From 3028a553bf4bc67f80e6ac075727a1e358cd1dbd Mon Sep 17 00:00:00 2001
From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Fri, 10 Sep 2004 19:18:39 +0000
Subject: [PATCH] LKCD 2.6 tree at
 :pserver:anonymous@cvs.sourceforge.net:/cvsroot/lkcd/2.6 as of 20040910
 ported to Linux 2.6.7

---
 CREDITS                                       |    14 +-
 Documentation/DocBook/kernel-hacking.tmpl     |    57 +-
 Documentation/DocBook/libata.tmpl             |    13 +-
 Documentation/DocBook/videobook.tmpl          |     4 -
 Documentation/SubmittingDrivers               |    13 +
 Documentation/SubmittingPatches               |    56 +
 Documentation/arm/memory.txt                  |    24 +-
 Documentation/cachetlb.txt                    |     8 +-
 Documentation/cdrom/cdrom-standard.tex        |     5 -
 Documentation/cpu-freq/core.txt               |     4 +
 Documentation/fb/framebuffer.txt              |     2 +-
 Documentation/fb/vesafb.txt                   |     4 +
 Documentation/filesystems/Exporting           |    24 +-
 Documentation/filesystems/Locking             |    30 +-
 Documentation/filesystems/befs.txt            |     6 +-
 Documentation/filesystems/ntfs.txt            |    25 +
 Documentation/filesystems/proc.txt            |    31 +-
 Documentation/i2c/i2c-old-porting             |    18 +-
 Documentation/i2c/porting-clients             |     4 +-
 Documentation/ide.txt                         |     7 +
 Documentation/initrd.txt                      |     4 +-
 Documentation/isdn/INTERFACE                  |    24 -
 Documentation/kernel-parameters.txt           |     4 +-
 Documentation/laptop-mode.txt                 |    66 +-
 Documentation/md.txt                          |    23 +-
 Documentation/networking/bridge.txt           |    15 +-
 Documentation/networking/ip-sysctl.txt        |     5 +
 Documentation/networking/packet_mmap.txt      |    13 -
 Documentation/power/swsusp.txt                |    79 +-
 Documentation/power/tricks.txt                |     2 +
 Documentation/power/video.txt                 |     4 +
 Documentation/scsi/00-INDEX                   |     2 +
 .../sound/alsa/ALSA-Configuration.txt         |    33 +-
 Documentation/sound/alsa/CMIPCI.txt           |     4 +-
 .../alsa/DocBook/writing-an-alsa-driver.tmpl  |   239 +-
 Documentation/sound/alsa/Procfile.txt         |     6 +
 Documentation/sound/oss/OPL3-SA               |     2 +-
 Documentation/sound/oss/VIBRA16               |    10 +-
 Documentation/usb/mtouchusb.txt               |    95 +-
 Documentation/vm/hugetlbpage.txt              |     9 +-
 Documentation/vm/locking                      |     2 +-
 MAINTAINERS                                   |    92 +-
 Makefile                                      |    36 +-
 arch/alpha/Kconfig                            |     4 +-
 arch/alpha/Makefile                           |     6 +-
 arch/alpha/kernel/core_cia.c                  |     2 +-
 arch/alpha/kernel/core_irongate.c             |     4 +-
 arch/alpha/kernel/core_marvel.c               |     2 +-
 arch/alpha/kernel/core_titan.c                |     4 +-
 arch/alpha/kernel/core_wildfire.c             |     4 +-
 arch/alpha/kernel/err_marvel.c                |     3 +-
 arch/alpha/kernel/err_titan.c                 |     6 +-
 arch/alpha/kernel/irq.c                       |     6 +-
 arch/alpha/kernel/machvec_impl.h              |     4 +-
 arch/alpha/kernel/module.c                    |     4 +
 arch/alpha/kernel/osf_sys.c                   |   170 +-
 arch/alpha/kernel/process.c                   |    16 +-
 arch/alpha/kernel/semaphore.c                 |     8 +-
 arch/alpha/kernel/setup.c                     |     6 +-
 arch/alpha/kernel/signal.c                    |    29 +-
 arch/alpha/kernel/smp.c                       |     7 +-
 arch/alpha/kernel/srm_env.c                   |     2 +-
 arch/alpha/kernel/sys_eiger.c                 |    33 +-
 arch/alpha/kernel/sys_ruffian.c               |     7 +-
 arch/alpha/kernel/sys_sx164.c                 |     2 +-
 arch/alpha/kernel/sys_takara.c                |     6 +-
 arch/alpha/kernel/systbls.S                   |     2 +-
 arch/alpha/kernel/time.c                      |     8 +-
 arch/alpha/lib/csum_partial_copy.c            |    17 +-
 arch/alpha/math-emu/Makefile                  |     4 +-
 arch/alpha/math-emu/math.c                    |    14 +-
 arch/alpha/mm/fault.c                         |     2 +-
 arch/alpha/mm/init.c                          |    12 +-
 arch/alpha/mm/numa.c                          |     2 +-
 arch/arm/Kconfig                              |    39 +-
 arch/arm/Makefile                             |     1 +
 arch/arm/boot/Makefile                        |     2 +
 arch/arm/boot/compressed/head.S               |    22 +-
 arch/arm/common/dmabounce.c                   |     3 +-
 arch/arm/configs/ebsa110_defconfig            |   587 +-
 arch/arm/configs/lpd7a400_defconfig           |   100 +-
 arch/arm/configs/lpd7a404_defconfig           |    83 +-
 arch/arm/kernel/arch.c                        |     1 -
 arch/arm/kernel/armksyms.c                    |    81 +-
 arch/arm/kernel/bios32.c                      |    28 +
 arch/arm/kernel/debug.S                       |    52 +-
 arch/arm/kernel/entry-armv.S                  |    45 +-
 arch/arm/kernel/irq.c                         |    10 +-
 arch/arm/kernel/process.c                     |    22 +-
 arch/arm/kernel/ptrace.c                      |     2 +-
 arch/arm/kernel/semaphore.c                   |     5 +
 arch/arm/kernel/setup.c                       |    14 +
 arch/arm/kernel/signal.c                      |    22 +-
 arch/arm/kernel/sys_arm.c                     |    41 +
 arch/arm/kernel/traps.c                       |     5 +
 arch/arm/lib/Makefile                         |     1 -
 arch/arm/lib/io-acorn.S                       |    25 -
 arch/arm/mach-adifcc/irq.c                    |     2 -
 arch/arm/mach-clps711x/Kconfig                |     9 +-
 arch/arm/mach-clps711x/clep7312.c             |     1 -
 arch/arm/mach-clps711x/fortunet.c             |    17 +-
 arch/arm/mach-ebsa110/io.c                    |    38 +-
 arch/arm/mach-epxa10db/Kconfig                |     6 +-
 arch/arm/mach-footbridge/Kconfig              |     7 +-
 arch/arm/mach-footbridge/mm.c                 |     2 +
 arch/arm/mach-integrator/Kconfig              |     5 +-
 arch/arm/mach-integrator/core.c               |     2 +-
 arch/arm/mach-integrator/cpu.c                |    20 +-
 arch/arm/mach-iop3xx/Kconfig                  |    11 +-
 arch/arm/mach-iop3xx/iop310-irq.c             |     2 -
 arch/arm/mach-iop3xx/iop321-time.c            |     1 -
 arch/arm/mach-iop3xx/iq80310-irq.c            |     2 -
 arch/arm/mach-iop3xx/iq80310-time.c           |     1 -
 arch/arm/mach-iop3xx/mm-321.c                 |     1 -
 arch/arm/mach-iop3xx/mm.c                     |     1 -
 arch/arm/mach-iop3xx/xs80200-irq.c            |     2 -
 arch/arm/mach-ixp4xx/Kconfig                  |     9 +-
 arch/arm/mach-lh7a40x/Kconfig                 |    10 +-
 arch/arm/mach-lh7a40x/arch-lpd7a40x.c         |    11 +-
 arch/arm/mach-omap/Kconfig                    |    10 +-
 arch/arm/mach-omap/board-generic.c            |     5 +-
 arch/arm/mach-omap/board-innovator.c          |    17 +-
 arch/arm/mach-omap/board-osk.c                |     3 +-
 arch/arm/mach-omap/board-perseus2.c           |     8 +-
 arch/arm/mach-omap/bus.c                      |     2 +-
 arch/arm/mach-omap/clocks.c                   |    22 +-
 arch/arm/mach-omap/common.c                   |    65 +-
 arch/arm/mach-omap/dma.c                      |   317 +-
 arch/arm/mach-omap/fpga.c                     |    28 +-
 arch/arm/mach-omap/gpio.c                     |    87 +-
 arch/arm/mach-omap/irq.c                      |   251 +-
 arch/arm/mach-omap/leds-perseus2.c            |     2 +-
 arch/arm/mach-omap/ocpi.c                     |     8 -
 arch/arm/mach-pxa/Kconfig                     |    28 +-
 arch/arm/mach-pxa/Makefile                    |     4 +
 arch/arm/mach-pxa/dma.c                       |     6 +-
 arch/arm/mach-pxa/generic.c                   |   124 +-
 arch/arm/mach-pxa/idp.c                       |     2 +
 arch/arm/mach-pxa/leds-idp.c                  |     2 +
 arch/arm/mach-pxa/leds-lubbock.c              |     7 +-
 arch/arm/mach-pxa/leds-mainstone.c            |     2 +
 arch/arm/mach-pxa/leds.c                      |     2 +
 arch/arm/mach-pxa/leds.h                      |     3 +-
 arch/arm/mach-pxa/lubbock.c                   |    35 +-
 arch/arm/mach-pxa/mainstone.c                 |     2 +
 arch/arm/mach-pxa/pm.c                        |    52 +-
 arch/arm/mach-pxa/pxa25x.c                    |    15 +-
 arch/arm/mach-pxa/pxa27x.c                    |   102 +-
 arch/arm/mach-s3c2410/Kconfig                 |    13 +-
 arch/arm/mach-s3c2410/Makefile                |     1 +
 arch/arm/mach-s3c2410/s3c2410.c               |     1 -
 arch/arm/mach-sa1100/Kconfig                  |    36 +-
 arch/arm/mach-sa1100/cpu-sa1100.c             |     9 +-
 arch/arm/mach-sa1100/cpu-sa1110.c             |    10 +-
 arch/arm/mach-sa1100/generic.c                |     6 +-
 arch/arm/mach-sa1100/generic.h                |     2 +-
 arch/arm/mach-versatile/core.c                |     1 +
 arch/arm/mm/Kconfig                           |     2 +-
 arch/arm/mm/blockops.c                        |     2 +-
 arch/arm/mm/cache-v6.S                        |     2 +
 arch/arm/mm/fault-armv.c                      |    74 +-
 arch/arm/mm/fault.c                           |     2 +-
 arch/arm/mm/init.c                            |    42 +-
 arch/arm/mm/ioremap.c                         |     3 +
 arch/arm/mm/mm-armv.c                         |    29 +-
 arch/arm/mm/mmap.c                            |     2 +-
 arch/arm/mm/proc-syms.c                       |     3 -
 arch/arm/mm/proc-xscale.S                     |    27 +-
 arch/arm/tools/mach-types                     |    17 +-
 arch/arm26/kernel/process.c                   |     8 +-
 arch/cris/Kconfig                             |    76 +-
 arch/cris/Makefile                            |    12 +-
 arch/cris/arch-v10/boot/compressed/misc.c     |     4 +-
 arch/cris/arch-v10/defconfig                  |     1 +
 arch/cris/arch-v10/drivers/Kconfig            |   216 +-
 arch/cris/arch-v10/drivers/Makefile           |     2 +
 arch/cris/arch-v10/drivers/axisflashmap.c     |    61 +-
 arch/cris/arch-v10/drivers/ds1302.c           |    94 +-
 arch/cris/arch-v10/drivers/eeprom.c           |     7 +-
 arch/cris/arch-v10/drivers/ethernet.c         |   307 +-
 arch/cris/arch-v10/drivers/gpio.c             |    84 +-
 arch/cris/arch-v10/drivers/i2c.c              |    78 +-
 arch/cris/arch-v10/drivers/i2c.h              |     4 +-
 arch/cris/arch-v10/drivers/pcf8563.c          |    82 +-
 arch/cris/arch-v10/drivers/serial.c           |  1436 +-
 arch/cris/arch-v10/drivers/serial.h           |    20 +-
 arch/cris/arch-v10/kernel/debugport.c         |   152 +-
 arch/cris/arch-v10/kernel/entry.S             |    21 +-
 arch/cris/arch-v10/kernel/fasttimer.c         |    17 +-
 arch/cris/arch-v10/kernel/head.S              |    31 +-
 arch/cris/arch-v10/kernel/process.c           |    23 +-
 arch/cris/arch-v10/kernel/ptrace.c            |    59 +-
 arch/cris/arch-v10/kernel/setup.c             |     9 +-
 arch/cris/arch-v10/kernel/signal.c            |     4 +-
 arch/cris/arch-v10/kernel/time.c              |     8 +-
 arch/cris/arch-v10/lib/dram_init.S            |    10 +-
 arch/cris/arch-v10/lib/old_checksum.c         |     4 +-
 arch/cris/arch-v10/mm/fault.c                 |    36 +-
 arch/cris/arch-v10/mm/tlb.c                   |     2 +-
 arch/cris/defconfig                           |   583 +-
 arch/cris/kernel/Makefile                     |     6 +-
 arch/cris/kernel/irq.c                        |    21 +-
 arch/cris/kernel/module.c                     |    25 +-
 arch/cris/kernel/process.c                    |    26 +-
 arch/cris/kernel/setup.c                      |    21 +-
 arch/cris/kernel/sys_cris.c                   |     2 +-
 arch/cris/kernel/time.c                       |    74 +-
 arch/cris/kernel/traps.c                      |     3 +-
 arch/cris/mm/fault.c                          |    26 +-
 arch/cris/mm/init.c                           |    25 +-
 arch/cris/mm/ioremap.c                        |    25 -
 arch/h8300/Kconfig                            |   117 +-
 arch/h8300/Kconfig.ide                        |    29 +-
 arch/h8300/Makefile                           |     9 +-
 arch/h8300/kernel/Makefile                    |     5 +-
 arch/h8300/kernel/h8300_ksyms.c               |    15 +-
 arch/h8300/kernel/process.c                   |    21 +-
 arch/h8300/kernel/setup.c                     |    25 +-
 arch/h8300/kernel/signal.c                    |     4 +
 arch/h8300/kernel/syscalls.S                  |    35 +-
 arch/h8300/kernel/traps.c                     |     6 +
 arch/h8300/kernel/vmlinux.lds.S               |    18 +
 arch/h8300/mm/init.c                          |     6 +-
 .../platform/h8300h/aki3068net/crt0_ram.S     |     2 +-
 arch/h8300/platform/h8300h/aki3068net/timer.c |    15 +-
 arch/h8300/platform/h8300h/entry.S            |    79 +-
 arch/h8300/platform/h8300h/generic/timer.c    |    49 +-
 arch/h8300/platform/h8300h/h8max/crt0_ram.S   |     2 +-
 arch/h8300/platform/h8300h/h8max/timer.c      |    15 +-
 arch/h8300/platform/h8300h/ptrace_h8300h.c    |     6 +-
 arch/h8300/platform/h8s/edosk2674/timer.c     |    31 +-
 arch/h8300/platform/h8s/entry.S               |    81 +-
 arch/h8300/platform/h8s/generic/timer.c       |    24 +-
 arch/i386/Kconfig                             |    73 +-
 arch/i386/Makefile                            |     6 +-
 arch/i386/boot/Makefile                       |     1 +
 arch/i386/boot/setup.S                        |    89 +-
 arch/i386/boot98/setup.S                      |    87 +-
 arch/i386/defconfig                           |    93 +-
 arch/i386/kernel/acpi/boot.c                  |    52 +-
 arch/i386/kernel/acpi/wakeup.S                |     1 +
 arch/i386/kernel/asm-offsets.c                |    52 +-
 arch/i386/kernel/cpu/common.c                 |    49 +-
 arch/i386/kernel/cpu/cpu.h                    |     3 +
 arch/i386/kernel/cpu/cpufreq/Makefile         |     4 +-
 arch/i386/kernel/cpu/cpufreq/elanfreq.c       |    12 +-
 arch/i386/kernel/cpu/cpufreq/gx-suspmod.c     |    14 +-
 arch/i386/kernel/cpu/cpufreq/longhaul.c       |   196 +-
 arch/i386/kernel/cpu/cpufreq/longhaul.h       |   167 +-
 arch/i386/kernel/cpu/cpufreq/longrun.c        |    41 +-
 arch/i386/kernel/cpu/cpufreq/p4-clockmod.c    |   152 +-
 arch/i386/kernel/cpu/cpufreq/powernow-k6.c    |     6 +
 arch/i386/kernel/cpu/cpufreq/powernow-k7.c    |    46 +-
 arch/i386/kernel/cpu/cpufreq/powernow-k8.c    |   103 +-
 arch/i386/kernel/cpu/cpufreq/powernow-k8.h    |    18 +-
 .../kernel/cpu/cpufreq/speedstep-centrino.c   |   124 +-
 arch/i386/kernel/cpu/cpufreq/speedstep-ich.c  |    77 +-
 arch/i386/kernel/cpu/cpufreq/speedstep-lib.c  |    17 +-
 arch/i386/kernel/cpu/cpufreq/speedstep-lib.h  |     2 +-
 arch/i386/kernel/cpu/cpufreq/speedstep-smi.c  |    54 +-
 arch/i386/kernel/cpu/intel.c                  |    48 +-
 arch/i386/kernel/cpu/mcheck/p4.c              |    30 +-
 arch/i386/kernel/cpuid.c                      |   172 +-
 arch/i386/kernel/dmi_scan.c                   |     1 +
 arch/i386/kernel/entry.S                      |    43 +-
 arch/i386/kernel/head.S                       |    17 +-
 arch/i386/kernel/i386_ksyms.c                 |    19 +
 arch/i386/kernel/i387.c                       |     4 +-
 arch/i386/kernel/io_apic.c                    |    23 +-
 arch/i386/kernel/irq.c                        |     4 +-
 arch/i386/kernel/mca.c                        |    12 +-
 arch/i386/kernel/microcode.c                  |     6 +-
 arch/i386/kernel/mpparse.c                    |     8 +-
 arch/i386/kernel/msr.c                        |   325 +-
 arch/i386/kernel/nmi.c                        |    19 +-
 arch/i386/kernel/process.c                    |    15 +-
 arch/i386/kernel/ptrace.c                     |    35 +-
 arch/i386/kernel/scx200.c                     |     5 +-
 arch/i386/kernel/setup.c                      |    13 +
 arch/i386/kernel/signal.c                     |    35 +-
 arch/i386/kernel/smp.c                        |    29 +-
 arch/i386/kernel/smpboot.c                    |   252 +-
 arch/i386/kernel/timers/timer_cyclone.c       |    12 +
 arch/i386/kernel/timers/timer_tsc.c           |    58 +-
 arch/i386/kernel/traps.c                      |    79 +-
 arch/i386/lib/getuser.S                       |     6 +-
 arch/i386/mach-default/topology.c             |     6 +-
 arch/i386/mach-es7000/Makefile                |     3 +-
 arch/i386/mach-es7000/es7000.h                |     3 +-
 arch/i386/mach-es7000/es7000plat.c            |     2 -
 arch/i386/mach-generic/Makefile               |    13 +-
 arch/i386/mach-generic/probe.c                |     2 +
 arch/i386/mach-voyager/voyager_smp.c          |     3 +
 arch/i386/mm/fault.c                          |     2 +-
 arch/i386/mm/hugetlbpage.c                    |     5 +-
 arch/i386/mm/init.c                           |    28 +
 arch/i386/mm/pageattr.c                       |     8 +-
 arch/i386/oprofile/op_model_p4.c              |     7 +-
 arch/i386/pci/fixup.c                         |    16 +-
 arch/i386/pci/irq.c                           |     7 +-
 arch/i386/power/pmdisk.S                      |     2 +-
 arch/i386/power/swsusp.S                      |     2 +-
 arch/ia64/Kconfig                             |     9 +
 arch/ia64/defconfig                           |    94 +-
 arch/ia64/dig/Makefile                        |     5 +
 arch/ia64/hp/sim/boot/boot_head.S             |    14 +-
 arch/ia64/ia32/Makefile                       |     4 +
 arch/ia64/ia32/binfmt_elf32.c                 |    32 +-
 arch/ia64/ia32/ia32_entry.S                   |     6 +-
 arch/ia64/ia32/ia32_signal.c                  |    19 +-
 arch/ia64/ia32/sys_ia32.c                     |   427 +-
 arch/ia64/kernel/Makefile                     |     3 +
 arch/ia64/kernel/acpi.c                       |    51 +-
 arch/ia64/kernel/efi.c                        |    27 +-
 arch/ia64/kernel/entry.S                      |    12 +-
 arch/ia64/kernel/fsys.S                       |    48 +-
 arch/ia64/kernel/gate.S                       |     6 +-
 arch/ia64/kernel/head.S                       |    61 +-
 arch/ia64/kernel/iosapic.c                    |    26 +-
 arch/ia64/kernel/irq.c                        |   119 +-
 arch/ia64/kernel/irq_ia64.c                   |    60 +-
 arch/ia64/kernel/ivt.S                        |    35 +
 arch/ia64/kernel/machvec.c                    |     2 +-
 arch/ia64/kernel/palinfo.c                    |   136 +-
 arch/ia64/kernel/perfmon.c                    |   549 +-
 arch/ia64/kernel/perfmon_generic.h            |    10 +-
 arch/ia64/kernel/perfmon_itanium.h            |    48 +-
 arch/ia64/kernel/perfmon_mckinley.h           |    45 +-
 arch/ia64/kernel/process.c                    |    53 +-
 arch/ia64/kernel/sal.c                        |    13 +
 arch/ia64/kernel/setup.c                      |    19 +-
 arch/ia64/kernel/signal.c                     |    17 -
 arch/ia64/kernel/smp.c                        |    30 +-
 arch/ia64/kernel/smpboot.c                    |   220 +-
 arch/ia64/kernel/time.c                       |    15 +-
 arch/ia64/kernel/traps.c                      |    23 -
 arch/ia64/kernel/unwind.c                     |    68 +-
 arch/ia64/kernel/unwind_i.h                   |     1 +
 arch/ia64/kernel/vmlinux.lds.S                |     5 +-
 arch/ia64/lib/Makefile                        |     2 +-
 arch/ia64/mm/hugetlbpage.c                    |     5 +-
 arch/ia64/mm/init.c                           |    12 +-
 arch/ia64/mm/tlb.c                            |     2 +-
 arch/ia64/pci/pci.c                           |     4 +-
 arch/ia64/scripts/toolchain-flags             |    10 +
 arch/ia64/sn/io/hwgfs/interface.c             |     2 +-
 arch/ia64/sn/io/io.c                          |     2 +-
 arch/ia64/sn/io/machvec/iomv.c                |     2 +-
 arch/ia64/sn/io/machvec/pci_bus_cvlink.c      |    33 +-
 arch/ia64/sn/io/platform_init/sgi_io_init.c   |     7 +-
 arch/ia64/sn/io/sn2/klgraph.c                 |    22 +-
 arch/ia64/sn/io/sn2/ml_SN_init.c              |     8 +-
 arch/ia64/sn/io/sn2/ml_SN_intr.c              |     8 +-
 arch/ia64/sn/io/sn2/ml_iograph.c              |     8 +-
 arch/ia64/sn/io/sn2/module.c                  |     4 +-
 arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c         |     6 +-
 arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c        |    50 +-
 arch/ia64/sn/io/sn2/pic.c                     |     4 +-
 arch/ia64/sn/io/sn2/shuberror.c               |     4 +-
 arch/ia64/sn/io/sn2/shubio.c                  |     4 +-
 arch/ia64/sn/kernel/setup.c                   |     6 +-
 arch/ia64/sn/kernel/sn2/prominfo_proc.c       |    13 +-
 arch/m68k/Kconfig                             |     8 +-
 arch/m68k/Makefile                            |     2 +-
 arch/m68k/amiga/amisound.c                    |     2 +-
 arch/m68k/amiga/chipram.c                     |     2 +-
 arch/m68k/amiga/config.c                      |    14 +-
 arch/m68k/apollo/config.c                     |    64 +-
 arch/m68k/apollo/dma.c                        |     2 +-
 arch/m68k/apollo/dn_debug.c                   |     4 +-
 arch/m68k/apollo/dn_ints.c                    |     4 +-
 arch/m68k/atari/ataints.c                     |    24 +-
 arch/m68k/atari/atasound.c                    |     2 +-
 arch/m68k/atari/config.c                      |    28 +-
 arch/m68k/atari/debug.c                       |    24 +-
 arch/m68k/atari/stdma.c                       |     2 +-
 arch/m68k/atari/stram.c                       |    40 +-
 arch/m68k/atari/time.c                        |    38 +-
 arch/m68k/bvme6000/rtc.c                      |     4 +-
 arch/m68k/defconfig                           |     2 +-
 arch/m68k/fpsp040/README                      |     4 +-
 arch/m68k/fpsp040/bindec.S                    |   116 +-
 arch/m68k/fpsp040/binstr.S                    |     4 +-
 arch/m68k/fpsp040/bugfix.S                    |    68 +-
 arch/m68k/fpsp040/decbin.S                    |    24 +-
 arch/m68k/fpsp040/do_func.S                   |    56 +-
 arch/m68k/fpsp040/fpsp.h                      |    26 +-
 arch/m68k/fpsp040/gen_except.S                |    78 +-
 arch/m68k/fpsp040/get_op.S                    |    82 +-
 arch/m68k/fpsp040/kernel_ex.S                 |    60 +-
 arch/m68k/fpsp040/res_func.S                  |   154 +-
 arch/m68k/fpsp040/round.S                     |   106 +-
 arch/m68k/fpsp040/sacos.S                     |    16 +-
 arch/m68k/fpsp040/sasin.S                     |    10 +-
 arch/m68k/fpsp040/satan.S                     |    22 +-
 arch/m68k/fpsp040/satanh.S                    |     8 +-
 arch/m68k/fpsp040/scale.S                     |    22 +-
 arch/m68k/fpsp040/scosh.S                     |     6 +-
 arch/m68k/fpsp040/setox.S                     |    28 +-
 arch/m68k/fpsp040/sgetem.S                    |    14 +-
 arch/m68k/fpsp040/sint.S                      |    30 +-
 arch/m68k/fpsp040/skeleton.S                  |    52 +-
 arch/m68k/fpsp040/slog2.S                     |    34 +-
 arch/m68k/fpsp040/slogn.S                     |    38 +-
 arch/m68k/fpsp040/smovecr.S                   |    12 +-
 arch/m68k/fpsp040/srem_mod.S                  |    18 +-
 arch/m68k/fpsp040/ssin.S                      |    26 +-
 arch/m68k/fpsp040/ssinh.S                     |     8 +-
 arch/m68k/fpsp040/stan.S                      |    58 +-
 arch/m68k/fpsp040/stanh.S                     |    10 +-
 arch/m68k/fpsp040/sto_res.S                   |     8 +-
 arch/m68k/fpsp040/stwotox.S                   |    28 +-
 arch/m68k/fpsp040/tbldo.S                     |    10 +-
 arch/m68k/fpsp040/util.S                      |    70 +-
 arch/m68k/fpsp040/x_bsun.S                    |     4 +-
 arch/m68k/fpsp040/x_fline.S                   |     8 +-
 arch/m68k/fpsp040/x_operr.S                   |    26 +-
 arch/m68k/fpsp040/x_ovfl.S                    |    16 +-
 arch/m68k/fpsp040/x_snan.S                    |    26 +-
 arch/m68k/fpsp040/x_store.S                   |    44 +-
 arch/m68k/fpsp040/x_unfl.S                    |    34 +-
 arch/m68k/fpsp040/x_unimp.S                   |     8 +-
 arch/m68k/fpsp040/x_unsupp.S                  |    18 +-
 arch/m68k/hp300/hp300map.map                  |    90 +-
 arch/m68k/hp300/ints.c                        |    16 +-
 arch/m68k/ifpsp060/CHANGES                    |    26 +-
 arch/m68k/ifpsp060/MISC                       |     6 +-
 arch/m68k/ifpsp060/README                     |     4 +-
 arch/m68k/ifpsp060/TEST.DOC                   |    14 +-
 arch/m68k/ifpsp060/fplsp.doc                  |     6 +-
 arch/m68k/ifpsp060/fpsp.doc                   |    20 +-
 arch/m68k/ifpsp060/fskeleton.S                |    26 +-
 arch/m68k/ifpsp060/ilsp.doc                   |    16 +-
 arch/m68k/ifpsp060/iskeleton.S                |    18 +-
 arch/m68k/ifpsp060/isp.doc                    |    18 +-
 arch/m68k/ifpsp060/os.S                       |    78 +-
 arch/m68k/ifpsp060/src/fplsp.S                |   358 +-
 arch/m68k/ifpsp060/src/fpsp.S                 |  1828 +--
 arch/m68k/ifpsp060/src/ftest.S                |    16 +-
 arch/m68k/ifpsp060/src/ilsp.S                 |   106 +-
 arch/m68k/ifpsp060/src/isp.S                  |   540 +-
 arch/m68k/ifpsp060/src/itest.S                |     8 +-
 arch/m68k/ifpsp060/src/pfpsp.S                |  1304 +-
 arch/m68k/kernel/bios32.c                     |     2 +-
 arch/m68k/kernel/entry.S                      |    30 +-
 arch/m68k/kernel/head.S                       |     6 +-
 arch/m68k/kernel/process.c                    |    11 +-
 arch/m68k/kernel/ptrace.c                     |    14 +-
 arch/m68k/kernel/setup.c                      |    30 +-
 arch/m68k/kernel/signal.c                     |    10 +-
 arch/m68k/kernel/sun3-head.S                  |    28 +-
 arch/m68k/kernel/sys_m68k.c                   |    10 +-
 arch/m68k/kernel/traps.c                      |    27 +-
 arch/m68k/kernel/vmlinux-std.lds              |    14 +-
 arch/m68k/kernel/vmlinux-sun3.lds             |    28 +-
 arch/m68k/lib/ashldi3.c                       |     2 +-
 arch/m68k/lib/ashrdi3.c                       |     2 +-
 arch/m68k/lib/lshrdi3.c                       |     2 +-
 arch/m68k/lib/muldi3.c                        |     4 +-
 arch/m68k/mac/baboon.c                        |     6 +-
 arch/m68k/mac/bootparse.c                     |   178 +-
 arch/m68k/mac/config.c                        |    64 +-
 arch/m68k/mac/debug.c                         |    24 +-
 arch/m68k/mac/iop.c                           |    18 +-
 arch/m68k/mac/macboing.c                      |    76 +-
 arch/m68k/mac/macints.c                       |    14 +-
 arch/m68k/mac/misc.c                          |    12 +-
 arch/m68k/mac/oss.c                           |    10 +-
 arch/m68k/mac/psc.c                           |     6 +-
 arch/m68k/mac/via.c                           |    18 +-
 arch/m68k/math-emu/fp_arith.c                 |     2 +-
 arch/m68k/math-emu/fp_cond.S                  |     8 +-
 arch/m68k/math-emu/fp_log.c                   |     4 +-
 arch/m68k/math-emu/fp_scan.S                  |     8 +-
 arch/m68k/math-emu/fp_util.S                  |     2 +-
 arch/m68k/mm/fault.c                          |     4 +-
 arch/m68k/mm/hwtest.c                         |    10 +-
 arch/m68k/mm/init.c                           |     2 +-
 arch/m68k/mm/memory.c                         |     6 +-
 arch/m68k/mm/motorola.c                       |     6 +-
 arch/m68k/mm/sun3kmap.c                       |    30 +-
 arch/m68k/mm/sun3mmu.c                        |     8 +-
 arch/m68k/mvme147/config.c                    |    14 +-
 arch/m68k/mvme16x/mvme16x_ksyms.c             |     2 +-
 arch/m68k/mvme16x/rtc.c                       |     4 +-
 arch/m68k/q40/Makefile                        |     2 +-
 arch/m68k/q40/README                          |    48 +-
 arch/m68k/q40/config.c                        |    18 +-
 arch/m68k/q40/q40ints.c                       |    40 +-
 arch/m68k/sun3/config.c                       |    30 +-
 arch/m68k/sun3/dvma.c                         |     8 +-
 arch/m68k/sun3/idprom.c                       |     4 +-
 arch/m68k/sun3/intersil.c                     |     2 +-
 arch/m68k/sun3/leds.c                         |     4 +-
 arch/m68k/sun3/mmu_emu.c                      |    40 +-
 arch/m68k/sun3/prom/init.c                    |     2 +-
 arch/m68k/sun3/sun3dvma.c                     |    66 +-
 arch/m68k/sun3/sun3ints.c                     |    30 +-
 arch/m68k/sun3x/config.c                      |    12 +-
 arch/m68k/sun3x/dvma.c                        |    44 +-
 arch/m68k/sun3x/prom.c                        |     6 +-
 arch/m68k/sun3x/time.c                        |    10 +-
 arch/m68knommu/kernel/comempci.c              |     4 +-
 arch/m68knommu/kernel/m68k_ksyms.c            |    18 -
 arch/m68knommu/kernel/process.c               |    11 +-
 arch/mips/Kconfig                             |    80 +-
 arch/mips/Makefile                            |     8 +-
 arch/mips/au1000/common/Makefile              |     2 +-
 arch/mips/au1000/common/power.c               |     2 +-
 arch/mips/au1000/common/setup.c               |    37 +-
 arch/mips/configs/atlas_defconfig             |    64 +-
 arch/mips/configs/bosporus_defconfig          |    60 +-
 arch/mips/configs/capcella_defconfig          |    65 +-
 arch/mips/configs/cobalt_defconfig            |    64 +-
 arch/mips/configs/db1000_defconfig            |    60 +-
 arch/mips/configs/db1100_defconfig            |    60 +-
 arch/mips/configs/db1500_defconfig            |    60 +-
 arch/mips/configs/ddb5476_defconfig           |    64 +-
 arch/mips/configs/ddb5477_defconfig           |    64 +-
 arch/mips/configs/decstation_defconfig        |    44 +-
 arch/mips/configs/e55_defconfig               |    57 +-
 arch/mips/configs/eagle_defconfig             |    66 +-
 arch/mips/configs/ev64120_defconfig           |    72 +-
 arch/mips/configs/ev96100_defconfig           |    44 +-
 arch/mips/configs/ip22_defconfig              |    47 +-
 arch/mips/configs/ip27_defconfig              |   135 +-
 arch/mips/configs/ip32_defconfig              |    64 +-
 arch/mips/configs/it8172_defconfig            |    44 +-
 arch/mips/configs/ivr_defconfig               |    64 +-
 arch/mips/configs/jaguar-atx_defconfig        |    52 +-
 arch/mips/configs/jmr3927_defconfig           |    64 +-
 arch/mips/configs/lasat200_defconfig          |    62 +-
 arch/mips/configs/malta_defconfig             |    64 +-
 arch/mips/configs/mirage_defconfig            |    60 +-
 arch/mips/configs/mpc30x_defconfig            |    89 +-
 arch/mips/configs/mtx1_defconfig              |    60 +-
 arch/mips/configs/ocelot_c_defconfig          |    44 +-
 arch/mips/configs/ocelot_defconfig            |    44 +-
 arch/mips/configs/osprey_defconfig            |    44 +-
 arch/mips/configs/pb1000_defconfig            |    60 +-
 arch/mips/configs/pb1100_defconfig            |    60 +-
 arch/mips/configs/pb1500_defconfig            |    78 +-
 arch/mips/configs/pb1550_defconfig            |    78 +-
 arch/mips/configs/rm200_defconfig             |   125 +-
 arch/mips/configs/sb1250-swarm_defconfig      |    65 +-
 arch/mips/configs/sead_defconfig              |     9 +-
 arch/mips/configs/tb0226_defconfig            |    58 +-
 arch/mips/configs/tb0229_defconfig            |    73 +-
 arch/mips/configs/workpad_defconfig           |    58 +-
 arch/mips/configs/xxs1500_defconfig           |    60 +-
 arch/mips/configs/yosemite_defconfig          |    45 +-
 arch/mips/defconfig                           |    47 +-
 arch/mips/gt64120/momenco_ocelot/prom.c       |    12 +-
 arch/mips/kernel/entry.S                      |     4 +-
 arch/mips/kernel/irixelf.c                    |     2 +-
 arch/mips/kernel/irixsig.c                    |    21 +-
 arch/mips/kernel/linux32.c                    |   533 +-
 arch/mips/kernel/mips_ksyms.c                 |     3 +
 arch/mips/kernel/process.c                    |    10 +-
 arch/mips/kernel/ptrace.c                     |    11 +-
 arch/mips/kernel/scall32-o32.S                |    19 +-
 arch/mips/kernel/scall64-64.S                 |    23 +-
 arch/mips/kernel/scall64-n32.S                |    28 +-
 arch/mips/kernel/scall64-o32.S                |    24 +-
 arch/mips/kernel/signal.c                     |    19 +-
 arch/mips/kernel/signal32.c                   |    20 +-
 arch/mips/kernel/signal_n32.c                 |     1 +
 arch/mips/kernel/smp.c                        |     3 +
 arch/mips/kernel/sysirix.c                    |     2 +-
 arch/mips/mm/init.c                           |     2 +-
 arch/mips/momentum/jaguar_atx/prom.c          |    12 +-
 arch/mips/momentum/ocelot_c/prom.c            |    12 +-
 arch/mips/momentum/ocelot_g/prom.c            |    12 +-
 arch/mips/pci/fixup-au1000.c                  |    66 +-
 arch/mips/pci/ops-au1000.c                    |   177 +-
 arch/mips/sgi-ip27/ip27-hubio.c               |     6 +-
 arch/mips/vr41xx/casio-e55/setup.c            |     3 +-
 arch/mips/vr41xx/common/icu.c                 |    56 +-
 arch/mips/vr41xx/common/serial.c              |    85 +-
 arch/mips/vr41xx/ibm-workpad/setup.c          |     3 +-
 arch/mips/vr41xx/nec-eagle/setup.c            |     3 +-
 arch/mips/vr41xx/tanbac-tb0226/setup.c        |     5 +-
 arch/mips/vr41xx/tanbac-tb0229/setup.c        |     5 +-
 arch/mips/vr41xx/victor-mpc30x/setup.c        |     3 +-
 arch/mips/vr41xx/zao-capcella/setup.c         |     3 +-
 arch/parisc/Kconfig                           |    51 +-
 arch/parisc/Makefile                          |     3 +-
 arch/parisc/configs/712_defconfig             |    22 +-
 arch/parisc/configs/a500_defconfig            |    35 +-
 arch/parisc/configs/b180_defconfig            |    27 +-
 arch/parisc/configs/c3000_defconfig           |    31 +-
 arch/parisc/kernel/Makefile                   |     2 +-
 arch/parisc/kernel/asm-offsets.c              |    15 +
 arch/parisc/kernel/cache.c                    |    72 +-
 arch/parisc/kernel/entry.S                    |   855 +-
 arch/parisc/kernel/firmware.c                 |    62 +-
 arch/parisc/kernel/hardware.c                 |     7 +-
 arch/parisc/kernel/head.S                     |    22 +-
 arch/parisc/kernel/head64.S                   |    31 +-
 arch/parisc/kernel/init_task.c                |     8 +-
 arch/parisc/kernel/pacache.S                  |    96 +-
 arch/parisc/kernel/pci-dma.c                  |     8 +-
 arch/parisc/kernel/perf.c                     |     6 +-
 arch/parisc/kernel/process.c                  |    27 +
 arch/parisc/kernel/processor.c                |     5 +-
 arch/parisc/kernel/real2.S                    |     3 +-
 arch/parisc/kernel/setup.c                    |     8 +-
 arch/parisc/kernel/signal.c                   |    25 +-
 arch/parisc/kernel/smp.c                      |   173 +-
 arch/parisc/kernel/sys_parisc.c               |    20 +-
 arch/parisc/kernel/sys_parisc32.c             |   539 +-
 arch/parisc/kernel/syscall.S                  |     5 +-
 arch/parisc/kernel/syscall_table.S            |    17 +-
 arch/parisc/kernel/vmlinux.lds.S              |    19 +-
 arch/parisc/lib/bitops.c                      |    26 +-
 arch/parisc/mm/init.c                         |     9 +-
 arch/ppc/4xx_io/serial_sicc.c                 |    10 +-
 arch/ppc/8260_io/enet.c                       |     2 +-
 arch/ppc/8260_io/fcc_enet.c                   |    57 +-
 arch/ppc/8260_io/uart.c                       |    14 +-
 arch/ppc/8xx_io/commproc.c                    |     4 +-
 arch/ppc/8xx_io/cs4218_tdm.c                  |    13 +-
 arch/ppc/8xx_io/uart.c                        |    11 +-
 arch/ppc/Kconfig                              |    37 +-
 arch/ppc/Makefile                             |     5 +-
 arch/ppc/boot/Makefile                        |     6 +-
 arch/ppc/boot/openfirmware/Makefile           |    21 +-
 arch/ppc/boot/simple/Makefile                 |    12 +-
 arch/ppc/boot/simple/embed_config.c           |    90 +-
 arch/ppc/configs/ash_defconfig                |   338 +-
 arch/ppc/configs/common_defconfig             |   687 +-
 arch/ppc/configs/cpci405_defconfig            |   168 +-
 arch/ppc/configs/ebony_defconfig              |    68 +-
 arch/ppc/configs/ep405_defconfig              |   232 +-
 arch/ppc/configs/ibmchrp_defconfig            |   318 +-
 arch/ppc/configs/lopec_defconfig              |   567 +-
 arch/ppc/configs/ocotea_defconfig             |   146 +-
 arch/ppc/configs/pmac_defconfig               |   799 +-
 arch/ppc/configs/power3_defconfig             |   613 +-
 arch/ppc/configs/redwood5_defconfig           |   145 +-
 arch/ppc/configs/redwood6_defconfig           |   132 +-
 arch/ppc/configs/sandpoint_defconfig          |   553 +-
 arch/ppc/configs/spruce_defconfig             |    89 +-
 arch/ppc/configs/sycamore_defconfig           |   304 +-
 arch/ppc/configs/walnut_defconfig             |    76 +-
 arch/ppc/defconfig                            |   693 +-
 arch/ppc/kernel/Makefile                      |     3 +-
 arch/ppc/kernel/cputable.c                    |    22 +-
 arch/ppc/kernel/entry.S                       |   152 +-
 arch/ppc/kernel/head.S                        |    22 +-
 arch/ppc/kernel/head_44x.S                    |   361 +-
 arch/ppc/kernel/head_4xx.S                    |     7 +-
 arch/ppc/kernel/irq.c                         |     4 +-
 arch/ppc/kernel/misc.S                        |    31 +-
 arch/ppc/kernel/pci.c                         |    19 +-
 arch/ppc/kernel/ppc_htab.c                    |    16 +-
 arch/ppc/kernel/ppc_ksyms.c                   |    16 +-
 arch/ppc/kernel/process.c                     |    12 +-
 arch/ppc/kernel/setup.c                       |     7 +
 arch/ppc/kernel/smp.c                         |     2 +
 arch/ppc/kernel/traps.c                       |    77 +-
 arch/ppc/lib/locks.c                          |    25 +-
 arch/ppc/lib/string.S                         |    62 +-
 arch/ppc/mm/Makefile                          |     1 -
 arch/ppc/mm/fault.c                           |    44 +-
 arch/ppc/mm/init.c                            |    14 +-
 arch/ppc/mm/mem_pieces.c                      |    17 -
 arch/ppc/mm/mem_pieces.h                      |     2 -
 arch/ppc/mm/pgtable.c                         |    28 +-
 arch/ppc/mm/tlb.c                             |    11 +
 arch/ppc/platforms/4xx/Kconfig                |    17 +-
 arch/ppc/platforms/4xx/Makefile               |     6 +-
 arch/ppc/platforms/4xx/ash.c                  |     8 +-
 arch/ppc/platforms/4xx/ash.h                  |     1 -
 arch/ppc/platforms/4xx/cpci405.c              |     4 +
 arch/ppc/platforms/4xx/ebony.c                |    24 +-
 arch/ppc/platforms/4xx/ebony.h                |     2 -
 arch/ppc/platforms/4xx/ep405.c                |     3 +
 arch/ppc/platforms/4xx/ibm405gp.c             |   115 +-
 arch/ppc/platforms/4xx/ibm405gp.h             |    21 +-
 arch/ppc/platforms/4xx/ibm405gpr.c            |    99 +-
 arch/ppc/platforms/4xx/ibm405gpr.h            |    17 +-
 arch/ppc/platforms/4xx/ibm440gp.c             |   146 +-
 arch/ppc/platforms/4xx/ibm440gp.h             |    42 +-
 arch/ppc/platforms/4xx/ibm440gx.c             |   220 +-
 arch/ppc/platforms/4xx/ibm440gx.h             |    53 +-
 arch/ppc/platforms/4xx/ibmnp405h.c            |   168 +-
 arch/ppc/platforms/4xx/ibmnp405h.h            |    23 -
 arch/ppc/platforms/4xx/ibmstb4.c              |    82 +-
 arch/ppc/platforms/4xx/ibmstb4.h              |     1 -
 arch/ppc/platforms/4xx/ibmstbx25.c            |    57 +-
 arch/ppc/platforms/4xx/ocotea.c               |    76 +-
 arch/ppc/platforms/4xx/ocotea.h               |    11 +-
 arch/ppc/platforms/4xx/redwood5.c             |     2 -
 arch/ppc/platforms/4xx/sycamore.c             |    17 +-
 arch/ppc/platforms/4xx/walnut.c               |     3 +
 arch/ppc/platforms/Makefile                   |     1 +
 arch/ppc/platforms/pmac_feature.c             |     2 +-
 arch/ppc/platforms/pmac_pic.c                 |     6 +-
 arch/ppc/platforms/pmac_setup.c               |    16 +-
 arch/ppc/syslib/Makefile                      |    10 +-
 arch/ppc/syslib/ibm440gp_common.c             |     6 +-
 arch/ppc/syslib/ibm440gp_common.h             |    16 +-
 arch/ppc/syslib/m8xx_setup.c                  |     7 +-
 arch/ppc/syslib/ppc405_pci.c                  |     8 -
 arch/ppc/syslib/ppc4xx_pic.c                  |   150 +-
 arch/ppc/syslib/ppc8xx_pic.h                  |     1 +
 arch/ppc/syslib/prom_init.c                   |     3 +-
 arch/ppc64/Kconfig                            |    40 +
 arch/ppc64/Makefile                           |     5 +-
 arch/ppc64/configs/iSeries_defconfig          |   138 +-
 arch/ppc64/kernel/HvLpEvent.c                 |     3 +
 arch/ppc64/kernel/align.c                     |    15 +-
 arch/ppc64/kernel/asm-offsets.c               |     1 -
 arch/ppc64/kernel/cpu_setup_power4.S          |     8 +-
 arch/ppc64/kernel/eeh.c                       |    51 +-
 arch/ppc64/kernel/head.S                      |    34 +-
 arch/ppc64/kernel/iSeries_setup.c             |    14 +-
 arch/ppc64/kernel/ioctl32.c                   |   312 -
 arch/ppc64/kernel/iommu.c                     |     2 +-
 arch/ppc64/kernel/irq.c                       |    94 +-
 arch/ppc64/kernel/mf_proc.c                   |     6 +-
 arch/ppc64/kernel/misc.S                      |    54 +-
 arch/ppc64/kernel/module.c                    |    13 +
 arch/ppc64/kernel/pSeries_nvram.c             |     2 +-
 arch/ppc64/kernel/pacaData.c                  |     5 +-
 arch/ppc64/kernel/pmac_feature.c              |     4 +
 arch/ppc64/kernel/process.c                   |    91 +-
 arch/ppc64/kernel/prom.c                      |    87 +-
 arch/ppc64/kernel/ptrace.c                    |    12 +-
 arch/ppc64/kernel/ptrace32.c                  |    24 +-
 arch/ppc64/kernel/rtas-proc.c                 |     4 +-
 arch/ppc64/kernel/rtas.c                      |    18 +-
 arch/ppc64/kernel/rtas_flash.c                |     2 +-
 arch/ppc64/kernel/rtasd.c                     |     4 +-
 arch/ppc64/kernel/setup.c                     |    35 +-
 arch/ppc64/kernel/signal.c                    |    40 +-
 arch/ppc64/kernel/signal32.c                  |    85 +-
 arch/ppc64/kernel/smp.c                       |   248 +-
 arch/ppc64/kernel/stab.c                      |    44 +-
 arch/ppc64/kernel/sys_ppc32.c                 |  1584 +-
 arch/ppc64/kernel/syscalls.c                  |    34 +-
 arch/ppc64/kernel/sysfs.c                     |    11 +
 arch/ppc64/kernel/time.c                      |     8 +-
 arch/ppc64/kernel/traps.c                     |    23 +-
 arch/ppc64/kernel/vio.c                       |    36 +-
 arch/ppc64/kernel/viopath.c                   |    11 +-
 arch/ppc64/kernel/xics.c                      |     4 +-
 arch/ppc64/lib/Makefile                       |     5 +
 arch/ppc64/mm/fault.c                         |     2 +-
 arch/ppc64/mm/hugetlbpage.c                   |     8 +-
 arch/ppc64/mm/init.c                          |     2 +-
 arch/ppc64/mm/numa.c                          |   260 +-
 arch/ppc64/mm/tlb.c                           |     4 +-
 arch/ppc64/oprofile/common.c                  |     2 +
 arch/ppc64/oprofile/op_model_power4.c         |    21 +-
 arch/ppc64/xmon/ppc-dis.c                     |   194 +-
 arch/ppc64/xmon/ppc-opc.c                     |  5048 +++++--
 arch/ppc64/xmon/ppc.h                         |    87 +-
 arch/ppc64/xmon/xmon.c                        |  1389 +-
 arch/s390/appldata/appldata_base.c            |    16 +-
 arch/s390/boot/Makefile                       |     2 +-
 arch/s390/boot/install.sh                     |    24 +-
 arch/s390/defconfig                           |    14 +-
 arch/s390/kernel/asm-offsets.c                |     1 +
 arch/s390/kernel/binfmt_elf32.c               |    23 +-
 arch/s390/kernel/compat_exec.c                |    12 +-
 arch/s390/kernel/compat_linux.c               |   699 +-
 arch/s390/kernel/compat_signal.c              |    54 +-
 arch/s390/kernel/compat_wrapper.S             |    42 +-
 arch/s390/kernel/debug.c                      |    24 +-
 arch/s390/kernel/entry.S                      |   111 +-
 arch/s390/kernel/entry64.S                    |   115 +-
 arch/s390/kernel/head.S                       |   126 +-
 arch/s390/kernel/head64.S                     |   134 +-
 arch/s390/kernel/module.c                     |     3 +-
 arch/s390/kernel/process.c                    |    23 +-
 arch/s390/kernel/profile.c                    |     3 +-
 arch/s390/kernel/ptrace.c                     |    28 +-
 arch/s390/kernel/s390_ksyms.c                 |    19 -
 arch/s390/kernel/setup.c                      |     4 +-
 arch/s390/kernel/signal.c                     |    48 +-
 arch/s390/kernel/smp.c                        |    22 +
 arch/s390/kernel/sys_s390.c                   |    78 +-
 arch/s390/kernel/syscalls.S                   |    10 +-
 arch/s390/kernel/time.c                       |     6 +-
 arch/s390/kernel/traps.c                      |     4 +-
 arch/s390/lib/Makefile                        |     6 +-
 arch/s390/lib/uaccess.S                       |    67 +-
 arch/s390/lib/uaccess64.S                     |    65 +-
 arch/s390/mm/extmem.c                         |    24 +-
 arch/s390/mm/init.c                           |     2 +-
 arch/s390/mm/ioremap.c                        |     2 +-
 arch/sh/boot/Makefile                         |     2 +-
 arch/sh/kernel/process.c                      |     8 +-
 arch/sh/kernel/smp.c                          |     3 +
 arch/sh/mm/hugetlbpage.c                      |     5 +-
 arch/sparc/Makefile                           |     1 +
 arch/sparc/kernel/apc.c                       |    71 +-
 arch/sparc/kernel/ebus.c                      |     4 +-
 arch/sparc/kernel/init_task.c                 |     2 +-
 arch/sparc/kernel/irq.c                       |     3 +-
 arch/sparc/kernel/muldiv.c                    |    49 +-
 arch/sparc/kernel/process.c                   |    90 +-
 arch/sparc/kernel/ptrace.c                    |    22 +-
 arch/sparc/kernel/signal.c                    |    29 +-
 arch/sparc/kernel/sunos_ioctl.c               |    35 +-
 arch/sparc/kernel/sys_sparc.c                 |    10 +-
 arch/sparc/kernel/sys_sunos.c                 |   155 +-
 arch/sparc/kernel/unaligned.c                 |    37 +-
 arch/sparc/kernel/windows.c                   |     9 +-
 arch/sparc/math-emu/math.c                    |    24 +-
 arch/sparc/mm/fault.c                         |    33 +-
 arch/sparc/mm/init.c                          |     2 +-
 arch/sparc/mm/srmmu.c                         |    64 +-
 arch/sparc/mm/sun4c.c                         |     4 -
 arch/sparc/prom/memory.c                      |     2 +-
 arch/sparc64/Kconfig                          |     2 +-
 arch/sparc64/Makefile                         |     2 +
 arch/sparc64/defconfig                        |    20 +-
 arch/sparc64/kernel/binfmt_aout32.c           |     5 +-
 arch/sparc64/kernel/chmc.c                    |     5 +-
 arch/sparc64/kernel/ebus.c                    |     4 +-
 arch/sparc64/kernel/entry.S                   |     4 +-
 arch/sparc64/kernel/ioctl32.c                 |   377 +-
 arch/sparc64/kernel/irq.c                     |     8 +-
 arch/sparc64/kernel/module.c                  |     4 +-
 arch/sparc64/kernel/pci.c                     |     2 +
 arch/sparc64/kernel/pci_psycho.c              |   212 +-
 arch/sparc64/kernel/pci_schizo.c              |    42 +-
 arch/sparc64/kernel/process.c                 |   117 +-
 arch/sparc64/kernel/ptrace.c                  |    38 +-
 arch/sparc64/kernel/sbus.c                    |    76 +-
 arch/sparc64/kernel/setup.c                   |     2 +-
 arch/sparc64/kernel/signal.c                  |     8 +-
 arch/sparc64/kernel/signal32.c                |    15 +-
 arch/sparc64/kernel/smp.c                     |    40 +-
 arch/sparc64/kernel/sparc64_ksyms.c           |     9 +
 arch/sparc64/kernel/sunos_ioctl32.c           |    22 +-
 arch/sparc64/kernel/sys32.S                   |   189 +-
 arch/sparc64/kernel/sys_sparc.c               |   117 +-
 arch/sparc64/kernel/sys_sparc32.c             |  1505 +-
 arch/sparc64/kernel/sys_sunos32.c             |   392 +-
 arch/sparc64/kernel/systbls.S                 |   102 +-
 arch/sparc64/kernel/time.c                    |     3 +-
 arch/sparc64/kernel/traps.c                   |    13 +-
 arch/sparc64/kernel/unaligned.c               |    54 +-
 arch/sparc64/lib/Makefile                     |     3 +-
 arch/sparc64/lib/debuglocks.c                 |    82 +-
 arch/sparc64/math-emu/math.c                  |    10 +-
 arch/sparc64/math-emu/sfp-util.h              |   180 +-
 arch/sparc64/mm/fault.c                       |    15 +-
 arch/sparc64/mm/hugetlbpage.c                 |     5 +-
 arch/sparc64/mm/init.c                        |    21 +-
 arch/sparc64/prom/memory.c                    |     2 +-
 arch/um/drivers/harddog_kern.c                |     2 +-
 arch/um/drivers/net_kern.c                    |     2 -
 arch/um/kernel/mem.c                          |     2 +-
 arch/um/kernel/smp.c                          |     3 +
 arch/v850/kernel/process.c                    |     4 +-
 arch/v850/kernel/vmlinux.lds.S                |     1 +
 arch/x86_64/Kconfig                           |    17 +-
 arch/x86_64/boot/compressed/misc.c            |    14 +-
 arch/x86_64/boot/setup.S                      |    83 +-
 arch/x86_64/defconfig                         |   179 +-
 arch/x86_64/ia32/fpu32.c                      |    16 +-
 arch/x86_64/ia32/ia32_binfmt.c                |     9 +-
 arch/x86_64/ia32/ia32_ioctl.c                 |    10 +-
 arch/x86_64/ia32/ia32_signal.c                |    50 +-
 arch/x86_64/ia32/ia32entry.S                  |    69 +-
 arch/x86_64/ia32/ptrace32.c                   |    33 +-
 arch/x86_64/ia32/sys_ia32.c                   |   640 +-
 arch/x86_64/ia32/syscall32.c                  |     6 +-
 arch/x86_64/ia32/tls32.c                      |    15 +-
 arch/x86_64/kernel/Makefile                   |     1 +
 arch/x86_64/kernel/acpi/sleep.c               |     1 -
 arch/x86_64/kernel/head64.c                   |     9 +
 arch/x86_64/kernel/i387.c                     |    10 +-
 arch/x86_64/kernel/io_apic.c                  |    10 +-
 arch/x86_64/kernel/irq.c                      |     6 +-
 arch/x86_64/kernel/ldt.c                      |     8 +-
 arch/x86_64/kernel/mce.c                      |    62 +-
 arch/x86_64/kernel/mpparse.c                  |    11 +-
 arch/x86_64/kernel/msr.c                      |    19 +-
 arch/x86_64/kernel/pci-gart.c                 |     1 -
 arch/x86_64/kernel/process.c                  |    19 +-
 arch/x86_64/kernel/ptrace.c                   |    41 +-
 arch/x86_64/kernel/reboot.c                   |     4 +-
 arch/x86_64/kernel/setup.c                    |    21 +-
 arch/x86_64/kernel/setup64.c                  |     5 +-
 arch/x86_64/kernel/signal.c                   |    44 +-
 arch/x86_64/kernel/smp.c                      |     3 +
 arch/x86_64/kernel/smpboot.c                  |    43 +-
 arch/x86_64/kernel/sys_x86_64.c               |     8 +-
 arch/x86_64/kernel/time.c                     |    10 +-
 arch/x86_64/kernel/traps.c                    |     8 +-
 arch/x86_64/kernel/vmlinux.lds.S              |     5 +-
 arch/x86_64/kernel/x8664_ksyms.c              |     6 +-
 arch/x86_64/lib/Makefile                      |     4 +-
 arch/x86_64/lib/csum-wrappers.c               |    12 +-
 arch/x86_64/lib/io.c                          |    10 +-
 arch/x86_64/lib/usercopy.c                    |    16 +-
 arch/x86_64/mm/fault.c                        |     8 +-
 arch/x86_64/mm/init.c                         |     4 +-
 arch/x86_64/mm/ioremap.c                      |     5 +-
 arch/x86_64/mm/numa.c                         |     2 +-
 arch/x86_64/mm/pageattr.c                     |    47 +-
 crypto/cipher.c                               |     7 +-
 crypto/digest.c                               |    27 +-
 crypto/scatterwalk.h                          |     1 +
 drivers/Makefile                              |     1 +
 drivers/acpi/ac.c                             |     3 +
 drivers/acpi/acpi_ksyms.c                     |     2 +-
 drivers/acpi/asus_acpi.c                      |    74 +-
 drivers/acpi/battery.c                        |     9 +-
 drivers/acpi/bus.c                            |     8 +
 drivers/acpi/button.c                         |    19 +-
 drivers/acpi/debug.c                          |     2 +-
 drivers/acpi/ec.c                             |     6 +
 drivers/acpi/event.c                          |     2 +-
 drivers/acpi/events/evxface.c                 |    27 +
 drivers/acpi/fan.c                            |     4 +-
 drivers/acpi/osl.c                            |    16 +-
 drivers/acpi/pci_link.c                       |    16 +-
 drivers/acpi/power.c                          |     2 +
 drivers/acpi/processor.c                      |     4 +-
 drivers/acpi/scan.c                           |    18 +-
 drivers/acpi/system.c                         |     8 +-
 drivers/acpi/tables.c                         |     5 +-
 drivers/acpi/thermal.c                        |    22 +-
 drivers/acpi/toshiba_acpi.c                   |     2 +-
 drivers/atm/ambassador.c                      |   524 +-
 drivers/atm/atmtcp.c                          |     4 +-
 drivers/atm/eni.c                             |    10 +-
 drivers/atm/firestream.c                      |     6 +-
 drivers/atm/fore200e.c                        |    41 +-
 drivers/atm/fore200e.h                        |    34 +-
 drivers/atm/he.c                              |    10 +-
 drivers/atm/horizon.c                         |   252 +-
 drivers/atm/idt77105.c                        |    11 +-
 drivers/atm/iphase.c                          |    12 +-
 drivers/atm/iphase.h                          |     2 +-
 drivers/atm/lanai.c                           |     2 +-
 drivers/atm/nicstar.c                         |    10 +-
 drivers/atm/suni.c                            |    23 +-
 drivers/atm/uPD98402.c                        |    15 +-
 drivers/atm/zatm.c                            |    14 +-
 drivers/base/bus.c                            |    32 +-
 drivers/base/class.c                          |     6 +-
 drivers/base/map.c                            |     7 +
 drivers/base/node.c                           |    59 +-
 drivers/base/platform.c                       |     5 +-
 drivers/base/power/resume.c                   |     5 +-
 drivers/base/power/runtime.c                  |     4 +-
 drivers/base/power/shutdown.c                 |     6 +-
 drivers/base/power/suspend.c                  |    30 +-
 drivers/base/sys.c                            |     5 +-
 drivers/block/DAC960.c                        |    22 +-
 drivers/block/DAC960.h                        |    10 +-
 drivers/block/Kconfig                         |     7 +-
 drivers/block/as-iosched.c                    |    28 +-
 drivers/block/carmel.c                        |    13 +-
 drivers/block/cciss.c                         |   101 +-
 drivers/block/cpqarray.c                      |    21 +-
 drivers/block/elevator.c                      |     7 +
 drivers/block/floppy.c                        |   146 +-
 drivers/block/floppy98.c                      |     9 +-
 drivers/block/genhd.c                         |    26 +-
 drivers/block/ida_cmd.h                       |     2 +-
 drivers/block/ida_ioctl.h                     |     2 +-
 drivers/block/ioctl.c                         |    21 +-
 drivers/block/ll_rw_blk.c                     |   110 +-
 drivers/block/loop.c                          |    20 +-
 drivers/block/paride/epat.c                   |    39 +-
 drivers/block/paride/paride.h                 |     2 +-
 drivers/block/paride/pcd.c                    |     4 +-
 drivers/block/paride/pd.c                     |     2 +-
 drivers/block/paride/pf.c                     |     2 +-
 drivers/block/paride/pg.c                     |    60 +-
 drivers/block/paride/pt.c                     |    66 +-
 drivers/block/ps2esdi.c                       |    18 +-
 drivers/block/rd.c                            |   212 +-
 drivers/block/scsi_ioctl.c                    |    65 +-
 drivers/block/swim3.c                         |     4 +
 drivers/block/umem.c                          |     4 +-
 drivers/block/viodasd.c                       |    67 +-
 drivers/block/xd.c                            |     8 +-
 drivers/bluetooth/bcm203x.c                   |     2 +-
 drivers/bluetooth/bfusb.c                     |    15 +-
 drivers/bluetooth/bt3c_cs.c                   |     3 +
 drivers/bluetooth/hci_bcsp.c                  |     1 -
 drivers/bluetooth/hci_ldisc.c                 |     5 +-
 drivers/bluetooth/hci_usb.c                   |   220 +-
 drivers/bluetooth/hci_usb.h                   |    63 +-
 drivers/bluetooth/hci_vhci.c                  |    11 +-
 drivers/cdrom/aztcd.c                         |    47 +-
 drivers/cdrom/cdrom.c                         |   110 +-
 drivers/cdrom/cdu31a.c                        |    13 +-
 drivers/cdrom/optcd.c                         |    67 +-
 drivers/cdrom/sjcd.c                          |    31 +-
 drivers/cdrom/sonycd535.c                     |    24 +-
 drivers/char/Kconfig                          |     8 +-
 drivers/char/Makefile                         |     2 -
 drivers/char/agp/amd-k7-agp.c                 |    51 +-
 drivers/char/agp/amd64-agp.c                  |   145 +-
 drivers/char/agp/ati-agp.c                    |     1 +
 drivers/char/agp/backend.c                    |    13 +-
 drivers/char/agp/intel-agp.c                  |    58 +-
 drivers/char/agp/intel-mch-agp.c              |    23 +-
 drivers/char/agp/nvidia-agp.c                 |    10 +-
 drivers/char/agp/sis-agp.c                    |    60 +-
 drivers/char/agp/sworks-agp.c                 |    27 +-
 drivers/char/agp/via-agp.c                    |    58 +-
 drivers/char/consolemap.c                     |    23 +-
 drivers/char/cyclades.c                       |    34 +-
 drivers/char/drm/ati_pcigart.h                |     4 +-
 drivers/char/drm/drm.h                        |    27 +-
 drivers/char/drm/drmP.h                       |    85 +-
 drivers/char/drm/drm_agpsupport.h             |     6 +-
 drivers/char/drm/drm_bufs.h                   |    12 +-
 drivers/char/drm/drm_context.h                |    29 +
 drivers/char/drm/drm_dma.h                    |   303 +-
 drivers/char/drm/drm_drv.h                    |   264 +-
 drivers/char/drm/drm_fops.h                   |     2 +
 drivers/char/drm/drm_ioctl.h                  |   199 +-
 drivers/char/drm/drm_memory_debug.h           |     1 +
 drivers/char/drm/drm_os_linux.h               |     6 +
 drivers/char/drm/drm_sarea.h                  |    14 +
 drivers/char/drm/drm_stub.h                   |     4 +-
 drivers/char/drm/drm_vm.h                     |   150 +-
 drivers/char/drm/ffb.h                        |     1 +
 drivers/char/drm/gamma.h                      |     4 +-
 drivers/char/drm/gamma_dma.c                  |    53 +-
 drivers/char/drm/gamma_drv.c                  |     1 +
 drivers/char/drm/i810.h                       |     3 +-
 drivers/char/drm/i810_dma.c                   |     4 +-
 drivers/char/drm/i830.h                       |     4 +-
 drivers/char/drm/i830_dma.c                   |     6 +-
 drivers/char/drm/i830_drv.c                   |     1 +
 drivers/char/drm/i830_irq.c                   |     2 +-
 drivers/char/drm/mga.h                        |     2 +-
 drivers/char/drm/mga_dma.c                    |    12 +-
 drivers/char/drm/mga_drm.h                    |    35 +-
 drivers/char/drm/mga_drv.c                    |     1 +
 drivers/char/drm/mga_drv.h                    |     1 -
 drivers/char/drm/mga_irq.c                    |     2 +-
 drivers/char/drm/r128.h                       |     2 +-
 drivers/char/drm/r128_cce.c                   |    50 +-
 drivers/char/drm/r128_drm.h                   |    61 +-
 drivers/char/drm/r128_drv.c                   |     1 +
 drivers/char/drm/r128_drv.h                   |    58 +-
 drivers/char/drm/r128_irq.c                   |     2 +-
 drivers/char/drm/r128_state.c                 |    42 +-
 drivers/char/drm/radeon.h                     |    24 +-
 drivers/char/drm/radeon_cp.c                  |    40 +-
 drivers/char/drm/radeon_drm.h                 |   104 +-
 drivers/char/drm/radeon_drv.c                 |     1 +
 drivers/char/drm/radeon_drv.h                 |     7 +-
 drivers/char/drm/radeon_irq.c                 |     2 +-
 drivers/char/drm/radeon_mem.c                 |     4 +-
 drivers/char/drm/radeon_state.c               |   414 +-
 drivers/char/drm/tdfx.h                       |    10 +
 drivers/char/drm/tdfx_drv.c                   |    41 -
 drivers/char/hw_random.c                      |     4 +-
 drivers/char/i8k.c                            |    22 +-
 drivers/char/ip2main.c                        |    46 +-
 drivers/char/ipmi/ipmi_bt_sm.c                |     2 +-
 drivers/char/ipmi/ipmi_msghandler.c           |    58 +-
 drivers/char/ipmi/ipmi_si_intf.c              |     4 +-
 drivers/char/lp.c                             |    16 +-
 drivers/char/mem.c                            |    43 +-
 drivers/char/mwave/mwavedd.c                  |     7 +-
 drivers/char/mxser.c                          |    10 +
 drivers/char/n_tty.c                          |    12 +-
 drivers/char/nvram.c                          |     4 +-
 drivers/char/pcmcia/synclink_cs.c             |   123 +-
 drivers/char/ppdev.c                          |    96 +-
 drivers/char/pty.c                            |    10 +-
 drivers/char/random.c                         |    35 +-
 drivers/char/raw.c                            |    18 +-
 drivers/char/rtc.c                            |    95 +-
 drivers/char/scx200_gpio.c                    |     4 +-
 drivers/char/selection.c                      |    34 +-
 drivers/char/sn_serial.c                      |     2 +-
 drivers/char/sonypi.c                         |    24 +-
 drivers/char/synclink.c                       |   155 +-
 drivers/char/synclinkmp.c                     |   128 +-
 drivers/char/sysrq.c                          |    36 +-
 drivers/char/tipar.c                          |    49 +-
 drivers/char/toshiba.c                        |     7 +-
 drivers/char/tpqic02.c                        |    19 +-
 drivers/char/tty_io.c                         |   105 +-
 drivers/char/tty_ioctl.c                      |    63 +-
 drivers/char/vc_screen.c                      |     4 +-
 drivers/char/vt.c                             |    74 +-
 drivers/char/vt_ioctl.c                       |    77 +-
 drivers/char/watchdog/Kconfig                 |    11 +
 drivers/char/watchdog/Makefile                |     1 +
 drivers/char/watchdog/alim1535_wdt.c          |     1 +
 drivers/char/watchdog/alim7101_wdt.c          |     1 +
 drivers/char/watchdog/ib700wdt.c              |     6 +-
 drivers/char/watchdog/pcwd.c                  |    26 +-
 drivers/char/watchdog/pcwd_pci.c              |    36 +-
 drivers/char/watchdog/pcwd_usb.c              |    28 +-
 drivers/char/watchdog/sc1200wdt.c             |     1 +
 drivers/char/watchdog/sc520_wdt.c             |   229 +-
 drivers/char/watchdog/scx200_wdt.c            |    11 +-
 drivers/char/watchdog/shwdt.c                 |     1 -
 drivers/char/watchdog/w83627hf_wdt.c          |    68 +-
 drivers/char/watchdog/wdt.c                   |     2 +-
 drivers/cpufreq/cpufreq.c                     |   194 +-
 drivers/cpufreq/cpufreq_userspace.c           |    46 +-
 drivers/cpufreq/proc_intf.c                   |     2 +-
 drivers/fc4/fc.c                              |    43 +-
 drivers/firmware/Kconfig                      |     2 +-
 drivers/firmware/edd.c                        |   183 +-
 drivers/firmware/efivars.c                    |    16 +-
 drivers/i2c/algos/i2c-algo-bit.c              |    10 +-
 drivers/i2c/busses/Kconfig                    |    20 +-
 drivers/i2c/busses/Makefile                   |     2 +-
 drivers/i2c/busses/i2c-ali1535.c              |     7 +-
 drivers/i2c/busses/i2c-ali1563.c              |     7 +-
 drivers/i2c/busses/i2c-ali15x3.c              |     7 +-
 drivers/i2c/busses/i2c-amd756.c               |     9 +-
 drivers/i2c/busses/i2c-amd8111.c              |     4 +-
 drivers/i2c/busses/i2c-i801.c                 |    35 +-
 drivers/i2c/busses/i2c-ibm_iic.c              |    48 +-
 drivers/i2c/busses/i2c-isa.c                  |     2 +-
 drivers/i2c/busses/i2c-keywest.c              |     1 -
 drivers/i2c/busses/i2c-nforce2.c              |     2 +-
 drivers/i2c/busses/i2c-parport-light.c        |     2 +-
 drivers/i2c/busses/i2c-parport.c              |     2 +-
 drivers/i2c/busses/i2c-parport.h              |    14 +-
 drivers/i2c/busses/i2c-piix4.c                |     6 +-
 drivers/i2c/busses/i2c-sis5595.c              |     5 +-
 drivers/i2c/busses/i2c-sis630.c               |     5 +-
 drivers/i2c/busses/i2c-sis96x.c               |     5 +-
 drivers/i2c/busses/i2c-via.c                  |     2 +-
 drivers/i2c/busses/i2c-viapro.c               |     5 +-
 drivers/i2c/busses/i2c-voodoo3.c              |     4 +-
 drivers/i2c/busses/scx200_acb.c               |     8 +-
 drivers/i2c/busses/scx200_i2c.c               |     1 -
 drivers/i2c/chips/Kconfig                     |    28 +-
 drivers/i2c/chips/Makefile                    |     2 +
 drivers/i2c/chips/adm1021.c                   |     2 +-
 drivers/i2c/chips/asb100.c                    |    10 +-
 drivers/i2c/chips/eeprom.c                    |     5 +-
 drivers/i2c/chips/fscher.c                    |     2 +-
 drivers/i2c/chips/gl518sm.c                   |     2 +-
 drivers/i2c/chips/it87.c                      |    80 +-
 drivers/i2c/chips/lm75.c                      |     2 +-
 drivers/i2c/chips/lm78.c                      |     2 +-
 drivers/i2c/chips/lm80.c                      |     2 +-
 drivers/i2c/chips/lm83.c                      |     2 +-
 drivers/i2c/chips/lm90.c                      |    51 +-
 drivers/i2c/chips/via686a.c                   |   119 +-
 drivers/i2c/chips/w83781d.c                   |    36 +-
 drivers/i2c/chips/w83l785ts.c                 |     5 +-
 drivers/i2c/i2c-core.c                        |    21 +-
 drivers/ide/Kconfig                           |    65 +-
 drivers/ide/Makefile                          |     7 +-
 drivers/ide/ide-cd.c                          |    88 +-
 drivers/ide/ide-disk.c                        |   324 +-
 drivers/ide/ide-dma.c                         |     4 +-
 drivers/ide/ide-floppy.c                      |    15 +-
 drivers/ide/ide-io.c                          |    24 +-
 drivers/ide/ide-iops.c                        |    10 +-
 drivers/ide/ide-pnp.c                         |    37 +-
 drivers/ide/ide-probe.c                       |    73 +-
 drivers/ide/ide-proc.c                        |   481 +-
 drivers/ide/ide-taskfile.c                    |   238 +-
 drivers/ide/ide.c                             |   353 +-
 drivers/ide/legacy/pdc4030.c                  |    16 +-
 drivers/ide/pci/adma100.h                     |     8 -
 drivers/ide/pci/aec62xx.c                     |    12 +-
 drivers/ide/pci/aec62xx.h                     |    22 -
 drivers/ide/pci/alim15x3.c                    |    16 +-
 drivers/ide/pci/amd74xx.c                     |    64 +-
 drivers/ide/pci/atiixp.c                      |     8 +-
 drivers/ide/pci/cmd64x.c                      |    11 +-
 drivers/ide/pci/cmd64x.h                      |    24 -
 drivers/ide/pci/cs5520.c                      |    21 +-
 drivers/ide/pci/cs5530.c                      |    17 +-
 drivers/ide/pci/cy82c693.h                    |    10 -
 drivers/ide/pci/generic.c                     |    12 +-
 drivers/ide/pci/generic.h                     |    71 -
 drivers/ide/pci/hpt34x.c                      |     4 +-
 drivers/ide/pci/hpt34x.h                      |     9 -
 drivers/ide/pci/hpt366.c                      |    18 +-
 drivers/ide/pci/hpt366.h                      |    29 -
 drivers/ide/pci/it8172.c                      |     3 +-
 drivers/ide/pci/it8172.h                      |     9 -
 drivers/ide/pci/ns87415.c                     |    15 +-
 drivers/ide/pci/opti621.c                     |     5 +-
 drivers/ide/pci/opti621.h                     |    15 -
 drivers/ide/pci/pdc202xx_new.c                |    12 +-
 drivers/ide/pci/pdc202xx_new.h                |    46 +-
 drivers/ide/pci/pdc202xx_old.c                |    14 +-
 drivers/ide/pci/pdc202xx_old.h                |    41 +-
 drivers/ide/pci/piix.c                        |    57 +-
 drivers/ide/pci/piix.h                        |    58 +-
 drivers/ide/pci/rz1000.c                      |    17 +-
 drivers/ide/pci/sc1200.c                      |    16 +-
 drivers/ide/pci/serverworks.c                 |     6 +-
 drivers/ide/pci/serverworks.h                 |    26 -
 drivers/ide/pci/sgiioc4.c                     |    13 +-
 drivers/ide/pci/siimage.c                     |   123 +-
 drivers/ide/pci/sis5513.c                     |    18 +-
 drivers/ide/pci/sl82c105.c                    |    18 +-
 drivers/ide/pci/slc90e66.c                    |    17 +-
 drivers/ide/pci/triflex.c                     |    27 +-
 drivers/ide/pci/trm290.c                      |    17 +-
 drivers/ide/pci/via82cxxx.c                   |    20 +-
 drivers/ide/setup-pci.c                       |    28 +-
 drivers/ieee1394/csr.c                        |     2 -
 drivers/ieee1394/csr1212.c                    |    10 +-
 drivers/ieee1394/csr1212.h                    |     6 +-
 drivers/ieee1394/eth1394.c                    |    12 +-
 drivers/ieee1394/highlevel.c                  |     2 +-
 drivers/ieee1394/hosts.c                      |    23 +-
 drivers/ieee1394/hosts.h                      |     2 +-
 drivers/ieee1394/ieee1394_core.c              |   123 +-
 drivers/ieee1394/ieee1394_core.h              |     2 -
 drivers/ieee1394/nodemgr.c                    |    35 +-
 drivers/ieee1394/nodemgr.h                    |     2 +-
 drivers/ieee1394/ohci1394.c                   |     8 +-
 drivers/ieee1394/sbp2.c                       |     6 +-
 drivers/ieee1394/video1394.c                  |     4 +
 drivers/input/Kconfig                         |     9 +-
 drivers/input/evbug.c                         |    14 +-
 drivers/input/evdev.c                         |    50 +-
 drivers/input/gameport/cs461x.c               |    30 +-
 drivers/input/gameport/emu10k1-gp.c           |    12 +-
 drivers/input/gameport/fm801-gp.c             |     2 +-
 drivers/input/gameport/gameport.c             |     2 +-
 drivers/input/gameport/lightning.c            |    16 +-
 drivers/input/gameport/ns558.c                |    19 +-
 drivers/input/gameport/vortex.c               |     9 +-
 drivers/input/input.c                         |    40 +-
 drivers/input/joydev.c                        |    16 +-
 drivers/input/joystick/Kconfig                |    16 +-
 drivers/input/joystick/a3d.c                  |    14 +-
 drivers/input/joystick/adi.c                  |    36 +-
 drivers/input/joystick/amijoy.c               |     2 +-
 drivers/input/joystick/analog.c               |    50 +-
 drivers/input/joystick/cobra.c                |    10 +-
 drivers/input/joystick/db9.c                  |    24 +-
 drivers/input/joystick/gamecon.c              |    32 +-
 drivers/input/joystick/gf2k.c                 |    16 +-
 drivers/input/joystick/grip.c                 |     6 +-
 drivers/input/joystick/grip_mp.c              |    44 +-
 drivers/input/joystick/guillemot.c            |     8 +-
 drivers/input/joystick/iforce/Kconfig         |     2 +-
 drivers/input/joystick/iforce/Makefile        |     6 +-
 drivers/input/joystick/iforce/iforce-ff.c     |     4 +-
 drivers/input/joystick/iforce/iforce-main.c   |     4 +-
 .../input/joystick/iforce/iforce-packets.c    |     4 +-
 drivers/input/joystick/iforce/iforce-serio.c  |     2 +-
 drivers/input/joystick/iforce/iforce.h        |     2 +-
 drivers/input/joystick/interact.c             |     8 +-
 drivers/input/joystick/joydump.c              |    10 +-
 drivers/input/joystick/magellan.c             |    12 +-
 drivers/input/joystick/sidewinder.c           |    20 +-
 drivers/input/joystick/spaceball.c            |    20 +-
 drivers/input/joystick/spaceorb.c             |    18 +-
 drivers/input/joystick/stinger.c              |     6 +-
 drivers/input/joystick/tmdc.c                 |    24 +-
 drivers/input/joystick/turbografx.c           |    20 +-
 drivers/input/joystick/twidjoy.c              |    15 +-
 drivers/input/joystick/warrior.c              |    32 +-
 drivers/input/keyboard/98kbd.c                |    42 +-
 drivers/input/keyboard/Kconfig                |     6 +-
 drivers/input/keyboard/atkbd.c                |    55 +-
 drivers/input/keyboard/maple_keyb.c           |     2 +-
 drivers/input/keyboard/sunkbd.c               |    16 +-
 drivers/input/keyboard/xtkbd.c                |    12 +-
 drivers/input/misc/98spkr.c                   |     7 +-
 drivers/input/misc/Kconfig                    |     2 +-
 drivers/input/misc/pcspkr.c                   |     7 +-
 drivers/input/misc/sparcspkr.c                |     8 +-
 drivers/input/misc/uinput.c                   |    50 +-
 drivers/input/mouse/logips2pp.c               |   266 +-
 drivers/input/mouse/logips2pp.h               |     9 +-
 drivers/input/mouse/psmouse-base.c            |   175 +-
 drivers/input/mouse/psmouse.h                 |    11 +-
 drivers/input/mouse/synaptics.c               |   453 +-
 drivers/input/mouse/synaptics.h               |    23 +-
 drivers/input/mousedev.c                      |   294 +-
 drivers/input/power.c                         |    27 +-
 drivers/input/serio/98kbd-io.c                |     9 +-
 drivers/input/serio/ct82c710.c                |     8 +-
 drivers/input/serio/gscps2.c                  |    22 +-
 drivers/input/serio/i8042.c                   |    44 +-
 drivers/input/serio/parkbd.c                  |    23 +-
 drivers/input/serio/q40kbd.c                  |    13 +-
 drivers/input/serio/rpckbd.c                  |     2 +-
 drivers/input/serio/sa1111ps2.c               |     5 +-
 drivers/input/serio/serio.c                   |    17 +-
 drivers/input/serio/serport.c                 |    14 +-
 drivers/input/touchscreen/gunze.c             |     8 +-
 drivers/input/touchscreen/h3600_ts_input.c    |   112 +-
 drivers/isdn/hardware/avm/avm_cs.c            |    10 +-
 drivers/isdn/hardware/eicon/divasmain.c       |     6 +-
 drivers/isdn/hisax/nj_s.c                     |    20 +-
 drivers/isdn/hisax/st5481_b.c                 |     9 +-
 drivers/isdn/hisax/st5481_d.c                 |     9 +-
 drivers/isdn/hisax/st5481_usb.c               |    10 +-
 drivers/isdn/i4l/isdn_common.c                |     2 +-
 drivers/macintosh/Kconfig                     |     2 +-
 drivers/macintosh/adb.c                       |    24 +-
 drivers/macintosh/therm_adt746x.c             |     3 +-
 drivers/macintosh/therm_pm72.c                |    17 +-
 drivers/md/dm-ioctl.c                         |    35 +-
 drivers/md/dm-table.c                         |     4 +-
 drivers/md/dm-target.c                        |     3 +-
 drivers/md/dm.c                               |    44 +-
 drivers/md/dm.h                               |     6 +-
 drivers/md/md.c                               |   179 +-
 drivers/md/multipath.c                        |    57 +-
 drivers/md/raid1.c                            |   213 +-
 drivers/md/raid5.c                            |    52 +-
 drivers/md/raid6main.c                        |    53 +-
 drivers/media/common/saa7146_fops.c           |     2 +-
 drivers/media/dvb/frontends/tda1004x.c        |     1 +
 drivers/media/radio/radio-cadet.c             |     8 +-
 drivers/media/radio/radio-typhoon.c           |     2 +-
 drivers/media/video/Kconfig                   |     2 +-
 drivers/media/video/bt832.c                   |     2 +-
 drivers/media/video/bttv-i2c.c                |     8 +-
 drivers/media/video/cpia_usb.c                |     4 +-
 drivers/media/video/cx88/cx88-i2c.c           |     4 +-
 drivers/media/video/dpc7146.c                 |     2 +-
 drivers/media/video/hexium_gemini.c           |     2 +-
 drivers/media/video/hexium_orion.c            |     2 +-
 drivers/media/video/ir-kbd-gpio.c             |     3 +-
 drivers/media/video/msp3400.c                 |     4 +-
 drivers/media/video/mxb.c                     |   205 +-
 drivers/media/video/planb.c                   |     4 -
 drivers/media/video/saa5246a.c                |     2 +-
 drivers/media/video/saa5249.c                 |     2 +-
 drivers/media/video/saa7111.c                 |    59 +-
 drivers/media/video/saa7134/saa6752hs.c       |     2 +-
 drivers/media/video/saa7134/saa7134-i2c.c     |     4 +-
 drivers/media/video/saa7134/saa7134-input.c   |     1 -
 drivers/media/video/tda7432.c                 |     4 +-
 drivers/media/video/tda9875.c                 |     4 +-
 drivers/media/video/tda9887.c                 |     4 +-
 drivers/media/video/tuner.c                   |     4 +-
 drivers/media/video/tvaudio.c                 |     4 +-
 drivers/media/video/tvmixer.c                 |     4 +-
 drivers/media/video/video-buf.c               |     2 +-
 drivers/media/video/videodev.c                |    15 +-
 drivers/message/fusion/Kconfig                |     2 +-
 drivers/message/fusion/mptbase.c              |   157 +
 drivers/message/fusion/mptbase.h              |     4 +-
 drivers/message/fusion/mptctl.c               |    78 +-
 drivers/message/fusion/mptctl.h               |    31 +
 drivers/message/fusion/mptscsih.c             |    37 +-
 drivers/message/i2o/Kconfig                   |    15 +-
 drivers/message/i2o/Makefile                  |     3 +-
 drivers/message/i2o/i2o_block.c               |   382 +-
 drivers/message/i2o/i2o_config.c              |   202 +-
 drivers/message/i2o/i2o_core.c                |   136 +
 drivers/message/i2o/i2o_proc.c                |   402 +-
 drivers/message/i2o/i2o_scsi.c                |    64 +-
 drivers/misc/Kconfig                          |     8 +-
 drivers/misc/ibmasm/module.c                  |     7 +
 drivers/mtd/chips/amd_flash.c                 |     2 +-
 drivers/mtd/chips/cfi_cmdset_0001.c           |     1 +
 drivers/mtd/chips/jedec_probe.c               |    43 +-
 drivers/mtd/chips/sharp.c                     |     3 +-
 drivers/mtd/maps/Kconfig                      |    17 +
 drivers/mtd/maps/Makefile                     |     2 +
 drivers/mtd/maps/lubbock-flash.c              |     3 +-
 drivers/mtd/maps/tqm8xxl.c                    |     2 +-
 drivers/mtd/maps/uclinux.c                    |     1 +
 drivers/net/3c509.c                           |     6 +-
 drivers/net/3c527.c                           |     1 +
 drivers/net/3c59x.c                           |     2 +-
 drivers/net/8139cp.c                          |     3 +-
 drivers/net/8139too.c                         |    38 +-
 drivers/net/8390.h                            |     2 +-
 drivers/net/Kconfig                           |    50 +-
 drivers/net/Makefile                          |     5 +-
 drivers/net/Space.c                           |     3 +-
 drivers/net/acenic.c                          |   765 +-
 drivers/net/amd8111e.c                        |     6 +-
 drivers/net/appletalk/cops.c                  |     2 +-
 drivers/net/appletalk/ipddp.c                 |     2 +-
 drivers/net/arcnet/com90xx.c                  |     4 +-
 drivers/net/arm/am79c961a.c                   |    89 +-
 drivers/net/arm/ether00.c                     |     1 -
 drivers/net/at1700.c                          |    13 +-
 drivers/net/au1000_eth.c                      |     2 +-
 drivers/net/b44.c                             |   546 +-
 drivers/net/b44.h                             |     2 +
 drivers/net/bonding/bond_main.c               |    20 +-
 drivers/net/depca.c                           |     2 +-
 drivers/net/depca.h                           |     2 +-
 drivers/net/dl2k.c                            |     8 +-
 drivers/net/e100.c                            |   125 +-
 drivers/net/e1000/e1000.h                     |     8 +
 drivers/net/e1000/e1000_ethtool.c             |   691 +-
 drivers/net/e1000/e1000_hw.c                  |    33 +-
 drivers/net/e1000/e1000_hw.h                  |    16 +-
 drivers/net/e1000/e1000_main.c                |   243 +-
 drivers/net/e1000/e1000_param.c               |   101 +-
 drivers/net/eepro100.c                        |     7 +-
 drivers/net/epic100.c                         |    32 +-
 drivers/net/eql.c                             |    42 +-
 drivers/net/ewrk3.c                           |     8 +-
 drivers/net/ewrk3.h                           |     2 +-
 drivers/net/fealnx.c                          |   472 +-
 drivers/net/forcedeth.c                       |     4 +-
 drivers/net/gt96100eth.c                      |     6 -
 drivers/net/hamachi.c                         |     8 +-
 drivers/net/hamradio/baycom_epp.c             |     2 -
 drivers/net/hamradio/baycom_par.c             |     3 -
 drivers/net/hamradio/baycom_ser_fdx.c         |     3 -
 drivers/net/hamradio/baycom_ser_hdx.c         |     3 -
 drivers/net/hamradio/bpqether.c               |     2 +-
 drivers/net/hamradio/dmascc.c                 |    18 -
 drivers/net/hamradio/scc.c                    |     6 +-
 drivers/net/ibm_emac/ibm_emac_core.c          |     2 +-
 drivers/net/ibmlana.c                         |     3 +-
 drivers/net/ibmveth.c                         |    14 +-
 drivers/net/ioc3-eth.c                        |     3 +-
 drivers/net/irda/act200l-sir.c                |     2 +-
 drivers/net/irda/act200l.c                    |    10 +-
 drivers/net/irda/actisys.c                    |     2 +-
 drivers/net/irda/girbil.c                     |    10 +-
 drivers/net/irda/irda-usb.c                   |     8 +-
 drivers/net/irda/irport.c                     |     4 +-
 drivers/net/irda/irtty-sir.c                  |     4 +-
 drivers/net/irda/ma600-sir.c                  |     8 +-
 drivers/net/irda/ma600.c                      |    16 +-
 drivers/net/irda/mcp2120.c                    |     8 +-
 drivers/net/irda/sir_dev.c                    |    11 +-
 drivers/net/irda/sir_kthread.c                |     2 +-
 drivers/net/irda/stir4200.c                   |    11 +-
 drivers/net/irda/tekram-sir.c                 |     2 +-
 drivers/net/irda/tekram.c                     |    12 +-
 drivers/net/iseries_veth.c                    |    73 +-
 drivers/net/ixgb/ixgb.h                       |    83 +-
 drivers/net/ixgb/ixgb_ee.c                    |   263 +-
 drivers/net/ixgb/ixgb_ee.h                    |    47 +-
 drivers/net/ixgb/ixgb_ethtool.c               |   433 +-
 drivers/net/ixgb/ixgb_hw.c                    |   392 +-
 drivers/net/ixgb/ixgb_hw.h                    |   370 +-
 drivers/net/ixgb/ixgb_ids.h                   |    17 +-
 drivers/net/ixgb/ixgb_main.c                  |  1501 +-
 drivers/net/ixgb/ixgb_osdep.h                 |    42 +-
 drivers/net/ixgb/ixgb_param.c                 |   176 +-
 drivers/net/lance.c                           |    44 +-
 drivers/net/natsemi.c                         |     8 +-
 drivers/net/netconsole.c                      |     1 -
 drivers/net/ns83820.c                         |     4 +-
 drivers/net/pci-skeleton.c                    |     2 +-
 drivers/net/pcmcia/3c574_cs.c                 |     2 +-
 drivers/net/pcmcia/axnet_cs.c                 |     3 +-
 drivers/net/pcmcia/pcnet_cs.c                 |     2 +-
 drivers/net/pcmcia/smc91c92_cs.c              |     8 +-
 drivers/net/pcmcia/xirc2ps_cs.c               |     2 +-
 drivers/net/pcnet32.c                         |   186 +-
 drivers/net/plip.c                            |     5 +-
 drivers/net/ppp_async.c                       |     4 +-
 drivers/net/ppp_synctty.c                     |     4 +-
 drivers/net/r8169.c                           |     2 +-
 drivers/net/rrunner.c                         |     2 +-
 drivers/net/s2io.c                            |    85 +-
 drivers/net/s2io.h                            |     2 +-
 drivers/net/sb1000.c                          |     5 +-
 drivers/net/sb1250-mac.c                      |     2 +-
 drivers/net/shaper.c                          |     2 +-
 drivers/net/sis900.c                          |    13 +-
 drivers/net/sis900.h                          |     6 +-
 drivers/net/sk98lin/skvpd.c                   |    11 +
 drivers/net/sk_mca.c                          |     3 +-
 drivers/net/sk_mca.h                          |     2 +-
 drivers/net/slip.c                            |    32 +-
 drivers/net/starfire.c                        |     6 +-
 drivers/net/sundance.c                        |     7 +-
 drivers/net/sungem.c                          |     2 +-
 drivers/net/tg3.c                             |  1824 ++-
 drivers/net/tg3.h                             |   115 +-
 drivers/net/tlan.c                            |     6 +-
 drivers/net/tokenring/olympic.c               |     2 +-
 drivers/net/tulip/de2104x.c                   |     9 +-
 drivers/net/tulip/de4x5.c                     |     2 +-
 drivers/net/tulip/de4x5.h                     |     2 +-
 drivers/net/tulip/dmfe.c                      |    23 +
 drivers/net/tulip/eeprom.c                    |    23 +-
 drivers/net/tulip/interrupt.c                 |     4 +
 drivers/net/tulip/tulip.h                     |     4 +-
 drivers/net/tulip/tulip_core.c                |    54 +-
 drivers/net/tulip/winbond-840.c               |     7 +-
 drivers/net/tulip/xircom_tulip_cb.c           |     6 +-
 drivers/net/tun.c                             |    14 +-
 drivers/net/typhoon.c                         |     4 +-
 drivers/net/via-rhine.c                       |  1128 +-
 drivers/net/wan/Kconfig                       |   113 -
 drivers/net/wan/Makefile                      |    15 +-
 drivers/net/wan/c101.c                        |     2 -
 drivers/net/wan/cosa.c                        |    41 +-
 drivers/net/wan/dlci.c                        |     6 +-
 drivers/net/wan/farsync.c                     |  3363 +++--
 drivers/net/wan/farsync.h                     |   140 +-
 drivers/net/wan/hd6457x.c                     |     2 +-
 drivers/net/wan/hdlc_cisco.c                  |    22 +-
 drivers/net/wan/hdlc_fr.c                     |    20 +-
 drivers/net/wan/hdlc_generic.c                |   108 +-
 drivers/net/wan/pc300_drv.c                   |     2 +-
 drivers/net/wan/sbni.c                        |     2 +-
 drivers/net/wan/sdla.c                        |     8 +-
 drivers/net/wan/sealevel.c                    |     1 +
 drivers/net/wan/wanxl.c                       |     6 +-
 drivers/net/wireless/airo.c                   |   246 +-
 drivers/net/wireless/hermes.h                 |     4 +-
 drivers/net/wireless/orinoco_pci.c            |     1 -
 drivers/net/wireless/orinoco_plx.c            |     1 -
 drivers/net/wireless/orinoco_tmd.c            |     1 -
 drivers/net/wireless/prism54/isl_38xx.c       |     2 +-
 drivers/net/wireless/prism54/isl_38xx.h       |     2 +-
 drivers/net/wireless/prism54/isl_ioctl.c      |   392 +-
 drivers/net/wireless/prism54/isl_ioctl.h      |     2 +-
 drivers/net/wireless/prism54/isl_oid.h        |    29 +-
 drivers/net/wireless/prism54/islpci_dev.c     |    10 +-
 drivers/net/wireless/prism54/islpci_dev.h     |    11 +-
 drivers/net/wireless/prism54/islpci_eth.c     |   143 +-
 drivers/net/wireless/prism54/islpci_eth.h     |    44 +-
 drivers/net/wireless/prism54/islpci_hotplug.c |     2 +-
 drivers/net/wireless/prism54/islpci_mgt.c     |     2 +-
 drivers/net/wireless/prism54/islpci_mgt.h     |     2 +-
 drivers/net/wireless/prism54/oid_mgt.c        |   634 +-
 drivers/net/wireless/prism54/oid_mgt.h        |    11 +-
 drivers/net/wireless/wavelan_cs.c             |     4 +-
 drivers/net/wireless/wl3501_cs.c              |     4 +-
 drivers/net/yellowfin.c                       |     6 +-
 drivers/oprofile/event_buffer.c               |     2 +-
 drivers/oprofile/oprofile_files.c             |    12 +-
 drivers/oprofile/oprofilefs.c                 |    12 +-
 drivers/parisc/superio.c                      |     2 +-
 drivers/parisc/wax.c                          |     1 -
 drivers/parport/parport_pc.c                  |     2 +-
 drivers/parport/procfs.c                      |    12 +-
 drivers/parport/share.c                       |     2 +-
 drivers/pci/hotplug/acpiphp.h                 |     5 -
 drivers/pci/hotplug/acpiphp_core.c            |   254 +-
 drivers/pci/hotplug/acpiphp_glue.c            |   106 +-
 drivers/pci/hotplug/acpiphp_res.c             |     8 +-
 drivers/pci/hotplug/cpci_hotplug.h            |     3 -
 drivers/pci/hotplug/cpci_hotplug_core.c       |   162 +-
 drivers/pci/hotplug/cpci_hotplug_pci.c        |     2 +
 drivers/pci/hotplug/cpcihp_generic.c          |    67 -
 drivers/pci/hotplug/cpcihp_zt5550.c           |    11 +-
 drivers/pci/hotplug/cpqphp.h                  |   242 +-
 drivers/pci/hotplug/cpqphp_core.c             |   510 +-
 drivers/pci/hotplug/cpqphp_ctrl.c             |  1523 +-
 drivers/pci/hotplug/cpqphp_pci.c              |    80 +-
 drivers/pci/hotplug/ibmphp.h                  |     2 -
 drivers/pci/hotplug/ibmphp_core.c             |     2 +-
 drivers/pci/hotplug/ibmphp_res.c              |     1 -
 drivers/pci/hotplug/pci_hotplug_core.c        |     9 +-
 drivers/pci/hotplug/pciehp.h                  |    72 +-
 drivers/pci/hotplug/pciehp_core.c             |   237 +-
 drivers/pci/hotplug/pciehp_ctrl.c             |  1235 +-
 drivers/pci/hotplug/pciehp_hpc.c              |    82 +-
 drivers/pci/hotplug/pciehp_pci.c              |   365 +-
 drivers/pci/hotplug/pciehprm.h                |     1 -
 drivers/pci/hotplug/pciehprm_acpi.c           |     2 +
 drivers/pci/hotplug/pciehprm_nonacpi.c        |     5 -
 drivers/pci/hotplug/pcihp_skeleton.c          |   241 +-
 drivers/pci/hotplug/rpadlpar_core.c           |    20 +-
 drivers/pci/hotplug/rpaphp.h                  |     3 -
 drivers/pci/hotplug/rpaphp_core.c             |   106 +-
 drivers/pci/hotplug/rpaphp_pci.c              |    38 +-
 drivers/pci/hotplug/rpaphp_slot.c             |    68 +-
 drivers/pci/hotplug/rpaphp_vio.c              |     1 +
 drivers/pci/hotplug/shpchp.h                  |     1 -
 drivers/pci/hotplug/shpchp_core.c             |   225 +-
 drivers/pci/hotplug/shpchp_ctrl.c             |   218 +-
 drivers/pci/hotplug/shpchp_pci.c              |   366 +-
 drivers/pci/hotplug/shpchprm.h                |     1 -
 drivers/pci/hotplug/shpchprm_acpi.c           |     4 +-
 drivers/pci/hotplug/shpchprm_legacy.c         |     5 -
 drivers/pci/hotplug/shpchprm_nonacpi.c        |     5 -
 drivers/pci/pci-driver.c                      |    26 +-
 drivers/pci/pci.c                             |     7 +-
 drivers/pci/pci.ids                           |  1486 +-
 drivers/pci/probe.c                           |     4 +-
 drivers/pci/proc.c                            |    12 +-
 drivers/pci/syscall.c                         |    18 +-
 drivers/pcmcia/Kconfig                        |     7 +
 drivers/pcmcia/Makefile                       |     8 +
 drivers/pcmcia/cs.c                           |    20 +-
 drivers/pcmcia/cs_internal.h                  |     4 +-
 drivers/pcmcia/ds.c                           |    17 +-
 drivers/pcmcia/i82365.c                       |     2 +-
 drivers/pcmcia/pxa2xx_base.c                  |   139 +-
 drivers/pcmcia/pxa2xx_lubbock.c               |     1 +
 drivers/pcmcia/pxa2xx_mainstone.c             |     2 +
 drivers/pcmcia/rsrc_mgr.c                     |    55 +-
 drivers/pcmcia/sa1100_adsbitsy.c              |     4 +-
 drivers/pcmcia/sa1100_assabet.c               |    20 +-
 drivers/pcmcia/sa1100_badge4.c                |     2 +-
 drivers/pcmcia/sa1100_cerf.c                  |    20 +-
 drivers/pcmcia/sa1100_flexanet.c              |    20 +-
 drivers/pcmcia/sa1100_freebird.c              |    20 +-
 drivers/pcmcia/sa1100_generic.c               |     4 +-
 drivers/pcmcia/sa1100_generic.h               |     3 +-
 drivers/pcmcia/sa1100_graphicsclient.c        |    14 +-
 drivers/pcmcia/sa1100_graphicsmaster.c        |     4 +-
 drivers/pcmcia/sa1100_h3600.c                 |    20 +-
 drivers/pcmcia/sa1100_jornada720.c            |     4 +-
 drivers/pcmcia/sa1100_neponset.c              |     4 +-
 drivers/pcmcia/sa1100_pangolin.c              |    20 +-
 drivers/pcmcia/sa1100_pfs168.c                |     4 +-
 drivers/pcmcia/sa1100_shannon.c               |    20 +-
 drivers/pcmcia/sa1100_simpad.c                |    20 +-
 drivers/pcmcia/sa1100_stork.c                 |    20 +-
 drivers/pcmcia/sa1100_system3.c               |     6 +-
 drivers/pcmcia/sa1100_trizeps.c               |    20 +-
 drivers/pcmcia/sa1100_xp860.c                 |     4 +-
 drivers/pcmcia/sa1100_yopy.c                  |    20 +-
 drivers/pcmcia/sa1111_generic.c               |    25 +-
 drivers/pcmcia/sa1111_generic.h               |    16 +-
 drivers/pcmcia/sa11xx_base.c                  |   104 +-
 drivers/pcmcia/soc_common.c                   |    51 +
 drivers/pcmcia/soc_common.h                   |     8 +
 drivers/pcmcia/tcic.c                         |     2 +-
 drivers/pcmcia/yenta_socket.c                 |     1 +
 drivers/pnp/isapnp/proc.c                     |     2 +-
 drivers/pnp/pnpbios/Kconfig                   |     2 +-
 drivers/pnp/pnpbios/bioscalls.c               |     6 +-
 drivers/pnp/pnpbios/core.c                    |     6 +-
 drivers/pnp/pnpbios/proc.c                    |     2 +-
 drivers/s390/Kconfig                          |    25 +-
 drivers/s390/block/dasd.c                     |    25 +-
 drivers/s390/block/dasd_cmb.c                 |     4 +-
 drivers/s390/block/dasd_devmap.c              |     5 +-
 drivers/s390/block/dasd_diag.c                |     8 +-
 drivers/s390/block/dasd_eckd.c                |    14 +-
 drivers/s390/block/dasd_erp.c                 |     5 +-
 drivers/s390/block/dasd_int.h                 |     9 +-
 drivers/s390/block/dasd_ioctl.c               |    14 +-
 drivers/s390/block/dasd_proc.c                |     4 +-
 drivers/s390/block/dcssblk.c                  |   114 +-
 drivers/s390/block/xpram.c                    |    29 +-
 drivers/s390/char/Makefile                    |     5 +-
 drivers/s390/char/con3215.c                   |     3 +-
 drivers/s390/char/keyboard.c                  |    19 +-
 drivers/s390/char/raw3270.c                   |   129 +-
 drivers/s390/char/raw3270.h                   |     7 +-
 drivers/s390/char/sclp_tty.c                  |    33 +-
 drivers/s390/char/sclp_vt220.c                |     3 +-
 drivers/s390/char/tape.h                      |     8 +-
 drivers/s390/char/tape_34xx.c                 |    22 +-
 drivers/s390/char/tape_block.c                |     2 +
 drivers/s390/char/tape_char.c                 |    16 +-
 drivers/s390/char/tape_core.c                 |    18 +-
 drivers/s390/char/tape_proc.c                 |     2 +
 drivers/s390/char/tape_std.c                  |     2 +
 drivers/s390/char/tty3270.c                   |    37 +-
 drivers/s390/cio/airq.c                       |    38 +-
 drivers/s390/cio/blacklist.c                  |     2 +-
 drivers/s390/cio/ccwgroup.c                   |    24 +-
 drivers/s390/cio/chsc.c                       |    40 +-
 drivers/s390/cio/chsc.h                       |     1 -
 drivers/s390/cio/cio.c                        |     8 +-
 drivers/s390/cio/css.c                        |    96 +-
 drivers/s390/cio/css.h                        |     4 +-
 drivers/s390/cio/device.c                     |   106 +-
 drivers/s390/cio/device_fsm.c                 |   185 +-
 drivers/s390/cio/device_pgid.c                |     4 +
 drivers/s390/cio/requestirq.c                 |    17 +-
 drivers/s390/crypto/z90crypt.h                |    22 +-
 drivers/s390/crypto/z90main.c                 |    65 +-
 drivers/s390/net/ctctty.c                     |    15 +-
 drivers/s390/net/iucv.c                       |    46 +-
 drivers/s390/net/lcs.c                        |   104 +-
 drivers/s390/net/lcs.h                        |     3 +-
 drivers/s390/net/netiucv.c                    |   121 +-
 drivers/s390/net/qeth.h                       |    59 +-
 drivers/s390/net/qeth_fs.h                    |     5 +
 drivers/s390/net/qeth_main.c                  |   991 +-
 drivers/s390/net/qeth_mpc.c                   |     5 +-
 drivers/s390/net/qeth_mpc.h                   |    90 +-
 drivers/s390/net/qeth_proc.c                  |    40 +-
 drivers/s390/net/qeth_sys.c                   |    67 +-
 drivers/s390/s390mach.c                       |    25 +-
 drivers/s390/scsi/zfcp_aux.c                  |   105 +-
 drivers/s390/scsi/zfcp_ccw.c                  |    12 +-
 drivers/s390/scsi/zfcp_def.h                  |    27 +-
 drivers/s390/scsi/zfcp_erp.c                  |    38 +-
 drivers/s390/scsi/zfcp_ext.h                  |     6 +-
 drivers/s390/scsi/zfcp_fsf.c                  |    10 +-
 drivers/s390/scsi/zfcp_qdio.c                 |    19 +-
 drivers/s390/scsi/zfcp_scsi.c                 |     4 +-
 drivers/s390/scsi/zfcp_sysfs_adapter.c        |     4 +-
 drivers/s390/scsi/zfcp_sysfs_driver.c         |     4 +-
 drivers/s390/scsi/zfcp_sysfs_port.c           |     6 +-
 drivers/s390/scsi/zfcp_sysfs_unit.c           |     6 +-
 drivers/scsi/3w-xxxx.c                        |    48 +-
 drivers/scsi/3w-xxxx.h                        |     8 +-
 drivers/scsi/Kconfig                          |    75 +-
 drivers/scsi/Makefile                         |     5 +-
 drivers/scsi/NCR53c406a.c                     |     3 +-
 drivers/scsi/aacraid/README                   |     8 +-
 drivers/scsi/aacraid/aacraid.h                |   157 +-
 drivers/scsi/aacraid/commctrl.c               |    37 +-
 drivers/scsi/aacraid/comminit.c               |     9 +-
 drivers/scsi/aacraid/commsup.c                |    81 +-
 drivers/scsi/aacraid/dpcsup.c                 |    53 +-
 drivers/scsi/aacraid/linit.c                  |    12 +-
 drivers/scsi/aacraid/sa.c                     |     5 +
 drivers/scsi/aha152x.c                        |     7 +-
 drivers/scsi/aic7xxx/aic7770_osm.c            |    23 +-
 drivers/scsi/aic7xxx/aic79xx_osm.c            |     1 +
 drivers/scsi/aic7xxx/aic7xxx_osm.c            |    47 +-
 drivers/scsi/aic7xxx/aic7xxx_osm.h            |    14 +-
 drivers/scsi/aic7xxx_old.c                    |    47 +-
 drivers/scsi/aic7xxx_old/aic7xxx_proc.c       |     6 +-
 drivers/scsi/ata_piix.c                       |    37 +-
 drivers/scsi/atp870u.c                        |    40 +-
 drivers/scsi/constants.c                      |     2 +
 drivers/scsi/cpqfcTScontrol.c                 |     2 +
 drivers/scsi/dc390.h                          |    12 +-
 drivers/scsi/dpt_i2o.c                        |   161 +-
 drivers/scsi/dpti.h                           |     4 +-
 drivers/scsi/esp.c                            |   141 +-
 drivers/scsi/esp.h                            |    10 +-
 drivers/scsi/gdth.c                           |  3147 ++--
 drivers/scsi/gdth.h                           |   157 +-
 drivers/scsi/gdth_ioctl.h                     |    50 +-
 drivers/scsi/gdth_proc.c                      |  1591 +-
 drivers/scsi/gdth_proc.h                      |    29 +-
 drivers/scsi/hosts.c                          |     4 +-
 drivers/scsi/ide-scsi.c                       |    18 +-
 drivers/scsi/imm.c                            |    40 +-
 drivers/scsi/imm.h                            |     2 +-
 drivers/scsi/ini9100u.c                       |    14 +-
 drivers/scsi/ini9100u.h                       |     3 +-
 drivers/scsi/libata-core.c                    |   808 +-
 drivers/scsi/libata-scsi.c                    |   224 +-
 drivers/scsi/libata.h                         |     4 -
 drivers/scsi/megaraid.c                       |     1 +
 drivers/scsi/ncr53c8xx.c                      |     6 +-
 drivers/scsi/nsp32.c                          |    25 +-
 drivers/scsi/nsp32.h                          |     4 -
 drivers/scsi/osst.c                           |    24 +-
 drivers/scsi/pci2000.c                        |    10 +-
 drivers/scsi/pcmcia/Kconfig                   |    10 +
 drivers/scsi/pcmcia/Makefile                  |     3 +-
 drivers/scsi/pcmcia/nsp_cs.c                  |    13 +-
 drivers/scsi/pcmcia/nsp_cs.h                  |     2 -
 drivers/scsi/pcmcia/qlogic_stub.c             |    65 +-
 drivers/scsi/ppa.c                            |    30 +-
 drivers/scsi/ppa.h                            |     2 +-
 drivers/scsi/qla1280.c                        |     5 +-
 drivers/scsi/qla1280.h                        |     3 +-
 drivers/scsi/qla2xxx/ql2300_fw.c              | 12380 ++++++++--------
 drivers/scsi/qla2xxx/ql2322_fw.c              | 11812 +++++++--------
 drivers/scsi/qla2xxx/ql6312_fw.c              | 10174 ++++++-------
 drivers/scsi/qla2xxx/ql6322_fw.c              | 10352 ++++++-------
 drivers/scsi/qla2xxx/qla_dbg.c                |    34 +-
 drivers/scsi/qla2xxx/qla_def.h                |    27 +-
 drivers/scsi/qla2xxx/qla_gbl.h                |    10 +-
 drivers/scsi/qla2xxx/qla_gs.c                 |    72 +-
 drivers/scsi/qla2xxx/qla_init.c               |   278 +-
 drivers/scsi/qla2xxx/qla_iocb.c               |    20 +-
 drivers/scsi/qla2xxx/qla_isr.c                |    12 +-
 drivers/scsi/qla2xxx/qla_mbx.c                |    12 +-
 drivers/scsi/qla2xxx/qla_os.c                 |   165 +-
 drivers/scsi/qla2xxx/qla_rscn.c               |     4 +-
 drivers/scsi/qla2xxx/qla_sup.c                |   446 -
 drivers/scsi/qla2xxx/qla_version.h            |     4 +-
 drivers/scsi/qlogicfas.c                      |   684 +-
 drivers/scsi/qlogicfas408.c                   |     2 +-
 drivers/scsi/qlogicpti.c                      |    59 +-
 drivers/scsi/qlogicpti.h                      |     6 +-
 drivers/scsi/sata_promise.c                   |  1276 +-
 drivers/scsi/sata_sil.c                       |    21 +-
 drivers/scsi/sata_sis.c                       |    10 +-
 drivers/scsi/sata_svw.c                       |    10 +-
 drivers/scsi/sata_sx4.c                       |     4 +-
 drivers/scsi/sata_via.c                       |    34 +-
 drivers/scsi/sata_vsc.c                       |     9 +-
 drivers/scsi/scsi.c                           |     2 -
 drivers/scsi/scsi_debug.c                     |     8 +-
 drivers/scsi/scsi_devinfo.c                   |     2 +-
 drivers/scsi/scsi_ioctl.c                     |    21 +-
 drivers/scsi/scsi_lib.c                       |     4 +-
 drivers/scsi/scsi_logging.h                   |     2 +-
 drivers/scsi/scsi_proc.c                      |     2 +-
 drivers/scsi/scsi_scan.c                      |    72 +-
 drivers/scsi/scsi_sysfs.c                     |    24 +-
 drivers/scsi/scsiiom.c                        |    45 +-
 drivers/scsi/sd.c                             |    50 +-
 drivers/scsi/sg.c                             |   268 +-
 drivers/scsi/sgiwd93.c                        |   391 +-
 drivers/scsi/sgiwd93.h                        |     2 +-
 drivers/scsi/sr.c                             |    31 +-
 drivers/scsi/sr.h                             |     2 +-
 drivers/scsi/sr_ioctl.c                       |    36 +-
 drivers/scsi/sr_vendor.c                      |     8 +-
 drivers/scsi/st.c                             |   198 +-
 drivers/scsi/st.h                             |     1 -
 drivers/scsi/sym53c8xx_comm.h                 |     5 +-
 drivers/scsi/tmscsim.c                        |   954 +-
 drivers/scsi/tmscsim.h                        |    23 +-
 drivers/scsi/wd7000.c                         |     7 +-
 drivers/serial/68360serial.c                  |     6 +-
 drivers/serial/8250_acpi.c                    |     1 -
 drivers/serial/8250_pci.c                     |    18 +-
 drivers/serial/8250_pnp.c                     |     2 +-
 drivers/serial/Kconfig                        |     1 +
 drivers/serial/pmac_zilog.c                   |     2 +-
 drivers/serial/pxa.c                          |    23 +-
 drivers/serial/s3c2410.c                      |     2 +-
 drivers/serial/serial_core.c                  |    31 +-
 drivers/serial/sh-sci.c                       |    23 +-
 drivers/serial/sunsab.c                       |    29 +-
 drivers/serial/sunsu.c                        |    20 +-
 drivers/serial/sunzilog.c                     |    23 +-
 drivers/telephony/ixj.h                       |     9 -
 drivers/usb/Makefile                          |     1 +
 drivers/usb/class/bluetty.c                   |     4 +-
 drivers/usb/class/cdc-acm.c                   |   251 +-
 drivers/usb/class/usblp.c                     |    21 +-
 drivers/usb/core/Makefile                     |     2 +-
 drivers/usb/core/config.c                     |   361 +-
 drivers/usb/core/devices.c                    |    43 +-
 drivers/usb/core/devio.c                      |   417 +-
 drivers/usb/core/hcd-pci.c                    |    77 +-
 drivers/usb/core/hcd.c                        |    51 +-
 drivers/usb/core/hcd.h                        |    19 +-
 drivers/usb/core/hub.c                        |   966 +-
 drivers/usb/core/hub.h                        |     2 +
 drivers/usb/core/inode.c                      |     3 -
 drivers/usb/core/message.c                    |    97 +-
 drivers/usb/core/urb.c                        |    23 +-
 drivers/usb/core/usb.c                        |   239 +-
 drivers/usb/core/usb.h                        |     4 +-
 drivers/usb/gadget/Kconfig                    |     1 +
 drivers/usb/gadget/dummy_hcd.c                |   166 +-
 drivers/usb/gadget/epautoconf.c               |     3 +-
 drivers/usb/gadget/ether.c                    |    94 +-
 drivers/usb/gadget/file_storage.c             |     2 +-
 drivers/usb/gadget/gadget_chips.h             |     2 +-
 drivers/usb/gadget/pxa2xx_udc.c               |     1 +
 drivers/usb/gadget/rndis.c                    |    60 +-
 drivers/usb/gadget/rndis.h                    |     1 +
 drivers/usb/gadget/serial.c                   |     6 +-
 drivers/usb/gadget/zero.c                     |    65 +-
 drivers/usb/host/ehci-dbg.c                   |    30 +-
 drivers/usb/host/ehci-hcd.c                   |   146 +-
 drivers/usb/host/ehci-hub.c                   |   182 +-
 drivers/usb/host/ehci-mem.c                   |    39 +-
 drivers/usb/host/ehci-q.c                     |    10 +-
 drivers/usb/host/ehci-sched.c                 |     6 +-
 drivers/usb/host/ehci.h                       |    14 +-
 drivers/usb/host/ohci-dbg.c                   |    14 +-
 drivers/usb/host/ohci-hcd.c                   |   140 +-
 drivers/usb/host/ohci-hub.c                   |   294 +-
 drivers/usb/host/ohci-mem.c                   |     3 +
 drivers/usb/host/ohci-pci.c                   |   165 +-
 drivers/usb/host/ohci-q.c                     |    21 +-
 drivers/usb/host/ohci.h                       |    28 +-
 drivers/usb/host/uhci-debug.c                 |    11 +-
 drivers/usb/host/uhci-hcd.c                   |   142 +-
 drivers/usb/host/uhci-hcd.h                   |    19 +-
 drivers/usb/image/mdc800.c                    |    27 +-
 drivers/usb/input/Kconfig                     |    13 +
 drivers/usb/input/Makefile                    |     1 +
 drivers/usb/input/aiptek.c                    |  2329 ++-
 drivers/usb/input/hid-core.c                  |    38 +-
 drivers/usb/input/hiddev.c                    |     4 +-
 drivers/usb/input/kbtab.c                     |     2 +-
 drivers/usb/input/mtouchusb.c                 |   111 +-
 drivers/usb/input/powermate.c                 |    20 +-
 drivers/usb/input/wacom.c                     |     4 +-
 drivers/usb/media/Kconfig                     |     2 +-
 drivers/usb/media/dsbr100.c                   |   224 +-
 drivers/usb/media/ibmcam.c                    |     9 +-
 drivers/usb/media/konicawc.c                  |    19 +-
 drivers/usb/media/ov511.c                     |    14 +-
 drivers/usb/media/pwc-if.c                    |    16 +-
 drivers/usb/media/se401.c                     |     2 +-
 drivers/usb/media/ultracam.c                  |     9 +-
 drivers/usb/media/vicam.c                     |     2 +-
 drivers/usb/media/w9968cf.c                   |     2 +-
 drivers/usb/media/w9968cf.h                   |     4 +-
 drivers/usb/misc/Kconfig                      |    12 +
 drivers/usb/misc/Makefile                     |     1 +
 drivers/usb/misc/cytherm.c                    |    27 +-
 drivers/usb/misc/emi26.c                      |     4 +-
 drivers/usb/misc/emi26_fw.h                   |     6 +-
 drivers/usb/misc/emi62.c                      |     4 +-
 drivers/usb/misc/emi62_fw_m.h                 |     7 +-
 drivers/usb/misc/emi62_fw_s.h                 |     7 +-
 drivers/usb/misc/legousbtower.c               |   761 +-
 drivers/usb/misc/speedtch.c                   |     6 +-
 drivers/usb/misc/tiglusb.c                    |    64 +-
 drivers/usb/misc/usbtest.c                    |     8 +-
 drivers/usb/misc/uss720.c                     |     2 +-
 drivers/usb/net/catc.c                        |     4 +-
 drivers/usb/net/kaweth.c                      |    29 +-
 drivers/usb/net/pegasus.c                     |    10 +-
 drivers/usb/net/pegasus.h                     |     3 +
 drivers/usb/net/rtl8150.c                     |    14 +-
 drivers/usb/net/usbnet.c                      |    62 +-
 drivers/usb/serial/Kconfig                    |     4 +-
 drivers/usb/serial/belkin_sa.c                |    28 +-
 drivers/usb/serial/console.c                  |     7 +-
 drivers/usb/serial/cyberjack.c                |    52 +-
 drivers/usb/serial/digi_acceleport.c          |    16 +-
 drivers/usb/serial/empeg.c                    |    34 +-
 drivers/usb/serial/ftdi_sio.c                 |   242 +-
 drivers/usb/serial/generic.c                  |    21 +-
 drivers/usb/serial/io_edgeport.c              |   126 +-
 drivers/usb/serial/io_ti.c                    |   106 +-
 drivers/usb/serial/ipaq.c                     |    33 +-
 drivers/usb/serial/ir-usb.c                   |    41 +-
 drivers/usb/serial/keyspan.c                  |     9 +-
 drivers/usb/serial/keyspan.h                  |    19 +-
 drivers/usb/serial/keyspan_pda.c              |    25 +-
 drivers/usb/serial/kl5kusb105.c               |    58 +-
 drivers/usb/serial/kobil_sct.c                |    56 +-
 drivers/usb/serial/omninet.c                  |    48 +-
 drivers/usb/serial/pl2303.c                   |    39 +-
 drivers/usb/serial/pl2303.h                   |     3 +
 drivers/usb/serial/safe_serial.c              |    15 +-
 drivers/usb/serial/usb-serial.c               |   100 +-
 drivers/usb/serial/usb-serial.h               |    65 +-
 drivers/usb/serial/visor.c                    |   174 +-
 drivers/usb/serial/visor.h                    |     1 +
 drivers/usb/serial/whiteheat.c                |    23 +-
 drivers/usb/storage/datafab.c                 |     4 +-
 drivers/usb/storage/isd200.c                  |    30 +-
 drivers/usb/storage/jumpshot.c                |     4 +-
 drivers/usb/storage/scsiglue.c                |    19 +-
 drivers/usb/storage/scsiglue.h                |     2 +-
 drivers/usb/storage/shuttle_usbat.c           |   156 +-
 drivers/usb/storage/shuttle_usbat.h           |    20 -
 drivers/usb/storage/transport.c               |    61 +-
 drivers/usb/storage/unusual_devs.h            |    40 +-
 drivers/usb/storage/usb.c                     |     4 +-
 drivers/usb/storage/usb.h                     |     8 +-
 drivers/video/68328fb.c                       |   762 +-
 drivers/video/Kconfig                         |    74 +
 drivers/video/Makefile                        |     8 +-
 drivers/video/atafb.c                         |    11 -
 drivers/video/aty/atyfb_base.c                |    42 +-
 drivers/video/aty/radeon_accel.c              |    26 +-
 drivers/video/aty/radeon_base.c               |    36 +-
 drivers/video/aty/radeon_i2c.c                |    16 +-
 drivers/video/aty/radeon_monitor.c            |     3 +-
 drivers/video/aty/radeon_pm.c                 |     2 +-
 drivers/video/aty/radeonfb.h                  |    11 -
 drivers/video/console/Makefile                |     2 +-
 drivers/video/console/dummycon.c              |     2 +
 drivers/video/console/fbcon.c                 |   317 +-
 drivers/video/console/fbcon.h                 |     1 -
 drivers/video/console/mdacon.c                |     8 +-
 drivers/video/console/newport_con.c           |   128 +-
 drivers/video/console/promcon.c               |     1 +
 drivers/video/console/sticon.c                |     3 +-
 drivers/video/console/vgacon.c                |     1 +
 drivers/video/cyber2000fb.c                   |     2 +-
 drivers/video/cyberfb.c                       |     9 -
 drivers/video/fbmem.c                         |    41 +-
 drivers/video/hgafb.c                         |    15 +-
 drivers/video/imsttfb.c                       |     2 +-
 drivers/video/logo/logo.c                     |     2 +-
 drivers/video/matrox/matroxfb_DAC1064.c       |     4 +-
 drivers/video/matrox/matroxfb_Ti3026.c        |     2 +-
 drivers/video/matrox/matroxfb_base.c          |    62 +-
 drivers/video/matrox/matroxfb_base.h          |     1 +
 drivers/video/matrox/matroxfb_crtc2.c         |     9 -
 drivers/video/matrox/matroxfb_g450.c          |     4 +-
 drivers/video/matrox/matroxfb_maven.c         |     3 +-
 drivers/video/modedb.c                        |    15 +-
 drivers/video/neofb.c                         |   511 +-
 drivers/video/pm2fb.c                         |    54 +-
 drivers/video/pxafb.c                         |     2 +-
 drivers/video/q40fb.c                         |   109 +-
 drivers/video/radeonfb.c                      |     1 -
 drivers/video/retz3fb.c                       |    12 -
 drivers/video/riva/fbdev.c                    |    33 +-
 drivers/video/sa1100fb.c                      |    23 +-
 drivers/video/sbuslib.c                       |     1 +
 drivers/video/tdfxfb.c                        |     8 +-
 drivers/video/tgafb.c                         |     1 +
 drivers/video/tridentfb.c                     |    13 +-
 drivers/video/vesafb.c                        |    98 +-
 drivers/video/vfb.c                           |   110 +-
 drivers/video/vga16fb.c                       |     4 +-
 drivers/video/virgefb.c                       |     9 -
 fs/Kconfig                                    |    90 +-
 fs/Makefile                                   |     1 -
 fs/afs/dir.c                                  |     2 +
 fs/afs/file.c                                 |     8 +-
 fs/afs/proc.c                                 |    14 +-
 fs/aio.c                                      |    62 +-
 fs/autofs4/autofs_i.h                         |    44 +-
 fs/autofs4/expire.c                           |   349 +-
 fs/autofs4/inode.c                            |    18 +-
 fs/autofs4/root.c                             |   489 +-
 fs/autofs4/waitq.c                            |   130 +-
 fs/befs/befs.h                                |     3 -
 fs/befs/btree.c                               |     4 +-
 fs/befs/debug.c                               |    29 +-
 fs/befs/io.c                                  |    21 +-
 fs/befs/linuxvfs.c                            |    15 +-
 fs/bfs/dir.c                                  |     7 +-
 fs/binfmt_aout.c                              |     2 +-
 fs/binfmt_elf.c                               |    40 +-
 fs/binfmt_em86.c                              |     4 +-
 fs/binfmt_flat.c                              |     4 +-
 fs/binfmt_misc.c                              |    16 +-
 fs/binfmt_script.c                            |     4 +-
 fs/binfmt_som.c                               |     2 +-
 fs/bio.c                                      |    16 +-
 fs/block_dev.c                                |    16 +-
 fs/buffer.c                                   |   103 +-
 fs/cifs/AUTHORS                               |     6 +-
 fs/cifs/CHANGES                               |    40 +-
 fs/cifs/README                                |    82 +-
 fs/cifs/TODO                                  |    49 +-
 fs/cifs/cifs_debug.c                          |   108 +-
 fs/cifs/cifs_debug.h                          |    14 -
 fs/cifs/cifsfs.c                              |    53 +-
 fs/cifs/cifsfs.h                              |     4 +-
 fs/cifs/cifsglob.h                            |    38 +-
 fs/cifs/cifspdu.h                             |   191 +-
 fs/cifs/cifsproto.h                           |    16 +-
 fs/cifs/cifssmb.c                             |   293 +-
 fs/cifs/connect.c                             |    96 +-
 fs/cifs/dir.c                                 |    98 +-
 fs/cifs/fcntl.c                               |    29 +-
 fs/cifs/file.c                                |   350 +-
 fs/cifs/inode.c                               |   128 +-
 fs/cifs/link.c                                |    40 +-
 fs/cifs/misc.c                                |    13 +-
 fs/cifs/transport.c                           |   110 +-
 fs/cifs/xattr.c                               |    49 +-
 fs/coda/file.c                                |     4 +-
 fs/coda/pioctl.c                              |     2 +-
 fs/coda/psdev.c                               |     6 +-
 fs/coda/sysctl.c                              |     8 +-
 fs/compat.c                                   |  1050 +-
 fs/compat_ioctl.c                             |   754 +-
 fs/dcache.c                                   |   246 +-
 fs/dcookies.c                                 |     2 +-
 fs/devfs/base.c                               |    12 +-
 fs/direct-io.c                                |    34 +-
 fs/dnotify.c                                  |     4 +-
 fs/dquot.c                                    |    68 +-
 fs/eventpoll.c                                |    82 +-
 fs/exec.c                                     |    59 +-
 fs/exportfs/expfs.c                           |     4 +
 fs/ext2/ialloc.c                              |     4 +-
 fs/ext2/inode.c                               |     1 +
 fs/ext2/ioctl.c                               |     8 +-
 fs/ext3/inode.c                               |    20 +-
 fs/ext3/ioctl.c                               |     8 +-
 fs/ext3/namei.c                               |    51 +-
 fs/ext3/super.c                               |    43 +-
 fs/fat/file.c                                 |     3 +-
 fs/fat/inode.c                                |     2 +-
 fs/fcntl.c                                    |     5 +-
 fs/fs-writeback.c                             |    54 +-
 fs/hfs/catalog.c                              |    27 +-
 fs/hfs/inode.c                                |     2 +-
 fs/hfsplus/brec.c                             |     4 +-
 fs/hfsplus/catalog.c                          |    27 +-
 fs/hfsplus/dir.c                              |    28 +-
 fs/hfsplus/inode.c                            |     2 +-
 fs/hfsplus/ioctl.c                            |     4 +-
 fs/hugetlbfs/inode.c                          |    92 +-
 fs/inode.c                                    |    39 +-
 fs/ioctl.c                                    |     9 +-
 fs/isofs/inode.c                              |     5 +-
 fs/jbd/commit.c                               |     6 +-
 fs/jbd/journal.c                              |    12 +-
 fs/jbd/revoke.c                               |     4 +-
 fs/jbd/transaction.c                          |    12 +-
 fs/jffs/inode-v23.c                           |     4 +-
 fs/jffs2/Makefile                             |    18 +-
 fs/jfs/jfs_btree.h                            |    24 +-
 fs/jfs/jfs_debug.c                            |     6 +-
 fs/jfs/jfs_dmap.c                             |     4 +-
 fs/jfs/jfs_dtree.c                            |    95 +-
 fs/jfs/jfs_incore.h                           |     8 +
 fs/jfs/jfs_logmgr.c                           |    62 +-
 fs/jfs/jfs_logmgr.h                           |     5 +-
 fs/jfs/jfs_metapage.c                         |   108 +-
 fs/jfs/jfs_metapage.h                         |     1 +
 fs/jfs/jfs_mount.c                            |     5 +
 fs/jfs/jfs_txnmgr.c                           |   206 +-
 fs/jfs/jfs_txnmgr.h                           |    20 +-
 fs/jfs/jfs_types.h                            |    12 +-
 fs/jfs/jfs_umount.c                           |     8 +-
 fs/jfs/namei.c                                |   127 +-
 fs/jfs/super.c                                |    47 +-
 fs/jfs/xattr.c                                |    36 +-
 fs/locks.c                                    |    54 +-
 fs/namei.c                                    |     4 +-
 fs/namespace.c                                |    70 +-
 fs/ncpfs/file.c                               |     4 +-
 fs/ncpfs/ncplib_kernel.c                      |     2 +-
 fs/ncpfs/ncplib_kernel.h                      |     2 +-
 fs/nfs/direct.c                               |   184 +-
 fs/nfs/file.c                                 |    22 +-
 fs/nfs/inode.c                                |    16 +-
 fs/nfs/nfs2xdr.c                              |    11 +-
 fs/nfs/nfs3xdr.c                              |    11 +-
 fs/nfs/nfs4state.c                            |     2 +
 fs/nfs/nfs4xdr.c                              |    11 +-
 fs/nfs/read.c                                 |    58 +-
 fs/nfs/unlink.c                               |     4 +
 fs/nfs/write.c                                |    58 +-
 fs/nfsd/export.c                              |     3 +-
 fs/nfsd/nfs3proc.c                            |     1 -
 fs/nfsd/nfs3xdr.c                             |    51 +-
 fs/nfsd/nfs4idmap.c                           |   105 +-
 fs/nfsd/nfs4proc.c                            |     2 +-
 fs/nfsd/nfs4state.c                           |    45 +-
 fs/nfsd/nfs4xdr.c                             |    87 +-
 fs/nfsd/nfsctl.c                              |     4 +-
 fs/nfsd/nfsfh.c                               |     4 +-
 fs/nfsd/nfsproc.c                             |     2 +
 fs/nfsd/vfs.c                                 |    54 +-
 fs/ntfs/ChangeLog                             |   147 +-
 fs/ntfs/Makefile                              |     8 +-
 fs/ntfs/aops.c                                |    61 +-
 fs/ntfs/attrib.c                              |    63 +-
 fs/ntfs/attrib.h                              |    18 +-
 fs/ntfs/compress.c                            |    19 +-
 fs/ntfs/debug.c                               |     9 +-
 fs/ntfs/debug.h                               |     9 +-
 fs/ntfs/dir.c                                 |    93 +-
 fs/ntfs/dir.h                                 |    15 +-
 fs/ntfs/endian.h                              |     9 +-
 fs/ntfs/file.c                                |     9 +-
 fs/ntfs/inode.c                               |   254 +-
 fs/ntfs/inode.h                               |    17 +-
 fs/ntfs/layout.h                              |    56 +-
 fs/ntfs/logfile.c                             |     9 +-
 fs/ntfs/logfile.h                             |     2 +-
 fs/ntfs/malloc.h                              |     2 +-
 fs/ntfs/mft.c                                 |   669 +-
 fs/ntfs/mft.h                                 |    58 +-
 fs/ntfs/mst.c                                 |     2 +-
 fs/ntfs/namei.c                               |    16 +-
 fs/ntfs/ntfs.h                                |    48 +-
 fs/ntfs/super.c                               |   421 +-
 fs/ntfs/sysctl.c                              |    13 +-
 fs/ntfs/sysctl.h                              |    13 +-
 fs/ntfs/time.h                                |     2 +-
 fs/ntfs/types.h                               |     4 +-
 fs/ntfs/unistr.c                              |    62 +-
 fs/ntfs/upcase.c                              |     8 +-
 fs/ntfs/volume.h                              |     6 +-
 fs/open.c                                     |    14 +-
 fs/partitions/check.c                         |     3 +
 fs/partitions/msdos.c                         |    23 +-
 fs/proc/array.c                               |    11 +-
 fs/proc/base.c                                |    12 +-
 fs/proc/kcore.c                               |     4 +
 fs/proc/proc_misc.c                           |     4 +-
 fs/proc/task_mmu.c                            |     2 +-
 fs/quota_v1.c                                 |     2 +
 fs/quota_v2.c                                 |    20 +-
 fs/ramfs/inode.c                              |     1 +
 fs/read_write.c                               |     3 +-
 fs/readdir.c                                  |    11 +-
 fs/reiserfs/Makefile                          |    12 +
 fs/reiserfs/bitmap.c                          |   111 +-
 fs/reiserfs/dir.c                             |    15 +-
 fs/reiserfs/do_balan.c                        |    28 +-
 fs/reiserfs/file.c                            |    98 +-
 fs/reiserfs/fix_node.c                        |    34 +-
 fs/reiserfs/inode.c                           |   303 +-
 fs/reiserfs/ioctl.c                           |     8 +-
 fs/reiserfs/item_ops.c                        |    37 +-
 fs/reiserfs/journal.c                         |   204 +-
 fs/reiserfs/lbalance.c                        |     4 +-
 fs/reiserfs/namei.c                           |   133 +-
 fs/reiserfs/objectid.c                        |     4 +-
 fs/reiserfs/prints.c                          |    50 +-
 fs/reiserfs/procfs.c                          |     7 +-
 fs/reiserfs/stree.c                           |   256 +-
 fs/reiserfs/super.c                           |   270 +-
 fs/reiserfs/tail_conversion.c                 |    14 +-
 fs/smbfs/file.c                               |     4 +-
 fs/smbfs/ioctl.c                              |     6 +-
 fs/smbfs/smbiod.c                             |     2 +-
 fs/stat.c                                     |    16 +-
 fs/super.c                                    |    22 +-
 fs/sysfs/bin.c                                |     2 +-
 fs/sysfs/dir.c                                |    31 +-
 fs/sysfs/file.c                               |     3 +-
 fs/sysfs/inode.c                              |     7 +-
 fs/sysfs/symlink.c                            |   135 +-
 fs/sysfs/sysfs.h                              |    16 +
 fs/udf/file.c                                 |    12 +-
 fs/udf/namei.c                                |    20 +-
 fs/xfs/Makefile                               |    14 +-
 fs/xfs/linux-2.6/xfs_iops.c                   |    30 +-
 fs/xfs/quota/xfs_qm.c                         |     5 +-
 fs/xfs/quota/xfs_qm_syscalls.c                |     5 +-
 fs/xfs/support/debug.h                        |     3 +-
 fs/xfs/xfs.h                                  |     4 +-
 fs/xfs/xfs_acl.c                              |    11 +-
 fs/xfs/xfs_attr.c                             |    64 +-
 fs/xfs/xfs_attr.h                             |     4 +-
 fs/xfs/xfs_bit.c                              |    68 +-
 fs/xfs/xfs_bmap.c                             |    66 +-
 fs/xfs/xfs_bmap.h                             |     7 -
 fs/xfs/xfs_bmap_btree.c                       |     2 +-
 fs/xfs/xfs_bmap_btree.h                       |     2 +-
 fs/xfs/xfs_buf_item.c                         |     6 +-
 fs/xfs/xfs_clnt.h                             |     2 +
 fs/xfs/xfs_da_btree.c                         |     8 +-
 fs/xfs/xfs_fsops.c                            |     3 +-
 fs/xfs/xfs_inode.c                            |    54 +-
 fs/xfs/xfs_inode.h                            |     5 +-
 fs/xfs/xfs_iomap.c                            |    49 +-
 fs/xfs/xfs_itable.c                           |    91 +-
 fs/xfs/xfs_itable.h                           |     4 -
 fs/xfs/xfs_log.c                              |    24 +-
 fs/xfs/xfs_log_recover.c                      |     2 +
 fs/xfs/xfs_mount.c                            |    11 +-
 fs/xfs/xfs_mount.h                            |     9 +-
 fs/xfs/xfs_trans.c                            |    28 +-
 fs/xfs/xfs_trans.h                            |     2 -
 fs/xfs/xfs_trans_ail.c                        |     8 +-
 fs/xfs/xfs_trans_buf.c                        |    35 -
 fs/xfs/xfs_trans_item.c                       |    14 +-
 fs/xfs/xfs_vfsops.c                           |     9 +-
 fs/xfs/xfs_vnodeops.c                         |    21 +-
 include/acpi/acpiosxf.h                       |     4 +
 include/asm-alpha/atomic.h                    |     3 +
 include/asm-alpha/cacheflush.h                |     2 +
 include/asm-alpha/checksum.h                  |     2 +-
 include/asm-alpha/core_mcpcia.h               |    10 +-
 include/asm-alpha/core_polaris.h              |    14 +-
 include/asm-alpha/elf.h                       |     5 +
 include/asm-alpha/floppy.h                    |     9 +-
 include/asm-alpha/ide.h                       |     5 +
 include/asm-alpha/io.h                        |     4 +-
 include/asm-alpha/page.h                      |    14 +-
 include/asm-alpha/pgtable.h                   |     4 +-
 include/asm-alpha/semaphore.h                 |     8 +-
 include/asm-alpha/signal.h                    |     1 -
 include/asm-alpha/spinlock.h                  |     1 +
 include/asm-alpha/types.h                     |     2 +
 include/asm-alpha/uaccess.h                   |    61 +-
 include/asm-alpha/unistd.h                    |    13 +
 include/asm-arm/arch-adifcc/memory.h          |    28 -
 include/asm-arm/arch-cl7500/memory.h          |    26 +-
 include/asm-arm/arch-clps711x/memory.h        |    35 +-
 include/asm-arm/arch-ebsa110/io.h             |     2 +-
 include/asm-arm/arch-ebsa110/memory.h         |    22 +-
 include/asm-arm/arch-ebsa110/system.h         |     4 +-
 include/asm-arm/arch-ebsa110/timex.h          |     2 +-
 include/asm-arm/arch-ebsa110/uncompress.h     |    40 +-
 include/asm-arm/arch-ebsa285/memory.h         |    18 +-
 include/asm-arm/arch-epxa10db/memory.h        |    29 +-
 include/asm-arm/arch-integrator/memory.h      |    32 +-
 include/asm-arm/arch-iop3xx/memory.h          |    28 -
 include/asm-arm/arch-l7200/memory.h           |    27 -
 include/asm-arm/arch-lh7a40x/hardware.h       |     6 +-
 include/asm-arm/arch-lh7a40x/ide.h            |     7 -
 include/asm-arm/arch-lh7a40x/memory.h         |    27 -
 include/asm-arm/arch-nexuspci/memory.h        |    29 +-
 include/asm-arm/arch-omap/board-innovator.h   |   106 +-
 include/asm-arm/arch-omap/bus.h               |     4 +
 include/asm-arm/arch-omap/dma.h               |   152 +-
 include/asm-arm/arch-omap/gpio.h              |    12 +-
 include/asm-arm/arch-omap/hardware.h          |   222 +-
 include/asm-arm/arch-omap/io.h                |    66 +
 include/asm-arm/arch-omap/memory.h            |    29 +-
 include/asm-arm/arch-omap/mux.h               |    14 +-
 include/asm-arm/arch-omap/omap1610.h          |    66 +-
 include/asm-arm/arch-omap/omap5912.h          |    44 +-
 include/asm-arm/arch-omap/omap730.h           |     4 +-
 include/asm-arm/arch-omap/time.h              |     2 +-
 include/asm-arm/arch-omap/uncompress.h        |    25 +-
 include/asm-arm/arch-pxa/dma.h                |    24 +-
 include/asm-arm/arch-pxa/hardware.h           |    45 +-
 include/asm-arm/arch-pxa/irqs.h               |    19 +-
 include/asm-arm/arch-pxa/lubbock.h            |     3 +
 include/asm-arm/arch-pxa/memory.h             |    28 -
 include/asm-arm/arch-pxa/pxa-regs.h           |   769 +-
 include/asm-arm/arch-pxa/timex.h              |    18 +-
 include/asm-arm/arch-rpc/memory.h             |    26 +-
 include/asm-arm/arch-s3c2410/memory.h         |    25 +-
 include/asm-arm/arch-s3c2410/regs-gpio.h      |     7 +-
 include/asm-arm/arch-s3c2410/regs-irq.h       |     5 +
 include/asm-arm/arch-s3c2410/time.h           |     2 +-
 include/asm-arm/arch-sa1100/memory.h          |    29 -
 include/asm-arm/arch-shark/memory.h           |    22 +-
 include/asm-arm/arch-tbox/memory.h            |    25 +-
 include/asm-arm/arch-versatile/memory.h       |    29 +-
 include/asm-arm/atomic.h                      |    85 +-
 include/asm-arm/cacheflush.h                  |    15 +-
 include/asm-arm/hardware/sa1111.h             |    16 -
 include/asm-arm/ide.h                         |    20 +-
 include/asm-arm/kmap_types.h                  |     1 -
 include/asm-arm/memory.h                      |    31 +
 include/asm-arm/pgtable.h                     |     9 +-
 include/asm-arm/setup.h                       |     1 -
 include/asm-arm/spinlock.h                    |     5 +-
 include/asm-arm/system.h                      |    42 +-
 include/asm-arm/thread_info.h                 |     2 +-
 include/asm-arm/types.h                       |     2 +
 include/asm-arm/uaccess.h                     |     2 +-
 include/asm-arm/unistd.h                      |    29 +-
 include/asm-arm26/cacheflush.h                |     3 +-
 include/asm-arm26/ide.h                       |    47 +-
 include/asm-arm26/pgtable.h                   |     2 -
 include/asm-arm26/types.h                     |     2 +
 include/asm-arm26/unistd.h                    |    25 +
 include/asm-cris/arch-v10/cache.h             |     1 +
 include/asm-cris/arch-v10/irq.h               |     5 +
 include/asm-cris/arch-v10/offset.h            |     2 +-
 include/asm-cris/atomic.h                     |     2 +
 include/asm-cris/bitops.h                     |    46 +
 include/asm-cris/cacheflush.h                 |     3 +-
 include/asm-cris/dma-mapping.h                |   126 +-
 include/asm-cris/fasttimer.h                  |     4 +-
 include/asm-cris/io.h                         |     2 +
 include/asm-cris/ioctl.h                      |    13 +-
 include/asm-cris/page.h                       |    11 +-
 include/asm-cris/pci.h                        |     4 +
 include/asm-cris/pgtable.h                    |    12 +-
 include/asm-cris/ptrace.h                     |     2 +
 include/asm-cris/rtc.h                        |     4 +-
 include/asm-cris/semaphore-helper.h           |     4 +-
 include/asm-cris/semaphore.h                  |    12 +-
 include/asm-cris/termbits.h                   |     2 +-
 include/asm-cris/types.h                      |     3 +
 include/asm-cris/unistd.h                     |    41 +-
 include/asm-generic/pgtable.h                 |    21 +-
 include/asm-generic/vmlinux.lds.h             |    28 +-
 include/asm-h8300/atomic.h                    |    11 +
 include/asm-h8300/bitops.h                    |    65 +-
 include/asm-h8300/cacheflush.h                |     3 +-
 include/asm-h8300/elf.h                       |    60 +-
 include/asm-h8300/flat.h                      |     3 +-
 include/asm-h8300/hardirq.h                   |     2 +-
 include/asm-h8300/ide.h                       |    16 +-
 include/asm-h8300/io.h                        |    66 +-
 include/asm-h8300/module.h                    |     6 +
 include/asm-h8300/pgtable.h                   |     2 -
 include/asm-h8300/processor.h                 |    18 +-
 include/asm-h8300/semaphore.h                 |    24 +-
 include/asm-h8300/sigcontext.h                |     1 +
 include/asm-h8300/thread_info.h               |    12 +-
 include/asm-h8300/timex.h                     |     6 +-
 include/asm-h8300/types.h                     |     2 +
 include/asm-h8300/unistd.h                    |    25 +
 include/asm-i386/acpi.h                       |     3 +-
 include/asm-i386/bitops.h                     |     4 +-
 include/asm-i386/cacheflush.h                 |     2 +
 include/asm-i386/cpu.h                        |     4 +-
 include/asm-i386/dma-mapping.h                |     4 +-
 include/asm-i386/floppy.h                     |     2 +-
 include/asm-i386/genapic.h                    |     5 +-
 include/asm-i386/hw_irq.h                     |     2 +-
 include/asm-i386/i387.h                       |     2 +-
 include/asm-i386/ide.h                        |     5 +
 include/asm-i386/kmap_types.h                 |    12 +-
 include/asm-i386/mach-bigsmp/mach_apic.h      |    36 +-
 include/asm-i386/mach-default/irq_vectors.h   |     1 +
 include/asm-i386/mach-es7000/mach_apic.h      |    10 +-
 include/asm-i386/mach-es7000/mach_ipi.h       |     2 +-
 include/asm-i386/mach-es7000/mach_mpparse.h   |    12 +-
 include/asm-i386/mach-generic/mach_apic.h     |     5 +-
 include/asm-i386/param.h                      |     2 +-
 include/asm-i386/pgtable.h                    |    26 +-
 include/asm-i386/processor.h                  |     8 +
 include/asm-i386/smp.h                        |     3 +-
 include/asm-i386/spinlock.h                   |     1 +
 include/asm-i386/thread_info.h                |    10 +-
 include/asm-i386/timer.h                      |    13 +-
 include/asm-i386/types.h                      |     2 +
 include/asm-i386/uaccess.h                    |    12 +-
 include/asm-i386/unistd.h                     |    28 +-
 include/asm-ia64/acpi.h                       |     1 -
 include/asm-ia64/asmmacro.h                   |     8 +
 include/asm-ia64/atomic.h                     |     4 +-
 include/asm-ia64/bitops.h                     |    92 +-
 include/asm-ia64/cacheflush.h                 |     3 +
 include/asm-ia64/delay.h                      |     6 +
 include/asm-ia64/gcc_intrin.h                 |    14 +-
 include/asm-ia64/ide.h                        |     5 +
 include/asm-ia64/intel_intrin.h               |     3 +
 include/asm-ia64/pgtable.h                    |    42 +-
 include/asm-ia64/signal.h                     |     1 -
 include/asm-ia64/smp.h                        |     8 +-
 include/asm-ia64/sn/arch.h                    |    12 +-
 include/asm-ia64/sn/intr.h                    |     2 +
 include/asm-ia64/sn/module.h                  |     4 -
 include/asm-ia64/sn/nodepda.h                 |     7 -
 include/asm-ia64/sn/sn2/sn_private.h          |     2 +-
 include/asm-ia64/sn/types.h                   |     2 -
 include/asm-ia64/spinlock.h                   |    24 +-
 include/asm-ia64/system.h                     |    14 +-
 include/asm-ia64/types.h                      |     2 +
 include/asm-ia64/unistd.h                     |    30 +-
 include/asm-m68k/amigahw.h                    |    16 +-
 include/asm-m68k/apollodma.h                  |    10 +-
 include/asm-m68k/apollohw.h                   |     8 +-
 include/asm-m68k/atafdreg.h                   |     2 +-
 include/asm-m68k/atari_SCCserial.h            |     2 +-
 include/asm-m68k/atari_acsi.h                 |     2 +-
 include/asm-m68k/atarihw.h                    |    82 +-
 include/asm-m68k/atariints.h                  |    12 +-
 include/asm-m68k/bitops.h                     |     2 +-
 include/asm-m68k/bootinfo.h                   |    10 +-
 include/asm-m68k/cacheflush.h                 |     8 +-
 include/asm-m68k/checksum.h                   |     2 +-
 include/asm-m68k/delay.h                      |     2 +-
 include/asm-m68k/dvma.h                       |    12 +-
 include/asm-m68k/entry.h                      |     2 +-
 include/asm-m68k/floppy.h                     |    14 +-
 include/asm-m68k/hwtest.h                     |     4 +-
 include/asm-m68k/ide.h                        |    28 +-
 include/asm-m68k/intersil.h                   |     2 +-
 include/asm-m68k/io.h                         |    14 +-
 include/asm-m68k/ipc.h                        |     2 +-
 include/asm-m68k/irq.h                        |     2 +-
 include/asm-m68k/mac_asc.h                    |     8 +-
 include/asm-m68k/mac_oss.h                    |     2 +-
 include/asm-m68k/mac_psc.h                    |    12 +-
 include/asm-m68k/mac_via.h                    |    24 +-
 include/asm-m68k/machw.h                      |     2 +-
 include/asm-m68k/macintosh.h                  |    16 +-
 include/asm-m68k/macints.h                    |     8 +-
 include/asm-m68k/md.h                         |     4 +-
 include/asm-m68k/mmu_context.h                |     4 +-
 include/asm-m68k/motorola_pgtable.h           |     2 +-
 include/asm-m68k/msgbuf.h                     |     2 +-
 include/asm-m68k/mvme147hw.h                  |     2 +-
 include/asm-m68k/mvme16xhw.h                  |     2 +-
 include/asm-m68k/openprom.h                   |    90 +-
 include/asm-m68k/oplib.h                      |     8 +-
 include/asm-m68k/page.h                       |     6 +-
 include/asm-m68k/page_offset.h                |     2 +-
 include/asm-m68k/pgtable.h                    |     2 -
 include/asm-m68k/q40_master.h                 |     4 +-
 include/asm-m68k/raw_io.h                     |     2 +-
 include/asm-m68k/rtc.h                        |     2 +-
 include/asm-m68k/sembuf.h                     |     2 +-
 include/asm-m68k/serial.h                     |     6 +-
 include/asm-m68k/setup.h                      |     2 +-
 include/asm-m68k/shmbuf.h                     |     2 +-
 include/asm-m68k/sigcontext.h                 |     2 +-
 include/asm-m68k/signal.h                     |     2 +-
 include/asm-m68k/sockios.h                    |     2 +-
 include/asm-m68k/string.h                     |     4 +-
 include/asm-m68k/sun3_pgalloc.h               |    10 +-
 include/asm-m68k/sun3mmu.h                    |     4 +-
 include/asm-m68k/sun3x.h                      |     2 +-
 include/asm-m68k/sun3xflop.h                  |    28 +-
 include/asm-m68k/termios.h                    |     2 +-
 include/asm-m68k/thread_info.h                |     2 +-
 include/asm-m68k/tlbflush.h                   |    10 +-
 include/asm-m68k/types.h                      |     2 +
 include/asm-m68k/unaligned.h                  |     2 +-
 include/asm-m68k/unistd.h                     |    25 +
 include/asm-m68k/user.h                       |     4 +-
 include/asm-m68k/virtconvert.h                |     3 +-
 include/asm-m68knommu/atomic.h                |    38 +-
 include/asm-m68knommu/bitops.h                |    55 +-
 include/asm-m68knommu/cacheflush.h            |     6 +-
 include/asm-m68knommu/flat.h                  |     2 +-
 include/asm-m68knommu/mcfsmc.h                |    12 +
 include/asm-m68knommu/pgtable.h               |     2 -
 include/asm-m68knommu/unistd.h                |    24 +
 include/asm-mips/cacheflush.h                 |     3 +
 include/asm-mips/checksum.h                   |     4 -
 include/asm-mips/hdreg.h                      |     2 +-
 include/asm-mips/kmap_types.h                 |    11 +-
 include/asm-mips/mach-au1x00/au1000.h         |    19 +-
 include/asm-mips/mach-db1x00/db1x00.h         |    31 +-
 include/asm-mips/mach-dec/mc146818rtc.h       |     2 +-
 include/asm-mips/mach-generic/ide.h           |     5 +
 include/asm-mips/pgtable-32.h                 |     6 -
 include/asm-mips/pgtable-64.h                 |     2 -
 include/asm-mips/processor.h                  |     2 +
 include/asm-mips/ptrace.h                     |     2 +
 include/asm-mips/spinlock.h                   |     1 +
 include/asm-mips/thread_info.h                |     6 +-
 include/asm-mips/types.h                      |     2 +
 include/asm-mips/unistd.h                     |    64 +-
 include/asm-mips/vr41xx/vr41xx.h              |    20 +-
 include/asm-parisc/atomic.h                   |    73 +-
 include/asm-parisc/bitops.h                   |    35 +-
 include/asm-parisc/cache.h                    |     2 +
 include/asm-parisc/cacheflush.h               |    99 +-
 include/asm-parisc/dma-mapping.h              |     3 +
 include/asm-parisc/fixmap.h                   |    24 +-
 include/asm-parisc/hardware.h                 |     3 +-
 include/asm-parisc/ide.h                      |     6 +-
 include/asm-parisc/page.h                     |    48 +-
 include/asm-parisc/pdc.h                      |     1 +
 include/asm-parisc/pgalloc.h                  |    72 +-
 include/asm-parisc/pgtable.h                  |   110 +-
 include/asm-parisc/processor.h                |    37 +-
 include/asm-parisc/smp.h                      |     4 +-
 include/asm-parisc/spinlock.h                 |    50 +-
 include/asm-parisc/system.h                   |    20 +-
 include/asm-parisc/types.h                    |     2 +
 include/asm-parisc/unistd.h                   |   274 +-
 include/asm-ppc/atomic.h                      |    10 +
 include/asm-ppc/bug.h                         |    38 +-
 include/asm-ppc/cacheflush.h                  |     5 +-
 include/asm-ppc/dma-mapping.h                 |   130 +-
 include/asm-ppc/hardirq.h                     |     4 +
 include/asm-ppc/ibm44x.h                      |   136 +-
 include/asm-ppc/ibm4xx.h                      |    17 +-
 include/asm-ppc/ide.h                         |     5 +
 include/asm-ppc/io.h                          |    38 -
 include/asm-ppc/kmap_types.h                  |     1 +
 include/asm-ppc/mpc8260.h                     |     4 +
 include/asm-ppc/ocp.h                         |   238 +-
 include/asm-ppc/ocp_ids.h                     |    67 +-
 include/asm-ppc/pci.h                         |   224 +-
 include/asm-ppc/pgtable.h                     |    16 +-
 include/asm-ppc/ppc_asm.h                     |     2 +
 include/asm-ppc/reg.h                         |     2 +-
 include/asm-ppc/reg_booke.h                   |    44 +-
 include/asm-ppc/spinlock.h                    |    23 +-
 include/asm-ppc/system.h                      |     4 +
 include/asm-ppc/termbits.h                    |     2 +-
 include/asm-ppc/tlbflush.h                    |     7 +
 include/asm-ppc/types.h                       |     2 +
 include/asm-ppc/unistd.h                      |    26 +-
 include/asm-ppc64/atomic.h                    |    12 +
 include/asm-ppc64/bitops.h                    |    14 +
 include/asm-ppc64/cacheflush.h                |     5 +-
 include/asm-ppc64/compat.h                    |    71 +-
 include/asm-ppc64/current.h                   |     4 +-
 include/asm-ppc64/eeh.h                       |    22 +-
 include/asm-ppc64/iSeries/HvCallSc.h          |    16 +-
 include/asm-ppc64/ide.h                       |     6 +-
 include/asm-ppc64/io.h                        |    55 +-
 include/asm-ppc64/iommu.h                     |     6 +-
 include/asm-ppc64/ipc.h                       |     2 +-
 include/asm-ppc64/irq.h                       |    22 +-
 include/asm-ppc64/mmu.h                       |     2 +-
 include/asm-ppc64/mmu_context.h               |    42 +-
 include/asm-ppc64/mmzone.h                    |     1 -
 include/asm-ppc64/naca.h                      |     2 +-
 include/asm-ppc64/paca.h                      |    14 +-
 include/asm-ppc64/page.h                      |    23 +-
 include/asm-ppc64/pgalloc.h                   |    31 +-
 include/asm-ppc64/pgtable.h                   |    46 +-
 include/asm-ppc64/ppc32.h                     |     5 -
 include/asm-ppc64/processor.h                 |    13 +
 include/asm-ppc64/ptrace.h                    |     2 +-
 include/asm-ppc64/rtas.h                      |     2 +-
 include/asm-ppc64/sigcontext.h                |     6 +-
 include/asm-ppc64/spinlock.h                  |   136 +-
 include/asm-ppc64/system.h                    |    21 +-
 include/asm-ppc64/termbits.h                  |     2 +-
 include/asm-ppc64/thread_info.h               |     4 -
 include/asm-ppc64/tlbflush.h                  |     2 +
 include/asm-ppc64/types.h                     |     2 +
 include/asm-ppc64/uaccess.h                   |     6 +-
 include/asm-ppc64/unistd.h                    |    27 +-
 include/asm-ppc64/vio.h                       |     5 -
 include/asm-s390/atomic.h                     |     5 +-
 include/asm-s390/bitops.h                     |    25 +-
 include/asm-s390/cacheflush.h                 |     2 +
 include/asm-s390/checksum.h                   |     4 +-
 include/asm-s390/compat.h                     |     8 +-
 include/asm-s390/debug.h                      |    23 +-
 include/asm-s390/idals.h                      |     8 +-
 include/asm-s390/ipc.h                        |     2 +-
 include/asm-s390/percpu.h                     |    20 +-
 include/asm-s390/pgtable.h                    |    13 +-
 include/asm-s390/processor.h                  |    11 +-
 include/asm-s390/ptrace.h                     |     1 +
 include/asm-s390/qeth.h                       |    42 +-
 include/asm-s390/setup.h                      |     1 +
 include/asm-s390/spinlock.h                   |     9 +-
 include/asm-s390/string.h                     |   212 +-
 include/asm-s390/thread_info.h                |     2 +
 include/asm-s390/types.h                      |     2 +
 include/asm-s390/uaccess.h                    |    56 +-
 include/asm-s390/unistd.h                     |    24 +
 include/asm-sh/atomic.h                       |    12 +
 include/asm-sh/cpu-sh2/cacheflush.h           |     2 +
 include/asm-sh/cpu-sh3/cacheflush.h           |     2 +
 include/asm-sh/cpu-sh4/cacheflush.h           |     4 +
 include/asm-sh/flat.h                         |     2 +-
 include/asm-sh/ide.h                          |     5 +
 include/asm-sh/mc146818rtc.h                  |     1 -
 include/asm-sh/pgtable.h                      |     2 -
 include/asm-sh/spinlock.h                     |     1 +
 include/asm-sh/types.h                        |     2 +
 include/asm-sh/unistd.h                       |    25 +
 include/asm-sparc/atomic.h                    |    12 +
 include/asm-sparc/cacheflush.h                |     2 +
 include/asm-sparc/dma-mapping.h               |     1 +
 include/asm-sparc/hardirq.h                   |     9 -
 include/asm-sparc/highmem.h                   |     4 +-
 include/asm-sparc/ide.h                       |    13 +-
 include/asm-sparc/ipc.h                       |     2 +-
 include/asm-sparc/kmap_types.h                |     1 -
 include/asm-sparc/pgtable.h                   |    33 +-
 include/asm-sparc/pgtsrmmu.h                  |    35 +-
 include/asm-sparc/pgtsun4.h                   |     3 -
 include/asm-sparc/pgtsun4c.h                  |     3 -
 include/asm-sparc/sbus.h                      |     9 +-
 include/asm-sparc/semaphore.h                 |    14 +-
 include/asm-sparc/signal.h                    |     4 +-
 include/asm-sparc/spinlock.h                  |     2 +
 include/asm-sparc/thread_info.h               |     1 +
 include/asm-sparc/types.h                     |     2 +
 include/asm-sparc/uaccess.h                   |    12 +-
 include/asm-sparc/unistd.h                    |    24 +
 include/asm-sparc/viking.h                    |     2 +-
 include/asm-sparc64/atomic.h                  |    13 +
 include/asm-sparc64/bitops.h                  |   113 +-
 include/asm-sparc64/cacheflush.h              |     2 +
 include/asm-sparc64/chmctrl.h                 |   154 +-
 include/asm-sparc64/compat.h                  |     8 +-
 include/asm-sparc64/hardirq.h                 |     9 -
 include/asm-sparc64/ide.h                     |    13 +-
 include/asm-sparc64/iommu.h                   |    16 +-
 include/asm-sparc64/lsu.h                     |    24 +-
 include/asm-sparc64/page.h                    |    16 +-
 include/asm-sparc64/param.h                   |     2 +-
 include/asm-sparc64/pci.h                     |     2 +-
 include/asm-sparc64/pgtable.h                 |   114 +-
 include/asm-sparc64/pstate.h                  |   104 +-
 include/asm-sparc64/sbus.h                    |     9 +-
 include/asm-sparc64/siginfo.h                 |     2 +-
 include/asm-sparc64/signal.h                  |     4 +-
 include/asm-sparc64/spinlock.h                |    13 +
 include/asm-sparc64/thread_info.h             |     3 +-
 include/asm-sparc64/types.h                   |     2 +
 include/asm-sparc64/uaccess.h                 |     8 +-
 include/asm-sparc64/unistd.h                  |    22 +-
 include/asm-um/pgtable.h                      |    12 -
 include/asm-um/unistd.h                       |    25 +
 include/asm-v850/atomic.h                     |    10 +
 include/asm-v850/cacheflush.h                 |     2 +
 include/asm-v850/flat.h                       |     3 +-
 include/asm-v850/pgtable.h                    |     2 -
 include/asm-v850/types.h                      |     2 +
 include/asm-v850/unistd.h                     |    25 +
 include/asm-x86_64/bitops.h                   |     9 +-
 include/asm-x86_64/cacheflush.h               |     2 +
 include/asm-x86_64/checksum.h                 |     4 +-
 include/asm-x86_64/compat.h                   |     8 +-
 include/asm-x86_64/desc.h                     |     3 +-
 include/asm-x86_64/floppy.h                   |     2 +-
 include/asm-x86_64/fpu32.h                    |     4 +-
 include/asm-x86_64/i387.h                     |    12 +-
 include/asm-x86_64/ia32.h                     |     4 +-
 include/asm-x86_64/ia32_unistd.h              |     3 +-
 include/asm-x86_64/ide.h                      |    65 +-
 include/asm-x86_64/io.h                       |     9 +-
 include/asm-x86_64/msr.h                      |     4 +-
 include/asm-x86_64/page.h                     |    11 +-
 include/asm-x86_64/percpu.h                   |     2 +-
 include/asm-x86_64/pgtable.h                  |    26 +-
 include/asm-x86_64/processor.h                |    15 +-
 include/asm-x86_64/ptrace.h                   |     2 +-
 include/asm-x86_64/semaphore.h                |    14 +-
 include/asm-x86_64/sigcontext.h               |     3 +-
 include/asm-x86_64/smp.h                      |     2 +-
 include/asm-x86_64/spinlock.h                 |     1 +
 include/asm-x86_64/timex.h                    |     3 +-
 include/asm-x86_64/types.h                    |     2 +
 include/asm-x86_64/uaccess.h                  |    56 +-
 include/asm-x86_64/unistd.h                   |    41 +-
 include/linux/acpi.h                          |     2 +-
 include/linux/aio.h                           |    11 +-
 include/linux/ata.h                           |    17 +
 include/linux/atm.h                           |     2 +-
 include/linux/atmdev.h                        |     8 +-
 include/linux/auto_fs4.h                      |    12 +-
 include/linux/backing-dev.h                   |     4 +-
 include/linux/bitmap.h                        |     3 +-
 include/linux/blkdev.h                        |    11 +-
 include/linux/blkpg.h                         |     2 +-
 include/linux/buffer_head.h                   |     5 +-
 include/linux/cciss_ioctl.h                   |     4 +-
 include/linux/cdrom.h                         |    32 +-
 include/linux/coda.h                          |     5 +-
 include/linux/coda_proc.h                     |     4 +-
 include/linux/compat.h                        |    19 +-
 include/linux/compat_ioctl.h                  |     8 +
 include/linux/compiler.h                      |     4 +
 include/linux/console.h                       |     4 +-
 include/linux/cpu.h                           |     3 +-
 include/linux/cpufreq.h                       |    30 +-
 include/linux/cpumask.h                       |    12 +
 include/linux/dcache.h                        |    69 +-
 include/linux/delay.h                         |     2 +
 include/linux/device.h                        |     4 +-
 include/linux/edd.h                           |     6 +-
 include/linux/efi.h                           |     7 -
 include/linux/elf.h                           |     3 +-
 include/linux/ethtool.h                       |     2 +
 include/linux/fb.h                            |     1 -
 include/linux/fd.h                            |     2 +-
 include/linux/fs.h                            |    34 +-
 include/linux/futex.h                         |     5 +-
 include/linux/gameport.h                      |     6 -
 include/linux/gfp.h                           |    33 +-
 include/linux/hdlc.h                          |     5 +-
 include/linux/hugetlb.h                       |    16 +-
 include/linux/i2c-id.h                        |     2 +-
 include/linux/i2c.h                           |    23 +-
 include/linux/i2o-dev.h                       |     7 +
 include/linux/i2o.h                           |    42 +
 include/linux/ide.h                           |    78 +-
 include/linux/idr.h                           |     4 +-
 include/linux/if.h                            |     8 +-
 include/linux/if_arp.h                        |     1 +
 include/linux/if_bridge.h                     |     8 +-
 include/linux/if_frad.h                       |     2 +-
 include/linux/if_vlan.h                       |     2 +-
 include/linux/igmp.h                          |     4 +-
 include/linux/inetdevice.h                    |     2 +-
 include/linux/init.h                          |     2 -
 include/linux/input.h                         |    63 +-
 include/linux/ipv6.h                          |     2 +
 include/linux/kd.h                            |     5 +-
 include/linux/kernel.h                        |    11 +-
 include/linux/kmod.h                          |     2 +
 include/linux/kobject.h                       |     2 +-
 include/linux/libata.h                        |    76 +-
 include/linux/mca.h                           |     2 +-
 include/linux/mii.h                           |     7 +
 include/linux/miscdevice.h                    |     1 +
 include/linux/mm.h                            |   217 +-
 include/linux/mmzone.h                        |     8 +
 include/linux/module.h                        |    30 +-
 include/linux/moduleparam.h                   |     6 +-
 include/linux/mroute.h                        |     6 +-
 include/linux/net.h                           |     4 +-
 include/linux/netdevice.h                     |     8 +-
 include/linux/netfilter.h                     |    14 +-
 include/linux/netfilter_arp/arp_tables.h      |     2 +-
 include/linux/netfilter_ipv4/ip_tables.h      |    10 +-
 include/linux/netfilter_ipv6/ip6_tables.h     |     4 +-
 include/linux/nfs_fs.h                        |     4 +
 include/linux/nfsd/export.h                   |     9 +-
 include/linux/nfsd/nfsd.h                     |     3 +-
 include/linux/nfsd/xdr3.h                     |     1 +
 include/linux/oprofile.h                      |     6 +-
 include/linux/page-flags.h                    |    18 +-
 include/linux/pagemap.h                       |     4 +-
 include/linux/pci.h                           |     5 +
 include/linux/pci_ids.h                       |    69 +-
 include/linux/pkt_cls.h                       |    20 +-
 include/linux/pm.h                            |     3 +-
 include/linux/quota.h                         |     2 +
 include/linux/quotaio_v2.h                    |     2 +-
 include/linux/raid/md_k.h                     |    10 +
 include/linux/raid/raid1.h                    |    16 +
 include/linux/raid/raid5.h                    |     2 +-
 include/linux/reboot.h                        |     2 +
 include/linux/reiserfs_fs.h                   |    49 +-
 include/linux/reiserfs_fs_i.h                 |     8 +-
 include/linux/reiserfs_fs_sb.h                |    13 +-
 include/linux/rmap.h                          |    97 +-
 include/linux/rtnetlink.h                     |    38 +-
 include/linux/sched.h                         |   199 +-
 include/linux/sdla.h                          |     2 +-
 include/linux/security.h                      |     2 +-
 include/linux/selection.h                     |     4 +-
 include/linux/sem.h                           |     8 +-
 include/linux/serial_core.h                   |     3 +
 include/linux/shmem_fs.h                      |     2 +
 include/linux/skbuff.h                        |     6 +-
 include/linux/slab.h                          |     2 +
 include/linux/sockios.h                       |     6 +
 include/linux/spinlock.h                      |     4 +-
 include/linux/stat.h                          |     2 +-
 include/linux/sunrpc/cache.h                  |    11 +-
 include/linux/sunrpc/gss_api.h                |    70 +-
 include/linux/sunrpc/gss_asn1.h               |     3 +-
 include/linux/sunrpc/gss_krb5.h               |     2 +-
 include/linux/sunrpc/svcauth.h                |     1 +
 include/linux/sunrpc/xprt.h                   |    10 +-
 include/linux/swap.h                          |    12 +-
 include/linux/syscalls.h                      |    10 +-
 include/linux/sysctl.h                        |     4 +
 include/linux/sysfs.h                         |     6 +-
 include/linux/sysrq.h                         |     8 +-
 include/linux/tcp.h                           |    23 +-
 include/linux/time.h                          |    36 +-
 include/linux/timer.h                         |     5 +-
 include/linux/times.h                         |    18 +-
 include/linux/tty.h                           |     1 -
 include/linux/tty_driver.h                    |     4 +-
 include/linux/tty_ldisc.h                     |     4 +-
 include/linux/udf_fs.h                        |     2 +-
 include/linux/usb.h                           |    58 +-
 include/linux/usbdevice_fs.h                  |     1 -
 include/linux/video_decoder.h                 |     7 +
 include/linux/vt_kern.h                       |    16 +-
 include/linux/wait.h                          |    20 +-
 include/linux/watchdog.h                      |     1 +
 include/linux/wavefront.h                     |     4 +-
 include/linux/xfrm.h                          |     3 +-
 include/net/addrconf.h                        |     6 +-
 include/net/arp.h                             |     2 +-
 include/net/ax25.h                            |     2 +-
 include/net/bluetooth/bluetooth.h             |    31 +-
 include/net/bluetooth/hci.h                   |     4 -
 include/net/bluetooth/hci_core.h              |    74 +-
 include/net/bluetooth/l2cap.h                 |    20 +-
 include/net/bluetooth/rfcomm.h                |    10 +-
 include/net/bluetooth/sco.h                   |    10 +-
 include/net/checksum.h                        |     4 +-
 include/net/compat.h                          |     6 +-
 include/net/dn_dev.h                          |     2 +-
 include/net/dst.h                             |     5 +-
 include/net/inet_common.h                     |     8 +-
 include/net/ip.h                              |    18 +-
 include/net/ip6_fib.h                         |     2 +
 include/net/ip6_route.h                       |     4 +-
 include/net/ipv6.h                            |    15 +-
 include/net/irda/irda.h                       |     2 -
 include/net/irda/irlmp.h                      |     2 +-
 include/net/netrom.h                          |     2 +-
 include/net/rose.h                            |     2 +-
 include/net/route.h                           |     2 +
 include/net/sctp/command.h                    |     1 +
 include/net/sctp/sctp.h                       |     5 -
 include/net/sctp/sm.h                         |    17 +
 include/net/sctp/structs.h                    |     6 +-
 include/net/sctp/user.h                       |     2 +-
 include/net/snmp.h                            |    87 +-
 include/net/sock.h                            |    57 +-
 include/net/tcp.h                             |    54 +-
 include/net/x25.h                             |     4 +-
 include/net/xfrm.h                            |     6 +-
 include/pcmcia/ss.h                           |     1 +
 include/scsi/scsi.h                           |     7 +
 include/scsi/scsi_device.h                    |     3 +
 include/scsi/scsi_devinfo.h                   |     6 +-
 include/scsi/scsi_ioctl.h                     |     4 +-
 include/scsi/sg.h                             |    12 +-
 include/sound/ac97_codec.h                    |    20 +-
 include/sound/ad1848.h                        |     3 -
 include/sound/ainstr_gf1.h                    |     4 +-
 include/sound/ainstr_iw.h                     |     4 +-
 include/sound/ainstr_simple.h                 |     4 +-
 include/sound/asound.h                        |    31 +-
 include/sound/core.h                          |    30 +-
 include/sound/cs4231.h                        |     1 -
 include/sound/cs46xx.h                        |     8 -
 include/sound/emu10k1.h                       |    18 +-
 include/sound/emux_synth.h                    |     2 +-
 include/sound/gus.h                           |    16 +-
 include/sound/hdsp.h                          |     2 +-
 include/sound/hwdep.h                         |     4 +-
 include/sound/info.h                          |     4 +-
 include/sound/initval.h                       |    40 -
 include/sound/pcm.h                           |    13 +-
 include/sound/seq_instr.h                     |     4 +-
 include/sound/seq_kernel.h                    |     2 +-
 include/sound/seq_oss.h                       |     2 +-
 include/sound/sscape_ioctl.h                  |     2 +-
 include/sound/timer.h                         |     1 +
 include/sound/trident.h                       |    15 +-
 include/sound/uda1341.h                       |     2 +-
 include/sound/version.h                       |     4 +-
 include/sound/vx_core.h                       |     4 +-
 include/sound/wavefront.h                     |     4 +-
 include/sound/ymfpci.h                        |     5 -
 include/video/neomagic.h                      |   261 +-
 include/video/radeon.h                        |     5 +-
 init/Kconfig                                  |    13 +-
 init/Makefile                                 |     3 +
 init/do_mounts_rd.c                           |     4 +-
 init/initramfs.c                              |     2 +-
 init/main.c                                   |    69 +-
 init/version.c                                |     4 +
 ipc/compat.c                                  |    23 +-
 ipc/compat_mq.c                               |     5 +-
 ipc/mqueue.c                                  |    41 +-
 ipc/msg.c                                     |    10 +-
 ipc/msgutil.c                                 |    10 +-
 ipc/sem.c                                     |     2 +-
 ipc/shm.c                                     |     4 +
 ipc/util.c                                    |     7 +-
 ipc/util.h                                    |     2 +-
 kernel/acct.c                                 |     2 +-
 kernel/compat.c                               |   147 +-
 kernel/cpu.c                                  |    39 +-
 kernel/exit.c                                 |    27 +-
 kernel/fork.c                                 |   124 +-
 kernel/futex.c                                |    52 +-
 kernel/kallsyms.c                             |    34 +-
 kernel/kmod.c                                 |    22 +-
 kernel/kthread.c                              |     6 +-
 kernel/module.c                               |   173 +-
 kernel/panic.c                                |    24 +-
 kernel/params.c                               |     2 +-
 kernel/power/process.c                        |     7 -
 kernel/power/swsusp.c                         |    33 +-
 kernel/printk.c                               |    29 +-
 kernel/rcupdate.c                             |     6 +-
 kernel/resource.c                             |     4 +-
 kernel/sched.c                                |  2030 ++-
 kernel/signal.c                               |    41 +-
 kernel/sys.c                                  |    43 +-
 kernel/sysctl.c                               |   104 +-
 kernel/time.c                                 |     9 +-
 kernel/timer.c                                |    64 +-
 kernel/user.c                                 |    18 +-
 kernel/workqueue.c                            |    82 +-
 lib/kobject.c                                 |    10 +-
 lib/radix-tree.c                              |     4 +-
 lib/rwsem.c                                   |    35 +-
 lib/string.c                                  |     4 +-
 mm/Makefile                                   |     6 +-
 mm/bootmem.c                                  |    25 +-
 mm/fadvise.c                                  |     5 +
 mm/filemap.c                                  |    99 +-
 mm/fremap.c                                   |    41 +-
 mm/hugetlb.c                                  |     4 +-
 mm/madvise.c                                  |    25 +-
 mm/memory.c                                   |   281 +-
 mm/mempolicy.c                                |     1 +
 mm/mincore.c                                  |     2 +-
 mm/mlock.c                                    |     9 +-
 mm/mmap.c                                     |   687 +-
 mm/mprotect.c                                 |   115 +-
 mm/mremap.c                                   |    95 +-
 mm/msync.c                                    |    10 +-
 mm/nommu.c                                    |     8 +-
 mm/oom_kill.c                                 |     1 -
 mm/page-writeback.c                           |   123 +-
 mm/page_alloc.c                               |    74 +-
 mm/readahead.c                                |    48 +-
 mm/rmap.c                                     |  1009 +-
 mm/shmem.c                                    |   112 +-
 mm/slab.c                                     |   236 +-
 mm/swap_state.c                               |    40 +-
 mm/swapfile.c                                 |   156 +-
 mm/vmalloc.c                                  |     2 +
 mm/vmscan.c                                   |   462 +-
 net/8021q/vlan.c                              |     9 +-
 net/8021q/vlan.h                              |     2 +-
 net/appletalk/ddp.c                           |    19 +-
 net/atm/addr.c                                |     4 +-
 net/atm/addr.h                                |     2 +-
 net/atm/br2684.c                              |    21 +-
 net/atm/common.c                              |    10 +-
 net/atm/common.h                              |     8 +-
 net/atm/ioctl.c                               |    10 +-
 net/atm/lec.c                                 |     4 +-
 net/atm/lec.h                                 |     2 +-
 net/atm/mpc.c                                 |     8 +-
 net/atm/mpc.h                                 |     2 +-
 net/atm/mpoa_proc.c                           |    10 +-
 net/atm/pppoatm.c                             |    17 +-
 net/atm/proc.c                                |     6 +-
 net/atm/pvc.c                                 |     4 +-
 net/atm/resources.c                           |    25 +-
 net/atm/resources.h                           |     2 +-
 net/atm/svc.c                                 |     4 +-
 net/ax25/af_ax25.c                            |    34 +-
 net/ax25/ax25_route.c                         |     2 +-
 net/bluetooth/Kconfig                         |    22 +-
 net/bluetooth/Makefile                        |     2 +-
 net/bluetooth/af_bluetooth.c                  |    40 +-
 net/bluetooth/bnep/Kconfig                    |     8 +-
 net/bluetooth/bnep/sock.c                     |    15 +-
 net/bluetooth/cmtp/Kconfig                    |     2 +-
 net/bluetooth/cmtp/cmtp.h                     |     2 +-
 net/bluetooth/cmtp/sock.c                     |    15 +-
 net/bluetooth/hci_conn.c                      |    46 +-
 net/bluetooth/hci_core.c                      |    84 +-
 net/bluetooth/hci_event.c                     |    37 +-
 net/bluetooth/hci_sock.c                      |    92 +-
 net/bluetooth/hci_sysfs.c                     |     4 +-
 net/bluetooth/l2cap.c                         |   215 +-
 net/bluetooth/lib.c                           |    15 +-
 net/bluetooth/rfcomm/Kconfig                  |     2 +-
 net/bluetooth/rfcomm/core.c                   |    34 +-
 net/bluetooth/rfcomm/sock.c                   |    27 +-
 net/bluetooth/rfcomm/tty.c                    |    24 +-
 net/bluetooth/sco.c                           |   137 +-
 net/bridge/Makefile                           |     2 +
 net/bridge/br.c                               |     3 +
 net/bridge/br_device.c                        |    17 +-
 net/bridge/br_fdb.c                           |   222 +-
 net/bridge/br_if.c                            |   162 +-
 net/bridge/br_ioctl.c                         |   236 +-
 net/bridge/br_netfilter.c                     |     4 +-
 net/bridge/br_notify.c                        |    17 +-
 net/bridge/br_private.h                       |    46 +-
 net/bridge/br_stp_if.c                        |     8 +
 net/bridge/br_stp_timer.c                     |     8 +
 net/bridge/netfilter/ebtables.c               |    10 +-
 net/compat.c                                  |    79 +-
 net/core/Makefile                             |     3 +-
 net/core/datagram.c                           |     4 +-
 net/core/dev.c                                |   105 +-
 net/core/dst.c                                |    26 +-
 net/core/ethtool.c                            |   104 +-
 net/core/iovec.c                              |     4 +-
 net/core/net-sysfs.c                          |     6 +-
 net/core/netfilter.c                          |    14 +-
 net/core/netpoll.c                            |     2 +-
 net/core/pktgen.c                             |     8 +-
 net/core/scm.c                                |    14 +-
 net/core/sock.c                               |    44 +-
 net/decnet/af_decnet.c                        |    22 +-
 net/decnet/dn_dev.c                           |    44 +-
 net/decnet/dn_route.c                         |    10 +-
 net/decnet/sysctl_net_decnet.c                |    20 +-
 net/econet/af_econet.c                        |    23 +-
 net/ipv4/af_inet.c                            |    18 +-
 net/ipv4/ah4.c                                |    37 +-
 net/ipv4/arp.c                                |     2 +-
 net/ipv4/devinet.c                            |    16 +-
 net/ipv4/esp4.c                               |    58 +-
 net/ipv4/igmp.c                               |    13 +-
 net/ipv4/ip_forward.c                         |     2 +-
 net/ipv4/ip_fragment.c                        |    14 +-
 net/ipv4/ip_input.c                           |    18 +-
 net/ipv4/ip_output.c                          |    31 +-
 net/ipv4/ip_sockglue.c                        |    14 +-
 net/ipv4/ipcomp.c                             |    46 +-
 net/ipv4/ipip.c                               |     1 +
 net/ipv4/ipmr.c                               |    22 +-
 net/ipv4/ipvs/ip_vs_core.c                    |    14 +
 net/ipv4/ipvs/ip_vs_ctl.c                     |     6 +-
 net/ipv4/netfilter/arp_tables.c               |    36 +-
 net/ipv4/netfilter/ip_conntrack_core.c        |    15 +-
 net/ipv4/netfilter/ip_conntrack_proto_tcp.c   |     2 +
 net/ipv4/netfilter/ip_fw_compat.c             |     5 +-
 net/ipv4/netfilter/ip_nat_standalone.c        |     3 +-
 net/ipv4/netfilter/ip_tables.c                |    34 +-
 net/ipv4/netfilter/ipt_ECN.c                  |    14 +-
 net/ipv4/netfilter/ipt_TCPMSS.c               |     5 +-
 net/ipv4/netfilter/ipt_recent.c               |     2 +-
 net/ipv4/proc.c                               |    50 +-
 net/ipv4/raw.c                                |    16 +-
 net/ipv4/route.c                              |    44 +-
 net/ipv4/sysctl_net_ipv4.c                    |    27 +-
 net/ipv4/tcp.c                                |   130 +-
 net/ipv4/tcp_diag.c                           |   106 +-
 net/ipv4/tcp_input.c                          |   141 +
 net/ipv4/tcp_ipv4.c                           |    12 +-
 net/ipv4/tcp_output.c                         |     3 +-
 net/ipv4/tcp_timer.c                          |    29 +-
 net/ipv4/udp.c                                |    12 +-
 net/ipv4/xfrm4_policy.c                       |     3 +-
 net/ipv4/xfrm4_state.c                        |     9 +-
 net/ipv4/xfrm4_tunnel.c                       |     3 +-
 net/ipv6/addrconf.c                           |    17 +-
 net/ipv6/af_inet6.c                           |    22 +-
 net/ipv6/ah6.c                                |    91 +-
 net/ipv6/datagram.c                           |    14 +-
 net/ipv6/esp6.c                               |    60 +-
 net/ipv6/exthdrs.c                            |    38 +-
 net/ipv6/icmp.c                               |     2 +-
 net/ipv6/ip6_flowlabel.c                      |     8 +-
 net/ipv6/ip6_input.c                          |    26 +-
 net/ipv6/ip6_output.c                         |    79 +-
 net/ipv6/ipcomp6.c                            |    55 +-
 net/ipv6/ipv6_sockglue.c                      |    16 +-
 net/ipv6/mcast.c                              |    22 +-
 net/ipv6/ndisc.c                              |    14 +-
 net/ipv6/netfilter/ip6_tables.c               |    31 +-
 net/ipv6/proc.c                               |    73 +-
 net/ipv6/raw.c                                |    65 +-
 net/ipv6/reassembly.c                         |    28 +-
 net/ipv6/route.c                              |    68 +-
 net/ipv6/tcp_ipv6.c                           |    19 +-
 net/ipv6/udp.c                                |    38 +-
 net/ipv6/xfrm6_policy.c                       |    11 +-
 net/ipv6/xfrm6_state.c                        |     9 +-
 net/ipx/af_ipx.c                              |    35 +-
 net/ipx/ipx_route.c                           |     2 +-
 net/irda/af_irda.c                            |    40 +-
 net/irda/ircomm/ircomm_tty.c                  |     8 +-
 net/irda/ircomm/ircomm_tty_ioctl.c            |    10 +-
 net/irda/irlap_event.c                        |     6 +-
 net/irda/irlmp.c                              |     4 +-
 net/irda/irnet/irnet_ppp.c                    |    44 +-
 net/irda/irnet/irnet_ppp.h                    |     4 +-
 net/irda/irsysctl.c                           |     2 +-
 net/key/af_key.c                              |     6 +-
 net/llc/af_llc.c                              |     8 +-
 net/netlink/af_netlink.c                      |     2 +-
 net/netlink/netlink_dev.c                     |     6 +-
 net/netrom/af_netrom.c                        |    19 +-
 net/netrom/nr_route.c                         |     2 +-
 net/packet/af_packet.c                        |    14 +-
 net/rose/af_rose.c                            |    27 +-
 net/rose/rose_route.c                         |     2 +-
 net/sched/sch_delay.c                         |     1 +
 net/sched/sch_tbf.c                           |     6 +
 net/sctp/associola.c                          |    16 +-
 net/sctp/chunk.c                              |     2 +-
 net/sctp/endpointola.c                        |     4 +-
 net/sctp/output.c                             |     2 +-
 net/sctp/sm_sideeffect.c                      |    10 +
 net/sctp/sm_statefuns.c                       |   136 +-
 net/sctp/socket.c                             |   158 +-
 net/sctp/sysctl.c                             |     4 +-
 net/socket.c                                  |    43 +-
 net/sunrpc/auth_gss/Makefile                  |     6 +-
 net/sunrpc/auth_gss/auth_gss.c                |   257 +-
 net/sunrpc/auth_gss/gss_generic_token.c       |    15 +-
 net/sunrpc/auth_gss/gss_krb5_crypto.c         |    31 +-
 net/sunrpc/auth_gss/gss_krb5_mech.c           |    50 +-
 net/sunrpc/auth_gss/gss_krb5_seal.c           |    15 +-
 net/sunrpc/auth_gss/gss_krb5_seqnum.c         |     2 +-
 net/sunrpc/auth_gss/gss_krb5_unseal.c         |     8 +-
 net/sunrpc/auth_gss/gss_mech_switch.c         |   209 +-
 net/sunrpc/auth_gss/gss_pseudoflavors.c       |    21 +-
 net/sunrpc/auth_gss/sunrpcgss_syms.c          |    18 +-
 net/sunrpc/auth_gss/svcauth_gss.c             |    54 +-
 net/sunrpc/cache.c                            |    47 +-
 net/sunrpc/clnt.c                             |     4 +-
 net/sunrpc/rpc_pipe.c                         |     2 +-
 net/sunrpc/svcauth.c                          |    30 +-
 net/sunrpc/svcauth_unix.c                     |     3 +
 net/sunrpc/svcsock.c                          |    13 +-
 net/sunrpc/sysctl.c                           |    19 +-
 net/sunrpc/timer.c                            |     1 +
 net/sunrpc/xprt.c                             |    93 +-
 net/unix/af_unix.c                            |     6 +-
 net/wanrouter/af_wanpipe.c                    |     6 +-
 net/wanrouter/wanmain.c                       |    26 +-
 net/x25/af_x25.c                              |    33 +-
 net/x25/x25_link.c                            |     2 +-
 net/x25/x25_route.c                           |     2 +-
 net/xfrm/xfrm_policy.c                        |     5 +
 net/xfrm/xfrm_state.c                         |    43 +-
 scripts/kallsyms.c                            |    56 +-
 scripts/kernel-doc                            |     2 +
 scripts/mk_elfconfig.c                        |     2 +-
 scripts/mkcompile_h                           |     4 +-
 scripts/modpost.c                             |     1 +
 scripts/reference_discarded.pl                |     2 +-
 scripts/sumversion.c                          |     2 +-
 security/Makefile                             |     2 +-
 security/capability.c                         |    26 +-
 security/commoncap.c                          |     2 +-
 security/dummy.c                              |     4 +-
 security/selinux/Kconfig                      |     2 +-
 security/selinux/hooks.c                      |    92 +-
 security/selinux/include/flask.h              |     3 +-
 .../selinux/include/initial_sid_to_string.h   |     1 +
 security/selinux/selinuxfs.c                  |    37 +-
 security/selinux/ss/mls.c                     |     2 +-
 security/selinux/ss/services.c                |     5 +
 sound/arm/sa11xx-uda1341.c                    |    68 +-
 sound/core/Kconfig                            |    15 +-
 sound/core/control.c                          |    87 +-
 sound/core/hwdep.c                            |    25 +-
 sound/core/info.c                             |     4 +-
 sound/core/init.c                             |    97 +
 sound/core/memalloc.c                         |    59 +-
 sound/core/memory.c                           |     4 +-
 sound/core/oss/mixer_oss.c                    |    34 +-
 sound/core/oss/pcm_oss.c                      |   106 +-
 sound/core/pcm.c                              |     9 +-
 sound/core/pcm_lib.c                          |    60 +-
 sound/core/pcm_memory.c                       |    11 +-
 sound/core/pcm_misc.c                         |     2 +-
 sound/core/pcm_native.c                       |   139 +-
 sound/core/rawmidi.c                          |    58 +-
 sound/core/rtctimer.c                         |    15 +-
 sound/core/seq/instr/ainstr_fm.c              |     5 +-
 sound/core/seq/instr/ainstr_gf1.c             |    10 +-
 sound/core/seq/instr/ainstr_iw.c              |    15 +-
 sound/core/seq/instr/ainstr_simple.c          |     6 +-
 sound/core/seq/oss/seq_oss.c                  |    11 +-
 sound/core/seq/oss/seq_oss_init.c             |     5 +-
 sound/core/seq/oss/seq_oss_ioctl.c            |    27 +-
 sound/core/seq/seq.c                          |    20 +-
 sound/core/seq/seq_clientmgr.c                |     8 +-
 sound/core/seq/seq_dummy.c                    |    11 +-
 sound/core/seq/seq_memory.c                   |     2 +-
 sound/core/seq/seq_midi.c                     |     5 +-
 sound/core/sound.c                            |    13 +-
 sound/core/timer.c                            |   100 +-
 sound/drivers/dummy.c                         |    39 +-
 sound/drivers/mpu401/mpu401.c                 |    49 +-
 sound/drivers/mtpav.c                         |    34 +-
 sound/drivers/opl3/opl3_oss.c                 |     4 +-
 sound/drivers/opl3/opl3_seq.c                 |     3 +-
 sound/drivers/opl3/opl3_synth.c               |     9 +-
 sound/drivers/opl4/opl4_proc.c                |     4 +-
 sound/drivers/opl4/opl4_seq.c                 |     3 +-
 sound/drivers/serial-u16550.c                 |    56 +-
 sound/drivers/virmidi.c                       |    33 +-
 sound/isa/ad1816a/ad1816a.c                   |    53 +-
 sound/isa/ad1848/ad1848.c                     |    43 +-
 sound/isa/ad1848/ad1848_lib.c                 |    65 +-
 sound/isa/als100.c                            |    53 +-
 sound/isa/azt2320.c                           |    55 +-
 sound/isa/cmi8330.c                           |    63 +-
 sound/isa/cs423x/cs4231.c                     |    52 +-
 sound/isa/cs423x/cs4231_lib.c                 |    64 +-
 sound/isa/cs423x/cs4236.c                     |    76 +-
 sound/isa/cs423x/pc98.c                       |    58 +-
 sound/isa/dt019x.c                            |    50 +-
 sound/isa/es1688/es1688.c                     |    48 +-
 sound/isa/es18xx.c                            |   124 +-
 sound/isa/gus/gus_dram.c                      |     8 +-
 sound/isa/gus/gus_instr.c                     |    12 +-
 sound/isa/gus/gus_mem_proc.c                  |     2 +-
 sound/isa/gus/gus_pcm.c                       |     2 +-
 sound/isa/gus/gusclassic.c                    |    55 +-
 sound/isa/gus/gusextreme.c                    |    65 +-
 sound/isa/gus/gusmax.c                        |    55 +-
 sound/isa/gus/interwave.c                     |    75 +-
 sound/isa/opl3sa2.c                           |   147 +-
 sound/isa/opti9xx/opti92x-ad1848.c            |    72 +-
 sound/isa/sb/emu8000_patch.c                  |    12 +-
 sound/isa/sb/emu8000_pcm.c                    |     4 +-
 sound/isa/sb/es968.c                          |    40 +-
 sound/isa/sb/sb16.c                           |    90 +-
 sound/isa/sb/sb16_csp.c                       |    61 +-
 sound/isa/sb/sb8.c                            |    40 +-
 sound/isa/sgalaxy.c                           |    42 +-
 sound/isa/sscape.c                            |    54 +-
 sound/isa/wavefront/wavefront.c               |    69 +-
 sound/isa/wavefront/wavefront_fx.c            |     4 +-
 sound/isa/wavefront/wavefront_synth.c         |    52 +-
 sound/oss/Kconfig                             |    95 +-
 sound/oss/Makefile                            |     6 +
 sound/oss/ac97.c                              |     8 +-
 sound/oss/ac97.h                              |     2 +-
 sound/oss/ac97_codec.c                        |    10 +-
 sound/oss/ac97_plugin_ad1980.c                |     2 +-
 sound/oss/aci.c                               |    91 +-
 sound/oss/ad1816.c                            |    23 +-
 sound/oss/ad1848.c                            |    17 +-
 sound/oss/ad1889.c                            |    27 +-
 sound/oss/ali5455.c                           |    71 +-
 sound/oss/audio.c                             |    33 +-
 sound/oss/awe_wave.c                          |    86 +-
 sound/oss/btaudio.c                           |    59 +-
 sound/oss/cmpci.c                             |  2593 ++--
 sound/oss/cs4281/cs4281m.c                    |   138 +-
 sound/oss/cs46xx.c                            |    99 +-
 sound/oss/dev_table.h                         |    16 +-
 sound/oss/dmabuf.c                            |     6 +-
 sound/oss/dmasound/dac3550a.c                 |     5 +-
 sound/oss/dmasound/dmasound.h                 |     6 -
 sound/oss/dmasound/dmasound_awacs.c           |    30 +-
 sound/oss/emu10k1/audio.c                     |    65 +-
 sound/oss/emu10k1/cardwi.c                    |     4 +-
 sound/oss/emu10k1/cardwi.h                    |     2 +-
 sound/oss/emu10k1/cardwo.c                    |     6 +-
 sound/oss/emu10k1/cardwo.h                    |     2 +-
 sound/oss/emu10k1/midi.c                      |     4 +-
 sound/oss/emu10k1/mixer.c                     |    29 +-
 sound/oss/emu10k1/passthrough.c               |     7 +-
 sound/oss/emu10k1/passthrough.h               |     2 +-
 sound/oss/es1370.c                            |   144 +-
 sound/oss/es1371.c                            |   107 +-
 sound/oss/esssolo1.c                          |   109 +-
 sound/oss/forte.c                             |    56 +-
 sound/oss/gus.h                               |     2 +-
 sound/oss/gus_wave.c                          |    26 +-
 sound/oss/i810_audio.c                        |   419 +-
 sound/oss/ics2101.c                           |     8 +-
 sound/oss/kahlua.c                            |     2 +-
 sound/oss/maestro.c                           |    68 +-
 sound/oss/maestro3.c                          |    54 +-
 sound/oss/maui.c                              |     6 +-
 sound/oss/midi_synth.c                        |     6 +-
 sound/oss/midi_synth.h                        |     4 +-
 sound/oss/midibuf.c                           |    10 +-
 sound/oss/mpu401.c                            |    52 +-
 sound/oss/msnd.c                              |    27 +-
 sound/oss/msnd.h                              |     4 +-
 sound/oss/msnd_pinnacle.c                     |   133 +-
 sound/oss/nm256_audio.c                       |    19 +-
 sound/oss/opl3.c                              |    10 +-
 sound/oss/opl3sa2.c                           |    33 +-
 sound/oss/os.h                                |     2 +-
 sound/oss/pas2_mixer.c                        |    19 +-
 sound/oss/pas2_pcm.c                          |    22 +-
 sound/oss/pss.c                               |    98 +-
 sound/oss/rme96xx.c                           |    77 +-
 sound/oss/sb_audio.c                          |     2 +-
 sound/oss/sb_card.c                           |     7 +
 sound/oss/sb_card.h                           |     2 +
 sound/oss/sb_common.c                         |     5 +-
 sound/oss/sb_midi.c                           |     2 +-
 sound/oss/sb_mixer.c                          |    13 +-
 sound/oss/sequencer.c                         |    31 +-
 sound/oss/sonicvibes.c                        |    99 +-
 sound/oss/sound_calls.h                       |    22 +-
 sound/oss/sound_timer.c                       |    11 +-
 sound/oss/soundcard.c                         |    43 +-
 sound/oss/sscape.c                            |     2 +-
 sound/oss/sys_timer.c                         |    19 +-
 sound/oss/trident.c                           |    74 +-
 sound/oss/v_midi.c                            |     2 +-
 sound/oss/via82cxxx_audio.c                   |    66 +-
 sound/oss/vidc.c                              |     6 +-
 sound/oss/vwsnd.c                             |    32 +-
 sound/oss/waveartist.c                        |    22 +-
 sound/oss/wavfront.c                          |    48 +-
 sound/oss/wf_midi.c                           |     7 +-
 sound/oss/ymfpci.c                            |    48 +-
 sound/parisc/harmony.c                        |   226 +-
 sound/pci/Kconfig                             |    18 +-
 sound/pci/ac97/ac97_codec.c                   |   111 +-
 sound/pci/ac97/ac97_local.h                   |     3 +-
 sound/pci/ac97/ac97_patch.c                   |   237 +-
 sound/pci/ac97/ac97_pcm.c                     |     2 +-
 sound/pci/ac97/ac97_proc.c                    |    79 +
 sound/pci/ali5451/ali5451.c                   |    92 +-
 sound/pci/als4000.c                           |    46 +-
 sound/pci/atiixp.c                            |   321 +-
 sound/pci/au88x0/au8810.h                     |   106 +-
 sound/pci/au88x0/au8820.c                     |     2 +-
 sound/pci/au88x0/au8820.h                     |     4 +-
 sound/pci/au88x0/au8830.c                     |     2 +-
 sound/pci/au88x0/au8830.h                     |     8 +-
 sound/pci/au88x0/au88x0.c                     |   152 +-
 sound/pci/au88x0/au88x0.h                     |    16 +-
 sound/pci/au88x0/au88x0_a3d.c                 |     6 +
 sound/pci/au88x0/au88x0_core.c                |    61 +-
 sound/pci/au88x0/au88x0_eq.c                  |     4 +-
 sound/pci/au88x0/au88x0_game.c                |    15 +-
 sound/pci/au88x0/au88x0_pcm.c                 |    23 +-
 sound/pci/au88x0/au88x0_synth.c               |    24 +-
 sound/pci/azt3328.c                           |    67 +-
 sound/pci/bt87x.c                             |    49 +-
 sound/pci/cmipci.c                            |   545 +-
 sound/pci/cs4281.c                            |   121 +-
 sound/pci/cs46xx/cs46xx.c                     |    75 +-
 sound/pci/cs46xx/cs46xx_lib.c                 |    48 +-
 sound/pci/emu10k1/emu10k1.c                   |    55 +-
 sound/pci/emu10k1/emu10k1_main.c              |     2 +-
 sound/pci/emu10k1/emufx.c                     |    56 +-
 sound/pci/emu10k1/emumixer.c                  |    11 +
 sound/pci/emu10k1/emuproc.c                   |     2 +-
 sound/pci/ens1370.c                           |    56 +-
 sound/pci/es1938.c                            |    44 +-
 sound/pci/es1968.c                            |   160 +-
 sound/pci/fm801.c                             |    43 +-
 sound/pci/ice1712/Makefile                    |     2 +-
 sound/pci/ice1712/amp.c                       |     9 +-
 sound/pci/ice1712/aureon.c                    |   406 +-
 sound/pci/ice1712/aureon.h                    |    10 +-
 sound/pci/ice1712/delta.c                     |    80 +-
 sound/pci/ice1712/envy24ht.h                  |     3 +
 sound/pci/ice1712/ews.c                       |    45 +-
 sound/pci/ice1712/hoontech.c                  |   125 +-
 sound/pci/ice1712/hoontech.h                  |    15 +-
 sound/pci/ice1712/ice1712.c                   |   171 +-
 sound/pci/ice1712/ice1712.h                   |     6 +
 sound/pci/ice1712/ice1724.c                   |   281 +-
 sound/pci/ice1712/revo.c                      |     9 +-
 sound/pci/intel8x0.c                          |   199 +-
 sound/pci/intel8x0m.c                         |   121 +-
 sound/pci/korg1212/korg1212.c                 |    56 +-
 sound/pci/maestro3.c                          |   117 +-
 sound/pci/mixart/mixart.c                     |    44 +-
 sound/pci/nm256/nm256.c                       |   161 +-
 sound/pci/rme32.c                             |    42 +-
 sound/pci/rme96.c                             |    44 +-
 sound/pci/rme9652/hdsp.c                      |   133 +-
 sound/pci/rme9652/rme9652.c                   |    49 +-
 sound/pci/sonicvibes.c                        |    50 +-
 sound/pci/trident/trident.c                   |    73 +-
 sound/pci/trident/trident_main.c              |    53 +-
 sound/pci/trident/trident_memory.c            |     2 +-
 sound/pci/trident/trident_synth.c             |     4 +-
 sound/pci/via82xx.c                           |   169 +-
 sound/pci/vx222/vx222.c                       |    44 +-
 sound/pci/vx222/vx222_ops.c                   |     3 +-
 sound/pci/ymfpci/ymfpci.c                     |    77 +-
 sound/pci/ymfpci/ymfpci_main.c                |    37 +-
 sound/pcmcia/Kconfig                          |     1 +
 sound/pcmcia/pdaudiocf/pdaudiocf.c            |    21 +-
 sound/pcmcia/pdaudiocf/pdaudiocf.h            |     7 +-
 sound/pcmcia/pdaudiocf/pdaudiocf_core.c       |    33 +-
 sound/pcmcia/pdaudiocf/pdaudiocf_irq.c        |     7 +-
 sound/pcmcia/vx/vxp_ops.c                     |     3 +-
 sound/pcmcia/vx/vxpocket.c                    |    14 +-
 sound/ppc/keywest.c                           |    18 +-
 sound/ppc/pmac.c                              |    65 +-
 sound/ppc/pmac.h                              |     2 +-
 sound/ppc/powermac.c                          |    35 +-
 sound/ppc/tumbler.c                           |     4 +-
 sound/sparc/amd7930.c                         |    30 +-
 sound/sparc/cs4231.c                          |    30 +-
 sound/synth/emux/emux_oss.c                   |     4 +-
 sound/synth/emux/soundfont.c                  |     2 +-
 sound/usb/usbaudio.c                          |   172 +-
 sound/usb/usbaudio.h                          |     5 +
 sound/usb/usbmixer.c                          |     4 +-
 sound/usb/usbquirks.h                         |    96 +-
 3414 files changed, 119930 insertions(+), 101191 deletions(-)

diff --git a/CREDITS b/CREDITS
index 505e02130..9eb5b8545 100644
--- a/CREDITS
+++ b/CREDITS
@@ -830,10 +830,10 @@ S: Boulder, CO 80302
 S: USA
 
 N: Thomas Dunbar
-E: tdunbar@vtaix.cc.vt.edu
+E: tdunbar@vt.edu
 D: TeX & METAFONT hacking/maintenance
-S: Dean, Graduate School
-S: Virginia Tech
+S: Virginia Tech Computing Center
+S: 1700 Pratt Drive
 S: Blacksburg, Virginia 24061
 S: USA
 
@@ -1284,8 +1284,8 @@ P: 1024D/77D4FC9B F5C5 1C20 1DFC DEC3 3107  54A4 2332 ADFC 77D4 FC9B
 D: National Language Support
 D: Linux Internationalization Project
 D: German Localization for Linux and GNU software
-S: Helenenstrasse 18
-S: 65183 Wiesbaden
+S: Kriemhildring 12a
+S: 65795 Hattersheim am Main
 S: Germany
 
 N: Christoph Hellwig
@@ -1951,9 +1951,9 @@ S: USA
 
 N: Robert M. Love
 E: rml@tech9.net
-E: rml@ufl.edu
+E: rml@novell.com
 D: misc. kernel hacking and debugging
-S: Gainesville, Florida 32608
+S: Cambridge, MA 02139
 S: USA
 
 N: Martin von Löwis
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index 9cf7cd0cd..0424c92f5 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -779,62 +779,7 @@ printk(KERN_INFO "my ip: %d.%d.%d.%d\n", NIPQUAD(ipaddress));
    </para>
   </sect1>
 
-  <sect1 id="routines-module-use-counters">
-   <title> <function>MOD_INC_USE_COUNT</function>/<function>MOD_DEC_USE_COUNT</function>
-    <filename class="headerfile">include/linux/module.h</filename></title>
-
-   <para>
-    These manipulate the module usage count, to protect against
-    removal (a module also can't be removed if another module uses
-    one of its exported symbols: see below).  Every reference to
-    the module from user context should be reflected by this
-    counter (e.g. for every data structure or socket) before the
-    function sleeps.  To quote Tim Waugh:
-   </para>
-
-   <programlisting>
-/* THIS IS BAD */
-foo_open (...)
-{
-        stuff..
-        if (fail)
-                return -EBUSY;
-        sleep.. (might get unloaded here)
-        stuff..
-        MOD_INC_USE_COUNT;
-        return 0;
-}
-
-/* THIS IS GOOD /
-foo_open (...)
-{
-        MOD_INC_USE_COUNT;
-        stuff..
-        if (fail) {
-                MOD_DEC_USE_COUNT;
-                return -EBUSY;
-        }
-        sleep.. (safe now)
-        stuff..
-        return 0;
-}
-   </programlisting>
-
-   <para>
-   You can often avoid having to deal with these problems by using the 
-   <structfield>owner</structfield> field of the 
-   <structname>file_operations</structname> structure. Set this field
-   as the macro <symbol>THIS_MODULE</symbol>.
-   </para>
-
-   <para>
-   For more complicated module unload locking requirements, you can set the
-   <structfield>can_unload</structfield> function pointer to your own routine,
-   which should return <returnvalue>0</returnvalue> if the module is
-   unloadable, or <returnvalue>-EBUSY</returnvalue> otherwise.
-   </para> 
-  
-  </sect1>
+ <!-- add info on new-style module refcounting here -->
  </chapter>
 
  <chapter id="queues">
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl
index 77812bbdb..ac0d5fc0a 100644
--- a/Documentation/DocBook/libata.tmpl
+++ b/Documentation/DocBook/libata.tmpl
@@ -64,12 +64,16 @@
   <chapter id="libataExt">
      <title>libata Library</title>
 !Edrivers/scsi/libata-core.c
-!Edrivers/scsi/libata-scsi.c
   </chapter>
 
   <chapter id="libataInt">
-     <title>libata Internals</title>
+     <title>libata Core Internals</title>
 !Idrivers/scsi/libata-core.c
+  </chapter>
+
+  <chapter id="libataScsiInt">
+     <title>libata SCSI translation/emulation</title>
+!Edrivers/scsi/libata-scsi.c
 !Idrivers/scsi/libata-scsi.c
   </chapter>
 
@@ -83,9 +87,4 @@
 !Idrivers/scsi/sata_sil.c
   </chapter>
 
-  <chapter id="VIAInt">
-     <title>ata_via Internals</title>
-!Idrivers/scsi/sata_via.c
-  </chapter>
-
 </book>
diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl
index b942a25a4..45243eeb2 100644
--- a/Documentation/DocBook/videobook.tmpl
+++ b/Documentation/DocBook/videobook.tmpl
@@ -232,7 +232,6 @@ static int radio_open(stuct video_device *dev, int flags)
         if(users)
                 return -EBUSY;
         users++;
-        MOD_INC_USE_COUNT;
         return 0;
 }
 
@@ -248,7 +247,6 @@ static int radio_open(stuct video_device *dev, int flags)
 static int radio_close(struct video_device *dev)
 {
         users--;
-        MOD_DEC_USE_COUNT;
 }
 
   </programlisting>
@@ -954,7 +952,6 @@ static int camera_open(stuct video_device *dev, int flags)
         if(request_irq(irq, camera_irq, 0, "camera", dev)&lt;0)
                 return -EBUSY;
         users++;
-        MOD_INC_USE_COUNT;
         return 0;
 }
 
@@ -963,7 +960,6 @@ static int camera_close(struct video_device *dev)
 {
         users--;
         free_irq(irq, dev);
-        MOD_DEC_USE_COUNT;
 }
   </programlisting>
   <para>
diff --git a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers
index af422d9ce..293591a88 100644
--- a/Documentation/SubmittingDrivers
+++ b/Documentation/SubmittingDrivers
@@ -121,6 +121,19 @@ Kernel traffic:
 	Weekly summary of kernel list activity (much easier to read)
 	http://www.kerneltraffic.org/kernel-traffic/
 
+LWN.net:
+	Weekly summary of kernel development activity - http://lwn.net/
+	2.6 driver porting information:
+		http://lwn.net/Articles/driver-porting/
+
+KernelTrap:
+	Occasional Linux kernel articles and developer interviews
+	http://kerneltrap.org/
+
+KernelNewbies:
+	Documentation and assistance for new kernel programmers
+	http://kernelnewbies.org/
+
 Linux USB project:
 	http://sourceforge.net/projects/linux-usb/
 
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 25db7b521..9838d32b2 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -132,6 +132,21 @@ which require discussion or do not have a clear advantage should
 usually be sent first to linux-kernel.  Only after the patch is
 discussed should the patch then be submitted to Linus.
 
+For small patches you may want to CC the Trivial Patch Monkey
+trivial@rustcorp.com.au set up by Rusty Russell; which collects "trivial"
+patches. Trivial patches must qualify for one of the following rules:
+ Spelling fixes in documentation
+ Spelling fixes which could break grep(1).
+ Warning fixes (cluttering with useless warnings is bad)
+ Compilation fixes (only if they are actually correct)
+ Runtime fixes (only if they actually fix things)
+ Removing use of deprecated functions/macros (eg. check_region).
+ Contact detail and documentation fixes
+ Non-portable code replaced by portable code (even in arch-specific,
+ since people copy, as long as it's trivial)
+ Any fix by the author/maintainer of the file. (ie. patch monkey
+ in re-transmission mode)
+
 
 
 5) Select your CC (e-mail carbon copy) list.
@@ -244,6 +259,47 @@ e-mail discussions.
 
 
 
+11) Sign your work
+
+To improve tracking of who did what, especially with patches that can
+percolate to their final resting place in the kernel through several
+layers of maintainers, we've introduced a "sign-off" procedure on
+patches that are being emailed around.
+
+The sign-off is a simple line at the end of the explanation for the
+patch, which certifies that you wrote it or otherwise have the right to
+pass it on as a open-source patch.  The rules are pretty simple: if you
+can certify the below:
+
+        Developer's Certificate of Origin 1.0
+
+        By making a contribution to this project, I certify that:
+
+        (a) The contribution was created in whole or in part by me and I
+            have the right to submit it under the open source license
+            indicated in the file; or
+
+        (b) The contribution is based upon previous work that, to the best
+            of my knowledge, is covered under an appropriate open source
+            license and I have the right under that license to submit that
+            work with modifications, whether created in whole or in part
+            by me, under the same open source license (unless I am
+            permitted to submit under a different license), as indicated
+            in the file; or
+
+        (c) The contribution was provided directly to me by some other
+            person who certified (a), (b) or (c) and I have not modified
+            it.
+
+then you just add a line saying
+
+	Signed-off-by: Random J Developer <random@developer.org>
+
+Some people also put extra tags at the end.  They'll just be ignored for
+now, but you can do this to mark internal company procedures or just
+point out some special detail about the sign-off. 
+
+
 -----------------------------------
 SECTION 2 - HINTS, TIPS, AND TRICKS
 -----------------------------------
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 967ce6c56..4b1c93a81 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -1,7 +1,7 @@
 		Kernel Memory Layout on ARM Linux
 
 		Russell King <rmk@arm.linux.org.uk>
-			April 27, 2003 (2.5.68)
+			May 21, 2004 (2.6.6)
 
 This document describes the virtual memory layout which the Linux
 kernel uses for ARM processors.  It indicates which regions are
@@ -29,32 +29,30 @@ ffff0000	ffff0fff	CPU vector page.
 				CPU supports vector relocation (control
 				register V bit.)
 
-ffe00000	fffeffff	Free for platform use, not recommended.
+ffc00000	fffeffff	DMA memory mapping region.  Memory returned
+				by the dma_alloc_xxx functions will be
+				dynamically mapped here.
 
-ffc00000	ffdfffff	2MB consistent memory mapping.
-				Memory returned by the consistent_alloc
-				low level function will be dynamically
-				mapped here.
+ff000000	ffbfffff	Reserved for future expansion of DMA
+				mapping region.
 
-ff000000	ffbfffff	Free for platform use, not recommended.
+VMALLOC_END	feffffff	Free for platform use, recommended.
 
-VMALLOC_END	ff000000	Free for platform use, recommended.
-
-VMALLOC_START	VMALLOC_END	vmalloc() / ioremap() space.
+VMALLOC_START	VMALLOC_END-1	vmalloc() / ioremap() space.
 				Memory returned by vmalloc/ioremap will
 				be dynamically placed in this region.
 				VMALLOC_START may be based upon the value
 				of the high_memory variable.
 
-PAGE_OFFSET	high_memory	Kernel direct-mapped RAM region.
+PAGE_OFFSET	high_memory-1	Kernel direct-mapped RAM region.
 				This maps the platforms RAM, and typically
 				maps all platform RAM in a 1:1 relationship.
 
-TASK_SIZE	PAGE_OFFSET	Kernel module space
+TASK_SIZE	PAGE_OFFSET-1	Kernel module space
 				Kernel modules inserted via insmod are
 				placed here using dynamic mappings.
 
-00001000	TASK_SIZE	User space mappings
+00001000	TASK_SIZE-1	User space mappings
 				Per-thread mappings are placed here via
 				the mmap() system call.
 
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt
index 094631ff5..98e4c6c73 100644
--- a/Documentation/cachetlb.txt
+++ b/Documentation/cachetlb.txt
@@ -322,10 +322,10 @@ maps this page at its virtual address.
 	about doing this.
 
 	The idea is, first at flush_dcache_page() time, if
-	page->mapping->i_mmap{,_shared} are empty lists, just mark the
-	architecture private page flag bit.  Later, in
-	update_mmu_cache(), a check is made of this flag bit, and if
-	set the flush is done and the flag bit is cleared.
+	page->mapping->i_mmap is an empty tree and ->i_mmap_nonlinear
+	an empty list, just mark the architecture private page flag bit.
+	Later, in update_mmu_cache(), a check is made of this flag bit,
+	and if set the flush is done and the flag bit is cleared.
 
 	IMPORTANT NOTE: It is often important, if you defer the flush,
 			that the actual flush occurs on the same CPU
diff --git a/Documentation/cdrom/cdrom-standard.tex b/Documentation/cdrom/cdrom-standard.tex
index af1c93a32..0a51967fe 100644
--- a/Documentation/cdrom/cdrom-standard.tex
+++ b/Documentation/cdrom/cdrom-standard.tex
@@ -352,11 +352,6 @@ user commands {\tt {dd}} or {\tt {cat}}.
 \item[1] Open for $ioctl$ commands, as done by audio-CD playing
 programs.
 \end{itemize}
-In case the driver supports modules, the call $MOD_INC_USE_COUNT$
-should be performed exactly once, if the $open()$ was successful. The
-return value is negative on error, and zero on success. The
-open-for-ioctl call can only fail if there is no hardware.
-
 Notice that any strategic code (closing tray upon $open()$, etc.)\ is
 done by the calling routine in \cdromc, so the low-level routine
 should only be concerned with proper initialization, such as spinning
diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt
index 1ad90c397..29b3f9ffc 100644
--- a/Documentation/cpu-freq/core.txt
+++ b/Documentation/cpu-freq/core.txt
@@ -92,3 +92,7 @@ values:
 cpu	- number of the affected CPU
 old	- old frequency
 new	- new frequency
+
+If the cpufreq core detects the frequency has changed while the system
+was suspended, these notifiers are called with CPUFREQ_RESUMECHANGE as
+second argument.
diff --git a/Documentation/fb/framebuffer.txt b/Documentation/fb/framebuffer.txt
index b8d0b78f4..610e78012 100644
--- a/Documentation/fb/framebuffer.txt
+++ b/Documentation/fb/framebuffer.txt
@@ -190,7 +190,7 @@ We'll say that the horizontal scanrate is about 31 kHz:
     1/(32.141E-6 s) = 31.113E3 Hz
 
 A full screen counts 480 (yres) lines, but we have to consider the vertical
-retrace too (e.g. 49 `pixels'). So a full screen will take
+retrace too (e.g. 49 `lines'). So a full screen will take
 
     (480+49)*32.141E-6 s = 17.002E-3 s
 
diff --git a/Documentation/fb/vesafb.txt b/Documentation/fb/vesafb.txt
index 93514f528..36beb54f1 100644
--- a/Documentation/fb/vesafb.txt
+++ b/Documentation/fb/vesafb.txt
@@ -146,6 +146,10 @@ pmipal	Use the protected mode interface for palette changes.
 
 mtrr	setup memory type range registers for the vesafb framebuffer.
 
+vram:n	remap 'n' MiB of video RAM. If 0 or not specified, remap memory
+	according to video mode. (2.5.66 patch/idea by Antonino Daplas
+	reversed to give override possibility (allocate more fb memory
+	than the kernel would) to 2.4 by tmb@iki.fi)
 
 Have fun!
 
diff --git a/Documentation/filesystems/Exporting b/Documentation/filesystems/Exporting
index 548dcf48e..31047e0fe 100644
--- a/Documentation/filesystems/Exporting
+++ b/Documentation/filesystems/Exporting
@@ -32,7 +32,7 @@ tree.  This means that if any filesystem object is in the dcache, then
 all of the ancestors of that filesystem object are also in the dcache.
 As normal access is by filename this prefix is created naturally and
 maintained easily (by each object maintaining a reference count on
-it's parent).
+its parent).
 
 However when objects are included into the dcache by interpreting a
 filehandle fragment, there is no automatic creation of a path prefix
@@ -44,15 +44,15 @@ the dcache that are not needed for normal filesystem access.
 2/ The dcache must be prepared for a newly found (via ->lookup) directory
    to already have a (non-connected) dentry, and must be able to move
    that dentry into place (based on the parent and name in the
-   ->lookup).   This is particuarly needed for directories as
+   ->lookup).   This is particularly needed for directories as
    it is a dcache invariant that directories only have one dentry.
 
 To implement these features, the dcache has:
 
-a/ A dentry flag  DCACHE_DISCONNECTED which is set on
-   and dentry that might not be part of the proper prefix.
+a/ A dentry flag DCACHE_DISCONNECTED which is set on
+   any dentry that might not be part of the proper prefix.
    This is set when anonymous dentries are created, and cleared when a
-   dentry is noticed to be a child on a dentry which is in the proper
+   dentry is noticed to be a child of a dentry which is in the proper
    prefix. 
 
 b/ A per-superblock list "s_anon" of dentries which are the roots of
@@ -123,9 +123,9 @@ filesystem:
   get_name.  When given a parent dentry and a child dentry, this
     should find a name in the directory identified by the parent
     dentry, which leads to the object identified by the child dentry.
-    If no get_name function is supplied, a default implementation
-    which used vfs_readdir to find potential names, and matches inode
-    numbers to find the correct match.
+    If no get_name function is supplied, a default implementation is
+    provided which uses vfs_readdir to find potential names, and
+    matches inode numbers to find the correct match.
 
   get_parent.  When given a dentry for a directory, this should return 
     a dentry for the parent.  Quite possibly the parent dentry will
@@ -135,7 +135,7 @@ filesystem:
     ->lookup("..") is *not* used as a default as it can leave ".."
     entries in the dcache which are too messy to work with.
 
-  get_dentry.  When given a opaque datum, this should find the
+  get_dentry.  When given an opaque datum, this should find the
     implied object and create a dentry for it (possibly with
     d_alloc_anon). 
     The opaque datum is whatever is passed down by the decode_fh
@@ -143,7 +143,7 @@ filesystem:
     fragment.
     decode_fh passes two datums through find_exported_dentry.  One that 
     should be used to identify the target object, and one that can be
-    used to identify the objects parent, should that be necessary.
+    used to identify the object's parent, should that be necessary.
     The default get_dentry function assumes that the datum contains an
     inode number and a generation number, and it attempts to get the
     inode using "iget" and check it's validity by matching the
@@ -164,8 +164,8 @@ filehandle assuming the format used by the default encode_fh and
 passed them to find_exported_dentry.
 
 
-A filehandle fragment consists of an array of 1 or more 4byte words.
-Together with a one byte "type".
+A filehandle fragment consists of an array of 1 or more 4byte words,
+together with a one byte "type".
 The decode_fh routine should not depend on the stated size that is
 passed to it.  This size may be larger than the original filehandle
 generated by encode_fh, in which case it will have been padded with
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 83e6a8f83..e0ef1f80f 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -203,20 +203,34 @@ currently-in-progress I/O.
 
 If the filesystem is not called for "sync" and it determines that it
 would need to block against in-progress I/O to be able to start new I/O
-against the page the filesystem shoud redirty the page (usually with
-__set_page_dirty_nobuffers()), then unlock the page and return zero. 
+against the page the filesystem should redirty the page with
+redirty_page_for_writepage(), then unlock the page and return zero.
 This may also be done to avoid internal deadlocks, but rarely.
 
 If the filesytem is called for sync then it must wait on any
 in-progress I/O and then start new I/O.
 
 The filesystem should unlock the page synchronously, before returning
-to the caller.  If the page has write I/O underway against it,
-writepage() should run SetPageWriteback() against the page prior to
-unlocking it.  The write I/O completion handler should run
-end_page_writeback() against the page.
-
-That is: after 2.5.12, pages which are under writeout are *not* locked.
+to the caller.
+
+Unless the filesystem is going to redirty_page_for_writepage(), unlock the page
+and return zero, writepage *must* run set_page_writeback() against the page,
+followed by unlocking it.  Once set_page_writeback() has been run against the
+page, write I/O can be submitted and the write I/O completion handler must run
+end_page_writeback() once the I/O is complete.  If no I/O is submitted, the
+filesystem must run end_page_writeback() against the page before returning from
+writepage.
+
+That is: after 2.5.12, pages which are under writeout are *not* locked.  Note,
+if the filesystem needs the page to be locked during writeout, that is ok, too,
+the page is allowed to be unlocked at any point in time between the calls to
+set_page_writeback() and end_page_writeback().
+
+Note, failure to run either redirty_page_for_writepage() or the combination of
+set_page_writeback()/end_page_writeback() on a page submitted to writepage
+will leave the page itself marked clean but it will be tagged as dirty in the
+radix tree.  This incoherency can lead to all sorts of hard-to-debug problems
+in the filesystem like having dirty inodes at umount and losing written data.
 
 	->sync_page() locking rules are not well-defined - usually it is called
 with lock on page, but that is not guaranteed. Considering the currently
diff --git a/Documentation/filesystems/befs.txt b/Documentation/filesystems/befs.txt
index ca730cf5c..877a7b1d4 100644
--- a/Documentation/filesystems/befs.txt
+++ b/Documentation/filesystems/befs.txt
@@ -17,8 +17,8 @@ Or the GNU website: <http://www.gnu.org/licenses/licenses.html>
 
 AUTHOR
 =====
-Current maintainer: Will Dyson <will_dyson@pobox.com>
-Has been working on the code since Aug 13, 2001. See the changelog for
+The largest part of the code written by Will Dyson <will_dyson@pobox.com>
+He has been working on the code since Aug 13, 2001. See the changelog for
 details.
 
 Original Author: Makoto Kato <m_kato@ga2.so-net.ne.jp>
@@ -27,6 +27,8 @@ His orriginal code can still be found at:
 Does anyone know of a more current email address for Makoto? He doesn't
 respond to the address given above...
 
+Current maintainer: Sergey S. Kostyliov <rathamahata@php4.ru>
+
 WHAT IS THIS DRIVER?
 ==================
 This module implements the native filesystem of BeOS <http://www.be.com/>
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
index 556f8517c..018ec9693 100644
--- a/Documentation/filesystems/ntfs.txt
+++ b/Documentation/filesystems/ntfs.txt
@@ -273,6 +273,31 @@ ChangeLog
 
 Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
 
+2.1.14:
+	- Fix an NFSd caused deadlock reported by several users.
+2.1.13:
+	- Implement writing of inodes (access time updates are not implemented
+	  yet so mounting with -o noatime,nodiratime is enforced).
+	- Enable writing out of resident files so you can now overwrite any
+	  uncompressed, unencrypted, nonsparse file as long as you do not
+	  change the file size.
+	- Add housekeeping of ntfs system files so that ntfsfix no longer needs
+	  to be run after writing to an NTFS volume.
+	  NOTE:  This still leaves quota tracking and user space journalling on
+	  the side but they should not cause data corruption.  In the worst
+	  case the charged quotas will be out of date ($Quota) and some
+	  userspace applications might get confused due to the out of date
+	  userspace journal ($UsnJrnl).
+2.1.12:
+	- Fix the second fix to the decompression engine from the 2.1.9 release
+	  and some further internals cleanups.
+2.1.11:
+	- Driver internal cleanups.
+2.1.10:
+	- Force read-only (re)mounting of volumes with unsupported volume
+	  flags and various cleanups.
+2.1.9:
+	- Fix two bugs in handling of corner cases in the decompression engine.
 2.1.8:
 	- Read the $MFT mirror and compare it to the $MFT and if the two do not
 	  match, force a read-only mount and do not allow read-write remounts.
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 378722d5b..bc552015b 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -852,7 +852,8 @@ this time.
 The value  in  file-max  denotes  the  maximum number of file handles that the
 Linux kernel will allocate. When you get a lot of error messages about running
 out of  file handles, you might want to raise this limit. The default value is
-4096. To change it, just write the new number into the file:
+10% of  RAM in kilobytes.  To  change it, just  write the new number  into the
+file:
 
   # cat /proc/sys/fs/file-max 
   4096 
@@ -864,11 +865,14 @@ out of  file handles, you might want to raise this limit. The default value is
 This method  of  revision  is  useful  for  all customizable parameters of the
 kernel - simply echo the new value to the corresponding file.
 
-The three  values  in file-nr denote the number of allocated file handles, the
-number of  used file handles, and the maximum number of file handles. When the
-allocated file  handles  come close to the maximum, but the number of actually
-used ones  is  far  behind,  you've  encountered  a peak in your usage of file
-handles and you don't need to increase the maximum.
+Historically, the three values in file-nr denoted the number of allocated file
+handles,  the number of  allocated but  unused file  handles, and  the maximum
+number of file handles. Linux 2.6 always  reports 0 as the number of free file
+handles -- this  is not an error,  it just means that the  number of allocated
+file handles exactly matches the number of used file handles.
+
+Attempts to  allocate more  file descriptors than  file-max are  reported with
+printk, look for "VFS: file-max limit <number> reached".
 
 inode-state and inode-nr
 ------------------------
@@ -1208,6 +1212,14 @@ On the  other  hand,  enabling this feature can cause you to run out of memory
 and thrash the system to death, so large and/or important servers will want to
 set this value to 0.
 
+nr_hugepages and hugetlb_shm_group
+----------------------------------
+
+nr_hugepages configures number of hugetlb page reserved for the system.
+
+hugetlb_shm_group contains group id that is allowed to create SysV shared
+memory segment using hugetlb page.
+
 2.5 /proc/sys/dev - Device specific parameters
 ----------------------------------------------
 
@@ -1848,10 +1860,3 @@ need to  recompile  the kernel, or even to reboot the system. The files in the
 command to write value into these files, thereby changing the default settings
 of the kernel.
 ------------------------------------------------------------------------------
-
-
-
-
-
-
-
diff --git a/Documentation/i2c/i2c-old-porting b/Documentation/i2c/i2c-old-porting
index 0bb04120c..158dfe550 100644
--- a/Documentation/i2c/i2c-old-porting
+++ b/Documentation/i2c/i2c-old-porting
@@ -386,7 +386,6 @@ based on the above guide (for clarity).
 +	if(client == NULL) 
  		return -ENOMEM;
 -
--	MOD_INC_USE_COUNT;
 +	client_template.adapter = adap;
 +	client_template.addr = addr;
 +	memcpy(client, &client_template, sizeof(*client));
@@ -432,7 +431,6 @@ based on the above guide (for clarity).
  
 +	init_MUTEX(&decoder->lock);
 +	i2c_attach_client(client);
-+	MOD_INC_USE_COUNT;
  	/* setup and implicit mode 0 select has been performed */
  	return 0;
  }
@@ -463,7 +461,6 @@ based on the above guide (for clarity).
 +	kfree(decoder);
 +	kfree(client);
  
- 	MOD_DEC_USE_COUNT;
  	return 0;
  }
  
@@ -593,12 +590,15 @@ based on the above guide (for clarity).
 -	I2C_SAA7110, I2C_SAA7110+1,	/* Addr range */
 -
 -	saa7110_attach,
-+	IF_NAME,			/* name */
-+	I2C_DRIVERID_SAA7110,	/* in i2c.h */
-+	I2C_DF_NOTIFY,	/* Addr range */
-+	saa7110_probe,
- 	saa7110_detach,
- 	saa7110_command
+-	saa7110_detach,
+-	saa7110_command
++	.owner		= THIS_MODULE,
++	.name		= IF_NAME,
++	.id		= I2C_DRIVERID_SAA7110,
++	.flags		= I2C_DF_NOTIFY,
++	.attach_adapter	= saa7110_probe,
++	.detach_adapter	= saa7110_detach,
++	.command	= saa7110_command,
  };
 +static struct i2c_client client_template = {
 +	"saa7110_client",
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients
index 886d605ce..18b9acef0 100644
--- a/Documentation/i2c/porting-clients
+++ b/Documentation/i2c/porting-clients
@@ -62,9 +62,9 @@ Technical changes:
   patch to the Documentation/i2c/sysfs-interface file.
 
 * [Attach] For I2C drivers, the attach function should make sure
-  that the adapter's class has I2C_ADAP_CLASS_SMBUS, using the
+  that the adapter's class has I2C_CLASS_HWMON, using the
   following construct:
-  if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+  if (!(adapter->class & I2C_CLASS_HWMON))
           return 0;
   ISA-only drivers of course don't need this.
 
diff --git a/Documentation/ide.txt b/Documentation/ide.txt
index 07811d2df..58853a4ef 100644
--- a/Documentation/ide.txt
+++ b/Documentation/ide.txt
@@ -248,6 +248,13 @@ Summary of ide driver parameters for kernel command line
  			  allowing ide-floppy, ide-tape, and ide-cdrom|writers
  			  to use ide-scsi emulation on a device specific option.
 
+ "hdx=stroke"		: Should you have a system w/ an AWARD Bios and your
+			  drives are larger than 32GB and it will not boot,
+			  one is required to perform a few OEM operations first.
+			  The option is called "stroke" because it allows one
+			  to "soft clip" the drive to work around a barrier
+			  limit.
+
  "idebus=xx"		: inform IDE driver of VESA/PCI bus speed in MHz,
 			  where "xx" is between 20 and 66 inclusive,
 			  used when tuning chipset PIO modes.
diff --git a/Documentation/initrd.txt b/Documentation/initrd.txt
index 941f9ddd0..7de1c80cd 100644
--- a/Documentation/initrd.txt
+++ b/Documentation/initrd.txt
@@ -333,8 +333,8 @@ Resources
 ---------
 
 [1] Almesberger, Werner; "Booting Linux: The History and the Future"
-    ftp://icaftp.epfl.ch/pub/people/almesber/booting/bootinglinux-current.ps.gz
+    http://www.almesberger.net/cv/papers/ols2k-9.ps.gz
 [2] newlib package (experimental), with initrd example
-    ftp://icaftp.epfl.ch/pub/people/almesber/misc/newlib-linux/
+    http://sources.redhat.com/newlib/
 [3] Brouwer, Andries; "util-linux: Miscellaneous utilities for Linux"
     ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/
diff --git a/Documentation/isdn/INTERFACE b/Documentation/isdn/INTERFACE
index 3b56e226f..5df17e5b2 100644
--- a/Documentation/isdn/INTERFACE
+++ b/Documentation/isdn/INTERFACE
@@ -412,30 +412,6 @@ Description of the Interface between Linklevel and Hardwarelevel
     Returnvalue:
       current protocol-Id (one of the constants ISDN_L3_PROTO)
 
-  ISDN_CMD_LOCK:
-
-    With this command the HL-driver is told, that it will be used by the
-    LL and therefore may not be unloaded. The HL-driver should use
-    MOD_INC_USE_COUNT to tell that to the kernel.
-
-    Parameter:
-      driver      = driver-Id.
-      command     = ISDN_CMD_LOCK
-      arg         = unused.
-      parm        = unused.
-
-  ISDN_CMD_UNLOCK:
-
-    With this command the HL-driver is told, that it is no more used by the
-    LL and therefore may be unloaded. The HL-driver should use
-    DEC_INC_USE_COUNT to tell that to the kernel.
-
-    Parameter:
-      driver      = driver-Id.
-      command     = ISDN_CMD_UNLOCK
-      arg         = unused.
-      parm        = unused.
-
   ISDN_CMD_PROCEED: 
 
     With this command, the HL-driver is told to proceed with a incoming call.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 591e458ee..c26a38ac5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -896,8 +896,8 @@ running once the system is up.
 	psmouse.rate=	[HW,MOUSE] Set desired mouse report rate, in reports
 			per second.
 	psmouse.resetafter=
-			[HW,MOUSE] Try to reset Synaptics Touchpad after so many
-			bad packets (0 = never).
+			[HW,MOUSE] Try to reset the device after so many bad packets
+			(0 = never).
 	psmouse.resolution=
 			[HW,MOUSE] Set desired mouse resolution, in dpi.
 	psmouse.smartscroll=
diff --git a/Documentation/laptop-mode.txt b/Documentation/laptop-mode.txt
index 9df8d2677..423ecefb7 100644
--- a/Documentation/laptop-mode.txt
+++ b/Documentation/laptop-mode.txt
@@ -69,12 +69,10 @@ Caveats
 * If you have your filesystems listed as type "auto" in fstab, like I did, then
   the control script will not recognize them as filesystems that need remounting.
 
-* If you have XFS, make SURE that you set the XFS_HZ value in the control script
-  correctly, to the value of HZ of your running kernel. Laptop mode will not
-  work correctly if it is set too low, and you may lose data if it is set too
-  high. The reason for this problem is that XFS does not export its sysctl
-  variables in centisecs (like most other subsystems do) but in "jiffies",
-  which is an internal kernel measure. Once this is fixed things will get better.
+* It has been reported that some versions of the mutt mail client use file access
+  times to determine whether a folder contains new mail. If you use mutt and
+  experience this, you must disable the noatime remounting in the control script
+  by setting DO_REMOUNT_NOATIME=0.
 
 
 The details
@@ -281,7 +279,13 @@ parse_mount_opts_wfstab () {
 	fi
 }
 
-KLEVEL="$(uname -r | cut -c1-3)"
+KLEVEL=$(
+           uname -r |
+             (
+	       IFS="." read a b c
+	       echo $a.$b
+	     )
+	 )
 case "$KLEVEL" in
 	"2.4"|"2.6")
 		true
@@ -295,6 +299,9 @@ esac
 # Shall we remount journaled fs. with appropiate commit interval? (1=yes)
 DO_REMOUNTS=1
 
+# And shall we add the "noatime" option to that as well? (1=yes)
+DO_REMOUNT_NOATIME=1
+
 # age time, in seconds. should be put into a sysconfig file
 MAX_AGE=600
 
@@ -319,11 +326,15 @@ DEF_DIRTY_BACKGROUND_RATIO=10
 DEF_DIRTY_RATIO=40
 DEF_XFS_AGE_BUFFER=15
 DEF_XFS_SYNC_INTERVAL=30
+DEF_XFS_BUFD_INTERVAL=1
 
-# This must be adjusted manually to the value of HZ in the running kernel,
-# until the XFS people change their external interfaces to work in centisecs
-# like the rest of the external world. Unfortunately this cannot be automated. :(
-XFS_HZ=1000
+# This must be adjusted manually to the value of HZ in the running kernel
+# on 2.4, until the XFS people change their 2.4 external interfaces to work in
+# centisecs. This can be automated, but it's a work in progress that still needs
+# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external
+# interfaces, and that is currently always set to 100. So you don't need to
+# change this on 2.6.
+XFS_HZ=100
 
 if [ ! -e /proc/sys/vm/laptop_mode ]; then
 	echo "Kernel is not patched with laptop_mode patch."
@@ -335,6 +346,10 @@ if [ ! -w /proc/sys/vm/laptop_mode ]; then
 	exit 1
 fi
 
+if [ $DO_REMOUNT_NOATIME -eq 1 ]; then
+	NOATIME_OPT=",noatime"
+fi
+
 case "$1" in
 	start)
 		AGE=$((100*$MAX_AGE))
@@ -342,19 +357,29 @@ case "$1" in
 		echo -n "Starting laptop_mode"
 
 		if [ -d /proc/sys/vm/pagebuf ] ; then
+			# (For 2.4 and early 2.6.)
 			# This only needs to be set, not reset -- it is only used when
 			# laptop mode is enabled.
 			echo $XFS_AGE > /proc/sys/vm/pagebuf/lm_flush_age
 			echo $XFS_AGE > /proc/sys/fs/xfs/lm_sync_interval
 		elif [ -f /proc/sys/fs/xfs/lm_age_buffer ] ; then
+			# (A couple of early 2.6 laptop mode patches had these.)
 			# The same goes for these.
 			echo $XFS_AGE > /proc/sys/fs/xfs/lm_age_buffer
 			echo $XFS_AGE > /proc/sys/fs/xfs/lm_sync_interval
 		elif [ -f /proc/sys/fs/xfs/age_buffer ] ; then
+			# (2.6.6)
 			# But not for these -- they are also used in normal
 			# operation.
 			echo $XFS_AGE > /proc/sys/fs/xfs/age_buffer
 			echo $XFS_AGE > /proc/sys/fs/xfs/sync_interval
+		elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then
+			# (2.6.7 upwards)
+			# And not for these either. These are in centisecs,
+			# not USER_HZ, so we have to use $AGE, not $XFS_AGE.
+			echo $AGE > /proc/sys/fs/xfs/age_buffer_centisecs
+			echo $AGE > /proc/sys/fs/xfs/xfssyncd_centisecs
+			echo 3000 > /proc/sys/fs/xfs/xfsbufd_centisecs
 		fi
 
 		case "$KLEVEL" in
@@ -376,10 +401,10 @@ case "$1" in
 				case "$FST" in
 					"ext3"|"reiserfs")
 						PARSEDOPTS="$(parse_mount_opts commit "$OPTS")"
-						mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE,noatime
+						mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE$NOATIME_OPT
 						;;
 					"xfs")
-						mount $DEV -t $FST $MP -o remount,$OPTS,noatime
+						mount $DEV -t $FST $MP -o remount,$OPTS$NOATIME_OPT
 						;;
 				esac
 				if [ -b $DEV ] ; then
@@ -395,9 +420,14 @@ case "$1" in
 		echo -n "Stopping laptop_mode"
 		echo "0" > /proc/sys/vm/laptop_mode
 		if [ -f /proc/sys/fs/xfs/age_buffer ] && [ ! -f /proc/sys/fs/xfs/lm_age_buffer ] ; then
-			# These need to be restored though, if there are no lm_*.
+			# These need to be restored, if there are no lm_*.
 			echo "$(($XFS_HZ*$DEF_XFS_AGE_BUFFER))" 	> /proc/sys/fs/xfs/age_buffer
 			echo "$(($XFS_HZ*$DEF_XFS_SYNC_INTERVAL))" 	> /proc/sys/fs/xfs/sync_interval
+		elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then
+			# These need to be restored as well.
+			echo "$((100*$DEF_XFS_AGE_BUFFER))" > /proc/sys/fs/xfs/age_buffer_centisecs
+			echo "$((100*$DEF_XFS_SYNC_INTERVAL))" > /proc/sys/fs/xfs/xfssyncd_centisecs
+			echo "$((100*$DEF_XFS_BUFD_INTERVAL))" > /proc/sys/fs/xfs/xfsbufd_centisecs
 		fi
 		case "$KLEVEL" in
 			"2.4")
@@ -472,16 +502,16 @@ status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/AC/state`
 
 case $status in
         "on-line")
-                echo "Setting HD spindown to 2 hours"
-                /sbin/laptop-mode stop
+                echo "Setting HD spindown for AC mode."
+                /sbin/laptop_mode stop
                 /sbin/hdparm -S $ACAD_HD /dev/hda > /dev/null 2>&1
                 /sbin/hdparm -B 255 /dev/hda > /dev/null 2>&1
                 #echo -n $ACAD_CPU:$ACAD_THR > /proc/acpi/processor/CPU0/limit
                 exit 0
         ;;
         "off-line")
-                echo "Setting HD spindown to 20 seconds"
-                /sbin/laptop-mode start
+                echo "Setting HD spindown for battery mode."
+                /sbin/laptop_mode start
                 /sbin/hdparm -S $BATT_HD /dev/hda > /dev/null 2>&1
                 /sbin/hdparm -B 1 /dev/hda > /dev/null 2>&1
                 #echo -n $BATT_CPU:$BATT_THR > /proc/acpi/processor/CPU0/limit
diff --git a/Documentation/md.txt b/Documentation/md.txt
index 203231307..3fb3b1ef1 100644
--- a/Documentation/md.txt
+++ b/Documentation/md.txt
@@ -2,6 +2,8 @@ Tools that manage md devices can be found at
    http://www.<country>.kernel.org/pub/linux/utils/raid/....
 
 
+Boot time assembly of RAID arrays
+---------------------------------
 
 You can boot with your md device with the following kernel command
 lines:
@@ -11,6 +13,8 @@ for old raid arrays without persistent superblocks:
 
 for raid arrays with persistent superblocks
   md=<md device no.>,dev0,dev1,...,devn
+or, to assemble a partitionable array:
+  md=d<md device no.>,dev0,dev1,...,devn
   
 md device no. = the number of the md device ... 
               0 means md0, 
@@ -34,7 +38,22 @@ A possible loadlin line (Harald Hoyer <HarryH@Royal.Net>)  looks like this:
 
 e:\loadlin\loadlin e:\zimage root=/dev/md0 md=0,0,4,0,/dev/hdb2,/dev/hdc3 ro
 
--------------------------------
+
+Boot time autodetection of RAID arrays
+--------------------------------------
+
+When md is compiled into the kernel (not as module), partitions of
+type 0xfd are scanned and automatically assembled into RAID arrays.
+This autodetection may be suppressed with the kernel parameter
+"raid=noautodetect".
+
+The kernel parameter "raid=partitionable" (or "raid=part") means
+that all auto-detected arrays are assembled as partitionable.
+
+
+Superblock formats
+------------------
+
 The md driver can support a variety of different superblock formats.
 (It doesn't yet, but it can)
 
@@ -82,7 +101,7 @@ array using HOT_REMOVE_DISK.
 
 
 Specific Rules that apply to format-0 super block arrays, and
-       arrays with no superblock (non-presistant).
+       arrays with no superblock (non-persistant).
 -------------------------------------------------------------
 
 An array can be 'created' by describing the array (level, chunksize
diff --git a/Documentation/networking/bridge.txt b/Documentation/networking/bridge.txt
index 66ffb4c1f..bdae2db41 100644
--- a/Documentation/networking/bridge.txt
+++ b/Documentation/networking/bridge.txt
@@ -1,11 +1,8 @@
-In order to use the ethernet bridging functionality you'll need the
-userspace tools available at http://www.math.leidenuniv.nl/~buytenh/bridge.
-The tarball available there contains extensive documentation, but if you
-still have questions, don't hesitate to post to the mailing list (more info
-at http://www.math.leidenuniv.nl/mailman/listinfo/bridge). You can also
-mail me at buytenh@gnu.org.
+In order to use the Ethernet bridging functionality, you'll need the
+userspace tools. These programs and documentation are available
+at http://bridge.sourceforge.net.  The download page is
+http://prdownloads.sourceforge.net/bridge.
 
+If you still have questions, don't hesitate to post to the mailing list 
+(more info http://lists.osdl.org/mailman/listinfo/bridge).
 
-
-Lennert Buytenhek
-<buytenh@gnu.org>
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index b0bc0ede3..708e12a20 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -340,6 +340,11 @@ tcp_bic_fast_convergence - BOOLEAN
 	more rapidly.
 	Default: 1
 
+tcp_default_win_scale - INTEGER
+	Sets the minimum window scale TCP will negotiate for on all
+	conections.
+	Default: 7
+
 ip_local_port_range - 2 INTEGERS
 	Defines the local port range that is used by TCP and UDP to
 	choose the local port. The first number is the first, the 
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index 091b2d202..8d4cf7825 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -1,11 +1,3 @@
-
-DaveM:
-
-If you agree with it I will send two small patches to modify
-kernel's configure help. 
-
-	Ulisses
-
 --------------------------------------------------------------------------------
 + ABSTRACT
 --------------------------------------------------------------------------------
@@ -405,8 +397,3 @@ then poll for frames.
    
    Jesse Brandeburg, for fixing my grammathical/spelling errors
 
->>> EOF
--
-To unsubscribe from this list: send the line "unsubscribe linux-net" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at  http://vger.kernel.org/majordomo-info.html
\ No newline at end of file
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index afe9bb766..8bc308d03 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -123,10 +123,79 @@ server is not hotplug capable. What do you do? Suspend to disk,
 replace ethernet card, resume. If you are fast your users will not
 even see broken connections.
 
-Any other idea you might have tell me!
 
-Contacting the author
-If you have any question or any patch that solves the above or detected
-problems please contact me at seasons@falcon.sch.bme.hu. I might delay
-answering, sorry about that.
+Q: Maybe I'm missing something, but why don't the regular I/O paths work?
 
+A: We do use the regular I/O paths. However we cannot restore the data
+to its original location as we load it. That would create an
+inconsistent kernel state which would certainly result in an oops.
+Instead, we load the image into unused memory and then atomically copy
+it back to it original location. This implies, of course, a maximum
+image size of half the amount of memory.
+
+There are two solutions to this:
+
+* require half of memory to be free during suspend. That way you can
+read "new" data onto free spots, then cli and copy
+
+* assume we had special "polling" ide driver that only uses memory
+between 0-640KB. That way, I'd have to make sure that 0-640KB is free
+during suspending, but otherwise it would work...
+
+suspend2 shares this fundamental limitation, but does not include user
+data and disk caches into "used memory" by saving them in
+advance. That means that the limitation goes away in practice.
+
+Q: Does linux support ACPI S4?
+
+A: No.
+
+When swsusp was created, ACPI was not too widespread, so we tried to
+avoid using ACPI-specific stuff. ACPI also is/was notoriously
+buggy. These days swsusp works on APM-only i386 machines and even
+without any power managment at all. Some versions also work on PPC.
+
+That means that machine does not enter S4 on suspend-to-disk, but
+simply enters S5. That has few advantages, you can for example boot
+windows on next boot, and return to your Linux session later. You
+could even have few different Linuxes on your box (not sharing any
+partitions), and switch between them.
+
+It also has disadvantages. On HP nx5000, if you unplug power cord
+while machine is suspended-to-disk, Linux will fail to notice that.
+
+Q: My machine doesn't work with ACPI. How can I use swsusp than ?
+
+A: Do a reboot() syscall with right parameters. Warning: glibc gets in
+its way, so check with strace:
+
+reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, 0xd000fce2)
+
+(Thanks to Peter Osterlund:)
+
+#include <unistd.h>
+#include <syscall.h>
+
+#define LINUX_REBOOT_MAGIC1     0xfee1dead
+#define LINUX_REBOOT_MAGIC2     672274793
+#define LINUX_REBOOT_CMD_SW_SUSPEND     0xD000FCE2
+
+int main()
+{
+    syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
+            LINUX_REBOOT_CMD_SW_SUSPEND, 0);
+    return 0;
+}
+
+Q: What is 'suspend2'?
+
+A: suspend2 is 'Software Suspend 2', a forked implementation of
+suspend-to-disk which is available as separate patches for 2.4 and 2.6
+kernels from swsusp.sourceforge.net. It includes support for SMP, 4GB
+highmem and preemption. It also has a extensible architecture that
+allows for arbitrary transformations on the image (compression,
+encryption) and arbitrary backends for writing the image (eg to swap
+or an NFS share[Work In Progress]). Questions regarding suspend2
+should be sent to the mailing list available through the suspend2
+website, and not to the Linux Kernel Mailing List. We are working
+toward merging suspend2 into the mainline kernel.
diff --git a/Documentation/power/tricks.txt b/Documentation/power/tricks.txt
index 43283e981..c6d58d3da 100644
--- a/Documentation/power/tricks.txt
+++ b/Documentation/power/tricks.txt
@@ -7,6 +7,8 @@ If you want to trick swsusp/S3 into working, you might want to try:
 * go with minimal config, turn off drivers like USB, AGP you don't
   really need
 
+* turn off APIC and preempt
+
 * use ext2. At least it has working fsck. [If something seemes to go
   wrong, force fsck when you have a chance]
 
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index cd9e2075b..652657307 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -30,6 +30,10 @@ There are three types of systems where video works after S3 resume:
   patched X, and plain text console (no vesafb or radeonfb), see
   http://www.doesi.gmxhome.de/linux/tm800s3/s3.html. (Acer TM 800)
 
+* radeon systems, where X can soft-boot your video card. You'll need
+  patched X, and plain text console (no vesafb or radeonfb), see
+  http://www.doesi.gmxhome.de/linux/tm800s3/s3.html. (Acer TM 800)
+
 Now, if you pass acpi_sleep=something, and it does not work with your
 bios, you'll get hard crash during resume. Be carefull.
 
diff --git a/Documentation/scsi/00-INDEX b/Documentation/scsi/00-INDEX
index bc2e4bdf6..f9cb5bdcc 100644
--- a/Documentation/scsi/00-INDEX
+++ b/Documentation/scsi/00-INDEX
@@ -62,6 +62,8 @@ scsi_mid_low_api.txt
 	- info on API between SCSI layer and low level drivers
 st.txt
 	- info on scsi tape driver
+sym53c500_cs.txt
+	- info on PCMCIA driver for Symbios Logic 53c500 based adapters
 sym53c8xx_2.txt
 	- info on second generation driver for sym53c8xx based adapters
 tmscsim.txt
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index addec5099..10c5bed26 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -416,7 +416,8 @@ Module parameters
 	* Creative Card w/Digital out + Digital I/O 2	[0x0fc3/0x1f0f]
 	* Creative Card w/Digital CD in + Digital I/O 2	[0x0fcf/0x1f0f]
         * Creative Card 5.1/w Digital out + LiveDrive	[0x3fc3/0x1fff]
-        * Creative Card all ins and outs		[0x3fff/0x1fff]
+	* Creative Card 5.1 (c) 2003			[0x3fc3/0x7cff]
+        * Creative Card all ins and outs		[0x3fff/0x7fff]
     
   Module snd-ens1370
   ------------------
@@ -609,6 +610,10 @@ Module parameters
                         * Hoontech SoundTrack DSP 24 Media 7.1
                         * Digigram VX442
 
+    model       - Use the given board model, one of the following:
+		  delta1010, dio2496, delta66, delta44, audiophile, delta410,
+		  delta1010lt, vx442, ewx2496, ews88mt, ews88mt_new, ews88d,
+		  dmx6fire, dsp24, dsp24_71, ez8
     omni	- Omni I/O support for MidiMan M-Audio Delta44/66
     cs8427_timeout - reset timeout for the CS8427 chip (S/PDIF transciever)
                      in msec resolution, default value is 500 (0.5 sec)
@@ -625,6 +630,9 @@ Module parameters
 			* AMP Ltd AUDIO2000
 			* TerraTec Aureon Sky-5.1, Space-7.1
 
+    model       - Use the given board model, one of the following:
+		  revo71, amp2000, prodigy71, aureon51, aureon71
+
     Module supports up to 8 cards and autoprobe.
 
   Module snd-intel8x0
@@ -787,6 +795,8 @@ Module parameters
 
     Module supports autoprobe and multiple chips (max 8).
 
+    The power-management is supported.
+
     Note: on some notebooks the buffer address cannot be detected
     automatically, or causes hang-up during initialization.
     In such a case, specify the buffer top address explicity via
@@ -796,9 +806,24 @@ Module parameters
       Sony F270: buffer_top=0x272800
     The driver supports only ac97 codec.  It's possible to force
     to initialize/use ac97 although it's not detected.  In such a
-    case, use force_ac97=1 option.
-
-    The power-management is supported.
+    case, use force_ac97=1 option - but *NO* guarantee whether it
+    works!
+
+    Note: The NM256 chip can be linked internally with non-AC97
+    codecs.  This driver supports only the AC97 codec, and won't work
+    with machines with other (most likely CS423x or OPL3SAx) chips,
+    even though the device is detected in lspci.  In such a case, try
+    other drivers, e.g. snd-cs4232 or snd-opl3sa2.  Some has ISA-PnP
+    but some doesn't have ISA PnP.  You'll need to speicfy isapnp=0
+    and proper hardware parameters in the case without ISA PnP.
+
+    Note: This driver is really crappy.  It's a porting from the
+    OSS driver, which is a result of black-magic reverse engineering.
+    The detection of codec will fail if the driver is loaded *after*
+    X-server as described above.  You might be able to force to load
+    the module, but it may result in hang-up.   Hence, make sure that
+    you load this module *before* X if you encounter this kind of
+    problem.
 
   Module snd-opl3sa2
   ------------------
diff --git a/Documentation/sound/alsa/CMIPCI.txt b/Documentation/sound/alsa/CMIPCI.txt
index f7e5ff7ba..4a7df771b 100644
--- a/Documentation/sound/alsa/CMIPCI.txt
+++ b/Documentation/sound/alsa/CMIPCI.txt
@@ -180,8 +180,8 @@ Similarly the following switches are off: "IEC958 Mix Analog" and
 device automatically to the previous state.
 
 On the model 033, AC3 is implemented by the software conversion in
-the driver.  This prevents the mmap support.  If you need mmap
-support, pass the "soft_ac3=0" module option.  This doesn't matter
+the alsa-lib.  If you need to bypass the software conversion of IEC958
+subframes, pass the "soft_ac3=0" module option.  This doesn't matter
 on the newer models.
 
 
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 63a46fd2b..934a49a59 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -511,7 +511,7 @@
           }
 
           // (7)
-          pci_set_drvdata(pci, chip);
+          pci_set_drvdata(pci, card);
           dev++;
           return 0;
   }
@@ -519,10 +519,7 @@
   // destructor -- see "Destructor" sub-section
   static void __devexit snd_mychip_remove(struct pci_dev *pci)
   {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                                     pci_get_drvdata(pci), return);
-          if (chip)
-                  snd_card_free(chip->card);
+          snd_card_free(pci_get_drvdata(pci));
           pci_set_drvdata(pci, NULL);
   }
 ]]>
@@ -691,21 +688,16 @@
           <informalexample>
             <programlisting>
 <![CDATA[
-        pci_set_drvdata(pci, chip);
+        pci_set_drvdata(pci, card);
         dev++;
         return 0;
 ]]>
             </programlisting>
           </informalexample>
 
-          In the above, the chip record is stored. This pointer is
+          In the above, the card record is stored. This pointer is
         referred in the remove callback and power-management
         callbacks, too. 
-	If the card doesn't support the suspend/resume, you can store
-        the card pointer instead of the chip pointer, so that
-        <function>snd_card_free</function> can be called directly
-        without cast in the remove callback.  But anyway, be sure
-        which pointer is used.
         </para>
       </section>
     </section>
@@ -726,21 +718,15 @@
 <![CDATA[
   static void __devexit snd_mychip_remove(struct pci_dev *pci)
   {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                                    pci_get_drvdata(pci), return);
-          if (chip)
-                  snd_card_free(chip->card);
+          snd_card_free(pci_get_drvdata(pci));
           pci_set_drvdata(pci, NULL);
   }
 ]]>
           </programlisting>
         </informalexample>
 
-        The above code assumes that the chip is allocated
-	with snd_magic stuff and
-      has the field to hold the card pointer (see <link
-      linkend="card-management"><citetitle>the next
-      section</citetitle></link>). 
+        The above code assumes that the card pointer is set to the PCI
+	driver data.
       </para>
     </section>
 
@@ -1355,16 +1341,7 @@
   // initialization of the module
   static int __init alsa_card_mychip_init(void)
   {
-          int err;
-
-          if ((err = pci_module_init(&driver)) < 0) {
-  #ifdef MODULE
-                  printk(KERN_ERR "My chip soundcard not found "
-                                  "or device busy\n");
-  #endif
-                  return err;
-          }
-          return 0;
+          return pci_module_init(&driver);
   }
 
   // clean up the module
@@ -1781,16 +1758,7 @@
 <![CDATA[
   static int __init alsa_card_mychip_init(void)
   {
-          int err;
-
-          if ((err = pci_module_init(&driver)) < 0) {
-  #ifdef MODULE
-                  printk(KERN_ERR "My chip soundcard not found"
-                                  " or device busy\n");
-  #endif
-                  return err;
-          }
-          return 0;
+          return pci_module_init(&driver);
   }
 
   static void __exit alsa_card_mychip_exit(void)
@@ -5254,65 +5222,34 @@ struct _snd_pcm_runtime {
     </para>
 
     <para>
-      Basic jobs of suspend/resume are done in
-      <structfield>suspend</structfield> and
-      <structfield>resume</structfield> callbacks of
-      <structname>pci_driver</structname> struct. Unfortunately, the
-      API of these callbacks was changed at the middle time of Linux
-      2.4.x, if you want to keep the support for older kernels, you
-      have to write two different callbacks. The example below is the
-      skeleton callbacks which just call the real suspend and resume
-      functions. 
+      ALSA provides the common power-management layer. Each card driver
+      needs to have only low-level suspend and resume callbacks.
 
       <informalexample>
         <programlisting>
 <![CDATA[
-  #ifndef PCI_OLD_SUSPEND
-  static int snd_my_suspend(struct pci_dev *dev, u32 state)
+  #ifdef CONFIG_PM
+  static int snd_my_suspend(snd_card_t *card, unsigned int state)
   {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                             pci_get_drvdata(dev), return -ENXIO);
-          mychip_suspend(chip);
+          .... // do things for suspsend
           return 0;
   }
-  static int snd_my_resume(struct pci_dev *dev)
+  static int snd_my_resume(snd_card_t *card, unsigned int state)
   {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                             pci_get_drvdata(dev), return -ENXIO);
-          mychip_resume(chip);
+          .... // do things for suspsend
           return 0;
   }
-  #else
-  static void snd_my_suspend(struct pci_dev *dev)
-  {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                             pci_get_drvdata(dev), return);
-          mychip_suspend(chip);
-  }
-  static void snd_mychip_resume(struct pci_dev *dev)
-  {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                             pci_get_drvdata(dev), return);
-          mychip_resume(chip);
-  }
   #endif
 ]]>
         </programlisting>
       </informalexample>
     </para>
 
-    <para>
-      For keeping the readability of 2.6 source code, it's recommended to
-      separate the above ifdef condition as the patch file in alsa-driver
-      directory.
-      See <filename>alsa-driver/pci/ali5451.c</filename> for example.
-   </para>
-
     <para>
       The scheme of the real suspend job is as following.
 
       <orderedlist>
-        <listitem><para>Check whether the power-state is already D3hot. If yes, skip the job.</para></listitem>
+        <listitem><para>Retrieve the chip data from pm_private_data field.</para></listitem>
         <listitem><para>Call <function>snd_pcm_suspend_all()</function> to suspend the running PCM streams.</para></listitem>
         <listitem><para>Save the register values if necessary.</para></listitem>
         <listitem><para>Stop the hardware if necessary.</para></listitem>
@@ -5326,12 +5263,11 @@ struct _snd_pcm_runtime {
       <informalexample>
         <programlisting>
 <![CDATA[
-  static void mychip_suspend(mychip_t *chip)
+  static int mychip_suspend(snd_card_t *card, unsigned int state)
   {
-          snd_card_t *card = chip->card;
           // (1)
-          if (card->power_state == SNDRV_CTL_POWER_D3hot)
-                  return;
+          mychip_t *chip = snd_magic_cast(mychip_t, card->pm_private_data,
+                                          return -ENXIO);
           // (2)
           snd_pcm_suspend_all(chip->pcm);
           // (3)
@@ -5340,6 +5276,7 @@ struct _snd_pcm_runtime {
           snd_mychip_stop_hardware(chip);
           // (5)
           snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+          return 0;
   }
 ]]>
         </programlisting>
@@ -5350,8 +5287,7 @@ struct _snd_pcm_runtime {
     The scheme of the real resume job is as following.
 
     <orderedlist>
-    <listitem><para>Check whether the power-state is already D0.
-    If yes, skip the job.</para></listitem>
+    <listitem><para>Retrieve the chip data from pm_private_data field.</para></listitem>
     <listitem><para>Enable the pci device again by calling
     <function>pci_enable_device()</function>.</para></listitem>
     <listitem><para>Re-initialize the chip.</para></listitem>
@@ -5372,10 +5308,9 @@ struct _snd_pcm_runtime {
 <![CDATA[
   static void mychip_resume(mychip_t *chip)
   {
-          snd_card_t *card = chip->card;
           // (1)
-          if (card->power_state == SNDRV_CTL_POWER_D0)
-                  return;
+          mychip_t *chip = snd_magic_cast(mychip_t, card->pm_private_data,
+                                          return -ENXIO);
           // (2)
           pci_enable_device(chip->pci);
           // (3)
@@ -5388,38 +5323,6 @@ struct _snd_pcm_runtime {
           snd_mychip_restart_chip(chip);
           // (7)
           snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-  }
-]]>
-        </programlisting>
-      </informalexample>
-    </para>
-
-    <para>
-      In addition to the callbacks above, you should define a callback
-      for the changes via the ALSA control interface. It's defined
-      like below: 
-
-      <informalexample>
-        <programlisting>
-<![CDATA[
-  static int snd_mychip_set_power_state(snd_card_t *card,
-                                        unsigned int power_state)
-  {
-          mychip_t *chip = snd_magic_cast(mychip_t,
-                   card->power_state_private_data, return -ENXIO);
-          switch (power_state) {
-          case SNDRV_CTL_POWER_D0:
-          case SNDRV_CTL_POWER_D1:
-          case SNDRV_CTL_POWER_D2:
-                  mychip_resume(chip);
-                  break;
-          case SNDRV_CTL_POWER_D3hot:
-          case SNDRV_CTL_POWER_D3cold:
-                  mychip_suspend(chip);
-                  break;
-          default:
-                  return -EINVAL;
-          }
           return 0;
   }
 ]]>
@@ -5439,41 +5342,42 @@ struct _snd_pcm_runtime {
   {
           ....
           snd_card_t *card;
+          mychip_t *chip;
           ....
-  #ifdef CONFIG_PM
-          card->set_power_state = snd_mychip_set_power_state;
-          card->power_state_private_data = chip;
-  #endif
+          snd_card_set_pm_callback(card, snd_my_suspend, snd_my_resume, chip);
           ....
   }
 ]]>
         </programlisting>
       </informalexample>
+
+    Here you don't have to put ifdef CONFIG_PM around, since it's already
+    checked in the header and expanded to empty if not needed.
     </para>
 
     <para>
       If you need a space for saving the registers, you'll need to
-    allocate the buffer for it here, too, since you cannot call
-    <function>kmalloc()</function> with
-    <constant>GFP_KERNEL</constant> flag or
-    <function>vmalloc()</function> in the suspend callback.
+    allocate the buffer for it here, too, since it would be fatal
+    if you cannot allocate a memory in the suspend phase.
     The allocated buffer should be released in the corresponding
     destructor.
     </para>
 
     <para>
       And next, set suspend/resume callbacks to the pci_driver,
+      This can be done by passing a macro SND_PCI_PM_CALLBACKS
+      in the pci_driver struct.  This macro is expanded to the correct
+      (global) callbacks if CONFIG_PM is set.
 
       <informalexample>
         <programlisting>
 <![CDATA[
   static struct pci_driver driver = {
           .name = "My Chip",
-          ....
-  #ifdef CONFIG_PM
-          .suspend = snd_mychip_suspend,
-          .resume = snd_mychip_resume,
-  #endif
+          .id_table = snd_my_ids,
+          .probe = snd_my_probe,
+          .remove = __devexit_p(snd_my_remove),
+          SND_PCI_PM_CALLBACKS
   };
 ]]>
         </programlisting>
@@ -5521,7 +5425,8 @@ struct _snd_pcm_runtime {
 
     <para>
       The module parameters must be declared with the standard
-    <function>MODULE_PARM()</function> and
+    <function>module_param()()</function>,
+    <function>module_param_array()()</function> and
     <function>MODULE_PARM_DESC()</function> macros. The ALSA provides
     an additional macro, <function>MODULE_PARM_SYNTAX()</function>,
     for describing its syntax. The strings will be written to
@@ -5545,18 +5450,22 @@ struct _snd_pcm_runtime {
 <![CDATA[
   #define CARD_NAME "My Chip"
 
-  MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+  static int boot_devs;
+  module_param_array(index, int, boot_devs, 0444);
   MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
   MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-  MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+  module_param_array(id, charp, boot_devs, 0444);
   MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
   MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-  MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+  module_param_array(enable, bool, boot_devs, 0444);
   MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
   MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 ]]>
         </programlisting>
       </informalexample>
+
+    Here boot_devs is passed but simply ignored since we don't care
+    the number of parsed parameters.
     </para>
 
     <para>
@@ -5577,39 +5486,6 @@ struct _snd_pcm_runtime {
       </informalexample>
     </para>
 
-    <para>
-      For building the driver into kernel, you should define the
-      <function>setup()</function> function in addition, too. 
-      ALSA provides <function>get_id()</function> function to retrieve
-      a string argument from the kernel boot parameters.
-
-      <informalexample>
-        <programlisting>
-<![CDATA[
-  #ifndef MODULE
-
-  /* format is: snd-mychip=enable,index,id */
-
-  static int __init alsa_card_mychip_setup(char *str)
-  {
-          static unsigned __initdata nr_dev = 0;
-
-          if (nr_dev >= SNDRV_CARDS)
-                  return 0;
-          (void)(get_option(&str,&enable[nr_dev]) == 2 &&
-                 get_option(&str,&index[nr_dev]) == 2 &&
-                 get_id(&str,&id[nr_dev]) == 2);
-          nr_dev++;
-          return 1;
-  }
-
-  __setup("snd-mychip=", alsa_card_mychip_setup);
-
-  #endif /* ifndef MODULE */
-]]>
-        </programlisting>
-      </informalexample>
-    </para>
   </chapter>
 
 
@@ -5631,10 +5507,14 @@ struct _snd_pcm_runtime {
 	Suppose that you'll create a new PCI driver for the card
 	<quote>xyz</quote>.  The card module name would be
 	snd-xyz.  The new driver is usually put into alsa-driver
-	tree.  Then the driver is evaluated, audited and tested
+	tree, <filename>alsa-driver/pci</filename> directory in
+	the case of PCI cards.
+	Then the driver is evaluated, audited and tested
 	by developers and users.  After a certain time, the driver
-	will go to alsa-kernel tree and eventually integrated into
-	Linux 2.6 tree.
+	will go to alsa-kernel tree (to the corresponding directory,
+	such as <filename>alsa-kernel/pci</filename>) and eventually
+	integrated into Linux 2.6 tree (the directory would be
+	<filename>linux/sound/pci</filename>).
 	</para>
 
 	<para>
@@ -5661,7 +5541,7 @@ struct _snd_pcm_runtime {
         <programlisting>
 <![CDATA[
   snd-xyz-objs := xyz.o
-  extra-obj-$(CONFIG_SND_XYZ) += snd-xyz.o
+  obj-$(CONFIG_SND_XYZ) += snd-xyz.o
 ]]>
         </programlisting>
       </informalexample>
@@ -5678,8 +5558,8 @@ struct _snd_pcm_runtime {
       <informalexample>
         <programlisting>
 <![CDATA[
-  config SND_BT87X
-          tristate "Foobar XYX"
+  config SND_XYZ
+          tristate "Foobar XYZ"
           depends on SND
           select SND_PCM
           help
@@ -5730,7 +5610,8 @@ struct _snd_pcm_runtime {
 	<orderedlist>
 	<listitem>
 	<para>
-	Add a new directory (xyz) to extra-subdir-y list in alsa-driver/pci/Makefile
+	Add a new directory (<filename>xyz</filename>) in
+	<filename>alsa-driver/pci/Makefile</filename> like below
 
       <informalexample>
         <programlisting>
@@ -5744,7 +5625,7 @@ struct _snd_pcm_runtime {
 
 	<listitem>
 	<para>
-	Under the directory xyz, create a Makefile
+	Under the directory <filename>xyz</filename>, create a Makefile
 
       <example>
 	<title>Sample Makefile for a driver xyz</title>
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt
index d686ea3c3..25c5d648a 100644
--- a/Documentation/sound/alsa/Procfile.txt
+++ b/Documentation/sound/alsa/Procfile.txt
@@ -131,6 +131,12 @@ card*/codec97#*/ac97#?-?
 card*/codec97#0/ac97#?-?+regs
 	Shows the AC97 register dump.  Useful for debugging.
 
+	When CONFIG_SND_DEBUG is enabled, you can write to this file for
+	changing an AC97 register directly.  Pass two hex numbers.
+	For example,
+
+	# echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs
+
 
 Sequencer Information
 ---------------------
diff --git a/Documentation/sound/oss/OPL3-SA b/Documentation/sound/oss/OPL3-SA
index 0d91c8bf3..66a91835d 100644
--- a/Documentation/sound/oss/OPL3-SA
+++ b/Documentation/sound/oss/OPL3-SA
@@ -34,7 +34,7 @@ Module options in detail:
 	mpu_irq: This is the MPU401's IRQ.
 
 If you'd like to use the OPL3 FM Synthesizer, make sure you enable
-CONFIG_YM3812 (in 'make config'). That'll build the opl3.o module.
+CONFIG_SOUND_YM3812 (in 'make config'). That'll build the opl3.o module.
 
 Then a simple 'insmod opl3 io=0x388', and you now have FM Synth.
 
diff --git a/Documentation/sound/oss/VIBRA16 b/Documentation/sound/oss/VIBRA16
index 0a0aff9d7..68a5a46be 100644
--- a/Documentation/sound/oss/VIBRA16
+++ b/Documentation/sound/oss/VIBRA16
@@ -62,12 +62,12 @@ modprobe sb io=0x220 irq=5 dma=1 dma16=3
 
 	Or, take the hard way:
 
-insmod souncore
-insmod sound
-insmod uart401
-insmod sb io=0x220 irq=5 dma=1 dma16=3
+modprobe soundcore
+modprobe sound
+modprobe uart401
+modprobe sb io=0x220 irq=5 dma=1 dma16=3
 # do you need MIDI?
-insmod opl3=0x388
+modprobe opl3=0x388
 
 	Just in case, the kernel sound support should be:
 
diff --git a/Documentation/usb/mtouchusb.txt b/Documentation/usb/mtouchusb.txt
index f27200050..cd806bfc8 100644
--- a/Documentation/usb/mtouchusb.txt
+++ b/Documentation/usb/mtouchusb.txt
@@ -1,26 +1,38 @@
 CHANGES
 
-- Created based off of scanner & INSTALL from the original touchscreen
+- 0.3 - Created based off of scanner & INSTALL from the original touchscreen
   driver on freshmeat (http://freshmeat.net/projects/3mtouchscreendriver)
 - Amended for linux-2.4.18, then 2.4.19
 
-- Complete rewrite using Linux Input in 2.6.3
+- 0.5 - Complete rewrite using Linux Input in 2.6.3
    Unfortunately no calibration support at this time
 
+- 1.4 - Multiple changes to support the EXII 5000UC and house cleaning
+   Changed reset from standard USB dev reset to vendor reset
+   Changed data sent to host from compensated to raw coordinates
+   Eliminated vendor/product module params
+   Performed multiple successfull tests with an EXII-5010UC
 
-DRIVER NOTES:
+SUPPORTED HARDWARE:
+
+        All controllers have the Vendor: 0x0596 & Product: 0x0001
 
-Installation is simple, you only need to add Linux Input, Linux USB, and the 
-driver to the kernel.  The driver can also be optionally built as a module.
 
-If you have another MicroTouch device that you wish to experiment with
-or try using this driver with, but the Vendor and Product ID's are not 
-coded in, don't despair.  If the driver was compiled as a module, you can 
-pass options to the driver.  Simply try:
+        Controller Description          Part Number
+        ------------------------------------------------------
 
-  /sbin/modprobe mtouchusb vendor=0x#### product=0x****
+        USB Capacitive - Pearl Case     14-205  (Discontinued)
+        USB Capacitive - Black Case     14-124  (Discontinued)
+        USB Capacitive - No Case        14-206  (Discontinued)
 
-If it works, send me the iVendor & iProduct (or a patch) and I will add...
+        USB Capacitive - Pearl Case     EXII-5010UC
+        USB Capacitive - Black Case     EXII-5030UC
+        USB Capacitive - No Case        EXII-5050UC
+
+DRIVER NOTES:
+
+Installation is simple, you only need to add Linux Input, Linux USB, and the 
+driver to the kernel.  The driver can also be optionally built as a module.
 
 This driver appears to be one of possible 2 Linux USB Input Touchscreen
 drivers.  Although 3M produces a binary only driver available for
@@ -28,53 +40,28 @@ download, I persist in updating this driver since I would like to use the
 touchscreen for embedded apps using QTEmbedded, DirectFB, etc. So I feel the
 logical choice is to use Linux Imput.
 
-A little info about the MicroTouch USB controller (14-206):
-
-Y is inverted, and the device has a total possible resolution of 0 - 65535.
-
-Y is inverted by the driver by:
-
-        input.absmin[ABS_Y] =  MTOUCHUSB_MAX_YC;
-        input.absmax[ABS_Y] =  MTOUCHUSB_MIN_YC;
-
-absmin & absmax are also used to scale the data, sine it is rather high 
-resolution.
-
-    ---------------touch screen area-----------------
-    I                        MicroTouch (xmax,ymax) @I
-    I                      X                         I
-    I   ########visible monitor area##############   I
-    I   #@ (xmin,ymin)                           #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I Y #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                                        #   I
-    I   #                           (xmax,ymax) @#   I
-    I   ##########################################   I
-    I                                                I
-    I@ MicroTouch (xmin,ymin)                        I
-    -------------------------------------------------
-
-Currently there is no way to calibrate the device via this driver.  Perhaps 
-at some point an abstract function will be placed into evdev so generic 
-functions like calibrations, resets, and vendor information can be requested 
-(And the drivers would handle the vendor specific tasks).
-
-ADDITIONAL INFORMATION/UPDATES:
+Currently there is no way to calibrate the device via this driver.  Even if
+the device could be calibrated, the driver pulls to raw coordinate data from
+the controller.  This means calibration must be performed within the
+userspace.
+
+The controller screen resolution is now 0 to 16384 for both X and Y reporting
+the raw touch data.  This is the same for the old and new capacitive USB
+controllers.
+
+Perhaps at some point an abstract function will be placed into evdev so 
+generic functions like calibrations, resets, and vendor information can be 
+requested from the userspace (And the drivers would handle the vendor specific
+tasks).
+
+ADDITIONAL INFORMATION/UPDATES/X CONFIGURATION EXAMPLE:
 
 http://groomlakelabs.com/grandamp/code/microtouch/
 
 TODO:
 
 Implement a control urb again to handle requests to and from the device
-such as calibration, etc.
+such as calibration, etc once/if it becomes available.
 
 DISCLAMER:
 
@@ -83,3 +70,7 @@ this driver!  If you want touch drivers only supported within X, please go to:
 
 http://www.3m.com/3MTouchSystems/downloads/
 
+THANKS:
+
+A huge thank you to 3M Touch Systems for the EXII-5010UC controllers for
+testing!
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 61ae09f49..47a7121b4 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -91,9 +91,12 @@ A regular chown, chgrp and chmod commands (with right permissions) could be
 used to change the file attributes on hugetlbfs.
 
 Also, it is important to note that no such mount command is required if the
-applications are going to use only shmat/shmget system calls.  It is possible
-for same or different applications to use any combination of mmaps and shm*
-calls.  Though the mount of filesystem will be required for using mmaps.
+applications are going to use only shmat/shmget system calls.  Users who
+wish to use hugetlb page via shared memory segment should be a member of
+a supplementary group and system admin needs to configure that gid into
+/proc/sys/vm/hugetlb_shm_group.  It is possible for same or different
+applications to use any combination of mmaps and shm* calls.  Though the
+mount of filesystem will be required for using mmaps.
 
 /* Example of using hugepage in user application using Sys V shared memory
  * system calls.  In this example, app is requesting memory of size 256MB that
diff --git a/Documentation/vm/locking b/Documentation/vm/locking
index d29992e40..c3ef09ae3 100644
--- a/Documentation/vm/locking
+++ b/Documentation/vm/locking
@@ -66,7 +66,7 @@ in some cases it is not really needed. Eg, vm_start is modified by
 expand_stack(), it is hard to come up with a destructive scenario without 
 having the vmlist protection in this case.
 
-The page_table_lock nests with the inode i_shared_sem and the kmem cache
+The page_table_lock nests with the inode i_mmap_lock and the kmem cache
 c_spinlock spinlocks.  This is okay, since the kmem code asks for pages after
 dropping c_spinlock.  The page_table_lock also nests with pagecache_lock and
 pagemap_lru_lock spinlocks, and no code asks for memory with these locks
diff --git a/MAINTAINERS b/MAINTAINERS
index 578c905ea..553945d52 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -168,10 +168,8 @@ S:	Supported
 
 AACRAID SCSI RAID DRIVER
 P:	Adaptec OEM Raid Solutions
-M:	linux-aacraid-devel@dell.com
-L:	linux-aacraid-devel@dell.com
-L:	linux-aacraid-announce@dell.com
-W:	http://domsch.com/linux
+L:	linux-scsi@vger.kernel.org
+W:	http://linux.dell.com/storage.shtml
 S:	Supported
 
 ACPI
@@ -187,6 +185,11 @@ W:	http://www.student.informatik.tu-darmstadt.de/~tek/projects/linux.html
 W:	http://www.tu-darmstadt.de/~tek01/projects/linux.html
 S:	Maintained
 
+ADT746X FAN DRIVER
+P:	Colin Leroy
+M:	colin@colino.net
+S:	Maintained
+
 ADVANSYS SCSI DRIVER
 P:	Bob Frey
 M:	linux@advansys.com
@@ -326,6 +329,12 @@ L:	linux-hams@vger.kernel.org
 W:	http://www.baycom.org/~tom/ham/ham.html
 S:	Maintained
 
+BEFS FILE SYSTEM
+P:	Sergey S. Kostyliov
+M:	rathamahata@php4.ru
+L:	linux-kernel@vger.kernel.org
+S:	Maintained
+
 BERKSHIRE PRODUCTS PC WATCHDOG DRIVER
 P:	Kenji Hollis
 W:	http://ftp.bitgate.com/pcwd/
@@ -350,6 +359,8 @@ P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
 L:	bluez-devel@lists.sf.net
 W:	http://bluez.sf.net
+W:	http://www.bluez.org
+W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH RFCOMM LAYER
@@ -357,7 +368,6 @@ P:	Marcel Holtmann
 M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
-W:	http://bluez.sf.net
 S:	Maintained
 
 BLUETOOTH BNEP LAYER
@@ -365,71 +375,60 @@ P:	Marcel Holtmann
 M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
-W:	http://bluez.sf.net
 S:	Maintained
 
 BLUETOOTH CMTP LAYER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
-BLUETOOTH HCI USB DRIVER
+BLUETOOTH HCI UART DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
-W:	http://bluez.sf.net
 S:	Maintained
 
-BLUETOOTH HCI UART DRIVER
+BLUETOOTH HCI USB DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
-W:	http://bluez.sf.net
 S:	Maintained
 
 BLUETOOTH HCI BCM203X DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH HCI BFUSB DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH HCI DTL1 DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH HCI BLUECARD DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH HCI BT3C DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH HCI BTUART DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
-W:	http://www.holtmann.org/linux/bluetooth/
 S:	Maintained
 
 BLUETOOTH HCI VHCI DRIVER
 P:	Maxim Krasnyansky
 M:	maxk@qualcomm.com
-W:	http://bluez.sf.net
 S:	Maintained
 
 BONDING DRIVER
@@ -512,11 +511,6 @@ W:	http://www.wittsend.com/computone.html
 L:	linux-computone@lazuli.wittsend.com
 S:	Supported
 
-COMX/MULTIGATE SYNC SERIAL DRIVERS
-P:	Pasztor Szilard
-M:	Pasztor Szilard <don@itc.hu>
-S:	Supported
-
 COSA/SRP SYNC SERIAL DRIVER
 P:	Jan "Yenya" Kasprzak
 M:	kas@fi.muni.cz
@@ -539,11 +533,6 @@ CRAMFS FILESYSTEM
 W:     http://sourceforge.net/projects/cramfs/
 S:     Orphan
 
-CREDITS FILE
-P:	John A. Martin
-M:	jam@acm.org
-S:	Maintained
-
 CRIS PORT
 P:	Bjorn Wesen
 M:	bjornw@axis.com
@@ -574,14 +563,12 @@ L:	cycsyn-devel@bazar.conectiva.com.br
 S:	Maintained
 
 CYCLADES ASYNC MUX DRIVER
-P:	Henrique Gobbi
-M:	henrique@cyclades.com
+M:	async@cyclades.com
 W:	http://www.cyclades.com/
 S:	Supported
 
 CYCLADES PC300 DRIVER
-P:	Henrique Gobbi
-M:	henrique@cyclades.com
+M:	pc300@cyclades.com
 W:	http://www.cyclades.com/
 S:	Supported
 
@@ -636,10 +623,9 @@ W:	http://www.debian.org/~dz/i8k/
 S:	Maintained
 
 DEVICE-MAPPER
-P:	Joe Thornber
-M:	dm@uk.sistina.com
-L:	linux-lvm@sistina.com
-W:	http://www.sistina.com/lvm
+P:	Alasdair Kergon
+L:	dm-devel@redhat.com
+W:	http://sources.redhat.com/dm
 S:	Maintained
 
 DEVICE NUMBER REGISTRY
@@ -796,7 +782,7 @@ FRAMEBUFFER LAYER
 P:	James Simmons, Geert Uytterhoeven	
 M:	jsimmons@infradead.org, geert@linux-m68k.org	
 L:	linux-fbdev-devel@lists.sourceforge.net	
-W:	http://www.linux-fbdev.org
+W:	http://linux-fbdev.sourceforge.net/
 S:	Supported
 
 FILE LOCKING (flock() and fcntl()/lockf())
@@ -958,15 +944,15 @@ S:	Maintained
 IA64 (Itanium) PLATFORM
 P:	David Mosberger-Tang
 M:	davidm@hpl.hp.com
-L:	linux-ia64@linuxia64.org
-W:	http://www.linuxia64.org/
+L:	linux-ia64@vger.kernel.org
+W:	http://www.ia64-linux.org/
 S:	Maintained
 
 SN-IA64 (Itanium) SUB-PLATFORM
 P:	Jesse Barnes
 M:	jbarnes@sgi.com
 L:	linux-altix@sgi.com
-L:	linux-ia64@linuxia64.org
+L:	linux-ia64@vger.kernel.org
 W:	http://www.sgi.com/altix
 S:	Maintained
 
@@ -976,6 +962,11 @@ M:	langa2@kph.uni-mainz.de
 W:	http://www.uni-mainz.de/~langm000/linux.html
 S:	Maintained
 
+IBM Power Linux RAID adapter
+P:	Brian King
+M:	brking@us.ibm.com
+S:	Supported
+
 IBM ServeRAID RAID DRIVER
 P:	Jack Hammer
 P:	Dave Jeffery
@@ -1182,8 +1173,8 @@ L:	autofs@linux.kernel.org
 S:	Odd Fixes
 
 KERNEL AUTOMOUNTER v4 (AUTOFS4)
-P:	Jeremy Fitzhardinge
-M:	jeremy@goop.org
+P:	Ian Kent
+M:	raven@themaw.net
 L:	autofs@linux.kernel.org
 S:	Maintained
 
@@ -1228,6 +1219,13 @@ M:	James.Bottomley@HansenPartnership.com
 L:	linux-scsi@vger.kernel.org
 S:	Maintained
 
+LEGO USB Tower driver
+P:	Juergen Stuber
+M:	starblue@users.sourceforge.net
+L:	legousb-devel@lists.sourceforge.net
+W:	http://legousb.sourceforge.net/
+S:	Maintained
+
 LINUX FOR IBM pSERIES (RS/6000)
 P:	Paul Mackerras
 M:	paulus@au.ibm.com
@@ -1392,8 +1390,6 @@ S:	Maintained
 NCP FILESYSTEM
 P:	Petr Vandrovec
 M:	vandrove@vc.cvut.cz
-P:	Volker Lendecke
-M:	vl@kki.org
 L:	linware@sh.cvut.cz
 S:	Maintained
 
@@ -1803,6 +1799,12 @@ L: 	selinux@tycho.nsa.gov (general discussion)
 W:	http://www.nsa.gov/selinux
 S:	Supported
 
+SERIAL ATA (SATA) SUBSYSTEM:
+P:	Jeff Garzik
+M:	jgarzik@pobox.com
+L:	linux-ide@vger.kernel.org
+S:	Supported
+
 SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER
 P:	Pat Gefre
 M:	pfg@sgi.com
@@ -2354,7 +2356,7 @@ S:	Maintained
 
 XFS FILESYSTEM
 P:	Silicon Graphics Inc
-M:	owner-xfs@oss.sgi.com
+M:	xfs-masters@oss.sgi.com
 M:	nathans@sgi.com
 L:	linux-xfs@oss.sgi.com
 W:	http://oss.sgi.com/projects/xfs
diff --git a/Makefile b/Makefile
index 4d8697026..08d3b92ae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 6
+SUBLEVEL = 7
 EXTRAVERSION =
 NAME=Zonked Quokka
 
@@ -110,7 +110,7 @@ $(if $(wildcard $(KBUILD_OUTPUT)),, \
 $(filter-out _all,$(MAKECMDGOALS)) _all:
 	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT)		\
 	KBUILD_SRC=$(CURDIR)	     KBUILD_VERBOSE=$(KBUILD_VERBOSE)	\
-	KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD=$(KBUILD_EXTMOD)     \
+	KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)"	\
         -f $(CURDIR)/Makefile $@
 
 # Leave processing to above invocation of make
@@ -325,7 +325,7 @@ export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
 # When compiling out-of-tree modules, put MODVERDIR in the module
 # tree rather than in the kernel tree. The kernel tree might
 # even be read-only.
-export MODVERDIR := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/).tmp_versions
+export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions
 
 # The temporary file to save gcc -MD generated dependencies must not
 # contain a comma
@@ -567,7 +567,7 @@ ifdef CONFIG_KALLSYMS
 kallsyms.o := .tmp_kallsyms2.o
 
 quiet_cmd_kallsyms = KSYM    $@
-cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) > $@
+cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) $(foreach x,$(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
 
 .tmp_kallsyms1.o .tmp_kallsyms2.o: %.o: %.S scripts FORCE
 	$(call if_changed_dep,as_o_S)
@@ -680,7 +680,7 @@ include/config/MARKER: include/linux/autoconf.h
 uts_len := 64
 
 define filechk_version.h
-	if ((`echo -n "$(KERNELRELEASE)" | wc -c ` > $(uts_len))); then \
+	if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
 	  echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
 	  exit 1; \
 	fi; \
@@ -904,6 +904,7 @@ help:
 	@echo  '  rpm		  - Build a kernel as an RPM package'
 	@echo  '  tags/TAGS	  - Generate tags file for editors'
 	@echo  '  cscope	  - Generate cscope index'
+	@echo  '  checkstack      - Generate a list of stack hogs'
 	@echo  ''
 	@echo  'Documentation targets:'
 	@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
@@ -952,15 +953,15 @@ else # KBUILD_EXTMOD
 # We are always building modules
 KBUILD_MODULES := 1
 .PHONY: crmodverdir
-crmodverdir: FORCE
+crmodverdir:
 	$(Q)mkdir -p $(MODVERDIR)
 
-.PHONY: $(KBUILD_EXTMOD)
-$(KBUILD_EXTMOD): crmodverdir FORCE
-	$(Q)$(MAKE) $(build)=$@
+module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
+.PHONY: $(module-dirs) modules
+$(module-dirs): crmodverdir
+	$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
 
-.PHONY: modules
-modules: $(KBUILD_EXTMOD)
+modules: $(module-dirs)
 	@echo '  Building modules, stage 2.';
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 
@@ -968,7 +969,7 @@ modules: $(KBUILD_EXTMOD)
 modules_install:
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
 
-clean-dirs := _clean_$(KBUILD_EXTMOD)
+clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))
 
 .PHONY: $(clean-dirs) clean
 $(clean-dirs):
@@ -1001,6 +1002,8 @@ define all-sources
 	       -name '*.[chS]' -print; \
 	  find arch/$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
+	  find security/selinux/include $(RCS_FIND_IGNORE) \
+	       -name '*.[chS]' -print; \
 	  find include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name '*.[chS]' -print; \
@@ -1057,9 +1060,18 @@ versioncheck:
 		-name '*.[hcS]' -type f -print | sort \
 		| xargs $(PERL) -w scripts/checkversion.pl
 
+buildcheck:
+	$(PERL) scripts/reference_discarded.pl
+	$(PERL) scripts/reference_init.pl
+
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(mixed-targets),1)
 
+.PHONY: checkstack
+checkstack:
+	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
+	$(PERL) scripts/checkstack.pl $(ARCH)
+
 # FIXME Should go into a make.lib or something 
 # ===========================================================================
 
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 16328adb9..e1f20ca1c 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -626,8 +626,8 @@ config DEBUG_KERNEL
 	  identify kernel problems.
 
 config MATHEMU
-	tristate "Kernel FP software completion" if DEBUG_KERNEL
-	default y if !DEBUG_KERNEL
+	tristate "Kernel FP software completion" if DEBUG_KERNEL && !SMP
+	default y if !DEBUG_KERNEL || SMP
 	help
 	  This option is required for IEEE compliant floating point arithmetic
 	  on the Alpha. The only time you would ever not say Y is to say M in
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 46bb6e918..4854ca379 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -106,10 +106,10 @@ boot := arch/alpha/boot
 all boot: $(boot)/vmlinux.gz
 
 $(boot)/vmlinux.gz: vmlinux
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $@
+	$(Q)$(MAKE) $(build)=$(boot) $@
 
 bootimage bootpfile bootpzfile: vmlinux
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $(boot)/$@
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 
 prepare: include/asm-$(ARCH)/asm_offsets.h
@@ -121,7 +121,7 @@ include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
 	$(call filechk,gen-asm-offsets)
 
 archclean:
-	$(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot)
+	$(Q)$(MAKE) $(clean)=$(boot)
 
 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
 
diff --git a/arch/alpha/kernel/core_cia.c b/arch/alpha/kernel/core_cia.c
index 7b3707ba6..f5245ab2f 100644
--- a/arch/alpha/kernel/core_cia.c
+++ b/arch/alpha/kernel/core_cia.c
@@ -762,7 +762,7 @@ do_init_arch(int is_pyxis)
 		*(vip)CIA_IOC_PCI_W3_MASK = 0xfff00000;
 		*(vip)CIA_IOC_PCI_T3_BASE = 0 >> 2;
 
-		alpha_mv.pci_dac_offset = 0x200000000;
+		alpha_mv.pci_dac_offset = 0x200000000UL;
 		*(vip)CIA_IOC_PCI_W_DAC = alpha_mv.pci_dac_offset >> 32;
 	}
 
diff --git a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c
index 865990072..50b7dd3d5 100644
--- a/arch/alpha/kernel/core_irongate.c
+++ b/arch/alpha/kernel/core_irongate.c
@@ -287,9 +287,9 @@ irongate_init_arch(void)
 	hose->sparse_mem_base = 0;
 	hose->sparse_io_base = 0;
 	hose->dense_mem_base
-	  = (IRONGATE_MEM & 0xffffffffff) | 0x80000000000;
+	  = (IRONGATE_MEM & 0xffffffffffUL) | 0x80000000000UL;
 	hose->dense_io_base
-	  = (IRONGATE_IO & 0xffffffffff) | 0x80000000000;
+	  = (IRONGATE_IO & 0xffffffffffUL) | 0x80000000000UL;
 
 	hose->sg_isa = hose->sg_pci = NULL;
 	__direct_map_base = 0;
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 5906f38fb..9bde638e8 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -718,7 +718,7 @@ marvel_iounmap(unsigned long addr)
 	if (((long)addr >> 41) == -2)
 		return;	/* kseg map, nothing to do */
 	if (addr)
-		return vfree((void *)(PAGE_MASK & addr)); 
+		vfree((void *)(PAGE_MASK & addr)); 
 }
 
 #ifndef CONFIG_ALPHA_GENERIC
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 81e609a18..3ddec9a87 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -258,9 +258,9 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index)
 	hose->sparse_mem_base = 0;
 	hose->sparse_io_base = 0;
 	hose->dense_mem_base
-	  = (TITAN_MEM(index) & 0xffffffffff) | 0x80000000000;
+	  = (TITAN_MEM(index) & 0xffffffffffUL) | 0x80000000000UL;
 	hose->dense_io_base
-	  = (TITAN_IO(index) & 0xffffffffff) | 0x80000000000;
+	  = (TITAN_IO(index) & 0xffffffffffUL) | 0x80000000000UL;
 
 	hose->config_space_base = TITAN_CONF(index);
 	hose->index = index;
diff --git a/arch/alpha/kernel/core_wildfire.c b/arch/alpha/kernel/core_wildfire.c
index 97f464b63..2b767a1ba 100644
--- a/arch/alpha/kernel/core_wildfire.c
+++ b/arch/alpha/kernel/core_wildfire.c
@@ -285,8 +285,8 @@ wildfire_hardware_probe(void)
 		    fe = WILDFIRE_fe(soft_qbb, i);
 
 		    if ((iop->iop_hose[i].init.csr & 1) == 1 &&
-			((ne->ne_what_am_i.csr & 0xf00000300) == 0x100000300) &&
-			((fe->fe_what_am_i.csr & 0xf00000300) == 0x100000200))
+			((ne->ne_what_am_i.csr & 0xf00000300UL) == 0x100000300UL) &&
+			((fe->fe_what_am_i.csr & 0xf00000300UL) == 0x100000200UL))
 		    {
 		        wildfire_pca_mask |= 1 << ((soft_qbb << 2) + i);
 		    }
diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c
index 8355284bd..70b38b1d2 100644
--- a/arch/alpha/kernel/err_marvel.c
+++ b/arch/alpha/kernel/err_marvel.c
@@ -1077,7 +1077,8 @@ marvel_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs)
 
 	default:
 		/* Don't know it - pass it up.  */
-		return ev7_machine_check(vector, la_ptr, regs);
+		ev7_machine_check(vector, la_ptr, regs);
+		return;
 	}	
 
 	/*
diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c
index 505cdb3db..897ea1a15 100644
--- a/arch/alpha/kernel/err_titan.c
+++ b/arch/alpha/kernel/err_titan.c
@@ -407,8 +407,10 @@ titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs)
 	/*
 	 * Only handle system errors here 
 	 */
-	if ((vector != SCB_Q_SYSMCHK) && (vector != SCB_Q_SYSERR)) 
-		return ev6_machine_check(vector, la_ptr, regs);
+	if ((vector != SCB_Q_SYSMCHK) && (vector != SCB_Q_SYSERR)) {
+		ev6_machine_check(vector, la_ptr, regs);
+		return;
+	}
 
 	/* 
 	 * It's a system error, handle it here
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index c51bf8dbf..9e8eab6dc 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -260,7 +260,7 @@ irq_affinity_read_proc (char *page, char **start, off_t off,
 }
 
 static unsigned int
-parse_hex_value (const char *buffer,
+parse_hex_value (const char __user *buffer,
 		 unsigned long count, unsigned long *ret)
 {
 	unsigned char hexnum [HEX_DIGITS];
@@ -298,7 +298,7 @@ out:
 }
 
 static int
-irq_affinity_write_proc(struct file *file, const char *buffer,
+irq_affinity_write_proc(struct file *file, const char __user *buffer,
 			unsigned long count, void *data)
 {
 	int irq = (long) data, full_count = count, err;
@@ -341,7 +341,7 @@ prof_cpu_mask_read_proc(char *page, char **start, off_t off,
 }
 
 static int
-prof_cpu_mask_write_proc(struct file *file, const char *buffer,
+prof_cpu_mask_write_proc(struct file *file, const char __user *buffer,
 			 unsigned long count, void *data)
 {
 	unsigned long *mask = (unsigned long *) data, full_count = count, err;
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
index f9832ce76..348597bdb 100644
--- a/arch/alpha/kernel/machvec_impl.h
+++ b/arch/alpha/kernel/machvec_impl.h
@@ -20,10 +20,10 @@
 #define TITAN_HAE_ADDRESS	(&alpha_mv.hae_cache)
 #define WILDFIRE_HAE_ADDRESS	(&alpha_mv.hae_cache)
 
-#if CIA_ONE_HAE_WINDOW
+#ifdef CIA_ONE_HAE_WINDOW
 #define CIA_HAE_ADDRESS		(&alpha_mv.hae_cache)
 #endif
-#if MCPCIA_ONE_HAE_WINDOW
+#ifdef MCPCIA_ONE_HAE_WINDOW
 #define MCPCIA_HAE_ADDRESS	(&alpha_mv.hae_cache)
 #endif
 
diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
index db7a87791..fc271e316 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -234,6 +234,10 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
 			   value was resolved from somewhere else.  */
 			if (sym->st_shndx == SHN_UNDEF)
 				goto reloc_overflow;
+			if ((sym->st_other & STO_ALPHA_STD_GPLOAD) ==
+			    STO_ALPHA_STD_GPLOAD)
+				/* Omit the prologue. */
+				value += 8;
 			/* FALLTHRU */
 		case R_ALPHA_BRADDR:
 			value -= (u64)location + 4;
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index f725059fe..3f1721f28 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -91,7 +91,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
  * braindamage (it can't really handle filesystems where the directory
  * offset differences aren't the same as "d_reclen").
  */
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 #define ROUND_UP(x) (((x)+3) & ~3)
 
 struct osf_dirent {
@@ -102,8 +102,8 @@ struct osf_dirent {
 };
 
 struct osf_dirent_callback {
-	struct osf_dirent *dirent;
-	long *basep;
+	struct osf_dirent __user *dirent;
+	long __user *basep;
 	unsigned int count;
 	int error;
 };
@@ -112,7 +112,7 @@ static int
 osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
 	    ino_t ino, unsigned int d_type)
 {
-	struct osf_dirent *dirent;
+	struct osf_dirent __user *dirent;
 	struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
 	unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
 
@@ -131,15 +131,15 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
 	if (copy_to_user(dirent->d_name, name, namlen) ||
 	    put_user(0, dirent->d_name + namlen))
 		return -EFAULT;
-	dirent = (void *)dirent + reclen;
+	dirent = (void __user *)dirent + reclen;
 	buf->dirent = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
 asmlinkage int
-osf_getdirentries(unsigned int fd, struct osf_dirent *dirent,
-		  unsigned int count, long *basep)
+osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent,
+		  unsigned int count, long __user *basep)
 {
 	int error;
 	struct file *file;
@@ -215,10 +215,10 @@ struct osf_statfs {
 	int f_files;
 	int f_ffree;
 	__kernel_fsid_t f_fsid;
-} *osf_stat;
+};
 
 static int
-linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs *osf_stat,
+linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs __user *osf_stat,
 		    unsigned long bufsiz)
 {
 	struct osf_statfs tmp_stat;
@@ -239,7 +239,7 @@ linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs *osf_stat,
 }
 
 static int
-do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer,
+do_osf_statfs(struct dentry * dentry, struct osf_statfs __user *buffer,
 	      unsigned long bufsiz)
 {
 	struct kstatfs linux_stat;
@@ -250,7 +250,7 @@ do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer,
 }
 
 asmlinkage int
-osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz)
+osf_statfs(char __user *path, struct osf_statfs __user *buffer, unsigned long bufsiz)
 {
 	struct nameidata nd;
 	int retval;
@@ -264,7 +264,7 @@ osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz)
 }
 
 asmlinkage int
-osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz)
+osf_fstatfs(unsigned long fd, struct osf_statfs __user *buffer, unsigned long bufsiz)
 {
 	struct file *file;
 	int retval;
@@ -284,13 +284,13 @@ osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz)
  * Although to be frank, neither are the native Linux/i386 ones..
  */
 struct ufs_args {
-	char *devname;
+	char __user *devname;
 	int flags;
 	uid_t exroot;
 };
 
 struct cdfs_args {
-	char *devname;
+	char __user *devname;
 	int flags;
 	uid_t exroot;
 
@@ -299,7 +299,7 @@ struct cdfs_args {
 };
 
 struct procfs_args {
-	char *devname;
+	char __user *devname;
 	int flags;
 	uid_t exroot;
 };
@@ -313,7 +313,7 @@ struct procfs_args {
  * unhappy with OSF UFS. [CHECKME]
  */
 static int
-osf_ufs_mount(char *dirname, struct ufs_args *args, int flags)
+osf_ufs_mount(char *dirname, struct ufs_args __user *args, int flags)
 {
 	int retval;
 	struct cdfs_args tmp;
@@ -333,7 +333,7 @@ osf_ufs_mount(char *dirname, struct ufs_args *args, int flags)
 }
 
 static int
-osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags)
+osf_cdfs_mount(char *dirname, struct cdfs_args __user *args, int flags)
 {
 	int retval;
 	struct cdfs_args tmp;
@@ -353,7 +353,7 @@ osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags)
 }
 
 static int
-osf_procfs_mount(char *dirname, struct procfs_args *args, int flags)
+osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags)
 {
 	struct procfs_args tmp;
 
@@ -364,7 +364,7 @@ osf_procfs_mount(char *dirname, struct procfs_args *args, int flags)
 }
 
 asmlinkage int
-osf_mount(unsigned long typenr, char *path, int flag, void *data)
+osf_mount(unsigned long typenr, char __user *path, int flag, void __user *data)
 {
 	int retval = -EINVAL;
 	char *name;
@@ -377,13 +377,13 @@ osf_mount(unsigned long typenr, char *path, int flag, void *data)
 		goto out;
 	switch (typenr) {
 	case 1:
-		retval = osf_ufs_mount(name, (struct ufs_args *) data, flag);
+		retval = osf_ufs_mount(name, data, flag);
 		break;
 	case 6:
-		retval = osf_cdfs_mount(name, (struct cdfs_args *) data, flag);
+		retval = osf_cdfs_mount(name, data, flag);
 		break;
 	case 9:
-		retval = osf_procfs_mount(name, (struct procfs_args *) data, flag);
+		retval = osf_procfs_mount(name, data, flag);
 		break;
 	default:
 		printk("osf_mount(%ld, %x)\n", typenr, flag);
@@ -395,7 +395,7 @@ osf_mount(unsigned long typenr, char *path, int flag, void *data)
 }
 
 asmlinkage int
-osf_utsname(char *name)
+osf_utsname(char __user *name)
 {
 	int error;
 
@@ -434,7 +434,7 @@ sys_getdtablesize(void)
  * For compatibility with OSF/1 only.  Use utsname(2) instead.
  */
 asmlinkage int
-osf_getdomainname(char *name, int namelen)
+osf_getdomainname(char __user *name, int namelen)
 {
 	unsigned len;
 	int i, error;
@@ -459,7 +459,7 @@ osf_getdomainname(char *name, int namelen)
 }
 
 asmlinkage long
-osf_shmat(int shmid, void *shmaddr, int shmflg)
+osf_shmat(int shmid, void __user *shmaddr, int shmflg)
 {
 	unsigned long raddr;
 	long err;
@@ -497,39 +497,39 @@ struct proplistname_args {
 
 union pl_args {
 	struct setargs {
-		char *path;
+		char __user *path;
 		long follow;
 		long nbytes;
-		char *buf;
+		char __user *buf;
 	} set;
 	struct fsetargs {
 		long fd;
 		long nbytes;
-		char *buf;
+		char __user *buf;
 	} fset;
 	struct getargs {
-		char *path;
+		char __user *path;
 		long follow;
-		struct proplistname_args *name_args;
+		struct proplistname_args __user *name_args;
 		long nbytes;
-		char *buf;
-		int *min_buf_size;
+		char __user *buf;
+		int __user *min_buf_size;
 	} get;
 	struct fgetargs {
 		long fd;
-		struct proplistname_args *name_args;
+		struct proplistname_args __user *name_args;
 		long nbytes;
-		char *buf;
-		int *min_buf_size;
+		char __user *buf;
+		int __user *min_buf_size;
 	} fget;
 	struct delargs {
-		char *path;
+		char __user *path;
 		long follow;
-		struct proplistname_args *name_args;
+		struct proplistname_args __user *name_args;
 	} del;
 	struct fdelargs {
 		long fd;
-		struct proplistname_args *name_args;
+		struct proplistname_args __user *name_args;
 	} fdel;
 };
 
@@ -540,24 +540,20 @@ enum pl_code {
 };
 
 asmlinkage long
-osf_proplist_syscall(enum pl_code code, union pl_args *args)
+osf_proplist_syscall(enum pl_code code, union pl_args __user *args)
 {
 	long error;
-	int *min_buf_size_ptr;
+	int __user *min_buf_size_ptr;
 
 	lock_kernel();
 	switch (code) {
 	case PL_SET:
-		error = verify_area(VERIFY_READ, &args->set.nbytes,
-				    sizeof(args->set.nbytes));
-		if (!error)
-			error = args->set.nbytes;
+		if (get_user(error, &args->set.nbytes))
+			error = -EFAULT;
 		break;
 	case PL_FSET:
-		error = verify_area(VERIFY_READ, &args->fset.nbytes,
-				    sizeof(args->fset.nbytes));
-		if (!error)
-			error = args->fset.nbytes;
+		if (get_user(error, &args->fset.nbytes))
+			error = -EFAULT;
 		break;
 	case PL_GET:
 		error = get_user(min_buf_size_ptr, &args->get.min_buf_size);
@@ -584,7 +580,7 @@ osf_proplist_syscall(enum pl_code code, union pl_args *args)
 }
 
 asmlinkage int
-osf_sigstack(struct sigstack *uss, struct sigstack *uoss)
+osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
 {
 	unsigned long usp = rdusp();
 	unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
@@ -625,7 +621,7 @@ osf_sigstack(struct sigstack *uss, struct sigstack *uoss)
 }
 
 asmlinkage long
-osf_sysinfo(int command, char *buf, long count)
+osf_sysinfo(int command, char __user *buf, long count)
 {
 	static char * sysinfo_table[] = {
 		system_utsname.sysname,
@@ -664,8 +660,8 @@ osf_sysinfo(int command, char *buf, long count)
 }
 
 asmlinkage unsigned long
-osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
-	       int *start, void *arg)
+osf_getsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
+	       int __user *start, void __user *arg)
 {
 	unsigned long w;
 	struct percpu_struct *cpu;
@@ -677,7 +673,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
 
  		w = current_thread_info()->ieee_state & IEEE_SW_MASK;
  		w = swcr_update_status(w, rdfpcr());
-		if (put_user(w, (unsigned long *) buffer))
+		if (put_user(w, (unsigned long __user *) buffer))
 			return -EFAULT;
 		return 0;
 
@@ -693,7 +689,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
 		if (nbytes < sizeof(unsigned int))
 			return -EINVAL;
  		w = (current_thread_info()->flags >> UAC_SHIFT) & UAC_BITMASK;
- 		if (put_user(w, (unsigned int *)buffer))
+ 		if (put_user(w, (unsigned int __user *)buffer))
  			return -EFAULT;
  		return 1;
 
@@ -703,7 +699,7 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
 		cpu = (struct percpu_struct*)
 		  ((char*)hwrpb + hwrpb->processor_offset);
 		w = cpu->type;
-		if (put_user(w, (unsigned long *)buffer))
+		if (put_user(w, (unsigned long  __user*)buffer))
 			return -EFAULT;
 		return 1;
 
@@ -722,8 +718,8 @@ osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
 }
 
 asmlinkage unsigned long
-osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
-	       int *start, void *arg)
+osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
+	       int __user *start, void __user *arg)
 {
 	switch (op) {
 	case SSI_IEEE_FP_CONTROL: {
@@ -737,7 +733,7 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
 		 */
 
 		/* Update softare trap enable bits.  */
-		if (get_user(swcr, (unsigned long *)buffer))
+		if (get_user(swcr, (unsigned long __user *)buffer))
 			return -EFAULT;
 		current_thread_info()->ieee_state
 		  = ((current_thread_info()->ieee_state & ~IEEE_SW_MASK)
@@ -788,9 +784,9 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
 		
  		for (i = 0; i < nbytes; ++i) {
 
- 			if (get_user(v, 2*i + (unsigned int *)buffer))
+ 			if (get_user(v, 2*i + (unsigned int __user *)buffer))
  				return -EFAULT;
- 			if (get_user(w, 2*i + 1 + (unsigned int *)buffer))
+ 			if (get_user(w, 2*i + 1 + (unsigned int __user *)buffer))
  				return -EFAULT;
  			switch (v) {
  			case SSIN_UACPROC:
@@ -835,7 +831,7 @@ struct itimerval32
 };
 
 static inline long
-get_tv32(struct timeval *o, struct timeval32 *i)
+get_tv32(struct timeval *o, struct timeval32 __user *i)
 {
 	return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
 		(__get_user(o->tv_sec, &i->tv_sec) |
@@ -843,7 +839,7 @@ get_tv32(struct timeval *o, struct timeval32 *i)
 }
 
 static inline long
-put_tv32(struct timeval32 *o, struct timeval *i)
+put_tv32(struct timeval32 __user *o, struct timeval *i)
 {
 	return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
 		(__put_user(i->tv_sec, &o->tv_sec) |
@@ -851,7 +847,7 @@ put_tv32(struct timeval32 *o, struct timeval *i)
 }
 
 static inline long
-get_it32(struct itimerval *o, struct itimerval32 *i)
+get_it32(struct itimerval *o, struct itimerval32 __user *i)
 {
 	return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
 		(__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) |
@@ -861,7 +857,7 @@ get_it32(struct itimerval *o, struct itimerval32 *i)
 }
 
 static inline long
-put_it32(struct itimerval32 *o, struct itimerval *i)
+put_it32(struct itimerval32 __user *o, struct itimerval *i)
 {
 	return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
 		(__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) |
@@ -878,7 +874,7 @@ jiffies_to_timeval32(unsigned long jiffies, struct timeval32 *value)
 }
 
 asmlinkage int
-osf_gettimeofday(struct timeval32 *tv, struct timezone *tz)
+osf_gettimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
 {
 	if (tv) {
 		struct timeval ktv;
@@ -894,7 +890,7 @@ osf_gettimeofday(struct timeval32 *tv, struct timezone *tz)
 }
 
 asmlinkage int
-osf_settimeofday(struct timeval32 *tv, struct timezone *tz)
+osf_settimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
 {
 	struct timespec kts;
 	struct timezone ktz;
@@ -914,7 +910,7 @@ osf_settimeofday(struct timeval32 *tv, struct timezone *tz)
 }
 
 asmlinkage int
-osf_getitimer(int which, struct itimerval32 *it)
+osf_getitimer(int which, struct itimerval32 __user *it)
 {
 	struct itimerval kit;
 	int error;
@@ -927,7 +923,7 @@ osf_getitimer(int which, struct itimerval32 *it)
 }
 
 asmlinkage int
-osf_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out)
+osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __user *out)
 {
 	struct itimerval kin, kout;
 	int error;
@@ -950,16 +946,9 @@ osf_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out)
 }
 
 asmlinkage int
-osf_utimes(const char *filename, struct timeval32 *tvs)
+osf_utimes(char __user *filename, struct timeval32 __user *tvs)
 {
-	char *kfilename;
 	struct timeval ktvs[2];
-	mm_segment_t old_fs;
-	int ret;
-
-	kfilename = getname(filename);
-	if (IS_ERR(kfilename))
-		return PTR_ERR(kfilename);
 
 	if (tvs) {
 		if (get_tv32(&ktvs[0], &tvs[0]) ||
@@ -967,22 +956,15 @@ osf_utimes(const char *filename, struct timeval32 *tvs)
 			return -EFAULT;
 	}
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_utimes(kfilename, tvs ? ktvs : 0);
-	set_fs(old_fs);
-
-	putname(kfilename);
-
-	return ret;
+	return do_utimes(filename, tvs ? ktvs : 0);
 }
 
 #define MAX_SELECT_SECONDS \
 	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
 
 asmlinkage int
-osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp,
-	   struct timeval32 *tvp)
+osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
+	   struct timeval32 __user *tvp)
 {
 	fd_set_bits fds;
 	char *bits;
@@ -1081,7 +1063,7 @@ struct rusage32 {
 };
 
 asmlinkage int
-osf_getrusage(int who, struct rusage32 *ru)
+osf_getrusage(int who, struct rusage32 __user *ru)
 {
 	struct rusage32 r;
 
@@ -1116,7 +1098,7 @@ osf_getrusage(int who, struct rusage32 *ru)
 }
 
 asmlinkage int
-osf_wait4(pid_t pid, int *ustatus, int options, struct rusage32 *ur)
+osf_wait4(pid_t pid, int __user *ustatus, int options, struct rusage32 __user *ur)
 {
 	if (!ur) {
 		return sys_wait4(pid, ustatus, options, NULL);
@@ -1163,7 +1145,7 @@ osf_wait4(pid_t pid, int *ustatus, int options, struct rusage32 *ur)
  * one is the time remaining.. Ho humm.. No documentation.
  */
 asmlinkage int
-osf_usleep_thread(struct timeval32 *sleep, struct timeval32 *remain)
+osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remain)
 {
 	struct timeval tmp;
 	unsigned long ticks;
@@ -1221,7 +1203,7 @@ struct timex32 {
 };
 
 asmlinkage int
-sys_old_adjtimex(struct timex32 *txc_p)
+sys_old_adjtimex(struct timex32 __user *txc_p)
 {
         struct timex txc;
 	int ret;
@@ -1316,12 +1298,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
    compatibility with old versions of OSF/1 where iov_len
    was defined as int. */
 static int
-osf_fix_iov_len(const struct iovec *iov, unsigned long count)
+osf_fix_iov_len(const struct iovec __user *iov, unsigned long count)
 {
 	unsigned long i;
 
 	for (i = 0 ; i < count ; i++) {
-		int *iov_len_high = (int *)&iov[i].iov_len + 1;
+		int *iov_len_high = (int __user *)&iov[i].iov_len + 1;
 
 		if (put_user(0, iov_len_high))
 			return -EFAULT;
@@ -1330,7 +1312,7 @@ osf_fix_iov_len(const struct iovec *iov, unsigned long count)
 }
 
 asmlinkage ssize_t
-osf_readv(unsigned long fd, const struct iovec * vector, unsigned long count)
+osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long count)
 {
 	if (unlikely(personality(current->personality) == PER_OSF4))
 		if (osf_fix_iov_len(vector, count))
@@ -1339,7 +1321,7 @@ osf_readv(unsigned long fd, const struct iovec * vector, unsigned long count)
 }
 
 asmlinkage ssize_t
-osf_writev(unsigned long fd, const struct iovec * vector, unsigned long count)
+osf_writev(unsigned long fd, const struct iovec __user * vector, unsigned long count)
 {
 	if (unlikely(personality(current->personality) == PER_OSF4))
 		if (osf_fix_iov_len(vector, count))
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 297e4b48b..f5c5969b7 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -239,8 +239,9 @@ release_thread(struct task_struct *dead_task)
  * with parameters (SIGCHLD, 0).
  */
 int
-alpha_clone(unsigned long clone_flags, unsigned long usp, int *parent_tid,
-	    int *child_tid, unsigned long tls_value, struct pt_regs *regs)
+alpha_clone(unsigned long clone_flags, unsigned long usp,
+	    int __user *parent_tid, int __user *child_tid,
+	    unsigned long tls_value, struct pt_regs *regs)
 {
 	if (!usp)
 		usp = rdusp();
@@ -464,7 +465,8 @@ dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
  * Don't do this at home.
  */
 asmlinkage int
-sys_execve(char *ufilename, char **argv, char **envp,
+sys_execve(char __user *ufilename, char __user * __user *argv,
+	   char __user * __user *envp,
 	   unsigned long a3, unsigned long a4, unsigned long a5,
 	   struct pt_regs regs)
 {
@@ -510,12 +512,6 @@ thread_saved_pc(task_t *t)
 	return 0;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long
 get_wchan(struct task_struct *p)
 {
@@ -534,7 +530,7 @@ get_wchan(struct task_struct *p)
 	 */
 
 	pc = thread_saved_pc(p);
-	if (pc >= first_sched && pc < last_sched) {
+	if (in_sched_functions(pc)) {
 		schedule_frame = ((unsigned long *)p->thread_info->pcb.ksp)[6];
 		return ((unsigned long *)schedule_frame)[12];
 	}
diff --git a/arch/alpha/kernel/semaphore.c b/arch/alpha/kernel/semaphore.c
index 4d60a0ccd..8c8aaa205 100644
--- a/arch/alpha/kernel/semaphore.c
+++ b/arch/alpha/kernel/semaphore.c
@@ -163,7 +163,7 @@ __up_wakeup(struct semaphore *sem)
 void __sched
 down(struct semaphore *sem)
 {
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 #ifdef CONFIG_DEBUG_SEMAPHORE
@@ -177,7 +177,7 @@ down(struct semaphore *sem)
 int __sched
 down_interruptible(struct semaphore *sem)
 {
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 #ifdef CONFIG_DEBUG_SEMAPHORE
@@ -193,7 +193,7 @@ down_trylock(struct semaphore *sem)
 {
 	int ret;
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
@@ -212,7 +212,7 @@ down_trylock(struct semaphore *sem)
 void
 up(struct semaphore *sem)
 {
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 #ifdef CONFIG_DEBUG_SEMAPHORE
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index d1f1e0cdf..1dff8e6c9 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -1359,7 +1359,7 @@ determine_cpu_caches (unsigned int cpu_type)
 		L1I = L1D = CSHAPE(8*1024, 5, 1);
 		L3 = -1;
 
-		car = *(vuip) phys_to_virt (0x120000078);
+		car = *(vuip) phys_to_virt (0x120000078UL);
 		size = 64*1024 * (1 << ((car >> 5) & 7));
 		/* No typo -- 8 byte cacheline size.  Whodathunk.  */
 		L2 = (car & 1 ? CSHAPE (size, 3, 1) : -1);
@@ -1374,7 +1374,7 @@ determine_cpu_caches (unsigned int cpu_type)
 		L1I = L1D = CSHAPE(8*1024, 5, 1);
 
 		/* Check the line size of the Scache.  */
-		sc_ctl = *(vulp) phys_to_virt (0xfffff000a8);
+		sc_ctl = *(vulp) phys_to_virt (0xfffff000a8UL);
 		width = sc_ctl & 0x1000 ? 6 : 5;
 		L2 = CSHAPE (96*1024, width, 3);
 
@@ -1406,7 +1406,7 @@ determine_cpu_caches (unsigned int cpu_type)
 		}
 		L3 = -1;
 
-		cbox_config = *(vulp) phys_to_virt (0xfffff00008);
+		cbox_config = *(vulp) phys_to_virt (0xfffff00008UL);
 		size = 512*1024 * (1 << ((cbox_config >> 12) & 3));
 
 #if 0
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 56b5b8afa..d908d7760 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -84,8 +84,8 @@ osf_sigprocmask(int how, unsigned long newmask, long a2, long a3,
 }
 
 asmlinkage int 
-osf_sigaction(int sig, const struct osf_sigaction *act,
-	      struct osf_sigaction *oact)
+osf_sigaction(int sig, const struct osf_sigaction __user *act,
+	      struct osf_sigaction __user *oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -115,8 +115,9 @@ osf_sigaction(int sig, const struct osf_sigaction *act,
 }
 
 asmlinkage long
-sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact,
-		 size_t sigsetsize, void *restorer)
+sys_rt_sigaction(int sig, const struct sigaction __user *act,
+		 struct sigaction __user *oact,
+		 size_t sigsetsize, void __user *restorer)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -165,7 +166,7 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *reg, struct switch_stack *sw)
 }
 
 asmlinkage int
-do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize,
+do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
 		 struct pt_regs *reg, struct switch_stack *sw)
 {
 	sigset_t oldset, set;
@@ -192,7 +193,7 @@ do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize,
 }
 
 asmlinkage int
-sys_sigaltstack(const stack_t *uss, stack_t *uoss)
+sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
 {
 	return do_sigaltstack(uss, uoss, rdusp());
 }
@@ -223,7 +224,7 @@ struct rt_sigframe
 #define INSN_CALLSYS		0x00000083
 
 static long
-restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
+restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 		   struct switch_stack *sw)
 {
 	unsigned long usp;
@@ -276,7 +277,7 @@ restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
    registers and transfer control from userland.  */
 
 asmlinkage void
-do_sigreturn(struct sigcontext *sc, struct pt_regs *regs,
+do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
 	     struct switch_stack *sw)
 {
 	sigset_t set;
@@ -314,7 +315,7 @@ give_sigsegv:
 }
 
 asmlinkage void
-do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs,
+do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
 		struct switch_stack *sw)
 {
 	sigset_t set;
@@ -356,17 +357,17 @@ give_sigsegv:
  * Set up a signal frame.
  */
 
-static inline void *
+static inline void __user *
 get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
 {
 	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp))
 		sp = current->sas_ss_sp + current->sas_ss_size;
 
-	return (void *)((sp - frame_size) & -32ul);
+	return (void __user *)((sp - frame_size) & -32ul);
 }
 
 static long
-setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, 
+setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, 
 		 struct switch_stack *sw, unsigned long mask, unsigned long sp)
 {
 	long i, err = 0;
@@ -426,7 +427,7 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
 	    struct pt_regs *regs, struct switch_stack * sw)
 {
 	unsigned long oldsp, r26, err = 0;
-	struct sigframe *frame;
+	struct sigframe __user *frame;
 
 	oldsp = rdusp();
 	frame = get_sigframe(ka, oldsp, sizeof(*frame));
@@ -479,7 +480,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 	       sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
 {
 	unsigned long oldsp, r26, err = 0;
-	struct rt_sigframe *frame;
+	struct rt_sigframe __user *frame;
 
 	oldsp = rdusp();
 	frame = get_sigframe(ka, oldsp, sizeof(*frame));
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 9f06d31f3..9f4aed859 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -779,7 +779,7 @@ handle_ipi(struct pt_regs *regs)
 void
 smp_send_reschedule(int cpu)
 {
-#if DEBUG_IPI_MSG
+#ifdef DEBUG_IPI_MSG
 	if (cpu == hard_smp_processor_id())
 		printk(KERN_WARNING
 		       "smp_send_reschedule: Sending IPI to self.\n");
@@ -791,7 +791,7 @@ void
 smp_send_stop(void)
 {
 	unsigned long to_whom = cpu_present_mask & ~(1UL << smp_processor_id());
-#if DEBUG_IPI_MSG
+#ifdef DEBUG_IPI_MSG
 	if (hard_smp_processor_id() != boot_cpu_id)
 		printk(KERN_WARNING "smp_send_stop: Not on boot cpu.\n");
 #endif
@@ -820,6 +820,9 @@ smp_call_function_on_cpu (void (*func) (void *info), void *info, int retry,
 	unsigned long timeout;
 	int num_cpus_to_call;
 	
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	data.wait = wait;
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index 08241c441..e98b02c27 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -132,7 +132,7 @@ srm_env_read(char *page, char **start, off_t off, int count, int *eof,
 
 
 static int
-srm_env_write(struct file *file, const char *buffer, unsigned long count,
+srm_env_write(struct file *file, const char __user *buffer, unsigned long count,
 		void *data)
 {
 	int res;
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index 8e91eb6e4..c6cbf4780 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -194,27 +194,20 @@ eiger_swizzle(struct pci_dev *dev, u8 *pinp)
 	   case 0x0f: bridge_count = 4; break; /* 4 */
 	};
 
-	/*  Check first for the built-in bridges on hose 0. */
-	if (hose->index == 0
-	    && PCI_SLOT(dev->bus->self->devfn) > 20-bridge_count) {
-		slot = PCI_SLOT(dev->devfn);
-	} else {
-		/* Must be a card-based bridge.  */
-		do {
-			/* Check for built-in bridges on hose 0. */
-			if (hose->index == 0
-			    && (PCI_SLOT(dev->bus->self->devfn)
-				> 20 - bridge_count)) {
-                  		slot = PCI_SLOT(dev->devfn);
-				break;
-			}
-			pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
-
-			/* Move up the chain of bridges.  */
-			dev = dev->bus->self;
-			/* Slot of the next bridge.  */
+	slot = PCI_SLOT(dev->devfn);
+	while (dev->bus->self) {
+		/* Check for built-in bridges on hose 0. */
+		if (hose->index == 0
+		    && (PCI_SLOT(dev->bus->self->devfn)
+			> 20 - bridge_count)) {
 			slot = PCI_SLOT(dev->devfn);
-		} while (dev->bus->self);
+			break;
+		}
+		/* Must be a card-based bridge.  */
+		pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
+
+		/* Move up the chain of bridges.  */
+		dev = dev->bus->self;
 	}
 	*pinp = pin;
 	return slot;
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index 3438b8d48..ccabcb1e3 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -25,6 +25,7 @@
 #include <asm/pgtable.h>
 #include <asm/core_cia.h>
 #include <asm/tlbflush.h>
+#include <asm/8253pit.h>
 
 #include "proto.h"
 #include "irq_impl.h"
@@ -64,6 +65,8 @@ ruffian_init_irq(void)
 	common_init_isa_dma();
 }
 
+#define RUFFIAN_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
+
 static void __init
 ruffian_init_rtc(void)
 {
@@ -72,8 +75,8 @@ ruffian_init_rtc(void)
 
 	/* Setup interval timer.  */
 	outb(0x34, 0x43);		/* binary, mode 2, LSB/MSB, ch 0 */
-	outb(LATCH & 0xff, 0x40);	/* LSB */
-	outb(LATCH >> 8, 0x40);		/* MSB */
+	outb(RUFFIAN_LATCH & 0xff, 0x40);	/* LSB */
+	outb(RUFFIAN_LATCH >> 8, 0x40);		/* MSB */
 
 	outb(0xb6, 0x43);		/* pit counter 2: speaker */
 	outb(0x31, 0x42);
diff --git a/arch/alpha/kernel/sys_sx164.c b/arch/alpha/kernel/sys_sx164.c
index 9910cfb4a..d8f771a98 100644
--- a/arch/alpha/kernel/sys_sx164.c
+++ b/arch/alpha/kernel/sys_sx164.c
@@ -51,7 +51,7 @@ sx164_init_irq(void)
 	if (alpha_using_srm)
 		init_srm_irqs(40, 0x3f0000);
 	else
-		init_pyxis_irqs(0xff00003f0000);
+		init_pyxis_irqs(0xff00003f0000UL);
 
 	setup_irq(16+6, &timer_cascade_irqaction);
 }
diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c
index 24c255eda..126c433a6 100644
--- a/arch/alpha/kernel/sys_takara.c
+++ b/arch/alpha/kernel/sys_takara.c
@@ -231,8 +231,12 @@ takara_swizzle(struct pci_dev *dev, u8 *pinp)
 	int slot = PCI_SLOT(dev->devfn);
 	int pin = *pinp;
 	unsigned int ctlreg = inl(0x500);
-	unsigned int busslot = PCI_SLOT(dev->bus->self->devfn);
+	unsigned int busslot;
 
+	if (!dev->bus->self)
+		return slot;
+
+	busslot = PCI_SLOT(dev->bus->self->devfn);
 	/* Check for built-in bridges.  */
 	if (dev->bus->number != 0
 	    && busslot > 16
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index 8e28e0382..7caf209d6 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -389,7 +389,7 @@ sys_call_table:
 	.quad sys_getcwd
 	.quad sys_capget
 	.quad sys_capset
-	.quad sys_sendfile			/* 370 */
+	.quad sys_sendfile64			/* 370 */
 	.quad sys_setresgid
 	.quad sys_getresgid
 	.quad sys_ni_syscall			/* sys_dipc */
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index af6428687..35b9761ec 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -45,6 +45,7 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/hwrpb.h>
+#include <asm/8253pit.h>
 
 #include <linux/mc146818rtc.h>
 #include <linux/time.h>
@@ -254,12 +255,11 @@ validate_cc_value(unsigned long cc)
  * arch/i386/time.c.
  */
 
-#define PIC_TICK_RATE	1193180UL
 #define CALIBRATE_LATCH	0xffff
 #define TIMEOUT_COUNT	0x100000
 
 static unsigned long __init
-calibrate_cc_with_pic(void)
+calibrate_cc_with_pit(void)
 {
 	int cc, count = 0;
 
@@ -287,7 +287,7 @@ calibrate_cc_with_pic(void)
 	if (count <= 1 || count == TIMEOUT_COUNT)
 		return 0;
 
-	return ((long)cc * PIC_TICK_RATE) / (CALIBRATE_LATCH + 1);
+	return ((long)cc * PIT_TICK_RATE) / (CALIBRATE_LATCH + 1);
 }
 
 /* The Linux interpretation of the CMOS clock register contents:
@@ -313,7 +313,7 @@ time_init(void)
 
 	/* Calibrate CPU clock -- attempt #1.  */
 	if (!est_cycle_freq)
-		est_cycle_freq = validate_cc_value(calibrate_cc_with_pic());
+		est_cycle_freq = validate_cc_value(calibrate_cc_with_pit());
 
 	cc1 = rpcc_after_update_in_progress();
 
diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
index 702efb639..3e0da493b 100644
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -99,7 +99,7 @@ static inline unsigned short from64to16(unsigned long x)
  * Ok. This isn't fun, but this is the EASY case.
  */
 static inline unsigned long
-csum_partial_cfu_aligned(const unsigned long *src, unsigned long *dst,
+csum_partial_cfu_aligned(const unsigned long __user *src, unsigned long *dst,
 			 long len, unsigned long checksum,
 			 int *errp)
 {
@@ -139,7 +139,8 @@ csum_partial_cfu_aligned(const unsigned long *src, unsigned long *dst,
  * easy.
  */
 static inline unsigned long
-csum_partial_cfu_dest_aligned(const unsigned long *src, unsigned long *dst,
+csum_partial_cfu_dest_aligned(const unsigned long __user *src,
+			      unsigned long *dst,
 			      unsigned long soff,
 			      long len, unsigned long checksum,
 			      int *errp)
@@ -327,7 +328,7 @@ csum_partial_cfu_unaligned(const unsigned long * src, unsigned long * dst,
 }
 
 static unsigned int
-do_csum_partial_copy_from_user(const char *src, char *dst, int len,
+do_csum_partial_copy_from_user(const char __user *src, char *dst, int len,
 			       unsigned int sum, int *errp)
 {
 	unsigned long checksum = (unsigned) sum;
@@ -338,12 +339,12 @@ do_csum_partial_copy_from_user(const char *src, char *dst, int len,
 		if (!doff) {
 			if (!soff)
 				checksum = csum_partial_cfu_aligned(
-					(const unsigned long *) src,
+					(const unsigned long __user *) src,
 					(unsigned long *) dst,
 					len-8, checksum, errp);
 			else
 				checksum = csum_partial_cfu_dest_aligned(
-					(const unsigned long *) src,
+					(const unsigned long __user *) src,
 					(unsigned long *) dst,
 					soff, len-8, checksum, errp);
 		} else {
@@ -351,13 +352,13 @@ do_csum_partial_copy_from_user(const char *src, char *dst, int len,
 			ldq_u(partial_dest, dst);
 			if (!soff)
 				checksum = csum_partial_cfu_src_aligned(
-					(const unsigned long *) src,
+					(const unsigned long __user *) src,
 					(unsigned long *) dst,
 					doff, len-8, checksum,
 					partial_dest, errp);
 			else
 				checksum = csum_partial_cfu_unaligned(
-					(const unsigned long *) src,
+					(const unsigned long __user *) src,
 					(unsigned long *) dst,
 					soff, doff, len-8, checksum,
 					partial_dest, errp);
@@ -368,7 +369,7 @@ do_csum_partial_copy_from_user(const char *src, char *dst, int len,
 }
 
 unsigned int
-csum_partial_copy_from_user(const char *src, char *dst, int len,
+csum_partial_copy_from_user(const char __user *src, char *dst, int len,
 			    unsigned int sum, int *errp)
 {
 	if (!access_ok(src, len, VERIFY_READ)) {
diff --git a/arch/alpha/math-emu/Makefile b/arch/alpha/math-emu/Makefile
index 0e36daffb..359ef087e 100644
--- a/arch/alpha/math-emu/Makefile
+++ b/arch/alpha/math-emu/Makefile
@@ -4,4 +4,6 @@
 
 EXTRA_CFLAGS := -w
 
-obj-$(CONFIG_MATHEMU) += math.o qrnnd.o
+obj-$(CONFIG_MATHEMU) += math-emu.o
+
+math-emu-objs := math.o qrnnd.o
diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c
index 28ad1440a..ae79dd970 100644
--- a/arch/alpha/math-emu/math.c
+++ b/arch/alpha/math-emu/math.c
@@ -106,9 +106,7 @@ alpha_fp_emul (unsigned long pc)
 	__u32 insn;
 	long si_code;
 
-	MOD_INC_USE_COUNT;
-
-	get_user(insn, (__u32*)pc);
+	get_user(insn, (__u32 __user *)pc);
 	fc     = (insn >>  0) & 0x1f;	/* destination register */
 	fb     = (insn >> 16) & 0x1f;
 	fa     = (insn >> 21) & 0x1f;
@@ -173,7 +171,7 @@ alpha_fp_emul (unsigned long pc)
 					_FP_FRAC_SET_1(DB, _FP_ZEROFRAC_1);
 			}
 			FP_CMP_D(res, DA, DB, 3);
-			vc = 0x4000000000000000;
+			vc = 0x4000000000000000UL;
 			/* CMPTEQ, CMPTUN don't trap on QNaN,
 			   while CMPTLT and CMPTLE do */
 			if (res == 3
@@ -320,7 +318,6 @@ done:
 			if (_fex & IEEE_TRAP_ENABLE_INV) si_code = FPE_FLTINV;
 		}
 
-		MOD_DEC_USE_COUNT;
 		return si_code;
 	}
 
@@ -328,13 +325,11 @@ done:
 	   requires that the result *always* be written... so we do the write
 	   immediately after the operations above.  */
 
-	MOD_DEC_USE_COUNT;
 	return 0;
 
 bad_insn:
 	printk(KERN_ERR "alpha_fp_emul: Invalid FP insn %#x at %#lx\n",
 	       insn, pc);
-	MOD_DEC_USE_COUNT;
 	return -1;
 }
 
@@ -344,8 +339,6 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
 	unsigned long trigger_pc = regs->pc - 4;
 	unsigned long insn, opcode, rc, si_code = 0;
 
-	MOD_INC_USE_COUNT;
-
 	/*
 	 * Turn off the bits corresponding to registers that are the
 	 * target of instructions that set bits in the exception
@@ -358,7 +351,7 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
 	 * up to the first occurrence of such an instruction.
 	 */
 	while (write_mask) {
-		get_user(insn, (__u32*)(trigger_pc));
+		get_user(insn, (__u32 __user *)(trigger_pc));
 		opcode = insn >> 26;
 		rc = insn & 0x1f;
 
@@ -403,6 +396,5 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
 	}
 
 egress:
-	MOD_DEC_USE_COUNT;
 	return si_code;
 }
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index e7a49c16e..242317d15 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -40,7 +40,7 @@ extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
 unsigned long last_asn = ASN_FIRST_VERSION;
 #endif
 
-extern void
+void
 __load_new_mm_context(struct mm_struct *next_mm)
 {
 	unsigned long mmc;
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index d02ee459c..0a5873f7e 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -117,7 +117,7 @@ show_mem(void)
 		else if (!page_count(mem_map+i))
 			free++;
 		else
-			shared += atomic_read(&mem_map[i].count) - 1;
+			shared += page_count(mem_map + i) - 1;
 	}
 	printk("%ld pages of RAM\n",total);
 	printk("%ld free pages\n",free);
@@ -152,9 +152,9 @@ switch_to_system_map(void)
 
 	/* Set the vptb.  This is often done by the bootloader, but 
 	   shouldn't be required.  */
-	if (hwrpb->vptb != 0xfffffffe00000000) {
-		wrvptptr(0xfffffffe00000000);
-		hwrpb->vptb = 0xfffffffe00000000;
+	if (hwrpb->vptb != 0xfffffffe00000000UL) {
+		wrvptptr(0xfffffffe00000000UL);
+		hwrpb->vptb = 0xfffffffe00000000UL;
 		hwrpb_update_checksum(hwrpb);
 	}
 
@@ -301,8 +301,8 @@ srm_paging_stop (void)
 	/* Move the vptb back to where the SRM console expects it.  */
 	swapper_pg_dir[1] = swapper_pg_dir[1023];
 	tbia();
-	wrvptptr(0x200000000);
-	hwrpb->vptb = 0x200000000;
+	wrvptptr(0x200000000UL);
+	hwrpb->vptb = 0x200000000UL;
 	hwrpb_update_checksum(hwrpb);
 
 	/* Reload the page tables that the console had in use.  */
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index 70362f416..2cb8fa4eb 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -384,7 +384,7 @@ show_mem(void)
 			else if (!page_count(lmem_map+i))
 				free++;
 			else
-				shared += atomic_read(&lmem_map[i].count) - 1;
+				shared += page_count(lmem_map + i) - 1;
 		}
 	}
 	printk("%ld pages of RAM\n",total);
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 588fd8b7c..9743a22fd 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -84,9 +84,6 @@ config ARCH_CLPS711X
 config ARCH_CO285
 	bool "Co-EBSA285"
 
-config ARCH_PXA
-	bool "PXA250/210-based"
-
 config ARCH_EBSA110
 	bool "EBSA-110"
 	help
@@ -111,6 +108,9 @@ config ARCH_INTEGRATOR
 config ARCH_IOP3XX
 	bool "IOP3xx-based"
 
+config ARCH_IXP4XX
+	bool "IXP4xx-based"
+
 config ARCH_L7200
 	bool "LinkUp-L7200"
 	help
@@ -123,6 +123,9 @@ config ARCH_L7200
 	  If you have any questions or comments about the Linux kernel port
 	  to this board, send e-mail to sjhill@cotw.com.
 
+config ARCH_PXA
+	bool "PXA2xx-based"
+
 config ARCH_RPC
 	bool "RiscPC"
 	help
@@ -132,9 +135,6 @@ config ARCH_RPC
 config ARCH_SA1100
 	bool "SA1100-based"
 
-config ARCH_SHARK
-	bool "Shark"
-
 config ARCH_S3C2410
 	bool "Samsung S3C2410"
 	help
@@ -142,8 +142,8 @@ config ARCH_S3C2410
 	  BAST (http://www.simtec.co.uk/products/EB110ITX/), the IPAQ 1940 or
 	  the Samsung SMDK2410 development board (and derviatives).
 
-config ARCH_OMAP
-	bool "TI OMAP"
+config ARCH_SHARK
+	bool "Shark"
 
 config ARCH_LH7A40X
 	bool "Sharp LH7A40X"
@@ -153,6 +153,9 @@ config ARCH_LH7A40X
 	  core with a wide array of integrated devices for
 	  hand-held and low-power applications.
 
+config ARCH_OMAP
+	bool "TI OMAP"
+
 config ARCH_VERSATILE_PB
 	bool "Versatile PB"
 	help
@@ -170,6 +173,8 @@ source "arch/arm/mach-integrator/Kconfig"
 
 source "arch/arm/mach-iop3xx/Kconfig"
 
+source "arch/arm/mach-ixp4xx/Kconfig"
+
 source "arch/arm/mach-pxa/Kconfig"
 
 source "arch/arm/mach-sa1100/Kconfig"
@@ -222,7 +227,7 @@ config FORCE_MAX_ZONEORDER
 
 config DMABOUNCE
 	bool
-	depends on SA1111
+	depends on SA1111 || ARCH_IXP4XX
 	default y
 
 source arch/arm/mm/Kconfig
@@ -252,7 +257,7 @@ config DISCONTIGMEM
 # Now handle the bus types
 config PCI
 	bool "PCI support" if ARCH_INTEGRATOR_AP
-	default y if ARCH_FTVPCI || ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX
+	default y if ARCH_FTVPCI || ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX
 	help
 	  Find out whether you have a PCI motherboard. PCI is the name of a
 	  bus system, i.e. the way the CPU talks to the other stuff inside
@@ -534,7 +539,7 @@ config CMDLINE
 
 config LEDS
 	bool "Timer and CPU usage LEDs"
-	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
+	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
 	help
 	  If you say Y here, the LEDs on your machine will be used
 	  to provide useful information about your current system status.
@@ -547,8 +552,8 @@ config LEDS
 	  system, but the driver will do nothing.
 
 config LEDS_TIMER
-	bool "Timer LED" if LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB)
-	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
+	bool "Timer LED" if LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || MACH_MAINSTONE || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB)
+	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
 	default y if ARCH_EBSA110
 	help
 	  If you say Y here, one of the system LEDs (the green one on the
@@ -563,7 +568,7 @@ config LEDS_TIMER
 
 config LEDS_CPU
 	bool "CPU usage LED"
-	depends on LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB)
+	depends on LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB)
 	help
 	  If you say Y here, the red LED will be used to give a good real
 	  time indication of CPU usage, by lighting whenever the idle task
@@ -576,7 +581,7 @@ config LEDS_CPU
 config ALIGNMENT_TRAP
 	bool
 	depends on CPU_32
-	default y
+	default y if !ARCH_EBSA110
 	help
 	  ARM processors can not fetch/store information which is not
 	  naturally aligned on the bus, i.e., a 4 byte fetch must start at an
@@ -604,7 +609,9 @@ source "drivers/acorn/block/Kconfig"
 
 source "net/Kconfig"
 
+if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_FTVPCI || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
 source "drivers/ide/Kconfig"
+endif
 
 source "drivers/scsi/Kconfig"
 
@@ -791,8 +798,8 @@ config DEBUG_S3C2410_PORT
 	  before it is used.
 
 config DEBUG_S3C2410_UART
-	int
 	depends on DEBUG_LL && ARCH_S3C2410
+	int "S3C2410 UART to use for low-level debug"
 	default "0"
 	help
 	  Choice for UART for kernel low-level using S3C2410 UARTS,
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index fb88490c5..85eeb2b1e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -92,6 +92,7 @@ textaddr-$(CONFIG_ARCH_CLPS711X)   := 0xc0028000
 textaddr-$(CONFIG_ARCH_FORTUNET)   := 0xc0008000
  machine-$(CONFIG_ARCH_IOP3XX)	   := iop3xx
  machine-$(CONFIG_ARCH_ADIFCC)	   := adifcc
+ machine-$(CONFIG_ARCH_IXP4XX)	   := ixp4xx
  machine-$(CONFIG_ARCH_OMAP)	   := omap
  machine-$(CONFIG_ARCH_S3C2410)	   := s3c2410
  machine-$(CONFIG_ARCH_LH7A40X)	   := lh7a40x
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 602b8a68e..72be85c54 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -51,6 +51,8 @@ initrd_phys-$(CONFIG_ARCH_SA1100)	:= 0xc0800000
 params_phys-$(CONFIG_ARCH_IOP3XX)	:= 0xa0000100
    zreladdr-$(CONFIG_ARCH_ADIFCC)	:= 0xc0008000
 params_phys-$(CONFIG_ARCH_ADIFCC)	:= 0xc0000100
+   zreladdr-$(CONFIG_ARCH_IXP4XX)	:= 0x00008000
+params-phys-$(CONFIG_ARCH_IXP4XX)	:= 0x00000100
    zreladdr-$(CONFIG_ARCH_OMAP)		:= 0x10008000
 params_phys-$(CONFIG_ARCH_OMAP)		:= 0x10000100
 initrd_phys-$(CONFIG_ARCH_OMAP)		:= 0x10800000
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index d54b4f611..480344606 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -73,6 +73,12 @@
 		.macro	writeb, rb
 		str	\rb, [r3, #0x14]	@ UTDR
 		.endm
+#elif defined(CONFIG_ARCH_IXP4XX)
+		.macro	loadsp, rb
+		mov	\rb, #0xc8000000
+		.endm
+		.macro	writeb, rb
+		str	\rb, [r3, #0]
 #elif defined(CONFIG_ARCH_LH7A40X)
 		.macro	loadsp, rb
 		ldr	\rb, =0x80000700	@ UART2 UARTBASE
@@ -80,6 +86,20 @@
 		.macro	writeb, rb
 		strb	\rb, [r3, #0]
 		.endm
+#elif defined(CONFIG_ARCH_OMAP)
+		.macro  loadsp, rb
+		mov	\rb, #0xff000000	@ physical base address
+		add	\rb, \rb, #0x00fb0000
+#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
+		add	\rb, \rb, #0x00000800
+#endif
+#ifdef CONFIG_OMAP_LL_DEBUG_UART3
+		add	\rb, \rb, #0x00009000
+#endif
+		.endm
+		.macro	writeb, rb
+		strb	\rb, [r3]
+		.endm
 #else
 #error no serial architecture defined
 #endif
@@ -176,7 +196,7 @@ not_angel:
 		ldmia	r0, {r1, r2, r3, r4, r5, r6, ip, sp}
 		subs	r0, r0, r1		@ calculate the delta offset
 
-						@ if delta is zero, we're
+						@ if delta is zero, we are
 		beq	not_relocated		@ running at the address we
 						@ were linked at.
 
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index f835e0729..0d0d8e882 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -100,6 +100,7 @@ find_dmabounce_dev(struct device *dev)
 		if (d->dev == dev)
 			return d;
 	}
+	return NULL;
 }
 
 
@@ -185,7 +186,7 @@ find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_
 static inline void
 free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *buf)
 {
-	dev_dbg(dev_info->dev, "%s(buf=%p)\n", __func__, buf);
+	dev_dbg(device_info->dev, "%s(buf=%p)\n", __func__, buf);
 
 	list_del(&buf->node);
 
diff --git a/arch/arm/configs/ebsa110_defconfig b/arch/arm/configs/ebsa110_defconfig
index 1def9c72b..6f1dac2e1 100644
--- a/arch/arm/configs/ebsa110_defconfig
+++ b/arch/arm/configs/ebsa110_defconfig
@@ -2,137 +2,120 @@
 # Automatically generated make config: don't edit
 #
 CONFIG_ARM=y
-# CONFIG_EISA is not set
-# CONFIG_SBUS is not set
-# CONFIG_MCA is not set
+CONFIG_MMU=y
 CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-# CONFIG_OBSOLETE is not set
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 
 #
 # Loadable module support
 #
 CONFIG_MODULES=y
+# CONFIG_MODULE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
 CONFIG_KMOD=y
 
 #
 # System Type
 #
-# CONFIG_ARCH_ARCA5K is not set
+# CONFIG_ARCH_ADIFCC is not set
 # CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
 CONFIG_ARCH_EBSA110=y
-# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE_PB is not set
 
 #
-# Archimedes/A5000 Implementations
-#
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
-# CONFIG_ARCH_ARC is not set
-# CONFIG_ARCH_A5K is not set
-
-#
-# Footbridge Implementations
-#
-# CONFIG_ARCH_CATS is not set
-# CONFIG_ARCH_PERSONAL_SERVER is not set
-# CONFIG_ARCH_EBSA285_ADDIN is not set
-# CONFIG_ARCH_EBSA285_HOST is not set
-# CONFIG_ARCH_NETWINDER is not set
-
-#
-# SA11x0 Implementations
-#
-# CONFIG_SA1100_ASSABET is not set
-# CONFIG_ASSABET_NEPONSET is not set
-# CONFIG_SA1100_BRUTUS is not set
-# CONFIG_SA1100_CERF is not set
-# CONFIG_SA1100_BITSY is not set
-# CONFIG_SA1100_EXTENEX1 is not set
-# CONFIG_SA1100_FREEBIRD is not set
-# CONFIG_SA1100_GRAPHICSCLIENT is not set
-# CONFIG_SA1100_JORNADA720 is not set
-# CONFIG_SA1100_HUW_WEBPANEL is not set
-# CONFIG_SA1100_ITSY is not set
-# CONFIG_SA1100_LART is not set
-# CONFIG_SA1100_NANOENGINE is not set
-# CONFIG_SA1100_OMNIMETER is not set
-# CONFIG_SA1100_PANGOLIN is not set
-# CONFIG_SA1100_PLEB is not set
-# CONFIG_SA1100_SHERMAN is not set
-# CONFIG_SA1100_PFS168 is not set
-# CONFIG_SA1100_VICTOR is not set
-# CONFIG_SA1100_XP860 is not set
-# CONFIG_SA1100_YOPY is not set
-
-#
-# CLPS711X/EP721X Implementations
+# Processor Type
 #
-# CONFIG_ARCH_P720T is not set
-# CONFIG_ARCH_ACORN is not set
-# CONFIG_FOOTBRIDGE is not set
-# CONFIG_FOOTBRIDGE_HOST is not set
-# CONFIG_FOOTBRIDGE_ADDIN is not set
 CONFIG_CPU_32=y
-# CONFIG_CPU_26 is not set
+CONFIG_CPU_SA110=y
+CONFIG_CPU_32v4=y
+CONFIG_CPU_ABRT_EV4=y
+CONFIG_CPU_CACHE_V4WB=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WB=y
 
 #
-# Processor Type
+# Processor Features
 #
-# CONFIG_CPU_32v3 is not set
-CONFIG_CPU_32v4=y
-# CONFIG_CPU_ARM610 is not set
-# CONFIG_CPU_ARM710 is not set
-# CONFIG_CPU_ARM720T is not set
-# CONFIG_CPU_ARM920T is not set
-# CONFIG_CPU_ARM1020 is not set
-CONFIG_CPU_SA110=y
-# CONFIG_CPU_SA1100 is not set
-# CONFIG_DISCONTIGMEM is not set
 
 #
 # General setup
 #
-# CONFIG_PCI is not set
 CONFIG_ISA=y
-# CONFIG_ISA_DMA is not set
-CONFIG_HOTPLUG=y
+# CONFIG_ZBOOT_ROM is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
 
 #
 # PCMCIA/CardBus support
 #
 CONFIG_PCMCIA=m
-CONFIG_I82365=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_I82365=m
 # CONFIG_TCIC is not set
-# CONFIG_PCMCIA_CLPS6700 is not set
-# CONFIG_PCMCIA_SA1100 is not set
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSCTL=y
+CONFIG_PCMCIA_PROBE=y
+
+#
+# At least one math emulation must be selected
+#
 CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
 CONFIG_FPE_FASTFPE=y
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
-CONFIG_BINFMT_AOUT=y
 CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=y
 # CONFIG_BINFMT_MISC is not set
+
+#
+# Generic Driver Options
+#
+# CONFIG_FW_LOADER is not set
 # CONFIG_PM is not set
+# CONFIG_PREEMPT is not set
 # CONFIG_ARTHUR is not set
 CONFIG_CMDLINE="root=/dev/nfs rw mem=16M console=ttyS1,38400n8"
 CONFIG_LEDS=y
@@ -143,22 +126,18 @@ CONFIG_LEDS_TIMER=y
 #
 CONFIG_PARPORT=y
 CONFIG_PARPORT_PC=y
+CONFIG_PARPORT_PC_CML1=y
 CONFIG_PARPORT_PC_FIFO=y
 # CONFIG_PARPORT_PC_SUPERIO is not set
 # CONFIG_PARPORT_PC_PCMCIA is not set
 # CONFIG_PARPORT_ARC is not set
-# CONFIG_PARPORT_AMIGA is not set
-# CONFIG_PARPORT_MFC3 is not set
-# CONFIG_PARPORT_ATARI is not set
-# CONFIG_PARPORT_SUNBPP is not set
 # CONFIG_PARPORT_OTHER is not set
 CONFIG_PARPORT_1284=y
 
 #
-# Plug and Play configuration
+# Plug and Play support
 #
 # CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
 
 #
 # Block devices
@@ -166,9 +145,6 @@ CONFIG_PARPORT_1284=y
 # CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_DEV_XD is not set
 # CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 CONFIG_BLK_DEV_RAM=y
@@ -179,37 +155,29 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 # Multi-device support (RAID and LVM)
 #
 # CONFIG_MD is not set
-# CONFIG_BLK_DEV_MD is not set
-# CONFIG_MD_LINEAR is not set
-# CONFIG_MD_RAID0 is not set
-# CONFIG_MD_RAID1 is not set
-# CONFIG_MD_RAID5 is not set
-# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
 
 #
 # Networking options
 #
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
-CONFIG_NETLINK=y
-CONFIG_RTNETLINK=y
 # CONFIG_NETLINK_DEV is not set
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
 CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_ADVANCED_ROUTER=y
-CONFIG_RTNETLINK=y
-CONFIG_NETLINK=y
 CONFIG_IP_MULTIPLE_TABLES=y
 CONFIG_IP_ROUTE_FWMARK=y
 CONFIG_IP_ROUTE_NAT=y
 # CONFIG_IP_ROUTE_MULTIPATH is not set
 # CONFIG_IP_ROUTE_TOS is not set
 CONFIG_IP_ROUTE_VERBOSE=y
-# CONFIG_IP_ROUTE_LARGE_TABLES is not set
 CONFIG_IP_PNP=y
 # CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
@@ -218,64 +186,113 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-CONFIG_INET_ECN=y
 CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_TUNNEL is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
 
 #
-#   IP: Netfilter Configuration
+# IP: Netfilter Configuration
 #
 CONFIG_IP_NF_CONNTRACK=y
 CONFIG_IP_NF_FTP=y
 CONFIG_IP_NF_IRC=y
+# CONFIG_IP_NF_TFTP is not set
+# CONFIG_IP_NF_AMANDA is not set
 # CONFIG_IP_NF_QUEUE is not set
 CONFIG_IP_NF_IPTABLES=y
 CONFIG_IP_NF_MATCH_LIMIT=y
-# CONFIG_IP_NF_MATCH_MAC is not set
+CONFIG_IP_NF_MATCH_IPRANGE=y
+CONFIG_IP_NF_MATCH_MAC=y
+CONFIG_IP_NF_MATCH_PKTTYPE=y
 CONFIG_IP_NF_MATCH_MARK=y
 CONFIG_IP_NF_MATCH_MULTIPORT=y
 CONFIG_IP_NF_MATCH_TOS=y
-# CONFIG_IP_NF_MATCH_TCPMSS is not set
+CONFIG_IP_NF_MATCH_RECENT=y
+CONFIG_IP_NF_MATCH_ECN=y
+CONFIG_IP_NF_MATCH_DSCP=y
+CONFIG_IP_NF_MATCH_AH_ESP=y
+CONFIG_IP_NF_MATCH_LENGTH=y
+CONFIG_IP_NF_MATCH_TTL=y
+CONFIG_IP_NF_MATCH_TCPMSS=y
+CONFIG_IP_NF_MATCH_HELPER=y
 CONFIG_IP_NF_MATCH_STATE=y
-CONFIG_IP_NF_MATCH_UNCLEAN=y
+CONFIG_IP_NF_MATCH_CONNTRACK=y
 # CONFIG_IP_NF_MATCH_OWNER is not set
 CONFIG_IP_NF_FILTER=y
 CONFIG_IP_NF_TARGET_REJECT=y
-# CONFIG_IP_NF_TARGET_MIRROR is not set
 CONFIG_IP_NF_NAT=y
 CONFIG_IP_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=y
 CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_TARGET_NETMAP=y
+CONFIG_IP_NF_TARGET_SAME=y
+# CONFIG_IP_NF_NAT_LOCAL is not set
+# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
 CONFIG_IP_NF_NAT_IRC=y
 CONFIG_IP_NF_NAT_FTP=y
 CONFIG_IP_NF_MANGLE=y
 CONFIG_IP_NF_TARGET_TOS=y
+CONFIG_IP_NF_TARGET_ECN=y
+CONFIG_IP_NF_TARGET_DSCP=y
 CONFIG_IP_NF_TARGET_MARK=y
+CONFIG_IP_NF_TARGET_CLASSIFY=y
 CONFIG_IP_NF_TARGET_LOG=y
-# CONFIG_IP_NF_TARGET_TCPMSS is not set
-CONFIG_IPV6=y
+# CONFIG_IP_NF_TARGET_ULOG is not set
+CONFIG_IP_NF_TARGET_TCPMSS=y
+# CONFIG_IP_NF_ARPTABLES is not set
+# CONFIG_IP_NF_RAW is not set
 
 #
-#   IPv6: Netfilter Configuration
+# IPv6: Netfilter Configuration
 #
+# CONFIG_IP6_NF_QUEUE is not set
 CONFIG_IP6_NF_IPTABLES=y
 CONFIG_IP6_NF_MATCH_LIMIT=y
+CONFIG_IP6_NF_MATCH_MAC=y
+CONFIG_IP6_NF_MATCH_RT=y
+CONFIG_IP6_NF_MATCH_OPTS=y
+CONFIG_IP6_NF_MATCH_FRAG=y
+CONFIG_IP6_NF_MATCH_HL=y
+CONFIG_IP6_NF_MATCH_MULTIPORT=y
+# CONFIG_IP6_NF_MATCH_OWNER is not set
 CONFIG_IP6_NF_MATCH_MARK=y
+# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
+CONFIG_IP6_NF_MATCH_AHESP=y
+CONFIG_IP6_NF_MATCH_LENGTH=y
+# CONFIG_IP6_NF_MATCH_EUI64 is not set
 CONFIG_IP6_NF_FILTER=y
+# CONFIG_IP6_NF_TARGET_LOG is not set
 CONFIG_IP6_NF_MANGLE=y
 CONFIG_IP6_NF_TARGET_MARK=y
-# CONFIG_KHTTPD is not set
-# CONFIG_ATM is not set
+# CONFIG_IP6_NF_RAW is not set
 
 #
-#  
+# SCTP Configuration (EXPERIMENTAL)
 #
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_LLC is not set
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
@@ -288,25 +305,30 @@ CONFIG_IP6_NF_TARGET_MARK=y
 # CONFIG_NET_SCHED is not set
 
 #
-# Network device support
+# Network testing
 #
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
 CONFIG_ARM_AM79C961A=y
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_LANCE is not set
@@ -322,40 +344,20 @@ CONFIG_ARM_AM79C961A=y
 #
 # Ethernet (1000 Mbit)
 #
-# CONFIG_ACENIC is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Ethernet (10000 Mbit)
 #
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -368,39 +370,42 @@ CONFIG_PCMCIA_PCNET=m
 # CONFIG_PCMCIA_NMCLAN is not set
 # CONFIG_PCMCIA_SMC91C92 is not set
 # CONFIG_PCMCIA_XIRC2PS is not set
-# CONFIG_ARCNET_COM20020_CS is not set
-# CONFIG_PCMCIA_IBMTR is not set
-# CONFIG_NET_PCMCIA_RADIO is not set
+# CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
+# Wan interfaces
 #
-# CONFIG_HAMRADIO is not set
+# CONFIG_WAN is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
-# IrDA (infrared) support
+# SCSI device support
 #
-# CONFIG_IRDA is not set
+# CONFIG_SCSI is not set
 
 #
-# ATA/IDE/MFM/RLL support
+# Fusion MPT device support
 #
-# CONFIG_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
 
 #
-# SCSI support
+# IEEE 1394 (FireWire) support
 #
-# CONFIG_SCSI is not set
+# CONFIG_IEEE1394 is not set
 
 #
 # I2O device support
 #
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
 
 #
 # ISDN subsystem
@@ -408,76 +413,80 @@ CONFIG_PCMCIA_PCNET=m
 # CONFIG_ISDN is not set
 
 #
-# Input core support
+# Input device support
 #
 # CONFIG_INPUT is not set
 
 #
-# Character devices
+# Userland interfaces
 #
-# CONFIG_VT is not set
-CONFIG_SERIAL=y
-CONFIG_SERIAL_CONSOLE=y
-CONFIG_SERIAL_EXTENDED=y
-# CONFIG_SERIAL_MANY_PORTS is not set
-# CONFIG_SERIAL_SHARE_IRQ is not set
-# CONFIG_SERIAL_DETECT_IRQ is not set
-# CONFIG_SERIAL_MULTIPORT is not set
-# CONFIG_HUB6 is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_SERIAL_21285 is not set
-# CONFIG_SERIAL_21285_OLD is not set
-# CONFIG_SERIAL_21285_CONSOLE is not set
-# CONFIG_SERIAL_SA1100 is not set
-# CONFIG_SERIAL_SA1100_CONSOLE is not set
-# CONFIG_SERIAL_AMBA is not set
-# CONFIG_SERIAL_AMBA_CONSOLE is not set
-# CONFIG_SERIAL_CLPS711X is not set
-# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-CONFIG_PRINTER=m
-# CONFIG_LP_CONSOLE is not set
-# CONFIG_PPDEV is not set
 
 #
-# I2C support
+# Input I/O drivers
 #
-# CONFIG_I2C is not set
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+# CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
 
 #
-# Mice
+# Input Device Drivers
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
 
 #
-# Joysticks
+# Character devices
 #
-# CONFIG_JOYSTICK is not set
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
 
 #
-# Input core support is needed for joysticks
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
 #
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+# CONFIG_TIPAR is not set
 # CONFIG_QIC02_TAPE is not set
 
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
 #
 # Watchdog Cards
 #
 CONFIG_WATCHDOG=y
 # CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
 CONFIG_SOFT_WATCHDOG=y
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
+
+#
+# ISA-based Watchdog Cards
+#
 # CONFIG_PCWATCHDOG is not set
-# CONFIG_ACQUIRE_WDT is not set
-# CONFIG_ADVANTECH_WDT is not set
-# CONFIG_60XX_WDT is not set
 # CONFIG_MIXCOMWD is not set
-# CONFIG_MACHZ_WDT is not set
-# CONFIG_INTEL_RNG is not set
+# CONFIG_WDT is not set
 # CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -492,81 +501,97 @@ CONFIG_SOFT_WATCHDOG=y
 #
 # PCMCIA character devices
 #
-# CONFIG_PCMCIA_SERIAL_CS is not set
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
 
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
 #
 # File systems
 #
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+CONFIG_MINIX_FS=y
+# CONFIG_ROMFS_FS is not set
 # CONFIG_QUOTA is not set
 # CONFIG_AUTOFS_FS is not set
 CONFIG_AUTOFS4_FS=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_REISERFS_CHECK is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
 # CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_FAT_FS is not set
-# CONFIG_MSDOS_FS is not set
-# CONFIG_UMSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
-# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
-# CONFIG_TMPFS is not set
-# CONFIG_RAMFS is not set
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-CONFIG_MINIX_FS=y
 # CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
 # CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_EXT2_FS is not set
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
 
 #
 # Network File Systems
 #
-# CONFIG_CODA_FS is not set
 CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-CONFIG_ROOT_NFS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-CONFIG_SUNRPC=y
+CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
 
 #
 # Partition Types
@@ -578,26 +603,68 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_ATARI_PARTITION is not set
 # CONFIG_MAC_PARTITION is not set
 # CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
-# CONFIG_SMB_NLS is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
 # CONFIG_NLS is not set
 
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# Misc devices
+#
+
 #
 # USB support
 #
-# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
 
 #
 # Kernel hacking
 #
 CONFIG_FRAME_POINTER=y
-CONFIG_DEBUG_ERRORS=y
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_INFO is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_NO_PGT_CACHE is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_DC21285_PORT is not set
-# CONFIG_DEBUG_CLPS711X_UART2 is not set
+# CONFIG_DEBUG_KERNEL is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/arm/configs/lpd7a400_defconfig b/arch/arm/configs/lpd7a400_defconfig
index 2fd8da9f1..7bbb7181d 100644
--- a/arch/arm/configs/lpd7a400_defconfig
+++ b/arch/arm/configs/lpd7a400_defconfig
@@ -19,19 +19,23 @@ CONFIG_BROKEN_ON_SMP=y
 #
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 # CONFIG_IKCONFIG_PROC is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 # CONFIG_EPOLL is not set
 CONFIG_IOSCHED_NOOP=y
 # CONFIG_IOSCHED_AS is not set
 # CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 
 #
@@ -43,21 +47,24 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # System Type
 #
 # CONFIG_ARCH_ADIFCC is not set
-# CONFIG_ARCH_ANAKIN is not set
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 CONFIG_ARCH_LH7A40X=y
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE_PB is not set
 
 #
 # CLPS711X/EP721X Implementations
@@ -82,13 +89,45 @@ CONFIG_ARCH_LH7A40X=y
 #
 
 #
-# Intel PXA250/210 Implementations
+# Intel IXP4xx Implementation Options
+#
+
+#
+# IXP4xx Platforms
+#
+
+#
+# IXP4xx Options
+#
+
+#
+# Intel PXA2xx Implementations
 #
 
 #
 # SA11x0 Implementations
 #
 
+#
+# TI OMAP Implementations
+#
+
+#
+# OMAP Core Type
+#
+
+#
+# OMAP Board Type
+#
+
+#
+# OMAP Feature Selections
+#
+
+#
+# S3C2410 Implementations
+#
+
 #
 # LH7A40X Implementations
 #
@@ -254,23 +293,21 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -291,6 +328,11 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -311,38 +353,24 @@ CONFIG_SMC91X=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -367,9 +395,9 @@ CONFIG_IDE_POLL=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+CONFIG_IDE_ARM=y
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
-# CONFIG_DMA_NONPCI is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -452,11 +480,6 @@ CONFIG_SERIAL_LH7A40X_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -536,6 +559,7 @@ CONFIG_VFAT_FS=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -576,7 +600,7 @@ CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -664,6 +688,11 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
 #
 # Misc devices
 #
@@ -706,5 +735,6 @@ CONFIG_DEBUG_ERRORS=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/lpd7a404_defconfig b/arch/arm/configs/lpd7a404_defconfig
index a13b52210..517f486d9 100644
--- a/arch/arm/configs/lpd7a404_defconfig
+++ b/arch/arm/configs/lpd7a404_defconfig
@@ -19,19 +19,23 @@ CONFIG_BROKEN_ON_SMP=y
 #
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 # CONFIG_IKCONFIG_PROC is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 # CONFIG_EPOLL is not set
 CONFIG_IOSCHED_NOOP=y
 # CONFIG_IOSCHED_AS is not set
 # CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 
 #
@@ -46,19 +50,21 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_SHARK is not set
 CONFIG_ARCH_LH7A40X=y
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE_PB is not set
 
 #
 # CLPS711X/EP721X Implementations
@@ -83,7 +89,19 @@ CONFIG_ARCH_LH7A40X=y
 #
 
 #
-# Intel PXA250/210 Implementations
+# Intel IXP4xx Implementation Options
+#
+
+#
+# IXP4xx Platforms
+#
+
+#
+# IXP4xx Options
+#
+
+#
+# Intel PXA2xx Implementations
 #
 
 #
@@ -94,6 +112,14 @@ CONFIG_ARCH_LH7A40X=y
 # TI OMAP Implementations
 #
 
+#
+# OMAP Core Type
+#
+
+#
+# OMAP Board Type
+#
+
 #
 # OMAP Feature Selections
 #
@@ -271,8 +297,6 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -280,7 +304,9 @@ CONFIG_IP_PNP_RARP=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -301,6 +327,11 @@ CONFIG_IP_PNP_RARP=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -321,41 +352,24 @@ CONFIG_SMC91X=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -381,6 +395,7 @@ CONFIG_IDE_POLL=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+CONFIG_IDE_ARM=y
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -404,7 +419,6 @@ CONFIG_SCSI=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -418,6 +432,7 @@ CONFIG_SCSI=y
 # SCSI low-level drivers
 #
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_DEBUG is not set
@@ -573,6 +588,7 @@ CONFIG_VFAT_FS=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -618,7 +634,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -761,6 +776,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
 # CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
 
@@ -809,6 +825,8 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -845,5 +863,6 @@ CONFIG_DEBUG_ERRORS=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/kernel/arch.c b/arch/arm/kernel/arch.c
index ba96bea03..4e02fbeb1 100644
--- a/arch/arm/kernel/arch.c
+++ b/arch/arm/kernel/arch.c
@@ -10,7 +10,6 @@
 #include <asm/elf.h>
 #include <asm/page.h>
 #include <asm/setup.h>
-#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
 unsigned int vram_size;
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index aaeec1305..43f0c6694 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -7,41 +7,16 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h>
 #include <linux/module.h>
-#include <linux/user.h>
 #include <linux/string.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/mman.h>
-#include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/in6.h>
-#include <linux/interrupt.h>
-#include <linux/pm.h>
-#include <linux/tty.h>
-#include <linux/vt_kern.h>
-#include <linux/smp_lock.h>
 #include <linux/syscalls.h>
 
-#include <asm/byteorder.h>
-#include <asm/elf.h>
+#include <asm/checksum.h>
 #include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/proc-fns.h>
-#include <asm/processor.h>
-#include <asm/semaphore.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/checksum.h>
-#include <asm/mach-types.h>
-
-extern void dump_thread(struct pt_regs *, struct user *);
-extern int dump_fpu(struct pt_regs *, struct user_fp_struct *);
-extern void inswb(unsigned int port, void *to, int len);
-extern void outswb(unsigned int port, const void *to, int len);
-
-extern void __bad_xchg(volatile void *ptr, int size);
 
 /*
  * libgcc functions - functions that are used internally by the
@@ -61,12 +36,9 @@ extern void __udivmoddi4(void);
 extern void __udivsi3(void);
 extern void __umodsi3(void);
 extern void __do_div64(void);
-extern void abort(void);
 
-extern void ret_from_exception(void);
 extern void fpundefinstr(void);
 extern void fp_enter(void);
-extern void fp_init(union fp_state *);
 
 /*
  * This has a special calling convention; it doesn't
@@ -88,32 +60,7 @@ EXPORT_SYMBOL_ALIAS(fp_send_sig,send_sig);
 EXPORT_SYMBOL_NOVERS(__backtrace);
 
 	/* platform dependent support */
-EXPORT_SYMBOL(dump_thread);
-EXPORT_SYMBOL(dump_fpu);
 EXPORT_SYMBOL(udelay);
-EXPORT_SYMBOL(__ioremap);
-EXPORT_SYMBOL(__iounmap);
-EXPORT_SYMBOL(kernel_thread);
-EXPORT_SYMBOL(system_rev);
-EXPORT_SYMBOL(system_serial_low);
-EXPORT_SYMBOL(system_serial_high);
-#ifdef CONFIG_DEBUG_BUGVERBOSE
-EXPORT_SYMBOL(__bug);
-#endif
-EXPORT_SYMBOL(__bad_xchg);
-EXPORT_SYMBOL(__readwrite_bug);
-EXPORT_SYMBOL(enable_irq);
-EXPORT_SYMBOL(disable_irq);
-EXPORT_SYMBOL(probe_irq_mask);
-EXPORT_SYMBOL(set_irq_type);
-EXPORT_SYMBOL(enable_irq_wake);
-EXPORT_SYMBOL(disable_irq_wake);
-EXPORT_SYMBOL(pm_idle);
-EXPORT_SYMBOL(pm_power_off);
-EXPORT_SYMBOL(fp_init);
-
-	/* processor dependencies */
-EXPORT_SYMBOL(__machine_arch_type);
 
 	/* networking */
 EXPORT_SYMBOL(csum_partial);
@@ -138,20 +85,6 @@ EXPORT_SYMBOL_NOVERS(__raw_writesw);
 #endif
 #ifndef __raw_writesl
 EXPORT_SYMBOL_NOVERS(__raw_writesl);
-#endif
-
-	/* address translation */
-#ifndef __virt_to_phys__is_a_macro
-EXPORT_SYMBOL(__virt_to_phys);
-#endif
-#ifndef __phys_to_virt__is_a_macro
-EXPORT_SYMBOL(__phys_to_virt);
-#endif
-#ifndef __virt_to_bus__is_a_macro
-EXPORT_SYMBOL(__virt_to_bus);
-#endif
-#ifndef __bus_to_virt__is_a_macro
-EXPORT_SYMBOL(__bus_to_virt);
 #endif
 
 	/* string / mem functions */
@@ -227,10 +160,6 @@ EXPORT_SYMBOL(_find_first_zero_bit_be);
 EXPORT_SYMBOL(_find_next_zero_bit_be);
 #endif
 
-	/* elf */
-EXPORT_SYMBOL(elf_platform);
-EXPORT_SYMBOL(elf_hwcap);
-
 	/* syscalls */
 EXPORT_SYMBOL(sys_write);
 EXPORT_SYMBOL(sys_read);
@@ -238,11 +167,3 @@ EXPORT_SYMBOL(sys_lseek);
 EXPORT_SYMBOL(sys_open);
 EXPORT_SYMBOL(sys_exit);
 EXPORT_SYMBOL(sys_wait4);
-
-	/* semaphores */
-EXPORT_SYMBOL_NOVERS(__down_failed);
-EXPORT_SYMBOL_NOVERS(__down_interruptible_failed);
-EXPORT_SYMBOL_NOVERS(__down_trylock_failed);
-EXPORT_SYMBOL_NOVERS(__up_wakeup);
-
-EXPORT_SYMBOL(get_wchan);
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 144286149..927711c48 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -155,6 +155,30 @@ static void __devinit pci_fixup_dec21285(struct pci_dev *dev)
 	}
 }
 
+/*
+ * Same as above. The PrPMC800 carrier board for the PrPMC1100 
+ * card maps the host-bridge @ 00:01:00 for some reason and it
+ * ends up getting scanned. Note that we only want to do this
+ * fixup when we find the IXP4xx on a PrPMC system, which is why
+ * we check the machine type. We could be running on a board
+ * with an IXP4xx target device and we don't want to kill the
+ * resources in that case.
+ */
+static void __devinit pci_fixup_prpmc1100(struct pci_dev *dev)
+{
+	int i;
+
+	if (machine_is_prpmc1100()) {
+		dev->class &= 0xff;
+		dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
+		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
+			dev->resource[i].start = 0;
+			dev->resource[i].end   = 0;
+			dev->resource[i].flags = 0;
+		}
+	}
+}
+
 /*
  * PCI IDE controllers use non-standard I/O port decoding, respect it.
  */
@@ -273,6 +297,10 @@ struct pci_fixup pcibios_fixups[] = {
 		PCI_FIXUP_HEADER,
 		PCI_ANY_ID,		PCI_ANY_ID,
 		pci_fixup_ide_bases
+	}, {
+		PCI_FIXUP_HEADER,
+		PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_IXP4XX,
+		pci_fixup_prpmc1100
 	}, { 0 }
 };
 
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index 9c0acea28..2ae6eae42 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -465,13 +465,45 @@
 		beq	1001b
 		.endm
 
-#elif defined(CONFIG_ARCH_OMAP)
+#elif defined(CONFIG_ARCH_IXP4XX)
+
+                .macro  addruart,rx
+                mrc     p15, 0, \rx, c1, c0
+                tst     \rx, #1                 @ MMU enabled?
+                moveq   \rx, #0xc8000000
+                movne   \rx, #0xff000000
+                add     \rx,\rx,#3              @ Uart regs are at off set of 3 if
+						@ byte writes used - Big Endian.
+                .endm
+
+               .macro  senduart,rd,rx
+                strb    \rd, [\rx]
+                .endm
+
+                .macro  waituart,rd,rx
+1002:           ldrb    \rd, [\rx, #0x14]
+                and     \rd, \rd, #0x60		@ check THRE and TEMT bits
+                teq     \rd, #0x60
+                bne     1002b
+                .endm
+
+                .macro  busyuart,rd,rx
+                .endm
 
-#include <asm/arch/serial.h>
+#elif defined(CONFIG_ARCH_OMAP)
 
 		.macro	addruart,rx
-		mov	\rx, #0xff000000
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1			@ MMU enabled?
+		moveq	\rx, #0xff000000	@ physical base address
+		movne	\rx, #0xfe000000	@ virtual base
 		orr	\rx, \rx, #0x00fb0000
+#ifdef CONFIG_OMAP_LL_DEBUG_UART3
+		orr	\rx, \rx, #0x00009000	@ UART 3
+#endif
+#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
+		orr	\rx, \rx, #0x00000800	@ UART 2 & 3
+#endif
 		.endm
 
 		.macro	senduart,rd,rx
@@ -479,16 +511,18 @@
 		.endm
 
 		.macro	busyuart,rd,rx
-1002:		ldrb	\rd, [\rx, #(0x5 << OMAP_SERIAL_REG_SHIFT)]
+1001:		ldrb	\rd, [\rx, #(0x5 << 2)]	@ OMAP-1510 and friends
 		and	\rd, \rd, #0x60
 		teq	\rd, #0x60
-		bne	1002b
+		beq	1002f
+		ldrb	\rd, [\rx, #(0x5 << 0)]	@ OMAP-730 only
+		and	\rd, \rd, #0x60
+		teq	\rd, #0x60
+		bne	1001b
+1002:
 		.endm
 
 		.macro	waituart,rd,rx
-1001:		ldrb	\rd, [\rx, #(0x6 << OMAP_SERIAL_REG_SHIFT)]
-		tst	\rd, #0x10
-		beq	1001b
 		.endm
 
 #elif defined(CONFIG_ARCH_S3C2410)
@@ -551,7 +585,7 @@
 		.endm
 
 #elif defined(CONFIG_ARCH_LH7A40X)
-	@ It isn't known if this will be appropriate for every 40x
+	@ It is not known if this will be appropriate for every 40x
 	@ board.
 
 		.macro  addruart,rx
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 2e85a9944..8af6251f3 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -623,10 +623,15 @@ ENTRY(soft_irq_mask)
 		.endm
 
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+#ifdef CONFIG_PXA27x
+		mrc	p6, 0, \irqstat, c0, c0, 0		@ ICIP
+		mrc	p6, 0, \irqnr, c1, c0, 0		@ ICMR
+#else
 		mov	\base, #io_p2v(0x40000000)	@ IIR Ctl = 0x40d00000
 		add	\base, \base, #0x00d00000
 		ldr	\irqstat, [\base, #0]		@ ICIP
 		ldr	\irqnr, [\base, #4]		@ ICMR
+#endif
 		ands	\irqnr, \irqstat, \irqnr
 		beq	1001f
 		rsb	\irqstat, \irqnr, #0
@@ -639,6 +644,34 @@ ENTRY(soft_irq_mask)
 		.macro	irq_prio_table
 		.endm
 
+#elif defined (CONFIG_ARCH_IXP4XX)
+
+		.macro	disable_fiq
+		.endm
+		
+		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+		ldr	\irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET)
+		ldr	\irqstat, [\irqstat]		@ get interrupts
+		cmp	\irqstat, #0
+		beq	1002f
+		clz     \irqnr, \irqstat
+		mov     \base, #31
+		subs    \irqnr, \base, \irqnr
+		
+/*
+1001:		tst	\irqstat, #1
+		addeq	\irqnr, \irqnr, #1
+		moveq	\irqstat, \irqstat, lsr #1
+		tsteq	\irqnr, #32
+		beq	1001b
+		teq	\irqnr, #32
+*/
+1002:
+		.endm
+
+                .macro  irq_prio_table
+                .endm
+
 #elif defined(CONFIG_ARCH_OMAP)
 
 		.macro	disable_fiq
@@ -646,19 +679,19 @@ ENTRY(soft_irq_mask)
 
 		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
 		ldr	\base, =IO_ADDRESS(OMAP_IH1_BASE)
-		ldr	\irqnr, [\base, #IRQ_ITR]
-		ldr	\tmp, [\base, #IRQ_MIR]
+		ldr	\irqnr, [\base, #IRQ_ITR_REG_OFFSET]
+		ldr	\tmp, [\base, #IRQ_MIR_REG_OFFSET]
 		mov	\irqstat, #0xffffffff
 		bic	\tmp, \irqstat, \tmp
 		tst	\irqnr, \tmp
 		beq	1510f
 
-		ldr	\irqnr, [\base, #IRQ_SIR_FIQ]
+		ldr	\irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
 		cmp	\irqnr, #0
-		ldreq	\irqnr, [\base, #IRQ_SIR_IRQ]
+		ldreq	\irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
 		cmpeq	\irqnr, #INT_IH2_IRQ
 		ldreq	\base, =IO_ADDRESS(OMAP_IH2_BASE)
-		ldreq	\irqnr, [\base, #IRQ_SIR_IRQ]
+		ldreq	\irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
 		addeqs	\irqnr, \irqnr, #32
 1510:
 		.endm
@@ -1219,7 +1252,7 @@ ENTRY(ret_from_exception)
 
 /*
  * Register switch for ARMv3 and ARMv4 processors
- * r0 = previous thread_info, r1 = next thread_info
+ * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
  * previous and next are guaranteed not to be the same.
  */
 ENTRY(__switch_to)
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index dac499cee..5777a8c2f 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -47,7 +47,7 @@
 #define MAX_IRQ_CNT	100000
 
 static volatile unsigned long irq_err_count;
-static spinlock_t irq_controller_lock;
+static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(irq_pending);
 
 struct irqdesc irq_desc[NR_IRQS];
@@ -103,6 +103,7 @@ void disable_irq(unsigned int irq)
 	list_del_init(&desc->pend);
 	spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
+EXPORT_SYMBOL(disable_irq);
 
 /**
  *	enable_irq - enable interrupt handling on an irq
@@ -142,6 +143,7 @@ void enable_irq(unsigned int irq)
 	}
 	spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
+EXPORT_SYMBOL(enable_irq);
 
 /*
  * Enable wake on selected irq
@@ -156,6 +158,7 @@ void enable_irq_wake(unsigned int irq)
 		desc->chip->wake(irq, 1);
 	spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
+EXPORT_SYMBOL(enable_irq_wake);
 
 void disable_irq_wake(unsigned int irq)
 {
@@ -167,6 +170,7 @@ void disable_irq_wake(unsigned int irq)
 		desc->chip->wake(irq, 0);
 	spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
+EXPORT_SYMBOL(disable_irq_wake);
 
 int show_interrupts(struct seq_file *p, void *v)
 {
@@ -443,7 +447,7 @@ static void do_pending_irqs(struct pt_regs *regs)
  * come via this function.  Instead, they should provide their
  * own 'handler'
  */
-asmlinkage void asm_do_IRQ(int irq, struct pt_regs *regs)
+asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
 	struct irqdesc *desc = irq_desc + irq;
 
@@ -541,6 +545,7 @@ int set_irq_type(unsigned int irq, unsigned int type)
 
 	return ret;
 }
+EXPORT_SYMBOL(set_irq_type);
 
 void set_irq_flags(unsigned int irq, unsigned int iflags)
 {
@@ -798,6 +803,7 @@ unsigned int probe_irq_mask(unsigned long irqs)
 
 	return mask;
 }
+EXPORT_SYMBOL(probe_irq_mask);
 
 /*
  * Possible return values:
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8423921e8..8d9db749e 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -73,7 +73,10 @@ __setup("hlt", hlt_setup);
  * The following aren't currently used.
  */
 void (*pm_idle)(void);
+EXPORT_SYMBOL(pm_idle);
+
 void (*pm_power_off)(void);
+EXPORT_SYMBOL(pm_power_off);
 
 /*
  * This is our default idle handler.  We need to disable
@@ -301,6 +304,7 @@ static void default_fp_init(union fp_state *fp)
 }
 
 void (*fp_init)(union fp_state *) = default_fp_init;
+EXPORT_SYMBOL(fp_init);
 
 void flush_thread(void)
 {
@@ -350,6 +354,7 @@ int dump_fpu (struct pt_regs *regs, struct user_fp *fp)
 
 	return used_math != 0;
 }
+EXPORT_SYMBOL(dump_fpu);
 
 /*
  * fill in the user structure for a core dump..
@@ -378,6 +383,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
 	dump->regs = *regs;
 	dump->u_fpvalid = dump_fpu (regs, &dump->u_fp);
 }
+EXPORT_SYMBOL(dump_thread);
 
 /*
  * Shuffle the argument into the correct register before calling the
@@ -385,13 +391,15 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
  * the thread function, and r3 points to the exit function.
  */
 extern void kernel_thread_helper(void);
-asm(	".align\n"
+asm(	".section .text\n"
+"	.align\n"
 "	.type	kernel_thread_helper, #function\n"
 "kernel_thread_helper:\n"
 "	mov	r0, r1\n"
 "	mov	lr, r3\n"
 "	mov	pc, r2\n"
-"	.size	kernel_thread_helper, . - kernel_thread_helper");
+"	.size	kernel_thread_helper, . - kernel_thread_helper\n"
+"	.previous");
 
 /*
  * Create a kernel thread.
@@ -410,12 +418,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
 
 	return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
 }
-
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
+EXPORT_SYMBOL(kernel_thread);
 
 unsigned long get_wchan(struct task_struct *p)
 {
@@ -431,9 +434,10 @@ unsigned long get_wchan(struct task_struct *p)
 		if (fp < stack_page || fp > 4092+stack_page)
 			return 0;
 		lr = pc_pointer (((unsigned long *)fp)[-1]);
-		if (lr < first_sched || lr > last_sched)
+		if (!in_sched_functions(lr))
 			return lr;
 		fp = *(unsigned long *) (fp - 12);
 	} while (count ++ < 16);
 	return 0;
 }
+EXPORT_SYMBOL(get_wchan);
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index d4058edc5..fd3d5b2ba 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -622,7 +622,7 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
 			ret = access_process_vm(child, addr, &tmp,
 						sizeof(unsigned long), 0);
 			if (ret == sizeof(unsigned long))
-				ret = put_user(tmp, (unsigned long *) data);
+				ret = put_user(tmp, (unsigned long __user *) data);
 			else
 				ret = -EIO;
 			break;
diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c
index da39eb3dc..9ce72332e 100644
--- a/arch/arm/kernel/semaphore.c
+++ b/arch/arm/kernel/semaphore.c
@@ -11,6 +11,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -213,3 +214,7 @@ __up_wakeup:					\n\
 	ldmfd	sp!, {r0 - r3, pc}		\n\
 	");
 
+EXPORT_SYMBOL_NOVERS(__down_failed);
+EXPORT_SYMBOL_NOVERS(__down_interruptible_failed);
+EXPORT_SYMBOL_NOVERS(__down_trylock_failed);
+EXPORT_SYMBOL_NOVERS(__up_wakeup);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index d58a35e50..1cff09a55 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -8,6 +8,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/ioport.h>
@@ -61,10 +62,20 @@ extern int _stext, _text, _etext, _edata, _end;
 
 unsigned int processor_id;
 unsigned int __machine_arch_type;
+EXPORT_SYMBOL(__machine_arch_type);
+
 unsigned int system_rev;
+EXPORT_SYMBOL(system_rev);
+
 unsigned int system_serial_low;
+EXPORT_SYMBOL(system_serial_low);
+
 unsigned int system_serial_high;
+EXPORT_SYMBOL(system_serial_high);
+
 unsigned int elf_hwcap;
+EXPORT_SYMBOL(elf_hwcap);
+
 
 #ifdef MULTI_CPU
 struct processor processor;
@@ -80,7 +91,10 @@ struct cpu_cache_fns cpu_cache;
 #endif
 
 unsigned char aux_device_present;
+
 char elf_platform[ELF_PLATFORM_SIZE];
+EXPORT_SYMBOL(elf_platform);
+
 char saved_command_line[COMMAND_LINE_SIZE];
 unsigned long phys_initrd_start __initdata = 0;
 unsigned long phys_initrd_size __initdata = 0;
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index c0f84aacb..4aef80895 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -253,6 +253,9 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
 	if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
 		goto badframe;
 
+	if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
+		goto badframe;
+
 	/* Send SIGTRAP if we're single-stepping */
 	if (current->ptrace & PT_SINGLESTEP) {
 		ptrace_cancel_bpt(current);
@@ -402,6 +405,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
 	       sigset_t *set, struct pt_regs *regs)
 {
 	struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame));
+	stack_t stack;
 	int err = 0;
 
 	if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
@@ -411,8 +415,14 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
 	__put_user_error(&frame->uc, &frame->puc, err);
 	err |= copy_siginfo_to_user(&frame->info, info);
 
-	/* Clear all the bits of the ucontext we don't use.  */
-	err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
+	__put_user_error(0, &frame->uc.uc_flags, err);
+	__put_user_error(NULL, &frame->uc.uc_link, err);
+
+	memset(&stack, 0, sizeof(stack));
+	stack.ss_sp = (void *)current->sas_ss_sp;
+	stack.ss_flags = sas_ss_flags(regs->ARM_sp);
+	stack.ss_size = current->sas_ss_size;
+	err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
 
 	err |= setup_sigcontext(&frame->uc.uc_mcontext, /*&frame->fpstate,*/
 				regs, set->sig[0]);
@@ -427,8 +437,8 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
 		 * arguments for the signal handler.
 		 *   -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06
 		 */
-		regs->ARM_r1 = (unsigned long)frame->pinfo;
-		regs->ARM_r2 = (unsigned long)frame->puc;
+		regs->ARM_r1 = (unsigned long)&frame->info;
+		regs->ARM_r2 = (unsigned long)&frame->uc;
 	}
 
 	return err;
@@ -564,10 +574,10 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
 				regs->ARM_r7 = __NR_restart_syscall;
 				regs->ARM_pc -= 2;
 			} else {
-				u32 *usp;
+				u32 __user *usp;
 
 				regs->ARM_sp -= 12;
-				usp = (u32 *)regs->ARM_sp;
+				usp = (u32 __user *)regs->ARM_sp;
 
 				put_user(regs->ARM_pc, &usp[0]);
 				/* swi __NR_restart_syscall */
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 4f98f2485..79acdd17f 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -12,6 +12,7 @@
  *  have a non-standard calling sequence on the Linux/arm
  *  platform.
  */
+#include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -282,3 +283,43 @@ asmlinkage int sys_execve(char __user *filenamei, char __user * __user *argv,
 out:
 	return error;
 }
+
+long execve(const char *filename, char **argv, char **envp)
+{
+	struct pt_regs regs;
+	int ret;
+
+	memset(&regs, 0, sizeof(struct pt_regs));
+	ret = do_execve((char *)filename, (char __user * __user *)argv,
+			(char __user * __user *)envp, &regs);
+	if (ret < 0)
+		goto out;
+
+	/*
+	 * Save argc to the register structure for userspace.
+	 */
+	regs.ARM_r0 = ret;
+
+	/*
+	 * We were successful.  We won't be returning to our caller, but
+	 * instead to user space by manipulating the kernel stack.
+	 */
+	asm(	"add	r0, %0, %1\n\t"
+		"mov	r1, %2\n\t"
+		"mov	r2, %3\n\t"
+		"bl	memmove\n\t"	/* copy regs to top of stack */
+		"mov	r8, #0\n\t"	/* not a syscall */
+		"mov	r9, %0\n\t"	/* thread structure */
+		"mov	sp, r0\n\t"	/* reposition stack pointer */
+		"b	ret_to_user"
+		:
+		: "r" (current_thread_info()),
+		  "Ir" (THREAD_SIZE - 8 - sizeof(regs)),
+		  "r" (&regs),
+		  "Ir" (sizeof(regs))
+		: "r0", "r1", "r2", "r3", "ip", "memory");
+
+ out:
+	return ret;
+}
+EXPORT_SYMBOL(execve);
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 514e88c27..3f2816793 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -495,6 +495,7 @@ void __bad_xchg(volatile void *ptr, int size)
 		__builtin_return_address(0), ptr, size);
 	BUG();
 }
+EXPORT_SYMBOL(__bad_xchg);
 
 /*
  * A data abort trap was taken, but we did not handle the instruction.
@@ -532,12 +533,14 @@ volatile void __bug(const char *file, int line, void *data)
 	printk("\n");
 	*(int *)0 = 0;
 }
+EXPORT_SYMBOL(__bug);
 
 void __readwrite_bug(const char *fn)
 {
 	printk("%s called, but not implemented", fn);
 	BUG();
 }
+EXPORT_SYMBOL(__readwrite_bug);
 
 void __pte_error(const char *file, int line, unsigned long val)
 {
@@ -559,6 +562,7 @@ asmlinkage void __div0(void)
 	printk("Division by zero in kernel.\n");
 	dump_stack();
 }
+EXPORT_SYMBOL_NOVERS(__div0);
 
 void abort(void)
 {
@@ -567,6 +571,7 @@ void abort(void)
 	/* if that doesn't kill us, halt */
 	panic("Oops failed to kill thread");
 }
+EXPORT_SYMBOL(abort);
 
 void __init trap_init(void)
 {
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index b419d0b5f..007a5a012 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -24,7 +24,6 @@ lib-$(CONFIG_ARCH_RPC)		+= ecard.o io-acorn.o floppydma.o
 lib-$(CONFIG_ARCH_CLPS7500)	+= io-acorn.o
 lib-$(CONFIG_ARCH_L7200)	+= io-acorn.o
 lib-$(CONFIG_ARCH_SHARK)	+= io-shark.o
-lib-$(CONFIG_ARCH_CLPS711X)	+= io-acorn.o
 
 $(obj)/csumpartialcopy.o:	$(obj)/csumpartialcopygeneric.S
 $(obj)/csumpartialcopyuser.o:	$(obj)/csumpartialcopygeneric.S
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index 99378ecd7..3aacd01d4 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -17,31 +17,6 @@
 		.text
 		.align
 
-		.equ	diff_pcio_base, PCIO_BASE - IO_BASE
-
-		.macro	outw2	rd
-		mov	r8, \rd, lsl #16
-		orr	r8, r8, r8, lsr #16
-		str	r8, [r3, r0, lsl #2]
-		mov	r8, \rd, lsr #16
-		orr	r8, r8, r8, lsl #16
-		str	r8, [r3, r0, lsl #2]
-		.endm
-
-		.macro	inw2	rd, mask, temp
-		ldr	\rd, [r0]
-		and	\rd, \rd, \mask
-		ldr	\temp, [r0]
-		orr	\rd, \rd, \temp, lsl #16
-		.endm
-
-		.macro	addr	rd
-		tst	\rd, #0x80000000
-		mov	\rd, \rd, lsl #2
-		add	\rd, \rd, #IO_BASE
-		addeq	\rd, \rd, #diff_pcio_base
-		.endm
-
 .iosl_warning:
 		.ascii	"<4>insl/outsl not implemented, called from %08lX\0"
 		.align
diff --git a/arch/arm/mach-adifcc/irq.c b/arch/arm/mach-adifcc/irq.c
index 29cd52983..4163c602d 100644
--- a/arch/arm/mach-adifcc/irq.c
+++ b/arch/arm/mach-adifcc/irq.c
@@ -19,8 +19,6 @@
 #include <asm/irq.h>
 #include <asm/hardware.h>
 
-#include <asm/mach-types.h>
-
 static void xs80200_irq_mask (unsigned int irq)
 {
 	long INTCTL;
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index 4e2278f95..f6e676322 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -1,16 +1,15 @@
+if ARCH_CLPS711X
 
 menu "CLPS711X/EP721X Implementations"
 
 config ARCH_AUTCPU12
 	bool "AUTCPU12"
-	depends on ARCH_CLPS711X
 	help
 	  Say Y if you intend to run the kernel on the autronix autcpu12
 	  board. This board is based on a Cirrus Logic CS89712.
 
 config ARCH_CDB89712
 	bool "CDB89712"
-	depends on ARCH_CLPS711X
 	help
 	  This is an evaluation board from Cirrus for the CS89712 processor.
 	  The board includes 2 serial ports, Ethernet, IRDA, and expansion
@@ -18,32 +17,27 @@ config ARCH_CDB89712
 
 config ARCH_CEIVA
 	bool "CEIVA"
-	depends on ARCH_CLPS711X
 	help
 	  Say Y here if you intend to run this kernel on the Ceiva/Polaroid
 	  PhotoMax Digital Picture Frame.
 
 config ARCH_CLEP7312
 	bool "CLEP7312"
-	depends on ARCH_CLPS711X
 
 config ARCH_EDB7211
 	bool "EDB7211"
-	depends on ARCH_CLPS711X
 	help
 	  Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
 	  evaluation board.
 
 config ARCH_P720T
 	bool "P720T"
-	depends on ARCH_CLPS711X
 	help
 	  Say Y here if you intend to run this kernel on the ARM Prospector
 	  720T.
 
 config ARCH_FORTUNET
 	bool "FORTUNET"
-	depends on ARCH_CLPS711X
 
 # XXX Maybe these should indicate register compatibility
 # instead of being mutually exclusive.
@@ -74,3 +68,4 @@ config EP72XX_ROM_BOOT
 
 endmenu
 
+endif
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index b40b5d663..f74f43583 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -31,7 +31,6 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
 	    char **cmdline, struct meminfo *mi)
 {
 	mi->nr_banks=1;
-	mi->end = 0xc0FFFFFF;
 	mi->bank[0].start = 0xc0000000;
 	mi->bank[0].size = 0x01000000;
 	mi->bank[0].node = 0;
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index 864699216..268e42baa 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -34,7 +34,16 @@
 extern void clps711x_map_io(void);
 extern void clps711x_init_irq(void);
 
-struct meminfo memmap = { 1, 0xC1000000, {{0xC0000000,0x01000000,0}}};
+struct meminfo memmap = {
+	.nr_banks	= 1,
+	.bank		= {
+		{
+			.start	= 0xC0000000,
+			.size	= 0x01000000,
+			.node	= 0
+		},
+	},
+};
 
 typedef struct tag_IMAGE_PARAMS
 {
@@ -53,9 +62,8 @@ static void __init
 fortunet_fixup(struct machine_desc *desc, struct tag *tags,
 		 char **cmdline, struct meminfo *mi)
 {
-	IMAGE_PARAMS *ip;
-	ip = (IMAGE_PARAMS *)__phys_to_virt(IMAGE_PARAMS_PHYS);
-	*cmdline = (char *)__phys_to_virt(ip->command_line);
+	IMAGE_PARAMS *ip = phys_to_virt(IMAGE_PARAMS_PHYS);
+	*cmdline = phys_to_virt(ip->command_line);
 #ifdef CONFIG_BLK_DEV_INITRD
 	if(ip->ramdisk_ok)
 	{
@@ -64,7 +72,6 @@ fortunet_fixup(struct machine_desc *desc, struct tag *tags,
 	}
 #endif
 	memmap.bank[0].size = ip->ram_size;
-	memmap.end = ip->ram_size+0xC0000000;
 	*mi = memmap;
 }
 
diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
index c948ddf30..6556818e4 100644
--- a/arch/arm/mach-ebsa110/io.c
+++ b/arch/arm/mach-ebsa110/io.c
@@ -67,9 +67,9 @@ u8 __readb(void *addr)
 	u32 ret, a = __isamem_convert_addr(addr);
 
 	if ((int)addr & 1)
-		ret = __raw_getl(a);
+		ret = __raw_readl(a);
 	else
-		ret = __raw_getb(a);
+		ret = __raw_readb(a);
 	return ret;
 }
 
@@ -80,7 +80,7 @@ u16 __readw(void *addr)
 	if ((int)addr & 1)
 		BUG();
 
-	return __raw_getw(a);
+	return __raw_readw(a);
 }
 
 u32 __readl(void *addr)
@@ -90,8 +90,8 @@ u32 __readl(void *addr)
 	if ((int)addr & 3)
 		BUG();
 
-	ret = __raw_getw(a);
-	ret |= __raw_getw(a + 4) << 16;
+	ret = __raw_readw(a);
+	ret |= __raw_readw(a + 4) << 16;
 	return ret;
 }
 
@@ -104,9 +104,9 @@ void __writeb(u8 val, void *addr)
 	u32 a = __isamem_convert_addr(addr);
 
 	if ((int)addr & 1)
-		__raw_putl(val, a);
+		__raw_writel(val, a);
 	else
-		__raw_putb(val, a);
+		__raw_writeb(val, a);
 }
 
 void __writew(u16 val, void *addr)
@@ -116,7 +116,7 @@ void __writew(u16 val, void *addr)
 	if ((int)addr & 1)
 		BUG();
 
-	__raw_putw(val, a);
+	__raw_writew(val, a);
 }
 
 void __writel(u32 val, void *addr)
@@ -126,8 +126,8 @@ void __writel(u32 val, void *addr)
 	if ((int)addr & 3)
 		BUG();
 
-	__raw_putw(val, a);
-	__raw_putw(val >> 16, a + 4);
+	__raw_writew(val, a);
+	__raw_writew(val >> 16, a + 4);
 }
 
 EXPORT_SYMBOL(__writeb);
@@ -147,7 +147,7 @@ u8 __inb(int port)
 	 * The SuperIO registers use sane addressing techniques...
 	 */
 	if (SUPERIO_PORT(port))
-		ret = __raw_getb(ISAIO_BASE + (port << 2));
+		ret = __raw_readb(ISAIO_BASE + (port << 2));
 	else {
 		u32 a = ISAIO_BASE + ((port & ~1) << 1);
 
@@ -155,9 +155,9 @@ u8 __inb(int port)
 		 * Shame nothing else does
 		 */
 		if (port & 1)
-			ret = __raw_getl(a);
+			ret = __raw_readl(a);
 		else
-			ret = __raw_getb(a);
+			ret = __raw_readb(a);
 	}
 	return ret;
 }
@@ -170,7 +170,7 @@ u16 __inw(int port)
 	 * The SuperIO registers use sane addressing techniques...
 	 */
 	if (SUPERIO_PORT(port))
-		ret = __raw_getw(ISAIO_BASE + (port << 2));
+		ret = __raw_readw(ISAIO_BASE + (port << 2));
 	else {
 		u32 a = ISAIO_BASE + ((port & ~1) << 1);
 
@@ -180,7 +180,7 @@ u16 __inw(int port)
 		if (port & 1)
 			BUG();
 
-		ret = __raw_getw(a);
+		ret = __raw_readw(a);
 	}
 	return ret;
 }
@@ -201,7 +201,7 @@ void __outb(u8 val, int port)
 	 * The SuperIO registers use sane addressing techniques...
 	 */
 	if (SUPERIO_PORT(port))
-		__raw_putb(val, ISAIO_BASE + (port << 2));
+		__raw_writeb(val, ISAIO_BASE + (port << 2));
 	else {
 		u32 a = ISAIO_BASE + ((port & ~1) << 1);
 
@@ -209,9 +209,9 @@ void __outb(u8 val, int port)
 		 * Shame nothing else does
 		 */
 		if (port & 1)
-			__raw_putl(val, a);
+			__raw_writel(val, a);
 		else
-			__raw_putb(val, a);
+			__raw_writeb(val, a);
 	}
 }
 
@@ -230,7 +230,7 @@ void __outw(u16 val, int port)
 			BUG();
 
 	}
-	__raw_putw(val, ISAIO_BASE + off);
+	__raw_writew(val, ISAIO_BASE + off);
 }
 
 void __outl(u32 val, int port)
diff --git a/arch/arm/mach-epxa10db/Kconfig b/arch/arm/mach-epxa10db/Kconfig
index e88d914ef..55d896dd4 100644
--- a/arch/arm/mach-epxa10db/Kconfig
+++ b/arch/arm/mach-epxa10db/Kconfig
@@ -1,17 +1,16 @@
+if ARCH_CAMELOT
 
 menu "Epxa10db"
 
 comment "PLD hotswap support"
-	depends on ARCH_CAMELOT
 
 config PLD
 	bool
-	depends on ARCH_CAMELOT
 	default y
 
 config PLD_HOTSWAP
 	bool "Support for PLD device hotplugging (experimental)"
-	depends on ARCH_CAMELOT && EXPERIMENTAL
+	depends on EXPERIMENTAL
 	help
 	  This enables support for the dynamic loading and configuration of
 	  compatible drivers when the contents of the PLD are changed. This
@@ -21,3 +20,4 @@ config PLD_HOTSWAP
 
 endmenu
 
+endif
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
index 510f896fd..1eaea0b87 100644
--- a/arch/arm/mach-footbridge/Kconfig
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -1,9 +1,9 @@
+if ARCH_FOOTBRIDGE
 
 menu "Footbridge Implementations"
 
 config ARCH_CATS
 	bool "CATS"
-	depends on ARCH_FOOTBRIDGE
 	help
 	  Say Y here if you intend to run this kernel on the CATS.
 
@@ -11,7 +11,6 @@ config ARCH_CATS
 
 config ARCH_PERSONAL_SERVER
 	bool "Compaq Personal Server"
-	depends on ARCH_FOOTBRIDGE
 	---help---
 	  Say Y here if you intend to run this kernel on the Compaq
 	  Personal Server.
@@ -29,7 +28,6 @@ config ARCH_PERSONAL_SERVER
 
 config ARCH_EBSA285_ADDIN
 	bool "EBSA285 (addin mode)"
-	depends on ARCH_FOOTBRIDGE
 	help
 	  Say Y here if you intend to run this kernel on the EBSA285 card
 	  in addin mode.
@@ -38,7 +36,6 @@ config ARCH_EBSA285_ADDIN
 
 config ARCH_EBSA285_HOST
 	bool "EBSA285 (host mode)"
-	depends on ARCH_FOOTBRIDGE
 	help
 	  Say Y here if you intend to run this kernel on the EBSA285 card
 	  in host ("central function") mode.
@@ -47,7 +44,6 @@ config ARCH_EBSA285_HOST
 
 config ARCH_NETWINDER
 	bool "NetWinder"
-	depends on ARCH_FOOTBRIDGE
 	help
 	  Say Y here if you intend to run this kernel on the Rebel.COM
 	  NetWinder.  Information about this machine can be found at:
@@ -58,3 +54,4 @@ config ARCH_NETWINDER
 
 endmenu
 
+endif
diff --git a/arch/arm/mach-footbridge/mm.c b/arch/arm/mach-footbridge/mm.c
index 400932cfd..ce85de648 100644
--- a/arch/arm/mach-footbridge/mm.c
+++ b/arch/arm/mach-footbridge/mm.c
@@ -87,6 +87,7 @@ unsigned long __virt_to_bus(unsigned long res)
 
 	return (res - PAGE_OFFSET) + (*CSR_PCISDRAMBASE & 0xfffffff0);
 }
+EXPORT_SYMBOL(__virt_to_bus);
 
 unsigned long __bus_to_virt(unsigned long res)
 {
@@ -97,5 +98,6 @@ unsigned long __bus_to_virt(unsigned long res)
 
 	return res;
 }
+EXPORT_SYMBOL(__bus_to_virt);
 
 #endif
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index 47f67a206..df97d1639 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -1,5 +1,6 @@
+if ARCH_INTEGRATOR
+
 menu "Integrator Options"
-	depends on ARCH_INTEGRATOR
 
 config ARCH_INTEGRATOR_AP
 	bool "Support Integrator/AP and Integrator/PP2 platforms"
@@ -28,3 +29,5 @@ config INTEGRATOR_IMPD1
 	  module will be called impd1.
 
 endmenu
+
+endif
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 8f30c1151..01ce14d70 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -108,7 +108,7 @@ arch_initcall(integrator_init);
 
 #define CM_CTRL	IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
 
-static spinlock_t cm_lock;
+static spinlock_t cm_lock = SPIN_LOCK_UNLOCKED;
 
 /**
  * cm_control - update the CM_CTRL register.
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index f2c1567a4..e2a07deda 100644
--- a/arch/arm/mach-integrator/cpu.c
+++ b/arch/arm/mach-integrator/cpu.c
@@ -152,10 +152,10 @@ static int integrator_set_target(struct cpufreq_policy *policy,
 	return 0;
 }
 
-static int integrator_cpufreq_init(struct cpufreq_policy *policy)
+static unsigned int integrator_get(unsigned int cpu)
 {
 	unsigned long cpus_allowed;
-	unsigned int cpu = policy->cpu;
+	unsigned int current_freq;
 	u_int cm_osc;
 	struct icst525_vco vco;
 
@@ -175,15 +175,22 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy)
 	vco.v = cm_osc & 255;
 	vco.r = 22;
 
+	current_freq = icst525_khz(&cclk_params, vco); /* current freq */
+
+	set_cpus_allowed(current, cpus_allowed);
+
+	return current_freq;
+}
+
+static int integrator_cpufreq_init(struct cpufreq_policy *policy)
+{
+
 	/* set default policy and cpuinfo */
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 	policy->cpuinfo.max_freq = 160000;
 	policy->cpuinfo.min_freq = 12000;
 	policy->cpuinfo.transition_latency = 1000000; /* 1 ms, assumed */
-	policy->cur = policy->min = policy->max =
-		icst525_khz(&cclk_params, vco); /* current freq */
-
-	set_cpus_allowed(current, cpus_allowed);
+	policy->cur = policy->min = policy->max = integrator_get(policy->cpu);
 
 	return 0;
 }
@@ -191,6 +198,7 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy)
 static struct cpufreq_driver integrator_driver = {
 	.verify		= integrator_verify_policy,
 	.target		= integrator_set_target,
+	.get		= integrator_get,
 	.init		= integrator_cpufreq_init,
 	.name		= "integrator",
 };
diff --git a/arch/arm/mach-iop3xx/Kconfig b/arch/arm/mach-iop3xx/Kconfig
index a253ad4dc..6a388e273 100644
--- a/arch/arm/mach-iop3xx/Kconfig
+++ b/arch/arm/mach-iop3xx/Kconfig
@@ -1,10 +1,10 @@
+if ARCH_IOP3XX
 
 menu "IOP3xx Implementation Options"
 
 choice
 	prompt "IOP3xx System Type"
 	default ARCH_IQ80310
-	depends on ARCH_IOP3XX
 
 config ARCH_IQ80310
 	bool "IQ80310"
@@ -36,19 +36,20 @@ comment "IOP3xx Chipset Features"
 
 config IOP3XX_AAU
 	bool "Support Intel IOP3xx Application Accelerator Unit (EXPERIMENTAL)"
-	depends on ARCH_IOP3XX && EXPERIMENTAL
+	depends on EXPERIMENTAL
 
 config IOP3XX_DMA
 	bool "Support Intel IOP3xx DMA (EXPERIMENTAL)"
-	depends on ARCH_IOP3XX && EXPERIMENTAL
+	depends on EXPERIMENTAL
 
 config IOP3XX_MU
 	bool "Support Intel IOP3xx Messaging Unit (EXPERIMENTAL)"
-	depends on ARCH_IOP3XX && EXPERIMENTAL
+	depends on EXPERIMENTAL
 
 config IOP3XX_PMON
 	bool "Support Intel IOP3xx Performance Monitor (EXPERIMENTAL)"
-	depends on ARCH_IOP3XX && EXPERIMENTAL
+	depends on EXPERIMENTAL
 
 endmenu
 
+endif
diff --git a/arch/arm/mach-iop3xx/iop310-irq.c b/arch/arm/mach-iop3xx/iop310-irq.c
index ec3824b10..a05e7e958 100644
--- a/arch/arm/mach-iop3xx/iop310-irq.c
+++ b/arch/arm/mach-iop3xx/iop310-irq.c
@@ -21,8 +21,6 @@
 #include <asm/irq.h>
 #include <asm/hardware.h>
 
-#include <asm/mach-types.h>
-
 extern void xs80200_irq_mask(unsigned int);
 extern void xs80200_irq_unmask(unsigned int);
 extern void xs80200_init_irq(void);
diff --git a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c
index 64a1e7c35..a10a9b953 100644
--- a/arch/arm/mach-iop3xx/iop321-time.c
+++ b/arch/arm/mach-iop3xx/iop321-time.c
@@ -23,7 +23,6 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
-#include <asm/mach-types.h>
 #include <asm/mach/irq.h>
 
 static unsigned long iop321_gettimeoffset(void)
diff --git a/arch/arm/mach-iop3xx/iq80310-irq.c b/arch/arm/mach-iop3xx/iq80310-irq.c
index 1b78847b2..933153781 100644
--- a/arch/arm/mach-iop3xx/iq80310-irq.c
+++ b/arch/arm/mach-iop3xx/iq80310-irq.c
@@ -22,8 +22,6 @@
 #include <asm/hardware.h>
 #include <asm/system.h>
 
-#include <asm/mach-types.h>
-
 extern void iop310_init_irq(void);
 extern void iop310_irq_demux(unsigned int, struct irqdesc *, struct pt_regs *);
 
diff --git a/arch/arm/mach-iop3xx/iq80310-time.c b/arch/arm/mach-iop3xx/iq80310-time.c
index 53794ddf5..2698938d9 100644
--- a/arch/arm/mach-iop3xx/iq80310-time.c
+++ b/arch/arm/mach-iop3xx/iq80310-time.c
@@ -21,7 +21,6 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
-#include <asm/mach-types.h>
 #include <asm/mach/irq.h>
 
 static void iq80310_write_timer (u_long val)
diff --git a/arch/arm/mach-iop3xx/mm-321.c b/arch/arm/mach-iop3xx/mm-321.c
index b24a1403d..f53dea57a 100644
--- a/arch/arm/mach-iop3xx/mm-321.c
+++ b/arch/arm/mach-iop3xx/mm-321.c
@@ -21,7 +21,6 @@
 #include <asm/page.h>
 
 #include <asm/mach/map.h>
-#include <asm/mach-types.h>
 
 
 /*
diff --git a/arch/arm/mach-iop3xx/mm.c b/arch/arm/mach-iop3xx/mm.c
index ef877dca9..110381a20 100644
--- a/arch/arm/mach-iop3xx/mm.c
+++ b/arch/arm/mach-iop3xx/mm.c
@@ -23,7 +23,6 @@
 #include <asm/page.h>
 
 #include <asm/mach/map.h>
-#include <asm/mach-types.h>
 
 #ifdef CONFIG_IOP310_MU
 #include "message.h"
diff --git a/arch/arm/mach-iop3xx/xs80200-irq.c b/arch/arm/mach-iop3xx/xs80200-irq.c
index a34bc7309..70304dd26 100644
--- a/arch/arm/mach-iop3xx/xs80200-irq.c
+++ b/arch/arm/mach-iop3xx/xs80200-irq.c
@@ -17,8 +17,6 @@
 #include <asm/irq.h>
 #include <asm/hardware.h>
 
-#include <asm/mach-types.h>
-
 static void xs80200_irq_mask (unsigned int irq)
 {
 	unsigned long intctl;
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 3377f887b..46b72e106 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -1,7 +1,7 @@
+if ARCH_IXP4XX
 
 config ARCH_SUPPORTS_BIG_ENDIAN
 	bool
-	depends on ARCH_IXP4XX
 	default y
 
 menu "Intel IXP4xx Implementation Options"
@@ -10,7 +10,6 @@ comment "IXP4xx Platforms"
 
 config ARCH_AVILA
 	bool "Avila"
-	depends on ARCH_IXP4XX
 	help
 	  Say 'Y' here if you want your kernel to support the Gateworks
 	  Avila Network Platform. For more information on this platform,
@@ -18,7 +17,6 @@ config ARCH_AVILA
 
 config ARCH_ADI_COYOTE
 	bool "Coyote"
-	depends on ARCH_IXP4XX
 	help
 	  Say 'Y' here if you want your kernel to support the ADI 
 	  Engineering Coyote Gateway Reference Platform. For more
@@ -26,7 +24,6 @@ config ARCH_ADI_COYOTE
 
 config ARCH_IXDP425
 	bool "IXDP425"
-	depends on ARCH_IXP4XX
 	help
 	  Say 'Y' here if you want your kernel to support Intel's 
 	  IXDP425 Development Platform (Also known as Richfield).  
@@ -44,7 +41,6 @@ config ARCH_IXCDP1100
 
 config ARCH_PRPMC1100
 	bool "PrPMC1100"
-	depends on ARCH_IXP4XX
 	help
 	  Say 'Y' here if you want your kernel to support the Motorola
 	  PrPCM1100 Processor Mezanine Module. For more information on
@@ -62,7 +58,6 @@ comment "IXP4xx Options"
 
 config IXP4XX_INDIRECT_PCI
 	bool "Use indirect PCI memory access"
-	depends on ARCH_IXP4XX
 	help
           IXP4xx provides two methods of accessing PCI memory space:
 
@@ -87,3 +82,5 @@ config IXP4XX_INDIRECT_PCI
 	  what you need, leave this option unselected.
 
 endmenu
+
+endif
diff --git a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig
index 4475dba72..b1934bfa4 100644
--- a/arch/arm/mach-lh7a40x/Kconfig
+++ b/arch/arm/mach-lh7a40x/Kconfig
@@ -1,9 +1,9 @@
+if ARCH_LH7A40X
 
 menu "LH7A40X Implementations"
 
 config MACH_KEV7A400
 	bool "KEV7A400"
-	depends on ARCH_LH7A40X
 	select ARCH_LH7A400
 	help
 	  Say Y here if you are using the Sharp KEV7A400 development
@@ -12,9 +12,8 @@ config MACH_KEV7A400
 
 config MACH_LPD7A400
 	bool "LPD7A400 Card Engine"
-	depends on ARCH_LH7A40X
 	select ARCH_LH7A400
-	select IDE_POLL
+#	select IDE_POLL
 	help
 	  Say Y here if you are using Logic Product Development's
 	  LPD7A400 CardEngine.  For the time being, the LPD7A400 and
@@ -22,9 +21,8 @@ config MACH_LPD7A400
 
 config MACH_LPD7A404
 	bool "LPD7A404 Card Engine"
-	depends on ARCH_LH7A40X
 	select ARCH_LH7A404
-	select IDE_POLL
+#	select IDE_POLL
 	help
 	  Say Y here if you are using Logic Product Development's
 	  LPD7A404 CardEngine. For the time being, the LPD7A400 and
@@ -37,3 +35,5 @@ config ARCH_LH7A404
 	bool
 
 endmenu
+
+endif
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
index 734cc7581..75dba9836 100644
--- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
@@ -116,7 +116,12 @@ extern void lpd7a400_map_io (void);
 
 static void __init lpd7a40x_init (void)
 {
-	CPLD_CONTROL = 0x0;	/* Enable LAN (Disable LCD) */
+	CPLD_CONTROL |=     (1<<6); /* Mask USB1 connection IRQ */
+	CPLD_CONTROL &= ~(0
+			  | (1<<1) /* Disable LCD */
+			  | (1<<0) /* Enable WLAN */
+		);
+
 	platform_add_devices (lpd7a40x_devs, ARRAY_SIZE (lpd7a40x_devs));
 }
 
@@ -191,7 +196,7 @@ void __init lh7a40x_init_board_irq (void)
 	int pinCPLD = (cpld_version == 0x28) ? 7 : 3;
 
 #if defined CONFIG_MACH_LPD7A404
-	cpld_version = 0x34;	/* Override, for now */
+	cpld_version = 0x34;	/* Coerce LPD7A404 to RevB */
 #endif
 
 		/* First, configure user controlled GPIOF interrupts  */
@@ -204,7 +209,7 @@ void __init lh7a40x_init_board_irq (void)
 
 		/* Then, configure CPLD interrupt */
 
-	CPLD_INTERRUPTS	=   0x0c; /* Disable all CPLD interrupts */
+	CPLD_INTERRUPTS	=   0x9c; /* Disable all CPLD interrupts */
 	GPIO_PFDD	&= ~(1 << pinCPLD); /* Make input */
 	GPIO_INTTYPE1	|=  (1 << pinCPLD); /* Edge triggered */
 	GPIO_INTTYPE2	&= ~(1 << pinCPLD); /* Active low */
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 30bc6dff3..9fb70d5dc 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -1,27 +1,24 @@
+if ARCH_OMAP
 
 menu "TI OMAP Implementations"
 
 comment "OMAP Core Type"
 
 config ARCH_OMAP730
-	depends on ARCH_OMAP
 	bool "OMAP730 Based System"
 	select CPU_ARM926T
 
 config ARCH_OMAP1510
-	depends on ARCH_OMAP
 	default y
 	bool "OMAP1510 Based System"
 	select CPU_ARM925T
 	select CPU_DCACHE_WRITETHROUGH
 
 config ARCH_OMAP1610
-	depends on ARCH_OMAP
 	bool "OMAP1610 Based System"
 	select CPU_ARM926T
 
 config ARCH_OMAP5912
-	depends on ARCH_OMAP
 	bool "OMAP5912 Based System"
 	select CPU_ARM926T
 
@@ -87,7 +84,6 @@ comment "OMAP Feature Selections"
 
 #config OMAP_BOOT_TAG
 #	bool "OMAP bootloader information passing"
-#        depends on ARCH_OMAP
 #        default n
 #        help
 #          Say Y, if you have a bootloader which passes information
@@ -95,7 +91,6 @@ comment "OMAP Feature Selections"
 
 config OMAP_MUX
 	bool "OMAP multiplexing support"
-        depends on ARCH_OMAP
 	default y
         help
           Pin multiplexing support for OMAP boards. If your bootloader
@@ -113,7 +108,6 @@ config OMAP_MUX_DEBUG
 
 choice
 	prompt "Low-level debug console UART"
-	depends on ARCH_OMAP
 	default OMAP_LL_DEBUG_UART1
 
 config OMAP_LL_DEBUG_UART1
@@ -171,3 +165,5 @@ config OMAP_ARM_30MHZ
           Enable 30MHz clock for OMAP CPU. If unsure, say N.
 
 endmenu
+
+endif
diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c
index b0b45337d..e0b09f86a 100644
--- a/arch/arm/mach-omap/board-generic.c
+++ b/arch/arm/mach-omap/board-generic.c
@@ -18,6 +18,7 @@
 #include <linux/device.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -64,9 +65,9 @@ static void __init omap_generic_map_io(void)
 	omap_map_io();
 }
 
-MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610")
+MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610/1710")
 	MAINTAINER("Tony Lindgren <tony@atomide.com>")
-	BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
+	BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
 	BOOT_PARAMS(0x10000100)
 	MAPIO(omap_generic_map_io)
 	INITIRQ(omap_generic_init_irq)
diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c
index ad32ad655..c65f38f58 100644
--- a/arch/arm/mach-omap/board-innovator.c
+++ b/arch/arm/mach-omap/board-innovator.c
@@ -19,8 +19,10 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/device.h>
+#include <linux/delay.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -36,14 +38,14 @@ extern int omap_gpio_init(void);
 
 /* Only FPGA needs to be mapped here. All others are done with ioremap */
 static struct map_desc innovator1510_io_desc[] __initdata = {
-{ OMAP1510P1_FPGA_BASE, OMAP1510P1_FPGA_START, OMAP1510P1_FPGA_SIZE,
+{ OMAP1510_FPGA_BASE, OMAP1510_FPGA_START, OMAP1510_FPGA_SIZE,
 	MT_DEVICE },
 };
 
 static struct resource innovator1510_smc91x_resources[] = {
 	[0] = {
-		.start	= OMAP1510P1_FPGA_ETHR_START,	/* Physical */
-		.end	= OMAP1510P1_FPGA_ETHR_START + 16,
+		.start	= OMAP1510_FPGA_ETHR_START,	/* Physical */
+		.end	= OMAP1510_FPGA_ETHR_START + 16,
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
@@ -132,12 +134,13 @@ static void __init innovator_map_io(void)
 #ifdef CONFIG_ARCH_OMAP1510
 	if (cpu_is_omap1510()) {
 		iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
+		udelay(10);	/* Delay needed for FPGA */
 
 		/* Dump the Innovator FPGA rev early - useful info for support. */
 		printk("Innovator FPGA Rev %d.%d Board Rev %d\n",
-		       fpga_read(OMAP1510P1_FPGA_REV_HIGH),
-		       fpga_read(OMAP1510P1_FPGA_REV_LOW),
-		       fpga_read(OMAP1510P1_FPGA_BOARD_REV));
+		       fpga_read(OMAP1510_FPGA_REV_HIGH),
+		       fpga_read(OMAP1510_FPGA_REV_LOW),
+		       fpga_read(OMAP1510_FPGA_BOARD_REV));
 	}
 #endif
 #ifdef CONFIG_ARCH_OMAP1610
@@ -149,7 +152,7 @@ static void __init innovator_map_io(void)
 
 MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
 	MAINTAINER("MontaVista Software, Inc.")
-	BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
+	BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
 	BOOT_PARAMS(0x10000100)
 	MAPIO(innovator_map_io)
 	INITIRQ(innovator_init_irq)
diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c
index 1dfa06e41..8044dd190 100644
--- a/arch/arm/mach-omap/board-osk.c
+++ b/arch/arm/mach-omap/board-osk.c
@@ -31,6 +31,7 @@
 #include <linux/device.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -89,7 +90,7 @@ static void __init osk_map_io(void)
 
 MACHINE_START(OMAP_OSK, "TI-OSK")
 	MAINTAINER("Dirk Behme <dirk.behme@de.bosch.com>")
-	BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
+	BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
 	BOOT_PARAMS(0x10000100)
 	MAPIO(osk_map_io)
 	INITIRQ(osk_init_irq)
diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c
index 5f38ed9ff..e938ea4b6 100644
--- a/arch/arm/mach-omap/board-perseus2.c
+++ b/arch/arm/mach-omap/board-perseus2.c
@@ -3,6 +3,9 @@
  *
  * Modified from board-generic.c
  *
+ * Original OMAP730 support by Jean Pihet <j-pihet@ti.com>
+ * Updated for 2.6 by Kevin Hilman <kjh@hilman.org>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -13,6 +16,7 @@
 #include <linux/device.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -102,8 +106,8 @@ static void __init omap_perseus2_map_io(void)
 }
 
 MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
-	MAINTAINER("Kevin Hilman <k-hilman@ti.com>")
-	BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
+	MAINTAINER("Kevin Hilman <kjh@hilman.org>")
+	BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
 	BOOT_PARAMS(0x10000100)
 	MAPIO(omap_perseus2_map_io)
 	INITIRQ(omap_perseus2_init_irq)
diff --git a/arch/arm/mach-omap/bus.c b/arch/arm/mach-omap/bus.c
index 2ad402d0d..07da30d52 100644
--- a/arch/arm/mach-omap/bus.c
+++ b/arch/arm/mach-omap/bus.c
@@ -266,7 +266,7 @@ static void __exit omap_bus_exit(void)
 	}
 }
 
-module_init(omap_bus_init);
+postcore_initcall(omap_bus_init);
 module_exit(omap_bus_exit);
 
 MODULE_DESCRIPTION("Virtual bus for OMAP");
diff --git a/arch/arm/mach-omap/clocks.c b/arch/arm/mach-omap/clocks.c
index 382baee25..bda7c6f38 100644
--- a/arch/arm/mach-omap/clocks.c
+++ b/arch/arm/mach-omap/clocks.c
@@ -84,7 +84,7 @@ static ck_info_t ck_info_table[] = {
 	}, {
 		.name		= "ck_gen1",
 		.flags		= CK_RATEF | CK_IDLEF,
-		.rate_reg	= CK_DPLL1,
+		.rate_reg	= DPLL_CTL,
 		.idle_reg	= ARM_IDLECT1,
 		.idle_shift	= IDLDPLL_ARM,
 		.parent		= OMAP_CLKIN,
@@ -629,39 +629,39 @@ init_ck(void)
 	omap_writew(0x1000, ARM_SYSST);
 #if defined(CONFIG_OMAP_ARM_30MHZ)
 	omap_writew(0x1555, ARM_CKCTL);
-	omap_writew(0x2290, DPLL_CTL_REG);
+	omap_writew(0x2290, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_60MHZ)
 	omap_writew(0x1005, ARM_CKCTL);
-	omap_writew(0x2290, DPLL_CTL_REG);
+	omap_writew(0x2290, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_96MHZ)
 	omap_writew(0x1005, ARM_CKCTL);
-	omap_writew(0x2410, DPLL_CTL_REG);
+	omap_writew(0x2410, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_120MHZ)
 	omap_writew(0x110a, ARM_CKCTL);
-	omap_writew(0x2510, DPLL_CTL_REG);
+	omap_writew(0x2510, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_168MHZ)
 	omap_writew(0x110f, ARM_CKCTL);
-	omap_writew(0x2710, DPLL_CTL_REG);
+	omap_writew(0x2710, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_182MHZ) && defined(CONFIG_ARCH_OMAP730)
 	omap_writew(0x250E, ARM_CKCTL);
-	omap_writew(0x2710, DPLL_CTL_REG);
+	omap_writew(0x2710, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_192MHZ) && (defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912))
 	omap_writew(0x150f, ARM_CKCTL);
 	if (crystal_type == 2) {
 		source_clock = 13;	/* MHz */
-		omap_writew(0x2510, DPLL_CTL_REG);
+		omap_writew(0x2510, DPLL_CTL);
 	} else
-		omap_writew(0x2810, DPLL_CTL_REG);
+		omap_writew(0x2810, DPLL_CTL);
 #elif defined(CONFIG_OMAP_ARM_195MHZ) && defined(CONFIG_ARCH_OMAP730)
 	omap_writew(0x250E, ARM_CKCTL);
-	omap_writew(0x2790, DPLL_CTL_REG);
+	omap_writew(0x2790, DPLL_CTL);
 #else
 #error "OMAP MHZ not set, please run make xconfig"
 #endif
 
 #ifdef CONFIG_MACH_OMAP_PERSEUS2
 	/* Select slicer output as OMAP input clock */
-	omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL_REG) & ~0x1, OMAP730_PCC_UPLD_CTRL_REG);
+	omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL);
 #endif
 
 	/* Turn off some other junk the bootloader might have turned on */
diff --git a/arch/arm/mach-omap/common.c b/arch/arm/mach-omap/common.c
index 2ff74d1a4..43aaa1c6c 100644
--- a/arch/arm/mach-omap/common.c
+++ b/arch/arm/mach-omap/common.c
@@ -23,6 +23,58 @@
 #include <asm/arch/board.h>
 #include <asm/io.h>
 
+/*
+ * ----------------------------------------------------------------------------
+ * OMAP revision check
+ *
+ * Since we use the cpu_is_omapnnnn() macros, there's a chance that a board
+ * switches to an updated core. We want to print out the OMAP revision early.
+ *
+ * We use the system_serial registers for the revision information so we
+ * can see it in /proc/cpuinfo.
+ *
+ * If the OMAP detection gets more complicated, we may want to expand this
+ * to store the OMAP version and replace the current cpu_is_omapnnnn() macros.
+ *
+ * ----------------------------------------------------------------------------
+ */
+static void __init omap_check_revision(void)
+{
+	system_serial_high = omap_readl(OMAP_ID_BASE);
+	system_serial_low = OMAP_ID_REG;
+	system_rev = (OMAP_ID_REG >> ID_SHIFT) & ID_MASK;
+
+	printk("OMAP revision: %d.%d (0x%08x) id: 0x%08x detected as OMAP-",
+	       (system_serial_high >> 20) & 0xf,
+	       (system_serial_high >> 16) & 0xf,
+	       system_serial_high, system_serial_low);
+
+	switch (system_rev) {
+	case OMAP_ID_730:
+		printk("730\n");
+		system_rev = 0x730;
+		break;
+	case OMAP_ID_1510:
+		printk("1510\n");
+		system_rev = 0x1510;
+		break;
+	case OMAP_ID_1610:
+		printk("1610\n");
+		system_rev = 0x1610;
+		break;
+	case OMAP_ID_1710:
+		printk("1710\n");
+		system_rev = 0x1710;
+		break;
+	case OMAP_ID_5912:
+		printk("5912/1611B\n");
+		system_rev = 0x5912;
+		break;
+	default:
+		printk("unknown, please add support!\n");
+	}
+}
+
 /*
  * ----------------------------------------------------------------------------
  * OMAP I/O mapping
@@ -64,7 +116,13 @@ static struct map_desc omap1610_io_desc[] __initdata = {
 static struct map_desc omap5912_io_desc[] __initdata = {
  { OMAP5912_DSP_BASE,    OMAP5912_DSP_START,    OMAP5912_DSP_SIZE,    MT_DEVICE },
  { OMAP5912_DSPREG_BASE, OMAP5912_DSPREG_START, OMAP5912_DSPREG_SIZE, MT_DEVICE },
- { OMAP5912_SRAM_BASE,   OMAP5912_SRAM_START,   OMAP5912_SRAM_SIZE,   MT_DEVICE }
+/*
+ * The OMAP5912 has 250kByte internal SRAM. Because the mapping is baseed on page
+ * size (4kByte), it seems that the last 2kByte (=0x800) of the 250kByte are not mapped.
+ * Add additional 2kByte (0x800) so that the last page is mapped and the last 2kByte
+ * can be used.
+ */
+ { OMAP5912_SRAM_BASE,   OMAP5912_SRAM_START,   OMAP5912_SRAM_SIZE + 0x800,   MT_DEVICE }
 };
 #endif
 
@@ -77,6 +135,7 @@ static void __init _omap_map_io(void)
 	/* We have to initialize the IO space mapping before we can run
 	 * cpu_is_omapxxx() macros. */
 	iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
+	omap_check_revision();
 
 #ifdef CONFIG_ARCH_OMAP730
 	if (cpu_is_omap730()) {
@@ -102,8 +161,8 @@ static void __init _omap_map_io(void)
 	/* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
 	 * on a Posted Write in the TIPB Bridge".
 	 */
-	omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL_REG);
-	omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL_REG);
+	omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
+	omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
 
 	/* Must init clocks early to assure that timer interrupt works
 	 */
diff --git a/arch/arm/mach-omap/dma.c b/arch/arm/mach-omap/dma.c
index 2c7832458..385b4d1cc 100644
--- a/arch/arm/mach-omap/dma.c
+++ b/arch/arm/mach-omap/dma.c
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2003 Nokia Corporation
  * Author: Juha Yrjölä <juha.yrjola@nokia.com>
+ * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
  *
  * Support functions for the OMAP internal DMA channels.
  *
@@ -34,6 +35,7 @@
 static int enable_1510_mode = 0;
 
 struct omap_dma_lch {
+	int next_lch;
 	int dev_id;
 	u16 saved_csr;
 	u16 enabled_irqs;
@@ -90,45 +92,124 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
 {
 	u16 w;
 
-	w = omap_readw(OMAP_DMA_CSDP_REG(lch));
+	w = omap_readw(OMAP_DMA_CSDP(lch));
 	w &= ~0x03;
 	w |= data_type;
-	omap_writew(w, OMAP_DMA_CSDP_REG(lch));
+	omap_writew(w, OMAP_DMA_CSDP(lch));
 
-	w = omap_readw(OMAP_DMA_CCR_REG(lch));
+	w = omap_readw(OMAP_DMA_CCR(lch));
 	w &= ~(1 << 5);
 	if (sync_mode == OMAP_DMA_SYNC_FRAME)
 		w |= 1 << 5;
-	omap_writew(w, OMAP_DMA_CCR_REG(lch));
+	omap_writew(w, OMAP_DMA_CCR(lch));
 
-	w = omap_readw(OMAP_DMA_CCR2_REG(lch));
+	w = omap_readw(OMAP_DMA_CCR2(lch));
 	w &= ~(1 << 2);
 	if (sync_mode == OMAP_DMA_SYNC_BLOCK)
 		w |= 1 << 2;
-	omap_writew(w, OMAP_DMA_CCR2_REG(lch));
+	omap_writew(w, OMAP_DMA_CCR2(lch));
 
-	omap_writew(elem_count, OMAP_DMA_CEN_REG(lch));
-	omap_writew(frame_count, OMAP_DMA_CFN_REG(lch));
+	omap_writew(elem_count, OMAP_DMA_CEN(lch));
+	omap_writew(frame_count, OMAP_DMA_CFN(lch));
 
 }
+void omap_set_dma_constant_fill(int lch, u32 color)
+{
+	u16 w;
+
+#ifdef CONFIG_DEBUG_KERNEL
+	if (omap_dma_in_1510_mode) {
+		printk(KERN_ERR "OMAP DMA constant fill not available in 1510 mode.");
+		BUG();
+		return;
+	}
+#endif
+	w = omap_readw(OMAP_DMA_CCR2(lch)) & ~0x03;
+	w |= 0x01;
+	omap_writew(w, OMAP_DMA_CCR2(lch));
+
+	omap_writew((u16)color, OMAP_DMA_COLOR_L(lch));
+	omap_writew((u16)(color >> 16), OMAP_DMA_COLOR_U(lch));
+
+	w = omap_readw(OMAP_DMA_LCH_CTRL(lch)) & ~0x0f;
+	w |= 1;		/* Channel type G */
+	omap_writew(w, OMAP_DMA_LCH_CTRL(lch));
+}
+
+void omap_set_dma_transparent_copy(int lch, u32 color)
+{
+	u16 w;
+
+#ifdef CONFIG_DEBUG_KERNEL
+	if (omap_dma_in_1510_mode) {
+		printk(KERN_ERR "OMAP DMA transparent copy not available in 1510 mode.");
+		BUG();
+	}
+#endif
+	w = omap_readw(OMAP_DMA_CCR2(lch)) & ~0x03;
+	w |= 0x02;
+	omap_writew(w, OMAP_DMA_CCR2(lch));
+
+	omap_writew((u16)color, OMAP_DMA_COLOR_L(lch));
+	omap_writew((u16)(color >> 16), OMAP_DMA_COLOR_U(lch));
+
+	w = omap_readw(OMAP_DMA_LCH_CTRL(lch)) & ~0x0f;
+	w |= 1;		/* Channel type G */
+	omap_writew(w, OMAP_DMA_LCH_CTRL(lch));
+}
 
 void omap_set_dma_src_params(int lch, int src_port, int src_amode,
 			     unsigned long src_start)
 {
 	u16 w;
 
-	w = omap_readw(OMAP_DMA_CSDP_REG(lch));
+	w = omap_readw(OMAP_DMA_CSDP(lch));
 	w &= ~(0x1f << 2);
 	w |= src_port << 2;
-	omap_writew(w, OMAP_DMA_CSDP_REG(lch));
+	omap_writew(w, OMAP_DMA_CSDP(lch));
 
-	w = omap_readw(OMAP_DMA_CCR_REG(lch));
+	w = omap_readw(OMAP_DMA_CCR(lch));
 	w &= ~(0x03 << 12);
 	w |= src_amode << 12;
-	omap_writew(w, OMAP_DMA_CCR_REG(lch));
+	omap_writew(w, OMAP_DMA_CCR(lch));
+
+	omap_writew(src_start >> 16, OMAP_DMA_CSSA_U(lch));
+	omap_writew(src_start, OMAP_DMA_CSSA_L(lch));
+}
 
-	omap_writew(src_start >> 16, OMAP_DMA_CSSA_U_REG(lch));
-	omap_writew(src_start, OMAP_DMA_CSSA_L_REG(lch));
+void omap_set_dma_src_index(int lch, int eidx, int fidx)
+{
+	omap_writew(eidx, OMAP_DMA_CSEI(lch));
+	omap_writew(fidx, OMAP_DMA_CSFI(lch));
+}
+
+void omap_set_dma_src_data_pack(int lch, int enable)
+{
+	u16 w;
+
+	w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(1 << 6);
+	w |= enable ? (1 << 6) : 0;
+	omap_writew(w, OMAP_DMA_CSDP(lch));
+}
+
+void omap_set_dma_src_burst_mode(int lch, int burst_mode)
+{
+	u16 w;
+
+	w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(0x03 << 7);
+	switch (burst_mode) {
+	case OMAP_DMA_DATA_BURST_4:
+		w |= (0x01 << 7);
+		break;
+	case OMAP_DMA_DATA_BURST_8:
+		w |= (0x03 << 7);
+		break;
+	default:
+		printk(KERN_ERR "Invalid DMA burst mode\n");
+		BUG();
+		return;
+	}
+	omap_writew(w, OMAP_DMA_CSDP(lch));
 }
 
 void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
@@ -136,46 +217,136 @@ void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
 {
 	u16 w;
 
-	w = omap_readw(OMAP_DMA_CSDP_REG(lch));
+	w = omap_readw(OMAP_DMA_CSDP(lch));
 	w &= ~(0x1f << 9);
 	w |= dest_port << 9;
-	omap_writew(w, OMAP_DMA_CSDP_REG(lch));
+	omap_writew(w, OMAP_DMA_CSDP(lch));
 
-	w = omap_readw(OMAP_DMA_CCR_REG(lch));
+	w = omap_readw(OMAP_DMA_CCR(lch));
 	w &= ~(0x03 << 14);
 	w |= dest_amode << 14;
-	omap_writew(w, OMAP_DMA_CCR_REG(lch));
+	omap_writew(w, OMAP_DMA_CCR(lch));
+
+	omap_writew(dest_start >> 16, OMAP_DMA_CDSA_U(lch));
+	omap_writew(dest_start, OMAP_DMA_CDSA_L(lch));
+}
+
+void omap_set_dma_dest_index(int lch, int eidx, int fidx)
+{
+	omap_writew(eidx, OMAP_DMA_CDEI(lch));
+	omap_writew(fidx, OMAP_DMA_CDFI(lch));
+}
+
+void omap_set_dma_dest_data_pack(int lch, int enable)
+{
+	u16 w;
+
+	w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(1 << 13);
+	w |= enable ? (1 << 13) : 0;
+	omap_writew(w, OMAP_DMA_CSDP(lch));
+}
+
+void omap_set_dma_dest_burst_mode(int lch, int burst_mode)
+{
+	u16 w;
 
-	omap_writew(dest_start >> 16, OMAP_DMA_CDSA_U_REG(lch));
-	omap_writew(dest_start, OMAP_DMA_CDSA_L_REG(lch));
+	w = omap_readw(OMAP_DMA_CSDP(lch)) & ~(0x03 << 14);
+	switch (burst_mode) {
+	case OMAP_DMA_DATA_BURST_4:
+		w |= (0x01 << 14);
+		break;
+	case OMAP_DMA_DATA_BURST_8:
+		w |= (0x03 << 14);
+		break;
+	default:
+		printk(KERN_ERR "Invalid DMA burst mode\n");
+		BUG();
+		return;
+	}
+	omap_writew(w, OMAP_DMA_CSDP(lch));
 }
 
 void omap_start_dma(int lch)
 {
 	u16 w;
 
+	if (!omap_dma_in_1510_mode()) {
+		int next_lch;
+
+		next_lch = dma_chan[lch].next_lch;
+
+		/* Enable the queue, if needed so. */
+		if (next_lch != -1) {
+			/* Clear the STOP_LNK bits */
+			w = omap_readw(OMAP_DMA_CLNK_CTRL(lch));
+			w &= ~(1 << 14);
+			omap_writew(w, OMAP_DMA_CLNK_CTRL(lch));
+			w = omap_readw(OMAP_DMA_CLNK_CTRL(next_lch));
+			w &= ~(1 << 14);
+			omap_writew(w, OMAP_DMA_CLNK_CTRL(next_lch));
+
+			/* And set the ENABLE_LNK bits */
+			omap_writew(next_lch | (1 << 15),
+				    OMAP_DMA_CLNK_CTRL(lch));
+			/* The loop case */
+			if (dma_chan[next_lch].next_lch == lch)
+				omap_writew(lch | (1 << 15),
+					    OMAP_DMA_CLNK_CTRL(next_lch));
+
+			/* Read CSR to make sure it's cleared. */
+			w = omap_readw(OMAP_DMA_CSR(next_lch));
+			/* Enable some nice interrupts. */
+			omap_writew(dma_chan[next_lch].enabled_irqs,
+				    OMAP_DMA_CICR(next_lch));
+			dma_chan[next_lch].flags |= OMAP_DMA_ACTIVE;
+		}
+	}
+
 	/* Read CSR to make sure it's cleared. */
-	w = omap_readw(OMAP_DMA_CSR_REG(lch));
+	w = omap_readw(OMAP_DMA_CSR(lch));
 	/* Enable some nice interrupts. */
-	omap_writew(dma_chan[lch].enabled_irqs, OMAP_DMA_CICR_REG(lch));
+	omap_writew(dma_chan[lch].enabled_irqs, OMAP_DMA_CICR(lch));
 
-	w = omap_readw(OMAP_DMA_CCR_REG(lch));
+	w = omap_readw(OMAP_DMA_CCR(lch));
 	w |= OMAP_DMA_CCR_EN;
-	omap_writew(w, OMAP_DMA_CCR_REG(lch));
+	omap_writew(w, OMAP_DMA_CCR(lch));
 	dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
 }
 
 void omap_stop_dma(int lch)
 {
 	u16 w;
+	int next_lch;
 
 	/* Disable all interrupts on the channel */
-	omap_writew(0, OMAP_DMA_CICR_REG(lch));
+	omap_writew(0, OMAP_DMA_CICR(lch));
 
-	w = omap_readw(OMAP_DMA_CCR_REG(lch));
-	w &= ~OMAP_DMA_CCR_EN;
-	omap_writew(w, OMAP_DMA_CCR_REG(lch));
+	if (omap_dma_in_1510_mode()) {
+		w = omap_readw(OMAP_DMA_CCR(lch));
+		w &= ~OMAP_DMA_CCR_EN;
+		omap_writew(w, OMAP_DMA_CCR(lch));
+		dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
+		return;
+	}
+
+	next_lch = dma_chan[lch].next_lch;
+
+	/*
+	 * According to thw HW spec, enabling the STOP_LNK bit
+	 * resets the CCR_EN bit at the same time.
+	 */
+	w = omap_readw(OMAP_DMA_CLNK_CTRL(lch));
+	w |= (1 << 14);
+	w = omap_writew(w, OMAP_DMA_CLNK_CTRL(lch));
 	dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
+
+	if (next_lch != -1) {
+		omap_writew(0, OMAP_DMA_CICR(next_lch));
+		w = omap_readw(OMAP_DMA_CLNK_CTRL(next_lch));
+		w |= (1 << 14);
+		w = omap_writew(w, OMAP_DMA_CLNK_CTRL(next_lch));
+		dma_chan[next_lch].flags &= ~OMAP_DMA_ACTIVE;
+	}
 }
 
 void omap_enable_dma_irq(int lch, u16 bits)
@@ -196,7 +367,7 @@ static int dma_handle_ch(int ch)
 		csr = dma_chan[ch].saved_csr;
 		dma_chan[ch].saved_csr = 0;
 	} else
-		csr = omap_readw(OMAP_DMA_CSR_REG(ch));
+		csr = omap_readw(OMAP_DMA_CSR(ch));
 	if (enable_1510_mode && ch <= 2 && (csr >> 7) != 0) {
 		dma_chan[ch + 6].saved_csr = csr >> 7;
 		csr &= 0x7f;
@@ -282,9 +453,9 @@ int omap_request_dma(int dev_id, const char *dev_name,
 		}
 		/* Disable the 1510 compatibility mode and set the sync device
 		 * id. */
-		omap_writew(dev_id | (1 << 10), OMAP_DMA_CCR_REG(free_ch));
+		omap_writew(dev_id | (1 << 10), OMAP_DMA_CCR(free_ch));
 	} else {
-		omap_writew(dev_id, OMAP_DMA_CCR_REG(free_ch));
+		omap_writew(dev_id, OMAP_DMA_CCR(free_ch));
 	}
 	*dma_ch_out = free_ch;
 
@@ -305,9 +476,9 @@ void omap_free_dma(int ch)
 	spin_unlock_irqrestore(&dma_chan_lock, flags);
 
 	/* Disable all DMA interrupts for the channel. */
-	omap_writew(0, OMAP_DMA_CICR_REG(ch));
+	omap_writew(0, OMAP_DMA_CICR(ch));
 	/* Make sure the DMA transfer is stopped. */
-	omap_writew(0, OMAP_DMA_CCR_REG(ch));
+	omap_writew(0, OMAP_DMA_CCR(ch));
 }
 
 int omap_dma_in_1510_mode(void)
@@ -315,6 +486,56 @@ int omap_dma_in_1510_mode(void)
 	return enable_1510_mode;
 }
 
+/*
+ * lch_queue DMA will start right after lch_head one is finished.
+ * For this DMA link to start, you still need to start (see omap_start_dma)
+ * the first one. That will fire up the entire queue.
+ */
+void omap_dma_link_lch (int lch_head, int lch_queue)
+{
+	if (omap_dma_in_1510_mode()) {
+		printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
+		BUG();
+		return;
+	}
+
+	if ((dma_chan[lch_head].dev_id == -1) ||
+	    (dma_chan[lch_queue].dev_id == -1)) {
+		printk(KERN_ERR "omap_dma: trying to link non requested channels\n");
+		dump_stack();
+	}
+
+	dma_chan[lch_head].next_lch = lch_queue;
+}
+
+/*
+ * Once the DMA queue is stopped, we can destroy it.
+ */
+void omap_dma_unlink_lch (int lch_head, int lch_queue)
+{
+	if (omap_dma_in_1510_mode()) {
+		printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
+		BUG();
+		return;
+	}
+
+	if (dma_chan[lch_head].next_lch != lch_queue ||
+	    dma_chan[lch_head].next_lch == -1) {
+		printk(KERN_ERR "omap_dma: trying to unlink non linked channels\n");
+		dump_stack();
+	}
+
+
+	if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) ||
+	    (dma_chan[lch_head].flags & OMAP_DMA_ACTIVE)) {
+		printk(KERN_ERR "omap_dma: You need to stop the DMA channels before unlinking\n");
+		dump_stack();
+	}
+
+	dma_chan[lch_head].next_lch = -1;
+	dma_chan[lch_queue].next_lch = -1;
+}
+
 
 static struct lcd_dma_info {
 	spinlock_t lock;
@@ -494,19 +715,19 @@ static int __init omap_init_dma(void)
 		enable_1510_mode = 1;
 	} else if (cpu_is_omap1610() || cpu_is_omap5912()) {
 		printk(KERN_INFO "OMAP DMA hardware version %d\n",
-		       omap_readw(OMAP_DMA_HW_ID_REG));
+		       omap_readw(OMAP_DMA_HW_ID));
 		printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
-		       (omap_readw(OMAP_DMA_CAPS_0_U_REG) << 16) | omap_readw(OMAP_DMA_CAPS_0_L_REG),
-		       (omap_readw(OMAP_DMA_CAPS_1_U_REG) << 16) | omap_readw(OMAP_DMA_CAPS_1_L_REG),
-		       omap_readw(OMAP_DMA_CAPS_2_REG), omap_readw(OMAP_DMA_CAPS_3_REG),
-		       omap_readw(OMAP_DMA_CAPS_4_REG));
+		       (omap_readw(OMAP_DMA_CAPS_0_U) << 16) | omap_readw(OMAP_DMA_CAPS_0_L),
+		       (omap_readw(OMAP_DMA_CAPS_1_U) << 16) | omap_readw(OMAP_DMA_CAPS_1_L),
+		       omap_readw(OMAP_DMA_CAPS_2), omap_readw(OMAP_DMA_CAPS_3),
+		       omap_readw(OMAP_DMA_CAPS_4));
 		if (!enable_1510_mode) {
 			u16 w;
 
 			/* Disable OMAP 3.0/3.1 compatibility mode. */
-			w = omap_readw(OMAP_DMA_GSCR_REG);
+			w = omap_readw(OMAP_DMA_GSCR);
 			w |= 1 << 3;
-			omap_writew(w, OMAP_DMA_GSCR_REG);
+			omap_writew(w, OMAP_DMA_GSCR);
 			dma_chan_count = OMAP_LOGICAL_DMA_CH_COUNT;
 		} else
 			dma_chan_count = 9;
@@ -522,6 +743,8 @@ static int __init omap_init_dma(void)
 
 	for (ch = 0; ch < dma_chan_count; ch++) {
 		dma_chan[ch].dev_id = -1;
+		dma_chan[ch].next_lch = -1;
+
 		if (ch >= 6 && enable_1510_mode)
 			continue;
 
@@ -548,9 +771,23 @@ EXPORT_SYMBOL(omap_request_dma);
 EXPORT_SYMBOL(omap_free_dma);
 EXPORT_SYMBOL(omap_start_dma);
 EXPORT_SYMBOL(omap_stop_dma);
+
 EXPORT_SYMBOL(omap_set_dma_transfer_params);
+EXPORT_SYMBOL(omap_set_dma_constant_fill);
+EXPORT_SYMBOL(omap_set_dma_transparent_copy);
+
 EXPORT_SYMBOL(omap_set_dma_src_params);
+EXPORT_SYMBOL(omap_set_dma_src_index);
+EXPORT_SYMBOL(omap_set_dma_src_data_pack);
+EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
+
 EXPORT_SYMBOL(omap_set_dma_dest_params);
+EXPORT_SYMBOL(omap_set_dma_dest_index);
+EXPORT_SYMBOL(omap_set_dma_dest_data_pack);
+EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
+
+EXPORT_SYMBOL(omap_dma_link_lch);
+EXPORT_SYMBOL(omap_dma_unlink_lch);
 
 EXPORT_SYMBOL(omap_request_lcd_dma);
 EXPORT_SYMBOL(omap_free_lcd_dma);
diff --git a/arch/arm/mach-omap/fpga.c b/arch/arm/mach-omap/fpga.c
index 95b21e2f4..d9246b1dc 100644
--- a/arch/arm/mach-omap/fpga.c
+++ b/arch/arm/mach-omap/fpga.c
@@ -46,11 +46,11 @@ static void fpga_mask_irq(unsigned int irq)
 	irq -= IH_FPGA_BASE;
 
 	if (irq < 8)
-		__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_LO)
-			      & ~(1 << irq)), OMAP1510P1_FPGA_IMR_LO);
+		__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO)
+			      & ~(1 << irq)), OMAP1510_FPGA_IMR_LO);
 	else if (irq < 16)
-		__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_HI)
-			      & ~(1 << (irq - 8))), OMAP1510P1_FPGA_IMR_HI);
+		__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI)
+			      & ~(1 << (irq - 8))), OMAP1510_FPGA_IMR_HI);
 	else
 		__raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2)
 			      & ~(1 << (irq - 16))), INNOVATOR_FPGA_IMR2);
@@ -60,10 +60,10 @@ static void fpga_mask_irq(unsigned int irq)
 static inline u32 get_fpga_unmasked_irqs(void)
 {
 	return
-		((__raw_readb(OMAP1510P1_FPGA_ISR_LO) &
-		  __raw_readb(OMAP1510P1_FPGA_IMR_LO))) |
-		((__raw_readb(OMAP1510P1_FPGA_ISR_HI) &
-		  __raw_readb(OMAP1510P1_FPGA_IMR_HI)) << 8) |
+		((__raw_readb(OMAP1510_FPGA_ISR_LO) &
+		  __raw_readb(OMAP1510_FPGA_IMR_LO))) |
+		((__raw_readb(OMAP1510_FPGA_ISR_HI) &
+		  __raw_readb(OMAP1510_FPGA_IMR_HI)) << 8) |
 		((__raw_readb(INNOVATOR_FPGA_ISR2) &
 		  __raw_readb(INNOVATOR_FPGA_IMR2)) << 16);
 }
@@ -79,11 +79,11 @@ static void fpga_unmask_irq(unsigned int irq)
 	irq -= IH_FPGA_BASE;
 
 	if (irq < 8)
-		__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_LO) | (1 << irq)),
-		     OMAP1510P1_FPGA_IMR_LO);
+		__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)),
+		     OMAP1510_FPGA_IMR_LO);
 	else if (irq < 16)
-		__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_HI)
-			      | (1 << (irq - 8))), OMAP1510P1_FPGA_IMR_HI);
+		__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI)
+			      | (1 << (irq - 8))), OMAP1510_FPGA_IMR_HI);
 	else
 		__raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2)
 			      | (1 << (irq - 16))), INNOVATOR_FPGA_IMR2);
@@ -166,8 +166,8 @@ void fpga_init_irq(void)
 {
 	int i;
 
-	__raw_writeb(0, OMAP1510P1_FPGA_IMR_LO);
-	__raw_writeb(0, OMAP1510P1_FPGA_IMR_HI);
+	__raw_writeb(0, OMAP1510_FPGA_IMR_LO);
+	__raw_writeb(0, OMAP1510_FPGA_IMR_HI);
 	__raw_writeb(0, INNOVATOR_FPGA_IMR2);
 
 	for (i = IH_FPGA_BASE; i < (IH_FPGA_BASE + NR_FPGA_IRQS); i++) {
diff --git a/arch/arm/mach-omap/gpio.c b/arch/arm/mach-omap/gpio.c
index 71141199f..2f052a959 100644
--- a/arch/arm/mach-omap/gpio.c
+++ b/arch/arm/mach-omap/gpio.c
@@ -22,7 +22,6 @@
 #include <asm/irq.h>
 #include <asm/arch/irqs.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/pm.h>
 #include <asm/mach/irq.h>
 
 #include <asm/io.h>
@@ -79,7 +78,7 @@
 #define OMAP730_GPIO_INT_MASK		0x10
 #define OMAP730_GPIO_INT_STATUS		0x14
 
-#define OMAP_MPUIO_MASK         (~OMAP_MAX_GPIO_LINES & 0xff)
+#define OMAP_MPUIO_MASK		(~OMAP_MAX_GPIO_LINES & 0xff)
 
 struct gpio_bank {
 	u32 base;
@@ -213,12 +212,12 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
 		reg += OMAP730_GPIO_DIR_CONTROL;
 		break;
 	}
-	l = omap_readl(reg);
+	l = __raw_readl(reg);
 	if (is_input)
 		l |= 1 << gpio;
 	else
 		l &= ~(1 << gpio);
-	omap_writel(l, reg);
+	__raw_writel(l, reg);
 }
 
 void omap_set_gpio_direction(int gpio, int is_input)
@@ -240,8 +239,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
 
 	switch (bank->method) {
 	case METHOD_MPUIO:
-		reg += OMAP_MPUIO_OUTPUT_REG;
-		l = omap_readl(reg);
+		reg += OMAP_MPUIO_OUTPUT;
+		l = __raw_readl(reg);
 		if (enable)
 			l |= 1 << gpio;
 		else
@@ -249,7 +248,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
 		break;
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_DATA_OUTPUT;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (enable)
 			l |= 1 << gpio;
 		else
@@ -264,7 +263,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
 		break;
 	case METHOD_GPIO_730:
 		reg += OMAP730_GPIO_DATA_OUTPUT;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (enable)
 			l |= 1 << gpio;
 		else
@@ -274,7 +273,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
 		BUG();
 		return;
 	}
-	omap_writel(l, reg);
+	__raw_writel(l, reg);
 }
 
 void omap_set_gpio_dataout(int gpio, int enable)
@@ -312,7 +311,7 @@ int omap_get_gpio_datain(int gpio)
 		BUG();
 		return -1;
 	}
-	return (omap_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
+	return (__raw_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
 }
 
 static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
@@ -322,22 +321,22 @@ static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
 
 	switch (bank->method) {
 	case METHOD_MPUIO:
-		reg += OMAP_MPUIO_GPIO_INT_EDGE_REG;
-		l = omap_readl(reg);
+		reg += OMAP_MPUIO_GPIO_INT_EDGE;
+		l = __raw_readl(reg);
 		if (edge == OMAP_GPIO_RISING_EDGE)
 			l |= 1 << gpio;
 		else
 			l &= ~(1 << gpio);
-		omap_writel(l, reg);
+		__raw_writel(l, reg);
 		break;
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_INT_CONTROL;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (edge == OMAP_GPIO_RISING_EDGE)
 			l |= 1 << gpio;
 		else
 			l &= ~(1 << gpio);
-		omap_writel(l, reg);
+		__raw_writel(l, reg);
 		break;
 	case METHOD_GPIO_1610:
 		edge &= 0x03;
@@ -346,19 +345,19 @@ static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
 		else
 			reg += OMAP1610_GPIO_EDGE_CTRL1;
 		gpio &= 0x07;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		l &= ~(3 << (gpio << 1));
 		l |= edge << (gpio << 1);
-		omap_writel(l, reg);
+		__raw_writel(l, reg);
 		break;
 	case METHOD_GPIO_730:
 		reg += OMAP730_GPIO_INT_CONTROL;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (edge == OMAP_GPIO_RISING_EDGE)
 			l |= 1 << gpio;
 		else
 			l &= ~(1 << gpio);
-		omap_writel(l, reg);
+		__raw_writel(l, reg);
 		break;
 	default:
 		BUG();
@@ -385,11 +384,11 @@ static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
 
 	switch (bank->method) {
 	case METHOD_MPUIO:
-		l = omap_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE_REG);
+		l = __raw_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE);
 		return (l & (1 << gpio)) ?
 			OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
 	case METHOD_GPIO_1510:
-		l = omap_readl(reg + OMAP1510_GPIO_INT_CONTROL);
+		l = __raw_readl(reg + OMAP1510_GPIO_INT_CONTROL);
 		return (l & (1 << gpio)) ?
 			OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
 	case METHOD_GPIO_1610:
@@ -397,9 +396,9 @@ static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
 			reg += OMAP1610_GPIO_EDGE_CTRL2;
 		else
 			reg += OMAP1610_GPIO_EDGE_CTRL1;
-		return (omap_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
+		return (__raw_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
 	case METHOD_GPIO_730:
-		l = omap_readl(reg + OMAP730_GPIO_INT_CONTROL);
+		l = __raw_readl(reg + OMAP730_GPIO_INT_CONTROL);
 		return (l & (1 << gpio)) ?
 			OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
 	default:
@@ -430,7 +429,7 @@ static void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
 		BUG();
 		return;
 	}
-	omap_writel(1 << get_gpio_index(gpio), reg);
+	__raw_writel(1 << get_gpio_index(gpio), reg);
 }
 
 static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
@@ -441,7 +440,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
 	switch (bank->method) {
 	case METHOD_MPUIO:
 		reg += OMAP_MPUIO_GPIO_MASKIT;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (enable)
 			l &= ~(1 << gpio);
 		else
@@ -449,7 +448,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
 		break;
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_INT_MASK;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (enable)
 			l &= ~(1 << gpio);
 		else
@@ -465,7 +464,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
 		break;
 	case METHOD_GPIO_730:
 		reg += OMAP730_GPIO_INT_MASK;
-		l = omap_readl(reg);
+		l = __raw_readl(reg);
 		if (enable)
 			l &= ~(1 << gpio);
 		else
@@ -475,7 +474,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
 		BUG();
 		return;
 	}
-	omap_writel(l, reg);
+	__raw_writel(l, reg);
 }
 
 int omap_request_gpio(int gpio)
@@ -500,7 +499,7 @@ int omap_request_gpio(int gpio)
 
 		/* Claim the pin for the ARM */
 		reg = bank->base + OMAP1510_GPIO_PIN_CONTROL;
-		omap_writel(omap_readl(reg) | (1 << get_gpio_index(gpio)), reg);
+		__raw_writel(__raw_readl(reg) | (1 << get_gpio_index(gpio)), reg);
 	}
 #endif
 	spin_unlock(&bank->lock);
@@ -564,7 +563,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
 		isr_reg = bank->base + OMAP730_GPIO_INT_STATUS;
 #endif
 	for (;;) {
-		u32 isr = omap_readl(isr_reg);
+		u32 isr = __raw_readl(isr_reg);
 		unsigned int gpio_irq;
 
 		if (!isr)
@@ -587,15 +586,15 @@ static void gpio_ack_irq(unsigned int irq)
 
 #ifdef CONFIG_ARCH_OMAP1510
 	if (bank->method == METHOD_GPIO_1510)
-		omap_writew(1 << gpio, bank->base + OMAP1510_GPIO_INT_STATUS);
+		__raw_writew(1 << (gpio & 0x0f), bank->base + OMAP1510_GPIO_INT_STATUS);
 #endif
 #if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912)
 	if (bank->method == METHOD_GPIO_1610)
-		omap_writew(1 << gpio, bank->base + OMAP1610_GPIO_IRQSTATUS1);
+		__raw_writew(1 << (gpio & 0x0f), bank->base + OMAP1610_GPIO_IRQSTATUS1);
 #endif
 #ifdef CONFIG_ARCH_OMAP730
 	if (bank->method == METHOD_GPIO_730)
-		omap_writel(1 << gpio, bank->base + OMAP730_GPIO_INT_STATUS);
+		__raw_writel(1 << (gpio & 0x1f), bank->base + OMAP730_GPIO_INT_STATUS);
 #endif
 }
 
@@ -692,26 +691,27 @@ static int __init _omap_gpio_init(void)
 
 		bank = &gpio_bank[i];
 		bank->reserved_map = 0;
+		bank->base = IO_ADDRESS(bank->base);
 		spin_lock_init(&bank->lock);
 		if (bank->method == METHOD_MPUIO) {
 			omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT);
 		}
 #ifdef CONFIG_ARCH_OMAP1510
 		if (bank->method == METHOD_GPIO_1510) {
-			omap_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
-			omap_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
+			__raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
+			__raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
 		}
 #endif
 #if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912)
 		if (bank->method == METHOD_GPIO_1610) {
-			omap_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
-			omap_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
+			__raw_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
+			__raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
 		}
 #endif
 #ifdef CONFIG_ARCH_OMAP730
 		if (bank->method == METHOD_GPIO_730) {
-			omap_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
-			omap_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
+			__raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
+			__raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
 
 			gpio_count = 32; /* 730 has 32-bit GPIOs */
 		}
@@ -730,9 +730,9 @@ static int __init _omap_gpio_init(void)
 	}
 
 	/* Enable system clock for GPIO module.
-	 * The CAM_CLK_CTRL_REG *is* really the right place. */
+	 * The CAM_CLK_CTRL *is* really the right place. */
 	if (cpu_is_omap1610())
-		omap_writel(omap_readl(ULPD_CAM_CLK_CTRL_REG) | 0x04, ULPD_CAM_CLK_CTRL_REG);
+		omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, ULPD_CAM_CLK_CTRL);
 
 	return 0;
 }
@@ -748,8 +748,11 @@ int omap_gpio_init(void)
 		return 0;
 }
 
-EXPORT_SYMBOL(omap_gpio_init);
 EXPORT_SYMBOL(omap_request_gpio);
 EXPORT_SYMBOL(omap_free_gpio);
+EXPORT_SYMBOL(omap_set_gpio_direction);
+EXPORT_SYMBOL(omap_set_gpio_dataout);
+EXPORT_SYMBOL(omap_get_gpio_datain);
+EXPORT_SYMBOL(omap_set_gpio_edge_ctrl);
 
 arch_initcall(omap_gpio_init);
diff --git a/arch/arm/mach-omap/irq.c b/arch/arm/mach-omap/irq.c
index c2441572a..18da117f6 100644
--- a/arch/arm/mach-omap/irq.c
+++ b/arch/arm/mach-omap/irq.c
@@ -5,6 +5,7 @@
  *
  * Copyright (C) 2004 Nokia Corporation
  * Written by Tony Lindgren <tony@atomide.com>
+ * Major cleanups by Juha Yrjölä <juha.yrjola@nokia.com>
  *
  * Completely re-written to support various OMAP chips with bank specific
  * interrupt handlers.
@@ -49,10 +50,16 @@
 
 #include <asm/io.h>
 
-#include "irq.h"
+#define IRQ_BANK(irq) ((irq) >> 5)
+#define IRQ_BIT(irq)  ((irq) & 0x1f)
 
-static unsigned int banks = 0;
-static struct omap_irq_bank irq_banks[MAX_NR_IRQ_BANKS];
+struct omap_irq_bank {
+	unsigned long base_reg;
+	unsigned long trigger_map;
+};
+
+static unsigned int irq_bank_count = 0;
+static struct omap_irq_bank *irq_banks;
 
 static inline unsigned int irq_bank_readl(int bank, int offset)
 {
@@ -64,94 +71,38 @@ static inline void irq_bank_writel(unsigned long value, int bank, int offset)
 	omap_writel(value, irq_banks[bank].base_reg + offset);
 }
 
-/*
- * Ack routine for chips with register offsets of 0x100
- */
-static void omap_offset_ack_irq(unsigned int irq)
+static void omap_ack_irq(unsigned int irq)
 {
 	if (irq > 31)
-		omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG);
+		omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET);
 
-	omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG);
+	omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET);
 }
 
-/*
- * Mask routine for chips with register offsets of 0x100
- */
-static void omap_offset_mask_irq(unsigned int irq)
+static void omap_mask_irq(unsigned int irq)
 {
-	int bank = IRQ_TO_BANK(irq);
+	int bank = IRQ_BANK(irq);
+	u32 l;
 
-	if (bank) {
-		omap_writel(
-			omap_readl(OMAP_IH2_BASE + BANK_OFFSET(bank) + IRQ_MIR)
-			| (1 << IRQ_BIT(irq)),
-			OMAP_IH2_BASE + BANK_OFFSET(bank) + IRQ_MIR);
-	} else {
-		omap_writel(
-			omap_readl(OMAP_IH1_BASE + IRQ_MIR)
-			| (1 << IRQ_BIT(irq)),
-			OMAP_IH1_BASE  + IRQ_MIR);
-	}
+	l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
+	l |= 1 << IRQ_BIT(irq);
+	omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
 }
 
-/*
- * Unmask routine for chips with register offsets of 0x100
- */
-static void omap_offset_unmask_irq(unsigned int irq)
+static void omap_unmask_irq(unsigned int irq)
 {
-	int bank = IRQ_TO_BANK(irq);
+	int bank = IRQ_BANK(irq);
+	u32 l;
 
-	if (bank) {
-		omap_writel(
-			omap_readl(OMAP_IH2_BASE + BANK_OFFSET(bank) + IRQ_MIR)
-			& ~(1 << IRQ_BIT(irq)),
-			OMAP_IH2_BASE + BANK_OFFSET(bank) + IRQ_MIR);
-	} else {
-		omap_writel(
-			omap_readl(OMAP_IH1_BASE + IRQ_MIR)
-			& ~(1 << IRQ_BIT(irq)),
-			OMAP_IH1_BASE  + IRQ_MIR);
-	}
+	l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
+	l &= ~(1 << IRQ_BIT(irq));
+	omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
 }
 
-static void omap_offset_mask_ack_irq(unsigned int irq)
+static void omap_mask_ack_irq(unsigned int irq)
 {
-	omap_offset_mask_irq(irq);
-	omap_offset_ack_irq(irq);
-}
-
-/*
- * Given the irq number returns the bank number
- */
-signed int irq_get_bank(unsigned int irq)
-{
-	int i;
-
-	for (i = 0; i < banks; i++) {
-		if (irq >= irq_banks[i].start_irq
-		    && irq <= irq_banks[i].start_irq + BANK_NR_IRQS) {
-			return i;
-		}
-	}
-
-	printk(KERN_ERR "No irq handler found for irq %i\n", irq);
-
-	return -ENODEV;
-}
-
-/*
- * Given the bank and irq number returns the irq bit at the bank register
- */
-signed int irq_bank_get_bit(int bank, unsigned int irq)
-{
-	if (irq_banks[bank].start_irq > irq) {
-		printk(KERN_ERR "Incorrect irq %i: bank %i offset %i\n",
-		       irq, bank, irq_banks[bank].start_irq);
-		return -ENODEV;
-	}
-
-	return irq - irq_banks[bank].start_irq;
+	omap_mask_irq(irq);
+	omap_ack_irq(irq);
 }
 
 /*
@@ -161,114 +112,98 @@ signed int irq_bank_get_bit(int bank, unsigned int irq)
  *	 mailing list threads on FIQ handlers if you are planning to
  *	 add a FIQ handler for OMAP.
  */
-void omap_irq_set_cfg(int irq, int fiq, int priority, int irq_level)
+static void omap_irq_set_cfg(int irq, int fiq, int priority, int trigger)
 {
 	signed int bank;
-	unsigned int irq_bit;
 	unsigned long val, offset;
 
-
-	bank = irq_get_bank(irq);
-
-	if (bank < 0)
-		return;
-
-	irq_bit = irq_bank_get_bit(bank, irq);
-
-	if (irq_bit < 0)
-		return;
-
-	/* FIQ is only availabe on bank 0 interrupts */
+	bank = IRQ_BANK(irq);
+	/* FIQ is only available on bank 0 interrupts */
 	fiq = bank ? 0 : (fiq & 0x1);
-
-	val = fiq | ((priority & 0x1f) << 2) | ((irq_level & 0x1) << 1);
-
-	offset = IRQ_ILR0 + irq_bit * 0x4;
-
+	val = fiq | ((priority & 0x1f) << 2) | ((trigger & 0x1) << 1);
+	offset = IRQ_ILR0_REG_OFFSET + IRQ_BIT(irq) * 0x4;
 	irq_bank_writel(val, bank, offset);
 }
 
-static struct omap_irq_desc *irq_bank_desc[] __initdata = {
-	&omap730_bank0_irqs,
-	&omap730_bank1_irqs,
-	&omap730_bank2_irqs,
-	&omap1510_bank0_irqs,
-	&omap1510_bank1_irqs,
-	&omap1610_bank0_irqs,
-	&omap1610_bank1_irqs,
-	&omap1610_bank2_irqs,
-	&omap1610_bank3_irqs,
-	NULL,
+#ifdef CONFIG_ARCH_OMAP730
+static struct omap_irq_bank omap730_irq_banks[] = {
+	{ .base_reg = OMAP_IH1_BASE, 		.trigger_map = 0xb3f8e22f },
+	{ .base_reg = OMAP_IH2_BASE, 		.trigger_map = 0xfdb9c1f2 },
+	{ .base_reg = OMAP_IH2_BASE + 0x100,	.trigger_map = 0x800040f3 },
+};
+#endif
+
+#ifdef CONFIG_ARCH_OMAP1510
+static struct omap_irq_bank omap1510_irq_banks[] = {
+	{ .base_reg = OMAP_IH1_BASE, 		.trigger_map = 0xb3febfff },
+	{ .base_reg = OMAP_IH2_BASE, 		.trigger_map = 0xffbfffed },
+};
+#endif
+
+#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912)
+static struct omap_irq_bank omap1610_irq_banks[] = {
+	{ .base_reg = OMAP_IH1_BASE, 		.trigger_map = 0xb3fefe8f },
+	{ .base_reg = OMAP_IH2_BASE, 		.trigger_map = 0xfffff7ff },
+	{ .base_reg = OMAP_IH2_BASE + 0x100,	.trigger_map = 0xfffff7ff },
+	{ .base_reg = OMAP_IH2_BASE + 0x200,	.trigger_map = 0xffffffff },
+};
+#endif
+
+static struct irqchip omap_irq_chip = {
+	.ack    = omap_mask_ack_irq,
+	.mask   = omap_mask_irq,
+	.unmask = omap_unmask_irq,
 };
 
 void __init omap_init_irq(void)
 {
-	int i,j, board_irq_type = 0, interrupts = 0;
-	struct omap_irq_desc *entry;
+	int i, j;
 
+#ifdef CONFIG_ARCH_OMAP730
 	if (cpu_is_omap730()) {
-		board_irq_type = OMAP_IRQ_TYPE730;
-	} else if (cpu_is_omap1510()) {
-		board_irq_type = OMAP_IRQ_TYPE1510;
-	} else if (cpu_is_omap1610() || cpu_is_omap5912()) {
-		board_irq_type = OMAP_IRQ_TYPE1610;
+		irq_banks = omap730_irq_banks;
+		irq_bank_count = ARRAY_SIZE(omap730_irq_banks);
 	}
-
-	if (board_irq_type == 0) {
-		printk("Could not detect OMAP type\n");
-		return;
+#endif
+#ifdef CONFIG_ARCH_OMAP1510
+	if (cpu_is_omap1510()) {
+		irq_banks = omap1510_irq_banks;
+		irq_bank_count = ARRAY_SIZE(omap1510_irq_banks);
 	}
-
-	/* Scan through the interrupt bank maps and copy the right data */
-	for (i = 0; (entry = irq_bank_desc[i]) != NULL; i++) {
-		if (entry->cpu_type == board_irq_type) {
-			printk("Type %i IRQs from %3i to %3i base at 0x%lx\n",
-			       board_irq_type, entry->start_irq,
-			       entry->start_irq + BANK_NR_IRQS, entry->base_reg);
-
-			irq_banks[banks].start_irq = entry->start_irq;
-			irq_banks[banks].level_map = entry->level_map;
-			irq_banks[banks].base_reg = entry->base_reg;
-			irq_banks[banks].mask_reg = entry->mask_reg;
-			irq_banks[banks].ack_reg = entry->ack_reg;
-			irq_banks[banks].handler = entry->handler;
-
-			interrupts += BANK_NR_IRQS;
-			banks++;
-		}
+#endif
+#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912)
+	if (cpu_is_omap1610() || cpu_is_omap5912()) {
+		irq_banks = omap1610_irq_banks;
+		irq_bank_count = ARRAY_SIZE(omap1610_irq_banks);
 	}
-
-	printk("Found total of %i interrupts in %i interrupt banks\n",
-	       interrupts, banks);
+#endif
+	printk("Total of %i interrupts in %i interrupt banks\n",
+	       irq_bank_count * 32, irq_bank_count);
 
 	/* Mask and clear all interrupts */
-	for (i = 0; i < banks; i++) {
-		irq_bank_writel(~0x0, i, IRQ_MIR);
-		irq_bank_writel(0x0, i, IRQ_ITR);
+	for (i = 0; i < irq_bank_count; i++) {
+		irq_bank_writel(~0x0, i, IRQ_MIR_REG_OFFSET);
+		irq_bank_writel(0x0, i, IRQ_ITR_REG_OFFSET);
 	}
 
-	/*
-	 * Clear any pending interrupts
-	 */
-	irq_bank_writel(3, 0, IRQ_CONTROL_REG);
-	irq_bank_writel(3, 1, IRQ_CONTROL_REG);
+	/* Clear any pending interrupts */
+	irq_bank_writel(0x03, 0, IRQ_CONTROL_REG_OFFSET);
+	irq_bank_writel(0x03, 1, IRQ_CONTROL_REG_OFFSET);
 
 	/* Install the interrupt handlers for each bank */
-	for (i = 0; i < banks; i++) {
-		for (j = irq_banks[i].start_irq;
-		     j <= irq_banks[i].start_irq + BANK_NR_IRQS; j++) {
-			int irq_level;
-			set_irq_chip(j, irq_banks[i].handler);
+	for (i = 0; i < irq_bank_count; i++) {
+		for (j = i * 32; j < (i + 1) * 32; j++) {
+			int irq_trigger;
+
+			irq_trigger = irq_banks[i].trigger_map >> IRQ_BIT(j);
+			omap_irq_set_cfg(j, 0, 0, irq_trigger);
+
+			set_irq_chip(j, &omap_irq_chip);
 			set_irq_handler(j, do_level_IRQ);
 			set_irq_flags(j, IRQF_VALID);
-			irq_level = irq_banks[i].level_map
-				>> (j - irq_banks[i].start_irq) & 1;
-			omap_irq_set_cfg(j, 0, 0, irq_level);
 		}
 	}
 
 	/* Unmask level 2 handler */
-	omap_writel(0, irq_banks[0].mask_reg);
+	omap_unmask_irq(INT_IH2_IRQ);
 }
-
-EXPORT_SYMBOL(omap_irq_set_cfg);
diff --git a/arch/arm/mach-omap/leds-perseus2.c b/arch/arm/mach-omap/leds-perseus2.c
index 7a24b3b20..8dafc0dae 100644
--- a/arch/arm/mach-omap/leds-perseus2.c
+++ b/arch/arm/mach-omap/leds-perseus2.c
@@ -96,7 +96,7 @@ void perseus2_leds_event(led_event_t evt)
 	/*
 	 *  Actually burn the LEDs
 	 */
-	omap_writew(~hw_led_state & 0xffff, OMAP730_FPGA_LEDS);
+	__raw_writew(~hw_led_state & 0xffff, OMAP730_FPGA_LEDS);
 
 	local_irq_restore(flags);
 }
diff --git a/arch/arm/mach-omap/ocpi.c b/arch/arm/mach-omap/ocpi.c
index e7087bc24..944c29418 100644
--- a/arch/arm/mach-omap/ocpi.c
+++ b/arch/arm/mach-omap/ocpi.c
@@ -85,14 +85,6 @@ int ocpi_enable(void)
 	val &= ~0xff;
 	omap_writel(val, OCPI_SEC);
 
-	val = omap_readl(OCPI_SEC);
-	val |= 0;
-	omap_writel(val, OCPI_SEC);
-
-	val = omap_readl(OCPI_SINT0);
-	val |= 0;
-	omap_writel(val, OCPI_SINT1);
-
 	return 0;
 }
 EXPORT_SYMBOL(ocpi_enable);
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 96ce47e19..d394f6957 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -1,13 +1,35 @@
+if ARCH_PXA
 
-menu "Intel PXA250/210 Implementations"
+menu "Intel PXA2xx Implementations"
+
+choice
+	prompt "Select target board"
 
 config ARCH_LUBBOCK
 	bool "Intel DBPXA250 Development Platform"
-	depends on ARCH_PXA
+	select PXA25x
+
+config MACH_MAINSTONE
+	bool "Intel HCDDBBVA0 Development Platform"
+	select PXA27x
+	#select IWMMXT
 
 config ARCH_PXA_IDP
 	bool "Accelent Xscale IDP"
-	depends on ARCH_PXA
+	select PXA25x
+
+endchoice
 
 endmenu
 
+config PXA25x
+	bool
+	help
+	  Select code specific to PXA21x/25x/26x variants
+
+config PXA27x
+	bool
+	help
+	  Select code specific to PXA27x variants
+
+endif
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 5763fb979..cc33a4767 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -4,14 +4,18 @@
 
 # Common support (must be linked before board specific support)
 obj-y += generic.o irq.o dma.o
+obj-$(CONFIG_PXA25x) += pxa25x.o
+obj-$(CONFIG_PXA27x) += pxa27x.o
 
 # Specific board support
 obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
+obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
 obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
 
 # Support for blinky lights
 led-y := leds.o
 led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
+led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o
 led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
 
 obj-$(CONFIG_LEDS) += $(led-y)
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c
index a16d69ab8..3096fa7c5 100644
--- a/arch/arm/mach-pxa/dma.c
+++ b/arch/arm/mach-pxa/dma.c
@@ -28,7 +28,7 @@ static struct dma_channel {
 	char *name;
 	void (*irq_handler)(int, void *, struct pt_regs *);
 	void *data;
-} dma_channels[16];
+} dma_channels[PXA_DMA_CHANNELS];
 
 
 int pxa_request_dma (char *name, pxa_dma_prio prio,
@@ -45,7 +45,7 @@ int pxa_request_dma (char *name, pxa_dma_prio prio,
 	local_irq_save(flags);
 
 	/* try grabbing a DMA channel with the requested priority */
-	for (i = prio; i < prio + (prio == DMA_PRIO_LOW) ? 8 : 4; i++) {
+	for (i = prio; i < prio + PXA_DMA_NBCH(prio); i++) {
 		if (!dma_channels[i].name) {
 			found = 1;
 			break;
@@ -97,7 +97,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int i, dint = DINT;
 
-	for (i = 0; i < 16; i++) {
+	for (i = 0; i < PXA_DMA_CHANNELS; i++) {
 		if (dint & (1 << i)) {
 			struct dma_channel *channel = &dma_channels[i];
 			if (channel->name && channel->irq_handler) {
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 5f6b151ff..24f3da29d 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -31,76 +31,10 @@
 #include <asm/mach/map.h>
 
 #include <asm/arch/udc.h>
+#include <asm/arch/pxafb.h>
 
 #include "generic.h"
 
-/*
- * Various clock factors driven by the CCCR register.
- */
-
-/* Crystal Frequency to Memory Frequency Multiplier (L) */
-static unsigned char L_clk_mult[32] = { 0, 27, 32, 36, 40, 45, 0, };
-
-/* Memory Frequency to Run Mode Frequency Multiplier (M) */
-static unsigned char M_clk_mult[4] = { 0, 1, 2, 4 };
-
-/* Run Mode Frequency to Turbo Mode Frequency Multiplier (N) */
-/* Note: we store the value N * 2 here. */
-static unsigned char N2_clk_mult[8] = { 0, 0, 2, 3, 4, 0, 6, 0 };
-
-/* Crystal clock */
-#define BASE_CLK	3686400
-
-/*
- * Get the clock frequency as reflected by CCCR and the turbo flag.
- * We assume these values have been applied via a fcs.
- * If info is not 0 we also display the current settings.
- */
-unsigned int get_clk_frequency_khz(int info)
-{
-	unsigned long cccr, turbo;
-	unsigned int l, L, m, M, n2, N;
-
-	cccr = CCCR;
-	asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
-
-	l  =  L_clk_mult[(cccr >> 0) & 0x1f];
-	m  =  M_clk_mult[(cccr >> 5) & 0x03];
-	n2 = N2_clk_mult[(cccr >> 7) & 0x07];
-
-	L = l * BASE_CLK;
-	M = m * L;
-	N = n2 * M / 2;
-
-	if(info)
-	{
-		L += 5000;
-		printk( KERN_INFO "Memory clock: %d.%02dMHz (*%d)\n",
-			L / 1000000, (L % 1000000) / 10000, l );
-		M += 5000;
-		printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
-			M / 1000000, (M % 1000000) / 10000, m );
-		N += 5000;
-		printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
-			N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5,
-			(turbo & 1) ? "" : "in" );
-	}
-
-	return (turbo & 1) ? (N/1000) : (M/1000);
-}
-
-EXPORT_SYMBOL(get_clk_frequency_khz);
-
-/*
- * Return the current lclk requency in units of 10kHz
- */
-unsigned int get_lclk_frequency_10khz(void)
-{
-	return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000;
-}
-
-EXPORT_SYMBOL(get_lclk_frequency_10khz);
-
 /*
  * Handy function to set GPIO alternate functions
  */
@@ -125,16 +59,21 @@ void pxa_gpio_mode(int gpio_mode)
 EXPORT_SYMBOL(pxa_gpio_mode);
 
 /*
- * Note that 0xfffe0000-0xffffffff is reserved for the vector table and
- * cache flush area.
+ * Intel PXA2xx internal register mapping.
+ *
+ * Note 1: not all PXA2xx variants implement all those addresses.
+ *
+ * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table
+ *         and cache flush area.
  */
 static struct map_desc standard_io_desc[] __initdata = {
  /* virtual     physical    length      type */
-  { 0xf6000000, 0x20000000, 0x01000000, MT_DEVICE }, /* PCMCIA0 IO */
-  { 0xf7000000, 0x30000000, 0x01000000, MT_DEVICE }, /* PCMCIA1 IO */
-  { 0xf8000000, 0x40000000, 0x01400000, MT_DEVICE }, /* Devs */
-  { 0xfa000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */
-  { 0xfc000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */
+  { 0xf2000000, 0x40000000, 0x01800000, MT_DEVICE }, /* Devs */
+  { 0xf4000000, 0x44000000, 0x00100000, MT_DEVICE }, /* LCD */
+  { 0xf6000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Mem Ctl */
+  { 0xf8000000, 0x4c000000, 0x00100000, MT_DEVICE }, /* USB host */
+  { 0xfa000000, 0x50000000, 0x00100000, MT_DEVICE }, /* Camera */
+  { 0xfe000000, 0x58000000, 0x00100000, MT_DEVICE }, /* IMem ctl */
   { 0xff000000, 0x00000000, 0x00100000, MT_DEVICE }  /* UNCACHED_PHYS_0 */
 };
 
@@ -165,6 +104,7 @@ static struct platform_device pxamci_device = {
 	.id		= 0,
 	.dev		= {
 		.dma_mask = &pxamci_dmamask,
+		.coherent_dma_mask = 0xffffffff,
 	},
 	.num_resources	= ARRAY_SIZE(pxamci_resources),
 	.resource	= pxamci_resources,
@@ -205,9 +145,45 @@ static struct platform_device udc_device = {
 	}
 };
 
+static struct pxafb_mach_info pxa_fb_info;
+
+void __init set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info)
+{
+	memcpy(&pxa_fb_info,hard_pxa_fb_info,sizeof(struct pxafb_mach_info));
+}
+EXPORT_SYMBOL(set_pxa_fb_info);
+
+static struct resource pxafb_resources[] = {
+	[0] = {
+		.start	= 0x44000000,
+		.end	= 0x4400ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_LCD,
+		.end	= IRQ_LCD,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static u64 fb_dma_mask = ~(u64)0;
+
+static struct platform_device pxafb_device = {
+	.name		= "pxafb",
+	.id		= 0,
+	.dev		= {
+ 		.platform_data	= &pxa_fb_info,
+		.dma_mask	= &fb_dma_mask,
+		.coherent_dma_mask = 0xffffffff,
+	},
+	.num_resources	= ARRAY_SIZE(pxafb_resources),
+	.resource	= pxafb_resources,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&pxamci_device,
 	&udc_device,
+	&pxafb_device,
 };
 
 static int __init pxa_init(void)
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 5e6468a5a..706858ea2 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -27,6 +27,8 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
+#include <asm/arch/idp.h>
+
 #include "generic.h"
 
 #ifndef PXA_IDP_REV02
diff --git a/arch/arm/mach-pxa/leds-idp.c b/arch/arm/mach-pxa/leds-idp.c
index 8f9d2c3c7..adb108c6c 100644
--- a/arch/arm/mach-pxa/leds-idp.c
+++ b/arch/arm/mach-pxa/leds-idp.c
@@ -19,6 +19,8 @@
 #include <asm/leds.h>
 #include <asm/system.h>
 
+#include <asm/arch/idp.h>
+
 #include "leds.h"
 
 #define LED_STATE_ENABLED	1
diff --git a/arch/arm/mach-pxa/leds-lubbock.c b/arch/arm/mach-pxa/leds-lubbock.c
index 03899b588..0e083b34e 100644
--- a/arch/arm/mach-pxa/leds-lubbock.c
+++ b/arch/arm/mach-pxa/leds-lubbock.c
@@ -17,6 +17,7 @@
 #include <asm/hardware.h>
 #include <asm/leds.h>
 #include <asm/system.h>
+#include <asm/arch/lubbock.h>
 
 #include "leds.h"
 
@@ -88,7 +89,7 @@ void lubbock_leds_event(led_event_t evt)
 		break;
 
 	case led_green_on:
-		hw_led_state |= D21;;
+		hw_led_state |= D21;
 		break;
 
 	case led_green_off:
@@ -96,7 +97,7 @@ void lubbock_leds_event(led_event_t evt)
 		break;
 
 	case led_amber_on:
-		hw_led_state |= D22;;
+		hw_led_state |= D22;
 		break;
 
 	case led_amber_off:
@@ -104,7 +105,7 @@ void lubbock_leds_event(led_event_t evt)
 		break;
 
 	case led_red_on:
-		hw_led_state |= D23;;
+		hw_led_state |= D23;
 		break;
 
 	case led_red_off:
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
index cb6f6ddb0..8403f6780 100644
--- a/arch/arm/mach-pxa/leds-mainstone.c
+++ b/arch/arm/mach-pxa/leds-mainstone.c
@@ -17,6 +17,8 @@
 #include <asm/leds.h>
 #include <asm/system.h>
 
+#include <asm/arch/mainstone.h>
+
 #include "leds.h"
 
 
diff --git a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c
index 2f51b6b6c..bbe4d5f6a 100644
--- a/arch/arm/mach-pxa/leds.c
+++ b/arch/arm/mach-pxa/leds.c
@@ -20,6 +20,8 @@ pxa_leds_init(void)
 {
 	if (machine_is_lubbock())
 		leds_event = lubbock_leds_event;
+	if (machine_is_mainstone())
+		leds_event = mainstone_leds_event;
 	if (machine_is_pxa_idp())
 		leds_event = idp_leds_event;
 
diff --git a/arch/arm/mach-pxa/leds.h b/arch/arm/mach-pxa/leds.h
index 2a7df0505..d98f6e93c 100644
--- a/arch/arm/mach-pxa/leds.h
+++ b/arch/arm/mach-pxa/leds.h
@@ -7,5 +7,6 @@
  *
  */
 
-extern void lubbock_leds_event(led_event_t evt);
 extern void idp_leds_event(led_event_t evt);
+extern void lubbock_leds_event(led_event_t evt);
+extern void mainstone_leds_event(led_event_t evt);
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 4a5cf96c5..023c5e9f3 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -11,11 +11,12 @@
  *  it under the terms of the GNU General Public License version 2 as
  *  published by the Free Software Foundation.
  */
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/major.h>
-#include <linux/fs.h>
+#include <linux/fb.h>
 #include <linux/interrupt.h>
 
 #include <asm/setup.h>
@@ -28,12 +29,24 @@
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 
+#include <asm/arch/lubbock.h>
 #include <asm/arch/udc.h>
+#include <asm/arch/pxafb.h>
 #include <asm/hardware/sa1111.h>
 
 #include "generic.h"
 
 
+void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	LUB_MISC_WR = (LUB_MISC_WR & ~mask) | (set & mask);
+	local_irq_restore(flags);
+}
+EXPORT_SYMBOL(lubbock_set_misc_wr);
+
 static unsigned long lubbock_irq_enabled;
 
 static void lubbock_mask_irq(unsigned int irq)
@@ -148,9 +161,29 @@ static struct platform_device *devices[] __initdata = {
 	&smc91x_device,
 };
 
+static struct pxafb_mach_info sharp_lm8v31 __initdata = {
+	.pixclock	= 270000,
+	.xres		= 640,
+	.yres		= 480,
+	.bpp		= 16,
+	.hsync_len	= 1,
+	.left_margin	= 3,
+	.right_margin	= 3,
+	.vsync_len	= 1,
+	.upper_margin	= 0,
+	.lower_margin	= 0,
+	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+	.cmap_greyscale	= 0,
+	.cmap_inverse	= 0,
+	.cmap_static	= 0,
+	.lccr0		= LCCR0_SDS,
+	.lccr3		= LCCR3_PCP | LCCR3_Acb(255),
+};
+
 static void __init lubbock_init(void)
 {
 	pxa_set_udc_info(&udc_info);
+	set_pxa_fb_info(&sharp_lm8v31);
 	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index cd7da1ddf..663c1eef8 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -30,6 +30,8 @@
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 
+#include <asm/arch/mainstone.h>
+
 #include "generic.h"
 
 
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index b1103400b..245e25b08 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -19,6 +19,7 @@
 #include <asm/hardware.h>
 #include <asm/memory.h>
 #include <asm/system.h>
+#include <asm/arch/lubbock.h>
 
 
 /*
@@ -32,6 +33,11 @@ extern void pxa_cpu_resume(void);
 #define SAVE(x)		sleep_save[SLEEP_SAVE_##x] = x
 #define RESTORE(x)	x = sleep_save[SLEEP_SAVE_##x]
 
+#define RESTORE_GPLEVEL(n) do { \
+	GPSR##n = sleep_save[SLEEP_SAVE_GPLR##n]; \
+	GPCR##n = ~sleep_save[SLEEP_SAVE_GPLR##n]; \
+} while (0)
+
 /*
  * List of global PXA peripheral registers to preserve.
  * More ones like CP and general purpose register values are preserved
@@ -42,16 +48,13 @@ enum {	SLEEP_SAVE_START = 0,
 	SLEEP_SAVE_OSCR, SLEEP_SAVE_OIER,
 	SLEEP_SAVE_OSMR0, SLEEP_SAVE_OSMR1, SLEEP_SAVE_OSMR2, SLEEP_SAVE_OSMR3,
 
+	SLEEP_SAVE_GPLR0, SLEEP_SAVE_GPLR1, SLEEP_SAVE_GPLR2,
 	SLEEP_SAVE_GPDR0, SLEEP_SAVE_GPDR1, SLEEP_SAVE_GPDR2,
 	SLEEP_SAVE_GRER0, SLEEP_SAVE_GRER1, SLEEP_SAVE_GRER2,
 	SLEEP_SAVE_GFER0, SLEEP_SAVE_GFER1, SLEEP_SAVE_GFER2,
 	SLEEP_SAVE_GAFR0_L, SLEEP_SAVE_GAFR1_L, SLEEP_SAVE_GAFR2_L,
 	SLEEP_SAVE_GAFR0_U, SLEEP_SAVE_GAFR1_U, SLEEP_SAVE_GAFR2_U,
 
-	SLEEP_SAVE_FFIER, SLEEP_SAVE_FFLCR, SLEEP_SAVE_FFMCR,
-	SLEEP_SAVE_FFSPR, SLEEP_SAVE_FFISR,
-	SLEEP_SAVE_FFDLL, SLEEP_SAVE_FFDLH,
-
 	SLEEP_SAVE_ICMR,
 	SLEEP_SAVE_CKEN,
 
@@ -74,21 +77,6 @@ static int pxa_pm_enter(u32 state)
 	/* preserve current time */
 	delta = xtime.tv_sec - RCNR;
 
-	/*
-	 * Temporary solution.  This won't be necessary once
-	 * we move pxa support into the serial driver
-	 * Save the FF UART
-	 */
-	SAVE(FFIER);
-	SAVE(FFLCR);
-	SAVE(FFMCR);
-	SAVE(FFSPR);
-	SAVE(FFISR);
-	FFLCR |= 0x80;
-	SAVE(FFDLL);
-	SAVE(FFDLH);
-	FFLCR &= 0xef;
-
 	/* save vital registers */
 	SAVE(OSCR);
 	SAVE(OSMR0);
@@ -97,6 +85,7 @@ static int pxa_pm_enter(u32 state)
 	SAVE(OSMR3);
 	SAVE(OIER);
 
+	SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2);
 	SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2);
 	SAVE(GRER0); SAVE(GRER1); SAVE(GRER2);
 	SAVE(GFER0); SAVE(GFER1); SAVE(GFER2);
@@ -146,14 +135,15 @@ static int pxa_pm_enter(u32 state)
 	PSPR = 0;
 
 	/* restore registers */
-	RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2);
-	RESTORE(GRER0); RESTORE(GRER1); RESTORE(GRER2);
-	RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2);
 	RESTORE(GAFR0_L); RESTORE(GAFR0_U);
 	RESTORE(GAFR1_L); RESTORE(GAFR1_U);
 	RESTORE(GAFR2_L); RESTORE(GAFR2_U);
+	RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2);
+	RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2);
+	RESTORE(GRER0); RESTORE(GRER1); RESTORE(GRER2);
+	RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2);
 
-	PSSR = PSSR_PH;
+	PSSR = PSSR_RDH | PSSR_PH;
 
 	RESTORE(OSMR0);
 	RESTORE(OSMR1);
@@ -168,22 +158,6 @@ static int pxa_pm_enter(u32 state)
 	ICCR = 1;
 	RESTORE(ICMR);
 
-	/*
-	 * Temporary solution.  This won't be necessary once
-	 * we move pxa support into the serial driver.
-	 * Restore the FF UART.
-	 */
-	RESTORE(FFMCR);
-	RESTORE(FFSPR);
-	RESTORE(FFLCR);
-	FFLCR |= 0x80;
-	RESTORE(FFDLH);
-	RESTORE(FFDLL);
-	RESTORE(FFLCR);
-	RESTORE(FFISR);
-	FFFCR = 0x07;
-	RESTORE(FFIER);
-
 	/* restore current time */
 	xtime.tv_sec = RCNR + delta;
 
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index f57c96222..41150917f 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -83,12 +83,21 @@ unsigned int get_clk_frequency_khz(int info)
 EXPORT_SYMBOL(get_clk_frequency_khz);
 
 /*
- * Return the current lclk requency in units of 10kHz
+ * Return the current memory clock frequency in units of 10kHz
  */
-unsigned int get_lclk_frequency_10khz(void)
+unsigned int get_memclk_frequency_10khz(void)
 {
 	return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000;
 }
 
-EXPORT_SYMBOL(get_lclk_frequency_10khz);
+EXPORT_SYMBOL(get_memclk_frequency_10khz);
 
+/*
+ * Return the current LCD clock frequency in units of 10kHz
+ */
+unsigned int get_lcdclk_frequency_10khz(void)
+{
+	return get_memclk_frequency_10khz();
+}
+
+EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 1addceb0f..b1573c837 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -21,100 +21,98 @@
 
 #include "generic.h"
 
-/* Crystal clock : 13-MHZ*/
+/* Crystal clock: 13MHz */
 #define BASE_CLK	13000000
 
 /*
  * Get the clock frequency as reflected by CCSR and the turbo flag.
  * We assume these values have been applied via a fcs.
  * If info is not 0 we also display the current settings.
- *
- * For more details, refer to Bulverde Manual, section 3.8.2.1
  */
 unsigned int get_clk_frequency_khz( int info)
 {
-	unsigned long ccsr, turbo, b, ht;
-	unsigned int l, L, m, M, n2, N, S, cccra;
+	unsigned long ccsr, clkcfg;
+	unsigned int l, L, m, M, n2, N, S;
+       	int cccr_a, t, ht, b;
 
 	ccsr = CCSR;
-	cccra = CCCR & (0x1 << 25);
+	cccr_a = CCCR & (1 << 25);
 
 	/* Read clkcfg register: it has turbo, b, half-turbo (and f) */
-	asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
-	b = (turbo & (0x1 << 3));
-	ht = (turbo & (0x1 << 2));
+	asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
+	t  = clkcfg & (1 << 1);
+	ht = clkcfg & (1 << 2);
+	b  = clkcfg & (1 << 3);
 
 	l  = ccsr & 0x1f;
 	n2 = (ccsr>>7) & 0xf;
-	if (l == 31) {
-		/* The calculation from the Yellow Book is incorrect:
-		   it says M=4 for L=21-30 (which is easy to calculate
-		   by subtracting 1 and then dividing by 10, but not
-		   with 31, so we'll do it manually */
-		m = 1 << 2;
-	} else {
-		m = 1 << ((l-1)/10);
-	}
+	m  = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
 
-	L = l * BASE_CLK;
-	N = (n2 * L) / 2;
-	S = (b) ? L : (L/2);
-	if (cccra == 0)
-		M = L/m;
-	else
-		M = (b) ? L : (L/2);
+	L  = l * BASE_CLK;
+	N  = (L * n2) / 2;
+	M  = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
+	S  = (b) ? L : (L/2);
 
 	if (info) {
 		printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
 			L / 1000000, (L % 1000000) / 10000, l );
-		printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
-			M / 1000000, (M % 1000000) / 10000, m );
 		printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
 			N / 1000000, (N % 1000000)/10000, n2 / 2, (n2 % 2)*5,
-			(turbo & 1) ? "" : "in" );
+			(t) ? "" : "in" );
+		printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
+			M / 1000000, (M % 1000000) / 10000, m );
 		printk( KERN_INFO "System bus clock: %d.%02dMHz \n",
 			S / 1000000, (S % 1000000) / 10000 );
 	}
 
-	return (turbo & 1) ? (N/1000) : (L/1000);
+	return (t) ? (N/1000) : (L/1000);
 }
 
 /*
  * Return the current mem clock frequency in units of 10kHz as
  * reflected by CCCR[A], B, and L
  */
-unsigned int get_lclk_frequency_10khz(void)
+unsigned int get_memclk_frequency_10khz(void)
 {
-	unsigned long ccsr, clkcfg, b;
-	unsigned int l, L, m, M, cccra;
+	unsigned long ccsr, clkcfg;
+	unsigned int l, L, m, M;
+       	int cccr_a, b;
 
-	cccra = CCCR & (0x1 << 25);
+	ccsr = CCSR;
+	cccr_a = CCCR & (1 << 25);
 
-	/* Read clkcfg register to obtain b */
+	/* Read clkcfg register: it has turbo, b, half-turbo (and f) */
 	asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
-	b = (clkcfg & (0x1 << 3));
+	b = clkcfg & (1 << 3);
 
-	ccsr = CCSR;
-	l  =  ccsr & 0x1f;
-	if (l == 31) {
-		/* The calculation from the Yellow Book is incorrect:
-		   it says M=4 for L=21-30 (which is easy to calculate
-		   by subtracting 1 and then dividing by 10, but not
-		   with 31, so we'll do it manually */
-		m = 1 << 2;
-	} else {
-		m = 1 << ((l-1)/10);
-	}
+	l = ccsr & 0x1f;
+	m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
 
 	L = l * BASE_CLK;
-	if (cccra == 0)
-		M = L/m;
-	else
-		M = (b) ? L : L/2;
+	M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
 
 	return (M / 10000);
 }
 
-EXPORT_SYMBOL(get_clk_frequency_khz);
-EXPORT_SYMBOL(get_lclk_frequency_10khz);
+/*
+ * Return the current LCD clock frequency in units of 10kHz as
+ */
+unsigned int get_lcdclk_frequency_10khz(void)
+{
+	unsigned long ccsr;
+	unsigned int l, L, k, K;
+
+	ccsr = CCSR;
 
+	l = ccsr & 0x1f;
+	k = (l <= 7) ? 1 : (l <= 16) ? 2 : 4;
+
+	L = l * BASE_CLK;
+	K = L / k;
+
+	return (K / 10000);
+}
+
+EXPORT_SYMBOL(get_clk_frequency_khz);
+EXPORT_SYMBOL(get_memclk_frequency_10khz);
+EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 867017767..b71f89e11 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -1,8 +1,9 @@
+if ARCH_S3C2410
+
 menu "S3C2410 Implementations"
 
 config ARCH_BAST
 	bool "Simtec Electronics BAST (EB2410ITX)"
-	depends on ARCH_S3C2410
 	help
 	  Say Y here if you are using the Simtec Electronics EB2410ITX
 	  development board (also known as BAST)
@@ -11,15 +12,21 @@ config ARCH_BAST
 
 config ARCH_H1940
 	bool "IPAQ H1940"
-	depends on ARCH_S3C2410
 	help
 	  Say Y here if you are using the HP IPAQ H1940
 	  <http://www.handhelds.org/projects/h1940.html>.
 
+config ARCH_SMDK2410
+	bool "SMDK2410/A9M2410"
+	help
+	   Say Y here if you are using the SMDK2410 or the derived module A9M2410
+           <http://www.fsforth.de>
+
 config MACH_VR1000
 	bool "Simtec VR1000"
-	depends on ARCH_S3C2410
 	help
 	  Say Y here if you are using the Simtec VR1000 board.
 
 endmenu
+
+endif
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index d1848835c..d36316999 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -12,6 +12,7 @@ obj-			:=
 obj-$(CONFIG_ARCH_BAST)    += mach-bast.o
 obj-$(CONFIG_MACH_H1940)   += mach-h1940.o
 obj-$(CONFIG_ARCH_H1940)   += mach-h1940.o
+obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o
 obj-$(CONFIG_MACH_VR1000)  += mach-vr1000.o
 
 #obj-$(CONFIG_PCI)	+=$(pci-y)
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index 95e5200cd..bfd843cef 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -31,7 +31,6 @@
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/mach-types.h>
 
 #include <asm/arch/regs-clock.h>
 #include <asm/arch/regs-serial.h>
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 6d9249bfc..ce21b9838 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -1,9 +1,9 @@
+if ARCH_SA1100
 
 menu "SA11x0 Implementations"
 
 config SA1100_ASSABET
 	bool "Assabet"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
 	  Microprocessor Development Board (also known as the Assabet).
@@ -18,7 +18,6 @@ config ASSABET_NEPONSET
 
 config SA1100_ADSBITSY
 	bool "ADS Bitsy"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using Applied Data Systems Intel(R)
 	  StrongARM(R) 1110 based Bitsy, 3 x 5 inches in size, Compaq - IPAQ -
@@ -28,14 +27,12 @@ config SA1100_ADSBITSY
 
 config SA1100_BRUTUS
 	bool "Brutus"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using the Intel(R) StrongARM(R) SA-1100
 	  Microprocessor Development Board (also known as the Brutus).
 
 config SA1100_CERF
 	bool "CerfBoard"
-	depends on ARCH_SA1100
 	help
 	  The Intrinsyc CerfBoard is based on the StrongARM 1110 (Discontinued).
 	  More information is available at:
@@ -62,7 +59,6 @@ endchoice
 
 config SA1100_H3100
 	bool "Compaq iPAQ H3100"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you intend to run this kernel on the Compaq iPAQ
 	  H3100 handheld computer.  Information about this machine and the
@@ -73,7 +69,6 @@ config SA1100_H3100
 
 config SA1100_H3600
 	bool "Compaq iPAQ H3600/H3700"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you intend to run this kernel on the Compaq iPAQ
 	  H3600 handheld computer.  Information about this machine and the
@@ -84,7 +79,6 @@ config SA1100_H3600
 
 config SA1100_H3800
 	bool "Compaq iPAQ H3800"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you intend to run this kernel on the Compaq iPAQ H3800
 	  series handheld computer.  Information about this machine and the
@@ -102,7 +96,6 @@ config SA1100_H3XXX
 #dep_bool '  Empeg' CONFIG_SA1100_EMPEG $CONFIG_ARCH_SA1100
 config SA1100_EXTENEX1
 	bool "Extenex HandHeld Theater (Squashtail)"
-	depends on ARCH_SA1100
 
 config SA1100_EXTENEX1_16MB
 	bool "Support 16 MB of DRAM (not just 8)"
@@ -110,7 +103,6 @@ config SA1100_EXTENEX1_16MB
 
 config SA1100_FLEXANET
 	bool "FlexaNet"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you intend to run this kernel on the FlexaNet
 	  handheld instruments. Information about this machine can be
@@ -118,14 +110,12 @@ config SA1100_FLEXANET
 
 config SA1100_FREEBIRD
 	bool "FreeBird-v1.1"
-	depends on ARCH_SA1100
 	help
 	  Support the FreeBird board used in Coventive embedded products.  See
 	  Documentation/arm/SA1100/Freebird for more.
 
 config SA1100_GRAPHICSCLIENT
 	bool "GraphicsClient Plus"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using an Applied Data Systems Intel(R)
 	  StrongARM(R) SA-1100 based Graphics Client SBC.  See
@@ -133,7 +123,6 @@ config SA1100_GRAPHICSCLIENT
 
 config SA1100_GRAPHICSMASTER
 	bool "GraphicsMaster"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using an Applied Data Systems Intel(R)
 	  StrongARM(R) SA-1100 based Graphics Master SBC with SA-1111
@@ -143,14 +132,12 @@ config SA1100_GRAPHICSMASTER
 
 config SA1100_BADGE4
 	bool "HP Labs BadgePAD 4"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you want to build a kernel for the HP Laboratories
 	  BadgePAD 4.
 
 config SA1100_JORNADA720
 	bool "HP Jornada 720"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you want to build a kernel for the HP Jornada 720
 	  handheld computer.  See <http://www.hp.com/jornada/products/720>
@@ -158,14 +145,12 @@ config SA1100_JORNADA720
 
 config SA1100_HACKKIT
 	bool "HackKit Core CPU Board"
-	depends on ARCH_SA1100
 	help
 	  Say Y here to support the HackKit Core CPU Board
 	  <http://hackkit.eletztrick.de>;
 
 config SA1100_HUW_WEBPANEL
 	bool "HuW WebPanel"
-	depends on ARCH_SA1100
 	help
 	  Say Y here to support the HuW Webpanel produced by Hoeft & Wessel
 	  AG.  English-language website is at
@@ -174,7 +159,6 @@ config SA1100_HUW_WEBPANEL
 
 config SA1100_ITSY
 	bool "Itsy"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using the Compaq Itsy experimental pocket
 	  computer. See <http://research.compaq.com/wrl/projects/itsy/> for
@@ -182,7 +166,6 @@ config SA1100_ITSY
 
 config SA1100_LART
 	bool "LART"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using the Linux Advanced Radio Terminal
 	  (also known as the LART).  See <http://www.lart.tudelft.nl/> for
@@ -190,7 +173,6 @@ config SA1100_LART
 
 config SA1100_NANOENGINE
 	bool "nanoEngine"
-	depends on ARCH_SA1100
 	help
 	  The nanoEngine is a StrongARM 1110-based single board computer
 	  from Bright Star Engineering. More information is available at:
@@ -201,14 +183,12 @@ config SA1100_NANOENGINE
 
 config SA1100_OMNIMETER
 	bool "OmniMeter"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using the inhand electronics OmniMeter.  See
 	  <http://www.inhandelectronics.com/omnimeter.asp> for details.
 
 config SA1100_PANGOLIN
 	bool "Pangolin"
-	depends on ARCH_SA1100
 	help
 	  Pangolin is a StrongARM 1110-based evaluation platform produced
 	  by Dialogue Technology.  It has EISA slots for ease of configuration
@@ -220,7 +200,6 @@ config SA1100_PANGOLIN
 
 config SA1100_PLEB
 	bool "PLEB"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using a Portable Linux Embedded Board
 	  (also known as PLEB). See <http://www.cse.unsw.edu.au/~pleb/>
@@ -228,7 +207,6 @@ config SA1100_PLEB
 
 config SA1100_PT_SYSTEM3
 	bool "PT System 3"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you intend to build a kernel suitable to run on
 	  a Pruftechnik Digital Board. For more information see
@@ -236,7 +214,6 @@ config SA1100_PT_SYSTEM3
 
 config SA1100_SHANNON
 	bool "Shannon"
-	depends on ARCH_SA1100
 	help
 	  The Shannon (also known as a Tuxscreen, and also as a IS2630) was a
 	  limited edition webphone produced by Philips. The Shannon is a SA1100
@@ -245,7 +222,6 @@ config SA1100_SHANNON
 
 config SA1100_SHERMAN
 	bool "Sherman"
-	depends on ARCH_SA1100
 	help
 	  Say Y here to support the Blazie Engineering `Sherman' StrongARM
 	  1110-based SBC, used primarily in assistance products for the
@@ -255,7 +231,6 @@ config SA1100_SHERMAN
 
 config SA1100_SIMPAD
 	bool "Simpad"
-	depends on ARCH_SA1100
 	help
 	  The SIEMENS webpad SIMpad is based on the StrongARM 1110. There
 	  are two different versions CL4 and SL4. CL4 has 32MB RAM and 16MB
@@ -266,7 +241,6 @@ config SA1100_SIMPAD
 
 config SA1100_PFS168
 	bool "Tulsa"
-	depends on ARCH_SA1100
 	help
 	  The Radisys Corp. PFS-168 (aka Tulsa) is an Intel® StrongArm® SA-1110 based
 	  computer which includes the SA-1111 Microprocessor Companion Chip and other
@@ -276,7 +250,6 @@ config SA1100_PFS168
 
 config SA1100_VICTOR
 	bool "Victor"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you are using a Visu Aide Intel(R) StrongARM(R)
 	  SA-1100 based Victor Digital Talking Book Reader.  See
@@ -285,14 +258,12 @@ config SA1100_VICTOR
 
 config SA1100_XP860
 	bool "XP860"
-	depends on ARCH_SA1100
 	help
 	  :: Config help missing ::
 	  :: 06 August 2002 ::
 
 config SA1100_YOPY
 	bool "Yopy"
-	depends on ARCH_SA1100
 	help
 	  Say Y here to support the Yopy PDA.  Product information at
 	  <http://www.yopy.com/>.  See Documentation/arm/SA1100/Yopy
@@ -300,14 +271,12 @@ config SA1100_YOPY
 
 config SA1100_STORK
 	bool "Stork"
-	depends on ARCH_SA1100
 	help
 	  Say Y here if you intend to run this kernel on the Stork
 	  handheld computer.
 
 #config SA1100_TRIZEPS
 #	bool "Trizeps"
-#	depends on ARCH_SA1100
 #	help
 #	  :: write me ::
 
@@ -319,7 +288,6 @@ config SA1100_STORK
 
 config SA1100_SSP
 	tristate "Generic PIO SSP"
-	depends on ARCH_SA1100
 	help
 	  Say Y here to enable support for the generic PIO SSP driver.
 	  This isn't for audio support, but for attached sensors and
@@ -328,7 +296,6 @@ config SA1100_SSP
 
 config SA1100_USB
 	tristate "SA1100 USB function support"
-	depends on ARCH_SA1100
 
 config SA1100_USB_NETLINK
 	tristate "Support for SA11x0 USB network link function"
@@ -349,3 +316,4 @@ config H3600_SLEEVE
 
 endmenu
 
+endif
diff --git a/arch/arm/mach-sa1100/cpu-sa1100.c b/arch/arm/mach-sa1100/cpu-sa1100.c
index 3014d3d66..be5dd86f4 100644
--- a/arch/arm/mach-sa1100/cpu-sa1100.c
+++ b/arch/arm/mach-sa1100/cpu-sa1100.c
@@ -180,7 +180,7 @@ static int sa1100_target(struct cpufreq_policy *policy,
 			 unsigned int target_freq,
 			 unsigned int relation)
 {
-	unsigned int cur = sa11x0_getspeed();
+	unsigned int cur = sa11x0_getspeed(0);
 	unsigned int new_ppcr;
 
 	struct cpufreq_freqs freqs;
@@ -221,7 +221,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = policy->min = policy->max = sa11x0_getspeed();
+	policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 	policy->cpuinfo.min_freq = 59000;
 	policy->cpuinfo.max_freq = 287000;
@@ -230,15 +230,18 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
 }
 
 static struct cpufreq_driver sa1100_driver = {
+	.flags		= CPUFREQ_STICKY |
+			  CPUFREQ_PANIC_OUTOFSYNC | 
+			  CPUFREQ_PANIC_RESUME_OUTOFSYNC,
 	.verify		= sa11x0_verify_speed,
 	.target		= sa1100_target,
+	.get		= sa11x0_getspeed,
 	.init		= sa1100_cpu_init,
 	.name		= "sa1100",
 };
 
 static int __init sa1100_dram_init(void)
 {
-	cpufreq_gov_userspace_init();
  	if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID)
 		return cpufreq_register_driver(&sa1100_driver);
 	else
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c
index 8643bb5b0..62a4dbcce 100644
--- a/arch/arm/mach-sa1100/cpu-sa1110.c
+++ b/arch/arm/mach-sa1100/cpu-sa1110.c
@@ -238,7 +238,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
 		return -EINVAL;
 	}
 
-	freqs.old = sa11x0_getspeed();
+	freqs.old = sa11x0_getspeed(0);
 	freqs.new = sa11x0_ppcr_to_freq(ppcr);
 	freqs.cpu = 0;
 
@@ -320,7 +320,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -EINVAL;
-	policy->cur = policy->min = policy->max = sa11x0_getspeed();
+	policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 	policy->cpuinfo.min_freq = 59000;
 	policy->cpuinfo.max_freq = 287000;
@@ -329,8 +329,12 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
 }
 
 static struct cpufreq_driver sa1110_driver = {
+	.flags		= CPUFREQ_STICKY |
+			  CPUFREQ_PANIC_OUTOFSYNC | 
+			  CPUFREQ_PANIC_RESUME_OUTOFSYNC,
 	.verify		= sa11x0_verify_speed,
 	.target		= sa1110_target,
+	.get		= sa11x0_getspeed,
 	.init		= sa1110_cpu_init,
 	.name		= "sa1110",
 };
@@ -354,8 +358,6 @@ static int __init sa1110_clk_init(void)
 			sdram->tck, sdram->trcd, sdram->trp,
 			sdram->twr, sdram->refresh, sdram->cas_latency);
 
-		cpufreq_gov_userspace_init();
- 
 		memcpy(&sdram_params, sdram, sizeof(sdram_params));
 
 		return cpufreq_register_driver(&sa1110_driver);
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index bc14c39bb..4fe5a5a4a 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -96,11 +96,13 @@ int sa11x0_verify_speed(struct cpufreq_policy *policy)
 	return 0;
 }
 
-unsigned int sa11x0_getspeed(void)
+unsigned int sa11x0_getspeed(unsigned int cpu)
 {
+	if (cpu)
+		return 0;
 	return cclk_frequency_100khz[PPCR & 0xf] * 100;
 }
-EXPORT_SYMBOL(sa11x0_getspeed);
+
 #else
 /*
  * We still need to provide this so building without cpufreq works.
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 956ede770..4649fc5c5 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -22,5 +22,5 @@ struct cpufreq_policy;
 
 extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz);
 extern int sa11x0_verify_speed(struct cpufreq_policy *policy);
-extern unsigned int sa11x0_getspeed(void);
+extern unsigned int sa11x0_getspeed(unsigned int cpu);
 extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx);
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 598d8d1b1..4c8646c62 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -336,6 +336,7 @@ static struct amba_device name##_device = {			\
 		.end	= (VERSATILE_##base##_BASE) + SZ_4K - 1,\
 		.flags	= IORESOURCE_MEM,			\
 	},							\
+	.dma_mask	= ~0,					\
 	.irq		= base##_IRQ,				\
 	/* .dma		= base##_DMA,*/				\
 }
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 54efc6721..ba32817ad 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -220,7 +220,7 @@ config CPU_SA1100
 # XScale
 config CPU_XSCALE
 	bool
-	depends on ARCH_IOP3XX || ARCH_ADIFCC || ARCH_PXA
+	depends on ARCH_IOP3XX || ARCH_ADIFCC || ARCH_PXA || ARCH_IXP4XX
 	default y
 	select CPU_32v5
 	select CPU_ABRT_EV5T
diff --git a/arch/arm/mm/blockops.c b/arch/arm/mm/blockops.c
index cdd1a27f6..9982c4c8c 100644
--- a/arch/arm/mm/blockops.c
+++ b/arch/arm/mm/blockops.c
@@ -133,7 +133,7 @@ static int __init blockops_check(void)
 	unsigned int cache_type;
 	int i;
 
-	asm("mcr p15, 0, %0, c0, c0, 1" : "=r" (cache_type));
+	asm("mrc p15, 0, %0, c0, c0, 1" : "=r" (cache_type));
 
 	printk("Checking V6 block cache operations:\n");
 	register_undef_hook(&blockops_hook);
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index 5814f8479..336aa0e40 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -151,6 +151,7 @@ ENTRY(v6_dma_inv_range)
 	add	r0, r0, #D_CACHE_LINE_SIZE
 	cmp	r0, r1
 	blo	1b
+	mov	r0, #0
 	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
 	mov	pc, lr
 
@@ -188,6 +189,7 @@ ENTRY(v6_dma_flush_range)
 	mcr	p15, 0, r0, c7, c15, 1		@ clean & invalidate line
 #endif
 	add	r0, r0, #D_CACHE_LINE_SIZE
+	cmp	r0, r1
 	blo	1b
 	mov	r0, #0
 	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 4d5c586c5..d03940c1b 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -8,12 +8,14 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/bitops.h>
 #include <linux/vmalloc.h>
 #include <linux/init.h>
+#include <linux/pagemap.h>
 
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
@@ -74,11 +76,14 @@ no_pmd:
 	return 0;
 }
 
-void __flush_dcache_page(struct page *page)
+static void __flush_dcache_page(struct page *page)
 {
 	struct address_space *mapping = page_mapping(page);
 	struct mm_struct *mm = current->active_mm;
-	struct list_head *l;
+	struct vm_area_struct *mpnt = NULL;
+	struct prio_tree_iter iter;
+	unsigned long offset;
+	pgoff_t pgoff;
 
 	__cpuc_flush_dcache_page(page_address(page));
 
@@ -89,36 +94,44 @@ void __flush_dcache_page(struct page *page)
 	 * With a VIVT cache, we need to also write back
 	 * and invalidate any user data.
 	 */
-	list_for_each(l, &mapping->i_mmap_shared) {
-		struct vm_area_struct *mpnt;
-		unsigned long off;
-
-		mpnt = list_entry(l, struct vm_area_struct, shared);
+	pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
 
+	flush_dcache_mmap_lock(mapping);
+	while ((mpnt = vma_prio_tree_next(mpnt, &mapping->i_mmap,
+					&iter, pgoff, pgoff)) != NULL) {
 		/*
 		 * If this VMA is not in our MM, we can ignore it.
 		 */
 		if (mpnt->vm_mm != mm)
 			continue;
-
-		if (page->index < mpnt->vm_pgoff)
+		if (!(mpnt->vm_flags & VM_MAYSHARE))
 			continue;
+		offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
+		flush_cache_page(mpnt, mpnt->vm_start + offset);
+	}
+	flush_dcache_mmap_unlock(mapping);
+}
 
-		off = page->index - mpnt->vm_pgoff;
-		if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
-			continue;
+void flush_dcache_page(struct page *page)
+{
+	struct address_space *mapping = page_mapping(page);
 
-		flush_cache_page(mpnt, mpnt->vm_start + (off << PAGE_SHIFT));
-	}
+	if (mapping && !mapping_mapped(mapping))
+		set_bit(PG_dcache_dirty, &page->flags);
+	else
+		__flush_dcache_page(page);
 }
+EXPORT_SYMBOL(flush_dcache_page);
 
 static void
 make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page, int dirty)
 {
 	struct address_space *mapping = page_mapping(page);
-	struct list_head *l;
 	struct mm_struct *mm = vma->vm_mm;
-	unsigned long pgoff;
+	struct vm_area_struct *mpnt = NULL;
+	struct prio_tree_iter iter;
+	unsigned long offset;
+	pgoff_t pgoff;
 	int aliases = 0;
 
 	if (!mapping)
@@ -131,12 +144,9 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
 	 * space, then we need to handle them specially to maintain
 	 * cache coherency.
 	 */
-	list_for_each(l, &mapping->i_mmap_shared) {
-		struct vm_area_struct *mpnt;
-		unsigned long off;
-
-		mpnt = list_entry(l, struct vm_area_struct, shared);
-
+	flush_dcache_mmap_lock(mapping);
+	while ((mpnt = vma_prio_tree_next(mpnt, &mapping->i_mmap,
+					&iter, pgoff, pgoff)) != NULL) {
 		/*
 		 * If this VMA is not in our MM, we can ignore it.
 		 * Note that we intentionally mask out the VMA
@@ -144,24 +154,12 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
 		 */
 		if (mpnt->vm_mm != mm || mpnt == vma)
 			continue;
-
-		/*
-		 * If the page isn't in this VMA, we can also ignore it.
-		 */
-		if (pgoff < mpnt->vm_pgoff)
-			continue;
-
-		off = pgoff - mpnt->vm_pgoff;
-		if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
+		if (!(mpnt->vm_flags & VM_MAYSHARE))
 			continue;
-
-		off = mpnt->vm_start + (off << PAGE_SHIFT);
-
-		/*
-		 * Ok, it is within mpnt.  Fix it up.
-		 */
-		aliases += adjust_pte(mpnt, off);
+		offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
+		aliases += adjust_pte(mpnt, mpnt->vm_start + offset);
 	}
+	flush_dcache_mmap_unlock(mapping);
 	if (aliases)
 		adjust_pte(vma, addr);
 	else
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index c306fc469..c00061769 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -348,7 +348,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
 	if (pmd_none(*pmd_k))
 		goto bad_area;
 
-	set_pmd(pmd, *pmd_k);
+	copy_pmd(pmd, pmd_k);
 	return 0;
 
 bad_area:
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 3d7e4ed8e..07ddce798 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -77,7 +77,7 @@ void show_mem(void)
 			else if (!page_count(page))
 				free++;
 			else
-				shared += atomic_read(&page->count) - 1;
+				shared += page_count(page) - 1;
 			page++;
 		} while (page < end);
 	}
@@ -225,6 +225,8 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
 		bootmem_pages += np[i].bootmap_pages;
 	}
 
+	high_memory = __va(memend_pfn << PAGE_SHIFT);
+
 	/*
 	 * This doesn't seem to be used by the Linux memory
 	 * manager any more.  If we can get rid of it, we
@@ -232,7 +234,6 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np)
 	 */
 	max_low_pfn = memend_pfn - O_PFN_DOWN(PHYS_OFFSET);
 	max_pfn = memend_pfn - O_PFN_DOWN(PHYS_OFFSET);
-	mi->end = memend_pfn << PAGE_SHIFT;
 
 	return bootmem_pages;
 }
@@ -280,6 +281,7 @@ static int __init check_initrd(struct meminfo *mi)
 static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int bootmap_pages)
 {
 	pg_data_t *pgdat = NODE_DATA(0);
+	unsigned long res_size = 0;
 
 	/*
 	 * Register the kernel text and data with bootmem.
@@ -303,31 +305,32 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot
 			     bootmap_pages << PAGE_SHIFT);
 
 	/*
-	 * Hmm... This should go elsewhere, but we really really
-	 * need to stop things allocating the low memory; we need
-	 * a better implementation of GFP_DMA which does not assume
-	 * that DMA-able memory starts at zero.
+	 * Hmm... This should go elsewhere, but we really really need to
+	 * stop things allocating the low memory; ideally we need a better
+	 * implementation of GFP_DMA which does not assume that DMA-able
+	 * memory starts at zero.
 	 */
-	if (machine_is_integrator())
-		reserve_bootmem_node(pgdat, 0, __pa(swapper_pg_dir));
+	if (machine_is_integrator() || machine_is_cintegrator())
+		res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
+
 	/*
-	 * These should likewise go elsewhere.  They pre-reserve
-	 * the screen memory region at the start of main system
-	 * memory.
+	 * These should likewise go elsewhere.  They pre-reserve the
+	 * screen memory region at the start of main system memory.
 	 */
-	if (machine_is_archimedes() || machine_is_a5k())
-		reserve_bootmem_node(pgdat, 0x02000000, 0x00080000);
 	if (machine_is_edb7211())
-		reserve_bootmem_node(pgdat, 0xc0000000, 0x00020000);
+		res_size = 0x00020000;
 	if (machine_is_p720t())
-		reserve_bootmem_node(pgdat, PHYS_OFFSET, 0x00014000);
+		res_size = 0x00014000;
+
 #ifdef CONFIG_SA1111
 	/*
-	 * Because of the SA1111 DMA bug, we want to preserve
-	 * our precious DMA-able memory...
+	 * Because of the SA1111 DMA bug, we want to preserve our
+	 * precious DMA-able memory...
 	 */
-	reserve_bootmem_node(pgdat, PHYS_OFFSET, __pa(swapper_pg_dir)-PHYS_OFFSET);
+	res_size = __pa(swapper_pg_dir) - PHYS_OFFSET;
 #endif
+	if (res_size)
+		reserve_bootmem_node(pgdat, PHYS_OFFSET, res_size);
 }
 
 /*
@@ -546,7 +549,6 @@ void __init mem_init(void)
 	datapages = &_end - &_etext;
 	initpages = &__init_end - &__init_begin;
 
-	high_memory = (void *)__va(meminfo.end);
 #ifndef CONFIG_DISCONTIGMEM
 	max_mapnr   = virt_to_page(high_memory) - mem_map;
 #endif
@@ -601,7 +603,7 @@ void __init mem_init(void)
 
 void free_initmem(void)
 {
-	if (!machine_is_integrator()) {
+	if (!machine_is_integrator() && !machine_is_cintegrator()) {
 		free_area((unsigned long)(&__init_begin),
 			  (unsigned long)(&__init_end),
 			  "init");
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index a991a155a..e2daf066e 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -20,6 +20,7 @@
  * We use MMU protection domains to trap any attempt to access the bank
  * that is not currently mapped.  (This isn't fully implemented yet.)
  */
+#include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
@@ -162,8 +163,10 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags,
 	}
 	return (void *) (offset + (char *)addr);
 }
+EXPORT_SYMBOL(__ioremap);
 
 void __iounmap(void *addr)
 {
 	vfree((void *) (PAGE_MASK & (unsigned long) addr));
 }
+EXPORT_SYMBOL(__iounmap);
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index 1b5a3f75e..50c2c0f8d 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -18,7 +18,6 @@
 
 #include <asm/pgalloc.h>
 #include <asm/page.h>
-#include <asm/rmap.h>
 #include <asm/io.h>
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
@@ -231,7 +230,7 @@ void free_pgd_slow(pgd_t *pgd)
 
 	pte = pmd_page(*pmd);
 	pmd_clear(pmd);
-	pgtable_remove_rmap(pte);
+	dec_page_state(nr_page_table_pages);
 	pte_free(pte);
 	pmd_free(pmd);
 free:
@@ -305,27 +304,27 @@ static struct mem_types mem_types[] __initdata = {
 	[MT_DEVICE] = {
 		.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
 				L_PTE_WRITE,
-		.prot_l1   = PMD_TYPE_TABLE | PMD_BIT4,
-		.prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED |
+		.prot_l1   = PMD_TYPE_TABLE,
+		.prot_sect = PMD_TYPE_SECT | PMD_SECT_UNCACHED |
 				PMD_SECT_AP_WRITE,
 		.domain    = DOMAIN_IO,
 	},
 	[MT_CACHECLEAN] = {
-		.prot_sect = PMD_TYPE_SECT | PMD_BIT4,
+		.prot_sect = PMD_TYPE_SECT,
 		.domain    = DOMAIN_KERNEL,
 	},
 	[MT_MINICLEAN] = {
-		.prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_MINICACHE,
+		.prot_sect = PMD_TYPE_SECT | PMD_SECT_MINICACHE,
 		.domain    = DOMAIN_KERNEL,
 	},
 	[MT_VECTORS] = {
 		.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
 				L_PTE_EXEC,
-		.prot_l1   = PMD_TYPE_TABLE | PMD_BIT4,
+		.prot_l1   = PMD_TYPE_TABLE,
 		.domain    = DOMAIN_USER,
 	},
 	[MT_MEMORY] = {
-		.prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_AP_WRITE,
+		.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
 		.domain    = DOMAIN_KERNEL,
 	}
 };
@@ -353,6 +352,15 @@ static void __init build_mem_type_table(void)
 		ecc_mask = 0;
 	}
 
+	if (cpu_arch <= CPU_ARCH_ARMv5) {
+		mem_types[MT_DEVICE].prot_l1       |= PMD_BIT4;
+		mem_types[MT_DEVICE].prot_sect     |= PMD_BIT4;
+		mem_types[MT_CACHECLEAN].prot_sect |= PMD_BIT4;
+		mem_types[MT_MINICLEAN].prot_sect  |= PMD_BIT4;
+		mem_types[MT_VECTORS].prot_l1      |= PMD_BIT4;
+		mem_types[MT_MEMORY].prot_sect     |= PMD_BIT4;
+	}
+
 	/*
 	 * ARMv6 and above have extended page tables.
 	 */
@@ -482,6 +490,7 @@ void setup_mm_for_reboot(char mode)
 	pgd_t *pgd;
 	pmd_t *pmd;
 	int i;
+	int cpu_arch = cpu_architecture();
 
 	if (current->mm && current->mm->pgd)
 		pgd = current->mm->pgd;
@@ -491,7 +500,9 @@ void setup_mm_for_reboot(char mode)
 	for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {
 		pmdval = (i << PGDIR_SHIFT) |
 			 PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
-			 PMD_BIT4 | PMD_TYPE_SECT;
+			 PMD_TYPE_SECT;
+		if (cpu_arch <= CPU_ARCH_ARMv5)
+			pmdval |= PMD_BIT4;
 		pmd = pmd_offset(pgd + i, i << PGDIR_SHIFT);
 		set_pmd(pmd, __pmd(pmdval));
 	}
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index eec9d7b00..32c4b0e35 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -40,7 +40,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 	 */
 	cache_type = read_cpuid(CPUID_CACHETYPE);
 	if (cache_type != read_cpuid(CPUID_ID)) {
-		aliasing = (cache_type | cache_type >> 12) & (1 << 9);
+		aliasing = (cache_type | cache_type >> 12) & (1 << 11);
 		if (aliasing)
 			do_align = filp || flags & MAP_SHARED;
 	}
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
index e73c74803..8df666f8d 100644
--- a/arch/arm/mm/proc-syms.c
+++ b/arch/arm/mm/proc-syms.c
@@ -14,8 +14,6 @@
 #include <asm/proc-fns.h>
 #include <asm/tlbflush.h>
 
-EXPORT_SYMBOL(__flush_dcache_page);
-
 #ifndef MULTI_CPU
 EXPORT_SYMBOL(cpu_dcache_clean_area);
 EXPORT_SYMBOL(cpu_set_pte);
@@ -28,7 +26,6 @@ EXPORT_SYMBOL_NOVERS(__cpuc_flush_kern_all);
 EXPORT_SYMBOL_NOVERS(__cpuc_flush_user_all);
 EXPORT_SYMBOL_NOVERS(__cpuc_flush_user_range);
 EXPORT_SYMBOL_NOVERS(__cpuc_coherent_kern_range);
-EXPORT_SYMBOL_NOVERS(__cpuc_flush_dcache_page);
 #else
 EXPORT_SYMBOL(cpu_cache);
 #endif
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index e23fc231e..2652d141f 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -298,7 +298,7 @@ ENTRY(xscale_dma_inv_range)
 	add	r0, r0, #CACHELINESIZE
 	cmp	r0, r1
 	blo	1b
-	mcr	p15, 0, r0, c7, c10, 1		@ Drain Write (& Fill) Buffer
+	mcr	p15, 0, r0, c7, c10, 4		@ Drain Write (& Fill) Buffer
 	mov	pc, lr
 
 /*
@@ -315,7 +315,7 @@ ENTRY(xscale_dma_clean_range)
 	add	r0, r0, #CACHELINESIZE
 	cmp	r0, r1
 	blo	1b
-	mcr	p15, 0, r0, c7, c10, 1		@ Drain Write (& Fill) Buffer
+	mcr	p15, 0, r0, c7, c10, 4		@ Drain Write (& Fill) Buffer
 	mov	pc, lr
 
 /*
@@ -333,7 +333,7 @@ ENTRY(xscale_dma_flush_range)
 	add	r0, r0, #CACHELINESIZE
 	cmp	r0, r1
 	blo	1b
-	mcr	p15, 0, r0, c7, c10, 1		@ Drain Write (& Fill) Buffer
+	mcr	p15, 0, r0, c7, c10, 4		@ Drain Write (& Fill) Buffer
 	mov	pc, lr
 
 ENTRY(xscale_cache_fns)
@@ -647,6 +647,11 @@ cpu_pxa210_name:
 	.asciz	"XScale-PXA210"
 	.size	cpu_pxa210_name, . - cpu_pxa210_name
 
+	.type	cpu_ixp42x_name, #object
+cpu_ixp42x_name:
+	.asciz	"XScale-IXP42x Family"
+	.size	cpu_ixp42x_name, . - cpu_ixp42x_name
+
 	.type	cpu_pxa255_name, #object
 cpu_pxa255_name:
 	.asciz	"XScale-PXA255"
@@ -725,6 +730,22 @@ __pxa210_proc_info:
 	.long	xscale_cache_fns
 	.size	__pxa210_proc_info, . - __pxa210_proc_info
 
+	.type	__ixp42x_proc_info, #object
+__ixp42x_proc_info:
+	.long   0x690541c0
+	.long   0xffffffc0
+	.long   0x00000c0e
+	b       __xscale_setup
+	.long   cpu_arch_name
+	.long   cpu_elf_name
+	.long   HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
+	.long   cpu_ixp42x_name
+	.long   xscale_processor_functions
+	.long	v4wbi_tlb_fns
+	.long	xscale_mc_user_fns
+	.long	xscale_cache_fns
+	.size   __ixp42x_proc_info, . - __ixp42x_proc_info                
+
 	.type	__pxa255_proc_info,#object
 __pxa255_proc_info:
 	.long	0x69052d00
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 2a594d21d..2ecfdfd61 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -6,7 +6,7 @@
 # To add an entry into this database, please see Documentation/arm/README,
 # or contact rmk@arm.linux.org.uk
 #
-# Last update: Thu Apr 29 19:06:33 2004
+# Last update: Fri May 28 13:17:46 2004
 #
 # machine_is_xxx	CONFIG_xxxx		MACH_TYPE_xxx		number
 #
@@ -509,7 +509,7 @@ s3c5500			MACH_S3C5500		S3C5500			498
 smdk5500		MACH_SMDK5500		SMDK5500		499
 signalsync		MACH_SIGNALSYNC		SIGNALSYNC		500
 nbc			MACH_NBC		NBC			501
-er4525			MACH_ER4525		ER4525			502
+kodiak			MACH_KODIAK		KODIAK			502
 netbookpro		MACH_NETBOOKPRO		NETBOOKPRO		503
 hw90200			MACH_HW90200		HW90200			504
 condor			MACH_CONDOR		CONDOR			505
@@ -533,3 +533,16 @@ emc1000			MACH_EMC1000		EMC1000			522
 tidsc25			MACH_TIDSC25		TIDSC25			523
 akcpmxl			MACH_AKCPMXL		AKCPMXL			524
 av3xx			MACH_AV3XX		AV3XX			525
+avila			MACH_AVILA		AVILA			526
+pxa_mpm10		MACH_PXA_MPM10		PXA_MPM10		527
+pxa_kyanite		MACH_PXA_KYANITE	PXA_KYANITE		528
+sgold			MACH_SGOLD		SGOLD			529
+oscar			MACH_OSCAR		OSCAR			530
+epxa4usb2		MACH_EPXA4USB2		EPXA4USB2		531
+xsengine		MACH_XSENGINE		XSENGINE		532
+ip600			MACH_IP600		IP600			533
+mcan2			MACH_MCAN2		MCAN2			534
+ddi_blueridge		MACH_DDI_BLUERIDGE	DDI_BLUERIDGE		535
+skyminder		MACH_SKYMINDER		SKYMINDER		536
+lpd79520		MACH_LPD79520		LPD79520		537
+edb9302			MACH_EDB9302		EDB9302			538
diff --git a/arch/arm26/kernel/process.c b/arch/arm26/kernel/process.c
index ce2357161..5b4efd620 100644
--- a/arch/arm26/kernel/process.c
+++ b/arch/arm26/kernel/process.c
@@ -397,12 +397,6 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
         return __ret;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long fp, lr;
@@ -417,7 +411,7 @@ unsigned long get_wchan(struct task_struct *p)
 		if (fp < stack_page || fp > 4092+stack_page)
 			return 0;
 		lr = pc_pointer (((unsigned long *)fp)[-1]);
-		if (lr < first_sched || lr > last_sched)
+		if (!in_sched_functions(lr))
 			return lr;
 		fp = *(unsigned long *) (fp - 12);
 	} while (count ++ < 16);
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 86a05dbff..481edcadc 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -27,19 +27,11 @@ menu "General setup"
 
 source "fs/Kconfig.binfmt"
 
-config ETRAX_KGDB
-	bool "Use kernel gdb debugger"
-	---help---
-	  The CRIS version of gdb can be used to remotely debug a running
-	  Linux kernel via the serial debug port.  Provided you have gdb-cris
-	  installed, run gdb-cris vmlinux, then type
-
-	  (gdb) set remotebaud 115200           <- kgdb uses 115200 as default
-	  (gdb) target remote /dev/ttyS0        <- maybe you use another port
-
-	  This should connect you to your booted kernel (or boot it now if you
-	  didn't before).  The kernel halts when it boots, waiting for gdb if
-	  this option is turned on!
+config ETRAX_CMDLINE
+	string "Kernel command line"
+	default "root=/dev/mtdblock3"
+	help
+	  Pass additional commands to the kernel.
 
 config ETRAX_WATCHDOG
 	bool "Enable ETRAX watchdog"
@@ -99,11 +91,6 @@ config SVINTO_SIM
 	help
 	  Support the xsim ETRAX Simulator.
 
-config ETRAX200LX
-	bool "ETRAX-200LX-V32"
-	help
-	  Support CRIS V32.
-
 endchoice
 
 config ETRAX_ARCH_V10
@@ -111,11 +98,6 @@ config ETRAX_ARCH_V10
        default y if ETRAX100LX || ETRAX100LX_V2
        default n if !(ETRAX100LX || ETRAX100LX_V2) 
 
-config ETRAX_ARCH_V32
-       bool
-       default y if ETRAX200LX
-       default n if !(ETRAX200LX) 
-
 config ETRAX_DRAM_SIZE
 	int "DRAM size (dec, in MB)"
 	default "8"
@@ -128,35 +110,18 @@ config ETRAX_FLASH_BUSWIDTH
 	help
 	  Width in bytes of the Flash bus (1, 2 or 4). Is usually 2.
 
-config ETRAX_ROOT_DEVICE
-	string "Root device name"
-	default "/dev/mtdblock3"
-	help
-	  Specifies the device that should be mounted as root file system
-	  when booting from flash. The axisflashmap driver adds an additional
-	  mtd partition for the appended root file system image, so this option
-	  should normally be the mtdblock device for the partition after the
-	  last partition in the partition table.
-
-# duplicate choice configs are not yet supported, so the followinguse 
-# doesn't work:
-
 source arch/cris/arch-v10/Kconfig
 
 endmenu
 
 # bring in ETRAX built-in drivers
 menu "Drivers for built-in interfaces"
-
 source arch/cris/arch-v10/drivers/Kconfig
 
 endmenu
 
 source "drivers/base/Kconfig"
 
-# bring in Etrax built-in drivers
-source "arch/cris/drivers/Kconfig"
-
 # standard linux drivers
 source "drivers/mtd/Kconfig"
 
@@ -212,6 +177,37 @@ config PROFILE_SHIFT
 	depends on PROFILE
 	default "2"
 
+config ETRAX_KGDB
+	bool "Use kernel GDB debugger"
+	---help---
+	  The CRIS version of gdb can be used to remotely debug a running
+	  Linux kernel via the serial debug port.  Provided you have gdb-cris
+	  installed, run gdb-cris vmlinux, then type
+
+	  (gdb) set remotebaud 115200           <- kgdb uses 115200 as default
+	  (gdb) target remote /dev/ttyS0        <- maybe you use another port
+
+	  This should connect you to your booted kernel (or boot it now if you
+	  didn't before).  The kernel halts when it boots, waiting for gdb if
+	  this option is turned on!
+
+
+config DEBUG_INFO
+        bool "Compile the kernel with debug info"
+        help
+          If you say Y here the resulting kernel image will include
+          debugging info resulting in a larger kernel image.
+          Say Y here only if you plan to use gdb to debug the kernel.
+          If you don't debug the kernel, you can say N.
+
+config FRAME_POINTER
+        bool "Compile the kernel with frame pointers"
+        help
+          If you say Y here the resulting kernel image will be slightly larger
+          and slower, but it will give very useful debugging information.
+          If you don't debug the kernel, you can say N, but we may not be able
+          to solve problems without frame pointers.
+
 endmenu
 
 source "security/Kconfig"
diff --git a/arch/cris/Makefile b/arch/cris/Makefile
index 734739951..30585a70c 100644
--- a/arch/cris/Makefile
+++ b/arch/cris/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15 2003/07/04 12:47:53 tobiasa Exp $
+# $Id: Makefile,v 1.20 2004/05/14 14:35:58 orjanf Exp $
 # cris/Makefile
 #
 # This file is included by the global makefile so that you can add your own
@@ -34,7 +34,7 @@ AFLAGS += -mlinux
 
 CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
 
-ifdef CONFIG_ETRAX_KGDB
+ifdef CONFIG_FRAME_POINTER
 CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
 CFLAGS += -fno-omit-frame-pointer
 endif
@@ -81,7 +81,7 @@ compressed: zImage
 
 archmrproper:
 archclean:
-	$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot	
+	$(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot
 	rm -f timage vmlinux.bin cramfs.img
 	rm -rf $(LD_SCRIPT).tmp
 
@@ -90,10 +90,14 @@ prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
 
 # Create some links to make all tools happy
 arch/$(ARCH)/.links:
+	@rm -rf arch/$(ARCH)/drivers
 	@ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers
+	@rm -rf arch/$(ARCH)/boot
 	@ln -sfn $(SARCH)/boot arch/$(ARCH)/boot
+	@rm -rf arch/$(ARCH)/lib
 	@ln -sfn $(SARCH)/lib arch/$(ARCH)/lib
-	@ln -sfn $(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S
+	@ln -sfn $(SARCH) arch/$(ARCH)/arch
+	@ln -sfn ../$(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S
 	@touch $@
 
 # Create link to sub arch includes
diff --git a/arch/cris/arch-v10/boot/compressed/misc.c b/arch/cris/arch-v10/boot/compressed/misc.c
index 6506ac4a8..1b5e83f1f 100644
--- a/arch/cris/arch-v10/boot/compressed/misc.c
+++ b/arch/cris/arch-v10/boot/compressed/misc.c
@@ -1,7 +1,7 @@
 /*
  * misc.c
  *
- * $Id: misc.c,v 1.4 2003/04/09 05:20:45 starvik Exp $
+ * $Id: misc.c,v 1.6 2003/10/27 08:04:31 starvik Exp $
  * 
  * This is a collection of several routines from gzip-1.0.3 
  * adapted for Linux.
@@ -263,7 +263,7 @@ decompress_kernel()
 	__asm__ volatile ("move vr,%0" : "=rm" (revision));
 	if (revision < 10)
 	{
-		puts("You need an ETRAX 100LX to run linux 2.4\n");
+		puts("You need an ETRAX 100LX to run linux 2.6\n");
 		while(1);
 	}
 
diff --git a/arch/cris/arch-v10/defconfig b/arch/cris/arch-v10/defconfig
index 5780e4e21..9d40dd316 100644
--- a/arch/cris/arch-v10/defconfig
+++ b/arch/cris/arch-v10/defconfig
@@ -267,6 +267,7 @@ CONFIG_INET=y
 # CONFIG_BLK_DEV_ISAPNP is not set
 # CONFIG_IDE_CHIPSETS is not set
 # CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
 
 #
 # SCSI support
diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig
index 7b0684d07..482ac6659 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -11,29 +11,6 @@ config NET_ETHERNET
 	bool
 	depends on ETRAX_ETHERNET
 	default y
-	---help---
-	  Ethernet (also called IEEE 802.3 or ISO 8802-2) is the most common
-	  type of Local Area Network (LAN) in universities and companies.
-
-	  Common varieties of Ethernet are: 10BASE-2 or Thinnet (10 Mbps over
-	  coaxial cable, linking computers in a chain), 10BASE-T or twisted
-	  pair (10 Mbps over twisted pair cable, linking computers to central
-	  hubs), 10BASE-F (10 Mbps over optical fiber links, using hubs),
-	  100BASE-TX (100 Mbps over two twisted pair cables, using hubs),
-	  100BASE-T4 (100 Mbps over 4 standard voice-grade twisted pair
-	  cables, using hubs), 100BASE-FX (100 Mbps over optical fiber links)
-	  [the 100BASE varieties are also known as Fast Ethernet], and Gigabit
-	  Ethernet (1 Gbps over optical fiber or short copper links).
-
-	  If your Linux machine will be connected to an Ethernet and you have
-	  an Ethernet network interface card (NIC) installed in your computer,
-	  say Y here and read the Ethernet-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>. You will then also have
-	  to say Y to the driver for your particular NIC.
-
-	  Note that the answer to this question won't directly affect the
-	  kernel: saying N will just cause the configurator to skip all
-	  the questions about Ethernet network cards. If unsure, say N.
 
 choice
 	prompt "Network LED behavior"
@@ -109,6 +86,32 @@ config ETRAX_SERIAL_PORT0
 	  Normally you want this on, unless you use external DMA 1 that uses
 	  the same DMA channels.
 
+choice
+	prompt "Ser0 DMA out assignment"
+	depends on ETRAX_SERIAL_PORT0
+	default ETRAX_SERIAL_PORT0_DMA6_OUT
+
+config CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT
+       bool "No DMA out"
+
+config CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
+       bool "DMA 6"
+
+endchoice
+
+choice
+	prompt "Ser0 DMA in assignment"
+	depends on ETRAX_SERIAL_PORT0
+	default ETRAX_SERIAL_PORT0_DMA7_IN
+
+config CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN
+       bool "No DMA in"
+
+config CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
+       bool "DMA 7"
+
+endchoice
+
 choice
 	prompt "Ser0 DTR, RI, DSR and CD assignment"
 	depends on ETRAX_SERIAL_PORT0
@@ -197,6 +200,32 @@ config ETRAX_SERIAL_PORT1
 	help
 	  Enables the ETRAX 100 serial driver for ser1 (ttyS1).
 
+choice
+	prompt "Ser1 DMA out assignment"
+	depends on ETRAX_SERIAL_PORT1
+	default ETRAX_SERIAL_PORT1_DMA8_OUT
+
+config CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_OUT
+       bool "No DMA out"
+
+config CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT
+       bool "DMA 8"
+
+endchoice
+
+choice
+	prompt "Ser1 DMA in assignment"
+	depends on ETRAX_SERIAL_PORT1
+	default ETRAX_SERIAL_PORT1_DMA9_IN
+
+config CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_IN
+       bool "No DMA in"
+
+config CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN
+       bool "DMA 9"
+
+endchoice
+
 choice
 	prompt "Ser1 DTR, RI, DSR and CD assignment"
 	depends on ETRAX_SERIAL_PORT1
@@ -288,6 +317,32 @@ config ETRAX_SERIAL_PORT2
 	help
 	  Enables the ETRAX 100 serial driver for ser2 (ttyS2).
 
+choice
+	prompt "Ser2 DMA out assignment"
+	depends on ETRAX_SERIAL_PORT2
+	default ETRAX_SERIAL_PORT2_DMA2_OUT
+
+config CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT
+       bool "No DMA out"
+
+config CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
+       bool "DMA 2"
+
+endchoice
+
+choice
+	prompt "Ser2 DMA in assignment"
+	depends on ETRAX_SERIAL_PORT2
+	default ETRAX_SERIAL_PORT2_DMA3_IN
+
+config CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN
+       bool "No DMA in"
+
+config CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
+       bool "DMA 3"
+
+endchoice
+
 choice
 	prompt "Ser2 DTR, RI, DSR and CD assignment"
 	depends on ETRAX_SERIAL_PORT2
@@ -376,6 +431,32 @@ config ETRAX_SERIAL_PORT3
 	help
 	  Enables the ETRAX 100 serial driver for ser3 (ttyS3).
 
+choice
+	prompt "Ser3 DMA out assignment"
+	depends on ETRAX_SERIAL_PORT3
+	default ETRAX_SERIAL_PORT3_DMA4_OUT
+
+config CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_OUT
+       bool "No DMA out"
+
+config CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT
+       bool "DMA 4"
+
+endchoice
+
+choice
+	prompt "Ser3 DMA in assignment"
+	depends on ETRAX_SERIAL_PORT3
+	default ETRAX_SERIAL_PORT3_DMA5_IN
+
+config CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_IN
+       bool "No DMA in"
+
+config CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN
+       bool "DMA 5"
+
+endchoice
+
 choice
 	prompt "Ser3 DTR, RI, DSR and CD assignment"
 	depends on ETRAX_SERIAL_PORT3
@@ -466,6 +547,95 @@ config ETRAX_RS485_DISABLE_RECEIVER
 	  loopback.  Not all products are able to do this in software only.
 	  Axis 2400/2401 must disable receiver.
 
+config ETRAX_IDE
+	bool "ATA/IDE support"
+	help
+	  Enable this to get support for ATA/IDE.
+	  You can't use parallell ports or SCSI ports
+	  at the same time.
+
+# here we should add the CONFIG_'s necessary to enable the basic
+# general ide drivers so the common case does not need to go
+# into that config submenu. enable disk and CD support. others
+# need to go fiddle in the submenu..
+config IDE
+	tristate
+	depends on ETRAX_IDE
+	default y
+
+config BLK_DEV_IDE
+	tristate
+	depends on ETRAX_IDE
+	default y
+
+config BLK_DEV_IDEDISK
+	tristate
+	depends on ETRAX_IDE
+	default y
+
+config BLK_DEV_IDECD
+	tristate
+	depends on ETRAX_IDE
+	default y
+
+config BLK_DEV_IDEDMA
+	bool
+	depends on ETRAX_IDE
+	default y
+
+config DMA_NONPCI
+	bool
+	depends on ETRAX_IDE
+	default y
+
+config ETRAX_IDE_DELAY
+	int "Delay for drives to regain consciousness"
+	depends on ETRAX_IDE
+	default 15
+	help
+	  Number of seconds to wait for IDE drives to spin up after an IDE
+	  reset.
+choice
+	prompt "IDE reset pin"
+	depends on ETRAX_IDE
+	default ETRAX_IDE_PB7_RESET
+
+config ETRAX_IDE_PB7_RESET
+	bool "Port_PB_Bit_7"
+	help
+	  IDE reset on pin 7 on port B
+
+config ETRAX_IDE_G27_RESET
+        bool "Port_G_Bit_27"
+	help
+	  IDE reset on pin 27 on port G
+
+endchoice
+
+
+config ETRAX_USB_HOST
+	bool "USB host"
+	help
+	   This option enables the host functionality of the ETRAX 100LX
+	   built-in USB controller. In host mode the controller is designed
+	   for CTRL and BULK traffic only, INTR traffic may work as well
+	   however (depending on the requirements of timeliness).
+
+config USB
+       tristate
+       depends on ETRAX_USB_HOST
+       default y
+
+config ETRAX_USB_HOST_PORT1
+       bool "  USB port 1 enabled"
+       depends on ETRAX_USB_HOST
+       default n
+
+config ETRAX_USB_HOST_PORT2
+       bool "  USB port 2 enabled"
+       depends on ETRAX_USB_HOST
+       default n
+
 config ETRAX_AXISFLASHMAP
 	bool "Axis flash-map support"
 	depends on ETRAX_ARCH_V10
diff --git a/arch/cris/arch-v10/drivers/Makefile b/arch/cris/arch-v10/drivers/Makefile
index 7160cdd7b..7036fc050 100644
--- a/arch/cris/arch-v10/drivers/Makefile
+++ b/arch/cris/arch-v10/drivers/Makefile
@@ -10,5 +10,7 @@ obj-$(CONFIG_ETRAX_I2C_EEPROM)          += eeprom.o
 obj-$(CONFIG_ETRAX_GPIO) 	        += gpio.o
 obj-$(CONFIG_ETRAX_DS1302)              += ds1302.o
 obj-$(CONFIG_ETRAX_PCF8563)		+= pcf8563.o
+obj-$(CONFIG_ETRAX_IDE)                 += ide.o
+obj-$(CONFIG_ETRAX_USB_HOST)            += usb-host.o
 
 
diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c
index c6f90bdcf..3277019e3 100644
--- a/arch/cris/arch-v10/drivers/axisflashmap.c
+++ b/arch/cris/arch-v10/drivers/axisflashmap.c
@@ -11,6 +11,9 @@
  * partition split defined below.
  *
  * $Log: axisflashmap.c,v $
+ * Revision 1.8  2004/05/14 07:58:03  starvik
+ * Merge of changes from 2.4
+ *
  * Revision 1.6  2003/07/04 08:27:37  starvik
  * Merge of Linux 2.5.74
  *
@@ -153,6 +156,9 @@
 /* From head.S */
 extern unsigned long romfs_start, romfs_length, romfs_in_flash;
 
+/* The master mtd for the entire flash. */
+struct mtd_info* axisflash_mtd = NULL;
+
 /* Map driver functions. */
 
 static __u8 flash_read8(struct map_info *map, unsigned long ofs)
@@ -314,7 +320,8 @@ static struct mtd_info *probe_cs(struct map_info *map_cs)
 {
 	struct mtd_info *mtd_cs = NULL;
 
-	printk("%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
+	printk(KERN_INFO
+               "%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
 	       map_cs->name, map_cs->size, map_cs->map_priv_1);
 
 #ifdef CONFIG_MTD_AMDSTD
@@ -398,7 +405,7 @@ static int __init init_axis_flash(void)
 	struct mtd_info *mymtd;
 	int err = 0;
 	int pidx = 0;
-	struct partitiontable_head *ptable_head;
+	struct partitiontable_head *ptable_head = NULL;
 	struct partitiontable_entry *ptable;
 	int use_default_ptable = 1; /* Until proven otherwise. */
 	const char *pmsg = "  /dev/flash%d at 0x%08x, size 0x%08x\n";
@@ -407,19 +414,22 @@ static int __init init_axis_flash(void)
 		/* There's no reason to use this module if no flash chip can
 		 * be identified. Make sure that's understood.
 		 */
-		panic("axisflashmap found no flash chip!\n");
+		printk(KERN_INFO "axisflashmap: Found no flash chip.\n");
+	} else {
+		printk(KERN_INFO "%s: 0x%08x bytes of flash memory.\n",
+		       mymtd->name, mymtd->size);
+		axisflash_mtd = mymtd;
 	}
 
-	printk("%s: 0x%08x bytes of flash memory.\n",
-	       mymtd->name, mymtd->size);
-
-	mymtd->owner = THIS_MODULE;
-
-	ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
-		      CONFIG_ETRAX_PTABLE_SECTOR + PARTITION_TABLE_OFFSET);
+	if (mymtd) {
+		mymtd->owner = THIS_MODULE;
+		ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
+			      CONFIG_ETRAX_PTABLE_SECTOR +
+			      PARTITION_TABLE_OFFSET);
+	}
 	pidx++;  /* First partition is always set to the default. */
 
-	if ((ptable_head->magic == PARTITION_TABLE_MAGIC)
+	if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC)
 	    && (ptable_head->size <
 		(MAX_PARTITIONS * sizeof(struct partitiontable_entry) +
 		PARTITIONTABLE_END_MARKER_SIZE))
@@ -454,7 +464,7 @@ static int __init init_axis_flash(void)
 		ptable_ok = (csum == ptable_head->checksum);
 
 		/* Read the entries and use/show the info.  */
-		printk(" Found a%s partition table at 0x%p-0x%p.\n",
+		printk(KERN_INFO " Found a%s partition table at 0x%p-0x%p.\n",
 		       (ptable_ok ? " valid" : "n invalid"), ptable_head,
 		       max_addr);
 
@@ -486,22 +496,25 @@ static int __init init_axis_flash(void)
 		axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
 		axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
 
-		printk(" Adding readonly flash partition for romfs image:\n");
+		printk(KERN_INFO
+                       " Adding readonly flash partition for romfs image:\n");
 		printk(pmsg, pidx, axis_partitions[pidx].offset,
 		       axis_partitions[pidx].size);
 		pidx++;
 	}
 
-	if (use_default_ptable) {
-		printk(" Using default partition table.\n");
-		err = add_mtd_partitions(mymtd, axis_default_partitions,
-		                         NUM_DEFAULT_PARTITIONS);
-	} else {
-		err = add_mtd_partitions(mymtd, axis_partitions, pidx);
-	}
+        if (mymtd) {
+		if (use_default_ptable) {
+			printk(KERN_INFO " Using default partition table.\n");
+			err = add_mtd_partitions(mymtd, axis_default_partitions,
+						 NUM_DEFAULT_PARTITIONS);
+		} else {
+			err = add_mtd_partitions(mymtd, axis_partitions, pidx);
+		}
 
-	if (err) {
-		panic("axisflashmap could not add MTD partitions!\n");
+		if (err) {
+			panic("axisflashmap could not add MTD partitions!\n");
+		}
 	}
 
 	if (!romfs_in_flash) {
@@ -522,7 +535,7 @@ static int __init init_axis_flash(void)
 			      "mtd_info!\n");
 		}
 
-		printk(" Adding RAM partition for romfs image:\n");
+		printk(KERN_INFO " Adding RAM partition for romfs image:\n");
 		printk(pmsg, pidx, romfs_start, romfs_length);
 
 		err = mtdram_init_device(mtd_ram, (void*)romfs_start, 
@@ -539,3 +552,5 @@ static int __init init_axis_flash(void)
 
 /* This adds the above to the kernels init-call chain. */
 module_init(init_axis_flash);
+
+EXPORT_SYMBOL(axisflash_mtd);
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index b244f40cd..78a200afa 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -4,9 +4,18 @@
 *!
 *! DESCRIPTION: Implements an interface for the DS1302 RTC through Etrax I/O
 *!
-*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status
+*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init
 *!
 *! $Log: ds1302.c,v $
+*! Revision 1.13  2004/05/28 09:26:59  starvik
+*! Modified I2C initialization to work in 2.6.
+*!
+*! Revision 1.12  2004/05/14 07:58:03  starvik
+*! Merge of changes from 2.4
+*!
+*! Revision 1.10  2004/02/04 09:25:12  starvik
+*! Merge of Linux 2.6.2
+*!
 *! Revision 1.9  2003/07/04 08:27:37  starvik
 *! Merge of Linux 2.5.74
 *!
@@ -114,7 +123,7 @@
 *!
 *! (C) Copyright 1999, 2000, 2001  Axis Communications AB, LUND, SWEDEN
 *!
-*! $Id: ds1302.c,v 1.9 2003/07/04 08:27:37 starvik Exp $
+*! $Id: ds1302.c,v 1.13 2004/05/28 09:26:59 starvik Exp $
 *!
 *!***************************************************************************/
 
@@ -283,12 +292,23 @@ ds1302_readreg(int reg)
 void
 ds1302_writereg(int reg, unsigned char val) 
 {
-	ds1302_wenable();
-	start();
-	out_byte(0x80 | (reg << 1)); /* write register */
-	out_byte(val);
-	stop();
-	ds1302_wdisable();
+#ifndef CONFIG_ETRAX_RTC_READONLY
+	int do_writereg = 1;
+#else
+	int do_writereg = 0;
+
+	if (reg == RTC_TRICKLECHARGER)
+		do_writereg = 1;
+#endif
+
+	if (do_writereg) {
+		ds1302_wenable();
+		start();
+		out_byte(0x80 | (reg << 1)); /* write register */
+		out_byte(val);
+		stop();
+		ds1302_wdisable();
+	}
 }
 
 void
@@ -426,20 +446,33 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			tcs_val = RTC_TCR_PATTERN | (tcs_val & 0x0F);
 			ds1302_writereg(RTC_TRICKLECHARGER, tcs_val);
 			return 0;
-		}                
+		}
+		case RTC_VLOW_RD:
+		{
+			/* TODO:
+			 * Implement voltage low detection support
+			 */
+			printk(KERN_WARNING "DS1302: RTC Voltage Low detection"
+			       " is not supported\n");
+			return 0;
+		}
+		case RTC_VLOW_SET:
+		{
+			/* TODO:
+			 * Nothing to do since Voltage Low detection is not supported
+			 */
+			return 0;
+		}
 		default:
 			return -ENOIOCTLCMD;
 	}
 }
 
-int
-get_rtc_status(char *buf) 
+static void
+print_rtc_status(void)
 {
-	char *p;
 	struct rtc_time tm;
 
-	p = buf;
-
 	get_rtc_time(&tm);
 
 	/*
@@ -447,16 +480,12 @@ get_rtc_status(char *buf)
 	 * time or for Universal Standard Time (GMT). Probably local though.
 	 */
 
-	p += sprintf(p,
-		"rtc_time\t: %02d:%02d:%02d\n"
-		"rtc_date\t: %04d-%02d-%02d\n",
-		tm.tm_hour, tm.tm_min, tm.tm_sec,
-		tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
-
-	return  p - buf;
+	printk(KERN_INFO "rtc_time\t: %02d:%02d:%02d\n",
+	       tm.tm_hour, tm.tm_min, tm.tm_sec);
+	printk(KERN_INFO "rtc_date\t: %04d-%02d-%02d\n",
+	       tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
 }
 
-
 /* The various file operations we support. */
 
 static struct file_operations rtc_fops = {
@@ -487,11 +516,10 @@ ds1302_probe(void)
 	out_byte(0xc1); /* read RAM byte 0 */
 
 	if((res = in_byte()) == MAGIC_PATTERN) {
-		char buf[100];
 		stop();
 		ds1302_wdisable();
-		printk("%s: RTC found.\n", ds1302_name);
-		printk("%s: SDA, SCL, RST on PB%i, PB%i, %s%i\n",
+		printk(KERN_INFO "%s: RTC found.\n", ds1302_name);
+		printk(KERN_INFO "%s: SDA, SCL, RST on PB%i, PB%i, %s%i\n",
 		       ds1302_name,
 		       CONFIG_ETRAX_DS1302_SDABIT,
 		       CONFIG_ETRAX_DS1302_SCLBIT,
@@ -501,12 +529,10 @@ ds1302_probe(void)
 		       "PB",
 #endif
 		       CONFIG_ETRAX_DS1302_RSTBIT);
-                get_rtc_status(buf);
-                printk(buf);
+                print_rtc_status();
 		retval = 1;
 	} else {
 		stop();
-		printk("%s: RTC not found.\n", ds1302_name);
 		retval = 0;
 	}
 
@@ -518,7 +544,9 @@ ds1302_probe(void)
 
 int __init
 ds1302_init(void) 
-{ 
+{
+	i2c_init();
+
 	if (!ds1302_probe()) {
 #ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT
 #if CONFIG_ETRAX_DS1302_RSTBIT == 27
@@ -539,16 +567,20 @@ ds1302_init(void)
 				   (IO_STATE(R_GEN_CONFIG, g0dir, out)));    
     		*R_GEN_CONFIG = genconfig_shadow;
 #endif
-		if (!ds1302_probe())
+		if (!ds1302_probe()) {
+			printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);
       			return -1;
+		}
 #else
+		printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);
     		return -1;
 #endif
   	}
-  
 	/* Initialise trickle charger */
 	ds1302_writereg(RTC_TRICKLECHARGER,
 			RTC_TCR_PATTERN |(CONFIG_ETRAX_DS1302_TRICKLE_CHARGE & 0x0F));
+        /* Start clock by resetting CLOCK_HALT */
+	ds1302_writereg(RTC_SECONDS, (ds1302_readreg(RTC_SECONDS) & 0x7F));
 	return 0;
 }
 
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
index f0ea47014..960f4cbdc 100644
--- a/arch/cris/arch-v10/drivers/eeprom.c
+++ b/arch/cris/arch-v10/drivers/eeprom.c
@@ -20,6 +20,9 @@
 *!                                  in the spin-lock.
 *!
 *!  $Log: eeprom.c,v $
+*!  Revision 1.10  2003/09/11 07:29:48  starvik
+*!  Merge of Linux 2.6.0-test5
+*!
 *!  Revision 1.9  2003/07/04 08:27:37  starvik
 *!  Merge of Linux 2.5.74
 *!
@@ -441,9 +444,9 @@ int __init eeprom_init(void)
 static int eeprom_open(struct inode * inode, struct file * file)
 {
 
-  if(iminor(inode) != EEPROM_MINOR_NR)
+  if(MINOR(inode->i_rdev) != EEPROM_MINOR_NR)
      return -ENXIO;
-  if(imajor(inode) != EEPROM_MAJOR_NR)
+  if(MAJOR(inode->i_rdev) != EEPROM_MAJOR_NR)
      return -ENXIO;
 
   if( eeprom.size > 0 )
diff --git a/arch/cris/arch-v10/drivers/ethernet.c b/arch/cris/arch-v10/drivers/ethernet.c
index 943db0b99..f258c0008 100644
--- a/arch/cris/arch-v10/drivers/ethernet.c
+++ b/arch/cris/arch-v10/drivers/ethernet.c
@@ -1,4 +1,4 @@
-/* $Id: ethernet.c,v 1.17 2003/07/04 08:27:37 starvik Exp $
+/* $Id: ethernet.c,v 1.22 2004/05/14 07:58:03 starvik Exp $
  *
  * e100net.c: A network driver for the ETRAX 100LX network controller.
  *
@@ -7,6 +7,15 @@
  * The outline of this driver comes from skeleton.c.
  *
  * $Log: ethernet.c,v $
+ * Revision 1.22  2004/05/14 07:58:03  starvik
+ * Merge of changes from 2.4
+ *
+ * Revision 1.20  2004/03/11 11:38:40  starvik
+ * Merge of Linux 2.6.4
+ *
+ * Revision 1.18  2003/12/03 13:45:46  starvik
+ * Use hardware pad for short packets to prevent information leakage.
+ *
  * Revision 1.17  2003/07/04 08:27:37  starvik
  * Merge of Linux 2.5.74
  *
@@ -258,6 +267,16 @@ typedef struct etrax_eth_descr
 	struct sk_buff* skb;
 } etrax_eth_descr;
 
+/* Some transceivers requires special handling */
+struct transceiver_ops
+{
+	unsigned int oui;
+	void (*check_speed)(void);
+	void (*check_duplex)(void);
+};
+
+struct transceiver_ops* transceiver;
+
 /* Duplex settings */
 enum duplex
 {
@@ -278,10 +297,17 @@ enum duplex
 */
 #define MDIO_BASE_STATUS_REG                0x1
 #define MDIO_BASE_CONTROL_REG               0x0
+#define MDIO_PHY_ID_HIGH_REG                0x2
+#define MDIO_PHY_ID_LOW_REG                 0x3
 #define MDIO_BC_NEGOTIATE                0x0200
 #define MDIO_BC_FULL_DUPLEX_MASK         0x0100
 #define MDIO_BC_AUTO_NEG_MASK            0x1000
 #define MDIO_BC_SPEED_SELECT_MASK        0x2000
+#define MDIO_STATUS_100_FD               0x4000
+#define MDIO_STATUS_100_HD               0x2000
+#define MDIO_STATUS_10_FD                0x1000
+#define MDIO_STATUS_10_HD                0x0800
+#define MDIO_STATUS_SPEED_DUPLEX_MASK	 0x7800
 #define MDIO_ADVERTISMENT_REG               0x4
 #define MDIO_ADVERT_100_FD                0x100
 #define MDIO_ADVERT_100_HD                0x080
@@ -295,9 +321,13 @@ enum duplex
 
 /* Broadcom specific */
 #define MDIO_AUX_CTRL_STATUS_REG           0x18
-#define MDIO_FULL_DUPLEX_IND                0x1
-#define MDIO_SPEED                          0x2
-#define MDIO_PHYS_ADDR                      0x0
+#define MDIO_BC_FULL_DUPLEX_IND             0x1
+#define MDIO_BC_SPEED                       0x2
+
+/* TDK specific */
+#define MDIO_TDK_DIAGNOSTIC_REG              18
+#define MDIO_TDK_DIAGNOSTIC_RATE          0x400
+#define MDIO_TDK_DIAGNOSTIC_DPLX          0x800
 
 /* Network flash constants */
 #define NET_FLASH_TIME                  (HZ/50) /* 20 ms */
@@ -341,6 +371,9 @@ static etrax_eth_descr* myNextTxDesc;  /* Next descriptor to use */
 static etrax_eth_descr TxDescList[NBR_OF_TX_DESC] __attribute__ ((aligned(32)));
 
 static unsigned int network_rec_config_shadow = 0;
+static unsigned int mdio_phy_addr; /* Transciever address */
+
+static unsigned int network_tr_ctrl_shadow = 0;
 
 /* Network speed indication. */
 static struct timer_list speed_timer = TIMER_INITIALIZER(NULL, 0, 0);
@@ -376,6 +409,7 @@ static void set_multicast_list(struct net_device *dev);
 static void e100_hardware_send_packet(char *buf, int length);
 static void update_rx_stats(struct net_device_stats *);
 static void update_tx_stats(struct net_device_stats *);
+static int e100_probe_transceiver(void);
 
 static void e100_check_speed(unsigned long dummy);
 static void e100_set_speed(unsigned long speed);
@@ -393,6 +427,21 @@ static void e100_reset_transceiver(void);
 static void e100_clear_network_leds(unsigned long dummy);
 static void e100_set_network_leds(int active);
 
+static void broadcom_check_speed(void);
+static void broadcom_check_duplex(void);
+static void tdk_check_speed(void);
+static void tdk_check_duplex(void);
+static void generic_check_speed(void);
+static void generic_check_duplex(void);
+
+struct transceiver_ops transceivers[] =
+{
+	{0x1018, broadcom_check_speed, broadcom_check_duplex},  /* Broadcom */
+	{0xC039, tdk_check_speed, tdk_check_duplex},            /* TDK 2120 */
+	{0x039C, tdk_check_speed, tdk_check_duplex},            /* TDK 2120C */
+	{0x0000, generic_check_speed, generic_check_duplex}     /* Generic, must be last */
+};
+
 #define tx_done(dev) (*R_DMA_CH0_CMD == 0)
 
 /*
@@ -409,7 +458,8 @@ etrax_ethernet_init(void)
 	struct net_device *dev;
 	int i, err;
 
-	printk("ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000-2003 Axis Communications AB\n");
+	printk(KERN_INFO
+	       "ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000-2003 Axis Communications AB\n");
 
 	dev = alloc_etherdev(sizeof(struct net_local));
 	if (!dev)
@@ -496,7 +546,6 @@ etrax_ethernet_init(void)
 	current_speed_selection = 0; /* Auto */
 	speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;
 	speed_timer.function = e100_check_speed;
-	add_timer(&speed_timer);
         
 	clear_led_timer.function = e100_clear_network_leds;
         
@@ -504,7 +553,6 @@ etrax_ethernet_init(void)
 	current_duplex = autoneg;
 	duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL;		
 	duplex_timer.function = e100_check_duplex;
-	add_timer(&duplex_timer);
 
 	/* Initialize group address registers to make sure that no */
 	/* unwanted addresses are matched */
@@ -543,7 +591,7 @@ e100_set_mac_address(struct net_device *dev, void *p)
 
 	/* show it in the log as well */
 
-	printk("%s: changed MAC to ", dev->name);
+	printk(KERN_INFO "%s: changed MAC to ", dev->name);
 
 	for (i = 0; i < 5; i++)
 		printk("%02X:", dev->dev_addr[i]);
@@ -569,12 +617,6 @@ e100_open(struct net_device *dev)
 {
 	unsigned long flags;
 
-	/* disable the ethernet interface while we configure it */
-
-	*R_NETWORK_GEN_CONFIG =
-		IO_STATE(R_NETWORK_GEN_CONFIG, phy,    mii_clk) |
-		IO_STATE(R_NETWORK_GEN_CONFIG, enable, off);
-
 	/* enable the MDIO output pin */
 
 	*R_NETWORK_MGM_CTRL = IO_STATE(R_NETWORK_MGM_CTRL, mdoe, enable);
@@ -645,14 +687,14 @@ e100_open(struct net_device *dev)
 		IO_STATE(R_NETWORK_GEN_CONFIG, phy,    mii_clk) |
 		IO_STATE(R_NETWORK_GEN_CONFIG, enable, on);
 
-	*R_NETWORK_TR_CTRL = 
-		IO_STATE(R_NETWORK_TR_CTRL, clr_error, clr) |
-		IO_STATE(R_NETWORK_TR_CTRL, delay, none) |
-		IO_STATE(R_NETWORK_TR_CTRL, cancel, dont) |
-		IO_STATE(R_NETWORK_TR_CTRL, cd, enable) |
-		IO_STATE(R_NETWORK_TR_CTRL, retry, enable) |
-		IO_STATE(R_NETWORK_TR_CTRL, pad, enable) |
-		IO_STATE(R_NETWORK_TR_CTRL, crc, enable);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, clr);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, delay, none);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, cancel, dont);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, cd, enable);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, retry, enable);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, pad, enable);
+	SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, crc, enable);
+	*R_NETWORK_TR_CTRL = network_tr_ctrl_shadow;
 
 	save_flags(flags);
 	cli();
@@ -660,7 +702,8 @@ e100_open(struct net_device *dev)
 	/* enable the irq's for ethernet DMA */
 
 	*R_IRQ_MASK2_SET =
-		IO_STATE(R_IRQ_MASK2_SET, dma1_eop, set); 
+		IO_STATE(R_IRQ_MASK2_SET, dma0_eop, set) |
+		IO_STATE(R_IRQ_MASK2_SET, dma1_eop, set);
 
 	*R_IRQ_MASK0_SET =
 		IO_STATE(R_IRQ_MASK0_SET, overrun,       set) |
@@ -689,6 +732,14 @@ e100_open(struct net_device *dev)
 
 	restore_flags(flags);
 	
+	/* Probe for transceiver */
+	if (e100_probe_transceiver())
+		goto grace_exit3;
+
+	/* Start duplex/speed timers */
+	add_timer(&speed_timer);
+	add_timer(&duplex_timer);
+
 	/* We are now ready to accept transmit requeusts from
 	 * the queueing layer of the networking.
 	 */
@@ -696,6 +747,8 @@ e100_open(struct net_device *dev)
 
 	return 0;
 
+grace_exit3:
+	free_irq(NETWORK_STATUS_IRQ_NBR, (void *)dev);
 grace_exit2:
 	free_irq(NETWORK_DMA_TX_IRQ_NBR, (void *)dev);
 grace_exit1:
@@ -705,9 +758,38 @@ grace_exit0:
 }
 
 
+static void
+generic_check_speed(void)
+{
+	unsigned long data;
+	data = e100_get_mdio_reg(MDIO_ADVERTISMENT_REG);
+	if ((data & MDIO_ADVERT_100_FD) ||
+	    (data & MDIO_ADVERT_100_HD))
+		current_speed = 100;
+	else
+		current_speed = 10;
+}
+
+static void
+tdk_check_speed(void)
+{
+	unsigned long data;
+	data = e100_get_mdio_reg(MDIO_TDK_DIAGNOSTIC_REG);
+	current_speed = (data & MDIO_TDK_DIAGNOSTIC_RATE ? 100 : 10);
+}
+
+static void
+broadcom_check_speed(void)
+{
+	unsigned long data;
+	data = e100_get_mdio_reg(MDIO_AUX_CTRL_STATUS_REG);
+	current_speed = (data & MDIO_BC_SPEED ? 100 : 10);
+}
+
 static void
 e100_check_speed(unsigned long dummy)
 {
+	static int led_initiated = 0;
 	unsigned long data;
 	int old_speed = current_speed;
 
@@ -715,12 +797,13 @@ e100_check_speed(unsigned long dummy)
 	if (!(data & MDIO_LINK_UP_MASK)) {
 		current_speed = 0;
 	} else {
-		data = e100_get_mdio_reg(MDIO_AUX_CTRL_STATUS_REG);
-		current_speed = (data & MDIO_SPEED ? 100 : 10);
+		transceiver->check_speed();
 	}
 	
-	if (old_speed != current_speed)
+	if ((old_speed != current_speed) || !led_initiated) {
+		led_initiated = 1;
 		e100_set_network_leds(NO_NETWORK_ACTIVITY);
+	}
 
 	/* Reinitialize the timer. */
 	speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL;
@@ -781,29 +864,21 @@ e100_negotiate(void)
 static void
 e100_set_speed(unsigned long speed)
 {
-	current_speed_selection = speed;
-	e100_negotiate();
+	if (speed != current_speed_selection) {
+		current_speed_selection = speed;
+		e100_negotiate();
+	}
 }
 
 static void
 e100_check_duplex(unsigned long dummy)
 {
-	unsigned long data;
-
-	data = e100_get_mdio_reg(MDIO_AUX_CTRL_STATUS_REG);
-        
-	if (data & MDIO_FULL_DUPLEX_IND) {
-		if (!full_duplex) { /* Duplex changed to full? */
-			full_duplex = 1;
-			SETF(network_rec_config_shadow, R_NETWORK_REC_CONFIG, duplex, full_duplex);
-			*R_NETWORK_REC_CONFIG = network_rec_config_shadow;
-		}
-	} else { /* half */
-		if (full_duplex) { /* Duplex changed to half? */
-			full_duplex = 0;
-			SETF(network_rec_config_shadow, R_NETWORK_REC_CONFIG, duplex, full_duplex);
-			*R_NETWORK_REC_CONFIG = network_rec_config_shadow;
-		}
+	int old_duplex = full_duplex;
+	transceiver->check_duplex();
+	if (old_duplex != full_duplex) {
+		/* Duplex changed */
+		SETF(network_rec_config_shadow, R_NETWORK_REC_CONFIG, duplex, full_duplex);
+		*R_NETWORK_REC_CONFIG = network_rec_config_shadow;
 	}
 
 	/* Reinitialize the timer. */
@@ -811,13 +886,72 @@ e100_check_duplex(unsigned long dummy)
 	add_timer(&duplex_timer);
 }
 
+static void
+generic_check_duplex(void)
+{
+	unsigned long data;
+	data = e100_get_mdio_reg(MDIO_ADVERTISMENT_REG);
+	if ((data & MDIO_ADVERT_100_FD) ||
+	    (data & MDIO_ADVERT_10_FD))
+		full_duplex = 1;
+	else
+		full_duplex = 0;
+}
+
+static void
+tdk_check_duplex(void)
+{
+	unsigned long data;
+	data = e100_get_mdio_reg(MDIO_TDK_DIAGNOSTIC_REG);
+	full_duplex = (data & MDIO_TDK_DIAGNOSTIC_DPLX) ? 1 : 0;
+}
+
+static void
+broadcom_check_duplex(void)
+{
+	unsigned long data;
+	data = e100_get_mdio_reg(MDIO_AUX_CTRL_STATUS_REG);
+	full_duplex = (data & MDIO_BC_FULL_DUPLEX_IND) ? 1 : 0;
+}
+
 static void 
 e100_set_duplex(enum duplex new_duplex)
 {
-	current_duplex = new_duplex;
-	e100_negotiate();
+	if (new_duplex != current_duplex) {
+		current_duplex = new_duplex;
+		e100_negotiate();
+	}
 }
 
+static int
+e100_probe_transceiver(void)
+{
+	unsigned int phyid_high;
+	unsigned int phyid_low;
+	unsigned int oui;
+	struct transceiver_ops* ops = NULL;
+
+	/* Probe MDIO physical address */
+	for (mdio_phy_addr = 0; mdio_phy_addr <= 31; mdio_phy_addr++) {
+		if (e100_get_mdio_reg(MDIO_BASE_STATUS_REG) != 0xffff)
+			break;
+	}
+	if (mdio_phy_addr == 32)
+		 return -ENODEV;
+
+	/* Get manufacturer */
+	phyid_high = e100_get_mdio_reg(MDIO_PHY_ID_HIGH_REG);
+	phyid_low = e100_get_mdio_reg(MDIO_PHY_ID_LOW_REG);
+	oui = (phyid_high << 6) | (phyid_low >> 10);
+
+	for (ops = &transceivers[0]; ops->oui; ops++) {
+		if (ops->oui == oui)
+			break;
+	}
+	transceiver = ops;
+
+	return 0;
+}
 
 static unsigned short
 e100_get_mdio_reg(unsigned char reg_num)
@@ -827,7 +961,7 @@ e100_get_mdio_reg(unsigned char reg_num)
 	int bitCounter;
 	
 	/* Start of frame, OP Code, Physical Address, Register Address */
-	cmd = (MDIO_START << 14) | (MDIO_READ << 12) | (MDIO_PHYS_ADDR << 7) |
+	cmd = (MDIO_START << 14) | (MDIO_READ << 12) | (mdio_phy_addr << 7) |
 		(reg_num << 2);
 	
 	e100_send_mdio_cmd(cmd, 0);
@@ -848,7 +982,7 @@ e100_set_mdio_reg(unsigned char reg, unsigned short data)
 	int bitCounter;
 	unsigned short cmd;
 
-	cmd = (MDIO_START << 14) | (MDIO_WRITE << 12) | (MDIO_PHYS_ADDR << 7) |
+	cmd = (MDIO_START << 14) | (MDIO_WRITE << 12) | (mdio_phy_addr << 7) |
 	      (reg << 2);
 
 	e100_send_mdio_cmd(cmd, 1);
@@ -916,7 +1050,7 @@ e100_reset_transceiver(void)
 
 	data = e100_get_mdio_reg(MDIO_BASE_CONTROL_REG);
 
-	cmd = (MDIO_START << 14) | (MDIO_WRITE << 12) | (MDIO_PHYS_ADDR << 7) | (MDIO_BASE_CONTROL_REG << 2);
+	cmd = (MDIO_START << 14) | (MDIO_WRITE << 12) | (mdio_phy_addr << 7) | (MDIO_BASE_CONTROL_REG << 2);
 
 	e100_send_mdio_cmd(cmd, 1);
 	
@@ -984,7 +1118,6 @@ static int
 e100_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
 	struct net_local *np = (struct net_local *)dev->priv;
-	int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
 	unsigned char *buf = skb->data;
 	unsigned long flags;
 	
@@ -997,15 +1130,12 @@ e100_send_packet(struct sk_buff *skb, struct net_device *dev)
 
 	dev->trans_start = jiffies;
 	
-	e100_hardware_send_packet(buf, length);
+	e100_hardware_send_packet(buf, skb->len);
 
 	myNextTxDesc = phys_to_virt(myNextTxDesc->descr.next);
 
 	/* Stop queue if full */
 	if (myNextTxDesc == myFirstTxDesc) {
-		/* Enable transmit interrupt to wake up queue */
-		*R_DMA_CH0_CLR_INTR = IO_STATE(R_DMA_CH0_CLR_INTR, clr_eop, do);		
-		*R_IRQ_MASK2_SET = IO_STATE(R_IRQ_MASK2_SET, dma0_eop, set);
 		netif_stop_queue(dev);
 	}
 
@@ -1026,6 +1156,11 @@ e100rxtx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	struct net_local *np = (struct net_local *)dev->priv;
 	unsigned long irqbits = *R_IRQ_MASK2_RD;
  
+	/* Disable RX/TX IRQs to avoid reentrancy */
+	*R_IRQ_MASK2_CLR =
+	  IO_STATE(R_IRQ_MASK2_CLR, dma0_eop, clr) |
+	  IO_STATE(R_IRQ_MASK2_CLR, dma1_eop, clr);
+
 	/* Handle received packets */
 	if (irqbits & IO_STATE(R_IRQ_MASK2_RD, dma1_eop, active)) {
 		/* acknowledge the eop interrupt */
@@ -1069,9 +1204,14 @@ e100rxtx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	if (irqbits & IO_STATE(R_IRQ_MASK2_RD, dma0_eop, active)) {
 		/* acknowledge the eop interrupt and wake up queue */
 		*R_DMA_CH0_CLR_INTR = IO_STATE(R_DMA_CH0_CLR_INTR, clr_eop, do);
-		*R_IRQ_MASK2_CLR = IO_STATE(R_IRQ_MASK2_CLR, dma0_eop, clr);		
 		netif_wake_queue(dev);
 	}
+
+	/* Enable RX/TX IRQs again */
+	*R_IRQ_MASK2_SET =
+	  IO_STATE(R_IRQ_MASK2_SET, dma0_eop, set) |
+	  IO_STATE(R_IRQ_MASK2_SET, dma1_eop, set);
+
 	return IRQ_HANDLED;
 }
 
@@ -1084,7 +1224,9 @@ e100nw_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
 	/* check for underrun irq */
 	if (irqbits & IO_STATE(R_IRQ_MASK0_RD, underrun, active)) { 
-		*R_NETWORK_TR_CTRL = IO_STATE(R_NETWORK_TR_CTRL, clr_error, clr);
+		SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, clr);
+		*R_NETWORK_TR_CTRL = network_tr_ctrl_shadow;
+		SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, nop);
 		np->stats.tx_errors++;
 		D(printk("ethernet receiver underrun!\n"));
 	}
@@ -1096,6 +1238,9 @@ e100nw_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	}
 	/* check for excessive collision irq */
 	if (irqbits & IO_STATE(R_IRQ_MASK0_RD, excessive_col, active)) { 
+		SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, clr);
+		*R_NETWORK_TR_CTRL = network_tr_ctrl_shadow;
+		SETS(network_tr_ctrl_shadow, R_NETWORK_TR_CTRL, clr_error, nop);
 		*R_NETWORK_TR_CTRL = IO_STATE(R_NETWORK_TR_CTRL, clr_error, clr);
 		np->stats.tx_errors++;
 		D(printk("ethernet excessive collisions!\n"));
@@ -1210,14 +1355,10 @@ e100_close(struct net_device *dev)
 {
 	struct net_local *np = (struct net_local *)dev->priv;
 
-	printk("Closing %s.\n", dev->name);
+	printk(KERN_INFO "Closing %s.\n", dev->name);
 
 	netif_stop_queue(dev);
 
-	*R_NETWORK_GEN_CONFIG =
-		IO_STATE(R_NETWORK_GEN_CONFIG, phy,    mii_clk) |
-		IO_STATE(R_NETWORK_GEN_CONFIG, enable, off);
-	
 	*R_IRQ_MASK0_CLR =
 		IO_STATE(R_IRQ_MASK0_CLR, overrun, clr) |
 		IO_STATE(R_IRQ_MASK0_CLR, underrun, clr) |
@@ -1245,21 +1386,25 @@ e100_close(struct net_device *dev)
 	update_rx_stats(&np->stats);
 	update_tx_stats(&np->stats);
 
+	/* Stop speed/duplex timers */
+	del_timer(&speed_timer);
+	del_timer(&duplex_timer);
+
 	return 0;
 }
 
 static int
 e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
-	struct net_local *np = (struct net_local *)dev->priv;
+	struct mii_ioctl_data *data = if_mii(ifr);
+	struct net_local *np = netdev_priv(dev);
 
 	spin_lock(&np->lock); /* Preempt protection */
 	switch (cmd) {
 		case SIOCETHTOOL:
 			return e100_ethtool_ioctl(dev,ifr);
 		case SIOCGMIIPHY: /* Get PHY address */
-			data->phy_id = MDIO_PHYS_ADDR;
+			data->phy_id = mdio_phy_addr;
 			break;
 		case SIOCGMIIREG: /* Read MII register */
 			data->val_out = e100_get_mdio_reg(data->reg_num);
@@ -1278,7 +1423,7 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		case SET_ETH_SPEED_AUTO:              /* Auto negotiate speed */
 			e100_set_speed(0);
 			break;
-		case SET_ETH_DUPLEX_HALF:              /* Hhalf duplex. */
+		case SET_ETH_DUPLEX_HALF:              /* Half duplex. */
 			e100_set_duplex(half);
 			break;
 		case SET_ETH_DUPLEX_FULL:              /* Full duplex. */
@@ -1312,12 +1457,12 @@ e100_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
 			  SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full;
 			ecmd.port = PORT_TP;
 			ecmd.transceiver = XCVR_EXTERNAL;
-			ecmd.phy_address = MDIO_PHYS_ADDR;
+			ecmd.phy_address = mdio_phy_addr;
 			ecmd.speed = current_speed;
 			ecmd.duplex = full_duplex ? DUPLEX_FULL : DUPLEX_HALF;
 			ecmd.advertising = ADVERTISED_TP;
 			if (current_duplex == autoneg && current_speed_selection == 0)
-				ecmd.advertising = ADVERTISED_Autoneg;
+				ecmd.advertising |= ADVERTISED_Autoneg;
 			else {
 				ecmd.advertising |= 
 				  ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
@@ -1355,7 +1500,7 @@ e100_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
 			struct ethtool_drvinfo info;
 			memset((void *) &info, 0, sizeof (info));
 			strncpy(info.driver, "ETRAX 100LX", sizeof(info.driver) - 1);
-			strncpy(info.version, "$Revision: 1.17 $", sizeof(info.version) - 1);
+			strncpy(info.version, "$Revision: 1.22 $", sizeof(info.version) - 1);
 			strncpy(info.fw_version, "N/A", sizeof(info.fw_version) - 1);
 			strncpy(info.bus_info, "N/A", sizeof(info.bus_info) - 1);
 			info.regdump_len = 0;
@@ -1595,7 +1740,11 @@ e100_set_network_leds(int active)
 
 	if (!current_speed) {
 		/* Make LED red, link is down */
+#if defined(CONFIG_ETRAX_NETWORK_RED_ON_NO_CONNECTION)
+		LED_NETWORK_SET(LED_RED);
+#else
 		LED_NETWORK_SET(LED_OFF);
+#endif
 	}
 	else if (light_leds) {
 		if (current_speed == 10) {
@@ -1615,4 +1764,26 @@ etrax_init_module(void)
 	return etrax_ethernet_init();
 }
 
+static int __init
+e100_boot_setup(char* str)
+{
+	struct sockaddr sa = {0};
+	int i;
+
+	/* Parse the colon separated Ethernet station address */
+	for (i = 0; i <  ETH_ALEN; i++) {
+		unsigned int tmp;
+		if (sscanf(str + 3*i, "%2x", &tmp) != 1) {
+			printk(KERN_WARNING "Malformed station address");
+			return 0;
+		}
+		sa.sa_data[i] = (char)tmp;
+	}
+
+	default_mac = sa;
+	return 1;
+}
+
+__setup("etrax100_eth=", e100_boot_setup);
+
 module_init(etrax_init_module);
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index f3a57162b..167291073 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -1,4 +1,4 @@
-/* $Id: gpio.c,v 1.8 2003/07/04 08:27:37 starvik Exp $
+/* $Id: gpio.c,v 1.11 2004/05/14 07:58:03 starvik Exp $
  *
  * Etrax general port I/O device
  *
@@ -9,6 +9,12 @@
  *             Johan Adolfsson  (read/set directions, write, port G)
  *
  * $Log: gpio.c,v $
+ * Revision 1.11  2004/05/14 07:58:03  starvik
+ * Merge of changes from 2.4
+ *
+ * Revision 1.9  2003/09/11 07:29:48  starvik
+ * Merge of Linux 2.6.0-test5
+ *
  * Revision 1.8  2003/07/04 08:27:37  starvik
  * Merge of Linux 2.5.74
  *
@@ -183,6 +189,7 @@ struct gpio_private {
 static struct gpio_private *alarmlist = 0;
 
 static int gpio_some_alarms = 0; /* Set if someone uses alarm */
+static unsigned long gpio_pa_irq_enabled_mask = 0;
 
 /* Port A and B use 8 bit access, but Port G is 32 bit */
 #define NUM_PORTS (GPIO_MINOR_B+1)
@@ -252,13 +259,19 @@ gpio_poll(struct file *file,
 	unsigned long data;
 	poll_wait(file, &priv->alarm_wq, wait);
 	if (priv->minor == GPIO_MINOR_A) {
+		unsigned long flags;
 		unsigned long tmp;
 		data = *R_PORT_PA_DATA;
 		/* PA has support for high level interrupt -
 		 * lets activate for those low and with highalarm set
 		 */
 		tmp = ~data & priv->highalarm & 0xFF;
-		*R_IRQ_MASK1_SET = (tmp << R_IRQ_MASK1_SET__pa0__BITNR);
+		tmp = (tmp << R_IRQ_MASK1_SET__pa0__BITNR);
+		save_flags(flags); cli();
+		gpio_pa_irq_enabled_mask |= tmp;
+		*R_IRQ_MASK1_SET = tmp;
+		restore_flags(flags);
+
 	} else if (priv->minor == GPIO_MINOR_B)
 		data = *R_PORT_PB_DATA;
 	else if (priv->minor == GPIO_MINOR_G)
@@ -312,12 +325,15 @@ gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long tmp;
 	/* Find what PA interrupts are active */
-	tmp = (*R_IRQ_READ1 >> R_IRQ_READ1__pa0__BITNR) & 0xFF;
+	tmp = (*R_IRQ_READ1);
+
+	/* Find those that we have enabled */
+	tmp &= gpio_pa_irq_enabled_mask;
+
 	/* Clear them.. */
-	/* NOTE: Maybe we need to be more careful here if some other
-	 * driver uses PA interrupt as well?
-	 */
-	*R_IRQ_MASK1_CLR = (tmp << R_IRQ_MASK1_CLR__pa0__BITNR);
+	*R_IRQ_MASK1_CLR = tmp;
+	gpio_pa_irq_enabled_mask &= ~tmp;
+
 	if (gpio_some_alarms) {
 		return IRQ_RETVAL(etrax_gpio_wake_up_check());
 	}
@@ -386,7 +402,7 @@ static int
 gpio_open(struct inode *inode, struct file *filp)
 {
 	struct gpio_private *priv;
-	int p = iminor(inode);
+	int p = MINOR(inode->i_rdev);
 
 	if (p > GPIO_MINOR_LAST)
 		return -EINVAL;
@@ -479,6 +495,7 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
 		return ~(*priv->dir_shadow) & 0xFF; /* Only 8 bits */
 	} else if (priv->minor == GPIO_MINOR_G) {
 		/* We must fiddle with R_GEN_CONFIG to change dir */
+		save_flags(flags); cli();
 		if (((arg & dir_g_in_bits) != arg) && 
 		    (arg & changeable_dir_g)) {
 			arg &= changeable_dir_g;
@@ -503,16 +520,17 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
 				dir_g_in_bits |= (1<<24);
 				dir_g_out_bits &= ~(1<<24);
 			}
-			printk("gpio: SETINPUT on port G set "
-				"genconfig to 0x%08lX "
-				"in_bits: 0x%08lX "
-				"out_bits: 0x%08lX\n", 
-			       (unsigned long)genconfig_shadow, 
-			       dir_g_in_bits, dir_g_out_bits);
+			D(printk(KERN_INFO "gpio: SETINPUT on port G set "
+				 "genconfig to 0x%08lX "
+				 "in_bits: 0x%08lX "
+				 "out_bits: 0x%08lX\n",
+			         (unsigned long)genconfig_shadow,
+			         dir_g_in_bits, dir_g_out_bits));
 			*R_GEN_CONFIG = genconfig_shadow;
 			/* Must be a >120 ns delay before writing this again */
 				
 		}
+		restore_flags(flags);
 		return dir_g_in_bits;
 	}
 	return 0;
@@ -529,6 +547,7 @@ unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
 		return *priv->dir_shadow;
 	} else if (priv->minor == GPIO_MINOR_G) {
 		/* We must fiddle with R_GEN_CONFIG to change dir */			
+		save_flags(flags); cli();
 		if (((arg & dir_g_out_bits) != arg) &&
 		    (arg & changeable_dir_g)) {
 			/* Set bits in genconfig to set to output */
@@ -552,15 +571,16 @@ unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
 				dir_g_out_bits |= (1<<24);
 				dir_g_in_bits &= ~(1<<24);
 			}
-			printk("gpio: SETOUTPUT on port G set "
-				"genconfig to 0x%08lX "
-				"in_bits: 0x%08lX "
-				"out_bits: 0x%08lX\n", 
-			       (unsigned long)genconfig_shadow, 
-			       dir_g_in_bits, dir_g_out_bits);
+			D(printk(KERN_INFO "gpio: SETOUTPUT on port G set "
+				 "genconfig to 0x%08lX "
+				 "in_bits: 0x%08lX "
+				 "out_bits: 0x%08lX\n",
+			         (unsigned long)genconfig_shadow,
+			         dir_g_in_bits, dir_g_out_bits));
 			*R_GEN_CONFIG = genconfig_shadow;
 			/* Must be a >120 ns delay before writing this again */
 		}
+		restore_flags(flags);
 		return dir_g_out_bits & 0x7FFFFFFF;
 	}
 	return 0;
@@ -625,6 +645,20 @@ gpio_ioctl(struct inode *inode, struct file *file,
 		// clear alarm for bits with 1 in arg
 		priv->highalarm &= ~arg;
 		priv->lowalarm  &= ~arg;
+		{
+			/* Must update gpio_some_alarms */
+			struct gpio_private *p = alarmlist;
+			int some_alarms;
+			some_alarms = 0;
+			while (p) {
+				if (p->highalarm | p->lowalarm) {
+					some_alarms = 1;
+					break;
+				}
+				p = p->next;
+			}
+			gpio_some_alarms = some_alarms;
+		}
 		break;
 	case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
 		/* Read direction 0=input 1=output */
@@ -844,9 +878,9 @@ static void __init gpio_init_port_g(void)
 	dir_g_in_bits |= (~dir_g_shadow & changeable_dir_g);
 
 
-	printk("GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n",
+	printk(KERN_INFO "GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n",
 	       dir_g_in_bits, dir_g_out_bits, (unsigned long)*R_PORT_G_DATA);
-	printk("GPIO port G: dir: %08lX changeable: %08lX\n", 
+	printk(KERN_INFO "GPIO port G: dir: %08lX changeable: %08lX\n",
 	       dir_g_shadow, changeable_dir_g);
 }
 
@@ -883,7 +917,7 @@ gpio_init(void)
 
 #endif
 	gpio_init_port_g();
-	printk("ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002 Axis Communications AB\n");
+	printk(KERN_INFO "ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002 Axis Communications AB\n");
 	/* We call etrax_gpio_wake_up_check() from timer interrupt and
 	 * from cpu_idle() in kernel/process.c
 	 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms
@@ -891,11 +925,11 @@ gpio_init(void)
 	 */  
 	if (request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt,
 			SA_SHIRQ | SA_INTERRUPT,"gpio poll", NULL)) {
-		printk("err: timer0 irq for gpio\n");
+		printk(KERN_CRIT "err: timer0 irq for gpio\n");
 	}
 	if (request_irq(PA_IRQ_NBR, gpio_pa_interrupt,
 			SA_SHIRQ | SA_INTERRUPT,"gpio PA", NULL)) {
-		printk("err: PA irq for gpio\n");
+		printk(KERN_CRIT "err: PA irq for gpio\n");
 	}
 	
 
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c
index 7731f7d22..52a299d89 100644
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -12,6 +12,12 @@
 *!                                 don't use PB_I2C if DS1302 uses same bits,
 *!                                 use PB.
 *! $Log: i2c.c,v $
+*! Revision 1.7  2004/05/28 09:26:59  starvik
+*! Modified I2C initialization to work in 2.6.
+*!
+*! Revision 1.6  2004/05/14 07:58:03  starvik
+*! Merge of changes from 2.4
+*!
 *! Revision 1.4  2002/12/11 13:13:57  starvik
 *! Added arch/ to v10 specific includes
 *! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
@@ -63,7 +69,7 @@
 *! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
 *!
 *!***************************************************************************/
-/* $Id: i2c.c,v 1.4 2002/12/11 13:13:57 starvik Exp $ */
+/* $Id: i2c.c,v 1.7 2004/05/28 09:26:59 starvik Exp $ */
 
 /****************** INCLUDE FILES SECTION ***********************************/
 
@@ -310,6 +316,12 @@ i2c_inbyte(void)
 	}
 	i2c_clk(I2C_CLOCK_HIGH);
 	i2c_delay(CLOCK_HIGH_TIME);
+
+        /*
+	 * we leave the clock low, getbyte is usually followed
+	 * by sendack/nack, they assume the clock to be low
+	 */
+        i2c_clk(I2C_CLOCK_LOW);
 	return aBitByte;
 }
 
@@ -371,6 +383,13 @@ i2c_getack(void)
 		i2c_delay(CLOCK_HIGH_TIME/2);
 	}
 
+	/*
+	 * our clock is high now, make sure data is low
+	 * before we enable our output. If we keep data high
+	 * and enable output, we would generate a stop condition.
+	 */
+	i2c_data(I2C_DATA_LOW);
+
 	/*
 	 * end clock pulse
 	 */
@@ -426,6 +445,37 @@ i2c_sendack(void)
 	i2c_dir_in();
 }
 
+/*#---------------------------------------------------------------------------
+*#
+*# FUNCTION NAME: i2c_sendnack
+*#
+*# DESCRIPTION  : Sends NACK on received data
+*#
+*#--------------------------------------------------------------------------*/
+void
+i2c_sendnack(void)
+{
+	/*
+	 * enable output
+	 */
+	i2c_delay(CLOCK_LOW_TIME);
+	i2c_dir_out();
+	/*
+	 * set data high
+	 */
+	i2c_data(I2C_DATA_HIGH);
+	/*
+	 * generate clock pulse
+	 */
+	i2c_delay(CLOCK_HIGH_TIME/6);
+	i2c_clk(I2C_CLOCK_HIGH);
+	i2c_delay(CLOCK_HIGH_TIME);
+	i2c_clk(I2C_CLOCK_LOW);
+	i2c_delay(CLOCK_LOW_TIME);
+
+	i2c_dir_in();
+}
+
 /*#---------------------------------------------------------------------------
 *#
 *# FUNCTION NAME: i2c_writereg
@@ -489,7 +539,7 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
 	} while(error && cntr--);
 
 	i2c_delay(CLOCK_LOW_TIME);
-	
+
 	return -error;
 }
 
@@ -557,7 +607,8 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
 		 */
 		b = i2c_inbyte();
 		/*
-		 * send Ack
+		 * last received byte needs to be nacked
+		 * instead of acked
 		 */
 		i2c_sendack();
 		/*
@@ -634,11 +685,9 @@ static struct file_operations i2c_fops = {
 	.release  = i2c_release,
 };
 
-static int __init
+int __init
 i2c_init(void)
 {
-	int res;
-
 	/* Setup and enable the Port B I2C interface */
 
 #ifndef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C
@@ -656,21 +705,28 @@ i2c_init(void)
 			  IO_STATE(R_PORT_PB_DIR, dir0, input)  |
 			  IO_STATE(R_PORT_PB_DIR, dir1, output));
 
-	/* register char device */
+	return 0;
+}
+
+static int __init
+i2c_register(void)
+{
+	int res;
 
-	res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
+	i2c_init();
+  	res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
 	if(res < 0) {
 		printk(KERN_ERR "i2c: couldn't get a major number.\n");
 		return res;
 	}
 
-	printk("I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n");
+	printk(KERN_INFO "I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n");
 	
 	return 0;
 }
 
-/* this makes sure that i2c_init is called during boot */
+/* this makes sure that i2c_register is called during boot */
 
-module_init(i2c_init);
+module_init(i2c_register);
 
 /****************** END OF FILE i2c.c ********************************/
diff --git a/arch/cris/arch-v10/drivers/i2c.h b/arch/cris/arch-v10/drivers/i2c.h
index d0caa9ff8..4ee91426b 100644
--- a/arch/cris/arch-v10/drivers/i2c.h
+++ b/arch/cris/arch-v10/drivers/i2c.h
@@ -1,4 +1,6 @@
-/* $Id: i2c.h,v 1.2 2002/11/18 13:16:06 starvik Exp $ */
+/* $Id: i2c.h,v 1.3 2004/05/28 09:26:59 starvik Exp $ */
+
+int i2c_init(void);
 
 /* High level I2C actions */
 int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index 66e87cc7a..8cf5f620e 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -15,7 +15,7 @@
  *
  * Author: Tobias Anderberg <tobiasa@axis.com>.
  *
- * $Id: pcf8563.c,v 1.1 2002/12/12 08:27:26 starvik Exp $
+ * $Id: pcf8563.c,v 1.4 2004/05/28 09:26:59 starvik Exp $
  */
 
 #include <linux/config.h>
@@ -28,6 +28,7 @@
 #include <linux/fs.h>
 #include <linux/ioctl.h>
 #include <linux/delay.h>
+#include <linux/bcd.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -39,7 +40,7 @@
 #define PCF8563_MAJOR 121		/* Local major number. */
 #define DEVICE_NAME "rtc"		/* Name which is registered in /proc/devices. */
 #define PCF8563_NAME "PCF8563"
-#define DRIVER_VERSION "$Revision: 1.1 $"
+#define DRIVER_VERSION "$Revision: 1.4 $"
 
 /* I2C bus slave registers. */
 #define RTC_I2C_READ		0xa3
@@ -53,14 +54,10 @@ static const unsigned char days_in_month[] =
 	{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
 
 int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
-int pcf8563_open(struct inode *, struct file *);
-int pcf8563_release(struct inode *, struct file *);
 
 static struct file_operations pcf8563_fops = {
 	.owner = THIS_MODULE,
 	.ioctl = pcf8563_ioctl,
-	.open = pcf8563_open,
-	.release = pcf8563_release,
 };
 
 unsigned char
@@ -89,7 +86,12 @@ pcf8563_readreg(int reg)
 void
 pcf8563_writereg(int reg, unsigned char val) 
 {
-	i2c_writereg(RTC_I2C_WRITE,reg,val);
+#ifdef CONFIG_ETRAX_RTC_READONLY
+	if (reg == RTC_CONTROL1 || (reg >= RTC_SECONDS && reg <= RTC_YEAR))
+		return;
+#endif
+
+	rtc_write(reg, val);
 }
 
 void
@@ -124,6 +126,9 @@ int __init
 pcf8563_init(void)
 {
 	unsigned char ret;
+
+	i2c_init();
+
 	/*
 	 * First of all we need to reset the chip. This is done by
 	 * clearing control1, control2 and clk freq, clear the 
@@ -156,14 +161,6 @@ pcf8563_init(void)
 	
 	if (rtc_write(RTC_WEEKDAY_ALARM, 0x00) < 0)
 		goto err;
-
-	if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
-		printk(KERN_INFO "%s: Unable to get major numer %d for RTC device.\n", 
-		       PCF8563_NAME, PCF8563_MAJOR);
-		return -1;
-	}
-
-	printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
         
 	/* Check for low voltage, and warn about it.. */
 	if (rtc_read(RTC_SECONDS) & 0x80)
@@ -214,9 +211,11 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
 			break;
 		case RTC_SET_TIME:
 			{
+#ifdef CONFIG_ETRAX_RTC_READONLY
+				return -EPERM;
+#else
 				int leap;
 				int century;
-				unsigned long flags;
 				struct rtc_time tm;
 
 				memset(&tm, 0, sizeof (struct rtc_time));
@@ -260,8 +259,35 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
 				rtc_write(RTC_SECONDS, tm.tm_sec);
 
 				return 0;
+#endif /* !CONFIG_ETRAX_RTC_READONLY */
 			}
-			break;
+
+		case RTC_VLOW_RD:
+		{
+			int vl_bit = 0;
+
+			if (rtc_read(RTC_SECONDS) & 0x80) {
+				vl_bit = 1;
+				printk(KERN_WARNING "%s: RTC Voltage Low - reliable "
+				       "date/time information is no longer guaranteed!\n",
+				       PCF8563_NAME);
+			}
+			if (copy_to_user((int *) arg, &vl_bit, sizeof(int)))
+				return -EFAULT;
+
+			return 0;
+		}
+
+		case RTC_VLOW_SET:
+		{
+			/* Clear the VL bit in the seconds register */
+			int ret = rtc_read(RTC_SECONDS);
+
+			rtc_write(RTC_SECONDS, (ret & 0x7F));
+
+			return 0;
+		}
+
 		default:
 				return -ENOTTY;
 	}
@@ -269,19 +295,19 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
 	return 0;
 }
 
-int 
-pcf8563_open(struct inode *inode, struct file *filp)
+static int __init
+pcf8563_register(void)
 {
-	MOD_INC_USE_COUNT;
-	return 0;
-}
+	pcf8563_init();
+	if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
+		printk(KERN_INFO "%s: Unable to get major numer %d for RTC device.\n",
+		       PCF8563_NAME, PCF8563_MAJOR);
+		return -1;
+	}
 
-int
-pcf8563_release(struct inode *inode, struct file *filp)
-{
-	MOD_DEC_USE_COUNT;
-	return 0;
+	printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
+        return 0;
 }
 
-module_init(pcf8563_init);
+module_init(pcf8563_register);
 module_exit(pcf8563_exit);
diff --git a/arch/cris/arch-v10/drivers/serial.c b/arch/cris/arch-v10/drivers/serial.c
index 2822ffb81..272795de9 100644
--- a/arch/cris/arch-v10/drivers/serial.c
+++ b/arch/cris/arch-v10/drivers/serial.c
@@ -1,4 +1,4 @@
-/* $Id: serial.c,v 1.17 2003/07/04 08:27:37 starvik Exp $
+/* $Id: serial.c,v 1.20 2004/05/24 12:00:20 starvik Exp $
  *
  * Serial port driver for the ETRAX 100LX chip
  *
@@ -7,6 +7,16 @@
  *    Many, many authors. Based once upon a time on serial.c for 16x50.
  *
  * $Log: serial.c,v $
+ * Revision 1.20  2004/05/24 12:00:20  starvik
+ * Big merge of stuff from Linux 2.4 (e.g. manual mode for the serial port).
+ *
+ * Revision 1.19  2004/05/17 13:12:15  starvik
+ * Kernel console hook
+ * Big merge from Linux 2.4 still pending.
+ *
+ * Revision 1.18  2003/10/28 07:18:30  starvik
+ * Compiles with debug info
+ *
  * Revision 1.17  2003/07/04 08:27:37  starvik
  * Merge of Linux 2.5.74
  *
@@ -399,7 +409,7 @@
  *
  */
 
-static char *serial_version = "$Revision: 1.17 $";
+static char *serial_version = "$Revision: 1.20 $";
 
 #include <linux/config.h>
 #include <linux/version.h>
@@ -447,6 +457,10 @@ static char *serial_version = "$Revision: 1.17 $";
 #error "RX_TIMEOUT_TICKS == 0 not allowed, use 1"
 #endif
 
+#if defined(CONFIG_ETRAX_RS485_ON_PA) && defined(CONFIG_ETRAX_RS485_ON_PORT_G)
+#error "Disable either CONFIG_ETRAX_RS485_ON_PA or CONFIG_ETRAX_RS485_ON_PORT_G"
+#endif
+
 /*
  * All of the compatibilty code so we can compile serial.c against
  * older kernels is hidden in serial_compat.h
@@ -473,7 +487,7 @@ struct tty_driver *serial_driver;
 //#define SERIAL_DEBUG_DATA
 //#define SERIAL_DEBUG_THROTTLE
 //#define SERIAL_DEBUG_IO  /* Debug for Extra control and status pins */
-#define SERIAL_DEBUG_LINE 0 /* What serport we want to debug */
+//#define SERIAL_DEBUG_LINE 0 /* What serport we want to debug */
 
 /* Enable this to use serial interrupts to handle when you
    expect the first received event on the serial port to
@@ -481,14 +495,74 @@ struct tty_driver *serial_driver;
    from eLinux */
 #define SERIAL_HANDLE_EARLY_ERRORS
 
-#define TTY_THROTTLE_LIMIT (TTY_FLIPBUF_SIZE/10)
+/* Defined and used in n_tty.c, but we need it here as well */
+#define TTY_THRESHOLD_THROTTLE 128
 
+/* Due to buffersizes and threshold values, our SERIAL_DESCR_BUF_SIZE
+ * must not be to high or flow control won't work if we leave it to the tty
+ * layer so we have our own throttling in flush_to_flip
+ * TTY_FLIPBUF_SIZE=512,
+ * TTY_THRESHOLD_THROTTLE/UNTHROTTLE=128
+ * BUF_SIZE can't be > 128
+ */
+/* Currently 16 descriptors x 128 bytes = 2048 bytes */
 #define SERIAL_DESCR_BUF_SIZE 256
 
+#define SERIAL_PRESCALE_BASE 3125000 /* 3.125MHz */
+#define DEF_BAUD_BASE SERIAL_PRESCALE_BASE
+
+/* We don't want to load the system with massive fast timer interrupt
+ * on high baudrates so limit it to 250 us (4kHz) */
+#define MIN_FLUSH_TIME_USEC 250
+
 /* Add an x here to log a lot of timer stuff */
 #define TIMERD(x)
-
+/* Debug details of interrupt handling */
+#define DINTR1(x)  /* irq on/off, errors */
+#define DINTR2(x)    /* tx and rx */
+/* Debug flip buffer stuff */
+#define DFLIP(x)
+/* Debug flow control and overview of data flow */
+#define DFLOW(x)
+#define DBAUD(x)
+#define DLOG_INT_TRIG(x)
+
+//#define DEBUG_LOG_INCLUDED
+#ifndef DEBUG_LOG_INCLUDED
 #define DEBUG_LOG(line, string, value)
+#else
+struct debug_log_info
+{
+	unsigned long time;
+	unsigned long timer_data;
+//  int line;
+	const char *string;
+	int value;
+};
+#define DEBUG_LOG_SIZE 4096
+
+struct debug_log_info debug_log[DEBUG_LOG_SIZE];
+int debug_log_pos = 0;
+
+#define DEBUG_LOG(_line, _string, _value) do { \
+  if ((_line) == SERIAL_DEBUG_LINE) {\
+    debug_log_func(_line, _string, _value); \
+  }\
+}while(0)
+
+void debug_log_func(int line, const char *string, int value)
+{
+	if (debug_log_pos < DEBUG_LOG_SIZE) {
+		debug_log[debug_log_pos].time = jiffies;
+		debug_log[debug_log_pos].timer_data = *R_TIMER_DATA;
+//    debug_log[debug_log_pos].line = line;
+		debug_log[debug_log_pos].string = string;
+		debug_log[debug_log_pos].value = value;
+		debug_log_pos++;
+	}
+	/*printk(string, value);*/
+}
+#endif
 
 #ifndef CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS
 /* Default number of timer ticks before flushing rx fifo 
@@ -498,11 +572,14 @@ struct tty_driver *serial_driver;
 #define CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS 5 
 #endif
 
+unsigned long timer_data_to_ns(unsigned long timer_data);
+
 static void change_speed(struct e100_serial *info);
+static void rs_throttle(struct tty_struct * tty);
 static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
 static int rs_write(struct tty_struct * tty, int from_user,
                     const unsigned char *buf, int count);
-static inline int raw_write(struct tty_struct * tty, int from_user,
+extern _INLINE_ int rs_raw_write(struct tty_struct * tty, int from_user,
                             const unsigned char *buf, int count);
 #ifdef CONFIG_ETRAX_RS485
 static int e100_write_rs485(struct tty_struct * tty, int from_user,
@@ -511,7 +588,7 @@ static int e100_write_rs485(struct tty_struct * tty, int from_user,
 static int get_lsr_info(struct e100_serial * info, unsigned int *value);
 
 
-#define DEF_BAUD 0x99   /* 115.2 kbit/s */
+#define DEF_BAUD 115200   /* 115.2 kbit/s */
 #define STD_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
 #define DEF_RX 0x20  /* or SERIAL_CTRL_W >> 8 */
 /* Default value of tx_ctrl register: has txd(bit 7)=1 (idle) as default */
@@ -520,6 +597,7 @@ static int get_lsr_info(struct e100_serial * info, unsigned int *value);
 /* offsets from R_SERIALx_CTRL */
 
 #define REG_DATA 0
+#define REG_DATA_STATUS32 0 /* this is the 32 bit register R_SERIALx_READ */
 #define REG_TR_DATA 0
 #define REG_STATUS 1
 #define REG_TR_CTRL 1
@@ -555,60 +633,162 @@ static int get_lsr_info(struct e100_serial * info, unsigned int *value);
  */
 
 
+/* Mask for the irqs possibly enabled in R_IRQ_MASK1_RD etc. */
+static const unsigned long e100_ser_int_mask = 0
+#ifdef CONFIG_ETRAX_SERIAL_PORT0
+| IO_MASK(R_IRQ_MASK1_RD, ser0_data) | IO_MASK(R_IRQ_MASK1_RD, ser0_ready)
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT1
+| IO_MASK(R_IRQ_MASK1_RD, ser1_data) | IO_MASK(R_IRQ_MASK1_RD, ser1_ready)
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT2
+| IO_MASK(R_IRQ_MASK1_RD, ser2_data) | IO_MASK(R_IRQ_MASK1_RD, ser2_ready)
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT3
+| IO_MASK(R_IRQ_MASK1_RD, ser3_data) | IO_MASK(R_IRQ_MASK1_RD, ser3_ready)
+#endif
+;
+unsigned long r_alt_ser_baudrate_shadow = 0;
+
 /* this is the data for the four serial ports in the etrax100 */
 /*  DMA2(ser2), DMA4(ser3), DMA6(ser0) or DMA8(ser1) */
 /* R_DMA_CHx_CLR_INTR, R_DMA_CHx_FIRST, R_DMA_CHx_CMD */
 
 static struct e100_serial rs_table[] = {
-	{ DEF_BAUD, (unsigned char *)R_SERIAL0_CTRL, 1U << 12, /* uses DMA 6 and 7 */
-	  R_DMA_CH6_CLR_INTR, R_DMA_CH6_FIRST, R_DMA_CH6_CMD,
-	  R_DMA_CH6_STATUS, R_DMA_CH6_HWSW, R_DMA_CH6_DESCR,
-	  R_DMA_CH7_CLR_INTR, R_DMA_CH7_FIRST, R_DMA_CH7_CMD,
-	  R_DMA_CH7_STATUS, R_DMA_CH7_HWSW, R_DMA_CH7_DESCR,
-	  STD_FLAGS, DEF_RX, DEF_TX, 2,
+	{ .baud        = DEF_BAUD,
+	  .port        = (unsigned char *)R_SERIAL0_CTRL,
+	  .irq         = 1U << 12, /* uses DMA 6 and 7 */
+	  .oclrintradr = R_DMA_CH6_CLR_INTR,
+	  .ofirstadr   = R_DMA_CH6_FIRST,
+	  .ocmdadr     = R_DMA_CH6_CMD,
+	  .ostatusadr  = R_DMA_CH6_STATUS,
+	  .iclrintradr = R_DMA_CH7_CLR_INTR,
+	  .ifirstadr   = R_DMA_CH7_FIRST,
+	  .icmdadr     = R_DMA_CH7_CMD,
+	  .idescradr   = R_DMA_CH7_DESCR,
+	  .flags       = STD_FLAGS,
+	  .rx_ctrl     = DEF_RX,
+	  .tx_ctrl     = DEF_TX,
+	  .iseteop     = 2,
 #ifdef CONFIG_ETRAX_SERIAL_PORT0
-          1
+          .enabled  = 1,
+#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
+	  .dma_out_enabled = 1,
+#else
+	  .dma_out_enabled = 0,
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
+	  .dma_in_enabled = 1,
 #else
-          0
+	  .dma_in_enabled = 0
 #endif
+#else
+          .enabled  = 0,
+	  .dma_out_enabled = 0,
+	  .dma_in_enabled = 0
+#endif
+
 },  /* ttyS0 */
 #ifndef CONFIG_SVINTO_SIM
-	{ DEF_BAUD, (unsigned char *)R_SERIAL1_CTRL, 1U << 16, /* uses DMA 8 and 9 */
-	  R_DMA_CH8_CLR_INTR, R_DMA_CH8_FIRST, R_DMA_CH8_CMD,
-	  R_DMA_CH8_STATUS, R_DMA_CH8_HWSW, R_DMA_CH8_DESCR,
-	  R_DMA_CH9_CLR_INTR, R_DMA_CH9_FIRST, R_DMA_CH9_CMD,
-	  R_DMA_CH9_STATUS, R_DMA_CH9_HWSW, R_DMA_CH9_DESCR,
-	  STD_FLAGS, DEF_RX, DEF_TX, 3 ,
+	{ .baud        = DEF_BAUD,
+	  .port        = (unsigned char *)R_SERIAL1_CTRL,
+	  .irq         = 1U << 16, /* uses DMA 8 and 9 */
+	  .oclrintradr = R_DMA_CH8_CLR_INTR,
+	  .ofirstadr   = R_DMA_CH8_FIRST,
+	  .ocmdadr     = R_DMA_CH8_CMD,
+	  .ostatusadr  = R_DMA_CH8_STATUS,
+	  .iclrintradr = R_DMA_CH9_CLR_INTR,
+	  .ifirstadr   = R_DMA_CH9_FIRST,
+	  .icmdadr     = R_DMA_CH9_CMD,
+	  .idescradr   = R_DMA_CH9_DESCR,
+	  .flags       = STD_FLAGS,
+	  .rx_ctrl     = DEF_RX,
+	  .tx_ctrl     = DEF_TX,
+	  .iseteop     = 3,
 #ifdef CONFIG_ETRAX_SERIAL_PORT1
-          1
+          .enabled  = 1,
+#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT
+	  .dma_out_enabled = 1,
+#else
+	  .dma_out_enabled = 0,
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN
+	  .dma_in_enabled = 1,
+#else
+	  .dma_in_enabled = 0
+#endif
 #else
-          0
+          .enabled  = 0,
+	  .dma_out_enabled = 0,
+	  .dma_in_enabled = 0
 #endif
 },  /* ttyS1 */
 
-	{ DEF_BAUD, (unsigned char *)R_SERIAL2_CTRL, 1U << 4,  /* uses DMA 2 and 3 */
-	  R_DMA_CH2_CLR_INTR, R_DMA_CH2_FIRST, R_DMA_CH2_CMD,
-	  R_DMA_CH2_STATUS, R_DMA_CH2_HWSW, R_DMA_CH2_DESCR,
-	  R_DMA_CH3_CLR_INTR, R_DMA_CH3_FIRST, R_DMA_CH3_CMD,
-	  R_DMA_CH3_STATUS, R_DMA_CH3_HWSW, R_DMA_CH3_DESCR,
-	  STD_FLAGS, DEF_RX, DEF_TX, 0,
+	{ .baud        = DEF_BAUD,
+	  .port        = (unsigned char *)R_SERIAL2_CTRL,
+	  .irq         = 1U << 4,  /* uses DMA 2 and 3 */
+	  .oclrintradr = R_DMA_CH2_CLR_INTR,
+	  .ofirstadr   = R_DMA_CH2_FIRST,
+	  .ocmdadr     = R_DMA_CH2_CMD,
+	  .ostatusadr  = R_DMA_CH2_STATUS,
+	  .iclrintradr = R_DMA_CH3_CLR_INTR,
+	  .ifirstadr   = R_DMA_CH3_FIRST,
+	  .icmdadr     = R_DMA_CH3_CMD,
+	  .idescradr   = R_DMA_CH3_DESCR,
+	  .flags       = STD_FLAGS,
+	  .rx_ctrl     = DEF_RX,
+	  .tx_ctrl     = DEF_TX,
+	  .iseteop     = 0,
 #ifdef CONFIG_ETRAX_SERIAL_PORT2
-          1
+          .enabled  = 1,
+#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
+	  .dma_out_enabled = 1,
+#else
+	  .dma_out_enabled = 0,
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
+	  .dma_in_enabled = 1,
+#else
+	  .dma_in_enabled = 0
+#endif
 #else
-          0
+          .enabled  = 0,
+	  .dma_out_enabled = 0,
+	  .dma_in_enabled = 0
 #endif
  },  /* ttyS2 */
 
-	{ DEF_BAUD, (unsigned char *)R_SERIAL3_CTRL, 1U << 8,  /* uses DMA 4 and 5 */
-	  R_DMA_CH4_CLR_INTR, R_DMA_CH4_FIRST, R_DMA_CH4_CMD,
-	  R_DMA_CH4_STATUS, R_DMA_CH4_HWSW, R_DMA_CH4_DESCR,
-	  R_DMA_CH5_CLR_INTR, R_DMA_CH5_FIRST, R_DMA_CH5_CMD,
-	  R_DMA_CH5_STATUS, R_DMA_CH5_HWSW, R_DMA_CH5_DESCR,
-	  STD_FLAGS, DEF_RX, DEF_TX, 1,
+	{ .baud        = DEF_BAUD,
+	  .port        = (unsigned char *)R_SERIAL3_CTRL,
+	  .irq         = 1U << 8,  /* uses DMA 4 and 5 */
+	  .oclrintradr = R_DMA_CH4_CLR_INTR,
+	  .ofirstadr   = R_DMA_CH4_FIRST,
+	  .ocmdadr     = R_DMA_CH4_CMD,
+	  .ostatusadr  = R_DMA_CH4_STATUS,
+	  .iclrintradr = R_DMA_CH5_CLR_INTR,
+	  .ifirstadr   = R_DMA_CH5_FIRST,
+	  .icmdadr     = R_DMA_CH5_CMD,
+	  .idescradr   = R_DMA_CH5_DESCR,
+	  .flags       = STD_FLAGS,
+	  .rx_ctrl     = DEF_RX,
+	  .tx_ctrl     = DEF_TX,
+	  .iseteop     = 1,
 #ifdef CONFIG_ETRAX_SERIAL_PORT3
-          1
+          .enabled  = 1,
+#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT
+	  .dma_out_enabled = 1,
 #else
-          0
+	  .dma_out_enabled = 0,
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN
+	  .dma_in_enabled = 1,
+#else
+	  .dma_in_enabled = 0
+#endif
+#else
+          .enabled  = 0,
+	  .dma_out_enabled = 0,
+	  .dma_in_enabled = 0
 #endif
  }   /* ttyS3 */
 #endif
@@ -616,6 +796,9 @@ static struct e100_serial rs_table[] = {
 
 
 #define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial))
+
+static struct termios *serial_termios[NR_PORTS];
+static struct termios *serial_termios_locked[NR_PORTS];
 #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
 static struct fast_timer fast_timers[NR_PORTS];
 #endif
@@ -652,6 +835,9 @@ static struct fast_timer fast_timers_rs485[NR_PORTS];
 #if defined(CONFIG_ETRAX_RS485_ON_PA)
 static int rs485_pa_bit = CONFIG_ETRAX_RS485_ON_PA_BIT;
 #endif
+#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)
+static int rs485_port_g_bit = CONFIG_ETRAX_RS485_ON_PORT_G_BIT;
+#endif
 #endif
 
 /* Info and macros needed for each ports extra control/status signals. */
@@ -761,7 +947,7 @@ static unsigned char dummy_ser[NR_PORTS] = {0xFF, 0xFF, 0xFF,0xFF};
 #  endif
 #endif
 
-#define SER0_PB_BITSUM (CONFIG_ETRAX_SER1_DTR_ON_PB_BIT+CONFIG_ETRAX_SER1_RI_ON_PB_BIT+CONFIG_ETRAX_SER1_DSR_ON_PB_BIT+CONFIG_ETRAX_SER1_CD_ON_PB_BIT)
+#define SER1_PB_BITSUM (CONFIG_ETRAX_SER1_DTR_ON_PB_BIT+CONFIG_ETRAX_SER1_RI_ON_PB_BIT+CONFIG_ETRAX_SER1_DSR_ON_PB_BIT+CONFIG_ETRAX_SER1_CD_ON_PB_BIT)
 
 #if SER1_PB_BITSUM != -4
 #  if CONFIG_ETRAX_SER1_DTR_ON_PB_BIT == -1
@@ -1081,15 +1267,9 @@ static const struct control_pins e100_modem_pins[NR_PORTS] =
 };
 #endif /* !CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED */
 
-#if defined(CONFIG_ETRAX_RS485) && defined(CONFIG_ETRAX_RS485_ON_PA)
-unsigned char rs485_pa_port = CONFIG_ETRAX_RS485_ON_PA_BIT;
-#endif
-
-
 #define E100_RTS_MASK 0x20
 #define E100_CTS_MASK 0x40
 
-
 /* All serial port signals are active low:
  * active   = 0 -> 3.3V to RS-232 driver -> -12V on RS-232 level
  * inactive = 1 -> 0V   to RS-232 driver -> +12V on RS-232 level
@@ -1151,6 +1331,10 @@ static void update_char_time(struct e100_serial * info)
 
 	/* calc timeout */
 	info->char_time_usec = ((bits * 1000000) / info->baud) + 1;
+	info->flush_time_usec = 4*info->char_time_usec;
+	if (info->flush_time_usec < MIN_FLUSH_TIME_USEC)
+		info->flush_time_usec = MIN_FLUSH_TIME_USEC;
+
 }
 
 /*
@@ -1250,9 +1434,13 @@ static inline void
 e100_rts(struct e100_serial *info, int set)
 {
 #ifndef CONFIG_SVINTO_SIM
+	unsigned long flags;
+	save_flags(flags);
+	cli();
 	info->rx_ctrl &= ~E100_RTS_MASK;
 	info->rx_ctrl |= (set ? 0 : E100_RTS_MASK);  /* RTS is active low */
 	info->port[REG_REC_CTRL] = info->rx_ctrl;
+	restore_flags(flags);
 #ifdef SERIAL_DEBUG_IO  
 	printk("ser%i rts %i\n", info->line, set);
 #endif
@@ -1326,6 +1514,7 @@ e100_disable_rxdma_irq(struct e100_serial *info)
 #ifdef SERIAL_DEBUG_INTR
 	printk("rxdma_irq(%d): 0\n",info->line);
 #endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ disable_rxdma_irq %i\n", info->line));
 	*R_IRQ_MASK2_CLR = (info->irq << 2) | (info->irq << 3);
 }
 
@@ -1335,30 +1524,33 @@ e100_enable_rxdma_irq(struct e100_serial *info)
 #ifdef SERIAL_DEBUG_INTR
 	printk("rxdma_irq(%d): 1\n",info->line);
 #endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ enable_rxdma_irq %i\n", info->line));
 	*R_IRQ_MASK2_SET = (info->irq << 2) | (info->irq << 3);
 }
 
 /* the tx DMA uses only dma_descr interrupt */
 
-static inline void
+static _INLINE_ void
 e100_disable_txdma_irq(struct e100_serial *info) 
 {
 #ifdef SERIAL_DEBUG_INTR
 	printk("txdma_irq(%d): 0\n",info->line);
 #endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ disable_txdma_irq %i\n", info->line));
 	*R_IRQ_MASK2_CLR = info->irq;
 }
 
-static inline void
+static _INLINE_ void
 e100_enable_txdma_irq(struct e100_serial *info) 
 {
 #ifdef SERIAL_DEBUG_INTR
 	printk("txdma_irq(%d): 1\n",info->line);
 #endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ enable_txdma_irq %i\n", info->line));
 	*R_IRQ_MASK2_SET = info->irq;
 }
 
-static inline void
+static _INLINE_ void
 e100_disable_txdma_channel(struct e100_serial *info)
 {
 	unsigned long flags;
@@ -1367,32 +1559,46 @@ e100_disable_txdma_channel(struct e100_serial *info)
 	 * ( set to something other then serialX)
 	 */
 	save_flags(flags);
-	cli();  
+	cli();
+	DFLOW(DEBUG_LOG(info->line, "disable_txdma_channel %i\n", info->line));
 	if (info->line == 0) {
-		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma6);
-		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused);
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma6)) ==
+		    IO_STATE(R_GEN_CONFIG, dma6, serial0)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma6);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused);
+		}
 	} else if (info->line == 1) {
-		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma8);
-		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb);
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma8)) ==
+		    IO_STATE(R_GEN_CONFIG, dma8, serial1)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma8);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb);
+		}
 	} else if (info->line == 2) {
-		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma2);
-		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0);
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma2)) ==
+		    IO_STATE(R_GEN_CONFIG, dma2, serial2)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma2);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0);
+		}
 	} else if (info->line == 3) {
-		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma4);
-		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, par1);
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma4)) ==
+		    IO_STATE(R_GEN_CONFIG, dma4, serial3)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma4);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, par1);
+		}
 	}
 	*R_GEN_CONFIG = genconfig_shadow;
 	restore_flags(flags);
 }
 
 
-static inline void
+static _INLINE_ void
 e100_enable_txdma_channel(struct e100_serial *info)
 {
 	unsigned long flags;
   
 	save_flags(flags);
-	cli();  
+	cli();
+	DFLOW(DEBUG_LOG(info->line, "enable_txdma_channel %i\n", info->line));
 	/* Enable output DMA channel for the serial port in question */
 	if (info->line == 0) {
 		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma6);
@@ -1411,6 +1617,70 @@ e100_enable_txdma_channel(struct e100_serial *info)
 	restore_flags(flags);
 }
 
+static _INLINE_ void
+e100_disable_rxdma_channel(struct e100_serial *info)
+{
+	unsigned long flags;
+
+	/* Disable input DMA channel for the serial port in question
+	 * ( set to something other then serialX)
+	 */
+	save_flags(flags);
+	cli();
+	if (info->line == 0) {
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma7)) ==
+		    IO_STATE(R_GEN_CONFIG, dma7, serial0)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma7);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma7, unused);
+		}
+	} else if (info->line == 1) {
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma9)) ==
+		    IO_STATE(R_GEN_CONFIG, dma9, serial1)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma9);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma9, usb);
+		}
+	} else if (info->line == 2) {
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma3)) ==
+		    IO_STATE(R_GEN_CONFIG, dma3, serial2)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma3);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma3, par0);
+		}
+	} else if (info->line == 3) {
+		if ((genconfig_shadow & IO_MASK(R_GEN_CONFIG, dma5)) ==
+		    IO_STATE(R_GEN_CONFIG, dma5, serial3)) {
+			genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma5);
+			genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma5, par1);
+		}
+	}
+	*R_GEN_CONFIG = genconfig_shadow;
+	restore_flags(flags);
+}
+
+
+static _INLINE_ void
+e100_enable_rxdma_channel(struct e100_serial *info)
+{
+	unsigned long flags;
+
+	save_flags(flags);
+	cli();
+	/* Enable input DMA channel for the serial port in question */
+	if (info->line == 0) {
+		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma7);
+		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma7, serial0);
+	} else if (info->line == 1) {
+		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma9);
+		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma9, serial1);
+	} else if (info->line == 2) {
+		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma3);
+		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma3, serial2);
+	} else if (info->line == 3) {
+		genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma5);
+		genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma5, serial3);
+	}
+	*R_GEN_CONFIG = genconfig_shadow;
+	restore_flags(flags);
+}
 
 #ifdef SERIAL_HANDLE_EARLY_ERRORS
 /* in order to detect and fix errors on the first byte
@@ -1422,6 +1692,7 @@ e100_disable_serial_data_irq(struct e100_serial *info)
 #ifdef SERIAL_DEBUG_INTR
 	printk("ser_irq(%d): 0\n",info->line);
 #endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ disable data_irq %i\n", info->line));
 	*R_IRQ_MASK1_CLR = (1U << (8+2*info->line));
 }
 
@@ -1434,10 +1705,49 @@ e100_enable_serial_data_irq(struct e100_serial *info)
 	       (8+2*info->line),
 	       (1U << (8+2*info->line)));
 #endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ enable data_irq %i\n", info->line));
 	*R_IRQ_MASK1_SET = (1U << (8+2*info->line));
 }
 #endif
 
+static inline void
+e100_disable_serial_tx_ready_irq(struct e100_serial *info)
+{
+#ifdef SERIAL_DEBUG_INTR
+	printk("ser_tx_irq(%d): 0\n",info->line);
+#endif
+	DINTR1(DEBUG_LOG(info->line,"IRQ disable ready_irq %i\n", info->line));
+	*R_IRQ_MASK1_CLR = (1U << (8+1+2*info->line));
+}
+
+static inline void
+e100_enable_serial_tx_ready_irq(struct e100_serial *info)
+{
+#ifdef SERIAL_DEBUG_INTR
+	printk("ser_tx_irq(%d): 1\n",info->line);
+	printk("**** %d = %d\n",
+	       (8+1+2*info->line),
+	       (1U << (8+1+2*info->line)));
+#endif
+	DINTR2(DEBUG_LOG(info->line,"IRQ enable ready_irq %i\n", info->line));
+	*R_IRQ_MASK1_SET = (1U << (8+1+2*info->line));
+}
+
+static inline void e100_enable_rx_irq(struct e100_serial *info)
+{
+	if (info->uses_dma_in)
+		e100_enable_rxdma_irq(info);
+	else
+		e100_enable_serial_data_irq(info);
+}
+static inline void e100_disable_rx_irq(struct e100_serial *info)
+{
+	if (info->uses_dma_in)
+		e100_disable_rxdma_irq(info);
+	else
+		e100_disable_serial_data_irq(info);
+}
+
 #if defined(CONFIG_ETRAX_RS485)
 /* Enable RS-485 mode on selected port. This is UGLY. */
 static int
@@ -1448,10 +1758,23 @@ e100_enable_rs485(struct tty_struct *tty,struct rs485_control *r)
 #if defined(CONFIG_ETRAX_RS485_ON_PA)	
 	*R_PORT_PA_DATA = port_pa_data_shadow |= (1 << rs485_pa_bit);
 #endif
+#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)
+	REG_SHADOW_SET(R_PORT_G_DATA,  port_g_data_shadow,
+		       rs485_port_g_bit, 1);
+#endif
+#if defined(CONFIG_ETRAX_RS485_LTC1387)
+	REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,
+		       CONFIG_ETRAX_RS485_LTC1387_DXEN_PORT_G_BIT, 1);
+	REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,
+		       CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1);
+#endif
 
 	info->rs485.rts_on_send = 0x01 & r->rts_on_send;
 	info->rs485.rts_after_sent = 0x01 & r->rts_after_sent;
-	info->rs485.delay_rts_before_send = r->delay_rts_before_send;
+	if (r->delay_rts_before_send >= 1000)
+		info->rs485.delay_rts_before_send = 1000;
+	else
+		info->rs485.delay_rts_before_send = r->delay_rts_before_send;
 	info->rs485.enabled = r->enabled;
 /*	printk("rts: on send = %i, after = %i, enabled = %i",
 		    info->rs485.rts_on_send,
@@ -1491,7 +1814,7 @@ static void rs485_toggle_rts_timer_function(unsigned long data)
 	e100_rts(info, info->rs485.rts_after_sent);
 #if defined(CONFIG_ETRAX_RS485_DISABLE_RECEIVER)
 	e100_enable_rx(info);
-	e100_enable_rxdma_irq(info);
+	e100_enable_rx_irq(info);
 #endif
 }
 #endif
@@ -1513,8 +1836,12 @@ rs_stop(struct tty_struct *tty)
 	if (info) {
 		unsigned long flags;
 		unsigned long xoff;
-		
+
 		save_flags(flags); cli();
+		DFLOW(DEBUG_LOG(info->line, "XOFF rs_stop xmit %i\n",
+				CIRC_CNT(info->xmit.head,
+					 info->xmit.tail,SERIAL_XMIT_SIZE)));
+
 		xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->tty));
 		xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop);
 		if (tty->termios->c_iflag & IXON ) {
@@ -1535,6 +1862,9 @@ rs_start(struct tty_struct *tty)
 		unsigned long xoff;
 
 		save_flags(flags); cli();
+		DFLOW(DEBUG_LOG(info->line, "XOFF rs_start xmit %i\n",
+				CIRC_CNT(info->xmit.head,
+					 info->xmit.tail,SERIAL_XMIT_SIZE)));
 		xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(tty));
 		xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable);
 		if (tty->termios->c_iflag & IXON ) {
@@ -1542,6 +1872,9 @@ rs_start(struct tty_struct *tty)
 		}
 	
 		*((unsigned long *)&info->port[REG_XOFF]) = xoff;
+		if (!info->uses_dma_out &&
+		    info->xmit.head != info->xmit.tail && info->xmit.buf)
+			e100_enable_serial_tx_ready_irq(info);
 		
 		restore_flags(flags);
 	}
@@ -1576,6 +1909,8 @@ static _INLINE_ void
 rs_sched_event(struct e100_serial *info,
 				    int event)
 {
+	if (info->event & (1 << event))
+		return;
 	info->event |= 1 << event;
 	schedule_work(&info->work);
 }
@@ -1592,7 +1927,7 @@ rs_sched_event(struct e100_serial *info,
  */
 
 static void 
-transmit_chars(struct e100_serial *info)
+transmit_chars_dma(struct e100_serial *info)
 {
 	unsigned int c, sentl;
 	struct etrax_dma_descr *descr;
@@ -1600,11 +1935,11 @@ transmit_chars(struct e100_serial *info)
 #ifdef CONFIG_SVINTO_SIM
 	/* This will output too little if tail is not 0 always since
 	 * we don't reloop to send the other part. Anyway this SHOULD be a
-	 * no-op - transmit_chars would never really be called during sim
+	 * no-op - transmit_chars_dma would never really be called during sim
 	 * since rs_write does not write into the xmit buffer then.
 	 */
 	if (info->xmit.tail)
-		printk("Error in serial.c:transmit_chars(), tail!=0\n");
+		printk("Error in serial.c:transmit_chars-dma(), tail!=0\n");
 	if (info->xmit.head != info->xmit.tail) {
 		SIMCOUT(info->xmit.buf + info->xmit.tail,
 			CIRC_CNT(info->xmit.head,
@@ -1626,7 +1961,7 @@ transmit_chars(struct e100_serial *info)
 #endif
 	if (!info->tr_running) {
 		/* weirdo... we shouldn't get here! */
-		printk(KERN_WARNING "Achtung: transmit_chars with !tr_running\n");
+		printk(KERN_WARNING "Achtung: transmit_chars_dma with !tr_running\n");
 		return;
 	}
 
@@ -1642,6 +1977,8 @@ transmit_chars(struct e100_serial *info)
 		/* otherwise we find the amount of data sent here */
 		sentl = descr->hw_len;
 
+	DFLOW(DEBUG_LOG(info->line, "TX %i done\n", sentl));
+
 	/* update stats */
 	info->icount.tx += sentl;
 
@@ -1659,6 +1996,13 @@ transmit_chars(struct e100_serial *info)
 
 	c = CIRC_CNT_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
 
+	/* Don't send all in one DMA transfer - divide it so we wake up
+	 * application before all is sent
+	 */
+
+	if (c >= 4*WAKEUP_CHARS)
+		c = c/2;
+
 	if (c <= 0) {
 		/* our job here is done, don't schedule any new DMA transfer */
 		info->tr_running = 0;
@@ -1678,17 +2022,17 @@ transmit_chars(struct e100_serial *info)
 
 	/* ok we can schedule a dma send of c chars starting at info->xmit.tail */
 	/* set up the descriptor correctly for output */
-
+	DFLOW(DEBUG_LOG(info->line, "TX %i\n", c));
 	descr->ctrl = d_int | d_eol | d_wait; /* Wait needed for tty_wait_until_sent() */
 	descr->sw_len = c;
 	descr->buf = virt_to_phys(info->xmit.buf + info->xmit.tail);
 	descr->status = 0;
 
 	*info->ofirstadr = virt_to_phys(descr); /* write to R_DMAx_FIRST */
-	*info->ocmdadr = 1;       /* dma command start -> R_DMAx_CMD */
+	*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, start);
 	
 	/* DMA is now running (hopefully) */
-} /* transmit_chars */
+} /* transmit_chars_dma */
 
 static void 
 start_transmit(struct e100_serial *info)
@@ -1702,15 +2046,17 @@ start_transmit(struct e100_serial *info)
 	info->tr_descr.hw_len = 0;
 	info->tr_descr.status = 0;
 	info->tr_running = 1;
-
-	transmit_chars(info);
+	if (info->uses_dma_out)
+		transmit_chars_dma(info);
+	else
+		e100_enable_serial_tx_ready_irq(info);
 } /* start_transmit */
 
 #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
 static int serial_fast_timer_started = 0;
 static int serial_fast_timer_expired = 0;
 static void flush_timeout_function(unsigned long data);
-#define START_FLUSH_FAST_TIMER(info, string) {\
+#define START_FLUSH_FAST_TIMER_TIME(info, string, usec) {\
   unsigned long timer_flags; \
   save_flags(timer_flags); \
   cli(); \
@@ -1721,7 +2067,7 @@ static void flush_timeout_function(unsigned long data);
     start_one_shot_timer(&fast_timers[info->line], \
                          flush_timeout_function, \
                          (unsigned long)info, \
-                         info->char_time_usec*4, \
+                         (usec), \
                          string); \
   } \
   else { \
@@ -1729,8 +2075,10 @@ static void flush_timeout_function(unsigned long data);
   } \
   restore_flags(timer_flags); \
 }
+#define START_FLUSH_FAST_TIMER(info, string) START_FLUSH_FAST_TIMER_TIME(info, string, info->flush_time_usec)
 
 #else
+#define START_FLUSH_FAST_TIMER_TIME(info, string, usec)
 #define START_FLUSH_FAST_TIMER(info, string)
 #endif
 
@@ -1775,17 +2123,26 @@ static int
 add_char_and_flag(struct e100_serial *info, unsigned char data, unsigned char flag)
 {
 	struct etrax_recv_buffer *buffer;
+	if (info->uses_dma_in) {
+		if (!(buffer = alloc_recv_buffer(4)))
+			return 0;
 
-	if (!(buffer = alloc_recv_buffer(4)))
-		return 0;
-
-	buffer->length = 1;
-	buffer->error = flag;
-	buffer->buffer[0] = data;
+		buffer->length = 1;
+		buffer->error = flag;
+		buffer->buffer[0] = data;
 	
-	append_recv_buffer(info, buffer);
+		append_recv_buffer(info, buffer);
 
-	info->icount.rx++;
+		info->icount.rx++;
+	} else {
+		struct tty_struct *tty = info->tty;
+		*tty->flip.char_buf_ptr = data;
+		*tty->flip.flag_buf_ptr = flag;
+		tty->flip.flag_buf_ptr++;
+		tty->flip.char_buf_ptr++;
+		tty->flip.count++;
+		info->icount.rx++;
+	}
 
 	return 1;
 }
@@ -1847,7 +2204,14 @@ handle_all_descr_data(struct e100_serial *info)
 		/* Reset the status information */
 		descr->status = 0;
 
-		DEBUG_LOG(info->line, "recvl %lu\n", recvl);
+		DFLOW(  DEBUG_LOG(info->line, "RX %lu\n", recvl);
+			if (info->tty->stopped) {
+				unsigned char *buf = phys_to_virt(descr->buf);
+				DEBUG_LOG(info->line, "rx 0x%02X\n", buf[0]);
+				DEBUG_LOG(info->line, "rx 0x%02X\n", buf[1]);
+				DEBUG_LOG(info->line, "rx 0x%02X\n", buf[2]);
+			}
+			);
 
 		/* update stats */
 		info->icount.rx += recvl;
@@ -1859,7 +2223,7 @@ handle_all_descr_data(struct e100_serial *info)
 }
 
 static _INLINE_ void 
-receive_chars(struct e100_serial *info)
+receive_chars_dma(struct e100_serial *info)
 {
 	struct tty_struct *tty;
 	unsigned char rstat;
@@ -1881,7 +2245,8 @@ receive_chars(struct e100_serial *info)
 		return;
 
 #ifdef SERIAL_HANDLE_EARLY_ERRORS
-	e100_enable_serial_data_irq(info);
+	if (info->uses_dma_in)
+		e100_enable_serial_data_irq(info);
 #endif	
 
 	if (info->errorcode == ERRCODE_INSERT_BREAK)
@@ -1891,6 +2256,9 @@ receive_chars(struct e100_serial *info)
 
 	/* Read the status register to detect errors */
 	rstat = info->port[REG_STATUS];
+	if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) {
+		DFLOW(DEBUG_LOG(info->line, "XOFF detect stat %x\n", rstat));
+	}
 
 	if (rstat & SER_ERROR_MASK) {
 		/* If we got an error, we must reset it by reading the
@@ -1959,16 +2327,16 @@ start_receive(struct e100_serial *info)
 	 */
 	return;
 #endif
-
-	/* reset the input dma channel to be sure it works */
-
-	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
-	while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->icmdadr) ==
-	       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
-
 	info->tty->flip.count = 0;
+	if (info->uses_dma_in) {
+		/* reset the input dma channel to be sure it works */
+
+		*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
+		while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->icmdadr) ==
+		       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
 
-	start_recv_dma(info);
+		start_recv_dma(info);
+	}
 }
 
 
@@ -2014,27 +2382,27 @@ tr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	
 	for (i = 0; i < NR_PORTS; i++) {
 		info = rs_table + i;
-		if (!info->enabled || !info->uses_dma) 
+		if (!info->enabled || !info->uses_dma_out)
 			continue; 
 		/* check for dma_descr (don't need to check for dma_eop in output dma for serial */
 		if (ireg & info->irq) {  
 			handled = 1;
 			/* we can send a new dma bunch. make it so. */
-			DEBUG_LOG(info->line, "tr_interrupt %i\n", i);
+			DINTR2(DEBUG_LOG(info->line, "tr_interrupt %i\n", i));
 			/* Read jiffies_usec first, 
 			 * we want this time to be as late as possible
 			 */
  			PROCSTAT(ser_stat[info->line].tx_dma_ints++);
 			info->last_tx_active_usec = GET_JIFFIES_USEC();
 			info->last_tx_active = jiffies;
-			transmit_chars(info);
+			transmit_chars_dma(info);
 		}
 		
 		/* FIXME: here we should really check for a change in the
 		   status lines and if so call status_handle(info) */
 	}
 	return IRQ_RETVAL(handled);
-}
+} /* tr_interrupt */
 
 /* dma input channel interrupt handler */
 
@@ -2054,7 +2422,7 @@ rec_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 		const char *s = "What? rec_interrupt in simulator??\n";
 		SIMCOUT(s,strlen(s));
 	}
-	return;
+	return IRQ_HANDLED;
 #endif
 	
 	/* find out the line that caused this irq and get it from rs_table */
@@ -2063,20 +2431,20 @@ rec_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	
 	for (i = 0; i < NR_PORTS; i++) {
 		info = rs_table + i;
-		if (!info->enabled || !info->uses_dma) 
+		if (!info->enabled || !info->uses_dma_in)
 			continue; 
 		/* check for both dma_eop and dma_descr for the input dma channel */
 		if (ireg & ((info->irq << 2) | (info->irq << 3))) {
 			handled = 1; 
 			/* we have received something */
-			receive_chars(info);
+			receive_chars_dma(info);
 		}
 		
 		/* FIXME: here we should really check for a change in the
 		   status lines and if so call status_handle(info) */
 	}
 	return IRQ_RETVAL(handled);
-}
+} /* rec_interrupt */
 
 static _INLINE_ int
 force_eop_if_needed(struct e100_serial *info)
@@ -2116,20 +2484,21 @@ force_eop_if_needed(struct e100_serial *info)
 	if (!info->forced_eop) {
 		info->forced_eop = 1;
 		PROCSTAT(ser_stat[info->line].timeout_flush_cnt++);
-		DEBUG_LOG(info->line, "timeout EOP %i\n", info->line);
+		TIMERD(DEBUG_LOG(info->line, "timeout EOP %i\n", info->line));
 		FORCE_EOP(info);
 	}
 
 	return 1;
 }
 
-static _INLINE_ void
+extern _INLINE_ void
 flush_to_flip_buffer(struct e100_serial *info)
 {
 	struct tty_struct *tty;
 	struct etrax_recv_buffer *buffer;
 	unsigned int length;
 	unsigned long flags;
+	int max_flip_size;
 
 	if (!info->first_recv_buffer)
 		return;
@@ -2143,12 +2512,46 @@ flush_to_flip_buffer(struct e100_serial *info)
 	}
 
 	length = tty->flip.count;
+	/* Don't flip more than the ldisc has room for.
+	 * The return value from ldisc.receive_room(tty) - might not be up to
+	 * date, the previous flip of up to TTY_FLIPBUF_SIZE might be on the
+	 * processed and not accounted for yet.
+	 * Since we use DMA, 1 SERIAL_DESCR_BUF_SIZE could be on the way.
+	 * Lets buffer data here and let flow control take care of it.
+	 * Since we normally flip large chunks, the ldisc don't react
+	 * with throttle until too late if we flip to much.
+	 */
+	max_flip_size = tty->ldisc.receive_room(tty);
+	if (max_flip_size < 0)
+		max_flip_size = 0;
+	if (max_flip_size <= (TTY_FLIPBUF_SIZE +         /* Maybe not accounted for */
+			      length + info->recv_cnt +  /* We have this queued */
+			      2*SERIAL_DESCR_BUF_SIZE +    /* This could be on the way */
+			      TTY_THRESHOLD_THROTTLE)) { /* Some slack */
+		/* check TTY_THROTTLED first so it indicates our state */
+		if (!test_and_set_bit(TTY_THROTTLED, &tty->flags)) {
+			DFLOW(DEBUG_LOG(info->line,"flush_to_flip throttles room %lu\n", max_flip_size));
+			rs_throttle(tty);
+		}
+#if 0
+		else if (max_flip_size <= (TTY_FLIPBUF_SIZE +         /* Maybe not accounted for */
+					   length + info->recv_cnt +  /* We have this queued */
+					   SERIAL_DESCR_BUF_SIZE +    /* This could be on the way */
+					   TTY_THRESHOLD_THROTTLE)) { /* Some slack */
+			DFLOW(DEBUG_LOG(info->line,"flush_to_flip throttles again! %lu\n", max_flip_size));
+			rs_throttle(tty);
+		}
+#endif
+	}
 
-	while ((buffer = info->first_recv_buffer) && length < TTY_FLIPBUF_SIZE) {
+	if (max_flip_size > TTY_FLIPBUF_SIZE)
+		max_flip_size = TTY_FLIPBUF_SIZE;
+
+	while ((buffer = info->first_recv_buffer) && length < max_flip_size) {
 		unsigned int count = buffer->length;
 
-		if (length + count > TTY_FLIPBUF_SIZE)
-			count = TTY_FLIPBUF_SIZE - length;
+		if (length + count > max_flip_size)
+			count = max_flip_size - length;
 
 		memcpy(tty->flip.char_buf_ptr + length, buffer->buffer, count);
 		memset(tty->flip.flag_buf_ptr + length, TTY_NORMAL, count);
@@ -2156,6 +2559,7 @@ flush_to_flip_buffer(struct e100_serial *info)
 
 		length += count;
 		info->recv_cnt -= count;
+		DFLIP(DEBUG_LOG(info->line,"flip: %i\n", length));
 
 		if (count == buffer->length) {
 			info->first_recv_buffer = buffer->next;
@@ -2171,9 +2575,30 @@ flush_to_flip_buffer(struct e100_serial *info)
 		info->last_recv_buffer = NULL;
 
 	tty->flip.count = length;
-
+	DFLIP(if (tty->ldisc.chars_in_buffer(tty) > 3500) {
+		DEBUG_LOG(info->line, "ldisc %lu\n",
+			  tty->ldisc.chars_in_buffer(tty));
+		DEBUG_LOG(info->line, "flip.count %lu\n",
+			  tty->flip.count);
+	      }
+	      );
 	restore_flags(flags);
 
+	DFLIP(
+	  if (1) {
+
+		  if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
+			  DEBUG_LOG(info->line, "*** TTY_DONT_FLIP set flip.count %i ***\n", tty->flip.count);
+			  DEBUG_LOG(info->line, "*** recv_cnt %i\n", info->recv_cnt);
+		  } else {
+		  }
+		  DEBUG_LOG(info->line, "*** rxtot %i\n", info->icount.rx);
+		  DEBUG_LOG(info->line, "ldisc %lu\n", tty->ldisc.chars_in_buffer(tty));
+		  DEBUG_LOG(info->line, "room  %lu\n", tty->ldisc.receive_room(tty));
+	  }
+
+	);
+
 	/* this includes a check for low-latency */
 	tty_flip_buffer_push(tty);
 }
@@ -2181,12 +2606,19 @@ flush_to_flip_buffer(struct e100_serial *info)
 static _INLINE_ void
 check_flush_timeout(struct e100_serial *info)
 {
-	force_eop_if_needed(info);
-
+	/* Flip what we've got (if we can) */
 	flush_to_flip_buffer(info);
 
+	/* We might need to flip later, but not to fast
+	 * since the system is busy processing input... */
 	if (info->first_recv_buffer)
-		START_FLUSH_FAST_TIMER(info, "flip");
+		START_FLUSH_FAST_TIMER_TIME(info, "flip", 2000);
+
+	/* Force eop last, since data might have come while we're processing
+	 * and if we started the slow timer above, we won't start a fast
+	 * below.
+	 */
+	force_eop_if_needed(info);
 }
 
 #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER
@@ -2222,7 +2654,7 @@ timed_flush_handler(unsigned long ptr)
 	
 	for (i = 0; i < NR_PORTS; i++) {
 		info = rs_table + i;
-		if (info->uses_dma) 
+		if (info->uses_dma_in)
 			check_flush_timeout(info);
 	}
 
@@ -2301,14 +2733,158 @@ TODO: The break will be delayed until an F or V character is received.
 
 */
 
-extern irqreturn_t _INLINE_ handle_ser_interrupt(struct e100_serial *info)
+extern _INLINE_
+struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
 {
-	unsigned char rstat = info->port[REG_STATUS];
+	unsigned long data_read;
+	struct tty_struct *tty = info->tty;
+
+	if (!tty) {
+		printk("!NO TTY!\n");
+		return info;
+	}
+	if (tty->flip.count >= TTY_FLIPBUF_SIZE - TTY_THRESHOLD_THROTTLE) {
+		/* check TTY_THROTTLED first so it indicates our state */
+		if (!test_and_set_bit(TTY_THROTTLED, &tty->flags)) {
+			DFLOW(DEBUG_LOG(info->line, "rs_throttle flip.count: %i\n", tty->flip.count));
+			rs_throttle(tty);
+		}
+	}
+	if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+		DEBUG_LOG(info->line, "force FLIP! %i\n", tty->flip.count);
+		tty->flip.work.func((void *) tty);
+		if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+			DEBUG_LOG(info->line, "FLIP FULL! %i\n", tty->flip.count);
+			return info;		/* if TTY_DONT_FLIP is set */
+		}
+	}
+	/* Read data and status at the same time */
+	data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
+more_data:
+	if (data_read & IO_MASK(R_SERIAL0_READ, xoff_detect) ) {
+		DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0));
+	}
+	DINTR2(DEBUG_LOG(info->line, "ser_rx   %c\n", IO_EXTRACT(R_SERIAL0_READ, data_in, data_read)));
+
+	if (data_read & ( IO_MASK(R_SERIAL0_READ, framing_err) |
+			  IO_MASK(R_SERIAL0_READ, par_err) |
+			  IO_MASK(R_SERIAL0_READ, overrun) )) {
+		/* An error */
+		info->last_rx_active_usec = GET_JIFFIES_USEC();
+		info->last_rx_active = jiffies;
+		DINTR1(DEBUG_LOG(info->line, "ser_rx err stat_data %04X\n", data_read));
+		DLOG_INT_TRIG(
+		if (!log_int_trig1_pos) {
+			log_int_trig1_pos = log_int_pos;
+			log_int(rdpc(), 0, 0);
+		}
+		);
+
+
+		if ( ((data_read & IO_MASK(R_SERIAL0_READ, data_in)) == 0) &&
+		     (data_read & IO_MASK(R_SERIAL0_READ, framing_err)) ) {
+			/* Most likely a break, but we get interrupts over and
+			 * over again.
+			 */
+
+			if (!info->break_detected_cnt) {
+				DEBUG_LOG(info->line, "#BRK start\n", 0);
+			}
+			if (data_read & IO_MASK(R_SERIAL0_READ, rxd)) {
+				/* The RX pin is high now, so the break
+				 * must be over, but....
+				 * we can't really know if we will get another
+				 * last byte ending the break or not.
+				 * And we don't know if the byte (if any) will
+				 * have an error or look valid.
+				 */
+				DEBUG_LOG(info->line, "# BL BRK\n", 0);
+				info->errorcode = ERRCODE_INSERT_BREAK;
+			}
+			info->break_detected_cnt++;
+		} else {
+			/* The error does not look like a break, but could be
+			 * the end of one
+			 */
+			if (info->break_detected_cnt) {
+				DEBUG_LOG(info->line, "EBRK %i\n", info->break_detected_cnt);
+				info->errorcode = ERRCODE_INSERT_BREAK;
+			} else {
+				if (info->errorcode == ERRCODE_INSERT_BREAK) {
+					info->icount.brk++;
+					*tty->flip.char_buf_ptr = 0;
+					*tty->flip.flag_buf_ptr = TTY_BREAK;
+					tty->flip.flag_buf_ptr++;
+					tty->flip.char_buf_ptr++;
+					tty->flip.count++;
+					info->icount.rx++;
+				}
+				*tty->flip.char_buf_ptr = IO_EXTRACT(R_SERIAL0_READ, data_in, data_read);
+
+				if (data_read & IO_MASK(R_SERIAL0_READ, par_err)) {
+					info->icount.parity++;
+					*tty->flip.flag_buf_ptr = TTY_PARITY;
+				} else if (data_read & IO_MASK(R_SERIAL0_READ, overrun)) {
+					info->icount.overrun++;
+					*tty->flip.flag_buf_ptr = TTY_OVERRUN;
+				} else if (data_read & IO_MASK(R_SERIAL0_READ, framing_err)) {
+					info->icount.frame++;
+					*tty->flip.flag_buf_ptr = TTY_FRAME;
+				}
+				info->errorcode = 0;
+			}
+			info->break_detected_cnt = 0;
+		}
+	} else if (data_read & IO_MASK(R_SERIAL0_READ, data_avail)) {
+		/* No error */
+		DLOG_INT_TRIG(
+		if (!log_int_trig1_pos) {
+			if (log_int_pos >= log_int_size) {
+				log_int_pos = 0;
+			}
+			log_int_trig0_pos = log_int_pos;
+			log_int(rdpc(), 0, 0);
+		}
+		);
+		*tty->flip.char_buf_ptr = IO_EXTRACT(R_SERIAL0_READ, data_in, data_read);
+		*tty->flip.flag_buf_ptr = 0;
+	} else {
+		DEBUG_LOG(info->line, "ser_rx int but no data_avail  %08lX\n", data_read);
+	}
+
+
+	tty->flip.flag_buf_ptr++;
+	tty->flip.char_buf_ptr++;
+	tty->flip.count++;
+	info->icount.rx++;
+	data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
+	if (data_read & IO_MASK(R_SERIAL0_READ, data_avail)) {
+		DEBUG_LOG(info->line, "ser_rx   %c in loop\n", IO_EXTRACT(R_SERIAL0_READ, data_in, data_read));
+		goto more_data;
+	}
+
+	tty_flip_buffer_push(info->tty);
+	return info;
+}
+
+extern _INLINE_
+struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info)
+{
+	unsigned char rstat;
 
 #ifdef SERIAL_DEBUG_INTR
 	printk("Interrupt from serport %d\n", i);
 #endif
 /*	DEBUG_LOG(info->line, "ser_interrupt stat %03X\n", rstat | (i << 8)); */
+	if (!info->uses_dma_in) {
+		return handle_ser_rx_interrupt_no_dma(info);
+	}
+	/* DMA is used */
+	rstat = info->port[REG_STATUS];
+	if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) {
+		DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0));
+	}
+
 	if (rstat & SER_ERROR_MASK) {
 		unsigned char data;
 
@@ -2318,7 +2894,8 @@ extern irqreturn_t _INLINE_ handle_ser_interrupt(struct e100_serial *info)
 		 * data_in field
 		 */
 		data = info->port[REG_DATA];
-
+		DINTR1(DEBUG_LOG(info->line, "ser_rx!  %c\n", data));
+		DINTR1(DEBUG_LOG(info->line, "ser_rx err stat %02X\n", rstat));
 		if (!data && (rstat & SER_FRAMING_ERR_MASK)) {
 			/* Most likely a break, but we get interrupts over and
 			 * over again.
@@ -2347,15 +2924,22 @@ extern irqreturn_t _INLINE_ handle_ser_interrupt(struct e100_serial *info)
 				DEBUG_LOG(info->line, "EBRK %i\n", info->break_detected_cnt);
 				info->errorcode = ERRCODE_INSERT_BREAK;
 			} else {
-				if (info->errorcode == ERRCODE_INSERT_BREAK)
+				if (info->errorcode == ERRCODE_INSERT_BREAK) {
+					info->icount.brk++;
 					add_char_and_flag(info, '\0', TTY_BREAK);
+				}
 
-				if (rstat & SER_PAR_ERR_MASK)
+				if (rstat & SER_PAR_ERR_MASK) {
+					info->icount.parity++;
 					add_char_and_flag(info, data, TTY_PARITY);
-				else if (rstat & SER_OVERRUN_MASK)
+				} else if (rstat & SER_OVERRUN_MASK) {
+					info->icount.overrun++;
 					add_char_and_flag(info, data, TTY_OVERRUN);
-				else if (rstat & SER_FRAMING_ERR_MASK)
+				} else if (rstat & SER_FRAMING_ERR_MASK) {
+					info->icount.frame++;
 					add_char_and_flag(info, data, TTY_FRAME);
+				}
+
 				info->errorcode = 0;
 			}
 			info->break_detected_cnt = 0;
@@ -2379,7 +2963,7 @@ extern irqreturn_t _INLINE_ handle_ser_interrupt(struct e100_serial *info)
 			if (elapsed_usec < 2*info->char_time_usec) {
 				DEBUG_LOG(info->line, "FBRK %i\n", info->line);
 				/* Report as BREAK (error) and let
-				 * receive_chars() handle it
+				 * receive_chars_dma() handle it
 				 */
 				info->errorcode = ERRCODE_SET_BREAK;
 			} else {
@@ -2392,38 +2976,196 @@ extern irqreturn_t _INLINE_ handle_ser_interrupt(struct e100_serial *info)
 		printk("** OK, disabling ser_interrupts\n");
 #endif
 		e100_disable_serial_data_irq(info);
-
+		DINTR2(DEBUG_LOG(info->line, "ser_rx OK %d\n", info->line));
 		info->break_detected_cnt = 0;
 
 		PROCSTAT(ser_stat[info->line].ser_ints_ok_cnt++);
-		DEBUG_LOG(info->line, "ser_int OK %d\n", info->line);
 	}
-
 	/* Restarting the DMA never hurts */
 	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, restart);
 	START_FLUSH_FAST_TIMER(info, "ser_int");
-	return IRQ_HANDLED;
-} /* handle_ser_interrupt */
+	return info;
+} /* handle_ser_rx_interrupt */
+
+extern _INLINE_ void handle_ser_tx_interrupt(struct e100_serial *info)
+{
+	unsigned long flags;
+
+	if (info->x_char) {
+		unsigned char rstat;
+		DFLOW(DEBUG_LOG(info->line, "tx_int: xchar 0x%02X\n", info->x_char));
+		save_flags(flags); cli();
+		rstat = info->port[REG_STATUS];
+		DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
+
+		info->port[REG_TR_DATA] = info->x_char;
+		info->icount.tx++;
+		info->x_char = 0;
+		/* We must enable since it is disabled in ser_interrupt */
+		e100_enable_serial_tx_ready_irq(info);
+		restore_flags(flags);
+		return;
+	}
+	if (info->uses_dma_out) {
+		unsigned char rstat;
+		int i;
+		/* We only use normal tx interrupt when sending x_char */
+		DFLOW(DEBUG_LOG(info->line, "tx_int: xchar sent\n", 0));
+		save_flags(flags); cli();
+		rstat = info->port[REG_STATUS];
+		DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
+		e100_disable_serial_tx_ready_irq(info);
+		if (info->tty->stopped)
+			rs_stop(info->tty);
+		/* Enable the DMA channel and tell it to continue */
+		e100_enable_txdma_channel(info);
+		/* Wait 12 cycles before doing the DMA command */
+		for(i = 6;  i > 0; i--)
+			nop();
+
+		*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, continue);
+		restore_flags(flags);
+		return;
+	}
+	/* Normal char-by-char interrupt */
+	if (info->xmit.head == info->xmit.tail
+	    || info->tty->stopped
+	    || info->tty->hw_stopped) {
+		DFLOW(DEBUG_LOG(info->line, "tx_int: stopped %i\n", info->tty->stopped));
+		e100_disable_serial_tx_ready_irq(info);
+		info->tr_running = 0;
+		return;
+	}
+	DINTR2(DEBUG_LOG(info->line, "tx_int %c\n", info->xmit.buf[info->xmit.tail]));
+	/* Send a byte, rs485 timing is critical so turn of ints */
+	save_flags(flags); cli();
+	info->port[REG_TR_DATA] = info->xmit.buf[info->xmit.tail];
+	info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);
+	info->icount.tx++;
+	if (info->xmit.head == info->xmit.tail) {
+#if defined(CONFIG_ETRAX_RS485) && defined(CONFIG_ETRAX_FAST_TIMER)
+		if (info->rs485.enabled) {
+			/* Set a short timer to toggle RTS */
+			start_one_shot_timer(&fast_timers_rs485[info->line],
+			                     rs485_toggle_rts_timer_function,
+			                     (unsigned long)info,
+			                     info->char_time_usec*2,
+			                     "RS-485");
+		}
+#endif /* RS485 */
+		info->last_tx_active_usec = GET_JIFFIES_USEC();
+		info->last_tx_active = jiffies;
+		e100_disable_serial_tx_ready_irq(info);
+		info->tr_running = 0;
+		DFLOW(DEBUG_LOG(info->line, "tx_int: stop2\n", 0));
+	} else {
+		/* We must enable since it is disabled in ser_interrupt */
+		e100_enable_serial_tx_ready_irq(info);
+	}
+	restore_flags(flags);
+
+	if (CIRC_CNT(info->xmit.head,
+		     info->xmit.tail,
+		     SERIAL_XMIT_SIZE) < WAKEUP_CHARS)
+		rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
 
+} /* handle_ser_tx_interrupt */
+
+/* result of time measurements:
+ * RX duration 54-60 us when doing something, otherwise 6-9 us
+ * ser_int duration: just sending: 8-15 us normally, up to 73 us
+ */
 static irqreturn_t
 ser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
+	static volatile int tx_started = 0;
 	struct e100_serial *info;
 	int i;
+	unsigned long flags;
+	unsigned long irq_mask1_rd;
+	unsigned long data_mask = (1 << (8+2*0)); /* ser0 data_avail */
 	int handled = 0;
+	static volatile unsigned long reentered_ready_mask = 0;
 
+	save_flags(flags); cli();
+	irq_mask1_rd = *R_IRQ_MASK1_RD;
+	/* First handle all rx interrupts with ints disabled */
+	info = rs_table;
+	irq_mask1_rd &= e100_ser_int_mask;
 	for (i = 0; i < NR_PORTS; i++) {
-		info = rs_table + i;
-
-		if (!info->enabled || !info->uses_dma) 
-			continue; 
-
-		/* Which line caused the irq? */
-		if (*R_IRQ_MASK1_RD & (1U << (8+2*info->line))) { 
+		/* Which line caused the data irq? */
+		if (irq_mask1_rd & data_mask) {
 			handled = 1;
-			handle_ser_interrupt(info);
+			handle_ser_rx_interrupt(info);
+		}
+		info += 1;
+		data_mask <<= 2;
+	}
+	/* Handle tx interrupts with interrupts enabled so we
+	 * can take care of new data interrupts while transmitting
+	 * We protect the tx part with the tx_started flag.
+	 * We disable the tr_ready interrupts we are about to handle and
+	 * unblock the serial interrupt so new serial interrupts may come.
+	 *
+	 * If we get a new interrupt:
+	 *  - it migth be due to synchronous serial ports.
+	 *  - serial irq will be blocked by general irq handler.
+	 *  - async data will be handled above (sync will be ignored).
+	 *  - tx_started flag will prevent us from trying to send again and
+	 *    we will exit fast - no need to unblock serial irq.
+	 *  - Next (sync) serial interrupt handler will be runned with
+	 *    disabled interrupt due to restore_flags() at end of function,
+	 *    so sync handler will not be preempted or reentered.
+	 */
+	if (!tx_started) {
+		unsigned long ready_mask;
+		unsigned long
+		tx_started = 1;
+		/* Only the tr_ready interrupts left */
+		irq_mask1_rd &= (IO_MASK(R_IRQ_MASK1_RD, ser0_ready) |
+				 IO_MASK(R_IRQ_MASK1_RD, ser1_ready) |
+				 IO_MASK(R_IRQ_MASK1_RD, ser2_ready) |
+				 IO_MASK(R_IRQ_MASK1_RD, ser3_ready));
+		while (irq_mask1_rd) {
+			/* Disable those we are about to handle */
+			*R_IRQ_MASK1_CLR = irq_mask1_rd;
+			/* Unblock the serial interrupt */
+			*R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, serial, set);
+
+			sti();
+			ready_mask = (1 << (8+1+2*0)); /* ser0 tr_ready */
+			info = rs_table;
+			for (i = 0; i < NR_PORTS; i++) {
+				/* Which line caused the ready irq? */
+				if (irq_mask1_rd & ready_mask) {
+					handled = 1;
+					handle_ser_tx_interrupt(info);
+				}
+				info += 1;
+				ready_mask <<= 2;
+			}
+			/* handle_ser_tx_interrupt enables tr_ready interrupts */
+			cli();
+			/* Handle reentered TX interrupt */
+			irq_mask1_rd = reentered_ready_mask;
+		}
+		cli();
+		tx_started = 0;
+	} else {
+		unsigned long ready_mask;
+		ready_mask = irq_mask1_rd & (IO_MASK(R_IRQ_MASK1_RD, ser0_ready) |
+					     IO_MASK(R_IRQ_MASK1_RD, ser1_ready) |
+					     IO_MASK(R_IRQ_MASK1_RD, ser2_ready) |
+					     IO_MASK(R_IRQ_MASK1_RD, ser3_ready));
+		if (ready_mask) {
+			reentered_ready_mask |= ready_mask;
+			/* Disable those we are about to handle */
+			*R_IRQ_MASK1_CLR = ready_mask;
+			DFLOW(DEBUG_LOG(SERIAL_DEBUG_LINE, "ser_int reentered with TX %X\n", ready_mask));
 		}
 	}
+
+	restore_flags(flags);
 	return IRQ_RETVAL(handled);
 } /* ser_interrupt */
 #endif
@@ -2489,7 +3231,7 @@ startup(struct e100_serial * info)
 		info->xmit.buf = (unsigned char *) xmit_page;
 
 #ifdef SERIAL_DEBUG_OPEN
-	printk("starting up ttyS%d (xmit_buf 0x%p, recv_buf 0x%p)...\n", info->line, info->xmit.buf, info->recv.buf);
+	printk("starting up ttyS%d (xmit_buf 0x%p)...\n", info->line, info->xmit.buf);
 #endif
 
 #ifdef CONFIG_SVINTO_SIM
@@ -2520,24 +3262,39 @@ startup(struct e100_serial * info)
 	 * Reset the DMA channels and make sure their interrupts are cleared
 	 */
 
-	info->uses_dma = 1;
-	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
-	*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
+	if (info->dma_in_enabled) {
+		info->uses_dma_in = 1;
+		e100_enable_rxdma_channel(info);
 
-	/* Wait until reset cycle is complete */
-	while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->icmdadr) ==
-	       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
+		*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
 
-	while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->ocmdadr) ==
-	       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
+		/* Wait until reset cycle is complete */
+		while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->icmdadr) ==
+		       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
 
-	/* Make sure the irqs are cleared */
-	*info->iclrintradr =
-		IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
-		IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);
-	*info->oclrintradr =
-		IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
-		IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);
+		/* Make sure the irqs are cleared */
+		*info->iclrintradr =
+			IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
+			IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);
+	} else {
+		e100_disable_rxdma_channel(info);
+	}
+
+	if (info->dma_out_enabled) {
+		info->uses_dma_out = 1;
+		e100_enable_txdma_channel(info);
+		*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
+
+		while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->ocmdadr) ==
+		       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
+
+		/* Make sure the irqs are cleared */
+		*info->oclrintradr =
+			IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
+			IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);
+	} else {
+		e100_disable_txdma_channel(info);
+	}
 
 	if (info->tty)
 		clear_bit(TTY_IO_ERROR, &info->tty->flags);
@@ -2563,9 +3320,10 @@ startup(struct e100_serial * info)
 	(void)info->port[REG_DATA];
 
 	/* enable the interrupts */
+	if (info->uses_dma_out)
+		e100_enable_txdma_irq(info);
 
-	e100_enable_txdma_irq(info);
-	e100_enable_rxdma_irq(info);
+	e100_enable_rx_irq(info);
 
 	info->tr_running = 0; /* to be sure we don't lock up the transmitter */
 
@@ -2606,20 +3364,28 @@ shutdown(struct e100_serial * info)
 
 #ifndef CONFIG_SVINTO_SIM	
 	/* shut down the transmitter and receiver */
-
+	DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line));
 	e100_disable_rx(info);
 	info->port[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40);
 
-	e100_disable_rxdma_irq(info);
-	e100_disable_txdma_irq(info);
-
-	info->tr_running = 0;
-
-	/* reset both dma channels */
+	/* disable interrupts, reset dma channels */
+	if (info->uses_dma_in) {
+		e100_disable_rxdma_irq(info);
+		*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
+		info->uses_dma_in = 0;
+	} else {
+		e100_disable_serial_data_irq(info);
+	}
 
-	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
-	*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
-	info->uses_dma = 0;
+	if (info->uses_dma_out) {
+		e100_disable_txdma_irq(info);
+		info->tr_running = 0;
+		*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
+		info->uses_dma_out = 0;
+	} else {
+		e100_disable_serial_tx_ready_irq(info);
+		info->tr_running = 0;
+	}
 
 #endif /* CONFIG_SVINTO_SIM */
 
@@ -2667,7 +3433,7 @@ change_speed(struct e100_serial *info)
 {
 	unsigned int cflag;
 	unsigned long xoff;
-
+	unsigned long flags;
 	/* first some safety checks */
 	
 	if (!info->tty || !info->tty->termios)
@@ -2676,17 +3442,80 @@ change_speed(struct e100_serial *info)
 		return;
 	
 	cflag = info->tty->termios->c_cflag;
-	
+
 	/* possibly, the tx/rx should be disabled first to do this safely */
 	
 	/* change baud-rate and write it to the hardware */
-	
-	info->baud = cflag_to_baud(cflag);
+	if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) {
+		/* Special baudrate */
+		u32 mask = 0xFF << (info->line*8); /* Each port has 8 bits */
+		unsigned long alt_source =
+				IO_STATE(R_ALT_SER_BAUDRATE, ser0_rec, normal) |
+				IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, normal);
+		/* R_ALT_SER_BAUDRATE selects the source */
+		DBAUD(printk("Custom baudrate: baud_base/divisor %lu/%i\n",
+		       (unsigned long)info->baud_base, info->custom_divisor));
+		if (info->baud_base == SERIAL_PRESCALE_BASE) {
+			/* 0, 2-65535 (0=65536) */
+			u16 divisor = info->custom_divisor;
+			/* R_SERIAL_PRESCALE (upper 16 bits of R_CLOCK_PRESCALE) */
+			/* baudrate is 3.125MHz/custom_divisor */
+			alt_source =
+				IO_STATE(R_ALT_SER_BAUDRATE, ser0_rec, prescale) |
+				IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, prescale);
+			alt_source = 0x11;
+			DBAUD(printk("Writing SERIAL_PRESCALE: divisor %i\n", divisor));
+			*R_SERIAL_PRESCALE = divisor;
+			info->baud = SERIAL_PRESCALE_BASE/divisor;
+		}
+#ifdef CONFIG_ETRAX_EXTERN_PB6CLK_ENABLED
+		else if ((info->baud_base==CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8 &&
+			  info->custom_divisor == 1) ||
+			 (info->baud_base==CONFIG_ETRAX_EXTERN_PB6CLK_FREQ &&
+			  info->custom_divisor == 8)) {
+				/* ext_clk selected */
+				alt_source =
+					IO_STATE(R_ALT_SER_BAUDRATE, ser0_rec, extern) |
+					IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, extern);
+				DBAUD(printk("using external baudrate: %lu\n", CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8));
+				info->baud = CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8;
+			}
+		}
+#endif
+		else
+		{
+			/* Bad baudbase, we don't support using timer0
+			 * for baudrate.
+			 */
+			printk(KERN_WARNING "Bad baud_base/custom_divisor: %lu/%i\n",
+			       (unsigned long)info->baud_base, info->custom_divisor);
+		}
+		r_alt_ser_baudrate_shadow &= ~mask;
+		r_alt_ser_baudrate_shadow |= (alt_source << (info->line*8));
+		*R_ALT_SER_BAUDRATE = r_alt_ser_baudrate_shadow;
+	} else {
+		/* Normal baudrate */
+		/* Make sure we use normal baudrate */
+		u32 mask = 0xFF << (info->line*8); /* Each port has 8 bits */
+		unsigned long alt_source =
+			IO_STATE(R_ALT_SER_BAUDRATE, ser0_rec, normal) |
+			IO_STATE(R_ALT_SER_BAUDRATE, ser0_tr, normal);
+		r_alt_ser_baudrate_shadow &= ~mask;
+		r_alt_ser_baudrate_shadow |= (alt_source << (info->line*8));
+#ifndef CONFIG_SVINTO_SIM
+		*R_ALT_SER_BAUDRATE = r_alt_ser_baudrate_shadow;
+#endif /* CONFIG_SVINTO_SIM */
+
+		info->baud = cflag_to_baud(cflag);
+#ifndef CONFIG_SVINTO_SIM
+		info->port[REG_BAUD] = cflag_to_etrax_baud(cflag);
+#endif /* CONFIG_SVINTO_SIM */
+	}
 	
 #ifndef CONFIG_SVINTO_SIM
-	info->port[REG_BAUD] = cflag_to_etrax_baud(cflag);
 	/* start with default settings and then fill in changes */
-
+	save_flags(flags);
+	cli();
 	/* 8 bit, no/even parity */
 	info->rx_ctrl &= ~(IO_MASK(R_SERIAL0_REC_CTRL, rec_bitnr) |
 			   IO_MASK(R_SERIAL0_REC_CTRL, rec_par_en) |
@@ -2717,24 +3546,19 @@ change_speed(struct e100_serial *info)
 	}
 	
 	if (cflag & CMSPAR) {
-		/* enable stick parity */
+		/* enable stick parity, PARODD mean Mark which matches ETRAX */
 		info->tx_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_stick_par, stick);
 		info->rx_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_stick_par, stick);
-		if (!(cflag & PARODD)) {
-			/* set mark parity */
-			info->tx_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_par, odd);
-			info->rx_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_par, odd);
-		}
-	} else {
-		if (cflag & PARODD) {
-			/* set odd parity */
-			info->tx_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_par, odd);
-			info->rx_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_par, odd);
-		}
+	}
+	if (cflag & PARODD) {
+		/* set odd parity (or Mark if CMSPAR) */
+		info->tx_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_par, odd);
+		info->rx_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_par, odd);
 	}
 	
 	if (cflag & CRTSCTS) {
 		/* enable automatic CTS handling */
+		DFLOW(DEBUG_LOG(info->line, "FLOW auto_cts enabled\n", 0));
 		info->tx_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, auto_cts, active);
 	}
 	
@@ -2750,13 +3574,16 @@ change_speed(struct e100_serial *info)
 	xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->tty));
 	xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable);
 	if (info->tty->termios->c_iflag & IXON ) {
+		DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n", STOP_CHAR(info->tty)));
 		xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
 	}
 	
 	*((unsigned long *)&info->port[REG_XOFF]) = xoff;
+	restore_flags(flags);
 #endif /* !CONFIG_SVINTO_SIM */
 
 	update_char_time(info);
+
 } /* change_speed */
 
 /* start transmitting chars NOW */
@@ -2786,8 +3613,8 @@ rs_flush_chars(struct tty_struct *tty)
 	restore_flags(flags);
 }
 
-extern inline int 
-raw_write(struct tty_struct * tty, int from_user,
+extern _INLINE_ int
+rs_raw_write(struct tty_struct * tty, int from_user,
 	  const unsigned char *buf, int count)
 {
 	int	c, ret = 0;
@@ -2801,7 +3628,7 @@ raw_write(struct tty_struct * tty, int from_user,
 	
 #ifdef SERIAL_DEBUG_DATA
 	if (info->line == SERIAL_DEBUG_LINE)
-		printk("raw_write (%d), status %d\n", 
+		printk("rs_raw_write (%d), status %d\n",
 		       count, info->port[REG_STATUS]);
 #endif
 
@@ -2811,6 +3638,9 @@ raw_write(struct tty_struct * tty, int from_user,
 	return count;
 #endif
 	save_flags(flags);
+	DFLOW(DEBUG_LOG(info->line, "write count %i ", count));
+	DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty)));
+
 	
 	/* the cli/restore_flags pairs below are needed because the
 	 * DMA interrupt handler moves the info->xmit values. the memcpy
@@ -2878,6 +3708,7 @@ raw_write(struct tty_struct * tty, int from_user,
 	 * this does not need IRQ protection since if tr_running == 0
 	 * the IRQ's are not running anyway for this port.
 	 */
+	DFLOW(DEBUG_LOG(info->line, "write ret %i\n", ret));
 	
 	if (info->xmit.head != info->xmit.tail &&
 	    !tty->stopped &&
@@ -2887,7 +3718,7 @@ raw_write(struct tty_struct * tty, int from_user,
 	}
  	
 	return ret;
-} /* raw_write() */
+} /* raw_raw_write() */
 
 static int 
 rs_write(struct tty_struct * tty, int from_user,
@@ -2909,7 +3740,7 @@ rs_write(struct tty_struct * tty, int from_user,
 		e100_rts(info, info->rs485.rts_on_send);
 #if defined(CONFIG_ETRAX_RS485_DISABLE_RECEIVER)
 		e100_disable_rx(info);
-		e100_disable_rxdma_irq(info);
+		e100_enable_rx_irq(info);
 #endif
 
 		if (info->rs485.delay_rts_before_send > 0) {
@@ -2919,7 +3750,7 @@ rs_write(struct tty_struct * tty, int from_user,
 	}
 #endif /* CONFIG_ETRAX_RS485 */
 
-	count = raw_write(tty, from_user, buf, count);
+	count = rs_raw_write(tty, from_user, buf, count);
 
 #if defined(CONFIG_ETRAX_RS485)
 	if (info->rs485.enabled)
@@ -3003,23 +3834,33 @@ rs_flush_buffer(struct tty_struct *tty)
  * This function is used to send a high-priority XON/XOFF character to
  * the device
  *
- * Since we use DMA we don't check for info->x_char in transmit_chars,
- * just disable DMA channel and write the character when possible.
+ * Since we use DMA we don't check for info->x_char in transmit_chars_dma(),
+ * but we do it in handle_ser_tx_interrupt().
+ * We disable DMA channel and enable tx ready interrupt and write the
+ * character when possible.
  */
 static void rs_send_xchar(struct tty_struct *tty, char ch)
 {
 	struct e100_serial *info = (struct e100_serial *)tty->driver_data;
+	unsigned long flags;
+	save_flags(flags); cli();
+	if (info->uses_dma_out) {
+		/* Put the DMA on hold and disable the channel */
+		*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, hold);
+		while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->ocmdadr) !=
+		       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, hold));
+		e100_disable_txdma_channel(info);
+	}
 
-	e100_disable_txdma_channel(info);
-
-	/* Wait for tr_ready */
-	while (!(info->port[REG_STATUS] & IO_MASK(R_SERIAL0_STATUS, tr_ready)))
-		/* wait */;
-
-	/* Write the XON/XOFF char */
-	info->port[REG_TR_DATA] = ch;
+	/* Must make sure transmitter is not stopped before we can transmit */
+	if (tty->stopped)
+		rs_start(tty);
 
-	e100_enable_txdma_channel(info);
+	/* Enable manual transmit interrupt and send from there */
+	DFLOW(DEBUG_LOG(info->line, "rs_send_xchar 0x%02X\n", ch));
+	info->x_char = ch;
+	e100_enable_serial_tx_ready_irq(info);
+	restore_flags(flags);
 }
 
 /*
@@ -3034,21 +3875,18 @@ static void
 rs_throttle(struct tty_struct * tty)
 {
 	struct e100_serial *info = (struct e100_serial *)tty->driver_data;
-	unsigned long flags;
 #ifdef SERIAL_DEBUG_THROTTLE
 	char	buf[64];
 
-	printk("throttle %s: %d....\n", _tty_name(tty, buf),
-	       tty->ldisc.chars_in_buffer(tty));
+	printk("throttle %s: %lu....\n", tty_name(tty, buf),
+	       (unsigned long)tty->ldisc.chars_in_buffer(tty));
 #endif
+	DFLOW(DEBUG_LOG(info->line,"rs_throttle %lu\n", tty->ldisc.chars_in_buffer(tty)));
 
 	/* Do RTS before XOFF since XOFF might take some time */
 	if (tty->termios->c_cflag & CRTSCTS) {
-		/* Turn off RTS line (do this atomic) */
-		save_flags(flags); 
-		cli();
+		/* Turn off RTS line */
 		e100_rts(info, 0);
-		restore_flags(flags);
 	}
 	if (I_IXOFF(tty))
 		rs_send_xchar(tty, STOP_CHAR(tty));
@@ -3059,21 +3897,18 @@ static void
 rs_unthrottle(struct tty_struct * tty)
 {
 	struct e100_serial *info = (struct e100_serial *)tty->driver_data;
-	unsigned long flags;
 #ifdef SERIAL_DEBUG_THROTTLE
 	char	buf[64];
 
-	printk("unthrottle %s: %d....\n", _tty_name(tty, buf),
-	       tty->ldisc.chars_in_buffer(tty));
+	printk("unthrottle %s: %lu....\n", tty_name(tty, buf),
+	       (unsigned long)tty->ldisc.chars_in_buffer(tty));
 #endif
-
+	DFLOW(DEBUG_LOG(info->line,"rs_unthrottle ldisc %d\n", tty->ldisc.chars_in_buffer(tty)));
+	DFLOW(DEBUG_LOG(info->line,"rs_unthrottle flip.count: %i\n", tty->flip.count));
 	/* Do RTS before XOFF since XOFF might take some time */
 	if (tty->termios->c_cflag & CRTSCTS) {
-		/* Assert RTS line (do this atomic) */
-		save_flags(flags); 
-		cli();
+		/* Assert RTS line  */
 		e100_rts(info, 1);
-		restore_flags(flags);
 	}
 
 	if (I_IXOFF(tty)) {
@@ -3110,8 +3945,10 @@ get_serial_info(struct e100_serial * info,
 	tmp.port = (int)info->port;
 	tmp.irq = info->irq;
 	tmp.flags = info->flags;
+	tmp.baud_base = info->baud_base;
 	tmp.close_delay = info->close_delay;
 	tmp.closing_wait = info->closing_wait;
+	tmp.custom_divisor = info->custom_divisor;
 	if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
 		return -EFAULT;
 	return 0;
@@ -3149,8 +3986,10 @@ set_serial_info(struct e100_serial *info,
 	 * At this point, we start making changes.....
 	 */
 	
+	info->baud_base = new_serial.baud_base;
 	info->flags = ((info->flags & ~ASYNC_FLAGS) |
 		       (new_serial.flags & ASYNC_FLAGS));
+	info->custom_divisor = new_serial.custom_divisor;
 	info->type = new_serial.type;
 	info->close_delay = new_serial.close_delay;
 	info->closing_wait = new_serial.closing_wait;
@@ -3418,6 +4257,7 @@ rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
 
 	change_speed(info);
 
+	/* Handle turning off CRTSCTS */
 	if ((old_termios->c_cflag & CRTSCTS) &&
 	    !(tty->termios->c_cflag & CRTSCTS)) {
 		tty->hw_stopped = 0;
@@ -3426,6 +4266,42 @@ rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
 	
 }
 
+/* In debugport.c - register a console write function that uses the normal
+ * serial driver
+ */
+typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len);
+
+extern debugport_write_function debug_write_function;
+
+static int rs_debug_write_function(int i, const char *buf, unsigned int len)
+{
+	int cnt;
+        struct tty_struct *tty;
+        static int recurse_cnt = 0;
+
+        tty = rs_table[i].tty;
+        if (tty)  {
+		unsigned long flags;
+		if (recurse_cnt > 5) /* We skip this debug output */
+			return 1;
+
+		local_irq_save(flags);
+		recurse_cnt++;
+                do {
+                        cnt = rs_write(tty, 0, buf, len);
+                        if (cnt >= 0) {
+                                buf += cnt;
+                                len -= cnt;
+                        } else
+                                len = cnt;
+                } while(len > 0);
+		recurse_cnt--;
+		local_irq_restore(flags);
+                return 1;
+        }
+        return 0;
+}
+
 /*
  * ------------------------------------------------------------
  * rs_close()
@@ -3482,6 +4358,12 @@ rs_close(struct tty_struct *tty, struct file * filp)
 		return;
 	}
 	info->flags |= ASYNC_CLOSING;
+	/*
+	 * Save the termios structure, since this port may have
+	 * separate termios for callout and dialin.
+	 */
+	if (info->flags & ASYNC_NORMAL_ACTIVE)
+		info->normal_termios = *tty->termios;
 	/*
 	 * Now we wait for the transmit buffer to clear; and we notify 
 	 * the line discipline to only process XON/XOFF characters.
@@ -3499,7 +4381,7 @@ rs_close(struct tty_struct *tty, struct file * filp)
 
 #ifndef CONFIG_SVINTO_SIM
 	e100_disable_rx(info);
-	e100_disable_rxdma_irq(info);
+	e100_disable_rx_irq(info);
 
 	if (info->flags & ASYNC_INITIALIZED) {
 		/*
@@ -3537,6 +4419,16 @@ rs_close(struct tty_struct *tty, struct file * filp)
 		info->rs485.enabled = 0;
 #if defined(CONFIG_ETRAX_RS485_ON_PA)
 		*R_PORT_PA_DATA = port_pa_data_shadow &= ~(1 << rs485_pa_bit);
+#endif
+#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)
+		REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,
+			       rs485_port_g_bit, 0);
+#endif
+#if defined(CONFIG_ETRAX_RS485_LTC1387)
+		REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,
+			       CONFIG_ETRAX_RS485_LTC1387_DXEN_PORT_G_BIT, 0);
+		REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow,
+			       CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 0);
 #endif
 	}
 #endif
@@ -3637,8 +4529,9 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 		return 0;
 	}
 	
-	if (tty->termios->c_cflag & CLOCAL)
-		do_clocal = 1;
+	if (tty->termios->c_cflag & CLOCAL) {
+			do_clocal = 1;
+	}
 	
 	/*
 	 * Block waiting for the carrier detect and the line to become
@@ -3664,7 +4557,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 	while (1) {
 		save_flags(flags);
 		cli();
-                /* assert RTS and DTR */
+		/* assert RTS and DTR */
 		e100_rts(info, 1);
 		e100_dtr(info, 1);
 		restore_flags(flags);
@@ -3681,7 +4574,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 #endif
 			break;
 		}
-                if (!(info->flags & ASYNC_CLOSING) && do_clocal)
+		if (!(info->flags & ASYNC_CLOSING) && do_clocal)
 			/* && (do_clocal || DCD_IS_ASSERTED) */
 			break;
 		if (signal_pending(current)) {
@@ -3787,10 +4680,21 @@ rs_open(struct tty_struct *tty, struct file * filp)
 #endif
 		return retval;
 	}
-  
+
+	if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
+		*tty->termios = info->normal_termios;
+		change_speed(info);
+	}
+
 #ifdef SERIAL_DEBUG_OPEN
 	printk("rs_open ttyS%d successful...\n", info->line);
 #endif
+	DLOG_INT_TRIG( log_int_pos = 0);
+
+	DFLIP(	if (info->line == SERIAL_DEBUG_LINE) {
+			info->icount.rx = 0;
+		} );
+
 	return 0;
 }
 
@@ -3798,10 +4702,11 @@ rs_open(struct tty_struct *tty, struct file * filp)
  * /proc fs routines....
  */
 
-extern inline int line_info(char *buf, struct e100_serial *info)
+extern _INLINE_ int line_info(char *buf, struct e100_serial *info)
 {
 	char	stat_buf[30];
 	int	ret;
+	unsigned long tmp;
 
 	ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d",
 		      info->line, (unsigned long)info->port, info->irq);
@@ -3831,11 +4736,39 @@ extern inline int line_info(char *buf, struct e100_serial *info)
 	ret += sprintf(buf+ret, " tx:%lu rx:%lu",
 		       (unsigned long)info->icount.tx,
 		       (unsigned long)info->icount.rx);
+	tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
+	if (tmp) {
+		ret += sprintf(buf+ret, " tx_pend:%lu/%lu",
+			       (unsigned long)tmp,
+			       (unsigned long)SERIAL_XMIT_SIZE);
+	}
 
 	ret += sprintf(buf+ret, " rx_pend:%lu/%lu",
 		       (unsigned long)info->recv_cnt,
 		       (unsigned long)info->max_recv_cnt);
 
+#if 1
+	if (info->tty) {
+
+		if (info->tty->stopped)
+			ret += sprintf(buf+ret, " stopped:%i",
+				       (int)info->tty->stopped);
+		if (info->tty->hw_stopped)
+			ret += sprintf(buf+ret, " hw_stopped:%i",
+				       (int)info->tty->hw_stopped);
+	}
+
+	{
+		unsigned char rstat = info->port[REG_STATUS];
+		if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) )
+			ret += sprintf(buf+ret, " xoff_detect:1");
+	}
+
+#endif
+
+
+
+
 	if (info->icount.frame)
 		ret += sprintf(buf+ret, " fe:%lu",
 			       (unsigned long)info->icount.frame);
@@ -3879,6 +4812,22 @@ int rs_read_proc(char *page, char **start, off_t off, int count,
 			len = 0;
 		}
 	}
+#ifdef DEBUG_LOG_INCLUDED
+	for (i = 0; i < debug_log_pos; i++) {
+		len += sprintf(page + len, "%-4i %lu.%lu ", i, debug_log[i].time, timer_data_to_ns(debug_log[i].timer_data));
+		len += sprintf(page + len, debug_log[i].string, debug_log[i].value);
+		if (len+begin > off+count)
+			goto done;
+		if (len+begin < off) {
+			begin += len;
+			len = 0;
+		}
+	}
+	len += sprintf(page + len, "debug_log %i/%i  %li bytes\n",
+		       i, DEBUG_LOG_SIZE, begin+len);
+	debug_log_pos = 0;
+#endif
+
 	*eof = 1;
 done:
 	if (off >= len+begin)
@@ -3893,7 +4842,7 @@ static void
 show_serial_version(void)
 {
 	printk(KERN_INFO
-	       "ETRAX 100LX serial-driver %s, (c) 2000-2003 Axis Communications AB\r\n",
+	       "ETRAX 100LX serial-driver %s, (c) 2000-2004 Axis Communications AB\r\n",
 	       &serial_version[11]); /* "$Revision: x.yy" */
 }
 
@@ -3952,20 +4901,25 @@ rs_init(void)
 	driver->init_termios.c_cflag =
 		B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
 	driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
+	driver->termios = serial_termios;
+	driver->termios_locked = serial_termios_locked;
+
 	tty_set_operations(driver, &rs_ops);
+        serial_driver = driver;
 	if (tty_register_driver(driver))
 		panic("Couldn't register serial driver\n");
-        serial_driver = driver;
-  
 	/* do some initializing for the separate ports */
   
 	for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) {
-		info->uses_dma = 0;   
+		info->uses_dma_in = 0;
+		info->uses_dma_out = 0;
 		info->line = i;
 		info->tty = 0;
 		info->type = PORT_ETRAX;
 		info->tr_running = 0;
 		info->forced_eop = 0;
+		info->baud_base = DEF_BAUD_BASE;
+		info->custom_divisor = 0;
 		info->flags = 0;
 		info->close_delay = 5*HZ/10;
 		info->closing_wait = 30*HZ;
@@ -3973,6 +4927,7 @@ rs_init(void)
 		info->event = 0;
 		info->count = 0;
 		info->blocked_open = 0;
+		info->normal_termios = driver->init_termios;
 		init_waitqueue_head(&info->open_wait);
 		init_waitqueue_head(&info->close_wait);
 		info->xmit.buf = NULL;
@@ -4009,39 +4964,62 @@ rs_init(void)
 #ifndef CONFIG_SVINTO_SIM
 	/* Not needed in simulator.  May only complicate stuff. */
 	/* hook the irq's for DMA channel 6 and 7, serial output and input, and some more... */
+
+	if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial ", NULL))
+		panic("irq8");
+
 #ifdef CONFIG_ETRAX_SERIAL_PORT0
+#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
 	if (request_irq(SER0_DMA_TX_IRQ_NBR, tr_interrupt, SA_INTERRUPT, "serial 0 dma tr", NULL))
 		panic("irq22");
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
 	if (request_irq(SER0_DMA_RX_IRQ_NBR, rec_interrupt, SA_INTERRUPT, "serial 0 dma rec", NULL))
 		panic("irq23");
 #endif
-#ifdef SERIAL_HANDLE_EARLY_ERRORS
-	if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial ", NULL))
-		panic("irq8");
 #endif
+
 #ifdef CONFIG_ETRAX_SERIAL_PORT1
+#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT
 	if (request_irq(SER1_DMA_TX_IRQ_NBR, tr_interrupt, SA_INTERRUPT, "serial 1 dma tr", NULL))
 		panic("irq24");
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN
 	if (request_irq(SER1_DMA_RX_IRQ_NBR, rec_interrupt, SA_INTERRUPT, "serial 1 dma rec", NULL))
 		panic("irq25");
 #endif
+#endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT2
 	/* DMA Shared with par0 (and SCSI0 and ATA) */
-	if (request_irq(SER2_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ, "serial 2 dma tr", NULL))
+#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
+	if (request_irq(SER2_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 2 dma tr", NULL))
 		panic("irq18");
-	if (request_irq(SER2_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ, "serial 2 dma rec", NULL))
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
+	if (request_irq(SER2_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 2 dma rec", NULL))
 		panic("irq19");
 #endif
+#endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT3
 	/* DMA Shared with par1 (and SCSI1 and Extern DMA 0) */
-	if (request_irq(SER3_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ, "serial 3 dma tr", NULL))
+#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT
+	if (request_irq(SER3_DMA_TX_IRQ_NBR, tr_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 3 dma tr", NULL))
 		panic("irq20");
-	if (request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ, "serial 3 dma rec", NULL))
+#endif
+#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN
+	if (request_irq(SER3_DMA_RX_IRQ_NBR, rec_interrupt, SA_SHIRQ | SA_INTERRUPT, "serial 3 dma rec", NULL))
 		panic("irq21");
 #endif
+#endif
 
+#ifdef CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST
+	if (request_irq(TIMER1_IRQ_NBR, timeout_interrupt, SA_SHIRQ | SA_INTERRUPT,
+		       "fast serial dma timeout", NULL)) {
+		printk(KERN_CRIT "err: timer1 irq\n");
+	}
+#endif
 #endif /* CONFIG_SVINTO_SIM */
-
+	debug_write_function = rs_debug_write_function;
 	return 0;
 }
 
diff --git a/arch/cris/arch-v10/drivers/serial.h b/arch/cris/arch-v10/drivers/serial.h
index 45813c657..b7bc8ddf5 100644
--- a/arch/cris/arch-v10/drivers/serial.h
+++ b/arch/cris/arch-v10/drivers/serial.h
@@ -44,15 +44,11 @@ struct e100_serial {
 	volatile u32		*ofirstadr;   /* adr to R_DMA_CHx_FIRST */
 	volatile u8		*ocmdadr;     /* adr to R_DMA_CHx_CMD */
 	const volatile u8	*ostatusadr;  /* adr to R_DMA_CHx_STATUS */
-	volatile u32		*ohwswadr;    /* adr to R_DMA_CHx_HWSW */
-	volatile u32		*odescradr;   /* adr to R_DMA_CHx_DESCR */
 
 	/* Input registers */
 	volatile u8		*iclrintradr; /* adr to R_DMA_CHx_CLR_INTR */
 	volatile u32		*ifirstadr;   /* adr to R_DMA_CHx_FIRST */
 	volatile u8		*icmdadr;     /* adr to R_DMA_CHx_CMD */
-	const volatile u8	*istatusadr;  /* adr to R_DMA_CHx_STATUS */
-	volatile u32		*ihwswadr;    /* adr to R_DMA_CHx_HWSW */
 	volatile u32		*idescradr;   /* adr to R_DMA_CHx_DESCR */
 
 	int			flags;	/* defined in tty.h */
@@ -60,14 +56,17 @@ struct e100_serial {
 	u8			rx_ctrl; /* shadow for R_SERIALx_REC_CTRL */
 	u8			tx_ctrl; /* shadow for R_SERIALx_TR_CTRL */
 	u8			iseteop; /* bit number for R_SET_EOP for the input dma */
-
 	int			enabled; /* Set to 1 if the port is enabled in HW config */
-  
-	/* end of fields defined in rs_table[] in .c-file */
 
-	int			uses_dma; /* Set to 1 if DMA should be used */
-	unsigned char           forced_eop; /* a fifo eop has been forced */
+	u8		dma_out_enabled:1; /* Set to 1 if DMA should be used */
+	u8		dma_in_enabled:1;  /* Set to 1 if DMA should be used */
 
+	/* end of fields defined in rs_table[] in .c-file */
+	u8		uses_dma_in;  /* Set to 1 if DMA is used */
+	u8		uses_dma_out; /* Set to 1 if DMA is used */
+	u8		forced_eop;   /* a fifo eop has been forced */
+	int			baud_base;     /* For special baudrates */
+	int			custom_divisor; /* For special baudrates */
 	struct etrax_dma_descr	tr_descr;
 	struct etrax_dma_descr	rec_descr[SERIAL_RECV_DESCRIPTORS];
 	int			cur_rec_descr;
@@ -95,6 +94,8 @@ struct e100_serial {
 
 	struct work_struct	work;
 	struct async_icount	icount;   /* error-statistics etc.*/
+	struct termios		normal_termios;
+	struct termios		callout_termios;
 #ifdef DECLARE_WAITQUEUE
 	wait_queue_head_t	open_wait;
 	wait_queue_head_t	close_wait;
@@ -104,6 +105,7 @@ struct e100_serial {
 #endif  
 
 	unsigned long		char_time_usec;       /* The time for 1 char, in usecs */
+	unsigned long		flush_time_usec;      /* How often we should flush */
 	unsigned long		last_tx_active_usec;  /* Last tx usec in the jiffies */
 	unsigned long		last_tx_active;       /* Last tx time in jiffies */
 	unsigned long		last_rx_active_usec;  /* Last rx usec in the jiffies */
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c
index 012c3028e..d80269f6f 100644
--- a/arch/cris/arch-v10/kernel/debugport.c
+++ b/arch/cris/arch-v10/kernel/debugport.c
@@ -12,6 +12,15 @@
  *    init_etrax_debug()
  *
  * $Log: debugport.c,v $
+ * Revision 1.14  2004/05/17 13:11:29  starvik
+ * Disable DMA until real serial driver is up
+ *
+ * Revision 1.13  2004/05/14 07:58:01  starvik
+ * Merge of changes from 2.4
+ *
+ * Revision 1.12  2003/09/11 07:29:49  starvik
+ * Merge of Linux 2.6.0-test5
+ *
  * Revision 1.11  2003/07/07 09:53:36  starvik
  * Revert all the 2.5.74 merge changes to make the console work again
  *
@@ -59,7 +68,7 @@
 #include <linux/init.h>
 #include <linux/major.h>
 #include <linux/delay.h>
-
+#include <linux/tty.h>
 #include <asm/system.h>
 #include <asm/arch/svinto.h>
 #include <asm/io.h>             /* Get SIMCOUT. */
@@ -124,22 +133,28 @@
 
 #define MIN_SIZE 32 /* Size that triggers the FIFO to flush characters to interface */
 
-/* Write a string of count length to the console (debug port) using DMA, polled
- * for completion. Interrupts are disabled during the whole process. Some
- * caution needs to be taken to not interfere with ttyS business on this port.
- */
+static struct tty_driver *serial_driver;
+
+typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len);
+
+debugport_write_function debug_write_function = NULL;
+
+static void
+console_write_direct(struct console *co, const char *buf, unsigned int len)
+{
+	int i;
+	/* Send data */
+	for (i = 0; i < len; i++) {
+		/* Wait until transmitter is ready and send.*/
+		while(!(*DEBUG_READ & IO_MASK(R_SERIAL0_READ, tr_ready)));
+                *DEBUG_WRITE = buf[i];
+	}
+}
 
 static void 
 console_write(struct console *co, const char *buf, unsigned int len)
 {
-
-	static struct etrax_dma_descr descr;
-	static struct etrax_dma_descr descr2;
-	static char tmp_buf[MIN_SIZE];
-	static int tmp_size = 0;
-
-	unsigned long flags; 
-	
+	unsigned long flags;
 #ifdef CONFIG_ETRAX_DEBUG_PORT_NULL
         /* no debug printout at all */
         return;
@@ -150,86 +165,18 @@ console_write(struct console *co, const char *buf, unsigned int len)
 	SIMCOUT(buf,len);
 	return;
 #endif
-	
-	local_save_flags(flags);
-	local_irq_disable();
 
 #ifdef CONFIG_ETRAX_KGDB
 	/* kgdb needs to output debug info using the gdb protocol */
 	putDebugString(buf, len);
-	local_irq_restore(flags);
 	return;
 #endif
 
-	/* To make this work together with the real serial port driver
-	 * we have to make sure that everything is flushed when we leave
-	 * here. The following steps are made to assure this:
-	 * 1. Wait until DMA stops, FIFO is empty and serial port pipeline empty.
-	 * 2. Write at least half the FIFO to trigger flush to serial port.
-	 * 3. Wait until DMA stops, FIFO is empty and serial port pipeline empty.
-         */
-
-	/* Do we have enough characters to make the DMA/FIFO happy? */
-	if (tmp_size + len < MIN_SIZE)
-	{
-		int size = min((int)(MIN_SIZE - tmp_size),(int)len);
-		memcpy(&tmp_buf[tmp_size], buf, size);
-		tmp_size += size;
-		len -= size;
-        
-		/* Pad with space if complete line */
-		if (tmp_buf[tmp_size-1] == '\n')
-		{
-			memset(&tmp_buf[tmp_size-1], ' ', MIN_SIZE - tmp_size);
-			tmp_buf[MIN_SIZE - 1] = '\n';
-			tmp_size = MIN_SIZE;
-			len = 0;
-		}
-		else
-		{
-                  /* Wait for more characters */
-			local_irq_restore(flags);
+	local_irq_save(flags);
+	if (debug_write_function)
+		if (debug_write_function(co->index, buf, len))
 			return;
-		}
-	}
-
-	/* make sure the transmitter is enabled. 
-	 * NOTE: this overrides any setting done in ttySx, to 8N1, no auto-CTS.
-	 * in the future, move the tr/rec_ctrl shadows from etrax100ser.c to
-	 * shadows.c and use it here as well...
-	 */
-
-	*DEBUG_TR_CTRL = 0x40;
-	while(*DEBUG_OCMD & 7); /* Until DMA is not running */
-	while(*DEBUG_STATUS & 0x7f); /* wait until output FIFO is empty as well */
-	udelay(200); /* Wait for last two characters to leave the serial transmitter */
-
-	if (tmp_size)
-	{
-		descr.ctrl = len ?  0 : d_eop | d_wait | d_eol;
-		descr.sw_len = tmp_size;
-		descr.buf = virt_to_phys(tmp_buf);
-		descr.next = virt_to_phys(&descr2);
-		descr2.ctrl = d_eop | d_wait | d_eol;
-		descr2.sw_len = len;
-		descr2.buf = virt_to_phys((char*)buf);
-	}
-	else
-	{
-		descr.ctrl = d_eop | d_wait | d_eol;
-		descr.sw_len = len;
-		descr.buf = virt_to_phys((char*)buf);
-	}
-
-	*DEBUG_FIRST = virt_to_phys(&descr); /* write to R_DMAx_FIRST */
-	*DEBUG_OCMD = 1;       /* dma command start -> R_DMAx_CMD */
-
-	/* wait until the output dma channel is ready again */
-	while(*DEBUG_OCMD & 7);
-	while(*DEBUG_STATUS & 0x7f);
-	udelay(200);
-
-	tmp_size = 0;
+	console_write_direct(co, buf, len);
 	local_irq_restore(flags);
 }
 
@@ -279,10 +226,11 @@ enableDebugIRQ(void)
 	*DEBUG_REC_CTRL = IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable);
 }
 
-static kdev_t 
-console_device(struct console *c)
+static struct tty_driver*
+console_device(struct console *c, int *index)
 {
-         return mk_kdev(TTY_MAJOR, 64 + c->index);
+	*index = c->index;
+	return serial_driver;
 }
 
 static int __init 
@@ -311,5 +259,33 @@ static struct console sercons = {
 void __init 
 init_etrax_debug(void)
 {
+#if CONFIG_ETRAX_DEBUG_PORT_NULL
+	return;
+#endif
+
+#if DEBUG_PORT_IDX == 0
+	genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma6);
+	genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused);
+#elif DEBUG_PORT_IDX == 1
+	genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma8);
+	genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb);
+#elif DEBUG_PORT_IDX == 2
+	genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma2);
+	genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0);
+#elif DEBUG_PORT_IDX == 3
+	genconfig_shadow &=  ~IO_MASK(R_GEN_CONFIG, dma4);
+	genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma4, par1);
+#endif
+	*R_GEN_CONFIG = genconfig_shadow;
+
 	register_console(&sercons);
 }
+
+int __init
+init_console(void)
+{
+	serial_driver = alloc_tty_driver(1);
+	if (!serial_driver)
+		return -ENOMEM;
+	return 0;
+}
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index 5e5f5be7e..ddd947d1c 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.16 2003/07/04 08:27:41 starvik Exp $
+/* $Id: entry.S,v 1.18 2004/05/11 12:28:25 starvik Exp $
  *
  *  linux/arch/cris/entry.S
  *
@@ -7,6 +7,12 @@
  *  Authors:	Bjorn Wesen (bjornw@axis.com)
  *
  *  $Log: entry.S,v $
+ *  Revision 1.18  2004/05/11 12:28:25  starvik
+ *  Merge of Linux 2.6.6
+ *
+ *  Revision 1.17  2003/09/11 07:29:49  starvik
+ *  Merge of Linux 2.6.0-test5
+ *
  *  Revision 1.16  2003/07/04 08:27:41  starvik
  *  Merge of Linux 2.5.74
  *
@@ -1060,6 +1066,19 @@ sys_call_table:
  	.long sys_clock_nanosleep
 	.long sys_statfs64
 	.long sys_fstatfs64	
+	.long sys_tgkill	/* 270 */
+	.long sys_utimes
+ 	.long sys_fadvise64_64
+	.long sys_ni_syscall	/* sys_vserver */
+	.long sys_ni_syscall	/* sys_mbind */
+	.long sys_ni_syscall	/* 275 sys_get_mempolicy */
+	.long sys_ni_syscall	/* sys_set_mempolicy */
+	.long sys_mq_open
+	.long sys_mq_unlink
+	.long sys_mq_timedsend
+	.long sys_mq_timedreceive	/* 280 */
+	.long sys_mq_notify
+	.long sys_mq_getsetattr
 		
         /*
          * NOTE!! This doesn't have to be exact - we just have
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index 2c2cb60c4..53b94eb3e 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -1,10 +1,16 @@
-/* $Id: fasttimer.c,v 1.4 2003/07/04 08:27:41 starvik Exp $
+/* $Id: fasttimer.c,v 1.6 2004/05/14 10:18:39 starvik Exp $
  * linux/arch/cris/kernel/fasttimer.c
  *
  * Fast timers for ETRAX100/ETRAX100LX
  * This may be useful in other OS than Linux so use 2 space indentation...
  *
  * $Log: fasttimer.c,v $
+ * Revision 1.6  2004/05/14 10:18:39  starvik
+ * Export fast_timer_list
+ *
+ * Revision 1.5  2004/05/14 07:58:01  starvik
+ * Merge of changes from 2.4
+ *
  * Revision 1.4  2003/07/04 08:27:41  starvik
  * Merge of Linux 2.5.74
  *
@@ -130,7 +136,7 @@ static int fast_timers_deleted = 0;
 static int fast_timer_is_init = 0;
 static int fast_timer_ints = 0;
 
-static struct fast_timer *fast_timer_list = NULL;
+struct fast_timer *fast_timer_list = NULL;
 
 #ifdef DEBUG_LOG_INCLUDED
 #define DEBUG_LOG_MAX 128
@@ -325,7 +331,8 @@ void start_one_shot_timer(struct fast_timer *t,
     {
       if (tmp == t)
       {
-        printk("timer name: %s data: 0x%08lX already in list!\n", name, data);
+        printk(KERN_WARNING
+               "timer name: %s data: 0x%08lX already in list!\n", name, data);
         sanity_failed++;
         return;
       }
@@ -784,7 +791,7 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
       cli();
       if (t->next != nextt)
       {
-        printk("timer removed!\n");
+        printk(KERN_WARNING "timer removed!\n");
       }
       t = nextt;
     }
@@ -965,7 +972,7 @@ void fast_timer_init(void)
     int i;
 #endif
 
-    printk("fast_timer_init()\n");
+    printk(KERN_INFO "fast_timer_init()\n");
 
 #if 0 && defined(FAST_TIMER_TEST)
     for (i = 0; i <= TIMER0_DIV; i++)
diff --git a/arch/cris/arch-v10/kernel/head.S b/arch/cris/arch-v10/kernel/head.S
index 8192cd758..2c1dd1184 100644
--- a/arch/cris/arch-v10/kernel/head.S
+++ b/arch/cris/arch-v10/kernel/head.S
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.6 2003/04/28 05:31:46 starvik Exp $
+/* $Id: head.S,v 1.7 2004/05/14 07:58:01 starvik Exp $
  * 
  * Head of the kernel - alter with care
  *
@@ -7,6 +7,9 @@
  * Authors:	Bjorn Wesen (bjornw@axis.com)
  * 
  * $Log: head.S,v $
+ * Revision 1.7  2004/05/14 07:58:01  starvik
+ * Merge of changes from 2.4
+ *
  * Revision 1.6  2003/04/28 05:31:46  starvik
  * Added section attributes
  *
@@ -331,7 +334,16 @@ _inflash:
 	move.d START_ETHERNET_CLOCK, $r0
 	move.d $r0, [R_NETWORK_GEN_CONFIG]
 #endif
-		
+
+	;; Set up waitstates etc according to kernel configuration.
+#ifndef CONFIG_SVINTO_SIM
+	move.d   CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
+	move.d   $r0, [R_WAITSTATES]
+
+	move.d   CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
+	move.d   $r0, [R_BUS_CONFIG]
+#endif
+
 	;; We need to initialze DRAM registers before we start using the DRAM
 
 	cmp.d	RAM_INIT_MAGIC, $r8	; Already initialized?
@@ -626,8 +638,19 @@ _start_it:
 		| IO_STATE (R_GEN_CONFIG, dma4, extdma0),$r0
 #endif
 
-#if defined(CONFIG_BLUETOOTH) && (defined(CONFIG_BLUETOOTH_RESET_G10) || defined(CONFIG_BLUETOOTH_RESET_G11))
-	or.d	  IO_STATE (R_GEN_CONFIG, g8_15dir, out),$r0
+#if defined(CONFIG_ETRAX_DEF_R_PORT_G0_DIR_OUT)
+        or.d      IO_STATE (R_GEN_CONFIG, g0dir, out),$r0
+#endif
+
+#if defined(CONFIG_ETRAX_DEF_R_PORT_G8_15_DIR_OUT)
+        or.d      IO_STATE (R_GEN_CONFIG, g8_15dir, out),$r0
+#endif
+#if defined(CONFIG_ETRAX_DEF_R_PORT_G16_23_DIR_OUT)
+       or.d      IO_STATE (R_GEN_CONFIG, g16_23dir, out),$r0
+#endif
+
+#if defined(CONFIG_ETRAX_DEF_R_PORT_G24_DIR_OUT)
+       or.d      IO_STATE (R_GEN_CONFIG, g24dir, out),$r0
 #endif
 
 	move.d	$r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index c785b54e6..8aba42472 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.3 2003/07/04 08:27:41 starvik Exp $
+/* $Id: process.c,v 1.6 2004/05/11 12:28:25 starvik Exp $
  * 
  *  linux/arch/cris/kernel/process.c
  *
@@ -16,6 +16,7 @@
 #include <linux/err.h>
 #include <linux/fs.h>
 #include <linux/slab.h>
+#include <asm/arch/svinto.h>
 #include <linux/init.h>
 
 #ifdef CONFIG_ETRAX_GPIO
@@ -217,8 +218,8 @@ asmlinkage int sys_execve(const char *fname, char **argv, char **envp,
  * These bracket the sleeping functions..
  */
 
-#define first_sched     ((unsigned long) scheduling_functions_start_here)
-#define last_sched      ((unsigned long) scheduling_functions_end_here)
+#define first_sched	((unsigned long)__sched_text_start)
+#define last_sched	((unsigned long)__sched_text_end)
 
 unsigned long get_wchan(struct task_struct *p)
 {
@@ -249,3 +250,19 @@ unsigned long get_wchan(struct task_struct *p)
 }
 #undef last_sched
 #undef first_sched
+
+void show_regs(struct pt_regs * regs)
+{
+	unsigned long usp = rdusp();
+	printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n",
+	       regs->irp, regs->srp, regs->dccr, usp, regs->mof );
+	printk(" r0: %08lx  r1: %08lx   r2: %08lx  r3: %08lx\n",
+	       regs->r0, regs->r1, regs->r2, regs->r3);
+	printk(" r4: %08lx  r5: %08lx   r6: %08lx  r7: %08lx\n",
+	       regs->r4, regs->r5, regs->r6, regs->r7);
+	printk(" r8: %08lx  r9: %08lx  r10: %08lx r11: %08lx\n",
+	       regs->r8, regs->r9, regs->r10, regs->r11);
+	printk("r12: %08lx r13: %08lx oR10: %08lx\n",
+	       regs->r12, regs->r13, regs->orig_r10);
+}
+
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index c83eba5d6..39dcc3c72 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -118,19 +118,13 @@ sys_ptrace(long request, long pid, long addr, long data)
 		/* Read the word at location address in the USER area. */
 		case PTRACE_PEEKUSR: {
 			unsigned long tmp;
-			
+
 			ret = -EIO;
-			if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
+			if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
 				break;
-			
-			tmp = 0;  /* Default return condition */
-			ret = -EIO;
-			
-			if (addr < sizeof(struct pt_regs)) {
-				tmp = get_reg(child, addr >> 2);
-				ret = put_user(tmp, (unsigned long *)data);
-			}
-			
+
+			tmp = get_reg(child, addr >> 2);
+			ret = put_user(tmp, (unsigned long *)data);
 			break;
 		}
 		
@@ -148,28 +142,21 @@ sys_ptrace(long request, long pid, long addr, long data)
  		/* Write the word at location address in the USER area. */
 		case PTRACE_POKEUSR:
 			ret = -EIO;
-			
-			if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
+			if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
 				break;
 
-			if (addr < sizeof(struct pt_regs)) {
-				addr >>= 2;
+			addr >>= 2;
 
-				if (addr == PT_DCCR) {
-					/*
-					 * Don't allow the tracing process to
-					 * change stuff like interrupt enable,
-					 * kernel/user bit, etc.
-					 */
-					data &= DCCR_MASK;
-					data |= get_reg(child, PT_DCCR) & ~DCCR_MASK;
-				}
-				
-				if (put_reg(child, addr, data))
-					break;
-				
-				ret = 0;
+			if (addr == PT_DCCR) {
+				/* don't allow the tracing process to change stuff like
+				 * interrupt enable, kernel/user bit, dma enables etc.
+				 */
+				data &= DCCR_MASK;
+				data |= get_reg(child, PT_DCCR) & ~DCCR_MASK;
 			}
+			if (put_reg(child, addr, data))
+				break;
+			ret = 0;
 			break;
 
 		case PTRACE_SYSCALL:
@@ -237,7 +224,7 @@ sys_ptrace(long request, long pid, long addr, long data)
 				
 				if (put_user(tmp, (unsigned long *) data)) {
 					ret = -EFAULT;
-					break;
+					goto out_tsk;
 				}
 				
 				data += sizeof(long);
@@ -255,7 +242,7 @@ sys_ptrace(long request, long pid, long addr, long data)
 			for (i = 0; i <= PT_MAX; i++) {
 				if (get_user(tmp, (unsigned long *) data)) {
 					ret = -EFAULT;
-					break;
+					goto out_tsk;
 				}
 				
 				if (i == PT_DCCR) {
@@ -290,12 +277,10 @@ void do_syscall_trace(void)
 	if (!(current->ptrace & PT_PTRACED))
 		return;
 	
-	current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
-					? 0x80 : 0);
-	
-	current->state = TASK_STOPPED;
-	notify_parent(current, SIGCHLD);
-	schedule();
+	/* the 0x80 provides a way for the tracing parent to distinguish
+	   between a syscall stop and SIGTRAP delivery */
+	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
+				 ? 0x80 : 0));
 	
 	/*
 	 * This isn't the same as continuing with a signal, but it will do for
diff --git a/arch/cris/arch-v10/kernel/setup.c b/arch/cris/arch-v10/kernel/setup.c
index d95930270..b668d7fb6 100644
--- a/arch/cris/arch-v10/kernel/setup.c
+++ b/arch/cris/arch-v10/kernel/setup.c
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.1 2002/12/11 15:42:02 starvik Exp $
+/*
  *
  *  linux/arch/cris/arch-v10/kernel/setup.c
  *
@@ -94,3 +94,10 @@ int show_cpuinfo(struct seq_file *m, void *v)
 }
 
 #endif /* CONFIG_PROC_FS */
+
+void
+show_etrax_copyright(void)
+{
+	printk(KERN_INFO
+               "Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB\n");
+}
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 6698054a5..8db985e29 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -180,6 +180,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
 	unsigned int err = 0;
 	unsigned long old_usp;
 
+        /* Always make any pending restarted system calls return -EINTR */
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
 	/* restore the regs from &sc->regs (same as sc, since regs is first)
 	 * (sc is already checked for VERIFY_READ since the sigframe was
 	 *  checked in sys_sigreturn previously)
@@ -492,7 +495,6 @@ handle_signal(int canrestart, unsigned long sig,
 		/* If so, check system call restarting.. */
 		switch (regs->r10) {
 			case -ERESTART_RESTARTBLOCK:
-				current_thread_info()->restart_block.fn = do_no_restart_syscall;
 			case -ERESTARTNOHAND:
 				/* ERESTARTNOHAND means that the syscall should only be
 				   restarted if there was no handler for the signal, and since
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c
index 31e83a84e..c4d78d52f 100644
--- a/arch/cris/arch-v10/kernel/time.c
+++ b/arch/cris/arch-v10/kernel/time.c
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.2 2003/07/04 08:27:41 starvik Exp $
+/* $Id: time.c,v 1.3 2004/06/01 05:38:42 starvik Exp $
  *
  *  linux/arch/cris/arch-v10/kernel/time.c
  *
@@ -277,6 +277,12 @@ time_init(void)
 		update_xtime_from_cmos();
 	}
 
+	/*
+	 * Initialize wall_to_monotonic such that adding it to xtime will yield zero, the
+	 * tv_nsec field must be normalized (i.e., 0 <= nsec < NSEC_PER_SEC).
+	 */
+	set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
+
 	/* Setup the etrax timers
 	 * Base frequency is 25000 hz, divider 250 -> 100 HZ
 	 * In normal mode, we use timer0, so timer1 is free. In cascade
diff --git a/arch/cris/arch-v10/lib/dram_init.S b/arch/cris/arch-v10/lib/dram_init.S
index 4852709dc..2ef4ad570 100644
--- a/arch/cris/arch-v10/lib/dram_init.S
+++ b/arch/cris/arch-v10/lib/dram_init.S
@@ -1,4 +1,4 @@
-/* $Id: dram_init.S,v 1.3 2003/03/31 09:38:37 starvik Exp $
+/* $Id: dram_init.S,v 1.4 2003/09/22 09:21:59 starvik Exp $
  * 
  * DRAM/SDRAM initialization - alter with care
  * This file is intended to be included from other assembler files
@@ -11,6 +11,10 @@
  * Authors:  Mikael Starvik (starvik@axis.com)	
  * 
  * $Log: dram_init.S,v $
+ * Revision 1.4  2003/09/22 09:21:59  starvik
+ * Decompresser is linked to 0x407xxxxx and sdram commands are at 0x000xxxxx
+ * so we need to mask off 12 bits.
+ *
  * Revision 1.3  2003/03/31 09:38:37  starvik
  * Corrected calculation of end of sdram init commands
  *
@@ -152,9 +156,9 @@ _set_timing:
 	
 	; Issue initialization command sequence
 	move.d   _sdram_commands_start, $r2
-	and.d    0x00ffffff, $r2 ; Make sure commands are read from flash
+	and.d    0x000fffff, $r2 ; Make sure commands are read from flash
 	move.d   _sdram_commands_end,  $r3
-	and.d    0x00ffffff, $r3
+	and.d    0x000fffff, $r3
 1:	clear.d  $r4
 	move.b   [$r2+], $r4
 	lslq     9, $r4	; Command starts at bit 9
diff --git a/arch/cris/arch-v10/lib/old_checksum.c b/arch/cris/arch-v10/lib/old_checksum.c
index 901a68d0b..22a6f0aa9 100644
--- a/arch/cris/arch-v10/lib/old_checksum.c
+++ b/arch/cris/arch-v10/lib/old_checksum.c
@@ -1,4 +1,4 @@
-/* $Id: old_checksum.c,v 1.2 2002/11/05 06:45:12 starvik Exp $
+/* $Id: old_checksum.c,v 1.3 2003/10/27 08:04:32 starvik Exp $
  *
  * INET		An implementation of the TCP/IP protocol suite for the LINUX
  *		operating system.  INET is implemented using the  BSD Socket
@@ -76,7 +76,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
     sum += *((unsigned short *)buff)++;
   }
   if(endMarker - buff > 0) {
-    sum += *buff;                 /* add extra byte separately */
+    sum += *buff;                 /* add extra byte seperately */
   }
   BITOFF;
   return(sum);
diff --git a/arch/cris/arch-v10/mm/fault.c b/arch/cris/arch-v10/mm/fault.c
index 7a012adc1..0c6bac018 100644
--- a/arch/cris/arch-v10/mm/fault.c
+++ b/arch/cris/arch-v10/mm/fault.c
@@ -30,7 +30,7 @@ extern const struct exception_table_entry
 	*search_exception_tables(unsigned long addr);
 
 asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
-                              int error_code);
+                              int protection, int writeaccess);
 
 /* fast TLB-fill fault handler
  * this is called from entry.S with interrupts disabled
@@ -39,8 +39,9 @@ asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
 void
 handle_mmu_bus_fault(struct pt_regs *regs)
 {
-	int cause, select;
+	int cause;
 #ifdef DEBUG
+	int select;
 	int index;
 	int page_id;
 	int acc, inv;
@@ -48,15 +49,14 @@ handle_mmu_bus_fault(struct pt_regs *regs)
 	int miss, we, writeac;
 	pmd_t *pmd;
 	pte_t pte;
-	int errcode;
 	unsigned long address;
 
 	cause = *R_MMU_CAUSE;
-	select = *R_TLB_SELECT;
 
 	address = cause & PAGE_MASK; /* get faulting address */
 
 #ifdef DEBUG
+	select = *R_TLB_SELECT;
 	page_id = IO_EXTRACT(R_MMU_CAUSE,  page_id,   cause);
 	acc     = IO_EXTRACT(R_MMU_CAUSE,  acc_excp,  cause);
 	inv     = IO_EXTRACT(R_MMU_CAUSE,  inv_excp,  cause);  
@@ -82,12 +82,6 @@ handle_mmu_bus_fault(struct pt_regs *regs)
 	if(writeac)
 		regs->csrinstr &= ~(1 << 5);
 	
-	/* Set errcode's R/W flag according to the mode which caused the
-	 * fault
-	 */
-
-	errcode = writeac << 1;
-
 	D(printk("bus_fault from IRP 0x%lx: addr 0x%lx, miss %d, inv %d, we %d, acc %d, dx %d pid %d\n",
 		 regs->irp, address, miss, inv, we, acc, index, page_id));
 
@@ -99,16 +93,20 @@ handle_mmu_bus_fault(struct pt_regs *regs)
 		 */
 
 		pmd = (pmd_t *)(current_pgd + pgd_index(address));
-		if (pmd_none(*pmd))
-			goto dofault;
+		if (pmd_none(*pmd)) {
+			do_page_fault(address, regs, 0, writeac);
+			return;
+		}
 		if (pmd_bad(*pmd)) {
 			printk("bad pgdir entry 0x%lx at 0x%p\n", *(unsigned long*)pmd, pmd);
 			pmd_clear(pmd);
 			return;
 		}
 		pte = *pte_offset_kernel(pmd, address);
-		if (!pte_present(pte))
-			goto dofault;
+		if (!pte_present(pte)) {
+			do_page_fault(address, regs, 0, writeac);
+			return;
+		}
 
 #ifdef DEBUG
 		printk(" found pte %lx pg %p ", pte_val(pte), pte_page(pte));
@@ -143,14 +141,10 @@ handle_mmu_bus_fault(struct pt_regs *regs)
 		*R_TLB_LO = pte_val(pte);
 
 		return;
-	} 
-
-	errcode = 1 | (we << 1);
+	}
 
- dofault:
-	/* leave it to the MM system fault handler below */
-	D(printk("do_page_fault %lx errcode %d\n", address, errcode));
-	do_page_fault(address, regs, errcode);
+	/* leave it to the MM system fault handler */
+	do_page_fault(address, regs, 1, we);
 }
 
 /* Called from arch/cris/mm/fault.c to find fixup code. */
diff --git a/arch/cris/arch-v10/mm/tlb.c b/arch/cris/arch-v10/mm/tlb.c
index 2ddb0a61c..62fd0143c 100644
--- a/arch/cris/arch-v10/mm/tlb.c
+++ b/arch/cris/arch-v10/mm/tlb.c
@@ -212,7 +212,7 @@ dump_tlb_all(void)
 
 void 
 switch_mm(struct mm_struct *prev, struct mm_struct *next,
-	  struct task_struct *tsk, int cpu)
+	  struct task_struct *tsk)
 {
 	/* make sure we have a context */
 
diff --git a/arch/cris/defconfig b/arch/cris/defconfig
index 3932dfa8e..0cef3f998 100644
--- a/arch/cris/defconfig
+++ b/arch/cris/defconfig
@@ -1,25 +1,55 @@
 #
 # Automatically generated make config: don't edit
 #
+CONFIG_MMU=y
 CONFIG_UID16=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
 #
-CONFIG_NET=y
-CONFIG_SYSVIPC=y
+CONFIG_SWAP=y
+# CONFIG_SYSVIPC is not set
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_SYSCTL is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# General setup
+#
 CONFIG_BINFMT_ELF=y
-# CONFIG_ETRAX_KGDB is not set
-# CONFIG_ETRAX_WATCHDOG is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc"
+CONFIG_ETRAX_WATCHDOG=y
+CONFIG_ETRAX_WATCHDOG_NICE_DOGGY=y
+CONFIG_ETRAX_FAST_TIMER=y
+# CONFIG_PREEMPT is not set
 
 #
 # Hardware setup
@@ -27,74 +57,170 @@ CONFIG_BINFMT_ELF=y
 CONFIG_ETRAX100LX=y
 # CONFIG_ETRAX100LX_V2 is not set
 # CONFIG_SVINTO_SIM is not set
-CONFIG_ETRAX_DRAM_SIZE=8
+CONFIG_ETRAX_ARCH_V10=y
+CONFIG_ETRAX_DRAM_SIZE=16
 CONFIG_ETRAX_FLASH_BUSWIDTH=2
-CONFIG_ETRAX_ROOT_DEVICE="/dev/mtdblock3"
+CONFIG_CRIS_LOW_MAP=y
+CONFIG_ETRAX_DRAM_VIRTUAL_BASE=60000000
+CONFIG_ETRAX_PA_LEDS=y
+# CONFIG_ETRAX_PB_LEDS is not set
+# CONFIG_ETRAX_CSP0_LEDS is not set
+# CONFIG_ETRAX_NO_LEDS is not set
+CONFIG_ETRAX_LED1G=2
+CONFIG_ETRAX_LED1R=2
+CONFIG_ETRAX_LED2G=3
+CONFIG_ETRAX_LED2R=3
+CONFIG_ETRAX_LED3G=2
+CONFIG_ETRAX_LED3R=2
+CONFIG_ETRAX_DEBUG_PORT0=y
+# CONFIG_ETRAX_DEBUG_PORT1 is not set
+# CONFIG_ETRAX_DEBUG_PORT2 is not set
+# CONFIG_ETRAX_DEBUG_PORT3 is not set
+# CONFIG_ETRAX_DEBUG_PORT_NULL is not set
+CONFIG_ETRAX_RESCUE_SER0=y
+# CONFIG_ETRAX_RESCUE_SER1 is not set
+# CONFIG_ETRAX_RESCUE_SER2 is not set
+# CONFIG_ETRAX_RESCUE_SER3 is not set
+CONFIG_ETRAX_DEF_R_WAITSTATES=0x95f8
+CONFIG_ETRAX_DEF_R_BUS_CONFIG=0x104
+CONFIG_ETRAX_SDRAM=y
+CONFIG_ETRAX_DEF_R_SDRAM_CONFIG=0x00e03636
+CONFIG_ETRAX_DEF_R_SDRAM_TIMING=0x80008002
+CONFIG_ETRAX_DEF_R_PORT_PA_DIR=0x1d
+CONFIG_ETRAX_DEF_R_PORT_PA_DATA=0xf0
+CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=0x00
+CONFIG_ETRAX_DEF_R_PORT_PB_DIR=0x1e
+CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0xf3
+# CONFIG_ETRAX_SOFT_SHUTDOWN is not set
+
+#
+# Drivers for built-in interfaces
+#
+CONFIG_ETRAX_ETHERNET=y
+CONFIG_NET_ETHERNET=y
+# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
+CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
+CONFIG_ETRAX_SERIAL=y
+CONFIG_ETRAX_SERIAL_FAST_TIMER=y
+CONFIG_ETRAX_SERIAL_PORT0=y
+# CONFIG_CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT is not set
+CONFIG_CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT=y
+# CONFIG_CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN is not set
+CONFIG_CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN=y
+CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE=y
+# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PA is not set
+# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
+# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_MIXED is not set
+CONFIG_ETRAX_SER0_DTR_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_RI_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_DSR_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_CD_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_DTR_ON_PB_BIT=-1
+CONFIG_ETRAX_SER0_RI_ON_PB_BIT=-1
+CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=-1
+CONFIG_ETRAX_SER0_CD_ON_PB_BIT=-1
+# CONFIG_ETRAX_SERIAL_PORT1 is not set
+CONFIG_ETRAX_SERIAL_PORT2=y
+# CONFIG_CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT is not set
+CONFIG_CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT=y
+# CONFIG_CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN is not set
+CONFIG_CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN=y
+CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE=y
+# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PA is not set
+# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PB is not set
+# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_MIXED is not set
+CONFIG_ETRAX_SER2_DTR_ON_PA_BIT=-1
+CONFIG_ETRAX_SER2_RI_ON_PA_BIT=-1
+CONFIG_ETRAX_SER2_DSR_ON_PA_BIT=-1
+CONFIG_ETRAX_SER2_CD_ON_PA_BIT=-1
+CONFIG_ETRAX_SER2_DTR_ON_PB_BIT=-1
+CONFIG_ETRAX_SER2_RI_ON_PB_BIT=-1
+CONFIG_ETRAX_SER2_DSR_ON_PB_BIT=-1
+CONFIG_ETRAX_SER2_CD_ON_PB_BIT=-1
+# CONFIG_ETRAX_SERIAL_PORT3 is not set
+# CONFIG_ETRAX_RS485 is not set
+# CONFIG_ETRAX_IDE is not set
+# CONFIG_IDE is not set
+# CONFIG_ETRAX_USB_HOST is not set
+CONFIG_ETRAX_AXISFLASHMAP=y
+CONFIG_ETRAX_PTABLE_SECTOR=65536
+CONFIG_MTD=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_OBSOLETE_CHIPS=y
+CONFIG_MTD_AMDSTD=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CONCAT=y
+# CONFIG_ETRAX_I2C is not set
+CONFIG_ETRAX_GPIO=y
+CONFIG_ETRAX_PA_BUTTON_BITMASK=0x02
+CONFIG_ETRAX_PA_CHANGEABLE_DIR=0x00
+CONFIG_ETRAX_PA_CHANGEABLE_BITS=0xFF
+CONFIG_ETRAX_PB_CHANGEABLE_DIR=0x00
+CONFIG_ETRAX_PB_CHANGEABLE_BITS=0xFF
+# CONFIG_ETRAX_RTC is not set
 
 #
-# Drivers for ETRAX 100LX built-in interfaces
+# Generic Driver Options
 #
 
 #
 # Memory Technology Devices (MTD)
 #
-CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
 
 #
-# Disk-On-Chip Device Drivers
+# User Modules And Translation Layers
 #
-# CONFIG_MTD_DOC1000 is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOCPROBE is not set
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
 
 #
-# RAM/ROM Device Drivers
+# RAM/ROM/Flash chip drivers
 #
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_RAM=y
 # CONFIG_MTD_ROM is not set
-# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_SHARP is not set
+# CONFIG_MTD_JEDEC is not set
 
 #
-# Linearly Mapped Flash Device Drivers
+# Mapping drivers for chip access
 #
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_GEOMETRY is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_AMDSTD=y
-# CONFIG_MTD_SHARP is not set
+CONFIG_MTD_COMPLEX_MAPPINGS=y
 # CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_NORA is not set
-# CONFIG_MTD_PNC2000 is not set
-# CONFIG_MTD_RPXLITE is not set
-# CONFIG_MTD_SC520CDP is not set
-# CONFIG_MTD_SBC_MEDIAGX is not set
-# CONFIG_MTD_ELAN_104NC is not set
-# CONFIG_MTD_SA1100 is not set
-# CONFIG_MTD_DC21285 is not set
-# CONFIG_MTD_CSTM_CFI_JEDEC is not set
-# CONFIG_MTD_JEDEC is not set
-# CONFIG_MTD_MIXMEM is not set
-# CONFIG_MTD_OCTAGON is not set
-# CONFIG_MTD_VMAX is not set
 
 #
-# NAND Flash Device Drivers
+# Self-contained MTD device drivers
 #
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_NAND_SPIA is not set
+# CONFIG_MTD_SLRAM is not set
+CONFIG_MTD_MTDRAM=y
+CONFIG_MTDRAM_TOTAL_SIZE=0
+CONFIG_MTDRAM_ERASE_SIZE=64
+CONFIG_MTDRAM_ABS_POS=0x0
+# CONFIG_MTD_BLKMTD is not set
 
 #
-# User Modules And Translation Layers
+# Disk-On-Chip Device Drivers
 #
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
 
 #
 # Parallel port support
@@ -102,51 +228,98 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_PARPORT is not set
 
 #
-# Plug and Play configuration
+# Plug and Play support
 #
-# CONFIG_PNP is not set
-# CONFIG_ISAPNP is not set
 
 #
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_XD is not set
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_CPQ_DA is not set
-# CONFIG_BLK_CPQ_CISS_DA is not set
-# CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_BLK_DEV_INITRD is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
 #
 # Networking options
 #
-# CONFIG_PACKET is not set
-# CONFIG_NETLINK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_FILTER is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
 CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 # CONFIG_IP_PNP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
-# CONFIG_INET_ECN is not set
+# CONFIG_ARPD is not set
 # CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_KHTTPD is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_IP_NF_CONNTRACK is not set
+# CONFIG_IP_NF_QUEUE is not set
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_LLC is not set
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
@@ -159,167 +332,114 @@ CONFIG_INET=y
 # CONFIG_NET_SCHED is not set
 
 #
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-
-#
-# ATA/IDE/MFM/RLL support
-#
-# CONFIG_IDE is not set
-
-#
-# IDE, ATA and ATAPI Block devices
-#
-# CONFIG_BLK_DEV_IDE is not set
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
-# CONFIG_BLK_DEV_IDEDISK is not set
-# CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_BLK_DEV_IDECS is not set
-# CONFIG_BLK_DEV_IDECD is not set
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-# CONFIG_BLK_DEV_CMD640 is not set
-# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
-# CONFIG_BLK_DEV_ISAPNP is not set
-# CONFIG_IDE_CHIPSETS is not set
-# CONFIG_IDEDMA_AUTO is not set
-
-#
-# SCSI support
-#
-# CONFIG_SCSI is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-# CONFIG_I2O_BLOCK is not set
-# CONFIG_I2O_LAN is not set
-# CONFIG_I2O_SCSI is not set
-# CONFIG_I2O_PROC is not set
-
-#
-# Network device support
+# Network testing
 #
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_NET_SB1000 is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
-CONFIG_NET_ETHERNET=y
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_LANCE is not set
-# CONFIG_NET_VENDOR_SMC is not set
-# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_AT1700 is not set
-# CONFIG_DEPCA is not set
-# CONFIG_NET_ISA is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_NET_POCKET is not set
+# CONFIG_MII is not set
 
 #
 # Ethernet (1000 Mbit)
 #
-# CONFIG_ACENIC is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Ethernet (10000 Mbit)
 #
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
-# Amateur Radio support
+# ISDN subsystem
 #
-# CONFIG_HAMRADIO is not set
+# CONFIG_ISDN is not set
 
 #
-# IrDA (infrared) support
+# Telephony Support
 #
-# CONFIG_IRDA is not set
+# CONFIG_PHONE is not set
 
 #
-# ISDN subsystem
+# Input device support
 #
-# CONFIG_ISDN is not set
+# CONFIG_INPUT is not set
 
 #
-# CD-ROM drivers (not for SCSI or IDE/ATAPI drives)
+# Userland interfaces
 #
-# CONFIG_CD_NO_IDESCSI is not set
 
 #
-# Input core support
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+
+#
+# Input Device Drivers
 #
-# CONFIG_INPUT is not set
 
 #
 # Character devices
 #
 # CONFIG_VT is not set
-# CONFIG_SERIAL is not set
-# CONFIG_SERIAL_EXTENDED is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_UNIX98_PTYS is not set
 
 #
-# I2C support
+# Serial drivers
 #
-# CONFIG_I2C is not set
+# CONFIG_SERIAL_8250 is not set
 
 #
-# Mice
+# Non-8250 serial port support
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_MOUSE is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
 
 #
-# Joysticks
+# IPMI
 #
-# CONFIG_JOYSTICK is not set
-# CONFIG_QIC02_TAPE is not set
+# CONFIG_IPMI_HANDLER is not set
 
 #
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_INTEL_RNG is not set
-# CONFIG_NVRAM is not set
 # CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -330,83 +450,106 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_FTAPE is not set
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
 
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
 #
 # File systems
 #
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_QUOTA is not set
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
 # CONFIG_ADFS_FS is not set
-# CONFIG_ADFS_FS_RW is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_FAT_FS is not set
-# CONFIG_MSDOS_FS is not set
-# CONFIG_UMSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
+CONFIG_JFFS_FS=y
+CONFIG_JFFS_FS_VERBOSE=0
+# CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=y
-CONFIG_RAMFS=y
-# CONFIG_ISO9660_FS is not set
-# CONFIG_JOLIET is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_NTFS_FS is not set
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
+# CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-# CONFIG_DEVPTS_FS is not set
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_QNX4FS_RW is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_EXT2_FS is not set
 # CONFIG_SYSV_FS is not set
-# CONFIG_SYSV_FS_WRITE is not set
-# CONFIG_UDF_FS is not set
-# CONFIG_UDF_RW is not set
 # CONFIG_UFS_FS is not set
-# CONFIG_UFS_FS_WRITE is not set
 
 #
 # Network File Systems
 #
-# CONFIG_CODA_FS is not set
-# CONFIG_NFS_FS is not set
-# CONFIG_NFS_V3 is not set
-# CONFIG_ROOT_NFS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
-# CONFIG_NFSD_V3 is not set
-# CONFIG_SUNRPC is not set
-# CONFIG_LOCKD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
-# CONFIG_NCPFS_PACKET_SIGNING is not set
-# CONFIG_NCPFS_IOCTL_LOCKING is not set
-# CONFIG_NCPFS_STRONG is not set
-# CONFIG_NCPFS_NFS_NS is not set
-# CONFIG_NCPFS_OS2_NS is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_NCPFS_MOUNT_SUBDIR is not set
-# CONFIG_NCPFS_NDS_DOMAINS is not set
-# CONFIG_NCPFS_NLS is not set
-# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
 # CONFIG_NLS is not set
 
 #
@@ -417,9 +560,33 @@ CONFIG_MSDOS_PARTITION=y
 #
 # USB support
 #
-# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PROFILE is not set
+# CONFIG_ETRAX_KGDB is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_FRAME_POINTER is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
diff --git a/arch/cris/kernel/Makefile b/arch/cris/kernel/Makefile
index 49bb782bd..7c071a765 100644
--- a/arch/cris/kernel/Makefile
+++ b/arch/cris/kernel/Makefile
@@ -1,14 +1,14 @@
-# $Id: Makefile,v 1.8 2003/04/09 05:20:47 starvik Exp $
+# $Id: Makefile,v 1.10 2004/05/14 10:18:12 starvik Exp $
 #
 # Makefile for the linux kernel.
 #
 
-extra-y := vmlinux.lds.s
+extra-y	:= vmlinux.lds.s
 
 obj-y   := process.o traps.o irq.o ptrace.o setup.o \
 	   time.o sys_cris.o semaphore.o
 
-obj-$(CONFIG_MODULES)    += ksyms.o
+obj-$(CONFIG_MODULES)    += crisksyms.o
 obj-$(CONFIG_MODULES)	 += module.o
 
 clean:
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index 5eba7c184..a963dda74 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.8 2003/07/04 08:27:52 starvik Exp $
+/*
  *
  *	linux/arch/cris/kernel/irq.c
  *
@@ -99,7 +99,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			goto skip;
 		seq_printf(p, "%2d: %10u %c %s",
-			i, kstat_cpu(0).irqs[i],
+			i, kstat_this_cpu.irqs[i],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action = action->next; action; action = action->next) {
@@ -129,13 +129,12 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 
         cpu = smp_processor_id();
         irq_enter();
-	kstat_cpu(cpu).irqs[irq]++;
+	kstat_cpu(cpu).irqs[irq - FIRST_IRQ]++;
+	action = irq_action[irq - FIRST_IRQ];
 
-	action = irq_action[irq];
         if (action) {
                 if (!(action->flags & SA_INTERRUPT))
                         local_irq_enable();
-                action = irq_action[irq];
                 do_random = 0;
                 do {
                         do_random |= action->flags;
@@ -175,7 +174,7 @@ int setup_irq(int irq, struct irqaction * new)
 	struct irqaction *old, **p;
 	unsigned long flags;
 
-	p = irq_action + irq;
+	p = irq_action + irq - FIRST_IRQ;
 	if ((old = *p) != NULL) {
 		/* Can't share interrupts unless both agree to */
 		if (!(old->flags & new->flags & SA_SHIRQ))
@@ -230,12 +229,6 @@ int request_irq(unsigned int irq,
 	int retval;
 	struct irqaction * action;
 
-	/* interrupts 0 and 1 are hardware breakpoint and NMI and we can't support
-	   these yet. interrupt 15 is the multiple irq, it's special. */
-
-	if(irq < 2 || irq == 15 || irq >= NR_IRQS)
-		return -EINVAL;
-
 	if(!handler)
 		return -EINVAL;
 
@@ -270,7 +263,7 @@ void free_irq(unsigned int irq, void *dev_id)
 		printk("Trying to free IRQ%d\n",irq);
 		return;
 	}
-	for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
+	for (p = irq - FIRST_IRQ + irq_action; (action = *p) != NULL; p = &action->next) {
 		if (action->dev_id != dev_id)
 			continue;
 
@@ -278,7 +271,7 @@ void free_irq(unsigned int irq, void *dev_id)
 		local_save_flags(flags);
 		local_irq_disable();
 		*p = action->next;
-		if (!irq_action[irq]) {
+		if (!irq_action[irq - FIRST_IRQ]) {
 			mask_irq(irq);
 			arch_free_irq(irq);
 		}
diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c
index 052c0031f..f1d3e784f 100644
--- a/arch/cris/kernel/module.c
+++ b/arch/cris/kernel/module.c
@@ -75,8 +75,6 @@ int apply_relocate(Elf32_Shdr *sechdrs,
 		sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
 			+ ELF32_R_SYM(rel[i].r_info);
 
-                /* TODO: This is probably not correct */
-                printk("Beware: untested code in module.c!\n");
                 /* We add the value into the location given */
                 *location += sym->st_value;
 	}
@@ -89,9 +87,26 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 		       unsigned int relsec,
 		       struct module *me)
 {
-	printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
-	       me->name);
-	return -ENOEXEC;
+  	unsigned int i;
+	Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
+
+	DEBUGP ("Applying relocate section %u to %u\n", relsec,
+		sechdrs[relsec].sh_info);
+
+	for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) {
+		/* This is where to make the change */
+		uint32_t *loc
+			= ((void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+			   + rela[i].r_offset);
+		/* This is the symbol it is referring to.  Note that all
+		   undefined symbols have been resolved.  */
+		Elf32_Sym *sym
+			= ((Elf32_Sym *)sechdrs[symindex].sh_addr
+			   + ELF32_R_SYM (rela[i].r_info));
+		*loc = sym->st_value + rela[i].r_addend;
+	}
+
+	return 0;
 }
 
 int module_finalize(const Elf_Ehdr *hdr,
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index cbb0bad22..c4992bf89 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.14 2003/06/10 10:21:12 johana Exp $
+/* $Id: process.c,v 1.17 2004/04/05 13:53:48 starvik Exp $
  * 
  *  linux/arch/cris/kernel/process.c
  *
@@ -8,9 +8,18 @@
  *  Authors:   Bjorn Wesen (bjornw@axis.com)
  *
  *  $Log: process.c,v $
+ *  Revision 1.17  2004/04/05 13:53:48  starvik
+ *  Merge of Linux 2.6.5
+ *
+ *  Revision 1.16  2003/10/27 08:04:33  starvik
+ *  Merge of Linux 2.6.0-test9
+ *
+ *  Revision 1.15  2003/09/11 07:29:52  starvik
+ *  Merge of Linux 2.6.0-test5
+ *
  *  Revision 1.14  2003/06/10 10:21:12  johana
  *  Moved thread_saved_pc() from arch/cris/kernel/process.c to
- *  subarch specific process.c. 
+ *  subarch specific process.c. arch-v32 has an erp, no irp.
  *
  *  Revision 1.13  2003/04/09 05:20:47  starvik
  *  Merge of Linux 2.5.67
@@ -94,6 +103,7 @@
 #include <asm/atomic.h>
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
+#include <asm/irq.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/fs_struct.h>
@@ -182,13 +192,17 @@ void cpu_idle (void)
 {
 	/* endless idle loop with no priority at all */
 	while (1) {
-		void (*idle)(void) = pm_idle;
-		if (!idle)
-			idle = default_idle;
-		while (!need_resched())
+		while (!need_resched()) {
+			void (*idle)(void) = pm_idle;
+
+			if (!idle)
+				idle = default_idle;
+
 			idle();
+		}
 		schedule();
 	}
+
 }
 
 void hard_reset_now (void);
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index fc989d2c7..95a9f4408 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.7 2003/07/04 08:27:52 starvik Exp $
+/*
  *
  *  linux/arch/cris/kernel/setup.c
  *
@@ -10,6 +10,7 @@
  * This file handles the architecture-dependent parts of initialization
  */
 
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
@@ -38,6 +39,8 @@ extern unsigned long dram_start, dram_end;
 
 extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */
 
+extern void show_etrax_copyright(void);		/* arch-vX/kernel/setup.c */
+
 /* This mainly sets up the memory area, and can be really confusing.
  *
  * The physical DRAM is virtually mapped into dram_start to dram_end
@@ -153,18 +156,16 @@ setup_arch(char **cmdline_p)
 	*cmdline_p = command_line;
 
 #ifdef CONFIG_ETRAX_CMDLINE
-	strlcpy(command_line, CONFIG_ETRAX_CMDLINE, sizeof(command_line));
-#elif defined(CONFIG_ETRAX_ROOT_DEVICE)
-	strlcpy(command_line, "root=", sizeof(command_line));
-	strlcat(command_line, CONFIG_ETRAX_ROOT_DEVICE,
-		sizeof(command_line));
-#endif
+	strlcpy(command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE);
 	command_line[COMMAND_LINE_SIZE - 1] = '\0';
 
-	/* give credit for the CRIS port */
-
-	printk("Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB\n");
+	/* Save command line for future references. */
+	memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
+	saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
+#endif
 
+	/* give credit for the CRIS port */
+	show_etrax_copyright();
 }
 
 static void *c_start(struct seq_file *m, loff_t *pos)
diff --git a/arch/cris/kernel/sys_cris.c b/arch/cris/kernel/sys_cris.c
index cd50e5ba2..0aa0e0ebb 100644
--- a/arch/cris/kernel/sys_cris.c
+++ b/arch/cris/kernel/sys_cris.c
@@ -1,4 +1,4 @@
-/* $Id: sys_cris.c,v 1.5 2003/07/04 08:27:52 starvik Exp $
+/* $Id: sys_cris.c,v 1.6 2004/03/11 11:38:40 starvik Exp $
  *
  * linux/arch/cris/kernel/sys_cris.c
  *
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c
index 9ca0f2025..6c28b0e7f 100644
--- a/arch/cris/kernel/time.c
+++ b/arch/cris/kernel/time.c
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.9 2003/07/04 08:27:52 starvik Exp $
+/* $Id: time.c,v 1.14 2004/06/01 05:38:11 starvik Exp $
  *
  *  linux/arch/cris/kernel/time.c
  *
@@ -29,6 +29,7 @@
 #include <linux/jiffies.h>
 #include <linux/bcd.h>
 #include <linux/timex.h>
+#include <linux/init.h>
 
 u64 jiffies_64 = INITIAL_JIFFIES;
 
@@ -39,6 +40,8 @@ int have_rtc;  /* used to remember if we have an RTC or not */;
 #define TICK_SIZE tick
 
 extern unsigned long wall_jiffies;
+extern unsigned long loops_per_jiffy; /* init/main.c */
+unsigned long loops_per_usec;
 
 extern unsigned long do_slow_gettimeoffset(void);
 static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
@@ -62,6 +65,15 @@ void do_gettimeofday(struct timeval *tv)
 		if (lost)
 			usec += lost * (1000000 / HZ);
 	}
+
+        /*
+	 * If time_adjust is negative then NTP is slowing the clock
+	 * so make sure not to go into next possible interval.
+	 * Better to lose some accuracy than have time go backwards..
+	 */
+	if (unlikely(time_adjust < 0) && usec > tickadj)
+		usec = tickadj;
+
 	sec = xtime.tv_sec;
 	usec += xtime.tv_nsec / 1000;
 	local_irq_restore(flags);
@@ -79,35 +91,33 @@ EXPORT_SYMBOL(do_gettimeofday);
 
 int do_settimeofday(struct timespec *tv)
 {
-	unsigned long flags;
+	time_t wtm_sec, sec = tv->tv_sec;
+	long wtm_nsec, nsec = tv->tv_nsec;
 
-        if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
+	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
 		return -EINVAL;
 
-	local_irq_save(flags);
-	local_irq_disable();
-
-	/* This is revolting. We need to set the xtime.tv_usec
-	 * correctly. However, the value in this location is
-	 * is value at the last tick.
-	 * Discover what correction gettimeofday
-	 * would have done, and then undo it!
+	write_seqlock_irq(&xtime_lock);
+	/*
+	 * This is revolting. We need to set "xtime" correctly. However, the
+	 * value in this location is the value at the most recent update of
+	 * wall time.  Discover what correction gettimeofday() would have
+	 * made, and then undo it!
 	 */
-	tv->tv_nsec -= do_gettimeoffset() * 1000;
-        tv->tv_nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
+	nsec -= do_gettimeoffset() * NSEC_PER_USEC;
+	nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
+
+	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
+	wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
+
+	set_normalized_timespec(&xtime, sec, nsec);
+	set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
 
-	while (tv->tv_nsec < 0) {
-		tv->tv_nsec += NSEC_PER_SEC;
-		tv->tv_sec--;
-	}
-	xtime.tv_sec = tv->tv_sec;
-	xtime.tv_nsec = tv->tv_nsec;
 	time_adjust = 0;		/* stop active adjtime() */
 	time_status |= STA_UNSYNC;
-	time_state = TIME_ERROR;	/* p. 24, (a) */
 	time_maxerror = NTP_PHASE_LIMIT;
 	time_esterror = NTP_PHASE_LIMIT;
-	local_irq_restore(flags);
+	write_sequnlock_irq(&xtime_lock);
 	clock_was_set();
 	return 0;
 }
@@ -125,7 +135,7 @@ int set_rtc_mmss(unsigned long nowtime)
 	int retval = 0;
 	int real_seconds, real_minutes, cmos_minutes;
 
-	printk("set_rtc_mmss(%lu)\n", nowtime);
+	printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime);
 
 	if(!have_rtc)
 		return 0;
@@ -174,7 +184,8 @@ get_cmos_time(void)
 	mon = CMOS_READ(RTC_MONTH);
 	year = CMOS_READ(RTC_YEAR);
 
-	printk("rtc: sec 0x%x min 0x%x hour 0x%x day 0x%x mon 0x%x year 0x%x\n", 
+	printk(KERN_DEBUG
+	       "rtc: sec 0x%x min 0x%x hour 0x%x day 0x%x mon 0x%x year 0x%x\n",
 	       sec, min, hour, day, mon, year);
 
 	BCD_TO_BIN(sec);
@@ -202,3 +213,20 @@ update_xtime_from_cmos(void)
 		xtime.tv_nsec = 0;
 	}
 }
+
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ */
+unsigned long long sched_clock(void)
+{
+	return (unsigned long long)jiffies * (1000000000 / HZ);
+}
+
+static int
+__init init_udelay(void)
+{
+	loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
+	return 0;
+}
+
+__initcall(init_udelay);
diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
index d9e656565..d4dfa050e 100644
--- a/arch/cris/kernel/traps.c
+++ b/arch/cris/kernel/traps.c
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.7 2003/07/04 08:27:52 starvik Exp $
+/* $Id: traps.c,v 1.9 2004/05/11 12:28:26 starvik Exp $
  *
  *  linux/arch/cris/traps.c
  *
@@ -14,6 +14,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/module.h>
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index 7e8f2a3ee..03254b9ed 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -6,9 +6,18 @@
  *  Authors:  Bjorn Wesen 
  * 
  *  $Log: fault.c,v $
+ *  Revision 1.11  2004/05/14 07:58:05  starvik
+ *  Merge of changes from 2.4
+ *
+ *  Revision 1.10  2003/10/27 14:51:24  starvik
+ *  Removed debugcode
+ *
+ *  Revision 1.9  2003/10/27 14:50:42  starvik
+ *  Changed do_page_fault signature
+ *
  *  Revision 1.8  2003/07/04 13:02:48  tobiasa
  *  Moved code snippet from arch/cris/mm/fault.c that searches for fixup code
- *  to separate function in arch-specific files.
+ *  to seperate function in arch-specific files.
  *
  *  Revision 1.7  2003/01/22 06:48:38  starvik
  *  Fixed warnings issued by GCC 3.2.1
@@ -95,10 +104,6 @@
 extern int find_fixup_code(struct pt_regs *);
 extern void die_if_kernel(const char *, struct pt_regs *, long);
 
-asmlinkage void do_invalid_op (struct pt_regs *, unsigned long);
-asmlinkage void do_page_fault(unsigned long address, struct pt_regs *regs,
-			      int error_code);
-
 /* debug of low-level TLB reload */
 #undef DEBUG
 
@@ -134,14 +139,16 @@ volatile pgd_t *current_pgd;
 
 asmlinkage void
 do_page_fault(unsigned long address, struct pt_regs *regs,
-	      int error_code)
+	      int protection, int writeaccess)
 {
 	struct task_struct *tsk;
 	struct mm_struct *mm;
 	struct vm_area_struct * vma;
-	int writeaccess;
 	siginfo_t info;
 
+        D(printk("Page fault for %X at %X, prot %d write %d\n",
+                 address, regs->erp, protection, writeaccess));
+
 	tsk = current;
 
 	/*
@@ -164,7 +171,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
 	 */
 
 	if (address >= VMALLOC_START &&
-	    !(error_code & 1) &&
+	    !protection &&
 	    !user_mode(regs))
 		goto vmalloc_fault;
 
@@ -172,7 +179,6 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
 	sti();
 
 	mm = tsk->mm;
-	writeaccess = error_code & 2;
 	info.si_code = SEGV_MAPERR;
 
 	/*
@@ -291,7 +297,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
 		printk(KERN_ALERT "Unable to handle kernel access");
 	printk(" at virtual address %08lx\n",address);
 
-	die_if_kernel("Oops", regs, error_code);
+	die_if_kernel("Oops", regs, (writeaccess << 1) | protection);
 
 	do_exit(SIGKILL);
 
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index 3ff9bfcb8..d0bd0c957 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -7,6 +7,13 @@
  *  Authors:  Bjorn Wesen (bjornw@axis.com)
  *
  *  $Log: init.c,v $
+ *  Revision 1.11  2004/05/28 09:28:56  starvik
+ *  Calculation of loops_per_usec moved because initalization order has changed
+ *  in Linux 2.6.
+ *
+ *  Revision 1.10  2004/05/14 07:58:05  starvik
+ *  Merge of changes from 2.4
+ *
  *  Revision 1.9  2003/07/04 08:27:54  starvik
  *  Merge of Linux 2.5.74
  *
@@ -120,9 +127,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
 unsigned long empty_zero_page;
 
-extern unsigned long loops_per_jiffy; /* init/main.c */
-unsigned long loops_per_usec;
-
 extern char _stext, _edata, _etext; /* From linkerscript */
 extern char __init_begin, __init_end;
 
@@ -190,7 +194,8 @@ mem_init(void)
         datasize =  (unsigned long) &_edata - (unsigned long) &_etext;
         initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
 	
-        printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, "
+        printk(KERN_INFO
+               "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, "
 	       "%dk init)\n" ,
 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
 	       max_mapnr << (PAGE_SHIFT-10),
@@ -199,16 +204,6 @@ mem_init(void)
 	       datasize >> 10,
 	       initsize >> 10
                );
-
-	/* HACK alert - calculate a loops_per_usec for asm/delay.h here
-	 * since this is called just after calibrate_delay in init/main.c
-	 * but before places which use udelay. cannot be in time.c since
-	 * that is called _before_ calibrate_delay
-	 */
-
-	loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
-
-	return;
 }
 
 /* free the pages occupied by initialization code */
@@ -225,6 +220,6 @@ free_initmem(void)
                 free_page(addr);
                 totalram_pages++;
         }
-        printk ("Freeing unused kernel memory: %luk freed\n", 
+        printk (KERN_INFO "Freeing unused kernel memory: %luk freed\n",
 		(unsigned long)((&__init_end - &__init_begin) >> 10));
 }
diff --git a/arch/cris/mm/ioremap.c b/arch/cris/mm/ioremap.c
index 52151df2f..6b9130bfb 100644
--- a/arch/cris/mm/ioremap.c
+++ b/arch/cris/mm/ioremap.c
@@ -118,31 +118,6 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
 	if (!size || last_addr < phys_addr)
 		return NULL;
 
-#if 0
-	/* TODO: Here we can put checks for driver-writer abuse...  */
-
-	/*
-	 * Don't remap the low PCI/ISA area, it's always mapped..
-	 */
-	if (phys_addr >= 0xA0000 && last_addr < 0x100000)
-		return phys_to_virt(phys_addr);
-
-	/*
-	 * Don't allow anybody to remap normal RAM that we're using..
-	 */
-	if (phys_addr < virt_to_phys(high_memory)) {
-		char *t_addr, *t_end;
-		struct page *page;
-
-		t_addr = __va(phys_addr);
-		t_end = t_addr + (size - 1);
-	   
-		for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
-			if(!PageReserved(page))
-				return NULL;
-	}
-#endif
-
 	/*
 	 * Mappings have to be page-aligned
 	 */
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 556863890..072192a4f 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -43,122 +43,7 @@ config PCI
 
 source "init/Kconfig"
 
-menu "Processor type and features"
-
-choice
-	prompt "H8/300 platform"
-	default H8300H_GENERIC
-
-config H8300H_GENERIC
-	bool "Generic"
-	help
-	  H8/300H CPU Generic Hardware Support
-
-config H8300H_AKI3068NET
-	bool "AE-3068/69"
-	help
-	  AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support
-	  More Information. (Japanese Only)
-	  <http://akizukidensi.com/catalog/h8.html>
-	  AE-3068/69 Evaluation Board Support
-	  More Information.
-	  <http://www.microtronique.com/ae3069lan.htm>
-
-config H8300H_H8MAX
-	bool "H8MAX"
-	help
-	  H8MAX Evaluation Board Support
-	  More Information. (Japanese Only)
-	  <http://strawberry-linux.com/h8/index.html>
-
-config H8300H_SIM
-	bool "H8/300H Simulator"
-	help
-	  GDB Simulator Support
-	  More Information.
-	  arch/h8300/Doc/simulator.txt
-
-config H8S_EDOSK2674
-	bool "EDOSK-2674"
-	help
-	  Renesas EDOSK-2674 Evaluation Board Support
-	  More Information.
-	  <http://www.azpower.com/H8-uClinux/index.html>
- 	  <http://www.eu.renesas.com/tools/edk/support/edosk2674.html>
-
-config H8S_SIM
-	bool "H8S Simulator"
-	help
-	  GDB Simulator Support
-	  More Information.
-	  arch/h8300/Doc/simulator.txt
-
-endchoice
-
-choice 
-	prompt "CPU Selection"
-
-config H83002
-	bool "H8/3001,3002,3003"
-	depends on H8300H_GENERIC
-
-config H83007
-	bool "H8/3006,3007"
-	depends on (H8300H_GENERIC || H8300H_SIM)
-
-config H83048
-	bool "H8/3044,3045,3046,3047,3048,3052"
-	depends on H8300H_GENERIC
-
-config H83068
-	bool "H8/3065,3066,3067,3068,3069"
-	depends on (H8300H_GENERIC || H8300H_AKI3068NET || H8300H_H8MAX)
-
-config H8S2678
-	bool "H8S/2670,2673,2674R,2675,2676"
-	depends on (H8S_GENERIC || H8S_EDOSK2674 || H8S_SIM)
-
-endchoice
-
-config CPU_H8300H
-	bool
-	depends on (H8300H_GENERIC || H8300H_AKI3068NET || H8300H_H8MAX || H8300H_SIM)
-	default y
-
-config CPU_H8S
-	bool
-	depends on (H8S_GENERIC || H8S_EDOSK2674 || H8S_SIM)
-	default y
-
-config CPU_CLOCK
-	int "CPU Clock Frequency (/1KHz)"	
-	default "20000" if H8300H_AKI3068NET
-	default "25000" if H8300H_H8MAX
-	default "16000" if H8300H_SIM
-	default "16000" if H8300H_GENERIC
-	default "33000" if H8S_GENERIC
-	default "33000" if H8S_SIM
-	default "33000" if H8S_EDOSK2674
-	help
-	  CPU Clock Frequency divide to 1000
-choice
-	prompt "Kernel executes from"
-	---help---
-	  Choose the memory type that the kernel will be running in.
-
-config RAMKERNEL
-	bool "RAM"
-	help
-	  The kernel will be resident in RAM when running.
-
-config ROMKERNEL
-	bool "ROM"
-	help
-	  The kernel will be resident in FLASH/ROM when running.
-
-endchoice
-
-endmenu
+source "arch/h8300/Kconfig.cpu"
 
 menu "Executable file formats"
 
diff --git a/arch/h8300/Kconfig.ide b/arch/h8300/Kconfig.ide
index 3b9d58c16..a38a63054 100644
--- a/arch/h8300/Kconfig.ide
+++ b/arch/h8300/Kconfig.ide
@@ -1,23 +1,44 @@
 # uClinux H8/300 Target Board Selection Menu (IDE)
 
+if (H8300H_AKI3068NET)
 menu "IDE Extra configuration"
 
 config H8300_IDE_BASE
-	hex "IDE regitser base address"
+	hex "IDE register base address"
 	depends on IDE
+	default 0
 	help
 	  IDE registers base address
 
 config H8300_IDE_ALT
-	hex "IDE regitser alternate address"
+	hex "IDE register alternate address"
 	depends on IDE
+	default 0
 	help
 	  IDE alternate registers address
 
 config H8300_IDE_IRQ
 	int "IDE IRQ no"
 	depends on IDE
+	default 0
 	help
-	  IDE I/F using IRQ no
-
+	  IDE use IRQ no
 endmenu
+endif
+
+if (H8300H_H8MAX)
+config H8300_IDE_BASE
+	hex
+	depends on IDE
+	default 0x200000
+
+config H8300_IDE_ALT
+	hex
+	depends on IDE
+	default 0x60000c
+
+config H8300_IDE_IRQ
+	int
+	depends on IDE
+	default 5
+endif
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index 749ae3ef6..5c6d67116 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -62,12 +62,7 @@ archmrproper:
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/machine-depend.h include/asm-$(ARCH)/asm-offsets.h
-
-include/asm-$(ARCH)/machine-depend.h: include/asm-$(ARCH)/$(BOARD)/machine-depend.h
-	$(Q)ln -sf $(BOARD)/machine-depend.h \
-                   include/asm-$(ARCH)/machine-depend.h
-	@echo '  Create include/asm-$(ARCH)/machine-depend.h'
+prepare: include/asm-$(ARCH)/asm-offsets.h
 
 include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
 				   include/asm include/linux/version.h
@@ -81,4 +76,4 @@ define archhelp
   echo  'vmlinux.srec - Create srec binary'
 endef
 
-CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h include/asm-$(ARCH)/machine-depend.h
+CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h
diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile
index 2aae3e9c6..1f4ef89b5 100644
--- a/arch/h8300/kernel/Makefile
+++ b/arch/h8300/kernel/Makefile
@@ -6,5 +6,6 @@ extra-y := vmlinux.lds.s
 
 obj-y := process.o traps.o ptrace.o ints.o \
 	 sys_h8300.o time.o semaphore.o signal.o \
-         setup.o h8300_ksyms.o gpio.o init_task.o \
-         syscalls.o
+         setup.o gpio.o init_task.o syscalls.o
+
+obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o 
diff --git a/arch/h8300/kernel/h8300_ksyms.c b/arch/h8300/kernel/h8300_ksyms.c
index 3b69d4533..ca8578fed 100644
--- a/arch/h8300/kernel/h8300_ksyms.c
+++ b/arch/h8300/kernel/h8300_ksyms.c
@@ -17,6 +17,7 @@
 #include <asm/checksum.h>
 #include <asm/hardirq.h>
 #include <asm/current.h>
+#include <asm/gpio.h>
 
 //asmlinkage long long __ashrdi3 (long long, int);
 //asmlinkage long long __lshrdi3 (long long, int);
@@ -38,9 +39,9 @@ EXPORT_SYMBOL(strncmp);
 
 EXPORT_SYMBOL(ip_fast_csum);
 
-EXPORT_SYMBOL(mach_enable_irq);
-EXPORT_SYMBOL(mach_disable_irq);
 EXPORT_SYMBOL(kernel_thread);
+EXPORT_SYMBOL(enable_irq);
+EXPORT_SYMBOL(disable_irq);
 
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy);
@@ -103,10 +104,10 @@ EXPORT_SYMBOL_NOVERS(__udivsi3);
 EXPORT_SYMBOL_NOVERS(__umoddi3);
 EXPORT_SYMBOL_NOVERS(__umodsi3);
 
-EXPORT_SYMBOL_NOVERS(_current_task);
-
+#ifdef MAGIC_ROM_PTR
 EXPORT_SYMBOL_NOVERS(is_in_rom);
+#endif
 
-EXPORT_SYMBOL_NOVERS(h8300_reserved_gpio)
-EXPORT_SYMBOL_NOVERS(h8300_free_gpio)
-EXPORT_SYMBOL_NOVERS(h8300_set_gpio_dir)
+EXPORT_SYMBOL_NOVERS(h8300_reserved_gpio);
+EXPORT_SYMBOL_NOVERS(h8300_free_gpio);
+EXPORT_SYMBOL_NOVERS(h8300_set_gpio_dir);
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index afe7417c0..d7c058d64 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -55,9 +55,9 @@ void default_idle(void)
 {
 	while(1) {
 		if (need_resched()) {
-			sti();
+			local_irq_enable();
 			__asm__("sleep");
-			cli();
+			local_irq_disable();
 		}
 		schedule();
 	}
@@ -112,14 +112,13 @@ EXPORT_SYMBOL(machine_power_off);
 
 void show_regs(struct pt_regs * regs)
 {
-	printk("\n");
-	printk("PC: %08lx  Status: %02x\n",
+	printk("\nPC: %08lx  Status: %02x",
 	       regs->pc, regs->ccr);
-	printk("ORIG_ER0: %08lx ER0: %08lx ER1: %08lx\n",
+	printk("\nORIG_ER0: %08lx ER0: %08lx ER1: %08lx",
 	       regs->orig_er0, regs->er0, regs->er1);
-	printk("ER2: %08lx ER3: %08lx ER4: %08lx ER5: %08lx\n",
+	printk("\nER2: %08lx ER3: %08lx ER4: %08lx ER5: %08lx",
 	       regs->er2, regs->er3, regs->er4, regs->er5);
-	printk("ER6' %08lx ",regs->er6);
+	printk("\nER6' %08lx ",regs->er6);
 	if (user_mode(regs))
 		printk("USP: %08lx\n", rdusp());
 	else
@@ -261,12 +260,6 @@ out:
 	return error;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long thread_saved_pc(struct task_struct *tsk)
 {
 	return ((struct pt_regs *)tsk->thread.esp0)->pc;
@@ -287,7 +280,7 @@ unsigned long get_wchan(struct task_struct *p)
 		    fp >= 8184+stack_page)
 			return 0;
 		pc = ((unsigned long *)fp)[1];
-		if (pc < first_sched || pc >= last_sched)
+		if (!in_sched_functions(pc))
 			return pc;
 		fp = *(unsigned long *) fp;
 	} while (count++ < 16);
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
index 7bab2e30d..bf5822c56 100644
--- a/arch/h8300/kernel/setup.c
+++ b/arch/h8300/kernel/setup.c
@@ -40,16 +40,12 @@
 
 #if defined(__H8300H__)
 #define CPU "H8/300H"
+#include <asm/regs306x.h>
 #endif
 
 #if defined(__H8300S__)
 #define CPU "H8S"
-#endif
-
-#if defined(CONFIG_INTELFLASH)
-#define BLKOFFSET 512
-#else
-#define BLKOFFSET 0
+#include <asm/regs267x.h>
 #endif
 
 #define STUBSIZE 0xc000;
@@ -58,8 +54,6 @@ unsigned long rom_length;
 unsigned long memory_start;
 unsigned long memory_end;
 
-struct task_struct *_current_task;
-
 char command_line[512];
 char saved_command_line[512];
 
@@ -107,12 +101,11 @@ void __init setup_arch(char **cmdline_p)
 	memory_start = (unsigned long) &_ramstart;
 
 	/* allow for ROMFS on the end of the kernel */
-	if (memcmp((void *)(memory_start + BLKOFFSET), "-rom1fs-", 8) == 0) {
+	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start += BLKOFFSET;
+		initrd_start = memory_start;
 		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
 #else
-		memory_start += BLKOFFSET;
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif
 	}
@@ -190,6 +183,16 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	paging_init();
 	h8300_gpio_init();
+#if defined(CONFIG_H8300_AKI3068NET) && defined(CONFIG_IDE)
+	{
+#define AREABIT(addr) (1 << (((addr) >> 21) & 7))
+		/* setup BSC */
+		volatile unsigned char *abwcr = (volatile unsigned char *)ABWCR;
+		volatile unsigned char *cscr = (volatile unsigned char *)CSCR;
+		*abwcr &= ~(AREABIT(CONFIG_H8300_IDE_BASE) | AREABIT(CONFIG_H8300_IDE_ALT));
+		*cscr  |= (AREABIT(CONFIG_H8300_IDE_BASE) | AREABIT(CONFIG_H8300_IDE_ALT)) | 0x0f;
+	}
+#endif
 #ifdef DEBUG
 	printk(KERN_DEBUG "Done setup_arch\n");
 #endif
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index b40b878fd..17c83890c 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -192,6 +192,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
 	regs->er1 = context.sc_er1;
 	regs->er2 = context.sc_er2;
 	regs->er3 = context.sc_er3;
+	regs->er5 = context.sc_er5;
 	regs->ccr = (regs->ccr & 0x10)|(context.sc_ccr & 0xef);
 	regs->pc = context.sc_pc;
 	regs->orig_er0 = -1;		/* disable syscall checks */
@@ -308,6 +309,7 @@ static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
 	sc->sc_er1 = regs->er1;
 	sc->sc_er2 = regs->er2;
 	sc->sc_er3 = regs->er3;
+	sc->sc_er5 = regs->er5;
 	sc->sc_ccr = regs->ccr;
 	sc->sc_pc = regs->pc;
 }
@@ -384,6 +386,7 @@ static void setup_frame (int sig, struct k_sigaction *ka,
 			   ? current_thread_info()->exec_domain->signal_invmap[sig]
 		          : sig);
 	regs->er1 = (unsigned long)&(frame->sc);
+	regs->er5 = current->mm->start_data;	/* GOT base */
 
 	return;
 
@@ -435,6 +438,7 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
 		     : sig);
 	regs->er1 = (unsigned long)&(frame->info);
 	regs->er2 = (unsigned long)&frame->uc;
+	regs->er5 = current->mm->start_data;	/* GOT base */
 
 	return;
 
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S
index 6d1638078..1055a1bf7 100644
--- a/arch/h8300/kernel/syscalls.S
+++ b/arch/h8300/kernel/syscalls.S
@@ -265,8 +265,8 @@ SYMBOL_NAME_LABEL(sys_call_table)
 	.long SYMBOL_NAME(sys_io_getevents)
 	.long SYMBOL_NAME(sys_io_submit)
 	.long SYMBOL_NAME(sys_io_cancel)
-	.long SYMBOL_NAME(sys_ni_syscall)	/* 250 */ /* sys_alloc_hugepages */
-	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_freec_hugepages */
+	.long SYMBOL_NAME(sys_fadvise64)	/* 250 */
+	.long SYMBOL_NAME(sys_ni_syscall)
 	.long SYMBOL_NAME(sys_exit_group)
 	.long SYMBOL_NAME(sys_lookup_dcookie)
 	.long SYMBOL_NAME(sys_epoll_create)
@@ -287,36 +287,39 @@ SYMBOL_NAME_LABEL(sys_call_table)
 	.long SYMBOL_NAME(sys_fstatfs64)	
 	.long SYMBOL_NAME(sys_tgkill)		/* 270 */
 	.long SYMBOL_NAME(sys_utimes)
+ 	.long SYMBOL_NAME(sys_fadvise64_64)
+	.long SYMBOL_NAME(sys_ni_syscall)	/* sys_vserver */
 
 	.rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4
 		.long SYMBOL_NAME(sys_ni_syscall)
 	.endr
 
+	.macro	call_sp addr
+	mov.l	#SYMBOL_NAME(\addr),er6
+	bra	SYMBOL_NAME(syscall_trampoline):8
+	.endm
+
 SYMBOL_NAME_LABEL(sys_clone)	
-	mov.l	#SYMBOL_NAME(h8300_clone),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	h8300_clone
 	
 SYMBOL_NAME_LABEL(sys_sigsuspend)
-	mov.l	#SYMBOL_NAME(do_sigsuspend),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	do_sigsuspend
 
 SYMBOL_NAME_LABEL(sys_rt_sigsuspend)
-	mov.l	#SYMBOL_NAME(do_rt_sigsuspend),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	do_rt_sigsuspend
 
 SYMBOL_NAME_LABEL(sys_sigreturn)
-	mov.l	#SYMBOL_NAME(do_sigreturn),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	do_sigreturn
 
 SYMBOL_NAME_LABEL(sys_rt_sigreturn)
-	mov.l	#SYMBOL_NAME(do_rt_sigreturn),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	do_rt_sigreturn
 
 SYMBOL_NAME_LABEL(sys_fork)
-	mov.l	#SYMBOL_NAME(h8300_fork),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	h8300_fork
 
 SYMBOL_NAME_LABEL(sys_vfork)
-	mov.l	#SYMBOL_NAME(h8300_vfork),er0
-	jmp	@SYMBOL_NAME(syscall_trampoline)
+	call_sp	h8300_vfork
 
+SYMBOL_NAME_LABEL(syscall_trampoline)
+	mov.l	sp,er0
+	jmp	@er6
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c
index 253c87bc5..300e3279c 100644
--- a/arch/h8300/kernel/traps.c
+++ b/arch/h8300/kernel/traps.c
@@ -156,8 +156,14 @@ void show_stack(struct task_struct *task, unsigned long *esp)
 	printk("\n");
 }
 
+void show_trace_task(struct task_struct *tsk)
+{
+	show_stack(tsk,(unsigned long *)tsk->thread.esp0);
+}
+
 void dump_stack(void)
 {
 	show_stack(NULL,NULL);
 }
+
 EXPORT_SYMBOL(dump_stack);
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 3a643954a..7a6009cf2 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -1,3 +1,6 @@
+#define VMLINUX_SYMBOL(_sym_) _##_sym_
+#include <asm-generic/vmlinux.lds.h>
+#include <asm/thread_info.h>
 #include <linux/config.h>
 
 #ifdef CONFIG_H8300H_GENERIC
@@ -101,6 +104,21 @@ SECTIONS
 		 *(__ksymtab)
 	___stop___ksymtab = .;
 
+	___start___ksymtab_gpl = .;	/* Kernel symbol table: GPL-only symbols */
+
+	*(__ksymtab_gpl)
+	___stop___ksymtab_gpl = .;
+
+	___start___kcrctab = .;	/* Kernel symbol table: Normal symbols */
+	*(__kcrctab)
+	___stop___kcrctab = .;
+
+	___start___kcrctab_gpl = .;	/* Kernel symbol table: GPL-only symbols */
+	*(__kcrctab_gpl)
+	___stop___kcrctab_gpl = .;
+
+	*(__ksymtab_strings)	/* Kernel symbol table: strings */
+
 	. = ALIGN(0x4) ;
 	__etext = . ;
 #if defined(CONFIG_ROMKERNEL)
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 9e39d2eb9..1e0929ddc 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -162,7 +162,7 @@ void mem_init(void)
 	unsigned long end_mem   = memory_end; /* DAVIDM - this must not include kernel stack at top */
 
 #ifdef DEBUG
-	printk("Mem_init: start=%lx, end=%lx\n", start_mem, end_mem);
+	printk(KERN_DEBUG "Mem_init: start=%lx, end=%lx\n", start_mem, end_mem);
 #endif
 
 	end_mem &= PAGE_MASK;
@@ -179,7 +179,7 @@ void mem_init(void)
 	initk = (&__init_begin - &__init_end) >> 10;
 
 	tmp = nr_free_pages() << PAGE_SHIFT;
-	printk("Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n",
+	printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n",
 	       tmp >> 10,
 	       len >> 10,
 	       (rom_length > 0) ? ((rom_length >> 10) - codek) : 0,
@@ -223,7 +223,7 @@ free_initmem()
 		free_page(addr);
 		totalram_pages++;
 	}
-	printk("Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
+	printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
 			(addr - PAGE_ALIGN((long) &__init_begin)) >> 10,
 			(int)(PAGE_ALIGN((unsigned long)(&__init_begin))),
 			(int)(addr - PAGE_SIZE));
diff --git a/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S b/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
index 0513166cc..31c3703d8 100644
--- a/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
+++ b/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S
@@ -40,7 +40,7 @@ SYMBOL_NAME_LABEL(_start)
 
 	/* Peripheral Setup */
 	
-#if defined(CONFIG_BLK_DEV_BLKMEM)
+#if defined(CONFIG_MTD_UCLINUX)
 	/* move romfs image */
 	jsr	@__move_romfs	
 #endif
diff --git a/arch/h8300/platform/h8300h/aki3068net/timer.c b/arch/h8300/platform/h8300h/aki3068net/timer.c
index 83e637c73..086efb1fd 100644
--- a/arch/h8300/platform/h8300h/aki3068net/timer.c
+++ b/arch/h8300/platform/h8300h/aki3068net/timer.c
@@ -25,12 +25,19 @@
 
 #define CMFA 6
 
+#define CMIEA 0x40
+#define CCLR_CMA 0x08
+#define CLK_DIV8192 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
+
 void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
-	ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
-	ctrl_outb(0x00,_8TCSR2);
-	request_irq(40,timer_int,0,"timer",0);
-	ctrl_outb(0x40|0x08|0x03,_8TCR2);
+	/* setup 8bit timer ch2 */
+	ctrl_outb(H8300_TIMER_FREQ / HZ, TCORA2);      /* set interval */
+	ctrl_outb(0x00, _8TCSR2);                      /* no output */
+	request_irq(40, timer_int, 0, "timer", 0);
+	ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR2); /* start count */
 }
 
 void platform_timer_eoi(void)
diff --git a/arch/h8300/platform/h8300h/entry.S b/arch/h8300/platform/h8300h/entry.S
index a638b82f9..bd0cf695b 100644
--- a/arch/h8300/platform/h8300h/entry.S
+++ b/arch/h8300/platform/h8300h/entry.S
@@ -109,12 +109,10 @@
 .globl SYMBOL_NAME(system_call)
 .globl SYMBOL_NAME(ret_from_exception)
 .globl SYMBOL_NAME(ret_from_fork)
-.globl SYMBOL_NAME(ret_from_signal)
 .globl SYMBOL_NAME(ret_from_interrupt)
 .globl SYMBOL_NAME(interrupt_redirect_table)
 .globl SYMBOL_NAME(sw_ksp),SYMBOL_NAME(sw_usp)
 .globl SYMBOL_NAME(resume)
-.globl SYMBOL_NAME(syscall_trampoline)
 .globl SYMBOL_NAME(interrupt_redirect_table)
 .globl SYMBOL_NAME(interrupt_entry)
 .globl SYMBOL_NAME(system_call)
@@ -173,7 +171,7 @@ SYMBOL_NAME_LABEL(interrupt_entry)
 	beq	1f
 	jsr	@SYMBOL_NAME(do_softirq)
 1:
-	jmp	@SYMBOL_NAME(ret_from_exception)
+	jmp	@SYMBOL_NAME(ret_from_interrupt)
 	
 SYMBOL_NAME_LABEL(system_call)
 	subs	#4,sp				/* dummy LVEC */
@@ -205,11 +203,11 @@ SYMBOL_NAME_LABEL(system_call)
 	mov.l	@(LER2:16,sp),er1
 	mov.l	@(LER3:16,sp),er2
 	jsr	@er4
-	mov.l	er0,@(LER0,sp)			/* save the return value */
+	mov.l	er0,@(LER0:16,sp)		/* save the return value */
 #if defined(CONFIG_SYSCALL_PRINT)
 	jsr	@SYMBOL_NAME(syscall_print)
 #endif
-	jmp	@SYMBOL_NAME(ret_from_exception)
+	bra	SYMBOL_NAME(ret_from_exception):8
 1:
 	jsr	SYMBOL_NAME(syscall_trace)
 	mov.l	@(LER1:16,sp),er0
@@ -218,44 +216,66 @@ SYMBOL_NAME_LABEL(system_call)
 	jsr	@er4
 	mov.l	er0,@(LER0:16,sp)		/* save the return value */
 	jsr	@SYMBOL_NAME(syscall_trace)
+	bra	SYMBOL_NAME(ret_from_exception):8
+
+SYMBOL_NAME_LABEL(ret_from_fork)
+	mov.l	er2,er0
+	jsr	@SYMBOL_NAME(schedule_tail)
+	bra	SYMBOL_NAME(ret_from_exception):8
 
-SYMBOL_NAME_LABEL(ret_from_signal)
+SYMBOL_NAME_LABEL(reschedule)
+	/* save top of frame */
+	mov.l	sp,er0
+	jsr	@SYMBOL_NAME(set_esp0)
+	jsr	@SYMBOL_NAME(schedule)
 
 SYMBOL_NAME_LABEL(ret_from_exception)
+#if defined(CONFIG_PREEMPT)
+	orc	#0x80,ccr
+#endif
+SYMBOL_NAME_LABEL(ret_from_interrupt)
 	mov.b	@(LCCR+1:16,sp),r0l
 	btst	#4,r0l			/* check if returning to kernel */
-	bne	3f			/* if so, skip resched, signals */
+	bne	done:8			/* if so, skip resched, signals */
 	andc	#0x7f,ccr
-	mov.l	sp,er2
-	and.w	#0xe000,r2
-	mov.l	@(TI_FLAGS:16,er2),er1
+	mov.l	sp,er4
+	and.w	#0xe000,r4
+	mov.l	@(TI_FLAGS:16,er4),er1
 	and.l	#_TIF_WORK_MASK,er1
-	beq	3f
+	beq	done:8
 1:
-	mov.l	@(TI_FLAGS:16,er2),er1
+	mov.l	@(TI_FLAGS:16,er4),er1
 	btst	#TIF_NEED_RESCHED,r1l
 	bne	SYMBOL_NAME(reschedule):16
 	mov.l	sp,er1
 	subs	#4,er1			/* adjust retpc */
 	mov.l	er2,er0
 	jsr	@SYMBOL_NAME(do_signal)
-3:	 
+#if defined(CONFIG_PREEMPT)
+	bra	done:8			/* userspace thoru */
+3:
+	btst	#4,r0l
+	beq	done:8			/* userspace thoru */
+4:
+	mov.l	@(TI_PRE_COUNT:16,er4),er1
+	bne	done:8
+	mov.l	@(TI_FLAGS:16,er4),er1
+	btst	#TIF_NEED_RESCHED,r1l
+	beq	done:8
+	mov.b	r0l,r0l
+	bpl	done:8			/* interrupt off (exception path?) */
+	mov.l	#PREEMPT_ACTIVE,er1
+	mov.l	er1,@(TI_PRE_COUNT:16,er4)
+	andc	#0x7f,ccr
+	jsr	@SYMBOL_NAME(schedule)
+	sub.l	er1,er1
+	mov.l	er1,@(TI_PRE_COUNT:16,er4)
+	orc	#0x80,ccr
+	bra	4b:8
+#endif
+done:
 	RESTORE_ALL			/* Does RTE */
 
-SYMBOL_NAME_LABEL(reschedule)
-	/* save top of frame */
-	mov.l	sp,er0
-	jsr	@SYMBOL_NAME(set_esp0)
-
-	mov.l	#SYMBOL_NAME(ret_from_exception),er0
-	mov.l	er0,@-sp
-	jmp	@SYMBOL_NAME(schedule)
-
-SYMBOL_NAME_LABEL(ret_from_fork)
-	mov.l	er2,er0
-	jsr	@SYMBOL_NAME(schedule_tail)
-	jmp	@SYMBOL_NAME(ret_from_exception)	
-
 SYMBOL_NAME_LABEL(resume)
 	/*
 	 * Beware - when entering resume, offset of tss is in d1,
@@ -306,11 +326,6 @@ SYMBOL_NAME_LABEL(trace_break)
 	jsr	@SYMBOL_NAME(trace_trap)
 	jmp	@SYMBOL_NAME(ret_from_exception)	
 
-SYMBOL_NAME_LABEL(syscall_trampoline)
-	mov.l	er0,er6
-	mov.l	sp,er0
-	jmp	@er6
-
 	.section	.bss
 SYMBOL_NAME_LABEL(sw_ksp)
 	.space	4	
diff --git a/arch/h8300/platform/h8300h/generic/timer.c b/arch/h8300/platform/h8300h/generic/timer.c
index 394baa4f0..ffc0349b7 100644
--- a/arch/h8300/platform/h8300h/generic/timer.c
+++ b/arch/h8300/platform/h8300h/generic/timer.c
@@ -22,22 +22,23 @@
 
 #include <linux/timex.h>
 
-extern int request_irq_boot(unsigned int,
-		             irqreturn_t (*handler)(int, void *, struct pt_regs *),
-		             unsigned long, const char *, void *);
-
-
 #if defined(CONFIG_H83007) || defined(CONFIG_H83068)
 #include <asm/regs306x.h>
 #define CMFA 6
 
+#define CMIEA 0x40
+#define CCLR_CMA 0x08
+#define CLK_DIV8192 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
+
 int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
-	ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
-	ctrl_outb(0x00,_8TCSR2);
-	request_irq(40,timer_int,0,"timer",0);
-	ctrl_outb(0x40|0x08|0x03,_8TCR2);
-	return 0;
+	/* setup 8bit timer ch2 */
+	ctrl_outb(H8300_TIMER_FREQ / HZ, TCORA2);      /* set interval */
+	ctrl_outb(0x00, _8TCSR2);                      /* no output */
+	request_irq(40, timer_int, 0, "timer", 0);
+	ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR2); /* start count */
 }
 
 void platform_timer_eoi(void)
@@ -46,7 +47,7 @@ void platform_timer_eoi(void)
 }
 #endif
 
-#if defined(H8_3002) || defined(CONFIG_H83048)
+#if defined(CONFIG_H83002) || defined(CONFIG_H83048)
 /* FIXME! */
 #define TSTR 0x00ffff60
 #define TSNC 0x00ffff61
@@ -54,6 +55,7 @@ void platform_timer_eoi(void)
 #define TFCR 0x00ffff63
 #define TOER 0x00ffff90
 #define TOCR 0x00ffff91
+/* ITU0 */
 #define TCR  0x00ffff64
 #define TIOR 0x00ffff65
 #define TIER 0x00ffff66
@@ -62,23 +64,28 @@ void platform_timer_eoi(void)
 #define GRA  0x00ffff6a
 #define GRB  0x00ffff6c
 
+#define CCLR_CMGRA 0x20
+#define CLK_DIV8 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8 /* Timer input freq. */
+
 int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
-	*(unsigned short *)GRA= H8300_TIMER_COUNT_DATA;
-	*(unsigned short *)TCNT=0;
-	ctrl_outb(0x23,TCR);
-	ctrl_outb(0x00,TIOR);
-	request_timer_irq(26,timer_int,0,"timer",0);
-	ctrl_outb(inb(TIER) | 0x01,TIER);
-	ctrl_outb(inb(TSNC) & ~0x01,TSNC);
-	ctrl_outb(inb(TMDR) & ~0x01,TMDR);
-	ctrl_outb(inb(TSTR) | 0x01,TSTR);
+	*(unsigned short *)GRA= H8300_TIMER_FREQ / HZ;  /* set interval */
+	*(unsigned short *)TCNT=0;                      /* clear counter */
+	ctrl_outb(0x80|CCLR_CMGRA|CLK_DIV8, TCR);       /* set ITU0 clock */
+	ctrl_outb(0x88, TIOR);                          /* no output */
+	request_irq(26, timer_int, 0, "timer", 0);
+	ctrl_outb(0xf9, TIER);                          /* compare match GRA interrupt */
+	ctrl_outb(ctrl_inb(TSNC) & ~0x01, TSNC);        /* ITU0 async */
+	ctrl_outb(ctrl_inb(TMDR) & ~0x01, TMDR);        /* ITU0 normal mode */
+	ctrl_outb(ctrl_inb(TSTR) | 0x01, TSTR);         /* ITU0 Start */
 	return 0;
 }
 
 void platform_timer_eoi(void)
 {
-	ctrl_outb(inb(TSR) & ~0x01,TSR);
+	ctrl_outb(ctrl_inb(TSR) & ~0x01,TSR);
 }
 #endif
 
diff --git a/arch/h8300/platform/h8300h/h8max/crt0_ram.S b/arch/h8300/platform/h8300h/h8max/crt0_ram.S
index f3140f79b..a5c5a9156 100644
--- a/arch/h8300/platform/h8300h/h8max/crt0_ram.S
+++ b/arch/h8300/platform/h8300h/h8max/crt0_ram.S
@@ -40,7 +40,7 @@ SYMBOL_NAME_LABEL(_start)
 
 	/* Peripheral Setup */
 	
-#if defined(CONFIG_BLK_DEV_BLKMEM)
+#if defined(CONFIG_MTD_UCLINUX)
 	/* move romfs image */
 	jsr	@__move_romfs	
 #endif
diff --git a/arch/h8300/platform/h8300h/h8max/timer.c b/arch/h8300/platform/h8300h/h8max/timer.c
index 745da9d27..9ac9fa669 100644
--- a/arch/h8300/platform/h8300h/h8max/timer.c
+++ b/arch/h8300/platform/h8300h/h8max/timer.c
@@ -25,12 +25,19 @@
 
 #define CMFA 6
 
+#define CMIEA 0x40
+#define CCLR_CMA 0x08
+#define CLK_DIV8192 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
+
 void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
-	ctrl_outb(H8300_TIMER_COUNT_DATA,TCORA2);
-	ctrl_outb(0x00,_8TCSR2);
-	request_irq(40,timer_int,0,"timer",0);
-	ctrl_outb(0x40|0x08|0x03,_8TCR2);
+	/* setup 8bit timer ch2 */
+	ctrl_outb(H8300_TIMER_FREQ / HZ, TCORA2);      /* set interval */
+	ctrl_outb(0x00, _8TCSR2);                      /* no output */
+	request_irq(40, timer_int, 0, "timer", 0);
+	ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR2); /* start count */
 }
 
 void platform_timer_eoi(void)
diff --git a/arch/h8300/platform/h8300h/ptrace_h8300h.c b/arch/h8300/platform/h8300h/ptrace_h8300h.c
index 69f6ae19e..18e51a716 100644
--- a/arch/h8300/platform/h8300h/ptrace_h8300h.c
+++ b/arch/h8300/platform/h8300h/ptrace_h8300h.c
@@ -246,11 +246,13 @@ static unsigned short *getnextpc(struct task_struct *child, unsigned short *pc)
 					return (unsigned short *)addr;
 				case relb:
 					if ((inst = 0x55) || isbranch(child,inst & 0x0f))
-						(unsigned char *)pc += (signed char)(*fetch_p);
+						pc = (unsigned short *)((unsigned long)pc +
+								       ((signed char)(*fetch_p)));
 					return pc+1; /* skip myself */
 				case relw:
 					if ((inst = 0x5c) || isbranch(child,(*fetch_p & 0xf0) >> 4))
-						(unsigned char *)pc += (signed short)(*(pc+1));
+						pc = (unsigned short *)((unsigned long)pc +
+								       ((signed short)(*(pc+1))));
 					return pc+2; /* skip myself */
 				}
 			}
diff --git a/arch/h8300/platform/h8s/edosk2674/timer.c b/arch/h8300/platform/h8s/edosk2674/timer.c
index e49892e8e..9441a4f16 100644
--- a/arch/h8300/platform/h8s/edosk2674/timer.c
+++ b/arch/h8300/platform/h8s/edosk2674/timer.c
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/h8300/platform/h8s/generic/timer.c
+ *  linux/arch/h8300/platform/h8s/edosk2674/timer.c
  *
  *  Yoshinori Sato <ysato@users.sourceforge.jp>
  *
@@ -23,25 +23,28 @@
 #include <asm/irq.h>
 #include <asm/regs267x.h>
 
-#define REGS(regs) __REGS(regs)
-#define __REGS(regs) #regs
+#define CMFA 6
 
-int __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
+#define CMIEA 0x40
+#define CCLR_CMA 0x08
+#define CLK_DIV8192 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
+
+void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
-	unsigned char mstpcrl;
-	mstpcrl = ctrl_inb(MSTPCRL);                  /* Enable timer */
-	mstpcrl &= ~0x01;
-	ctrl_outb(mstpcrl,MSTPCRL);
-	ctrl_outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
-	ctrl_outb(0x00,_8TCSR1);
-	request_irq(76,timer_int,0,"timer",0);
-	ctrl_outb(0x40|0x08|0x03,_8TCR1);
-	return 0;
+	/* 8bit timer module enabled */
+	ctrl_outb(ctrl_inb(MSTPCRL) & ~0x01, MSTPCRL);
+	/* setup 8bit timer ch1 */
+	ctrl_outb(H8300_TIMER_FREQ / HZ, _8TCORA1);      /* set interval */
+	ctrl_outb(0x00, _8TCSR1);                        /* no output */
+	request_irq(76, timer_int, 0, "timer" ,0);
+	ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR1);   /* start count */
 }
 
 void platform_timer_eoi(void)
 {
-        __asm__("bclr #6,@" REGS(_8TCSR1) ":8");
+	*(volatile unsigned char *)_8TCSR1 &= ~(1 << CMFA);
 }
 
 void platform_gettod(int *year, int *mon, int *day, int *hour,
diff --git a/arch/h8300/platform/h8s/entry.S b/arch/h8300/platform/h8s/entry.S
index ab73e30cd..9df1201a1 100644
--- a/arch/h8300/platform/h8s/entry.S
+++ b/arch/h8300/platform/h8s/entry.S
@@ -109,12 +109,10 @@
 .globl SYMBOL_NAME(system_call)
 .globl SYMBOL_NAME(ret_from_exception)
 .globl SYMBOL_NAME(ret_from_fork)
-.globl SYMBOL_NAME(ret_from_signal)
 .globl SYMBOL_NAME(ret_from_interrupt)
 .globl SYMBOL_NAME(interrupt_redirect_table)
 .globl SYMBOL_NAME(sw_ksp),SYMBOL_NAME(sw_usp)
 .globl SYMBOL_NAME(resume)
-.globl SYMBOL_NAME(syscall_trampoline)
 .globl SYMBOL_NAME(trace_break)
 .globl SYMBOL_NAME(interrupt_entry)
 		
@@ -201,11 +199,11 @@ SYMBOL_NAME_LABEL(system_call)
 	mov.l	@(LER2:16,sp),er1
 	mov.l	@(LER3:16,sp),er2
 	jsr	@er4
-	mov.l	er0,@(LER0,sp)			/* save the return value */
+	mov.l	er0,@(LER0:16,sp)			/* save the return value */
 #if defined(CONFIG_SYSCALL_PRINT)
 	jsr	@SYMBOL_NAME(syscall_print)
 #endif
-	jmp	@SYMBOL_NAME(ret_from_exception)
+	bra	SYMBOL_NAME(ret_from_exception):8
 1:
 	jsr	SYMBOL_NAME(syscall_trace)
 	mov.l	@(LER1:16,sp),er0
@@ -214,45 +212,67 @@ SYMBOL_NAME_LABEL(system_call)
 	jsr	@er4
 	mov.l	er0,@(LER0:16,sp)		/* save the return value */
 	jsr	@SYMBOL_NAME(syscall_trace)
+	bra	SYMBOL_NAME(ret_from_exception):8
+
+
+SYMBOL_NAME_LABEL(ret_from_fork)
+	mov.l	er2,er0
+	jsr	@SYMBOL_NAME(schedule_tail)
+	bra	SYMBOL_NAME(ret_from_exception):8
 
-SYMBOL_NAME_LABEL(ret_from_signal)
+SYMBOL_NAME_LABEL(reschedule)
+	/* save top of frame */
+	mov.l	sp,er0
+	jsr	@SYMBOL_NAME(set_esp0)
+	jsr	@SYMBOL_NAME(schedule)
 
 SYMBOL_NAME_LABEL(ret_from_exception)
+#if defined(CONFIG_PREEMPT)
+	orc	#0x80,ccr
+#endif
+SYMBOL_NAME_LABEL(ret_from_interrupt)
 	mov.b	@(LCCR+1:16,sp),r0l
 	btst	#4,r0l			/* check if returning to kernel */
-	bne	3f			/* if so, skip resched, signals */
+	bne	done:8			/* if so, skip resched, signals */
 	andc	#0x7f,ccr
-	mov.l	sp,er2
-	and.w	#0xe000,r2
-	mov.l	@(TI_FLAGS:16,er2),er1
+	mov.l	sp,er4
+	and.w	#0xe000,r4
+	mov.l	@(TI_FLAGS:16,er4),er1
 	and.l	#_TIF_WORK_MASK,er1
-	beq	3f
+	beq	done:8
 1:
-	mov.l	@(TI_FLAGS:16,er2),er1
+	mov.l	@(TI_FLAGS:16,er4),er1
 	btst	#TIF_NEED_RESCHED,r1l
 	bne	SYMBOL_NAME(reschedule):16
 	mov.l	sp,er1
 	subs	#4,er1			/* adjust retpc */
 	mov.l	er2,er0
 	jsr	@SYMBOL_NAME(do_signal)
-3:	 
+#if defined(CONFIG_PREEMPT)
+	bra	done:8			/* userspace thoru */
+3:
+	btst	#4,r0l
+	beq	done:8			/* userspace thoru */
+4:
+	mov.l	@(TI_PRE_COUNT:16,er4),er1
+	bne	done:8
+	mov.l	@(TI_FLAGS:16,er4),er1
+	btst	#TIF_NEED_RESCHED,r1l
+	beq	done:8
+	mov.b	r0l,r0l
+	bpl	done:8			/* interrupt off (exception path?) */
+	mov.l	#PREEMPT_ACTIVE,er1
+	mov.l	er1,@(TI_PRE_COUNT:16,er4)
+	andc	#0x7f,ccr
+	jsr	@SYMBOL_NAME(schedule)
+	sub.l	er1,er1
+	mov.l	er1,@(TI_PRE_COUNT:16,er4)
+	orc	#0x80,ccr
+	bra	4b:8
+#endif
+done:
 	RESTORE_ALL			/* Does RTE */
 
-SYMBOL_NAME_LABEL(reschedule)
-	/* save top of frame */
-	mov.l	sp,er0
-	jsr	@SYMBOL_NAME(set_esp0)
-
-	mov.l	#SYMBOL_NAME(ret_from_exception),er0
-	mov.l	er0,@-sp
-	jmp	@SYMBOL_NAME(schedule)
-
-SYMBOL_NAME_LABEL(ret_from_fork)
-	mov.l	er2,er0
-	jsr	@SYMBOL_NAME(schedule_tail)
-	jmp	@SYMBOL_NAME(ret_from_exception)	
-
-
 SYMBOL_NAME_LABEL(resume)
 	/*
 	 *	er0 = prev
@@ -284,7 +304,7 @@ SYMBOL_NAME_LABEL(resume)
 
 	ldc	r3l,ccr
 	ldc	r3h,exr
-	
+
 	rts
 
 SYMBOL_NAME_LABEL(trace_break)
@@ -304,11 +324,6 @@ SYMBOL_NAME_LABEL(trace_break)
 	jsr	@SYMBOL_NAME(trace_trap)
 	jmp	@SYMBOL_NAME(ret_from_exception)	
 
-SYMBOL_NAME_LABEL(syscall_trampoline)
-	mov.l	er0,er6
-	mov.l	sp,er0
-	jmp	@er6
-
 	.section	.bss
 SYMBOL_NAME_LABEL(sw_ksp)
 	.space	4	
diff --git a/arch/h8300/platform/h8s/generic/timer.c b/arch/h8300/platform/h8s/generic/timer.c
index 2e0ad1140..633cd8e1c 100644
--- a/arch/h8300/platform/h8s/generic/timer.c
+++ b/arch/h8300/platform/h8s/generic/timer.c
@@ -23,18 +23,28 @@
 #include <asm/irq.h>
 #include <asm/regs267x.h>
 
-int platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
+#define CMFA 6
+
+#define CMIEA 0x40
+#define CCLR_CMA 0x08
+#define CLK_DIV8192 0x03
+
+#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
+
+void __init platform_timer_setup(irqreturn_t (*timer_int)(int, void *, struct pt_regs *))
 {
-	ctrl_outb(H8300_TIMER_COUNT_DATA,_8TCORA1);
-	ctrl_outb(0x00,_8TCSR1);
-	request_irq(76,timer_int,0,"timer",0);
-	ctrl_outb(0x40|0x08|0x03,_8TCR1);
-	return 0;
+	/* 8bit timer module enabled */
+	ctrl_outb(ctrl_inb(MSTPCRL) & ~0x01, MSTPCRL);
+	/* setup 8bit timer ch1 */
+	ctrl_outb(H8300_TIMER_FREQ / HZ, _8TCORA1);      /* set interval */
+	ctrl_outb(0x00, _8TCSR1);                        /* no output */
+	request_irq(76, timer_int, 0, "timer" ,0);
+	ctrl_outb(CMIEA|CCLR_CMA|CLK_DIV8192, _8TCR1);   /* start count */
 }
 
 void platform_timer_eoi(void)
 {
-        __asm__("bclr #6,@0xffffb3:8");
+	*(volatile unsigned char *)_8TCSR1 &= ~(1 << CMFA);
 }
 
 void platform_gettod(int *year, int *mon, int *day, int *hour,
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 954887332..3645f706a 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -65,6 +65,8 @@ config X86_VOYAGER
 
 config X86_NUMAQ
 	bool "NUMAQ (IBM/Sequent)"
+	select DISCONTIGMEM
+	select NUMA
 	help
 	  This option is used for getting Linux to run on a (IBM/Sequent) NUMA 
 	  multiquad box. This changes the way that processors are bootstrapped,
@@ -102,10 +104,10 @@ config X86_VISWS
 	  and vice versa. See <file:Documentation/sgi-visws.txt> for details.
 
 config X86_GENERICARCH
-       bool "Generic architecture (Summit, bigsmp, default)"
+       bool "Generic architecture (Summit, bigsmp, ES7000, default)"
        depends on SMP
        help
-          This option compiles in the Summit, bigsmp, default subarchitectures.
+          This option compiles in the Summit, bigsmp, ES7000, default subarchitectures.
 	  It is intended for a generic binary kernel.
 
 config X86_ES7000
@@ -479,6 +481,16 @@ config NR_CPUS
 	  This is purely to save memory - each supported CPU adds
 	  approximately eight kilobytes to the kernel image.
 
+config SCHED_SMT
+	bool "SMT (Hyperthreading) scheduler support"
+	depends on SMP
+	default off
+	help
+	  SMT scheduler support improves the CPU scheduler's decision making
+	  when dealing with Intel Pentium 4 chips with HyperThreading at a
+	  cost of slightly increased overhead in some places. If unsure say
+	  N here.
+
 config PREEMPT
 	bool "Preemptible Kernel"
 	help
@@ -538,6 +550,7 @@ config X86_TSC
 
 config X86_MCE
 	bool "Machine Check Exception"
+	depends on !X86_VOYAGER
 	---help---
 	  Machine Check Exception support allows the processor to notify the
 	  kernel if it detects a problem (e.g. overheating, component failure).
@@ -709,7 +722,7 @@ config X86_PAE
 
 # Common NUMA Features
 config NUMA
-	bool "Numa Memory Allocation Support"
+	bool "Numa Memory Allocation and Scheduler Support"
 	depends on SMP && HIGHMEM64G && (X86_NUMAQ || X86_GENERICARCH || (X86_SUMMIT && ACPI))
 	default n if X86_PC
 	default y if (X86_NUMAQ || X86_SUMMIT)
@@ -813,7 +826,7 @@ config EFI
 	This option is only useful on systems that have EFI firmware
 	and will result in a kernel image that is ~8k larger.  In addition,
 	you must use the latest ELILO loader available at
-	<ftp://ftp.hpl.hp.com/pub/linux-ia64/> in order to take advantage of
+	<http://elilo.sourceforge.net> in order to take advantage of
 	kernel initialization using EFI information (neither GRUB nor LILO know
 	anything about EFI).  However, even with this option, the resultant
 	kernel should continue to boot on existing non-EFI platforms.
@@ -1174,6 +1187,58 @@ source "arch/i386/oprofile/Kconfig"
 
 menu "Kernel hacking"
 
+config CRASH_DUMP
+	tristate "Crash dump support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	default n
+	---help---
+	  Say Y here to enable saving an image of system memory when a panic
+	  or other error occurs. Dumps can also be forced with the SysRq+d
+	  key if MAGIC_SYSRQ is enabled.
+
+config CRASH_DUMP_BLOCKDEV
+	tristate "Crash dump block device driver"
+	depends on CRASH_DUMP
+	help
+	  Say Y to allow saving crash dumps directly to a disk device.
+
+config CRASH_DUMP_NETDEV
+	tristate "Crash dump network device driver"
+	depends on CRASH_DUMP
+	help
+	  Say Y to allow saving crash dumps over a network device.
+
+config CRASH_DUMP_MEMDEV
+	bool "Crash dump staged memory driver"
+	depends on CRASH_DUMP
+	help
+	  Say Y to allow intermediate saving crash dumps in spare 
+	  memory pages which would then be written out to disk
+	  later.
+
+config CRASH_DUMP_SOFTBOOT
+	bool "Save crash dump across a soft reboot"
+	depends on CRASH_DUMP_MEMDEV
+	help
+	  Say Y to allow a crash dump to be preserved in memory
+	  pages across a soft reboot and written out to disk
+	  thereafter. For this to work, CRASH_DUMP must be 
+	  configured as part of the kernel (not as a module).
+
+config CRASH_DUMP_COMPRESS_RLE
+	tristate "Crash dump RLE compression"
+	depends on CRASH_DUMP
+	help
+	  Say Y to allow saving dumps with Run Length Encoding compression.
+
+config CRASH_DUMP_COMPRESS_GZIP
+	tristate "Crash dump GZIP compression"
+	select ZLIB_INFLATE
+	select ZLIB_DEFLATE
+	depends on CRASH_DUMP
+	help
+	  Say Y to allow saving dumps with Gnu Zip compression.
+
 config DEBUG_KERNEL
 	bool "Kernel debugging"
 	help
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 019544e08..299b5f2bb 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -18,8 +18,9 @@
 LDFLAGS		:= -m elf_i386
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
 LDFLAGS_vmlinux :=
+CHECK		:= $(CHECK) -D__i386__=1
 
-CFLAGS += -pipe
+CFLAGS += -pipe -msoft-float
 
 # prevent gcc from keeping the stack 16 byte aligned
 CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,)
@@ -92,7 +93,8 @@ core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/
 
 # ES7000 subarch support
 mflags-$(CONFIG_X86_ES7000)	:= -Iinclude/asm-i386/mach-es7000
-mcore-$(CONFIG_X86_ES7000)	:= mach-es7000
+mcore-$(CONFIG_X86_ES7000)	:= mach-default
+core-$(CONFIG_X86_ES7000)	:= arch/i386/mach-es7000/
 
 # default subarch .h files
 mflags-y += -Iinclude/asm-i386/mach-default
diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
index d70853d99..feb561e9a 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/i386/boot/Makefile
@@ -102,3 +102,4 @@ zlilo: $(BOOTIMAGE)
 
 install: $(BOOTIMAGE)
 	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
+	if [ -f init/kerntypes.o ]; then cp init/kerntypes.o $(INSTALL_PATH)/Kerntypes; fi
diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
index 803a1bff5..d606d0687 100644
--- a/arch/i386/boot/setup.S
+++ b/arch/i386/boot/setup.S
@@ -133,7 +133,7 @@ ramdisk_image:	.long	0		# address of loaded ramdisk image
 ramdisk_size:	.long	0		# its size in bytes
 
 bootsect_kludge:
-		.word  bootsect_helper, SETUPSEG
+		.long	0		# obsolete
 
 heap_end_ptr:	.word	modelist+1024	# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
@@ -156,7 +156,8 @@ cmd_line_ptr:	.long 0			# (Header version 0x0202 or later)
 					# can be located anywhere in
 					# low memory 0x10000 or higher.
 
-ramdisk_max:	.long MAXMEM-1		# (Header version 0x0203 or later)
+ramdisk_max:	.long (MAXMEM-1) & 0x7fffffff
+					# (Header version 0x0203 or later)
 					# The highest safe address for
 					# the contents of an initrd
 
@@ -837,7 +838,7 @@ flush_instr:
 	subw	$DELTA_INITSEG, %si
 	shll	$4, %esi			# Convert to 32-bit pointer
 
-# jump to startup_32 in arch/i386/kernel/head.S
+# jump to startup_32 in arch/i386/boot/compressed/head.S
 #	
 # NOTE: For high loaded big kernels we need a
 #	jmpi    0x100000,__BOOT_CS
@@ -872,88 +873,6 @@ default_switch:
 	outb	%al, $0x70
 	lret
 
-# This routine only gets called, if we get loaded by the simple
-# bootsect loader _and_ have a bzImage to load.
-# Because there is no place left in the 512 bytes of the boot sector,
-# we must emigrate to code space here.
-bootsect_helper:
-	cmpw	$0, %cs:bootsect_es
-	jnz	bootsect_second
-
-	movb	$0x20, %cs:type_of_loader
-	movw	%es, %ax
-	shrw	$4, %ax
-	movb	%ah, %cs:bootsect_src_base+2
-	movw	%es, %ax
-	movw	%ax, %cs:bootsect_es
-	subw	$SYSSEG, %ax
-	lret					# nothing else to do for now
-
-bootsect_second:
-	pushw	%cx
-	pushw	%si
-	pushw	%bx
-	testw	%bx, %bx			# 64K full?
-	jne	bootsect_ex
-
-	movw	$0x8000, %cx			# full 64K, INT15 moves words
-	pushw	%cs
-	popw	%es
-	movw	$bootsect_gdt, %si
-	movw	$0x8700, %ax
-	int	$0x15
-	jc	bootsect_panic			# this, if INT15 fails
-
-	movw	%cs:bootsect_es, %es		# we reset %es to always point
-	incb	%cs:bootsect_dst_base+2		# to 0x10000
-bootsect_ex:
-	movb	%cs:bootsect_dst_base+2, %ah
-	shlb	$4, %ah				# we now have the number of
-						# moved frames in %ax
-	xorb	%al, %al
-	popw	%bx
-	popw	%si
-	popw	%cx
-	lret
-
-bootsect_gdt:
-	.word	0, 0, 0, 0
-	.word	0, 0, 0, 0
-
-bootsect_src:
-	.word	0xffff
-
-bootsect_src_base:
-	.byte	0x00, 0x00, 0x01		# base = 0x010000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-
-bootsect_dst:
-	.word	0xffff
-
-bootsect_dst_base:
-	.byte	0x00, 0x00, 0x10		# base = 0x100000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-	.word	0, 0, 0, 0			# BIOS CS
-	.word	0, 0, 0, 0			# BIOS DS
-
-bootsect_es:
-	.word	0
-
-bootsect_panic:
-	pushw	%cs
-	popw	%ds
-	cld
-	leaw	bootsect_panic_mess, %si
-	call	prtstr
-	
-bootsect_panic_loop:
-	jmp	bootsect_panic_loop
-
-bootsect_panic_mess:
-	.string	"INT15 refuses to access high mem, giving up."
-
 
 #ifndef CONFIG_X86_VOYAGER
 # This routine tests whether or not A20 is enabled.  If so, it
diff --git a/arch/i386/boot98/setup.S b/arch/i386/boot98/setup.S
index 615fe3fa2..4ed91417e 100644
--- a/arch/i386/boot98/setup.S
+++ b/arch/i386/boot98/setup.S
@@ -146,7 +146,7 @@ ramdisk_image:	.long	0		# address of loaded ramdisk image
 ramdisk_size:	.long	0		# its size in bytes
 
 bootsect_kludge:
-		.word  bootsect_helper, SETUPSEG
+		.long	0		# obsolete
 
 heap_end_ptr:	.word	modelist+1024	# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
@@ -691,91 +691,6 @@ default_switch:
 						# sequence
 	lret
 
-# This routine only gets called, if we get loaded by the simple
-# bootsect loader _and_ have a bzImage to load.
-# Because there is no place left in the 512 bytes of the boot sector,
-# we must emigrate to code space here.
-bootsect_helper:
-	cmpw	$0, %cs:bootsect_es
-	jnz	bootsect_second
-
-	movb	$0x20, %cs:type_of_loader
-	movw	%es, %ax
-	shrw	$4, %ax
-	movb	%ah, %cs:bootsect_src_base+2
-	movw	%es, %ax
-	movw	%ax, %cs:bootsect_es
-	subw	$SYSSEG, %ax
-	lret					# nothing else to do for now
-
-bootsect_second:
-	pushw	%bx
-	pushw	%cx
-	pushw	%si
-	pushw	%di
-	testw	%bp, %bp			# 64K full ?
-	jne	bootsect_ex
-
-	xorw	%cx, %cx			# zero means full 64K
-	pushw	%cs
-	popw	%es
-	movw	$bootsect_gdt, %bx
-	xorw	%si, %si			# source address
-	xorw	%di, %di			# destination address
-	movb	$0x90, %ah
-	int	$0x1f
-	jc	bootsect_panic			# this, if INT1F fails
-
-	movw	%cs:bootsect_es, %es		# we reset %es to always point
-	incb	%cs:bootsect_dst_base+2		# to 0x10000
-bootsect_ex:
-	movb	%cs:bootsect_dst_base+2, %ah
-	shlb	$4, %ah				# we now have the number of
-						# moved frames in %ax
-	xorb	%al, %al
-	popw	%di
-	popw	%si
-	popw	%cx
-	popw	%bx
-	lret
-
-bootsect_gdt:
-	.word	0, 0, 0, 0
-	.word	0, 0, 0, 0
-
-bootsect_src:
-	.word	0xffff
-
-bootsect_src_base:
-	.byte	0x00, 0x00, 0x01		# base = 0x010000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-
-bootsect_dst:
-	.word	0xffff
-
-bootsect_dst_base:
-	.byte	0x00, 0x00, 0x10		# base = 0x100000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-	.word	0, 0, 0, 0			# BIOS CS
-	.word	0, 0, 0, 0			# BIOS DS
-
-bootsect_es:
-	.word	0
-
-bootsect_panic:
-	pushw	%cs
-	popw	%ds
-	cld
-	leaw	bootsect_panic_mess, %si
-	call	prtstr
-
-bootsect_panic_loop:
-	jmp	bootsect_panic_loop
-
-bootsect_panic_mess:
-	.string	"INT1F refuses to access high mem, giving up."
 
 # This routine prints one character (in %al) on console.
 # PC-9800 doesn't have BIOS-function to do it like IBM PC's INT 10h - 0Eh,
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index c2a9ab0aa..7257696c7 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -18,8 +18,11 @@ CONFIG_STANDALONE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_AUDIT=y
+CONFIG_AUDITSYSCALL=y
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -30,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -88,6 +92,7 @@ CONFIG_X86_USE_PPRO_CHECKSUM=y
 # CONFIG_HPET_EMULATE_RTC is not set
 CONFIG_SMP=y
 CONFIG_NR_CPUS=8
+CONFIG_SCHED_SMT=y
 CONFIG_PREEMPT=y
 CONFIG_X86_LOCAL_APIC=y
 CONFIG_X86_IO_APIC=y
@@ -200,7 +205,7 @@ CONFIG_BINFMT_MISC=y
 #
 # Generic Driver Options
 #
-# CONFIG_FW_LOADER is not set
+CONFIG_FW_LOADER=m
 
 #
 # Memory Technology Devices (MTD)
@@ -259,7 +264,6 @@ CONFIG_BLK_DEV_IDE=y
 # CONFIG_BLK_DEV_HD_IDE is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -307,6 +311,7 @@ CONFIG_BLK_DEV_PIIX=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 # CONFIG_IDE_CHIPSETS is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
@@ -332,7 +337,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-CONFIG_SCSI_REPORT_LUNS=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -354,6 +358,7 @@ CONFIG_SCSI_REPORT_LUNS=y
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
+CONFIG_SCSI_DPT_I2O=m
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_MEGARAID is not set
@@ -361,7 +366,9 @@ CONFIG_SCSI_SATA=y
 # CONFIG_SCSI_SATA_SVW is not set
 CONFIG_SCSI_ATA_PIIX=y
 # CONFIG_SCSI_SATA_PROMISE is not set
+CONFIG_SCSI_SATA_SX4=m
 # CONFIG_SCSI_SATA_SIL is not set
+CONFIG_SCSI_SATA_SIS=m
 # CONFIG_SCSI_SATA_VIA is not set
 # CONFIG_SCSI_SATA_VITESSE is not set
 # CONFIG_SCSI_BUSLOGIC is not set
@@ -380,6 +387,9 @@ CONFIG_SCSI_ATA_PIIX=y
 # CONFIG_SCSI_IMM is not set
 # CONFIG_SCSI_NCR53C406A is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+CONFIG_SCSI_IPR=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_SCSI_IPR_DUMP is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
@@ -484,8 +494,6 @@ CONFIG_IP_MULTICAST=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -539,13 +547,17 @@ CONFIG_IP_NF_TARGET_TCPMSS=y
 CONFIG_IP_NF_ARPTABLES=y
 CONFIG_IP_NF_ARPFILTER=y
 CONFIG_IP_NF_ARP_MANGLE=y
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -566,18 +578,23 @@ CONFIG_IP_NF_ARP_MANGLE=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_NET_SB1000 is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -619,7 +636,6 @@ CONFIG_8139TOO_PIO=y
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_8139_RXBUF_IDX=2
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -637,7 +653,6 @@ CONFIG_8139_RXBUF_IDX=2
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -645,47 +660,31 @@ CONFIG_8139_RXBUF_IDX=2
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+CONFIG_S2IO=m
+# CONFIG_S2IO_NAPI is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -803,6 +802,7 @@ CONFIG_AGP=y
 # CONFIG_AGP_AMD is not set
 # CONFIG_AGP_AMD64 is not set
 CONFIG_AGP_INTEL=y
+CONFIG_AGP_INTEL_MCH=m
 # CONFIG_AGP_NVIDIA is not set
 # CONFIG_AGP_SIS is not set
 # CONFIG_AGP_SWORKS is not set
@@ -978,6 +978,7 @@ CONFIG_USB_DEVICEFS=y
 #
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_OHCI_HCD is not set
 CONFIG_USB_UHCI_HCD=y
 
@@ -1012,6 +1013,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
 # CONFIG_USB_MTOUCH is not set
+CONFIG_USB_EGALAX=m
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
 
@@ -1061,6 +1063,8 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETSERVO=m
 # CONFIG_USB_TEST is not set
 
 #
@@ -1110,6 +1114,7 @@ CONFIG_VFAT_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -1152,7 +1157,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -1217,6 +1221,7 @@ CONFIG_OPROFILE=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_FRAME_POINTER is not set
+CONFIG_4KSTACKS=y
 CONFIG_X86_FIND_SMP_CONFIG=y
 CONFIG_X86_MPPARSE=y
 
@@ -1234,8 +1239,10 @@ CONFIG_X86_MPPARSE=y
 # Library routines
 #
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_X86_SMP=y
 CONFIG_X86_HT=y
 CONFIG_X86_BIOS_REBOOT=y
 CONFIG_X86_TRAMPOLINE=y
+CONFIG_X86_STD_RESOURCES=y
 CONFIG_PC=y
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index a91878d4e..2c53ca535 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -51,6 +51,10 @@ static inline int ioapic_setup_disabled(void) { return 0; }
 
 #endif	/* X86 */
 
+#define BAD_MADT_ENTRY(entry, end) (					    \
+		(!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
+		((acpi_table_entry_header *)entry)->length != sizeof(*entry))
+
 #define PREFIX			"ACPI: "
 
 #ifdef CONFIG_ACPI_PCI
@@ -204,12 +208,13 @@ acpi_parse_madt (
 
 static int __init
 acpi_parse_lapic (
-	acpi_table_entry_header *header)
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lapic	*processor = NULL;
 
 	processor = (struct acpi_table_lapic*) header;
-	if (!processor)
+
+	if (BAD_MADT_ENTRY(processor, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -225,15 +230,15 @@ acpi_parse_lapic (
 	return 0;
 }
 
-
 static int __init
 acpi_parse_lapic_addr_ovr (
-	acpi_table_entry_header *header)
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
 
 	lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header;
-	if (!lapic_addr_ovr)
+
+	if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
 		return -EINVAL;
 
 	acpi_lapic_addr = lapic_addr_ovr->address;
@@ -243,12 +248,13 @@ acpi_parse_lapic_addr_ovr (
 
 static int __init
 acpi_parse_lapic_nmi (
-	acpi_table_entry_header *header)
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lapic_nmi *lapic_nmi = NULL;
 
 	lapic_nmi = (struct acpi_table_lapic_nmi*) header;
-	if (!lapic_nmi)
+
+	if (BAD_MADT_ENTRY(lapic_nmi, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -266,12 +272,13 @@ acpi_parse_lapic_nmi (
 
 static int __init
 acpi_parse_ioapic (
-	acpi_table_entry_header *header)
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_ioapic *ioapic = NULL;
 
 	ioapic = (struct acpi_table_ioapic*) header;
-	if (!ioapic)
+
+	if (BAD_MADT_ENTRY(ioapic, end))
 		return -EINVAL;
  
 	acpi_table_print_madt_entry(header);
@@ -320,12 +327,13 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 
 static int __init
 acpi_parse_int_src_ovr (
-	acpi_table_entry_header *header)
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_int_src_ovr *intsrc = NULL;
 
 	intsrc = (struct acpi_table_int_src_ovr*) header;
-	if (!intsrc)
+
+	if (BAD_MADT_ENTRY(intsrc, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -354,12 +362,13 @@ acpi_parse_int_src_ovr (
 
 static int __init
 acpi_parse_nmi_src (
-	acpi_table_entry_header *header)
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_nmi_src *nmi_src = NULL;
 
 	nmi_src = (struct acpi_table_nmi_src*) header;
-	if (!nmi_src)
+
+	if (BAD_MADT_ENTRY(nmi_src, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -417,16 +426,6 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 
 #endif /* CONFIG_ACPI_BUS */
 
-#ifdef CONFIG_X86_IO_APIC
-/* deprecated in favor of acpi_gsi_to_irq */
-int acpi_irq_to_vector(u32 irq)
-{
-	if (use_pci_vector() && !platform_legacy_irq(irq))
- 		irq = IO_APIC_VECTOR(irq);
-	return irq;
-}
-#endif
-
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
 #ifdef CONFIG_X86_IO_APIC
@@ -729,6 +728,13 @@ acpi_process_madt(void)
 				clustered_apic_check();
 			}
 		}
+		if (error == -EINVAL) {
+			/*
+			 * Dell Precision Workstation 410, 610 come here.
+			 */
+			printk(KERN_ERR PREFIX "Invalid BIOS MADT, disabling ACPI\n");
+			disable_acpi();
+		}
 	}
 #endif
 	return;
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index 5ae7dbef1..2c5de1d7f 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -270,6 +270,7 @@ ENTRY(do_suspend_lowlevel)
 	call	save_registers
 	pushl	$3
 	call	acpi_enter_sleep_state
+	addl	$4,%esp
 	ret
 	.p2align 4,,7
 ret_point:
diff --git a/arch/i386/kernel/asm-offsets.c b/arch/i386/kernel/asm-offsets.c
index 4a1a6c231..6248bf257 100644
--- a/arch/i386/kernel/asm-offsets.c
+++ b/arch/i386/kernel/asm-offsets.c
@@ -6,30 +6,60 @@
 
 #include <linux/sched.h>
 #include <linux/signal.h>
+#include <linux/personality.h>
 #include <asm/ucontext.h>
 #include "sigframe.h"
 #include <asm/fixmap.h>
+#include <asm/processor.h>
+#include <asm/thread_info.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
 
 #define BLANK() asm volatile("\n->" : : )
 
+#define OFFSET(sym, str, mem) \
+	DEFINE(sym, offsetof(struct str, mem));
+
 void foo(void)
 {
-	DEFINE(SIGCONTEXT_eax, offsetof (struct sigcontext, eax));
-	DEFINE(SIGCONTEXT_ebx, offsetof (struct sigcontext, ebx));
-	DEFINE(SIGCONTEXT_ecx, offsetof (struct sigcontext, ecx));
-	DEFINE(SIGCONTEXT_edx, offsetof (struct sigcontext, edx));
-	DEFINE(SIGCONTEXT_esi, offsetof (struct sigcontext, esi));
-	DEFINE(SIGCONTEXT_edi, offsetof (struct sigcontext, edi));
-	DEFINE(SIGCONTEXT_ebp, offsetof (struct sigcontext, ebp));
-	DEFINE(SIGCONTEXT_esp, offsetof (struct sigcontext, esp));
-	DEFINE(SIGCONTEXT_eip, offsetof (struct sigcontext, eip));
+	OFFSET(SIGCONTEXT_eax, sigcontext, eax);
+	OFFSET(SIGCONTEXT_ebx, sigcontext, ebx);
+	OFFSET(SIGCONTEXT_ecx, sigcontext, ecx);
+	OFFSET(SIGCONTEXT_edx, sigcontext, edx);
+	OFFSET(SIGCONTEXT_esi, sigcontext, esi);
+	OFFSET(SIGCONTEXT_edi, sigcontext, edi);
+	OFFSET(SIGCONTEXT_ebp, sigcontext, ebp);
+	OFFSET(SIGCONTEXT_esp, sigcontext, esp);
+	OFFSET(SIGCONTEXT_eip, sigcontext, eip);
+	BLANK();
+
+	OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
+	OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
+	OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
+	OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask);
+	OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math);
+	OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
+	OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
+	OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
 	BLANK();
 
-	DEFINE(RT_SIGFRAME_sigcontext,
-	       offsetof (struct rt_sigframe, uc.uc_mcontext));
+	OFFSET(TI_task, thread_info, task);
+	OFFSET(TI_exec_domain, thread_info, exec_domain);
+	OFFSET(TI_flags, thread_info, flags);
+	OFFSET(TI_status, thread_info, status);
+	OFFSET(TI_cpu, thread_info, cpu);
+	OFFSET(TI_preempt_count, thread_info, preempt_count);
+	OFFSET(TI_addr_limit, thread_info, addr_limit);
+	OFFSET(TI_restart_block, thread_info, restart_block);
+	BLANK();
+
+	OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
+	OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
+
+	/* Offset from the sysenter stack to tss.esp0 */
+	DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) -
+		 sizeof(struct tss_struct));
 
 	DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
 }
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 85fdfdcf2..fbb6a591c 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -138,8 +138,7 @@ static char __init *table_lookup_model(struct cpuinfo_x86 *c)
 }
 
 
-
-void __init get_cpu_vendor(struct cpuinfo_x86 *c)
+void __init get_cpu_vendor(struct cpuinfo_x86 *c, int early)
 {
 	char *v = c->x86_vendor_id;
 	int i;
@@ -150,7 +149,8 @@ void __init get_cpu_vendor(struct cpuinfo_x86 *c)
 			    (cpu_devs[i]->c_ident[1] && 
 			     !strcmp(v,cpu_devs[i]->c_ident[1]))) {
 				c->x86_vendor = i;
-				this_cpu = cpu_devs[i];
+				if (!early)
+					this_cpu = cpu_devs[i];
 				break;
 			}
 		}
@@ -194,6 +194,44 @@ int __init have_cpuid_p(void)
 	return flag_is_changeable_p(X86_EFLAGS_ID);
 }
 
+/* Do minimum CPU detection early.
+   Fields really needed: vendor, cpuid_level, family, model, mask, cache alignment.
+   The others are not touched to avoid unwanted side effects. */
+void __init early_cpu_detect(void)
+{
+	struct cpuinfo_x86 *c = &boot_cpu_data;
+
+	c->x86_cache_alignment = 32;
+
+	if (!have_cpuid_p())
+		return;
+
+	/* Get vendor name */
+	cpuid(0x00000000, &c->cpuid_level,
+	      (int *)&c->x86_vendor_id[0],
+	      (int *)&c->x86_vendor_id[8],
+	      (int *)&c->x86_vendor_id[4]);
+
+	get_cpu_vendor(c, 1);
+
+	c->x86 = 4;
+	if (c->cpuid_level >= 0x00000001) {
+		u32 junk, tfms, cap0, misc;
+		cpuid(0x00000001, &tfms, &misc, &junk, &cap0);
+		c->x86 = (tfms >> 8) & 15;
+		c->x86_model = (tfms >> 4) & 15;
+		if (c->x86 == 0xf) {
+			c->x86 += (tfms >> 20) & 0xff;
+			c->x86_model += ((tfms >> 16) & 0xF) << 4;
+		}
+		c->x86_mask = tfms & 15;
+		if (cap0 & (1<<19))
+			c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
+	}
+
+	early_intel_workaround(c);
+}
+
 void __init generic_identify(struct cpuinfo_x86 * c)
 {
 	u32 tfms, xlvl;
@@ -206,7 +244,7 @@ void __init generic_identify(struct cpuinfo_x86 * c)
 		      (int *)&c->x86_vendor_id[8],
 		      (int *)&c->x86_vendor_id[4]);
 		
-		get_cpu_vendor(c);
+		get_cpu_vendor(c, 0);
 		/* Initialize the standard set of capabilities */
 		/* Note that the vendor-specific code below might override */
 	
@@ -384,7 +422,6 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
  
 void __init dodgy_tsc(void)
 {
-	get_cpu_vendor(&boot_cpu_data);
 	if (( boot_cpu_data.x86_vendor == X86_VENDOR_CYRIX ) ||
 	    ( boot_cpu_data.x86_vendor == X86_VENDOR_NSC   ))
 		cpu_devs[X86_VENDOR_CYRIX]->c_init(&boot_cpu_data);
@@ -432,9 +469,11 @@ extern int transmeta_init_cpu(void);
 extern int rise_init_cpu(void);
 extern int nexgen_init_cpu(void);
 extern int umc_init_cpu(void);
+void early_cpu_detect(void);
 
 void __init early_cpu_init(void)
 {
+	early_cpu_detect();
 	intel_cpu_init();
 	cyrix_init_cpu();
 	nsc_init_cpu();
diff --git a/arch/i386/kernel/cpu/cpu.h b/arch/i386/kernel/cpu/cpu.h
index ad3a3371e..9df38d993 100644
--- a/arch/i386/kernel/cpu/cpu.h
+++ b/arch/i386/kernel/cpu/cpu.h
@@ -26,3 +26,6 @@ extern void display_cacheinfo(struct cpuinfo_x86 *c);
 
 extern void generic_identify(struct cpuinfo_x86 * c);
 extern int have_cpuid_p(void);
+
+extern void early_intel_workaround(struct cpuinfo_x86 *c);
+
diff --git a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile
index a075cca61..2dad46e11 100644
--- a/arch/i386/kernel/cpu/cpufreq/Makefile
+++ b/arch/i386/kernel/cpu/cpufreq/Makefile
@@ -2,15 +2,15 @@ obj-$(CONFIG_X86_POWERNOW_K6)	+= powernow-k6.o
 obj-$(CONFIG_X86_POWERNOW_K7)	+= powernow-k7.o
 obj-$(CONFIG_X86_POWERNOW_K8)	+= powernow-k8.o
 obj-$(CONFIG_X86_LONGHAUL)	+= longhaul.o
-obj-$(CONFIG_X86_P4_CLOCKMOD)	+= p4-clockmod.o
 obj-$(CONFIG_ELAN_CPUFREQ)	+= elanfreq.o
 obj-$(CONFIG_X86_LONGRUN)	+= longrun.o  
 obj-$(CONFIG_X86_GX_SUSPMOD)    += gx-suspmod.o
-obj-$(CONFIG_X86_ACPI_CPUFREQ)	+= acpi.o
 obj-$(CONFIG_X86_SPEEDSTEP_ICH)	+= speedstep-ich.o
 obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
 obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
 obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o
+obj-$(CONFIG_X86_ACPI_CPUFREQ)	+= acpi.o
+obj-$(CONFIG_X86_P4_CLOCKMOD)	+= p4-clockmod.o
 
 ifdef CONFIG_X86_ACPI_CPUFREQ
   ifdef CONFIG_ACPI_DEBUG
diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c
index e45ff82dc..3f7caa4ae 100644
--- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c
@@ -77,7 +77,7 @@ static struct cpufreq_frequency_table elanfreq_table[] = {
  *	and have the rest of the chip running with 33 MHz. 
  */
 
-static unsigned int elanfreq_get_cpu_frequency(void)
+static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
 {
         u8 clockspeed_reg;    /* Clock Speed Register */
 	
@@ -121,7 +121,7 @@ static void elanfreq_set_cpu_state (unsigned int state) {
 
 	struct cpufreq_freqs    freqs;
 
-	freqs.old = elanfreq_get_cpu_frequency();
+	freqs.old = elanfreq_get_cpu_frequency(0);
 	freqs.new = elan_multiplier[state].clock;
 	freqs.cpu = 0; /* elanfreq.c is UP only driver */
 	
@@ -209,7 +209,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
 
 	/* max freq */
 	if (!max_freq)
-		max_freq = elanfreq_get_cpu_frequency();
+		max_freq = elanfreq_get_cpu_frequency(0);
 
 	/* table init */
  	for (i=0; (elanfreq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
@@ -220,7 +220,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
 	/* cpuinfo and default policy values */
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
-	policy->cur = elanfreq_get_cpu_frequency();
+	policy->cur = elanfreq_get_cpu_frequency(0);
 
 	result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table);
 	if (result)
@@ -254,6 +254,7 @@ static int elanfreq_cpu_exit(struct cpufreq_policy *policy)
 static int __init elanfreq_setup(char *str)
 {
 	max_freq = simple_strtoul(str, &str, 0);
+	printk(KERN_WARNING "You're using the deprecated elanfreq command line option. Use elanfreq.max_freq instead, please!\n");
 	return 1;
 }
 __setup("elanfreq=", elanfreq_setup);
@@ -267,6 +268,7 @@ static struct freq_attr* elanfreq_attr[] = {
 
 
 static struct cpufreq_driver elanfreq_driver = {
+	.get	 	= elanfreq_get_cpu_frequency,
 	.verify 	= elanfreq_verify,
 	.target 	= elanfreq_target,
 	.init		= elanfreq_cpu_init,
@@ -299,7 +301,7 @@ static void __exit elanfreq_exit(void)
 }
 
 
-MODULE_PARM (max_freq, "i");
+module_param (max_freq, int, 0444);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Robert Schwebel <r.schwebel@pengutronix.de>, Sven Geggus <sven@geggus.net>");
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
index 91ea29efd..fefaf45a0 100644
--- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
@@ -75,7 +75,6 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h> 
-#include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/cpufreq.h>
@@ -125,7 +124,7 @@ static int stock_freq;
 
 /* PCI bus clock - defaults to 30.000 if cpu_khz is not available */
 static int pci_busclk = 0;
-MODULE_PARM(pci_busclk, "i");
+module_param (pci_busclk, int, 0444);
 
 /* maximum duration for which the cpu may be suspended
  * (32us * MAX_DURATION). If no parameter is given, this defaults
@@ -134,7 +133,7 @@ MODULE_PARM(pci_busclk, "i");
  * is suspended -- processing power is just 0.39% of what it used to be,
  * though. 781.25 kHz(!) for a 200 MHz processor -- wow. */
 static int max_duration = 255;
-MODULE_PARM(max_duration, "i");
+module_param (max_duration, int, 0444);
 
 /* For the default policy, we want at least some processing power
  * - let's say 5%. (min = maxfreq / POLICY_MIN_DIV)
@@ -215,7 +214,7 @@ static __init struct pci_dev *gx_detect_chipset(void)
  *
  * Finds out at which efficient frequency the Cyrix MediaGX/NatSemi Geode CPU runs.
  */
-static int gx_get_cpuspeed(void)
+static unsigned int gx_get_cpuspeed(unsigned int cpu)
 {
 	if ((gx_params->pci_suscfg & SUSMOD) == 0) 
 		return stock_freq;
@@ -271,7 +270,7 @@ static void gx_set_cpuspeed(unsigned int khz)
 
 
 	freqs.cpu = 0;
-	freqs.old = gx_get_cpuspeed();
+	freqs.old = gx_get_cpuspeed(0);
 
 	new_khz = gx_validate_speed(khz, &gx_params->on_duration, &gx_params->off_duration);
 
@@ -405,7 +404,7 @@ static int cpufreq_gx_target(struct cpufreq_policy *policy,
 
 static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
 {
-	int maxfreq, curfreq;
+	unsigned int maxfreq, curfreq;
 
 	if (!policy || policy->cpu != 0)
 		return -ENODEV;
@@ -419,7 +418,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
 		maxfreq = 30000 * gx_freq_mult[getCx86(CX86_DIR1) & 0x0f];
 	}
 	stock_freq = maxfreq;
-	curfreq = gx_get_cpuspeed();
+	curfreq = gx_get_cpuspeed(0);
 
 	dprintk("cpu max frequency is %d.\n", maxfreq);
 	dprintk("cpu current frequency is %dkHz.\n",curfreq);
@@ -446,6 +445,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
  *   MediaGX/Geode GX initialize cpufreq driver
  */
 static struct cpufreq_driver gx_suspmod_driver = {
+	.get		= gx_get_cpuspeed,
 	.verify		= cpufreq_gx_verify,
 	.target		= cpufreq_gx_target,
 	.init		= cpufreq_gx_cpu_init,
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index d8ddf3931..57c0377b4 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -18,7 +18,8 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h> 
+#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
@@ -30,25 +31,33 @@
 
 #include "longhaul.h"
 
-#define DEBUG
-
-#ifdef DEBUG
-#define dprintk(msg...) printk(msg)
-#else
-#define dprintk(msg...) do { } while(0)
-#endif
-
 #define PFX "longhaul: "
 
 static unsigned int numscales=16, numvscales;
+static unsigned int fsb;
 static int minvid, maxvid;
+static unsigned int minmult, maxmult;
 static int can_scale_voltage;
 static int vrmrev;
 
-
 /* Module parameters */
 static int dont_scale_voltage;
-static unsigned int fsb;
+static int debug;
+
+static void dprintk(const char *fmt, ...)
+{
+	char s[256];
+	va_list args;
+
+	if (debug == 0)
+		return;
+
+	va_start(args, fmt);
+	vsprintf(s, fmt, args);
+	printk(s);
+	va_end(args);
+}
+
 
 #define __hlt()     __asm__ __volatile__("hlt": : :"memory")
 
@@ -61,7 +70,7 @@ static int longhaul_version;
 static struct cpufreq_frequency_table *longhaul_table;
 
 
-static unsigned int calc_speed (int mult, int fsb)
+static unsigned int calc_speed(int mult, int fsb)
 {
 	int khz;
 	khz = (mult/10)*fsb;
@@ -72,13 +81,13 @@ static unsigned int calc_speed (int mult, int fsb)
 }
 
 
-static int longhaul_get_cpu_mult (void)
+static int longhaul_get_cpu_mult(void)
 {
 	unsigned long invalue=0,lo, hi;
 
 	rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi);
 	invalue = (lo & (1<<22|1<<23|1<<24|1<<25)) >>22;
-	if (longhaul_version==2) {
+	if (longhaul_version==2 || longhaul_version==3) {
 		if (lo & (1<<27))
 			invalue+=16;
 	}
@@ -93,7 +102,7 @@ static int longhaul_get_cpu_mult (void)
  * Sets a new clock ratio, and -if applicable- a new Front Side Bus
  */
 
-static void longhaul_setstate (unsigned int clock_ratio_index)
+static void longhaul_setstate(unsigned int clock_ratio_index)
 {
 	int speed, mult;
 	struct cpufreq_freqs freqs;
@@ -114,8 +123,7 @@ static void longhaul_setstate (unsigned int clock_ratio_index)
 
 	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
-	dprintk (KERN_INFO PFX "FSB:%d Mult:%d.%dx\n", fsb,
-				mult/10, mult%10);
+	dprintk (KERN_INFO PFX "FSB:%d Mult:%d.%dx\n", fsb, mult/10, mult%10);
 
 	switch (longhaul_version) {
 	case 1:
@@ -158,6 +166,22 @@ static void longhaul_setstate (unsigned int clock_ratio_index)
 		longhaul.bits.RevisionKey = 3;
 		wrmsrl (MSR_VIA_LONGHAUL, longhaul.val);
 		break;
+	case 3:
+		rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
+		longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
+		longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
+		longhaul.bits.EnableSoftBusRatio = 1;
+
+		longhaul.bits.RevisionKey = 0x0;
+
+		wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
+		__hlt();
+
+		rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
+		longhaul.bits.EnableSoftBusRatio = 0;
+		longhaul.bits.RevisionKey = 0xf;
+		wrmsrl (MSR_VIA_LONGHAUL, longhaul.val);
+		break;
 	}
 
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
@@ -174,7 +198,7 @@ static void longhaul_setstate (unsigned int clock_ratio_index)
 
 #define ROUNDING	0xf
 
-static int _guess (int guess, int maxmult)
+static int _guess(int guess)
 {
 	int target;
 
@@ -187,7 +211,7 @@ static int _guess (int guess, int maxmult)
 }
 
 
-static int guess_fsb(int maxmult)
+static int guess_fsb(void)
 {
 	int speed = (cpu_khz/1000);
 	int i;
@@ -197,25 +221,25 @@ static int guess_fsb(int maxmult)
 	speed &= ~ROUNDING;
 
 	for (i=0; i<3; i++) {
-		if (_guess(speeds[i],maxmult) == speed)
+		if (_guess(speeds[i]) == speed)
 			return speeds[i];
 	}
 	return 0;
 }
 
 
-static int __init longhaul_get_ranges (void)
+static int __init longhaul_get_ranges(void)
 {
 	struct cpuinfo_x86 *c = cpu_data;
 	unsigned long invalue;
-	unsigned int minmult=0, maxmult=0;
 	unsigned int multipliers[32]= {
 		50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65,
 		-1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 };
 	unsigned int j, k = 0;
 	union msr_longhaul longhaul;
 	unsigned long lo, hi;
-	unsigned int eblcr_fsb_table[] = { 66, 133, 100, -1 };
+	unsigned int eblcr_fsb_table_v1[] = { 66, 133, 100, -1 };
+	unsigned int eblcr_fsb_table_v2[] = { 133, 100, -1, 66 };
 
 	switch (longhaul_version) {
 	case 1:
@@ -226,16 +250,14 @@ static int __init longhaul_get_ranges (void)
 		rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi);
 		invalue = (lo & (1<<18|1<<19)) >>18;
 		if (c->x86_model==6)
-			fsb = eblcr_fsb_table[invalue];
+			fsb = eblcr_fsb_table_v1[invalue];
 		else
-			fsb = guess_fsb(maxmult);
+			fsb = guess_fsb();
 		break;
 
 	case 2:
 		rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
 
-		//TODO: Nehemiah may have borken MaxMHzBR.
-		// need to extrapolate from FSB.
 		invalue = longhaul.bits.MaxMHzBR;
 		if (longhaul.bits.MaxMHzBR4)
 			invalue += 16;
@@ -247,21 +269,38 @@ static int __init longhaul_get_ranges (void)
 		else
 			minmult = multipliers[invalue];
 
-		switch (longhaul.bits.MaxMHzFSB) {
-		case 0x0:	fsb=133;
-				break;
-		case 0x1:	fsb=100;
-				break;
-		case 0x2:	printk (KERN_INFO PFX "Invalid (reserved) FSB!\n");
-			return -EINVAL;
-		case 0x3:	fsb=66;
-				break;
-		}
+		fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
+		break;
+
+	case 3:
+		rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
+
+		/*
+		 * TODO: This code works, but raises a lot of questions.
+		 * - Some Nehemiah's seem to have broken Min/MaxMHzBR's.
+		 *   We get around this by using a hardcoded multiplier of 5.0x
+		 *   for the minimimum speed, and the speed we booted up at for the max.
+		 *   This is done in longhaul_get_cpu_mult() by reading the EBLCR register.
+		 * - According to some VIA documentation EBLCR is only
+		 *   in pre-Nehemiah C3s. How this still works is a mystery.
+		 *   We're possibly using something undocumented and unsupported,
+		 *   But it works, so we don't grumble.
+		 */
+		minmult=50;
+		maxmult=longhaul_get_cpu_mult();
+
+		fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
 		break;
 	}
 
 	dprintk (KERN_INFO PFX "MinMult=%d.%dx MaxMult=%d.%dx\n",
 		 minmult/10, minmult%10, maxmult/10, maxmult%10);
+
+	if (fsb == -1) {
+		printk (KERN_INFO PFX "Invalid (reserved) FSB!\n");
+		return -EINVAL;
+	}
+
 	highest_speed = calc_speed (maxmult, fsb);
 	lowest_speed = calc_speed (minmult,fsb);
 	dprintk (KERN_INFO PFX "FSB: %dMHz Lowestspeed=%dMHz Highestspeed=%dMHz\n",
@@ -363,24 +402,31 @@ static int longhaul_verify(struct cpufreq_policy *policy)
 }
 
 
-static int longhaul_target (struct cpufreq_policy *policy,
+static int longhaul_target(struct cpufreq_policy *policy,
 			    unsigned int target_freq,
 			    unsigned int relation)
 {
 	unsigned int table_index = 0;
- 	unsigned int new_clock_ratio = 0;
+	unsigned int new_clock_ratio = 0;
 
 	if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, relation, &table_index))
 		return -EINVAL;
 
 	new_clock_ratio = longhaul_table[table_index].index & 0xFF;
- 
+
 	longhaul_setstate(new_clock_ratio);
 
 	return 0;
 }
 
-static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
+static unsigned int longhaul_get(unsigned int cpu)
+{
+	if (cpu)
+		return 0;
+	return (calc_speed (longhaul_get_cpu_mult(), fsb));
+}
+
+static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
 {
 	struct cpuinfo_x86 *c = cpu_data;
 	char *cpuname=NULL;
@@ -423,11 +469,25 @@ static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
 		break;
 
 	case 9:
-		cpuname = "C3 'Nehemiah' [C5N]";
-		longhaul_version=2;
+		longhaul_version=3;
 		numscales=32;
-		memcpy (clock_ratio, nehemiah_clock_ratio, sizeof(nehemiah_clock_ratio));
-		memcpy (eblcr_table, nehemiah_eblcr, sizeof(nehemiah_eblcr));
+		switch (c->x86_mask) {
+		case 0 ... 1:
+			cpuname = "C3 'Nehemiah A' [C5N]";
+			memcpy (clock_ratio, nehemiah_a_clock_ratio, sizeof(nehemiah_a_clock_ratio));
+			memcpy (eblcr_table, nehemiah_a_eblcr, sizeof(nehemiah_a_eblcr));
+			break;
+		case 2 ... 4:
+			cpuname = "C3 'Nehemiah B' [C5N]";
+			memcpy (clock_ratio, nehemiah_b_clock_ratio, sizeof(nehemiah_b_clock_ratio));
+			memcpy (eblcr_table, nehemiah_b_eblcr, sizeof(nehemiah_b_eblcr));
+			break;
+		case 5 ... 15:
+			cpuname = "C3 'Nehemiah C' [C5N]";
+			memcpy (clock_ratio, nehemiah_c_clock_ratio, sizeof(nehemiah_c_clock_ratio));
+			memcpy (eblcr_table, nehemiah_c_eblcr, sizeof(nehemiah_c_eblcr));
+			break;
+		}
 		break;
 
 	default:
@@ -442,11 +502,11 @@ static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
 	if (ret != 0)
 		return ret;
 
- 	if ((longhaul_version==2) && (dont_scale_voltage==0))
+	if ((longhaul_version==2) && (dont_scale_voltage==0))
 		longhaul_setup_voltagescaling();
 
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 	policy->cur = calc_speed (longhaul_get_cpu_mult(), fsb);
 
 	ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
@@ -458,7 +518,7 @@ static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
 	return 0;
 }
 
-static int __exit longhaul_cpu_exit(struct cpufreq_policy *policy)
+static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)
 {
 	cpufreq_frequency_table_put_attr(policy->cpu);
 	return 0;
@@ -470,16 +530,17 @@ static struct freq_attr* longhaul_attr[] = {
 };
 
 static struct cpufreq_driver longhaul_driver = {
-	.verify 	= longhaul_verify,
-	.target 	= longhaul_target,
-	.init		= longhaul_cpu_init,
-	.exit		= longhaul_cpu_exit,
-	.name		= "longhaul",
-	.owner		= THIS_MODULE,
-	.attr		= longhaul_attr,
+	.verify	= longhaul_verify,
+	.target	= longhaul_target,
+	.get	= longhaul_get,
+	.init	= longhaul_cpu_init,
+	.exit	= __devexit_p(longhaul_cpu_exit),
+	.name	= "longhaul",
+	.owner	= THIS_MODULE,
+	.attr	= longhaul_attr,
 };
 
-static int __init longhaul_init (void)
+static int __init longhaul_init(void)
 {
 	struct cpuinfo_x86 *c = cpu_data;
 
@@ -487,12 +548,8 @@ static int __init longhaul_init (void)
 		return -ENODEV;
 
 	switch (c->x86_model) {
-	case 6 ... 8:
+	case 6 ... 9:
 		return cpufreq_register_driver(&longhaul_driver);
-	case 9:
-		printk (KERN_INFO PFX "Nehemiah unsupported: Waiting on working silicon "
-						"from VIA before this is usable.\n");
-		break;
 	default:
 		printk (KERN_INFO PFX "Unknown VIA CPU. Contact davej@codemonkey.org.uk\n");
 	}
@@ -500,13 +557,26 @@ static int __init longhaul_init (void)
 	return -ENODEV;
 }
 
-static void __exit longhaul_exit (void)
+static void __exit longhaul_exit(void)
 {
+	int i=0;
+	unsigned int new_clock_ratio;
+
+	while (clock_ratio[i] != maxmult)
+		i++;
+
+	new_clock_ratio = longhaul_table[i].index & 0xFF;
+	longhaul_setstate(new_clock_ratio);
+
 	cpufreq_unregister_driver(&longhaul_driver);
 	kfree(longhaul_table);
 }
 
-MODULE_PARM (dont_scale_voltage, "i");
+module_param (dont_scale_voltage, int, 0644);
+MODULE_PARM_DESC(dont_scale_voltage, "Don't scale voltage of processor");
+
+module_param (debug, int, 0644);
+MODULE_PARM_DESC(debug, "Dump debugging information.");
 
 MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
 MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/i386/kernel/cpu/cpufreq/longhaul.h
index a14e8230c..2a495c162 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.h
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.h
@@ -234,14 +234,15 @@ static int __initdata ezrat_eblcr[32] = {
 
 /*
  * VIA C3 Nehemiah */
-static int __initdata nehemiah_clock_ratio[32] = {
+ 
+static int __initdata nehemiah_a_clock_ratio[32] = {
 	100, /* 0000 -> 10.0x */
 	160, /* 0001 -> 16.0x */
-	-1,  /* 0010 -> RESERVED */
+	-1,  /* 0010 ->  RESERVED */
 	90,  /* 0011 ->  9.0x */
 	95,  /* 0100 ->  9.5x */
-	-1,  /* 0101 -> RESERVED */
-	-1,  /* 0110 -> RESERVED */
+	-1,  /* 0101 ->  RESERVED */
+	-1,  /* 0110 ->  RESERVED */
 	55,  /* 0111 ->  5.5x */
 	60,  /* 1000 ->  6.0x */
 	70,  /* 1001 ->  7.0x */
@@ -250,8 +251,42 @@ static int __initdata nehemiah_clock_ratio[32] = {
 	65,  /* 1100 ->  6.5x */
 	75,  /* 1101 ->  7.5x */
 	85,  /* 1110 ->  8.5x */
-	120, /* 1111 ->  12.0x */
+	120, /* 1111 -> 12.0x */
+	100, /* 0000 -> 10.0x */
+	-1,  /* 0001 -> RESERVED */
+	120, /* 0010 -> 12.0x */
+	90,  /* 0011 ->  9.0x */
+	105, /* 0100 -> 10.5x */
+	115, /* 0101 -> 11.5x */
+	125, /* 0110 -> 12.5x */
+	135, /* 0111 -> 13.5x */
+	140, /* 1000 -> 14.0x */
+	150, /* 1001 -> 15.0x */
+	160, /* 1010 -> 16.0x */
+	130, /* 1011 -> 13.0x */
+	145, /* 1100 -> 14.5x */
+	155, /* 1101 -> 15.5x */
+	-1,  /* 1110 -> RESERVED (13.0x) */
+	120, /* 1111 -> 12.0x */
+};
 
+static int __initdata  nehemiah_b_clock_ratio[32] = {
+	100, /* 0000 -> 10.0x */
+	160, /* 0001 -> 16.0x */
+	-1,  /* 0010 ->  RESERVED */
+	90,  /* 0011 ->  9.0x */
+	95,  /* 0100 ->  9.5x */
+	-1,  /* 0101 ->  RESERVED */
+	-1,  /* 0110 ->  RESERVED */
+	55,  /* 0111 ->  5.5x */
+	60,  /* 1000 ->  6.0x */
+	70,  /* 1001 ->  7.0x */
+	80,  /* 1010 ->  8.0x */
+	50,  /* 1011 ->  5.0x */
+	65,  /* 1100 ->  6.5x */
+	75,  /* 1101 ->  7.5x */
+	85,  /* 1110 ->  8.5x */
+	120, /* 1111 -> 12.0x */
 	100, /* 0000 -> 10.0x */
 	110, /* 0001 -> 11.0x */
 	120, /* 0010 -> 12.0x */
@@ -266,18 +301,88 @@ static int __initdata nehemiah_clock_ratio[32] = {
 	130, /* 1011 -> 13.0x */
 	145, /* 1100 -> 14.5x */
 	155, /* 1101 -> 15.5x */
-	-1,  /* 1110 -> RESERVED */
+	-1,  /* 1110 -> RESERVED (13.0x) */
 	120, /* 1111 -> 12.0x */
 };
 
-static int __initdata nehemiah_eblcr[32] = {
+static int __initdata  nehemiah_c_clock_ratio[32] = {
+	100, /* 0000 -> 10.0x */
+	160, /* 0001 -> 16.0x */
+	40,  /* 0010 ->  RESERVED */
+	90,  /* 0011 ->  9.0x */
+	95,  /* 0100 ->  9.5x */
+	-1,  /* 0101 ->  RESERVED */
+	45,  /* 0110 ->  RESERVED */
+	55,  /* 0111 ->  5.5x */
+	60,  /* 1000 ->  6.0x */
+	70,  /* 1001 ->  7.0x */
+	80,  /* 1010 ->  8.0x */
+	50,  /* 1011 ->  5.0x */
+	65,  /* 1100 ->  6.5x */
+	75,  /* 1101 ->  7.5x */
+	85,  /* 1110 ->  8.5x */
+	120, /* 1111 -> 12.0x */
+	100, /* 0000 -> 10.0x */
+	110, /* 0001 -> 11.0x */
+	120, /* 0010 -> 12.0x */
+	90,  /* 0011 ->  9.0x */
+	105, /* 0100 -> 10.5x */
+	115, /* 0101 -> 11.5x */
+	125, /* 0110 -> 12.5x */
+	135, /* 0111 -> 13.5x */
+	140, /* 1000 -> 14.0x */
+	150, /* 1001 -> 15.0x */
+	160, /* 1010 -> 16.0x */
+	130, /* 1011 -> 13.0x */
+	145, /* 1100 -> 14.5x */
+	155, /* 1101 -> 15.5x */
+	-1,  /* 1110 -> RESERVED (13.0x) */
+	120, /* 1111 -> 12.0x */
+};
+
+static int __initdata nehemiah_a_eblcr[32] = {
 	50,  /* 0000 ->  5.0x */
 	160, /* 0001 -> 16.0x */
-	-1,  /* 0010 -> RESERVED */
+	-1,  /* 0010 ->  RESERVED */
 	100, /* 0011 -> 10.0x */
 	55,  /* 0100 ->  5.5x */
-	-1,  /* 0101 -> RESERVED */
-	-1,  /* 0110 -> RESERVED */
+	-1,  /* 0101 ->  RESERVED */
+	-1,  /* 0110 ->  RESERVED */
+	95,  /* 0111 ->  9.5x */
+	90,  /* 1000 ->  9.0x */
+	70,  /* 1001 ->  7.0x */
+	80,  /* 1010 ->  8.0x */
+	60,  /* 1011 ->  6.0x */
+	120, /* 1100 -> 12.0x */
+	75,  /* 1101 ->  7.5x */
+	85,  /* 1110 ->  8.5x */
+	65,  /* 1111 ->  6.5x */
+	90,  /* 0000 ->  9.0x */
+	-1,  /* 0001 -> RESERVED */
+	120, /* 0010 -> 12.0x */
+	100, /* 0011 -> 10.0x */
+	135, /* 0100 -> 13.5x */
+	115, /* 0101 -> 11.5x */
+	125, /* 0110 -> 12.5x */
+	105, /* 0111 -> 10.5x */
+	130, /* 1000 -> 13.0x */
+	150, /* 1001 -> 15.0x */
+	160, /* 1010 -> 16.0x */
+	140, /* 1011 -> 14.0x */
+	120, /* 1100 -> 12.0x */
+	155, /* 1101 -> 15.5x */
+	-1,  /* 1110 -> RESERVED (13.0x) */
+	145 /* 1111 -> 14.5x */
+   /* end of table  */
+};
+static int __initdata nehemiah_b_eblcr[32] = {
+	50,  /* 0000 ->  5.0x */
+	160, /* 0001 -> 16.0x */
+	-1,  /* 0010 ->  RESERVED */
+	100, /* 0011 -> 10.0x */
+	55,  /* 0100 ->  5.5x */
+	-1,  /* 0101 ->  RESERVED */
+	-1,  /* 0110 ->  RESERVED */
 	95,  /* 0111 ->  9.5x */
 	90,  /* 1000 ->  9.0x */
 	70,  /* 1001 ->  7.0x */
@@ -287,7 +392,6 @@ static int __initdata nehemiah_eblcr[32] = {
 	75,  /* 1101 ->  7.5x */
 	85,  /* 1110 ->  8.5x */
 	65,  /* 1111 ->  6.5x */
-
 	90,  /* 0000 ->  9.0x */
 	110, /* 0001 -> 11.0x */
 	120, /* 0010 -> 12.0x */
@@ -302,9 +406,46 @@ static int __initdata nehemiah_eblcr[32] = {
 	140, /* 1011 -> 14.0x */
 	120, /* 1100 -> 12.0x */
 	155, /* 1101 -> 15.5x */
-	-1,  /* 1110 -> RESERVED */
-	-1,  /* 1111 -> RESERVED */
+	-1,  /* 1110 -> RESERVED (13.0x) */
+	145 /* 1111 -> 14.5x */
+	   /* end of table  */
 };
+static int __initdata nehemiah_c_eblcr[32] = {
+	50,  /* 0000 ->  5.0x */
+	160, /* 0001 -> 16.0x */
+	40,  /* 0010 ->  RESERVED */
+	100, /* 0011 -> 10.0x */
+	55,  /* 0100 ->  5.5x */
+	-1,  /* 0101 ->  RESERVED */
+	45,  /* 0110 ->  RESERVED */
+	95,  /* 0111 ->  9.5x */
+	90,  /* 1000 ->  9.0x */
+	70,  /* 1001 ->  7.0x */
+	80,  /* 1010 ->  8.0x */
+	60,  /* 1011 ->  6.0x */
+	120, /* 1100 -> 12.0x */
+	75,  /* 1101 ->  7.5x */
+	85,  /* 1110 ->  8.5x */
+	65,  /* 1111 ->  6.5x */
+	90,  /* 0000 ->  9.0x */
+	110, /* 0001 -> 11.0x */
+	120, /* 0010 -> 12.0x */
+	100, /* 0011 -> 10.0x */
+	135, /* 0100 -> 13.5x */
+	115, /* 0101 -> 11.5x */
+	125, /* 0110 -> 12.5x */
+	105, /* 0111 -> 10.5x */
+	130, /* 1000 -> 13.0x */
+	150, /* 1001 -> 15.0x */
+	160, /* 1010 -> 16.0x */
+	140, /* 1011 -> 14.0x */
+	120, /* 1100 -> 12.0x */
+	155, /* 1101 -> 15.5x */
+	-1,  /* 1110 -> RESERVED (13.0x) */
+	145 /* 1111 -> 14.5x */
+	  /* end of table  */
+};
+
 /* 
  * Voltage scales. Div/Mod by 1000 to get actual voltage.
  * Which scale to use depends on the VRM type in use.
diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c
index e51bb0304..c04c99bba 100644
--- a/arch/i386/kernel/cpu/cpufreq/longrun.c
+++ b/arch/i386/kernel/cpu/cpufreq/longrun.c
@@ -46,11 +46,16 @@ static void __init longrun_get_policy(struct cpufreq_policy *policy)
 	rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
 	msr_lo &= 0x0000007F;
 	msr_hi &= 0x0000007F;
-
-	policy->min = longrun_low_freq + msr_lo * 
-		((longrun_high_freq - longrun_low_freq) / 100);
-	policy->max = longrun_low_freq + msr_hi * 
-		((longrun_high_freq - longrun_low_freq) / 100);
+	
+	if ( longrun_high_freq <= longrun_low_freq ) {
+		/* Assume degenerate Longrun table */
+		policy->min = policy->max = longrun_high_freq;
+	} else {
+		policy->min = longrun_low_freq + msr_lo * 
+			((longrun_high_freq - longrun_low_freq) / 100);
+		policy->max = longrun_low_freq + msr_hi * 
+			((longrun_high_freq - longrun_low_freq) / 100);
+	}
 	policy->cpu = 0;
 }
 
@@ -70,10 +75,15 @@ static int longrun_set_policy(struct cpufreq_policy *policy)
 	if (!policy)
 		return -EINVAL;
 
-	pctg_lo = (policy->min - longrun_low_freq) / 
-		((longrun_high_freq - longrun_low_freq) / 100);
-	pctg_hi = (policy->max - longrun_low_freq) / 
-		((longrun_high_freq - longrun_low_freq) / 100);
+	if ( longrun_high_freq <= longrun_low_freq ) {
+		/* Assume degenerate Longrun table */
+		pctg_lo = pctg_hi = 100;
+	} else {
+		pctg_lo = (policy->min - longrun_low_freq) / 
+			((longrun_high_freq - longrun_low_freq) / 100);
+		pctg_hi = (policy->max - longrun_low_freq) / 
+			((longrun_high_freq - longrun_low_freq) / 100);
+	}
 
 	if (pctg_hi > 100)
 		pctg_hi = 100;
@@ -128,6 +138,17 @@ static int longrun_verify_policy(struct cpufreq_policy *policy)
 	return 0;
 }
 
+static unsigned int longrun_get(unsigned int cpu)
+{
+	u32 eax, ebx, ecx, edx;
+
+	if (cpu)
+		return 0;
+
+	cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
+
+	return (eax * 1000);
+}
 
 /**
  * longrun_determine_freqs - determines the lowest and highest possible core frequency
@@ -250,8 +271,10 @@ static int __init longrun_cpu_init(struct cpufreq_policy *policy)
 
 
 static struct cpufreq_driver longrun_driver = {
+	.flags		= CPUFREQ_CONST_LOOPS,
 	.verify 	= longrun_verify_policy,
 	.setpolicy 	= longrun_set_policy,
+	.get		= longrun_get,
 	.init		= longrun_cpu_init,
 	.name		= "longrun",
 	.owner		= THIS_MODULE,
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
index 28d5e2243..fa01a95bb 100644
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
@@ -27,7 +27,7 @@
 #include <linux/smp.h>
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
-#include <linux/sched.h>
+#include <linux/cpumask.h>
 
 #include <asm/processor.h> 
 #include <asm/msr.h>
@@ -35,7 +35,7 @@
 
 #include "speedstep-lib.h"
 
-#define PFX	"cpufreq: "
+#define PFX	"p4-clockmod: "
 
 /*
  * Duty Cycle (3bits), note DC_DISABLE is not specified in
@@ -51,59 +51,16 @@ enum {
 
 static int has_N44_O17_errata[NR_CPUS];
 static unsigned int stock_freq;
+static struct cpufreq_driver p4clockmod_driver;
+static unsigned int cpufreq_p4_get(unsigned int cpu);
 
 static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
 {
 	u32 l, h;
-	cpumask_t cpus_allowed, affected_cpu_map;
-	struct cpufreq_freqs freqs;
-	int hyperthreading = 0;
-	int sibling = 0;
 
-	if (!cpu_online(cpu) || (newstate > DC_DISABLE) || 
-		(newstate == DC_RESV))
+	if (!cpu_online(cpu) || (newstate > DC_DISABLE) || (newstate == DC_RESV))
 		return -EINVAL;
 
-	/* switch to physical CPU where state is to be changed*/
-	cpus_allowed = current->cpus_allowed;
-
-	/* only run on CPU to be set, or on its sibling */
-       affected_cpu_map = cpumask_of_cpu(cpu);
-#ifdef CONFIG_X86_HT
-	hyperthreading = ((cpu_has_ht) && (smp_num_siblings == 2));
-	if (hyperthreading) {
-		sibling = cpu_sibling_map[cpu];
-                cpu_set(sibling, affected_cpu_map);
-	}
-#endif
-	set_cpus_allowed(current, affected_cpu_map);
-        BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map));
-
-	/* get current state */
-	rdmsr(MSR_IA32_THERM_CONTROL, l, h);
-	if (l & 0x10) {
-		l = l >> 1;
-		l &= 0x7;
-	} else
-		l = DC_DISABLE;
-	
-	if (l == newstate) {
-		set_cpus_allowed(current, cpus_allowed);
-		return 0;
-	} else if (l == DC_RESV) {
-		printk(KERN_ERR PFX "BIG FAT WARNING: currently in invalid setting\n");
-	}
-
-	/* notifiers */
-	freqs.old = stock_freq * l / 8;
-	freqs.new = stock_freq * newstate / 8;
-	freqs.cpu = cpu;
-	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-	if (hyperthreading) {
-		freqs.cpu = sibling;
-		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-	}
-
 	rdmsr(MSR_IA32_THERM_STATUS, l, h);
 #if 0
 	if (l & 0x01)
@@ -129,15 +86,6 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
 		wrmsr(MSR_IA32_THERM_CONTROL, l, h);
 	}
 
-	set_cpus_allowed(current, cpus_allowed);
-
-	/* notifiers */
-	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-	if (hyperthreading) {
-		freqs.cpu = cpu;
-		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-	}
-
 	return 0;
 }
 
@@ -161,11 +109,53 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
 			     unsigned int relation)
 {
 	unsigned int    newstate = DC_RESV;
+	struct cpufreq_freqs freqs;
+	cpumask_t cpus_allowed, affected_cpu_map;
+	int i;
 
 	if (cpufreq_frequency_table_target(policy, &p4clockmod_table[0], target_freq, relation, &newstate))
 		return -EINVAL;
 
-	cpufreq_p4_setdc(policy->cpu, p4clockmod_table[newstate].index);
+	freqs.old = cpufreq_p4_get(policy->cpu);
+	freqs.new = stock_freq * p4clockmod_table[newstate].index / 8;
+
+	if (freqs.new == freqs.old)
+		return 0;
+
+	/* switch to physical CPU where state is to be changed*/
+	cpus_allowed = current->cpus_allowed;
+
+	/* only run on CPU to be set, or on its sibling */
+#ifdef CONFIG_SMP
+	affected_cpu_map = cpu_sibling_map[policy->cpu];
+#else
+	affected_cpu_map = cpumask_of_cpu(policy->cpu);
+#endif
+
+	/* notifiers */
+	for_each_cpu_mask(i, affected_cpu_map) {
+		freqs.cpu = i;
+		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+	}
+
+	/* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software
+	 * Developer's Manual, Volume 3 
+	 */
+	for_each_cpu_mask(i, affected_cpu_map) {
+		cpumask_t this_cpu = cpumask_of_cpu(i);
+
+		set_cpus_allowed(current, this_cpu);
+		BUG_ON(smp_processor_id() != i);
+
+		cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);
+	}
+	set_cpus_allowed(current, cpus_allowed);
+
+	/* notifiers */
+	for_each_cpu_mask(i, affected_cpu_map) {
+		freqs.cpu = i;
+		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+	}
 
 	return 0;
 }
@@ -180,11 +170,23 @@ static int cpufreq_p4_verify(struct cpufreq_policy *policy)
 static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
 {
 	if ((c->x86 == 0x06) && (c->x86_model == 0x09)) {
-		/* Pentium M */
+		/* Pentium M (Banias) */
+		printk(KERN_WARNING PFX "Warning: Pentium M detected. "
+		       "The speedstep_centrino module offers voltage scaling"
+		       " in addition of frequency scaling. You should use "
+		       "that instead of p4-clockmod, if possible.\n");
+		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);
+	}
+
+	if ((c->x86 == 0x06) && (c->x86_model == 0x13)) {
+		/* Pentium M (Dothan) */
 		printk(KERN_WARNING PFX "Warning: Pentium M detected. "
 		       "The speedstep_centrino module offers voltage scaling"
 		       " in addition of frequency scaling. You should use "
 		       "that instead of p4-clockmod, if possible.\n");
+		/* on P-4s, the TSC runs with constant frequency independent wether
+		 * throttling is active or not. */
+		p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
 		return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);
 	}
 
@@ -193,6 +195,10 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
 		return 0;
 	}
 
+	/* on P-4s, the TSC runs with constant frequency independent wether
+	 * throttling is active or not. */
+	p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
+
 	if (speedstep_detect_processor() == SPEEDSTEP_PROCESSOR_P4M) {
 		printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. "
 		       "The speedstep-ich or acpi cpufreq modules offer "
@@ -252,6 +258,33 @@ static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy)
 	return 0;
 }
 
+static unsigned int cpufreq_p4_get(unsigned int cpu)
+{
+	cpumask_t cpus_allowed, affected_cpu_map;
+	u32 l, h;
+
+	cpus_allowed = current->cpus_allowed;
+        affected_cpu_map = cpumask_of_cpu(cpu);
+
+	set_cpus_allowed(current, affected_cpu_map);
+        BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map));
+
+	rdmsr(MSR_IA32_THERM_CONTROL, l, h);
+
+	set_cpus_allowed(current, cpus_allowed);
+
+	if (l & 0x10) {
+		l = l >> 1;
+		l &= 0x7;
+	} else
+		l = DC_DISABLE;
+
+	if (l != DC_DISABLE)
+		return (stock_freq * l / 8);
+
+	return stock_freq;
+}
+
 static struct freq_attr* p4clockmod_attr[] = {
 	&cpufreq_freq_attr_scaling_available_freqs,
 	NULL,
@@ -262,6 +295,7 @@ static struct cpufreq_driver p4clockmod_driver = {
 	.target		= cpufreq_p4_target,
 	.init		= cpufreq_p4_cpu_init,
 	.exit		= cpufreq_p4_cpu_exit,
+	.get		= cpufreq_p4_get,
 	.name		= "p4-clockmod",
 	.owner		= THIS_MODULE,
 	.attr		= p4clockmod_attr,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
index 80153fb05..222f8cfe3 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
@@ -185,6 +185,11 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
  	return 0;
 }
 
+static unsigned int powernow_k6_get(unsigned int cpu)
+{
+	return busfreq * powernow_k6_get_cpu_multiplier();
+}
+
 static struct freq_attr* powernow_k6_attr[] = {
 	&cpufreq_freq_attr_scaling_available_freqs,
 	NULL,
@@ -195,6 +200,7 @@ static struct cpufreq_driver powernow_k6_driver = {
 	.target 	= powernow_k6_target,
 	.init		= powernow_k6_cpu_init,
 	.exit		= powernow_k6_cpu_exit,
+	.get		= powernow_k6_get,
 	.name		= "powernow-k6",
 	.owner		= THIS_MODULE,
 	.attr		= powernow_k6_attr,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 65246256f..7aefc6764 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -16,7 +16,7 @@
 
 #include <linux/config.h>
 #include <linux/kernel.h>
-#include <linux/module.h> 
+#include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/cpufreq.h>
@@ -28,7 +28,7 @@
 #include <asm/io.h>
 #include <asm/system.h>
 
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 #include <linux/acpi.h>
 #include <acpi/processor.h>
 #endif
@@ -63,7 +63,7 @@ struct pst_s {
 	u8 numpstates;
 };
 
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 union powernow_acpi_control_t {
 	struct {
 		unsigned long fid:5,
@@ -86,7 +86,7 @@ static int mobile_vid_table[32] = {
 /* divide by 10 to get FID. */
 static int fid_codes[32] = {
     110, 115, 120, 125, 50, 55, 60, 65,
-    70, 75, 80, 85, 90, 95, 100, 105, 
+    70, 75, 80, 85, 90, 95, 100, 105,
     30, 190, 40, 200, 130, 135, 140, 210,
     150, 225, 160, 165, 170, 180, -1, -1,
 };
@@ -95,7 +95,7 @@ static int fid_codes[32] = {
  * configuration purpose.
  */
 
-static int powernow_acpi_force;
+static int acpi_force;
 
 static struct cpufreq_frequency_table *powernow_table;
 
@@ -144,6 +144,11 @@ static int check_powernow(void)
 	}
 
 	cpuid(0x80000007, &eax, &ebx, &ecx, &edx);
+
+	/* Check we can actually do something before we say anything.*/
+	if (!(edx & (1 << 1 | 1 << 2)))
+		return 0;
+
 	printk (KERN_INFO PFX "PowerNOW! Technology present. Can scale: ");
 
 	if (edx & 1 << 1) {
@@ -159,11 +164,6 @@ static int check_powernow(void)
 		can_scale_vid=1;
 	}
 
-	if (!(edx & (1 << 1 | 1 << 2))) {
-		printk ("nothing.\n");
-		return 0;
-	}
-
 	printk (".\n");
 	return 1;
 }
@@ -293,7 +293,7 @@ static void change_speed (unsigned int index)
 }
 
 
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 
 struct acpi_processor_performance *acpi_processor_perf;
 
@@ -540,6 +540,20 @@ static int __init fixup_sgtc(void)
 	return sgtc;
 }
 
+static unsigned int powernow_get(unsigned int cpu)
+{
+	union msr_fidvidstatus fidvidstatus;
+	unsigned int cfid;
+
+	if (cpu)
+		return 0;
+	rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
+	cfid = fidvidstatus.bits.CFID;
+
+	return (fsb * fid_codes[cfid] / 10);
+}
+
+
 static int __init powernow_cpu_init (struct cpufreq_policy *policy)
 {
 	union msr_fidvidstatus fidvidstatus;
@@ -558,7 +572,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
 	}
 	dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
 
-	if ((dmi_broken & BROKEN_CPUFREQ) || powernow_acpi_force) {
+	if ((dmi_broken & BROKEN_CPUFREQ) || acpi_force) {
 		printk (KERN_INFO PFX "PSB/PST known to be broken.  Trying ACPI instead\n");
 		result = powernow_acpi_init();
 	} else {
@@ -590,7 +604,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
 
 	policy->cpuinfo.transition_latency = 20 * latency / fsb;
 
-	policy->cur = maximum_speed;
+	policy->cur = powernow_get(0);
 
 	cpufreq_frequency_table_get_attr(powernow_table, policy->cpu);
 
@@ -610,6 +624,7 @@ static struct freq_attr* powernow_table_attr[] = {
 static struct cpufreq_driver powernow_driver = {
 	.verify 	= powernow_verify,
 	.target 	= powernow_target,
+	.get		= powernow_get,	
 	.init		= powernow_cpu_init,
 	.exit		= powernow_cpu_exit,
 	.name		= "powernow-k7",
@@ -627,7 +642,7 @@ static int __init powernow_init (void)
 
 static void __exit powernow_exit (void)
 {
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 	if (acpi_processor_perf) {
 		acpi_processor_unregister_performance(acpi_processor_perf, 0);
 		kfree(acpi_processor_perf);
@@ -638,8 +653,7 @@ static void __exit powernow_exit (void)
 		kfree(powernow_table);
 }
 
-module_param(powernow_acpi_force,  int, 0444);
-
+module_param(acpi_force,  int, 0444);
 MODULE_PARM_DESC(acpi_force, "Force ACPI to be used");
 
 MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 862bcf5dd..05ed9025e 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -32,14 +32,14 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 #include <linux/acpi.h>
 #include <acpi/processor.h>
 #endif
 
 #define PFX "powernow-k8: "
 #define BFX PFX "BIOS error: "
-#define VERSION "version 1.00.08b"
+#define VERSION "version 1.00.09b"
 #include "powernow-k8.h"
 
 /* serialize freq changes  */
@@ -450,13 +450,10 @@ static int check_supported_cpu(unsigned int cpu)
 		goto out;
 
 	eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
-	if ((eax & CPUID_XFAM_MOD) == ATHLON64_XFAM_MOD) {
-		dprintk(KERN_DEBUG PFX "AMD Althon 64 Processor found\n");
-	} else if ((eax & CPUID_XFAM_MOD) == OPTERON_XFAM_MOD) {
-		dprintk(KERN_DEBUG PFX "AMD Opteron Processor found\n");
-	} else {
-		printk(KERN_INFO PFX
-		       "AMD Athlon 64 or AMD Opteron processor required\n");
+	if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
+	    ((eax & CPUID_XFAM) != CPUID_XFAM_K8) ||
+	    ((eax & CPUID_XMOD) > CPUID_XMOD_REV_E)) {
+		printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax);
 		goto out;
 	}
 
@@ -524,11 +521,12 @@ static void print_basics(struct powernow_k8_data *data)
 {
 	int j;
 	for (j = 0; j < data->numps; j++) {
-		printk(KERN_INFO PFX "   %d : fid 0x%x (%d MHz), vid 0x%x (%d mV)\n", j,
-			data->powernow_table[j].index & 0xff,
-			data->powernow_table[j].frequency/1000,
-			data->powernow_table[j].index >> 8,
-			find_millivolts_from_vid(data, data->powernow_table[j].index >> 8));
+		if (data->powernow_table[j].frequency != CPUFREQ_ENTRY_INVALID)
+			printk(KERN_INFO PFX "   %d : fid 0x%x (%d MHz), vid 0x%x (%d mV)\n", j,
+				data->powernow_table[j].index & 0xff,
+				data->powernow_table[j].frequency/1000,
+				data->powernow_table[j].index >> 8,
+				find_millivolts_from_vid(data, data->powernow_table[j].index >> 8));
 	}
 	if (data->batps)
 		printk(KERN_INFO PFX "Only %d pstates on battery\n", data->batps);
@@ -555,7 +553,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst,
 		printk(KERN_ERR PFX "no p states to transition\n");
 		return -ENODEV;
 	}
-                                                                                                    
+
 	if (check_pst_table(data, pst, maxvid))
 		return -EINVAL;
 
@@ -666,7 +664,7 @@ static int find_psb_table(struct powernow_k8_data *data)
 	return -ENODEV;
 }
 
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index)
 {
 	if (!data->acpi_data.state_count)
@@ -723,17 +721,36 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
 		/* verify frequency is OK */
 		if ((powernow_table[i].frequency > (MAX_FREQ * 1000)) ||
 			(powernow_table[i].frequency < (MIN_FREQ * 1000))) {
-			dprintk(KERN_INFO PFX "invalid freq %u kHz\n", powernow_table[i].frequency);
+			dprintk(KERN_INFO PFX "invalid freq %u kHz, ignoring\n", powernow_table[i].frequency);
 			powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
 			continue;
 		}
 
-		/* verify only 1 entry from the lo frequency table */
-		if ((fid < HI_FID_TABLE_BOTTOM) && (cntlofreq++)) {
-			printk(KERN_ERR PFX "Too many lo freq table entries\n");
-			goto err_out;
+		/* verify voltage is OK - BIOSs are using "off" to indicate invalid */
+		if (vid == 0x1f) {
+			dprintk(KERN_INFO PFX "invalid vid %u, ignoring\n", vid);
+			powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+			continue;
 		}
-                                                                                                            
+
+ 		if (fid < HI_FID_TABLE_BOTTOM) {
+ 			if (cntlofreq) {
+ 				/* if both entries are the same, ignore this
+ 				 * one... 
+ 				 */
+ 				if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||
+ 				    (powernow_table[i].index != powernow_table[cntlofreq].index)) {
+ 					printk(KERN_ERR PFX "Too many lo freq table entries\n");
+ 					goto err_out_mem;
+ 				}
+				
+ 				dprintk(KERN_INFO PFX "double low frequency table entry, ignoring it.\n");
+ 				powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+ 				continue;
+ 			} else
+ 				cntlofreq = i;
+		}
+
 		if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {
 			printk(KERN_INFO PFX "invalid freq entries %u kHz vs. %u kHz\n",
 				powernow_table[i].frequency,
@@ -752,12 +769,16 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
 	print_basics(data);
 	powernow_k8_acpi_pst_values(data, 0);
 	return 0;
+
+err_out_mem:
+	kfree(powernow_table);
+
 err_out:
 	acpi_processor_unregister_performance(&data->acpi_data, data->cpu);
 
 	/* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */
 	data->acpi_data.state_count = 0;
-                                                                                                            
+
 	return -ENODEV;
 }
 
@@ -848,12 +869,9 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
 
 	if (smp_processor_id() != pol->cpu) {
 		printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
-		goto sched_out;
+		goto err_out;
 	}
 
-	/* from this point, do not exit without restoring preempt and cpu */
-	preempt_disable();
-
 	if (pending_bit_stuck()) {
 		printk(KERN_ERR PFX "failing targ, change pending bit set\n");
 		goto err_out;
@@ -891,8 +909,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
 	ret = 0;
 
 err_out:
-	preempt_enable_no_resched();
-sched_out:
 	set_cpus_allowed(current, oldmask);
 	schedule();
 
@@ -940,7 +956,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
 		if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
 			printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n");
 			kfree(data);
-			return 0;
+			return -ENODEV;
 		}
 		rc = find_psb_table(data);
 		if (rc) {
@@ -1025,6 +1041,32 @@ static int __exit powernowk8_cpu_exit (struct cpufreq_policy *pol)
 	return 0;
 }
 
+static unsigned int powernowk8_get (unsigned int cpu)
+{
+	struct powernow_k8_data *data = powernow_data[cpu];
+	cpumask_t oldmask = current->cpus_allowed;
+	unsigned int khz = 0;
+
+	set_cpus_allowed(current, cpumask_of_cpu(cpu));
+	if (smp_processor_id() != cpu) {
+		printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
+		set_cpus_allowed(current, oldmask);
+		return 0;
+	}
+	preempt_disable();
+
+	if (query_current_values_with_pending_wait(data))
+		goto out;
+
+	khz = find_khz_freq_from_fid(data->currfid);
+
+ out:
+	preempt_enable_no_resched();
+	set_cpus_allowed(current, oldmask);
+
+	return khz;
+}
+
 static struct freq_attr* powernow_k8_attr[] = {
 	&cpufreq_freq_attr_scaling_available_freqs,
 	NULL,
@@ -1035,6 +1077,7 @@ static struct cpufreq_driver cpufreq_amd64_driver = {
 	.target = powernowk8_target,
 	.init = powernowk8_cpu_init,
 	.exit = powernowk8_cpu_exit,
+	.get = powernowk8_get,
 	.name = "powernow-k8",
 	.owner = THIS_MODULE,
 	.attr = powernow_k8_attr,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index 20564ef08..500f28d27 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -29,7 +29,7 @@ struct powernow_k8_data {
 	 * frequency is in kHz */
 	struct cpufreq_frequency_table  *powernow_table;
 
-#ifdef CONFIG_ACPI_PROCESSOR
+#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
 	/* the acpi table needs to be kept. it's only available if ACPI was
 	 * used to determine valid frequency/vid/fid states */
 	struct acpi_processor_performance acpi_data;
@@ -38,13 +38,15 @@ struct powernow_k8_data {
 
 
 /* processor's cpuid instruction support */
-#define CPUID_PROCESSOR_SIGNATURE             1	/* function 1 */
-#define CPUID_XFAM_MOD               0x0ff00ff0	/* extended fam, fam + model */
-#define ATHLON64_XFAM_MOD            0x00000f40	/* extended fam, fam + model */
-#define OPTERON_XFAM_MOD             0x00000f50	/* extended fam, fam + model */
-#define CPUID_GET_MAX_CAPABILITIES   0x80000000
-#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
-#define P_STATE_TRANSITION_CAPABLE            6
+#define CPUID_PROCESSOR_SIGNATURE	1	/* function 1 */
+#define CPUID_XFAM			0x0ff00000	/* extended family */
+#define CPUID_XFAM_K8			0
+#define CPUID_XMOD			0x000f0000	/* extended model */
+#define CPUID_XMOD_REV_E		0x00020000
+#define CPUID_USE_XFAM_XMOD		0x00000f00
+#define CPUID_GET_MAX_CAPABILITIES	0x80000000
+#define CPUID_FREQ_VOLT_CAPABILITIES	0x80000007
+#define P_STATE_TRANSITION_CAPABLE	6
 
 /* Model Specific Registers for p-state transitions. MSRs are 64-bit. For     */
 /* writes (wrmsr - opcode 0f 30), the register number is placed in ecx, and   */
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index da46fb82e..f84f9af7a 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -38,13 +38,37 @@
 #define dprintk(msg...) do { } while(0)
 #endif
 
+struct cpu_id
+{
+	__u8	x86;            /* CPU family */
+	__u8	x86_vendor;     /* CPU vendor */
+	__u8	x86_model;	/* model */
+	__u8	x86_mask;	/* stepping */
+};
+
+static const struct cpu_id cpu_id_banias = {
+	.x86_vendor = X86_VENDOR_INTEL,
+	.x86 = 6,
+	.x86_model = 9,
+	.x86_mask = 5,
+};
+
+static const struct cpu_id cpu_id_dothan_a1 = {
+	.x86_vendor = X86_VENDOR_INTEL,
+	.x86 = 6,
+	.x86_model = 13,
+	.x86_mask = 1,
+};
+
 struct cpu_model
 {
+	const struct cpu_id *cpu_id;
 	const char	*model_name;
 	unsigned	max_freq; /* max clock in kHz */
 
 	struct cpufreq_frequency_table *op_points; /* clock/voltage pairs */
 };
+static int centrino_verify_cpu_id(struct cpuinfo_x86 *c, const struct cpu_id *x);
 
 /* Operating points for current CPU */
 static struct cpu_model *centrino_model;
@@ -67,8 +91,8 @@ static struct cpu_model *centrino_model;
  * M.
  */
 
-/* Ultra Low Voltage Intel Pentium M processor 900MHz */
-static struct cpufreq_frequency_table op_900[] =
+/* Ultra Low Voltage Intel Pentium M processor 900MHz (Banias) */
+static struct cpufreq_frequency_table banias_900[] =
 {
 	OP(600,  844),
 	OP(800,  988),
@@ -76,8 +100,8 @@ static struct cpufreq_frequency_table op_900[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Ultra Low Voltage Intel Pentium M processor 1000MHz */
-static struct cpufreq_frequency_table op_1000[] =
+/* Ultra Low Voltage Intel Pentium M processor 1000MHz (Banias) */
+static struct cpufreq_frequency_table banias_1000[] =
 {
 	OP(600,  844),
 	OP(800,  972),
@@ -86,8 +110,8 @@ static struct cpufreq_frequency_table op_1000[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Low Voltage Intel Pentium M processor 1.10GHz */
-static struct cpufreq_frequency_table op_1100[] =
+/* Low Voltage Intel Pentium M processor 1.10GHz (Banias) */
+static struct cpufreq_frequency_table banias_1100[] =
 {
 	OP( 600,  956),
 	OP( 800, 1020),
@@ -98,8 +122,8 @@ static struct cpufreq_frequency_table op_1100[] =
 };
 
 
-/* Low Voltage Intel Pentium M processor 1.20GHz */
-static struct cpufreq_frequency_table op_1200[] =
+/* Low Voltage Intel Pentium M processor 1.20GHz (Banias) */
+static struct cpufreq_frequency_table banias_1200[] =
 {
 	OP( 600,  956),
 	OP( 800, 1004),
@@ -110,8 +134,8 @@ static struct cpufreq_frequency_table op_1200[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Intel Pentium M processor 1.30GHz */
-static struct cpufreq_frequency_table op_1300[] = 
+/* Intel Pentium M processor 1.30GHz (Banias) */
+static struct cpufreq_frequency_table banias_1300[] = 
 {
 	OP( 600,  956),
 	OP( 800, 1260),
@@ -121,8 +145,8 @@ static struct cpufreq_frequency_table op_1300[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Intel Pentium M processor 1.40GHz */
-static struct cpufreq_frequency_table op_1400[] = 
+/* Intel Pentium M processor 1.40GHz (Banias) */
+static struct cpufreq_frequency_table banias_1400[] = 
 {
 	OP( 600,  956),
 	OP( 800, 1180),
@@ -132,8 +156,8 @@ static struct cpufreq_frequency_table op_1400[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Intel Pentium M processor 1.50GHz */
-static struct cpufreq_frequency_table op_1500[] = 
+/* Intel Pentium M processor 1.50GHz (Banias) */
+static struct cpufreq_frequency_table banias_1500[] = 
 {
 	OP( 600,  956),
 	OP( 800, 1116),
@@ -144,8 +168,8 @@ static struct cpufreq_frequency_table op_1500[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Intel Pentium M processor 1.60GHz */
-static struct cpufreq_frequency_table op_1600[] = 
+/* Intel Pentium M processor 1.60GHz (Banias) */
+static struct cpufreq_frequency_table banias_1600[] = 
 {
 	OP( 600,  956),
 	OP( 800, 1036),
@@ -156,8 +180,8 @@ static struct cpufreq_frequency_table op_1600[] =
 	{ .frequency = CPUFREQ_TABLE_END }
 };
 
-/* Intel Pentium M processor 1.70GHz */
-static struct cpufreq_frequency_table op_1700[] =
+/* Intel Pentium M processor 1.70GHz (Banias) */
+static struct cpufreq_frequency_table banias_1700[] =
 {
 	OP( 600,  956),
 	OP( 800, 1004),
@@ -169,26 +193,31 @@ static struct cpufreq_frequency_table op_1700[] =
 };
 #undef OP
 
-#define _CPU(max, name)	\
-	{ "Intel(R) Pentium(R) M processor " name "MHz", (max)*1000, op_##max }
-#define CPU(max)	_CPU(max, #max)
+#define _BANIAS(cpuid, max, name)	\
+{	.cpu_id		= cpuid,	\
+	.model_name	= "Intel(R) Pentium(R) M processor " name "MHz", \
+	.max_freq	= (max)*1000,	\
+	.op_points	= banias_##max,	\
+}
+#define BANIAS(max)	_BANIAS(&cpu_id_banias, max, #max)
 
 /* CPU models, their operating frequency range, and freq/voltage
    operating points */
 static struct cpu_model models[] = 
 {
-       _CPU( 900, " 900"),
-	CPU(1000),
-	CPU(1100),
-	CPU(1200),
-	CPU(1300),
-	CPU(1400),
-	CPU(1500),
-	CPU(1600),
-	CPU(1700),
+	_BANIAS(&cpu_id_banias, 900, " 900"),
+	BANIAS(1000),
+	BANIAS(1100),
+	BANIAS(1200),
+	BANIAS(1300),
+	BANIAS(1400),
+	BANIAS(1500),
+	BANIAS(1600),
+	BANIAS(1700),
 	{ 0, }
 };
-#undef CPU
+#undef _BANIAS
+#undef BANIAS
 
 static int centrino_cpu_init_table(struct cpufreq_policy *policy)
 {
@@ -196,7 +225,8 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
 	struct cpu_model *model;
 
 	for(model = models; model->model_name != NULL; model++)
-		if (strcmp(cpu->x86_model_id, model->model_name) == 0)
+		if ((strcmp(cpu->x86_model_id, model->model_name) == 0) &&
+		    (!centrino_verify_cpu_id(cpu, model->cpu_id)))
 			break;
 	if (model->model_name == NULL) {
 		printk(KERN_INFO PFX "no support for CPU model \"%s\": "
@@ -217,6 +247,16 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
 static inline int centrino_cpu_init_table(struct cpufreq_policy *policy) { return -ENODEV; }
 #endif /* CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE */
 
+static int centrino_verify_cpu_id(struct cpuinfo_x86 *c, const struct cpu_id *x)
+{
+	if ((c->x86 == x->x86) &&
+	    (c->x86_vendor == x->x86_vendor) &&
+	    (c->x86_model == x->x86_model) &&
+	    (c->x86_mask == x->x86_mask))
+		return 0;
+	return -ENODEV;
+}
+
 /* Extract clock in kHz from PERF_CTL value */
 static unsigned extract_clock(unsigned msr)
 {
@@ -225,9 +265,11 @@ static unsigned extract_clock(unsigned msr)
 }
 
 /* Return the current CPU frequency in kHz */
-static unsigned get_cur_freq(void)
+static unsigned int get_cur_freq(unsigned int cpu)
 {
 	unsigned l, h;
+	if (cpu)
+		return 0;
 
 	rdmsr(MSR_IA32_PERF_STATUS, l, h);
 	return extract_clock(l);
@@ -322,7 +364,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
                 goto err_kfree;
         }
 
-	cur_freq = get_cur_freq();
+	cur_freq = get_cur_freq(0);
 
         for (i=0; i<p.state_count; i++) {
 		centrino_model->op_points[i].index = p.states[i].control;
@@ -357,13 +399,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
 	if (!cpu_has(cpu, X86_FEATURE_EST))
 		return -ENODEV;
 
-	/* Only Intel Pentium M stepping 5 for now - add new CPUs as
-	   they appear after making sure they use PERF_CTL in the same
-	   way. */
-	if (cpu->x86_vendor != X86_VENDOR_INTEL ||
-	    cpu->x86        != 6 ||
-	    cpu->x86_model  != 9 ||
-	    cpu->x86_mask   != 5) {
+	if ((centrino_verify_cpu_id(cpu, &cpu_id_banias)) &&
+	    (centrino_verify_cpu_id(cpu, &cpu_id_dothan_a1))) {
 		printk(KERN_INFO PFX "found unsupported CPU with Enhanced SpeedStep: "
 		       "send /proc/cpuinfo to " MAINTAINER "\n");
 		return -ENODEV;
@@ -391,10 +428,10 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
 		}
 	}
 
-	freq = get_cur_freq();
+	freq = get_cur_freq(0);
 
 	policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
-	policy->cpuinfo.transition_latency = 10; /* 10uS transition latency */
+	policy->cpuinfo.transition_latency = 10000; /* 10uS transition latency */
 	policy->cur = freq;
 
 	dprintk(KERN_INFO PFX "centrino_cpu_init: policy=%d cur=%dkHz\n",
@@ -516,6 +553,7 @@ static struct cpufreq_driver centrino_driver = {
 	.exit		= centrino_cpu_exit,
 	.verify 	= centrino_verify,
 	.target 	= centrino_target,
+	.get		= get_cur_freq,
 	.attr           = centrino_attr,
 	.owner		= THIS_MODULE,
 };
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
index 5ba993af5..93b70f0dc 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
@@ -67,28 +67,19 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
 /**
  * speedstep_set_state - set the SpeedStep state
  * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
- * @notify: whether to call cpufreq_notify_transition for CPU speed changes
  *
  *   Tries to change the SpeedStep state. 
  */
-static void speedstep_set_state (unsigned int state, unsigned int notify)
+static void speedstep_set_state (unsigned int state)
 {
 	u32			pmbase;
 	u8			pm2_blk;
 	u8			value;
 	unsigned long		flags;
-	struct cpufreq_freqs	freqs;
 
 	if (!speedstep_chipset_dev || (state > 0x1))
 		return;
 
-	freqs.old = speedstep_get_processor_frequency(speedstep_processor);
-	freqs.new = speedstep_freqs[state].frequency;
-	freqs.cpu = 0; /* speedstep.c is UP only driver */
-	
-	if (notify)
-		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-
 	/* get PMBASE */
 	pci_read_config_dword(speedstep_chipset_dev, 0x40, &pmbase);
 	if (!(pmbase & 0x01))
@@ -143,9 +134,6 @@ static void speedstep_set_state (unsigned int state, unsigned int notify)
 		printk (KERN_ERR "cpufreq: change failed - I/O error\n");
 	}
 
-	if (notify)
-		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-
 	return;
 }
 
@@ -179,7 +167,7 @@ static int speedstep_activate (void)
 /**
  * speedstep_detect_chipset - detect the Southbridge which contains SpeedStep logic
  *
- *   Detects PIIX4, ICH2-M and ICH3-M so far. The pci_dev points to 
+ *   Detects ICH2-M, ICH3-M and ICH4-M so far. The pci_dev points to 
  * the LPC bridge / PM module which contains all power-management 
  * functions. Returns the SPEEDSTEP_CHIPSET_-number for the detected
  * chipset, or zero on failure.
@@ -252,11 +240,47 @@ static int speedstep_target (struct cpufreq_policy *policy,
 			     unsigned int relation)
 {
 	unsigned int	newstate = 0;
+	struct cpufreq_freqs freqs;
+	cpumask_t cpus_allowed, affected_cpu_map;
+	int i;
 
 	if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
 		return -EINVAL;
 
-	speedstep_set_state(newstate, 1);
+	/* no transition necessary */
+	if (freqs.old == freqs.new)
+		return 0;
+
+	freqs.old = speedstep_get_processor_frequency(speedstep_processor);
+	freqs.new = speedstep_freqs[newstate].frequency;
+	freqs.cpu = policy->cpu;
+
+	cpus_allowed = current->cpus_allowed;
+
+	/* only run on CPU to be set, or on its sibling */
+#ifdef CONFIG_SMP
+	affected_cpu_map = cpu_sibling_map[policy->cpu];
+#else
+	affected_cpu_map = cpumask_of_cpu(policy->cpu);
+#endif
+
+	for_each_cpu_mask(i, affected_cpu_map) {
+		freqs.cpu = i;
+		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+	}
+
+	/* switch to physical CPU where state is to be changed */
+	set_cpus_allowed(current, affected_cpu_map);
+
+	speedstep_set_state(newstate);
+
+	/* allow to be run on all CPUs */
+	set_cpus_allowed(current, cpus_allowed);
+
+	for_each_cpu_mask(i, affected_cpu_map) {
+		freqs.cpu = i;
+		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+	}
 
 	return 0;
 }
@@ -279,21 +303,35 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 {
 	int		result = 0;
 	unsigned int	speed;
+	cpumask_t       cpus_allowed,affected_cpu_map;
+
 
 	/* capability check */
-	if (policy->cpu != 0)
+	if (policy->cpu != 0) /* FIXME: better support for SMT in cpufreq core. Up until then, it's better to register only one CPU */
 		return -ENODEV;
 
+	/* only run on CPU to be set, or on its sibling */
+	cpus_allowed = current->cpus_allowed;
+#ifdef CONFIG_SMP
+	affected_cpu_map = cpu_sibling_map[policy->cpu];
+#else
+	affected_cpu_map = cpumask_of_cpu(policy->cpu);
+#endif
+	set_cpus_allowed(current, affected_cpu_map);
+
 	/* detect low and high frequency */
 	result = speedstep_get_freqs(speedstep_processor,
 				     &speedstep_freqs[SPEEDSTEP_LOW].frequency,
 				     &speedstep_freqs[SPEEDSTEP_HIGH].frequency,
 				     &speedstep_set_state);
-	if (result)
+	if (result) {
+		set_cpus_allowed(current, cpus_allowed);
 		return result;
+	}
 
 	/* get current speed setting */
 	speed = speedstep_get_processor_frequency(speedstep_processor);
+	set_cpus_allowed(current, cpus_allowed);
 	if (!speed)
 		return -EIO;
 
@@ -322,6 +360,10 @@ static int speedstep_cpu_exit(struct cpufreq_policy *policy)
 	return 0;
 }
 
+static unsigned int speedstep_get(unsigned int cpu)
+{
+	return speedstep_get_processor_frequency(speedstep_processor);
+}
 
 static struct freq_attr* speedstep_attr[] = {
 	&cpufreq_freq_attr_scaling_available_freqs,
@@ -335,6 +377,7 @@ static struct cpufreq_driver speedstep_driver = {
 	.target 	= speedstep_target,
 	.init		= speedstep_cpu_init,
 	.exit		= speedstep_cpu_exit,
+	.get		= speedstep_get,
 	.owner		= THIS_MODULE,
 	.attr		= speedstep_attr,
 };
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
index 3305a84b6..82f7c0220 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
@@ -252,11 +252,10 @@ unsigned int speedstep_detect_processor (void)
 			 * specific.
 			 * M-P4-Ms may have either ebx=0xe or 0xf [see above]
 			 * M-P4/533 have either ebx=0xe or 0xf. [25317607.pdf]
-			 * So, how to distinguish all those processors with
-			 * ebx=0xf? I don't know. Sort them out, and wait
-			 * for someone to complain.
+			 * also, M-P4M HTs have ebx=0x8, too
+			 * For now, they are distinguished by the model_id string
 			 */
-			if (ebx == 0x0e)
+		        if ((ebx == 0x0e) || (strstr(c->x86_model_id,"Mobile Intel(R) Pentium(R) 4") != NULL)) 
 				return SPEEDSTEP_PROCESSOR_P4M;
 			break;
 		default:
@@ -321,9 +320,7 @@ EXPORT_SYMBOL_GPL(speedstep_detect_processor);
 unsigned int speedstep_get_freqs(unsigned int processor,
 				  unsigned int *low_speed,
 				  unsigned int *high_speed,
-				  void (*set_state) (unsigned int state,
-						     unsigned int notify)
-				 )
+				  void (*set_state) (unsigned int state))
 {
 	unsigned int prev_speed;
 	unsigned int ret = 0;
@@ -340,7 +337,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
 	local_irq_save(flags);
 
 	/* switch to low state */
-	set_state(SPEEDSTEP_LOW, 0);
+	set_state(SPEEDSTEP_LOW);
 	*low_speed = speedstep_get_processor_frequency(processor);
 	if (!*low_speed) {
 		ret = -EIO;
@@ -348,7 +345,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
 	}
 
 	/* switch to high state */
-	set_state(SPEEDSTEP_HIGH, 0);
+	set_state(SPEEDSTEP_HIGH);
 	*high_speed = speedstep_get_processor_frequency(processor);
 	if (!*high_speed) {
 		ret = -EIO;
@@ -362,7 +359,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
 
 	/* switch to previous state, if necessary */
 	if (*high_speed != prev_speed)
-		set_state(SPEEDSTEP_LOW, 0);
+		set_state(SPEEDSTEP_LOW);
 
  out:
 	local_irq_restore(flags);
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
index 851926d61..261a2c9b7 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
@@ -44,4 +44,4 @@ extern unsigned int speedstep_get_processor_frequency(unsigned int processor);
 extern unsigned int speedstep_get_freqs(unsigned int processor,
 	  unsigned int *low_speed,
 	  unsigned int *high_speed,
-	  void (*set_state) (unsigned int state, unsigned int notify));
+	  void (*set_state) (unsigned int state));
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index a84273864..6aa31cd5a 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -36,6 +36,8 @@ static int		smi_port	= 0;
 static int		smi_cmd		= 0;
 static unsigned int	smi_sig		= 0;
 
+/* info about the processor */
+static unsigned int	speedstep_processor = 0;
 
 /* 
  *   There are only two frequency states for each processor. Values
@@ -137,37 +139,24 @@ static int speedstep_get_state (void)
 		: "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0)
 	);
 
-	return state;
+	return (state & 1);
 }
 
 /**
  * speedstep_set_state - set the SpeedStep state
  * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
- * @notify: whether to call cpufreq_notify_transition
  *
  */
-static void speedstep_set_state (unsigned int state, unsigned int notify)
+static void speedstep_set_state (unsigned int state)
 {
-	unsigned int old_state, result = 0, command, new_state;
+	unsigned int result = 0, command, new_state;
 	unsigned long flags;
-	struct cpufreq_freqs freqs;
 	unsigned int function=SET_SPEEDSTEP_STATE;
 	unsigned int retry = 0;
 
 	if (state > 0x1)
 		return;
 
-	old_state = speedstep_get_state();
-	freqs.old = speedstep_freqs[old_state].frequency;
-	freqs.new = speedstep_freqs[state].frequency;
-	freqs.cpu = 0; /* speedstep.c is UP only driver */
-
-	if (old_state == state)
-		return;
-
-	if (notify)
-		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-
 	/* Disable IRQs */
 	local_irq_save(flags);
 
@@ -196,9 +185,6 @@ static void speedstep_set_state (unsigned int state, unsigned int notify)
 		printk(KERN_ERR "cpufreq: change failed with new_state %u and result %u\n", new_state, result);
 	}
 
-	if (notify)
-		cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-
 	return;
 }
 
@@ -215,11 +201,21 @@ static int speedstep_target (struct cpufreq_policy *policy,
 			unsigned int target_freq, unsigned int relation)
 {
 	unsigned int newstate = 0;
+	struct cpufreq_freqs freqs;
 
 	if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
 		return -EINVAL;
 
-	speedstep_set_state(newstate, 1);
+	freqs.old = speedstep_freqs[speedstep_get_state()].frequency;
+	freqs.new = speedstep_freqs[newstate].frequency;
+	freqs.cpu = 0; /* speedstep.c is UP only driver */
+
+	if (freqs.old == freqs.new)
+		return 0;
+
+	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+	speedstep_set_state(newstate);
+	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
 	return 0;
 }
@@ -258,9 +254,10 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 				&speedstep_freqs[SPEEDSTEP_HIGH].frequency);
 	if (result) {
 		/* fall back to speedstep_lib.c dection mechanism: try both states out */
-		unsigned int speedstep_processor = speedstep_detect_processor();
-
 		dprintk(KERN_INFO PFX "could not detect low and high frequencies by SMI call.\n");
+		if (!speedstep_processor)
+			speedstep_processor = speedstep_detect_processor();
+
 		if (!speedstep_processor)
 			return -ENODEV;
 
@@ -298,13 +295,23 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 	return 0;
 }
 
-
 static int speedstep_cpu_exit(struct cpufreq_policy *policy)
 {
 	cpufreq_frequency_table_put_attr(policy->cpu);
 	return 0;
 }
 
+static unsigned int speedstep_get(unsigned int cpu)
+{
+	if (cpu)
+		return -ENODEV;
+	if (!speedstep_processor)
+		speedstep_processor = speedstep_detect_processor();
+	if (!speedstep_processor)
+		return 0;
+	return speedstep_get_processor_frequency(speedstep_processor);
+}
+
 
 static int speedstep_resume(struct cpufreq_policy *policy)
 {
@@ -327,6 +334,7 @@ static struct cpufreq_driver speedstep_driver = {
 	.target 	= speedstep_target,
 	.init		= speedstep_cpu_init,
 	.exit		= speedstep_cpu_exit,
+	.get		= speedstep_get,
 	.resume		= speedstep_resume,
 	.owner		= THIS_MODULE,
 	.attr		= speedstep_attr,
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c
index e04e1c9a1..09acdd76b 100644
--- a/arch/i386/kernel/cpu/intel.c
+++ b/arch/i386/kernel/cpu/intel.c
@@ -28,6 +28,15 @@ extern int trap_init_f00f_bug(void);
 struct movsl_mask movsl_mask;
 #endif
 
+void __init early_intel_workaround(struct cpuinfo_x86 *c)
+{
+	if (c->x86_vendor != X86_VENDOR_INTEL)
+		return;
+	/* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
+	if (c->x86 == 15 && c->x86_cache_alignment == 64)
+		c->x86_cache_alignment = 128;
+}
+
 /*
  *	Early probe support logic for ppro memory erratum #50
  *
@@ -36,42 +45,14 @@ struct movsl_mask movsl_mask;
  
 int __init ppro_with_ram_bug(void)
 {
-	char vendor_id[16];
-	int ident;
-
-	/* Must have CPUID */
-	if(!have_cpuid_p())
-		return 0;
-	if(cpuid_eax(0)<1)
-		return 0;
-	
-	/* Must be Intel */
-	cpuid(0, &ident, 
-		(int *)&vendor_id[0],
-		(int *)&vendor_id[8],
-		(int *)&vendor_id[4]);
-	
-	if(memcmp(vendor_id, "IntelInside", 12))
-		return 0;
-	
-	ident = cpuid_eax(1);
-
-	/* Model 6 */
-
-	if(((ident>>8)&15)!=6)
-		return 0;
-	
-	/* Pentium Pro */
-
-	if(((ident>>4)&15)!=1)
-		return 0;
-	
-	if((ident&15) < 8)
-	{
+	/* Uses data from early_cpu_detect now */
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+	    boot_cpu_data.x86 == 6 &&
+	    boot_cpu_data.x86_model == 1 &&
+	    boot_cpu_data.x86_mask < 8) {
 		printk(KERN_INFO "Pentium Pro with Errata#50 detected. Taking evasive action.\n");
 		return 1;
 	}
-	printk(KERN_INFO "Your Pentium Pro seems ok.\n");
 	return 0;
 }
 	
@@ -109,6 +90,7 @@ static struct _cache_table cache_table[] __initdata =
 	{ 0x43, LVL_2,      512 },
 	{ 0x44, LVL_2,      1024 },
 	{ 0x45, LVL_2,      2048 },
+	{ 0x60, LVL_1_DATA, 16 },
 	{ 0x66, LVL_1_DATA, 8 },
 	{ 0x67, LVL_1_DATA, 16 },
 	{ 0x68, LVL_1_DATA, 32 },
diff --git a/arch/i386/kernel/cpu/mcheck/p4.c b/arch/i386/kernel/cpu/mcheck/p4.c
index abb817f67..b31fc006f 100644
--- a/arch/i386/kernel/cpu/mcheck/p4.c
+++ b/arch/i386/kernel/cpu/mcheck/p4.c
@@ -38,7 +38,8 @@ static int mce_num_extended_msrs = 0;
 #ifdef CONFIG_X86_MCE_P4THERMAL
 static void unexpected_thermal_interrupt(struct pt_regs *regs)
 {	
-	printk(KERN_ERR "CPU#%d: Unexpected LVT TMR interrupt!\n", smp_processor_id());
+	printk(KERN_ERR "CPU%d: Unexpected LVT TMR interrupt!\n",
+			smp_processor_id());
 }
 
 /* P4/Xeon Thermal transition interrupt handler */
@@ -46,15 +47,21 @@ static void intel_thermal_interrupt(struct pt_regs *regs)
 {
 	u32 l, h;
 	unsigned int cpu = smp_processor_id();
+	static unsigned long next[NR_CPUS];
 
 	ack_APIC_irq();
 
-	rdmsr (MSR_IA32_THERM_STATUS, l, h);
-	if (l & 1) {
-		printk(KERN_EMERG "CPU#%d: Temperature above threshold\n", cpu);
-		printk(KERN_EMERG "CPU#%d: Running in modulated clock mode\n", cpu);
+	if (time_after(next[cpu], jiffies))
+		return;
+
+	next[cpu] = jiffies + HZ*5;
+	rdmsr(MSR_IA32_THERM_STATUS, l, h);
+	if (l & 0x1) {
+		printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
+		printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
+				cpu);
 	} else {
-		printk(KERN_INFO "CPU#%d: Temperature/speed normal\n", cpu);
+		printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
 	}
 }
 
@@ -89,13 +96,15 @@ static void __init intel_init_thermal(struct cpuinfo_x86 *c)
 	rdmsr (MSR_IA32_MISC_ENABLE, l, h);
 	h = apic_read(APIC_LVTTHMR);
 	if ((l & (1<<3)) && (h & APIC_DM_SMI)) {
-		printk(KERN_DEBUG "CPU#%d: Thermal monitoring handled by SMI\n", cpu);
+		printk(KERN_DEBUG "CPU%d: Thermal monitoring handled by SMI\n",
+				cpu);
 		return; /* -EBUSY */
 	}
 
 	/* check whether a vector already exists, temporarily masked? */	
 	if (h & APIC_VECTOR_MASK) {
-		printk(KERN_DEBUG "CPU#%d: Thermal LVT vector (%#x) already installed\n",
+		printk(KERN_DEBUG "CPU%d: Thermal LVT vector (%#x) already "
+				"installed\n",
 			cpu, (h & APIC_VECTOR_MASK));
 		return; /* -EBUSY */
 	}
@@ -116,7 +125,7 @@ static void __init intel_init_thermal(struct cpuinfo_x86 *c)
 	
 	l = apic_read (APIC_LVTTHMR);
 	apic_write_around (APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
-	printk (KERN_INFO "CPU#%d: Thermal monitoring enabled\n", cpu);
+	printk (KERN_INFO "CPU%d: Thermal monitoring enabled\n", cpu);
 	return;
 }
 #endif /* CONFIG_X86_MCE_P4THERMAL */
@@ -247,7 +256,8 @@ void __init intel_p4_mcheck_init(struct cpuinfo_x86 *c)
 	rdmsr (MSR_IA32_MCG_CAP, l, h);
 	if (l & (1<<9))	{/* MCG_EXT_P */
 		mce_num_extended_msrs = (l >> 16) & 0xff;
-		printk (KERN_INFO "CPU#%d: Intel P4/Xeon Extended MCE MSRs (%d) available\n",
+		printk (KERN_INFO "CPU%d: Intel P4/Xeon Extended MCE MSRs (%d)"
+				" available\n",
 			smp_processor_id(), mce_num_extended_msrs);
 
 #ifdef CONFIG_X86_MCE_P4THERMAL
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 9a6a7e874..5a997a371 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -10,7 +10,6 @@
  *
  * ----------------------------------------------------------------------- */
 
-
 /*
  * cpuid.c
  *
@@ -46,131 +45,132 @@
 #ifdef CONFIG_SMP
 
 struct cpuid_command {
-  int cpu;
-  u32 reg;
-  u32 *data;
+	int cpu;
+	u32 reg;
+	u32 *data;
 };
 
 static void cpuid_smp_cpuid(void *cmd_block)
 {
-  struct cpuid_command *cmd = (struct cpuid_command *) cmd_block;
-  
-  if ( cmd->cpu == smp_processor_id() )
-    cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2], &cmd->data[3]);
+	struct cpuid_command *cmd = (struct cpuid_command *)cmd_block;
+
+	if (cmd->cpu == smp_processor_id())
+		cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2],
+		      &cmd->data[3]);
 }
 
-static inline void do_cpuid(int cpu, u32 reg, u32 *data)
+static inline void do_cpuid(int cpu, u32 reg, u32 * data)
 {
-  struct cpuid_command cmd;
-  
-  preempt_disable();
-  if ( cpu == smp_processor_id() ) {
-    cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
-  } else {
-    cmd.cpu  = cpu;
-    cmd.reg  = reg;
-    cmd.data = data;
-    
-    smp_call_function(cpuid_smp_cpuid, &cmd, 1, 1);
-  }
-  preempt_enable();
+	struct cpuid_command cmd;
+
+	preempt_disable();
+	if (cpu == smp_processor_id()) {
+		cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
+	} else {
+		cmd.cpu = cpu;
+		cmd.reg = reg;
+		cmd.data = data;
+
+		smp_call_function(cpuid_smp_cpuid, &cmd, 1, 1);
+	}
+	preempt_enable();
 }
-#else /* ! CONFIG_SMP */
+#else				/* ! CONFIG_SMP */
 
-static inline void do_cpuid(int cpu, u32 reg, u32 *data)
+static inline void do_cpuid(int cpu, u32 reg, u32 * data)
 {
-  cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
+	cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
 }
 
-#endif /* ! CONFIG_SMP */
+#endif				/* ! CONFIG_SMP */
 
 static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
 {
-  loff_t ret;
-
-  lock_kernel();
-
-  switch (orig) {
-  case 0:
-    file->f_pos = offset;
-    ret = file->f_pos;
-    break;
-  case 1:
-    file->f_pos += offset;
-    ret = file->f_pos;
-    break;
-  default:
-    ret = -EINVAL;
-  }
-
-  unlock_kernel();
-  return ret;
+	loff_t ret;
+
+	lock_kernel();
+
+	switch (orig) {
+	case 0:
+		file->f_pos = offset;
+		ret = file->f_pos;
+		break;
+	case 1:
+		file->f_pos += offset;
+		ret = file->f_pos;
+		break;
+	default:
+		ret = -EINVAL;
+	}
+
+	unlock_kernel();
+	return ret;
 }
 
-static ssize_t cpuid_read(struct file * file, char * buf,
-			size_t count, loff_t *ppos)
+static ssize_t cpuid_read(struct file *file, char __user *buf,
+			  size_t count, loff_t * ppos)
 {
-  u32 *tmp = (u32 *)buf;
-  u32 data[4];
-  size_t rv;
-  u32 reg = *ppos;
-  int cpu = iminor(file->f_dentry->d_inode);
-  
-  if ( count % 16 )
-    return -EINVAL; /* Invalid chunk size */
-  
-  for ( rv = 0 ; count ; count -= 16 ) {
-    do_cpuid(cpu, reg, data);
-    if ( copy_to_user(tmp,&data,16) )
-      return -EFAULT;
-    tmp += 4;
-    *ppos = reg++;
-  }
-  
-  return ((char *)tmp) - buf;
+	char __user *tmp = buf;
+	u32 data[4];
+	size_t rv;
+	u32 reg = *ppos;
+	int cpu = iminor(file->f_dentry->d_inode);
+
+	if (count % 16)
+		return -EINVAL;	/* Invalid chunk size */
+
+	for (rv = 0; count; count -= 16) {
+		do_cpuid(cpu, reg, data);
+		if (copy_to_user(tmp, &data, 16))
+			return -EFAULT;
+		tmp += 16;
+		*ppos = reg++;
+	}
+
+	return tmp - buf;
 }
 
 static int cpuid_open(struct inode *inode, struct file *file)
 {
-  int cpu = iminor(file->f_dentry->d_inode);
-  struct cpuinfo_x86 *c = &(cpu_data)[cpu];
-
-  if (!cpu_online(cpu))
-    return -ENXIO;		/* No such CPU */
-  if ( c->cpuid_level < 0 )
-    return -EIO;		/* CPUID not supported */
-  
-  return 0;
+	unsigned int cpu = iminor(file->f_dentry->d_inode);
+	struct cpuinfo_x86 *c = &(cpu_data)[cpu];
+
+	if (cpu >= NR_CPUS || !cpu_online(cpu))
+		return -ENXIO;	/* No such CPU */
+	if (c->cpuid_level < 0)
+		return -EIO;	/* CPUID not supported */
+
+	return 0;
 }
 
 /*
  * File operations we support
  */
 static struct file_operations cpuid_fops = {
-  .owner	= THIS_MODULE,
-  .llseek	= cpuid_seek,
-  .read		= cpuid_read,
-  .open		= cpuid_open,
+	.owner = THIS_MODULE,
+	.llseek = cpuid_seek,
+	.read = cpuid_read,
+	.open = cpuid_open,
 };
 
 int __init cpuid_init(void)
 {
-  if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) {
-    printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n",
-	   CPUID_MAJOR);
-    return -EBUSY;
-  }
+	if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) {
+		printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n",
+		       CPUID_MAJOR);
+		return -EBUSY;
+	}
 
-  return 0;
+	return 0;
 }
 
 void __exit cpuid_exit(void)
 {
-  unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
+	unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
 }
 
 module_init(cpuid_init);
-module_exit(cpuid_exit)
+module_exit(cpuid_exit);
 
 MODULE_AUTHOR("H. Peter Anvin <hpa@zytor.com>");
 MODULE_DESCRIPTION("x86 generic CPUID driver");
diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
index 6c20ebe99..d9c97dae4 100644
--- a/arch/i386/kernel/dmi_scan.c
+++ b/arch/i386/kernel/dmi_scan.c
@@ -783,6 +783,7 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
 	{ exploding_pnp_bios, "ASUS P4P800", {	/* PnPBIOS GPF on boot */
 			MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
 			MATCH(DMI_BOARD_NAME, "P4P800"),
+			NO_MATCH, NO_MATCH
 			} },
 
 	/* Machines which have problems handling enabled local APICs */
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index afa02ea35..7b6856363 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -74,12 +74,6 @@ DF_MASK		= 0x00000400
 NT_MASK		= 0x00004000
 VM_MASK		= 0x00020000
 
-/*
- * ESP0 is at offset 4. 0x200 is the size of the TSS, and
- * also thus the top-of-stack pointer offset of SYSENTER_ESP
- */
-TSS_ESP0_OFFSET = (4 - 0x200)
-
 #ifdef CONFIG_PREEMPT
 #define preempt_stop		cli
 #else
@@ -163,8 +157,8 @@ do_lcall:
 	movl %edx,EIP(%ebp)	# Now we move them to their "normal" places
 	movl %ecx,CS(%ebp)	#
 	GET_THREAD_INFO_WITH_ESP(%ebp)	# GET_THREAD_INFO
-	movl TI_EXEC_DOMAIN(%ebp), %edx	# Get the execution domain
-	call *4(%edx)		# Call the lcall7 handler for the domain
+	movl TI_exec_domain(%ebp), %edx	# Get the execution domain
+	call *EXEC_DOMAIN_handler(%edx)	# Call the handler for the domain
 	addl $4, %esp
 	popl %eax
 	jmp resume_userspace
@@ -208,7 +202,7 @@ ENTRY(resume_userspace)
  	cli				# make sure we don't miss an interrupt
 					# setting need_resched or sigpending
 					# between sampling and the iret
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	andl $_TIF_WORK_MASK, %ecx	# is there any work to be done on
 					# int/exception return?
 	jne work_pending
@@ -216,18 +210,18 @@ ENTRY(resume_userspace)
 
 #ifdef CONFIG_PREEMPT
 ENTRY(resume_kernel)
-	cmpl $0,TI_PRE_COUNT(%ebp)	# non-zero preempt_count ?
+	cmpl $0,TI_preempt_count(%ebp)	# non-zero preempt_count ?
 	jnz restore_all
 need_resched:
-	movl TI_FLAGS(%ebp), %ecx	# need_resched set ?
+	movl TI_flags(%ebp), %ecx	# need_resched set ?
 	testb $_TIF_NEED_RESCHED, %cl
 	jz restore_all
 	testl $IF_MASK,EFLAGS(%esp)     # interrupts off (exception path) ?
 	jz restore_all
-	movl $PREEMPT_ACTIVE,TI_PRE_COUNT(%ebp)
+	movl $PREEMPT_ACTIVE,TI_preempt_count(%ebp)
 	sti
 	call schedule
-	movl $0,TI_PRE_COUNT(%ebp)
+	movl $0,TI_preempt_count(%ebp)
 	cli
 	jmp need_resched
 #endif
@@ -237,7 +231,7 @@ need_resched:
 
 	# sysenter call handler stub
 ENTRY(sysenter_entry)
-	movl TSS_ESP0_OFFSET(%esp),%esp
+	movl TSS_sysenter_esp0(%esp),%esp
 sysenter_past_esp:
 	sti
 	pushl $(__USER_DS)
@@ -264,12 +258,12 @@ sysenter_past_esp:
 	cmpl $(nr_syscalls), %eax
 	jae syscall_badsys
 
-	testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_FLAGS(%ebp)
+	testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
 	jnz syscall_trace_entry
 	call *sys_call_table(,%eax,4)
 	movl %eax,EAX(%esp)
 	cli
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	testw $_TIF_ALLWORK_MASK, %cx
 	jne syscall_exit_work
 /* if something modifies registers it must also disable sysexit */
@@ -287,7 +281,7 @@ ENTRY(system_call)
 	cmpl $(nr_syscalls), %eax
 	jae syscall_badsys
 					# system call tracing in operation
-	testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_FLAGS(%ebp)
+	testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
 	jnz syscall_trace_entry
 syscall_call:
 	call *sys_call_table(,%eax,4)
@@ -296,7 +290,7 @@ syscall_exit:
 	cli				# make sure we don't miss an interrupt
 					# setting need_resched or sigpending
 					# between sampling and the iret
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	testw $_TIF_ALLWORK_MASK, %cx	# current->work
 	jne syscall_exit_work
 restore_all:
@@ -312,7 +306,7 @@ work_resched:
 	cli				# make sure we don't miss an interrupt
 					# setting need_resched or sigpending
 					# between sampling and the iret
-	movl TI_FLAGS(%ebp), %ecx
+	movl TI_flags(%ebp), %ecx
 	andl $_TIF_WORK_MASK, %ecx	# is there any work to be done other
 					# than syscall tracing?
 	jz restore_all
@@ -473,7 +467,7 @@ device_not_available_emulate:
  * that sets up the real kernel stack. Check here, since we can't
  * allow the wrong stack to be used.
  *
- * "TSS_ESP0_OFFSET+12" is because the NMI/debug handler will have
+ * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have
  * already pushed 3 words if it hits on the sysenter instruction:
  * eflags, cs and eip.
  *
@@ -485,7 +479,7 @@ device_not_available_emulate:
 	cmpw $__KERNEL_CS,4(%esp);		\
 	jne ok;					\
 label:						\
-	movl TSS_ESP0_OFFSET+offset(%esp),%esp;	\
+	movl TSS_sysenter_esp0+offset(%esp),%esp;	\
 	pushfl;					\
 	pushl $__KERNEL_CS;			\
 	pushl $sysenter_past_esp
@@ -882,14 +876,15 @@ ENTRY(sys_call_table)
 	.long sys_utimes
  	.long sys_fadvise64_64
 	.long sys_ni_syscall	/* sys_vserver */
-	.long sys_ni_syscall	/* sys_mbind */
-	.long sys_ni_syscall	/* 275 sys_get_mempolicy */
-	.long sys_ni_syscall	/* sys_set_mempolicy */
+	.long sys_mbind
+	.long sys_get_mempolicy
+	.long sys_set_mempolicy
 	.long sys_mq_open
 	.long sys_mq_unlink
 	.long sys_mq_timedsend
 	.long sys_mq_timedreceive	/* 280 */
 	.long sys_mq_notify
 	.long sys_mq_getsetattr
+	.long sys_ni_syscall		/* reserved for kexec */
 
 syscall_table_size=(.-sys_call_table)
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index f7867f4b8..3f868ea50 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -24,15 +24,14 @@
  * References to members of the new_cpu_data structure.
  */
 
-#define CPU_PARAMS	new_cpu_data
-#define X86		CPU_PARAMS+0
-#define X86_VENDOR	CPU_PARAMS+1
-#define X86_MODEL	CPU_PARAMS+2
-#define X86_MASK	CPU_PARAMS+3
-#define X86_HARD_MATH	CPU_PARAMS+6
-#define X86_CPUID	CPU_PARAMS+8
-#define X86_CAPABILITY	CPU_PARAMS+12
-#define X86_VENDOR_ID	CPU_PARAMS+36	/* offset dependent on NCAPINTS */
+#define X86		new_cpu_data+CPUINFO_x86
+#define X86_VENDOR	new_cpu_data+CPUINFO_x86_vendor
+#define X86_MODEL	new_cpu_data+CPUINFO_x86_model
+#define X86_MASK	new_cpu_data+CPUINFO_x86_mask
+#define X86_HARD_MATH	new_cpu_data+CPUINFO_hard_math
+#define X86_CPUID	new_cpu_data+CPUINFO_cpuid_level
+#define X86_CAPABILITY	new_cpu_data+CPUINFO_x86_capability
+#define X86_VENDOR_ID	new_cpu_data+CPUINFO_x86_vendor_id
 
 /*
  * This is how much memory *in addition to the memory covered up to
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 582f093ad..13e60f013 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -16,6 +16,7 @@
 #include <linux/tty.h>
 #include <linux/highmem.h>
 #include <linux/time.h>
+#include <linux/nmi.h>
 
 #include <asm/semaphore.h>
 #include <asm/processor.h>
@@ -33,6 +34,7 @@
 #include <asm/tlbflush.h>
 #include <asm/nmi.h>
 #include <asm/ist.h>
+#include <asm/e820.h>
 
 extern void dump_thread(struct pt_regs *, struct user *);
 extern spinlock_t rtc_lock;
@@ -206,3 +208,20 @@ EXPORT_SYMBOL(ist_info);
 #endif
 
 EXPORT_SYMBOL(csum_partial);
+ 
+#ifdef CONFIG_CRASH_DUMP_MODULE
+#ifdef CONFIG_SMP
+extern irq_desc_t irq_desc[NR_IRQS];
+extern unsigned long irq_affinity[NR_IRQS];
+extern void stop_this_cpu(void *);
+EXPORT_SYMBOL(irq_desc);
+EXPORT_SYMBOL(irq_affinity);
+EXPORT_SYMBOL(stop_this_cpu);
+EXPORT_SYMBOL(dump_send_ipi);
+#endif
+extern int pfn_is_ram(unsigned long);
+EXPORT_SYMBOL(pfn_is_ram);
+#ifdef ARCH_HAS_NMI_WATCHDOG
+EXPORT_SYMBOL(touch_nmi_watchdog);
+#endif
+#endif
diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c
index 0d35516ca..3da92c23d 100644
--- a/arch/i386/kernel/i387.c
+++ b/arch/i386/kernel/i387.c
@@ -246,7 +246,7 @@ static int convert_fxsr_to_user( struct _fpstate __user *buf,
 	to = &buf->_st[0];
 	from = (struct _fpxreg *) &fxsave->st_space[0];
 	for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
-		unsigned long *t = (unsigned long *)to;
+		unsigned long __user *t = (unsigned long __user *)to;
 		unsigned long *f = (unsigned long *)from;
 
 		if (__put_user(*f, t) ||
@@ -281,7 +281,7 @@ static int convert_fxsr_from_user( struct i387_fxsave_struct *fxsave,
 	from = &buf->_st[0];
 	for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
 		unsigned long *t = (unsigned long *)to;
-		unsigned long *f = (unsigned long *)from;
+		unsigned long __user *f = (unsigned long __user *)from;
 
 		if (__get_user(*t, f) ||
 				__get_user(*(t + 1), f + 1) ||
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 92bf30a0b..3ea997f30 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -317,8 +317,7 @@ struct irq_cpu_info {
 
 #define IRQ_ALLOWED(cpu, allowed_mask)	cpu_isset(cpu, allowed_mask)
 
-#define CPU_TO_PACKAGEINDEX(i) \
-		((physical_balance && i > cpu_sibling_map[i]) ? cpu_sibling_map[i] : i)
+#define CPU_TO_PACKAGEINDEX(i) (first_cpu(cpu_sibling_map[i]))
 
 #define MAX_BALANCED_IRQ_INTERVAL	(5*HZ)
 #define MIN_BALANCED_IRQ_INTERVAL	(HZ/2)
@@ -401,6 +400,7 @@ static void do_irq_balance(void)
 	unsigned long max_cpu_irq = 0, min_cpu_irq = (~0);
 	unsigned long move_this_load = 0;
 	int max_loaded = 0, min_loaded = 0;
+	int load;
 	unsigned long useful_load_threshold = balanced_irq_interval + 10;
 	int selected_irq;
 	int tmp_loaded, first_attempt = 1;
@@ -452,7 +452,7 @@ static void do_irq_balance(void)
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_online(i))
 			continue;
-		if (physical_balance && i > cpu_sibling_map[i])
+		if (i != CPU_TO_PACKAGEINDEX(i))
 			continue;
 		if (min_cpu_irq > CPU_IRQ(i)) {
 			min_cpu_irq = CPU_IRQ(i);
@@ -471,7 +471,7 @@ tryanothercpu:
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_online(i))
 			continue;
-		if (physical_balance && i > cpu_sibling_map[i])
+		if (i != CPU_TO_PACKAGEINDEX(i))
 			continue;
 		if (max_cpu_irq <= CPU_IRQ(i)) 
 			continue;
@@ -551,9 +551,14 @@ tryanotherirq:
 	 * We seek the least loaded sibling by making the comparison
 	 * (A+B)/2 vs B
 	 */
-	if (physical_balance && (CPU_IRQ(min_loaded) >> 1) >
-					CPU_IRQ(cpu_sibling_map[min_loaded]))
-		min_loaded = cpu_sibling_map[min_loaded];
+	load = CPU_IRQ(min_loaded) >> 1;
+	for_each_cpu_mask(j, cpu_sibling_map[min_loaded]) {
+		if (load > CPU_IRQ(j)) {
+			/* This won't change cpu_sibling_map[min_loaded] */
+			load = CPU_IRQ(j);
+			min_loaded = j;
+		}
+	}
 
 	cpus_and(allowed_mask, cpu_online_map, irq_affinity[selected_irq]);
 	target_cpu_mask = cpumask_of_cpu(min_loaded);
@@ -848,7 +853,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
  * we need to reprogram the ioredtbls to cater for the cpus which have come online
  * so mask in all cases should simply be TARGET_CPUS
  */
-void __init setup_ioapic_dest(cpumask_t mask)
+void __init setup_ioapic_dest(void)
 {
 	int pin, ioapic, irq, irq_entry;
 
@@ -861,7 +866,7 @@ void __init setup_ioapic_dest(cpumask_t mask)
 			if (irq_entry == -1)
 				continue;
 			irq = pin_2_irq(irq_entry, ioapic, pin);
-			set_ioapic_affinity_irq(irq, mask);
+			set_ioapic_affinity_irq(irq, TARGET_CPUS);
 		}
 
 	}
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index ea69f2199..579b3282e 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -1117,8 +1117,8 @@ void init_irq_proc (void)
 
 
 #ifdef CONFIG_4KSTACKS
-static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE)));
-static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE)));
+static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
+static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
 
 /*
  * allocate per-cpu stacks for hardirq and for softirq processing
diff --git a/arch/i386/kernel/mca.c b/arch/i386/kernel/mca.c
index a03d36810..720365e46 100644
--- a/arch/i386/kernel/mca.c
+++ b/arch/i386/kernel/mca.c
@@ -258,16 +258,16 @@ static int __init mca_init(void)
 
 	/* Make sure the MCA bus is present */
 
-	if(!MCA_bus)
-		return -ENODEV;
-
-	printk(KERN_INFO "Micro Channel bus detected.\n");
-
-	if(mca_system_init()) {
+	if (mca_system_init()) {
 		printk(KERN_ERR "MCA bus system initialisation failed\n");
 		return -ENODEV;
 	}
 
+	if (!MCA_bus)
+		return -ENODEV;
+
+	printk(KERN_INFO "Micro Channel bus detected.\n");
+
 	/* All MCA systems have at least a primary bus */
 	bus = mca_attach_bus(MCA_PRIMARY_BUS);
 	if (!bus)
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index 553164fbf..198b17c7e 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -113,7 +113,7 @@ static spinlock_t microcode_update_lock = SPIN_LOCK_UNLOCKED;
 /* no concurrent ->write()s are allowed on /dev/cpu/microcode */
 static DECLARE_MUTEX(microcode_sem);
 
-static void *user_buffer;		/* user area microcode data buffer */
+static void __user *user_buffer;	/* user area microcode data buffer */
 static unsigned int user_buffer_size;	/* it's size */
 
 typedef enum mc_error_code {
@@ -425,7 +425,7 @@ out:
 	return error;
 }
 
-static ssize_t microcode_write (struct file *file, const char *buf, size_t len, loff_t *ppos)
+static ssize_t microcode_write (struct file *file, const char __user *buf, size_t len, loff_t *ppos)
 {
 	ssize_t ret;
 
@@ -441,7 +441,7 @@ static ssize_t microcode_write (struct file *file, const char *buf, size_t len,
 
 	down(&microcode_sem);
 
-	user_buffer = (void *) buf;
+	user_buffer = (void __user *) buf;
 	user_buffer_size = (int) len;
 
 	ret = do_microcode_update();
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 3e0c8a7bf..e8ed286c8 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -1029,6 +1029,8 @@ extern FADT_DESCRIPTOR acpi_fadt;
 
 #ifdef CONFIG_ACPI_PCI
 
+int (*platform_rename_gsi)(int ioapic, int gsi);
+
 void __init mp_parse_prt (void)
 {
 	struct list_head	*node = NULL;
@@ -1072,10 +1074,8 @@ void __init mp_parse_prt (void)
 			continue;
 		ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base;
 
-		if (es7000_plat) {
-			if (!ioapic && (gsi < 16))
-				gsi += 16;
-		}
+		if (platform_rename_gsi)
+			gsi = platform_rename_gsi(ioapic, gsi);
 
 		/* 
 		 * Avoid pin reprogramming.  PRTs typically include entries  
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index 3b326704d..1a1093e4a 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -46,234 +46,229 @@
 
 static inline int wrmsr_eio(u32 reg, u32 eax, u32 edx)
 {
-  int err;
-
-  asm volatile(
-	       "1:	wrmsr\n"
-	       "2:\n"
-	       ".section .fixup,\"ax\"\n"
-	       "3:	movl %4,%0\n"
-	       "	jmp 2b\n"
-	       ".previous\n"
-	       ".section __ex_table,\"a\"\n"
-	       "	.align 4\n"
-	       "	.long 1b,3b\n"
-	       ".previous"
-	       : "=&bDS" (err)
-	       : "a" (eax), "d" (edx), "c" (reg), "i" (-EIO), "0" (0));
-
-  return err;
+	int err;
+
+	asm volatile ("1:	wrmsr\n"
+		      "2:\n"
+		      ".section .fixup,\"ax\"\n"
+		      "3:	movl %4,%0\n"
+		      "	jmp 2b\n"
+		      ".previous\n"
+		      ".section __ex_table,\"a\"\n"
+		      "	.align 4\n" "	.long 1b,3b\n" ".previous":"=&bDS" (err)
+		      :"a"(eax), "d"(edx), "c"(reg), "i"(-EIO), "0"(0));
+
+	return err;
 }
 
 static inline int rdmsr_eio(u32 reg, u32 *eax, u32 *edx)
 {
-  int err;
-
-  asm volatile(
-	       "1:	rdmsr\n"
-	       "2:\n"
-	       ".section .fixup,\"ax\"\n"
-	       "3:	movl %4,%0\n"
-	       "	jmp 2b\n"
-	       ".previous\n"
-	       ".section __ex_table,\"a\"\n"
-	       "	.align 4\n"
-	       "	.long 1b,3b\n"
-	       ".previous"
-	       : "=&bDS" (err), "=a" (*eax), "=d" (*edx)
-	       : "c" (reg), "i" (-EIO), "0" (0));
-
-  return err;
+	int err;
+
+	asm volatile ("1:	rdmsr\n"
+		      "2:\n"
+		      ".section .fixup,\"ax\"\n"
+		      "3:	movl %4,%0\n"
+		      "	jmp 2b\n"
+		      ".previous\n"
+		      ".section __ex_table,\"a\"\n"
+		      "	.align 4\n"
+		      "	.long 1b,3b\n"
+		      ".previous":"=&bDS" (err), "=a"(*eax), "=d"(*edx)
+		      :"c"(reg), "i"(-EIO), "0"(0));
+
+	return err;
 }
 
 #ifdef CONFIG_SMP
 
 struct msr_command {
-  int cpu;
-  int err;
-  u32 reg;
-  u32 data[2];
+	int cpu;
+	int err;
+	u32 reg;
+	u32 data[2];
 };
 
 static void msr_smp_wrmsr(void *cmd_block)
 {
-  struct msr_command *cmd = (struct msr_command *) cmd_block;
-  
-  if ( cmd->cpu == smp_processor_id() )
-    cmd->err = wrmsr_eio(cmd->reg, cmd->data[0], cmd->data[1]);
+	struct msr_command *cmd = (struct msr_command *)cmd_block;
+
+	if (cmd->cpu == smp_processor_id())
+		cmd->err = wrmsr_eio(cmd->reg, cmd->data[0], cmd->data[1]);
 }
 
 static void msr_smp_rdmsr(void *cmd_block)
 {
-  struct msr_command *cmd = (struct msr_command *) cmd_block;
-  
-  if ( cmd->cpu == smp_processor_id() )
-    cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]);
+	struct msr_command *cmd = (struct msr_command *)cmd_block;
+
+	if (cmd->cpu == smp_processor_id())
+		cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]);
 }
 
 static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
 {
-  struct msr_command cmd;
-  int ret;
-
-  preempt_disable();
-  if ( cpu == smp_processor_id() ) {
-    ret = wrmsr_eio(reg, eax, edx);
-  } else {
-    cmd.cpu = cpu;
-    cmd.reg = reg;
-    cmd.data[0] = eax;
-    cmd.data[1] = edx;
-    
-    smp_call_function(msr_smp_wrmsr, &cmd, 1, 1);
-    ret = cmd.err;
-  }
-  preempt_enable();
-  return ret;
+	struct msr_command cmd;
+	int ret;
+
+	preempt_disable();
+	if (cpu == smp_processor_id()) {
+		ret = wrmsr_eio(reg, eax, edx);
+	} else {
+		cmd.cpu = cpu;
+		cmd.reg = reg;
+		cmd.data[0] = eax;
+		cmd.data[1] = edx;
+
+		smp_call_function(msr_smp_wrmsr, &cmd, 1, 1);
+		ret = cmd.err;
+	}
+	preempt_enable();
+	return ret;
 }
 
-static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx)
+static inline int do_rdmsr(int cpu, u32 reg, u32 * eax, u32 * edx)
 {
-  struct msr_command cmd;
-  int ret;
-
-  preempt_disable();
-  if ( cpu == smp_processor_id() ) {
-    ret = rdmsr_eio(reg, eax, edx);
-  } else {
-    cmd.cpu = cpu;
-    cmd.reg = reg;
-
-    smp_call_function(msr_smp_rdmsr, &cmd, 1, 1);
-    
-    *eax = cmd.data[0];
-    *edx = cmd.data[1];
-
-    ret = cmd.err;
-  }
-  preempt_enable();
-  return ret;
+	struct msr_command cmd;
+	int ret;
+
+	preempt_disable();
+	if (cpu == smp_processor_id()) {
+		ret = rdmsr_eio(reg, eax, edx);
+	} else {
+		cmd.cpu = cpu;
+		cmd.reg = reg;
+
+		smp_call_function(msr_smp_rdmsr, &cmd, 1, 1);
+
+		*eax = cmd.data[0];
+		*edx = cmd.data[1];
+
+		ret = cmd.err;
+	}
+	preempt_enable();
+	return ret;
 }
 
-#else /* ! CONFIG_SMP */
+#else				/* ! CONFIG_SMP */
 
 static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
 {
-  return wrmsr_eio(reg, eax, edx);
+	return wrmsr_eio(reg, eax, edx);
 }
 
 static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx)
 {
-  return rdmsr_eio(reg, eax, edx);
+	return rdmsr_eio(reg, eax, edx);
 }
 
-#endif /* ! CONFIG_SMP */
+#endif				/* ! CONFIG_SMP */
 
 static loff_t msr_seek(struct file *file, loff_t offset, int orig)
 {
-  loff_t ret = -EINVAL;
-  lock_kernel();
-  switch (orig) {
-  case 0:
-    file->f_pos = offset;
-    ret = file->f_pos;
-    break;
-  case 1:
-    file->f_pos += offset;
-    ret = file->f_pos;
-  }
-  unlock_kernel();
-  return ret;
+	loff_t ret = -EINVAL;
+
+	lock_kernel();
+	switch (orig) {
+	case 0:
+		file->f_pos = offset;
+		ret = file->f_pos;
+		break;
+	case 1:
+		file->f_pos += offset;
+		ret = file->f_pos;
+	}
+	unlock_kernel();
+	return ret;
 }
 
-static ssize_t msr_read(struct file * file, char __user * buf,
-			size_t count, loff_t *ppos)
+static ssize_t msr_read(struct file *file, char __user * buf,
+			size_t count, loff_t * ppos)
 {
-  u32 *tmp = (u32 *)buf;
-  u32 data[2];
-  size_t rv;
-  u32 reg = *ppos;
-  int cpu = iminor(file->f_dentry->d_inode);
-  int err;
-
-  if ( count % 8 )
-    return -EINVAL; /* Invalid chunk size */
-  
-  for ( rv = 0 ; count ; count -= 8 ) {
-    err = do_rdmsr(cpu, reg, &data[0], &data[1]);
-    if ( err )
-      return err;
-    if ( copy_to_user(tmp,&data,8) )
-      return -EFAULT;
-    tmp += 2;
-  }
-
-  return ((char *)tmp) - buf;
+	u32 __user *tmp = (u32 __user *) buf;
+	u32 data[2];
+	size_t rv;
+	u32 reg = *ppos;
+	int cpu = iminor(file->f_dentry->d_inode);
+	int err;
+
+	if (count % 8)
+		return -EINVAL;	/* Invalid chunk size */
+
+	for (rv = 0; count; count -= 8) {
+		err = do_rdmsr(cpu, reg, &data[0], &data[1]);
+		if (err)
+			return err;
+		if (copy_to_user(tmp, &data, 8))
+			return -EFAULT;
+		tmp += 2;
+	}
+
+	return ((char __user *)tmp) - buf;
 }
 
-static ssize_t msr_write(struct file * file, const char __user * buf,
+static ssize_t msr_write(struct file *file, const char __user *buf,
 			 size_t count, loff_t *ppos)
 {
-  const u32 *tmp = (const u32 *)buf;
-  u32 data[2];
-  size_t rv;
-  u32 reg = *ppos;
-  int cpu = iminor(file->f_dentry->d_inode);
-  int err;
-
-  if ( count % 8 )
-    return -EINVAL; /* Invalid chunk size */
-  
-  for ( rv = 0 ; count ; count -= 8 ) {
-    if ( copy_from_user(&data,tmp,8) )
-      return -EFAULT;
-    err = do_wrmsr(cpu, reg, data[0], data[1]);
-    if ( err )
-      return err;
-    tmp += 2;
-  }
-
-  return ((char *)tmp) - buf;
+	const u32 __user *tmp = (const u32 __user *)buf;
+	u32 data[2];
+	size_t rv;
+	u32 reg = *ppos;
+	int cpu = iminor(file->f_dentry->d_inode);
+	int err;
+
+	if (count % 8)
+		return -EINVAL;	/* Invalid chunk size */
+
+	for (rv = 0; count; count -= 8) {
+		if (copy_from_user(&data, tmp, 8))
+			return -EFAULT;
+		err = do_wrmsr(cpu, reg, data[0], data[1]);
+		if (err)
+			return err;
+		tmp += 2;
+	}
+
+	return ((char __user *)tmp) - buf;
 }
 
 static int msr_open(struct inode *inode, struct file *file)
 {
-  int cpu = iminor(file->f_dentry->d_inode);
-  struct cpuinfo_x86 *c = &(cpu_data)[cpu];
-  
-  if (!cpu_online(cpu))
-    return -ENXIO;		/* No such CPU */
-  if ( !cpu_has(c, X86_FEATURE_MSR) )
-    return -EIO;		/* MSR not supported */
-  
-  return 0;
+	unsigned int cpu = iminor(file->f_dentry->d_inode);
+	struct cpuinfo_x86 *c = &(cpu_data)[cpu];
+
+	if (cpu >= NR_CPUS || !cpu_online(cpu))
+		return -ENXIO;	/* No such CPU */
+	if (!cpu_has(c, X86_FEATURE_MSR))
+		return -EIO;	/* MSR not supported */
+
+	return 0;
 }
 
 /*
  * File operations we support
  */
 static struct file_operations msr_fops = {
-  .owner	= THIS_MODULE,
-  .llseek	= msr_seek,
-  .read		= msr_read,
-  .write	= msr_write,
-  .open		= msr_open,
+	.owner = THIS_MODULE,
+	.llseek = msr_seek,
+	.read = msr_read,
+	.write = msr_write,
+	.open = msr_open,
 };
 
 int __init msr_init(void)
 {
-  if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
-    printk(KERN_ERR "msr: unable to get major %d for msr\n",
-	   MSR_MAJOR);
-    return -EBUSY;
-  }
-  
-  return 0;
+	if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
+		printk(KERN_ERR "msr: unable to get major %d for msr\n",
+		       MSR_MAJOR);
+		return -EBUSY;
+	}
+
+	return 0;
 }
 
 void __exit msr_exit(void)
 {
-  unregister_chrdev(MSR_MAJOR, "cpu/msr");
+	unregister_chrdev(MSR_MAJOR, "cpu/msr");
 }
 
 module_init(msr_init);
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 70dd434e5..466ba2b62 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/nmi.h>
 #include <linux/sysdev.h>
+#include <linux/dump.h>
 
 #include <asm/smp.h>
 #include <asm/mtrr.h>
@@ -33,7 +34,8 @@
 
 unsigned int nmi_watchdog = NMI_NONE;
 static unsigned int nmi_hz = HZ;
-unsigned int nmi_perfctr_msr;	/* the MSR to reset in NMI handler */
+static unsigned int nmi_perfctr_msr;	/* the MSR to reset in NMI handler */
+static unsigned int nmi_p4_cccr_val;
 extern void show_registers(struct pt_regs *regs);
 
 /*
@@ -80,7 +82,8 @@ int nmi_active;
 #define P4_ESCR_EVENT_SELECT(N)	((N)<<25)
 #define P4_ESCR_OS		(1<<3)
 #define P4_ESCR_USR		(1<<2)
-#define P4_CCCR_OVF_PMI		(1<<26)
+#define P4_CCCR_OVF_PMI0	(1<<26)
+#define P4_CCCR_OVF_PMI1	(1<<27)
 #define P4_CCCR_THRESHOLD(N)	((N)<<20)
 #define P4_CCCR_COMPLEMENT	(1<<19)
 #define P4_CCCR_COMPARE		(1<<18)
@@ -93,7 +96,7 @@ int nmi_active;
 #define MSR_P4_IQ_COUNTER0	0x30C
 #define P4_NMI_CRU_ESCR0	(P4_ESCR_EVENT_SELECT(0x3F)|P4_ESCR_OS|P4_ESCR_USR)
 #define P4_NMI_IQ_CCCR0	\
-	(P4_CCCR_OVF_PMI|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT|	\
+	(P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT|	\
 	 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE)
 
 int __init check_nmi_watchdog (void)
@@ -364,6 +367,11 @@ static int setup_p4_watchdog(void)
 		return 0;
 
 	nmi_perfctr_msr = MSR_P4_IQ_COUNTER0;
+	nmi_p4_cccr_val = P4_NMI_IQ_CCCR0;
+#ifdef CONFIG_SMP
+	if (smp_num_siblings == 2)
+		nmi_p4_cccr_val |= P4_CCCR_OVF_PMI1;
+#endif
 
 	if (!(misc_enable & MSR_P4_MISC_ENABLE_PEBS_UNAVAIL))
 		clear_msr_range(0x3F1, 2);
@@ -381,7 +389,7 @@ static int setup_p4_watchdog(void)
 	Dprintk("setting P4_IQ_COUNTER0 to 0x%08lx\n", -(cpu_khz/nmi_hz*1000));
 	wrmsr(MSR_P4_IQ_COUNTER0, -(cpu_khz/nmi_hz*1000), -1);
 	apic_write(APIC_LVTPC, APIC_DM_NMI);
-	wrmsr(MSR_P4_IQ_CCCR0, P4_NMI_IQ_CCCR0, 0);
+	wrmsr(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val, 0);
 	return 1;
 }
 
@@ -479,6 +487,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
 			bust_spinlocks(1);
 			printk("NMI Watchdog detected LOCKUP on CPU%d, eip %08lx, registers:\n", cpu, regs->eip);
 			show_registers(regs);
+			dump("NMI Watchdog detected LOCKUP", regs);
 			printk("console shuts up ...\n");
 			console_silent();
 			spin_unlock(&nmi_print_lock);
@@ -498,7 +507,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
 			 * - LVTPC is masked on interrupt and must be
 			 *   unmasked by the LVTPC handler.
 			 */
-			wrmsr(MSR_P4_IQ_CCCR0, P4_NMI_IQ_CCCR0, 0);
+			wrmsr(MSR_P4_IQ_CCCR0, nmi_p4_cccr_val, 0);
 			apic_write(APIC_LVTPC, APIC_DM_NMI);
 		}
 		else if (nmi_perfctr_msr == MSR_P6_PERFCTR0) {
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 2e61c5d9a..de22204a7 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -202,6 +202,10 @@ static int __init idle_setup (char *str)
 	if (!strncmp(str, "poll", 4)) {
 		printk("using polling idle threads.\n");
 		pm_idle = poll_idle;
+#ifdef CONFIG_X86_SMP
+		if (smp_num_siblings > 1)
+			printk("WARNING: polling idle and HT enabled, performance may degrade.\n");
+#endif
 	} else if (!strncmp(str, "halt", 4)) {
 		printk("using halt in idle threads.\n");
 		pm_idle = default_idle;
@@ -633,11 +637,6 @@ out:
 	return error;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
 #define top_esp                (THREAD_SIZE - sizeof(unsigned long))
 #define top_ebp                (THREAD_SIZE - 2*sizeof(unsigned long))
 
@@ -658,14 +657,12 @@ unsigned long get_wchan(struct task_struct *p)
 		if (ebp < stack_page || ebp > top_ebp+stack_page)
 			return 0;
 		eip = *(unsigned long *) (ebp+4);
-		if (eip < first_sched || eip >= last_sched)
+		if (!in_sched_functions(eip))
 			return eip;
 		ebp = *(unsigned long *) ebp;
 	} while (count++ < 16);
 	return 0;
 }
-#undef last_sched
-#undef first_sched
 
 /*
  * sys_alloc_thread_area: get a yet unused TLS descriptor index.
@@ -744,7 +741,7 @@ asmlinkage int sys_set_thread_area(struct user_desc __user *u_info)
 	((desc)->a & 0x0ffff) | \
 	 ((desc)->b & 0xf0000) )
 	
-#define GET_32BIT(desc)		(((desc)->b >> 23) & 1)
+#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
 #define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
 #define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
 #define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 9f9b32a3f..0cf2f1187 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -174,7 +174,7 @@ ptrace_get_thread_area(struct task_struct *child,
 	((desc)->a & 0x0ffff) | \
 	 ((desc)->b & 0xf0000) )
 
-#define GET_32BIT(desc)		(((desc)->b >> 23) & 1)
+#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
 #define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
 #define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
 #define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
@@ -235,6 +235,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 	struct task_struct *child;
 	struct user * dummy = NULL;
 	int i, ret;
+	unsigned long __user *datap = (unsigned long __user *)data;
 
 	lock_kernel();
 	ret = -EPERM;
@@ -283,7 +284,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp, datap);
 		break;
 	}
 
@@ -305,7 +306,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 			addr = addr >> 2;
 			tmp = child->thread.debugreg[addr];
 		}
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp, datap);
 		break;
 	}
 
@@ -423,13 +424,13 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 		break;
 
 	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
-	  	if (!access_ok(VERIFY_WRITE, (unsigned *)data, FRAME_SIZE*sizeof(long))) {
+	  	if (!access_ok(VERIFY_WRITE, datap, FRAME_SIZE*sizeof(long))) {
 			ret = -EIO;
 			break;
 		}
 		for ( i = 0; i < FRAME_SIZE*sizeof(long); i += sizeof(long) ) {
-			__put_user(getreg(child, i),(unsigned long *) data);
-			data += sizeof(long);
+			__put_user(getreg(child, i), datap);
+			datap++;
 		}
 		ret = 0;
 		break;
@@ -437,21 +438,21 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 
 	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
 		unsigned long tmp;
-	  	if (!access_ok(VERIFY_READ, (unsigned *)data, FRAME_SIZE*sizeof(long))) {
+	  	if (!access_ok(VERIFY_READ, datap, FRAME_SIZE*sizeof(long))) {
 			ret = -EIO;
 			break;
 		}
 		for ( i = 0; i < FRAME_SIZE*sizeof(long); i += sizeof(long) ) {
-			__get_user(tmp, (unsigned long *) data);
+			__get_user(tmp, datap);
 			putreg(child, i, tmp);
-			data += sizeof(long);
+			datap++;
 		}
 		ret = 0;
 		break;
 	}
 
 	case PTRACE_GETFPREGS: { /* Get the child FPU state. */
-		if (!access_ok(VERIFY_WRITE, (unsigned *)data,
+		if (!access_ok(VERIFY_WRITE, datap,
 			       sizeof(struct user_i387_struct))) {
 			ret = -EIO;
 			break;
@@ -464,7 +465,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 	}
 
 	case PTRACE_SETFPREGS: { /* Set the child FPU state. */
-		if (!access_ok(VERIFY_READ, (unsigned *)data,
+		if (!access_ok(VERIFY_READ, datap,
 			       sizeof(struct user_i387_struct))) {
 			ret = -EIO;
 			break;
@@ -476,7 +477,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 	}
 
 	case PTRACE_GETFPXREGS: { /* Get the child extended FPU state. */
-		if (!access_ok(VERIFY_WRITE, (unsigned *)data,
+		if (!access_ok(VERIFY_WRITE, datap,
 			       sizeof(struct user_fxsr_struct))) {
 			ret = -EIO;
 			break;
@@ -488,7 +489,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 	}
 
 	case PTRACE_SETFPXREGS: { /* Set the child extended FPU state. */
-		if (!access_ok(VERIFY_READ, (unsigned *)data,
+		if (!access_ok(VERIFY_READ, datap,
 			       sizeof(struct user_fxsr_struct))) {
 			ret = -EIO;
 			break;
@@ -499,13 +500,13 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 	}
 
 	case PTRACE_GET_THREAD_AREA:
-		ret = ptrace_get_thread_area(child,
-					     addr, (struct user_desc __user *) data);
+		ret = ptrace_get_thread_area(child, addr,
+					(struct user_desc __user *) data);
 		break;
 
 	case PTRACE_SET_THREAD_AREA:
-		ret = ptrace_set_thread_area(child,
-					     addr, (struct user_desc __user *) data);
+		ret = ptrace_set_thread_area(child, addr,
+					(struct user_desc __user *) data);
 		break;
 
 	default:
diff --git a/arch/i386/kernel/scx200.c b/arch/i386/kernel/scx200.c
index 340e7f39a..22a2fe2f8 100644
--- a/arch/i386/kernel/scx200.c
+++ b/arch/i386/kernel/scx200.c
@@ -86,7 +86,10 @@ int __init scx200_init(void)
 
 	if ((bridge = pci_find_device(PCI_VENDOR_ID_NS, 
 				      PCI_DEVICE_ID_NS_SCx200_BRIDGE,
-				      NULL)) == NULL)
+				      NULL)) == NULL
+	    && (bridge = pci_find_device(PCI_VENDOR_ID_NS,
+					 PCI_DEVICE_ID_NS_SC1100_BRIDGE,
+					 NULL)) == NULL)
 		return -ENODEV;
 
 	base = pci_resource_start(bridge, 0);
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 938ec130f..5f06850be 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -65,6 +65,7 @@ static inline char * __init machine_specific_memory_setup(void);
 
 #ifdef CONFIG_EFI
 int efi_enabled = 0;
+EXPORT_SYMBOL(efi_enabled);
 #endif
 
 /* cpu data as detected by the assembly code in head.S */
@@ -471,6 +472,7 @@ static void __init setup_memory_region(void)
 	print_memory_map(who);
 } /* setup_memory_region */
 
+unsigned long crashdump_addr = 0xdeadbeef;
 
 static void __init parse_cmdline_early (char ** cmdline_p)
 {
@@ -625,6 +627,9 @@ static void __init parse_cmdline_early (char ** cmdline_p)
 		if (c == ' ' && !memcmp(from, "highmem=", 8))
 			highmem_pages = memparse(from+8, &from) >> PAGE_SHIFT;
 	
+		if (c == ' ' && !memcmp(from, "crashdump=", 10))
+			crashdump_addr = memparse(from+10, &from); 
+			
 		c = *(from++);
 		if (!c)
 			break;
@@ -1072,6 +1077,10 @@ static int __init noreplacement_setup(char *s)
 
 __setup("noreplacement", noreplacement_setup); 
 
+#ifdef CONFIG_CRASH_DUMP_SOFTBOOT
+extern void crashdump_reserve(void);
+#endif
+
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
@@ -1166,6 +1175,10 @@ void __init setup_arch(char **cmdline_p)
 #endif
 
 
+#ifdef CONFIG_CRASH_DUMP_SOFTBOOT
+	crashdump_reserve(); /* Preserve crash dump state from prev boot */
+#endif
+
 	dmi_scan_machine();
 
 #ifdef CONFIG_X86_GENERICARCH
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index aa242e932..c23188191 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -231,7 +231,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long __unused)
 	struct pt_regs *regs = (struct pt_regs *) &__unused;
 	struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(regs->esp - 4);
 	sigset_t set;
-	stack_t st;
 	int eax;
 
 	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
@@ -248,16 +247,8 @@ asmlinkage int sys_rt_sigreturn(unsigned long __unused)
 	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax))
 		goto badframe;
 
-	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
+	if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->esp) == -EFAULT)
 		goto badframe;
-	/* It is more difficult to avoid calling this function than to
-	   call it and ignore errors.  */
-	/*
-	 * THIS CANNOT WORK! "&st" is a kernel address, and "do_sigaltstack()"
-	 * takes a user address (and verifies that it is a user address). End
-	 * result: it does exactly _nothing_.
-	 */
-	do_sigaltstack(&st, NULL, regs->esp);
 
 	return eax;
 
@@ -278,12 +269,12 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate,
 
 	tmp = 0;
 	__asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->gs);
+	err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
 	__asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->fs);
+	err |= __put_user(tmp, (unsigned int __user *)&sc->fs);
 
-	err |= __put_user(regs->xes, (unsigned int *)&sc->es);
-	err |= __put_user(regs->xds, (unsigned int *)&sc->ds);
+	err |= __put_user(regs->xes, (unsigned int __user *)&sc->es);
+	err |= __put_user(regs->xds, (unsigned int __user *)&sc->ds);
 	err |= __put_user(regs->edi, &sc->edi);
 	err |= __put_user(regs->esi, &sc->esi);
 	err |= __put_user(regs->ebp, &sc->ebp);
@@ -295,10 +286,10 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate,
 	err |= __put_user(current->thread.trap_no, &sc->trapno);
 	err |= __put_user(current->thread.error_code, &sc->err);
 	err |= __put_user(regs->eip, &sc->eip);
-	err |= __put_user(regs->xcs, (unsigned int *)&sc->cs);
+	err |= __put_user(regs->xcs, (unsigned int __user *)&sc->cs);
 	err |= __put_user(regs->eflags, &sc->eflags);
 	err |= __put_user(regs->esp, &sc->esp_at_signal);
-	err |= __put_user(regs->xss, (unsigned int *)&sc->ss);
+	err |= __put_user(regs->xss, (unsigned int __user *)&sc->ss);
 
 	tmp = save_i387(fpstate);
 	if (tmp < 0)
@@ -390,9 +381,9 @@ static void setup_frame(int sig, struct k_sigaction *ka,
 	 * reasons and because gdb uses it as a signature to notice
 	 * signal handler stack frames.
 	 */
-	err |= __put_user(0xb858, (short *)(frame->retcode+0));
-	err |= __put_user(__NR_sigreturn, (int *)(frame->retcode+2));
-	err |= __put_user(0x80cd, (short *)(frame->retcode+6));
+	err |= __put_user(0xb858, (short __user *)(frame->retcode+0));
+	err |= __put_user(__NR_sigreturn, (int __user *)(frame->retcode+2));
+	err |= __put_user(0x80cd, (short __user *)(frame->retcode+6));
 
 	if (err)
 		goto give_sigsegv;
@@ -471,9 +462,9 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 	 * reasons and because gdb uses it as a signature to notice
 	 * signal handler stack frames.
 	 */
-	err |= __put_user(0xb8, (char *)(frame->retcode+0));
-	err |= __put_user(__NR_rt_sigreturn, (int *)(frame->retcode+1));
-	err |= __put_user(0x80cd, (short *)(frame->retcode+5));
+	err |= __put_user(0xb8, (char __user *)(frame->retcode+0));
+	err |= __put_user(__NR_rt_sigreturn, (int __user *)(frame->retcode+1));
+	err |= __put_user(0x80cd, (short __user *)(frame->retcode+5));
 
 	if (err)
 		goto give_sigsegv;
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c
index 9f7987a6c..4670b0b80 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/i386/kernel/smp.c
@@ -19,6 +19,7 @@
 #include <linux/mc146818rtc.h>
 #include <linux/cache.h>
 #include <linux/interrupt.h>
+#include <linux/dump.h>
 
 #include <asm/mtrr.h>
 #include <asm/pgalloc.h>
@@ -144,6 +145,13 @@ inline void __send_IPI_shortcut(unsigned int shortcut, int vector)
 	 */
 	cfg = __prepare_ICR(shortcut, vector);
 
+	if (vector == DUMP_VECTOR) {
+		/*
+		 * Setup DUMP IPI to be delivered as an NMI
+		 */
+		cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
+	}
+
 	/*
 	 * Send the IPI. The write to APIC_ICR fires this off.
 	 */
@@ -221,7 +229,13 @@ inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
 			 * program the ICR 
 			 */
 			cfg = __prepare_ICR(0, vector);
-			
+		
+			if (vector == DUMP_VECTOR) {
+				/*
+				 * Setup DUMP IPI to be delivered as an NMI
+				 */
+				cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
+			}	
 			/*
 			 * Send the IPI. The write to APIC_ICR fires this off.
 			 */
@@ -467,6 +481,11 @@ void flush_tlb_all(void)
 	on_each_cpu(do_flush_tlb_all, 0, 1, 1);
 }
 
+void dump_send_ipi(void)
+{
+	send_IPI_allbutself(DUMP_VECTOR);
+}
+
 /*
  * this function sends a 'reschedule' IPI to another CPU.
  * it goes straight through and wastes no time serializing
@@ -519,6 +538,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	if (!cpus)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.started, 0);
@@ -545,7 +567,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	return 0;
 }
 
-static void stop_this_cpu (void * dummy)
+void stop_this_cpu (void * dummy)
 {
 	/*
 	 * Remove this CPU:
@@ -571,6 +593,8 @@ void smp_send_stop(void)
 	local_irq_enable();
 }
 
+EXPORT_SYMBOL(smp_send_stop);
+
 /*
  * Reschedule call back. Nothing to do,
  * all the work is done automatically when
@@ -606,4 +630,3 @@ asmlinkage void smp_call_function_interrupt(void)
 		atomic_inc(&call_data->finished);
 	}
 }
-
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 7baa4d420..45e8fbab3 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -39,6 +39,7 @@
 #include <linux/kernel.h>
 
 #include <linux/mm.h>
+#include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <linux/smp_lock.h>
 #include <linux/irq.h>
@@ -936,7 +937,7 @@ static int boot_cpu_logical_apicid;
 /* Where the IO area was mapped on multiquad, always 0 otherwise */
 void *xquad_portio;
 
-int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
 
 static void __init smp_boot_cpus(unsigned int max_cpus)
 {
@@ -955,6 +956,8 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
 
 	current_thread_info()->cpu = 0;
 	smp_tune_scheduling();
+	cpus_clear(cpu_sibling_map[0]);
+	cpu_set(0, cpu_sibling_map[0]);
 
 	/*
 	 * If we couldn't find an SMP configuration at boot time,
@@ -1081,34 +1084,39 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
 	Dprintk("Boot done.\n");
 
 	/*
-	 * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
-	 * that we can tell the sibling CPU efficiently.
+	 * construct cpu_sibling_map[], so that we can tell sibling CPUs
+	 * efficiently.
 	 */
-	if (cpu_has_ht && smp_num_siblings > 1) {
-		for (cpu = 0; cpu < NR_CPUS; cpu++)
-			cpu_sibling_map[cpu] = NO_PROC_ID;
-		
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			int 	i;
-			if (!cpu_isset(cpu, cpu_callout_map))
-				continue;
+	for (cpu = 0; cpu < NR_CPUS; cpu++)
+		cpus_clear(cpu_sibling_map[cpu]);
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		int siblings = 0;
+		int i;
+		if (!cpu_isset(cpu, cpu_callout_map))
+			continue;
 
+		if (smp_num_siblings > 1) {
 			for (i = 0; i < NR_CPUS; i++) {
-				if (i == cpu || !cpu_isset(i, cpu_callout_map))
+				if (!cpu_isset(i, cpu_callout_map))
 					continue;
 				if (phys_proc_id[cpu] == phys_proc_id[i]) {
-					cpu_sibling_map[cpu] = i;
-					printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
-					break;
+					siblings++;
+					cpu_set(i, cpu_sibling_map[cpu]);
 				}
 			}
-			if (cpu_sibling_map[cpu] == NO_PROC_ID) {
-				smp_num_siblings = 1;
-				printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
-			}
+		} else {
+			siblings++;
+			cpu_set(cpu, cpu_sibling_map[cpu]);
 		}
+
+		if (siblings != smp_num_siblings)
+			printk(KERN_WARNING "WARNING: %d siblings found for CPU%d, should be %d\n", siblings, cpu, smp_num_siblings);
 	}
 
+	if (nmi_watchdog == NMI_LOCAL_APIC)
+		check_nmi_watchdog();
+
 	smpboot_setup_io_apic();
 
 	setup_boot_APIC_clock();
@@ -1120,6 +1128,209 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
 		synchronize_tsc_bp();
 }
 
+#ifdef CONFIG_SCHED_SMT
+#ifdef CONFIG_NUMA
+static struct sched_group sched_group_cpus[NR_CPUS];
+static struct sched_group sched_group_phys[NR_CPUS];
+static struct sched_group sched_group_nodes[MAX_NUMNODES];
+static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
+static DEFINE_PER_CPU(struct sched_domain, phys_domains);
+static DEFINE_PER_CPU(struct sched_domain, node_domains);
+__init void arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first = NULL, *last = NULL;
+
+	/* Set up domains */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+		struct sched_domain *node_domain = &per_cpu(node_domains, i);
+		int node = cpu_to_node(i);
+		cpumask_t nodemask = node_to_cpumask(node);
+
+		*cpu_domain = SD_SIBLING_INIT;
+		cpu_domain->span = cpu_sibling_map[i];
+		cpu_domain->parent = phys_domain;
+		cpu_domain->groups = &sched_group_cpus[i];
+
+		*phys_domain = SD_CPU_INIT;
+		phys_domain->span = nodemask;
+		phys_domain->parent = node_domain;
+		phys_domain->groups = &sched_group_phys[first_cpu(cpu_domain->span)];
+
+		*node_domain = SD_NODE_INIT;
+		node_domain->span = cpu_possible_map;
+		node_domain->groups = &sched_group_nodes[cpu_to_node(i)];
+	}
+
+	/* Set up CPU (sibling) groups */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		int j;
+		first = last = NULL;
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		for_each_cpu_mask(j, cpu_domain->span) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpu->cpumask = CPU_MASK_NONE;
+			cpu_set(j, cpu->cpumask);
+			cpu->cpu_power = SCHED_LOAD_SCALE;
+
+			if (!first)
+				first = cpu;
+			if (last)
+				last->next = cpu;
+			last = cpu;
+		}
+		last->next = first;
+	}
+
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		int j;
+		cpumask_t nodemask;
+		struct sched_group *node = &sched_group_nodes[i];
+		cpus_and(nodemask, node_to_cpumask(i), cpu_possible_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		first = last = NULL;
+		/* Set up physical groups */
+		for_each_cpu_mask(j, nodemask) {
+			struct sched_domain *cpu_domain = &per_cpu(cpu_domains, j);
+			struct sched_group *cpu = &sched_group_phys[j];
+
+			if (j != first_cpu(cpu_domain->span))
+				continue;
+
+			cpu->cpumask = cpu_domain->span;
+			/*
+			 * Make each extra sibling increase power by 10% of
+			 * the basic CPU. This is very arbitrary.
+			 */
+			cpu->cpu_power = SCHED_LOAD_SCALE + SCHED_LOAD_SCALE*(cpus_weight(cpu->cpumask)-1) / 10;
+			node->cpu_power += cpu->cpu_power;
+
+			if (!first)
+				first = cpu;
+			if (last)
+				last->next = cpu;
+			last = cpu;
+		}
+		last->next = first;
+	}
+
+	/* Set up nodes */
+	first = last = NULL;
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		struct sched_group *cpu = &sched_group_nodes[i];
+		cpumask_t nodemask;
+		cpus_and(nodemask, node_to_cpumask(i), cpu_possible_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		cpu->cpumask = nodemask;
+		/* ->cpu_power already setup */
+
+		if (!first)
+			first = cpu;
+		if (last)
+			last->next = cpu;
+		last = cpu;
+	}
+	last->next = first;
+
+	mb();
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		cpu_attach_domain(cpu_domain, i);
+	}
+}
+#else /* !CONFIG_NUMA */
+static struct sched_group sched_group_cpus[NR_CPUS];
+static struct sched_group sched_group_phys[NR_CPUS];
+static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
+static DEFINE_PER_CPU(struct sched_domain, phys_domains);
+__init void arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first = NULL, *last = NULL;
+
+	/* Set up domains */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+
+		*cpu_domain = SD_SIBLING_INIT;
+		cpu_domain->span = cpu_sibling_map[i];
+		cpu_domain->parent = phys_domain;
+		cpu_domain->groups = &sched_group_cpus[i];
+
+		*phys_domain = SD_CPU_INIT;
+		phys_domain->span = cpu_possible_map;
+		phys_domain->groups = &sched_group_phys[first_cpu(cpu_domain->span)];
+	}
+
+	/* Set up CPU (sibling) groups */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		int j;
+		first = last = NULL;
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		for_each_cpu_mask(j, cpu_domain->span) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpus_clear(cpu->cpumask);
+			cpu_set(j, cpu->cpumask);
+			cpu->cpu_power = SCHED_LOAD_SCALE;
+
+			if (!first)
+				first = cpu;
+			if (last)
+				last->next = cpu;
+			last = cpu;
+		}
+		last->next = first;
+	}
+
+	first = last = NULL;
+	/* Set up physical groups */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		struct sched_group *cpu = &sched_group_phys[i];
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		cpu->cpumask = cpu_domain->span;
+		/* See SMT+NUMA setup for comment */
+		cpu->cpu_power = SCHED_LOAD_SCALE + SCHED_LOAD_SCALE*(cpus_weight(cpu->cpumask)-1) / 10;
+
+		if (!first)
+			first = cpu;
+		if (last)
+			last->next = cpu;
+		last = cpu;
+	}
+	last->next = first;
+
+	mb();
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		cpu_attach_domain(cpu_domain, i);
+	}
+}
+#endif /* CONFIG_NUMA */
+#endif /* CONFIG_SCHED_SMT */
+
 /* These are wrappers to interface to the new boot process.  Someone
    who understands all this stuff should rewrite it properly. --RR 15/Jul/02 */
 void __init smp_prepare_cpus(unsigned int max_cpus)
@@ -1158,8 +1369,7 @@ int __devinit __cpu_up(unsigned int cpu)
 void __init smp_cpus_done(unsigned int max_cpus)
 {
 #ifdef CONFIG_X86_IO_APIC
-	cpumask_t targets = CPU_MASK_ALL;
-	setup_ioapic_dest(targets);
+	setup_ioapic_dest();
 #endif
 	zap_low_mappings();
 }
diff --git a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c
index 9f80757d1..34f1f3d1c 100644
--- a/arch/i386/kernel/timers/timer_cyclone.c
+++ b/arch/i386/kernel/timers/timer_cyclone.c
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/fixmap.h>
+#include "io_ports.h"
 
 extern spinlock_t i8253_lock;
 
@@ -62,6 +63,17 @@ static void mark_offset_cyclone(void)
 
 	count = inb_p(0x40);    /* read the latched count */
 	count |= inb(0x40) << 8;
+
+	/*
+	 * VIA686a test code... reset the latch if count > max + 1
+	 * from timer_pit.c - cjb
+	 */
+	if (count > LATCH) {
+		outb_p(0x34, PIT_MODE);
+		outb_p(LATCH & 0xff, PIT_CH0);
+		outb(LATCH >> 8, PIT_CH0);
+		count = LATCH - 1;
+	}
 	spin_unlock(&i8253_lock);
 
 	/* lost tick compensation */
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 907d2efa6..b20fe4dc1 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -27,6 +27,8 @@ static unsigned long hpet_last;
 struct timer_opts timer_tsc;
 #endif
 
+static inline void cpufreq_delayed_get(void);
+
 int tsc_disable __initdata = 0;
 
 extern spinlock_t i8253_lock;
@@ -241,6 +243,9 @@ static void mark_offset_tsc(void)
 
 			clock_fallback();
 		}
+		/* ... but give the TSC a fair chance */
+		if (lost_count > 25)
+			cpufreq_delayed_get();
 	} else
 		lost_count = 0;
 	/* update the monotonic base value */
@@ -324,15 +329,40 @@ static void mark_offset_tsc_hpet(void)
 
 
 #ifdef CONFIG_CPU_FREQ
+#include <linux/workqueue.h>
+
+static unsigned int cpufreq_delayed_issched = 0;
+static unsigned int cpufreq_init = 0;
+static struct work_struct cpufreq_delayed_get_work;
+
+static void handle_cpufreq_delayed_get(void *v)
+{
+	unsigned int cpu;
+	for_each_online_cpu(cpu) {
+		cpufreq_get(cpu);
+	}
+	cpufreq_delayed_issched = 0;
+}
+
+/* if we notice lost ticks, schedule a call to cpufreq_get() as it tries
+ * to verify the CPU frequency the timing core thinks the CPU is running
+ * at is still correct.
+ */
+static inline void cpufreq_delayed_get(void) 
+{
+	if (cpufreq_init && !cpufreq_delayed_issched) {
+		cpufreq_delayed_issched = 1;
+		printk(KERN_DEBUG "Losing some ticks... checking if CPU frequency changed.\n");
+		schedule_work(&cpufreq_delayed_get_work);
+	}
+}
+
 /* If the CPU frequency is scaled, TSC-based delays will need a different
- * loops_per_jiffy value to function properly. An exception to this
- * are modern Intel Pentium 4 processors, where the TSC runs at a constant
- * speed independent of frequency scaling. 
+ * loops_per_jiffy value to function properly.
  */
 
 static unsigned int  ref_freq = 0;
 static unsigned long loops_per_jiffy_ref = 0;
-static unsigned int  variable_tsc = 1;
 
 #ifndef CONFIG_SMP
 static unsigned long fast_gettimeoffset_ref = 0;
@@ -356,14 +386,15 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 	}
 
 	if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
-	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
-		if (variable_tsc)
+	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+	    (val == CPUFREQ_RESUMECHANGE)) {
+		if (!(freq->flags & CPUFREQ_CONST_LOOPS))
 			cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
 #ifndef CONFIG_SMP
 		if (cpu_khz)
 			cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new);
 		if (use_tsc) {
-			if (variable_tsc) {
+			if (!(freq->flags & CPUFREQ_CONST_LOOPS)) {
 				fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
 				set_cyc2ns_scale(cpu_khz/1000);
 			}
@@ -382,14 +413,17 @@ static struct notifier_block time_cpufreq_notifier_block = {
 
 static int __init cpufreq_tsc(void)
 {
-	/* P4 and above CPU TSC freq doesn't change when CPU frequency changes*/
-	if ((boot_cpu_data.x86 >= 15) && (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
-		variable_tsc = 0;
-
-	return cpufreq_register_notifier(&time_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+	int ret;
+	INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get, NULL);
+	ret = cpufreq_register_notifier(&time_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+	if (!ret)
+		cpufreq_init = 1;
+	return ret;
 }
 core_initcall(cpufreq_tsc);
 
+#else /* CONFIG_CPU_FREQ */
+static inline void cpufreq_delayed_get(void) { return; }
 #endif 
 
 
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index c770d878c..1679aca67 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -26,6 +26,7 @@
 #include <linux/kallsyms.h>
 #include <linux/ptrace.h>
 #include <linux/version.h>
+#include <linux/dump.h>
 
 #ifdef CONFIG_EISA
 #include <linux/ioport.h>
@@ -94,27 +95,70 @@ asmlinkage void machine_check(void);
 
 static int kstack_depth_to_print = 24;
 
-void show_trace(struct task_struct *task, unsigned long * stack)
+static int valid_stack_ptr(struct task_struct *task, void *p)
+{
+	if (p <= (void *)task->thread_info)
+		return 0;
+	if (kstack_end(p))
+		return 0;
+	return 1;
+}
+
+#ifdef CONFIG_FRAME_POINTER
+void print_context_stack(struct task_struct *task, unsigned long *stack,
+			 unsigned long ebp)
 {
 	unsigned long addr;
 
-	if (!stack)
-		stack = (unsigned long*)&stack;
+	while (valid_stack_ptr(task, (void *)ebp)) {
+		addr = *(unsigned long *)(ebp + 4);
+		printk(" [<%08lx>] ", addr);
+		print_symbol("%s", addr);
+		printk("\n");
+		ebp = *(unsigned long *)ebp;
+	}
+}
+#else
+void print_context_stack(struct task_struct *task, unsigned long *stack,
+			 unsigned long ebp)
+{
+	unsigned long addr;
 
-	printk("Call Trace:");
-#ifdef CONFIG_KALLSYMS
-	printk("\n");
+	while (!kstack_end(stack)) {
+		addr = *stack++;
+		if (kernel_text_address(addr)) {
+			printk(" [<%08lx>] ", addr);
+			print_symbol("%s\n", addr);
+		}
+	}
+}
 #endif
+
+void show_trace(struct task_struct *task, unsigned long * stack)
+{
+	unsigned long ebp;
+
+	if (!task)
+		task = current;
+
+	if (!valid_stack_ptr(task, stack)) {
+		printk("Stack pointer is garbage, not printing trace\n");
+		return;
+	}
+
+	if (task == current) {
+		/* Grab ebp right from our regs */
+		asm ("movl %%ebp, %0" : "=r" (ebp) : );
+	} else {
+		/* ebp is the last reg pushed by switch_to */
+		ebp = *(unsigned long *) task->thread.esp;
+	}
+
 	while (1) {
 		struct thread_info *context;
-		context = (struct thread_info*) ((unsigned long)stack & (~(THREAD_SIZE - 1)));
-		while (!kstack_end(stack)) {
-			addr = *stack++;
-			if (kernel_text_address(addr)) {
-				printk(" [<%08lx>] ", addr);
-				print_symbol("%s\n", addr);
-			}
-		}
+		context = (struct thread_info *)
+			((unsigned long)stack & (~(THREAD_SIZE - 1)));
+		print_context_stack(task, stack, ebp);
 		stack = (unsigned long*)context->previous_esp;
 		if (!stack)
 			break;
@@ -143,7 +187,7 @@ void show_stack(struct task_struct *task, unsigned long *esp)
 			printk("\n       ");
 		printk("%08lx ", *stack++);
 	}
-	printk("\n");
+	printk("\nCall Trace:\n");
 	show_trace(task, esp);
 }
 
@@ -240,7 +284,7 @@ static void handle_BUG(struct pt_regs *regs)
 		file = "<bad filename>";
 
 	printk("------------[ cut here ]------------\n");
-	printk("kernel BUG at %s:%d!\n", file, line);
+	printk(KERN_ALERT "kernel BUG at %s:%d!\n", file, line);
 
 no_bug:
 	return;
@@ -261,7 +305,7 @@ void die(const char * str, struct pt_regs * regs, long err)
 	spin_lock_irq(&die_lock);
 	bust_spinlocks(1);
 	handle_BUG(regs);
-	printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
+	printk(KERN_ALERT "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
 #ifdef CONFIG_PREEMPT
 	printk("PREEMPT ");
 	nl = 1;
@@ -277,6 +321,7 @@ void die(const char * str, struct pt_regs * regs, long err)
 	if (nl)
 		printk("\n");
 	show_registers(regs);
+	dump((char *)str, regs);
 	bust_spinlocks(0);
 	spin_unlock_irq(&die_lock);
 	if (in_interrupt())
diff --git a/arch/i386/lib/getuser.S b/arch/i386/lib/getuser.S
index 3814c2419..62d7f178a 100644
--- a/arch/i386/lib/getuser.S
+++ b/arch/i386/lib/getuser.S
@@ -28,7 +28,7 @@
 .globl __get_user_1
 __get_user_1:
 	GET_THREAD_INFO(%edx)
-	cmpl TI_ADDR_LIMIT(%edx),%eax
+	cmpl TI_addr_limit(%edx),%eax
 	jae bad_get_user
 1:	movzbl (%eax),%edx
 	xorl %eax,%eax
@@ -40,7 +40,7 @@ __get_user_2:
 	addl $1,%eax
 	jc bad_get_user
 	GET_THREAD_INFO(%edx)
-	cmpl TI_ADDR_LIMIT(%edx),%eax
+	cmpl TI_addr_limit(%edx),%eax
 	jae bad_get_user
 2:	movzwl -1(%eax),%edx
 	xorl %eax,%eax
@@ -52,7 +52,7 @@ __get_user_4:
 	addl $3,%eax
 	jc bad_get_user
 	GET_THREAD_INFO(%edx)
-	cmpl TI_ADDR_LIMIT(%edx),%eax
+	cmpl TI_addr_limit(%edx),%eax
 	jae bad_get_user
 3:	movl -3(%eax),%edx
 	xorl %eax,%eax
diff --git a/arch/i386/mach-default/topology.c b/arch/i386/mach-default/topology.c
index e96d8910a..c70547a7e 100644
--- a/arch/i386/mach-default/topology.c
+++ b/arch/i386/mach-default/topology.c
@@ -41,8 +41,10 @@ static int __init topology_init(void)
 {
 	int i;
 
-	for (i = 0; i < num_online_nodes(); i++)
-		arch_register_node(i);
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		if (node_online(i))
+			arch_register_node(i);
+	}
 	for (i = 0; i < NR_CPUS; i++)
 		if (cpu_possible(i)) arch_register_cpu(i);
 	return 0;
diff --git a/arch/i386/mach-es7000/Makefile b/arch/i386/mach-es7000/Makefile
index 2873e2b4b..69dd4da21 100644
--- a/arch/i386/mach-es7000/Makefile
+++ b/arch/i386/mach-es7000/Makefile
@@ -2,4 +2,5 @@
 # Makefile for the linux kernel.
 #
 
-obj-y		:= setup.o topology.o es7000.o
+obj-$(CONFIG_X86_ES7000)	:= es7000plat.o
+obj-$(CONFIG_X86_GENERICARCH)	:= es7000plat.o
diff --git a/arch/i386/mach-es7000/es7000.h b/arch/i386/mach-es7000/es7000.h
index ec6dea5d4..1cb878fc5 100644
--- a/arch/i386/mach-es7000/es7000.h
+++ b/arch/i386/mach-es7000/es7000.h
@@ -30,6 +30,7 @@
 #define	MIP_BUSY		1
 #define	MIP_SPIN		0xf0000
 #define	MIP_VALID		0x0100000000000000
+#define	MIP_PORT(VALUE)	((VALUE >> 32) & 0xffff)
 
 #define	MIP_RD_LO(VALUE)	(VALUE & 0xffffffff)   
 
@@ -103,7 +104,7 @@ struct mip_reg {
 #define	MIP_SW_APIC		0x1020b
 #define	MIP_FUNC(VALUE) 	(VALUE & 0xff)
 
-extern void parse_unisys_oem (char *oemptr, int oem_entries);
+extern int parse_unisys_oem (char *oemptr, int oem_entries);
 extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length);
 extern int es7000_start_cpu(int cpu, unsigned long eip);
 extern void es7000_sw_apic(void);
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c
index 70db26443..784576c53 100644
--- a/arch/i386/mach-es7000/es7000plat.c
+++ b/arch/i386/mach-es7000/es7000plat.c
@@ -50,7 +50,6 @@ struct mip_reg		*mip_reg;
 struct mip_reg		*host_reg;
 int 			mip_port;
 unsigned long		mip_addr, host_addr;
-extern int (*platform_rename_gsi)();
 
 static int __init
 es7000_rename_gsi(int ioapic, int gsi)
@@ -134,7 +133,6 @@ parse_unisys_oem (char *oemptr, int oem_entries)
 	}
 
 	if (success < 2) {
-		printk("\nNo ES7000 found.\n");
 		es7000_plat = 0;
 	} else {
 		printk("\nEnabling ES7000 specific features...\n");
diff --git a/arch/i386/mach-generic/Makefile b/arch/i386/mach-generic/Makefile
index 07bfdcbd9..77fbc9f64 100644
--- a/arch/i386/mach-generic/Makefile
+++ b/arch/i386/mach-generic/Makefile
@@ -4,15 +4,4 @@
 
 EXTRA_CFLAGS	+= -I../kernel
 
-obj-y				:= probe.o summit.o bigsmp.o default.o
-
-
-#
-# Makefile for the generic architecture
-#
-
-EXTRA_CFLAGS	+= -I../kernel
-
-obj-y				:= probe.o summit.o bigsmp.o default.o
-
-
+obj-y				:= probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c
index fdb25423c..5497c65a8 100644
--- a/arch/i386/mach-generic/probe.c
+++ b/arch/i386/mach-generic/probe.c
@@ -17,6 +17,7 @@
 
 extern struct genapic apic_summit;
 extern struct genapic apic_bigsmp;
+extern struct genapic apic_es7000;
 extern struct genapic apic_default;
 
 struct genapic *genapic = &apic_default;
@@ -24,6 +25,7 @@ struct genapic *genapic = &apic_default;
 struct genapic *apic_probe[] __initdata = { 
 	&apic_summit,
 	&apic_bigsmp, 
+	&apic_es7000,
 	&apic_default,	/* must be last */
 	NULL,
 };
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index d7054f4ec..2bdc18fff 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -1106,6 +1106,9 @@ smp_call_function (void (*func) (void *info), void *info, int retry,
 	if (!mask)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	data.started = mask;
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index dcec5e732..0c77e0b07 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -411,7 +411,7 @@ no_context:
 	else
 		printk(KERN_ALERT "Unable to handle kernel paging request");
 	printk(" at virtual address %08lx\n",address);
-	printk(" printing eip:\n");
+	printk(KERN_ALERT " printing eip:\n");
 	printk("%08lx\n", regs->eip);
 	asm("movl %%cr3,%0":"=r" (page));
 	page = ((unsigned long *) __va(page))[address >> 22];
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index 6e2fa1f39..0397fe963 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -264,8 +264,9 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 				goto out;
 			}
 			ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
-			unlock_page(page);
-			if (ret) {
+			if (! ret) {
+				unlock_page(page);
+			} else {
 				hugetlb_put_quota(mapping);
 				free_huge_page(page);
 				goto out;
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 040862e6c..834d6231a 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -206,6 +206,13 @@ static inline int page_is_ram(unsigned long pagenr)
 	return 0;
 }
 
+/* To enable modules to check if a page is in RAM */
+int pfn_is_ram(unsigned long pfn)
+{
+	return (page_is_ram(pfn));
+}
+
+
 #ifdef CONFIG_HIGHMEM
 pte_t *kmap_pte;
 pgprot_t kmap_prot;
@@ -328,9 +335,30 @@ static void __init pagetable_init (void)
 #endif
 }
 
+#if defined(CONFIG_PM_DISK) || defined(CONFIG_SOFTWARE_SUSPEND)
+/*
+ * Swap suspend & friends need this for resume because things like the intel-agp
+ * driver might have split up a kernel 4MB mapping.
+ */
+char __nosavedata swsusp_pg_dir[PAGE_SIZE]
+	__attribute__ ((aligned (PAGE_SIZE)));
+
+static inline void save_pg_dir(void)
+{
+	memcpy(swsusp_pg_dir, swapper_pg_dir, PAGE_SIZE);
+}
+#else
+static inline void save_pg_dir(void)
+{
+}
+#endif
+
 void zap_low_mappings (void)
 {
 	int i;
+
+	save_pg_dir();
+
 	/*
 	 * Zap initial low-memory mappings.
 	 *
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index 04b488ccb..af7c60285 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -121,20 +121,20 @@ __change_page_attr(struct page *page, pgprot_t prot)
 			pte_t standard = mk_pte(page, PAGE_KERNEL); 
 			set_pte_atomic(kpte, mk_pte(page, prot)); 
 			if (pte_same(old,standard))
-				atomic_inc(&kpte_page->count);
+				get_page(kpte_page);
 		} else {
 			struct page *split = split_large_page(address, prot); 
 			if (!split)
 				return -ENOMEM;
-			atomic_inc(&kpte_page->count);
+			get_page(kpte_page);
 			set_pmd_pte(kpte,address,mk_pte(split, PAGE_KERNEL));
 		}	
 	} else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
 		set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
-		atomic_dec(&kpte_page->count); 
+		__put_page(kpte_page);
 	}
 
-	if (cpu_has_pse && (atomic_read(&kpte_page->count) == 1)) { 
+	if (cpu_has_pse && (page_count(kpte_page) == 1)) {
 		list_add(&kpte_page->lru, &df_list);
 		revert_page(kpte_page, address);
 	} 
diff --git a/arch/i386/oprofile/op_model_p4.c b/arch/i386/oprofile/op_model_p4.c
index 7e41dc982..8b932b1b3 100644
--- a/arch/i386/oprofile/op_model_p4.c
+++ b/arch/i386/oprofile/op_model_p4.c
@@ -382,11 +382,8 @@ static struct p4_event_binding p4_events[NUM_EVENTS] = {
 static unsigned int get_stagger(void)
 {
 #ifdef CONFIG_SMP
-	int cpu;
-	if (smp_num_siblings > 1) {
-		cpu = smp_processor_id();
-		return (cpu_sibling_map[cpu] > cpu) ? 0 : 1;
-	}
+	int cpu = smp_processor_id();
+	return (cpu != first_cpu(cpu_sibling_map[cpu]));
 #endif	
 	return 0;
 }
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
index d436e0011..a8b1954ae 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/i386/pci/fixup.c
@@ -91,6 +91,15 @@ static void __devinit  pci_fixup_ide_trash(struct pci_dev *d)
 {
 	int i;
 
+	/*
+	 * Runs the fixup only for the first IDE controller
+	 * (Shai Fultheim - shai@ftcon.com)
+	 */
+	static int called = 0;
+	if (called)
+		return;
+	called = 1;
+
 	/*
 	 * There exist PCI IDE controllers which have utter garbage
 	 * in first four base registers. Ignore that.
@@ -217,7 +226,12 @@ static void __init pci_fixup_nforce2(struct pci_dev *dev)
 	fixed_val = rev < 0xC1 ? 0x1F01FF01 : 0x9F01FF01;
 
 	pci_read_config_dword(dev, 0x6c, &val);
-	if (val != fixed_val) {
+
+	/*
+	 * Apply fixup only if C1 Halt Disconnect is enabled
+	 * (bit28) because it is not supported on some boards.
+	 */
+	if ((val & (1 << 28)) && val != fixed_val) {
 		printk(KERN_WARNING "PCI: nForce2 C1 Halt Disconnect fixup\n");
 		pci_write_config_dword(dev, 0x6c, fixed_val);
 	}
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index f72313b10..e29b67b9c 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -476,8 +476,9 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
 		case PCI_DEVICE_ID_INTEL_82801DB_0:
 		case PCI_DEVICE_ID_INTEL_82801E_0:
 		case PCI_DEVICE_ID_INTEL_82801EB_0:
-		case PCI_DEVICE_ID_INTEL_ESB_0:
+		case PCI_DEVICE_ID_INTEL_ESB_1:
 		case PCI_DEVICE_ID_INTEL_ICH6_0:
+		case PCI_DEVICE_ID_INTEL_ICH6_1:
 			r->name = "PIIX/ICH";
 			r->get = pirq_piix_get;
 			r->set = pirq_piix_set;
@@ -540,8 +541,6 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router,
 	r->name = "SIS";
 	r->get = pirq_sis_get;
 	r->set = pirq_sis_set;
-	DBG("PCI: Detecting SiS router at %02x:%02x\n",
-	    rt->rtr_bus, rt->rtr_devfn);
 	return 1;
 }
 
@@ -898,7 +897,7 @@ static int __init pcibios_irq_init(void)
 {
 	DBG("PCI: IRQ init\n");
 
-	if (pcibios_enable_irq)
+	if (pcibios_enable_irq || raw_pci_ops == NULL)
 		return 0;
 
 	pirq_table = pirq_find_routing_table();
diff --git a/arch/i386/power/pmdisk.S b/arch/i386/power/pmdisk.S
index c885f5412..b8106ae23 100644
--- a/arch/i386/power/pmdisk.S
+++ b/arch/i386/power/pmdisk.S
@@ -21,7 +21,7 @@ ENTRY(pmdisk_arch_suspend)
 	jmp .L1449
 	.p2align 4,,7
 .L1450:
-	movl $swapper_pg_dir-__PAGE_OFFSET,%ecx
+	movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
 	movl %ecx,%cr3
 
 	movl	pm_pagedir_nosave,%ebx
diff --git a/arch/i386/power/swsusp.S b/arch/i386/power/swsusp.S
index ac2b57d7a..bdf03dd1e 100644
--- a/arch/i386/power/swsusp.S
+++ b/arch/i386/power/swsusp.S
@@ -36,7 +36,7 @@ ENTRY(do_magic)
 	jmp .L1449
 	.p2align 4,,7
 .L1450:
-	movl $swapper_pg_dir-__PAGE_OFFSET,%ecx
+	movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
 	movl %ecx,%cr3
 
 	call do_magic_resume_1
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 991916a4a..64e4ec65f 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -244,6 +244,15 @@ config NR_CPUS
 	  than 64 will cause the use of a CPU mask array, causing a small
 	  performance hit.
 
+config HOTPLUG_CPU
+    bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
+    depends on SMP && HOTPLUG && EXPERIMENTAL
+	default n
+    ---help---
+      Say Y here to experiment with turning CPUs off and on.  CPUs
+      can be controlled through /sys/devices/system/cpu/cpu#.
+      Say N if you want to disable CPU hotplug.
+
 config PREEMPT
 	bool "Preemptible Kernel"
         help
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 61fa67acf..6f718fb8e 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -16,8 +16,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
@@ -29,6 +31,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -69,7 +72,6 @@ CONFIG_VIRTUAL_MEM_MAP=y
 # CONFIG_IA64_CYCLONE is not set
 CONFIG_IOSAPIC=y
 CONFIG_FORCE_MAX_ZONEORDER=18
-# CONFIG_IA64_PAL_IDLE is not set
 CONFIG_SMP=y
 CONFIG_NR_CPUS=16
 # CONFIG_PREEMPT is not set
@@ -78,6 +80,10 @@ CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
+
+#
+# Firmware Drivers
+#
 CONFIG_EFI_VARS=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
@@ -87,13 +93,12 @@ CONFIG_BINFMT_MISC=y
 #
 CONFIG_PM=y
 CONFIG_ACPI=y
-CONFIG_ACPI_INTERPRETER=y
-CONFIG_ACPI_KERNEL_CONFIG=y
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
 CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_BUTTON=y
 CONFIG_ACPI_FAN=y
 CONFIG_ACPI_PROCESSOR=y
@@ -109,6 +114,7 @@ CONFIG_ACPI_SYSTEM=y
 #
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_USE_VECTOR is not set
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
 
@@ -149,7 +155,6 @@ CONFIG_PCI_NAMES=y
 #
 # Block devices
 #
-# CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -345,7 +350,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -356,8 +360,6 @@ CONFIG_IP_MULTICAST=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -376,10 +378,11 @@ CONFIG_IP_NF_ARPTABLES=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -400,16 +403,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+CONFIG_DUMMY=y
+CONFIG_BONDING=y
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-CONFIG_DUMMY=y
-CONFIG_BONDING=y
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -456,7 +464,6 @@ CONFIG_E1000=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
 
@@ -464,45 +471,29 @@ CONFIG_TIGON3=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -577,11 +568,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -594,7 +580,6 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
-# CONFIG_GEN_RTC is not set
 CONFIG_EFI_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
@@ -631,6 +616,7 @@ CONFIG_I2C_ALGOBIT=y
 # I2C Hardware Bus support
 #
 # CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
@@ -674,6 +660,8 @@ CONFIG_I2C_ALGOBIT=y
 # Other I2C Chip support
 #
 # CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
@@ -704,7 +692,7 @@ CONFIG_FB=y
 CONFIG_FB_RIVA=m
 # CONFIG_FB_MATROX is not set
 # CONFIG_FB_RADEON_OLD is not set
-CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON=m
 CONFIG_FB_RADEON_I2C=y
 # CONFIG_FB_RADEON_DEBUG is not set
 # CONFIG_FB_ATY128 is not set
@@ -837,6 +825,8 @@ CONFIG_USB_BANDWIDTH=y
 # USB Host Controller Drivers
 #
 CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_UHCI_HCD=y
 
@@ -861,7 +851,9 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_WACOM is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
 # CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
 
 #
 # USB Imaging devices
@@ -908,6 +900,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -959,6 +952,7 @@ CONFIG_VFAT_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -1075,6 +1069,7 @@ CONFIG_NLS_UTF8=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # Profiling support
@@ -1090,6 +1085,7 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_IA64_PRINT_HAZARDS=y
 CONFIG_DISABLE_VHPT=y
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_IA64_EARLY_PRINTK_VGA is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -1123,4 +1119,6 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_CAST6 is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
diff --git a/arch/ia64/dig/Makefile b/arch/ia64/dig/Makefile
index 971cd7870..1a7f925ea 100644
--- a/arch/ia64/dig/Makefile
+++ b/arch/ia64/dig/Makefile
@@ -6,4 +6,9 @@
 #
 
 obj-y := setup.o
+
+ifndef CONFIG_NUMA
+obj-$(CONFIG_IA64_DIG) += topology.o
+endif
+
 obj-$(CONFIG_IA64_GENERIC) += machvec.o
diff --git a/arch/ia64/hp/sim/boot/boot_head.S b/arch/ia64/hp/sim/boot/boot_head.S
index 43dcebc8f..9364199e5 100644
--- a/arch/ia64/hp/sim/boot/boot_head.S
+++ b/arch/ia64/hp/sim/boot/boot_head.S
@@ -105,37 +105,37 @@ static:	cmp.eq p6,p7=6,r28		/* PAL_PTCE_INFO */
 1:	cmp.eq p6,p7=15,r28		/* PAL_PERF_MON_INFO */
 (p7)	br.cond.sptk.few 1f
 	mov r8=0			/* status = 0 */
-	movl r9 =0x12082004		/* generic=4 width=32 retired=8 cycles=18 */
+	movl r9 =0x08122f04		/* generic=4 width=47 retired=8 cycles=18 */
 	mov r10=0			/* reserved */
 	mov r11=0			/* reserved */
 	mov r16=0xffff			/* implemented PMC */
-	mov r17=0xffff			/* implemented PMD */
+	mov r17=0x3ffff			/* implemented PMD */
 	add r18=8,r29			/* second index */
 	;;
 	st8 [r29]=r16,16		/* store implemented PMC */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	;;
-	st8 [r29]=r0,16			/* store implemented PMC */
+	st8 [r29]=r0,16			/* clear remaining bits  */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	;;
 	st8 [r29]=r17,16		/* store implemented PMD */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	mov r16=0xf0			/* cycles count capable PMC */
 	;;
-	st8 [r29]=r0,16			/* store implemented PMC */
+	st8 [r29]=r0,16			/* clear remaining bits  */
 	st8 [r18]=r0,16			/* clear remaining bits  */
-	mov r17=0x10			/* retired bundles capable PMC */
+	mov r17=0xf0			/* retired bundles capable PMC */
 	;;
 	st8 [r29]=r16,16		/* store cycles capable */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	;;
-	st8 [r29]=r0,16			/* store implemented PMC */
+	st8 [r29]=r0,16			/* clear remaining bits  */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	;;
 	st8 [r29]=r17,16		/* store retired bundle capable */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	;;
-	st8 [r29]=r0,16			/* store implemented PMC */
+	st8 [r29]=r0,16			/* clear remaining bits  */
 	st8 [r18]=r0,16			/* clear remaining bits  */
 	;;
 1:	br.cond.sptk.few rp
diff --git a/arch/ia64/ia32/Makefile b/arch/ia64/ia32/Makefile
index 4caefe724..2ed90da81 100644
--- a/arch/ia64/ia32/Makefile
+++ b/arch/ia64/ia32/Makefile
@@ -6,3 +6,7 @@ obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o \
 	 ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o
 
 CFLAGS_ia32_ioctl.o += -Ifs/
+
+# Don't let GCC uses f16-f31 so that save_ia32_fpstate_live() and
+# restore_ia32_fpstate_live() can be sure the live register contain user-level state.
+CFLAGS_ia32_signal.o += -mfixed-range=f16-f31
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index 679e68afd..babf3d1fc 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -73,15 +73,13 @@ ia64_elf32_init (struct pt_regs *regs)
 	 */
 	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
 	if (vma) {
+		memset(vma, 0, sizeof(*vma));
 		vma->vm_mm = current->mm;
 		vma->vm_start = IA32_GDT_OFFSET;
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_page_prot = PAGE_SHARED;
-		vma->vm_flags = VM_READ|VM_MAYREAD;
+		vma->vm_flags = VM_READ|VM_MAYREAD|VM_RESERVED;
 		vma->vm_ops = &ia32_shared_page_vm_ops;
-		vma->vm_pgoff = 0;
-		vma->vm_file = NULL;
-		vma->vm_private_data = NULL;
 		down_write(&current->mm->mmap_sem);
 		{
 			insert_vm_struct(current->mm, vma);
@@ -95,15 +93,12 @@ ia64_elf32_init (struct pt_regs *regs)
 	 */
 	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
 	if (vma) {
+		memset(vma, 0, sizeof(*vma));
 		vma->vm_mm = current->mm;
 		vma->vm_start = IA32_LDT_OFFSET;
 		vma->vm_end = vma->vm_start + PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE);
 		vma->vm_page_prot = PAGE_SHARED;
 		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE;
-		vma->vm_ops = NULL;
-		vma->vm_pgoff = 0;
-		vma->vm_file = NULL;
-		vma->vm_private_data = NULL;
 		down_write(&current->mm->mmap_sem);
 		{
 			insert_vm_struct(current->mm, vma);
@@ -173,6 +168,8 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
 		return -ENOMEM;
 	}
 
+	memset(mpnt, 0, sizeof(*mpnt));
+
 	down_write(&current->mm->mmap_sem);
 	{
 		mpnt->vm_mm = current->mm;
@@ -186,10 +183,6 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
 			mpnt->vm_flags = VM_STACK_FLAGS;
 		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC)?
 					PAGE_COPY_EXEC: PAGE_COPY;
-		mpnt->vm_ops = NULL;
-		mpnt->vm_pgoff = 0;
-		mpnt->vm_file = NULL;
-		mpnt->vm_private_data = 0;
 		insert_vm_struct(current->mm, mpnt);
 		current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
 	}
@@ -198,7 +191,7 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
 		struct page *page = bprm->page[i];
 		if (page) {
 			bprm->page[i] = NULL;
-			put_dirty_page(current, page, stack_base, mpnt->vm_page_prot);
+			install_arg_page(mpnt, page, stack_base);
 		}
 		stack_base += PAGE_SIZE;
 	}
@@ -225,3 +218,16 @@ elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p
 	return ia32_do_mmap(filep, (addr & IA32_PAGE_MASK), eppnt->p_filesz + pgoff, prot, type,
 			    eppnt->p_offset - pgoff);
 }
+
+#define cpu_uses_ia32el()	(local_cpu_data->family > 0x1f)
+
+static int __init check_elf32_binfmt(void)
+{
+	if (cpu_uses_ia32el()) {
+		printk("Please use IA-32 EL for executing IA-32 binaries\n");
+		return unregister_binfmt(&elf_format);
+	}
+	return 0;
+}
+
+module_init(check_elf32_binfmt)
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index d3331ba15..4ee1e551f 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -350,11 +350,11 @@ ia32_syscall_table:
 	data8 sys_setfsgid	/* 16-bit version */
 	data8 sys_llseek	  /* 140 */
 	data8 sys32_getdents
-	data8 sys32_select
+	data8 compat_sys_select
 	data8 sys_flock
 	data8 sys32_msync
-	data8 sys32_readv	  /* 145 */
-	data8 sys32_writev
+	data8 compat_sys_readv	  /* 145 */
+	data8 compat_sys_writev
 	data8 sys_getsid
 	data8 sys_fdatasync
 	data8 sys32_sysctl
diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
index 217c0acb1..793ec3f76 100644
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -43,22 +43,6 @@
 #define __IA32_NR_sigreturn            119
 #define __IA32_NR_rt_sigreturn         173
 
-#ifdef ASM_SUPPORTED
-/*
- * Don't let GCC uses f16-f31 so that save_ia32_fpstate_live() and
- * restore_ia32_fpstate_live() can be sure the live register contain user-level state.
- */
-register double f16 asm ("f16"); register double f17 asm ("f17");
-register double f18 asm ("f18"); register double f19 asm ("f19");
-register double f20 asm ("f20"); register double f21 asm ("f21");
-register double f22 asm ("f22"); register double f23 asm ("f23");
-
-register double f24 asm ("f24"); register double f25 asm ("f25");
-register double f26 asm ("f26"); register double f27 asm ("f27");
-register double f28 asm ("f28"); register double f29 asm ("f29");
-register double f30 asm ("f30"); register double f31 asm ("f31");
-#endif
-
 struct sigframe_ia32
 {
        int pretcode;
@@ -173,7 +157,8 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
 		case __SI_MESGQ >> 16:
 			err |= __put_user(from->si_uid, &to->si_uid);
 			err |= __put_user(from->si_pid, &to->si_pid);
-			err |= __put_user(from->si_ptr, &to->si_ptr);
+			addr = (unsigned long) from->si_ptr;
+			err |= __put_user(addr, &to->si_ptr);
 			break;
 		}
 	}
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index a1d008067..8994c9d11 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -90,58 +90,17 @@ extern unsigned long arch_get_unmapped_area (struct file *, unsigned long, unsig
 /* XXX make per-mm: */
 static DECLARE_MUTEX(ia32_mmap_sem);
 
-static int
-nargs (unsigned int arg, char **ap)
-{
-	unsigned int addr;
-	int n, err;
-
-	if (!arg)
-		return 0;
-
-	n = 0;
-	do {
-		err = get_user(addr, (unsigned int *)A(arg));
-		if (err)
-			return err;
-		if (ap)
-			*ap++ = (char *) A(addr);
-		arg += sizeof(unsigned int);
-		n++;
-	} while (addr);
-	return n - 1;
-}
-
 asmlinkage long
-sys32_execve (char *filename, unsigned int argv, unsigned int envp,
-	      struct pt_regs *regs)
+sys32_execve (char *name, compat_uptr_t __user *argv, compat_uptr_t __user *envp, struct pt_regs *regs)
 {
+	long error;
+	char *filename;
 	unsigned long old_map_base, old_task_size, tssd;
-	char **av, **ae;
-	int na, ne, len;
-	long r;
-
-	na = nargs(argv, NULL);
-	if (na < 0)
-		return na;
-	ne = nargs(envp, NULL);
-	if (ne < 0)
-		return ne;
-	len = (na + ne + 2) * sizeof(*av);
-	av = kmalloc(len, GFP_KERNEL);
-	if (!av)
-		return -ENOMEM;
-
-	ae = av + na + 1;
-	av[na] = NULL;
-	ae[ne] = NULL;
 
-	r = nargs(argv, av);
-	if (r < 0)
-		goto out;
-	r = nargs(envp, ae);
-	if (r < 0)
-		goto out;
+	filename = getname(name);
+	error = PTR_ERR(filename);
+	if (IS_ERR(filename))
+		return error;
 
 	old_map_base  = current->thread.map_base;
 	old_task_size = current->thread.task_size;
@@ -153,19 +112,18 @@ sys32_execve (char *filename, unsigned int argv, unsigned int envp,
 	ia64_set_kr(IA64_KR_IO_BASE, current->thread.old_iob);
 	ia64_set_kr(IA64_KR_TSSD, current->thread.old_k1);
 
-	set_fs(KERNEL_DS);
-	r = sys_execve(filename, av, ae, regs);
-	if (r < 0) {
+	error = compat_do_execve(filename, argv, envp, regs);
+	putname(filename);
+
+	if (error < 0) {
 		/* oops, execve failed, switch back to old values... */
 		ia64_set_kr(IA64_KR_IO_BASE, IA32_IOBASE);
 		ia64_set_kr(IA64_KR_TSSD, tssd);
 		current->thread.map_base  = old_map_base;
 		current->thread.task_size = old_task_size;
-		set_fs(USER_DS);	/* establish new task-size as the address-limit */
 	}
-  out:
-	kfree(av);
-	return r;
+
+	return error;
 }
 
 int cp_compat_stat(struct kstat *stat, struct compat_stat *ubuf)
@@ -818,110 +776,6 @@ out:
 	return error;
 }
 
-/*
- * We can actually return ERESTARTSYS instead of EINTR, but I'd
- * like to be certain this leads to no problems. So I return
- * EINTR just for safety.
- *
- * Update: ERESTARTSYS breaks at least the xview clock binary, so
- * I'm trying ERESTARTNOHAND which restart only when you want to.
- */
-#define MAX_SELECT_SECONDS \
-	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-#define ROUND_UP_TIME(x,y) (((x)+(y)-1)/(y))
-
-asmlinkage long
-sys32_select (int n, fd_set *inp, fd_set *outp, fd_set *exp, struct compat_timeval *tvp32)
-{
-	fd_set_bits fds;
-	char *bits;
-	long timeout;
-	int ret, size;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp32) {
-		time_t sec, usec;
-
-		ret = -EFAULT;
-		if (get_user(sec, &tvp32->tv_sec) || get_user(usec, &tvp32->tv_usec))
-			goto out_nofds;
-
-		ret = -EINVAL;
-		if (sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = ROUND_UP_TIME(usec, 1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-
-	if (n > current->files->max_fdset)
-		n = current->files->max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words.
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = kmalloc(6 * size, GFP_KERNEL);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	if ((ret = get_fd_set(n, inp, fds.in)) ||
-	    (ret = get_fd_set(n, outp, fds.out)) ||
-	    (ret = get_fd_set(n, exp, fds.ex)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp32 && !(current->personality & STICKY_TIMEOUTS)) {
-		time_t sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		if (put_user(sec, &tvp32->tv_sec) || put_user(usec, &tvp32->tv_usec)) {
-			ret = -EFAULT;
-			goto out;
-		}
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set(n, inp, fds.res_in);
-	set_fd_set(n, outp, fds.res_out);
-	set_fd_set(n, exp, fds.res_ex);
-
-out:
-	kfree(bits);
-out_nofds:
-	return ret;
-}
-
 struct sel_arg_struct {
 	unsigned int n;
 	unsigned int inp;
@@ -937,87 +791,8 @@ sys32_old_select (struct sel_arg_struct *arg)
 
 	if (copy_from_user(&a, arg, sizeof(a)))
 		return -EFAULT;
-	return sys32_select(a.n, (fd_set *) A(a.inp), (fd_set *) A(a.outp), (fd_set *) A(a.exp),
-			    (struct compat_timeval *) A(a.tvp));
-}
-
-static struct iovec *
-get_compat_iovec (struct compat_iovec *iov32, struct iovec *iov_buf, u32 count, int type)
-{
-	u32 i, buf, len;
-	struct iovec *ivp, *iov;
-
-	/* Get the "struct iovec" from user memory */
-
-	if (!count)
-		return 0;
-	if (verify_area(VERIFY_READ, iov32, sizeof(struct compat_iovec)*count))
-		return NULL;
-	if (count > UIO_MAXIOV)
-		return NULL;
-	if (count > UIO_FASTIOV) {
-		iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			return NULL;
-	} else
-		iov = iov_buf;
-
-	ivp = iov;
-	for (i = 0; i < count; i++) {
-		if (__get_user(len, &iov32->iov_len) || __get_user(buf, &iov32->iov_base)) {
-			if (iov != iov_buf)
-				kfree(iov);
-			return NULL;
-		}
-		if (verify_area(type, (void *)A(buf), len)) {
-			if (iov != iov_buf)
-				kfree(iov);
-			return((struct iovec *)0);
-		}
-		ivp->iov_base = (void *)A(buf);
-		ivp->iov_len = (__kernel_size_t) len;
-		iov32++;
-		ivp++;
-	}
-	return iov;
-}
-
-asmlinkage long
-sys32_readv (int fd, struct compat_iovec *vector, u32 count)
-{
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov;
-	long ret;
-	mm_segment_t old_fs = get_fs();
-
-	iov = get_compat_iovec(vector, iovstack, count, VERIFY_WRITE);
-	if (!iov)
-		return -EFAULT;
-	set_fs(KERNEL_DS);
-	ret = sys_readv(fd, iov, count);
-	set_fs(old_fs);
-	if (iov != iovstack)
-		kfree(iov);
-	return ret;
-}
-
-asmlinkage long
-sys32_writev (int fd, struct compat_iovec *vector, u32 count)
-{
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov;
-	long ret;
-	mm_segment_t old_fs = get_fs();
-
-	iov = get_compat_iovec(vector, iovstack, count, VERIFY_READ);
-	if (!iov)
-		return -EFAULT;
-	set_fs(KERNEL_DS);
-	ret = sys_writev(fd, iov, count);
-	set_fs(old_fs);
-	if (iov != iovstack)
-		kfree(iov);
-	return ret;
+	return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
+				 compat_ptr(a.exp), compat_ptr(a.tvp));
 }
 
 #define SEMOP		 1
@@ -2298,7 +2073,7 @@ sys32_set_thread_area (struct ia32_user_desc *u_info)
 	((desc)->a & 0x0ffff) |			\
 	 ((desc)->b & 0xf0000) )
 
-#define GET_32BIT(desc)		(((desc)->b >> 23) & 1)
+#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
 #define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
 #define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
 #define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
@@ -2425,176 +2200,6 @@ sys32_setresgid(compat_gid_t rgid, compat_gid_t egid,
 	return sys_setresgid(srgid, segid, ssgid);
 }
 
-/* Stuff for NFS server syscalls... */
-struct nfsctl_svc32 {
-	u16			svc32_port;
-	s32			svc32_nthreads;
-};
-
-struct nfsctl_client32 {
-	s8			cl32_ident[NFSCLNT_IDMAX+1];
-	s32			cl32_naddr;
-	struct in_addr		cl32_addrlist[NFSCLNT_ADDRMAX];
-	s32			cl32_fhkeytype;
-	s32			cl32_fhkeylen;
-	u8			cl32_fhkey[NFSCLNT_KEYMAX];
-};
-
-struct nfsctl_export32 {
-	s8			ex32_client[NFSCLNT_IDMAX+1];
-	s8			ex32_path[NFS_MAXPATHLEN+1];
-	compat_dev_t	ex32_dev;
-	compat_ino_t	ex32_ino;
-	s32			ex32_flags;
-	compat_uid_t	ex32_anon_uid;
-	compat_gid_t	ex32_anon_gid;
-};
-
-struct nfsctl_arg32 {
-	s32			ca32_version;	/* safeguard */
-	union {
-		struct nfsctl_svc32	u32_svc;
-		struct nfsctl_client32	u32_client;
-		struct nfsctl_export32	u32_export;
-		u32			u32_debug;
-	} u;
-#define ca32_svc	u.u32_svc
-#define ca32_client	u.u32_client
-#define ca32_export	u.u32_export
-#define ca32_debug	u.u32_debug
-};
-
-union nfsctl_res32 {
-	struct knfs_fh		cr32_getfh;
-	u32			cr32_debug;
-};
-
-static int
-nfs_svc32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= __get_user(karg->ca_svc.svc_port, &arg32->ca32_svc.svc32_port);
-	err |= __get_user(karg->ca_svc.svc_nthreads,
-			  &arg32->ca32_svc.svc32_nthreads);
-	return err;
-}
-
-static int
-nfs_clnt32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_client.cl_ident[0],
-			  &arg32->ca32_client.cl32_ident[0],
-			  NFSCLNT_IDMAX);
-	err |= __get_user(karg->ca_client.cl_naddr,
-			  &arg32->ca32_client.cl32_naddr);
-	err |= copy_from_user(&karg->ca_client.cl_addrlist[0],
-			  &arg32->ca32_client.cl32_addrlist[0],
-			  (sizeof(struct in_addr) * NFSCLNT_ADDRMAX));
-	err |= __get_user(karg->ca_client.cl_fhkeytype,
-		      &arg32->ca32_client.cl32_fhkeytype);
-	err |= __get_user(karg->ca_client.cl_fhkeylen,
-		      &arg32->ca32_client.cl32_fhkeylen);
-	err |= copy_from_user(&karg->ca_client.cl_fhkey[0],
-			  &arg32->ca32_client.cl32_fhkey[0],
-			  NFSCLNT_KEYMAX);
-	return err;
-}
-
-static int
-nfs_exp32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_export.ex_client[0],
-			  &arg32->ca32_export.ex32_client[0],
-			  NFSCLNT_IDMAX);
-	err |= copy_from_user(&karg->ca_export.ex_path[0],
-			  &arg32->ca32_export.ex32_path[0],
-			  NFS_MAXPATHLEN);
-	err |= __get_user(karg->ca_export.ex_dev,
-		      &arg32->ca32_export.ex32_dev);
-	err |= __get_user(karg->ca_export.ex_ino,
-		      &arg32->ca32_export.ex32_ino);
-	err |= __get_user(karg->ca_export.ex_flags,
-		      &arg32->ca32_export.ex32_flags);
-	err |= __get_user(karg->ca_export.ex_anon_uid,
-		      &arg32->ca32_export.ex32_anon_uid);
-	err |= __get_user(karg->ca_export.ex_anon_gid,
-		      &arg32->ca32_export.ex32_anon_gid);
-	return err;
-}
-
-static int
-nfs_getfh32_res_trans(union nfsctl_res *kres, union nfsctl_res32 *res32)
-{
-	int err;
-
-	err = copy_to_user(&res32->cr32_getfh,
-			&kres->cr_getfh,
-			sizeof(res32->cr32_getfh));
-	err |= __put_user(kres->cr_debug, &res32->cr32_debug);
-	return err;
-}
-
-int asmlinkage
-sys32_nfsservctl(int cmd, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
-{
-	struct nfsctl_arg *karg = NULL;
-	union nfsctl_res *kres = NULL;
-	mm_segment_t oldfs;
-	int err;
-
-	karg = kmalloc(sizeof(*karg), GFP_USER);
-	if(!karg)
-		return -ENOMEM;
-	if(res32) {
-		kres = kmalloc(sizeof(*kres), GFP_USER);
-		if(!kres) {
-			kfree(karg);
-			return -ENOMEM;
-		}
-	}
-	switch(cmd) {
-	case NFSCTL_SVC:
-		err = nfs_svc32_trans(karg, arg32);
-		break;
-	case NFSCTL_ADDCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_DELCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_EXPORT:
-		err = nfs_exp32_trans(karg, arg32);
-		break;
-	default:
-		err = -EINVAL;
-		break;
-	}
-	if(err)
-		goto done;
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_nfsservctl(cmd, karg, kres);
-	set_fs(oldfs);
-
-	if(!err && cmd == NFSCTL_GETFS)
-		err = nfs_getfh32_res_trans(kres, res32);
-
-done:
-	if(karg)
-		kfree(karg);
-	if(kres)
-		kfree(kres);
-	return err;
-}
-
 /* Handle adjtimex compatibility. */
 
 struct timex32 {
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index a41d2346b..7d1e2f3d4 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -23,6 +23,9 @@ targets += gate.so gate-syms.o
 
 extra-y += gate.so gate-syms.o gate.lds.s gate.o
 
+# fp_emulate() expects f2-f5,f16-f31 to contain the user-level state.
+CFLAGS_traps.o  += -mfixed-range=f2-f5,f16-f31
+
 AFLAGS_gate.lds.o += -P -C -U$(ARCH)
 
 quiet_cmd_gate = GATE $@
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 28d4fdcb2..10f2c7cd7 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -52,6 +52,9 @@
 #include <asm/sal.h>
 #include <asm/cyclone.h>
 
+#define BAD_MADT_ENTRY(entry, end) (                                        \
+		(!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
+		((acpi_table_entry_header *)entry)->length != sizeof(*entry))
 
 #define PREFIX			"ACPI: "
 
@@ -158,12 +161,14 @@ static u8			has_8259;
 
 
 static int __init
-acpi_parse_lapic_addr_ovr (acpi_table_entry_header *header)
+acpi_parse_lapic_addr_ovr (
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lapic_addr_ovr *lapic;
 
 	lapic = (struct acpi_table_lapic_addr_ovr *) header;
-	if (!lapic)
+
+	if (BAD_MADT_ENTRY(lapic, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -177,12 +182,13 @@ acpi_parse_lapic_addr_ovr (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_lsapic (acpi_table_entry_header *header)
+acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lsapic *lsapic;
 
 	lsapic = (struct acpi_table_lsapic *) header;
-	if (!lsapic)
+
+	if (BAD_MADT_ENTRY(lsapic, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -210,12 +216,13 @@ acpi_parse_lsapic (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_lapic_nmi (acpi_table_entry_header *header)
+acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_lapic_nmi *lacpi_nmi;
 
 	lacpi_nmi = (struct acpi_table_lapic_nmi*) header;
-	if (!lacpi_nmi)
+
+	if (BAD_MADT_ENTRY(lacpi_nmi, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -226,12 +233,13 @@ acpi_parse_lapic_nmi (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_iosapic (acpi_table_entry_header *header)
+acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_iosapic *iosapic;
 
 	iosapic = (struct acpi_table_iosapic *) header;
-	if (!iosapic)
+
+	if (BAD_MADT_ENTRY(iosapic, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -243,13 +251,15 @@ acpi_parse_iosapic (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_plat_int_src (acpi_table_entry_header *header)
+acpi_parse_plat_int_src (
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_plat_int_src *plintsrc;
 	int vector;
 
 	plintsrc = (struct acpi_table_plat_int_src *) header;
-	if (!plintsrc)
+
+	if (BAD_MADT_ENTRY(plintsrc, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -272,12 +282,14 @@ acpi_parse_plat_int_src (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_int_src_ovr (acpi_table_entry_header *header)
+acpi_parse_int_src_ovr (
+	acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_int_src_ovr *p;
 
 	p = (struct acpi_table_int_src_ovr *) header;
-	if (!p)
+
+	if (BAD_MADT_ENTRY(p, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -290,12 +302,13 @@ acpi_parse_int_src_ovr (acpi_table_entry_header *header)
 
 
 static int __init
-acpi_parse_nmi_src (acpi_table_entry_header *header)
+acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
 {
 	struct acpi_table_nmi_src *nmi_src;
 
 	nmi_src = (struct acpi_table_nmi_src*) header;
-	if (!nmi_src)
+
+	if (BAD_MADT_ENTRY(nmi_src, end))
 		return -EINVAL;
 
 	acpi_table_print_madt_entry(header);
@@ -632,16 +645,6 @@ acpi_boot_init (void)
 	return 0;
 }
 
-/* deprecated in favor of acpi_gsi_to_irq */
-int
-acpi_irq_to_vector (u32 gsi)
-{
-	if (has_8259 && gsi < 16)
-		return isa_irq_to_vector(gsi);
-
-	return gsi_to_vector(gsi);
-}
-
 int
 acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
 {
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 13572d153..3789a515a 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -39,7 +39,7 @@ extern efi_status_t efi_call_phys (void *, ...);
 struct efi efi;
 EXPORT_SYMBOL(efi);
 static efi_runtime_services_t *runtime;
-static unsigned long mem_limit = ~0UL;
+static unsigned long mem_limit = ~0UL, max_addr = ~0UL;
 
 #define efi_call_virt(f, args...)	(*(f))(args)
 
@@ -290,6 +290,7 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
 	void *efi_map_start, *efi_map_end, *p, *q;
 	efi_memory_desc_t *md, *check_md;
 	u64 efi_desc_size, start, end, granule_addr, last_granule_addr, first_non_wb_addr = 0;
+	unsigned long total_mem = 0;
 
 	efi_map_start = __va(ia64_boot_param->efi_memmap);
 	efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
@@ -331,12 +332,18 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
 			trim_top(md, last_granule_addr);
 
 		if (is_available_memory(md)) {
-			if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) {
-				if (md->phys_addr > mem_limit)
+			if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > max_addr) {
+				if (md->phys_addr > max_addr)
 					continue;
-				md->num_pages = (mem_limit - md->phys_addr) >> EFI_PAGE_SHIFT;
+				md->num_pages = (max_addr - md->phys_addr) >> EFI_PAGE_SHIFT;
 			}
 
+			if (total_mem >= mem_limit)
+				continue;
+			total_mem += (md->num_pages << EFI_PAGE_SHIFT);
+			if (total_mem > mem_limit)
+				md->num_pages -= ((total_mem - mem_limit) >> EFI_PAGE_SHIFT);
+
 			if (md->num_pages == 0)
 				continue;
 
@@ -470,7 +477,13 @@ efi_init (void)
 	for (cp = saved_command_line; *cp; ) {
 		if (memcmp(cp, "mem=", 4) == 0) {
 			cp += 4;
-			mem_limit = memparse(cp, &end) - 1;
+			mem_limit = memparse(cp, &end) - 2;
+			if (end != cp)
+				break;
+			cp = end;
+		} else if (memcmp(cp, "max_addr=", 9) == 0) {
+			cp += 9;
+			max_addr = memparse(cp, &end) - 1;
 			if (end != cp)
 				break;
 			cp = end;
@@ -481,8 +494,8 @@ efi_init (void)
 				++cp;
 		}
 	}
-	if (mem_limit != ~0UL)
-		printk(KERN_INFO "Ignoring memory above %luMB\n", mem_limit >> 20);
+	if (max_addr != ~0UL)
+		printk(KERN_INFO "Ignoring memory above %luMB\n", max_addr >> 20);
 
 	efi.systab = __va(ia64_boot_param->efi_systab);
 
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index ee80c68d0..45a49b600 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -21,7 +21,7 @@
  * Jonathan Nicklin	<nicklin@missioncriticallinux.com>
  * Patrick O'Rourke	<orourke@missioncriticallinux.com>
  * 11/07/2000
- /
+ */
 /*
  * Global (preserved) predicate usage on syscall entry/exit path:
  *
@@ -1429,7 +1429,7 @@ sys_call_table:
 	data8 sys_getcwd
 	data8 sys_capget			// 1185
 	data8 sys_capset
-	data8 sys_sendfile
+	data8 sys_sendfile64
 	data8 sys_ni_syscall		// sys_getpmsg (STREAMS)
 	data8 sys_ni_syscall		// sys_putpmsg (STREAMS)
 	data8 sys_socket			// 1190
@@ -1501,16 +1501,16 @@ sys_call_table:
 	data8 sys_clock_nanosleep
 	data8 sys_fstatfs64
 	data8 sys_statfs64
-	data8 sys_ni_syscall
-	data8 sys_ni_syscall			// 1260
-	data8 sys_ni_syscall
+	data8 sys_mbind
+	data8 sys_get_mempolicy			// 1260
+	data8 sys_set_mempolicy
 	data8 sys_mq_open
 	data8 sys_mq_unlink
 	data8 sys_mq_timedsend
 	data8 sys_mq_timedreceive		// 1265
 	data8 sys_mq_notify
 	data8 sys_mq_getsetattr
-	data8 sys_ni_syscall
+	data8 sys_ni_syscall			// reserved for kexec_load
 	data8 sys_ni_syscall
 	data8 sys_ni_syscall			// 1270
 	data8 sys_ni_syscall
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 458daa5ad..874bb10b7 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -345,40 +345,33 @@ ENTRY(fsys_rt_sigprocmask)
 	.altrp b6
 	.body
 
-	mf					// ensure reading of current->blocked is ordered
 	add r2=IA64_TASK_BLOCKED_OFFSET,r16
 	add r9=TI_FLAGS+IA64_TASK_SIZE,r16
+	cmp4.ltu p6,p0=SIG_SETMASK,r32
+
+	cmp.ne p15,p0=r0,r34			// oset != NULL?
+	tnat.nz p8,p0=r34
+	add r31=IA64_TASK_SIGHAND_OFFSET,r16
 	;;
-	/*
-	 * Since we're only reading a single word, we can do it
-	 * atomically without acquiring current->sighand->siglock.  To
-	 * be on the safe side, we need a fully-ordered load, though:
-	 */
-	ld8.acq r3=[r2]				// read/prefetch current->blocked
+	ld8 r3=[r2]				// read/prefetch current->blocked
 	ld4 r9=[r9]
-	add r31=IA64_TASK_SIGHAND_OFFSET,r16
+	tnat.nz.or p6,p0=r35
+
+	cmp.ne.or p6,p0=_NSIG_WORDS*8,r35
+	tnat.nz.or p6,p0=r32
+(p6)	br.spnt.few .fail_einval		// fail with EINVAL
 	;;
 #ifdef CONFIG_SMP
 	ld8 r31=[r31]				// r31 <- current->sighand
 #endif
 	and r9=TIF_ALLWORK_MASK,r9
-	tnat.nz p6,p0=r32
-	;;
-	cmp.ne p7,p0=0,r9
-	tnat.nz.or p6,p0=r35
-	tnat.nz p8,p0=r34
-	;;
-	cmp.ne p15,p0=r0,r34			// oset != NULL?
-	cmp.ne.or p6,p0=_NSIG_WORDS*8,r35
 	tnat.nz.or p8,p0=r33
-
-(p6)	br.spnt.few .fail_einval		// fail with EINVAL
-(p7)	br.spnt.many fsys_fallback_syscall	// got pending kernel work...
-(p8)	br.spnt.few .fail_efault		// fail with EFAULT
 	;;
-
-	cmp.eq p6,p7=r0,r33			// set == NULL?
+	cmp.ne p7,p0=0,r9
+	cmp.eq p6,p0=r0,r33			// set == NULL?
 	add r31=IA64_SIGHAND_SIGLOCK_OFFSET,r31	// r31 <- current->sighand->siglock
+(p8)	br.spnt.few .fail_efault		// fail with EFAULT
+(p7)	br.spnt.many fsys_fallback_syscall	// got pending kernel work...
 (p6)	br.dpnt.many .store_mask		// -> short-circuit to just reading the signal mask
 
 	/* Argh, we actually have to do some work and _update_ the signal mask: */
@@ -462,12 +455,10 @@ EX(.fail_efault, ld8 r14=[r33])			// r14 <- *set
 	st4.rel [r31]=r0			// release the lock
 #endif
 	ssm psr.i
-	cmp.ne p9,p0=r8,r0			// check for bad HOW value
 	;;
 
 	srlz.d					// ensure psr.i is set again
 	mov r18=0					// i must not leak kernel bits...
-(p9)	br.spnt.few .fail_einval		// bail out for bad HOW value
 
 .store_mask:
 EX(.fail_efault, (p15) probe.w.fault r34, 3)	// verify user has write-access to *oset
@@ -511,6 +502,7 @@ ENTRY(fsys_fallback_syscall)
 	adds r17=-1024,r15
 	movl r14=sys_call_table
 	;;
+	rsm psr.i
 	shladd r18=r17,3,r14
 	;;
 	ld8 r18=[r18]				// load normal (heavy-weight) syscall entry-point
@@ -551,7 +543,7 @@ GLOBAL_ENTRY(fsys_bubble_down)
 	 * to synthesize.
 	 */
 #	define PSR_ONE_BITS		((3 << IA64_PSR_CPL0_BIT) | (0x1 << IA64_PSR_RI_BIT) \
-					 | IA64_PSR_BN)
+					 | IA64_PSR_BN | IA64_PSR_I)
 
 	invala
 	movl r8=PSR_ONE_BITS
@@ -574,6 +566,10 @@ GLOBAL_ENTRY(fsys_bubble_down)
 	or r29=r8,r29			// construct cr.ipsr value to save
 	addl r22=IA64_RBS_OFFSET,r2	// compute base of RBS
 	;;
+	// GAS reports a spurious RAW hazard on the read of ar.rnat because it thinks
+	// we may be reading ar.itc after writing to psr.l.  Avoid that message with
+	// this directive:
+	dv_serialize_data
 	mov.m r24=ar.rnat		// read ar.rnat (5 cyc lat)
 	lfetch.fault.excl.nt1 [r22]
 	adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r2
@@ -857,7 +853,7 @@ fsyscall_table:
 	data8 0				// mq_timedreceive	// 1265
 	data8 0				// mq_notify
 	data8 0				// mq_getsetattr
-	data8 0
+	data8 0				// kexec_load
 	data8 0
 	data8 0							// 1270
 	data8 0
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S
index 36e8a24ff..a4dba3648 100644
--- a/arch/ia64/kernel/gate.S
+++ b/arch/ia64/kernel/gate.S
@@ -91,16 +91,18 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
 	cmp.geu p6,p7=r19,r17			// (syscall > 0 && syscall < 1024+NR_syscalls)?
 	;;
 (p6)	ld8 r18=[r18]
-	mov r29=psr				// read psr (12 cyc load latency)
+	mov r21=ar.fpsr
 	add r14=-8,r14				// r14 <- addr of fsys_bubble_down entry
 	;;
 (p6)	mov b7=r18
 (p6)	tbit.z p8,p0=r18,0
 (p8)	br.dptk.many b7
 
+(p6)	rsm psr.i
 	mov r27=ar.rsc
-	mov r21=ar.fpsr
 	mov r26=ar.pfs
+	;;
+	mov r29=psr				// read psr (12 cyc load latency)
 /*
  * brl.cond doesn't work as intended because the linker would convert this branch
  * into a branch to a PLT.  Perhaps there will be a way to avoid this with some
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index b2f67f130..0a5eb48d5 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -56,8 +56,7 @@ halt_msg:
 GLOBAL_ENTRY(_start)
 start_ap:
 	.prologue
-	.save rp, r4		// terminate unwind chain with a NULL rp
-	mov r4=r0
+	.save rp, r0		// terminate unwind chain with a NULL rp
 	.body
 
 	rsm psr.i | psr.ic
@@ -816,6 +815,42 @@ GLOBAL_ENTRY(ia64_delay_loop)
 	br.ret.sptk.many rp
 END(ia64_delay_loop)
 
+/*
+ * Return a CPU-local timestamp in nano-seconds.  This timestamp is
+ * NOT synchronized across CPUs its return value must never be
+ * compared against the values returned on another CPU.  The usage in
+ * kernel/sched.c ensures that.
+ *
+ * The return-value of sched_clock() is NOT supposed to wrap-around.
+ * If it did, it would cause some scheduling hiccups (at the worst).
+ * Fortunately, with a 64-bit cycle-counter ticking at 100GHz, even
+ * that would happen only once every 5+ years.
+ *
+ * The code below basically calculates:
+ *
+ *   (ia64_get_itc() * local_cpu_data->nsec_per_cyc) >> IA64_NSEC_PER_CYC_SHIFT
+ *
+ * except that the multiplication and the shift are done with 128-bit
+ * intermediate precision so that we can produce a full 64-bit result.
+ */
+GLOBAL_ENTRY(sched_clock)
+	addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
+	mov.m r9=ar.itc		// fetch cycle-counter				(35 cyc)
+	;;
+	ldf8 f8=[r8]
+	;;
+	setf.sig f9=r9		// certain to stall, so issue it _after_ ldf8...
+	;;
+	xmpy.lu f10=f9,f8	// calculate low 64 bits of 128-bit product	(4 cyc)
+	xmpy.hu f11=f9,f8	// calculate high 64 bits of 128-bit product
+	;;
+	getf.sig r8=f10		//						(5 cyc)
+	getf.sig r9=f11
+	;;
+	shrp r8=r9,r8,IA64_NSEC_PER_CYC_SHIFT
+	br.ret.sptk.many rp
+END(sched_clock)
+
 GLOBAL_ENTRY(start_kernel_thread)
 	.prologue
 	.save rp, r0				// this is the end of the call-chain
@@ -866,12 +901,14 @@ SET_REG(b5);
 	 * Inputs:
 	 *   ar.pfs - saved CFM of caller
 	 *   ar.ccv - 0 (and available for use)
+	 *   r27    - flags from spin_lock_irqsave or 0.  Must be preserved.
 	 *   r28    - available for use.
 	 *   r29    - available for use.
 	 *   r30    - available for use.
 	 *   r31    - address of lock, available for use.
 	 *   b6     - return address
 	 *   p14    - available for use.
+	 *   p15    - used to track flag status.
 	 *
 	 * If you patch this code to use more registers, do not forget to update
 	 * the clobber lists for spin_lock() in include/asm-ia64/spinlock.h.
@@ -885,22 +922,26 @@ GLOBAL_ENTRY(ia64_spinlock_contention_pre3_4)
 	.save rp, r28
 	.body
 	nop 0
-	nop 0
+	tbit.nz p15,p0=r27,IA64_PSR_I_BIT
 	.restore sp		// pop existing prologue after next insn
 	mov b6 = r28
 	.prologue
 	.save ar.pfs, r0
 	.altrp b6
 	.body
+	;;
+(p15)	ssm psr.i		// reenable interrupts if they were on
+				// DavidM says that srlz.d is slow and is not required in this case
 .wait:
 	// exponential backoff, kdb, lockmeter etc. go in here
 	hint @pause
 	ld4 r30=[r31]		// don't use ld4.bias; if it's contended, we won't write the word
 	nop 0
 	;;
-	cmp4.eq p14,p0=r30,r0
-(p14)	br.cond.sptk.few b6	// lock is now free, try to acquire
-	br.cond.sptk.few .wait
+	cmp4.ne p14,p0=r30,r0
+(p14)	br.cond.sptk.few .wait
+(p15)	rsm psr.i		// disable interrupts if we reenabled them
+	br.cond.sptk.few b6	// lock is now free, try to acquire
 END(ia64_spinlock_contention_pre3_4)
 
 #else
@@ -909,14 +950,20 @@ GLOBAL_ENTRY(ia64_spinlock_contention)
 	.prologue
 	.altrp b6
 	.body
+	tbit.nz p15,p0=r27,IA64_PSR_I_BIT
+	;;
 .wait:
+(p15)	ssm psr.i		// reenable interrupts if they were on
+				// DavidM says that srlz.d is slow and is not required in this case
+.wait2:
 	// exponential backoff, kdb, lockmeter etc. go in here
 	hint @pause
 	ld4 r30=[r31]		// don't use ld4.bias; if it's contended, we won't write the word
 	;;
 	cmp4.ne p14,p0=r30,r0
 	mov r30 = 1
-(p14)	br.cond.sptk.few .wait
+(p14)	br.cond.sptk.few .wait2
+(p15)	rsm psr.i		// disable interrupts if we reenabled them
 	;;
 	cmpxchg4.acq r30=[r31], r30, ar.ccv
 	;;
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 9db13ac60..9ef5f3ef9 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -32,6 +32,8 @@
  * 03/02/19	B. Helgaas	Make pcat_compat system-wide, not per-IOSAPIC.
  *				Remove iosapic_address & gsi_base from external interfaces.
  *				Rationalize __init/__devinit attributes.
+ * 04/12/04 Ashok Raj	<ashok.raj@intel.com> Intel Corporation 2004
+ *				Updated to work with irq migration necessary for CPU Hotplug
  */
 /*
  * Here is what the interrupt logic between a PCI device and the kernel looks like:
@@ -98,6 +100,7 @@
 #endif
 
 static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED;
+extern cpumask_t	__cacheline_aligned pending_irq_cpumask[NR_IRQS];
 
 /* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */
 
@@ -188,8 +191,10 @@ set_rte (unsigned int vector, unsigned int dest, int mask)
 	pol     = iosapic_intr_info[vector].polarity;
 	trigger = iosapic_intr_info[vector].trigger;
 	dmode   = iosapic_intr_info[vector].dmode;
+	vector &= (~IA64_IRQ_REDIRECTED);
 
 	redir = (dmode == IOSAPIC_LOWEST_PRIORITY) ? 1 : 0;
+
 #ifdef CONFIG_SMP
 	{
 		unsigned int irq;
@@ -311,9 +316,8 @@ iosapic_set_affinity (unsigned int irq, cpumask_t mask)
 
 	spin_lock_irqsave(&iosapic_lock, flags);
 	{
-		/* get current delivery mode by reading the low32 */
-		writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
 		low32 = iosapic_intr_info[vec].low32 & ~(7 << IOSAPIC_DELIVERY_SHIFT);
+
 		if (redir)
 		        /* change delivery mode to lowest priority */
 			low32 |= (IOSAPIC_LOWEST_PRIORITY << IOSAPIC_DELIVERY_SHIFT);
@@ -331,6 +335,21 @@ iosapic_set_affinity (unsigned int irq, cpumask_t mask)
 #endif
 }
 
+static inline void move_irq(int irq)
+{
+	/* note - we hold desc->lock */
+	cpumask_t tmp;
+	irq_desc_t *desc = irq_descp(irq);
+
+	if (!cpus_empty(pending_irq_cpumask[irq])) {
+		cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
+		if (unlikely(!cpus_empty(tmp))) {
+			desc->handler->set_affinity(irq, pending_irq_cpumask[irq]);
+		}
+		cpus_clear(pending_irq_cpumask[irq]);
+	}
+}
+
 /*
  * Handlers for level-triggered interrupts.
  */
@@ -347,6 +366,7 @@ iosapic_end_level_irq (unsigned int irq)
 {
 	ia64_vector vec = irq_to_vector(irq);
 
+	move_irq(irq);
 	writel(vec, iosapic_intr_info[vec].addr + IOSAPIC_EOI);
 }
 
@@ -386,6 +406,8 @@ static void
 iosapic_ack_edge_irq (unsigned int irq)
 {
 	irq_desc_t *idesc = irq_descp(irq);
+
+	move_irq(irq);
 	/*
 	 * Once we have recorded IRQ_PENDING already, we can mask the
 	 * interrupt for real. This prevents IRQ storms from unhandled
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 9d697c82f..42056fbaa 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -8,6 +8,12 @@
  * instead of just grabbing them. Thus setups with different IRQ numbers
  * shouldn't result in any weird surprises, and installing new handlers
  * should be easier.
+ *
+ * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 2004
+ *
+ * 4/14/2004: Added code to handle cpu migration and do safe irq
+ *			migration without lossing interrupts for iosapic
+ *			architecture.
  */
 
 /*
@@ -27,6 +33,7 @@
 #include <linux/timex.h>
 #include <linux/slab.h>
 #include <linux/random.h>
+#include <linux/cpu.h>
 #include <linux/ctype.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
@@ -35,19 +42,21 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/kallsyms.h>
+#include <linux/notifier.h>
 
 #include <asm/atomic.h>
+#include <asm/cpu.h>
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
+#include <asm/tlbflush.h>
 #include <asm/delay.h>
 #include <asm/irq.h>
 
 
-
 /*
  * Linux has a controller-independent x86 interrupt architecture.
  * every controller has a 'controller-template', that is used
@@ -75,6 +84,11 @@ irq_desc_t _irq_desc[NR_IRQS] __cacheline_aligned = {
 	}
 };
 
+/*
+ * This is updated when the user sets irq affinity via /proc
+ */
+cpumask_t    __cacheline_aligned pending_irq_cpumask[NR_IRQS];
+
 #ifdef CONFIG_IA64_GENERIC
 irq_desc_t * __ia64_irq_desc (unsigned int irq)
 {
@@ -938,7 +952,9 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
 static int irq_affinity_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
 {
-	int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
+	int len = sprintf(page, "%s", irq_redir[(long)data] ? "r " : "");
+
+	len += cpumask_scnprintf(page+len, count, irq_affinity[(long)data]);
 	if (count - len < 2)
 		return -EINVAL;
 	len += sprintf(page + len, "\n");
@@ -956,6 +972,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
 	int rlen;
 	int prelen;
 	irq_desc_t *desc = irq_descp(irq);
+	unsigned long flags;
 
 	if (!desc->handler->set_affinity)
 		return -EIO;
@@ -994,12 +1011,108 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
 	if (cpus_empty(tmp))
 		return -EINVAL;
 
-	desc->handler->set_affinity(irq, new_value);
+	spin_lock_irqsave(&desc->lock, flags);
+	pending_irq_cpumask[irq] = new_value;
+	spin_unlock_irqrestore(&desc->lock, flags);
+
 	return full_count;
 }
 
 #endif /* CONFIG_SMP */
 
+#ifdef CONFIG_HOTPLUG_CPU
+unsigned int vectors_in_migration[NR_IRQS];
+
+/*
+ * Since cpu_online_map is already updated, we just need to check for
+ * affinity that has zeros
+ */
+static void migrate_irqs(void)
+{
+	cpumask_t	mask;
+	irq_desc_t *desc;
+	int 		irq, new_cpu;
+
+	for (irq=0; irq < NR_IRQS; irq++) {
+		desc = irq_descp(irq);
+
+		/*
+		 * No handling for now.
+		 * TBD: Implement a disable function so we can now
+		 * tell CPU not to respond to these local intr sources.
+		 * such as ITV,CPEI,MCA etc.
+		 */
+		if (desc->status == IRQ_PER_CPU)
+			continue;
+
+		cpus_and(mask, irq_affinity[irq], cpu_online_map);
+		if (any_online_cpu(mask) == NR_CPUS) {
+			/*
+			 * Save it for phase 2 processing
+			 */
+			vectors_in_migration[irq] = irq;
+
+			new_cpu = any_online_cpu(cpu_online_map);
+			mask = cpumask_of_cpu(new_cpu);
+
+			/*
+			 * Al three are essential, currently WARN_ON.. maybe panic?
+			 */
+			if (desc->handler && desc->handler->disable &&
+				desc->handler->enable && desc->handler->set_affinity) {
+				desc->handler->disable(irq);
+				desc->handler->set_affinity(irq, mask);
+				desc->handler->enable(irq);
+			} else {
+				WARN_ON((!(desc->handler) || !(desc->handler->disable) ||
+						!(desc->handler->enable) ||
+						!(desc->handler->set_affinity)));
+			}
+		}
+	}
+}
+
+void fixup_irqs(void)
+{
+	unsigned int irq;
+	extern void ia64_process_pending_intr(void);
+
+	ia64_set_itv(1<<16);
+	/*
+	 * Phase 1: Locate irq's bound to this cpu and
+	 * relocate them for cpu removal.
+	 */
+	migrate_irqs();
+
+	/*
+	 * Phase 2: Perform interrupt processing for all entries reported in
+	 * local APIC.
+	 */
+	ia64_process_pending_intr();
+
+	/*
+	 * Phase 3: Now handle any interrupts not captured in local APIC.
+	 * This is to account for cases that device interrupted during the time the
+	 * rte was being disabled and re-programmed.
+	 */
+	for (irq=0; irq < NR_IRQS; irq++) {
+		if (vectors_in_migration[irq]) {
+			vectors_in_migration[irq]=0;
+			do_IRQ(irq, NULL);
+		}
+	}
+
+	/*
+	 * Now let processor die. We do irq disable and max_xtp() to
+	 * ensure there is no more interrupts routed to this processor.
+	 * But the local timer interrupt can have 1 pending which we
+	 * take care in timer_interrupt().
+	 */
+	max_xtp();
+	local_irq_disable();
+}
+#endif
+
 static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
 {
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 4c89328dd..e853159b8 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -10,6 +10,8 @@
  *
  * 09/15/00 Goutham Rao <goutham.rao@intel.com> Implemented pci_irq_to_vector
  *                      PCI to vector allocation routine.
+ * 04/14/2004 Ashok Raj <ashok.raj@intel.com>
+ *						Added CPU Hotplug handling for IPF.
  */
 
 #include <linux/config.h>
@@ -85,6 +87,11 @@ assign_irq_vector (int irq)
 
 extern unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs);
 
+#ifdef CONFIG_SMP
+#	define IS_RESCHEDULE(vec)	(vec == IA64_IPI_RESCHEDULE)
+#else
+#	define IS_RESCHEDULE(vec)	(0)
+#endif
 /*
  * That's where the IVT branches when we get an external
  * interrupt. This branches to the correct hardware IRQ handler via
@@ -94,11 +101,6 @@ void
 ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
 {
 	unsigned long saved_tpr;
-#ifdef CONFIG_SMP
-#	define IS_RESCHEDULE(vec)	(vec == IA64_IPI_RESCHEDULE)
-#else
-#	define IS_RESCHEDULE(vec)	(0)
-#endif
 
 #if IRQ_DEBUG
 	{
@@ -162,6 +164,54 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
 	irq_exit();
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+/*
+ * This function emulates a interrupt processing when a cpu is about to be
+ * brought down.
+ */
+void ia64_process_pending_intr(void)
+{
+	ia64_vector vector;
+	unsigned long saved_tpr;
+	extern unsigned int vectors_in_migration[NR_IRQS];
+
+	vector = ia64_get_ivr();
+
+	 irq_enter();
+	 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
+	 ia64_srlz_d();
+
+	 /*
+	  * Perform normal interrupt style processing
+	  */
+	while (vector != IA64_SPURIOUS_INT_VECTOR) {
+		if (!IS_RESCHEDULE(vector)) {
+			ia64_setreg(_IA64_REG_CR_TPR, vector);
+			ia64_srlz_d();
+
+			/*
+			 * Now try calling normal ia64_handle_irq as it would have got called
+			 * from a real intr handler. Try passing null for pt_regs, hopefully
+			 * it will work. I hope it works!.
+			 * Probably could shared code.
+			 */
+			vectors_in_migration[local_vector_to_irq(vector)]=0;
+			do_IRQ(local_vector_to_irq(vector), NULL);
+
+			/*
+			 * Disable interrupts and send EOI
+			 */
+			local_irq_disable();
+			ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
+		}
+		ia64_eoi();
+		vector = ia64_get_ivr();
+	}
+	irq_exit();
+}
+#endif
+
+
 #ifdef CONFIG_SMP
 extern irqreturn_t handle_IPI (int irq, void *dev_id, struct pt_regs *regs);
 
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index c65b6bfb2..1269d2c0f 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -181,6 +181,12 @@ ENTRY(vhpt_miss)
 (p7)	itc.d r24
 	;;
 #ifdef CONFIG_SMP
+	/*
+	 * Tell the assemblers dependency-violation checker that the above "itc" instructions
+	 * cannot possibly affect the following loads:
+	 */
+	dv_serialize_data
+
 	/*
 	 * Re-check L2 and L3 pagetable.  If they changed, we may have received a ptc.g
 	 * between reading the pagetable and the "itc".  If so, flush the entry we
@@ -229,6 +235,12 @@ ENTRY(itlb_miss)
 	itc.i r18
 	;;
 #ifdef CONFIG_SMP
+	/*
+	 * Tell the assemblers dependency-violation checker that the above "itc" instructions
+	 * cannot possibly affect the following loads:
+	 */
+	dv_serialize_data
+
 	ld8 r19=[r17]				// read L3 PTE again and see if same
 	mov r20=PAGE_SHIFT<<2			// setup page size for purge
 	;;
@@ -267,6 +279,12 @@ dtlb_fault:
 	itc.d r18
 	;;
 #ifdef CONFIG_SMP
+	/*
+	 * Tell the assemblers dependency-violation checker that the above "itc" instructions
+	 * cannot possibly affect the following loads:
+	 */
+	dv_serialize_data
+
 	ld8 r19=[r17]				// read L3 PTE again and see if same
 	mov r20=PAGE_SHIFT<<2			// setup page size for purge
 	;;
@@ -504,6 +522,12 @@ ENTRY(dirty_bit)
 	;;
 (p6)	itc.d r25				// install updated PTE
 	;;
+	/*
+	 * Tell the assemblers dependency-violation checker that the above "itc" instructions
+	 * cannot possibly affect the following loads:
+	 */
+	dv_serialize_data
+
 	ld8 r18=[r17]				// read PTE again
 	;;
 	cmp.eq p6,p7=r18,r25			// is it same as the newly installed
@@ -563,6 +587,12 @@ ENTRY(iaccess_bit)
 	;;
 (p6)	itc.i r25				// install updated PTE
 	;;
+	/*
+	 * Tell the assemblers dependency-violation checker that the above "itc" instructions
+	 * cannot possibly affect the following loads:
+	 */
+	dv_serialize_data
+
 	ld8 r18=[r17]				// read PTE again
 	;;
 	cmp.eq p6,p7=r18,r25			// is it same as the newly installed
@@ -610,6 +640,11 @@ ENTRY(daccess_bit)
 	cmp.eq p6,p7=r26,r18
 	;;
 (p6)	itc.d r25				// install updated PTE
+	/*
+	 * Tell the assemblers dependency-violation checker that the above "itc" instructions
+	 * cannot possibly affect the following loads:
+	 */
+	dv_serialize_data
 	;;
 	ld8 r18=[r17]				// read PTE again
 	;;
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index b47d7d27f..cd70ff190 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -1,6 +1,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 
+#include <asm/machvec.h>
 #include <asm/system.h>
 
 #ifdef CONFIG_IA64_GENERIC
@@ -8,7 +9,6 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 
-#include <asm/machvec.h>
 #include <asm/page.h>
 
 struct ia64_machine_vector ia64_mv;
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 27123bb61..fab4296e2 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -8,11 +8,14 @@
  *
  * Copyright (C) 2000-2001, 2003 Hewlett-Packard Co
  *	Stephane Eranian <eranian@hpl.hp.com>
+ * Copyright (C) 2004 Intel Corporation
+ *  Ashok Raj <ashok.raj@intel.com>
  *
  * 05/26/2000	S.Eranian	initial release
  * 08/21/2000	S.Eranian	updated to July 2000 PAL specs
  * 02/05/2001   S.Eranian	fixed module support
  * 10/23/2001	S.Eranian	updated pal_perf_mon_info bug fixes
+ * 03/24/2004	Ashok Raj	updated to work with CPU Hotplug
  */
 #include <linux/config.h>
 #include <linux/types.h>
@@ -22,6 +25,9 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/efi.h>
+#include <linux/notifier.h>
+#include <linux/cpu.h>
+#include <linux/cpumask.h>
 
 #include <asm/pal.h>
 #include <asm/sal.h>
@@ -768,13 +774,12 @@ static palinfo_entry_t palinfo_entries[]={
  * does not do recursion of deletion
  *
  * Notes:
- *	- first +1 accounts for the cpuN entry
- *	- second +1 account for toplevel palinfo
- *
+ *	- +1 accounts for the cpuN directory entry in /proc/pal
  */
-#define NR_PALINFO_PROC_ENTRIES	(NR_CPUS*(NR_PALINFO_ENTRIES+1)+1)
+#define NR_PALINFO_PROC_ENTRIES	(NR_CPUS*(NR_PALINFO_ENTRIES+1))
 
 static struct proc_dir_entry *palinfo_proc_entries[NR_PALINFO_PROC_ENTRIES];
+static struct proc_dir_entry *palinfo_dir;
 
 /*
  * This data structure is used to pass which cpu,function is being requested
@@ -888,47 +893,107 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi
 	return len;
 }
 
-static int __init
-palinfo_init(void)
+static void
+create_palinfo_proc_entries(unsigned int cpu)
 {
 #	define CPUSTR	"cpu%d"
 
 	pal_func_cpu_u_t f;
-	struct proc_dir_entry **pdir = palinfo_proc_entries;
-	struct proc_dir_entry *palinfo_dir, *cpu_dir;
-	int i, j;
+	struct proc_dir_entry **pdir;
+	struct proc_dir_entry *cpu_dir;
+	int j;
 	char cpustr[sizeof(CPUSTR)];
 
-	printk(KERN_INFO "PAL Information Facility v%s\n", PALINFO_VERSION);
-
-	palinfo_dir = proc_mkdir("pal", NULL);
 
 	/*
 	 * we keep track of created entries in a depth-first order for
 	 * cleanup purposes. Each entry is stored into palinfo_proc_entries
 	 */
-	for (i=0; i < NR_CPUS; i++) {
-
-		if (!cpu_online(i)) continue;
+	sprintf(cpustr,CPUSTR, cpu);
 
-		sprintf(cpustr,CPUSTR, i);
+	cpu_dir = proc_mkdir(cpustr, palinfo_dir);
 
-		cpu_dir = proc_mkdir(cpustr, palinfo_dir);
+	f.req_cpu = cpu;
 
-		f.req_cpu = i;
+	/*
+	 * Compute the location to store per cpu entries
+	 * We dont store the top level entry in this list, but
+	 * remove it finally after removing all cpu entries.
+	 */
+	pdir = &palinfo_proc_entries[cpu*(NR_PALINFO_ENTRIES+1)];
+	*pdir++ = cpu_dir;
+	for (j=0; j < NR_PALINFO_ENTRIES; j++) {
+		f.func_id = j;
+		*pdir = create_proc_read_entry(
+				palinfo_entries[j].name, 0, cpu_dir,
+				palinfo_read_entry, (void *)f.value);
+		if (*pdir)
+			(*pdir)->owner = THIS_MODULE;
+		pdir++;
+	}
+}
 
-		for (j=0; j < NR_PALINFO_ENTRIES; j++) {
-			f.func_id = j;
-			*pdir = create_proc_read_entry(
-					palinfo_entries[j].name, 0, cpu_dir,
-					palinfo_read_entry, (void *)f.value);
-			if (*pdir)
-				(*pdir)->owner = THIS_MODULE;
-			pdir++;
+static void
+remove_palinfo_proc_entries(unsigned int hcpu)
+{
+	int j;
+	struct proc_dir_entry *cpu_dir, **pdir;
+
+	pdir = &palinfo_proc_entries[hcpu*(NR_PALINFO_ENTRIES+1)];
+	cpu_dir = *pdir;
+	*pdir++=NULL;
+	for (j=0; j < (NR_PALINFO_ENTRIES); j++) {
+		if ((*pdir)) {
+			remove_proc_entry ((*pdir)->name, cpu_dir);
+			*pdir ++= NULL;
 		}
-		*pdir++ = cpu_dir;
 	}
-	*pdir = palinfo_dir;
+
+	if (cpu_dir) {
+		remove_proc_entry(cpu_dir->name, palinfo_dir);
+	}
+}
+
+static int __devinit palinfo_cpu_callback(struct notifier_block *nfb,
+								unsigned long action,
+								void *hcpu)
+{
+	unsigned int hotcpu = (unsigned long)hcpu;
+
+	switch (action) {
+	case CPU_ONLINE:
+		create_palinfo_proc_entries(hotcpu);
+		break;
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_DEAD:
+		remove_palinfo_proc_entries(hotcpu);
+		break;
+#endif
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block palinfo_cpu_notifier =
+{
+	.notifier_call = palinfo_cpu_callback,
+	.priority = 0,
+};
+
+static int __init
+palinfo_init(void)
+{
+	int i = 0;
+
+	printk(KERN_INFO "PAL Information Facility v%s\n", PALINFO_VERSION);
+	palinfo_dir = proc_mkdir("pal", NULL);
+
+	/* Create palinfo dirs in /proc for all online cpus */
+	for_each_online_cpu(i) {
+		create_palinfo_proc_entries(i);
+	}
+
+	/* Register for future delivery via notify registration */
+	register_cpu_notifier(&palinfo_cpu_notifier);
 
 	return 0;
 }
@@ -939,10 +1004,19 @@ palinfo_exit(void)
 	int i = 0;
 
 	/* remove all nodes: depth first pass. Could optimize this  */
-	for (i=0; i< NR_PALINFO_PROC_ENTRIES ; i++) {
-		if (palinfo_proc_entries[i])
-			remove_proc_entry (palinfo_proc_entries[i]->name, NULL);
+	for_each_online_cpu(i) {
+		remove_palinfo_proc_entries(i);
 	}
+
+	/*
+	 * Remove the top level entry finally
+	 */
+	remove_proc_entry(palinfo_dir->name, NULL);
+
+	/*
+	 * Unregister from cpu notifier callbacks
+	 */
+	unregister_cpu_notifier(&palinfo_cpu_notifier);
 }
 
 module_init(palinfo_init);
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index ae2eb13f9..85371f48a 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -26,6 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
@@ -86,27 +87,25 @@
 #define	PFM_REG_CONFIG		(0x8<<4|PFM_REG_IMPL) /* configuration register */
 #define PFM_REG_BUFFER	 	(0xc<<4|PFM_REG_IMPL) /* PMD used as buffer */
 
-#define PMC_IS_LAST(i)	(pmu_conf.pmc_desc[i].type & PFM_REG_END)
-#define PMD_IS_LAST(i)	(pmu_conf.pmd_desc[i].type & PFM_REG_END)
-
-#define PFM_IS_DISABLED() (pmu_conf.enabled == 0)
+#define PMC_IS_LAST(i)	(pmu_conf->pmc_desc[i].type & PFM_REG_END)
+#define PMD_IS_LAST(i)	(pmu_conf->pmd_desc[i].type & PFM_REG_END)
 
 #define PMC_OVFL_NOTIFY(ctx, i)	((ctx)->ctx_pmds[i].flags &  PFM_REGFL_OVFL_NOTIFY)
 
 /* i assumed unsigned */
-#define PMC_IS_IMPL(i)	  (i< PMU_MAX_PMCS && (pmu_conf.pmc_desc[i].type & PFM_REG_IMPL))
-#define PMD_IS_IMPL(i)	  (i< PMU_MAX_PMDS && (pmu_conf.pmd_desc[i].type & PFM_REG_IMPL))
+#define PMC_IS_IMPL(i)	  (i< PMU_MAX_PMCS && (pmu_conf->pmc_desc[i].type & PFM_REG_IMPL))
+#define PMD_IS_IMPL(i)	  (i< PMU_MAX_PMDS && (pmu_conf->pmd_desc[i].type & PFM_REG_IMPL))
 
 /* XXX: these assume that register i is implemented */
-#define PMD_IS_COUNTING(i) ((pmu_conf.pmd_desc[i].type & PFM_REG_COUNTING) == PFM_REG_COUNTING)
-#define PMC_IS_COUNTING(i) ((pmu_conf.pmc_desc[i].type & PFM_REG_COUNTING) == PFM_REG_COUNTING)
-#define PMC_IS_MONITOR(i)  ((pmu_conf.pmc_desc[i].type & PFM_REG_MONITOR)  == PFM_REG_MONITOR)
-#define PMC_IS_CONTROL(i)  ((pmu_conf.pmc_desc[i].type & PFM_REG_CONTROL)  == PFM_REG_CONTROL)
+#define PMD_IS_COUNTING(i) ((pmu_conf->pmd_desc[i].type & PFM_REG_COUNTING) == PFM_REG_COUNTING)
+#define PMC_IS_COUNTING(i) ((pmu_conf->pmc_desc[i].type & PFM_REG_COUNTING) == PFM_REG_COUNTING)
+#define PMC_IS_MONITOR(i)  ((pmu_conf->pmc_desc[i].type & PFM_REG_MONITOR)  == PFM_REG_MONITOR)
+#define PMC_IS_CONTROL(i)  ((pmu_conf->pmc_desc[i].type & PFM_REG_CONTROL)  == PFM_REG_CONTROL)
 
-#define PMC_DFL_VAL(i)     pmu_conf.pmc_desc[i].default_value
-#define PMC_RSVD_MASK(i)   pmu_conf.pmc_desc[i].reserved_mask
-#define PMD_PMD_DEP(i)	   pmu_conf.pmd_desc[i].dep_pmd[0]
-#define PMC_PMD_DEP(i)	   pmu_conf.pmc_desc[i].dep_pmd[0]
+#define PMC_DFL_VAL(i)     pmu_conf->pmc_desc[i].default_value
+#define PMC_RSVD_MASK(i)   pmu_conf->pmc_desc[i].reserved_mask
+#define PMD_PMD_DEP(i)	   pmu_conf->pmd_desc[i].dep_pmd[0]
+#define PMC_PMD_DEP(i)	   pmu_conf->pmc_desc[i].dep_pmd[0]
 
 #define PFM_NUM_IBRS	  IA64_NUM_DBG_REGS
 #define PFM_NUM_DBRS	  IA64_NUM_DBG_REGS
@@ -133,6 +132,8 @@
 #define PFM_CPUINFO_SET(v)	pfm_get_cpu_var(pfm_syst_info) |= (v)
 #define PFM_CPUINFO_GET()	pfm_get_cpu_var(pfm_syst_info)
 
+#define RDEP(x)	(1UL<<(x))
+
 /*
  * context protection macros
  * in SMP:
@@ -374,26 +375,32 @@ typedef struct {
  * dep_pmd[]: a bitmask of dependent PMD registers
  * dep_pmc[]: a bitmask of dependent PMC registers
  */
+typedef int (*pfm_reg_check_t)(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
 typedef struct {
 	unsigned int		type;
 	int			pm_pos;
 	unsigned long		default_value;	/* power-on default value */
 	unsigned long		reserved_mask;	/* bitmask of reserved bits */
-	int			(*read_check)(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
-	int			(*write_check)(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
+	pfm_reg_check_t		read_check;
+	pfm_reg_check_t		write_check;
 	unsigned long		dep_pmd[4];
 	unsigned long		dep_pmc[4];
 } pfm_reg_desc_t;
 
 /* assume cnum is a valid monitor */
-#define PMC_PM(cnum, val)	(((val) >> (pmu_conf.pmc_desc[cnum].pm_pos)) & 0x1)
-#define PMC_WR_FUNC(cnum)	(pmu_conf.pmc_desc[cnum].write_check)
-#define PMD_WR_FUNC(cnum)	(pmu_conf.pmd_desc[cnum].write_check)
-#define PMD_RD_FUNC(cnum)	(pmu_conf.pmd_desc[cnum].read_check)
+#define PMC_PM(cnum, val)	(((val) >> (pmu_conf->pmc_desc[cnum].pm_pos)) & 0x1)
 
 /*
  * This structure is initialized at boot time and contains
  * a description of the PMU main characteristics.
+ *
+ * If the probe function is defined, detection is based
+ * on its return value: 
+ * 	- 0 means recognized PMU
+ * 	- anything else means not supported
+ * When the probe function is not defined, then the pmu_family field
+ * is used and it must match the host CPU family such that:
+ * 	- cpu->family & config->pmu_family != 0
  */
 typedef struct {
 	unsigned long  ovfl_val;	/* overflow value for counters */
@@ -407,15 +414,18 @@ typedef struct {
 	unsigned long  impl_pmds[4];	/* bitmask of implemented PMDS */
 
 	char	      *pmu_name;	/* PMU family name */
-	unsigned int  enabled;		/* indicates if perfmon initialized properly */
 	unsigned int  pmu_family;	/* cpuid family pattern used to identify pmu */
-
+	unsigned int  flags;		/* pmu specific flags */
 	unsigned int  num_ibrs;		/* number of IBRS: computed at init time */
 	unsigned int  num_dbrs;		/* number of DBRS: computed at init time */
 	unsigned int  num_counters;	/* PMC/PMD counting pairs : computed at init time */
-
+	int           (*probe)(void);   /* customized probe routine */
 	unsigned int  use_rr_dbregs:1;	/* set if debug registers used for range restriction */
 } pmu_config_t;
+/*
+ * PMU specific flags
+ */
+#define PFM_PMU_IRQ_RESEND	1	/* PMU needs explicit IRQ resend */
 
 /*
  * debug register related type definitions
@@ -500,6 +510,8 @@ static pfm_uuid_t		pfm_null_uuid = {0,};
 static spinlock_t		pfm_buffer_fmt_lock;
 static LIST_HEAD(pfm_buffer_fmt_list);
 
+static pmu_config_t		*pmu_conf;
+
 /* sysctl() controls */
 static pfm_sysctl_t pfm_sysctl;
 int pfm_debug_var;
@@ -620,20 +632,19 @@ static void pfm_lazy_save_regs (struct task_struct *ta);
 #endif
 
 void dump_pmu_state(const char *);
+static int pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
 
-/*
- * the HP simulator must be first because
- * CONFIG_IA64_HP_SIM is independent of CONFIG_MCKINLEY or CONFIG_ITANIUM
- */
-#if defined(CONFIG_IA64_HP_SIM)
-#include "perfmon_hpsim.h"
-#elif   defined(CONFIG_ITANIUM)
 #include "perfmon_itanium.h"
-#elif defined(CONFIG_MCKINLEY)
 #include "perfmon_mckinley.h"
-#else
 #include "perfmon_generic.h"
-#endif
+
+static pmu_config_t *pmu_confs[]={
+	&pmu_conf_mck,
+	&pmu_conf_ita,
+	&pmu_conf_gen, /* must be last */
+	NULL
+};
+
 
 static int pfm_end_notify_user(pfm_context_t *ctx);
 
@@ -702,6 +713,7 @@ pfm_restore_ibrs(unsigned long *ibrs, unsigned int nibrs)
 
 	for (i=0; i < nibrs; i++) {
 		ia64_set_ibr(i, ibrs[i]);
+		ia64_dv_serialize_instruction();
 	}
 	ia64_srlz_i();
 }
@@ -713,6 +725,7 @@ pfm_restore_dbrs(unsigned long *dbrs, unsigned int ndbrs)
 
 	for (i=0; i < ndbrs; i++) {
 		ia64_set_dbr(i, dbrs[i]);
+		ia64_dv_serialize_data();
 	}
 	ia64_srlz_d();
 }
@@ -723,7 +736,7 @@ pfm_restore_dbrs(unsigned long *dbrs, unsigned int ndbrs)
 static inline unsigned long
 pfm_read_soft_counter(pfm_context_t *ctx, int i)
 {
-	return ctx->ctx_pmds[i].val + (ia64_get_pmd(i) & pmu_conf.ovfl_val);
+	return ctx->ctx_pmds[i].val + (ia64_get_pmd(i) & pmu_conf->ovfl_val);
 }
 
 /*
@@ -732,7 +745,7 @@ pfm_read_soft_counter(pfm_context_t *ctx, int i)
 static inline void
 pfm_write_soft_counter(pfm_context_t *ctx, int i, unsigned long val)
 {
-	unsigned long ovfl_val = pmu_conf.ovfl_val;
+	unsigned long ovfl_val = pmu_conf->ovfl_val;
 
 	ctx->ctx_pmds[i].val = val  & ~ovfl_val;
 	/*
@@ -878,7 +891,7 @@ pfm_mask_monitoring(struct task_struct *task)
 
 	DPRINT_ovfl(("masking monitoring for [%d]\n", task->pid));
 
-	ovfl_mask = pmu_conf.ovfl_val;
+	ovfl_mask = pmu_conf->ovfl_val;
 	/*
 	 * monitoring can only be masked as a result of a valid
 	 * counter overflow. In UP, it means that the PMU still
@@ -953,7 +966,7 @@ pfm_restore_monitoring(struct task_struct *task)
 	int i, is_system;
 
 	is_system = ctx->ctx_fl_system;
-	ovfl_mask = pmu_conf.ovfl_val;
+	ovfl_mask = pmu_conf->ovfl_val;
 
 	if (task != current) {
 		printk(KERN_ERR "perfmon.%d: invalid task[%d] current[%d]\n", __LINE__, task->pid, current->pid);
@@ -1024,8 +1037,8 @@ pfm_restore_monitoring(struct task_struct *task)
 	 * XXX: need to optimize 
 	 */
 	if (ctx->ctx_fl_using_dbreg) {
-		pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf.num_ibrs);
-		pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf.num_dbrs);
+		pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf->num_ibrs);
+		pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf->num_dbrs);
 	}
 
 	/*
@@ -1058,7 +1071,7 @@ static inline void
 pfm_restore_pmds(unsigned long *pmds, unsigned long mask)
 {
 	int i;
-	unsigned long val, ovfl_val = pmu_conf.ovfl_val;
+	unsigned long val, ovfl_val = pmu_conf->ovfl_val;
 
 	for (i=0; mask; i++, mask>>=1) {
 		if ((mask & 0x1) == 0) continue;
@@ -1075,7 +1088,7 @@ static inline void
 pfm_copy_pmds(struct task_struct *task, pfm_context_t *ctx)
 {
 	struct thread_struct *thread = &task->thread;
-	unsigned long ovfl_val = pmu_conf.ovfl_val;
+	unsigned long ovfl_val = pmu_conf->ovfl_val;
 	unsigned long mask = ctx->ctx_all_pmds[0];
 	unsigned long val;
 	int i;
@@ -2295,6 +2308,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
 		DPRINT(("Cannot allocate vma\n"));
 		goto error_kmem;
 	}
+	memset(vma, 0, sizeof(*vma));
+
 	/*
 	 * partially initialize the vma for the sampling buffer
 	 *
@@ -2305,10 +2320,6 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
 	vma->vm_mm	     = mm;
 	vma->vm_flags	     = VM_READ| VM_MAYREAD |VM_RESERVED;
 	vma->vm_page_prot    = PAGE_READONLY; /* XXX may need to change */
-	vma->vm_ops	     = NULL;
-	vma->vm_pgoff	     = 0;
-	vma->vm_file	     = NULL;
-	vma->vm_private_data = NULL; 
 
 	/*
 	 * Now we have everything we need and we can initialize
@@ -2513,12 +2524,12 @@ pfm_reset_pmu_state(pfm_context_t *ctx)
 	  *
 	  * PMC0 is treated differently.
 	  */
-	ctx->ctx_all_pmcs[0] = pmu_conf.impl_pmcs[0] & ~0x1;
+	ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1;
 
 	/*
 	 * bitmask of all PMDs that are accesible to this context
 	 */
-	ctx->ctx_all_pmds[0] = pmu_conf.impl_pmds[0];
+	ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0];
 
 	DPRINT(("<%d> all_pmcs=0x%lx all_pmds=0x%lx\n", ctx->ctx_fd, ctx->ctx_all_pmcs[0],ctx->ctx_all_pmds[0]));
 
@@ -2858,16 +2869,17 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 	unsigned long value, pmc_pm;
 	unsigned long smpl_pmds, reset_pmds, impl_pmds;
 	unsigned int cnum, reg_flags, flags, pmc_type;
-	int i, can_access_pmu = 0, is_loaded, is_system;
+	int i, can_access_pmu = 0, is_loaded, is_system, expert_mode;
 	int is_monitor, is_counting, state;
 	int ret = -EINVAL;
+	pfm_reg_check_t	wr_func;
 #define PFM_CHECK_PMC_PM(x, y, z) ((x)->ctx_fl_system ^ PMC_PM(y, z))
 
 	state     = ctx->ctx_state;
 	is_loaded = state == PFM_CTX_LOADED ? 1 : 0;
 	is_system = ctx->ctx_fl_system;
 	task      = ctx->ctx_task;
-	impl_pmds = pmu_conf.impl_pmds[0];
+	impl_pmds = pmu_conf->impl_pmds[0];
 
 	if (state == PFM_CTX_ZOMBIE) return -EINVAL;
 
@@ -2884,6 +2896,7 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 		}
 		can_access_pmu = GET_PMU_OWNER() == task || is_system ? 1 : 0;
 	}
+	expert_mode = pfm_sysctl.expert_mode; 
 
 	for (i = 0; i < count; i++, req++) {
 
@@ -2900,8 +2913,8 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 			goto error;
 		}
 
-		pmc_type   = pmu_conf.pmc_desc[cnum].type;
-		pmc_pm     = (value >> pmu_conf.pmc_desc[cnum].pm_pos) & 0x1;
+		pmc_type   = pmu_conf->pmc_desc[cnum].type;
+		pmc_pm     = (value >> pmu_conf->pmc_desc[cnum].pm_pos) & 0x1;
 		is_counting = (pmc_type & PFM_REG_COUNTING) == PFM_REG_COUNTING ? 1 : 0;
 		is_monitor  = (pmc_type & PFM_REG_MONITOR) == PFM_REG_MONITOR ? 1 : 0;
 
@@ -2914,6 +2927,7 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 			DPRINT(("pmc%u is unimplemented or no-access pmc_type=%x\n", cnum, pmc_type));
 			goto error;
 		}
+		wr_func = pmu_conf->pmc_desc[cnum].write_check;
 		/*
 		 * If the PMC is a monitor, then if the value is not the default:
 		 * 	- system-wide session: PMCx.pm=1 (privileged monitor)
@@ -2962,8 +2976,8 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 		/*
 		 * execute write checker, if any
 		 */
-		if (pfm_sysctl.expert_mode == 0 && PMC_WR_FUNC(cnum)) {
-			ret = PMC_WR_FUNC(cnum)(task, ctx, cnum, &value, regs);
+		if (likely(expert_mode == 0 && wr_func)) {
+			ret = (*wr_func)(task, ctx, cnum, &value, regs);
 			if (ret) goto error;
 			ret = -EINVAL;
 		}
@@ -3014,7 +3028,7 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 		 * PMD. Clearing is done indirectly via pfm_reset_pmu_state() so there is no
 		 * possible leak here.
 		 */
-		CTX_USED_PMD(ctx, pmu_conf.pmc_desc[cnum].dep_pmd[0]);
+		CTX_USED_PMD(ctx, pmu_conf->pmc_desc[cnum].dep_pmd[0]);
 
 		/*
 		 * keep track of the monitor PMC that we are using.
@@ -3096,14 +3110,15 @@ pfm_write_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 	unsigned long value, hw_value, ovfl_mask;
 	unsigned int cnum;
 	int i, can_access_pmu = 0, state;
-	int is_counting, is_loaded, is_system;
+	int is_counting, is_loaded, is_system, expert_mode;
 	int ret = -EINVAL;
+	pfm_reg_check_t wr_func;
 
 
 	state     = ctx->ctx_state;
 	is_loaded = state == PFM_CTX_LOADED ? 1 : 0;
 	is_system = ctx->ctx_fl_system;
-	ovfl_mask = pmu_conf.ovfl_val;
+	ovfl_mask = pmu_conf->ovfl_val;
 	task      = ctx->ctx_task;
 
 	if (unlikely(state == PFM_CTX_ZOMBIE)) return -EINVAL;
@@ -3125,6 +3140,7 @@ pfm_write_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 		}
 		can_access_pmu = GET_PMU_OWNER() == task || is_system ? 1 : 0;
 	}
+	expert_mode = pfm_sysctl.expert_mode; 
 
 	for (i = 0; i < count; i++, req++) {
 
@@ -3136,14 +3152,15 @@ pfm_write_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 			goto abort_mission;
 		}
 		is_counting = PMD_IS_COUNTING(cnum);
+		wr_func     = pmu_conf->pmd_desc[cnum].write_check;
 
 		/*
 		 * execute write checker, if any
 		 */
-		if (pfm_sysctl.expert_mode == 0 && PMD_WR_FUNC(cnum)) {
+		if (unlikely(expert_mode == 0 && wr_func)) {
 			unsigned long v = value;
 
-			ret = PMD_WR_FUNC(cnum)(task, ctx, cnum, &v, regs);
+			ret = (*wr_func)(task, ctx, cnum, &v, regs);
 			if (ret) goto abort_mission;
 
 			value = v;
@@ -3289,8 +3306,9 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 	pfarg_reg_t *req = (pfarg_reg_t *)arg;
 	unsigned int cnum, reg_flags = 0;
 	int i, can_access_pmu = 0, state;
-	int is_loaded, is_system, is_counting;
+	int is_loaded, is_system, is_counting, expert_mode;
 	int ret = -EINVAL;
+	pfm_reg_check_t rd_func;
 
 	/*
 	 * access is possible when loaded only for
@@ -3300,7 +3318,7 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 	state     = ctx->ctx_state;
 	is_loaded = state == PFM_CTX_LOADED ? 1 : 0;
 	is_system = ctx->ctx_fl_system;
-	ovfl_mask = pmu_conf.ovfl_val;
+	ovfl_mask = pmu_conf->ovfl_val;
 	task      = ctx->ctx_task;
 
 	if (state == PFM_CTX_ZOMBIE) return -EINVAL;
@@ -3323,6 +3341,7 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 
 		if (can_access_pmu) ia64_srlz_d();
 	}
+	expert_mode = pfm_sysctl.expert_mode; 
 
 	DPRINT(("loaded=%d access_pmu=%d ctx_state=%d\n",
 		is_loaded,
@@ -3369,6 +3388,7 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 			 */
 			val = is_loaded ? thread->pmds[cnum] : 0UL;
 		}
+		rd_func = pmu_conf->pmd_desc[cnum].read_check;
 
 		if (is_counting) {
 			/*
@@ -3381,9 +3401,9 @@ pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 		/*
 		 * execute read checker, if any
 		 */
-		if (unlikely(pfm_sysctl.expert_mode == 0 && PMD_RD_FUNC(cnum))) {
+		if (unlikely(expert_mode == 0 && rd_func)) {
 			unsigned long v = val;
-			ret = PMD_RD_FUNC(cnum)(ctx->ctx_task, ctx, cnum, &v, regs);
+			ret = (*rd_func)(ctx->ctx_task, ctx, cnum, &v, regs);
 			if (ret) goto error;
 			val = v;
 			ret = -EINVAL;
@@ -3463,7 +3483,7 @@ pfm_use_debug_registers(struct task_struct *task)
 	unsigned long flags;
 	int ret = 0;
 
-	if (pmu_conf.use_rr_dbregs == 0) return 0;
+	if (pmu_conf->use_rr_dbregs == 0) return 0;
 
 	DPRINT(("called for [%d]\n", task->pid));
 
@@ -3517,7 +3537,7 @@ pfm_release_debug_registers(struct task_struct *task)
 	unsigned long flags;
 	int ret;
 
-	if (pmu_conf.use_rr_dbregs == 0) return 0;
+	if (pmu_conf->use_rr_dbregs == 0) return 0;
 
 	LOCK_PFS(flags);
 	if (pfm_sessions.pfs_ptrace_use_dbregs == 0) {
@@ -3720,7 +3740,7 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_
 	int i, can_access_pmu = 0;
 	int is_system, is_loaded;
 
-	if (pmu_conf.use_rr_dbregs == 0) return -EINVAL;
+	if (pmu_conf->use_rr_dbregs == 0) return -EINVAL;
 
 	state     = ctx->ctx_state;
 	is_loaded = state == PFM_CTX_LOADED ? 1 : 0;
@@ -3802,14 +3822,14 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_
  	 */
 	if (first_time && can_access_pmu) {
 		DPRINT(("[%d] clearing ibrs, dbrs\n", task->pid));
-		for (i=0; i < pmu_conf.num_ibrs; i++) {
+		for (i=0; i < pmu_conf->num_ibrs; i++) {
 			ia64_set_ibr(i, 0UL);
-			ia64_srlz_i();
+			ia64_dv_serialize_instruction();
 		}
 		ia64_srlz_i();
-		for (i=0; i < pmu_conf.num_dbrs; i++) {
+		for (i=0; i < pmu_conf->num_dbrs; i++) {
 			ia64_set_dbr(i, 0UL);
-			ia64_srlz_d();
+			ia64_dv_serialize_data();
 		}
 		ia64_srlz_d();
 	}
@@ -3856,7 +3876,10 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_
 		if (mode == PFM_CODE_RR) {
 			CTX_USED_IBR(ctx, rnum);
 
-			if (can_access_pmu) ia64_set_ibr(rnum, dbreg.val);
+			if (can_access_pmu) {
+				ia64_set_ibr(rnum, dbreg.val);
+				ia64_dv_serialize_instruction();
+			}
 
 			ctx->ctx_ibrs[rnum] = dbreg.val;
 
@@ -3865,8 +3888,10 @@ pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_
 		} else {
 			CTX_USED_DBR(ctx, rnum);
 
-			if (can_access_pmu) ia64_set_dbr(rnum, dbreg.val);
-
+			if (can_access_pmu) {
+				ia64_set_dbr(rnum, dbreg.val);
+				ia64_dv_serialize_data();
+			}
 			ctx->ctx_dbrs[rnum] = dbreg.val;
 
 			DPRINT(("write dbr%u=0x%lx used_dbrs=0x%x is_loaded=%d access_pmu=%d\n",
@@ -4367,8 +4392,8 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
 		 * guaranteed safe by earlier check against DBG_VALID
 		 */
 		if (ctx->ctx_fl_using_dbreg) {
-			pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf.num_ibrs);
-			pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf.num_dbrs);
+			pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf->num_ibrs);
+			pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf->num_dbrs);
 		}
 		/*
 		 * set new ownership
@@ -4777,7 +4802,7 @@ sys_perfmonctl (int fd, int cmd, void *arg, int count, long arg5, long arg6, lon
 	/*
 	 * reject any call if perfmon was disabled at initialization
 	 */
-	if (unlikely(PFM_IS_DISABLED())) return -ENOSYS;
+	if (unlikely(pmu_conf == NULL)) return -ENOSYS;
 
 	if (unlikely(cmd < 0 || cmd >= PFM_CMD_COUNT)) {
 		DPRINT(("invalid cmd=%d\n", cmd));
@@ -5178,7 +5203,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
 
 	tstamp   = ia64_get_itc();
 	mask     = pmc0 >> PMU_FIRST_COUNTER;
-	ovfl_val = pmu_conf.ovfl_val;
+	ovfl_val = pmu_conf->ovfl_val;
 	has_smpl = CTX_HAS_SMPL(ctx);
 
 	DPRINT_ovfl(("pmc0=0x%lx pid=%d iip=0x%lx, %s "
@@ -5536,111 +5561,185 @@ pfm_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
 	return IRQ_HANDLED;
 }
 
+/*
+ * /proc/perfmon interface, for debug only
+ */
+
+#define PFM_PROC_SHOW_HEADER	((void *)NR_CPUS+1)
 
-/* for debug only */
-static int
-pfm_proc_info(char *page)
+static void *
+pfm_proc_start(struct seq_file *m, loff_t *pos)
 {
-	char *p = page;
-	struct list_head * pos;
-	pfm_buffer_fmt_t * entry;
-	unsigned long psr, flags;
-	int online_cpus = 0;
-	int i;
+	if (*pos == 0) {
+		return PFM_PROC_SHOW_HEADER;
+	}
 
-		p += sprintf(p, "perfmon version           : %u.%u\n", PFM_VERSION_MAJ, PFM_VERSION_MIN);
-		p += sprintf(p, "model                     : %s\n", pmu_conf.pmu_name);
-		p += sprintf(p, "fastctxsw                 : %s\n", pfm_sysctl.fastctxsw > 0 ? "Yes": "No");
-		p += sprintf(p, "expert mode               : %s\n", pfm_sysctl.expert_mode > 0 ? "Yes": "No");
-		p += sprintf(p, "ovfl_mask                 : 0x%lx\n", pmu_conf.ovfl_val);
-
-	for(i=0; i < NR_CPUS; i++) {
-		if (cpu_online(i) == 0) continue;
-		p += sprintf(p, "CPU%-2d overflow intrs      : %lu\n", i, pfm_stats[i].pfm_ovfl_intr_count);
-		p += sprintf(p, "CPU%-2d overflow cycles     : %lu\n", i, pfm_stats[i].pfm_ovfl_intr_cycles);
-		p += sprintf(p, "CPU%-2d overflow min        : %lu\n", i, pfm_stats[i].pfm_ovfl_intr_cycles_min);
-		p += sprintf(p, "CPU%-2d overflow max        : %lu\n", i, pfm_stats[i].pfm_ovfl_intr_cycles_max);
-		p += sprintf(p, "CPU%-2d smpl handler calls  : %lu\n", i, pfm_stats[i].pfm_smpl_handler_calls);
-		p += sprintf(p, "CPU%-2d smpl handler cycles : %lu\n", i, pfm_stats[i].pfm_smpl_handler_cycles);
-		p += sprintf(p, "CPU%-2d spurious intrs      : %lu\n", i, pfm_stats[i].pfm_spurious_ovfl_intr_count);
-		p += sprintf(p, "CPU%-2d replay   intrs      : %lu\n", i, pfm_stats[i].pfm_replay_ovfl_intr_count);
-		p += sprintf(p, "CPU%-2d syst_wide           : %d\n" , i, pfm_get_cpu_data(pfm_syst_info, i) & PFM_CPUINFO_SYST_WIDE ? 1 : 0);
-		p += sprintf(p, "CPU%-2d dcr_pp              : %d\n" , i, pfm_get_cpu_data(pfm_syst_info, i) & PFM_CPUINFO_DCR_PP ? 1 : 0);
-		p += sprintf(p, "CPU%-2d exclude idle        : %d\n" , i, pfm_get_cpu_data(pfm_syst_info, i) & PFM_CPUINFO_EXCL_IDLE ? 1 : 0);
-		p += sprintf(p, "CPU%-2d owner               : %d\n" , i, pfm_get_cpu_data(pmu_owner, i) ? pfm_get_cpu_data(pmu_owner, i)->pid: -1);
-		p += sprintf(p, "CPU%-2d context             : %p\n" , i, pfm_get_cpu_data(pmu_ctx, i));
-		p += sprintf(p, "CPU%-2d activations         : %lu\n", i, pfm_get_cpu_data(pmu_activation_number,i));
-		online_cpus++;
-	}
-
-	if (online_cpus == 1)
-	{
-		psr = pfm_get_psr();
-		ia64_srlz_d();
-		p += sprintf(p, "CPU%-2d psr                 : 0x%lx\n", smp_processor_id(), psr);
-		p += sprintf(p, "CPU%-2d pmc0                : 0x%lx\n", smp_processor_id(), ia64_get_pmc(0));
-		for(i=4; i < 8; i++) {
-   			p += sprintf(p, "CPU%-2d pmc%u                : 0x%lx\n", smp_processor_id(), i, ia64_get_pmc(i));
-   			p += sprintf(p, "CPU%-2d pmd%u                : 0x%lx\n", smp_processor_id(), i, ia64_get_pmd(i));
-  		}
+	while (*pos <= NR_CPUS) {
+		if (cpu_online(*pos - 1)) {
+			return (void *)*pos;
+		}
+		++*pos;
 	}
+	return NULL;
+}
 
-	LOCK_PFS(flags);
-	p += sprintf(p, "proc_sessions             : %u\n"
-			"sys_sessions              : %u\n"
-			"sys_use_dbregs            : %u\n"
-			"ptrace_use_dbregs         : %u\n",
-			pfm_sessions.pfs_task_sessions,
-			pfm_sessions.pfs_sys_sessions,
-			pfm_sessions.pfs_sys_use_dbregs,
-			pfm_sessions.pfs_ptrace_use_dbregs);
-	UNLOCK_PFS(flags);
+static void *
+pfm_proc_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	++*pos;
+	return pfm_proc_start(m, pos);
+}
+
+static void
+pfm_proc_stop(struct seq_file *m, void *v)
+{
+}
+
+static void
+pfm_proc_show_header(struct seq_file *m)
+{
+	struct list_head * pos;
+	pfm_buffer_fmt_t * entry;
+	unsigned long flags;
+
+ 	seq_printf(m,
+		"perfmon version           : %u.%u\n"
+		"model                     : %s\n"
+		"fastctxsw                 : %s\n"
+		"expert mode               : %s\n"
+		"ovfl_mask                 : 0x%lx\n"
+		"PMU flags                 : 0x%x\n",
+		PFM_VERSION_MAJ, PFM_VERSION_MIN,
+		pmu_conf->pmu_name,
+		pfm_sysctl.fastctxsw > 0 ? "Yes": "No",
+		pfm_sysctl.expert_mode > 0 ? "Yes": "No",
+		pmu_conf->ovfl_val,
+		pmu_conf->flags);
+
+  	LOCK_PFS(flags);
+
+ 	seq_printf(m,
+ 		"proc_sessions             : %u\n"
+ 		"sys_sessions              : %u\n"
+ 		"sys_use_dbregs            : %u\n"
+ 		"ptrace_use_dbregs         : %u\n",
+ 		pfm_sessions.pfs_task_sessions,
+ 		pfm_sessions.pfs_sys_sessions,
+ 		pfm_sessions.pfs_sys_use_dbregs,
+ 		pfm_sessions.pfs_ptrace_use_dbregs);
+
+  	UNLOCK_PFS(flags);
 
 	spin_lock(&pfm_buffer_fmt_lock);
 
 	list_for_each(pos, &pfm_buffer_fmt_list) {
 		entry = list_entry(pos, pfm_buffer_fmt_t, fmt_list);
-		p += sprintf(p, "format                    : %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %s\n",
-				entry->fmt_uuid[0],
-				entry->fmt_uuid[1],
-				entry->fmt_uuid[2],
-				entry->fmt_uuid[3],
-				entry->fmt_uuid[4],
-				entry->fmt_uuid[5],
-				entry->fmt_uuid[6],
-				entry->fmt_uuid[7],
-				entry->fmt_uuid[8],
-				entry->fmt_uuid[9],
-				entry->fmt_uuid[10],
-				entry->fmt_uuid[11],
-				entry->fmt_uuid[12],
-				entry->fmt_uuid[13],
-				entry->fmt_uuid[14],
-				entry->fmt_uuid[15],
-				entry->fmt_name);
+		seq_printf(m, "format                    : %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %s\n",
+			entry->fmt_uuid[0],
+			entry->fmt_uuid[1],
+			entry->fmt_uuid[2],
+			entry->fmt_uuid[3],
+			entry->fmt_uuid[4],
+			entry->fmt_uuid[5],
+			entry->fmt_uuid[6],
+			entry->fmt_uuid[7],
+			entry->fmt_uuid[8],
+			entry->fmt_uuid[9],
+			entry->fmt_uuid[10],
+			entry->fmt_uuid[11],
+			entry->fmt_uuid[12],
+			entry->fmt_uuid[13],
+			entry->fmt_uuid[14],
+			entry->fmt_uuid[15],
+			entry->fmt_name);
 	}
 	spin_unlock(&pfm_buffer_fmt_lock);
 
-	return p - page;
 }
 
-/* /proc interface, for debug only */
 static int
-perfmon_read_entry(char *page, char **start, off_t off, int count, int *eof, void *data)
+pfm_proc_show(struct seq_file *m, void *v)
 {
-	int len = pfm_proc_info(page);
+	unsigned long psr;
+	unsigned int i;
+	int cpu;
+
+	if (v == PFM_PROC_SHOW_HEADER) {
+		pfm_proc_show_header(m);
+		return 0;
+	}
 
-	if (len <= off+count) *eof = 1;
+	/* show info for CPU (v - 1) */
+
+	cpu = (long)v - 1;
+	seq_printf(m,
+		"CPU%-2d overflow intrs      : %lu\n"
+		"CPU%-2d overflow cycles     : %lu\n"
+		"CPU%-2d overflow min        : %lu\n"
+		"CPU%-2d overflow max        : %lu\n"
+		"CPU%-2d smpl handler calls  : %lu\n"
+		"CPU%-2d smpl handler cycles : %lu\n"
+		"CPU%-2d spurious intrs      : %lu\n"
+		"CPU%-2d replay   intrs      : %lu\n"
+		"CPU%-2d syst_wide           : %d\n"
+		"CPU%-2d dcr_pp              : %d\n"
+		"CPU%-2d exclude idle        : %d\n"
+		"CPU%-2d owner               : %d\n"
+		"CPU%-2d context             : %p\n"
+		"CPU%-2d activations         : %lu\n",
+		cpu, pfm_stats[cpu].pfm_ovfl_intr_count,
+		cpu, pfm_stats[cpu].pfm_ovfl_intr_cycles,
+		cpu, pfm_stats[cpu].pfm_ovfl_intr_cycles_min,
+		cpu, pfm_stats[cpu].pfm_ovfl_intr_cycles_max,
+		cpu, pfm_stats[cpu].pfm_smpl_handler_calls,
+		cpu, pfm_stats[cpu].pfm_smpl_handler_cycles,
+		cpu, pfm_stats[cpu].pfm_spurious_ovfl_intr_count,
+		cpu, pfm_stats[cpu].pfm_replay_ovfl_intr_count,
+		cpu, pfm_get_cpu_data(pfm_syst_info, cpu) & PFM_CPUINFO_SYST_WIDE ? 1 : 0,
+		cpu, pfm_get_cpu_data(pfm_syst_info, cpu) & PFM_CPUINFO_DCR_PP ? 1 : 0,
+		cpu, pfm_get_cpu_data(pfm_syst_info, cpu) & PFM_CPUINFO_EXCL_IDLE ? 1 : 0,
+		cpu, pfm_get_cpu_data(pmu_owner, cpu) ? pfm_get_cpu_data(pmu_owner, cpu)->pid: -1,
+		cpu, pfm_get_cpu_data(pmu_ctx, cpu),
+		cpu, pfm_get_cpu_data(pmu_activation_number, cpu));
+
+	if (num_online_cpus() == 1 && pfm_sysctl.debug > 0) {
 
-	*start = page + off;
-	len   -= off;
+		psr = pfm_get_psr();
+
+		ia64_srlz_d();
 
-	if (len>count) len = count;
-	if (len<0) len = 0;
+		seq_printf(m, 
+			"CPU%-2d psr                 : 0x%lx\n"
+			"CPU%-2d pmc0                : 0x%lx\n", 
+			cpu, psr,
+			cpu, ia64_get_pmc(0));
+
+		for (i=0; PMC_IS_LAST(i) == 0;  i++) {
+			if (PMC_IS_COUNTING(i) == 0) continue;
+   			seq_printf(m, 
+				"CPU%-2d pmc%u                : 0x%lx\n"
+   				"CPU%-2d pmd%u                : 0x%lx\n", 
+				cpu, i, ia64_get_pmc(i),
+				cpu, i, ia64_get_pmd(i));
+  		}
+	}
+	return 0;
+}
+
+struct seq_operations pfm_seq_ops = {
+	.start =	pfm_proc_start,
+ 	.next =		pfm_proc_next,
+ 	.stop =		pfm_proc_stop,
+ 	.show =		pfm_proc_show
+};
 
-	return len;
+static int
+pfm_proc_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &pfm_seq_ops);
 }
 
+
 /*
  * we come here as soon as local_cpu_data->pfm_syst_wide is set. this happens
  * during pfm_enable() hence before pfm_start(). We cannot assume monitoring
@@ -5899,6 +5998,7 @@ pfm_load_regs (struct task_struct *task)
 	unsigned long pmc_mask = 0UL, pmd_mask = 0UL;
 	unsigned long flags;
 	u64 psr, psr_up;
+	int need_irq_resend;
 
 	ctx = PFM_GET_CTX(task);
 	if (unlikely(ctx == NULL)) return;
@@ -5919,6 +6019,8 @@ pfm_load_regs (struct task_struct *task)
 	flags = pfm_protect_ctx_ctxsw(ctx);
 	psr   = pfm_get_psr();
 
+	need_irq_resend = pmu_conf->flags & PFM_PMU_IRQ_RESEND;
+
 	BUG_ON(psr & (IA64_PSR_UP|IA64_PSR_PP));
 	BUG_ON(psr & IA64_PSR_I);
 
@@ -5944,8 +6046,8 @@ pfm_load_regs (struct task_struct *task)
 	 * stale state.
 	 */
 	if (ctx->ctx_fl_using_dbreg) {
-		pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf.num_ibrs);
-		pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf.num_dbrs);
+		pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf->num_ibrs);
+		pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf->num_dbrs);
 	}
 	/*
 	 * retrieve saved psr.up
@@ -6004,12 +6106,12 @@ pfm_load_regs (struct task_struct *task)
 		ia64_set_pmc(0, t->pmcs[0]);
 		ia64_srlz_d();
 		t->pmcs[0] = 0UL;
-#ifndef CONFIG_MCKINLEY
+
 		/*
 		 * will replay the PMU interrupt
 		 */
-		hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
-#endif
+		if (need_irq_resend) hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
+
 		pfm_stats[smp_processor_id()].pfm_replay_ovfl_intr_count++;
 	}
 
@@ -6061,6 +6163,7 @@ pfm_load_regs (struct task_struct *task)
 	struct task_struct *owner;
 	unsigned long pmd_mask, pmc_mask;
 	u64 psr, psr_up;
+	int need_irq_resend;
 
 	owner = GET_PMU_OWNER();
 	ctx   = PFM_GET_CTX(task);
@@ -6079,14 +6182,15 @@ pfm_load_regs (struct task_struct *task)
 	 * (not perfmon) by the previous task.
 	 */
 	if (ctx->ctx_fl_using_dbreg) {
-		pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf.num_ibrs);
-		pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf.num_dbrs);
+		pfm_restore_ibrs(ctx->ctx_ibrs, pmu_conf->num_ibrs);
+		pfm_restore_dbrs(ctx->ctx_dbrs, pmu_conf->num_dbrs);
 	}
 
 	/*
 	 * retrieved saved psr.up
 	 */
 	psr_up = ctx->ctx_saved_psr_up;
+	need_irq_resend = pmu_conf->flags & PFM_PMU_IRQ_RESEND;
 
 	/*
 	 * short path, our state is still there, just
@@ -6143,12 +6247,11 @@ pfm_load_regs (struct task_struct *task)
 
 		t->pmcs[0] = 0UL;
 
-#ifndef CONFIG_MCKINLEY
 		/*
 		 * will replay the PMU interrupt
 		 */
-		hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
-#endif
+		if (need_irq_resend) hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
+
 		pfm_stats[smp_processor_id()].pfm_replay_ovfl_intr_count++;
 	}
 
@@ -6222,7 +6325,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
 		 */
 		task->thread.pmcs[0] = 0;
 	}
-	ovfl_val = pmu_conf.ovfl_val;
+	ovfl_val = pmu_conf->ovfl_val;
 	/*
 	 * we save all the used pmds
 	 * we take care of overflows for counting PMDs
@@ -6287,6 +6390,36 @@ static struct irqaction perfmon_irqaction = {
  */
 static int init_pfm_fs(void);
 
+static int __init
+pfm_probe_pmu(void)
+{
+	pmu_config_t **p;
+	int family;
+
+	family = local_cpu_data->family;
+	p      = pmu_confs;
+
+	while(*p) {
+		if ((*p)->probe) {
+			if ((*p)->probe() == 0) goto found;
+		} else if ((*p)->pmu_family == family || (*p)->pmu_family == 0xff) {
+			goto found;
+		}
+		p++;
+	}
+	return -1;
+found:
+	pmu_conf = *p;
+	return 0;
+}
+
+static struct file_operations pfm_proc_fops = {
+	.open		= pfm_proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
 int __init
 pfm_init(void)
 {
@@ -6297,12 +6430,9 @@ pfm_init(void)
 		PFM_VERSION_MIN,
 		IA64_PERFMON_VECTOR);
 
-	/*
-	 * PMU type sanity check
-	 * XXX: maybe better to implement autodetection (but then we have a larger kernel)
-	 */
-	if (local_cpu_data->family != pmu_conf.pmu_family) {
-		printk(KERN_INFO "perfmon: disabled, kernel only supports %s PMU family\n", pmu_conf.pmu_name);
+	if (pfm_probe_pmu()) {
+		printk(KERN_INFO "perfmon: disabled, there is no support for processor family %d\n", 
+				local_cpu_data->family);
 		return -ENODEV;
 	}
 
@@ -6313,56 +6443,64 @@ pfm_init(void)
 	n = 0;
 	for (i=0; PMC_IS_LAST(i) == 0;  i++) {
 		if (PMC_IS_IMPL(i) == 0) continue;
-		pmu_conf.impl_pmcs[i>>6] |= 1UL << (i&63);
+		pmu_conf->impl_pmcs[i>>6] |= 1UL << (i&63);
 		n++;
 	}
-	pmu_conf.num_pmcs = n;
+	pmu_conf->num_pmcs = n;
 
 	n = 0; n_counters = 0;
 	for (i=0; PMD_IS_LAST(i) == 0;  i++) {
 		if (PMD_IS_IMPL(i) == 0) continue;
-		pmu_conf.impl_pmds[i>>6] |= 1UL << (i&63);
+		pmu_conf->impl_pmds[i>>6] |= 1UL << (i&63);
 		n++;
 		if (PMD_IS_COUNTING(i)) n_counters++;
 	}
-	pmu_conf.num_pmds      = n;
-	pmu_conf.num_counters  = n_counters;
+	pmu_conf->num_pmds      = n;
+	pmu_conf->num_counters  = n_counters;
 
 	/*
 	 * sanity checks on the number of debug registers
 	 */
-	if (pmu_conf.use_rr_dbregs) {
-		if (pmu_conf.num_ibrs > IA64_NUM_DBG_REGS) {
-			printk(KERN_INFO "perfmon: unsupported number of code debug registers (%u)\n", pmu_conf.num_ibrs);
+	if (pmu_conf->use_rr_dbregs) {
+		if (pmu_conf->num_ibrs > IA64_NUM_DBG_REGS) {
+			printk(KERN_INFO "perfmon: unsupported number of code debug registers (%u)\n", pmu_conf->num_ibrs);
+			pmu_conf = NULL;
 			return -1;
 		}
-		if (pmu_conf.num_dbrs > IA64_NUM_DBG_REGS) {
-			printk(KERN_INFO "perfmon: unsupported number of data debug registers (%u)\n", pmu_conf.num_ibrs);
+		if (pmu_conf->num_dbrs > IA64_NUM_DBG_REGS) {
+			printk(KERN_INFO "perfmon: unsupported number of data debug registers (%u)\n", pmu_conf->num_ibrs);
+			pmu_conf = NULL;
 			return -1;
 		}
 	}
 
 	printk("perfmon: %s PMU detected, %u PMCs, %u PMDs, %u counters (%lu bits)\n",
-	       pmu_conf.pmu_name,
-	       pmu_conf.num_pmcs,
-	       pmu_conf.num_pmds,
-	       pmu_conf.num_counters,
-	       ffz(pmu_conf.ovfl_val));
+	       pmu_conf->pmu_name,
+	       pmu_conf->num_pmcs,
+	       pmu_conf->num_pmds,
+	       pmu_conf->num_counters,
+	       ffz(pmu_conf->ovfl_val));
 
 	/* sanity check */
-	if (pmu_conf.num_pmds >= IA64_NUM_PMD_REGS || pmu_conf.num_pmcs >= IA64_NUM_PMC_REGS) {
+	if (pmu_conf->num_pmds >= IA64_NUM_PMD_REGS || pmu_conf->num_pmcs >= IA64_NUM_PMC_REGS) {
 		printk(KERN_ERR "perfmon: not enough pmc/pmd, perfmon disabled\n");
+		pmu_conf = NULL;
 		return -1;
 	}
 
 	/*
 	 * create /proc/perfmon (mostly for debugging purposes)
 	 */
-	perfmon_dir = create_proc_read_entry ("perfmon", 0, 0, perfmon_read_entry, NULL);
+ 	perfmon_dir = create_proc_entry("perfmon", S_IRUGO, NULL);
 	if (perfmon_dir == NULL) {
 		printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n");
+		pmu_conf = NULL;
 		return -1;
 	}
+  	/*
+ 	 * install customized file operations for /proc/perfmon entry
+ 	 */
+ 	perfmon_dir->proc_fops = &pfm_proc_fops;
 
 	/*
 	 * create /proc/sys/kernel/perfmon (for debugging purposes)
@@ -6379,9 +6517,6 @@ pfm_init(void)
 
 	for(i=0; i < NR_CPUS; i++) pfm_stats[i].pfm_ovfl_intr_cycles_min = ~0UL;
 
-	/* we are all set */
-	pmu_conf.enabled = 1;
-
 	return 0;
 }
 
@@ -6393,8 +6528,6 @@ __initcall(pfm_init);
 void
 pfm_init_percpu (void)
 {
-	int i;
-
 	/*
 	 * make sure no measurement is active
 	 * (may inherit programmed PMCs from EFI).
@@ -6412,28 +6545,6 @@ pfm_init_percpu (void)
 
 	ia64_setreg(_IA64_REG_CR_PMV, IA64_PERFMON_VECTOR);
 	ia64_srlz_d();
-
-	/*
-	 * we first initialize the PMU to a stable state.
-	 * the values may have been changed from their power-up
-	 * values by software executed before the kernel took over.
-	 *
-	 * At this point, pmu_conf has not yet been initialized
-	 *
-	 * On McKinley, this code is ineffective until PMC4 is initialized
-	 * but that's all right because we take care of pmc0 later.
-	 *
-	 * XXX: potential problems with pmc1.
-	 */
-	for (i=1; PMC_IS_LAST(i) == 0;  i++) {
-		if (PMC_IS_IMPL(i) == 0) continue;
-		ia64_set_pmc(i, PMC_DFL_VAL(i));
-	}
-
-	for (i=0; PMD_IS_LAST(i) == 0; i++) {
-		if (PMD_IS_IMPL(i) == 0) continue;
-		ia64_set_pmd(i, 0UL);
-	}
 }
 
 /*
diff --git a/arch/ia64/kernel/perfmon_generic.h b/arch/ia64/kernel/perfmon_generic.h
index 39aecdb2a..674894780 100644
--- a/arch/ia64/kernel/perfmon_generic.h
+++ b/arch/ia64/kernel/perfmon_generic.h
@@ -6,13 +6,6 @@
  *               Stephane Eranian <eranian@hpl.hp.com>
  */
 
-
-#define RDEP(x)	(1UL<<(x))
-
-#if defined(CONFIG_ITANIUM) || defined (CONFIG_MCKINLEY)
-#error "This file should not be used when CONFIG_ITANIUM or CONFIG_MCKINLEY is defined"
-#endif
-
 static pfm_reg_desc_t pfm_gen_pmc_desc[PMU_MAX_PMCS]={
 /* pmc0  */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
 /* pmc1  */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
@@ -40,10 +33,9 @@ static pfm_reg_desc_t pfm_gen_pmd_desc[PMU_MAX_PMDS]={
 /*
  * impl_pmcs, impl_pmds are computed at runtime to minimize errors!
  */
-static pmu_config_t pmu_conf={
+static pmu_config_t pmu_conf_gen={
 	.pmu_name   = "Generic",
 	.pmu_family = 0xff, /* any */
-	.enabled    = 0,
 	.ovfl_val   = (1UL << 32) - 1,
 	.num_ibrs   = 0, /* does not use */
 	.num_dbrs   = 0, /* does not use */
diff --git a/arch/ia64/kernel/perfmon_itanium.h b/arch/ia64/kernel/perfmon_itanium.h
index af81ba44b..d1d508a0f 100644
--- a/arch/ia64/kernel/perfmon_itanium.h
+++ b/arch/ia64/kernel/perfmon_itanium.h
@@ -5,15 +5,7 @@
  * Copyright (C) 2002-2003  Hewlett Packard Co
  *               Stephane Eranian <eranian@hpl.hp.com>
  */
-
-#define RDEP(x)	(1UL<<(x))
-
-#ifndef CONFIG_ITANIUM
-#error "This file is only valid when CONFIG_ITANIUM is defined"
-#endif
-
 static int pfm_ita_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
-static int pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
 
 static pfm_reg_desc_t pfm_ita_pmc_desc[PMU_MAX_PMCS]={
 /* pmc0  */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
@@ -55,31 +47,22 @@ static pfm_reg_desc_t pfm_ita_pmd_desc[PMU_MAX_PMDS]={
 	    { PFM_REG_END     , 0, 0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
 };
 
-/*
- * impl_pmcs, impl_pmds are computed at runtime to minimize errors!
- */
-static pmu_config_t pmu_conf={
-	.pmu_name      = "Itanium",
-	.pmu_family    = 0x7,
-	.enabled       = 0,
-	.ovfl_val      = (1UL << 32) - 1,
-	.pmd_desc      = pfm_ita_pmd_desc,
-	.pmc_desc      = pfm_ita_pmc_desc,
-	.num_ibrs      = 8,
-	.num_dbrs      = 8,
-	.use_rr_dbregs = 1 /* debug register are use for range retrictions */
-};
-
 static int
 pfm_ita_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, unsigned long *val, struct pt_regs *regs)
 {
 	int ret;
+	int is_loaded;
+
+	/* sanitfy check */
+	if (ctx == NULL) return -EINVAL;
+
+	is_loaded = ctx->ctx_state == PFM_CTX_LOADED || ctx->ctx_state == PFM_CTX_MASKED;
 
 	/*
 	 * we must clear the (instruction) debug registers if pmc13.ta bit is cleared
 	 * before they are written (fl_using_dbreg==0) to avoid picking up stale information.
 	 */
-	if (cnum == 13 && ((*val & 0x1) == 0UL) && ctx->ctx_fl_using_dbreg == 0) {
+	if (cnum == 13 && is_loaded && ((*val & 0x1) == 0UL) && ctx->ctx_fl_using_dbreg == 0) {
 
 		DPRINT(("pmc[%d]=0x%lx has active pmc13.ta cleared, clearing ibr\n", cnum, *val));
 
@@ -98,7 +81,7 @@ pfm_ita_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnu
 	 * we must clear the (data) debug registers if pmc11.pt bit is cleared
 	 * before they are written (fl_using_dbreg==0) to avoid picking up stale information.
 	 */
-	if (cnum == 11 && ((*val >> 28)& 0x1) == 0 && ctx->ctx_fl_using_dbreg == 0) {
+	if (cnum == 11 && is_loaded && ((*val >> 28)& 0x1) == 0 && ctx->ctx_fl_using_dbreg == 0) {
 
 		DPRINT(("pmc[%d]=0x%lx has active pmc11.pt cleared, clearing dbr\n", cnum, *val));
 
@@ -115,3 +98,18 @@ pfm_ita_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnu
 	return 0;
 }
 
+/*
+ * impl_pmcs, impl_pmds are computed at runtime to minimize errors!
+ */
+static pmu_config_t pmu_conf_ita={
+	.pmu_name      = "Itanium",
+	.pmu_family    = 0x7,
+	.ovfl_val      = (1UL << 32) - 1,
+	.pmd_desc      = pfm_ita_pmd_desc,
+	.pmc_desc      = pfm_ita_pmc_desc,
+	.num_ibrs      = 8,
+	.num_dbrs      = 8,
+	.use_rr_dbregs = 1, /* debug register are use for range retrictions */
+};
+
+
diff --git a/arch/ia64/kernel/perfmon_mckinley.h b/arch/ia64/kernel/perfmon_mckinley.h
index 898146b07..9becccda2 100644
--- a/arch/ia64/kernel/perfmon_mckinley.h
+++ b/arch/ia64/kernel/perfmon_mckinley.h
@@ -5,15 +5,7 @@
  * Copyright (C) 2002-2003  Hewlett Packard Co
  *               Stephane Eranian <eranian@hpl.hp.com>
  */
-
-#define RDEP(x)	(1UL<<(x))
-
-#ifndef CONFIG_MCKINLEY
-#error "This file is only valid when CONFIG_MCKINLEY is defined"
-#endif
-
 static int pfm_mck_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
-static int pfm_write_ibr_dbr(int mode, pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
 
 static pfm_reg_desc_t pfm_mck_pmc_desc[PMU_MAX_PMCS]={
 /* pmc0  */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
@@ -57,21 +49,6 @@ static pfm_reg_desc_t pfm_mck_pmd_desc[PMU_MAX_PMDS]={
 	    { PFM_REG_END     , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
 };
 
-/*
- * impl_pmcs, impl_pmds are computed at runtime to minimize errors!
- */
-static pmu_config_t pmu_conf={
-	.pmu_name      = "Itanium 2",
-	.pmu_family    = 0x1f,
-	.enabled       = 0,
-	.ovfl_val      = (1UL << 47) - 1,
-	.pmd_desc      = pfm_mck_pmd_desc,
-	.pmc_desc      = pfm_mck_pmc_desc,
-	.num_ibrs       = 8,
-	.num_dbrs       = 8,
-	.use_rr_dbregs = 1 /* debug register are use for range retrictions */
-};
-
 /*
  * PMC reserved fields must have their power-up values preserved
  */
@@ -120,12 +97,11 @@ pfm_mck_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnu
 	 * 	one of the pmc13.cfg_dbrpXX field is different from 0x3
 	 * AND
 	 * 	at the corresponding pmc13.ena_dbrpXX is set.
-	 *
-	 * For now, we just check on cfg_dbrXX != 0x3.
 	 */
 	DPRINT(("cnum=%u val=0x%lx, using_dbreg=%d loaded=%d\n", cnum, *val, ctx->ctx_fl_using_dbreg, is_loaded));
 
-	if (cnum == 13 && is_loaded && ((*val & 0x18181818UL) != 0x18181818UL) && ctx->ctx_fl_using_dbreg == 0) {
+	if (cnum == 13 && is_loaded
+	    && (*val & 0x1e00000000000UL) && (*val & 0x18181818UL) != 0x18181818UL && ctx->ctx_fl_using_dbreg == 0) {
 
 		DPRINT(("pmc[%d]=0x%lx has active pmc13 settings, clearing dbr\n", cnum, *val));
 
@@ -192,3 +168,20 @@ pfm_mck_pmc_check(struct task_struct *task, pfm_context_t *ctx, unsigned int cnu
 
 	return ret ? -EINVAL : 0;
 }
+
+/*
+ * impl_pmcs, impl_pmds are computed at runtime to minimize errors!
+ */
+static pmu_config_t pmu_conf_mck={
+	.pmu_name      = "Itanium 2",
+	.pmu_family    = 0x1f,
+	.flags	       = PFM_PMU_IRQ_RESEND,
+	.ovfl_val      = (1UL << 47) - 1,
+	.pmd_desc      = pfm_mck_pmd_desc,
+	.pmc_desc      = pfm_mck_pmc_desc,
+	.num_ibrs       = 8,
+	.num_dbrs       = 8,
+	.use_rr_dbregs = 1 /* debug register are use for range retrictions */
+};
+
+
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 0d245cbcd..7455e4894 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -7,6 +7,7 @@
 #define __KERNEL_SYSCALLS__	/* see <asm/unistd.h> */
 #include <linux/config.h>
 
+#include <linux/cpu.h>
 #include <linux/pm.h>
 #include <linux/elf.h>
 #include <linux/errno.h>
@@ -14,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/module.h>
+#include <linux/notifier.h>
 #include <linux/personality.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -22,13 +24,17 @@
 #include <linux/thread_info.h>
 #include <linux/unistd.h>
 #include <linux/efi.h>
+#include <linux/interrupt.h>
 
+#include <asm/cpu.h>
 #include <asm/delay.h>
 #include <asm/elf.h>
 #include <asm/ia32.h>
+#include <asm/irq.h>
 #include <asm/pgalloc.h>
 #include <asm/processor.h>
 #include <asm/sal.h>
+#include <asm/tlbflush.h>
 #include <asm/uaccess.h>
 #include <asm/unwind.h>
 #include <asm/user.h>
@@ -90,6 +96,7 @@ show_regs (struct pt_regs *regs)
 {
 	unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
 
+	print_modules();
 	printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm);
 	printk("psr : %016lx ifs : %016lx ip  : [<%016lx>]    %s\n",
 	       regs->cr_ipsr, regs->cr_ifs, ip, print_tainted());
@@ -180,6 +187,40 @@ default_idle (void)
 			safe_halt();
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+/* We don't actually take CPU down, just spin without interrupts. */
+static inline void play_dead(void)
+{
+	extern void ia64_cpu_local_tick (void);
+	/* Ack it */
+	__get_cpu_var(cpu_state) = CPU_DEAD;
+
+	/* We shouldn't have to disable interrupts while dead, but
+	 * some interrupts just don't seem to go away, and this makes
+	 * it "work" for testing purposes. */
+	max_xtp();
+	local_irq_disable();
+	/* Death loop */
+	while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
+		cpu_relax();
+
+	/*
+	 * Enable timer interrupts from now on
+	 * Not required if we put processor in SAL_BOOT_RENDEZ mode.
+	 */
+	local_flush_tlb_all();
+	cpu_set(smp_processor_id(), cpu_online_map);
+	wmb();
+	ia64_cpu_local_tick ();
+	local_irq_enable();
+}
+#else
+static inline void play_dead(void)
+{
+	BUG();
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 void __attribute__((noreturn))
 cpu_idle (void *unused)
 {
@@ -195,7 +236,6 @@ cpu_idle (void *unused)
 		if (!need_resched())
 			min_xtp();
 #endif
-
 		while (!need_resched()) {
 			if (mark_idle)
 				(*mark_idle)(1);
@@ -210,6 +250,8 @@ cpu_idle (void *unused)
 #endif
 		schedule();
 		check_pgt_cache();
+		if (cpu_is_offline(smp_processor_id()))
+			play_dead();
 	}
 }
 
@@ -657,11 +699,6 @@ get_wchan (struct task_struct *p)
 	struct unw_frame_info info;
 	unsigned long ip;
 	int count = 0;
-	/*
-	 * These bracket the sleeping functions..
-	 */
-#	define first_sched	((unsigned long) scheduling_functions_start_here)
-#	define last_sched	((unsigned long) scheduling_functions_end_here)
 
 	/*
 	 * Note: p may not be a blocked task (it could be current or
@@ -676,12 +713,10 @@ get_wchan (struct task_struct *p)
 		if (unw_unwind(&info) < 0)
 			return 0;
 		unw_get_ip(&info, &ip);
-		if (ip < first_sched || ip >= last_sched)
+		if (!in_sched_functions(ip))
 			return ip;
 	} while (count++ < 16);
 	return 0;
-#	undef first_sched
-#	undef last_sched
 }
 
 void
diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c
index e00974721..82a9b8930 100644
--- a/arch/ia64/kernel/sal.c
+++ b/arch/ia64/kernel/sal.c
@@ -122,10 +122,23 @@ sal_desc_entry_point (void *p)
 static void __init
 set_smp_redirect (int flag)
 {
+#ifndef CONFIG_HOTPLUG_CPU
 	if (no_int_routing)
 		smp_int_redirect &= ~flag;
 	else
 		smp_int_redirect |= flag;
+#else
+	/*
+	 * For CPU Hotplug we dont want to do any chipset supported
+	 * interrupt redirection. The reason is this would require that
+	 * All interrupts be stopped and hard bind the irq to a cpu.
+	 * Later when the interrupt is fired we need to set the redir hint
+	 * on again in the vector. This is combersome for something that the
+	 * user mode irq balancer will solve anyways.
+	 */
+	no_int_routing=1;
+	smp_int_redirect &= ~flag;
+#endif
 }
 #else
 #define set_smp_redirect(flag)	do { } while (0)
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 993d09657..aa2cb4fc3 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -330,18 +330,8 @@ setup_arch (char **cmdline_p)
 		setup_serial_hcdp(efi.hcdp);
 	}
 #endif
-	/*
-	 * Without HCDP, we won't discover any serial ports until the serial driver looks
-	 * in the ACPI namespace.  If ACPI claims there are some legacy devices, register
-	 * the legacy COM ports so serial console works earlier.  This is slightly dangerous
-	 * because we don't *really* know whether there's anything there, but we hope that
-	 * all new boxes will implement HCDP.
-	 */
-	{
-		extern unsigned char acpi_legacy_devices;
-		if (!efi.hcdp && acpi_legacy_devices)
-			setup_serial_legacy();
-	}
+	if (!efi.hcdp)
+		setup_serial_legacy();
 #endif
 
 #ifdef CONFIG_VT
@@ -575,7 +565,7 @@ get_max_cacheline_size (void)
 void
 cpu_init (void)
 {
-	extern void __init ia64_mmu_init (void *);
+	extern void __devinit ia64_mmu_init (void *);
 	unsigned long num_phys_stacked;
 	pal_vm_info_2_u_t vmi;
 	unsigned int max_ctx;
@@ -635,6 +625,9 @@ cpu_init (void)
 	ia32_cpu_init();
 #endif
 
+	/* Clear ITC to eliminiate sched_clock() overflows in human time.  */
+	ia64_set_itc(0);
+
 	/* disable all local interrupt sources: */
 	ia64_set_itv(1 << 16);
 	ia64_set_lrr0(1 << 16);
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index ff2268b7b..5a609295a 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -42,23 +42,6 @@
 # define GET_SIGSET(k,u)	__get_user((k)->sig[0], &(u)->sig[0])
 #endif
 
-#ifdef ASM_SUPPORTED
-/*
- * Don't let GCC uses f16-f31 so that when we setup/restore the registers in the signal
- * context in __kernel_sigtramp(), we can be sure that registers f16-f31 contain user-level
- * values.
- */
-register double f16 asm ("f16"); register double f17 asm ("f17");
-register double f18 asm ("f18"); register double f19 asm ("f19");
-register double f20 asm ("f20"); register double f21 asm ("f21");
-register double f22 asm ("f22"); register double f23 asm ("f23");
-
-register double f24 asm ("f24"); register double f25 asm ("f25");
-register double f26 asm ("f26"); register double f27 asm ("f27");
-register double f28 asm ("f28"); register double f29 asm ("f29");
-register double f30 asm ("f30"); register double f31 asm ("f31");
-#endif
-
 long
 ia64_rt_sigsuspend (sigset_t *uset, size_t sigsetsize, struct sigscratch *scr)
 {
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 7f56a4986..99f008853 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -28,7 +28,6 @@
 #include <linux/mm.h>
 #include <linux/cache.h>
 #include <linux/delay.h>
-#include <linux/cache.h>
 #include <linux/efi.h>
 
 #include <asm/atomic.h>
@@ -71,10 +70,23 @@ static volatile struct call_data_struct *call_data;
 /* This needs to be cacheline aligned because it is written to by *other* CPUs.  */
 static DEFINE_PER_CPU(u64, ipi_operation) ____cacheline_aligned;
 
+extern void cpu_halt (void);
+
+void
+lock_ipi_calllock(void)
+{
+	spin_lock_irq(&call_lock);
+}
+
+void
+unlock_ipi_calllock(void)
+{
+	spin_unlock_irq(&call_lock);
+}
+
 static void
 stop_this_cpu (void)
 {
-	extern void cpu_halt (void);
 	/*
 	 * Remove this CPU:
 	 */
@@ -84,6 +96,17 @@ stop_this_cpu (void)
 	cpu_halt();
 }
 
+void
+cpu_die(void)
+{
+	max_xtp();
+	local_irq_disable();
+	cpu_halt();
+	/* Should never be here */
+	BUG();
+	for (;;);
+}
+
 irqreturn_t
 handle_IPI (int irq, void *dev_id, struct pt_regs *regs)
 {
@@ -308,6 +331,9 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai
 	if (!cpus)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.started, 0);
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 1db117af8..8cef119ac 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/acpi.h>
 #include <linux/bootmem.h>
+#include <linux/cpu.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -22,10 +23,12 @@
 #include <linux/kernel.h>
 #include <linux/kernel_stat.h>
 #include <linux/mm.h>
+#include <linux/notifier.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
 #include <linux/efi.h>
+#include <linux/percpu.h>
 
 #include <asm/atomic.h>
 #include <asm/bitops.h>
@@ -44,6 +47,7 @@
 #include <asm/ptrace.h>
 #include <asm/sal.h>
 #include <asm/system.h>
+#include <asm/tlbflush.h>
 #include <asm/unistd.h>
 
 #define SMP_DEBUG 0
@@ -69,17 +73,22 @@ static volatile unsigned long go[SLAVE + 1];
 
 #define DEBUG_ITC_SYNC	0
 
-extern void __init calibrate_delay (void);
+extern void __devinit calibrate_delay (void);
 extern void start_ap (void);
 extern unsigned long ia64_iobase;
 
 task_t *task_for_booting_cpu;
 
-/* Bitmask of currently online CPUs */
+/*
+ * State for each CPU
+ */
+DEFINE_PER_CPU(int, cpu_state);
+
+/* Bitmasks of currently online, and possible CPUs */
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
-cpumask_t phys_cpu_present_map;
-EXPORT_SYMBOL(phys_cpu_present_map);
+cpumask_t cpu_possible_map;
+EXPORT_SYMBOL(cpu_possible_map);
 
 /* which logical CPU number maps to which CPU (physical APIC ID) */
 volatile int ia64_cpu_to_sapicid[NR_CPUS];
@@ -99,6 +108,7 @@ static int __init
 nointroute (char *str)
 {
 	no_int_routing = 1;
+	printk ("no_int_routing on\n");
 	return 1;
 }
 
@@ -192,7 +202,6 @@ ia64_sync_itc (unsigned int master)
 {
 	long i, delta, adj, adjust_latency = 0, done = 0;
 	unsigned long flags, rt, master_time_stamp, bound;
-	extern void ia64_cpu_local_tick (void);
 #if DEBUG_ITC_SYNC
 	struct {
 		long rt;	/* roundtrip time */
@@ -202,6 +211,14 @@ ia64_sync_itc (unsigned int master)
 	} t[NUM_ROUNDS];
 #endif
 
+	/*
+	 * Make sure local timer ticks are disabled while we sync.  If
+	 * they were enabled, we'd have to worry about nasty issues
+	 * like setting the ITC ahead of (or a long time before) the
+	 * next scheduled tick.
+	 */
+	BUG_ON((ia64_get_itv() & (1 << 16)) == 0);
+
 	go[MASTER] = 1;
 
 	if (smp_call_function_single(master, sync_master, NULL, 1, 0) < 0) {
@@ -247,27 +264,17 @@ ia64_sync_itc (unsigned int master)
 
 	printk(KERN_INFO "CPU %d: synchronized ITC with CPU %u (last diff %ld cycles, "
 	       "maxerr %lu cycles)\n", smp_processor_id(), master, delta, rt);
-
-	/*
-	 * Check whether we sync'd the itc ahead of the next timer interrupt.  If so, just
-	 * reset it.
-	 */
-	if (time_after(ia64_get_itc(), local_cpu_data->itm_next)) {
-		Dprintk("CPU %d: oops, jumped a timer tick; resetting timer.\n",
-			smp_processor_id());
-		ia64_cpu_local_tick();
-	}
 }
 
 /*
  * Ideally sets up per-cpu profiling hooks.  Doesn't do much now...
  */
-static inline void __init
+static inline void __devinit
 smp_setup_percpu_timer (void)
 {
 }
 
-static void __init
+static void __devinit
 smp_callin (void)
 {
 	int cpuid, phys_id;
@@ -280,23 +287,17 @@ smp_callin (void)
 	cpuid = smp_processor_id();
 	phys_id = hard_smp_processor_id();
 
-	if (cpu_test_and_set(cpuid, cpu_online_map)) {
+	if (cpu_online(cpuid)) {
 		printk(KERN_ERR "huh, phys CPU#0x%x, CPU#0x%x already present??\n",
 		       phys_id, cpuid);
 		BUG();
 	}
 
-	smp_setup_percpu_timer();
-
-	/*
-	 * Get our bogomips.
-	 */
-	ia64_init_itm();
+	lock_ipi_calllock();
+	cpu_set(cpuid, cpu_online_map);
+	unlock_ipi_calllock();
 
-	/*
-	 * Set I/O port base per CPU
-	 */
-	ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase));
+	smp_setup_percpu_timer();
 
 	ia64_mca_cmc_vector_setup();	/* Setup vector on AP & enable */
 
@@ -305,11 +306,6 @@ smp_callin (void)
 #endif
 
 	local_irq_enable();
-	calibrate_delay();
-	local_cpu_data->loops_per_jiffy = loops_per_jiffy;
-#ifdef CONFIG_IA32_SUPPORT
-	ia32_gdt_init();
-#endif
 
 	if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) {
 		/*
@@ -322,6 +318,17 @@ smp_callin (void)
 		ia64_sync_itc(0);
 	}
 
+	/*
+	 * Get our bogomips.
+	 */
+	ia64_init_itm();
+	calibrate_delay();
+	local_cpu_data->loops_per_jiffy = loops_per_jiffy;
+
+#ifdef CONFIG_IA32_SUPPORT
+	ia32_gdt_init();
+#endif
+
 	/*
 	 * Allow the master to continue.
 	 */
@@ -333,11 +340,14 @@ smp_callin (void)
 /*
  * Activate a secondary processor.  head.S calls this.
  */
-int __init
+int __devinit
 start_secondary (void *unused)
 {
 	extern int cpu_idle (void);
 
+	/* Early console may use I/O ports */
+	ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase));
+
 	Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id());
 	efi_map_pal_code();
 	cpu_init();
@@ -346,7 +356,7 @@ start_secondary (void *unused)
 	return cpu_idle();
 }
 
-static struct task_struct * __init
+static struct task_struct * __devinit
 fork_by_hand (void)
 {
 	/*
@@ -356,29 +366,51 @@ fork_by_hand (void)
 	return copy_process(CLONE_VM|CLONE_IDLETASK, 0, 0, 0, NULL, NULL);
 }
 
-static int __init
+struct create_idle {
+	struct task_struct *idle;
+	struct completion done;
+};
+
+void
+do_fork_idle(void *_c_idle)
+{
+	struct create_idle *c_idle = _c_idle;
+
+	c_idle->idle = fork_by_hand();
+	complete(&c_idle->done);
+}
+
+static int __devinit
 do_boot_cpu (int sapicid, int cpu)
 {
-	struct task_struct *idle;
 	int timeout;
+	struct create_idle c_idle;
+	DECLARE_WORK(work, do_fork_idle, &c_idle);
 
+	init_completion(&c_idle.done);
 	/*
 	 * We can't use kernel_thread since we must avoid to reschedule the child.
 	 */
-	idle = fork_by_hand();
-	if (IS_ERR(idle))
+	if (!keventd_up() || current_is_keventd())
+		work.func(work.data);
+	else {
+		schedule_work(&work);
+		wait_for_completion(&c_idle.done);
+	}
+
+	if (IS_ERR(c_idle.idle))
 		panic("failed fork for CPU %d", cpu);
-	wake_up_forked_process(idle);
+	wake_up_forked_process(c_idle.idle);
 
 	/*
 	 * We remove it from the pidhash and the runqueue
 	 * once we got the process:
 	 */
-	init_idle(idle, cpu);
+	init_idle(c_idle.idle, cpu);
 
-	unhash_process(idle);
+	unhash_process(c_idle.idle);
 
-	task_for_booting_cpu = idle;
+	task_for_booting_cpu = c_idle.idle;
 
 	Dprintk("Sending wakeup vector %lu to AP 0x%x/0x%x.\n", ap_wakeup_vector, cpu, sapicid);
 
@@ -437,18 +469,23 @@ smp_build_cpu_map (void)
 	int sapicid, cpu, i;
 	int boot_cpu_id = hard_smp_processor_id();
 
-	for (cpu = 0; cpu < NR_CPUS; cpu++)
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		ia64_cpu_to_sapicid[cpu] = -1;
+#ifdef CONFIG_HOTPLUG_CPU
+		cpu_set(cpu, cpu_possible_map);
+#endif
+	}
 
 	ia64_cpu_to_sapicid[0] = boot_cpu_id;
-	cpus_clear(phys_cpu_present_map);
-	cpu_set(0, phys_cpu_present_map);
-
+	cpus_clear(cpu_present_map);
+	cpu_set(0, cpu_present_map);
+	cpu_set(0, cpu_possible_map);
 	for (cpu = 1, i = 0; i < smp_boot_data.cpu_count; i++) {
 		sapicid = smp_boot_data.cpu_phys_id[i];
 		if (sapicid == boot_cpu_id)
 			continue;
-		cpu_set(cpu, phys_cpu_present_map);
+		cpu_set(cpu, cpu_present_map);
+		cpu_set(cpu, cpu_possible_map);
 		ia64_cpu_to_sapicid[cpu] = sapicid;
 		cpu++;
 	}
@@ -487,7 +524,7 @@ build_cpu_to_node_map (void)
 #else
 #		error Fixme: Dunno how to build CPU-to-node map.
 #endif
-		cpu_to_node_map[cpu] = node;
+		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
 		if (node >= 0)
 			cpu_set(cpu, node_to_cpu_mask[node]);
 	}
@@ -529,9 +566,11 @@ smp_prepare_cpus (unsigned int max_cpus)
 	if (!max_cpus) {
 		printk(KERN_INFO "SMP mode deactivated.\n");
 		cpus_clear(cpu_online_map);
-		cpus_clear(phys_cpu_present_map);
+		cpus_clear(cpu_present_map);
+		cpus_clear(cpu_possible_map);
 		cpu_set(0, cpu_online_map);
-		cpu_set(0, phys_cpu_present_map);
+		cpu_set(0, cpu_present_map);
+		cpu_set(0, cpu_possible_map);
 		return;
 	}
 }
@@ -542,6 +581,74 @@ void __devinit smp_prepare_boot_cpu(void)
 	cpu_set(smp_processor_id(), cpu_callin_map);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+extern void fixup_irqs(void);
+/* must be called with cpucontrol mutex held */
+static int __devinit cpu_enable(unsigned int cpu)
+{
+	per_cpu(cpu_state,cpu) = CPU_UP_PREPARE;
+	wmb();
+
+	while (!cpu_online(cpu))
+		cpu_relax();
+	return 0;
+}
+
+int __cpu_disable(void)
+{
+	int cpu = smp_processor_id();
+
+	/*
+	 * dont permit boot processor for now
+	 */
+	if (cpu == 0)
+		return -EBUSY;
+
+	fixup_irqs();
+	local_flush_tlb_all();
+	printk ("Disabled cpu %u\n", smp_processor_id());
+	return 0;
+}
+
+void __cpu_die(unsigned int cpu)
+{
+	unsigned int i;
+
+	for (i = 0; i < 100; i++) {
+		/* They ack this in play_dead by setting CPU_DEAD */
+		if (per_cpu(cpu_state, cpu) == CPU_DEAD)
+		{
+			/*
+			 * TBD: Enable this when physical removal
+			 * or when we put the processor is put in
+			 * SAL_BOOT_RENDEZ mode
+			 * cpu_clear(cpu, cpu_callin_map);
+			 */
+			return;
+		}
+		current->state = TASK_UNINTERRUPTIBLE;
+		schedule_timeout(HZ/10);
+	}
+ 	printk(KERN_ERR "CPU %u didn't die...\n", cpu);
+}
+#else /* !CONFIG_HOTPLUG_CPU */
+static int __devinit cpu_enable(unsigned int cpu)
+{
+	return 0;
+}
+
+int __cpu_disable(void)
+{
+	return -ENOSYS;
+}
+
+void __cpu_die(unsigned int cpu)
+{
+	/* We said "no" in __cpu_disable */
+	BUG();
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+
 void
 smp_cpus_done (unsigned int dummy)
 {
@@ -570,6 +677,17 @@ __cpu_up (unsigned int cpu)
 	if (sapicid == -1)
 		return -EINVAL;
 
+	/*
+	 * Already booted.. just enable and get outa idle lool
+	 */
+	if (cpu_isset(cpu, cpu_callin_map))
+	{
+		cpu_enable(cpu);
+		local_irq_enable();
+		while (!cpu_isset(cpu, cpu_online_map))
+			mb();
+		return 0;
+	}
 	/* Processor goes to start_secondary(), sets online flag */
 	ret = do_boot_cpu(sapicid, cpu);
 	if (ret < 0)
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 744734ecb..e33bcb661 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -10,6 +10,7 @@
  */
 #include <linux/config.h>
 
+#include <linux/cpu.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -44,14 +45,6 @@ EXPORT_SYMBOL(last_cli_ip);
 
 #endif
 
-unsigned long long
-sched_clock (void)
-{
-	unsigned long offset = ia64_get_itc();
-
-	return (offset * local_cpu_data->nsec_per_cyc) >> IA64_NSEC_PER_CYC_SHIFT;
-}
-
 static void
 itc_reset (void)
 {
@@ -244,6 +237,10 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long new_itm;
 
+	if (unlikely(cpu_is_offline(smp_processor_id()))) {
+		return IRQ_HANDLED;
+	}
+
 	platform_timer_interrupt(irq, dev_id, regs);
 
 	new_itm = local_cpu_data->itm_next;
@@ -326,7 +323,7 @@ ia64_cpu_local_tick (void)
 	ia64_set_itm(local_cpu_data->itm_next);
 }
 
-void __init
+void __devinit
 ia64_init_itm (void)
 {
 	unsigned long platform_base_freq, itc_freq;
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index e021594d7..f89913135 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -22,29 +22,6 @@
 #include <asm/processor.h>
 #include <asm/uaccess.h>
 
-/*
- * fp_emulate() needs to be able to access and update all floating point registers.  Those
- * saved in pt_regs can be accessed through that structure, but those not saved, will be
- * accessed directly.  To make this work, we need to ensure that the compiler does not end
- * up using a preserved floating point register on its own.  The following achieves this
- * by declaring preserved registers that are not marked as "fixed" as global register
- * variables.
- */
-#ifdef ASM_SUPPORTED
-register double f2 asm ("f2"); register double f3 asm ("f3");
-register double f4 asm ("f4"); register double f5 asm ("f5");
-
-register long f16 asm ("f16"); register long f17 asm ("f17");
-register long f18 asm ("f18"); register long f19 asm ("f19");
-register long f20 asm ("f20"); register long f21 asm ("f21");
-register long f22 asm ("f22"); register long f23 asm ("f23");
-
-register double f24 asm ("f24"); register double f25 asm ("f25");
-register double f26 asm ("f26"); register double f27 asm ("f27");
-register double f28 asm ("f28"); register double f29 asm ("f29");
-register double f30 asm ("f30"); register double f31 asm ("f31");
-#endif
-
 extern spinlock_t timerlist_lock;
 
 fpswa_interface_t *fpswa_interface;
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index 6a715d841..e8be97229 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1999-2003 Hewlett-Packard Co
+ * Copyright (C) 1999-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com>
  * 	- Change pt_regs_off() to make it less dependant on pt_regs structure.
@@ -89,6 +89,8 @@ static struct {
 	/* list of unwind tables (one per load-module) */
 	struct unw_table *tables;
 
+	unsigned long r0;			/* constant 0 for r0 */
+
 	/* table of registers that prologues can save (and order in which they're saved): */
 	const unsigned char save_order[8];
 
@@ -239,7 +241,11 @@ static struct {
 #endif
 };
 
-/* Unwind accessors.  */
+static inline int
+read_only (void *addr)
+{
+	return (unsigned long) ((char *) addr - (char *) &unw.r0) < sizeof(unw.r0);
+}
 
 /*
  * Returns offset of rREG in struct pt_regs.
@@ -274,6 +280,8 @@ get_scratch_regs (struct unw_frame_info *info)
 	return (struct pt_regs *) info->pt;
 }
 
+/* Unwind accessors.  */
+
 int
 unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char *nat, int write)
 {
@@ -377,11 +385,15 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
 	}
 
 	if (write) {
-		*addr = *val;
-		if (*nat)
-			*nat_addr |= nat_mask;
-		else
-			*nat_addr &= ~nat_mask;
+		if (read_only(addr))
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
+		else {
+			*addr = *val;
+			if (*nat)
+				*nat_addr |= nat_mask;
+			else
+				*nat_addr &= ~nat_mask;
+		}
 	} else {
 		if ((*nat_addr & nat_mask) == 0) {
 			*val = *addr;
@@ -420,7 +432,10 @@ unw_access_br (struct unw_frame_info *info, int regnum, unsigned long *val, int
 		return -1;
 	}
 	if (write)
-		*addr = *val;
+		if (read_only(addr))
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
+		else
+			*addr = *val;
 	else
 		*val = *addr;
 	return 0;
@@ -465,7 +480,10 @@ unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val,
 	}
 
 	if (write)
-		*addr = *val;
+		if (read_only(addr))
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
+		else
+			*addr = *val;
 	else
 		*val = *addr;
 	return 0;
@@ -557,9 +575,12 @@ unw_access_ar (struct unw_frame_info *info, int regnum, unsigned long *val, int
 		return -1;
 	}
 
-	if (write)
-		*addr = *val;
-	else
+	if (write) {
+		if (read_only(addr))
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
+		else
+			*addr = *val;
+	} else
 		*val = *addr;
 	return 0;
 }
@@ -574,9 +595,12 @@ unw_access_pr (struct unw_frame_info *info, unsigned long *val, int write)
 	if (!addr)
 		addr = &info->sw->pr;
 
-	if (write)
-		*addr = *val;
-	else
+	if (write) {
+		if (read_only(addr))
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
+		else
+			*addr = *val;
+	} else
 		*val = *addr;
 	return 0;
 }
@@ -1407,6 +1431,9 @@ compile_reg (struct unw_state_record *sr, int i, struct unw_script *script)
 				need_nat_info = 0;
 			}
 			val = unw.preg_index[UNW_REG_R4 + (rval - 4)];
+		} else if (rval == 0) {
+			opc = UNW_INSN_MOVE_CONST;
+			val = 0;
 		} else {
 			/* register got spilled to a scratch register */
 			opc = UNW_INSN_MOVE_SCRATCH;
@@ -1729,6 +1756,17 @@ run_script (struct unw_script *script, struct unw_frame_info *state)
 			}
 			break;
 
+		      case UNW_INSN_MOVE_CONST:
+			if (val == 0)
+				s[dst] = (unsigned long) &unw.r0;
+			else {
+				s[dst] = 0;
+				UNW_DPRINT(0, "unwind.%s: UNW_INSN_MOVE_CONST bad val=%ld\n",
+					   __FUNCTION__, val);
+			}
+			break;
+
+
 		      case UNW_INSN_MOVE_STACKED:
 			s[dst] = (unsigned long) ia64_rse_skip_regs((unsigned long *)state->bsp,
 								    val);
diff --git a/arch/ia64/kernel/unwind_i.h b/arch/ia64/kernel/unwind_i.h
index 1853dc450..96693a6ae 100644
--- a/arch/ia64/kernel/unwind_i.h
+++ b/arch/ia64/kernel/unwind_i.h
@@ -133,6 +133,7 @@ enum unw_insn_opcode {
 	UNW_INSN_SETNAT_TYPE,		/* s[dst+1].nat.type = val */
 	UNW_INSN_LOAD,			/* s[dst] = *s[val] */
 	UNW_INSN_MOVE_SCRATCH,		/* s[dst] = scratch reg "val" */
+	UNW_INSN_MOVE_CONST,            /* s[dst] = constant reg "val" */
 };
 
 struct unw_insn {
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 5c45718a9..57912212b 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -195,11 +195,10 @@ SECTIONS
   .data : AT(ADDR(.data) - LOAD_OFFSET)
 	{ *(.data) *(.data1) *(.gnu.linkonce.d*) CONSTRUCTORS }
 
-  . = ALIGN(16);
-  __gp = . + 0x200000;	/* gp must be 16-byte aligned for exc. table */
-
+  . = ALIGN(16);	/* gp must be 16-byte aligned for exc. table */
   .got : AT(ADDR(.got) - LOAD_OFFSET)
 	{ *(.got.plt) *(.got) }
+  __gp = ADDR(.got) + 0x200000;
   /* We want the small data sections together, so single-instruction offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 218de3efc..1902c3c2e 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -6,7 +6,7 @@ obj-y := io.o
 
 lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o			\
 	__divdi3.o __udivdi3.o __moddi3.o __umoddi3.o			\
-	checksum.o clear_page.o csum_partial_copy.o copy_page.o		\
+	bitop.o checksum.o clear_page.o csum_partial_copy.o copy_page.o	\
 	clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o	\
 	flush.o ip_fast_csum.o do_csum.o				\
 	memset.o strlen.o swiotlb.o
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 114e3d96c..56e409ec6 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -293,8 +293,9 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 				goto out;
 			}
 			ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
-			unlock_page(page);
-			if (ret) {
+			if (! ret) {
+				unlock_page(page);
+			} else {
 				hugetlb_put_quota(mapping);
 				free_huge_page(page);
 				goto out;
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index c0dfe9c47..c03b3980d 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -123,15 +123,12 @@ ia64_init_addr_space (void)
 	 */
 	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
 	if (vma) {
+		memset(vma, 0, sizeof(*vma));
 		vma->vm_mm = current->mm;
 		vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
 		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE|VM_GROWSUP;
-		vma->vm_ops = NULL;
-		vma->vm_pgoff = 0;
-		vma->vm_file = NULL;
-		vma->vm_private_data = NULL;
 		insert_vm_struct(current->mm, vma);
 	}
 
@@ -220,7 +217,7 @@ free_initrd_mem (unsigned long start, unsigned long end)
 }
 
 /*
- * This is like put_dirty_page() but installs a clean page in the kernel's page table.
+ * This installs a clean page in the kernel's page table.
  */
 struct page *
 put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
@@ -275,11 +272,11 @@ setup_gate (void)
 	ia64_patch_gate();
 }
 
-void __init
+void __devinit
 ia64_mmu_init (void *my_cpu_data)
 {
 	unsigned long psr, pta, impl_va_bits;
-	extern void __init tlb_init (void);
+	extern void __devinit tlb_init (void);
 	int cpu;
 
 #ifdef CONFIG_DISABLE_VHPT
@@ -343,6 +340,7 @@ ia64_mmu_init (void *my_cpu_data)
 
 #ifdef	CONFIG_HUGETLB_PAGE
 	ia64_set_rr(HPAGE_REGION_BASE, HPAGE_SHIFT << 2);
+	ia64_srlz_d();
 #endif
 
 	cpu = smp_processor_id();
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
index 44fb8b84a..dc15aa01c 100644
--- a/arch/ia64/mm/tlb.c
+++ b/arch/ia64/mm/tlb.c
@@ -166,7 +166,7 @@ flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long
 }
 EXPORT_SYMBOL(flush_tlb_range);
 
-void __init
+void __devinit
 ia64_tlb_init (void)
 {
 	ia64_ptce_info_t ptce_info;
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 662674017..fdcc71a09 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -323,8 +323,10 @@ pcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus)
 	struct pci_controller *controller = PCI_CONTROLLER(dev);
 	struct pci_window *window;
 	int i, j;
+	int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \
+		PCI_ROM_RESOURCE : PCI_NUM_RESOURCES;
 
-	for (i = 0; i < PCI_NUM_RESOURCES; i++) {
+	for (i = 0; i < limit; i++) {
 		if (!dev->resource[i].start)
 			continue;
 
diff --git a/arch/ia64/scripts/toolchain-flags b/arch/ia64/scripts/toolchain-flags
index 7fd868bf1..3f0c2adac 100755
--- a/arch/ia64/scripts/toolchain-flags
+++ b/arch/ia64/scripts/toolchain-flags
@@ -40,4 +40,14 @@ then
     CPPFLAGS="$CPPFLAGS -DHAVE_MODEL_SMALL_ATTRIBUTE"
 fi
 rm -f $out
+
+# Check whether assembler supports .serialize.{data,instruction} directive.
+
+$CC -c $dir/check-serialize.S -o $out 2>/dev/null
+res=$?
+rm -f $out
+if [ $res -eq 0 ]; then
+    CPPFLAGS="$CPPFLAGS -DHAVE_SERIALIZE_DIRECTIVE"
+fi
+
 echo $CPPFLAGS
diff --git a/arch/ia64/sn/io/hwgfs/interface.c b/arch/ia64/sn/io/hwgfs/interface.c
index fd06df927..caac7f067 100644
--- a/arch/ia64/sn/io/hwgfs/interface.c
+++ b/arch/ia64/sn/io/hwgfs/interface.c
@@ -204,7 +204,7 @@ hwgfs_mk_symlink(
 
 	error = hwgfs_decode(dir, name, 0, &parent_inode, &dentry);
 	if (likely(!error)) {
-		error = vfs_symlink(parent_inode, dentry, link);
+		error = vfs_symlink(parent_inode, dentry, link, S_IALLUGO);
 		dentry->d_fsdata = info;
 		if (handle)
 			*handle = dentry;
diff --git a/arch/ia64/sn/io/io.c b/arch/ia64/sn/io/io.c
index cb6100e8f..cfc38abd5 100644
--- a/arch/ia64/sn/io/io.c
+++ b/arch/ia64/sn/io/io.c
@@ -651,7 +651,7 @@ hub_set_piomode(nasid_t nasid, int conveyor)
 	hubii_wcr_t ii_wcr;
 	int prbnum;
 
-	ASSERT(NASID_TO_COMPACT_NODEID(nasid) != INVALID_CNODEID);
+	ASSERT(nasid_to_cnodeid(nasid) != INVALID_CNODEID);
 
 	ii_iowa = REMOTE_HUB_L(nasid, IIO_OUTWIDGET_ACCESS);
 	REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, 0);
diff --git a/arch/ia64/sn/io/machvec/iomv.c b/arch/ia64/sn/io/machvec/iomv.c
index df17cc049..10ee752ea 100644
--- a/arch/ia64/sn/io/machvec/iomv.c
+++ b/arch/ia64/sn/io/machvec/iomv.c
@@ -71,6 +71,6 @@ sn_mmiob (void)
 {
 	while ((((volatile unsigned long) (*pda->pio_write_status_addr)) & SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK) != 
 				SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT_MASK)
-		udelay(1);
+		cpu_relax();
 }
 EXPORT_SYMBOL(sn_mmiob);
diff --git a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
index 69198ea31..1cb5beae5 100644
--- a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
+++ b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
@@ -328,6 +328,34 @@ sn_pci_fixup_slot(struct pci_dev *dev)
 			cmd |= PCI_COMMAND_MEMORY;
 	}
 
+        /*
+	 * Assign addresses to the ROMs, but don't enable them yet
+	 * Also note that we only map display card ROMs due to PIO mapping
+	 * space scarcity.
+	 */
+        if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
+                unsigned long addr;
+                size = dev->resource[PCI_ROM_RESOURCE].end -
+                        dev->resource[PCI_ROM_RESOURCE].start;
+
+                if (size) {
+                        addr = (unsigned long) pciio_pio_addr(vhdl, 0,
+					      PCIIO_SPACE_ROM,
+					      0, size, 0, PIOMAP_FIXED);
+                        if (!addr) {
+                                dev->resource[PCI_ROM_RESOURCE].start = 0;
+                                dev->resource[PCI_ROM_RESOURCE].end = 0;
+                                printk("sn_pci_fixup(): ROM pio map failure "
+				       "for %s\n", dev->slot_name);
+                        }
+                        addr |= __IA64_UNCACHED_OFFSET;
+                        dev->resource[PCI_ROM_RESOURCE].start = addr;
+                        dev->resource[PCI_ROM_RESOURCE].end = addr + size;
+                        if (dev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_MEM)
+                                cmd |= PCI_COMMAND_MEMORY;
+                }
+        }
+
 	/*
 	 * Update the Command Word on the Card.
 	 */
@@ -712,7 +740,7 @@ pci_bus_to_hcl_cvlink(void)
 			
 			/* Is this PCI bus associated with this moduleid? */
 			moduleid = NODE_MODULEID(
-				NASID_TO_COMPACT_NODEID(pcibr_soft->bs_nasid));
+				nasid_to_cnodeid(pcibr_soft->bs_nasid));
 			if (modules[i]->id == moduleid) {
 				struct pcibr_list_s *new_element;
 
@@ -791,8 +819,7 @@ sn_pci_init (void)
 	struct list_head *ln;
 	struct pci_bus *pci_bus = NULL;
 	struct pci_dev *pci_dev = NULL;
-	extern int numnodes;
-	int cnode, ret;
+	int ret;
 #ifdef CONFIG_PROC_FS
 	extern void register_sn_procfs(void);
 #endif
diff --git a/arch/ia64/sn/io/platform_init/sgi_io_init.c b/arch/ia64/sn/io/platform_init/sgi_io_init.c
index e8dd0ae2c..8e410fcc8 100644
--- a/arch/ia64/sn/io/platform_init/sgi_io_init.c
+++ b/arch/ia64/sn/io/platform_init/sgi_io_init.c
@@ -26,7 +26,6 @@ extern vertex_hdl_t hwgraph_root;
 extern void io_module_init(void);
 extern int pci_bus_to_hcl_cvlink(void);
 
-cpuid_t master_procid;
 nasid_t console_nasid = (nasid_t) - 1;
 char master_baseio_wid;
 
@@ -47,10 +46,10 @@ per_hub_init(cnodeid_t cnode)
 	ii_ibcr_u_t ii_ibcr;
 	ii_ilcsr_u_t ii_ilcsr;
 
-	nasid = COMPACT_TO_NASID_NODEID(cnode);
+	nasid = cnodeid_to_nasid(cnode);
 
 	ASSERT(nasid != INVALID_NASID);
-	ASSERT(NASID_TO_COMPACT_NODEID(nasid) == cnode);
+	ASSERT(nasid_to_cnodeid(nasid) == cnode);
 
 	npdap = NODEPDA(cnode);
 
@@ -150,7 +149,7 @@ inline int
 check_nasid_equiv(nasid_t nasida, nasid_t nasidb)
 {
 	if ((nasida == nasidb)
-	    || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer))
+	    || (nasida == NODEPDA(nasid_to_cnodeid(nasidb))->xbow_peer))
 		return 1;
 	else
 		return 0;
diff --git a/arch/ia64/sn/io/sn2/klgraph.c b/arch/ia64/sn/io/sn2/klgraph.c
index 0a8b925eb..ca342b712 100644
--- a/arch/ia64/sn/io/sn2/klgraph.c
+++ b/arch/ia64/sn/io/sn2/klgraph.c
@@ -65,7 +65,7 @@ klhwg_add_disabled_cpu(vertex_hdl_t node_vertex, cnodeid_t cnode, klcpu_t *cpu,
         cpuid_t cpu_id;
 	nasid_t nasid;
 
-	nasid = COMPACT_TO_NASID_NODEID(cnode);
+	nasid = cnodeid_to_nasid(cnode);
         cpu_id = nasid_slice_to_cpuid(nasid, cpu->cpu_info.physid);
         if(cpu_id != -1){
 		snprintf(name, 120, "%s/%s/%c", EDGE_LBL_DISABLED, EDGE_LBL_CPU, 'a' + cpu->cpu_info.physid);
@@ -88,7 +88,7 @@ klhwg_add_cpu(vertex_hdl_t node_vertex, cnodeid_t cnode, klcpu_t *cpu)
         cpuid_t cpu_id;
 	nasid_t nasid;
 
-	nasid = COMPACT_TO_NASID_NODEID(cnode);
+	nasid = cnodeid_to_nasid(cnode);
         cpu_id = nasid_slice_to_cpuid(nasid, cpu->cpu_info.physid);
 
         snprintf(name, 120, "%s/%d/%c",
@@ -145,7 +145,7 @@ klhwg_add_xbow(cnodeid_t cnode, nasid_t nasid)
 			continue;
 		}
 
-		hub_cnode = NASID_TO_COMPACT_NODEID(hub_nasid);
+		hub_cnode = nasid_to_cnodeid(hub_nasid);
 
 		if (hub_cnode == INVALID_CNODEID) {
 			continue;
@@ -178,7 +178,7 @@ klhwg_add_xbow(cnodeid_t cnode, nasid_t nasid)
 		 */
 		if (hub_nasid != nasid) {
 			NODEPDA(hub_cnode)->xbow_peer = nasid;
-			NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->xbow_peer =
+			NODEPDA(nasid_to_cnodeid(nasid))->xbow_peer =
 				hub_nasid;
 		}
 	}
@@ -200,7 +200,7 @@ klhwg_add_node(vertex_hdl_t hwgraph_root, cnodeid_t cnode)
 	klcpu_t *cpu;
 	vertex_hdl_t cpu_dir;
 
-	nasid = COMPACT_TO_NASID_NODEID(cnode);
+	nasid = cnodeid_to_nasid(cnode);
 	brd = find_lboard_any((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 	ASSERT(brd);
 
@@ -280,7 +280,7 @@ klhwg_add_all_routers(vertex_hdl_t hwgraph_root)
 	int rv;
 
 	for (cnode = 0; cnode < numnodes; cnode++) {
-		nasid = COMPACT_TO_NASID_NODEID(cnode);
+		nasid = cnodeid_to_nasid(cnode);
 		brd = find_lboard_class_any((lboard_t *)KL_CONFIG_INFO(nasid),
 				KLTYPE_ROUTER);
 
@@ -363,7 +363,7 @@ klhwg_connect_one_router(vertex_hdl_t hwgraph_root, lboard_t *brd,
 				 port));
 			continue;
 		}
-		if (NASID_TO_COMPACT_NODEID(router->rou_port[port].port_nasid) 
+		if (nasid_to_cnodeid(router->rou_port[port].port_nasid) 
 		    == INVALID_CNODEID) {
 			continue;
 		}
@@ -414,7 +414,7 @@ klhwg_connect_routers(vertex_hdl_t hwgraph_root)
 	lboard_t *brd;
 
 	for (cnode = 0; cnode < numnodes; cnode++) {
-		nasid = COMPACT_TO_NASID_NODEID(cnode);
+		nasid = cnodeid_to_nasid(cnode);
 		brd = find_lboard_class_any((lboard_t *)KL_CONFIG_INFO(nasid),
 				KLTYPE_ROUTER);
 
@@ -423,7 +423,7 @@ klhwg_connect_routers(vertex_hdl_t hwgraph_root)
 
 		do {
 
-			nasid = COMPACT_TO_NASID_NODEID(cnode);
+			nasid = cnodeid_to_nasid(cnode);
 
 			klhwg_connect_one_router(hwgraph_root, brd,
 						 cnode, nasid);
@@ -451,7 +451,7 @@ klhwg_connect_hubs(vertex_hdl_t hwgraph_root)
 	int port;
 
 	for (cnode = 0; cnode < numionodes; cnode++) {
-		nasid = COMPACT_TO_NASID_NODEID(cnode);
+		nasid = cnodeid_to_nasid(cnode);
 
 		brd = find_lboard_any((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
 
@@ -463,7 +463,7 @@ klhwg_connect_hubs(vertex_hdl_t hwgraph_root)
 				continue; /* Port not active */
 			}
 
-			if (NASID_TO_COMPACT_NODEID(hub->hub_port[port].port_nasid) == INVALID_CNODEID)
+			if (nasid_to_cnodeid(hub->hub_port[port].port_nasid) == INVALID_CNODEID)
 				continue;
 
 			/* Generate a hardware graph path for this board. */
diff --git a/arch/ia64/sn/io/sn2/ml_SN_init.c b/arch/ia64/sn/io/sn2/ml_SN_init.c
index bab6d7ea6..6de1ba85c 100644
--- a/arch/ia64/sn/io/sn2/ml_SN_init.c
+++ b/arch/ia64/sn/io/sn2/ml_SN_init.c
@@ -31,13 +31,9 @@ void init_platform_nodepda(nodepda_t *npda, cnodeid_t node)
 	hubinfo_t hubinfo;
 	nasid_t nasid;
 
-	extern void router_map_init(nodepda_t *);
-	extern void router_queue_init(nodepda_t *,cnodeid_t);
-	extern void intr_init_vecblk(nodepda_t *, cnodeid_t, int);
-
 	/* Allocate per-node platform-dependent data */
 	
-	nasid = COMPACT_TO_NASID_NODEID(node);
+	nasid = cnodeid_to_nasid(node);
 	if (node >= numnodes) /* Headless/memless IO nodes */
 		hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(0), sizeof(struct hubinfo_s));
 	else
@@ -81,7 +77,7 @@ init_platform_hubinfo(nodepda_t **nodepdaindr)
 	for (cnode = 0; cnode < numionodes; cnode++) {
 		npda = nodepdaindr[cnode];
 		hubinfo = (hubinfo_t)npda->pdinfo;
-		hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(cnode);
+		hubinfo->h_nasid = cnodeid_to_nasid(cnode);
 		hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid);
 	}
 }
diff --git a/arch/ia64/sn/io/sn2/ml_SN_intr.c b/arch/ia64/sn/io/sn2/ml_SN_intr.c
index 8fb2edae4..1d90a3652 100644
--- a/arch/ia64/sn/io/sn2/ml_SN_intr.c
+++ b/arch/ia64/sn/io/sn2/ml_SN_intr.c
@@ -12,6 +12,7 @@
 #include <asm/smp.h>
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
+#include <asm/topology.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/iograph.h>
 #include <asm/sn/hcl.h>
@@ -43,7 +44,6 @@ void intr_init_vecblk(cnodeid_t node)
 	sh_ii_int0_config_u_t		ii_int_config;
 	cpuid_t				cpu;
 	cpuid_t				cpu0, cpu1;
-	nodepda_t			*lnodepda;
 	sh_ii_int0_enable_u_t		ii_int_enable;
 	sh_int_node_id_config_u_t	node_id_config;
 	sh_local_int5_config_u_t	local5_config;
@@ -60,15 +60,13 @@ void intr_init_vecblk(cnodeid_t node)
 		HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_INT_NODE_ID_CONFIG),
 			node_id_config.sh_int_node_id_config_regval);
 		cnode = nasid_to_cnodeid(master_nasid);
-		lnodepda = NODEPDA(cnode);
-		cpu = lnodepda->node_first_cpu;
+		cpu = first_cpu(node_to_cpumask(cnode));
 		cpu = cpu_physical_id(cpu);
 		SAL_CALL(ret_stuff, SN_SAL_REGISTER_CE, nasid, cpu, master_nasid,0,0,0,0);
 		if (ret_stuff.status < 0)
 			printk("%s: SN_SAL_REGISTER_CE SAL_CALL failed\n",__FUNCTION__);
 	} else {
-		lnodepda = NODEPDA(node);
-		cpu = lnodepda->node_first_cpu;
+		cpu = first_cpu(node_to_cpumask(node));
 		cpu = cpu_physical_id(cpu);
 	}
 
diff --git a/arch/ia64/sn/io/sn2/ml_iograph.c b/arch/ia64/sn/io/sn2/ml_iograph.c
index 8ad338578..d0b0a5b58 100644
--- a/arch/ia64/sn/io/sn2/ml_iograph.c
+++ b/arch/ia64/sn/io/sn2/ml_iograph.c
@@ -313,7 +313,7 @@ io_xswitch_widget_init(vertex_hdl_t  	xswitchv,
 
 	hubinfo_get(hubv, &hubinfo);
 	nasid = hubinfo->h_nasid;
-	cnode = NASID_TO_COMPACT_NODEID(nasid);
+	cnode = nasid_to_cnodeid(nasid);
 	hub_widgetid = hubinfo->h_widgetid;
 
 	/*
@@ -567,7 +567,7 @@ io_init_node(cnodeid_t cnodeid)
 	 * and hence widget id is Not 0.
 	 */
 	widget_partnum = (((*(volatile int32_t *)(NODE_SWIN_BASE
-			(COMPACT_TO_NASID_NODEID(cnodeid), 0) + 
+			(cnodeid_to_nasid(cnodeid), 0) + 
 			WIDGET_ID))) & WIDGET_PART_NUM) 
 			>> WIDGET_PART_NUM_SHFT;
 
@@ -584,7 +584,7 @@ io_init_node(cnodeid_t cnodeid)
 	} else {
 		void	*bridge;
 
-		bridge = (void *)NODE_SWIN_BASE(COMPACT_TO_NASID_NODEID(cnodeid), 0);
+		bridge = (void *)NODE_SWIN_BASE(cnodeid_to_nasid(cnodeid), 0);
 		npdap->basew_id = pcireg_bridge_control_get(bridge) & WIDGET_WIDGET_ID;
 
 		printk(" ****io_init_node: Unknown Widget Part Number 0x%x Widget ID 0x%x attached to Hubv 0x%p ****\n", widget_partnum, npdap->basew_id, (void *)hubv);
@@ -637,7 +637,7 @@ io_init_node(cnodeid_t cnodeid)
 
 		/* If there's someone else on this crossbow, recognize him */
 		if (npdap->xbow_peer != INVALID_NASID) {
-			nodepda_t *peer_npdap = NODEPDA(NASID_TO_COMPACT_NODEID(npdap->xbow_peer));
+			nodepda_t *peer_npdap = NODEPDA(nasid_to_cnodeid(npdap->xbow_peer));
 			peer_sema = &peer_npdap->xbow_sema;
 			volunteer_for_widgets(switchv, peer_npdap->node_vertex);
 		}
diff --git a/arch/ia64/sn/io/sn2/module.c b/arch/ia64/sn/io/sn2/module.c
index 67204d2d6..0bba7843e 100644
--- a/arch/ia64/sn/io/sn2/module.c
+++ b/arch/ia64/sn/io/sn2/module.c
@@ -196,7 +196,7 @@ io_module_init(void)
      * We do not support memoryless compute nodes.
      */
     for (node = 0; node < numnodes; node++) {
-	nasid = COMPACT_TO_NASID_NODEID(node);
+	nasid = cnodeid_to_nasid(node);
 	board = find_lboard_nasid((lboard_t *) KL_CONFIG_INFO(nasid), nasid, KLTYPE_SNIA);
 	ASSERT(board);
 
@@ -214,7 +214,7 @@ io_module_init(void)
 	nasid_t		nasid;
 	char		serial_number[16];
 
-        nasid = COMPACT_TO_NASID_NODEID(node);
+        nasid = cnodeid_to_nasid(node);
 	board = find_lboard_nasid((lboard_t *) KL_CONFIG_INFO(nasid), 
 				nasid, KLTYPE_SNIA);
 	ASSERT(board);
diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c
index 1fa9985cb..b632a685a 100644
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c
@@ -758,7 +758,7 @@ pcibr_directmap_init(pcibr_soft_t pcibr_soft)
     cnodeid_t		cnodeid = 0;	/* We need api for diroff api */
     nasid_t		nasid;
 
-    nasid = COMPACT_TO_NASID_NODEID(cnodeid);
+    nasid = cnodeid_to_nasid(cnodeid);
     paddr = NODE_OFFSET(nasid) + 0;
 
     /* Assume that if we ask for a DMA mapping to zero the XIO host will
@@ -2092,7 +2092,7 @@ pcibr_get_dmatrans_node(vertex_hdl_t pconn_vhdl)
 	pciio_info_t	pciio_info = pciio_info_get(pconn_vhdl);
 	pcibr_soft_t	pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
 
-	return NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase));
+	return nasid_to_cnodeid(NASID_GET(pcibr_soft->bs_dir_xbase));
 }
 
 /*ARGSUSED */
@@ -2645,7 +2645,7 @@ isIO9(nasid_t nasid)
                         brd = KLCF_NEXT(brd);
 	}
 	/* if it's dual ported, check the peer also */
-	nasid = NODEPDA(NASID_TO_COMPACT_NODEID(nasid))->xbow_peer;
+	nasid = NODEPDA(nasid_to_cnodeid(nasid))->xbow_peer;
 	if (nasid < 0) return 0;
 	brd = (lboard_t *)KL_CONFIG_INFO(nasid);
 	while (brd) {
diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c
index f8147fec7..a4d7c5615 100644
--- a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c
+++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2001-2003 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved.
  */
 
 #include <linux/types.h>
@@ -1615,6 +1615,46 @@ pcibr_piomap_probe(pcibr_piomap_t piomap, off_t offset, int len, void *valp)
 				piomap->bp_kvaddr + offset, len, valp);
 }
 
+static uint64_t
+pcibr_disable_mst_timeout(pcibr_soft_t pcibr_soft)
+{
+    uint64_t		old_enable;
+    uint64_t		new_enable;
+    uint64_t		intr_bits;
+
+    intr_bits = PIC_ISR_PCI_MST_TIMEOUT
+		| PIC_ISR_PCIX_MTOUT | PIC_ISR_PCIX_SPLIT_EMSG;
+    old_enable = pcireg_intr_enable_get(pcibr_soft);
+    pcireg_intr_enable_bit_clr(pcibr_soft, intr_bits);
+    new_enable = pcireg_intr_enable_get(pcibr_soft);
+
+    if (old_enable == new_enable) {
+	return 0;		/* was already disabled */
+    } else {
+	return 1;
+    }
+}
+
+static int
+pcibr_enable_mst_timeout(pcibr_soft_t pcibr_soft)
+{
+    uint64_t		old_enable;
+    uint64_t		new_enable;
+    uint64_t		intr_bits;
+    
+    intr_bits = PIC_ISR_PCI_MST_TIMEOUT
+		| PIC_ISR_PCIX_MTOUT | PIC_ISR_PCIX_SPLIT_EMSG;
+    old_enable = pcireg_intr_enable_get(pcibr_soft);
+    pcireg_intr_enable_bit_set(pcibr_soft, intr_bits);
+    new_enable = pcireg_intr_enable_get(pcibr_soft);
+
+    if (old_enable == new_enable) {
+	return 0;		/* was alread enabled */
+    } else {
+	return 1;
+    }
+}
+
 /*
  * pcibr_probe_slot: read a config space word
  * while trapping any errors; return zero if
@@ -1628,7 +1668,7 @@ pcibr_probe_work(pcibr_soft_t pcibr_soft,
 		 int len,
 		 void *valp)
 {
-    int			rv;
+    int			rv, changed;
 
     /*
      * Sanity checks ...
@@ -1642,15 +1682,19 @@ pcibr_probe_work(pcibr_soft_t pcibr_soft,
 	return -1;				/* invalid alignment */
     }
 
+    changed = pcibr_disable_mst_timeout(pcibr_soft);
+
     rv = snia_badaddr_val((void *)addr, len, valp);
 
     /* Clear the int_view register incase it was set */
     pcireg_intr_reset_set(pcibr_soft, BRIDGE_IRR_MULTI_CLR);
 
+    if (changed) {
+	pcibr_enable_mst_timeout(pcibr_soft);
+    }
     return (rv ? 1 : 0);	/* return 1 for snia_badaddr_val error, 0 if ok */
 }
 
-
 void
 pcibr_device_info_free(vertex_hdl_t pcibr_vhdl, pciio_slot_t slot)
 {
diff --git a/arch/ia64/sn/io/sn2/pic.c b/arch/ia64/sn/io/sn2/pic.c
index 775495af6..c9cea08d4 100644
--- a/arch/ia64/sn/io/sn2/pic.c
+++ b/arch/ia64/sn/io/sn2/pic.c
@@ -124,7 +124,7 @@ pic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v,
 static vertex_hdl_t
 pic_bus1_redist(nasid_t nasid, vertex_hdl_t conn_v)
 {
-	cnodeid_t cnode = NASID_TO_COMPACT_NODEID(nasid);
+	cnodeid_t cnode = nasid_to_cnodeid(nasid);
 	cnodeid_t xbow_peer = -1;
 	char pathname[256], peer_path[256], tmpbuf[256];
 	char *p;
@@ -137,7 +137,7 @@ pic_bus1_redist(nasid_t nasid, vertex_hdl_t conn_v)
 		/* create a path for this widget on the peer Cbrick */
 		/* pcibr widget hw/module/001c11/slab/0/Pbrick/xtalk/12 */
 		/* sprintf(pathname, "%v", conn_v); */
-		xbow_peer = NASID_TO_COMPACT_NODEID(NODEPDA(cnode)->xbow_peer);
+		xbow_peer = nasid_to_cnodeid(NODEPDA(cnode)->xbow_peer);
 		pos = hwgfs_generate_path(conn_v, tmpbuf, 256);
 		strcpy(pathname, &tmpbuf[pos]);
 		p = pathname + strlen("hw/module/001c01/slab/0/");
diff --git a/arch/ia64/sn/io/sn2/shuberror.c b/arch/ia64/sn/io/sn2/shuberror.c
index 4b203d5eb..e2a991cca 100644
--- a/arch/ia64/sn/io/sn2/shuberror.c
+++ b/arch/ia64/sn/io/sn2/shuberror.c
@@ -157,7 +157,7 @@ hubii_eint_init(cnodeid_t cnode)
     hubio_eint.ii_iidsr_regval = 0;
     hubio_eint.ii_iidsr_fld_s.i_enable = 1;
     hubio_eint.ii_iidsr_fld_s.i_level = bit;/* Take the least significant bits*/
-    hubio_eint.ii_iidsr_fld_s.i_node = COMPACT_TO_NASID_NODEID(cnode);
+    hubio_eint.ii_iidsr_fld_s.i_node = cnodeid_to_nasid(cnode);
     hubio_eint.ii_iidsr_fld_s.i_pi_id = cpuid_to_subnode(intr_cpu);
     REMOTE_HUB_S(hinfo->h_nasid, IIO_IIDSR, hubio_eint.ii_iidsr_regval);
 
@@ -450,7 +450,7 @@ hubiio_crb_error_handler(vertex_hdl_t hub_v, hubinfo_t hinfo)
 	int		rc;
 
 	nasid = hinfo->h_nasid;
-	cnode = NASID_TO_COMPACT_NODEID(nasid);
+	cnode = nasid_to_cnodeid(nasid);
 
 	/*
 	 * XXX - Add locking for any recovery actions
diff --git a/arch/ia64/sn/io/sn2/shubio.c b/arch/ia64/sn/io/sn2/shubio.c
index e89148a5e..a4540c1b7 100644
--- a/arch/ia64/sn/io/sn2/shubio.c
+++ b/arch/ia64/sn/io/sn2/shubio.c
@@ -76,7 +76,7 @@ hub_xp_error_handler(
 	/* Get the error state of the hub */
 	e_state = error_state_get(hub_v);
 
-	cnode = NASID_TO_COMPACT_NODEID(nasid);
+	cnode = nasid_to_cnodeid(nasid);
 
 	xswitch = NODEPDA(cnode)->basew_xc;
 
@@ -119,7 +119,7 @@ is_widget_pio_enabled(ioerror_t *ioerror)
 		return(0);
 
 	/* Get the nasid for the cnode */
-	src_nasid = COMPACT_TO_NASID_NODEID(src_node);
+	src_nasid = cnodeid_to_nasid(src_node);
 	if (src_nasid == INVALID_NASID)
 		return(0);
 
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index e42c83cfa..9644e5805 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -451,10 +451,6 @@ sn_cpu_init(void)
 	}
 	pda->shub_1_1_found = shub_1_1_found;
 	
-	if (local_node_data->active_cpu_count == 1)
-		nodepda->node_first_cpu = cpuid;
-
-
 
 	/*
 	 * We must use different memory allocators for first cpu (bootmem 
@@ -474,7 +470,7 @@ sn_cpu_init(void)
 	pda->mem_write_status_addr = (volatile u64 *)
 			LOCAL_MMR_ADDR((slice < 2 ? SH_MEMORY_WRITE_STATUS_0 : SH_MEMORY_WRITE_STATUS_1 ) );
 
-	if (nodepda->node_first_cpu == cpuid) {
+	if (local_node_data->active_cpu_count++ == 0) {
 		int	buddy_nasid;
 		buddy_nasid = cnodeid_to_nasid(numa_node_id() == numnodes-1 ? 0 : numa_node_id()+ 1);
 		pda->pio_shub_war_cam_addr = (volatile unsigned long*)GLOBAL_MMR_ADDR(nasid, SH_PI_CAM_CONTROL);
diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
index 7d4d5a198..bcc938b28 100644
--- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c
+++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
@@ -228,11 +228,9 @@ read_version_entry(char *page, char **start, off_t off, int count, int *eof,
 {
 	int len = 0;
 
-	MOD_INC_USE_COUNT;
 	/* data holds the pointer to this node's FIT */
 	len = dump_version(page, (unsigned long *)data);
 	len = proc_calc_metrics(page, start, off, count, eof, len);
-	MOD_DEC_USE_COUNT;
 	return len;
 }
 
@@ -242,11 +240,9 @@ read_fit_entry(char *page, char **start, off_t off, int count, int *eof,
 {
 	int len = 0;
 
-	MOD_INC_USE_COUNT;
 	/* data holds the pointer to this node's FIT */
 	len = dump_fit(page, (unsigned long *)data);
 	len = proc_calc_metrics(page, start, off, count, eof, len);
-	MOD_DEC_USE_COUNT;
 
 	return len;
 }
@@ -310,6 +306,7 @@ int __init
 prominfo_init(void)
 {
 	struct proc_dir_entry **entp;
+	struct proc_dir_entry *p;
 	cnodeid_t cnodeid;
 	nasid_t nasid;
 	char name[NODE_NAME_LEN];
@@ -333,12 +330,16 @@ prominfo_init(void)
 		sprintf(name, "node%d", cnodeid);
 		*entp = proc_mkdir(name, sgi_prominfo_entry);
 		nasid = cnodeid_to_nasid(cnodeid);
-		create_proc_read_entry(
+		p = create_proc_read_entry(
 			"fit", 0, *entp, read_fit_entry,
 			lookup_fit(nasid));
-		create_proc_read_entry(
+		if (p)
+			p->owner = THIS_MODULE;
+		p = create_proc_read_entry(
 			"version", 0, *entp, read_version_entry,
 			lookup_fit(nasid));
+		if (p)
+			p->owner = THIS_MODULE;
 	}
 
 	return 0;
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 503a32d23..1fa88d5f3 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -76,9 +76,9 @@ config SUN3
 	select MMU_SUN3 if MMU
 	help
 	  This option enables support for the Sun 3 series of workstations
-	  (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires 
-	  that all other hardware types must be disabled, as Sun 3 kernels 
-	  are incompatible with all other m68k targets (including Sun 3x!).  
+	  (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
+	  that all other hardware types must be disabled, as Sun 3 kernels
+	  are incompatible with all other m68k targets (including Sun 3x!).
 
 	  If you don't want to compile a kernel exclusively for a Sun 3, say N.
 
@@ -687,7 +687,7 @@ config DEBUG_INFO
 	  debugging info resulting in a larger kernel image.
 	  Say Y here only if you plan to use gdb to debug the kernel.
 	  If you don't debug the kernel, you can say N.
-	  
+
 endmenu
 
 source "security/Kconfig"
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 1ec10c9f2..6a8736ecd 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -56,7 +56,7 @@ ifndef CONFIG_SUN3
 head-y := arch/m68k/kernel/head.o
 else
 head-y := arch/m68k/kernel/sun3-head.o
-endif 
+endif
 
 core-y				+= arch/m68k/kernel/	arch/m68k/mm/
 libs-y				+= arch/m68k/lib/
diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
index a97b44d6b..cb5d93630 100644
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -88,7 +88,7 @@ void amiga_mksound( unsigned int hz, unsigned int ticks )
 		custom.aud[2].audlen = sizeof(sine_data)/2;
 		custom.aud[2].audper = (unsigned short)period;
 		custom.aud[2].audvol = 32; /* 50% of maxvol */
-	
+
 		if (ticks) {
 			sound_timer.expires = jiffies + ticks;
 			add_timer( &sound_timer );
diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c
index b75901a31..558d5fd2d 100644
--- a/arch/m68k/amiga/chipram.c
+++ b/arch/m68k/amiga/chipram.c
@@ -42,7 +42,7 @@ void __init amiga_chip_init(void)
     chipavail = amiga_chip_size;
 }
 
-    
+
 void *amiga_chip_alloc(unsigned long size, const char *name)
 {
     struct resource *res;
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 5f3b13bee..4775e18a7 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -332,7 +332,7 @@ static void __init amiga_identify(void)
 
   case AMI_DRACO:
     panic("No support for Draco yet");
- 
+
   default:
     panic("Unknown Amiga Model");
   }
@@ -426,7 +426,7 @@ void __init config_amiga(void)
 				      */
 
   mach_set_clock_mmss  = amiga_set_clock_mmss;
-  mach_get_ss          = amiga_get_ss; 
+  mach_get_ss          = amiga_get_ss;
 #ifdef CONFIG_AMIGA_FLOPPY
   mach_floppy_setup    = amiga_floppy_setup;
 #endif
@@ -679,13 +679,13 @@ static int amiga_set_clock_mmss (unsigned long nowtime)
 		tod_3000.second2 = real_seconds % 10;
 		tod_3000.minute1 = real_minutes / 10;
 		tod_3000.minute2 = real_minutes % 10;
-		
+
 		tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
 	} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
 		int cnt = 5;
 
 		tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
-		
+
 		while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--)
 		{
 			tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
@@ -715,7 +715,7 @@ static unsigned int amiga_get_ss( void )
 		tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
 		s = tod_3000.second1 * 10 + tod_3000.second2;
 		tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
-	} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ { 
+	} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
 		s = tod_2000.second1 * 10 + tod_2000.second2;
 	}
 	return s;
@@ -758,7 +758,7 @@ static void amiga_reset (void)
        : "a" (jmp_addr));
  jmp_addr_label040:
   /* disable translation on '040 now */
-  __asm__ __volatile__    
+  __asm__ __volatile__
     ("moveq #0,%/d0\n\t"
      ".chip 68040\n\t"
      "movec %%d0,%%tc\n\t"	/* disable MMU */
@@ -783,7 +783,7 @@ static void amiga_reset (void)
      "1:\n\t"
      "reset\n\t"
      "jmp   %/a0@" : /* Just that gcc scans it for % escapes */ );
-  
+
   for (;;);
 
 }
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 3e96cb6ee..264929471 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -62,19 +62,19 @@ int apollo_parse_bootinfo(const struct bi_record *record) {
 	const unsigned long *data = record->data;
 
 	switch(record->tag) {
-		case BI_APOLLO_MODEL: 
-			apollo_model=*data;	
+		case BI_APOLLO_MODEL:
+			apollo_model=*data;
 			break;
 
 		default:
 			 unknown=1;
 	}
-	
+
 	return unknown;
 }
 
 void dn_setup_model(void) {
-	
+
 
 	printk("Apollo hardware found: ");
 	printk("[%s]\n", apollo_models[apollo_model - APOLLO_DN3000]);
@@ -85,19 +85,19 @@ void dn_setup_model(void) {
 			break;
 		case APOLLO_DN3000:
 		case APOLLO_DN3010:
-			sio01_physaddr=SAU8_SIO01_PHYSADDR;	
-			rtc_physaddr=SAU8_RTC_PHYSADDR;	
-			pica_physaddr=SAU8_PICA;	
-			picb_physaddr=SAU8_PICB;	
+			sio01_physaddr=SAU8_SIO01_PHYSADDR;
+			rtc_physaddr=SAU8_RTC_PHYSADDR;
+			pica_physaddr=SAU8_PICA;
+			picb_physaddr=SAU8_PICB;
 			cpuctrl_physaddr=SAU8_CPUCTRL;
 			timer_physaddr=SAU8_TIMER;
 			break;
 		case APOLLO_DN4000:
-			sio01_physaddr=SAU7_SIO01_PHYSADDR;	
-			sio23_physaddr=SAU7_SIO23_PHYSADDR;	
-			rtc_physaddr=SAU7_RTC_PHYSADDR;	
-			pica_physaddr=SAU7_PICA;	
-			picb_physaddr=SAU7_PICB;	
+			sio01_physaddr=SAU7_SIO01_PHYSADDR;
+			sio23_physaddr=SAU7_SIO23_PHYSADDR;
+			rtc_physaddr=SAU7_RTC_PHYSADDR;
+			pica_physaddr=SAU7_PICA;
+			picb_physaddr=SAU7_PICB;
 			cpuctrl_physaddr=SAU7_CPUCTRL;
 			timer_physaddr=SAU7_TIMER;
 			break;
@@ -105,11 +105,11 @@ void dn_setup_model(void) {
 			panic("Apollo model not yet supported");
 			break;
 		case APOLLO_DN3500:
-			sio01_physaddr=SAU7_SIO01_PHYSADDR;	
-			sio23_physaddr=SAU7_SIO23_PHYSADDR;	
-			rtc_physaddr=SAU7_RTC_PHYSADDR;	
-			pica_physaddr=SAU7_PICA;	
-			picb_physaddr=SAU7_PICB;	
+			sio01_physaddr=SAU7_SIO01_PHYSADDR;
+			sio23_physaddr=SAU7_SIO23_PHYSADDR;
+			rtc_physaddr=SAU7_RTC_PHYSADDR;
+			pica_physaddr=SAU7_PICA;
+			picb_physaddr=SAU7_PICB;
 			cpuctrl_physaddr=SAU7_CPUCTRL;
 			timer_physaddr=SAU7_TIMER;
 			break;
@@ -131,17 +131,17 @@ int dn_serial_console_wait_key(struct console *co) {
 void dn_serial_console_write (struct console *co, const char *str,unsigned int count)
 {
    while(count--) {
-	if (*str == '\n') { 
-    	sio01.rhrb_thrb = (unsigned char)'\r';
-       	while (!(sio01.srb_csrb & 0x4))
+	if (*str == '\n') {
+	sio01.rhrb_thrb = (unsigned char)'\r';
+	while (!(sio01.srb_csrb & 0x4))
                 ;
- 	}
+	}
     sio01.rhrb_thrb = (unsigned char)*str++;
     while (!(sio01.srb_csrb & 0x4))
             ;
-  }	
+  }
 }
- 
+
 void dn_serial_print (const char *str)
 {
     while (*str) {
@@ -160,7 +160,7 @@ void config_apollo(void) {
 
 	int i;
 
-	dn_setup_model();	
+	dn_setup_model();
 
 	mach_sched_init=dn_sched_init; /* */
 	mach_init_IRQ=dn_init_IRQ;
@@ -180,24 +180,24 @@ void config_apollo(void) {
         conswitchp           = &dummy_con;
 #endif
 #ifdef CONFIG_HEARTBEAT
-  	mach_heartbeat = dn_heartbeat;
+	mach_heartbeat = dn_heartbeat;
 #endif
 	mach_get_model       = dn_get_model;
 
 	cpuctrl=0xaa00;
 
 	/* clear DMA translation table */
-	for(i=0;i<0x400;i++) 
+	for(i=0;i<0x400;i++)
 		addr_xlat_map[i]=0;
 
-}		
+}
 
 irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) {
 
 	volatile unsigned char x;
 
 	sched_timer_handler(irq,dev_id,fp);
-	
+
 	x=*(volatile unsigned char *)(timer+3);
 	x=*(volatile unsigned char *)(timer+5);
 
@@ -206,7 +206,7 @@ irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) {
 
 void dn_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) {
 
-	/* program timer 1 */       	
+	/* program timer 1 */
 	*(volatile unsigned char *)(timer+3)=0x01;
 	*(volatile unsigned char *)(timer+1)=0x40;
 	*(volatile unsigned char *)(timer+5)=0x09;
@@ -272,7 +272,7 @@ void dn_dummy_reset(void) {
   for(;;);
 
 }
-	
+
 void dn_dummy_waitbut(void) {
 
   dn_serial_print("waitbut\n");
@@ -291,7 +291,7 @@ static int dn_cpuctrl=0xff00;
 
 static void dn_heartbeat(int on) {
 
-	if(on) { 
+	if(on) {
 		dn_cpuctrl&=~0x100;
 		cpuctrl=dn_cpuctrl;
 	}
diff --git a/arch/m68k/apollo/dma.c b/arch/m68k/apollo/dma.c
index 36fbb08e3..aed8be177 100644
--- a/arch/m68k/apollo/dma.c
+++ b/arch/m68k/apollo/dma.c
@@ -34,7 +34,7 @@ unsigned short dma_map_page(unsigned long phys_addr,int count,int type) {
 	next_free_xlat_entry+=2;
 	if(next_free_xlat_entry>125)
 		next_free_xlat_entry=0;
-	
+
 #if 0
 	printk("next_free_xlat_entry: %d\n",next_free_xlat_entry);
 #endif
diff --git a/arch/m68k/apollo/dn_debug.c b/arch/m68k/apollo/dn_debug.c
index 734902fbf..b106969bd 100644
--- a/arch/m68k/apollo/dn_debug.c
+++ b/arch/m68k/apollo/dn_debug.c
@@ -14,9 +14,9 @@ int dn_deb_printf(const char *fmt, ...) {
 		i=vsprintf(current_dbg_ptr,fmt,args);
 		va_end(args);
 		current_dbg_ptr+=i;
-	
+
 		return i;
 	}
-	else 
+	else
 		return 0;
 }
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c
index 71fd3ae35..a31259359 100644
--- a/arch/m68k/apollo/dn_ints.c
+++ b/arch/m68k/apollo/dn_ints.c
@@ -40,7 +40,7 @@ void dn_init_IRQ(void) {
     dn_irqs[i].dev_id=NULL;
     dn_irqs[i].devname=NULL;
   }
-  
+
 }
 
 int dn_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id) {
@@ -79,7 +79,7 @@ void dn_free_irq(unsigned int irq, void *dev_id) {
   if(irq<8)
     *(volatile unsigned char *)(pica+1)|=(1<<irq);
   else
-    *(volatile unsigned char *)(picb+1)|=(1<<(irq-8));  
+    *(volatile unsigned char *)(picb+1)|=(1<<(irq-8));
 
   dn_irqs[irq].handler=NULL;
   dn_irqs[irq].flags=IRQ_FLG_STD;
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index f195e0e3b..076f47917 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -54,14 +54,14 @@
 /*
  * Atari interrupt handling scheme:
  * --------------------------------
- * 
+ *
  * All interrupt source have an internal number (defined in
  * <asm/atariints.h>): Autovector interrupts are 1..7, then follow ST-MFP,
  * TT-MFP, SCC, and finally VME interrupts. Vector numbers for the latter can
  * be allocated by atari_register_vme_int().
  *
  * Each interrupt can be of three types:
- * 
+ *
  *  - SLOW: The handler runs with all interrupts enabled, except the one it
  *    was called by (to avoid reentering). This should be the usual method.
  *    But it is currently possible only for MFP ints, since only the MFP
@@ -179,16 +179,16 @@ __asm__ (__ALIGN_STR "\n"						   \
 "	movew	%%d1,%%sr\n"		/* set IPL = previous value */	   \
 "	addql	#1,%a0\n"						   \
 "	lea	%a1,%%a0\n"						   \
-"	pea 	%%sp@\n"		/* push addr of frame */	   \
+"	pea	%%sp@\n"		/* push addr of frame */	   \
 "	movel	%%a0@(4),%%sp@-\n"	/* push handler data */		   \
-"	pea 	(%c3+8)\n"		/* push int number */		   \
+"	pea	(%c3+8)\n"		/* push int number */		   \
 "	movel	%%a0@,%%a0\n"						   \
 "	jbsr	%%a0@\n"		/* call the handler */		   \
 "	addql	#8,%%sp\n"						   \
 "	addql	#4,%%sp\n"						   \
 "	orw	#0x0600,%%sr\n"						   \
 "	andw	#0xfeff,%%sr\n"		/* set IPL = 6 again */		   \
-"	orb 	#(1<<(%c3&7)),%a4:w\n"	/* now unmask the int again */	   \
+"	orb	#(1<<(%c3&7)),%a4:w\n"	/* now unmask the int again */	   \
 "	jbra	ret_from_interrupt\n"					   \
 	 : : "i" (&kstat_cpu(0).irqs[n+8]), "i" (&irq_handler[n+8]),	   \
 	     "n" (PT_OFF_SR), "n" (n),					   \
@@ -274,7 +274,7 @@ asmlinkage void atari_prio_irq_handler( void );
 void atari_fast_prio_irq_dummy (void) {
 __asm__ (__ALIGN_STR "\n"
 "atari_fast_irq_handler:\n\t"
-	"orw 	#0x700,%%sr\n"		/* disable all interrupts */
+	"orw	#0x700,%%sr\n"		/* disable all interrupts */
 "atari_prio_irq_handler:\n\t"
 	"addl	%3,%2\n\t"		/* preempt_count() += HARDIRQ_OFFSET */
 	SAVE_ALL_INT "\n\t"
@@ -282,13 +282,13 @@ __asm__ (__ALIGN_STR "\n"
 	/* get vector number from stack frame and convert to source */
 	"bfextu	%%sp@(%c1){#4,#10},%%d0\n\t"
 	"subw	#(0x40-8),%%d0\n\t"
-	"jpl 	1f\n\t"
+	"jpl	1f\n\t"
 	"addw	#(0x40-8-0x18),%%d0\n"
     "1:\tlea	%a0,%%a0\n\t"
 	"addql	#1,%%a0@(%%d0:l:4)\n\t"
 	"lea	irq_handler,%%a0\n\t"
 	"lea	%%a0@(%%d0:l:8),%%a0\n\t"
-	"pea 	%%sp@\n\t"		/* push frame address */
+	"pea	%%sp@\n\t"		/* push frame address */
 	"movel	%%a0@(4),%%sp@-\n\t"	/* push handler data */
 	"movel	%%d0,%%sp@-\n\t"	/* push int number */
 	"movel	%%a0@,%%a0\n\t"
@@ -395,7 +395,7 @@ void __init atari_init_IRQ(void)
 		   be in an atasound_init(), that doesn't exist yet. */
 		atari_microwire_cmd(MW_LM1992_PSG_HIGH);
 	}
-	
+
 	stdma_init();
 
 	/* Initialize the PSG: all sounds off, both ports output */
@@ -460,7 +460,7 @@ int atari_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, stru
 		        __FUNCTION__, irq, devname);
 		return -EINVAL;
 	}
-		
+
 	if (vectors[vector] == bad_interrupt) {
 		/* int has no handler yet */
 		irq_handler[irq].handler = handler;
@@ -594,7 +594,7 @@ unsigned long atari_register_vme_int(void)
 	for(i = 0; i < 32; i++)
 		if((free_vme_vec_bitmap & (1 << i)) == 0)
 			break;
-	
+
 	if(i == 16)
 		return 0;
 
@@ -641,7 +641,7 @@ int show_atari_interrupts(struct seq_file *p, void *v)
 	}
 	if (num_spurious)
 		seq_printf(p, "spurio.: %10u\n", num_spurious);
-	
+
 	return 0;
 }
 
diff --git a/arch/m68k/atari/atasound.c b/arch/m68k/atari/atasound.c
index d3a60be60..ee04250eb 100644
--- a/arch/m68k/atari/atasound.c
+++ b/arch/m68k/atari/atasound.c
@@ -70,7 +70,7 @@ void atari_mksound (unsigned int hz, unsigned int ticks)
 	if (hz) {
 	    /* Convert from frequency value to PSG period value (base
 	       frequency 125 kHz).  */
-		
+
 	    period = PSG_FREQ / hz;
 
 	    if (period > 0xfff) period = 0xfff;
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index 665745ba3..9261d2dee 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -7,7 +7,7 @@
  *    Added setting of time_adj to get a better clock.
  *
  *  5/14/94 Roman Hodek:
- *    gettod() for TT 
+ *    gettod() for TT
  *
  *  5/15/94 Roman Hodek:
  *    hard_reset_now() for Atari (and others?)
@@ -92,7 +92,7 @@ extern void atari_debug_init(void);
  * for posterity.
  *   -- Peter Maydell <pmaydell@chiark.greenend.org.uk>, 05/1998
  */
-  
+
 #if 0
 static int __init
 hwreg_present_bywrite(volatile void *regp, unsigned char val)
@@ -100,7 +100,7 @@ hwreg_present_bywrite(volatile void *regp, unsigned char val)
     int		ret;
     long	save_sp, save_vbr;
     static long tmp_vectors[3] = { [2] = (long)&&after_test };
-	
+
     __asm__ __volatile__
 	(	"movec	%/vbr,%2\n\t"	/* save vbr value            */
                 "movec	%4,%/vbr\n\t"	/* set up temporary vectors  */
@@ -141,14 +141,14 @@ static int __init scc_test( volatile char *ctla )
 
 	*ctla = 2; MFPDELAY();
 	*ctla = 0x40; MFPDELAY();
-	
+
 	*ctla = 2; MFPDELAY();
 	if (*ctla != 0x40) return( 0 );
 	MFPDELAY();
 
 	*ctla = 2; MFPDELAY();
 	*ctla = 0x60; MFPDELAY();
-	
+
 	*ctla = 2; MFPDELAY();
 	if (*ctla != 0x60) return( 0 );
 
@@ -199,7 +199,7 @@ void __init atari_switches_setup( const char *str, unsigned len )
 	    p += 3;
 	    ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
 	}
-	
+
 	if (strcmp( p, "ikbd" ) == 0) {
 	    /* RTS line of IKBD ACIA */
 	    atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
@@ -269,8 +269,8 @@ void __init config_atari(void)
 			   ((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
 			   ((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
     }
-	
-    /* ++bjoern: 
+
+    /* ++bjoern:
      * Determine hardware present
      */
 
@@ -446,7 +446,7 @@ void __init config_atari(void)
 						  : /* no outputs */
 						  : /* no inputs */
 						  : "d0");
-	
+
     /* allocator for memory that must reside in st-ram */
     atari_stram_init ();
 
@@ -507,7 +507,7 @@ static void atari_heartbeat( int on )
 
     if (atari_dont_touch_floppy_select)
 	return;
-    
+
     local_irq_save(flags);
     sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
     tmp = sound_ym.rd_data_reg_sel;
@@ -544,7 +544,7 @@ static void atari_heartbeat( int on )
  * address of a C label. No hope to compile this with another compiler
  * than GCC!
  */
-  
+
 /* ++andreas: no need for complicated code, just depend on prefetch */
 
 static void atari_reset (void)
@@ -563,7 +563,7 @@ static void atari_reset (void)
 	acia.key_ctrl = ACIA_RESET;
     if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
 	acia.mid_ctrl = ACIA_RESET;
-    
+
     /* processor independent: turn off interrupts and reset the VBR;
      * the caches must be left enabled, else prefetching the final jump
      * instruction doesn't work. */
@@ -572,7 +572,7 @@ static void atari_reset (void)
 	("moveq	#0,%/d0\n\t"
 	 "movec	%/d0,%/vbr"
 	 : : : "d0" );
-    
+
     if (CPU_IS_040_OR_060) {
         unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
 	if (CPU_IS_060) {
@@ -584,7 +584,7 @@ static void atari_reset (void)
 		 ".chip 68k"
 		 : : : "d0" );
 	}
-	    
+
         __asm__ __volatile__
             ("movel    %0,%/d0\n\t"
              "andl     #0xff000000,%/d0\n\t"
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c
index 0bbe230ac..ace05f79d 100644
--- a/arch/m68k/atari/debug.c
+++ b/arch/m68k/atari/debug.c
@@ -4,7 +4,7 @@
  * Atari debugging and serial console stuff
  *
  * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek
- *  
+ *
  * 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.
@@ -99,7 +99,7 @@ static int ata_par_out (char c)
     while( (mfp.par_dt_reg & 1) && --i ) /* wait for BUSY == L */
 	;
     if (!i) return( 0 );
-    
+
     sound_ym.rd_data_reg_sel = 15;  /* select port B */
     sound_ym.wd_data = c;           /* put char onto port */
     sound_ym.rd_data_reg_sel = 14;  /* select port A */
@@ -177,7 +177,7 @@ void atari_init_mfp_port( int cflag )
     if (baud < B1200 || baud > B38400+2)
 	baud = B9600; /* use default 9600bps for non-implemented rates */
     baud -= B1200; /* baud_table[] starts at 1200bps */
-	
+
     mfp.trn_stat &= ~0x01; /* disable TX */
     mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */
     mfp.tim_ct_cd &= 0x70;  /* stop timer D */
@@ -204,7 +204,7 @@ void atari_init_mfp_port( int cflag )
 	for( i = 100; i > 0; --i )		\
 	    MFPDELAY();				\
     } while(0)
-    
+
 #ifndef CONFIG_SERIAL_CONSOLE
 static void __init atari_init_scc_port( int cflag )
 #else
@@ -214,20 +214,20 @@ void atari_init_scc_port( int cflag )
     extern int atari_SCC_reset_done;
     static int clksrc_table[9] =
 	/* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
-    	{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
+	{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
     static int brgsrc_table[9] =
 	/* reg 14: 0 = RTxC, 2 = PCLK */
-    	{ 2, 2, 2, 2, 2, 2, 0, 2, 2 };
+	{ 2, 2, 2, 2, 2, 2, 0, 2, 2 };
     static int clkmode_table[9] =
 	/* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */
-    	{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
+	{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
     static int div_table[9] =
 	/* reg12 (BRG low) */
-    	{ 208, 138, 103, 50, 24, 11, 1, 0, 0 };
+	{ 208, 138, 103, 50, 24, 11, 1, 0, 0 };
 
     int baud = cflag & CBAUD;
     int clksrc, clkmode, div, reg3, reg5;
-    
+
     if (cflag & CBAUDEX)
 	baud += B38400;
     if (baud < B1200 || baud > B38400+2)
@@ -248,7 +248,7 @@ void atari_init_scc_port( int cflag )
 
     reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40;
     reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */;
-    
+
     (void)scc.cha_b_ctrl;	/* reset reg pointer */
     SCC_WRITE( 9, 0xc0 );	/* reset */
     LONG_DELAY();		/* extra delay after WR9 access */
@@ -267,12 +267,12 @@ void atari_init_scc_port( int cflag )
     SCC_WRITE( 14, brgsrc_table[baud] | (div ? 1 : 0) );
     SCC_WRITE( 3, reg3 | 1 );
     SCC_WRITE( 5, reg5 | 8 );
-    
+
     atari_SCC_reset_done = 1;
     atari_SCC_init_done = 1;
 }
 
-#ifndef CONFIG_SERIAL_CONSOLE 
+#ifndef CONFIG_SERIAL_CONSOLE
 static void __init atari_init_midi_port( int cflag )
 #else
 void atari_init_midi_port( int cflag )
diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c
index d4f030fe9..05f02e4fd 100644
--- a/arch/m68k/atari/stdma.c
+++ b/arch/m68k/atari/stdma.c
@@ -97,7 +97,7 @@ void stdma_lock(irqreturn_t (*handler)(int, void *, struct pt_regs *),
 /*
  * Function: void stdma_release( void )
  *
- * Purpose: Releases the lock on the ST-DMA chip. 
+ * Purpose: Releases the lock on the ST-DMA chip.
  *
  * Inputs: none
  *
diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c
index 45644b89e..b03d03163 100644
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -52,7 +52,7 @@
 /* Pre-swapping comments:
  *
  * ++roman:
- * 
+ *
  * New version of ST-Ram buffer allocation. Instead of using the
  * 1 MB - 4 KB that remain when the ST-Ram chunk starts at $1000
  * (1 MB granularity!), such buffers are reserved like this:
@@ -60,14 +60,14 @@
  *  - If the kernel resides in ST-Ram anyway, we can take the buffer
  *    from behind the current kernel data space the normal way
  *    (incrementing start_mem).
- *    
+ *
  *  - If the kernel is in TT-Ram, stram_init() initializes start and
  *    end of the available region. Buffers are allocated from there
  *    and mem_init() later marks the such used pages as reserved.
  *    Since each TT-Ram chunk is at least 4 MB in size, I hope there
  *    won't be an overrun of the ST-Ram region by normal kernel data
  *    space.
- *    
+ *
  * For that, ST-Ram may only be allocated while kernel initialization
  * is going on, or exactly: before mem_init() is called. There is also
  * no provision now for freeing ST-Ram buffers. It seems that isn't
@@ -105,7 +105,7 @@
  * visible on a TT, where the speed difference between ST- and TT-RAM isn't
  * that dramatic, but it should on machines where TT-RAM is really much faster
  * (e.g. Afterburner).
- * 
+ *
  *   [1]: __get_free_pages() does a fine job if you only want one page, but if
  * you want more (contiguous) pages, it can give you such a block only if
  * there's already a free one. The algorithm can't try to free buffers or swap
@@ -318,7 +318,7 @@ void __init atari_stram_reserve_pages(void *start_mem)
 			swap_end =  swap_start + max_swap_size;
 		DPRINTK( "atari_stram_reserve_pages: swapping enabled; "
 				 "swap=%p-%p\n", swap_start, swap_end);
-		
+
 		/* reserve some amount of memory for maintainance of
 		 * swapping itself: one page for each 2048 (PAGE_SIZE/2)
 		 * swap pages. (2 bytes for each page) */
@@ -328,7 +328,7 @@ void __init atari_stram_reserve_pages(void *start_mem)
 		/* correct swap_start if necessary */
 		if (swap_start + PAGE_SIZE == swap_data)
 			swap_start = start_mem - PAGE_SIZE;
-		
+
 		if (!swap_init( start_mem, swap_data )) {
 			printk( KERN_ERR "ST-RAM swap space initialization failed\n" );
 			max_swap_size = 0;
@@ -368,13 +368,13 @@ void atari_stram_mem_init_hook (void)
 /*
  * This is main public interface: somehow allocate a ST-RAM block
  * There are three strategies:
- * 
+ *
  *  - If we're before mem_init(), we have to make a static allocation. The
  *    region is taken in the kernel data area (if the kernel is in ST-RAM) or
  *    from the start of ST-RAM (if the kernel is in TT-RAM) and added to the
  *    rsvd_stram_* region. The ST-RAM is somewhere in the middle of kernel
  *    address space in the latter case.
- * 
+ *
  *  - If mem_init() already has been called and ST-RAM swapping is enabled,
  *    try to get the memory from the (pseudo) swap-space, either free already
  *    or by moving some other pages out of the swap.
@@ -383,7 +383,7 @@ void atari_stram_mem_init_hook (void)
  *    enabled, the only possibility is to try with __get_dma_pages(). This has
  *    the disadvantage that it's very hard to get more than 1 page, and it is
  *    likely to fail :-(
- * 
+ *
  */
 void *atari_stram_alloc(long size, const char *owner)
 {
@@ -450,7 +450,7 @@ void atari_stram_free( void *addr )
 	}
 	DPRINTK( "atari_stram_free: found block (%p): size=%08lx, owner=%s, "
 			 "flags=%02x\n", block, block->size, block->owner, block->flags );
-	
+
 #ifdef CONFIG_STRAM_SWAP
 	if (!max_swap_size) {
 #endif
@@ -503,14 +503,14 @@ static int __init swap_init(void *start_mem, void *swap_data)
 
 	DPRINTK("swap_init(start_mem=%p, swap_data=%p)\n",
 		start_mem, swap_data);
-	
+
 	/* need at least one page for swapping to (and this also isn't very
 	 * much... :-) */
 	if (swap_end - swap_start < 2*PAGE_SIZE) {
 		printk( KERN_WARNING "stram_swap_init: swap space too small\n" );
 		return( 0 );
 	}
-	
+
 	/* find free slot in swap_info */
 	for( p = swap_info, type = 0; type < nr_swapfiles; type++, p++ )
 		if (!(p->flags & SWP_USED))
@@ -531,7 +531,7 @@ static int __init swap_init(void *start_mem, void *swap_data)
 	fake_dentry.d_name.name = "stram (internal)";
 	fake_dentry.d_name.len = 16;
 	fake_vfsmnt.mnt_parent = &fake_vfsmnt;
-	
+
 	p->flags        = SWP_USED;
 	p->swap_file    = &fake_dentry;
 	p->swap_vfsmnt  = &fake_vfsmnt;
@@ -706,7 +706,7 @@ static void unswap_vma(struct vm_area_struct * vma, pgd_t *pgdir,
 	} while (start < end);
 }
 
-static void unswap_process(struct mm_struct * mm, swp_entry_t entry, 
+static void unswap_process(struct mm_struct * mm, swp_entry_t entry,
 			   struct page *page)
 {
 	struct vm_area_struct* vma;
@@ -752,7 +752,7 @@ static int unswap_by_read(unsigned short *map, unsigned long max,
 			/* Get a page for the entry, using the existing
 			   swap cache page if there is one.  Otherwise,
 			   get a clean page and read the swap into it. */
-			page = read_swap_cache_async(entry);
+			page = read_swap_cache_async(entry, NULL, 0);
 			if (!page) {
 				swap_free(entry);
 				return -ENOMEM;
@@ -799,7 +799,7 @@ static void *get_stram_region( unsigned long n_pages )
 	unsigned long start, total_free, region_free;
 	int err;
 	void *ret = NULL;
-	
+
 	DPRINTK( "get_stram_region(n_pages=%lu)\n", n_pages );
 
 	down(&stram_swap_sem);
@@ -874,7 +874,7 @@ static void free_stram_region( unsigned long offset, unsigned long n_pages )
 static int in_some_region(void *addr)
 {
 	BLOCK *p;
-	
+
 	for( p = alloc_list; p; p = p->next ) {
 		if (p->start <= addr && addr < p->start + p->size)
 			return( 1 );
@@ -920,7 +920,7 @@ static unsigned long find_free_region(unsigned long n_pages,
 			/* don't need more free pages... :-) */
 			goto out;
 	}
-	
+
 	/* now shift the window and look for the area where as much pages as
 	 * possible are free */
 	while( tail < max ) {
@@ -1130,7 +1130,7 @@ static BLOCK *add_region( void *addr, unsigned long size )
 static BLOCK *find_region( void *addr )
 {
 	BLOCK *p;
-	
+
 	for( p = alloc_list; p; p = p->next ) {
 		if (p->start == addr)
 			return( p );
@@ -1145,7 +1145,7 @@ static BLOCK *find_region( void *addr )
 static int remove_region( BLOCK *block )
 {
 	BLOCK **p;
-	
+
 	for( p = &alloc_list; *p; p = &((*p)->next) )
 		if (*p == block) break;
 	if (!*p)
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c
index 654d8466e..6df7fb60d 100644
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -4,7 +4,7 @@
  * Atari time and real time clock stuff
  *
  * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek
- *  
+ *
  * 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.
@@ -25,7 +25,7 @@ atari_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
     /* set Timer C data Register */
     mfp.tim_dt_c = INT_TICKS;
     /* start timer C, div = 1:100 */
-    mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60; 
+    mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60;
     /* install interrupt service routine for MFP Timer C */
     request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW,
                 "timer", timer_routine);
@@ -34,7 +34,7 @@ atari_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
 /* ++andreas: gettimeoffset fixed to check for pending interrupt */
 
 #define TICK_SIZE 10000
-  
+
 /* This is always executed with interrupts disabled.  */
 unsigned long atari_gettimeoffset (void)
 {
@@ -59,9 +59,9 @@ static void mste_read(struct MSTE_RTC *val)
 {
 #define COPY(v) val->v=(mste_rtc.v & 0xf)
 	do {
-		COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ; 
-		COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ; 
-		COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ; 
+		COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ;
+		COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ;
+		COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ;
 		COPY(mon_ones) ; COPY(mon_tens) ; COPY(year_ones) ;
 		COPY(year_tens) ;
 	/* prevent from reading the clock while it changed */
@@ -73,9 +73,9 @@ static void mste_write(struct MSTE_RTC *val)
 {
 #define COPY(v) mste_rtc.v=val->v
 	do {
-		COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ; 
-		COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ; 
-		COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ; 
+		COPY(sec_ones) ; COPY(sec_tens) ; COPY(min_ones) ;
+		COPY(min_tens) ; COPY(hr_ones) ; COPY(hr_tens) ;
+		COPY(weekday) ; COPY(day_ones) ; COPY(day_tens) ;
 		COPY(mon_ones) ; COPY(mon_tens) ; COPY(year_ones) ;
 		COPY(year_tens) ;
 	/* prevent from writing the clock while it changed */
@@ -104,14 +104,14 @@ int atari_mste_hwclk( int op, struct rtc_time *t )
     int hour, year;
     int hr24=0;
     struct MSTE_RTC val;
-    
+
     mste_rtc.mode=(mste_rtc.mode | 1);
     hr24=mste_rtc.mon_tens & 1;
     mste_rtc.mode=(mste_rtc.mode & ~1);
 
     if (op) {
         /* write: prepare values */
-        
+
         val.sec_ones = t->tm_sec % 10;
         val.sec_tens = t->tm_sec / 10;
         val.min_ones = t->tm_min % 10;
@@ -160,8 +160,8 @@ int atari_mste_hwclk( int op, struct rtc_time *t )
 
 int atari_tt_hwclk( int op, struct rtc_time *t )
 {
-    int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0; 
-    unsigned long 	flags;
+    int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0;
+    unsigned long	flags;
     unsigned char	ctrl;
     int pm = 0;
 
@@ -170,7 +170,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
 
     if (op) {
         /* write: prepare values */
-        
+
         sec  = t->tm_sec;
         min  = t->tm_min;
         hour = t->tm_hour;
@@ -178,7 +178,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
         mon  = t->tm_mon + 1;
         year = t->tm_year - atari_rtc_year_offset;
         wday = t->tm_wday + (t->tm_wday >= 0);
-        
+
         if (!(ctrl & RTC_24H)) {
 	    if (hour > 11) {
 		pm = 0x80;
@@ -188,7 +188,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
 	    else if (hour == 0)
 		hour = 12;
         }
-        
+
         if (!(ctrl & RTC_DM_BINARY)) {
             BIN_TO_BCD(sec);
             BIN_TO_BCD(min);
@@ -199,7 +199,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
             if (wday >= 0) BIN_TO_BCD(wday);
         }
     }
-    
+
     /* Reading/writing the clock registers is a bit critical due to
      * the regular update cycle of the RTC. While an update is in
      * progress, registers 0..9 shouldn't be touched.
@@ -242,7 +242,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
 
     if (!op) {
         /* read: adjust values */
-        
+
         if (hour & 0x80) {
 	    hour &= ~0x80;
 	    pm = 1;
@@ -284,7 +284,7 @@ int atari_mste_set_clock_mmss (unsigned long nowtime)
     struct MSTE_RTC val;
     unsigned char rtc_minutes;
 
-    mste_read(&val);  
+    mste_read(&val);
     rtc_minutes= val.min_ones + val.min_tens * 10;
     if ((rtc_minutes < real_minutes
          ? real_minutes - rtc_minutes
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c
index e30fa33a6..c6b2a410b 100644
--- a/arch/m68k/bvme6000/rtc.c
+++ b/arch/m68k/bvme6000/rtc.c
@@ -44,7 +44,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
 	unsigned char msr;
 	unsigned long flags;
-	struct rtc_time wtime; 
+	struct rtc_time wtime;
 
 	switch (cmd) {
 	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
@@ -105,7 +105,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 		if (yrs >= 2070)
 			return -EINVAL;
-		
+
 		local_irq_save(flags);
 		/* Ensure clock and real-time-mode-register are accessible */
 		msr = rtc->msr & 0xc0;
diff --git a/arch/m68k/defconfig b/arch/m68k/defconfig
index fcd7d0257..5ea3db600 100644
--- a/arch/m68k/defconfig
+++ b/arch/m68k/defconfig
@@ -101,7 +101,7 @@ CONFIG_INET=y
 # CONFIG_ATM is not set
 
 #
-#  
+#
 #
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
diff --git a/arch/m68k/fpsp040/README b/arch/m68k/fpsp040/README
index 5446a71e8..f57494460 100644
--- a/arch/m68k/fpsp040/README
+++ b/arch/m68k/fpsp040/README
@@ -12,7 +12,7 @@ MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
 PARTICULAR PURPOSE and any warranty against infringement with
 regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
-and any accompanying written materials. 
+and any accompanying written materials.
 
 To the maximum extent permitted by applicable law,
 IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
@@ -20,7 +20,7 @@ IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
 PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
 OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE
 SOFTWARE.  Motorola assumes no responsibility for the maintenance
-and support of the SOFTWARE.  
+and support of the SOFTWARE.
 
 You are hereby granted a copyright license to use, modify, and
 distribute the SOFTWARE so long as this entire notice is retained
diff --git a/arch/m68k/fpsp040/bindec.S b/arch/m68k/fpsp040/bindec.S
index b0ce37b74..3ba446a99 100644
--- a/arch/m68k/fpsp040/bindec.S
+++ b/arch/m68k/fpsp040/bindec.S
@@ -19,7 +19,7 @@
 |
 |	Algorithm:
 |
-|	A1.	Set RM and size ext;  Set SIGMA = sign of input.  
+|	A1.	Set RM and size ext;  Set SIGMA = sign of input.
 |		The k-factor is saved for use in d7. Clear the
 |		BINDEC_FLG for separating normalized/denormalized
 |		input.  If input is unnormalized or denormalized,
@@ -29,15 +29,15 @@
 |
 |	A3.	Compute ILOG.
 |		ILOG is the log base 10 of the input value.  It is
-|		approximated by adding e + 0.f when the original 
-|		value is viewed as 2^^e * 1.f in extended precision.  
+|		approximated by adding e + 0.f when the original
+|		value is viewed as 2^^e * 1.f in extended precision.
 |		This value is stored in d6.
 |
 |	A4.	Clr INEX bit.
-|		The operation in A3 above may have set INEX2.  
+|		The operation in A3 above may have set INEX2.
 |
 |	A5.	Set ICTR = 0;
-|		ICTR is a flag used in A13.  It must be set before the 
+|		ICTR is a flag used in A13.  It must be set before the
 |		loop entry A6.
 |
 |	A6.	Calculate LEN.
@@ -59,9 +59,9 @@
 |		of ISCALE and X.  A table is given in the code.
 |
 |	A8.	Clr INEX; Force RZ.
-|		The operation in A3 above may have set INEX2.  
+|		The operation in A3 above may have set INEX2.
 |		RZ mode is forced for the scaling operation to insure
-|		only one rounding error.  The grs bits are collected in 
+|		only one rounding error.  The grs bits are collected in
 |		the INEX flag for use in A10.
 |
 |	A9.	Scale X -> Y.
@@ -90,11 +90,11 @@
 |		the mantissa by 10.
 |
 |	A14.	Convert the mantissa to bcd.
-|		The binstr routine is used to convert the LEN digit 
+|		The binstr routine is used to convert the LEN digit
 |		mantissa to bcd in memory.  The input to binstr is
 |		to be a fraction; i.e. (mantissa)/10^LEN and adjusted
 |		such that the decimal point is to the left of bit 63.
-|		The bcd digits are stored in the correct position in 
+|		The bcd digits are stored in the correct position in
 |		the final string area in memory.
 |
 |	A15.	Convert the exponent to bcd.
@@ -114,7 +114,7 @@
 |		d2: upper 32-bits of mantissa for binstr
 |		d3: scratch;lower 32-bits of mantissa for binstr
 |		d4: LEN
-|      		d5: LAMBDA/ICTR
+|		d5: LAMBDA/ICTR
 |		d6: ILOG
 |		d7: k-factor
 |		a0: ptr for original operand/final result
@@ -131,8 +131,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |BINDEC    idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -142,16 +142,16 @@
 	|section	8
 
 | Constants in extended precision
-LOG2: 	.long	0x3FFD0000,0x9A209A84,0xFBCFF798,0x00000000
+LOG2:	.long	0x3FFD0000,0x9A209A84,0xFBCFF798,0x00000000
 LOG2UP1:	.long	0x3FFD0000,0x9A209A84,0xFBCFF799,0x00000000
 
 | Constants in single precision
-FONE: 	.long	0x3F800000,0x00000000,0x00000000,0x00000000
+FONE:	.long	0x3F800000,0x00000000,0x00000000,0x00000000
 FTWO:	.long	0x40000000,0x00000000,0x00000000,0x00000000
-FTEN: 	.long	0x41200000,0x00000000,0x00000000,0x00000000
+FTEN:	.long	0x41200000,0x00000000,0x00000000,0x00000000
 F4933:	.long	0x459A2800,0x00000000,0x00000000,0x00000000
 
-RBDTBL: 	.byte	0,0,0,0
+RBDTBL:	.byte	0,0,0,0
 	.byte	3,3,2,2
 	.byte	3,2,2,3
 	.byte	2,3,3,2
@@ -171,7 +171,7 @@ bindec:
 |     separating  normalized/denormalized input.  If the input
 |     is a denormalized number, set the BINDEC_FLG memory word
 |     to signal denorm.  If the input is unnormalized, normalize
-|     the input and test for denormalized result.  
+|     the input and test for denormalized result.
 |
 	fmovel	#rm_mode,%FPCR	|set RM and ext
 	movel	(%a0),L_SCR2(%a6)	|save exponent for sign check
@@ -251,7 +251,7 @@ A3_cont:
 	subw	#0x3fff,%d0	|strip off bias
 	faddw	%d0,%fp0		|add in exp
 	fsubs	FONE,%fp0	|subtract off 1.0
-	fbge	pos_res		|if pos, branch 
+	fbge	pos_res		|if pos, branch
 	fmulx	LOG2UP1,%fp0	|if neg, mul by LOG2UP1
 	fmovel	%fp0,%d6		|put ILOG in d6 as a lword
 	bras	A4_str		|go move out ILOG
@@ -261,14 +261,14 @@ pos_res:
 
 
 | A4. Clr INEX bit.
-|     The operation in A3 above may have set INEX2.  
+|     The operation in A3 above may have set INEX2.
 
-A4_str:	
+A4_str:
 	fmovel	#0,%FPSR		|zero all of fpsr - nothing needed
 
 
 | A5. Set ICTR = 0;
-|     ICTR is a flag used in A13.  It must be set before the 
+|     ICTR is a flag used in A13.  It must be set before the
 |     loop entry A6. The lower word of d5 is used for ICTR.
 
 	clrw	%d5		|clear ICTR
@@ -303,7 +303,7 @@ A4_str:
 |	L_SCR1:x/x
 |	L_SCR2:first word of X packed/Unchanged
 
-A6_str:	
+A6_str:
 	tstl	%d7		|branch on sign of k
 	bles	k_neg		|if k <= 0, LEN = ILOG + 1 - k
 	movel	%d7,%d4		|if k > 0, LEN = k
@@ -375,13 +375,13 @@ LEN_ng:
 |	L_SCR1:x/x
 |	L_SCR2:first word of X packed/Unchanged
 
-A7_str:	
+A7_str:
 	tstl	%d7		|test sign of k
 	bgts	k_pos		|if pos and > 0, skip this
 	cmpl	%d6,%d7		|test k - ILOG
 	blts	k_pos		|if ILOG >= k, skip this
 	movel	%d7,%d6		|if ((k<0) & (ILOG < k)) ILOG = k
-k_pos:	
+k_pos:
 	movel	%d6,%d0		|calc ILOG + 1 - LEN in d0
 	addql	#1,%d0		|add the 1
 	subl	%d4,%d0		|sub off LEN
@@ -395,9 +395,9 @@ k_pos:
 	bgts	no_inf		|if false, skip rest
 	addil	#24,%d0		|add in 24 to iscale
 	movel	#24,%d2		|put 24 in d2 for A9
-no_inf:	
+no_inf:
 	negl	%d0		|and take abs of ISCALE
-iscale:	
+iscale:
 	fmoves	FONE,%fp1	|init fp1 to 1
 	bfextu	USER_FPCR(%a6){#26:#2},%d1 |get initial rmode bits
 	lslw	#1,%d1		|put them in bits 2:1
@@ -425,33 +425,33 @@ not_rp:
 	leal	PTENRM,%a1	|load a1 with RM table base
 rmode:
 	clrl	%d3		|clr table index
-e_loop:	
+e_loop:
 	lsrl	#1,%d0		|shift next bit into carry
 	bccs	e_next		|if zero, skip the mul
 	fmulx	(%a1,%d3),%fp1	|mul by 10**(d3_bit_no)
-e_next:	
+e_next:
 	addl	#12,%d3		|inc d3 to next pwrten table entry
 	tstl	%d0		|test if ISCALE is zero
 	bnes	e_loop		|if not, loop
 
 
 | A8. Clr INEX; Force RZ.
-|     The operation in A3 above may have set INEX2.  
+|     The operation in A3 above may have set INEX2.
 |     RZ mode is forced for the scaling operation to insure
-|     only one rounding error.  The grs bits are collected in 
+|     only one rounding error.  The grs bits are collected in
 |     the INEX flag for use in A10.
 |
 | Register usage:
 |	Input/Output
 
-	fmovel	#0,%FPSR		|clr INEX 
+	fmovel	#0,%FPSR		|clr INEX
 	fmovel	#rz_mode,%FPCR	|set RZ rounding mode
 
 
 | A9. Scale X -> Y.
 |     The mantissa is scaled to the desired number of significant
 |     digits.  The excess digits are collected in INEX2. If mul,
-|     Check d2 for excess 10 exponential value.  If not zero, 
+|     Check d2 for excess 10 exponential value.  If not zero,
 |     the iscale value would have caused the pwrten calculation
 |     to overflow.  Only a negative iscale can cause this, so
 |     multiply by 10^(d2), which is now only allowed to be 24,
@@ -480,7 +480,7 @@ e_next:
 |	L_SCR1:x/x
 |	L_SCR2:first word of X packed/Unchanged
 
-A9_str:	
+A9_str:
 	fmovex	(%a0),%fp0	|load X from memory
 	fabsx	%fp0		|use abs(X)
 	tstw	%d5		|LAMBDA is in lower word of d5
@@ -498,9 +498,9 @@ sc_mul:
 	movel	#18,%d3		|load count for busy stack
 A9_loop:
 	clrl	-(%a7)		|clear lword on stack
-	dbf	%d3,A9_loop	
+	dbf	%d3,A9_loop
 	moveb	VER_TMP(%a6),(%a7) |write current version number
-	moveb	#BUSY_SIZE-4,1(%a7) |write current busy size 
+	moveb	#BUSY_SIZE-4,1(%a7) |write current busy size
 	moveb	#0x10,0x44(%a7)	|set fcefpte[15] bit
 	movew	#0x0023,0x40(%a7)	|load cmdreg1b with mul command
 	moveb	#0xfe,0x8(%a7)	|load all 1s to cu savepc
@@ -537,7 +537,7 @@ A9_con:
 |	fp1: 10^ISCALE/Unchanged
 |	fp2: x/x
 
-A10_st:	
+A10_st:
 	fmovel	%FPSR,%d0		|get FPSR
 	fmovex	%fp0,FP_SCR2(%a6)	|move Y to memory
 	leal	FP_SCR2(%a6),%a2	|load a2 with ptr to FP_SCR2
@@ -553,9 +553,9 @@ A10_st:
 |      routine expects the FPCR value to be in USER_FPCR for
 |      mode and precision.  The original FPCR is saved in L_SCR1.
 
-A11_st:	
+A11_st:
 	movel	USER_FPCR(%a6),L_SCR1(%a6) |save it for later
-	andil	#0x00000030,USER_FPCR(%a6) |set size to ext, 
+	andil	#0x00000030,USER_FPCR(%a6) |set size to ext,
 |					;block exceptions
 
 
@@ -584,13 +584,13 @@ A11_st:
 |	L_SCR2:first word of X packed/Unchanged
 
 A12_st:
-	moveml	%d0-%d1/%a0-%a1,-(%a7)	|save regs used by sintd0	
+	moveml	%d0-%d1/%a0-%a1,-(%a7)	|save regs used by sintd0
 	movel	L_SCR1(%a6),-(%a7)
 	movel	L_SCR2(%a6),-(%a7)
 	leal	FP_SCR2(%a6),%a0		|a0 is ptr to F_SCR2(a6)
 	fmovex	%fp0,(%a0)		|move Y to memory at FP_SCR2(a6)
 	tstl	L_SCR2(%a6)		|test sign of original operand
-	bges	do_fint			|if pos, use Y 
+	bges	do_fint			|if pos, use Y
 	orl	#0x80000000,(%a0)		|if neg, use -Y
 do_fint:
 	movel	USER_FPSR(%a6),-(%a7)
@@ -599,7 +599,7 @@ do_fint:
 	addl	#4,%a7
 	movel	(%a7)+,L_SCR2(%a6)
 	movel	(%a7)+,L_SCR1(%a6)
-	moveml	(%a7)+,%d0-%d1/%a0-%a1	|restore regs used by sint	
+	moveml	(%a7)+,%d0-%d1/%a0-%a1	|restore regs used by sint
 	movel	L_SCR2(%a6),FP_SCR2(%a6)	|restore original exponent
 	movel	L_SCR1(%a6),USER_FPCR(%a6) |restore user's FPCR
 
@@ -635,7 +635,7 @@ do_fint:
 |	L_SCR1:original USER_FPCR/Unchanged
 |	L_SCR2:first word of X packed/Unchanged
 
-A13_st:	
+A13_st:
 	swap	%d5		|put ICTR in lower word of d5
 	tstw	%d5		|check if ICTR = 0
 	bne	not_zr		|if non-zero, go to second test
@@ -646,7 +646,7 @@ A13_st:
 	movel	%d4,%d0		|put LEN in d0
 	subql	#1,%d0		|d0 = LEN -1
 	clrl	%d3		|clr table index
-l_loop:	
+l_loop:
 	lsrl	#1,%d0		|shift next bit into carry
 	bccs	l_next		|if zero, skip the mul
 	fmulx	(%a1,%d3),%fp2	|mul by 10**(d3_bit_no)
@@ -672,7 +672,7 @@ A13_con:
 	subql	#1,%d6		|subtract 1 from ILOG
 	movew	#1,%d5		|set ICTR
 	fmovel	#rm_mode,%FPCR	|set rmode to RM
-	fmuls	FTEN,%fp2	|compute 10^LEN 
+	fmuls	FTEN,%fp2	|compute 10^LEN
 	bra	A6_str		|return to A6 and recompute YINT
 test_2:
 	fmuls	FTEN,%fp2	|compute 10^LEN
@@ -688,7 +688,7 @@ fix_ex:
 	fmovel	#rm_mode,%FPCR	|set rmode to RM
 	bra	A6_str		|return to A6 and recompute YINT
 |
-| Since ICTR <> 0, we have already been through one adjustment, 
+| Since ICTR <> 0, we have already been through one adjustment,
 | and shouldn't have another; this is to check if abs(YINT) = 10^LEN
 | 10^LEN is again computed using whatever table is in a1 since the
 | value calculated cannot be inexact.
@@ -715,11 +715,11 @@ z_next:
 
 
 | A14. Convert the mantissa to bcd.
-|      The binstr routine is used to convert the LEN digit 
+|      The binstr routine is used to convert the LEN digit
 |      mantissa to bcd in memory.  The input to binstr is
 |      to be a fraction; i.e. (mantissa)/10^LEN and adjusted
 |      such that the decimal point is to the left of bit 63.
-|      The bcd digits are stored in the correct position in 
+|      The bcd digits are stored in the correct position in
 |      the final string area in memory.
 |
 |
@@ -745,7 +745,7 @@ z_next:
 |	L_SCR1:original USER_FPCR/Unchanged
 |	L_SCR2:first word of X packed/Unchanged
 
-A14_st:	
+A14_st:
 	fmovel	#rz_mode,%FPCR	|force rz for conversion
 	fdivx	%fp2,%fp0		|divide abs(YINT) by 10^LEN
 	leal	FP_SCR1(%a6),%a0
@@ -762,7 +762,7 @@ A14_st:
 	bgts	no_sft		|if so, don't shift
 	negl	%d0		|make exp positive
 m_loop:
-	lsrl	#1,%d2		|shift d2:d3 right, add 0s 
+	lsrl	#1,%d2		|shift d2:d3 right, add 0s
 	roxrl	#1,%d3		|the number of places
 	dbf	%d0,m_loop	|given in d0
 no_sft:
@@ -787,9 +787,9 @@ zer_m:
 |
 |      Digits are stored in L_SCR1(a6) on return from BINDEC as:
 |
-|  	 32               16 15                0
+|	 32               16 15                0
 |	-----------------------------------------
-|  	|  0 | e3 | e2 | e1 | e4 |  X |  X |  X |
+|	|  0 | e3 | e2 | e1 | e4 |  X |  X |  X |
 |	-----------------------------------------
 |
 | And are moved into their proper places in FP_SCR1.  If digit e4
@@ -817,7 +817,7 @@ zer_m:
 |	L_SCR1:original USER_FPCR/Exponent digits on return from binstr
 |	L_SCR2:first word of X packed/Unchanged
 
-A15_st:	
+A15_st:
 	tstb	BINDEC_FLG(%a6)	|check for denorm
 	beqs	not_denorm
 	ftstx	%fp0		|test for zero
@@ -839,7 +839,7 @@ not_denorm:
 	fbne	not_zero	|if zero, force exponent
 	fmoves	FONE,%fp0	|force exponent to 1
 	bras	convrt		|do it
-not_zero:	
+not_zero:
 	fmovel	%d6,%fp0		|float ILOG
 	fabsx	%fp0		|get abs of ILOG
 convrt:
@@ -852,7 +852,7 @@ convrt:
 	subiw	#0x3ffd,%d0	|subtract off bias
 	negw	%d0		|make exp positive
 x_loop:
-	lsrl	#1,%d2		|shift d2:d3 right 
+	lsrl	#1,%d2		|shift d2:d3 right
 	roxrl	#1,%d3		|the number of places
 	dbf	%d0,x_loop	|given in d0
 x_loop_fin:
@@ -863,12 +863,12 @@ x_loop_fin:
 	movel	#4,%d0		|put 4 in d0 for binstr call
 	leal	L_SCR1(%a6),%a0	|a0 is ptr to L_SCR1 for exp digits
 	bsr	binstr		|call binstr to convert exp
-	movel	L_SCR1(%a6),%d0	|load L_SCR1 lword to d0 
+	movel	L_SCR1(%a6),%d0	|load L_SCR1 lword to d0
 	movel	#12,%d1		|use d1 for shift count
 	lsrl	%d1,%d0		|shift d0 right by 12
 	bfins	%d0,FP_SCR1(%a6){#4:#12} |put e3:e2:e1 in FP_SCR1
 	lsrl	%d1,%d0		|shift d0 right by 12
-	bfins	%d0,FP_SCR1(%a6){#16:#4} |put e4 in FP_SCR1 
+	bfins	%d0,FP_SCR1(%a6){#16:#4} |put e4 in FP_SCR1
 	tstb	%d0		|check if e4 is zero
 	beqs	A16_st		|if zero, skip rest
 	orl	#opaop_mask,USER_FPSR(%a6) |set OPERR & AIOP in USER_FPSR
@@ -899,14 +899,14 @@ x_loop_fin:
 
 A16_st:
 	clrl	%d0		|clr d0 for collection of signs
-	andib	#0x0f,FP_SCR1(%a6) |clear first nibble of FP_SCR1 
+	andib	#0x0f,FP_SCR1(%a6) |clear first nibble of FP_SCR1
 	tstl	L_SCR2(%a6)	|check sign of original mantissa
 	bges	mant_p		|if pos, don't set SM
 	moveql	#2,%d0		|move 2 in to d0 for SM
 mant_p:
 	tstl	%d6		|check sign of ILOG
 	bges	wr_sgn		|if pos, don't set SE
-	addql	#1,%d0		|set bit 0 in d0 for SE 
+	addql	#1,%d0		|set bit 0 in d0 for SE
 wr_sgn:
 	bfins	%d0,FP_SCR1(%a6){#0:#2} |insert SM and SE into FP_SCR1
 
diff --git a/arch/m68k/fpsp040/binstr.S b/arch/m68k/fpsp040/binstr.S
index b3816424d..d53555c0a 100644
--- a/arch/m68k/fpsp040/binstr.S
+++ b/arch/m68k/fpsp040/binstr.S
@@ -60,8 +60,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |BINSTR    idnt    2,1 | Motorola 040 Floating Point Software Package
diff --git a/arch/m68k/fpsp040/bugfix.S b/arch/m68k/fpsp040/bugfix.S
index 654ed5a76..942c4f6f4 100644
--- a/arch/m68k/fpsp040/bugfix.S
+++ b/arch/m68k/fpsp040/bugfix.S
@@ -7,7 +7,7 @@
 |
 |	Fixes for bugs: 1238
 |
-|	Bug: 1238 
+|	Bug: 1238
 |
 |
 |    /* The following dirty_bit clear should be left in
@@ -152,8 +152,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |BUGFIX    idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -167,8 +167,8 @@
 	.global	b1238_fix
 b1238_fix:
 |
-| This code is entered only on completion of the handling of an 
-| nu-generated ovfl, unfl, or inex exception.  If the version 
+| This code is entered only on completion of the handling of an
+| nu-generated ovfl, unfl, or inex exception.  If the version
 | number of the fsave is not $40, this handler is not necessary.
 | Simply branch to fix_done and exit normally.
 |
@@ -180,11 +180,11 @@ b1238_fix:
 |
 	moveb	CU_SAVEPC(%a6),%d0
 	andib	#0xFE,%d0
-	beq 	fix_done	|if zero, this is not bug #1238
+	beq	fix_done	|if zero, this is not bug #1238
 
 |
 | Test the register conflict aspect.  If opclass0, check for
-| cu src equal to xu dest or equal to nu dest.  If so, go to 
+| cu src equal to xu dest or equal to nu dest.  If so, go to
 | op0.  Else, or if opclass2, check for cu dest equal to
 | xu dest or equal to nu dest.  If so, go to tst_opcl.  Else,
 | exit, it is not the bug case.
@@ -196,17 +196,17 @@ b1238_fix:
 	bne	op2sgl			|not opclass 0, check op2
 |
 | Check for cu and nu register conflict.  If one exists, this takes
-| priority over a cu and xu conflict. 
+| priority over a cu and xu conflict.
 |
-	bfextu	CMDREG1B(%a6){#3:#3},%d0	|get 1st src 
+	bfextu	CMDREG1B(%a6){#3:#3},%d0	|get 1st src
 	bfextu	CMDREG3B(%a6){#6:#3},%d1	|get 3rd dest
 	cmpb	%d0,%d1
 	beqs	op0			|if equal, continue bugfix
 |
-| Check for cu dest equal to nu dest.  If so, go and fix the 
+| Check for cu dest equal to nu dest.  If so, go and fix the
 | bug condition.  Otherwise, exit.
 |
-	bfextu	CMDREG1B(%a6){#6:#3},%d0	|get 1st dest 
+	bfextu	CMDREG1B(%a6){#6:#3},%d0	|get 1st dest
 	cmpb	%d0,%d1			|cmp 1st dest with 3rd dest
 	beqs	op0			|if equal, continue bugfix
 |
@@ -215,7 +215,7 @@ b1238_fix:
 	bfextu	CMDREG2B(%a6){#6:#3},%d1	|get 2nd dest
 	cmpb	%d0,%d1			|cmp 1st dest with 2nd dest
 	beqs	op0_xu			|if equal, continue bugfix
-	bfextu	CMDREG1B(%a6){#3:#3},%d0	|get 1st src 
+	bfextu	CMDREG1B(%a6){#3:#3},%d0	|get 1st src
 	cmpb	%d0,%d1			|cmp 1st src with 2nd dest
 	beq	op0_xu
 	bne	fix_done		|if the reg checks fail, exit
@@ -245,7 +245,7 @@ setete15:
 
 |
 | We have the case in which a conflict exists between the cu src or
-| dest and the dest of the xu.  We must clear the instruction in 
+| dest and the dest of the xu.  We must clear the instruction in
 | the cu and restore the state, allowing the instruction in the
 | xu to complete.  Remember, the instruction in the nu
 | was exceptional, and was completed by the appropriate handler.
@@ -255,7 +255,7 @@ setete15:
 | exceptional, we choose to kill the process.
 |
 |	Items saved from the stack:
-|	
+|
 |		$3c stag     - L_SCR1
 |		$40 cmdreg1b - L_SCR2
 |		$44 dtag     - L_SCR3
@@ -264,8 +264,8 @@ setete15:
 | fpu.
 |
 op0_xu:
-	movel	STAG(%a6),L_SCR1(%a6)	
-	movel	CMDREG1B(%a6),L_SCR2(%a6)	
+	movel	STAG(%a6),L_SCR1(%a6)
+	movel	CMDREG1B(%a6),L_SCR2(%a6)
 	movel	DTAG(%a6),L_SCR3(%a6)
 	andil	#0xe0000000,L_SCR3(%a6)
 	moveb	#0,CU_SAVEPC(%a6)
@@ -274,13 +274,13 @@ op0_xu:
 	fsave	-(%a7)
 |
 | Check if the instruction which just completed was exceptional.
-| 
+|
 	cmpw	#0x4060,(%a7)
 	beq	op0_xb
-| 
+|
 | It is necessary to isolate the result of the instruction in the
 | xu if it is to fp0 - fp3 and write that value to the USER_FPn
-| locations on the stack.  The correct destination register is in 
+| locations on the stack.  The correct destination register is in
 | cmdreg2b.
 |
 	bfextu	CMDREG2B(%a6){#6:#3},%d0	|get dest register no
@@ -339,7 +339,7 @@ op0_sete15:
 
 |
 | The frame returned is busy.  It is not possible to reconstruct
-| the code sequence to allow completion.  We will jump to 
+| the code sequence to allow completion.  We will jump to
 | fpsp_fmt_error and allow the kernel to kill the process.
 |
 op0_xb:
@@ -354,20 +354,20 @@ op2sgl:
 	cmpiw	#0x4400,%d0		|test for opclass 2 and size=sgl
 	bne	fix_done		|if not, it is not bug 1238
 |
-| Check for cu dest equal to nu dest or equal to xu dest, with 
+| Check for cu dest equal to nu dest or equal to xu dest, with
 | a cu and nu conflict taking priority an nu conflict.  If either,
 | go and fix the bug condition.  Otherwise, exit.
 |
-	bfextu	CMDREG1B(%a6){#6:#3},%d0	|get 1st dest 
+	bfextu	CMDREG1B(%a6){#6:#3},%d0	|get 1st dest
 	bfextu	CMDREG3B(%a6){#6:#3},%d1	|get 3rd dest
 	cmpb	%d0,%d1			|cmp 1st dest with 3rd dest
 	beq	op2_com			|if equal, continue bugfix
-	bfextu	CMDREG2B(%a6){#6:#3},%d1	|get 2nd dest 
+	bfextu	CMDREG2B(%a6){#6:#3},%d1	|get 2nd dest
 	cmpb	%d0,%d1			|cmp 1st dest with 2nd dest
 	bne	fix_done		|if the reg checks fail, exit
 |
 | We have the case in which a conflict exists between the cu src or
-| dest and the dest of the xu.  We must clear the instruction in 
+| dest and the dest of the xu.  We must clear the instruction in
 | the cu and restore the state, allowing the instruction in the
 | xu to complete.  Remember, the instruction in the nu
 | was exceptional, and was completed by the appropriate handler.
@@ -377,7 +377,7 @@ op2sgl:
 | exceptional, we choose to kill the process.
 |
 |	Items saved from the stack:
-|	
+|
 |		$3c stag     - L_SCR1
 |		$40 cmdreg1b - L_SCR2
 |		$44 dtag     - L_SCR3
@@ -387,9 +387,9 @@ op2sgl:
 | fpu.
 |
 op2_xu:
-	movel	STAG(%a6),L_SCR1(%a6)	
-	movel	CMDREG1B(%a6),L_SCR2(%a6)	
-	movel	DTAG(%a6),L_SCR3(%a6)	
+	movel	STAG(%a6),L_SCR1(%a6)
+	movel	CMDREG1B(%a6),L_SCR2(%a6)
+	movel	DTAG(%a6),L_SCR3(%a6)
 	andil	#0xe0000000,L_SCR3(%a6)
 	moveb	#0,CU_SAVEPC(%a6)
 	movel	ETEMP(%a6),FP_SCR2(%a6)
@@ -400,13 +400,13 @@ op2_xu:
 	fsave	-(%a7)
 |
 | Check if the instruction which just completed was exceptional.
-| 
+|
 	cmpw	#0x4060,(%a7)
 	beq	op2_xb
-| 
+|
 | It is necessary to isolate the result of the instruction in the
 | xu if it is to fp0 - fp3 and write that value to the USER_FPn
-| locations on the stack.  The correct destination register is in 
+| locations on the stack.  The correct destination register is in
 | cmdreg2b.
 |
 	bfextu	CMDREG2B(%a6){#6:#3},%d0	|get dest register no
@@ -459,12 +459,12 @@ op2_com:
 	bnes	case2
 	movew	#0x43FF,ETEMP_EX(%a6)	|to double +max
 	bra	finish
-case2:	
+case2:
 	cmpw	#0xC07F,ETEMP_EX(%a6)	|single -max
 	bnes	case3
 	movew	#0xC3FF,ETEMP_EX(%a6)	|to double -max
 	bra	finish
-case3:	
+case3:
 	cmpw	#0x3F80,ETEMP_EX(%a6)	|single +min
 	bnes	case4
 	movew	#0x3C00,ETEMP_EX(%a6)	|to double +min
@@ -480,7 +480,7 @@ case4:
 | an fline illegal instruction to be executed.
 |
 | You should replace the jump to fpsp_fmt_error with a jump
-| to the entry point used to kill a process. 
+| to the entry point used to kill a process.
 |
 op2_xb:
 	jmp	fpsp_fmt_error
diff --git a/arch/m68k/fpsp040/decbin.S b/arch/m68k/fpsp040/decbin.S
index 1862d509a..2160609e3 100644
--- a/arch/m68k/fpsp040/decbin.S
+++ b/arch/m68k/fpsp040/decbin.S
@@ -60,17 +60,17 @@
 |	it is negative.
 |
 |	Clean up and return.  Check if the final mul or div resulted
-|	in an inex2 exception.  If so, set inex1 in the fpsr and 
+|	in an inex2 exception.  If so, set inex1 in the fpsr and
 |	check if the inex1 exception is enabled.  If so, set d7 upper
 |	word to $0100.  This will signal unimp.sa that an enabled inex1
 |	exception occurred.  Unimp will fix the stack.
-|	
+|
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |DECBIN    idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -107,12 +107,12 @@ RTABLE:	.byte	0,0,0,0
 	.set	FSTRT,0
 |
 	.set	ESTRT,4
-	.set	EDIGITS,2	| 
+	.set	EDIGITS,2	|
 |
 | Constants in single precision
-FZERO: 	.long	0x00000000
-FONE: 	.long	0x3F800000
-FTEN: 	.long	0x41200000
+FZERO:	.long	0x00000000
+FONE:	.long	0x3F800000
+FTEN:	.long	0x41200000
 
 	.set	TEN,10
 
@@ -224,7 +224,7 @@ nextlw:
 	addql	#1,%d1		|inc lw pointer in mantissa
 	cmpl	#2,%d1		|test for last lw
 	ble	loadlw		|if not, get last one
-	
+
 |
 |  Check the sign of the mant and make the value in fp0 the same sign.
 |
@@ -232,7 +232,7 @@ m_sign:
 	btst	#31,(%a0)	|test sign of the mantissa
 	beq	ap_st_z		|if clear, go to append/strip zeros
 	fnegx	%fp0		|if set, negate fp0
-	
+
 |
 | Append/strip zeros:
 |
@@ -407,7 +407,7 @@ ap_n_en:
 |
 | Pwrten calculates the exponent factor in the selected rounding mode
 | according to the following table:
-|	
+|
 |	Sign of Mant  Sign of Exp  Rounding Mode  PWRTEN Rounding Mode
 |
 |	ANY	  ANY	RN	RN
@@ -495,7 +495,7 @@ mul:
 | it will be inex2, but will be reported as inex1 by get_op.
 |
 end_dec:
-	fmovel	%FPSR,%d0		|get status register	
+	fmovel	%FPSR,%d0		|get status register
 	bclrl	#inex2_bit+8,%d0	|test for inex2 and clear it
 	fmovel	%d0,%FPSR		|return status reg w/o inex2
 	beqs	no_exc		|skip this if no exc
diff --git a/arch/m68k/fpsp040/do_func.S b/arch/m68k/fpsp040/do_func.S
index 3fa7087c4..81f6a9856 100644
--- a/arch/m68k/fpsp040/do_func.S
+++ b/arch/m68k/fpsp040/do_func.S
@@ -4,11 +4,11 @@
 | Do_func performs the unimplemented operation.  The operation
 | to be performed is determined from the lower 7 bits of the
 | extension word (except in the case of fmovecr and fsincos).
-| The opcode and tag bits form an index into a jump table in 
-| tbldo.sa.  Cases of zero, infinity and NaN are handled in 
+| The opcode and tag bits form an index into a jump table in
+| tbldo.sa.  Cases of zero, infinity and NaN are handled in
 | do_func by forcing the default result.  Normalized and
 | denormalized (there are no unnormalized numbers at this
-| point) are passed onto the emulation code.  
+| point) are passed onto the emulation code.
 |
 | CMDREG1B and STAG are extracted from the fsave frame
 | and combined to form the table index.  The function called
@@ -22,8 +22,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 DO_FUNC:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -35,7 +35,7 @@ DO_FUNC:	|idnt    2,1 | Motorola 040 Floating Point Software Package
 	|xref	t_dz2
 	|xref	t_operr
 	|xref	t_inx2
-	|xref 	t_resdnrm
+	|xref	t_resdnrm
 	|xref	dst_nan
 	|xref	src_nan
 	|xref	nrm_set
@@ -68,7 +68,7 @@ do_func:
 | directly.
 |
 	bfextu	CMDREG1B(%a6){#0:#6},%d0 |get opclass and src fields
-	cmpil	#0x17,%d0		|if op class and size fields are $17, 
+	cmpil	#0x17,%d0		|if op class and size fields are $17,
 |				;it is FMOVECR; if not, continue
 	bnes	not_fmovecr
 	jmp	smovcr		|fmovecr; jmp directly to emulation
@@ -76,7 +76,7 @@ do_func:
 not_fmovecr:
 	movew	CMDREG1B(%a6),%d0
 	andl	#0x7F,%d0
-	cmpil	#0x38,%d0		|if the extension is >= $38, 
+	cmpil	#0x38,%d0		|if the extension is >= $38,
 	bge	serror		|it is illegal
 	bfextu	STAG(%a6){#0:#3},%d1
 	lsll	#3,%d0		|make room for STAG
@@ -111,7 +111,7 @@ ld_mzinx:
 	bsr	ld_mzero	|if neg, load neg zero, return here
 	bra	t_inx2		|now, set the inx for the next inst
 |
-| Load a signed zero to fp0; do not set inex2/ainex 
+| Load a signed zero to fp0; do not set inex2/ainex
 |
 	.global	szero
 szero:
@@ -119,7 +119,7 @@ szero:
 	bne	ld_mzero	|if neg, load neg zero
 	bra	ld_pzero	|load positive zero
 |
-| Load a signed infinity to fp0; do not set inex2/ainex 
+| Load a signed infinity to fp0; do not set inex2/ainex
 |
 	.global	sinf
 sinf:
@@ -127,7 +127,7 @@ sinf:
 	bne	ld_minf			|if negative branch
 	bra	ld_pinf
 |
-| Load a signed one to fp0; do not set inex2/ainex 
+| Load a signed one to fp0; do not set inex2/ainex
 |
 	.global	sone
 sone:
@@ -135,7 +135,7 @@ sone:
 	bne	ld_mone
 	bra	ld_pone
 |
-| Load a signed pi/2 to fp0; do not set inex2/ainex 
+| Load a signed pi/2 to fp0; do not set inex2/ainex
 |
 	.global	spi_2
 spi_2:
@@ -160,13 +160,13 @@ sopr_inf:
 	bne	t_operr
 	bra	ld_pinf
 |
-|	FLOGNP1 
+|	FLOGNP1
 |
 	.global	sslognp1
 sslognp1:
 	fmovemx (%a0),%fp0-%fp0
 	fcmpb	#-1,%fp0
-	fbgt	slognp1		
+	fbgt	slognp1
 	fbeq	t_dz2		|if = -1, divide by zero exception
 	fmovel	#0,%FPSR		|clr N flag
 	bra	t_operr		|take care of operands < -1
@@ -186,7 +186,7 @@ setoxm1i:
 |
 	.global	sslogn
 sslogn:
-	btstb	#sign_bit,LOCAL_EX(%a0) 
+	btstb	#sign_bit,LOCAL_EX(%a0)
 	bne	t_operr		|take care of operands < 0
 	cmpiw	#0x3fff,LOCAL_EX(%a0) |test for 1.0 input
 	bne	slogn
@@ -199,7 +199,7 @@ sslogn:
 
 	.global	sslognd
 sslognd:
-	btstb	#sign_bit,LOCAL_EX(%a0) 
+	btstb	#sign_bit,LOCAL_EX(%a0)
 	beq	slognd
 	bra	t_operr		|take care of operands < 0
 
@@ -221,7 +221,7 @@ sslog10:
 
 	.global	sslog10d
 sslog10d:
-	btstb	#sign_bit,LOCAL_EX(%a0) 
+	btstb	#sign_bit,LOCAL_EX(%a0)
 	beq	slog10d
 	bra	t_operr		|take care of operands < 0
 
@@ -243,7 +243,7 @@ sslog2:
 
 	.global	sslog2d
 sslog2d:
-	btstb	#sign_bit,LOCAL_EX(%a0) 
+	btstb	#sign_bit,LOCAL_EX(%a0)
 	beq	slog2d
 	bra	t_operr		|take care of operands < 0
 
@@ -310,7 +310,7 @@ smod_zsn:
 	btstl	#7,%d0		|test if + or -
 	beq	ld_pzero	|if pos then load +0
 	bra	ld_mzero	|else neg load -0
-	
+
 smod_fpn:
 	moveb	ETEMP(%a6),%d1	|get sign of src op
 	moveb	FPTEMP(%a6),%d0	|get sign of dst op
@@ -327,7 +327,7 @@ smod_nrm:
 	fmovel USER_FPCR(%a6),%fpcr |use user's rmode and precision
 	fmovex FPTEMP(%a6),%fp0	|return dest to fp0
 	rts
-		
+
 |
 |	FREM
 |
@@ -372,7 +372,7 @@ prem:
 	lea	premt,%a1
 	movel	(%a1,%d1.w*4),%a1
 	jmp	(%a1)
-	
+
 srem_snan:
 	bra	src_nan
 srem_dnan:
@@ -390,7 +390,7 @@ srem_zsn:
 	btstl	#7,%d0		|test if + or -
 	beq	ld_pzero	|if pos then load +0
 	bra	ld_mzero	|else neg load -0
-	
+
 srem_fpn:
 	moveb	ETEMP(%a6),%d1	|get sign of src op
 	moveb	FPTEMP(%a6),%d0	|get sign of dst op
@@ -424,10 +424,10 @@ pscalet:
 	.long	scl_inf		|  10,00  inf,norm  = +-inf
 	.long	scl_inf		|  10,01  inf,zero  = +-inf
 	.long	scl_opr		|  10,10  inf,inf   = nan with operr
- 	.long	scl_snan	|  10,11  inf,nan   = nan
- 	.long	scl_dnan	|  11,00  nan,norm  = nan
- 	.long	scl_dnan	|  11,01  nan,zero  = nan
- 	.long	scl_dnan	|  11,10  nan,inf   = nan
+	.long	scl_snan	|  10,11  inf,nan   = nan
+	.long	scl_dnan	|  11,00  nan,norm  = nan
+	.long	scl_dnan	|  11,01  nan,zero  = nan
+	.long	scl_dnan	|  11,10  nan,inf   = nan
 	.long	scl_dnan	|  11,11  nan,nan   = nan
 
 	.global	pscale
@@ -478,7 +478,7 @@ ssincosz:
 sincosp:
 	fmovex PZERO,%fp0
 sincoscom:
-  	fmovemx PONE,%fp1-%fp1	|do not allow FPSR to be affected
+	fmovemx PONE,%fp1-%fp1	|do not allow FPSR to be affected
 	bra	sto_cos		|store cosine result
 
 	.global	ssincosi
@@ -498,7 +498,7 @@ ssincosnan:
 	bsr	sto_cos
 	bra	src_nan
 |
-| This code forces default values for the zero, inf, and nan cases 
+| This code forces default values for the zero, inf, and nan cases
 | in the transcendentals code.  The CC bits must be set in the
 | stacked FPSR to be correctly reported.
 |
diff --git a/arch/m68k/fpsp040/fpsp.h b/arch/m68k/fpsp040/fpsp.h
index 9ebe3c490..984a4eb80 100644
--- a/arch/m68k/fpsp040/fpsp.h
+++ b/arch/m68k/fpsp040/fpsp.h
@@ -5,15 +5,15 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |	fpsp.h --- stack frame offsets during FPSP exception handling
 |
 |	These equates are used to access the exception frame, the fsave
 |	frame and any local variables needed by the FPSP package.
-|	
+|
 |	All FPSP handlers begin by executing:
 |
 |		link	a6,#-LOCAL_SIZE
@@ -90,13 +90,13 @@
 	.set	USER_FP2,LV+40		| saved user FP2
 	.set	USER_FP3,LV+52		| saved user FP3
 	.set	USER_FPCR,LV+64		| saved user FPCR
-	.set	FPCR_ENABLE,USER_FPCR+2	| 	FPCR exception enable 
-	.set	FPCR_MODE,USER_FPCR+3	| 	FPCR rounding mode control
+	.set	FPCR_ENABLE,USER_FPCR+2	|	FPCR exception enable
+	.set	FPCR_MODE,USER_FPCR+3	|	FPCR rounding mode control
 	.set	USER_FPSR,LV+68		| saved user FPSR
-	.set	FPSR_CC,USER_FPSR+0	| 	FPSR condition code
-	.set	FPSR_QBYTE,USER_FPSR+1	| 	FPSR quotient
-	.set	FPSR_EXCEPT,USER_FPSR+2	| 	FPSR exception
-	.set	FPSR_AEXCEPT,USER_FPSR+3	| 	FPSR accrued exception
+	.set	FPSR_CC,USER_FPSR+0	|	FPSR condition code
+	.set	FPSR_QBYTE,USER_FPSR+1	|	FPSR quotient
+	.set	FPSR_EXCEPT,USER_FPSR+2	|	FPSR exception
+	.set	FPSR_AEXCEPT,USER_FPSR+3	|	FPSR accrued exception
 	.set	USER_FPIAR,LV+72		| saved user FPIAR
 	.set	FP_SCR1,LV+76		| room for a temporary float value
 	.set	FP_SCR2,LV+92		| room for a temporary float value
@@ -143,8 +143,8 @@
 	.set	CMDREG3B,LV-48		| cmd reg for E3 exceptions (2 bytes)
 |
 	.set	NMNEXC,LV-44		| NMNEXC (unsup,snan bits only)
-	.set	nmn_unsup_bit,1	| 
-	.set	nmn_snan_bit,0	| 
+	.set	nmn_unsup_bit,1	|
+	.set	nmn_snan_bit,0	|
 |
 	.set	NMCEXC,LV-43		| NMNEXC & NMCEXC
 	.set	nmn_operr_bit,7
@@ -249,7 +249,7 @@
 	.set	inf_mask,0x02000000
 	.set	nan_mask,0x01000000
 |
-	.set	bsun_mask,0x00008000	| 
+	.set	bsun_mask,0x00008000	|
 	.set	snan_mask,0x00004000
 	.set	operr_mask,0x00002000
 	.set	ovfl_mask,0x00001000
@@ -268,7 +268,7 @@
 |
 	.set	dzinf_mask,inf_mask+dz_mask+adz_mask
 	.set	opnan_mask,nan_mask+operr_mask+aiop_mask
-	.set	nzi_mask,0x01ffffff 	|  clears N, Z, and I
+	.set	nzi_mask,0x01ffffff	|  clears N, Z, and I
 	.set	unfinx_mask,unfl_mask+inex2_mask+aunfl_mask+ainex_mask
 	.set	unf2inx_mask,unfl_mask+inex2_mask+ainex_mask
 	.set	ovfinx_mask,ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
diff --git a/arch/m68k/fpsp040/gen_except.S b/arch/m68k/fpsp040/gen_except.S
index 628637b8b..401d06f39 100644
--- a/arch/m68k/fpsp040/gen_except.S
+++ b/arch/m68k/fpsp040/gen_except.S
@@ -2,10 +2,10 @@
 |	gen_except.sa 3.7 1/16/92
 |
 |	gen_except --- FPSP routine to detect reportable exceptions
-|	
+|
 |	This routine compares the exception enable byte of the
 |	user_fpcr on the stack with the exception status byte
-|	of the user_fpsr. 
+|	of the user_fpsr.
 |
 |	Any routine which may report an exceptions must load
 |	the stack frame in memory with the exceptional operand(s).
@@ -23,14 +23,14 @@
 |
 |	Note: The IEEE standard specifies that inex2 is to be
 |	reported if ovfl occurs and the ovfl enable bit is not
-|	set but the inex2 enable bit is.  
+|	set but the inex2 enable bit is.
 |
 |
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 GEN_EXCEPT:    |idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -70,12 +70,12 @@ gen_except:
 |
 	movel	ETEMP_EX(%a6),ETEMP_EX(%a1) |copy etemp from unimp
 	movel	ETEMP_HI(%a6),ETEMP_HI(%a1) |frame to busy frame
-	movel	ETEMP_LO(%a6),ETEMP_LO(%a1) 
+	movel	ETEMP_LO(%a6),ETEMP_LO(%a1)
 	movel	CMDREG1B(%a6),CMDREG1B(%a1) |set inst in frame to unimp
 	movel	CMDREG1B(%a6),%d0		|fix cmd1b to make it
 	andl	#0x03c30000,%d0		|work for cmd3b
 	bfextu	CMDREG1B(%a6){#13:#1},%d1	|extract bit 2
-	lsll	#5,%d1			
+	lsll	#5,%d1
 	swap	%d1
 	orl	%d1,%d0			|put it in the right place
 	bfextu	CMDREG1B(%a6){#10:#3},%d1	|extract bit 3,4,5
@@ -86,7 +86,7 @@ gen_except:
 |
 | Or in the FPSR from the emulation with the USER_FPSR on the stack.
 |
-	fmovel	%FPSR,%d0		
+	fmovel	%FPSR,%d0
 	orl	%d0,USER_FPSR(%a6)
 	movel	USER_FPSR(%a6),FPSR_SHADOW(%a1) |set exc bits
 	orl	#sx_mask,E_BYTE(%a1)
@@ -108,7 +108,7 @@ test_rev:
 	cmpib	#UNIMP_41_SIZE-4,1(%a7)	|test for rev unimp frame
 	bnel	fpsp_fmt_error		|if not $28 or $30
 	leal	UNIMP_41_SIZE+LOCAL_SIZE(%a7),%a1
-	
+
 unimp_con:
 |
 | Fix up the new unimp frame with entries from the old unimp frame
@@ -117,23 +117,23 @@ unimp_con:
 |
 | Or in the FPSR from the emulation with the USER_FPSR on the stack.
 |
-	fmovel	%FPSR,%d0		
+	fmovel	%FPSR,%d0
 	orl	%d0,USER_FPSR(%a6)
 	bra	do_clean
 
 |
 | Frame is idle, so check for exceptions reported through
-| USER_FPSR and set the unimp frame accordingly.  
+| USER_FPSR and set the unimp frame accordingly.
 | A7 must be incremented to the point before the
 | idle fsave vector to the unimp vector.
 |
-	
+
 do_check:
 	addl	#4,%a7			|point A7 back to unimp frame
 |
 | Or in the FPSR from the emulation with the USER_FPSR on the stack.
 |
-	fmovel	%FPSR,%d0		
+	fmovel	%FPSR,%d0
 	orl	%d0,USER_FPSR(%a6)
 |
 | On a busy frame, we must clear the nmnexc bits.
@@ -165,10 +165,10 @@ frame_com:
 bsun_exc:
 	bra	do_clean
 |
-| The typical work to be done to the unimp frame to report an 
+| The typical work to be done to the unimp frame to report an
 | exception is to set the E1/E3 byte and clr the U flag.
-| commonE1 does this for E1 exceptions, which are snan, 
-| operr, and dz.  commonE3 does this for E3 exceptions, which 
+| commonE1 does this for E1 exceptions, which are snan,
+| operr, and dz.  commonE3 does this for E3 exceptions, which
 | are inex2 and inex1, and also clears the E1 exception bit
 | left over from the unimp exception.
 |
@@ -186,7 +186,7 @@ uniE3:
 
 unsE3:
 	tstb	RES_FLG(%a6)
-	bnes	unsE3_0	
+	bnes	unsE3_0
 unsE3_1:
 	bsetb	#E3,E_BYTE(%a6)		|set E3 flag
 unsE3_0:
@@ -194,7 +194,7 @@ unsE3_0:
 	movel	CMDREG1B(%a6),%d0
 	andl	#0x03c30000,%d0		|work for cmd3b
 	bfextu	CMDREG1B(%a6){#13:#1},%d1	|extract bit 2
-	lsll	#5,%d1			
+	lsll	#5,%d1
 	swap	%d1
 	orl	%d1,%d0			|put it in the right place
 	bfextu	CMDREG1B(%a6){#10:#3},%d1	|extract bit 3,4,5
@@ -218,8 +218,8 @@ no_match:
 	beqs	no_exc			|if clear, exit
 	bras	ovfl_unfl		|go to unfl_ovfl to determine if
 |					;it is an unsupp or unimp exc
-	
-| No exceptions are to be reported.  If the instruction was 
+
+| No exceptions are to be reported.  If the instruction was
 | unimplemented, no FPU restore is necessary.  If it was
 | unsupported, we must perform the restore.
 no_exc:
@@ -227,7 +227,7 @@ no_exc:
 	beqs	uni_no_exc
 uns_no_exc:
 	tstb	RES_FLG(%a6)	|check if frestore is needed
-	bne	do_clean 	|if clear, no frestore needed
+	bne	do_clean	|if clear, no frestore needed
 uni_no_exc:
 	moveml	USER_DA(%a6),%d0-%d1/%a0-%a1
 	fmovemx USER_FP0(%a6),%fp0-%fp3
@@ -243,13 +243,13 @@ uni_no_exc:
 |
 | Unimplemented Instruction Handler:
 | Ovfl:
-|   Only scosh, setox, ssinh, stwotox, and scale can set overflow in 
+|   Only scosh, setox, ssinh, stwotox, and scale can set overflow in
 |   this manner.
 | Unfl:
 |   Stwotox, setox, and scale can set underflow in this manner.
 |   Any of the other Library Routines such that f(x)=x in which
-|   x is an extended denorm can report an underflow exception. 
-|   It is the responsibility of the exception-causing exception 
+|   x is an extended denorm can report an underflow exception.
+|   It is the responsibility of the exception-causing exception
 |   to make sure that WBTEMP is correct.
 |
 |   The exceptional operand is in FP_SCR1.
@@ -306,7 +306,7 @@ busy_fr:
 	movel	CMDREG1B(%a6),%d0		|fix cmd1b to make it
 	andl	#0x03c30000,%d0		|work for cmd3b
 	bfextu	CMDREG1B(%a6){#13:#1},%d1	|extract bit 2
-	lsll	#5,%d1			
+	lsll	#5,%d1
 	swap	%d1
 	orl	%d1,%d0			|put it in the right place
 	bfextu	CMDREG1B(%a6){#10:#3},%d1	|extract bit 3,4,5
@@ -318,10 +318,10 @@ busy_fr:
 |
 | Check if the frame to be restored is busy or unimp.
 |** NOTE *** Bug fix for errata (0d43b #3)
-| If the frame is unimp, we must create a busy frame to 
+| If the frame is unimp, we must create a busy frame to
 | fix the bug with the nmnexc bits in cases in which they
 | are set by a previous instruction and not cleared by
-| the save. The frame will be unimp only if the final 
+| the save. The frame will be unimp only if the final
 | instruction in an emulation routine caused the exception
 | by doing an fmove <ea>,fp0.  The exception operand, in
 | internal format, is in fptemp.
@@ -353,7 +353,7 @@ loop2:
 	leal	BUSY_SIZE+LOCAL_SIZE(%a7),%a1	|init a1 for new frame
 	moveb	VER_TMP(%a6),(%a7)	|write busy fmt word
 	moveb	#BUSY_SIZE-4,1(%a7)
-	movel	FP_SCR1(%a6),WBTEMP_EX(%a1) 	|write
+	movel	FP_SCR1(%a6),WBTEMP_EX(%a1)	|write
 	movel	FP_SCR1+4(%a6),WBTEMP_HI(%a1)	|exceptional op to
 	movel	FP_SCR1+8(%a6),WBTEMP_LO(%a1)	|wbtemp
 |	btst.b	#E1,E_BYTE(%a1)
@@ -362,7 +362,7 @@ loop2:
 	bfins	%d0,NMCEXC(%a1){#4:#4}	|and insert them in nmcexc
 	movel	USER_FPSR(%a6),FPSR_SHADOW(%a1) |set exc bits
 	orl	#sx_mask,E_BYTE(%a1)
-	
+
 do_restore:
 	moveml	USER_DA(%a6),%d0-%d1/%a0-%a1
 	fmovemx USER_FP0(%a6),%fp0-%fp3
@@ -374,10 +374,10 @@ do_restore:
 cont:
 	unlk	%a6
 |
-| If trace mode enabled, then go to trace handler.  This handler 
-| cannot have any fp instructions.  If there are fp inst's and an 
-| exception has been restored into the machine then the exception 
-| will occur upon execution of the fp inst.  This is not desirable 
+| If trace mode enabled, then go to trace handler.  This handler
+| cannot have any fp instructions.  If there are fp inst's and an
+| exception has been restored into the machine then the exception
+| will occur upon execution of the fp inst.  This is not desirable
 | in the kernel (supervisor mode).  See MC68040 manual Section 9.3.8.
 |
 finish_up:
@@ -436,12 +436,12 @@ loop40:	clrl	-(%sp)
         movel  USER_D1(%a6),%d1  | restore d1
 	movel	#0x40280000,-(%sp)
 	frestore (%sp)+
-	unlk  	%a5	
+	unlk	%a5
 	rts
 
 frame_41:
 	tstb	1(%sp)		| check to see if idle
-	bne	notidle	
+	bne	notidle
 idle41:
 	clrl	(%sp)		| get rid of old fsave frame
         movel  %d1,USER_D1(%a6)  | save d1
@@ -451,18 +451,18 @@ loop41:	clrl	-(%sp)
         movel  USER_D1(%a6),%d1  | restore d1
 	movel	#0x41300000,-(%sp)
 	frestore (%sp)+
-	unlk	%a5	
+	unlk	%a5
 	rts
 
 notidle:
-	bclrb	#etemp15_bit,-40(%a5) 
+	bclrb	#etemp15_bit,-40(%a5)
 	frestore (%sp)+
-	unlk	%a5	
+	unlk	%a5
 	rts
 
 nofix:
 	frestore (%sp)+
-	unlk	%a5	
+	unlk	%a5
 	rts
 
 	|end
diff --git a/arch/m68k/fpsp040/get_op.S b/arch/m68k/fpsp040/get_op.S
index 63d238ca8..c7c2f3727 100644
--- a/arch/m68k/fpsp040/get_op.S
+++ b/arch/m68k/fpsp040/get_op.S
@@ -16,7 +16,7 @@
 |
 | - For unnormalized numbers (opclass 0, 2, or 3) the
 | number(s) is normalized and the operand type tag is updated.
-|		
+|
 | - For a packed number (opclass 2) the number is unpacked and the
 | operand type tag is updated.
 |
@@ -41,7 +41,7 @@
 | the '040.  The '040 then re-executes the fadd.x fpm,fpn with
 | a normalized number in the source and the instruction is
 | successful.
-|		
+|
 | Next consider if in the process of normalizing the un-
 | normalized number it becomes a denormalized number.  The
 | routine which converts the unnorm to a norm (called mk_norm)
@@ -54,8 +54,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 GET_OP:    |idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -194,7 +194,7 @@ uns_notpacked:
 
 uni_getop:
 	bfextu	CMDREG1B(%a6){#0:#6},%d0 |get opclass and src fields
-	cmpil	#0x17,%d0		|if op class and size fields are $17, 
+	cmpil	#0x17,%d0		|if op class and size fields are $17,
 |				;it is FMOVECR; if not, continue
 |
 | If the instruction is fmovecr, exit get_op.  It is handled
@@ -226,21 +226,21 @@ dst_ex_dnrm:
 	movew	FPTEMP_EX(%a6),%d0 |get destination exponent
 	andiw	#0x7fff,%d0	|mask sign, check if exp = 0000
 	beqs	src_op_ck	|if denorm then check source op.
-|				;denorms are taken care of in res_func 
+|				;denorms are taken care of in res_func
 |				;(unsupp) or do_func (unimp)
 |				;else unnorm fall through
 	leal	FPTEMP(%a6),%a0	|point a0 to dop - used in mk_norm
 	bsr	mk_norm		|go normalize - mk_norm returns:
-|				;L_SCR1{7:5} = operand tag 
+|				;L_SCR1{7:5} = operand tag
 |				;	(000 = norm, 100 = denorm)
-|				;L_SCR1{4} = fpte15 or ete15 
+|				;L_SCR1{4} = fpte15 or ete15
 |				;	0 = exp >  $3fff
 |				;	1 = exp <= $3fff
-|				;and puts the normalized num back 
+|				;and puts the normalized num back
 |				;on the fsave stack
 |
-	moveb L_SCR1(%a6),DTAG(%a6) |write the new tag & fpte15 
-|				;to the fsave stack and fall 
+	moveb L_SCR1(%a6),DTAG(%a6) |write the new tag & fpte15
+|				;to the fsave stack and fall
 |				;through to check source operand
 |
 src_op_ck:
@@ -255,19 +255,19 @@ src_op_ck:
 src_ex_dnrm:
 	movew	ETEMP_EX(%a6),%d0 |get source exponent
 	andiw	#0x7fff,%d0	|mask sign, check if exp = 0000
-	beq	end_getop	|if denorm then exit, denorms are 
+	beq	end_getop	|if denorm then exit, denorms are
 |				;handled in do_func
 	leal	ETEMP(%a6),%a0	|point a0 to sop - used in mk_norm
 	bsr	mk_norm		|go normalize - mk_norm returns:
-|				;L_SCR1{7:5} = operand tag 
+|				;L_SCR1{7:5} = operand tag
 |				;	(000 = norm, 100 = denorm)
-|				;L_SCR1{4} = fpte15 or ete15 
+|				;L_SCR1{4} = fpte15 or ete15
 |				;	0 = exp >  $3fff
 |				;	1 = exp <= $3fff
-|				;and puts the normalized num back 
+|				;and puts the normalized num back
 |				;on the fsave stack
 |
-	moveb	L_SCR1(%a6),STAG(%a6) |write the new tag & ete15 
+	moveb	L_SCR1(%a6),STAG(%a6) |write the new tag & ete15
 	rts			|end_getop
 
 |
@@ -285,7 +285,7 @@ is_double:
 	movew	#0x3c01,%d1	|write the bias for a dbl denorm
 common:
 	btstb	#sign_bit,ETEMP_EX(%a6) |grab sign bit of mantissa
-	beqs	pos	
+	beqs	pos
 	bset	#15,%d1		|set sign bit because it is negative
 pos:
 	movew	%d1,ETEMP_EX(%a6)
@@ -297,7 +297,7 @@ pos:
 	movew	%d1,CMDREG1B(%a6)	|write back to the command word in stack
 |				;this is needed to fix unsupp data stack
 	leal	ETEMP(%a6),%a0	|point a0 to sop
-	
+
 	bsr	mk_norm		|convert sgl/dbl denorm to norm
 	moveb	L_SCR1(%a6),STAG(%a6) |put tag into source tag reg - d0
 	rts			|end_getop
@@ -306,7 +306,7 @@ pos:
 | instruction is dyadic or monadic is still unknown
 |
 pack_source:
-	movel	FPTEMP_LO(%a6),ETEMP(%a6)	|write ms part of packed 
+	movel	FPTEMP_LO(%a6),ETEMP(%a6)	|write ms part of packed
 |				;number to etemp slot
 	bsr	chk_dy_mo	|set dyadic/monadic flag
 	bsr	unpack
@@ -325,7 +325,7 @@ pack_dya:
 	btstb	#7,DTAG(%a6)	|check dest tag for unnorm or denorm
 	bne	dst_ex_dnrm	|else, handle the unnorm or ext denorm
 |
-| Dest is not denormalized.  Check for norm, and set fpte15 
+| Dest is not denormalized.  Check for norm, and set fpte15
 | accordingly.
 |
 	moveb	DTAG(%a6),%d0
@@ -357,13 +357,13 @@ end_getop:
 | unsupported data type exception.  Set if dyadic.
 |
 chk_dy_mo:
-	movew	CMDREG1B(%a6),%d0	
+	movew	CMDREG1B(%a6),%d0
 	btstl	#5,%d0		|testing extension command word
 	beqs	set_mon		|if bit 5 = 0 then monadic
 	btstl	#4,%d0		|know that bit 5 = 1
 	beqs	set_dya		|if bit 4 = 0 then dyadic
 	andiw	#0x007f,%d0	|get rid of all but extension bits {6:0}
-	cmpiw 	#0x0038,%d0	|if extension = $38 then fcmp (dyadic)
+	cmpiw	#0x0038,%d0	|if extension = $38 then fcmp (dyadic)
 	bnes	set_mon
 set_dya:
 	st	DY_MO_FLG(%a6)	|set the inst flag type to dyadic
@@ -406,7 +406,7 @@ set_mon:
 |	L_SCR1{7:5} = operand tag (000 = norm, 100 = denorm)
 |	L_SCR1{4}   = fpte15 or ete15 (0 = exp > $3fff, 1 = exp <=$3fff)
 |	the normalized operand is placed back on the fsave stack
-mk_norm:	
+mk_norm:
 	clrl	L_SCR1(%a6)
 	bclrb	#sign_bit,LOCAL_EX(%a0)
 	sne	LOCAL_SGN(%a0)	|transform into internal extended format
@@ -426,11 +426,11 @@ reload:
 	cmpw	#0x3fff,LOCAL_EX(%a0) |if exp > $3fff
 	bgts	end_mk		|   fpte15/ete15 already set to 0
 	bsetb	#4,L_SCR1(%a6)	|else set fpte15/ete15 to 1
-|				;calling routine actually sets the 
-|				;value on the stack (along with the 
-|				;tag), since this routine doesn't 
+|				;calling routine actually sets the
+|				;value on the stack (along with the
+|				;tag), since this routine doesn't
 |				;know if it should set ete15 or fpte15
-|				;ie, it doesn't know if this is the 
+|				;ie, it doesn't know if this is the
 |				;src op or dest op.
 end_mk:
 	bfclr	LOCAL_SGN(%a0){#0:#8}
@@ -455,7 +455,7 @@ no_unfl:
 |
 uns_opx:
 	bsr	nrm_zero	|normalize the number
-	btstb	#7,LOCAL_HI(%a0)	|check if integer bit (j-bit) is set 
+	btstb	#7,LOCAL_HI(%a0)	|check if integer bit (j-bit) is set
 	beqs	uns_den		|if clear then now have a denorm
 uns_nrm:
 	orb	#norm_tag,L_SCR1(%a6) |set tag to norm
@@ -468,7 +468,7 @@ uns_den:
 |
 uni_inst:
 	bsr	nrm_zero
-	btstb	#7,LOCAL_HI(%a0)	|check if integer bit (j-bit) is set 
+	btstb	#7,LOCAL_HI(%a0)	|check if integer bit (j-bit) is set
 	beqs	uni_den		|if clear then now have a denorm
 uni_nrm:
 	orb	#norm_tag,L_SCR1(%a6) |set tag to norm
@@ -480,9 +480,9 @@ uni_den:
 |
 |	Decimal to binary conversion
 |
-| Special cases of inf and NaNs are completed outside of decbin.  
+| Special cases of inf and NaNs are completed outside of decbin.
 | If the input is an snan, the snan bit is not set.
-| 
+|
 | input:
 |	ETEMP(a6)	- points to packed decimal string in memory
 | output:
@@ -610,16 +610,16 @@ mnot_spec:
 
 finish:
 	movew	CMDREG1B(%a6),%d0	|get the command word
-	andw	#0xfbff,%d0	|change the source specifier field to 
+	andw	#0xfbff,%d0	|change the source specifier field to
 |				;extended (was packed).
 	movew	%d0,CMDREG1B(%a6)	|write command word back to fsave stack
-|				;we need to do this so the 040 will 
-|				;re-execute the inst. without taking 
+|				;we need to do this so the 040 will
+|				;re-execute the inst. without taking
 |				;another packed trap.
 
 fix_stag:
-|Converted result is now in etemp on fsave stack, now set the source 
-|tag (stag) 
+|Converted result is now in etemp on fsave stack, now set the source
+|tag (stag)
 |	if (ete =$7fff) then INF or NAN
 |		if (etemp = $x.0----0) then
 |			stag = INF
@@ -632,12 +632,12 @@ fix_stag:
 |			stag = NORM
 |
 | Note also that the etemp_15 bit (just right of the stag) must
-| be set accordingly.  
+| be set accordingly.
 |
 	movew		ETEMP_EX(%a6),%d1
 	andiw		#0x7fff,%d1   |strip sign
-	cmpw  		#0x7fff,%d1
-	bnes  		z_or_nrm
+	cmpw		#0x7fff,%d1
+	bnes		z_or_nrm
 	movel		ETEMP_HI(%a6),%d1
 	bnes		is_nan
 	movel		ETEMP_LO(%a6),%d1
@@ -651,7 +651,7 @@ is_nan:
 	movel		#0x60,%d0
 	rts
 z_or_nrm:
-	tstw		%d1  
+	tstw		%d1
 	bnes		is_nrm
 is_zro:
 | For a zero, set etemp_15
@@ -670,7 +670,7 @@ end_is_nrm:
 	movel		#0,%d0
 end_fix:
 	rts
- 
+
 end_get:
 	rts
 	|end
diff --git a/arch/m68k/fpsp040/kernel_ex.S b/arch/m68k/fpsp040/kernel_ex.S
index 2cc097676..476b71196 100644
--- a/arch/m68k/fpsp040/kernel_ex.S
+++ b/arch/m68k/fpsp040/kernel_ex.S
@@ -1,19 +1,19 @@
 |
-|	kernel_ex.sa 3.3 12/19/90 
+|	kernel_ex.sa 3.3 12/19/90
 |
-| This file contains routines to force exception status in the 
+| This file contains routines to force exception status in the
 | fpu for exceptional cases detected or reported within the
 | transcendental functions.  Typically, the t_xx routine will
 | set the appropriate bits in the USER_FPSR word on the stack.
 | The bits are tested in gen_except.sa to determine if an exceptional
-| situation needs to be created on return from the FPSP. 
+| situation needs to be created on return from the FPSP.
 |
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 KERNEL_EX:    |idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -31,7 +31,7 @@ huge:     .long 0x7ffe0000,0xffffffff,0xffffffff
 	|xref	  unf_sub
 	|xref	  nrm_set
 
-	.global   	  t_dz
+	.global	  t_dz
 	.global      t_dz2
 	.global      t_operr
 	.global      t_unfl
@@ -49,7 +49,7 @@ huge:     .long 0x7ffe0000,0xffffffff,0xffffffff
 |
 |	if dz trap disabled
 |		store properly signed inf (use sign of etemp) into fp0
-|		set FPSR exception status dz bit, condition code 
+|		set FPSR exception status dz bit, condition code
 |		inf bit, and accrued dz bit
 |		return
 |		frestore the frame into the machine (done by unimp_hd)
@@ -61,7 +61,7 @@ huge:     .long 0x7ffe0000,0xffffffff,0xffffffff
 |		frestore the frame into the machine (done by unimp_hd)
 |
 | t_dz2 is used by monadic functions such as flogn (from do_func).
-| t_dz is used by monadic functions such as satanh (from the 
+| t_dz is used by monadic functions such as satanh (from the
 | transcendental function).
 |
 t_dz2:
@@ -104,10 +104,10 @@ dz_ena_end:
 |	OPERR exception
 |
 |	if (operr trap disabled)
-|		set FPSR exception status operr bit, condition code 
+|		set FPSR exception status operr bit, condition code
 |		nan bit; Store default NAN into fp0
 |		frestore the frame into the machine (done by unimp_hd)
-|	
+|
 |	else (operr trap enabled)
 |		set FPSR exception status operr bit, accrued operr bit
 |		set flag to disable sto_res from corrupting fp register
@@ -159,13 +159,13 @@ unfl_ena:
 
 unfl_dis:
 	bfextu	FPCR_MODE(%a6){#0:#2},%d0	|get round precision
-	
+
 	bclrb	#sign_bit,LOCAL_EX(%a0)
 	sne	LOCAL_SGN(%a0)		|convert to internal ext format
 
 	bsr	unf_sub			|returns IEEE result at a0
 |					;and sets FPSR_CC accordingly
-	
+
 	bfclr	LOCAL_SGN(%a0){#0:#8}	|convert back to IEEE ext format
 	beqs	unfl_fin
 
@@ -175,7 +175,7 @@ unfl_dis:
 unfl_fin:
 	fmovemx (%a0),%fp0-%fp0		|store result in fp0
 	rts
-	
+
 
 |
 |	t_ovfl2 --- OVFL exception (without inex2 returned)
@@ -280,7 +280,7 @@ no_uacc1:
 |	DST_NAN
 |
 | Determine if the destination nan is signalling or non-signalling,
-| and set the FPSR bits accordingly.  See the MC68040 User's Manual 
+| and set the FPSR bits accordingly.  See the MC68040 User's Manual
 | section 3.2.2.5 NOT-A-NUMBERS.
 |
 dst_nan:
@@ -288,7 +288,7 @@ dst_nan:
 	beqs	dst_pos			|if clr, it was positive
 	bsetb	#neg_bit,FPSR_CC(%a6)	|set N bit
 dst_pos:
-	btstb	#signan_bit,FPTEMP_HI(%a6) |check if signalling 
+	btstb	#signan_bit,FPTEMP_HI(%a6) |check if signalling
 	beqs	dst_snan		|branch if signalling
 
 	fmovel	%d1,%fpcr			|restore user's rmode/prec
@@ -300,14 +300,14 @@ dst_pos:
 	andib	#0xe0,%d0
 	cmpib	#0x60,%d0
 	bnes	no_snan
-	btstb	#signan_bit,ETEMP_HI(%a6) |check if signalling 
+	btstb	#signan_bit,ETEMP_HI(%a6) |check if signalling
 	bnes	no_snan
 	orl	#snaniop_mask,USER_FPSR(%a6) |set NAN, SNAN, AIOP
 no_snan:
-	rts	
+	rts
 
 dst_snan:
-	btstb	#snan_bit,FPCR_ENABLE(%a6) |check if trap enabled 
+	btstb	#snan_bit,FPCR_ENABLE(%a6) |check if trap enabled
 	beqs	dst_dis			|branch if disabled
 
 	orb	#nan_tag,DTAG(%a6)	|set up dtag for nan
@@ -316,9 +316,9 @@ dst_snan:
 	rts
 
 dst_dis:
-	bsetb	#signan_bit,FPTEMP_HI(%a6) |set SNAN bit in sop 
+	bsetb	#signan_bit,FPTEMP_HI(%a6) |set SNAN bit in sop
 	fmovel	%d1,%fpcr			|restore user's rmode/prec
-	fmovex FPTEMP(%a6),%fp0		|load non-sign. nan 
+	fmovex FPTEMP(%a6),%fp0		|load non-sign. nan
 	orl	#snaniop_mask,USER_FPSR(%a6) |set NAN, SNAN, AIOP
 	rts
 
@@ -326,7 +326,7 @@ dst_dis:
 |	SRC_NAN
 |
 | Determine if the source nan is signalling or non-signalling,
-| and set the FPSR bits accordingly.  See the MC68040 User's Manual 
+| and set the FPSR bits accordingly.  See the MC68040 User's Manual
 | section 3.2.2.5 NOT-A-NUMBERS.
 |
 src_nan:
@@ -334,16 +334,16 @@ src_nan:
 	beqs	src_pos			|if clr, it was positive
 	bsetb	#neg_bit,FPSR_CC(%a6)	|set N bit
 src_pos:
-	btstb	#signan_bit,ETEMP_HI(%a6) |check if signalling 
+	btstb	#signan_bit,ETEMP_HI(%a6) |check if signalling
 	beqs	src_snan		|branch if signalling
 	fmovel	%d1,%fpcr			|restore user's rmode/prec
 	fmovex ETEMP(%a6),%fp0		|return the non-signalling nan
-	rts	
+	rts
 
 src_snan:
-	btstb	#snan_bit,FPCR_ENABLE(%a6) |check if trap enabled 
+	btstb	#snan_bit,FPCR_ENABLE(%a6) |check if trap enabled
 	beqs	src_dis			|branch if disabled
-	bsetb	#signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop 
+	bsetb	#signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop
 	orb	#norm_tag,DTAG(%a6)	|set up dtag for norm
 	orb	#nan_tag,STAG(%a6)	|set up stag for nan
 	st	STORE_FLG(%a6)		|do not store a result
@@ -351,9 +351,9 @@ src_snan:
 	rts
 
 src_dis:
-	bsetb	#signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop 
+	bsetb	#signan_bit,ETEMP_HI(%a6) |set SNAN bit in sop
 	fmovel	%d1,%fpcr			|restore user's rmode/prec
-	fmovex ETEMP(%a6),%fp0		|load non-sign. nan 
+	fmovex ETEMP(%a6),%fp0		|load non-sign. nan
 	orl	#snaniop_mask,USER_FPSR(%a6) |set NAN, SNAN, AIOP
 	rts
 
@@ -367,7 +367,7 @@ t_extdnrm:
 	bras	xdnrm_con
 |
 | Entry point for scale with extended denorm.  The function does
-| not set inex2, aunfl, or ainex.  
+| not set inex2, aunfl, or ainex.
 |
 t_resdnrm:
 	orl	#unfl_mask,USER_FPSR(%a6)
@@ -402,7 +402,7 @@ xdnrm_dn:
 	bfclr	LOCAL_SGN(%a0){#0:#8}	|change back to IEEE ext format
 	beqs	xdep
 	bsetb	#sign_bit,LOCAL_EX(%a0)
-xdep:	
+xdep:
 	bfclr	STAG(%a6){#5:#3}		|clear wbtm66,wbtm1,wbtm0
 	bsetb	#wbtemp15_bit,WB_BYTE(%a6) |set wbtemp15
 	bclrb	#sticky_bit,STICKY(%a6)	|clear sticky bit
@@ -439,7 +439,7 @@ xdnrm_store:
 |
 	.global	t_avoid_unsupp
 t_avoid_unsupp:
-	link	%a2,#-LOCAL_SIZE		|so that a2 fpsp.h negative 
+	link	%a2,#-LOCAL_SIZE		|so that a2 fpsp.h negative
 |					;offsets may be used
 	fsave	-(%a7)
 	tstb	1(%a7)			|check if idle, exit if so
diff --git a/arch/m68k/fpsp040/res_func.S b/arch/m68k/fpsp040/res_func.S
index 95bac414f..8f6b95217 100644
--- a/arch/m68k/fpsp040/res_func.S
+++ b/arch/m68k/fpsp040/res_func.S
@@ -8,7 +8,7 @@
 | (Exception vector 55).
 |
 | For packed move out (fmove.p fpm,<ea>) the operation is
-| completed here; data is packed and moved to user memory. 
+| completed here; data is packed and moved to user memory.
 | The stack is restored to the 040 only in the case of a
 | reportable exception in the conversion.
 |
@@ -16,8 +16,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 RES_FUNC:    |idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -48,7 +48,7 @@ dp_bnds:	.short	0x3c01,0x43fe
 	|xref	t_unfl
 
 	.global	res_func
-	.global 	p_move
+	.global	p_move
 
 res_func:
 	clrb	DNRM_FLG(%a6)
@@ -100,7 +100,7 @@ monadic:
 	movew	CMDREG1B(%a6),%d0	|get command register
 	andil	#0x7f,%d0			|strip to only command word
 |
-| At this point, fabs, fneg, fsmove, fdmove, ftst, fsqrt, fssqrt, and 
+| At this point, fabs, fneg, fsmove, fdmove, ftst, fsqrt, fssqrt, and
 | fdsqrt are possible.
 | For cases fabs, fneg, fsmove, and fdmove goto spos (do not normalize)
 | For cases fsqrt, fssqrt, and fdsqrt goto nrm_src (do normalize)
@@ -143,7 +143,7 @@ cu_ntpo:
 	rts
 cu_ntn:
 	orl	#nan_mask,USER_FPSR(%a6)
-	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for 
+	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for
 |						;snan handler
 
 	rts
@@ -206,7 +206,7 @@ cu_nmnr:
 cu_nmrd:
 	movel	#2,%d0			|set up the size for denorm
 	movew	LOCAL_EX(%a0),%d1		|compare exponent to double threshold
-	andw	#0x7fff,%d1	
+	andw	#0x7fff,%d1
 	cmpw	#0x3c01,%d1
 	bls	cu_nunfl
 	bfextu	FPCR_MODE(%a6){#2:#2},%d1	|get rmode
@@ -359,7 +359,7 @@ cu_wreon:
 |				;write the new tag & ete15 to the fstack
 mon_dnrm:
 |
-| At this point, check for the cases in which normalizing the 
+| At this point, check for the cases in which normalizing the
 | denorm produces incorrect results.
 |
 	tstb	DY_MO_FLG(%a6)	|all cases of dyadic instructions would
@@ -374,7 +374,7 @@ mon_dnrm:
 	movew	CMDREG1B(%a6),%d0	|get command register
 	andil	#0x7f,%d0			|strip to only command word
 |
-| At this point, fabs, fneg, fsmove, fdmove, ftst, fsqrt, fssqrt, and 
+| At this point, fabs, fneg, fsmove, fdmove, ftst, fsqrt, fssqrt, and
 | fdsqrt are possible.
 | For cases fabs, fneg, fsmove, and fdmove goto spos (do not normalize)
 | For cases fsqrt, fssqrt, and fdsqrt goto nrm_src (do normalize)
@@ -382,12 +382,12 @@ mon_dnrm:
 	btstl	#0,%d0
 	bnes	nrm_src		|weed out fsqrt instructions
 	st	CU_ONLY(%a6)	|set cu-only inst flag
-	bra	cu_dnrm		|fmove, fabs, fneg, ftst 
+	bra	cu_dnrm		|fmove, fabs, fneg, ftst
 |				;cases go to cu_dnrm
 nrm_src:
 	bclrb	#sign_bit,LOCAL_EX(%a0)
 	sne	LOCAL_SGN(%a0)
-	bsr	nrm_set		|normalize number (exponent will go 
+	bsr	nrm_set		|normalize number (exponent will go
 |				; negative)
 	bclrb	#sign_bit,LOCAL_EX(%a0) |get rid of false sign
 
@@ -413,7 +413,7 @@ fix_stk:
 
 |
 | cu_dnrm handles all cu-only instructions (fmove, fabs, fneg, and
-| ftst) completely in software without an frestore to the 040. 
+| ftst) completely in software without an frestore to the 040.
 |
 cu_dnrm:
 	st	CU_ONLY(%a6)
@@ -446,7 +446,7 @@ cu_dtpo:
 	rts
 cu_dtn:
 	orl	#nan_mask,USER_FPSR(%a6)
-	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for 
+	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for
 |						;snan handler
 	rts
 cu_dtcz:
@@ -525,7 +525,7 @@ cu_dmsn:
 	bra	cu_sndr			|load single neg zero w/lsb
 |
 | The precision is extended, so the result in etemp is correct.
-| Simply set unfl (not inex2 or aunfl) and write the result to 
+| Simply set unfl (not inex2 or aunfl) and write the result to
 | the correct fp register.
 cu_wrexd:
 	orl	#unfl_mask,USER_FPSR(%a6)
@@ -597,7 +597,7 @@ cu_sndr:
 	orl	#neg_mask,USER_FPSR(%a6)
 	orl	#unfinx_mask,USER_FPSR(%a6)
 	bra	wr_etemp
-	
+
 |
 | This code checks for 16-bit overflow conditions on dyadic
 | operations which are not restorable into the floating-point
@@ -613,7 +613,7 @@ cu_sndr:
 |	                  $ff for both ops denormalized
 |
 | The wrap-around condition occurs for add, sub, div, and cmp
-| when 
+| when
 |
 |	abs(dest_exp - src_exp) >= $8000
 |
@@ -627,7 +627,7 @@ cu_sndr:
 | for this condition.  The restore flag (RES_FLG) is left clear.
 | No frestore is done unless an exception is to be reported.
 |
-| For fadd: 
+| For fadd:
 |	if(sign_of(dest) != sign_of(src))
 |		replace exponent of src with $3fff (keep sign)
 |		use fpu to perform dest+new_src (user's rmode and X)
@@ -689,10 +689,10 @@ ck_wrap:
 	cmpiw	#cmpcode,%d0
 	beq	wrap_cmp
 |
-| Inst is fdiv.  
+| Inst is fdiv.
 |
 wrap_div:
-	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm, 
+	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm,
 	beq	fix_stk		 |restore to fpu
 |
 | One of the ops is denormalized.  Test for wrap condition
@@ -722,7 +722,7 @@ ckinf_ns:
 	bra	ck_in_com
 ckinf_nd:
 	moveb	DTAG(%a6),%d0		|check destination tag for inf or nan
-ck_in_com:	
+ck_in_com:
 	andib	#0x60,%d0			|isolate tag bits
 	cmpb	#0x40,%d0			|is it inf?
 	beq	nan_or_inf		|not wrap case
@@ -755,7 +755,7 @@ div_srcd:
 	beqs	force_ovf
 	st	WBTEMP_SGN(%a6)
 |
-| This code handles the case of the instruction resulting in 
+| This code handles the case of the instruction resulting in
 | an overflow condition.
 |
 force_ovf:
@@ -777,7 +777,7 @@ frcovf_fpcr:
 	bfextu	FPCR_MODE(%a6){#0:#2},%d0	|inst not forced - use fpcr prec
 frcovf_rnd:
 
-| The 881/882 does not set inex2 for the following case, so the 
+| The 881/882 does not set inex2 for the following case, so the
 | line is commented out to be compatible with 881/882
 |	tst.b	%d0
 |	beq.b	frcovf_x
@@ -785,7 +785,7 @@ frcovf_rnd:
 
 |frcovf_x:
 	bsrl	ovf_res			|get correct result based on
-|					;round precision/mode.  This 
+|					;round precision/mode.  This
 |					;sets FPSR_CC correctly
 |					;returns in external format
 	bfclr	WBTEMP_SGN(%a6){#0:#8}
@@ -796,7 +796,7 @@ frcovf_rnd:
 | Inst is fadd.
 |
 wrap_add:
-	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm, 
+	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm,
 	beq	fix_stk		 |restore to fpu
 |
 | One of the ops is denormalized.  Test for wrap condition
@@ -964,14 +964,14 @@ add_ckovf:
 | and aovfl, and clr the mantissa (incorrectly set by the
 | round routine.)
 |
-	orl	#inf_mask+ovfl_inx_mask,USER_FPSR(%a6)	
+	orl	#inf_mask+ovfl_inx_mask,USER_FPSR(%a6)
 	clrl	4(%a0)
 	bra	frcfpnr
 |
 | Inst is fsub.
 |
 wrap_sub:
-	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm, 
+	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm,
 	beq	fix_stk		 |restore to fpu
 |
 | One of the ops is denormalized.  Test for wrap condition
@@ -1145,14 +1145,14 @@ sub_ckovf:
 | and aovfl, and clr the mantissa (incorrectly set by the
 | round routine.)
 |
-	orl	#inf_mask+ovfl_inx_mask,USER_FPSR(%a6)	
+	orl	#inf_mask+ovfl_inx_mask,USER_FPSR(%a6)
 	clrl	4(%a0)
 	bra	frcfpnr
 |
 | Inst is fcmp.
 |
 wrap_cmp:
-	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm, 
+	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm,
 	beq	fix_stk		 |restore to fpu
 |
 | One of the ops is denormalized.  Test for wrap condition
@@ -1190,7 +1190,7 @@ cmp_setn:
 | Inst is fmul.
 |
 wrap_mul:
-	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm, 
+	cmpb	#0xff,DNRM_FLG(%a6) |if both ops denorm,
 	beq	force_unf	|force an underflow (really!)
 |
 | One of the ops is denormalized.  Test for wrap condition
@@ -1213,9 +1213,9 @@ mul_srcd:
 	bfexts	ETEMP_EX(%a6){#1:#15},%d1	|get src exp (always neg)
 	addl	%d1,%d0			|subtract src from dest
 	bgt	fix_stk
-	
+
 |
-| This code handles the case of the instruction resulting in 
+| This code handles the case of the instruction resulting in
 | an underflow condition.
 |
 force_unf:
@@ -1245,7 +1245,7 @@ frcunf_fpcr:
 	bfextu	FPCR_MODE(%a6){#0:#2},%d0	|inst not forced - use fpcr prec
 frcunf_rnd:
 	bsrl	unf_sub			|get correct result based on
-|					;round precision/mode.  This 
+|					;round precision/mode.  This
 |					;sets FPSR_CC correctly
 	bfclr	WBTEMP_SGN(%a6){#0:#8}	|convert back to IEEE ext format
 	beqs	frcfpn
@@ -1277,14 +1277,14 @@ frcfpn_rnd:
 	bclrb	#sign_bit,WBTEMP_EX(%a6)
 	sne	WBTEMP_SGN(%a6)
 	bsrl	ovf_res			|get correct result based on
-|					;round precision/mode.  This 
+|					;round precision/mode.  This
 |					;sets FPSR_CC correctly
 	bfclr	WBTEMP_SGN(%a6){#0:#8}	|convert back to IEEE ext format
 	beqs	frcfpn_clr
 	bsetb	#sign_bit,WBTEMP_EX(%a6)
 frcfpn_clr:
 	orl	#ovfinx_mask,USER_FPSR(%a6)
-| 
+|
 | Perform the write.
 |
 frcfpn:
@@ -1301,9 +1301,9 @@ frc0123:
 	cmpib	#0,%d0
 	beqs	frc0_dst
 	cmpib	#1,%d0
-	beqs	frc1_dst 
+	beqs	frc1_dst
 	cmpib	#2,%d0
-	beqs	frc2_dst 
+	beqs	frc2_dst
 frc3_dst:
 	movel	WBTEMP_EX(%a6),USER_FP3(%a6)
 	movel	WBTEMP_HI(%a6),USER_FP3+4(%a6)
@@ -1337,7 +1337,7 @@ wr_etemp:
 	beqs	fmoveinc		|enabled, force restore
 	btstb	#snan_bit,FPCR_ENABLE(%a6) |and don't overwrite
 	beqs	fmoveinc		|the dest
-	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for 
+	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for
 |						;snan handler
 	tstb	ETEMP(%a6)		|check for negative
 	blts	snan_neg
@@ -1361,7 +1361,7 @@ fminc_cnan:
 	cmpib	#0x60,%d0			|check if stag is NaN
 	bnes	fminc_czero
 	orl	#nan_mask,USER_FPSR(%a6) |if nan, nothing yet has set NaN
-	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for 
+	movel	ETEMP_EX(%a6),FPTEMP_EX(%a6)	|set up fptemp sign for
 |						;snan handler
 	tstw	LOCAL_EX(%a0)		|check sign
 	bges	fminc_con
@@ -1389,9 +1389,9 @@ fp0123:
 	cmpib	#0,%d0
 	beqs	fp0_dst
 	cmpib	#1,%d0
-	beqs	fp1_dst 
+	beqs	fp1_dst
 	cmpib	#2,%d0
-	beqs	fp2_dst 
+	beqs	fp2_dst
 fp3_dst:
 	movel	ETEMP_EX(%a6),USER_FP3(%a6)
 	movel	ETEMP_HI(%a6),USER_FP3+4(%a6)
@@ -1421,20 +1421,20 @@ opclass3:
 	beq	pack_out	|else it is norm or denorm
 	bra	mv_out
 
-	
+
 |
 |	MOVE OUT
 |
 
 mv_tbl:
 	.long	li
-	.long 	sgp
-	.long 	xp
-	.long 	mvout_end	|should never be taken
-	.long 	wi
-	.long 	dp
-	.long 	bi
-	.long 	mvout_end	|should never be taken
+	.long	sgp
+	.long	xp
+	.long	mvout_end	|should never be taken
+	.long	wi
+	.long	dp
+	.long	bi
+	.long	mvout_end	|should never be taken
 mv_out:
 	bfextu	CMDREG1B(%a6){#3:#3},%d1	|put source specifier in d1
 	leal	mv_tbl,%a0
@@ -1442,7 +1442,7 @@ mv_out:
 	jmp	(%a0)
 
 |
-| This exit is for move-out to memory.  The aunfl bit is 
+| This exit is for move-out to memory.  The aunfl bit is
 | set if the result is inex and unfl is signalled.
 |
 mvout_end:
@@ -1466,7 +1466,7 @@ no_aufl:
 mvout_con:
 	rts
 |
-| This exit is for move-out to int register.  The aunfl bit is 
+| This exit is for move-out to int register.  The aunfl bit is
 | not set in any case for this move.
 |
 mvouti_end:
@@ -1496,7 +1496,7 @@ li:
 	fmovemx ETEMP(%a6),%fp0-%fp0
 	fcmpd	#0x41dfffffffc00000,%fp0
 | 41dfffffffc00000 in dbl prec = 401d0000fffffffe00000000 in ext prec
-	fbge	lo_plrg	
+	fbge	lo_plrg
 	fcmpd	#0xc1e0000000000000,%fp0
 | c1e0000000000000 in dbl prec = c01e00008000000000000000 in ext prec
 	fble	lo_nlrg
@@ -1541,7 +1541,7 @@ wi:
 	fmovemx ETEMP(%a6),%fp0-%fp0
 	fcmps	#0x46fffe00,%fp0
 | 46fffe00 in sgl prec = 400d0000fffe000000000000 in ext prec
-	fbge	wo_plrg	
+	fbge	wo_plrg
 	fcmps	#0xc7000000,%fp0
 | c7000000 in sgl prec = c00e00008000000000000000 in ext prec
 	fble	wo_nlrg
@@ -1586,7 +1586,7 @@ bi:
 	fmovemx ETEMP(%a6),%fp0-%fp0
 	fcmps	#0x42fe0000,%fp0
 | 42fe0000 in sgl prec = 40050000fe00000000000000 in ext prec
-	fbge	by_plrg	
+	fbge	by_plrg
 	fcmps	#0xc3000000,%fp0
 | c3000000 in sgl prec = c00600008000000000000000 in ext prec
 	fble	by_nlrg
@@ -1629,7 +1629,7 @@ by_nlrg:
 int_dnrm:
 	movel	#0,L_SCR1(%a6)	| initialize result to 0
 	bfextu	FPCR_MODE(%a6){#2:#2},%d1	| d1 is the rounding mode
-	cmpb	#2,%d1		
+	cmpb	#2,%d1
 	bmis	int_inx		| if RN or RZ, done
 	bnes	int_rp		| if RP, continue below
 	tstw	ETEMP(%a6)	| RM: store -1 in L_SCR1 if src is negative
@@ -1642,7 +1642,7 @@ int_rp:
 	bmis	int_inx		| otherwise, result is 0
 	lea	L_SCR1(%a6),%a1	| a1 is address of L_SCR1
 	addal	%d0,%a1		| offset by destination width -1
-	subal	#1,%a1		
+	subal	#1,%a1
 	bsetb	#0,(%a1)		| set low bit at a1 address
 int_inx:
 	oril	#inx2a_mask,USER_FPSR(%a6)
@@ -1656,10 +1656,10 @@ int_operr:
 
 	oril	#opaop_mask,USER_FPSR(%a6)
 |				;fall through to perform int_wrt
-int_wrt: 
+int_wrt:
 	movel	EXC_EA(%a6),%a1	|load destination address
 	tstl	%a1		|check to see if it is a dest register
-	beqs	wrt_dn		|write data register 
+	beqs	wrt_dn		|write data register
 	lea	L_SCR1(%a6),%a0	|point to supervisor source address
 	bsrl	mem_write
 	bra	mvouti_end
@@ -1680,7 +1680,7 @@ sz_long:
 sz_con:
 	movel	%d0,%d1		|reg_dest expects size:reg in d1
 	bsrl	reg_dest	|load proper data register
-	bra	mvouti_end 
+	bra	mvouti_end
 xp:
 	lea	ETEMP(%a6),%a0
 	bclrb	#sign_bit,LOCAL_EX(%a0)
@@ -1718,7 +1718,7 @@ dp:
 	blt	dp_under
 	cmpw	2(%a1),%d0
 	bgt	dp_over
-	
+
 	movel	#2,%d0		|set destination format to double
 |				;fall through to do_fp
 |
@@ -1726,10 +1726,10 @@ do_fp:
 	bfextu	FPCR_MODE(%a6){#2:#2},%d1	|rnd mode in d1
 	swap	%d0			|rnd prec in upper word
 	addl	%d0,%d1			|d1 has PREC/MODE info
-	
-	clrl	%d0			|clear g,r,s 
 
-	bsrl	round			|round 
+	clrl	%d0			|clear g,r,s
+
+	bsrl	round			|round
 
 	movel	%a0,%a1
 	movel	EXC_EA(%a6),%a0
@@ -1764,12 +1764,12 @@ xdnrm:
 	bsrl	dest_ext	|store to memory
 	bsetb	#unfl_bit,FPSR_EXCEPT(%a6)
 	bra	mvout_end
-	
+
 sp_under:
 	bsetb	#etemp15_bit,STAG(%a6)
 
 	cmpw	4(%a1),%d0
-	blts	sp_catas	|catastrophic underflow case	
+	blts	sp_catas	|catastrophic underflow case
 
 	movel	#1,%d0		|load in round precision
 	movel	#sgl_thresh,%d1	|load in single denorm threshold
@@ -1784,9 +1784,9 @@ dp_under:
 
 	cmpw	4(%a1),%d0
 	blts	dp_catas	|catastrophic underflow case
-		
+
 	movel	#dbl_thresh,%d1	|load in double precision threshold
-	movel	#2,%d0		
+	movel	#2,%d0
 	bsrl	dpspdnrm	|expects d1 to have proper
 |				;denorm threshold
 |				;expects d0 to have round precision
@@ -1813,11 +1813,11 @@ sp_catas:
 
 	movel	%a0,%a1		|a1 has the operand input
 	movel	EXC_EA(%a6),%a0	|a0 has the destination pointer
-	
+
 	bsrl	dest_sgl	|store the result
 	oril	#unfinx_mask,USER_FPSR(%a6)
 	bra	mvout_end
-	
+
 dp_catas:
 | Temp fix for z bit set in unf_sub
 	movel	USER_FPSR(%a6),-(%a7)
@@ -1828,12 +1828,12 @@ dp_catas:
 	movel	(%a7)+,USER_FPSR(%a6)
 
 	movel	#1,%d0
-	subw	%d0,LOCAL_EX(%a0) |account for difference between 
+	subw	%d0,LOCAL_EX(%a0) |account for difference between
 |				;denorm/norm bias
 
 	movel	%a0,%a1		|a1 has the operand input
 	movel	EXC_EA(%a6),%a0	|a0 has the destination pointer
-	
+
 	bsrl	dest_dbl	|store the result
 	oril	#unfinx_mask,USER_FPSR(%a6)
 	bra	mvout_end
@@ -1880,7 +1880,7 @@ dp_over:
 	bra	mvout_end
 
 |
-| 	DPSPDNRM
+|	DPSPDNRM
 |
 | This subroutine takes an extended normalized number and denormalizes
 | it to the given round precision. This subroutine also decrements
@@ -1894,7 +1894,7 @@ dp_over:
 |
 | Output: (In the format for dest_sgl or dest_dbl)
 |	 a0   points to the destination
-|   	 a1   points to the operand
+|	 a1   points to the operand
 |
 | Exceptions: Reports inexact 2 exception by setting USER_FPSR bits
 |
@@ -1905,7 +1905,7 @@ dpspdnrm:
 
 	bfextu	FPCR_MODE(%a6){#2:#2},%d1 |get rounding mode
 	swap	%d1
-	movew	2(%a7),%d1	|set rounding precision 
+	movew	2(%a7),%d1	|set rounding precision
 	swap	%d1		|at this point d1 has PREC/MODE info
 	bsrl	round		|round result, sets the inex bit in
 |				;USER_FPSR if needed
@@ -1952,20 +1952,20 @@ p_regd:
 	.long	p_dyd7
 
 pack_out:
- 	leal	p_movet,%a0	|load jmp table address
+	leal	p_movet,%a0	|load jmp table address
 	movew	STAG(%a6),%d0	|get source tag
 	bfextu	%d0{#16:#3},%d0	|isolate source bits
 	movel	(%a0,%d0.w*4),%a0	|load a0 with routine label for tag
 	jmp	(%a0)		|go to the routine
 
 p_write:
-	movel	#0x0c,%d0 	|get byte count
+	movel	#0x0c,%d0	|get byte count
 	movel	EXC_EA(%a6),%a1	|get the destination address
-	bsr 	mem_write	|write the user's destination
+	bsr	mem_write	|write the user's destination
 	moveb	#0,CU_SAVEPC(%a6) |set the cu save pc to all 0's
 
 |
-| Also note that the dtag must be set to norm here - this is because 
+| Also note that the dtag must be set to norm here - this is because
 | the 040 uses the dtag to execute the correct microcode.
 |
         bfclr    DTAG(%a6){#0:#3}  |set dtag to norm
diff --git a/arch/m68k/fpsp040/round.S b/arch/m68k/fpsp040/round.S
index abcbf8696..00f980687 100644
--- a/arch/m68k/fpsp040/round.S
+++ b/arch/m68k/fpsp040/round.S
@@ -8,8 +8,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |ROUND	idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -21,7 +21,7 @@
 |
 |	round --- round result according to precision/mode
 |
-|	a0 points to the input operand in the internal extended format 
+|	a0 points to the input operand in the internal extended format
 |	d1(high word) contains rounding precision:
 |		ext = $0000xxxx
 |		sgl = $0001xxxx
@@ -44,15 +44,15 @@
 
 	.global	round
 round:
-| If g=r=s=0 then result is exact and round is done, else set 
-| the inex flag in status reg and continue.  
+| If g=r=s=0 then result is exact and round is done, else set
+| the inex flag in status reg and continue.
 |
-	bsrs	ext_grs			|this subroutine looks at the 
-|					:rounding precision and sets 
+	bsrs	ext_grs			|this subroutine looks at the
+|					:rounding precision and sets
 |					;the appropriate g-r-s bits.
 	tstl	%d0			|if grs are zero, go force
 	bne	rnd_cont		|lower bits to zero for size
-	
+
 	swap	%d1			|set up d1.w for round prec.
 	bra	truncate
 
@@ -79,7 +79,7 @@ mode_tab:
 |	If sign of fp number = 0 (positive), then add 1 to l.
 |
 rnd_plus:
-	swap 	%d1			|set up d1 for round prec.
+	swap	%d1			|set up d1 for round prec.
 	tstb	LOCAL_SGN(%a0)		|check for sign
 	bmi	truncate		|if positive then truncate
 	movel	#0xffffffff,%d0		|force g,r,s to be all f's
@@ -92,8 +92,8 @@ rnd_plus:
 |	If sign of fp number = 1 (negative), then add 1 to l.
 |
 rnd_mnus:
-	swap 	%d1			|set up d1 for round prec.
-	tstb	LOCAL_SGN(%a0)		|check for sign	
+	swap	%d1			|set up d1 for round prec.
+	tstb	LOCAL_SGN(%a0)		|check for sign
 	bpl	truncate		|if negative then truncate
 	movel	#0xffffffff,%d0		|force g,r,s to be all f's
 	lea	add_to_l,%a1
@@ -104,7 +104,7 @@ rnd_mnus:
 |
 |	Always truncate.
 rnd_zero:
-	swap 	%d1			|set up d1 for round prec.
+	swap	%d1			|set up d1 for round prec.
 	bra	truncate
 |
 |
@@ -114,7 +114,7 @@ rnd_zero:
 |	Note that this will round to even in case of a tie.
 |
 rnd_near:
-	swap 	%d1			|set up d1 for round prec.
+	swap	%d1			|set up d1 for round prec.
 	asll	#1,%d0			|shift g-bit to c-bit
 	bcc	truncate		|if (g=1) then
 	lea	add_to_l,%a1
@@ -125,11 +125,11 @@ rnd_near:
 |	ext_grs --- extract guard, round and sticky bits
 |
 | Input:	d1 =		PREC:ROUND
-| Output:  	d0{31:29}=	guard, round, sticky
+| Output:	d0{31:29}=	guard, round, sticky
 |
 | The ext_grs extract the guard/round/sticky bits according to the
 | selected rounding precision. It is called by the round subroutine
-| only.  All registers except d0 are kept intact. d0 becomes an 
+| only.  All registers except d0 are kept intact. d0 becomes an
 | updated guard,round,sticky in d0{31:29}
 |
 | Notes: the ext_grs uses the round PREC, and therefore has to swap d1
@@ -140,7 +140,7 @@ ext_grs:
 	cmpiw	#0,%d1
 	bnes	sgl_or_dbl
 	bras	end_ext_grs
- 
+
 sgl_or_dbl:
 	moveml	%d2/%d3,-(%a7)		|make some temp registers
 	cmpiw	#1,%d1
@@ -150,19 +150,19 @@ grs_sgl:
 	movel	#30,%d2			|of the sgl prec. limits
 	lsll	%d2,%d3			|shift g-r bits to MSB of d3
 	movel	LOCAL_HI(%a0),%d2		|get word 2 for s-bit test
-	andil	#0x0000003f,%d2		|s bit is the or of all other 
+	andil	#0x0000003f,%d2		|s bit is the or of all other
 	bnes	st_stky			|bits to the right of g-r
 	tstl	LOCAL_LO(%a0)		|test lower mantissa
 	bnes	st_stky			|if any are set, set sticky
 	tstl	%d0			|test original g,r,s
 	bnes	st_stky			|if any are set, set sticky
 	bras	end_sd			|if words 3 and 4 are clr, exit
-grs_dbl:    
+grs_dbl:
 	bfextu	LOCAL_LO(%a0){#21:#2},%d3	|dbl-prec. g-r are 2 bits right
 	movel	#30,%d2			|of the dbl prec. limits
 	lsll	%d2,%d3			|shift g-r bits to the MSB of d3
 	movel	LOCAL_LO(%a0),%d2		|get lower mantissa  for s-bit test
-	andil	#0x000001ff,%d2		|s bit is the or-ing of all 
+	andil	#0x000001ff,%d2		|s bit is the or-ing of all
 	bnes	st_stky			|other bits to the right of g-r
 	tstl	%d0			|test word original g,r,s
 	bnes	st_stky			|if any are set, set sticky
@@ -269,20 +269,20 @@ end_rnd:
 |
 |	NORMALIZE
 |
-| These routines (nrm_zero & nrm_set) normalize the unnorm.  This 
-| is done by shifting the mantissa left while decrementing the 
+| These routines (nrm_zero & nrm_set) normalize the unnorm.  This
+| is done by shifting the mantissa left while decrementing the
 | exponent.
 |
-| NRM_SET shifts and decrements until there is a 1 set in the integer 
+| NRM_SET shifts and decrements until there is a 1 set in the integer
 | bit of the mantissa (msb in d1).
 |
-| NRM_ZERO shifts and decrements until there is a 1 set in the integer 
-| bit of the mantissa (msb in d1) unless this would mean the exponent 
-| would go less than 0.  In that case the number becomes a denorm - the 
-| exponent (d0) is set to 0 and the mantissa (d1 & d2) is not 
+| NRM_ZERO shifts and decrements until there is a 1 set in the integer
+| bit of the mantissa (msb in d1) unless this would mean the exponent
+| would go less than 0.  In that case the number becomes a denorm - the
+| exponent (d0) is set to 0 and the mantissa (d1 & d2) is not
 | normalized.
 |
-| Note that both routines have been optimized (for the worst case) and 
+| Note that both routines have been optimized (for the worst case) and
 | therefore do not have the easy to follow decrement/shift loop.
 |
 |	NRM_ZERO
@@ -304,34 +304,34 @@ end_rnd:
 	.global	nrm_zero
 nrm_zero:
 	movew	LOCAL_EX(%a0),%d0
-	cmpw   #64,%d0          |see if exp > 64 
+	cmpw   #64,%d0          |see if exp > 64
 	bmis	d0_less
-	bsr	nrm_set		|exp > 64 so exp won't exceed 0 
+	bsr	nrm_set		|exp > 64 so exp won't exceed 0
 	rts
 d0_less:
 	moveml	%d2/%d3/%d5/%d6,-(%a7)
 	movel	LOCAL_HI(%a0),%d1
 	movel	LOCAL_LO(%a0),%d2
 
-	bfffo	%d1{#0:#32},%d3	|get the distance to the first 1 
+	bfffo	%d1{#0:#32},%d3	|get the distance to the first 1
 |				;in ms mant
 	beqs	ms_clr		|branch if no bits were set
 	cmpw	%d3,%d0		|of X>Y
-	bmis	greater		|then exp will go past 0 (neg) if 
+	bmis	greater		|then exp will go past 0 (neg) if
 |				;it is just shifted
 	bsr	nrm_set		|else exp won't go past 0
 	moveml	(%a7)+,%d2/%d3/%d5/%d6
-	rts	
+	rts
 greater:
 	movel	%d2,%d6		|save ls mant in d6
 	lsll	%d0,%d2		|shift ls mant by count
 	lsll	%d0,%d1		|shift ms mant by count
 	movel	#32,%d5
-	subl	%d0,%d5		|make op a denorm by shifting bits 
-	lsrl	%d5,%d6		|by the number in the exp, then 
+	subl	%d0,%d5		|make op a denorm by shifting bits
+	lsrl	%d5,%d6		|by the number in the exp, then
 |				;set exp = 0.
 	orl	%d6,%d1		|shift the ls mant bits into the ms mant
-	movel	#0,%d0		|same as if decremented exp to 0 
+	movel	#0,%d0		|same as if decremented exp to 0
 |				;while shifting
 	movew	%d0,LOCAL_EX(%a0)
 	movel	%d1,LOCAL_HI(%a0)
@@ -380,7 +380,7 @@ nrm_set:
 	rts
 
 |
-| We get here if ms mant was = 0, and we assume ls mant has bits 
+| We get here if ms mant was = 0, and we assume ls mant has bits
 | set (otherwise this would have been tagged a zero not a denorm).
 |
 lower:
@@ -400,26 +400,26 @@ lower:
 |
 |	Used by underflow.
 |
-| Input: 
+| Input:
 |	a0	 points to the operand to be denormalized
 |		 (in the internal extended format)
-|		 
-|	d0: 	 rounding precision
+|
+|	d0:	 rounding precision
 | Output:
 |	a0	 points to the denormalized result
 |		 (in the internal extended format)
 |
-|	d0 	is guard,round,sticky
+|	d0	is guard,round,sticky
 |
-| d0 comes into this routine with the rounding precision. It 
-| is then loaded with the denormalized exponent threshold for the 
+| d0 comes into this routine with the rounding precision. It
+| is then loaded with the denormalized exponent threshold for the
 | rounding precision.
 |
 
 	.global	denorm
 denorm:
 	btstb	#6,LOCAL_EX(%a0)	|check for exponents between $7fff-$4000
-	beqs	no_sgn_ext	
+	beqs	no_sgn_ext
 	bsetb	#7,LOCAL_EX(%a0)	|sign extend if it is so
 no_sgn_ext:
 
@@ -442,7 +442,7 @@ load_dbl:
 	movel	%d1,%d0		|copy d1 into d0
 	subw	LOCAL_EX(%a0),%d0	|diff = threshold - exp
 	cmpw	#67,%d0		|if diff > 67 (mant + grs bits)
-	bpls	chk_stky	|then branch (all bits would be 
+	bpls	chk_stky	|then branch (all bits would be
 |				; shifted off in denorm routine)
 	clrl	%d0		|else clear the sticky flag
 	bsr	dnrm_lp		|denormalize the number
@@ -455,7 +455,7 @@ load_sgl:
 	movel	%d1,%d0		|copy d1 into d0
 	subw	LOCAL_EX(%a0),%d0	|diff = threshold - exp
 	cmpw	#67,%d0		|if diff > 67 (mant + grs bits)
-	bpls	chk_stky	|then branch (all bits would be 
+	bpls	chk_stky	|then branch (all bits would be
 |				; shifted off in denorm routine)
 	clrl	%d0		|else clear the sticky flag
 	bsr	dnrm_lp		|denormalize the number
@@ -474,7 +474,7 @@ set_stky:
 	movel	#0x20000000,%d0	|set sticky bit in return value
 clr_mant:
 	movew	%d1,LOCAL_EX(%a0)		|load exp with threshold
-	movel	#0,LOCAL_HI(%a0) 	|set d1 = 0 (ms mantissa)
+	movel	#0,LOCAL_HI(%a0)	|set d1 = 0 (ms mantissa)
 	movel	#0,LOCAL_LO(%a0)		|set d2 = 0 (ms mantissa)
 	rts
 dnrm_inex:
@@ -487,7 +487,7 @@ no_inex:
 |
 | Input:
 |	a0		points to the operand to be denormalized
-|	d0{31:29} 	initial guard,round,sticky
+|	d0{31:29}	initial guard,round,sticky
 |	d1{15:0}	denormalization threshold
 | Output:
 |	a0		points to the denormalized operand
@@ -496,7 +496,7 @@ no_inex:
 |
 | The LOCAL_LO and LOCAL_GRS parts of the value are copied to FP_SCR2
 | so that bfext can be used to extract the new low part of the mantissa.
-| Dnrm_lp can be called with a0 pointing to ETEMP or WBTEMP and there 
+| Dnrm_lp can be called with a0 pointing to ETEMP or WBTEMP and there
 | is no LOCAL_GRS scratch word following it on the fsave frame.
 |
 	.global	dnrm_lp
@@ -515,8 +515,8 @@ not_E3:
 	movel	%d1,%d0			|copy the denorm threshold
 	subw	LOCAL_EX(%a0),%d1		|d1 = threshold - uns exponent
 	bles	no_lp			|d1 <= 0
-	cmpw	#32,%d1			
-	blts	case_1			|0 = d1 < 32 
+	cmpw	#32,%d1
+	blts	case_1			|0 = d1 < 32
 	cmpw	#64,%d1
 	blts	case_2			|32 <= d1 < 64
 	bra	case_3			|d1 >= 64
@@ -542,7 +542,7 @@ case_1:
 	movel	%d2,LOCAL_HI(%a0)		|store new LOCAL_HI
 	movel	%d1,LOCAL_LO(%a0)		|store new LOCAL_LO
 	clrb	%d1
-	bftst	%d0{#2:#30}	
+	bftst	%d0{#2:#30}
 	beqs	c1nstky
 	bsetl	#rnd_stky_bit,%d0
 	st	%d1
@@ -585,7 +585,7 @@ end_c2:
 	movel	FP_SCR2+LOCAL_GRS(%a6),%d2	|restore original g,r,s
 	andil	#0xe0000000,%d2		|clear all but G,R,S
 	tstl	%d2			|test if original G,R,S are clear
-	beqs	clear_grs		
+	beqs	clear_grs
 	orl	#0x20000000,%d0		|set sticky bit in d0
 clear_grs:
 	andil	#0xe0000000,%d0		|get rid of all but G,R,S
@@ -621,7 +621,7 @@ sixty_four:
 	bfextu	%d0{#2:#30},%d1
 	andil	#0xc0000000,%d0
 	bras	c3com
-	
+
 sixty_five:
 	movel	LOCAL_HI(%a0),%d0
 	bfextu	%d0{#1:#31},%d1
diff --git a/arch/m68k/fpsp040/sacos.S b/arch/m68k/fpsp040/sacos.S
index a21cfdffb..83b00ab1c 100644
--- a/arch/m68k/fpsp040/sacos.S
+++ b/arch/m68k/fpsp040/sacos.S
@@ -12,7 +12,7 @@
 |
 |	Accuracy and Monotonicity: The returned result is within 3 ulps in
 |		64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-|		result is subsequently rounded to double precision. The 
+|		result is subsequently rounded to double precision. The
 |		result is provably monotonic in double precision.
 |
 |	Speed: The program sCOS takes approximately 310 cycles.
@@ -38,8 +38,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SACOS	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -74,17 +74,17 @@ sacos:
 |--ACOS(X) = 2 * ATAN(	SQRT( (1-X)/(1+X) )	)
 
 	fmoves		#0x3F800000,%fp1
-	faddx		%fp0,%fp1	 	| ...1+X
-	fnegx		%fp0	 	| ... -X
+	faddx		%fp0,%fp1		| ...1+X
+	fnegx		%fp0		| ... -X
 	fadds		#0x3F800000,%fp0	| ...1-X
-	fdivx		%fp1,%fp0	 	| ...(1-X)/(1+X)
+	fdivx		%fp1,%fp0		| ...(1-X)/(1+X)
 	fsqrtx		%fp0		| ...SQRT((1-X)/(1+X))
 	fmovemx	%fp0-%fp0,(%a0)	| ...overwrite input
 	movel		%d1,-(%sp)	|save original users fpcr
 	clrl		%d1
 	bsr		satan		| ...ATAN(SQRT([1-X]/[1+X]))
 	fmovel		(%sp)+,%fpcr	|restore users exceptions
-	faddx		%fp0,%fp0	 	| ...2 * ATAN( STUFF )
+	faddx		%fp0,%fp0		| ...2 * ATAN( STUFF )
 	bra		t_frcinx
 
 ACOSBIG:
@@ -110,6 +110,6 @@ ACOSBIG:
 ACOSP1:
 	fmovel		%d1,%FPCR
 	fmoves		#0x00000000,%fp0
-	rts				|Facos ; of +1 is exact	
+	rts				|Facos ; of +1 is exact
 
 	|end
diff --git a/arch/m68k/fpsp040/sasin.S b/arch/m68k/fpsp040/sasin.S
index 1d01b6b77..5647a6043 100644
--- a/arch/m68k/fpsp040/sasin.S
+++ b/arch/m68k/fpsp040/sasin.S
@@ -12,7 +12,7 @@
 |
 |	Accuracy and Monotonicity: The returned result is within 3 ulps in
 |		64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-|		result is subsequently rounded to double precision. The 
+|		result is subsequently rounded to double precision. The
 |		result is provably monotonic in double precision.
 |
 |	Speed: The program sASIN takes approximately 310 cycles.
@@ -38,8 +38,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SASIN	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -80,7 +80,7 @@ sasin:
 	fmulx		%fp2,%fp1		| ...(1+X)(1-X)
 	fmovemx	(%a7)+,%fp2-%fp2
 	fsqrtx		%fp1		| ...SQRT([1-X][1+X])
-	fdivx		%fp1,%fp0	 	| ...X/SQRT([1-X][1+X])
+	fdivx		%fp1,%fp0		| ...X/SQRT([1-X][1+X])
 	fmovemx	%fp0-%fp0,(%a0)
 	bsr		satan
 	bra		t_frcinx
@@ -97,7 +97,7 @@ asinbig:
 	andil		#0x80000000,%d0	| ...SIGN BIT OF X
 	oril		#0x3F800000,%d0	| ...+-1 IN SGL FORMAT
 	movel		%d0,-(%sp)	| ...push SIGN(X) IN SGL-FMT
-	fmovel		%d1,%FPCR		
+	fmovel		%d1,%FPCR
 	fmuls		(%sp)+,%fp0
 	bra		t_frcinx
 
diff --git a/arch/m68k/fpsp040/satan.S b/arch/m68k/fpsp040/satan.S
index 429b3c64a..20dae222d 100644
--- a/arch/m68k/fpsp040/satan.S
+++ b/arch/m68k/fpsp040/satan.S
@@ -43,8 +43,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |satan	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -52,7 +52,7 @@
 	|section	8
 
 #include "fpsp.h"
-	
+
 BOUNDS1:	.long 0x3FFB8000,0x4002FFFF
 
 ONE:	.long 0x3F800000
@@ -322,7 +322,7 @@ ATANMAIN:
 |--THE REASON FOR THIS REARRANGEMENT IS TO MAKE THE INDEPENDENT
 |--PARTS A1*U*V AND (A2 + ... STUFF) MORE LOAD-BALANCED
 
-	
+
 	fmovex		%fp0,%fp1
 	fmulx		%fp1,%fp1
 	fmoved		ATANA3,%fp2
@@ -332,7 +332,7 @@ ATANMAIN:
 	faddd		ATANA2,%fp2	| ...A2+V*(A3+V)
 	fmuld		ATANA1,%fp1	| ...A1*U*V
 	fmulx		%fp2,%fp1		| ...A1*U*V*(A2+V*(A3+V))
-	
+
 	faddx		%fp1,%fp0		| ...ATAN(U), FP1 RELEASED
 	fmovel		%d1,%FPCR		|restore users exceptions
 	faddx		ATANF(%a6),%fp0	| ...ATAN(X)
@@ -356,7 +356,7 @@ ATANSM:
 |--COMPUTE POLYNOMIAL
 	fmulx		%fp0,%fp0	| ...FP0 IS Y = X*X
 
-	
+
 	movew		#0x0000,XDCARE(%a6)
 
 	fmovex		%fp0,%fp1
@@ -381,7 +381,7 @@ ATANSM:
 	fmulx		X(%a6),%fp0		| ...X*Y
 
 	faddx		%fp2,%fp1		| ...[B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))]
-	
+
 
 	fmulx		%fp1,%fp0	| ...X*Y*([B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))])
 
@@ -413,7 +413,7 @@ ATANBIG:
 	fmoves		#0xBF800000,%fp1	| ...LOAD -1
 	fdivx		%fp0,%fp1		| ...FP1 IS -1/X
 
-	
+
 |--DIVIDE IS STILL CRANKING
 
 	fmovex		%fp1,%fp0		| ...FP0 IS X'
@@ -439,14 +439,14 @@ ATANBIG:
 	fmulx		X(%a6),%fp0		| ...X'*Y
 
 	faddx		%fp2,%fp1		| ...[Y*(C2+Z*C4)]+[C1+Z*(C3+Z*C5)]
-	
+
 
 	fmulx		%fp1,%fp0		| ...X'*Y*([B1+Z*(B3+Z*B5)]
 |					...	+[Y*(B2+Z*(B4+Z*B6))])
 	faddx		X(%a6),%fp0
 
 	fmovel		%d1,%FPCR		|restore users exceptions
-	
+
 	btstb		#7,(%a0)
 	beqs		pos_big
 
@@ -474,5 +474,5 @@ pos_huge:
 	fmovel		%d1,%fpcr
 	fsubx		PTINY,%fp0
 	bra		t_frcinx
-	
+
 	|end
diff --git a/arch/m68k/fpsp040/satanh.S b/arch/m68k/fpsp040/satanh.S
index 53a1fb53b..20f07810b 100644
--- a/arch/m68k/fpsp040/satanh.S
+++ b/arch/m68k/fpsp040/satanh.S
@@ -13,7 +13,7 @@
 |
 |	Accuracy and Monotonicity: The returned result is within 3 ulps in
 |		64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-|		result is subsequently rounded to double precision. The 
+|		result is subsequently rounded to double precision. The
 |		result is provably monotonic in double precision.
 |
 |	Speed: The program satanh takes approximately 270 cycles.
@@ -33,7 +33,7 @@
 |	3. If |X| > 1, go to 5.
 |
 |	4. (|X| = 1) Generate infinity with an appropriate sign and
-|		divide-by-zero by	
+|		divide-by-zero by
 |		sgn := sign(X)
 |		atan(X) := sgn / (+0).
 |		Exit.
@@ -45,8 +45,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |satanh	idnt	2,1 | Motorola 040 Floating Point Software Package
diff --git a/arch/m68k/fpsp040/scale.S b/arch/m68k/fpsp040/scale.S
index f940f0493..5c9b80526 100644
--- a/arch/m68k/fpsp040/scale.S
+++ b/arch/m68k/fpsp040/scale.S
@@ -9,7 +9,7 @@
 |	The entry point sscale is called from do_func to emulate
 |	the fscale unimplemented instruction.
 |
-|	Input: Double-extended destination operand in FPTEMP, 
+|	Input: Double-extended destination operand in FPTEMP,
 |		double-extended source operand in ETEMP.
 |
 |	Output: The function returns scale(X,Y) to fp0.
@@ -17,12 +17,12 @@
 |	Modifies: fp0.
 |
 |	Algorithm:
-|		
+|
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SCALE    idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -147,7 +147,7 @@ nden_exit:
 src_neg:
 	addl		%d0,%d1		|add src to dest
 	beqs		denorm		|if zero, result is denorm
-	blts		fix_dnrm	|if negative, result is 
+	blts		fix_dnrm	|if negative, result is
 |					;needing denormalization
 	tstb		L_SCR1(%a6)
 	beqs		sneg_pos
@@ -161,7 +161,7 @@ sneg_pos:
 
 |
 | The result exponent is below denorm value.  Test for catastrophic
-| underflow and force zero if true.  If not, try to shift the 
+| underflow and force zero if true.  If not, try to shift the
 | mantissa right until a zero exponent exists.
 |
 fix_dnrm:
@@ -229,7 +229,7 @@ no_dir:
 	rts
 
 |
-| The rounding mode changed the zero to a smallest denorm. Call 
+| The rounding mode changed the zero to a smallest denorm. Call
 | t_resdnrm with exceptional operand in ETEMP.
 |
 sm_dnrm:
@@ -250,7 +250,7 @@ not_zero:
 fix_exit:
 	bras		sm_dnrm
 
-	
+
 |
 | The result has underflowed to zero. Return zero and set
 | unfl, aunfl, and ainex.
@@ -284,7 +284,7 @@ neg_zero:
 	clrl		FP_SCR1(%a6)	|clear the exceptional operand
 	clrl		FP_SCR1+4(%a6)	|for gen_except.
 	clrl		FP_SCR1+8(%a6)
-	fmoves		#0x80000000,%fp0	
+	fmoves		#0x80000000,%fp0
 	rts
 pos_zero:
 	clrl		FP_SCR1(%a6)	|clear the exceptional operand
@@ -299,7 +299,7 @@ pos_zero:
 | then adding the remainder of the source to the exponent.
 |
 dst_dnrm:
-	moveml		%d2/%d3,-(%a7)	
+	moveml		%d2/%d3,-(%a7)
 	movew		FPTEMP_EX(%a6),%d1
 	movel		FPTEMP_HI(%a6),%d2
 	movel		FPTEMP_LO(%a6),%d3
@@ -313,7 +313,7 @@ dst_loop:
 	roxll		#1,%d2
 	bras		dst_loop
 |
-| Destination became normalized.  Simply add the remaining 
+| Destination became normalized.  Simply add the remaining
 | portion of the src to the exponent.
 |
 dst_norm:
diff --git a/arch/m68k/fpsp040/scosh.S b/arch/m68k/fpsp040/scosh.S
index 4464b63e7..e81edbb87 100644
--- a/arch/m68k/fpsp040/scosh.S
+++ b/arch/m68k/fpsp040/scosh.S
@@ -49,8 +49,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SCOSH	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -99,7 +99,7 @@ scosh:
 	movel		(%sp)+,%d1
 
 	fmoves		#0x3E800000,%fp1	| ...(1/4)
-	fdivx		%fp0,%fp1	 	| ...1/(2 EXP(|X|))
+	fdivx		%fp0,%fp1		| ...1/(2 EXP(|X|))
 
 	fmovel		%d1,%FPCR
 	faddx		%fp1,%fp0
diff --git a/arch/m68k/fpsp040/setox.S b/arch/m68k/fpsp040/setox.S
index cfb4ed4e3..0aa75f9bf 100644
--- a/arch/m68k/fpsp040/setox.S
+++ b/arch/m68k/fpsp040/setox.S
@@ -331,8 +331,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |setox	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -505,7 +505,7 @@ EXPCONT1:
 	fmovex		%fp0,%fp2
 	fmuls		#0xBC317218,%fp0	| ...N * L1, L1 = lead(-log2/64)
 	fmulx		L2,%fp2		| ...N * L2, L1+L2 = -log2/64
-	faddx		%fp1,%fp0	 	| ...X + N*L1
+	faddx		%fp1,%fp0		| ...X + N*L1
 	faddx		%fp2,%fp0		| ...fp0 is R, reduced arg.
 |	MOVE.W		#$3FA5,EXPA3	...load EXPA3 in cache
 
@@ -516,46 +516,46 @@ EXPCONT1:
 |--[R+R*S*(A2+S*A4)] + [S*(A1+S*(A3+S*A5))]
 
 	fmovex		%fp0,%fp1
-	fmulx		%fp1,%fp1	 	| ...fp1 IS S = R*R
+	fmulx		%fp1,%fp1		| ...fp1 IS S = R*R
 
 	fmoves		#0x3AB60B70,%fp2	| ...fp2 IS A5
 |	MOVE.W		#0,2(%a1)	...load 2^(J/64) in cache
 
-	fmulx		%fp1,%fp2	 	| ...fp2 IS S*A5
+	fmulx		%fp1,%fp2		| ...fp2 IS S*A5
 	fmovex		%fp1,%fp3
 	fmuls		#0x3C088895,%fp3	| ...fp3 IS S*A4
 
 	faddd		EXPA3,%fp2	| ...fp2 IS A3+S*A5
 	faddd		EXPA2,%fp3	| ...fp3 IS A2+S*A4
 
-	fmulx		%fp1,%fp2	 	| ...fp2 IS S*(A3+S*A5)
+	fmulx		%fp1,%fp2		| ...fp2 IS S*(A3+S*A5)
 	movew		%d0,SCALE(%a6)	| ...SCALE is 2^(M) in extended
 	clrw		SCALE+2(%a6)
 	movel		#0x80000000,SCALE+4(%a6)
 	clrl		SCALE+8(%a6)
 
-	fmulx		%fp1,%fp3	 	| ...fp3 IS S*(A2+S*A4)
+	fmulx		%fp1,%fp3		| ...fp3 IS S*(A2+S*A4)
 
 	fadds		#0x3F000000,%fp2	| ...fp2 IS A1+S*(A3+S*A5)
-	fmulx		%fp0,%fp3	 	| ...fp3 IS R*S*(A2+S*A4)
+	fmulx		%fp0,%fp3		| ...fp3 IS R*S*(A2+S*A4)
 
-	fmulx		%fp1,%fp2	 	| ...fp2 IS S*(A1+S*(A3+S*A5))
-	faddx		%fp3,%fp0	 	| ...fp0 IS R+R*S*(A2+S*A4),
+	fmulx		%fp1,%fp2		| ...fp2 IS S*(A1+S*(A3+S*A5))
+	faddx		%fp3,%fp0		| ...fp0 IS R+R*S*(A2+S*A4),
 |					...fp3 released
 
 	fmovex		(%a1)+,%fp1	| ...fp1 is lead. pt. of 2^(J/64)
-	faddx		%fp2,%fp0	 	| ...fp0 is EXP(R) - 1
+	faddx		%fp2,%fp0		| ...fp0 is EXP(R) - 1
 |					...fp2 released
 
 |--Step 5
 |--final reconstruction process
 |--EXP(X) = 2^M * ( 2^(J/64) + 2^(J/64)*(EXP(R)-1) )
 
-	fmulx		%fp1,%fp0	 	| ...2^(J/64)*(Exp(R)-1)
+	fmulx		%fp1,%fp0		| ...2^(J/64)*(Exp(R)-1)
 	fmovemx	(%a7)+,%fp2-%fp2/%fp3	| ...fp2 restored
 	fadds		(%a1),%fp0	| ...accurate 2^(J/64)
 
-	faddx		%fp1,%fp0	 	| ...2^(J/64) + 2^(J/64)*...
+	faddx		%fp1,%fp0		| ...2^(J/64) + 2^(J/64)*...
 	movel		ADJFLAG(%a6),%d0
 
 |--Step 6
@@ -564,7 +564,7 @@ EXPCONT1:
 ADJUST:
 	fmulx		ADJSCALE(%a6),%fp0
 NORMAL:
-	fmovel		%d1,%FPCR	 	| ...restore user FPCR
+	fmovel		%d1,%FPCR		| ...restore user FPCR
 	fmulx		SCALE(%a6),%fp0	| ...multiply 2^(M)
 	bra		t_frcinx
 
diff --git a/arch/m68k/fpsp040/sgetem.S b/arch/m68k/fpsp040/sgetem.S
index 3308278f3..0fcbd045b 100644
--- a/arch/m68k/fpsp040/sgetem.S
+++ b/arch/m68k/fpsp040/sgetem.S
@@ -1,14 +1,14 @@
 |
 |	sgetem.sa 3.1 12/10/90
 |
-|	The entry point sGETEXP returns the exponent portion 
+|	The entry point sGETEXP returns the exponent portion
 |	of the input argument.  The exponent bias is removed
-|	and the exponent value is returned as an extended 
+|	and the exponent value is returned as an extended
 |	precision number in fp0.  sGETEXPD handles denormalized
 |	numbers.
 |
-|	The entry point sGETMAN extracts the mantissa of the 
-|	input argument.  The mantissa is converted to an 
+|	The entry point sGETMAN extracts the mantissa of the
+|	input argument.  The mantissa is converted to an
 |	extended precision number and returned in fp0.  The
 |	range of the result is [1.0 - 2.0).
 |
@@ -24,8 +24,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SGETEM	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -81,7 +81,7 @@ sgetman:
 	fmovel	%d0,%fpcr		|this fpcr setting is used by the 882
 	movew	LOCAL_EX(%a0),%d0	|get the exp (really just want sign bit)
 	orw	#0x7fff,%d0	|clear old exp
-	bclrl	#14,%d0	 	|make it the new exp +-3fff
+	bclrl	#14,%d0		|make it the new exp +-3fff
 	movew	%d0,LOCAL_EX(%a0)	|move the sign & exp back to fsave stack
 	fmovex	(%a0),%fp0	|put new value back in fp0
 	rts
diff --git a/arch/m68k/fpsp040/sint.S b/arch/m68k/fpsp040/sint.S
index f04653e71..0f9bd28e5 100644
--- a/arch/m68k/fpsp040/sint.S
+++ b/arch/m68k/fpsp040/sint.S
@@ -1,8 +1,8 @@
 |
 |	sint.sa 3.1 12/10/90
 |
-|	The entry point sINT computes the rounded integer 
-|	equivalent of the input argument, sINTRZ computes 
+|	The entry point sINT computes the rounded integer
+|	equivalent of the input argument, sINTRZ computes
 |	the integer rounded to zero of the input argument.
 |
 |	Entry points sint and sintrz are called from do_func
@@ -24,10 +24,10 @@
 |
 |	Algorithm: (sint and sintrz)
 |
-|	1. If exp(X) >= 63, return X. 
+|	1. If exp(X) >= 63, return X.
 |	   If exp(X) < 0, return +/- 0 or +/- 1, according to
 |	   the rounding mode.
-|	
+|
 |	2. (X is in range) set rsc = 63 - exp(X). Unnormalize the
 |	   result to the exponent $403e.
 |
@@ -51,8 +51,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SINT    idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -78,9 +78,9 @@
 sint:
 	bfextu	FPCR_MODE(%a6){#2:#2},%d1	|use user's mode for rounding
 |					;implicitly has extend precision
-|					;in upper word. 
+|					;in upper word.
 	movel	%d1,L_SCR1(%a6)		|save mode bits
-	bras	sintexc			
+	bras	sintexc
 
 |
 |	FINT with extended denorm inputs.
@@ -115,13 +115,13 @@ sintmz:
 sintrz:
 	movel	#1,L_SCR1(%a6)		|use rz mode for rounding
 |					;implicitly has extend precision
-|					;in upper word. 
-	bras	sintexc			
+|					;in upper word.
+	bras	sintexc
 |
 |	SINTDO
 |
 |	Input:	a0 points to an IEEE extended format operand
-| 	Output:	fp0 has the result 
+|	Output:	fp0 has the result
 |
 | Exceptions:
 |
@@ -133,7 +133,7 @@ sintrz:
 sintdo:
 	bfextu	FPCR_MODE(%a6){#2:#2},%d1	|use user's mode for rounding
 |					;implicitly has ext precision
-|					;in upper word. 
+|					;in upper word.
 	movel	%d1,L_SCR1(%a6)		|save mode bits
 |
 | Real work of sint is in sintexc
@@ -141,7 +141,7 @@ sintdo:
 sintexc:
 	bclrb	#sign_bit,LOCAL_EX(%a0)	|convert to internal extended
 |					;format
-	sne	LOCAL_SGN(%a0)		
+	sne	LOCAL_SGN(%a0)
 	cmpw	#0x403e,LOCAL_EX(%a0)	|check if (unbiased) exp > 63
 	bgts	out_rnge			|branch if exp < 63
 	cmpw	#0x3ffd,LOCAL_EX(%a0)	|check if (unbiased) exp < 0
@@ -187,7 +187,7 @@ un_rnrz:
 un_rnrz_neg:
 	bsr	ld_mzero
 	bra	t_inx2
-	
+
 |
 | Input is greater than 2^63.  All bits are significant.  Return
 | the input.
@@ -206,7 +206,7 @@ intps:
 	rts
 
 in_rnge:
-| 					;shift off fraction bits
+|					;shift off fraction bits
 	clrl	%d0			|clear d0 - initial g,r,s for
 |					;dnrm_lp
 	movel	#0x403e,%d1		|set threshold for dnrm_lp
diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S
index 4825eb25e..dbc1255a5 100644
--- a/arch/m68k/fpsp040/skeleton.S
+++ b/arch/m68k/fpsp040/skeleton.S
@@ -18,20 +18,20 @@
 |	to handle the exception.
 |
 |	If the exception was completely handled by the package, then
-|	the return will be via a 'jmp fpsp_done'.  Unless there is 
+|	the return will be via a 'jmp fpsp_done'.  Unless there is
 |	OS specific work to be done (such as handling a context switch or
 |	interrupt) the user program can be resumed via 'rte'.
 |
 |	In the following skeleton code, some typical 'real_xxxx' handling
 |	code is shown.  This code may need to be moved to an appropriate
 |	place in the target system, or rewritten.
-|	
+|
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |
@@ -50,7 +50,7 @@
 |
 
 	|section 8
- 
+
 #include "fpsp.h"
 
 	|xref	b1238_fix
@@ -72,7 +72,7 @@ real_dz:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
@@ -82,7 +82,7 @@ real_dz:
 |
 |	All inexact exceptions are real, but the 'real' handler
 |	will probably want to clear the pending exception.
-|	The provided code will clear the E3 exception (if pending), 
+|	The provided code will clear the E3 exception (if pending),
 |	otherwise clear the E1 exception.  The frestore is not really
 |	necessary for E1 exceptions.
 |
@@ -96,7 +96,7 @@ real_dz:
 | to the appropriate  handler for the exception in the fpsr.  Note
 | that this fix is only for d43b parts, and is skipped if the
 | version number is not $40.
-| 
+|
 |
 	.global	real_inex
 	.global	inex
@@ -116,7 +116,7 @@ inex:
 	bra		snan
 inex_ckofl:
 	btstb		#ovfl_bit,2(%sp) |test for ovfl
-	beq		inex_ckufl 
+	beq		inex_ckufl
 	addl		#4,%sp
 	frestore	(%sp)+
 	unlk		%a6
@@ -163,11 +163,11 @@ inex_done:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
-	
+
 |
 |	Overflow exception
 |
@@ -189,11 +189,11 @@ ovfl_done:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
-	
+
 |
 |	Underflow exception
 |
@@ -215,11 +215,11 @@ unfl_done:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
-	
+
 |
 |	Signalling NAN exception
 |
@@ -237,11 +237,11 @@ real_snan:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
-	
+
 |
 |	Operand Error exception
 |
@@ -259,12 +259,12 @@ real_operr:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
 
-	
+
 |
 |	BSUN exception
 |
@@ -287,7 +287,7 @@ real_bsun:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
@@ -295,7 +295,7 @@ real_bsun:
 |
 |	F-line exception
 |
-|	A 'real' F-line exception is one that the FPSP isn't supposed to 
+|	A 'real' F-line exception is one that the FPSP isn't supposed to
 |	handle. E.g. an instruction with a co-processor ID that is not 1.
 |
 |
@@ -308,7 +308,7 @@ real_fline:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
@@ -330,7 +330,7 @@ real_unsupp:
 
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	bral	ret_from_exception
@@ -355,14 +355,14 @@ real_trace:
 |	{4028, 4130} - unimp frame
 |	{4000, 4100} - idle frame
 |
-|	This entry point simply holds an f-line illegal value.  
+|	This entry point simply holds an f-line illegal value.
 |	Replace this with a call to your kernel panic code or
 |	code to handle future revisions of the fpu.
 |
 	.global	fpsp_fmt_error
 fpsp_fmt_error:
 
-	.long	0xf27f0000	|f-line illegal 
+	.long	0xf27f0000	|f-line illegal
 
 |
 |	fpsp_done --- FPSP exit point
@@ -442,7 +442,7 @@ user_write:
 |	a1 - supervisor destination address
 |	d0 - number of bytes to read (maximum count is 12)
 |
-| Like mem_write, mem_read always reads with a supervisor 
+| Like mem_write, mem_read always reads with a supervisor
 | destination address on the supervisor stack.  Also like mem_write,
 | the EXC_SR is checked and a simple memory copy is done if reading
 | from supervisor space is indicated.
diff --git a/arch/m68k/fpsp040/slog2.S b/arch/m68k/fpsp040/slog2.S
index 6a17a627f..517fa4563 100644
--- a/arch/m68k/fpsp040/slog2.S
+++ b/arch/m68k/fpsp040/slog2.S
@@ -1,28 +1,28 @@
 |
 |	slog2.sa 3.1 12/10/90
 |
-|       The entry point slog10 computes the base-10 
+|       The entry point slog10 computes the base-10
 |	logarithm of an input argument X.
-|	slog10d does the same except the input value is a 
-|	denormalized number.  
+|	slog10d does the same except the input value is a
+|	denormalized number.
 |	sLog2 and sLog2d are the base-2 analogues.
 |
-|       INPUT:	Double-extended value in memory location pointed to 
+|       INPUT:	Double-extended value in memory location pointed to
 |		by address register a0.
 |
-|       OUTPUT: log_10(X) or log_2(X) returned in floating-point 
+|       OUTPUT: log_10(X) or log_2(X) returned in floating-point
 |		register fp0.
 |
-|       ACCURACY and MONOTONICITY: The returned result is within 1.7 
-|		ulps in 64 significant bit, i.e. within 0.5003 ulp 
-|		to 53 bits if the result is subsequently rounded 
-|		to double precision. The result is provably monotonic 
+|       ACCURACY and MONOTONICITY: The returned result is within 1.7
+|		ulps in 64 significant bit, i.e. within 0.5003 ulp
+|		to 53 bits if the result is subsequently rounded
+|		to double precision. The result is provably monotonic
 |		in double precision.
 |
-|       SPEED:	Two timings are measured, both in the copy-back mode. 
-|		The first one is measured when the function is invoked 
-|		the first time (so the instructions and data are not 
-|		in cache), and the second one is measured when the 
+|       SPEED:	Two timings are measured, both in the copy-back mode.
+|		The first one is measured when the function is invoked
+|		the first time (so the instructions and data are not
+|		in cache), and the second one is measured when the
 |		function is reinvoked at the same input argument.
 |
 |       ALGORITHM and IMPLEMENTATION NOTES:
@@ -42,7 +42,7 @@
 |            2.2  Return ans := Y * INV_L10.
 |
 |
-|       slog10: 
+|       slog10:
 |
 |       Step 0.   If X < 0, create a NaN and raise the invalid operation
 |                 flag. Otherwise, save FPCR in D1; set FpCR to default.
@@ -96,15 +96,15 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SLOG2    idnt    2,1 | Motorola 040 Floating Point Software Package
 
 	|section	8
 
-	|xref	t_frcinx	
+	|xref	t_frcinx
 	|xref	t_operr
 	|xref	slogn
 	|xref	slognd
diff --git a/arch/m68k/fpsp040/slogn.S b/arch/m68k/fpsp040/slogn.S
index 68bd283ff..2aaa0725c 100644
--- a/arch/m68k/fpsp040/slogn.S
+++ b/arch/m68k/fpsp040/slogn.S
@@ -13,11 +13,11 @@
 |
 |	Accuracy and Monotonicity: The returned result is within 2 ulps in
 |		64 significant bit, i.e. within 0.5001 ulp to 53 bits if the
-|		result is subsequently rounded to double precision. The 
+|		result is subsequently rounded to double precision. The
 |		result is provably monotonic in double precision.
 |
-|	Speed: The program slogn takes approximately 190 cycles for input 
-|		argument X such that |X-1| >= 1/16, which is the usual 
+|	Speed: The program slogn takes approximately 190 cycles for input
+|		argument X such that |X-1| >= 1/16, which is the usual
 |		situation. For those arguments, slognp1 takes approximately
 |		 210 cycles. For the less common arguments, the program will
 |		 run no worse than 10% slower.
@@ -45,26 +45,26 @@
 |	Step 2: Let 1+X = 2**k * Y, where 1 <= Y < 2. Define F as done in Step 2
 |		of the algorithm for LOGN and compute log(1+X) as
 |		k*log(2) + log(F) + poly where poly approximates log(1+u),
-|		u = (Y-F)/F. 
+|		u = (Y-F)/F.
 |
 |	Implementation Notes:
 |	Note 1. There are 64 different possible values for F, thus 64 log(F)'s
-|		need to be tabulated. Moreover, the values of 1/F are also 
+|		need to be tabulated. Moreover, the values of 1/F are also
 |		tabulated so that the division in (Y-F)/F can be performed by a
 |		multiplication.
 |
 |	Note 2. In Step 2 of lognp1, in order to preserved accuracy, the value
-|		Y-F has to be calculated carefully when 1/2 <= X < 3/2. 
+|		Y-F has to be calculated carefully when 1/2 <= X < 3/2.
 |
 |	Note 3. To fully exploit the pipeline, polynomials are usually separated
 |		into two parts evaluated independently before being added up.
-|	
+|
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |slogn	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -262,7 +262,7 @@ slognd:
 |----the value TWOTO100 is no longer needed.
 |----Note that this code assumes the denormalized input is NON-ZERO.
 
-     moveml	%d2-%d7,-(%a7)		| ...save some registers 
+     moveml	%d2-%d7,-(%a7)		| ...save some registers
      movel	#0x00000000,%d3		| ...D3 is exponent of smallest norm. #
      movel	4(%a0),%d4
      movel	8(%a0),%d5		| ...(D4,D5) is (Hi_X,Lo_X)
@@ -347,14 +347,14 @@ LOGMAIN:
 |--NOTE THAT U = (Y-F)/F IS VERY SMALL AND THUS APPROXIMATING
 |--LOG(1+U) CAN BE VERY EFFICIENT.
 |--ALSO NOTE THAT THE VALUE 1/F IS STORED IN A TABLE SO THAT NO
-|--DIVISION IS NEEDED TO CALCULATE (Y-F)/F. 
+|--DIVISION IS NEEDED TO CALCULATE (Y-F)/F.
 
 |--GET K, Y, F, AND ADDRESS OF 1/F.
 	asrl	#8,%d0
 	asrl	#8,%d0		| ...SHIFTED 16 BITS, BIASED EXPO. OF X
-	subil	#0x3FFF,%d0 	| ...THIS IS K
+	subil	#0x3FFF,%d0	| ...THIS IS K
 	addl	ADJK(%a6),%d0	| ...ADJUST K, ORIGINAL INPUT MAY BE  DENORM.
-	lea	LOGTBL,%a0 	| ...BASE ADDRESS OF 1/F AND LOG(F)
+	lea	LOGTBL,%a0	| ...BASE ADDRESS OF 1/F AND LOG(F)
 	fmovel	%d0,%fp1		| ...CONVERT K TO FLOATING-POINT FORMAT
 
 |--WHILE THE CONVERSION IS GOING ON, WE GET F AND ADDRESS OF 1/F
@@ -363,7 +363,7 @@ LOGMAIN:
 	andil	#0xFE000000,FFRAC(%a6) | ...FIRST 7 BITS OF Y
 	oril	#0x01000000,FFRAC(%a6) | ...GET F: ATTACH A 1 AT THE EIGHTH BIT
 	movel	FFRAC(%a6),%d0	| ...READY TO GET ADDRESS OF 1/F
-	andil	#0x7E000000,%d0	
+	andil	#0x7E000000,%d0
 	asrl	#8,%d0
 	asrl	#8,%d0
 	asrl	#4,%d0		| ...SHIFTED 20, D0 IS THE DISPLACEMENT
@@ -390,7 +390,7 @@ LP1CONT1:
 |--[U + V*(A1+V*(A3+V*A5))]  +  [U*V*(A2+V*(A4+V*A6))]
 
 	fmovex	%fp2,%fp3
-	fmovex	%fp2,%fp1	
+	fmovex	%fp2,%fp1
 
 	fmuld	LOGA6,%fp1	| ...V*A6
 	fmuld	LOGA5,%fp2	| ...V*A5
@@ -440,7 +440,7 @@ LP1CONT2:
 	fmovex	%fp1,%fp0
 	fmulx	%fp0,%fp0	| ...FP0 IS V
 	fmovex	%fp1,SAVEU(%a6) | ...STORE U IN MEMORY, FREE FP1
-	fmovex	%fp0,%fp1	
+	fmovex	%fp0,%fp1
 	fmulx	%fp1,%fp1	| ...FP1 IS W
 
 	fmoved	LOGB5,%fp3
@@ -465,7 +465,7 @@ LP1CONT2:
 	fmulx	%fp1,%fp0	| ...U*V*( [B1+W*(B3+W*B5)] + [V*(B2+W*B4)] )
 
 	fmovel	%d1,%fpcr
-	faddx	SAVEU(%a6),%fp0		
+	faddx	SAVEU(%a6),%fp0
 	bra	t_frcinx
 	rts
 
@@ -549,7 +549,7 @@ KISNEG1:
 	asrl	#8,%d0
 	asrl	#4,%d0		| ...D0 CONTAINS DISPLACEMENT FOR 1/F
 	faddx	%fp1,%fp1		| ...GET 2Z
-	fmovemx %fp2-%fp2/%fp3,-(%sp)	| ...SAVE FP2 
+	fmovemx %fp2-%fp2/%fp3,-(%sp)	| ...SAVE FP2
 	faddx	%fp1,%fp0		| ...FP0 IS Y-F = (2-F)+2Z
 	lea	LOGTBL,%a0	| ...A0 IS ADDRESS OF 1/F
 	addal	%d0,%a0
@@ -569,7 +569,7 @@ KISZERO:
 	faddx	%fp1,%fp0		| ...FP0 IS Y-F
 	fmovemx %fp2-%fp2/%fp3,-(%sp)	| ...FP2 SAVED
 	lea	LOGTBL,%a0
-	addal	%d0,%a0	 	| ...A0 IS ADDRESS OF 1/F
+	addal	%d0,%a0		| ...A0 IS ADDRESS OF 1/F
 	fmoves	zero,%fp1	| ...FP1 IS K = 0
 	bra	LP1CONT1
 
diff --git a/arch/m68k/fpsp040/smovecr.S b/arch/m68k/fpsp040/smovecr.S
index 09b5c389a..a0127fa55 100644
--- a/arch/m68k/fpsp040/smovecr.S
+++ b/arch/m68k/fpsp040/smovecr.S
@@ -15,8 +15,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SMOVECR	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -39,7 +39,7 @@
 
 FZERO:	.long	00000000
 |
-|	FMOVECR 
+|	FMOVECR
 |
 	.global	smovcr
 smovcr:
@@ -55,9 +55,9 @@ smovcr:
 	cmpib	#0x0e,%d0		|check range $0b - $0e
 	bles	SM_TBL		|valid constants in this range
 	cmpib	#0x2f,%d0		|check range $10 - $2f
-	bles	Z_VAL		|if in this range, return zero 
+	bles	Z_VAL		|if in this range, return zero
 	cmpib	#0x3f,%d0		|check range $30 - $3f
-	ble  	BG_TBL		|valid constants in this range
+	ble	BG_TBL		|valid constants in this range
 Z_VAL:
 	fmoves	FZERO,%fp0
 	rts
@@ -149,7 +149,7 @@ not_ext:
 	lea	FP_SCR1(%a6),%a0
 	btstb	#sign_bit,LOCAL_EX(%a0)
 	sne	LOCAL_SGN(%a0)		|convert to internal ext. format
-	
+
 	bsr	round			|go round the mantissa
 
 	bfclr	LOCAL_SGN(%a0){#0:#8}	|convert back to IEEE ext format
diff --git a/arch/m68k/fpsp040/srem_mod.S b/arch/m68k/fpsp040/srem_mod.S
index dd2b39266..8c8d7f50c 100644
--- a/arch/m68k/fpsp040/srem_mod.S
+++ b/arch/m68k/fpsp040/srem_mod.S
@@ -21,7 +21,7 @@
 |       ---------
 |
 |       Step 1.  Save and strip signs of X and Y: signX := sign(X),
-|                signY := sign(Y), X := |X|, Y := |Y|, 
+|                signY := sign(Y), X := |X|, Y := |Y|,
 |                signQ := signX EOR signY. Record whether MOD or REM
 |                is requested.
 |
@@ -41,7 +41,7 @@
 |
 |       Step 4.  At this point, R = X - QY = MOD(X,Y). Set
 |                Last_Subtract := false (used in Step 7 below). If
-|                MOD is requested, go to Step 6. 
+|                MOD is requested, go to Step 6.
 |
 |       Step 5.  R = MOD(X,Y), but REM(X,Y) is requested.
 |            5.1 If R < Y/2, then R = MOD(X,Y) = REM(X,Y). Go to
@@ -61,13 +61,13 @@
 |                X = 2^(j)*(Q+1)Y. set Q := 2^(j)*(Q+1),
 |                R := 0. Return signQ, last 7 bits of Q, and R.
 |
-|                
-             
+|
+
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 SREM_MOD:    |idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -362,10 +362,10 @@ Fix_Sign:
 |..Get Q
 |
 Get_Q:
-   clrl		%d6		
+   clrl		%d6
    movew               SignQ(%a6),%d6        | ...D6 is sign(Q)
    movel               #8,%d7
-   lsrl                %d7,%d6           
+   lsrl                %d7,%d6
    andil               #0x0000007F,%d3   | ...7 bits of Q
    orl                 %d6,%d3           | ...sign and bits of Q
    swap                 %d3
@@ -391,7 +391,7 @@ Finish:
 Rem_is_0:
 |..R = 2^(-j)X - Q Y = Y, thus R = 0 and quotient = 2^j (Q+1)
    addql               #1,%d3
-   cmpil               #8,%d0           | ...D0 is j 
+   cmpil               #8,%d0           | ...D0 is j
    bges                Q_Big
 
    lsll                %d0,%d3
diff --git a/arch/m68k/fpsp040/ssin.S b/arch/m68k/fpsp040/ssin.S
index 886290440..043c91cdd 100644
--- a/arch/m68k/fpsp040/ssin.S
+++ b/arch/m68k/fpsp040/ssin.S
@@ -83,8 +83,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SSIN	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -204,7 +204,7 @@ SINMAIN:
 
 |--HIDE THE NEXT THREE INSTRUCTIONS
 	lea		PITBL+0x200,%a1 | ...TABLE OF N*PI/2, N = -32,...,32
-	
+
 
 |--FP1 IS NOW READY
 	fmovel		%fp1,N(%a6)		| ...CONVERT TO INTEGER
@@ -273,7 +273,7 @@ SINPOLY:
 	faddx		%fp2,%fp1	| ...[A1+T(A3+T(A5+TA7))]+[S(A2+T(A4+TA6))]
 |--FP3 RELEASED, RESTORE NOW AND TAKE SOME ADVANTAGE OF HIDING
 |--FP2 RELEASED, RESTORE NOW AND TAKE FULL ADVANTAGE OF HIDING
-	
+
 
 	fmulx		%fp1,%fp0		| ...SIN(R')-R'
 |--FP1 RELEASED.
@@ -335,7 +335,7 @@ COSPOLY:
 	fmulx		%fp2,%fp0	| ...S(B2+T(B4+T(B6+TB8)))
 |--FP3 RELEASED, RESTORE NOW AND TAKE SOME ADVANTAGE OF HIDING
 |--FP2 RELEASED.
-	
+
 
 	faddx		%fp1,%fp0
 |--FP1 RELEASED
@@ -352,7 +352,7 @@ SINBORS:
 |--IF |X| < 2**(-40), RETURN X OR 1.
 	cmpil		#0x3FFF8000,%d0
 	bgts		REDUCEX
-        
+
 
 SINSM:
 	movel		ADJN(%a6),%d0
@@ -466,7 +466,7 @@ WORK:
         movew		%d2,FP_SCR2(%a6)
 	clrw           FP_SCR2+2(%a6)
 	movel		#0xC90FDAA2,FP_SCR2+4(%a6)
-	clrl		FP_SCR2+8(%a6)		| ...FP_SCR2 is  2**(L) * Piby2_1	
+	clrl		FP_SCR2+8(%a6)		| ...FP_SCR2 is  2**(L) * Piby2_1
 
 |--FP2 IS READY
 	fsubs		TWOTO63(%a6),%fp2		| ...FP2 is N
@@ -514,7 +514,7 @@ RESTORE:
 	movel		(%a7)+,%d2
 	fmovemx	(%a7)+,%fp2-%fp5
 
-	
+
 	movel		ADJN(%a6),%d0
 	cmpil		#4,%d0
 
@@ -559,7 +559,7 @@ SCMAIN:
 
 |--HIDE THE NEXT THREE INSTRUCTIONS
 	lea		PITBL+0x200,%a1 | ...TABLE OF N*PI/2, N = -32,...,32
-	
+
 
 |--FP1 IS NOW READY
 	fmovel		%fp1,N(%a6)		| ...CONVERT TO INTEGER
@@ -577,7 +577,7 @@ SCCONT:
 |--HIDE THE NEXT TWO
 	movel		N(%a6),%d0
 	rorl		#1,%d0
-	
+
 	cmpil		#0,%d0		| ...D0 < 0 IFF N IS ODD
 	bge		NEVEN
 
@@ -641,7 +641,7 @@ NODD:
 	fmulx		%fp0,%fp1	 | ...S(A1+...)
 	fmulx		%fp2,%fp0	 | ...S(B2+...)
 
-	
+
 
 	fmulx		RPRIME(%a6),%fp1	| ...R'S(A1+...)
 	fadds		COSB1,%fp0	| ...B1+S(B2...)
@@ -709,7 +709,7 @@ NEVEN:
 	fmulx		%fp0,%fp1	 | ...S(B2+...)
 	fmulx		%fp2,%fp0	 | ...s(a1+...)
 
-	
+
 
 	fadds		COSB1,%fp1	| ...B1+S(B2...)
 	fmulx		RPRIME(%a6),%fp0	| ...R'S(A1+...)
@@ -728,7 +728,7 @@ NEVEN:
 SCBORS:
 	cmpil		#0x3FFF8000,%d0
 	bgt		REDUCEX
-        
+
 
 SCSM:
 	movew		#0x0000,XDCARE(%a6)
diff --git a/arch/m68k/fpsp040/ssinh.S b/arch/m68k/fpsp040/ssinh.S
index fc1f11e8c..c8b3308bb 100644
--- a/arch/m68k/fpsp040/ssinh.S
+++ b/arch/m68k/fpsp040/ssinh.S
@@ -5,7 +5,7 @@
 |       an input argument; sSinhd does the same except for denormalized
 |       input.
 |
-|       Input: Double-extended number X in location pointed to 
+|       Input: Double-extended number X in location pointed to
 |		by address register a0.
 |
 |       Output: The value sinh(X) returned in floating-point register Fp0.
@@ -49,8 +49,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |SSINH	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -91,7 +91,7 @@ ssinh:
 	moveml	%a1/%d1,-(%sp)
 	fmovemx %fp0-%fp0,(%a0)
 	clrl	%d1
-	bsr	setoxm1	 	| ...FP0 IS Z = EXPM1(Y)
+	bsr	setoxm1		| ...FP0 IS Z = EXPM1(Y)
 	fmovel	#0,%fpcr
 	moveml	(%sp)+,%a1/%d1
 
diff --git a/arch/m68k/fpsp040/stan.S b/arch/m68k/fpsp040/stan.S
index e0b4daf91..b5c2a196e 100644
--- a/arch/m68k/fpsp040/stan.S
+++ b/arch/m68k/fpsp040/stan.S
@@ -50,8 +50,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |STAN	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -213,34 +213,34 @@ TANCONT:
 	blt		NODD
 
 	fmovex		%fp0,%fp1
-	fmulx		%fp1,%fp1	 	| ...S = R*R
+	fmulx		%fp1,%fp1		| ...S = R*R
 
 	fmoved		TANQ4,%fp3
 	fmoved		TANP3,%fp2
 
-	fmulx		%fp1,%fp3	 	| ...SQ4
-	fmulx		%fp1,%fp2	 	| ...SP3
+	fmulx		%fp1,%fp3		| ...SQ4
+	fmulx		%fp1,%fp2		| ...SP3
 
 	faddd		TANQ3,%fp3	| ...Q3+SQ4
 	faddx		TANP2,%fp2	| ...P2+SP3
 
-	fmulx		%fp1,%fp3	 	| ...S(Q3+SQ4)
-	fmulx		%fp1,%fp2	 	| ...S(P2+SP3)
+	fmulx		%fp1,%fp3		| ...S(Q3+SQ4)
+	fmulx		%fp1,%fp2		| ...S(P2+SP3)
 
 	faddx		TANQ2,%fp3	| ...Q2+S(Q3+SQ4)
 	faddx		TANP1,%fp2	| ...P1+S(P2+SP3)
 
-	fmulx		%fp1,%fp3	 	| ...S(Q2+S(Q3+SQ4))
-	fmulx		%fp1,%fp2	 	| ...S(P1+S(P2+SP3))
+	fmulx		%fp1,%fp3		| ...S(Q2+S(Q3+SQ4))
+	fmulx		%fp1,%fp2		| ...S(P1+S(P2+SP3))
 
 	faddx		TANQ1,%fp3	| ...Q1+S(Q2+S(Q3+SQ4))
-	fmulx		%fp0,%fp2	 	| ...RS(P1+S(P2+SP3))
+	fmulx		%fp0,%fp2		| ...RS(P1+S(P2+SP3))
 
-	fmulx		%fp3,%fp1	 	| ...S(Q1+S(Q2+S(Q3+SQ4)))
-	
+	fmulx		%fp3,%fp1		| ...S(Q1+S(Q2+S(Q3+SQ4)))
+
+
+	faddx		%fp2,%fp0		| ...R+RS(P1+S(P2+SP3))
 
-	faddx		%fp2,%fp0	 	| ...R+RS(P1+S(P2+SP3))
-	
 
 	fadds		#0x3F800000,%fp1	| ...1+S(Q1+...)
 
@@ -251,40 +251,40 @@ TANCONT:
 
 NODD:
 	fmovex		%fp0,%fp1
-	fmulx		%fp0,%fp0	 	| ...S = R*R
+	fmulx		%fp0,%fp0		| ...S = R*R
 
 	fmoved		TANQ4,%fp3
 	fmoved		TANP3,%fp2
 
-	fmulx		%fp0,%fp3	 	| ...SQ4
-	fmulx		%fp0,%fp2	 	| ...SP3
+	fmulx		%fp0,%fp3		| ...SQ4
+	fmulx		%fp0,%fp2		| ...SP3
 
 	faddd		TANQ3,%fp3	| ...Q3+SQ4
 	faddx		TANP2,%fp2	| ...P2+SP3
 
-	fmulx		%fp0,%fp3	 	| ...S(Q3+SQ4)
-	fmulx		%fp0,%fp2	 	| ...S(P2+SP3)
+	fmulx		%fp0,%fp3		| ...S(Q3+SQ4)
+	fmulx		%fp0,%fp2		| ...S(P2+SP3)
 
 	faddx		TANQ2,%fp3	| ...Q2+S(Q3+SQ4)
 	faddx		TANP1,%fp2	| ...P1+S(P2+SP3)
 
-	fmulx		%fp0,%fp3	 	| ...S(Q2+S(Q3+SQ4))
-	fmulx		%fp0,%fp2	 	| ...S(P1+S(P2+SP3))
+	fmulx		%fp0,%fp3		| ...S(Q2+S(Q3+SQ4))
+	fmulx		%fp0,%fp2		| ...S(P1+S(P2+SP3))
 
 	faddx		TANQ1,%fp3	| ...Q1+S(Q2+S(Q3+SQ4))
-	fmulx		%fp1,%fp2	 	| ...RS(P1+S(P2+SP3))
+	fmulx		%fp1,%fp2		| ...RS(P1+S(P2+SP3))
+
+	fmulx		%fp3,%fp0		| ...S(Q1+S(Q2+S(Q3+SQ4)))
 
-	fmulx		%fp3,%fp0	 	| ...S(Q1+S(Q2+S(Q3+SQ4)))
-	
 
-	faddx		%fp2,%fp1	 	| ...R+RS(P1+S(P2+SP3))
+	faddx		%fp2,%fp1		| ...R+RS(P1+S(P2+SP3))
 	fadds		#0x3F800000,%fp0	| ...1+S(Q1+...)
-	
+
 
 	fmovex		%fp1,-(%sp)
 	eoril		#0x80000000,(%sp)
 
-	fmovel		%d1,%fpcr	 	|restore users exceptions
+	fmovel		%d1,%fpcr		|restore users exceptions
 	fdivx		(%sp)+,%fp0	|last inst - possible exception set
 
 	bra		t_frcinx
@@ -397,7 +397,7 @@ WORK:
         movew		%d2,FP_SCR2(%a6)
 	clrw           FP_SCR2+2(%a6)
 	movel		#0xC90FDAA2,FP_SCR2+4(%a6)
-	clrl		FP_SCR2+8(%a6)		| ...FP_SCR2 is  2**(L) * Piby2_1	
+	clrl		FP_SCR2+8(%a6)		| ...FP_SCR2 is  2**(L) * Piby2_1
 
 |--FP2 IS READY
 	fsubs		TWOTO63(%a6),%fp2		| ...FP2 is N
@@ -445,7 +445,7 @@ RESTORE:
 	movel		(%a7)+,%d2
 	fmovemx	(%a7)+,%fp2-%fp5
 
-	
+
 	movel		N(%a6),%d0
         rorl		#1,%d0
 
diff --git a/arch/m68k/fpsp040/stanh.S b/arch/m68k/fpsp040/stanh.S
index 889915f9c..33b009802 100644
--- a/arch/m68k/fpsp040/stanh.S
+++ b/arch/m68k/fpsp040/stanh.S
@@ -49,14 +49,14 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |STANH	idnt	2,1 | Motorola 040 Floating Point Software Package
 
 	|section	8
-	
+
 #include "fpsp.h"
 
 	.set	X,FP_SCR5
@@ -106,7 +106,7 @@ stanh:
 	movel		%d1,-(%a7)
 	clrl		%d1
 	fmovemx	%fp0-%fp0,(%a0)
-	bsr		setoxm1	 	| ...FP0 IS Z = EXPM1(Y)
+	bsr		setoxm1		| ...FP0 IS Z = EXPM1(Y)
 	movel		(%a7)+,%d1
 
 	fmovex		%fp0,%fp1
@@ -149,7 +149,7 @@ TANHBORS:
 
 	eorl		#0xC0000000,%d0	| ...-SIGN(X)*2
 	fmoves		%d0,%fp1		| ...-SIGN(X)*2 IN SGL FMT
-	fdivx		%fp0,%fp1	 	| ...-SIGN(X)2 / [EXP(Y)+1 ]
+	fdivx		%fp0,%fp1		| ...-SIGN(X)2 / [EXP(Y)+1 ]
 
 	movel		SGN(%a6),%d0
 	orl		#0x3F800000,%d0	| ...SGN
diff --git a/arch/m68k/fpsp040/sto_res.S b/arch/m68k/fpsp040/sto_res.S
index c3996adc3..0cdca3b06 100644
--- a/arch/m68k/fpsp040/sto_res.S
+++ b/arch/m68k/fpsp040/sto_res.S
@@ -5,9 +5,9 @@
 |	Library functions return result in fp0.	If fp0 is not the
 |	users destination register then fp0 is moved to the
 |	correct floating-point destination register.  fp0 and fp1
-|	are then restored to the original contents. 
+|	are then restored to the original contents.
 |
-|	Input:	result in fp0,fp1 
+|	Input:	result in fp0,fp1
 |
 |		d2 & a0 should be kept unmodified
 |
@@ -19,8 +19,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 STO_RES:	|idnt	2,1 | Motorola 040 Floating Point Software Package
diff --git a/arch/m68k/fpsp040/stwotox.S b/arch/m68k/fpsp040/stwotox.S
index 5d5d75d2f..4e3c1407d 100644
--- a/arch/m68k/fpsp040/stwotox.S
+++ b/arch/m68k/fpsp040/stwotox.S
@@ -76,8 +76,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |STWOTOX	idnt	2,1 | Motorola 040 Floating Point Software Package
@@ -222,17 +222,17 @@ TWOOK1:
 	cmpil		#0x400D80C0,%d0		| ...|X| > 16480?
 	bles		TWOMAIN
 	bra		EXPBORS
-	
+
 
 TWOMAIN:
 |--USUAL CASE, 2^(-70) <= |X| <= 16480
 
 	fmovex		%fp0,%fp1
 	fmuls		#0x42800000,%fp1  | ...64 * X
-	
+
 	fmovel		%fp1,N(%a6)		| ...N = ROUND-TO-INT(64 X)
 	movel		%d2,-(%sp)
-	lea		EXPTBL,%a1 	| ...LOAD ADDRESS OF TABLE OF 2^(J/64)
+	lea		EXPTBL,%a1	| ...LOAD ADDRESS OF TABLE OF 2^(J/64)
 	fmovel		N(%a6),%fp1		| ...N --> FLOATING FMT
 	movel		N(%a6),%d0
 	movel		%d0,%d2
@@ -244,7 +244,7 @@ TWOMAIN:
 	asrl		#1,%d0		| ...D0 IS M
 	subl		%d0,%d2		| ...d2 IS M', N = 64(M+M') + J
 	addil		#0x3FFF,%d2
-	movew		%d2,ADJFACT(%a6) 	| ...ADJFACT IS 2^(M')
+	movew		%d2,ADJFACT(%a6)	| ...ADJFACT IS 2^(M')
 	movel		(%sp)+,%d2
 |--SUMMARY: a1 IS ADDRESS FOR THE LEADING PORTION OF 2^(J/64),
 |--D0 IS M WHERE N = 64(M+M') + J. NOTE THAT |M| <= 16140 BY DESIGN.
@@ -258,13 +258,13 @@ TWOMAIN:
 	movew		(%a1)+,FACT2(%a6)
 	clrw		FACT2+2(%a6)
 
-	fsubx		%fp1,%fp0	 	| ...X - (1/64)*INT(64 X)
+	fsubx		%fp1,%fp0		| ...X - (1/64)*INT(64 X)
 
 	movew		(%a1)+,FACT2HI(%a6)
 	clrw		FACT2HI+2(%a6)
 	clrl		FACT2LOW(%a6)
 	addw		%d0,FACT1(%a6)
-	
+
 	fmulx		LOG2,%fp0	| ...FP0 IS R
 	addw		%d0,FACT2(%a6)
 
@@ -332,10 +332,10 @@ TENMAIN:
 
 	fmovex		%fp0,%fp1
 	fmuld		L2TEN64,%fp1	| ...X*64*LOG10/LOG2
-	
+
 	fmovel		%fp1,N(%a6)		| ...N=INT(X*64*LOG10/LOG2)
 	movel		%d2,-(%sp)
-	lea		EXPTBL,%a1 	| ...LOAD ADDRESS OF TABLE OF 2^(J/64)
+	lea		EXPTBL,%a1	| ...LOAD ADDRESS OF TABLE OF 2^(J/64)
 	fmovel		N(%a6),%fp1		| ...N --> FLOATING FMT
 	movel		N(%a6),%d0
 	movel		%d0,%d2
@@ -347,7 +347,7 @@ TENMAIN:
 	asrl		#1,%d0		| ...D0 IS M
 	subl		%d0,%d2		| ...d2 IS M', N = 64(M+M') + J
 	addil		#0x3FFF,%d2
-	movew		%d2,ADJFACT(%a6) 	| ...ADJFACT IS 2^(M')
+	movew		%d2,ADJFACT(%a6)	| ...ADJFACT IS 2^(M')
 	movel		(%sp)+,%d2
 
 |--SUMMARY: a1 IS ADDRESS FOR THE LEADING PORTION OF 2^(J/64),
@@ -375,7 +375,7 @@ TENMAIN:
 	clrl		FACT2LOW(%a6)
 
 	fmulx		LOG10,%fp0	| ...FP0 IS R
-	
+
 	addw		%d0,FACT1(%a6)
 	addw		%d0,FACT2(%a6)
 
@@ -405,9 +405,9 @@ expr:
 
 	fmulx		%fp1,%fp2		| ...FP2 IS S*(A1+S*(A3+S*A5))
 	faddx		%fp3,%fp0		| ...FP0 IS R+R*S*(A2+S*A4)
-	
+
 	faddx		%fp2,%fp0		| ...FP0 IS EXP(R) - 1
-	
+
 
 |--FINAL RECONSTRUCTION PROCESS
 |--EXP(X) = 2^M*2^(J/64) + 2^M*2^(J/64)*(EXP(R)-1)  -  (1 OR 0)
diff --git a/arch/m68k/fpsp040/tbldo.S b/arch/m68k/fpsp040/tbldo.S
index b80bef99e..fe60cf4d2 100644
--- a/arch/m68k/fpsp040/tbldo.S
+++ b/arch/m68k/fpsp040/tbldo.S
@@ -6,19 +6,19 @@
 |			of indirection in do_func for monadic
 |			functions.  Dyadic functions require two
 |			levels, and the tables are still contained
-|			in do_func.  The table is arranged for 
+|			in do_func.  The table is arranged for
 |			index with a 10-bit index, with the first
 |			7 bits the opcode, and the remaining 3
 |			the stag.  For dyadic functions, all
 |			valid addresses are to the generic entry
-|			point. 
+|			point.
 |
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |TBLDO	idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -57,7 +57,7 @@ tblpre:
 	.long	smovcr		|$00-7 fmovecr all
 
 	.long	sint		|$01-0 fint norm
-	.long	szero		|$01-1 fint zero 
+	.long	szero		|$01-1 fint zero
 	.long	sinf		|$01-2 fint inf
 	.long	src_nan		|$01-3 fint nan
 	.long	sintd		|$01-4 fint denorm inx
diff --git a/arch/m68k/fpsp040/util.S b/arch/m68k/fpsp040/util.S
index 009eeb15d..452f3d658 100644
--- a/arch/m68k/fpsp040/util.S
+++ b/arch/m68k/fpsp040/util.S
@@ -4,20 +4,20 @@
 |	This file contains routines used by other programs.
 |
 |	ovf_res: used by overflow to force the correct
-|		 result. ovf_r_k, ovf_r_x2, ovf_r_x3 are 
+|		 result. ovf_r_k, ovf_r_x2, ovf_r_x3 are
 |		 derivatives of this routine.
 |	get_fline: get user's opcode word
 |	g_dfmtou: returns the destination format.
 |	g_opcls: returns the opclass of the float instruction.
-|	g_rndpr: returns the rounding precision. 
+|	g_rndpr: returns the rounding precision.
 |	reg_dest: write byte, word, or long data to Dn
 |
 |
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 |UTIL	idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -39,13 +39,13 @@
 | are unnecessary as ovf_res always returns the sign separately from
 | the exponent.
 |					;+inf
-EXT_PINF:	.long	0x7fff0000,0x00000000,0x00000000,0x00000000	
+EXT_PINF:	.long	0x7fff0000,0x00000000,0x00000000,0x00000000
 |					;largest +ext
-EXT_PLRG:	.long	0x7ffe0000,0xffffffff,0xffffffff,0x00000000	
+EXT_PLRG:	.long	0x7ffe0000,0xffffffff,0xffffffff,0x00000000
 |					;largest magnitude +sgl in ext
-SGL_PLRG:	.long	0x407e0000,0xffffff00,0x00000000,0x00000000	
+SGL_PLRG:	.long	0x407e0000,0xffffff00,0x00000000,0x00000000
 |					;largest magnitude +dbl in ext
-DBL_PLRG:	.long	0x43fe0000,0xffffffff,0xfffff800,0x00000000	
+DBL_PLRG:	.long	0x43fe0000,0xffffffff,0xfffff800,0x00000000
 |					;largest -ext
 
 tblovfl:
@@ -70,7 +70,7 @@ tblovfl:
 |
 |	ovf_r_k --- overflow result calculation
 |
-| This entry point is used by kernel_ex.  
+| This entry point is used by kernel_ex.
 |
 | This forces the destination precision to be extended
 |
@@ -79,7 +79,7 @@ tblovfl:
 |
 	.global	ovf_r_k
 ovf_r_k:
-	lea	ETEMP(%a6),%a0	|a0 points to source operand	
+	lea	ETEMP(%a6),%a0	|a0 points to source operand
 	bclrb	#sign_bit,ETEMP_EX(%a6)
 	sne	ETEMP_SGN(%a6)	|convert to internal IEEE format
 
@@ -112,10 +112,10 @@ ovf_e3_exc:
 	beql	ovff_dbl		|force precision is double
 	movew	CMDREG3B(%a6),%d0		|get the command word again
 	andil	#0x7f,%d0			|clear all except operation
-	cmpil	#0x33,%d0			
+	cmpil	#0x33,%d0
 	beql	ovf_fsgl		|fsglmul or fsgldiv
 	cmpil	#0x30,%d0
-	beql	ovf_fsgl		
+	beql	ovf_fsgl
 	bra	ovf_fpcr		|instruction is none of the above
 |					;use FPCR
 ovf_e1_exc:
@@ -129,10 +129,10 @@ ovf_e1_exc:
 	andil	#0x0000007f,%d0		|clear all except the op code
 	cmpil	#0x00000027,%d0
 	beql	ovf_fsgl		|fsglmul
-	cmpil 	#0x00000024,%d0
+	cmpil	#0x00000024,%d0
 	beql	ovf_fsgl		|fsgldiv
 	bra	ovf_fpcr		|none of the above, use FPCR
-| 
+|
 |
 | Inst is either fsgldiv or fsglmul.  Force extended precision.
 |
@@ -152,7 +152,7 @@ ovff_dbl:
 ovf_fpcr:
 	bfextu	FPCR_MODE(%a6){#0:#2},%d0 |set round precision
 	bra	ovf_res
-	
+
 |
 |
 |	ovf_r_x3 --- overflow result calculation
@@ -174,9 +174,9 @@ ovf_r_x3:
 |	ovf_res --- overflow result calculation
 |
 | Input:
-|	a0 	points to operand in internal extended format
+|	a0	points to operand in internal extended format
 | Output:
-|	a0 	points to result in internal extended format
+|	a0	points to result in internal extended format
 |
 	.global	ovf_res
 ovf_res:
@@ -192,7 +192,7 @@ ovf_res:
 EXT_RN:
 	leal	EXT_PINF,%a1	|answer is +/- infinity
 	bsetb	#inf_bit,FPSR_CC(%a6)
-	bra	set_sign	|now go set the sign	
+	bra	set_sign	|now go set the sign
 EXT_RZ:
 	leal	EXT_PLRG,%a1	|answer is +/- large number
 	bra	set_sign	|now go set the sign
@@ -312,10 +312,10 @@ get_fline:
 	movel	(%a7)+,%d0
 	rts
 |
-| 	g_rndpr --- put rounding precision in d0{1:0}
-|	
+|	g_rndpr --- put rounding precision in d0{1:0}
+|
 |	valid return codes are:
-|		00 - extended 
+|		00 - extended
 |		01 - single
 |		10 - double
 |
@@ -350,7 +350,7 @@ g_rndpr:
 | For move out instructions (opclass 011) the destination format
 | is the same as the rounding precision.  Pass results from g_dfmtou.
 |
-	bsr 	g_dfmtou	
+	bsr	g_dfmtou
 	rts
 op_0x0:
 	btstb	#E3,E_BYTE(%a6)
@@ -364,7 +364,7 @@ unf_e3_exc:
 	beql	unff_dbl
 	movew	CMDREG3B(%a6),%d0	|get the command word again
 	andil	#0x7f,%d0		|clear all except operation
-	cmpil	#0x33,%d0			
+	cmpil	#0x33,%d0
 	beql	unf_fsgl	|fsglmul or fsgldiv
 	cmpil	#0x30,%d0
 	beql	unf_fsgl	|fsgldiv or fsglmul
@@ -408,7 +408,7 @@ unff_dbl:
 | Force extended
 |
 unf_fsgl:
-	movel	#0,%d0		
+	movel	#0,%d0
 	rts
 |
 | Get rounding precision set in FPCR{7:6}.
@@ -436,7 +436,7 @@ opc_1b:
 |	If E1, the format is from cmdreg1b{12:10}
 |	If E3, the format is extended.
 |
-|	Dest. Fmt.	
+|	Dest. Fmt.
 |		extended  010 -> 00
 |		single    001 -> 01
 |		double    101 -> 10
@@ -468,26 +468,26 @@ not_dbl:
 | are unnecessary as unf_sub always returns the sign separately from
 | the exponent.
 |					;+zero
-EXT_PZRO:	.long	0x00000000,0x00000000,0x00000000,0x00000000	
+EXT_PZRO:	.long	0x00000000,0x00000000,0x00000000,0x00000000
 |					;+zero
-SGL_PZRO:	.long	0x3f810000,0x00000000,0x00000000,0x00000000	
+SGL_PZRO:	.long	0x3f810000,0x00000000,0x00000000,0x00000000
 |					;+zero
-DBL_PZRO:	.long	0x3c010000,0x00000000,0x00000000,0x00000000	
+DBL_PZRO:	.long	0x3c010000,0x00000000,0x00000000,0x00000000
 |					;smallest +ext denorm
-EXT_PSML:	.long	0x00000000,0x00000000,0x00000001,0x00000000	
+EXT_PSML:	.long	0x00000000,0x00000000,0x00000001,0x00000000
 |					;smallest +sgl denorm
-SGL_PSML:	.long	0x3f810000,0x00000100,0x00000000,0x00000000	
+SGL_PSML:	.long	0x3f810000,0x00000100,0x00000000,0x00000000
 |					;smallest +dbl denorm
-DBL_PSML:	.long	0x3c010000,0x00000000,0x00000800,0x00000000	
+DBL_PSML:	.long	0x3c010000,0x00000000,0x00000800,0x00000000
 |
 |	UNF_SUB --- underflow result calculation
 |
 | Input:
-|	d0 	contains round precision
+|	d0	contains round precision
 |	a0	points to input operand in the internal extended format
 |
 | Output:
-|	a0 	points to correct internal extended precision result.
+|	a0	points to correct internal extended precision result.
 |
 
 tblunf:
@@ -522,7 +522,7 @@ unf_sub:
 uEXT_RN:
 	leal	EXT_PZRO,%a1	|answer is +/- zero
 	bsetb	#z_bit,FPSR_CC(%a6)
-	bra	uset_sign	|now go set the sign	
+	bra	uset_sign	|now go set the sign
 uEXT_RZ:
 	leal	EXT_PZRO,%a1	|answer is +/- zero
 	bsetb	#z_bit,FPSR_CC(%a6)
@@ -629,7 +629,7 @@ end_unfr:
 |
 |
 | Input:
-|	L_SCR1: Data 
+|	L_SCR1: Data
 |	d1:     data size and dest register number formatted as:
 |
 |	32		5    4     3     2     1     0
diff --git a/arch/m68k/fpsp040/x_bsun.S b/arch/m68k/fpsp040/x_bsun.S
index 751c98bf1..039247b09 100644
--- a/arch/m68k/fpsp040/x_bsun.S
+++ b/arch/m68k/fpsp040/x_bsun.S
@@ -13,8 +13,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_BSUN:	|idnt    2,1 | Motorola 040 Floating Point Software Package
diff --git a/arch/m68k/fpsp040/x_fline.S b/arch/m68k/fpsp040/x_fline.S
index 8eb55c8dc..3917710b0 100644
--- a/arch/m68k/fpsp040/x_fline.S
+++ b/arch/m68k/fpsp040/x_fline.S
@@ -13,8 +13,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_FLINE:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -52,7 +52,7 @@ fpsp_fline:
 	leal	L_SCR1(%a6),%a1	|use L_SCR1 as scratch
 	movel	#4,%d0
 	addl	#4,%a6		|to offset the sub.l #4,a7 above so that
-|				;a6 can point correctly to the stack frame 
+|				;a6 can point correctly to the stack frame
 |				;before branching to mem_read
 	bsrl	mem_read
 	subl	#4,%a6
@@ -62,7 +62,7 @@ fpsp_fline:
 	bne	not_mvcr	|exit if not
 	bfextu	%d0{#16:#6},%d1
 	cmpib	#0x17,%d1		|check if it is an FMOVECR encoding
-	bne	not_mvcr	
+	bne	not_mvcr
 |				;if an FMOVECR instruction, fix stack
 |				;and go to FPSP_UNIMP
 fix_stack:
diff --git a/arch/m68k/fpsp040/x_operr.S b/arch/m68k/fpsp040/x_operr.S
index 526e6a3f1..b0f54bcb4 100644
--- a/arch/m68k/fpsp040/x_operr.S
+++ b/arch/m68k/fpsp040/x_operr.S
@@ -13,8 +13,8 @@
 | the dest format is integer (b, w, l) and the operr is caused by
 | integer overflow, or the source op is inf, then the result stored is
 | garbage.
-| There are three cases in which operr is incorrectly signaled on the 
-| 040.  This occurs for move_out of format b, w, or l for the largest 
+| There are three cases in which operr is incorrectly signaled on the
+| 040.  This occurs for move_out of format b, w, or l for the largest
 | negative integer (-2^7 for b, -2^15 for w, -2^31 for l).
 |
 |	  On opclass = 011 fmove.(b,w,l) that causes a conversion
@@ -36,15 +36,15 @@
 | Note 2: For trap enabled 040 does the following:
 | If the inst is move_out, then same as Note 1.
 | If the inst is not move_out, the dest is not modified.
-| The exceptional operand is not defined for integer overflow 
+| The exceptional operand is not defined for integer overflow
 | during a move_out.
 |
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_OPERR:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -77,7 +77,7 @@ fpsp_operr:
 	beqs	operr_end
 
 |
-| If the destination size is B,W,or L, the operr must be 
+| If the destination size is B,W,or L, the operr must be
 | handled here.
 |
 	movel	CMDREG1B(%a6),%d0
@@ -90,9 +90,9 @@ fpsp_operr:
 	beq	operr_byte
 
 |
-| The size is not B,W,or L, so the operr is handled by the 
+| The size is not B,W,or L, so the operr is handled by the
 | kernel handler.  Set the operr bits and clean up, leaving
-| only the integer exception frame on the stack, and the 
+| only the integer exception frame on the stack, and the
 | fpu in the original exceptional state.
 |
 operr_end:
@@ -111,7 +111,7 @@ operr_long:
 	moveb	STAG(%a6),%d0	|test stag for nan
 	andib	#0xe0,%d0		|clr all but tag
 	cmpib	#0x60,%d0		|check for nan
-	beq	operr_nan	
+	beq	operr_nan
 	cmpil	#0x80000000,FPTEMP_LO(%a6) |test if ls lword is special
 	bnes	chklerr		|if not equal, check for incorrect operr
 	bsr	check_upper	|check if exp and ms mant are special
@@ -158,7 +158,7 @@ operr_word:
 	moveb	STAG(%a6),%d0	|test stag for nan
 	andib	#0xe0,%d0		|clr all but tag
 	cmpib	#0x60,%d0		|check for nan
-	beq	operr_nan	
+	beq	operr_nan
 	cmpil	#0xffff8000,FPTEMP_LO(%a6) |test if ls lword is special
 	bnes	chkwerr		|if not equal, check for incorrect operr
 	bsr	check_upper	|check if exp and ms mant are special
@@ -185,7 +185,7 @@ operr_byte:
 	moveb	STAG(%a6),%d0	|test stag for nan
 	andib	#0xe0,%d0		|clr all but tag
 	cmpib	#0x60,%d0		|check for nan
-	beqs	operr_nan	
+	beqs	operr_nan
 	cmpil	#0xffffff80,FPTEMP_LO(%a6) |test if ls lword is special
 	bnes	chkberr		|if not equal, check for incorrect operr
 	bsr	check_upper	|check if exp and ms mant are special
@@ -229,7 +229,7 @@ store_max:
 	bclrb	#inex2_bit,FPSR_EXCEPT(%a6)
 	bclrb	#ainex_bit,FPSR_AEXCEPT(%a6)
 	fmovel	#0,%FPSR
-	
+
 	tstw	FPTEMP_EX(%a6)	|check sign
 	blts	load_neg
 	movel	#0x7fffffff,%d0
@@ -280,7 +280,7 @@ dest_mem:
 	bsrl	mem_write
 	rts
 |
-| Check the exponent for $c000 and the upper 32 bits of the 
+| Check the exponent for $c000 and the upper 32 bits of the
 | mantissa for $ffffffff.  If both are true, return d0 clr
 | and store the lower n bits of the least lword of FPTEMP
 | to d0 for write out.  If not, it is a real operr, and set d0.
diff --git a/arch/m68k/fpsp040/x_ovfl.S b/arch/m68k/fpsp040/x_ovfl.S
index 61ab8cc00..22cb8b42c 100644
--- a/arch/m68k/fpsp040/x_ovfl.S
+++ b/arch/m68k/fpsp040/x_ovfl.S
@@ -8,7 +8,7 @@
 |	or when storing to memory, the contents of a floating-point
 |	data register are too large to be represented in the
 |	destination format.
-|		
+|
 | Trap disabled results
 |
 | If the instruction is move_out, then garbage is stored in the
@@ -35,8 +35,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_OVFL:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -73,7 +73,7 @@ fpsp_ovfl:
 |	if overflow traps not enabled check for inexact exception
 |
 	btstb	#ovfl_bit,FPCR_ENABLE(%a6)
-	beqs	ck_inex	
+	beqs	ck_inex
 |
 	btstb		#E3,E_BYTE(%a6)
 	beqs		no_e3_1
@@ -120,7 +120,7 @@ no_e3_2:
 	frestore	(%a7)+
 	unlk		%a6
 	bral		real_inex
-	
+
 ovfl_exit:
 	bclrb	#E3,E_BYTE(%a6)	|test and clear E3 bit
 	beqs	e1_set
@@ -152,7 +152,7 @@ e1_set:
 |
 ovf_adj:
 |
-| Have a0 point to the correct operand. 
+| Have a0 point to the correct operand.
 |
 	btstb	#E3,E_BYTE(%a6)	|test E3 bit
 	beqs	ovf_e1
@@ -175,10 +175,10 @@ ovf_com:
 | CCs are defined to be 'not affected' for the opclass3 instruction.
 |
 	moveb	FPSR_CC(%a6),L_SCR1(%a6)
- 	bsrl	ovf_r_x3	|returns a0 pointing to result
+	bsrl	ovf_r_x3	|returns a0 pointing to result
 	moveb	L_SCR1(%a6),FPSR_CC(%a6)
 	bral	store		|stores to memory or register
-	
+
 not_opc011:
 	bsrl	ovf_r_x2	|returns a0 pointing to result
 	bral	store		|stores to memory or register
diff --git a/arch/m68k/fpsp040/x_snan.S b/arch/m68k/fpsp040/x_snan.S
index 29b966288..039af5733 100644
--- a/arch/m68k/fpsp040/x_snan.S
+++ b/arch/m68k/fpsp040/x_snan.S
@@ -14,7 +14,7 @@
 | of the mantissa are sent to the integer unit).
 |
 | For trap enabled the 040 does the following:
-| If the inst is move_out, then the results are the same as for trap 
+| If the inst is move_out, then the results are the same as for trap
 | disabled with the exception posted.  If the instruction is not move_
 | out, the dest. is not modified, and the exception is posted.
 |
@@ -22,8 +22,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_SNAN:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -139,7 +139,7 @@ loop2:
 	bral		fpsp_done
 
 |
-| Move_out 
+| Move_out
 |
 move_out:
 	movel		EXC_EA(%a6),%a0	|get <ea> from exc frame
@@ -147,18 +147,18 @@ move_out:
 	bfextu		CMDREG1B(%a6){#3:#3},%d0 |move rx field to d0{2:0}
 	cmpil		#0,%d0		|check for long
 	beqs		sto_long	|branch if move_out long
-	
+
 	cmpil		#4,%d0		|check for word
 	beqs		sto_word	|branch if move_out word
-	
+
 	cmpil		#6,%d0		|check for byte
 	beqs		sto_byte	|branch if move_out byte
-	
+
 |
 | Not byte, word or long
 |
 	rts
-|	
+|
 | Get the 32 most significant bits of etemp mantissa
 |
 sto_long:
@@ -167,13 +167,13 @@ sto_long:
 |
 | Set signalling nan bit
 |
-	bsetl		#30,%d1			
+	bsetl		#30,%d1
 |
 | Store to the users destination address
 |
 	tstl		%a0		|check if <ea> is 0
 	beqs		wrt_dn		|destination is a data register
-	
+
 	movel		%d1,-(%a7)	|move the snan onto the stack
 	movel		%a0,%a1		|load dest addr into a1
 	movel		%a7,%a0		|load src addr of snan into a0
@@ -189,7 +189,7 @@ sto_word:
 |
 | Set signalling nan bit
 |
-	bsetl		#30,%d1			
+	bsetl		#30,%d1
 |
 | Store to the users destination address
 |
@@ -211,7 +211,7 @@ sto_byte:
 |
 | Set signalling nan bit
 |
-	bsetl		#30,%d1			
+	bsetl		#30,%d1
 |
 | Store to the users destination address
 |
@@ -253,7 +253,7 @@ wrt_byte:
 | Check if it is a src nan or dst nan
 |
 not_out:
-	movel		DTAG(%a6),%d0	
+	movel		DTAG(%a6),%d0
 	bfextu		%d0{#0:#3},%d0	|isolate dtag in lsbs
 
 	cmpib		#3,%d0		|check for nan in destination
diff --git a/arch/m68k/fpsp040/x_store.S b/arch/m68k/fpsp040/x_store.S
index 4c407057a..4282fa67d 100644
--- a/arch/m68k/fpsp040/x_store.S
+++ b/arch/m68k/fpsp040/x_store.S
@@ -11,8 +11,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_STORE:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -54,7 +54,7 @@ is_pos:
 |	in the USER_FPn variable on the stack because all exception
 |	handlers restore fp0-fp3 from there.
 |
-	cmpb	#0x80,%d0		
+	cmpb	#0x80,%d0
 	bnes	not_fp0
 	fmovemx %fp0-%fp0,USER_FP0(%a6)
 	rts
@@ -115,18 +115,18 @@ opc011:
 |	get rid of ext integer bit
 |	dbl_mant = ext_mant{62:12}
 |
-|	    	---------------   ---------------    ---------------
+|		---------------   ---------------    ---------------
 |  extended ->  |s|    exp    |   |1| ms mant   |    | ls mant     |
-|	    	---------------   ---------------    ---------------
-|	   	 95	    64    63 62	      32      31     11	  0
+|		---------------   ---------------    ---------------
+|		 95	    64    63 62	      32      31     11	  0
 |				     |			     |
 |				     |			     |
 |				     |			     |
-|		 	             v   		     v
-|	    		      ---------------   ---------------
-|  double   ->  	      |s|exp| mant  |   |  mant       |
-|	    		      ---------------   ---------------
-|	   	 	      63     51   32   31	       0
+|			             v			     v
+|			      ---------------   ---------------
+|  double   ->		      |s|exp| mant  |   |  mant       |
+|			      ---------------   ---------------
+|			      63     51   32   31	       0
 |
 dest_dbl:
 	clrl	%d0		|clear d0
@@ -137,7 +137,7 @@ dest_dbl:
 	addw	#0x3ff,%d0	|add double precision bias
 	swap	%d0		|d0 now in upper word
 	lsll	#4,%d0		|d0 now in proper place for dbl prec exp
-	tstb	LOCAL_SGN(%a1)	
+	tstb	LOCAL_SGN(%a1)
 	beqs	get_mant	|if positive, go process mantissa
 	bsetl	#31,%d0		|if negative, put in sign information
 |				; before continuing
@@ -186,18 +186,18 @@ dbl_wrt:
 |	get rid of ext integer bit
 |	sgl_mant = ext_mant{62:12}
 |
-|	    	---------------   ---------------    ---------------
+|		---------------   ---------------    ---------------
 |  extended ->  |s|    exp    |   |1| ms mant   |    | ls mant     |
-|	    	---------------   ---------------    ---------------
-|	   	 95	    64    63 62	   40 32      31     12	  0
+|		---------------   ---------------    ---------------
+|		 95	    64    63 62	   40 32      31     12	  0
 |				     |	   |
 |				     |	   |
 |				     |	   |
-|		 	             v     v
-|	    		      ---------------
-|  single   ->  	      |s|exp| mant  |
-|	    		      ---------------
-|	   	 	      31     22     0
+|			             v     v
+|			      ---------------
+|  single   ->		      |s|exp| mant  |
+|			      ---------------
+|			      31     22     0
 |
 dest_sgl:
 	clrl	%d0
@@ -208,7 +208,7 @@ dest_sgl:
 	addw	#0x7f,%d0		|add single precision bias
 	swap	%d0		|put exp in upper word of d0
 	lsll	#7,%d0		|shift it into single exp bits
-	tstb	LOCAL_SGN(%a1)	
+	tstb	LOCAL_SGN(%a1)
 	beqs	get_sman	|if positive, continue
 	bsetl	#31,%d0		|if negative, put in sign first
 	bras	get_sman	|get mantissa
@@ -240,7 +240,7 @@ sgl_Dn:
 	orl	#0x10,%d1		|reg_dest wants size added to reg#
 	bral	reg_dest	|size is X, rts in reg_dest will
 |				;return to caller of dest_sgl
-	
+
 dest_ext:
 	tstb	LOCAL_SGN(%a1)	|put back sign into exponent word
 	beqs	dstx_cont
diff --git a/arch/m68k/fpsp040/x_unfl.S b/arch/m68k/fpsp040/x_unfl.S
index b64dd9983..077fcc230 100644
--- a/arch/m68k/fpsp040/x_unfl.S
+++ b/arch/m68k/fpsp040/x_unfl.S
@@ -4,25 +4,25 @@
 |	fpsp_unfl --- FPSP handler for underflow exception
 |
 | Trap disabled results
-|	For 881/2 compatibility, sw must denormalize the intermediate 
-| result, then store the result.  Denormalization is accomplished 
-| by taking the intermediate result (which is always normalized) and 
-| shifting the mantissa right while incrementing the exponent until 
-| it is equal to the denormalized exponent for the destination 
-| format.  After denormalization, the result is rounded to the 
+|	For 881/2 compatibility, sw must denormalize the intermediate
+| result, then store the result.  Denormalization is accomplished
+| by taking the intermediate result (which is always normalized) and
+| shifting the mantissa right while incrementing the exponent until
+| it is equal to the denormalized exponent for the destination
+| format.  After denormalization, the result is rounded to the
 | destination format.
-|		
+|
 | Trap enabled results
-| 	All trap disabled code applies.	In addition the exceptional 
-| operand needs to made available to the user with a bias of $6000 
+|	All trap disabled code applies.	In addition the exceptional
+| operand needs to made available to the user with a bias of $6000
 | added to the exponent.
 |
 
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_UNFL:	|idnt    2,1 | Motorola 040 Floating Point Software Package
@@ -91,7 +91,7 @@ ck_inex:
 
 |
 | Inexact enabled and reported, and we must take an inexact exception
-|	
+|
 take_inex:
 	btstb		#E3,E_BYTE(%a6)
 	beqs		no_e3_2
@@ -145,7 +145,7 @@ unf_res:
 |					;1=sgl, 2=dbl
 |					;we need the RND_PREC in the
 |					;upper word for round
-	movew		#0,-(%a7)	
+	movew		#0,-(%a7)
 	movew		%d0,-(%a7)	|copy RND_PREC to stack
 |
 |
@@ -199,7 +199,7 @@ unf_cont:
 | must not corrupt a0 and d0.
 |
 |
-| Perform Round	
+| Perform Round
 |	Input:		a0 points to input operand
 |			d0{31:29} has guard, round, sticky
 |			d1{01:00} has rounding mode
@@ -222,7 +222,7 @@ opc011:
 	bsrl		g_dfmtou
 	tstb		%d0
 	beqs		ext_opc011	|If extended, do not subtract
-| 				;If destination format is sgl/dbl, 
+|				;If destination format is sgl/dbl,
 	tstb		LOCAL_HI(%a0)	|If rounded result is normal,don't
 |					;subtract
 	bmis		ext_opc011
@@ -252,12 +252,12 @@ not_opc011:
 	bnes		ck_sgn
 	bsetb		#z_bit,FPSR_CC(%a6) |set condition codes if zero
 ck_sgn:
-	btstb 		#sign_bit,LOCAL_EX(%a0)	|check the sign bit
+	btstb		#sign_bit,LOCAL_EX(%a0)	|check the sign bit
 	beqs		unf_done
 	bsetb		#neg_bit,FPSR_CC(%a6)
 
 |
-| Finish.  
+| Finish.
 |
 unf_done:
 	btstb		#inex2_bit,FPSR_EXCEPT(%a6)
diff --git a/arch/m68k/fpsp040/x_unimp.S b/arch/m68k/fpsp040/x_unimp.S
index 6c561dfcf..920cb9410 100644
--- a/arch/m68k/fpsp040/x_unimp.S
+++ b/arch/m68k/fpsp040/x_unimp.S
@@ -1,14 +1,14 @@
 |
 |	x_unimp.sa 3.3 7/1/91
 |
-|	fpsp_unimp --- FPSP handler for unimplemented instruction	
+|	fpsp_unimp --- FPSP handler for unimplemented instruction
 |	exception.
 |
 | Invoked when the user program encounters a floating-point
 | op-code that hardware does not support.  Trap vector# 11
 | (See table 8-1 MC68030 User's Manual).
 |
-| 
+|
 | Note: An fsave for an unimplemented inst. will create a short
 | fsave stack.
 |
@@ -22,8 +22,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_UNIMP:	|idnt    2,1 | Motorola 040 Floating Point Software Package
diff --git a/arch/m68k/fpsp040/x_unsupp.S b/arch/m68k/fpsp040/x_unsupp.S
index 894b251da..4ec57285b 100644
--- a/arch/m68k/fpsp040/x_unsupp.S
+++ b/arch/m68k/fpsp040/x_unsupp.S
@@ -3,18 +3,18 @@
 |
 |	fpsp_unsupp --- FPSP handler for unsupported data type exception
 |
-| Trap vector #55	(See table 8-1 Mc68030 User's manual).	
+| Trap vector #55	(See table 8-1 Mc68030 User's manual).
 | Invoked when the user program encounters a data format (packed) that
 | hardware does not support or a data type (denormalized numbers or un-
 | normalized numbers).
-| Normalizes denorms and unnorms, unpacks packed numbers then stores 
-| them back into the machine to let the 040 finish the operation.  
+| Normalizes denorms and unnorms, unpacks packed numbers then stores
+| them back into the machine to let the 040 finish the operation.
 |
 | Unsupp calls two routines:
-| 	1. get_op -  gets the operand(s)
-| 	2. res_func - restore the function back into the 040 or
-| 			if fmove.p fpm,<ea> then pack source (fpm)
-| 			and store in users memory <ea>.
+|	1. get_op -  gets the operand(s)
+|	2. res_func - restore the function back into the 040 or
+|			if fmove.p fpm,<ea> then pack source (fpm)
+|			and store in users memory <ea>.
 |
 |  Input: Long fsave stack frame
 |
@@ -23,8 +23,8 @@
 |		Copyright (C) Motorola, Inc. 1990
 |			All Rights Reserved
 |
-|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 
-|	The copyright notice above does not evidence any  
+|	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
+|	The copyright notice above does not evidence any
 |	actual or intended publication of such source code.
 
 X_UNSUPP:	|idnt    2,1 | Motorola 040 Floating Point Software Package
diff --git a/arch/m68k/hp300/hp300map.map b/arch/m68k/hp300/hp300map.map
index 807d09f5a..6b45f0abc 100644
--- a/arch/m68k/hp300/hp300map.map
+++ b/arch/m68k/hp300/hp300map.map
@@ -3,29 +3,29 @@ keymaps 0-2,4-5,8,12
 # Change the above line into
 #	keymaps 0-2,4-6,8,12
 # in case you want the entries
-#	altgr   control keycode  83 = Boot            
-#	altgr   control keycode 111 = Boot            
+#	altgr   control keycode  83 = Boot
+#	altgr   control keycode 111 = Boot
 # below.
 #
 # In fact AltGr is used very little, and one more keymap can
 # be saved by mapping AltGr to Alt (and adapting a few entries):
 # keycode 100 = Alt
 #
-keycode   1 = 
+keycode   1 =
 keycode   2 = Alt
 keycode   3 = Alt
 keycode   4 = Shift
 keycode   5 = Shift
 keycode   6 = Control
-keycode   7 = 
-keycode   8 = 
-keycode   9 = 
-keycode  10 = 
-keycode  11 = 
-keycode  12 = 
-keycode  13 = 
+keycode   7 =
+keycode   8 =
+keycode   9 =
+keycode  10 =
+keycode  11 =
+keycode  12 =
+keycode  13 =
 keycode  14 =
-keycode  15 = 
+keycode  15 =
 keycode  16 =
 keycode  17 =
 keycode  18 =
@@ -34,12 +34,12 @@ keycode  20 =
 keycode  21 =
 keycode  22 =
 keycode  23 =
-keycode  24 = b               
-keycode  25 = v               
+keycode  24 = b
+keycode  25 = v
 keycode  26 = c
 keycode  27 = x
 keycode  28 = z
-keycode  29 = 
+keycode  29 =
 keycode  30 =
 keycode  31 = Escape		Delete
 keycode  32 =
@@ -55,7 +55,7 @@ keycode  41 = g
 keycode  42 = f
 keycode  43 = d
 keycode  44 = s
-keycode  45 = a               
+keycode  45 = a
 keycode  46 =
 keycode  47 = Caps_Lock
 keycode  48 = u
@@ -65,8 +65,8 @@ keycode  51 = r
 keycode  52 = e
 keycode  53 = w
 keycode  54 = q
-keycode  55 = Tab		Tab             
-	alt     keycode    55 = Meta_Tab        
+keycode  55 = Tab		Tab
+	alt     keycode    55 = Meta_Tab
 keycode  56 = seven		ampersand
 keycode  57 = six		asciicircum
 keycode  58 = five		percent
@@ -74,19 +74,19 @@ keycode  59 = four		dollar
 keycode  60 = three		numbersign
 keycode  61 = two		at		at
 keycode  62 = one		exclam		exclam
-keycode  63 = grave		asciitilde      
-	control keycode    63 = nul             
-	alt     keycode    63 = Meta_grave      
-keycode  64 =        
-keycode  65 = 
-keycode  66 = 
-keycode  67 = 
-keycode  68 = 
-keycode  69 = 
-keycode  70 = 
-keycode  71 = 
+keycode  63 = grave		asciitilde
+	control keycode    63 = nul
+	alt     keycode    63 = Meta_grave
+keycode  64 =
+keycode  65 =
+keycode  66 =
+keycode  67 =
+keycode  68 =
+keycode  69 =
+keycode  70 =
+keycode  71 =
 keycode  72 =
-keycode  73 = F4       
+keycode  73 = F4
 	control keycode	   73 = Console_4
 keycode  74 = F3
 	control keycode	   74 = Console_3
@@ -107,8 +107,8 @@ keycode  83 = F7
 keycode  84 = F8
 	control keycode	   84 = Console_8
 keycode  85 =
-keycode  86 = 
-keycode  87 = 
+keycode  86 =
+keycode  87 =
 keycode  88 = eight		asterisk	asterisk
 keycode  89 = nine		parenleft	bracketleft
 keycode  90 = zero		parenright	bracketright
@@ -122,30 +122,30 @@ keycode  97 = o
 keycode  98 = p
 keycode  99 = bracketleft	braceleft
 keycode 100 = bracketright	braceright
-keycode 101 = backslash		bar             
+keycode 101 = backslash		bar
 	control keycode   101 = Control_backslash
-	alt     keycode   101 = Meta_backslash  
-keycode 102 = 
-keycode 103 = 
+	alt     keycode   101 = Meta_backslash
+keycode 102 =
+keycode 103 =
 keycode 104 = j
 keycode 105 = k
 keycode 106 = l
 keycode 107 = semicolon		colon
-	alt     keycode   107 = Meta_semicolon  
-keycode 108 = apostrophe	quotedbl        
-	control keycode   108 = Control_g       
-	alt     keycode   108 = Meta_apostrophe 
+	alt     keycode   107 = Meta_semicolon
+keycode 108 = apostrophe	quotedbl
+	control keycode   108 = Control_g
+	alt     keycode   108 = Meta_apostrophe
 keycode 109 = Return
-keycode 110 = 
-keycode 111 = 
+keycode 110 =
+keycode 111 =
 keycode 112 = m
 keycode 113 = comma		less
 keycode 114 = period		greater
 keycode 115 = slash		question
-keycode 116 = 
-keycode 117 = 
-keycode 118 = 
-keycode 119 = 
+keycode 116 =
+keycode 117 =
+keycode 118 =
+keycode 119 =
 keycode 120 = n
 keycode 121 = space		space
 keycode 122 =
diff --git a/arch/m68k/hp300/ints.c b/arch/m68k/hp300/ints.c
index 40a2cdcc5..9fe4a9605 100644
--- a/arch/m68k/hp300/ints.c
+++ b/arch/m68k/hp300/ints.c
@@ -29,7 +29,7 @@
  * Service routines are added via hp300_request_irq() and removed
  * via hp300_free_irq(). The device driver should set IRQ_FLG_FAST
  * if it needs to be serviced early (eg FIFOless UARTs); this will
- * cause it to be added at the front of the queue rather than 
+ * cause it to be added at the front of the queue rather than
  * the back.
  * Currently IRQ_FLG_SLOW and flags=0 are treated identically; if
  * we needed three levels of priority we could distinguish them
@@ -52,7 +52,7 @@ static irqreturn_t hp300_int_handler(int irq, void *dev_id, struct pt_regs *fp)
                 t->handler(irq, t->dev_id, fp);
         /* We could put in some accounting routines, checks for stray interrupts,
          * etc, in here. Note that currently we can't tell whether or not
-         * a handler handles the interrupt, though. 
+         * a handler handles the interrupt, though.
          */
 	return IRQ_HANDLED;
 }
@@ -80,7 +80,7 @@ int hp300_request_irq(unsigned int irq,
                       unsigned long flags, const char *devname, void *dev_id)
 {
         irq_node_t *t, *n = new_irq_node();
-        
+
         if (!n)                                   /* oops, no free nodes */
                 return -ENOMEM;
 
@@ -117,7 +117,7 @@ void hp300_free_irq(unsigned int irq, void *dev_id)
         unsigned long flags;
 
         spin_lock_irqsave(&irqlist_lock, flags);
-        
+
         t = hp300_irq_list[irq];
         if (!t)                                   /* no handlers at all for that IRQ */
         {
@@ -125,7 +125,7 @@ void hp300_free_irq(unsigned int irq, void *dev_id)
                 spin_unlock_irqrestore(&irqlist_lock, flags);
 		return;
         }
-        
+
         if (t->dev_id == dev_id)
         {                                         /* removing first handler on chain */
                 t->flags = IRQ_FLG_STD;           /* we probably don't really need these */
@@ -136,9 +136,9 @@ void hp300_free_irq(unsigned int irq, void *dev_id)
 		spin_unlock_irqrestore(&irqlist_lock, flags);
 		return;
         }
-        
+
         /* OK, must be removing from middle of the chain */
-        
+
         for (t = hp300_irq_list[irq]; t->next && t->next->dev_id != dev_id; t = t->next)
                 /* do nothing */;
         if (!t->next)
@@ -153,7 +153,7 @@ void hp300_free_irq(unsigned int irq, void *dev_id)
 	t->next->devname = NULL;
 	t->next->handler = NULL;
         t->next = t->next->next;
-        
+
 	spin_unlock_irqrestore(&irqlist_lock, flags);
 }
 
diff --git a/arch/m68k/ifpsp060/CHANGES b/arch/m68k/ifpsp060/CHANGES
index ffa1b5672..c1e712dfc 100644
--- a/arch/m68k/ifpsp060/CHANGES
+++ b/arch/m68k/ifpsp060/CHANGES
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -31,7 +31,7 @@ CHANGES SINCE LAST RELEASE:
 ---------------------------
 
 1) "movep" emulation where data was being read from memory
-was reading the intermediate bytes. Emulation now only 
+was reading the intermediate bytes. Emulation now only
 reads the required bytes.
 
 2) "flogn", "flog2", and "flog10" of "1" was setting the
@@ -57,7 +57,7 @@ of the operation. This has been corrected.
 	For example, if a user executed "fsin.x ADDR,fp0" where
 	ADDR should cause a "segmentation violation", the memory read
 	requested by the package should return a failing value
-	to the package. Since the package currently ignores this 
+	to the package. Since the package currently ignores this
 	return value, the user program will continue to the
 	next instruction, and the result created in fp0 will be
 	undefined.
@@ -76,16 +76,16 @@ of the operation. This has been corrected.
 	as described in the MC68060 User's Manual.
 
 	For instruction read access errors, the info stacked is:
-		SR 	= SR at time of exception
-		PC 	= PC of instruction being emulated
+		SR	= SR at time of exception
+		PC	= PC of instruction being emulated
 		VOFF	= $4008 (stack frame format type)
 		ADDRESS	= PC of instruction being emulated
 		FSLW	= FAULT STATUS LONGWORD
 
 	The valid FSLW bits are:
-		bit 27 		= 1	(misaligned bit)
-		bit 24 		= 1	(read)
-		bit 23 		= 0	(write)
+		bit 27		= 1	(misaligned bit)
+		bit 24		= 1	(read)
+		bit 23		= 0	(write)
 		bit 22:21	= 10	(SIZE = word)
 		bit 20:19	= 00	(TT)
 		bit 18:16	= x10	(TM; x = 1 for supervisor mode)
@@ -98,15 +98,15 @@ of the operation. This has been corrected.
 	other bits.
 
 	For data read/write access errors, the info stacked is:
-		SR 	= SR at time of exception
-		PC 	= PC of instruction being emulated
+		SR	= SR at time of exception
+		PC	= PC of instruction being emulated
 		VOFF	= $4008 (stack frame format type)
 		ADDRESS	= Address of source or destination operand
 		FSLW	= FAULT STATUS LONGWORD
 
 	The valid FSLW bits are:
-		bit 27 		= 0	(misaligned bit)
-		bit 24 		= x	(read; 1 if read, 0 if write)
+		bit 27		= 0	(misaligned bit)
+		bit 24		= x	(read; 1 if read, 0 if write)
 		bit 23		= x	(write; 1 if write, 0 if read)
 		bit 22:21	= xx	(SIZE; see MC68060 User's Manual)
 		bit 20:19	= 00	(TT)
diff --git a/arch/m68k/ifpsp060/MISC b/arch/m68k/ifpsp060/MISC
index 0c0f2b011..b7e644b94 100644
--- a/arch/m68k/ifpsp060/MISC
+++ b/arch/m68k/ifpsp060/MISC
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -176,7 +176,7 @@ icalc_ea.s  : 2.11
 imovep.s    : 2.8
 ichk2cmp2.s : 2.6
 idiv64.s    : 2.10
-imul64.s    : 
+imul64.s    :
 icas2.s     : 2.11
 icas.s      : 2.12
 icas2_core.s: 2.6
diff --git a/arch/m68k/ifpsp060/README b/arch/m68k/ifpsp060/README
index afd059f8b..e3bced429 100644
--- a/arch/m68k/ifpsp060/README
+++ b/arch/m68k/ifpsp060/README
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
diff --git a/arch/m68k/ifpsp060/TEST.DOC b/arch/m68k/ifpsp060/TEST.DOC
index 3a96b4b20..5e5900cb2 100644
--- a/arch/m68k/ifpsp060/TEST.DOC
+++ b/arch/m68k/ifpsp060/TEST.DOC
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -56,7 +56,7 @@ Release file structure:
 -----------------------
 
 (top of module)
-	----------------- 
+	-----------------
 	|		| - 128 byte-sized section
    (1)  |   Call-Out	| - 4 bytes per entry (user fills these in)
 	|		|
@@ -74,8 +74,8 @@ Release file structure:
 The first section of this module is the "Call-out" section. This section
 is NOT INCLUDED in {i,f}test.sa (an example "Call-out" section is provided at
 the end of this file). The purpose of this section is to allow the test
-routines to reference external printing functions that must be provided 
-by the host operating system. This section MUST be exactly 128 bytes in 
+routines to reference external printing functions that must be provided
+by the host operating system. This section MUST be exactly 128 bytes in
 size. There are 32 fields, each 4 bytes in size. Each field corresponds
 to a function required by the test packages (these functions and their
 location are listed in "68060{ISP,FPSP}-TEST call-outs" below). Each field
@@ -152,7 +152,7 @@ main fp test: tests (1) unimp effective address exception
 		    (2) unsupported data type exceptions
 		    (3) non-maskable overflow/underflow exceptions
 
-FP unimplemented: tests FP unimplemented exception. this one is 
+FP unimplemented: tests FP unimplemented exception. this one is
 		  separate from the previous tests for systems that don't
 		  want FP unimplemented instructions.
 
@@ -194,7 +194,7 @@ _print_num:
 # beginning of "Call-out" section; provided by integrator.
 # MUST be 128 bytes long.
 _060FPSP_TEST:
-	long	_print_str - _060FPSP_TEST	
+	long	_print_str - _060FPSP_TEST
 	long	_print_num - _060FPSP_TEST
 	space	120
 
diff --git a/arch/m68k/ifpsp060/fplsp.doc b/arch/m68k/ifpsp060/fplsp.doc
index 80a4fd7da..fb637c436 100644
--- a/arch/m68k/ifpsp060/fplsp.doc
+++ b/arch/m68k/ifpsp060/fplsp.doc
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -34,7 +34,7 @@ The file fplsp.sa contains the "Library version" of the
 68060SP Floating-Point Software Package. The routines
 included in this module can be used to emulate the
 FP instructions not implemented in 68060 hardware. These
-instructions normally take exception vector #11 
+instructions normally take exception vector #11
 "FP Unimplemented Instruction".
 
 By re-compiling a program that uses these instructions, and
diff --git a/arch/m68k/ifpsp060/fpsp.doc b/arch/m68k/ifpsp060/fpsp.doc
index 1a66c16c4..408315209 100644
--- a/arch/m68k/ifpsp060/fpsp.doc
+++ b/arch/m68k/ifpsp060/fpsp.doc
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -31,7 +31,7 @@ or trademarks of Motorola, Inc.
 
 The file fpsp.sa contains the 68060 Floating-Point Software
 Package. This package is essentially a set of exception handlers
-that can be integrated into an operating system. 
+that can be integrated into an operating system.
 These exception handlers emulate Unimplemented FP instructions,
 instructions using unimplemented data types, and instructions
 using unimplemented addressing modes. In addition, this package
@@ -62,14 +62,14 @@ Release file structure:
 -----------------------
 
 (top of module)
-	----------------- 
+	-----------------
 	|		| - 128 byte-sized section
    (1)  |   Call-Out	| - 4 bytes per entry (user fills these in)
 	|		| - example routines in fskeleton.s
 	-----------------
 	|		| - 8 bytes per entry
    (2)  | Entry Point	| - user does "bra" or "jmp" to this address
-	|		| 
+	|		|
 	-----------------
 	|		| - code section
    (3)  ~		~
@@ -79,14 +79,14 @@ Release file structure:
 
 The first section of this module is the "Call-out" section. This section
 is NOT INCLUDED in fpsp.sa (an example "Call-out" section is provided at
-the end of the file fskeleton.s). The purpose of this section is to allow 
-the FPSP routines to reference external functions that must be provided 
-by the host operating system. This section MUST be exactly 128 bytes in 
+the end of the file fskeleton.s). The purpose of this section is to allow
+the FPSP routines to reference external functions that must be provided
+by the host operating system. This section MUST be exactly 128 bytes in
 size. There are 32 fields, each 4 bytes in size. Each field corresponds
 to a function required by the FPSP (these functions and their location are
 listed in "68060FPSP call-outs" below). Each field entry should contain
 the address of the corresponding function RELATIVE to the starting address
-of the "call-out" section. The "Call-out" section must sit adjacent to the 
+of the "call-out" section. The "Call-out" section must sit adjacent to the
 fpsp.sa image in memory.
 
 The second section, the "Entry-point" section, is used by external routines
@@ -97,7 +97,7 @@ are listed in section "68060 FPSP entry points" below. A calling routine
 would simply execute a "bra" or "jmp" that jumped to the selected function
 entry-point.
 
-For example, if the 68060 hardware took a "Line-F Emulator" exception 
+For example, if the 68060 hardware took a "Line-F Emulator" exception
 (vector #11), the operating system should execute something similar to:
 
 	bra	_060FPSP_TOP+128+48
diff --git a/arch/m68k/ifpsp060/fskeleton.S b/arch/m68k/ifpsp060/fskeleton.S
index 0e91c5f05..a45a4ff9d 100644
--- a/arch/m68k/ifpsp060/fskeleton.S
+++ b/arch/m68k/ifpsp060/fskeleton.S
@@ -5,10 +5,10 @@
 |Production Release P1.00 -- October 10, 1994
 |
 |M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
-| 
+|
 |THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 |To the maximum extent permitted by applicable law,
-|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 |and any warranty against infringement with regard to the SOFTWARE
 |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -68,7 +68,7 @@ _060_fpsp_done:
 | _060_real_ovfl():
 |
 | This is the exit point for the 060FPSP when an enabled overflow exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled overflow conditions. The exception stack frame is an overflow
 | stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
 |
@@ -87,7 +87,7 @@ _060_real_ovfl:
 | _060_real_unfl():
 |
 | This is the exit point for the 060FPSP when an enabled underflow exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled underflow conditions. The exception stack frame is an underflow
 | stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
 |
@@ -105,7 +105,7 @@ _060_real_unfl:
 | _060_real_operr():
 |
 | This is the exit point for the 060FPSP when an enabled operand error exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled operand error exceptions. The exception stack frame is an operand error
 | stack frame. The FP state frame holds the source operand of the faulting
 | instruction.
@@ -124,7 +124,7 @@ _060_real_operr:
 | _060_real_snan():
 |
 | This is the exit point for the 060FPSP when an enabled signalling NaN exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled signalling NaN exceptions. The exception stack frame is a signalling NaN
 | stack frame. The FP state frame holds the source operand of the faulting
 | instruction.
@@ -143,7 +143,7 @@ _060_real_snan:
 | _060_real_dz():
 |
 | This is the exit point for the 060FPSP when an enabled divide-by-zero exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled divide-by-zero exceptions. The exception stack frame is a divide-by-zero
 | stack frame. The FP state frame holds the source operand of the faulting
 | instruction.
@@ -162,7 +162,7 @@ _060_real_dz:
 | _060_real_inex():
 |
 | This is the exit point for the 060FPSP when an enabled inexact exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled inexact exceptions. The exception stack frame is an inexact
 | stack frame. The FP state frame holds the source operand of the faulting
 | instruction.
@@ -181,12 +181,12 @@ _060_real_inex:
 | _060_real_bsun():
 |
 | This is the exit point for the 060FPSP when an enabled bsun exception
-| is present. The routine below should point to the operating system handler 
+| is present. The routine below should point to the operating system handler
 | for enabled bsun exceptions. The exception stack frame is a bsun
 | stack frame.
 |
 | The sample routine below clears the exception status bit, clears the NaN
-| bit in the FPSR, and does an "rte". The instruction that caused the 
+| bit in the FPSR, and does an "rte". The instruction that caused the
 | bsun will now be re-executed but with the NaN FPSR bit cleared.
 |
 	.global		_060_real_bsun
@@ -202,13 +202,13 @@ _060_real_bsun:
 |
 | _060_real_fline():
 |
-| This is the exit point for the 060FPSP when an F-Line Illegal exception is 
+| This is the exit point for the 060FPSP when an F-Line Illegal exception is
 | encountered. Three different types of exceptions can enter the F-Line exception
 | vector number 11: FP Unimplemented Instructions, FP implemented instructions when
 | the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
 | _fpsp_fline() distinguishes between the three and acts appropriately. F-Line
 | Illegals branch here.
-| 
+|
 	.global		_060_real_fline
 _060_real_fline:
 	bral		trap	| jump to trap handler
@@ -216,7 +216,7 @@ _060_real_fline:
 |
 | _060_real_fpu_disabled():
 |
-| This is the exit point for the 060FPSP when an FPU disabled exception is 
+| This is the exit point for the 060FPSP when an FPU disabled exception is
 | encountered. Three different types of exceptions can enter the F-Line exception
 | vector number 11: FP Unimplemented Instructions, FP implemented instructions when
 | the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
diff --git a/arch/m68k/ifpsp060/ilsp.doc b/arch/m68k/ifpsp060/ilsp.doc
index 560ffdbbc..f6fae6d90 100644
--- a/arch/m68k/ifpsp060/ilsp.doc
+++ b/arch/m68k/ifpsp060/ilsp.doc
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -32,11 +32,11 @@ or trademarks of Motorola, Inc.
 The file ilsp.s contains the "Library version" of the
 68060 Integer Software Package. Routines included in this
 module can be used to emulate 64-bit divide and multiply,
-and the "cmp2" instruction. These instructions are not 
-implemented in hardware on the 68060 and normally take 
+and the "cmp2" instruction. These instructions are not
+implemented in hardware on the 68060 and normally take
 exception vector #61 "Unimplemented Integer Instruction".
 
-By re-compiling a program that uses these instructions, and 
+By re-compiling a program that uses these instructions, and
 making subroutine calls in place of the unimplemented
 instructions, a program can avoid the overhead associated with
 taking the exception.
@@ -63,7 +63,7 @@ documentation purposes.
 
 Release file structure:
 -----------------------
-The file ilsp.sa contains an "Entry-Point" section and a 
+The file ilsp.sa contains an "Entry-Point" section and a
 code section. The ILSP has no "Call-Out" section. The first section
 is the "Entry-Point" section. In order to access a function in the
 package, a program must "bsr" or "jsr" to the location listed
@@ -77,7 +77,7 @@ re-compiled with every new 68060ILSP release.
 
 For example, to use a 64-bit multiply instruction,
 do a "bsr" or "jsr" to the entry point defined by
-the 060ILSP entry table. A compiler generated code sequence 
+the 060ILSP entry table. A compiler generated code sequence
 for unsigned multiply could look like:
 
 # mulu.l <ea>,Dh:Dl
@@ -107,7 +107,7 @@ For a divide:
 	mov.l	(%sp)+,%d1	# load remainder
 	mov.l	(%sp)+,%d0	# load quotient
 
-The library routines also return the correct condition code 
+The library routines also return the correct condition code
 register value. If this is important, then the caller of the library
 routine must make sure that the value isn't lost while popping
 other items off of the stack.
diff --git a/arch/m68k/ifpsp060/iskeleton.S b/arch/m68k/ifpsp060/iskeleton.S
index d92b12830..fc25c5fde 100644
--- a/arch/m68k/ifpsp060/iskeleton.S
+++ b/arch/m68k/ifpsp060/iskeleton.S
@@ -5,10 +5,10 @@
 |Production Release P1.00 -- October 10, 1994
 |
 |M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
-| 
+|
 |THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 |To the maximum extent permitted by applicable law,
-|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 |and any warranty against infringement with regard to the SOFTWARE
 |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -40,7 +40,7 @@
 
 
 |################################
-| (1) EXAMPLE CALL-OUTS 	#
+| (1) EXAMPLE CALL-OUTS		#
 |				#
 | _060_isp_done()		#
 | _060_real_chk()		#
@@ -56,7 +56,7 @@
 | _060_isp_done():
 |
 | This is and example main exit point for the Unimplemented Integer
-| Instruction exception handler. For a normal exit, the 
+| Instruction exception handler. For a normal exit, the
 | _isp_unimp() branches to here so that the operating system
 | can do any clean-up desired. The stack frame is the
 | Unimplemented Integer Instruction stack frame with
@@ -118,9 +118,9 @@ real_chk_end:
 |
 | _060_real_divbyzero:
 |
-| This is an alternate exit point for the Unimplemented Integer 
+| This is an alternate exit point for the Unimplemented Integer
 | Instruction exception handler isp_unimp(). If the instruction is a 64-bit
-| integer divide where the source operand is a zero, then the _isp_unimp() 
+| integer divide where the source operand is a zero, then the _isp_unimp()
 | creates a Divide-by-zero exception stack frame from the Unimplemented
 | Integer Instruction stack frame and branches to this routine.
 |
@@ -128,7 +128,7 @@ real_chk_end:
 | no action associated with the "chk" exception. If tracing is enabled,
 | then it create a Trace exception stack frame from the "chk" exception
 | stack frame and branches to the _real_trace() entry point.
-| 
+|
 | Linux/68k: commented out test for tracing
 
 	.global		_060_real_divbyzero
@@ -185,7 +185,7 @@ _060_real_cas2:
 | Entry point for the operating system`s routine to "lock" a page
 | from being paged out. This routine is needed by the cas/cas2
 | algorithms so that no page faults occur within the "core" code
-| region. Note: the routine must lock two pages if the operand 
+| region. Note: the routine must lock two pages if the operand
 | spans two pages.
 | NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE
 | SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME.
@@ -212,7 +212,7 @@ _060_real_lock_page:
 | Note: the routine must unlock two pages if the operand spans
 | two pages.
 | Arguments:
-| 	a0 = operand address
+|	a0 = operand address
 |	d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user
 |	d1 = `xxxxxxff -> longword; `xxxxxx00 -> word
 |
diff --git a/arch/m68k/ifpsp060/isp.doc b/arch/m68k/ifpsp060/isp.doc
index 802324c61..5a90fded3 100644
--- a/arch/m68k/ifpsp060/isp.doc
+++ b/arch/m68k/ifpsp060/isp.doc
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -77,7 +77,7 @@ Release file structure:
 	-----------------
 	|		| - 8 bytes per entry
    (2)  | Entry Point   | - user does a "bra" or "jmp" to this address
-	|               | 
+	|               |
 	-----------------
 	|		| - code section
    (3)  ~		~
@@ -87,14 +87,14 @@ Release file structure:
 
 The first section of this module is the "Call-out" section. This section
 is NOT INCLUDED in isp.sa (an example "Call-out" section is provided at
-the end of the file iskeleton.s). The purpose of this section is to allow 
-the ISP routines to reference external functions that must be provided 
-by the host operating system. This section MUST be exactly 128 bytes in 
+the end of the file iskeleton.s). The purpose of this section is to allow
+the ISP routines to reference external functions that must be provided
+by the host operating system. This section MUST be exactly 128 bytes in
 size. There are 32 fields, each 4 bytes in size. Each field corresponds
 to a function required by the ISP (these functions and their location are
 listed in "68060ISP call-outs" below). Each field entry should contain
 the address of the corresponding function RELATIVE to the starting address
-of the "call-out" section. The "Call-out" section must sit adjacent to the 
+of the "call-out" section. The "Call-out" section must sit adjacent to the
 isp.sa image in memory.
 
 The second section, the "Entry-point" section, is used by external routines
@@ -112,7 +112,7 @@ similar to:
 	bra	_060ISP_TOP+128+0
 
 (_060ISP_TOP is the starting address of the "Call-out" section; the "Call-out"
-section is 128 bytes long; and the Unimplemented Integer ISP handler entry 
+section is 128 bytes long; and the Unimplemented Integer ISP handler entry
 point is located 0 bytes from the top of the "Entry-point" section.)
 
 The third section is the code section. After entering through an "Entry-point",
@@ -177,7 +177,7 @@ address) take the Unimplemented Integer Instruction exception. When the
 _060_isp_unimp() entry point of the ISP.
 
 After the 060ISP decodes the instruction type and fetches the appropriate
-data registers, and BEFORE the actual emulated transfers occur, the 
+data registers, and BEFORE the actual emulated transfers occur, the
 package calls either the "Call-out" _060_real_cas() or _060_real_cas2().
 If the emulation code provided by the 060ISP is sufficient for the
 host system (see isp.s source code), then these "Call-out"s should be
diff --git a/arch/m68k/ifpsp060/os.S b/arch/m68k/ifpsp060/os.S
index d39dbe7b4..aa4df87a6 100644
--- a/arch/m68k/ifpsp060/os.S
+++ b/arch/m68k/ifpsp060/os.S
@@ -5,10 +5,10 @@
 |Production Release P1.00 -- October 10, 1994
 |
 |M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
-| 
+|
 |THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 |To the maximum extent permitted by applicable law,
-|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+|MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 |and any warranty against infringement with regard to the SOFTWARE
 |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -35,8 +35,8 @@
 #include <linux/linkage.h>
 
 |################################
-| EXAMPLE CALL-OUTS 		#
-| 				#
+| EXAMPLE CALL-OUTS		#
+|				#
 | _060_dmem_write()		#
 | _060_dmem_read()		#
 | _060_imem_read()		#
@@ -53,12 +53,12 @@
 | _060_real_access()		#
 |################################
 
-| 
+|
 | Each IO routine checks to see if the memory write/read is to/from user
 | or supervisor application space. The examples below use simple "move"
 | instructions for supervisor mode applications and call _copyin()/_copyout()
 | for user mode applications.
-| When installing the 060SP, the _copyin()/_copyout() equivalents for a 
+| When installing the 060SP, the _copyin()/_copyout() equivalents for a
 | given operating system should be substituted.
 |
 | The addresses within the 060SP are guaranteed to be on the stack.
@@ -76,10 +76,10 @@
 | Writes to data memory while in supervisor mode.
 |
 | INPUTS:
-|	a0 - supervisor source address	
+|	a0 - supervisor source address
 |	a1 - user destination address
-|	d0 - number of bytes to write	
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	d0 - number of bytes to write
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d1 - 0 = success, !0 = failure
 |
@@ -110,11 +110,11 @@ copyoutae:
 |	a0 - user source address
 |	a1 - supervisor destination address
 |	d0 - number of bytes to read
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_imem_read
+	.global		_060_imem_read
 	.global		_060_dmem_read
 _060_imem_read:
 _060_dmem_read:
@@ -136,17 +136,17 @@ copyinae:
 
 |
 | _060_dmem_read_byte():
-| 
+|
 | Read a data byte from user memory.
 |
 | INPUTS:
 |	a0 - user source address
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d0 - data byte in d0
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_dmem_read_byte
+	.global		_060_dmem_read_byte
 _060_dmem_read_byte:
 	clr.l		%d0			| clear whole longword
 	clr.l		%d1			| assume success
@@ -159,29 +159,29 @@ dmrbs:	move.b		(%a0),%d0		| fetch super byte
 
 |
 | _060_dmem_read_word():
-| 
+|
 | Read a data word from user memory.
 |
 | INPUTS:
 |	a0 - user source address
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d0 - data word in d0
 |	d1 - 0 = success, !0 = failure
 |
 | _060_imem_read_word():
-| 
+|
 | Read an instruction word from user memory.
 |
 | INPUTS:
 |	a0 - user source address
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d0 - instruction word in d0
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_dmem_read_word
-	.global 		_060_imem_read_word
+	.global		_060_dmem_read_word
+	.global		_060_imem_read_word
 _060_dmem_read_word:
 _060_imem_read_word:
 	clr.l		%d1			| assume success
@@ -195,29 +195,29 @@ dmrws:	move.w		(%a0), %d0		| fetch super word
 
 |
 | _060_dmem_read_long():
-| 
+|
 
 |
 | INPUTS:
 |	a0 - user source address
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d0 - data longword in d0
 |	d1 - 0 = success, !0 = failure
 |
 | _060_imem_read_long():
-| 
+|
 | Read an instruction longword from user memory.
 |
 | INPUTS:
 |	a0 - user source address
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d0 - instruction longword in d0
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_dmem_read_long
-	.global 		_060_imem_read_long
+	.global		_060_dmem_read_long
+	.global		_060_imem_read_long
 _060_dmem_read_long:
 _060_imem_read_long:
 	clr.l		%d1			| assume success
@@ -235,12 +235,12 @@ dmrls:	move.l		(%a0),%d0		| fetch super longword
 |
 | INPUTS:
 |	a0 - user destination address
-| 	d0 - data byte in d0
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	d0 - data byte in d0
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_dmem_write_byte
+	.global		_060_dmem_write_byte
 _060_dmem_write_byte:
 	clr.l		%d1			| assume success
 	btst		#0x5,0x4(%a6)		| check for supervisor state
@@ -257,12 +257,12 @@ dmwbs:	move.b		%d0,(%a0)		| store super byte
 |
 | INPUTS:
 |	a0 - user destination address
-| 	d0 - data word in d0
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	d0 - data word in d0
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_dmem_write_word
+	.global		_060_dmem_write_word
 _060_dmem_write_word:
 	clr.l		%d1			| assume success
 	btst		#0x5,0x4(%a6)		| check for supervisor state
@@ -281,12 +281,12 @@ dmwwr:	clr.l		%d1			| return success
 |
 | INPUTS:
 |	a0 - user destination address
-| 	d0 - data longword in d0
-| 	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
+|	d0 - data longword in d0
+|	0x4(%a6),bit5 - 1 = supervisor mode, 0 = user mode
 | OUTPUTS:
 |	d1 - 0 = success, !0 = failure
 |
-	.global 		_060_dmem_write_long
+	.global		_060_dmem_write_long
 _060_dmem_write_long:
 	clr.l		%d1			| assume success
 	btst		#0x5,0x4(%a6)		| check for supervisor state
@@ -313,7 +313,7 @@ dmwls:	move.l		%d0,(%a0)		| store super longword
 |
 | int _copyout(supervisor_addr, user_addr, nbytes)
 |
-	.global 		_copyout
+	.global		_copyout
 _copyout:
 	move.l		4(%sp),%a0		| source
 	move.l		8(%sp),%a1		| destination
@@ -330,14 +330,14 @@ copyoutae:
 |
 | int _copyin(user_addr, supervisor_addr, nbytes)
 |
-	.global 		_copyin
+	.global		_copyin
 _copyin:
 	move.l		4(%sp),%a0		| source
 	move.l		8(%sp),%a1		| destination
 	move.l		12(%sp),%d0		| count
     subq.l      #1,%d0
 morein:
-copyinae:	
+copyinae:
 	movs.b		(%a0)+,%d1		| fetch user byte
 	move.b		%d1,(%a1)+		| write supervisor byte
 	dbra		%d0,morein		| are we through yet?
@@ -378,7 +378,7 @@ _060_real_access:
 
 
 
-| Execption handling for movs access to illegal memory	
+| Execption handling for movs access to illegal memory
 	.section .fixup,#alloc,#execinstr
 	.even
 1:	moveq		#-1,%d1
diff --git a/arch/m68k/ifpsp060/src/fplsp.S b/arch/m68k/ifpsp060/src/fplsp.S
index 903e4d544..fdb79b927 100644
--- a/arch/m68k/ifpsp060/src/fplsp.S
+++ b/arch/m68k/ifpsp060/src/fplsp.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -304,33 +304,33 @@ set EXC_D2,		EXC_DREGS+(2*4)
 set EXC_D1,		EXC_DREGS+(1*4)
 set EXC_D0,		EXC_DREGS+(0*4)
 
-set EXC_FP0, 		EXC_FPREGS+(0*12)	# offset of saved fp0
-set EXC_FP1, 		EXC_FPREGS+(1*12)	# offset of saved fp1
-set EXC_FP2, 		EXC_FPREGS+(2*12)	# offset of saved fp2 (not used)
+set EXC_FP0,		EXC_FPREGS+(0*12)	# offset of saved fp0
+set EXC_FP1,		EXC_FPREGS+(1*12)	# offset of saved fp1
+set EXC_FP2,		EXC_FPREGS+(2*12)	# offset of saved fp2 (not used)
 
-set FP_SCR1, 		LV+80			# fp scratch 1
-set FP_SCR1_EX, 	FP_SCR1+0
+set FP_SCR1,		LV+80			# fp scratch 1
+set FP_SCR1_EX,		FP_SCR1+0
 set FP_SCR1_SGN,	FP_SCR1+2
-set FP_SCR1_HI, 	FP_SCR1+4
-set FP_SCR1_LO, 	FP_SCR1+8
+set FP_SCR1_HI,		FP_SCR1+4
+set FP_SCR1_LO,		FP_SCR1+8
 
-set FP_SCR0, 		LV+68			# fp scratch 0
-set FP_SCR0_EX, 	FP_SCR0+0
+set FP_SCR0,		LV+68			# fp scratch 0
+set FP_SCR0_EX,		FP_SCR0+0
 set FP_SCR0_SGN,	FP_SCR0+2
-set FP_SCR0_HI, 	FP_SCR0+4
-set FP_SCR0_LO, 	FP_SCR0+8
+set FP_SCR0_HI,		FP_SCR0+4
+set FP_SCR0_LO,		FP_SCR0+8
 
-set FP_DST, 		LV+56			# fp destination operand
-set FP_DST_EX, 		FP_DST+0
+set FP_DST,		LV+56			# fp destination operand
+set FP_DST_EX,		FP_DST+0
 set FP_DST_SGN,		FP_DST+2
-set FP_DST_HI, 		FP_DST+4
-set FP_DST_LO, 		FP_DST+8
+set FP_DST_HI,		FP_DST+4
+set FP_DST_LO,		FP_DST+8
 
-set FP_SRC, 		LV+44			# fp source operand
-set FP_SRC_EX, 		FP_SRC+0
+set FP_SRC,		LV+44			# fp source operand
+set FP_SRC_EX,		FP_SRC+0
 set FP_SRC_SGN,		FP_SRC+2
-set FP_SRC_HI, 		FP_SRC+4
-set FP_SRC_LO, 		FP_SRC+8
+set FP_SRC_HI,		FP_SRC+4
+set FP_SRC_LO,		FP_SRC+8
 
 set USER_FPIAR,		LV+40			# FP instr address register
 
@@ -354,7 +354,7 @@ set EXC_TEMP2,		LV+24			# temporary space
 set EXC_TEMP,		LV+16			# temporary space
 
 set DTAG,		LV+15			# destination operand type
-set STAG, 		LV+14			# source operand type
+set STAG,		LV+14			# source operand type
 
 set SPCOND_FLG,		LV+10			# flag: special case (see below)
 
@@ -369,17 +369,17 @@ set EXC_OPWORD,		LV+0			# saved operation word
 # Helpful macros
 
 set FTEMP,		0			# offsets within an
-set FTEMP_EX, 		0			# extended precision
+set FTEMP_EX,		0			# extended precision
 set FTEMP_SGN,		2			# value saved in memory.
-set FTEMP_HI, 		4
-set FTEMP_LO, 		8
+set FTEMP_HI,		4
+set FTEMP_LO,		8
 set FTEMP_GRS,		12
 
 set LOCAL,		0			# offsets within an
-set LOCAL_EX, 		0			# extended precision 
+set LOCAL_EX,		0			# extended precision
 set LOCAL_SGN,		2			# value saved in memory.
-set LOCAL_HI, 		4
-set LOCAL_LO, 		8
+set LOCAL_HI,		4
+set LOCAL_LO,		8
 set LOCAL_GRS,		12
 
 set DST,		0			# offsets within an
@@ -469,17 +469,17 @@ set ainex_mask,		0x00000008		# accrued inexact
 ######################################
 set dzinf_mask,		inf_mask+dz_mask+adz_mask
 set opnan_mask,		nan_mask+operr_mask+aiop_mask
-set nzi_mask,		0x01ffffff 		#clears N, Z, and I
+set nzi_mask,		0x01ffffff		#clears N, Z, and I
 set unfinx_mask,	unfl_mask+inex2_mask+aunfl_mask+ainex_mask
 set unf2inx_mask,	unfl_mask+inex2_mask+ainex_mask
 set ovfinx_mask,	ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
 set inx1a_mask,		inex1_mask+ainex_mask
 set inx2a_mask,		inex2_mask+ainex_mask
-set snaniop_mask, 	nan_mask+snan_mask+aiop_mask
+set snaniop_mask,	nan_mask+snan_mask+aiop_mask
 set snaniop2_mask,	snan_mask+aiop_mask
 set naniop_mask,	nan_mask+aiop_mask
 set neginf_mask,	neg_mask+inf_mask
-set infaiop_mask, 	inf_mask+aiop_mask
+set infaiop_mask,	inf_mask+aiop_mask
 set negz_mask,		neg_mask+z_mask
 set opaop_mask,		operr_mask+aiop_mask
 set unfl_inx_mask,	unfl_mask+aunfl_mask+ainex_mask
@@ -508,8 +508,8 @@ set rp_mode,		0x3			# round-to-plus-infinity
 set mantissalen,	64			# length of mantissa in bits
 
 set BYTE,		1			# len(byte) == 1 byte
-set WORD, 		2			# len(word) == 2 bytes
-set LONG, 		4			# len(longword) == 2 bytes
+set WORD,		2			# len(word) == 2 bytes
+set LONG,		4			# len(longword) == 2 bytes
 
 set BSUN_VEC,		0xc0			# bsun    vector offset
 set INEX_VEC,		0xc4			# inexact vector offset
@@ -4903,7 +4903,7 @@ _L23_6x:
 #	d0 = round precision,mode					#
 #									#
 # OUTPUT ************************************************************** #
-#	fp0 = sin(X) or cos(X) 						#
+#	fp0 = sin(X) or cos(X)						#
 #									#
 #    For ssincos(X):							#
 #	fp0 = sin(X)							#
@@ -4911,7 +4911,7 @@ _L23_6x:
 #									#
 # ACCURACY and MONOTONICITY ******************************************* #
 #	The returned result is within 1 ulp in 64 significant bit, i.e.	#
-#	within 0.5001 ulp to 53 bits if the result is subsequently 	#
+#	within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
@@ -4928,8 +4928,8 @@ _L23_6x:
 #									#
 #	4. If k is even, go to 6.					#
 #									#
-#	5. (k is odd) Set j := (k-1)/2, sgn := (-1)**j. 		#
-#		Return sgn*cos(r) where cos(r) is approximated by an 	#
+#	5. (k is odd) Set j := (k-1)/2, sgn := (-1)**j.			#
+#		Return sgn*cos(r) where cos(r) is approximated by an	#
 #		even polynomial in r, 1 + r*r*(B1+s*(B2+ ... + s*B8)),	#
 #		s = r*r.						#
 #		Exit.							#
@@ -4941,10 +4941,10 @@ _L23_6x:
 #									#
 #	7. If |X| > 1, go to 9.						#
 #									#
-#	8. (|X|<2**(-40)) If SIN is invoked, return X; 			#
+#	8. (|X|<2**(-40)) If SIN is invoked, return X;			#
 #		otherwise return 1.					#
 #									#
-#	9. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, 		#
+#	9. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi,		#
 #		go back to 3.						#
 #									#
 #	SINCOS:								#
@@ -4959,19 +4959,19 @@ _L23_6x:
 #		j1 exclusive or with the l.s.b. of k.			#
 #		sgn1 := (-1)**j1, sgn2 := (-1)**j2.			#
 #		SIN(X) = sgn1 * cos(r) and COS(X) = sgn2*sin(r) where	#
-#		sin(r) and cos(r) are computed as odd and even 		#
+#		sin(r) and cos(r) are computed as odd and even		#
 #		polynomials in r, respectively. Exit			#
 #									#
 #	5. (k is even) Set j1 := k/2, sgn1 := (-1)**j1.			#
 #		SIN(X) = sgn1 * sin(r) and COS(X) = sgn1*cos(r) where	#
-#		sin(r) and cos(r) are computed as odd and even 		#
+#		sin(r) and cos(r) are computed as odd and even		#
 #		polynomials in r, respectively. Exit			#
 #									#
 #	6. If |X| > 1, go to 8.						#
 #									#
 #	7. (|X|<2**(-40)) SIN(X) = X and COS(X) = 1. Exit.		#
 #									#
-#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, 		#
+#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi,		#
 #		go back to 2.						#
 #									#
 #########################################################################
@@ -5046,9 +5046,9 @@ SOK1:
 #--THE ARGUMENT REDUCTION IS DONE BY TABLE LOOK UP.
 SINMAIN:
 	fmov.x		%fp0,%fp1
-	fmul.d		TWOBYPI(%pc),%fp1 	# X*2/PI
+	fmul.d		TWOBYPI(%pc),%fp1	# X*2/PI
 
-	lea		PITBL+0x200(%pc),%a1 	# TABLE OF N*PI/2, N = -32,...,32
+	lea		PITBL+0x200(%pc),%a1	# TABLE OF N*PI/2, N = -32,...,32
 
 	fmov.l		%fp1,INT(%a6)		# CONVERT TO INTEGER
 
@@ -5058,8 +5058,8 @@ SINMAIN:
 
 # A1 IS THE ADDRESS OF N*PIBY2
 # ...WHICH IS IN TWO PIECES Y1 & Y2
-	fsub.x		(%a1)+,%fp0 		# X-Y1
-	fsub.s		(%a1),%fp0 		# fp0 = R = (X-Y1)-Y2
+	fsub.x		(%a1)+,%fp0		# X-Y1
+	fsub.s		(%a1),%fp0		# fp0 = R = (X-Y1)-Y2
 
 SINCONT:
 #--continuation from REDUCEX
@@ -5213,7 +5213,7 @@ SINTINY:
 COSTINY:
 	fmov.s		&0x3F800000,%fp0	# fp0 = 1.0
 	fmov.l		%d0,%fpcr		# restore users round mode,prec
-	fadd.s 		&0x80800000,%fp0	# last inst - possible exception set
+	fadd.s		&0x80800000,%fp0	# last inst - possible exception set
 	bra		t_pinx2
 
 ################################################
@@ -5645,7 +5645,7 @@ SRESTORE:
 #									#
 #	7. (|X|<2**(-40)) Tan(X) = X. Exit.				#
 #									#
-#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back 	#
+#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back	#
 #		to 2.							#
 #									#
 #########################################################################
@@ -6048,27 +6048,27 @@ RESTORE:
 #	The returned result is within 2 ulps in	64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
-#	in double precision. 						#
+#	in double precision.						#
 #									#
 # ALGORITHM *********************************************************** #
 #	Step 1. If |X| >= 16 or |X| < 1/16, go to Step 5.		#
 #									#
-#	Step 2. Let X = sgn * 2**k * 1.xxxxxxxx...x. 			#
+#	Step 2. Let X = sgn * 2**k * 1.xxxxxxxx...x.			#
 #		Note that k = -4, -3,..., or 3.				#
-#		Define F = sgn * 2**k * 1.xxxx1, i.e. the first 5 	#
+#		Define F = sgn * 2**k * 1.xxxx1, i.e. the first 5	#
 #		significant bits of X with a bit-1 attached at the 6-th	#
 #		bit position. Define u to be u = (X-F) / (1 + X*F).	#
 #									#
 #	Step 3. Approximate arctan(u) by a polynomial poly.		#
 #									#
-#	Step 4. Return arctan(F) + poly, arctan(F) is fetched from a 	#
+#	Step 4. Return arctan(F) + poly, arctan(F) is fetched from a	#
 #		table of values calculated beforehand. Exit.		#
 #									#
 #	Step 5. If |X| >= 16, go to Step 7.				#
 #									#
 #	Step 6. Approximate arctan(X) by an odd polynomial in X. Exit.	#
 #									#
-#	Step 7. Define X' = -1/X. Approximate arctan(X') by an odd 	#
+#	Step 7. Define X' = -1/X. Approximate arctan(X') by an odd	#
 #		polynomial in X'.					#
 #		Arctan(X) = sign(X)*Pi/2 + arctan(X'). Exit.		#
 #									#
@@ -6334,7 +6334,7 @@ ATANMAIN:
 	fmul.x		%fp2,%fp1		# A1*U*V*(A2+V*(A3+V))
 	fadd.x		%fp1,%fp0		# ATAN(U), FP1 RELEASED
 
-	fmovm.x 	(%sp)+,&0x20		# restore fp2
+	fmovm.x		(%sp)+,&0x20		# restore fp2
 
 	fmov.l		%d0,%fpcr		# restore users rnd mode,prec
 	fadd.x		ATANF(%a6),%fp0		# ATAN(X)
@@ -6491,7 +6491,7 @@ satand:
 #	a0 = pointer to extended precision input			#
 #	d0 = round precision,mode					#
 #									#
-# OUTPUT **************************************************************	# 
+# OUTPUT **************************************************************	#
 #	fp0 = arcsin(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
@@ -6531,7 +6531,7 @@ sasin:
 
 # This catch is added here for the '060 QSP. Originally, the call to
 # satan() would handle this case by causing the exception which would
-# not be caught until gen_except(). Now, with the exceptions being 
+# not be caught until gen_except(). Now, with the exceptions being
 # detected inside of satan(), the exception would have been handled there
 # instead of inside sasin() as expected.
 	cmp.l		%d1,&0x3FD78000
@@ -6680,7 +6680,7 @@ sacosd:
 
 #########################################################################
 # setox():    computes the exponential for a normalized input		#
-# setoxd():   computes the exponential for a denormalized input		# 
+# setoxd():   computes the exponential for a denormalized input		#
 # setoxm1():  computes the exponential minus 1 for a normalized input	#
 # setoxm1d(): computes the exponential minus 1 for a denormalized input	#
 #									#
@@ -6692,9 +6692,9 @@ sacosd:
 #	fp0 = exp(X) or exp(X)-1					#
 #									#
 # ACCURACY and MONOTONICITY ******************************************* #
-#	The returned result is within 0.85 ulps in 64 significant bit, 	#
+#	The returned result is within 0.85 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently #
-#	rounded to double precision. The result is provably monotonic 	#
+#	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
 # ALGORITHM and IMPLEMENTATION **************************************** #
@@ -6718,14 +6718,14 @@ sacosd:
 #	Notes:	The usual case should take the branches 1.1 -> 1.3 -> 2.#
 #		To avoid the use of floating-point comparisons, a	#
 #		compact representation of |X| is used. This format is a	#
-#		32-bit integer, the upper (more significant) 16 bits 	#
-#		are the sign and biased exponent field of |X|; the 	#
+#		32-bit integer, the upper (more significant) 16 bits	#
+#		are the sign and biased exponent field of |X|; the	#
 #		lower 16 bits are the 16 most significant fraction	#
 #		(including the explicit bit) bits of |X|. Consequently,	#
 #		the comparisons in Steps 1.1 and 1.3 can be performed	#
 #		by integer comparison. Note also that the constant	#
 #		16380 log(2) used in Step 1.3 is also in the compact	#
-#		form. Thus taking the branch to Step 2 guarantees 	#
+#		form. Thus taking the branch to Step 2 guarantees	#
 #		|X| < 16380 log(2). There is no harm to have a small	#
 #		number of cases where |X| is less than,	but close to,	#
 #		16380 log(2) and the branch to Step 9 is taken.		#
@@ -6737,7 +6737,7 @@ sacosd:
 #		2.3	Calculate	J = N mod 64; so J = 0,1,2,..., #
 #			or 63.						#
 #		2.4	Calculate	M = (N - J)/64; so N = 64M + J.	#
-#		2.5	Calculate the address of the stored value of 	#
+#		2.5	Calculate the address of the stored value of	#
 #			2^(J/64).					#
 #		2.6	Create the value Scale = 2^M.			#
 #	Notes:	The calculation in 2.2 is really performed by		#
@@ -6746,26 +6746,26 @@ sacosd:
 #		where							#
 #			constant := single-precision( 64/log 2 ).	#
 #									#
-#		Using a single-precision constant avoids memory 	#
+#		Using a single-precision constant avoids memory		#
 #		access. Another effect of using a single-precision	#
-#		"constant" is that the calculated value Z is 		#
+#		"constant" is that the calculated value Z is		#
 #									#
 #			Z = X*(64/log2)*(1+eps), |eps| <= 2^(-24).	#
 #									#
 #		This error has to be considered later in Steps 3 and 4.	#
 #									#
 #	Step 3.	Calculate X - N*log2/64.				#
-#		3.1	R := X + N*L1, 					#
+#		3.1	R := X + N*L1,					#
 #				where L1 := single-precision(-log2/64).	#
-#		3.2	R := R + N*L2, 					#
+#		3.2	R := R + N*L2,					#
 #				L2 := extended-precision(-log2/64 - L1).#
-#	Notes:	a) The way L1 and L2 are chosen ensures L1+L2 		#
+#	Notes:	a) The way L1 and L2 are chosen ensures L1+L2		#
 #		approximate the value -log2/64 to 88 bits of accuracy.	#
 #		b) N*L1 is exact because N is no longer than 22 bits	#
 #		and L1 is no longer than 24 bits.			#
-#		c) The calculation X+N*L1 is also exact due to 		#
+#		c) The calculation X+N*L1 is also exact due to		#
 #		cancellation. Thus, R is practically X+N(L1+L2) to full	#
-#		64 bits. 						#
+#		64 bits.						#
 #		d) It is important to estimate how large can |R| be	#
 #		after Step 3.2.						#
 #									#
@@ -6783,11 +6783,11 @@ sacosd:
 #									#
 #	Step 4.	Approximate exp(R)-1 by a polynomial			#
 #		p = R + R*R*(A1 + R*(A2 + R*(A3 + R*(A4 + R*A5))))	#
-#	Notes:	a) In order to reduce memory access, the coefficients 	#
+#	Notes:	a) In order to reduce memory access, the coefficients	#
 #		are made as "short" as possible: A1 (which is 1/2), A4	#
 #		and A5 are single precision; A2 and A3 are double	#
-#		precision. 						#
-#		b) Even with the restrictions above, 			#
+#		precision.						#
+#		b) Even with the restrictions above,			#
 #		   |p - (exp(R)-1)| < 2^(-68.8) for all |R| <= 0.0062.	#
 #		Note that 0.0062 is slightly bigger than 0.57 log2/64.	#
 #		c) To fully utilize the pipeline, p is separated into	#
@@ -6801,11 +6801,11 @@ sacosd:
 #		where T and t are the stored values for 2^(J/64).	#
 #	Notes:	2^(J/64) is stored as T and t where T+t approximates	#
 #		2^(J/64) to roughly 85 bits; T is in extended precision	#
-#		and t is in single precision. Note also that T is 	#
-#		rounded to 62 bits so that the last two bits of T are 	#
-#		zero. The reason for such a special form is that T-1, 	#
+#		and t is in single precision. Note also that T is	#
+#		rounded to 62 bits so that the last two bits of T are	#
+#		zero. The reason for such a special form is that T-1,	#
 #		T-2, and T-8 will all be exact --- a property that will	#
-#		give much more accurate computation of the function 	#
+#		give much more accurate computation of the function	#
 #		EXPM1.							#
 #									#
 #	Step 6.	Reconstruction of exp(X)				#
@@ -6821,11 +6821,11 @@ sacosd:
 #			X = (M1+M)log2 + Jlog2/64 + R, |M1+M| >= 16380.	#
 #		Hence, exp(X) may overflow or underflow or neither.	#
 #		When that is the case, AdjScale = 2^(M1) where M1 is	#
-#		approximately M. Thus 6.2 will never cause 		#
+#		approximately M. Thus 6.2 will never cause		#
 #		over/underflow. Possible exception in 6.4 is overflow	#
 #		or underflow. The inexact exception is not generated in	#
 #		6.4. Although one can argue that the inexact flag	#
-#		should always be raised, to simulate that exception 	#
+#		should always be raised, to simulate that exception	#
 #		cost to much than the flag is worth in practical uses.	#
 #									#
 #	Step 7.	Return 1 + X.						#
@@ -6838,7 +6838,7 @@ sacosd:
 #		in Step 7.1 to avoid unnecessary trapping. (Although	#
 #		the FMOVEM may not seem relevant since X is normalized,	#
 #		the precaution will be useful in the library version of	#
-#		this code where the separate entry for denormalized 	#
+#		this code where the separate entry for denormalized	#
 #		inputs will be done away with.)				#
 #									#
 #	Step 8.	Handle exp(X) where |X| >= 16380log2.			#
@@ -6846,9 +6846,9 @@ sacosd:
 #		(mimic 2.2 - 2.6)					#
 #		8.2	N := round-to-integer( X * 64/log2 )		#
 #		8.3	Calculate J = N mod 64, J = 0,1,...,63		#
-#		8.4	K := (N-J)/64, M1 := truncate(K/2), M = K-M1, 	#
+#		8.4	K := (N-J)/64, M1 := truncate(K/2), M = K-M1,	#
 #			AdjFlag := 1.					#
-#		8.5	Calculate the address of the stored value 	#
+#		8.5	Calculate the address of the stored value	#
 #			2^(J/64).					#
 #		8.6	Create the values Scale = 2^M, AdjScale = 2^M1.	#
 #		8.7	Go to Step 3.					#
@@ -6885,8 +6885,8 @@ sacosd:
 #		1.4	Go to Step 10.					#
 #	Notes:	The usual case should take the branches 1.1 -> 1.3 -> 2.#
 #		However, it is conceivable |X| can be small very often	#
-#		because EXPM1 is intended to evaluate exp(X)-1 		#
-#		accurately when |X| is small. For further details on 	#
+#		because EXPM1 is intended to evaluate exp(X)-1		#
+#		accurately when |X| is small. For further details on	#
 #		the comparisons, see the notes on Step 1 of setox.	#
 #									#
 #	Step 2.	Calculate N = round-to-nearest-int( X * 64/log2 ).	#
@@ -6894,16 +6894,16 @@ sacosd:
 #		2.2	Calculate	J = N mod 64; so J = 0,1,2,..., #
 #			or 63.						#
 #		2.3	Calculate	M = (N - J)/64; so N = 64M + J.	#
-#		2.4	Calculate the address of the stored value of 	#
+#		2.4	Calculate the address of the stored value of	#
 #			2^(J/64).					#
-#		2.5	Create the values Sc = 2^M and 			#
+#		2.5	Create the values Sc = 2^M and			#
 #			OnebySc := -2^(-M).				#
 #	Notes:	See the notes on Step 2 of setox.			#
 #									#
 #	Step 3.	Calculate X - N*log2/64.				#
-#		3.1	R := X + N*L1, 					#
+#		3.1	R := X + N*L1,					#
 #				where L1 := single-precision(-log2/64).	#
-#		3.2	R := R + N*L2, 					#
+#		3.2	R := R + N*L2,					#
 #				L2 := extended-precision(-log2/64 - L1).#
 #	Notes:	Applying the analysis of Step 3 of setox in this case	#
 #		shows that |R| <= 0.0055 (note that |X| <= 70 log2 in	#
@@ -6911,10 +6911,10 @@ sacosd:
 #									#
 #	Step 4.	Approximate exp(R)-1 by a polynomial			#
 #			p = R+R*R*(A1+R*(A2+R*(A3+R*(A4+R*(A5+R*A6)))))	#
-#	Notes:	a) In order to reduce memory access, the coefficients 	#
-#		are made as "short" as possible: A1 (which is 1/2), A5 	#
-#		and A6 are single precision; A2, A3 and A4 are double 	#
-#		precision. 						#
+#	Notes:	a) In order to reduce memory access, the coefficients	#
+#		are made as "short" as possible: A1 (which is 1/2), A5	#
+#		and A6 are single precision; A2, A3 and A4 are double	#
+#		precision.						#
 #		b) Even with the restriction above,			#
 #			|p - (exp(R)-1)| <	|R| * 2^(-72.7)		#
 #		for all |R| <= 0.0055.					#
@@ -6929,9 +6929,9 @@ sacosd:
 #		where T and t are the stored values for 2^(J/64).	#
 #	Notes:	2^(J/64) is stored as T and t where T+t approximates	#
 #		2^(J/64) to roughly 85 bits; T is in extended precision	#
-#		and t is in single precision. Note also that T is 	#
-#		rounded to 62 bits so that the last two bits of T are 	#
-#		zero. The reason for such a special form is that T-1, 	#
+#		and t is in single precision. Note also that T is	#
+#		rounded to 62 bits so that the last two bits of T are	#
+#		zero. The reason for such a special form is that T-1,	#
 #		T-2, and T-8 will all be exact --- a property that will	#
 #		be exploited in Step 6 below. The total relative error	#
 #		in p is no bigger than 2^(-67.7) compared to the final	#
@@ -6946,7 +6946,7 @@ sacosd:
 #		6.5	ans := (T + OnebySc) + (p + t).			#
 #		6.6	Restore user FPCR.				#
 #		6.7	Return ans := Sc * ans. Exit.			#
-#	Notes:	The various arrangements of the expressions give 	#
+#	Notes:	The various arrangements of the expressions give	#
 #		accurate evaluations.					#
 #									#
 #	Step 7.	exp(X)-1 for |X| < 1/4.					#
@@ -6962,8 +6962,8 @@ sacosd:
 #		 Return ans := ans*2^(140). Exit			#
 #	Notes:	The idea is to return "X - tiny" under the user		#
 #		precision and rounding modes. To avoid unnecessary	#
-#		inefficiency, we stay away from denormalized numbers 	#
-#		the best we can. For |X| >= 2^(-16312), the 		#
+#		inefficiency, we stay away from denormalized numbers	#
+#		the best we can. For |X| >= 2^(-16312), the		#
 #		straightforward 8.2 generates the inexact exception as	#
 #		the case warrants.					#
 #									#
@@ -6971,13 +6971,13 @@ sacosd:
 #			p = X + X*X*(B1 + X*(B2 + ... + X*B12))		#
 #	Notes:	a) In order to reduce memory access, the coefficients	#
 #		are made as "short" as possible: B1 (which is 1/2), B9	#
-#		to B12 are single precision; B3 to B8 are double 	#
+#		to B12 are single precision; B3 to B8 are double	#
 #		precision; and B2 is double extended.			#
 #		b) Even with the restriction above,			#
 #			|p - (exp(X)-1)| < |X| 2^(-70.6)		#
 #		for all |X| <= 0.251.					#
 #		Note that 0.251 is slightly bigger than 1/4.		#
-#		c) To fully preserve accuracy, the polynomial is 	#
+#		c) To fully preserve accuracy, the polynomial is	#
 #		computed as						#
 #			X + ( S*B1 +	Q ) where S = X*X and		#
 #			Q	=	X*S*(B2 + X*(B3 + ... + X*B12))	#
@@ -6987,11 +6987,11 @@ sacosd:
 #				[ S*S*(B3 + S*(B5 + ... + S*B11)) ]	#
 #									#
 #	Step 10. Calculate exp(X)-1 for |X| >= 70 log 2.		#
-#		10.1 If X >= 70log2 , exp(X) - 1 = exp(X) for all 	#
+#		10.1 If X >= 70log2 , exp(X) - 1 = exp(X) for all	#
 #		practical purposes. Therefore, go to Step 1 of setox.	#
 #		10.2 If X <= -70log2, exp(X) - 1 = -1 for all practical	#
-#		purposes. 						#
-#		ans := -1 						#
+#		purposes.						#
+#		ans := -1						#
 #		Restore user FPCR					#
 #		Return ans := ans + 2^(-126). Exit.			#
 #	Notes:	10.2 will always create an inexact and return -1 + tiny	#
@@ -7496,10 +7496,10 @@ setoxm1d:
 # sgetexp():  returns the exponent portion of the input argument.	#
 #	      The exponent bias is removed and the exponent value is	#
 #	      returned as an extended precision number in fp0.		#
-# sgetexpd(): handles denormalized numbers. 				#
+# sgetexpd(): handles denormalized numbers.				#
 #									#
-# sgetman():  extracts the mantissa of the input argument. The 		#
-#	      mantissa is converted to an extended precision number w/ 	#
+# sgetman():  extracts the mantissa of the input argument. The		#
+#	      mantissa is converted to an extended precision number w/	#
 #	      an exponent of $3fff and is returned in fp0. The range of #
 #	      the result is [1.0 - 2.0).				#
 # sgetmand(): handles denormalized numbers.				#
@@ -7573,9 +7573,9 @@ sgetmand:
 #	fp0 = cosh(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 3 ulps in 64 significant bit, 	#
+#	The returned result is within 3 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
-#	rounded to double precision. The result is provably monotonic 	#
+#	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
 # ALGORITHM ***********************************************************	#
@@ -7592,7 +7592,7 @@ sgetmand:
 #									#
 #	4. (16380 log2 < |X| <= 16480 log2)				#
 #		cosh(X) = sign(X) * exp(|X|)/2.				#
-#		However, invoking exp(|X|) may cause premature 		#
+#		However, invoking exp(|X|) may cause premature		#
 #		overflow. Thus, we calculate sinh(X) as follows:	#
 #		Y	:= |X|						#
 #		Fact	:=	2**(16380)				#
@@ -7687,7 +7687,7 @@ scoshd:
 #	fp0 = sinh(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 3 ulps in 64 significant bit, 	#
+#	The returned result is within 3 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently #
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
@@ -7805,7 +7805,7 @@ ssinhd:
 #	fp0 = tanh(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 3 ulps in 64 significant bit, 	#
+#	The returned result is within 3 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently #
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
@@ -7971,51 +7971,51 @@ stanhd:
 #	fp0 = log(X) or log(1+X)					#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 2 ulps in 64 significant bit, 	#
+#	The returned result is within 2 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
 # ALGORITHM ***********************************************************	#
 #	LOGN:								#
-#	Step 1. If |X-1| < 1/16, approximate log(X) by an odd 		#
-#		polynomial in u, where u = 2(X-1)/(X+1). Otherwise, 	#
+#	Step 1. If |X-1| < 1/16, approximate log(X) by an odd		#
+#		polynomial in u, where u = 2(X-1)/(X+1). Otherwise,	#
 #		move on to Step 2.					#
 #									#
 #	Step 2. X = 2**k * Y where 1 <= Y < 2. Define F to be the first	#
-#		seven significant bits of Y plus 2**(-7), i.e. 		#
-#		F = 1.xxxxxx1 in base 2 where the six "x" match those 	#
+#		seven significant bits of Y plus 2**(-7), i.e.		#
+#		F = 1.xxxxxx1 in base 2 where the six "x" match those	#
 #		of Y. Note that |Y-F| <= 2**(-7).			#
 #									#
-#	Step 3. Define u = (Y-F)/F. Approximate log(1+u) by a 		#
+#	Step 3. Define u = (Y-F)/F. Approximate log(1+u) by a		#
 #		polynomial in u, log(1+u) = poly.			#
 #									#
-#	Step 4. Reconstruct 						#
+#	Step 4. Reconstruct						#
 #		log(X) = log( 2**k * Y ) = k*log(2) + log(F) + log(1+u)	#
 #		by k*log(2) + (log(F) + poly). The values of log(F) are	#
 #		calculated beforehand and stored in the program.	#
 #									#
 #	lognp1:								#
-#	Step 1: If |X| < 1/16, approximate log(1+X) by an odd 		#
+#	Step 1: If |X| < 1/16, approximate log(1+X) by an odd		#
 #		polynomial in u where u = 2X/(2+X). Otherwise, move on	#
 #		to Step 2.						#
 #									#
 #	Step 2: Let 1+X = 2**k * Y, where 1 <= Y < 2. Define F as done	#
-#		in Step 2 of the algorithm for LOGN and compute 	#
-#		log(1+X) as k*log(2) + log(F) + poly where poly 	#
-#		approximates log(1+u), u = (Y-F)/F. 			#
+#		in Step 2 of the algorithm for LOGN and compute		#
+#		log(1+X) as k*log(2) + log(F) + poly where poly		#
+#		approximates log(1+u), u = (Y-F)/F.			#
 #									#
 #	Implementation Notes:						#
-#	Note 1. There are 64 different possible values for F, thus 64 	#
+#	Note 1. There are 64 different possible values for F, thus 64	#
 #		log(F)'s need to be tabulated. Moreover, the values of	#
 #		1/F are also tabulated so that the division in (Y-F)/F	#
 #		can be performed by a multiplication.			#
 #									#
-#	Note 2. In Step 2 of lognp1, in order to preserved accuracy, 	#
-#		the value Y-F has to be calculated carefully when 	#
-#		1/2 <= X < 3/2. 					#
+#	Note 2. In Step 2 of lognp1, in order to preserved accuracy,	#
+#		the value Y-F has to be calculated carefully when	#
+#		1/2 <= X < 3/2.						#
 #									#
-#	Note 3. To fully exploit the pipeline, polynomials are usually 	#
+#	Note 3. To fully exploit the pipeline, polynomials are usually	#
 #		separated into two parts evaluated independently before	#
 #		being added up.						#
 #									#
@@ -8228,9 +8228,9 @@ LOGBGN:
 	cmp.l		%d1,&0			# CHECK IF X IS NEGATIVE
 	blt.w		LOGNEG			# LOG OF NEGATIVE ARGUMENT IS INVALID
 # X IS POSITIVE, CHECK IF X IS NEAR 1
-	cmp.l		%d1,&0x3ffef07d 	# IS X < 15/16?
+	cmp.l		%d1,&0x3ffef07d		# IS X < 15/16?
 	blt.b		LOGMAIN			# YES
-	cmp.l		%d1,&0x3fff8841 	# IS X > 17/16?
+	cmp.l		%d1,&0x3fff8841		# IS X > 17/16?
 	ble.w		LOGNEAR1		# NO
 
 LOGMAIN:
@@ -8243,7 +8243,7 @@ LOGMAIN:
 #--NOTE THAT U = (Y-F)/F IS VERY SMALL AND THUS APPROXIMATING
 #--LOG(1+U) CAN BE VERY EFFICIENT.
 #--ALSO NOTE THAT THE VALUE 1/F IS STORED IN A TABLE SO THAT NO
-#--DIVISION IS NEEDED TO CALCULATE (Y-F)/F. 
+#--DIVISION IS NEEDED TO CALCULATE (Y-F)/F.
 
 #--GET K, Y, F, AND ADDRESS OF 1/F.
 	asr.l		&8,%d1
@@ -8458,10 +8458,10 @@ LP1REAL:
 	mov.l		X(%a6),%d1
 	cmp.l		%d1,&0
 	ble.w		LP1NEG0			# LOG OF ZERO OR -VE
-	cmp.l		%d1,&0x3ffe8000 	# IS BOUNDS [1/2,3/2]?
+	cmp.l		%d1,&0x3ffe8000		# IS BOUNDS [1/2,3/2]?
 	blt.w		LOGMAIN
 	cmp.l		%d1,&0x3fffc000
-	bgt.w		LOGMAIN 
+	bgt.w		LOGMAIN
 #--IF 1+Z > 3/2 OR 1+Z < 1/2, THEN X, WHICH IS ROUNDING 1+Z,
 #--CONTAINS AT LEAST 63 BITS OF INFORMATION OF Z. IN THAT CASE,
 #--SIMPLY INVOKE LOG(X) FOR LOG(1+Z).
@@ -8562,7 +8562,7 @@ slognp1d:
 #	a0 = pointer to extended precision input			#
 #	d0 = round precision,mode					#
 #									#
-# OUTPUT **************************************************************	# 
+# OUTPUT **************************************************************	#
 #	fp0 = arctanh(X)						#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
@@ -8677,7 +8677,7 @@ satanhd:
 #            2.1 Restore the user FPCR					#
 #            2.2 Return ans := Y * INV_L10.				#
 #									#
-#       slog10: 							#
+#       slog10:								#
 #									#
 #       Step 0. If X < 0, create a NaN and raise the invalid operation	#
 #               flag. Otherwise, save FPCR in D1; set FpCR to default.	#
@@ -8820,7 +8820,7 @@ slog2d:
 #	fp0 = 2**X or 10**X						#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 2 ulps in 64 significant bit, 	#
+#	The returned result is within 2 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
@@ -8851,7 +8851,7 @@ slog2d:
 #									#
 #	4. Define r as							#
 #		r := ((X - N*L1)-N*L2) * L10				#
-#		where L1, L2 are the leading and trailing parts of 	#
+#		where L1, L2 are the leading and trailing parts of	#
 #		log_10(2)/64 and L10 is the natural log of 10. Then	#
 #		10**X = 2**(M') * 2**(M) * 2**(j/64) * exp(r).		#
 #		Go to expr to compute that expression.			#
@@ -8872,7 +8872,7 @@ slog2d:
 #		Exit.							#
 #									#
 #	ExpBig								#
-#	1. Generate overflow by Huge * Huge if X > 0; otherwise, 	#
+#	1. Generate overflow by Huge * Huge if X > 0; otherwise,	#
 #	        generate underflow by Tiny * Tiny.			#
 #									#
 #	ExpSm								#
@@ -9203,7 +9203,7 @@ stentoxd:
 
 #########################################################################
 # sscale(): computes the destination operand scaled by the source	#
-#	    operand. If the absoulute value of the source operand is 	#
+#	    operand. If the absoulute value of the source operand is	#
 #	    >= 2^14, an overflow or underflow is returned.		#
 #									#
 # INPUT *************************************************************** #
@@ -9265,7 +9265,7 @@ sok_dnrm:
 	bge.b		sok_norm2		# thank goodness no
 
 # the multiply factor that we're trying to create should be a denorm
-# for the multiply to work. therefore, we're going to actually do a 
+# for the multiply to work. therefore, we're going to actually do a
 # multiply with a denorm which will cause an unimplemented data type
 # exception to be put into the machine which will be caught and corrected
 # later. we don't do this with the DENORMs above because this method
@@ -9280,7 +9280,7 @@ sok_dnrm:
 	clr.l		-(%sp)			# insert zero low mantissa
 	mov.l		%d1,-(%sp)		# insert new high mantissa
 	clr.l		-(%sp)			# make zero exponent
-	bra.b		sok_norm_cont	
+	bra.b		sok_norm_cont
 sok_dnrm_32:
 	subi.b		&0x20,%d0		# get shift count
 	lsr.l		%d0,%d1			# make low mantissa longword
@@ -9288,7 +9288,7 @@ sok_dnrm_32:
 	clr.l		-(%sp)			# insert zero high mantissa
 	clr.l		-(%sp)			# make zero exponent
 	bra.b		sok_norm_cont
-	
+
 # the src will force the dst to a DENORM value or worse. so, let's
 # create an fp multiply that will create the result.
 sok_norm:
@@ -9346,7 +9346,7 @@ ssmall_done:
 #	a1 = pointer to extended precision input Y			#
 #	d0 = round precision,mode					#
 #									#
-# 	The input operands X and Y can be either normalized or 		#
+#	The input operands X and Y can be either normalized or		#
 #	denormalized.							#
 #									#
 # OUTPUT ************************************************************** #
@@ -9355,7 +9355,7 @@ ssmall_done:
 # ALGORITHM *********************************************************** #
 #									#
 #       Step 1.  Save and strip signs of X and Y: signX := sign(X),	#
-#                signY := sign(Y), X := |X|, Y := |Y|, 			#
+#                signY := sign(Y), X := |X|, Y := |Y|,			#
 #                signQ := signX EOR signY. Record whether MOD or REM	#
 #                is requested.						#
 #									#
@@ -9375,7 +9375,7 @@ ssmall_done:
 #									#
 #       Step 4.  At this point, R = X - QY = MOD(X,Y). Set		#
 #                Last_Subtract := false (used in Step 7 below). If	#
-#                MOD is requested, go to Step 6. 			#
+#                MOD is requested, go to Step 6.			#
 #									#
 #       Step 5.  R = MOD(X,Y), but REM(X,Y) is requested.		#
 #            5.1 If R < Y/2, then R = MOD(X,Y) = REM(X,Y). Go to	#
@@ -9701,8 +9701,8 @@ Restore:
 	mov.b		&FMUL_OP,%d1		# last inst is MUL
 	fmul.x		Scale(%pc),%fp0		# may cause underflow
 	bra		t_catch2
-# the '040 package did this apparently to see if the dst operand for the 
-# preceding fmul was a denorm. but, it better not have been since the 
+# the '040 package did this apparently to see if the dst operand for the
+# preceding fmul was a denorm. but, it better not have been since the
 # algorithm just got done playing with fp0 and expected no exceptions
 # as a result. trust me...
 #	bra		t_avoid_unsupp		# check for denorm as a
@@ -9716,7 +9716,7 @@ Finish:
 Rem_is_0:
 #..R = 2^(-j)X - Q Y = Y, thus R = 0 and quotient = 2^j (Q+1)
 	addq.l		&1,%d3
-	cmp.l		%d0,&8			# D0 is j 
+	cmp.l		%d0,&8			# D0 is j
 	bge.b		Q_Big
 
 	lsl.l		%d0,%d3
@@ -9746,7 +9746,7 @@ Tie_Case:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	tag(): return the optype of the input ext fp number		#
+#	tag(): return the optype of the input ext fp number		#
 #									#
 #	This routine is used by the 060FPLSP.				#
 #									#
@@ -9755,13 +9755,13 @@ Tie_Case:
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #	If it's an unnormalized zero, alter the operand and force it	#
 # to be a normal zero.							#
@@ -9829,15 +9829,15 @@ qnan:	long		0x7fff0000, 0xffffffff, 0xffffffff
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand.		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default DZ result.					#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Transcendental emulation for the 060FPLSP has detected that 	#
+#	Transcendental emulation for the 060FPLSP has detected that	#
 # a DZ exception should occur for the instruction. If DZ is disabled,	#
 # return the default result.						#
-# 	If DZ is enabled, the dst operand should be returned unscathed	#
+#	If DZ is enabled, the dst operand should be returned unscathed	#
 # in fp0 while fp1 is used to create a DZ exception so that the		#
 # operating system can log that such an event occurred.			#
 #									#
@@ -9898,7 +9898,7 @@ dz_pinf_ena:
 #									#
 # INPUT ***************************************************************	#
 #	fp1 = source operand						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #	fp1 = unchanged							#
@@ -9927,7 +9927,7 @@ t_operr:
 # but use fp2 instead. return the dst operand unscathed in fp0.
 operr_ena:
 	fmovm.x		EXC_FP0(%a6),&0x80	# return fp0 unscathed
-	fmov.l		USER_FPCR(%a6),%fpcr	
+	fmov.l		USER_FPCR(%a6),%fpcr
 	fmovm.x		&0x04,-(%sp)		# save fp2
 	fmov.s		&0x7f800000,%fp2	# load +INF
 	fmul.s		&0x00000000,%fp2	# +INF x 0
@@ -9956,7 +9956,7 @@ mns_tiny:
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default underflow result					#
 #									#
@@ -10003,8 +10003,8 @@ unf_pos:
 #		  (monadic)						#
 #	t_ovfl2(): Handle 060FPLSP overflow exception during		#
 #	           emulation. result always positive. (dyadic)		#
-#	t_ovfl_sc(): Handle 060FPLSP overflow exception during 		#
-#	             emulation for "fscale". 				#
+#	t_ovfl_sc(): Handle 060FPLSP overflow exception during		#
+#	             emulation for "fscale".				#
 #									#
 #	This routine is used by the 060FPLSP package.			#
 #									#
@@ -10013,7 +10013,7 @@ unf_pos:
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default underflow result					#
 #									#
@@ -10113,12 +10113,12 @@ t_ovfl2:
 #									#
 # INPUT ***************************************************************	#
 #	fp0 = default underflow or overflow result			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	If an overflow or underflow occurred during the last 		#
+#	If an overflow or underflow occurred during the last		#
 # instruction of transcendental 060FPLSP emulation, then it has already	#
 # occurred and has been logged. Now we need to see if an inexact	#
 # exception should occur.						#
@@ -10147,16 +10147,16 @@ t_catch:
 #									#
 # INPUT ***************************************************************	#
 #	fp0 = default result						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	The last instruction of transcendental emulation for the 	#
+#	The last instruction of transcendental emulation for the	#
 # 060FPLSP should be inexact. So, if inexact is enabled, then we create	#
 # the event here by adding a large and very small number together	#
 # so that the operating system can log the event.			#
-# 	Must check, too, if the result was zero, in which case we just	#
+#	Must check, too, if the result was zero, in which case we just	#
 # set the FPSR bits and return.						#
 #									#
 #########################################################################
@@ -10178,7 +10178,7 @@ t_minx2:
 inx2_work:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # is inexact enabled?
 	bne.b		inx2_work_ena		# yes
-	rts	
+	rts
 inx2_work_ena:
 	fmov.l		USER_FPCR(%a6),%fpcr	# insert user's exceptions
 	fmov.s		&0x3f800000,%fp1	# load +1
@@ -10202,7 +10202,7 @@ inx2_zero:
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision input operand		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #									#
@@ -10235,7 +10235,7 @@ t_resdnrm:
 
 #
 # sto_cos:
-# 	This is used by fsincos library emulation. The correct
+#	This is used by fsincos library emulation. The correct
 # values are already in fp0 and fp1 so we do nothing here.
 #
 	global		sto_cos
@@ -10485,7 +10485,7 @@ ld_mzero:
 #########################################################################
 	global		dst_zero
 dst_zero:
-	tst.b		DST_EX(%a1) 		# get sign of dst operand
+	tst.b		DST_EX(%a1)		# get sign of dst operand
 	bmi.b		ld_mzero		# if neg, load neg zero
 	bra.b		ld_pzero		# load positive zero
 
@@ -10494,7 +10494,7 @@ dst_zero:
 #########################################################################
 	global		src_inf
 src_inf:
-	tst.b		SRC_EX(%a0) 		# get sign of src operand
+	tst.b		SRC_EX(%a0)		# get sign of src operand
 	bmi.b		ld_minf			# if negative branch
 
 #
@@ -10520,7 +10520,7 @@ ld_minf:
 #########################################################################
 	global		dst_inf
 dst_inf:
-	tst.b		DST_EX(%a1) 		# get sign of dst operand
+	tst.b		DST_EX(%a1)		# get sign of dst operand
 	bmi.b		ld_minf			# if negative branch
 	bra.b		ld_pinf
 
@@ -10562,7 +10562,7 @@ setoxm1i:
 #########################################################################
 	global		src_one
 src_one:
-	tst.b		SRC_EX(%a0) 		# check sign of source
+	tst.b		SRC_EX(%a0)		# check sign of source
 	bmi.b		ld_mone
 
 #
@@ -10591,7 +10591,7 @@ mpiby2:	long		0xbfff0000, 0xc90fdaa2, 0x2168c235
 #################################################################
 	global		spi_2
 spi_2:
-	tst.b		SRC_EX(%a0) 		# check sign of source
+	tst.b		SRC_EX(%a0)		# check sign of source
 	bmi.b		ld_mpi2
 
 #
@@ -10618,7 +10618,7 @@ ld_mpi2:
 
 #
 # ssincosz(): When the src operand is ZERO, store a one in the
-# 	      cosine register and return a ZERO in fp0 w/ the same sign
+#	      cosine register and return a ZERO in fp0 w/ the same sign
 #	      as the src operand.
 #
 	global		ssincosz
@@ -10646,7 +10646,7 @@ ssincosi:
 
 #
 # ssincosqnan(): When the src operand is a QNAN, store the QNAN in the cosine
-# 		 register and branch to the src QNAN routine.
+#		 register and branch to the src QNAN routine.
 #
 	global		ssincosqnan
 ssincosqnan:
@@ -10827,7 +10827,7 @@ sop_sqnan:
 #	a0 = pointer fp extended precision operand to normalize		#
 #									#
 # OUTPUT ************************************************************** #
-# 	d0 = number of bit positions the mantissa was shifted		#
+#	d0 = number of bit positions the mantissa was shifted		#
 #	a0 = the input operand's mantissa is normalized; the exponent	#
 #	     is unchanged.						#
 #									#
@@ -10854,7 +10854,7 @@ norm_hi:
 	mov.l		%d1, FTEMP_LO(%a0)	# store new lo(man)
 
 	mov.l		%d2, %d0		# return shift amount
-	
+
 	mov.l		(%sp)+, %d3		# restore temp regs
 	mov.l		(%sp)+, %d2
 
@@ -10869,7 +10869,7 @@ norm_lo:
 	clr.l		FTEMP_LO(%a0)		# lo(man) is now zero
 
 	mov.l		%d2, %d0		# return shift amount
-	
+
 	mov.l		(%sp)+, %d3		# restore temp regs
 	mov.l		(%sp)+, %d2
 
@@ -10974,7 +10974,7 @@ unnorm_nrm_zero_lrg:
 # whole mantissa is zero so this UNNORM is actually a zero
 #
 unnorm_zero:
-	and.w		&0x8000, FTEMP_EX(%a0) 	# force exponent to zero
+	and.w		&0x8000, FTEMP_EX(%a0)	# force exponent to zero
 
 	mov.b		&ZERO, %d0		# fix optype tag
 	rts
diff --git a/arch/m68k/ifpsp060/src/fpsp.S b/arch/m68k/ifpsp060/src/fpsp.S
index 73805f830..3b597a9bb 100644
--- a/arch/m68k/ifpsp060/src/fpsp.S
+++ b/arch/m68k/ifpsp060/src/fpsp.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -90,7 +90,7 @@ _060FPSP_TABLE:
 	bra.l		_fpsp_effadd
 	short		0x0000
 
-	space 		56
+	space		56
 
 ###############################################################
 	global		_fpsp_done
@@ -324,33 +324,33 @@ set EXC_D2,		EXC_DREGS+(2*4)
 set EXC_D1,		EXC_DREGS+(1*4)
 set EXC_D0,		EXC_DREGS+(0*4)
 
-set EXC_FP0, 		EXC_FPREGS+(0*12)	# offset of saved fp0
-set EXC_FP1, 		EXC_FPREGS+(1*12)	# offset of saved fp1
-set EXC_FP2, 		EXC_FPREGS+(2*12)	# offset of saved fp2 (not used)
+set EXC_FP0,		EXC_FPREGS+(0*12)	# offset of saved fp0
+set EXC_FP1,		EXC_FPREGS+(1*12)	# offset of saved fp1
+set EXC_FP2,		EXC_FPREGS+(2*12)	# offset of saved fp2 (not used)
 
-set FP_SCR1, 		LV+80			# fp scratch 1
-set FP_SCR1_EX, 	FP_SCR1+0
+set FP_SCR1,		LV+80			# fp scratch 1
+set FP_SCR1_EX,		FP_SCR1+0
 set FP_SCR1_SGN,	FP_SCR1+2
-set FP_SCR1_HI, 	FP_SCR1+4
-set FP_SCR1_LO, 	FP_SCR1+8
+set FP_SCR1_HI,		FP_SCR1+4
+set FP_SCR1_LO,		FP_SCR1+8
 
-set FP_SCR0, 		LV+68			# fp scratch 0
-set FP_SCR0_EX, 	FP_SCR0+0
+set FP_SCR0,		LV+68			# fp scratch 0
+set FP_SCR0_EX,		FP_SCR0+0
 set FP_SCR0_SGN,	FP_SCR0+2
-set FP_SCR0_HI, 	FP_SCR0+4
-set FP_SCR0_LO, 	FP_SCR0+8
+set FP_SCR0_HI,		FP_SCR0+4
+set FP_SCR0_LO,		FP_SCR0+8
 
-set FP_DST, 		LV+56			# fp destination operand
-set FP_DST_EX, 		FP_DST+0
+set FP_DST,		LV+56			# fp destination operand
+set FP_DST_EX,		FP_DST+0
 set FP_DST_SGN,		FP_DST+2
-set FP_DST_HI, 		FP_DST+4
-set FP_DST_LO, 		FP_DST+8
+set FP_DST_HI,		FP_DST+4
+set FP_DST_LO,		FP_DST+8
 
-set FP_SRC, 		LV+44			# fp source operand
-set FP_SRC_EX, 		FP_SRC+0
+set FP_SRC,		LV+44			# fp source operand
+set FP_SRC_EX,		FP_SRC+0
 set FP_SRC_SGN,		FP_SRC+2
-set FP_SRC_HI, 		FP_SRC+4
-set FP_SRC_LO, 		FP_SRC+8
+set FP_SRC_HI,		FP_SRC+4
+set FP_SRC_LO,		FP_SRC+8
 
 set USER_FPIAR,		LV+40			# FP instr address register
 
@@ -374,7 +374,7 @@ set EXC_TEMP2,		LV+24			# temporary space
 set EXC_TEMP,		LV+16			# temporary space
 
 set DTAG,		LV+15			# destination operand type
-set STAG, 		LV+14			# source operand type
+set STAG,		LV+14			# source operand type
 
 set SPCOND_FLG,		LV+10			# flag: special case (see below)
 
@@ -389,17 +389,17 @@ set EXC_OPWORD,		LV+0			# saved operation word
 # Helpful macros
 
 set FTEMP,		0			# offsets within an
-set FTEMP_EX, 		0			# extended precision
+set FTEMP_EX,		0			# extended precision
 set FTEMP_SGN,		2			# value saved in memory.
-set FTEMP_HI, 		4
-set FTEMP_LO, 		8
+set FTEMP_HI,		4
+set FTEMP_LO,		8
 set FTEMP_GRS,		12
 
 set LOCAL,		0			# offsets within an
-set LOCAL_EX, 		0			# extended precision 
+set LOCAL_EX,		0			# extended precision
 set LOCAL_SGN,		2			# value saved in memory.
-set LOCAL_HI, 		4
-set LOCAL_LO, 		8
+set LOCAL_HI,		4
+set LOCAL_LO,		8
 set LOCAL_GRS,		12
 
 set DST,		0			# offsets within an
@@ -489,17 +489,17 @@ set ainex_mask,		0x00000008		# accrued inexact
 ######################################
 set dzinf_mask,		inf_mask+dz_mask+adz_mask
 set opnan_mask,		nan_mask+operr_mask+aiop_mask
-set nzi_mask,		0x01ffffff 		#clears N, Z, and I
+set nzi_mask,		0x01ffffff		#clears N, Z, and I
 set unfinx_mask,	unfl_mask+inex2_mask+aunfl_mask+ainex_mask
 set unf2inx_mask,	unfl_mask+inex2_mask+ainex_mask
 set ovfinx_mask,	ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
 set inx1a_mask,		inex1_mask+ainex_mask
 set inx2a_mask,		inex2_mask+ainex_mask
-set snaniop_mask, 	nan_mask+snan_mask+aiop_mask
+set snaniop_mask,	nan_mask+snan_mask+aiop_mask
 set snaniop2_mask,	snan_mask+aiop_mask
 set naniop_mask,	nan_mask+aiop_mask
 set neginf_mask,	neg_mask+inf_mask
-set infaiop_mask, 	inf_mask+aiop_mask
+set infaiop_mask,	inf_mask+aiop_mask
 set negz_mask,		neg_mask+z_mask
 set opaop_mask,		operr_mask+aiop_mask
 set unfl_inx_mask,	unfl_mask+aunfl_mask+ainex_mask
@@ -528,8 +528,8 @@ set rp_mode,		0x3			# round-to-plus-infinity
 set mantissalen,	64			# length of mantissa in bits
 
 set BYTE,		1			# len(byte) == 1 byte
-set WORD, 		2			# len(word) == 2 bytes
-set LONG, 		4			# len(longword) == 2 bytes
+set WORD,		2			# len(word) == 2 bytes
+set LONG,		4			# len(longword) == 2 bytes
 
 set BSUN_VEC,		0xc0			# bsun    vector offset
 set INEX_VEC,		0xc4			# inexact vector offset
@@ -599,7 +599,7 @@ TWOBYPI:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Ovfl exception stack frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	Overflow Exception enabled:					#
 #	- The system stack is unchanged					#
@@ -610,24 +610,24 @@ TWOBYPI:
 #									#
 # ALGORITHM ***********************************************************	#
 #	On the 060, if an FP overflow is present as the result of any	#
-# instruction, the 060 will take an overflow exception whether the 	#
-# exception is enabled or disabled in the FPCR. For the disabled case, 	#
+# instruction, the 060 will take an overflow exception whether the	#
+# exception is enabled or disabled in the FPCR. For the disabled case,	#
 # This handler emulates the instruction to determine what the correct	#
 # default result should be for the operation. This default result is	#
-# then stored in either the FP regfile, data regfile, or memory. 	#
-# Finally, the handler exits through the "callout" _fpsp_done() 	#
+# then stored in either the FP regfile, data regfile, or memory.	#
+# Finally, the handler exits through the "callout" _fpsp_done()		#
 # denoting that no exceptional conditions exist within the machine.	#
-# 	If the exception is enabled, then this handler must create the	#
+#	If the exception is enabled, then this handler must create the	#
 # exceptional operand and plave it in the fsave state frame, and store	#
-# the default result (only if the instruction is opclass 3). For 	#
-# exceptions enabled, this handler must exit through the "callout" 	#
+# the default result (only if the instruction is opclass 3). For	#
+# exceptions enabled, this handler must exit through the "callout"	#
 # _real_ovfl() so that the operating system enabled overflow handler	#
 # can handle this case.							#
-#	Two other conditions exist. First, if overflow was disabled 	#
-# but the inexact exception was enabled, this handler must exit 	#
+#	Two other conditions exist. First, if overflow was disabled	#
+# but the inexact exception was enabled, this handler must exit		#
 # through the "callout" _real_inex() regardless of whether the result	#
 # was inexact.								#
-#	Also, in the case of an opclass three instruction where 	#
+#	Also, in the case of an opclass three instruction where		#
 # overflow was disabled and the trace exception was enabled, this	#
 # handler must exit through the "callout" _real_trace().		#
 #									#
@@ -642,9 +642,9 @@ _fpsp_ovfl:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
@@ -668,7 +668,7 @@ _fpsp_ovfl:
 	bsr.l		set_tag_x		# tag the operand type
 	mov.b		%d0,STAG(%a6)		# maybe NORM,DENORM
 
-# bit five of the fp extension word separates the monadic and dyadic operations 
+# bit five of the fp extension word separates the monadic and dyadic operations
 # that can pass through fpsp_ovfl(). remember that fcmp, ftst, and fsincos
 # will never take this exception.
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is operation monadic or dyadic?
@@ -741,7 +741,7 @@ fovfl_extract:
 fovfl_ovfl_on:
 	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP (fp1) to stack
 
-	mov.w		&0xe005,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe005,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -757,10 +757,10 @@ fovfl_ovfl_on:
 # we must jump to real_inex().
 fovfl_inex_on:
 
-	fmovm.x		&0x40,FP_SRC(%a6) 	# save EXOP (fp1) to stack
+	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP (fp1) to stack
 
 	mov.b		&0xc4,1+EXC_VOFF(%a6)	# vector offset = 0xc4
-	mov.w		&0xe001,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe001,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -811,7 +811,7 @@ fovfl_out:
 	btst		&0x7,(%sp)		# is trace on?
 	beq.l		_fpsp_done		# no
 
-	fmov.l		%fpiar,0x8(%sp)		# "Current PC" is in FPIAR	
+	fmov.l		%fpiar,0x8(%sp)		# "Current PC" is in FPIAR
 	mov.w		&0x2024,0x6(%sp)	# stk fmt = 0x2; voff = 0x024
 	bra.l		_real_trace
 
@@ -839,7 +839,7 @@ fovfl_out:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Unfl exception stack frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	Underflow Exception enabled:					#
 #	- The system stack is unchanged					#
@@ -850,24 +850,24 @@ fovfl_out:
 #									#
 # ALGORITHM ***********************************************************	#
 #	On the 060, if an FP underflow is present as the result of any	#
-# instruction, the 060 will take an underflow exception whether the 	#
-# exception is enabled or disabled in the FPCR. For the disabled case, 	#
+# instruction, the 060 will take an underflow exception whether the	#
+# exception is enabled or disabled in the FPCR. For the disabled case,	#
 # This handler emulates the instruction to determine what the correct	#
 # default result should be for the operation. This default result is	#
-# then stored in either the FP regfile, data regfile, or memory. 	#
-# Finally, the handler exits through the "callout" _fpsp_done() 	#
+# then stored in either the FP regfile, data regfile, or memory.	#
+# Finally, the handler exits through the "callout" _fpsp_done()		#
 # denoting that no exceptional conditions exist within the machine.	#
-# 	If the exception is enabled, then this handler must create the	#
+#	If the exception is enabled, then this handler must create the	#
 # exceptional operand and plave it in the fsave state frame, and store	#
-# the default result (only if the instruction is opclass 3). For 	#
-# exceptions enabled, this handler must exit through the "callout" 	#
+# the default result (only if the instruction is opclass 3). For	#
+# exceptions enabled, this handler must exit through the "callout"	#
 # _real_unfl() so that the operating system enabled overflow handler	#
 # can handle this case.							#
-#	Two other conditions exist. First, if underflow was disabled 	#
-# but the inexact exception was enabled and the result was inexact, 	#
+#	Two other conditions exist. First, if underflow was disabled	#
+# but the inexact exception was enabled and the result was inexact,	#
 # this handler must exit through the "callout" _real_inex().		#
 # was inexact.								#
-#	Also, in the case of an opclass three instruction where 	#
+#	Also, in the case of an opclass three instruction where		#
 # underflow was disabled and the trace exception was enabled, this	#
 # handler must exit through the "callout" _real_trace().		#
 #									#
@@ -882,12 +882,12 @@ _fpsp_unfl:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
-	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)	
+	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -906,13 +906,13 @@ _fpsp_unfl:
 	bsr.l		set_tag_x		# tag the operand type
 	mov.b		%d0,STAG(%a6)		# maybe NORM,DENORM
 
-# bit five of the fp ext word separates the monadic and dyadic operations 
+# bit five of the fp ext word separates the monadic and dyadic operations
 # that can pass through fpsp_unfl(). remember that fcmp, and ftst
 # will never take this exception.
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is op monadic or dyadic?
 	beq.b		funfl_extract		# monadic
 
-# now, what's left that's not dyadic is fsincos. we can distinguish it 
+# now, what's left that's not dyadic is fsincos. we can distinguish it
 # from all dyadics by the '0110xxx pattern
 	btst		&0x4,1+EXC_CMDREG(%a6)	# is op an fsincos?
 	bne.b		funfl_extract		# yes
@@ -963,7 +963,7 @@ funfl_extract:
 # (0x00000000_80000000_00000000), then the machine will take an
 # underflow exception. Since this is incorrect, we need to check
 # if our emulation, after re-doing the operation, decided that
-# no underflow was called for. We do these checks only in 
+# no underflow was called for. We do these checks only in
 # funfl_{unfl,inex}_on() because w/ both exceptions disabled, this
 # special case will simply exit gracefully with the correct result.
 
@@ -1003,7 +1003,7 @@ funfl_unfl_on:
 funfl_unfl_on2:
 	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP (fp1) to stack
 
-	mov.w		&0xe003,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe003,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -1022,7 +1022,7 @@ funfl_inex_on:
 # The `060 FPU multiplier hardware is such that if the result of a
 # multiply operation is the smallest possible normalized number
 # (0x00000000_80000000_00000000), then the machine will take an
-# underflow exception. 
+# underflow exception.
 # But, whether bogus or not, if inexact is enabled AND it occurred,
 # then we have to branch to real_inex.
 
@@ -1031,10 +1031,10 @@ funfl_inex_on:
 
 funfl_inex_on2:
 
-	fmovm.x		&0x40,FP_SRC(%a6) 	# save EXOP to stack
+	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP to stack
 
 	mov.b		&0xc4,1+EXC_VOFF(%a6)	# vector offset = 0xc4
-	mov.w		&0xe001,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe001,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -1120,7 +1120,7 @@ funfl_out:
 # INPUT ***************************************************************	#
 #	- The system stack contains the "Unimp Data Type" stk frame	#
 #	- The fsave frame contains the ssrc op (for UNNORM/DENORM)	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If Inexact exception (opclass 3):				#
 #	- The system stack is changed to an Inexact exception stk frame	#
@@ -1139,12 +1139,12 @@ funfl_out:
 #									#
 # ALGORITHM ***********************************************************	#
 #	Two main instruction types can enter here: (1) DENORM or UNNORM	#
-# unimplemented data types. These can be either opclass 0,2 or 3 	#
+# unimplemented data types. These can be either opclass 0,2 or 3	#
 # instructions, and (2) PACKED unimplemented data format instructions	#
 # also of opclasses 0,2, or 3.						#
 #	For UNNORM/DENORM opclass 0 and 2, the handler fetches the src	#
 # operand from the fsave state frame and the dst operand (if dyadic)	#
-# from the FP register file. The instruction is then emulated by 	#
+# from the FP register file. The instruction is then emulated by	#
 # choosing an emulation routine from a table of routines indexed by	#
 # instruction type. Once the instruction has been emulated and result	#
 # saved, then we check to see if any enabled exceptions resulted from	#
@@ -1166,7 +1166,7 @@ funfl_out:
 # (a Trace stack frame must be created here, too). If an FP exception	#
 # should occur, then we must create an exception stack frame of that	#
 # type and jump to either _real_snan(), _real_operr(), _real_inex(),	#
-# _real_unfl(), or _real_ovfl() as appropriate. PACKED opclass 3 	#
+# _real_unfl(), or _real_ovfl() as appropriate. PACKED opclass 3	#
 # emulation is performed in a similar manner.				#
 #									#
 #########################################################################
@@ -1178,7 +1178,7 @@ funfl_out:
 #				*****************
 #				*      EA	*
 #	 pre-instruction	*		*
-# 	*****************	*****************
+#	*****************	*****************
 #	* 0x0 *  0x0dc  *	* 0x3 *  0x0dc  *
 #	*****************	*****************
 #	*     Next	*	*     Next	*
@@ -1207,9 +1207,9 @@ _fpsp_unsupp:
 
 	fsave		FP_SRC(%a6)		# save fp state
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 	btst		&0x5,EXC_SR(%a6)	# user or supervisor mode?
 	bne.b		fu_s
@@ -1258,7 +1258,7 @@ fu_cont:
 	fmov.l		&0x0,%fpsr
 
 # Opclass two w/ memory-to-fpn operation will have an incorrect extended
-# precision format if the src format was single or double and the 
+# precision format if the src format was single or double and the
 # source data type was an INF, NAN, DENORM, or UNNORM
 	lea		FP_SRC(%a6),%a0		# pass ptr to input
 	bsr.l		fix_skewed_ops
@@ -1277,7 +1277,7 @@ fu_op2:
 
 	bfextu		EXC_CMDREG(%a6){&6:&3},%d0 # dyadic; load dst reg
 
-# bit five of the fp extension word separates the monadic and dyadic operations 
+# bit five of the fp extension word separates the monadic and dyadic operations
 # at this point
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is operation monadic or dyadic?
 	beq.b		fu_extract		# monadic
@@ -1308,13 +1308,13 @@ fu_extract:
 
 #
 # Exceptions in order of precedence:
-# 	BSUN	: none
+#	BSUN	: none
 #	SNAN	: all dyadic ops
 #	OPERR	: fsqrt(-NORM)
 #	OVFL	: all except ftst,fcmp
 #	UNFL	: all except ftst,fcmp
 #	DZ	: fdiv
-# 	INEX2	: all except ftst,fcmp
+#	INEX2	: all except ftst,fcmp
 #	INEX1	: none (packed doesn't go through here)
 #
 
@@ -1351,16 +1351,16 @@ fu_in_ena:
 #
 # No exceptions occurred that were also enabled. Now:
 #
-#   	if (OVFL && ovfl_disabled && inexact_enabled) {
+#	if (OVFL && ovfl_disabled && inexact_enabled) {
 #	    branch to _real_inex() (even if the result was exact!);
-#     	} else {
+#	} else {
 #	    save the result in the proper fp reg (unless the op is fcmp or ftst);
 #	    return;
-#     	}
+#	}
 #
 	btst		&ovfl_bit,FPSR_EXCEPT(%a6) # was overflow set?
 	beq.b		fu_in_cont		# no
-	
+
 fu_in_ovflchk:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # was inexact enabled?
 	beq.b		fu_in_cont		# no
@@ -1380,7 +1380,7 @@ fu_in_ovflchk:
 #	} else {
 #		restore exc state (SNAN||OPERR||OVFL||UNFL||DZ||INEX) into the FPU;
 #	}
-#	    		
+#
 fu_in_exc:
 	subi.l		&24,%d0			# fix offset to be 0-8
 	cmpi.b		%d0,&0x6		# is exception INEX? (6)
@@ -1393,7 +1393,7 @@ fu_in_exc:
 	bne.w		fu_in_exc_ovfl		# yes
 
 # here, we insert the correct fsave status value into the fsave frame for the
-# corresponding exception. the operand in the fsave frame should be the original 
+# corresponding exception. the operand in the fsave frame should be the original
 # src operand.
 fu_in_exc_exit:
 	mov.l		%d0,-(%sp)		# save d0
@@ -1424,8 +1424,8 @@ fu_in_exc_ovfl:
 	bra.b		fu_in_exc_exit
 
 # If the input operand to this operation was opclass two and a single
-# or double precision denorm, inf, or nan, the operand needs to be 
-# "corrected" in order to have the proper equivalent extended precision 
+# or double precision denorm, inf, or nan, the operand needs to be
+# "corrected" in order to have the proper equivalent extended precision
 # number.
 	global		fix_skewed_ops
 fix_skewed_ops:
@@ -1453,7 +1453,7 @@ fso_sgl_dnrm:
 	bsr.l		norm			# normalize mantissa
 	neg.w		%d0			# -shft amt
 	addi.w		&0x3f81,%d0		# adjust new exponent
-	andi.w		&0x8000,LOCAL_EX(%a0) 	# clear old exponent
+	andi.w		&0x8000,LOCAL_EX(%a0)	# clear old exponent
 	or.w		%d0,LOCAL_EX(%a0)	# insert new exponent
 	rts
 
@@ -1462,7 +1462,7 @@ fso_zero:
 	rts
 
 fso_infnan:
-	andi.b		&0x7f,LOCAL_HI(%a0) 	# clear j-bit
+	andi.b		&0x7f,LOCAL_HI(%a0)	# clear j-bit
 	ori.w		&0x7fff,LOCAL_EX(%a0)	# make exponent = $7fff
 	rts
 
@@ -1485,7 +1485,7 @@ fso_dbl_dnrm:
 	bsr.l		norm			# normalize mantissa
 	neg.w		%d0			# -shft amt
 	addi.w		&0x3c01,%d0		# adjust new exponent
-	andi.w		&0x8000,LOCAL_EX(%a0) 	# clear old exponent
+	andi.w		&0x8000,LOCAL_EX(%a0)	# clear old exponent
 	or.w		%d0,LOCAL_EX(%a0)	# insert new exponent
 	rts
 
@@ -1537,13 +1537,13 @@ fu_out_cont:
 	bsr.l		fout			# call fmove out routine
 
 # Exceptions in order of precedence:
-# 	BSUN	: none
+#	BSUN	: none
 #	SNAN	: none
 #	OPERR	: fmove.{b,w,l} out of large UNNORM
 #	OVFL	: fmove.{s,d}
 #	UNFL	: fmove.{s,d,x}
 #	DZ	: none
-# 	INEX2	: all
+#	INEX2	: all
 #	INEX1	: none (packed doesn't travel through here)
 
 # determine the highest priority exception(if any) set by the
@@ -1555,7 +1555,7 @@ fu_out_done:
 
 	mov.l		EXC_A6(%a6),(%a6)	# in case a6 changed
 
-# on extended precision opclass three instructions using pre-decrement or 
+# on extended precision opclass three instructions using pre-decrement or
 # post-increment addressing mode, the address register is not updated. is the
 # address register was the stack pointer used from user mode, then let's update
 # it here. if it was used from supervisor mode, then we have to handle this
@@ -1579,7 +1579,7 @@ fu_out_done_cont:
 	bra.l		_fpsp_done
 
 # is the ea mode pre-decrement of the stack pointer from supervisor mode?
-# ("fmov.x fpm,-(a7)") if so, 
+# ("fmov.x fpm,-(a7)") if so,
 fu_out_done_s:
 	cmpi.b		SPCOND_FLG(%a6),&mda7_flg
 	bne.b		fu_out_done_cont
@@ -1617,7 +1617,7 @@ fu_out_ena:
 	bfffo		%d0{&24:&8},%d0		# find highest priority exception
 	bne.b		fu_out_exc		# there is at least one set
 
-# no exceptions were set. 
+# no exceptions were set.
 # if a disabled overflow occurred and inexact was enabled but the result
 # was exact, then a branch to _real_inex() is made.
 	btst		&ovfl_bit,FPSR_EXCEPT(%a6) # was overflow set?
@@ -1634,7 +1634,7 @@ fu_out_ovflchk:
 # from FPIAR and put it in the trace stack frame then jump to _real_trace().
 #
 #		  UNSUPP FRAME		   TRACE FRAME
-# 		*****************	*****************
+#		*****************	*****************
 #		*      EA	*	*    Current	*
 #		*		*	*      PC	*
 #		*****************	*****************
@@ -1651,7 +1651,7 @@ fu_out_trace:
 	fmov.l		%fpiar,0x8(%sp)
 	bra.l		_real_trace
 
-# an exception occurred and that exception was enabled. 	
+# an exception occurred and that exception was enabled.
 fu_out_exc:
 	subi.l		&24,%d0			# fix offset to be 0-8
 
@@ -1663,15 +1663,15 @@ fu_out_exc:
 	swbeg		&0x8
 tbl_fu_out:
 	short		tbl_fu_out	- tbl_fu_out	# BSUN can't happen
-	short		tbl_fu_out 	- tbl_fu_out	# SNAN can't happen
+	short		tbl_fu_out	- tbl_fu_out	# SNAN can't happen
 	short		fu_operr	- tbl_fu_out	# OPERR
-	short		fu_ovfl 	- tbl_fu_out	# OVFL
-	short		fu_unfl 	- tbl_fu_out	# UNFL
+	short		fu_ovfl		- tbl_fu_out	# OVFL
+	short		fu_unfl		- tbl_fu_out	# UNFL
 	short		tbl_fu_out	- tbl_fu_out	# DZ can't happen
-	short		fu_inex 	- tbl_fu_out	# INEX2
+	short		fu_inex		- tbl_fu_out	# INEX2
 	short		tbl_fu_out	- tbl_fu_out	# INEX1 won't make it here
 
-# for snan,operr,ovfl,unfl, src op is still in FP_SRC so just 
+# for snan,operr,ovfl,unfl, src op is still in FP_SRC so just
 # frestore it.
 fu_snan:
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0/fp1
@@ -1722,7 +1722,7 @@ fu_ovfl:
 # underflow can happen for extended precision. extended precision opclass
 # three instruction exceptions don't update the stack pointer. so, if the
 # exception occurred from user mode, then simply update a7 and exit normally.
-# if the exception occurred from supervisor mode, check if 
+# if the exception occurred from supervisor mode, check if
 fu_unfl:
 	mov.l		EXC_A6(%a6),(%a6)	# restore a6
 
@@ -1731,7 +1731,7 @@ fu_unfl:
 
 	mov.l		EXC_A7(%a6),%a0		# restore a7 whether we need
 	mov.l		%a0,%usp		# to or not...
-	
+
 fu_unfl_cont:
 	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP to the stack
 
@@ -1822,7 +1822,7 @@ fu_in_pack:
 
 	bfextu		EXC_CMDREG(%a6){&6:&3},%d0 # dyadic; load dst reg
 
-# bit five of the fp extension word separates the monadic and dyadic operations 
+# bit five of the fp extension word separates the monadic and dyadic operations
 # at this point
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is operation monadic or dyadic?
 	beq.b		fu_extract_p		# monadic
@@ -1853,13 +1853,13 @@ fu_extract_p:
 
 #
 # Exceptions in order of precedence:
-# 	BSUN	: none
+#	BSUN	: none
 #	SNAN	: all dyadic ops
 #	OPERR	: fsqrt(-NORM)
 #	OVFL	: all except ftst,fcmp
 #	UNFL	: all except ftst,fcmp
 #	DZ	: fdiv
-# 	INEX2	: all except ftst,fcmp
+#	INEX2	: all except ftst,fcmp
 #	INEX1	: all
 #
 
@@ -1929,16 +1929,16 @@ fu_in_ena_p:
 #
 # No exceptions occurred that were also enabled. Now:
 #
-#   	if (OVFL && ovfl_disabled && inexact_enabled) {
+#	if (OVFL && ovfl_disabled && inexact_enabled) {
 #	    branch to _real_inex() (even if the result was exact!);
-#     	} else {
+#	} else {
 #	    save the result in the proper fp reg (unless the op is fcmp or ftst);
 #	    return;
-#     	}
+#	}
 #
 	btst		&ovfl_bit,FPSR_EXCEPT(%a6) # was overflow set?
 	beq.w		fu_in_cont_p		# no
-	
+
 fu_in_ovflchk_p:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # was inexact enabled?
 	beq.w		fu_in_cont_p		# no
@@ -1958,7 +1958,7 @@ fu_in_ovflchk_p:
 #	} else {
 #		restore exc state (SNAN||OPERR||OVFL||UNFL||DZ||INEX) into the FPU;
 #	}
-#	    		
+#
 fu_in_exc_p:
 	subi.l		&24,%d0			# fix offset to be 0-8
 	cmpi.b		%d0,&0x6		# is exception INEX? (6 or 7)
@@ -1971,7 +1971,7 @@ fu_in_exc_p:
 	bne.w		fu_in_exc_ovfl_p	# yes
 
 # here, we insert the correct fsave status value into the fsave frame for the
-# corresponding exception. the operand in the fsave frame should be the original 
+# corresponding exception. the operand in the fsave frame should be the original
 # src operand.
 # as a reminder for future predicted pain and agony, we are passing in fsave the
 # "non-skewed" operand for cases of sgl and dbl src INFs,NANs, and DENORMs.
@@ -2034,21 +2034,21 @@ fu_in_exc_exit_s_p:
 	bne.b		fu_trace_p		# yes
 
 	bra.l		_fpsp_done		# exit to os
-	
+
 #
-# The opclass two PACKED instruction that took an "Unimplemented Data Type" 
-# exception was being traced. Make the "current" PC the FPIAR and put it in the 
+# The opclass two PACKED instruction that took an "Unimplemented Data Type"
+# exception was being traced. Make the "current" PC the FPIAR and put it in the
 # trace stack frame then jump to _real_trace().
-#					
+#
 #		  UNSUPP FRAME		   TRACE FRAME
 #		*****************	*****************
 #		*      EA	*	*    Current	*
 #		*		*	*      PC	*
 #		*****************	*****************
-#		* 0x2 *	0x0dc	* 	* 0x2 *  0x024	*
+#		* 0x2 *	0x0dc	*	* 0x2 *  0x024	*
 #		*****************	*****************
 #		*     Next	*	*     Next	*
-#		*      PC	*      	*      PC	*
+#		*      PC	*	*      PC	*
 #		*****************	*****************
 #		*      SR	*	*      SR	*
 #		*****************	*****************
@@ -2094,13 +2094,13 @@ fu_op2_p:
 	bsr.l		fout			# call fmove out routine
 
 # Exceptions in order of precedence:
-# 	BSUN	: no
+#	BSUN	: no
 #	SNAN	: yes
 #	OPERR	: if ((k_factor > +17) || (dec. exp exceeds 3 digits))
 #	OVFL	: no
 #	UNFL	: no
 #	DZ	: no
-# 	INEX2	: yes
+#	INEX2	: yes
 #	INEX1	: no
 
 # determine the highest priority exception(if any) set by the
@@ -2164,7 +2164,7 @@ fu_out_ena_p:
 
 	mov.l		EXC_A6(%a6),(%a6)	# restore a6
 
-# an exception occurred and that exception was enabled. 	
+# an exception occurred and that exception was enabled.
 # the only exception possible on packed move out are INEX, OPERR, and SNAN.
 fu_out_exc_p:
 	cmpi.b		%d0,&0x1a
@@ -2191,7 +2191,7 @@ fu_snan_s_p:
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	mov.w		&0x30d8,EXC_VOFF(%a6)	# vector offset = 0xd0
-	mov.w		&0xe006,2+FP_SRC(%a6) 	# set fsave status
+	mov.w		&0xe006,2+FP_SRC(%a6)	# set fsave status
 
 	frestore	FP_SRC(%a6)		# restore src operand
 
@@ -2231,7 +2231,7 @@ fu_operr_p_s:
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	mov.w		&0x30d0,EXC_VOFF(%a6)	# vector offset = 0xd0
-	mov.w		&0xe004,2+FP_SRC(%a6) 	# set fsave status
+	mov.w		&0xe004,2+FP_SRC(%a6)	# set fsave status
 
 	frestore	FP_SRC(%a6)		# restore src operand
 
@@ -2270,8 +2270,8 @@ fu_inex_s_p2:
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
-	mov.w		&0x30c4,EXC_VOFF(%a6) 	# vector offset = 0xc4
-	mov.w		&0xe001,2+FP_SRC(%a6) 	# set fsave status
+	mov.w		&0x30c4,EXC_VOFF(%a6)	# vector offset = 0xc4
+	mov.w		&0xe001,2+FP_SRC(%a6)	# set fsave status
 
 	frestore	FP_SRC(%a6)		# restore src operand
 
@@ -2312,7 +2312,7 @@ funimp_skew_sgl:
 	andi.w		&0x7fff,%d0		# strip sign
 	beq.b		funimp_skew_sgl_not
 	cmpi.w		%d0,&0x3f80
-	bgt.b		funimp_skew_sgl_not		
+	bgt.b		funimp_skew_sgl_not
 	neg.w		%d0			# make exponent negative
 	addi.w		&0x3f81,%d0		# find amt to shift
 	mov.l		FP_SRC_HI(%a6),%d1	# fetch DENORM hi(man)
@@ -2329,7 +2329,7 @@ funimp_skew_dbl:
 	andi.w		&0x7fff,%d0		# strip sign
 	beq.b		funimp_skew_dbl_not
 	cmpi.w		%d0,&0x3c00
-	bgt.b		funimp_skew_dbl_not		
+	bgt.b		funimp_skew_dbl_not
 
 	tst.b		FP_SRC_EX(%a6)		# make "internal format"
 	smi.b		0x2+FP_SRC(%a6)
@@ -2362,7 +2362,7 @@ _mem_write2:
 #########################################################################
 # XDEF ****************************************************************	#
 #	_fpsp_effadd(): 060FPSP entry point for FP "Unimplemented	#
-#		     	effective address" exception.			#
+#			effective address" exception.			#
 #									#
 #	This handler should be the first code executed upon taking the	#
 #	FP Unimplemented Effective Address exception in an operating	#
@@ -2387,7 +2387,7 @@ _mem_write2:
 #									#
 # INPUT ***************************************************************	#
 #	- The system stack contains the "Unimplemented <ea>" stk frame	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If access error:						#
 #	- The system stack is changed to an access error stack frame	#
@@ -2408,17 +2408,17 @@ _mem_write2:
 #	For immediate data operations, the data is read in w/ a		#
 # _mem_read() "callout", converted to FP binary (if packed), and used	#
 # as the source operand to the instruction specified by the instruction	#
-# word. If no FP exception should be reported ads a result of the 	#
+# word. If no FP exception should be reported ads a result of the	#
 # emulation, then the result is stored to the destination register and	#
 # the handler exits through _fpsp_done(). If an enabled exc has been	#
 # signalled as a result of emulation, then an fsave state frame		#
 # corresponding to the FP exception type must be entered into the 060	#
-# FPU before exiting. In either the enabled or disabled cases, we 	#
+# FPU before exiting. In either the enabled or disabled cases, we	#
 # must also check if a Trace exception is pending, in which case, we	#
 # must create a Trace exception stack frame from the current exception	#
 # stack frame. If no Trace is pending, we simply exit through		#
 # _fpsp_done().								#
-#	For "fmovm.x", call the routine fmovm_dynamic() which will 	#
+#	For "fmovm.x", call the routine fmovm_dynamic() which will	#
 # decode and emulate the instruction. No FP exceptions can be pending	#
 # as a result of this operation emulation. A Trace exception can be	#
 # pending, though, which means the current stack frame must be changed	#
@@ -2437,11 +2437,11 @@ _mem_write2:
 # before the "FPU disabled" exception, but the "FPU disabled" exception	#
 # has higher priority, we check the disabled bit in the PCR. If set,	#
 # then we must create an 8 word "FPU disabled" exception stack frame	#
-# from the current 4 word exception stack frame. This includes 		#
-# reproducing the effective address of the instruction to put on the 	#
+# from the current 4 word exception stack frame. This includes		#
+# reproducing the effective address of the instruction to put on the	#
 # new stack frame.							#
 #									#
-# 	In the process of all emulation work, if a _mem_read()		#
+#	In the process of all emulation work, if a _mem_read()		#
 # "callout" returns a failing result indicating an access error, then	#
 # we must create an access error stack frame from the current stack	#
 # frame. This information includes a faulting address and a fault-	#
@@ -2482,18 +2482,18 @@ _fpsp_effadd:
 
 #
 # here, we will have:
-# 	fabs	fdabs	fsabs		facos		fmod
+#	fabs	fdabs	fsabs		facos		fmod
 #	fadd	fdadd	fsadd		fasin		frem
-# 	fcmp				fatan		fscale
+#	fcmp				fatan		fscale
 #	fdiv	fddiv	fsdiv		fatanh		fsin
 #	fint				fcos		fsincos
 #	fintrz				fcosh		fsinh
 #	fmove	fdmove	fsmove		fetox		ftan
-# 	fmul	fdmul	fsmul		fetoxm1		ftanh
+#	fmul	fdmul	fsmul		fetoxm1		ftanh
 #	fneg	fdneg	fsneg		fgetexp		ftentox
 #	fsgldiv				fgetman		ftwotox
-# 	fsglmul				flog10
-# 	fsqrt				flog2
+#	fsglmul				flog10
+#	fsqrt				flog2
 #	fsub	fdsub	fssub		flogn
 #	ftst				flognp1
 # which can all use f<op>.{x,p}
@@ -2585,8 +2585,8 @@ iea_op_spec:
 # store a result. then, only fcmp will branch back and pick up a dst operand.
 	st		STORE_FLG(%a6)		# don't store a final result
 	btst		&0x1,1+EXC_CMDREG(%a6)	# is operation fcmp?
-	beq.b		iea_op_loaddst		# yes	
-	
+	beq.b		iea_op_loaddst		# yes
+
 iea_op_extract:
 	clr.l		%d0
 	mov.b		FPCR_MODE(%a6),%d0	# pass: rnd mode,prec
@@ -2659,7 +2659,7 @@ iea_op_ovfl:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # is inexact enabled?
 	beq.b		iea_op_store		# no
 	bra.b		iea_op_exc_ovfl		# yes
-	
+
 # an enabled exception occurred. we have to insert the exception type back into
 # the machine.
 iea_op_exc:
@@ -2698,7 +2698,7 @@ iea_op_exit2:
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
-	frestore 	FP_SRC(%a6)		# restore exceptional state
+	frestore	FP_SRC(%a6)		# restore exceptional state
 
 	unlk		%a6			# unravel the frame
 
@@ -2706,12 +2706,12 @@ iea_op_exit2:
 	bne.b		iea_op_trace		# yes
 
 	bra.l		_fpsp_done		# exit to os
-	
+
 #
 # The opclass two instruction that took an "Unimplemented Effective Address"
 # exception was being traced. Make the "current" PC the FPIAR and put it in
 # the trace stack frame then jump to _real_trace().
-#					
+#
 #		 UNIMP EA FRAME		   TRACE FRAME
 #		*****************	*****************
 #		* 0x0 *  0x0f0	*	*    Current	*
@@ -2744,7 +2744,7 @@ iea_fmovm_data:
 
 iea_fmovm_data_u:
 	mov.l		%usp,%a0
-	mov.l		%a0,EXC_A7(%a6)		# store current a7	
+	mov.l		%a0,EXC_A7(%a6)		# store current a7
 	bsr.l		fmovm_dynamic		# do dynamic fmovm
 	mov.l		EXC_A7(%a6),%a0		# load possibly new a7
 	mov.l		%a0,%usp		# update usp
@@ -2775,10 +2775,10 @@ iea_fmovm_data_postinc:
 
 	lea		(EXC_SR,%a6,%d0),%a0
 	mov.l		%a0,EXC_SR(%a6)
-	
+
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 	mov.l		(%sp)+,%sp
@@ -2792,15 +2792,15 @@ iea_fmovm_data_pi_trace:
 
 	lea		(EXC_SR-0x4,%a6,%d0),%a0
 	mov.l		%a0,EXC_SR(%a6)
-	
+
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 	mov.l		(%sp)+,%sp
 	bra.l		_real_trace
-	
+
 # right now, d1 = size and d0 = the strg.
 iea_fmovm_data_predec:
 	mov.b		%d1,EXC_VOFF(%a6)	# store strg
@@ -2808,7 +2808,7 @@ iea_fmovm_data_predec:
 
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	mov.l		(%a6),-(%sp)		# make a copy of a6
 	mov.l		%d0,-(%sp)		# save d0
@@ -2910,10 +2910,10 @@ iea_fmovm_exit:
 
 #
 # The control reg instruction that took an "Unimplemented Effective Address"
-# exception was being traced. The "Current PC" for the trace frame is the 
+# exception was being traced. The "Current PC" for the trace frame is the
 # PC stacked for Unimp EA. The "Next PC" is in EXC_EXTWPTR.
 # After fixing the stack frame, jump to _real_trace().
-#					
+#
 #		 UNIMP EA FRAME		   TRACE FRAME
 #		*****************	*****************
 #		* 0x0 *  0x0f0	*	*    Current	*
@@ -3066,7 +3066,7 @@ iea_dacc_cont:
 #	_fpsp_operr(): 060FPSP entry point for FP Operr exception.	#
 #									#
 #	This handler should be the first code executed upon taking the	#
-# 	FP Operand Error exception in an operating system.		#
+#	FP Operand Error exception in an operating system.		#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read instruction longword			#
@@ -3079,7 +3079,7 @@ iea_dacc_cont:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Operr exception frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	No access error:						#
 #	- The system stack is unchanged					#
@@ -3088,16 +3088,16 @@ iea_dacc_cont:
 # ALGORITHM ***********************************************************	#
 #	In a system where the FP Operr exception is enabled, the goal	#
 # is to get to the handler specified at _real_operr(). But, on the 060,	#
-# for opclass zero and two instruction taking this exception, the 	#
+# for opclass zero and two instruction taking this exception, the	#
 # input operand in the fsave frame may be incorrect for some cases	#
 # and needs to be corrected. This handler calls fix_skewed_ops() to	#
 # do just this and then exits through _real_operr().			#
 #	For opclass 3 instructions, the 060 doesn't store the default	#
 # operr result out to memory or data register file as it should.	#
 # This code must emulate the move out before finally exiting through	#
-# _real_inex(). The move out, if to memory, is performed using 		#
+# _real_inex(). The move out, if to memory, is performed using		#
 # _mem_write() "callout" routines that may return a failing result.	#
-# In this special case, the handler must exit through facc_out() 	#
+# In this special case, the handler must exit through facc_out()	#
 # which creates an access error stack frame from the current operr	#
 # stack frame.								#
 #									#
@@ -3110,13 +3110,13 @@ _fpsp_operr:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3130,7 +3130,7 @@ _fpsp_operr:
 
 # here, we simply see if the operand in the fsave frame needs to be "unskewed".
 # this would be the case for opclass two operations with a source infinity or
-# denorm operand in the sgl or dbl format. NANs also become skewed, but can't 
+# denorm operand in the sgl or dbl format. NANs also become skewed, but can't
 # cause an operr so we don't need to check for them here.
 	lea		FP_SRC(%a6),%a0		# pass: ptr to src op
 	bsr.l		fix_skewed_ops		# fix src op
@@ -3201,7 +3201,7 @@ tbl_operr:
 	short		tbl_operr    - tbl_operr # dbl prec shouldn't happen
 	short		foperr_out_b - tbl_operr # byte integer
 	short		tbl_operr    - tbl_operr # packed won't enter here
-	
+
 foperr_out_b:
 	mov.b		L_SCR1(%a6),%d0		# load positive default result
 	cmpi.b		%d1,&0x7		# is <ea> mode a data reg?
@@ -3255,7 +3255,7 @@ foperr_out_l_save_dn:
 #	_fpsp_snan(): 060FPSP entry point for FP SNAN exception.	#
 #									#
 #	This handler should be the first code executed upon taking the	#
-# 	FP Signalling NAN exception in an operating system.		#
+#	FP Signalling NAN exception in an operating system.		#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read instruction longword			#
@@ -3269,7 +3269,7 @@ foperr_out_l_save_dn:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP SNAN exception frame		#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	No access error:						#
 #	- The system stack is unchanged					#
@@ -3278,16 +3278,16 @@ foperr_out_l_save_dn:
 # ALGORITHM ***********************************************************	#
 #	In a system where the FP SNAN exception is enabled, the goal	#
 # is to get to the handler specified at _real_snan(). But, on the 060,	#
-# for opclass zero and two instructions taking this exception, the 	#
+# for opclass zero and two instructions taking this exception, the	#
 # input operand in the fsave frame may be incorrect for some cases	#
 # and needs to be corrected. This handler calls fix_skewed_ops() to	#
 # do just this and then exits through _real_snan().			#
 #	For opclass 3 instructions, the 060 doesn't store the default	#
 # SNAN result out to memory or data register file as it should.		#
 # This code must emulate the move out before finally exiting through	#
-# _real_snan(). The move out, if to memory, is performed using 		#
+# _real_snan(). The move out, if to memory, is performed using		#
 # _mem_write() "callout" routines that may return a failing result.	#
-# In this special case, the handler must exit through facc_out() 	#
+# In this special case, the handler must exit through facc_out()	#
 # which creates an access error stack frame from the current SNAN	#
 # stack frame.								#
 #	For the case of an extended precision opclass 3 instruction,	#
@@ -3306,13 +3306,13 @@ _fpsp_snan:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3340,7 +3340,7 @@ fsnan_exit:
 
 	unlk		%a6
 	bra.l		_real_snan
-		
+
 ########################################################################
 
 #
@@ -3350,7 +3350,7 @@ fsnan_exit:
 #
 # byte, word, long, and packed destination format operations can pass
 # through here. since packed format operations already were handled by
-# fpsp_unsupp(), then we need to do nothing else for them here. 
+# fpsp_unsupp(), then we need to do nothing else for them here.
 # for byte, word, and long, we simply need to test the sign of the src
 # operand and save the appropriate minimum or maximum integer value
 # to the effective address as pointed to by the stacked effective address.
@@ -3371,7 +3371,7 @@ tbl_snan:
 	short		fsnan_out_d - tbl_snan # dbl prec shouldn't happen
 	short		fsnan_out_b - tbl_snan # byte integer
 	short		tbl_snan    - tbl_snan # packed needs no help
-	
+
 fsnan_out_b:
 	mov.b		FP_SRC_HI(%a6),%d0	# load upper byte of SNAN
 	bset		&6,%d0			# set SNAN bit
@@ -3497,7 +3497,7 @@ fsnan_out_x:
 	mov.l		%usp,%a0		# fetch user stack pointer
 	mov.l		%a0,EXC_A7(%a6)		# save on stack for calc_ea()
 	mov.l		(%a6),EXC_A6(%a6)
-	
+
 	bsr.l		_calc_ea_fout		# find the correct ea,update An
 	mov.l		%a0,%a1
 	mov.l		%a0,EXC_EA(%a6)		# stack correct <ea>
@@ -3546,7 +3546,7 @@ fsnan_out_x_s:
 	mov.l		LOCAL_SIZE+FP_SCR0_LO(%sp),LOCAL_SIZE+EXC_EA(%sp)
 
 	add.l		&LOCAL_SIZE-0x8,%sp
-	
+
 	bra.l		_real_snan
 
 #########################################################################
@@ -3554,7 +3554,7 @@ fsnan_out_x_s:
 #	_fpsp_inex(): 060FPSP entry point for FP Inexact exception.	#
 #									#
 #	This handler should be the first code executed upon taking the	#
-# 	FP Inexact exception in an operating system.			#
+#	FP Inexact exception in an operating system.			#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read instruction longword			#
@@ -3571,7 +3571,7 @@ fsnan_out_x_s:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Inexact exception frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	- The system stack is unchanged					#
 #	- The fsave frame contains the adjusted src op for opclass 0,2	#
@@ -3579,10 +3579,10 @@ fsnan_out_x_s:
 # ALGORITHM ***********************************************************	#
 #	In a system where the FP Inexact exception is enabled, the goal	#
 # is to get to the handler specified at _real_inex(). But, on the 060,	#
-# for opclass zero and two instruction taking this exception, the 	#
+# for opclass zero and two instruction taking this exception, the	#
 # hardware doesn't store the correct result to the destination FP	#
-# register as did the '040 and '881/2. This handler must emulate the 	#
-# instruction in order to get this value and then store it to the 	#
+# register as did the '040 and '881/2. This handler must emulate the	#
+# instruction in order to get this value and then store it to the	#
 # correct register before calling _real_inex().				#
 #	For opclass 3 instructions, the 060 doesn't store the default	#
 # inexact result out to memory or data register file as it should.	#
@@ -3598,13 +3598,13 @@ _fpsp_inex:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3616,7 +3616,7 @@ _fpsp_inex:
 	bne.w		finex_out		# fmove out
 
 
-# the hardware, for "fabs" and "fneg" w/ a long source format, puts the 
+# the hardware, for "fabs" and "fneg" w/ a long source format, puts the
 # longword integer directly into the upper longword of the mantissa along
 # w/ an exponent value of 0x401e. we convert this to extended precision here.
 	bfextu		%d0{&19:&3},%d0		# fetch instr size
@@ -3750,7 +3750,7 @@ finex_out:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP DZ exception stack.		#
 #	- The fsave frame contains the source operand.			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	- The system stack contains the FP DZ exception stack.		#
 #	- The fsave frame contains the adjusted source operand.		#
@@ -3761,7 +3761,7 @@ finex_out:
 # exception is taken, the input operand in the fsave state frame may	#
 # be incorrect for some cases and need to be adjusted. So, this package	#
 # adjusts the operand using fix_skewed_ops() and then branches to	#
-# _real_dz(). 								#
+# _real_dz().								#
 #									#
 #########################################################################
 
@@ -3772,13 +3772,13 @@ _fpsp_dz:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3819,7 +3819,7 @@ fdz_exit:
 # INPUT ***************************************************************	#
 #	- The system stack contains a "Line F Emulator" exception	#
 #	  stack frame.							#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	- The system stack is unchanged					#
 #									#
@@ -3830,7 +3830,7 @@ fdz_exit:
 #	(2) FPU disabled (8 word stack frame)				#
 #	(3) Line F (4 word stack frame)					#
 #									#
-#	This module determines which and forks the flow off to the 	#
+#	This module determines which and forks the flow off to the	#
 # appropriate "callout" (for "disabled" and "Line F") or to the		#
 # correct emulation code (for "FPU unimplemented").			#
 #	This code also must check for "fmovecr" instructions w/ a	#
@@ -3943,11 +3943,11 @@ fline_fline:
 #	_fdbcc() - emulate an "fdbcc" instruction			#
 #	_fscc() - emulate an "fscc" instruction				#
 #	_real_trap() - "callout" for Trap exception			#
-# 	_real_bsun() - "callout" for enabled Bsun exception		#
+#	_real_bsun() - "callout" for enabled Bsun exception		#
 #									#
 # INPUT ***************************************************************	#
 #	- The system stack contains the "Unimplemented Instr" stk frame	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If access error:						#
 #	- The system stack is changed to an access error stack frame	#
@@ -3962,21 +3962,21 @@ fline_fline:
 # unimplemented on the 040, and (2) "ftrapcc", "fscc", and "fdbcc".	#
 #	For the first set, this handler calls the routine load_fop()	#
 # to load the source and destination (for dyadic) operands to be used	#
-# for instruction emulation. The correct emulation routine is then 	#
-# chosen by decoding the instruction type and indexing into an 		#
-# emulation subroutine index table. After emulation returns, this 	#
+# for instruction emulation. The correct emulation routine is then	#
+# chosen by decoding the instruction type and indexing into an		#
+# emulation subroutine index table. After emulation returns, this	#
 # handler checks to see if an exception should occur as a result of the #
 # FP instruction emulation. If so, then an FP exception of the correct	#
 # type is inserted into the FPU state frame using the "frestore"	#
-# instruction before exiting through _fpsp_done(). In either the 	#
+# instruction before exiting through _fpsp_done(). In either the	#
 # exceptional or non-exceptional cases, we must check to see if the	#
 # Trace exception is enabled. If so, then we must create a Trace	#
 # exception frame from the current exception frame and exit through	#
 # _real_trace().							#
-# 	For "fdbcc", "ftrapcc", and "fscc", the emulation subroutines	#
+#	For "fdbcc", "ftrapcc", and "fscc", the emulation subroutines	#
 # _fdbcc(), _ftrapcc(), and _fscc() respectively are used. All three	#
-# may flag that a BSUN exception should be taken. If so, then the 	#
-# current exception stack frame is converted into a BSUN exception 	#
+# may flag that a BSUN exception should be taken. If so, then the	#
+# current exception stack frame is converted into a BSUN exception	#
 # stack frame and an exit is made through _real_bsun(). If the		#
 # instruction was "ftrapcc" and a Trap exception should result, a Trap	#
 # exception stack frame is created from the current frame and an exit	#
@@ -3985,7 +3985,7 @@ fline_fline:
 # is made to _real_trace(). Finally, if none of these conditions exist,	#
 # then the handler exits though the callout _fpsp_done().		#
 #									#
-# 	In any of the above scenarios, if a _mem_read() or _mem_write()	#
+#	In any of the above scenarios, if a _mem_read() or _mem_write()	#
 # "callout" returns a failing value, then an access error stack frame	#
 # is created from the current stack frame and an exit is made through	#
 # _real_access().							#
@@ -4077,7 +4077,7 @@ funimp_gen:
 	beq.w		funimp_fmovcr		# yes
 
 funimp_gen_op:
-	bsr.l		_load_fop		# load 
+	bsr.l		_load_fop		# load
 
 	clr.l		%d0
 	mov.b		FPCR_MODE(%a6),%d0	# fetch rnd mode
@@ -4104,7 +4104,7 @@ funimp_store:
 funimp_gen_exit:
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 funimp_gen_exit_cmp:
 	cmpi.b		SPCOND_FLG(%a6),&mia7_flg # was the ea mode (sp)+ ?
@@ -4129,7 +4129,7 @@ funimp_gen_exit_cont2:
 	frestore	(%sp)+
 	mov.w		&0x2024,0x6(%sp)	# stk fmt = 0x2; voff = 0x24
 	bra.l		_real_trace
-	
+
 funimp_gen_exit_a7:
 	btst		&0x5,EXC_SR(%a6)	# supervisor or user mode?
 	bne.b		funimp_gen_exit_a7_s	# supervisor
@@ -4156,7 +4156,7 @@ funimp_gen_exit_a7_s:
 	unlk		%a6
 
 	add.w		(%sp),%sp		# stack frame shifted
-	bra.b		funimp_gen_exit_cont2		
+	bra.b		funimp_gen_exit_cont2
 
 ######################
 # fmovecr.x #ccc,fpn #
@@ -4212,7 +4212,7 @@ funimp_exc:
 	btst		&unfl_bit,FPSR_EXCEPT(%a6) # did underflow occur?
 	bne.b		funimp_exc_unfl		# yes
 
-# force the fsave exception status bits to signal an exception of the 
+# force the fsave exception status bits to signal an exception of the
 # appropriate type. don't forget to "skew" the source operand in case we
 # "unskewed" the one the hardware initially gave us.
 funimp_exc_force:
@@ -4242,7 +4242,7 @@ funimp_exc_unfl:
 funimp_gen_exit2:
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	frestore	FP_SRC(%a6)		# insert exceptional status
 
@@ -4262,7 +4262,7 @@ funimp_misc:
 	beq.w		funimp_fdbcc		# yes
 	cmpi.b		%d1,&0x7		# is it an fs<cc>?
 	bne.w		funimp_fscc		# yes
-	bfextu		%d0{&13:&3},%d1	
+	bfextu		%d0{&13:&3},%d1
 	cmpi.b		%d1,&0x2		# is it an fs<cc>?
 	blt.w		funimp_fscc		# yes
 
@@ -4302,7 +4302,7 @@ funimp_ftrapcc_tp:
 
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 	bra.l		_real_trap
@@ -4346,7 +4346,7 @@ funimp_fscc:
 funimp_fscc_u:
 	mov.l		EXC_A7(%a6),%a0		# yes; set new USP
 	mov.l		%a0,%usp
-	bra.w		funimp_done		# branch to finish	
+	bra.w		funimp_done		# branch to finish
 
 # remember, I'm assuming that post-increment is bogus...(it IS!!!)
 # so, the least significant WORD of the stacked effective address got
@@ -4361,7 +4361,7 @@ funimp_fscc_s:
 
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 
@@ -4381,7 +4381,7 @@ funimp_fscc_s_trace:
 	fmov.l		%fpiar,0x8(%sp)		# insert "current PC"
 
 	bra.l		_real_trace
-		
+
 #
 # The ftrap<cc>, fs<cc>, or fdb<cc> is to take an enabled bsun. we must convert
 # the fp unimplemented instruction exception stack frame into a bsun stack frame,
@@ -4409,7 +4409,7 @@ funimp_bsun:
 
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	frestore	FP_SRC(%a6)		# restore bsun exception
 
@@ -4424,13 +4424,13 @@ funimp_bsun:
 # and return.
 #
 # as usual, we have to check for trace mode being on here. since instructions
-# modifying the supervisor stack frame don't pass through here, this is a 
+# modifying the supervisor stack frame don't pass through here, this is a
 # relatively easy task.
 #
 funimp_done:
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 
@@ -4465,16 +4465,16 @@ funimp_trace:
 	global		tbl_trans
 	swbeg		&0x1c0
 tbl_trans:
-	short 		tbl_trans - tbl_trans	# $00-0 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-1 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-2 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-3 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-4 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-5 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-6 fmovecr all
-	short 		tbl_trans - tbl_trans	# $00-7 fmovecr all
-
-	short 		tbl_trans - tbl_trans	# $01-0 fint norm
+	short		tbl_trans - tbl_trans	# $00-0 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-1 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-2 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-3 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-4 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-5 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-6 fmovecr all
+	short		tbl_trans - tbl_trans	# $00-7 fmovecr all
+
+	short		tbl_trans - tbl_trans	# $01-0 fint norm
 	short		tbl_trans - tbl_trans	# $01-1 fint zero
 	short		tbl_trans - tbl_trans	# $01-2 fint inf
 	short		tbl_trans - tbl_trans	# $01-3 fint qnan
@@ -4599,7 +4599,7 @@ tbl_trans:
 	short		src_snan - tbl_trans	# $0e-4 fsin snan
 	short		tbl_trans - tbl_trans	# $0e-6 fsin unnorm
 	short		tbl_trans - tbl_trans	# $0e-7 ERROR
-	
+
 	short		stan	 - tbl_trans	# $0f-0 ftan norm
 	short		src_zero - tbl_trans	# $0f-1 ftan zero
 	short		t_operr	 - tbl_trans	# $0f-2 ftan inf
@@ -5009,7 +5009,7 @@ funimp_iacc_end:
 #	d0 = round precision,mode					#
 #									#
 # OUTPUT ************************************************************** #
-#	fp0 = sin(X) or cos(X) 						#
+#	fp0 = sin(X) or cos(X)						#
 #									#
 #    For ssincos(X):							#
 #	fp0 = sin(X)							#
@@ -5017,7 +5017,7 @@ funimp_iacc_end:
 #									#
 # ACCURACY and MONOTONICITY ******************************************* #
 #	The returned result is within 1 ulp in 64 significant bit, i.e.	#
-#	within 0.5001 ulp to 53 bits if the result is subsequently 	#
+#	within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
@@ -5034,8 +5034,8 @@ funimp_iacc_end:
 #									#
 #	4. If k is even, go to 6.					#
 #									#
-#	5. (k is odd) Set j := (k-1)/2, sgn := (-1)**j. 		#
-#		Return sgn*cos(r) where cos(r) is approximated by an 	#
+#	5. (k is odd) Set j := (k-1)/2, sgn := (-1)**j.			#
+#		Return sgn*cos(r) where cos(r) is approximated by an	#
 #		even polynomial in r, 1 + r*r*(B1+s*(B2+ ... + s*B8)),	#
 #		s = r*r.						#
 #		Exit.							#
@@ -5047,10 +5047,10 @@ funimp_iacc_end:
 #									#
 #	7. If |X| > 1, go to 9.						#
 #									#
-#	8. (|X|<2**(-40)) If SIN is invoked, return X; 			#
+#	8. (|X|<2**(-40)) If SIN is invoked, return X;			#
 #		otherwise return 1.					#
 #									#
-#	9. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, 		#
+#	9. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi,		#
 #		go back to 3.						#
 #									#
 #	SINCOS:								#
@@ -5065,19 +5065,19 @@ funimp_iacc_end:
 #		j1 exclusive or with the l.s.b. of k.			#
 #		sgn1 := (-1)**j1, sgn2 := (-1)**j2.			#
 #		SIN(X) = sgn1 * cos(r) and COS(X) = sgn2*sin(r) where	#
-#		sin(r) and cos(r) are computed as odd and even 		#
+#		sin(r) and cos(r) are computed as odd and even		#
 #		polynomials in r, respectively. Exit			#
 #									#
 #	5. (k is even) Set j1 := k/2, sgn1 := (-1)**j1.			#
 #		SIN(X) = sgn1 * sin(r) and COS(X) = sgn1*cos(r) where	#
-#		sin(r) and cos(r) are computed as odd and even 		#
+#		sin(r) and cos(r) are computed as odd and even		#
 #		polynomials in r, respectively. Exit			#
 #									#
 #	6. If |X| > 1, go to 8.						#
 #									#
 #	7. (|X|<2**(-40)) SIN(X) = X and COS(X) = 1. Exit.		#
 #									#
-#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, 		#
+#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi,		#
 #		go back to 2.						#
 #									#
 #########################################################################
@@ -5152,9 +5152,9 @@ SOK1:
 #--THE ARGUMENT REDUCTION IS DONE BY TABLE LOOK UP.
 SINMAIN:
 	fmov.x		%fp0,%fp1
-	fmul.d		TWOBYPI(%pc),%fp1 	# X*2/PI
+	fmul.d		TWOBYPI(%pc),%fp1	# X*2/PI
 
-	lea		PITBL+0x200(%pc),%a1 	# TABLE OF N*PI/2, N = -32,...,32
+	lea		PITBL+0x200(%pc),%a1	# TABLE OF N*PI/2, N = -32,...,32
 
 	fmov.l		%fp1,INT(%a6)		# CONVERT TO INTEGER
 
@@ -5164,8 +5164,8 @@ SINMAIN:
 
 # A1 IS THE ADDRESS OF N*PIBY2
 # ...WHICH IS IN TWO PIECES Y1 & Y2
-	fsub.x		(%a1)+,%fp0 		# X-Y1
-	fsub.s		(%a1),%fp0 		# fp0 = R = (X-Y1)-Y2
+	fsub.x		(%a1)+,%fp0		# X-Y1
+	fsub.s		(%a1),%fp0		# fp0 = R = (X-Y1)-Y2
 
 SINCONT:
 #--continuation from REDUCEX
@@ -5319,7 +5319,7 @@ SINTINY:
 COSTINY:
 	fmov.s		&0x3F800000,%fp0	# fp0 = 1.0
 	fmov.l		%d0,%fpcr		# restore users round mode,prec
-	fadd.s 		&0x80800000,%fp0	# last inst - possible exception set
+	fadd.s		&0x80800000,%fp0	# last inst - possible exception set
 	bra		t_pinx2
 
 ################################################
@@ -5751,7 +5751,7 @@ SRESTORE:
 #									#
 #	7. (|X|<2**(-40)) Tan(X) = X. Exit.				#
 #									#
-#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back 	#
+#	8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back	#
 #		to 2.							#
 #									#
 #########################################################################
@@ -6154,27 +6154,27 @@ RESTORE:
 #	The returned result is within 2 ulps in	64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
-#	in double precision. 						#
+#	in double precision.						#
 #									#
 # ALGORITHM *********************************************************** #
 #	Step 1. If |X| >= 16 or |X| < 1/16, go to Step 5.		#
 #									#
-#	Step 2. Let X = sgn * 2**k * 1.xxxxxxxx...x. 			#
+#	Step 2. Let X = sgn * 2**k * 1.xxxxxxxx...x.			#
 #		Note that k = -4, -3,..., or 3.				#
-#		Define F = sgn * 2**k * 1.xxxx1, i.e. the first 5 	#
+#		Define F = sgn * 2**k * 1.xxxx1, i.e. the first 5	#
 #		significant bits of X with a bit-1 attached at the 6-th	#
 #		bit position. Define u to be u = (X-F) / (1 + X*F).	#
 #									#
 #	Step 3. Approximate arctan(u) by a polynomial poly.		#
 #									#
-#	Step 4. Return arctan(F) + poly, arctan(F) is fetched from a 	#
+#	Step 4. Return arctan(F) + poly, arctan(F) is fetched from a	#
 #		table of values calculated beforehand. Exit.		#
 #									#
 #	Step 5. If |X| >= 16, go to Step 7.				#
 #									#
 #	Step 6. Approximate arctan(X) by an odd polynomial in X. Exit.	#
 #									#
-#	Step 7. Define X' = -1/X. Approximate arctan(X') by an odd 	#
+#	Step 7. Define X' = -1/X. Approximate arctan(X') by an odd	#
 #		polynomial in X'.					#
 #		Arctan(X) = sign(X)*Pi/2 + arctan(X'). Exit.		#
 #									#
@@ -6440,7 +6440,7 @@ ATANMAIN:
 	fmul.x		%fp2,%fp1		# A1*U*V*(A2+V*(A3+V))
 	fadd.x		%fp1,%fp0		# ATAN(U), FP1 RELEASED
 
-	fmovm.x 	(%sp)+,&0x20		# restore fp2
+	fmovm.x		(%sp)+,&0x20		# restore fp2
 
 	fmov.l		%d0,%fpcr		# restore users rnd mode,prec
 	fadd.x		ATANF(%a6),%fp0		# ATAN(X)
@@ -6597,7 +6597,7 @@ satand:
 #	a0 = pointer to extended precision input			#
 #	d0 = round precision,mode					#
 #									#
-# OUTPUT **************************************************************	# 
+# OUTPUT **************************************************************	#
 #	fp0 = arcsin(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
@@ -6637,7 +6637,7 @@ sasin:
 
 # This catch is added here for the '060 QSP. Originally, the call to
 # satan() would handle this case by causing the exception which would
-# not be caught until gen_except(). Now, with the exceptions being 
+# not be caught until gen_except(). Now, with the exceptions being
 # detected inside of satan(), the exception would have been handled there
 # instead of inside sasin() as expected.
 	cmp.l		%d1,&0x3FD78000
@@ -6786,7 +6786,7 @@ sacosd:
 
 #########################################################################
 # setox():    computes the exponential for a normalized input		#
-# setoxd():   computes the exponential for a denormalized input		# 
+# setoxd():   computes the exponential for a denormalized input		#
 # setoxm1():  computes the exponential minus 1 for a normalized input	#
 # setoxm1d(): computes the exponential minus 1 for a denormalized input	#
 #									#
@@ -6798,9 +6798,9 @@ sacosd:
 #	fp0 = exp(X) or exp(X)-1					#
 #									#
 # ACCURACY and MONOTONICITY ******************************************* #
-#	The returned result is within 0.85 ulps in 64 significant bit, 	#
+#	The returned result is within 0.85 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently #
-#	rounded to double precision. The result is provably monotonic 	#
+#	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
 # ALGORITHM and IMPLEMENTATION **************************************** #
@@ -6824,14 +6824,14 @@ sacosd:
 #	Notes:	The usual case should take the branches 1.1 -> 1.3 -> 2.#
 #		To avoid the use of floating-point comparisons, a	#
 #		compact representation of |X| is used. This format is a	#
-#		32-bit integer, the upper (more significant) 16 bits 	#
-#		are the sign and biased exponent field of |X|; the 	#
+#		32-bit integer, the upper (more significant) 16 bits	#
+#		are the sign and biased exponent field of |X|; the	#
 #		lower 16 bits are the 16 most significant fraction	#
 #		(including the explicit bit) bits of |X|. Consequently,	#
 #		the comparisons in Steps 1.1 and 1.3 can be performed	#
 #		by integer comparison. Note also that the constant	#
 #		16380 log(2) used in Step 1.3 is also in the compact	#
-#		form. Thus taking the branch to Step 2 guarantees 	#
+#		form. Thus taking the branch to Step 2 guarantees	#
 #		|X| < 16380 log(2). There is no harm to have a small	#
 #		number of cases where |X| is less than,	but close to,	#
 #		16380 log(2) and the branch to Step 9 is taken.		#
@@ -6843,7 +6843,7 @@ sacosd:
 #		2.3	Calculate	J = N mod 64; so J = 0,1,2,..., #
 #			or 63.						#
 #		2.4	Calculate	M = (N - J)/64; so N = 64M + J.	#
-#		2.5	Calculate the address of the stored value of 	#
+#		2.5	Calculate the address of the stored value of	#
 #			2^(J/64).					#
 #		2.6	Create the value Scale = 2^M.			#
 #	Notes:	The calculation in 2.2 is really performed by		#
@@ -6852,26 +6852,26 @@ sacosd:
 #		where							#
 #			constant := single-precision( 64/log 2 ).	#
 #									#
-#		Using a single-precision constant avoids memory 	#
+#		Using a single-precision constant avoids memory		#
 #		access. Another effect of using a single-precision	#
-#		"constant" is that the calculated value Z is 		#
+#		"constant" is that the calculated value Z is		#
 #									#
 #			Z = X*(64/log2)*(1+eps), |eps| <= 2^(-24).	#
 #									#
 #		This error has to be considered later in Steps 3 and 4.	#
 #									#
 #	Step 3.	Calculate X - N*log2/64.				#
-#		3.1	R := X + N*L1, 					#
+#		3.1	R := X + N*L1,					#
 #				where L1 := single-precision(-log2/64).	#
-#		3.2	R := R + N*L2, 					#
+#		3.2	R := R + N*L2,					#
 #				L2 := extended-precision(-log2/64 - L1).#
-#	Notes:	a) The way L1 and L2 are chosen ensures L1+L2 		#
+#	Notes:	a) The way L1 and L2 are chosen ensures L1+L2		#
 #		approximate the value -log2/64 to 88 bits of accuracy.	#
 #		b) N*L1 is exact because N is no longer than 22 bits	#
 #		and L1 is no longer than 24 bits.			#
-#		c) The calculation X+N*L1 is also exact due to 		#
+#		c) The calculation X+N*L1 is also exact due to		#
 #		cancellation. Thus, R is practically X+N(L1+L2) to full	#
-#		64 bits. 						#
+#		64 bits.						#
 #		d) It is important to estimate how large can |R| be	#
 #		after Step 3.2.						#
 #									#
@@ -6889,11 +6889,11 @@ sacosd:
 #									#
 #	Step 4.	Approximate exp(R)-1 by a polynomial			#
 #		p = R + R*R*(A1 + R*(A2 + R*(A3 + R*(A4 + R*A5))))	#
-#	Notes:	a) In order to reduce memory access, the coefficients 	#
+#	Notes:	a) In order to reduce memory access, the coefficients	#
 #		are made as "short" as possible: A1 (which is 1/2), A4	#
 #		and A5 are single precision; A2 and A3 are double	#
-#		precision. 						#
-#		b) Even with the restrictions above, 			#
+#		precision.						#
+#		b) Even with the restrictions above,			#
 #		   |p - (exp(R)-1)| < 2^(-68.8) for all |R| <= 0.0062.	#
 #		Note that 0.0062 is slightly bigger than 0.57 log2/64.	#
 #		c) To fully utilize the pipeline, p is separated into	#
@@ -6907,11 +6907,11 @@ sacosd:
 #		where T and t are the stored values for 2^(J/64).	#
 #	Notes:	2^(J/64) is stored as T and t where T+t approximates	#
 #		2^(J/64) to roughly 85 bits; T is in extended precision	#
-#		and t is in single precision. Note also that T is 	#
-#		rounded to 62 bits so that the last two bits of T are 	#
-#		zero. The reason for such a special form is that T-1, 	#
+#		and t is in single precision. Note also that T is	#
+#		rounded to 62 bits so that the last two bits of T are	#
+#		zero. The reason for such a special form is that T-1,	#
 #		T-2, and T-8 will all be exact --- a property that will	#
-#		give much more accurate computation of the function 	#
+#		give much more accurate computation of the function	#
 #		EXPM1.							#
 #									#
 #	Step 6.	Reconstruction of exp(X)				#
@@ -6927,11 +6927,11 @@ sacosd:
 #			X = (M1+M)log2 + Jlog2/64 + R, |M1+M| >= 16380.	#
 #		Hence, exp(X) may overflow or underflow or neither.	#
 #		When that is the case, AdjScale = 2^(M1) where M1 is	#
-#		approximately M. Thus 6.2 will never cause 		#
+#		approximately M. Thus 6.2 will never cause		#
 #		over/underflow. Possible exception in 6.4 is overflow	#
 #		or underflow. The inexact exception is not generated in	#
 #		6.4. Although one can argue that the inexact flag	#
-#		should always be raised, to simulate that exception 	#
+#		should always be raised, to simulate that exception	#
 #		cost to much than the flag is worth in practical uses.	#
 #									#
 #	Step 7.	Return 1 + X.						#
@@ -6944,7 +6944,7 @@ sacosd:
 #		in Step 7.1 to avoid unnecessary trapping. (Although	#
 #		the FMOVEM may not seem relevant since X is normalized,	#
 #		the precaution will be useful in the library version of	#
-#		this code where the separate entry for denormalized 	#
+#		this code where the separate entry for denormalized	#
 #		inputs will be done away with.)				#
 #									#
 #	Step 8.	Handle exp(X) where |X| >= 16380log2.			#
@@ -6952,9 +6952,9 @@ sacosd:
 #		(mimic 2.2 - 2.6)					#
 #		8.2	N := round-to-integer( X * 64/log2 )		#
 #		8.3	Calculate J = N mod 64, J = 0,1,...,63		#
-#		8.4	K := (N-J)/64, M1 := truncate(K/2), M = K-M1, 	#
+#		8.4	K := (N-J)/64, M1 := truncate(K/2), M = K-M1,	#
 #			AdjFlag := 1.					#
-#		8.5	Calculate the address of the stored value 	#
+#		8.5	Calculate the address of the stored value	#
 #			2^(J/64).					#
 #		8.6	Create the values Scale = 2^M, AdjScale = 2^M1.	#
 #		8.7	Go to Step 3.					#
@@ -6991,8 +6991,8 @@ sacosd:
 #		1.4	Go to Step 10.					#
 #	Notes:	The usual case should take the branches 1.1 -> 1.3 -> 2.#
 #		However, it is conceivable |X| can be small very often	#
-#		because EXPM1 is intended to evaluate exp(X)-1 		#
-#		accurately when |X| is small. For further details on 	#
+#		because EXPM1 is intended to evaluate exp(X)-1		#
+#		accurately when |X| is small. For further details on	#
 #		the comparisons, see the notes on Step 1 of setox.	#
 #									#
 #	Step 2.	Calculate N = round-to-nearest-int( X * 64/log2 ).	#
@@ -7000,16 +7000,16 @@ sacosd:
 #		2.2	Calculate	J = N mod 64; so J = 0,1,2,..., #
 #			or 63.						#
 #		2.3	Calculate	M = (N - J)/64; so N = 64M + J.	#
-#		2.4	Calculate the address of the stored value of 	#
+#		2.4	Calculate the address of the stored value of	#
 #			2^(J/64).					#
-#		2.5	Create the values Sc = 2^M and 			#
+#		2.5	Create the values Sc = 2^M and			#
 #			OnebySc := -2^(-M).				#
 #	Notes:	See the notes on Step 2 of setox.			#
 #									#
 #	Step 3.	Calculate X - N*log2/64.				#
-#		3.1	R := X + N*L1, 					#
+#		3.1	R := X + N*L1,					#
 #				where L1 := single-precision(-log2/64).	#
-#		3.2	R := R + N*L2, 					#
+#		3.2	R := R + N*L2,					#
 #				L2 := extended-precision(-log2/64 - L1).#
 #	Notes:	Applying the analysis of Step 3 of setox in this case	#
 #		shows that |R| <= 0.0055 (note that |X| <= 70 log2 in	#
@@ -7017,10 +7017,10 @@ sacosd:
 #									#
 #	Step 4.	Approximate exp(R)-1 by a polynomial			#
 #			p = R+R*R*(A1+R*(A2+R*(A3+R*(A4+R*(A5+R*A6)))))	#
-#	Notes:	a) In order to reduce memory access, the coefficients 	#
-#		are made as "short" as possible: A1 (which is 1/2), A5 	#
-#		and A6 are single precision; A2, A3 and A4 are double 	#
-#		precision. 						#
+#	Notes:	a) In order to reduce memory access, the coefficients	#
+#		are made as "short" as possible: A1 (which is 1/2), A5	#
+#		and A6 are single precision; A2, A3 and A4 are double	#
+#		precision.						#
 #		b) Even with the restriction above,			#
 #			|p - (exp(R)-1)| <	|R| * 2^(-72.7)		#
 #		for all |R| <= 0.0055.					#
@@ -7035,9 +7035,9 @@ sacosd:
 #		where T and t are the stored values for 2^(J/64).	#
 #	Notes:	2^(J/64) is stored as T and t where T+t approximates	#
 #		2^(J/64) to roughly 85 bits; T is in extended precision	#
-#		and t is in single precision. Note also that T is 	#
-#		rounded to 62 bits so that the last two bits of T are 	#
-#		zero. The reason for such a special form is that T-1, 	#
+#		and t is in single precision. Note also that T is	#
+#		rounded to 62 bits so that the last two bits of T are	#
+#		zero. The reason for such a special form is that T-1,	#
 #		T-2, and T-8 will all be exact --- a property that will	#
 #		be exploited in Step 6 below. The total relative error	#
 #		in p is no bigger than 2^(-67.7) compared to the final	#
@@ -7052,7 +7052,7 @@ sacosd:
 #		6.5	ans := (T + OnebySc) + (p + t).			#
 #		6.6	Restore user FPCR.				#
 #		6.7	Return ans := Sc * ans. Exit.			#
-#	Notes:	The various arrangements of the expressions give 	#
+#	Notes:	The various arrangements of the expressions give	#
 #		accurate evaluations.					#
 #									#
 #	Step 7.	exp(X)-1 for |X| < 1/4.					#
@@ -7068,8 +7068,8 @@ sacosd:
 #		 Return ans := ans*2^(140). Exit			#
 #	Notes:	The idea is to return "X - tiny" under the user		#
 #		precision and rounding modes. To avoid unnecessary	#
-#		inefficiency, we stay away from denormalized numbers 	#
-#		the best we can. For |X| >= 2^(-16312), the 		#
+#		inefficiency, we stay away from denormalized numbers	#
+#		the best we can. For |X| >= 2^(-16312), the		#
 #		straightforward 8.2 generates the inexact exception as	#
 #		the case warrants.					#
 #									#
@@ -7077,13 +7077,13 @@ sacosd:
 #			p = X + X*X*(B1 + X*(B2 + ... + X*B12))		#
 #	Notes:	a) In order to reduce memory access, the coefficients	#
 #		are made as "short" as possible: B1 (which is 1/2), B9	#
-#		to B12 are single precision; B3 to B8 are double 	#
+#		to B12 are single precision; B3 to B8 are double	#
 #		precision; and B2 is double extended.			#
 #		b) Even with the restriction above,			#
 #			|p - (exp(X)-1)| < |X| 2^(-70.6)		#
 #		for all |X| <= 0.251.					#
 #		Note that 0.251 is slightly bigger than 1/4.		#
-#		c) To fully preserve accuracy, the polynomial is 	#
+#		c) To fully preserve accuracy, the polynomial is	#
 #		computed as						#
 #			X + ( S*B1 +	Q ) where S = X*X and		#
 #			Q	=	X*S*(B2 + X*(B3 + ... + X*B12))	#
@@ -7093,11 +7093,11 @@ sacosd:
 #				[ S*S*(B3 + S*(B5 + ... + S*B11)) ]	#
 #									#
 #	Step 10. Calculate exp(X)-1 for |X| >= 70 log 2.		#
-#		10.1 If X >= 70log2 , exp(X) - 1 = exp(X) for all 	#
+#		10.1 If X >= 70log2 , exp(X) - 1 = exp(X) for all	#
 #		practical purposes. Therefore, go to Step 1 of setox.	#
 #		10.2 If X <= -70log2, exp(X) - 1 = -1 for all practical	#
-#		purposes. 						#
-#		ans := -1 						#
+#		purposes.						#
+#		ans := -1						#
 #		Restore user FPCR					#
 #		Return ans := ans + 2^(-126). Exit.			#
 #	Notes:	10.2 will always create an inexact and return -1 + tiny	#
@@ -7602,10 +7602,10 @@ setoxm1d:
 # sgetexp():  returns the exponent portion of the input argument.	#
 #	      The exponent bias is removed and the exponent value is	#
 #	      returned as an extended precision number in fp0.		#
-# sgetexpd(): handles denormalized numbers. 				#
+# sgetexpd(): handles denormalized numbers.				#
 #									#
-# sgetman():  extracts the mantissa of the input argument. The 		#
-#	      mantissa is converted to an extended precision number w/ 	#
+# sgetman():  extracts the mantissa of the input argument. The		#
+#	      mantissa is converted to an extended precision number w/	#
 #	      an exponent of $3fff and is returned in fp0. The range of #
 #	      the result is [1.0 - 2.0).				#
 # sgetmand(): handles denormalized numbers.				#
@@ -7679,9 +7679,9 @@ sgetmand:
 #	fp0 = cosh(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 3 ulps in 64 significant bit, 	#
+#	The returned result is within 3 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
-#	rounded to double precision. The result is provably monotonic 	#
+#	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
 # ALGORITHM ***********************************************************	#
@@ -7698,7 +7698,7 @@ sgetmand:
 #									#
 #	4. (16380 log2 < |X| <= 16480 log2)				#
 #		cosh(X) = sign(X) * exp(|X|)/2.				#
-#		However, invoking exp(|X|) may cause premature 		#
+#		However, invoking exp(|X|) may cause premature		#
 #		overflow. Thus, we calculate sinh(X) as follows:	#
 #		Y	:= |X|						#
 #		Fact	:=	2**(16380)				#
@@ -7793,7 +7793,7 @@ scoshd:
 #	fp0 = sinh(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 3 ulps in 64 significant bit, 	#
+#	The returned result is within 3 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently #
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
@@ -7911,7 +7911,7 @@ ssinhd:
 #	fp0 = tanh(X)							#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 3 ulps in 64 significant bit, 	#
+#	The returned result is within 3 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently #
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
@@ -8077,51 +8077,51 @@ stanhd:
 #	fp0 = log(X) or log(1+X)					#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 2 ulps in 64 significant bit, 	#
+#	The returned result is within 2 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
 #									#
 # ALGORITHM ***********************************************************	#
 #	LOGN:								#
-#	Step 1. If |X-1| < 1/16, approximate log(X) by an odd 		#
-#		polynomial in u, where u = 2(X-1)/(X+1). Otherwise, 	#
+#	Step 1. If |X-1| < 1/16, approximate log(X) by an odd		#
+#		polynomial in u, where u = 2(X-1)/(X+1). Otherwise,	#
 #		move on to Step 2.					#
 #									#
 #	Step 2. X = 2**k * Y where 1 <= Y < 2. Define F to be the first	#
-#		seven significant bits of Y plus 2**(-7), i.e. 		#
-#		F = 1.xxxxxx1 in base 2 where the six "x" match those 	#
+#		seven significant bits of Y plus 2**(-7), i.e.		#
+#		F = 1.xxxxxx1 in base 2 where the six "x" match those	#
 #		of Y. Note that |Y-F| <= 2**(-7).			#
 #									#
-#	Step 3. Define u = (Y-F)/F. Approximate log(1+u) by a 		#
+#	Step 3. Define u = (Y-F)/F. Approximate log(1+u) by a		#
 #		polynomial in u, log(1+u) = poly.			#
 #									#
-#	Step 4. Reconstruct 						#
+#	Step 4. Reconstruct						#
 #		log(X) = log( 2**k * Y ) = k*log(2) + log(F) + log(1+u)	#
 #		by k*log(2) + (log(F) + poly). The values of log(F) are	#
 #		calculated beforehand and stored in the program.	#
 #									#
 #	lognp1:								#
-#	Step 1: If |X| < 1/16, approximate log(1+X) by an odd 		#
+#	Step 1: If |X| < 1/16, approximate log(1+X) by an odd		#
 #		polynomial in u where u = 2X/(2+X). Otherwise, move on	#
 #		to Step 2.						#
 #									#
 #	Step 2: Let 1+X = 2**k * Y, where 1 <= Y < 2. Define F as done	#
-#		in Step 2 of the algorithm for LOGN and compute 	#
-#		log(1+X) as k*log(2) + log(F) + poly where poly 	#
-#		approximates log(1+u), u = (Y-F)/F. 			#
+#		in Step 2 of the algorithm for LOGN and compute		#
+#		log(1+X) as k*log(2) + log(F) + poly where poly		#
+#		approximates log(1+u), u = (Y-F)/F.			#
 #									#
 #	Implementation Notes:						#
-#	Note 1. There are 64 different possible values for F, thus 64 	#
+#	Note 1. There are 64 different possible values for F, thus 64	#
 #		log(F)'s need to be tabulated. Moreover, the values of	#
 #		1/F are also tabulated so that the division in (Y-F)/F	#
 #		can be performed by a multiplication.			#
 #									#
-#	Note 2. In Step 2 of lognp1, in order to preserved accuracy, 	#
-#		the value Y-F has to be calculated carefully when 	#
-#		1/2 <= X < 3/2. 					#
+#	Note 2. In Step 2 of lognp1, in order to preserved accuracy,	#
+#		the value Y-F has to be calculated carefully when	#
+#		1/2 <= X < 3/2.						#
 #									#
-#	Note 3. To fully exploit the pipeline, polynomials are usually 	#
+#	Note 3. To fully exploit the pipeline, polynomials are usually	#
 #		separated into two parts evaluated independently before	#
 #		being added up.						#
 #									#
@@ -8334,9 +8334,9 @@ LOGBGN:
 	cmp.l		%d1,&0			# CHECK IF X IS NEGATIVE
 	blt.w		LOGNEG			# LOG OF NEGATIVE ARGUMENT IS INVALID
 # X IS POSITIVE, CHECK IF X IS NEAR 1
-	cmp.l		%d1,&0x3ffef07d 	# IS X < 15/16?
+	cmp.l		%d1,&0x3ffef07d		# IS X < 15/16?
 	blt.b		LOGMAIN			# YES
-	cmp.l		%d1,&0x3fff8841 	# IS X > 17/16?
+	cmp.l		%d1,&0x3fff8841		# IS X > 17/16?
 	ble.w		LOGNEAR1		# NO
 
 LOGMAIN:
@@ -8349,7 +8349,7 @@ LOGMAIN:
 #--NOTE THAT U = (Y-F)/F IS VERY SMALL AND THUS APPROXIMATING
 #--LOG(1+U) CAN BE VERY EFFICIENT.
 #--ALSO NOTE THAT THE VALUE 1/F IS STORED IN A TABLE SO THAT NO
-#--DIVISION IS NEEDED TO CALCULATE (Y-F)/F. 
+#--DIVISION IS NEEDED TO CALCULATE (Y-F)/F.
 
 #--GET K, Y, F, AND ADDRESS OF 1/F.
 	asr.l		&8,%d1
@@ -8564,10 +8564,10 @@ LP1REAL:
 	mov.l		X(%a6),%d1
 	cmp.l		%d1,&0
 	ble.w		LP1NEG0			# LOG OF ZERO OR -VE
-	cmp.l		%d1,&0x3ffe8000 	# IS BOUNDS [1/2,3/2]?
+	cmp.l		%d1,&0x3ffe8000		# IS BOUNDS [1/2,3/2]?
 	blt.w		LOGMAIN
 	cmp.l		%d1,&0x3fffc000
-	bgt.w		LOGMAIN 
+	bgt.w		LOGMAIN
 #--IF 1+Z > 3/2 OR 1+Z < 1/2, THEN X, WHICH IS ROUNDING 1+Z,
 #--CONTAINS AT LEAST 63 BITS OF INFORMATION OF Z. IN THAT CASE,
 #--SIMPLY INVOKE LOG(X) FOR LOG(1+Z).
@@ -8668,7 +8668,7 @@ slognp1d:
 #	a0 = pointer to extended precision input			#
 #	d0 = round precision,mode					#
 #									#
-# OUTPUT **************************************************************	# 
+# OUTPUT **************************************************************	#
 #	fp0 = arctanh(X)						#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
@@ -8783,7 +8783,7 @@ satanhd:
 #            2.1 Restore the user FPCR					#
 #            2.2 Return ans := Y * INV_L10.				#
 #									#
-#       slog10: 							#
+#       slog10:								#
 #									#
 #       Step 0. If X < 0, create a NaN and raise the invalid operation	#
 #               flag. Otherwise, save FPCR in D1; set FpCR to default.	#
@@ -8926,7 +8926,7 @@ slog2d:
 #	fp0 = 2**X or 10**X						#
 #									#
 # ACCURACY and MONOTONICITY *******************************************	#
-#	The returned result is within 2 ulps in 64 significant bit, 	#
+#	The returned result is within 2 ulps in 64 significant bit,	#
 #	i.e. within 0.5001 ulp to 53 bits if the result is subsequently	#
 #	rounded to double precision. The result is provably monotonic	#
 #	in double precision.						#
@@ -8957,7 +8957,7 @@ slog2d:
 #									#
 #	4. Define r as							#
 #		r := ((X - N*L1)-N*L2) * L10				#
-#		where L1, L2 are the leading and trailing parts of 	#
+#		where L1, L2 are the leading and trailing parts of	#
 #		log_10(2)/64 and L10 is the natural log of 10. Then	#
 #		10**X = 2**(M') * 2**(M) * 2**(j/64) * exp(r).		#
 #		Go to expr to compute that expression.			#
@@ -8978,7 +8978,7 @@ slog2d:
 #		Exit.							#
 #									#
 #	ExpBig								#
-#	1. Generate overflow by Huge * Huge if X > 0; otherwise, 	#
+#	1. Generate overflow by Huge * Huge if X > 0; otherwise,	#
 #	        generate underflow by Tiny * Tiny.			#
 #									#
 #	ExpSm								#
@@ -9309,10 +9309,10 @@ stentoxd:
 
 #########################################################################
 # smovcr(): returns the ROM constant at the offset specified in d1	#
-#	    rounded to the mode and precision specified in d0. 		#
+#	    rounded to the mode and precision specified in d0.		#
 #									#
 # INPUT	***************************************************************	#
-# 	d0 = rnd prec,mode						#
+#	d0 = rnd prec,mode						#
 #	d1 = ROM offset							#
 #									#
 # OUTPUT **************************************************************	#
@@ -9325,7 +9325,7 @@ smovcr:
 	mov.l		%d1,-(%sp)		# save rom offset for a sec
 
 	lsr.b		&0x4,%d0		# shift ctrl bits to lo
-	mov.l		%d0,%d1			# make a copy 
+	mov.l		%d0,%d1			# make a copy
 	andi.w		&0x3,%d1		# extract rnd mode
 	andi.w		&0xc,%d0		# extract rnd prec
 	swap		%d0			# put rnd prec in hi
@@ -9343,7 +9343,7 @@ smovcr:
 	cmpi.b		%d1,&0x0e		# check range $0b - $0e
 	ble.b		sm_tbl			# valid constants in this range
 	cmpi.b		%d1,&0x2f		# check range $10 - $2f
-	ble.b		z_val			# if in this range, return zero 
+	ble.b		z_val			# if in this range, return zero
 	cmpi.b		%d1,&0x3f		# check range $30 - $3f
 	ble.b		bg_tbl			# valid constants in this range
 
@@ -9378,7 +9378,7 @@ pi_rp:
 #	$0C	e		(inexact)
 #	$0D	log2(e)		(inexact)
 #	$0E	log10(e)	(exact)
-# 
+#
 # fetch a pointer to the answer table relating to the proper rounding
 # precision.
 #
@@ -9465,7 +9465,7 @@ not_ext:
 	swap		%d0			# rnd prec in upper word
 
 # call round() to round the answer to the proper precision.
-# exponents out of range for single or double DO NOT cause underflow 
+# exponents out of range for single or double DO NOT cause underflow
 # or overflow.
 	mov.w		0x0(%a0,%d1.w),FP_SCR1_EX(%a6) # load first word
 	mov.l		0x4(%a0,%d1.w),FP_SCR1_HI(%a6) # load second word
@@ -9562,7 +9562,7 @@ BIGRP:
 
 #########################################################################
 # sscale(): computes the destination operand scaled by the source	#
-#	    operand. If the absoulute value of the source operand is 	#
+#	    operand. If the absoulute value of the source operand is	#
 #	    >= 2^14, an overflow or underflow is returned.		#
 #									#
 # INPUT *************************************************************** #
@@ -9624,7 +9624,7 @@ sok_dnrm:
 	bge.b		sok_norm2		# thank goodness no
 
 # the multiply factor that we're trying to create should be a denorm
-# for the multiply to work. therefore, we're going to actually do a 
+# for the multiply to work. therefore, we're going to actually do a
 # multiply with a denorm which will cause an unimplemented data type
 # exception to be put into the machine which will be caught and corrected
 # later. we don't do this with the DENORMs above because this method
@@ -9639,7 +9639,7 @@ sok_dnrm:
 	clr.l		-(%sp)			# insert zero low mantissa
 	mov.l		%d1,-(%sp)		# insert new high mantissa
 	clr.l		-(%sp)			# make zero exponent
-	bra.b		sok_norm_cont	
+	bra.b		sok_norm_cont
 sok_dnrm_32:
 	subi.b		&0x20,%d0		# get shift count
 	lsr.l		%d0,%d1			# make low mantissa longword
@@ -9647,7 +9647,7 @@ sok_dnrm_32:
 	clr.l		-(%sp)			# insert zero high mantissa
 	clr.l		-(%sp)			# make zero exponent
 	bra.b		sok_norm_cont
-	
+
 # the src will force the dst to a DENORM value or worse. so, let's
 # create an fp multiply that will create the result.
 sok_norm:
@@ -9705,7 +9705,7 @@ ssmall_done:
 #	a1 = pointer to extended precision input Y			#
 #	d0 = round precision,mode					#
 #									#
-# 	The input operands X and Y can be either normalized or 		#
+#	The input operands X and Y can be either normalized or		#
 #	denormalized.							#
 #									#
 # OUTPUT ************************************************************** #
@@ -9714,7 +9714,7 @@ ssmall_done:
 # ALGORITHM *********************************************************** #
 #									#
 #       Step 1.  Save and strip signs of X and Y: signX := sign(X),	#
-#                signY := sign(Y), X := |X|, Y := |Y|, 			#
+#                signY := sign(Y), X := |X|, Y := |Y|,			#
 #                signQ := signX EOR signY. Record whether MOD or REM	#
 #                is requested.						#
 #									#
@@ -9734,7 +9734,7 @@ ssmall_done:
 #									#
 #       Step 4.  At this point, R = X - QY = MOD(X,Y). Set		#
 #                Last_Subtract := false (used in Step 7 below). If	#
-#                MOD is requested, go to Step 6. 			#
+#                MOD is requested, go to Step 6.			#
 #									#
 #       Step 5.  R = MOD(X,Y), but REM(X,Y) is requested.		#
 #            5.1 If R < Y/2, then R = MOD(X,Y) = REM(X,Y). Go to	#
@@ -10060,8 +10060,8 @@ Restore:
 	mov.b		&FMUL_OP,%d1		# last inst is MUL
 	fmul.x		Scale(%pc),%fp0		# may cause underflow
 	bra		t_catch2
-# the '040 package did this apparently to see if the dst operand for the 
-# preceding fmul was a denorm. but, it better not have been since the 
+# the '040 package did this apparently to see if the dst operand for the
+# preceding fmul was a denorm. but, it better not have been since the
 # algorithm just got done playing with fp0 and expected no exceptions
 # as a result. trust me...
 #	bra		t_avoid_unsupp		# check for denorm as a
@@ -10075,7 +10075,7 @@ Finish:
 Rem_is_0:
 #..R = 2^(-j)X - Q Y = Y, thus R = 0 and quotient = 2^j (Q+1)
 	addq.l		&1,%d3
-	cmp.l		%d0,&8			# D0 is j 
+	cmp.l		%d0,&8			# D0 is j
 	bge.b		Q_Big
 
 	lsl.l		%d0,%d3
@@ -10117,20 +10117,20 @@ qnan:	long		0x7fff0000, 0xffffffff, 0xffffffff
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to source operand					#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #									#
 # ALGORITHM ***********************************************************	#
 #	- Store properly signed INF into fp0.				#
-#	- Set FPSR exception status dz bit, ccode inf bit, and 		#
+#	- Set FPSR exception status dz bit, ccode inf bit, and		#
 #	  accrued dz bit.						#
 #									#
 #########################################################################
 
 	global		t_dz
 t_dz:
-	tst.b		SRC_EX(%a0) 		# no; is src negative?
+	tst.b		SRC_EX(%a0)		# no; is src negative?
 	bmi.b		t_dz2			# yes
 
 dz_pinf:
@@ -10146,7 +10146,7 @@ t_dz2:
 
 #################################################################
 # OPERR exception:						#
-#	- set FPSR exception status operr bit, condition code 	#
+#	- set FPSR exception status operr bit, condition code	#
 #	  nan bit; Store default NAN into fp0			#
 #################################################################
 	global		t_operr
@@ -10157,7 +10157,7 @@ t_operr:
 
 #################################################################
 # Extended DENORM:						#
-# 	- For all functions that have a denormalized input and	#
+#	- For all functions that have a denormalized input and	#
 #	  that f(x)=x, this is the entry point.			#
 #	- we only return the EXOP here if either underflow or	#
 #	  inexact is enabled.					#
@@ -10224,13 +10224,13 @@ xdnrm_ena:
 
 #################################################################
 # UNFL exception:						#
-# 	- This routine is for cases where even an EXOP isn't	#
-#  	  large enough to hold the range of this result.	#
+#	- This routine is for cases where even an EXOP isn't	#
+#	  large enough to hold the range of this result.	#
 #	  In such a case, the EXOP equals zero.			#
-#  	- Return the default result to the proper precision 	#
+#	- Return the default result to the proper precision	#
 #	  with the sign of this result being the same as that	#
 #	  of the src operand.					#
-# 	- t_unfl2() is provided to force the result sign to 	#
+#	- t_unfl2() is provided to force the result sign to	#
 #	  positive which is the desired result for fetox().	#
 #################################################################
 	global		t_unfl
@@ -10259,15 +10259,15 @@ t_unfl2:
 
 #################################################################
 # OVFL exception:						#
-# 	- This routine is for cases where even an EXOP isn't	#
-#  	  large enough to hold the range of this result.	#
-# 	- Return the default result to the proper precision 	#
-#	  with the sign of this result being the same as that 	#
+#	- This routine is for cases where even an EXOP isn't	#
+#	  large enough to hold the range of this result.	#
+#	- Return the default result to the proper precision	#
+#	  with the sign of this result being the same as that	#
 #	  of the src operand.					#
-# 	- t_ovfl2() is provided to force the result sign to 	#
+#	- t_ovfl2() is provided to force the result sign to	#
 #	  positive which is the desired result for fcosh().	#
-# 	- t_ovfl_sc() is provided for scale() which only sets 	#
-#	  the inexact bits if the number is inexact for the 	#
+#	- t_ovfl_sc() is provided for scale() which only sets	#
+#	  the inexact bits if the number is inexact for the	#
 #	  precision indicated.					#
 #################################################################
 
@@ -10338,10 +10338,10 @@ t_ovfl2:
 	rts
 
 #################################################################
-# t_catch(): 							#
+# t_catch():							#
 #	- the last operation of a transcendental emulation	#
-# 	  routine may have caused an underflow or overflow. 	#
-# 	  we find out if this occurred by doing an fsave and 	#
+#	  routine may have caused an underflow or overflow.	#
+#	  we find out if this occurred by doing an fsave and	#
 #	  checking the exception bit. if one did occur, then we	#
 #	  jump to fgen_except() which creates the default	#
 #	  result and EXOP for us.				#
@@ -10407,8 +10407,8 @@ t_catch2:
 # unf_res(): underflow default result calculation for transcendentals	#
 #									#
 # INPUT:								#
-# 	d0   : rnd mode,precision					#
-# 	d1.b : sign bit of result ('11111111 = (-) ; '00000000 = (+))	#
+#	d0   : rnd mode,precision					#
+#	d1.b : sign bit of result ('11111111 = (-) ; '00000000 = (+))	#
 # OUTPUT:								#
 #	a0   : points to result (in instruction memory)			#
 #########################################################################
@@ -10457,7 +10457,7 @@ tbl_unf_result:
 	long		0x0,0x0,0x0,0x0
 	long		0x0,0x0,0x0,0x0
 	long		0x0,0x0,0x0,0x0
-	
+
 	long		0x80000000, 0x00000000, 0x00000000, 0x0 # ZERO;ext
 	long		0x80000000, 0x00000000, 0x00000000, 0x0 # ZERO;ext
 	long		0x80000000, 0x00000000, 0x00000001, 0x0 # MIN; ext
@@ -10504,7 +10504,7 @@ ld_mzero:
 #########################################################################
 	global		dst_zero
 dst_zero:
-	tst.b		DST_EX(%a1) 		# get sign of dst operand
+	tst.b		DST_EX(%a1)		# get sign of dst operand
 	bmi.b		ld_mzero		# if neg, load neg zero
 	bra.b		ld_pzero		# load positive zero
 
@@ -10513,7 +10513,7 @@ dst_zero:
 #########################################################################
 	global		src_inf
 src_inf:
-	tst.b		SRC_EX(%a0) 		# get sign of src operand
+	tst.b		SRC_EX(%a0)		# get sign of src operand
 	bmi.b		ld_minf			# if negative branch
 
 #
@@ -10539,7 +10539,7 @@ ld_minf:
 #########################################################################
 	global		dst_inf
 dst_inf:
-	tst.b		DST_EX(%a1) 		# get sign of dst operand
+	tst.b		DST_EX(%a1)		# get sign of dst operand
 	bmi.b		ld_minf			# if negative branch
 	bra.b		ld_pinf
 
@@ -10581,7 +10581,7 @@ setoxm1i:
 #########################################################################
 	global		src_one
 src_one:
-	tst.b		SRC_EX(%a0) 		# check sign of source
+	tst.b		SRC_EX(%a0)		# check sign of source
 	bmi.b		ld_mone
 
 #
@@ -10610,7 +10610,7 @@ mpiby2:	long		0xbfff0000, 0xc90fdaa2, 0x2168c235
 #################################################################
 	global		spi_2
 spi_2:
-	tst.b		SRC_EX(%a0) 		# check sign of source
+	tst.b		SRC_EX(%a0)		# check sign of source
 	bmi.b		ld_mpi2
 
 #
@@ -10637,7 +10637,7 @@ ld_mpi2:
 
 #
 # ssincosz(): When the src operand is ZERO, store a one in the
-# 	      cosine register and return a ZERO in fp0 w/ the same sign
+#	      cosine register and return a ZERO in fp0 w/ the same sign
 #	      as the src operand.
 #
 	global		ssincosz
@@ -10666,7 +10666,7 @@ ssincosi:
 
 #
 # ssincosqnan(): When the src operand is a QNAN, store the QNAN in the cosine
-# 		 register and branch to the src QNAN routine.
+#		 register and branch to the src QNAN routine.
 #
 	global		ssincosqnan
 ssincosqnan:
@@ -10719,7 +10719,7 @@ sto_cos_1:
 	fmovm.x		&0x40,EXC_FP1(%a6)
 	rts
 sto_cos_2:
-	fmov.x 		%fp1,%fp2
+	fmov.x		%fp1,%fp2
 	rts
 sto_cos_3:
 	fmov.x		%fp1,%fp3
@@ -10988,8 +10988,8 @@ src_qnan_m:
 # fkern2.s:
 #	These entry points are used by the exception handler
 # routines where an instruction is selected by an index into
-# a large jump table corresponding to a given instruction which 
-# has been decoded. Flow continues here where we now decode 
+# a large jump table corresponding to a given instruction which
+# has been decoded. Flow continues here where we now decode
 # further accoding to the source operand type.
 #
 
@@ -11331,11 +11331,11 @@ fscale:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fgen_except(): catch an exception during transcendental 	#
+#	fgen_except(): catch an exception during transcendental		#
 #		       emulation					#
 #									#
 # XREF ****************************************************************	#
-#	fmul() - emulate a multiply instruction				# 
+#	fmul() - emulate a multiply instruction				#
 #	fadd() - emulate an add instruction				#
 #	fin() - emulate an fmove instruction				#
 #									#
@@ -11343,16 +11343,16 @@ fscale:
 #	fp0 = destination operand					#
 #	d0  = type of instruction that took exception			#
 #	fsave frame = source operand					#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP							#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	An exception occurred on the last instruction of the 		#
-# transcendental emulation. hopefully, this won't be happening much 	#
+#	An exception occurred on the last instruction of the		#
+# transcendental emulation. hopefully, this won't be happening much	#
 # because it will be VERY slow.						#
-# 	The only exceptions capable of passing through here are		#
+#	The only exceptions capable of passing through here are		#
 # Overflow, Underflow, and Unsupported Data Type.			#
 #									#
 #########################################################################
@@ -11408,11 +11408,11 @@ fge_unsupp:
 
 	swbeg		&109
 tbl_unsupp:
-	long		fin	 	- tbl_unsupp	# 00: fmove
-	long		fint	 	- tbl_unsupp	# 01: fint
-	long		fsinh	 	- tbl_unsupp	# 02: fsinh
-	long		fintrz	 	- tbl_unsupp	# 03: fintrz
-	long		fsqrt	 	- tbl_unsupp	# 04: fsqrt
+	long		fin		- tbl_unsupp	# 00: fmove
+	long		fint		- tbl_unsupp	# 01: fint
+	long		fsinh		- tbl_unsupp	# 02: fsinh
+	long		fintrz		- tbl_unsupp	# 03: fintrz
+	long		fsqrt		- tbl_unsupp	# 04: fsqrt
 	long		tbl_unsupp	- tbl_unsupp
 	long		flognp1		- tbl_unsupp	# 06: flognp1
 	long		tbl_unsupp	- tbl_unsupp
@@ -11432,23 +11432,23 @@ tbl_unsupp:
 	long		flog10		- tbl_unsupp	# 15: flog10
 	long		flog2		- tbl_unsupp	# 16: flog2
 	long		tbl_unsupp	- tbl_unsupp
-	long		fabs		- tbl_unsupp 	# 18: fabs
+	long		fabs		- tbl_unsupp	# 18: fabs
 	long		fcosh		- tbl_unsupp	# 19: fcosh
-	long		fneg		- tbl_unsupp 	# 1a: fneg
+	long		fneg		- tbl_unsupp	# 1a: fneg
 	long		tbl_unsupp	- tbl_unsupp
 	long		facos		- tbl_unsupp	# 1c: facos
 	long		fcos		- tbl_unsupp	# 1d: fcos
 	long		fgetexp		- tbl_unsupp	# 1e: fgetexp
 	long		fgetman		- tbl_unsupp	# 1f: fgetman
-	long		fdiv		- tbl_unsupp 	# 20: fdiv
+	long		fdiv		- tbl_unsupp	# 20: fdiv
 	long		fmod		- tbl_unsupp	# 21: fmod
-	long		fadd		- tbl_unsupp 	# 22: fadd
-	long		fmul		- tbl_unsupp 	# 23: fmul
-	long		fsgldiv		- tbl_unsupp 	# 24: fsgldiv
+	long		fadd		- tbl_unsupp	# 22: fadd
+	long		fmul		- tbl_unsupp	# 23: fmul
+	long		fsgldiv		- tbl_unsupp	# 24: fsgldiv
 	long		frem		- tbl_unsupp	# 25: frem
 	long		fscale		- tbl_unsupp	# 26: fscale
-	long		fsglmul		- tbl_unsupp 	# 27: fsglmul
-	long		fsub		- tbl_unsupp 	# 28: fsub
+	long		fsglmul		- tbl_unsupp	# 27: fsglmul
+	long		fsub		- tbl_unsupp	# 28: fsub
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
@@ -11464,20 +11464,20 @@ tbl_unsupp:
 	long		fsincos		- tbl_unsupp	# 35: fsincos
 	long		fsincos		- tbl_unsupp	# 36: fsincos
 	long		fsincos		- tbl_unsupp	# 37: fsincos
-	long		fcmp		- tbl_unsupp 	# 38: fcmp
+	long		fcmp		- tbl_unsupp	# 38: fcmp
 	long		tbl_unsupp	- tbl_unsupp
-	long		ftst		- tbl_unsupp 	# 3a: ftst
+	long		ftst		- tbl_unsupp	# 3a: ftst
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
-	long		fsin		- tbl_unsupp 	# 40: fsmove
-	long		fssqrt		- tbl_unsupp 	# 41: fssqrt
+	long		fsin		- tbl_unsupp	# 40: fsmove
+	long		fssqrt		- tbl_unsupp	# 41: fssqrt
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		fdin		- tbl_unsupp	# 44: fdmove
-	long		fdsqrt		- tbl_unsupp 	# 45: fdsqrt
+	long		fdsqrt		- tbl_unsupp	# 45: fdsqrt
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
@@ -11496,31 +11496,31 @@ tbl_unsupp:
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
-	long		fsabs		- tbl_unsupp 	# 58: fsabs
+	long		fsabs		- tbl_unsupp	# 58: fsabs
 	long		tbl_unsupp	- tbl_unsupp
-	long		fsneg		- tbl_unsupp 	# 5a: fsneg
+	long		fsneg		- tbl_unsupp	# 5a: fsneg
 	long		tbl_unsupp	- tbl_unsupp
 	long		fdabs		- tbl_unsupp	# 5c: fdabs
 	long		tbl_unsupp	- tbl_unsupp
-	long		fdneg		- tbl_unsupp 	# 5e: fdneg
+	long		fdneg		- tbl_unsupp	# 5e: fdneg
 	long		tbl_unsupp	- tbl_unsupp
 	long		fsdiv		- tbl_unsupp	# 60: fsdiv
 	long		tbl_unsupp	- tbl_unsupp
 	long		fsadd		- tbl_unsupp	# 62: fsadd
 	long		fsmul		- tbl_unsupp	# 63: fsmul
-	long		fddiv		- tbl_unsupp 	# 64: fddiv
+	long		fddiv		- tbl_unsupp	# 64: fddiv
 	long		tbl_unsupp	- tbl_unsupp
 	long		fdadd		- tbl_unsupp	# 66: fdadd
-	long		fdmul		- tbl_unsupp 	# 67: fdmul
+	long		fdmul		- tbl_unsupp	# 67: fdmul
 	long		fssub		- tbl_unsupp	# 68: fssub
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
-	long		fdsub		- tbl_unsupp 	# 6c: fdsub
+	long		fdsub		- tbl_unsupp	# 6c: fdsub
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fmul(): emulates the fmul instruction				#
+#	fmul(): emulates the fmul instruction				#
 #	fsmul(): emulates the fsmul instruction				#
 #	fdmul(): emulates the fdmul instruction				#
 #									#
@@ -11529,8 +11529,8 @@ tbl_unsupp:
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res() - return default underflow result			#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -11548,12 +11548,12 @@ tbl_unsupp:
 # instruction won't cause an exception. Use the regular fmul to		#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
 
-	align 		0x10
+	align		0x10
 tbl_fmul_ovfl:
 	long		0x3fff - 0x7ffe		# ext_max
 	long		0x3fff - 0x407e		# sgl_max
@@ -11614,7 +11614,7 @@ fmul_norm:
 #
 # NORMAL:
 # - the result of the multiply operation will neither overflow nor underflow.
-# - do the multiply to the proper precision and rounding mode. 
+# - do the multiply to the proper precision and rounding mode.
 # - scale the result exponent using the scale factor. if both operands were
 # normalized then we really don't need to go through this scaling. but for now,
 # this will do.
@@ -11625,7 +11625,7 @@ fmul_normal:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -11665,7 +11665,7 @@ fmul_ovfl:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -11744,7 +11744,7 @@ fmul_may_ovfl:
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
 	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
-	
+
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -11753,7 +11753,7 @@ fmul_may_ovfl:
 	fabs.x		%fp0,%fp1		# make a copy of result
 	fcmp.b		%fp1,&0x2		# is |result| >= 2.b?
 	fbge.w		fmul_ovfl_tst		# yes; overflow has occurred
-	
+
 # no, it didn't overflow; we have correct result
 	bra.w		fmul_normal_exit
 
@@ -11770,7 +11770,7 @@ fmul_may_ovfl:
 # of this operation then has its exponent scaled by -0x6000 to create the
 # exceptional operand.
 #
-fmul_unfl:	
+fmul_unfl:
 	bset		&unfl_bit,FPSR_EXCEPT(%a6) # set unfl exc bit
 
 # for fun, let's use only extended precision, round to zero. then, let
@@ -11803,7 +11803,7 @@ fmul_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fmul_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -11819,7 +11819,7 @@ fmul_unfl_ena:
 fmul_unfl_ena_cont:
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -11854,7 +11854,7 @@ fmul_may_unfl:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -11878,11 +11878,11 @@ fmul_may_unfl:
 	mov.l		L_SCR3(%a6),%d1
 	andi.b		&0xc0,%d1		# keep rnd prec
 	ori.b		&rz_mode*0x10,%d1	# insert RZ
-	
+
 	fmov.l		%d1,%fpcr		# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fabs.x		%fp1			# make absolute value
@@ -12024,22 +12024,22 @@ fmul_inf_src:
 #	norm() - normalize mantissa for EXOP on denorm			#
 #	scale_to_zero_src() - scale src exponent to zero		#
 #	ovf_res() - return default overflow result			#
-# 	unf_res() - return default underflow result			#
+#	unf_res() - return default underflow result			#
 #	res_qnan_1op() - return QNAN result				#
 #	res_snan_1op() - return SNAN result				#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
 #	d0 = round prec/mode						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP (if exception occurred)				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs, infinities, and zeroes as special cases. Divide	#
+#	Handle NANs, infinities, and zeroes as special cases. Divide	#
 # norms into extended, single, and double precision.			#
-# 	Norms can be emulated w/ a regular fmove instruction. For	#
+#	Norms can be emulated w/ a regular fmove instruction. For	#
 # sgl/dbl, must scale exponent and perform an "fmove". Check to see	#
 # if the result would have overflowed/underflowed. If so, use unf_res()	#
 # or ovf_res() to return the default result. Also return EXOP if	#
@@ -12065,7 +12065,7 @@ fin:
 
 	mov.b		STAG(%a6),%d1		# fetch src optype tag
 	bne.w		fin_not_norm		# optimize on non-norm input
-		
+
 #
 # FP MOVE IN: NORMs and DENORMs ONLY!
 #
@@ -12126,9 +12126,9 @@ fin_denorm_unfl_ena:
 
 #
 # operand is to be rounded to single or double precision
-#	
+#
 fin_not_ext:
-	cmpi.b		%d0,&s_mode*0x10 	# separate sgl/dbl prec
+	cmpi.b		%d0,&s_mode*0x10	# separate sgl/dbl prec
 	bne.b		fin_dbl
 
 #
@@ -12212,10 +12212,10 @@ fin_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# unf_res may have set 'Z'
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow or inexact is enabled. 
+# operand will underflow AND underflow or inexact is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fin_sd_unfl_ena:
@@ -12337,7 +12337,7 @@ fin_not_norm:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fdiv(): emulates the fdiv instruction				#
+#	fdiv(): emulates the fdiv instruction				#
 #	fsdiv(): emulates the fsdiv instruction				#
 #	fddiv(): emulates the fddiv instruction				#
 #									#
@@ -12346,8 +12346,8 @@ fin_not_norm:
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res() - return default underflow result			#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -12365,7 +12365,7 @@ fin_not_norm:
 # instruction won't cause an exception. Use the regular fdiv to		#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -12402,7 +12402,7 @@ fdiv:
 	or.b		STAG(%a6),%d1		# combine src tags
 
 	bne.w		fdiv_not_norm		# optimize on non-norm input
-		
+
 #
 # DIVIDE: NORMs and DENORMs ONLY!
 #
@@ -12468,7 +12468,7 @@ tbl_fdiv_ovfl2:
 fdiv_no_ovfl:
 	mov.l		(%sp)+,%d0		# restore scale factor
 	bra.b		fdiv_normal_exit
-	
+
 fdiv_may_ovfl:
 	mov.l		%d0,-(%sp)		# save scale factor
 
@@ -12501,7 +12501,7 @@ fdiv_ovfl_tst:
 	bne.b		fdiv_ovfl_ena		# yes
 
 fdiv_ovfl_dis:
-	btst		&neg_bit,FPSR_CC(%a6) 	# is result negative?
+	btst		&neg_bit,FPSR_CC(%a6)	# is result negative?
 	sne		%d1			# set sign param accordingly
 	mov.l		L_SCR3(%a6),%d0		# pass prec:rnd
 	bsr.l		ovf_res			# calculate default result
@@ -12573,7 +12573,7 @@ fdiv_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fdiv_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -12637,8 +12637,8 @@ fdiv_may_unfl:
 #
 # we still don't know if underflow occurred. result is ~ equal to 1. but,
 # we don't know if the result was an underflow that rounded up to a 1
-# or a normalized number that rounded down to a 1. so, redo the entire 
-# operation using RZ as the rounding mode to see what the pre-rounded 
+# or a normalized number that rounded down to a 1. so, redo the entire
+# operation using RZ as the rounding mode to see what the pre-rounded
 # result is. this case should be relatively rare.
 #
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op into fp1
@@ -12765,8 +12765,8 @@ fdiv_inf_load_p:
 	rts
 
 #
-# The destination was an INF w/ an In Range or ZERO source, the result is 
-# an INF w/ the proper sign. 
+# The destination was an INF w/ an In Range or ZERO source, the result is
+# an INF w/ the proper sign.
 # The 68881/882 returns the destination INF w/ the new sign(if the j-bit of the
 # dst INF is set, then then j-bit of the result INF is also set).
 #
@@ -12796,11 +12796,11 @@ fdiv_inf_dst_p:
 #	fdneg(): emulates the fdneg instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	norm() - normalize a denorm to provide EXOP			#
+#	norm() - normalize a denorm to provide EXOP			#
 #	scale_to_zero_src() - scale sgl/dbl source exponent		#
 #	ovf_res() - return default overflow result			#
 #	unf_res() - return default underflow result			#
-# 	res_qnan_1op() - return QNAN result				#
+#	res_qnan_1op() - return QNAN result				#
 #	res_snan_1op() - return SNAN result				#
 #									#
 # INPUT ***************************************************************	#
@@ -12838,7 +12838,7 @@ fneg:
 	mov.l		%d0,L_SCR3(%a6)		# store rnd info
 	mov.b		STAG(%a6),%d1
 	bne.w		fneg_not_norm		# optimize on non-norm input
-		
+
 #
 # NEGATE SIGN : norms and denorms ONLY!
 #
@@ -12897,7 +12897,7 @@ fneg_ext_unfl_ena:
 	neg.w		%d0			# new exponent = -(shft val)
 	addi.w		&0x6000,%d0		# add new bias to exponent
 	mov.w		FP_SCR0_EX(%a6),%d1	# fetch old sign,exp
-	andi.w		&0x8000,%d1	 	# keep old sign
+	andi.w		&0x8000,%d1		# keep old sign
 	andi.w		&0x7fff,%d0		# clear sign position
 	or.w		%d1,%d0			# concat old sign, new exponent
 	mov.w		%d0,FP_SCR0_EX(%a6)	# insert new exponent
@@ -12976,7 +12976,7 @@ fneg_dbl:
 fneg_sd_unfl:
 	bset		&unfl_bit,FPSR_EXCEPT(%a6) # set unfl exc bit
 
-	eori.b		&0x80,FP_SCR0_EX(%a6)	# negate sign	
+	eori.b		&0x80,FP_SCR0_EX(%a6)	# negate sign
 	bpl.b		fneg_sd_unfl_tst
 	bset		&neg_bit,FPSR_CC(%a6)	# set 'N' ccode bit
 
@@ -12992,10 +12992,10 @@ fneg_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# unf_res may have set 'Z'
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow is enabled. 
+# operand will underflow AND underflow is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fneg_sd_unfl_ena:
@@ -13117,19 +13117,19 @@ fneg_not_norm:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	ftst(): emulates the ftest instruction				#
+#	ftst(): emulates the ftest instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	res{s,q}nan_1op() - set NAN result for monadic instruction	#
+#	res{s,q}nan_1op() - set NAN result for monadic instruction	#
 #									#
 # INPUT ***************************************************************	#
-# 	a0 = pointer to extended precision source operand		#
+#	a0 = pointer to extended precision source operand		#
 #									#
 # OUTPUT **************************************************************	#
 #	none								#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Check the source operand tag (STAG) and set the FPCR according	#
+#	Check the source operand tag (STAG) and set the FPCR according	#
 # to the operand type and sign.						#
 #									#
 #########################################################################
@@ -13138,7 +13138,7 @@ fneg_not_norm:
 ftst:
 	mov.b		STAG(%a6),%d1
 	bne.b		ftst_not_norm		# optimize on non-norm input
-		
+
 #
 # Norm:
 #
@@ -13186,7 +13186,7 @@ ftst_inf_p:
 ftst_inf_m:
 	mov.b		&inf_bmask+neg_bmask,FPSR_CC(%a6) # set 'I','N' ccode bits
 	rts
-	
+
 #
 # Zero:
 #
@@ -13215,13 +13215,13 @@ ftst_zero_m:
 #	fp0 = result							#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Separate according to operand type. Unnorms don't pass through 	#
-# here. For norms, load the rounding mode/prec, execute a "fint", then 	#
+#	Separate according to operand type. Unnorms don't pass through	#
+# here. For norms, load the rounding mode/prec, execute a "fint", then	#
 # store the resulting FPSR bits.					#
-# 	For denorms, force the j-bit to a one and do the same as for	#
-# norms. Denorms are so low that the answer will either be a zero or a 	#
+#	For denorms, force the j-bit to a one and do the same as for	#
+# norms. Denorms are so low that the answer will either be a zero or a	#
 # one.									#
-# 	For zeroes/infs/NANs, return the same while setting the FPSR	#
+#	For zeroes/infs/NANs, return the same while setting the FPSR	#
 # as appropriate.							#
 #									#
 #########################################################################
@@ -13230,7 +13230,7 @@ ftst_zero_m:
 fint:
 	mov.b		STAG(%a6),%d1
 	bne.b		fint_not_norm		# optimize on non-norm input
-		
+
 #
 # Norm:
 #
@@ -13240,7 +13240,7 @@ fint_norm:
 	fmov.l		%d0,%fpcr		# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fint.x 		SRC(%a0),%fp0		# execute fint
+	fint.x		SRC(%a0),%fp0		# execute fint
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fmov.l		%fpsr,%d0		# save FPSR
@@ -13318,16 +13318,16 @@ fint_inf_m:
 #	d0 = round precision/mode					#
 #									#
 # OUTPUT **************************************************************	#
-# 	fp0 = result							#
+#	fp0 = result							#
 #									#
 # ALGORITHM ***********************************************************	#
 #	Separate according to operand type. Unnorms don't pass through	#
-# here. For norms, load the rounding mode/prec, execute a "fintrz", 	#
+# here. For norms, load the rounding mode/prec, execute a "fintrz",	#
 # then store the resulting FPSR bits.					#
-# 	For denorms, force the j-bit to a one and do the same as for	#
+#	For denorms, force the j-bit to a one and do the same as for	#
 # norms. Denorms are so low that the answer will either be a zero or a	#
 # one.									#
-# 	For zeroes/infs/NANs, return the same while setting the FPSR	#
+#	For zeroes/infs/NANs, return the same while setting the FPSR	#
 # as appropriate.							#
 #									#
 #########################################################################
@@ -13336,7 +13336,7 @@ fint_inf_m:
 fintrz:
 	mov.b		STAG(%a6),%d1
 	bne.b		fintrz_not_norm		# optimize on non-norm input
-		
+
 #
 # Norm:
 #
@@ -13431,17 +13431,17 @@ fintrz_inf_m:
 #									#
 # ALGORITHM ***********************************************************	#
 #	Handle NANs, infinities, and zeroes as special cases. Divide	#
-# norms into extended, single, and double precision. 			#
-# 	Simply clear sign for extended precision norm. Ext prec denorm	#
+# norms into extended, single, and double precision.			#
+#	Simply clear sign for extended precision norm. Ext prec denorm	#
 # gets an EXOP created for it since it's an underflow.			#
 #	Double and single precision can overflow and underflow. First,	#
 # scale the operand such that the exponent is zero. Perform an "fabs"	#
-# using the correct rnd mode/prec. Check to see if the original 	#
+# using the correct rnd mode/prec. Check to see if the original		#
 # exponent would take an exception. If so, use unf_res() or ovf_res()	#
 # to calculate the default result. Also, create the EXOP for the	#
-# exceptional case. If no exception should occur, insert the correct 	#
+# exceptional case. If no exception should occur, insert the correct	#
 # result exponent and return.						#
-# 	Unnorms don't pass through here.				#
+#	Unnorms don't pass through here.				#
 #									#
 #########################################################################
 
@@ -13461,7 +13461,7 @@ fabs:
 	mov.l		%d0,L_SCR3(%a6)		# store rnd info
 	mov.b		STAG(%a6),%d1
 	bne.w		fabs_not_norm		# optimize on non-norm input
-		
+
 #
 # ABSOLUTE VALUE: norms and denorms ONLY!
 #
@@ -13607,10 +13607,10 @@ fabs_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# set possible 'Z' ccode
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow is enabled. 
+# operand will underflow AND underflow is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fabs_sd_unfl_ena:
@@ -13732,10 +13732,10 @@ fabs_inf:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fcmp(): fp compare op routine					#
+#	fcmp(): fp compare op routine					#
 #									#
 # XREF ****************************************************************	#
-# 	res_qnan() - return QNAN result					#
+#	res_qnan() - return QNAN result					#
 #	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
@@ -13747,7 +13747,7 @@ fabs_inf:
 #	None								#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs and denorms as special cases. For everything else,	#
+#	Handle NANs and denorms as special cases. For everything else,	#
 # just use the actual fcmp instruction to produce the correct condition	#
 # codes.								#
 #									#
@@ -13760,14 +13760,14 @@ fcmp:
 	lsl.b		&0x3,%d1
 	or.b		STAG(%a6),%d1
 	bne.b		fcmp_not_norm		# optimize on non-norm input
-		
+
 #
 # COMPARE FP OPs : NORMs, ZEROs, INFs, and "corrected" DENORMs
 #
 fcmp_norm:
 	fmovm.x		DST(%a1),&0x80		# load dst op
 
-	fcmp.x 		%fp0,SRC(%a0)		# do compare
+	fcmp.x		%fp0,SRC(%a0)		# do compare
 
 	fmov.l		%fpsr,%d0		# save FPSR
 	rol.l		&0x8,%d0		# extract ccode bits
@@ -13788,7 +13788,7 @@ tbl_fcmp_op:
 	short		fcmp_norm	- tbl_fcmp_op # NORM - ZERO
 	short		fcmp_norm	- tbl_fcmp_op # NORM - INF
 	short		fcmp_res_qnan	- tbl_fcmp_op # NORM - QNAN
-	short		fcmp_nrm_dnrm 	- tbl_fcmp_op # NORM - DENORM
+	short		fcmp_nrm_dnrm	- tbl_fcmp_op # NORM - DENORM
 	short		fcmp_res_snan	- tbl_fcmp_op # NORM - SNAN
 	short		tbl_fcmp_op	- tbl_fcmp_op #
 	short		tbl_fcmp_op	- tbl_fcmp_op #
@@ -13850,8 +13850,8 @@ fcmp_res_snan:
 	rts
 
 #
-# DENORMs are a little more difficult. 
-# If you have a 2 DENORMs, then you can just force the j-bit to a one 
+# DENORMs are a little more difficult.
+# If you have a 2 DENORMs, then you can just force the j-bit to a one
 # and use the fcmp_norm routine.
 # If you have a DENORM and an INF or ZERO, just force the DENORM's j-bit to a one
 # and use the fcmp_norm routine.
@@ -13892,7 +13892,7 @@ fcmp_dnrm_sd:
 	mov.l		SRC_LO(%a0),FP_SCR0_LO(%a6)
 	lea		FP_SCR1(%a6),%a1
 	lea		FP_SCR0(%a6),%a0
-	bra.w		fcmp_norm	
+	bra.w		fcmp_norm
 
 fcmp_nrm_dnrm:
 	mov.b		SRC_EX(%a0),%d0		# determine if like signs
@@ -13924,15 +13924,15 @@ fcmp_dnrm_nrm_m:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fsglmul(): emulates the fsglmul instruction			#
+#	fsglmul(): emulates the fsglmul instruction			#
 #									#
 # XREF ****************************************************************	#
 #	scale_to_zero_src() - scale src exponent to zero		#
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res4() - return default underflow result for sglop		#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -13950,7 +13950,7 @@ fcmp_dnrm_nrm_m:
 # instruction won't cause an exception. Use the regular fsglmul to	#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -13982,11 +13982,11 @@ fsglmul_norm:
 
 	add.l		(%sp)+,%d0		# SCALE_FACTOR = scale1 + scale2
 
-	cmpi.l		%d0,&0x3fff-0x7ffe 	# would result ovfl?
+	cmpi.l		%d0,&0x3fff-0x7ffe	# would result ovfl?
 	beq.w		fsglmul_may_ovfl	# result may rnd to overflow
 	blt.w		fsglmul_ovfl		# result will overflow
 
-	cmpi.l		%d0,&0x3fff+0x0001 	# would result unfl?
+	cmpi.l		%d0,&0x3fff+0x0001	# would result unfl?
 	beq.w		fsglmul_may_unfl	# result may rnd to no unfl
 	bgt.w		fsglmul_unfl		# result will underflow
 
@@ -14073,7 +14073,7 @@ fsglmul_may_ovfl:
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
 	fsglmul.x	FP_SCR0(%a6),%fp0	# execute sgl multiply
-	
+
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -14082,7 +14082,7 @@ fsglmul_may_ovfl:
 	fabs.x		%fp0,%fp1		# make a copy of result
 	fcmp.b		%fp1,&0x2		# is |result| >= 2.b?
 	fbge.w		fsglmul_ovfl_tst	# yes; overflow has occurred
-	
+
 # no, it didn't overflow; we have correct result
 	bra.w		fsglmul_normal_exit
 
@@ -14116,7 +14116,7 @@ fsglmul_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fsglmul_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -14124,7 +14124,7 @@ fsglmul_unfl_ena:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply	
+	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -14149,7 +14149,7 @@ fsglmul_may_unfl:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsglmul.x	FP_SCR0(%a6),%fp0	# execute sgl multiply	
+	fsglmul.x	FP_SCR0(%a6),%fp0	# execute sgl multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -14173,11 +14173,11 @@ fsglmul_may_unfl:
 	mov.l		L_SCR3(%a6),%d1
 	andi.b		&0xc0,%d1		# keep rnd prec
 	ori.b		&rz_mode*0x10,%d1	# insert RZ
-	
+
 	fmov.l		%d1,%fpcr		# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply	
+	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fabs.x		%fp1			# make absolute value
@@ -14265,15 +14265,15 @@ fsglmul_inf_dst:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fsgldiv(): emulates the fsgldiv instruction			#
+#	fsgldiv(): emulates the fsgldiv instruction			#
 #									#
 # XREF ****************************************************************	#
 #	scale_to_zero_src() - scale src exponent to zero		#
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res4() - return default underflow result for sglop		#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -14291,7 +14291,7 @@ fsglmul_inf_dst:
 # instruction won't cause an exception. Use the regular fsgldiv to	#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -14306,7 +14306,7 @@ fsgldiv:
 	or.b		STAG(%a6),%d1		# combine src tags
 
 	bne.w		fsgldiv_not_norm	# optimize on non-norm input
-		
+
 #
 # DIVIDE: NORMs and DENORMs ONLY!
 #
@@ -14333,7 +14333,7 @@ fsgldiv_norm:
 	cmpi.l		%d0,&0x3fff-0x7ffe
 	ble.w		fsgldiv_may_ovfl
 
-	cmpi.l		%d0,&0x3fff-0x0000 	# will result underflow?
+	cmpi.l		%d0,&0x3fff-0x0000	# will result underflow?
 	beq.w		fsgldiv_may_unfl	# maybe
 	bgt.w		fsgldiv_unfl		# yes; go handle underflow
 
@@ -14393,7 +14393,7 @@ fsgldiv_ovfl_tst:
 	bne.b		fsgldiv_ovfl_ena	# yes
 
 fsgldiv_ovfl_dis:
-	btst		&neg_bit,FPSR_CC(%a6) 	# is result negative
+	btst		&neg_bit,FPSR_CC(%a6)	# is result negative
 	sne		%d1			# set sign param accordingly
 	mov.l		L_SCR3(%a6),%d0		# pass prec:rnd
 	andi.b		&0x30,%d0		# kill precision
@@ -14449,7 +14449,7 @@ fsgldiv_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fsgldiv_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -14500,8 +14500,8 @@ fsgldiv_may_unfl:
 #
 # we still don't know if underflow occurred. result is ~ equal to 1. but,
 # we don't know if the result was an underflow that rounded up to a 1
-# or a normalized number that rounded down to a 1. so, redo the entire 
-# operation using RZ as the rounding mode to see what the pre-rounded 
+# or a normalized number that rounded down to a 1. so, redo the entire
+# operation using RZ as the rounding mode to see what the pre-rounded
 # result is. this case should be relatively rare.
 #
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op into %fp1
@@ -14605,25 +14605,25 @@ fsgldiv_inf_dst:
 #	fdadd(): emulates the fdadd instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	addsub_scaler2() - scale the operands so they won't take exc	#
+#	addsub_scaler2() - scale the operands so they won't take exc	#
 #	ovf_res() - return default overflow result			#
 #	unf_res() - return default underflow result			#
 #	res_qnan() - set QNAN result					#
-# 	res_snan() - set SNAN result					#
+#	res_snan() - set SNAN result					#
 #	res_operr() - set OPERR result					#
 #	scale_to_zero_src() - set src operand exponent equal to zero	#
 #	scale_to_zero_dst() - set dst operand exponent equal to zero	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
-# 	a1 = pointer to extended precision destination operand		#
+#	a1 = pointer to extended precision destination operand		#
 #									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP (if exception occurred)				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs, infinities, and zeroes as special cases. Divide	#
+#	Handle NANs, infinities, and zeroes as special cases. Divide	#
 # norms into extended, single, and double precision.			#
 #	Do addition after scaling exponents such that exception won't	#
 # occur. Then, check result exponent to see if exception would have	#
@@ -14837,7 +14837,7 @@ fadd_unfl_ena_sd:
 
 #
 # result is equal to the smallest normalized number in the selected precision
-# if the precision is extended, this result could not have come from an 
+# if the precision is extended, this result could not have come from an
 # underflow that rounded up.
 #
 fadd_may_unfl:
@@ -14859,7 +14859,7 @@ fadd_may_unfl:
 # ok, so now the result has a exponent equal to the smallest normalized
 # exponent for the selected precision. also, the mantissa is equal to
 # 0x8000000000000000 and this mantissa is the result of rounding non-zero
-# g,r,s. 
+# g,r,s.
 # now, we must determine whether the pre-rounded result was an underflow
 # rounded "up" or a normalized number rounded "down".
 # so, we do this be re-executing the add using RZ as the rounding mode and
@@ -14970,7 +14970,7 @@ fadd_zero_2:
 	fmov.s		&0x00000000,%fp0	# return +ZERO
 	mov.b		&z_bmask,FPSR_CC(%a6)	# set Z
 	rts
-	
+
 #
 # the ZEROes have opposite signs:
 # - therefore, we return +ZERO if the rounding modes are RN,RZ, or RP.
@@ -15024,7 +15024,7 @@ fadd_inf_2:
 	eor.b		%d1,%d0
 	bmi.l		res_operr		# weed out (-INF)+(+INF)
 
-# ok, so it's not an OPERR. but, we do have to remember to return the 
+# ok, so it's not an OPERR. but, we do have to remember to return the
 # src INF since that's where the 881/882 gets the j-bit from...
 
 #
@@ -15058,25 +15058,25 @@ fadd_inf_done:
 #	fdsub(): emulates the fdsub instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	addsub_scaler2() - scale the operands so they won't take exc	#
+#	addsub_scaler2() - scale the operands so they won't take exc	#
 #	ovf_res() - return default overflow result			#
 #	unf_res() - return default underflow result			#
 #	res_qnan() - set QNAN result					#
-# 	res_snan() - set SNAN result					#
+#	res_snan() - set SNAN result					#
 #	res_operr() - set OPERR result					#
 #	scale_to_zero_src() - set src operand exponent equal to zero	#
 #	scale_to_zero_dst() - set dst operand exponent equal to zero	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
-# 	a1 = pointer to extended precision destination operand		#
+#	a1 = pointer to extended precision destination operand		#
 #									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP (if exception occurred)				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs, infinities, and zeroes as special cases. Divide	#
+#	Handle NANs, infinities, and zeroes as special cases. Divide	#
 # norms into extended, single, and double precision.			#
 #	Do subtraction after scaling exponents such that exception won't#
 # occur. Then, check result exponent to see if exception would have	#
@@ -15226,7 +15226,7 @@ fsub_unfl:
 	add.l		&0xc,%sp
 
 	fmovm.x		FP_SCR1(%a6),&0x80	# load dst op
-	
+
 	fmov.l		&rz_mode*0x10,%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
@@ -15290,7 +15290,7 @@ fsub_unfl_ena_sd:
 
 #
 # result is equal to the smallest normalized number in the selected precision
-# if the precision is extended, this result could not have come from an 
+# if the precision is extended, this result could not have come from an
 # underflow that rounded up.
 #
 fsub_may_unfl:
@@ -15312,7 +15312,7 @@ fsub_may_unfl:
 # ok, so now the result has a exponent equal to the smallest normalized
 # exponent for the selected precision. also, the mantissa is equal to
 # 0x8000000000000000 and this mantissa is the result of rounding non-zero
-# g,r,s. 
+# g,r,s.
 # now, we must determine whether the pre-rounded result was an underflow
 # rounded "up" or a normalized number rounded "down".
 # so, we do this be re-executing the add using RZ as the rounding mode and
@@ -15468,7 +15468,7 @@ fsub_zero_src:
 
 #
 # both operands are INFs. an OPERR will result if the INFs have the
-# same signs. else, 
+# same signs. else,
 #
 fsub_inf_2:
 	mov.b		SRC_EX(%a0),%d0		# exclusive or the signs
@@ -15483,7 +15483,7 @@ fsub_inf_src:
 	fmovm.x		SRC(%a0),&0x80		# return src INF
 	fneg.x		%fp0			# invert sign
 	fbge.w		fsub_inf_done		# sign is now positive
-	mov.b		&neg_bmask+inf_bmask,FPSR_CC(%a6) # set INF/NEG	
+	mov.b		&neg_bmask+inf_bmask,FPSR_CC(%a6) # set INF/NEG
 	rts
 
 fsub_inf_dst:
@@ -15499,7 +15499,7 @@ fsub_inf_done:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fsqrt(): emulates the fsqrt instruction				#
+#	fsqrt(): emulates the fsqrt instruction				#
 #	fssqrt(): emulates the fssqrt instruction			#
 #	fdsqrt(): emulates the fdsqrt instruction			#
 #									#
@@ -15507,8 +15507,8 @@ fsub_inf_done:
 #	scale_sqrt() - scale the source operand				#
 #	unf_res() - return default underflow result			#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan_1op() - return QNAN result				#
-# 	res_snan_1op() - return SNAN result				#
+#	res_qnan_1op() - return QNAN result				#
+#	res_snan_1op() - return SNAN result				#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -15525,7 +15525,7 @@ fsub_inf_done:
 # instruction won't cause an exception. Use the regular fsqrt to	#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -15547,7 +15547,7 @@ fsqrt:
 	clr.w		%d1
 	mov.b		STAG(%a6),%d1
 	bne.w		fsqrt_not_norm		# optimize on non-norm input
-		
+
 #
 # SQUARE ROOT: norms and denorms ONLY!
 #
@@ -15669,7 +15669,7 @@ fsqrt_sd_unfl:
 	fmov.l		&rz_mode*0x10,%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsqrt.x 	FP_SCR0(%a6),%fp0	# execute square root
+	fsqrt.x		FP_SCR0(%a6),%fp0	# execute square root
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -15689,10 +15689,10 @@ fsqrt_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# set possible 'Z' ccode
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow is enabled. 
+# operand will underflow AND underflow is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fsqrt_sd_unfl_ena:
@@ -15808,15 +15808,15 @@ fsqrt_not_norm:
 	bra.l		res_qnan_1op
 
 #
-# 	fsqrt(+0) = +0
-# 	fsqrt(-0) = -0
+#	fsqrt(+0) = +0
+#	fsqrt(-0) = -0
 #	fsqrt(+INF) = +INF
-# 	fsqrt(-INF) = OPERR
+#	fsqrt(-INF) = OPERR
 #
 fsqrt_zero:
 	tst.b		SRC_EX(%a0)		# is ZERO positive or negative?
 	bmi.b		fsqrt_zero_m		# negative
-fsqrt_zero_p:	
+fsqrt_zero_p:
 	fmov.s		&0x00000000,%fp0	# return +ZERO
 	mov.b		&z_bmask,FPSR_CC(%a6)	# set 'Z' ccode bit
 	rts
@@ -15846,14 +15846,14 @@ fsqrt_inf_p:
 # INPUT ***************************************************************	#
 #	FP_SRC(a6) = fp op1(src)					#
 #	FP_DST(a6) = fp op2(dst)					#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SRC(a6) = fp op1 scaled(src)					#
 #	FP_DST(a6) = fp op2 scaled(dst)					#
 #	d0         = scale amount					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	If the DST exponent is > the SRC exponent, set the DST exponent	#
+#	If the DST exponent is > the SRC exponent, set the DST exponent	#
 # equal to 0x3fff and scale the SRC exponent by the value that the	#
 # DST exponent was scaled by. If the SRC exponent is greater or equal,	#
 # do the opposite. Return this scale factor in d0.			#
@@ -15916,7 +15916,7 @@ quick_scale12:
 	andi.w		&0x8000,FP_SCR0_EX(%a6)	# zero src exponent
 	bset		&0x0,1+FP_SCR0_EX(%a6)	# set exp = 1
 
-	mov.l		(%sp)+,%d0		# return SCALE factor	
+	mov.l		(%sp)+,%d0		# return SCALE factor
 	rts
 
 # src exp is >= dst exp; scale src to exp = 0x3fff
@@ -15952,7 +15952,7 @@ quick_scale22:
 	andi.w		&0x8000,FP_SCR1_EX(%a6)	# zero dst exponent
 	bset		&0x0,1+FP_SCR1_EX(%a6)	# set exp = 1
 
-	mov.l		(%sp)+,%d0		# return SCALE factor	
+	mov.l		(%sp)+,%d0		# return SCALE factor
 	rts
 
 ##########################################################################
@@ -15967,14 +15967,14 @@ quick_scale22:
 #									#
 # INPUT ***************************************************************	#
 #	FP_SCR0(a6) = extended precision operand to be scaled		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SCR0(a6) = scaled extended precision operand			#
 #	d0	    = scale value					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Set the exponent of the input operand to 0x3fff. Save the value	#
-# of the difference between the original and new exponent. Then, 	#
+#	Set the exponent of the input operand to 0x3fff. Save the value	#
+# of the difference between the original and new exponent. Then,	#
 # normalize the operand if it was a DENORM. Add this normalization	#
 # value to the previous value. Return the result.			#
 #									#
@@ -16020,17 +16020,17 @@ stzs_denorm:
 #									#
 # INPUT ***************************************************************	#
 #	FP_SCR0(a6) = extended precision operand to be scaled		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SCR0(a6) = scaled extended precision operand			#
 #	d0	    = scale value					#
 #									#
 # ALGORITHM ***********************************************************	#
 #	If the input operand is a DENORM, normalize it.			#
-# 	If the exponent of the input operand is even, set the exponent	#
-# to 0x3ffe and return a scale factor of "(exp-0x3ffe)/2". If the 	#
+#	If the exponent of the input operand is even, set the exponent	#
+# to 0x3ffe and return a scale factor of "(exp-0x3ffe)/2". If the	#
 # exponent of the input operand is off, set the exponent to ox3fff and	#
-# return a scale factor of "(exp-0x3fff)/2". 				#
+# return a scale factor of "(exp-0x3fff)/2".				#
 #									#
 #########################################################################
 
@@ -16094,14 +16094,14 @@ ss_denorm_even:
 #									#
 # INPUT ***************************************************************	#
 #	FP_SCR1(a6) = extended precision operand to be scaled		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SCR1(a6) = scaled extended precision operand			#
 #	d0	    = scale value					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Set the exponent of the input operand to 0x3fff. Save the value	#
-# of the difference between the original and new exponent. Then, 	#
+#	Set the exponent of the input operand to 0x3fff. Save the value	#
+# of the difference between the original and new exponent. Then,	#
 # normalize the operand if it was a DENORM. Add this normalization	#
 # value to the previous value. Return the result.			#
 #									#
@@ -16149,21 +16149,21 @@ stzd_denorm:
 # INPUT ***************************************************************	#
 #	FP_SRC(a6) = pointer to extended precision src operand		#
 #	FP_DST(a6) = pointer to extended precision dst operand		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	If either operand (but not both operands) of an operation is a	#
+#	If either operand (but not both operands) of an operation is a	#
 # nonsignalling NAN, then that NAN is returned as the result. If both	#
-# operands are nonsignalling NANs, then the destination operand 	#
+# operands are nonsignalling NANs, then the destination operand		#
 # nonsignalling NAN is returned as the result.				#
-# 	If either operand to an operation is a signalling NAN (SNAN),	#
+#	If either operand to an operation is a signalling NAN (SNAN),	#
 # then, the SNAN bit is set in the FPSR EXC byte. If the SNAN trap	#
-# enable bit is set in the FPCR, then the trap is taken and the 	#
+# enable bit is set in the FPCR, then the trap is taken and the		#
 # destination is not modified. If the SNAN trap enable bit is not set,	#
-# then the SNAN is converted to a nonsignalling NAN (by setting the 	#
-# SNAN bit in the operand to one), and the operation continues as 	#
+# then the SNAN is converted to a nonsignalling NAN (by setting the	#
+# SNAN bit in the operand to one), and the operation continues as	#
 # described in the preceding paragraph, for nonsignalling NANs.		#
 #	Make sure the appropriate FPSR bits are set before exiting.	#
 #									#
@@ -16202,7 +16202,7 @@ dst_qnan2:
 	lea		FP_DST(%a6), %a0
 	cmp.b		STAG(%a6), &SNAN
 	bne		nan_done
-	or.l		&aiop_mask+snan_mask, USER_FPSR(%a6)	
+	or.l		&aiop_mask+snan_mask, USER_FPSR(%a6)
 nan_done:
 	or.l		&nan_mask, USER_FPSR(%a6)
 nan_comp:
@@ -16215,14 +16215,14 @@ nan_not_neg:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	res_operr(): return default result during operand error		#
+#	res_operr(): return default result during operand error		#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default operand error result				#
 #									#
@@ -16230,8 +16230,8 @@ nan_not_neg:
 #	An nonsignalling NAN is returned as the default result when	#
 # an operand error occurs for the following cases:			#
 #									#
-# 	Multiply: (Infinity x Zero)					#
-# 	Divide  : (Zero / Zero) || (Infinity / Infinity)		#
+#	Multiply: (Infinity x Zero)					#
+#	Divide  : (Zero / Zero) || (Infinity / Infinity)		#
 #									#
 #########################################################################
 
@@ -16241,7 +16241,7 @@ res_operr:
 	fmovm.x		nan_return(%pc), &0x80
 	rts
 
-nan_return:	
+nan_return:
 	long		0x7fff0000, 0xffffffff, 0xffffffff
 
 #########################################################################
@@ -16268,7 +16268,7 @@ nan_return:
 # or false.								#
 #	If a BSUN exception should be indicated, the BSUN and ABSUN	#
 # bits are set in the stacked FPSR. If the BSUN exception is enabled,	#
-# the fbsun_flg is set in the SPCOND_FLG location on the stack. If an 	#
+# the fbsun_flg is set in the SPCOND_FLG location on the stack. If an	#
 # enabled BSUN should not be flagged and the predicate is true, then	#
 # Dn is fetched and decremented by one. If Dn is not equal to -1, add	#
 # the displacement value to the stacked PC so that when an "rte" is	#
@@ -16286,7 +16286,7 @@ _fdbcc:
 	ror.l		&0x8,%d1		# rotate to top byte
 	fmov.l		%d1,%fpsr		# insert into FPSR
 
-	mov.w		(tbl_fdbcc.b,%pc,%d0.w*2),%d1 # load table 
+	mov.w		(tbl_fdbcc.b,%pc,%d0.w*2),%d1 # load table
 	jmp		(tbl_fdbcc.b,%pc,%d1.w) # jump to fdbcc routine
 
 tbl_fdbcc:
@@ -16327,7 +16327,7 @@ tbl_fdbcc:
 #									#
 # IEEE Nonaware tests							#
 #									#
-# For the IEEE nonaware tests, only the false branch changes the 	#
+# For the IEEE nonaware tests, only the false branch changes the	#
 # counter. However, the true branch may set bsun so we check to see	#
 # if the NAN bit is set, in which case BSUN and AIOP will be set.	#
 #									#
@@ -16376,7 +16376,7 @@ fdbcc_gt:
 	beq.w		fdbcc_false		# no;go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 	bra.w		fdbcc_false		# no; go handle counter
 fdbcc_gt_yes:
 	rts					# do nothing
@@ -16384,7 +16384,7 @@ fdbcc_gt_yes:
 #
 # not greater than:
 #
-#	NANvZvN	
+#	NANvZvN
 #
 fdbcc_ngt:
 	fbngt.w		fdbcc_ngt_yes		# not greater than?
@@ -16395,7 +16395,7 @@ fdbcc_ngt_yes:
 	beq.b		fdbcc_ngt_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 fdbcc_ngt_done:
 	rts					# no; do nothing
 
@@ -16411,14 +16411,14 @@ fdbcc_ge_no:
 	beq.w		fdbcc_false		# no;go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 	bra.w		fdbcc_false		# no; go handle counter
 fdbcc_ge_yes:
 	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set in cc?
 	beq.b		fdbcc_ge_yes_done	# no;go do nothing
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 fdbcc_ge_yes_done:
 	rts					# do nothing
 
@@ -16436,7 +16436,7 @@ fdbcc_nge_yes:
 	beq.b		fdbcc_nge_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 fdbcc_nge_done:
 	rts					# no; do nothing
 
@@ -16452,7 +16452,7 @@ fdbcc_lt_no:
 	beq.w		fdbcc_false		# no; go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 	bra.w		fdbcc_false		# no; go handle counter
 fdbcc_lt_yes:
 	rts					# do nothing
@@ -16471,7 +16471,7 @@ fdbcc_nlt_yes:
 	beq.b		fdbcc_nlt_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 fdbcc_nlt_done:
 	rts					# no; do nothing
 
@@ -16487,14 +16487,14 @@ fdbcc_le_no:
 	beq.w		fdbcc_false		# no; go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 	bra.w		fdbcc_false		# no; go handle counter
 fdbcc_le_yes:
 	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set in cc?
 	beq.b		fdbcc_le_yes_done	# no; go do nothing
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
-	bne.w		fdbcc_bsun		# yes; we have an exception	
+	bne.w		fdbcc_bsun		# yes; we have an exception
 fdbcc_le_yes_done:
 	rts					# do nothing
 
@@ -16611,7 +16611,7 @@ fdbcc_t:					# no bsun possible
 #	False
 #
 fdbcc_sf:
-	btst		&nan_bit, FPSR_CC(%a6) 	# is NAN set?
+	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set?
 	beq.w		fdbcc_false		# no;go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
@@ -16624,7 +16624,7 @@ fdbcc_sf:
 #	True
 #
 fdbcc_st:
-	btst		&nan_bit, FPSR_CC(%a6) 	# is NAN set?
+	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set?
 	beq.b		fdbcc_st_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
@@ -16640,14 +16640,14 @@ fdbcc_st_done:
 fdbcc_seq:
 	fbseq.w		fdbcc_seq_yes		# signalling equal?
 fdbcc_seq_no:
-	btst		&nan_bit, FPSR_CC(%a6) 	# is NAN set?
+	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set?
 	beq.w		fdbcc_false		# no;go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
 	bne.w		fdbcc_bsun		# yes; we have an exception
 	bra.w		fdbcc_false		# go handle counter
 fdbcc_seq_yes:
-	btst		&nan_bit, FPSR_CC(%a6) 	# is NAN set?
+	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set?
 	beq.b		fdbcc_seq_yes_done	# no;go do nothing
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
@@ -16663,14 +16663,14 @@ fdbcc_seq_yes_done:
 fdbcc_sneq:
 	fbsneq.w	fdbcc_sneq_yes		# signalling not equal?
 fdbcc_sneq_no:
-	btst		&nan_bit, FPSR_CC(%a6) 	# is NAN set?
+	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set?
 	beq.w		fdbcc_false		# no;go handle counter
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
 	bne.w		fdbcc_bsun		# yes; we have an exception
 	bra.w		fdbcc_false		# go handle counter
 fdbcc_sneq_yes:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fdbcc_sneq_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # is BSUN enabled?
@@ -16684,7 +16684,7 @@ fdbcc_sneq_done:
 #									#
 # For the IEEE aware tests, action is only taken if the result is false.#
 # Therefore, the opposite branch type is used to jump to the decrement	#
-# routine. 								#
+# routine.								#
 # The BSUN exception will not be set for any of these tests.		#
 #									#
 #########################################################################
@@ -16845,7 +16845,7 @@ fdbcc_un_yes:
 #	pc += sign_ext(16-bit displacement)
 #
 fdbcc_false:
-	mov.b		1+EXC_OPWORD(%a6), %d1	# fetch lo opword 
+	mov.b		1+EXC_OPWORD(%a6), %d1	# fetch lo opword
 	andi.w		&0x7, %d1		# extract count register
 
 	bsr.l		fetch_dreg		# fetch count value
@@ -16856,7 +16856,7 @@ fdbcc_false:
 	bsr.l		store_dreg_l		# store new count value
 
 	cmpi.w		%d0, &-0x1		# is (Dn == -1)?
-	bne.b		fdbcc_false_cont	# no; 
+	bne.b		fdbcc_false_cont	# no;
 	rts
 
 fdbcc_false_cont:
@@ -16897,7 +16897,7 @@ fdbcc_bsun:
 # or false.								#
 #	If a BSUN exception should be indicated, the BSUN and ABSUN	#
 # bits are set in the stacked FPSR. If the BSUN exception is enabled,	#
-# the fbsun_flg is set in the SPCOND_FLG location on the stack. If an 	#
+# the fbsun_flg is set in the SPCOND_FLG location on the stack. If an	#
 # enabled BSUN should not be flagged and the predicate is true, then	#
 # the ftrapcc_flg is set in the SPCOND_FLG location. These special	#
 # flags indicate to the calling routine to emulate the exceptional	#
@@ -16914,7 +16914,7 @@ _ftrapcc:
 	ror.l		&0x8,%d1		# rotate to top byte
 	fmov.l		%d1,%fpsr		# insert into FPSR
 
-	mov.w		(tbl_ftrapcc.b,%pc,%d0.w*2), %d1 # load table 
+	mov.w		(tbl_ftrapcc.b,%pc,%d0.w*2), %d1 # load table
 	jmp		(tbl_ftrapcc.b,%pc,%d1.w) # jump to ftrapcc routine
 
 tbl_ftrapcc:
@@ -17006,7 +17006,7 @@ ftrapcc_gt_done:
 #
 # not greater than:
 #
-#	NANvZvN	
+#	NANvZvN
 #
 ftrapcc_ngt:
 	fbngt.w		ftrapcc_ngt_yes		# not greater than?
@@ -17226,7 +17226,7 @@ ftrapcc_t:
 #	False
 #
 ftrapcc_sf:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.b		ftrapcc_sf_done		# no; go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # was BSUN set?
@@ -17240,7 +17240,7 @@ ftrapcc_sf_done:
 #	True
 #
 ftrapcc_st:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		ftrapcc_trap		# no; go take trap
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # was BSUN set?
@@ -17255,7 +17255,7 @@ ftrapcc_st:
 ftrapcc_seq:
 	fbseq.w		ftrapcc_seq_yes		# signalling equal?
 ftrapcc_seq_no:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		ftrapcc_seq_done	# no; go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # was BSUN set?
@@ -17263,7 +17263,7 @@ ftrapcc_seq_no:
 ftrapcc_seq_done:
 	rts					# no; do nothing
 ftrapcc_seq_yes:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		ftrapcc_trap		# no; go take trap
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # was BSUN set?
@@ -17278,7 +17278,7 @@ ftrapcc_seq_yes:
 ftrapcc_sneq:
 	fbsneq.w	ftrapcc_sneq_yes	# signalling equal?
 ftrapcc_sneq_no:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		ftrapcc_sneq_no_done	# no; go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # was BSUN set?
@@ -17286,7 +17286,7 @@ ftrapcc_sneq_no:
 ftrapcc_sneq_no_done:
 	rts					# do nothing
 ftrapcc_sneq_yes:
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		ftrapcc_trap		# no; go take trap
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	btst		&bsun_bit, FPCR_ENABLE(%a6) # was BSUN set?
@@ -17469,7 +17469,7 @@ ftrapcc_bsun:
 # or false.								#
 #	If a BSUN exception should be indicated, the BSUN and ABSUN	#
 # bits are set in the stacked FPSR. If the BSUN exception is enabled,	#
-# the fbsun_flg is set in the SPCOND_FLG location on the stack. If an 	#
+# the fbsun_flg is set in the SPCOND_FLG location on the stack. If an	#
 # enabled BSUN should not be flagged and the predicate is true, then	#
 # the result is stored to the data register file or memory		#
 #									#
@@ -17484,8 +17484,8 @@ _fscc:
 	ror.l		&0x8,%d1		# rotate to top byte
 	fmov.l		%d1,%fpsr		# insert into FPSR
 
-	mov.w		(tbl_fscc.b,%pc,%d0.w*2),%d1 # load table 
-	jmp		(tbl_fscc.b,%pc,%d1.w) 	# jump to fscc routine
+	mov.w		(tbl_fscc.b,%pc,%d0.w*2),%d1 # load table
+	jmp		(tbl_fscc.b,%pc,%d1.w)	# jump to fscc routine
 
 tbl_fscc:
 	short		fscc_f		-	tbl_fscc	# 00
@@ -17585,7 +17585,7 @@ fscc_gt_yes:
 #
 # not greater than:
 #
-#	NANvZvN	
+#	NANvZvN
 #
 fscc_ngt:
 	fbngt.w		fscc_ngt_yes		# not greater than?
@@ -17613,7 +17613,7 @@ fscc_ge_no:
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
 fscc_ge_yes:
-	st		%d0			# set true	
+	st		%d0			# set true
 	btst		&nan_bit, FPSR_CC(%a6)	# is NAN set in cc?
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
@@ -17806,7 +17806,7 @@ fscc_t:
 #
 fscc_sf:
 	clr.b		%d0			# set false
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
@@ -17818,7 +17818,7 @@ fscc_sf:
 #
 fscc_st:
 	st		%d0			# set false
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
@@ -17832,13 +17832,13 @@ fscc_seq:
 	fbseq.w		fscc_seq_yes		# signalling equal?
 fscc_seq_no:
 	clr.b		%d0			# set false
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
 fscc_seq_yes:
 	st		%d0			# set true
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
@@ -17852,13 +17852,13 @@ fscc_sneq:
 	fbsneq.w	fscc_sneq_yes		# signalling equal?
 fscc_sneq_no:
 	clr.b		%d0			# set false
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
 fscc_sneq_yes:
 	st		%d0			# set true
-	btst		&nan_bit, FPSR_CC(%a6) 	# set BSUN exc bit
+	btst		&nan_bit, FPSR_CC(%a6)	# set BSUN exc bit
 	beq.w		fscc_done		# no;go finish
 	ori.l		&bsun_mask+aiop_mask, USER_FPSR(%a6) # set BSUN exc bit
 	bra.w		fscc_chk_bsun		# go finish
@@ -18044,7 +18044,7 @@ fscc_un_yes:
 #######################################################################
 
 #
-# the bsun exception bit was set. now, check to see is BSUN 
+# the bsun exception bit was set. now, check to see is BSUN
 # is enabled. if so, don't store result and correct stack frame
 # for a bsun exception.
 #
@@ -18061,7 +18061,7 @@ fscc_chk_bsun:
 fscc_done:
 	mov.l		%d0,%a0			# save result for a moment
 
-	mov.b		1+EXC_OPWORD(%a6),%d1	# fetch lo opword 
+	mov.b		1+EXC_OPWORD(%a6),%d1	# fetch lo opword
 	mov.l		%d1,%d0			# make a copy
 	andi.b		&0x38,%d1		# extract src mode
 
@@ -18075,7 +18075,7 @@ fscc_done:
 
 #
 # the stacked <ea> is correct with the exception of:
-# 	-> Dn : <ea> is garbage
+#	-> Dn : <ea> is garbage
 #
 # if the addressing mode is post-increment or pre-decrement,
 # then the address registers have not been updated.
@@ -18088,7 +18088,7 @@ fscc_mem_op:
 
 	mov.l		%a0,%d0			# pass result in d0
 	mov.l		EXC_EA(%a6),%a0		# fetch <ea>
-	bsr.l		_dmem_write_byte	# write result byte	
+	bsr.l		_dmem_write_byte	# write result byte
 
 	tst.l		%d1			# did dstore fail?
 	bne.w		fscc_err		# yes
@@ -18159,7 +18159,7 @@ fscc_err:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If instr is "fmovm Dn,-(A7)" from supervisor mode,		#
 #		d0 = size of dump					#
@@ -18181,25 +18181,25 @@ fscc_err:
 #	The data register is determined and its value loaded to get the	#
 # string of FP registers affected. This value is used as an index into	#
 # a lookup table such that we can determine the number of bytes		#
-# involved. 								#
+# involved.								#
 #	If the instruction is "fmovm.x <ea>,Dn", a _mem_read() is used	#
 # to read in all FP values. Again, _mem_read() may fail and require a	#
-# special exit. 							#
+# special exit.								#
 #	If the instruction is "fmovm.x DN,<ea>", a _mem_write() is used	#
 # to write all FP values. _mem_write() may also fail.			#
-# 	If the instruction is "fmovm.x DN,-(a7)" from supervisor mode,	#
+#	If the instruction is "fmovm.x DN,-(a7)" from supervisor mode,	#
 # then we return the size of the dump and the string to the caller	#
 # so that the move can occur outside of this routine. This special	#
 # case is required so that moves to the system stack are handled	#
 # correctly.								#
 #									#
 # DYNAMIC:								#
-# 	fmovm.x	dn, <ea>						#
-# 	fmovm.x	<ea>, dn						#
+#	fmovm.x	dn, <ea>						#
+#	fmovm.x	<ea>, dn						#
 #									#
 #	      <WORD 1>		      <WORD2>				#
 #	1111 0010 00 |<ea>|	11@& 1000 0$$$ 0000			#
-#					  				#
+#									#
 #	& = (0): predecrement addressing mode				#
 #	    (1): postincrement or control addressing mode		#
 #	@ = (0): move listed regs from memory to the FPU		#
@@ -18468,12 +18468,12 @@ tbl_fmovm_size:
 	byte	0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
 	byte	0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
 	byte	0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
-	byte	0x3c,0x48,0x48,0x54,0x48,0x54,0x54,0x60	
+	byte	0x3c,0x48,0x48,0x54,0x48,0x54,0x54,0x60
 
 #
 # table to convert a pre-decrement bit string into a post-increment
 # or control bit string.
-# ex: 	0x00	==>	0x00
+# ex:	0x00	==>	0x00
 #	0x01	==>	0x80
 #	0x02	==>	0x40
 #		.
@@ -18555,59 +18555,59 @@ tbl_fea_mode:
 	short		tbl_fea_mode	-	tbl_fea_mode
 	short		tbl_fea_mode	-	tbl_fea_mode
 
-	short		faddr_ind_a0	- 	tbl_fea_mode
-	short		faddr_ind_a1	- 	tbl_fea_mode
-	short		faddr_ind_a2	- 	tbl_fea_mode
-	short		faddr_ind_a3 	- 	tbl_fea_mode
-	short		faddr_ind_a4 	- 	tbl_fea_mode
-	short		faddr_ind_a5 	- 	tbl_fea_mode
-	short		faddr_ind_a6 	- 	tbl_fea_mode
-	short		faddr_ind_a7 	- 	tbl_fea_mode
-
-	short		faddr_ind_p_a0	- 	tbl_fea_mode
-	short		faddr_ind_p_a1 	- 	tbl_fea_mode
-	short		faddr_ind_p_a2 	- 	tbl_fea_mode
-	short		faddr_ind_p_a3 	- 	tbl_fea_mode
-	short		faddr_ind_p_a4 	- 	tbl_fea_mode
-	short		faddr_ind_p_a5 	- 	tbl_fea_mode
-	short		faddr_ind_p_a6 	- 	tbl_fea_mode
-	short		faddr_ind_p_a7 	- 	tbl_fea_mode
-
-	short		faddr_ind_m_a0 	- 	tbl_fea_mode
-	short		faddr_ind_m_a1 	- 	tbl_fea_mode
-	short		faddr_ind_m_a2 	- 	tbl_fea_mode
-	short		faddr_ind_m_a3 	- 	tbl_fea_mode
-	short		faddr_ind_m_a4 	- 	tbl_fea_mode
-	short		faddr_ind_m_a5 	- 	tbl_fea_mode
-	short		faddr_ind_m_a6 	- 	tbl_fea_mode
-	short		faddr_ind_m_a7 	- 	tbl_fea_mode
-
-	short		faddr_ind_disp_a0	- 	tbl_fea_mode
-	short		faddr_ind_disp_a1 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a2 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a3 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a4 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a5 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a6 	- 	tbl_fea_mode
+	short		faddr_ind_a0	-	tbl_fea_mode
+	short		faddr_ind_a1	-	tbl_fea_mode
+	short		faddr_ind_a2	-	tbl_fea_mode
+	short		faddr_ind_a3	-	tbl_fea_mode
+	short		faddr_ind_a4	-	tbl_fea_mode
+	short		faddr_ind_a5	-	tbl_fea_mode
+	short		faddr_ind_a6	-	tbl_fea_mode
+	short		faddr_ind_a7	-	tbl_fea_mode
+
+	short		faddr_ind_p_a0	-	tbl_fea_mode
+	short		faddr_ind_p_a1	-	tbl_fea_mode
+	short		faddr_ind_p_a2	-	tbl_fea_mode
+	short		faddr_ind_p_a3	-	tbl_fea_mode
+	short		faddr_ind_p_a4	-	tbl_fea_mode
+	short		faddr_ind_p_a5	-	tbl_fea_mode
+	short		faddr_ind_p_a6	-	tbl_fea_mode
+	short		faddr_ind_p_a7	-	tbl_fea_mode
+
+	short		faddr_ind_m_a0	-	tbl_fea_mode
+	short		faddr_ind_m_a1	-	tbl_fea_mode
+	short		faddr_ind_m_a2	-	tbl_fea_mode
+	short		faddr_ind_m_a3	-	tbl_fea_mode
+	short		faddr_ind_m_a4	-	tbl_fea_mode
+	short		faddr_ind_m_a5	-	tbl_fea_mode
+	short		faddr_ind_m_a6	-	tbl_fea_mode
+	short		faddr_ind_m_a7	-	tbl_fea_mode
+
+	short		faddr_ind_disp_a0	-	tbl_fea_mode
+	short		faddr_ind_disp_a1	-	tbl_fea_mode
+	short		faddr_ind_disp_a2	-	tbl_fea_mode
+	short		faddr_ind_disp_a3	-	tbl_fea_mode
+	short		faddr_ind_disp_a4	-	tbl_fea_mode
+	short		faddr_ind_disp_a5	-	tbl_fea_mode
+	short		faddr_ind_disp_a6	-	tbl_fea_mode
 	short		faddr_ind_disp_a7	-	tbl_fea_mode
 
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-
-	short		fabs_short	- 	tbl_fea_mode
-	short		fabs_long	- 	tbl_fea_mode
-	short		fpc_ind		- 	tbl_fea_mode
-	short		fpc_ind_ext	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+
+	short		fabs_short	-	tbl_fea_mode
+	short		fabs_long	-	tbl_fea_mode
+	short		fpc_ind		-	tbl_fea_mode
+	short		fpc_ind_ext	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
 
 ###################################
 # Address register indirect: (An) #
@@ -18903,7 +18903,7 @@ faddr_ind_ext:
 
 	btst		&0x8,%d0
 	bne.w		fcalc_mem_ind
-	
+
 	mov.l		%d0,L_SCR1(%a6)		# hold opword
 
 	mov.l		%d0,%d1
@@ -18999,7 +18999,7 @@ fpc_ind_ext:
 
 	btst		&0x8,%d0		# is disp only 8 bits?
 	bne.w		fcalc_mem_ind		# calc memory indirect
-	
+
 	mov.l		%d0,L_SCR1(%a6)		# store opword
 
 	mov.l		%d0,%d1			# make extword copy
@@ -19076,7 +19076,7 @@ fno_base_sup:
 	bfextu		%d5{&26:&2},%d0		# get bd size
 #	beq.l		fmovm_error		# if (size == 0) it's reserved
 
-	cmpi.b	 	%d0,&0x2
+	cmpi.b		%d0,&0x2
 	blt.b		fno_bd
 	beq.b		fget_word_bd
 
@@ -19098,7 +19098,7 @@ fget_word_bd:
 	bne.l		fcea_iacc		# yes
 
 	ext.l		%d0			# sign extend bd
-	
+
 fchk_ind:
 	add.l		%d0,%d3			# base += bd
 
@@ -19107,10 +19107,10 @@ fno_bd:
 	bfextu		%d5{&30:&2},%d0		# is od suppressed?
 	beq.w		faii_bd
 
-	cmpi.b	 	%d0,&0x2
+	cmpi.b		%d0,&0x2
 	blt.b		fnull_od
 	beq.b		fword_od
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long
@@ -19118,7 +19118,7 @@ fno_bd:
 	tst.l		%d1			# did ifetch fail?
 	bne.l		fcea_iacc		# yes
 
-	bra.b 		fadd_them
+	bra.b		fadd_them
 
 fword_od:
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
@@ -19171,7 +19171,7 @@ fdone_ea:
 	rts
 
 #########################################################
-fcea_err:	
+fcea_err:
 	mov.l		%d3,%a0
 
 	movm.l		(%sp)+,&0x003c		# restore d2-d5
@@ -19181,7 +19181,7 @@ fcea_err:
 fcea_iacc:
 	movm.l		(%sp)+,&0x003c		# restore d2-d5
 	bra.l		iea_iacc
-	
+
 fmovm_out_err:
 	bsr.l		restore
 	mov.w		&0x00e1,%d0
@@ -19197,7 +19197,7 @@ fmovm_err:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fmovm_ctrl(): emulate fmovm.l of control registers instr	#
+#	fmovm_ctrl(): emulate fmovm.l of control registers instr	#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read longword from memory			#
@@ -19205,7 +19205,7 @@ fmovm_err:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If _imem_read_long() doesn't fail:				#
 #		USER_FPCR(a6)  = new FPCR value				#
@@ -19213,14 +19213,14 @@ fmovm_err:
 #		USER_FPIAR(a6) = new FPIAR value			#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Decode the instruction type by looking at the extension word 	#
+#	Decode the instruction type by looking at the extension word	#
 # in order to see how many control registers to fetch from memory.	#
 # Fetch them using _imem_read_long(). If this fetch fails, exit through	#
 # the special access error exit handler iea_iacc().			#
 #									#
 # Instruction word decoding:						#
 #									#
-# 	fmovem.l #<data>, {FPIAR&|FPCR&|FPSR}				#
+#	fmovem.l #<data>, {FPIAR&|FPCR&|FPSR}				#
 #									#
 #		WORD1			WORD2				#
 #	1111 0010 00 111100	100$ $$00 0000 0000			#
@@ -19241,7 +19241,7 @@ fmovm_ctrl:
 	beq.w		fctrl_in_6		# yes
 	cmpi.b		%d0,&0x94		# fpcr & fpiar ?
 	beq.b		fctrl_in_5		# yes
-	
+
 # fmovem.l #<data>, fpsr/fpiar
 fctrl_in_3:
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
@@ -19340,21 +19340,21 @@ fctrl_in_7:
 #									#
 # INPUT ***************************************************************	#
 #	d0 = number of bytes to adjust <ea> by				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	None								#
 #									#
 # ALGORITHM ***********************************************************	#
 # "Dummy" CALCulate Effective Address:					#
-# 	The stacked <ea> for FP unimplemented instructions and opclass	#
+#	The stacked <ea> for FP unimplemented instructions and opclass	#
 #	two packed instructions is correct with the exception of...	#
 #									#
 #	1) -(An)   : The register is not updated regardless of size.	#
-#		     Also, for extended precision and packed, the 	#
+#		     Also, for extended precision and packed, the	#
 #		     stacked <ea> value is 8 bytes too big		#
 #	2) (An)+   : The register is not updated.			#
-#	3) #<data> : The upper longword of the immediate operand is 	#
-#		     stacked b,w,l and s sizes are completely stacked. 	#
+#	3) #<data> : The upper longword of the immediate operand is	#
+#		     stacked b,w,l and s sizes are completely stacked.	#
 #		     d,x, and p are not.				#
 #									#
 #########################################################################
@@ -19390,8 +19390,8 @@ dcea_imm:
 	lea		([USER_FPIAR,%a6],0x4),%a0 # no; return <ea>
 	rts
 
-# here, the <ea> is stacked correctly. however, we must update the 
-# address register...	
+# here, the <ea> is stacked correctly. however, we must update the
+# address register...
 dcea_pi:
 	mov.l		%a0,%d0			# pass amt to inc by
 	bsr.l		inc_areg		# inc addr register
@@ -19399,7 +19399,7 @@ dcea_pi:
 	mov.l		EXC_EA(%a6),%a0		# stacked <ea> is correct
 	rts
 
-# the <ea> is stacked correctly for all but extended and packed which 
+# the <ea> is stacked correctly for all but extended and packed which
 # the <ea>s are 8 bytes too large.
 # it would make no sense to have a pre-decrement to a7 in supervisor
 # mode so we don't even worry about this tricky case here : )
@@ -19419,7 +19419,7 @@ dcea_pd2:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_calc_ea_fout(): calculate correct stacked <ea> for extended	#
+#	_calc_ea_fout(): calculate correct stacked <ea> for extended	#
 #			 and packed data opclass 3 operations.		#
 #									#
 # XREF ****************************************************************	#
@@ -19427,22 +19427,22 @@ dcea_pd2:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	a0 = return correct effective address				#
 #									#
 # ALGORITHM ***********************************************************	#
 #	For opclass 3 extended and packed data operations, the <ea>	#
 # stacked for the exception is incorrect for -(an) and (an)+ addressing	#
-# modes. Also, while we're at it, the index register itself must get 	#
+# modes. Also, while we're at it, the index register itself must get	#
 # updated.								#
-# 	So, for -(an), we must subtract 8 off of the stacked <ea> value	#
+#	So, for -(an), we must subtract 8 off of the stacked <ea> value	#
 # and return that value as the correct <ea> and store that value in An.	#
 # For (an)+, the stacked <ea> is correct but we must adjust An by +12.	#
 #									#
 #########################################################################
 
-# This calc_ea is currently used to retrieve the correct <ea> 
+# This calc_ea is currently used to retrieve the correct <ea>
 # for fmove outs of type extended and packed.
 	global		_calc_ea_fout
 _calc_ea_fout:
@@ -19463,7 +19463,7 @@ _calc_ea_fout:
 
 # (An)+ : extended and packed fmove out
 #	: stacked <ea> is correct
-#	: "An" not updated 
+#	: "An" not updated
 ceaf_pi:
 	mov.w		(tbl_ceaf_pi.b,%pc,%d1.w*2),%d1
 	mov.l		EXC_EA(%a6),%a0
@@ -19574,31 +19574,31 @@ ceaf_pd7:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If memory access doesn't fail:					#
 #		FP_SRC(a6) = source operand in extended precision	#
-# 		FP_DST(a6) = destination operand in extended precision	#
+#		FP_DST(a6) = destination operand in extended precision	#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	This is called from the Unimplemented FP exception handler in	#
+#	This is called from the Unimplemented FP exception handler in	#
 # order to load the source and maybe destination operand into		#
 # FP_SRC(a6) and FP_DST(a6). If the instruction was opclass zero, load	#
 # the source and destination from the FP register file. Set the optype	#
 # tags for both if dyadic, one for monadic. If a number is an UNNORM,	#
 # convert it to a DENORM or a ZERO.					#
-# 	If the instruction is opclass two (memory->reg), then fetch	#
-# the destination from the register file and the source operand from 	#
+#	If the instruction is opclass two (memory->reg), then fetch	#
+# the destination from the register file and the source operand from	#
 # memory. Tag and fix both as above w/ opclass zero instructions.	#
-# 	If the source operand is byte,word,long, or single, it may be	#
+#	If the source operand is byte,word,long, or single, it may be	#
 # in the data register file. If it's actually out in memory, use one of	#
 # the mem_read() routines to fetch it. If the mem_read() access returns	#
 # a failing value, exit through the special facc_in() routine which	#
 # will create an access error exception frame from the current exception #
 # frame.								#
-# 	Immediate data and regular data accesses are separated because 	#
+#	Immediate data and regular data accesses are separated because	#
 # if an immediate data access fails, the resulting fault status		#
-# longword stacked for the access error exception must have the 	#
+# longword stacked for the access error exception must have the		#
 # instruction bit set.							#
 #									#
 #########################################################################
@@ -19644,7 +19644,7 @@ op000_dst:
 	cmpi.b		%d0, &UNNORM		# is dst fpreg an UNNORM?
 	beq.b		op000_dst_unnorm	# yes
 op000_dst_cont:
-	mov.b 		%d0, DTAG(%a6)		# store the dst optype tag
+	mov.b		%d0, DTAG(%a6)		# store the dst optype tag
 
 op000_src:
 	bfextu		EXC_CMDREG(%a6){&3:&3}, %d0 # extract src field
@@ -19709,7 +19709,7 @@ op010_dst_unnorm:
 	swbeg		&0x8
 tbl_op010_dreg:
 	short		opd_long	- tbl_op010_dreg
-	short		opd_sgl 	- tbl_op010_dreg
+	short		opd_sgl		- tbl_op010_dreg
 	short		tbl_op010_dreg	- tbl_op010_dreg
 	short		tbl_op010_dreg	- tbl_op010_dreg
 	short		opd_word	- tbl_op010_dreg
@@ -19722,7 +19722,7 @@ tbl_op010_dreg:
 #
 opd_long:
 	bsr.l		fetch_dreg		# fetch long in d0
-	fmov.l		%d0, %fp0 		# load a long
+	fmov.l		%d0, %fp0		# load a long
 	fmovm.x		&0x80, FP_SRC(%a6)	# return src op in FP_SRC
 	fbeq.w		opd_long_zero		# long is a ZERO
 	rts
@@ -19735,7 +19735,7 @@ opd_long_zero:
 #
 opd_word:
 	bsr.l		fetch_dreg		# fetch word in d0
-	fmov.w		%d0, %fp0 		# load a word
+	fmov.w		%d0, %fp0		# load a word
 	fmovm.x		&0x80, FP_SRC(%a6)	# return src op in FP_SRC
 	fbeq.w		opd_word_zero		# WORD is a ZERO
 	rts
@@ -19748,7 +19748,7 @@ opd_word_zero:
 #
 opd_byte:
 	bsr.l		fetch_dreg		# fetch word in d0
-	fmov.b		%d0, %fp0 		# load a byte
+	fmov.b		%d0, %fp0		# load a byte
 	fmovm.x		&0x80, FP_SRC(%a6)	# return src op in FP_SRC
 	fbeq.w		opd_byte_zero		# byte is a ZERO
 	rts
@@ -19766,7 +19766,7 @@ opd_sgl:
 	bsr.l		fetch_dreg		# fetch sgl in d0
 	mov.l		%d0,L_SCR1(%a6)
 
-	lea		L_SCR1(%a6), %a0 	# pass: ptr to the sgl
+	lea		L_SCR1(%a6), %a0	# pass: ptr to the sgl
 	bsr.l		set_tag_s		# determine sgl type
 	mov.b		%d0, STAG(%a6)		# save the src tag
 
@@ -19813,7 +19813,7 @@ tbl_fp_type:
 
 #########################################
 # load a LONG into %fp0:		#
-# 	-number can't fault		#
+#	-number can't fault		#
 #	(1) calc ea			#
 #	(2) read 4 bytes into L_SCR1	#
 #	(3) fmov.l into %fp0		#
@@ -19849,7 +19849,7 @@ load_long_immed:
 
 #########################################
 # load a WORD into %fp0:		#
-# 	-number can't fault		#
+#	-number can't fault		#
 #	(1) calc ea			#
 #	(2) read 2 bytes into L_SCR1	#
 #	(3) fmov.w into %fp0		#
@@ -19885,7 +19885,7 @@ load_word_immed:
 
 #########################################
 # load a BYTE into %fp0:		#
-# 	-number can't fault		#
+#	-number can't fault		#
 #	(1) calc ea			#
 #	(2) read 1 byte into L_SCR1	#
 #	(3) fmov.b into %fp0		#
@@ -19921,7 +19921,7 @@ load_byte_immed:
 
 #########################################
 # load a SGL into %fp0:			#
-# 	-number can't fault		#
+#	-number can't fault		#
 #	(1) calc ea			#
 #	(2) read 4 bytes into L_SCR1	#
 #	(3) fmov.s into %fp0		#
@@ -19961,7 +19961,7 @@ load_sgl_immed:
 	bne.l		funimp_iacc		# yes
 	bra.b		load_sgl_cont
 
-# must convert sgl denorm format to an Xprec denorm fmt suitable for 
+# must convert sgl denorm format to an Xprec denorm fmt suitable for
 # normalization...
 # %a0 : points to sgl denorm
 get_sgl_denorm:
@@ -20003,7 +20003,7 @@ no_sgl_snan_sgn:
 
 #########################################
 # load a DBL into %fp0:			#
-# 	-number can't fault		#
+#	-number can't fault		#
 #	(1) calc ea			#
 #	(2) read 8 bytes into L_SCR(1,2)#
 #	(3) fmov.d into %fp0		#
@@ -20046,7 +20046,7 @@ load_dbl_immed:
 	bne.l		funimp_iacc		# yes
 	bra.b		load_dbl_cont
 
-# must convert dbl denorm format to an Xprec denorm fmt suitable for 
+# must convert dbl denorm format to an Xprec denorm fmt suitable for
 # normalization...
 # %a0 : loc. of dbl denorm
 get_dbl_denorm:
@@ -20092,7 +20092,7 @@ no_dbl_snan_sgn:
 
 #################################################
 # load a Xprec into %fp0:			#
-# 	-number can't fault			#
+#	-number can't fault			#
 #	(1) calc ea				#
 #	(2) read 12 bytes into L_SCR(1,2)	#
 #	(3) fmov.x into %fp0			#
@@ -20124,7 +20124,7 @@ load_ext_unnorm:
 
 #################################################
 # load a packed into %fp0:			#
-# 	-number can't fault			#
+#	-number can't fault			#
 #	(1) calc ea				#
 #	(2) read 12 bytes into L_SCR(1,2,3)	#
 #	(3) fmov.x into %fp0			#
@@ -20143,11 +20143,11 @@ load_packed:
 load_packed_unnorm:
 	bsr.l		unnorm_fix		# fix the UNNORM ZERO
 	mov.b		%d0,STAG(%a6)		# store the src optype tag
-	rts	
+	rts
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fout(): move from fp register to memory or data register	#
+#	fout(): move from fp register to memory or data register	#
 #									#
 # XREF ****************************************************************	#
 #	_round() - needed to create EXOP for sgl/dbl precision		#
@@ -20167,7 +20167,7 @@ load_packed_unnorm:
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
 #	d0 = round prec,mode						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 : intermediate underflow or overflow result if		#
 #	      OVFL/UNFL occurred for a sgl or dbl operand		#
@@ -20186,9 +20186,9 @@ load_packed_unnorm:
 # w/ the address index register as appropriate w/ _calc_ea_fout(). If	#
 # the source is a denorm and if underflow is enabled, an EXOP must be	#
 # created.								#
-# 	For packed, the k-factor must be fetched from the instruction	#
-# word or a data register. The <ea> must be fixed as w/ extended 	#
-# precision. Then, bindec() is called to create the appropriate 	#
+#	For packed, the k-factor must be fetched from the instruction	#
+# word or a data register. The <ea> must be fixed as w/ extended	#
+# precision. Then, bindec() is called to create the appropriate		#
 # packed result.							#
 #	If at any time an access error is flagged by one of the move-	#
 # to-memory routines, then a special exit must be made so that the	#
@@ -20304,7 +20304,7 @@ fout_word_denorm:
 	ori.l		&0x00800000,%d1		# make smallest sgl
 	fmov.s		%d1,%fp0
 	bra.b		fout_word_norm
-	
+
 #################################################################
 # fmove.l out ###################################################
 #################################################################
@@ -20378,7 +20378,7 @@ fout_ext:
 	mov.l		&0xc,%d0		# pass: opsize is 12 bytes
 
 # we must not yet write the extended precision data to the stack
-# in the pre-decrement case from supervisor mode or else we'll corrupt 
+# in the pre-decrement case from supervisor mode or else we'll corrupt
 # the stack frame. so, leave it in FP_SRC for now and deal with it later...
 	cmpi.b		SPCOND_FLG(%a6),&mda7_flg
 	beq.b		fout_ext_a7
@@ -20465,7 +20465,7 @@ fout_sgl_exg:
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fmov.l		%fpsr,%d1		# save FPSR
 
-	or.w		%d1,2+USER_FPSR(%a6) 	# set possible inex2/ainex
+	or.w		%d1,2+USER_FPSR(%a6)	# set possible inex2/ainex
 
 fout_sgl_exg_write:
 	mov.b		1+EXC_OPWORD(%a6),%d1	# extract dst mode
@@ -20506,7 +20506,7 @@ fout_sgl_unfl:
 
 	lea		FP_SCR0(%a6),%a0
 	bsr.l		norm			# normalize the DENORM
-	
+
 fout_sgl_unfl_cont:
 	lea		FP_SCR0(%a6),%a0	# pass: ptr to operand
 	mov.l		L_SCR3(%a6),%d1		# pass: rnd prec,mode
@@ -20557,7 +20557,7 @@ fout_sgl_ovfl_cont:
 
 # call ovf_res() w/ sgl prec and the correct rnd mode to create the default
 # overflow result. DON'T save the returned ccodes from ovf_res() since
-# fmove out doesn't alter them. 
+# fmove out doesn't alter them.
 	tst.b		SRC_EX(%a0)		# is operand negative?
 	smi		%d1			# set if so
 	mov.l		L_SCR3(%a6),%d0		# pass: sgl prec,rnd mode
@@ -20612,7 +20612,7 @@ fout_sgl_may_ovfl:
 
 	fabs.x		%fp0			# need absolute value
 	fcmp.b		%fp0,&0x2		# did exponent increase?
-	fblt.w		fout_sgl_exg		# no; go finish NORM	
+	fblt.w		fout_sgl_exg		# no; go finish NORM
 	bra.w		fout_sgl_ovfl		# yes; go handle overflow
 
 ################
@@ -20703,7 +20703,7 @@ fout_dbl_exg:
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fmov.l		%fpsr,%d0		# save FPSR
 
-	or.w		%d0,2+USER_FPSR(%a6) 	# set possible inex2/ainex
+	or.w		%d0,2+USER_FPSR(%a6)	# set possible inex2/ainex
 
 	mov.l		EXC_EA(%a6),%a1		# pass: dst addr
 	lea		L_SCR1(%a6),%a0		# pass: src addr
@@ -20713,7 +20713,7 @@ fout_dbl_exg:
 	tst.l		%d1			# did dstore fail?
 	bne.l		facc_out_d		# yes
 
-	rts					# no; so we're finished	
+	rts					# no; so we're finished
 
 #
 # here, we know that the operand would UNFL if moved out to double prec,
@@ -20735,7 +20735,7 @@ fout_dbl_unfl:
 
 	lea		FP_SCR0(%a6),%a0
 	bsr.l		norm			# normalize the DENORM
-	
+
 fout_dbl_unfl_cont:
 	lea		FP_SCR0(%a6),%a0	# pass: ptr to operand
 	mov.l		L_SCR3(%a6),%d1		# pass: rnd prec,mode
@@ -20778,7 +20778,7 @@ fout_dbl_ovfl_cont:
 
 # call ovf_res() w/ dbl prec and the correct rnd mode to create the default
 # overflow result. DON'T save the returned ccodes from ovf_res() since
-# fmove out doesn't alter them. 
+# fmove out doesn't alter them.
 	tst.b		SRC_EX(%a0)		# is operand negative?
 	smi		%d1			# set if so
 	mov.l		L_SCR3(%a6),%d0		# pass: dbl prec,rnd mode
@@ -20823,19 +20823,19 @@ fout_dbl_may_ovfl:
 
 	fabs.x		%fp0			# need absolute value
 	fcmp.b		%fp0,&0x2		# did exponent increase?
-	fblt.w		fout_dbl_exg		# no; go finish NORM	
+	fblt.w		fout_dbl_exg		# no; go finish NORM
 	bra.w		fout_dbl_ovfl		# yes; go handle overflow
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	dst_dbl(): create double precision value from extended prec.	#
+#	dst_dbl(): create double precision value from extended prec.	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to source operand in extended precision		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = hi(double precision result)				#
 #	d1 = lo(double precision result)				#
@@ -20849,18 +20849,18 @@ fout_dbl_may_ovfl:
 #	get rid of ext integer bit					#
 #	dbl_mant = ext_mant{62:12}					#
 #									#
-#	    	---------------   ---------------    ---------------	#
+#		---------------   ---------------    ---------------	#
 #  extended ->  |s|    exp    |   |1| ms mant   |    | ls mant     |	#
-#	    	---------------   ---------------    ---------------	#
-#	   	 95	    64    63 62	      32      31     11	  0	#
+#		---------------   ---------------    ---------------	#
+#		 95	    64    63 62	      32      31     11	  0	#
 #				     |			     |		#
 #				     |			     |		#
 #				     |			     |		#
-#		 	             v   		     v		#
-#	    		      ---------------   ---------------		#
-#  double   ->  	      |s|exp| mant  |   |  mant       |		#
-#	    		      ---------------   ---------------		#
-#	   	 	      63     51   32   31	       0	#
+#			             v			     v		#
+#			      ---------------   ---------------		#
+#  double   ->		      |s|exp| mant  |   |  mant       |		#
+#			      ---------------   ---------------		#
+#			      63     51   32   31	       0	#
 #									#
 #########################################################################
 
@@ -20896,13 +20896,13 @@ dst_get_dman:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	dst_sgl(): create single precision value from extended prec	#
+#	dst_sgl(): create single precision value from extended prec	#
 #									#
 # XREF ****************************************************************	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to source operand in extended precision		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = single precision result					#
 #									#
@@ -20914,18 +20914,18 @@ dst_get_dman:
 #	get rid of ext integer bit					#
 #	sgl_mant = ext_mant{62:12}					#
 #									#
-#	    	---------------   ---------------    ---------------	#
+#		---------------   ---------------    ---------------	#
 #  extended ->  |s|    exp    |   |1| ms mant   |    | ls mant     |	#
-#	    	---------------   ---------------    ---------------	#
-#	   	 95	    64    63 62	   40 32      31     12	  0	#
+#		---------------   ---------------    ---------------	#
+#		 95	    64    63 62	   40 32      31     12	  0	#
 #				     |	   |				#
 #				     |	   |				#
 #				     |	   |				#
-#		 	             v     v				#
-#	    		      ---------------				#
-#  single   ->  	      |s|exp| mant  |				#
-#	    		      ---------------				#
-#	   	 	      31     22     0				#
+#			             v     v				#
+#			      ---------------				#
+#  single   ->		      |s|exp| mant  |				#
+#			      ---------------				#
+#			      31     22     0				#
 #									#
 #########################################################################
 
@@ -20998,7 +20998,7 @@ fout_pack_type:
 # add the extra condition that only if the k-factor was zero, too, should
 # we zero the exponent
 	tst.l		%d0
-	bne.b		fout_pack_set	
+	bne.b		fout_pack_set
 # "mantissa" is all zero which means that the answer is zero. but, the '040
 # algorithm allows the exponent to be non-zero. the 881/2 do not. therefore,
 # if the mantissa is zero, I will zero the exponent, too.
@@ -21057,13 +21057,13 @@ fout_pack_snan:
 #									#
 # INPUT ***************************************************************	#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of register fetched					#
 #									#
 # ALGORITHM ***********************************************************	#
-#	According to the index value in d1 which can range from zero 	#
-# to fifteen, load the corresponding register file value (where 	#
+#	According to the index value in d1 which can range from zero	#
+# to fifteen, load the corresponding register file value (where		#
 # address register indexes start at 8). D0/D1/A0/A1/A6/A7 are on the	#
 # stack. The rest should still be in their original places.		#
 #									#
@@ -21152,7 +21152,7 @@ fdregf:
 # INPUT ***************************************************************	#
 #	d0 = longowrd value to store					#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(data register is updated)					#
 #									#
@@ -21213,7 +21213,7 @@ sdregl7:
 # INPUT ***************************************************************	#
 #	d0 = word value to store					#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(data register is updated)					#
 #									#
@@ -21274,7 +21274,7 @@ sdregw7:
 # INPUT ***************************************************************	#
 #	d0 = byte value to store					#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(data register is updated)					#
 #									#
@@ -21335,16 +21335,16 @@ sdregb7:
 # INPUT ***************************************************************	#
 #	d0 = amount to increment by					#
 #	d1 = index of address register to increment			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(address register is updated)					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Typically used for an instruction w/ a post-increment <ea>, 	#
+#	Typically used for an instruction w/ a post-increment <ea>,	#
 # this routine adds the increment value in d0 to the address register	#
 # specified by d1. A0/A1/A6/A7 reside on the stack. The rest reside	#
 # in their original places.						#
-# 	For a7, if the increment amount is one, then we have to 	#
+#	For a7, if the increment amount is one, then we have to		#
 # increment by two. For any a7 update, set the mia7_flag so that if	#
 # an access error exception occurs later in emulation, this address	#
 # register update can be undone.					#
@@ -21399,16 +21399,16 @@ iareg7b:
 # INPUT ***************************************************************	#
 #	d0 = amount to decrement by					#
 #	d1 = index of address register to decrement			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(address register is updated)					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Typically used for an instruction w/ a pre-decrement <ea>, 	#
+#	Typically used for an instruction w/ a pre-decrement <ea>,	#
 # this routine adds the decrement value in d0 to the address register	#
 # specified by d1. A0/A1/A6/A7 reside on the stack. The rest reside	#
 # in their original places.						#
-# 	For a7, if the decrement amount is one, then we have to 	#
+#	For a7, if the decrement amount is one, then we have to		#
 # decrement by two. For any a7 update, set the mda7_flag so that if	#
 # an access error exception occurs later in emulation, this address	#
 # register update can be undone.					#
@@ -21464,17 +21464,17 @@ dareg7b:
 #									#
 # INPUT ***************************************************************	#
 #	d0 = index of FP register to load				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SRC(a6) = value loaded from FP register file			#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Using the index in d0, load FP_SRC(a6) with a number from the 	#
+#	Using the index in d0, load FP_SRC(a6) with a number from the	#
 # FP register file.							#
 #									#
 #########################################################################
 
-	global 		load_fpn1
+	global		load_fpn1
 load_fpn1:
 	mov.w		(tbl_load_fpn1.b,%pc,%d0.w*2), %d0
 	jmp		(tbl_load_fpn1.b,%pc,%d0.w*1)
@@ -21537,12 +21537,12 @@ load_fpn1_7:
 #									#
 # INPUT ***************************************************************	#
 #	d0 = index of FP register to load				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_DST(a6) = value loaded from FP register file			#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Using the index in d0, load FP_DST(a6) with a number from the 	#
+#	Using the index in d0, load FP_DST(a6) with a number from the	#
 # FP register file.							#
 #									#
 #########################################################################
@@ -21603,7 +21603,7 @@ load_fpn2_7:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	store_fpreg(): store an fp value to the fpreg designated d0.	#
+#	store_fpreg(): store an fp value to the fpreg designated d0.	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
@@ -21611,7 +21611,7 @@ load_fpn2_7:
 # INPUT ***************************************************************	#
 #	fp0 = extended precision value to store				#
 #	d0  = index of floating-point register				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	None								#
 #									#
@@ -21644,33 +21644,33 @@ store_fpreg_1:
 	fmovm.x		&0x80, EXC_FP1(%a6)
 	rts
 store_fpreg_2:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x20
 	rts
 store_fpreg_3:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x10
 	rts
 store_fpreg_4:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x08
 	rts
 store_fpreg_5:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x04
 	rts
 store_fpreg_6:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x02
 	rts
 store_fpreg_7:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x01
 	rts
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_denorm(): denormalize an intermediate result			#
+#	_denorm(): denormalize an intermediate result			#
 #									#
 # XREF ****************************************************************	#
 #	None								#
@@ -21678,7 +21678,7 @@ store_fpreg_7:
 # INPUT *************************************************************** #
 #	a0 = points to the operand to be denormalized			#
 #		(in the internal extended format)			#
-#		 							#
+#									#
 #	d0 = rounding precision						#
 #									#
 # OUTPUT **************************************************************	#
@@ -21688,10 +21688,10 @@ store_fpreg_7:
 #	d0 = guard,round,sticky						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	According to the exponent underflow threshold for the given	#
+#	According to the exponent underflow threshold for the given	#
 # precision, shift the mantissa bits to the right in order raise the	#
-# exponent of the operand to the threshold value. While shifting the 	#
-# mantissa bits right, maintain the value of the guard, round, and 	#
+# exponent of the operand to the threshold value. While shifting the	#
+# mantissa bits right, maintain the value of the guard, round, and	#
 # sticky bits.								#
 # other notes:								#
 #	(1) _denorm() is called by the underflow routines		#
@@ -21711,7 +21711,7 @@ tbl_thresh:
 _denorm:
 #
 # Load the exponent threshold for the precision selected and check
-# to see if (threshold - exponent) is > 65 in which case we can 
+# to see if (threshold - exponent) is > 65 in which case we can
 # simply calculate the sticky bit and zero the mantissa. otherwise
 # we have to call the denormalization routine.
 #
@@ -21750,7 +21750,7 @@ denorm_set_stky:
 #	%d0{31:29} : initial guard,round,sticky				#
 #	%d1{15:0}  : denormalization threshold				#
 # OUTPUT:								#
-#	%a0	   : points to the denormalized operand		 	#
+#	%a0	   : points to the denormalized operand			#
 #	%d0{31:29} : final guard,round,sticky				#
 #									#
 
@@ -21770,7 +21770,7 @@ dnrm_lp:
 
 #
 # check to see how much less than the underflow threshold the operand
-# exponent is. 
+# exponent is.
 #
 	mov.l		%d1, %d0		# copy the denorm threshold
 	sub.w		FTEMP_EX(%a0), %d1	# d1 = threshold - uns exponent
@@ -21785,7 +21785,7 @@ dnrm_lp:
 # No normalization necessary
 #
 dnrm_no_lp:
-	mov.l		GRS(%a6), %d0 		# restore original g,r,s
+	mov.l		GRS(%a6), %d0		# restore original g,r,s
 	rts
 
 #
@@ -21795,7 +21795,7 @@ dnrm_no_lp:
 # %d1 = "n" = amt to shift
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-(32 - n)-><-(n)-><-(32 - n)-><-(n)-><-(32 - n)-><-(n)->
 #	\	   \		      \			 \
@@ -21806,7 +21806,7 @@ dnrm_no_lp:
 #	     \		\		   \		      \
 #	      \		 \		    \		       \
 #	       \	  \		     \			\
-#	<-(n)-><-(32 - n)-><------(32)-------><------(32)------->	
+#	<-(n)-><-(32 - n)-><------(32)-------><------(32)------->
 #	---------------------------------------------------------
 #	|0.....0| NEW_HI  |  NEW_FTEMP_LO     |grs		|
 #	---------------------------------------------------------
@@ -21847,17 +21847,17 @@ case1_sticky_clear:
 # %d1 = "n" = amt to shift
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-(32 - n)-><-(n)-><-(32 - n)-><-(n)-><-(32 - n)-><-(n)->
 #	\	   \		      \
 #	 \	    \		       \
 #	  \	     \			-------------------
 #	   \	      --------------------		   \
-#	    -------------------	  	  \		    \
-#	     		       \	   \		     \
-#	      		 	\     	    \		      \
-#	       		  	 \	     \		       \
+#	    -------------------		  \		    \
+#			       \	   \		     \
+#				\	    \		      \
+#				 \	     \		       \
 #	<-------(32)------><-(n)-><-(32 - n)-><------(32)------->
 #	---------------------------------------------------------
 #	|0...............0|0....0| NEW_LO     |grs		|
@@ -21928,17 +21928,17 @@ case_3:
 # case (d1 == 64)
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-------(32)------>
-#	\	   	   \
-#	 \	    	    \
-#	  \	     	     \
-#	   \	      	      ------------------------------
+#	\		   \
+#	 \		    \
+#	  \		     \
+#	   \		      ------------------------------
 #	    -------------------------------		    \
-#	     		       		   \		     \
-#	      		 	     	    \		      \
-#	       		  	 	     \		       \
+#					   \		     \
+#					    \		      \
+#					     \		       \
 #					      <-------(32)------>
 #	---------------------------------------------------------
 #	|0...............0|0................0|grs		|
@@ -21956,17 +21956,17 @@ case3_64:
 # case (d1 == 65)
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-------(32)------>
-#	\	   	   \
-#	 \	    	    \
-#	  \	     	     \
-#	   \	      	      ------------------------------
+#	\		   \
+#	 \		    \
+#	  \		     \
+#	   \		      ------------------------------
 #	    --------------------------------		    \
-#	     		       		    \		     \
-#	      		 	     	     \		      \
-#	       		  	 	      \		       \
+#					    \		     \
+#					     \		      \
+#					      \		       \
 #					       <-------(31)----->
 #	---------------------------------------------------------
 #	|0...............0|0................0|0rs		|
@@ -22014,7 +22014,7 @@ case3_set_sticky:
 #	None								#
 #									#
 # INPUT ***************************************************************	#
-#	a0	  = ptr to input operand in internal extended format 	#
+#	a0	  = ptr to input operand in internal extended format	#
 #	d1(hi)    = contains rounding precision:			#
 #			ext = $0000xxxx					#
 #			sgl = $0004xxxx					#
@@ -22045,7 +22045,7 @@ _round:
 #
 # ext_grs() looks at the rounding precision and sets the appropriate
 # G,R,S bits.
-# If (G,R,S == 0) then result is exact and round is done, else set 
+# If (G,R,S == 0) then result is exact and round is done, else set
 # the inex flag in status reg and continue.
 #
 	bsr.l		ext_grs			# extract G,R,S
@@ -22091,7 +22091,7 @@ rnd_plus:
 #	If sign of fp number = 1 (negative), then add 1 to l.	#
 #################################################################
 rnd_mnus:
-	tst.b		FTEMP_SGN(%a0)		# check for sign	
+	tst.b		FTEMP_SGN(%a0)		# check for sign
 	bpl.w		truncate		# if negative then truncate
 
 	mov.l		&0xffffffff, %d0	# force g,r,s to be all f's
@@ -22202,7 +22202,7 @@ truncate:
 #
 # INPUT
 #	d0	   = extended precision g,r,s (in d0{31:29})
-#	d1 	   = {PREC,ROUND}
+#	d1	   = {PREC,ROUND}
 # OUTPUT
 #	d0{31:29}  = guard, round, sticky
 #
@@ -22253,7 +22253,7 @@ ext_grs_sgl:
 	mov.l		&30, %d2		# of the sgl prec. limits
 	lsl.l		%d2, %d3		# shift g-r bits to MSB of d3
 	mov.l		FTEMP_HI(%a0), %d2	# get word 2 for s-bit test
-	and.l		&0x0000003f, %d2	# s bit is the or of all other 
+	and.l		&0x0000003f, %d2	# s bit is the or of all other
 	bne.b		ext_grs_st_stky		# bits to the right of g-r
 	tst.l		FTEMP_LO(%a0)		# test lower mantissa
 	bne.b		ext_grs_st_stky		# if any are set, set sticky
@@ -22263,9 +22263,9 @@ ext_grs_sgl:
 
 #
 # dbl:
-#	96		64	  	32	 11	0
+#	96		64		32	 11	0
 #	-----------------------------------------------------
-#	| EXP	|XXXXXXX|	  	|	 |xx	|grs|
+#	| EXP	|XXXXXXX|		|	 |xx	|grs|
 #	-----------------------------------------------------
 #						  nn\	    /
 #						  ee -------
@@ -22278,7 +22278,7 @@ ext_grs_dbl:
 	mov.l		&30, %d2		# of the dbl prec. limits
 	lsl.l		%d2, %d3		# shift g-r bits to the MSB of d3
 	mov.l		FTEMP_LO(%a0), %d2	# get lower mantissa  for s-bit test
-	and.l		&0x000001ff, %d2	# s bit is the or-ing of all 
+	and.l		&0x000001ff, %d2	# s bit is the or-ing of all
 	bne.b		ext_grs_st_stky		# other bits to the right of g-r
 	tst.l		%d0			# test word original g,r,s
 	bne.b		ext_grs_st_stky		# if any are set, set sticky
@@ -22308,7 +22308,7 @@ ext_grs_end_sd:
 #	a0 = pointer fp extended precision operand to normalize		#
 #									#
 # OUTPUT ************************************************************** #
-# 	d0 = number of bit positions the mantissa was shifted		#
+#	d0 = number of bit positions the mantissa was shifted		#
 #	a0 = the input operand's mantissa is normalized; the exponent	#
 #	     is unchanged.						#
 #									#
@@ -22335,7 +22335,7 @@ norm_hi:
 	mov.l		%d1, FTEMP_LO(%a0)	# store new lo(man)
 
 	mov.l		%d2, %d0		# return shift amount
-	
+
 	mov.l		(%sp)+, %d3		# restore temp regs
 	mov.l		(%sp)+, %d2
 
@@ -22350,7 +22350,7 @@ norm_lo:
 	clr.l		FTEMP_LO(%a0)		# lo(man) is now zero
 
 	mov.l		%d2, %d0		# return shift amount
-	
+
 	mov.l		(%sp)+, %d3		# restore temp regs
 	mov.l		(%sp)+, %d2
 
@@ -22455,27 +22455,27 @@ unnorm_nrm_zero_lrg:
 # whole mantissa is zero so this UNNORM is actually a zero
 #
 unnorm_zero:
-	and.w		&0x8000, FTEMP_EX(%a0) 	# force exponent to zero
+	and.w		&0x8000, FTEMP_EX(%a0)	# force exponent to zero
 
 	mov.b		&ZERO, %d0		# fix optype tag
 	rts
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	set_tag_x(): return the optype of the input ext fp number	#
+#	set_tag_x(): return the optype of the input ext fp number	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, UNNORM, ZERO	#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, UNNORM, ZERO	#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #	If it's an unnormalized zero, alter the operand and force it	#
 # to be a normal zero.							#
@@ -22542,20 +22542,20 @@ is_snan_x:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	set_tag_d(): return the optype of the input dbl fp number	#
+#	set_tag_d(): return the optype of the input dbl fp number	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = points to double precision operand				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #									#
 #########################################################################
@@ -22605,20 +22605,20 @@ is_qnan_d:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	set_tag_s(): return the optype of the input sgl fp number	#
+#	set_tag_s(): return the optype of the input sgl fp number	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to single precision operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #									#
 #########################################################################
@@ -22664,15 +22664,15 @@ is_qnan_s:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	unf_res(): routine to produce default underflow result of a 	#
-#	 	   scaled extended precision number; this is used by 	#
+#	unf_res(): routine to produce default underflow result of a	#
+#		   scaled extended precision number; this is used by	#
 #		   fadd/fdiv/fmul/etc. emulation routines.		#
-# 	unf_res4(): same as above but for fsglmul/fsgldiv which use	#
+#	unf_res4(): same as above but for fsglmul/fsgldiv which use	#
 #		    single round prec and extended prec mode.		#
 #									#
 # XREF ****************************************************************	#
 #	_denorm() - denormalize according to scale factor		#
-# 	_round() - round denormalized number according to rnd prec	#
+#	_round() - round denormalized number according to rnd prec	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precison operand			#
@@ -22684,15 +22684,15 @@ is_qnan_s:
 #	d0.b = result FPSR_cc which caller may or may not want to save	#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Convert the input operand to "internal format" which means the	#
+#	Convert the input operand to "internal format" which means the	#
 # exponent is extended to 16 bits and the sign is stored in the unused	#
 # portion of the extended precison operand. Denormalize the number	#
-# according to the scale factor passed in d0. Then, round the 		#
+# according to the scale factor passed in d0. Then, round the		#
 # denormalized result.							#
-# 	Set the FPSR_exc bits as appropriate but return the cc bits in	#
+#	Set the FPSR_exc bits as appropriate but return the cc bits in	#
 # d0 in case the caller doesn't want to save them (as is the case for	#
 # fmove out).								#
-# 	unf_res4() for fsglmul/fsgldiv forces the denorm to extended	#
+#	unf_res4() for fsglmul/fsgldiv forces the denorm to extended	#
 # precision and the rounding mode to single.				#
 #									#
 #########################################################################
@@ -22830,23 +22830,23 @@ unf_res4_end:
 #	none								#
 #									#
 # INPUT ***************************************************************	#
-#	d1.b 	= '-1' => (-); '0' => (+)				#
+#	d1.b	= '-1' => (-); '0' => (+)				#
 #   ovf_res():								#
-#	d0 	= rnd mode/prec						#
+#	d0	= rnd mode/prec						#
 #   ovf_res2():								#
-#	hi(d0) 	= rnd prec						#
+#	hi(d0)	= rnd prec						#
 #	lo(d0)	= rnd mode						#
 #									#
 # OUTPUT **************************************************************	#
-#	a0   	= points to extended precision result			#
-#	d0.b 	= condition code bits					#
+#	a0	= points to extended precision result			#
+#	d0.b	= condition code bits					#
 #									#
 # ALGORITHM ***********************************************************	#
 #	The default overflow result can be determined by the sign of	#
 # the result and the rounding mode/prec in effect. These bits are	#
-# concatenated together to create an index into the default result 	#
+# concatenated together to create an index into the default result	#
 # table. A pointer to the correct result is returned in a0. The		#
-# resulting condition codes are returned in d0 in case the caller 	#
+# resulting condition codes are returned in d0 in case the caller	#
 # doesn't want FPSR_cc altered (as is the case for fmove out).		#
 #									#
 #########################################################################
@@ -22876,7 +22876,7 @@ ovf_res2:
 ovf_res_load:
 	mov.b		(tbl_ovfl_cc.b,%pc,%d0.w*1), %d0 # fetch result ccodes
 	lea		(tbl_ovfl_result.b,%pc,%d1.w*8), %a0 # return result ptr
-	
+
 	rts
 
 tbl_ovfl_cc:
@@ -22937,18 +22937,18 @@ tbl_ovfl_result:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If no failure on _mem_read():					#
-# 	FP_SRC(a6) = packed operand now as a binary FP number		#
+#	FP_SRC(a6) = packed operand now as a binary FP number		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Get the correct <ea> whihc is the value on the exception stack 	#
+#	Get the correct <ea> whihc is the value on the exception stack	#
 # frame w/ maybe a correction factor if the <ea> is -(an) or (an)+.	#
 # Then, fetch the operand from memory. If the fetch fails, exit		#
 # through facc_in_x().							#
 #	If the packed operand is a ZERO,NAN, or INF, convert it to	#
-# its binary representation here. Else, call decbin() which will 	#
+# its binary representation here. Else, call decbin() which will	#
 # convert the packed value to an extended precision binary value.	#
 #									#
 #########################################################################
@@ -23005,7 +23005,7 @@ gp_not_spec:
 #	and NaN operands are dispatched without entering this routine)	#
 #	value in 68881/882 format at location (a0).			#
 #									#
-#	A1. Convert the bcd exponent to binary by successive adds and 	#
+#	A1. Convert the bcd exponent to binary by successive adds and	#
 #	muls. Set the sign according to SE. Subtract 16 to compensate	#
 #	for the mantissa which is to be interpreted as 17 integer	#
 #	digits, rather than 1 integer and 16 fraction digits.		#
@@ -23069,7 +23069,7 @@ RTABLE:
 
 	global		decbin
 decbin:
-	mov.l		0x0(%a0),FP_SCR0_EX(%a6) # make a copy of input 
+	mov.l		0x0(%a0),FP_SCR0_EX(%a6) # make a copy of input
 	mov.l		0x4(%a0),FP_SCR0_HI(%a6) # so we don't alter it
 	mov.l		0x8(%a0),FP_SCR0_LO(%a6)
 
@@ -23358,7 +23358,7 @@ ap_n_en:
 #
 # Pwrten calculates the exponent factor in the selected rounding mode
 # according to the following table:
-#	
+#
 #	Sign of Mant  Sign of Exp  Rounding Mode  PWRTEN Rounding Mode
 #
 #	ANY	  ANY	RN	RN
@@ -23446,7 +23446,7 @@ mul:
 # it will be inex2, but will be reported as inex1 by get_op.
 #
 end_dec:
-	fmov.l		%fpsr,%d0		# get status register	
+	fmov.l		%fpsr,%d0		# get status register
 	bclr		&inex2_bit+8,%d0	# test for inex2 and clear it
 	beq.b		no_exc			# skip this if no exc
 	ori.w		&inx1a_mask,2+USER_FPSR(%a6) # set INEX1/AINEX
@@ -23463,16 +23463,16 @@ no_exc:
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to the input extended precision value in memory.	#
-#	     the input may be either normalized, unnormalized, or 	#
+#	     the input may be either normalized, unnormalized, or	#
 #	     denormalized.						#
-#	d0 = contains the k-factor sign-extended to 32-bits. 		#
+#	d0 = contains the k-factor sign-extended to 32-bits.		#
 #									#
 # OUTPUT **************************************************************	#
 #	FP_SCR0(a6) = bcd format result on the stack.			#
 #									#
 # ALGORITHM ***********************************************************	#
 #									#
-#	A1.	Set RM and size ext;  Set SIGMA = sign of input.  	#
+#	A1.	Set RM and size ext;  Set SIGMA = sign of input.	#
 #		The k-factor is saved for use in d7. Clear the		#
 #		BINDEC_FLG for separating normalized/denormalized	#
 #		input.  If input is unnormalized or denormalized,	#
@@ -23482,15 +23482,15 @@ no_exc:
 #									#
 #	A3.	Compute ILOG.						#
 #		ILOG is the log base 10 of the input value.  It is	#
-#		approximated by adding e + 0.f when the original 	#
-#		value is viewed as 2^^e * 1.f in extended precision.  	#
+#		approximated by adding e + 0.f when the original	#
+#		value is viewed as 2^^e * 1.f in extended precision.	#
 #		This value is stored in d6.				#
 #									#
 #	A4.	Clr INEX bit.						#
-#		The operation in A3 above may have set INEX2.  		#
+#		The operation in A3 above may have set INEX2.		#
 #									#
 #	A5.	Set ICTR = 0;						#
-#		ICTR is a flag used in A13.  It must be set before the 	#
+#		ICTR is a flag used in A13.  It must be set before the	#
 #		loop entry A6.						#
 #									#
 #	A6.	Calculate LEN.						#
@@ -23512,7 +23512,7 @@ no_exc:
 #		of ISCALE and X.  A table is given in the code.		#
 #									#
 #	A8.	Clr INEX; Force RZ.					#
-#		The operation in A3 above may have set INEX2.  		#
+#		The operation in A3 above may have set INEX2.		#
 #		RZ mode is forced for the scaling operation to insure	#
 #		only one rounding error.  The grs bits are collected in #
 #		the INEX flag for use in A10.				#
@@ -23543,11 +23543,11 @@ no_exc:
 #		the mantissa by 10.					#
 #									#
 #	A14.	Convert the mantissa to bcd.				#
-#		The binstr routine is used to convert the LEN digit 	#
+#		The binstr routine is used to convert the LEN digit	#
 #		mantissa to bcd in memory.  The input to binstr is	#
 #		to be a fraction; i.e. (mantissa)/10^LEN and adjusted	#
 #		such that the decimal point is to the left of bit 63.	#
-#		The bcd digits are stored in the correct position in 	#
+#		The bcd digits are stored in the correct position in	#
 #		the final string area in memory.			#
 #									#
 #	A15.	Convert the exponent to bcd.				#
@@ -23593,7 +23593,7 @@ RBDTBL:
 #		d2: upper 32-bits of mantissa for binstr
 #		d3: scratch;lower 32-bits of mantissa for binstr
 #		d4: LEN
-#      		d5: LAMBDA/ICTR
+#		d5: LAMBDA/ICTR
 #		d6: ILOG
 #		d7: k-factor
 #		a0: ptr for original operand/final result
@@ -23617,7 +23617,7 @@ bindec:
 #     separating  normalized/denormalized input.  If the input
 #     is a denormalized number, set the BINDEC_FLG memory word
 #     to signal denorm.  If the input is unnormalized, normalize
-#     the input and test for denormalized result.  
+#     the input and test for denormalized result.
 #
 	fmov.l		&rm_mode*0x10,%fpcr	# set RM and ext
 	mov.l		(%a0),L_SCR2(%a6)	# save exponent for sign check
@@ -23698,7 +23698,7 @@ A3_cont:
 	sub.w		&0x3fff,%d0	# strip off bias
 	fadd.w		%d0,%fp0	# add in exp
 	fsub.s		FONE(%pc),%fp0	# subtract off 1.0
-	fbge.w		pos_res		# if pos, branch 
+	fbge.w		pos_res		# if pos, branch
 	fmul.x		PLOG2UP1(%pc),%fp0	# if neg, mul by LOG2UP1
 	fmov.l		%fp0,%d6	# put ILOG in d6 as a lword
 	bra.b		A4_str		# go move out ILOG
@@ -23708,14 +23708,14 @@ pos_res:
 
 
 # A4. Clr INEX bit.
-#     The operation in A3 above may have set INEX2.  
+#     The operation in A3 above may have set INEX2.
 
 A4_str:
 	fmov.l		&0,%fpsr	# zero all of fpsr - nothing needed
 
 
 # A5. Set ICTR = 0;
-#     ICTR is a flag used in A13.  It must be set before the 
+#     ICTR is a flag used in A13.  It must be set before the
 #     loop entry A6. The lower word of d5 is used for ICTR.
 
 	clr.w		%d5		# clear ICTR
@@ -23881,21 +23881,21 @@ e_next2:
 	bne.b		e_loop2		# if not, loop
 
 # A8. Clr INEX; Force RZ.
-#     The operation in A3 above may have set INEX2.  
+#     The operation in A3 above may have set INEX2.
 #     RZ mode is forced for the scaling operation to insure
-#     only one rounding error.  The grs bits are collected in 
+#     only one rounding error.  The grs bits are collected in
 #     the INEX flag for use in A10.
 #
 # Register usage:
 #	Input/Output
 
-	fmov.l		&0,%fpsr	# clr INEX 
+	fmov.l		&0,%fpsr	# clr INEX
 	fmov.l		&rz_mode*0x10,%fpcr	# set RZ rounding mode
 
 # A9. Scale X -> Y.
 #     The mantissa is scaled to the desired number of significant
 #     digits.  The excess digits are collected in INEX2. If mul,
-#     Check d2 for excess 10 exponential value.  If not zero, 
+#     Check d2 for excess 10 exponential value.  If not zero,
 #     the iscale value would have caused the pwrten calculation
 #     to overflow.  Only a negative iscale can cause this, so
 #     multiply by 10^(d2), which is now only allowed to be 24,
@@ -24026,7 +24026,7 @@ A10_st:
 
 A11_st:
 	mov.l		USER_FPCR(%a6),L_SCR1(%a6)	# save it for later
-	and.l		&0x00000030,USER_FPCR(%a6)	# set size to ext, 
+	and.l		&0x00000030,USER_FPCR(%a6)	# set size to ext,
 #					;block exceptions
 
 
@@ -24062,7 +24062,7 @@ A12_st:
 	lea.l		FP_SCR1(%a6),%a0	# a0 is ptr to FP_SCR1(a6)
 	fmov.x		%fp0,(%a0)	# move Y to memory at FP_SCR1(a6)
 	tst.l		L_SCR2(%a6)	# test sign of original operand
-	bge.b		do_fint12		# if pos, use Y 
+	bge.b		do_fint12		# if pos, use Y
 	or.l		&0x80000000,(%a0)	# if neg, use -Y
 do_fint12:
 	mov.l	USER_FPSR(%a6),-(%sp)
@@ -24158,7 +24158,7 @@ A13_con:
 	subq.l		&1,%d6		# subtract 1 from ILOG
 	mov.w		&1,%d5		# set ICTR
 	fmov.l		&rm_mode*0x10,%fpcr	# set rmode to RM
-	fmul.s		FTEN(%pc),%fp2	# compute 10^LEN 
+	fmul.s		FTEN(%pc),%fp2	# compute 10^LEN
 	bra.w		A6_str		# return to A6 and recompute YINT
 test_2:
 	fmul.s		FTEN(%pc),%fp2	# compute 10^LEN
@@ -24174,7 +24174,7 @@ fix_ex:
 	fmov.l		&rm_mode*0x10,%fpcr	# set rmode to RM
 	bra.w		A6_str		# return to A6 and recompute YINT
 #
-# Since ICTR <> 0, we have already been through one adjustment, 
+# Since ICTR <> 0, we have already been through one adjustment,
 # and shouldn't have another; this is to check if abs(YINT) = 10^LEN
 # 10^LEN is again computed using whatever table is in a1 since the
 # value calculated cannot be inexact.
@@ -24200,11 +24200,11 @@ z_next:
 	fmul.s		FTEN(%pc),%fp2	# if LEN++, the get 10^^LEN
 
 # A14. Convert the mantissa to bcd.
-#      The binstr routine is used to convert the LEN digit 
+#      The binstr routine is used to convert the LEN digit
 #      mantissa to bcd in memory.  The input to binstr is
 #      to be a fraction; i.e. (mantissa)/10^LEN and adjusted
 #      such that the decimal point is to the left of bit 63.
-#      The bcd digits are stored in the correct position in 
+#      The bcd digits are stored in the correct position in
 #      the final string area in memory.
 #
 #
@@ -24247,7 +24247,7 @@ A14_st:
 	bgt.b		no_sft		# if so, don't shift
 	neg.l		%d0		# make exp positive
 m_loop:
-	lsr.l		&1,%d2		# shift d2:d3 right, add 0s 
+	lsr.l		&1,%d2		# shift d2:d3 right, add 0s
 	roxr.l		&1,%d3		# the number of places
 	dbf.w		%d0,m_loop	# given in d0
 no_sft:
@@ -24272,9 +24272,9 @@ zer_m:
 #
 #      Digits are stored in L_SCR1(a6) on return from BINDEC as:
 #
-#  	 32               16 15                0
+#	 32               16 15                0
 #	-----------------------------------------
-#  	|  0 | e3 | e2 | e1 | e4 |  X |  X |  X |
+#	|  0 | e3 | e2 | e1 | e4 |  X |  X |  X |
 #	-----------------------------------------
 #
 # And are moved into their proper places in FP_SCR0.  If digit e4
@@ -24337,7 +24337,7 @@ convrt:
 	sub.w		&0x3ffd,%d0	# subtract off bias
 	neg.w		%d0		# make exp positive
 x_loop:
-	lsr.l		&1,%d2		# shift d2:d3 right 
+	lsr.l		&1,%d2		# shift d2:d3 right
 	roxr.l		&1,%d3		# the number of places
 	dbf.w		%d0,x_loop	# given in d0
 x_loop_fin:
@@ -24348,12 +24348,12 @@ x_loop_fin:
 	mov.l		&4,%d0		# put 4 in d0 for binstr call
 	lea.l		L_SCR1(%a6),%a0	# a0 is ptr to L_SCR1 for exp digits
 	bsr		binstr		# call binstr to convert exp
-	mov.l		L_SCR1(%a6),%d0	# load L_SCR1 lword to d0 
+	mov.l		L_SCR1(%a6),%d0	# load L_SCR1 lword to d0
 	mov.l		&12,%d1		# use d1 for shift count
 	lsr.l		%d1,%d0		# shift d0 right by 12
 	bfins		%d0,FP_SCR0(%a6){&4:&12}	# put e3:e2:e1 in FP_SCR0
 	lsr.l		%d1,%d0		# shift d0 right by 12
-	bfins		%d0,FP_SCR0(%a6){&16:&4}	# put e4 in FP_SCR0 
+	bfins		%d0,FP_SCR0(%a6){&16:&4}	# put e4 in FP_SCR0
 	tst.b		%d0		# check if e4 is zero
 	beq.b		A16_st		# if zero, skip rest
 	or.l		&opaop_mask,USER_FPSR(%a6)	# set OPERR & AIOP in USER_FPSR
@@ -24384,14 +24384,14 @@ x_loop_fin:
 
 A16_st:
 	clr.l		%d0		# clr d0 for collection of signs
-	and.b		&0x0f,FP_SCR0(%a6)	# clear first nibble of FP_SCR0 
+	and.b		&0x0f,FP_SCR0(%a6)	# clear first nibble of FP_SCR0
 	tst.l		L_SCR2(%a6)	# check sign of original mantissa
 	bge.b		mant_p		# if pos, don't set SM
 	mov.l		&2,%d0		# move 2 in to d0 for SM
 mant_p:
 	tst.l		%d6		# check sign of ILOG
 	bge.b		wr_sgn		# if pos, don't set SE
-	addq.l		&1,%d0		# set bit 0 in d0 for SE 
+	addq.l		&1,%d0		# set bit 0 in d0 for SE
 wr_sgn:
 	bfins		%d0,FP_SCR0(%a6){&0:&2}	# insert SM and SE into FP_SCR0
 
@@ -24457,8 +24457,8 @@ PTENRM:
 #	d2:d3 = 64-bit binary integer					#
 #	d0    = desired length (LEN)					#
 #	a0    = pointer to start in memory for bcd characters		#
-#          	(This pointer must point to byte 4 of the first		#
-#          	 lword of the packed decimal memory string.)		#
+#		(This pointer must point to byte 4 of the first		#
+#		 lword of the packed decimal memory string.)		#
 #									#
 # OUTPUT ************************************************************** #
 #	a0 = pointer to LEN bcd digits representing the 64-bit integer.	#
@@ -24598,14 +24598,14 @@ end_bstr:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	None								#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Flow jumps here when an FP data fetch call gets an error 	#
+#	Flow jumps here when an FP data fetch call gets an error	#
 # result. This means the operating system wants an access error frame	#
-# made out of the current exception stack frame. 			#
+# made out of the current exception stack frame.			#
 #	So, we first call restore() which makes sure that any updated	#
 # -(an)+ register gets returned to its pre-exception value and then	#
 # we change the stack to an access error stack frame.			#
@@ -24775,7 +24775,7 @@ ri_a7:
 	bne.b		ri_a7_done		# supervisor
 	movc		%usp,%a0		# restore USP
 	sub.l		%d0,%a0
-	movc		%a0,%usp	
+	movc		%a0,%usp
 ri_a7_done:
 	rts
 
diff --git a/arch/m68k/ifpsp060/src/ftest.S b/arch/m68k/ifpsp060/src/ftest.S
index c2148a278..2edcbae0f 100644
--- a/arch/m68k/ifpsp060/src/ftest.S
+++ b/arch/m68k/ifpsp060/src/ftest.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -86,7 +86,7 @@ test_fail:
 #############################################
 _060TESTS_:
 	link		%a6,&-384
-	
+
 	movm.l		&0x3f3c,-(%sp)
 	fmovm.x		&0xff,-(%sp)
 
@@ -138,7 +138,7 @@ _060TESTS_:
 
 _060TESTS_unimp:
 	link		%a6,&-384
-	
+
 	movm.l		&0x3f3c,-(%sp)
 	fmovm.x		&0xff,-(%sp)
 
@@ -164,7 +164,7 @@ _060TESTS_unimp:
 
 _060TESTS_enable:
 	link		%a6,&-384
-	
+
 	movm.l		&0x3f3c,-(%sp)
 	fmovm.x		&0xff,-(%sp)
 
@@ -687,7 +687,7 @@ fmovmx_0:
 
 	fmovm.l		%fpcr,%fpsr,%fpiar,IFPCREGS(%a6)
 	fmovm.x		&0xff,IFPREGS(%a6)
-	
+
 	mov.w		&0x0000,%cc
 
 	fmovm.x		%d0,-(%sp)
@@ -753,7 +753,7 @@ fmovmx_1:
 	movm.l		&0xffff,IREGS(%a6)
 
 	fmovm.l		%fpcr,%fpsr,%fpiar,IFPCREGS(%a6)
-	
+
 	mov.w		&0x0000,%cc
 
 	fmovm.x		(%sp)+,%d0
@@ -797,7 +797,7 @@ fmovmx_2:
 
 	fmovm.l		%fpcr,%fpsr,%fpiar,IFPCREGS(%a6)
 	fmovm.x		&0xff,IFPREGS(%a6)
-	
+
 	mov.w		&0x0000,%cc
 
 	fmovm.x		%d0,-(%sp)
diff --git a/arch/m68k/ifpsp060/src/ilsp.S b/arch/m68k/ifpsp060/src/ilsp.S
index 43d220fc4..afa7422cd 100644
--- a/arch/m68k/ifpsp060/src/ilsp.S
+++ b/arch/m68k/ifpsp060/src/ilsp.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -27,7 +27,7 @@ No licenses are granted by implication, estoppel or otherwise under any patents
 or trademarks of Motorola, Inc.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # litop.s:
-# 	This file is appended to the top of the 060FPLSP package
+#	This file is appended to the top of the 060FPLSP package
 # and contains the entry points into the package. The user, in
 # effect, branches to one of the branch table entries located here.
 #
@@ -64,7 +64,7 @@ or trademarks of Motorola, Inc.
 #	_060LSP__idivs64_(): Emulate 64-bit signed div instruction.	#
 #									#
 #	This is the library version which is accessed as a subroutine	#
-# 	and therefore does not work exactly like the 680X0 div{s,u}.l	#
+#	and therefore does not work exactly like the 680X0 div{s,u}.l	#
 #	64-bit divide instruction.					#
 #									#
 # XREF ****************************************************************	#
@@ -75,17 +75,17 @@ or trademarks of Motorola, Inc.
 #	0x8(sp)  = hi(dividend)						#
 #	0xc(sp)  = lo(dividend)						#
 #	0x10(sp) = pointer to location to place quotient/remainder	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	0x10(sp) = points to location of remainder/quotient.		#
 #		   remainder is in first longword, quotient is in 2nd.	#
 #									#
 # ALGORITHM ***********************************************************	#
-#	If the operands are signed, make them unsigned and save the 	#
+#	If the operands are signed, make them unsigned and save the	#
 # sign info for later. Separate out special cases like divide-by-zero	#
 # or 32-bit divides if possible. Else, use a special math algorithm	#
 # to calculate the result.						#
-#	Restore sign info if signed instruction. Set the condition 	#
+#	Restore sign info if signed instruction. Set the condition	#
 # codes before performing the final "rts". If the divisor was equal to	#
 # zero, then perform a divide-by-zero using a 16-bit implemented	#
 # divide instruction. This way, the operating system can record that	#
@@ -135,8 +135,8 @@ ldiv64_cont:
 
 	beq.w		ldiv64eq0		# divisor is = 0!!!
 
-	mov.l		0xc(%a6), %d5 		# get dividend hi
-	mov.l		0x10(%a6), %d6 		# get dividend lo
+	mov.l		0xc(%a6), %d5		# get dividend hi
+	mov.l		0x10(%a6), %d6		# get dividend lo
 
 # separate signed and unsigned divide
 	tst.b		POSNEG(%a6)		# signed or unsigned?
@@ -161,7 +161,7 @@ ldsgndividend:
 	negx.l		%d5
 
 # extract some special cases:
-# 	- is (dividend == 0) ?
+#	- is (dividend == 0) ?
 #	- is (hi(dividend) == 0 && (divisor <= lo(dividend))) ? (32-bit div)
 ldspecialcases:
 	tst.l		%d5			# is (hi(dividend) == 0)
@@ -170,7 +170,7 @@ ldspecialcases:
 	tst.l		%d6			# is (lo(dividend) == 0), too
 	beq.w		lddone			# yes, so (dividend == 0)
 
-	cmp.l	 	%d7,%d6			# is (divisor <= lo(dividend))
+	cmp.l		%d7,%d6			# is (divisor <= lo(dividend))
 	bls.b		ld32bitdivide		# yes, so use 32 bit divide
 
 	exg		%d5,%d6			# q = 0, r = dividend
@@ -183,7 +183,7 @@ ld32bitdivide:
 
 ldnormaldivide:
 # last special case:
-# 	- is hi(dividend) >= divisor ? if yes, then overflow
+#	- is hi(dividend) >= divisor ? if yes, then overflow
 	cmp.l		%d7,%d5
 	bls.b		lddovf			# answer won't fit in 32 bits
 
@@ -196,7 +196,7 @@ ldivfinish:
 	beq.b		lddone			# divu has no processing!!!
 
 # it was a divs.l, so ccode setting is a little more complicated...
-	tst.b		NDIVIDEND(%a6)		# remainder has same sign 
+	tst.b		NDIVIDEND(%a6)		# remainder has same sign
 	beq.b		ldcc			# as dividend.
 	neg.l		%d5			# sgn(rem) = sgn(dividend)
 ldcc:
@@ -240,8 +240,8 @@ ldexit:
 
 # the result should be the unchanged dividend
 lddovf:
-	mov.l		0xc(%a6), %d5 		# get dividend hi
-	mov.l		0x10(%a6), %d6 		# get dividend lo
+	mov.l		0xc(%a6), %d5		# get dividend hi
+	mov.l		0x10(%a6), %d6		# get dividend lo
 
 	andi.w		&0x1c,DIV64_CC(%a6)
 	ori.w		&0x02,DIV64_CC(%a6)	# set 'V' ccode bit
@@ -271,8 +271,8 @@ ldiv64eq0:
 # For this implementation b=2**16, and the target is U1U2U3U4/V1V2,	#
 # where U,V are words of the quadword dividend and longword divisor,	#
 # and U1, V1 are the most significant words.				#
-# 									#
-# The most sig. longword of the 64 bit dividend must be in %d5, least 	#
+#									#
+# The most sig. longword of the 64 bit dividend must be in %d5, least	#
 # in %d6. The divisor must be in the variable ddivisor, and the		#
 # signed/unsigned flag ddusign must be set (0=unsigned,1=signed).	#
 # The quotient is returned in %d6, remainder in %d5, unless the		#
@@ -292,7 +292,7 @@ ldclassical:
 # dividing the divisor word into each dividend word. In this case,
 # the first two quotient words must be zero, or overflow would occur.
 # Since we already checked this case above, we can treat the most significant
-# longword of the dividend as (0) remainder (see Knuth) and merely complete 
+# longword of the dividend as (0) remainder (see Knuth) and merely complete
 # the last two divisions to get a quotient longword and word remainder:
 
 	clr.l		%d1
@@ -328,12 +328,12 @@ lddknuth:
 	clr.b		DDSECOND(%a6)		# clear flag for quotient digits
 	clr.l		%d1			# %d1 will hold trial quotient
 lddnchk:
-	btst		&31, %d7		# must we normalize? first word of 
+	btst		&31, %d7		# must we normalize? first word of
 	bne.b		lddnormalized		# divisor (V1) must be >= 65536/2
 	addq.l		&0x1, DDNORMAL(%a6)	# count normalization shifts
 	lsl.l		&0x1, %d7		# shift the divisor
 	lsl.l		&0x1, %d6		# shift u4,u3 with overflow to u2
-	roxl.l		&0x1, %d5		# shift u1,u2 
+	roxl.l		&0x1, %d5		# shift u1,u2
 	bra.w		lddnchk
 lddnormalized:
 
@@ -343,12 +343,12 @@ lddnormalized:
 	mov.l		%d5, %d2		# dividend mslw
 	swap		%d2
 	swap		%d3
-	cmp.w	 	%d2, %d3		# V1 = U1 ?
+	cmp.w		%d2, %d3		# V1 = U1 ?
 	bne.b		lddqcalc1
 	mov.w		&0xffff, %d1		# use max trial quotient word
 	bra.b		lddadj0
 lddqcalc1:
-	mov.l		%d5, %d1		
+	mov.l		%d5, %d1
 
 	divu.w		%d3, %d1		# use quotient of mslw/msw
 
@@ -379,7 +379,7 @@ lddadj1: mov.l		%d7, %d3
 
 #	add.l		%d6, %d4		# (U1U2 - V1q) + U3
 
-	cmp.l	 	%d2, %d4
+	cmp.l		%d2, %d4
 	bls.b		lddadjd1		# is V2q > (U1U2-V1q) + U3 ?
 	subq.l		&0x1, %d1		# yes, decrement and recheck
 	bra.b		lddadj1
@@ -416,7 +416,7 @@ ldd2nd:
 	tst.b		DDSECOND(%a6)	# both q words done?
 	bne.b		lddremain
 # first quotient digit now correct. store digit and shift the
-# (subtracted) dividend 
+# (subtracted) dividend
 	mov.w		%d1, DDQUOTIENT(%a6)
 	clr.l		%d1
 	swap		%d5
@@ -427,7 +427,7 @@ ldd2nd:
 	bra.w		lddnormalized
 lddremain:
 # add 2nd word to quotient, get the remainder.
-	mov.w 		%d1, DDQUOTIENT+2(%a6)
+	mov.w		%d1, DDQUOTIENT+2(%a6)
 # shift down one word/digit to renormalize remainder.
 	mov.w		%d5, %d6
 	swap		%d6
@@ -441,7 +441,7 @@ lddnlp:
 	dbf		%d7, lddnlp
 lddrn:
 	mov.l		%d6, %d5		# remainder
-	mov.l		DDQUOTIENT(%a6), %d6 	# quotient
+	mov.l		DDQUOTIENT(%a6), %d6	# quotient
 
 	rts
 ldmm2:
@@ -471,7 +471,7 @@ ldmm2:
 	clr.w		%d2			# lsw of two mixed products used,
 	swap		%d5			# now use msws of longwords
 	swap		%d2
-	add.l		%d2, %d5				
+	add.l		%d2, %d5
 	add.l		%d3, %d5	# %d5 now ms 32 bits of final product
 	rts
 
@@ -491,7 +491,7 @@ ldmm2:
 #	0x4(sp) = multiplier						#
 #	0x8(sp) = multiplicand						#
 #	0xc(sp) = pointer to location to place 64-bit result		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	0xc(sp) = points to location of 64-bit result			#
 #									#
@@ -524,9 +524,9 @@ _060LSP__imulu64_:
 
 #########################################################################
 #	63			   32				0	#
-# 	----------------------------					#
-# 	| hi(mplier) * hi(mplicand)|					#
-# 	----------------------------					#
+#	----------------------------					#
+#	| hi(mplier) * hi(mplicand)|					#
+#	----------------------------					#
 #		     -----------------------------			#
 #		     | hi(mplier) * lo(mplicand) |			#
 #		     -----------------------------			#
@@ -589,7 +589,7 @@ mulu64_ddone:
 # the values at the location pointed to by a0.
 # use movm here to not disturb the condition codes.
 mulu64_end:
-	exg		%d1,%d0		
+	exg		%d1,%d0
 	movm.l		&0x0003,([0x10,%a6])		# save result
 
 # EPILOGUE BEGIN ########################################################
@@ -643,16 +643,16 @@ _060LSP__imuls64_:
 # the result sign is the exclusive or of the operand sign bits.
 muls64_chk_md_sgn:
 	tst.l		%d1			# is multiplicand negative?
-	bge.b		muls64_alg		# no	
+	bge.b		muls64_alg		# no
 	neg.l		%d1			# make multiplicand positive
 
 	eori.b		&0x1,%d5		# calculate correct sign
 
 #########################################################################
 #	63			   32				0	#
-# 	----------------------------					#
-# 	| hi(mplier) * hi(mplicand)|					#
-# 	----------------------------					#
+#	----------------------------					#
+#	| hi(mplier) * hi(mplicand)|					#
+#	----------------------------					#
 #		     -----------------------------			#
 #		     | hi(mplier) * lo(mplicand) |			#
 #		     -----------------------------			#
@@ -726,7 +726,7 @@ muls64_ddone:
 # the values at the location pointed to by a0.
 # use movm here to not disturb the condition codes.
 muls64_end:
-	exg		%d1,%d0		
+	exg		%d1,%d0
 	movm.l		&0x0003,([0x10,%a6])	# save result at (a0)
 
 # EPILOGUE BEGIN ########################################################
@@ -769,12 +769,12 @@ muls64_zero:
 # INPUT ***************************************************************	#
 #	0x4(sp) = Rn							#
 #	0x8(sp) = pointer to boundary pair				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	cc = condition codes are set correctly				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	In the interest of simplicity, all operands are converted to	#
+#	In the interest of simplicity, all operands are converted to	#
 # longword size whether the operation is byte, word, or long. The	#
 # bounds are sign extended accordingly. If Rn is a data regsiter, Rn is #
 # also sign extended. If Rn is an address register, it need not be sign #
@@ -785,7 +785,7 @@ muls64_zero:
 
 set	CMP2_CC,	-4
 
-	global 		_060LSP__cmp2_Ab_
+	global		_060LSP__cmp2_Ab_
 _060LSP__cmp2_Ab_:
 
 # PROLOGUE BEGIN ########################################################
@@ -795,7 +795,7 @@ _060LSP__cmp2_Ab_:
 # PROLOGUE END ##########################################################
 
 	mov.w		%cc,CMP2_CC(%a6)
-	mov.l		0x8(%a6), %d2 		# get regval
+	mov.l		0x8(%a6), %d2		# get regval
 
 	mov.b		([0xc,%a6],0x0),%d0
 	mov.b		([0xc,%a6],0x1),%d1
@@ -804,7 +804,7 @@ _060LSP__cmp2_Ab_:
 	extb.l		%d1			# sign extend hi bnd
 	bra.w		l_cmp2_cmp		# go do the compare emulation
 
-	global 		_060LSP__cmp2_Aw_
+	global		_060LSP__cmp2_Aw_
 _060LSP__cmp2_Aw_:
 
 # PROLOGUE BEGIN ########################################################
@@ -814,7 +814,7 @@ _060LSP__cmp2_Aw_:
 # PROLOGUE END ##########################################################
 
 	mov.w		%cc,CMP2_CC(%a6)
-	mov.l		0x8(%a6), %d2 		# get regval
+	mov.l		0x8(%a6), %d2		# get regval
 
 	mov.w		([0xc,%a6],0x0),%d0
 	mov.w		([0xc,%a6],0x2),%d1
@@ -823,7 +823,7 @@ _060LSP__cmp2_Aw_:
 	ext.l		%d1			# sign extend hi bnd
 	bra.w		l_cmp2_cmp		# go do the compare emulation
 
-	global 		_060LSP__cmp2_Al_
+	global		_060LSP__cmp2_Al_
 _060LSP__cmp2_Al_:
 
 # PROLOGUE BEGIN ########################################################
@@ -833,13 +833,13 @@ _060LSP__cmp2_Al_:
 # PROLOGUE END ##########################################################
 
 	mov.w		%cc,CMP2_CC(%a6)
-	mov.l		0x8(%a6), %d2 		# get regval
+	mov.l		0x8(%a6), %d2		# get regval
 
 	mov.l		([0xc,%a6],0x0),%d0
 	mov.l		([0xc,%a6],0x4),%d1
 	bra.w		l_cmp2_cmp		# go do the compare emulation
 
-	global 		_060LSP__cmp2_Db_
+	global		_060LSP__cmp2_Db_
 _060LSP__cmp2_Db_:
 
 # PROLOGUE BEGIN ########################################################
@@ -849,7 +849,7 @@ _060LSP__cmp2_Db_:
 # PROLOGUE END ##########################################################
 
 	mov.w		%cc,CMP2_CC(%a6)
-	mov.l		0x8(%a6), %d2 		# get regval
+	mov.l		0x8(%a6), %d2		# get regval
 
 	mov.b		([0xc,%a6],0x0),%d0
 	mov.b		([0xc,%a6],0x1),%d1
@@ -862,7 +862,7 @@ _060LSP__cmp2_Db_:
 	extb.l		%d2			# sign extend data byte
 	bra.w		l_cmp2_cmp		# go do the compare emulation
 
-	global 		_060LSP__cmp2_Dw_
+	global		_060LSP__cmp2_Dw_
 _060LSP__cmp2_Dw_:
 
 # PROLOGUE BEGIN ########################################################
@@ -872,7 +872,7 @@ _060LSP__cmp2_Dw_:
 # PROLOGUE END ##########################################################
 
 	mov.w		%cc,CMP2_CC(%a6)
-	mov.l		0x8(%a6), %d2 		# get regval
+	mov.l		0x8(%a6), %d2		# get regval
 
 	mov.w		([0xc,%a6],0x0),%d0
 	mov.w		([0xc,%a6],0x2),%d1
@@ -885,7 +885,7 @@ _060LSP__cmp2_Dw_:
 	ext.l		%d2			# sign extend data word
 	bra.w		l_cmp2_cmp		# go emulate compare
 
-	global 		_060LSP__cmp2_Dl_
+	global		_060LSP__cmp2_Dl_
 _060LSP__cmp2_Dl_:
 
 # PROLOGUE BEGIN ########################################################
@@ -895,14 +895,14 @@ _060LSP__cmp2_Dl_:
 # PROLOGUE END ##########################################################
 
 	mov.w		%cc,CMP2_CC(%a6)
-	mov.l		0x8(%a6), %d2 		# get regval
+	mov.l		0x8(%a6), %d2		# get regval
 
 	mov.l		([0xc,%a6],0x0),%d0
 	mov.l		([0xc,%a6],0x4),%d1
 
 #
 # To set the ccodes correctly:
-# 	(1) save 'Z' bit from (Rn - lo)
+#	(1) save 'Z' bit from (Rn - lo)
 #	(2) save 'Z' and 'N' bits from ((hi - lo) - (Rn - hi))
 #	(3) keep 'X', 'N', and 'V' from before instruction
 #	(4) combine ccodes
@@ -912,7 +912,7 @@ l_cmp2_cmp:
 	mov.w		%cc, %d3		# fetch resulting ccodes
 	andi.b		&0x4, %d3		# keep 'Z' bit
 	sub.l		%d0, %d1		# (hi - lo)
-	cmp.l	 	%d1,%d2			# ((hi - lo) - (Rn - hi))
+	cmp.l		%d1,%d2			# ((hi - lo) - (Rn - hi))
 
 	mov.w		%cc, %d4		# fetch resulting ccodes
 	or.b		%d4, %d3		# combine w/ earlier ccodes
diff --git a/arch/m68k/ifpsp060/src/isp.S b/arch/m68k/ifpsp060/src/isp.S
index 5a1e6fdc5..b269091d9 100644
--- a/arch/m68k/ifpsp060/src/isp.S
+++ b/arch/m68k/ifpsp060/src/isp.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -322,21 +322,21 @@ set immed_bit,		0x7			# immediate data bit
 # Misc. #
 #########
 set BYTE,		1			# len(byte) == 1 byte
-set WORD, 		2			# len(word) == 2 bytes
-set LONG, 		4			# len(longword) == 4 bytes
+set WORD,		2			# len(word) == 2 bytes
+set LONG,		4			# len(longword) == 4 bytes
 
 #########################################################################
 # XDEF ****************************************************************	#
 #	_isp_unimp(): 060ISP entry point for Unimplemented Instruction	#
 #									#
-#	This handler should be the first code executed upon taking the 	#
-# 	"Unimplemented Integer Instruction" exception in an operating	#
+#	This handler should be the first code executed upon taking the	#
+#	"Unimplemented Integer Instruction" exception in an operating	#
 #	system.								#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_{word,long}() - read instruction word/longword	#
 #	_mul64() - emulate 64-bit multiply				#
-# 	_div64() - emulate 64-bit divide				#
+#	_div64() - emulate 64-bit divide				#
 #	_moveperipheral() - emulate "movep"				#
 #	_compandset() - emulate misaligned "cas"			#
 #	_compandset2() - emulate "cas2"					#
@@ -349,7 +349,7 @@ set LONG, 		4			# len(longword) == 4 bytes
 #									#
 # INPUT ***************************************************************	#
 #	- The system stack contains the Unimp Int Instr stack frame	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If Trace exception:						#
 #	- The system stack changed to contain Trace exc stack frame	#
@@ -366,8 +366,8 @@ set LONG, 		4			# len(longword) == 4 bytes
 #	This handler fetches the first instruction longword from	#
 # memory and decodes it to determine which of the unimplemented		#
 # integer instructions caused this exception. This handler then calls	#
-# one of _mul64(), _div64(), _moveperipheral(), _compandset(), 		#
-# _compandset2(), or _chk2_cmp2() as appropriate. 			#
+# one of _mul64(), _div64(), _moveperipheral(), _compandset(),		#
+# _compandset2(), or _chk2_cmp2() as appropriate.			#
 #	Some of these instructions, by their nature, may produce other	#
 # types of exceptions. "div" can produce a divide-by-zero exception,	#
 # and "chk2" can cause a "Chk" exception. In both cases, the current	#
@@ -375,7 +375,7 @@ set LONG, 		4			# len(longword) == 4 bytes
 # of the correct exception type and an exit must be made through	#
 # _real_divbyzero() or _real_chk() as appropriate. In addition, all	#
 # instructions may be executing while Trace is enabled. If so, then	#
-# a Trace exception stack frame must be created and an exit made 	#
+# a Trace exception stack frame must be created and an exit made	#
 # through _real_trace().						#
 #	Meanwhile, if any read or write to memory using the		#
 # _mem_{read,write}() "callout"s returns a failing value, then an	#
@@ -384,19 +384,19 @@ set LONG, 		4			# len(longword) == 4 bytes
 #	If none of these occur, then a normal exit is made through	#
 # _isp_done().								#
 #									#
-#	This handler, upon entry, saves almost all user-visible 	#
+#	This handler, upon entry, saves almost all user-visible		#
 # address and data registers to the stack. Although this may seem to	#
 # cause excess memory traffic, it was found that due to having to	#
 # access these register files for things like data retrieval and <ea>	#
 # calculations, it was more efficient to have them on the stack where	#
-# they could be accessed by indexing rather than to make subroutine 	#
-# calls to retrieve a register of a particular index. 			#
+# they could be accessed by indexing rather than to make subroutine	#
+# calls to retrieve a register of a particular index.			#
 #									#
 #########################################################################
 
 	global		_isp_unimp
 _isp_unimp:
-	link.w 		%a6,&-LOCAL_SIZE	# create room for stack frame
+	link.w		%a6,&-LOCAL_SIZE	# create room for stack frame
 
 	movm.l		&0x3fff,EXC_DREGS(%a6)	# store d0-d7/a0-a5
 	mov.l		(%a6),EXC_A6(%a6)	# store a6
@@ -428,9 +428,9 @@ uieh_cont:
 	bsr.l		_imem_read_long		# fetch opword & extword
 	mov.l		%d0,EXC_OPWORD(%a6)	# store extword on stack
 
-	
+
 #########################################################################
-# muls.l	0100 1100 00 |<ea>|	0*** 1100 0000 0*** 		#
+# muls.l	0100 1100 00 |<ea>|	0*** 1100 0000 0***		#
 # mulu.l	0100 1100 00 |<ea>|	0*** 0100 0000 0***		#
 #									#
 # divs.l	0100 1100 01 |<ea>|	0*** 1100 0000 0***		#
@@ -514,7 +514,7 @@ uieh_div64_a7:
 	tst.b		EXC_ISR(%a6)		# no; is trace enabled?
 	bmi.w		uieh_trace_a7		# yes
 	bra.w		uieh_a7			# no
-	
+
 #
 # now, w/ group2, make movep's decode the fastest since it will
 # most likely be used the most.
@@ -532,7 +532,7 @@ uieh_not_movep:
 	beq.b		uieh_chk2cmp2		# go handle chk2,cmp2
 
 	swap		%d0			# put opword in lo word
-	cmpi.b	 	%d0,&0xfc		# test for cas2
+	cmpi.b		%d0,&0xfc		# test for cas2
 	beq.b		uieh_cas2		# go handle cas2
 
 uieh_cas:
@@ -585,7 +585,7 @@ uieh_done:
 	mov.l		%a0,%usp		# restore it
 
 uieh_finish:
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 
 	btst		&0x7,EXC_ISR(%a6)	# is trace mode on?
 	bne.b		uieh_trace		# yes;go handle trace mode
@@ -596,7 +596,7 @@ uieh_finish:
 	bra.l		_isp_done
 
 #
-# The instruction that was just emulated was also being traced. The trace 
+# The instruction that was just emulated was also being traced. The trace
 # trap for this instruction will be lost unless we jump to the trace handler.
 # So, here we create a Trace Exception format number two exception stack
 # frame from the Unimplemented Integer Intruction Exception stack frame
@@ -607,11 +607,11 @@ uieh_finish:
 #		* 0x0 *  0x0f4	*	*    Current	*
 #		*****************	*      PC	*
 #		*    Current	*	*****************
-#		*      PC 	*	* 0x2 *  0x024	*
+#		*      PC	*	* 0x2 *  0x024	*
 #		*****************	*****************
 #		*      SR	*	*     Next	*
 #		*****************	*      PC	*
-#	      ->*     Old   	*	*****************
+#	      ->*     Old	*	*****************
 #  from link -->*      A6	*	*      SR	*
 #	        *****************	*****************
 #	       /*      A7	*	*      New	* <-- for final unlink
@@ -651,7 +651,7 @@ uieh_trace:
 #
 uieh_chk_trap:
 	mov.b		EXC_CC+1(%a6),EXC_ISR+1(%a6) # insert new ccodes
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 
 	mov.w		EXC_ISR(%a6),(%a6)	# put new SR on stack
 	mov.l		EXC_IPC(%a6),0x8(%a6)	# put "Current PC" on stack
@@ -678,14 +678,14 @@ uieh_chk_trap:
 #				*****************
 #				    (6 words)
 #
-# the divide instruction should take an integer divide by zero trap. so, here 
-# we must create a divbyzero stack frame from an unimplemented integer 
-# instruction exception frame and jump to the user supplied entry point 
+# the divide instruction should take an integer divide by zero trap. so, here
+# we must create a divbyzero stack frame from an unimplemented integer
+# instruction exception frame and jump to the user supplied entry point
 # "_real_divbyzero()".
 #
 uieh_divbyzero:
 	mov.b		EXC_CC+1(%a6),EXC_ISR+1(%a6) # insert new ccodes
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 
 	mov.w		EXC_ISR(%a6),(%a6)	# put new SR on stack
 	mov.l		EXC_IPC(%a6),0x8(%a6)	# put "Current PC" on stack
@@ -712,9 +712,9 @@ uieh_divbyzero:
 #	*****************	*****************
 #	    (4 words)		    (6 words)
 #
-# the divide instruction should take an integer divide by zero trap. so, here 
-# we must create a divbyzero stack frame from an unimplemented integer 
-# instruction exception frame and jump to the user supplied entry point 
+# the divide instruction should take an integer divide by zero trap. so, here
+# we must create a divbyzero stack frame from an unimplemented integer
+# instruction exception frame and jump to the user supplied entry point
 # "_real_divbyzero()".
 #
 # However, we must also deal with the fact that (a7)+ was used from supervisor
@@ -722,7 +722,7 @@ uieh_divbyzero:
 #
 uieh_divbyzero_a7:
 	mov.b		EXC_CC+1(%a6),EXC_ISR+1(%a6) # insert new ccodes
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 
 	mov.l		EXC_IPC(%a6),0xc(%a6)	# put "Current PC" on stack
 	mov.w		&0x2014,0xa(%a6)	# put Vector Offset on stack
@@ -748,8 +748,8 @@ uieh_divbyzero_a7:
 #	*****************	*****************
 #	    (4 words)		    (6 words)
 #
-# 
-# The instruction that was just emulated was also being traced. The trace 
+#
+# The instruction that was just emulated was also being traced. The trace
 # trap for this instruction will be lost unless we jump to the trace handler.
 # So, here we create a Trace Exception format number two exception stack
 # frame from the Unimplemented Integer Intruction Exception stack frame
@@ -760,7 +760,7 @@ uieh_divbyzero_a7:
 #
 uieh_trace_a7:
 	mov.b		EXC_CC+1(%a6),EXC_ISR+1(%a6) # insert new ccodes
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 
 	mov.l		EXC_IPC(%a6),0xc(%a6)	# put "Current PC" on stack
 	mov.w		&0x2024,0xa(%a6)	# put Vector Offset on stack
@@ -772,12 +772,12 @@ uieh_trace_a7:
 	bra.l		_real_trace
 
 #
-#				   UIEH FRAME	
+#				   UIEH FRAME
 #				*****************
 #				* 0x0 * 0x0f4	*
 #	   UIEH FRAME		*****************
 #	*****************	*     Next	*
-#	* 0x0 *  0x0f4	*	*      PC	*	
+#	* 0x0 *  0x0f4	*	*      PC	*
 #	*****************	*****************
 #	*    Current	*	*      SR	*
 #	*      PC	*	*****************
@@ -787,7 +787,7 @@ uieh_trace_a7:
 #	    (4 words)
 uieh_a7:
 	mov.b		EXC_CC+1(%a6),EXC_ISR+1(%a6) # insert new ccodes
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 
 	mov.w		&0x00f4,0xe(%a6)	# put Vector Offset on stack
 	mov.l		EXC_EXTWPTR(%a6),0xa(%a6) # put "Next PC" on stack
@@ -803,11 +803,11 @@ uieh_a7:
 # a0 = failing address
 # d0 = fslw
 isp_dacc:
-	mov.l		%a0,(%a6)		# save address	
+	mov.l		%a0,(%a6)		# save address
 	mov.l		%d0,-0x4(%a6)		# save partial fslw
 
 	lea		-64(%a6),%sp
-	movm.l		(%sp)+,&0x7fff 		# restore d0-d7/a0-a6
+	movm.l		(%sp)+,&0x7fff		# restore d0-d7/a0-a6
 
 	mov.l		0xc(%sp),-(%sp)		# move voff,hi(pc)
 	mov.l		0x4(%sp),0x10(%sp)	# store fslw
@@ -822,11 +822,11 @@ isp_dacc:
 # FSLW:
 #	misaligned = true
 #	read = true
-# 	size = word
-# 	instruction = true
-# 	software emulation error = true
+#	size = word
+#	instruction = true
+#	software emulation error = true
 isp_iacc:
-	movm.l		EXC_DREGS(%a6),&0x3fff 	# restore d0-d7/a0-a5
+	movm.l		EXC_DREGS(%a6),&0x3fff	# restore d0-d7/a0-a5
 	unlk		%a6			# unlink frame
 	sub.w		&0x8,%sp		# make room for acc frame
 	mov.l		0x8(%sp),(%sp)		# store sr,lo(pc)
@@ -840,7 +840,7 @@ isp_acc_exit:
 	beq.b		isp_acc_exit2		# user
 	bset		&0x2,0xd(%sp)		# set supervisor TM bit
 isp_acc_exit2:
-	bra.l		_real_access		
+	bra.l		_real_access
 
 # if the addressing mode was (an)+ or -(an), the address register must
 # be restored to its pre-exception value before entering _real_access.
@@ -858,14 +858,14 @@ isp_restore_done:
 #	_calc_ea(): routine to calculate effective address		#
 #									#
 # XREF ****************************************************************	#
-# 	_imem_read_word() - read instruction word			#
-# 	_imem_read_long() - read instruction longword			#
-# 	_dmem_read_long() - read data longword (for memory indirect)	#
-# 	isp_iacc() - handle instruction access error exception		#
+#	_imem_read_word() - read instruction word			#
+#	_imem_read_long() - read instruction longword			#
+#	_dmem_read_long() - read data longword (for memory indirect)	#
+#	isp_iacc() - handle instruction access error exception		#
 #	isp_dacc() - handle data access error exception			#
 #									#
 # INPUT ***************************************************************	#
-# 	d0 = number of bytes related to effective address (w,l)		#
+#	d0 = number of bytes related to effective address (w,l)		#
 #									#
 # OUTPUT **************************************************************	#
 #	If exiting through isp_dacc...					#
@@ -877,22 +877,22 @@ isp_restore_done:
 #		a0 = effective address					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	The effective address type is decoded from the opword residing	#
-# on the stack. A jump table is used to vector to a routine for the 	#
+#	The effective address type is decoded from the opword residing	#
+# on the stack. A jump table is used to vector to a routine for the	#
 # appropriate mode. Since none of the emulated integer instructions	#
 # uses byte-sized operands, only handle word and long operations.	#
 #									#
-# 	Dn,An	- shouldn't enter here					#
+#	Dn,An	- shouldn't enter here					#
 #	(An)	- fetch An value from stack				#
-# 	-(An)	- fetch An value from stack; return decr value;		#
+#	-(An)	- fetch An value from stack; return decr value;		#
 #		  place decr value on stack; store old value in case of	#
-#		  future access error; if -(a7), set mda7_flg in 	#
+#		  future access error; if -(a7), set mda7_flg in	#
 #		  SPCOND_FLG						#
 #	(An)+	- fetch An value from stack; return value;		#
 #		  place incr value on stack; store old value in case of	#
 #		  future access error; if (a7)+, set mia7_flg in	#
 #		  SPCOND_FLG						#
-#	(d16,An) - fetch An value from stack; read d16 using 		#
+#	(d16,An) - fetch An value from stack; read d16 using		#
 #		  _imem_read_word(); fetch may fail -> branch to	#
 #		  isp_iacc()						#
 #	(xxx).w,(xxx).l - use _imem_read_{word,long}() to fetch		#
@@ -904,7 +904,7 @@ isp_restore_done:
 #		  isp_iacc()						#
 #	everything else - read needed displacements as appropriate w/	#
 #		  _imem_read_{word,long}(); read may fail; if memory	#
-# 		  indirect, read indirect address using			#
+#		  indirect, read indirect address using			#
 #		  _dmem_read_long() which may also fail			#
 #									#
 #########################################################################
@@ -944,59 +944,59 @@ tbl_ea_mode:
 	short		tbl_ea_mode	-	tbl_ea_mode
 	short		tbl_ea_mode	-	tbl_ea_mode
 
-	short		addr_ind_a0	- 	tbl_ea_mode
-	short		addr_ind_a1	- 	tbl_ea_mode
-	short		addr_ind_a2	- 	tbl_ea_mode
-	short		addr_ind_a3 	- 	tbl_ea_mode
-	short		addr_ind_a4 	- 	tbl_ea_mode
-	short		addr_ind_a5 	- 	tbl_ea_mode
-	short		addr_ind_a6 	- 	tbl_ea_mode
-	short		addr_ind_a7 	- 	tbl_ea_mode
-
-	short		addr_ind_p_a0	- 	tbl_ea_mode
-	short		addr_ind_p_a1 	- 	tbl_ea_mode
-	short		addr_ind_p_a2 	- 	tbl_ea_mode
-	short		addr_ind_p_a3 	- 	tbl_ea_mode
-	short		addr_ind_p_a4 	- 	tbl_ea_mode
-	short		addr_ind_p_a5 	- 	tbl_ea_mode
-	short		addr_ind_p_a6 	- 	tbl_ea_mode
-	short		addr_ind_p_a7 	- 	tbl_ea_mode
-
-	short		addr_ind_m_a0 		- 	tbl_ea_mode
-	short		addr_ind_m_a1 		- 	tbl_ea_mode
-	short		addr_ind_m_a2 		- 	tbl_ea_mode
-	short		addr_ind_m_a3 		- 	tbl_ea_mode
-	short		addr_ind_m_a4 		- 	tbl_ea_mode
-	short		addr_ind_m_a5 		- 	tbl_ea_mode
-	short		addr_ind_m_a6 		- 	tbl_ea_mode
-	short		addr_ind_m_a7 		- 	tbl_ea_mode
-
-	short		addr_ind_disp_a0	- 	tbl_ea_mode
-	short		addr_ind_disp_a1 	- 	tbl_ea_mode
-	short		addr_ind_disp_a2 	- 	tbl_ea_mode
-	short		addr_ind_disp_a3 	- 	tbl_ea_mode
-	short		addr_ind_disp_a4 	- 	tbl_ea_mode
-	short		addr_ind_disp_a5 	- 	tbl_ea_mode
-	short		addr_ind_disp_a6 	- 	tbl_ea_mode
+	short		addr_ind_a0	-	tbl_ea_mode
+	short		addr_ind_a1	-	tbl_ea_mode
+	short		addr_ind_a2	-	tbl_ea_mode
+	short		addr_ind_a3	-	tbl_ea_mode
+	short		addr_ind_a4	-	tbl_ea_mode
+	short		addr_ind_a5	-	tbl_ea_mode
+	short		addr_ind_a6	-	tbl_ea_mode
+	short		addr_ind_a7	-	tbl_ea_mode
+
+	short		addr_ind_p_a0	-	tbl_ea_mode
+	short		addr_ind_p_a1	-	tbl_ea_mode
+	short		addr_ind_p_a2	-	tbl_ea_mode
+	short		addr_ind_p_a3	-	tbl_ea_mode
+	short		addr_ind_p_a4	-	tbl_ea_mode
+	short		addr_ind_p_a5	-	tbl_ea_mode
+	short		addr_ind_p_a6	-	tbl_ea_mode
+	short		addr_ind_p_a7	-	tbl_ea_mode
+
+	short		addr_ind_m_a0		-	tbl_ea_mode
+	short		addr_ind_m_a1		-	tbl_ea_mode
+	short		addr_ind_m_a2		-	tbl_ea_mode
+	short		addr_ind_m_a3		-	tbl_ea_mode
+	short		addr_ind_m_a4		-	tbl_ea_mode
+	short		addr_ind_m_a5		-	tbl_ea_mode
+	short		addr_ind_m_a6		-	tbl_ea_mode
+	short		addr_ind_m_a7		-	tbl_ea_mode
+
+	short		addr_ind_disp_a0	-	tbl_ea_mode
+	short		addr_ind_disp_a1	-	tbl_ea_mode
+	short		addr_ind_disp_a2	-	tbl_ea_mode
+	short		addr_ind_disp_a3	-	tbl_ea_mode
+	short		addr_ind_disp_a4	-	tbl_ea_mode
+	short		addr_ind_disp_a5	-	tbl_ea_mode
+	short		addr_ind_disp_a6	-	tbl_ea_mode
 	short		addr_ind_disp_a7	-	tbl_ea_mode
 
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-	short		_addr_ind_ext 		- 	tbl_ea_mode
-
-	short		abs_short		- 	tbl_ea_mode
-	short		abs_long		- 	tbl_ea_mode
-	short		pc_ind			- 	tbl_ea_mode
-	short		pc_ind_ext		- 	tbl_ea_mode
-	short		immediate		- 	tbl_ea_mode
-	short		tbl_ea_mode		- 	tbl_ea_mode
-	short		tbl_ea_mode		- 	tbl_ea_mode
-	short		tbl_ea_mode		- 	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+	short		_addr_ind_ext		-	tbl_ea_mode
+
+	short		abs_short		-	tbl_ea_mode
+	short		abs_long		-	tbl_ea_mode
+	short		pc_ind			-	tbl_ea_mode
+	short		pc_ind_ext		-	tbl_ea_mode
+	short		immediate		-	tbl_ea_mode
+	short		tbl_ea_mode		-	tbl_ea_mode
+	short		tbl_ea_mode		-	tbl_ea_mode
+	short		tbl_ea_mode		-	tbl_ea_mode
 
 ###################################
 # Address register indirect: (An) #
@@ -1041,7 +1041,7 @@ addr_ind_p_a0:
 	mov.l		EXC_A0(%a6),%a0		# load current value
 	add.l		%a0,%d0			# increment
 	mov.l		%d0,EXC_A0(%a6)		# save incremented value
-	
+
 	mov.l		%a0,EXC_SAVVAL(%a6)	# save in case of access error
 	mov.b		&0x0,EXC_SAVREG(%a6)	# save regno, too
 	mov.b		&restore_flg,SPCOND_FLG(%a6) # set flag
@@ -1339,7 +1339,7 @@ _addr_ind_ext:
 	mov.l		%a0,%d3			# put base in d3
 
 	bra.l		calc_mem_ind		# calc memory indirect
-	
+
 addr_ind_index_8bit:
 	mov.l		%d2,-(%sp)		# save old d2
 
@@ -1370,8 +1370,8 @@ aii8_long:
 # Immediate: #<data> #
 #########################################################################
 # word, long: <ea> of the data is the current extension word		#
-# 	pointer value. new extension word pointer is simply the old	#
-# 	plus the number of bytes in the data type(2 or 4).		#
+#	pointer value. new extension word pointer is simply the old	#
+#	plus the number of bytes in the data type(2 or 4).		#
 #########################################################################
 immediate:
 	mov.b		&immed_flg,SPCOND_FLG(%a6) # set immediate flag
@@ -1455,9 +1455,9 @@ pc_ind_ext:
 	mov.l		%a0,%d3			# put base in d3
 
 	bra.l		calc_mem_ind		# calc memory indirect
-	
+
 pc_ind_index_8bit:
- 	mov.l		%d2,-(%sp)		# create a temp register
+	mov.l		%d2,-(%sp)		# create a temp register
 
 	mov.l		%d0,%d1			# make extword copy
 	rol.w		&0x4,%d1		# rotate reg num into place
@@ -1512,14 +1512,14 @@ base_supp_ck:
 no_base_sup:
 	bfextu		%d5{&26:&2},%d0	# get bd size
 #	beq.l		_error			# if (size == 0) it's reserved
-	cmpi.b	 	%d0,&2
+	cmpi.b		%d0,&2
 	blt.b		no_bd
 	beq.b		get_word_bd
 
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long
-	
+
 	tst.l		%d1			# ifetch error?
 	bne.l		isp_iacc		# yes
 
@@ -1533,16 +1533,16 @@ get_word_bd:
 	bne.l		isp_iacc		# yes
 
 	ext.l		%d0			# sign extend bd
-	
+
 chk_ind:
 	add.l		%d0,%d3			# base += bd
 no_bd:
 	bfextu		%d5{&30:&2},%d0		# is od suppressed?
 	beq.w		aii_bd
-	cmpi.b	 	%d0,&0x2
+	cmpi.b		%d0,&0x2
 	blt.b		null_od
 	beq.b		word_od
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long
@@ -1550,7 +1550,7 @@ no_bd:
 	tst.l		%d1			# ifetch error?
 	bne.l		isp_iacc		# yes
 
-	bra.b 		add_them
+	bra.b		add_them
 
 word_od:
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
@@ -1604,10 +1604,10 @@ done_ea:
 # must create an access error frame. here, we pass a skeleton fslw
 # and the failing address to the routine that creates the new frame.
 # FSLW:
-# 	read = true
-# 	size = longword
+#	read = true
+#	size = longword
 #	TM = data
-# 	software emulation error = true
+#	software emulation error = true
 calc_ea_err:
 	mov.l		%d3,%a0			# pass failing address
 	mov.l		&0x01010001,%d0		# pass fslw
@@ -1615,7 +1615,7 @@ calc_ea_err:
 
 #########################################################################
 # XDEF **************************************************************** #
-# 	_moveperipheral(): routine to emulate movep instruction		#
+#	_moveperipheral(): routine to emulate movep instruction		#
 #									#
 # XREF **************************************************************** #
 #	_dmem_read_byte() - read byte from memory			#
@@ -1647,7 +1647,7 @@ calc_ea_err:
 # movep.(w,l)	Dx,(d,Ay) #
 # movep.(w,l)	(d,Ay),Dx #
 ###########################
-	global 		_moveperipheral
+	global		_moveperipheral
 _moveperipheral:
 	mov.w		EXC_OPWORD(%a6),%d1	# fetch the opcode word
 
@@ -1793,11 +1793,11 @@ m2rltrans:
 	mov.b		EXC_OPWORD(%a6),%d1
 	lsr.b		&0x1,%d1
 	and.w		&0x7,%d1		# extract Dx from opcode word
-	
+
 	mov.l		%d2,(EXC_DREGS,%a6,%d1.w*4) # store dx
 
 	rts
-	
+
 # a0 = dst addr
 m2rwtrans:
 	mov.l		%a0,%a2			# store addr
@@ -1823,7 +1823,7 @@ m2rwtrans:
 	mov.b		EXC_OPWORD(%a6),%d1
 	lsr.b		&0x1,%d1
 	and.w		&0x7,%d1		# extract Dx from opcode word
-	
+
 	mov.w		%d2,(EXC_DREGS+2,%a6,%d1.w*4) # store dx
 
 	rts
@@ -1832,7 +1832,7 @@ m2rwtrans:
 # must create an access error frame. here, we pass a skeleton fslw
 # and the failing address to the routine that creates the new frame.
 # FSLW:
-# 	write = true
+#	write = true
 #	size = byte
 #	TM = data
 #	software emulation error = true
@@ -1842,7 +1842,7 @@ movp_write_err:
 	bra.l		isp_dacc
 
 # FSLW:
-# 	read = true
+#	read = true
 #	size = byte
 #	TM = data
 #	software emulation error = true
@@ -1853,12 +1853,12 @@ movp_read_err:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_chk2_cmp2(): routine to emulate chk2/cmp2 instructions		#
+#	_chk2_cmp2(): routine to emulate chk2/cmp2 instructions		#
 #									#
 # XREF ****************************************************************	#
 #	_calc_ea(): calculate effective address				#
 #	_dmem_read_long(): read operands				#
-# 	_dmem_read_word(): read operands				#
+#	_dmem_read_word(): read operands				#
 #	isp_dacc(): handle data access error exception			#
 #									#
 # INPUT ***************************************************************	#
@@ -1869,25 +1869,25 @@ movp_read_err:
 #		a0 = failing address					#
 #		d0 = FSLW						#
 #	else								#
-# 		none							#
+#		none							#
 #									#
 # ALGORITHM ***********************************************************	#
 #	First, calculate the effective address, then fetch the byte,	#
-# word, or longword sized operands. Then, in the interest of 		#
-# simplicity, all operands are converted to longword size whether the 	#
-# operation is byte, word, or long. The bounds are sign extended 	#
-# accordingly. If Rn is a data regsiter, Rn is also sign extended. If 	#
-# Rn is an address register, it need not be sign extended since the 	#
+# word, or longword sized operands. Then, in the interest of		#
+# simplicity, all operands are converted to longword size whether the	#
+# operation is byte, word, or long. The bounds are sign extended	#
+# accordingly. If Rn is a data regsiter, Rn is also sign extended. If	#
+# Rn is an address register, it need not be sign extended since the	#
 # full register is always used.						#
 #	The comparisons are made and the condition codes calculated.	#
 # If the instruction is chk2 and the Rn value is out-of-bounds, set	#
 # the ichk_flg in SPCOND_FLG.						#
-#	If the memory fetch returns a failing value, pass the failing 	#
+#	If the memory fetch returns a failing value, pass the failing	#
 # address and FSLW to the isp_dacc() routine.				#
 #									#
 #########################################################################
 
-	global 		_chk2_cmp2
+	global		_chk2_cmp2
 _chk2_cmp2:
 
 # passing size parameter doesn't matter since chk2 & cmp2 can't do
@@ -1974,7 +1974,7 @@ chk2_cmp2_byte:
 
 #
 # To set the ccodes correctly:
-# 	(1) save 'Z' bit from (Rn - lo)
+#	(1) save 'Z' bit from (Rn - lo)
 #	(2) save 'Z' and 'N' bits from ((hi - lo) - (Rn - hi))
 #	(3) keep 'X', 'N', and 'V' from before instruction
 #	(4) combine ccodes
@@ -1984,7 +1984,7 @@ chk2_cmp2_compare:
 	mov.w		%cc, %d3		# fetch resulting ccodes
 	andi.b		&0x4, %d3		# keep 'Z' bit
 	sub.l		%d0, %d1		# (hi - lo)
-	cmp.l	 	%d1,%d2			# ((hi - lo) - (Rn - hi))
+	cmp.l		%d1,%d2			# ((hi - lo) - (Rn - hi))
 
 	mov.w		%cc, %d4		# fetch resulting ccodes
 	or.b		%d4, %d3		# combine w/ earlier ccodes
@@ -2003,7 +2003,7 @@ chk2_cmp2_compare:
 # this code handles the only difference between chk2 and cmp2. chk2 would
 # have trapped out if the value was out of bounds. we check this by seeing
 # if the 'N' bit was set by the operation.
-chk2_finish:	
+chk2_finish:
 	btst		&0x0, %d4		# is 'N' bit set?
 	bne.b		chk2_trap		# yes;chk2 should trap
 	rts
@@ -2018,7 +2018,7 @@ chk2_trap:
 #	read = true
 #	size = longword
 #	TM = data
-# 	software emulation error = true
+#	software emulation error = true
 chk2_cmp2_err_l:
 	mov.l		%a2,%a0			# pass failing address
 	mov.l		&0x01010001,%d0		# pass fslw
@@ -2028,7 +2028,7 @@ chk2_cmp2_err_l:
 #	read = true
 #	size = word
 #	TM = data
-# 	software emulation error = true
+#	software emulation error = true
 chk2_cmp2_err_w:
 	mov.l		%a2,%a0			# pass failing address
 	mov.l		&0x01410001,%d0		# pass fslw
@@ -2036,12 +2036,12 @@ chk2_cmp2_err_w:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_div64(): routine to emulate div{u,s}.l <ea>,Dr:Dq		#
+#	_div64(): routine to emulate div{u,s}.l <ea>,Dr:Dq		#
 #							64/32->32r:32q	#
 #									#
 # XREF ****************************************************************	#
 #	_calc_ea() - calculate effective address			#
-# 	isp_iacc() - handle instruction access error exception		#
+#	isp_iacc() - handle instruction access error exception		#
 #	isp_dacc() - handle data access error exception			#
 #	isp_restore() - restore An on access error w/ -() or ()+	#
 #									#
@@ -2049,24 +2049,24 @@ chk2_cmp2_err_w:
 #	none								#
 #									#
 # OUTPUT **************************************************************	#
-# 	If exiting through isp_dacc...					#
+#	If exiting through isp_dacc...					#
 #		a0 = failing address					#
-# 		d0 = FSLW						#
+#		d0 = FSLW						#
 #	else								#
 #		none							#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	First, decode the operand location. If it's in Dn, fetch from	#
-# the stack. If it's in memory, use _calc_ea() to calculate the 	#
+#	First, decode the operand location. If it's in Dn, fetch from	#
+# the stack. If it's in memory, use _calc_ea() to calculate the		#
 # effective address. Use _dmem_read_long() to fetch at that address.	#
 # Unless the operand is immediate data. Then use _imem_read_long().	#
 # Send failures to isp_dacc() or isp_iacc() as appropriate.		#
-#	If the operands are signed, make them unsigned and save	the 	#
+#	If the operands are signed, make them unsigned and save	the	#
 # sign info for later. Separate out special cases like divide-by-zero	#
 # or 32-bit divides if possible. Else, use a special math algorithm	#
-# to calculate the result. 						#
-#	Restore sign info if signed instruction. Set the condition 	#
-# codes. Set idbyz_flg in SPCOND_FLG if divisor was zero. Store the 	#
+# to calculate the result.						#
+#	Restore sign info if signed instruction. Set the condition	#
+# codes. Set idbyz_flg in SPCOND_FLG if divisor was zero. Store the	#
 # quotient and remainder in the appropriate data registers on the stack.#
 #									#
 #########################################################################
@@ -2131,7 +2131,7 @@ dsgndividend:
 	negx.l		%d5
 
 # extract some special cases:
-# 	- is (dividend == 0) ?
+#	- is (dividend == 0) ?
 #	- is (hi(dividend) == 0 && (divisor <= lo(dividend))) ? (32-bit div)
 dspecialcases:
 	tst.l		%d5			# is (hi(dividend) == 0)
@@ -2140,7 +2140,7 @@ dspecialcases:
 	tst.l		%d6			# is (lo(dividend) == 0), too
 	beq.w		ddone			# yes, so (dividend == 0)
 
-	cmp.l	 	%d7,%d6			# is (divisor <= lo(dividend))
+	cmp.l		%d7,%d6			# is (divisor <= lo(dividend))
 	bls.b		d32bitdivide		# yes, so use 32 bit divide
 
 	exg		%d5,%d6			# q = 0, r = dividend
@@ -2153,7 +2153,7 @@ d32bitdivide:
 
 dnormaldivide:
 # last special case:
-# 	- is hi(dividend) >= divisor ? if yes, then overflow
+#	- is hi(dividend) >= divisor ? if yes, then overflow
 	cmp.l		%d7,%d5
 	bls.b		ddovf			# answer won't fit in 32 bits
 
@@ -2166,7 +2166,7 @@ divfinish:
 	beq.b		ddone			# divu has no processing!!!
 
 # it was a divs.l, so ccode setting is a little more complicated...
-	tst.b		NDIVIDEND(%a6)		# remainder has same sign 
+	tst.b		NDIVIDEND(%a6)		# remainder has same sign
 	beq.b		dcc			# as dividend.
 	neg.l		%d5			# sgn(rem) = sgn(dividend)
 dcc:
@@ -2194,7 +2194,7 @@ ddone:
 	mov.w		%cc, EXC_CC(%a6)
 
 	mov.w		NDRSAVE(%a6), %d0	# get Dr off stack
-	mov.w		NDQSAVE(%a6), %d1	# get Dq off stack	
+	mov.w		NDQSAVE(%a6), %d1	# get Dq off stack
 
 # if the register numbers are the same, only the quotient gets saved.
 # so, if we always save the quotient second, we save ourselves a cmp&beq
@@ -2221,8 +2221,8 @@ div64eq0:
 # For this implementation b=2**16, and the target is U1U2U3U4/V1V2,	#
 # where U,V are words of the quadword dividend and longword divisor,	#
 # and U1, V1 are the most significant words.				#
-# 									#
-# The most sig. longword of the 64 bit dividend must be in %d5, least 	#
+#									#
+# The most sig. longword of the 64 bit dividend must be in %d5, least	#
 # in %d6. The divisor must be in the variable ddivisor, and the		#
 # signed/unsigned flag ddusign must be set (0=unsigned,1=signed).	#
 # The quotient is returned in %d6, remainder in %d5, unless the		#
@@ -2242,7 +2242,7 @@ dclassical:
 # dividing the divisor word into each dividend word. In this case,
 # the first two quotient words must be zero, or overflow would occur.
 # Since we already checked this case above, we can treat the most significant
-# longword of the dividend as (0) remainder (see Knuth) and merely complete 
+# longword of the dividend as (0) remainder (see Knuth) and merely complete
 # the last two divisions to get a quotient longword and word remainder:
 
 	clr.l		%d1
@@ -2278,12 +2278,12 @@ ddknuth:
 	clr.b		DDSECOND(%a6)		# clear flag for quotient digits
 	clr.l		%d1			# %d1 will hold trial quotient
 ddnchk:
-	btst		&31, %d7		# must we normalize? first word of 
+	btst		&31, %d7		# must we normalize? first word of
 	bne.b		ddnormalized		# divisor (V1) must be >= 65536/2
 	addq.l		&0x1, DDNORMAL(%a6)	# count normalization shifts
 	lsl.l		&0x1, %d7		# shift the divisor
 	lsl.l		&0x1, %d6		# shift u4,u3 with overflow to u2
-	roxl.l		&0x1, %d5		# shift u1,u2 
+	roxl.l		&0x1, %d5		# shift u1,u2
 	bra.w		ddnchk
 ddnormalized:
 
@@ -2293,12 +2293,12 @@ ddnormalized:
 	mov.l		%d5, %d2		# dividend mslw
 	swap		%d2
 	swap		%d3
-	cmp.w	 	%d2, %d3		# V1 = U1 ?
+	cmp.w		%d2, %d3		# V1 = U1 ?
 	bne.b		ddqcalc1
 	mov.w		&0xffff, %d1		# use max trial quotient word
 	bra.b		ddadj0
 ddqcalc1:
-	mov.l		%d5, %d1		
+	mov.l		%d5, %d1
 
 	divu.w		%d3, %d1		# use quotient of mslw/msw
 
@@ -2329,7 +2329,7 @@ ddadj1: mov.l		%d7, %d3
 
 #	add.l		%d6, %d4		# (U1U2 - V1q) + U3
 
-	cmp.l	 	%d2, %d4
+	cmp.l		%d2, %d4
 	bls.b		ddadjd1			# is V2q > (U1U2-V1q) + U3 ?
 	subq.l		&0x1, %d1		# yes, decrement and recheck
 	bra.b		ddadj1
@@ -2366,7 +2366,7 @@ dd2nd:
 	tst.b		DDSECOND(%a6)		# both q words done?
 	bne.b		ddremain
 # first quotient digit now correct. store digit and shift the
-# (subtracted) dividend 
+# (subtracted) dividend
 	mov.w		%d1, DDQUOTIENT(%a6)
 	clr.l		%d1
 	swap		%d5
@@ -2377,7 +2377,7 @@ dd2nd:
 	bra.w		ddnormalized
 ddremain:
 # add 2nd word to quotient, get the remainder.
-	mov.w 		%d1, DDQUOTIENT+2(%a6)
+	mov.w		%d1, DDQUOTIENT+2(%a6)
 # shift down one word/digit to renormalize remainder.
 	mov.w		%d5, %d6
 	swap		%d6
@@ -2391,7 +2391,7 @@ ddnlp:
 	dbf		%d7, ddnlp
 ddrn:
 	mov.l		%d6, %d5		# remainder
-	mov.l		DDQUOTIENT(%a6), %d6 	# quotient
+	mov.l		DDQUOTIENT(%a6), %d6	# quotient
 
 	rts
 dmm2:
@@ -2421,7 +2421,7 @@ dmm2:
 	clr.w		%d2			# lsw of two mixed products used,
 	swap		%d5			# now use msws of longwords
 	swap		%d2
-	add.l		%d2, %d5				
+	add.l		%d2, %d5
 	add.l		%d3, %d5		# %d5 now ms 32 bits of final product
 	rts
 
@@ -2463,10 +2463,10 @@ dimmed:
 # also, we call isp_restore in case the effective addressing mode was
 # (an)+ or -(an) in which case the previous "an" value must be restored.
 # FSLW:
-# 	read = true
-# 	size = longword
+#	read = true
+#	size = longword
 #	TM = data
-# 	software emulation error = true
+#	software emulation error = true
 div64_err:
 	bsr.l		isp_restore		# restore addr reg
 	mov.l		%a2,%a0			# pass failing address
@@ -2480,17 +2480,17 @@ div64_err:
 # XREF ****************************************************************	#
 #	_calc_ea() - calculate effective address			#
 #	isp_iacc() - handle instruction access error exception		#
-# 	isp_dacc() - handle data access error exception			#
+#	isp_dacc() - handle data access error exception			#
 #	isp_restore() - restore An on access error w/ -() or ()+	#
 #									#
 # INPUT ***************************************************************	#
 #	none								#
 #									#
 # OUTPUT **************************************************************	#
-# 	If exiting through isp_dacc...					#
+#	If exiting through isp_dacc...					#
 #		a0 = failing address					#
 #		d0 = FSLW						#
-# 	else								#
+#	else								#
 #		none							#
 #									#
 # ALGORITHM ***********************************************************	#
@@ -2499,9 +2499,9 @@ div64_err:
 # effective address. Use _dmem_read_long() to fetch at that address.	#
 # Unless the operand is immediate data. Then use _imem_read_long().	#
 # Send failures to isp_dacc() or isp_iacc() as appropriate.		#
-#	If the operands are signed, make them unsigned and save the 	#
+#	If the operands are signed, make them unsigned and save the	#
 # sign info for later. Perform the multiplication using 16x16->32	#
-# unsigned multiplies and "add" instructions. Store the high and low 	#
+# unsigned multiplies and "add" instructions. Store the high and low	#
 # portions of the result in the appropriate data registers on the	#
 # stack. Calculate the condition codes, also.				#
 #									#
@@ -2554,15 +2554,15 @@ mul64_multiplicand:
 # the result sign is the exclusive or of the operand sign bits.
 mul64_chk_md_sgn:
 	tst.l		%d4			# is multiplicand negative?
-	bge.b		mul64_alg		# no	
+	bge.b		mul64_alg		# no
 	neg.l		%d4			# make multiplicand positive
 	eori.b		&0x1, EXC_TEMP(%a6)	# calculate correct sign
 
 #########################################################################
 #	63			   32				0	#
-# 	----------------------------					#
-# 	| hi(mplier) * hi(mplicand)|					#
-# 	----------------------------					#
+#	----------------------------					#
+#	| hi(mplier) * hi(mplicand)|					#
+#	----------------------------					#
 #		     -----------------------------			#
 #		     | hi(mplier) * lo(mplicand) |			#
 #		     -----------------------------			#
@@ -2639,7 +2639,7 @@ mul64_done:
 	andi.b		&0x8, %d7		# extract 'N' bit
 
 mul64_ccode_set:
-	mov.b		EXC_CC+1(%a6), %d6 	# fetch previous %ccr
+	mov.b		EXC_CC+1(%a6), %d6	# fetch previous %ccr
 	andi.b		&0x10, %d6		# all but 'X' bit changes
 
 	or.b		%d7, %d6		# group 'X' and 'N'
@@ -2698,10 +2698,10 @@ mul64_immed:
 # also, we call isp_restore in case the effective addressing mode was
 # (an)+ or -(an) in which case the previous "an" value must be restored.
 # FSLW:
-# 	read = true
-# 	size = longword
+#	read = true
+#	size = longword
 #	TM = data
-# 	software emulation error = true
+#	software emulation error = true
 mul64_err:
 	bsr.l		isp_restore		# restore addr reg
 	mov.l		%a2,%a0			# pass failing address
@@ -2728,7 +2728,7 @@ mul64_err:
 #									#
 # _isp_cas2_finish():							#
 #	see cas2 core emulation code					#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 # _compandset2():							#
 #	see cas2 core emulation code					#
@@ -2744,7 +2744,7 @@ mul64_err:
 # pages from being paged out. If either _real_lock_page() fails, exit	#
 # through _cas_terminate2(). Don't forget to unlock the 1st locked page	#
 # using _real_unlock_paged() if the 2nd lock-page fails.		#
-# Finally, branch to the core cas2 emulation code by calling the 	#
+# Finally, branch to the core cas2 emulation code by calling the	#
 # "callout" _real_cas2().						#
 #									#
 # _isp_cas2_finish():							#
@@ -2793,7 +2793,7 @@ _compandset2:
 	lsr.w		&0x6,%d1
 	andi.w		&0x7,%d1		# extract Du1
 	mov.l		(EXC_DREGS,%a6,%d1.w*4),%d4 # fetch Update1 Op
-	
+
 	andi.w		&0x7,%d0		# extract Dc1
 	mov.l		(EXC_DREGS,%a6,%d0.w*4),%d2 # fetch Compare1 Op
 	mov.w		%d0,DC1(%a6)
@@ -2827,7 +2827,7 @@ _compandset2:
 
 	bra.l		_real_cas2
 
-# if the 2nd lock attempt fails, then we must still unlock the 
+# if the 2nd lock attempt fails, then we must still unlock the
 # first page(s).
 cas_preterm:
 	mov.l		%d0,-(%sp)		# save FSLW
@@ -2869,7 +2869,7 @@ cas2_finish_w_done:
 	sf		%d1			# pass size
 	mov.l		ADDR1(%a6),%a0		# pass ADDR1
 	bsr.l		_real_unlock_page	# unlock page
-	
+
 	mov.l		%d2,%d0			# pass mode
 	sf		%d1			# pass size
 	mov.l		ADDR2(%a6),%a0		# pass ADDR2
@@ -2900,7 +2900,7 @@ cas2_finish_l_done:
 	st		%d1			# pass size
 	mov.l		ADDR1(%a6),%a0		# pass ADDR1
 	bsr.l		_real_unlock_page	# unlock page
-	
+
 	mov.l		%d2,%d0			# pass mode
 	st		%d1			# pass size
 	mov.l		ADDR2(%a6),%a0		# pass ADDR2
@@ -2928,11 +2928,11 @@ cr_cas2:
 #			    (external to package)			#
 #									#
 # XREF ****************************************************************	#
-# 	_calc_ea(): calculate effective address				#
+#	_calc_ea(): calculate effective address				#
 #									#
 # INPUT ***************************************************************	#
 # compandset():								#
-# 	none								#
+#	none								#
 # _isp_cas_restart():							#
 #	d6 = previous sfc/dfc						#
 # _isp_cas_finish():							#
@@ -2959,10 +2959,10 @@ cr_cas2:
 # ALGORITHM ***********************************************************	#
 #									#
 # compandset():								#
-#	First, calculate the effective address. Then, decode the 	#
+#	First, calculate the effective address. Then, decode the	#
 # instruction word and fetch the "compare" (DC) and "update" (Du)	#
 # operands.								#
-# 	Next, call the external routine _real_lock_page() so that the	#
+#	Next, call the external routine _real_lock_page() so that the	#
 # operating system can keep this page from being paged out while we're	#
 # in this routine. If this call fails, jump to _cas_terminate2().	#
 #	The routine then branches to _real_cas(). This external routine	#
@@ -2971,7 +2971,7 @@ cr_cas2:
 # this purpose.								#
 #									#
 # _isp_cas_finish():							#
-# 	Either way, after emulation, the package is re-entered at	#
+#	Either way, after emulation, the package is re-entered at	#
 # _isp_cas_finish(). This routine re-compares the operands in order to	#
 # set the condition codes. Finally, these routines will call		#
 # _real_unlock_page() in order to unlock the pages that were previously	#
@@ -2984,13 +2984,13 @@ cr_cas2:
 # _isp_cas_terminate():							#
 #	This routine can be entered from an access error handler where	#
 # an emulation operand access failed and the operating system would	#
-# like an access error stack frame created instead of the current 	#
+# like an access error stack frame created instead of the current	#
 # unimplemented integer instruction frame.				#
-# 	Also, the package enters here if a call to _real_lock_page()	#
+#	Also, the package enters here if a call to _real_lock_page()	#
 # fails.								#
 #									#
 # _isp_cas_inrange():							#
-# 	Checks to see whether the instruction address passed to it in	#
+#	Checks to see whether the instruction address passed to it in	#
 # a0 is within the software package cas/cas2 emulation routines. This	#
 # can be helpful for an operating system to determine whether an access	#
 # error during emulation was due to a cas/cas2 emulation access.	#
@@ -3003,18 +3003,18 @@ set ADDR,	EXC_TEMP+0x4
 	global		_compandset
 _compandset:
 	btst		&0x1,EXC_OPWORD(%a6)	# word or long operation?
-	bne.b		compandsetl		# long	
+	bne.b		compandsetl		# long
 
 compandsetw:
 	movq.l		&0x2,%d0		# size = 2 bytes
-	bsr.l		_calc_ea		# a0 = calculated <ea>	
+	bsr.l		_calc_ea		# a0 = calculated <ea>
 	mov.l		%a0,ADDR(%a6)		# save <ea> for possible restart
 	sf		%d7			# clear d7 for word size
 	bra.b		compandsetfetch
 
 compandsetl:
 	movq.l		&0x4,%d0		# size = 4 bytes
-	bsr.l		_calc_ea		# a0 = calculated <ea>	
+	bsr.l		_calc_ea		# a0 = calculated <ea>
 	mov.l		%a0,ADDR(%a6)		# save <ea> for possible restart
 	st		%d7			# set d7 for longword size
 
@@ -3040,7 +3040,7 @@ compandsetfetch:
 	tst.l		%d0			# did error occur?
 	bne.w		_cas_terminate2		# yes, clean up the mess
 	mov.l		%a2,%a0			# pass addr in a0
-	
+
 	bra.l		_real_cas
 
 ########
@@ -3053,7 +3053,7 @@ _isp_cas_finish:
 # from the locked routine...
 cas_finish_w:
 	mov.w		EXC_CC(%a6),%cc		# restore cc
-	cmp.w	 	%d0,%d4			# do word compare
+	cmp.w		%d0,%d4			# do word compare
 	mov.w		%cc,EXC_CC(%a6)		# save cc
 
 	tst.b		%d1			# update compare reg?
@@ -3074,7 +3074,7 @@ cas_finish_w_done:
 # from the locked routine...
 cas_finish_l:
 	mov.w		EXC_CC(%a6),%cc		# restore cc
-	cmp.l	 	%d0,%d4			# do longword compare
+	cmp.l		%d0,%d4			# do longword compare
 	mov.w		%cc,EXC_CC(%a6)		# save cc
 
 	tst.b		%d1			# update compare reg?
@@ -3092,7 +3092,7 @@ cas_finish_l_done:
 	rts
 
 ########
-	
+
 	global		_isp_cas_restart
 _isp_cas_restart:
 	mov.l		%d6,%sfc		# restore previous sfc
@@ -3104,7 +3104,7 @@ cr_cas:
 	mov.l		ADDR(%a6),%a0		# load <ea>
 	btst		&0x1,EXC_OPWORD(%a6)	# word or long operation?
 	sne		%d7			# set d7 accordingly
-	bra.w		compandsetfetch	
+	bra.w		compandsetfetch
 
 ########
 
@@ -3151,7 +3151,7 @@ _isp_cas_inrange:
 	cmp.l		%a0,%a1			# is PC in range?
 	blt.b		cin_no			# no
 	rts					# yes; return d0 = 0
-cin_no:	
+cin_no:
 	mov.l		&-0x1,%d0		# out of range; return d0 = -1
 	rts
 
@@ -3179,28 +3179,28 @@ cin_no:
 #									#
 # XREF ****************************************************************	#
 #	_isp_cas2_finish() - only exit point for this emulation code;	#
-#			     do clean-up; calculate ccodes; store 	#
+#			     do clean-up; calculate ccodes; store	#
 #			     Compare Ops if appropriate.		#
 #									#
 # INPUT ***************************************************************	#
 #	*see chart below*						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	*see chart below*						#
 #									#
 # ALGORITHM ***********************************************************	#
 #	(1) Make several copies of the effective address.		#
 #	(2) Save current SR; Then mask off all maskable interrupts.	#
-#	(3) Save current SFC/DFC (ASSUMED TO BE EQUAL!!!); Then set 	#
-#	    according to whether exception occurred in user or 		#
+#	(3) Save current SFC/DFC (ASSUMED TO BE EQUAL!!!); Then set	#
+#	    according to whether exception occurred in user or		#
 #	    supervisor mode.						#
 #	(4) Use "plpaw" instruction to pre-load ATC with effective	#
 #	    address pages(s). THIS SHOULD NOT FAULT!!! The relevant	#
 #	    page(s) should have already been made resident prior to	#
-# 	    entering this routine.					#
-#	(5) Push the operand lines from the cache w/ "cpushl". 		#
+#	    entering this routine.					#
+#	(5) Push the operand lines from the cache w/ "cpushl".		#
 #	    In the 68040, this was done within the locked region. In	#
-# 	    the 68060, it is done outside of the locked region.		#
+#	    the 68060, it is done outside of the locked region.		#
 #	(6) Use "plpar" instruction to do a re-load of ATC entries for	#
 #	    ADDR1 since ADDR2 entries may have pushed ADDR1 out of the	#
 #	    ATC.							#
@@ -3214,19 +3214,19 @@ cin_no:
 #	    back to itself (as w/ the '040) so we can gracefully unlock	#
 #	    the bus (and assert LOCKE*) using BUSCR and the final move.	#
 #	(12)Exit.							#
-#	(13)Write update operand to the DST locations. Use BUSCR to 	#
+#	(13)Write update operand to the DST locations. Use BUSCR to	#
 #	    assert LOCKE* for the final write operation.		#
 #	(14)Exit.							#
 #									#
-# 	The algorithm is actually implemented slightly differently	#
-# depending on the size of the operation and the misalignment of the 	#
+#	The algorithm is actually implemented slightly differently	#
+# depending on the size of the operation and the misalignment of the	#
 # operands. A misaligned operand must be written in aligned chunks or	#
 # else the BUSCR register control gets confused.			#
 #									#
 #########################################################################
 
 #################################################################
-# THIS IS THE STATE OF THE INTEGER REGISTER FILE UPON		# 
+# THIS IS THE STATE OF THE INTEGER REGISTER FILE UPON		#
 # ENTERING _isp_cas2().						#
 #								#
 # D0 = xxxxxxxx							#
@@ -3236,7 +3236,7 @@ cin_no:
 # D4 = update oper 1						#
 # D5 = update oper 2						#
 # D6 = 'xxxxxxff if supervisor mode; 'xxxxxx00 if user mode	#
-# D7 = 'xxxxxxff if longword operation; 'xxxxxx00 if word 	#
+# D7 = 'xxxxxxff if longword operation; 'xxxxxx00 if word	#
 # A0 = ADDR1							#
 # A1 = ADDR2							#
 # A2 = xxxxxxxx							#
@@ -3339,22 +3339,22 @@ cas2l:
 # A4 = bus unlock value
 # A5 = xxxxxxxx
 #
-	align 		0x10
+	align		0x10
 CAS2L_START:
 	movc		%a2,%buscr		# assert LOCK*
 	movs.l		(%a1),%d1		# fetch Dest2[31:0]
 	movs.l		(%a0),%d0		# fetch Dest1[31:0]
-	bra.b 		CAS2L_CONT
+	bra.b		CAS2L_CONT
 CAS2L_ENTER:
 	bra.b		~+16
 
 CAS2L_CONT:
-	cmp.l	 	%d0,%d2			# Dest1 - Compare1
+	cmp.l		%d0,%d2			# Dest1 - Compare1
 	bne.b		CAS2L_NOUPDATE
-	cmp.l	 	%d1,%d3			# Dest2 - Compare2
+	cmp.l		%d1,%d3			# Dest2 - Compare2
 	bne.b		CAS2L_NOUPDATE
 	movs.l		%d5,(%a1)		# Update2[31:0] -> DEST2
-	bra.b 		CAS2L_UPDATE
+	bra.b		CAS2L_UPDATE
 	bra.b		~+16
 
 CAS2L_UPDATE:
@@ -3384,7 +3384,7 @@ CAS2L_FILLER:
 ####
 
 #################################################################
-# THIS MUST BE THE STATE OF THE INTEGER REGISTER FILE UPON	# 
+# THIS MUST BE THE STATE OF THE INTEGER REGISTER FILE UPON	#
 # ENTERING _isp_cas2().						#
 #								#
 # D0 = destination[31:0] operand 1				#
@@ -3430,22 +3430,22 @@ cas2l_update_done:
 	bra.l		_isp_cas2_finish
 ####
 
-	align 		0x10
+	align		0x10
 CAS2L2_START:
 	movc		%a2,%buscr		# assert LOCK*
 	movs.l		(%a1),%d1		# fetch Dest2[31:0]
 	movs.l		(%a0),%d0		# fetch Dest1[31:0]
-	bra.b 		CAS2L2_CONT
+	bra.b		CAS2L2_CONT
 CAS2L2_ENTER:
 	bra.b		~+16
 
 CAS2L2_CONT:
-	cmp.l	 	%d0,%d2			# Dest1 - Compare1
+	cmp.l		%d0,%d2			# Dest1 - Compare1
 	bne.b		CAS2L2_NOUPDATE
-	cmp.l	 	%d1,%d3			# Dest2 - Compare2
+	cmp.l		%d1,%d3			# Dest2 - Compare2
 	bne.b		CAS2L2_NOUPDATE
 	movs.l		%d5,(%a1)		# Update2[31:0] -> Dest2
-	bra.b 		CAS2L2_UPDATE
+	bra.b		CAS2L2_UPDATE
 	bra.b		~+16
 
 CAS2L2_UPDATE:
@@ -3490,22 +3490,22 @@ CAS2L2_FILLER:
 
 #################################
 
-	align 		0x10
+	align		0x10
 CAS2L3_START:
 	movc		%a2,%buscr		# assert LOCK*
 	movs.l		(%a1),%d1		# fetch Dest2[31:0]
 	movs.l		(%a0),%d0		# fetch Dest1[31:0]
-	bra.b 		CAS2L3_CONT
+	bra.b		CAS2L3_CONT
 CAS2L3_ENTER:
 	bra.b		~+16
 
 CAS2L3_CONT:
-	cmp.l	 	%d0,%d2			# Dest1 - Compare1
+	cmp.l		%d0,%d2			# Dest1 - Compare1
 	bne.b		CAS2L3_NOUPDATE
-	cmp.l	 	%d1,%d3			# Dest2 - Compare2
+	cmp.l		%d1,%d3			# Dest2 - Compare2
 	bne.b		CAS2L3_NOUPDATE
 	movs.l		%d5,(%a1)		# Update2[31:0] -> DEST2
-	bra.b 		CAS2L3_UPDATE
+	bra.b		CAS2L3_UPDATE
 	bra.b		~+16
 
 CAS2L3_UPDATE:
@@ -3531,7 +3531,7 @@ CAS2L3_UPDATE3:
 	nop
 	nop
 	bra.b		~+16
-	
+
 CAS2L3_NOUPDATE:
 	rol.l		&0x8,%d0		# get Dest1[31:24]
 	movs.b		%d0,(%a0)+		# Dest1[31:24] -> DEST1
@@ -3639,22 +3639,22 @@ cas2w:
 # A4 = bus unlock value
 # A5 = xxxxxxxx
 #
-	align 		0x10
+	align		0x10
 CAS2W_START:
 	movc		%a2,%buscr		# assert LOCK*
 	movs.w		(%a1),%d1		# fetch Dest2[15:0]
 	movs.w		(%a0),%d0		# fetch Dest1[15:0]
-	bra.b 		CAS2W_CONT2
+	bra.b		CAS2W_CONT2
 CAS2W_ENTER:
 	bra.b		~+16
 
 CAS2W_CONT2:
-	cmp.w	 	%d0,%d2			# Dest1 - Compare1
+	cmp.w		%d0,%d2			# Dest1 - Compare1
 	bne.b		CAS2W_NOUPDATE
-	cmp.w	 	%d1,%d3			# Dest2 - Compare2
+	cmp.w		%d1,%d3			# Dest2 - Compare2
 	bne.b		CAS2W_NOUPDATE
 	movs.w		%d5,(%a1)		# Update2[15:0] -> DEST2
-	bra.b 		CAS2W_UPDATE
+	bra.b		CAS2W_UPDATE
 	bra.b		~+16
 
 CAS2W_UPDATE:
@@ -3684,7 +3684,7 @@ CAS2W_FILLER:
 ####
 
 #################################################################
-# THIS MUST BE THE STATE OF THE INTEGER REGISTER FILE UPON	# 
+# THIS MUST BE THE STATE OF THE INTEGER REGISTER FILE UPON	#
 # ENTERING _isp_cas2().						#
 #								#
 # D0 = destination[15:0] operand 1				#
@@ -3730,22 +3730,22 @@ cas2w_update_done:
 	bra.l		_isp_cas2_finish
 ####
 
-	align 		0x10
+	align		0x10
 CAS2W2_START:
 	movc		%a2,%buscr		# assert LOCK*
 	movs.w		(%a1),%d1		# fetch Dest2[15:0]
 	movs.w		(%a0),%d0		# fetch Dest1[15:0]
-	bra.b 		CAS2W2_CONT2
+	bra.b		CAS2W2_CONT2
 CAS2W2_ENTER:
 	bra.b		~+16
 
 CAS2W2_CONT2:
-	cmp.w	 	%d0,%d2			# Dest1 - Compare1
+	cmp.w		%d0,%d2			# Dest1 - Compare1
 	bne.b		CAS2W2_NOUPDATE
-	cmp.w	 	%d1,%d3			# Dest2 - Compare2
+	cmp.w		%d1,%d3			# Dest2 - Compare2
 	bne.b		CAS2W2_NOUPDATE
 	movs.w		%d5,(%a1)		# Update2[15:0] -> DEST2
-	bra.b 		CAS2W2_UPDATE
+	bra.b		CAS2W2_UPDATE
 	bra.b		~+16
 
 CAS2W2_UPDATE:
@@ -3789,34 +3789,34 @@ CAS2W2_FILLER:
 	bra.b		CAS2W2_START
 
 #       ######      ##      ######
-#       #	   #  #     #     
+#       #	   #  #     #
 #	#	  ######    ######
 #	#	  #    #         #
 #       ######    #    #    ######
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_isp_cas(): "core" emulation code for the cas instruction	#
+#	_isp_cas(): "core" emulation code for the cas instruction	#
 #									#
 # XREF ****************************************************************	#
 #	_isp_cas_finish() - only exit point for this emulation code;	#
 #			    do clean-up					#
 #									#
 # INPUT ***************************************************************	#
-# 	*see entry chart below*						#
+#	*see entry chart below*						#
 #									#
 # OUTPUT **************************************************************	#
 #	*see exit chart below*						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	(1) Make several copies of the effective address. 		#
-# 	(2) Save current SR; Then mask off all maskable interrupts.	#
+#	(1) Make several copies of the effective address.		#
+#	(2) Save current SR; Then mask off all maskable interrupts.	#
 #	(3) Save current DFC/SFC (ASSUMED TO BE EQUAL!!!); Then set	#
 #	    SFC/DFC according to whether exception occurred in user or	#
 #	    supervisor mode.						#
 #	(4) Use "plpaw" instruction to pre-load ATC with efective	#
 #	    address page(s). THIS SHOULD NOT FAULT!!! The relevant	#
-# 	    page(s) should have been made resident prior to entering 	#
+#	    page(s) should have been made resident prior to entering	#
 #	    this routine.						#
 #	(5) Push the operand lines from the cache w/ "cpushl".		#
 #	    In the 68040, this was done within the locked region. In	#
@@ -3834,8 +3834,8 @@ CAS2W2_FILLER:
 #	(12)Write update operand to the DST location. Use BUSCR to	#
 #	    assert LOCKE* for the final write operation.		#
 #	(13)Exit.							#
-# 									#
-# 	The algorithm is actually implemented slightly differently	#
+#									#
+#	The algorithm is actually implemented slightly differently	#
 # depending on the size of the operation and the misalignment of the	#
 # operand. A misaligned operand must be written in aligned chunks or	#
 # else the BUSCR register control gets confused.			#
@@ -3934,9 +3934,9 @@ casw:
 CASW_START:
 	movc		%a1,%buscr		# assert LOCK*
 	movs.w		(%a0),%d0		# fetch Dest[15:0]
-	cmp.w	 	%d0,%d4			# Dest - Compare
+	cmp.w		%d0,%d4			# Dest - Compare
 	bne.b		CASW_NOUPDATE
-	bra.b 		CASW_UPDATE
+	bra.b		CASW_UPDATE
 CASW_ENTER:
 	bra.b		~+16
 
@@ -3961,7 +3961,7 @@ CASW_NOUPDATE:
 	movs.b		%d0,(%a0)+		# Dest[15:8] -> DEST
 	movc		%a2,%buscr		# assert LOCKE*
 	rol.l		&0x8,%d0		# get Dest[7:0]
-	bra.b 		CASW_NOUPDATE2
+	bra.b		CASW_NOUPDATE2
 	bra.b		~+16
 
 CASW_NOUPDATE2:
@@ -4090,9 +4090,9 @@ casl:
 CASL_START:
 	movc		%a1,%buscr		# assert LOCK*
 	movs.l		(%a0),%d0		# fetch Dest[31:0]
-	cmp.l	 	%d0,%d4			# Dest - Compare
+	cmp.l		%d0,%d4			# Dest - Compare
 	bne.b		CASL_NOUPDATE
-	bra.b 		CASL_UPDATE
+	bra.b		CASL_UPDATE
 CASL_ENTER:
 	bra.b		~+16
 
@@ -4117,7 +4117,7 @@ CASL_NOUPDATE:
 	movs.w		%d0,(%a0)+		# Dest[31:16] -> DEST
 	swap		%d0			# get Dest[15:0]
 	movc		%a2,%buscr		# assert LOCKE*
-	bra.b 		CASL_NOUPDATE2
+	bra.b		CASL_NOUPDATE2
 	bra.b		~+16
 
 CASL_NOUPDATE2:
@@ -4214,7 +4214,7 @@ casl2:
 	mov.l		&0xa0000000,%a2		# assert LOCKE* buscr value
 	mov.l		&0x00000000,%a3		# buscr unlock value
 
-# pre-load the instruction cache for the following algorithm. 
+# pre-load the instruction cache for the following algorithm.
 # this will minimize the number of cycles that LOCK* will be asserted.
 	bra.b		CASL2_ENTER		# start pre-loading icache
 
@@ -4238,9 +4238,9 @@ casl2:
 CASL2_START:
 	movc		%a1,%buscr		# assert LOCK*
 	movs.l		(%a0),%d0		# fetch Dest[31:0]
-	cmp.l	 	%d0,%d4			# Dest - Compare
+	cmp.l		%d0,%d4			# Dest - Compare
 	bne.b		CASL2_NOUPDATE
-	bra.b 		CASL2_UPDATE
+	bra.b		CASL2_UPDATE
 CASL2_ENTER:
 	bra.b		~+16
 
@@ -4263,14 +4263,14 @@ CASL2_NOUPDATE:
 	movs.b		%d0,(%a0)+		# Dest[31:24] -> DEST
 	swap		%d0			# get Dest[23:8]
 	movs.w		%d0,(%a0)+		# Dest[23:8] -> DEST+0x1
-	bra.b 		CASL2_NOUPDATE2
+	bra.b		CASL2_NOUPDATE2
 	bra.b		~+16
 
 CASL2_NOUPDATE2:
 	rol.l		&0x8,%d0		# get Dest[7:0]
 	movc		%a2,%buscr		# assert LOCKE*
 	movs.b		%d0,(%a0)		# Dest[7:0] -> DEST+0x3
-	bra.b 		CASL2_NOUPDATE3
+	bra.b		CASL2_NOUPDATE3
 	nop
 	bra.b		~+16
 
diff --git a/arch/m68k/ifpsp060/src/itest.S b/arch/m68k/ifpsp060/src/itest.S
index 6d557d9f1..ba4a30cbc 100644
--- a/arch/m68k/ifpsp060/src/itest.S
+++ b/arch/m68k/ifpsp060/src/itest.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -453,8 +453,8 @@ movp_1:
 	bne.l	error
 
 #####################################################
-# movep.w	%d0,(0x0,%a0) 			    #
-# 	- this test has %cc initially equal to zero #
+# movep.w	%d0,(0x0,%a0)			    #
+#	- this test has %cc initially equal to zero #
 #####################################################
 movp_2:
 	addq.l	&0x1,TESTCTR(%a6)
diff --git a/arch/m68k/ifpsp060/src/pfpsp.S b/arch/m68k/ifpsp060/src/pfpsp.S
index fbf9d6448..0c997c436 100644
--- a/arch/m68k/ifpsp060/src/pfpsp.S
+++ b/arch/m68k/ifpsp060/src/pfpsp.S
@@ -5,10 +5,10 @@ M68060 Software Package
 Production Release P1.00 -- October 10, 1994
 
 M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
- 
+
 THE SOFTWARE is provided on an "AS IS" basis and without warranty.
 To the maximum extent permitted by applicable law,
-MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, 
+MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
 INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 and any warranty against infringement with regard to the SOFTWARE
 (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
@@ -89,7 +89,7 @@ _060FPSP_TABLE:
 	bra.l		_fpsp_effadd
 	short		0x0000
 
-	space 		56
+	space		56
 
 ###############################################################
 	global		_fpsp_done
@@ -323,33 +323,33 @@ set EXC_D2,		EXC_DREGS+(2*4)
 set EXC_D1,		EXC_DREGS+(1*4)
 set EXC_D0,		EXC_DREGS+(0*4)
 
-set EXC_FP0, 		EXC_FPREGS+(0*12)	# offset of saved fp0
-set EXC_FP1, 		EXC_FPREGS+(1*12)	# offset of saved fp1
-set EXC_FP2, 		EXC_FPREGS+(2*12)	# offset of saved fp2 (not used)
+set EXC_FP0,		EXC_FPREGS+(0*12)	# offset of saved fp0
+set EXC_FP1,		EXC_FPREGS+(1*12)	# offset of saved fp1
+set EXC_FP2,		EXC_FPREGS+(2*12)	# offset of saved fp2 (not used)
 
-set FP_SCR1, 		LV+80			# fp scratch 1
-set FP_SCR1_EX, 	FP_SCR1+0
+set FP_SCR1,		LV+80			# fp scratch 1
+set FP_SCR1_EX,		FP_SCR1+0
 set FP_SCR1_SGN,	FP_SCR1+2
-set FP_SCR1_HI, 	FP_SCR1+4
-set FP_SCR1_LO, 	FP_SCR1+8
+set FP_SCR1_HI,		FP_SCR1+4
+set FP_SCR1_LO,		FP_SCR1+8
 
-set FP_SCR0, 		LV+68			# fp scratch 0
-set FP_SCR0_EX, 	FP_SCR0+0
+set FP_SCR0,		LV+68			# fp scratch 0
+set FP_SCR0_EX,		FP_SCR0+0
 set FP_SCR0_SGN,	FP_SCR0+2
-set FP_SCR0_HI, 	FP_SCR0+4
-set FP_SCR0_LO, 	FP_SCR0+8
+set FP_SCR0_HI,		FP_SCR0+4
+set FP_SCR0_LO,		FP_SCR0+8
 
-set FP_DST, 		LV+56			# fp destination operand
-set FP_DST_EX, 		FP_DST+0
+set FP_DST,		LV+56			# fp destination operand
+set FP_DST_EX,		FP_DST+0
 set FP_DST_SGN,		FP_DST+2
-set FP_DST_HI, 		FP_DST+4
-set FP_DST_LO, 		FP_DST+8
+set FP_DST_HI,		FP_DST+4
+set FP_DST_LO,		FP_DST+8
 
-set FP_SRC, 		LV+44			# fp source operand
-set FP_SRC_EX, 		FP_SRC+0
+set FP_SRC,		LV+44			# fp source operand
+set FP_SRC_EX,		FP_SRC+0
 set FP_SRC_SGN,		FP_SRC+2
-set FP_SRC_HI, 		FP_SRC+4
-set FP_SRC_LO, 		FP_SRC+8
+set FP_SRC_HI,		FP_SRC+4
+set FP_SRC_LO,		FP_SRC+8
 
 set USER_FPIAR,		LV+40			# FP instr address register
 
@@ -373,7 +373,7 @@ set EXC_TEMP2,		LV+24			# temporary space
 set EXC_TEMP,		LV+16			# temporary space
 
 set DTAG,		LV+15			# destination operand type
-set STAG, 		LV+14			# source operand type
+set STAG,		LV+14			# source operand type
 
 set SPCOND_FLG,		LV+10			# flag: special case (see below)
 
@@ -388,17 +388,17 @@ set EXC_OPWORD,		LV+0			# saved operation word
 # Helpful macros
 
 set FTEMP,		0			# offsets within an
-set FTEMP_EX, 		0			# extended precision
+set FTEMP_EX,		0			# extended precision
 set FTEMP_SGN,		2			# value saved in memory.
-set FTEMP_HI, 		4
-set FTEMP_LO, 		8
+set FTEMP_HI,		4
+set FTEMP_LO,		8
 set FTEMP_GRS,		12
 
 set LOCAL,		0			# offsets within an
-set LOCAL_EX, 		0			# extended precision 
+set LOCAL_EX,		0			# extended precision
 set LOCAL_SGN,		2			# value saved in memory.
-set LOCAL_HI, 		4
-set LOCAL_LO, 		8
+set LOCAL_HI,		4
+set LOCAL_LO,		8
 set LOCAL_GRS,		12
 
 set DST,		0			# offsets within an
@@ -488,17 +488,17 @@ set ainex_mask,		0x00000008		# accrued inexact
 ######################################
 set dzinf_mask,		inf_mask+dz_mask+adz_mask
 set opnan_mask,		nan_mask+operr_mask+aiop_mask
-set nzi_mask,		0x01ffffff 		#clears N, Z, and I
+set nzi_mask,		0x01ffffff		#clears N, Z, and I
 set unfinx_mask,	unfl_mask+inex2_mask+aunfl_mask+ainex_mask
 set unf2inx_mask,	unfl_mask+inex2_mask+ainex_mask
 set ovfinx_mask,	ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
 set inx1a_mask,		inex1_mask+ainex_mask
 set inx2a_mask,		inex2_mask+ainex_mask
-set snaniop_mask, 	nan_mask+snan_mask+aiop_mask
+set snaniop_mask,	nan_mask+snan_mask+aiop_mask
 set snaniop2_mask,	snan_mask+aiop_mask
 set naniop_mask,	nan_mask+aiop_mask
 set neginf_mask,	neg_mask+inf_mask
-set infaiop_mask, 	inf_mask+aiop_mask
+set infaiop_mask,	inf_mask+aiop_mask
 set negz_mask,		neg_mask+z_mask
 set opaop_mask,		operr_mask+aiop_mask
 set unfl_inx_mask,	unfl_mask+aunfl_mask+ainex_mask
@@ -527,8 +527,8 @@ set rp_mode,		0x3			# round-to-plus-infinity
 set mantissalen,	64			# length of mantissa in bits
 
 set BYTE,		1			# len(byte) == 1 byte
-set WORD, 		2			# len(word) == 2 bytes
-set LONG, 		4			# len(longword) == 2 bytes
+set WORD,		2			# len(word) == 2 bytes
+set LONG,		4			# len(longword) == 2 bytes
 
 set BSUN_VEC,		0xc0			# bsun    vector offset
 set INEX_VEC,		0xc4			# inexact vector offset
@@ -598,7 +598,7 @@ TWOBYPI:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Ovfl exception stack frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	Overflow Exception enabled:					#
 #	- The system stack is unchanged					#
@@ -609,24 +609,24 @@ TWOBYPI:
 #									#
 # ALGORITHM ***********************************************************	#
 #	On the 060, if an FP overflow is present as the result of any	#
-# instruction, the 060 will take an overflow exception whether the 	#
-# exception is enabled or disabled in the FPCR. For the disabled case, 	#
+# instruction, the 060 will take an overflow exception whether the	#
+# exception is enabled or disabled in the FPCR. For the disabled case,	#
 # This handler emulates the instruction to determine what the correct	#
 # default result should be for the operation. This default result is	#
-# then stored in either the FP regfile, data regfile, or memory. 	#
-# Finally, the handler exits through the "callout" _fpsp_done() 	#
+# then stored in either the FP regfile, data regfile, or memory.	#
+# Finally, the handler exits through the "callout" _fpsp_done()		#
 # denoting that no exceptional conditions exist within the machine.	#
-# 	If the exception is enabled, then this handler must create the	#
+#	If the exception is enabled, then this handler must create the	#
 # exceptional operand and plave it in the fsave state frame, and store	#
-# the default result (only if the instruction is opclass 3). For 	#
-# exceptions enabled, this handler must exit through the "callout" 	#
+# the default result (only if the instruction is opclass 3). For	#
+# exceptions enabled, this handler must exit through the "callout"	#
 # _real_ovfl() so that the operating system enabled overflow handler	#
 # can handle this case.							#
-#	Two other conditions exist. First, if overflow was disabled 	#
-# but the inexact exception was enabled, this handler must exit 	#
+#	Two other conditions exist. First, if overflow was disabled	#
+# but the inexact exception was enabled, this handler must exit		#
 # through the "callout" _real_inex() regardless of whether the result	#
 # was inexact.								#
-#	Also, in the case of an opclass three instruction where 	#
+#	Also, in the case of an opclass three instruction where		#
 # overflow was disabled and the trace exception was enabled, this	#
 # handler must exit through the "callout" _real_trace().		#
 #									#
@@ -641,9 +641,9 @@ _fpsp_ovfl:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
@@ -667,7 +667,7 @@ _fpsp_ovfl:
 	bsr.l		set_tag_x		# tag the operand type
 	mov.b		%d0,STAG(%a6)		# maybe NORM,DENORM
 
-# bit five of the fp extension word separates the monadic and dyadic operations 
+# bit five of the fp extension word separates the monadic and dyadic operations
 # that can pass through fpsp_ovfl(). remember that fcmp, ftst, and fsincos
 # will never take this exception.
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is operation monadic or dyadic?
@@ -740,7 +740,7 @@ fovfl_extract:
 fovfl_ovfl_on:
 	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP (fp1) to stack
 
-	mov.w		&0xe005,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe005,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -756,10 +756,10 @@ fovfl_ovfl_on:
 # we must jump to real_inex().
 fovfl_inex_on:
 
-	fmovm.x		&0x40,FP_SRC(%a6) 	# save EXOP (fp1) to stack
+	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP (fp1) to stack
 
 	mov.b		&0xc4,1+EXC_VOFF(%a6)	# vector offset = 0xc4
-	mov.w		&0xe001,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe001,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -810,7 +810,7 @@ fovfl_out:
 	btst		&0x7,(%sp)		# is trace on?
 	beq.l		_fpsp_done		# no
 
-	fmov.l		%fpiar,0x8(%sp)		# "Current PC" is in FPIAR	
+	fmov.l		%fpiar,0x8(%sp)		# "Current PC" is in FPIAR
 	mov.w		&0x2024,0x6(%sp)	# stk fmt = 0x2; voff = 0x024
 	bra.l		_real_trace
 
@@ -838,7 +838,7 @@ fovfl_out:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Unfl exception stack frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	Underflow Exception enabled:					#
 #	- The system stack is unchanged					#
@@ -849,24 +849,24 @@ fovfl_out:
 #									#
 # ALGORITHM ***********************************************************	#
 #	On the 060, if an FP underflow is present as the result of any	#
-# instruction, the 060 will take an underflow exception whether the 	#
-# exception is enabled or disabled in the FPCR. For the disabled case, 	#
+# instruction, the 060 will take an underflow exception whether the	#
+# exception is enabled or disabled in the FPCR. For the disabled case,	#
 # This handler emulates the instruction to determine what the correct	#
 # default result should be for the operation. This default result is	#
-# then stored in either the FP regfile, data regfile, or memory. 	#
-# Finally, the handler exits through the "callout" _fpsp_done() 	#
+# then stored in either the FP regfile, data regfile, or memory.	#
+# Finally, the handler exits through the "callout" _fpsp_done()		#
 # denoting that no exceptional conditions exist within the machine.	#
-# 	If the exception is enabled, then this handler must create the	#
+#	If the exception is enabled, then this handler must create the	#
 # exceptional operand and plave it in the fsave state frame, and store	#
-# the default result (only if the instruction is opclass 3). For 	#
-# exceptions enabled, this handler must exit through the "callout" 	#
+# the default result (only if the instruction is opclass 3). For	#
+# exceptions enabled, this handler must exit through the "callout"	#
 # _real_unfl() so that the operating system enabled overflow handler	#
 # can handle this case.							#
-#	Two other conditions exist. First, if underflow was disabled 	#
-# but the inexact exception was enabled and the result was inexact, 	#
+#	Two other conditions exist. First, if underflow was disabled	#
+# but the inexact exception was enabled and the result was inexact,	#
 # this handler must exit through the "callout" _real_inex().		#
 # was inexact.								#
-#	Also, in the case of an opclass three instruction where 	#
+#	Also, in the case of an opclass three instruction where		#
 # underflow was disabled and the trace exception was enabled, this	#
 # handler must exit through the "callout" _real_trace().		#
 #									#
@@ -881,12 +881,12 @@ _fpsp_unfl:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
-	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)	
+	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -905,13 +905,13 @@ _fpsp_unfl:
 	bsr.l		set_tag_x		# tag the operand type
 	mov.b		%d0,STAG(%a6)		# maybe NORM,DENORM
 
-# bit five of the fp ext word separates the monadic and dyadic operations 
+# bit five of the fp ext word separates the monadic and dyadic operations
 # that can pass through fpsp_unfl(). remember that fcmp, and ftst
 # will never take this exception.
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is op monadic or dyadic?
 	beq.b		funfl_extract		# monadic
 
-# now, what's left that's not dyadic is fsincos. we can distinguish it 
+# now, what's left that's not dyadic is fsincos. we can distinguish it
 # from all dyadics by the '0110xxx pattern
 	btst		&0x4,1+EXC_CMDREG(%a6)	# is op an fsincos?
 	bne.b		funfl_extract		# yes
@@ -962,7 +962,7 @@ funfl_extract:
 # (0x00000000_80000000_00000000), then the machine will take an
 # underflow exception. Since this is incorrect, we need to check
 # if our emulation, after re-doing the operation, decided that
-# no underflow was called for. We do these checks only in 
+# no underflow was called for. We do these checks only in
 # funfl_{unfl,inex}_on() because w/ both exceptions disabled, this
 # special case will simply exit gracefully with the correct result.
 
@@ -1002,7 +1002,7 @@ funfl_unfl_on:
 funfl_unfl_on2:
 	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP (fp1) to stack
 
-	mov.w		&0xe003,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe003,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -1021,7 +1021,7 @@ funfl_inex_on:
 # The `060 FPU multiplier hardware is such that if the result of a
 # multiply operation is the smallest possible normalized number
 # (0x00000000_80000000_00000000), then the machine will take an
-# underflow exception. 
+# underflow exception.
 # But, whether bogus or not, if inexact is enabled AND it occurred,
 # then we have to branch to real_inex.
 
@@ -1030,10 +1030,10 @@ funfl_inex_on:
 
 funfl_inex_on2:
 
-	fmovm.x		&0x40,FP_SRC(%a6) 	# save EXOP to stack
+	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP to stack
 
 	mov.b		&0xc4,1+EXC_VOFF(%a6)	# vector offset = 0xc4
-	mov.w		&0xe001,2+FP_SRC(%a6) 	# save exc status
+	mov.w		&0xe001,2+FP_SRC(%a6)	# save exc status
 
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
@@ -1119,7 +1119,7 @@ funfl_out:
 # INPUT ***************************************************************	#
 #	- The system stack contains the "Unimp Data Type" stk frame	#
 #	- The fsave frame contains the ssrc op (for UNNORM/DENORM)	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If Inexact exception (opclass 3):				#
 #	- The system stack is changed to an Inexact exception stk frame	#
@@ -1138,12 +1138,12 @@ funfl_out:
 #									#
 # ALGORITHM ***********************************************************	#
 #	Two main instruction types can enter here: (1) DENORM or UNNORM	#
-# unimplemented data types. These can be either opclass 0,2 or 3 	#
+# unimplemented data types. These can be either opclass 0,2 or 3	#
 # instructions, and (2) PACKED unimplemented data format instructions	#
 # also of opclasses 0,2, or 3.						#
 #	For UNNORM/DENORM opclass 0 and 2, the handler fetches the src	#
 # operand from the fsave state frame and the dst operand (if dyadic)	#
-# from the FP register file. The instruction is then emulated by 	#
+# from the FP register file. The instruction is then emulated by	#
 # choosing an emulation routine from a table of routines indexed by	#
 # instruction type. Once the instruction has been emulated and result	#
 # saved, then we check to see if any enabled exceptions resulted from	#
@@ -1165,7 +1165,7 @@ funfl_out:
 # (a Trace stack frame must be created here, too). If an FP exception	#
 # should occur, then we must create an exception stack frame of that	#
 # type and jump to either _real_snan(), _real_operr(), _real_inex(),	#
-# _real_unfl(), or _real_ovfl() as appropriate. PACKED opclass 3 	#
+# _real_unfl(), or _real_ovfl() as appropriate. PACKED opclass 3	#
 # emulation is performed in a similar manner.				#
 #									#
 #########################################################################
@@ -1177,7 +1177,7 @@ funfl_out:
 #				*****************
 #				*      EA	*
 #	 pre-instruction	*		*
-# 	*****************	*****************
+#	*****************	*****************
 #	* 0x0 *  0x0dc  *	* 0x3 *  0x0dc  *
 #	*****************	*****************
 #	*     Next	*	*     Next	*
@@ -1206,9 +1206,9 @@ _fpsp_unsupp:
 
 	fsave		FP_SRC(%a6)		# save fp state
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 	btst		&0x5,EXC_SR(%a6)	# user or supervisor mode?
 	bne.b		fu_s
@@ -1257,7 +1257,7 @@ fu_cont:
 	fmov.l		&0x0,%fpsr
 
 # Opclass two w/ memory-to-fpn operation will have an incorrect extended
-# precision format if the src format was single or double and the 
+# precision format if the src format was single or double and the
 # source data type was an INF, NAN, DENORM, or UNNORM
 	lea		FP_SRC(%a6),%a0		# pass ptr to input
 	bsr.l		fix_skewed_ops
@@ -1276,7 +1276,7 @@ fu_op2:
 
 	bfextu		EXC_CMDREG(%a6){&6:&3},%d0 # dyadic; load dst reg
 
-# bit five of the fp extension word separates the monadic and dyadic operations 
+# bit five of the fp extension word separates the monadic and dyadic operations
 # at this point
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is operation monadic or dyadic?
 	beq.b		fu_extract		# monadic
@@ -1307,13 +1307,13 @@ fu_extract:
 
 #
 # Exceptions in order of precedence:
-# 	BSUN	: none
+#	BSUN	: none
 #	SNAN	: all dyadic ops
 #	OPERR	: fsqrt(-NORM)
 #	OVFL	: all except ftst,fcmp
 #	UNFL	: all except ftst,fcmp
 #	DZ	: fdiv
-# 	INEX2	: all except ftst,fcmp
+#	INEX2	: all except ftst,fcmp
 #	INEX1	: none (packed doesn't go through here)
 #
 
@@ -1350,16 +1350,16 @@ fu_in_ena:
 #
 # No exceptions occurred that were also enabled. Now:
 #
-#   	if (OVFL && ovfl_disabled && inexact_enabled) {
+#	if (OVFL && ovfl_disabled && inexact_enabled) {
 #	    branch to _real_inex() (even if the result was exact!);
-#     	} else {
+#	} else {
 #	    save the result in the proper fp reg (unless the op is fcmp or ftst);
 #	    return;
-#     	}
+#	}
 #
 	btst		&ovfl_bit,FPSR_EXCEPT(%a6) # was overflow set?
 	beq.b		fu_in_cont		# no
-	
+
 fu_in_ovflchk:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # was inexact enabled?
 	beq.b		fu_in_cont		# no
@@ -1379,7 +1379,7 @@ fu_in_ovflchk:
 #	} else {
 #		restore exc state (SNAN||OPERR||OVFL||UNFL||DZ||INEX) into the FPU;
 #	}
-#	    		
+#
 fu_in_exc:
 	subi.l		&24,%d0			# fix offset to be 0-8
 	cmpi.b		%d0,&0x6		# is exception INEX? (6)
@@ -1392,7 +1392,7 @@ fu_in_exc:
 	bne.w		fu_in_exc_ovfl		# yes
 
 # here, we insert the correct fsave status value into the fsave frame for the
-# corresponding exception. the operand in the fsave frame should be the original 
+# corresponding exception. the operand in the fsave frame should be the original
 # src operand.
 fu_in_exc_exit:
 	mov.l		%d0,-(%sp)		# save d0
@@ -1423,8 +1423,8 @@ fu_in_exc_ovfl:
 	bra.b		fu_in_exc_exit
 
 # If the input operand to this operation was opclass two and a single
-# or double precision denorm, inf, or nan, the operand needs to be 
-# "corrected" in order to have the proper equivalent extended precision 
+# or double precision denorm, inf, or nan, the operand needs to be
+# "corrected" in order to have the proper equivalent extended precision
 # number.
 	global		fix_skewed_ops
 fix_skewed_ops:
@@ -1452,7 +1452,7 @@ fso_sgl_dnrm:
 	bsr.l		norm			# normalize mantissa
 	neg.w		%d0			# -shft amt
 	addi.w		&0x3f81,%d0		# adjust new exponent
-	andi.w		&0x8000,LOCAL_EX(%a0) 	# clear old exponent
+	andi.w		&0x8000,LOCAL_EX(%a0)	# clear old exponent
 	or.w		%d0,LOCAL_EX(%a0)	# insert new exponent
 	rts
 
@@ -1461,7 +1461,7 @@ fso_zero:
 	rts
 
 fso_infnan:
-	andi.b		&0x7f,LOCAL_HI(%a0) 	# clear j-bit
+	andi.b		&0x7f,LOCAL_HI(%a0)	# clear j-bit
 	ori.w		&0x7fff,LOCAL_EX(%a0)	# make exponent = $7fff
 	rts
 
@@ -1484,7 +1484,7 @@ fso_dbl_dnrm:
 	bsr.l		norm			# normalize mantissa
 	neg.w		%d0			# -shft amt
 	addi.w		&0x3c01,%d0		# adjust new exponent
-	andi.w		&0x8000,LOCAL_EX(%a0) 	# clear old exponent
+	andi.w		&0x8000,LOCAL_EX(%a0)	# clear old exponent
 	or.w		%d0,LOCAL_EX(%a0)	# insert new exponent
 	rts
 
@@ -1536,13 +1536,13 @@ fu_out_cont:
 	bsr.l		fout			# call fmove out routine
 
 # Exceptions in order of precedence:
-# 	BSUN	: none
+#	BSUN	: none
 #	SNAN	: none
 #	OPERR	: fmove.{b,w,l} out of large UNNORM
 #	OVFL	: fmove.{s,d}
 #	UNFL	: fmove.{s,d,x}
 #	DZ	: none
-# 	INEX2	: all
+#	INEX2	: all
 #	INEX1	: none (packed doesn't travel through here)
 
 # determine the highest priority exception(if any) set by the
@@ -1554,7 +1554,7 @@ fu_out_done:
 
 	mov.l		EXC_A6(%a6),(%a6)	# in case a6 changed
 
-# on extended precision opclass three instructions using pre-decrement or 
+# on extended precision opclass three instructions using pre-decrement or
 # post-increment addressing mode, the address register is not updated. is the
 # address register was the stack pointer used from user mode, then let's update
 # it here. if it was used from supervisor mode, then we have to handle this
@@ -1578,7 +1578,7 @@ fu_out_done_cont:
 	bra.l		_fpsp_done
 
 # is the ea mode pre-decrement of the stack pointer from supervisor mode?
-# ("fmov.x fpm,-(a7)") if so, 
+# ("fmov.x fpm,-(a7)") if so,
 fu_out_done_s:
 	cmpi.b		SPCOND_FLG(%a6),&mda7_flg
 	bne.b		fu_out_done_cont
@@ -1616,7 +1616,7 @@ fu_out_ena:
 	bfffo		%d0{&24:&8},%d0		# find highest priority exception
 	bne.b		fu_out_exc		# there is at least one set
 
-# no exceptions were set. 
+# no exceptions were set.
 # if a disabled overflow occurred and inexact was enabled but the result
 # was exact, then a branch to _real_inex() is made.
 	btst		&ovfl_bit,FPSR_EXCEPT(%a6) # was overflow set?
@@ -1633,7 +1633,7 @@ fu_out_ovflchk:
 # from FPIAR and put it in the trace stack frame then jump to _real_trace().
 #
 #		  UNSUPP FRAME		   TRACE FRAME
-# 		*****************	*****************
+#		*****************	*****************
 #		*      EA	*	*    Current	*
 #		*		*	*      PC	*
 #		*****************	*****************
@@ -1650,7 +1650,7 @@ fu_out_trace:
 	fmov.l		%fpiar,0x8(%sp)
 	bra.l		_real_trace
 
-# an exception occurred and that exception was enabled. 	
+# an exception occurred and that exception was enabled.
 fu_out_exc:
 	subi.l		&24,%d0			# fix offset to be 0-8
 
@@ -1662,15 +1662,15 @@ fu_out_exc:
 	swbeg		&0x8
 tbl_fu_out:
 	short		tbl_fu_out	- tbl_fu_out	# BSUN can't happen
-	short		tbl_fu_out 	- tbl_fu_out	# SNAN can't happen
+	short		tbl_fu_out	- tbl_fu_out	# SNAN can't happen
 	short		fu_operr	- tbl_fu_out	# OPERR
-	short		fu_ovfl 	- tbl_fu_out	# OVFL
-	short		fu_unfl 	- tbl_fu_out	# UNFL
+	short		fu_ovfl		- tbl_fu_out	# OVFL
+	short		fu_unfl		- tbl_fu_out	# UNFL
 	short		tbl_fu_out	- tbl_fu_out	# DZ can't happen
-	short		fu_inex 	- tbl_fu_out	# INEX2
+	short		fu_inex		- tbl_fu_out	# INEX2
 	short		tbl_fu_out	- tbl_fu_out	# INEX1 won't make it here
 
-# for snan,operr,ovfl,unfl, src op is still in FP_SRC so just 
+# for snan,operr,ovfl,unfl, src op is still in FP_SRC so just
 # frestore it.
 fu_snan:
 	fmovm.x		EXC_FPREGS(%a6),&0xc0	# restore fp0/fp1
@@ -1721,7 +1721,7 @@ fu_ovfl:
 # underflow can happen for extended precision. extended precision opclass
 # three instruction exceptions don't update the stack pointer. so, if the
 # exception occurred from user mode, then simply update a7 and exit normally.
-# if the exception occurred from supervisor mode, check if 
+# if the exception occurred from supervisor mode, check if
 fu_unfl:
 	mov.l		EXC_A6(%a6),(%a6)	# restore a6
 
@@ -1730,7 +1730,7 @@ fu_unfl:
 
 	mov.l		EXC_A7(%a6),%a0		# restore a7 whether we need
 	mov.l		%a0,%usp		# to or not...
-	
+
 fu_unfl_cont:
 	fmovm.x		&0x40,FP_SRC(%a6)	# save EXOP to the stack
 
@@ -1821,7 +1821,7 @@ fu_in_pack:
 
 	bfextu		EXC_CMDREG(%a6){&6:&3},%d0 # dyadic; load dst reg
 
-# bit five of the fp extension word separates the monadic and dyadic operations 
+# bit five of the fp extension word separates the monadic and dyadic operations
 # at this point
 	btst		&0x5,1+EXC_CMDREG(%a6)	# is operation monadic or dyadic?
 	beq.b		fu_extract_p		# monadic
@@ -1852,13 +1852,13 @@ fu_extract_p:
 
 #
 # Exceptions in order of precedence:
-# 	BSUN	: none
+#	BSUN	: none
 #	SNAN	: all dyadic ops
 #	OPERR	: fsqrt(-NORM)
 #	OVFL	: all except ftst,fcmp
 #	UNFL	: all except ftst,fcmp
 #	DZ	: fdiv
-# 	INEX2	: all except ftst,fcmp
+#	INEX2	: all except ftst,fcmp
 #	INEX1	: all
 #
 
@@ -1928,16 +1928,16 @@ fu_in_ena_p:
 #
 # No exceptions occurred that were also enabled. Now:
 #
-#   	if (OVFL && ovfl_disabled && inexact_enabled) {
+#	if (OVFL && ovfl_disabled && inexact_enabled) {
 #	    branch to _real_inex() (even if the result was exact!);
-#     	} else {
+#	} else {
 #	    save the result in the proper fp reg (unless the op is fcmp or ftst);
 #	    return;
-#     	}
+#	}
 #
 	btst		&ovfl_bit,FPSR_EXCEPT(%a6) # was overflow set?
 	beq.w		fu_in_cont_p		# no
-	
+
 fu_in_ovflchk_p:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # was inexact enabled?
 	beq.w		fu_in_cont_p		# no
@@ -1957,7 +1957,7 @@ fu_in_ovflchk_p:
 #	} else {
 #		restore exc state (SNAN||OPERR||OVFL||UNFL||DZ||INEX) into the FPU;
 #	}
-#	    		
+#
 fu_in_exc_p:
 	subi.l		&24,%d0			# fix offset to be 0-8
 	cmpi.b		%d0,&0x6		# is exception INEX? (6 or 7)
@@ -1970,7 +1970,7 @@ fu_in_exc_p:
 	bne.w		fu_in_exc_ovfl_p	# yes
 
 # here, we insert the correct fsave status value into the fsave frame for the
-# corresponding exception. the operand in the fsave frame should be the original 
+# corresponding exception. the operand in the fsave frame should be the original
 # src operand.
 # as a reminder for future predicted pain and agony, we are passing in fsave the
 # "non-skewed" operand for cases of sgl and dbl src INFs,NANs, and DENORMs.
@@ -2033,21 +2033,21 @@ fu_in_exc_exit_s_p:
 	bne.b		fu_trace_p		# yes
 
 	bra.l		_fpsp_done		# exit to os
-	
+
 #
-# The opclass two PACKED instruction that took an "Unimplemented Data Type" 
-# exception was being traced. Make the "current" PC the FPIAR and put it in the 
+# The opclass two PACKED instruction that took an "Unimplemented Data Type"
+# exception was being traced. Make the "current" PC the FPIAR and put it in the
 # trace stack frame then jump to _real_trace().
-#					
+#
 #		  UNSUPP FRAME		   TRACE FRAME
 #		*****************	*****************
 #		*      EA	*	*    Current	*
 #		*		*	*      PC	*
 #		*****************	*****************
-#		* 0x2 *	0x0dc	* 	* 0x2 *  0x024	*
+#		* 0x2 *	0x0dc	*	* 0x2 *  0x024	*
 #		*****************	*****************
 #		*     Next	*	*     Next	*
-#		*      PC	*      	*      PC	*
+#		*      PC	*	*      PC	*
 #		*****************	*****************
 #		*      SR	*	*      SR	*
 #		*****************	*****************
@@ -2093,13 +2093,13 @@ fu_op2_p:
 	bsr.l		fout			# call fmove out routine
 
 # Exceptions in order of precedence:
-# 	BSUN	: no
+#	BSUN	: no
 #	SNAN	: yes
 #	OPERR	: if ((k_factor > +17) || (dec. exp exceeds 3 digits))
 #	OVFL	: no
 #	UNFL	: no
 #	DZ	: no
-# 	INEX2	: yes
+#	INEX2	: yes
 #	INEX1	: no
 
 # determine the highest priority exception(if any) set by the
@@ -2163,7 +2163,7 @@ fu_out_ena_p:
 
 	mov.l		EXC_A6(%a6),(%a6)	# restore a6
 
-# an exception occurred and that exception was enabled. 	
+# an exception occurred and that exception was enabled.
 # the only exception possible on packed move out are INEX, OPERR, and SNAN.
 fu_out_exc_p:
 	cmpi.b		%d0,&0x1a
@@ -2190,7 +2190,7 @@ fu_snan_s_p:
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	mov.w		&0x30d8,EXC_VOFF(%a6)	# vector offset = 0xd0
-	mov.w		&0xe006,2+FP_SRC(%a6) 	# set fsave status
+	mov.w		&0xe006,2+FP_SRC(%a6)	# set fsave status
 
 	frestore	FP_SRC(%a6)		# restore src operand
 
@@ -2230,7 +2230,7 @@ fu_operr_p_s:
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	mov.w		&0x30d0,EXC_VOFF(%a6)	# vector offset = 0xd0
-	mov.w		&0xe004,2+FP_SRC(%a6) 	# set fsave status
+	mov.w		&0xe004,2+FP_SRC(%a6)	# set fsave status
 
 	frestore	FP_SRC(%a6)		# restore src operand
 
@@ -2269,8 +2269,8 @@ fu_inex_s_p2:
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
-	mov.w		&0x30c4,EXC_VOFF(%a6) 	# vector offset = 0xc4
-	mov.w		&0xe001,2+FP_SRC(%a6) 	# set fsave status
+	mov.w		&0x30c4,EXC_VOFF(%a6)	# vector offset = 0xc4
+	mov.w		&0xe001,2+FP_SRC(%a6)	# set fsave status
 
 	frestore	FP_SRC(%a6)		# restore src operand
 
@@ -2311,7 +2311,7 @@ funimp_skew_sgl:
 	andi.w		&0x7fff,%d0		# strip sign
 	beq.b		funimp_skew_sgl_not
 	cmpi.w		%d0,&0x3f80
-	bgt.b		funimp_skew_sgl_not		
+	bgt.b		funimp_skew_sgl_not
 	neg.w		%d0			# make exponent negative
 	addi.w		&0x3f81,%d0		# find amt to shift
 	mov.l		FP_SRC_HI(%a6),%d1	# fetch DENORM hi(man)
@@ -2328,7 +2328,7 @@ funimp_skew_dbl:
 	andi.w		&0x7fff,%d0		# strip sign
 	beq.b		funimp_skew_dbl_not
 	cmpi.w		%d0,&0x3c00
-	bgt.b		funimp_skew_dbl_not		
+	bgt.b		funimp_skew_dbl_not
 
 	tst.b		FP_SRC_EX(%a6)		# make "internal format"
 	smi.b		0x2+FP_SRC(%a6)
@@ -2361,7 +2361,7 @@ _mem_write2:
 #########################################################################
 # XDEF ****************************************************************	#
 #	_fpsp_effadd(): 060FPSP entry point for FP "Unimplemented	#
-#		     	effective address" exception.			#
+#			effective address" exception.			#
 #									#
 #	This handler should be the first code executed upon taking the	#
 #	FP Unimplemented Effective Address exception in an operating	#
@@ -2386,7 +2386,7 @@ _mem_write2:
 #									#
 # INPUT ***************************************************************	#
 #	- The system stack contains the "Unimplemented <ea>" stk frame	#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If access error:						#
 #	- The system stack is changed to an access error stack frame	#
@@ -2407,17 +2407,17 @@ _mem_write2:
 #	For immediate data operations, the data is read in w/ a		#
 # _mem_read() "callout", converted to FP binary (if packed), and used	#
 # as the source operand to the instruction specified by the instruction	#
-# word. If no FP exception should be reported ads a result of the 	#
+# word. If no FP exception should be reported ads a result of the	#
 # emulation, then the result is stored to the destination register and	#
 # the handler exits through _fpsp_done(). If an enabled exc has been	#
 # signalled as a result of emulation, then an fsave state frame		#
 # corresponding to the FP exception type must be entered into the 060	#
-# FPU before exiting. In either the enabled or disabled cases, we 	#
+# FPU before exiting. In either the enabled or disabled cases, we	#
 # must also check if a Trace exception is pending, in which case, we	#
 # must create a Trace exception stack frame from the current exception	#
 # stack frame. If no Trace is pending, we simply exit through		#
 # _fpsp_done().								#
-#	For "fmovm.x", call the routine fmovm_dynamic() which will 	#
+#	For "fmovm.x", call the routine fmovm_dynamic() which will	#
 # decode and emulate the instruction. No FP exceptions can be pending	#
 # as a result of this operation emulation. A Trace exception can be	#
 # pending, though, which means the current stack frame must be changed	#
@@ -2436,11 +2436,11 @@ _mem_write2:
 # before the "FPU disabled" exception, but the "FPU disabled" exception	#
 # has higher priority, we check the disabled bit in the PCR. If set,	#
 # then we must create an 8 word "FPU disabled" exception stack frame	#
-# from the current 4 word exception stack frame. This includes 		#
-# reproducing the effective address of the instruction to put on the 	#
+# from the current 4 word exception stack frame. This includes		#
+# reproducing the effective address of the instruction to put on the	#
 # new stack frame.							#
 #									#
-# 	In the process of all emulation work, if a _mem_read()		#
+#	In the process of all emulation work, if a _mem_read()		#
 # "callout" returns a failing result indicating an access error, then	#
 # we must create an access error stack frame from the current stack	#
 # frame. This information includes a faulting address and a fault-	#
@@ -2481,18 +2481,18 @@ _fpsp_effadd:
 
 #
 # here, we will have:
-# 	fabs	fdabs	fsabs		facos		fmod
+#	fabs	fdabs	fsabs		facos		fmod
 #	fadd	fdadd	fsadd		fasin		frem
-# 	fcmp				fatan		fscale
+#	fcmp				fatan		fscale
 #	fdiv	fddiv	fsdiv		fatanh		fsin
 #	fint				fcos		fsincos
 #	fintrz				fcosh		fsinh
 #	fmove	fdmove	fsmove		fetox		ftan
-# 	fmul	fdmul	fsmul		fetoxm1		ftanh
+#	fmul	fdmul	fsmul		fetoxm1		ftanh
 #	fneg	fdneg	fsneg		fgetexp		ftentox
 #	fsgldiv				fgetman		ftwotox
-# 	fsglmul				flog10
-# 	fsqrt				flog2
+#	fsglmul				flog10
+#	fsqrt				flog2
 #	fsub	fdsub	fssub		flogn
 #	ftst				flognp1
 # which can all use f<op>.{x,p}
@@ -2584,8 +2584,8 @@ iea_op_spec:
 # store a result. then, only fcmp will branch back and pick up a dst operand.
 	st		STORE_FLG(%a6)		# don't store a final result
 	btst		&0x1,1+EXC_CMDREG(%a6)	# is operation fcmp?
-	beq.b		iea_op_loaddst		# yes	
-	
+	beq.b		iea_op_loaddst		# yes
+
 iea_op_extract:
 	clr.l		%d0
 	mov.b		FPCR_MODE(%a6),%d0	# pass: rnd mode,prec
@@ -2658,7 +2658,7 @@ iea_op_ovfl:
 	btst		&inex2_bit,FPCR_ENABLE(%a6) # is inexact enabled?
 	beq.b		iea_op_store		# no
 	bra.b		iea_op_exc_ovfl		# yes
-	
+
 # an enabled exception occurred. we have to insert the exception type back into
 # the machine.
 iea_op_exc:
@@ -2697,7 +2697,7 @@ iea_op_exit2:
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
 	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
-	frestore 	FP_SRC(%a6)		# restore exceptional state
+	frestore	FP_SRC(%a6)		# restore exceptional state
 
 	unlk		%a6			# unravel the frame
 
@@ -2705,12 +2705,12 @@ iea_op_exit2:
 	bne.b		iea_op_trace		# yes
 
 	bra.l		_fpsp_done		# exit to os
-	
+
 #
 # The opclass two instruction that took an "Unimplemented Effective Address"
 # exception was being traced. Make the "current" PC the FPIAR and put it in
 # the trace stack frame then jump to _real_trace().
-#					
+#
 #		 UNIMP EA FRAME		   TRACE FRAME
 #		*****************	*****************
 #		* 0x0 *  0x0f0	*	*    Current	*
@@ -2743,7 +2743,7 @@ iea_fmovm_data:
 
 iea_fmovm_data_u:
 	mov.l		%usp,%a0
-	mov.l		%a0,EXC_A7(%a6)		# store current a7	
+	mov.l		%a0,EXC_A7(%a6)		# store current a7
 	bsr.l		fmovm_dynamic		# do dynamic fmovm
 	mov.l		EXC_A7(%a6),%a0		# load possibly new a7
 	mov.l		%a0,%usp		# update usp
@@ -2774,10 +2774,10 @@ iea_fmovm_data_postinc:
 
 	lea		(EXC_SR,%a6,%d0),%a0
 	mov.l		%a0,EXC_SR(%a6)
-	
+
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 	mov.l		(%sp)+,%sp
@@ -2791,15 +2791,15 @@ iea_fmovm_data_pi_trace:
 
 	lea		(EXC_SR-0x4,%a6,%d0),%a0
 	mov.l		%a0,EXC_SR(%a6)
-	
+
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	unlk		%a6
 	mov.l		(%sp)+,%sp
 	bra.l		_real_trace
-	
+
 # right now, d1 = size and d0 = the strg.
 iea_fmovm_data_predec:
 	mov.b		%d1,EXC_VOFF(%a6)	# store strg
@@ -2807,7 +2807,7 @@ iea_fmovm_data_predec:
 
 	fmovm.x		EXC_FP0(%a6),&0xc0	# restore fp0-fp1
 	fmovm.l		USER_FPCR(%a6),%fpcr,%fpsr,%fpiar # restore ctrl regs
- 	movm.l		EXC_DREGS(%a6),&0x0303 	# restore d0-d1/a0-a1
+	movm.l		EXC_DREGS(%a6),&0x0303	# restore d0-d1/a0-a1
 
 	mov.l		(%a6),-(%sp)		# make a copy of a6
 	mov.l		%d0,-(%sp)		# save d0
@@ -2909,10 +2909,10 @@ iea_fmovm_exit:
 
 #
 # The control reg instruction that took an "Unimplemented Effective Address"
-# exception was being traced. The "Current PC" for the trace frame is the 
+# exception was being traced. The "Current PC" for the trace frame is the
 # PC stacked for Unimp EA. The "Next PC" is in EXC_EXTWPTR.
 # After fixing the stack frame, jump to _real_trace().
-#					
+#
 #		 UNIMP EA FRAME		   TRACE FRAME
 #		*****************	*****************
 #		* 0x0 *  0x0f0	*	*    Current	*
@@ -3065,7 +3065,7 @@ iea_dacc_cont:
 #	_fpsp_operr(): 060FPSP entry point for FP Operr exception.	#
 #									#
 #	This handler should be the first code executed upon taking the	#
-# 	FP Operand Error exception in an operating system.		#
+#	FP Operand Error exception in an operating system.		#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read instruction longword			#
@@ -3078,7 +3078,7 @@ iea_dacc_cont:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Operr exception frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	No access error:						#
 #	- The system stack is unchanged					#
@@ -3087,16 +3087,16 @@ iea_dacc_cont:
 # ALGORITHM ***********************************************************	#
 #	In a system where the FP Operr exception is enabled, the goal	#
 # is to get to the handler specified at _real_operr(). But, on the 060,	#
-# for opclass zero and two instruction taking this exception, the 	#
+# for opclass zero and two instruction taking this exception, the	#
 # input operand in the fsave frame may be incorrect for some cases	#
 # and needs to be corrected. This handler calls fix_skewed_ops() to	#
 # do just this and then exits through _real_operr().			#
 #	For opclass 3 instructions, the 060 doesn't store the default	#
 # operr result out to memory or data register file as it should.	#
 # This code must emulate the move out before finally exiting through	#
-# _real_inex(). The move out, if to memory, is performed using 		#
+# _real_inex(). The move out, if to memory, is performed using		#
 # _mem_write() "callout" routines that may return a failing result.	#
-# In this special case, the handler must exit through facc_out() 	#
+# In this special case, the handler must exit through facc_out()	#
 # which creates an access error stack frame from the current operr	#
 # stack frame.								#
 #									#
@@ -3109,13 +3109,13 @@ _fpsp_operr:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3129,7 +3129,7 @@ _fpsp_operr:
 
 # here, we simply see if the operand in the fsave frame needs to be "unskewed".
 # this would be the case for opclass two operations with a source infinity or
-# denorm operand in the sgl or dbl format. NANs also become skewed, but can't 
+# denorm operand in the sgl or dbl format. NANs also become skewed, but can't
 # cause an operr so we don't need to check for them here.
 	lea		FP_SRC(%a6),%a0		# pass: ptr to src op
 	bsr.l		fix_skewed_ops		# fix src op
@@ -3200,7 +3200,7 @@ tbl_operr:
 	short		tbl_operr    - tbl_operr # dbl prec shouldn't happen
 	short		foperr_out_b - tbl_operr # byte integer
 	short		tbl_operr    - tbl_operr # packed won't enter here
-	
+
 foperr_out_b:
 	mov.b		L_SCR1(%a6),%d0		# load positive default result
 	cmpi.b		%d1,&0x7		# is <ea> mode a data reg?
@@ -3254,7 +3254,7 @@ foperr_out_l_save_dn:
 #	_fpsp_snan(): 060FPSP entry point for FP SNAN exception.	#
 #									#
 #	This handler should be the first code executed upon taking the	#
-# 	FP Signalling NAN exception in an operating system.		#
+#	FP Signalling NAN exception in an operating system.		#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read instruction longword			#
@@ -3268,7 +3268,7 @@ foperr_out_l_save_dn:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP SNAN exception frame		#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	No access error:						#
 #	- The system stack is unchanged					#
@@ -3277,16 +3277,16 @@ foperr_out_l_save_dn:
 # ALGORITHM ***********************************************************	#
 #	In a system where the FP SNAN exception is enabled, the goal	#
 # is to get to the handler specified at _real_snan(). But, on the 060,	#
-# for opclass zero and two instructions taking this exception, the 	#
+# for opclass zero and two instructions taking this exception, the	#
 # input operand in the fsave frame may be incorrect for some cases	#
 # and needs to be corrected. This handler calls fix_skewed_ops() to	#
 # do just this and then exits through _real_snan().			#
 #	For opclass 3 instructions, the 060 doesn't store the default	#
 # SNAN result out to memory or data register file as it should.		#
 # This code must emulate the move out before finally exiting through	#
-# _real_snan(). The move out, if to memory, is performed using 		#
+# _real_snan(). The move out, if to memory, is performed using		#
 # _mem_write() "callout" routines that may return a failing result.	#
-# In this special case, the handler must exit through facc_out() 	#
+# In this special case, the handler must exit through facc_out()	#
 # which creates an access error stack frame from the current SNAN	#
 # stack frame.								#
 #	For the case of an extended precision opclass 3 instruction,	#
@@ -3305,13 +3305,13 @@ _fpsp_snan:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3339,7 +3339,7 @@ fsnan_exit:
 
 	unlk		%a6
 	bra.l		_real_snan
-		
+
 ########################################################################
 
 #
@@ -3349,7 +3349,7 @@ fsnan_exit:
 #
 # byte, word, long, and packed destination format operations can pass
 # through here. since packed format operations already were handled by
-# fpsp_unsupp(), then we need to do nothing else for them here. 
+# fpsp_unsupp(), then we need to do nothing else for them here.
 # for byte, word, and long, we simply need to test the sign of the src
 # operand and save the appropriate minimum or maximum integer value
 # to the effective address as pointed to by the stacked effective address.
@@ -3370,7 +3370,7 @@ tbl_snan:
 	short		fsnan_out_d - tbl_snan # dbl prec shouldn't happen
 	short		fsnan_out_b - tbl_snan # byte integer
 	short		tbl_snan    - tbl_snan # packed needs no help
-	
+
 fsnan_out_b:
 	mov.b		FP_SRC_HI(%a6),%d0	# load upper byte of SNAN
 	bset		&6,%d0			# set SNAN bit
@@ -3496,7 +3496,7 @@ fsnan_out_x:
 	mov.l		%usp,%a0		# fetch user stack pointer
 	mov.l		%a0,EXC_A7(%a6)		# save on stack for calc_ea()
 	mov.l		(%a6),EXC_A6(%a6)
-	
+
 	bsr.l		_calc_ea_fout		# find the correct ea,update An
 	mov.l		%a0,%a1
 	mov.l		%a0,EXC_EA(%a6)		# stack correct <ea>
@@ -3545,7 +3545,7 @@ fsnan_out_x_s:
 	mov.l		LOCAL_SIZE+FP_SCR0_LO(%sp),LOCAL_SIZE+EXC_EA(%sp)
 
 	add.l		&LOCAL_SIZE-0x8,%sp
-	
+
 	bra.l		_real_snan
 
 #########################################################################
@@ -3553,7 +3553,7 @@ fsnan_out_x_s:
 #	_fpsp_inex(): 060FPSP entry point for FP Inexact exception.	#
 #									#
 #	This handler should be the first code executed upon taking the	#
-# 	FP Inexact exception in an operating system.			#
+#	FP Inexact exception in an operating system.			#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read instruction longword			#
@@ -3570,7 +3570,7 @@ fsnan_out_x_s:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP Inexact exception frame	#
 #	- The fsave frame contains the source operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	- The system stack is unchanged					#
 #	- The fsave frame contains the adjusted src op for opclass 0,2	#
@@ -3578,10 +3578,10 @@ fsnan_out_x_s:
 # ALGORITHM ***********************************************************	#
 #	In a system where the FP Inexact exception is enabled, the goal	#
 # is to get to the handler specified at _real_inex(). But, on the 060,	#
-# for opclass zero and two instruction taking this exception, the 	#
+# for opclass zero and two instruction taking this exception, the	#
 # hardware doesn't store the correct result to the destination FP	#
-# register as did the '040 and '881/2. This handler must emulate the 	#
-# instruction in order to get this value and then store it to the 	#
+# register as did the '040 and '881/2. This handler must emulate the	#
+# instruction in order to get this value and then store it to the	#
 # correct register before calling _real_inex().				#
 #	For opclass 3 instructions, the 060 doesn't store the default	#
 # inexact result out to memory or data register file as it should.	#
@@ -3597,13 +3597,13 @@ _fpsp_inex:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3615,7 +3615,7 @@ _fpsp_inex:
 	bne.w		finex_out		# fmove out
 
 
-# the hardware, for "fabs" and "fneg" w/ a long source format, puts the 
+# the hardware, for "fabs" and "fneg" w/ a long source format, puts the
 # longword integer directly into the upper longword of the mantissa along
 # w/ an exponent value of 0x401e. we convert this to extended precision here.
 	bfextu		%d0{&19:&3},%d0		# fetch instr size
@@ -3749,7 +3749,7 @@ finex_out:
 # INPUT ***************************************************************	#
 #	- The system stack contains the FP DZ exception stack.		#
 #	- The fsave frame contains the source operand.			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	- The system stack contains the FP DZ exception stack.		#
 #	- The fsave frame contains the adjusted source operand.		#
@@ -3760,7 +3760,7 @@ finex_out:
 # exception is taken, the input operand in the fsave state frame may	#
 # be incorrect for some cases and need to be adjusted. So, this package	#
 # adjusts the operand using fix_skewed_ops() and then branches to	#
-# _real_dz(). 								#
+# _real_dz().								#
 #									#
 #########################################################################
 
@@ -3771,13 +3771,13 @@ _fpsp_dz:
 
 	fsave		FP_SRC(%a6)		# grab the "busy" frame
 
- 	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
+	movm.l		&0x0303,EXC_DREGS(%a6)	# save d0-d1/a0-a1
 	fmovm.l		%fpcr,%fpsr,%fpiar,USER_FPCR(%a6) # save ctrl regs
- 	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
+	fmovm.x		&0xc0,EXC_FPREGS(%a6)	# save fp0-fp1 on stack
 
 # the FPIAR holds the "current PC" of the faulting instruction
 	mov.l		USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long		# fetch the instruction words
@@ -3805,7 +3805,7 @@ fdz_exit:
 #########################################################################
 # XDEF ****************************************************************	#
 #	_fpsp_fline(): 060FPSP entry point for "Line F emulator"	#
-#		       exception when the "reduced" version of the 	#
+#		       exception when the "reduced" version of the	#
 #		       FPSP is implemented that does not emulate	#
 #		       FP unimplemented instructions.			#
 #									#
@@ -3820,12 +3820,12 @@ fdz_exit:
 # INPUT ***************************************************************	#
 #	- The system stack contains a "Line F Emulator" exception	#
 #	  stack frame.							#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	- The system stack is unchanged.				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	When a "Line F Emulator" exception occurs in a system where	#
+#	When a "Line F Emulator" exception occurs in a system where	#
 # "FPU Unimplemented" instructions will not be emulated, the exception	#
 # can occur because then FPU is disabled or the instruction is to be	#
 # classifed as "Line F". This module determines which case exists and	#
@@ -3853,21 +3853,21 @@ _fpsp_fline:
 #									#
 # INPUT ***************************************************************	#
 #	d0 = number of bytes to adjust <ea> by				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	None								#
 #									#
 # ALGORITHM ***********************************************************	#
 # "Dummy" CALCulate Effective Address:					#
-# 	The stacked <ea> for FP unimplemented instructions and opclass	#
+#	The stacked <ea> for FP unimplemented instructions and opclass	#
 #	two packed instructions is correct with the exception of...	#
 #									#
 #	1) -(An)   : The register is not updated regardless of size.	#
-#		     Also, for extended precision and packed, the 	#
+#		     Also, for extended precision and packed, the	#
 #		     stacked <ea> value is 8 bytes too big		#
 #	2) (An)+   : The register is not updated.			#
-#	3) #<data> : The upper longword of the immediate operand is 	#
-#		     stacked b,w,l and s sizes are completely stacked. 	#
+#	3) #<data> : The upper longword of the immediate operand is	#
+#		     stacked b,w,l and s sizes are completely stacked.	#
 #		     d,x, and p are not.				#
 #									#
 #########################################################################
@@ -3903,8 +3903,8 @@ dcea_imm:
 	lea		([USER_FPIAR,%a6],0x4),%a0 # no; return <ea>
 	rts
 
-# here, the <ea> is stacked correctly. however, we must update the 
-# address register...	
+# here, the <ea> is stacked correctly. however, we must update the
+# address register...
 dcea_pi:
 	mov.l		%a0,%d0			# pass amt to inc by
 	bsr.l		inc_areg		# inc addr register
@@ -3912,7 +3912,7 @@ dcea_pi:
 	mov.l		EXC_EA(%a6),%a0		# stacked <ea> is correct
 	rts
 
-# the <ea> is stacked correctly for all but extended and packed which 
+# the <ea> is stacked correctly for all but extended and packed which
 # the <ea>s are 8 bytes too large.
 # it would make no sense to have a pre-decrement to a7 in supervisor
 # mode so we don't even worry about this tricky case here : )
@@ -3932,7 +3932,7 @@ dcea_pd2:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_calc_ea_fout(): calculate correct stacked <ea> for extended	#
+#	_calc_ea_fout(): calculate correct stacked <ea> for extended	#
 #			 and packed data opclass 3 operations.		#
 #									#
 # XREF ****************************************************************	#
@@ -3940,22 +3940,22 @@ dcea_pd2:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	a0 = return correct effective address				#
 #									#
 # ALGORITHM ***********************************************************	#
 #	For opclass 3 extended and packed data operations, the <ea>	#
 # stacked for the exception is incorrect for -(an) and (an)+ addressing	#
-# modes. Also, while we're at it, the index register itself must get 	#
+# modes. Also, while we're at it, the index register itself must get	#
 # updated.								#
-# 	So, for -(an), we must subtract 8 off of the stacked <ea> value	#
+#	So, for -(an), we must subtract 8 off of the stacked <ea> value	#
 # and return that value as the correct <ea> and store that value in An.	#
 # For (an)+, the stacked <ea> is correct but we must adjust An by +12.	#
 #									#
 #########################################################################
 
-# This calc_ea is currently used to retrieve the correct <ea> 
+# This calc_ea is currently used to retrieve the correct <ea>
 # for fmove outs of type extended and packed.
 	global		_calc_ea_fout
 _calc_ea_fout:
@@ -3976,7 +3976,7 @@ _calc_ea_fout:
 
 # (An)+ : extended and packed fmove out
 #	: stacked <ea> is correct
-#	: "An" not updated 
+#	: "An" not updated
 ceaf_pi:
 	mov.w		(tbl_ceaf_pi.b,%pc,%d1.w*2),%d1
 	mov.l		EXC_EA(%a6),%a0
@@ -4077,11 +4077,11 @@ ceaf_pd7:
 
 	swbeg		&109
 tbl_unsupp:
-	long		fin	 	- tbl_unsupp	# 00: fmove
-	long		fint	 	- tbl_unsupp	# 01: fint
-	long		tbl_unsupp 	- tbl_unsupp	# 02: fsinh
-	long		fintrz	 	- tbl_unsupp	# 03: fintrz
-	long		fsqrt	 	- tbl_unsupp	# 04: fsqrt
+	long		fin		- tbl_unsupp	# 00: fmove
+	long		fint		- tbl_unsupp	# 01: fint
+	long		tbl_unsupp	- tbl_unsupp	# 02: fsinh
+	long		fintrz		- tbl_unsupp	# 03: fintrz
+	long		fsqrt		- tbl_unsupp	# 04: fsqrt
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp	# 06: flognp1
 	long		tbl_unsupp	- tbl_unsupp
@@ -4101,23 +4101,23 @@ tbl_unsupp:
 	long		tbl_unsupp	- tbl_unsupp	# 15: flog10
 	long		tbl_unsupp	- tbl_unsupp	# 16: flog2
 	long		tbl_unsupp	- tbl_unsupp
-	long		fabs		- tbl_unsupp 	# 18: fabs
+	long		fabs		- tbl_unsupp	# 18: fabs
 	long		tbl_unsupp	- tbl_unsupp	# 19: fcosh
-	long		fneg		- tbl_unsupp 	# 1a: fneg
+	long		fneg		- tbl_unsupp	# 1a: fneg
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp	# 1c: facos
 	long		tbl_unsupp	- tbl_unsupp	# 1d: fcos
 	long		tbl_unsupp	- tbl_unsupp	# 1e: fgetexp
 	long		tbl_unsupp	- tbl_unsupp	# 1f: fgetman
-	long		fdiv		- tbl_unsupp 	# 20: fdiv
+	long		fdiv		- tbl_unsupp	# 20: fdiv
 	long		tbl_unsupp	- tbl_unsupp	# 21: fmod
-	long		fadd		- tbl_unsupp 	# 22: fadd
-	long		fmul		- tbl_unsupp 	# 23: fmul
-	long		fsgldiv		- tbl_unsupp 	# 24: fsgldiv
+	long		fadd		- tbl_unsupp	# 22: fadd
+	long		fmul		- tbl_unsupp	# 23: fmul
+	long		fsgldiv		- tbl_unsupp	# 24: fsgldiv
 	long		tbl_unsupp	- tbl_unsupp	# 25: frem
 	long		tbl_unsupp	- tbl_unsupp	# 26: fscale
-	long		fsglmul		- tbl_unsupp 	# 27: fsglmul
-	long		fsub		- tbl_unsupp 	# 28: fsub
+	long		fsglmul		- tbl_unsupp	# 27: fsglmul
+	long		fsub		- tbl_unsupp	# 28: fsub
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
@@ -4133,20 +4133,20 @@ tbl_unsupp:
 	long		tbl_unsupp	- tbl_unsupp	# 35: fsincos
 	long		tbl_unsupp	- tbl_unsupp	# 36: fsincos
 	long		tbl_unsupp	- tbl_unsupp	# 37: fsincos
-	long		fcmp		- tbl_unsupp 	# 38: fcmp
+	long		fcmp		- tbl_unsupp	# 38: fcmp
 	long		tbl_unsupp	- tbl_unsupp
-	long		ftst		- tbl_unsupp 	# 3a: ftst
+	long		ftst		- tbl_unsupp	# 3a: ftst
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
-	long		fsin		- tbl_unsupp 	# 40: fsmove
-	long		fssqrt		- tbl_unsupp 	# 41: fssqrt
+	long		fsin		- tbl_unsupp	# 40: fsmove
+	long		fssqrt		- tbl_unsupp	# 41: fssqrt
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		fdin		- tbl_unsupp	# 44: fdmove
-	long		fdsqrt		- tbl_unsupp 	# 45: fdsqrt
+	long		fdsqrt		- tbl_unsupp	# 45: fdsqrt
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
@@ -4165,27 +4165,27 @@ tbl_unsupp:
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
-	long		fsabs		- tbl_unsupp 	# 58: fsabs
+	long		fsabs		- tbl_unsupp	# 58: fsabs
 	long		tbl_unsupp	- tbl_unsupp
-	long		fsneg		- tbl_unsupp 	# 5a: fsneg
+	long		fsneg		- tbl_unsupp	# 5a: fsneg
 	long		tbl_unsupp	- tbl_unsupp
 	long		fdabs		- tbl_unsupp	# 5c: fdabs
 	long		tbl_unsupp	- tbl_unsupp
-	long		fdneg		- tbl_unsupp 	# 5e: fdneg
+	long		fdneg		- tbl_unsupp	# 5e: fdneg
 	long		tbl_unsupp	- tbl_unsupp
 	long		fsdiv		- tbl_unsupp	# 60: fsdiv
 	long		tbl_unsupp	- tbl_unsupp
 	long		fsadd		- tbl_unsupp	# 62: fsadd
 	long		fsmul		- tbl_unsupp	# 63: fsmul
-	long		fddiv		- tbl_unsupp 	# 64: fddiv
+	long		fddiv		- tbl_unsupp	# 64: fddiv
 	long		tbl_unsupp	- tbl_unsupp
 	long		fdadd		- tbl_unsupp	# 66: fdadd
-	long		fdmul		- tbl_unsupp 	# 67: fdmul
+	long		fdmul		- tbl_unsupp	# 67: fdmul
 	long		fssub		- tbl_unsupp	# 68: fssub
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
 	long		tbl_unsupp	- tbl_unsupp
-	long		fdsub		- tbl_unsupp 	# 6c: fdsub
+	long		fdsub		- tbl_unsupp	# 6c: fdsub
 
 #################################################
 # Add this here so non-fp modules can compile.
@@ -4208,7 +4208,7 @@ smovcr:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If instr is "fmovm Dn,-(A7)" from supervisor mode,		#
 #		d0 = size of dump					#
@@ -4230,25 +4230,25 @@ smovcr:
 #	The data register is determined and its value loaded to get the	#
 # string of FP registers affected. This value is used as an index into	#
 # a lookup table such that we can determine the number of bytes		#
-# involved. 								#
+# involved.								#
 #	If the instruction is "fmovm.x <ea>,Dn", a _mem_read() is used	#
 # to read in all FP values. Again, _mem_read() may fail and require a	#
-# special exit. 							#
+# special exit.								#
 #	If the instruction is "fmovm.x DN,<ea>", a _mem_write() is used	#
 # to write all FP values. _mem_write() may also fail.			#
-# 	If the instruction is "fmovm.x DN,-(a7)" from supervisor mode,	#
+#	If the instruction is "fmovm.x DN,-(a7)" from supervisor mode,	#
 # then we return the size of the dump and the string to the caller	#
 # so that the move can occur outside of this routine. This special	#
 # case is required so that moves to the system stack are handled	#
 # correctly.								#
 #									#
 # DYNAMIC:								#
-# 	fmovm.x	dn, <ea>						#
-# 	fmovm.x	<ea>, dn						#
+#	fmovm.x	dn, <ea>						#
+#	fmovm.x	<ea>, dn						#
 #									#
 #	      <WORD 1>		      <WORD2>				#
 #	1111 0010 00 |<ea>|	11@& 1000 0$$$ 0000			#
-#					  				#
+#									#
 #	& = (0): predecrement addressing mode				#
 #	    (1): postincrement or control addressing mode		#
 #	@ = (0): move listed regs from memory to the FPU		#
@@ -4517,12 +4517,12 @@ tbl_fmovm_size:
 	byte	0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
 	byte	0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
 	byte	0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
-	byte	0x3c,0x48,0x48,0x54,0x48,0x54,0x54,0x60	
+	byte	0x3c,0x48,0x48,0x54,0x48,0x54,0x54,0x60
 
 #
 # table to convert a pre-decrement bit string into a post-increment
 # or control bit string.
-# ex: 	0x00	==>	0x00
+# ex:	0x00	==>	0x00
 #	0x01	==>	0x80
 #	0x02	==>	0x40
 #		.
@@ -4604,59 +4604,59 @@ tbl_fea_mode:
 	short		tbl_fea_mode	-	tbl_fea_mode
 	short		tbl_fea_mode	-	tbl_fea_mode
 
-	short		faddr_ind_a0	- 	tbl_fea_mode
-	short		faddr_ind_a1	- 	tbl_fea_mode
-	short		faddr_ind_a2	- 	tbl_fea_mode
-	short		faddr_ind_a3 	- 	tbl_fea_mode
-	short		faddr_ind_a4 	- 	tbl_fea_mode
-	short		faddr_ind_a5 	- 	tbl_fea_mode
-	short		faddr_ind_a6 	- 	tbl_fea_mode
-	short		faddr_ind_a7 	- 	tbl_fea_mode
-
-	short		faddr_ind_p_a0	- 	tbl_fea_mode
-	short		faddr_ind_p_a1 	- 	tbl_fea_mode
-	short		faddr_ind_p_a2 	- 	tbl_fea_mode
-	short		faddr_ind_p_a3 	- 	tbl_fea_mode
-	short		faddr_ind_p_a4 	- 	tbl_fea_mode
-	short		faddr_ind_p_a5 	- 	tbl_fea_mode
-	short		faddr_ind_p_a6 	- 	tbl_fea_mode
-	short		faddr_ind_p_a7 	- 	tbl_fea_mode
-
-	short		faddr_ind_m_a0 	- 	tbl_fea_mode
-	short		faddr_ind_m_a1 	- 	tbl_fea_mode
-	short		faddr_ind_m_a2 	- 	tbl_fea_mode
-	short		faddr_ind_m_a3 	- 	tbl_fea_mode
-	short		faddr_ind_m_a4 	- 	tbl_fea_mode
-	short		faddr_ind_m_a5 	- 	tbl_fea_mode
-	short		faddr_ind_m_a6 	- 	tbl_fea_mode
-	short		faddr_ind_m_a7 	- 	tbl_fea_mode
-
-	short		faddr_ind_disp_a0	- 	tbl_fea_mode
-	short		faddr_ind_disp_a1 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a2 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a3 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a4 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a5 	- 	tbl_fea_mode
-	short		faddr_ind_disp_a6 	- 	tbl_fea_mode
+	short		faddr_ind_a0	-	tbl_fea_mode
+	short		faddr_ind_a1	-	tbl_fea_mode
+	short		faddr_ind_a2	-	tbl_fea_mode
+	short		faddr_ind_a3	-	tbl_fea_mode
+	short		faddr_ind_a4	-	tbl_fea_mode
+	short		faddr_ind_a5	-	tbl_fea_mode
+	short		faddr_ind_a6	-	tbl_fea_mode
+	short		faddr_ind_a7	-	tbl_fea_mode
+
+	short		faddr_ind_p_a0	-	tbl_fea_mode
+	short		faddr_ind_p_a1	-	tbl_fea_mode
+	short		faddr_ind_p_a2	-	tbl_fea_mode
+	short		faddr_ind_p_a3	-	tbl_fea_mode
+	short		faddr_ind_p_a4	-	tbl_fea_mode
+	short		faddr_ind_p_a5	-	tbl_fea_mode
+	short		faddr_ind_p_a6	-	tbl_fea_mode
+	short		faddr_ind_p_a7	-	tbl_fea_mode
+
+	short		faddr_ind_m_a0	-	tbl_fea_mode
+	short		faddr_ind_m_a1	-	tbl_fea_mode
+	short		faddr_ind_m_a2	-	tbl_fea_mode
+	short		faddr_ind_m_a3	-	tbl_fea_mode
+	short		faddr_ind_m_a4	-	tbl_fea_mode
+	short		faddr_ind_m_a5	-	tbl_fea_mode
+	short		faddr_ind_m_a6	-	tbl_fea_mode
+	short		faddr_ind_m_a7	-	tbl_fea_mode
+
+	short		faddr_ind_disp_a0	-	tbl_fea_mode
+	short		faddr_ind_disp_a1	-	tbl_fea_mode
+	short		faddr_ind_disp_a2	-	tbl_fea_mode
+	short		faddr_ind_disp_a3	-	tbl_fea_mode
+	short		faddr_ind_disp_a4	-	tbl_fea_mode
+	short		faddr_ind_disp_a5	-	tbl_fea_mode
+	short		faddr_ind_disp_a6	-	tbl_fea_mode
 	short		faddr_ind_disp_a7	-	tbl_fea_mode
 
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-	short		faddr_ind_ext 	- 	tbl_fea_mode
-
-	short		fabs_short	- 	tbl_fea_mode
-	short		fabs_long	- 	tbl_fea_mode
-	short		fpc_ind		- 	tbl_fea_mode
-	short		fpc_ind_ext	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
-	short		tbl_fea_mode	- 	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+	short		faddr_ind_ext	-	tbl_fea_mode
+
+	short		fabs_short	-	tbl_fea_mode
+	short		fabs_long	-	tbl_fea_mode
+	short		fpc_ind		-	tbl_fea_mode
+	short		fpc_ind_ext	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
+	short		tbl_fea_mode	-	tbl_fea_mode
 
 ###################################
 # Address register indirect: (An) #
@@ -4952,7 +4952,7 @@ faddr_ind_ext:
 
 	btst		&0x8,%d0
 	bne.w		fcalc_mem_ind
-	
+
 	mov.l		%d0,L_SCR1(%a6)		# hold opword
 
 	mov.l		%d0,%d1
@@ -5048,7 +5048,7 @@ fpc_ind_ext:
 
 	btst		&0x8,%d0		# is disp only 8 bits?
 	bne.w		fcalc_mem_ind		# calc memory indirect
-	
+
 	mov.l		%d0,L_SCR1(%a6)		# store opword
 
 	mov.l		%d0,%d1			# make extword copy
@@ -5125,7 +5125,7 @@ fno_base_sup:
 	bfextu		%d5{&26:&2},%d0		# get bd size
 #	beq.l		fmovm_error		# if (size == 0) it's reserved
 
-	cmpi.b	 	%d0,&0x2
+	cmpi.b		%d0,&0x2
 	blt.b		fno_bd
 	beq.b		fget_word_bd
 
@@ -5147,7 +5147,7 @@ fget_word_bd:
 	bne.l		fcea_iacc		# yes
 
 	ext.l		%d0			# sign extend bd
-	
+
 fchk_ind:
 	add.l		%d0,%d3			# base += bd
 
@@ -5156,10 +5156,10 @@ fno_bd:
 	bfextu		%d5{&30:&2},%d0		# is od suppressed?
 	beq.w		faii_bd
 
-	cmpi.b	 	%d0,&0x2
+	cmpi.b		%d0,&0x2
 	blt.b		fnull_od
 	beq.b		fword_od
-	
+
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
 	addq.l		&0x4,EXC_EXTWPTR(%a6)	# incr instruction ptr
 	bsr.l		_imem_read_long
@@ -5167,7 +5167,7 @@ fno_bd:
 	tst.l		%d1			# did ifetch fail?
 	bne.l		fcea_iacc		# yes
 
-	bra.b 		fadd_them
+	bra.b		fadd_them
 
 fword_od:
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
@@ -5220,7 +5220,7 @@ fdone_ea:
 	rts
 
 #########################################################
-fcea_err:	
+fcea_err:
 	mov.l		%d3,%a0
 
 	movm.l		(%sp)+,&0x003c		# restore d2-d5
@@ -5230,7 +5230,7 @@ fcea_err:
 fcea_iacc:
 	movm.l		(%sp)+,&0x003c		# restore d2-d5
 	bra.l		iea_iacc
-	
+
 fmovm_out_err:
 	bsr.l		restore
 	mov.w		&0x00e1,%d0
@@ -5246,7 +5246,7 @@ fmovm_err:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fmovm_ctrl(): emulate fmovm.l of control registers instr	#
+#	fmovm_ctrl(): emulate fmovm.l of control registers instr	#
 #									#
 # XREF ****************************************************************	#
 #	_imem_read_long() - read longword from memory			#
@@ -5254,7 +5254,7 @@ fmovm_err:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If _imem_read_long() doesn't fail:				#
 #		USER_FPCR(a6)  = new FPCR value				#
@@ -5262,14 +5262,14 @@ fmovm_err:
 #		USER_FPIAR(a6) = new FPIAR value			#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Decode the instruction type by looking at the extension word 	#
+#	Decode the instruction type by looking at the extension word	#
 # in order to see how many control registers to fetch from memory.	#
 # Fetch them using _imem_read_long(). If this fetch fails, exit through	#
 # the special access error exit handler iea_iacc().			#
 #									#
 # Instruction word decoding:						#
 #									#
-# 	fmovem.l #<data>, {FPIAR&|FPCR&|FPSR}				#
+#	fmovem.l #<data>, {FPIAR&|FPCR&|FPSR}				#
 #									#
 #		WORD1			WORD2				#
 #	1111 0010 00 111100	100$ $$00 0000 0000			#
@@ -5290,7 +5290,7 @@ fmovm_ctrl:
 	beq.w		fctrl_in_6		# yes
 	cmpi.b		%d0,&0x94		# fpcr & fpiar ?
 	beq.b		fctrl_in_5		# yes
-	
+
 # fmovem.l #<data>, fpsr/fpiar
 fctrl_in_3:
 	mov.l		EXC_EXTWPTR(%a6),%a0	# fetch instruction addr
@@ -5392,14 +5392,14 @@ fctrl_in_7:
 # INPUT ***************************************************************	#
 #	FP_SRC(a6) = fp op1(src)					#
 #	FP_DST(a6) = fp op2(dst)					#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SRC(a6) = fp op1 scaled(src)					#
 #	FP_DST(a6) = fp op2 scaled(dst)					#
 #	d0         = scale amount					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	If the DST exponent is > the SRC exponent, set the DST exponent	#
+#	If the DST exponent is > the SRC exponent, set the DST exponent	#
 # equal to 0x3fff and scale the SRC exponent by the value that the	#
 # DST exponent was scaled by. If the SRC exponent is greater or equal,	#
 # do the opposite. Return this scale factor in d0.			#
@@ -5462,7 +5462,7 @@ quick_scale12:
 	andi.w		&0x8000,FP_SCR0_EX(%a6)	# zero src exponent
 	bset		&0x0,1+FP_SCR0_EX(%a6)	# set exp = 1
 
-	mov.l		(%sp)+,%d0		# return SCALE factor	
+	mov.l		(%sp)+,%d0		# return SCALE factor
 	rts
 
 # src exp is >= dst exp; scale src to exp = 0x3fff
@@ -5498,7 +5498,7 @@ quick_scale22:
 	andi.w		&0x8000,FP_SCR1_EX(%a6)	# zero dst exponent
 	bset		&0x0,1+FP_SCR1_EX(%a6)	# set exp = 1
 
-	mov.l		(%sp)+,%d0		# return SCALE factor	
+	mov.l		(%sp)+,%d0		# return SCALE factor
 	rts
 
 ##########################################################################
@@ -5513,14 +5513,14 @@ quick_scale22:
 #									#
 # INPUT ***************************************************************	#
 #	FP_SCR0(a6) = extended precision operand to be scaled		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SCR0(a6) = scaled extended precision operand			#
 #	d0	    = scale value					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Set the exponent of the input operand to 0x3fff. Save the value	#
-# of the difference between the original and new exponent. Then, 	#
+#	Set the exponent of the input operand to 0x3fff. Save the value	#
+# of the difference between the original and new exponent. Then,	#
 # normalize the operand if it was a DENORM. Add this normalization	#
 # value to the previous value. Return the result.			#
 #									#
@@ -5566,17 +5566,17 @@ stzs_denorm:
 #									#
 # INPUT ***************************************************************	#
 #	FP_SCR0(a6) = extended precision operand to be scaled		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SCR0(a6) = scaled extended precision operand			#
 #	d0	    = scale value					#
 #									#
 # ALGORITHM ***********************************************************	#
 #	If the input operand is a DENORM, normalize it.			#
-# 	If the exponent of the input operand is even, set the exponent	#
-# to 0x3ffe and return a scale factor of "(exp-0x3ffe)/2". If the 	#
+#	If the exponent of the input operand is even, set the exponent	#
+# to 0x3ffe and return a scale factor of "(exp-0x3ffe)/2". If the	#
 # exponent of the input operand is off, set the exponent to ox3fff and	#
-# return a scale factor of "(exp-0x3fff)/2". 				#
+# return a scale factor of "(exp-0x3fff)/2".				#
 #									#
 #########################################################################
 
@@ -5640,14 +5640,14 @@ ss_denorm_even:
 #									#
 # INPUT ***************************************************************	#
 #	FP_SCR1(a6) = extended precision operand to be scaled		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SCR1(a6) = scaled extended precision operand			#
 #	d0	    = scale value					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Set the exponent of the input operand to 0x3fff. Save the value	#
-# of the difference between the original and new exponent. Then, 	#
+#	Set the exponent of the input operand to 0x3fff. Save the value	#
+# of the difference between the original and new exponent. Then,	#
 # normalize the operand if it was a DENORM. Add this normalization	#
 # value to the previous value. Return the result.			#
 #									#
@@ -5695,21 +5695,21 @@ stzd_denorm:
 # INPUT ***************************************************************	#
 #	FP_SRC(a6) = pointer to extended precision src operand		#
 #	FP_DST(a6) = pointer to extended precision dst operand		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default result						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	If either operand (but not both operands) of an operation is a	#
+#	If either operand (but not both operands) of an operation is a	#
 # nonsignalling NAN, then that NAN is returned as the result. If both	#
-# operands are nonsignalling NANs, then the destination operand 	#
+# operands are nonsignalling NANs, then the destination operand		#
 # nonsignalling NAN is returned as the result.				#
-# 	If either operand to an operation is a signalling NAN (SNAN),	#
+#	If either operand to an operation is a signalling NAN (SNAN),	#
 # then, the SNAN bit is set in the FPSR EXC byte. If the SNAN trap	#
-# enable bit is set in the FPCR, then the trap is taken and the 	#
+# enable bit is set in the FPCR, then the trap is taken and the		#
 # destination is not modified. If the SNAN trap enable bit is not set,	#
-# then the SNAN is converted to a nonsignalling NAN (by setting the 	#
-# SNAN bit in the operand to one), and the operation continues as 	#
+# then the SNAN is converted to a nonsignalling NAN (by setting the	#
+# SNAN bit in the operand to one), and the operation continues as	#
 # described in the preceding paragraph, for nonsignalling NANs.		#
 #	Make sure the appropriate FPSR bits are set before exiting.	#
 #									#
@@ -5748,7 +5748,7 @@ dst_qnan2:
 	lea		FP_DST(%a6), %a0
 	cmp.b		STAG(%a6), &SNAN
 	bne		nan_done
-	or.l		&aiop_mask+snan_mask, USER_FPSR(%a6)	
+	or.l		&aiop_mask+snan_mask, USER_FPSR(%a6)
 nan_done:
 	or.l		&nan_mask, USER_FPSR(%a6)
 nan_comp:
@@ -5761,14 +5761,14 @@ nan_not_neg:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	res_operr(): return default result during operand error		#
+#	res_operr(): return default result during operand error		#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = default operand error result				#
 #									#
@@ -5776,8 +5776,8 @@ nan_not_neg:
 #	An nonsignalling NAN is returned as the default result when	#
 # an operand error occurs for the following cases:			#
 #									#
-# 	Multiply: (Infinity x Zero)					#
-# 	Divide  : (Zero / Zero) || (Infinity / Infinity)		#
+#	Multiply: (Infinity x Zero)					#
+#	Divide  : (Zero / Zero) || (Infinity / Infinity)		#
 #									#
 #########################################################################
 
@@ -5787,12 +5787,12 @@ res_operr:
 	fmovm.x		nan_return(%pc), &0x80
 	rts
 
-nan_return:	
+nan_return:
 	long		0x7fff0000, 0xffffffff, 0xffffffff
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	_denorm(): denormalize an intermediate result			#
+#	_denorm(): denormalize an intermediate result			#
 #									#
 # XREF ****************************************************************	#
 #	None								#
@@ -5800,7 +5800,7 @@ nan_return:
 # INPUT *************************************************************** #
 #	a0 = points to the operand to be denormalized			#
 #		(in the internal extended format)			#
-#		 							#
+#									#
 #	d0 = rounding precision						#
 #									#
 # OUTPUT **************************************************************	#
@@ -5810,10 +5810,10 @@ nan_return:
 #	d0 = guard,round,sticky						#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	According to the exponent underflow threshold for the given	#
+#	According to the exponent underflow threshold for the given	#
 # precision, shift the mantissa bits to the right in order raise the	#
-# exponent of the operand to the threshold value. While shifting the 	#
-# mantissa bits right, maintain the value of the guard, round, and 	#
+# exponent of the operand to the threshold value. While shifting the	#
+# mantissa bits right, maintain the value of the guard, round, and	#
 # sticky bits.								#
 # other notes:								#
 #	(1) _denorm() is called by the underflow routines		#
@@ -5833,7 +5833,7 @@ tbl_thresh:
 _denorm:
 #
 # Load the exponent threshold for the precision selected and check
-# to see if (threshold - exponent) is > 65 in which case we can 
+# to see if (threshold - exponent) is > 65 in which case we can
 # simply calculate the sticky bit and zero the mantissa. otherwise
 # we have to call the denormalization routine.
 #
@@ -5872,7 +5872,7 @@ denorm_set_stky:
 #	%d0{31:29} : initial guard,round,sticky				#
 #	%d1{15:0}  : denormalization threshold				#
 # OUTPUT:								#
-#	%a0	   : points to the denormalized operand		 	#
+#	%a0	   : points to the denormalized operand			#
 #	%d0{31:29} : final guard,round,sticky				#
 #									#
 
@@ -5892,7 +5892,7 @@ dnrm_lp:
 
 #
 # check to see how much less than the underflow threshold the operand
-# exponent is. 
+# exponent is.
 #
 	mov.l		%d1, %d0		# copy the denorm threshold
 	sub.w		FTEMP_EX(%a0), %d1	# d1 = threshold - uns exponent
@@ -5907,7 +5907,7 @@ dnrm_lp:
 # No normalization necessary
 #
 dnrm_no_lp:
-	mov.l		GRS(%a6), %d0 		# restore original g,r,s
+	mov.l		GRS(%a6), %d0		# restore original g,r,s
 	rts
 
 #
@@ -5917,7 +5917,7 @@ dnrm_no_lp:
 # %d1 = "n" = amt to shift
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-(32 - n)-><-(n)-><-(32 - n)-><-(n)-><-(32 - n)-><-(n)->
 #	\	   \		      \			 \
@@ -5928,7 +5928,7 @@ dnrm_no_lp:
 #	     \		\		   \		      \
 #	      \		 \		    \		       \
 #	       \	  \		     \			\
-#	<-(n)-><-(32 - n)-><------(32)-------><------(32)------->	
+#	<-(n)-><-(32 - n)-><------(32)-------><------(32)------->
 #	---------------------------------------------------------
 #	|0.....0| NEW_HI  |  NEW_FTEMP_LO     |grs		|
 #	---------------------------------------------------------
@@ -5969,17 +5969,17 @@ case1_sticky_clear:
 # %d1 = "n" = amt to shift
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-(32 - n)-><-(n)-><-(32 - n)-><-(n)-><-(32 - n)-><-(n)->
 #	\	   \		      \
 #	 \	    \		       \
 #	  \	     \			-------------------
 #	   \	      --------------------		   \
-#	    -------------------	  	  \		    \
-#	     		       \	   \		     \
-#	      		 	\     	    \		      \
-#	       		  	 \	     \		       \
+#	    -------------------		  \		    \
+#			       \	   \		     \
+#				\	    \		      \
+#				 \	     \		       \
 #	<-------(32)------><-(n)-><-(32 - n)-><------(32)------->
 #	---------------------------------------------------------
 #	|0...............0|0....0| NEW_LO     |grs		|
@@ -6050,17 +6050,17 @@ case_3:
 # case (d1 == 64)
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-------(32)------>
-#	\	   	   \
-#	 \	    	    \
-#	  \	     	     \
-#	   \	      	      ------------------------------
+#	\		   \
+#	 \		    \
+#	  \		     \
+#	   \		      ------------------------------
 #	    -------------------------------		    \
-#	     		       		   \		     \
-#	      		 	     	    \		      \
-#	       		  	 	     \		       \
+#					   \		     \
+#					    \		      \
+#					     \		       \
 #					      <-------(32)------>
 #	---------------------------------------------------------
 #	|0...............0|0................0|grs		|
@@ -6078,17 +6078,17 @@ case3_64:
 # case (d1 == 65)
 #
 #	---------------------------------------------------------
-#	|     FTEMP_HI	  |    	FTEMP_LO     |grs000.........000|
+#	|     FTEMP_HI	  |	FTEMP_LO     |grs000.........000|
 #	---------------------------------------------------------
 #	<-------(32)------>
-#	\	   	   \
-#	 \	    	    \
-#	  \	     	     \
-#	   \	      	      ------------------------------
+#	\		   \
+#	 \		    \
+#	  \		     \
+#	   \		      ------------------------------
 #	    --------------------------------		    \
-#	     		       		    \		     \
-#	      		 	     	     \		      \
-#	       		  	 	      \		       \
+#					    \		     \
+#					     \		      \
+#					      \		       \
 #					       <-------(31)----->
 #	---------------------------------------------------------
 #	|0...............0|0................0|0rs		|
@@ -6136,7 +6136,7 @@ case3_set_sticky:
 #	None								#
 #									#
 # INPUT ***************************************************************	#
-#	a0	  = ptr to input operand in internal extended format 	#
+#	a0	  = ptr to input operand in internal extended format	#
 #	d1(hi)    = contains rounding precision:			#
 #			ext = $0000xxxx					#
 #			sgl = $0004xxxx					#
@@ -6167,7 +6167,7 @@ _round:
 #
 # ext_grs() looks at the rounding precision and sets the appropriate
 # G,R,S bits.
-# If (G,R,S == 0) then result is exact and round is done, else set 
+# If (G,R,S == 0) then result is exact and round is done, else set
 # the inex flag in status reg and continue.
 #
 	bsr.l		ext_grs			# extract G,R,S
@@ -6213,7 +6213,7 @@ rnd_plus:
 #	If sign of fp number = 1 (negative), then add 1 to l.	#
 #################################################################
 rnd_mnus:
-	tst.b		FTEMP_SGN(%a0)		# check for sign	
+	tst.b		FTEMP_SGN(%a0)		# check for sign
 	bpl.w		truncate		# if negative then truncate
 
 	mov.l		&0xffffffff, %d0	# force g,r,s to be all f's
@@ -6324,7 +6324,7 @@ truncate:
 #
 # INPUT
 #	d0	   = extended precision g,r,s (in d0{31:29})
-#	d1 	   = {PREC,ROUND}
+#	d1	   = {PREC,ROUND}
 # OUTPUT
 #	d0{31:29}  = guard, round, sticky
 #
@@ -6375,7 +6375,7 @@ ext_grs_sgl:
 	mov.l		&30, %d2		# of the sgl prec. limits
 	lsl.l		%d2, %d3		# shift g-r bits to MSB of d3
 	mov.l		FTEMP_HI(%a0), %d2	# get word 2 for s-bit test
-	and.l		&0x0000003f, %d2	# s bit is the or of all other 
+	and.l		&0x0000003f, %d2	# s bit is the or of all other
 	bne.b		ext_grs_st_stky		# bits to the right of g-r
 	tst.l		FTEMP_LO(%a0)		# test lower mantissa
 	bne.b		ext_grs_st_stky		# if any are set, set sticky
@@ -6385,9 +6385,9 @@ ext_grs_sgl:
 
 #
 # dbl:
-#	96		64	  	32	 11	0
+#	96		64		32	 11	0
 #	-----------------------------------------------------
-#	| EXP	|XXXXXXX|	  	|	 |xx	|grs|
+#	| EXP	|XXXXXXX|		|	 |xx	|grs|
 #	-----------------------------------------------------
 #						  nn\	    /
 #						  ee -------
@@ -6400,7 +6400,7 @@ ext_grs_dbl:
 	mov.l		&30, %d2		# of the dbl prec. limits
 	lsl.l		%d2, %d3		# shift g-r bits to the MSB of d3
 	mov.l		FTEMP_LO(%a0), %d2	# get lower mantissa  for s-bit test
-	and.l		&0x000001ff, %d2	# s bit is the or-ing of all 
+	and.l		&0x000001ff, %d2	# s bit is the or-ing of all
 	bne.b		ext_grs_st_stky		# other bits to the right of g-r
 	tst.l		%d0			# test word original g,r,s
 	bne.b		ext_grs_st_stky		# if any are set, set sticky
@@ -6430,7 +6430,7 @@ ext_grs_end_sd:
 #	a0 = pointer fp extended precision operand to normalize		#
 #									#
 # OUTPUT ************************************************************** #
-# 	d0 = number of bit positions the mantissa was shifted		#
+#	d0 = number of bit positions the mantissa was shifted		#
 #	a0 = the input operand's mantissa is normalized; the exponent	#
 #	     is unchanged.						#
 #									#
@@ -6457,7 +6457,7 @@ norm_hi:
 	mov.l		%d1, FTEMP_LO(%a0)	# store new lo(man)
 
 	mov.l		%d2, %d0		# return shift amount
-	
+
 	mov.l		(%sp)+, %d3		# restore temp regs
 	mov.l		(%sp)+, %d2
 
@@ -6472,7 +6472,7 @@ norm_lo:
 	clr.l		FTEMP_LO(%a0)		# lo(man) is now zero
 
 	mov.l		%d2, %d0		# return shift amount
-	
+
 	mov.l		(%sp)+, %d3		# restore temp regs
 	mov.l		(%sp)+, %d2
 
@@ -6577,27 +6577,27 @@ unnorm_nrm_zero_lrg:
 # whole mantissa is zero so this UNNORM is actually a zero
 #
 unnorm_zero:
-	and.w		&0x8000, FTEMP_EX(%a0) 	# force exponent to zero
+	and.w		&0x8000, FTEMP_EX(%a0)	# force exponent to zero
 
 	mov.b		&ZERO, %d0		# fix optype tag
 	rts
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	set_tag_x(): return the optype of the input ext fp number	#
+#	set_tag_x(): return the optype of the input ext fp number	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, UNNORM, ZERO	#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, UNNORM, ZERO	#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #	If it's an unnormalized zero, alter the operand and force it	#
 # to be a normal zero.							#
@@ -6664,20 +6664,20 @@ is_snan_x:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	set_tag_d(): return the optype of the input dbl fp number	#
+#	set_tag_d(): return the optype of the input dbl fp number	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = points to double precision operand				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #									#
 #########################################################################
@@ -6727,20 +6727,20 @@ is_qnan_d:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	set_tag_s(): return the optype of the input sgl fp number	#
+#	set_tag_s(): return the optype of the input sgl fp number	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to single precision operand			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of type tag						#
-# 		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
+#		one of: NORM, INF, QNAN, SNAN, DENORM, ZERO		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Simply test the exponent, j-bit, and mantissa values to 	#
+#	Simply test the exponent, j-bit, and mantissa values to		#
 # determine the type of operand.					#
 #									#
 #########################################################################
@@ -6786,15 +6786,15 @@ is_qnan_s:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	unf_res(): routine to produce default underflow result of a 	#
-#	 	   scaled extended precision number; this is used by 	#
+#	unf_res(): routine to produce default underflow result of a	#
+#		   scaled extended precision number; this is used by	#
 #		   fadd/fdiv/fmul/etc. emulation routines.		#
-# 	unf_res4(): same as above but for fsglmul/fsgldiv which use	#
+#	unf_res4(): same as above but for fsglmul/fsgldiv which use	#
 #		    single round prec and extended prec mode.		#
 #									#
 # XREF ****************************************************************	#
 #	_denorm() - denormalize according to scale factor		#
-# 	_round() - round denormalized number according to rnd prec	#
+#	_round() - round denormalized number according to rnd prec	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precison operand			#
@@ -6806,15 +6806,15 @@ is_qnan_s:
 #	d0.b = result FPSR_cc which caller may or may not want to save	#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Convert the input operand to "internal format" which means the	#
+#	Convert the input operand to "internal format" which means the	#
 # exponent is extended to 16 bits and the sign is stored in the unused	#
 # portion of the extended precison operand. Denormalize the number	#
-# according to the scale factor passed in d0. Then, round the 		#
+# according to the scale factor passed in d0. Then, round the		#
 # denormalized result.							#
-# 	Set the FPSR_exc bits as appropriate but return the cc bits in	#
+#	Set the FPSR_exc bits as appropriate but return the cc bits in	#
 # d0 in case the caller doesn't want to save them (as is the case for	#
 # fmove out).								#
-# 	unf_res4() for fsglmul/fsgldiv forces the denorm to extended	#
+#	unf_res4() for fsglmul/fsgldiv forces the denorm to extended	#
 # precision and the rounding mode to single.				#
 #									#
 #########################################################################
@@ -6952,23 +6952,23 @@ unf_res4_end:
 #	none								#
 #									#
 # INPUT ***************************************************************	#
-#	d1.b 	= '-1' => (-); '0' => (+)				#
+#	d1.b	= '-1' => (-); '0' => (+)				#
 #   ovf_res():								#
-#	d0 	= rnd mode/prec						#
+#	d0	= rnd mode/prec						#
 #   ovf_res2():								#
-#	hi(d0) 	= rnd prec						#
+#	hi(d0)	= rnd prec						#
 #	lo(d0)	= rnd mode						#
 #									#
 # OUTPUT **************************************************************	#
-#	a0   	= points to extended precision result			#
-#	d0.b 	= condition code bits					#
+#	a0	= points to extended precision result			#
+#	d0.b	= condition code bits					#
 #									#
 # ALGORITHM ***********************************************************	#
 #	The default overflow result can be determined by the sign of	#
 # the result and the rounding mode/prec in effect. These bits are	#
-# concatenated together to create an index into the default result 	#
+# concatenated together to create an index into the default result	#
 # table. A pointer to the correct result is returned in a0. The		#
-# resulting condition codes are returned in d0 in case the caller 	#
+# resulting condition codes are returned in d0 in case the caller	#
 # doesn't want FPSR_cc altered (as is the case for fmove out).		#
 #									#
 #########################################################################
@@ -6998,7 +6998,7 @@ ovf_res2:
 ovf_res_load:
 	mov.b		(tbl_ovfl_cc.b,%pc,%d0.w*1), %d0 # fetch result ccodes
 	lea		(tbl_ovfl_result.b,%pc,%d1.w*8), %a0 # return result ptr
-	
+
 	rts
 
 tbl_ovfl_cc:
@@ -7048,7 +7048,7 @@ tbl_ovfl_result:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fout(): move from fp register to memory or data register	#
+#	fout(): move from fp register to memory or data register	#
 #									#
 # XREF ****************************************************************	#
 #	_round() - needed to create EXOP for sgl/dbl precision		#
@@ -7068,7 +7068,7 @@ tbl_ovfl_result:
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
 #	d0 = round prec,mode						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 : intermediate underflow or overflow result if		#
 #	      OVFL/UNFL occurred for a sgl or dbl operand		#
@@ -7087,9 +7087,9 @@ tbl_ovfl_result:
 # w/ the address index register as appropriate w/ _calc_ea_fout(). If	#
 # the source is a denorm and if underflow is enabled, an EXOP must be	#
 # created.								#
-# 	For packed, the k-factor must be fetched from the instruction	#
-# word or a data register. The <ea> must be fixed as w/ extended 	#
-# precision. Then, bindec() is called to create the appropriate 	#
+#	For packed, the k-factor must be fetched from the instruction	#
+# word or a data register. The <ea> must be fixed as w/ extended	#
+# precision. Then, bindec() is called to create the appropriate		#
 # packed result.							#
 #	If at any time an access error is flagged by one of the move-	#
 # to-memory routines, then a special exit must be made so that the	#
@@ -7205,7 +7205,7 @@ fout_word_denorm:
 	ori.l		&0x00800000,%d1		# make smallest sgl
 	fmov.s		%d1,%fp0
 	bra.b		fout_word_norm
-	
+
 #################################################################
 # fmove.l out ###################################################
 #################################################################
@@ -7279,7 +7279,7 @@ fout_ext:
 	mov.l		&0xc,%d0		# pass: opsize is 12 bytes
 
 # we must not yet write the extended precision data to the stack
-# in the pre-decrement case from supervisor mode or else we'll corrupt 
+# in the pre-decrement case from supervisor mode or else we'll corrupt
 # the stack frame. so, leave it in FP_SRC for now and deal with it later...
 	cmpi.b		SPCOND_FLG(%a6),&mda7_flg
 	beq.b		fout_ext_a7
@@ -7366,7 +7366,7 @@ fout_sgl_exg:
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fmov.l		%fpsr,%d1		# save FPSR
 
-	or.w		%d1,2+USER_FPSR(%a6) 	# set possible inex2/ainex
+	or.w		%d1,2+USER_FPSR(%a6)	# set possible inex2/ainex
 
 fout_sgl_exg_write:
 	mov.b		1+EXC_OPWORD(%a6),%d1	# extract dst mode
@@ -7407,7 +7407,7 @@ fout_sgl_unfl:
 
 	lea		FP_SCR0(%a6),%a0
 	bsr.l		norm			# normalize the DENORM
-	
+
 fout_sgl_unfl_cont:
 	lea		FP_SCR0(%a6),%a0	# pass: ptr to operand
 	mov.l		L_SCR3(%a6),%d1		# pass: rnd prec,mode
@@ -7458,7 +7458,7 @@ fout_sgl_ovfl_cont:
 
 # call ovf_res() w/ sgl prec and the correct rnd mode to create the default
 # overflow result. DON'T save the returned ccodes from ovf_res() since
-# fmove out doesn't alter them. 
+# fmove out doesn't alter them.
 	tst.b		SRC_EX(%a0)		# is operand negative?
 	smi		%d1			# set if so
 	mov.l		L_SCR3(%a6),%d0		# pass: sgl prec,rnd mode
@@ -7513,7 +7513,7 @@ fout_sgl_may_ovfl:
 
 	fabs.x		%fp0			# need absolute value
 	fcmp.b		%fp0,&0x2		# did exponent increase?
-	fblt.w		fout_sgl_exg		# no; go finish NORM	
+	fblt.w		fout_sgl_exg		# no; go finish NORM
 	bra.w		fout_sgl_ovfl		# yes; go handle overflow
 
 ################
@@ -7604,7 +7604,7 @@ fout_dbl_exg:
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fmov.l		%fpsr,%d0		# save FPSR
 
-	or.w		%d0,2+USER_FPSR(%a6) 	# set possible inex2/ainex
+	or.w		%d0,2+USER_FPSR(%a6)	# set possible inex2/ainex
 
 	mov.l		EXC_EA(%a6),%a1		# pass: dst addr
 	lea		L_SCR1(%a6),%a0		# pass: src addr
@@ -7614,7 +7614,7 @@ fout_dbl_exg:
 	tst.l		%d1			# did dstore fail?
 	bne.l		facc_out_d		# yes
 
-	rts					# no; so we're finished	
+	rts					# no; so we're finished
 
 #
 # here, we know that the operand would UNFL if moved out to double prec,
@@ -7636,7 +7636,7 @@ fout_dbl_unfl:
 
 	lea		FP_SCR0(%a6),%a0
 	bsr.l		norm			# normalize the DENORM
-	
+
 fout_dbl_unfl_cont:
 	lea		FP_SCR0(%a6),%a0	# pass: ptr to operand
 	mov.l		L_SCR3(%a6),%d1		# pass: rnd prec,mode
@@ -7679,7 +7679,7 @@ fout_dbl_ovfl_cont:
 
 # call ovf_res() w/ dbl prec and the correct rnd mode to create the default
 # overflow result. DON'T save the returned ccodes from ovf_res() since
-# fmove out doesn't alter them. 
+# fmove out doesn't alter them.
 	tst.b		SRC_EX(%a0)		# is operand negative?
 	smi		%d1			# set if so
 	mov.l		L_SCR3(%a6),%d0		# pass: dbl prec,rnd mode
@@ -7724,19 +7724,19 @@ fout_dbl_may_ovfl:
 
 	fabs.x		%fp0			# need absolute value
 	fcmp.b		%fp0,&0x2		# did exponent increase?
-	fblt.w		fout_dbl_exg		# no; go finish NORM	
+	fblt.w		fout_dbl_exg		# no; go finish NORM
 	bra.w		fout_dbl_ovfl		# yes; go handle overflow
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	dst_dbl(): create double precision value from extended prec.	#
+#	dst_dbl(): create double precision value from extended prec.	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to source operand in extended precision		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = hi(double precision result)				#
 #	d1 = lo(double precision result)				#
@@ -7750,18 +7750,18 @@ fout_dbl_may_ovfl:
 #	get rid of ext integer bit					#
 #	dbl_mant = ext_mant{62:12}					#
 #									#
-#	    	---------------   ---------------    ---------------	#
+#		---------------   ---------------    ---------------	#
 #  extended ->  |s|    exp    |   |1| ms mant   |    | ls mant     |	#
-#	    	---------------   ---------------    ---------------	#
-#	   	 95	    64    63 62	      32      31     11	  0	#
+#		---------------   ---------------    ---------------	#
+#		 95	    64    63 62	      32      31     11	  0	#
 #				     |			     |		#
 #				     |			     |		#
 #				     |			     |		#
-#		 	             v   		     v		#
-#	    		      ---------------   ---------------		#
-#  double   ->  	      |s|exp| mant  |   |  mant       |		#
-#	    		      ---------------   ---------------		#
-#	   	 	      63     51   32   31	       0	#
+#			             v			     v		#
+#			      ---------------   ---------------		#
+#  double   ->		      |s|exp| mant  |   |  mant       |		#
+#			      ---------------   ---------------		#
+#			      63     51   32   31	       0	#
 #									#
 #########################################################################
 
@@ -7797,13 +7797,13 @@ dst_get_dman:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	dst_sgl(): create single precision value from extended prec	#
+#	dst_sgl(): create single precision value from extended prec	#
 #									#
 # XREF ****************************************************************	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to source operand in extended precision		#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = single precision result					#
 #									#
@@ -7815,18 +7815,18 @@ dst_get_dman:
 #	get rid of ext integer bit					#
 #	sgl_mant = ext_mant{62:12}					#
 #									#
-#	    	---------------   ---------------    ---------------	#
+#		---------------   ---------------    ---------------	#
 #  extended ->  |s|    exp    |   |1| ms mant   |    | ls mant     |	#
-#	    	---------------   ---------------    ---------------	#
-#	   	 95	    64    63 62	   40 32      31     12	  0	#
+#		---------------   ---------------    ---------------	#
+#		 95	    64    63 62	   40 32      31     12	  0	#
 #				     |	   |				#
 #				     |	   |				#
 #				     |	   |				#
-#		 	             v     v				#
-#	    		      ---------------				#
-#  single   ->  	      |s|exp| mant  |				#
-#	    		      ---------------				#
-#	   	 	      31     22     0				#
+#			             v     v				#
+#			      ---------------				#
+#  single   ->		      |s|exp| mant  |				#
+#			      ---------------				#
+#			      31     22     0				#
 #									#
 #########################################################################
 
@@ -7899,7 +7899,7 @@ fout_pack_type:
 # add the extra condition that only if the k-factor was zero, too, should
 # we zero the exponent
 	tst.l		%d0
-	bne.b		fout_pack_set	
+	bne.b		fout_pack_set
 # "mantissa" is all zero which means that the answer is zero. but, the '040
 # algorithm allows the exponent to be non-zero. the 881/2 do not. therefore,
 # if the mantissa is zero, I will zero the exponent, too.
@@ -7951,7 +7951,7 @@ fout_pack_snan:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fmul(): emulates the fmul instruction				#
+#	fmul(): emulates the fmul instruction				#
 #	fsmul(): emulates the fsmul instruction				#
 #	fdmul(): emulates the fdmul instruction				#
 #									#
@@ -7960,8 +7960,8 @@ fout_pack_snan:
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res() - return default underflow result			#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -7979,12 +7979,12 @@ fout_pack_snan:
 # instruction won't cause an exception. Use the regular fmul to		#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
 
-	align 		0x10
+	align		0x10
 tbl_fmul_ovfl:
 	long		0x3fff - 0x7ffe		# ext_max
 	long		0x3fff - 0x407e		# sgl_max
@@ -8045,7 +8045,7 @@ fmul_norm:
 #
 # NORMAL:
 # - the result of the multiply operation will neither overflow nor underflow.
-# - do the multiply to the proper precision and rounding mode. 
+# - do the multiply to the proper precision and rounding mode.
 # - scale the result exponent using the scale factor. if both operands were
 # normalized then we really don't need to go through this scaling. but for now,
 # this will do.
@@ -8056,7 +8056,7 @@ fmul_normal:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -8096,7 +8096,7 @@ fmul_ovfl:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -8175,7 +8175,7 @@ fmul_may_ovfl:
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
 	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
-	
+
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -8184,7 +8184,7 @@ fmul_may_ovfl:
 	fabs.x		%fp0,%fp1		# make a copy of result
 	fcmp.b		%fp1,&0x2		# is |result| >= 2.b?
 	fbge.w		fmul_ovfl_tst		# yes; overflow has occurred
-	
+
 # no, it didn't overflow; we have correct result
 	bra.w		fmul_normal_exit
 
@@ -8201,7 +8201,7 @@ fmul_may_ovfl:
 # of this operation then has its exponent scaled by -0x6000 to create the
 # exceptional operand.
 #
-fmul_unfl:	
+fmul_unfl:
 	bset		&unfl_bit,FPSR_EXCEPT(%a6) # set unfl exc bit
 
 # for fun, let's use only extended precision, round to zero. then, let
@@ -8234,7 +8234,7 @@ fmul_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fmul_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -8250,7 +8250,7 @@ fmul_unfl_ena:
 fmul_unfl_ena_cont:
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -8285,7 +8285,7 @@ fmul_may_unfl:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp0	# execute multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -8309,11 +8309,11 @@ fmul_may_unfl:
 	mov.l		L_SCR3(%a6),%d1
 	andi.b		&0xc0,%d1		# keep rnd prec
 	ori.b		&rz_mode*0x10,%d1	# insert RZ
-	
+
 	fmov.l		%d1,%fpcr		# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply	
+	fmul.x		FP_SCR0(%a6),%fp1	# execute multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fabs.x		%fp1			# make absolute value
@@ -8455,22 +8455,22 @@ fmul_inf_src:
 #	norm() - normalize mantissa for EXOP on denorm			#
 #	scale_to_zero_src() - scale src exponent to zero		#
 #	ovf_res() - return default overflow result			#
-# 	unf_res() - return default underflow result			#
+#	unf_res() - return default underflow result			#
 #	res_qnan_1op() - return QNAN result				#
 #	res_snan_1op() - return SNAN result				#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
 #	d0 = round prec/mode						#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP (if exception occurred)				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs, infinities, and zeroes as special cases. Divide	#
+#	Handle NANs, infinities, and zeroes as special cases. Divide	#
 # norms into extended, single, and double precision.			#
-# 	Norms can be emulated w/ a regular fmove instruction. For	#
+#	Norms can be emulated w/ a regular fmove instruction. For	#
 # sgl/dbl, must scale exponent and perform an "fmove". Check to see	#
 # if the result would have overflowed/underflowed. If so, use unf_res()	#
 # or ovf_res() to return the default result. Also return EXOP if	#
@@ -8496,7 +8496,7 @@ fin:
 
 	mov.b		STAG(%a6),%d1		# fetch src optype tag
 	bne.w		fin_not_norm		# optimize on non-norm input
-		
+
 #
 # FP MOVE IN: NORMs and DENORMs ONLY!
 #
@@ -8557,9 +8557,9 @@ fin_denorm_unfl_ena:
 
 #
 # operand is to be rounded to single or double precision
-#	
+#
 fin_not_ext:
-	cmpi.b		%d0,&s_mode*0x10 	# separate sgl/dbl prec
+	cmpi.b		%d0,&s_mode*0x10	# separate sgl/dbl prec
 	bne.b		fin_dbl
 
 #
@@ -8643,10 +8643,10 @@ fin_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# unf_res may have set 'Z'
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow or inexact is enabled. 
+# operand will underflow AND underflow or inexact is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fin_sd_unfl_ena:
@@ -8768,7 +8768,7 @@ fin_not_norm:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fdiv(): emulates the fdiv instruction				#
+#	fdiv(): emulates the fdiv instruction				#
 #	fsdiv(): emulates the fsdiv instruction				#
 #	fddiv(): emulates the fddiv instruction				#
 #									#
@@ -8777,8 +8777,8 @@ fin_not_norm:
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res() - return default underflow result			#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -8796,7 +8796,7 @@ fin_not_norm:
 # instruction won't cause an exception. Use the regular fdiv to		#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -8833,7 +8833,7 @@ fdiv:
 	or.b		STAG(%a6),%d1		# combine src tags
 
 	bne.w		fdiv_not_norm		# optimize on non-norm input
-		
+
 #
 # DIVIDE: NORMs and DENORMs ONLY!
 #
@@ -8899,7 +8899,7 @@ tbl_fdiv_ovfl2:
 fdiv_no_ovfl:
 	mov.l		(%sp)+,%d0		# restore scale factor
 	bra.b		fdiv_normal_exit
-	
+
 fdiv_may_ovfl:
 	mov.l		%d0,-(%sp)		# save scale factor
 
@@ -8932,7 +8932,7 @@ fdiv_ovfl_tst:
 	bne.b		fdiv_ovfl_ena		# yes
 
 fdiv_ovfl_dis:
-	btst		&neg_bit,FPSR_CC(%a6) 	# is result negative?
+	btst		&neg_bit,FPSR_CC(%a6)	# is result negative?
 	sne		%d1			# set sign param accordingly
 	mov.l		L_SCR3(%a6),%d0		# pass prec:rnd
 	bsr.l		ovf_res			# calculate default result
@@ -9004,7 +9004,7 @@ fdiv_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fdiv_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -9068,8 +9068,8 @@ fdiv_may_unfl:
 #
 # we still don't know if underflow occurred. result is ~ equal to 1. but,
 # we don't know if the result was an underflow that rounded up to a 1
-# or a normalized number that rounded down to a 1. so, redo the entire 
-# operation using RZ as the rounding mode to see what the pre-rounded 
+# or a normalized number that rounded down to a 1. so, redo the entire
+# operation using RZ as the rounding mode to see what the pre-rounded
 # result is. this case should be relatively rare.
 #
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op into fp1
@@ -9196,8 +9196,8 @@ fdiv_inf_load_p:
 	rts
 
 #
-# The destination was an INF w/ an In Range or ZERO source, the result is 
-# an INF w/ the proper sign. 
+# The destination was an INF w/ an In Range or ZERO source, the result is
+# an INF w/ the proper sign.
 # The 68881/882 returns the destination INF w/ the new sign(if the j-bit of the
 # dst INF is set, then then j-bit of the result INF is also set).
 #
@@ -9227,11 +9227,11 @@ fdiv_inf_dst_p:
 #	fdneg(): emulates the fdneg instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	norm() - normalize a denorm to provide EXOP			#
+#	norm() - normalize a denorm to provide EXOP			#
 #	scale_to_zero_src() - scale sgl/dbl source exponent		#
 #	ovf_res() - return default overflow result			#
 #	unf_res() - return default underflow result			#
-# 	res_qnan_1op() - return QNAN result				#
+#	res_qnan_1op() - return QNAN result				#
 #	res_snan_1op() - return SNAN result				#
 #									#
 # INPUT ***************************************************************	#
@@ -9269,7 +9269,7 @@ fneg:
 	mov.l		%d0,L_SCR3(%a6)		# store rnd info
 	mov.b		STAG(%a6),%d1
 	bne.w		fneg_not_norm		# optimize on non-norm input
-		
+
 #
 # NEGATE SIGN : norms and denorms ONLY!
 #
@@ -9328,7 +9328,7 @@ fneg_ext_unfl_ena:
 	neg.w		%d0			# new exponent = -(shft val)
 	addi.w		&0x6000,%d0		# add new bias to exponent
 	mov.w		FP_SCR0_EX(%a6),%d1	# fetch old sign,exp
-	andi.w		&0x8000,%d1	 	# keep old sign
+	andi.w		&0x8000,%d1		# keep old sign
 	andi.w		&0x7fff,%d0		# clear sign position
 	or.w		%d1,%d0			# concat old sign, new exponent
 	mov.w		%d0,FP_SCR0_EX(%a6)	# insert new exponent
@@ -9407,7 +9407,7 @@ fneg_dbl:
 fneg_sd_unfl:
 	bset		&unfl_bit,FPSR_EXCEPT(%a6) # set unfl exc bit
 
-	eori.b		&0x80,FP_SCR0_EX(%a6)	# negate sign	
+	eori.b		&0x80,FP_SCR0_EX(%a6)	# negate sign
 	bpl.b		fneg_sd_unfl_tst
 	bset		&neg_bit,FPSR_CC(%a6)	# set 'N' ccode bit
 
@@ -9423,10 +9423,10 @@ fneg_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# unf_res may have set 'Z'
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow is enabled. 
+# operand will underflow AND underflow is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fneg_sd_unfl_ena:
@@ -9548,19 +9548,19 @@ fneg_not_norm:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	ftst(): emulates the ftest instruction				#
+#	ftst(): emulates the ftest instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	res{s,q}nan_1op() - set NAN result for monadic instruction	#
+#	res{s,q}nan_1op() - set NAN result for monadic instruction	#
 #									#
 # INPUT ***************************************************************	#
-# 	a0 = pointer to extended precision source operand		#
+#	a0 = pointer to extended precision source operand		#
 #									#
 # OUTPUT **************************************************************	#
 #	none								#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Check the source operand tag (STAG) and set the FPCR according	#
+#	Check the source operand tag (STAG) and set the FPCR according	#
 # to the operand type and sign.						#
 #									#
 #########################################################################
@@ -9569,7 +9569,7 @@ fneg_not_norm:
 ftst:
 	mov.b		STAG(%a6),%d1
 	bne.b		ftst_not_norm		# optimize on non-norm input
-		
+
 #
 # Norm:
 #
@@ -9617,7 +9617,7 @@ ftst_inf_p:
 ftst_inf_m:
 	mov.b		&inf_bmask+neg_bmask,FPSR_CC(%a6) # set 'I','N' ccode bits
 	rts
-	
+
 #
 # Zero:
 #
@@ -9646,13 +9646,13 @@ ftst_zero_m:
 #	fp0 = result							#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Separate according to operand type. Unnorms don't pass through 	#
-# here. For norms, load the rounding mode/prec, execute a "fint", then 	#
+#	Separate according to operand type. Unnorms don't pass through	#
+# here. For norms, load the rounding mode/prec, execute a "fint", then	#
 # store the resulting FPSR bits.					#
-# 	For denorms, force the j-bit to a one and do the same as for	#
-# norms. Denorms are so low that the answer will either be a zero or a 	#
+#	For denorms, force the j-bit to a one and do the same as for	#
+# norms. Denorms are so low that the answer will either be a zero or a	#
 # one.									#
-# 	For zeroes/infs/NANs, return the same while setting the FPSR	#
+#	For zeroes/infs/NANs, return the same while setting the FPSR	#
 # as appropriate.							#
 #									#
 #########################################################################
@@ -9661,7 +9661,7 @@ ftst_zero_m:
 fint:
 	mov.b		STAG(%a6),%d1
 	bne.b		fint_not_norm		# optimize on non-norm input
-		
+
 #
 # Norm:
 #
@@ -9671,7 +9671,7 @@ fint_norm:
 	fmov.l		%d0,%fpcr		# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fint.x 		SRC(%a0),%fp0		# execute fint
+	fint.x		SRC(%a0),%fp0		# execute fint
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fmov.l		%fpsr,%d0		# save FPSR
@@ -9749,16 +9749,16 @@ fint_inf_m:
 #	d0 = round precision/mode					#
 #									#
 # OUTPUT **************************************************************	#
-# 	fp0 = result							#
+#	fp0 = result							#
 #									#
 # ALGORITHM ***********************************************************	#
 #	Separate according to operand type. Unnorms don't pass through	#
-# here. For norms, load the rounding mode/prec, execute a "fintrz", 	#
+# here. For norms, load the rounding mode/prec, execute a "fintrz",	#
 # then store the resulting FPSR bits.					#
-# 	For denorms, force the j-bit to a one and do the same as for	#
+#	For denorms, force the j-bit to a one and do the same as for	#
 # norms. Denorms are so low that the answer will either be a zero or a	#
 # one.									#
-# 	For zeroes/infs/NANs, return the same while setting the FPSR	#
+#	For zeroes/infs/NANs, return the same while setting the FPSR	#
 # as appropriate.							#
 #									#
 #########################################################################
@@ -9767,7 +9767,7 @@ fint_inf_m:
 fintrz:
 	mov.b		STAG(%a6),%d1
 	bne.b		fintrz_not_norm		# optimize on non-norm input
-		
+
 #
 # Norm:
 #
@@ -9862,17 +9862,17 @@ fintrz_inf_m:
 #									#
 # ALGORITHM ***********************************************************	#
 #	Handle NANs, infinities, and zeroes as special cases. Divide	#
-# norms into extended, single, and double precision. 			#
-# 	Simply clear sign for extended precision norm. Ext prec denorm	#
+# norms into extended, single, and double precision.			#
+#	Simply clear sign for extended precision norm. Ext prec denorm	#
 # gets an EXOP created for it since it's an underflow.			#
 #	Double and single precision can overflow and underflow. First,	#
 # scale the operand such that the exponent is zero. Perform an "fabs"	#
-# using the correct rnd mode/prec. Check to see if the original 	#
+# using the correct rnd mode/prec. Check to see if the original		#
 # exponent would take an exception. If so, use unf_res() or ovf_res()	#
 # to calculate the default result. Also, create the EXOP for the	#
-# exceptional case. If no exception should occur, insert the correct 	#
+# exceptional case. If no exception should occur, insert the correct	#
 # result exponent and return.						#
-# 	Unnorms don't pass through here.				#
+#	Unnorms don't pass through here.				#
 #									#
 #########################################################################
 
@@ -9892,7 +9892,7 @@ fabs:
 	mov.l		%d0,L_SCR3(%a6)		# store rnd info
 	mov.b		STAG(%a6),%d1
 	bne.w		fabs_not_norm		# optimize on non-norm input
-		
+
 #
 # ABSOLUTE VALUE: norms and denorms ONLY!
 #
@@ -10038,10 +10038,10 @@ fabs_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# set possible 'Z' ccode
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow is enabled. 
+# operand will underflow AND underflow is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fabs_sd_unfl_ena:
@@ -10163,10 +10163,10 @@ fabs_inf:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fcmp(): fp compare op routine					#
+#	fcmp(): fp compare op routine					#
 #									#
 # XREF ****************************************************************	#
-# 	res_qnan() - return QNAN result					#
+#	res_qnan() - return QNAN result					#
 #	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
@@ -10178,7 +10178,7 @@ fabs_inf:
 #	None								#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs and denorms as special cases. For everything else,	#
+#	Handle NANs and denorms as special cases. For everything else,	#
 # just use the actual fcmp instruction to produce the correct condition	#
 # codes.								#
 #									#
@@ -10191,14 +10191,14 @@ fcmp:
 	lsl.b		&0x3,%d1
 	or.b		STAG(%a6),%d1
 	bne.b		fcmp_not_norm		# optimize on non-norm input
-		
+
 #
 # COMPARE FP OPs : NORMs, ZEROs, INFs, and "corrected" DENORMs
 #
 fcmp_norm:
 	fmovm.x		DST(%a1),&0x80		# load dst op
 
-	fcmp.x 		%fp0,SRC(%a0)		# do compare
+	fcmp.x		%fp0,SRC(%a0)		# do compare
 
 	fmov.l		%fpsr,%d0		# save FPSR
 	rol.l		&0x8,%d0		# extract ccode bits
@@ -10219,7 +10219,7 @@ tbl_fcmp_op:
 	short		fcmp_norm	- tbl_fcmp_op # NORM - ZERO
 	short		fcmp_norm	- tbl_fcmp_op # NORM - INF
 	short		fcmp_res_qnan	- tbl_fcmp_op # NORM - QNAN
-	short		fcmp_nrm_dnrm 	- tbl_fcmp_op # NORM - DENORM
+	short		fcmp_nrm_dnrm	- tbl_fcmp_op # NORM - DENORM
 	short		fcmp_res_snan	- tbl_fcmp_op # NORM - SNAN
 	short		tbl_fcmp_op	- tbl_fcmp_op #
 	short		tbl_fcmp_op	- tbl_fcmp_op #
@@ -10281,8 +10281,8 @@ fcmp_res_snan:
 	rts
 
 #
-# DENORMs are a little more difficult. 
-# If you have a 2 DENORMs, then you can just force the j-bit to a one 
+# DENORMs are a little more difficult.
+# If you have a 2 DENORMs, then you can just force the j-bit to a one
 # and use the fcmp_norm routine.
 # If you have a DENORM and an INF or ZERO, just force the DENORM's j-bit to a one
 # and use the fcmp_norm routine.
@@ -10323,7 +10323,7 @@ fcmp_dnrm_sd:
 	mov.l		SRC_LO(%a0),FP_SCR0_LO(%a6)
 	lea		FP_SCR1(%a6),%a1
 	lea		FP_SCR0(%a6),%a0
-	bra.w		fcmp_norm	
+	bra.w		fcmp_norm
 
 fcmp_nrm_dnrm:
 	mov.b		SRC_EX(%a0),%d0		# determine if like signs
@@ -10355,15 +10355,15 @@ fcmp_dnrm_nrm_m:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fsglmul(): emulates the fsglmul instruction			#
+#	fsglmul(): emulates the fsglmul instruction			#
 #									#
 # XREF ****************************************************************	#
 #	scale_to_zero_src() - scale src exponent to zero		#
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res4() - return default underflow result for sglop		#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -10381,7 +10381,7 @@ fcmp_dnrm_nrm_m:
 # instruction won't cause an exception. Use the regular fsglmul to	#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -10413,11 +10413,11 @@ fsglmul_norm:
 
 	add.l		(%sp)+,%d0		# SCALE_FACTOR = scale1 + scale2
 
-	cmpi.l		%d0,&0x3fff-0x7ffe 	# would result ovfl?
+	cmpi.l		%d0,&0x3fff-0x7ffe	# would result ovfl?
 	beq.w		fsglmul_may_ovfl	# result may rnd to overflow
 	blt.w		fsglmul_ovfl		# result will overflow
 
-	cmpi.l		%d0,&0x3fff+0x0001 	# would result unfl?
+	cmpi.l		%d0,&0x3fff+0x0001	# would result unfl?
 	beq.w		fsglmul_may_unfl	# result may rnd to no unfl
 	bgt.w		fsglmul_unfl		# result will underflow
 
@@ -10504,7 +10504,7 @@ fsglmul_may_ovfl:
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
 	fsglmul.x	FP_SCR0(%a6),%fp0	# execute sgl multiply
-	
+
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -10513,7 +10513,7 @@ fsglmul_may_ovfl:
 	fabs.x		%fp0,%fp1		# make a copy of result
 	fcmp.b		%fp1,&0x2		# is |result| >= 2.b?
 	fbge.w		fsglmul_ovfl_tst	# yes; overflow has occurred
-	
+
 # no, it didn't overflow; we have correct result
 	bra.w		fsglmul_normal_exit
 
@@ -10547,7 +10547,7 @@ fsglmul_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fsglmul_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -10555,7 +10555,7 @@ fsglmul_unfl_ena:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply	
+	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 
@@ -10580,7 +10580,7 @@ fsglmul_may_unfl:
 	fmov.l		L_SCR3(%a6),%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsglmul.x	FP_SCR0(%a6),%fp0	# execute sgl multiply	
+	fsglmul.x	FP_SCR0(%a6),%fp0	# execute sgl multiply
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -10604,11 +10604,11 @@ fsglmul_may_unfl:
 	mov.l		L_SCR3(%a6),%d1
 	andi.b		&0xc0,%d1		# keep rnd prec
 	ori.b		&rz_mode*0x10,%d1	# insert RZ
-	
+
 	fmov.l		%d1,%fpcr		# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply	
+	fsglmul.x	FP_SCR0(%a6),%fp1	# execute sgl multiply
 
 	fmov.l		&0x0,%fpcr		# clear FPCR
 	fabs.x		%fp1			# make absolute value
@@ -10696,15 +10696,15 @@ fsglmul_inf_dst:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fsgldiv(): emulates the fsgldiv instruction			#
+#	fsgldiv(): emulates the fsgldiv instruction			#
 #									#
 # XREF ****************************************************************	#
 #	scale_to_zero_src() - scale src exponent to zero		#
 #	scale_to_zero_dst() - scale dst exponent to zero		#
 #	unf_res4() - return default underflow result for sglop		#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan() - return QNAN result					#
-# 	res_snan() - return SNAN result					#
+#	res_qnan() - return QNAN result					#
+#	res_snan() - return SNAN result					#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -10722,7 +10722,7 @@ fsglmul_inf_dst:
 # instruction won't cause an exception. Use the regular fsgldiv to	#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -10737,7 +10737,7 @@ fsgldiv:
 	or.b		STAG(%a6),%d1		# combine src tags
 
 	bne.w		fsgldiv_not_norm	# optimize on non-norm input
-		
+
 #
 # DIVIDE: NORMs and DENORMs ONLY!
 #
@@ -10764,7 +10764,7 @@ fsgldiv_norm:
 	cmpi.l		%d0,&0x3fff-0x7ffe
 	ble.w		fsgldiv_may_ovfl
 
-	cmpi.l		%d0,&0x3fff-0x0000 	# will result underflow?
+	cmpi.l		%d0,&0x3fff-0x0000	# will result underflow?
 	beq.w		fsgldiv_may_unfl	# maybe
 	bgt.w		fsgldiv_unfl		# yes; go handle underflow
 
@@ -10824,7 +10824,7 @@ fsgldiv_ovfl_tst:
 	bne.b		fsgldiv_ovfl_ena	# yes
 
 fsgldiv_ovfl_dis:
-	btst		&neg_bit,FPSR_CC(%a6) 	# is result negative
+	btst		&neg_bit,FPSR_CC(%a6)	# is result negative
 	sne		%d1			# set sign param accordingly
 	mov.l		L_SCR3(%a6),%d0		# pass prec:rnd
 	andi.b		&0x30,%d0		# kill precision
@@ -10880,7 +10880,7 @@ fsgldiv_unfl_dis:
 	rts
 
 #
-# UNFL is enabled. 
+# UNFL is enabled.
 #
 fsgldiv_unfl_ena:
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op
@@ -10931,8 +10931,8 @@ fsgldiv_may_unfl:
 #
 # we still don't know if underflow occurred. result is ~ equal to 1. but,
 # we don't know if the result was an underflow that rounded up to a 1
-# or a normalized number that rounded down to a 1. so, redo the entire 
-# operation using RZ as the rounding mode to see what the pre-rounded 
+# or a normalized number that rounded down to a 1. so, redo the entire
+# operation using RZ as the rounding mode to see what the pre-rounded
 # result is. this case should be relatively rare.
 #
 	fmovm.x		FP_SCR1(%a6),&0x40	# load dst op into %fp1
@@ -11036,25 +11036,25 @@ fsgldiv_inf_dst:
 #	fdadd(): emulates the fdadd instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	addsub_scaler2() - scale the operands so they won't take exc	#
+#	addsub_scaler2() - scale the operands so they won't take exc	#
 #	ovf_res() - return default overflow result			#
 #	unf_res() - return default underflow result			#
 #	res_qnan() - set QNAN result					#
-# 	res_snan() - set SNAN result					#
+#	res_snan() - set SNAN result					#
 #	res_operr() - set OPERR result					#
 #	scale_to_zero_src() - set src operand exponent equal to zero	#
 #	scale_to_zero_dst() - set dst operand exponent equal to zero	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
-# 	a1 = pointer to extended precision destination operand		#
+#	a1 = pointer to extended precision destination operand		#
 #									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP (if exception occurred)				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs, infinities, and zeroes as special cases. Divide	#
+#	Handle NANs, infinities, and zeroes as special cases. Divide	#
 # norms into extended, single, and double precision.			#
 #	Do addition after scaling exponents such that exception won't	#
 # occur. Then, check result exponent to see if exception would have	#
@@ -11268,7 +11268,7 @@ fadd_unfl_ena_sd:
 
 #
 # result is equal to the smallest normalized number in the selected precision
-# if the precision is extended, this result could not have come from an 
+# if the precision is extended, this result could not have come from an
 # underflow that rounded up.
 #
 fadd_may_unfl:
@@ -11290,7 +11290,7 @@ fadd_may_unfl:
 # ok, so now the result has a exponent equal to the smallest normalized
 # exponent for the selected precision. also, the mantissa is equal to
 # 0x8000000000000000 and this mantissa is the result of rounding non-zero
-# g,r,s. 
+# g,r,s.
 # now, we must determine whether the pre-rounded result was an underflow
 # rounded "up" or a normalized number rounded "down".
 # so, we do this be re-executing the add using RZ as the rounding mode and
@@ -11401,7 +11401,7 @@ fadd_zero_2:
 	fmov.s		&0x00000000,%fp0	# return +ZERO
 	mov.b		&z_bmask,FPSR_CC(%a6)	# set Z
 	rts
-	
+
 #
 # the ZEROes have opposite signs:
 # - therefore, we return +ZERO if the rounding modes are RN,RZ, or RP.
@@ -11455,7 +11455,7 @@ fadd_inf_2:
 	eor.b		%d1,%d0
 	bmi.l		res_operr		# weed out (-INF)+(+INF)
 
-# ok, so it's not an OPERR. but, we do have to remember to return the 
+# ok, so it's not an OPERR. but, we do have to remember to return the
 # src INF since that's where the 881/882 gets the j-bit from...
 
 #
@@ -11489,25 +11489,25 @@ fadd_inf_done:
 #	fdsub(): emulates the fdsub instruction				#
 #									#
 # XREF ****************************************************************	#
-# 	addsub_scaler2() - scale the operands so they won't take exc	#
+#	addsub_scaler2() - scale the operands so they won't take exc	#
 #	ovf_res() - return default overflow result			#
 #	unf_res() - return default underflow result			#
 #	res_qnan() - set QNAN result					#
-# 	res_snan() - set SNAN result					#
+#	res_snan() - set SNAN result					#
 #	res_operr() - set OPERR result					#
 #	scale_to_zero_src() - set src operand exponent equal to zero	#
 #	scale_to_zero_dst() - set dst operand exponent equal to zero	#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
-# 	a1 = pointer to extended precision destination operand		#
+#	a1 = pointer to extended precision destination operand		#
 #									#
 # OUTPUT **************************************************************	#
 #	fp0 = result							#
 #	fp1 = EXOP (if exception occurred)				#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Handle NANs, infinities, and zeroes as special cases. Divide	#
+#	Handle NANs, infinities, and zeroes as special cases. Divide	#
 # norms into extended, single, and double precision.			#
 #	Do subtraction after scaling exponents such that exception won't#
 # occur. Then, check result exponent to see if exception would have	#
@@ -11657,7 +11657,7 @@ fsub_unfl:
 	add.l		&0xc,%sp
 
 	fmovm.x		FP_SCR1(%a6),&0x80	# load dst op
-	
+
 	fmov.l		&rz_mode*0x10,%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
@@ -11721,7 +11721,7 @@ fsub_unfl_ena_sd:
 
 #
 # result is equal to the smallest normalized number in the selected precision
-# if the precision is extended, this result could not have come from an 
+# if the precision is extended, this result could not have come from an
 # underflow that rounded up.
 #
 fsub_may_unfl:
@@ -11743,7 +11743,7 @@ fsub_may_unfl:
 # ok, so now the result has a exponent equal to the smallest normalized
 # exponent for the selected precision. also, the mantissa is equal to
 # 0x8000000000000000 and this mantissa is the result of rounding non-zero
-# g,r,s. 
+# g,r,s.
 # now, we must determine whether the pre-rounded result was an underflow
 # rounded "up" or a normalized number rounded "down".
 # so, we do this be re-executing the add using RZ as the rounding mode and
@@ -11899,7 +11899,7 @@ fsub_zero_src:
 
 #
 # both operands are INFs. an OPERR will result if the INFs have the
-# same signs. else, 
+# same signs. else,
 #
 fsub_inf_2:
 	mov.b		SRC_EX(%a0),%d0		# exclusive or the signs
@@ -11914,7 +11914,7 @@ fsub_inf_src:
 	fmovm.x		SRC(%a0),&0x80		# return src INF
 	fneg.x		%fp0			# invert sign
 	fbge.w		fsub_inf_done		# sign is now positive
-	mov.b		&neg_bmask+inf_bmask,FPSR_CC(%a6) # set INF/NEG	
+	mov.b		&neg_bmask+inf_bmask,FPSR_CC(%a6) # set INF/NEG
 	rts
 
 fsub_inf_dst:
@@ -11930,7 +11930,7 @@ fsub_inf_done:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	fsqrt(): emulates the fsqrt instruction				#
+#	fsqrt(): emulates the fsqrt instruction				#
 #	fssqrt(): emulates the fssqrt instruction			#
 #	fdsqrt(): emulates the fdsqrt instruction			#
 #									#
@@ -11938,8 +11938,8 @@ fsub_inf_done:
 #	scale_sqrt() - scale the source operand				#
 #	unf_res() - return default underflow result			#
 #	ovf_res() - return default overflow result			#
-# 	res_qnan_1op() - return QNAN result				#
-# 	res_snan_1op() - return SNAN result				#
+#	res_qnan_1op() - return QNAN result				#
+#	res_snan_1op() - return SNAN result				#
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to extended precision source operand		#
@@ -11956,7 +11956,7 @@ fsub_inf_done:
 # instruction won't cause an exception. Use the regular fsqrt to	#
 # compute a result. Check if the regular operands would have taken	#
 # an exception. If so, return the default overflow/underflow result	#
-# and return the EXOP if exceptions are enabled. Else, scale the 	#
+# and return the EXOP if exceptions are enabled. Else, scale the	#
 # result operand to the proper exponent.				#
 #									#
 #########################################################################
@@ -11978,7 +11978,7 @@ fsqrt:
 	clr.w		%d1
 	mov.b		STAG(%a6),%d1
 	bne.w		fsqrt_not_norm		# optimize on non-norm input
-		
+
 #
 # SQUARE ROOT: norms and denorms ONLY!
 #
@@ -12100,7 +12100,7 @@ fsqrt_sd_unfl:
 	fmov.l		&rz_mode*0x10,%fpcr	# set FPCR
 	fmov.l		&0x0,%fpsr		# clear FPSR
 
-	fsqrt.x 	FP_SCR0(%a6),%fp0	# execute square root
+	fsqrt.x		FP_SCR0(%a6),%fp0	# execute square root
 
 	fmov.l		%fpsr,%d1		# save status
 	fmov.l		&0x0,%fpcr		# clear FPCR
@@ -12120,10 +12120,10 @@ fsqrt_sd_unfl_dis:
 	bsr.l		unf_res			# calculate default result
 	or.b		%d0,FPSR_CC(%a6)	# set possible 'Z' ccode
 	fmovm.x		FP_SCR0(%a6),&0x80	# return default result in fp0
-	rts	
+	rts
 
 #
-# operand will underflow AND underflow is enabled. 
+# operand will underflow AND underflow is enabled.
 # therefore, we must return the result rounded to extended precision.
 #
 fsqrt_sd_unfl_ena:
@@ -12239,15 +12239,15 @@ fsqrt_not_norm:
 	bra.l		res_qnan_1op
 
 #
-# 	fsqrt(+0) = +0
-# 	fsqrt(-0) = -0
+#	fsqrt(+0) = +0
+#	fsqrt(-0) = -0
 #	fsqrt(+INF) = +INF
-# 	fsqrt(-INF) = OPERR
+#	fsqrt(-INF) = OPERR
 #
 fsqrt_zero:
 	tst.b		SRC_EX(%a0)		# is ZERO positive or negative?
 	bmi.b		fsqrt_zero_m		# negative
-fsqrt_zero_p:	
+fsqrt_zero_p:
 	fmov.s		&0x00000000,%fp0	# return +ZERO
 	mov.b		&z_bmask,FPSR_CC(%a6)	# set 'Z' ccode bit
 	rts
@@ -12273,13 +12273,13 @@ fsqrt_inf_p:
 #									#
 # INPUT ***************************************************************	#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	d0 = value of register fetched					#
 #									#
 # ALGORITHM ***********************************************************	#
-#	According to the index value in d1 which can range from zero 	#
-# to fifteen, load the corresponding register file value (where 	#
+#	According to the index value in d1 which can range from zero	#
+# to fifteen, load the corresponding register file value (where		#
 # address register indexes start at 8). D0/D1/A0/A1/A6/A7 are on the	#
 # stack. The rest should still be in their original places.		#
 #									#
@@ -12368,7 +12368,7 @@ fdregf:
 # INPUT ***************************************************************	#
 #	d0 = longowrd value to store					#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(data register is updated)					#
 #									#
@@ -12429,7 +12429,7 @@ sdregl7:
 # INPUT ***************************************************************	#
 #	d0 = word value to store					#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(data register is updated)					#
 #									#
@@ -12490,7 +12490,7 @@ sdregw7:
 # INPUT ***************************************************************	#
 #	d0 = byte value to store					#
 #	d1 = index of register to fetch from				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(data register is updated)					#
 #									#
@@ -12551,16 +12551,16 @@ sdregb7:
 # INPUT ***************************************************************	#
 #	d0 = amount to increment by					#
 #	d1 = index of address register to increment			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(address register is updated)					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Typically used for an instruction w/ a post-increment <ea>, 	#
+#	Typically used for an instruction w/ a post-increment <ea>,	#
 # this routine adds the increment value in d0 to the address register	#
 # specified by d1. A0/A1/A6/A7 reside on the stack. The rest reside	#
 # in their original places.						#
-# 	For a7, if the increment amount is one, then we have to 	#
+#	For a7, if the increment amount is one, then we have to		#
 # increment by two. For any a7 update, set the mia7_flag so that if	#
 # an access error exception occurs later in emulation, this address	#
 # register update can be undone.					#
@@ -12615,16 +12615,16 @@ iareg7b:
 # INPUT ***************************************************************	#
 #	d0 = amount to decrement by					#
 #	d1 = index of address register to decrement			#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	(address register is updated)					#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Typically used for an instruction w/ a pre-decrement <ea>, 	#
+#	Typically used for an instruction w/ a pre-decrement <ea>,	#
 # this routine adds the decrement value in d0 to the address register	#
 # specified by d1. A0/A1/A6/A7 reside on the stack. The rest reside	#
 # in their original places.						#
-# 	For a7, if the decrement amount is one, then we have to 	#
+#	For a7, if the decrement amount is one, then we have to		#
 # decrement by two. For any a7 update, set the mda7_flag so that if	#
 # an access error exception occurs later in emulation, this address	#
 # register update can be undone.					#
@@ -12680,17 +12680,17 @@ dareg7b:
 #									#
 # INPUT ***************************************************************	#
 #	d0 = index of FP register to load				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_SRC(a6) = value loaded from FP register file			#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Using the index in d0, load FP_SRC(a6) with a number from the 	#
+#	Using the index in d0, load FP_SRC(a6) with a number from the	#
 # FP register file.							#
 #									#
 #########################################################################
 
-	global 		load_fpn1
+	global		load_fpn1
 load_fpn1:
 	mov.w		(tbl_load_fpn1.b,%pc,%d0.w*2), %d0
 	jmp		(tbl_load_fpn1.b,%pc,%d0.w*1)
@@ -12753,12 +12753,12 @@ load_fpn1_7:
 #									#
 # INPUT ***************************************************************	#
 #	d0 = index of FP register to load				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	FP_DST(a6) = value loaded from FP register file			#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Using the index in d0, load FP_DST(a6) with a number from the 	#
+#	Using the index in d0, load FP_DST(a6) with a number from the	#
 # FP register file.							#
 #									#
 #########################################################################
@@ -12819,7 +12819,7 @@ load_fpn2_7:
 
 #########################################################################
 # XDEF ****************************************************************	#
-# 	store_fpreg(): store an fp value to the fpreg designated d0.	#
+#	store_fpreg(): store an fp value to the fpreg designated d0.	#
 #									#
 # XREF ****************************************************************	#
 #	None								#
@@ -12827,7 +12827,7 @@ load_fpn2_7:
 # INPUT ***************************************************************	#
 #	fp0 = extended precision value to store				#
 #	d0  = index of floating-point register				#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	None								#
 #									#
@@ -12860,27 +12860,27 @@ store_fpreg_1:
 	fmovm.x		&0x80, EXC_FP1(%a6)
 	rts
 store_fpreg_2:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x20
 	rts
 store_fpreg_3:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x10
 	rts
 store_fpreg_4:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x08
 	rts
 store_fpreg_5:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x04
 	rts
 store_fpreg_6:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x02
 	rts
 store_fpreg_7:
-	fmovm.x 	&0x01, -(%sp)
+	fmovm.x		&0x01, -(%sp)
 	fmovm.x		(%sp)+, &0x01
 	rts
 
@@ -12897,18 +12897,18 @@ store_fpreg_7:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	If no failure on _mem_read():					#
-# 	FP_SRC(a6) = packed operand now as a binary FP number		#
+#	FP_SRC(a6) = packed operand now as a binary FP number		#
 #									#
 # ALGORITHM ***********************************************************	#
-#	Get the correct <ea> whihc is the value on the exception stack 	#
+#	Get the correct <ea> whihc is the value on the exception stack	#
 # frame w/ maybe a correction factor if the <ea> is -(an) or (an)+.	#
 # Then, fetch the operand from memory. If the fetch fails, exit		#
 # through facc_in_x().							#
 #	If the packed operand is a ZERO,NAN, or INF, convert it to	#
-# its binary representation here. Else, call decbin() which will 	#
+# its binary representation here. Else, call decbin() which will	#
 # convert the packed value to an extended precision binary value.	#
 #									#
 #########################################################################
@@ -12965,7 +12965,7 @@ gp_not_spec:
 #	and NaN operands are dispatched without entering this routine)	#
 #	value in 68881/882 format at location (a0).			#
 #									#
-#	A1. Convert the bcd exponent to binary by successive adds and 	#
+#	A1. Convert the bcd exponent to binary by successive adds and	#
 #	muls. Set the sign according to SE. Subtract 16 to compensate	#
 #	for the mantissa which is to be interpreted as 17 integer	#
 #	digits, rather than 1 integer and 16 fraction digits.		#
@@ -13029,7 +13029,7 @@ RTABLE:
 
 	global		decbin
 decbin:
-	mov.l		0x0(%a0),FP_SCR0_EX(%a6) # make a copy of input 
+	mov.l		0x0(%a0),FP_SCR0_EX(%a6) # make a copy of input
 	mov.l		0x4(%a0),FP_SCR0_HI(%a6) # so we don't alter it
 	mov.l		0x8(%a0),FP_SCR0_LO(%a6)
 
@@ -13318,7 +13318,7 @@ ap_n_en:
 #
 # Pwrten calculates the exponent factor in the selected rounding mode
 # according to the following table:
-#	
+#
 #	Sign of Mant  Sign of Exp  Rounding Mode  PWRTEN Rounding Mode
 #
 #	ANY	  ANY	RN	RN
@@ -13406,7 +13406,7 @@ mul:
 # it will be inex2, but will be reported as inex1 by get_op.
 #
 end_dec:
-	fmov.l		%fpsr,%d0		# get status register	
+	fmov.l		%fpsr,%d0		# get status register
 	bclr		&inex2_bit+8,%d0	# test for inex2 and clear it
 	beq.b		no_exc			# skip this if no exc
 	ori.w		&inx1a_mask,2+USER_FPSR(%a6) # set INEX1/AINEX
@@ -13423,16 +13423,16 @@ no_exc:
 #									#
 # INPUT ***************************************************************	#
 #	a0 = pointer to the input extended precision value in memory.	#
-#	     the input may be either normalized, unnormalized, or 	#
+#	     the input may be either normalized, unnormalized, or	#
 #	     denormalized.						#
-#	d0 = contains the k-factor sign-extended to 32-bits. 		#
+#	d0 = contains the k-factor sign-extended to 32-bits.		#
 #									#
 # OUTPUT **************************************************************	#
 #	FP_SCR0(a6) = bcd format result on the stack.			#
 #									#
 # ALGORITHM ***********************************************************	#
 #									#
-#	A1.	Set RM and size ext;  Set SIGMA = sign of input.  	#
+#	A1.	Set RM and size ext;  Set SIGMA = sign of input.	#
 #		The k-factor is saved for use in d7. Clear the		#
 #		BINDEC_FLG for separating normalized/denormalized	#
 #		input.  If input is unnormalized or denormalized,	#
@@ -13442,15 +13442,15 @@ no_exc:
 #									#
 #	A3.	Compute ILOG.						#
 #		ILOG is the log base 10 of the input value.  It is	#
-#		approximated by adding e + 0.f when the original 	#
-#		value is viewed as 2^^e * 1.f in extended precision.  	#
+#		approximated by adding e + 0.f when the original	#
+#		value is viewed as 2^^e * 1.f in extended precision.	#
 #		This value is stored in d6.				#
 #									#
 #	A4.	Clr INEX bit.						#
-#		The operation in A3 above may have set INEX2.  		#
+#		The operation in A3 above may have set INEX2.		#
 #									#
 #	A5.	Set ICTR = 0;						#
-#		ICTR is a flag used in A13.  It must be set before the 	#
+#		ICTR is a flag used in A13.  It must be set before the	#
 #		loop entry A6.						#
 #									#
 #	A6.	Calculate LEN.						#
@@ -13472,7 +13472,7 @@ no_exc:
 #		of ISCALE and X.  A table is given in the code.		#
 #									#
 #	A8.	Clr INEX; Force RZ.					#
-#		The operation in A3 above may have set INEX2.  		#
+#		The operation in A3 above may have set INEX2.		#
 #		RZ mode is forced for the scaling operation to insure	#
 #		only one rounding error.  The grs bits are collected in #
 #		the INEX flag for use in A10.				#
@@ -13503,11 +13503,11 @@ no_exc:
 #		the mantissa by 10.					#
 #									#
 #	A14.	Convert the mantissa to bcd.				#
-#		The binstr routine is used to convert the LEN digit 	#
+#		The binstr routine is used to convert the LEN digit	#
 #		mantissa to bcd in memory.  The input to binstr is	#
 #		to be a fraction; i.e. (mantissa)/10^LEN and adjusted	#
 #		such that the decimal point is to the left of bit 63.	#
-#		The bcd digits are stored in the correct position in 	#
+#		The bcd digits are stored in the correct position in	#
 #		the final string area in memory.			#
 #									#
 #	A15.	Convert the exponent to bcd.				#
@@ -13553,7 +13553,7 @@ RBDTBL:
 #		d2: upper 32-bits of mantissa for binstr
 #		d3: scratch;lower 32-bits of mantissa for binstr
 #		d4: LEN
-#      		d5: LAMBDA/ICTR
+#		d5: LAMBDA/ICTR
 #		d6: ILOG
 #		d7: k-factor
 #		a0: ptr for original operand/final result
@@ -13577,7 +13577,7 @@ bindec:
 #     separating  normalized/denormalized input.  If the input
 #     is a denormalized number, set the BINDEC_FLG memory word
 #     to signal denorm.  If the input is unnormalized, normalize
-#     the input and test for denormalized result.  
+#     the input and test for denormalized result.
 #
 	fmov.l		&rm_mode*0x10,%fpcr	# set RM and ext
 	mov.l		(%a0),L_SCR2(%a6)	# save exponent for sign check
@@ -13658,7 +13658,7 @@ A3_cont:
 	sub.w		&0x3fff,%d0	# strip off bias
 	fadd.w		%d0,%fp0	# add in exp
 	fsub.s		FONE(%pc),%fp0	# subtract off 1.0
-	fbge.w		pos_res		# if pos, branch 
+	fbge.w		pos_res		# if pos, branch
 	fmul.x		PLOG2UP1(%pc),%fp0	# if neg, mul by LOG2UP1
 	fmov.l		%fp0,%d6	# put ILOG in d6 as a lword
 	bra.b		A4_str		# go move out ILOG
@@ -13668,14 +13668,14 @@ pos_res:
 
 
 # A4. Clr INEX bit.
-#     The operation in A3 above may have set INEX2.  
+#     The operation in A3 above may have set INEX2.
 
 A4_str:
 	fmov.l		&0,%fpsr	# zero all of fpsr - nothing needed
 
 
 # A5. Set ICTR = 0;
-#     ICTR is a flag used in A13.  It must be set before the 
+#     ICTR is a flag used in A13.  It must be set before the
 #     loop entry A6. The lower word of d5 is used for ICTR.
 
 	clr.w		%d5		# clear ICTR
@@ -13841,21 +13841,21 @@ e_next2:
 	bne.b		e_loop2		# if not, loop
 
 # A8. Clr INEX; Force RZ.
-#     The operation in A3 above may have set INEX2.  
+#     The operation in A3 above may have set INEX2.
 #     RZ mode is forced for the scaling operation to insure
-#     only one rounding error.  The grs bits are collected in 
+#     only one rounding error.  The grs bits are collected in
 #     the INEX flag for use in A10.
 #
 # Register usage:
 #	Input/Output
 
-	fmov.l		&0,%fpsr	# clr INEX 
+	fmov.l		&0,%fpsr	# clr INEX
 	fmov.l		&rz_mode*0x10,%fpcr	# set RZ rounding mode
 
 # A9. Scale X -> Y.
 #     The mantissa is scaled to the desired number of significant
 #     digits.  The excess digits are collected in INEX2. If mul,
-#     Check d2 for excess 10 exponential value.  If not zero, 
+#     Check d2 for excess 10 exponential value.  If not zero,
 #     the iscale value would have caused the pwrten calculation
 #     to overflow.  Only a negative iscale can cause this, so
 #     multiply by 10^(d2), which is now only allowed to be 24,
@@ -13986,7 +13986,7 @@ A10_st:
 
 A11_st:
 	mov.l		USER_FPCR(%a6),L_SCR1(%a6)	# save it for later
-	and.l		&0x00000030,USER_FPCR(%a6)	# set size to ext, 
+	and.l		&0x00000030,USER_FPCR(%a6)	# set size to ext,
 #					;block exceptions
 
 
@@ -14022,7 +14022,7 @@ A12_st:
 	lea.l		FP_SCR1(%a6),%a0	# a0 is ptr to FP_SCR1(a6)
 	fmov.x		%fp0,(%a0)	# move Y to memory at FP_SCR1(a6)
 	tst.l		L_SCR2(%a6)	# test sign of original operand
-	bge.b		do_fint12		# if pos, use Y 
+	bge.b		do_fint12		# if pos, use Y
 	or.l		&0x80000000,(%a0)	# if neg, use -Y
 do_fint12:
 	mov.l	USER_FPSR(%a6),-(%sp)
@@ -14118,7 +14118,7 @@ A13_con:
 	subq.l		&1,%d6		# subtract 1 from ILOG
 	mov.w		&1,%d5		# set ICTR
 	fmov.l		&rm_mode*0x10,%fpcr	# set rmode to RM
-	fmul.s		FTEN(%pc),%fp2	# compute 10^LEN 
+	fmul.s		FTEN(%pc),%fp2	# compute 10^LEN
 	bra.w		A6_str		# return to A6 and recompute YINT
 test_2:
 	fmul.s		FTEN(%pc),%fp2	# compute 10^LEN
@@ -14134,7 +14134,7 @@ fix_ex:
 	fmov.l		&rm_mode*0x10,%fpcr	# set rmode to RM
 	bra.w		A6_str		# return to A6 and recompute YINT
 #
-# Since ICTR <> 0, we have already been through one adjustment, 
+# Since ICTR <> 0, we have already been through one adjustment,
 # and shouldn't have another; this is to check if abs(YINT) = 10^LEN
 # 10^LEN is again computed using whatever table is in a1 since the
 # value calculated cannot be inexact.
@@ -14160,11 +14160,11 @@ z_next:
 	fmul.s		FTEN(%pc),%fp2	# if LEN++, the get 10^^LEN
 
 # A14. Convert the mantissa to bcd.
-#      The binstr routine is used to convert the LEN digit 
+#      The binstr routine is used to convert the LEN digit
 #      mantissa to bcd in memory.  The input to binstr is
 #      to be a fraction; i.e. (mantissa)/10^LEN and adjusted
 #      such that the decimal point is to the left of bit 63.
-#      The bcd digits are stored in the correct position in 
+#      The bcd digits are stored in the correct position in
 #      the final string area in memory.
 #
 #
@@ -14207,7 +14207,7 @@ A14_st:
 	bgt.b		no_sft		# if so, don't shift
 	neg.l		%d0		# make exp positive
 m_loop:
-	lsr.l		&1,%d2		# shift d2:d3 right, add 0s 
+	lsr.l		&1,%d2		# shift d2:d3 right, add 0s
 	roxr.l		&1,%d3		# the number of places
 	dbf.w		%d0,m_loop	# given in d0
 no_sft:
@@ -14232,9 +14232,9 @@ zer_m:
 #
 #      Digits are stored in L_SCR1(a6) on return from BINDEC as:
 #
-#  	 32               16 15                0
+#	 32               16 15                0
 #	-----------------------------------------
-#  	|  0 | e3 | e2 | e1 | e4 |  X |  X |  X |
+#	|  0 | e3 | e2 | e1 | e4 |  X |  X |  X |
 #	-----------------------------------------
 #
 # And are moved into their proper places in FP_SCR0.  If digit e4
@@ -14297,7 +14297,7 @@ convrt:
 	sub.w		&0x3ffd,%d0	# subtract off bias
 	neg.w		%d0		# make exp positive
 x_loop:
-	lsr.l		&1,%d2		# shift d2:d3 right 
+	lsr.l		&1,%d2		# shift d2:d3 right
 	roxr.l		&1,%d3		# the number of places
 	dbf.w		%d0,x_loop	# given in d0
 x_loop_fin:
@@ -14308,12 +14308,12 @@ x_loop_fin:
 	mov.l		&4,%d0		# put 4 in d0 for binstr call
 	lea.l		L_SCR1(%a6),%a0	# a0 is ptr to L_SCR1 for exp digits
 	bsr		binstr		# call binstr to convert exp
-	mov.l		L_SCR1(%a6),%d0	# load L_SCR1 lword to d0 
+	mov.l		L_SCR1(%a6),%d0	# load L_SCR1 lword to d0
 	mov.l		&12,%d1		# use d1 for shift count
 	lsr.l		%d1,%d0		# shift d0 right by 12
 	bfins		%d0,FP_SCR0(%a6){&4:&12}	# put e3:e2:e1 in FP_SCR0
 	lsr.l		%d1,%d0		# shift d0 right by 12
-	bfins		%d0,FP_SCR0(%a6){&16:&4}	# put e4 in FP_SCR0 
+	bfins		%d0,FP_SCR0(%a6){&16:&4}	# put e4 in FP_SCR0
 	tst.b		%d0		# check if e4 is zero
 	beq.b		A16_st		# if zero, skip rest
 	or.l		&opaop_mask,USER_FPSR(%a6)	# set OPERR & AIOP in USER_FPSR
@@ -14344,14 +14344,14 @@ x_loop_fin:
 
 A16_st:
 	clr.l		%d0		# clr d0 for collection of signs
-	and.b		&0x0f,FP_SCR0(%a6)	# clear first nibble of FP_SCR0 
+	and.b		&0x0f,FP_SCR0(%a6)	# clear first nibble of FP_SCR0
 	tst.l		L_SCR2(%a6)	# check sign of original mantissa
 	bge.b		mant_p		# if pos, don't set SM
 	mov.l		&2,%d0		# move 2 in to d0 for SM
 mant_p:
 	tst.l		%d6		# check sign of ILOG
 	bge.b		wr_sgn		# if pos, don't set SE
-	addq.l		&1,%d0		# set bit 0 in d0 for SE 
+	addq.l		&1,%d0		# set bit 0 in d0 for SE
 wr_sgn:
 	bfins		%d0,FP_SCR0(%a6){&0:&2}	# insert SM and SE into FP_SCR0
 
@@ -14417,8 +14417,8 @@ PTENRM:
 #	d2:d3 = 64-bit binary integer					#
 #	d0    = desired length (LEN)					#
 #	a0    = pointer to start in memory for bcd characters		#
-#          	(This pointer must point to byte 4 of the first		#
-#          	 lword of the packed decimal memory string.)		#
+#		(This pointer must point to byte 4 of the first		#
+#		 lword of the packed decimal memory string.)		#
 #									#
 # OUTPUT ************************************************************** #
 #	a0 = pointer to LEN bcd digits representing the 64-bit integer.	#
@@ -14558,14 +14558,14 @@ end_bstr:
 #									#
 # INPUT ***************************************************************	#
 #	None								#
-# 									#
+#									#
 # OUTPUT **************************************************************	#
 #	None								#
 #									#
 # ALGORITHM ***********************************************************	#
-# 	Flow jumps here when an FP data fetch call gets an error 	#
+#	Flow jumps here when an FP data fetch call gets an error	#
 # result. This means the operating system wants an access error frame	#
-# made out of the current exception stack frame. 			#
+# made out of the current exception stack frame.			#
 #	So, we first call restore() which makes sure that any updated	#
 # -(an)+ register gets returned to its pre-exception value and then	#
 # we change the stack to an access error stack frame.			#
@@ -14735,7 +14735,7 @@ ri_a7:
 	bne.b		ri_a7_done		# supervisor
 	movc		%usp,%a0		# restore USP
 	sub.l		%d0,%a0
-	movc		%a0,%usp	
+	movc		%a0,%usp
 ri_a7_done:
 	rts
 
diff --git a/arch/m68k/kernel/bios32.c b/arch/m68k/kernel/bios32.c
index b3aed9d0b..be2f7e616 100644
--- a/arch/m68k/kernel/bios32.c
+++ b/arch/m68k/kernel/bios32.c
@@ -46,7 +46,7 @@
 
 #define ALIGN(val,align)	(((val) + ((align) - 1)) & ~((align) - 1))
 
-#define MAX(val1, val2) 	(((val1) > (val2)) ? val1 : val2)
+#define MAX(val1, val2)		(((val1) > (val2)) ? val1 : val2)
 
 /*
  * Offsets relative to the I/O and memory base addresses from where resources
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 015e4632d..59ee17ab5 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -55,7 +55,7 @@
 ENTRY(buserr)
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	buserr_c
 	addql	#4,%sp
 	jra	ret_from_exception
@@ -63,7 +63,7 @@ ENTRY(buserr)
 ENTRY(trap)
 	SAVE_ALL_INT
 	GET_CURRENT(%d0)
-	movel	%sp,%sp@- 		| stack frame pointer argument
+	movel	%sp,%sp@-		| stack frame pointer argument
 	bsrl	trap_c
 	addql	#4,%sp
 	jra	ret_from_exception
@@ -99,18 +99,18 @@ do_trace:
 	jbsr	syscall_trace
 
 ret_from_signal:
-	RESTORE_SWITCH_STACK 
+	RESTORE_SWITCH_STACK
 	addql	#4,%sp
-/* on 68040 complete pending writebacks if any */	
+/* on 68040 complete pending writebacks if any */
 #ifdef CONFIG_M68040
-	bfextu	%sp@(PT_VECTOR){#0,#4},%d0  
+	bfextu	%sp@(PT_VECTOR){#0,#4},%d0
 	subql	#7,%d0				| bus error frame ?
 	jbne	1f
 	movel	%sp,%sp@-
 	jbsr	berr_040cleanup
 	addql	#4,%sp
-1:	
-#endif	
+1:
+#endif
 	jra	ret_from_exception
 
 ENTRY(system_call)
@@ -229,18 +229,18 @@ inthandler:
 	bfextu %sp@(PT_VECTOR){#4,#10},%d0
 
 	movel	%sp,%sp@-
-	movel	%d0,%sp@- 		|  put vector # on stack
+	movel	%d0,%sp@-		|  put vector # on stack
 #if defined(MACH_Q40_ONLY) && defined(CONFIG_BLK_DEV_FD)
 	btstb	#4,0xff000000		| Q40 floppy needs very special treatment ...
 	jbeq	1f
-	btstb	#3,0xff000004		
+	btstb	#3,0xff000004
 	jbeq	1f
 	jbsr	floppy_hardint
 	jbra	3f
 1:
-#endif		
+#endif
 	jbsr	process_int		|  process the IRQ
-3:     	addql	#8,%sp			|  pop parameters off stack
+3:	addql	#8,%sp			|  pop parameters off stack
 
 ret_from_interrupt:
 	subqb	#1,%curptr@(TASK_INFO+TINFO_PREEMPT+2)
@@ -266,7 +266,7 @@ bad_interrupt:
 	rte
 
 ENTRY(sys_fork)
-	SAVE_SWITCH_STACK	
+	SAVE_SWITCH_STACK
 	pea	%sp@(SWITCH_STACK_SIZE)
 	jbsr	m68k_fork
 	addql	#4,%sp
@@ -282,7 +282,7 @@ ENTRY(sys_clone)
 	rts
 
 ENTRY(sys_vfork)
-	SAVE_SWITCH_STACK	
+	SAVE_SWITCH_STACK
 	pea	%sp@(SWITCH_STACK_SIZE)
 	jbsr	m68k_vfork
 	addql	#4,%sp
@@ -397,7 +397,7 @@ resume:
 #if !defined(CPU_M68060_ONLY)
 1:	tstb	%a1@(TASK_THREAD+THREAD_FPSTATE)
 	jeq	3f
-#endif	
+#endif
 2:	fmovemx	%a1@(TASK_THREAD+THREAD_FPREG),%fp0-%fp7
 	fmoveml	%a1@(TASK_THREAD+THREAD_FPCNTL),%fpcr/%fpsr/%fpiar
 3:	frestore %a1@(TASK_THREAD+THREAD_FPSTATE)
@@ -554,7 +554,7 @@ sys_call_table:
 	.long sys_adjtimex
 	.long sys_mprotect	/* 125 */
 	.long sys_sigprocmask
-	.long sys_ni_syscall		/* old "create_module" */ 
+	.long sys_ni_syscall		/* old "create_module" */
 	.long sys_init_module
 	.long sys_delete_module
 	.long sys_ni_syscall	/* 130 - old "get_kernel_syms" */
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index 95688507f..b1e5ae099 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -19,7 +19,7 @@
 ** ++ Bjoern & Roman: ATARI-68040 support for the Medusa
 ** 95/11/18 Richard Hirst: Added MVME166 support
 ** 96/04/26 Guenther Kelleter: fixed identity mapping for Falcon with
-** 			      Magnum- and FX-alternate ram
+**			      Magnum- and FX-alternate ram
 ** 98/04/25 Phil Blundell: added HP300 support
 ** 1998/08/30 David Kilzer: Added support for font_desc structures
 **            for linux-2.1.115
@@ -67,7 +67,7 @@
  * for the kernel.
  *	There are new subroutines and data structures to make MMU
  * support cleaner and easier to understand.
- * 	First, you will find a routine call "mmu_map" which maps
+ *	First, you will find a routine call "mmu_map" which maps
  * a logical to a physical region for some length given a cache
  * type on behalf of the caller.  This routine makes writing the
  * actual per-machine specific code very simple.
@@ -299,7 +299,7 @@
  * For the head.S console, there are three supported fonts, 6x11, 8x16 and 8x8.
  * The 8x8 font is harder to read but fits more on the screen.
  */
-#define FONT_8x8 	/* default */
+#define FONT_8x8	/* default */
 /* #define FONT_8x16 */	/* 2nd choice */
 /* #define FONT_6x11 */	/* 3rd choice */
 
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index a270b5ff3..552bd2ff1 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -67,8 +67,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
 {
 	struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
 	/* Check whether the thread is blocked in resume() */
-	if (sw->retpc > (unsigned long)scheduling_functions_start_here &&
-	    sw->retpc < (unsigned long)scheduling_functions_end_here)
+	if (in_sched_functions(sw->retpc))
 		return ((unsigned long *)sw->a6)[1];
 	else
 		return sw->retpc;
@@ -382,12 +381,6 @@ out:
 	return error;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long fp, pc;
@@ -403,7 +396,7 @@ unsigned long get_wchan(struct task_struct *p)
 		    fp >= 8184+stack_page)
 			return 0;
 		pc = ((unsigned long *)fp)[1];
-		if (pc < first_sched || pc >= last_sched)
+		if (!in_sched_functions(pc))
 			return pc;
 		fp = *(unsigned long *) fp;
 	} while (count++ < 16);
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index 666b3ae01..12e4acdfd 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -156,7 +156,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 
 	switch (request) {
 	/* when I and D space are separate, these will need to be fixed. */
-		case PTRACE_PEEKTEXT: /* read word at location addr. */ 
+		case PTRACE_PEEKTEXT: /* read word at location addr. */
 		case PTRACE_PEEKDATA: {
 			unsigned long tmp;
 			int copied;
@@ -172,12 +172,12 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 	/* read the word at location addr in the USER area. */
 		case PTRACE_PEEKUSR: {
 			unsigned long tmp;
-			
+
 			ret = -EIO;
 			if ((addr & 3) || addr < 0 ||
 			    addr > sizeof(struct user) - 3)
 				break;
-			
+
 			tmp = 0;  /* Default return condition */
 			addr = addr >> 2; /* temporary hack. */
 			ret = -EIO;
@@ -217,7 +217,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 				break;
 
 			addr = addr >> 2; /* temporary hack. */
-			    
+
 			if (addr == PT_SR) {
 				data &= SR_MASK;
 				data <<= 16;
@@ -269,8 +269,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 		}
 
 /*
- * make the child exit.  Best I can do is send it a sigkill. 
- * perhaps it should be put in the status that it wants to 
+ * make the child exit.  Best I can do is send it a sigkill.
+ * perhaps it should be put in the status that it wants to
  * exit.
  */
 		case PTRACE_KILL: {
@@ -311,7 +311,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 			break;
 
 		case PTRACE_GETREGS: { /* Get all gp regs from the child. */
-		  	int i;
+			int i;
 			unsigned long tmp;
 			for (i = 0; i < 19; i++) {
 			    tmp = get_reg(child, i);
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 0dec70f1f..2ede4125b 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -85,7 +85,7 @@ void (*mach_reset)( void );
 void (*mach_halt)( void );
 void (*mach_power_off)( void );
 long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
-#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) 
+#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
 void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
 #endif
 #ifdef CONFIG_HEARTBEAT
@@ -143,7 +143,7 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
 		/* Already set up by head.S */
 		break;
 
- 	    case BI_MEMCHUNK:
+	    case BI_MEMCHUNK:
 		if (m68k_num_memory < NUM_MEMINFO) {
 		    m68k_memory[m68k_num_memory].addr = data[0];
 		    m68k_memory[m68k_num_memory].size = data[1];
@@ -236,7 +236,7 @@ void __init setup_arch(char **cmdline_p)
 		volatile int zero = 0;
 		asm __volatile__ ("frestore %0" : : "m" (zero));
 	}
-#endif	
+#endif
 
 	init_mm.start_code = PAGE_OFFSET;
 	init_mm.end_code = (unsigned long) &_etext;
@@ -296,28 +296,28 @@ void __init setup_arch(char **cmdline_p)
 #endif
 #ifdef CONFIG_SUN3
 	    case MACH_SUN3:
-	    	config_sun3();
-	    	break;
+		config_sun3();
+		break;
 #endif
 #ifdef CONFIG_APOLLO
 	    case MACH_APOLLO:
-	    	config_apollo();
-	    	break;
+		config_apollo();
+		break;
 #endif
 #ifdef CONFIG_MVME147
 	    case MACH_MVME147:
-	    	config_mvme147();
-	    	break;
+		config_mvme147();
+		break;
 #endif
 #ifdef CONFIG_MVME16x
 	    case MACH_MVME16x:
-	    	config_mvme16x();
-	    	break;
+		config_mvme16x();
+		break;
 #endif
 #ifdef CONFIG_BVME6000
 	    case MACH_BVME6000:
-	    	config_bvme6000();
-	    	break;
+		config_bvme6000();
+		break;
 #endif
 #ifdef CONFIG_HP300
 	    case MACH_HP300:
@@ -384,11 +384,11 @@ void __init setup_arch(char **cmdline_p)
 
 /* set ISA defs early as possible */
 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
-#if defined(CONFIG_Q40) 
+#if defined(CONFIG_Q40)
 	if (MACH_IS_Q40) {
 	    isa_type = Q40_ISA;
 	    isa_sex = 0;
-	} 
+	}
 #elif defined(CONFIG_GG2)
 	if (MACH_IS_AMIGA && AMIGAHW_PRESENT(GG2_ISA)){
 	    isa_type = GG2_ISA;
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index eaa659ef5..0fd62ab0f 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -121,7 +121,7 @@ do_rt_sigsuspend(struct pt_regs *regs)
 	}
 }
 
-asmlinkage int 
+asmlinkage int
 sys_sigaction(int sig, const struct old_sigaction *act,
 	      struct old_sigaction *oact)
 {
@@ -329,7 +329,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
 	/* get previous context */
 	if (copy_from_user(&context, usc, sizeof(context)))
 		goto badframe;
-	
+
 	/* restore passed registers */
 	regs->d1 = context.sc_d1;
 	regs->a0 = context.sc_a0;
@@ -521,7 +521,7 @@ asmlinkage int do_sigreturn(unsigned long __unused)
 	sigdelsetmask(&set, ~_BLOCKABLE);
 	current->blocked = set;
 	recalc_sigpending();
-	
+
 	if (restore_sigcontext(regs, &frame->sc, frame + 1, &d0))
 		goto badframe;
 	return d0;
@@ -548,7 +548,7 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused)
 	sigdelsetmask(&set, ~_BLOCKABLE);
 	current->blocked = set;
 	recalc_sigpending();
-	
+
 	if (rt_restore_ucontext(regs, sw, &frame->uc, &d0))
 		goto badframe;
 	return d0;
@@ -1091,7 +1091,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
 				current->state = TASK_STOPPED;
 				current->exit_code = signr;
 				sighand = current->parent->sighand;
-				if (sighand && !(sighand->action[SIGCHLD-1].sa.sa_flags 
+				if (sighand && !(sighand->action[SIGCHLD-1].sa.sa_flags
 					     & SA_NOCLDSTOP))
 					notify_parent(current, SIGCHLD);
 				schedule();
diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S
index d8a095061..bffd69a4a 100644
--- a/arch/m68k/kernel/sun3-head.S
+++ b/arch/m68k/kernel/sun3-head.S
@@ -9,7 +9,7 @@ PSL_HIGHIPL     = 0x2700
 NBSG            = 0x20000
 ICACHE_ONLY	= 0x00000009
 CACHES_OFF	= 0x00000008	| actually a clear and disable --m
-#define MAS_STACK INT_STACK 
+#define MAS_STACK INT_STACK
 ROOT_TABLE_SIZE = 128
 PAGESIZE	= 8192
 SUN3_INVALID_PMEG = 255
@@ -35,9 +35,9 @@ ENTRY(_start)
 
 /* Firstly, disable interrupts and set up function codes. */
 	movew	#PSL_HIGHIPL, %sr
-	moveq	#FC_CONTROL, %d0	
-	movec	%d0, %sfc	
-	movec	%d0, %dfc	
+	moveq	#FC_CONTROL, %d0
+	movec	%d0, %sfc
+	movec	%d0, %dfc
 
 /* Make sure we're in context zero. */
 	moveq	#0, %d0
@@ -45,9 +45,9 @@ ENTRY(_start)
 
 /* map everything the bootloader left us into high memory, clean up the
    excess later */
-	lea	(AC_SEGMAP+0),%a0 
-	lea	(AC_SEGMAP+KERNBASE),%a1	
-1:	
+	lea	(AC_SEGMAP+0),%a0
+	lea	(AC_SEGMAP+KERNBASE),%a1
+1:
 	movsb	%a0@, %d1
 	movsb	%d1, %a1@
 	cmpib	#SUN3_INVALID_PMEG, %d1
@@ -55,13 +55,13 @@ ENTRY(_start)
 	addl	#NBSG,%a0
 	addl	#NBSG,%a1
 	jmp	1b
-	
-2:				
-	
+
+2:
+
 /* Disable caches and jump to high code. */
 	moveq	#ICACHE_ONLY,%d0	| Cache disabled until we're ready to enable it
 	movc	%d0, %cacr	|   is this the right value? (yes --m)
-	jmp	1f:l		
+	jmp	1f:l
 
 /* Following code executes at high addresses (0xE000xxx). */
 1:	lea	init_task,%curptr			| get initial thread...
@@ -76,7 +76,7 @@ ENTRY(_start)
 	movel   %a0@, %a1@
 	addl	#4, %a1
 	dbf	%d0, 1b
-	
+
 /* Point MSP at an invalid page to trap if it's used. --m */
 	movl	#(PAGESIZE),%d0
 	movc	%d0,%msp
@@ -86,9 +86,9 @@ ENTRY(_start)
 	jbsr	sun3_init
 
 	jbsr	base_trap_init
-			
+
         jbsr    start_kernel
-	trap	#15			
+	trap	#15
 
         .data
         .even
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index fb1f0c7fa..2ed7b783f 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -203,10 +203,10 @@ asmlinkage int sys_ipc (uint call, int first, int second,
 		default:
 			return -ENOSYS;
 		}
-	if (call <= MSGCTL) 
+	if (call <= MSGCTL)
 		switch (call) {
 		case MSGSND:
-			return sys_msgsnd (first, (struct msgbuf *) ptr, 
+			return sys_msgsnd (first, (struct msgbuf *) ptr,
 					  second, third);
 		case MSGRCV:
 			switch (version) {
@@ -234,7 +234,7 @@ asmlinkage int sys_ipc (uint call, int first, int second,
 		default:
 			return -ENOSYS;
 		}
-	if (call <= SHMCTL) 
+	if (call <= SHMCTL)
 		switch (call) {
 		case SHMAT:
 			switch (version) {
@@ -247,7 +247,7 @@ asmlinkage int sys_ipc (uint call, int first, int second,
 				return put_user (raddr, (ulong *) third);
 			}
 			}
-		case SHMDT: 
+		case SHMDT:
 			return sys_shmdt ((char *)ptr);
 		case SHMGET:
 			return sys_shmget (first, second, third);
@@ -442,7 +442,7 @@ cache_flush_060 (unsigned long addr, int scope, int cache, unsigned long len)
   unsigned long paddr, i;
 
   /*
-   * 68060 manual says: 
+   * 68060 manual says:
    *  cpush %dc : flush DC, remains valid (with our %cacr setup)
    *  cpush %ic : invalidate IC
    *  cpush %bc : flush DC + invalidate IC
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 7c5146b90..fdf8e0ae9 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -116,7 +116,7 @@ void __init base_trap_init(void)
 
 		__asm__ volatile ("movec %%vbr, %0" : "=r" ((void*)sun3x_prom_vbr));
 	}
-	
+
 	/* setup the exception vector table */
 	__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
 
@@ -352,7 +352,7 @@ static inline unsigned long probe040(int iswrite, unsigned long addr, int wbs)
 
 	asm volatile (".chip 68040; movec %%mmusr,%0; .chip 68k" : "=r" (mmusr));
 
-	set_fs(old_fs); 
+	set_fs(old_fs);
 
 	return mmusr;
 }
@@ -379,8 +379,8 @@ static inline int do_040writeback1(unsigned short wbs, unsigned long wba,
 	}
 
 	/* set_fs can not be moved, otherwise put_user() may oops */
-	set_fs(old_fs); 
-	
+	set_fs(old_fs);
+
 
 #ifdef DEBUG
 	printk("do_040writeback1, res=%d\n",res);
@@ -390,7 +390,7 @@ static inline int do_040writeback1(unsigned short wbs, unsigned long wba,
 }
 
 /* after an exception in a writeback the stack frame corresponding
- * to that exception is discarded, set a few bits in the old frame 
+ * to that exception is discarded, set a few bits in the old frame
  * to simulate what it should look like
  */
 static inline void fix_xframe040(struct frame *fp, unsigned long wba, unsigned short wbs)
@@ -415,7 +415,7 @@ static inline void do_040writebacks(struct frame *fp)
 				       fp->un.fmt7.wb2d);
 		if (res)
 			fix_xframe040(fp, fp->un.fmt7.wb2a, fp->un.fmt7.wb2s);
-		else 
+		else
 			fp->un.fmt7.wb2s = 0;
 	}
 
@@ -461,9 +461,9 @@ static inline void access_error040(struct frame *fp)
 
 #ifdef DEBUG
 	printk("ssw=%#x, fa=%#lx\n", ssw, fp->un.fmt7.faddr);
-        printk("wb1s=%#x, wb2s=%#x, wb3s=%#x\n", fp->un.fmt7.wb1s,  
+        printk("wb1s=%#x, wb2s=%#x, wb3s=%#x\n", fp->un.fmt7.wb1s,
 		fp->un.fmt7.wb2s, fp->un.fmt7.wb3s);
-	printk ("wb2a=%lx, wb3a=%lx, wb2d=%lx, wb3d=%lx\n", 
+	printk ("wb2a=%lx, wb3a=%lx, wb2d=%lx, wb3d=%lx\n",
 		fp->un.fmt7.wb2a, fp->un.fmt7.wb3a,
 		fp->un.fmt7.wb2d, fp->un.fmt7.wb3d);
 #endif
@@ -491,7 +491,7 @@ static inline void access_error040(struct frame *fp)
 			errorcode = 0;
 		}
 
-		/* despite what documentation seems to say, RMW 
+		/* despite what documentation seems to say, RMW
 		 * accesses have always both the LK and RW bits set */
 		if (!(ssw & RW_040) || (ssw & LK_040))
 			errorcode |= 2;
@@ -547,7 +547,7 @@ static inline void bus_error030 (struct frame *fp)
 			fp->ptregs.format == 0xa ? fp->ptregs.pc + 2 : fp->un.fmtb.baddr - 2
 			:
 			fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
-	if (ssw & DF) 
+	if (ssw & DF)
 		printk ("Data %s fault at %#010lx in %s (pc=%#lx)\n",
 			ssw & RW ? "read" : "write",
 			fp->un.fmtb.daddr,
@@ -559,7 +559,7 @@ static inline void bus_error030 (struct frame *fp)
 	 * the testing for a bad kernel-space access (demand-mapping applies
 	 * to kernel accesses too).
 	 */
-	
+
 	if ((ssw & DF)
 	    && (buserr_type & (SUN3_BUSERR_PROTERR | SUN3_BUSERR_INVALID))) {
 		if (mmu_emu_handle_fault (fp->un.fmtb.daddr, ssw & RW, 0))
@@ -659,7 +659,7 @@ static inline void bus_error030 (struct frame *fp)
 		printk ("protection fault on insn access (segv).\n");
 #endif
 		force_sig (SIGSEGV, current);
-       }	
+       }
 }
 #else
 #if defined(CPU_M68020_OR_M68030)
@@ -1035,7 +1035,7 @@ void bad_super_trap (struct frame *fp)
 			fp->ptregs.format);
 	else
 		printk ("*** Exception %d ***   FORMAT=%X\n",
-			(fp->ptregs.vector) >> 2, 
+			(fp->ptregs.vector) >> 2,
 			fp->ptregs.format);
 	if (fp->ptregs.vector >> 2 == VEC_ADDRERR && CPU_IS_020_OR_030) {
 		unsigned short ssw = fp->un.fmtb.ssw;
@@ -1187,6 +1187,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
 
 	console_verbose();
 	printk("%s: %08x\n",str,nr);
+	print_modules();
 	printk("PC: [<%08lx>]",fp->pc);
 	print_symbol(" %s\n", fp->pc);
 	printk("\nSR: %04x  SP: %p  a2: %08lx\n",
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 6dc62684c..b0a5cd53d 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -41,7 +41,7 @@ SECTIONS
   /* will be freed after init */
   . = ALIGN(4096);		/* Init code and data */
   __init_begin = .;
-  .init.text : { 
+  .init.text : {
 	_sinittext = .;
 	*(.init.text)
 	_einittext = .;
@@ -56,12 +56,12 @@ SECTIONS
   __stop___param = .;
   __initcall_start = .;
   .initcall.init : {
-	*(.initcall1.init) 
-	*(.initcall2.init) 
-	*(.initcall3.init) 
-	*(.initcall4.init) 
-	*(.initcall5.init) 
-	*(.initcall6.init) 
+	*(.initcall1.init)
+	*(.initcall2.init)
+	*(.initcall3.init)
+	*(.initcall4.init)
+	*(.initcall5.init)
+	*(.initcall6.init)
 	*(.initcall7.init)
   }
   __initcall_end = .;
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index f293e5671..12931b324 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -24,10 +24,10 @@ SECTIONS
   .data : {			/* Data */
 	*(.data)
 	CONSTRUCTORS
-  	. = ALIGN(16);		/* Exception table */
-  	__start___ex_table = .;
-  	*(__ex_table) 
-  	__stop___ex_table = .;
+	. = ALIGN(16);		/* Exception table */
+	__start___ex_table = .;
+	*(__ex_table)
+	__stop___ex_table = .;
 	}
   /* End of data goes *here* so that freeing init code works properly. */
   _edata = .;
@@ -35,12 +35,12 @@ SECTIONS
   /* will be freed after init */
   . = ALIGN(8192);	/* Init code and data */
 __init_begin = .;
-	.init.text : { 
+	.init.text : {
 		_sinittext = .;
 		*(.init.text)
 		_einittext = .;
 	}
-  	.init.data : { *(.init.data) }
+	.init.data : { *(.init.data) }
 	. = ALIGN(16);
 	__setup_start = .;
 	.init.setup : { *(.init.setup) }
@@ -50,12 +50,12 @@ __init_begin = .;
 	__stop___param = .;
 	__initcall_start = .;
 	.initcall.init : {
-		*(.initcall1.init) 
-		*(.initcall2.init) 
-		*(.initcall3.init) 
-		*(.initcall4.init) 
-		*(.initcall5.init) 
-		*(.initcall6.init) 
+		*(.initcall1.init)
+		*(.initcall2.init)
+		*(.initcall3.init)
+		*(.initcall4.init)
+		*(.initcall5.init)
+		*(.initcall6.init)
 		*(.initcall7.init)
 	}
 	__initcall_end = .;
@@ -70,7 +70,7 @@ __init_begin = .;
 	. = ALIGN(8192);
 	__init_end = .;
 	.init.task : { *(init_task) }
-	
+
 
   .bss : { *(.bss) }		/* BSS */
 
@@ -84,7 +84,7 @@ __init_begin = .;
 	}
 
   .crap : {
-  	/* Stabs debugging sections.  */
+	/* Stabs debugging sections.  */
 	*(.stab)
 	*(.stabstr)
 	*(.stab.excl)
diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c
index 008403eb8..7729f3387 100644
--- a/arch/m68k/lib/ashldi3.c
+++ b/arch/m68k/lib/ashldi3.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define BITS_PER_UNIT 8
 
-typedef 	 int SItype	__attribute__ ((mode (SI)));
+typedef		 int SItype	__attribute__ ((mode (SI)));
 typedef unsigned int USItype	__attribute__ ((mode (SI)));
 typedef		 int DItype	__attribute__ ((mode (DI)));
 typedef int word_type __attribute__ ((mode (__word__)));
diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c
index 78efb65e3..18ea5f7ed 100644
--- a/arch/m68k/lib/ashrdi3.c
+++ b/arch/m68k/lib/ashrdi3.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define BITS_PER_UNIT 8
 
-typedef 	 int SItype	__attribute__ ((mode (SI)));
+typedef		 int SItype	__attribute__ ((mode (SI)));
 typedef unsigned int USItype	__attribute__ ((mode (SI)));
 typedef		 int DItype	__attribute__ ((mode (DI)));
 typedef int word_type __attribute__ ((mode (__word__)));
diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c
index 93b1cb6fd..d06442d3a 100644
--- a/arch/m68k/lib/lshrdi3.c
+++ b/arch/m68k/lib/lshrdi3.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define BITS_PER_UNIT 8
 
-typedef 	 int SItype	__attribute__ ((mode (SI)));
+typedef		 int SItype	__attribute__ ((mode (SI)));
 typedef unsigned int USItype	__attribute__ ((mode (SI)));
 typedef		 int DItype	__attribute__ ((mode (DI)));
 typedef int word_type __attribute__ ((mode (__word__)));
diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c
index 9ea8812fc..be4f27564 100644
--- a/arch/m68k/lib/muldi3.c
+++ b/arch/m68k/lib/muldi3.c
@@ -1,4 +1,4 @@
-/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and 
+/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and
 			   gcc-2.7.2.3/longlong.h which is: */
 /* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 
@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA.  */
     umul_ppmm (__w.s.high, __w.s.low, u, v);				\
     __w.ll; })
 
-typedef 	 int SItype	__attribute__ ((mode (SI)));
+typedef		 int SItype	__attribute__ ((mode (SI)));
 typedef unsigned int USItype	__attribute__ ((mode (SI)));
 typedef		 int DItype	__attribute__ ((mode (DI)));
 typedef int word_type __attribute__ ((mode (__word__)));
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index dd424e495..b19b7dd9b 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -14,9 +14,9 @@
 #include <linux/ide.h>
 
 #include <asm/traps.h>
-#include <asm/bootinfo.h> 
-#include <asm/macintosh.h> 
-#include <asm/macints.h> 
+#include <asm/bootinfo.h>
+#include <asm/macintosh.h>
+#include <asm/macints.h>
 #include <asm/mac_baboon.h>
 
 /* #define DEBUG_BABOON */
diff --git a/arch/m68k/mac/bootparse.c b/arch/m68k/mac/bootparse.c
index f7600999b..36d223609 100644
--- a/arch/m68k/mac/bootparse.c
+++ b/arch/m68k/mac/bootparse.c
@@ -9,114 +9,114 @@
 /*
  *	Booter vars
  */
- 
+
 int boothowto;
 int _boothowto;
- 
+
 /*
  *	Called early to parse the environment (passed to us from the booter)
  *	into a bootinfo struct. Will die as soon as we have our own booter
  */
 
 #define atol(x)	simple_strtoul(x,NULL,0)
- 
+
 void parse_booter(char *env)
 {
- 	char *name;
- 	char *value;
+	char *name;
+	char *value;
 #if 0
- 	while(0 && *env)
+	while(0 && *env)
 #else
- 	while(*env)
+	while(*env)
 #endif
- 	{
- 		name=env;
- 		value=name;
- 		while(*value!='='&&*value)
- 			value++;
- 		if(*value=='=')
- 			*value++=0;
- 		env=value;
- 		while(*env)
- 			env++;
- 		env++;
-#if 0 			
- 		if(strcmp(name,"VIDEO_ADDR")==0)
- 			mac_mch.videoaddr=atol(value);
- 		if(strcmp(name,"ROW_BYTES")==0)
- 			mac_mch.videorow=atol(value); 			
- 		if(strcmp(name,"SCREEN_DEPTH")==0)
- 			mac_mch.videodepth=atol(value);
- 		if(strcmp(name,"DIMENSIONS")==0)
- 			mac_mch.dimensions=atol(value);
-#endif 			
- 		if(strcmp(name,"BOOTTIME")==0)
- 			mac_bi_data.boottime=atol(value);
- 		if(strcmp(name,"GMTBIAS")==0)
- 			mac_bi_data.gmtbias=atol(value);
- 		if(strcmp(name,"BOOTERVER")==0)
- 			mac_bi_data.bootver=atol(value);
- 		if(strcmp(name,"MACOS_VIDEO")==0)
- 			mac_bi_data.videological=atol(value);
- 		if(strcmp(name,"MACOS_SCC")==0)
- 			mac_bi_data.sccbase=atol(value);
- 		if(strcmp(name,"MACHINEID")==0)
- 			mac_bi_data.id=atol(value);
- 		if(strcmp(name,"MEMSIZE")==0)
- 			mac_bi_data.memsize=atol(value);
- 		if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
- 			mac_bi_data.serialmf=atol(value);
- 		if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
- 			mac_bi_data.serialhsk=atol(value);
- 		if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
- 			mac_bi_data.serialgpi=atol(value);
- 		if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
- 			mac_bi_data.printmf=atol(value);
- 		if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
- 			mac_bi_data.printhsk=atol(value);
- 		if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
- 			mac_bi_data.printgpi=atol(value);
- 		if(strcmp(name,"PROCESSOR")==0)
- 			mac_bi_data.cpuid=atol(value);
- 		if(strcmp(name,"ROMBASE")==0)
- 			mac_bi_data.rombase=atol(value);
- 		if(strcmp(name,"TIMEDBRA")==0)
- 			mac_bi_data.timedbra=atol(value);
- 		if(strcmp(name,"ADBDELAY")==0)
- 			mac_bi_data.adbdelay=atol(value);
- 	}
+	{
+		name=env;
+		value=name;
+		while(*value!='='&&*value)
+			value++;
+		if(*value=='=')
+			*value++=0;
+		env=value;
+		while(*env)
+			env++;
+		env++;
+#if 0
+		if(strcmp(name,"VIDEO_ADDR")==0)
+			mac_mch.videoaddr=atol(value);
+		if(strcmp(name,"ROW_BYTES")==0)
+			mac_mch.videorow=atol(value);
+		if(strcmp(name,"SCREEN_DEPTH")==0)
+			mac_mch.videodepth=atol(value);
+		if(strcmp(name,"DIMENSIONS")==0)
+			mac_mch.dimensions=atol(value);
+#endif
+		if(strcmp(name,"BOOTTIME")==0)
+			mac_bi_data.boottime=atol(value);
+		if(strcmp(name,"GMTBIAS")==0)
+			mac_bi_data.gmtbias=atol(value);
+		if(strcmp(name,"BOOTERVER")==0)
+			mac_bi_data.bootver=atol(value);
+		if(strcmp(name,"MACOS_VIDEO")==0)
+			mac_bi_data.videological=atol(value);
+		if(strcmp(name,"MACOS_SCC")==0)
+			mac_bi_data.sccbase=atol(value);
+		if(strcmp(name,"MACHINEID")==0)
+			mac_bi_data.id=atol(value);
+		if(strcmp(name,"MEMSIZE")==0)
+			mac_bi_data.memsize=atol(value);
+		if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
+			mac_bi_data.serialmf=atol(value);
+		if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
+			mac_bi_data.serialhsk=atol(value);
+		if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
+			mac_bi_data.serialgpi=atol(value);
+		if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
+			mac_bi_data.printmf=atol(value);
+		if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
+			mac_bi_data.printhsk=atol(value);
+		if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
+			mac_bi_data.printgpi=atol(value);
+		if(strcmp(name,"PROCESSOR")==0)
+			mac_bi_data.cpuid=atol(value);
+		if(strcmp(name,"ROMBASE")==0)
+			mac_bi_data.rombase=atol(value);
+		if(strcmp(name,"TIMEDBRA")==0)
+			mac_bi_data.timedbra=atol(value);
+		if(strcmp(name,"ADBDELAY")==0)
+			mac_bi_data.adbdelay=atol(value);
+	}
 #if 0	/* XXX: TODO with m68k_mach_* */
- 	/* Fill in the base stuff */
- 	boot_info.machtype=MACH_MAC;
- 	/* Read this from the macinfo we got ! */
+	/* Fill in the base stuff */
+	boot_info.machtype=MACH_MAC;
+	/* Read this from the macinfo we got ! */
 /*	boot_info.cputype=CPU_68020|FPUB_68881;*/
-/* 	boot_info.memory[0].addr=0;*/
-/* 	boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
- 	boot_info.num_memory=1;		/* On a MacII */
- 	boot_info.ramdisk_size=0;	/* For now */
- 	*boot_info.command_line=0;
+/*	boot_info.memory[0].addr=0;*/
+/*	boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
+	boot_info.num_memory=1;		/* On a MacII */
+	boot_info.ramdisk_size=0;	/* For now */
+	*boot_info.command_line=0;
 #endif
  }
- 
+
 
 void print_booter(char *env)
 {
- 	char *name;
- 	char *value;
- 	while(*env)
- 	{
- 		name=env;
- 		value=name;
- 		while(*value!='='&&*value)
- 			value++;
- 		if(*value=='=')
- 			*value++=0;
- 		env=value;
- 		while(*env)
- 			env++;
- 		env++;
- 		printk("%s=%s\n", name,value);
- 	}
+	char *name;
+	char *value;
+	while(*env)
+	{
+		name=env;
+		value=name;
+		while(*value!='='&&*value)
+			value++;
+		if(*value=='=')
+			*value++=0;
+		env=value;
+		while(*env)
+			env++;
+		env++;
+		printk("%s=%s\n", name,value);
+	}
  }
- 
+
 
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index 816caa3ba..cd19cbb21 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -176,7 +176,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
 
 /*
  * Flip into 24bit mode for an instant - flushes the L2 cache card. We
- * have to disable interrupts for this. Our IRQ handlers will crap 
+ * have to disable interrupts for this. Our IRQ handlers will crap
  * themselves if they take an IRQ in 24bit mode!
  */
 
@@ -232,10 +232,10 @@ void __init config_mac(void)
 	/*
 	 * Determine hardware present
 	 */
-     
+
 	mac_identify();
 	mac_report_hardware();
-    
+
 	/* AFAIK only the IIci takes a cache card.  The IIfx has onboard
 	   cache ... someone needs to figure out how to tell if it's on or
 	   not. */
@@ -252,21 +252,21 @@ void __init config_mac(void)
 #ifdef OLD_NUBUS_CODE
 	 nubus_sweep_video();
 #endif
-}	
+}
 
 
 /*
- *	Macintosh Table: hardcoded model configuration data. 
+ *	Macintosh Table: hardcoded model configuration data.
  *
- *	Much of this was defined by Alan, based on who knows what docs. 
- *	I've added a lot more, and some of that was pure guesswork based 
- *	on hardware pages present on the Mac web site. Possibly wildly 
+ *	Much of this was defined by Alan, based on who knows what docs.
+ *	I've added a lot more, and some of that was pure guesswork based
+ *	on hardware pages present on the Mac web site. Possibly wildly
  *	inaccurate, so look here if a new Mac model won't run. Example: if
  *	a Mac crashes immediately after the VIA1 registers have been dumped
- *	to the screen, it probably died attempting to read DirB on a RBV. 
+ *	to the screen, it probably died attempting to read DirB on a RBV.
  *	Meaning it should have MAC_VIA_IIci here :-)
  */
- 
+
 struct mac_model *macintosh_config;
 EXPORT_SYMBOL(macintosh_config);
 
@@ -288,9 +288,9 @@ static struct mac_model mac_data_table[]=
 
 	/*
 	 *	Original MacII hardware
-	 *	
+	 *
 	 */
-	 
+
 	{
 		.ident		= MAC_MODEL_II,
 		.name		= "II",
@@ -324,7 +324,7 @@ static struct mac_model mac_data_table[]=
 		.scc_type	= MAC_SCC_II,
 		.nubus_type	= MAC_NUBUS
 	},
-	
+
 	/*
 	 *	Weirdified MacII hardware - all subtley different. Gee thanks
 	 *	Apple. All these boxes seem to have VIA2 in a different place to
@@ -373,7 +373,7 @@ static struct mac_model mac_data_table[]=
 		.scc_type	= MAC_SCC_II,
 		.nubus_type	= MAC_NUBUS
 	},
-	
+
 	/*
 	 *	Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...)
 	 */
@@ -398,7 +398,7 @@ static struct mac_model mac_data_table[]=
 	/*
 	 *	Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
 	 */
-	
+
 	{
 		.ident		= MAC_MODEL_LC,
 		.name		= "LC",
@@ -426,15 +426,15 @@ static struct mac_model mac_data_table[]=
 	},
 
 	/*
-	 *	Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently 
-	 *	as some of the stuff connected to VIA2 seems different. Better SCSI chip and 
-	 *	onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an 
+	 *	Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently
+	 *	as some of the stuff connected to VIA2 seems different. Better SCSI chip and
+	 *	onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an
 	 *	AMD 79C940 (MACE).
 	 *	The 700, 900 and 950 have some I/O chips in the wrong place to
 	 *	confuse us. The 840AV has a SCSI location of its own (same as
 	 *	the 660AV).
-	 */	 
-	 
+	 */
+
 	{
 		.ident		= MAC_MODEL_Q605,
 		.name		= "Quadra 605",
@@ -528,7 +528,7 @@ static struct mac_model mac_data_table[]=
 		.nubus_type	= MAC_NUBUS
 	},
 
-	/* 
+	/*
 	 *	Performa - more LC type machines
 	 */
 
@@ -816,7 +816,7 @@ void mac_identify(void)
 {
 	struct mac_model *m;
 
-	/* Penguin data useful? */	
+	/* Penguin data useful? */
 	int model = mac_bi_data.id;
 	if (!model) {
 		/* no bootinfo model id -> NetBSD booter was used! */
@@ -825,7 +825,7 @@ void mac_identify(void)
 		printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
 	}
 
-	macintosh_config = mac_data_table; 
+	macintosh_config = mac_data_table;
 	for (m = macintosh_config ; m->ident != -1 ; m++) {
 		if (m->ident == model) {
 			macintosh_config = m;
@@ -846,19 +846,19 @@ void mac_identify(void)
 	 * Report booter data:
 	 */
 	printk (KERN_DEBUG " Penguin bootinfo data:\n");
-	printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", 
-		mac_bi_data.videoaddr, mac_bi_data.videorow, 
-		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, 
-		mac_bi_data.dimensions >> 16); 
+	printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
+		mac_bi_data.videoaddr, mac_bi_data.videorow,
+		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
+		mac_bi_data.dimensions >> 16);
 	printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
-		mac_bi_data.videological, mac_orig_videoaddr, 
-		mac_bi_data.sccbase); 
+		mac_bi_data.videological, mac_orig_videoaddr,
+		mac_bi_data.sccbase);
 	printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
-		mac_bi_data.boottime, mac_bi_data.gmtbias); 
+		mac_bi_data.boottime, mac_bi_data.gmtbias);
 	printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
-		mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); 
+		mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
 #if 0
-	printk ("Ramdisk: addr 0x%lx size 0x%lx\n", 
+	printk ("Ramdisk: addr 0x%lx size 0x%lx\n",
 		m68k_ramdisk.addr, m68k_ramdisk.size);
 #endif
 
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
index 219196f79..cc62ed61c 100644
--- a/arch/m68k/mac/debug.c
+++ b/arch/m68k/mac/debug.c
@@ -8,7 +8,7 @@
  * Atari debugging and serial console stuff
  *
  * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek
- *  
+ *
  * 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.
@@ -43,7 +43,7 @@ extern void mac_serial_print(const char *);
 #define DEBUG_SERIAL
 
 /*
- * These two auxiliary debug functions should go away ASAP. Only usage: 
+ * These two auxiliary debug functions should go away ASAP. Only usage:
  * before the console output is up (after head.S come some other crucial
  * setup routines :-) it permits writing 'data' to the screen as bit patterns
  * (good luck reading those). Helped to figure that the bootinfo contained
@@ -77,9 +77,9 @@ void mac_debugging_short(int pos, short num)
 	/* calculate current offset */
 	pengoffset=(unsigned char *)(mac_videobase+(150+line*2)*mac_rowbytes)
 		    +80*peng;
-	
+
 	pptr=pengoffset;
-	
+
 	for(i=0;i<8*sizeof(short);i++) /* # of bits */
 	{
 		/*        value        mask for bit i, reverse order */
@@ -112,12 +112,12 @@ void mac_debugging_long(int pos, long addr)
 		/* printk("debug: #%ld !\n", addr); */
 		return;
 	}
-	
+
 	pengoffset=(unsigned char *)(mac_videobase+(150+line*2)*mac_rowbytes)
 		    +80*peng;
-	
+
 	pptr=pengoffset;
-	
+
 	for(i=0;i<8*sizeof(long);i++) /* # of bits */
 	{
 		*pptr++ = (addr & ( 1 << (8*sizeof(long)-i-1) ) ? 0xFF : 0x00);
@@ -270,7 +270,7 @@ void mac_scca_console_write (struct console *co, const char *str,
 	for( i = 60*uSEC; i > 0; --i )		\
 	    barrier();				\
     } while(0)
-    
+
 #ifndef CONFIG_SERIAL_CONSOLE
 static void __init mac_init_scc_port( int cflag, int port )
 #else
@@ -285,17 +285,17 @@ void mac_init_scc_port( int cflag, int port )
 
 	static int clksrc_table[9] =
 		/* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
-    		{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
+		{ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
 	static int clkmode_table[9] =
 		/* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */
-    		{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
+		{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
 	static int div_table[9] =
 		/* reg12 (BRG low) */
-    		{ 94, 62, 46, 22, 10, 4, 1, 0, 0 };
+		{ 94, 62, 46, 22, 10, 4, 1, 0, 0 };
 
     int baud = cflag & CBAUD;
     int clksrc, clkmode, div, reg3, reg5;
-    
+
     if (cflag & CBAUDEX)
 	baud += B38400;
     if (baud < B1200 || baud > B38400+2)
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c
index cf55640d4..59442d091 100644
--- a/arch/m68k/mac/iop.c
+++ b/arch/m68k/mac/iop.c
@@ -113,9 +113,9 @@
 #include <linux/proc_fs.h>
 #include <linux/interrupt.h>
 
-#include <asm/bootinfo.h> 
-#include <asm/macintosh.h> 
-#include <asm/macints.h> 
+#include <asm/bootinfo.h>
+#include <asm/macintosh.h>
+#include <asm/macints.h>
 #include <asm/mac_iop.h>
 #include <asm/mac_oss.h>
 
@@ -485,7 +485,7 @@ static void iop_handle_recv(uint iop_num, uint chan, struct pt_regs *regs)
 
 /*
  * Send a message
- * 
+ *
  * The message is placed at the end of the send queue. Afterwards if the
  * channel is idle we force an immediate send of the next message in the
  * queue.
@@ -537,7 +537,7 @@ void iop_upload_code(uint iop_num, __u8 *code_start,
 	if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return;
 
 	iop_loadaddr(iop_base[iop_num], shared_ram_start);
-	
+
 	while (code_len--) {
 		iop_base[iop_num]->ram_data = *code_start++;
 	}
@@ -553,7 +553,7 @@ void iop_download_code(uint iop_num, __u8 *code_start,
 	if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return;
 
 	iop_loadaddr(iop_base[iop_num], shared_ram_start);
-	
+
 	while (code_len--) {
 		*code_start++ = iop_base[iop_num]->ram_data;
 	}
@@ -571,7 +571,7 @@ __u8 *iop_compare_code(uint iop_num, __u8 *code_start,
 	if ((iop_num >= NUM_IOPS) || !iop_base[iop_num]) return code_start;
 
 	iop_loadaddr(iop_base[iop_num], shared_ram_start);
-	
+
 	while (code_len--) {
 		if (*code_start != iop_base[iop_num]->ram_data) {
 			return code_start;
@@ -666,12 +666,12 @@ int iop_dump_one_iop(char *buf, int iop_num, char *iop_name)
 			iop_chan_state(iop_readb(iop, IOP_ADDR_RECV_STATE+i)),
 			iop_listeners[iop_num][i].handler?
 				      iop_listeners[iop_num][i].devname : "");
-			
+
 	}
 	len += sprintf(buf+len, "\n");
 	return len;
 }
- 
+
 static int iop_get_proc_info(char *buf, char **start, off_t pos, int count)
 {
 	int len, cnt;
diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
index 5036b2883..44c5cd2ad 100644
--- a/arch/m68k/mac/macboing.c
+++ b/arch/m68k/mac/macboing.c
@@ -1,7 +1,7 @@
 /*
  *	Mac bong noise generator. Note - we ought to put a boingy noise
  *	here 8)
- *	 
+ *
  *	----------------------------------------------------------------------
  *	16.11.98:
  *	rewrote some functions, added support for Enhanced ASC (Quadras)
@@ -22,8 +22,8 @@ static int mac_asc_inited;
 static __u8 mac_asc_wave_tab[ 0x800 ];
 
 /*
- * Alan's original sine table; needs interpolating to 0x800 
- * (hint: interpolate or hardwire [0 -> Pi/2[, it's symmetric) 
+ * Alan's original sine table; needs interpolating to 0x800
+ * (hint: interpolate or hardwire [0 -> Pi/2[, it's symmetric)
  */
 static const signed char sine_data[] = {
 	0,  39,  75,  103,  121,  127,  121,  103,  75,  39,
@@ -35,16 +35,16 @@ static const signed char sine_data[] = {
  */
 static volatile __u8* mac_asc_regs = ( void* )0x50F14000;
 
-/* 
- * sample rate; is this a good default value? 
+/*
+ * sample rate; is this a good default value?
  */
-static unsigned long mac_asc_samplespersec = 11050;  
+static unsigned long mac_asc_samplespersec = 11050;
 static int mac_bell_duration;
 static unsigned long mac_bell_phase; /* 0..2*Pi -> 0..0x800 (wavetable size) */
 static unsigned long mac_bell_phasepersample;
 
 /*
- * some function protos 
+ * some function protos
  */
 static void mac_init_asc( void );
 static void mac_nosound( unsigned long );
@@ -67,11 +67,11 @@ static void mac_init_asc( void )
 {
 	int i;
 
-	/* 
-	 * do some machine specific initialization 
+	/*
+	 * do some machine specific initialization
 	 * BTW:
 	 * the NetBSD Quadra patch identifies the Enhanced Apple Sound Chip via
-	 * 	mac_asc_regs[ 0x800 ] & 0xF0 != 0
+	 *	mac_asc_regs[ 0x800 ] & 0xF0 != 0
 	 * this makes no sense here, because we have to set the default sample
 	 * rate anyway if we want correct frequencies
 	 */
@@ -83,27 +83,27 @@ static void mac_init_asc( void )
 			 */
 			mac_asc_regs = ( void* )0x50010000;
 			break;
-			/* 
-			 * not sure about how correct this list is 
-			 * machines with the EASC enhanced apple sound chip 
+			/*
+			 * not sure about how correct this list is
+			 * machines with the EASC enhanced apple sound chip
 			 */
 		case MAC_MODEL_Q630:
 		case MAC_MODEL_P475:
 			mac_special_bell = mac_quadra_start_bell;
 			mac_asc_samplespersec = 22150;
-			break;	
+			break;
 		case MAC_MODEL_C660:
 		case MAC_MODEL_Q840:
 			/*
 			 * The Quadra 660AV and 840AV use the "Singer" custom ASIC for sound I/O.
-			 * It appears to be similar to the "AWACS" custom ASIC in the Power Mac 
-			 * [678]100.  Because Singer and AWACS may have a similar hardware 
-			 * interface, this would imply that the code in drivers/sound/dmasound.c 
+			 * It appears to be similar to the "AWACS" custom ASIC in the Power Mac
+			 * [678]100.  Because Singer and AWACS may have a similar hardware
+			 * interface, this would imply that the code in drivers/sound/dmasound.c
 			 * for AWACS could be used as a basis for Singer support.  All we have to
-			 * do is figure out how to do DMA on the 660AV/840AV through the PSC and 
+			 * do is figure out how to do DMA on the 660AV/840AV through the PSC and
 			 * figure out where the Singer hardware sits in memory. (I'd look in the
-			 * vicinity of the AWACS location in a Power Mac [678]100 first, or the 
-			 * current location of the Apple Sound Chip--ASC--in other Macs.)  The 
+			 * vicinity of the AWACS location in a Power Mac [678]100 first, or the
+			 * current location of the Apple Sound Chip--ASC--in other Macs.)  The
 			 * Power Mac [678]100 info can be found in MkLinux Mach kernel sources.
 			 *
 			 * Quoted from Apple's Tech Info Library, article number 16405:
@@ -111,7 +111,7 @@ static void mac_init_asc( void )
 			 *   Macintosh models have 16-bit audio input and output capability
 			 *   because of the AT&T DSP3210 hardware circuitry and the 16-bit Singer
 			 *   codec circuitry in the AVs.  The Audio Waveform Amplifier and
-			 *   Converter (AWAC) chip in the Power Macintosh performs the same 
+			 *   Converter (AWAC) chip in the Power Macintosh performs the same
 			 *   16-bit I/O functionality.  The PowerBook 500 series computers
 			 *   support 16-bit stereo output, but only mono input."
 			 *
@@ -139,8 +139,8 @@ static void mac_init_asc( void )
 			break;
 	}
 
-	/* 
-	 * init the wave table with a simple triangular wave 
+	/*
+	 * init the wave table with a simple triangular wave
 	 * A sine wave would sure be nicer here ...
 	 */
 	for ( i = 0; i < 0x400; i++ )
@@ -149,15 +149,15 @@ static void mac_init_asc( void )
 		mac_asc_wave_tab[ i + 0x400 ] = 0xFF - i / 4;
 	}
 	mac_asc_inited = 1;
-}	
+}
 
 /*
- * Called to make noise; current single entry to the boing driver. 
+ * Called to make noise; current single entry to the boing driver.
  * Does the job for simple ASC, calls other routines else.
  * XXX Fixme:
- * Should be split into asc_mksound, easc_mksound, av_mksound and 
- * function pointer set in mac_init_asc which would be called at 
- * init time. 
+ * Should be split into asc_mksound, easc_mksound, av_mksound and
+ * function pointer set in mac_init_asc which would be called at
+ * init time.
  * _This_ is rather ugly ...
  */
 void mac_mksound( unsigned int freq, unsigned int length )
@@ -192,7 +192,7 @@ void mac_mksound( unsigned int freq, unsigned int length )
 	del_timer( &mac_sound_timer );
 
 	for ( i = 0; i < 0x800; i++ )
-		mac_asc_regs[ i ] = 0;	
+		mac_asc_regs[ i ] = 0;
 	for ( i = 0; i < 0x800; i++ )
 		mac_asc_regs[ i ] = mac_asc_wave_tab[ i ];
 
@@ -218,7 +218,7 @@ void mac_mksound( unsigned int freq, unsigned int length )
 static void mac_nosound( unsigned long ignored )
 {
 	mac_asc_regs[ ASC_ENABLE ] = 0;
-}	
+}
 
 /*
  * EASC entry; init EASC, don't load wavetable, schedule 'start whining'.
@@ -237,7 +237,7 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig
 	mac_bell_duration = length;
 	mac_bell_phase = 0;
 	mac_bell_phasepersample = ( freq * sizeof( mac_asc_wave_tab ) ) / mac_asc_samplespersec;
-	/* this is reasonably big for small frequencies */ 
+	/* this is reasonably big for small frequencies */
 
 	local_irq_save(flags);
 
@@ -247,11 +247,11 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig
 	/* set up the ASC registers */
 	if ( mac_asc_regs[ 0x801 ] != 1 )
 	{
-		/* select mono mode */	
+		/* select mono mode */
 		mac_asc_regs[ 0x807 ] = 0;
 		/* select sampled sound mode */
 		mac_asc_regs[ 0x802 ] = 0;
-	 	/* ??? */	
+		/* ??? */
 		mac_asc_regs[ 0x801 ] = 1;
 		mac_asc_regs[ 0x803 ] |= 0x80;
 		mac_asc_regs[ 0x803 ] &= 0x7F;
@@ -266,12 +266,12 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig
 
 /*
  * EASC 'start/continue whining'; I'm not sure why the above function didn't
- * already load the wave table, or at least call this one... 
+ * already load the wave table, or at least call this one...
  * This piece keeps reloading the wave table until done.
  */
 static void mac_quadra_ring_bell( unsigned long ignored )
 {
-	int 	i, count = mac_asc_samplespersec / HZ;
+	int	i, count = mac_asc_samplespersec / HZ;
 	__u32 flags;
 
 	/*
@@ -282,7 +282,7 @@ static void mac_quadra_ring_bell( unsigned long ignored )
 	 */
 
 	local_irq_save(flags);
-	
+
 	del_timer( &mac_sound_timer );
 
 	if ( mac_bell_duration-- > 0 )
@@ -297,7 +297,7 @@ static void mac_quadra_ring_bell( unsigned long ignored )
 	}
 	else
 		mac_asc_regs[ 0x801 ] = 0;
-	
+
 	local_irq_restore(flags);
 }
 
@@ -306,4 +306,4 @@ static void mac_quadra_ring_bell( unsigned long ignored )
  */
 static void mac_av_start_bell( unsigned int freq, unsigned int length, unsigned int volume )
 {
-} 
+}
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index fc4f420b2..c50cdb6f6 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -2,8 +2,8 @@
  *	Macintosh interrupts
  *
  * General design:
- * In contrary to the Amiga and Atari platforms, the Mac hardware seems to 
- * exclusively use the autovector interrupts (the 'generic level0-level7' 
+ * In contrary to the Amiga and Atari platforms, the Mac hardware seems to
+ * exclusively use the autovector interrupts (the 'generic level0-level7'
  * interrupts with exception vectors 0x19-0x1f). The following interrupt levels
  * are used:
  *	1	- VIA1
@@ -248,7 +248,7 @@ void mac_init_IRQ(void)
 	printk("Done.\n");
 #endif /* SHUTUP_SONIC */
 
-	/* 
+	/*
 	 * Now register the handlers for the master IRQ handlers
 	 * at levels 1-7. Most of the work is done elsewhere.
 	 */
@@ -496,7 +496,7 @@ int mac_irq_pending( unsigned int irq )
  * FIXME: You can register interrupts on nonexistent source (ie PSC4 on a
  *        non-PSC machine). We should return -EINVAL in those cases.
  */
- 
+
 int mac_request_irq(unsigned int irq,
 		    irqreturn_t (*handler)(int, void *, struct pt_regs *),
 		    unsigned long flags, const char *devname, void *dev_id)
@@ -533,7 +533,7 @@ int mac_request_irq(unsigned int irq,
 
 	return 0;
 }
-                            
+
 /*
  * Removes an interrupt service routine from an interrupt source.
  */
@@ -661,7 +661,7 @@ static volatile int nmi_hold;
 irqreturn_t mac_nmi_handler(int irq, void *dev_id, struct pt_regs *fp)
 {
 	int i;
-	/* 
+	/*
 	 * generate debug output on NMI switch if 'debug' kernel option given
 	 * (only works with Penguin!)
 	 */
@@ -691,7 +691,7 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id, struct pt_regs *fp)
 		       fp->d0, fp->d1, fp->d2, fp->d3);
 		printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
 		       fp->d4, fp->d5, fp->a0, fp->a1);
-	
+
 		if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
 			printk("Corrupted stack page\n");
 		printk("Process %s (pid: %d, stackpage=%08lx)\n",
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index 789a82e74..5b80d7cd9 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -1,5 +1,5 @@
 /*
- * Miscellaneous Mac68K-specific stuff 
+ * Miscellaneous Mac68K-specific stuff
  */
 
 #include <linux/config.h>
@@ -67,7 +67,7 @@ static void adb_write_time(long data)
 	volatile struct adb_request req;
 
 	data += RTC_OFFSET;
-	
+
 	adb_request((struct adb_request *) &req, NULL,
 			ADBREQ_RAW|ADBREQ_SYNC,
 			6, CUDA_PACKET, CUDA_SET_TIME,
@@ -324,7 +324,7 @@ void pmu_restart(void)
 	adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC,
 			3, PMU_PACKET, PMU_SET_INTR_MASK,
 			PMU_INT_ADB|PMU_INT_TICK);
-	
+
 	adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC,
 			2, PMU_PACKET, PMU_RESET);
 }
@@ -477,7 +477,7 @@ void mac_reset(void)
                     ".chip 68030\n\t"
 		    "lea %/pc@(1f),%/a0\n\t"
 		    "addl %0,%/a0\n\t"/* fixup target address and stack ptr */
-		    "addl %0,%/sp\n\t" 
+		    "addl %0,%/sp\n\t"
 		    "pflusha\n\t"
 		    "jmp %/a0@\n\t" /* jump into physical memory */
 		    "0:.long 0\n\t" /* a constant zero. */
@@ -494,7 +494,7 @@ void mac_reset(void)
 		    "movec %/a0, %/cacr\n\t" /* flush i&d caches */
 		    "movew #0x2700,%/sr\n\t" /* set up status register */
 		    "movel %1@(0x0),%/a0\n\t"/* load interrupt stack pointer */
-		    "movec %/a0, %/isp\n\t" 
+		    "movec %/a0, %/isp\n\t"
 		    "movel %1@(0x4),%/a0\n\t" /* load reset vector */
 		    "reset\n\t" /* reset external devices */
 		    "jmp %/a0@\n\t" /* jump to the reset vector */
@@ -579,7 +579,7 @@ static void unmktime(unsigned long time, long offset,
 	return;
 }
 
-/* 
+/*
  * Read/write the hardware clock.
  */
 
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 2c0af34f3..333547692 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -20,9 +20,9 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 
-#include <asm/bootinfo.h> 
-#include <asm/machw.h> 
-#include <asm/macintosh.h> 
+#include <asm/bootinfo.h>
+#include <asm/machw.h>
+#include <asm/macintosh.h>
 #include <asm/macints.h>
 #include <asm/mac_via.h>
 #include <asm/mac_oss.h>
@@ -91,7 +91,7 @@ void __init oss_nubus_init(void)
  * Handle miscellaneous OSS interrupts. Right now that's just sound
  * and SCSI; everything else is routed to its own autovector IRQ.
  */
- 
+
 irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int events;
@@ -100,7 +100,7 @@ irqreturn_t oss_irq(int irq, void *dev_id, struct pt_regs *regs)
 	if (!events)
 		return IRQ_NONE;
 
-#ifdef DEBUG_IRQS	
+#ifdef DEBUG_IRQS
 	if ((console_loglevel == 10) && !(events & OSS_IP_SCSI)) {
 		printk("oss_irq: irq %d events = 0x%04X\n", irq,
 			(int) oss->irq_pending);
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c
index 5ec8ace8b..e72384e43 100644
--- a/arch/m68k/mac/psc.c
+++ b/arch/m68k/mac/psc.c
@@ -20,9 +20,9 @@
 #include <linux/init.h>
 
 #include <asm/traps.h>
-#include <asm/bootinfo.h> 
-#include <asm/macintosh.h> 
-#include <asm/macints.h> 
+#include <asm/bootinfo.h>
+#include <asm/macintosh.h>
+#include <asm/macints.h>
 #include <asm/mac_psc.h>
 
 #define DEBUG_PSC
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 4954e343c..cd528bf7b 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -26,10 +26,10 @@
 #include <linux/ide.h>
 
 #include <asm/traps.h>
-#include <asm/bootinfo.h> 
-#include <asm/macintosh.h> 
+#include <asm/bootinfo.h>
+#include <asm/macintosh.h>
 #include <asm/macints.h>
-#include <asm/machw.h> 
+#include <asm/machw.h>
 #include <asm/mac_via.h>
 #include <asm/mac_psc.h>
 
@@ -93,7 +93,7 @@ void __init via_init(void)
 
 		/* IIci, IIsi, IIvx, IIvi (P6xx), LC series */
 
-		case MAC_VIA_IIci:	
+		case MAC_VIA_IIci:
 			via1 = (void *) VIA1_BASE;
 			if (macintosh_config->ident == MAC_MODEL_IIFX) {
 				via2 = NULL;
@@ -166,7 +166,7 @@ void __init via_init(void)
 	via1[vT2CH] = 0;
 	via1[vACR] &= 0x3F;
 
-	/* 
+	/*
 	 * SE/30: disable video IRQ
 	 * XXX: testing for SE/30 VBL
 	 */
@@ -174,8 +174,8 @@ void __init via_init(void)
 	if (macintosh_config->ident == MAC_MODEL_SE30) {
 		via1[vDirB] |= 0x40;
 		via1[vBufB] |= 0x40;
-	} 
-	
+	}
+
 	/*
 	 * Set the RTC bits to a known state: all lines to outputs and
 	 * RTC disabled (yes that's 0 to enable and 1 to disable).
@@ -243,7 +243,7 @@ void __init via_init(void)
  */
 
 void __init via_init_clock(irqreturn_t (*func)(int, void *, struct pt_regs *))
-{	
+{
 	via1[vACR] |= 0x40;
 	via1[vT1LL] = MAC_CLOCK_LOW;
 	via1[vT1LH] = MAC_CLOCK_HIGH;
@@ -537,7 +537,7 @@ void via_irq_enable(int irq) {
 			/* But not on PowerBooks, that's ADB... */
 			if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
 			   (macintosh_config->adb_type != MAC_ADB_PB2)) {
-			   	switch(macintosh_config->ident)
+				switch(macintosh_config->ident)
 				{
 					case MAC_MODEL_II:
 					case MAC_MODEL_IIX:
diff --git a/arch/m68k/math-emu/fp_arith.c b/arch/m68k/math-emu/fp_arith.c
index 50f516dbb..08f286db3 100644
--- a/arch/m68k/math-emu/fp_arith.c
+++ b/arch/m68k/math-emu/fp_arith.c
@@ -458,7 +458,7 @@ static void fp_roundint(struct fp_ext *dest, int mode)
 		return;
 
 	/* infinities and zeroes */
-	if (IS_INF(dest) || IS_ZERO(dest)) 
+	if (IS_INF(dest) || IS_ZERO(dest))
 		return;
 
 	/* first truncate the lower bits */
diff --git a/arch/m68k/math-emu/fp_cond.S b/arch/m68k/math-emu/fp_cond.S
index db53cbe54..ddae8b1b8 100644
--- a/arch/m68k/math-emu/fp_cond.S
+++ b/arch/m68k/math-emu/fp_cond.S
@@ -105,10 +105,10 @@ fp_fscc:
 	| decode addressing mode
 	fp_decode_addr_mode
 
-	.long 	fp_data, fp_fdbcc
-	.long 	fp_indirect, fp_postinc
-	.long 	fp_predecr, fp_disp16
-	.long 	fp_extmode0, fp_extmode1
+	.long	fp_data, fp_fdbcc
+	.long	fp_indirect, fp_postinc
+	.long	fp_predecr, fp_disp16
+	.long	fp_extmode0, fp_extmode1
 
 	| addressing mode: data register direct
 fp_data:
diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c
index 8cda5be89..87b4f0158 100644
--- a/arch/m68k/math-emu/fp_log.c
+++ b/arch/m68k/math-emu/fp_log.c
@@ -48,7 +48,7 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src)
 
 	/*
 	 *		 sqrt(m) * 2^(p)	, if e = 2*p
-	 * sqrt(m*2^e) = 
+	 * sqrt(m*2^e) =
 	 *		 sqrt(2*m) * 2^(p)	, if e = 2*p + 1
 	 *
 	 * So we use the last bit of the exponent to decide wether to
@@ -80,7 +80,7 @@ fp_fsqrt(struct fp_ext *dest, struct fp_ext *src)
 	 * which has a null point on x = sqrt(r).
 	 *
 	 * It gives:
-	 * 	x' := x - f(x)/f'(x)
+	 *	x' := x - f(x)/f'(x)
 	 *	    = x - (x^2 -r)/(2*x)
 	 *	    = x - (x - r/x)/2
 	 *          = (2*x - x + r/x)/2
diff --git a/arch/m68k/math-emu/fp_scan.S b/arch/m68k/math-emu/fp_scan.S
index 1177ebad3..e4146ed57 100644
--- a/arch/m68k/math-emu/fp_scan.S
+++ b/arch/m68k/math-emu/fp_scan.S
@@ -133,10 +133,10 @@ fp_getsource:
 	| decode addressing mode for source
 	fp_decode_addr_mode
 
-	.long 	fp_data, fp_ill
-	.long 	fp_indirect, fp_postinc
-	.long 	fp_predecr, fp_disp16
-	.long 	fp_extmode0, fp_extmode1
+	.long	fp_data, fp_ill
+	.long	fp_indirect, fp_postinc
+	.long	fp_predecr, fp_disp16
+	.long	fp_extmode0, fp_extmode1
 
 	| addressing mode: data register direct
 fp_data:
diff --git a/arch/m68k/math-emu/fp_util.S b/arch/m68k/math-emu/fp_util.S
index efe798193..a9f7f0129 100644
--- a/arch/m68k/math-emu/fp_util.S
+++ b/arch/m68k/math-emu/fp_util.S
@@ -1337,7 +1337,7 @@ fp_finalrounding_single:
 	jra	fp_finaltest
 
 fp_finalrounding_single_fast:
-	addq.l	#8,%sp 
+	addq.l	#8,%sp
 	jsr	fp_normalize_ext
 	jsr	fp_normalize_single_fast
 	jra	fp_finaltest
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index 805284ae6..ac48b6d2a 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -157,7 +157,7 @@ good_area:
  survive:
 	fault = handle_mm_fault(mm, vma, address, write);
 #ifdef DEBUG
- 	printk("handle_mm_fault returns %d\n",fault);
+	printk("handle_mm_fault returns %d\n",fault);
 #endif
 	switch (fault) {
 	case 1:
@@ -186,7 +186,7 @@ out_of_memory:
 		down_read(&mm->mmap_sem);
 		goto survive;
 	}
-	
+
 	printk("VM: killing process %s\n", current->comm);
 	if (user_mode(regs))
 		do_exit(SIGKILL);
diff --git a/arch/m68k/mm/hwtest.c b/arch/m68k/mm/hwtest.c
index 196e68b7f..2c7dde3c6 100644
--- a/arch/m68k/mm/hwtest.c
+++ b/arch/m68k/mm/hwtest.c
@@ -3,9 +3,9 @@
  * that it was also in drivers/nubus/nubus.c and I wanted to
  * use it in hp300/config.c, so it seemed sensible to pull it
  * out into its own file.
- * 
+ *
  * The test is for use when trying to read a hardware register
- * that isn't present would cause a bus error. We set up a 
+ * that isn't present would cause a bus error. We set up a
  * temporary handler so that this doesn't kill the kernel.
  *
  * There is a test-by-reading and a test-by-writing; I present
@@ -37,7 +37,7 @@ int hwreg_present( volatile void *regp )
                 "movec	%4,%/vbr\n\t"
 		"movel	%/sp,%1\n\t"
 		"moveq	#0,%0\n\t"
-		"tstb	%3@\n\t"  
+		"tstb	%3@\n\t"
 		"nop\n\t"
 		"moveq	#1,%0\n"
                 "Lberr1:\n\t"
@@ -50,7 +50,7 @@ int hwreg_present( volatile void *regp )
     return( ret );
 }
 EXPORT_SYMBOL(hwreg_present);
-  
+
 /* Basically the same, but writes a value into a word register, protected
  * by a bus error handler. Returns 1 if successful, 0 otherwise.
  */
@@ -67,7 +67,7 @@ int hwreg_write( volatile void *regp, unsigned short val )
 		"movec	%4,%/vbr\n\t"
 		"movel	%/sp,%1\n\t"
 		"moveq	#0,%0\n\t"
-		"movew	%5,%3@\n\t"  
+		"movew	%5,%3@\n\t"
 		"nop	\n\t"	/* If this nop isn't present, 'ret' may already be
 				 * loaded with 1 at the time the bus error
 				 * happens! */
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index b21a28883..d79dbfae6 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -109,7 +109,7 @@ void __init mem_init(void)
 			continue;
 		}
 	}
-	
+
 #ifndef CONFIG_SUN3
 	/* insert pointer tables allocated so far into the tablelist */
 	init_pointer_table((unsigned long)kernel_pg_dir);
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 4af152355..d9616bebb 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -298,7 +298,7 @@ void cache_clear (unsigned long paddr, int len)
 		      : "d0");
 #ifdef CONFIG_M68K_L2_CACHE
     if(mach_l2_flush)
-    	mach_l2_flush(0);
+	mach_l2_flush(0);
 #endif
 }
 
@@ -350,7 +350,7 @@ void cache_push (unsigned long paddr, int len)
 		      : "d0");
 #ifdef CONFIG_M68K_L2_CACHE
     if(mach_l2_flush)
-    	mach_l2_flush(1);
+	mach_l2_flush(1);
 #endif
 }
 
@@ -387,7 +387,7 @@ static unsigned long virt_to_phys_slow(unsigned long vaddr)
 		unsigned long mmusr;
 
 		set_fs(get_ds());
-		
+
 		asm volatile (".chip 68040\n\t"
 			      "ptestr (%1)\n\t"
 			      "movec %%mmusr, %0\n\t"
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index dee769349..e58d9e362 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -2,9 +2,9 @@
  * linux/arch/m68k/motorola.c
  *
  * Routines specific to the Motorola MMU, originally from:
- * linux/arch/m68k/init.c 
+ * linux/arch/m68k/init.c
  * which are Copyright (C) 1995 Hamish Macdonald
- * 
+ *
  * Moved 8/20/1999 Sam Creasey
  */
 
@@ -99,7 +99,7 @@ static pmd_t * __init kernel_ptr_table(void)
 	return last_pgtable;
 }
 
-static unsigned long __init 
+static unsigned long __init
 map_chunk (unsigned long addr, long size)
 {
 #define PTRTREESIZE (256*1024)
diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c
index e8498b209..7f0d86f3f 100644
--- a/arch/m68k/mm/sun3kmap.c
+++ b/arch/m68k/mm/sun3kmap.c
@@ -26,7 +26,7 @@ extern void print_pte_vaddr(unsigned long vaddr);
 
 extern void mmu_emu_map_pmeg (int context, int vaddr);
 
-static inline void do_page_mapin(unsigned long phys, unsigned long virt, 
+static inline void do_page_mapin(unsigned long phys, unsigned long virt,
 				 unsigned long type)
 {
 	unsigned long pte;
@@ -44,11 +44,11 @@ static inline void do_page_mapin(unsigned long phys, unsigned long virt,
 
 }
 
-static inline void do_pmeg_mapin(unsigned long phys, unsigned long virt, 
+static inline void do_pmeg_mapin(unsigned long phys, unsigned long virt,
 				 unsigned long type, int pages)
 {
 
-	if(sun3_get_segmap(virt & ~SUN3_PMEG_MASK) == SUN3_INVALID_PMEG) 
+	if(sun3_get_segmap(virt & ~SUN3_PMEG_MASK) == SUN3_INVALID_PMEG)
 		mmu_emu_map_pmeg(sun3_get_context(), virt);
 
 	while(pages) {
@@ -59,7 +59,7 @@ static inline void do_pmeg_mapin(unsigned long phys, unsigned long virt,
 	}
 }
 
-void *sun3_ioremap(unsigned long phys, unsigned long size, 
+void *sun3_ioremap(unsigned long phys, unsigned long size,
 		   unsigned long type)
 {
 	struct vm_struct *area;
@@ -79,7 +79,7 @@ void *sun3_ioremap(unsigned long phys, unsigned long size,
 		return NULL;
 
 #ifdef SUN3_KMAP_DEBUG
-	printk("ioremap: got virt %p size %lx(%lx)\n", 
+	printk("ioremap: got virt %p size %lx(%lx)\n",
 	       area->addr, size, area->size);
 #endif
 
@@ -93,39 +93,39 @@ void *sun3_ioremap(unsigned long phys, unsigned long size,
 		seg_pages = (SUN3_PMEG_SIZE - (virt & SUN3_PMEG_MASK)) / PAGE_SIZE;
 		if(seg_pages > pages)
 			seg_pages = pages;
-		
+
 		do_pmeg_mapin(phys, virt, type, seg_pages);
 
 		pages -= seg_pages;
 		phys += seg_pages * PAGE_SIZE;
 		virt += seg_pages * PAGE_SIZE;
 	}
-		
+
 	return (void *)ret;
 
 }
- 
- 
+
+
 void *__ioremap(unsigned long phys, unsigned long size, int cache)
 {
-	
+
 	return sun3_ioremap(phys, size, SUN3_PAGE_TYPE_IO);
-	
+
 }
 
 void iounmap(void *addr)
 {
-	vfree((void *)(PAGE_MASK & (unsigned long)addr));	
+	vfree((void *)(PAGE_MASK & (unsigned long)addr));
 }
 
 /* sun3_map_test(addr, val) -- Reads a byte from addr, storing to val,
  * trapping the potential read fault.  Returns 0 if the access faulted,
  * 1 on success.
- *  
+ *
  * This function is primarily used to check addresses on the VME bus.
  *
  * Mucking with the page fault handler seems a little hackish to me, but
- * SunOS, NetBSD, and Mach all implemented this check in such a manner, 
+ * SunOS, NetBSD, and Mach all implemented this check in such a manner,
  * so I figure we're allowed.
  */
 int sun3_map_test(unsigned long addr, char *val)
@@ -151,6 +151,6 @@ int sun3_map_test(unsigned long addr, char *val)
 		 "_sun3_map_test_end:\n"
 		 : "=a"(val), "=r"(ret)
 		 : "a"(addr));
-	
+
 	return ret;
 }
diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c
index 084fbfbb6..256c5eeb5 100644
--- a/arch/m68k/mm/sun3mmu.c
+++ b/arch/m68k/mm/sun3mmu.c
@@ -1,4 +1,4 @@
-/* 
+/*
  * linux/arch/m68k/mm/sun3mmu.c
  *
  * Implementations of mm routines specific to the sun3 MMU.
@@ -64,12 +64,12 @@ void __init paging_init(void)
 
 	size = num_pages * sizeof(pte_t);
 	size = (size + PAGE_SIZE) & ~(PAGE_SIZE-1);
-	
+
 	next_pgtable = (unsigned long)alloc_bootmem_pages(size);
 	bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
 
 	/* Map whole memory from PAGE_OFFSET (0x0E000000) */
-	pg_dir += PAGE_OFFSET >> PGDIR_SHIFT; 
+	pg_dir += PAGE_OFFSET >> PGDIR_SHIFT;
 
 	while (address < (unsigned long)high_memory) {
 		pg_table = (pte_t *) __pa (next_pgtable);
@@ -95,7 +95,7 @@ void __init paging_init(void)
 	/* memory sizing is a hack stolen from motorola.c..  hope it works for us */
 	zones_size[0] = ((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
 	zones_size[1] = 0;
-	
+
 	free_area_init(zones_size);
 
 }
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index a84400e94..58c3b9db9 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -120,8 +120,8 @@ void __init config_mvme147(void)
 
 static irqreturn_t mvme147_timer_int (int irq, void *dev_id, struct pt_regs *fp)
 {
-	m147_pcc->t1_int_cntrl = PCC_TIMER_INT_CLR;  
-	m147_pcc->t1_int_cntrl = PCC_INT_ENAB|PCC_LEVEL_TIMER1;   
+	m147_pcc->t1_int_cntrl = PCC_TIMER_INT_CLR;
+	m147_pcc->t1_int_cntrl = PCC_INT_ENAB|PCC_LEVEL_TIMER1;
 	return tick_handler(irq, dev_id, fp);
 }
 
@@ -129,16 +129,16 @@ static irqreturn_t mvme147_timer_int (int irq, void *dev_id, struct pt_regs *fp)
 void mvme147_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *))
 {
 	tick_handler = timer_routine;
-	request_irq (PCC_IRQ_TIMER1, mvme147_timer_int, 
+	request_irq (PCC_IRQ_TIMER1, mvme147_timer_int,
 		IRQ_FLG_REPLACE, "timer 1", NULL);
-	
+
 	/* Init the clock with a value */
 	/* our clock goes off every 6.25us */
 	m147_pcc->t1_preload = PCC_TIMER_PRELOAD;
-	m147_pcc->t1_cntrl = 0x0;   	/* clear timer */
-	m147_pcc->t1_cntrl = 0x3; 	/* start timer */
+	m147_pcc->t1_cntrl = 0x0;	/* clear timer */
+	m147_pcc->t1_cntrl = 0x3;	/* start timer */
 	m147_pcc->t1_int_cntrl = PCC_TIMER_INT_CLR;  /* clear pending ints */
-	m147_pcc->t1_int_cntrl = PCC_INT_ENAB|PCC_LEVEL_TIMER1;   
+	m147_pcc->t1_int_cntrl = PCC_INT_ENAB|PCC_LEVEL_TIMER1;
 }
 
 /* This is always executed with interrupts disabled.  */
diff --git a/arch/m68k/mvme16x/mvme16x_ksyms.c b/arch/m68k/mvme16x/mvme16x_ksyms.c
index 7185bb0f0..4a8a3634b 100644
--- a/arch/m68k/mvme16x/mvme16x_ksyms.c
+++ b/arch/m68k/mvme16x/mvme16x_ksyms.c
@@ -2,5 +2,5 @@
 #include <linux/types.h>
 #include <asm/ptrace.h>
 #include <asm/mvme16xhw.h>
- 
+
 EXPORT_SYMBOL(mvme16x_config);
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
index 3efc26d25..8a2425069 100644
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -43,7 +43,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 {
 	volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE;
 	unsigned long flags;
-	struct rtc_time wtime; 
+	struct rtc_time wtime;
 
 	switch (cmd) {
 	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
@@ -101,7 +101,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 		if (yrs >= 2070)
 			return -EINVAL;
-		
+
 		local_irq_save(flags);
 		rtc->ctrl     = RTC_WRITE;
 
diff --git a/arch/m68k/q40/Makefile b/arch/m68k/q40/Makefile
index 85976bb53..27eb42796 100644
--- a/arch/m68k/q40/Makefile
+++ b/arch/m68k/q40/Makefile
@@ -2,4 +2,4 @@
 # Makefile for Linux arch/m68k/q40 source directory
 #
 
-obj-y		:= config.o q40ints.o 
+obj-y		:= config.o q40ints.o
diff --git a/arch/m68k/q40/README b/arch/m68k/q40/README
index 79a46b054..6bdbf4879 100644
--- a/arch/m68k/q40/README
+++ b/arch/m68k/q40/README
@@ -9,18 +9,18 @@ and mirrors.
 Hints to documentation usually refer to the linux source tree in
 /usr/src/linux/Documentation unless URL given.
 
-It seems IRQ unmasking can't be safely done on a Q40. IRQ probing 
+It seems IRQ unmasking can't be safely done on a Q40. IRQ probing
 is not implemented - do not try it! (See below)
 
 For a list of kernel command-line options read the documentation for the
 particular device drivers.
 
 The floppy imposes a very high interrupt load on the CPU, approx 30K/s.
-When something blocks interrupts (HD) it will lose some of them, so far 
+When something blocks interrupts (HD) it will lose some of them, so far
 this is not known to have caused any data loss. On highly loaded systems
-it can make the floppy very slow or practically stop. Other Q40 OS' simply 
+it can make the floppy very slow or practically stop. Other Q40 OS' simply
 poll the floppy for this reason - something that can't be done in Linux.
-Only possible cure is getting a 82072 controller with fifo instead of 
+Only possible cure is getting a 82072 controller with fifo instead of
 the 8272A.
 
 drivers used by the Q40, apart from the very obvious (console etc.):
@@ -28,7 +28,7 @@ drivers used by the Q40, apart from the very obvious (console etc.):
 		     serial.c		# normal PC driver - any speed
 	             lp.c		# printer driver
 		     genrtc.c		# RTC
-		char/joystick/*		# most of this should work, not 
+		char/joystick/*		# most of this should work, not
 				        # in default config.in
 	        block/q40ide.c		# startup for ide
 		      ide*		# see Documentation/ide.txt
@@ -41,30 +41,30 @@ drivers used by the Q40, apart from the very obvious (console etc.):
 		sound/dmasound_core.c
 		      dmasound_q40.c
 
-Various other PC drivers can be enabled simply by adding them to 
+Various other PC drivers can be enabled simply by adding them to
 arch/m68k/config.in, especially 8 bit devices should be without any
-problems. For cards using 16bit io/mem more care is required, like 
+problems. For cards using 16bit io/mem more care is required, like
 checking byte order issues, hacking memcpy_*_io etc.
 
 
 Debugging
 =========
 
-Upon startup the kernel will usually output "ABCQGHIJ" into the SRAM, 
-preceded by the booter signature. This is a trace just in case something 
-went wrong during earliest setup stages of head.S. 
-**Changed** to preserve SRAM contents by default, this is only done when 
-requested - SRAM must start with '%LX$' signature to do this. '-d' option 
+Upon startup the kernel will usually output "ABCQGHIJ" into the SRAM,
+preceded by the booter signature. This is a trace just in case something
+went wrong during earliest setup stages of head.S.
+**Changed** to preserve SRAM contents by default, this is only done when
+requested - SRAM must start with '%LX$' signature to do this. '-d' option
 to 'lxx' loader enables this.
 
 SRAM can also be used as additional console device, use debug=mem.
-This will save kernel startup msgs into SRAM, the screen will display 
+This will save kernel startup msgs into SRAM, the screen will display
 only the penguin - and shell prompt if it gets that far..
 Unfortunately only 2000 bytes are available.
 
 Serial console works and can also be used for debugging, see loader_txt
 
-Most problems seem to be caused by fawlty or badly configured io-cards or 
+Most problems seem to be caused by fawlty or badly configured io-cards or
 hard drives anyway.
 Make sure to configure the parallel port as SPP and remove IRQ/DMA jumpers
 for first testing. The Q40 does not support DMA and may have trouble with
@@ -74,7 +74,7 @@ parallel ports version of interrupts.
 Q40 Hardware Description
 ========================
 
-This is just an overview, see asm-m68k/* for details ask if you have any 
+This is just an overview, see asm-m68k/* for details ask if you have any
 questions.
 
 The Q40 consists of a 68040@40 MHz, 1MB video RAM, up to 32MB RAM, AT-style
@@ -82,16 +82,16 @@ keyboard interface, 1 Programmable LED, 2x8bit DACs and up to 1MB ROM, 1MB
 shadow ROM.
 The Q60 has any of 68060 or 68LC060 and up to 128 MB RAM.
 
-Most interfacing like floppy, IDE, serial and parallel ports is done via ISA 
-slots. The ISA io and mem range is mapped (sparse&byteswapped!) into separate 
+Most interfacing like floppy, IDE, serial and parallel ports is done via ISA
+slots. The ISA io and mem range is mapped (sparse&byteswapped!) into separate
 regions of the memory.
-The main interrupt register IIRQ_REG will indicate whether an IRQ was internal 
+The main interrupt register IIRQ_REG will indicate whether an IRQ was internal
 or from some ISA devices, EIRQ_REG can distinguish up to 8 ISA IRQs.
 
 The Q40 custom chip is programmable to provide 2 periodic timers:
 	- 50 or 200 Hz - level 2, !!THIS CANT BE DISABLED!!
-	- 10 or 20 KHz - level 4, used for dma-sound 
-  
+	- 10 or 20 KHz - level 4, used for dma-sound
+
 Linux uses the 200 Hz interrupt for timer and beep by default.
 
 
@@ -112,7 +112,7 @@ q40ints.c now contains a trivial hack for (a), (b) is more difficult
 because only irq's 4-15 can be disabled - and only all of them at once.
 Thus disable_irq() can effectively block the machine if the driver goes
 asleep.
-One thing to keep in mind when hacking around the interrupt code is 
+One thing to keep in mind when hacking around the interrupt code is
 that there is no way to find out which IRQ caused a request, [EI]IRQ_REG
 displays current state of the various IRQ lines.
 
@@ -123,11 +123,11 @@ q40 receives AT make/break codes from the keyboard, these are translated to
 the PC scancodes x86 Linux uses. So by theory every national keyboard should
 work just by loading the appropriate x86 keytable - see any national-HOWTO.
 
-Unfortunately the AT->PC translation isn't quite trivial and even worse, my 
-documentation of it is absolutely minimal - thus some exotic keys may not 
+Unfortunately the AT->PC translation isn't quite trivial and even worse, my
+documentation of it is absolutely minimal - thus some exotic keys may not
 behave exactly as expected.
 
-There is still hope that it can be fixed completely though. If you encounter 
+There is still hope that it can be fixed completely though. If you encounter
 problems, email me ideally this:
 	- exact keypress/release sequence
 	- 'showkey -s' run on q40, non-X session
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index cd9f505e6..1f8977e79 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -159,7 +159,7 @@ static unsigned int serports[]={0x3f8,0x2f8,0x3e8,0x2e8,0};
 void q40_disable_irqs(void)
 {
   unsigned i,j;
-  
+
   j=0;
   while((i=serports[j++])) outb(0,i+UART_IER);
   master_outb(0,EXT_ENABLE_REG);
@@ -170,16 +170,16 @@ void __init config_q40(void)
 {
     mach_sched_init      = q40_sched_init;
 
-    mach_init_IRQ        = q40_init_IRQ;   
-    mach_gettimeoffset   = q40_gettimeoffset; 
-    mach_hwclk           = q40_hwclk; 
+    mach_init_IRQ        = q40_init_IRQ;
+    mach_gettimeoffset   = q40_gettimeoffset;
+    mach_hwclk           = q40_hwclk;
     mach_get_ss          = q40_get_ss;
     mach_get_rtc_pll     = q40_get_rtc_pll;
     mach_set_rtc_pll     = q40_set_rtc_pll;
     mach_set_clock_mmss	 = q40_set_clock_mmss;
 
     mach_reset		 = q40_reset;
-    mach_free_irq	 = q40_free_irq; 
+    mach_free_irq	 = q40_free_irq;
     mach_process_int	 = q40_process_int;
     mach_get_irq_list	 = show_q40_interrupts;
     mach_request_irq	 = q40_request_irq;
@@ -204,9 +204,9 @@ void __init config_q40(void)
     q40_disable_irqs();
 
     /* no DMA at all, but ide-scsi requires it.. make sure
-     * all physical RAM fits into the boundary - otherwise 
+     * all physical RAM fits into the boundary - otherwise
      * allocator may play costly and useless tricks */
-    mach_max_dma_address = 1024*1024*1024;   
+    mach_max_dma_address = 1024*1024*1024;
 
     /* useful for early debugging stages - writes kernel messages into SRAM */
     if (!strncmp( m68k_debug_device,"mem",3 ))
@@ -286,7 +286,7 @@ int q40_hwclk(int op, struct rtc_time *t)
 	  t->tm_sec  = bcd2bin (Q40_RTC_SECS);
 
 	  Q40_RTC_CTRL &= ~(Q40_RTC_READ);
-	  
+
 	  if (t->tm_year < 70)
 	    t->tm_year += 100;
 	  t->tm_wday = bcd2bin(Q40_RTC_DOW)-1;
@@ -319,7 +319,7 @@ int q40_set_clock_mmss (unsigned long nowtime)
 	if ((rtc_minutes < real_minutes
 		? real_minutes - rtc_minutes
 			: rtc_minutes - real_minutes) < 30)
-	{	   
+	{
 	        Q40_RTC_CTRL |= Q40_RTC_WRITE;
 		Q40_RTC_MINS = bin2bcd(real_minutes);
 		Q40_RTC_SECS = bin2bcd(real_seconds);
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c
index 8cafcb91c..541897351 100644
--- a/arch/m68k/q40/q40ints.c
+++ b/arch/m68k/q40/q40ints.c
@@ -30,14 +30,14 @@
 #include <asm/q40_master.h>
 #include <asm/q40ints.h>
 
-/* 
- * Q40 IRQs are defined as follows: 
+/*
+ * Q40 IRQs are defined as follows:
  *            3,4,5,6,7,10,11,14,15 : ISA dev IRQs
  *            16-31: reserved
  *            32   : keyboard int
  *            33   : frame int (50/200 Hz periodic timer)
  *            34   : sample int (10/20 KHz periodic timer)
- *          
+ *
 */
 
 extern int ints_inited;
@@ -122,7 +122,7 @@ int q40_request_irq(unsigned int irq,
 	  case 12: case 13:
 	    printk("%s: ISA IRQ %d from %s not implemented by HW\n", __FUNCTION__, irq, devname);
 	    return -ENXIO;
-	  case 11: 	      
+	  case 11:
 	    printk("warning IRQ 10 and 11 not distinguishable\n");
 	    irq=10;
 	  default:
@@ -131,7 +131,7 @@ int q40_request_irq(unsigned int irq,
 
 	if (irq<Q40_IRQ_SAMPLE)
 	  {
-	    if (irq_tab[irq].dev_id != NULL) 
+	    if (irq_tab[irq].dev_id != NULL)
 		  {
 		    printk("%s: IRQ %d from %s is not replaceable\n",
 			   __FUNCTION__, irq, irq_tab[irq].devname);
@@ -176,13 +176,13 @@ void q40_free_irq(unsigned int irq, void *dev_id)
 	  default:
 	    ;
 	  }
-	
+
 	if (irq<Q40_IRQ_SAMPLE)
 	  {
 	    if (irq_tab[irq].dev_id != dev_id)
 	      printk("%s: Removing probably wrong IRQ %d from %s\n",
 		     __FUNCTION__, irq, irq_tab[irq].devname);
-	    
+
 	    irq_tab[irq].handler = q40_defhand;
 	    irq_tab[irq].flags   = 0;
 	    irq_tab[irq].dev_id  = NULL;
@@ -205,7 +205,7 @@ irqreturn_t q40_process_int (int level, struct pt_regs *fp)
   return IRQ_HANDLED;
 }
 
-/* 
+/*
  * this stuff doesn't really belong here..
 */
 
@@ -267,10 +267,10 @@ void q40_sched_init (irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)
 }
 
 
-/* 
- * tables to translate bits into IRQ numbers 
+/*
+ * tables to translate bits into IRQ numbers
  * it is a good idea to order the entries by priority
- * 
+ *
 */
 
 struct IRQ_TABLE{ unsigned mask; int irq ;};
@@ -319,7 +319,7 @@ irqreturn_t q40_irq2_handler (int vec, void *devname, struct pt_regs *fp)
   mir=master_inb(IIRQ_REG);
   if (mir&Q40_IRQ_FRAME_MASK) {
 	  irq_tab[Q40_IRQ_FRAME].count++;
-	  irq_tab[Q40_IRQ_FRAME].handler(Q40_IRQ_FRAME,irq_tab[Q40_IRQ_FRAME].dev_id,fp);   
+	  irq_tab[Q40_IRQ_FRAME].handler(Q40_IRQ_FRAME,irq_tab[Q40_IRQ_FRAME].dev_id,fp);
 	  master_outb(-1,FRAME_CLEAR_REG);
   }
   if ((mir&Q40_IRQ_SER_MASK) || (mir&Q40_IRQ_EXT_MASK)) {
@@ -356,15 +356,15 @@ irqreturn_t q40_irq2_handler (int vec, void *devname, struct pt_regs *fp)
 #endif
 				  goto iirq;
 			  }
-			  irq_tab[irq].count++; 
+			  irq_tab[irq].count++;
 			  irq_tab[irq].state |= IRQ_INPROGRESS;
 			  irq_tab[irq].handler(irq,irq_tab[irq].dev_id,fp);
 			  irq_tab[irq].state &= ~IRQ_INPROGRESS;
-			  
+
 			  /* naively enable everything, if that fails than    */
 			  /* this function will be reentered immediately thus */
 			  /* getting another chance to disable the IRQ        */
-			  
+
 			  if ( disabled ) {
 #ifdef IP_USE_DISABLE
 				  if (irq>4){
@@ -379,9 +379,9 @@ irqreturn_t q40_irq2_handler (int vec, void *devname, struct pt_regs *fp)
 			  return IRQ_HANDLED;
 		  }
 	  }
-	  if (mer && ccleirq>0 && !aliased_irq) 
+	  if (mer && ccleirq>0 && !aliased_irq)
 		  printk("ISA interrupt from unknown source? EIRQ_REG = %x\n",mer),ccleirq--;
-  } 
+  }
  iirq:
   mir=master_inb(IIRQ_REG);
   /* should test whether keyboard irq is really enabled, doing it in defhand */
@@ -399,10 +399,10 @@ int show_q40_interrupts (struct seq_file *p, void *v)
 	for (i = 0; i <= Q40_IRQ_MAX; i++) {
 		if (irq_tab[i].count)
 		      seq_printf(p, "%sIRQ %02d: %8d  %s%s\n",
-			      (i<=15) ? "ISA-" : "    " ,		
+			      (i<=15) ? "ISA-" : "    " ,
 			    i, irq_tab[i].count,
 			    irq_tab[i].devname[0] ? irq_tab[i].devname : "?",
-			    irq_tab[i].handler == q40_defhand ? 
+			    irq_tab[i].handler == q40_defhand ?
 					" (now unassigned)" : "");
 	}
 	return 0;
@@ -440,7 +440,7 @@ void q40_enable_irq (unsigned int irq)
   {
     mext_disabled--;
     if (mext_disabled>0)
-	  printk("q40_enable_irq : nested disable/enable\n"); 
+	  printk("q40_enable_irq : nested disable/enable\n");
     if (mext_disabled==0)
     master_outb(1,EXT_ENABLE_REG);
     }
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index db71459a9..77d05bcc3 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -42,19 +42,19 @@ extern void sun3_get_model (char* model);
 extern void idprom_init (void);
 extern int sun3_hwclk(int set, struct rtc_time *t);
 
-volatile char* clock_va; 
+volatile char* clock_va;
 extern volatile unsigned char* sun3_intreg;
 extern unsigned long availmem;
 unsigned long num_pages;
 
 static int sun3_get_hardware_list(char *buffer)
 {
-	
+
 	int len = 0;
 
 	len += sprintf(buffer + len, "PROM Revision:\t%s\n",
 		       romvec->pv_monid);
-	
+
 	return len;
 
 }
@@ -71,14 +71,14 @@ void __init sun3_init(void)
 	clock_va    =          (char *) 0xfe06000;	/* dark  */
 	sun3_intreg = (unsigned char *) 0xfe0a000;	/* magic */
 	sun3_disable_interrupts();
-	
+
 	prom_init((void *)LINUX_OPPROM_BEGVM);
-		
+
 	GET_CONTROL_BYTE(AC_SENABLE,enable_register);
-	enable_register |= 0x50; /* Enable FPU */	
+	enable_register |= 0x50; /* Enable FPU */
 	SET_CONTROL_BYTE(AC_SENABLE,enable_register);
 	GET_CONTROL_BYTE(AC_SENABLE,enable_register);
-	
+
 	/* This code looks suspicious, because it doesn't subtract
            memory belonging to the kernel from the available space */
 
@@ -122,7 +122,7 @@ void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_
 	/* align start/end to page boundaries */
 	memory_start = ((memory_start + (PAGE_SIZE-1)) & PAGE_MASK);
 	memory_end = memory_end & PAGE_MASK;
-		
+
 	start_page = __pa(memory_start) >> PAGE_SHIFT;
 	num_pages = __pa(memory_end) >> PAGE_SHIFT;
 
@@ -134,7 +134,7 @@ void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_
 
 	free_bootmem(__pa(availmem), memory_end - (availmem));
 }
-	
+
 
 void __init config_sun3(void)
 {
@@ -145,13 +145,13 @@ void __init config_sun3(void)
 
 	/* Subtract kernel memory from available memory */
 
-        mach_sched_init      =  sun3_sched_init; 
+        mach_sched_init      =  sun3_sched_init;
         mach_init_IRQ        =  sun3_init_IRQ;
         mach_default_handler = &sun3_default_handler;
         mach_request_irq     =  sun3_request_irq;
         mach_free_irq        =  sun3_free_irq;
-	enable_irq     	     =  sun3_enable_irq;
-        disable_irq  	     =  sun3_disable_irq;
+	enable_irq	     =  sun3_enable_irq;
+        disable_irq	     =  sun3_disable_irq;
 	mach_process_int     =  sun3_process_int;
         mach_get_irq_list    =  show_sun3_interrupts;
         mach_reset           =  sun3_reboot;
@@ -161,7 +161,7 @@ void __init config_sun3(void)
 	mach_halt	     =  sun3_halt;
 	mach_get_hardware_list = sun3_get_hardware_list;
 #if defined(CONFIG_DUMMY_CONSOLE)
-	conswitchp 	     = &dummy_con;
+	conswitchp	     = &dummy_con;
 #endif
 
 	memory_start = ((((int)&_end) + 0x2000) & ~0x1fff);
@@ -170,7 +170,7 @@ void __init config_sun3(void)
 
 	m68k_num_memory=1;
         m68k_memory[0].size=*(romvec->pv_sun3mem);
-	
+
 	sun3_bootmem_alloc(memory_start, memory_end);
 }
 
@@ -179,7 +179,7 @@ void __init sun3_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_
 	sun3_disable_interrupts();
         intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_DISABLE|INTERSIL_24H_MODE);
         intersil_clock->int_reg=INTERSIL_HZ_100_MASK;
- 	intersil_clear();
+	intersil_clear();
         sun3_enable_irq(5);
         intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_ENABLE|INTERSIL_24H_MODE);
         sun3_enable_interrupts();
diff --git a/arch/m68k/sun3/dvma.c b/arch/m68k/sun3/dvma.c
index af1b60199..d2b3093f2 100644
--- a/arch/m68k/sun3/dvma.c
+++ b/arch/m68k/sun3/dvma.c
@@ -24,13 +24,13 @@ inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
 	unsigned long pte;
 	unsigned long j;
 	pte_t ptep;
-	
+
 	j = *(volatile unsigned long *)kaddr;
 	*(volatile unsigned long *)kaddr = j;
 
 	ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL);
 	pte = pte_val(ptep);
-//		printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n", 
+//		printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n",
 //		       kaddr, vaddr, pte, len);
 	if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) {
 		sun3_put_pte(vaddr, pte);
@@ -41,7 +41,7 @@ inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
 
 }
 
-int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, 
+int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
 			      int len)
 {
 
@@ -51,7 +51,7 @@ int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
 	vaddr = dvma_btov(baddr);
 
 	end = vaddr + len;
-	
+
 	while(vaddr < end) {
 		dvma_page(kaddr, vaddr);
 		kaddr += PAGE_SIZE;
diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
index 9939be871..02c1fee6f 100644
--- a/arch/m68k/sun3/idprom.c
+++ b/arch/m68k/sun3/idprom.c
@@ -67,7 +67,7 @@ static void __init display_system_type(unsigned char machtype)
 				prom_getproperty(prom_root_node, "banner-name",
 						 sysname, sizeof(sysname));
 				printk("TYPE: %s\n", sysname);
-#endif				
+#endif
 			}
 			return;
 		}
@@ -83,7 +83,7 @@ void sun3_get_model(unsigned char* model)
 
 	for (i = 0; i < NUM_SUN_MACHINES; i++) {
 		if(Sun_Machines[i].id_machtype == idprom->id_machtype) {
-       		        strcpy(model, Sun_Machines[i].name);
+		        strcpy(model, Sun_Machines[i].name);
 			return;
 		}
 	}
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c
index fce7e6f03..db359d740 100644
--- a/arch/m68k/sun3/intersil.c
+++ b/arch/m68k/sun3/intersil.c
@@ -26,7 +26,7 @@
 
 /* does this need to be implemented? */
 unsigned long sun3_gettimeoffset(void)
-{ 
+{
   return 1;
 }
 
diff --git a/arch/m68k/sun3/leds.c b/arch/m68k/sun3/leds.c
index c334d9d87..a3e948463 100644
--- a/arch/m68k/sun3/leds.c
+++ b/arch/m68k/sun3/leds.c
@@ -5,9 +5,9 @@
 void sun3_leds(unsigned char byte)
 {
 	unsigned char dfc;
-	
+
 	GET_DFC(dfc);
         SET_DFC(FC_CONTROL);
-       	SET_CONTROL_BYTE(AC_LEDS,byte);
+	SET_CONTROL_BYTE(AC_LEDS,byte);
 	SET_DFC(dfc);
 }
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 864c980e5..0d9876190 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -125,12 +125,12 @@ void mmu_emu_init(unsigned long bootmem_end)
 {
 	unsigned long seg, num;
 	int i,j;
-	
+
 	memset(rom_pages, 0, sizeof(rom_pages));
 	memset(pmeg_vaddr, 0, sizeof(pmeg_vaddr));
 	memset(pmeg_alloc, 0, sizeof(pmeg_alloc));
 	memset(pmeg_ctx, 0, sizeof(pmeg_ctx));
-	
+
 	/* pmeg align the end of bootmem, adding another pmeg,
 	 * later bootmem allocations will likely need it */
 	bootmem_end = (bootmem_end + (2 * SUN3_PMEG_SIZE)) & ~SUN3_PMEG_MASK;
@@ -148,7 +148,7 @@ void mmu_emu_init(unsigned long bootmem_end)
 	/* liberate all existing mappings in the rest of kernel space */
 	for(seg = bootmem_end; seg < 0x0f800000; seg += SUN3_PMEG_SIZE) {
 		i = sun3_get_segmap(seg);
-		
+
 		if(!pmeg_alloc[i]) {
 #ifdef DEBUG_MMU_EMU
 			printk("freed: ");
@@ -179,13 +179,13 @@ void mmu_emu_init(unsigned long bootmem_end)
 			pmeg_alloc[sun3_get_segmap(seg)] = 2;
 		}
 	}
-	
+
 	dvma_init();
-	
-	
+
+
 	/* blank everything below the kernel, and we've got the base
 	   mapping to start all the contexts off with... */
-	for(seg = 0; seg < PAGE_OFFSET; seg += SUN3_PMEG_SIZE) 
+	for(seg = 0; seg < PAGE_OFFSET; seg += SUN3_PMEG_SIZE)
 		sun3_put_segmap(seg, SUN3_INVALID_PMEG);
 
 	set_fs(MAKE_MM_SEG(3));
@@ -195,7 +195,7 @@ void mmu_emu_init(unsigned long bootmem_end)
 			(*(romvec->pv_setctxt))(j, (void *)seg, i);
 	}
 	set_fs(KERNEL_DS);
-	
+
 }
 
 /* erase the mappings for a dead context.  Uses the pg_dir for hints
@@ -207,9 +207,9 @@ void clear_context(unsigned long context)
 {
      unsigned char oldctx;
      unsigned long i;
-    
+
      if(context) {
-	     if(!ctx_alloc[context]) 
+	     if(!ctx_alloc[context])
 		     panic("clear_context: context not allocated\n");
 
 	     ctx_alloc[context]->context = SUN3_INVALID_CONTEXT;
@@ -229,7 +229,7 @@ void clear_context(unsigned long context)
 		     pmeg_vaddr[i] = 0;
 	     }
      }
-     
+
      sun3_put_context(oldctx);
 }
 
@@ -239,7 +239,7 @@ void clear_context(unsigned long context)
    sure it could be much more intellegent...  but it gets the job done
    for now without much overhead in making it's decision. */
 /* todo: come up with optimized scheme for flushing contexts */
-unsigned long get_free_context(struct mm_struct *mm) 
+unsigned long get_free_context(struct mm_struct *mm)
 {
 	unsigned long new = 1;
 	static unsigned char next_to_die = 1;
@@ -259,7 +259,7 @@ unsigned long get_free_context(struct mm_struct *mm)
 				break;
 		}
 		// check to make sure one was really free...
-		if(new == CONTEXTS_NUM) 
+		if(new == CONTEXTS_NUM)
 			panic("get_free_context: failed to find free context");
 	}
 
@@ -307,7 +307,7 @@ printk("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n",
 	if(vaddr >= PAGE_OFFSET) {
 		/* map kernel pmegs into all contexts */
 		unsigned char i;
-		
+
 		for(i = 0; i < CONTEXTS_NUM; i++) {
 			sun3_put_context(i);
 			sun3_put_segmap (vaddr, curr_pmeg);
@@ -315,7 +315,7 @@ printk("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n",
 		sun3_put_context(context);
 		pmeg_alloc[curr_pmeg] = 2;
 		pmeg_ctx[curr_pmeg] = 0;
-		
+
 	}
 	else {
 		pmeg_alloc[curr_pmeg] = 1;
@@ -326,7 +326,7 @@ printk("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n",
 	pmeg_vaddr[curr_pmeg] = vaddr;
 
 	/* Set hardware mapping and clear the old PTE entries. */
-	for (i=0; i<SUN3_PMEG_SIZE; i+=SUN3_PTE_SIZE) 
+	for (i=0; i<SUN3_PMEG_SIZE; i+=SUN3_PTE_SIZE)
 		sun3_put_pte (vaddr + i, SUN3_PAGE_SYSTEM);
 
 	/* Consider a different one next time. */
@@ -361,7 +361,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 		context = 0;
 	} else {
 		context = current->mm->context;
-		if(kernel_fault) 
+		if(kernel_fault)
 			crp = swapper_pg_dir;
 		else
 			crp = current->mm->pgd;
@@ -390,11 +390,11 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 	pte = (pte_t *) __va ((unsigned long)(pte + offset));
 
 	/* Make sure this is a valid page */
-	if (!(pte_val (*pte) & SUN3_PAGE_VALID)) 
+	if (!(pte_val (*pte) & SUN3_PAGE_VALID))
 		return 0;
 
 	/* Make sure there's a pmeg allocated for the page */
-	if (sun3_get_segmap (vaddr&~SUN3_PMEG_MASK) == SUN3_INVALID_PMEG) 
+	if (sun3_get_segmap (vaddr&~SUN3_PMEG_MASK) == SUN3_INVALID_PMEG)
 		mmu_emu_map_pmeg (context, vaddr);
 
 	/* Write the pte value to hardware MMU */
@@ -409,7 +409,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 		if (pte_val (*pte) & SUN3_PAGE_WRITEABLE)
 			pte_val (*pte) |= (SUN3_PAGE_ACCESSED
 					   | SUN3_PAGE_MODIFIED);
-		else 
+		else
 			return 0;	/* Write-protect error. */
 	} else
 		pte_val (*pte) |= SUN3_PAGE_ACCESSED;
diff --git a/arch/m68k/sun3/prom/init.c b/arch/m68k/sun3/prom/init.c
index a83d303d1..2e6ae56ae 100644
--- a/arch/m68k/sun3/prom/init.c
+++ b/arch/m68k/sun3/prom/init.c
@@ -73,7 +73,7 @@ void __init prom_init(struct linux_romvec *rp)
 	if((prom_root_node == 0) || (prom_root_node == -1))
 		prom_halt();
 
-	if((((unsigned long) prom_nodeops) == 0) || 
+	if((((unsigned long) prom_nodeops) == 0) ||
 	   (((unsigned long) prom_nodeops) == -1))
 		prom_halt();
 
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index 553a2d95e..47e677d0d 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -52,21 +52,21 @@ static unsigned long dvma_frees;
 static unsigned long long dvma_alloc_bytes;
 static unsigned long long dvma_free_bytes;
 
-static void print_use(void) 
+static void print_use(void)
 {
-	
+
 	int i;
 	int j = 0;
 
 	printk("dvma entry usage:\n");
-	
+
 	for(i = 0; i < IOMMU_TOTAL_ENTRIES; i++) {
 		if(!iommu_use[i])
 			continue;
-		
+
 		j++;
 
-		printk("dvma entry: %08lx len %08lx\n", 
+		printk("dvma entry: %08lx len %08lx\n",
 		       ( i << DVMA_PAGE_SHIFT) + DVMA_START,
 		       iommu_use[i]);
 	}
@@ -74,28 +74,28 @@ static void print_use(void)
 	printk("%d entries in use total\n", j);
 
 	printk("allocation/free calls: %lu/%lu\n", dvma_allocs, dvma_frees);
-	printk("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes, 
+	printk("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes,
 	       dvma_free_bytes);
 }
 
 static void print_holes(struct list_head *holes)
 {
-	
+
 	struct list_head *cur;
 	struct hole *hole;
 
 	printk("listing dvma holes\n");
 	list_for_each(cur, holes) {
 		hole = list_entry(cur, struct hole, list);
-		
+
 		if((hole->start == 0) && (hole->end == 0) && (hole->size == 0))
 			continue;
-		
+
 		printk("hole: start %08lx end %08lx size %08lx\n", hole->start, hole->end, hole->size);
 	}
-	
+
 	printk("end of hole listing...\n");
-	
+
 }
 #endif /* DVMA_DEBUG */
 
@@ -106,7 +106,7 @@ static inline int refill(void)
 	struct hole *prev = NULL;
 	struct list_head *cur;
 	int ret = 0;
-	
+
 	list_for_each(cur, &hole_list) {
 		hole = list_entry(cur, struct hole, list);
 
@@ -114,7 +114,7 @@ static inline int refill(void)
 			prev = hole;
 			continue;
 		}
-		
+
 		if(hole->end == prev->start) {
 			hole->size += prev->size;
 			hole->end = prev->end;
@@ -122,12 +122,12 @@ static inline int refill(void)
 			list_add(&(prev->list), &hole_cache);
 			ret++;
 		}
-		
+
 	}
 
 	return ret;
 }
-	
+
 static inline struct hole *rmcache(void)
 {
 	struct hole *ret;
@@ -148,7 +148,7 @@ static inline struct hole *rmcache(void)
 
 static inline unsigned long get_baddr(int len, unsigned long align)
 {
-	
+
 	struct list_head *cur;
 	struct hole *hole;
 
@@ -166,11 +166,11 @@ static inline unsigned long get_baddr(int len, unsigned long align)
 
 		hole = list_entry(cur, struct hole, list);
 
-		if(align > DVMA_PAGE_SIZE) 
+		if(align > DVMA_PAGE_SIZE)
 			newlen = len + ((hole->end - len) & (align-1));
 		else
 			newlen = len;
-		
+
 		if(hole->size > newlen) {
 			hole->end -= newlen;
 			hole->size -= newlen;
@@ -200,7 +200,7 @@ static inline unsigned long get_baddr(int len, unsigned long align)
 
 static inline int free_baddr(unsigned long baddr)
 {
-	
+
 	unsigned long len;
 	struct hole *hole;
 	struct list_head *cur;
@@ -219,7 +219,7 @@ static inline int free_baddr(unsigned long baddr)
 
 	list_for_each(cur, &hole_list) {
 		hole = list_entry(cur, struct hole, list);
-		
+
 		if(hole->end == baddr) {
 			hole->end += len;
 			hole->size += len;
@@ -233,21 +233,21 @@ static inline int free_baddr(unsigned long baddr)
 	}
 
 	hole = rmcache();
-	
+
 	hole->start = baddr;
 	hole->end = baddr + len;
 	hole->size = len;
-	
+
 //	list_add_tail(&(hole->list), cur);
 	list_add(&(hole->list), cur);
-	
+
 	return 0;
-	
+
 }
 
 void dvma_init(void)
 {
-	
+
 	struct hole *hole;
 	int i;
 
@@ -255,14 +255,14 @@ void dvma_init(void)
 	INIT_LIST_HEAD(&hole_cache);
 
 	/* prepare the hole cache */
-	for(i = 0; i < 64; i++) 
+	for(i = 0; i < 64; i++)
 		list_add(&(initholes[i].list), &hole_cache);
-		
+
 	hole = rmcache();
 	hole->start = DVMA_START;
 	hole->end = DVMA_END;
 	hole->size = DVMA_SIZE;
-	
+
 	list_add(&(hole->list), &hole_list);
 
 	memset(iommu_use, 0, sizeof(iommu_use));
@@ -291,7 +291,7 @@ inline unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
 	}
 
 #ifdef DEBUG
-	printk("dvma_map request %08lx bytes from %08lx\n", 
+	printk("dvma_map request %08lx bytes from %08lx\n",
 	       len, kaddr);
 #endif
 	off = kaddr & ~DVMA_PAGE_MASK;
@@ -309,7 +309,7 @@ inline unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
 
 	if(!dvma_map_iommu(kaddr, baddr, len))
 		return (baddr + off);
-	
+
 	printk("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr, len);
 	BUG();
 	return 0;
@@ -318,14 +318,14 @@ inline unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
 void dvma_unmap(void *baddr)
 {
 	unsigned long addr;
-	
+
 	addr = (unsigned long)baddr;
 	/* check if this is a vme mapping */
 	if(!(addr & 0x00f00000))
 		addr |= 0xf00000;
-	
+
 	free_baddr(addr);
-	
+
 	return;
 
 }
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index cbdd02eae..bca65bd06 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -28,7 +28,7 @@ void sun3_disable_interrupts(void)
 void sun3_enable_interrupts(void)
 {
 	sun3_enable_irq(0);
-}	
+}
 
 int led_pattern[8] = {
        ~(0x80), ~(0x01),
@@ -67,7 +67,7 @@ inline void sun3_do_irq(int irq, struct pt_regs *fp)
 static irqreturn_t sun3_int7(int irq, void *dev_id, struct pt_regs *fp)
 {
 	sun3_do_irq(irq,fp);
-	if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 2000)) 
+	if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 2000))
 		sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%16000)
 			  /2000]);
 	return IRQ_HANDLED;
@@ -125,7 +125,7 @@ int show_sun3_interrupts(struct seq_file *p, void *v)
 
 	for(i = 0; i < (SUN3_INT_VECS-1); i++) {
 		if(sun3_vechandler[i] != NULL) {
-			seq_printf(p, "vec %3d: %10u %s\n", i+64, 
+			seq_printf(p, "vec %3d: %10u %s\n", i+64,
 				   vec_ints[i],
 				   (vec_names[i]) ? vec_names[i] :
 				   "sun3_vechandler");
@@ -166,12 +166,12 @@ void sun3_init_IRQ(void)
 					dev_names[i], NULL);
 	}
 
-	for(i = 0; i < 192; i++) 
+	for(i = 0; i < 192; i++)
 		sun3_vechandler[i] = NULL;
-	
+
 	sun3_vechandler[191] = sun3_vec255;
 }
-                                
+
 int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
                       unsigned long flags, const char *devname, void *dev_id)
 {
@@ -181,11 +181,11 @@ int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struc
 			printk("sun3_request_irq: request for irq %d -- already taken!\n", irq);
 			return 1;
 		}
-		
+
 		sun3_inthandler[irq] = handler;
 		dev_ids[irq] = dev_id;
 		dev_names[irq] = devname;
-		
+
 		/* setting devname would be nice */
 		cpu_request_irq(irq, sun3_default_handler[irq], 0, devname,
 				NULL);
@@ -205,7 +205,7 @@ int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struc
 			vec_ids[vec] = dev_id;
 			vec_names[vec] = devname;
 			vec_ints[vec] = 0;
-			
+
 			return 0;
 		}
 	}
@@ -214,16 +214,16 @@ int sun3_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struc
 	return 1;
 
 }
-                        
+
 void sun3_free_irq(unsigned int irq, void *dev_id)
 {
 
 	if(irq < SYS_IRQS) {
-		if(sun3_inthandler[irq] == NULL) 
+		if(sun3_inthandler[irq] == NULL)
 			panic("sun3_free_int: attempt to free unused irq %d\n", irq);
 		if(dev_ids[irq] != dev_id)
 			panic("sun3_free_int: incorrect dev_id for irq %d\n", irq);
-		
+
 		sun3_inthandler[irq] = NULL;
 		return;
 	} else if((irq >= 64) && (irq <= 255)) {
@@ -234,12 +234,12 @@ void sun3_free_irq(unsigned int irq, void *dev_id)
 			panic("sun3_free_int: attempt to free unused vector %d\n", irq);
 		if(vec_ids[irq] != dev_id)
 			panic("sun3_free_int: incorrect dev_id for vec %d\n", irq);
-		
+
 		sun3_vechandler[vec] = NULL;
 		return;
 	} else {
 		panic("sun3_free_irq: invalid irq %d\n", irq);
-	}		
+	}
 }
 
 irqreturn_t sun3_process_int(int irq, struct pt_regs *regs)
@@ -249,7 +249,7 @@ irqreturn_t sun3_process_int(int irq, struct pt_regs *regs)
 		int vec;
 
 		vec = irq - 64;
-		if(sun3_vechandler[vec] == NULL) 
+		if(sun3_vechandler[vec] == NULL)
 			panic ("bad interrupt vector %d received\n",irq);
 
 		vec_ints[vec]++;
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index 25ab5d9c0..756d6277f 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -33,12 +33,12 @@ void sun3_leds(unsigned int i)
 
 static int sun3x_get_hardware_list(char *buffer)
 {
-	
+
 	int len = 0;
 
 	len += sprintf(buffer + len, "PROM Revision:\t%s\n",
 		       romvec->pv_monid);
-	
+
 	return len;
 
 }
@@ -62,7 +62,7 @@ void __init config_sun3x(void)
 	mach_request_irq     = sun3_request_irq;
 	mach_free_irq        = sun3_free_irq;
 	mach_process_int     = sun3_process_int;
-    
+
 	mach_gettimeoffset   = sun3x_gettimeoffset;
 	mach_reset           = sun3x_reboot;
 
@@ -70,10 +70,14 @@ void __init config_sun3x(void)
 	mach_get_model       = sun3_get_model;
 	mach_get_hardware_list = sun3x_get_hardware_list;
 
+#if defined(CONFIG_DUMMY_CONSOLE)
+	conswitchp	     = &dummy_con;
+#endif
+
 	sun3_intreg = (unsigned char *)SUN3X_INTREG;
 
 	/* only the serial console is known to work anyway... */
-#if 0    
+#if 0
 	switch (*(unsigned char *)SUN3X_EEPROM_CONS) {
 	case 0x10:
 		serial_console = 1;
diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c
index 4fc997c9b..32e55adfe 100644
--- a/arch/m68k/sun3x/dvma.c
+++ b/arch/m68k/sun3x/dvma.c
@@ -1,11 +1,11 @@
 /*
  * Virtual DMA allocation
  *
- * (C) 1999 Thomas Bogendoerfer (tsbogend@alpha.franken.de) 
+ * (C) 1999 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
  *
- * 11/26/2000 -- disabled the existing code because it didn't work for 
- * me in 2.4.  Replaced with a significantly more primitive version 
- * similar to the sun3 code.  the old functionality was probably more 
+ * 11/26/2000 -- disabled the existing code because it didn't work for
+ * me in 2.4.  Replaced with a significantly more primitive version
+ * similar to the sun3 code.  the old functionality was probably more
  * desirable, but....   -- Sam Creasey (sammy@oh.verio.com)
  *
  */
@@ -42,8 +42,8 @@
 static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU;
 
 
-#define dvma_entry_paddr(index) 	(iommu_pte[index] & IOMMU_ADDR_MASK)
-#define dvma_entry_vaddr(index,paddr) 	((index << DVMA_PAGE_SHIFT) |  \
+#define dvma_entry_paddr(index)		(iommu_pte[index] & IOMMU_ADDR_MASK)
+#define dvma_entry_vaddr(index,paddr)	((index << DVMA_PAGE_SHIFT) |  \
 					 (paddr & (DVMA_PAGE_SIZE-1)))
 #if 0
 #define dvma_entry_set(index,addr)	(iommu_pte[index] =            \
@@ -80,7 +80,7 @@ void dvma_print (unsigned long dvma_addr)
 
 /* create a virtual mapping for a page assigned within the IOMMU
    so that the cpu can reach it easily */
-inline int dvma_map_cpu(unsigned long kaddr, 
+inline int dvma_map_cpu(unsigned long kaddr,
 			       unsigned long vaddr, int len)
 {
 	pgd_t *pgd;
@@ -97,7 +97,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
 	       kaddr, vaddr);
 #endif
 	pgd = pgd_offset_k(vaddr);
-	
+
 	do {
 		pmd_t *pmd;
 		unsigned long end2;
@@ -107,7 +107,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
 			goto out;
 		}
 
-		if((end & PGDIR_MASK) > (vaddr & PGDIR_MASK)) 
+		if((end & PGDIR_MASK) > (vaddr & PGDIR_MASK))
 			end2 = (vaddr + (PGDIR_SIZE-1)) & PGDIR_MASK;
 		else
 			end2 = end;
@@ -121,7 +121,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
 				goto out;
 			}
 
-			if((end2 & PMD_MASK) > (vaddr & PMD_MASK)) 
+			if((end2 & PMD_MASK) > (vaddr & PMD_MASK))
 				end3 = (vaddr + (PMD_SIZE-1)) & PMD_MASK;
 			else
 				end3 = end2;
@@ -131,17 +131,17 @@ inline int dvma_map_cpu(unsigned long kaddr,
 				printk("mapping %08lx phys to %08lx\n",
 				       __pa(kaddr), vaddr);
 #endif
-				set_pte(pte, pfn_pte(virt_to_pfn(kaddr), 
+				set_pte(pte, pfn_pte(virt_to_pfn(kaddr),
 						     PAGE_KERNEL));
 				pte++;
 				kaddr += PAGE_SIZE;
 				vaddr += PAGE_SIZE;
 			} while(vaddr < end3);
-			
+
 		} while(vaddr < end2);
 
 	} while(vaddr < end);
-	
+
 	flush_tlb_all();
 
  out:
@@ -150,13 +150,13 @@ inline int dvma_map_cpu(unsigned long kaddr,
 
 
 inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
-				 int len) 
+				 int len)
 {
 	unsigned long end, index;
 
 	index = baddr >> DVMA_PAGE_SHIFT;
 	end = ((baddr+len) >> DVMA_PAGE_SHIFT);
-	
+
 	if(len & ~DVMA_PAGE_MASK)
 		end++;
 
@@ -169,12 +169,12 @@ inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
 
 		iommu_pte[index] |= IOMMU_FULL_BLOCK;
 //		dvma_entry_inc(index);
-		
+
 		kaddr += DVMA_PAGE_SIZE;
 	}
 
-#ifdef DEBUG	
-	for(index = (baddr >> DVMA_PAGE_SHIFT); index < end; index++) 
+#ifdef DEBUG
+	for(index = (baddr >> DVMA_PAGE_SHIFT); index < end; index++)
 		dvma_print(index << DVMA_PAGE_SHIFT);
 #endif
 	return 0;
@@ -185,17 +185,17 @@ void dvma_unmap_iommu(unsigned long baddr, int len)
 {
 
 	int index, end;
-	
-	
+
+
 	index = baddr >> DVMA_PAGE_SHIFT;
 	end = (DVMA_PAGE_ALIGN(baddr+len) >> DVMA_PAGE_SHIFT);
-	
+
 	for(; index < end ; index++) {
 #ifdef DEBUG
 		printk("freeing bus mapping %08x\n", index << DVMA_PAGE_SHIFT);
 #endif
 #if 0
-		if(!dvma_entry_use(index)) 
+		if(!dvma_entry_use(index))
 			printk("dvma_unmap freeing unused entry %04x\n",
 			       index);
 		else
diff --git a/arch/m68k/sun3x/prom.c b/arch/m68k/sun3x/prom.c
index e5514eaaf..574cf06df 100644
--- a/arch/m68k/sun3x/prom.c
+++ b/arch/m68k/sun3x/prom.c
@@ -119,13 +119,13 @@ void sun3x_prom_init(void)
      * XXX this is futile since we restore the vbr first - oops
      */
     vectors[VEC_TRAP14] = sun3x_prom_abort;
-    
+
     /* If debug=prom was specified, start the debug console */
 
     if (!strcmp(m68k_debug_device, "prom"))
         register_console(&sun3x_debug);
 
-    
+
 }
 
 /* some prom functions to export */
@@ -159,7 +159,7 @@ prom_get_idprom(char *idbuf, int num_bytes)
         int i;
 
 	/* make a copy of the idprom structure */
-	for(i = 0; i < num_bytes; i++) 
+	for(i = 0; i < num_bytes; i++)
 		idbuf[i] = ((char *)SUN3X_IDPROM)[i];
 
         return idbuf[0];
diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c
index d475410e6..6f4204fbe 100644
--- a/arch/m68k/sun3x/time.c
+++ b/arch/m68k/sun3x/time.c
@@ -39,12 +39,12 @@
 
 int sun3x_hwclk(int set, struct rtc_time *t)
 {
-	volatile struct mostek_dt *h = 
+	volatile struct mostek_dt *h =
 		(struct mostek_dt *)(SUN3X_EEPROM+M_CONTROL);
 	unsigned long flags;
 
 	local_irq_save(flags);
-	
+
 	if(set) {
 		h->csr |= C_WRITE;
 		h->sec = BIN2BCD(t->tm_sec);
@@ -85,16 +85,16 @@ static void sun3x_timer_tick(int irq, void *dev_id, struct pt_regs *regs)
     /* Clear the pending interrupt - pulse the enable line low */
     disable_irq(5);
     enable_irq(5);
-    
+
     vector(irq, NULL, regs);
 }
 #endif
 
 void __init sun3x_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
 {
-	
+
 	sun3_disable_interrupts();
-	
+
 
     /* Pulse enable low to get the clock started */
 	sun3_disable_irq(5);
diff --git a/arch/m68knommu/kernel/comempci.c b/arch/m68knommu/kernel/comempci.c
index 68aa14f4a..ce5dafa69 100644
--- a/arch/m68knommu/kernel/comempci.c
+++ b/arch/m68knommu/kernel/comempci.c
@@ -419,7 +419,7 @@ void pci_outw(unsigned short val, unsigned int addr)
 	volatile unsigned short	*sp;
 
 #ifdef DEBUGIO
-	printk(KERN_DEBUG "pci_outw(val=%04x,addr=%x)", val, addr);
+	printk(KERN_DEBUG "pci_outw(val=%04x,addr=%x)\n", val, addr);
 #endif
 
 	rp = (volatile unsigned long *) COMEM_BASE;
@@ -470,7 +470,7 @@ unsigned char pci_inb(unsigned int addr)
 	unsigned char		val;
 
 #ifdef DEBUGIO
-	printk(KERN_DEBUG "pci_inb(addr=%x)", addr);
+	printk(KERN_DEBUG "pci_inb(addr=%x)\n", addr);
 #endif
 
 	rp = (volatile unsigned long *) COMEM_BASE;
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c
index 7700ca82a..33e084146 100644
--- a/arch/m68knommu/kernel/m68k_ksyms.c
+++ b/arch/m68knommu/kernel/m68k_ksyms.c
@@ -68,43 +68,25 @@ EXPORT_SYMBOL(get_wchan);
  * compiler...  (prototypes are not correct though, but that
  * doesn't really matter since they're not versioned).
  */
-extern void __gcc_bcmp(void);
 extern void __ashldi3(void);
 extern void __ashrdi3(void);
-extern void __cmpdi2(void);
-extern void __divdi3(void);
 extern void __divsi3(void);
 extern void __lshrdi3(void);
-extern void __moddi3(void);
 extern void __modsi3(void);
 extern void __muldi3(void);
 extern void __mulsi3(void);
-extern void __negdi2(void);
-extern void __ucmpdi2(void);
-extern void __udivdi3(void);
-extern void __udivmoddi4(void);
 extern void __udivsi3(void);
-extern void __umoddi3(void);
 extern void __umodsi3(void);
 
         /* gcc lib functions */
-EXPORT_SYMBOL_NOVERS(__gcc_bcmp);
 EXPORT_SYMBOL_NOVERS(__ashldi3);
 EXPORT_SYMBOL_NOVERS(__ashrdi3);
-EXPORT_SYMBOL_NOVERS(__cmpdi2);
-EXPORT_SYMBOL_NOVERS(__divdi3);
 EXPORT_SYMBOL_NOVERS(__divsi3);
 EXPORT_SYMBOL_NOVERS(__lshrdi3);
-EXPORT_SYMBOL_NOVERS(__moddi3);
 EXPORT_SYMBOL_NOVERS(__modsi3);
 EXPORT_SYMBOL_NOVERS(__muldi3);
 EXPORT_SYMBOL_NOVERS(__mulsi3);
-EXPORT_SYMBOL_NOVERS(__negdi2);
-EXPORT_SYMBOL_NOVERS(__ucmpdi2);
-EXPORT_SYMBOL_NOVERS(__udivdi3);
-EXPORT_SYMBOL_NOVERS(__udivmoddi4);
 EXPORT_SYMBOL_NOVERS(__udivsi3);
-EXPORT_SYMBOL_NOVERS(__umoddi3);
 EXPORT_SYMBOL_NOVERS(__umodsi3);
 
 EXPORT_SYMBOL_NOVERS(is_in_rom);
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 6d9f428ef..581eef2b7 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -404,12 +404,6 @@ out:
 	return error;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long fp, pc;
@@ -425,7 +419,7 @@ unsigned long get_wchan(struct task_struct *p)
 		    fp >= 8184+stack_page)
 			return 0;
 		pc = ((unsigned long *)fp)[1];
-		if (pc < first_sched || pc >= last_sched)
+		if (!in_sched_functions(pc))
 			return pc;
 		fp = *(unsigned long *) fp;
 	} while (count++ < 16);
@@ -440,8 +434,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
 	struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
 
 	/* Check whether the thread is blocked in resume() */
-	if (sw->retpc > (unsigned long)scheduling_functions_start_here &&
-	    sw->retpc < (unsigned long)scheduling_functions_end_here)
+	if (in_sched_functions(sw->retpc))
 		return ((unsigned long *)sw->a6)[1];
 	else
 		return sw->retpc;
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 61fa43fa4..920bec861 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -39,6 +39,7 @@ config MACH_JAZZ
 config ACER_PICA_61
 	bool "Support for Acer PICA 1 chipset (EXPERIMENTAL)"
 	depends on MACH_JAZZ && EXPERIMENTAL
+	select DMA_NONCOHERENT
 	help
 	  This is a machine with a R4400 133/150 MHz CPU. To compile a Linux
 	  kernel that runs on these, say Y here. For details about Linux on
@@ -48,6 +49,7 @@ config ACER_PICA_61
 config MIPS_MAGNUM_4000
 	bool "Support for MIPS Magnum 4000"
 	depends on MACH_JAZZ
+	select DMA_NONCOHERENT
 	help
 	  This is a machine with a R4000 100 MHz CPU. To compile a Linux
 	  kernel that runs on these, say Y here. For details about Linux on
@@ -57,6 +59,7 @@ config MIPS_MAGNUM_4000
 config OLIVETTI_M700
 	bool "Support for Olivetti M700-10"
 	depends on MACH_JAZZ
+	select DMA_NONCOHERENT
 	help
 	  This is a machine with a R4000 100 MHz CPU. To compile a Linux
 	  kernel that runs on these, say Y here. For details about Linux on
@@ -77,23 +80,27 @@ config MACH_VR41XX
 config CASIO_E55
 	bool "Support for CASIO CASSIOPEIA E-10/15/55/65"
 	depends on MACH_VR41XX
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select ISA
 
 config IBM_WORKPAD
 	bool "Support for IBM WorkPad z50"
 	depends on MACH_VR41XX
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select ISA
 
 config NEC_EAGLE
 	bool "Support for NEC Eagle/Hawk board"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	depends on MACH_VR41XX
 
 config TANBAC_TB0226
 	bool "Support for TANBAC TB0226 (Mbase)"
 	depends on MACH_VR41XX
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	help
 	  The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by TANBAC.
@@ -102,6 +109,7 @@ config TANBAC_TB0226
 config TANBAC_TB0229
 	bool "Support for TANBAC TB0229 (VR4131DIMM)"
 	depends on MACH_VR41XX
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	help
 	  The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured by TANBAC.
@@ -109,25 +117,42 @@ config TANBAC_TB0229
 
 config VICTOR_MPC30X
 	bool "Support for Victor MP-C303/304"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	depends on MACH_VR41XX
 
 config ZAO_CAPCELLA
 	bool "Support for ZAO Networks Capcella"
 	depends on MACH_VR41XX
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 
+config VRC4171
+	tristate "add NEC VRC4171 companion chip support"
+	depends on MACH_VR41XX && ISA
+	---help---
+	  The NEC VRC4171/4171A is a companion chip for NEC VR4111/VR4121.
+
+config VRC4173
+	tristate "add NEC VRC4173 companion chip support"
+	depends on MACH_VR41XX && PCI
+	---help---
+	  The NEC VRC4173 is a companion chip for NEC VR4122/VR4131.
+
 config TOSHIBA_JMR3927
 	bool "Support for Toshiba JMR-TX3927 board"
 	depends on MIPS32
+	select DMA_NONCOHERENT
 
 config MIPS_COBALT
 	bool "Support for Cobalt Server (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 
 config MACH_DECSTATION
 	bool "Support for DECstations"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	depends on MIPS32 || EXPERIMENTAL
 	---help---
@@ -148,6 +173,7 @@ config MACH_DECSTATION
 config MIPS_EV64120
 	bool "Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	select DMA_NONCOHERENT
 	help
 	  This is an evaluation board based on the Galileo GT-64120
 	  single-chip system controller that contains a MIPS R5000 compatible
@@ -162,6 +188,7 @@ config EVB_PCI1
 config MIPS_EV96100
 	bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select MIPS_GT96100
 	select RM7000_CPU_SCACHE
@@ -173,6 +200,7 @@ config MIPS_EV96100
 
 config MIPS_IVR
 	bool "Support for Globespan IVR board"
+	select DMA_NONCOHERENT
 	help
 	  This is an evaluation board built by Globespan to showcase thir
 	  iVR (Internet Video Recorder) design. It utilizes a QED RM5231
@@ -182,6 +210,7 @@ config MIPS_IVR
 
 config LASAT
 	bool "Support for LASAT Networks platforms"
+	select DMA_NONCOHERENT
 	select R5000_CPU_SCACHE
 
 config PICVUE
@@ -203,10 +232,12 @@ config LASAT_SYSCTL
 config HP_LASERJET
 	bool "Support for Hewlett Packard LaserJet board"
 	depends on BROKEN
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 
 config MIPS_ITE8172
 	bool "Support for ITE 8172G board"
+	select DMA_NONCOHERENT
 	help
 	  Ths is an evaluation board made by ITE <http://www.ite.com.tw/>
 	  with ATX form factor that utilizes a MIPS R5000 to work with its
@@ -225,6 +256,7 @@ config IT8172_REVC
 
 config MIPS_ATLAS
 	bool "Support for MIPS Atlas board"
+	select DMA_NONCOHERENT
 	help
 	  This enables support for the QED R5231-based MIPS Atlas evaluation
 	  board.
@@ -232,17 +264,20 @@ config MIPS_ATLAS
 config MIPS_MALTA
 	bool "Support for MIPS Malta board"
 	select HAVE_STD_PC_SERIAL_PORT
+	select DMA_NONCOHERENT
 	help
 	  This enables support for the VR5000-based MIPS Malta evaluation
 	  board.
 
 config MIPS_SEAD
 	bool "Support for MIPS SEAD board (EXPERIMENTAL)"
-	select IRQ_CPU
 	depends on EXPERIMENTAL
+	select IRQ_CPU
+	select DMA_NONCOHERENT
 
 config MOMENCO_OCELOT
 	bool "Support for Momentum Ocelot board"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
 	select RM7000_CPU_SCACHE
@@ -252,6 +287,7 @@ config MOMENCO_OCELOT
 
 config MOMENCO_OCELOT_G
 	bool "Support for Momentum Ocelot-G board"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
 	select RM7000_CPU_SCACHE
@@ -261,6 +297,7 @@ config MOMENCO_OCELOT_G
 
 config MOMENCO_OCELOT_C
 	bool "Support for Momentum Ocelot-C board"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select RM7000_CPU_SCACHE
 	help
@@ -269,6 +306,7 @@ config MOMENCO_OCELOT_C
 
 config MOMENCO_JAGUAR_ATX
 	bool "Support for Momentum Jaguar board"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
 	select LIMITED_DMA
@@ -286,6 +324,7 @@ config JAGUAR_DMALOW
 
 config PMC_YOSEMITE
 	bool "Support for PMC-Sierra Yosemite eval board"
+	select DMA_NONCOHERENT
 	help
 	  Yosemite is an evaluation board for the RM9000x2 processor
 	  manufactured by PMC-Sierra
@@ -297,6 +336,7 @@ config HYPERTRANSPORT
 config DDB5074
 	bool "Support for NEC DDB Vrc-5074 (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	select DMA_NONCOHERENT
 	select HAVE_STD_PC_SERIAL_PORT
 	select IRQ_CPU
 	select ISA
@@ -306,6 +346,7 @@ config DDB5074
 
 config DDB5476
 	bool "Support for NEC DDB Vrc-5476"
+	select DMA_NONCOHERENT
 	select HAVE_STD_PC_SERIAL_PORT
 	select IRQ_CPU
 	select ISA
@@ -319,6 +360,7 @@ config DDB5476
 
 config DDB5477
 	bool "Support for NEC DDB Vrc-5477"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 	help
 	  This enables support for the R5432-based NEC DDB Vrc-5477,
@@ -334,10 +376,12 @@ config DDB5477_BUS_FREQUENCY
 	
 config NEC_OSPREY
 	bool "Support for NEC Osprey board"
+	select DMA_NONCOHERENT
 	select IRQ_CPU
 
 config SGI_IP22
 	bool "Support for SGI IP22 (Indy/Indigo2)"
+	select DMA_NONCOHERENT
 	select IP22_CPU_SCACHE
 	select IRQ_CPU
 	help
@@ -348,6 +392,7 @@ config SGI_IP22
 config SGI_IP27
 	bool "Support for SGI IP27 (Origin200/2000)"
 	depends on MIPS64
+	select DMA_IP27
 	help
 	  This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
 	  workstations.  To compile a Linux kernel that runs on these, say Y
@@ -411,6 +456,7 @@ config REPLICATE_EXHANDLERS
 config SGI_IP32
 	bool "Support for SGI IP32 (O2) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	select DMA_NONCOHERENT
 	select R5000_CPU_SCACHE
 	select RM7000_CPU_SCACHE
 	help
@@ -452,30 +498,37 @@ choice
 config MIPS_PB1000
 	bool "PB1000 board"
 	depends on SOC_AU1000
+	select DMA_NONCOHERENT
 
 config MIPS_PB1100
 	bool "PB1100 board"
 	depends on SOC_AU1100
+	select DMA_NONCOHERENT
 
 config MIPS_PB1500
 	bool "PB1500 board"
 	depends on SOC_AU1500
+	select DMA_NONCOHERENT
 
 config MIPS_PB1550
 	bool "PB1550 board"
 	depends on SOC_AU1550
+	select DMA_NONCOHERENT
 
 config MIPS_DB1000
 	bool "DB1000 board"
 	depends on SOC_AU1000
+	select DMA_NONCOHERENT
 
 config MIPS_DB1100
 	bool "DB1100 board"
 	depends on SOC_AU1100
+	select DMA_NONCOHERENT
 
 config MIPS_DB1500
 	bool "DB1500 board"
 	depends on SOC_AU1500
+	select DMA_NONCOHERENT
 
 config MIPS_DB1550
 	bool "DB1550 board"
@@ -484,24 +537,29 @@ config MIPS_DB1550
 config MIPS_BOSPORUS
 	bool "Bosporus board"
 	depends on SOC_AU1500
+	select DMA_NONCOHERENT
 
 config MIPS_MIRAGE
 	bool "Mirage board"
 	depends on SOC_AU1500
+	select DMA_NONCOHERENT
 
 config MIPS_XXS1500
 	bool "MyCable XXS1500 board"
 	depends on SOC_AU1500
+	select DMA_NONCOHERENT
 
 config MIPS_MTX1
 	bool "4G Systems MTX-1 board"
 	depends on SOC_AU1500
+	select DMA_NONCOHERENT
 
 endchoice
 
 config SIBYTE_SB1xxx_SOC
 	bool "Support for Broadcom BCM1xxx SOCs (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
+	select DMA_COHERENT
 
 choice
 	prompt "BCM1xxx SOC-based board"
@@ -710,6 +768,7 @@ config SIBYTE_TBPROF
 
 config SNI_RM200_PCI
 	bool "Support for SNI RM200 PCI"
+	select DMA_NONCOHERENT
 	select HAVE_STD_PC_SERIAL_PORT
 	select ISA
 	help
@@ -720,8 +779,9 @@ config SNI_RM200_PCI
 
 config TOSHIBA_RBTX4927
 	bool "Support for Toshiba TBTX49[23]7 board"
-	select ISA
 	depends on MIPS32
+	select DMA_NONCOHERENT
+	select ISA
 
 config RWSEM_GENERIC_SPINLOCK
 	bool
@@ -744,18 +804,12 @@ config ARC
 
 config	DMA_COHERENT
 	bool
-	depends on SIBYTE_SB1xxx_SOC
-	default y
 
 config	DMA_IP27
 	bool
-	depends on SGI_IP27
-	default y
 
 config	DMA_NONCOHERENT
 	bool
-	depends on ZAO_CAPCELLA || VICTOR_MPC30X || TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 || SNI_RM200_PCI || SGI_IP32 || SGI_IP22 || NEC_EAGLE || NEC_OSPREY || DDB5477 || DDB5476 || DDB5074 || MOMENCO_OCELOT || MOMENCO_OCELOT_C || MOMENCO_OCELOT_G || MOMENCO_JAGUAR_ATX || MIPS_BOSPORUS || MIPS_DB1000 || MIPS_DB1100 || MIPS_DB1500 || MIPS_SEAD || MIPS_MALTA || MIPS_MAGNUM_4000 || MIPS_MIRAGE || MIPS_MTX1 || MIPS_XXS1500 || OLIVETTI_M700 || MIPS_ATLAS || LASAT || MIPS_ITE8172 || IBM_WORKPAD || HP_LASERJET || MIPS_IVR || MIPS_EV96100 || MIPS_EV64120 || MACH_DECSTATION || MIPS_COBALT || MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000 || MIPS_PB1550 || CASIO_E55 || ACER_PICA_61 || TANBAC_TB0226 || TANBAC_TB0229
-	default y
 
 config EARLY_PRINTK
 	bool
@@ -811,14 +865,6 @@ config DUMMY_KEYB
 	depends on ZAO_CAPCELLA || VICTOR_MPC30X || SIBYTE_SB1xxx_SOC || NEC_EAGLE || NEC_OSPREY || DDB5477 || CASIO_E55 || TANBAC_TB0226 || TANBAC_TB0229
 	default y
 
-config VRC4171
-	tristate "NEC VRC4171 Support"
-	depends on IBM_WORKPAD
-
-config VRC4173
-	tristate "NEC VRC4173 Support"
-	depends on NEC_EAGLE || VICTOR_MPC30X
-
 config DDB5XXX_COMMON
 	bool
 	depends on DDB5074 || DDB5476 || DDB5477
@@ -1170,7 +1216,7 @@ config SIBYTE_DMA_PAGEOPS
 
 config CPU_HAS_PREFETCH
 	bool "Enable prefetches" if CPU_SB1 && !CPU_SB1_PASS_2
-	default y if CPU_MIPS32 || CPU_MIPS64 || CPU_RM7000 || CPU_RM9000
+	default y if CPU_MIPS32 || CPU_MIPS64 || CPU_RM7000 || CPU_RM9000 || CPU_R10000
 
 config VTAG_ICACHE
 	bool "Support for Virtual Tagged I-cache" if CPU_MIPS64 || CPU_MIPS32
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 51b0add5a..8c4fb4b1d 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -686,7 +686,7 @@ vmlinux.64: vmlinux
 		--change-addresses=0xa800000080000000 $< $@
 endif
 
-makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/mips/boot $(1)
+makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot $(1)
 
 ifdef CONFIG_SGI_IP27
 all:	vmlinux.64
@@ -708,9 +708,9 @@ CLEAN_FILES += vmlinux.ecoff \
 	       vmlinux.rm200
 
 archclean:
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/boot
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/baget
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/lasat
+	@$(MAKE) $(clean)=arch/mips/boot
+	@$(MAKE) $(clean)=arch/mips/baget
+	@$(MAKE) $(clean)=arch/mips/lasat
 
 # Generate <asm/offset.h 
 #
diff --git a/arch/mips/au1000/common/Makefile b/arch/mips/au1000/common/Makefile
index 627a6a1b8..f228e8eee 100644
--- a/arch/mips/au1000/common/Makefile
+++ b/arch/mips/au1000/common/Makefile
@@ -7,7 +7,7 @@
 #
 
 obj-y += prom.o int-handler.o irq.o puts.o time.o reset.o \
-	au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o
+	au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o cputable.o
 
 obj-$(CONFIG_AU1X00_USB_DEVICE)	+= usbdev.o
 obj-$(CONFIG_KGDB)		+= dbg_io.o
diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c
index d9af49ff2..d9ec5876e 100644
--- a/arch/mips/au1000/common/power.c
+++ b/arch/mips/au1000/common/power.c
@@ -320,7 +320,7 @@ static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
 	unsigned long val, pll;
 #define TMPBUFLEN 64
 #define MAX_CPU_FREQ 396
-	char buf[8], *p;
+	char buf[TMPBUFLEN], *p;
 	unsigned long flags, intc0_mask, intc1_mask;
 	unsigned long old_baud_base, old_cpu_freq, baud_rate, old_clk,
 	    old_refresh;
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index b45c2142e..d4c92fa67 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -65,40 +65,20 @@ extern void au1xxx_timer_setup(struct irqaction *irq);
 
 static int __init au1x00_setup(void)
 {
+	struct	cpu_spec *sp;
 	char *argptr;
 	unsigned long prid, cpupll, bclk = 1;
 
-	/* Various early Au1000 Errata corrected by this */
-	set_c0_config(1<<19); /* Config[OD] */
+	set_cpuspec();
+	sp = cur_cpu_spec[0];
 
 	board_setup();  /* board specific setup */
 
 	prid = read_c0_prid();
-	switch (prid)
-	{
-		case 0x00030100: printk("Au1000 DA "); bclk = 0; break;
-	 	case 0x00030201: printk("Au1000 HA "); bclk = 0; break;
-		case 0x00030202: printk("Au1000 HB "); bclk = 0; break;
-		case 0x00030203: printk("Au1000 HC "); break;
-		case 0x00030204: printk("Au1000 HD "); break;
-
-		case 0x01030200: printk("Au1500 AB "); break;
-		case 0x01030201: printk("Au1500 AC "); break;
-		case 0x01030202: printk("Au1500 AD "); break;
-
-		case 0x02030200: printk("Au1100 AB "); break;
-		case 0x02030201: printk("Au1100 BA "); break;
-		case 0x02030202: printk("Au1100 BC "); break;
-		case 0x02030203: printk("Au1100 BD "); break;
-		case 0x02030204: printk("Au1100 BE "); break;
-
-		case 0x03030200: printk("Au1550 AA "); break;
-
-		default: printk("Unknown Au1x00! "); bclk = 0; break;
-	}
 	cpupll = (au_readl(0xB1900060) & 0x3F) * 12;
 	printk("(PRId %08X) @ %dMHZ\n", prid, cpupll);
 
+	bclk = sp->cpu_bclk;
 	if (bclk)
 	{
 		/* Enable BCLK switching */
@@ -107,6 +87,15 @@ static int __init au1x00_setup(void)
 		printk("BCLK switching enabled!\n");
 	}
 
+	if (sp->cpu_od) {
+		/* Various early Au1000 Errata corrected by this */
+		set_c0_config(1<<19); /* Set Config[OD] */
+	}
+	else {
+		/* Clear to obtain best system bus performance */
+		clear_c0_config(1<<19); /* Clear Config[OD] */
+ 	}
+
 	argptr = prom_getcmdline();
 
 #ifdef CONFIG_SERIAL_AU1X00_CONSOLE
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 9519ed93c..9814c8e6d 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -289,8 +292,6 @@ CONFIG_IP_PNP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -300,7 +301,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -321,18 +324,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -359,7 +367,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -367,10 +374,12 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -378,36 +387,18 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wan interfaces
 #
-# CONFIG_TR is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
 #
 # ISDN subsystem
 #
@@ -582,6 +573,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/bosporus_defconfig b/arch/mips/configs/bosporus_defconfig
index 63b54f995..edf9ced7a 100644
--- a/arch/mips/configs/bosporus_defconfig
+++ b/arch/mips/configs/bosporus_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -231,8 +234,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -253,7 +254,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -274,6 +277,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -294,31 +302,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -334,21 +326,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -531,6 +522,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 6671d5ad1..910a796df 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -56,6 +59,7 @@ CONFIG_MACH_VR41XX=y
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
 CONFIG_ZAO_CAPCELLA=y
+# CONFIG_VRC4173 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -251,8 +255,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -262,7 +264,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -283,18 +287,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -321,7 +330,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -329,45 +337,29 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -555,6 +547,7 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 873506244..a653f0297 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -240,8 +243,6 @@ CONFIG_INET=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -251,7 +252,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -272,18 +275,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -310,7 +318,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -318,45 +325,29 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -535,6 +526,7 @@ CONFIG_FS_POSIX_ACL=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index df61181aa..fbb3ecda0 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -250,8 +253,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -272,7 +273,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -293,6 +296,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -314,31 +322,15 @@ CONFIG_MIPS_AU1X00_ENET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -354,21 +346,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -557,6 +548,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 897591b90..088b3a106 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -249,8 +252,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -271,7 +272,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -292,6 +295,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -313,31 +321,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -353,21 +345,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -553,6 +544,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index 525c637ae..86ecbe185 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -329,8 +332,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -351,7 +352,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -372,6 +375,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -393,31 +401,15 @@ CONFIG_MIPS_AU1X00_ENET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -433,21 +425,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -627,6 +618,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index baa0a7d25..5f74857ae 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -251,8 +254,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -262,7 +263,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -283,18 +286,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -328,7 +336,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -336,45 +343,29 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -573,6 +564,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index 73d11f597..13222c363 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -221,8 +224,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -232,7 +233,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -253,18 +256,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -310,7 +318,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -318,45 +325,29 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -532,6 +523,7 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index a0e5edb30..9f41a3d0f 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -247,8 +250,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -258,7 +259,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -279,6 +282,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -300,41 +308,24 @@ CONFIG_DECLANCE=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -511,6 +502,7 @@ CONFIG_FS_POSIX_ACL=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index 4b0c15d01..b0154fa60 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -56,6 +59,7 @@ CONFIG_CASIO_E55=y
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
 # CONFIG_ZAO_CAPCELLA is not set
+# CONFIG_VRC4171 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -246,8 +250,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -257,7 +259,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -278,18 +282,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -313,42 +322,25 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
 
 #
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -535,6 +527,7 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/eagle_defconfig b/arch/mips/configs/eagle_defconfig
index 5f89bba7b..9a4517f6a 100644
--- a/arch/mips/configs/eagle_defconfig
+++ b/arch/mips/configs/eagle_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -56,6 +59,7 @@ CONFIG_NEC_EAGLE=y
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
 # CONFIG_ZAO_CAPCELLA is not set
+CONFIG_VRC4173=y
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -88,7 +92,6 @@ CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_DUMMY_KEYB=y
-CONFIG_VRC4173=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -329,8 +332,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -340,7 +341,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -361,18 +364,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -399,7 +407,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -407,28 +414,17 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -444,21 +440,16 @@ CONFIG_PCMCIA_PCNET=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -652,6 +643,7 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index adea411d0..2cbeb69b9 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -227,8 +230,6 @@ CONFIG_IP_PNP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -238,7 +239,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -259,18 +262,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -297,7 +305,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -305,6 +312,22 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 CONFIG_PPP=y
@@ -316,42 +339,10 @@ CONFIG_PPP_ASYNC=y
 # CONFIG_PPP_BSDCOMP is not set
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
 #
 # ISDN subsystem
 #
@@ -526,6 +517,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index 6e5626ee2..4d6bd5352 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -220,8 +223,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -231,7 +232,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -252,6 +255,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -273,41 +281,24 @@ CONFIG_MIPS_GT96100ETH=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -481,6 +472,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index c2e797233..bbd6215cc 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
@@ -32,6 +34,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -298,8 +301,6 @@ CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_TUNNEL=m
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -359,6 +360,8 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # IPv6: Netfilter Configuration
@@ -382,6 +385,7 @@ CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_LOG=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_MARK=m
+CONFIG_IP6_NF_RAW=m
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 
@@ -395,7 +399,9 @@ CONFIG_IP_SCTP=m
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -440,6 +446,11 @@ CONFIG_NET_CLS_POLICE=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
@@ -461,41 +472,24 @@ CONFIG_SGISEEQ=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -709,6 +703,7 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 68619109f..c7cff248c 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -17,8 +17,10 @@ CONFIG_STANDALONE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
@@ -30,6 +32,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -112,6 +115,7 @@ CONFIG_CPU_R10000=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_LLDSCD=y
 CONFIG_CPU_HAS_SYNC=y
@@ -206,7 +210,7 @@ CONFIG_SCSI_LOGGING=y
 #
 # SCSI Transport Attributes
 #
-CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_FC_ATTRS is not set
 
 #
@@ -293,8 +297,6 @@ CONFIG_IP_PNP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -304,7 +306,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -320,46 +324,51 @@ CONFIG_XFRM=y
 # QoS and/or fair queueing
 #
 CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_CBQ=m
-CONFIG_NET_SCH_HTB=m
-CONFIG_NET_SCH_HFSC=m
-CONFIG_NET_SCH_CSZ=m
-CONFIG_NET_SCH_PRIO=m
-CONFIG_NET_SCH_RED=m
-CONFIG_NET_SCH_SFQ=m
-CONFIG_NET_SCH_TEQL=m
-CONFIG_NET_SCH_TBF=m
-CONFIG_NET_SCH_GRED=m
-CONFIG_NET_SCH_DSMARK=m
-CONFIG_NET_SCH_DELAY=m
+CONFIG_NET_SCH_CBQ=y
+CONFIG_NET_SCH_HTB=y
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_CSZ=y
+CONFIG_NET_SCH_PRIO=y
+CONFIG_NET_SCH_RED=y
+CONFIG_NET_SCH_SFQ=y
+CONFIG_NET_SCH_TEQL=y
+CONFIG_NET_SCH_TBF=y
+CONFIG_NET_SCH_GRED=y
+CONFIG_NET_SCH_DSMARK=y
+CONFIG_NET_SCH_DELAY=y
 CONFIG_NET_QOS=y
 CONFIG_NET_ESTIMATOR=y
 CONFIG_NET_CLS=y
-CONFIG_NET_CLS_TCINDEX=m
-CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_TCINDEX=y
+CONFIG_NET_CLS_ROUTE4=y
 CONFIG_NET_CLS_ROUTE=y
-CONFIG_NET_CLS_FW=m
-CONFIG_NET_CLS_U32=m
-CONFIG_NET_CLS_RSVP=m
-CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_FW=y
+CONFIG_NET_CLS_U32=y
+CONFIG_NET_CLS_RSVP=y
+CONFIG_NET_CLS_RSVP6=y
 CONFIG_NET_CLS_POLICE=y
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -389,7 +398,6 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -397,45 +405,29 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -602,6 +594,7 @@ CONFIG_AUTOFS_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
@@ -691,27 +684,27 @@ CONFIG_CMDLINE=""
 #
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_HMAC=y
-CONFIG_CRYPTO_NULL=m
-CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_SHA1=m
-CONFIG_CRYPTO_SHA256=m
-CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_DES=y
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_AES=m
-CONFIG_CRYPTO_CAST5=m
-CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_ARC4=m
-CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_BLOWFISH=y
+CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_SERPENT=y
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_CAST5=y
+CONFIG_CRYPTO_CAST6=y
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
 CONFIG_CRC32=y
-CONFIG_ZLIB_INFLATE=m
-CONFIG_ZLIB_DEFLATE=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index ad767e800..7dcbf62c9 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -18,8 +18,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -30,6 +32,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -289,8 +292,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -300,7 +301,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -321,18 +324,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -360,7 +368,6 @@ CONFIG_SGI_O2MACE_ETH=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -368,45 +375,29 @@ CONFIG_SGI_O2MACE_ETH=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -583,6 +574,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index 00fe90087..d7f83618a 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -294,8 +297,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -305,7 +306,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -326,6 +329,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -346,41 +354,24 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -580,6 +571,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index 906332cac..58a83eece 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -245,8 +248,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -256,7 +257,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -277,18 +280,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -315,7 +323,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -323,45 +330,29 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -538,6 +529,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index ae4e50e97..99cda767b 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -21,6 +21,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
@@ -32,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -219,10 +221,10 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -236,16 +238,21 @@ CONFIG_IP_PNP_BOOTP=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -299,14 +306,7 @@ CONFIG_MV64340_ETH_2=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
@@ -314,26 +314,17 @@ CONFIG_MV64340_ETH_2=y
 # CONFIG_TR is not set
 
 #
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
 
 #
 # ISDN subsystem
@@ -483,6 +474,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 1a31fff82..95e463724 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -219,8 +222,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -230,7 +231,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -251,18 +254,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -289,7 +297,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -297,45 +304,29 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -547,6 +538,7 @@ CONFIG_DUMMY_CONSOLE=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index 55171546c..f7208748c 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -334,8 +337,6 @@ CONFIG_INET=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -345,7 +346,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -366,16 +369,21 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -403,7 +411,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -411,45 +418,29 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -630,6 +621,7 @@ CONFIG_FS_MBCACHE=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index 577096e74..67a995528 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -233,8 +236,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -244,7 +245,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -265,18 +268,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -322,7 +330,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -330,45 +337,29 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -543,6 +534,7 @@ CONFIG_AUTOFS_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/mirage_defconfig b/arch/mips/configs/mirage_defconfig
index 63b54f995..edf9ced7a 100644
--- a/arch/mips/configs/mirage_defconfig
+++ b/arch/mips/configs/mirage_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -231,8 +234,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -253,7 +254,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -274,6 +277,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -294,31 +302,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -334,21 +326,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -531,6 +522,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 382c271da..3ccf5a617 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -56,6 +59,7 @@ CONFIG_MACH_VR41XX=y
 # CONFIG_TANBAC_TB0229 is not set
 CONFIG_VICTOR_MPC30X=y
 # CONFIG_ZAO_CAPCELLA is not set
+CONFIG_VRC4173=y
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -88,7 +92,6 @@ CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_DUMMY_KEYB=y
-CONFIG_VRC4173=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -123,7 +126,9 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
-# CONFIG_PCI is not set
+CONFIG_PCI=y
+CONFIG_PCI_LEGACY_PROC=y
+CONFIG_PCI_NAMES=y
 CONFIG_MMU=y
 
 #
@@ -159,8 +164,13 @@ CONFIG_TRAD_SIGNALS=y
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -182,6 +192,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Fusion MPT device support
 #
+# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -191,6 +202,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -221,8 +233,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -232,7 +242,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -253,6 +265,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -260,54 +277,67 @@ CONFIG_NETDEVICES=y
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
 
 #
-# Ethernet (1000 Mbit)
+# Tulip family network device support
 #
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
 
 #
-# Ethernet (10000 Mbit)
+# Ethernet (1000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Ethernet (10000 Mbit)
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
+# CONFIG_TR is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -345,6 +375,7 @@ CONFIG_SERIO=y
 CONFIG_SERIO_I8042=y
 CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
 
 #
 # Input Device Drivers
@@ -442,6 +473,7 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # USB support
 #
+# CONFIG_USB is not set
 
 #
 # USB Gadget Support
@@ -481,6 +513,7 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index 63b54f995..edf9ced7a 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -231,8 +234,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -253,7 +254,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -274,6 +277,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -294,31 +302,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -334,21 +326,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -531,6 +522,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index 9b6587f89..f33d867cc 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -18,8 +18,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -30,6 +32,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -210,8 +213,6 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -221,7 +222,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -242,6 +245,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -266,41 +274,24 @@ CONFIG_MV64340_ETH_0=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -474,6 +465,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index cf51c3998..c3d713ac4 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -218,8 +221,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -229,7 +230,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -250,6 +253,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -270,41 +278,24 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -478,6 +469,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/osprey_defconfig b/arch/mips/configs/osprey_defconfig
index 91d09df54..6d6e26201 100644
--- a/arch/mips/configs/osprey_defconfig
+++ b/arch/mips/configs/osprey_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -212,8 +215,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -223,7 +224,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -244,6 +247,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -264,41 +272,24 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -472,6 +463,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/pb1000_defconfig b/arch/mips/configs/pb1000_defconfig
index 63b54f995..edf9ced7a 100644
--- a/arch/mips/configs/pb1000_defconfig
+++ b/arch/mips/configs/pb1000_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -231,8 +234,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -253,7 +254,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -274,6 +277,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -294,31 +302,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -334,21 +326,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -531,6 +522,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 63b54f995..edf9ced7a 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -231,8 +234,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -253,7 +254,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -274,6 +277,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -294,31 +302,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -334,21 +326,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -531,6 +522,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 11a133051..533dc53ae 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -315,8 +318,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -337,7 +338,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -358,18 +361,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -397,7 +405,6 @@ CONFIG_MIPS_AU1X00_ENET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -405,35 +412,17 @@ CONFIG_MIPS_AU1X00_ENET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -449,21 +438,23 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -646,6 +637,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index 4d6eed123..ad953c3a9 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -314,8 +317,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -336,7 +337,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -357,18 +360,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -396,7 +404,6 @@ CONFIG_MIPS_AU1X00_ENET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -404,35 +411,17 @@ CONFIG_MIPS_AU1X00_ENET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -448,21 +437,23 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -645,6 +636,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 00fa01d80..2317b23ed 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
@@ -32,6 +34,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -250,7 +253,7 @@ CONFIG_SCSI_CONSTANTS=y
 #
 # SCSI Transport Attributes
 #
-CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_FC_ATTRS is not set
 
 #
@@ -385,10 +388,6 @@ CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_TUNNEL=m
-CONFIG_DECNET=m
-# CONFIG_DECNET_SIOCGIFCONF is not set
-# CONFIG_DECNET_ROUTER is not set
-CONFIG_BRIDGE=m
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 CONFIG_BRIDGE_NETFILTER=y
@@ -450,6 +449,8 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # IPv6: Netfilter Configuration
@@ -473,6 +474,7 @@ CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_LOG=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_MARK=m
+CONFIG_IP6_NF_RAW=m
 
 #
 # DECnet: Netfilter Configuration
@@ -509,7 +511,11 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+CONFIG_BRIDGE=m
 # CONFIG_VLAN_8021Q is not set
+CONFIG_DECNET=m
+# CONFIG_DECNET_SIOCGIFCONF is not set
+# CONFIG_DECNET_ROUTER is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -554,18 +560,45 @@ CONFIG_NET_CLS_POLICE=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-CONFIG_NETDEVICES=y
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+CONFIG_HAMRADIO=y
 
 #
-# ARCnet devices
+# Packet Radio protocols
 #
-# CONFIG_ARCNET is not set
+CONFIG_AX25=m
+CONFIG_AX25_DAMA_SLAVE=y
+CONFIG_NETROM=m
+CONFIG_ROSE=m
+
+#
+# AX.25 network device drivers
+#
+CONFIG_MKISS=m
+CONFIG_6PACK=m
+CONFIG_BPQETHER=m
+# CONFIG_DMASCC is not set
+# CONFIG_SCC is not set
+# CONFIG_BAYCOM_SER_FDX is not set
+# CONFIG_BAYCOM_SER_HDX is not set
+# CONFIG_BAYCOM_PAR is not set
+# CONFIG_BAYCOM_EPP is not set
+# CONFIG_YAM is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
 CONFIG_EQUALIZER=m
 CONFIG_TUN=m
 CONFIG_ETHERTAP=m
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -633,7 +666,6 @@ CONFIG_EEPRO100=m
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -641,11 +673,12 @@ CONFIG_EEPRO100=m
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PLIP=m
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -653,58 +686,19 @@ CONFIG_PLIP=m
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wan interfaces
 #
-# CONFIG_TR is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PLIP=m
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-CONFIG_HAMRADIO=y
-
-#
-# Packet Radio protocols
-#
-CONFIG_AX25=m
-CONFIG_AX25_DAMA_SLAVE=y
-CONFIG_NETROM=m
-CONFIG_ROSE=m
-
-#
-# AX.25 network device drivers
-#
-# CONFIG_MKISS is not set
-# CONFIG_6PACK is not set
-CONFIG_BPQETHER=m
-# CONFIG_DMASCC is not set
-# CONFIG_SCC is not set
-# CONFIG_BAYCOM_SER_FDX is not set
-# CONFIG_BAYCOM_SER_HDX is not set
-# CONFIG_BAYCOM_PAR is not set
-# CONFIG_BAYCOM_EPP is not set
-# CONFIG_YAM is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
 #
 # ISDN subsystem
 #
@@ -873,6 +867,7 @@ CONFIG_USB_DEVICEFS=y
 #
 CONFIG_USB_EHCI_HCD=m
 # CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 CONFIG_USB_OHCI_HCD=m
 CONFIG_USB_UHCI_HCD=m
 
@@ -1019,7 +1014,8 @@ CONFIG_USB_AUERSWALD=m
 CONFIG_USB_RIO500=m
 CONFIG_USB_LEGOTOWER=m
 CONFIG_USB_LCD=m
-# CONFIG_USB_LED is not set
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
 CONFIG_USB_TEST=m
 
 #
@@ -1031,9 +1027,11 @@ CONFIG_USB_NET2280=m
 # CONFIG_USB_GADGET_PXA2XX is not set
 # CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_SA1100 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_ZERO=m
 CONFIG_USB_ETH=m
+# CONFIG_USB_ETH_RNDIS is not set
 CONFIG_USB_GADGETFS=m
 # CONFIG_USB_FILE_STORAGE is not set
 # CONFIG_USB_G_SERIAL is not set
@@ -1093,6 +1091,7 @@ CONFIG_NTFS_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
@@ -1152,7 +1151,7 @@ CONFIG_NCPFS_NLS=y
 CONFIG_NCPFS_EXTRAS=y
 CONFIG_CODA_FS=m
 CONFIG_CODA_FS_OLD_API=y
-# CONFIG_INTERMEZZO_FS is not set
+CONFIG_INTERMEZZO_FS=m
 CONFIG_AFS_FS=m
 CONFIG_RXRPC=m
 
@@ -1252,7 +1251,7 @@ CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_TEST=m
 
 #
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index dca18e189..593f119b4 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -18,8 +18,10 @@ CONFIG_STANDALONE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -30,6 +32,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -265,8 +268,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -276,7 +277,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -297,18 +300,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -336,7 +344,6 @@ CONFIG_NET_SB1250_MAC=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -344,45 +351,29 @@ CONFIG_NET_SB1250_MAC=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -424,6 +415,7 @@ CONFIG_SERIO_SERPORT=y
 # CONFIG_VT is not set
 CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
 # CONFIG_SYNCLINK is not set
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
@@ -541,6 +533,7 @@ CONFIG_FS_POSIX_ACL=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index d6de04f90..ba93024bf 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 # CONFIG_SYSVIPC is not set
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -194,11 +197,6 @@ CONFIG_BLK_DEV_INITRD=y
 # Networking support
 #
 # CONFIG_NET is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
 
@@ -376,6 +374,7 @@ CONFIG_FS_POSIX_ACL=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index ce327a8c0..f32841b80 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -282,8 +285,6 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -291,7 +292,9 @@ CONFIG_SYN_COOKIES=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -312,6 +315,11 @@ CONFIG_SYN_COOKIES=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -332,48 +340,31 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -569,6 +560,7 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index 21d4f52ef..730a994ab 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -56,6 +59,7 @@ CONFIG_MACH_VR41XX=y
 CONFIG_TANBAC_TB0229=y
 # CONFIG_VICTOR_MPC30X is not set
 # CONFIG_ZAO_CAPCELLA is not set
+# CONFIG_VRC4173 is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -239,8 +243,6 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -250,7 +252,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -271,18 +275,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -309,7 +318,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -317,6 +325,22 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 CONFIG_PPP=m
@@ -331,42 +355,10 @@ CONFIG_SLIP=m
 CONFIG_SLIP_COMPRESSED=y
 CONFIG_SLIP_SMART=y
 CONFIG_SLIP_MODE_SLIP6=y
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
 #
 # ISDN subsystem
 #
@@ -559,6 +551,7 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 1113fb0bd..cfe12d1c4 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -56,6 +59,7 @@ CONFIG_IBM_WORKPAD=y
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
 # CONFIG_ZAO_CAPCELLA is not set
+CONFIG_VRC4171=y
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -87,7 +91,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_VRC4171=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -246,8 +249,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
@@ -257,7 +258,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -278,18 +281,23 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -313,42 +321,25 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
 
 #
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -539,6 +530,7 @@ CONFIG_AUTOFS4_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/xxs1500_defconfig b/arch/mips/configs/xxs1500_defconfig
index 63b54f995..edf9ced7a 100644
--- a/arch/mips/configs/xxs1500_defconfig
+++ b/arch/mips/configs/xxs1500_defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -231,8 +234,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -253,7 +254,9 @@ CONFIG_XFRM=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -274,6 +277,11 @@ CONFIG_XFRM=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -294,31 +302,15 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
 
 #
 # Token Ring devices
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -334,21 +326,20 @@ CONFIG_PCMCIA_3C589=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -531,6 +522,7 @@ CONFIG_AUTOFS4_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index 33631948e..fc1eddbbd 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -18,8 +18,10 @@ CONFIG_STANDALONE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
@@ -31,6 +33,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -251,8 +254,6 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -260,7 +261,9 @@ CONFIG_IP_PNP_DHCP=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -281,6 +284,11 @@ CONFIG_IP_PNP_DHCP=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -300,41 +308,24 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -375,6 +366,7 @@ CONFIG_SERIO_SERPORT=y
 # CONFIG_VT is not set
 CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
 # CONFIG_SYNCLINK is not set
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
@@ -489,6 +481,7 @@ CONFIG_FS_MBCACHE=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index c2e797233..bbd6215cc 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -19,8 +19,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
@@ -32,6 +34,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -298,8 +301,6 @@ CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_TUNNEL=m
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -359,6 +360,8 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # IPv6: Netfilter Configuration
@@ -382,6 +385,7 @@ CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_LOG=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_TARGET_MARK=m
+CONFIG_IP6_NF_RAW=m
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 
@@ -395,7 +399,9 @@ CONFIG_IP_SCTP=m
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -440,6 +446,11 @@ CONFIG_NET_CLS_POLICE=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
@@ -461,41 +472,24 @@ CONFIG_SGISEEQ=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -709,6 +703,7 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 CONFIG_DEVPTS_FS_SECURITY=y
diff --git a/arch/mips/gt64120/momenco_ocelot/prom.c b/arch/mips/gt64120/momenco_ocelot/prom.c
index 94dc30cec..8677b6d3a 100644
--- a/arch/mips/gt64120/momenco_ocelot/prom.c
+++ b/arch/mips/gt64120/momenco_ocelot/prom.c
@@ -14,17 +14,7 @@
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-
-struct callvectors {
-	int	(*open) (char*, int, int);
-	int	(*close) (int);
-	int	(*read) (int, void*, int);
-	int	(*write) (int, void*, int);
-	off_t	(*lseek) (int, off_t, int);
-	int	(*printf) (const char*, ...);
-	void	(*cacheflush) (void);
-	char*	(*gets) (char*);
-};
+#include <asm/pmon.h>
 
 struct callvectors* debug_vectors;
 
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index f37209d5a..c1f842291 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -114,11 +114,13 @@ FEXPORT(syscall_exit_work_partial)
 	SAVE_STATIC
 FEXPORT(syscall_exit_work)
 	LONG_L	t0, TI_FLAGS($28)
-	li	t1, _TIF_SYSCALL_TRACE
+	li	t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
 	and	t0, t1
 	beqz	t0, work_pending	# trace bit is set
 	local_irq_enable		# could let do_syscall_trace()
 					# call schedule() instead
+	move	a0, sp
+	li	a1, 1
 	jal	do_syscall_trace
 	b	resume_userspace
 
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 6a2b36236..dc9f7924e 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -1130,7 +1130,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
 	psinfo.pr_pid = prstatus.pr_pid = current->pid;
 	psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid;
 	psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current);
-	psinfo.pr_sid = prstatus.pr_sid = current->session;
+	psinfo.pr_sid = prstatus.pr_sid = current->signal->session;
 	prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime);
 	prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime);
 	prstatus.pr_stime.tv_sec = CT_TO_SECS(current->stime);
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index 223ca36ab..b15f3b0de 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -13,12 +13,11 @@
 #include <linux/smp_lock.h>
 #include <linux/time.h>
 #include <linux/ptrace.h>
+#include <linux/suspend.h>
 
 #include <asm/ptrace.h>
 #include <asm/uaccess.h>
 
-extern asmlinkage void do_syscall_trace(void);
-
 #undef DEBUG_SIG
 
 #define _S(nr) (1<<((nr)-1))
@@ -177,6 +176,19 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
 	siginfo_t info;
 	int signr;
 
+	/*
+	 * We want the common case to go fast, which is why we may in certain
+	 * cases get here from kernel mode. Just return without doing anything
+	 * if so.
+	 */
+	if (!user_mode(regs))
+		return 1;
+
+	if (current->flags & PF_FREEZE) {
+		refrigerator(0);
+		goto no_signal;
+	}
+
 	if (!oldset)
 		oldset = &current->blocked;
 
@@ -186,6 +198,7 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
 		return 1;
 	}
 
+no_signal:
 	/*
 	 * Who's code doesn't conform to the restartable syscall convention
 	 * dies here!!!  The li instruction, a single machine instruction,
@@ -263,7 +276,7 @@ irix_sigreturn(struct pt_regs *regs)
 	 * Don't let your children do this ...
 	 */
 	if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
-		do_syscall_trace();
+		do_syscall_trace(regs, 1);
 	__asm__ __volatile__(
 		"move\t$29,%0\n\t"
 		"j\tsyscall_exit"
@@ -536,7 +549,7 @@ out:
 #define P_PGID   2
 #define P_ALL    7
 
-extern int getrusage(struct task_struct *, int, struct rusage *);
+extern int getrusage(struct task_struct *, int, struct rusage __user *);
 
 #define W_EXITED     1
 #define W_TRAPPED    2
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 06813fe22..bcb3e0c5a 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -141,228 +141,6 @@ asmlinkage int sys_ftruncate64(unsigned int fd, unsigned int high,
 	return sys_ftruncate(fd, ((long) high << 32) | low);
 }
 
-/*
- * count32() counts the number of arguments/envelopes
- */
-static int count32(u32 * argv, int max)
-{
-	int i = 0;
-
-	if (argv != NULL) {
-		for (;;) {
-			u32 p; int error;
-
-			error = get_user(p,argv);
-			if (error)
-				return error;
-			if (!p)
-				break;
-			argv++;
-			if (++i > max)
-				return -E2BIG;
-		}
-	}
-	return i;
-}
-
-
-/*
- * 'copy_strings32()' copies argument/envelope strings from user
- * memory to free pages in kernel mem. These are in a format ready
- * to be put directly into the top of new user memory.
- */
-int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm)
-{
-	struct page *kmapped_page = NULL;
-	char *kaddr = NULL;
-	int ret;
-
-	while (argc-- > 0) {
-		u32 str;
-		int len;
-		unsigned long pos;
-
-		if (get_user(str, argv+argc) || !str ||
-		     !(len = strnlen_user((char *)A(str), bprm->p))) {
-			ret = -EFAULT;
-			goto out;
-		}
-
-		if (bprm->p < len)  {
-			ret = -E2BIG;
-			goto out;
-		}
-
-		bprm->p -= len;
-		/* XXX: add architecture specific overflow check here. */
-
-		pos = bprm->p;
-		while (len > 0) {
-			int i, new, err;
-			int offset, bytes_to_copy;
-			struct page *page;
-
-			offset = pos % PAGE_SIZE;
-			i = pos/PAGE_SIZE;
-			page = bprm->page[i];
-			new = 0;
-			if (!page) {
-				page = alloc_page(GFP_HIGHUSER);
-				bprm->page[i] = page;
-				if (!page) {
-					ret = -ENOMEM;
-					goto out;
-				}
-				new = 1;
-			}
-
-			if (page != kmapped_page) {
-				if (kmapped_page)
-					kunmap(kmapped_page);
-				kmapped_page = page;
-				kaddr = kmap(kmapped_page);
-			}
-			if (new && offset)
-				memset(kaddr, 0, offset);
-			bytes_to_copy = PAGE_SIZE - offset;
-			if (bytes_to_copy > len) {
-				bytes_to_copy = len;
-				if (new)
-					memset(kaddr+offset+len, 0,
-					       PAGE_SIZE-offset-len);
-			}
-			err = copy_from_user(kaddr + offset, (char *)A(str),
-			                     bytes_to_copy);
-			if (err) {
-				ret = -EFAULT;
-				goto out;
-			}
-
-			pos += bytes_to_copy;
-			str += bytes_to_copy;
-			len -= bytes_to_copy;
-		}
-	}
-	ret = 0;
-out:
-	if (kmapped_page)
-		kunmap(kmapped_page);
-	return ret;
-}
-
-#ifdef CONFIG_MMU
-
-#define free_arg_pages(bprm) do { } while (0)
-
-#else
-
-static inline void free_arg_pages(struct linux_binprm *bprm)
-{
-	int i;
-
-	for (i = 0; i < MAX_ARG_PAGES; i++) {
-		if (bprm->page[i])
-			__free_page(bprm->page[i]);
-		bprm->page[i] = NULL;
-	}
-}
-
-#endif /* CONFIG_MMU */
-
-/*
- * sys32_execve() executes a new program.
- */
-static inline int 
-do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
-{
-	struct linux_binprm bprm;
-	struct file * file;
-	int retval;
-
-	sched_balance_exec();
-
-	file = open_exec(filename);
-
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		return retval;
-
-	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
-	memset(bprm.page, 0, MAX_ARG_PAGES * sizeof(bprm.page[0]));
-
-	bprm.file = file;
-	bprm.filename = filename;
-	bprm.interp = filename;
-	bprm.sh_bang = 0;
-	bprm.loader = 0;
-	bprm.exec = 0;
-	bprm.security = NULL;
-	bprm.mm = mm_alloc();
-	retval = -ENOMEM;
-	if (!bprm.mm) 
-		goto out_file;
-
-	retval = init_new_context(current, bprm.mm);
-	if (retval < 0)
-		goto out_mm;
-
-	bprm.argc = count32(argv, bprm.p / sizeof(u32));
-	if ((retval = bprm.argc) < 0)
-		goto out_mm;
-
-	bprm.envc = count32(envp, bprm.p / sizeof(u32));
-	if ((retval = bprm.envc) < 0)
-		goto out_mm;
-
-	retval = security_bprm_alloc(&bprm);
-	if (retval)
-		goto out;
-
-	retval = prepare_binprm(&bprm);
-	if (retval < 0)
-		goto out;
-	
-	retval = copy_strings_kernel(1, &bprm.filename, &bprm);
-	if (retval < 0)
-		goto out;
-
-	bprm.exec = bprm.p;
-	retval = copy_strings32(bprm.envc, envp, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = copy_strings32(bprm.argc, argv, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = search_binary_handler(&bprm, regs);
-	if (retval >= 0) {
-		free_arg_pages(&bprm);
-
-		/* execve success */
-		security_bprm_free(&bprm);
-		return retval;
-	}
-
-out:
-	/* Something went wrong, return the inode and free the argument pages*/
-	free_arg_pages(&bprm);
-
-	if (bprm.security)
-		security_bprm_free(&bprm);
-
-out_mm:
-	if (bprm.mm)
-		mmdrop(bprm.mm);
-
-out_file:
-	if (bprm.file) {
-		allow_write_access(bprm.file);
-		fput(bprm.file);
-	}
-	return retval;
-}
-
 /*
  * sys_execve() executes a new program.
  */
@@ -371,12 +149,12 @@ asmlinkage int sys32_execve(nabi_no_regargs struct pt_regs regs)
 	int error;
 	char * filename;
 
-	filename = getname((char *) (long)regs.regs[4]);
+	filename = getname(compat_ptr(regs.regs[4]));
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
-	error = do_execve32(filename, (u32 *) (long)regs.regs[5],
-	                  (u32 *) (long)regs.regs[6], &regs);
+	error = compat_do_execve(filename, compat_ptr(regs.regs[5]),
+				 compat_ptr(regs.regs[6]), &regs);
 	putname(filename);
 
 out:
@@ -671,150 +449,6 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
 	return sys_llseek(fd, offset_high, offset_low, result, origin);
 }
 
-typedef ssize_t (*IO_fn_t)(struct file *, char *, size_t, loff_t *);
-
-static long
-do_readv_writev32(int type, struct file *file, const struct compat_iovec *vector,
-		  u32 count)
-{
-	unsigned long tot_len;
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov=iovstack, *ivp;
-	struct inode *inode;
-	long retval, i;
-	IO_fn_t fn;
-
-	/* First get the "struct iovec" from user memory and
-	 * verify all the pointers
-	 */
-	if (!count)
-		return 0;
-	if(verify_area(VERIFY_READ, vector, sizeof(struct compat_iovec)*count))
-		return -EFAULT;
-	if (count > UIO_MAXIOV)
-		return -EINVAL;
-	if (count > UIO_FASTIOV) {
-		iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			return -ENOMEM;
-	}
-
-	tot_len = 0;
-	i = count;
-	ivp = iov;
-	while (i > 0) {
-		u32 len;
-		u32 buf;
-
-		__get_user(len, &vector->iov_len);
-		__get_user(buf, &vector->iov_base);
-		tot_len += len;
-		ivp->iov_base = (void *)A(buf);
-		ivp->iov_len = (__kernel_size_t) len;
-		vector++;
-		ivp++;
-		i--;
-	}
-
-	inode = file->f_dentry->d_inode;
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	retval = locks_verify_area((type == VERIFY_WRITE
-				    ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
-				   inode, file, file->f_pos, tot_len);
-	if (retval) {
-		if (iov != iovstack)
-			kfree(iov);
-		return retval;
-	}
-
-	/* Then do the actual IO.  Note that sockets need to be handled
-	 * specially as they have atomicity guarantees and can handle
-	 * iovec's natively
-	 */
-#ifdef CONFIG_NET
-	if (inode->i_sock) {
-		int err;
-		err = sock_readv_writev(type, inode, file, iov, count, tot_len);
-		if (iov != iovstack)
-			kfree(iov);
-		return err;
-	}
-#endif
-
-	if (!file->f_op) {
-		if (iov != iovstack)
-			kfree(iov);
-		return -EINVAL;
-	}
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	fn = file->f_op->read;
-	if (type == VERIFY_READ)
-		fn = (IO_fn_t) file->f_op->write;
-	ivp = iov;
-	while (count > 0) {
-		void * base;
-		int len, nr;
-
-		base = ivp->iov_base;
-		len = ivp->iov_len;
-		ivp++;
-		count--;
-		nr = fn(file, base, len, &file->f_pos);
-		if (nr < 0) {
-			if (retval)
-				break;
-			retval = nr;
-			break;
-		}
-		retval += nr;
-		if (nr != len)
-			break;
-	}
-	if (iov != iovstack)
-		kfree(iov);
-
-	return retval;
-}
-
-asmlinkage long
-sys32_readv(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	ssize_t ret;
-
-	ret = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto bad_file;
-	if (file->f_op && (file->f_mode & FMODE_READ) &&
-	    (file->f_op->readv || file->f_op->read))
-		ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
-
-	fput(file);
-
-bad_file:
-	return ret;
-}
-
-asmlinkage long
-sys32_writev(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	ssize_t ret;
-
-	ret = -EBADF;
-	file = fget(fd);
-	if(!file)
-		goto bad_file;
-	if (file->f_op && (file->f_mode & FMODE_WRITE) &&
-	    (file->f_op->writev || file->f_op->write))
-	        ret = do_readv_writev32(VERIFY_READ, file, vector, count);
-	fput(file);
-
-bad_file:
-	return ret;
-}
-
 /* From the Single Unix Spec: pread & pwrite act like lseek to pos + op +
    lseek back to original location.  They fail just like lseek does on
    non-seekable files.  */
@@ -885,167 +519,6 @@ out:
 bad_file:
 	return ret;
 }
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static inline int
-get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
-{
-	if (ufdset) {
-		unsigned long odd;
-
-		if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
-/*
- * We can actually return ERESTARTSYS instead of EINTR, but I'd
- * like to be certain this leads to no problems. So I return
- * EINTR just for safety.
- *
- * Update: ERESTARTSYS breaks at least the xview clock binary, so
- * I'm trying ERESTARTNOHAND which restart only when you want to.
- */
-#define MAX_SELECT_SECONDS \
-	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-
-asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, struct compat_timeval *tvp)
-{
-	fd_set_bits fds;
-	char *bits;
-	unsigned long nn;
-	long timeout;
-	int ret, size;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp) {
-		time_t sec, usec;
-
-		if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
-		    || (ret = __get_user(sec, &tvp->tv_sec))
-		    || (ret = __get_user(usec, &tvp->tv_usec)))
-			goto out_nofds;
-
-		ret = -EINVAL;
-		if(sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-	if (n > current->files->max_fdset)
-		n = current->files->max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words.
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = kmalloc(6 * size, GFP_KERNEL);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if ((ret = get_fd_set32(nn, fds.in, inp)) ||
-	    (ret = get_fd_set32(nn, fds.out, outp)) ||
-	    (ret = get_fd_set32(nn, fds.ex, exp)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
-		time_t sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		put_user(sec, &tvp->tv_sec);
-		put_user(usec, &tvp->tv_usec);
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set32(nn, inp, fds.res_in);
-	set_fd_set32(nn, outp, fds.res_out);
-	set_fd_set32(nn, exp, fds.res_ex);
-
-out:
-	kfree(bits);
-out_nofds:
-	return ret;
-}
-
 
 asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
 	struct compat_timespec *interval)
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 04a808ef3..2b2265ada 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -33,6 +33,9 @@ EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(memmove);
 EXPORT_SYMBOL_NOVERS(strcat);
 EXPORT_SYMBOL_NOVERS(strchr);
+#ifdef CONFIG_MIPS64
+EXPORT_SYMBOL_NOVERS(strncmp);
+#endif
 EXPORT_SYMBOL_NOVERS(strlen);
 EXPORT_SYMBOL_NOVERS(strpbrk);
 EXPORT_SYMBOL_NOVERS(strncat);
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index f4ab9c66b..4bb61f32c 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -280,12 +280,6 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
 	return ((unsigned long *)t->reg29)[schedule_frame.pc_offset];
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 /* get_wchan - a maintenance nightmare^W^Wpain in the ass ...  */
 unsigned long get_wchan(struct task_struct *p)
 {
@@ -297,7 +291,7 @@ unsigned long get_wchan(struct task_struct *p)
 	if (!mips_frame_info_initialized)
 		return 0;
 	pc = thread_saved_pc(p);
-	if (pc < first_sched || pc >= last_sched)
+	if (!in_sched_functions(pc))
 		goto out;
 
 	if (pc >= (unsigned long) sleep_on_timeout)
@@ -331,7 +325,7 @@ schedule_timeout_caller:
 	 */
 	pc    = ((unsigned long *)frame)[schedule_timeout_frame.pc_offset];
 
-	if (pc >= first_sched && pc < last_sched) {
+	if (in_sched_functions(pc)) {
 		/* schedule_timeout called by [interruptible_]sleep_on_timeout */
 		frame = ((unsigned long *)frame)[schedule_timeout_frame.frame_offset];
 		pc    = ((unsigned long *)frame)[sleep_on_timeout_frame.pc_offset];
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 1036abe1c..6e8511390 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -303,8 +303,17 @@ out:
  * Notification of system call entry/exit
  * - triggered by current->work.syscall_trace
  */
-asmlinkage void do_syscall_trace(void)
+asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
 {
+	if (unlikely(current->audit_context)) {
+		if (!entryexit)
+			audit_syscall_entry(current, regs->orig_eax,
+			                    regs->regs[4], regs->regs[5],
+			                    regs->regs[6], regs->regs[7]);
+		else
+			audit_syscall_exit(current, regs->regs[2]);
+	}
+
 	if (!test_thread_flag(TIF_SYSCALL_TRACE))
 		return;
 	if (!(current->ptrace & PT_PTRACED))
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 9729191b8..09477c1e3 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -33,8 +33,8 @@ NESTED(handle_sys, PT_SIZE, sp)
 
 	sltiu	t0, v0, MAX_SYSCALL_NO + 1 # check syscall number
 	addiu	t1, 4			# skip to next instruction
-	beqz	t0, illegal_syscall
 	sw	t1, PT_EPC(sp)
+	beqz	t0, illegal_syscall
 
 	/* XXX Put both in one cacheline, should save a bit. */
 	sll	t0, v0, 2
@@ -49,7 +49,7 @@ NESTED(handle_sys, PT_SIZE, sp)
 stack_done:
 	sw	a3, PT_R26(sp)          # save for syscall restart
 	LONG_L	t0, TI_FLAGS($28)	# syscall tracing enabled?
-	li	t1, _TIF_SYSCALL_TRACE
+	li	t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
 	and	t0, t1, t0
 	bnez	t0, syscall_trace_entry	# -> yes
 
@@ -84,6 +84,8 @@ o32_syscall_exit_work:
 syscall_trace_entry:
 	SAVE_STATIC
 	sw	t2, PT_R1(sp)
+	move	a0, sp
+	li	a1, 0
 	jal	do_syscall_trace
 	lw	t2, PT_R1(sp)
 
@@ -233,13 +235,15 @@ illegal_syscall:
 
 	/* Success, so skip usual error handling garbage.  */
 	LONG_L	a2, TI_FLAGS($28)	# syscall tracing enabled?
-	li	t0, _TIF_SYSCALL_TRACE
+	li	t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
 	and	t0, a2, t0
 	bnez	t0, 1f
 
 	b	o32_syscall_exit
 
 1:	SAVE_STATIC
+	move	a0, sp
+	li	a1, 1
 	jal	do_syscall_trace
 	j	syscall_exit
 
@@ -614,6 +618,15 @@ out:	jr	ra
 	sys	sys_clock_nanosleep	4	/* 4265 */
 	sys	sys_tgkill		3
 	sys	sys_utimes		2
+	sys	sys_ni_syscall		0	/* sys_mbind */
+	sys	sys_ni_syscall		0	/* sys_get_mempolicy */
+	sys	sys_ni_syscall		0	/* 4270 sys_set_mempolicy */
+	sys	sys_mq_open		4
+	sys	sys_mq_unlink		1
+	sys	sys_mq_timedsend	5
+	sys	sys_mq_timedreceive	5
+	sys	sys_mq_notify		2	/* 4275 */
+	sys	sys_mq_getsetattr	3
 
 	.endm
 
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 06b604598..19e430d62 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -36,14 +36,16 @@ NESTED(handle_sys64, PT_SIZE, sp)
 	STI
 	.set	at
 #endif
-	ld	t1, PT_EPC(sp)		# skip syscall on return
 
 FEXPORT(__handle_sys64)
 	subu	t0, v0, __NR_64_Linux	# check syscall number
 	sltiu	t0, t0,	__NR_64_Linux_syscalls + 1
+#if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
+	ld	t1, PT_EPC(sp)		# skip syscall on return
 	daddiu	t1, 4			# skip to next instruction
-	beqz	t0, illegal_syscall
 	sd	t1, PT_EPC(sp)
+#endif
+	beqz	t0, illegal_syscall
 
 	dsll	t0, v0, 3		# offset into table
 	ld	t2, (sys_call_table - (__NR_64_Linux * 8))(t0)
@@ -85,6 +87,8 @@ n64_syscall_exit_work:
 syscall_trace_entry:
 	SAVE_STATIC
 	sd	t2,PT_R1(sp)
+	move	a0, sp
+	li	a1, 0
 	jal	do_syscall_trace
 	ld	t2,PT_R1(sp)
 
@@ -165,13 +169,15 @@ illegal_syscall:
 
 	/* Success, so skip usual error handling garbage.  */
 	LONG_L	a2, TI_FLAGS($28)	# syscall tracing enabled?
-	li	t0, _TIF_SYSCALL_TRACE
+	li	t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
 	and	t0, a2, t0
 	bnez	t0, 1f
 
 	b	syscall_exit
 
 1:	SAVE_STATIC
+	move	a0, sp
+	li	a1, 1
 	jal	do_syscall_trace
 	j	syscall_exit
 
@@ -244,7 +250,7 @@ sys_call_table:
 	PTR	sys_setitimer
 	PTR	sys_alarm
 	PTR	sys_getpid
-	PTR	sys_sendfile
+	PTR	sys_sendfile64
 	PTR	sys_socket			/* 5040 */
 	PTR	sys_connect
 	PTR	sys_accept
@@ -432,3 +438,12 @@ sys_call_table:
 	PTR	sys_clock_nanosleep
 	PTR	sys_tgkill			/* 5225 */
 	PTR	sys_utimes
+	PTR	sys_ni_syscall			/* sys_mbind */
+	PTR	sys_ni_syscall			/* sys_get_mempolicy */
+	PTR	sys_ni_syscall			/* sys_set_mempolicy */
+	PTR	sys_mq_open			/* 5230 */
+	PTR	sys_mq_unlink
+	PTR	sys_mq_timedsend
+	PTR	sys_mq_timedreceive
+	PTR	sys_mq_notify
+	PTR	sys_mq_getsetattr		/* 5235 */
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 6a89b53ea..9993a8a15 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -36,21 +36,26 @@ NESTED(handle_sysn32, PT_SIZE, sp)
 	STI
 	.set	at
 #endif
-	ld	t1, PT_EPC(sp)		# skip syscall on return
 
 	subu	t0, v0, __NR_N32_Linux	# check syscall number
 	sltiu	t0, t0,	__NR_N32_Linux_syscalls + 1
+
+#ifndef CONFIG_MIPS32_O32
+	ld	t1, PT_EPC(sp)		# skip syscall on return
 	daddiu	t1, 4			# skip to next instruction
-	beqz	t0, not_n32_scall
 	sd	t1, PT_EPC(sp)
+#endif
+	beqz	t0, not_n32_scall
 
 	dsll	t0, v0, 3		# offset into table
 	ld	t2, (sysn32_call_table - (__NR_N32_Linux * 8))(t0)
 
 	sd	a3, PT_R26(sp)		# save a3 for syscall restarting
 
+	li	t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
 	LONG_L	t0, TI_FLAGS($28)	# syscall tracing enabled?
-	bltz	t0, n32_syscall_trace_entry
+	and	t0, t1, t0
+	bnez	t0, n32_syscall_trace_entry
 
 	jalr	t2			# Do The Real Thing (TM)
 
@@ -82,6 +87,8 @@ n32_syscall_exit_work:
 n32_syscall_trace_entry:
 	SAVE_STATIC
 	sd	t2,PT_R1(sp)
+	move	a0, sp
+	li	a1, 0
 	jal	do_syscall_trace
 	ld	t2,PT_R1(sp)
 
@@ -128,11 +135,11 @@ EXPORT(sysn32_call_table)
 	PTR	compat_sys_ioctl		/* 6015 */
 	PTR	sys_pread64
 	PTR	sys_pwrite64
-	PTR	sys32_readv
-	PTR	sys32_writev
+	PTR	compat_sys_readv
+	PTR	compat_sys_writev
 	PTR	sys_access			/* 6020 */
 	PTR	sys_pipe
-	PTR	sys32_select
+	PTR	compat_sys_select
 	PTR	sys_sched_yield
 	PTR	sys_mremap
 	PTR	sys_msync			/* 6025 */
@@ -341,3 +348,12 @@ EXPORT(sysn32_call_table)
 	PTR	sys_clock_nanosleep
 	PTR	sys_tgkill
 	PTR	compat_sys_utimes		/* 6230 */
+	PTR	sys_ni_syscall			/* sys_mbind */
+	PTR	sys_ni_syscall			/* sys_get_mempolicy */
+	PTR	sys_ni_syscall			/* sys_set_mempolicy */
+	PTR	compat_sys_mq_open
+	PTR	sys_mq_unlink			/* 6235 */
+	PTR	compat_sys_mq_timedsend
+	PTR	compat_sys_mq_timedreceive
+	PTR	compat_sys_mq_notify
+	PTR	compat_sys_mq_getsetattr	/* 6239 */
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 8ca8d826b..b35165686 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -34,8 +34,8 @@ NESTED(handle_sys, PT_SIZE, sp)
 	subu	t0, v0, __NR_O32_Linux	# check syscall number
 	sltiu	t0, t0, __NR_O32_Linux_syscalls + 1
 	daddiu	t1, 4			# skip to next instruction
-	beqz	t0, not_o32_scall
 	sd	t1, PT_EPC(sp)
+	beqz	t0, not_o32_scall
 #if 0
  SAVE_ALL
  move a1, v0
@@ -58,8 +58,9 @@ NESTED(handle_sys, PT_SIZE, sp)
 	bgez	t0, stackargs
 
 stack_done:
-	LONG_L	t0, TI_FLAGS($28)
-					# syscall tracing enabled?
+	li	t1, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT
+	LONG_L	t0, TI_FLAGS($28)	# syscall tracing enabled?
+	and	t0, t1, t0
 	bnez	t0, trace_a_syscall
 
 	jalr	t2			# Do The Real Thing (TM)
@@ -97,6 +98,8 @@ trace_a_syscall:
 	sd	a7, PT_R11(sp)
 
 	sd	t2,PT_R1(sp)
+	move	a0, sp
+	li	a1, 0
 	jal	do_syscall_trace
 	ld	t2,PT_R1(sp)
 
@@ -397,11 +400,11 @@ out:	jr	ra
 	sys	sys_setfsgid	1
 	sys	sys32_llseek	5			/* 4140 */
 	sys	sys32_getdents	3
-	sys	sys32_select	5
+	sys	compat_sys_select	5
 	sys	sys_flock	2
 	sys	sys_msync	3
-	sys	sys32_readv	3			/* 4145 */
-	sys	sys32_writev	3
+	sys	compat_sys_readv	3		/* 4145 */
+	sys	compat_sys_writev	3
 	sys	sys_cacheflush	3
 	sys	sys_cachectl	3
 	sys	sys_sysmips	4
@@ -523,6 +526,15 @@ out:	jr	ra
 	sys	sys_clock_nanosleep	4		/* 4265 */
 	sys	sys_tgkill		3
 	sys	compat_sys_utimes	2
+	sys	sys_ni_syscall		0	/* sys_mbind */
+	sys	sys_ni_syscall		0	/* sys_get_mempolicy */
+	sys	sys_ni_syscall		0	/* 4270 sys_set_mempolicy */
+	sys	compat_sys_mq_open	4
+	sys	sys_mq_unlink		1
+	sys	compat_sys_mq_timedsend	5
+	sys	compat_sys_mq_timedreceive 5
+	sys	compat_sys_mq_notify	2	/* 4275 */
+	sys	compat_sys_mq_getsetattr 3
 
 	.endm
 
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 273d10c29..a820be85e 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -18,6 +18,7 @@
 #include <linux/errno.h>
 #include <linux/wait.h>
 #include <linux/ptrace.h>
+#include <linux/suspend.h>
 #include <linux/unistd.h>
 
 #include <asm/asm.h>
@@ -34,8 +35,6 @@
 
 extern asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs);
 
-extern asmlinkage void do_syscall_trace(void);
-
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
@@ -232,7 +231,7 @@ asmlinkage void sys_sigreturn(struct pt_regs regs)
 	 * Don't let your children do this ...
 	 */
 	if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
-		do_syscall_trace();
+		do_syscall_trace(&regs, 1);
 	__asm__ __volatile__(
 		"move\t$29, %0\n\t"
 		"j\tsyscall_exit"
@@ -549,6 +548,19 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
 	}
 #endif
 
+	/*
+	 * We want the common case to go fast, which is why we may in certain
+	 * cases get here from kernel mode. Just return without doing anything
+	 * if so.
+	 */
+	if (!user_mode(regs))
+		return 1;
+
+	if (current->flags & PF_FREEZE) {
+		refrigerator(0);
+		goto no_signal;
+	}
+
 	if (!oldset)
 		oldset = &current->blocked;
 
@@ -558,6 +570,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
 		return 1;
 	}
 
+no_signal:
 	/*
 	 * Who's code doesn't conform to the restartable syscall convention
 	 * dies here!!!  The li instruction, a single machine instruction,
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 0c4ee2afe..407beff81 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -18,9 +18,11 @@
 #include <linux/wait.h>
 #include <linux/ptrace.h>
 #include <linux/compat.h>
+#include <linux/suspend.h>
 
 #include <asm/asm.h>
 #include <asm/bitops.h>
+#include <asm/cacheflush.h>
 #include <asm/sim.h>
 #include <asm/uaccess.h>
 #include <asm/ucontext.h>
@@ -40,8 +42,6 @@
 
 extern asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs);
 
-extern asmlinkage void do_syscall_trace(void);
-
 /* 32-bit compatibility types */
 
 #define _NSIG_BPW32	32
@@ -392,7 +392,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
 	 * Don't let your children do this ...
 	 */
 	if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
-		do_syscall_trace();
+		do_syscall_trace(&regs, 1);
 	__asm__ __volatile__(
 		"move\t$29, %0\n\t"
 		"j\tsyscall_exit"
@@ -696,6 +696,19 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs)
 	siginfo_t info;
 	int signr;
 
+	/*
+	 * We want the common case to go fast, which is why we may in certain
+	 * cases get here from kernel mode. Just return without doing anything
+	 * if so.
+	 */
+	if (!user_mode(regs))
+		return 1;
+
+	if (current->flags & PF_FREEZE) {
+		refrigerator(0);
+		goto no_signal;
+	}
+
 	if (!oldset)
 		oldset = &current->blocked;
 
@@ -705,6 +718,7 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs)
 		return 1;
 	}
 
+no_signal:
 	/*
 	 * Who's code doesn't conform to the restartable syscall convention
 	 * dies here!!!  The li instruction, a single machine instruction,
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index a3d9740f1..d262fbdc9 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -29,6 +29,7 @@
 
 #include <asm/asm.h>
 #include <asm/bitops.h>
+#include <asm/cacheflush.h>
 #include <asm/sim.h>
 #include <asm/uaccess.h>
 #include <asm/ucontext.h>
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 557fb12d9..1f917fe93 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -151,6 +151,9 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
 	if (!cpus)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.started, 0);
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 1b10357ab..25d7e97ed 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -235,7 +235,7 @@ asmlinkage int irix_prctl(struct pt_regs *regs)
 #undef DEBUG_PROCGRPS
 
 extern unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt);
-extern int getrusage(struct task_struct *p, int who, struct rusage *ru);
+extern int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
 extern char *prom_getenv(char *name);
 extern long prom_setenv(char *name, char *value);
 
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 5a3b32bbf..e580a911b 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -238,7 +238,7 @@ void __init mem_init(void)
 		set_page_address(page, lowmem_page_address(page));
 #endif
 		set_bit(PG_highmem, &page->flags);
-		atomic_set(&page->count, 1);
+		set_page_count(page, 1);
 		__free_page(page);
 		totalhigh_pages++;
 	}
diff --git a/arch/mips/momentum/jaguar_atx/prom.c b/arch/mips/momentum/jaguar_atx/prom.c
index f96211aee..10acbe9b0 100644
--- a/arch/mips/momentum/jaguar_atx/prom.c
+++ b/arch/mips/momentum/jaguar_atx/prom.c
@@ -25,22 +25,12 @@
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 #include <asm/mv64340.h>
+#include <asm/pmon.h>
 
 #include "jaguar_atx_fpga.h"
 
 extern void ja_setup_console(void);
 
-struct callvectors {
-	int	(*open) (char*, int, int);		/*	 0 */
-	int	(*close) (int);				/*	 4 */
-	int	(*read) (int, void*, int);		/*	 8 */
-	int	(*write) (int, void*, int);		/*	12 */
-	off_t	(*lseek) (int, off_t, int);		/*	16 */
-	int	(*printf) (const char*, ...);		/*	20 */
-	void	(*cacheflush) (void);			/*	24 */
-	char*	(*gets) (char*);			/*	28 */
-};
-
 struct callvectors *debug_vectors;
 
 extern unsigned long mv64340_base;
diff --git a/arch/mips/momentum/ocelot_c/prom.c b/arch/mips/momentum/ocelot_c/prom.c
index cf6c180e5..0387b562b 100644
--- a/arch/mips/momentum/ocelot_c/prom.c
+++ b/arch/mips/momentum/ocelot_c/prom.c
@@ -23,20 +23,10 @@
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 #include <asm/mv64340.h>
+#include <asm/pmon.h>
 
 #include "ocelot_c_fpga.h"
 
-struct callvectors {
-	int	(*open) (char*, int, int);
-	int	(*close) (int);
-	int	(*read) (int, void*, int);
-	int	(*write) (int, void*, int);
-	off_t	(*lseek) (int, off_t, int);
-	int	(*printf) (const char*, ...);
-	void	(*cacheflush) (void);
-	char*	(*gets) (char*);
-};
-
 struct callvectors* debug_vectors;
 
 extern unsigned long mv64340_base;
diff --git a/arch/mips/momentum/ocelot_g/prom.c b/arch/mips/momentum/ocelot_g/prom.c
index 8901280fe..2b480b2ef 100644
--- a/arch/mips/momentum/ocelot_g/prom.c
+++ b/arch/mips/momentum/ocelot_g/prom.c
@@ -19,21 +19,11 @@
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
+#include <asm/pmon.h>
 
 #include "gt64240.h"
 #include "ocelot_pld.h"
 
-struct callvectors {
-	int	(*open) (char*, int, int);
-	int	(*close) (int);
-	int	(*read) (int, void*, int);
-	int	(*write) (int, void*, int);
-	off_t	(*lseek) (int, off_t, int);
-	int	(*printf) (const char*, ...);
-	void	(*cacheflush) (void);
-	char*	(*gets) (char*);
-};
-
 struct callvectors* debug_vectors;
 
 extern unsigned long gt64240_base;
diff --git a/arch/mips/pci/fixup-au1000.c b/arch/mips/pci/fixup-au1000.c
index 36fc6fe16..7bbe12336 100644
--- a/arch/mips/pci/fixup-au1000.c
+++ b/arch/mips/pci/fixup-au1000.c
@@ -37,22 +37,72 @@
 /*
  * Shortcut
  */
-#define INTA	AU1000_PCI_INTA
-#define INTB	AU1000_PCI_INTB
+#ifdef CONFIG_SOC_AU1500
+#define INTA AU1000_PCI_INTA
+#define INTB AU1000_PCI_INTB
+#define INTC AU1000_PCI_INTC
+#define INTD AU1000_PCI_INTD
+#endif
+
+#ifdef CONFIG_SOC_AU1550
+#define INTA AU1550_PCI_INTA
+#define INTB AU1550_PCI_INTB
+#define INTC AU1550_PCI_INTC
+#define INTD AU1550_PCI_INTD
+#endif
+
+#define INTX    0xFF /* not valid */
+
+#ifdef CONFIG_MIPS_DB1500
+static char irq_tab_alchemy[][5] __initdata = {
+ [12] =	{ -1, INTA, INTX, INTX, INTX},   /* IDSEL 12 - HPT371   */
+ [13] =	{ -1, INTA, INTB, INTC, INTD},   /* IDSEL 13 - PCI slot */
+};
+#endif
+
+#ifdef CONFIG_MIPS_BOSPORUS
+static char irq_tab_alchemy[][5] __initdata = {
+ [11] =	{ -1, INTA, INTB, INTX, INTX},   /* IDSEL 11 - miniPCI  */
+ [12] =	{ -1, INTA, INTX, INTX, INTX},   /* IDSEL 12 - SN1741   */
+ [13] =	{ -1, INTA, INTB, INTC, INTD},   /* IDSEL 13 - PCI slot */
+};
+#endif
 
+#ifdef CONFIG_MIPS_MIRAGE
 static char irq_tab_alchemy[][5] __initdata = {
- [11] = { -1, INTA, INTA, INTA, INTA },
- [12] = { -1, INTA, INTA, INTA, INTA },
-#if defined( CONFIG_SOC_AU1550 )
- [13] = { -1, INTB, INTB, INTB, INTB }
+ [11] =	{ -1, INTD, INTX, INTX, INTX},   /* IDSEL 11 - SMI VGX */
+ [12] =	{ -1, INTX, INTX, INTC, INTX},   /* IDSEL 12 - PNX1300 */
+ [13] =	{ -1, INTA, INTB, INTX, INTX},   /* IDSEL 13 - miniPCI */
+};
+#endif
+
+#ifdef CONFIG_MIPS_DB1550
+static char irq_tab_alchemy[][5] __initdata = {
+ [11] =	{ -1, INTC, INTX, INTX, INTX},   /* IDSEL 11 - on-board HPT371    */
+ [12] =	{ -1, INTB, INTC, INTD, INTA},   /* IDSEL 12 - PCI slot 2 (left)  */
+ [13] =	{ -1, INTA, INTB, INTC, INTD},   /* IDSEL 13 - PCI slot 1 (right) */
+};
+#endif
+
+#ifdef CONFIG_MIPS_PB1500
+static char irq_tab_alchemy[][5] __initdata = {
+ [12] = { -1, INTA, INTX, INTX, INTX},   /* IDSEL 12 - HPT370   */
+ [13] = { -1, INTA, INTB, INTC, INTD},   /* IDSEL 13 - PCI slot */
+};
 #endif
+
+#ifdef CONFIG_MIPS_PB1550
+static char irq_tab_alchemy[][5] __initdata = {
+ [12] =	{ -1, INTB, INTC, INTD, INTA},   /* IDSEL 12 - PCI slot 2 (left)  */
+ [13] =	{ -1, INTA, INTB, INTC, INTD},   /* IDSEL 13 - PCI slot 1 (right) */
 };
+#endif
 
 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
-	return irq_tab_alchemy[slot][pin];
+return irq_tab_alchemy[slot][pin];
 }
 
 struct pci_fixup pcibios_fixups[] __initdata = {
-	{ 0 }
+{ 0 }
 };
diff --git a/arch/mips/pci/ops-au1000.c b/arch/mips/pci/ops-au1000.c
index 74d052c66..b921cc6b3 100644
--- a/arch/mips/pci/ops-au1000.c
+++ b/arch/mips/pci/ops-au1000.c
@@ -33,89 +33,170 @@
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/vmalloc.h>
 
 #include <asm/mach-au1x00/au1000.h>
 
+#undef DEBUG
+#ifdef DEBUG
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
 #define PCI_ACCESS_READ  0
 #define PCI_ACCESS_WRITE 1
 
 
+int (*board_pci_idsel)(unsigned int devsel, int assert);
+
+/* CP0 hazard avoidance. */
+#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \
+				     "nop; nop; nop; nop;\t" \
+				     ".set reorder\n\t")
+
+void mod_wired_entry(int entry, unsigned long entrylo0,
+		unsigned long entrylo1, unsigned long entryhi,
+		unsigned long pagemask)
+{
+	unsigned long old_pagemask;
+	unsigned long old_ctx;
+
+	/* Save old context and create impossible VPN2 value */
+	old_ctx = read_c0_entryhi() & 0xff;
+	old_pagemask = read_c0_pagemask();
+	write_c0_index(entry);
+	BARRIER;
+	write_c0_pagemask(pagemask);
+	write_c0_entryhi(entryhi);
+	write_c0_entrylo0(entrylo0);
+	write_c0_entrylo1(entrylo1);
+	BARRIER;
+	tlb_write_indexed();
+	BARRIER;
+	write_c0_entryhi(old_ctx);
+	BARRIER;
+	write_c0_pagemask(old_pagemask);
+}
+
+struct vm_struct *pci_cfg_vm;
+static int pci_cfg_wired_entry;
+static int first_cfg = 1;
+unsigned long last_entryLo0, last_entryLo1;
+
 static int config_access(unsigned char access_type, struct pci_bus *bus,
-			 unsigned int devfn, unsigned char where,
+			 unsigned int dev_fn, unsigned char where,
 			 u32 * data)
 {
-	unsigned int device = PCI_SLOT(devfn);
-	unsigned int function = PCI_FUNC(devfn);
-	unsigned long config, status;
-	unsigned long cfg_addr;
+#if defined( CONFIG_SOC_AU1500 ) || defined( CONFIG_SOC_AU1550 )
+	unsigned int device = PCI_SLOT(dev_fn);
+	unsigned int function = PCI_FUNC(dev_fn);
+	unsigned long offset, status;
+	unsigned long cfg_base;
+	unsigned long flags;
+	int error = PCIBIOS_SUCCESSFUL;
+	unsigned long entryLo0, entryLo1;
 
 	if (device > 19) {
 		*data = 0xffffffff;
 		return -1;
 	}
 
-	au_writel(((0x2000 << 16) |
-		   (au_readl(Au1500_PCI_STATCMD) & 0xffff)),
-		  Au1500_PCI_STATCMD);
-	//au_writel(au_readl(Au1500_PCI_CFG) & ~PCI_ERROR, Au1500_PCI_CFG);
+	local_irq_save(flags);
+	au_writel(((0x2000 << 16) | (au_readl(Au1500_PCI_STATCMD) & 0xffff)),
+			Au1500_PCI_STATCMD);
 	au_sync_udelay(1);
 
-	/* setup the config window */
-	if (bus->number == 0) {
-		cfg_addr = (unsigned long) ioremap(Au1500_EXT_CFG |
-						   ((1 << device) << 11),
-						   0x00100000);
-	} else {
-		cfg_addr = (unsigned long) ioremap(Au1500_EXT_CFG_TYPE1 |
-						   (bus->
-						    number << 16) | (device
-								     <<
-								     11),
-						   0x00100000);
+	/*
+	 * We can't ioremap the entire pci config space because it's
+	 * too large. Nor can we call ioremap dynamically because some
+	 * device drivers use the pci config routines from within
+	 * interrupt handlers and that becomes a problem in get_vm_area().
+	 * We use one wired tlb to handle all config accesses for all
+	 * busses. To improve performance, if the current device
+	 * is the same as the last device accessed, we don't touch the
+	 * tlb.
+	 */
+	if (first_cfg) {
+		/* reserve a wired entry for pci config accesses */
+		first_cfg = 0;
+		pci_cfg_vm = get_vm_area(0x2000, 0);
+		if (!pci_cfg_vm)
+			panic (KERN_ERR "PCI unable to get vm area\n");
+		pci_cfg_wired_entry = read_c0_wired();
+		add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
+		last_entryLo0  = last_entryLo1 = 0xffffffff;
 	}
 
-	if (!cfg_addr)
-		panic(KERN_ERR "PCI unable to ioremap cfg space\n");
-
-	/* setup the lower bits of the 36 bit address */
-	config = cfg_addr | (function << 8) | (where & ~0x3);
-
-#if 1
-	if (access_type == PCI_ACCESS_WRITE) {
-		printk("cfg write:  ");
-	} else {
-		printk("cfg read:  ");
+	/* Since the Au1xxx doesn't do the idsel timing exactly to spec,
+	 * many board vendors implement their own off-chip idsel, so call
+	 * it now.  If it doesn't succeed, may as well bail out at this point.
+	 */
+	if (board_pci_idsel) {
+		if (board_pci_idsel(device, 1) == 0) {
+			*data = 0xffffffff;
+			local_irq_restore(flags);
+			return -1;
+		}
 	}
-	printk("devfn %x, device %x func %x  \n", devfn, device, function);
-	if (access_type == PCI_ACCESS_WRITE) {
-		printk("data %x\n", *data);
+
+        /* setup the config window */
+        if (bus->number == 0) {
+                cfg_base = ((1<<device)<<11);
+        } else {
+                cfg_base = 0x80000000 | (bus->number<<16) | (device<<11);
+        }
+
+        /* setup the lower bits of the 36 bit address */
+        offset = (function << 8) | (where & ~0x3);
+	/* pick up any address that falls below the page mask */
+	offset |= cfg_base & ~PAGE_MASK;
+
+	/* page boundary */
+	cfg_base = cfg_base & PAGE_MASK;
+
+	entryLo0 = (6 << 26)  | (cfg_base >> 6) | (2 << 3) | 7;
+	entryLo1 = (6 << 26)  | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7;
+
+	if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) {
+		mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1,
+				(unsigned long)pci_cfg_vm->addr, PM_4K);
+		last_entryLo0 = entryLo0;
+		last_entryLo1 = entryLo1;
 	}
-#endif
 
 	if (access_type == PCI_ACCESS_WRITE) {
-		au_writel(*data, config);
+		au_writel(*data, (int)(pci_cfg_vm->addr + offset));
 	} else {
-		*data = au_readl(config);
+		*data = au_readl((int)(pci_cfg_vm->addr + offset));
 	}
 	au_sync_udelay(2);
 
-	/* unmap io space */
-	iounmap((void *) cfg_addr);
+	DBG("cfg_access %d bus->number %d dev %d at %x *data %x conf %x\n",
+			access_type, bus->number, device, where, *data, offset);
 
 	/* check master abort */
 	status = au_readl(Au1500_PCI_STATCMD);
-	if (status & (1 << 29)) {
-		printk("master abort\n");
+
+	if (status & (1<<29)) {
 		*data = 0xffffffff;
-		return -1;
+		error = -1;
+		DBG("Au1x Master Abort\n");
 	} else if ((status >> 28) & 0xf) {
-		printk("PCI ERR detected: status %x\n", status);
+		DBG("PCI ERR detected: status %x\n", status);
 		*data = 0xffffffff;
-		return -1;
-	} else {
-		printk("bios_successful: %x\n", *data);
-		return PCIBIOS_SUCCESSFUL;
+		error = -1;
+	}
+
+	/* Take away the idsel.
+	*/
+	if (board_pci_idsel) {
+		(void)board_pci_idsel(device, 0);
 	}
+
+	local_irq_restore(flags);
+	return error;
+#endif
 }
 
 static int read_config_byte(struct pci_bus *bus, unsigned int devfn,
diff --git a/arch/mips/sgi-ip27/ip27-hubio.c b/arch/mips/sgi-ip27/ip27-hubio.c
index 68d989500..79e0d6c36 100644
--- a/arch/mips/sgi-ip27/ip27-hubio.c
+++ b/arch/mips/sgi-ip27/ip27-hubio.c
@@ -166,18 +166,18 @@ static void hub_set_piomode(nasid_t nasid)
 	REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, ii_iowa);
 }
 
-/**
+/*
  * hub_pio_init  -  PIO-related hub initalization
  *
  * @hub:	hubinfo structure for our hub
- **/
+ */
 void hub_pio_init(cnodeid_t cnode)
 {
 	nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
 	unsigned i;
 
 	/* initialize big window piomaps for this hub */
-	CLEAR_BITMAP(HUB_DATA(cnode)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
+	bitmap_zero(HUB_DATA(cnode)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
 	for (i = 0; i < HUB_NUM_BIG_WINDOW; i++)
 		IIO_ITTE_DISABLE(nasid, i);
 
diff --git a/arch/mips/vr41xx/casio-e55/setup.c b/arch/mips/vr41xx/casio-e55/setup.c
index c838fc6ac..e41c7b066 100644
--- a/arch/mips/vr41xx/casio-e55/setup.c
+++ b/arch/mips/vr41xx/casio-e55/setup.c
@@ -35,7 +35,8 @@ static int casio_e55_setup(void)
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
 #ifdef CONFIG_SERIAL_8250
-	vr41xx_siu_init(SIU_RS232C, 0);
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
 #endif
 
 	return 0;
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index 70ff78190..bd67058e4 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -1,34 +1,23 @@
 /*
- * FILE NAME
- *	arch/mips/vr41xx/common/icu.c
+ *  icu.c, Interrupt Control Unit routines for the NEC VR4100 series.
  *
- * BRIEF MODULE DESCRIPTION
- *	Interrupt Control Unit routines for the NEC VR4100 series.
+ *  Copyright (C) 2001-2002  MontaVista Software Inc.
+ *    Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com>
+ *  Copyright (C) 2003-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Author: Yoichi Yuasa
- *         yyuasa@mvista.com or source@mvista.com
+ *  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.
  *
- * Copyright 2001,2002 MontaVista Software Inc.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
  *
- *  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.
- *
- *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 /*
  * Changes:
@@ -90,6 +79,9 @@ static unsigned char sysint2_assign[16] = {
 #define MSYSINT2REG	0x06
 #define MGIUINTHREG	0x08
 
+#define MDSIUINTREG	KSEG1ADDR(0x0f000096)
+ #define INTDSIU	0x0800
+
 #define SYSINT1_IRQ_TO_PIN(x)	((x) - SYSINT1_IRQ_BASE)	/* Pin 0-15 */
 #define SYSINT2_IRQ_TO_PIN(x)	((x) - SYSINT2_IRQ_BASE)	/* Pin 0-15 */
 
@@ -148,6 +140,18 @@ static inline uint16_t clear_icu2(uint8_t offset, uint16_t clear)
 
 /*=======================================================================*/
 
+void vr41xx_enable_dsiuint(void)
+{
+	writew(INTDSIU, MDSIUINTREG);
+}
+
+void vr41xx_disable_dsiuint(void)
+{
+	writew(0, MDSIUINTREG);
+}
+
+/*=======================================================================*/
+
 static void enable_sysint1_irq(unsigned int irq)
 {
 	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
diff --git a/arch/mips/vr41xx/common/serial.c b/arch/mips/vr41xx/common/serial.c
index f981cfe2c..b052a9548 100644
--- a/arch/mips/vr41xx/common/serial.c
+++ b/arch/mips/vr41xx/common/serial.c
@@ -40,14 +40,8 @@
 #include <asm/io.h>
 #include <asm/vr41xx/vr41xx.h>
 
-/* VR4111 and VR4121 SIU Registers */
-#define SIURB_TYPE1		KSEG1ADDR(0x0c000000)
 #define SIUIRSEL_TYPE1		KSEG1ADDR(0x0c000008)
-
-/* VR4122, VR4131 and VR4133 SIU Registers */
-#define SIURB_TYPE2		KSEG1ADDR(0x0f000800)
 #define SIUIRSEL_TYPE2		KSEG1ADDR(0x0f000808)
-
  #define USE_RS232C		0x00
  #define USE_IRDA		0x01
  #define SIU_USES_IRDA		0x00
@@ -58,21 +52,24 @@
  #define TMICTX			0x10
  #define TMICMODE		0x20
 
-#define SIU_BASE_BAUD		1152000
+#define SIU_BASE_TYPE1		0x0c000000UL	/* VR4111 and VR4121 */
+#define SIU_BASE_TYPE2		0x0f000800UL	/* VR4122, VR4131 and VR4133 */
+#define SIU_SIZE		0x8UL
 
-/* VR4122 and VR4131 DSIU Registers */
-#define DSIURB			KSEG1ADDR(0x0f000820)
+#define SIU_BASE_BAUD		1152000
 
-#define MDSIUINTREG		KSEG1ADDR(0x0f000096)
- #define INTDSIU		0x0800
+/* VR4122, VR4131 and VR4133 DSIU Registers */
+#define DSIU_BASE		0x0f000820UL
+#define DSIU_SIZE		0x8UL
 
 #define DSIU_BASE_BAUD		1152000
 
 int vr41xx_serial_ports = 0;
 
-void vr41xx_siu_ifselect(int interface, int module)
+void vr41xx_select_siu_interface(siu_interface_t interface,
+                                 irda_module_t module)
 {
-	u16 val = USE_RS232C;	/* Select RS-232C */
+	uint16_t val = USE_RS232C;	/* Select RS-232C */
 
 	/* Select IrDA */
 	if (interface == SIU_IRDA) {
@@ -86,6 +83,9 @@ void vr41xx_siu_ifselect(int interface, int module)
 		case IRDA_HP:
 			val = IRDA_MODULE_HP;
 			break;
+		default:
+			printk(KERN_ERR "SIU: unknown IrDA module\n");
+			return;
 		}
 		val |= USE_IRDA | SIU_USES_IRDA;
 	}
@@ -101,45 +101,47 @@ void vr41xx_siu_ifselect(int interface, int module)
 		writew(val, SIUIRSEL_TYPE2);
 		break;
 	default:
-		printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n");
+		printk(KERN_ERR "SIU: unsupported CPU of NEC VR4100 series\n");
 		break;
 	}
 }
 
-void __init vr41xx_siu_init(int interface, int module)
+void __init vr41xx_siu_init(void)
 {
 	struct uart_port port;
 
-	vr41xx_siu_ifselect(interface, module);
-
 	memset(&port, 0, sizeof(port));
 
 	port.line = vr41xx_serial_ports;
-	port.uartclk = SIU_BASE_BAUD;
+	port.uartclk = SIU_BASE_BAUD * 16;
 	port.irq = SIU_IRQ;
-	port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
+	port.flags = UPF_RESOURCES | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
 	switch (current_cpu_data.cputype) {
 	case CPU_VR4111:
 	case CPU_VR4121:
-		port.membase = (char *)SIURB_TYPE1;
+		port.mapbase = SIU_BASE_TYPE1;
 		break;
 	case CPU_VR4122:
 	case CPU_VR4131:
 	case CPU_VR4133:
-		port.membase = (char *)SIURB_TYPE2;
+		port.mapbase = SIU_BASE_TYPE2;
 		break;
 	default:
-		panic("Unexpected CPU of NEC VR4100 series");
-		break;
+		printk(KERN_ERR "SIU: unsupported CPU of NEC VR4100 series\n");
+		return;
 	}
 	port.regshift = 0;
 	port.iotype = UPIO_MEM;
-	if (early_serial_setup(&port) != 0)
-		printk(KERN_ERR "SIU setup failed!\n");
-
-	vr41xx_supply_clock(SIU_CLOCK);
+	port.membase = ioremap(port.mapbase, SIU_SIZE);
+	if (port.membase != NULL) {
+		if (early_serial_setup(&port) == 0) {
+			vr41xx_supply_clock(SIU_CLOCK);
+			vr41xx_serial_ports++;
+			return;
+		}
+	}
 
-	vr41xx_serial_ports++;
+	printk(KERN_ERR "SIU: setup failed!\n");
 }
 
 void __init vr41xx_dsiu_init(void)
@@ -148,24 +150,29 @@ void __init vr41xx_dsiu_init(void)
 
 	if (current_cpu_data.cputype != CPU_VR4122 &&
 	    current_cpu_data.cputype != CPU_VR4131 &&
-	    current_cpu_data.cputype != CPU_VR4133)
+	    current_cpu_data.cputype != CPU_VR4133) {
+		printk(KERN_ERR "DSIU: unsupported CPU of NEC VR4100 series\n");
 		return;
+	}
 
 	memset(&port, 0, sizeof(port));
 
 	port.line = vr41xx_serial_ports;
-	port.uartclk = DSIU_BASE_BAUD;
+	port.uartclk = DSIU_BASE_BAUD * 16;
 	port.irq = DSIU_IRQ;
-	port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
-	port.membase = (char *)DSIURB;
+	port.flags = UPF_RESOURCES | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
+	port.mapbase = DSIU_BASE;
 	port.regshift = 0;
 	port.iotype = UPIO_MEM;
-	if (early_serial_setup(&port) != 0)
-		printk(KERN_ERR "DSIU setup failed!\n");
-
-	vr41xx_supply_clock(DSIU_CLOCK);
-
-	writew(INTDSIU, MDSIUINTREG);
+	port.membase = ioremap(port.mapbase, DSIU_SIZE);
+	if (port.membase != NULL) {
+		if (early_serial_setup(&port) == 0) {
+			vr41xx_supply_clock(DSIU_CLOCK);
+			vr41xx_enable_dsiuint();
+			vr41xx_serial_ports++;
+			return;
+		}
+	}
 
-	vr41xx_serial_ports++;
+	printk(KERN_ERR "DSIU: setup failed!\n");
 }
diff --git a/arch/mips/vr41xx/ibm-workpad/setup.c b/arch/mips/vr41xx/ibm-workpad/setup.c
index 63d6da734..3475d2ec8 100644
--- a/arch/mips/vr41xx/ibm-workpad/setup.c
+++ b/arch/mips/vr41xx/ibm-workpad/setup.c
@@ -35,7 +35,8 @@ static int ibm_workpad_setup(void)
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
 #ifdef CONFIG_SERIAL_8250
-	vr41xx_siu_init(SIU_RS232C, 0);
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
 #endif
 
 	return 0;
diff --git a/arch/mips/vr41xx/nec-eagle/setup.c b/arch/mips/vr41xx/nec-eagle/setup.c
index 9efceb403..cc055af00 100644
--- a/arch/mips/vr41xx/nec-eagle/setup.c
+++ b/arch/mips/vr41xx/nec-eagle/setup.c
@@ -80,8 +80,9 @@ static int nec_eagle_setup(void)
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
 #ifdef CONFIG_SERIAL_8250
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
 	vr41xx_dsiu_init();
-	vr41xx_siu_init(SIU_RS232C, 0);
 #endif
 
 #ifdef CONFIG_PCI
diff --git a/arch/mips/vr41xx/tanbac-tb0226/setup.c b/arch/mips/vr41xx/tanbac-tb0226/setup.c
index 68439e222..995a578e2 100644
--- a/arch/mips/vr41xx/tanbac-tb0226/setup.c
+++ b/arch/mips/vr41xx/tanbac-tb0226/setup.c
@@ -83,7 +83,10 @@ static int tanbac_tb0226_setup(void)
 	ioport_resource.start = IO_PORT_RESOURCE_START;
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
-	vr41xx_siu_init(SIU_RS232C, 0);
+#ifdef CONFIG_SERIAL_8250
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
+#endif
 
 #ifdef CONFIG_PCI
 	vr41xx_pciu_init(&pci_address_map);
diff --git a/arch/mips/vr41xx/tanbac-tb0229/setup.c b/arch/mips/vr41xx/tanbac-tb0229/setup.c
index fae4b3652..971473e61 100644
--- a/arch/mips/vr41xx/tanbac-tb0229/setup.c
+++ b/arch/mips/vr41xx/tanbac-tb0229/setup.c
@@ -87,8 +87,11 @@ static int tanbac_tb0229_setup(void)
 	ioport_resource.start = IO_PORT_RESOURCE_START;
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
-	vr41xx_siu_init(SIU_RS232C, 0);
+#ifdef CONFIG_SERIAL_8250
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
 	vr41xx_dsiu_init();
+#endif
 
 #ifdef CONFIG_PCI
 	vr41xx_pciu_init(&pci_address_map);
diff --git a/arch/mips/vr41xx/victor-mpc30x/setup.c b/arch/mips/vr41xx/victor-mpc30x/setup.c
index 65dff6cfb..5fc208496 100644
--- a/arch/mips/vr41xx/victor-mpc30x/setup.c
+++ b/arch/mips/vr41xx/victor-mpc30x/setup.c
@@ -84,7 +84,8 @@ static int victor_mpc30x_setup(void)
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
 #ifdef CONFIG_SERIAL_8250
-	vr41xx_siu_init(SIU_RS232C, 0);
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
 #endif
 
 #ifdef CONFIG_PCI
diff --git a/arch/mips/vr41xx/zao-capcella/setup.c b/arch/mips/vr41xx/zao-capcella/setup.c
index d0f081a26..8b1e178ae 100644
--- a/arch/mips/vr41xx/zao-capcella/setup.c
+++ b/arch/mips/vr41xx/zao-capcella/setup.c
@@ -84,7 +84,8 @@ static int zao_capcella_setup(void)
 	ioport_resource.end = IO_PORT_RESOURCE_END;
 
 #ifdef CONFIG_SERIAL_8250
-	vr41xx_siu_init(SIU_RS232C, 0);
+	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
+	vr41xx_siu_init();
 	vr41xx_dsiu_init();
 #endif
 
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 751f3ac76..ccd63a41f 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -51,25 +51,34 @@ choice
 config PA7000
 	bool "PA7000/PA7100"
 	---help---
-	  This is the processor type of your CPU. This information is used for
-	  optimizing purposes.  In order to compile a kernel that can run on
-	  all PA CPUs (albeit not optimally fast), you can specify "PA7000"
-	  here.
+	  This is the processor type of your CPU.  This information is
+	  used for optimizing purposes.  In order to compile a kernel
+	  that can run on all 32-bit PA CPUs (albeit not optimally fast),
+	  you can specify "PA7000" here.
 
 	  Specifying "PA8000" here will allow you to select a 64-bit kernel
 	  which is required on some machines.
 
 config PA7100LC
-	bool "PA7100LC/PA7300LC"
+	bool "PA7100LC"
 	help
-	  Select this option for a 7100LC or 7300LC processor, as used
-	  in the 712, 715/Mirage, A180, B132, C160L and some other machines.
+	  Select this option for the PCX-L processor, as used in the
+	  712, 715/64, 715/80, 715/100, 715/100XC, 725/100, 743, 748,
+	  D200, D210, D300, D310 and E-class
 
 config PA7200
 	bool "PA7200"
 	help
-	  Select this option for the PCX-T' processor, as used in C110, D100
-	  and similar machines.
+	  Select this option for the PCX-T' processor, as used in the
+	  C100, C110, J100, J110, J210XC, D250, D260, D350, D360,
+	  K100, K200, K210, K220, K400, K410 and K420
+
+config PA7300LC
+	bool "PA7300LC"
+	help
+	  Select this option for the PCX-L2 processor, as used in the
+	  744, A180, B132L, B160L, B180L, C132L, C160L, C180L,
+	  D220, D230, D320 and D330.
 
 config PA8X00
 	bool "PA8000 and up"
@@ -81,14 +90,16 @@ endchoice
 # Define implied options from the CPU selection here
 
 config PA20
-	bool
+	def_bool y
 	depends on PA8X00
-	default y
 
 config PA11
-	bool
-	depends on PA7000 || PA7100LC || PA7200
-	default y
+	def_bool y
+	depends on PA7000 || PA7100LC || PA7200 || PA7300LC
+
+config PREFETCH
+	def_bool y
+	depends on PA8X00
 
 config PARISC64
 	bool "64-bit kernel"
@@ -106,18 +117,6 @@ config PARISC64
 config 64BIT
 	def_bool PARISC64
 
-config PDC_NARROW
-	bool "32-bit firmware"
-	depends on PARISC64
-	help
-	  This option will enable owners of C160, C180, C200, C240, C360, J280,
-	  J282, J2240 and some D/K/R class to run a 64bit kernel with their
-	  32bit PDC firmware.
-	
-	  Nobody should try this option unless they know what they are doing.
-	
-	  If unsure, say N.
-
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 201156cae..b59911f2c 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -16,7 +16,7 @@
 # Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
 # Mike Shaver, Helge Deller and Martin K. Petersen
 #
-NM		= sh arch/parisc/nm
+NM		= sh $(srctree)/arch/parisc/nm
 ifdef CONFIG_PARISC64
 CROSS_COMPILE	:= hppa64-linux-
 UTS_MACHINE	:= parisc64
@@ -48,6 +48,7 @@ cflags-y	+= -ffunction-sections
 cflags-$(CONFIG_PA7100)		+= -march=1.1 -mschedule=7100
 cflags-$(CONFIG_PA7200)		+= -march=1.1 -mschedule=7200
 cflags-$(CONFIG_PA7100LC)	+= -march=1.1 -mschedule=7100LC
+cflags-$(CONFIG_PA7300LC)	+= -march=1.1 -mschedule=7300
 cflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
 
 head-y			:= arch/parisc/kernel/head.o 
diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig
index 8b3ebd1f5..071139d4e 100644
--- a/arch/parisc/configs/712_defconfig
+++ b/arch/parisc/configs/712_defconfig
@@ -141,6 +141,12 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+CONFIG_SCSI_FC_ATTRS=y
+
 #
 # SCSI low-level drivers
 #
@@ -179,10 +185,6 @@ CONFIG_MD_RAID5=y
 # I2O device support
 #
 
-#
-# Macintosh device drivers
-#
-
 #
 # Networking support
 #
@@ -206,7 +208,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
-CONFIG_INET_ECN=y
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -290,6 +291,8 @@ CONFIG_NET_RADIO=y
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
@@ -335,6 +338,7 @@ CONFIG_SERIO_GSCPS2=y
 CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_HIL_OLD is not set
@@ -342,6 +346,7 @@ CONFIG_INPUT_KEYBOARD=y
 CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_MOUSE_HIL is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
@@ -385,11 +390,6 @@ CONFIG_PRINTER=y
 # CONFIG_LP_CONSOLE is not set
 # CONFIG_PPDEV is not set
 # CONFIG_TIPAR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -401,7 +401,6 @@ CONFIG_PRINTER=y
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_DTLK is not set
@@ -635,6 +634,7 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_CAST6 is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig
index 21401b2c6..7fe97811b 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -27,7 +27,7 @@ CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
-# CONFIG_KALLSYMS is not set
+CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -78,6 +78,7 @@ CONFIG_CHASSIS_LCD_LED=y
 # PCMCIA/CardBus support
 #
 CONFIG_PCMCIA=m
+CONFIG_PCMCIA_DEBUG=y
 CONFIG_YENTA=m
 CONFIG_CARDBUS=y
 # CONFIG_I82092 is not set
@@ -129,6 +130,7 @@ CONFIG_BLK_DEV_UMEM=m
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=6144
 CONFIG_BLK_DEV_INITRD=y
@@ -162,6 +164,12 @@ CONFIG_SCSI_REPORT_LUNS=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -242,10 +250,6 @@ CONFIG_FUSION_CTL=m
 # I2O device support
 #
 
-#
-# Macintosh device drivers
-#
-
 #
 # Networking support
 #
@@ -270,7 +274,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
@@ -348,7 +351,6 @@ CONFIG_XFRM_USER=m
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
@@ -504,6 +506,11 @@ CONFIG_PCI_HERMES=m
 CONFIG_PCMCIA_HERMES=m
 CONFIG_AIRO_CS=m
 # CONFIG_PCMCIA_WL3501 is not set
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+# CONFIG_PRISM54 is not set
 CONFIG_NET_WIRELESS=y
 
 #
@@ -512,6 +519,7 @@ CONFIG_NET_WIRELESS=y
 # CONFIG_TR is not set
 # CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -545,6 +553,8 @@ CONFIG_PCMCIA_XIRC2PS=m
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
@@ -617,11 +627,6 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_LEGACY_PTYS is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -633,7 +638,6 @@ CONFIG_UNIX98_PTYS=y
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
 CONFIG_GEN_RTC=y
 CONFIG_GEN_RTC_X=y
 # CONFIG_DTLK is not set
@@ -682,7 +686,6 @@ CONFIG_MAX_RAW_DEVS=256
 # Console display driver support
 #
 # CONFIG_MDA_CONSOLE is not set
-# CONFIG_STI_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE_COLUMNS=160
 CONFIG_DUMMY_CONSOLE_ROWS=64
 CONFIG_DUMMY_CONSOLE=y
@@ -788,7 +791,8 @@ CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
 CONFIG_SUNRPC=m
-# CONFIG_SUNRPC_GSS is not set
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
 CONFIG_SMB_FS=m
 CONFIG_SMB_NLS_DEFAULT=y
 CONFIG_SMB_NLS_REMOTE="cp437"
@@ -887,6 +891,7 @@ CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
 CONFIG_CRYPTO_TEST=m
 
 #
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index 40218f409..65f186377 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -121,6 +121,7 @@ CONFIG_PARPORT_GSC=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_CRYPTOLOOP=y
 # CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_CARMEL=y
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -152,6 +153,12 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -244,10 +251,6 @@ CONFIG_MD_RAID5=y
 #
 # CONFIG_I2O is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Networking support
 #
@@ -271,7 +274,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
-CONFIG_INET_ECN=y
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -376,6 +378,10 @@ CONFIG_NET_RADIO=y
 #
 # CONFIG_AIRO is not set
 # CONFIG_HERMES is not set
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
 CONFIG_NET_WIRELESS=y
 
 #
@@ -403,6 +409,8 @@ CONFIG_NET_WIRELESS=y
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
@@ -449,6 +457,7 @@ CONFIG_SERIO_GSCPS2=y
 CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_HIL_OLD is not set
@@ -459,6 +468,7 @@ CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_INPORT is not set
 # CONFIG_MOUSE_LOGIBM is not set
 # CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_MOUSE_HIL is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
@@ -502,11 +512,6 @@ CONFIG_PRINTER=y
 # CONFIG_LP_CONSOLE is not set
 # CONFIG_PPDEV is not set
 # CONFIG_TIPAR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -518,7 +523,6 @@ CONFIG_PRINTER=y
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
 CONFIG_GEN_RTC=y
 # CONFIG_GEN_RTC_X is not set
 # CONFIG_DTLK is not set
@@ -768,6 +772,7 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_CAST6 is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index f26f6bb43..a0252de6d 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -77,6 +77,7 @@ CONFIG_SUPERIO=y
 # PCMCIA/CardBus support
 #
 CONFIG_PCMCIA=m
+CONFIG_PCMCIA_DEBUG=y
 CONFIG_YENTA=m
 CONFIG_CARDBUS=y
 # CONFIG_I82092 is not set
@@ -128,6 +129,7 @@ CONFIG_BLK_DEV_UMEM=m
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -212,6 +214,12 @@ CONFIG_SCSI_REPORT_LUNS=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -230,6 +238,7 @@ CONFIG_SCSI_ATA_PIIX=m
 CONFIG_SCSI_SATA_PROMISE=m
 CONFIG_SCSI_SATA_SIL=m
 CONFIG_SCSI_SATA_VIA=m
+# CONFIG_SCSI_SATA_VITESSE is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -303,10 +312,6 @@ CONFIG_FUSION_CTL=m
 #
 # CONFIG_I2O is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Networking support
 #
@@ -331,7 +336,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
@@ -409,7 +413,6 @@ CONFIG_XFRM_USER=m
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
@@ -543,6 +546,7 @@ CONFIG_PPPOE=m
 # CONFIG_NET_FC is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -576,6 +580,8 @@ CONFIG_PCMCIA_AXNET=m
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
@@ -619,6 +625,7 @@ CONFIG_SERIO_SERPORT=m
 CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_HIL_OLD is not set
@@ -626,6 +633,7 @@ CONFIG_INPUT_KEYBOARD=y
 CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_MOUSE_HIL is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
@@ -663,11 +671,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -679,7 +682,6 @@ CONFIG_LEGACY_PTY_COUNT=256
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
 CONFIG_GEN_RTC=y
 CONFIG_GEN_RTC_X=y
 # CONFIG_DTLK is not set
@@ -831,7 +833,9 @@ CONFIG_USB_AIPTEK=m
 CONFIG_USB_WACOM=m
 CONFIG_USB_KBTAB=m
 # CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
 # CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
 
 #
 # USB Imaging devices
@@ -968,7 +972,7 @@ CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -1065,6 +1069,7 @@ CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
 CONFIG_CRYPTO_TEST=m
 
 #
diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile
index 6775b82da..b032c6b79 100644
--- a/arch/parisc/kernel/Makefile
+++ b/arch/parisc/kernel/Makefile
@@ -14,7 +14,7 @@ obj-y	     	:= cache.o pacache.o setup.o traps.o time.o irq.o \
 		   pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \
 		   ptrace.o hardware.o inventory.o drivers.o semaphore.o \
 		   signal.o hpmc.o real2.o parisc_ksyms.o unaligned.o \
-		   process.o processor.o pdc_cons.o pdc_chassis.o
+		   process.o processor.o pdc_cons.o pdc_chassis.o unwind.o
 
 obj-$(CONFIG_SMP)	+= smp.o
 obj-$(CONFIG_PA11)	+= pci-dma.o
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index f4dac2e3c..64d49cb2d 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -32,6 +32,7 @@
 #include <linux/thread_info.h>
 #include <linux/version.h>
 #include <linux/ptrace.h>
+#include <asm/pgtable.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
@@ -276,5 +277,19 @@ int main(void)
 	DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT);
 	DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT);
 	BLANK();
+	DEFINE(ASM_PMD_SHIFT, PMD_SHIFT);
+	DEFINE(ASM_PGDIR_SHIFT, PGDIR_SHIFT);
+	DEFINE(ASM_BITS_PER_PGD, BITS_PER_PGD);
+	DEFINE(ASM_BITS_PER_PMD, BITS_PER_PMD);
+	DEFINE(ASM_BITS_PER_PTE, BITS_PER_PTE);
+	DEFINE(ASM_PGD_PMD_OFFSET, -(PAGE_SIZE << PGD_ORDER));
+	DEFINE(ASM_PMD_ENTRY, ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT));
+	DEFINE(ASM_PGD_ENTRY, PAGE_OFFSET >> PGDIR_SHIFT);
+	DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE);
+	DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE);
+	DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE);
+	DEFINE(ASM_PT_INITIAL, PT_INITIAL);
+	DEFINE(ASM_PAGE_SIZE, PAGE_SIZE);
+	BLANK();
 	return 0;
 }
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 27ae25fdf..9fc061440 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -17,6 +17,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/seq_file.h>
+#include <linux/pagemap.h>
 
 #include <asm/pdc.h>
 #include <asm/cache.h>
@@ -230,68 +231,45 @@ void disable_sr_hashing(void)
 void __flush_dcache_page(struct page *page)
 {
 	struct address_space *mapping = page_mapping(page);
-	struct mm_struct *mm = current->active_mm;
-	struct list_head *l;
+	struct vm_area_struct *mpnt = NULL;
+	struct prio_tree_iter iter;
+	unsigned long offset;
+	unsigned long addr;
+	pgoff_t pgoff;
 
 	flush_kernel_dcache_page(page_address(page));
 
 	if (!mapping)
 		return;
-	/* check shared list first if it's not empty...it's usually
-	 * the shortest */
-	list_for_each(l, &mapping->i_mmap_shared) {
-		struct vm_area_struct *mpnt;
-		unsigned long off;
-
-		mpnt = list_entry(l, struct vm_area_struct, shared);
-
-		/*
-		 * If this VMA is not in our MM, we can ignore it.
-		 */
-		if (mpnt->vm_mm != mm)
-			continue;
-
-		if (page->index < mpnt->vm_pgoff)
-			continue;
-
-		off = page->index - mpnt->vm_pgoff;
-		if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
-			continue;
-
-		flush_cache_page(mpnt, mpnt->vm_start + (off << PAGE_SHIFT));
 
-		/* All user shared mappings should be equivalently mapped,
-		 * so once we've flushed one we should be ok
-		 */
-		return;
-	}
-
-	/* then check private mapping list for read only shared mappings
-	 * which are flagged by VM_MAYSHARE */
-	list_for_each(l, &mapping->i_mmap) {
-		struct vm_area_struct *mpnt;
-		unsigned long off;
+	pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
 
-		mpnt = list_entry(l, struct vm_area_struct, shared);
+	/* We have carefully arranged in arch_get_unmapped_area() that
+	 * *any* mappings of a file are always congruently mapped (whether
+	 * declared as MAP_PRIVATE or MAP_SHARED), so we only need
+	 * to flush one address here for them all to become coherent */
 
+	flush_dcache_mmap_lock(mapping);
+	while ((mpnt = vma_prio_tree_next(mpnt, &mapping->i_mmap,
+					&iter, pgoff, pgoff)) != NULL) {
+		offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
+		addr = mpnt->vm_start + offset;
 
-		if (mpnt->vm_mm != mm || !(mpnt->vm_flags & VM_MAYSHARE))
-			continue;
-
-		if (page->index < mpnt->vm_pgoff)
-			continue;
+		/* Flush instructions produce non access tlb misses.
+		 * On PA, we nullify these instructions rather than
+		 * taking a page fault if the pte doesn't exist.
+		 * This is just for speed.  If the page translation
+		 * isn't there, there's no point exciting the
+		 * nadtlb handler into a nullification frenzy */
 
-		off = page->index - mpnt->vm_pgoff;
-		if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
+		if (!translation_exists(mpnt, addr))
 			continue;
 
-		flush_cache_page(mpnt, mpnt->vm_start + (off << PAGE_SHIFT));
+		__flush_cache_page(mpnt, addr);
 
-		/* All user shared mappings should be equivalently mapped,
-		 * so once we've flushed one we should be ok
-		 */
 		break;
 	}
+	flush_dcache_mmap_unlock(mapping);
 }
 EXPORT_SYMBOL(__flush_dcache_page);
 
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 040956b70..9c284947d 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -40,11 +40,13 @@
 #ifdef __LP64__
 #define CMPIB           cmpib,*
 #define CMPB            cmpb,*
+#define COND(x)		*x
 
 	.level 2.0w
 #else
 #define CMPIB           cmpib,
 #define CMPB            cmpb,
+#define COND(x)		x
 
 	.level 2.0
 #endif
@@ -389,6 +391,228 @@
 	.align		32
 	.endm
 
+	/* The following are simple 32 vs 64 bit instruction
+	 * abstractions for the macros */
+	.macro		EXTR	reg1,start,length,reg2
+#ifdef __LP64__
+	extrd,u		\reg1,32+\start,\length,\reg2
+#else
+	extrw,u		\reg1,\start,\length,\reg2
+#endif
+	.endm
+
+	.macro		DEP	reg1,start,length,reg2
+#ifdef __LP64__
+	depd		\reg1,32+\start,\length,\reg2
+#else
+	depw		\reg1,\start,\length,\reg2
+#endif
+	.endm
+
+	.macro		DEPI	val,start,length,reg
+#ifdef __LP64__
+	depdi		\val,32+\start,\length,\reg
+#else
+	depwi		\val,\start,\length,\reg
+#endif
+	.endm
+
+	/* In LP64, the space contains part of the upper 32 bits of the
+	 * fault.  We have to extract this and place it in the va,
+	 * zeroing the corresponding bits in the space register */
+	.macro		space_adjust	spc,va,tmp
+#ifdef __LP64__
+	extrd,u		\spc,63,SPACEID_SHIFT,\tmp
+	depd		%r0,63,SPACEID_SHIFT,\spc
+	depd		\tmp,31,SPACEID_SHIFT,\va
+#endif
+	.endm
+
+	.import		swapper_pg_dir,code
+
+	/* Get the pgd.  For faults on space zero (kernel space), this
+	 * is simply swapper_pg_dir.  For user space faults, the
+	 * pgd is stored in %cr25 */
+	.macro		get_pgd		spc,reg
+	ldil		L%PA(swapper_pg_dir),\reg
+	ldo		R%PA(swapper_pg_dir)(\reg),\reg
+	or,COND(=)	%r0,\spc,%r0
+	mfctl		%cr25,\reg
+	.endm
+
+	/* Only allow faults on different spaces from the
+	 * currently active one if we're the kernel */
+	.macro		space_check	spc,tmp,fault
+	mfsp		%sr7,\tmp
+	or,COND(<>)	%r0,\spc,%r0	/* user may execute gateway page
+					 * as kernel, so defeat the space
+					 * check if it is */
+	copy		\spc,\tmp
+	or,COND(=)	%r0,\tmp,%r0	/* nullify if executing as kernel */
+	cmpb,COND(<>),n	\tmp,\spc,\fault
+	.endm
+
+	/* Look up a PTE in a 2-Level scheme (faulting at each
+	 * level if the entry isn't present 
+	 *
+	 * NOTE: we use ldw even for LP64 because our pte
+	 * and pmd are allocated <4GB */
+	.macro		L2_ptep	pmd,pte,index,va,fault
+#if PT_NLEVELS == 3
+	EXTR		\va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
+#else
+	EXTR		\va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
+#endif
+	DEP		%r0,31,PAGE_SHIFT,\pmd	/* clear offset */
+	copy		%r0,\pte
+	ldw,s		\index(\pmd),\pmd
+	EXTR		\va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
+	bb,>=,n		\pmd,_PAGE_PRESENT_BIT,\fault
+	DEP		%r0,31,PAGE_SHIFT,\pmd	/* clear offset */
+	shladd		\index,BITS_PER_PTE_ENTRY,\pmd,\pmd
+	LDREG		%r0(\pmd),\pte		/* pmd is now pte */
+	bb,>=,n		\pte,_PAGE_PRESENT_BIT,\fault
+	.endm
+
+	/* Look up PTE in a 3-Level scheme.
+	 *
+	 * Here we implement a Hybrid L2/L3 scheme: we allocate the
+	 * first pmd adjacent to the pgd.  This means that we can
+	 * subtract a constant offset to get to it.  The pmd and pgd
+	 * sizes are arranged so that a single pmd covers 4GB (giving
+	 * a full LP64 process access to 8TB) so our lookups are
+	 * effectively L2 for the first 4GB of the kernel (i.e. for
+	 * all ILP32 processes and all the kernel for machines with
+	 * under 4GB of memory) */
+	.macro		L3_ptep pgd,pte,index,va,fault
+	extrd,u		\va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
+	copy		%r0,\pte
+	extrd,u,*=	\va,31,32,%r0
+	ldw,s		\index(\pgd),\pgd
+	extrd,u,*<>	\va,31,32,%r0
+	ldo		ASM_PGD_PMD_OFFSET(\pgd),\pgd
+	extrd,u,*=	\va,31,32,%r0
+	bb,>=,n		\pgd,_PAGE_PRESENT_BIT,\fault
+	L2_ptep		\pgd,\pte,\index,\va,\fault
+	.endm
+
+	/* Set the _PAGE_ACCESSED bit of the PTE.  Be clever and
+	 * don't needlessly dirty the cache line if it was already set */
+	.macro		update_ptep	ptep,pte,tmp,tmp1
+	ldi		_PAGE_ACCESSED,\tmp1
+	or		\tmp1,\pte,\tmp
+	and,COND(<>)	\tmp1,\pte,%r0
+	STREG		\tmp,0(\ptep)
+	.endm
+
+	/* Set the dirty bit (and accessed bit).  No need to be
+	 * clever, this is only used from the dirty fault */
+	.macro		update_dirty	ptep,pte,tmp,tmp1
+	ldi		_PAGE_ACCESSED|_PAGE_DIRTY,\tmp
+	or		\tmp,\pte,\pte
+	STREG		\pte,0(\ptep)
+	.endm
+
+	/* Convert the pte and prot to tlb insertion values.  How
+	 * this happens is quite subtle, read below */
+	.macro		make_insert_tlb	spc,pte,prot
+	space_to_prot   \spc \prot        /* create prot id from space */
+	/* The following is the real subtlety.  This is depositing
+	 * T <-> _PAGE_REFTRAP
+	 * D <-> _PAGE_DIRTY
+	 * B <-> _PAGE_DMB (memory break)
+	 *
+	 * Then incredible subtlety: The access rights are
+	 * _PAGE_GATEWAY _PAGE_EXEC _PAGE_READ
+	 * See 3-14 of the parisc 2.0 manual
+	 *
+	 * Finally, _PAGE_READ goes in the top bit of PL1 (so we
+	 * trigger an access rights trap in user space if the user
+	 * tries to read an unreadable page */
+	depd            \pte,8,7,\prot
+
+	/* PAGE_USER indicates the page can be read with user privileges,
+	 * so deposit X1|11 to PL1|PL2 (remember the upper bit of PL1
+	 * contains _PAGE_READ */
+	extrd,u,*=      \pte,_PAGE_USER_BIT+32,1,%r0
+	depdi		7,11,3,\prot
+	/* If we're a gateway page, drop PL2 back to zero for promotion
+	 * to kernel privilege (so we can execute the page as kernel).
+	 * Any privilege promotion page always denys read and write */
+	extrd,u,*= 	\pte,_PAGE_GATEWAY_BIT+32,1,%r0
+	depd		%r0,11,2,\prot	/* If Gateway, Set PL2 to 0 */
+
+	/* Get rid of prot bits and convert to page addr for iitlbt */
+
+	depd		%r0,63,PAGE_SHIFT,\pte
+	extrd,u		\pte,56,32,\pte
+	.endm
+
+	/* Identical macro to make_insert_tlb above, except it
+	 * makes the tlb entry for the differently formatted pa11
+	 * insertion instructions */
+	.macro		make_insert_tlb_11	spc,pte,prot
+	zdep		\spc,30,15,\prot
+	dep		\pte,8,7,\prot
+	extru,=		\pte,_PAGE_NO_CACHE_BIT,1,%r0
+	depi		1,12,1,\prot
+	extru,=         \pte,_PAGE_USER_BIT,1,%r0
+	depi		7,11,3,\prot   /* Set for user space (1 rsvd for read) */
+	extru,= 	\pte,_PAGE_GATEWAY_BIT,1,%r0
+	depi		0,11,2,\prot	/* If Gateway, Set PL2 to 0 */
+
+	/* Get rid of prot bits and convert to page addr for iitlba */
+
+	depi		0,31,12,\pte
+	extru		\pte,24,25,\pte
+
+	.endm
+
+	/* This is for ILP32 PA2.0 only.  The TLB insertion needs
+	 * to extend into I/O space if the address is 0xfXXXXXXX
+	 * so we extend the f's into the top word of the pte in
+	 * this case */
+	.macro		f_extend	pte,tmp
+	extrd,s		\pte,42,4,\tmp
+	addi,<>		1,\tmp,%r0
+	extrd,s		\pte,63,25,\pte
+	.endm
+
+	/* The alias region is an 8MB aligned 16MB to do clear and
+	 * copy user pages at addresses congruent with the user
+	 * virtual address.
+	 *
+	 * To use the alias page, you set %r26 up with the to TLB
+	 * entry (identifying the physical page) and %r23 up with
+	 * the from tlb entry (or nothing if only a to entry---for
+	 * clear_user_page_asm) */
+	.macro		do_alias	spc,tmp,tmp1,va,pte,prot,fault
+	cmpib,COND(<>),n 0,\spc,\fault
+	ldil		L%(TMPALIAS_MAP_START),\tmp
+#if defined(__LP64__) && (TMPALIAS_MAP_START >= 0x80000000)
+	/* on LP64, ldi will sign extend into the upper 32 bits,
+	 * which is behaviour we don't want */
+	depdi		0,31,32,\tmp
+#endif
+	copy		\va,\tmp1
+	DEPI		0,31,23,\tmp1
+	cmpb,COND(<>),n	\tmp,\tmp1,\fault
+	ldi		(_PAGE_DIRTY|_PAGE_WRITE|_PAGE_READ),\prot
+	depd,z		\prot,8,7,\prot
+	/*
+	 * OK, it is in the temp alias region, check whether "from" or "to".
+	 * Check "subtle" note in pacache.S re: r23/r26.
+	 */
+#ifdef __LP64__
+	extrd,u,*=	\va,41,1,%r0
+#else
+	extrw,u,=	\va,9,1,%r0
+#endif
+	or,COND(tr)	%r23,%r0,\pte
+	or		%r26,%r0,\pte
+	.endm 
+
+
 	/*
 	 * Align fault_vector_20 on 4K boundary so that both
 	 * fault_vector_11 and fault_vector_20 are on the
@@ -979,82 +1203,23 @@ skip_save_ior:
 #ifdef __LP64__
 
 dtlb_miss_20w:
-	extrd,u         spc,63,7,t1     /* adjust va */
-	depd            t1,31,7,va      /* adjust va */
-	depdi           0,63,7,spc      /* adjust space */
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,*<>          %r0,spc,%r0     /* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extrd,u         va,33,9,t1      /* Get pgd index */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,*=           %r0,t0,%r0      /* If kernel, nullify following test */
-	cmpb,*<>,n       t0,spc,dtlb_fault /* forward */
-
-	/* First level page table lookup */
-
-	ldd,s           t1(ptp),ptp
-	extrd,u         va,42,9,t0     /* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,dtlb_check_alias_20w
-	depdi           0,63,12,ptp     /* clear prot bits */
-
-	/* Second level page table lookup */
+	space_adjust	spc,va,t0
+	get_pgd		spc,ptp
+	space_check	spc,t0,dtlb_fault
 
-	ldd,s           t0(ptp),ptp
-	extrd,u         va,51,9,t0     /* get third-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,dtlb_check_alias_20w
-	depdi           0,63,12,ptp     /* clear prot bits */
+	L3_ptep		ptp,pte,t0,va,dtlb_check_alias_20w
 
-	/* Third level page table lookup */
-
-	shladd           t0,3,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldd              0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,dtlb_check_alias_20w
-
-	/* Check whether the "accessed" bit was set, otherwise do so */
-
-	or		t1,pte,t0	/* t0 has R bit set */
-	and,*<>         t1,pte,%r0      /* test and nullify if already set */
-	std             t0,0(ptp)       /* write back pte */
-
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
-
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlbt */
+	update_ptep	ptp,pte,t0,t1
 
-	depdi		0,63,12,pte
-	extrd,u         pte,56,52,pte
+	make_insert_tlb	spc,pte,prot
+	
 	idtlbt          pte,prot
 
 	rfir
 	nop
 
 dtlb_check_alias_20w:
-
-	/* Check to see if fault is in the temporary alias region */
-
-	cmpib,*<>,n     0,spc,dtlb_fault /* forward */
-	ldil            L%(TMPALIAS_MAP_START),t0
-	copy            va,t1
-	depdi           0,63,23,t1
-	cmpb,*<>,n      t0,t1,dtlb_fault /* forward */
-	ldi             (_PAGE_DIRTY|_PAGE_WRITE|_PAGE_READ),prot
-	depd,z          prot,8,7,prot
-
-	/*
-	 * OK, it is in the temp alias region, check whether "from" or "to".
-	 * Check "subtle" note in pacache.S re: r23/r26.
-	 */
-
-	extrd,u,*=      va,41,1,r0
-	or,*tr          %r23,%r0,pte    /* If "from" use "from" page */
-	or,*            %r26,%r0,pte    /* else "to", use "to" page  */
+	do_alias	spc,t0,t1,va,pte,prot,dtlb_fault
 
 	idtlbt          pte,prot
 
@@ -1062,51 +1227,16 @@ dtlb_check_alias_20w:
 	nop
 
 nadtlb_miss_20w:
-	extrd,u         spc,63,7,t1     /* adjust va */
-	depd            t1,31,7,va      /* adjust va */
-	depdi           0,63,7,spc      /* adjust space */
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,*<>          %r0,spc,%r0     /* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extrd,u         va,33,9,t1      /* Get pgd index */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,*=           %r0,t0,%r0      /* If kernel, nullify following test */
-	cmpb,*<>,n       t0,spc,nadtlb_fault /* forward */
-
-	/* First level page table lookup */
-
-	ldd,s           t1(ptp),ptp
-	extrd,u         va,42,9,t0     /* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,nadtlb_emulate
-	depdi           0,63,12,ptp     /* clear prot bits */
-
-	/* Second level page table lookup */
-
-	ldd,s           t0(ptp),ptp
-	extrd,u         va,51,9,t0     /* get third-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,nadtlb_emulate
-	depdi           0,63,12,ptp     /* clear prot bits */
-
-	/* Third level page table lookup */
+	space_adjust	spc,va,t0
+	get_pgd		spc,ptp
+	space_check	spc,t0,nadtlb_fault
 
-	shladd           t0,3,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldd              0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,nadtlb_check_flush_20w
+	L3_ptep		ptp,pte,t0,va,nadtlb_check_flush_20w
 
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
+	update_ptep	ptp,pte,t0,t1
 
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
+	make_insert_tlb	spc,pte,prot
 
-	/* Get rid of prot bits and convert to page addr for idtlbt */
-
-	depdi		0,63,12,pte
-	extrd,u         pte,56,52,pte
 	idtlbt          pte,prot
 
 	rfir
@@ -1132,49 +1262,15 @@ nadtlb_check_flush_20w:
 #else
 
 dtlb_miss_11:
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,<>           %r0,spc,%r0	/* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extru		va,9,10,t1	/* Get pgd index */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,dtlb_fault /* forward */
-
-	/* First level page table lookup */
-
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,dtlb_check_alias_11
-	depi		0,31,12,ptp	/* clear prot bits */
+	get_pgd		spc,ptp
 
-	/* Second level page table lookup */
+	space_check	spc,t0,dtlb_fault
 
-	sh2addl 	 t0,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldw		 0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,dtlb_check_alias_11
+	L2_ptep		ptp,pte,t0,va,dtlb_check_alias_11
 
-	/* Check whether the "accessed" bit was set, otherwise do so */
+	update_ptep	ptp,pte,t0,t1
 
-	or		t1,pte,t0	/* t0 has R bit set */
-	and,<>		t1,pte,%r0	/* test and nullify if already set */
-	stw		t0,0(ptp)	/* write back pte */
-
-	zdep            spc,30,15,prot  /* create prot id from space */
-	dep             pte,8,7,prot    /* add in prot bits from pte */
-
-	extru,=		pte,_PAGE_NO_CACHE_BIT,1,r0
-	depi		1,12,1,prot
-	extru,=         pte,_PAGE_USER_BIT,1,r0
-	depi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extru,= 	pte,_PAGE_GATEWAY_BIT,1,r0
-	depi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlba */
-
-	depi		0,31,12,pte
-	extru		pte,24,25,pte
+	make_insert_tlb_11	spc,pte,prot
 
 	mfsp		%sr1,t0  /* Save sr1 so we can use it in tlb inserts */
 	mtsp		spc,%sr1
@@ -1215,43 +1311,16 @@ dtlb_check_alias_11:
 	nop
 
 nadtlb_miss_11:
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,<>           %r0,spc,%r0	/* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extru		va,9,10,t1	/* Get pgd index */
+	get_pgd		spc,ptp
 
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,nadtlb_fault /* forward */
+	space_check	spc,t0,nadtlb_fault
 
-	/* First level page table lookup */
+	L2_ptep		ptp,pte,t0,va,nadtlb_check_flush_11
 
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,nadtlb_emulate
-	depi		0,31,12,ptp	/* clear prot bits */
+	update_ptep	ptp,pte,t0,t1
 
-	/* Second level page table lookup */
+	make_insert_tlb_11	spc,pte,prot
 
-	sh2addl 	 t0,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldw		 0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,nadtlb_check_flush_11
-
-	zdep            spc,30,15,prot  /* create prot id from space */
-	dep             pte,8,7,prot    /* add in prot bits from pte */
-
-	extru,=		pte,_PAGE_NO_CACHE_BIT,1,r0
-	depi		1,12,1,prot
-	extru,=         pte,_PAGE_USER_BIT,1,r0
-	depi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extru,= 	pte,_PAGE_GATEWAY_BIT,1,r0
-	depi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlba */
-
-	depi		0,31,12,pte
-	extru		pte,24,25,pte
 
 	mfsp		%sr1,t0  /* Save sr1 so we can use it in tlb inserts */
 	mtsp		spc,%sr1
@@ -1289,120 +1358,44 @@ nadtlb_check_flush_11:
 	nop
 
 dtlb_miss_20:
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,<>           %r0,spc,%r0	/* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extru		va,9,10,t1	/* Get pgd index */
+	space_adjust	spc,va,t0
+	get_pgd		spc,ptp
+	space_check	spc,t0,dtlb_fault
 
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,dtlb_fault /* forward */
+	L2_ptep		ptp,pte,t0,va,dtlb_check_alias_20
 
-	/* First level page table lookup */
+	update_ptep	ptp,pte,t0,t1
 
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,dtlb_check_alias_20
-	depi		0,31,12,ptp	/* clear prot bits */
+	make_insert_tlb	spc,pte,prot
 
-	/* Second level page table lookup */
+	f_extend	pte,t0
 
-	sh2addl 	 t0,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldw		 0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,dtlb_check_alias_20
-
-	/* Check whether the "accessed" bit was set, otherwise do so */
-
-	or		t1,pte,t0	/* t0 has R bit set */
-	and,<>		t1,pte,%r0	/* test and nullify if already set */
-	stw		t0,0(ptp)	/* write back pte */
-
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
-
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlbt */
-
-	extrd,s         pte,35,4,t0
-	depdi		0,63,12,pte	/* clear lower 12 bits */
-        addi,=          1,t0,0 
-        extrd,u,*tr     pte,56,25,pte 
-	extrd,s		pte,56,25,pte	/* bit 31:8 >> 8  */ 
 	idtlbt          pte,prot
 
 	rfir
 	nop
 
 dtlb_check_alias_20:
-
-	/* Check to see if fault is in the temporary alias region */
-
-	cmpib,<>,n      0,spc,dtlb_fault /* forward */
-	ldil            L%(TMPALIAS_MAP_START),t0
-	copy            va,t1
-	depwi           0,31,23,t1
-	cmpb,<>,n       t0,t1,dtlb_fault /* forward */
-	ldi             (_PAGE_DIRTY|_PAGE_WRITE|_PAGE_READ),prot
-	depd,z          prot,8,7,prot
-
-	/*
-	 * OK, it is in the temp alias region, check whether "from" or "to".
-	 * Check "subtle" note in pacache.S re: r23/r26.
-	 */
-
-	extrw,u,=       va,9,1,r0
-	or,tr           %r23,%r0,pte    /* If "from" use "from" page */
-	or              %r26,%r0,pte    /* else "to", use "to" page  */
-
+	do_alias	spc,t0,t1,va,pte,prot,dtlb_fault
+	
 	idtlbt          pte,prot
 
 	rfir
 	nop
 
 nadtlb_miss_20:
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,<>           %r0,spc,%r0	/* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extru		va,9,10,t1	/* Get pgd index */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,nadtlb_fault /* forward */
-
-	/* First level page table lookup */
+	get_pgd		spc,ptp
 
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,nadtlb_emulate
-	depi		0,31,12,ptp	/* clear prot bits */
+	space_check	spc,t0,nadtlb_fault
 
-	/* Second level page table lookup */
+	L2_ptep		ptp,pte,t0,va,nadtlb_check_flush_20
 
-	sh2addl 	 t0,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldw		 0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,nadtlb_check_flush_20
+	update_ptep	ptp,pte,t0,t1
 
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
+	make_insert_tlb	spc,pte,prot
 
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlbt */
-
-        extrd,s         pte,35,4,t0
-        depdi           0,63,12,pte     /* clear lower 12 bits */
-        addi,=          1,t0,0
-        extrd,u,*tr     pte,56,25,pte
-        extrd,s         pte,56,25,pte   /* bit 31:8 >> 8  */
+	f_extend	pte,t0
+	
         idtlbt          pte,prot
 
 	rfir
@@ -1475,119 +1468,33 @@ itlb_miss_20w:
 	 * on the gateway page which is in the kernel address space.
 	 */
 
-	extrd,u         spc,63,7,t1     /* adjust va */
-	depd            t1,31,7,va      /* adjust va */
-	depdi           0,63,7,spc      /* adjust space */
-	cmpib,*=        0,spc,itlb_miss_kernel_20w
-	extrd,u         va,33,9,t1      /* Get pgd index */
-
-	mfctl           %cr25,ptp	/* load user pgd */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,*=           %r0,t0,%r0      /* If kernel, nullify following test */
-	cmpb,*<>,n      t0,spc,itlb_fault /* forward */
-
-	/* First level page table lookup */
-
-itlb_miss_common_20w:
-	ldd,s           t1(ptp),ptp
-	extrd,u         va,42,9,t0     /* get second-level index */
-	bb,>=,n 	ptp,_PAGE_PRESENT_BIT,itlb_fault
-	depdi           0,63,12,ptp     /* clear prot bits */
+	space_adjust	spc,va,t0
+	get_pgd		spc,ptp
+	space_check	spc,t0,itlb_fault
 
-	/* Second level page table lookup */
+	L3_ptep		ptp,pte,t0,va,itlb_fault
 
-	ldd,s           t0(ptp),ptp
-	extrd,u         va,51,9,t0     /* get third-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,itlb_fault
-	depdi           0,63,12,ptp     /* clear prot bits */
+	update_ptep	ptp,pte,t0,t1
 
-	/* Third level page table lookup */
-
-	shladd           t0,3,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldd              0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,itlb_fault
-
-	/* Check whether the "accessed" bit was set, otherwise do so */
-
-	or		t1,pte,t0	/* t0 has R bit set */
-	and,*<>         t1,pte,%r0      /* test and nullify if already set */
-	std             t0,0(ptp)       /* write back pte */
-
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
-
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for iitlbt */
-
-	depdi		0,63,12,pte
-	extrd,u         pte,56,32,pte
+	make_insert_tlb	spc,pte,prot
+	
 	iitlbt          pte,prot
 
 	rfir
 	nop
 
-itlb_miss_kernel_20w:
-	b               itlb_miss_common_20w
-	mfctl           %cr24,ptp	/* Load kernel pgd */
 #else
 
 itlb_miss_11:
+	get_pgd		spc,ptp
 
-	/*
-	 * I miss is a little different, since we allow users to fault
-	 * on the gateway page which is in the kernel address space.
-	 */
-
-	cmpib,=         0,spc,itlb_miss_kernel_11
-	extru		va,9,10,t1	/* Get pgd index */
-
-	mfctl           %cr25,ptp	/* load user pgd */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,itlb_fault /* forward */
-
-	/* First level page table lookup */
-
-itlb_miss_common_11:
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n 	ptp,_PAGE_PRESENT_BIT,itlb_fault
-	depi		0,31,12,ptp	/* clear prot bits */
-
-	/* Second level page table lookup */
+	space_check	spc,t0,itlb_fault
 
-	sh2addl 	 t0,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldw		 0(ptp),pte
-	bb,>=,n 	 pte,_PAGE_PRESENT_BIT,itlb_fault
+	L2_ptep		ptp,pte,t0,va,itlb_fault
 
-	/* Check whether the "accessed" bit was set, otherwise do so */
+	update_ptep	ptp,pte,t0,t1
 
-	or		t1,pte,t0	/* t0 has R bit set */
-	and,<>		t1,pte,%r0	/* test and nullify if already set */
-	stw		t0,0(ptp)	/* write back pte */
-
-	zdep            spc,30,15,prot  /* create prot id from space */
-	dep             pte,8,7,prot    /* add in prot bits from pte */
-
-	extru,=		pte,_PAGE_NO_CACHE_BIT,1,r0
-	depi		1,12,1,prot
-	extru,=         pte,_PAGE_USER_BIT,1,r0
-	depi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extru,= 	pte,_PAGE_GATEWAY_BIT,1,r0
-	depi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for iitlba */
-
-	depi		0,31,12,pte
-	extru		pte,24,25,pte
+	make_insert_tlb_11	spc,pte,prot
 
 	mfsp		%sr1,t0  /* Save sr1 so we can use it in tlb inserts */
 	mtsp		spc,%sr1
@@ -1600,106 +1507,35 @@ itlb_miss_common_11:
 	rfir
 	nop
 
-itlb_miss_kernel_11:
-	b               itlb_miss_common_11
-	mfctl           %cr24,ptp	/* Load kernel pgd */
-
 itlb_miss_20:
+	get_pgd		spc,ptp
 
-	/*
-	 * I miss is a little different, since we allow users to fault
-	 * on the gateway page which is in the kernel address space.
-	 */
-
-	cmpib,=         0,spc,itlb_miss_kernel_20
-	extru		va,9,10,t1	/* Get pgd index */
-
-	mfctl           %cr25,ptp	/* load user pgd */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,itlb_fault /* forward */
+	space_check	spc,t0,itlb_fault
 
-	/* First level page table lookup */
+	L2_ptep		ptp,pte,t0,va,itlb_fault
 
-itlb_miss_common_20:
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n 	ptp,_PAGE_PRESENT_BIT,itlb_fault
-	depi		0,31,12,ptp	/* clear prot bits */
+	update_ptep	ptp,pte,t0,t1
 
-	/* Second level page table lookup */
+	make_insert_tlb	spc,pte,prot
 
-	sh2addl 	 t0,ptp,ptp
-	ldi		_PAGE_ACCESSED,t1
-	ldw		 0(ptp),pte
-	bb,>=,n 	 pte,_PAGE_PRESENT_BIT,itlb_fault
+	f_extend	pte,t0	
 
-	/* Check whether the "accessed" bit was set, otherwise do so */
-
-	or		t1,pte,t0	/* t0 has R bit set */
-	and,<>		t1,pte,%r0	/* test and nullify if already set */
-	stw		t0,0(ptp)	/* write back pte */
-
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
-
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for iitlbt */
-
-        extrd,s         pte,35,4,t0 
-        depdi           0,63,12,pte     /* clear lower 12 bits */
-        addi,=          1,t0,0
-        extrd,u,*tr     pte,56,25,pte 
-        extrd,s         pte,56,25,pte   /* bit 31:8 >> 8  */
 	iitlbt          pte,prot
 
 	rfir
 	nop
 
-
-itlb_miss_kernel_20:
-	b               itlb_miss_common_20
-	mfctl           %cr24,ptp	/* Load kernel pgd */
 #endif
 
 #ifdef __LP64__
 
 dbit_trap_20w:
-	extrd,u         spc,63,7,t1     /* adjust va */
-	depd            t1,31,7,va      /* adjust va */
-	depdi           0,1,2,va        /* adjust va */
-	depdi           0,63,7,spc      /* adjust space */
-	mfctl           %cr25,ptp	/* Assume user space miss */
-	or,*<>          %r0,spc,%r0     /* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extrd,u         va,33,9,t1      /* Get pgd index */
+	space_adjust	spc,va,t0
+	get_pgd		spc,ptp
+	space_check	spc,t0,dbit_fault
 
-	mfsp            %sr7,t0		/* Get current space */
-	or,*=           %r0,t0,%r0      /* If kernel, nullify following test */
-	cmpb,*<>,n       t0,spc,dbit_fault /* forward */
+	L3_ptep		ptp,pte,t0,va,dbit_fault
 
-	/* First level page table lookup */
-
-	ldd,s           t1(ptp),ptp
-	extrd,u         va,42,9,t0     /* get second-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,dbit_fault
-	depdi           0,63,12,ptp     /* clear prot bits */
-
-	/* Second level page table lookup */
-
-	ldd,s           t0(ptp),ptp
-	extrd,u         va,51,9,t0     /* get third-level index */
-	bb,>=,n         ptp,_PAGE_PRESENT_BIT,dbit_fault
-	depdi           0,63,12,ptp     /* clear prot bits */
-
-	/* Third level page table lookup */
-
-	shladd           t0,3,ptp,ptp
 #ifdef CONFIG_SMP
 	CMPIB=,n        0,spc,dbit_nolock_20w
 	ldil            L%PA(pa_dbit_lock),t0
@@ -1712,27 +1548,10 @@ dbit_spin_20w:
 
 dbit_nolock_20w:
 #endif
-	ldi		(_PAGE_ACCESSED|_PAGE_DIRTY),t1
-	ldd              0(ptp),pte
-	bb,>=,n          pte,_PAGE_PRESENT_BIT,dbit_fault
-
-	/* Set Accessed and Dirty bits in the pte */
-
-	or		t1,pte,pte
-	std             pte,0(ptp)      /* write back pte */
+	update_dirty	ptp,pte,t0,t1
 
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
-
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlbt */
-
-	depdi		0,63,12,pte
-	extrd,u         pte,56,52,pte
+	make_insert_tlb	spc,pte,prot
+		
 	idtlbt          pte,prot
 #ifdef CONFIG_SMP
 	CMPIB=,n        0,spc,dbit_nounlock_20w
@@ -1747,25 +1566,13 @@ dbit_nounlock_20w:
 #else
 
 dbit_trap_11:
-	mfctl           %cr25,ptp	/* Assume user space trap */
-	or,<>           %r0,spc,%r0	/* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extru		va,9,10,t1	/* Get pgd index */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,dbit_fault /* forward */
 
-	/* First level page table lookup */
+	get_pgd		spc,ptp
 
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n 	ptp,_PAGE_PRESENT_BIT,dbit_fault
-	depi		0,31,12,ptp	/* clear prot bits */
+	space_check	spc,t0,dbit_fault
 
-	/* Second level page table lookup */
+	L2_ptep		ptp,pte,t0,va,dbit_fault
 
-	sh2addl 	 t0,ptp,ptp
 #ifdef CONFIG_SMP
 	CMPIB=,n        0,spc,dbit_nolock_11
 	ldil            L%PA(pa_dbit_lock),t0
@@ -1778,29 +1585,9 @@ dbit_spin_11:
 
 dbit_nolock_11:
 #endif
-	ldi		(_PAGE_ACCESSED|_PAGE_DIRTY),t1
-	ldw		 0(ptp),pte
-	bb,>=,n 	 pte,_PAGE_PRESENT_BIT,dbit_fault
+	update_dirty	ptp,pte,t0,t1
 
-	/* Set Accessed and Dirty bits in the pte */
-
-	or		t1,pte,pte
-	stw		pte,0(ptp)	/* write back pte */
-
-	zdep            spc,30,15,prot  /* create prot id from space */
-	dep             pte,8,7,prot    /* add in prot bits from pte */
-
-	extru,=		pte,_PAGE_NO_CACHE_BIT,1,r0
-	depi		1,12,1,prot
-	extru,=         pte,_PAGE_USER_BIT,1,r0
-	depi		7,11,3,prot /* Set for user space (1 rsvd for read) */
-	extru,= 	pte,_PAGE_GATEWAY_BIT,1,r0
-	depi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-	/* Get rid of prot bits and convert to page addr for idtlba */
-
-	depi		0,31,12,pte
-	extru		pte,24,25,pte
+	make_insert_tlb_11	spc,pte,prot
 
 	mfsp            %sr1,t1  /* Save sr1 so we can use it in tlb inserts */
 	mtsp		spc,%sr1
@@ -1821,25 +1608,12 @@ dbit_nounlock_11:
 	nop
 
 dbit_trap_20:
-	mfctl           %cr25,ptp	/* Assume user space trap */
-	or,<>           %r0,spc,%r0	/* If it is user space, nullify */
-	mfctl           %cr24,ptp	/* Load kernel pgd instead */
-	extru		va,9,10,t1	/* Get pgd index */
-
-	mfsp            %sr7,t0		/* Get current space */
-	or,=            %r0,t0,%r0	/* If kernel, nullify following test */
-	cmpb,<>,n       t0,spc,dbit_fault /* forward */
+	get_pgd		spc,ptp
 
-	/* First level page table lookup */
+	space_check	spc,t0,dbit_fault
 
-	ldwx,s		t1(ptp),ptp
-	extru		va,19,10,t0	/* get second-level index */
-	bb,>=,n 	ptp,_PAGE_PRESENT_BIT,dbit_fault
-	depi		0,31,12,ptp	/* clear prot bits */
+	L2_ptep		ptp,pte,t0,va,dbit_fault
 
-	/* Second level page table lookup */
-
-	sh2addl 	 t0,ptp,ptp
 #ifdef CONFIG_SMP
 	CMPIB=,n        0,spc,dbit_nolock_20
 	ldil            L%PA(pa_dbit_lock),t0
@@ -1852,28 +1626,12 @@ dbit_spin_20:
 
 dbit_nolock_20:
 #endif
-	ldi		(_PAGE_ACCESSED|_PAGE_DIRTY),t1
-	ldw		 0(ptp),pte
-	bb,>=,n 	 pte,_PAGE_PRESENT_BIT,dbit_fault
-
-	/* Set Accessed and Dirty bits in the pte */
+	update_dirty	ptp,pte,t0,t1
 
-	or		t1,pte,pte
-	stw		pte,0(ptp)	/* write back pte */
+	make_insert_tlb	spc,pte,prot
 
-	space_to_prot   spc prot        /* create prot id from space */
-	depd            pte,8,7,prot    /* add in prot bits from pte */
-
-	extrd,u,*=      pte,_PAGE_USER_BIT+32,1,r0
-	depdi		7,11,3,prot   /* Set for user space (1 rsvd for read) */
-	extrd,u,*= 	pte,_PAGE_GATEWAY_BIT+32,1,r0
-	depdi		0,11,2,prot	/* If Gateway, Set PL2 to 0 */
-
-        extrd,s         pte,35,4,t0 
-        depdi           0,63,12,pte     /* clear lower 12 bits */
-        addi,=          1,t0,0
-        extrd,u,*tr     pte,56,25,pte 
-        extrd,s         pte,56,25,pte   /* bit 31:8 >> 8  */
+	f_extend	pte,t0
+	
         idtlbt          pte,prot
 
 #ifdef CONFIG_SMP
@@ -2285,9 +2043,13 @@ syscall_check_sig:
 	bb,<,n	%r19, 31-TIF_SIGPENDING, syscall_do_signal /* forward */
 
 syscall_restore:
-	LDREG	TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19    /* get ti flags */
-	bb,<	%r19, 31-TIF_SYSCALL_TRACE,syscall_restore_rfi
-	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1	/* delay slot! */
+	/* Are we being ptraced? */
+	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
+
+	LDREG	TASK_PTRACE(%r1), %r19
+	bb,<	%r19,31,syscall_restore_rfi
+	nop
+
 	ldo	TASK_PT_FR31(%r1),%r19		   /* reload fpregs */
 	rest_fp	%r19
 
@@ -2337,7 +2099,6 @@ syscall_restore:
 	 * the most efficient way of doing things, but it works.
 	 */
 syscall_restore_rfi:
-	LDREG	TASK_PTRACE(%r1), %r19
 	ldo	-1(%r0),%r2			   /* Set recovery cntr to -1 */
 	mtctl	%r2,%cr0			   /*   for immediate trap */
 	LDREG	TASK_PT_PSW(%r1),%r2		   /* Get old PSW */
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index da94aec7b..8127a7098 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -10,6 +10,7 @@
  * Copyright 1999 SuSE GmbH Nuernberg (Philipp Rumpf, prumpf@tux.org)
  * Copyright 1999 The Puffin Group, (Alex deVries, David Kennedy)
  * Copyright 2003 Grant Grundler <grundler parisc-linux org>
+ * Copyright 2003,2004 Ryan Bradetich <rbrad@parisc-linux.org>
  *
  *    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
@@ -71,6 +72,15 @@ static spinlock_t pdc_lock = SPIN_LOCK_UNLOCKED;
 static unsigned long pdc_result[32] __attribute__ ((aligned (8)));
 static unsigned long pdc_result2[32] __attribute__ ((aligned (8)));
 
+#ifdef __LP64__
+#define WIDE_FIRMWARE 0x1
+#define NARROW_FIRMWARE 0x2
+
+/* Firmware needs to be initially set to narrow to determine the 
+ * actual firmware width. */
+int parisc_narrow_firmware = 1;
+#endif
+
 /* on all currently-supported platforms, IODC I/O calls are always
  * 32-bit calls, and MEM_PDC calls are always the same width as the OS.
  * This means Cxxx boxes can't run wide kernels right now. -PB
@@ -87,11 +97,11 @@ long real64_call(unsigned long function, ...);
 #endif
 long real32_call(unsigned long function, ...);
 
-#if defined(__LP64__) && ! defined(CONFIG_PDC_NARROW)
-#define MEM_PDC (unsigned long)(PAGE0->mem_pdc_hi) << 32 | PAGE0->mem_pdc
-#   define mem_pdc_call(args...) real64_call(MEM_PDC, args)
+#ifdef __LP64__
+#   define MEM_PDC (unsigned long)(PAGE0->mem_pdc_hi) << 32 | PAGE0->mem_pdc
+#   define mem_pdc_call(args...) unlikely(parisc_narrow_firmware) ? real32_call(MEM_PDC, args) : real64_call(MEM_PDC, args)
 #else
-#define MEM_PDC (unsigned long)PAGE0->mem_pdc
+#   define MEM_PDC (unsigned long)PAGE0->mem_pdc
 #   define mem_pdc_call(args...) real32_call(MEM_PDC, args)
 #endif
 
@@ -105,12 +115,14 @@ long real32_call(unsigned long function, ...);
  */
 static unsigned long f_extend(unsigned long address)
 {
-#ifdef CONFIG_PDC_NARROW
-	if((address & 0xff000000) == 0xf0000000)
-		return 0xf0f0f0f000000000 | (u32)address;
+#ifdef __LP64__
+	if(unlikely(parisc_narrow_firmware)) {
+		if((address & 0xff000000) == 0xf0000000)
+			return 0xf0f0f0f000000000 | (u32)address;
 
-	if((address & 0xf0000000) == 0xf0000000)
-		return 0xffffffff00000000 | (u32)address;
+		if((address & 0xf0000000) == 0xf0000000)
+			return 0xffffffff00000000 | (u32)address;
+	}
 #endif
 	return address;
 }
@@ -125,11 +137,34 @@ static unsigned long f_extend(unsigned long address)
  */
 static void convert_to_wide(unsigned long *addr)
 {
-#ifdef CONFIG_PDC_NARROW
+#ifdef __LP64__
 	int i;
-	unsigned *p = (unsigned int *)addr;
-	for(i = 31; i >= 0; --i)
-		addr[i] = p[i];
+	unsigned int *p = (unsigned int *)addr;
+
+	if(unlikely(parisc_narrow_firmware)) {
+		for(i = 31; i >= 0; --i)
+			addr[i] = p[i];
+	}
+#endif
+}
+
+/**
+ * set_firmware_width - Determine if the firmware is wide or narrow.
+ * 
+ * This function must be called before any pdc_* function that uses the convert_to_wide
+ * function.
+ */
+void __init set_firmware_width(void)
+{
+#ifdef __LP64__
+	int retval;
+
+        spin_lock_irq(&pdc_lock);
+	retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
+	convert_to_wide(pdc_result);
+	if(pdc_result[0] != NARROW_FIRMWARE)
+		parisc_narrow_firmware = 0;
+        spin_unlock_irq(&pdc_lock);
 #endif
 }
 
@@ -582,6 +617,7 @@ int pdc_get_initiator(struct hardware_path *hwpath, unsigned char *scsi_id,
 		case 10:  *period = 1000; break;
 		case 20:  *period = 500; break;
 		case 40:  *period = 250; break;
+		case 80:  *period = 125; break;
 		default: /* Do nothing */ break;
 	}
 
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c
index f9723cbf7..b423e7d79 100644
--- a/arch/parisc/kernel/hardware.c
+++ b/arch/parisc/kernel/hardware.c
@@ -1273,8 +1273,8 @@ static struct hp_cpu_type_mask {
 	{ 0x05e6, 0x0ffe, pcxw2  },  /* 0x05e6 - 0x05e7 */
 	{ 0x05e8, 0x0ff8, pcxw2  },  /* 0x05e8 - 0x05ef */
 	{ 0x05f0, 0x0ff0, pcxw2  },  /* 0x05f0 - 0x05ff */
-	{ 0x0600, 0x0ff0, pcxl   },  /* 0x0600 - 0x060f */
-	{ 0x0610, 0x0ff0, pcxl   },  /* 0x0610 - 0x061f */
+	{ 0x0600, 0x0fe0, pcxl   },  /* 0x0600 - 0x061f */
+	{ 0x0880, 0x0ff0, mako   },  /* 0x0880 - 0x088f */
 	{ 0x0000, 0x0000, pcx    }	/* terminate table */
 };
 
@@ -1289,7 +1289,8 @@ char *cpu_name_version[][2] = {
 	[pcxu_]	{ "PA8200 (PCX-U+)",	"2.0" },
 	[pcxw]	{ "PA8500 (PCX-W)",	"2.0" },
 	[pcxw_]	{ "PA8600 (PCX-W+)",	"2.0" },
-	[pcxw2]	{ "PA8700 (PCX-W2)",	"2.0" }
+	[pcxw2]	{ "PA8700 (PCX-W2)",	"2.0" },
+	[mako]	{ "PA8800 (MAKO)",	"2.0" }
 };
 
 const char * __init
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index d7aff5e90..0297d4164 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -82,19 +82,21 @@ $bss_loop:
 	ldo		R%PA(swapper_pg_dir)(%r4),%r4
 	mtctl		%r4,%cr24	/* Initialize kernel root pointer */
 	mtctl		%r4,%cr25	/* Initialize user root pointer */
+	ldi		ASM_PT_INITIAL,%r1
+	ldo		ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
+1:
+	stw             %r3,0(%r4)
+	ldo		ASM_PAGE_SIZE(%r3),%r3
+	addib,>		-1,%r1,1b
+	ldo		ASM_PGD_ENTRY_SIZE(%r4),%r4
 
-#if (__PAGE_OFFSET != 0x10000000UL)
-Error! Code below (the next two stw's) needs to be changed
-#endif
-
-	stw             %r3,0x100(%r4)  /* Hardwired 0x1... kernel Vaddr start*/
-	ldo		0x1000(%r3),%r3
-	stw             %r3,0x104(%r4)
 	ldo		_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
+	ldil		L%PA(pg0),%r1
+	ldo		R%PA(pg0)(%r1),%r1
 $pgt_fill_loop:
-	stwm		%r3,4(%r1)
-	ldo		0x1000(%r3),%r3
-	bb,>=		%r3,8,$pgt_fill_loop
+	stwm		%r3,ASM_PTE_ENTRY_SIZE(%r1)
+	ldo		ASM_PAGE_SIZE(%r3),%r3
+	bb,>=		%r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop
 	nop
 
 
diff --git a/arch/parisc/kernel/head64.S b/arch/parisc/kernel/head64.S
index a8c7c7b66..78d8bad2e 100644
--- a/arch/parisc/kernel/head64.S
+++ b/arch/parisc/kernel/head64.S
@@ -88,26 +88,25 @@ $bss_loop:
 	mtctl		%r4,%cr24	/* Initialize kernel root pointer */
 	mtctl		%r4,%cr25	/* Initialize user root pointer */
 
-#if (__PAGE_OFFSET != 0x10000000UL)
-Error! Code below (the next five std's) needs to be changed
-#endif
-
-	std             %r3,0x00(%r4)   /* Hardwired 0x1... kernel Vaddr start*/
+	stw             %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4)
 
 	ldo		_PAGE_TABLE(%r1),%r3
-	std             %r3,0x400(%r5)  /* Hardwired 0x1... kernel Vaddr start*/
-	ldo		0x1000(%r3),%r3
-	std             %r3,0x408(%r5)
-	ldo		0x1000(%r3),%r3
-	std             %r3,0x410(%r5)
-	ldo		0x1000(%r3),%r3
-	std             %r3,0x418(%r5)
+	ldo		ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r5
+	ldi		ASM_PT_INITIAL,%r1
+1:
+	stw		%r3,0(%r5)
+	ldo		ASM_PAGE_SIZE(%r3),%r3
+	addib,>		-1,%r1,1b
+	ldo		ASM_PMD_ENTRY_SIZE(%r5),%r5
 
 	ldo		_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
+	ldil		L%PA(pg0),%r1
+	ldo		R%PA(pg0)(%r1),%r1
+
 $pgt_fill_loop:
-	std,ma		%r3,8(%r1)
-	ldo		0x1000(%r3),%r3
-	bb,>=		%r3,8,$pgt_fill_loop
+	std,ma		%r3,ASM_PTE_ENTRY_SIZE(%r1)
+	ldo		ASM_PAGE_SIZE(%r3),%r3
+	bb,>=		%r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop
 	nop
 
 	/* And the RFI Target address too */
@@ -169,7 +168,6 @@ common_stext:
 	tophys_r1	%r10
 	std		%r11,  TASK_PT_GR11(%r10)
 
-#ifndef CONFIG_PDC_NARROW
 	/* Switch to wide mode; Superdome doesn't support narrow PDC
 	** calls.
 	*/
@@ -179,7 +177,6 @@ common_stext:
 	bv		(%rp)
 	ssm		PSW_SM_W,%r0
 2:
-#endif /* CONFIG_PDC_NARROW */
 
 	/* Set Wide mode as the "Default" (eg for traps)
 	** First trap occurs *right* after (or part of) rfi for slave CPUs.
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 6a61a95ba..ed4fb5858 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -52,11 +52,13 @@ union thread_union init_thread_union
 	__attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =
 		{ INIT_THREAD_INFO(init_task) };
 
-pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned(4096))) = { {0}, };
 #ifdef __LP64__
-unsigned long pmd0[PTRS_PER_PMD] __attribute__ ((aligned(4096))) = { 0, };
+/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout
+ * with the first pmd adjacent to the pgd and below it */
+pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((aligned(PAGE_SIZE))) = { {0}, };
 #endif
-unsigned long pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((aligned(4096))) = { 0, };
+pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned(PAGE_SIZE))) = { {0}, };
+pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((aligned(PAGE_SIZE))) = { {0}, };
 
 /*
  * Initial task structure.
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index d96ae45ac..bc96fd28e 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -350,10 +350,6 @@ copy_user_page_asm:
 
 	.procend
 
-#if (TMPALIAS_MAP_START >= 0x80000000UL)
-Warning TMPALIAS_MAP_START changed. If > 2 Gb, code in pacache.S is bogus
-#endif
-
 /*
  * NOTE: Code in clear_user_page has a hard coded dependency on the
  *       maximum alias boundary being 4 Mb. We've been assured by the
@@ -490,6 +486,9 @@ clear_user_page_asm:
 
 	ldil    L%(TMPALIAS_MAP_START),%r28
 #ifdef __LP64__
+#if (TMPALIAS_MAP_START >= 0x80000000)
+	depdi	0,31,32,%r28	/* clear any sign extension */
+#endif
 	extrd,u %r26,56,32,%r26 /* convert phys addr to tlb insert format */
 	depd    %r25,63,22,%r28 /* Form aliased virtual address 'to' */
 	depdi   0,63,12,%r28    /* Clear any offset bits */
@@ -574,6 +573,95 @@ flush_kernel_dcache_page:
 	.exit
 
 	.procend
+	
+	.export flush_user_dcache_page
+
+flush_user_dcache_page:
+	.proc
+	.callinfo NO_CALLS
+	.entry
+
+	ldil    L%dcache_stride,%r1
+	ldw     R%dcache_stride(%r1),%r23
+
+#ifdef __LP64__
+	depdi,z 1,63-PAGE_SHIFT,1,%r25
+#else
+	depwi,z 1,31-PAGE_SHIFT,1,%r25
+#endif
+	add     %r26,%r25,%r25
+	sub     %r25,%r23,%r25
+
+
+1:      fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	fdc,m   %r23(%sr3,%r26)
+	CMPB<<  %r26,%r25,1b
+	fdc,m   %r23(%sr3,%r26)
+
+	sync
+	bv      %r0(%r2)
+	nop
+	.exit
+
+	.procend
+
+	.export flush_user_icache_page
+
+flush_user_icache_page:
+	.proc
+	.callinfo NO_CALLS
+	.entry
+
+	ldil    L%dcache_stride,%r1
+	ldw     R%dcache_stride(%r1),%r23
+
+#ifdef __LP64__
+	depdi,z 1,63-PAGE_SHIFT,1,%r25
+#else
+	depwi,z 1,31-PAGE_SHIFT,1,%r25
+#endif
+	add     %r26,%r25,%r25
+	sub     %r25,%r23,%r25
+
+
+1:      fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	fic,m   %r23(%sr3,%r26)
+	CMPB<<  %r26,%r25,1b
+	fic,m   %r23(%sr3,%r26)
+
+	sync
+	bv      %r0(%r2)
+	nop
+	.exit
+
+	.procend
+
 
 	.export purge_kernel_dcache_page
 
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 248583560..5595f3bad 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -539,10 +539,10 @@ struct hppa_dma_ops pcx_dma_ops = {
 	.unmap_single =		pa11_dma_unmap_single,
 	.map_sg =		pa11_dma_map_sg,
 	.unmap_sg =		pa11_dma_unmap_sg,
-	.dma_sync_single_cpu =	pa11_dma_sync_single_cpu,
-	.dma_sync_single_device = pa11_dma_sync_single_device,
-	.dma_sync_sg_cpu =	pa11_dma_sync_sg_cpu,
-	.dma_sync_sg_device =	pa11_dma_sync_sg_device,
+	.dma_sync_single_for_cpu =	pa11_dma_sync_single_for_cpu,
+	.dma_sync_single_for_device =	pa11_dma_sync_single_for_device,
+	.dma_sync_sg_for_cpu =		pa11_dma_sync_sg_for_cpu,
+	.dma_sync_sg_for_device =	pa11_dma_sync_sg_for_device,
 };
 
 
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index 30f85ffa2..f8bacd79a 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -506,9 +506,11 @@ static int __init perf_init(void)
 		perf_processor_interface = ONYX_INTF;
 	} else if (boot_cpu_data.cpu_type == pcxw ||
 		 boot_cpu_data.cpu_type == pcxw_ ||
-		 boot_cpu_data.cpu_type == pcxw2) {
+		 boot_cpu_data.cpu_type == pcxw2 ||
+		 boot_cpu_data.cpu_type == mako) {
 		perf_processor_interface = CUDA_INTF;
-		if (boot_cpu_data.cpu_type == pcxw2) 
+		if (boot_cpu_data.cpu_type == pcxw2 ||
+		    boot_cpu_data.cpu_type == mako) 
 			bitmask_array = perf_bitmasks_piranha;
 	} else {
 		perf_processor_interface = UNKNOWN_INTF;
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index b6ae7c4e4..f04dea6a7 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -44,6 +44,7 @@
 #include <linux/sched.h>
 #include <linux/stddef.h>
 #include <linux/unistd.h>
+#include <linux/kallsyms.h>
 
 #include <asm/io.h>
 #include <asm/offsets.h>
@@ -51,6 +52,7 @@
 #include <asm/pdc_chassis.h>
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
+#include <asm/unwind.h>
 
 int hlt_counter;
 
@@ -368,3 +370,28 @@ out:
 
 	return error;
 }
+
+unsigned long 
+get_wchan(struct task_struct *p)
+{
+	struct unwind_frame_info info;
+	unsigned long ip;
+	int count = 0;
+	/*
+	 * These bracket the sleeping functions..
+	 */
+#	define first_sched	((unsigned long) scheduling_functions_start_here)
+#	define last_sched	((unsigned long) scheduling_functions_end_here)
+
+	unwind_frame_init_from_blocked_task(&info, p);
+	do {
+		if (unwind_once(&info) < 0)
+			return 0;
+		ip = info.ip;
+		if (ip < first_sched || ip >= last_sched)
+			return ip;
+	} while (count++ < 16);
+	return 0;
+#	undef first_sched
+#	undef last_sched
+}
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index 5b05759ac..dd7f239aa 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -231,9 +231,7 @@ void __init collect_boot_cpu_data(void)
 	boot_cpu_data.hversion =  boot_cpu_data.pdc.model.hversion;
 	boot_cpu_data.sversion =  boot_cpu_data.pdc.model.sversion;
 
-	boot_cpu_data.cpu_type =
-			parisc_get_cpu_type(boot_cpu_data.hversion);
-
+	boot_cpu_data.cpu_type = parisc_get_cpu_type(boot_cpu_data.hversion);
 	boot_cpu_data.cpu_name = cpu_name_version[boot_cpu_data.cpu_type][0];
 	boot_cpu_data.family_name = cpu_name_version[boot_cpu_data.cpu_type][1];
 }
@@ -276,6 +274,7 @@ int __init init_per_cpu(int cpunum)
 	int ret;
 	struct pdc_coproc_cfg coproc_cfg;
 
+	set_firmware_width();
 	ret = pdc_coproc_cfg(&coproc_cfg);
 
 	if(ret >= 0 && coproc_cfg.ccr_functional) {
diff --git a/arch/parisc/kernel/real2.S b/arch/parisc/kernel/real2.S
index 03ed8aabc..899fd7356 100644
--- a/arch/parisc/kernel/real2.S
+++ b/arch/parisc/kernel/real2.S
@@ -26,6 +26,7 @@ real_stack:
 
 save_cr_space:
 	.block	REG_SZ * N_SAVED_REGS
+save_cr_end:
 
 
 /************************ 32-bit real-mode calls ***********************/
@@ -123,7 +124,7 @@ save_control_regs:
 	nop
 
 restore_control_regs:
-	load32	PA(save_cr_space+(N_SAVED_REGS*REG_SZ)), %r26
+	load32	PA(save_cr_end), %r26
 	POP_CR(%cr15, %r26)
 	POP_CR(%cr31, %r26)
 	POP_CR(%cr30, %r26)
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 1780944eb..820adb178 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -121,8 +121,11 @@ void __init setup_arch(char **cmdline_p)
 
 	pdc_console_init();
 
-#ifdef CONFIG_PDC_NARROW
-	printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
+#ifdef __LP64__
+	extern int parisc_narrow_firmware;
+	if(parisc_narrow_firmware) {
+		printk(KERN_INFO "Kernel is using PDC in 32-bit mode.\n");
+	}
 #endif
 	setup_pdc();
 	setup_cmdline(cmdline_p);
@@ -204,6 +207,7 @@ static void __init parisc_proc_mkdir(void)
         case pcxw:
         case pcxw_:
         case pcxw2:
+	case mako:	/* XXX : this is really mckinley bus */
                 if (NULL == proc_runway_root)
                 {
                         proc_runway_root = proc_mkdir("bus/runway", 0);
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 1aed89de6..b220bb22f 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -353,12 +353,17 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 		goto give_sigsegv;
 
 	/* Set up to return from userspace.  If provided, use a stub
-	   already in userspace.  */
+	   already in userspace. The first words of tramp are used to
+	   save the previous sigrestartblock trampoline that might be
+	   on the stack. We start the sigreturn trampoline at 
+	   SIGRESTARTBLOCK_TRAMP+X. */
 	err |= __put_user(in_syscall ? INSN_LDI_R25_1 : INSN_LDI_R25_0,
-			&frame->tramp[SIGRETURN_TRAMP+0]);
-	err |= __put_user(INSN_LDI_R20, &frame->tramp[SIGRETURN_TRAMP+1]);
-	err |= __put_user(INSN_BLE_SR2_R0, &frame->tramp[SIGRETURN_TRAMP+2]);
-	err |= __put_user(INSN_NOP, &frame->tramp[SIGRETURN_TRAMP+3]);
+			&frame->tramp[SIGRESTARTBLOCK_TRAMP+0]);
+	err |= __put_user(INSN_LDI_R20, 
+			&frame->tramp[SIGRESTARTBLOCK_TRAMP+1]);
+	err |= __put_user(INSN_BLE_SR2_R0, 
+			&frame->tramp[SIGRESTARTBLOCK_TRAMP+2]);
+	err |= __put_user(INSN_NOP, &frame->tramp[SIGRESTARTBLOCK_TRAMP+3]);
 
 #if DEBUG_SIG
 	/* Assert that we're flushing in the correct space... */
@@ -370,12 +375,16 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 	}
 #endif
 
-	flush_user_dcache_range((unsigned long) &frame->tramp[SIGRETURN_TRAMP],
+	flush_user_dcache_range((unsigned long) &frame->tramp[0],
 			   (unsigned long) &frame->tramp[TRAMP_SIZE]);
-	flush_user_icache_range((unsigned long) &frame->tramp[SIGRETURN_TRAMP],
+	flush_user_icache_range((unsigned long) &frame->tramp[0],
 			   (unsigned long) &frame->tramp[TRAMP_SIZE]);
 
-	rp = (unsigned long) &frame->tramp[SIGRETURN_TRAMP];
+	/* TRAMP Words 0-4, Lenght 5 = SIGRESTARTBLOCK_TRAMP
+	 * TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
+	 * So the SIGRETURN_TRAMP is at the end of SIGRESTARTBLOCK_TRAMP
+	 */
+	rp = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP];
 
 	if (err)
 		goto give_sigsegv;
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index c5185a93b..77be8d41e 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -3,7 +3,7 @@
 **
 ** Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
 ** Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
-** Copyright (C) 2001 Grant Grundler <grundler@parisc-linux.org>
+** Copyright (C) 2001,2004 Grant Grundler <grundler@parisc-linux.org>
 ** 
 ** Lots of stuff stolen from arch/alpha/kernel/smp.c
 ** ...and then parisc stole from arch/ia64/kernel/smp.c. Thanks David! :^)
@@ -60,20 +60,16 @@ spinlock_t smp_lock = SPIN_LOCK_UNLOCKED;
 
 volatile struct task_struct *smp_init_current_idle_task;
 
-static volatile int smp_commenced = 0;   /* Set when the idlers are all forked */
-static volatile int cpu_now_booting = 0;      /* track which CPU is booting */
-cpumask_t cpu_online_map = CPU_MASK_NONE;   /* Bitmap of online CPUs */
-#define IS_LOGGED_IN(cpunum) (cpu_isset(cpunum, cpu_online_map))
+static volatile int cpu_now_booting = 0;	/* track which CPU is booting */
+static int parisc_max_cpus = -1;		/* Command line */
 
-EXPORT_SYMBOL(cpu_online_map);
+unsigned long cache_decay_ticks;	/* declared by include/linux/sched.h */
+cpumask_t cpu_online_map = CPU_MASK_NONE;	/* Bitmap of online CPUs */
+cpumask_t cpu_possible_map = CPU_MASK_NONE;	/* Bitmap of Present CPUs */
 
-int smp_num_cpus = 1;
-int smp_threads_ready = 0;
-unsigned long cache_decay_ticks;
-static int max_cpus = -1;			     /* Command line */
-cpumask_t cpu_present_mask;
+EXPORT_SYMBOL(cpu_online_map);
+EXPORT_SYMBOL(cpu_possible_map);
 
-EXPORT_SYMBOL(cpu_present_mask);
 
 struct smp_call_struct {
 	void (*func) (void *info);
@@ -114,7 +110,7 @@ ipi_init(int cpuid)
 
 #error verify IRQ_OFFSET(IPI_IRQ) is ipi_interrupt() in new IRQ region
 
-	if(IS_LOGGED_IN(cpuid) )
+	if(cpu_online(cpuid) )
 	{
 		switch_to_idle_task(current);
 	}
@@ -293,12 +289,13 @@ send_IPI_allbutself(enum ipi_message_type op)
 {
 	int i;
 	
-	for (i = 0; i < smp_num_cpus; i++) {
-		if (i != smp_processor_id())
+	for (i = 0; i < parisc_max_cpus; i++) {
+		if (cpu_online(i) && i != smp_processor_id())
 			send_IPI_single(i, op);
 	}
 }
 
+
 inline void 
 smp_send_stop(void)	{ send_IPI_allbutself(IPI_CPU_STOP); }
 
@@ -327,12 +324,15 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
 	struct smp_call_struct data;
 	unsigned long timeout;
 	static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
 	
 	data.func = func;
 	data.info = info;
 	data.wait = wait;
-	atomic_set(&data.unstarted_count, smp_num_cpus - 1);
-	atomic_set(&data.unfinished_count, smp_num_cpus - 1);
+	atomic_set(&data.unstarted_count, num_online_cpus() - 1);
+	atomic_set(&data.unfinished_count, num_online_cpus() - 1);
 
 	if (retry) {
 		spin_lock (&lock);
@@ -392,7 +392,7 @@ EXPORT_SYMBOL(smp_call_function);
 
 static int __init nosmp(char *str)
 {
-	max_cpus = 0;
+	parisc_max_cpus = 0;
 	return 1;
 }
 
@@ -400,7 +400,7 @@ __setup("nosmp", nosmp);
 
 static int __init maxcpus(char *str)
 {
-	get_option(&str, &max_cpus);
+	get_option(&str, &parisc_max_cpus);
 	return 1;
 }
 
@@ -496,17 +496,13 @@ void __init smp_callin(void)
 
 	local_irq_enable();  /* Interrupts have been off until now */
 
-	/* Slaves wait here until Big Poppa daddy say "jump" */
-	mb();	/* PARANOID */
-	while (!smp_commenced) ;
-	mb();	/* PARANOID */
-
 	cpu_idle();      /* Wait for timer to schedule some work */
 
 	/* NOTREACHED */
 	panic("smp_callin() AAAAaaaaahhhh....\n");
 }
 
+#if 0
 /*
  * Create the idle task for a new Slave CPU.  DO NOT use kernel_thread()
  * because that could end up calling schedule(). If it did, the new idle
@@ -528,7 +524,7 @@ static struct task_struct *fork_by_hand(void)
 /*
  * Bring one cpu online.
  */
-static int __init smp_boot_one_cpu(int cpuid, int cpunum)
+int __init smp_boot_one_cpu(int cpuid, int cpunum)
 {
 	struct task_struct *idle;
 	long timeout;
@@ -573,12 +569,11 @@ static int __init smp_boot_one_cpu(int cpuid, int cpunum)
 
 	/* 
 	 * OK, wait a bit for that CPU to finish staggering about. 
-	 * Slave will set a bit when it reaches smp_cpu_init() and then
-	 * wait for smp_commenced to be 1.
-	 * Once we see the bit change, we can move on.
+	 * Slave will set a bit when it reaches smp_cpu_init().
+	 * Once the "monarch CPU" sees the bit change, it can move on.
 	 */
 	for (timeout = 0; timeout < 10000; timeout++) {
-		if(IS_LOGGED_IN(cpunum)) {
+		if(cpu_online(cpunum)) {
 			/* Which implies Slave has started up */
 			cpu_now_booting = 0;
 			smp_init_current_idle_task = NULL;
@@ -605,120 +600,56 @@ alive:
 #endif
 	return 0;
 }
+#endif
 
 
-
-
-/*
-** inventory.c:do_inventory() has already 'discovered' the additional CPU's.
-** We are ready to wrest them from PDC's control now.
-** Called by smp_init bring all the secondaries online and hold them.  
-**
-** o Setup of the IPI irq handler is done in irq.c.
-** o MEM_RENDEZ is initialzed in head.S:stext()
-**
-*/
-void __init smp_boot_cpus(void)
+void __devinit smp_prepare_boot_cpu(void)
 {
-	int i, cpu_count = 1;
-	unsigned long bogosum = cpu_data[0].loops_per_jiffy; /* Count Monarch */
-
-	/* REVISIT - assumes first CPU reported by PAT PDC is BSP */
 	int bootstrap_processor=cpu_data[0].cpuid;	/* CPU ID of BSP */
 
+#ifdef ENTRY_SYS_CPUS
+	cpu_data[0].state = STATE_RUNNING;
+#endif
+
 	/* Setup BSP mappings */
 	printk(KERN_DEBUG "SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
 	init_task.thread_info->cpu = bootstrap_processor; 
 	current->thread_info->cpu = bootstrap_processor;
-	/* Mark Boostrap processor as present */
-	cpu_online_map = cpumask_of_cpu(bootstrap_processor);
-	current->active_mm = &init_mm;
 
-#ifdef ENTRY_SYS_CPUS
-	cpu_data[0].state = STATE_RUNNING;
-#endif
-	cpu_present_mask = cpumask_of_cpu(bootstrap_processor);
+	cpu_set(bootstrap_processor, cpu_online_map);
+	cpu_set(bootstrap_processor, cpu_possible_map);
 
-	/* Nothing to do when told not to.  */
-	if (max_cpus == 0) {
-		printk(KERN_INFO "SMP mode deactivated.\n");
-		return;
-	}
+	/* Mark Boostrap processor as present */
+	current->active_mm = &init_mm;
 
-	if (max_cpus != -1) 
-		printk(KERN_INFO "Limiting CPUs to %d\n", max_cpus);
+	cache_decay_ticks = HZ/100;	/* FIXME very rough.  */
+}
 
-	/* We found more than one CPU.... */
-	if (boot_cpu_data.cpu_count > 1) {
 
-		for (i = 0; i < NR_CPUS; i++) {
-			if (cpu_data[i].cpuid == NO_PROC_ID || 
-			    cpu_data[i].cpuid == bootstrap_processor)
-				continue;
 
-			if (smp_boot_one_cpu(cpu_data[i].cpuid, cpu_count) < 0)
-				continue;
-
-			bogosum += cpu_data[i].loops_per_jiffy;
-			cpu_count++; /* Count good CPUs only... */
-			
-			cpu_present_mask |= 1UL << i;
-			
-			/* Bail when we've started as many CPUS as told to */
-			if (cpu_count == max_cpus)
-				break;
-		}
-	}
-	if (cpu_count == 1) {
-		printk(KERN_INFO "SMP: Bootstrap processor only.\n");
-	}
+/*
+** inventory.c:do_inventory() hasn't yet been run and thus we
+** don't 'discover' the additional CPU's until later.
+*/
+void __init smp_prepare_cpus(unsigned int max_cpus)
+{
 
-	/*
-	 * FIXME very rough.
-	 */
-	cache_decay_ticks = HZ/100;
+	if (max_cpus != -1) 
+		printk(KERN_INFO "SMP: Limited to %d CPUs\n", max_cpus);
 
-	printk(KERN_INFO "SMP: Total %d of %d processors activated "
-	       "(%lu.%02lu BogoMIPS noticed) (Present Mask: %lu).\n",
-	       cpu_count, boot_cpu_data.cpu_count, (bogosum + 25) / 5000,
-	       ((bogosum + 25) / 50) % 100, cpu_present_mask);
+	printk(KERN_INFO "SMP: Monarch CPU activated (%lu.%02lu BogoMIPS)\n",
+	       (cpu_data[0].loops_per_jiffy + 25) / 5000,
+	       ((cpu_data[0].loops_per_jiffy + 25) / 50) % 100);
 
-	smp_num_cpus = cpu_count;
-#ifdef PER_CPU_IRQ_REGION
-	ipi_init();
-#endif
 	return;
 }
 
-/* 
- * Called from main.c by Monarch Processor.
- * After this, any CPU can schedule any task.
- */
-void smp_commence(void)
-{
-	smp_commenced = 1;
-	mb();
-	return;
-}
 
-/*
- * XXX FIXME : do nothing
- */
 void smp_cpus_done(unsigned int cpu_max)
 {
-	smp_threads_ready = 1;
-}
-
-void __init smp_prepare_cpus(unsigned int max_cpus)
-{
-	smp_boot_cpus();
+	return;
 }
 
-void __devinit smp_prepare_boot_cpu(void)
-{
-	cpu_set(smp_processor_id(), cpu_online_map);
-	cpu_set(smp_processor_id(), cpu_present_mask);
-}
 
 int __devinit __cpu_up(unsigned int cpu)
 {
@@ -745,7 +676,7 @@ int sys_cpus(int argc, char **argv)
 #ifdef DUMP_MORE_STATE
 		for(i=0; i<NR_CPUS; i++) {
 			int cpus_per_line = 4;
-			if(IS_LOGGED_IN(i)) {
+			if(cpu_online(i)) {
 				if (j++ % cpus_per_line)
 					printk(" %3d",i);
 				else
@@ -760,7 +691,7 @@ int sys_cpus(int argc, char **argv)
 		printk("\nCPUSTATE  TASK CPUNUM CPUID HARDCPU(HPA)\n");
 #ifdef DUMP_MORE_STATE
 		for(i=0;i<NR_CPUS;i++) {
-			if (!IS_LOGGED_IN(i))
+			if (!cpu_online(i))
 				continue;
 			if (cpu_data[i].cpuid != NO_PROC_ID) {
 				switch(cpu_data[i].state) {
@@ -780,7 +711,7 @@ int sys_cpus(int argc, char **argv)
 						printk("%08x?", cpu_data[i].state);
 						break;
 				}
-				if(IS_LOGGED_IN(i)) {
+				if(cpu_online(i)) {
 					printk(" %4d",current_pid(i));
 				}	
 				printk(" %6d",cpu_number_map(i));
@@ -796,7 +727,7 @@ int sys_cpus(int argc, char **argv)
 #ifdef DUMP_MORE_STATE
      		printk("\nCPUSTATE   CPUID\n");
 		for (i=0;i<NR_CPUS;i++) {
-			if (!IS_LOGGED_IN(i))
+			if (!cpu_online(i))
 				continue;
 			if (cpu_data[i].cpuid != NO_PROC_ID) {
 				switch(cpu_data[i].state) {
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 93cd4dcfa..625a701f0 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -68,17 +68,8 @@ static unsigned long get_unshared_area(unsigned long addr, unsigned long len)
  * existing mapping and use the same offset.  New scheme is to use the
  * address of the kernel data structure as the seed for the offset.
  * We'll see how that works...
- */
-#if 0
-static int get_offset(struct address_space *mapping)
-{
-	struct vm_area_struct *vma = list_entry(mapping->i_mmap_shared.next,
-			struct vm_area_struct, shared);
-	return (vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT)) &
-		(SHMLBA - 1);
-}
-#else
-/* The mapping is cacheline aligned, so there's no information in the bottom
+ *
+ * The mapping is cacheline aligned, so there's no information in the bottom
  * few bits of the address.  We're looking for 10 bits (4MB / 4k), so let's
  * drop the bottom 8 bits and use bits 8-17.  
  */
@@ -87,13 +78,12 @@ static int get_offset(struct address_space *mapping)
 	int offset = (unsigned long) mapping << (PAGE_SHIFT - 8);
 	return offset & 0x3FF000;
 }
-#endif
 
 static unsigned long get_shared_area(struct address_space *mapping,
 		unsigned long addr, unsigned long len, unsigned long pgoff)
 {
 	struct vm_area_struct *vma;
-	int offset = get_offset(mapping);
+	int offset = mapping ? get_offset(mapping) : 0;
 
 	addr = DCACHE_ALIGN(addr - offset) + offset;
 
@@ -117,8 +107,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
 	if (!addr)
 		addr = TASK_UNMAPPED_BASE;
 
-	if (filp && (flags & MAP_SHARED)) {
+	if (filp) {
 		addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
+	} else if(flags & MAP_SHARED) {
+		addr = get_shared_area(NULL, addr, len, pgoff);
 	} else {
 		addr = get_unshared_area(addr, len);
 	}
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 7159953b2..6b5649a69 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -64,189 +64,6 @@
 #define DBG(x)
 #endif
 
-/*
- * count32() counts the number of arguments/envelopes. It is basically
- *           a copy of count() from fs/exec.c, except that it works
- *           with 32 bit argv and envp pointers.
- */
-
-static int count32(u32 *argv, int max)
-{
-	int i = 0;
-
-	if (argv != NULL) {
-		for (;;) {
-			u32 p;
-			int error;
-
-			error = get_user(p,argv);
-			if (error)
-				return error;
-			if (!p)
-				break;
-			argv++;
-			if(++i > max)
-				return -E2BIG;
-		}
-	}
-	return i;
-}
-
-
-/*
- * copy_strings32() is basically a copy of copy_strings() from fs/exec.c
- *                  except that it works with 32 bit argv and envp pointers.
- */
-
-
-static int copy_strings32(int argc, u32 *argv, struct linux_binprm *bprm)
-{
-	while (argc-- > 0) {
-		u32 str;
-		int len;
-		unsigned long pos;
-
-		if (get_user(str, argv + argc) ||
-		    !str ||
-		    !(len = strnlen_user((char *)compat_ptr(str), bprm->p)))
-			return -EFAULT;
-
-		if (bprm->p < len) 
-			return -E2BIG; 
-
-		bprm->p -= len;
-
-		pos = bprm->p;
-		while (len > 0) {
-			char *kaddr;
-			int i, new, err;
-			struct page *page;
-			int offset, bytes_to_copy;
-
-			offset = pos % PAGE_SIZE;
-			i = pos/PAGE_SIZE;
-			page = bprm->page[i];
-			new = 0;
-			if (!page) {
-				page = alloc_page(GFP_HIGHUSER);
-				bprm->page[i] = page;
-				if (!page)
-					return -ENOMEM;
-				new = 1;
-			}
-			kaddr = (char *)kmap(page);
-
-			if (new && offset)
-				memset(kaddr, 0, offset);
-			bytes_to_copy = PAGE_SIZE - offset;
-			if (bytes_to_copy > len) {
-				bytes_to_copy = len;
-				if (new)
-					memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len);
-			}
-			err = copy_from_user(kaddr + offset, (char *)compat_ptr(str), bytes_to_copy);
-			flush_dcache_page(page);
-			kunmap(page);
-
-			if (err)
-				return -EFAULT; 
-
-			pos += bytes_to_copy;
-			str += bytes_to_copy;
-			len -= bytes_to_copy;
-		}
-	}
-	return 0;
-}
-
-/*
- * do_execve32() is mostly a copy of do_execve(), with the exception
- * that it processes 32 bit argv and envp pointers.
- */
-
-static inline int 
-do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
-{
-	struct linux_binprm bprm;
-	struct file *file;
-	int retval;
-	int i;
-
-	file = open_exec(filename);
-
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		return retval;
-
-	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
-	memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
-
-	DBG(("do_execve32(%s, %p, %p, %p)\n", filename, argv, envp, regs));
-
-	bprm.file = file;
-	bprm.filename = filename;
-	bprm.interp = filename;
-	bprm.sh_bang = 0;
-	bprm.loader = 0;
-	bprm.exec = 0;
-
-	bprm.mm = mm_alloc();
-	retval = -ENOMEM;
-	if (!bprm.mm)
-		goto out_file;
-
-	retval = init_new_context(current, bprm.mm);
-	if (retval < 0)
-		goto out_mm;
-
-	if ((bprm.argc = count32(argv, bprm.p / sizeof(u32))) < 0) 
-		goto out_mm;
-
-	if ((bprm.envc = count32(envp, bprm.p / sizeof(u32))) < 0) 
-		goto out_mm;
-
-	retval = prepare_binprm(&bprm);
-	if (retval < 0)
-		goto out;
-	
-	retval = copy_strings_kernel(1, &bprm.filename, &bprm);
-	if (retval < 0)
-		goto out;
-
-	bprm.exec = bprm.p;
-	retval = copy_strings32(bprm.envc, envp, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = copy_strings32(bprm.argc, argv, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = search_binary_handler(&bprm,regs);
-	if (retval >= 0)
-		/* execve success */
-		return retval;
-
-out:
-	/* Something went wrong, return the inode and free the argument pages*/
-	for (i = 0; i < MAX_ARG_PAGES; i++) {
-		struct page *page = bprm.page[i];
-		if (page)
-			__free_page(page);
-	}
-
-out_mm:
-	mmdrop(bprm.mm);
-
-out_file:
-	if (bprm.file) {
-		allow_write_access(bprm.file);
-		fput(bprm.file);
-	}
-
-	return retval;
-}
-
 /*
  * sys32_execve() executes a new program.
  */
@@ -261,8 +78,8 @@ asmlinkage int sys32_execve(struct pt_regs *regs)
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
-	error = do_execve32(filename, (u32 *) regs->gr[25],
-		(u32 *) regs->gr[24], regs);
+	error = compat_do_execve(filename, compat_ptr(regs->gr[25]),
+				 compat_ptr(regs->gr[24]), regs);
 	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
 	putname(filename);
@@ -609,149 +426,6 @@ out:
 	return error;
 }
 
-/* readv/writev stolen from mips64 */
-typedef ssize_t (*IO_fn_t)(struct file *, char *, size_t, loff_t *);
-
-static long
-do_readv_writev32(int type, struct file *file, const struct compat_iovec *vector,
-		  u32 count)
-{
-	unsigned long tot_len;
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov=iovstack, *ivp;
-	struct inode *inode;
-	long retval, i;
-	IO_fn_t fn;
-
-	/* First get the "struct iovec" from user memory and
-	 * verify all the pointers
-	 */
-	if (!count)
-		return 0;
-	if(verify_area(VERIFY_READ, vector, sizeof(struct compat_iovec)*count))
-		return -EFAULT;
-	if (count > UIO_MAXIOV)
-		return -EINVAL;
-	if (count > UIO_FASTIOV) {
-		iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			return -ENOMEM;
-	}
-
-	tot_len = 0;
-	i = count;
-	ivp = iov;
-	while (i > 0) {
-		u32 len;
-		u32 buf;
-
-		__get_user(len, &vector->iov_len);
-		__get_user(buf, &vector->iov_base);
-		tot_len += len;
-		ivp->iov_base = compat_ptr(buf);
-		ivp->iov_len = (compat_size_t) len;
-		vector++;
-		ivp++;
-		i--;
-	}
-
-	inode = file->f_dentry->d_inode;
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	retval = locks_verify_area((type == VERIFY_WRITE
-				    ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
-				   inode, file, file->f_pos, tot_len);
-	if (retval) {
-		if (iov != iovstack)
-			kfree(iov);
-		return retval;
-	}
-
-	/* Then do the actual IO.  Note that sockets need to be handled
-	 * specially as they have atomicity guarantees and can handle
-	 * iovec's natively
-	 */
-	if (inode->i_sock) {
-		int err;
-		err = sock_readv_writev(type, inode, file, iov, count, tot_len);
-		if (iov != iovstack)
-			kfree(iov);
-		return err;
-	}
-
-	if (!file->f_op) {
-		if (iov != iovstack)
-			kfree(iov);
-		return -EINVAL;
-	}
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	fn = file->f_op->read;
-	if (type == VERIFY_READ)
-		fn = (IO_fn_t) file->f_op->write;		
-	ivp = iov;
-	while (count > 0) {
-		void * base;
-		int len, nr;
-
-		base = ivp->iov_base;
-		len = ivp->iov_len;
-		ivp++;
-		count--;
-		nr = fn(file, base, len, &file->f_pos);
-		if (nr < 0) {
-			if (retval)
-				break;
-			retval = nr;
-			break;
-		}
-		retval += nr;
-		if (nr != len)
-			break;
-	}
-	if (iov != iovstack)
-		kfree(iov);
-
-	return retval;
-}
-
-asmlinkage long
-sys32_readv(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	ssize_t ret;
-
-	ret = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto bad_file;
-	if (file->f_op && (file->f_mode & FMODE_READ) &&
-	    (file->f_op->readv || file->f_op->read))
-		ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
-
-	fput(file);
-
-bad_file:
-	return ret;
-}
-
-asmlinkage long
-sys32_writev(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	ssize_t ret;
-
-	ret = -EBADF;
-	file = fget(fd);
-	if(!file)
-		goto bad_file;
-	if (file->f_op && (file->f_mode & FMODE_WRITE) &&
-	    (file->f_op->writev || file->f_op->write))
-	        ret = do_readv_writev32(VERIFY_READ, file, vector, count);
-	fput(file);
-
-bad_file:
-	return ret;
-}
-
 /*** copied from mips64 ***/
 /*
  * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
@@ -814,126 +488,6 @@ set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
 		__put_user(*fdset, ufdset);
 }
 
-/*** This is a virtual copy of sys_select from fs/select.c and probably
- *** should be compared to it from time to time
- ***/
-static inline void *select_bits_alloc(int size)
-{
-	return kmalloc(6 * size, GFP_KERNEL);
-}
-
-static inline void select_bits_free(void *bits, int size)
-{
-	kfree(bits);
-}
-
-/*
- * We can actually return ERESTARTSYS instead of EINTR, but I'd
- * like to be certain this leads to no problems. So I return
- * EINTR just for safety.
- *
- * Update: ERESTARTSYS breaks at least the xview clock binary, so
- * I'm trying ERESTARTNOHAND which restart only when you want to.
- */
-#define MAX_SELECT_SECONDS \
-	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-#define DIVIDE_ROUND_UP(x,y) (((x)+(y)-1)/(y))
-
-asmlinkage long
-sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, struct compat_timeval *tvp)
-{
-	fd_set_bits fds;
-	char *bits;
-	long timeout;
-	int ret, size, err;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp) {
-		struct compat_timeval tv32;
-		time_t sec, usec;
-
-		if ((ret = copy_from_user(&tv32, tvp, sizeof tv32)))
-			goto out_nofds;
-
-		sec = tv32.tv_sec;
-		usec = tv32.tv_usec;
-
-		ret = -EINVAL;
-		if (sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = DIVIDE_ROUND_UP(usec, 1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-
-	if (n > current->files->max_fdset)
-		n = current->files->max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words. 
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = select_bits_alloc(size);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	if ((ret = get_fd_set32(n, inp, fds.in)) ||
-	    (ret = get_fd_set32(n, outp, fds.out)) ||
-	    (ret = get_fd_set32(n, exp, fds.ex)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
-		time_t sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		err = put_user(sec, &tvp->tv_sec);
-		err |= __put_user(usec, &tvp->tv_usec);
-		if (err)
-			ret = -EFAULT;
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set32(n, inp, fds.res_in);
-	set_fd_set32(n, outp, fds.res_out);
-	set_fd_set32(n, exp, fds.res_ex);
-
-out:
-	select_bits_free(bits, size);
-out_nofds:
-	return ret;
-}
-
 struct msgbuf32 {
     int mtype;
     char mtext[1];
@@ -991,7 +545,6 @@ asmlinkage long sys32_msgrcv(int msqid,
 	return err;
 }
 
-
 asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
 {
         mm_segment_t old_fs = get_fs();
@@ -1011,94 +564,6 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 c
         return ret;
 }
 
-/* EXPORT/UNEXPORT */
-struct nfsctl_export32 {
-	char		ex_client[NFSCLNT_IDMAX+1];
-	char		ex_path[NFS_MAXPATHLEN+1];
-	__kernel_old_dev_t ex_dev;
-	compat_ino_t	ex_ino;
-	int		ex_flags;
-	__kernel_uid_t	ex_anon_uid;
-	__kernel_gid_t	ex_anon_gid;
-};
-
-struct nfsctl_arg32 {
-	int			ca_version;	/* safeguard */
-	/* wide kernel places this union on 8-byte boundary, narrow on 4 */
-	union {
-		struct nfsctl_svc	u_svc;
-		struct nfsctl_client	u_client;
-		struct nfsctl_export32	u_export;
-		struct nfsctl_fdparm	u_getfd;
-		struct nfsctl_fsparm	u_getfs;
-	} u;
-};
-
-asmlinkage int sys32_nfsservctl(int cmd, void *argp, void *resp)
-{
-	int ret, tmp;
-	struct nfsctl_arg32 n32;
-	struct nfsctl_arg n;
-
-	ret = copy_from_user(&n, argp, sizeof n.ca_version);
-	if (ret != 0)
-		return ret;
-
-	/* adjust argp to point at the union inside the user's n32 struct */
-	tmp = (unsigned long)&n32.u - (unsigned long)&n32;
-	argp = (void *)((unsigned long)argp + tmp);
-	switch(cmd) {
-	case NFSCTL_SVC:
-		ret = copy_from_user(&n.u, argp, sizeof n.u.u_svc);
-		break;
-
-	case NFSCTL_ADDCLIENT:
-	case NFSCTL_DELCLIENT:
-		ret = copy_from_user(&n.u, argp, sizeof n.u.u_client);
-		break;
-
-	case NFSCTL_GETFD:
-		ret = copy_from_user(&n.u, argp, sizeof n.u.u_getfd);
-		break;
-
-	case NFSCTL_GETFS:
-		ret = copy_from_user(&n.u, argp, sizeof n.u.u_getfs);
-		break;
-
-	case NFSCTL_UNEXPORT:		/* nfsctl_export */
-	case NFSCTL_EXPORT:		/* nfsctl_export */
-		ret = copy_from_user(&n32.u, argp, sizeof n32.u.u_export);
-#undef CP
-#define CP(x)	n.u.u_export.ex_##x = n32.u.u_export.ex_##x
-		memcpy(n.u.u_export.ex_client, n32.u.u_export.ex_client, sizeof n32.u.u_export.ex_client);
-		memcpy(n.u.u_export.ex_path, n32.u.u_export.ex_path, sizeof n32.u.u_export.ex_path);
-		CP(dev);
-		CP(ino);
-		CP(flags);
-		CP(anon_uid);
-		CP(anon_gid);
-		break;
-
-	default:
-		/* lockd probes for some other values (0x10000);
-		 * so don't BUG() */
-		ret = -EINVAL;
-		break;
-	}
-
-	if (ret == 0) {
-		unsigned char rbuf[NFS_FHSIZE + sizeof (struct knfsd_fh)];
-		KERNEL_SYSCALL(ret, sys_nfsservctl, cmd, &n, &rbuf);
-		if (cmd == NFSCTL_GETFD) {
-			ret = copy_to_user(resp, rbuf, NFS_FHSIZE);
-		} else if (cmd == NFSCTL_GETFS) {
-			ret = copy_to_user(resp, rbuf, sizeof (struct knfsd_fh));
-		}
-	}
-
-	return ret;
-}
-
 typedef long __kernel_loff_t32;		/* move this to asm/posix_types.h? */
 
 asmlinkage int sys32_sendfile64(int out_fd, int in_fd, __kernel_loff_t32 *offset, s32 count)
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 9691da8b6..1c34cf70d 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -155,9 +155,10 @@ linux_gateway_entry:
 	stw     %r21, -56(%r30)                 /* 6th argument */
 #endif
 
+	/* Are we being ptraced? */
 	mfctl	%cr30, %r1
-	LDREG	TI_FLAGS(%r1), %r19
-	bb,<,n	%r19,31-TIF_SYSCALL_TRACE,.Ltracesys
+	LDREG	TASK_PTRACE(%r1), %r1
+	bb,<,n	%r1,31,.Ltracesys
 	
 	/* Note!  We cannot use the syscall table that is mapped
 	nearby since the gateway page is mapped execute-only. */
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index ce47ee803..2a3c11955 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -232,12 +232,12 @@
 	ENTRY_DIFF(getdents)
 	/* it is POSSIBLE that select will be OK because even though fd_set
 	 * contains longs, the macros and sizes are clever. */
-	ENTRY_DIFF(select)
+	ENTRY_COMP(select)
 	ENTRY_SAME(flock)
 	ENTRY_SAME(msync)
 	/* struct iovec contains pointers */
-	ENTRY_DIFF(readv)		/* 145 */
-	ENTRY_DIFF(writev)
+	ENTRY_COMP(readv)		/* 145 */
+	ENTRY_COMP(writev)
 	ENTRY_SAME(getsid)
 	ENTRY_SAME(fdatasync)
 	/* struct __sysctl_args is a mess */
@@ -266,7 +266,7 @@
 	ENTRY_SAME(ni_syscall)		/* query_module */
 	ENTRY_SAME(poll)
 	/* structs contain pointers and an in_addr... */
-	ENTRY_DIFF(nfsservctl)
+	ENTRY_COMP(nfsservctl)
 	ENTRY_SAME(setresgid)		/* 170 */
 	ENTRY_SAME(getresgid)
 	ENTRY_SAME(prctl)
@@ -334,3 +334,12 @@
 	ENTRY_SAME(epoll_ctl)		/* 225 */
 	ENTRY_SAME(epoll_wait)
  	ENTRY_SAME(remap_file_pages)
+  ENTRY_SAME(semtimedop)
+  ENTRY_SAME(mq_open)
+  ENTRY_SAME(mq_unlink)   /* 230 */
+  ENTRY_SAME(mq_timedsend)
+  ENTRY_SAME(mq_timedreceive)
+  ENTRY_SAME(mq_notify)
+  ENTRY_SAME(mq_getsetattr)
+  /* Nothing yet */       /* 235 */
+
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index e5d5aeef9..7da318ed0 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -26,6 +26,7 @@
 #include <asm-generic/vmlinux.lds.h>
 /* needed for the processor specific cache alignment size */	
 #include <asm/cache.h>
+#include <asm/page.h>
 	
 /* ld script to make hppa Linux kernel */
 #ifndef CONFIG_PARISC64
@@ -45,13 +46,17 @@ jiffies = jiffies_64;
 SECTIONS
 {
 
-  . = 0x10100000;
+  . = KERNEL_BINARY_TEXT_START;
 
   _text = .;			/* Text and read-only data */
   .text ALIGN(16) : {
-	*(.text*)
+	*(.text)
 	SCHED_TEXT
-	*(.PARISC.unwind)
+	*(.text.do_softirq)
+	*(.text.sys_exit)
+	*(.text.do_sigaltstack)
+	*(.text.do_fork)
+	*(.text.*)
 	*(.fixup)
 	*(.lock.text)		/* out-of-line lock text */
 	*(.gnu.warning)
@@ -72,6 +77,10 @@ SECTIONS
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
 
+  __start___unwind = .;         /* unwind info */
+  .PARISC.unwind : { *(.PARISC.unwind) }
+  __stop___unwind = .;
+ 
   .data : {			/* Data */
 	*(.data)
 	CONSTRUCTORS
@@ -88,6 +97,10 @@ SECTIONS
   . = ALIGN(L1_CACHE_BYTES);
   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
 
+  /* PA-RISC locks requires 16-byte alignment */
+  . = ALIGN(16);
+  .data.lock_aligned : { *(.data.lock_aligned) }
+
   _edata = .;			/* End of data section */
 
   . = ALIGN(16384); 		/* init_task */
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index b79452c8c..b7e171abd 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -13,22 +13,20 @@
 #include <asm/atomic.h>
 
 #ifdef CONFIG_SMP
-spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
-	[0 ... (ATOMIC_HASH_SIZE-1)]  = SPIN_LOCK_UNLOCKED
+atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
+	[0 ... (ATOMIC_HASH_SIZE-1)]  = (atomic_lock_t) { { 1, 1, 1, 1 } }
 };
 #endif
 
-spinlock_t __atomic_lock = SPIN_LOCK_UNLOCKED;
-
 #ifdef __LP64__
 unsigned long __xchg64(unsigned long x, unsigned long *ptr)
 {
 	unsigned long temp, flags;
 
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
 	temp = *ptr;
 	*ptr = x;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
 	return temp;
 }
 #endif
@@ -38,10 +36,10 @@ unsigned long __xchg32(int x, int *ptr)
 	unsigned long flags;
 	unsigned long temp;
 
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
 	(long) temp = (long) *ptr;	/* XXX - sign extension wanted? */
 	*ptr = x;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
 	return temp;
 }
 
@@ -51,10 +49,10 @@ unsigned long __xchg8(char x, char *ptr)
 	unsigned long flags;
 	unsigned long temp;
 
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
 	(long) temp = (long) *ptr;	/* XXX - sign extension wanted? */
 	*ptr = x;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
 	return temp;
 }
 
@@ -65,10 +63,10 @@ unsigned long __cmpxchg_u64(volatile unsigned long *ptr, unsigned long old, unsi
 	unsigned long flags;
 	unsigned long prev;
 
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
 	if ((prev = *ptr) == old)
 		*ptr = new;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
 	return prev;
 }
 #endif
@@ -78,9 +76,9 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign
 	unsigned long flags;
 	unsigned int prev;
 
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
 	if ((prev = *ptr) == old)
 		*ptr = new;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(ptr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
 	return (unsigned long)prev;
 }
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index fb18cfc57..e7a8b1bc9 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -424,7 +424,12 @@ void free_initmem(void)
  * a hole of 4kB between each vmalloced area for the same reason.
  */
 
-#define MAP_START 0x4000 /* Leave room for gateway page expansion */
+ /* Leave room for gateway page expansion */
+#if KERNEL_MAP_START < GATEWAY_PAGE_SIZE
+#error KERNEL_MAP_START is in gateway reserved region
+#endif
+#define MAP_START (KERNEL_MAP_START)
+
 #define VM_MAP_OFFSET  (32*1024)
 #define SET_MAP_OFFSET(x) ((void *)(((unsigned long)(x) + VM_MAP_OFFSET) \
 				     & ~(VM_MAP_OFFSET-1)))
@@ -545,7 +550,7 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
 		 */
 
 		if (!pmd) {
-			pmd = (pmd_t *) alloc_bootmem_low_pages_node(NODE_DATA(0),PAGE_SIZE);
+			pmd = (pmd_t *) alloc_bootmem_low_pages_node(NODE_DATA(0),PAGE_SIZE << PMD_ORDER);
 			pmd = (pmd_t *) __pa(pmd);
 		}
 
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
index ee4dbc047..f0728f3c0 100644
--- a/arch/ppc/4xx_io/serial_sicc.c
+++ b/arch/ppc/4xx_io/serial_sicc.c
@@ -1431,7 +1431,6 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp)
     save_flags(flags); cli();
 
     if (tty_hung_up_p(filp)) {
-        MOD_DEC_USE_COUNT;
         restore_flags(flags);
         return;
     }
@@ -1452,7 +1451,6 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp)
         state->count = 0;
     }
     if (state->count) {
-        MOD_DEC_USE_COUNT;
         restore_flags(flags);
         return;
     }
@@ -1495,7 +1493,6 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp)
     }
     info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
     wake_up_interruptible(&info->close_wait);
-    MOD_DEC_USE_COUNT;
 }
 
 static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout)
@@ -1685,9 +1682,7 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
 
 
     // is this a line that we've got?
-    MOD_INC_USE_COUNT;
     if (line >= SERIAL_SICC_NR) {
-        MOD_DEC_USE_COUNT;
         return -ENODEV;
     }
 
@@ -1707,7 +1702,6 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
         if (tmp_buf)
             free_page(page);
         else if (!page) {
-            MOD_DEC_USE_COUNT;
             return -ENOMEM;
         }
         tmp_buf = (u_char *)page;
@@ -1720,7 +1714,6 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
         (info->flags & ASYNC_CLOSING)) {
         if (info->flags & ASYNC_CLOSING)
             interruptible_sleep_on(&info->close_wait);
-        MOD_DEC_USE_COUNT;
         return -EAGAIN;
     }
 
@@ -1729,13 +1722,11 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
      */
     retval = siccuart_startup(info);
     if (retval) {
-        MOD_DEC_USE_COUNT;
         return retval;
     }
 
     retval = block_til_ready(tty, filp, info);
     if (retval) {
-        MOD_DEC_USE_COUNT;
         return retval;
     }
 
@@ -1778,6 +1769,7 @@ int __init siccuart_init(void)
 	return -ENOMEM;
     printk("IBM Vesta SICC serial port driver V 0.1 by Yudong Yang and Yi Ge / IBM CRL .\n");
     siccnormal_driver->driver_name = "serial_sicc";
+    siccnormal_driver->owner = THIS_MODULE;
     siccnormal_driver->name = SERIAL_SICC_NAME;
     siccnormal_driver->major = SERIAL_SICC_MAJOR;
     siccnormal_driver->minor_start = SERIAL_SICC_MINOR;
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
index b6dd2352f..7a9a7bf31 100644
--- a/arch/ppc/8260_io/enet.c
+++ b/arch/ppc/8260_io/enet.c
@@ -612,7 +612,7 @@ static int __init scc_enet_init(void)
 {
 	struct net_device *dev;
 	struct scc_enet_private *cep;
-	int i, j;
+	int i, j, err;
 	unsigned char	*eap;
 	unsigned long	mem_addr;
 	bd_t		*bd;
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c
index 226214c66..d9df49ceb 100644
--- a/arch/ppc/8260_io/fcc_enet.c
+++ b/arch/ppc/8260_io/fcc_enet.c
@@ -158,12 +158,21 @@ static int fcc_enet_set_mac_address(struct net_device *dev, void *addr);
 #define PA1_DIRA0	(PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
 #define PA1_DIRA1	(PA1_TXDAT | PA1_TXEN | PA1_TXER)
 
+#ifdef CONFIG_SBC82xx
+/* rx is clk9, tx is clk10
+ */
+#define PC_F1RXCLK     ((uint)0x00000100)
+#define PC_F1TXCLK     ((uint)0x00000200)
+#define CMX1_CLK_ROUTE ((uint)0x25000000)
+#define CMX1_CLK_MASK  ((uint)0xff000000)
+#else
 /* CLK12 is receive, CLK11 is transmit.  These are board specific.
 */
 #define PC_F1RXCLK	((uint)0x00000800)
 #define PC_F1TXCLK	((uint)0x00000400)
 #define CMX1_CLK_ROUTE	((uint)0x3e000000)
 #define CMX1_CLK_MASK	((uint)0xff000000)
+#endif /* !CONFIG_SBC82xx */
 
 /* I/O Pin assignment for FCC2.  I don't yet know the best way to do this,
  * but there is little variation among the choices.
@@ -288,6 +297,8 @@ struct fcc_enet_private {
 	ushort	skb_cur;
 	ushort	skb_dirty;
 
+	atomic_t n_pkts;  /* Number of packets in tx ring */
+
 	/* CPM dual port RAM relative addresses.
 	*/
 	cbd_t	*rx_bd_base;		/* Address of Rx and Tx buffers. */
@@ -347,6 +358,7 @@ fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct fcc_enet_private *cep = (struct fcc_enet_private *)dev->priv;
 	volatile cbd_t	*bdp;
+	int idx;
 
 	if (!cep->link) {
 		/* Link is down or autonegotiation is in progress. */
@@ -379,13 +391,24 @@ fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	bdp->cbd_datlen = skb->len;
 	bdp->cbd_bufaddr = __pa(skb->data);
 
+	spin_lock_irq(&cep->lock);
+
 	/* Save skb pointer. */
-	cep->tx_skbuff[cep->skb_cur] = skb;
+	idx = cep->skb_cur & TX_RING_MOD_MASK;
+	if (cep->tx_skbuff[idx]) {
+		/* This should never happen (any more).
+		   Leave the sanity check in for now... */
+		printk(KERN_ERR "EEP. cep->tx_skbuff[%d] is %p not NULL in %s\n", 
+		       idx, cep->tx_skbuff[idx], __func__);
+		printk(KERN_ERR "Expect to lose %d bytes of sock space", 
+		       cep->tx_skbuff[idx]->truesize);
+	}
+	cep->tx_skbuff[idx] = skb;
 
 	cep->stats.tx_bytes += skb->len;
-	cep->skb_cur = (cep->skb_cur+1) & TX_RING_MOD_MASK;
+	cep->skb_cur++;
 
-	spin_lock_irq(&cep->lock);
+	atomic_inc(&cep->n_pkts);
 
 	/* Send it on its way.  Tell CPM its ready, interrupt when done,
 	 * its the last BD of the frame, and to put the CRC on the end.
@@ -404,9 +427,13 @@ fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	else
 		bdp++;
 
-	if (bdp->cbd_sc & BD_ENET_TX_READY) {
-		netif_stop_queue(dev);
+
+	/* If the tx_ring is full, stop the queue */
+	if (atomic_read(&cep->n_pkts) >= (TX_RING_SIZE-1)) {
+	  if (!netif_queue_stopped(dev)) {
+		netif_stop_queue(dev);	  
 		cep->tx_full = 1;
+	  }
 	}
 
 	cep->cur_tx = (cbd_t *)bdp;
@@ -460,6 +487,7 @@ fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 	volatile cbd_t	*bdp;
 	ushort	int_events;
 	int	must_restart;
+	int idx;
 
 	cep = (struct fcc_enet_private *)dev->priv;
 
@@ -522,8 +550,12 @@ fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 			cep->stats.collisions++;
 
 		/* Free the sk buffer associated with this last transmit. */
-		dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]);
-		cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK;
+		idx = cep->skb_dirty & TX_RING_MOD_MASK;
+		dev_kfree_skb_irq(cep->tx_skbuff[idx]);
+		cep->tx_skbuff[idx] = NULL;
+		cep->skb_dirty++;
+
+		atomic_dec(&cep->n_pkts);
 
 		/* Update pointer to next buffer descriptor to be transmitted. */
 		if (bdp->cbd_sc & BD_ENET_TX_WRAP)
@@ -1594,11 +1626,21 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
 	 */
 	eap = (unsigned char *)&(ep->fen_paddrh);
 	for (i=5; i>=0; i--) {
+#ifdef CONFIG_SBC82xx
+		if (i == 5) {
+			/* bd->bi_enetaddr holds the SCC0 address; the FCC
+			   devices count up from there */
+			dev->dev_addr[i] = bd->bi_enetaddr[i] & ~3;
+			dev->dev_addr[i] += 1 + fip->fc_fccnum;
+			*eap++ = dev->dev_addr[i];
+		}
+#else
 		if (i == 3) {
 			dev->dev_addr[i] = bd->bi_enetaddr[i];
 			dev->dev_addr[i] |= (1 << (7 - fip->fc_fccnum));
 			*eap++ = dev->dev_addr[i];
 		}
+#endif
 		else {
 			*eap++ = dev->dev_addr[i] = bd->bi_enetaddr[i];
 		}
@@ -1683,6 +1725,7 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
 	while (cp->cp_cpcr & CPM_CR_FLG);
 
 	cep->skb_cur = cep->skb_dirty = 0;
+	atomic_set(&cep->n_pkts, 0);
 }
 
 /* Let 'er rip.
diff --git a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c
index 15f6c3264..23c0322d5 100644
--- a/arch/ppc/8260_io/uart.c
+++ b/arch/ppc/8260_io/uart.c
@@ -161,7 +161,7 @@ static struct serial_state rs_table[] = {
 #ifndef CONFIG_SCC1_ENET
 	{ 0,     0, PROFF_SCC1, SIU_INT_SCC1,   0, SCC_NUM_BASE},    /* SCC1 ttyS2 */
 #endif
-#ifndef CONFIG_SCC2_ENET
+#if !defined(CONFIG_SBC82xx) && !defined(CONFIG_SCC2_ENET)
 	{ 0,     0, PROFF_SCC2, SIU_INT_SCC2,   0, SCC_NUM_BASE + 1},    /* SCC2 ttyS3 */
 #endif
 };
@@ -475,7 +475,7 @@ static _INLINE_ void receive_chars(ser_info_t *info, struct pt_regs *regs)
 			if (break_pressed && info->line == sercons.index) {
 				if (ch != 0 && time_before(jiffies,
 							break_pressed + HZ*5)) {
-					handle_sysrq(ch, regs, NULL, NULL);
+					handle_sysrq(ch, regs, NULL);
 					break_pressed = 0;
 					goto ignore_char;
 				} else
@@ -592,9 +592,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
 #ifdef SERIAL_DEBUG_OPEN
 			printk("scheduling hangup...");
 #endif
-			MOD_INC_USE_COUNT;
-			if (schedule_work(&info->tqueue_hangup) == 0)
-				MOD_DEC_USE_COUNT;
+			schedule_work(&info->tqueue_hangup);
 		}
 	}
 	if (info->flags & ASYNC_CTS_FLOW) {
@@ -723,7 +721,6 @@ static void do_serial_hangup(void *private_)
 	tty = info->tty;
 	if (tty)
 		tty_hangup(tty);
-	MOD_DEC_USE_COUNT;
 }
 
 /*static void rs_8xx_timer(void)
@@ -1689,7 +1686,6 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
 
 	if (tty_hung_up_p(filp)) {
 		DBG_CNT("before DEC-hung");
-		MOD_DEC_USE_COUNT;
 		restore_flags(flags);
 		return;
 	}
@@ -1716,7 +1712,6 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
 	}
 	if (state->count) {
 		DBG_CNT("before DEC-2");
-		MOD_DEC_USE_COUNT;
 		restore_flags(flags);
 		return;
 	}
@@ -1770,7 +1765,6 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
 	}
 	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&info->close_wait);
-	MOD_DEC_USE_COUNT;
 	restore_flags(flags);
 }
 
@@ -2021,7 +2015,6 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
 	if (retval)
 		return retval;
 
-	MOD_INC_USE_COUNT;
 	retval = block_til_ready(tty, filp, info);
 	if (retval) {
 #ifdef SERIAL_DEBUG_OPEN
@@ -2530,6 +2523,7 @@ static int __init rs_8xx_init(void)
 
 	/* Initialize the tty_driver structure */
 
+	serial_driver->owner = THIS_MODULE;
 	serial_driver->driver_name = "serial";
 	serial_driver->devfs_name = "tts/";
 	serial_driver->name = "ttyS";
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 6dd2e14b6..ec637ed48 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -33,6 +33,7 @@
 #include <asm/pgtable.h>
 #include <asm/8xx_immap.h>
 #include <asm/commproc.h>
+#include <asm/io.h>
 
 extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
 
@@ -55,11 +56,10 @@ static	void	alloc_host_memory(void);
 
 #if 1
 void
-m8xx_cpm_reset()
+m8xx_cpm_reset(void)
 {
 	volatile immap_t	 *imp;
 	volatile cpm8xx_t	*commproc;
-	pte_t			*pte;
 
 	imp = (immap_t *)IMAP_ADDR;
 	commproc = (cpm8xx_t *)&imp->im_cpm;
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
index da6790b2e..99dfab887 100644
--- a/arch/ppc/8xx_io/cs4218_tdm.c
+++ b/arch/ppc/8xx_io/cs4218_tdm.c
@@ -1456,21 +1456,10 @@ static void cs_mksound(unsigned int hz, unsigned int ticks)
 	restore_flags(flags);
 }
 
-static void CS_open(void)
-{
-	MOD_INC_USE_COUNT;
-}
-
-static void CS_release(void)
-{
-	MOD_DEC_USE_COUNT;
-}
-
 static MACHINE mach_cs4218 = {
+	.owner =	THIS_MODULE,
 	.name =		"HIOX CS4218",
 	.name2 =	"Built-in Sound",
-	.open =		CS_open,
-	.release =	CS_release,
 	.dma_alloc =	CS_Alloc,
 	.dma_free =	CS_Free,
 	.irqinit =	CS_IrqInit,
diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c
index d0701bd03..7acc703d4 100644
--- a/arch/ppc/8xx_io/uart.c
+++ b/arch/ppc/8xx_io/uart.c
@@ -583,9 +583,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
 #ifdef SERIAL_DEBUG_OPEN
 			printk("scheduling hangup...");
 #endif
-			MOD_INC_USE_COUNT;
-			if (schedule_task(&info->tqueue_hangup) == 0)
-				MOD_DEC_USE_COUNT;
+			schedule_task(&info->tqueue_hangup);
 		}
 	}
 	if (info->flags & ASYNC_CTS_FLOW) {
@@ -719,7 +717,6 @@ static void do_serial_hangup(void *private_)
 	tty = info->tty;
 	if (tty)
 		tty_hangup(tty);
-	MOD_DEC_USE_COUNT;
 }
 
 /*static void rs_8xx_timer(void)
@@ -1664,7 +1661,6 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
 
 	if (tty_hung_up_p(filp)) {
 		DBG_CNT("before DEC-hung");
-		MOD_DEC_USE_COUNT;
 		restore_flags(flags);
 		return;
 	}
@@ -1691,7 +1687,6 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
 	}
 	if (state->count) {
 		DBG_CNT("before DEC-2");
-		MOD_DEC_USE_COUNT;
 		restore_flags(flags);
 		return;
 	}
@@ -1746,7 +1741,6 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp)
 	}
 	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&info->close_wait);
-	MOD_DEC_USE_COUNT;
 	restore_flags(flags);
 }
 
@@ -2008,14 +2002,12 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp)
 	if (retval)
 		return retval;
 
-	MOD_INC_USE_COUNT;
 	retval = block_til_ready(tty, filp, info);
 	if (retval) {
 #ifdef SERIAL_DEBUG_OPEN
 		printk("rs_open returning after block_til_ready with %d\n",
 		       retval);
 #endif
-		MOD_DEC_USE_COUNT;
 		return retval;
 	}
 
@@ -2520,6 +2512,7 @@ static int __init rs_8xx_init(void)
 
 	/* Initialize the tty_driver structure */
 
+	serial_driver->owner = THIS_MODULE;
 	serial_driver->driver_name = "serial";
 	serial_driver->devfs_name = "tts/";
 	serial_driver->name = "ttyS";
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 8de9f39a1..0d4e6516a 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -542,6 +542,15 @@ config EST8260
 	  <http://www.windriver.com/>, but the EST8260 cannot be found on it
 	  and has probably been discontinued or rebadged.
 
+config SBC82xx
+	bool "SBC82xx"
+	---help---
+	  SBC PowerQUICC II, single-board computer with MPC82xx CPU
+	  Manufacturer: Wind River Systems, Inc.
+	  Date of Release: May 2003
+	  End of Life: -
+	  URL: <http://www.windriver.com/>
+
 config SBS8260
 	bool "SBS8260"
 
@@ -575,7 +584,7 @@ config EMBEDDEDBOOT
 config 8260
 	bool "MPC8260 CPM Support" if WILLOW
 	depends on 6xx
-	default y if TQM8260 || RPXSUPER || EST8260 || SBS8260
+	default y if TQM8260 || RPXSUPER || EST8260 || SBS8260 || SBC82xx
 	help
 	  The MPC8260 CPM (Communications Processor Module) is a typical
 	  embedded CPU made by Motorola.  Selecting this option means that
@@ -1070,6 +1079,30 @@ config TASK_SIZE
 	hex "Size of user task space" if TASK_SIZE_BOOL
 	default "0x80000000"
 
+config CONSISTENT_START_BOOL
+	bool "Set custom consistent memory pool address"
+	depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
+	help
+	  This option allows you to set the base virtual address
+	  of the the consistent memory pool.  This pool of virtual
+	  memory is used to make consistent memory allocations.
+
+config CONSISTENT_START
+	hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL
+	default "0xff100000" if NOT_COHERENT_CACHE
+
+config CONSISTENT_SIZE_BOOL
+	bool "Set custom consistent memory pool size"
+	depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
+	help
+	  This option allows you to set the size of the the
+	  consistent memory pool.  This pool of virtual memory
+	  is used to make consistent memory allocations.
+
+config CONSISTENT_SIZE
+	hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
+	default "0x00200000" if NOT_COHERENT_CACHE
+
 config BOOT_LOAD_BOOL
 	bool "Set the boot link/load address"
 	depends on ADVANCED_OPTIONS && !PPC_MULTIPLATFORM
@@ -1238,7 +1271,7 @@ config SERIAL_TEXT_DEBUG
 	bool "Support for early boot texts over serial port"
 	depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550
 
-config OCP
+config PPC_OCP
 	bool
 	depends on IBM_OCP
 	default y
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index daf9fc0bc..54e9a9e6d 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -43,7 +43,6 @@ core-$(CONFIG_APUS)		+= arch/ppc/amiga/
 drivers-$(CONFIG_8xx)		+= arch/ppc/8xx_io/
 drivers-$(CONFIG_4xx)		+= arch/ppc/4xx_io/
 drivers-$(CONFIG_8260)		+= arch/ppc/8260_io/
-drivers-$(CONFIG_OCP)		+= arch/ppc/ocp/
 
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
 
@@ -87,7 +86,7 @@ include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
 
 ifdef CONFIG_6xx
 # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later
-NEW_AS	:= $(shell echo dssall | $(AS) -o /dev/null >/dev/null 2>&1 ; echo $$?)
+NEW_AS	:= $(shell echo dssall | $(AS) -many -o /dev/null >/dev/null 2>&1 ; echo $$?)
 GOODVER	:= 2.12.1
 else
 NEW_AS	:= 0
@@ -95,7 +94,7 @@ endif
 
 ifneq ($(NEW_AS),0)
 checkbin:
-	@echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build'
+	@echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '
 	@echo 'correctly with old versions of binutils.'
 	@echo '*** Please upgrade your binutils to ${GOODVER} or newer'
 	@false
diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile
index 181a5a582..8c1d7eb8b 100644
--- a/arch/ppc/boot/Makefile
+++ b/arch/ppc/boot/Makefile
@@ -17,11 +17,11 @@ BOOT_TARGETS	= zImage zImage.initrd znetboot znetboot.initrd
 
 bootdir-y			:= simple
 bootdir-$(CONFIG_PPC_OF)	+= openfirmware
-subdir-y			:= lib/ common/ images/
-subdir-$(CONFIG_PPC_OF)		+= of1275/
+subdir-y			:= lib common images
+subdir-$(CONFIG_PPC_OF)		+= of1275
 
 # for cleaning
-subdir-				+= simple/ openfirmware/
+subdir-				+= simple openfirmware
 
 host-progs := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree)
 
diff --git a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
index 88a2dd049..4eacbd8c7 100644
--- a/arch/ppc/boot/openfirmware/Makefile
+++ b/arch/ppc/boot/openfirmware/Makefile
@@ -22,9 +22,10 @@ of1275	:= $(boot)/of1275
 images	:= $(boot)/images
 
 OBJCOPY_ARGS	:= -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
-COFF_LD_ARGS	:= -T $(boot)/ld.script -e _start -Ttext 0x00500000 -Bstatic
-CHRP_LD_ARGS	:= -T $(boot)/ld.script -e _start -Ttext 0x00800000
-NEWWORLD_LD_ARGS:= -T $(boot)/ld.script -e _start -Ttext 0x01000000
+COFF_LD_ARGS	:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00500000 \
+			-Bstatic
+CHRP_LD_ARGS	:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000
+NEWWORLD_LD_ARGS:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x01000000
 
 COMMONOBJS	:= start.o misc.o common.o
 COFFOBJS	:= coffcrt0.o $(COMMONOBJS) coffmain.o
@@ -92,11 +93,11 @@ quiet_cmd_gencoffb = COFF    $@
       cmd_gencoffb = $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) $< $(LIBS) && \
                      $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
 targets += coffboot
-$(obj)/coffboot: $(obj)/image.o $(COFFOBJS) $(LIBS) $(boot)/ld.script FORCE
+$(obj)/coffboot: $(obj)/image.o $(COFFOBJS) $(LIBS) $(srctree)/$(boot)/ld.script FORCE
 	$(call if_changed,gencoffb)
 targets += coffboot.initrd
 $(obj)/coffboot.initrd: $(obj)/image.initrd.o $(COFFOBJS) $(LIBS) \
-			$(boot)/ld.script FORCE
+			$(srctree)/$(boot)/ld.script FORCE
 	$(call if_changed,gencoffb)
 
 
@@ -118,20 +119,22 @@ quiet_cmd_gen-elf-pmac = ELF     $@
 					 -R .comment $(del-ramdisk-sec)
 
 $(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) \
-			$(obj)/note $(boot)/ld.script
+			$(obj)/note $(srctree)/$(boot)/ld.script
 	$(call cmd,gen-elf-pmac)
 $(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
-				   $(LIBS) $(obj)/note $(boot)/ld.script
+				   $(LIBS) $(obj)/note \
+				   $(srctree)/$(boot)/ld.script
 	$(call cmd,gen-elf-pmac)
 
 quiet_cmd_gen-chrp = CHRP    $@
       cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
 			$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
 
-$(images)/zImage.chrp: $(obj)/image.o $(CHRPOBJS) $(LIBS) $(boot)/ld.script
+$(images)/zImage.chrp: $(obj)/image.o $(CHRPOBJS) $(LIBS) \
+				   $(srctree)/$(boot)/ld.script
 	$(call cmd,gen-chrp)
 $(images)/zImage.initrd.chrp: $(obj)/image.initrd.o $(CHRPOBJS) $(LIBS) \
-			$(boot)/ld.script
+				   $(srctree)/$(boot)/ld.script
 	$(call cmd,gen-chrp)
 
 quiet_cmd_addnote = ADDNOTE $@
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index 91e2cc493..d497a9366 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -125,7 +125,7 @@ EXTRA_AFLAGS := $(extra-aflags-y)
 AFLAGS_head.o				+= $(cacheflag-y)
 
 # Linker args.  This specifies where the image will be run at.
-LD_ARGS				:= -T $(boot)/ld.script \
+LD_ARGS					:= -T $(srctree)/$(boot)/ld.script \
 				   -Ttext $(CONFIG_BOOT_LOAD) -Bstatic
 OBJCOPY_ARGS			:= -O elf32-powerpc
 
@@ -159,8 +159,8 @@ MKTREE				:= $(utils)/mktree
 
 targets := dummy.o
 
-$(obj)/zvmlinux: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \
-		$(obj)/dummy.o
+$(obj)/zvmlinux: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
+		$(images)/vmlinux.gz $(obj)/dummy.o
 	$(OBJCOPY) $(OBJCOPY_ARGS) \
 		--add-section=.image=$(images)/vmlinux.gz \
 		--set-section-flags=.image=contents,alloc,load,readonly,data \
@@ -169,7 +169,7 @@ $(obj)/zvmlinux: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \
 	$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
 		-R .stabstr -R .ramdisk -R .sysmap
 
-$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(boot)/ld.script \
+$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
 		$(images)/vmlinux.gz $(obj)/dummy.o
 	$(OBJCOPY) $(OBJCOPY_ARGS) \
 		--add-section=.ramdisk=$(images)/ramdisk.image.gz \
@@ -210,10 +210,10 @@ $(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE)
 	$(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \
 		$(ENTRYPOINT)
 
-$(images)/zImage-PPLUS: $(obj)/zvmlinux $(utils)/mkprep $(MKBUGBOOT)
+$(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
 	$(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.$(end-y)
 	$(MKBUGBOOT) $(obj)/zvmlinux $(images)/zImage.bugboot
 
-$(images)/zImage.initrd-PPLUS: $(obj)/zvmlinux.initrd $(utils)/mkprep $(MKBUGBOOT)
+$(images)/zImage.initrd-PPLUS: $(obj)/zvmlinux.initrd $(MKPREP) $(MKBUGBOOT)
 	$(MKPREP) -pbp $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y)
 	$(MKBUGBOOT) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.bugboot
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index 3c3b31c98..4dc12e6ab 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -10,6 +10,7 @@
 #include <linux/types.h>
 #include <linux/config.h>
 #include <linux/string.h>
+#include <asm/reg.h>
 #ifdef CONFIG_8xx
 #include <asm/mpc8xx.h>
 #endif
@@ -402,14 +403,18 @@ embed_config(bd_t **bdp)
 
 #ifdef CONFIG_8260
 /* Compute 8260 clock values if the rom doesn't provide them.
- * We can't compute the internal core frequency (I don't know how to
- * do that).
  */
+static unsigned char bus2core_8260[] = {
+/*      0   1   2   3   4   5   6   7   8   9   a   b   c   d   e   f */
+	3,  2,  2,  2,  4,  4,  5,  9,  6, 11,  8, 10,  3, 12,  7,  2,
+	6,  5, 13,  2, 14,  4, 15,  2,  3, 11,  8, 10, 16, 12,  7,  2,
+};
+
 static void
 clk_8260(bd_t *bd)
 {
 	uint	scmr, vco_out, clkin;
-	uint	plldf, pllmf, busdf, brgdf, cpmdf;
+	uint	plldf, pllmf, corecnf;
 	volatile immap_t	*ip;
 
 	ip = (immap_t *)IMAP_ADDR;
@@ -423,8 +428,7 @@ clk_8260(bd_t *bd)
 	*/
 	plldf = (scmr >> 12) & 1;
 	pllmf = scmr & 0xfff;
-	cpmdf = (scmr >> 16) & 0x0f;
-	busdf = (scmr >> 20) & 0x0f;
+	corecnf = (scmr >> 24) &0x1f;
 
 	/* This is arithmetic from the 8260 manual.
 	*/
@@ -433,6 +437,7 @@ clk_8260(bd_t *bd)
 	bd->bi_vco = vco_out;		/* Save for later */
 
 	bd->bi_cpmfreq = vco_out / 2;	/* CPM Freq, in MHz */
+	bd->bi_intfreq = bd->bi_busfreq * bus2core_8260[corecnf] / 2;
 
 	/* Set Baud rate divisor.  The power up default is divide by 16,
 	 * but we set it again here in case it was changed.
@@ -440,8 +445,79 @@ clk_8260(bd_t *bd)
 	ip->im_clkrst.car_sccr = 1;	/* DIV 16 BRG */
 	bd->bi_brgfreq = vco_out / 16;
 }
+
+static unsigned char bus2core_8280[] = {
+/*      0   1   2   3   4   5   6   7   8   9   a   b   c   d   e   f */
+	3,  2,  2,  2,  4,  4,  5,  9,  6, 11,  8, 10,  3, 12,  7,  2,
+	6,  5, 13,  2, 14,  2, 15,  2,  3,  2,  2,  2, 16,  2,  2,  2,
+};
+
+static void
+clk_8280(bd_t *bd)
+{
+	uint	scmr, main_clk, clkin;
+	uint	pllmf, corecnf;
+	volatile immap_t	*ip;
+
+	ip = (immap_t *)IMAP_ADDR;
+	scmr = ip->im_clkrst.car_scmr;
+
+	/* The clkin is always bus frequency.
+	*/
+	clkin = bd->bi_busfreq;
+
+	/* Collect the bits from the scmr.
+	*/
+	pllmf = scmr & 0xf;
+	corecnf = (scmr >> 24) & 0x1f;
+
+	/* This is arithmetic from the 8280 manual.
+	*/
+	main_clk = clkin * (pllmf + 1);
+
+	bd->bi_cpmfreq = main_clk / 2;	/* CPM Freq, in MHz */
+	bd->bi_intfreq = bd->bi_busfreq * bus2core_8280[corecnf] / 2;
+
+	/* Set Baud rate divisor.  The power up default is divide by 16,
+	 * but we set it again here in case it was changed.
+	 */
+	ip->im_clkrst.car_sccr = (ip->im_clkrst.car_sccr & 0x3) | 0x1;
+	bd->bi_brgfreq = main_clk / 16;
+}
 #endif
 
+#ifdef CONFIG_SBC82xx
+void
+embed_config(bd_t **bdp)
+{
+	u_char	*cp;
+	int	i;
+	bd_t	*bd;
+	unsigned long pvr;
+
+	bd = *bdp;
+
+	bd = &bdinfo;
+	*bdp = bd;
+	bd->bi_baudrate = 9600;
+	bd->bi_memsize = 256 * 1024 * 1024;	/* just a guess */
+
+	cp = (void*)SBC82xx_MACADDR_NVRAM_SCC1;
+	memcpy(bd->bi_enetaddr, cp, 6);
+
+	/* can busfreq be calculated? */
+	pvr = mfspr(PVR);
+	if ((pvr & 0xffff0000) == 0x80820000) {
+		bd->bi_busfreq = 100000000;
+		clk_8280(bd);
+	} else {
+		bd->bi_busfreq = 66000000;
+		clk_8260(bd);
+	}
+
+}
+#endif /* SBC82xx */
+
 #if defined(CONFIG_EST8260) || defined(CONFIG_TQM8260)
 void
 embed_config(bd_t **bdp)
@@ -705,7 +781,7 @@ embed_config(bd_t ** bdp)
 #ifdef CONFIG_IBM_OPENBIOS
 /* This could possibly work for all treeboot roms.
 */
-#if defined(CONFIG_ASH) || defined(CONFIG_BEECH)
+#if defined(CONFIG_ASH) || defined(CONFIG_BEECH) || defined(CONFIG_BUBINGA)
 #define BOARD_INFO_VECTOR       0xFFF80B50 /* openbios 1.19 moved this vector down  - armin */
 #else
 #define BOARD_INFO_VECTOR	0xFFFE0B50
@@ -742,7 +818,7 @@ embed_config(bd_t **bdp)
 	 */
 	mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);     /* 1st reset MAL */
 	while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for the reset */	
-	out_be32(EMAC0_BASE,0x20000000);        /* then reset EMAC */
+	out_be32((volatile u32*)EMAC0_BASE,0x20000000);        /* then reset EMAC */
 #endif
 
 	bd = &bdinfo;
diff --git a/arch/ppc/configs/ash_defconfig b/arch/ppc/configs/ash_defconfig
index fd371dedc..b2d8e1c00 100644
--- a/arch/ppc/configs/ash_defconfig
+++ b/arch/ppc/configs/ash_defconfig
@@ -4,11 +4,17 @@
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
@@ -18,9 +24,16 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
+# CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
 CONFIG_FUTEX=y
 # CONFIG_EPOLL is not set
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -33,66 +46,61 @@ CONFIG_OBSOLETE_MODPARM=y
 CONFIG_KMOD=y
 
 #
-# Platform support
+# Processor
 #
-CONFIG_PPC=y
-CONFIG_PPC32=y
 # CONFIG_6xx is not set
 CONFIG_40x=y
+# CONFIG_44x is not set
 # CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_CPU_FREQ is not set
 CONFIG_4xx=y
 
 #
 # IBM 4xx options
 #
 CONFIG_ASH=y
-# CONFIG_BEECH is not set
-# CONFIG_CEDAR is not set
 # CONFIG_CPCI405 is not set
 # CONFIG_EP405 is not set
+# CONFIG_EVB405EP is not set
 # CONFIG_OAK is not set
-# CONFIG_REDWOOD_4 is not set
 # CONFIG_REDWOOD_5 is not set
 # CONFIG_REDWOOD_6 is not set
 # CONFIG_SYCAMORE is not set
-# CONFIG_TIVO is not set
 # CONFIG_WALNUT is not set
 CONFIG_NP405H=y
 CONFIG_IBM405_ERR77=y
 CONFIG_IBM405_ERR51=y
 CONFIG_IBM_OCP=y
+CONFIG_PPC_OCP=y
 CONFIG_IBM_OPENBIOS=y
-# CONFIG_405_DMA is not set
 # CONFIG_PM is not set
 CONFIG_UART0_TTYS0=y
 # CONFIG_UART0_TTYS1 is not set
 CONFIG_NOT_COHERENT_CACHE=y
-# CONFIG_SMP is not set
-# CONFIG_PREEMPT is not set
-# CONFIG_MATH_EMULATION is not set
-# CONFIG_CPU_FREQ is not set
 
 #
-# General setup
+# Platform options
 #
-# CONFIG_HIGHMEM is not set
-CONFIG_PCI=y
-CONFIG_PCI_DOMAINS=y
 # CONFIG_PC_KEYBOARD is not set
-CONFIG_KCORE_ELF=y
-CONFIG_BINFMT_ELF=y
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HIGHMEM is not set
 CONFIG_KERNEL_ELF=y
+CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-CONFIG_PCI_LEGACY_PROC=y
-# CONFIG_PCI_NAMES is not set
-# CONFIG_HOTPLUG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
-# Parallel port support
+# Bus options
 #
-# CONFIG_PARPORT is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_LEGACY_PROC=y
+# CONFIG_PCI_NAMES is not set
 
 #
 # Advanced setup
@@ -108,15 +116,27 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00400000
 
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+
 #
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
@@ -127,32 +147,36 @@ CONFIG_BOOT_LOAD=0x00400000
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
 
 #
-# Multi-device support (RAID and LVM)
+# ATA/ATAPI/MFM/RLL support
 #
-# CONFIG_MD is not set
+# CONFIG_IDE is not set
 
 #
-# ATA/IDE/MFM/RLL support
+# SCSI device support
 #
-# CONFIG_IDE is not set
+# CONFIG_SCSI is not set
 
 #
-# SCSI support
+# Multi-device support (RAID and LVM)
 #
-# CONFIG_SCSI is not set
+# CONFIG_MD is not set
 
 #
 # Fusion MPT device support
 #
+# CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -161,6 +185,10 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -171,38 +199,37 @@ CONFIG_NET=y
 #
 # CONFIG_PACKET is not set
 # CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
+# CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_XFRM_USER is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -230,7 +257,6 @@ CONFIG_NETDEVICES=y
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -247,6 +273,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -254,6 +281,12 @@ CONFIG_NETDEVICES=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=64
+CONFIG_IBM_EMAC_TXB=8
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
@@ -265,10 +298,12 @@ CONFIG_NETDEVICES=y
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
+# CONFIG_TR is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -286,47 +321,71 @@ CONFIG_NETDEVICES=y
 # CONFIG_IRDA is not set
 
 #
-# ISDN subsystem
+# Bluetooth support
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
-# Graphics support
+# ISDN subsystem
 #
-# CONFIG_FB is not set
+# CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Telephony Support
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
 #
-# CONFIG_INPUT is not set
+CONFIG_INPUT=y
 
 #
 # Userland interfaces
 #
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
 
 #
 # Input I/O drivers
 #
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
-# CONFIG_SERIO is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
 
 #
 # Input Device Drivers
 #
-
-#
-# Macintosh device drivers
-#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
 
 #
 # Character devices
 #
+# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -334,6 +393,7 @@ CONFIG_SOUND_GAMEPORT=y
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -342,100 +402,145 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
 #
 CONFIG_I2C=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
 # CONFIG_I2C_ALGOBIT is not set
 # CONFIG_I2C_ALGOPCF is not set
-CONFIG_I2C_IBM_OCP_ALGO=y
-CONFIG_I2C_IBM_OCP_ADAP=y
-# CONFIG_I2C_CHARDEV is not set
 
 #
-# I2C Hardware Sensors Mainboard support
+# I2C Hardware Bus support
 #
+# CONFIG_I2C_ALI1535 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
 # CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_IBM_IIC is not set
+# CONFIG_I2C_ISA is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
 # CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
+# CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
-# CONFIG_I2C_SENSOR is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# Mice
+# Other I2C Chip support
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_QIC02_TAPE is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# IPMI
+# Misc devices
 #
-# CONFIG_IPMI_HANDLER is not set
 
 #
-# Watchdog Cards
+# Multimedia devices
 #
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_WDT is not set
-# CONFIG_WDTPCI is not set
-# CONFIG_PCWATCHDOG is not set
-# CONFIG_ACQUIRE_WDT is not set
-# CONFIG_ADVANTECH_WDT is not set
-# CONFIG_EUROTECH_WDT is not set
-# CONFIG_IB700_WDT is not set
-# CONFIG_MIXCOMWD is not set
-# CONFIG_SCx200_WDT is not set
-# CONFIG_60XX_WDT is not set
-# CONFIG_W83877F_WDT is not set
-# CONFIG_MACHZ_WDT is not set
-# CONFIG_SC520_WDT is not set
-# CONFIG_AMD7XX_TCO is not set
-# CONFIG_ALIM7101_WDT is not set
-# CONFIG_SC1200_WDT is not set
-# CONFIG_WAFER_WDT is not set
-# CONFIG_CPU5_WDT is not set
-# CONFIG_NVRAM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
+# CONFIG_VIDEO_DEV is not set
 
 #
-# Ftape, the floppy tape device driver
+# Digital Video Broadcasting Devices
 #
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_DVB is not set
 
 #
-# Multimedia devices
+# Graphics support
 #
-# CONFIG_VIDEO_DEV is not set
+# CONFIG_FB is not set
 
 #
-# Digital Video Broadcasting Devices
+# Sound
 #
-# CONFIG_DVB is not set
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
 
 #
 # File systems
@@ -469,10 +574,11 @@ CONFIG_EXT2_FS=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 
 #
@@ -481,6 +587,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -497,12 +604,13 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -528,25 +636,14 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_EFI_PARTITION is not set
 
 #
-# Sound
+# Native Language Support
 #
-# CONFIG_SOUND is not set
+# CONFIG_NLS is not set
 
 #
 # IBM 40x options
 #
 
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-
 #
 # Library routines
 #
@@ -556,7 +653,6 @@ CONFIG_CRC32=y
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
-# CONFIG_KALLSYMS is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
 CONFIG_OCP=y
 
diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig
index 789af1885..15ecefd47 100644
--- a/arch/ppc/configs/common_defconfig
+++ b/arch/ppc/configs/common_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -20,9 +21,12 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
@@ -32,6 +36,8 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -113,7 +119,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-CONFIG_HOTPLUG=y
 
 #
 # PCMCIA/CardBus support
@@ -121,11 +126,6 @@ CONFIG_HOTPLUG=y
 # CONFIG_PCMCIA is not set
 CONFIG_PCMCIA_PROBE=y
 
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
 #
 # Advanced setup
 #
@@ -140,6 +140,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -150,6 +154,11 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
@@ -167,16 +176,12 @@ CONFIG_BLK_DEV_FD=m
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_LBD=y
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -199,6 +204,7 @@ CONFIG_BLK_DEV_IDESCSI=y
 #
 # IDE chipset support/bugfixes
 #
+CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -206,7 +212,6 @@ CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_SL82C105=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
@@ -267,6 +272,12 @@ CONFIG_CHR_DEV_SG=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -279,7 +290,6 @@ CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_AIC7XXX=m
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
 CONFIG_AIC7XXX_RESET_DELAY_MS=15000
-# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
 CONFIG_AIC7XXX_DEBUG_ENABLE=y
 CONFIG_AIC7XXX_DEBUG_MASK=0
@@ -289,6 +299,7 @@ CONFIG_SCSI_AIC7XXX_OLD=m
 CONFIG_SCSI_ADVANSYS=m
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -307,14 +318,23 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_NSP32 is not set
@@ -324,13 +344,23 @@ CONFIG_SCSI_MESH_SYNC_RATE=5
 CONFIG_SCSI_MESH_RESET_DELAY_MS=4000
 CONFIG_SCSI_MAC53C94=y
 
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -339,6 +369,24 @@ CONFIG_SCSI_MAC53C94=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+CONFIG_ADB=y
+CONFIG_ADB_CUDA=y
+CONFIG_ADB_PMU=y
+CONFIG_PMAC_PBOOK=y
+CONFIG_PMAC_APM_EMU=y
+CONFIG_PMAC_BACKLIGHT=y
+# CONFIG_MAC_FLOPPY is not set
+CONFIG_MAC_SERIAL=m
+CONFIG_ADB_MACIO=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_THERM_WINDTUNNEL=m
+CONFIG_THERM_ADT746X=m
+# CONFIG_ANSLCD is not set
+
 #
 # Networking support
 #
@@ -360,7 +408,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -371,8 +418,6 @@ CONFIG_SYN_COOKIES=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -425,14 +470,17 @@ CONFIG_IP_NF_TARGET_TCPMSS=m
 # CONFIG_IP_NF_ARPTABLES is not set
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 # CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -453,16 +501,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -488,6 +541,7 @@ CONFIG_DE2104X=y
 CONFIG_TULIP=y
 # CONFIG_TULIP_MWI is not set
 CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
 CONFIG_DE4X5=m
 # CONFIG_WINBOND_840 is not set
 # CONFIG_DM9102 is not set
@@ -502,6 +556,7 @@ CONFIG_PCNET32=y
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
@@ -528,7 +583,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -536,17 +590,12 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=y
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=y
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=y
-# CONFIG_PPP_BSDCOMP is not set
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -569,98 +618,43 @@ CONFIG_APPLE_AIRPORT=m
 # CONFIG_PLX_HERMES is not set
 # CONFIG_TMD_HERMES is not set
 # CONFIG_PCI_HERMES is not set
-CONFIG_NET_WIRELESS=y
+# CONFIG_ATMEL is not set
 
 #
-# Token Ring devices
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
 #
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
+# CONFIG_PRISM54 is not set
+CONFIG_NET_WIRELESS=y
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=y
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
-
-#
-# Graphics support
-#
-CONFIG_FB=y
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-CONFIG_FB_CONTROL=y
-CONFIG_FB_PLATINUM=y
-CONFIG_FB_VALKYRIE=y
-CONFIG_FB_CT65550=y
-CONFIG_FB_IMSTT=y
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-# CONFIG_FB_MATROX_G450 is not set
-# CONFIG_FB_MATROX_G100A is not set
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-CONFIG_FB_RADEON=y
-CONFIG_FB_ATY128=y
-CONFIG_FB_ATY=y
-CONFIG_FB_ATY_CT=y
-CONFIG_FB_ATY_GX=y
-# CONFIG_FB_ATY_XL_INIT is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-CONFIG_FB_3DFX=y
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-CONFIG_VGA_CONSOLE=y
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Telephony Support
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -696,37 +690,21 @@ CONFIG_SERIO_I8042=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_INPORT is not set
 # CONFIG_MOUSE_LOGIBM is not set
 # CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 CONFIG_INPUT_MISC=y
-CONFIG_INPUT_PCSPKR=y
 CONFIG_INPUT_UINPUT=m
 
-#
-# Macintosh device drivers
-#
-CONFIG_ADB_CUDA=y
-CONFIG_ADB_PMU=y
-CONFIG_PMAC_PBOOK=y
-CONFIG_PMAC_APM_EMU=y
-CONFIG_PMAC_BACKLIGHT=y
-# CONFIG_MAC_FLOPPY is not set
-CONFIG_MAC_SERIAL=m
-CONFIG_ADB=y
-CONFIG_ADB_MACIO=y
-CONFIG_INPUT_ADBHID=y
-CONFIG_MAC_EMUMOUSEBTN=y
-# CONFIG_ANSLCD is not set
-
 #
 # Character devices
 #
@@ -749,79 +727,108 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_PMACZILOG=y
 # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
 #
-CONFIG_I2C=m
+CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=m
 
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 
 #
 # I2C Hardware Bus support
 #
 # CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_ELEKTOR is not set
+CONFIG_I2C_HYDRA=y
 # CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
 # CONFIG_I2C_ISA is not set
 CONFIG_I2C_KEYWEST=m
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
 # CONFIG_I2C_SIS5595 is not set
 # CONFIG_I2C_SIS630 is not set
 # CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
 # CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
 # CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# Mice
-#
-CONFIG_BUSMOUSE=y
-# CONFIG_QIC02_TAPE is not set
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
+# Other I2C Chip support
 #
-# CONFIG_WATCHDOG is not set
-CONFIG_NVRAM=y
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# Ftape, the floppy tape device driver
+# Misc devices
 #
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
 
 #
 # Multimedia devices
@@ -834,152 +841,63 @@ CONFIG_GEN_RTC=y
 # CONFIG_DVB is not set
 
 #
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
+# Graphics support
 #
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_DEVFS_FS=y
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-CONFIG_HFS_FS=m
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V4 is not set
-CONFIG_NFSD=y
-CONFIG_NFSD_V3=y
-# CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
+CONFIG_FB=y
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_CT65550=y
+CONFIG_FB_IMSTT=y
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+# CONFIG_FB_MATROX_G450 is not set
+# CONFIG_FB_MATROX_G100A is not set
+CONFIG_FB_MATROX_I2C=y
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+# CONFIG_FB_RADEON_OLD is not set
+CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=y
+CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
 
 #
-# Partition Types
+# Console display driver support
 #
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-CONFIG_MAC_PARTITION=y
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-CONFIG_NLS=y
+CONFIG_VGA_CONSOLE=y
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
 
 #
-# Native Language Support
+# Logo configuration
 #
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ISO8859_1=m
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
 
 #
 # Sound
@@ -992,6 +910,10 @@ CONFIG_DMASOUND=m
 # Advanced Linux Sound Architecture
 #
 CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
 CONFIG_SND_SEQUENCER=m
 # CONFIG_SND_SEQ_DUMMY is not set
 CONFIG_SND_OSSEMUL=y
@@ -1004,6 +926,8 @@ CONFIG_SND_SEQUENCER_OSS=y
 #
 # Generic devices
 #
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_VIRMIDI is not set
 # CONFIG_SND_MTPAV is not set
@@ -1040,11 +964,17 @@ CONFIG_SND_CS4232=m
 # PCI devices
 #
 # CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
 # CONFIG_SND_CS46XX is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MIXART is not set
 # CONFIG_SND_NM256 is not set
 # CONFIG_SND_RME32 is not set
 # CONFIG_SND_RME96 is not set
@@ -1063,6 +993,7 @@ CONFIG_SND_CS4232=m
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
 # CONFIG_SND_SONICVIBES is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VX222 is not set
@@ -1132,13 +1063,14 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_WACOM is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
 # CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-CONFIG_USB_SCANNER=m
 # CONFIG_USB_MICROTEK is not set
 # CONFIG_USB_HPUSBSCSI is not set
 
@@ -1206,17 +1138,176 @@ CONFIG_USB_EZUSB=y
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_DEVFS_FS=y
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V4 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
 
diff --git a/arch/ppc/configs/cpci405_defconfig b/arch/ppc/configs/cpci405_defconfig
index c3e992afd..1fc50f5fe 100644
--- a/arch/ppc/configs/cpci405_defconfig
+++ b/arch/ppc/configs/cpci405_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -23,6 +24,7 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 # CONFIG_KALLSYMS is not set
@@ -31,6 +33,7 @@ CONFIG_FUTEX=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -59,22 +62,19 @@ CONFIG_4xx=y
 # IBM 4xx options
 #
 # CONFIG_ASH is not set
-# CONFIG_BEECH is not set
-# CONFIG_CEDAR is not set
 CONFIG_CPCI405=y
 # CONFIG_EP405 is not set
+# CONFIG_EVB405EP is not set
 # CONFIG_OAK is not set
-# CONFIG_REDWOOD_4 is not set
 # CONFIG_REDWOOD_5 is not set
 # CONFIG_REDWOOD_6 is not set
 # CONFIG_SYCAMORE is not set
-# CONFIG_TIVO is not set
 # CONFIG_WALNUT is not set
 CONFIG_IBM405_ERR77=y
 CONFIG_IBM405_ERR51=y
 CONFIG_IBM_OCP=y
+CONFIG_PPC_OCP=y
 CONFIG_405GP=y
-# CONFIG_405_DMA is not set
 # CONFIG_PM is not set
 CONFIG_UART0_TTYS0=y
 # CONFIG_UART0_TTYS1 is not set
@@ -90,7 +90,8 @@ CONFIG_NOT_COHERENT_CACHE=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
 # Bus options
@@ -99,12 +100,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 # CONFIG_PCI_NAMES is not set
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 
 #
 # Advanced setup
@@ -120,6 +115,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00400000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -129,30 +128,31 @@ CONFIG_BOOT_LOAD=0x00400000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
+# CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_LBD is not set
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -174,6 +174,7 @@ CONFIG_BLK_DEV_IDEDISK=y
 #
 # IDE chipset support/bugfixes
 #
+CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -184,12 +185,18 @@ CONFIG_BLK_DEV_IDEDISK=y
 #
 # CONFIG_SCSI is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
+# CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -198,6 +205,10 @@ CONFIG_BLK_DEV_IDEDISK=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -214,14 +225,13 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
+# CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -234,7 +244,6 @@ CONFIG_SYN_COOKIES=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
@@ -292,6 +301,12 @@ CONFIG_NETDEVICES=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=64
+CONFIG_IBM_EMAC_TXB=8
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
@@ -308,6 +323,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_TR is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -328,16 +344,18 @@ CONFIG_NETDEVICES=y
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-# CONFIG_FB is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -373,10 +391,6 @@ CONFIG_SERIO=y
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Character devices
 #
@@ -397,52 +411,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_UNIX98_PTYS is not set
-
-#
-# I2C support
-#
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-CONFIG_I2C_IBM_IIC=y
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_PIIX4 is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_VIAPRO is not set
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_W83781D is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -469,6 +439,15 @@ CONFIG_GEN_RTC=y
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -479,6 +458,26 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_DVB is not set
 
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
 #
 # File systems
 #
@@ -525,6 +524,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -541,13 +541,14 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -560,11 +561,11 @@ CONFIG_SUNRPC=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -604,21 +605,10 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
 #
 # IBM 40x options
 #
 
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
 #
 # Library routines
 #
diff --git a/arch/ppc/configs/ebony_defconfig b/arch/ppc/configs/ebony_defconfig
index 7cbb927c2..7dca4c6e1 100644
--- a/arch/ppc/configs/ebony_defconfig
+++ b/arch/ppc/configs/ebony_defconfig
@@ -21,8 +21,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -33,6 +35,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -67,7 +70,6 @@ CONFIG_440GP=y
 CONFIG_440=y
 CONFIG_BOOKE=y
 CONFIG_IBM_OCP=y
-CONFIG_PPC_OCP=y
 # CONFIG_PM is not set
 CONFIG_NOT_COHERENT_CACHE=y
 
@@ -161,7 +163,6 @@ CONFIG_LBD=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -210,8 +211,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -230,7 +229,9 @@ CONFIG_NETFILTER=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -251,16 +252,21 @@ CONFIG_NETFILTER=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -277,7 +283,6 @@ CONFIG_NETDEVICES=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -285,45 +290,29 @@ CONFIG_NETDEVICES=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -495,6 +484,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
@@ -535,7 +525,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -553,6 +542,7 @@ CONFIG_MSDOS_PARTITION=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # Kernel hacking
@@ -567,7 +557,7 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_BDI_SWITCH=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
-CONFIG_OCP=y
+CONFIG_PPC_OCP=y
 
 #
 # Security options
diff --git a/arch/ppc/configs/ep405_defconfig b/arch/ppc/configs/ep405_defconfig
index c457d16ae..6f8b1e7ff 100644
--- a/arch/ppc/configs/ep405_defconfig
+++ b/arch/ppc/configs/ep405_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -20,17 +21,22 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
-# CONFIG_EMBEDDED is not set
+CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -59,16 +65,13 @@ CONFIG_4xx=y
 # IBM 4xx options
 #
 # CONFIG_ASH is not set
-# CONFIG_BEECH is not set
-# CONFIG_CEDAR is not set
+# CONFIG_BUBINGA is not set
 # CONFIG_CPCI405 is not set
 CONFIG_EP405=y
 # CONFIG_OAK is not set
-# CONFIG_REDWOOD_4 is not set
 # CONFIG_REDWOOD_5 is not set
 # CONFIG_REDWOOD_6 is not set
 # CONFIG_SYCAMORE is not set
-# CONFIG_TIVO is not set
 # CONFIG_WALNUT is not set
 # CONFIG_EP405PC is not set
 CONFIG_IBM405_ERR77=y
@@ -77,7 +80,6 @@ CONFIG_IBM_OCP=y
 CONFIG_BIOS_FIXUP=y
 CONFIG_405GP=y
 CONFIG_EMBEDDEDBOOT=y
-# CONFIG_405_DMA is not set
 # CONFIG_PM is not set
 CONFIG_UART0_TTYS0=y
 # CONFIG_UART0_TTYS1 is not set
@@ -93,7 +95,8 @@ CONFIG_NOT_COHERENT_CACHE=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
 # Bus options
@@ -102,12 +105,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 # CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 
 #
 # Advanced setup
@@ -123,6 +120,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00400000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -132,14 +133,19 @@ CONFIG_BOOT_LOAD=0x00400000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
+# CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -147,16 +153,12 @@ CONFIG_BOOT_LOAD=0x00400000
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_LBD is not set
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -167,12 +169,17 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_SCSI is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -181,6 +188,10 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -197,30 +208,28 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
+# CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -241,16 +250,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -279,7 +293,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -287,59 +300,39 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-# CONFIG_FB is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -378,16 +371,10 @@ CONFIG_SERIO_SERPORT=y
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Character devices
 #
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
+# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -403,53 +390,9 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 #
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_UNIX98_PTYS is not set
-
-#
-# I2C support
-#
-CONFIG_I2C=y
-# CONFIG_I2C_CHARDEV is not set
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-CONFIG_I2C_IBM_IIC=y
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_PIIX4 is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_VIAPRO is not set
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_W83781D is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -476,6 +419,15 @@ CONFIG_GEN_RTC=y
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -486,6 +438,26 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_DVB is not set
 
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
 #
 # File systems
 #
@@ -519,7 +491,9 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
@@ -530,6 +504,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -546,17 +521,17 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -566,31 +541,26 @@ CONFIG_SUNRPC=y
 CONFIG_MSDOS_PARTITION=y
 
 #
-# Sound
+# Native Language Support
 #
-# CONFIG_SOUND is not set
+# CONFIG_NLS is not set
 
 #
 # IBM 40x options
 #
 
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
-CONFIG_OCP=y
+CONFIG_PPC_OCP=y
 
 #
 # Security options
diff --git a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig
index d258e7b55..1661b995a 100644
--- a/arch/ppc/configs/ibmchrp_defconfig
+++ b/arch/ppc/configs/ibmchrp_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -20,9 +21,12 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
@@ -32,6 +36,8 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -108,12 +114,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 
 #
 # Advanced setup
@@ -129,6 +129,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -138,6 +142,11 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
@@ -155,16 +164,12 @@ CONFIG_BLK_DEV_FD=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_LBD=y
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -194,6 +199,12 @@ CONFIG_CHR_DEV_SG=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -209,6 +220,7 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -227,14 +239,23 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_NSP32 is not set
@@ -242,13 +263,23 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_MESH is not set
 # CONFIG_SCSI_MAC53C94 is not set
 
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -257,6 +288,15 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+# CONFIG_ADB is not set
+# CONFIG_ADB_CUDA is not set
+# CONFIG_ADB_PMU is not set
+# CONFIG_MAC_FLOPPY is not set
+# CONFIG_MAC_SERIAL is not set
+
 #
 # Networking support
 #
@@ -278,7 +318,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -289,8 +328,6 @@ CONFIG_SYN_COOKIES=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -345,14 +382,17 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 # CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -373,16 +413,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -414,6 +459,7 @@ CONFIG_PCNET32=y
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
@@ -440,7 +486,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -448,104 +493,40 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
 
 #
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
-
-#
-# Graphics support
-#
-CONFIG_FB=y
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-# CONFIG_FB_CONTROL is not set
-# CONFIG_FB_PLATINUM is not set
-# CONFIG_FB_VALKYRIE is not set
-# CONFIG_FB_CT65550 is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-# CONFIG_FB_MATROX_G450 is not set
-CONFIG_FB_MATROX_G100A=y
-CONFIG_FB_MATROX_G100=y
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-# CONFIG_FB_RADEON is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-CONFIG_FB_3DFX=y
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-CONFIG_VGA_CONSOLE=y
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Telephony Support
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -581,30 +562,21 @@ CONFIG_SERIO_SERPORT=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_INPORT is not set
 # CONFIG_MOUSE_LOGIBM is not set
 # CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 CONFIG_INPUT_MISC=y
-CONFIG_INPUT_PCSPKR=y
 CONFIG_INPUT_UINPUT=y
 
-#
-# Macintosh device drivers
-#
-# CONFIG_ADB_CUDA is not set
-# CONFIG_ADB_PMU is not set
-# CONFIG_MAC_FLOPPY is not set
-# CONFIG_MAC_SERIAL is not set
-# CONFIG_ADB is not set
-
 #
 # Character devices
 #
@@ -627,30 +599,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_CORE=y
 # CONFIG_SERIAL_PMACZILOG is not set
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Algorithms
-#
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
-# Mice
-#
-CONFIG_BUSMOUSE=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -677,6 +627,15 @@ CONFIG_GEN_RTC=y
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -687,6 +646,75 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_DVB is not set
 
+#
+# Graphics support
+#
+CONFIG_FB=y
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+# CONFIG_FB_CONTROL is not set
+# CONFIG_FB_PLATINUM is not set
+# CONFIG_FB_VALKYRIE is not set
+# CONFIG_FB_CT65550 is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+# CONFIG_FB_MATROX_G450 is not set
+CONFIG_FB_MATROX_G100A=y
+CONFIG_FB_MATROX_G100=y
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+# CONFIG_FB_RADEON_OLD is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
 #
 # File systems
 #
@@ -724,10 +752,10 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 CONFIG_DEVFS_FS=y
 # CONFIG_DEVFS_MOUNT is not set
 # CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
@@ -739,6 +767,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -759,7 +788,6 @@ CONFIG_RAMFS=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -782,11 +810,11 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -826,21 +854,11 @@ CONFIG_NLS_ISO8859_1=m
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # Kernel hacking
diff --git a/arch/ppc/configs/lopec_defconfig b/arch/ppc/configs/lopec_defconfig
index 43a6f11f4..09f1baee9 100644
--- a/arch/ppc/configs/lopec_defconfig
+++ b/arch/ppc/configs/lopec_defconfig
@@ -4,23 +4,39 @@
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_EMBEDDED is not set
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -33,24 +49,25 @@ CONFIG_OBSOLETE_MODPARM=y
 CONFIG_KMOD=y
 
 #
-# Platform support
+# Processor
 #
-CONFIG_PPC=y
-CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_40x is not set
+# CONFIG_44x is not set
 # CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
+CONFIG_ALTIVEC=y
+# CONFIG_TAU is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_PPC_STD_MMU=y
 
 #
-# IBM 4xx options
+# Platform options
 #
-# CONFIG_8260 is not set
-CONFIG_GENERIC_ISA_DMA=y
-CONFIG_PPC_STD_MMU=y
 # CONFIG_PPC_MULTIPLATFORM is not set
 # CONFIG_APUS is not set
-# CONFIG_WILLOW_2 is not set
+# CONFIG_WILLOW is not set
 # CONFIG_PCORE is not set
 # CONFIG_POWERPMC250 is not set
 # CONFIG_EV64260 is not set
@@ -66,41 +83,37 @@ CONFIG_LOPEC=y
 # CONFIG_K2 is not set
 # CONFIG_PAL4 is not set
 # CONFIG_GEMINI is not set
+# CONFIG_EST8260 is not set
+# CONFIG_SBS8260 is not set
+# CONFIG_RPX6 is not set
+# CONFIG_TQM8260 is not set
 CONFIG_EPIC_SERIAL_MODE=y
+CONFIG_MPC10X_BRIDGE=y
+# CONFIG_MPC10X_STORE_GATHERING is not set
+CONFIG_PPCBUG_NVRAM=y
 # CONFIG_SMP is not set
 # CONFIG_PREEMPT is not set
-CONFIG_ALTIVEC=y
-# CONFIG_TAU is not set
-# CONFIG_CPU_FREQ is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_KERNEL_ELF=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
-# General setup
+# Bus options
 #
-# CONFIG_HIGHMEM is not set
+CONFIG_GENERIC_ISA_DMA=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
-CONFIG_KCORE_ELF=y
-CONFIG_BINFMT_ELF=y
-CONFIG_KERNEL_ELF=y
-CONFIG_BINFMT_MISC=m
 # CONFIG_PCI_LEGACY_PROC is not set
 CONFIG_PCI_NAMES=y
-CONFIG_HOTPLUG=y
 
 #
 # PCMCIA/CardBus support
 #
 # CONFIG_PCMCIA is not set
 
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-CONFIG_PPC601_SYNC_FIX=y
-# CONFIG_PPCBUG_NVRAM is not set
-CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="ip=on"
-
 #
 # Advanced setup
 #
@@ -115,15 +128,28 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_FW_LOADER is not set
+
 #
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
@@ -134,47 +160,77 @@ CONFIG_BOOT_LOAD=0x00800000
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_SIZE=4096
-# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_LBD is not set
 
 #
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# ATA/IDE/MFM/RLL support
+# ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
 CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
-# CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
 # CONFIG_IDEDISK_STROKE is not set
-# CONFIG_BLK_DEV_IDECD is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
 
 #
 # IDE chipset support/bugfixes
 #
-# CONFIG_BLK_DEV_IDEPCI is not set
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_SL82C105=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_ADMA=y
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
 
 #
-# SCSI support
+# SCSI device support
 #
 CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
 
 #
 # SCSI support type (disk, tape, CD-ROM)
@@ -193,6 +249,12 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -202,11 +264,9 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
-# CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_AM53C974 is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -214,34 +274,41 @@ CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
-# CONFIG_SCSI_GENERIC_NCR5380 is not set
-# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
-# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_NCR53C7xx is not set
 CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
-# CONFIG_SCSI_PCI2000 is not set
-# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -250,6 +317,10 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -261,38 +332,37 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 # CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_XFRM_USER is not set
+# CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
 # CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -310,17 +380,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-CONFIG_DUMMY=m
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -342,9 +416,11 @@ CONFIG_NET_PCI=y
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=y
+# CONFIG_E100_NAPI is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
@@ -373,102 +449,49 @@ CONFIG_E100=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_TR is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-CONFIG_FB=y
-# CONFIG_FB_CIRRUS is not set
-# CONFIG_FB_PM2 is not set
-# CONFIG_FB_CYBER2000 is not set
-# CONFIG_FB_CT65550 is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-# CONFIG_FB_MATROX_MYSTIQUE is not set
-# CONFIG_FB_MATROX_G450 is not set
-CONFIG_FB_MATROX_G100A=y
-CONFIG_FB_MATROX_G100=y
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-# CONFIG_FB_RADEON is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-# CONFIG_FB_3DFX is not set
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_PM3 is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Logo configuration
-#
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
 #
-CONFIG_INPUT=m
+# CONFIG_INPUT is not set
 
 #
 # Userland interfaces
 #
-CONFIG_INPUT_MOUSEDEV=m
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-CONFIG_INPUT_EVDEV=m
-# CONFIG_INPUT_EVBUG is not set
 
 #
 # Input I/O drivers
@@ -476,23 +499,16 @@ CONFIG_INPUT_EVDEV=m
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
 # CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
 
 #
 # Input Device Drivers
 #
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_INPUT_MOUSE=y
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Macintosh device drivers
-#
 
 #
 # Character devices
 #
+# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -500,6 +516,7 @@ CONFIG_INPUT_MOUSE=y
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=1
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -508,26 +525,8 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Hardware Sensors Mainboard support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -553,122 +552,30 @@ CONFIG_GEN_RTC=y
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-# CONFIG_HANGCHECK_TIMER is not set
 
 #
-# Multimedia devices
-#
-CONFIG_VIDEO_DEV=m
-
-#
-# Video For Linux
+# I2C support
 #
-CONFIG_VIDEO_PROC_FS=y
+# CONFIG_I2C is not set
 
 #
-# Video Adapters
+# Misc devices
 #
-# CONFIG_VIDEO_PMS is not set
-# CONFIG_VIDEO_CPIA is not set
-# CONFIG_VIDEO_STRADIS is not set
 
 #
-# Radio Adapters
+# Multimedia devices
 #
-# CONFIG_RADIO_GEMTEK_PCI is not set
-# CONFIG_RADIO_MAXIRADIO is not set
-# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_VIDEO_DEV is not set
 
 #
 # Digital Video Broadcasting Devices
 #
 # CONFIG_DVB is not set
-# CONFIG_VIDEO_BTCX is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-# CONFIG_FAT_FS is not set
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-CONFIG_RAMFS=y
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
 
 #
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V4 is not set
-# CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-# CONFIG_EXPORTFS is not set
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
+# Graphics support
 #
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
+# CONFIG_FB is not set
 
 #
 # Sound
@@ -707,26 +614,20 @@ CONFIG_USB_ACM=m
 # USB Human Interface Devices (HID)
 #
 CONFIG_USB_HID=m
-CONFIG_USB_HIDINPUT=y
-# CONFIG_HID_FF is not set
+
+#
+# Input core support is needed for USB HID input layer or HIDBP support
+#
 # CONFIG_USB_HIDDEV is not set
 
 #
 # USB HID Boot Protocol drivers
 #
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_XPAD is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-CONFIG_USB_SCANNER=m
 # CONFIG_USB_MICROTEK is not set
 # CONFIG_USB_HPUSBSCSI is not set
 
@@ -734,14 +635,10 @@ CONFIG_USB_SCANNER=m
 # USB Multimedia devices
 #
 # CONFIG_USB_DABUSB is not set
-# CONFIG_USB_VICAM is not set
-# CONFIG_USB_DSBR is not set
-# CONFIG_USB_IBMCAM is not set
-# CONFIG_USB_KONICAWC is not set
-# CONFIG_USB_OV511 is not set
-# CONFIG_USB_PWC is not set
-CONFIG_USB_SE401=m
-# CONFIG_USB_STV680 is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
 
 #
 # USB Network adaptors
@@ -785,28 +682,126 @@ CONFIG_USB_SERIAL_VISOR=m
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
 #
-# Bluetooth support
+# File systems
 #
-# CONFIG_BT is not set
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
 
 #
 # Library routines
 #
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
-# CONFIG_KALLSYMS is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
 
 #
diff --git a/arch/ppc/configs/ocotea_defconfig b/arch/ppc/configs/ocotea_defconfig
index 03431665d..292d04b0b 100644
--- a/arch/ppc/configs/ocotea_defconfig
+++ b/arch/ppc/configs/ocotea_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -23,14 +24,16 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
-# CONFIG_EMBEDDED is not set
+CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -63,9 +66,9 @@ CONFIG_4xx=y
 CONFIG_OCOTEA=y
 CONFIG_440GX=y
 CONFIG_440A=y
-CONFIG_PIN_TLB=y
 CONFIG_BOOKE=y
 CONFIG_IBM_OCP=y
+CONFIG_PPC_OCP=y
 CONFIG_IBM_EMAC4=y
 # CONFIG_PM is not set
 CONFIG_NOT_COHERENT_CACHE=y
@@ -90,12 +93,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 # CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 
 #
 # Advanced setup
@@ -111,38 +108,43 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x01000000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
+# CONFIG_DEBUG_DRIVER is not set
 
 #
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
+# CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 # CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_LBD is not set
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -153,12 +155,18 @@ CONFIG_BOOT_LOAD=0x01000000
 #
 # CONFIG_SCSI is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
+# CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -167,6 +175,10 @@ CONFIG_BOOT_LOAD=0x01000000
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -190,7 +202,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -219,7 +230,6 @@ CONFIG_NETFILTER=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
@@ -289,6 +299,12 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=128
+CONFIG_IBM_EMAC_TXB=128
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
@@ -305,6 +321,7 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_TR is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -325,23 +342,18 @@ CONFIG_NET_ETHERNET=y
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
-
-#
-# Graphics support
-#
-# CONFIG_FB is not set
+# CONFIG_ISDN is not set
 
 #
-# Console display driver support
+# Telephony Support
 #
-CONFIG_VGA_CONSOLE=y
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -380,16 +392,10 @@ CONFIG_SERIO=y
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Character devices
 #
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
+# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -411,30 +417,8 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Algorithms
-#
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -460,6 +444,15 @@ CONFIG_UNIX98_PTY_COUNT=256
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -470,6 +463,26 @@ CONFIG_UNIX98_PTY_COUNT=256
 #
 # CONFIG_DVB is not set
 
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
 #
 # File systems
 #
@@ -503,7 +516,6 @@ CONFIG_UNIX98_PTY_COUNT=256
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
@@ -515,6 +527,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -531,12 +544,13 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -551,15 +565,9 @@ CONFIG_SUNRPC=y
 CONFIG_MSDOS_PARTITION=y
 
 #
-# Sound
+# Native Language Support
 #
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
+# CONFIG_NLS is not set
 
 #
 # Library routines
diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig
index 1a7474c91..05842e761 100644
--- a/arch/ppc/configs/pmac_defconfig
+++ b/arch/ppc/configs/pmac_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -20,9 +21,12 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
@@ -32,6 +36,8 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -119,22 +125,17 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-CONFIG_HOTPLUG=y
 
 #
 # PCMCIA/CardBus support
 #
 CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
 CONFIG_YENTA=m
 CONFIG_CARDBUS=y
 CONFIG_I82092=m
 CONFIG_TCIC=m
 
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
 #
 # Advanced setup
 #
@@ -148,6 +149,10 @@ CONFIG_TASK_SIZE_BOOL=y
 CONFIG_TASK_SIZE=0xc0000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -158,14 +163,19 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
+# CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -173,16 +183,12 @@ CONFIG_BOOT_LOAD=0x00800000
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_LBD=y
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -206,6 +212,7 @@ CONFIG_BLK_DEV_IDESCSI=y
 #
 # IDE chipset support/bugfixes
 #
+# CONFIG_IDE_GENERIC is not set
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -213,7 +220,6 @@ CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_SL82C105=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
@@ -273,6 +279,12 @@ CONFIG_CHR_DEV_SG=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -282,7 +294,6 @@ CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_AIC7XXX=m
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
 CONFIG_AIC7XXX_RESET_DELAY_MS=15000
-# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
 CONFIG_AIC7XXX_DEBUG_ENABLE=y
 CONFIG_AIC7XXX_DEBUG_MASK=0
@@ -291,6 +302,7 @@ CONFIG_SCSI_AIC7XXX_OLD=m
 # CONFIG_SCSI_AIC79XX is not set
 CONFIG_SCSI_ADVANSYS=m
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -305,10 +317,19 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 CONFIG_SCSI_MESH=y
@@ -323,6 +344,12 @@ CONFIG_SCSI_MAC53C94=y
 # CONFIG_PCMCIA_FDOMAIN is not set
 # CONFIG_PCMCIA_NINJA_SCSI is not set
 # CONFIG_PCMCIA_QLOGIC is not set
+# CONFIG_PCMCIA_SYM53C500 is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
 
 #
 # Fusion MPT device support
@@ -330,7 +357,7 @@ CONFIG_SCSI_MAC53C94=y
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 CONFIG_IEEE1394=m
 
@@ -339,14 +366,13 @@ CONFIG_IEEE1394=m
 #
 # CONFIG_IEEE1394_VERBOSEDEBUG is not set
 # CONFIG_IEEE1394_OUI_DB is not set
+CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
+CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
 
 #
 # Device Drivers
 #
-
-#
-# Texas Instruments PCILynx requires I2C bit-banging
-#
+# CONFIG_IEEE1394_PCILYNX is not set
 CONFIG_IEEE1394_OHCI1394=m
 
 #
@@ -365,6 +391,24 @@ CONFIG_IEEE1394_RAWIO=m
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+CONFIG_ADB=y
+CONFIG_ADB_CUDA=y
+CONFIG_ADB_PMU=y
+CONFIG_PMAC_PBOOK=y
+CONFIG_PMAC_APM_EMU=y
+CONFIG_PMAC_BACKLIGHT=y
+# CONFIG_MAC_FLOPPY is not set
+CONFIG_MAC_SERIAL=y
+CONFIG_ADB_MACIO=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_THERM_WINDTUNNEL=m
+CONFIG_THERM_ADT746X=m
+# CONFIG_ANSLCD is not set
+
 #
 # Networking support
 #
@@ -386,7 +430,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -397,8 +440,6 @@ CONFIG_SYN_COOKIES=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -453,14 +494,17 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 # CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -481,17 +525,68 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-CONFIG_NETDEVICES=y
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_IRDA=m
 
 #
-# ARCnet devices
+# IrDA protocols
 #
-# CONFIG_ARCNET is not set
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+# CONFIG_DONGLE is not set
+
+#
+# Old SIR device drivers
+#
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+# CONFIG_USB_IRDA is not set
+# CONFIG_SIGMATEL_FIR is not set
+# CONFIG_TOSHIBA_FIR is not set
+# CONFIG_VLSI_FIR is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -515,6 +610,7 @@ CONFIG_PCNET32=y
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
@@ -539,7 +635,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -547,17 +642,12 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=y
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=y
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=y
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -585,28 +675,20 @@ CONFIG_APPLE_AIRPORT=m
 # CONFIG_PLX_HERMES is not set
 # CONFIG_TMD_HERMES is not set
 # CONFIG_PCI_HERMES is not set
+# CONFIG_ATMEL is not set
 
 #
 # Wireless 802.11b Pcmcia/Cardbus cards support
 #
 CONFIG_PCMCIA_HERMES=m
 # CONFIG_AIRO_CS is not set
-# CONFIG_PCMCIA_ATMEL is not set
 # CONFIG_PCMCIA_WL3501 is not set
-CONFIG_NET_WIRELESS=y
-
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
 
 #
-# Wan interfaces
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
 #
-# CONFIG_WAN is not set
+# CONFIG_PRISM54 is not set
+CONFIG_NET_WIRELESS=y
 
 #
 # PCMCIA network device support
@@ -622,123 +704,34 @@ CONFIG_NET_PCMCIA=y
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-CONFIG_IRDA=m
-
-#
-# IrDA protocols
-#
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-# CONFIG_IRDA_ULTRA is not set
-
-#
-# IrDA options
-#
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-# CONFIG_IRDA_DEBUG is not set
-
-#
-# Infrared-port device drivers
-#
-
-#
-# SIR device drivers
-#
-CONFIG_IRTTY_SIR=m
-
-#
-# Dongle support
-#
-# CONFIG_DONGLE is not set
-
-#
-# Old SIR device drivers
-#
-# CONFIG_IRPORT_SIR is not set
-
-#
-# Old Serial dongle support
-#
-
-#
-# FIR device drivers
-#
-# CONFIG_USB_IRDA is not set
-# CONFIG_TOSHIBA_FIR is not set
-# CONFIG_VLSI_FIR is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
-
-#
-# Graphics support
-#
-CONFIG_FB=y
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-CONFIG_FB_CONTROL=y
-CONFIG_FB_PLATINUM=y
-CONFIG_FB_VALKYRIE=y
-CONFIG_FB_CT65550=y
-CONFIG_FB_IMSTT=y
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-# CONFIG_FB_MATROX_G450 is not set
-CONFIG_FB_MATROX_G100A=y
-CONFIG_FB_MATROX_G100=y
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-CONFIG_FB_RADEON=y
-CONFIG_FB_ATY128=y
-CONFIG_FB_ATY=y
-CONFIG_FB_ATY_CT=y
-CONFIG_FB_ATY_GX=y
-# CONFIG_FB_ATY_XL_INIT is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-CONFIG_FB_3DFX=y
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
+# CONFIG_ISDN is not set
 
 #
-# Logo configuration
+# Telephony Support
 #
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -774,31 +767,17 @@ CONFIG_SERIO=y
 CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-CONFIG_ADB_CUDA=y
-CONFIG_ADB_PMU=y
-CONFIG_PMAC_PBOOK=y
-CONFIG_PMAC_APM_EMU=y
-CONFIG_PMAC_BACKLIGHT=y
-# CONFIG_MAC_FLOPPY is not set
-CONFIG_MAC_SERIAL=y
-CONFIG_ADB=y
-CONFIG_ADB_MACIO=y
-CONFIG_INPUT_ADBHID=y
-CONFIG_MAC_EMUMOUSEBTN=y
-# CONFIG_ANSLCD is not set
-
 #
 # Character devices
 #
@@ -822,83 +801,112 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_PMACZILOG=y
 # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
 #
-CONFIG_I2C=m
+CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=m
 
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 
 #
 # I2C Hardware Bus support
 #
 # CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_HYDRA is not set
 # CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_ISA is not set
 CONFIG_I2C_KEYWEST=m
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
 # CONFIG_I2C_SIS5595 is not set
 # CONFIG_I2C_SIS630 is not set
 # CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
 # CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
 # CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# Mice
+# Other I2C Chip support
 #
-CONFIG_BUSMOUSE=y
-# CONFIG_QIC02_TAPE is not set
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-CONFIG_NVRAM=y
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
-
-#
-# Ftape, the floppy tape device driver
-#
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# PCMCIA character devices
+# Misc devices
 #
-# CONFIG_SYNCLINK_CS is not set
-# CONFIG_RAW_DRIVER is not set
 
 #
 # Multimedia devices
@@ -911,157 +919,64 @@ CONFIG_GEN_RTC=y
 # CONFIG_DVB is not set
 
 #
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_DEVFS_FS=y
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-CONFIG_HFS_FS=m
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
+# Graphics support
 #
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_NFS_V4 is not set
-CONFIG_NFSD=y
-# CONFIG_NFSD_V3 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_LOCKD=y
-CONFIG_EXPORTFS=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
-CONFIG_SMB_FS=m
-# CONFIG_SMB_NLS_DEFAULT is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
+CONFIG_FB=y
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_CT65550=y
+CONFIG_FB_IMSTT=y
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+# CONFIG_FB_MATROX_G450 is not set
+CONFIG_FB_MATROX_G100A=y
+CONFIG_FB_MATROX_G100=y
+# CONFIG_FB_MATROX_I2C is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+# CONFIG_FB_RADEON_OLD is not set
+CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=y
+CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
 
 #
-# Partition Types
+# Console display driver support
 #
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-CONFIG_MAC_PARTITION=y
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-CONFIG_SMB_NLS=y
-CONFIG_NLS=y
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
 
 #
-# Native Language Support
+# Logo configuration
 #
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ISO8859_1=m
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
 
 #
 # Sound
@@ -1074,6 +989,9 @@ CONFIG_DMASOUND=m
 # Advanced Linux Sound Architecture
 #
 CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_RAWMIDI=m
 CONFIG_SND_SEQUENCER=m
 CONFIG_SND_SEQ_DUMMY=m
 CONFIG_SND_OSSEMUL=y
@@ -1096,11 +1014,17 @@ CONFIG_SND_DUMMY=m
 # PCI devices
 #
 # CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
 # CONFIG_SND_CS46XX is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MIXART is not set
 # CONFIG_SND_NM256 is not set
 # CONFIG_SND_RME32 is not set
 # CONFIG_SND_RME96 is not set
@@ -1119,6 +1043,7 @@ CONFIG_SND_DUMMY=m
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
 # CONFIG_SND_SONICVIBES is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VX222 is not set
@@ -1136,8 +1061,6 @@ CONFIG_SND_USB_AUDIO=m
 #
 # PCMCIA devices
 #
-# CONFIG_SND_VXPOCKET is not set
-# CONFIG_SND_VXP440 is not set
 
 #
 # Open Sound System
@@ -1185,13 +1108,14 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_WACOM is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
 # CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-CONFIG_USB_SCANNER=m
 # CONFIG_USB_MICROTEK is not set
 # CONFIG_USB_HPUSBSCSI is not set
 
@@ -1246,17 +1170,180 @@ CONFIG_USB_SERIAL_VISOR=m
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_DEVFS_FS=y
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_LOCKD=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
 
diff --git a/arch/ppc/configs/power3_defconfig b/arch/ppc/configs/power3_defconfig
index 856b41cc7..bd7beebda 100644
--- a/arch/ppc/configs/power3_defconfig
+++ b/arch/ppc/configs/power3_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -19,9 +20,12 @@ CONFIG_CLEAN_COMPILE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
@@ -31,6 +35,8 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -41,6 +47,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
 CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
 
 #
 # Processor
@@ -88,6 +95,7 @@ CONFIG_PPCBUG_NVRAM=y
 CONFIG_SMP=y
 # CONFIG_IRQ_ALL_CPUS is not set
 CONFIG_NR_CPUS=32
+# CONFIG_PREEMPT is not set
 CONFIG_HIGHMEM=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
@@ -106,19 +114,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-CONFIG_PARPORT=m
-CONFIG_PARPORT_PC=m
-CONFIG_PARPORT_PC_CML1=m
-# CONFIG_PARPORT_SERIAL is not set
-CONFIG_PARPORT_PC_FIFO=y
-# CONFIG_PARPORT_PC_SUPERIO is not set
-# CONFIG_PARPORT_OTHER is not set
-# CONFIG_PARPORT_1284 is not set
 
 #
 # Advanced setup
@@ -134,6 +129,10 @@ CONFIG_TASK_SIZE_BOOL=y
 CONFIG_TASK_SIZE=0xc0000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -143,6 +142,18 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_PC_CML1=m
+# CONFIG_PARPORT_SERIAL is not set
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_OTHER is not set
+# CONFIG_PARPORT_1284 is not set
+
 #
 # Plug and Play support
 #
@@ -161,23 +172,12 @@ CONFIG_BLK_DEV_FD=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_LBD=y
 
-#
-# Multi-device support (RAID and LVM)
-#
-CONFIG_MD=y
-CONFIG_BLK_DEV_MD=y
-CONFIG_MD_LINEAR=y
-CONFIG_MD_RAID0=y
-CONFIG_MD_RAID1=y
-CONFIG_MD_RAID5=y
-# CONFIG_MD_MULTIPATH is not set
-CONFIG_BLK_DEV_DM=y
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -207,6 +207,12 @@ CONFIG_CHR_DEV_SG=y
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -222,6 +228,7 @@ CONFIG_SCSI_LOGGING=y
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -242,14 +249,23 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_NSP32 is not set
@@ -257,13 +273,32 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_MESH is not set
 # CONFIG_SCSI_MAC53C94 is not set
 
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+CONFIG_MD_RAID5=y
+CONFIG_MD_RAID6=y
+# CONFIG_MD_MULTIPATH is not set
+CONFIG_BLK_DEV_DM=y
+CONFIG_DM_CRYPT=y
+
 #
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -272,6 +307,15 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+# CONFIG_ADB is not set
+# CONFIG_ADB_CUDA is not set
+# CONFIG_ADB_PMU is not set
+# CONFIG_MAC_FLOPPY is not set
+# CONFIG_MAC_SERIAL is not set
+
 #
 # Networking support
 #
@@ -293,23 +337,21 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -330,16 +372,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -371,10 +418,12 @@ CONFIG_PCNET32=y
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=y
+# CONFIG_E100_NAPI is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
@@ -398,7 +447,6 @@ CONFIG_E1000=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -406,107 +454,41 @@ CONFIG_E1000=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
 
 #
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-CONFIG_FB=y
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-# CONFIG_FB_CONTROL is not set
-# CONFIG_FB_PLATINUM is not set
-# CONFIG_FB_VALKYRIE is not set
-# CONFIG_FB_CT65550 is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-# CONFIG_FB_MATROX_G450 is not set
-CONFIG_FB_MATROX_G100A=y
-CONFIG_FB_MATROX_G100=y
-CONFIG_FB_MATROX_I2C=y
-# CONFIG_FB_MATROX_MAVEN is not set
-CONFIG_FB_MATROX_MULTIHEAD=y
-# CONFIG_FB_RADEON is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-# CONFIG_FB_3DFX is not set
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
-
-#
-# Old CD-ROM drivers (not SCSI, not IDE)
-#
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -549,30 +531,21 @@ CONFIG_SERIO_SERPORT=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_INPORT is not set
 # CONFIG_MOUSE_LOGIBM is not set
 # CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 CONFIG_INPUT_MISC=y
-CONFIG_INPUT_PCSPKR=y
 CONFIG_INPUT_UINPUT=y
 
-#
-# Macintosh device drivers
-#
-# CONFIG_ADB_CUDA is not set
-# CONFIG_ADB_PMU is not set
-# CONFIG_MAC_FLOPPY is not set
-# CONFIG_MAC_SERIAL is not set
-# CONFIG_ADB is not set
-
 #
 # Character devices
 #
@@ -596,11 +569,36 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_PMACZILOG is not set
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=2048
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_PRINTER=m
 # CONFIG_LP_CONSOLE is not set
 # CONFIG_PPDEV is not set
 # CONFIG_TIPAR is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
@@ -618,14 +616,18 @@ CONFIG_I2C_ALGOPCF=y
 # I2C Hardware Bus support
 #
 # CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_HYDRA is not set
 # CONFIG_I2C_I801 is not set
 # CONFIG_I2C_I810 is not set
 # CONFIG_I2C_ISA is not set
 # CONFIG_I2C_KEYWEST is not set
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PIIX4 is not set
 # CONFIG_I2C_PROSAVAGE is not set
 # CONFIG_I2C_SAVAGE4 is not set
@@ -638,56 +640,226 @@ CONFIG_I2C_ALGOPCF=y
 # CONFIG_I2C_VOODOO3 is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
 # CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
 # CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# Mice
+# Other I2C Chip support
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_QIC02_TAPE is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# IPMI
+# Misc devices
 #
-# CONFIG_IPMI_HANDLER is not set
 
 #
-# Watchdog Cards
+# Multimedia devices
 #
-# CONFIG_WATCHDOG is not set
-CONFIG_NVRAM=y
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
+# CONFIG_VIDEO_DEV is not set
 
 #
-# Ftape, the floppy tape device driver
+# Digital Video Broadcasting Devices
 #
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
+# CONFIG_DVB is not set
 
 #
-# Multimedia devices
+# Graphics support
 #
-# CONFIG_VIDEO_DEV is not set
+CONFIG_FB=y
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+# CONFIG_FB_CONTROL is not set
+# CONFIG_FB_PLATINUM is not set
+# CONFIG_FB_VALKYRIE is not set
+# CONFIG_FB_CT65550 is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+# CONFIG_FB_MATROX_G450 is not set
+CONFIG_FB_MATROX_G100A=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=y
+# CONFIG_FB_MATROX_MAVEN is not set
+CONFIG_FB_MATROX_MULTIHEAD=y
+# CONFIG_FB_RADEON_OLD is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
 
 #
-# Digital Video Broadcasting Devices
+# Console display driver support
 #
-# CONFIG_DVB is not set
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+# CONFIG_DMASOUND_PMAC is not set
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_DUMMY=m
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ISA devices
+#
+# CONFIG_SND_AD1848 is not set
+# CONFIG_SND_CS4231 is not set
+CONFIG_SND_CS4232=m
+# CONFIG_SND_CS4236 is not set
+# CONFIG_SND_ES1688 is not set
+# CONFIG_SND_ES18XX is not set
+# CONFIG_SND_GUSCLASSIC is not set
+# CONFIG_SND_GUSEXTREME is not set
+# CONFIG_SND_GUSMAX is not set
+# CONFIG_SND_INTERWAVE is not set
+# CONFIG_SND_INTERWAVE_STB is not set
+# CONFIG_SND_OPTI92X_AD1848 is not set
+# CONFIG_SND_OPTI92X_CS4231 is not set
+# CONFIG_SND_OPTI93X is not set
+# CONFIG_SND_SB8 is not set
+# CONFIG_SND_SB16 is not set
+# CONFIG_SND_SBAWE is not set
+# CONFIG_SND_WAVEFRONT is not set
+# CONFIG_SND_CMI8330 is not set
+# CONFIG_SND_OPL3SA2 is not set
+# CONFIG_SND_SGALAXY is not set
+# CONFIG_SND_SSCAPE is not set
+
+#
+# PCI devices
+#
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+CONFIG_SND_CS46XX=m
+# CONFIG_SND_CS46XX_NEW_DSP is not set
+CONFIG_SND_CS4281=m
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_YMFPCI is not set
+# CONFIG_SND_ALS4000 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VX222 is not set
+
+#
+# ALSA PowerMac devices
+#
+# CONFIG_SND_POWERMAC is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
 
 #
 # File systems
@@ -726,8 +898,8 @@ CONFIG_VFAT_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
@@ -739,6 +911,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -755,18 +928,18 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 # CONFIG_NFSD_V3 is not set
 # CONFIG_NFSD_TCP is not set
 CONFIG_LOCKD=y
 CONFIG_EXPORTFS=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -774,11 +947,11 @@ CONFIG_SUNRPC=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -818,112 +991,13 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
-#
-# Sound
-#
-CONFIG_SOUND=y
-# CONFIG_DMASOUND_PMAC is not set
-
-#
-# Advanced Linux Sound Architecture
-#
-CONFIG_SND=m
-CONFIG_SND_SEQUENCER=m
-CONFIG_SND_SEQ_DUMMY=m
-CONFIG_SND_OSSEMUL=y
-CONFIG_SND_MIXER_OSS=m
-CONFIG_SND_PCM_OSS=m
-CONFIG_SND_SEQUENCER_OSS=y
-# CONFIG_SND_VERBOSE_PRINTK is not set
-# CONFIG_SND_DEBUG is not set
-
-#
-# Generic devices
-#
-CONFIG_SND_DUMMY=m
-# CONFIG_SND_VIRMIDI is not set
-# CONFIG_SND_MTPAV is not set
-# CONFIG_SND_SERIAL_U16550 is not set
-# CONFIG_SND_MPU401 is not set
-
-#
-# ISA devices
-#
-# CONFIG_SND_AD1848 is not set
-# CONFIG_SND_CS4231 is not set
-CONFIG_SND_CS4232=m
-# CONFIG_SND_CS4236 is not set
-# CONFIG_SND_ES1688 is not set
-# CONFIG_SND_ES18XX is not set
-# CONFIG_SND_GUSCLASSIC is not set
-# CONFIG_SND_GUSEXTREME is not set
-# CONFIG_SND_GUSMAX is not set
-# CONFIG_SND_INTERWAVE is not set
-# CONFIG_SND_INTERWAVE_STB is not set
-# CONFIG_SND_OPTI92X_AD1848 is not set
-# CONFIG_SND_OPTI92X_CS4231 is not set
-# CONFIG_SND_OPTI93X is not set
-# CONFIG_SND_SB8 is not set
-# CONFIG_SND_SB16 is not set
-# CONFIG_SND_SBAWE is not set
-# CONFIG_SND_WAVEFRONT is not set
-# CONFIG_SND_CMI8330 is not set
-# CONFIG_SND_OPL3SA2 is not set
-# CONFIG_SND_SGALAXY is not set
-# CONFIG_SND_SSCAPE is not set
-
-#
-# PCI devices
-#
-# CONFIG_SND_ALI5451 is not set
-# CONFIG_SND_AZT3328 is not set
-CONFIG_SND_CS46XX=m
-# CONFIG_SND_CS46XX_NEW_DSP is not set
-CONFIG_SND_CS4281=m
-# CONFIG_SND_EMU10K1 is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_TRIDENT is not set
-# CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_ALS4000 is not set
-# CONFIG_SND_CMIPCI is not set
-# CONFIG_SND_ENS1370 is not set
-# CONFIG_SND_ENS1371 is not set
-# CONFIG_SND_ES1938 is not set
-# CONFIG_SND_ES1968 is not set
-# CONFIG_SND_MAESTRO3 is not set
-# CONFIG_SND_FM801 is not set
-# CONFIG_SND_ICE1712 is not set
-# CONFIG_SND_ICE1724 is not set
-# CONFIG_SND_INTEL8X0 is not set
-# CONFIG_SND_SONICVIBES is not set
-# CONFIG_SND_VIA82XX is not set
-# CONFIG_SND_VX222 is not set
-
-#
-# ALSA PowerMac devices
-#
-# CONFIG_SND_POWERMAC is not set
-
-#
-# Open Sound System
-#
-# CONFIG_SOUND_PRIME is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
 
 #
 # Kernel hacking
@@ -939,4 +1013,23 @@ CONFIG_BOOTX_TEXT=y
 #
 # Cryptographic options
 #
-# CONFIG_CRYPTO is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_SERPENT is not set
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
diff --git a/arch/ppc/configs/redwood5_defconfig b/arch/ppc/configs/redwood5_defconfig
index 5e19714ac..4af5a3ccf 100644
--- a/arch/ppc/configs/redwood5_defconfig
+++ b/arch/ppc/configs/redwood5_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -23,6 +24,7 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 # CONFIG_KALLSYMS is not set
@@ -31,6 +33,7 @@ CONFIG_FUTEX=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -59,23 +62,19 @@ CONFIG_4xx=y
 # IBM 4xx options
 #
 # CONFIG_ASH is not set
-# CONFIG_BEECH is not set
-# CONFIG_CEDAR is not set
 # CONFIG_CPCI405 is not set
 # CONFIG_EP405 is not set
 # CONFIG_OAK is not set
-# CONFIG_REDWOOD_4 is not set
 CONFIG_REDWOOD_5=y
 # CONFIG_REDWOOD_6 is not set
 # CONFIG_SYCAMORE is not set
-# CONFIG_TIVO is not set
 # CONFIG_WALNUT is not set
 CONFIG_IBM405_ERR77=y
 CONFIG_IBM405_ERR51=y
 CONFIG_IBM_OCP=y
+CONFIG_PPC_OCP=y
 CONFIG_STB03xxx=y
 CONFIG_IBM_OPENBIOS=y
-# CONFIG_405_DMA is not set
 # CONFIG_PM is not set
 CONFIG_UART0_TTYS0=y
 # CONFIG_UART0_TTYS1 is not set
@@ -92,19 +91,14 @@ CONFIG_NOT_COHERENT_CACHE=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
 # Bus options
 #
 # CONFIG_PCI is not set
 # CONFIG_PCI_DOMAINS is not set
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 
 #
 # Advanced setup
@@ -120,6 +114,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00400000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -129,14 +127,19 @@ CONFIG_BOOT_LOAD=0x00400000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
+# CONFIG_BLK_DEV_FD is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
@@ -145,11 +148,6 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_LBD is not set
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -171,6 +169,7 @@ CONFIG_BLK_DEV_IDEDISK=y
 #
 # IDE chipset support/bugfixes
 #
+CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -180,14 +179,28 @@ CONFIG_BLK_DEV_IDEDISK=y
 #
 # CONFIG_SCSI is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
 #
 # I2O device support
 #
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -211,7 +224,6 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -224,7 +236,6 @@ CONFIG_SYN_COOKIES=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
@@ -268,6 +279,7 @@ CONFIG_MII=y
 #
 # Ethernet (10000 Mbit)
 #
+# CONFIG_IBM_EMAC is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -280,6 +292,7 @@ CONFIG_MII=y
 # Token Ring devices
 #
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -300,16 +313,18 @@ CONFIG_MII=y
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-# CONFIG_FB is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -344,10 +359,6 @@ CONFIG_SERIO=y
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Character devices
 #
@@ -368,43 +379,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_UNIX98_PTYS is not set
-
-#
-# I2C support
-#
-CONFIG_I2C=y
-# CONFIG_I2C_CHARDEV is not set
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-CONFIG_I2C_IBM_IIC=y
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_W83781D is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -431,6 +407,15 @@ CONFIG_GEN_RTC=y
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -441,6 +426,25 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_DVB is not set
 
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
 #
 # File systems
 #
@@ -485,6 +489,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -501,12 +506,13 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -521,19 +527,14 @@ CONFIG_SUNRPC=y
 CONFIG_MSDOS_PARTITION=y
 
 #
-# Sound
+# Native Language Support
 #
-# CONFIG_SOUND is not set
+# CONFIG_NLS is not set
 
 #
 # IBM 40x options
 #
 
-#
-# USB support
-#
-# CONFIG_USB_GADGET is not set
-
 #
 # Library routines
 #
diff --git a/arch/ppc/configs/redwood6_defconfig b/arch/ppc/configs/redwood6_defconfig
index bc121d923..cc3f76c6b 100644
--- a/arch/ppc/configs/redwood6_defconfig
+++ b/arch/ppc/configs/redwood6_defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -23,6 +24,7 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 # CONFIG_KALLSYMS is not set
@@ -31,6 +33,7 @@ CONFIG_FUTEX=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -58,23 +61,19 @@ CONFIG_4xx=y
 # IBM 4xx options
 #
 # CONFIG_ASH is not set
-# CONFIG_BEECH is not set
-# CONFIG_CEDAR is not set
 # CONFIG_CPCI405 is not set
 # CONFIG_EP405 is not set
 # CONFIG_OAK is not set
-# CONFIG_REDWOOD_4 is not set
 # CONFIG_REDWOOD_5 is not set
 CONFIG_REDWOOD_6=y
 # CONFIG_SYCAMORE is not set
-# CONFIG_TIVO is not set
 # CONFIG_WALNUT is not set
 CONFIG_IBM405_ERR77=y
 CONFIG_IBM405_ERR51=y
 CONFIG_IBM_OCP=y
+CONFIG_PPC_OCP=y
 CONFIG_STB03xxx=y
 CONFIG_IBM_OPENBIOS=y
-# CONFIG_405_DMA is not set
 # CONFIG_PM is not set
 CONFIG_UART0_TTYS0=y
 # CONFIG_UART0_TTYS1 is not set
@@ -91,19 +90,14 @@ CONFIG_NOT_COHERENT_CACHE=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
 # Bus options
 #
 # CONFIG_PCI is not set
 # CONFIG_PCI_DOMAINS is not set
-# CONFIG_HOTPLUG is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
 
 #
 # Advanced setup
@@ -119,6 +113,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00400000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -128,14 +126,19 @@ CONFIG_BOOT_LOAD=0x00400000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
+# CONFIG_BLK_DEV_FD is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
@@ -144,11 +147,6 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_LBD is not set
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -159,14 +157,28 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_SCSI is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
 #
 # I2O device support
 #
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -190,7 +202,6 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -203,7 +214,6 @@ CONFIG_SYN_COOKIES=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
@@ -247,6 +257,7 @@ CONFIG_MII=y
 #
 # Ethernet (10000 Mbit)
 #
+# CONFIG_IBM_EMAC is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
@@ -259,6 +270,7 @@ CONFIG_MII=y
 # Token Ring devices
 #
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -279,16 +291,18 @@ CONFIG_MII=y
 # Bluetooth support
 #
 # CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-# CONFIG_FB is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -323,10 +337,6 @@ CONFIG_SERIO=y
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-
 #
 # Character devices
 #
@@ -347,30 +357,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Algorithms
-#
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -396,6 +384,15 @@ CONFIG_UNIX98_PTY_COUNT=256
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -406,6 +403,25 @@ CONFIG_UNIX98_PTY_COUNT=256
 #
 # CONFIG_DVB is not set
 
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
 #
 # File systems
 #
@@ -440,7 +456,6 @@ CONFIG_EXT2_FS=y
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
@@ -452,6 +467,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -468,12 +484,13 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -488,19 +505,14 @@ CONFIG_SUNRPC=y
 CONFIG_MSDOS_PARTITION=y
 
 #
-# Sound
+# Native Language Support
 #
-# CONFIG_SOUND is not set
+# CONFIG_NLS is not set
 
 #
 # IBM 40x options
 #
 
-#
-# USB support
-#
-# CONFIG_USB_GADGET is not set
-
 #
 # Library routines
 #
diff --git a/arch/ppc/configs/sandpoint_defconfig b/arch/ppc/configs/sandpoint_defconfig
index c359b0030..739b09581 100644
--- a/arch/ppc/configs/sandpoint_defconfig
+++ b/arch/ppc/configs/sandpoint_defconfig
@@ -4,23 +4,39 @@
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
 #
-CONFIG_SWAP=y
+# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
 CONFIG_FUTEX=y
-# CONFIG_EPOLL is not set
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -33,24 +49,25 @@ CONFIG_OBSOLETE_MODPARM=y
 CONFIG_KMOD=y
 
 #
-# Platform support
+# Processor
 #
-CONFIG_PPC=y
-CONFIG_PPC32=y
 CONFIG_6xx=y
 # CONFIG_40x is not set
+# CONFIG_44x is not set
 # CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
+CONFIG_ALTIVEC=y
+# CONFIG_TAU is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_PPC_STD_MMU=y
 
 #
-# IBM 4xx options
+# Platform options
 #
-# CONFIG_8260 is not set
-CONFIG_GENERIC_ISA_DMA=y
-CONFIG_PPC_STD_MMU=y
 # CONFIG_PPC_MULTIPLATFORM is not set
 # CONFIG_APUS is not set
-# CONFIG_WILLOW_2 is not set
+# CONFIG_WILLOW is not set
 # CONFIG_PCORE is not set
 # CONFIG_POWERPMC250 is not set
 # CONFIG_EV64260 is not set
@@ -66,41 +83,37 @@ CONFIG_SANDPOINT=y
 # CONFIG_K2 is not set
 # CONFIG_PAL4 is not set
 # CONFIG_GEMINI is not set
+# CONFIG_EST8260 is not set
+# CONFIG_SBS8260 is not set
+# CONFIG_RPX6 is not set
+# CONFIG_TQM8260 is not set
 CONFIG_PPC_GEN550=y
 CONFIG_EPIC_SERIAL_MODE=y
+CONFIG_MPC10X_BRIDGE=y
 # CONFIG_MPC10X_STORE_GATHERING is not set
 # CONFIG_SMP is not set
 # CONFIG_PREEMPT is not set
-CONFIG_ALTIVEC=y
-# CONFIG_TAU is not set
-# CONFIG_CPU_FREQ is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_KERNEL_ELF=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
-# General setup
+# Bus options
 #
-# CONFIG_HIGHMEM is not set
+CONFIG_GENERIC_ISA_DMA=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
-CONFIG_KCORE_ELF=y
-CONFIG_KERNEL_ELF=y
-CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_MISC=m
 # CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
-CONFIG_HOTPLUG=y
 
 #
 # PCMCIA/CardBus support
 #
 # CONFIG_PCMCIA is not set
 
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-CONFIG_PPC601_SYNC_FIX=y
-# CONFIG_CMDLINE_BOOL is not set
-
 #
 # Advanced setup
 #
@@ -115,6 +128,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -125,10 +142,14 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
@@ -139,34 +160,28 @@ CONFIG_BOOT_LOAD=0x00800000
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
+# CONFIG_LBD is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
 CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
-# CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
 # CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 CONFIG_IDE_TASKFILE_IO=y
@@ -174,19 +189,28 @@ CONFIG_IDE_TASKFILE_IO=y
 #
 # IDE chipset support/bugfixes
 #
+CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
 
 #
 # SCSI device support
 #
 # CONFIG_SCSI is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -195,6 +219,10 @@ CONFIG_IDE_TASKFILE_IO=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -206,38 +234,37 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 # CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_XFRM_USER is not set
+# CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
 # CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -255,17 +282,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-CONFIG_DUMMY=m
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -287,6 +318,7 @@ CONFIG_NET_TULIP=y
 CONFIG_TULIP=y
 # CONFIG_TULIP_MWI is not set
 # CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_WINBOND_840 is not set
 # CONFIG_DM9102 is not set
@@ -296,15 +328,20 @@ CONFIG_NET_PCI=y
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
-# CONFIG_TC35815 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=y
+# CONFIG_E100_NAPI is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
 # CONFIG_8139CP is not set
-# CONFIG_8139TOO is not set
+CONFIG_8139TOO=y
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -328,6 +365,22 @@ CONFIG_E100=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 CONFIG_PPP=m
@@ -339,139 +392,45 @@ CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices (depends on LLC=y)
-#
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Graphics support
+# Telephony Support
 #
-CONFIG_FB=y
-# CONFIG_FB_CIRRUS is not set
-# CONFIG_FB_PM2 is not set
-# CONFIG_FB_CYBER2000 is not set
-# CONFIG_FB_CT65550 is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-# CONFIG_FB_MATROX_MYSTIQUE is not set
-# CONFIG_FB_MATROX_G450 is not set
-# CONFIG_FB_MATROX_G100A is not set
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-# CONFIG_FB_RADEON is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-# CONFIG_FB_3DFX is not set
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_PM3 is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
-# CONFIG_LOGO is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
 #
-CONFIG_INPUT=y
+# CONFIG_INPUT is not set
 
 #
 # Userland interfaces
 #
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-CONFIG_INPUT_EVDEV=m
-# CONFIG_INPUT_EVBUG is not set
 
 #
 # Input I/O drivers
 #
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
-CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
-# CONFIG_SERIO_SERPORT is not set
-# CONFIG_SERIO_CT82C710 is not set
-# CONFIG_SERIO_PCIPS2 is not set
+# CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
 
 #
 # Input Device Drivers
 #
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_SERIAL is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-CONFIG_INPUT_MISC=y
-# CONFIG_INPUT_PCSPKR is not set
-CONFIG_INPUT_UINPUT=m
-
-#
-# Macintosh device drivers
-#
 
 #
 # Character devices
 #
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
+# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -479,6 +438,7 @@ CONFIG_HW_CONSOLE=y
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -487,26 +447,8 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Hardware Sensors Mainboard support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -531,135 +473,31 @@ CONFIG_GEN_RTC=y
 # CONFIG_FTAPE is not set
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
-CONFIG_RAW_DRIVER=m
-# CONFIG_HANGCHECK_TIMER is not set
-
-#
-# Multimedia devices
-#
-CONFIG_VIDEO_DEV=m
+# CONFIG_RAW_DRIVER is not set
 
 #
-# Video For Linux
+# I2C support
 #
-CONFIG_VIDEO_PROC_FS=y
+# CONFIG_I2C is not set
 
 #
-# Video Adapters
+# Misc devices
 #
-# CONFIG_VIDEO_PMS is not set
-# CONFIG_VIDEO_CPIA is not set
-# CONFIG_VIDEO_STRADIS is not set
 
 #
-# Radio Adapters
+# Multimedia devices
 #
-# CONFIG_RADIO_GEMTEK_PCI is not set
-# CONFIG_RADIO_MAXIRADIO is not set
-# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_VIDEO_DEV is not set
 
 #
 # Digital Video Broadcasting Devices
 #
 # CONFIG_DVB is not set
-# CONFIG_VIDEO_BTCX is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-# CONFIG_FAT_FS is not set
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-CONFIG_RAMFS=y
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V4 is not set
-# CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-# CONFIG_EXPORTFS is not set
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
 
 #
-# Partition Types
+# Graphics support
 #
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
+# CONFIG_FB is not set
 
 #
 # Sound
@@ -692,47 +530,38 @@ CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_BLUETOOTH_TTY is not set
 CONFIG_USB_ACM=m
 # CONFIG_USB_PRINTER is not set
+# CONFIG_USB_STORAGE is not set
 
 #
-# SCSI support is needed for USB Storage
+# USB Human Interface Devices (HID)
 #
+# CONFIG_USB_HID is not set
 
 #
-# USB Human Interface Devices (HID)
+# Input core support is needed for USB HID input layer or HIDBP support
+#
+
+#
+# USB HID Boot Protocol drivers
 #
-CONFIG_USB_HID=y
-CONFIG_USB_HIDINPUT=y
-# CONFIG_HID_FF is not set
-CONFIG_USB_HIDDEV=y
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_XPAD is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-CONFIG_USB_SCANNER=m
 
 #
 # USB Multimedia devices
 #
 # CONFIG_USB_DABUSB is not set
-# CONFIG_USB_VICAM is not set
-# CONFIG_USB_DSBR is not set
-# CONFIG_USB_IBMCAM is not set
-# CONFIG_USB_KONICAWC is not set
-# CONFIG_USB_OV511 is not set
-# CONFIG_USB_PWC is not set
-CONFIG_USB_SE401=m
-# CONFIG_USB_STV680 is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
 
 #
 # USB Network adaptors
 #
-# CONFIG_USB_AX8817X is not set
 # CONFIG_USB_CATC is not set
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_PEGASUS is not set
@@ -772,22 +601,123 @@ CONFIG_USB_SERIAL_VISOR=m
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
 #
-# Bluetooth support
+# File systems
 #
-# CONFIG_BT is not set
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_FAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
 
 #
 # Library routines
 #
-# CONFIG_CRC32 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
 
@@ -795,7 +725,6 @@ CONFIG_ZLIB_DEFLATE=m
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
-# CONFIG_KALLSYMS is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
 
 #
diff --git a/arch/ppc/configs/spruce_defconfig b/arch/ppc/configs/spruce_defconfig
index 7cf1b4a07..ce3417ba9 100644
--- a/arch/ppc/configs/spruce_defconfig
+++ b/arch/ppc/configs/spruce_defconfig
@@ -21,9 +21,12 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
@@ -32,6 +35,7 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -102,7 +106,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 # CONFIG_PCI_NAMES is not set
-# CONFIG_HOTPLUG is not set
 
 #
 # Advanced setup
@@ -150,8 +153,8 @@ CONFIG_BOOT_LOAD=0x00800000
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 # CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_LBD is not set
 
 #
@@ -174,7 +177,7 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -210,23 +213,21 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -247,23 +248,27 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
-CONFIG_CRC32=y
 # CONFIG_OAKNET is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
@@ -304,7 +309,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -312,47 +316,34 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
 
 #
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
 # Telephony Support
@@ -403,12 +394,8 @@ CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -440,6 +427,10 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_I2C is not set
 
+#
+# Misc devices
+#
+
 #
 # Multimedia devices
 #
@@ -510,8 +501,8 @@ CONFIG_ISO9660_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
@@ -523,6 +514,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -545,12 +537,11 @@ CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -567,6 +558,8 @@ CONFIG_MSDOS_PARTITION=y
 #
 # Library routines
 #
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # Kernel hacking
diff --git a/arch/ppc/configs/sycamore_defconfig b/arch/ppc/configs/sycamore_defconfig
index 0c46a8327..246bb2c21 100644
--- a/arch/ppc/configs/sycamore_defconfig
+++ b/arch/ppc/configs/sycamore_defconfig
@@ -4,11 +4,17 @@
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
@@ -18,9 +24,16 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
+# CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
 CONFIG_FUTEX=y
 # CONFIG_EPOLL is not set
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -33,66 +46,60 @@ CONFIG_MODVERSIONS=y
 CONFIG_KMOD=y
 
 #
-# Platform support
+# Processor
 #
-CONFIG_PPC=y
-CONFIG_PPC32=y
 # CONFIG_6xx is not set
 CONFIG_40x=y
+# CONFIG_44x is not set
 # CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_CPU_FREQ is not set
 CONFIG_4xx=y
 
 #
 # IBM 4xx options
 #
 # CONFIG_ASH is not set
-# CONFIG_BEECH is not set
-# CONFIG_CEDAR is not set
 # CONFIG_CPCI405 is not set
 # CONFIG_EP405 is not set
+# CONFIG_EVB405EP is not set
 # CONFIG_OAK is not set
-# CONFIG_REDWOOD_4 is not set
 # CONFIG_REDWOOD_5 is not set
 # CONFIG_REDWOOD_6 is not set
 CONFIG_SYCAMORE=y
-# CONFIG_TIVO is not set
 # CONFIG_WALNUT is not set
-CONFIG_IBM405_ERR77=y
-CONFIG_IBM405_ERR51=y
 CONFIG_IBM_OCP=y
+CONFIG_PPC_OCP=y
 CONFIG_BIOS_FIXUP=y
+CONFIG_405GPR=y
 CONFIG_IBM_OPENBIOS=y
-# CONFIG_405_DMA is not set
-CONFIG_PM=y
+# CONFIG_PM is not set
 CONFIG_UART0_TTYS0=y
 # CONFIG_UART0_TTYS1 is not set
 CONFIG_NOT_COHERENT_CACHE=y
-# CONFIG_SMP is not set
-# CONFIG_PREEMPT is not set
-# CONFIG_MATH_EMULATION is not set
-# CONFIG_CPU_FREQ is not set
 
 #
-# General setup
+# Platform options
 #
-# CONFIG_HIGHMEM is not set
-CONFIG_PCI=y
-CONFIG_PCI_DOMAINS=y
 # CONFIG_PC_KEYBOARD is not set
-CONFIG_KCORE_ELF=y
-CONFIG_BINFMT_ELF=y
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HIGHMEM is not set
 CONFIG_KERNEL_ELF=y
+CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_PCI_LEGACY_PROC is not set
-# CONFIG_PCI_NAMES is not set
-# CONFIG_HOTPLUG is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
-# Parallel port support
+# Bus options
 #
-# CONFIG_PARPORT is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_LEGACY_PROC is not set
+# CONFIG_PCI_NAMES is not set
 
 #
 # Advanced setup
@@ -108,15 +115,27 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00400000
 
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+
 #
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
@@ -127,32 +146,36 @@ CONFIG_BOOT_LOAD=0x00400000
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
+# CONFIG_LBD is not set
 
 #
-# Multi-device support (RAID and LVM)
+# ATA/ATAPI/MFM/RLL support
 #
-# CONFIG_MD is not set
+# CONFIG_IDE is not set
 
 #
-# ATA/IDE/MFM/RLL support
+# SCSI device support
 #
-# CONFIG_IDE is not set
+# CONFIG_SCSI is not set
 
 #
-# SCSI support
+# Multi-device support (RAID and LVM)
 #
-# CONFIG_SCSI is not set
+# CONFIG_MD is not set
 
 #
 # Fusion MPT device support
 #
+# CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -161,6 +184,10 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+
 #
 # Networking support
 #
@@ -171,7 +198,6 @@ CONFIG_NET=y
 #
 # CONFIG_PACKET is not set
 # CONFIG_NETLINK_DEV is not set
-# CONFIG_NETFILTER is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
@@ -180,29 +206,29 @@ CONFIG_IP_MULTICAST=y
 CONFIG_IP_PNP=y
 # CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
+# CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_XFRM_USER is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_LLC is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -230,7 +256,6 @@ CONFIG_NETDEVICES=y
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -259,6 +284,7 @@ CONFIG_MII=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -266,6 +292,12 @@ CONFIG_MII=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=64
+CONFIG_IBM_EMAC_TXB=8
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
@@ -277,10 +309,12 @@ CONFIG_MII=y
 # CONFIG_NET_RADIO is not set
 
 #
-# Token Ring devices (depends on LLC=y)
+# Token Ring devices
 #
+# CONFIG_TR is not set
 # CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -298,28 +332,38 @@ CONFIG_MII=y
 # CONFIG_IRDA is not set
 
 #
-# ISDN subsystem
+# Bluetooth support
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
-# Graphics support
+# ISDN subsystem
 #
-# CONFIG_FB is not set
+# CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Telephony Support
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
 #
-# CONFIG_INPUT is not set
+CONFIG_INPUT=y
 
 #
 # Userland interfaces
 #
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
 
 #
 # Input I/O drivers
@@ -330,18 +374,29 @@ CONFIG_SERIO=y
 CONFIG_SERIO_I8042=y
 CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
 
 #
 # Input Device Drivers
 #
-
-#
-# Macintosh device drivers
-#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
 
 #
 # Character devices
 #
+# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -349,6 +404,7 @@ CONFIG_SERIO_SERPORT=y
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -357,79 +413,132 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
 #
 CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
 # CONFIG_I2C_ALGOBIT is not set
 # CONFIG_I2C_ALGOPCF is not set
-CONFIG_I2C_IBM_OCP_ALGO=y
-CONFIG_I2C_IBM_OCP_ADAP=y
-CONFIG_I2C_CHARDEV=y
 
 #
-# I2C Hardware Sensors Mainboard support
+# I2C Hardware Bus support
 #
+# CONFIG_I2C_ALI1535 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
 # CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_IBM_IIC is not set
+# CONFIG_I2C_ISA is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
 # CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
+# CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
-# CONFIG_I2C_SENSOR is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# Mice
+# Other I2C Chip support
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_QIC02_TAPE is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# IPMI
+# Misc devices
 #
-# CONFIG_IPMI_HANDLER is not set
 
 #
-# Watchdog Cards
+# Multimedia devices
 #
-# CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
+# CONFIG_VIDEO_DEV is not set
 
 #
-# Ftape, the floppy tape device driver
+# Digital Video Broadcasting Devices
 #
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_DVB is not set
 
 #
-# Multimedia devices
+# Graphics support
 #
-# CONFIG_VIDEO_DEV is not set
+# CONFIG_FB is not set
 
 #
-# Digital Video Broadcasting Devices
+# Sound
 #
-# CONFIG_DVB is not set
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
 
 #
 # File systems
@@ -463,10 +572,11 @@ CONFIG_EXT2_FS=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 
 #
@@ -475,6 +585,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -491,12 +602,13 @@ CONFIG_RAMFS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
@@ -522,35 +634,23 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_EFI_PARTITION is not set
 
 #
-# Sound
+# Native Language Support
 #
-# CONFIG_SOUND is not set
+# CONFIG_NLS is not set
 
 #
 # IBM 40x options
 #
 
-#
-# USB support
-#
-# CONFIG_USB is not set
-# CONFIG_USB_GADGET is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-
 #
 # Library routines
 #
-# CONFIG_CRC32 is not set
+CONFIG_CRC32=y
 
 #
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
-# CONFIG_KALLSYMS is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
 CONFIG_OCP=y
 
diff --git a/arch/ppc/configs/walnut_defconfig b/arch/ppc/configs/walnut_defconfig
index ab2bb1e81..4641fd77b 100644
--- a/arch/ppc/configs/walnut_defconfig
+++ b/arch/ppc/configs/walnut_defconfig
@@ -21,8 +21,10 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
@@ -33,6 +35,7 @@ CONFIG_FUTEX=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -62,6 +65,7 @@ CONFIG_4xx=y
 # IBM 4xx options
 #
 # CONFIG_ASH is not set
+# CONFIG_BUBINGA is not set
 # CONFIG_CPCI405 is not set
 # CONFIG_EP405 is not set
 # CONFIG_OAK is not set
@@ -72,7 +76,6 @@ CONFIG_WALNUT=y
 CONFIG_IBM405_ERR77=y
 CONFIG_IBM405_ERR51=y
 CONFIG_IBM_OCP=y
-CONFIG_PPC_OCP=y
 CONFIG_BIOS_FIXUP=y
 CONFIG_405GP=y
 CONFIG_IBM_OPENBIOS=y
@@ -91,7 +94,8 @@ CONFIG_NOT_COHERENT_CACHE=y
 CONFIG_KERNEL_ELF=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="ip=on"
 
 #
 # Bus options
@@ -172,7 +176,6 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -204,9 +207,9 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_DHCP is not set
 CONFIG_IP_PNP_BOOTP=y
-CONFIG_IP_PNP_RARP=y
+# CONFIG_IP_PNP_RARP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
@@ -216,8 +219,6 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -225,7 +226,9 @@ CONFIG_SYN_COOKIES=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -246,16 +249,21 @@ CONFIG_SYN_COOKIES=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -284,7 +292,6 @@ CONFIG_MII=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -292,45 +299,29 @@ CONFIG_MII=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -495,6 +486,7 @@ CONFIG_EXT2_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -535,7 +527,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -568,13 +559,14 @@ CONFIG_PARTITION_ADVANCED=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_SERIAL_TEXT_DEBUG is not set
-CONFIG_OCP=y
+CONFIG_PPC_OCP=y
 
 #
 # Security options
diff --git a/arch/ppc/defconfig b/arch/ppc/defconfig
index d2553f6f4..9cf908e2f 100644
--- a/arch/ppc/defconfig
+++ b/arch/ppc/defconfig
@@ -6,6 +6,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PPC=y
 CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
 
 #
 # Code maturity level options
@@ -20,9 +21,12 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
+CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
@@ -32,6 +36,8 @@ CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -122,7 +128,6 @@ CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-CONFIG_HOTPLUG=y
 
 #
 # PCMCIA/CardBus support
@@ -130,11 +135,6 @@ CONFIG_HOTPLUG=y
 # CONFIG_PCMCIA is not set
 CONFIG_PCMCIA_PROBE=y
 
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
 #
 # Advanced setup
 #
@@ -148,6 +148,10 @@ CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
 CONFIG_BOOT_LOAD=0x00800000
 
+#
+# Device Drivers
+#
+
 #
 # Generic Driver Options
 #
@@ -158,6 +162,11 @@ CONFIG_BOOT_LOAD=0x00800000
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
@@ -175,16 +184,12 @@ CONFIG_BLK_DEV_FD=m
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_LBD=y
 
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -207,6 +212,7 @@ CONFIG_BLK_DEV_IDESCSI=y
 #
 # IDE chipset support/bugfixes
 #
+CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDEPCI=y
 CONFIG_IDEPCI_SHARE_IRQ=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -214,7 +220,6 @@ CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_SL82C105=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
@@ -274,6 +279,12 @@ CONFIG_SCSI_REPORT_LUNS=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+
 #
 # SCSI low-level drivers
 #
@@ -286,7 +297,6 @@ CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_AIC7XXX=m
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
 CONFIG_AIC7XXX_RESET_DELAY_MS=15000
-# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
 CONFIG_AIC7XXX_DEBUG_ENABLE=y
 CONFIG_AIC7XXX_DEBUG_MASK=0
@@ -296,6 +306,7 @@ CONFIG_SCSI_AIC7XXX_OLD=m
 CONFIG_SCSI_ADVANSYS=m
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -314,14 +325,23 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_SYM53C416 is not set
 # CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_U14_34F is not set
 # CONFIG_SCSI_NSP32 is not set
@@ -331,13 +351,23 @@ CONFIG_SCSI_MESH_SYNC_RATE=5
 CONFIG_SCSI_MESH_RESET_DELAY_MS=4000
 CONFIG_SCSI_MAC53C94=y
 
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
 #
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
@@ -346,6 +376,24 @@ CONFIG_SCSI_MAC53C94=y
 #
 # CONFIG_I2O is not set
 
+#
+# Macintosh device drivers
+#
+CONFIG_ADB=y
+CONFIG_ADB_CUDA=y
+CONFIG_ADB_PMU=y
+CONFIG_PMAC_PBOOK=y
+CONFIG_PMAC_APM_EMU=y
+CONFIG_PMAC_BACKLIGHT=y
+# CONFIG_MAC_FLOPPY is not set
+CONFIG_MAC_SERIAL=m
+CONFIG_ADB_MACIO=y
+CONFIG_INPUT_ADBHID=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_THERM_WINDTUNNEL=m
+CONFIG_THERM_ADT746X=m
+# CONFIG_ANSLCD is not set
+
 #
 # Networking support
 #
@@ -367,7 +415,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
@@ -378,8 +425,6 @@ CONFIG_SYN_COOKIES=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -434,14 +479,17 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 # CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -462,16 +510,21 @@ CONFIG_IPV6_SCTP__=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -504,6 +557,7 @@ CONFIG_PCNET32=y
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
@@ -530,7 +584,6 @@ CONFIG_PCNET32=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -538,17 +591,12 @@ CONFIG_PCNET32=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=y
-CONFIG_PPP_MULTILINK=y
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=y
-# CONFIG_PPP_SYNC_TTY is not set
-CONFIG_PPP_DEFLATE=y
-# CONFIG_PPP_BSDCOMP is not set
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -571,99 +619,43 @@ CONFIG_APPLE_AIRPORT=m
 # CONFIG_PLX_HERMES is not set
 # CONFIG_TMD_HERMES is not set
 # CONFIG_PCI_HERMES is not set
-CONFIG_NET_WIRELESS=y
+# CONFIG_ATMEL is not set
 
 #
-# Token Ring devices
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
 #
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
+# CONFIG_PRISM54 is not set
+CONFIG_NET_WIRELESS=y
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=y
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=y
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
-
-#
-# Graphics support
-#
-CONFIG_FB=y
-# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_OF=y
-CONFIG_FB_CONTROL=y
-CONFIG_FB_PLATINUM=y
-CONFIG_FB_VALKYRIE=y
-CONFIG_FB_CT65550=y
-CONFIG_FB_IMSTT=y
-# CONFIG_FB_S3TRIO is not set
-# CONFIG_FB_VGA16 is not set
-# CONFIG_FB_RIVA is not set
-CONFIG_FB_MATROX=y
-CONFIG_FB_MATROX_MILLENIUM=y
-CONFIG_FB_MATROX_MYSTIQUE=y
-# CONFIG_FB_MATROX_G450 is not set
-CONFIG_FB_MATROX_G100A=y
-CONFIG_FB_MATROX_G100=y
-# CONFIG_FB_MATROX_MULTIHEAD is not set
-CONFIG_FB_RADEON=y
-CONFIG_FB_ATY128=y
-CONFIG_FB_ATY=y
-CONFIG_FB_ATY_CT=y
-CONFIG_FB_ATY_GX=y
-# CONFIG_FB_ATY_XL_INIT is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-CONFIG_FB_3DFX=y
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Console display driver support
-#
-CONFIG_VGA_CONSOLE=y
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
-# CONFIG_FONTS is not set
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
-CONFIG_LOGO=y
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Telephony Support
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -699,35 +691,20 @@ CONFIG_SERIO_SERPORT=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_INPORT is not set
 # CONFIG_MOUSE_LOGIBM is not set
 # CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
-#
-# Macintosh device drivers
-#
-CONFIG_ADB_CUDA=y
-CONFIG_ADB_PMU=y
-CONFIG_PMAC_PBOOK=y
-CONFIG_PMAC_APM_EMU=y
-CONFIG_PMAC_BACKLIGHT=y
-# CONFIG_MAC_FLOPPY is not set
-CONFIG_MAC_SERIAL=m
-CONFIG_ADB=y
-CONFIG_ADB_MACIO=y
-CONFIG_INPUT_ADBHID=y
-CONFIG_MAC_EMUMOUSEBTN=y
-# CONFIG_ANSLCD is not set
-
 #
 # Character devices
 #
@@ -751,79 +728,108 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_PMACZILOG=y
 # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_NVRAM=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
 #
-CONFIG_I2C=m
+CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=m
 
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 
 #
 # I2C Hardware Bus support
 #
 # CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
 # CONFIG_I2C_ALI15X3 is not set
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_ELEKTOR is not set
+CONFIG_I2C_HYDRA=y
 # CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
 # CONFIG_I2C_ISA is not set
 CONFIG_I2C_KEYWEST=m
 # CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_SCx200_ACB is not set
 # CONFIG_I2C_SIS5595 is not set
 # CONFIG_I2C_SIS630 is not set
 # CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
 # CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
 # CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# Mice
-#
-CONFIG_BUSMOUSE=y
-# CONFIG_QIC02_TAPE is not set
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
+# Other I2C Chip support
 #
-# CONFIG_WATCHDOG is not set
-CONFIG_NVRAM=y
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# Ftape, the floppy tape device driver
+# Misc devices
 #
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
 
 #
 # Multimedia devices
@@ -836,152 +842,65 @@ CONFIG_GEN_RTC=y
 # CONFIG_DVB is not set
 
 #
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
+# Graphics support
 #
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=m
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_DEVFS_FS=y
-# CONFIG_DEVFS_MOUNT is not set
-# CONFIG_DEVFS_DEBUG is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-CONFIG_HFS_FS=m
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V4 is not set
-CONFIG_NFSD=y
-CONFIG_NFSD_V3=y
-# CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
+CONFIG_FB=y
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+CONFIG_FB_OF=y
+CONFIG_FB_CONTROL=y
+CONFIG_FB_PLATINUM=y
+CONFIG_FB_VALKYRIE=y
+CONFIG_FB_CT65550=y
+CONFIG_FB_IMSTT=y
+# CONFIG_FB_S3TRIO is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_RIVA is not set
+CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+# CONFIG_FB_MATROX_G450 is not set
+CONFIG_FB_MATROX_G100A=y
+CONFIG_FB_MATROX_G100=y
+CONFIG_FB_MATROX_I2C=y
+# CONFIG_FB_MATROX_MAVEN is not set
+# CONFIG_FB_MATROX_MULTIHEAD is not set
+# CONFIG_FB_RADEON_OLD is not set
+CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON_I2C=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=y
+CONFIG_FB_ATY=y
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GX=y
+# CONFIG_FB_ATY_XL_INIT is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+CONFIG_FB_3DFX=y
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_VIRTUAL is not set
 
 #
-# Partition Types
+# Console display driver support
 #
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-CONFIG_MAC_PARTITION=y
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-CONFIG_NLS=y
+CONFIG_VGA_CONSOLE=y
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
 
 #
-# Native Language Support
+# Logo configuration
 #
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ISO8859_1=m
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
 
 #
 # Sound
@@ -994,15 +913,24 @@ CONFIG_DMASOUND=m
 # Advanced Linux Sound Architecture
 #
 CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
 CONFIG_SND_SEQUENCER=m
 CONFIG_SND_SEQ_DUMMY=m
-# CONFIG_SND_OSSEMUL is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
 
 #
 # Generic devices
 #
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_VIRMIDI is not set
 # CONFIG_SND_MTPAV is not set
@@ -1039,11 +967,17 @@ CONFIG_SND_CS4232=m
 # PCI devices
 #
 # CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
 # CONFIG_SND_CS46XX is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MIXART is not set
 # CONFIG_SND_NM256 is not set
 # CONFIG_SND_RME32 is not set
 # CONFIG_SND_RME96 is not set
@@ -1062,6 +996,7 @@ CONFIG_SND_CS4232=m
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
 # CONFIG_SND_SONICVIBES is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VX222 is not set
@@ -1131,13 +1066,14 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_WACOM is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
 # CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-CONFIG_USB_SCANNER=m
 # CONFIG_USB_MICROTEK is not set
 # CONFIG_USB_HPUSBSCSI is not set
 
@@ -1205,17 +1141,176 @@ CONFIG_USB_EZUSB=y
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_DEVFS_FS=y
+# CONFIG_DEVFS_MOUNT is not set
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=y
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V4 is not set
+# CONFIG_NFSD_TCP is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
 
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index 33b6ca871..1934cd3f8 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -24,11 +24,12 @@ obj-y				:= entry.o traps.o irq.o idle.o time.o misc.o \
 obj-$(CONFIG_6xx)		+= l2cr.o cpu_setup_6xx.o
 obj-$(CONFIG_POWER4)		+= cpu_setup_power4.o
 obj-$(CONFIG_MODULES)		+= module.o ppc_ksyms.o
+obj-$(CONFIG_NOT_COHERENT_CACHE)	+= dma-mapping.o
 obj-$(CONFIG_PCI)		+= pci.o
-obj-$(CONFIG_PCI)		+= pci-dma.o
 obj-$(CONFIG_KGDB)		+= ppc-stub.o
 obj-$(CONFIG_SMP)		+= smp.o smp-tbsync.o
 obj-$(CONFIG_TAU)		+= temp.o
+obj-$(CONFIG_ALTIVEC)		+= vecemu.o vector.o
 
 ifdef CONFIG_MATH_EMULATION
 obj-$(CONFIG_8xx)		+= softemu8xx.o
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index b48744b02..78f85e675 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -209,7 +209,15 @@ struct cpu_spec	cpu_specs[] = {
 	32, 32,
 	__setup_cpu_750fx
     },
-
+    {	/* 750GX */
+    	0xffff0000, 0x70020000, "750GX",
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP |
+	CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_750fx
+    },
     {	/* 740/750 (L2CR bit need fixup for 740) */
     	0xffff0000, 0x00080000, "740/750",
 	CPU_FTR_COMMON |
@@ -342,6 +350,14 @@ struct cpu_spec	cpu_specs[] = {
 	32, 32,
 	__setup_cpu_603
     },
+    {	/* 8280 is a G2_LE (603e core, plus some) */
+	0x7fff0000, 0x00820000, "8280",
+	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+	CPU_FTR_CAN_NAP | CPU_FTR_HAS_HIGH_BATS,
+	COMMON_PPC,
+	32, 32,
+	__setup_cpu_603
+    },
     {	/* default match, we assume split I/D cache & TB (non-601)... */
     	0x00000000, 0x00000000, "(generic PPC)",
 	CPU_FTR_COMMON |
@@ -537,8 +553,8 @@ struct cpu_spec	cpu_specs[] = {
         32, 32,
         0, /*__setup_cpu_440 */
     },
-    { /* 440GX Rev. B1 (2.1) */
-        0xf0000fff, 0x50000852, "440GX Rev. B1 (2.1)",
+    { /* 440GX Rev. C */
+        0xf0000fff, 0x50000892, "440GX Rev. C",
         CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
         PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
         32, 32,
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index c657ee4f4..8108917ea 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -44,13 +44,41 @@
 #define LOAD_MSR_KERNEL(r, x)	li r,(x)
 #endif
 
-#ifdef CONFIG_4xx
+#ifdef CONFIG_BOOKE
+#define	COR	r8
+#define BOOKE_LOAD_COR	lis COR,crit_save@ha
+#define BOOKE_REST_COR	mfspr COR,SPRG2
+#define BOOKE_SAVE_COR	mtspr SPRG2,COR
+#else
+#define COR	0
+#define BOOKE_LOAD_COR
+#define BOOKE_REST_COR
+#define BOOKE_SAVE_COR
+#endif
+
+#ifdef CONFIG_BOOKE
+	.globl	mcheck_transfer_to_handler
+mcheck_transfer_to_handler:
+	mtspr	SPRG6W,r8
+	lis	r8,mcheck_save@ha
+	lwz	r0,mcheck_r10@l(r8)
+	stw	r0,GPR10(r11)
+	lwz	r0,mcheck_r11@l(r8)
+	stw	r0,GPR11(r11)
+	mfspr	r8,SPRG6R
+	b	transfer_to_handler_full
+#endif
+
+#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
 	.globl	crit_transfer_to_handler
 crit_transfer_to_handler:
-	lwz	r0,crit_r10@l(0)
+	BOOKE_SAVE_COR
+	BOOKE_LOAD_COR
+	lwz	r0,crit_r10@l(COR)
 	stw	r0,GPR10(r11)
-	lwz	r0,crit_r11@l(0)
+	lwz	r0,crit_r11@l(COR)
 	stw	r0,GPR11(r11)
+	BOOKE_REST_COR
 	/* fall through */
 #endif
 
@@ -82,7 +110,7 @@ transfer_to_handler:
 	beq	2f			/* if from user, fix up THREAD.regs */
 	addi	r11,r1,STACK_FRAME_OVERHEAD
 	stw	r11,PT_REGS(r12)
-#ifdef CONFIG_4xx
+#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
 	lwz	r12,PTRACE-THREAD(r12)
 	andi.	r12,r12,PT_PTRACED
 	beq+	3f
@@ -423,6 +451,29 @@ ppc_swapcontext:
 	stw	r0,TRAP(r1)		/* register set saved */
 	b	sys_swapcontext
 
+/*
+ * Top-level page fault handling.
+ * This is in assembler because if do_page_fault tells us that
+ * it is a bad kernel page fault, we want to save the non-volatile
+ * registers before calling bad_page_fault.
+ */
+	.globl	handle_page_fault
+handle_page_fault:
+	stw	r4,_DAR(r1)
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	do_page_fault
+	cmpwi	r3,0
+	beq+	ret_from_except
+	SAVE_NVGPRS(r1)
+	lwz	r0,TRAP(r1)
+	clrrwi	r0,r0,1
+	stw	r0,TRAP(r1)
+	mr	r5,r3
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	lwz	r4,_DAR(r1)
+	bl	bad_page_fault
+	b	ret_from_except_full
+
 /*
  * This routine switches between two different tasks.  The process
  * state of one is saved on its kernel stack.  Then the state
@@ -695,12 +746,14 @@ ret_from_crit_exc:
 	mtlr	r11
 	lwz	r10,_CCR(r1)
 	mtcrf	0xff,r10
+#ifdef CONFIG_40x
 	/* avoid any possible TLB misses here by turning off MSR.DR, we
 	 * assume the instructions here are mapped by a pinned TLB entry */
 	li	r10,MSR_IR
 	mtmsr	r10
 	isync
 	tophys(r1, r1)
+#endif
 	lwz	r9,_DEAR(r1)
 	lwz	r10,_ESR(r1)
 	mtspr	SPRN_DEAR,r9
@@ -711,31 +764,104 @@ ret_from_crit_exc:
 	mtspr	CSRR1,r12
 	lwz	r9,GPR9(r1)
 	lwz	r12,GPR12(r1)
-	lwz	r10,crit_sprg0@l(0)
+	BOOKE_SAVE_COR
+	BOOKE_LOAD_COR
+	lwz	r10,crit_sprg0@l(COR)
 	mtspr	SPRN_SPRG0,r10
-	lwz	r10,crit_sprg1@l(0)
+	lwz	r10,crit_sprg1@l(COR)
 	mtspr	SPRN_SPRG1,r10
-	lwz	r10,crit_sprg4@l(0)
+	lwz	r10,crit_sprg4@l(COR)
 	mtspr	SPRN_SPRG4,r10
-	lwz	r10,crit_sprg5@l(0)
+	lwz	r10,crit_sprg5@l(COR)
 	mtspr	SPRN_SPRG5,r10
-	lwz	r10,crit_sprg6@l(0)
+#ifdef CONFIG_40x
+	lwz	r10,crit_sprg6@l(COR)
 	mtspr	SPRN_SPRG6,r10
-	lwz	r10,crit_sprg7@l(0)
+#endif
+	lwz	r10,crit_sprg7@l(COR)
 	mtspr	SPRN_SPRG7,r10
-	lwz	r10,crit_srr0@l(0)
+	lwz	r10,crit_srr0@l(COR)
 	mtspr	SRR0,r10
-	lwz	r10,crit_srr1@l(0)
+	lwz	r10,crit_srr1@l(COR)
 	mtspr	SRR1,r10
-	lwz	r10,crit_pid@l(0)
+	lwz	r10,crit_pid@l(COR)
 	mtspr	SPRN_PID,r10
 	lwz	r10,GPR10(r1)
 	lwz	r11,GPR11(r1)
 	lwz	r1,GPR1(r1)
+	BOOKE_REST_COR
 	PPC405_ERR77_SYNC
 	rfci
 	b	.		/* prevent prefetch past rfci */
 
+#ifdef CONFIG_BOOKE
+/*
+ * Return from a machine check interrupt, similar to a critical
+ * interrupt.
+ */
+	.globl	ret_from_mcheck_exc
+ret_from_mcheck_exc:
+	REST_NVGPRS(r1)
+	lwz	r3,_MSR(r1)
+	andi.	r3,r3,MSR_PR
+	LOAD_MSR_KERNEL(r10,MSR_KERNEL)
+	bne	user_exc_return
+
+	lwz	r0,GPR0(r1)
+	lwz	r2,GPR2(r1)
+	REST_4GPRS(3, r1)
+	REST_2GPRS(7, r1)
+
+	lwz	r10,_XER(r1)
+	lwz	r11,_CTR(r1)
+	mtspr	XER,r10
+	mtctr	r11
+
+	stwcx.	r0,0,r1			/* to clear the reservation */
+
+	lwz	r11,_LINK(r1)
+	mtlr	r11
+	lwz	r10,_CCR(r1)
+	mtcrf	0xff,r10
+	lwz	r9,_DEAR(r1)
+	lwz	r10,_ESR(r1)
+	mtspr	SPRN_DEAR,r9
+	mtspr	SPRN_ESR,r10
+	lwz	r11,_NIP(r1)
+	lwz	r12,_MSR(r1)
+	mtspr	MCSRR0,r11
+	mtspr	MCSRR1,r12
+	lwz	r9,GPR9(r1)
+	lwz	r12,GPR12(r1)
+	mtspr	SPRG6W,r8
+	lis	r8,mcheck_save@ha
+	lwz	r10,mcheck_sprg0@l(r8)
+	mtspr	SPRN_SPRG0,r10
+	lwz	r10,mcheck_sprg1@l(r8)
+	mtspr	SPRN_SPRG1,r10
+	lwz	r10,mcheck_sprg4@l(r8)
+	mtspr	SPRN_SPRG4,r10
+	lwz	r10,mcheck_sprg5@l(r8)
+	mtspr	SPRN_SPRG5,r10
+	lwz	r10,mcheck_sprg7@l(r8)
+	mtspr	SPRN_SPRG7,r10
+	lwz	r10,mcheck_srr0@l(r8)
+	mtspr	SRR0,r10
+	lwz	r10,mcheck_srr1@l(r8)
+	mtspr	SRR1,r10
+	lwz	r10,mcheck_csrr0@l(r8)
+	mtspr	CSRR0,r10
+	lwz	r10,mcheck_csrr1@l(r8)
+	mtspr	CSRR1,r10
+	lwz	r10,mcheck_pid@l(r8)
+	mtspr	SPRN_PID,r10
+	lwz	r10,GPR10(r1)
+	lwz	r11,GPR11(r1)
+	lwz	r1,GPR1(r1)
+	mfspr	r8,SPRG6R
+	RFMCI
+#endif /* CONFIG_BOOKE */
+
 /*
  * Load the DBCR0 value for a task that is being ptraced,
  * having first saved away the global DBCR0.
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 54f7728e5..a7bb50232 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -412,9 +412,7 @@ DataAccess:
 1:	stw	r10,_DSISR(r11)
 	mr	r5,r10
 	mfspr	r4,DAR
-	stw	r4,_DAR(r11)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE_LITE(0x300, do_page_fault)
+	EXC_XFER_EE_LITE(0x300, handle_page_fault)
 
 #ifdef CONFIG_PPC64BRIDGE
 /* SLB fault on data access. */
@@ -436,10 +434,9 @@ InstructionAccess:
 	li	r3,0			/* into the hash table */
 	mr	r4,r12			/* SRR0 is fault address */
 	bl	hash_page
-1:	addi	r3,r1,STACK_FRAME_OVERHEAD
-	mr	r4,r12
+1:	mr	r4,r12
 	mr	r5,r9
-	EXC_XFER_EE_LITE(0x400, do_page_fault)
+	EXC_XFER_EE_LITE(0x400, handle_page_fault)
 
 #ifdef CONFIG_PPC64BRIDGE
 /* SLB fault on instruction access. */
@@ -491,14 +488,16 @@ SystemCall:
 /*
  * The Altivec unavailable trap is at 0x0f20.  Foo.
  * We effectively remap it to 0x3000.
+ * We include an altivec unavailable exception vector even if
+ * not configured for Altivec, so that you can't panic a
+ * non-altivec kernel running on a machine with altivec just
+ * by executing an altivec instruction.
  */
 	. = 0xf00
 	b	Trap_0f
 
 	. = 0xf20
-#ifdef CONFIG_ALTIVEC
 	b	AltiVecUnavailable
-#endif
 
 Trap_0f:
 	EXCEPTION_PROLOG
@@ -705,6 +704,7 @@ DataStoreTLBMiss:
 #ifndef CONFIG_ALTIVEC
 #define AltivecAssistException	UnknownException
 #endif
+
 	EXCEPTION(0x1300, Trap_13, InstructionBreakpoint, EXC_XFER_EE)
 	EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
 	EXCEPTION(0x1500, Trap_15, UnknownException, EXC_XFER_EE)
@@ -746,12 +746,12 @@ DataStoreTLBMiss:
 
 	. = 0x3000
 
-#ifdef CONFIG_ALTIVEC
 AltiVecUnavailable:
 	EXCEPTION_PROLOG
+#ifdef CONFIG_ALTIVEC
 	bne	load_up_altivec		/* if from user, just load it up */
-	EXC_XFER_EE_LITE(0xf20, KernelAltiVec)
 #endif /* CONFIG_ALTIVEC */
+	EXC_XFER_EE_LITE(0xf20, AltivecUnavailException)
 
 #ifdef CONFIG_PPC64BRIDGE
 DataAccess:
@@ -1633,7 +1633,7 @@ initial_mm_power4:
 	blr
 
 #endif /* CONFIG_POWER4 */
-	
+
 #ifdef CONFIG_8260
 /* Jump into the system reset for the rom.
  * We first disable the MMU, and then jump to the ROM reset address.
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index e4c59673c..f38298cbb 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -313,7 +313,7 @@ skpinv:	addi	r4,r4,1				/* Increment */
 #define NORMAL_EXCEPTION_PROLOG						     \
 	mtspr	SPRN_SPRG0,r10;		/* save two registers to work with */\
 	mtspr	SPRN_SPRG1,r11;						     \
-	mtspr	SPRN_SPRG2,r1;						     \
+	mtspr	SPRN_SPRG4W,r1;						     \
 	mfcr	r10;			/* save CR in r10 for now	   */\
 	mfspr	r11,SPRN_SRR1;		/* check whether user or kernel    */\
 	andi.	r11,r11,MSR_PR;						     \
@@ -332,7 +332,7 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	stw	r12,GPR11(r11);						     \
 	mflr	r10;							     \
 	stw	r10,_LINK(r11);						     \
-	mfspr	r10,SPRG2;						     \
+	mfspr	r10,SPRG4R;						     \
 	mfspr	r12,SRR0;						     \
 	stw	r10,GPR1(r11);						     \
 	mfspr	r9,SRR1;						     \
@@ -348,30 +348,34 @@ skpinv:	addi	r4,r4,1				/* Increment */
  * can potentially occur at any point during normal exception processing.
  * Thus we cannot use the same SPRG registers as the normal prolog above.
  * Instead we use a couple of words of memory at low physical addresses.
- * This is OK since we don't support SMP on these processors.
+ * This is OK since we don't support SMP on these processors. For Book E
+ * processors, we also have a reserved register (SPRG2) that is only used
+ * in critical exceptions so we can free up a GPR to use as the base for
+ * indirect access to the critical exception save area.  This is necessary
+ * since the MMU is always on and the save area is offset from KERNELBASE.
  */
-/* XXX but we don't have RAM mapped at 0 in space 0  -- paulus. */
 #define CRITICAL_EXCEPTION_PROLOG					     \
-	stw	r10,crit_r10@l(0);	/* save two registers to work with */\
-	stw	r11,crit_r11@l(0);					     \
+	mtspr	SPRG2,r8;		/* SPRG2 only used in criticals */   \
+	lis	r8,crit_save@ha;					     \
+	stw	r10,crit_r10@l(r8);					     \
+	stw	r11,crit_r11@l(r8);					     \
 	mfspr	r10,SPRG0;						     \
-	stw	r10,crit_sprg0@l(0);					     \
+	stw	r10,crit_sprg0@l(r8);					     \
 	mfspr	r10,SPRG1;						     \
-	stw	r10,crit_sprg1@l(0);					     \
+	stw	r10,crit_sprg1@l(r8);					     \
 	mfspr	r10,SPRG4R;						     \
-	stw	r10,crit_sprg4@l(0);					     \
+	stw	r10,crit_sprg4@l(r8);					     \
 	mfspr	r10,SPRG5R;						     \
-	stw	r10,crit_sprg5@l(0);					     \
-	mfspr	r10,SPRG6R;						     \
-	stw	r10,crit_sprg6@l(0);					     \
+	stw	r10,crit_sprg5@l(r8);					     \
 	mfspr	r10,SPRG7R;						     \
-	stw	r10,crit_sprg7@l(0);					     \
+	stw	r10,crit_sprg7@l(r8);					     \
 	mfspr	r10,SPRN_PID;						     \
-	stw	r10,crit_pid@l(0);					     \
+	stw	r10,crit_pid@l(r8);					     \
 	mfspr	r10,SRR0;						     \
-	stw	r10,crit_srr0@l(0);					     \
+	stw	r10,crit_srr0@l(r8);					     \
 	mfspr	r10,SRR1;						     \
-	stw	r10,crit_srr1@l(0);					     \
+	stw	r10,crit_srr1@l(r8);					     \
+	mfspr	r8,SPRG2;		/* SPRG2 only used in criticals */   \
 	mfcr	r10;			/* save CR in r10 for now	   */\
 	mfspr	r11,SPRN_CSRR1;		/* check whether user or kernel    */\
 	andi.	r11,r11,MSR_PR;						     \
@@ -383,7 +387,6 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	lwz	r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
 	addi	r11,r11,THREAD_SIZE;					     \
 1:	subi	r11,r11,INT_FRAME_SIZE;	/* Allocate an exception frame     */\
-	tophys(r11,r11);						     \
 	stw	r10,_CCR(r11);          /* save various registers	   */\
 	stw	r12,GPR12(r11);						     \
 	stw	r9,GPR9(r11);						     \
@@ -403,6 +406,71 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	SAVE_4GPRS(3, r11);						     \
 	SAVE_2GPRS(7, r11)
 
+/*
+ * Exception prolog for machine check exceptions.  This is similar to
+ * the critical exception prolog, except that machine check exceptions
+ * have their own save area.  For Book E processors, we also have a
+ * reserved register (SPRG6) that is only used in machine check exceptions
+ * so we can free up a GPR to use as the base for indirect access to the
+ * machine check exception save area.  This is necessary since the MMU
+ * is always on and the save area is offset from KERNELBASE.
+ */
+#define MCHECK_EXCEPTION_PROLOG					     \
+	mtspr	SPRG6W,r8;		/* SPRG6 used in machine checks */   \
+	lis	r8,mcheck_save@ha;					     \
+	stw	r10,mcheck_r10@l(r8);					     \
+	stw	r11,mcheck_r11@l(r8);					     \
+	mfspr	r10,SPRG0;						     \
+	stw	r10,mcheck_sprg0@l(r8);					     \
+	mfspr	r10,SPRG1;						     \
+	stw	r10,mcheck_sprg1@l(r8);					     \
+	mfspr	r10,SPRG4R;						     \
+	stw	r10,mcheck_sprg4@l(r8);					     \
+	mfspr	r10,SPRG5R;						     \
+	stw	r10,mcheck_sprg5@l(r8);					     \
+	mfspr	r10,SPRG7R;						     \
+	stw	r10,mcheck_sprg7@l(r8);					     \
+	mfspr	r10,SPRN_PID;						     \
+	stw	r10,mcheck_pid@l(r8);					     \
+	mfspr	r10,SRR0;						     \
+	stw	r10,mcheck_srr0@l(r8);					     \
+	mfspr	r10,SRR1;						     \
+	stw	r10,mcheck_srr1@l(r8);					     \
+	mfspr	r10,CSRR0;						     \
+	stw	r10,mcheck_csrr0@l(r8);					     \
+	mfspr	r10,CSRR1;						     \
+	stw	r10,mcheck_csrr1@l(r8);					     \
+	mfspr	r8,SPRG6R;		/* SPRG6 used in machine checks */   \
+	mfcr	r10;			/* save CR in r10 for now	   */\
+	mfspr	r11,SPRN_MCSRR1;	/* check whether user or kernel    */\
+	andi.	r11,r11,MSR_PR;						     \
+	lis	r11,mcheck_stack_top@h;					     \
+	ori	r11,r11,mcheck_stack_top@l;				     \
+	beq	1f;							     \
+	/* COMING FROM USER MODE */					     \
+	mfspr	r11,SPRG3;		/* if from user, start at top of   */\
+	lwz	r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
+	addi	r11,r11,THREAD_SIZE;					     \
+1:	subi	r11,r11,INT_FRAME_SIZE;	/* Allocate an exception frame     */\
+	stw	r10,_CCR(r11);          /* save various registers	   */\
+	stw	r12,GPR12(r11);						     \
+	stw	r9,GPR9(r11);						     \
+	mflr	r10;							     \
+	stw	r10,_LINK(r11);						     \
+	mfspr	r12,SPRN_DEAR;		/* save DEAR and ESR in the frame  */\
+	stw	r12,_DEAR(r11);		/* since they may have had stuff   */\
+	mfspr	r9,SPRN_ESR;		/* in them at the point where the  */\
+	stw	r9,_ESR(r11);		/* exception was taken		   */\
+	mfspr	r12,MCSRR0;						     \
+	stw	r1,GPR1(r11);						     \
+	mfspr	r9,MCSRR1;						     \
+	stw	r1,0(r11);						     \
+	tovirt(r1,r11);							     \
+	rlwinm	r9,r9,0,14,12;		/* clear MSR_WE (necessary?)	   */\
+	stw	r0,GPR0(r11);						     \
+	SAVE_4GPRS(3, r11);						     \
+	SAVE_2GPRS(7, r11)
+
 /*
  * Exception vectors.
  */
@@ -429,6 +497,18 @@ label:
 			  NOCOPY, transfer_to_handler_full, \
 			  ret_from_except_full)
 
+#define MCHECK_EXCEPTION(n, label, hdlr)			\
+	START_EXCEPTION(label);					\
+	MCHECK_EXCEPTION_PROLOG;				\
+	lis	r4,MCSR_MCS@h;					\
+	mtspr	SPRN_MCSR,r4;					\
+	mfspr	r5,SPRN_ESR;					\
+	stw	r5,_ESR(r11);					\
+	addi	r3,r1,STACK_FRAME_OVERHEAD;			\
+	EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
+			  NOCOPY, mcheck_transfer_to_handler,   \
+			  ret_from_mcheck_exc)
+
 #define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret)	\
 	li	r10,trap;					\
 	stw	r10,TRAP(r11);					\
@@ -463,7 +543,11 @@ interrupt_base:
 	CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException)
 
 	/* Machine Check Interrupt */
+#ifdef CONFIG_440A
+	MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException)
+#else
 	CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException)
+#endif
 
 	/* Data Storage Interrupt */
 	START_EXCEPTION(DataStorage)
@@ -471,7 +555,6 @@ interrupt_base:
 	mtspr	SPRG1, r11
 	mtspr	SPRG4W, r12
 	mtspr	SPRG5W, r13
-	mtspr	SPRG6W, r14
 	mfcr	r11
 	mtspr	SPRG7W, r11
 
@@ -544,15 +627,14 @@ interrupt_base:
 	rlwinm	r11,r11,0,20,15		/* Clear U0-U3 */
 
 	/* find the TLB index that caused the fault.  It has to be here. */
-	tlbsx	r14, 0, r10
+	tlbsx	r10, 0, r10
 
-	tlbwe	r11, r14, PPC44x_TLB_ATTRIB	/* Write ATTRIB */
+	tlbwe	r11, r10, PPC44x_TLB_ATTRIB	/* Write ATTRIB */
 
 	/* Done...restore registers and get out of here.
 	*/
 	mfspr	r11, SPRG7R
 	mtcr	r11
-	mfspr	r14, SPRG6R
 	mfspr	r13, SPRG5R
 	mfspr	r12, SPRG4R
 
@@ -567,7 +649,6 @@ interrupt_base:
 	 */
 	mfspr	r11, SPRG7R
 	mtcr	r11
-	mfspr	r14, SPRG6R
 	mfspr	r13, SPRG5R
 	mfspr	r12, SPRG4R
 
@@ -580,8 +661,7 @@ interrupt_base:
 	NORMAL_EXCEPTION_PROLOG
 	mr      r4,r12                  /* Pass SRR0 as arg2 */
 	li      r5,0                    /* Pass zero as arg3 */
-	addi    r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE_LITE(0x0400, do_page_fault)
+	EXC_XFER_EE_LITE(0x0400, handle_page_fault)
 
 	/* External Input Interrupt */
 	EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
@@ -635,7 +715,6 @@ interrupt_base:
 	mtspr	SPRG1, r11
 	mtspr	SPRG4W, r12
 	mtspr	SPRG5W, r13
-	mtspr	SPRG6W, r14
 	mfcr	r11
 	mtspr	SPRG7W, r11
 	mfspr	r10, SPRN_DEAR		/* Get faulting address */
@@ -688,7 +767,6 @@ interrupt_base:
 	 */
 	mfspr	r11, SPRG7R
 	mtcr	r11
-	mfspr	r14, SPRG6R
 	mfspr	r13, SPRG5R
 	mfspr	r12, SPRG4R
 	mfspr	r11, SPRG1
@@ -706,7 +784,6 @@ interrupt_base:
 	mtspr	SPRG1, r11
 	mtspr	SPRG4W, r12
 	mtspr	SPRG5W, r13
-	mtspr	SPRG6W, r14
 	mfcr	r11
 	mtspr	SPRG7W, r11
 	mfspr	r10, SRR0		/* Get faulting address */
@@ -759,7 +836,6 @@ interrupt_base:
 	 */
 	mfspr	r11, SPRG7R
 	mtcr	r11
-	mfspr	r14, SPRG6R
 	mfspr	r13, SPRG5R
 	mfspr	r12, SPRG4R
 	mfspr	r11, SPRG1
@@ -780,61 +856,50 @@ interrupt_base:
  * the MSR_DE bit set.
  */
 	/* Debug Interrupt */
-	CRITICAL_EXCEPTION(0x2000, Debug, DebugException)
-#if 0
 	START_EXCEPTION(Debug)
-	/* This first instruction was already executed by the exception
-	 * handler and must be the first instruction of every exception
-	 * handler.
-	 */
-	mtspr	SPRN_SPRG0,r10		/* Save some working registers... */
-	mtspr	SPRN_SPRG1,r11
-	mtspr	SPRN_SPRG4W,r12
-	mfcr	r10			/* ..and the cr because we change it */
-
-	mfspr   r11,SPRN_CSRR1		/* MSR at the time of fault */
-	andi.   r11,r11,MSR_PR
-	bne+    2f			/* trapped from problem state */
-
-	mfspr   r11,SPRN_CSRR0		/* Faulting instruction address */
-	lis	r12, KERNELBASE@h
-	ori	r12, r12, KERNELBASE@l
-	cmplw   r11,r12
-	blt+    2f			/* addr below exception vectors */
-
-	lis	r12, Debug@h
-	ori	r12, r12, Debug@l
-	cmplw   r11,r12
-	bgt+    2f			/* addr above TLB exception vectors */
-
-	lis     r11,DBSR_IC@h           /* Remove the trap status */
-	mtspr   SPRN_DBSR,r11
-
-	mfspr	r11,SPRN_CSRR1
-	rlwinm	r11,r11,0,23,21		/* clear MSR_DE */
-	mtspr	SPRN_CSRR1, r11		/* restore MSR at rcfi without DE */
-
-	mtcrf   0xff,r10                /* restore registers */
-	mfspr	r12,SPRN_SPRG4R
-	mfspr   r11,SPRN_SPRG1
-	mfspr   r10,SPRN_SPRG0
-
-	sync
-	rfci                            /* return to the exception handler  */
-	b	.			/* prevent prefetch past rfci */
-
-2:
-	mtcrf   0xff,r10                /* restore registers */
-	mfspr   r12,SPRN_SPRG4R
-	mfspr   r11,SPRN_SPRG1
-	mfspr   r10,SPRN_SPRG0
+	CRITICAL_EXCEPTION_PROLOG
 
-	CRIT_EXCEPTION_PROLOG
+	/*
+	 * If this is a single step or branch-taken exception in an
+	 * exception entry sequence, it was probably meant to apply to
+	 * the code where the exception occurred (since exception entry
+	 * doesn't turn off DE automatically).  We simulate the effect
+	 * of turning off DE on entry to an exception handler by turning
+	 * off DE in the CSRR1 value and clearing the debug status.
+	 */
+	mfspr	r10,SPRN_DBSR		/* check single-step/branch taken */
+	andis.	r10,r10,(DBSR_IC|DBSR_BT)@h
+	beq+	1f
+	andi.	r0,r9,MSR_PR		/* check supervisor */
+	beq	2f			/* branch if we need to fix it up... */
+
+	/* continue normal handling for a critical exception... */
+1:	mfspr	r4,SPRN_DBSR
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	li	r7,CRIT_EXC;
-        li      r9,MSR_KERNEL
-	FINISH_EXCEPTION(DebugException)
-#endif
+	EXC_XFER_TEMPLATE(DebugException, 0x2002, \
+		(MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
+		NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
+
+	/* here it looks like we got an inappropriate debug exception. */
+2:	rlwinm	r9,r9,0,~MSR_DE		/* clear DE in the CSRR1 value */
+	mtspr	SPRN_DBSR,r10		/* clear the IC/BT debug intr status */
+	/* restore state and get out */
+	lwz	r10,_CCR(r11)
+	lwz	r0,GPR0(r11)
+	lwz	r1,GPR1(r11)
+	mtcrf	0x80,r10
+	mtspr	CSRR0,r12
+	mtspr	CSRR1,r9
+	lwz	r9,GPR9(r11)
+
+	mtspr	SPRG2,r8;		/* SPRG2 only used in criticals */
+	lis	r8,crit_save@ha;
+	lwz	r10,crit_r10@l(r8)
+	lwz	r11,crit_r11@l(r8)
+	mfspr	r8,SPRG2
+
+	rfci
+	b	.
 
 /*
  * Local functions
@@ -848,9 +913,7 @@ data_access:
 	mfspr	r5,SPRN_ESR		/* Grab the ESR, save it, pass arg3 */
 	stw	r5,_ESR(r11)
 	mfspr	r4,SPRN_DEAR		/* Grab the DEAR, save it, pass arg2 */
-	stw	r4,_DEAR(r11)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE_LITE(0x0300, do_page_fault)
+	EXC_XFER_EE_LITE(0x0300, handle_page_fault)
 
 /*
 
@@ -860,7 +923,6 @@ data_access:
  * 	r11 - available to use
  *	r12 - Pointer to the 64-bit PTE
  *	r13 - available to use
- *	r14 - available to use
  *	MMUCR - loaded with proper value when we get here
  *	Upon exit, we reload everything and RFI.
  */
@@ -875,51 +937,50 @@ finish_tlb_load:
 
 	/* Load the next available TLB index */
 	lis	r13, tlb_44x_index@ha
-	lwz	r14, tlb_44x_index@l(r13)
+	lwz	r13, tlb_44x_index@l(r13)
 	/* Load the TLB high watermark */
-	lis	r13, tlb_44x_hwater@ha
-	lwz	r11, tlb_44x_hwater@l(r13)
+	lis	r11, tlb_44x_hwater@ha
+	lwz	r11, tlb_44x_hwater@l(r11)
 
 	/* Increment, rollover, and store TLB index */
-	addi	r14, r14, 1
-	cmpw	0, r14, r11			/* reserve entries */
+	addi	r13, r13, 1
+	cmpw	0, r13, r11			/* reserve entries */
 	ble	7f
-	li	r14, 0
+	li	r13, 0
 7:
 	/* Store the next available TLB index */
-	lis	r13, tlb_44x_index@ha
-	stw	r14, tlb_44x_index@l(r13)
+	lis	r11, tlb_44x_index@ha
+	stw	r13, tlb_44x_index@l(r11)
 
-	lwz	r13, 0(r12)			/* Get MS word of PTE */
-	lwz	r11, 4(r12)			/* Get LS word of PTE */
-	rlwimi	r13, r11, 0, 0 , 19		/* Insert RPN */
-	tlbwe	r13, r14, PPC44x_TLB_XLAT	/* Write XLAT */
+	lwz	r11, 0(r12)			/* Get MS word of PTE */
+	lwz	r12, 4(r12)			/* Get LS word of PTE */
+	rlwimi	r11, r12, 0, 0 , 19		/* Insert RPN */
+	tlbwe	r11, r13, PPC44x_TLB_XLAT	/* Write XLAT */
 
 	/*
 	 * Create PAGEID. This is the faulting address,
 	 * page size, and valid flag.
 	 */
-	li	r12, PPC44x_TLB_VALID | PPC44x_TLB_4K
-	rlwimi	r10, r12, 0, 20, 31		/* Insert valid and page size */
-	tlbwe	r10, r14, PPC44x_TLB_PAGEID	/* Write PAGEID */
-
-	li	r13, PPC44x_TLB_SR@l		/* Set SR */
-	rlwimi	r13, r11, 0, 30, 30		/* Set SW = _PAGE_RW */
-	rlwimi	r13, r11, 29, 29, 29		/* SX = _PAGE_HWEXEC */
-	rlwimi	r13, r11, 29, 28, 28		/* UR = _PAGE_USER */
-	rlwimi	r12, r11, 31, 26, 26		/* (_PAGE_USER>>1)->r12 */
-	and	r12, r12, r11			/* HWEXEC & USER */
-	rlwimi	r13, r12, 0, 26, 26		/* UX = HWEXEC & USER */
-
-	rlwimi	r11, r13, 0, 26, 31		/* Insert static perms */
-	rlwinm	r11, r11, 0, 20, 15		/* Clear U0-U3 */
-	tlbwe	r11, r14, PPC44x_TLB_ATTRIB	/* Write ATTRIB */
+	li	r11, PPC44x_TLB_VALID | PPC44x_TLB_4K
+	rlwimi	r10, r11, 0, 20, 31		/* Insert valid and page size */
+	tlbwe	r10, r13, PPC44x_TLB_PAGEID	/* Write PAGEID */
+
+	li	r10, PPC44x_TLB_SR@l		/* Set SR */
+	rlwimi	r10, r12, 0, 30, 30		/* Set SW = _PAGE_RW */
+	rlwimi	r10, r12, 29, 29, 29		/* SX = _PAGE_HWEXEC */
+	rlwimi	r10, r12, 29, 28, 28		/* UR = _PAGE_USER */
+	rlwimi	r11, r12, 31, 26, 26		/* (_PAGE_USER>>1)->r12 */
+	and	r11, r12, r11			/* HWEXEC & USER */
+	rlwimi	r10, r11, 0, 26, 26		/* UX = HWEXEC & USER */
+
+	rlwimi	r12, r10, 0, 26, 31		/* Insert static perms */
+	rlwinm	r12, r12, 0, 20, 15		/* Clear U0-U3 */
+	tlbwe	r12, r13, PPC44x_TLB_ATTRIB	/* Write ATTRIB */
 
 	/* Done...restore registers and get out of here.
 	*/
 	mfspr	r11, SPRG7R
 	mtcr	r11
-	mfspr	r14, SPRG6R
 	mfspr	r13, SPRG5R
 	mfspr	r12, SPRG4R
 	mfspr	r11, SPRG1
@@ -985,32 +1046,30 @@ _GLOBAL(empty_zero_page)
 _GLOBAL(swapper_pg_dir)
 	.space	8192
 
-/* Stack for handling critical exceptions from kernel mode */
 	.section .bss
+/* Stack for handling critical exceptions from kernel mode */
 critical_stack_bottom:
 	.space 4096
 critical_stack_top:
 	.previous
 
-/*
- * This space gets a copy of optional info passed to us by the bootstrap
- * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
- */
-_GLOBAL(cmd_line)
-	.space	512
-
-/*
- * Room for two PTE pointers, usually the kernel and current user pointers
- * to their respective root page table.
- */
-abatron_pteptrs:
-	.space	8
+/* Stack for handling machine check exceptions from kernel mode */
+mcheck_stack_bottom:
+	.space 4096
+mcheck_stack_top:
+	.previous
 
 /*
  * This area is used for temporarily saving registers during the
- * critical exception prolog.
+ * critical and machine check exception prologs. It must always
+ * follow the page aligned allocations, so it starts on a page
+ * boundary, ensuring that all crit_save areas are in a single
+ * page.
  */
-crit_save:
+
+/* crit_save */
+_GLOBAL(crit_save)
+	.space  4
 _GLOBAL(crit_r10)
 	.space	4
 _GLOBAL(crit_r11)
@@ -1023,8 +1082,6 @@ _GLOBAL(crit_sprg4)
 	.space	4
 _GLOBAL(crit_sprg5)
 	.space	4
-_GLOBAL(crit_sprg6)
-	.space	4
 _GLOBAL(crit_sprg7)
 	.space	4
 _GLOBAL(crit_pid)
@@ -1033,3 +1090,47 @@ _GLOBAL(crit_srr0)
 	.space	4
 _GLOBAL(crit_srr1)
 	.space	4
+
+/* mcheck_save */
+_GLOBAL(mcheck_save)
+	.space  4
+_GLOBAL(mcheck_r10)
+	.space	4
+_GLOBAL(mcheck_r11)
+	.space	4
+_GLOBAL(mcheck_sprg0)
+	.space	4
+_GLOBAL(mcheck_sprg1)
+	.space	4
+_GLOBAL(mcheck_sprg4)
+	.space	4
+_GLOBAL(mcheck_sprg5)
+	.space	4
+_GLOBAL(mcheck_sprg7)
+	.space	4
+_GLOBAL(mcheck_pid)
+	.space	4
+_GLOBAL(mcheck_srr0)
+	.space	4
+_GLOBAL(mcheck_srr1)
+	.space	4
+_GLOBAL(mcheck_csrr0)
+	.space	4
+_GLOBAL(mcheck_csrr1)
+	.space	4
+
+/*
+ * This space gets a copy of optional info passed to us by the bootstrap
+ * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
+ */
+_GLOBAL(cmd_line)
+	.space	512
+
+/*
+ * Room for two PTE pointers, usually the kernel and current user pointers
+ * to their respective root page table.
+ */
+abatron_pteptrs:
+	.space	8
+
+
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index dd03eec83..54de9b5bb 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -432,8 +432,7 @@ label:
 	NORMAL_EXCEPTION_PROLOG
 	mr	r4,r12			/* Pass SRR0 as arg2 */
 	li	r5,0			/* Pass zero as arg3 */
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE_LITE(0x400, do_page_fault)
+	EXC_XFER_EE_LITE(0x400, handle_page_fault)
 
 /* 0x0500 - External Interrupt Exception */
 	EXCEPTION(0x0500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
@@ -763,9 +762,7 @@ DataAccess:
 	mfspr	r5,SPRN_ESR		/* Grab the ESR, save it, pass arg3 */
 	stw	r5,_ESR(r11)
 	mfspr	r4,SPRN_DEAR		/* Grab the DEAR, save it, pass arg2 */
-	stw	r4,_DEAR(r11)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE_LITE(0x300, do_page_fault)
+	EXC_XFER_EE_LITE(0x300, handle_page_fault)
 
 /* Other PowerPC processors, namely those derived from the 6xx-series
  * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved.
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index c1df60395..cc3b36c0d 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -304,8 +304,10 @@ void disable_irq_nosync(unsigned int irq)
 
 void disable_irq(unsigned int irq)
 {
+	irq_desc_t *desc = irq_desc + irq;
 	disable_irq_nosync(irq);
-	synchronize_irq(irq);
+	if (desc->action)
+		synchronize_irq(irq);
 }
 
 /**
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 134b74be7..c3ed5ed1d 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -780,9 +780,18 @@ _GLOBAL(clear_pages)
 _GLOBAL(copy_page)
 	addi	r3,r3,-4
 	addi	r4,r4,-4
+
+#ifdef CONFIG_8xx
+	/* don't use prefetch on 8xx */
+    	li	r0,4096/L1_CACHE_LINE_SIZE
+	mtctr	r0
+1:	COPY_16_BYTES
+	bdnz	1b
+	blr
+
+#else	/* not 8xx, we can prefetch */
 	li	r5,4
 
-#ifndef CONFIG_8xx
 #if MAX_COPY_PREFETCH > 1
 	li	r0,MAX_COPY_PREFETCH
 	li	r11,4
@@ -790,19 +799,17 @@ _GLOBAL(copy_page)
 11:	dcbt	r11,r4
 	addi	r11,r11,L1_CACHE_LINE_SIZE
 	bdnz	11b
-#else /* MAX_L1_COPY_PREFETCH == 1 */
+#else /* MAX_COPY_PREFETCH == 1 */
 	dcbt	r5,r4
 	li	r11,L1_CACHE_LINE_SIZE+4
-#endif /* MAX_L1_COPY_PREFETCH */
-#endif /* CONFIG_8xx */
-
-	li	r0,4096/L1_CACHE_LINE_SIZE
+#endif /* MAX_COPY_PREFETCH */
+	li	r0,4096/L1_CACHE_LINE_SIZE - MAX_COPY_PREFETCH
+	crclr	4*cr0+eq
+2:
 	mtctr	r0
 1:
-#ifndef CONFIG_8xx
 	dcbt	r11,r4
 	dcbz	r5,r3
-#endif
 	COPY_16_BYTES
 #if L1_CACHE_LINE_SIZE >= 32
 	COPY_16_BYTES
@@ -818,7 +825,12 @@ _GLOBAL(copy_page)
 #endif
 #endif
 	bdnz	1b
-	blr
+	beqlr
+	crnot	4*cr0+eq,4*cr0+eq
+	li	r0,MAX_COPY_PREFETCH
+	li	r11,4
+	b	2b
+#endif	/* CONFIG_8xx */
 
 /*
  * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
@@ -1385,3 +1397,4 @@ _GLOBAL(sys_call_table)
 	.long sys_mq_timedreceive	/* 265 */
 	.long sys_mq_notify
 	.long sys_mq_getsetattr
+	.long sys_ni_syscall		/* 268 reserved for sys_kexec_load */
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 5b4965534..f095fcd74 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -128,7 +128,7 @@ pcibios_fixup_resources(struct pci_dev *dev)
 		struct resource *res = dev->resource + i;
 		if (!res->flags)
 			continue;
-		if (!res->start || res->end == 0xffffffff) {
+		if (res->end == 0xffffffff) {
 			DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
 			    pci_name(dev), i, res->start, res->end);
 			res->end -= res->start;
@@ -347,6 +347,8 @@ pci_relocate_bridge_resource(struct pci_bus *bus, int i)
 		return -1;
 	}
 	res = bus->resource[i];
+	if (res == NULL)
+		return -1;
 	pr = NULL;
 	for (j = 0; j < 4; j++) {
 		struct resource *r = parent->resource[j];
@@ -659,11 +661,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
 		return;
 	bus_range = (int *) get_property(node, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
-		printk(KERN_WARNING "Can't get bus-range for %s\n",
-		       node->full_name);
-		return;
-	}
-	pci_to_OF_bus_map[pci_bus] = bus_range[0];
+		printk(KERN_WARNING "Can't get bus-range for %s, "
+		       "assuming it starts at 0\n", node->full_name);
+		pci_to_OF_bus_map[pci_bus] = 0;
+	} else
+		pci_to_OF_bus_map[pci_bus] = bus_range[0];
 
 	for (node=node->child; node != 0;node = node->sibling) {
 		struct pci_dev* dev;
@@ -1073,6 +1075,8 @@ do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
 	u16 w;
 	struct resource res;
 
+	if (bus->resource[0] == NULL)
+		return;
  	res = *(bus->resource[0]);
 
 	DBG("Remapping Bus %d, bridge: %s\n", bus->number, bridge->slot_name);
@@ -1168,7 +1172,8 @@ do_fixup_p2p_level(struct pci_bus *bus)
 	int has_vga = 0;
 
 	for (parent_io=0; parent_io<4; parent_io++)
-		if (bus->resource[parent_io]->flags & IORESOURCE_IO)
+		if (bus->resource[parent_io]
+		    && bus->resource[parent_io]->flags & IORESOURCE_IO)
 			break;
 	if (parent_io >= 4)
 		return;
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
index 7d2f3a5cd..ad7808fa6 100644
--- a/arch/ppc/kernel/ppc_htab.c
+++ b/arch/ppc/kernel/ppc_htab.c
@@ -101,7 +101,7 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 {
 	unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
 	int n = 0;
-#ifdef CONFIG_PPC_STD_MMU
+#if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE)
 	unsigned int kptes = 0, uptes = 0;
 	PTE *ptr;
 #endif /* CONFIG_PPC_STD_MMU */
@@ -135,6 +135,7 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 		goto return_string;
 	}
 
+#ifndef CONFIG_PPC64BRIDGE
 	for (ptr = Hash; ptr < Hash_end; ptr++) {
 		unsigned int mctx, vsid;
 
@@ -148,6 +149,7 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 		else
 			uptes++;
 	}
+#endif
 
 	n += sprintf( buffer + n,
 		      "PTE Hash Table Information\n"
@@ -155,16 +157,20 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 		      "Buckets\t\t: %lu\n"
  		      "Address\t\t: %08lx\n"
 		      "Entries\t\t: %lu\n"
+#ifndef CONFIG_PPC64BRIDGE
 		      "User ptes\t: %u\n"
 		      "Kernel ptes\t: %u\n"
-		      "Percent full\t: %lu%%\n",
-                      (unsigned long)(Hash_size>>10),
+		      "Percent full\t: %lu%%\n"
+#endif
+                      , (unsigned long)(Hash_size>>10),
 		      (Hash_size/(sizeof(PTE)*8)),
 		      (unsigned long)Hash,
-		      Hash_size/sizeof(PTE),
-                      uptes,
+		      Hash_size/sizeof(PTE)
+#ifndef CONFIG_PPC64BRIDGE
+                      , uptes,
 		      kptes,
 		      ((kptes+uptes)*100) / (Hash_size/sizeof(PTE))
+#endif
 		);
 
 	n += sprintf( buffer + n,
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 452def033..eaeb6eb1e 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -72,7 +72,7 @@ int abs(int);
 
 extern unsigned long mm_ptov (unsigned long paddr);
 
-EXPORT_SYMBOL(clear_page);
+EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(clear_user_page);
 EXPORT_SYMBOL(do_signal);
 EXPORT_SYMBOL(do_syscall_trace);
@@ -181,9 +181,6 @@ EXPORT_SYMBOL(pci_bus_to_phys);
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_NOT_COHERENT_CACHE
-EXPORT_SYMBOL(consistent_alloc);
-EXPORT_SYMBOL(consistent_free);
-EXPORT_SYMBOL(consistent_sync);
 EXPORT_SYMBOL(flush_dcache_all);
 #endif
 
@@ -203,15 +200,6 @@ EXPORT_SYMBOL(last_task_used_altivec);
 EXPORT_SYMBOL(giveup_altivec);
 #endif /* CONFIG_ALTIVEC */
 #ifdef CONFIG_SMP
-#ifdef CONFIG_DEBUG_SPINLOCK
-EXPORT_SYMBOL(_raw_spin_lock);
-EXPORT_SYMBOL(_raw_spin_unlock);
-EXPORT_SYMBOL(_raw_spin_trylock);
-EXPORT_SYMBOL(_raw_read_lock);
-EXPORT_SYMBOL(_raw_read_unlock);
-EXPORT_SYMBOL(_raw_write_lock);
-EXPORT_SYMBOL(_raw_write_unlock);
-#endif
 EXPORT_SYMBOL(smp_call_function);
 EXPORT_SYMBOL(smp_hw_index);
 EXPORT_SYMBOL(synchronize_irq);
@@ -336,7 +324,7 @@ EXPORT_SYMBOL(debugger_fault_handler);
 EXPORT_SYMBOL(cpm_install_handler);
 EXPORT_SYMBOL(cpm_free_handler);
 #endif /* CONFIG_8xx */
-#if defined(CONFIG_8xx) || defined(CONFIG_4xx)
+#if defined(CONFIG_8xx) || defined(CONFIG_40x)
 EXPORT_SYMBOL(__res);
 #endif
 #if defined(CONFIG_8xx)
diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c
index 7e47f388e..b82a2009e 100644
--- a/arch/ppc/kernel/process.c
+++ b/arch/ppc/kernel/process.c
@@ -163,7 +163,7 @@ dump_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)
 void
 enable_kernel_altivec(void)
 {
-	WARN_ON(current_thread_info()->preempt_count == 0 && !irqs_disabled());
+	WARN_ON(preemptible());
 
 #ifdef CONFIG_SMP
 	if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))
@@ -180,7 +180,7 @@ EXPORT_SYMBOL(enable_kernel_altivec);
 void
 enable_kernel_fp(void)
 {
-	WARN_ON(current_thread_info()->preempt_count == 0 && !irqs_disabled());
+	WARN_ON(preemptible());
 
 #ifdef CONFIG_SMP
 	if (current->thread.regs && (current->thread.regs->msr & MSR_FP))
@@ -668,12 +668,6 @@ void __init ll_puts(const char *s)
 }
 #endif
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched    ((unsigned long) scheduling_functions_start_here)
-#define last_sched     ((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long ip, sp;
@@ -688,7 +682,7 @@ unsigned long get_wchan(struct task_struct *p)
 			return 0;
 		if (count > 0) {
 			ip = *(unsigned long *)(sp + 4);
-			if (ip < first_sched || ip >= last_sched)
+			if (!in_sched_functions(ip))
 				return ip;
 		}
 	} while (count++ < 16);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 7cd9e210e..18a2f147d 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -37,6 +37,7 @@
 #include <asm/sections.h>
 #include <asm/nvram.h>
 #include <asm/xmon.h>
+#include <asm/ocp.h>
 
 #if defined CONFIG_KGDB
 #include <asm/kgdb.h>
@@ -683,6 +684,12 @@ void __init setup_arch(char **cmdline_p)
 	do_init_bootmem();
 	if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
 
+#ifdef CONFIG_PPC_OCP
+	/* Initialize OCP device list */
+	ocp_early_init();
+	if ( ppc_md.progress ) ppc_md.progress("ocp: exit", 0x3eab);
+#endif
+
 	ppc_md.setup_arch();
 	if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
 
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index 5805707ed..c28fbf398 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -211,6 +211,8 @@ int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
            bitmask. --RR */
 	if (num_online_cpus() <= 1)
 		return 0;
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
 	return __smp_call_function(func, info, wait, MSG_ALL_BUT_SELF);
 }
 
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 197b8629b..cc500228e 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -41,9 +41,6 @@
 #include <asm/backlight.h>
 #endif
 
-extern int fix_alignment(struct pt_regs *);
-extern void bad_page_fault(struct pt_regs *, unsigned long, int sig);
-
 #ifdef CONFIG_XMON
 void (*debugger)(struct pt_regs *regs) = xmon;
 int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
@@ -222,14 +219,43 @@ MachineCheckException(struct pt_regs *regs)
 	if (check_io_access(regs))
 		return;
 
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
 	if (reason & ESR_IMCP) {
 		printk("Instruction");
 		mtspr(SPRN_ESR, reason & ~ESR_IMCP);
 	} else
 		printk("Data");
 	printk(" machine check in kernel mode.\n");
-
+#elif defined(CONFIG_440A)
+	printk("Machine check in kernel mode.\n");
+	if (reason & ESR_IMCP){
+		printk("Instruction Synchronous Machine Check exception\n");
+		mtspr(SPRN_ESR, reason & ~ESR_IMCP);
+	}
+	else {
+		u32 mcsr = mfspr(SPRN_MCSR);
+		if (mcsr & MCSR_IB)
+			printk("Instruction Read PLB Error\n");
+		if (mcsr & MCSR_DRB)
+			printk("Data Read PLB Error\n");
+		if (mcsr & MCSR_DWB)
+			printk("Data Write PLB Error\n");
+		if (mcsr & MCSR_TLBP)
+			printk("TLB Parity Error\n");
+		if (mcsr & MCSR_ICP){
+			flush_instruction_cache();
+			printk("I-Cache Parity Error\n");
+		}
+		if (mcsr & MCSR_DCSP)
+			printk("D-Cache Search Parity Error\n");
+		if (mcsr & MCSR_DCFP)
+			printk("D-Cache Flush Parity Error\n");
+		if (mcsr & MCSR_IMPE)
+			printk("Machine Check exception is imprecise\n");
+
+		/* Clear MCSR */
+		mtspr(SPRN_MCSR, mcsr);
+	}
 #else /* !CONFIG_4xx */
 	printk("Machine check in kernel mode.\n");
 	printk("Caused by (from SRR1=%lx): ", reason);
@@ -605,17 +631,54 @@ TAUException(struct pt_regs *regs)
 }
 #endif /* CONFIG_INT_TAU */
 
+void AltivecUnavailException(struct pt_regs *regs)
+{
+	static int kernel_altivec_count;
+
+#ifndef CONFIG_ALTIVEC
+	if (user_mode(regs)) {
+		/* A user program has executed an altivec instruction,
+		   but this kernel doesn't support altivec. */
+		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
+		return;
+	}
+#endif
+	/* The kernel has executed an altivec instruction without
+	   first enabling altivec.  Whinge but let it do it. */
+	if (++kernel_altivec_count < 10)
+		printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%x)\n",
+		       current, regs->nip);
+	regs->msr |= MSR_VEC;
+}
+
 #ifdef CONFIG_ALTIVEC
 void
 AltivecAssistException(struct pt_regs *regs)
 {
+	int err;
+
 	preempt_disable();
 	if (regs->msr & MSR_VEC)
 		giveup_altivec(current);
 	preempt_enable();
 
-	/* XXX quick hack for now: set the non-Java bit in the VSCR */
-	current->thread.vscr.u[3] |= 0x10000;
+	err = emulate_altivec(regs);
+	if (err == 0) {
+		regs->nip += 4;		/* skip emulated instruction */
+		emulate_single_step(regs);
+		return;
+	}
+
+	if (err == -EFAULT) {
+		/* got an error reading the instruction */
+		_exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
+	} else {
+		/* didn't recognize the instruction */
+		/* XXX quick hack for now: set the non-Java bit in the VSCR */
+		printk(KERN_ERR "unrecognized altivec instruction "
+		       "in %s at %lx\n", current->comm, regs->nip);
+		current->thread.vscr.u[3] |= 0x10000;
+	}
 }
 #endif /* CONFIG_ALTIVEC */
 
diff --git a/arch/ppc/lib/locks.c b/arch/ppc/lib/locks.c
index 1f85f3ef2..0eaffa9b5 100644
--- a/arch/ppc/lib/locks.c
+++ b/arch/ppc/lib/locks.c
@@ -7,6 +7,7 @@
 #include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
+#include <linux/module.h>
 #include <asm/ppc_asm.h>
 #include <asm/smp.h>
 
@@ -22,7 +23,7 @@
  * since they may inhibit forward progress by other CPUs in getting
  * a lock.
  */
-unsigned long __spin_trylock(volatile unsigned long *lock)
+static inline unsigned long __spin_trylock(volatile unsigned long *lock)
 {
 	unsigned long ret;
 
@@ -62,6 +63,7 @@ void _raw_spin_lock(spinlock_t *lock)
 	lock->owner_pc = (unsigned long)__builtin_return_address(0);
 	lock->owner_cpu = cpu;
 }
+EXPORT_SYMBOL(_raw_spin_lock);
 
 int _raw_spin_trylock(spinlock_t *lock)
 {
@@ -71,6 +73,7 @@ int _raw_spin_trylock(spinlock_t *lock)
 	lock->owner_pc = (unsigned long)__builtin_return_address(0);
 	return 1;
 }
+EXPORT_SYMBOL(_raw_spin_trylock);
 
 void _raw_spin_unlock(spinlock_t *lp)
 {
@@ -86,6 +89,7 @@ void _raw_spin_unlock(spinlock_t *lp)
 	wmb();
 	lp->lock = 0;
 }
+EXPORT_SYMBOL(_raw_spin_unlock);
 
 
 /*
@@ -119,6 +123,7 @@ again:
 	}
 	wmb();
 }
+EXPORT_SYMBOL(_raw_read_lock);
 
 void _raw_read_unlock(rwlock_t *rw)
 {
@@ -129,6 +134,7 @@ void _raw_read_unlock(rwlock_t *rw)
 	wmb();
 	atomic_dec((atomic_t *) &(rw)->lock);
 }
+EXPORT_SYMBOL(_raw_read_unlock);
 
 void _raw_write_lock(rwlock_t *rw)
 {
@@ -169,6 +175,22 @@ again:
 	}
 	wmb();
 }
+EXPORT_SYMBOL(_raw_write_lock);
+
+int _raw_write_trylock(rwlock_t *rw)
+{
+	if (test_and_set_bit(31, &(rw)->lock)) /* someone has a write lock */
+		return 0;
+
+	if ((rw)->lock & ~(1<<31)) {	/* someone has a read lock */
+		/* clear our write lock and wait for reads to go away */
+		clear_bit(31,&(rw)->lock);
+		return 0;
+	}
+	wmb();
+	return 1;
+}
+EXPORT_SYMBOL(_raw_write_trylock);
 
 void _raw_write_unlock(rwlock_t *rw)
 {
@@ -179,5 +201,6 @@ void _raw_write_unlock(rwlock_t *rw)
 	wmb();
 	clear_bit(31,&(rw)->lock);
 }
+EXPORT_SYMBOL(_raw_write_unlock);
 
 #endif
diff --git a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S
index 47f48c1d2..2b6091027 100644
--- a/arch/ppc/lib/string.S
+++ b/arch/ppc/lib/string.S
@@ -436,48 +436,57 @@ _GLOBAL(__copy_tofrom_user)
 73:	stwu	r9,4(r6)
 	bdnz	72b
 
+	.section __ex_table,"a"
+	.align	2
+	.long	70b,100f
+	.long	71b,101f
+	.long	72b,102f
+	.long	73b,103f
+	.text
+
 58:	srwi.	r0,r5,LG_CACHELINE_BYTES /* # complete cachelines */
 	clrlwi	r5,r5,32-LG_CACHELINE_BYTES
 	li	r11,4
 	beq	63f
 
-#if !defined(CONFIG_8xx)
+#ifdef CONFIG_8xx
+	/* Don't use prefetch on 8xx */
+	mtctr	r0
+53:	COPY_16_BYTES_WITHEX(0)
+	bdnz	53b
+
+#else /* not CONFIG_8xx */
 	/* Here we decide how far ahead to prefetch the source */
+	li	r3,4
+	cmpwi	r0,1
+	li	r7,0
+	ble	114f
+	li	r7,1
 #if MAX_COPY_PREFETCH > 1
 	/* Heuristically, for large transfers we prefetch
 	   MAX_COPY_PREFETCH cachelines ahead.  For small transfers
 	   we prefetch 1 cacheline ahead. */
 	cmpwi	r0,MAX_COPY_PREFETCH
-	li	r7,1
-	li	r3,4
-	ble	111f
+	ble	112f
 	li	r7,MAX_COPY_PREFETCH
-111:	mtctr	r7
-112:	dcbt	r3,r4
+112:	mtctr	r7
+111:	dcbt	r3,r4
 	addi	r3,r3,CACHELINE_BYTES
-	bdnz	112b
-#else /* MAX_COPY_PREFETCH == 1 */
-	li	r3,CACHELINE_BYTES + 4
-	dcbt	r11,r4
-#endif /* MAX_COPY_PREFETCH */
-#endif /* CONFIG_8xx */
-
-	mtctr	r0
-53:
-#if !defined(CONFIG_8xx)
+	bdnz	111b
+#else
 	dcbt	r3,r4
+	addi	r3,r3,CACHELINE_BYTES
+#endif /* MAX_COPY_PREFETCH > 1 */
+
+114:	subf	r8,r7,r0
+	mr	r0,r7
+	mtctr	r8
+
+53:	dcbt	r3,r4
 54:	dcbz	r11,r6
-#endif
-/* had to move these to keep extable in order */
 	.section __ex_table,"a"
 	.align	2
-	.long	70b,100f
-	.long	71b,101f
-	.long	72b,102f
-	.long	73b,103f
-#if !defined(CONFIG_8xx)
 	.long	54b,105f
-#endif
 	.text
 /* the main body of the cacheline loop */
 	COPY_16_BYTES_WITHEX(0)
@@ -495,6 +504,11 @@ _GLOBAL(__copy_tofrom_user)
 #endif
 #endif
 	bdnz	53b
+	cmpwi	r0,0
+	li	r3,4
+	li	r7,0
+	bne	114b
+#endif /* CONFIG_8xx */
 
 63:	srwi.	r0,r5,2
 	mtctr	r0
diff --git a/arch/ppc/mm/Makefile b/arch/ppc/mm/Makefile
index 6c1dd3974..038260878 100644
--- a/arch/ppc/mm/Makefile
+++ b/arch/ppc/mm/Makefile
@@ -12,4 +12,3 @@ obj-y				:= fault.o init.o mem_pieces.o \
 obj-$(CONFIG_PPC_STD_MMU)	+= hashtable.o ppc_mmu.o tlb.o
 obj-$(CONFIG_40x)		+= 4xx_mmu.o
 obj-$(CONFIG_44x)		+= 44x_mmu.o
-obj-$(CONFIG_NOT_COHERENT_CACHE)	+= cachemap.o
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
index e31abd874..7a280f9da 100644
--- a/arch/ppc/mm/fault.c
+++ b/arch/ppc/mm/fault.c
@@ -51,11 +51,6 @@ unsigned long pte_misses;	/* updated by do_page_fault() */
 unsigned long pte_errors;	/* updated by do_page_fault() */
 unsigned int probingmem;
 
-extern void die_if_kernel(char *, struct pt_regs *, long);
-void bad_page_fault(struct pt_regs *, unsigned long, int sig);
-void do_page_fault(struct pt_regs *, unsigned long, unsigned long);
-extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
-
 /*
  * Check whether the instruction at regs->nip is a store using
  * an update addressing form which will update r1.
@@ -97,8 +92,8 @@ static int store_updates_sp(struct pt_regs *regs)
  * the error_code parameter is ESR for a data fault, 0 for an instruction
  * fault.
  */
-void do_page_fault(struct pt_regs *regs, unsigned long address,
-		   unsigned long error_code)
+int do_page_fault(struct pt_regs *regs, unsigned long address,
+		  unsigned long error_code)
 {
 	struct vm_area_struct * vma;
 	struct mm_struct *mm = current->mm;
@@ -124,21 +119,20 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
 #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
 	if (debugger_fault_handler && TRAP(regs) == 0x300) {
 		debugger_fault_handler(regs);
-		return;
+		return 0;
 	}
 #if !defined(CONFIG_4xx)
 	if (error_code & 0x00400000) {
 		/* DABR match */
 		if (debugger_dabr_match(regs))
-			return;
+			return 0;
 	}
 #endif /* !CONFIG_4xx */
 #endif /* CONFIG_XMON || CONFIG_KGDB */
 
-	if (in_atomic() || mm == NULL) {
-		bad_page_fault(regs, address, SIGSEGV);
-		return;
-	}
+	if (in_atomic() || mm == NULL)
+		return SIGSEGV;
+
 	down_read(&mm->mmap_sem);
 	vma = find_vma(mm, address);
 	if (!vma)
@@ -227,15 +221,14 @@ good_area:
 			struct page *page = pte_page(*ptep);
 
 			if (! test_bit(PG_arch_1, &page->flags)) {
-				unsigned long phys = page_to_pfn(page) << PAGE_SHIFT;
-				__flush_dcache_icache_phys(phys);
+				flush_dcache_icache_page(page);
 				set_bit(PG_arch_1, &page->flags);
 			}
 			pte_update(ptep, 0, _PAGE_HWEXEC);
 			_tlbie(address);
 			pte_unmap(ptep);
 			up_read(&mm->mmap_sem);
-			return;
+			return 0;
 		}
 		if (ptep != NULL)
 			pte_unmap(ptep);
@@ -277,7 +270,7 @@ good_area:
 	 * -- Cort
 	 */
 	pte_misses++;
-	return;
+	return 0;
 
 bad_area:
 	up_read(&mm->mmap_sem);
@@ -290,11 +283,10 @@ bad_area:
 		info.si_code = code;
 		info.si_addr = (void *) address;
 		force_sig_info(SIGSEGV, &info, current);
-		return;
+		return 0;
 	}
 
-	bad_page_fault(regs, address, SIGSEGV);
-	return;
+	return SIGSEGV;
 
 /*
  * We ran out of memory, or some other thing happened to us that made
@@ -310,8 +302,7 @@ out_of_memory:
 	printk("VM: killing process %s\n", current->comm);
 	if (user_mode(regs))
 		do_exit(SIGKILL);
-	bad_page_fault(regs, address, SIGKILL);
-	return;
+	return SIGKILL;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);
@@ -321,18 +312,18 @@ do_sigbus:
 	info.si_addr = (void *)address;
 	force_sig_info (SIGBUS, &info, current);
 	if (!user_mode(regs))
-		bad_page_fault(regs, address, SIGBUS);
+		return SIGBUS;
+	return 0;
 }
 
 /*
  * bad_page_fault is called when we have a bad access from the kernel.
- * It is called from do_page_fault above and from some of the procedures
- * in traps.c.
+ * It is called from the DSI and ISI handlers in head.S and from some
+ * of the procedures in traps.c.
  */
 void
 bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
 {
-	extern void die(const char *,struct pt_regs *,long);
 	const struct exception_table_entry *entry;
 
 	/* Are we prepared to handle this fault?  */
@@ -359,7 +350,6 @@ pte_t *va_to_pte(unsigned long address)
 	pgd_t *dir;
 	pmd_t *pmd;
 	pte_t *pte;
-	struct mm_struct *mm;
 
 	if (address < TASK_SIZE)
 		return NULL;
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index b61a61cee..4628e26ab 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -458,7 +458,7 @@ void __init mem_init(void)
 
 			ClearPageReserved(page);
 			set_bit(PG_highmem, &page->flags);
-			atomic_set(&page->count, 1);
+			set_page_count(page, 1);
 			__free_page(page);
 			totalhigh_pages++;
 		}
@@ -572,6 +572,16 @@ void flush_dcache_page(struct page *page)
 	clear_bit(PG_arch_1, &page->flags);
 }
 
+void flush_dcache_icache_page(struct page *page)
+{
+#ifdef CONFIG_BOOKE
+	__flush_dcache_icache(kmap(page));
+	kunmap(page);
+#else
+	__flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
+#endif
+
+}
 void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
 {
 	clear_page(page);
@@ -614,7 +624,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
 			if (vma->vm_mm == current->active_mm)
 				__flush_dcache_icache((void *) address);
 			else
-				__flush_dcache_icache_phys(pfn << PAGE_SHIFT);
+				flush_dcache_icache_page(page);
 			set_bit(PG_arch_1, &page->flags);
 		}
 	}
diff --git a/arch/ppc/mm/mem_pieces.c b/arch/ppc/mm/mem_pieces.c
index eac045efa..3d6390520 100644
--- a/arch/ppc/mm/mem_pieces.c
+++ b/arch/ppc/mm/mem_pieces.c
@@ -120,23 +120,6 @@ mem_pieces_print(struct mem_pieces *mp)
 	printk("\n");
 }
 
-#if defined(CONFIG_APUS) || defined(CONFIG_PPC_OF)
-/*
- * Add some memory to an array of pieces
- */
-void __init
-mem_pieces_append(struct mem_pieces *mp, unsigned int start, unsigned int size)
-{
-	struct reg_property *rp;
-
-	if (mp->n_regions >= MEM_PIECES_MAX)
-		return;
-	rp = &mp->regions[mp->n_regions++];
-	rp->address = start;
-	rp->size = size;
-}
-#endif /* CONFIG_APUS || CONFIG_PPC_OF */
-
 void __init
 mem_pieces_sort(struct mem_pieces *mp)
 {
diff --git a/arch/ppc/mm/mem_pieces.h b/arch/ppc/mm/mem_pieces.h
index cd481c6b3..e2b700dc7 100644
--- a/arch/ppc/mm/mem_pieces.h
+++ b/arch/ppc/mm/mem_pieces.h
@@ -38,8 +38,6 @@ struct mem_pieces {
 extern void	*mem_pieces_find(unsigned int size, unsigned int align);
 extern void	 mem_pieces_remove(struct mem_pieces *mp, unsigned int start,
 				   unsigned int size, int must_exist);
-extern void	 mem_pieces_append(struct mem_pieces *mp, unsigned int start,
-				   unsigned int size);
 extern void	 mem_pieces_coalesce(struct mem_pieces *mp);
 extern void	 mem_pieces_sort(struct mem_pieces *mp);
 
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index b1b93fc18..04c148127 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -86,9 +86,14 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 	extern int mem_init_done;
 	extern void *early_get_page(void);
 
-	if (mem_init_done)
+	if (mem_init_done) {
 		pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
-	else
+		if (pte) {
+			struct page *ptepage = virt_to_page(pte);
+			ptepage->mapping = (void *) mm;
+			ptepage->index = address & PMD_MASK;
+		}
+	} else
 		pte = (pte_t *)early_get_page();
 	if (pte)
 		clear_page(pte);
@@ -97,7 +102,7 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 
 struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	struct page *pte;
+	struct page *ptepage;
 
 #ifdef CONFIG_HIGHPTE
 	int flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
@@ -105,10 +110,13 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 	int flags = GFP_KERNEL | __GFP_REPEAT;
 #endif
 
-	pte = alloc_pages(flags, 0);
-	if (pte)
-		clear_highpage(pte);
-	return pte;
+	ptepage = alloc_pages(flags, 0);
+	if (ptepage) {
+		ptepage->mapping = (void *) mm;
+		ptepage->index = address & PMD_MASK;
+		clear_highpage(ptepage);
+	}
+	return ptepage;
 }
 
 void pte_free_kernel(pte_t *pte)
@@ -116,15 +124,17 @@ void pte_free_kernel(pte_t *pte)
 #ifdef CONFIG_SMP
 	hash_page_sync();
 #endif
+	virt_to_page(pte)->mapping = NULL;
 	free_page((unsigned long)pte);
 }
 
-void pte_free(struct page *pte)
+void pte_free(struct page *ptepage)
 {
 #ifdef CONFIG_SMP
 	hash_page_sync();
 #endif
-	__free_page(pte);
+	ptepage->mapping = NULL;
+	__free_page(ptepage);
 }
 
 #ifndef CONFIG_44x
diff --git a/arch/ppc/mm/tlb.c b/arch/ppc/mm/tlb.c
index 3bf70f65f..34605ba4a 100644
--- a/arch/ppc/mm/tlb.c
+++ b/arch/ppc/mm/tlb.c
@@ -66,6 +66,17 @@ void flush_hash_one_pte(pte_t *ptep)
 	flush_hash_pages(mm->context, addr, ptephys, 1);
 }
 
+/*
+ * Called by ptep_set_access_flags, must flush on CPUs for which the
+ * DSI handler can't just "fixup" the TLB on a write fault
+ */
+void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
+{
+	if (Hash != 0)
+		return;
+	_tlbie(addr);
+}
+
 /*
  * Called at the end of a mmu_gather operation to make sure the
  * TLB flush is completely done.
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index eadd667df..b439b155c 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -16,6 +16,11 @@ config ASH
 	help
 	  This option enables support for the IBM NP405H evaluation board.
 
+config BUBINGA
+	bool "Bubinga"
+	help
+	  This option enables support for the IBM 405EP evaluation board.
+
 config CPCI405
 	bool "CPCI405"
 	help
@@ -122,7 +127,7 @@ config BOOKE
 
 config IBM_OCP
 	bool
-	depends on ASH || CPCI405 || EBONY || EP405 || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
+	depends on ASH || BUBINGA || CPCI405 || EBONY || EP405 || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
 	default y
 
 config IBM_EMAC4
@@ -132,7 +137,7 @@ config IBM_EMAC4
 
 config BIOS_FIXUP
 	bool
-	depends on EP405 || SYCAMORE || WALNUT
+	depends on BUBINGA || EP405 || SYCAMORE || WALNUT
 	default y
 
 config 403GCX
@@ -140,6 +145,11 @@ config 403GCX
 	depends OAK
 	default y
 
+config 405EP
+	bool
+	depends on BUBINGA
+	default y
+
 config 405GP
 	bool
 	depends on CPCI405 || EP405 || WALNUT
@@ -148,6 +158,7 @@ config 405GP
 config 405GPR
 	bool
 	depends on SYCAMORE
+	default y
 
 config STB03xxx
 	bool
@@ -161,7 +172,7 @@ config EMBEDDEDBOOT
 
 config IBM_OPENBIOS
 	bool
-	depends on ASH || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
+	depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
 	default y
 
 config PM
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index 7ae382901..82064c35d 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_ASH)		+= ash.o
 obj-$(CONFIG_CPCI405)		+= cpci405.o
 obj-$(CONFIG_EBONY)		+= ebony.o
 obj-$(CONFIG_EP405)		+= ep405.o
+obj-$(CONFIG_BUBINGA)		+= bubinga.o
 obj-$(CONFIG_OAK)		+= oak.o
 obj-$(CONFIG_OCOTEA)		+= ocotea.o
 obj-$(CONFIG_REDWOOD_5)		+= redwood5.o
@@ -16,6 +17,7 @@ obj-$(CONFIG_405GP)		+= ibm405gp.o
 obj-$(CONFIG_REDWOOD_5)		+= ibmstb4.o
 obj-$(CONFIG_NP405H)		+= ibmnp405h.o
 obj-$(CONFIG_REDWOOD_6)		+= ibmstbx25.o
-obj-$(CONFIG_EBONY)		+= ibm440gp.o
-obj-$(CONFIG_OCOTEA)		+= ibm440gx.o
+obj-$(CONFIG_440GP)		+= ibm440gp.o
+obj-$(CONFIG_440GX)		+= ibm440gx.o
+obj-$(CONFIG_405EP)		+= ibm405ep.o
 obj-$(CONFIG_405GPR)		+= ibm405gpr.o
diff --git a/arch/ppc/platforms/4xx/ash.c b/arch/ppc/platforms/4xx/ash.c
index e0a00fd35..ce2911793 100644
--- a/arch/ppc/platforms/4xx/ash.c
+++ b/arch/ppc/platforms/4xx/ash.c
@@ -18,6 +18,8 @@
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
 #include <asm/io.h>
+#include <asm/ocp.h>
+#include <asm/ibm_ocp_pci.h>
 #include <asm/todc.h>
 
 #ifdef DEBUG
@@ -53,10 +55,10 @@ ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
 void __init
 ash_setup_arch(void)
 {
-	bd_t *bip = &__res;
-
 	ppc4xx_setup_arch();
 
+	ibm_ocp_set_emac(0, 3);
+
 #ifdef CONFIG_DEBUG_BRINGUP
 	int i;
 	printk("\n");
@@ -96,8 +98,6 @@ ash_setup_arch(void)
 void __init
 bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
 {
-
-	unsigned int bar_response, bar;
 	/*
 	 * Expected PCI mapping:
 	 *
diff --git a/arch/ppc/platforms/4xx/ash.h b/arch/ppc/platforms/4xx/ash.h
index afa00015b..5f7448ea4 100644
--- a/arch/ppc/platforms/4xx/ash.h
+++ b/arch/ppc/platforms/4xx/ash.h
@@ -15,7 +15,6 @@
 #ifdef __KERNEL__
 #ifndef __ASM_ASH_H__
 #define __ASM_ASH_H__
-#include <asm/ibm_ocp.h>
 #include <platforms/4xx/ibmnp405h.h>
 
 #ifndef __ASSEMBLY__
diff --git a/arch/ppc/platforms/4xx/cpci405.c b/arch/ppc/platforms/4xx/cpci405.c
index 4ad441778..ff966773a 100644
--- a/arch/ppc/platforms/4xx/cpci405.c
+++ b/arch/ppc/platforms/4xx/cpci405.c
@@ -22,6 +22,7 @@
 #include <asm/pci-bridge.h>
 #include <asm/machdep.h>
 #include <asm/todc.h>
+#include <asm/ocp.h>
 
 void *cpci405_nvram;
 
@@ -53,6 +54,9 @@ void __init
 cpci405_setup_arch(void)
 {
 	ppc4xx_setup_arch();
+
+	ibm_ocp_set_emac(0, 0);
+
 	TODC_INIT(TODC_TYPE_MK48T35, cpci405_nvram, cpci405_nvram, cpci405_nvram, 8);
 }
 
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
index a531c13f3..6c9bde473 100644
--- a/arch/ppc/platforms/4xx/ebony.c
+++ b/arch/ppc/platforms/4xx/ebony.c
@@ -41,6 +41,7 @@
 #include <asm/dma.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
+#include <asm/ocp.h>
 #include <asm/pci-bridge.h>
 #include <asm/time.h>
 #include <asm/todc.h>
@@ -119,9 +120,6 @@ static u_char ebony_IRQ_initsenses[] __initdata = {
 
 extern void abort(void);
 
-/* Global Variables */
-bd_t __res;
-
 static void __init
 ebony_calibrate_decr(void)
 {
@@ -308,7 +306,9 @@ static void __init
 ebony_setup_arch(void)
 {
 	unsigned char * vpd_base;
-	struct ibm440gp_clocks clocks;
+	struct ibm44x_clocks clocks;
+	struct ocp_def *def;
+	struct ocp_func_emac_data *emacdata;
 
 #if !defined(CONFIG_BDI_SWITCH)
 	/*
@@ -318,10 +318,15 @@ ebony_setup_arch(void)
         mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
 #endif
 
-	/* Retrieve MAC addresses */
+	/* Set mac_addr for each EMAC */
 	vpd_base = ioremap64(EBONY_VPD_BASE, EBONY_VPD_SIZE);
-	memcpy(__res.bi_enetaddr[0],EBONY_NA0_ADDR(vpd_base),6);
-	memcpy(__res.bi_enetaddr[1],EBONY_NA1_ADDR(vpd_base),6);
+	def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
+	emacdata = def->additions;
+	memcpy(emacdata->mac_addr, EBONY_NA0_ADDR(vpd_base), 6);
+	def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 1);
+	emacdata = def->additions;
+	memcpy(emacdata->mac_addr, EBONY_NA1_ADDR(vpd_base), 6);
+	iounmap(vpd_base);
 
 	/*
 	 * Determine various clocks.
@@ -330,10 +335,7 @@ ebony_setup_arch(void)
 	 * --ebs
 	 */
 	ibm440gp_get_clocks(&clocks, 33333333, 6 * 1843200);
-	__res.bi_opb_busfreq = clocks.opb;
-
-	/* Use IIC in standard (100 kHz) mode */
-	__res.bi_iic_fast[0] = __res.bi_iic_fast[1] = 0;
+	ocp_sys_info.opb_bus_freq = clocks.opb;
 
 	/* Setup TODC access */
 	TODC_INIT(TODC_TYPE_DS1743,
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
index c852552f1..749fff956 100755
--- a/arch/ppc/platforms/4xx/ebony.h
+++ b/arch/ppc/platforms/4xx/ebony.h
@@ -65,8 +65,6 @@
 #define UART1_IO_BASE	(u8 *) 0xE0000300
 
 #define BASE_BAUD	33000000/3/16
-#define UART0_INT	0
-#define UART1_INT	1
 
 #define STD_UART_OP(num)					\
 	{ 0, BASE_BAUD, 0, UART##num##_INT,			\
diff --git a/arch/ppc/platforms/4xx/ep405.c b/arch/ppc/platforms/4xx/ep405.c
index 5f3f6dc87..26a07cdb3 100644
--- a/arch/ppc/platforms/4xx/ep405.c
+++ b/arch/ppc/platforms/4xx/ep405.c
@@ -18,6 +18,7 @@
 #include <asm/pci-bridge.h>
 #include <asm/machdep.h>
 #include <asm/todc.h>
+#include <asm/ocp.h>
 #include <asm/ibm_ocp_pci.h>
 
 #undef DEBUG
@@ -59,6 +60,8 @@ ep405_setup_arch(void)
 {
 	ppc4xx_setup_arch();
 
+	ibm_ocp_set_emac(0, 0);
+
 	if (__res.bi_nvramsize == 512*1024) {
 		/* FIXME: we should properly handle NVRTCs of different sizes */
 		TODC_INIT(TODC_TYPE_DS1557, ep405_nvram, ep405_nvram, ep405_nvram, 8);
diff --git a/arch/ppc/platforms/4xx/ibm405gp.c b/arch/ppc/platforms/4xx/ibm405gp.c
index aec4ebce7..70a262a01 100644
--- a/arch/ppc/platforms/4xx/ibm405gp.c
+++ b/arch/ppc/platforms/4xx/ibm405gp.c
@@ -1,26 +1,111 @@
 /*
- * arch/ppc/platforms/4xx/ibm405gp.c
  *
- * Author: Armin Kuster <akuster@mvista.com>
+ *    Copyright 2000-2001 MontaVista Software Inc.
+ *      Original author: Armin Kuster akuster@mvista.com
+ *
+ *    Module name: ibm405gp.c
+ *
+ *
+ * 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.
  *
- * 2001 (c) MontaVista, Software, Inc.  This file is licensed under
- * the terms of the GNU General Public License version 2.  This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
  */
 
 #include <linux/config.h>
 #include <linux/init.h>
-#include <asm/ocp.h>
+#include <linux/smp.h>
+#include <linux/threads.h>
+#include <linux/param.h>
+#include <linux/string.h>
 #include <platforms/4xx/ibm405gp.h>
+#include <asm/ibm4xx.h>
+#include <asm/ocp.h>
 
-struct ocp_def core_ocp[]  __initdata = {
-	{OCP_VENDOR_IBM, OCP_FUNC_OPB, OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART0_IO_BASE, UART0_INT,IBM_CPM_UART0},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART1_IO_BASE, UART1_INT, IBM_CPM_UART1},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, IIC0_BASE, IIC0_IRQ, IBM_CPM_IIC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_GPIO, GPIO0_BASE, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC0_BASE, BL_MAC_ETH0, IBM_CPM_EMAC0},
-	{OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+static struct ocp_func_emac_data ibm405gp_emac0_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx	= -1,		/* ZMII device index */
+	.zmii_mux	= 0,		/* ZMII input of this EMAC */
+	.mal_idx	= 0,		/* MAL device index */
+	.mal_rx_chan	= 0,		/* MAL rx channel number */
+	.mal_tx_chan	= 0,		/* MAL tx channel number */
+	.wol_irq	= 9,		/* WOL interrupt number */
+	.mdio_idx	= -1,		/* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+OCP_SYSFS_EMAC_DATA()
+
+static struct ocp_func_mal_data ibm405gp_mal0_def = {
+	.num_tx_chans	= 1,		/* Number of TX channels */
+	.num_rx_chans	= 1,		/* Number of RX channels */
+	.txeob_irq	= 11,		/* TX End Of Buffer IRQ  */
+	.rxeob_irq	= 12,		/* RX End Of Buffer IRQ  */
+	.txde_irq	= 13,		/* TX Descriptor Error IRQ */
+	.rxde_irq	= 14,		/* RX Descriptor Error IRQ */
+	.serr_irq	= 10,		/* MAL System Error IRQ    */
+};
+OCP_SYSFS_MAL_DATA()
+
+static struct ocp_func_iic_data ibm405gp_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+OCP_SYSFS_IIC_DATA()
 
+struct ocp_def core_ocp[] = {
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_OPB,
+	  .index	= 0,
+	  .paddr	= 0xEF600000,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= UART0_IO_BASE,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= UART1_IO_BASE,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .paddr	= 0xEF600500,
+	  .irq		= 2,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibm405gp_iic0_def,
+	  .show		= &ocp_show_iic_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .paddr	= 0xEF600700,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_MAL,
+	  .paddr	= OCP_PADDR_NA,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm405gp_mal0_def,
+	  .show		= &ocp_show_mal_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 0,
+	  .paddr	= EMAC0_BASE,
+	  .irq		= 15,
+	  .pm		= IBM_CPM_EMAC0,
+	  .additions	= &ibm405gp_emac0_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ibm405gp.h b/arch/ppc/platforms/4xx/ibm405gp.h
index ae2fe03d3..b2b642e81 100644
--- a/arch/ppc/platforms/4xx/ibm405gp.h
+++ b/arch/ppc/platforms/4xx/ibm405gp.h
@@ -51,9 +51,6 @@
 #define PPC4xx_ONB_IO_VADDR	PPC4xx_ONB_IO_PADDR
 #define PPC4xx_ONB_IO_SIZE	((uint)4*1024)
 
-#define OPB_BASE_START	0x40000000
-#define EBIU_BASE_START	0xF0100000
-
 /* serial port defines */
 #define RS_TABLE_SIZE	2
 
@@ -63,24 +60,8 @@
 #define PCIL0_BASE	0xEF400000
 #define UART0_IO_BASE	0xEF600300
 #define UART1_IO_BASE	0xEF600400
-#define IIC0_BASE	0xEF600500
-#define OPB0_BASE	0xEF600600
-#define GPIO0_BASE	0xEF600700
 #define EMAC0_BASE	0xEF600800
-#define BL_MAC_WOL	9	/* WOL */
-#define BL_MAL_SERR	10	/* MAL SERR */
-#define BL_MAL_TXDE	13	/* MAL TXDE */
-#define BL_MAL_RXDE	14	/* MAL RXDE */
-#define BL_MAL_TXEOB	11	/* MAL TX EOB */
-#define BL_MAL_RXEOB	12	/* MAL RX EOB */
-#define BL_MAC_ETH0	15	/* MAC */
-
-#define EMAC_NUMS	1
-#define IIC0_IRQ	2
-#define IIC1_IRQ	0
-
-#define IIC_OWN		0x55
-#define IIC_CLOCK	50
+
 #define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
 
 #define STD_UART_OP(num)					\
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.c b/arch/ppc/platforms/4xx/ibm405gpr.c
index 2e21c430d..3bd7ff5fb 100644
--- a/arch/ppc/platforms/4xx/ibm405gpr.c
+++ b/arch/ppc/platforms/4xx/ibm405gpr.c
@@ -11,17 +11,98 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/threads.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <platforms/4xx/ibm405gpr.h>
+#include <asm/ibm4xx.h>
 #include <asm/ocp.h>
 
-#include "ibm405gpr.h"
+static struct ocp_func_emac_data ibm405gpr_emac0_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx	= -1,		/* ZMII device index */
+	.zmii_mux	= 0,		/* ZMII input of this EMAC */
+	.mal_idx	= 0,		/* MAL device index */
+	.mal_rx_chan	= 0,		/* MAL rx channel number */
+	.mal_tx_chan	= 0,		/* MAL tx channel number */
+	.wol_irq	= 9,		/* WOL interrupt number */
+	.mdio_idx	= -1,		/* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+OCP_SYSFS_EMAC_DATA()
+
+static struct ocp_func_mal_data ibm405gpr_mal0_def = {
+	.num_tx_chans	= 1,		/* Number of TX channels */
+	.num_rx_chans	= 1,		/* Number of RX channels */
+	.txeob_irq	= 11,		/* TX End Of Buffer IRQ  */
+	.rxeob_irq	= 12,		/* RX End Of Buffer IRQ  */
+	.txde_irq	= 13,		/* TX Descriptor Error IRQ */
+	.rxde_irq	= 14,		/* RX Descriptor Error IRQ */
+	.serr_irq	= 10,		/* MAL System Error IRQ    */
+};
+OCP_SYSFS_MAL_DATA()
+
+static struct ocp_func_iic_data ibm405gpr_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
 
-struct ocp_def core_ocp[]  __initdata = {
-	{OCP_VENDOR_IBM, OCP_FUNC_OPB, OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART0_IO_BASE, UART0_INT,IBM_CPM_UART0},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART1_IO_BASE, UART1_INT, IBM_CPM_UART1},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, IIC0_BASE, IIC0_IRQ, IBM_CPM_IIC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_GPIO, GPIO0_BASE, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC0_BASE, BL_MAC_ETH0, IBM_CPM_EMAC0},
-	{OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+OCP_SYSFS_IIC_DATA()
 
+struct ocp_def core_ocp[] = {
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_OPB,
+	  .index	= 0,
+	  .paddr	= 0xEF600000,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= UART0_IO_BASE,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= UART1_IO_BASE,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .paddr	= 0xEF600500,
+	  .irq		= 2,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibm405gpr_iic0_def,
+	  .show		= &ocp_show_iic_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .paddr	= 0xEF600700,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_MAL,
+	  .paddr	= OCP_PADDR_NA,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm405gpr_mal0_def,
+	  .show		= &ocp_show_mal_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 0,
+	  .paddr	= EMAC0_BASE,
+	  .irq		= 15,
+	  .pm		= IBM_CPM_EMAC0,
+	  .additions	= &ibm405gpr_emac0_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.h b/arch/ppc/platforms/4xx/ibm405gpr.h
index afeb48c34..45412fb43 100644
--- a/arch/ppc/platforms/4xx/ibm405gpr.h
+++ b/arch/ppc/platforms/4xx/ibm405gpr.h
@@ -51,9 +51,6 @@
 #define PPC4xx_ONB_IO_VADDR	PPC4xx_ONB_IO_PADDR
 #define PPC4xx_ONB_IO_SIZE	((uint)4*1024)
 
-#define OPB_BASE_START	0x40000000
-#define EBIU_BASE_START	0xF0100000
-
 /* serial port defines */
 #define RS_TABLE_SIZE	2
 
@@ -63,20 +60,8 @@
 #define PCIL0_BASE	0xEF400000
 #define UART0_IO_BASE	0xEF600300
 #define UART1_IO_BASE	0xEF600400
-#define IIC0_BASE	0xEF600500
-#define OPB0_BASE	0xEF600600
-#define GPIO0_BASE	0xEF600700
 #define EMAC0_BASE	0xEF600800
-#define BL_MAC_WOL	9	/* WOL */
-#define BL_MAL_SERR	10	/* MAL SERR */
-#define BL_MAL_TXDE	13	/* MAL TXDE */
-#define BL_MAL_RXDE	14	/* MAL RXDE */
-#define BL_MAL_TXEOB	11	/* MAL TX EOB */
-#define BL_MAL_RXEOB	12	/* MAL RX EOB */
-#define BL_MAC_ETH0	15	/* MAC */
-
-#define IIC_OWN		0x55
-#define IIC_CLOCK	50
+
 #define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
 
 #define STD_UART_OP(num)					\
diff --git a/arch/ppc/platforms/4xx/ibm440gp.c b/arch/ppc/platforms/4xx/ibm440gp.c
index 7bdd7455a..965953086 100644
--- a/arch/ppc/platforms/4xx/ibm440gp.c
+++ b/arch/ppc/platforms/4xx/ibm440gp.c
@@ -4,8 +4,10 @@
  * PPC440GP I/O descriptions
  *
  * Matt Porter <mporter@mvista.com>
+ * Copyright 2002-2004 MontaVista Software Inc.
  *
- * Copyright 2002 MontaVista Software Inc.
+ * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
+ * Copyright (c) 2003, 2004 Zultys Technologies
  *
  * 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
@@ -13,19 +15,137 @@
  * option) any later version.
  *
  */
+#include <linux/init.h>
+#include <linux/module.h>
 #include <platforms/4xx/ibm440gp.h>
 #include <asm/ocp.h>
-#include <linux/init.h>
 
-struct ocp_def core_ocp[] __initdata = {
-	{OCP_VENDOR_IBM, OCP_FUNC_OPB, PPC440GP_OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GP_UART0_ADDR, UART0_INT, IBM_CPM_UART0},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GP_UART1_ADDR, UART1_INT, IBM_CPM_UART1},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GP_IIC0_ADDR, IIC0_IRQ, IBM_CPM_IIC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GP_IIC1_ADDR, IIC1_IRQ, IBM_CPM_IIC1},
-	{OCP_VENDOR_IBM, OCP_FUNC_GPIO, PPC440GP_GPIO0_ADDR, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GP_EMAC0_ADDR, BL_MAC_ETH0, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GP_EMAC1_ADDR, BL_MAC_ETH1, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_ZMII, PPC440GP_ZMII_ADDR, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+static struct ocp_func_emac_data ibm440gp_emac0_def = {
+	.rgmii_idx	= -1,           /* No RGMII */
+	.rgmii_mux	= -1,           /* No RGMII */
+	.zmii_idx       = 0,            /* ZMII device index */
+	.zmii_mux       = 0,            /* ZMII input of this EMAC */
+	.mal_idx        = 0,            /* MAL device index */
+	.mal_rx_chan    = 0,            /* MAL rx channel number */
+	.mal_tx_chan    = 0,            /* MAL tx channel number */
+	.wol_irq        = 61,		/* WOL interrupt number */
+	.mdio_idx       = -1,           /* No shared MDIO */
+	.tah_idx	= -1,           /* No TAH */
+};
+
+static struct ocp_func_emac_data ibm440gp_emac1_def = {
+	.rgmii_idx	= -1,           /* No RGMII */
+	.rgmii_mux	= -1,           /* No RGMII */
+	.zmii_idx       = 0,            /* ZMII device index */
+	.zmii_mux       = 1,            /* ZMII input of this EMAC */
+	.mal_idx        = 0,            /* MAL device index */
+	.mal_rx_chan    = 1,            /* MAL rx channel number */
+	.mal_tx_chan    = 2,            /* MAL tx channel number */
+	.wol_irq        = 63,  		/* WOL interrupt number */
+	.mdio_idx       = -1,           /* No shared MDIO */
+	.tah_idx	= -1,           /* No TAH */
+};
+OCP_SYSFS_EMAC_DATA()
+
+static struct ocp_func_mal_data ibm440gp_mal0_def = {
+	.num_tx_chans   = 4,  		/* Number of TX channels */
+	.num_rx_chans   = 2,    	/* Number of RX channels */
+	.txeob_irq	= 10,		/* TX End Of Buffer IRQ  */
+	.rxeob_irq	= 11,		/* RX End Of Buffer IRQ  */
+	.txde_irq	= 33,		/* TX Descriptor Error IRQ */
+	.rxde_irq	= 34,		/* RX Descriptor Error IRQ */
+	.serr_irq	= 32,		/* MAL System Error IRQ    */
+};
+OCP_SYSFS_MAL_DATA()
+
+static struct ocp_func_iic_data ibm440gp_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+
+static struct ocp_func_iic_data ibm440gp_iic1_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+OCP_SYSFS_IIC_DATA()
+
+struct ocp_def core_ocp[] = {
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_OPB,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000000ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= PPC440GP_UART0_ADDR,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= PPC440GP_UART1_ADDR,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000400ULL,
+	  .irq		= 2,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibm440gp_iic0_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .index	= 1,
+	  .paddr	= 0x0000000140000500ULL,
+	  .irq		= 3,
+	  .pm		= IBM_CPM_IIC1,
+	  .additions	= &ibm440gp_iic1_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000700ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_MAL,
+	  .paddr	= OCP_PADDR_NA,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gp_mal0_def,
+	  .show		= &ocp_show_mal_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000800ULL,
+	  .irq		= 60,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gp_emac0_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 1,
+	  .paddr	= 0x0000000140000900ULL,
+	  .irq		= 62,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gp_emac1_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_ZMII,
+	  .paddr	= 0x0000000140000780ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ibm440gp.h b/arch/ppc/platforms/4xx/ibm440gp.h
index b8c1a4fb6..ae1efc03b 100644
--- a/arch/ppc/platforms/4xx/ibm440gp.h
+++ b/arch/ppc/platforms/4xx/ibm440gp.h
@@ -22,44 +22,11 @@
 
 #include <linux/config.h>
 
-#define EMAC_NUMS		2
-#define UART_NUMS		2
-#define ZMII_NUMS		1
-#define IIC_NUMS		2
-#define IIC0_IRQ		2
-#define IIC1_IRQ		3
-#define GPIO_NUMS		1
-
-/* UART location */
+/* UART */
 #define PPC440GP_UART0_ADDR	0x0000000140000200ULL
 #define PPC440GP_UART1_ADDR	0x0000000140000300ULL
-
-/* EMAC location */
-#define PPC440GP_EMAC0_ADDR	0x0000000140000800ULL
-#define PPC440GP_EMAC1_ADDR	0x0000000140000900ULL
-#define PPC440GP_EMAC_SIZE	0x70
-
-/* EMAC IRQ's */
-#define BL_MAC_WOL	61	/* WOL */
-#define BL_MAC_WOL1	63	/* WOL */
-#define BL_MAL_SERR	32	/* MAL SERR */
-#define BL_MAL_TXDE	33	/* MAL TXDE */
-#define BL_MAL_RXDE	34	/* MAL RXDE */
-#define BL_MAL_TXEOB	10	/* MAL TX EOB */
-#define BL_MAL_RXEOB	11	/* MAL RX EOB */
-#define BL_MAC_ETH0	60	/* MAC */
-#define BL_MAC_ETH1	62	/* MAC */
-
-/* ZMII location */
-#define PPC440GP_ZMII_ADDR	0x0000000140000780ULL
-#define PPC440GP_ZMII_SIZE	0x0c
-
-/* I2C location */
-#define PPC440GP_IIC0_ADDR	0x40000400
-#define PPC440GP_IIC1_ADDR	0x40000500
-
-/* GPIO location */
-#define PPC440GP_GPIO0_ADDR	0x0000000140000700ULL
+#define UART0_INT		0
+#define UART1_INT		1
 
 /* Clock and Power Management */
 #define IBM_CPM_IIC0		0x80000000	/* IIC interface */
@@ -87,9 +54,6 @@
 				| IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \
 				| IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \
 				| IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI)
-
-#define PPC440GP_OPB_BASE_START	0x0000000140000000ULL
-
 /*
  * Serial port defines
  */
diff --git a/arch/ppc/platforms/4xx/ibm440gx.c b/arch/ppc/platforms/4xx/ibm440gx.c
index 42677b8b1..c23db3d72 100644
--- a/arch/ppc/platforms/4xx/ibm440gx.c
+++ b/arch/ppc/platforms/4xx/ibm440gx.c
@@ -1,11 +1,13 @@
 /*
- * arch/ppc/platforms/ibm440gx.c
+ * arch/ppc/platforms/4xx/ibm440gx.c
  *
  * PPC440GX I/O descriptions
  *
  * Matt Porter <mporter@mvista.com>
+ * Copyright 2002-2004 MontaVista Software Inc.
  *
- * Copyright 2002-2003 MontaVista Software Inc.
+ * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
+ * Copyright (c) 2003, 2004 Zultys Technologies
  *
  * 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
@@ -13,25 +15,203 @@
  * option) any later version.
  *
  */
-
-#include <linux/config.h>
 #include <linux/init.h>
-#include <linux/smp.h>
-#include <linux/threads.h>
-#include <linux/param.h>
-#include <linux/string.h>
-#include <asm/ocp.h>
+#include <linux/module.h>
 #include <platforms/4xx/ibm440gx.h>
+#include <asm/ocp.h>
+
+static struct ocp_func_emac_data ibm440gx_emac0_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx       = 0,            /* ZMII device index */
+	.zmii_mux       = 0,            /* ZMII input of this EMAC */
+	.mal_idx        = 0,            /* MAL device index */
+	.mal_rx_chan    = 0,            /* MAL rx channel number */
+	.mal_tx_chan    = 0,            /* MAL tx channel number */
+	.wol_irq        = 61,   	/* WOL interrupt number */
+	.mdio_idx       = -1,           /* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+
+static struct ocp_func_emac_data ibm440gx_emac1_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx       = 0,            /* ZMII device index */
+	.zmii_mux       = 1,            /* ZMII input of this EMAC */
+	.mal_idx        = 0,            /* MAL device index */
+	.mal_rx_chan    = 1,            /* MAL rx channel number */
+	.mal_tx_chan    = 1,            /* MAL tx channel number */
+	.wol_irq        = 63,  		/* WOL interrupt number */
+	.mdio_idx       = -1,           /* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+
+static struct ocp_func_emac_data ibm440gx_emac2_def = {
+	.rgmii_idx	= 0,		/* RGMII device index */
+	.rgmii_mux	= 0,		/* RGMII input of this EMAC */
+	.zmii_idx       = 0,            /* ZMII device index */
+	.zmii_mux       = 2,            /* ZMII input of this EMAC */
+	.mal_idx        = 0,            /* MAL device index */
+	.mal_rx_chan    = 2,            /* MAL rx channel number */
+	.mal_tx_chan    = 2,            /* MAL tx channel number */
+	.wol_irq        = 65,  		/* WOL interrupt number */
+	.mdio_idx       = -1,           /* No shared MDIO */
+	.tah_idx	= 0,		/* TAH device index */
+	.jumbo		= 1,		/* Jumbo frames supported */
+};
+
+static struct ocp_func_emac_data ibm440gx_emac3_def = {
+	.rgmii_idx	= 0,		/* RGMII device index */
+	.rgmii_mux	= 1,		/* RGMII input of this EMAC */
+	.zmii_idx       = 0,            /* ZMII device index */
+	.zmii_mux       = 3,            /* ZMII input of this EMAC */
+	.mal_idx        = 0,            /* MAL device index */
+	.mal_rx_chan    = 3,            /* MAL rx channel number */
+	.mal_tx_chan    = 3,            /* MAL tx channel number */
+	.wol_irq        = 67,  		/* WOL interrupt number */
+	.mdio_idx       = -1,           /* No shared MDIO */
+	.tah_idx	= 1,		/* TAH device index */
+	.jumbo		= 1,		/* Jumbo frames supported */
+};
+OCP_SYSFS_EMAC_DATA()
+
+static struct ocp_func_mal_data ibm440gx_mal0_def = {
+	.num_tx_chans   = 4,    	/* Number of TX channels */
+	.num_rx_chans   = 4,    	/* Number of RX channels */
+	.txeob_irq	= 10,		/* TX End Of Buffer IRQ  */
+	.rxeob_irq	= 11,		/* RX End Of Buffer IRQ  */
+	.txde_irq	= 33,		/* TX Descriptor Error IRQ */
+	.rxde_irq	= 34,		/* RX Descriptor Error IRQ */
+	.serr_irq	= 32,		/* MAL System Error IRQ    */
+};
+OCP_SYSFS_MAL_DATA()
+
+static struct ocp_func_iic_data ibm440gx_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+
+static struct ocp_func_iic_data ibm440gx_iic1_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+OCP_SYSFS_IIC_DATA()
 
-struct ocp_def core_ocp[] __initdata = {
-	{OCP_VENDOR_IBM, OCP_FUNC_OPB, PPC440GX_OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GX_UART0_ADDR, UART0_IRQ, IBM_CPM_UART0},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, PPC440GX_UART1_ADDR, UART1_IRQ, IBM_CPM_UART1},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GX_IIC0_ADDR, IIC0_IRQ, IBM_CPM_IIC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, PPC440GX_IIC1_ADDR, IIC1_IRQ, IBM_CPM_IIC1},
-	{OCP_VENDOR_IBM, OCP_FUNC_GPIO, PPC440GX_GPIO0_ADDR, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GX_EMAC0_ADDR, BL_MAC_ETH0, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, PPC440GX_EMAC1_ADDR, BL_MAC_ETH1, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_ZMII, PPC440GX_ZMII_ADDR, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+struct ocp_def core_ocp[] = {
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_OPB,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000000ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= PPC440GX_UART0_ADDR,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= PPC440GX_UART1_ADDR,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000400ULL,
+	  .irq		= 2,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibm440gx_iic0_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .index	= 1,
+	  .paddr	= 0x0000000140000500ULL,
+	  .irq		= 3,
+	  .pm		= IBM_CPM_IIC1,
+	  .additions	= &ibm440gx_iic1_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000700ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_MAL,
+	  .paddr	= OCP_PADDR_NA,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gx_mal0_def,
+	  .show		= &ocp_show_mal_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000800ULL,
+	  .irq		= 60,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gx_emac0_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 1,
+	  .paddr	= 0x0000000140000900ULL,
+	  .irq		= 62,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gx_emac1_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 2,
+	  .paddr	= 0x0000000140000C00ULL,
+	  .irq		= 64,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gx_emac2_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 3,
+	  .paddr	= 0x0000000140000E00ULL,
+	  .irq		= 66,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibm440gx_emac3_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_RGMII,
+	  .paddr	= 0x0000000140000790ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_ZMII,
+	  .paddr	= 0x0000000140000780ULL,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_TAH,
+	  .index	= 0,
+	  .paddr	= 0x0000000140000b50ULL,
+	  .irq		= 68,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_TAH,
+	  .index	= 1,
+	  .paddr	= 0x0000000140000d50ULL,
+	  .irq		= 69,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ibm440gx.h b/arch/ppc/platforms/4xx/ibm440gx.h
index 50c16a01d..0b59d8dcd 100644
--- a/arch/ppc/platforms/4xx/ibm440gx.h
+++ b/arch/ppc/platforms/4xx/ibm440gx.h
@@ -26,53 +26,8 @@
 /* UART */
 #define PPC440GX_UART0_ADDR	0x0000000140000200ULL
 #define PPC440GX_UART1_ADDR	0x0000000140000300ULL
-#define UART0_IRQ		0
-#define UART1_IRQ		1
-
-/* EMAC */
-#define PPC440GX_EMAC0_ADDR	0x0000000140000800ULL
-#define PPC440GX_EMAC1_ADDR	0x0000000140000900ULL
-#define PPC440GX_EMAC2_ADDR	0x0000000140000C00ULL
-#define PPC440GX_EMAC3_ADDR	0x0000000140000E00ULL
-#define PPC440GX_EMAC_SIZE	0xFC
-#define EMAC_NUMS               2
-#define BL_MAC_WOL	61	/* WOL */
-#define BL_MAC_WOL1	63	/* WOL */
-#define BL_MAC_WOL2	65	/* WOL */
-#define BL_MAC_WOL3	67	/* WOL */
-#define BL_MAL_SERR	32	/* MAL SERR */
-#define BL_MAL_TXDE	33	/* MAL TXDE */
-#define BL_MAL_RXDE	34	/* MAL RXDE */
-#define BL_MAL_TXEOB	10	/* MAL TX EOB */
-#define BL_MAL_RXEOB	11	/* MAL RX EOB */
-#define BL_MAC_ETH0	60	/* MAC */
-#define BL_MAC_ETH1	62	/* MAC */
-#define BL_MAC_ETH2	64	/* MAC */
-#define BL_MAC_ETH3	66	/* MAC */
-#define BL_TAH0		68	/* TAH 0 */
-#define BL_TAH1		69	/* TAH 1 */
-
-/* TAH */
-#define PPC440GX_TAH0_ADDR	0x0000000140000B00ULL
-#define PPC440GX_TAH1_ADDR	0x0000000140000D00ULL
-#define PPC440GX_TAH_SIZE	0xFC
-
-/* ZMII */
-#define PPC440GX_ZMII_ADDR	0x0000000140000780ULL
-#define PPC440GX_ZMII_SIZE	0x0c
-
-/* RGMII */
-#define PPC440GX_RGMII_ADDR	0x0000000140000790ULL
-#define PPC440GX_RGMII_SIZE	0x0c
-
-/* IIC  */
-#define PPC440GX_IIC0_ADDR	0x40000400
-#define PPC440GX_IIC1_ADDR	0x40000500
-#define IIC0_IRQ		2
-#define IIC1_IRQ		3
-
-/* GPIO */
-#define PPC440GX_GPIO0_ADDR	0x0000000140000700ULL
+#define UART0_INT		0
+#define UART1_INT		1
 
 /* Clock and Power Management */
 #define IBM_CPM_IIC0		0x80000000	/* IIC interface */
@@ -110,10 +65,6 @@
 				| IBM_CPM_TAHOE0 | IBM_CPM_TAHOE1 \
 				| IBM_CPM_EMAC0 | IBM_CPM_EMAC1 \
 			  	| IBM_CPM_EMAC2 | IBM_CPM_EMAC3 )
-
-/* OPB */
-#define PPC440GX_OPB_BASE_START	0x0000000140000000ULL
-
 /*
  * Serial port defines
  */
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.c b/arch/ppc/platforms/4xx/ibmnp405h.c
index 09dfe0d1a..ecdc5be6a 100644
--- a/arch/ppc/platforms/4xx/ibmnp405h.c
+++ b/arch/ppc/platforms/4xx/ibmnp405h.c
@@ -14,21 +14,159 @@
 #include <asm/ocp.h>
 #include <platforms/4xx/ibmnp405h.h>
 
+static struct ocp_func_emac_data ibmnp405h_emac0_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx	= 0,		/* ZMII device index */
+	.zmii_mux	= 0,		/* ZMII input of this EMAC */
+	.mal_idx	= 0,		/* MAL device index */
+	.mal_rx_chan	= 0,		/* MAL rx channel number */
+	.mal_tx_chan	= 0,		/* MAL tx channel number */
+	.wol_irq	= 41,		/* WOL interrupt number */
+	.mdio_idx	= -1,		/* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+
+static struct ocp_func_emac_data ibmnp405h_emac1_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx	= 0,		/* ZMII device index */
+	.zmii_mux	= 1,		/* ZMII input of this EMAC */
+	.mal_idx	= 0,		/* MAL device index */
+	.mal_rx_chan	= 1,		/* MAL rx channel number */
+	.mal_tx_chan	= 1,		/* MAL tx channel number */
+	.wol_irq	= 41,		/* WOL interrupt number */
+	.mdio_idx	= -1,		/* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+static struct ocp_func_emac_data ibmnp405h_emac2_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx	= 0,		/* ZMII device index */
+	.zmii_mux	= 2,		/* ZMII input of this EMAC */
+	.mal_idx	= 0,		/* MAL device index */
+	.mal_rx_chan	= 2,		/* MAL rx channel number */
+	.mal_tx_chan	= 2,		/* MAL tx channel number */
+	.wol_irq	= 41,		/* WOL interrupt number */
+	.mdio_idx	= -1,		/* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+static struct ocp_func_emac_data ibmnp405h_emac3_def = {
+	.rgmii_idx	= -1,		/* No RGMII */
+	.rgmii_mux	= -1,		/* No RGMII */
+	.zmii_idx	= 0,		/* ZMII device index */
+	.zmii_mux	= 3,		/* ZMII input of this EMAC */
+	.mal_idx	= 0,		/* MAL device index */
+	.mal_rx_chan	= 3,		/* MAL rx channel number */
+	.mal_tx_chan	= 3,		/* MAL tx channel number */
+	.wol_irq	= 41,		/* WOL interrupt number */
+	.mdio_idx	= -1,		/* No shared MDIO */
+	.tah_idx	= -1,		/* No TAH */
+};
+OCP_SYSFS_EMAC_DATA()
+
+static struct ocp_func_mal_data ibmnp405h_mal0_def = {
+	.num_tx_chans	= 8,		/* Number of TX channels */
+	.num_rx_chans	= 4,		/* Number of RX channels */
+	.txeob_irq	= 17,		/* TX End Of Buffer IRQ  */
+	.rxeob_irq	= 18,		/* RX End Of Buffer IRQ  */
+	.txde_irq	= 46,		/* TX Descriptor Error IRQ */
+	.rxde_irq	= 47,		/* RX Descriptor Error IRQ */
+	.serr_irq	= 45,		/* MAL System Error IRQ    */
+};
+OCP_SYSFS_MAL_DATA()
+
+static struct ocp_func_iic_data ibmnp405h_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+OCP_SYSFS_IIC_DATA()
 
 struct ocp_def core_ocp[] = {
-//	{OCP_VENDOR_IBM, OCP_FUNC_PLB, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_OPB, OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART0_IO_BASE, UART0_INT,IBM_CPM_UART0},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART1_IO_BASE, UART1_INT, IBM_CPM_UART1},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, IIC0_BASE, IIC0_IRQ, IBM_CPM_IIC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_GPIO, GPIO0_BASE, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC0_BASE, BL_MAC_ETH0, IBM_CPM_EMAC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC0_BASE, BL_MAC_ETH0, IBM_CPM_EMAC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC1_BASE, BL_MAC_ETH1, IBM_CPM_EMAC1},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC2_BASE, BL_MAC_ETH2, IBM_CPM_EMAC2},
-	{OCP_VENDOR_IBM, OCP_FUNC_EMAC, EMAC3_BASE, BL_MAC_ETH3, IBM_CPM_EMAC3},
-	{OCP_VENDOR_IBM, OCP_FUNC_PHY, ZMII0_BASE, OCP_IRQ_NA, OCP_CPM_NA},
-//	{OCP_VENDOR_IBM, OCP_FUNC_EXT, EBIU_BASE_START, OCP_IRQ_NA,IBM_CPM_EBC},
-//	{OCP_VENDOR_IBM, OCP_FUNC_PCI, PCIL0_BASE, OCP_IRQ_NA, IBM_CPM_PCI},
-	{OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_OPB,
+	  .index	= 0,
+	  .paddr	= 0xEF600000,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= UART0_IO_BASE,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= UART1_IO_BASE,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .paddr	= 0xEF600500,
+	  .irq		= 2,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibmnp405h_iic0_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .paddr	= 0xEF600700,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_MAL,
+	  .paddr	= OCP_PADDR_NA,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	  .additions	= &ibmnp405h_mal0_def,
+	  .show		= &ocp_show_mal_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 0,
+	  .paddr	= EMAC0_BASE,
+	  .irq		= 37,
+	  .pm		= IBM_CPM_EMAC0,
+	  .additions	= &ibmnp405h_emac0_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 1,
+	  .paddr	= 0xEF600900,
+	  .irq		= 38,
+	  .pm		= IBM_CPM_EMAC1,
+	  .additions	= &ibmnp405h_emac1_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 2,
+	  .paddr	= 0xEF600a00,
+	  .irq		= 39,
+	  .pm		= IBM_CPM_EMAC2,
+	  .additions	= &ibmnp405h_emac2_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_EMAC,
+	  .index	= 3,
+	  .paddr	= 0xEF600b00,
+	  .irq		= 40,
+	  .pm		= IBM_CPM_EMAC3,
+	  .additions	= &ibmnp405h_emac3_def,
+	  .show		= &ocp_show_emac_data,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_ZMII,
+	  .paddr	= 0xEF600C10,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.h b/arch/ppc/platforms/4xx/ibmnp405h.h
index d1566b01f..07a48aa82 100644
--- a/arch/ppc/platforms/4xx/ibmnp405h.h
+++ b/arch/ppc/platforms/4xx/ibmnp405h.h
@@ -14,7 +14,6 @@
 #define __ASM_IBMNP405H_H__
 
 #include <linux/config.h>
-#include <asm/ibm_ocp.h>
 
 /* ibm405.h at bottom of this file */
 
@@ -42,9 +41,6 @@
 #define PPC4xx_ONB_IO_ADDR	((uint)0xef600000)
 #define PPC4xx_ONB_IO_SIZE	((uint)4*1024)
 
-#define OPB_BASE_START	0x40000000
-#define EBIU_BASE_START	0xF0100000
-
 /* serial port defines */
 #define RS_TABLE_SIZE	4
 
@@ -53,27 +49,8 @@
 #define PCIL0_BASE	0xEF400000
 #define UART0_IO_BASE	0xEF600300
 #define UART1_IO_BASE	0xEF600400
-#define IIC0_BASE	0xEF600500
 #define OPB0_BASE	0xEF600600
-#define GPIO0_BASE	0xEF600700
 #define EMAC0_BASE	0xEF600800
-#define EMAC1_BASE	0xEF600900
-#define EMAC2_BASE	0xEF600a00
-#define EMAC3_BASE	0xEF600b00
-#define ZMII0_BASE	0xEF600C10
-#define BL_MAC_WOL	41 	/* WOL */
-#define BL_MAL_SERR	45	/* MAL SERR */
-#define BL_MAL_TXDE	46	/* MAL TXDE */
-#define BL_MAL_RXDE	47	/* MAL RXDE */
-#define BL_MAL_TXEOB	17	/* MAL TX EOB */
-#define BL_MAL_RXEOB	18	/* MAL RX EOB */
-#define BL_MAC_ETH0	37	/* MAC */
-#define BL_MAC_ETH1	38	/* MAC */
-#define BL_MAC_ETH2	39	/* MAC */
-#define BL_MAC_ETH3	40	/* MAC */
-
-#define EMAC_NUMS	4
-#define IIC0_IRQ	2
 
 #define BD_EMAC_ADDR(e,i) bi_enetaddr[e][i]
 
diff --git a/arch/ppc/platforms/4xx/ibmstb4.c b/arch/ppc/platforms/4xx/ibmstb4.c
index 2fed8f19c..874d16bab 100644
--- a/arch/ppc/platforms/4xx/ibmstb4.c
+++ b/arch/ppc/platforms/4xx/ibmstb4.c
@@ -9,19 +9,75 @@
  * or implied.
  */
 
-#include <linux/config.h>
-#include <linux/module.h>
-#include "ibmstb4.h"
+#include <linux/init.h>
 #include <asm/ocp.h>
+#include <platforms/4xx/ibmstb4.h>
 
-struct ocp_def core_ocp[] = {
-	{UART, UART0_IO_BASE, UART0_INT,IBM_CPM_UART0},
-	{UART, UART1_IO_BASE, UART1_INT, IBM_CPM_UART1},
-	{UART, UART2_IO_BASE, UART2_INT, IBM_CPM_UART2},
-	{IIC, IIC0_BASE, IIC0_IRQ, IBM_CPM_IIC0},
-	{IIC, IIC1_BASE, IIC1_IRQ, IBM_CPM_IIC1},
-	{GPIO, GPIO0_BASE, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{IDE, IDE0_BASE, IDE0_IRQ, OCP_CPM_NA},
-	{USB, USB0_BASE, USB0_IRQ, IBM_CPM_USB0},
-	{OCP_NULL_TYPE, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+static struct ocp_func_iic_data ibmstb4_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+
+static struct ocp_func_iic_data ibmstb4_iic1_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+OCP_SYSFS_IIC_DATA()
+
+struct ocp_def core_ocp[] __initdata = {
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= UART0_IO_BASE,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= UART1_IO_BASE,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 2,
+	  .paddr	= UART2_IO_BASE,
+	  .irq		= UART2_INT,
+	  .pm		= IBM_CPM_UART2,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .paddr	= IIC0_BASE,
+	  .irq		= IIC0_IRQ,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibmstb4_iic0_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .paddr	= IIC1_BASE,
+	  .irq		= IIC1_IRQ,
+	  .pm		= IBM_CPM_IIC1,
+	  .additions	= &ibmstb4_iic1_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .paddr	= GPIO0_BASE,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IDE,
+	  .paddr	= IDE0_BASE,
+	  .irq		= IDE0_IRQ,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_USB,
+	  .paddr	= USB0_BASE,
+	  .irq		= USB0_IRQ,
+	  .pm		= OCP_CPM_NA,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID,
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ibmstb4.h b/arch/ppc/platforms/4xx/ibmstb4.h
index 367012fa0..bcb4b1ee7 100644
--- a/arch/ppc/platforms/4xx/ibmstb4.h
+++ b/arch/ppc/platforms/4xx/ibmstb4.h
@@ -14,7 +14,6 @@
 #define __ASM_IBMSTB4_H__
 
 #include <linux/config.h>
-#include <platforms/4xx/ibm_ocp.h>
 
 /* serial port defines */
 #define STB04xxx_IO_BASE	((uint)0xe0000000)
diff --git a/arch/ppc/platforms/4xx/ibmstbx25.c b/arch/ppc/platforms/4xx/ibmstbx25.c
index 894254446..eb17f025f 100644
--- a/arch/ppc/platforms/4xx/ibmstbx25.c
+++ b/arch/ppc/platforms/4xx/ibmstbx25.c
@@ -9,22 +9,51 @@
  * or implied.
  */
 
-#include <linux/config.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <asm/ocp.h>
-#include "ibmstbx25.h"
+#include <platforms/4xx/ibmstbx25.h>
 
-struct ocp_def core_ocp[]  __initdata = {
-	{OCP_VENDOR_IBM, OCP_FUNC_PLB, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_OPB, OPB_BASE_START, OCP_IRQ_NA, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART0_IO_BASE, UART0_INT,IBM_CPM_UART0},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART1_IO_BASE, UART1_INT, IBM_CPM_UART1},
-	{OCP_VENDOR_IBM, OCP_FUNC_16550, UART2_IO_BASE,UART2_INT, IBM_CPM_UART2},
-	{OCP_VENDOR_IBM, OCP_FUNC_IIC, IIC0_BASE, IIC0_IRQ, IBM_CPM_IIC0},
-	{OCP_VENDOR_IBM, OCP_FUNC_GPIO, GPIO0_BASE, OCP_IRQ_NA, IBM_CPM_GPIO0},
-	{OCP_VENDOR_IBM, OCP_FUNC_IDE, IDE0_BASE, IDE0_IRQ, OCP_CPM_NA},
-	{OCP_VENDOR_IBM, OCP_FUNC_EXT, EBIU_BASE_START, OCP_IRQ_NA,IBM_CPM_EBIU},
-	{OCP_VENDOR_INVALID, OCP_FUNC_INVALID, 0x0, OCP_IRQ_NA, OCP_CPM_NA},
+static struct ocp_func_iic_data ibmstbx25_iic0_def = {
+	.fast_mode	= 0,		/* Use standad mode (100Khz) */
+};
+OCP_SYSFS_IIC_DATA()
 
+struct ocp_def core_ocp[] __initdata = {
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index        = 0,
+	  .paddr	= UART0_IO_BASE,
+	  .irq		= UART0_INT,
+	  .pm		= IBM_CPM_UART0,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= UART1_IO_BASE,
+	  .irq		= UART1_INT,
+	  .pm		= IBM_CPM_UART1,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 2,
+	  .paddr	= UART2_IO_BASE,
+	  .irq		= UART2_INT,
+	  .pm		= IBM_CPM_UART2,
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_IIC,
+	  .paddr	= IIC0_BASE,
+	  .irq		= IIC0_IRQ,
+	  .pm		= IBM_CPM_IIC0,
+	  .additions	= &ibmstbx25_iic0_def,
+	  .show		= &ocp_show_iic_data
+	},
+	{ .vendor	= OCP_VENDOR_IBM,
+	  .function	= OCP_FUNC_GPIO,
+	  .paddr	= GPIO0_BASE,
+	  .irq		= OCP_IRQ_NA,
+	  .pm		= IBM_CPM_GPIO0,
+	},
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
 };
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index af6fa5686..6376890e3 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -41,16 +41,23 @@
 #include <asm/dma.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
+#include <asm/ocp.h>
 #include <asm/pci-bridge.h>
 #include <asm/time.h>
 #include <asm/todc.h>
 #include <asm/bootinfo.h>
 #include <asm/ppc4xx_pic.h>
 
-extern void abort(void);
+#include <syslib/ibm440gx_common.h>
 
-/* Global Variables */
-bd_t __res;
+/*
+ * This is a horrible kludge, we eventually need to abstract this
+ * generic PHY stuff, so the  standard phy mode defines can be
+ * easily used from arch code.
+ */
+#include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h"
+
+extern void abort(void);
 
 static void __init
 ocotea_calibrate_decr(void)
@@ -202,15 +209,15 @@ ocotea_setup_hose(void)
 TODC_ALLOC();
 
 static void __init
-ocotea_early_serial_map(void)
+ocotea_early_serial_map(const struct ibm44x_clocks *clks)
 {
 	struct uart_port port;
 
 	/* Setup ioremapped serial port access */
 	memset(&port, 0, sizeof(port));
 	port.membase = ioremap64(PPC440GX_UART0_ADDR, 8);
-	port.irq = 0;
-	port.uartclk = BASE_BAUD * 16;
+	port.irq = UART0_INT;
+	port.uartclk = clks->uart0;
 	port.regshift = 0;
 	port.iotype = SERIAL_IO_MEM;
 	port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
@@ -221,7 +228,8 @@ ocotea_early_serial_map(void)
 	}
 
 	port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
-	port.irq = 1;
+	port.irq = UART1_INT;
+	port.uartclk = clks->uart1;
 	port.line = 1;
 
 	if (early_serial_setup(&port) != 0) {
@@ -234,15 +242,42 @@ ocotea_setup_arch(void)
 {
 	unsigned char *addr;
 	unsigned long long mac64;
+	struct ocp_def *def;
+	struct ocp_func_emac_data *emacdata;
+	int i;
+	struct ibm44x_clocks clocks;
 
-	/* Retrieve MAC addresses from flash */
+	/*
+	 * Note: Current rev. board only operates in Group 4a
+	 * mode, so we always set EMAC0-1 for SMII and EMAC2-3
+	 * for RGMII (though these could run in RTBI just the same).
+	 *
+	 * The FPGA reg 3 information isn't even suitable for
+	 * determining the phy_mode, so if the board becomes
+	 * usable in !4a, it will be necessary to parse an environment
+	 * variable from the firmware or similar to properly configure
+	 * the phy_map/phy_mode.
+	 */
+	/* Set phy_map, phy_mode, and mac_addr for each EMAC */
 	addr = ioremap64(OCOTEA_MAC_BASE, OCOTEA_MAC_SIZE);
-	mac64 = simple_strtoull(addr, 0, 16);
-	memcpy(__res.bi_enetaddr[0], (char *)&mac64+2, 6);
-	mac64 = simple_strtoull(addr+OCOTEA_MAC1_OFFSET, 0, 16);
-	memcpy(__res.bi_enetaddr[1], (char *)&mac64+2, 6);
+	for (i=0; i<4; i++) {
+		mac64 = simple_strtoull(addr+OCOTEA_MAC_OFFSET*i, 0, 16);
+		def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i);
+		emacdata = def->additions;
+		if (i < 2) {
+			emacdata->phy_map = 0x00000001;	/* Skip 0x00 */
+			emacdata->phy_mode = PHY_MODE_SMII;
+		}
+		else {
+			emacdata->phy_map = 0x0000ffff; /* Skip 0x00-0x0f */
+			emacdata->phy_mode = PHY_MODE_RGMII;
+		}
+		memcpy(emacdata->mac_addr, (char *)&mac64+2, 6);
+	}
 	iounmap(addr);
 
+	ibm440gx_tah_enable();
+
 #if !defined(CONFIG_BDI_SWITCH)
 	/*
 	 * The Abatron BDI JTAG debugger does not tolerate others
@@ -251,6 +286,15 @@ ocotea_setup_arch(void)
         mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
 #endif
 
+	/*
+	 * Determine various clocks.
+	 * To be completely correct we should get SysClk
+	 * from FPGA, because it can be changed by on-board switches
+	 * --ebs
+	 */
+	ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
+	ocp_sys_info.opb_bus_freq = clocks.opb;
+
 	/* Setup TODC access */
 	TODC_INIT(TODC_TYPE_DS1743,
 			0,
@@ -279,7 +323,7 @@ ocotea_setup_arch(void)
 	conswitchp = &dummy_con;
 #endif
 
-	ocotea_early_serial_map();
+	ocotea_early_serial_map(&clocks);
 
 	/* Identify the system */
 	printk("IBM Ocotea port (MontaVista Software, Inc. <source@mvista.com>)\n");
@@ -370,9 +414,6 @@ ocotea_init_irq(void)
 {
 	int i;
 
-	/* Enable PPC440GP interrupt compatibility mode */
-	SDR_WRITE(DCRN_SDR_MFR,SDR_READ(DCRN_SDR_MFR) | DCRN_SDR_MFR_PCM);
-
 	ppc4xx_pic_init();
 
 	for (i = 0; i < NR_IRQS; i++)
@@ -431,6 +472,9 @@ void __init platform_init(unsigned long r3, unsigned long r4,
 {
 	parse_bootinfo((struct bi_record *) (r3 + KERNELBASE));
 
+	/* Disable L2-Cache due to hardware issues */
+	ibm440gx_l2c_disable();
+
 	ppc_md.setup_arch = ocotea_setup_arch;
 	ppc_md.show_cpuinfo = ocotea_show_cpuinfo;
 	ppc_md.init_IRQ = ocotea_init_irq;
diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
index 2f2b5ab2f..17fe8dada 100644
--- a/arch/ppc/platforms/4xx/ocotea.h
+++ b/arch/ppc/platforms/4xx/ocotea.h
@@ -25,9 +25,9 @@
 #define PPC44x_EMAC0_MR0	0xE0000800
 
 /* Location of MAC addresses in firmware */
-#define OCOTEA_MAC_BASE		(OCOTEA_SMALL_FLASH_HIGH+0xc0500)
+#define OCOTEA_MAC_BASE		(OCOTEA_SMALL_FLASH_HIGH+0xb0500)
 #define OCOTEA_MAC_SIZE		0x200
-#define OCOTEA_MAC1_OFFSET	0x100
+#define OCOTEA_MAC_OFFSET	0x100
 
 /* Default clock rate */
 #define OCOTEA_SYSCLK		25000000
@@ -37,7 +37,7 @@
 #define OCOTEA_RTC_SIZE		0x2000
 
 /* Flash */
-#define OCOTEA_FPGA_ADDR		0x0000000148300000ULL
+#define OCOTEA_FPGA_REG_0		0x0000000148300000ULL
 #define OCOTEA_BOOT_LARGE_FLASH(x)	(x & 0x40)
 #define OCOTEA_SMALL_FLASH_LOW		0x00000001ff900000ULL
 #define OCOTEA_SMALL_FLASH_HIGH		0x00000001fff00000ULL
@@ -46,6 +46,9 @@
 #define OCOTEA_LARGE_FLASH_HIGH		0x00000001ffc00000ULL
 #define OCOTEA_LARGE_FLASH_SIZE		0x400000
 
+/* FPGA_REG_3 (Ethernet Groups) */
+#define OCOTEA_FPGA_REG_3		0x0000000148300003ULL
+
 /*
  * Serial port defines
  */
@@ -57,7 +60,7 @@
 
 #define BASE_BAUD	11059200/16
 #define STD_UART_OP(num)					\
-	{ 0, BASE_BAUD, 0, UART##num##_IRQ,			\
+	{ 0, BASE_BAUD, 0, UART##num##_INT,			\
 		(ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST),	\
 		iomem_base: UART##num##_IO_BASE,		\
 		io_type: SERIAL_IO_MEM},
diff --git a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c
index f47cc7f15..85f0a0f82 100644
--- a/arch/ppc/platforms/4xx/redwood5.c
+++ b/arch/ppc/platforms/4xx/redwood5.c
@@ -20,8 +20,6 @@
 void __init
 redwood5_setup_arch(void)
 {
-	bd_t *bip = &__res;
-
 	ppc4xx_setup_arch();
 
 #ifdef CONFIG_DEBUG_BRINGUP
diff --git a/arch/ppc/platforms/4xx/sycamore.c b/arch/ppc/platforms/4xx/sycamore.c
index 862498962..d5e5077cf 100644
--- a/arch/ppc/platforms/4xx/sycamore.c
+++ b/arch/ppc/platforms/4xx/sycamore.c
@@ -28,6 +28,7 @@
 #include <asm/page.h>
 #include <asm/time.h>
 #include <asm/io.h>
+#include <asm/ibm_ocp_pci.h>
 #include <asm/todc.h>
 
 #undef DEBUG
@@ -119,6 +120,8 @@ sycamore_setup_arch(void)
 
 	ppc4xx_setup_arch();
 
+	ibm_ocp_set_emac(0, 1);
+
 	kb_data = ioremap(SYCAMORE_PS2_BASE, 8);
 	if (!kb_data) {
 		printk(KERN_CRIT
@@ -218,21 +221,25 @@ bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
 						(PPC405_PCI_UPPER_MEM -
 						 PPC405_PCI_MEM_BASE)) | 0x01));
 
-	/* Disable region one */
+	/* Enable inbound region one - 1GB size */
+	out_le32((void *) &(pcip->ptm1ms), 0xc0000001);
+
+	/* Disable outbound region one */
 	out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
 	out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
 	out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
 	out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
 	out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
-	out_le32((void *) &(pcip->ptm1ms), 0x00000000);
 
-	/* Disable region two */
+	/* Disable inbound region two */
+	out_le32((void *) &(pcip->ptm2ms), 0x00000000);
+
+	/* Disable outbound region two */
 	out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
 	out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
 	out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
 	out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
 	out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
-	out_le32((void *) &(pcip->ptm2ms), 0x00000000);
 
 	/* Zero config bars */
 	for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
@@ -283,9 +290,11 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	ppc_md.setup_arch = sycamore_setup_arch;
 	ppc_md.setup_io_mappings = sycamore_map_io;
 
+#ifdef CONFIG_GEN_RTC
 	ppc_md.time_init = todc_time_init;
 	ppc_md.set_rtc_time = todc_set_rtc_time;
 	ppc_md.get_rtc_time = todc_get_rtc_time;
 	ppc_md.nvram_read_val = todc_direct_read_val;
 	ppc_md.nvram_write_val = todc_direct_write_val;
+#endif
 }
diff --git a/arch/ppc/platforms/4xx/walnut.c b/arch/ppc/platforms/4xx/walnut.c
index f0ac89862..a33eda4b7 100644
--- a/arch/ppc/platforms/4xx/walnut.c
+++ b/arch/ppc/platforms/4xx/walnut.c
@@ -28,6 +28,7 @@
 #include <asm/page.h>
 #include <asm/time.h>
 #include <asm/io.h>
+#include <asm/ocp.h>
 #include <asm/ibm_ocp_pci.h>
 #include <asm/todc.h>
 
@@ -78,6 +79,8 @@ walnut_setup_arch(void)
 
 	ppc4xx_setup_arch();
 
+	ibm_ocp_set_emac(0, 0);
+
 	kb_data = ioremap(WALNUT_PS2_BASE, 8);
 	if (!kb_data) {
 		printk(KERN_CRIT
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index 31f2d3067..6f0c42645 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_PPLUS)		+= pplus.o
 obj-$(CONFIG_PRPMC750)		+= prpmc750.o
 obj-$(CONFIG_PRPMC800)		+= prpmc800.o
 obj-$(CONFIG_SANDPOINT)		+= sandpoint.o
+obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
 obj-$(CONFIG_SPRUCE)		+= spruce.o
 
 ifeq ($(CONFIG_SMP),y)
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
index 493f4a2ac..abd06fc82 100644
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -1156,7 +1156,7 @@ core99_usb_enable(struct device_node* node, long param, long value)
 			(void)MACIO_IN32(KEYLARGO_FCR1);
 			mdelay(1);
 			LOCK(flags);
-			MACIO_BIS(KEYLARGO_FCR0, KL1_USB2_CELL_ENABLE);
+			MACIO_BIS(KEYLARGO_FCR1, KL1_USB2_CELL_ENABLE);
 		}
 		if (number < 4) {
 			reg = MACIO_IN32(KEYLARGO_FCR4);
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
index 1c8f3008c..fd46bb98d 100644
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -260,7 +260,7 @@ pmac_fix_gatwick_interrupts(struct device_node *gw, int irq_base)
 					node->child->intrs = &gatwick_int_pool[count];
 					count += 3;
 				}
-				node->child->n_intrs = 3;			
+				node->child->n_intrs = 3;
 				node->child->intrs[0].line = 15+irq_base;
 				node->child->intrs[1].line =  4+irq_base;
 				node->child->intrs[2].line =  5+irq_base;
@@ -279,7 +279,7 @@ pmac_fix_gatwick_interrupts(struct device_node *gw, int irq_base)
 			node->intrs[0].line = 29+irq_base;
 			printk(KERN_INFO "irq: fixed media-bay on second controller (%d)\n",
 					node->intrs[0].line);
-		
+
 			ya_node = node->child;
 			while(ya_node)
 			{
@@ -501,7 +501,7 @@ void __init pmac_pic_init(void)
 				pmac_irq_hw[i] = (volatile struct pmac_irq_hw*)
 					(addr + (2 - i) * 0x10);
 		}
-	
+
 		/* get addresses of second controller */
 		irqctrler = irqctrler->next;
 		if (irqctrler && irqctrler->n_addrs > 0) {
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
index 10a2d5f27..d89cfe2ae 100644
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -136,7 +136,7 @@ pmac_show_cpuinfo(struct seq_file *m)
 
 	if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME, (int)&mbname) != 0)
 		mbname = "Unknown";
-	
+
 	/* find motherboard type */
 	seq_printf(m, "machine\t\t: ");
 	np = find_devices("device-tree");
@@ -196,7 +196,7 @@ pmac_show_cpuinfo(struct seq_file *m)
 		int n;
 		struct reg_property *reg = (struct reg_property *)
 			get_property(np, "reg", &n);
-	
+
 		if (reg != 0) {
 			unsigned long total = 0;
 
@@ -207,9 +207,9 @@ pmac_show_cpuinfo(struct seq_file *m)
 	}
 
 	/* Checks "l2cr-value" property in the registry */
-	np = find_devices("cpus");	
+	np = find_devices("cpus");
 	if (np == 0)
-		np = find_type_devices("cpu");	
+		np = find_type_devices("cpu");
 	if (np != 0) {
 		unsigned int *l2cr = (unsigned int *)
 			get_property(np, "l2cr-value", NULL);
@@ -277,9 +277,9 @@ pmac_setup_arch(void)
 
 	/* Checks "l2cr-value" property in the registry */
 	if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) {
-		struct device_node *np = find_devices("cpus");	
+		struct device_node *np = find_devices("cpus");
 		if (np == 0)
-			np = find_type_devices("cpu");	
+			np = find_type_devices("cpu");
 		if (np != 0) {
 			unsigned int *l2cr = (unsigned int *)
 				get_property(np, "l2cr-value", NULL);
@@ -478,11 +478,11 @@ pmac_restart(char *cmd)
 			cuda_poll();
 		break;
 #endif /* CONFIG_ADB_CUDA */
-#ifdef CONFIG_ADB_PMU	
+#ifdef CONFIG_ADB_PMU
 	case SYS_CTRLER_PMU:
 		pmu_restart();
 		break;
-#endif /* CONFIG_ADB_PMU */	
+#endif /* CONFIG_ADB_PMU */
 	default: ;
 	}
 }
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 690d78426..f77cdf1d0 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -9,12 +9,15 @@ ifdef CONFIG_4xx
 EXTRA_AFLAGS		:= -Wa,-m405
 endif
 
-CFLAGS_prom_init.o      += -mrelocatable-lib
-CFLAGS_btext.o          += -mrelocatable-lib
+CFLAGS_prom_init.o      += -fPIC
+CFLAGS_btext.o          += -fPIC
 
 obj-$(CONFIG_PPCBUG_NVRAM)	+= prep_nvram.o
+obj-$(CONFIG_PPC_OCP)		+= ocp.o
+obj-$(CONFIG_IBM_OCP)		+= ibm_ocp.o
 obj-$(CONFIG_44x)		+= ibm44x_common.o
 obj-$(CONFIG_440GP)		+= ibm440gp_common.o
+obj-$(CONFIG_440GX)		+= ibm440gx_common.o
 ifeq ($(CONFIG_4xx),y)
 obj-$(CONFIG_4xx)		+= ppc4xx_pic.o
 obj-$(CONFIG_40x)		+= ppc4xx_setup.o
@@ -60,6 +63,7 @@ obj-$(CONFIG_PRPMC750)		+= open_pic.o indirect_pci.o pci_auto.o \
 obj-$(CONFIG_HARRIER)		+= harrier.o
 obj-$(CONFIG_PRPMC800)		+= open_pic.o indirect_pci.o pci_auto.o
 obj-$(CONFIG_SANDPOINT)		+= i8259.o open_pic.o pci_auto.o todc_time.o
+obj-$(CONFIG_SBC82xx)		+= todc_time.o
 obj-$(CONFIG_SPRUCE)		+= cpc700_pic.o indirect_pci.o pci_auto.o \
 				   todc_time.o
 obj-$(CONFIG_8260)		+= m8260_setup.o ppc8260_pic.o
@@ -69,3 +73,5 @@ obj-$(CONFIG_SERIAL_TEXT_DEBUG)	+= gen550_dbg.o
 endif
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
 obj-$(CONFIG_MPC10X_BRIDGE)     += mpc10x_common.o indirect_pci.o
+obj-$(CONFIG_40x)		+= dcr.o
+obj-$(CONFIG_BOOKE)		+= dcr.o
diff --git a/arch/ppc/syslib/ibm440gp_common.c b/arch/ppc/syslib/ibm440gp_common.c
index c7a9949ea..d1ce1435f 100644
--- a/arch/ppc/syslib/ibm440gp_common.c
+++ b/arch/ppc/syslib/ibm440gp_common.c
@@ -24,7 +24,7 @@
 /*
  * Calculate 440GP clocks
  */
-void __init ibm440gp_get_clocks(struct ibm440gp_clocks* p,
+void __init ibm440gp_get_clocks(struct ibm44x_clocks* p,
 				unsigned int sys_clk,
 				unsigned int ser_clk)
 {
@@ -68,11 +68,11 @@ void __init ibm440gp_get_clocks(struct ibm440gp_clocks* p,
 
 	if (cpc0_cr0 & 0x00400000){
 		/* External UART clock */
-		p->uart = ser_clk;
+		p->uart0 = p->uart1 = ser_clk;
 	}
 	else {
 		/* Internal UART clock */
     		u32 uart_div = ((cpc0_cr0 >> 16) & 0x1f) + 1;
-		p->uart = p->plb / uart_div;
+		p->uart0 = p->uart1 = p->plb / uart_div;
 	}
 }
diff --git a/arch/ppc/syslib/ibm440gp_common.h b/arch/ppc/syslib/ibm440gp_common.h
index 96b8b2042..a054d83cb 100644
--- a/arch/ppc/syslib/ibm440gp_common.h
+++ b/arch/ppc/syslib/ibm440gp_common.h
@@ -1,5 +1,5 @@
 /*
- * arch/ppc/syslib/ibm440gp_common.h
+ * arch/ppc/kernel/ibm440gp_common.h
  *
  * PPC440GP system library
  *
@@ -20,24 +20,14 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
-
-/*
- * All clocks are in Hz
- */
-struct ibm440gp_clocks {
-	unsigned int cpu;	/* CPUCoreClk */
-	unsigned int plb;	/* PLBClk */
-	unsigned int opb;	/* OPBClk */
-	unsigned int ebc;	/* PerClk */
-	unsigned int uart;
-};
+#include <syslib/ibm44x_common.h>
 
 /*
  * Please, refer to the Figure 13.1 in 440GP user manual
  *
  * if internal UART clock is used, ser_clk is ignored
  */
-void ibm440gp_get_clocks(struct ibm440gp_clocks*, unsigned int sys_clk,
+void ibm440gp_get_clocks(struct ibm44x_clocks*, unsigned int sys_clk,
 	unsigned int ser_clk) __init;
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index 1fe70e8b0..5ccf07149 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -214,14 +214,13 @@ static void
 m8xx_restart(char *cmd)
 {
 	__volatile__ unsigned char dummy;
-	uint	msr;
 
 	cli();
 	((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr |= 0x00000080;
 
 	/* Clear the ME bit in MSR to cause checkstop on machine check
 	*/
-	mtmsr(mfmsr(msr) & ~0x1000);
+	mtmsr(mfmsr() & ~0x1000);
 
 	dummy = ((immap_t *)IMAP_ADDR)->im_clkrst.res[0];
 	printk("Restart failed\n");
@@ -248,8 +247,8 @@ m8xx_show_percpuinfo(struct seq_file *m, int i)
 
 	bp = (bd_t *)__res;
 
-	seq_printf(m, "clock\t\t: %dMHz\n"
-		   "bus clock\t: %dMHz\n",
+	seq_printf(m, "clock\t\t: %ldMHz\n"
+		   "bus clock\t: %ldMHz\n",
 		   bp->bi_intfreq / 1000000,
 		   bp->bi_busfreq / 1000000);
 
diff --git a/arch/ppc/syslib/ppc405_pci.c b/arch/ppc/syslib/ppc405_pci.c
index c7f81e705..7f94bdf39 100644
--- a/arch/ppc/syslib/ppc405_pci.c
+++ b/arch/ppc/syslib/ppc405_pci.c
@@ -57,14 +57,6 @@ ppc405_pcibios_fixup_resources(struct pci_dev *dev)
 		    )
 		    ) {
 
-			DBG(KERN_ERR "PCI: 0x%lx <= resource[%d] <= 0x%lx"
-			    ", bus 0x%x dev 0x%2.2x.%1.1x,\n"
-			    KERN_ERR "  %s\n"
-			    KERN_ERR "  fixup will be attempted later\n",
-			    min_host_addr, i, max_host_addr,
-			    dev->bus->number, PCI_SLOT(dev->devfn),
-			    PCI_FUNC(dev->devfn), dev->slot.name);
-
 			/* force pcibios_assign_resources() to assign a new address */
 			res->end -= res->start;
 			res->start = 0;
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
index 5bb8c2dd2..22c9010e5 100644
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ b/arch/ppc/syslib/ppc4xx_pic.c
@@ -142,9 +142,12 @@ ppc403_aic_disable_and_ack(unsigned int irq)
 #ifndef UIC1
 #define UIC1 UIC0
 #endif
+#ifndef UIC2
+#define UIC2 UIC1
+#endif
 
 static void
-ppc405_uic_enable(unsigned int irq)
+ppc4xx_uic_enable(unsigned int irq)
 {
 	int bit, word;
 	irq_desc_t *desc = irq_desc + irq;
@@ -153,7 +156,7 @@ ppc405_uic_enable(unsigned int irq)
 	word = irq >> 5;
 
 #ifdef UIC_DEBUG
-	printk("ppc405_uic_enable - irq %d word %d bit 0x%x\n", irq, word, bit);
+	printk("ppc4xx_uic_enable - irq %d word %d bit 0x%x\n", irq, word, bit);
 #endif
 	ppc_cached_irq_mask[word] |= 1 << (31 - bit);
 	switch (word) {
@@ -162,38 +165,35 @@ ppc405_uic_enable(unsigned int irq)
 		if ((mfdcr(DCRN_UIC_TR(UIC0)) & (1 << (31 - bit))) == 0)
 			desc->status |= IRQ_LEVEL;
 		else
-		/* lets hope this works since in linux/irq.h
-		 * there is no define for EDGE and it's assumed
-		 * once you set status to LEVEL you would not
-		 * want to change it - Armin
-		 */
-		desc->status = desc->status & ~IRQ_LEVEL;
+			desc->status = desc->status & ~IRQ_LEVEL;
 		break;
 	case 1:
 		mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]);
 		if ((mfdcr(DCRN_UIC_TR(UIC1)) & (1 << (31 - bit))) == 0)
 			desc->status |= IRQ_LEVEL;
 		else
-		/* lets hope this works since in linux/irq.h
-		 * there is no define for EDGE and it's assumed
-		 * once you set status to LEVEL you would not
-		 * want to change it - Armin
-		 */
-		desc->status = desc->status & ~IRQ_LEVEL;
-	break;
+			desc->status = desc->status & ~IRQ_LEVEL;
+		break;
+	case 2:
+		mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]);
+		if ((mfdcr(DCRN_UIC_TR(UIC2)) & (1 << (31 - bit))) == 0)
+			desc->status |= IRQ_LEVEL;
+		else
+			desc->status = desc->status & ~IRQ_LEVEL;
+		break;
 	}
 
 }
 
 static void
-ppc405_uic_disable(unsigned int irq)
+ppc4xx_uic_disable(unsigned int irq)
 {
 	int bit, word;
 
 	bit = irq & 0x1f;
 	word = irq >> 5;
 #ifdef UIC_DEBUG
-	printk("ppc405_uic_disable - irq %d word %d bit 0x%x\n", irq, word,
+	printk("ppc4xx_uic_disable - irq %d word %d bit 0x%x\n", irq, word,
 	       bit);
 #endif
 	ppc_cached_irq_mask[word] &= ~(1 << (31 - bit));
@@ -204,11 +204,14 @@ ppc405_uic_disable(unsigned int irq)
 	case 1:
 		mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]);
 		break;
+	case 2:
+		mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]);
+		break;
 	}
 }
 
 static void
-ppc405_uic_disable_and_ack(unsigned int irq)
+ppc4xx_uic_disable_and_ack(unsigned int irq)
 {
 	int bit, word;
 
@@ -216,7 +219,7 @@ ppc405_uic_disable_and_ack(unsigned int irq)
 	word = irq >> 5;
 
 #ifdef UIC_DEBUG
-	printk("ppc405_uic_disable_and_ack - irq %d word %d bit 0x%x\n", irq,
+	printk("ppc4xx_uic_disable_and_ack - irq %d word %d bit 0x%x\n", irq,
 	       word, bit);
 #endif
 	ppc_cached_irq_mask[word] &= ~(1 << (31 - bit));
@@ -224,16 +227,30 @@ ppc405_uic_disable_and_ack(unsigned int irq)
 	case 0:
 		mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[word]);
 		mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - bit)));
+#if (NR_UICS > 2)
+		mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC);
+#endif
 		break;
 	case 1:
 		mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]);
 		mtdcr(DCRN_UIC_SR(UIC1), (1 << (31 - bit)));
+#if (NR_UICS > 2)
+		mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC);
+#endif
+		break;
+	case 2:
+		mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]);
+		mtdcr(DCRN_UIC_SR(UIC2), (1 << (31 - bit)));
+#if (NR_UICS > 2)
+		mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC);
+#endif
 		break;
 	}
+
 }
 
 static void
-ppc405_uic_end(unsigned int irq)
+ppc4xx_uic_end(unsigned int irq)
 {
 	int bit, word;
 	unsigned int tr_bits;
@@ -242,7 +259,7 @@ ppc405_uic_end(unsigned int irq)
 	word = irq >> 5;
 
 #ifdef UIC_DEBUG
-	printk("ppc405_uic_end - irq %d word %d bit 0x%x\n", irq, word, bit);
+	printk("ppc4xx_uic_end - irq %d word %d bit 0x%x\n", irq, word, bit);
 #endif
 
 	switch (word) {
@@ -252,6 +269,9 @@ ppc405_uic_end(unsigned int irq)
 	case 1:
 		tr_bits = mfdcr(DCRN_UIC_TR(UIC1));
 		break;
+	case 2:
+		tr_bits = mfdcr(DCRN_UIC_TR(UIC2));
+		break;
 	}
 
 	if ((tr_bits & (1 << (31 - bit))) == 0) {
@@ -259,9 +279,21 @@ ppc405_uic_end(unsigned int irq)
 		switch (word) {
 		case 0:
 			mtdcr(DCRN_UIC_SR(UIC0), 1 << (31 - bit));
+#if (NR_UICS > 2)
+			mtdcr(DCRN_UIC_SR(UICB),  UICB_UIC0NC);
+#endif
 			break;
 		case 1:
 			mtdcr(DCRN_UIC_SR(UIC1), 1 << (31 - bit));
+#if (NR_UICS > 2)
+			mtdcr(DCRN_UIC_SR(UICB),  UICB_UIC1NC);
+#endif
+			break;
+		case 2:
+			mtdcr(DCRN_UIC_SR(UIC2), 1 << (31 - bit));
+#if (NR_UICS > 2)
+			mtdcr(DCRN_UIC_SR(UICB),  UICB_UIC2NC);
+#endif
 			break;
 		}
 	}
@@ -275,11 +307,14 @@ ppc405_uic_end(unsigned int irq)
 		case 1:
 			mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]);
 			break;
+		case 2:
+			mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[word]);
+			break;
 		}
 	}
 }
 
-static struct hw_interrupt_type ppc405_uic = {
+static struct hw_interrupt_type ppc4xx_uic = {
 #if (NR_UICS == 1)
 	"IBM UIC",
 #else
@@ -287,15 +322,15 @@ static struct hw_interrupt_type ppc405_uic = {
 #endif
 	NULL,
 	NULL,
-	ppc405_uic_enable,
-	ppc405_uic_disable,
-	ppc405_uic_disable_and_ack,
-	ppc405_uic_end,
+	ppc4xx_uic_enable,
+	ppc4xx_uic_disable,
+	ppc4xx_uic_disable_and_ack,
+	ppc4xx_uic_end,
 	0
 };
 
 int
-ppc405_pic_get_irq(struct pt_regs *regs)
+ppc4xx_pic_get_irq(struct pt_regs *regs)
 {
 	int irq, cas_irq;
 	unsigned long bits;
@@ -305,9 +340,25 @@ ppc405_pic_get_irq(struct pt_regs *regs)
 	 * enabled.
 	 */
 
+#if (NR_UICS > 2)
+	bits = mfdcr(DCRN_UIC_MSR(UICB));
+#else
 	bits = mfdcr(DCRN_UIC_MSR(UIC0));
-
-#if (NR_UICS > 1)
+#endif
+#if (NR_UICS > 2)
+	if (bits & UICB_UIC0NC) {
+		bits = mfdcr(DCRN_UIC_MSR(UIC0));
+		irq = 32 - ffs(bits);
+	} else if (bits & UICB_UIC1NC) {
+		bits = mfdcr(DCRN_UIC_MSR(UIC1));
+		irq = 64 - ffs(bits);
+	} else if (bits & UICB_UIC2NC) {
+		bits = mfdcr(DCRN_UIC_MSR(UIC2));
+		irq = 96 - ffs(bits);
+	} else {
+		irq = -1;
+	}
+#elif (NR_UICS > 1)
 	if (bits & UIC_CASCADE_MASK) {
 		bits = mfdcr(DCRN_UIC_MSR(UIC1));
 		cas_irq = 32 - ffs(bits);
@@ -330,7 +381,7 @@ ppc405_pic_get_irq(struct pt_regs *regs)
 		irq = -1;
 
 #ifdef UIC_DEBUG
-	printk("ppc405_pic_get_irq - irq %d bit 0x%x\n", irq, bits);
+	printk("ppc4xx_pic_get_irq - irq %d bit 0x%x\n", irq, bits);
 #endif
 
 	return (irq);
@@ -354,8 +405,10 @@ ppc4xx_extpic_init(void)
 	unsigned long ppc_cached_pol_mask[NR_MASK_WORDS];
 	ppc_cached_sense_mask[0] = 0;
 	ppc_cached_sense_mask[1] = 0;
+	ppc_cached_sense_mask[2] = 0;
 	ppc_cached_pol_mask[0] = 0;
 	ppc_cached_pol_mask[1] = 0;
+	ppc_cached_pol_mask[2] = 0;
 
 	for (irq = 0; irq < NR_IRQS; irq++) {
 
@@ -397,6 +450,18 @@ ppc4xx_extpic_init(void)
 			/* Level setting */
 			mtdcr(DCRN_UIC_TR(UIC1), ppc_cached_sense_mask[word]);
 
+			break;
+		case 2:
+#ifdef PPC4xx_PIC_DEBUG
+			printk("Pol %x ", mfdcr(DCRN_UIC_PR(UIC2)));
+			printk("Level %x\n", mfdcr(DCRN_UIC_TR(UIC2)));
+#endif
+			/* polarity  setting */
+			mtdcr(DCRN_UIC_PR(UIC2), ppc_cached_pol_mask[word]);
+
+			/* Level setting */
+			mtdcr(DCRN_UIC_TR(UIC2), ppc_cached_sense_mask[word]);
+
 			break;
 		}
 	}
@@ -405,13 +470,13 @@ ppc4xx_extpic_init(void)
 void __init
 ppc4xx_pic_init(void)
 {
-
 	/*
 	 * Disable all external interrupts until they are
 	 * explicity requested.
 	 */
 	ppc_cached_irq_mask[0] = 0;
 	ppc_cached_irq_mask[1] = 0;
+	ppc_cached_irq_mask[2] = 0;
 
 #if defined CONFIG_403
 	mtdcr(DCRN_EXIER, ppc_cached_irq_mask[0]);
@@ -419,11 +484,21 @@ ppc4xx_pic_init(void)
 	ppc4xx_pic = &ppc403_aic;
 	ppc_md.get_irq = ppc403_pic_get_irq;
 #else
+#if  (NR_UICS > 2)
+	mtdcr(DCRN_UIC_ER(UICB), UICB_UIC0NC | UICB_UIC1NC | UICB_UIC2NC);
+	mtdcr(DCRN_UIC_CR(UICB), 0);
+
+	mtdcr(DCRN_UIC_ER(UIC2), ppc_cached_irq_mask[2]);
+	mtdcr(DCRN_UIC_CR(UIC2), 0);
+
+#endif
 #if  (NR_UICS > 1)
-	ppc_cached_irq_mask[0] |= 1 << (31 - UIC0_UIC1NC);	/* enable cascading interrupt */
+#if  (NR_UICS == 2)
+	/* enable cascading interrupt */
+	ppc_cached_irq_mask[0] |= 1 << (31 - UIC0_UIC1NC);
+#endif
 	mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[1]);
 	mtdcr(DCRN_UIC_CR(UIC1), 0);
-
 #endif
 	mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]);
 	mtdcr(DCRN_UIC_CR(UIC0), 0);
@@ -432,13 +507,16 @@ ppc4xx_pic_init(void)
 		ppc4xx_extpic_init();
 
 	/* Clear any pending interrupts */
+#if (NR_UICS > 2)
+	mtdcr(DCRN_UIC_SR(UICB), 0xffffffff);
+	mtdcr(DCRN_UIC_SR(UIC2), 0xffffffff);
+#endif
 #if (NR_UICS > 1)
 	mtdcr(DCRN_UIC_SR(UIC1), 0xffffffff);
 #endif
 	mtdcr(DCRN_UIC_SR(UIC0), 0xffffffff);
 
-	ppc4xx_pic = &ppc405_uic;
-	ppc_md.get_irq = ppc405_pic_get_irq;
+	ppc4xx_pic = &ppc4xx_uic;
+	ppc_md.get_irq = ppc4xx_pic_get_irq;
 #endif
-
 }
diff --git a/arch/ppc/syslib/ppc8xx_pic.h b/arch/ppc/syslib/ppc8xx_pic.h
index 22397c722..784935eac 100644
--- a/arch/ppc/syslib/ppc8xx_pic.h
+++ b/arch/ppc/syslib/ppc8xx_pic.h
@@ -3,6 +3,7 @@
 
 #include <linux/config.h>
 #include <linux/irq.h>
+#include <linux/interrupt.h>
 
 extern struct hw_interrupt_type ppc8xx_pic;
 
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
index e114c595b..932608875 100644
--- a/arch/ppc/syslib/prom_init.c
+++ b/arch/ppc/syslib/prom_init.c
@@ -800,8 +800,7 @@ prom_init(int r3, int r4, prom_entry pp)
 
 	/* First get a handle for the stdout device */
 	prom = pp;
-	prom_chosen = call_prom("finddevice", 1, 1,
-				       "/chosen");
+	prom_chosen = call_prom("finddevice", 1, 1, "/chosen");
 	if (prom_chosen == (void *)-1)
 		prom_exit();
 	if ((int) call_prom("getprop", 4, 1, prom_chosen,
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 9b2f319d0..f0a6ef197 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -49,6 +49,10 @@ config FORCE_MAX_ZONEORDER
 
 source "init/Kconfig"
 
+config SYSVIPC_COMPAT
+	bool
+	depends on COMPAT && SYSVIPC
+	default y
 
 menu "Platform support"
 
@@ -89,6 +93,16 @@ config PPC_PMAC
 	bool "Apple PowerMac G5 support"
 	select ADB_PMU
 
+config PPC_SPLPAR
+	depends on PPC_PSERIES
+	bool "Support for shared-processor logical partitions"
+	default n
+	help
+	  Enabling this option will make the kernel run more efficiently
+	  on logically-partitioned pSeries systems which use shared
+	  processors, that is, which share physical processors between
+	  two or more partitions.
+
 config PMAC_DART
 	bool "Enable DART/IOMMU on PowerMac (allow >2G of RAM)"
 	depends on PPC_PMAC
@@ -173,6 +187,15 @@ config NUMA
 	bool "NUMA support"
 	depends on DISCONTIGMEM
 
+config SCHED_SMT
+	bool "SMT (Hyperthreading) scheduler support"
+	depends on SMP
+	default off
+	help
+	  SMT scheduler support improves the CPU scheduler's decision making
+	  when dealing with POWER5 cpus at a cost of slightly increased
+	  overhead in some places. If unsure say N here.
+
 config PREEMPT
 	bool "Preemptible Kernel"
 	depends on BROKEN
@@ -394,9 +417,26 @@ config DEBUG_INFO
 	  debugging info resulting in a larger kernel image.
 	  Say Y here only if you plan to use gdb to debug the kernel.
 	  If you don't debug the kernel, you can say N.
+
+config IRQSTACKS
+	bool "Use separate kernel stacks when processing interrupts"
+	help
+	  If you say Y here the kernel will use separate kernel stacks
+	  for handling hard and soft interrupts.  This can help avoid
+	  overflowing the process kernel stacks.
 	  
 endmenu
 
+config SPINLINE
+	bool "Inline spinlock code at each call site"
+	depends on SMP && !PPC_SPLPAR && !PPC_ISERIES
+	help
+	  Say Y if you want to have the code for acquiring spinlocks
+	  and rwlocks inlined at each call site.  This makes the kernel
+	  somewhat bigger, but can be useful when profiling the kernel.
+
+	  If in doubt, say N.
+
 source "security/Kconfig"
 
 source "crypto/Kconfig"
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index 09e84e75e..10c1d6299 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -17,12 +17,13 @@ KERNELLOAD	:= 0xc000000000000000
 
 HAS_BIARCH      := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
 ifeq ($(HAS_BIARCH),y)
-AS              := $(AS) -64
+AS              := $(AS) -a64
 LD              := $(LD) -m elf64ppc
 CC		:= $(CC) -m64
-CHECK		:= $(CHECK) -m64
 endif
 
+CHECK		:= $(CHECK) -m64 -D__powerpc__=1
+
 LDFLAGS		:= -m elf64ppc
 LDFLAGS_vmlinux	:= -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
 CFLAGS		+= -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig
index b80b92389..fdb3606aa 100644
--- a/arch/ppc64/configs/iSeries_defconfig
+++ b/arch/ppc64/configs/iSeries_defconfig
@@ -23,19 +23,23 @@ CONFIG_STANDALONE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
-CONFIG_EMBEDDED=y
+# CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -48,6 +52,7 @@ CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_KMOD is not set
 CONFIG_STOP_MACHINE=y
+CONFIG_SYSVIPC_COMPAT=y
 
 #
 # Platform support
@@ -60,6 +65,7 @@ CONFIG_PPC64=y
 # CONFIG_IOMMU_VMERGE is not set
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
+# CONFIG_SCHED_SMT is not set
 CONFIG_MSCHUNKS=y
 CONFIG_LPARCFG=y
 
@@ -72,6 +78,7 @@ CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
+# CONFIG_HOTPLUG_CPU is not set
 
 #
 # PCMCIA/CardBus support
@@ -148,7 +155,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_REPORT_LUNS=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -180,6 +186,7 @@ CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -221,6 +228,7 @@ CONFIG_DM_CRYPT=m
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Macintosh device drivers
@@ -247,7 +255,6 @@ CONFIG_NET_IPIP=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
-CONFIG_INET_ECN=y
 CONFIG_SYN_COOKIES=y
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
@@ -258,8 +265,6 @@ CONFIG_INET_IPCOMP=m
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -319,16 +324,18 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
+# CONFIG_IP_NF_RAW is not set
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 CONFIG_LLC=y
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
@@ -350,16 +357,23 @@ CONFIG_LLC=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_RX=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-CONFIG_DUMMY=m
-CONFIG_BONDING=m
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
 
 #
 # Ethernet (10 or 100Mbit)
@@ -397,27 +411,29 @@ CONFIG_E100=y
 # CONFIG_VIA_RHINE is not set
 
 #
-# Ethernet (1000 Mbit)
+# Gigabit Ethernet (1000/10000 Mbit)
 #
-CONFIG_ACENIC=y
-CONFIG_ACENIC_OMIT_TIGON_I=y
-# CONFIG_DL2K is not set
-CONFIG_E1000=y
-# CONFIG_E1000_NAPI is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_YELLOWFIN is not set
-# CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_TIGON3 is not set
+# CONFIG_NET_GIGE is not set
 
 #
-# Ethernet (10000 Mbit)
+# Token Ring devices
+#
+CONFIG_TR=y
+CONFIG_IBMOL=y
+# CONFIG_IBMLS is not set
+# CONFIG_3C359 is not set
+# CONFIG_TMS380TR is not set
+
+#
+# Wireless LAN (non-hamradio)
 #
-CONFIG_IXGB=m
-# CONFIG_IXGB_NAPI is not set
-# CONFIG_VETH is not set
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_ISERIES_VETH=y
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 CONFIG_PPP=m
@@ -429,48 +445,10 @@ CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
 CONFIG_PPPOE=m
 # CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Token Ring devices
-#
-CONFIG_TR=y
-CONFIG_IBMOL=y
-# CONFIG_IBMLS is not set
-# CONFIG_3C359 is not set
-# CONFIG_TMS380TR is not set
 # CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 CONFIG_NETCONSOLE=y
 
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-CONFIG_NETPOLL=y
-CONFIG_NETPOLL_RX=y
-CONFIG_NETPOLL_TRAP=y
-CONFIG_NET_POLL_CONTROLLER=y
-
 #
 # ISDN subsystem
 #
@@ -489,7 +467,10 @@ CONFIG_INPUT=y
 #
 # Userland interfaces
 #
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
 # CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
@@ -518,7 +499,6 @@ CONFIG_SERIO_SERPORT=y
 #
 # Character devices
 #
-# CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -532,11 +512,6 @@ CONFIG_SERIO_SERPORT=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -618,6 +593,7 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=y
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_REISERFS_FS_XATTR is not set
 CONFIG_JFS_FS=y
 CONFIG_JFS_POSIX_ACL=y
 # CONFIG_JFS_DEBUG is not set
@@ -655,6 +631,7 @@ CONFIG_VFAT_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 # CONFIG_DEVPTS_FS_SECURITY is not set
@@ -695,10 +672,11 @@ CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=m
-CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_SMB_FS is not set
 CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -757,8 +735,8 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 #
 CONFIG_VIOCONS=y
 CONFIG_VIODASD=y
-CONFIG_VIOCD=y
-# CONFIG_VIOTAPE is not set
+CONFIG_VIOCD=m
+CONFIG_VIOTAPE=m
 CONFIG_VIOPATH=y
 
 #
@@ -778,6 +756,7 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUGGER is not set
 # CONFIG_PPCDBG is not set
 # CONFIG_DEBUG_INFO is not set
+# CONFIG_IRQSTACKS is not set
 
 #
 # Security options
@@ -791,11 +770,11 @@ CONFIG_CRYPTO=y
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_MD4=m
-CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_DES=y
 CONFIG_CRYPTO_BLOWFISH=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_SERPENT=m
@@ -804,11 +783,14 @@ CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
 CONFIG_CRYPTO_TEST=m
 
 #
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/ppc64/kernel/HvLpEvent.c b/arch/ppc64/kernel/HvLpEvent.c
index f92dfc2fb..93eea792f 100644
--- a/arch/ppc64/kernel/HvLpEvent.c
+++ b/arch/ppc64/kernel/HvLpEvent.c
@@ -8,6 +8,7 @@
  */
 #include <linux/stddef.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <asm/system.h>
 #include <asm/iSeries/HvLpEvent.h>
 #include <asm/iSeries/HvCallEvent.h>
@@ -41,6 +42,8 @@ int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType )
 	}
 	return rc;
 }
+EXPORT_SYMBOL(HvLpEvent_registerHandler);
+EXPORT_SYMBOL(HvLpEvent_unregisterHandler);
 
 /* (lpIndex is the partition index of the target partition.  
  * needed only for VirtualIo, VirtualLan and SessionMgr.  Zero
diff --git a/arch/ppc64/kernel/align.c b/arch/ppc64/kernel/align.c
index dc455830d..58a5eb9e3 100644
--- a/arch/ppc64/kernel/align.c
+++ b/arch/ppc64/kernel/align.c
@@ -215,8 +215,9 @@ fix_alignment(struct pt_regs *regs)
 	unsigned long i;
 	int ret;
 	unsigned dsisr;
-	unsigned char *addr, *p;
-	unsigned long *lp;
+	unsigned char __user *addr;
+	unsigned char __user *p;
+	unsigned long __user *lp;
 	union {
 		long ll;
 		double dd;
@@ -241,9 +242,9 @@ fix_alignment(struct pt_regs *regs)
 
 	if (cur_cpu_spec->cpu_features & CPU_FTR_NODSISRALIGN) {
 	    unsigned int real_instr;
-	    if (__get_user(real_instr, (unsigned int *)regs->nip))
+	    if (__get_user(real_instr, (unsigned int __user *)regs->nip))
 		return 0;
-	    dsisr = make_dsisr(*((unsigned *)regs->nip));
+	    dsisr = make_dsisr(real_instr);
 	}
 
 	/* extract the operation and registers from the dsisr */
@@ -257,7 +258,7 @@ fix_alignment(struct pt_regs *regs)
 	flags = aligninfo[instr].flags;
 
 	/* DAR has the operand effective address */
-	addr = (unsigned char *)regs->dar;
+	addr = (unsigned char __user *)regs->dar;
 
 	/* A size of 0 indicates an instruction we don't support */
 	/* we also don't support the multiples (lmw, stmw, lmd, stmd) */
@@ -270,7 +271,7 @@ fix_alignment(struct pt_regs *regs)
 	 * storage
 	 */
 	if (instr == DCBZ)
-		addr = (unsigned char *) ((unsigned long)addr & -L1_CACHE_BYTES);
+		addr = (unsigned char __user *) ((unsigned long)addr & -L1_CACHE_BYTES);
 
 	/* Verify the address of the operand */
 	if (user_mode(regs)) {
@@ -360,7 +361,7 @@ fix_alignment(struct pt_regs *regs)
 		p = addr;
 		switch (nb) {
 		case 128:	/* Special case - must be dcbz */
-			lp = (unsigned long *)p;
+			lp = (unsigned long __user *)p;
 			for (i = 0; i < L1_CACHE_BYTES / sizeof(long); ++i)
 				ret |= __put_user(0, lp++);
 			break;
diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
index 98e8d373b..9368fb0ff 100644
--- a/arch/ppc64/kernel/asm-offsets.c
+++ b/arch/ppc64/kernel/asm-offsets.c
@@ -73,7 +73,6 @@ int main(void)
         DEFINE(ICACHEL1LINESIZE, offsetof(struct systemcfg, iCacheL1LineSize));
         DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize));
         DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage));
-	DEFINE(SLBSIZE, offsetof(struct naca_struct, slb_size));
 	DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
 
 	/* paca */
diff --git a/arch/ppc64/kernel/cpu_setup_power4.S b/arch/ppc64/kernel/cpu_setup_power4.S
index 3816626d2..0e009850f 100644
--- a/arch/ppc64/kernel/cpu_setup_power4.S
+++ b/arch/ppc64/kernel/cpu_setup_power4.S
@@ -119,7 +119,9 @@ _GLOBAL(__save_cpu_setup)
 	/* We only deal with 970 for now */
 	mfspr	r0,SPRN_PVR
 	srwi	r0,r0,16
-	cmpwi	r0,0x39
+	cmpwi	cr0,r0,0x39
+	cmpwi	cr1,r0,0x3c
+	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq
 	bne	1f
 
 	/* Save HID0,1,4 and 5 */
@@ -149,7 +151,9 @@ _GLOBAL(__restore_cpu_setup)
 	/* We only deal with 970 for now */
 	mfspr	r0,SPRN_PVR
 	srwi	r0,r0,16
-	cmpwi	r0,0x39
+	cmpwi	cr0,r0,0x39
+	cmpwi	cr1,r0,0x3c
+	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq
 	bne	1f
 
 	/* Clear interrupt prefix */
diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
index 303eac178..dc83803db 100644
--- a/arch/ppc64/kernel/eeh.c
+++ b/arch/ppc64/kernel/eeh.c
@@ -612,33 +612,25 @@ void __init eeh_init(void)
 }
 
 /**
- * eeh_add_device - perform EEH initialization for the indicated pci device
- * @dev: pci device for which to set up EEH
+ * eeh_add_device_early - enable EEH for the indicated device_node
+ * @dn: device node for which to set up EEH
  *
- * This routine can be used to perform EEH initialization for PCI
+ * This routine must be used to perform EEH initialization for PCI
  * devices that were added after system boot (e.g. hotplug, dlpar).
+ * This routine must be called before any i/o is performed to the
+ * adapter (inluding any config-space i/o).
  * Whether this actually enables EEH or not for this device depends
- * on the type of the device, on earlier boot command-line
- * arguments & etc.
+ * on the CEC architecture, type of the device, on earlier boot
+ * command-line arguments & etc.
  */
-void eeh_add_device(struct pci_dev *dev)
+void eeh_add_device_early(struct device_node *dn)
 {
-	struct device_node *dn;
 	struct pci_controller *phb;
 	struct eeh_early_enable_info info;
 
-	if (!dev || !eeh_subsystem_enabled)
-		return;
-
-#ifdef DEBUG
-	printk(KERN_DEBUG "EEH: adding device %s %s\n", pci_name(dev),
-	       pci_pretty_name(dev));
-#endif
-	dn = pci_device_to_OF_node(dev);
-	if (NULL == dn)
+	if (!dn || !eeh_subsystem_enabled)
 		return;
-
-	phb = PCI_GET_PHB_PTR(dev);
+	phb = dn->phb;
 	if (NULL == phb || 0 == phb->buid) {
 		printk(KERN_WARNING "EEH: Expected buid but found none\n");
 		return;
@@ -646,11 +638,30 @@ void eeh_add_device(struct pci_dev *dev)
 
 	info.buid_hi = BUID_HI(phb->buid);
 	info.buid_lo = BUID_LO(phb->buid);
-
 	early_enable_eeh(dn, &info);
+}
+EXPORT_SYMBOL(eeh_add_device_early);
+
+/**
+ * eeh_add_device_late - perform EEH initialization for the indicated pci device
+ * @dev: pci device for which to set up EEH
+ *
+ * This routine must be used to complete EEH initialization for PCI
+ * devices that were added after system boot (e.g. hotplug, dlpar).
+ */
+void eeh_add_device_late(struct pci_dev *dev)
+{
+	if (!dev || !eeh_subsystem_enabled)
+		return;
+
+#ifdef DEBUG
+	printk(KERN_DEBUG "EEH: adding device %s %s\n", pci_name(dev),
+	       pci_pretty_name(dev));
+#endif
+
 	pci_addr_cache_insert_device (dev);
 }
-EXPORT_SYMBOL(eeh_add_device);
+EXPORT_SYMBOL(eeh_add_device_late);
 
 /**
  * eeh_remove_device - undo EEH setup for the indicated pci device
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index a47b8edd1..e868fe7b8 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -265,6 +265,9 @@ _GLOBAL(__secondary_hold)
 	mfspr	r23,SPRG2;		/* Save r20 in exc. frame      */ \
 	std	r23,EX_R20(r21);	                                  \
                                                                          \
+	mfmsr	r22;			    /* set MSR.RI		   */ \
+	ori	r22,r22,MSR_RI;						      \
+	mtmsrd	r22,1;							      \
 	mfcr    r23;                        /* save CR in r23              */
 
 /*
@@ -923,8 +926,8 @@ _GLOBAL(do_hash_page_DSI)
 	stb	r0,PACAPROCENABLED(r20)	/* Soft Disabled */
 
 	mfmsr	r0
-	ori	r0,r0,MSR_EE+MSR_RI
-	mtmsrd	r0			/* Hard Enable, RI on */
+	ori	r0,r0,MSR_EE
+	mtmsrd	r0,1			/* Hard Enable */
 #endif
 
 	/*
@@ -943,9 +946,9 @@ _GLOBAL(do_hash_page_DSI)
 	 */
 	mfmsr	r0
 	li	r4,0
-	ori	r4,r4,MSR_EE+MSR_RI
+	ori	r4,r4,MSR_EE
 	andc	r0,r0,r4
-	mtmsrd	r0			/* Hard Disable, RI off */
+	mtmsrd	r0,1			/* Hard Disable */
 
 	ld	r0,SOFTE(r1)
 	cmpdi	0,r0,0			/* See if we will soft enable in */
@@ -1120,13 +1123,11 @@ _GLOBAL(do_slb_bolted)
 	 */
 
 	/* r20 = paca */
-	/* use a cpu feature mask if we ever change our slb size */
-SLB_NUM_ENTRIES = 64
 1:	ld	r22,PACASTABRR(r20)
 	addi	r21,r22,1
 	cmpdi	r21,SLB_NUM_ENTRIES
 	blt+	2f
-	li	r21,1			/* dont touch bolted slot 0 */
+	li	r21,2			/* dont touch slot 0 or 1 */
 2:	std	r21,PACASTABRR(r20)
 
 	/* r20 = paca, r22 = entry */
@@ -1278,6 +1279,10 @@ _GLOBAL(save_remaining_regs)
 	SAVE_4GPRS(16, r1)
 	SAVE_8GPRS(24, r1)
 
+	/* Set the marker value "regshere" just before the reg values */
+	SET_REG_TO_CONST(r22, 0x7265677368657265)
+	std	r22,STACK_FRAME_OVERHEAD-16(r1)
+
 	/*
 	 * Clear the RESULT field
 	 */
@@ -1952,21 +1957,6 @@ _GLOBAL(enable_64b_mode)
 	isync
 	blr
 
-/*
- * This subroutine clobbers r11, r12 and the LR
- */
-_GLOBAL(enable_32b_mode)
-	mfmsr   r11                      /* grab the current MSR */
-	li      r12,1
-	rldicr  r12,r12,MSR_SF_LG,(63-MSR_SF_LG)
-	andc	r11,r11,r12
-	li      r12,1
-	rldicr  r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG)
-	andc	r11,r11,r12
-	mtmsrd  r11
-	isync
-	blr
-
 #ifdef CONFIG_PPC_PSERIES
 /*
  * This is where the main kernel code starts.
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index f2271fdbb..3f17d5e25 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -563,11 +563,6 @@ static void __init build_iSeries_Memory_Map(void)
 	lmb_add(0, systemcfg->physicalMemorySize);
 	lmb_analyze();	/* ?? */
 	lmb_reserve(0, __pa(klimit));
-
-	/* 
-	 * Hardcode to GP size.  I am not sure where to get this info. DRENG
-	 */
-	naca->slb_size = 64;
 }
 
 /*
@@ -858,3 +853,12 @@ static void iSeries_setup_dprofile(void)
 		}
 	}
 }
+
+int __init iSeries_src_init(void)
+{
+        /* clear the progress line */
+        ppc_md.progress(" ", 0xffff);
+        return 0;
+}
+
+late_initcall(iSeries_src_init);
diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
index dbb87dce7..1027c84c7 100644
--- a/arch/ppc64/kernel/ioctl32.c
+++ b/arch/ppc64/kernel/ioctl32.c
@@ -29,307 +29,6 @@
 #define CODE
 #include "compat_ioctl.c"
 
-struct ncp_ioctl_request_32 {
-	unsigned int function;
-	unsigned int size;
-	compat_caddr_t data;
-};
-
-struct ncp_fs_info_v2_32 {
-	int version;
-	unsigned int mounted_uid;
-	unsigned int connection;
-	unsigned int buffer_size;
-
-	unsigned int volume_number;
-	__u32 directory_id;
-
-	__u32 dummy1;
-	__u32 dummy2;
-	__u32 dummy3;
-};
-
-struct ncp_objectname_ioctl_32
-{
-	int		auth_type;
-	unsigned int	object_name_len;
-	compat_caddr_t	object_name;	/* an userspace data, in most cases user name */
-};
-
-struct ncp_privatedata_ioctl_32
-{
-	unsigned int	len;
-	compat_caddr_t	data;		/* ~1000 for NDS */
-};
-
-#define	NCP_IOC_NCPREQUEST_32		_IOR('n', 1, struct ncp_ioctl_request_32)
-
-#define NCP_IOC_GETMOUNTUID2_32		_IOW('n', 2, unsigned int)
-
-#define NCP_IOC_GET_FS_INFO_V2_32	_IOWR('n', 4, struct ncp_fs_info_v2_32)
-
-#define NCP_IOC_GETOBJECTNAME_32	_IOWR('n', 9, struct ncp_objectname_ioctl_32)
-#define NCP_IOC_SETOBJECTNAME_32	_IOR('n', 9, struct ncp_objectname_ioctl_32)
-#define NCP_IOC_GETPRIVATEDATA_32	_IOWR('n', 10, struct ncp_privatedata_ioctl_32)
-#define NCP_IOC_SETPRIVATEDATA_32	_IOR('n', 10, struct ncp_privatedata_ioctl_32)
-
-static int do_ncp_ncprequest(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_ioctl_request_32 n32;
-	struct ncp_ioctl_request n;
-	mm_segment_t old_fs;
-	int err;
-
-	if (copy_from_user(&n32, (struct ncp_ioctl_request_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.function = n32.function;
-	n.size = n32.size;
-	if (n.size > 65536)
-		return -EINVAL;
-	n.data = vmalloc(65536);	/* 65536 must be same as NCP_PACKET_SIZE_INTERNAL in ncpfs */
-	if (!n.data)
-		return -ENOMEM;
-	err = -EFAULT;
-	if (copy_from_user(n.data, (void *)A(n32.data), n.size))
-		goto out;
-
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_NCPREQUEST, (unsigned long)&n);
-	set_fs (old_fs);
-        if(err <= 0)
-		goto out;
-	if (err > 65536) {
-		err = -EINVAL;
-		goto out;
-	}
-	if (copy_to_user((void *)A(n32.data), n.data, err)) {
-		err = -EFAULT;
-		goto out;
-	}
- out:
-	vfree(n.data);
-	return err;
-}
-
-static int do_ncp_getmountuid2(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	mm_segment_t old_fs = get_fs();
-	__kernel_uid_t kuid;
-	int err;
-
-	cmd = NCP_IOC_GETMOUNTUID2;
-
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, cmd, (unsigned long)&kuid);
-	set_fs(old_fs);
-
-	if (!err)
-		err = put_user(kuid, (unsigned int*)arg);
-
-	return err;
-}
-
-static int do_ncp_getfsinfo2(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	mm_segment_t old_fs = get_fs();
-	struct ncp_fs_info_v2_32 n32;
-	struct ncp_fs_info_v2 n;
-	int err;
-
-	if (copy_from_user(&n32, (struct ncp_fs_info_v2_32*)arg, sizeof(n32)))
-		return -EFAULT;
-	if (n32.version != NCP_GET_FS_INFO_VERSION_V2)
-		return -EINVAL;
-	n.version = NCP_GET_FS_INFO_VERSION_V2;
-
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, NCP_IOC_GET_FS_INFO_V2, (unsigned long)&n);
-	set_fs(old_fs);
-
-	if (!err) {
-		n32.version = n.version;
-		n32.mounted_uid = n.mounted_uid;
-		n32.connection = n.connection;
-		n32.buffer_size = n.buffer_size;
-		n32.volume_number = n.volume_number;
-		n32.directory_id = n.directory_id;
-		n32.dummy1 = n.dummy1;
-		n32.dummy2 = n.dummy2;
-		n32.dummy3 = n.dummy3;
-		err = copy_to_user((struct ncp_fs_info_v2_32*)arg, &n32, sizeof(n32)) ? -EFAULT : 0;
-	}
-	return err;
-}
-
-static int do_ncp_getobjectname(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_objectname_ioctl_32 n32;
-	struct ncp_objectname_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_objectname_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.object_name_len = tl = n32.object_name_len;
-	if (tl) {
-		n.object_name = kmalloc(tl, GFP_KERNEL);
-		if (!n.object_name)
-			return -ENOMEM;
-	} else {
-		n.object_name = NULL;
-	}
-
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_GETOBJECTNAME, (unsigned long)&n);
-	set_fs (old_fs);
-        if(err)
-		goto out;
-		
-	if (tl > n.object_name_len)
-		tl = n.object_name_len;
-
-	err = -EFAULT;
-	if (tl && copy_to_user((void *)A(n32.object_name), n.object_name, tl))
-		goto out;
-
-	n32.auth_type = n.auth_type;
-	n32.object_name_len = n.object_name_len;
-	
-	if (copy_to_user((struct ncp_objectname_ioctl_32*)arg, &n32, sizeof(n32)))
-		goto out;
-	
-	err = 0;
- out:
- 	if (n.object_name)
-		kfree(n.object_name);
-
-	return err;
-}
-
-static int do_ncp_setobjectname(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_objectname_ioctl_32 n32;
-	struct ncp_objectname_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_objectname_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.auth_type = n32.auth_type;
-	n.object_name_len = tl = n32.object_name_len;
-	if (tl) {
-		n.object_name = kmalloc(tl, GFP_KERNEL);
-		if (!n.object_name)
-			return -ENOMEM;
-		err = -EFAULT;
-		if (copy_from_user(n.object_name, (void *)A(n32.object_name), tl))
-			goto out;
-	} else {
-		n.object_name = NULL;
-	}
-	
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_SETOBJECTNAME, (unsigned long)&n);
-	set_fs (old_fs);
-		
- out:
-	if (n.object_name)
-		kfree(n.object_name);
-
-	return err;
-}
-
-static int do_ncp_getprivatedata(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_privatedata_ioctl_32 n32;
-	struct ncp_privatedata_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_privatedata_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.len = tl = n32.len;
-	if (tl) {
-		n.data = kmalloc(tl, GFP_KERNEL);
-		if (!n.data)
-			return -ENOMEM;
-	} else {
-		n.data = NULL;
-	}
-
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_GETPRIVATEDATA, (unsigned long)&n);
-	set_fs (old_fs);
-        if(err)
-		goto out;
-		
-	if (tl > n.len)
-		tl = n.len;
-
-	err = -EFAULT;
-	if (tl && copy_to_user((void *)A(n32.data), n.data, tl))
-		goto out;
-
-	n32.len = n.len;
-	
-	if (copy_to_user((struct ncp_privatedata_ioctl_32*)arg, &n32, sizeof(n32)))
-		goto out;
-	
-	err = 0;
- out:
- 	if (n.data)
-		kfree(n.data);
-
-	return err;
-}
-
-static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_privatedata_ioctl_32 n32;
-	struct ncp_privatedata_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_privatedata_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.len = tl = n32.len;
-	if (tl) {
-		n.data = kmalloc(tl, GFP_KERNEL);
-		if (!n.data)
-			return -ENOMEM;
-		err = -EFAULT;
-		if (copy_from_user(n.data, (void *)A(n32.data), tl))
-			goto out;
-	} else {
-		n.data = NULL;
-	}
-	
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_SETPRIVATEDATA, (unsigned long)&n);
-	set_fs (old_fs);
-		
- out:
-	if (n.data)
-		kfree(n.data);
-
-	return err;
-}
-
-
 #define HANDLE_IOCTL(cmd,handler) { cmd, (ioctl_trans_handler_t)handler, 0 },
 #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
 
@@ -350,17 +49,6 @@ COMPATIBLE_IOCTL(TIOCSLTC)
 COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
 COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
 
-/* And these ioctls need translation */
-
-/* NCPFS */
-HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest)
-HANDLE_IOCTL(NCP_IOC_GETMOUNTUID2_32, do_ncp_getmountuid2)
-HANDLE_IOCTL(NCP_IOC_GET_FS_INFO_V2_32, do_ncp_getfsinfo2)
-HANDLE_IOCTL(NCP_IOC_GETOBJECTNAME_32, do_ncp_getobjectname)
-HANDLE_IOCTL(NCP_IOC_SETOBJECTNAME_32, do_ncp_setobjectname)
-HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata)
-HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata)
-
 IOCTL_TABLE_END
 
 int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff --git a/arch/ppc64/kernel/iommu.c b/arch/ppc64/kernel/iommu.c
index fb321026e..5cac0d240 100644
--- a/arch/ppc64/kernel/iommu.c
+++ b/arch/ppc64/kernel/iommu.c
@@ -491,7 +491,7 @@ void *iommu_alloc_consistent(struct iommu_table *tbl, size_t size,
 	 */
 	if (order >= IOMAP_MAX_ORDER) {
 		printk("iommu_alloc_consistent size too large: 0x%lx\n", size);
-		return (void *)DMA_ERROR_CODE;
+		return NULL;
 	}
 
 	if (!tbl)
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index 5a4d3e472..7335442e4 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -370,16 +370,13 @@ skip:
 	return 0;
 }
 
-static inline int handle_irq_event(int irq, struct pt_regs *regs,
-				   struct irqaction *action)
+int handle_irq_event(int irq, struct pt_regs *regs, struct irqaction *action)
 {
 	int status = 0;
 	int retval = 0;
 
-#ifndef CONFIG_PPC_ISERIES
 	if (!(action->flags & SA_INTERRUPT))
 		local_irq_enable();
-#endif
 
 	do {
 		status |= action->flags;
@@ -388,9 +385,7 @@ static inline int handle_irq_event(int irq, struct pt_regs *regs,
 	} while (action);
 	if (status & SA_SAMPLE_RANDOM)
 		add_interrupt_randomness(irq);
-#ifndef CONFIG_PPC_ISERIES
 	local_irq_disable();
-#endif
 	return retval;
 }
 
@@ -486,6 +481,9 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
 	int cpu = smp_processor_id();
 	irq_desc_t *desc = get_irq_desc(irq);
 	irqreturn_t action_ret;
+#ifdef CONFIG_IRQSTACKS
+	struct thread_info *curtp, *irqtp;
+#endif
 
 	kstat_cpu(cpu).irqs[irq]++;
 
@@ -552,7 +550,22 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
 	 */
 	for (;;) {
 		spin_unlock(&desc->lock);
-		action_ret = handle_irq_event(irq, regs, action);
+
+#ifdef CONFIG_IRQSTACKS
+		/* Switch to the irq stack to handle this */
+		curtp = current_thread_info();
+		irqtp = hardirq_ctx[smp_processor_id()];
+		if (curtp != irqtp) {
+			irqtp->task = curtp->task;
+			irqtp->flags = 0;
+			action_ret = call_handle_irq_event(irq, regs, action, irqtp);
+			irqtp->task = NULL;
+			if (irqtp->flags)
+				set_bits(irqtp->flags, &curtp->flags);
+		} else
+#endif
+			action_ret = handle_irq_event(irq, regs, action);
+
 		spin_lock(&desc->lock);
 		if (!noirqdebug)
 			note_interrupt(irq, desc, action_ret);
@@ -628,6 +641,21 @@ int do_IRQ(struct pt_regs *regs)
 
 	irq_enter();
 
+#ifdef CONFIG_DEBUG_STACKOVERFLOW
+	/* Debugging check for stack overflow: is there less than 4KB free? */
+	{
+		long sp;
+
+		sp = __get_SP() & (THREAD_SIZE-1);
+
+		if (unlikely(sp < (sizeof(struct thread_info) + 4096))) {
+			printk("do_IRQ: stack overflow: %ld\n",
+				sp - sizeof(struct thread_info));
+			dump_stack();
+		}
+	}
+#endif
+
 	/*
 	 * Every arch is required to implement ppc_md.get_irq.
 	 * This function will either return an irq number or -1 to
@@ -679,6 +707,7 @@ void __init init_IRQ(void)
 	once++;
 
 	ppc_md.init_IRQ();
+	irq_ctx_init();
 }
 
 static struct proc_dir_entry * root_irq_dir;
@@ -702,7 +731,7 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off,
 	return len;
 }
 
-static int irq_affinity_write_proc (struct file *file, const char *buffer,
+static int irq_affinity_write_proc (struct file *file, const char __user *buffer,
 					unsigned long count, void *data)
 {
 	unsigned int irq = (long)data;
@@ -962,4 +991,51 @@ unsigned int real_irq_to_virt_slowpath(unsigned int real_irq)
 
 }
 
-#endif
+#endif /* CONFIG_PPC_ISERIES */
+
+#ifdef CONFIG_IRQSTACKS
+struct thread_info *softirq_ctx[NR_CPUS];
+struct thread_info *hardirq_ctx[NR_CPUS];
+
+void irq_ctx_init(void)
+{
+	struct thread_info *tp;
+	int i;
+
+	for (i = 0; i < NR_CPUS; i++) {
+		memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
+		tp = softirq_ctx[i];
+		tp->cpu = i;
+		tp->preempt_count = SOFTIRQ_OFFSET;
+
+		memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
+		tp = hardirq_ctx[i];
+		tp->cpu = i;
+		tp->preempt_count = HARDIRQ_OFFSET;
+	}
+}
+
+void do_softirq(void)
+{
+	unsigned long flags;
+	struct thread_info *curtp, *irqtp;
+
+	if (in_interrupt())
+		return;
+
+	local_irq_save(flags);
+
+	if (local_softirq_pending()) {
+		curtp = current_thread_info();
+		irqtp = softirq_ctx[smp_processor_id()];
+		irqtp->task = curtp->task;
+		call_do_softirq(irqtp);
+		irqtp->task = NULL;
+	}
+
+	local_irq_restore(flags);
+}
+EXPORT_SYMBOL(do_softirq);
+
+#endif /* CONFIG_IRQSTACKS */
+
diff --git a/arch/ppc64/kernel/mf_proc.c b/arch/ppc64/kernel/mf_proc.c
index 2992f2819..5d48ce84a 100644
--- a/arch/ppc64/kernel/mf_proc.c
+++ b/arch/ppc64/kernel/mf_proc.c
@@ -177,10 +177,14 @@ static int proc_mf_change_cmdline(struct file *file, const char *buffer,
 static int proc_mf_change_vmlinux(struct file *file, const char *buffer,
 		unsigned long count, void *data)
 {
+	int rc;
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	mf_setVmlinuxChunk(buffer, count, file->f_pos, (u64)data);
+	rc = mf_setVmlinuxChunk(buffer, count, file->f_pos, (u64)data);
+	if (rc < 0)
+		return rc;
+
 	file->f_pos += count;
 
 	return count;			
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index a59c0408a..9f784fb56 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -102,6 +102,30 @@ _GLOBAL(local_irq_restore)
 	blr
 #endif /* CONFIG_PPC_ISERIES */
 
+#ifdef CONFIG_IRQSTACKS
+_GLOBAL(call_do_softirq)
+	mflr	r0
+	std	r0,16(r1)
+	stdu	r1,THREAD_SIZE-112(r3)
+	mr	r1,r3
+	bl	.__do_softirq
+	ld	r1,0(r1)
+	ld	r0,16(r1)
+	mtlr	r0
+	blr
+
+_GLOBAL(call_handle_irq_event)
+	mflr	r0
+	std	r0,16(r1)
+	stdu	r1,THREAD_SIZE-112(r6)
+	mr	r1,r6
+	bl	.handle_irq_event
+	ld	r1,0(r1)
+	ld	r0,16(r1)
+	mtlr	r0
+	blr
+#endif /* CONFIG_IRQSTACKS */
+
 /*
  * Flush instruction cache.
  */
@@ -316,6 +340,8 @@ _GLOBAL(_insb)
 	eieio
 	stbu	r5,1(r4)
 	bdnz	00b
+	twi	0,r5,0
+	isync
 	blr
 
 _GLOBAL(_outsb)
@@ -325,8 +351,8 @@ _GLOBAL(_outsb)
 	blelr-
 00:	lbzu	r5,1(r4)
 	stb	r5,0(r3)
-	eieio
 	bdnz	00b
+	sync
 	blr	
 
 _GLOBAL(_insw)
@@ -338,6 +364,8 @@ _GLOBAL(_insw)
 	eieio
 	sthu	r5,2(r4)
 	bdnz	00b
+	twi	0,r5,0
+	isync
 	blr
 
 _GLOBAL(_outsw)
@@ -346,9 +374,9 @@ _GLOBAL(_outsw)
 	subi	r4,r4,2
 	blelr-
 00:	lhzu	r5,2(r4)
-	eieio
 	sthbrx	r5,0,r3	
 	bdnz	00b
+	sync
 	blr	
 
 _GLOBAL(_insl)
@@ -360,6 +388,8 @@ _GLOBAL(_insl)
 	eieio
 	stwu	r5,4(r4)
 	bdnz	00b
+	twi	0,r5,0
+	isync
 	blr
 
 _GLOBAL(_outsl)
@@ -369,8 +399,8 @@ _GLOBAL(_outsl)
 	blelr-
 00:	lwzu	r5,4(r4)
 	stwbrx	r5,0,r3
-	eieio
 	bdnz	00b
+	sync
 	blr	
 
 /* _GLOBAL(ide_insw) now in drivers/ide/ide-iops.c */
@@ -383,6 +413,8 @@ _GLOBAL(_insw_ns)
 	eieio
 	sthu	r5,2(r4)
 	bdnz	00b
+	twi	0,r5,0
+	isync
 	blr
 
 /* _GLOBAL(ide_outsw) now in drivers/ide/ide-iops.c */
@@ -393,8 +425,8 @@ _GLOBAL(_outsw_ns)
 	blelr-
 00:	lhzu	r5,2(r4)
 	sth	r5,0(r3)
-	eieio
 	bdnz	00b
+	sync
 	blr	
 
 _GLOBAL(_insl_ns)
@@ -406,6 +438,8 @@ _GLOBAL(_insl_ns)
 	eieio
 	stwu	r5,4(r4)
 	bdnz	00b
+	twi	0,r5,0
+	isync
 	blr
 
 _GLOBAL(_outsl_ns)
@@ -415,8 +449,8 @@ _GLOBAL(_outsl_ns)
 	blelr-
 00:	lwzu	r5,4(r4)
 	stw	r5,0(r3)
-	eieio
 	bdnz	00b
+	sync
 	blr	
 
 _GLOBAL(abs)
@@ -717,8 +751,8 @@ _GLOBAL(sys_call_table32)
 	.llong .ppc32_select
 	.llong .sys_flock
 	.llong .sys_msync
-	.llong .sys32_readv		/* 145 */
-	.llong .sys32_writev
+	.llong .compat_sys_readv	/* 145 */
+	.llong .compat_sys_writev
 	.llong .sys32_getsid
 	.llong .sys_fdatasync
 	.llong .sys32_sysctl
@@ -740,7 +774,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys_getresuid	        /* 165 */
 	.llong .sys_ni_syscall		/* old query_module syscall */
 	.llong .sys_poll
-	.llong .sys32_nfsservctl
+	.llong .compat_sys_nfsservctl
 	.llong .sys_setresgid
 	.llong .sys_getresgid	        /* 170 */
 	.llong .sys32_prctl
@@ -840,6 +874,7 @@ _GLOBAL(sys_call_table32)
 	.llong .compat_sys_mq_timedreceive /* 265 */
 	.llong .compat_sys_mq_notify
 	.llong .compat_sys_mq_getsetattr
+	.llong .sys_ni_syscall		/* 268 reserved for sys_kexec_load */
 
 	.balign 8
 _GLOBAL(sys_call_table)
@@ -1029,7 +1064,7 @@ _GLOBAL(sys_call_table)
 	.llong .sys_capget
 	.llong .sys_capset
 	.llong .sys_sigaltstack	        /* 185 */
-	.llong .sys_sendfile
+	.llong .sys_sendfile64
 	.llong .sys_ni_syscall		/* reserved for streams1 */
 	.llong .sys_ni_syscall		/* reserved for streams2 */
 	.llong .sys_vfork
@@ -1111,3 +1146,4 @@ _GLOBAL(sys_call_table)
 	.llong .sys_mq_timedreceive	/* 265 */
 	.llong .sys_mq_notify
 	.llong .sys_mq_getsetattr
+	.llong .sys_ni_syscall		/* 268 reserved for sys_kexec_load */
diff --git a/arch/ppc64/kernel/module.c b/arch/ppc64/kernel/module.c
index 7a6246394..5bccbc5f0 100644
--- a/arch/ppc64/kernel/module.c
+++ b/arch/ppc64/kernel/module.c
@@ -138,6 +138,16 @@ static unsigned long get_stubs_size(const Elf64_Ehdr *hdr,
 	return relocs * sizeof(struct ppc64_stub_entry);
 }
 
+static void dedotify_versions(struct modversion_info *vers,
+			      unsigned long size)
+{
+	struct modversion_info *end;
+
+	for (end = (void *)vers + size; vers < end; vers++)
+		if (vers->name[0] == '.')
+			memmove(vers->name, vers->name+1, strlen(vers->name));
+}
+
 /* Undefined symbols which refer to .funcname, hack to funcname */
 static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
 {
@@ -166,6 +176,9 @@ int module_frob_arch_sections(Elf64_Ehdr *hdr,
 			me->arch.stubs_section = i;
 		else if (strcmp(secstrings + sechdrs[i].sh_name, ".toc") == 0)
 			me->arch.toc_section = i;
+		else if (strcmp(secstrings+sechdrs[i].sh_name,"__versions")==0)
+			dedotify_versions((void *)hdr + sechdrs[i].sh_offset,
+					  sechdrs[i].sh_size);
 
 		/* We don't handle .init for the moment: rename to _init */
 		while ((p = strstr(secstrings + sechdrs[i].sh_name, ".init")))
diff --git a/arch/ppc64/kernel/pSeries_nvram.c b/arch/ppc64/kernel/pSeries_nvram.c
index ff775a948..ebccb1663 100644
--- a/arch/ppc64/kernel/pSeries_nvram.c
+++ b/arch/ppc64/kernel/pSeries_nvram.c
@@ -29,7 +29,7 @@
 #include <asm/machdep.h>
 
 static unsigned int nvram_size;
-static unsigned int nvram_fetch, nvram_store;
+static int nvram_fetch, nvram_store;
 static char nvram_buf[NVRW_CNT];	/* assume this is in the first 4GB */
 static spinlock_t nvram_lock = SPIN_LOCK_UNLOCKED;
 
diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
index 422254f34..d283f4897 100644
--- a/arch/ppc64/kernel/pacaData.c
+++ b/arch/ppc64/kernel/pacaData.c
@@ -36,11 +36,13 @@ struct systemcfg *systemcfg;
 {									    \
 	.xLpPacaPtr = &paca[number].xLpPaca,				    \
 	.xLpRegSavePtr = &paca[number].xRegSav,				    \
+	.lock_token = 0x8000,						    \
 	.xPacaIndex = (number),		/* Paca Index */		    \
 	.default_decr = 0x00ff0000,	/* Initial Decr */		    \
 	.xStab_data = {							    \
 		.real = (asrr),		/* Real pointer to segment table */ \
 		.virt = (asrv),		/* Virt pointer to segment table */ \
+		.next_round_robin = 1,					    \
 	},								    \
 	.lpQueuePtr = (lpq),		/* &xItLpQueue, */		    \
 	/* .xRtas = {							    \
@@ -53,7 +55,8 @@ struct systemcfg *systemcfg;
 		.xFPRegsInUse = 1,					    \
 		.xDynProcStatus = 2,					    \
 		.xDecrVal = 0x00ff0000,					    \
-		.xEndOfQuantum = 0xffffffffffffffff			    \
+		.xEndOfQuantum = 0xfffffffffffffffful,			    \
+		.xSLBCount = 64,					    \
 	},								    \
 	.xRegSav = {							    \
 		.xDesc = 0xd397d9e2,	/* "LpRS" */			    \
diff --git a/arch/ppc64/kernel/pmac_feature.c b/arch/ppc64/kernel/pmac_feature.c
index dbc94842d..c059a7608 100644
--- a/arch/ppc64/kernel/pmac_feature.c
+++ b/arch/ppc64/kernel/pmac_feature.c
@@ -343,6 +343,10 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
 		PMAC_TYPE_POWERMAC_G5,		g5_features,
 		0,
 	},
+	{       "RackMac3,1",                   "XServe G5",
+		PMAC_TYPE_POWERMAC_G5,          g5_features,
+		0,
+	},
 };
 
 /*
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
index a64973cf5..be153b959 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/ppc64/kernel/process.c
@@ -332,8 +332,8 @@ void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp)
          * entry is the TOC value we need to use.
          */
 	set_fs(USER_DS);
-	__get_user(entry, (unsigned long *)fdptr);
-	__get_user(toc, (unsigned long *)fdptr+1);
+	__get_user(entry, (unsigned long __user *)fdptr);
+	__get_user(toc, (unsigned long __user *)fdptr+1);
 
 	/* Check whether the e_entry function descriptor entries
 	 * need to be relocated before we can use them.
@@ -386,7 +386,7 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
 	unsigned int val;
 
 	val = __unpack_fe01(tsk->thread.fpexc_mode);
-	return put_user(val, (unsigned int *) adr);
+	return put_user(val, (unsigned int __user *) adr);
 }
 
 int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3,
@@ -410,7 +410,7 @@ int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3,
 	}
 
 	return do_fork(clone_flags & ~CLONE_IDLETASK, p2, regs, 0,
-		    (int *)parent_tidptr, (int *)child_tidptr);
+		    (int __user *)parent_tidptr, (int __user *)child_tidptr);
 }
 
 int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
@@ -435,7 +435,7 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 	int error;
 	char * filename;
 	
-	filename = getname((char *) a0);
+	filename = getname((char __user *) a0);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
@@ -445,7 +445,8 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 	if (regs->msr & MSR_VEC)
 		giveup_altivec(current);
 #endif /* CONFIG_ALTIVEC */
-	error = do_execve(filename, (char **) a1, (char **) a2, regs);
+	error = do_execve(filename, (char __user * __user *) a1,
+				    (char __user * __user *) a2, regs);
   
 	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
@@ -457,23 +458,29 @@ out:
 
 static int kstack_depth_to_print = 64;
 
-static inline int validate_sp(unsigned long sp, struct task_struct *p)
+static int validate_sp(unsigned long sp, struct task_struct *p,
+		       unsigned long nbytes)
 {
 	unsigned long stack_page = (unsigned long)p->thread_info;
 
-	if (sp < stack_page + sizeof(struct thread_struct))
-		return 0;
-	if (sp >= stack_page + THREAD_SIZE)
-		return 0;
+	if (sp >= stack_page + sizeof(struct thread_struct)
+	    && sp <= stack_page + THREAD_SIZE - nbytes)
+		return 1;
 
-	return 1;
-}
+#ifdef CONFIG_IRQSTACKS
+	stack_page = (unsigned long) hardirq_ctx[task_cpu(p)];
+	if (sp >= stack_page + sizeof(struct thread_struct)
+	    && sp <= stack_page + THREAD_SIZE - nbytes)
+		return 1;
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched    (*(unsigned long *)scheduling_functions_start_here)
-#define last_sched     (*(unsigned long *)scheduling_functions_end_here)
+	stack_page = (unsigned long) softirq_ctx[task_cpu(p)];
+	if (sp >= stack_page + sizeof(struct thread_struct)
+	    && sp <= stack_page + THREAD_SIZE - nbytes)
+		return 1;
+#endif
+
+	return 0;
+}
 
 unsigned long get_wchan(struct task_struct *p)
 {
@@ -484,16 +491,16 @@ unsigned long get_wchan(struct task_struct *p)
 		return 0;
 
 	sp = p->thread.ksp;
-	if (!validate_sp(sp, p))
+	if (!validate_sp(sp, p, 112))
 		return 0;
 
 	do {
 		sp = *(unsigned long *)sp;
-		if (!validate_sp(sp, p))
+		if (!validate_sp(sp, p, 112))
 			return 0;
 		if (count > 0) {
 			ip = *(unsigned long *)(sp + 16);
-			if (ip < first_sched || ip >= last_sched)
+			if (!in_sched_functions(ip))
 				return ip;
 		}
 	} while (count++ < 16);
@@ -502,9 +509,10 @@ unsigned long get_wchan(struct task_struct *p)
 
 void show_stack(struct task_struct *p, unsigned long *_sp)
 {
-	unsigned long ip;
+	unsigned long ip, newsp, lr;
 	int count = 0;
 	unsigned long sp = (unsigned long)_sp;
+	int firstframe = 1;
 
 	if (sp == 0) {
 		if (p) {
@@ -515,17 +523,40 @@ void show_stack(struct task_struct *p, unsigned long *_sp)
 		}
 	}
 
-	if (!validate_sp(sp, p))
-		return;
-
+	lr = 0;
 	printk("Call Trace:\n");
 	do {
-		sp = *(unsigned long *)sp;
-		if (!validate_sp(sp, p))
+		if (!validate_sp(sp, p, 112))
 			return;
-		ip = *(unsigned long *)(sp + 16);
-		printk("[%016lx] ", ip);
-		print_symbol("%s\n", ip);
+
+		_sp = (unsigned long *) sp;
+		newsp = _sp[0];
+		ip = _sp[2];
+		if (!firstframe || ip != lr) {
+			printk("[%016lx] [%016lx] ", sp, ip);
+			print_symbol("%s", ip);
+			if (firstframe)
+				printk(" (unreliable)");
+			printk("\n");
+		}
+		firstframe = 0;
+
+		/*
+		 * See if this is an exception frame.
+		 * We look for the "regshere" marker in the current frame.
+		 */
+		if (validate_sp(sp, p, sizeof(struct pt_regs) + 400)
+		    && _sp[12] == 0x7265677368657265ul) {
+			struct pt_regs *regs = (struct pt_regs *)
+				(sp + STACK_FRAME_OVERHEAD);
+			printk("--- Exception: %lx", regs->trap);
+			print_symbol(" at %s\n", regs->nip);
+			lr = regs->link;
+			print_symbol("    LR = %s\n", lr);
+			firstframe = 1;
+		}
+
+		sp = newsp;
 	} while (count++ < kstack_depth_to_print);
 }
 
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index 527c1eea1..a5f8f2418 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -458,13 +458,6 @@ static void __init prom_initialize_naca(void)
 		PROM_BUG();
 	}
 
-	/* 
-	 * Hardcode to GP size.  I am not sure where to get this info
-	 * in general, as there does not appear to be a slb-size OF
-	 * entry.  At least in Condor and earlier.  DRENG 
-	 */
-	_naca->slb_size = 64;
-
 	/* Add an eye catcher and the systemcfg layout version number */
 	strcpy(_systemcfg->eye_catcher, RELOC("SYSTEMCFG:PPC64"));
 	_systemcfg->version.major = SYSTEMCFG_MAJOR;
@@ -654,8 +647,6 @@ static void __init prom_initialize_lmb(void)
 #endif /* DEBUG_PROM */
 }
 
-static char hypertas_funcs[1024];
-
 static void __init
 prom_instantiate_rtas(void)
 {
@@ -665,6 +656,7 @@ prom_instantiate_rtas(void)
 	struct systemcfg *_systemcfg = RELOC(systemcfg);
 	ihandle prom_rtas;
         u32 getprop_rval;
+	char hypertas_funcs[4];
 
 #ifdef DEBUG_PROM
 	prom_print(RELOC("prom_instantiate_rtas: start...\n"));
@@ -1556,7 +1548,7 @@ static void __init *__make_room(unsigned long *mem_start, unsigned long *mem_end
 		if (*mem_end != RELOC(initrd_start))
 			prom_panic(RELOC("No memory for copy_device_tree"));
 
-		prom_print("Huge device_tree: moving initrd\n");
+		prom_print(RELOC("Huge device_tree: moving initrd\n"));
 		/* Move by 4M. */
 		initrd_len = RELOC(initrd_end) - RELOC(initrd_start);
 		*mem_end = RELOC(initrd_start) + 4 * 1024 * 1024;
@@ -1590,6 +1582,7 @@ inspect_node(phandle node, struct device_node *dad,
 	char *prev_name, *namep;
 	unsigned char *valp;
 	unsigned long offset = reloc_offset();
+	phandle ibm_phandle;
 
 	np = make_room(mem_start, mem_end, struct device_node);
 	memset(np, 0, sizeof(*np));
@@ -1652,23 +1645,24 @@ inspect_node(phandle node, struct device_node *dad,
 		prev_propp = &pp->next;
 	}
 
-	/* Add a "linux_phandle" value */
-        if (np->node) {
-		u32 ibm_phandle = 0;
-		int len;
-
-                /* First see if "ibm,phandle" exists and use its value */
-                len = (int)
-                        call_prom(RELOC("getprop"), 4, 1, node, RELOC("ibm,phandle"),
-                                  &ibm_phandle, sizeof(ibm_phandle));
-                if (len < 0) {
-                        np->linux_phandle = np->node;
-                } else {
-                        np->linux_phandle = ibm_phandle;
-		}
-	}
-
-	*prev_propp = 0;
+	/* Add a "linux,phandle" property. */
+	namep = make_room(mem_start, mem_end, char[16]);
+	strcpy(namep, RELOC("linux,phandle"));
+	pp = make_room(mem_start, mem_end, struct property);
+	pp->name = PTRUNRELOC(namep);
+	pp->length = sizeof(phandle);
+	valp = make_room(mem_start, mem_end, phandle);
+	pp->value = PTRUNRELOC(valp);
+	*(phandle *)valp = node;
+	*prev_propp = PTRUNRELOC(pp);
+	pp->next = NULL;
+
+	/* Set np->linux_phandle to the value of the ibm,phandle property
+	   if it exists, otherwise to the phandle for this node. */
+	np->linux_phandle = node;
+	if ((int)call_prom(RELOC("getprop"), 4, 1, node, RELOC("ibm,phandle"),
+			   &ibm_phandle, sizeof(ibm_phandle)) > 0)
+		np->linux_phandle = ibm_phandle;
 
 	/* get the node's full name */
 	namep = (char *)*mem_start;
@@ -2189,11 +2183,13 @@ map_interrupt(unsigned int **irq, struct device_node **ictrler,
 		ints = imap - nintrc;
 		reg = ints - naddrc;
 	}
+	if (p == NULL) {
 #ifdef DEBUG_IRQ
-	if (p == NULL)
 		printk("hmmm, int tree for %s doesn't have ctrler\n",
 		       np->full_name);
 #endif
+		return 0;
+	}
 	*irq = ints;
 	*ictrler = p;
 	return nintrc;
@@ -2204,7 +2200,7 @@ finish_node_interrupts(struct device_node *np, unsigned long mem_start,
 		       int measure_only)
 {
 	unsigned int *ints;
-	int intlen, intrcells;
+	int intlen, intrcells, intrcount;
 	int i, j, n;
 	unsigned int *irq, virq;
 	struct device_node *ic;
@@ -2214,34 +2210,40 @@ finish_node_interrupts(struct device_node *np, unsigned long mem_start,
 		return mem_start;
 	intrcells = prom_n_intr_cells(np);
 	intlen /= intrcells * sizeof(unsigned int);
-	np->n_intrs = intlen;
 	np->intrs = (struct interrupt_info *) mem_start;
 	mem_start += intlen * sizeof(struct interrupt_info);
 
 	if (measure_only)
 		return mem_start;
 
-	for (i = 0; i < intlen; ++i) {
-		np->intrs[i].line = 0;
-		np->intrs[i].sense = 1;
+	intrcount = 0;
+	for (i = 0; i < intlen; ++i, ints += intrcells) {
 		n = map_interrupt(&irq, &ic, np, ints, intrcells);
 		if (n <= 0)
 			continue;
-		virq = virt_irq_create_mapping(irq[0]);
-		if (virq == NO_IRQ) {
-			printk(KERN_CRIT "Could not allocate interrupt "
-			       "number for %s\n", np->full_name);
-		} else
-			np->intrs[i].line = irq_offset_up(virq);
+
+		/* don't map IRQ numbers under a cascaded 8259 controller */
+		if (ic && device_is_compatible(ic, "chrp,iic")) {
+			np->intrs[intrcount].line = irq[0];
+		} else {
+			virq = virt_irq_create_mapping(irq[0]);
+			if (virq == NO_IRQ) {
+				printk(KERN_CRIT "Could not allocate interrupt"
+				       " number for %s\n", np->full_name);
+				continue;
+			}
+			np->intrs[intrcount].line = irq_offset_up(virq);
+		}
 
 		/* We offset irq numbers for the u3 MPIC by 128 in PowerMac */
 		if (systemcfg->platform == PLATFORM_POWERMAC && ic && ic->parent) {
 			char *name = get_property(ic->parent, "name", NULL);
 			if (name && !strcmp(name, "u3"))
-				np->intrs[i].line += 128;
+				np->intrs[intrcount].line += 128;
 		}
+		np->intrs[intrcount].sense = 1;
 		if (n > 1)
-			np->intrs[i].sense = irq[1];
+			np->intrs[intrcount].sense = irq[1];
 		if (n > 2) {
 			printk("hmmm, got %d intr cells for %s:", n,
 			       np->full_name);
@@ -2249,8 +2251,9 @@ finish_node_interrupts(struct device_node *np, unsigned long mem_start,
 				printk(" %d", irq[j]);
 			printk("\n");
 		}
-		ints += intrcells;
+		++intrcount;
 	}
+	np->n_intrs = intrcount;
 
 	return mem_start;
 }
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c
index 6afe71a7d..efc9dbd3b 100644
--- a/arch/ppc64/kernel/ptrace.c
+++ b/arch/ppc64/kernel/ptrace.c
@@ -101,7 +101,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -123,7 +123,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 				giveup_fpu(child);
 			tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
 		}
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -213,7 +213,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 	case PPC_PTRACE_GETREGS: { /* Get GPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
-		unsigned long *tmp = (unsigned long *)addr;
+		unsigned long __user *tmp = (unsigned long __user *)addr;
 
 		for (i = 0; i < 32; i++) {
 			ret = put_user(*reg, tmp);
@@ -228,7 +228,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 	case PPC_PTRACE_SETREGS: { /* Set GPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
-		unsigned long *tmp = (unsigned long *)addr;
+		unsigned long __user *tmp = (unsigned long __user *)addr;
 
 		for (i = 0; i < 32; i++) {
 			ret = get_user(*reg, tmp);
@@ -243,7 +243,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 	case PPC_PTRACE_GETFPREGS: { /* Get FPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
-		unsigned long *tmp = (unsigned long *)addr;
+		unsigned long __user *tmp = (unsigned long __user *)addr;
 
 		if (child->thread.regs->msr & MSR_FP)
 			giveup_fpu(child);
@@ -261,7 +261,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 	case PPC_PTRACE_SETFPREGS: { /* Get FPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
-		unsigned long *tmp = (unsigned long *)addr;
+		unsigned long __user *tmp = (unsigned long __user *)addr;
 
 		if (child->thread.regs->msr & MSR_FP)
 			giveup_fpu(child);
diff --git a/arch/ppc64/kernel/ptrace32.c b/arch/ppc64/kernel/ptrace32.c
index 3309bf2c4..309db1c08 100644
--- a/arch/ppc64/kernel/ptrace32.c
+++ b/arch/ppc64/kernel/ptrace32.c
@@ -89,7 +89,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp, (u32*)data);
+		ret = put_user(tmp, (u32 __user *)data);
 		break;
 	}
 
@@ -106,19 +106,19 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 	case PPC_PTRACE_PEEKDATA_3264: {
 		u32 tmp;
 		int copied;
-		u32* addrOthers;
+		u32 __user * addrOthers;
 
 		ret = -EIO;
 
 		/* Get the addr in the other process that we want to read */
-		if (get_user(addrOthers, (u32**)addr) != 0)
+		if (get_user(addrOthers, (u32 __user * __user *)addr) != 0)
 			break;
 
 		copied = access_process_vm(child, (u64)addrOthers, &tmp,
 				sizeof(tmp), 0);
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp, (u32*)data);
+		ret = put_user(tmp, (u32 __user *)data);
 		break;
 	}
 
@@ -145,7 +145,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 			 */
 			tmp = ((unsigned int *)child->thread.fpr)[index - PT_FPR0];
 		}
-		ret = put_user((unsigned int)tmp, (u32*)data);
+		ret = put_user((unsigned int)tmp, (u32 __user *)data);
 		break;
 	}
   
@@ -186,7 +186,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 			tmp = get_reg(child, numReg);
 		} 
 		reg32bits = ((u32*)&tmp)[part];
-		ret = put_user(reg32bits, (u32*)data);
+		ret = put_user(reg32bits, (u32 __user *)data);
 		break;
 	}
 
@@ -215,11 +215,11 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 	case PPC_PTRACE_POKETEXT_3264:
 	case PPC_PTRACE_POKEDATA_3264: {
 		u32 tmp = data;
-		u32* addrOthers;
+		u32 __user * addrOthers;
 
 		/* Get the addr in the other process that we want to write into */
 		ret = -EIO;
-		if (get_user(addrOthers, (u32**)addr) != 0)
+		if (get_user(addrOthers, (u32 __user * __user *)addr) != 0)
 			break;
 		ret = 0;
 		if (access_process_vm(child, (u64)addrOthers, &tmp,
@@ -347,7 +347,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 	case PPC_PTRACE_GETREGS: { /* Get GPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
-		unsigned int *tmp = (unsigned int *)addr;
+		unsigned int __user *tmp = (unsigned int __user *)addr;
 
 		for (i = 0; i < 32; i++) {
 			ret = put_user(*reg, tmp);
@@ -362,7 +362,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 	case PPC_PTRACE_SETREGS: { /* Set GPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
-		unsigned int *tmp = (unsigned int *)addr;
+		unsigned int __user *tmp = (unsigned int __user *)addr;
 
 		for (i = 0; i < 32; i++) {
 			ret = get_user(*reg, tmp);
@@ -377,7 +377,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 	case PPC_PTRACE_GETFPREGS: { /* Get FPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
-		unsigned int *tmp = (unsigned int *)addr;
+		unsigned int __user *tmp = (unsigned int __user *)addr;
 
 		if (child->thread.regs->msr & MSR_FP)
 			giveup_fpu(child);
@@ -395,7 +395,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 	case PPC_PTRACE_SETFPREGS: { /* Get FPRs 0 - 31. */
 		int i;
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
-		unsigned int *tmp = (unsigned int *)addr;
+		unsigned int __user *tmp = (unsigned int __user *)addr;
 
 		if (child->thread.regs->msr & MSR_FP)
 			giveup_fpu(child);
diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c
index f555d42bd..338f66084 100644
--- a/arch/ppc64/kernel/rtas-proc.c
+++ b/arch/ppc64/kernel/rtas-proc.c
@@ -541,7 +541,7 @@ char * ppc_rtas_process_error(int error)
 		case SENSOR_BUSY:
 			return "(busy)";
 		case SENSOR_NOT_EXIST:
-			return "(non existant)";
+			return "(non existent)";
 		case SENSOR_DR_ENTITY:
 			return "(dr entity removed)";
 		default:
@@ -698,7 +698,7 @@ int ppc_rtas_process_sensor(struct individual_sensor s, int state,
 			}
 			break;
 		default:
-			n += sprintf(buf+n,  "Unkown sensor (type %d), ignoring it\n",
+			n += sprintf(buf+n,  "Unknown sensor (type %d), ignoring it\n",
 					s.token);
 			unknown = 1;
 			have_strings = 1;
diff --git a/arch/ppc64/kernel/rtas.c b/arch/ppc64/kernel/rtas.c
index 4a26e1cff..ff59b0057 100644
--- a/arch/ppc64/kernel/rtas.c
+++ b/arch/ppc64/kernel/rtas.c
@@ -79,7 +79,7 @@ call_rtas_display_status(char c)
 	args->rets  = (rtas_arg_t *)&(args->args[1]);
 	args->args[0] = (int)c;
 
-	enter_rtas((void *)__pa((unsigned long)args));	
+	enter_rtas(__pa(args));
 
 	spin_unlock_irqrestore(&rtas.lock, s);
 }
@@ -115,9 +115,9 @@ __log_rtas_error(struct rtas_args *rtas_args)
 	get_paca()->xRtas = err_args;
 
 	PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
-	       (void *)__pa((unsigned long)&err_args));
-	enter_rtas((void *)__pa((unsigned long)&get_paca()->xRtas));
-	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");	
+	       __pa(&err_args));
+	enter_rtas(__pa(&get_paca()->xRtas));
+	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
 
 	err_args = get_paca()->xRtas;
 	get_paca()->xRtas = temp_args;
@@ -174,8 +174,8 @@ rtas_call(int token, int nargs, int nret,
 		rtas_args->rets[i] = 0;
 
 	PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
-		(void *)__pa((unsigned long)rtas_args));
-	enter_rtas((void *)__pa((unsigned long)rtas_args));
+		__pa(rtas_args));
+	enter_rtas(__pa(rtas_args));
 	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
 
 	if (rtas_args->rets[0] == -1)
@@ -345,7 +345,7 @@ rtas_flash_firmware(void)
 	rtas_firmware_flash_list.num_blocks = 0;
 	flist = (struct flash_block_list *)&rtas_firmware_flash_list;
 	rtas_block_list = virt_to_abs(flist);
-	if (rtas_block_list >= (4UL << 20)) {
+	if (rtas_block_list >= 4UL*1024*1024*1024) {
 		printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
 		return;
 	}
@@ -480,7 +480,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 	spin_lock_irqsave(&rtas.lock, flags);
 
 	get_paca()->xRtas = args;
-	enter_rtas((void *)__pa((unsigned long)&get_paca()->xRtas));
+	enter_rtas(__pa(&get_paca()->xRtas));
 	args = get_paca()->xRtas;
 
 	spin_unlock_irqrestore(&rtas.lock, flags);
@@ -515,7 +515,7 @@ void rtas_stop_self(void)
 
 	printk("%u %u Ready to die...\n",
 	       smp_processor_id(), hard_smp_processor_id());
-	enter_rtas((void *)__pa(rtas_args));
+	enter_rtas(__pa(rtas_args));
 
 	panic("Alas, I survived.\n");
 }
diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c
index 907540324..e9d21eb4e 100644
--- a/arch/ppc64/kernel/rtas_flash.c
+++ b/arch/ppc64/kernel/rtas_flash.c
@@ -692,7 +692,7 @@ int __init rtas_flash_init(void)
 	if (rc != 0)
 		goto cleanup;
 
-	manage_pde = create_flash_pde("ppc64/rtas" MANAGE_FLASH_NAME,
+	manage_pde = create_flash_pde("ppc64/rtas/" MANAGE_FLASH_NAME,
 				      &manage_flash_operations);
 	if (manage_pde == NULL) {
 		rc = -ENOMEM;
diff --git a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c
index a9a3128cf..eea82c7b2 100644
--- a/arch/ppc64/kernel/rtasd.c
+++ b/arch/ppc64/kernel/rtasd.c
@@ -372,7 +372,7 @@ static int rtasd(void *unused)
 	if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1)
 		goto error;
 
-	rtas_log_buf = vmalloc(rtas_error_log_max*LOG_NUMBER);
+	rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
 	if (!rtas_log_buf) {
 		printk(KERN_ERR "rtasd: no memory\n");
 		goto error;
@@ -450,7 +450,7 @@ static int __init rtas_init(void)
 		return 1;
 	}
 
-	entry = create_proc_entry("ppc64/error_log", S_IRUSR, NULL);
+	entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL);
 	if (entry)
 		entry->proc_fops = &proc_rtas_log_operations;
 	else
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index 65b9356eb..f13739566 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -476,6 +476,7 @@ static int __init set_preferred_console(void)
 {
 	struct device_node *prom_stdout;
 	char *name;
+	int offset;
 
 	/* The user has requested a console so this is already set up. */
 	if (strstr(saved_command_line, "console="))
@@ -493,7 +494,6 @@ static int __init set_preferred_console(void)
 		int i;
 		u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
 		if (i > 8) {
-			int offset;
 			switch (reg[1]) {
 				case 0x3f8:
 					offset = 0;
@@ -511,15 +511,19 @@ static int __init set_preferred_console(void)
 					/* We dont recognise the serial port */
 					return -ENODEV;
 			}
-
-			return add_preferred_console("ttyS", offset, NULL);
 		}
-	} else if (strcmp(name, "vty") == 0) {
+	} else if (strcmp(name, "vty") == 0)
 		/* pSeries LPAR virtual console */
 		return add_preferred_console("hvc", 0, NULL);
-	}
+	else if (strcmp(name, "ch-a") == 0)
+		offset = 0;
+	else if (strcmp(name, "ch-b") == 0)
+		offset = 1;
+	else
+		return -ENODEV;
+
+	return add_preferred_console("ttyS", offset, NULL);
 
-	return -ENODEV;
 }
 console_initcall(set_preferred_console);
 
@@ -568,6 +572,23 @@ void __init ppc64_calibrate_delay(void)
 
 extern void (*calibrate_delay)(void);
 
+#ifdef CONFIG_IRQSTACKS
+static void __init irqstack_early_init(void)
+{
+	int i;
+
+	/* interrupt stacks must be under 256MB, we cannot afford to take SLB misses on them */
+	for (i = 0; i < NR_CPUS; i++) {
+		softirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE,
+					THREAD_SIZE, 0x10000000));
+		hardirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE,
+					THREAD_SIZE, 0x10000000));
+	}
+}
+#else
+#define irqstack_early_init()
+#endif
+
 /*
  * Called into from start_kernel, after lock_kernel has been called.
  * Initializes bootmem, which is unsed to manage page allocation until
@@ -613,6 +634,8 @@ void __init setup_arch(char **cmdline_p)
 	strlcpy(saved_command_line, cmd_line, sizeof(saved_command_line));
 	*cmdline_p = cmd_line;
 
+	irqstack_early_init();
+
 	/* set up the bootmem stuff with available memory */
 	do_init_bootmem();
 
diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c
index 7b75311c1..ce066788c 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/ppc64/kernel/signal.c
@@ -73,7 +73,7 @@ struct rt_sigframe {
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
-long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4,
+long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, int p3, int p4,
 		       int p6, int p7, struct pt_regs *regs)
 {
 	sigset_t saveset, newset;
@@ -103,7 +103,7 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4,
 	}
 }
 
-long sys_sigaltstack(const stack_t *uss, stack_t *uoss, unsigned long r5,
+long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, unsigned long r5,
 		     unsigned long r6, unsigned long r7, unsigned long r8,
 		     struct pt_regs *regs)
 {
@@ -115,7 +115,7 @@ long sys_sigaltstack(const stack_t *uss, stack_t *uoss, unsigned long r5,
  * Set up the sigcontext for the signal frame.
  */
 
-static long setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
+static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 		 int signr, sigset_t *set, unsigned long handler)
 {
 	/* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
@@ -127,7 +127,7 @@ static long setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
 	 * v_regs pointer or not
 	 */
 #ifdef CONFIG_ALTIVEC
-	elf_vrreg_t *v_regs = (elf_vrreg_t *)(((unsigned long)sc->vmx_reserve) & ~0xful);
+	elf_vrreg_t __user *v_regs = (elf_vrreg_t __user *)(((unsigned long)sc->vmx_reserve) & ~0xful);
 #endif
 	long err = 0;
 
@@ -154,7 +154,7 @@ static long setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
 	/* We always copy to/from vrsave, it's 0 if we don't have or don't
 	 * use altivec.
 	 */
-	err |= __put_user(current->thread.vrsave, (u32 *)&v_regs[33]);
+	err |= __put_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
 #else /* CONFIG_ALTIVEC */
 	err |= __put_user(0, &sc->v_regs);
 #endif /* CONFIG_ALTIVEC */
@@ -174,10 +174,10 @@ static long setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
  */
 
 static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
-			      struct sigcontext *sc)
+			      struct sigcontext __user *sc)
 {
 #ifdef CONFIG_ALTIVEC
-	elf_vrreg_t *v_regs;
+	elf_vrreg_t __user *v_regs;
 #endif
 	unsigned long err = 0;
 	unsigned long save_r13;
@@ -216,7 +216,7 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
 		memset(&current->thread.vr, 0, 33);
 	/* Always get VRSAVE back */
 	if (v_regs != 0)
-		err |= __get_user(current->thread.vrsave, (u32 *)&v_regs[33]);
+		err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
 	else
 		current->thread.vrsave = 0;
 #endif /* CONFIG_ALTIVEC */
@@ -230,7 +230,7 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
 /*
  * Allocate space for the signal frame
  */
-static inline void * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
 				  size_t frame_size)
 {
         unsigned long newsp;
@@ -243,13 +243,13 @@ static inline void * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
 			newsp = (current->sas_ss_sp + current->sas_ss_size);
 	}
 
-        return (void *)((newsp - frame_size) & -8ul);
+        return (void __user *)((newsp - frame_size) & -8ul);
 }
 
 /*
  * Setup the trampoline code on the stack
  */
-static long setup_trampoline(unsigned int syscall, unsigned int *tramp)
+static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp)
 {
 	int i;
 	long err = 0;
@@ -311,8 +311,8 @@ int sys_swapcontext(struct ucontext __user *old_ctx,
 	if (new_ctx == NULL)
 		return 0;
 	if (verify_area(VERIFY_READ, new_ctx, sizeof(*new_ctx))
-	    || __get_user(tmp, (u8 *) new_ctx)
-	    || __get_user(tmp, (u8 *) (new_ctx + 1) - 1))
+	    || __get_user(tmp, (u8 __user *) new_ctx)
+	    || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
 		return -EFAULT;
 
 	/*
@@ -346,7 +346,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
 		     unsigned long r6, unsigned long r7, unsigned long r8,
 		     struct pt_regs *regs)
 {
-	struct ucontext *uc = (struct ucontext *)regs->gpr[1];
+	struct ucontext __user *uc = (struct ucontext __user *)regs->gpr[1];
 	sigset_t set;
 
 	/* Always make any pending restarted system calls return -EINTR */
@@ -384,8 +384,8 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
 	 * descriptor is the entry address of signal and the second
 	 * entry is the TOC value we need to use.
 	 */
-	func_descr_t *funct_desc_ptr;
-	struct rt_sigframe *frame;
+	func_descr_t __user *funct_desc_ptr;
+	struct rt_sigframe __user *frame;
 	unsigned long newsp = 0;
 	long err = 0;
 
@@ -418,11 +418,11 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
 	if (err)
 		goto badframe;
 
-	funct_desc_ptr = (func_descr_t *) ka->sa.sa_handler;
+	funct_desc_ptr = (func_descr_t __user *) ka->sa.sa_handler;
 
 	/* Allocate a dummy caller frame for the signal handler. */
 	newsp = (unsigned long)frame - __SIGNAL_FRAMESIZE;
-	err |= put_user(0, (unsigned long *)newsp);
+	err |= put_user(0, (unsigned long __user *)newsp);
 
 	/* Set up "regs" so we "return" to the signal handler. */
 	err |= get_user(regs->nip, &funct_desc_ptr->entry);
@@ -432,8 +432,8 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
 	regs->gpr[3] = signr;
 	regs->result = 0;
 	if (ka->sa.sa_flags & SA_SIGINFO) {
-		err |= get_user(regs->gpr[4], (unsigned long *)&frame->pinfo);
-		err |= get_user(regs->gpr[5], (unsigned long *)&frame->puc);
+		err |= get_user(regs->gpr[4], (unsigned long __user *)&frame->pinfo);
+		err |= get_user(regs->gpr[5], (unsigned long __user *)&frame->puc);
 		regs->gpr[6] = (unsigned long) frame;
 	} else {
 		regs->gpr[4] = (unsigned long)&frame->uc.uc_mcontext;
diff --git a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c
index cf817f8bd..c8f6294a2 100644
--- a/arch/ppc64/kernel/signal32.c
+++ b/arch/ppc64/kernel/signal32.c
@@ -126,7 +126,7 @@ static inline void sigset_from_compat(sigset_t *set, compat_sigset_t *compat)
  * We only save the altivec registers if the process has used
  * altivec instructions at some point.
  */
-static int save_user_regs(struct pt_regs *regs, struct mcontext32 *frame, int sigret)
+static int save_user_regs(struct pt_regs *regs, struct mcontext32 __user *frame, int sigret)
 {
 	elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
 	int i, err = 0;
@@ -165,7 +165,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext32 *frame, int si
 	 * significant bits of a vector, we "cheat" and stuff VRSAVE in the
 	 * most significant bits of that same vector. --BenH
 	 */
-	if (__put_user(current->thread.vrsave, (u32 *)&frame->mc_vregs[32]))
+	if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
 
@@ -232,7 +232,7 @@ static long restore_user_regs(struct pt_regs *regs,
 		memset(&current->thread.vr, 0, ELF_NVRREG32 * sizeof(vector128));
 
 	/* Always get VRSAVE back */
-	if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32]))
+	if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
 
@@ -289,8 +289,8 @@ long sys32_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7,
 	}
 }
 
-long sys32_sigaction(int sig, struct old_sigaction32 *act,
-		struct old_sigaction32 *oact)
+long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
+		struct old_sigaction32 __user *oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -344,8 +344,8 @@ long sys32_sigaction(int sig, struct old_sigaction32 *act,
  */
 
 
-long sys32_rt_sigaction(int sig, const struct sigaction32 *act,
-		struct sigaction32 *oact, size_t sigsetsize)
+long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
+		struct sigaction32 __user *oact, size_t sigsetsize)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -383,10 +383,11 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 *act,
  * of a signed int (msr in 32-bit mode) and the register representation
  * of a signed int (msr in 64-bit mode) is performed.
  */
-long sys32_rt_sigprocmask(u32 how, compat_sigset_t *set,
-		compat_sigset_t *oset, size_t sigsetsize)
+long sys32_rt_sigprocmask(u32 how, compat_sigset_t __user *set,
+		compat_sigset_t __user *oset, size_t sigsetsize)
 {
 	sigset_t s;
+	sigset_t __user *up;
 	compat_sigset_t s32;
 	int ret;
 	mm_segment_t old_fs = get_fs();
@@ -398,7 +399,9 @@ long sys32_rt_sigprocmask(u32 how, compat_sigset_t *set,
 	}
 	
 	set_fs(KERNEL_DS);
-	ret = sys_rt_sigprocmask((int)how, set ? &s : NULL, oset ? &s : NULL,
+	/* This is valid because of the set_fs() */
+	up = (sigset_t __user *) &s;
+	ret = sys_rt_sigprocmask((int)how, set ? up : NULL, oset ? up : NULL,
 				 sigsetsize); 
 	set_fs(old_fs);
 	if (ret)
@@ -411,7 +414,7 @@ long sys32_rt_sigprocmask(u32 how, compat_sigset_t *set,
 	return 0;
 }
 
-long sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
+long sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -419,7 +422,8 @@ long sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
-	ret = sys_rt_sigpending(&s, sigsetsize);
+	/* The __user pointer cast is valid because of the set_fs() */
+	ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
 	set_fs(old_fs);
 	if (!ret) {
 		compat_from_sigset(&s32, &s);
@@ -430,7 +434,7 @@ long sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
 }
 
 
-static long copy_siginfo_to_user32(compat_siginfo_t *d, siginfo_t *s)
+static long copy_siginfo_to_user32(compat_siginfo_t __user *d, siginfo_t *s)
 {
 	long err;
 
@@ -481,8 +485,8 @@ static long copy_siginfo_to_user32(compat_siginfo_t *d, siginfo_t *s)
 	return err;
 }
 
-long sys32_rt_sigtimedwait(compat_sigset_t *uthese, compat_siginfo_t *uinfo,
-		struct compat_timespec *uts, compat_size_t sigsetsize)
+long sys32_rt_sigtimedwait(compat_sigset_t __user *uthese, compat_siginfo_t __user *uinfo,
+		struct compat_timespec __user *uts, compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -497,7 +501,10 @@ long sys32_rt_sigtimedwait(compat_sigset_t *uthese, compat_siginfo_t *uinfo,
 	if (uts && get_compat_timespec(&t, uts))
 		return -EFAULT;
 	set_fs(KERNEL_DS);
-	ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
+	/* The __user pointer casts are valid because of the set_fs() */
+	ret = sys_rt_sigtimedwait((sigset_t __user *) &s,
+			uinfo ? (siginfo_t __user *) &info : NULL,
+			uts ? (struct timespec __user *) &t : NULL,
 			sigsetsize);
 	set_fs(old_fs);
 	if (ret >= 0 && uinfo) {
@@ -514,7 +521,7 @@ long sys32_rt_sigtimedwait(compat_sigset_t *uthese, compat_siginfo_t *uinfo,
  * (msr in 32-bit mode) and the register representation of a signed int
  * (msr in 64-bit mode) is performed.
  */
-long sys32_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t *uinfo)
+long sys32_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo)
 {
 	siginfo_t info;
 	int ret;
@@ -524,12 +531,13 @@ long sys32_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t *uinfo)
 	    copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE32))
 		return -EFAULT;
 	set_fs (KERNEL_DS);
-	ret = sys_rt_sigqueueinfo((int)pid, (int)sig, &info);
+	/* The __user pointer cast is valid becasuse of the set_fs() */
+	ret = sys_rt_sigqueueinfo((int)pid, (int)sig, (siginfo_t __user *) &info);
 	set_fs (old_fs);
 	return ret;
 }
 
-int sys32_rt_sigsuspend(compat_sigset_t* unewset, size_t sigsetsize, int p3,
+int sys32_rt_sigsuspend(compat_sigset_t __user * unewset, size_t sigsetsize, int p3,
 		int p4, int p6, int p7, struct pt_regs *regs)
 {
 	sigset_t saveset, newset;
@@ -581,9 +589,11 @@ int sys32_rt_sigsuspend(compat_sigset_t* unewset, size_t sigsetsize, int p3,
  *       sigaltatck               sys32_sigaltstack
  */
 
-int sys32_sigaltstack(u32 newstack, u32 oldstack, int r5,
+int sys32_sigaltstack(u32 __new, u32 __old, int r5,
 		      int r6, int r7, int r8, struct pt_regs *regs)
 {
+	stack_32_t __user * newstack = (stack_32_t __user *)(long) __new;
+	stack_32_t __user * oldstack = (stack_32_t __user *)(long) __old;
 	stack_t uss, uoss;
 	int ret;
 	mm_segment_t old_fs;
@@ -597,27 +607,24 @@ int sys32_sigaltstack(u32 newstack, u32 oldstack, int r5,
 
 	/* Put new stack info in local 64 bit stack struct */
 	if (newstack &&
-		(get_user((long)uss.ss_sp,
-			  &((stack_32_t *)(long)newstack)->ss_sp) ||
-		 __get_user(uss.ss_flags,
-			 &((stack_32_t *)(long)newstack)->ss_flags) ||
-		 __get_user(uss.ss_size,
-			 &((stack_32_t *)(long)newstack)->ss_size)))
+		(get_user((long)uss.ss_sp, &newstack->ss_sp) ||
+		 __get_user(uss.ss_flags, &newstack->ss_flags) ||
+		 __get_user(uss.ss_size, &newstack->ss_size)))
 		return -EFAULT; 
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = do_sigaltstack(newstack ? &uss : NULL, oldstack ? &uoss : NULL,
-			sp);
+	/* The __user pointer casts are valid because of the set_fs() */
+	ret = do_sigaltstack(
+		newstack ? (stack_t __user *) &uss : NULL,
+		oldstack ? (stack_t __user *) &uoss : NULL,
+		sp);
 	set_fs(old_fs);
 	/* Copy the stack information to the user output buffer */
 	if (!ret && oldstack  &&
-		(put_user((long)uoss.ss_sp,
-			  &((stack_32_t *)(long)oldstack)->ss_sp) ||
-		 __put_user(uoss.ss_flags,
-			 &((stack_32_t *)(long)oldstack)->ss_flags) ||
-		 __put_user(uoss.ss_size,
-			 &((stack_32_t *)(long)oldstack)->ss_size)))
+		(put_user((long)uoss.ss_sp, &oldstack->ss_sp) ||
+		 __put_user(uoss.ss_flags, &oldstack->ss_flags) ||
+		 __put_user(uoss.ss_size, &oldstack->ss_size)))
 		return -EFAULT;
 	return ret;
 }
@@ -701,7 +708,7 @@ static long do_setcontext32(struct ucontext32 __user *ucp, struct pt_regs *regs,
 		return -EFAULT;
 	sigset_from_compat(&set, &c_set);
 	restore_sigmask(&set);
-	if (restore_user_regs(regs, (struct mcontext32 *)(u64)mcp, sig))
+	if (restore_user_regs(regs, (struct mcontext32 __user *)(u64)mcp, sig))
 		return -EFAULT;
 
 	return 0;
@@ -735,8 +742,8 @@ long sys32_swapcontext(struct ucontext32 __user *old_ctx,
 	if (new_ctx == NULL)
 		return 0;
 	if (verify_area(VERIFY_READ, new_ctx, sizeof(*new_ctx))
-	    || __get_user(tmp, (u8 *) new_ctx)
-	    || __get_user(tmp, (u8 *) (new_ctx + 1) - 1))
+	    || __get_user(tmp, (u8 __user *) new_ctx)
+	    || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
 		return -EFAULT;
 
 	/*
@@ -817,7 +824,7 @@ static void handle_signal32(unsigned long sig, struct k_sigaction *ka,
 	/* create a stack frame for the caller of the handler */
 	newsp -= __SIGNAL_FRAMESIZE32;
 
-	if (verify_area(VERIFY_WRITE, (void *) newsp, origsp - newsp))
+	if (verify_area(VERIFY_WRITE, (void __user *) newsp, origsp - newsp))
 		goto badframe;
 
 #if _NSIG != 64
@@ -881,7 +888,7 @@ long sys32_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 	set.sig[0] = sigctx.oldmask + ((long)(sigctx._unused[3]) << 32);
 	restore_sigmask(&set);
 
-	sr = (struct mcontext32 *)(u64)sigctx.regs;
+	sr = (struct mcontext32 __user *)(u64)sigctx.regs;
 	if (verify_area(VERIFY_READ, sr, sizeof(*sr))
 	    || restore_user_regs(regs, sr, 1))
 		goto badframe;
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 2447cce8b..7fa0e5a10 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -390,8 +390,7 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
 	}
 
 	/* Fixup atomic count: it exited inside IRQ handler. */
-	((struct task_struct *)paca[lcpu].xCurrent)->thread_info->preempt_count
-		= 0;
+	paca[lcpu].xCurrent->thread_info->preempt_count	= 0;
 	/* Fixup SLB round-robin so next segment (kernel) goes in segment 0 */
 	paca[lcpu].xStab_data.next_round_robin = 0;
 
@@ -618,7 +617,7 @@ void smp_message_recv(int msg, struct pt_regs *regs)
 #endif
 #ifdef CONFIG_DEBUGGER
 	case PPC_MSG_DEBUGGER_BREAK:
-		debugger(regs);
+		debugger_ipi(regs);
 		break;
 #endif
 	default:
@@ -692,6 +691,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	int ret = -1, cpus;
 	unsigned long timeout;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.started, 0);
@@ -814,7 +816,7 @@ static void __init smp_create_idle(unsigned int cpu)
 	init_idle(p, cpu);
 	unhash_process(p);
 
-	paca[cpu].xCurrent = (u64)p;
+	paca[cpu].xCurrent = p;
 	current_set[cpu] = p->thread_info;
 }
 
@@ -834,11 +836,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 	paca[boot_cpuid].prof_counter = 1;
 	paca[boot_cpuid].prof_multiplier = 1;
 
-	/*
-	 * XXX very rough. 
-	 */
-	cache_decay_ticks = HZ/100;
-
 #ifndef CONFIG_PPC_ISERIES
 	paca[boot_cpuid].next_jiffy_update_tb = tb_last_stamp = get_tb();
 
@@ -871,7 +868,7 @@ void __devinit smp_prepare_boot_cpu(void)
 	/* cpu_possible is set up in prom.c */
 	cpu_set(boot_cpuid, cpu_online_map);
 
-	paca[boot_cpuid].xCurrent = (u64)current;
+	paca[boot_cpuid].xCurrent = current;
 	current_set[boot_cpuid] = current->thread_info;
 }
 
@@ -914,8 +911,20 @@ int __devinit __cpu_up(unsigned int cpu)
 	 * use this value that I found through experimentation.
 	 * -- Cort
 	 */
-	for (c = 5000; c && !cpu_callin_map[cpu]; c--)
-		udelay(100);
+	if (system_state == SYSTEM_BOOTING)
+		for (c = 5000; c && !cpu_callin_map[cpu]; c--)
+			udelay(100);
+#ifdef CONFIG_HOTPLUG_CPU
+	else
+		/*
+		 * CPUs can take much longer to come up in the
+		 * hotplug case.  Wait five seconds.
+		 */
+		for (c = 25; c && !cpu_callin_map[cpu]; c--) {
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			schedule_timeout(HZ/5);
+		}
+#endif
 
 	if (!cpu_callin_map[cpu]) {
 		printk("Processor %u is stuck.\n", cpu);
@@ -992,3 +1001,218 @@ void __init smp_cpus_done(unsigned int max_cpus)
 
 	set_cpus_allowed(current, old_mask);
 }
+
+#ifdef CONFIG_SCHED_SMT
+#ifdef CONFIG_NUMA
+static struct sched_group sched_group_cpus[NR_CPUS];
+static struct sched_group sched_group_phys[NR_CPUS];
+static struct sched_group sched_group_nodes[MAX_NUMNODES];
+static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
+static DEFINE_PER_CPU(struct sched_domain, phys_domains);
+static DEFINE_PER_CPU(struct sched_domain, node_domains);
+__init void arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first = NULL, *last = NULL;
+
+	/* Set up domains */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+		struct sched_domain *node_domain = &per_cpu(node_domains, i);
+		int node = cpu_to_node(i);
+		cpumask_t nodemask = node_to_cpumask(node);
+		cpumask_t my_cpumask = cpumask_of_cpu(i);
+		cpumask_t sibling_cpumask = cpumask_of_cpu(i ^ 0x1);
+
+		*cpu_domain = SD_SIBLING_INIT;
+		if (cur_cpu_spec->cpu_features & CPU_FTR_SMT)
+			cpus_or(cpu_domain->span, my_cpumask, sibling_cpumask);
+		else
+			cpu_domain->span = my_cpumask;
+		cpu_domain->parent = phys_domain;
+		cpu_domain->groups = &sched_group_cpus[i];
+
+		*phys_domain = SD_CPU_INIT;
+		phys_domain->span = nodemask;
+		phys_domain->parent = node_domain;
+		phys_domain->groups = &sched_group_phys[first_cpu(cpu_domain->span)];
+
+		*node_domain = SD_NODE_INIT;
+		node_domain->span = cpu_possible_map;
+		node_domain->groups = &sched_group_nodes[node];
+	}
+
+	/* Set up CPU (sibling) groups */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		int j;
+		first = last = NULL;
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		for_each_cpu_mask(j, cpu_domain->span) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpus_clear(cpu->cpumask);
+			cpu_set(j, cpu->cpumask);
+			cpu->cpu_power = SCHED_LOAD_SCALE;
+
+			if (!first)
+				first = cpu;
+			if (last)
+				last->next = cpu;
+			last = cpu;
+		}
+		last->next = first;
+	}
+
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		int j;
+		cpumask_t nodemask;
+		struct sched_group *node = &sched_group_nodes[i];
+		cpumask_t node_cpumask = node_to_cpumask(i);
+		cpus_and(nodemask, node_cpumask, cpu_possible_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		first = last = NULL;
+		/* Set up physical groups */
+		for_each_cpu_mask(j, nodemask) {
+			struct sched_domain *cpu_domain = &per_cpu(cpu_domains, j);
+			struct sched_group *cpu = &sched_group_phys[j];
+
+			if (j != first_cpu(cpu_domain->span))
+				continue;
+
+			cpu->cpumask = cpu_domain->span;
+			/*
+			 * Make each extra sibling increase power by 10% of
+			 * the basic CPU. This is very arbitrary.
+			 */
+			cpu->cpu_power = SCHED_LOAD_SCALE + SCHED_LOAD_SCALE*(cpus_weight(cpu->cpumask)-1) / 10;
+			node->cpu_power += cpu->cpu_power;
+
+			if (!first)
+				first = cpu;
+			if (last)
+				last->next = cpu;
+			last = cpu;
+		}
+		last->next = first;
+	}
+
+	/* Set up nodes */
+	first = last = NULL;
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		struct sched_group *cpu = &sched_group_nodes[i];
+		cpumask_t nodemask;
+		cpumask_t node_cpumask = node_to_cpumask(i);
+		cpus_and(nodemask, node_cpumask, cpu_possible_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		cpu->cpumask = nodemask;
+		/* ->cpu_power already setup */
+
+		if (!first)
+			first = cpu;
+		if (last)
+			last->next = cpu;
+		last = cpu;
+	}
+	last->next = first;
+
+	mb();
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		cpu_attach_domain(cpu_domain, i);
+	}
+}
+#else /* !CONFIG_NUMA */
+static struct sched_group sched_group_cpus[NR_CPUS];
+static struct sched_group sched_group_phys[NR_CPUS];
+static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
+static DEFINE_PER_CPU(struct sched_domain, phys_domains);
+__init void arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first = NULL, *last = NULL;
+
+	/* Set up domains */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
+		cpumask_t my_cpumask = cpumask_of_cpu(i);
+		cpumask_t sibling_cpumask = cpumask_of_cpu(i ^ 0x1);
+
+		*cpu_domain = SD_SIBLING_INIT;
+		if (cur_cpu_spec->cpu_features & CPU_FTR_SMT)
+			cpus_or(cpu_domain->span, my_cpumask, sibling_cpumask);
+		else
+			cpu_domain->span = my_cpumask;
+		cpu_domain->parent = phys_domain;
+		cpu_domain->groups = &sched_group_cpus[i];
+
+		*phys_domain = SD_CPU_INIT;
+		phys_domain->span = cpu_possible_map;
+		phys_domain->groups = &sched_group_phys[first_cpu(cpu_domain->span)];
+	}
+
+	/* Set up CPU (sibling) groups */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		int j;
+		first = last = NULL;
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		for_each_cpu_mask(j, cpu_domain->span) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpus_clear(cpu->cpumask);
+			cpu_set(j, cpu->cpumask);
+			cpu->cpu_power = SCHED_LOAD_SCALE;
+
+			if (!first)
+				first = cpu;
+			if (last)
+				last->next = cpu;
+			last = cpu;
+		}
+		last->next = first;
+	}
+
+	first = last = NULL;
+	/* Set up physical groups */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		struct sched_group *cpu = &sched_group_phys[i];
+
+		if (i != first_cpu(cpu_domain->span))
+			continue;
+
+		cpu->cpumask = cpu_domain->span;
+		/* See SMT+NUMA setup for comment */
+		cpu->cpu_power = SCHED_LOAD_SCALE + SCHED_LOAD_SCALE*(cpus_weight(cpu->cpumask)-1) / 10;
+
+		if (!first)
+			first = cpu;
+		if (last)
+			last->next = cpu;
+		last = cpu;
+	}
+	last->next = first;
+
+	mb();
+	for_each_cpu(i) {
+		struct sched_domain *cpu_domain = &per_cpu(cpu_domains, i);
+		cpu_attach_domain(cpu_domain, i);
+	}
+}
+#endif /* CONFIG_NUMA */
+#endif /* CONFIG_SCHED_SMT */
diff --git a/arch/ppc64/kernel/stab.c b/arch/ppc64/kernel/stab.c
index b3ac3ac62..061890449 100644
--- a/arch/ppc64/kernel/stab.c
+++ b/arch/ppc64/kernel/stab.c
@@ -24,6 +24,23 @@ static int make_ste(unsigned long stab, unsigned long esid, unsigned long vsid);
 static void make_slbe(unsigned long esid, unsigned long vsid, int large,
 		      int kernel_segment);
 
+static inline void slb_add_bolted(void)
+{
+#ifndef CONFIG_PPC_ISERIES
+	unsigned long esid = GET_ESID(VMALLOCBASE);
+	unsigned long vsid = get_kernel_vsid(VMALLOCBASE);
+
+	WARN_ON(!irqs_disabled());
+
+	/*
+	 * Bolt in the first vmalloc segment. Since modules end
+	 * up there it gets hit very heavily.
+	 */
+	get_paca()->xStab_data.next_round_robin = 1;
+	make_slbe(esid, vsid, 0, 1);
+#endif
+}
+
 /*
  * Build an entry for the base kernel segment and put it into
  * the segment table or SLB.  All other segment table or SLB
@@ -48,9 +65,12 @@ void stab_initialize(unsigned long stab)
 		asm volatile("isync":::"memory");
 		asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
 		asm volatile("isync; slbia; isync":::"memory");
+		get_paca()->xStab_data.next_round_robin = 0;
 		make_slbe(esid, vsid, seg0_largepages, 1);
 		asm volatile("isync":::"memory");
 #endif
+
+		slb_add_bolted();
 	} else {
 		asm volatile("isync; slbia; isync":::"memory");
 		make_ste(stab, esid, vsid);
@@ -317,6 +337,7 @@ static void make_slbe(unsigned long esid, unsigned long vsid, int large,
 		unsigned long word0;
 		slb_dword1    data;
 	} vsid_data;
+	struct paca_struct *lpaca = get_paca();
 
 	/*
 	 * We take the next entry, round robin. Previously we tried
@@ -330,18 +351,25 @@ static void make_slbe(unsigned long esid, unsigned long vsid, int large,
 	 * for the kernel stack during the first part of exception exit 
 	 * which gets invalidated due to a tlbie from another cpu at a
 	 * non recoverable point (after setting srr0/1) - Anton
+	 *
+	 * paca Ksave is always valid (even when on the interrupt stack)
+	 * so we use that.
 	 */
-	castout_entry = get_paca()->xStab_data.next_round_robin;
+	castout_entry = lpaca->xStab_data.next_round_robin;
 	do {
 		entry = castout_entry;
 		castout_entry++; 
-		if (castout_entry >= naca->slb_size)
-			castout_entry = 1; 
+		/*
+		 * We bolt in the first kernel segment and the first
+		 * vmalloc segment.
+		 */
+		if (castout_entry >= SLB_NUM_ENTRIES)
+			castout_entry = 2;
 		asm volatile("slbmfee  %0,%1" : "=r" (esid_data) : "r" (entry));
 	} while (esid_data.data.v &&
-		 esid_data.data.esid == GET_ESID(__get_SP()));
+		 esid_data.data.esid == GET_ESID(lpaca->xKsave));
 
-	get_paca()->xStab_data.next_round_robin = castout_entry;
+	lpaca->xStab_data.next_round_robin = castout_entry;
 
 	/* slbie not needed as the previous mapping is still valid. */
 
@@ -422,6 +450,9 @@ int slb_allocate(unsigned long ea)
 	}
 
 	esid = GET_ESID(ea);
+#ifndef CONFIG_PPC_ISERIES
+	BUG_ON((esid << SID_SHIFT) == VMALLOCBASE);
+#endif
 	__slb_allocate(esid, vsid, context);
 
 	return 0;
@@ -479,18 +510,19 @@ void flush_slb(struct task_struct *tsk, struct mm_struct *mm)
 		slb_dword0 data;
 	} esid_data;
 
-
 	if (offset <= NR_STAB_CACHE_ENTRIES) {
 		int i;
 		asm volatile("isync" : : : "memory");
 		for (i = 0; i < offset; i++) {
 			esid_data.word0 = 0;
 			esid_data.data.esid = __get_cpu_var(stab_cache[i]);
+			BUG_ON(esid_data.data.esid == GET_ESID(VMALLOCBASE));
 			asm volatile("slbie %0" : : "r" (esid_data));
 		}
 		asm volatile("isync" : : : "memory");
 	} else {
 		asm volatile("isync; slbia; isync" : : : "memory");
+		slb_add_bolted();
 	}
 
 	/* Workaround POWER5 < DD2.1 issue */
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index 7e4bc8355..ca8014224 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -15,7 +15,6 @@
  */
 
 #include <linux/config.h>
-#include <asm/ptrace.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h> 
@@ -60,17 +59,17 @@
 #include <linux/compat.h>
 #include <linux/ptrace.h>
 #include <linux/aio_abi.h>
+#include <linux/elf.h>
+
+#include <net/scm.h>
+#include <net/sock.h>
 
+#include <asm/ptrace.h>
 #include <asm/types.h>
 #include <asm/ipc.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
-
 #include <asm/semaphore.h>
-
-#include <net/scm.h>
-#include <net/sock.h>
-#include <linux/elf.h>
 #include <asm/ppcdebug.h>
 #include <asm/time.h>
 #include <asm/ppc32.h>
@@ -78,180 +77,8 @@
 
 #include "pci.h"
 
-typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *);
-typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *);
-
-static long do_readv_writev32(int type, struct file *file,
-			      const struct compat_iovec *vector, u32 count)
-{
-	compat_ssize_t tot_len;
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov=iovstack, *ivp;
-	struct inode *inode;
-	long retval, i;
-	io_fn_t fn;
-	iov_fn_t fnv;
-
-	/*
-	 * SuS says "The readv() function *may* fail if the iovcnt argument
-	 * was less than or equal to 0, or greater than {IOV_MAX}.  Linux has
-	 * traditionally returned zero for zero segments, so...
-	 */
-	retval = 0;
-	if (count == 0)
-		goto out;
-
-	/* First get the "struct iovec" from user memory and
-	 * verify all the pointers
-	 */
-	retval = -EINVAL;
-	if (count > UIO_MAXIOV)
-		goto out;
-	if (!file->f_op)
-		goto out;
-	if (count > UIO_FASTIOV) {
-		retval = -ENOMEM;
-		iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			goto out;
-	}
-	retval = -EFAULT;
-	if (verify_area(VERIFY_READ, vector, sizeof(struct compat_iovec)*count))
-		goto out;
-
-	/*
-	 * Single unix specification:
-	 * We should -EINVAL if an element length is not >= 0 and fitting an
-	 * ssize_t.  The total length is fitting an ssize_t
-	 *
-	 * Be careful here because iov_len is a size_t not an ssize_t
-	 */
-	tot_len = 0;
-	i = count;
-	ivp = iov;
-	retval = -EINVAL;
-	while(i > 0) {
-		compat_ssize_t tmp = tot_len;
-		compat_ssize_t len;
-		u32 buf;
-
-		if (__get_user(len, &vector->iov_len) ||
-		    __get_user(buf, &vector->iov_base)) {
-			retval = -EFAULT;
-			goto out;
-		}
-		if (len < 0)	/* size_t not fitting an compat_ssize_t .. */
-			goto out;
-		tot_len += len;
-		if (tot_len < tmp) /* maths overflow on the compat_ssize_t */
-			goto out;
-		ivp->iov_base = (void *)A(buf);
-		ivp->iov_len = (__kernel_size_t) len;
-		vector++;
-		ivp++;
-		i--;
-	}
-	if (tot_len == 0) {
-		retval = 0;
-		goto out;
-	}
-
-	inode = file->f_dentry->d_inode;
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	retval = locks_verify_area((type == READ
-				    ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
-				   inode, file, file->f_pos, tot_len);
-	if (retval)
-		goto out;
-
-	if (type == READ) {
-		fn = file->f_op->read;
-		fnv = file->f_op->readv;
-	} else {
-		fn = (io_fn_t)file->f_op->write;
-		fnv = file->f_op->writev;
-	}
-	if (fnv) {
-		retval = fnv(file, iov, count, &file->f_pos);
-		goto out;
-	}
-
-	/* Do it by hand, with file-ops */
-	ivp = iov;
-	while (count > 0) {
-		void * base;
-		int len, nr;
-
-		base = ivp->iov_base;
-		len = ivp->iov_len;
-		ivp++;
-		count--;
-
-		nr = fn(file, base, len, &file->f_pos);
-
-		if (nr < 0) {
-			if (!retval)
-				retval = nr;
-			break;
-		}
-		retval += nr;
-		if (nr != len)
-			break;
-	}
-out:
-	if (iov != iovstack)
-		kfree(iov);
-	if ((retval + (type == READ)) > 0)
-		dnotify_parent(file->f_dentry,
-			       (type == READ) ? DN_ACCESS : DN_MODIFY);
-
-	return retval;
-}
-
-asmlinkage long sys32_readv(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	int ret = -EBADF;
-
-	file = fget(fd);
-	if (!file || !(file->f_mode & FMODE_READ))
-		goto out; 
-
-	ret = -EINVAL;
-	if (!file->f_op || (!file->f_op->readv && !file->f_op->read))
-		goto out;
-
-	ret = do_readv_writev32(READ, file, vector, count);
-
-out:
-	if (file)
-		fput(file);
-	return ret;
-}
-
-asmlinkage long sys32_writev(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	int ret = -EBADF;
-
-	file = fget(fd);
-	if (!file || !(file->f_mode & FMODE_WRITE))
-		goto out;
-
-	ret = -EINVAL;
-	if (!file->f_op || (!file->f_op->writev && !file->f_op->write))
-		goto out;
-
-	ret = do_readv_writev32(WRITE, file, vector, count);
-
-out:
-	if (file)
-		fput(file);
-	return ret;
-}
-
 /* readdir & getdents */
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 #define ROUND_UP(x) (((x)+sizeof(u32)-1) & ~(sizeof(u32)-1))
 
 struct old_linux_dirent32 {
@@ -262,7 +89,7 @@ struct old_linux_dirent32 {
 };
 
 struct readdir_callback32 {
-	struct old_linux_dirent32 * dirent;
+	struct old_linux_dirent32 __user * dirent;
 	int count;
 };
 
@@ -270,7 +97,7 @@ static int fillonedir(void * __buf, const char * name, int namlen,
 		                  off_t offset, ino_t ino, unsigned int d_type)
 {
 	struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf;
-	struct old_linux_dirent32 * dirent;
+	struct old_linux_dirent32 __user * dirent;
 
 	if (buf->count)
 		return -EINVAL;
@@ -284,7 +111,7 @@ static int fillonedir(void * __buf, const char * name, int namlen,
 	return 0;
 }
 
-asmlinkage int old32_readdir(unsigned int fd, struct old_linux_dirent32 *dirent, unsigned int count)
+asmlinkage int old32_readdir(unsigned int fd, struct old_linux_dirent32 __user *dirent, unsigned int count)
 {
 	int error = -EBADF;
 	struct file * file;
@@ -316,8 +143,8 @@ struct linux_dirent32 {
 };
 
 struct getdents_callback32 {
-	struct linux_dirent32 * current_dir;
-	struct linux_dirent32 * previous;
+	struct linux_dirent32 __user * current_dir;
+	struct linux_dirent32 __user * previous;
 	int count;
 	int error;
 };
@@ -325,7 +152,7 @@ struct getdents_callback32 {
 static int filldir(void * __buf, const char * name, int namlen, off_t offset,
 		   ino_t ino, unsigned int d_type)
 {
-	struct linux_dirent32 * dirent;
+	struct linux_dirent32 __user * dirent;
 	struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
 
@@ -346,10 +173,10 @@ static int filldir(void * __buf, const char * name, int namlen, off_t offset,
 		goto efault;
 	if (__put_user(0, dirent->d_name + namlen))
 		goto efault;
-	if (__put_user(d_type, (char *) dirent + reclen - 1))
+	if (__put_user(d_type, (char __user *) dirent + reclen - 1))
 		goto efault;
 	buf->previous = dirent;
-	dirent = (void *)dirent + reclen;
+	dirent = (void __user *)dirent + reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
@@ -358,11 +185,11 @@ efault:
 	return -EFAULT;
 }
 
-long sys32_getdents(unsigned int fd, struct linux_dirent32 *dirent,
+asmlinkage long sys32_getdents(unsigned int fd, struct linux_dirent32 __user *dirent,
 		    unsigned int count)
 {
 	struct file * file;
-	struct linux_dirent32 * lastdirent;
+	struct linux_dirent32 __user * lastdirent;
 	struct getdents_callback32 buf;
 	int error;
 
@@ -398,170 +225,15 @@ out:
 	return error;
 }
 
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-static inline int
-get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
-{
-	if (ufdset) {
-		unsigned long odd;
-
-		if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
-
-
-#define MAX_SELECT_SECONDS ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-
-asmlinkage long sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x)
-{
-	fd_set_bits fds;
-	struct compat_timeval *tvp = (struct compat_timeval *)AA(tvp_x);
-	char *bits;
-	unsigned long nn;
-	long timeout;
-	int ret, size, max_fdset;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp) {
-		time_t sec, usec;
-		if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
-		    || (ret = __get_user(sec, &tvp->tv_sec))
-		    || (ret = __get_user(usec, &tvp->tv_usec)))
-			goto out_nofds;
-
-		ret = -EINVAL;
-		if(sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-
-	/* max_fdset can increase, so grab it once to avoid race */
-	max_fdset = current->files->max_fdset;
-	if (n > max_fdset)
-		n = max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words. 
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = kmalloc(6 * size, GFP_KERNEL);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if ((ret = get_fd_set32(nn, fds.in, inp)) ||
-	    (ret = get_fd_set32(nn, fds.out, outp)) ||
-	    (ret = get_fd_set32(nn, fds.ex, exp)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
-		time_t sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		put_user(sec, &tvp->tv_sec);
-		put_user(usec, &tvp->tv_usec);
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set32(nn, inp, fds.res_in);
-	set_fd_set32(nn, outp, fds.res_out);
-	set_fd_set32(nn, exp, fds.res_ex);
-  
-out:
-	kfree(bits);
-
-out_nofds:
-	return ret;
-}
-
-int ppc32_select(u32 n, u32* inp, u32* outp, u32* exp, u32 tvp_x)
+asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
+		compat_ulong_t __user *outp, compat_ulong_t __user *exp,
+		compat_uptr_t tvp_x)
 {
 	/* sign extend n */
-	return sys32_select((int)n, inp, outp, exp, tvp_x);
+	return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x));
 }
 
-int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
+int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
 {
 	long err;
 
@@ -619,7 +291,7 @@ struct timex32 {
 extern int do_adjtimex(struct timex *);
 extern void ppc_adjtimex(void);
 
-asmlinkage long sys32_adjtimex(struct timex32 *utp)
+asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
 {
 	struct timex txc;
 	int ret;
@@ -678,245 +350,6 @@ asmlinkage long sys32_adjtimex(struct timex32 *utp)
 	return ret;
 }
 
-/* Stuff for NFS server syscalls... */
-struct nfsctl_svc32 {
-	u16			svc32_port;
-	s32			svc32_nthreads;
-};
-
-struct nfsctl_client32 {
-	s8			cl32_ident[NFSCLNT_IDMAX+1];
-	s32			cl32_naddr;
-	struct in_addr		cl32_addrlist[NFSCLNT_ADDRMAX];
-	s32			cl32_fhkeytype;
-	s32			cl32_fhkeylen;
-	u8			cl32_fhkey[NFSCLNT_KEYMAX];
-};
-
-struct nfsctl_export32 {
-	s8			ex32_client[NFSCLNT_IDMAX+1];
-	s8			ex32_path[NFS_MAXPATHLEN+1];
-	compat_dev_t	ex32_dev;
-	compat_ino_t	ex32_ino;
-	s32			ex32_flags;
-	compat_uid_t	ex32_anon_uid;
-	compat_gid_t	ex32_anon_gid;
-};
-
-struct nfsctl_fdparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_version;
-};
-
-struct nfsctl_fsparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_maxlen;
-};
-
-struct nfsctl_arg32 {
-	s32			ca32_version;	/* safeguard */
-	union {
-		struct nfsctl_svc32	u32_svc;
-		struct nfsctl_client32	u32_client;
-		struct nfsctl_export32	u32_export;
-		struct nfsctl_fdparm32	u32_getfd;
-		struct nfsctl_fsparm32	u32_getfs;
-	} u;
-#define ca32_svc	u.u32_svc
-#define ca32_client	u.u32_client
-#define ca32_export	u.u32_export
-#define ca32_getfd	u.u32_getfd
-#define ca32_getfs	u.u32_getfs
-};
-
-union nfsctl_res32 {
-	__u8			cr32_getfh[NFS_FHSIZE];
-	struct knfsd_fh		cr32_getfs;
-};
-
-static int nfs_svc32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= __get_user(karg->ca_svc.svc_port, &arg32->ca32_svc.svc32_port);
-	err |= __get_user(karg->ca_svc.svc_nthreads, &arg32->ca32_svc.svc32_nthreads);
-	return err;
-}
-
-static int nfs_clnt32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_client.cl_ident[0],
-			  &arg32->ca32_client.cl32_ident[0],
-			  NFSCLNT_IDMAX);
-	err |= __get_user(karg->ca_client.cl_naddr, &arg32->ca32_client.cl32_naddr);
-	err |= copy_from_user(&karg->ca_client.cl_addrlist[0],
-			  &arg32->ca32_client.cl32_addrlist[0],
-			  (sizeof(struct in_addr) * NFSCLNT_ADDRMAX));
-	err |= __get_user(karg->ca_client.cl_fhkeytype,
-		      &arg32->ca32_client.cl32_fhkeytype);
-	err |= __get_user(karg->ca_client.cl_fhkeylen,
-		      &arg32->ca32_client.cl32_fhkeylen);
-	err |= copy_from_user(&karg->ca_client.cl_fhkey[0],
-			  &arg32->ca32_client.cl32_fhkey[0],
-			  NFSCLNT_KEYMAX);
-
-	if(err) return -EFAULT;
-	return 0;
-}
-
-static int nfs_exp32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_export.ex_client[0],
-			  &arg32->ca32_export.ex32_client[0],
-			  NFSCLNT_IDMAX);
-	err |= copy_from_user(&karg->ca_export.ex_path[0],
-			  &arg32->ca32_export.ex32_path[0],
-			  NFS_MAXPATHLEN);
-	err |= __get_user(karg->ca_export.ex_dev,
-		      &arg32->ca32_export.ex32_dev);
-	err |= __get_user(karg->ca_export.ex_ino,
-		      &arg32->ca32_export.ex32_ino);
-	err |= __get_user(karg->ca_export.ex_flags,
-		      &arg32->ca32_export.ex32_flags);
-	err |= __get_user(karg->ca_export.ex_anon_uid,
-		      &arg32->ca32_export.ex32_anon_uid);
-	err |= __get_user(karg->ca_export.ex_anon_gid,
-		      &arg32->ca32_export.ex32_anon_gid);
-	karg->ca_export.ex_anon_uid = karg->ca_export.ex_anon_uid;
-	karg->ca_export.ex_anon_gid = karg->ca_export.ex_anon_gid;
-
-	if(err) return -EFAULT;
-	return 0;
-}
-
-static int nfs_getfd32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfd.gd_addr,
-			  &arg32->ca32_getfd.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfd.gd_path,
-			  &arg32->ca32_getfd.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= __get_user(karg->ca_getfd.gd_version,
-		      &arg32->ca32_getfd.gd32_version);
-
-	if(err) return -EFAULT;
-	return 0;
-}
-
-static int nfs_getfs32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfs.gd_addr,
-			  &arg32->ca32_getfs.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfs.gd_path,
-			  &arg32->ca32_getfs.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= __get_user(karg->ca_getfs.gd_maxlen,
-		      &arg32->ca32_getfs.gd32_maxlen);
-
-	if(err) return -EFAULT;
-	return 0;
-}
-
-/* This really doesn't need translations, we are only passing
- * back a union which contains opaque nfs file handle data.
- */
-static int nfs_getfh32_res_trans(union nfsctl_res *kres, union nfsctl_res32 *res32)
-{
-	int err;
-
-	err = copy_to_user(res32, kres, sizeof(*res32));
-
-	if(err) return -EFAULT;
-	return 0;
-}
-
-/* Note: it is necessary to treat cmd_parm as an unsigned int, 
- * with the corresponding cast to a signed int to insure that the 
- * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
- * and the register representation of a signed int (msr in 64-bit mode) is performed.
- */
-int asmlinkage sys32_nfsservctl(u32 cmd_parm, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
-{
-  int cmd = (int)cmd_parm;
-	struct nfsctl_arg *karg = NULL;
-	union nfsctl_res *kres = NULL;
-	mm_segment_t oldfs;
-	int err;
-
-	karg = kmalloc(sizeof(*karg), GFP_USER);
-	if(!karg)
-		return -ENOMEM;
-	if(res32) {
-		kres = kmalloc(sizeof(*kres), GFP_USER);
-		if(!kres) {
-			kfree(karg);
-			return -ENOMEM;
-		}
-	}
-	switch(cmd) {
-	case NFSCTL_SVC:
-		err = nfs_svc32_trans(karg, arg32);
-		break;
-	case NFSCTL_ADDCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_DELCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_EXPORT:
-	case NFSCTL_UNEXPORT:
-		err = nfs_exp32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFD:
-		err = nfs_getfd32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFS:
-		err = nfs_getfs32_trans(karg, arg32);
-		break;
-	default:
-		err = -EINVAL;
-		break;
-	}
-	if(err)
-		goto done;
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_nfsservctl(cmd, karg, kres);
-	set_fs(oldfs);
-
-	if (err)
-		goto done;
-
-	if((cmd == NFSCTL_GETFD) ||
-	   (cmd == NFSCTL_GETFS))
-		err = nfs_getfh32_res_trans(kres, res32);
-
-done:
-	if(karg)
-		kfree(karg);
-	if(kres)
-		kfree(kres);
-	return err;
-}
-
-
 
 /* These are here just in case some old sparc32 binary calls it. */
 asmlinkage long sys32_pause(void)
@@ -929,7 +362,7 @@ asmlinkage long sys32_pause(void)
 
 
 
-static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
+static inline long get_ts32(struct timespec *o, struct compat_timeval __user *i)
 {
 	long usec;
 
@@ -943,7 +376,7 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
 	return 0;
 }
 
-static inline long put_tv32(struct compat_timeval *o, struct timeval *i)
+static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
 {
 	return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
 		(__put_user(i->tv_sec, &o->tv_sec) |
@@ -967,16 +400,18 @@ struct sysinfo32 {
 	char _f[20-2*sizeof(int)-sizeof(int)];
 };
 
-asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
+asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
 {
 	struct sysinfo s;
 	int ret, err;
 	int bitcount=0;
 	mm_segment_t old_fs = get_fs ();
 	
+	/* The __user cast is valid due to set_fs() */
 	set_fs (KERNEL_DS);
-	ret = sys_sysinfo(&s);
+	ret = sys_sysinfo((struct sysinfo __user *)&s);
 	set_fs (old_fs);
+
 	/* Check to see if any memory value is too large for 32-bit and
          * scale down if needed.
          */
@@ -1022,7 +457,7 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 *info)
    sorts of things, like timeval and itimerval.  */
 extern struct timezone sys_tz;
 
-asmlinkage long sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
+asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
 {
 	if (tv) {
 		struct timeval ktv;
@@ -1040,7 +475,7 @@ asmlinkage long sys32_gettimeofday(struct compat_timeval *tv, struct timezone *t
 
 
 
-asmlinkage long sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
+asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
 {
 	struct timespec kts;
 	struct timezone ktz;
@@ -1057,625 +492,69 @@ asmlinkage long sys32_settimeofday(struct compat_timeval *tv, struct timezone *t
 	return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 
-
-struct msgbuf32 {
-	compat_long_t mtype; 
-	char mtext[1];
-};
-
-struct semid_ds32 {
-	struct ipc_perm sem_perm;
-	compat_time_t sem_otime;
-	compat_time_t sem_ctime;
-	compat_uptr_t sem_base;
-	compat_uptr_t sem_pending;
-	compat_uptr_t sem_pending_last;
-	compat_uptr_t undo;
-	unsigned short sem_nsems;
-};
-
-struct semid64_ds32 {
-	struct ipc64_perm sem_perm;
-	unsigned int __unused1;
-	compat_time_t sem_otime;
-	unsigned int __unused2;
-	compat_time_t sem_ctime;
-	compat_ulong_t sem_nsems;
-	compat_ulong_t __unused3;
-	compat_ulong_t __unused4;
-};
-
-struct msqid_ds32 {
-	struct ipc_perm msg_perm;
-	compat_uptr_t msg_first;
-	compat_uptr_t msg_last;
-	compat_time_t msg_stime;
-	compat_time_t msg_rtime;
-	compat_time_t msg_ctime;
-	compat_ulong_t msg_lcbytes;
-	compat_ulong_t msg_lqbytes;
-	unsigned short msg_cbytes;
-	unsigned short msg_qnum;
-	unsigned short msg_qbytes;
-	compat_ipc_pid_t msg_lspid;
-	compat_ipc_pid_t msg_lrpid;
-};
-
-struct msqid64_ds32 {
-	struct ipc64_perm msg_perm;
-	unsigned int __unused1;
-	compat_time_t msg_stime;
-	unsigned int __unused2;
-	compat_time_t msg_rtime;
-	unsigned int __unused3;
-	compat_time_t msg_ctime;
-	compat_ulong_t msg_cbytes;
-	compat_ulong_t msg_qnum;
-	compat_ulong_t msg_qbytes;
-	compat_pid_t msg_lspid;
-	compat_pid_t msg_lrpid;
-	compat_ulong_t __unused4;
-	compat_ulong_t __unused5;
-};
-
-struct shmid_ds32 {
-	struct ipc_perm shm_perm;
-	int shm_segsz;
-	compat_time_t shm_atime;
-	compat_time_t shm_dtime;
-	compat_time_t shm_ctime;
-	compat_ipc_pid_t shm_cpid;
-	compat_ipc_pid_t shm_lpid;
-	unsigned short shm_nattch;
-	unsigned short __unused;
-	compat_uptr_t __unused2;
-	compat_uptr_t __unused3;
-};
-
-struct shmid64_ds32 {
-	struct ipc64_perm shm_perm;
-	unsigned int __unused1;
-	compat_time_t shm_atime;
-	unsigned int __unused2;
-	compat_time_t shm_dtime;
-	unsigned int __unused3;
-	compat_time_t shm_ctime;
-	unsigned int __unused4;
-	compat_size_t shm_segsz;
-	compat_pid_t shm_cpid;
-	compat_pid_t shm_lpid;
-	compat_ulong_t shm_nattch;
-	compat_ulong_t __unused5;
-	compat_ulong_t __unused6;
-};
-
-/*
- * sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit
- * emulation..
- *
- * This is really horribly ugly.
- */
-static long do_sys32_semctl(int first, int second, int third, void *uptr)
-{
-	union semun fourth;
-	u32 pad;
-	int err, err2;
-	mm_segment_t old_fs;
-
-	if (!uptr)
-		return -EINVAL;
-	err = -EFAULT;
-	if (get_user(pad, (u32 *)uptr))
-		return err;
-	if ((third & ~IPC_64) == SETVAL)
-		fourth.val = (int)pad;
-	else
-		fourth.__pad = (void *)A(pad);
-	switch (third & (~IPC_64)) {
-
-	case IPC_INFO:
-	case IPC_RMID:
-	case SEM_INFO:
-	case GETVAL:
-	case GETPID:
-	case GETNCNT:
-	case GETZCNT:
-	case GETALL:
-	case SETALL:
-	case SETVAL:
-		err = sys_semctl(first, second, third, fourth);
-		break;
-
-	case IPC_STAT:
-	case SEM_STAT:
-		if (third & IPC_64) {
-			struct semid64_ds s64;
-			struct semid64_ds32 *usp;
-
-			usp = (struct semid64_ds32 *)A(pad);
-			fourth.__pad = &s64;
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_semctl(first, second, third, fourth);
-			set_fs(old_fs);
-			err2 = copy_to_user(&usp->sem_perm, &s64.sem_perm,
-					    sizeof(struct ipc64_perm));
-			err2 |= __put_user(s64.sem_otime, &usp->sem_otime);
-			err2 |= __put_user(s64.sem_ctime, &usp->sem_ctime);
-			err2 |= __put_user(s64.sem_nsems, &usp->sem_nsems);
-			if (err2)
-				err = -EFAULT;
-		} else {
-			struct semid_ds s;
-			struct semid_ds32 *usp;
-
-			usp = (struct semid_ds32 *)A(pad);
-			fourth.__pad = &s;
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_semctl(first, second, third, fourth);
-			set_fs(old_fs);
-			err2 = copy_to_user(&usp->sem_perm, &s.sem_perm,
-					    sizeof(struct ipc_perm));
-			err2 |= __put_user(s.sem_otime, &usp->sem_otime);
-			err2 |= __put_user(s.sem_ctime, &usp->sem_ctime);
-			err2 |= __put_user(s.sem_nsems, &usp->sem_nsems);
-			if (err2)
-				err = -EFAULT;
-		}
-		break;
- 
-	case IPC_SET:
-		if (third & IPC_64) {
-			struct semid64_ds s64;
-			struct semid64_ds32 *usp;
-
-			usp = (struct semid64_ds32 *)A(pad);
-
-			err = get_user(s64.sem_perm.uid, &usp->sem_perm.uid);
-			err |= __get_user(s64.sem_perm.gid,
-					  &usp->sem_perm.gid);
-			err |= __get_user(s64.sem_perm.mode,
-					  &usp->sem_perm.mode);
-			if (err)
-				goto out;
-			fourth.__pad = &s64;
-
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_semctl(first, second, third, fourth);
-			set_fs(old_fs);
-
-		} else {
-			struct semid_ds s;
-			struct semid_ds32 *usp;
-
-			usp = (struct semid_ds32 *)A(pad);
-
-			err = get_user(s.sem_perm.uid, &usp->sem_perm.uid);
-			err |= __get_user(s.sem_perm.gid,
-					  &usp->sem_perm.gid);
-			err |= __get_user(s.sem_perm.mode,
-					  &usp->sem_perm.mode);
-			if (err)
-				goto out;
-			fourth.__pad = &s;
-
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_semctl(first, second, third, fourth);
-			set_fs(old_fs);
-		}
-		break;
-	default:
-		err = -EINVAL;
-	}
-out:
-	return err;
-}
-
-#define MAXBUF (64*1024)
-
-static int 
-do_sys32_msgsnd(int first, int second, int third, void *uptr)
-{
-	struct msgbuf *p;
-	struct msgbuf32 *up = (struct msgbuf32 *)uptr;
-	mm_segment_t old_fs;
-	int err;
-
-	if (second < 0 || (second >= MAXBUF-sizeof(struct msgbuf)))
-		return -EINVAL;
-
-	p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
-	if (!p)
-		return -ENOMEM;
-	err = get_user(p->mtype, &up->mtype);
-	err |= copy_from_user(p->mtext, &up->mtext, second);
-	if (err) {
-		err = -EFAULT;
-		goto out;
-	}
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_msgsnd(first, p, second, third);
-	set_fs(old_fs);
-out:
-	kfree(p);
-	return err;
-}
-
-static int
-do_sys32_msgrcv(int first, int second, int msgtyp, int third,
-		int version, void *uptr)
-{
-	struct msgbuf32 *up;
-	struct msgbuf *p;
-	mm_segment_t old_fs;
-	int err;
-
-	if (second < 0 || (second >= MAXBUF-sizeof(struct msgbuf)))
-		return -EINVAL;
-
-	if (!version) {
-		struct ipc_kludge_32 *uipck = (struct ipc_kludge_32 *)uptr;
-		struct ipc_kludge_32 ipck;
-
-		err = -EINVAL;
-		if (!uptr)
-			goto out;
-		err = -EFAULT;
-		if (copy_from_user(&ipck, uipck, sizeof(struct ipc_kludge_32)))
-			goto out;
-		uptr = (void *)A(ipck.msgp);
-		msgtyp = ipck.msgtyp;
-	}
-	err = -ENOMEM;
-	p = kmalloc(second + sizeof (struct msgbuf), GFP_USER);
-	if (!p)
-		goto out;
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_msgrcv(first, p, second, msgtyp, third);
-	set_fs(old_fs);
-	if (err < 0)
-		goto free_then_out;
-	up = (struct msgbuf32 *)uptr;
-	if (put_user(p->mtype, &up->mtype) ||
-	    copy_to_user(&up->mtext, p->mtext, err))
-		err = -EFAULT;
-free_then_out:
-	kfree(p);
-out:
-	return err;
-}
-
-static int
-do_sys32_msgctl(int first, int second, void *uptr)
-{
-	int err = -EINVAL, err2;
-	mm_segment_t old_fs;
-
-	switch (second & (~IPC_64)) {
-
-	case IPC_INFO:
-	case IPC_RMID:
-	case MSG_INFO:
-		err = sys_msgctl(first, second, (struct msqid_ds *)uptr);
-		break;
-
-	case IPC_SET:
-		if (second & IPC_64) {
-			struct msqid64_ds m64;
-			struct msqid64_ds32 *up = (struct msqid64_ds32 *)uptr;
-
-			err2 = copy_from_user(&m64.msg_perm, &up->msg_perm,
-					      sizeof(struct ipc64_perm));
-			err2 |= __get_user(m64.msg_qbytes, &up->msg_qbytes);
-			if (err2) {
-				err = -EFAULT;
-				break;
-			}
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_msgctl(first, second,
-					 (struct msqid_ds *)&m64);
-			set_fs(old_fs);
-		} else {
-			struct msqid_ds m;
-			struct msqid_ds32 *up = (struct msqid_ds32 *)uptr;
-
-			err2 = copy_from_user(&m.msg_perm, &up->msg_perm,
-					      sizeof(struct ipc_perm));
-			err2 |= __get_user(m.msg_qbytes, &up->msg_qbytes);
-			if (err2) {
-				err = -EFAULT;
-				break;
-			}
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_msgctl(first, second, &m);
-			set_fs(old_fs);
-		}
-		break;
-
-	case IPC_STAT:
-	case MSG_STAT:
-		if (second & IPC_64) {
-			struct msqid64_ds m64;
-			struct msqid64_ds32 *up = (struct msqid64_ds32 *)uptr;
-
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_msgctl(first, second,
-					 (struct msqid_ds *)&m64);
-			set_fs(old_fs);
-
-			err2 = copy_to_user(&up->msg_perm, &m64.msg_perm,
-					    sizeof(struct ipc64_perm));
- 			err2 |= __put_user(m64.msg_stime, &up->msg_stime);
-			err2 |= __put_user(m64.msg_rtime, &up->msg_rtime);
-			err2 |= __put_user(m64.msg_ctime, &up->msg_ctime);
-			err2 |= __put_user(m64.msg_cbytes, &up->msg_cbytes);
-			err2 |= __put_user(m64.msg_qnum, &up->msg_qnum);
-			err2 |= __put_user(m64.msg_qbytes, &up->msg_qbytes);
-			err2 |= __put_user(m64.msg_lspid, &up->msg_lspid);
-			err2 |= __put_user(m64.msg_lrpid, &up->msg_lrpid);
-			if (err2)
-				err = -EFAULT;
-		} else {
-			struct msqid64_ds m;
-			struct msqid_ds32 *up = (struct msqid_ds32 *)uptr;
-
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_msgctl(first, second, (struct msqid_ds *)&m);
-			set_fs(old_fs);
-
-			err2 = copy_to_user(&up->msg_perm, &m.msg_perm,
-					    sizeof(struct ipc_perm));
- 			err2 |= __put_user(m.msg_stime, &up->msg_stime);
-			err2 |= __put_user(m.msg_rtime, &up->msg_rtime);
-			err2 |= __put_user(m.msg_ctime, &up->msg_ctime);
-			err2 |= __put_user(m.msg_cbytes, &up->msg_cbytes);
-			err2 |= __put_user(m.msg_qnum, &up->msg_qnum);
-			err2 |= __put_user(m.msg_qbytes, &up->msg_qbytes);
-			err2 |= __put_user(m.msg_lspid, &up->msg_lspid);
-			err2 |= __put_user(m.msg_lrpid, &up->msg_lrpid);
-			if (err2)
-				err = -EFAULT;
-		}
-		break;
-	}
-	return err;
-}
-
-static int
-do_sys32_shmat(int first, int second, int third, int version, void *uptr)
+long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
+	       u32 fifth)
 {
-	unsigned long raddr;
-	u32 *uaddr = (u32 *)A((u32)third);
-	int err = -EINVAL;
+	int version;
 
-	if (version == 1)
-		return err;
-	err = do_shmat(first, uptr, second, &raddr);
-	if (err)
-		return err;
-	err = put_user(raddr, uaddr);
-	return err;
-}
-
-static int
-do_sys32_shmctl(int first, int second, void *uptr)
-{
-	int err = -EINVAL, err2;
-	mm_segment_t old_fs;
-
-	switch (second & (~IPC_64)) {
-
-	case IPC_INFO:
-	case IPC_RMID:
-	case SHM_LOCK:
-	case SHM_UNLOCK:
-		err = sys_shmctl(first, second, (struct shmid_ds *)uptr);
-		break;
-	case IPC_SET:
-		if (second & IPC_64) {
-			struct shmid64_ds32 *up = (struct shmid64_ds32 *)uptr;
-			struct shmid64_ds s64;
-
-			err = get_user(s64.shm_perm.uid, &up->shm_perm.uid);
-			err |= __get_user(s64.shm_perm.gid, &up->shm_perm.gid);
-			err |= __get_user(s64.shm_perm.mode,
-					  &up->shm_perm.mode);
-			if (err)
-				break;
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_shmctl(first, second,
-					 (struct shmid_ds *)&s64);
-			set_fs(old_fs);
-		} else {
-			struct shmid_ds32 *up = (struct shmid_ds32 *)uptr;
-			struct shmid_ds s;
-
-			err = get_user(s.shm_perm.uid, &up->shm_perm.uid);
-			err |= __get_user(s.shm_perm.gid, &up->shm_perm.gid);
-			err |= __get_user(s.shm_perm.mode, &up->shm_perm.mode);
-			if (err)
-				break;
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_shmctl(first, second, &s);
-			set_fs(old_fs);
-		}
-		break;
-
-	case IPC_STAT:
-	case SHM_STAT:
-		if (second & IPC_64) {
-			struct shmid64_ds32 *up = (struct shmid64_ds32 *)uptr;
-			struct shmid64_ds s64;
-
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_shmctl(first, second,
-					 (struct shmid_ds *)&s64);
-			set_fs(old_fs);
-			if (err < 0)
-				break;
-
-			err2 = copy_to_user(&up->shm_perm, &s64.shm_perm,
-					    sizeof(struct ipc64_perm));
-			err2 |= __put_user(s64.shm_atime, &up->shm_atime);
-			err2 |= __put_user(s64.shm_dtime, &up->shm_dtime);
-			err2 |= __put_user(s64.shm_ctime, &up->shm_ctime);
-			err2 |= __put_user(s64.shm_segsz, &up->shm_segsz);
-			err2 |= __put_user(s64.shm_nattch, &up->shm_nattch);
-			err2 |= __put_user(s64.shm_cpid, &up->shm_cpid);
-			err2 |= __put_user(s64.shm_lpid, &up->shm_lpid);
-			if (err2)
-				err = -EFAULT;
-		} else {
-			struct shmid_ds32 *up = (struct shmid_ds32 *)uptr;
-			struct shmid_ds s;
-
-			old_fs = get_fs();
-			set_fs(KERNEL_DS);
-			err = sys_shmctl(first, second, &s);
-			set_fs(old_fs);
-			if (err < 0)
-				break;
-
-			err2 = copy_to_user(&up->shm_perm, &s.shm_perm,
-					    sizeof(struct ipc_perm));
-			err2 |= __put_user (s.shm_atime, &up->shm_atime);
-			err2 |= __put_user (s.shm_dtime, &up->shm_dtime);
-			err2 |= __put_user (s.shm_ctime, &up->shm_ctime);
-			err2 |= __put_user (s.shm_segsz, &up->shm_segsz);
-			err2 |= __put_user (s.shm_nattch, &up->shm_nattch);
-			err2 |= __put_user (s.shm_cpid, &up->shm_cpid);
-			err2 |= __put_user (s.shm_lpid, &up->shm_lpid);
-			if (err2)
-				err = -EFAULT;
-		}
-		break;
-
-	case SHM_INFO: {
-		struct shm_info si;
-		struct shm_info32 {
-			int used_ids;
-			u32 shm_tot, shm_rss, shm_swp;
-			u32 swap_attempts, swap_successes;
-		} *uip = (struct shm_info32 *)uptr;
-
-		old_fs = get_fs();
-		set_fs(KERNEL_DS);
-		err = sys_shmctl(first, second, (struct shmid_ds *)&si);
-		set_fs(old_fs);
-		if (err < 0)
-			break;
-		err2 = put_user(si.used_ids, &uip->used_ids);
-		err2 |= __put_user(si.shm_tot, &uip->shm_tot);
-		err2 |= __put_user(si.shm_rss, &uip->shm_rss);
-		err2 |= __put_user(si.shm_swp, &uip->shm_swp);
-		err2 |= __put_user(si.swap_attempts, &uip->swap_attempts);
-		err2 |= __put_user(si.swap_successes, &uip->swap_successes);
-		if (err2)
-			err = -EFAULT;
-		break;
-	}
-	}
-	return err;
-}
-
-static int sys32_semtimedop(int semid, struct sembuf *tsems, int nsems,
-			    const struct compat_timespec *timeout32)
-{
-	struct compat_timespec t32;
-	struct timespec *t64 = compat_alloc_user_space(sizeof(*t64));
-
-	if (copy_from_user(&t32, timeout32, sizeof(t32)))
-		return -EFAULT;
-
-	if (put_user(t32.tv_sec, &t64->tv_sec) ||
-	    put_user(t32.tv_nsec, &t64->tv_nsec))
-		return -EFAULT;
-
-	return sys_semtimedop(semid, tsems, nsems, t64);
-}
-
-/*
- * Note: it is necessary to treat first_parm, second_parm, and
- * third_parm as unsigned ints, with the corresponding cast to a
- * signed int to insure that the proper conversion (sign extension)
- * between the register representation of a signed int (msr in 32-bit
- * mode) and the register representation of a signed int (msr in
- * 64-bit mode) is performed.
- */
-asmlinkage long sys32_ipc(u32 call, u32 first_parm, u32 second_parm, u32 third_parm, u32 ptr, u32 fifth)
-{
-	int first  = (int)first_parm;
-	int second = (int)second_parm;
-	int third  = (int)third_parm;
-	int version, err;
-	
 	version = call >> 16; /* hack for backward compatibility */
 	call &= 0xffff;
 
 	switch (call) {
 
+	case SEMTIMEDOP:
+		if (third)
+			/* sign extend semid */
+			return compat_sys_semtimedop((int)first,
+						     compat_ptr(ptr), second,
+						     compat_ptr(third));
+		/* else fall through for normal semop() */
 	case SEMOP:
 		/* struct sembuf is the same on 32 and 64bit :)) */
-		err = sys_semtimedop(first, (struct sembuf *)AA(ptr),
-				     second, NULL);
-		break;
-	case SEMTIMEDOP:
-		err = sys32_semtimedop(first, (struct sembuf *)AA(ptr), second,
-				       (const struct compat_timespec *)AA(fifth));
-		break;
+		/* sign extend semid */
+		return sys_semtimedop((int)first, compat_ptr(ptr), second,
+				      NULL);
 	case SEMGET:
-		err = sys_semget(first, second, third);
-		break;
+		/* sign extend key, nsems */
+		return sys_semget((int)first, (int)second, third);
 	case SEMCTL:
-		err = do_sys32_semctl(first, second, third,
-				      (void *)AA(ptr));
-		break;
+		/* sign extend semid, semnum */
+		return compat_sys_semctl((int)first, (int)second, third,
+					 compat_ptr(ptr));
 
 	case MSGSND:
-		err = do_sys32_msgsnd(first, second, third,
-				      (void *)AA(ptr));
-		break;
+		/* sign extend msqid */
+		return compat_sys_msgsnd((int)first, (int)second, third,
+					 compat_ptr(ptr));
 	case MSGRCV:
-		err = do_sys32_msgrcv(first, second, fifth, third,
-				      version, (void *)AA(ptr));
-		break;
+		/* sign extend msqid, msgtyp */
+		return compat_sys_msgrcv((int)first, second, (int)fifth,
+					 third, version, compat_ptr(ptr));
 	case MSGGET:
-		err = sys_msgget((key_t)first, second);
-		break;
+		/* sign extend key */
+		return sys_msgget((int)first, second);
 	case MSGCTL:
-		err = do_sys32_msgctl(first, second, (void *)AA(ptr));
-		break;
+		/* sign extend msqid */
+		return compat_sys_msgctl((int)first, second, compat_ptr(ptr));
 
 	case SHMAT:
-		err = do_sys32_shmat(first, second, third,
-				     version, (void *)AA(ptr));
-		break;
-	case SHMDT: 
-		err = sys_shmdt((char *)AA(ptr));
-		break;
+		/* sign extend shmid */
+		return compat_sys_shmat((int)first, second, third, version,
+					compat_ptr(ptr));
+	case SHMDT:
+		return sys_shmdt(compat_ptr(ptr));
 	case SHMGET:
-		err = sys_shmget(first, second_parm, third);
-		break;
+		/* sign extend key_t */
+		return sys_shmget((int)first, second, third);
 	case SHMCTL:
-		err = do_sys32_shmctl(first, second, (void *)AA(ptr));
-		break;
+		/* sign extend shmid */
+		return compat_sys_shmctl((int)first, second, compat_ptr(ptr));
+
 	default:
-		err = -ENOSYS;
-		break;
+		return -ENOSYS;
 	}
-	return err;
+
+	return -ENOSYS;
 }
 
 /* Note: it is necessary to treat out_fd and in_fd as unsigned ints, 
@@ -1683,17 +562,20 @@ asmlinkage long sys32_ipc(u32 call, u32 first_parm, u32 second_parm, u32 third_p
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_sendfile(u32 out_fd, u32 in_fd, compat_off_t* offset, u32 count)
+asmlinkage long sys32_sendfile(u32 out_fd, u32 in_fd, compat_off_t __user * offset, u32 count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
 	off_t of;
-	
+	off_t __user *up;
+
 	if (offset && get_user(of, offset))
 		return -EFAULT;
-		
+
+	/* The __user pointer cast is valid because of the set_fs() */		
 	set_fs(KERNEL_DS);
-	ret = sys_sendfile((int)out_fd, (int)in_fd, offset ? &of : NULL, count);
+	up = offset ? (off_t __user *) &of : NULL;
+	ret = sys_sendfile((int)out_fd, (int)in_fd, up, count);
 	set_fs(old_fs);
 	
 	if (offset && put_user(of, offset))
@@ -1702,17 +584,20 @@ asmlinkage long sys32_sendfile(u32 out_fd, u32 in_fd, compat_off_t* offset, u32
 	return ret;
 }
 
-asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s32 count)
+asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, s32 count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
 	loff_t lof;
+	loff_t __user *up;
 	
 	if (offset && get_user(lof, offset))
 		return -EFAULT;
 		
+	/* The __user pointer cast is valid because of the set_fs() */		
 	set_fs(KERNEL_DS);
-	ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count);
+	up = offset ? (loff_t __user *) &lof : NULL;
+	ret = sys_sendfile64(out_fd, in_fd, up, count);
 	set_fs(old_fs);
 	
 	if (offset && put_user(lof, offset))
@@ -1721,191 +606,6 @@ asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s3
 	return ret;
 }
 
-/*
- * count32() counts the number of arguments/envelopes
- */
-static int count32(u32 * argv, int max)
-{
-	int i = 0;
-
-	if (argv != NULL) {
-		for (;;) {
-			u32 p; int error;
-
-			error = get_user(p,argv);
-			if (error)
-				return error;
-			if (!p)
-				break;
-			argv++;
-			if (++i > max)
-				return -E2BIG;
-		}
-	}
-	return i;
-}
-
-/*
- * 'copy_string32()' copies argument/envelope strings from user
- * memory to free pages in kernel mem. These are in a format ready
- * to be put directly into the top of new user memory.
- */
-static int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm)
-{
-	while (argc-- > 0) {
-		u32 str;
-		int len;
-		unsigned long pos;
-
-		if (get_user(str, argv + argc) ||
-		    !str ||
-		    !(len = strnlen_user((char *)A(str), bprm->p)))
-			return -EFAULT;
-
-		if (bprm->p < len)
-			return -E2BIG;
-
-		bprm->p -= len;
-
-		pos = bprm->p;
-		while (len) {
-			char *kaddr;
-			struct page *page;
-			int offset, bytes_to_copy, new, err;
-
-			offset = pos % PAGE_SIZE;
-			page = bprm->page[pos / PAGE_SIZE];
-			new = 0;
-			if (!page) {
-				page = alloc_page(GFP_USER);
-				bprm->page[pos / PAGE_SIZE] = page;
-				if (!page)
-					return -ENOMEM;
-				new = 1;
-			}
-			kaddr = (char *)kmap(page);
-
-			if (new && offset)
-				memset(kaddr, 0, offset);
-			bytes_to_copy = PAGE_SIZE - offset;
-			if (bytes_to_copy > len) {
-				bytes_to_copy = len;
-				if (new)
-					memset(kaddr+offset+len, 0,
-					       PAGE_SIZE-offset-len);
-			}
-
-			err = copy_from_user(kaddr + offset, (char *)A(str),
-					     bytes_to_copy);
-			kunmap((unsigned long)kaddr);
-
-			if (err)
-				return -EFAULT;
-
-			pos += bytes_to_copy;
-			str += bytes_to_copy;
-			len -= bytes_to_copy;
-		}
-	}
-	return 0;
-}
-
-/*
- * sys32_execve() executes a new program.
- */
-static int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
-{
-	struct linux_binprm bprm;
-	struct file * file;
-	int retval;
-	int i;
-
-	sched_balance_exec();
-
-	file = open_exec(filename);
-
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		return retval;
-
-	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
-	memset(bprm.page, 0, MAX_ARG_PAGES * sizeof(bprm.page[0]));
-
-	bprm.file = file;
-	bprm.filename = filename;
-	bprm.interp = filename;
-	bprm.sh_bang = 0;
-	bprm.loader = 0;
-	bprm.exec = 0;
-	bprm.security = NULL;
-	bprm.mm = mm_alloc();
-	retval = -ENOMEM;
-	if (!bprm.mm)
-		goto out_file;
-
-	retval = init_new_context(current, bprm.mm);
-	if (retval < 0)
-		goto out_mm;
-
-	bprm.argc = count32(argv, bprm.p / sizeof(u32));
-	if ((retval = bprm.argc) < 0)
-		goto out_mm;
-
-	bprm.envc = count32(envp, bprm.p / sizeof(u32));
-	if ((retval = bprm.envc) < 0)
-		goto out_mm;
-
-	retval = security_bprm_alloc(&bprm);
-	if (retval)
-		goto out;
-
-	retval = prepare_binprm(&bprm);
-	if (retval < 0) 
-		goto out; 
-
-	retval = copy_strings_kernel(1, &bprm.filename, &bprm);
-	if (retval < 0) 
-		goto out; 
-
-	bprm.exec = bprm.p;
-	retval = copy_strings32(bprm.envc, envp, &bprm);
-	if (retval < 0) 
-		goto out; 
-
-	retval = copy_strings32(bprm.argc, argv, &bprm);
-	if (retval < 0) 
-		goto out; 
-
-	retval = search_binary_handler(&bprm,regs);
-	if (retval >= 0) {
-		/* execve success */
-		security_bprm_free(&bprm);
-		return retval;
-	}
-
-out:
-	/* Something went wrong, return the inode and free the argument pages*/
-	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
-		struct page * page = bprm.page[i];
-		if (page)
-			__free_page(page);
-	}
-
-	if (bprm.security)
-		security_bprm_free(&bprm);
-
-out_mm:
-	if (bprm.mm)
-		mmdrop(bprm.mm);
-
-out_file:
-	if (bprm.file) {
-		allow_write_access(bprm.file);
-		fput(bprm.file);
-	}
-	return retval;
-}
-
 long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 		  unsigned long a3, unsigned long a4, unsigned long a5,
 		  struct pt_regs *regs)
@@ -1913,7 +613,7 @@ long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 	int error;
 	char * filename;
 	
-	filename = getname((char *) a0);
+	filename = getname((char __user *) a0);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
@@ -1924,7 +624,7 @@ long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 		giveup_altivec(current);
 #endif /* CONFIG_ALTIVEC */
 
-	error = do_execve32(filename, (u32*) a1, (u32*) a2, regs);
+	error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs);
 
 	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
@@ -1983,14 +683,15 @@ asmlinkage long sys32_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_sched_rr_get_interval(u32 pid, struct compat_timespec *interval)
+asmlinkage long sys32_sched_rr_get_interval(u32 pid, struct compat_timespec __user *interval)
 {
 	struct timespec t;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	
+
+	/* The __user pointer cast is valid because of the set_fs() */
 	set_fs (KERNEL_DS);
-	ret = sys_sched_rr_get_interval((int)pid, &t);
+	ret = sys_sched_rr_get_interval((int)pid, (struct timespec __user *) &t);
 	set_fs (old_fs);
 	if (put_compat_timespec(&t, interval))
 		return -EFAULT;
@@ -2003,7 +704,7 @@ asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf
 				  (unsigned long) dfn,
 				  (unsigned long) off,
 				  (unsigned long) len,
-				  (unsigned char *)AA(ubuf));
+				  (unsigned char __user *)AA(ubuf));
 }
 
 asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
@@ -2012,7 +713,7 @@ asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubu
 				   (unsigned long) dfn,
 				   (unsigned long) off,
 				   (unsigned long) len,
-				   (unsigned char *)AA(ubuf));
+				   (unsigned char __user *)AA(ubuf));
 }
 
 #define IOBASE_BRIDGE_NUMBER	0
@@ -2073,7 +774,7 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
 }
 
 
-asmlinkage int ppc64_newuname(struct new_utsname * name)
+asmlinkage int ppc64_newuname(struct new_utsname __user * name)
 {
 	int errno = sys_newuname(name);
 
@@ -2103,7 +804,7 @@ asmlinkage int ppc64_personality(unsigned long personality)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_access(const char * filename, u32 mode)
+asmlinkage long sys32_access(const char __user * filename, u32 mode)
 {
 	return sys_access(filename, (int)mode);
 }
@@ -2114,7 +815,7 @@ asmlinkage long sys32_access(const char * filename, u32 mode)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_creat(const char * pathname, u32 mode)
+asmlinkage long sys32_creat(const char __user * pathname, u32 mode)
 {
 	return sys_creat(pathname, (int)mode);
 }
@@ -2125,7 +826,7 @@ asmlinkage long sys32_creat(const char * pathname, u32 mode)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_waitpid(u32 pid, unsigned int * stat_addr, u32 options)
+asmlinkage long sys32_waitpid(u32 pid, unsigned int __user * stat_addr, u32 options)
 {
 	return sys_waitpid((int)pid, stat_addr, (int)options);
 }
@@ -2136,7 +837,7 @@ asmlinkage long sys32_waitpid(u32 pid, unsigned int * stat_addr, u32 options)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_getgroups(u32 gidsetsize, gid_t *grouplist)
+asmlinkage long sys32_getgroups(u32 gidsetsize, gid_t __user *grouplist)
 {
 	return sys_getgroups((int)gidsetsize, grouplist);
 }
@@ -2191,7 +892,7 @@ asmlinkage long sys32_kill(u32 pid, u32 sig)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_mkdir(const char * pathname, u32 mode)
+asmlinkage long sys32_mkdir(const char __user * pathname, u32 mode)
 {
 	return sys_mkdir(pathname, (int)mode);
 }
@@ -2212,7 +913,7 @@ off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin)
  * This is just a version for 32-bit applications which does
  * not force O_LARGEFILE on.
  */
-long sys32_open(const char * filename, int flags, int mode)
+asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
 {
 	char * tmp;
 	int fd, error;
@@ -2244,7 +945,7 @@ out_error:
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_readlink(const char * path, char * buf, u32 bufsiz)
+asmlinkage long sys32_readlink(const char __user * path, char __user * buf, u32 bufsiz)
 {
 	return sys_readlink(path, buf, (int)bufsiz);
 }
@@ -2276,7 +977,7 @@ asmlinkage long sys32_sched_get_priority_min(u32 policy)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_sched_getparam(u32 pid, struct sched_param *param)
+asmlinkage long sys32_sched_getparam(u32 pid, struct sched_param __user *param)
 {
 	return sys_sched_getparam((int)pid, param);
 }
@@ -2298,7 +999,7 @@ asmlinkage long sys32_sched_getscheduler(u32 pid)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_sched_setparam(u32 pid, struct sched_param *param)
+asmlinkage long sys32_sched_setparam(u32 pid, struct sched_param __user *param)
 {
 	return sys_sched_setparam((int)pid, param);
 }
@@ -2309,7 +1010,7 @@ asmlinkage long sys32_sched_setparam(u32 pid, struct sched_param *param)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_sched_setscheduler(u32 pid, u32 policy, struct sched_param *param)
+asmlinkage long sys32_sched_setscheduler(u32 pid, u32 policy, struct sched_param __user *param)
 {
 	return sys_sched_setscheduler((int)pid, (int)policy, param);
 }
@@ -2320,7 +1021,7 @@ asmlinkage long sys32_sched_setscheduler(u32 pid, u32 policy, struct sched_param
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_setdomainname(char *name, u32 len)
+asmlinkage long sys32_setdomainname(char __user *name, u32 len)
 {
 	return sys_setdomainname(name, (int)len);
 }
@@ -2331,13 +1032,13 @@ asmlinkage long sys32_setdomainname(char *name, u32 len)
  * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
  * and the register representation of a signed int (msr in 64-bit mode) is performed.
  */
-asmlinkage long sys32_setgroups(u32 gidsetsize, gid_t *grouplist)
+asmlinkage long sys32_setgroups(u32 gidsetsize, gid_t __user *grouplist)
 {
 	return sys_setgroups((int)gidsetsize, grouplist);
 }
 
 
-asmlinkage long sys32_sethostname(char *name, u32 len)
+asmlinkage long sys32_sethostname(char __user *name, u32 len)
 {
 	/* sign extend len */
 	return sys_sethostname(name, (int)len);
@@ -2371,7 +1072,7 @@ asmlinkage long sys32_ssetmask(u32 newmask)
 	return sys_ssetmask((int) newmask);
 }
 
-long sys32_syslog(u32 type, char * buf, u32 len)
+asmlinkage long sys32_syslog(u32 type, char __user * buf, u32 len)
 {
 	/* sign extend len */
 	return sys_syslog(type, buf, (int)len);
@@ -2398,12 +1099,13 @@ struct __sysctl_args32 {
 	u32 __unused[4];
 };
 
-extern asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
+extern asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
 {
 	struct __sysctl_args32 tmp;
 	int error;
-	size_t oldlen, *oldlenp = NULL;
-	unsigned long addr = (((long)&args->__unused[0]) + 7) & ~7;
+	size_t oldlen;
+	size_t __user *oldlenp = NULL;
+	unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
 
 	if (copy_from_user(&tmp, args, sizeof(tmp)))
 		return -EFAULT;
@@ -2415,20 +1117,20 @@ extern asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
 		   basically copy the whole sysctl.c here, and
 		   glibc's __sysctl uses rw memory for the structure
 		   anyway.  */
-		if (get_user(oldlen, (u32 *)A(tmp.oldlenp)) ||
-		    put_user(oldlen, (size_t *)addr))
+		oldlenp = (size_t __user *)addr;
+		if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
+		    put_user(oldlen, oldlenp))
 			return -EFAULT;
-		oldlenp = (size_t *)addr;
 	}
 
 	lock_kernel();
-	error = do_sysctl((int *)A(tmp.name), tmp.nlen, (void *)A(tmp.oldval),
-			  oldlenp, (void *)A(tmp.newval), tmp.newlen);
+	error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
+			  oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
 	unlock_kernel();
 	if (oldlenp) {
 		if (!error) {
-			if (get_user(oldlen, (size_t *)addr) ||
-			    put_user(oldlen, (u32 *)A(tmp.oldlenp)))
+			if (get_user(oldlen, oldlenp) ||
+			    put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
 				error = -EFAULT;
 		}
 		copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
@@ -2436,7 +1138,7 @@ extern asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
 	return error;
 }
 
-asmlinkage long sys32_time(compat_time_t* tloc)
+asmlinkage long sys32_time(compat_time_t __user * tloc)
 {
 	compat_time_t secs;
 
@@ -2453,7 +1155,7 @@ asmlinkage long sys32_time(compat_time_t* tloc)
 	return secs;
 }
 
-int sys32_olduname(struct oldold_utsname * name)
+asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
 {
 	int error;
 	
@@ -2488,37 +1190,26 @@ unsigned long sys32_mmap2(unsigned long addr, size_t len,
 	return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
 }
 
-int get_compat_timeval(struct timeval *tv, struct compat_timeval *ctv)
+int get_compat_timeval(struct timeval *tv, struct compat_timeval __user *ctv)
 {
 	return (verify_area(VERIFY_READ, ctv, sizeof(*ctv)) ||
 		__get_user(tv->tv_sec, &ctv->tv_sec) ||
 		__get_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0;
 }
 
-long sys32_utimes(char *filename, struct compat_timeval *tvs)
+asmlinkage long sys32_utimes(char __user *filename, struct compat_timeval __user *tvs)
 {
-	char *kfilename;
-	struct timeval ktvs[2];
-	mm_segment_t old_fs;
-	long ret;
-
-	kfilename = getname(filename);
-	ret = PTR_ERR(kfilename);
-	if (!IS_ERR(kfilename)) {
-		if (tvs) {
-			if (get_compat_timeval(&ktvs[0], &tvs[0]) ||
-			    get_compat_timeval(&ktvs[1], &tvs[1]))
-				return -EFAULT;
-		}
+	struct timeval ktvs[2], *ptr;
 
-		old_fs = get_fs();
-		set_fs(KERNEL_DS);
-		ret = do_utimes(kfilename, (tvs ? &ktvs[0] : NULL));
-		set_fs(old_fs);
-
-		putname(kfilename);
+	ptr = NULL;
+	if (tvs) {
+		if (get_compat_timeval(&ktvs[0], &tvs[0]) ||
+		    get_compat_timeval(&ktvs[1], &tvs[1]))
+			return -EFAULT;
+		ptr = ktvs;
 	}
-	return ret;
+
+	return do_utimes(filename, ptr);
 }
 
 long sys32_tgkill(u32 tgid, u32 pid, int sig)
@@ -2532,13 +1223,13 @@ long sys32_tgkill(u32 tgid, u32 pid, int sig)
  * The 32 bit ABI passes long longs in an odd even register pair.
  */
 
-compat_ssize_t sys32_pread64(unsigned int fd, char *ubuf, compat_size_t count,
+compat_ssize_t sys32_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
 			     u32 reg6, u32 poshi, u32 poslo)
 {
 	return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
 }
 
-compat_ssize_t sys32_pwrite64(unsigned int fd, char *ubuf, compat_size_t count,
+compat_ssize_t sys32_pwrite64(unsigned int fd, char __user *ubuf, compat_size_t count,
 			      u32 reg6, u32 poshi, u32 poslo)
 {
 	return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
@@ -2549,7 +1240,7 @@ compat_ssize_t sys32_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count)
 	return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count);
 }
 
-asmlinkage int sys32_truncate64(const char * path, u32 reg4,
+asmlinkage int sys32_truncate64(const char __user * path, u32 reg4,
 				unsigned long high, unsigned long low)
 {
 	return sys_truncate(path, (high << 32) | low);
@@ -2561,7 +1252,7 @@ asmlinkage int sys32_ftruncate64(unsigned int fd, u32 reg4, unsigned long high,
 	return sys_ftruncate(fd, (high << 32) | low);
 }
 
-long ppc32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char *buf,
+long ppc32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char __user *buf,
 			  size_t len)
 {
 	return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
@@ -2582,7 +1273,7 @@ long ppc32_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
 			     (u64)len_high << 32 | len_low, advice);
 }
 
-extern long sys_timer_create(clockid_t, sigevent_t *, timer_t *);
+extern asmlinkage long sys_timer_create(clockid_t, sigevent_t __user *, timer_t __user *);
 
 long ppc32_timer_create(clockid_t clock,
 			struct compat_sigevent __user *ev32,
@@ -2611,7 +1302,10 @@ long ppc32_timer_create(clockid_t clock,
 
 	savefs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_timer_create(clock, &event, &t);
+	/* The __user pointer casts are valid due to the set_fs() */
+	err = sys_timer_create(clock,
+		(sigevent_t __user *) &event,
+		(timer_t __user *) &t);
 	set_fs(savefs);
 
 	if (err == 0)
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
index 00ff6538b..4ae0825ee 100644
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/ppc64/kernel/syscalls.c
@@ -57,7 +57,7 @@ check_bugs(void)
  * This is really horribly ugly.
  */
 asmlinkage int 
-sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
+sys_ipc (uint call, int first, int second, long third, void __user *ptr, long fifth)
 {
 	int version, ret;
 
@@ -67,12 +67,12 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
 	ret = -ENOSYS;
 	switch (call) {
 	case SEMOP:
-		ret = sys_semtimedop (first, (struct sembuf *)ptr, second,
+		ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second,
 				      NULL);
 		break;
 	case SEMTIMEDOP:
-		ret = sys_semtimedop (first, (struct sembuf *)ptr, second,
-				      (const struct timespec *) fifth);
+		ret = sys_semtimedop (first, (struct sembuf __user *)ptr, second,
+				      (const struct timespec __user *) fifth);
 		break;
 	case SEMGET:
 		ret = sys_semget (first, second, third);
@@ -83,13 +83,13 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
 		ret = -EINVAL;
 		if (!ptr)
 			break;
-		if ((ret = get_user(fourth.__pad, (void **)ptr)))
+		if ((ret = get_user(fourth.__pad, (void __user * __user *)ptr)))
 			break;
 		ret = sys_semctl (first, second, third, fourth);
 		break;
 	}
 	case MSGSND:
-		ret = sys_msgsnd (first, (struct msgbuf *) ptr, second, third);
+		ret = sys_msgsnd (first, (struct msgbuf __user *) ptr, second, third);
 		break;
 	case MSGRCV:
 		switch (version) {
@@ -100,7 +100,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
 			if (!ptr)
 				break;
 			if ((ret = copy_from_user(&tmp,
-						(struct ipc_kludge *) ptr,
+						(struct ipc_kludge __user *) ptr,
 						sizeof (tmp)) ? -EFAULT : 0))
 				break;
 			ret = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp,
@@ -108,7 +108,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
 			break;
 		}
 		default:
-			ret = sys_msgrcv (first, (struct msgbuf *) ptr,
+			ret = sys_msgrcv (first, (struct msgbuf __user *) ptr,
 					  second, fifth, third);
 			break;
 		}
@@ -117,35 +117,35 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
 		ret = sys_msgget ((key_t) first, second);
 		break;
 	case MSGCTL:
-		ret = sys_msgctl (first, second, (struct msqid_ds *) ptr);
+		ret = sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
 		break;
 	case SHMAT:
 		switch (version) {
 		default: {
 			ulong raddr;
-			ret = do_shmat (first, (char *) ptr, second, &raddr);
+			ret = do_shmat (first, (char __user *) ptr, second, &raddr);
 			if (ret)
 				break;
-			ret = put_user (raddr, (ulong *) third);
+			ret = put_user (raddr, (ulong __user *) third);
 			break;
 		}
 		case 1:	/* iBCS2 emulator entry point */
 			ret = -EINVAL;
 			if (!segment_eq(get_fs(), get_ds()))
 				break;
-			ret = do_shmat (first, (char *) ptr, second,
+			ret = do_shmat (first, (char __user *) ptr, second,
 					 (ulong *) third);
 			break;
 		}
 		break;
 	case SHMDT: 
-		ret = sys_shmdt ((char *)ptr);
+		ret = sys_shmdt ((char __user *)ptr);
 		break;
 	case SHMGET:
 		ret = sys_shmget (first, second, third);
 		break;
 	case SHMCTL:
-		ret = sys_shmctl (first, second, (struct shmid_ds *) ptr);
+		ret = sys_shmctl (first, second, (struct shmid_ds __user *) ptr);
 		break;
 	}
 
@@ -156,7 +156,7 @@ sys_ipc (uint call, int first, int second, long third, void *ptr, long fifth)
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way unix traditionally does this, though.
  */
-asmlinkage int sys_pipe(int *fildes)
+asmlinkage int sys_pipe(int __user *fildes)
 {
 	int fd[2];
 	int error;
@@ -202,7 +202,7 @@ static int __init set_fakeppc(char *str)
 }
 __setup("fakeppc", set_fakeppc);
 
-asmlinkage int sys_uname(struct old_utsname * name)
+asmlinkage int sys_uname(struct old_utsname __user * name)
 {
 	int err = -EFAULT;
 	
@@ -214,7 +214,7 @@ asmlinkage int sys_uname(struct old_utsname * name)
 	return err;
 }
 
-asmlinkage time_t sys64_time(time_t* tloc)
+asmlinkage time_t sys64_time(time_t __user * tloc)
 {
 	time_t secs;
 	time_t usecs;
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index 3bcbdec74..dcb1097ce 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -114,6 +114,7 @@ void ppc64_enable_pmcs(void)
 	unsigned long hid0;
 	unsigned long set, reset;
 	int ret;
+	unsigned int ctrl;
 
 	/* Only need to enable them once */
 	if (__get_cpu_var(pmcs_enabled))
@@ -158,6 +159,16 @@ void ppc64_enable_pmcs(void)
 		char *ptr = (char *)&paca[smp_processor_id()].xLpPaca;
 		ptr[0xBB] = 1;
 	}
+
+	/*
+	 * On SMT machines we have to set the run latch in the ctrl register
+	 * in order to make PMC6 spin.
+	 */
+	if (cur_cpu_spec->cpu_features & CPU_FTR_SMT) {
+		ctrl = mfspr(CTRLF);
+		ctrl |= RUNLATCH;
+		mtspr(CTRLT, ctrl);
+	}
 }
 #endif
 
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 085da5670..33229ac0a 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -66,7 +66,7 @@
 
 void smp_local_timer_interrupt(struct pt_regs *);
 
-u64 jiffies_64 = INITIAL_JIFFIES;
+u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES;
 
 EXPORT_SYMBOL(jiffies_64);
 
@@ -256,7 +256,7 @@ static void iSeries_tb_recal(void)
  * call will not be needed)
  */
 
-unsigned long tb_last_stamp=0;
+unsigned long tb_last_stamp __cacheline_aligned_in_smp;
 
 /*
  * timer_interrupt - gets called when the decrementer overflows,
@@ -430,7 +430,7 @@ EXPORT_SYMBOL(do_settimeofday);
  * fields itself.  This way, the fields which are used for 
  * do_settimeofday get updated too.
  */
-long ppc64_sys32_stime(int* tptr)
+long ppc64_sys32_stime(int __user * tptr)
 {
 	int value;
 	struct timespec myTimeval;
@@ -455,7 +455,7 @@ long ppc64_sys32_stime(int* tptr)
  * fields itself.  This way, the fields which are used for 
  * do_settimeofday get updated too.
  */
-long ppc64_sys_stime(long* tptr)
+long ppc64_sys_stime(long __user * tptr)
 {
 	long value;
 	struct timespec myTimeval;
diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c
index 82d9b8b24..c941b796a 100644
--- a/arch/ppc64/kernel/traps.c
+++ b/arch/ppc64/kernel/traps.c
@@ -44,6 +44,7 @@ extern int fwnmi_active;
 
 #ifdef CONFIG_DEBUGGER
 int (*__debugger)(struct pt_regs *regs);
+int (*__debugger_ipi)(struct pt_regs *regs);
 int (*__debugger_bpt)(struct pt_regs *regs);
 int (*__debugger_sstep)(struct pt_regs *regs);
 int (*__debugger_iabr_match)(struct pt_regs *regs);
@@ -51,6 +52,7 @@ int (*__debugger_dabr_match)(struct pt_regs *regs);
 int (*__debugger_fault_handler)(struct pt_regs *regs);
 
 EXPORT_SYMBOL(__debugger);
+EXPORT_SYMBOL(__debugger_ipi);
 EXPORT_SYMBOL(__debugger_bpt);
 EXPORT_SYMBOL(__debugger_sstep);
 EXPORT_SYMBOL(__debugger_iabr_match);
@@ -69,9 +71,6 @@ int die(const char *str, struct pt_regs *regs, long err)
 	static int die_counter;
 	int nl = 0;
 
-	if (debugger_fault_handler(regs))
-		return 1;
-
 	if (debugger(regs))
 		return 1;
 
@@ -266,6 +265,8 @@ MachineCheckException(struct pt_regs *regs)
 	}
 #endif
 
+	if (debugger_fault_handler(regs))
+		return;
 	die("Machine check", regs, 0);
 
 	/* Must die if the interrupt is not recoverable */
@@ -465,6 +466,18 @@ SingleStepException(struct pt_regs *regs)
 	_exception(SIGTRAP, &info, regs);	
 }
 
+/*
+ * After we have successfully emulated an instruction, we have to
+ * check if the instruction was being single-stepped, and if so,
+ * pretend we got a single-step exception.  This was pointed out
+ * by Kumar Gala.  -- paulus
+ */
+static inline void emulate_single_step(struct pt_regs *regs)
+{
+	if (regs->msr & MSR_SE)
+		SingleStepException(regs);
+}
+
 static void dummy_perf(struct pt_regs *regs)
 {
 }
@@ -486,10 +499,8 @@ AlignmentException(struct pt_regs *regs)
 	fixed = fix_alignment(regs);
 
 	if (fixed == 1) {
-		if (!user_mode(regs))
-			PPCDBG(PPCDBG_ALIGNFIXUP, "fix alignment at %lx\n",
-			       regs->nip);
 		regs->nip += 4;	/* skip over emulated instruction */
+		emulate_single_step(regs);
 		return;
 	}
 
diff --git a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c
index 817f3152f..78b05df91 100644
--- a/arch/ppc64/kernel/vio.c
+++ b/arch/ppc64/kernel/vio.c
@@ -32,7 +32,9 @@
 
 extern struct subsystem devices_subsys; /* needed for vio_find_name() */
 
-struct iommu_table *vio_build_iommu_table(struct vio_dev *dev);
+static struct iommu_table *vio_build_iommu_table(struct vio_dev *);
+static const struct vio_device_id *vio_match_device(
+		const struct vio_device_id *, const struct vio_dev *);
 
 #ifdef CONFIG_PPC_PSERIES
 static int vio_num_address_cells;
@@ -136,15 +138,15 @@ EXPORT_SYMBOL(vio_unregister_driver);
  * system is in its list of supported devices. Returns the matching
  * vio_device_id structure or NULL if there is no match.
  */
-const struct vio_device_id * vio_match_device(const struct vio_device_id *ids,
+static const struct vio_device_id * vio_match_device(const struct vio_device_id *ids,
 	const struct vio_dev *dev)
 {
 	DBGENTER();
 
 #ifdef CONFIG_PPC_PSERIES
 	while (ids->type) {
-		if ((strncmp(dev->archdata->type, ids->type, strlen(ids->type)) == 0) &&
-			device_is_compatible((struct device_node*)dev->archdata, ids->compat))
+		if ((strncmp(((struct device_node *)dev->dev.platform_data)->type, ids->type, strlen(ids->type)) == 0) &&
+			device_is_compatible(dev->dev.platform_data, ids->compat))
 			return ids;
 		ids++;
 	}
@@ -263,14 +265,21 @@ static void __devinit vio_dev_release(struct device *dev)
 	DBGENTER();
 
 	/* XXX free TCE table */
-	of_node_put(viodev->archdata);
+	of_node_put(viodev->dev.platform_data);
 	kfree(viodev);
 }
 
+static ssize_t viodev_show_devspec(struct device *dev, char *buf)
+{
+	struct device_node *of_node = dev->platform_data;
+
+	return sprintf(buf, "%s\n", of_node->full_name);
+}
+DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
+
 static ssize_t viodev_show_name(struct device *dev, char *buf)
 {
-	struct vio_dev *viodev = to_vio_dev(dev);
-	struct device_node *of_node = viodev->archdata;
+	struct device_node *of_node = dev->platform_data;
 
 	return sprintf(buf, "%s\n", of_node->name);
 }
@@ -281,7 +290,7 @@ DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);
  * @of_node:	The OF node for this device.
  *
  * Creates and initializes a vio_dev structure from the data in
- * of_node (archdata) and adds it to the list of virtual devices.
+ * of_node (dev.platform_data) and adds it to the list of virtual devices.
  * Returns a pointer to the created vio_dev or NULL if node has
  * NULL device_type or compatible fields.
  */
@@ -315,7 +324,7 @@ struct vio_dev * __devinit vio_register_device(struct device_node *of_node)
 	}
 	memset(viodev, 0, sizeof(struct vio_dev));
 
-	viodev->archdata = (void *)of_node_get(of_node);
+	viodev->dev.platform_data = of_node_get(of_node);
 	viodev->unit_address = *unit_address;
 	viodev->iommu_table = vio_build_iommu_table(viodev);
 
@@ -345,6 +354,7 @@ struct vio_dev * __devinit vio_register_device(struct device_node *of_node)
 		return NULL;
 	}
 	device_create_file(&viodev->dev, &dev_attr_name);
+	device_create_file(&viodev->dev, &dev_attr_devspec);
 
 	return viodev;
 }
@@ -353,6 +363,8 @@ EXPORT_SYMBOL(vio_register_device);
 void __devinit vio_unregister_device(struct vio_dev *viodev)
 {
 	DBGENTER();
+	device_remove_file(&viodev->dev, &dev_attr_devspec);
+	device_remove_file(&viodev->dev, &dev_attr_name);
 	device_unregister(&viodev->dev);
 }
 EXPORT_SYMBOL(vio_unregister_device);
@@ -368,7 +380,7 @@ EXPORT_SYMBOL(vio_unregister_device);
 */
 const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length)
 {
-	return get_property((struct device_node *)vdev->archdata, (char*)which, length);
+	return get_property(vdev->dev.platform_data, (char*)which, length);
 }
 EXPORT_SYMBOL(vio_get_attribute);
 
@@ -415,7 +427,7 @@ EXPORT_SYMBOL(vio_find_node);
  * Returns a pointer to the built tce tree, or NULL if it can't
  * find property.
 */
-struct iommu_table * vio_build_iommu_table(struct vio_dev *dev)
+static struct iommu_table * vio_build_iommu_table(struct vio_dev *dev)
 {
 	unsigned int *dma_window;
 	struct iommu_table *newTceTable;
@@ -423,7 +435,7 @@ struct iommu_table * vio_build_iommu_table(struct vio_dev *dev)
 	unsigned long size;
 	int dma_window_property_size;
 
-	dma_window = (unsigned int *) get_property((struct device_node *)dev->archdata, "ibm,my-dma-window", &dma_window_property_size);
+	dma_window = (unsigned int *) get_property(dev->dev.platform_data, "ibm,my-dma-window", &dma_window_property_size);
 	if(!dma_window) {
 		return NULL;
 	}
diff --git a/arch/ppc64/kernel/viopath.c b/arch/ppc64/kernel/viopath.c
index 50df8160f..3fbdd00d3 100644
--- a/arch/ppc64/kernel/viopath.c
+++ b/arch/ppc64/kernel/viopath.c
@@ -190,6 +190,7 @@ static unsigned char e2a(unsigned char x)
 static int proc_viopath_show(struct seq_file *m, void *v)
 {
 	char *buf;
+	u16 vlanMap;
 	dma_addr_t handle;
 	HvLpEvent_Rc hvrc;
 	DECLARE_MUTEX_LOCKED(Semaphore);
@@ -216,12 +217,11 @@ static int proc_viopath_show(struct seq_file *m, void *v)
 
 	down(&Semaphore);
 
-	dma_unmap_single(iSeries_vio_dev, handle, PAGE_SIZE, DMA_FROM_DEVICE);
-	kfree(buf);
+	vlanMap = HvLpConfig_getVirtualLanIndexMap();
 
-	buf[PAGE_SIZE] = '\0';
+	buf[PAGE_SIZE-1] = '\0';
 	seq_printf(m, "%s", buf);
-
+	seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
 	seq_printf(m, "SRLNBR=%c%c%c%c%c%c%c\n",
 		   e2a(xItExtVpdPanel.mfgID[2]),
 		   e2a(xItExtVpdPanel.mfgID[3]),
@@ -231,6 +231,9 @@ static int proc_viopath_show(struct seq_file *m, void *v)
 		   e2a(xItExtVpdPanel.systemSerial[4]),
 		   e2a(xItExtVpdPanel.systemSerial[5]));
 
+	dma_unmap_single(iSeries_vio_dev, handle, PAGE_SIZE, DMA_FROM_DEVICE);
+	kfree(buf);
+
 	return 0;
 }
 
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c
index a94504036..1d9cf20a2 100644
--- a/arch/ppc64/kernel/xics.c
+++ b/arch/ppc64/kernel/xics.c
@@ -56,7 +56,7 @@ struct hw_interrupt_type xics_8259_pic = {
 };
 
 /* This is used to map real irq numbers to virtual */
-static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_KERNEL);
+static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC);
 
 #define XICS_IPI		2
 #define XICS_IRQ_SPURIOUS	0
@@ -620,7 +620,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
 	cpumask_t tmp = CPU_MASK_NONE;
 
 	irq = virt_irq_to_real(irq_offset_down(virq));
-	if (irq == XICS_IPI)
+	if (irq == XICS_IPI || irq == NO_IRQ)
 		return;
 
 	status = rtas_call(ibm_get_xive, 1, 3, (void *)&xics_status, irq);
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile
index dba8dca26..713ae47da 100644
--- a/arch/ppc64/lib/Makefile
+++ b/arch/ppc64/lib/Makefile
@@ -4,3 +4,8 @@
 
 lib-y := checksum.o dec_and_lock.o string.o strcase.o
 lib-y += copypage.o memcpy.o copyuser.o
+
+# Lock primitives are defined as no-ops in include/linux/spinlock.h
+# for non-SMP configs. Don't build the real versions.
+
+lib-$(CONFIG_SMP) += locks.o
diff --git a/arch/ppc64/mm/fault.c b/arch/ppc64/mm/fault.c
index 5079f87c5..ca2b86d56 100644
--- a/arch/ppc64/mm/fault.c
+++ b/arch/ppc64/mm/fault.c
@@ -45,7 +45,7 @@ static int store_updates_sp(struct pt_regs *regs)
 {
 	unsigned int inst;
 
-	if (get_user(inst, (unsigned int *)regs->nip))
+	if (get_user(inst, (unsigned int __user *)regs->nip))
 		return 0;
 	/* check for 1 in the rA field */
 	if (((inst >> 16) & 0x1f) != 1)
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
index 3ac622c60..d660b0d28 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/ppc64/mm/hugetlbpage.c
@@ -24,7 +24,6 @@
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/tlb.h>
-#include <asm/rmap.h>
 
 #include <linux/sysctl.h>
 
@@ -214,7 +213,7 @@ static int prepare_low_seg_for_htlb(struct mm_struct *mm, unsigned long seg)
 		}
 		page = pmd_page(*pmd);
 		pmd_clear(pmd);
-		pgtable_remove_rmap(page);
+		dec_page_state(nr_page_table_pages);
 		pte_free_tlb(tlb, page);
 	}
 	tlb_finish_mmu(tlb, start, end);
@@ -452,8 +451,9 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 				goto out;
 			}
 			ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
-			unlock_page(page);
-			if (ret) {
+			if (! ret) {
+				unlock_page(page);
+			} else {
 				hugetlb_put_quota(mapping);
 				free_huge_page(page);
 				goto out;
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index c2b36b7cb..84ceb2db2 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -407,7 +407,7 @@ int iounmap_explicit(void *addr, unsigned long size)
 	area = im_get_area((unsigned long) addr, size, 
 			    IM_REGION_EXISTS | IM_REGION_SUBSET);
 	if (area == NULL) {
-		printk(KERN_ERR "%s() cannot unmap nonexistant range 0x%lx\n",
+		printk(KERN_ERR "%s() cannot unmap nonexistent range 0x%lx\n",
 				__FUNCTION__, (unsigned long) addr);
 		return 1;
 	}
diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c
index 5746622c0..c1c4d6cd0 100644
--- a/arch/ppc64/mm/numa.c
+++ b/arch/ppc64/mm/numa.c
@@ -19,7 +19,7 @@
 #include <asm/abs_addr.h>
 
 #if 1
-#define dbg(args...) udbg_printf(args)
+#define dbg(args...) printk(KERN_INFO args)
 #else
 #define dbg(args...)
 #endif
@@ -56,16 +56,136 @@ static inline void map_cpu_to_node(int cpu, int node)
 	}
 }
 
+static struct device_node * __init find_cpu_node(unsigned int cpu)
+{
+	unsigned int hw_cpuid = get_hard_smp_processor_id(cpu);
+	struct device_node *cpu_node = NULL;
+	unsigned int *interrupt_server, *reg;
+	int len;
+
+	while ((cpu_node = of_find_node_by_type(cpu_node, "cpu")) != NULL) {
+		/* Try interrupt server first */
+		interrupt_server = (unsigned int *)get_property(cpu_node,
+					"ibm,ppc-interrupt-server#s", &len);
+
+		if (interrupt_server && (len > 0)) {
+			while (len--) {
+				if (interrupt_server[len-1] == hw_cpuid)
+					return cpu_node;
+			}
+		} else {
+			reg = (unsigned int *)get_property(cpu_node,
+							   "reg", &len);
+			if (reg && (len > 0) && (reg[0] == hw_cpuid))
+				return cpu_node;
+		}
+	}
+
+	return NULL;
+}
+
+/* must hold reference to node during call */
+static int *of_get_associativity(struct device_node *dev)
+ {
+	unsigned int *result;
+	int len;
+
+	result = (unsigned int *)get_property(dev, "ibm,associativity", &len);
+
+	if (len <= 0)
+		return NULL;
+
+	return result;
+}
+
+static int of_node_numa_domain(struct device_node *device, int depth)
+{
+	int numa_domain;
+	unsigned int *tmp;
+
+	tmp = of_get_associativity(device);
+	if (tmp && (tmp[0] >= depth)) {
+		numa_domain = tmp[depth];
+	} else {
+		printk(KERN_ERR "WARNING: no NUMA information for "
+		       "%s\n", device->full_name);
+		numa_domain = 0;
+	}
+	return numa_domain;
+}
+
+/*
+ * In theory, the "ibm,associativity" property may contain multiple
+ * associativity lists because a resource may be multiply connected
+ * into the machine.  This resource then has different associativity
+ * characteristics relative to its multiple connections.  We ignore
+ * this for now.  We also assume that all cpu and memory sets have
+ * their distances represented at a common level.  This won't be
+ * true for heirarchical NUMA.
+ *
+ * In any case the ibm,associativity-reference-points should give
+ * the correct depth for a normal NUMA system.
+ *
+ * - Dave Hansen <haveblue@us.ibm.com>
+ */
+static int find_min_common_depth(void)
+{
+	int depth;
+	unsigned int *ref_points;
+	struct device_node *rtas_root;
+	unsigned int len;
+
+	rtas_root = of_find_node_by_path("/rtas");
+
+	if (!rtas_root) {
+		printk(KERN_ERR "WARNING: %s() could not find rtas root\n",
+				__FUNCTION__);
+		return -1;
+	}
+
+	/*
+	 * this property is 2 32-bit integers, each representing a level of
+	 * depth in the associativity nodes.  The first is for an SMP
+	 * configuration (should be all 0's) and the second is for a normal
+	 * NUMA configuration.
+	 */
+	ref_points = (unsigned int *)get_property(rtas_root,
+			"ibm,associativity-reference-points", &len);
+
+	if ((len >= 1) && ref_points) {
+		depth = ref_points[1];
+	} else {
+		printk(KERN_ERR "WARNING: could not find NUMA "
+				"associativity reference point\n");
+		depth = -1;
+	}
+	of_node_put(rtas_root);
+
+	return depth;
+}
+
+static unsigned long read_cell_ul(struct device_node *device, unsigned int **buf)
+{
+	int i;
+	unsigned long result = 0;
+
+	i = prom_n_size_cells(device);
+	/* bug on i>2 ?? */
+	while (i--) {
+		result = (result << 32) | **buf;
+		(*buf)++;
+	}
+	return result;
+}
+
 static int __init parse_numa_properties(void)
 {
 	struct device_node *cpu = NULL;
 	struct device_node *memory = NULL;
-	int *cpu_associativity;
-	int *memory_associativity;
 	int depth;
 	int max_domain = 0;
 	long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT;
-	long i;
+	unsigned long i;
 
 	if (strstr(saved_command_line, "numa=off")) {
 		printk(KERN_WARNING "NUMA disabled by user\n");
@@ -78,112 +198,78 @@ static int __init parse_numa_properties(void)
 	for (i = 0; i < entries ; i++)
 		numa_memory_lookup_table[i] = ARRAY_INITIALISER;
 
-	cpu = of_find_node_by_type(NULL, "cpu");
-	if (!cpu)
-		goto err;
-
-	memory = of_find_node_by_type(NULL, "memory");
-	if (!memory)
-		goto err;
-
-	cpu_associativity = (int *)get_property(cpu, "ibm,associativity", NULL);
-	if (!cpu_associativity)
-		goto err;
+	depth = find_min_common_depth();
 
-	memory_associativity = (int *)get_property(memory, "ibm,associativity",
-						   NULL);
-	if (!memory_associativity)
-		goto err;
+	printk(KERN_INFO "NUMA associativity depth for CPU/Memory: %d\n", depth);
+	if (depth < 0)
+		return depth;
 
-	/* find common depth */
-	if (cpu_associativity[0] < memory_associativity[0])
-		depth = cpu_associativity[0];
-	else
-		depth = memory_associativity[0];
-
-	for (; cpu; cpu = of_find_node_by_type(cpu, "cpu")) {
-		int *tmp;
-		int cpu_nr, numa_domain;
-
-		tmp = (int *)get_property(cpu, "reg", NULL);
-		if (!tmp)
-			continue;
-		cpu_nr = *tmp;
-
-		tmp = (int *)get_property(cpu, "ibm,associativity",
-					  NULL);
-		if (!tmp)
-			continue;
-		numa_domain = tmp[depth];
+	for_each_cpu(i) {
+		int numa_domain;
 
-		/* FIXME */
-		if (numa_domain == 0xffff) {
-			dbg("cpu %d has no numa doman\n", cpu_nr);
+		cpu = find_cpu_node(i);
+
+		if (cpu) {
+			numa_domain = of_node_numa_domain(cpu, depth);
+			of_node_put(cpu);
+
+			if (numa_domain >= MAX_NUMNODES) {
+				/*
+			 	 * POWER4 LPAR uses 0xffff as invalid node,
+				 * dont warn in this case.
+			 	 */
+				if (numa_domain != 0xffff)
+					printk(KERN_ERR "WARNING: cpu %ld "
+					       "maps to invalid NUMA node %d\n",
+					       i, numa_domain);
+				numa_domain = 0;
+			}
+		} else {
+			printk(KERN_ERR "WARNING: no NUMA information for "
+			       "cpu %ld\n", i);
 			numa_domain = 0;
 		}
 
-		if (numa_domain >= MAX_NUMNODES)
-			BUG();
-
 		node_set_online(numa_domain);
 
 		if (max_domain < numa_domain)
 			max_domain = numa_domain;
 
-		map_cpu_to_node(cpu_nr, numa_domain);
-		/* register the second thread on an SMT machine */
-		if (cur_cpu_spec->cpu_features & CPU_FTR_SMT)
-			map_cpu_to_node(cpu_nr ^ 0x1, numa_domain);
+		map_cpu_to_node(i, numa_domain);
 	}
 
-	for (; memory; memory = of_find_node_by_type(memory, "memory")) {
-		unsigned int *tmp1, *tmp2;
-		unsigned long i;
-		unsigned long start = 0;
-		unsigned long size = 0;
+	memory = NULL;
+	while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
+		unsigned long start;
+		unsigned long size;
 		int numa_domain;
 		int ranges;
+		unsigned int *memcell_buf;
+		unsigned int len;
 
-		tmp1 = (int *)get_property(memory, "reg", NULL);
-		if (!tmp1)
+		memcell_buf = (unsigned int *)get_property(memory, "reg", &len);
+		if (!memcell_buf || len <= 0)
 			continue;
 
 		ranges = memory->n_addrs;
 new_range:
-
-		i = prom_n_size_cells(memory);
-		while (i--) {
-			start = (start << 32) | *tmp1;
-			tmp1++;
-		}
-
-		i = prom_n_size_cells(memory);
-		while (i--) {
-			size = (size << 32) | *tmp1;
-			tmp1++;
-		}
+		/* these are order-sensitive, and modify the buffer pointer */
+		start = read_cell_ul(memory, &memcell_buf);
+		size = read_cell_ul(memory, &memcell_buf);
 
 		start = _ALIGN_DOWN(start, MEMORY_INCREMENT);
 		size = _ALIGN_UP(size, MEMORY_INCREMENT);
 
-		if ((start + size) > MAX_MEMORY)
-			BUG();
+		numa_domain = of_node_numa_domain(memory, depth);
 
-		tmp2 = (int *)get_property(memory, "ibm,associativity",
-					   NULL);
-		if (!tmp2)
-			continue;
-		numa_domain = tmp2[depth];
-
-		/* FIXME */
-		if (numa_domain == 0xffff) {
-			dbg("memory has no numa doman\n");
+		if (numa_domain >= MAX_NUMNODES) {
+			if (numa_domain != 0xffff)
+				printk(KERN_ERR "WARNING: memory at %lx maps "
+				       "to invalid NUMA node %d\n", start,
+				       numa_domain);
 			numa_domain = 0;
 		}
 
-		if (numa_domain >= MAX_NUMNODES)
-			BUG();
-
 		node_set_online(numa_domain);
 
 		if (max_domain < numa_domain)
@@ -205,11 +291,13 @@ new_range:
 						start, size);
 				continue;
 			}
-			node_data[numa_domain].node_spanned_pages += size / PAGE_SIZE;
+			node_data[numa_domain].node_spanned_pages +=
+				size / PAGE_SIZE;
 		} else {
 			node_data[numa_domain].node_start_pfn =
 				start / PAGE_SIZE;
-			node_data[numa_domain].node_spanned_pages = size / PAGE_SIZE;
+			node_data[numa_domain].node_spanned_pages =
+				size / PAGE_SIZE;
 		}
 
 		for (i = start ; i < (start+size); i += MEMORY_INCREMENT)
@@ -227,10 +315,6 @@ new_range:
 	numnodes = max_domain + 1;
 
 	return 0;
-err:
-	of_node_put(cpu);
-	of_node_put(memory);
-	return -1;
 }
 
 static void __init setup_nonnuma(void)
diff --git a/arch/ppc64/mm/tlb.c b/arch/ppc64/mm/tlb.c
index 99be5d0d7..b616f9a40 100644
--- a/arch/ppc64/mm/tlb.c
+++ b/arch/ppc64/mm/tlb.c
@@ -31,7 +31,6 @@
 #include <asm/tlb.h>
 #include <asm/hardirq.h>
 #include <linux/highmem.h>
-#include <asm/rmap.h>
 
 DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
 
@@ -59,7 +58,8 @@ void hpte_update(pte_t *ptep, unsigned long pte, int wrprot)
 
 	ptepage = virt_to_page(ptep);
 	mm = (struct mm_struct *) ptepage->mapping;
-	addr = ptep_to_address(ptep);
+	addr = ptepage->index +
+		(((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE);
 
 	if (REGION_ID(addr) == USER_REGION_ID)
 		context = mm->context.id;
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index 95e824b27..2d5ce46cb 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -155,12 +155,14 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
 			break;
 
 		case PV_GPUL:
+		case PV_GPULp:
 			model = &op_model_power4;
 			model->num_counters = 8;
 			oprof_ppc64_ops.cpu_type = "ppc64/970";
 			break;
 
 		case PV_POWER5:
+		case PV_POWER5p:
 			model = &op_model_power4;
 			model->num_counters = 6;
 			oprof_ppc64_ops.cpu_type = "ppc64/power5";
diff --git a/arch/ppc64/oprofile/op_model_power4.c b/arch/ppc64/oprofile/op_model_power4.c
index 46f79d380..6b132a8c6 100644
--- a/arch/ppc64/oprofile/op_model_power4.c
+++ b/arch/ppc64/oprofile/op_model_power4.c
@@ -24,6 +24,8 @@
 static unsigned long reset_value[OP_MAX_COUNTER];
 
 static int num_counters;
+static int oprofile_running;
+static int mmcra_has_sihv;
 
 static void power4_reg_setup(struct op_counter_config *ctr,
 			     struct op_system_config *sys,
@@ -33,6 +35,16 @@ static void power4_reg_setup(struct op_counter_config *ctr,
 
 	num_counters = num_ctrs;
 
+	/*
+	 * SIHV / SIPR bits are only implemented on POWER4+ (GQ) and above.
+	 * However we disable it on all POWER4 until we verify it works
+	 * (I was seeing some strange behaviour last time I tried).
+	 *
+	 * It has been verified to work on POWER5 so we enable it there.
+	 */
+	if (!(__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)))
+		mmcra_has_sihv = 1;
+
 	for (i = 0; i < num_counters; ++i)
 		reset_value[i] = 0x80000000UL - ctr[i].count;
 
@@ -99,6 +111,8 @@ static void power4_start(struct op_counter_config *ctr)
 	mmcr0 &= ~MMCR0_FC;
 	mtspr(SPRN_MMCR0, mmcr0);
 
+	oprofile_running = 1;
+
 	dbg("start on cpu %d, mmcr0 %x\n", smp_processor_id(), mmcr0);
 }
 
@@ -111,6 +125,8 @@ static void power4_stop(void)
 	mmcr0 |= MMCR0_FC;
 	mtspr(SPRN_MMCR0, mmcr0);
 
+	oprofile_running = 0;
+
 	dbg("stop on cpu %d, mmcr0 %x\n", smp_processor_id(), mmcr0);
 
 	mb();
@@ -129,9 +145,6 @@ static void __attribute_used__ kernel_unknown_bucket(void)
 {
 }
 
-/* XXX Not currently working */
-static int mmcra_has_sihv = 0;
-
 /*
  * On GQ and newer the MMCRA stores the HV and PR bits at the time
  * the SIAR was sampled. We use that to work out if the SIAR was sampled in
@@ -210,7 +223,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
 	for (i = 0; i < num_counters; ++i) {
 		val = ctr_read(i);
 		if (val < 0) {
-			if (ctr[i].enabled) {
+			if (oprofile_running && ctr[i].enabled) {
 				oprofile_add_sample(pc, is_kernel, i, cpu);
 				ctr_write(i, reset_value[i]);
 			} else {
diff --git a/arch/ppc64/xmon/ppc-dis.c b/arch/ppc64/xmon/ppc-dis.c
index b614eb08d..ac0a9d242 100644
--- a/arch/ppc64/xmon/ppc-dis.c
+++ b/arch/ppc64/xmon/ppc-dis.c
@@ -22,37 +22,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *
 #include "ansidecl.h"
 #include "ppc.h"
 
-static int print_insn_powerpc PARAMS ((FILE *, unsigned long insn,
-				       unsigned long memaddr, int dialect));
-
-extern void print_address PARAMS((unsigned long memaddr));
-
-/* Print a big endian PowerPC instruction.  For convenience, also
-   disassemble instructions supported by the Motorola PowerPC 601.  */
-
-int
-print_insn_big_powerpc (FILE *out, unsigned long insn, unsigned long memaddr)
-{
-  return print_insn_powerpc (out, insn, memaddr,
-			     PPC_OPCODE_PPC | PPC_OPCODE_601);
-}
+extern void print_address (unsigned long memaddr);
 
 /* Print a PowerPC or POWER instruction.  */
 
-static int
-print_insn_powerpc (FILE *out, unsigned long insn, unsigned long memaddr,
-		    int dialect)
+int
+print_insn_powerpc (unsigned long insn, unsigned long memaddr, int dialect)
 {
   const struct powerpc_opcode *opcode;
   const struct powerpc_opcode *opcode_end;
   unsigned long op;
 
+  if (dialect == 0)
+    dialect = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_COMMON
+	      | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC;
+
   /* Get the major opcode of the instruction.  */
   op = PPC_OP (insn);
 
   /* Find the first match in the opcode table.  We could speed this up
      a bit by doing a binary search on the major opcode.  */
   opcode_end = powerpc_opcodes + powerpc_num_opcodes;
+ again:
   for (opcode = powerpc_opcodes; opcode < opcode_end; opcode++)
     {
       unsigned long table_op;
@@ -64,109 +55,106 @@ print_insn_powerpc (FILE *out, unsigned long insn, unsigned long memaddr,
 
       table_op = PPC_OP (opcode->opcode);
       if (op < table_op)
-		break;
+	break;
       if (op > table_op)
-		continue;
+	continue;
 
       if ((insn & opcode->mask) != opcode->opcode
 	  || (opcode->flags & dialect) == 0)
-		continue;
+	continue;
 
       /* Make two passes over the operands.  First see if any of them
-		 have extraction functions, and, if they do, make sure the
-		 instruction is valid.  */
+	 have extraction functions, and, if they do, make sure the
+	 instruction is valid.  */
       invalid = 0;
       for (opindex = opcode->operands; *opindex != 0; opindex++)
-		{
-		  operand = powerpc_operands + *opindex;
-		  if (operand->extract)
-		    (*operand->extract) (insn, &invalid);
-		}
+	{
+	  operand = powerpc_operands + *opindex;
+	  if (operand->extract)
+	    (*operand->extract) (insn, dialect, &invalid);
+	}
       if (invalid)
-		continue;
+	continue;
 
       /* The instruction is valid.  */
-      fprintf(out, "%s", opcode->name);
+      printf("%s", opcode->name);
       if (opcode->operands[0] != 0)
-		fprintf(out, "\t");
+	printf("\t");
 
       /* Now extract and print the operands.  */
       need_comma = 0;
       need_paren = 0;
       for (opindex = opcode->operands; *opindex != 0; opindex++)
+	{
+	  long value;
+
+	  operand = powerpc_operands + *opindex;
+
+	  /* Operands that are marked FAKE are simply ignored.  We
+	     already made sure that the extract function considered
+	     the instruction to be valid.  */
+	  if ((operand->flags & PPC_OPERAND_FAKE) != 0)
+	    continue;
+
+	  /* Extract the value from the instruction.  */
+	  if (operand->extract)
+	    value = (*operand->extract) (insn, dialect, &invalid);
+	  else
+	    {
+	      value = (insn >> operand->shift) & ((1 << operand->bits) - 1);
+	      if ((operand->flags & PPC_OPERAND_SIGNED) != 0
+		  && (value & (1 << (operand->bits - 1))) != 0)
+		value -= 1 << operand->bits;
+	    }
+
+	  /* If the operand is optional, and the value is zero, don't
+	     print anything.  */
+	  if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0
+	      && (operand->flags & PPC_OPERAND_NEXT) == 0
+	      && value == 0)
+	    continue;
+
+	  if (need_comma)
+	    {
+	      printf(",");
+	      need_comma = 0;
+	    }
+
+	  /* Print the operand as directed by the flags.  */
+	  if ((operand->flags & PPC_OPERAND_GPR) != 0)
+	    printf("r%ld", value);
+	  else if ((operand->flags & PPC_OPERAND_FPR) != 0)
+	    printf("f%ld", value);
+	  else if ((operand->flags & PPC_OPERAND_VR) != 0)
+	    printf("v%ld", value);
+	  else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0)
+	    print_address (memaddr + value);
+	  else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0)
+	    print_address (value & 0xffffffff);
+	  else if ((operand->flags & PPC_OPERAND_CR) == 0
+		   || (dialect & PPC_OPCODE_PPC) == 0)
+	    printf("%ld", value);
+	  else
+	    {
+	      if (operand->bits == 3)
+		printf("cr%d", value);
+	      else
 		{
-		  long value;
-
-		  operand = powerpc_operands + *opindex;
-
-		  /* Operands that are marked FAKE are simply ignored.  We
-		     already made sure that the extract function considered
-		     the instruction to be valid.  */
-		  if ((operand->flags & PPC_OPERAND_FAKE) != 0)
-		    continue;
-
-		  /* Extract the value from the instruction.  */
-		  if (operand->extract)
-		    value = (*operand->extract) (insn, (int *) 0);
-		  else
-		    {
-		      value = (insn >> operand->shift) & ((1 << operand->bits) - 1);
-		      if ((operand->flags & PPC_OPERAND_SIGNED) != 0
-			  && (value & (1 << (operand->bits - 1))) != 0)
-			value -= 1 << operand->bits;
-		    }
-
-		  /* If the operand is optional, and the value is zero, don't
-		     print anything.  */
-		  if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0
-		      && (operand->flags & PPC_OPERAND_NEXT) == 0
-		      && value == 0)
-		    continue;
-
-		  if (need_comma)
-		    {
-		      fprintf(out, ",");
-		      need_comma = 0;
-		    }
-
-		  /* Print the operand as directed by the flags.  */
-		  if ((operand->flags & PPC_OPERAND_GPR) != 0)
-		    fprintf(out, "r%ld", value);
-		  else if ((operand->flags & PPC_OPERAND_FPR) != 0)
-		    fprintf(out, "f%ld", value);
-		  else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0)
-		    print_address (memaddr + value);
-		  else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0)
-		    print_address (value & 0xffffffff);
-		  else if ((operand->flags & PPC_OPERAND_CR) == 0
-			   || (dialect & PPC_OPCODE_PPC) == 0)
-		    fprintf(out, "%ld", value);
-		  else
-		    {
-		      if (operand->bits == 3)
-				fprintf(out, "cr%d", value);
-		      else
-			{
-			  static const char *cbnames[4] = { "lt", "gt", "eq", "so" };
-			  int cr;
-			  int cc;
-
-			  cr = value >> 2;
-			  if (cr != 0)
-			    fprintf(out, "4*cr%d", cr);
-			  cc = value & 3;
-			  if (cc != 0)
-			    {
-			      if (cr != 0)
-					fprintf(out, "+");
-			      fprintf(out, "%s", cbnames[cc]);
-			    }
-			}
+		  static const char *cbnames[4] = { "lt", "gt", "eq", "so" };
+		  int cr;
+		  int cc;
+
+		  cr = value >> 2;
+		  if (cr != 0)
+		    printf("4*cr%d+", cr);
+		  cc = value & 3;
+		  printf("%s", cbnames[cc]);
+		}
 	    }
 
 	  if (need_paren)
 	    {
-	      fprintf(out, ")");
+	      printf(")");
 	      need_paren = 0;
 	    }
 
@@ -174,7 +162,7 @@ print_insn_powerpc (FILE *out, unsigned long insn, unsigned long memaddr,
 	    need_comma = 1;
 	  else
 	    {
-	      fprintf(out, "(");
+	      printf("(");
 	      need_paren = 1;
 	    }
 	}
@@ -183,8 +171,14 @@ print_insn_powerpc (FILE *out, unsigned long insn, unsigned long memaddr,
       return 4;
     }
 
+  if ((dialect & PPC_OPCODE_ANY) != 0)
+    {
+      dialect = ~PPC_OPCODE_ANY;
+      goto again;
+    }
+
   /* We could not find a match.  */
-  fprintf(out, ".long 0x%lx", insn);
+  printf(".long 0x%lx", insn);
 
   return 4;
 }
diff --git a/arch/ppc64/xmon/ppc-opc.c b/arch/ppc64/xmon/ppc-opc.c
index a5d3c6d43..1e4e7e319 100644
--- a/arch/ppc64/xmon/ppc-opc.c
+++ b/arch/ppc64/xmon/ppc-opc.c
@@ -1,27 +1,31 @@
 /* ppc-opc.c -- PowerPC opcode list
-   Copyright 1994 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support
 
-This file is part of GDB, GAS, and the GNU binutils.
+   This file is part of GDB, GAS, and the GNU binutils.
 
-GDB, GAS, and the GNU binutils are free software; you can redistribute
-them and/or modify them under the terms of the GNU General Public
-License as published by the Free Software Foundation; either version
-2, or (at your option) any later version.
+   GDB, GAS, and the GNU binutils are free software; you can redistribute
+   them and/or modify them under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either version
+   2, or (at your option) any later version.
 
-GDB, GAS, and the GNU binutils are distributed in the hope that they
-will be useful, but WITHOUT ANY WARRANTY; without even the implied
-warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-the GNU General Public License for more details.
+   GDB, GAS, and the GNU binutils are distributed in the hope that they
+   will be useful, but WITHOUT ANY WARRANTY; without even the implied
+   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+   the GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this file; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this file; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
 
-#include <linux/posix_types.h>
-#include "ansidecl.h"
+#include "nonstdio.h"
 #include "ppc.h"
 
+#define ATTRIBUTE_UNUSED
+#define _(x)	x
+
 /* This file holds the PowerPC opcode table.  The opcode table
    includes almost all of the extended instruction mnemonics.  This
    permits the disassembler to use them, and simplifies the assembler
@@ -35,223 +39,292 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *
 
 /* Local insertion and extraction functions.  */
 
-static unsigned long insert_bat PARAMS ((unsigned long, long, const char **));
-static long extract_bat PARAMS ((unsigned long, int *));
-static unsigned long insert_bba PARAMS ((unsigned long, long, const char **));
-static long extract_bba PARAMS ((unsigned long, int *));
-static unsigned long insert_bd PARAMS ((unsigned long, long, const char **));
-static long extract_bd PARAMS ((unsigned long, int *));
-static unsigned long insert_bdm PARAMS ((unsigned long, long, const char **));
-static long extract_bdm PARAMS ((unsigned long, int *));
-static unsigned long insert_bdp PARAMS ((unsigned long, long, const char **));
-static long extract_bdp PARAMS ((unsigned long, int *));
-static unsigned long insert_bo PARAMS ((unsigned long, long, const char **));
-static long extract_bo PARAMS ((unsigned long, int *));
-static unsigned long insert_boe PARAMS ((unsigned long, long, const char **));
-static long extract_boe PARAMS ((unsigned long, int *));
-static unsigned long insert_ds PARAMS ((unsigned long, long, const char **));
-static long extract_ds PARAMS ((unsigned long, int *));
-static unsigned long insert_li PARAMS ((unsigned long, long, const char **));
-static long extract_li PARAMS ((unsigned long, int *));
-static unsigned long insert_mbe PARAMS ((unsigned long, long, const char **));
-static long extract_mbe PARAMS ((unsigned long, int *));
-static unsigned long insert_mb6 PARAMS ((unsigned long, long, const char **));
-static long extract_mb6 PARAMS ((unsigned long, int *));
-static unsigned long insert_nb PARAMS ((unsigned long, long, const char **));
-static long extract_nb PARAMS ((unsigned long, int *));
-static unsigned long insert_nsi PARAMS ((unsigned long, long, const char **));
-static long extract_nsi PARAMS ((unsigned long, int *));
-static unsigned long insert_ral PARAMS ((unsigned long, long, const char **));
-static unsigned long insert_ram PARAMS ((unsigned long, long, const char **));
-static unsigned long insert_ras PARAMS ((unsigned long, long, const char **));
-static unsigned long insert_rbs PARAMS ((unsigned long, long, const char **));
-static long extract_rbs PARAMS ((unsigned long, int *));
-static unsigned long insert_sh6 PARAMS ((unsigned long, long, const char **));
-static long extract_sh6 PARAMS ((unsigned long, int *));
-static unsigned long insert_spr PARAMS ((unsigned long, long, const char **));
-static long extract_spr PARAMS ((unsigned long, int *));
-static unsigned long insert_tbr PARAMS ((unsigned long, long, const char **));
-static long extract_tbr PARAMS ((unsigned long, int *));
+static unsigned long insert_bat (unsigned long, long, int, const char **);
+static long extract_bat (unsigned long, int, int *);
+static unsigned long insert_bba (unsigned long, long, int, const char **);
+static long extract_bba (unsigned long, int, int *);
+static unsigned long insert_bd (unsigned long, long, int, const char **);
+static long extract_bd (unsigned long, int, int *);
+static unsigned long insert_bdm (unsigned long, long, int, const char **);
+static long extract_bdm (unsigned long, int, int *);
+static unsigned long insert_bdp (unsigned long, long, int, const char **);
+static long extract_bdp (unsigned long, int, int *);
+static unsigned long insert_bo (unsigned long, long, int, const char **);
+static long extract_bo (unsigned long, int, int *);
+static unsigned long insert_boe (unsigned long, long, int, const char **);
+static long extract_boe (unsigned long, int, int *);
+static unsigned long insert_dq (unsigned long, long, int, const char **);
+static long extract_dq (unsigned long, int, int *);
+static unsigned long insert_ds (unsigned long, long, int, const char **);
+static long extract_ds (unsigned long, int, int *);
+static unsigned long insert_de (unsigned long, long, int, const char **);
+static long extract_de (unsigned long, int, int *);
+static unsigned long insert_des (unsigned long, long, int, const char **);
+static long extract_des (unsigned long, int, int *);
+static unsigned long insert_fxm (unsigned long, long, int, const char **);
+static long extract_fxm (unsigned long, int, int *);
+static unsigned long insert_li (unsigned long, long, int, const char **);
+static long extract_li (unsigned long, int, int *);
+static unsigned long insert_mbe (unsigned long, long, int, const char **);
+static long extract_mbe (unsigned long, int, int *);
+static unsigned long insert_mb6 (unsigned long, long, int, const char **);
+static long extract_mb6 (unsigned long, int, int *);
+static unsigned long insert_nb (unsigned long, long, int, const char **);
+static long extract_nb (unsigned long, int, int *);
+static unsigned long insert_nsi (unsigned long, long, int, const char **);
+static long extract_nsi (unsigned long, int, int *);
+static unsigned long insert_ral (unsigned long, long, int, const char **);
+static unsigned long insert_ram (unsigned long, long, int, const char **);
+static unsigned long insert_raq (unsigned long, long, int, const char **);
+static unsigned long insert_ras (unsigned long, long, int, const char **);
+static unsigned long insert_rbs (unsigned long, long, int, const char **);
+static long extract_rbs (unsigned long, int, int *);
+static unsigned long insert_rsq (unsigned long, long, int, const char **);
+static unsigned long insert_rtq (unsigned long, long, int, const char **);
+static unsigned long insert_sh6 (unsigned long, long, int, const char **);
+static long extract_sh6 (unsigned long, int, int *);
+static unsigned long insert_spr (unsigned long, long, int, const char **);
+static long extract_spr (unsigned long, int, int *);
+static unsigned long insert_tbr (unsigned long, long, int, const char **);
+static long extract_tbr (unsigned long, int, int *);
+static unsigned long insert_ev2 (unsigned long, long, int, const char **);
+static long extract_ev2 (unsigned long, int, int *);
+static unsigned long insert_ev4 (unsigned long, long, int, const char **);
+static long extract_ev4 (unsigned long, int, int *);
+static unsigned long insert_ev8 (unsigned long, long, int, const char **);
+static long extract_ev8 (unsigned long, int, int *);
 
 /* The operands table.
 
-   The fields are bits, shift, signed, insert, extract, flags.  */
+   The fields are bits, shift, insert, extract, flags.
+
+   We used to put parens around the various additions, like the one
+   for BA just below.  However, that caused trouble with feeble
+   compilers with a limit on depth of a parenthesized expression, like
+   (reportedly) the compiler in Microsoft Developer Studio 5.  So we
+   omit the parens, since the macros are never used in a context where
+   the addition will be ambiguous.  */
 
 const struct powerpc_operand powerpc_operands[] =
 {
   /* The zero index is used to indicate the end of the list of
      operands.  */
-#define UNUSED (0)
+#define UNUSED 0
   { 0, 0, 0, 0, 0 },
 
   /* The BA field in an XL form instruction.  */
-#define BA (1)
+#define BA UNUSED + 1
 #define BA_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_CR },
 
   /* The BA field in an XL form instruction when it must be the same
      as the BT field in the same instruction.  */
-#define BAT (2)
+#define BAT BA + 1
   { 5, 16, insert_bat, extract_bat, PPC_OPERAND_FAKE },
 
   /* The BB field in an XL form instruction.  */
-#define BB (3)
+#define BB BAT + 1
 #define BB_MASK (0x1f << 11)
   { 5, 11, 0, 0, PPC_OPERAND_CR },
 
   /* The BB field in an XL form instruction when it must be the same
      as the BA field in the same instruction.  */
-#define BBA (4)
+#define BBA BB + 1
   { 5, 11, insert_bba, extract_bba, PPC_OPERAND_FAKE },
 
   /* The BD field in a B form instruction.  The lower two bits are
      forced to zero.  */
-#define BD (5)
+#define BD BBA + 1
   { 16, 0, insert_bd, extract_bd, PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when absolute addressing is
      used.  */
-#define BDA (6)
+#define BDA BD + 1
   { 16, 0, insert_bd, extract_bd, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the - modifier is used.
      This sets the y bit of the BO field appropriately.  */
-#define BDM (7)
+#define BDM BDA + 1
   { 16, 0, insert_bdm, extract_bdm,
       PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the - modifier is used
      and absolute address is used.  */
-#define BDMA (8)
+#define BDMA BDM + 1
   { 16, 0, insert_bdm, extract_bdm,
       PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the + modifier is used.
      This sets the y bit of the BO field appropriately.  */
-#define BDP (9)
+#define BDP BDMA + 1
   { 16, 0, insert_bdp, extract_bdp,
       PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the + modifier is used
      and absolute addressing is used.  */
-#define BDPA (10)
+#define BDPA BDP + 1
   { 16, 0, insert_bdp, extract_bdp,
       PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The BF field in an X or XL form instruction.  */
-#define BF (11)
+#define BF BDPA + 1
   { 3, 23, 0, 0, PPC_OPERAND_CR },
 
   /* An optional BF field.  This is used for comparison instructions,
      in which an omitted BF field is taken as zero.  */
-#define OBF (12)
+#define OBF BF + 1
   { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The BFA field in an X or XL form instruction.  */
-#define BFA (13)
+#define BFA OBF + 1
   { 3, 18, 0, 0, PPC_OPERAND_CR },
 
   /* The BI field in a B form or XL form instruction.  */
-#define BI (14)
+#define BI BFA + 1
 #define BI_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_CR },
 
   /* The BO field in a B form instruction.  Certain values are
      illegal.  */
-#define BO (15)
+#define BO BI + 1
 #define BO_MASK (0x1f << 21)
   { 5, 21, insert_bo, extract_bo, 0 },
 
   /* The BO field in a B form instruction when the + or - modifier is
      used.  This is like the BO field, but it must be even.  */
-#define BOE (16)
+#define BOE BO + 1
   { 5, 21, insert_boe, extract_boe, 0 },
 
   /* The BT field in an X or XL form instruction.  */
-#define BT (17)
+#define BT BOE + 1
   { 5, 21, 0, 0, PPC_OPERAND_CR },
 
   /* The condition register number portion of the BI field in a B form
      or XL form instruction.  This is used for the extended
      conditional branch mnemonics, which set the lower two bits of the
      BI field.  This field is optional.  */
-#define CR (18)
+#define CR BT + 1
   { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
+  /* The CRB field in an X form instruction.  */
+#define CRB CR + 1
+  { 5, 6, 0, 0, 0 },
+
+  /* The CRFD field in an X form instruction.  */
+#define CRFD CRB + 1
+  { 3, 23, 0, 0, PPC_OPERAND_CR },
+
+  /* The CRFS field in an X form instruction.  */
+#define CRFS CRFD + 1
+  { 3, 0, 0, 0, PPC_OPERAND_CR },
+
+  /* The CT field in an X form instruction.  */
+#define CT CRFS + 1
+  { 5, 21, 0, 0, PPC_OPERAND_OPTIONAL },
+
   /* The D field in a D form instruction.  This is a displacement off
      a register, and implies that the next operand is a register in
      parentheses.  */
-#define D (19)
+#define D CT + 1
   { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
+  /* The DE field in a DE form instruction.  This is like D, but is 12
+     bits only.  */
+#define DE D + 1
+  { 14, 0, insert_de, extract_de, PPC_OPERAND_PARENS },
+
+  /* The DES field in a DES form instruction.  This is like DS, but is 14
+     bits only (12 stored.)  */
+#define DES DE + 1
+  { 14, 0, insert_des, extract_des, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
+
+  /* The DQ field in a DQ form instruction.  This is like D, but the
+     lower four bits are forced to zero. */
+#define DQ DES + 1
+  { 16, 0, insert_dq, extract_dq,
+      PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED | PPC_OPERAND_DQ },
+
   /* The DS field in a DS form instruction.  This is like D, but the
      lower two bits are forced to zero.  */
-#define DS (20)
-  { 16, 0, insert_ds, extract_ds, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
+#define DS DQ + 1
+  { 16, 0, insert_ds, extract_ds,
+      PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED | PPC_OPERAND_DS },
+
+  /* The E field in a wrteei instruction.  */
+#define E DS + 1
+  { 1, 15, 0, 0, 0 },
 
   /* The FL1 field in a POWER SC form instruction.  */
-#define FL1 (21)
+#define FL1 E + 1
   { 4, 12, 0, 0, 0 },
 
   /* The FL2 field in a POWER SC form instruction.  */
-#define FL2 (22)
+#define FL2 FL1 + 1
   { 3, 2, 0, 0, 0 },
 
   /* The FLM field in an XFL form instruction.  */
-#define FLM (23)
+#define FLM FL2 + 1
   { 8, 17, 0, 0, 0 },
 
   /* The FRA field in an X or A form instruction.  */
-#define FRA (24)
+#define FRA FLM + 1
 #define FRA_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRB field in an X or A form instruction.  */
-#define FRB (25)
+#define FRB FRA + 1
 #define FRB_MASK (0x1f << 11)
   { 5, 11, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRC field in an A form instruction.  */
-#define FRC (26)
+#define FRC FRB + 1
 #define FRC_MASK (0x1f << 6)
   { 5, 6, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRS field in an X form instruction or the FRT field in a D, X
      or A form instruction.  */
-#define FRS (27)
-#define FRT (FRS)
+#define FRS FRC + 1
+#define FRT FRS
   { 5, 21, 0, 0, PPC_OPERAND_FPR },
 
   /* The FXM field in an XFX instruction.  */
-#define FXM (28)
+#define FXM FRS + 1
 #define FXM_MASK (0xff << 12)
-  { 8, 12, 0, 0, 0 },
+  { 8, 12, insert_fxm, extract_fxm, 0 },
+
+  /* Power4 version for mfcr.  */
+#define FXM4 FXM + 1
+  { 8, 12, insert_fxm, extract_fxm, PPC_OPERAND_OPTIONAL },
 
   /* The L field in a D or X form instruction.  */
-#define L (29)
+#define L FXM4 + 1
   { 1, 21, 0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The LEV field in a POWER SC form instruction.  */
-#define LEV (30)
+#define LEV L + 1
   { 7, 5, 0, 0, 0 },
 
   /* The LI field in an I form instruction.  The lower two bits are
      forced to zero.  */
-#define LI (31)
+#define LI LEV + 1
   { 26, 0, insert_li, extract_li, PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The LI field in an I form instruction when used as an absolute
      address.  */
-#define LIA (32)
+#define LIA LI + 1
   { 26, 0, insert_li, extract_li, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
+  /* The LS field in an X (sync) form instruction.  */
+#define LS LIA + 1
+  { 2, 21, 0, 0, PPC_OPERAND_OPTIONAL },
+
   /* The MB field in an M form instruction.  */
-#define MB (33)
+#define MB LS + 1
 #define MB_MASK (0x1f << 6)
   { 5, 6, 0, 0, 0 },
 
   /* The ME field in an M form instruction.  */
-#define ME (34)
+#define ME MB + 1
 #define ME_MASK (0x1f << 1)
   { 5, 1, 0, 0, 0 },
 
@@ -259,129 +332,213 @@ const struct powerpc_operand powerpc_operands[] =
      operand which is a bitmask indicating which bits to select.  This
      is a two operand form using PPC_OPERAND_NEXT.  See the
      description in opcode/ppc.h for what this means.  */
-#define MBE (35)
+#define MBE ME + 1
   { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
   { 32, 0, insert_mbe, extract_mbe, 0 },
 
   /* The MB or ME field in an MD or MDS form instruction.  The high
      bit is wrapped to the low end.  */
-#define MB6 (37)
-#define ME6 (MB6)
+#define MB6 MBE + 2
+#define ME6 MB6
 #define MB6_MASK (0x3f << 5)
   { 6, 5, insert_mb6, extract_mb6, 0 },
 
+  /* The MO field in an mbar instruction.  */
+#define MO MB6 + 1
+  { 5, 21, 0, 0, 0 },
+
   /* The NB field in an X form instruction.  The value 32 is stored as
      0.  */
-#define NB (38)
+#define NB MO + 1
   { 6, 11, insert_nb, extract_nb, 0 },
 
   /* The NSI field in a D form instruction.  This is the same as the
      SI field, only negated.  */
-#define NSI (39)
+#define NSI NB + 1
   { 16, 0, insert_nsi, extract_nsi,
       PPC_OPERAND_NEGATIVE | PPC_OPERAND_SIGNED },
 
-  /* The RA field in an D, DS, X, XO, M, or MDS form instruction.  */
-#define RA (40)
+  /* The RA field in an D, DS, DQ, X, XO, M, or MDS form instruction.  */
+#define RA NSI + 1
 #define RA_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_GPR },
 
+  /* The RA field in the DQ form lq instruction, which has special
+     value restrictions.  */
+#define RAQ RA + 1
+  { 5, 16, insert_raq, 0, PPC_OPERAND_GPR },
+
   /* The RA field in a D or X form instruction which is an updating
      load, which means that the RA field may not be zero and may not
      equal the RT field.  */
-#define RAL (41)
+#define RAL RAQ + 1
   { 5, 16, insert_ral, 0, PPC_OPERAND_GPR },
 
   /* The RA field in an lmw instruction, which has special value
      restrictions.  */
-#define RAM (42)
+#define RAM RAL + 1
   { 5, 16, insert_ram, 0, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      store or an updating floating point load, which means that the RA
      field may not be zero.  */
-#define RAS (43)
+#define RAS RAM + 1
   { 5, 16, insert_ras, 0, PPC_OPERAND_GPR },
 
   /* The RB field in an X, XO, M, or MDS form instruction.  */
-#define RB (44)
+#define RB RAS + 1
 #define RB_MASK (0x1f << 11)
   { 5, 11, 0, 0, PPC_OPERAND_GPR },
 
   /* The RB field in an X form instruction when it must be the same as
      the RS field in the instruction.  This is used for extended
      mnemonics like mr.  */
-#define RBS (45)
+#define RBS RB + 1
   { 5, 1, insert_rbs, extract_rbs, PPC_OPERAND_FAKE },
 
   /* The RS field in a D, DS, X, XFX, XS, M, MD or MDS form
      instruction or the RT field in a D, DS, X, XFX or XO form
      instruction.  */
-#define RS (46)
-#define RT (RS)
+#define RS RBS + 1
+#define RT RS
 #define RT_MASK (0x1f << 21)
   { 5, 21, 0, 0, PPC_OPERAND_GPR },
 
+  /* The RS field of the DS form stq instruction, which has special
+     value restrictions.  */
+#define RSQ RS + 1
+  { 5, 21, insert_rsq, 0, PPC_OPERAND_GPR },
+
+  /* The RT field of the DQ form lq instruction, which has special
+     value restrictions.  */
+#define RTQ RSQ + 1
+  { 5, 21, insert_rtq, 0, PPC_OPERAND_GPR },
+
   /* The SH field in an X or M form instruction.  */
-#define SH (47)
+#define SH RTQ + 1
 #define SH_MASK (0x1f << 11)
   { 5, 11, 0, 0, 0 },
 
   /* The SH field in an MD form instruction.  This is split.  */
-#define SH6 (48)
+#define SH6 SH + 1
 #define SH6_MASK ((0x1f << 11) | (1 << 1))
   { 6, 1, insert_sh6, extract_sh6, 0 },
 
   /* The SI field in a D form instruction.  */
-#define SI (49)
+#define SI SH6 + 1
   { 16, 0, 0, 0, PPC_OPERAND_SIGNED },
 
   /* The SI field in a D form instruction when we accept a wide range
      of positive values.  */
-#define SISIGNOPT (50)
+#define SISIGNOPT SI + 1
   { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
 
   /* The SPR field in an XFX form instruction.  This is flipped--the
      lower 5 bits are stored in the upper 5 and vice- versa.  */
-#define SPR (51)
+#define SPR SISIGNOPT + 1
+#define PMR SPR
 #define SPR_MASK (0x3ff << 11)
   { 10, 11, insert_spr, extract_spr, 0 },
 
   /* The BAT index number in an XFX form m[ft]ibat[lu] instruction.  */
-#define SPRBAT (52)
+#define SPRBAT SPR + 1
 #define SPRBAT_MASK (0x3 << 17)
   { 2, 17, 0, 0, 0 },
 
   /* The SPRG register number in an XFX form m[ft]sprg instruction.  */
-#define SPRG (53)
+#define SPRG SPRBAT + 1
 #define SPRG_MASK (0x3 << 16)
   { 2, 16, 0, 0, 0 },
 
   /* The SR field in an X form instruction.  */
-#define SR (54)
+#define SR SPRG + 1
   { 4, 16, 0, 0, 0 },
 
+  /* The STRM field in an X AltiVec form instruction.  */
+#define STRM SR + 1
+#define STRM_MASK (0x3 << 21)
+  { 2, 21, 0, 0, 0 },
+
   /* The SV field in a POWER SC form instruction.  */
-#define SV (55)
+#define SV STRM + 1
   { 14, 2, 0, 0, 0 },
 
   /* The TBR field in an XFX form instruction.  This is like the SPR
      field, but it is optional.  */
-#define TBR (56)
+#define TBR SV + 1
   { 10, 11, insert_tbr, extract_tbr, PPC_OPERAND_OPTIONAL },
 
   /* The TO field in a D or X form instruction.  */
-#define TO (57)
+#define TO TBR + 1
 #define TO_MASK (0x1f << 21)
   { 5, 21, 0, 0, 0 },
 
   /* The U field in an X form instruction.  */
-#define U (58)
+#define U TO + 1
   { 4, 12, 0, 0, 0 },
 
   /* The UI field in a D form instruction.  */
-#define UI (59)
+#define UI U + 1
   { 16, 0, 0, 0, 0 },
+
+  /* The VA field in a VA, VX or VXR form instruction.  */
+#define VA UI + 1
+#define VA_MASK	(0x1f << 16)
+  { 5, 16, 0, 0, PPC_OPERAND_VR },
+
+  /* The VB field in a VA, VX or VXR form instruction.  */
+#define VB VA + 1
+#define VB_MASK (0x1f << 11)
+  { 5, 11, 0, 0, PPC_OPERAND_VR },
+
+  /* The VC field in a VA form instruction.  */
+#define VC VB + 1
+#define VC_MASK (0x1f << 6)
+  { 5, 6, 0, 0, PPC_OPERAND_VR },
+
+  /* The VD or VS field in a VA, VX, VXR or X form instruction.  */
+#define VD VC + 1
+#define VS VD
+#define VD_MASK (0x1f << 21)
+  { 5, 21, 0, 0, PPC_OPERAND_VR },
+
+  /* The SIMM field in a VX form instruction.  */
+#define SIMM VD + 1
+  { 5, 16, 0, 0, PPC_OPERAND_SIGNED},
+
+  /* The UIMM field in a VX form instruction.  */
+#define UIMM SIMM + 1
+  { 5, 16, 0, 0, 0 },
+
+  /* The SHB field in a VA form instruction.  */
+#define SHB UIMM + 1
+  { 4, 6, 0, 0, 0 },
+
+  /* The other UIMM field in a EVX form instruction.  */
+#define EVUIMM SHB + 1
+  { 5, 11, 0, 0, 0 },
+
+  /* The other UIMM field in a half word EVX form instruction.  */
+#define EVUIMM_2 EVUIMM + 1
+  { 32, 11, insert_ev2, extract_ev2, PPC_OPERAND_PARENS },
+
+  /* The other UIMM field in a word EVX form instruction.  */
+#define EVUIMM_4 EVUIMM_2 + 1
+  { 32, 11, insert_ev4, extract_ev4, PPC_OPERAND_PARENS },
+
+  /* The other UIMM field in a double EVX form instruction.  */
+#define EVUIMM_8 EVUIMM_4 + 1
+  { 32, 11, insert_ev8, extract_ev8, PPC_OPERAND_PARENS },
+
+  /* The WS field.  */
+#define WS EVUIMM_8 + 1
+#define WS_MASK (0x7 << 11)
+  { 3, 11, 0, 0, 0 },
+
+  /* The L field in an mtmsrd instruction */
+#define MTMSRD_L WS + 1
+  { 1, 16, 0, 0, PPC_OPERAND_OPTIONAL },
+
 };
 
 /* The functions used to insert and extract complicated operands.  */
@@ -393,17 +550,21 @@ const struct powerpc_operand powerpc_operands[] =
    same.  */
 
 /*ARGSUSED*/
-static unsigned long 
-insert_bat(unsigned long insn, long value, const char **errmsg)
+static unsigned long
+insert_bat (unsigned long insn,
+	    long value ATTRIBUTE_UNUSED,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | (((insn >> 21) & 0x1f) << 16);
 }
 
 static long
-extract_bat(unsigned long insn, int *invalid)
+extract_bat (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid)
 {
-  if (invalid != (int *) NULL
-      && ((insn >> 21) & 0x1f) != ((insn >> 16) & 0x1f))
+  if (((insn >> 21) & 0x1f) != ((insn >> 16) & 0x1f))
     *invalid = 1;
   return 0;
 }
@@ -416,16 +577,20 @@ extract_bat(unsigned long insn, int *invalid)
 
 /*ARGSUSED*/
 static unsigned long
-insert_bba(unsigned long insn, long value, const char **errmsg)
+insert_bba (unsigned long insn,
+	    long value ATTRIBUTE_UNUSED,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | (((insn >> 16) & 0x1f) << 11);
 }
 
 static long
-extract_bba(unsigned long insn, int *invalid)
+extract_bba (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid)
 {
-  if (invalid != (int *) NULL
-      && ((insn >> 16) & 0x1f) != ((insn >> 11) & 0x1f))
+  if (((insn >> 16) & 0x1f) != ((insn >> 11) & 0x1f))
     *invalid = 1;
   return 0;
 }
@@ -435,48 +600,76 @@ extract_bba(unsigned long insn, int *invalid)
 
 /*ARGSUSED*/
 static unsigned long
-insert_bd(unsigned long insn, long value, const char **errmsg)
+insert_bd (unsigned long insn,
+	   long value,
+	   int dialect ATTRIBUTE_UNUSED,
+	   const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | (value & 0xfffc);
 }
 
 /*ARGSUSED*/
 static long
-extract_bd(unsigned long insn, int *invalid)
+extract_bd (unsigned long insn,
+	    int dialect ATTRIBUTE_UNUSED,
+	    int *invalid ATTRIBUTE_UNUSED)
 {
-  if ((insn & 0x8000) != 0)
-    return (insn & 0xfffc) - 0x10000;
-  else
-    return insn & 0xfffc;
+  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
 }
 
 /* The BD field in a B form instruction when the - modifier is used.
    This modifier means that the branch is not expected to be taken.
-   We must set the y bit of the BO field to 1 if the offset is
-   negative.  When extracting, we require that the y bit be 1 and that
-   the offset be positive, since if the y bit is 0 we just want to
-   print the normal form of the instruction.  */
+   For chips built to versions of the architecture prior to version 2
+   (ie. not Power4 compatible), we set the y bit of the BO field to 1
+   if the offset is negative.  When extracting, we require that the y
+   bit be 1 and that the offset be positive, since if the y bit is 0
+   we just want to print the normal form of the instruction.
+   Power4 compatible targets use two bits, "a", and "t", instead of
+   the "y" bit.  "at" == 00 => no hint, "at" == 01 => unpredictable,
+   "at" == 10 => not taken, "at" == 11 => taken.  The "t" bit is 00001
+   in BO field, the "a" bit is 00010 for branch on CR(BI) and 01000
+   for branch on CTR.  We only handle the taken/not-taken hint here.  */
 
 /*ARGSUSED*/
 static unsigned long
-insert_bdm(unsigned long insn, long value, const char **errmsg)
+insert_bdm (unsigned long insn,
+	    long value,
+	    int dialect,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
-  if ((value & 0x8000) != 0)
-    insn |= 1 << 21;
+  if ((dialect & PPC_OPCODE_POWER4) == 0)
+    {
+      if ((value & 0x8000) != 0)
+	insn |= 1 << 21;
+    }
+  else
+    {
+      if ((insn & (0x14 << 21)) == (0x04 << 21))
+	insn |= 0x02 << 21;
+      else if ((insn & (0x14 << 21)) == (0x10 << 21))
+	insn |= 0x08 << 21;
+    }
   return insn | (value & 0xfffc);
 }
 
 static long
-extract_bdm(unsigned long insn, int *invalid)
+extract_bdm (unsigned long insn,
+	     int dialect,
+	     int *invalid)
 {
-  if (invalid != (int *) NULL
-      && ((insn & (1 << 21)) == 0
-	  || (insn & (1 << 15)) == 0))
-    *invalid = 1;
-  if ((insn & 0x8000) != 0)
-    return (insn & 0xfffc) - 0x10000;
+  if ((dialect & PPC_OPCODE_POWER4) == 0)
+    {
+      if (((insn & (1 << 21)) == 0) != ((insn & (1 << 15)) == 0))
+	*invalid = 1;
+    }
   else
-    return insn & 0xfffc;
+    {
+      if ((insn & (0x17 << 21)) != (0x06 << 21)
+	  && (insn & (0x1d << 21)) != (0x18 << 21))
+	*invalid = 1;
+    }
+
+  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
 }
 
 /* The BD field in a B form instruction when the + modifier is used.
@@ -485,50 +678,94 @@ extract_bdm(unsigned long insn, int *invalid)
 
 /*ARGSUSED*/
 static unsigned long
-insert_bdp(unsigned long insn, long value, const char **errmsg)
+insert_bdp (unsigned long insn,
+	    long value,
+	    int dialect,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
-  if ((value & 0x8000) == 0)
-    insn |= 1 << 21;
+  if ((dialect & PPC_OPCODE_POWER4) == 0)
+    {
+      if ((value & 0x8000) == 0)
+	insn |= 1 << 21;
+    }
+  else
+    {
+      if ((insn & (0x14 << 21)) == (0x04 << 21))
+	insn |= 0x03 << 21;
+      else if ((insn & (0x14 << 21)) == (0x10 << 21))
+	insn |= 0x09 << 21;
+    }
   return insn | (value & 0xfffc);
 }
 
 static long
-extract_bdp(unsigned long insn, int *invalid)
+extract_bdp (unsigned long insn,
+	     int dialect,
+	     int *invalid)
 {
-  if (invalid != (int *) NULL
-      && ((insn & (1 << 21)) == 0
-	  || (insn & (1 << 15)) != 0))
-    *invalid = 1;
-  if ((insn & 0x8000) != 0)
-    return (insn & 0xfffc) - 0x10000;
+  if ((dialect & PPC_OPCODE_POWER4) == 0)
+    {
+      if (((insn & (1 << 21)) == 0) == ((insn & (1 << 15)) == 0))
+	*invalid = 1;
+    }
   else
-    return insn & 0xfffc;
+    {
+      if ((insn & (0x17 << 21)) != (0x07 << 21)
+	  && (insn & (0x1d << 21)) != (0x19 << 21))
+	*invalid = 1;
+    }
+
+  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
 }
 
 /* Check for legal values of a BO field.  */
 
 static int
-valid_bo (long value)
+valid_bo (long value, int dialect)
 {
-  /* Certain encodings have bits that are required to be zero.  These
-     are (z must be zero, y may be anything):
-         001zy
-	 011zy
-	 1z00y
-	 1z01y
-	 1z1zz
-     */
-  switch (value & 0x14)
+  if ((dialect & PPC_OPCODE_POWER4) == 0)
     {
-    default:
-    case 0:
-      return 1;
-    case 0x4:
-      return (value & 0x2) == 0;
-    case 0x10:
-      return (value & 0x8) == 0;
-    case 0x14:
-      return value == 0x14;
+      /* Certain encodings have bits that are required to be zero.
+	 These are (z must be zero, y may be anything):
+	     001zy
+	     011zy
+	     1z00y
+	     1z01y
+	     1z1zz
+      */
+      switch (value & 0x14)
+	{
+	default:
+	case 0:
+	  return 1;
+	case 0x4:
+	  return (value & 0x2) == 0;
+	case 0x10:
+	  return (value & 0x8) == 0;
+	case 0x14:
+	  return value == 0x14;
+	}
+    }
+  else
+    {
+      /* Certain encodings have bits that are required to be zero.
+	 These are (z must be zero, a & t may be anything):
+	     0000z
+	     0001z
+	     0100z
+	     0101z
+	     001at
+	     011at
+	     1a00t
+	     1a01t
+	     1z1zz
+      */
+      if ((value & 0x14) == 0)
+	return (value & 0x1) == 0;
+      else if ((value & 0x14) == 0x14)
+	return value == 0x14;
+      else
+	return 1;
     }
 }
 
@@ -536,22 +773,25 @@ valid_bo (long value)
    the field to an illegal value.  */
 
 static unsigned long
-insert_bo(unsigned long insn, long value, const char **errmsg)
+insert_bo (unsigned long insn,
+	   long value,
+	   int dialect,
+	   const char **errmsg)
 {
-  if (errmsg != (const char **) NULL
-      && ! valid_bo (value))
-    *errmsg = "invalid conditional option";
+  if (!valid_bo (value, dialect))
+    *errmsg = _("invalid conditional option");
   return insn | ((value & 0x1f) << 21);
 }
 
 static long
-extract_bo(unsigned long insn, int *invalid)
+extract_bo (unsigned long insn,
+	    int dialect,
+	    int *invalid)
 {
   long value;
 
   value = (insn >> 21) & 0x1f;
-  if (invalid != (int *) NULL
-      && ! valid_bo (value))
+  if (!valid_bo (value, dialect))
     *invalid = 1;
   return value;
 }
@@ -561,48 +801,250 @@ extract_bo(unsigned long insn, int *invalid)
    extracting it, we force it to be even.  */
 
 static unsigned long
-insert_boe(unsigned long insn, long value, const char **errmsg)
+insert_boe (unsigned long insn,
+	    long value,
+	    int dialect,
+	    const char **errmsg)
 {
-  if (errmsg != (const char **) NULL)
-    {
-      if (! valid_bo (value))
-	*errmsg = "invalid conditional option";
-      else if ((value & 1) != 0)
-	*errmsg = "attempt to set y bit when using + or - modifier";
-    }
+  if (!valid_bo (value, dialect))
+    *errmsg = _("invalid conditional option");
+  else if ((value & 1) != 0)
+    *errmsg = _("attempt to set y bit when using + or - modifier");
+
   return insn | ((value & 0x1f) << 21);
 }
 
 static long
-extract_boe(unsigned long insn, int *invalid)
+extract_boe (unsigned long insn,
+	     int dialect,
+	     int *invalid)
 {
   long value;
 
   value = (insn >> 21) & 0x1f;
-  if (invalid != (int *) NULL
-      && ! valid_bo (value))
+  if (!valid_bo (value, dialect))
     *invalid = 1;
   return value & 0x1e;
 }
 
+/* The DQ field in a DQ form instruction.  This is like D, but the
+   lower four bits are forced to zero. */
+
+/*ARGSUSED*/
+static unsigned long
+insert_dq (unsigned long insn,
+	   long value,
+	   int dialect ATTRIBUTE_UNUSED,
+	   const char **errmsg)
+{
+  if ((value & 0xf) != 0)
+    *errmsg = _("offset not a multiple of 16");
+  return insn | (value & 0xfff0);
+}
+
+/*ARGSUSED*/
+static long
+extract_dq (unsigned long insn,
+	    int dialect ATTRIBUTE_UNUSED,
+	    int *invalid ATTRIBUTE_UNUSED)
+{
+  return ((insn & 0xfff0) ^ 0x8000) - 0x8000;
+}
+
+static unsigned long
+insert_ev2 (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  if ((value & 1) != 0)
+    *errmsg = _("offset not a multiple of 2");
+  if ((value > 62) != 0)
+    *errmsg = _("offset greater than 62");
+  return insn | ((value & 0x3e) << 10);
+}
+
+static long
+extract_ev2 (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
+{
+  return (insn >> 10) & 0x3e;
+}
+
+static unsigned long
+insert_ev4 (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  if ((value & 3) != 0)
+    *errmsg = _("offset not a multiple of 4");
+  if ((value > 124) != 0)
+    *errmsg = _("offset greater than 124");
+  return insn | ((value & 0x7c) << 9);
+}
+
+static long
+extract_ev4 (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
+{
+  return (insn >> 9) & 0x7c;
+}
+
+static unsigned long
+insert_ev8 (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  if ((value & 7) != 0)
+    *errmsg = _("offset not a multiple of 8");
+  if ((value > 248) != 0)
+    *errmsg = _("offset greater than 248");
+  return insn | ((value & 0xf8) << 8);
+}
+
+static long
+extract_ev8 (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
+{
+  return (insn >> 8) & 0xf8;
+}
+
 /* The DS field in a DS form instruction.  This is like D, but the
    lower two bits are forced to zero.  */
 
 /*ARGSUSED*/
 static unsigned long
-insert_ds(unsigned long insn, long value, const char **errmsg)
+insert_ds (unsigned long insn,
+	   long value,
+	   int dialect ATTRIBUTE_UNUSED,
+	   const char **errmsg)
 {
+  if ((value & 3) != 0)
+    *errmsg = _("offset not a multiple of 4");
   return insn | (value & 0xfffc);
 }
 
 /*ARGSUSED*/
 static long
-extract_ds(unsigned long insn, int *invalid)
+extract_ds (unsigned long insn,
+	    int dialect ATTRIBUTE_UNUSED,
+	    int *invalid ATTRIBUTE_UNUSED)
 {
-  if ((insn & 0x8000) != 0)
-    return (insn & 0xfffc) - 0x10000;
-  else
-    return insn & 0xfffc;
+  return ((insn & 0xfffc) ^ 0x8000) - 0x8000;
+}
+
+/* The DE field in a DE form instruction.  */
+
+/*ARGSUSED*/
+static unsigned long
+insert_de (unsigned long insn,
+	   long value,
+	   int dialect ATTRIBUTE_UNUSED,
+	   const char **errmsg)
+{
+  if (value > 2047 || value < -2048)
+    *errmsg = _("offset not between -2048 and 2047");
+  return insn | ((value << 4) & 0xfff0);
+}
+
+/*ARGSUSED*/
+static long
+extract_de (unsigned long insn,
+	    int dialect ATTRIBUTE_UNUSED,
+	    int *invalid ATTRIBUTE_UNUSED)
+{
+  return (insn & 0xfff0) >> 4;
+}
+
+/* The DES field in a DES form instruction.  */
+
+/*ARGSUSED*/
+static unsigned long
+insert_des (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  if (value > 8191 || value < -8192)
+    *errmsg = _("offset not between -8192 and 8191");
+  else if ((value & 3) != 0)
+    *errmsg = _("offset not a multiple of 4");
+  return insn | ((value << 2) & 0xfff0);
+}
+
+/*ARGSUSED*/
+static long
+extract_des (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
+{
+  return (((insn >> 2) & 0x3ffc) ^ 0x2000) - 0x2000;
+}
+
+/* FXM mask in mfcr and mtcrf instructions.  */
+
+static unsigned long
+insert_fxm (unsigned long insn,
+	    long value,
+	    int dialect,
+	    const char **errmsg)
+{
+  /* If the optional field on mfcr is missing that means we want to use
+     the old form of the instruction that moves the whole cr.  In that
+     case we'll have VALUE zero.  There doesn't seem to be a way to
+     distinguish this from the case where someone writes mfcr %r3,0.  */
+  if (value == 0)
+    ;
+
+  /* If only one bit of the FXM field is set, we can use the new form
+     of the instruction, which is faster.  Unlike the Power4 branch hint
+     encoding, this is not backward compatible.  */
+  else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
+    insn |= 1 << 20;
+
+  /* Any other value on mfcr is an error.  */
+  else if ((insn & (0x3ff << 1)) == 19 << 1)
+    {
+      *errmsg = _("ignoring invalid mfcr mask");
+      value = 0;
+    }
+
+  return insn | ((value & 0xff) << 12);
+}
+
+static long
+extract_fxm (unsigned long insn,
+	     int dialect,
+	     int *invalid)
+{
+  long mask = (insn >> 12) & 0xff;
+
+  /* Is this a Power4 insn?  */
+  if ((insn & (1 << 20)) != 0)
+    {
+      if ((dialect & PPC_OPCODE_POWER4) == 0)
+	*invalid = 1;
+      else
+	{
+	  /* Exactly one bit of MASK should be set.  */
+	  if (mask == 0 || (mask & -mask) != mask)
+	    *invalid = 1;
+	}
+    }
+
+  /* Check that non-power4 form of mfcr has a zero MASK.  */
+  else if ((insn & (0x3ff << 1)) == 19 << 1)
+    {
+      if (mask != 0)
+	*invalid = 1;
+    }
+
+  return mask;
 }
 
 /* The LI field in an I form instruction.  The lower two bits are
@@ -610,19 +1052,23 @@ extract_ds(unsigned long insn, int *invalid)
 
 /*ARGSUSED*/
 static unsigned long
-insert_li(unsigned long insn, long value, const char **errmsg)
+insert_li (unsigned long insn,
+	   long value,
+	   int dialect ATTRIBUTE_UNUSED,
+	   const char **errmsg)
 {
+  if ((value & 3) != 0)
+    *errmsg = _("ignoring least significant bits in branch offset");
   return insn | (value & 0x3fffffc);
 }
 
 /*ARGSUSED*/
 static long
-extract_li(unsigned long insn, int *invalid)
+extract_li (unsigned long insn,
+	    int dialect ATTRIBUTE_UNUSED,
+	    int *invalid ATTRIBUTE_UNUSED)
 {
-  if ((insn & 0x2000000) != 0)
-    return (insn & 0x3fffffc) - 0x4000000;
-  else
-    return insn & 0x3fffffc;
+  return ((insn & 0x3fffffc) ^ 0x2000000) - 0x2000000;
 }
 
 /* The MB and ME fields in an M form instruction expressed as a single
@@ -631,59 +1077,85 @@ extract_li(unsigned long insn, int *invalid)
    instruction which uses a field of this type.  */
 
 static unsigned long
-insert_mbe(unsigned long insn, long value, const char **errmsg)
+insert_mbe (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
 {
-  unsigned long uval;
-  int mb, me;
+  unsigned long uval, mask;
+  int mb, me, mx, count, last;
 
   uval = value;
 
   if (uval == 0)
     {
-      if (errmsg != (const char **) NULL)
-	*errmsg = "illegal bitmask";
+      *errmsg = _("illegal bitmask");
       return insn;
     }
 
-  me = 31;
-  while ((uval & 1) == 0)
-    {
-      uval >>= 1;
-      --me;
-    }
+  mb = 0;
+  me = 32;
+  if ((uval & 1) != 0)
+    last = 1;
+  else
+    last = 0;
+  count = 0;
 
-  mb = me;
-  uval >>= 1;
-  while ((uval & 1) != 0)
-    {
-      uval >>= 1;
-      --mb;
-    }
+  /* mb: location of last 0->1 transition */
+  /* me: location of last 1->0 transition */
+  /* count: # transitions */
 
-  if (uval != 0)
+  for (mx = 0, mask = 1L << 31; mx < 32; ++mx, mask >>= 1)
     {
-      if (errmsg != (const char **) NULL)
-	*errmsg = "illegal bitmask";
+      if ((uval & mask) && !last)
+	{
+	  ++count;
+	  mb = mx;
+	  last = 1;
+	}
+      else if (!(uval & mask) && last)
+	{
+	  ++count;
+	  me = mx;
+	  last = 0;
+	}
     }
+  if (me == 0)
+    me = 32;
 
-  return insn | (mb << 6) | (me << 1);
+  if (count != 2 && (count != 0 || ! last))
+    *errmsg = _("illegal bitmask");
+
+  return insn | (mb << 6) | ((me - 1) << 1);
 }
 
 static long
-extract_mbe(unsigned long insn, int *invalid)
+extract_mbe (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid)
 {
   long ret;
   int mb, me;
   int i;
 
-  if (invalid != (int *) NULL)
-    *invalid = 1;
+  *invalid = 1;
 
-  ret = 0;
   mb = (insn >> 6) & 0x1f;
   me = (insn >> 1) & 0x1f;
-  for (i = mb; i < me; i++)
-    ret |= 1 << (31 - i);
+  if (mb < me + 1)
+    {
+      ret = 0;
+      for (i = mb; i <= me; i++)
+	ret |= 1L << (31 - i);
+    }
+  else if (mb == me + 1)
+    ret = ~0;
+  else /* (mb > me + 1) */
+    {
+      ret = ~0;
+      for (i = me + 1; i < mb; i++)
+	ret &= ~(1L << (31 - i));
+    }
   return ret;
 }
 
@@ -692,14 +1164,19 @@ extract_mbe(unsigned long insn, int *invalid)
 
 /*ARGSUSED*/
 static unsigned long
-insert_mb6(unsigned long insn, long value, const char **errmsg)
+insert_mb6 (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | ((value & 0x1f) << 6) | (value & 0x20);
 }
 
 /*ARGSUSED*/
 static long
-extract_mb6(unsigned long insn, int *invalid)
+extract_mb6 (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
 {
   return ((insn >> 6) & 0x1f) | (insn & 0x20);
 }
@@ -708,10 +1185,13 @@ extract_mb6(unsigned long insn, int *invalid)
    0.  */
 
 static unsigned long
-insert_nb(unsigned long insn, long value, const char **errmsg)
+insert_nb (unsigned long insn,
+	   long value,
+	   int dialect ATTRIBUTE_UNUSED,
+	   const char **errmsg)
 {
   if (value < 0 || value > 32)
-    *errmsg = "value out of range";
+    *errmsg = _("value out of range");
   if (value == 32)
     value = 0;
   return insn | ((value & 0x1f) << 11);
@@ -719,7 +1199,9 @@ insert_nb(unsigned long insn, long value, const char **errmsg)
 
 /*ARGSUSED*/
 static long
-extract_nb(unsigned long insn, int *invalid)
+extract_nb (unsigned long insn,
+	    int dialect ATTRIBUTE_UNUSED,
+	    int *invalid ATTRIBUTE_UNUSED)
 {
   long ret;
 
@@ -736,20 +1218,21 @@ extract_nb(unsigned long insn, int *invalid)
 
 /*ARGSUSED*/
 static unsigned long
-insert_nsi(unsigned long insn, long value, const char **errmsg)
+insert_nsi (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
-  return insn | ((- value) & 0xffff);
+  return insn | (-value & 0xffff);
 }
 
 static long
-extract_nsi(unsigned long insn, int *invalid)
+extract_nsi (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid)
 {
-  if (invalid != (int *) NULL)
-    *invalid = 1;
-  if ((insn & 0x8000) != 0)
-    return - ((insn & 0xffff) - 0x10000);
-  else
-    return - (insn & 0xffff);
+  *invalid = 1;
+  return -(((insn & 0xffff) ^ 0x8000) - 0x8000);
 }
 
 /* The RA field in a D or X form instruction which is an updating
@@ -757,10 +1240,13 @@ extract_nsi(unsigned long insn, int *invalid)
    equal the RT field.  */
 
 static unsigned long
-insert_ral(unsigned long insn, long value, const char **errmsg)
+insert_ral (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
 {
   if (value == 0
-      || value == ((insn >> 21) & 0x1f))
+      || (unsigned long) value == ((insn >> 21) & 0x1f))
     *errmsg = "invalid register operand when updating";
   return insn | ((value & 0x1f) << 16);
 }
@@ -769,10 +1255,30 @@ insert_ral(unsigned long insn, long value, const char **errmsg)
    restrictions.  */
 
 static unsigned long
-insert_ram(unsigned long insn, long value, const char **errmsg)
+insert_ram (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
 {
-  if (value >= ((insn >> 21) & 0x1f))
-    *errmsg = "index register in load range";
+  if ((unsigned long) value >= ((insn >> 21) & 0x1f))
+    *errmsg = _("index register in load range");
+  return insn | ((value & 0x1f) << 16);
+}
+
+/* The RA field in the DQ form lq instruction, which has special
+   value restrictions.  */
+
+/*ARGSUSED*/
+static unsigned long
+insert_raq (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  long rtvalue = (insn & RT_MASK) >> 21;
+
+  if (value == rtvalue)
+    *errmsg = _("source and target register operands must be different");
   return insn | ((value & 0x1f) << 16);
 }
 
@@ -781,10 +1287,13 @@ insert_ram(unsigned long insn, long value, const char **errmsg)
    field may not be zero.  */
 
 static unsigned long
-insert_ras(unsigned long insn, long value, const char **errmsg)
+insert_ras (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
 {
   if (value == 0)
-    *errmsg = "invalid register operand when updating";
+    *errmsg = _("invalid register operand when updating");
   return insn | ((value & 0x1f) << 16);
 }
 
@@ -795,33 +1304,72 @@ insert_ras(unsigned long insn, long value, const char **errmsg)
    extraction function just checks that the fields are the same.  */
 
 /*ARGSUSED*/
-static unsigned long 
-insert_rbs(unsigned long insn, long value, const char **errmsg)
+static unsigned long
+insert_rbs (unsigned long insn,
+	    long value ATTRIBUTE_UNUSED,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | (((insn >> 21) & 0x1f) << 11);
 }
 
 static long
-extract_rbs(unsigned long insn, int *invalid)
+extract_rbs (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid)
 {
-  if (invalid != (int *) NULL
-      && ((insn >> 21) & 0x1f) != ((insn >> 11) & 0x1f))
+  if (((insn >> 21) & 0x1f) != ((insn >> 11) & 0x1f))
     *invalid = 1;
   return 0;
 }
 
+/* The RT field of the DQ form lq instruction, which has special
+   value restrictions.  */
+
+/*ARGSUSED*/
+static unsigned long
+insert_rtq (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  if ((value & 1) != 0)
+    *errmsg = _("target register operand must be even");
+  return insn | ((value & 0x1f) << 21);
+}
+
+/* The RS field of the DS form stq instruction, which has special
+   value restrictions.  */
+
+/*ARGSUSED*/
+static unsigned long
+insert_rsq (unsigned long insn,
+	    long value ATTRIBUTE_UNUSED,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg)
+{
+  if ((value & 1) != 0)
+    *errmsg = _("source register operand must be even");
+  return insn | ((value & 0x1f) << 21);
+}
+
 /* The SH field in an MD form instruction.  This is split.  */
 
 /*ARGSUSED*/
 static unsigned long
-insert_sh6(unsigned long insn, long value, const char **errmsg)
+insert_sh6 (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | ((value & 0x1f) << 11) | ((value & 0x20) >> 4);
 }
 
 /*ARGSUSED*/
 static long
-extract_sh6(unsigned long insn, int *invalid)
+extract_sh6 (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
 {
   return ((insn >> 11) & 0x1f) | ((insn << 4) & 0x20);
 }
@@ -830,13 +1378,18 @@ extract_sh6(unsigned long insn, int *invalid)
    lower 5 bits are stored in the upper 5 and vice- versa.  */
 
 static unsigned long
-insert_spr(unsigned long insn, long value, const char **errmsg)
+insert_spr (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
 }
 
 static long
-extract_spr(unsigned long insn, int *invalid)
+extract_spr (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
 {
   return ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
 }
@@ -852,7 +1405,10 @@ extract_spr(unsigned long insn, int *invalid)
 #define TB (268)
 
 static unsigned long
-insert_tbr(unsigned long insn, long value, const char **errmsg)
+insert_tbr (unsigned long insn,
+	    long value,
+	    int dialect ATTRIBUTE_UNUSED,
+	    const char **errmsg ATTRIBUTE_UNUSED)
 {
   if (value == 0)
     value = TB;
@@ -860,7 +1416,9 @@ insert_tbr(unsigned long insn, long value, const char **errmsg)
 }
 
 static long
-extract_tbr(unsigned long insn, int *invalid)
+extract_tbr (unsigned long insn,
+	     int dialect ATTRIBUTE_UNUSED,
+	     int *invalid ATTRIBUTE_UNUSED)
 {
   long ret;
 
@@ -873,23 +1431,23 @@ extract_tbr(unsigned long insn, int *invalid)
 /* Macros used to form opcodes.  */
 
 /* The main opcode.  */
-#define OP(x) (((x) & 0x3f) << 26)
+#define OP(x) ((((unsigned long)(x)) & 0x3f) << 26)
 #define OP_MASK OP (0x3f)
 
 /* The main opcode combined with a trap code in the TO field of a D
    form instruction.  Used for extended mnemonics for the trap
    instructions.  */
-#define OPTO(x,to) (OP (x) | (((to) & 0x1f) << 21))
+#define OPTO(x,to) (OP (x) | ((((unsigned long)(to)) & 0x1f) << 21))
 #define OPTO_MASK (OP_MASK | TO_MASK)
 
 /* The main opcode combined with a comparison size bit in the L field
    of a D form or X form instruction.  Used for extended mnemonics for
    the comparison instructions.  */
-#define OPL(x,l) (OP (x) | (((l) & 1) << 21))
+#define OPL(x,l) (OP (x) | ((((unsigned long)(l)) & 1) << 21))
 #define OPL_MASK OPL (0x3f,1)
 
 /* An A form instruction.  */
-#define A(op, xop, rc) (OP (op) | (((xop) & 0x1f) << 1) | ((rc) & 1))
+#define A(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1) | (((unsigned long)(rc)) & 1))
 #define A_MASK A (0x3f, 0x1f, 1)
 
 /* An A_MASK with the FRB field fixed.  */
@@ -902,30 +1460,44 @@ extract_tbr(unsigned long insn, int *invalid)
 #define AFRAFRC_MASK (A_MASK | FRA_MASK | FRC_MASK)
 
 /* A B form instruction.  */
-#define B(op, aa, lk) (OP (op) | (((aa) & 1) << 1) | ((lk) & 1))
+#define B(op, aa, lk) (OP (op) | ((((unsigned long)(aa)) & 1) << 1) | ((lk) & 1))
 #define B_MASK B (0x3f, 1, 1)
 
 /* A B form instruction setting the BO field.  */
-#define BBO(op, bo, aa, lk) (B ((op), (aa), (lk)) | (((bo) & 0x1f) << 21))
+#define BBO(op, bo, aa, lk) (B ((op), (aa), (lk)) | ((((unsigned long)(bo)) & 0x1f) << 21))
 #define BBO_MASK BBO (0x3f, 0x1f, 1, 1)
 
 /* A BBO_MASK with the y bit of the BO field removed.  This permits
    matching a conditional branch regardless of the setting of the y
-   bit.  */
-#define Y_MASK (1 << 21)
-#define BBOY_MASK (BBO_MASK &~ Y_MASK)
+   bit.  Similarly for the 'at' bits used for power4 branch hints.  */
+#define Y_MASK   (((unsigned long) 1) << 21)
+#define AT1_MASK (((unsigned long) 3) << 21)
+#define AT2_MASK (((unsigned long) 9) << 21)
+#define BBOY_MASK  (BBO_MASK &~ Y_MASK)
+#define BBOAT_MASK (BBO_MASK &~ AT1_MASK)
 
 /* A B form instruction setting the BO field and the condition bits of
    the BI field.  */
 #define BBOCB(op, bo, cb, aa, lk) \
-  (BBO ((op), (bo), (aa), (lk)) | (((cb) & 0x3) << 16))
+  (BBO ((op), (bo), (aa), (lk)) | ((((unsigned long)(cb)) & 0x3) << 16))
 #define BBOCB_MASK BBOCB (0x3f, 0x1f, 0x3, 1, 1)
 
 /* A BBOCB_MASK with the y bit of the BO field removed.  */
 #define BBOYCB_MASK (BBOCB_MASK &~ Y_MASK)
+#define BBOATCB_MASK (BBOCB_MASK &~ AT1_MASK)
+#define BBOAT2CB_MASK (BBOCB_MASK &~ AT2_MASK)
 
 /* A BBOYCB_MASK in which the BI field is fixed.  */
 #define BBOYBI_MASK (BBOYCB_MASK | BI_MASK)
+#define BBOATBI_MASK (BBOAT2CB_MASK | BI_MASK)
+
+/* An Context form instruction.  */
+#define CTX(op, xop)   (OP (op) | (((unsigned long)(xop)) & 0x7))
+#define CTX_MASK       CTX(0x3f, 0x7)
+
+/* An User Context form instruction.  */
+#define UCTX(op, xop)  (OP (op) | (((unsigned long)(xop)) & 0x1f))
+#define UCTX_MASK      UCTX(0x3f, 0x1f)
 
 /* The main opcode mask with the RA field clear.  */
 #define DRA_MASK (OP_MASK | RA_MASK)
@@ -934,12 +1506,20 @@ extract_tbr(unsigned long insn, int *invalid)
 #define DSO(op, xop) (OP (op) | ((xop) & 0x3))
 #define DS_MASK DSO (0x3f, 3)
 
+/* A DE form instruction.  */
+#define DEO(op, xop) (OP (op) | ((xop) & 0xf))
+#define DE_MASK DEO (0x3e, 0xf)
+
+/* An EVSEL form instruction.  */
+#define EVSEL(op, xop) (OP (op) | (((unsigned long)(xop)) & 0xff) << 3)
+#define EVSEL_MASK EVSEL(0x3f, 0xff)
+
 /* An M form instruction.  */
 #define M(op, rc) (OP (op) | ((rc) & 1))
 #define M_MASK M (0x3f, 1)
 
 /* An M form instruction with the ME field specified.  */
-#define MME(op, me, rc) (M ((op), (rc)) | (((me) & 0x1f) << 1))
+#define MME(op, me, rc) (M ((op), (rc)) | ((((unsigned long)(me)) & 0x1f) << 1))
 
 /* An M_MASK with the MB and ME fields fixed.  */
 #define MMBME_MASK (M_MASK | MB_MASK | ME_MASK)
@@ -948,7 +1528,7 @@ extract_tbr(unsigned long insn, int *invalid)
 #define MSHME_MASK (M_MASK | SH_MASK | ME_MASK)
 
 /* An MD form instruction.  */
-#define MD(op, xop, rc) (OP (op) | (((xop) & 0x7) << 2) | ((rc) & 1))
+#define MD(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x7) << 2) | ((rc) & 1))
 #define MD_MASK MD (0x3f, 0x7, 1)
 
 /* An MD_MASK with the MB field fixed.  */
@@ -958,18 +1538,36 @@ extract_tbr(unsigned long insn, int *invalid)
 #define MDSH_MASK (MD_MASK | SH6_MASK)
 
 /* An MDS form instruction.  */
-#define MDS(op, xop, rc) (OP (op) | (((xop) & 0xf) << 1) | ((rc) & 1))
+#define MDS(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0xf) << 1) | ((rc) & 1))
 #define MDS_MASK MDS (0x3f, 0xf, 1)
 
 /* An MDS_MASK with the MB field fixed.  */
 #define MDSMB_MASK (MDS_MASK | MB6_MASK)
 
 /* An SC form instruction.  */
-#define SC(op, sa, lk) (OP (op) | (((sa) & 1) << 1) | ((lk) & 1))
-#define SC_MASK (OP_MASK | (0x3ff << 16) | (1 << 1) | 1)
+#define SC(op, sa, lk) (OP (op) | ((((unsigned long)(sa)) & 1) << 1) | ((lk) & 1))
+#define SC_MASK (OP_MASK | (((unsigned long)0x3ff) << 16) | (((unsigned long)1) << 1) | 1)
+
+/* An VX form instruction.  */
+#define VX(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x7ff))
+
+/* The mask for an VX form instruction.  */
+#define VX_MASK	VX(0x3f, 0x7ff)
+
+/* An VA form instruction.  */
+#define VXA(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x03f))
+
+/* The mask for an VA form instruction.  */
+#define VXA_MASK VXA(0x3f, 0x3f)
+
+/* An VXR form instruction.  */
+#define VXR(op, xop, rc) (OP (op) | (((rc) & 1) << 10) | (((unsigned long)(xop)) & 0x3ff))
+
+/* The mask for a VXR form instruction.  */
+#define VXR_MASK VXR(0x3f, 0x3ff, 1)
 
 /* An X form instruction.  */
-#define X(op, xop) (OP (op) | (((xop) & 0x3ff) << 1))
+#define X(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))
 
 /* An X form instruction with the RC bit specified.  */
 #define XRC(op, xop, rc) (X ((op), (xop)) | ((rc) & 1))
@@ -989,29 +1587,53 @@ extract_tbr(unsigned long insn, int *invalid)
 /* An X_MASK with the RA and RB fields fixed.  */
 #define XRARB_MASK (X_MASK | RA_MASK | RB_MASK)
 
+/* An XRARB_MASK, but with the L bit clear.  */
+#define XRLARB_MASK (XRARB_MASK & ~((unsigned long) 1 << 16))
+
 /* An X_MASK with the RT and RA fields fixed.  */
 #define XRTRA_MASK (X_MASK | RT_MASK | RA_MASK)
 
+/* An XRTRA_MASK, but with L bit clear.  */
+#define XRTLRA_MASK (XRTRA_MASK & ~((unsigned long) 1 << 21))
+
 /* An X form comparison instruction.  */
-#define XCMPL(op, xop, l) (X ((op), (xop)) | (((l) & 1) << 21))
+#define XCMPL(op, xop, l) (X ((op), (xop)) | ((((unsigned long)(l)) & 1) << 21))
 
 /* The mask for an X form comparison instruction.  */
-#define XCMP_MASK (X_MASK | (1 << 22))
+#define XCMP_MASK (X_MASK | (((unsigned long)1) << 22))
 
 /* The mask for an X form comparison instruction with the L field
    fixed.  */
-#define XCMPL_MASK (XCMP_MASK | (1 << 21))
+#define XCMPL_MASK (XCMP_MASK | (((unsigned long)1) << 21))
 
 /* An X form trap instruction with the TO field specified.  */
-#define XTO(op, xop, to) (X ((op), (xop)) | (((to) & 0x1f) << 21))
+#define XTO(op, xop, to) (X ((op), (xop)) | ((((unsigned long)(to)) & 0x1f) << 21))
 #define XTO_MASK (X_MASK | TO_MASK)
 
+/* An X form tlb instruction with the SH field specified.  */
+#define XTLB(op, xop, sh) (X ((op), (xop)) | ((((unsigned long)(sh)) & 0x1f) << 11))
+#define XTLB_MASK (X_MASK | SH_MASK)
+
+/* An X form sync instruction.  */
+#define XSYNC(op, xop, l) (X ((op), (xop)) | ((((unsigned long)(l)) & 3) << 21))
+
+/* An X form sync instruction with everything filled in except the LS field.  */
+#define XSYNC_MASK (0xff9fffff)
+
+/* An X form AltiVec dss instruction.  */
+#define XDSS(op, xop, a) (X ((op), (xop)) | ((((unsigned long)(a)) & 1) << 25))
+#define XDSS_MASK XDSS(0x3f, 0x3ff, 1)
+
 /* An XFL form instruction.  */
-#define XFL(op, xop, rc) (OP (op) | (((xop) & 0x3ff) << 1) | ((rc) & 1))
-#define XFL_MASK (XFL (0x3f, 0x3ff, 1) | (1 << 25) | (1 << 16))
+#define XFL(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1) | (((unsigned long)(rc)) & 1))
+#define XFL_MASK (XFL (0x3f, 0x3ff, 1) | (((unsigned long)1) << 25) | (((unsigned long)1) << 16))
+
+/* An X form isel instruction.  */
+#define XISEL(op, xop)  (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1))
+#define XISEL_MASK      XISEL(0x3f, 0x1f)
 
 /* An XL form instruction with the LK field set to 0.  */
-#define XL(op, xop) (OP (op) | (((xop) & 0x3ff) << 1))
+#define XL(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))
 
 /* An XL form instruction which uses the LK field.  */
 #define XLLK(op, xop, lk) (XL ((op), (xop)) | ((lk) & 1))
@@ -1021,18 +1643,18 @@ extract_tbr(unsigned long insn, int *invalid)
 
 /* An XL form instruction which explicitly sets the BO field.  */
 #define XLO(op, bo, xop, lk) \
-  (XLLK ((op), (xop), (lk)) | (((bo) & 0x1f) << 21))
+  (XLLK ((op), (xop), (lk)) | ((((unsigned long)(bo)) & 0x1f) << 21))
 #define XLO_MASK (XL_MASK | BO_MASK)
 
 /* An XL form instruction which explicitly sets the y bit of the BO
    field.  */
-#define XLYLK(op, xop, y, lk) (XLLK ((op), (xop), (lk)) | (((y) & 1) << 21))
+#define XLYLK(op, xop, y, lk) (XLLK ((op), (xop), (lk)) | ((((unsigned long)(y)) & 1) << 21))
 #define XLYLK_MASK (XL_MASK | Y_MASK)
 
 /* An XL form instruction which sets the BO field and the condition
    bits of the BI field.  */
 #define XLOCB(op, bo, cb, xop, lk) \
-  (XLO ((op), (bo), (xop), (lk)) | (((cb) & 3) << 16))
+  (XLO ((op), (bo), (xop), (lk)) | ((((unsigned long)(cb)) & 3) << 16))
 #define XLOCB_MASK XLOCB (0x3f, 0x1f, 0x3, 0x3ff, 1)
 
 /* An XL_MASK or XLYLK_MASK or XLOCB_MASK with the BB field fixed.  */
@@ -1048,26 +1670,26 @@ extract_tbr(unsigned long insn, int *invalid)
 
 /* An XO form instruction.  */
 #define XO(op, xop, oe, rc) \
-  (OP (op) | (((xop) & 0x1ff) << 1) | (((oe) & 1) << 10) | ((rc) & 1))
+  (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 1) | ((((unsigned long)(oe)) & 1) << 10) | (((unsigned long)(rc)) & 1))
 #define XO_MASK XO (0x3f, 0x1ff, 1, 1)
 
 /* An XO_MASK with the RB field fixed.  */
 #define XORB_MASK (XO_MASK | RB_MASK)
 
 /* An XS form instruction.  */
-#define XS(op, xop, rc) (OP (op) | (((xop) & 0x1ff) << 2) | ((rc) & 1))
+#define XS(op, xop, rc) (OP (op) | ((((unsigned long)(xop)) & 0x1ff) << 2) | (((unsigned long)(rc)) & 1))
 #define XS_MASK XS (0x3f, 0x1ff, 1)
 
 /* A mask for the FXM version of an XFX form instruction.  */
-#define XFXFXM_MASK (X_MASK | (1 << 20) | (1 << 11))
+#define XFXFXM_MASK (X_MASK | (1 << 11))
 
 /* An XFX form instruction with the FXM field filled in.  */
 #define XFXM(op, xop, fxm) \
-  (X ((op), (xop)) | (((fxm) & 0xff) << 12))
+  (X ((op), (xop)) | ((((unsigned long)(fxm)) & 0xff) << 12))
 
 /* An XFX form instruction with the SPR field filled in.  */
 #define XSPR(op, xop, spr) \
-  (X ((op), (xop)) | (((spr) & 0x1f) << 16) | (((spr) & 0x3e0) << 6))
+  (X ((op), (xop)) | ((((unsigned long)(spr)) & 0x1f) << 16) | ((((unsigned long)(spr)) & 0x3e0) << 6))
 #define XSPR_MASK (X_MASK | SPR_MASK)
 
 /* An XFX form instruction with the SPR field filled in except for the
@@ -1078,23 +1700,41 @@ extract_tbr(unsigned long insn, int *invalid)
    SPRG field.  */
 #define XSPRG_MASK (XSPR_MASK &~ SPRG_MASK)
 
+/* An X form instruction with everything filled in except the E field.  */
+#define XE_MASK (0xffff7fff)
+
+/* An X form user context instruction.  */
+#define XUC(op, xop)  (OP (op) | (((unsigned long)(xop)) & 0x1f))
+#define XUC_MASK      XUC(0x3f, 0x1f)
+
 /* The BO encodings used in extended conditional branch mnemonics.  */
 #define BODNZF	(0x0)
 #define BODNZFP	(0x1)
 #define BODZF	(0x2)
 #define BODZFP	(0x3)
-#define BOF	(0x4)
-#define BOFP	(0x5)
 #define BODNZT	(0x8)
 #define BODNZTP	(0x9)
 #define BODZT	(0xa)
 #define BODZTP	(0xb)
+
+#define BOF	(0x4)
+#define BOFP	(0x5)
+#define BOFM4	(0x6)
+#define BOFP4	(0x7)
 #define BOT	(0xc)
 #define BOTP	(0xd)
+#define BOTM4	(0xe)
+#define BOTP4	(0xf)
+
 #define BODNZ	(0x10)
 #define BODNZP	(0x11)
 #define BODZ	(0x12)
 #define BODZP	(0x13)
+#define BODNZM4 (0x18)
+#define BODNZP4 (0x19)
+#define BODZM4	(0x1a)
+#define BODZP4	(0x1b)
+
 #define BOU	(0x14)
 
 /* The BI condition bit encodings used in extended conditional branch
@@ -1123,13 +1763,40 @@ extract_tbr(unsigned long insn, int *invalid)
 
 /* Smaller names for the flags so each entry in the opcodes table will
    fit on a single line.  */
-#undef PPC
-#define PPC PPC_OPCODE_PPC
-#define POWER PPC_OPCODE_POWER
-#define POWER2 PPC_OPCODE_POWER2
-#define B32 PPC_OPCODE_32
-#define B64 PPC_OPCODE_64
-#define M601 PPC_OPCODE_601
+#undef	PPC
+#define PPC     PPC_OPCODE_PPC
+#define PPCCOM	PPC_OPCODE_PPC | PPC_OPCODE_COMMON
+#define NOPOWER4 PPC_OPCODE_NOPOWER4 | PPCCOM
+#define POWER4	PPC_OPCODE_POWER4
+#define PPC32   PPC_OPCODE_32 | PPC_OPCODE_PPC
+#define PPC64   PPC_OPCODE_64 | PPC_OPCODE_PPC
+#define PPC403	PPC_OPCODE_403
+#define PPC405	PPC403
+#define PPC440	PPC_OPCODE_440
+#define PPC750	PPC
+#define PPC860	PPC
+#define PPCVEC	PPC_OPCODE_ALTIVEC | PPC_OPCODE_PPC
+#define	POWER   PPC_OPCODE_POWER
+#define	POWER2	PPC_OPCODE_POWER | PPC_OPCODE_POWER2
+#define PPCPWR2	PPC_OPCODE_PPC | PPC_OPCODE_POWER | PPC_OPCODE_POWER2
+#define	POWER32	PPC_OPCODE_POWER | PPC_OPCODE_32
+#define	COM     PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON
+#define	COM32   PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_32
+#define	M601    PPC_OPCODE_POWER | PPC_OPCODE_601
+#define PWRCOM	PPC_OPCODE_POWER | PPC_OPCODE_601 | PPC_OPCODE_COMMON
+#define	MFDEC1	PPC_OPCODE_POWER
+#define	MFDEC2	PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE
+#define BOOKE	PPC_OPCODE_BOOKE
+#define BOOKE64	PPC_OPCODE_BOOKE64
+#define CLASSIC	PPC_OPCODE_CLASSIC
+#define PPCSPE	PPC_OPCODE_SPE
+#define PPCISEL	PPC_OPCODE_ISEL
+#define PPCEFS	PPC_OPCODE_EFS
+#define PPCBRLK	PPC_OPCODE_BRLOCK
+#define PPCPMR	PPC_OPCODE_PMR
+#define PPCCHLK	PPC_OPCODE_CACHELCK
+#define PPCCHLK64	PPC_OPCODE_CACHELCK | PPC_OPCODE_BOOKE64
+#define PPCRFMCI	PPC_OPCODE_RFMCI
 
 /* The opcode table.
 
@@ -1150,815 +1817,1456 @@ extract_tbr(unsigned long insn, int *invalid)
    sorted by major opcode.  */
 
 const struct powerpc_opcode powerpc_opcodes[] = {
-{ "tdlgti",  OPTO(2,TOLGT), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdllti",  OPTO(2,TOLLT), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdeqi",   OPTO(2,TOEQ), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdlgei",  OPTO(2,TOLGE), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdlnli",  OPTO(2,TOLNL), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdllei",  OPTO(2,TOLLE), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdlngi",  OPTO(2,TOLNG), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdgti",   OPTO(2,TOGT), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdgei",   OPTO(2,TOGE), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdnli",   OPTO(2,TONL), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdlti",   OPTO(2,TOLT), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdlei",   OPTO(2,TOLE), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdngi",   OPTO(2,TONG), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdnei",   OPTO(2,TONE), OPTO_MASK,	PPC|B64,	{ RA, SI } },
-{ "tdi",     OP(2),	OP_MASK,	PPC|B64,	{ TO, RA, SI } },
-
-{ "twlgti",  OPTO(3,TOLGT), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tlgti",   OPTO(3,TOLGT), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twllti",  OPTO(3,TOLLT), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tllti",   OPTO(3,TOLLT), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "tweqi",   OPTO(3,TOEQ), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "teqi",    OPTO(3,TOEQ), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twlgei",  OPTO(3,TOLGE), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tlgei",   OPTO(3,TOLGE), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twlnli",  OPTO(3,TOLNL), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tlnli",   OPTO(3,TOLNL), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twllei",  OPTO(3,TOLLE), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tllei",   OPTO(3,TOLLE), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twlngi",  OPTO(3,TOLNG), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tlngi",   OPTO(3,TOLNG), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twgti",   OPTO(3,TOGT), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tgti",    OPTO(3,TOGT), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twgei",   OPTO(3,TOGE), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tgei",    OPTO(3,TOGE), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twnli",   OPTO(3,TONL), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tnli",    OPTO(3,TONL), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twlti",   OPTO(3,TOLT), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tlti",    OPTO(3,TOLT), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twlei",   OPTO(3,TOLE), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tlei",    OPTO(3,TOLE), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twngi",   OPTO(3,TONG), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tngi",    OPTO(3,TONG), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twnei",   OPTO(3,TONE), OPTO_MASK,	PPC,		{ RA, SI } },
-{ "tnei",    OPTO(3,TONE), OPTO_MASK,	POWER,		{ RA, SI } },
-{ "twi",     OP(3),	OP_MASK,	PPC,		{ TO, RA, SI } },
-{ "ti",      OP(3),	OP_MASK,	POWER,		{ TO, RA, SI } },
-
-{ "mulli",   OP(7),	OP_MASK,	PPC,		{ RT, RA, SI } },
-{ "muli",    OP(7),	OP_MASK,	POWER,		{ RT, RA, SI } },
-
-{ "subfic",  OP(8),	OP_MASK,	PPC,		{ RT, RA, SI } },
-{ "sfi",     OP(8),	OP_MASK,	POWER,		{ RT, RA, SI } },
-
-{ "dozi",    OP(9),	OP_MASK,	POWER|M601,	{ RT, RA, SI } },
-
-{ "cmplwi",  OPL(10,0),	OPL_MASK,	PPC,		{ OBF, RA, UI } },
-{ "cmpldi",  OPL(10,1), OPL_MASK,	PPC|B64,	{ OBF, RA, UI } },
+{ "attn",    X(0,256), X_MASK,		POWER4,		{ 0 } },
+{ "tdlgti",  OPTO(2,TOLGT), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdllti",  OPTO(2,TOLLT), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdeqi",   OPTO(2,TOEQ), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdlgei",  OPTO(2,TOLGE), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdlnli",  OPTO(2,TOLNL), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdllei",  OPTO(2,TOLLE), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdlngi",  OPTO(2,TOLNG), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdgti",   OPTO(2,TOGT), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdgei",   OPTO(2,TOGE), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdnli",   OPTO(2,TONL), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdlti",   OPTO(2,TOLT), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdlei",   OPTO(2,TOLE), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdngi",   OPTO(2,TONG), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdnei",   OPTO(2,TONE), OPTO_MASK,	PPC64,		{ RA, SI } },
+{ "tdi",     OP(2),	OP_MASK,	PPC64,		{ TO, RA, SI } },
+
+{ "twlgti",  OPTO(3,TOLGT), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tlgti",   OPTO(3,TOLGT), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twllti",  OPTO(3,TOLLT), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tllti",   OPTO(3,TOLLT), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "tweqi",   OPTO(3,TOEQ), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "teqi",    OPTO(3,TOEQ), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twlgei",  OPTO(3,TOLGE), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tlgei",   OPTO(3,TOLGE), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twlnli",  OPTO(3,TOLNL), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tlnli",   OPTO(3,TOLNL), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twllei",  OPTO(3,TOLLE), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tllei",   OPTO(3,TOLLE), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twlngi",  OPTO(3,TOLNG), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tlngi",   OPTO(3,TOLNG), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twgti",   OPTO(3,TOGT), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tgti",    OPTO(3,TOGT), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twgei",   OPTO(3,TOGE), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tgei",    OPTO(3,TOGE), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twnli",   OPTO(3,TONL), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tnli",    OPTO(3,TONL), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twlti",   OPTO(3,TOLT), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tlti",    OPTO(3,TOLT), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twlei",   OPTO(3,TOLE), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tlei",    OPTO(3,TOLE), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twngi",   OPTO(3,TONG), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tngi",    OPTO(3,TONG), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twnei",   OPTO(3,TONE), OPTO_MASK,	PPCCOM,		{ RA, SI } },
+{ "tnei",    OPTO(3,TONE), OPTO_MASK,	PWRCOM,		{ RA, SI } },
+{ "twi",     OP(3),	OP_MASK,	PPCCOM,		{ TO, RA, SI } },
+{ "ti",      OP(3),	OP_MASK,	PWRCOM,		{ TO, RA, SI } },
+
+{ "macchw",	XO(4,172,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchw.",	XO(4,172,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwo",	XO(4,172,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwo.",	XO(4,172,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchws",	XO(4,236,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchws.",	XO(4,236,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwso",	XO(4,236,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwso.",	XO(4,236,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwsu",	XO(4,204,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwsu.",	XO(4,204,0,1), XO_MASK, PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwsuo",	XO(4,204,1,0), XO_MASK, PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwsuo.",	XO(4,204,1,1), XO_MASK, PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwu",	XO(4,140,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwu.",	XO(4,140,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwuo",	XO(4,140,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "macchwuo.",	XO(4,140,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhw",	XO(4,44,0,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhw.",	XO(4,44,0,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwo",	XO(4,44,1,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwo.",	XO(4,44,1,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhws",	XO(4,108,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhws.",	XO(4,108,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwso",	XO(4,108,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwso.",	XO(4,108,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwsu",	XO(4,76,0,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwsu.",	XO(4,76,0,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwsuo",	XO(4,76,1,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwsuo.",	XO(4,76,1,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwu",	XO(4,12,0,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwu.",	XO(4,12,0,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwuo",	XO(4,12,1,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "machhwuo.",	XO(4,12,1,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhw",	XO(4,428,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhw.",	XO(4,428,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwo",	XO(4,428,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwo.",	XO(4,428,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhws",	XO(4,492,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhws.",	XO(4,492,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwso",	XO(4,492,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwso.",	XO(4,492,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwsu",	XO(4,460,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwsu.",	XO(4,460,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwsuo",	XO(4,460,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwsuo.",	XO(4,460,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwu",	XO(4,396,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwu.",	XO(4,396,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwuo",	XO(4,396,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "maclhwuo.",	XO(4,396,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulchw",	XRC(4,168,0),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulchw.",	XRC(4,168,1),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulchwu",	XRC(4,136,0),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulchwu.",	XRC(4,136,1),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulhhw",	XRC(4,40,0),   X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulhhw.",	XRC(4,40,1),   X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulhhwu",	XRC(4,8,0),    X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mulhhwu.",	XRC(4,8,1),    X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mullhw",	XRC(4,424,0),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mullhw.",	XRC(4,424,1),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mullhwu",	XRC(4,392,0),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mullhwu.",	XRC(4,392,1),  X_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchw",	XO(4,174,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchw.",	XO(4,174,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchwo",	XO(4,174,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchwo.",	XO(4,174,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchws",	XO(4,238,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchws.",	XO(4,238,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchwso",	XO(4,238,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmacchwso.",	XO(4,238,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhw",	XO(4,46,0,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhw.",	XO(4,46,0,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhwo",	XO(4,46,1,0),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhwo.",	XO(4,46,1,1),  XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhws",	XO(4,110,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhws.",	XO(4,110,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhwso",	XO(4,110,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmachhwso.",	XO(4,110,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhw",	XO(4,430,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhw.",	XO(4,430,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhwo",	XO(4,430,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhwo.",	XO(4,430,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhws",	XO(4,494,0,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhws.",	XO(4,494,0,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhwso",	XO(4,494,1,0), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "nmaclhwso.",	XO(4,494,1,1), XO_MASK,	PPC405|PPC440,	{ RT, RA, RB } },
+{ "mfvscr",  VX(4, 1540), VX_MASK,	PPCVEC,		{ VD } },
+{ "mtvscr",  VX(4, 1604), VX_MASK,	PPCVEC,		{ VB } },
+{ "vaddcuw", VX(4,  384), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vaddfp",  VX(4,   10), VX_MASK, 	PPCVEC,		{ VD, VA, VB } },
+{ "vaddsbs", VX(4,  768), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vaddshs", VX(4,  832), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vaddsws", VX(4,  896), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vaddubm", VX(4,    0), VX_MASK, 	PPCVEC,		{ VD, VA, VB } },
+{ "vaddubs", VX(4,  512), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vadduhm", VX(4,   64), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vadduhs", VX(4,  576), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vadduwm", VX(4,  128), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vadduws", VX(4,  640), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vand",    VX(4, 1028), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vandc",   VX(4, 1092), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vavgsb",  VX(4, 1282), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vavgsh",  VX(4, 1346), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vavgsw",  VX(4, 1410), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vavgub",  VX(4, 1026), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vavguh",  VX(4, 1090), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vavguw",  VX(4, 1154), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vcfsx",   VX(4,  842), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vcfux",   VX(4,  778), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vcmpbfp",   VXR(4, 966, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpbfp.",  VXR(4, 966, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpeqfp",  VXR(4, 198, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpeqfp.", VXR(4, 198, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpequb",  VXR(4,   6, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpequb.", VXR(4,   6, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpequh",  VXR(4,  70, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpequh.", VXR(4,  70, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpequw",  VXR(4, 134, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpequw.", VXR(4, 134, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgefp",  VXR(4, 454, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgefp.", VXR(4, 454, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtfp",  VXR(4, 710, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtfp.", VXR(4, 710, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtsb",  VXR(4, 774, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtsb.", VXR(4, 774, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtsh",  VXR(4, 838, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtsh.", VXR(4, 838, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtsw",  VXR(4, 902, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtsw.", VXR(4, 902, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtub",  VXR(4, 518, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtub.", VXR(4, 518, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtuh",  VXR(4, 582, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtuh.", VXR(4, 582, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtuw",  VXR(4, 646, 0), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vcmpgtuw.", VXR(4, 646, 1), VXR_MASK, PPCVEC,	{ VD, VA, VB } },
+{ "vctsxs",    VX(4,  970), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vctuxs",    VX(4,  906), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vexptefp",  VX(4,  394), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vlogefp",   VX(4,  458), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vmaddfp",   VXA(4,  46), VXA_MASK,	PPCVEC,		{ VD, VA, VC, VB } },
+{ "vmaxfp",    VX(4, 1034), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmaxsb",    VX(4,  258), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmaxsh",    VX(4,  322), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmaxsw",    VX(4,  386), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmaxub",    VX(4,    2), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmaxuh",    VX(4,   66), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmaxuw",    VX(4,  130), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmhaddshs", VXA(4,  32), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmhraddshs", VXA(4, 33), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vminfp",    VX(4, 1098), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vminsb",    VX(4,  770), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vminsh",    VX(4,  834), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vminsw",    VX(4,  898), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vminub",    VX(4,  514), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vminuh",    VX(4,  578), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vminuw",    VX(4,  642), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmladduhm", VXA(4,  34), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmrghb",    VX(4,   12), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmrghh",    VX(4,   76), VX_MASK,    PPCVEC,		{ VD, VA, VB } },
+{ "vmrghw",    VX(4,  140), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmrglb",    VX(4,  268), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmrglh",    VX(4,  332), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmrglw",    VX(4,  396), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmsummbm",  VXA(4,  37), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmsumshm",  VXA(4,  40), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmsumshs",  VXA(4,  41), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmsumubm",  VXA(4,  36), VXA_MASK,   PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmsumuhm",  VXA(4,  38), VXA_MASK,   PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmsumuhs",  VXA(4,  39), VXA_MASK,   PPCVEC,		{ VD, VA, VB, VC } },
+{ "vmulesb",   VX(4,  776), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmulesh",   VX(4,  840), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmuleub",   VX(4,  520), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmuleuh",   VX(4,  584), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmulosb",   VX(4,  264), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmulosh",   VX(4,  328), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmuloub",   VX(4,    8), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vmulouh",   VX(4,   72), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vnmsubfp",  VXA(4,  47), VXA_MASK,	PPCVEC,		{ VD, VA, VC, VB } },
+{ "vnor",      VX(4, 1284), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vor",       VX(4, 1156), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vperm",     VXA(4,  43), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vpkpx",     VX(4,  782), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkshss",   VX(4,  398), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkshus",   VX(4,  270), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkswss",   VX(4,  462), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkswus",   VX(4,  334), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkuhum",   VX(4,   14), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkuhus",   VX(4,  142), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkuwum",   VX(4,   78), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vpkuwus",   VX(4,  206), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vrefp",     VX(4,  266), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vrfim",     VX(4,  714), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vrfin",     VX(4,  522), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vrfip",     VX(4,  650), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vrfiz",     VX(4,  586), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vrlb",      VX(4,    4), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vrlh",      VX(4,   68), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vrlw",      VX(4,  132), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vrsqrtefp", VX(4,  330), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vsel",      VXA(4,  42), VXA_MASK,	PPCVEC,		{ VD, VA, VB, VC } },
+{ "vsl",       VX(4,  452), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vslb",      VX(4,  260), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsldoi",    VXA(4,  44), VXA_MASK,	PPCVEC,		{ VD, VA, VB, SHB } },
+{ "vslh",      VX(4,  324), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vslo",      VX(4, 1036), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vslw",      VX(4,  388), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vspltb",    VX(4,  524), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vsplth",    VX(4,  588), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vspltisb",  VX(4,  780), VX_MASK,	PPCVEC,		{ VD, SIMM } },
+{ "vspltish",  VX(4,  844), VX_MASK,	PPCVEC,		{ VD, SIMM } },
+{ "vspltisw",  VX(4,  908), VX_MASK,	PPCVEC,		{ VD, SIMM } },
+{ "vspltw",    VX(4,  652), VX_MASK,	PPCVEC,		{ VD, VB, UIMM } },
+{ "vsr",       VX(4,  708), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsrab",     VX(4,  772), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsrah",     VX(4,  836), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsraw",     VX(4,  900), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsrb",      VX(4,  516), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsrh",      VX(4,  580), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsro",      VX(4, 1100), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsrw",      VX(4,  644), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubcuw",   VX(4, 1408), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubfp",    VX(4,   74), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubsbs",   VX(4, 1792), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubshs",   VX(4, 1856), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubsws",   VX(4, 1920), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsububm",   VX(4, 1024), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsububs",   VX(4, 1536), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubuhm",   VX(4, 1088), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubuhs",   VX(4, 1600), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubuwm",   VX(4, 1152), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsubuws",   VX(4, 1664), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsumsws",   VX(4, 1928), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsum2sws",  VX(4, 1672), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsum4sbs",  VX(4, 1800), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsum4shs",  VX(4, 1608), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vsum4ubs",  VX(4, 1544), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+{ "vupkhpx",   VX(4,  846), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vupkhsb",   VX(4,  526), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vupkhsh",   VX(4,  590), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vupklpx",   VX(4,  974), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vupklsb",   VX(4,  654), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vupklsh",   VX(4,  718), VX_MASK,	PPCVEC,		{ VD, VB } },
+{ "vxor",      VX(4, 1220), VX_MASK,	PPCVEC,		{ VD, VA, VB } },
+
+{ "evaddw",    VX(4, 512), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evaddiw",   VX(4, 514), VX_MASK,	PPCSPE,		{ RS, RB, UIMM } },
+{ "evsubfw",   VX(4, 516), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evsubw",    VX(4, 516), VX_MASK,	PPCSPE,		{ RS, RB, RA } },
+{ "evsubifw",  VX(4, 518), VX_MASK,	PPCSPE,		{ RS, UIMM, RB } },
+{ "evsubiw",   VX(4, 518), VX_MASK,	PPCSPE,		{ RS, RB, UIMM } },
+{ "evabs",     VX(4, 520), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evneg",     VX(4, 521), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evextsb",   VX(4, 522), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evextsh",   VX(4, 523), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evrndw",    VX(4, 524), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evcntlzw",  VX(4, 525), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evcntlsw",  VX(4, 526), VX_MASK,	PPCSPE,		{ RS, RA } },
+
+{ "brinc",     VX(4, 527), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evand",     VX(4, 529), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evandc",    VX(4, 530), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmr",      VX(4, 535), VX_MASK,	PPCSPE,		{ RS, RA, BBA } },
+{ "evor",      VX(4, 535), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evorc",     VX(4, 539), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evxor",     VX(4, 534), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "eveqv",     VX(4, 537), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evnand",    VX(4, 542), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evnot",     VX(4, 536), VX_MASK,	PPCSPE,		{ RS, RA, BBA } },
+{ "evnor",     VX(4, 536), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evrlw",     VX(4, 552), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evrlwi",    VX(4, 554), VX_MASK,	PPCSPE,		{ RS, RA, EVUIMM } },
+{ "evslw",     VX(4, 548), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evslwi",    VX(4, 550), VX_MASK,	PPCSPE,		{ RS, RA, EVUIMM } },
+{ "evsrws",    VX(4, 545), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evsrwu",    VX(4, 544), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evsrwis",   VX(4, 547), VX_MASK,	PPCSPE,		{ RS, RA, EVUIMM } },
+{ "evsrwiu",   VX(4, 546), VX_MASK,	PPCSPE,		{ RS, RA, EVUIMM } },
+{ "evsplati",  VX(4, 553), VX_MASK,	PPCSPE,		{ RS, SIMM } },
+{ "evsplatfi", VX(4, 555), VX_MASK,	PPCSPE,		{ RS, SIMM } },
+{ "evmergehi", VX(4, 556), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmergelo", VX(4, 557), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmergehilo",VX(4,558), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmergelohi",VX(4,559), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evcmpgts",  VX(4, 561), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evcmpgtu",  VX(4, 560), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evcmplts",  VX(4, 563), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evcmpltu",  VX(4, 562), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evcmpeq",   VX(4, 564), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evsel",     EVSEL(4,79),EVSEL_MASK,	PPCSPE,		{ RS, RA, RB, CRFS } },
+
+{ "evldd",     VX(4, 769), VX_MASK,	PPCSPE,		{ RS, EVUIMM_8, RA } },
+{ "evlddx",    VX(4, 768), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evldw",     VX(4, 771), VX_MASK,	PPCSPE,		{ RS, EVUIMM_8, RA } },
+{ "evldwx",    VX(4, 770), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evldh",     VX(4, 773), VX_MASK,	PPCSPE,		{ RS, EVUIMM_8, RA } },
+{ "evldhx",    VX(4, 772), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlwhe",    VX(4, 785), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evlwhex",   VX(4, 784), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlwhou",   VX(4, 789), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evlwhoux",  VX(4, 788), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlwhos",   VX(4, 791), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evlwhosx",  VX(4, 790), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlwwsplat",VX(4, 793), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evlwwsplatx",VX(4, 792), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlwhsplat",VX(4, 797), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evlwhsplatx",VX(4, 796), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlhhesplat",VX(4, 777), VX_MASK,	PPCSPE,		{ RS, EVUIMM_2, RA } },
+{ "evlhhesplatx",VX(4, 776), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlhhousplat",VX(4, 781), VX_MASK,	PPCSPE,		{ RS, EVUIMM_2, RA } },
+{ "evlhhousplatx",VX(4, 780), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evlhhossplat",VX(4, 783), VX_MASK,	PPCSPE,		{ RS, EVUIMM_2, RA } },
+{ "evlhhossplatx",VX(4, 782), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evstdd",    VX(4, 801), VX_MASK,	PPCSPE,		{ RS, EVUIMM_8, RA } },
+{ "evstddx",   VX(4, 800), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evstdw",    VX(4, 803), VX_MASK,	PPCSPE,		{ RS, EVUIMM_8, RA } },
+{ "evstdwx",   VX(4, 802), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evstdh",    VX(4, 805), VX_MASK,	PPCSPE,		{ RS, EVUIMM_8, RA } },
+{ "evstdhx",   VX(4, 804), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evstwwe",   VX(4, 825), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evstwwex",  VX(4, 824), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evstwwo",   VX(4, 829), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evstwwox",  VX(4, 828), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evstwhe",   VX(4, 817), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evstwhex",  VX(4, 816), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evstwho",   VX(4, 821), VX_MASK,	PPCSPE,		{ RS, EVUIMM_4, RA } },
+{ "evstwhox",  VX(4, 820), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evfsabs",   VX(4, 644), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evfsnabs",  VX(4, 645), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evfsneg",   VX(4, 646), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evfsadd",   VX(4, 640), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evfssub",   VX(4, 641), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evfsmul",   VX(4, 648), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evfsdiv",   VX(4, 649), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evfscmpgt", VX(4, 652), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evfscmplt", VX(4, 653), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evfscmpeq", VX(4, 654), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evfststgt", VX(4, 668), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evfststlt", VX(4, 669), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evfststeq", VX(4, 670), VX_MASK,	PPCSPE,		{ CRFD, RA, RB } },
+{ "evfscfui",  VX(4, 656), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfsctuiz", VX(4, 664), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfscfsi",  VX(4, 657), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfscfuf",  VX(4, 658), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfscfsf",  VX(4, 659), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfsctui",  VX(4, 660), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfsctsi",  VX(4, 661), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfsctsiz", VX(4, 666), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfsctuf",  VX(4, 662), VX_MASK,	PPCSPE,		{ RS, RB } },
+{ "evfsctsf",  VX(4, 663), VX_MASK,	PPCSPE,		{ RS, RB } },
+
+{ "efsabs",   VX(4, 708), VX_MASK,	PPCEFS,		{ RS, RA } },
+{ "efsnabs",  VX(4, 709), VX_MASK,	PPCEFS,		{ RS, RA } },
+{ "efsneg",   VX(4, 710), VX_MASK,	PPCEFS,		{ RS, RA } },
+{ "efsadd",   VX(4, 704), VX_MASK,	PPCEFS,		{ RS, RA, RB } },
+{ "efssub",   VX(4, 705), VX_MASK,	PPCEFS,		{ RS, RA, RB } },
+{ "efsmul",   VX(4, 712), VX_MASK,	PPCEFS,		{ RS, RA, RB } },
+{ "efsdiv",   VX(4, 713), VX_MASK,	PPCEFS,		{ RS, RA, RB } },
+{ "efscmpgt", VX(4, 716), VX_MASK,	PPCEFS,		{ CRFD, RA, RB } },
+{ "efscmplt", VX(4, 717), VX_MASK,	PPCEFS,		{ CRFD, RA, RB } },
+{ "efscmpeq", VX(4, 718), VX_MASK,	PPCEFS,		{ CRFD, RA, RB } },
+{ "efststgt", VX(4, 732), VX_MASK,	PPCEFS,		{ CRFD, RA, RB } },
+{ "efststlt", VX(4, 733), VX_MASK,	PPCEFS,		{ CRFD, RA, RB } },
+{ "efststeq", VX(4, 734), VX_MASK,	PPCEFS,		{ CRFD, RA, RB } },
+{ "efscfui",  VX(4, 720), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efsctuiz", VX(4, 728), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efscfsi",  VX(4, 721), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efscfuf",  VX(4, 722), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efscfsf",  VX(4, 723), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efsctui",  VX(4, 724), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efsctsi",  VX(4, 725), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efsctsiz", VX(4, 730), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efsctuf",  VX(4, 726), VX_MASK,	PPCEFS,		{ RS, RB } },
+{ "efsctsf",  VX(4, 727), VX_MASK,	PPCEFS,		{ RS, RB } },
+
+{ "evmhossf",  VX(4, 1031), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhossfa", VX(4, 1063), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmf",  VX(4, 1039), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmfa", VX(4, 1071), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmi",  VX(4, 1037), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmia", VX(4, 1069), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhoumi",  VX(4, 1036), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhoumia", VX(4, 1068), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhessf",  VX(4, 1027), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhessfa", VX(4, 1059), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmf",  VX(4, 1035), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmfa", VX(4, 1067), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmi",  VX(4, 1033), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmia", VX(4, 1065), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmheumi",  VX(4, 1032), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmheumia", VX(4, 1064), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmhossfaaw",VX(4, 1287), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhossiaaw",VX(4, 1285), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmfaaw",VX(4, 1295), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmiaaw",VX(4, 1293), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhousiaaw",VX(4, 1284), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhoumiaaw",VX(4, 1292), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhessfaaw",VX(4, 1283), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhessiaaw",VX(4, 1281), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmfaaw",VX(4, 1291), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmiaaw",VX(4, 1289), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmheusiaaw",VX(4, 1280), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmheumiaaw",VX(4, 1288), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmhossfanw",VX(4, 1415), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhossianw",VX(4, 1413), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmfanw",VX(4, 1423), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhosmianw",VX(4, 1421), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhousianw",VX(4, 1412), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhoumianw",VX(4, 1420), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhessfanw",VX(4, 1411), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhessianw",VX(4, 1409), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmfanw",VX(4, 1419), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhesmianw",VX(4, 1417), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmheusianw",VX(4, 1408), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmheumianw",VX(4, 1416), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmhogsmfaa",VX(4, 1327), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhogsmiaa",VX(4, 1325), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhogumiaa",VX(4, 1324), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhegsmfaa",VX(4, 1323), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhegsmiaa",VX(4, 1321), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhegumiaa",VX(4, 1320), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmhogsmfan",VX(4, 1455), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhogsmian",VX(4, 1453), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhogumian",VX(4, 1452), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhegsmfan",VX(4, 1451), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhegsmian",VX(4, 1449), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmhegumian",VX(4, 1448), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwhssf",  VX(4, 1095), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhssfa", VX(4, 1127), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhsmf",  VX(4, 1103), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhsmfa", VX(4, 1135), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhsmi",  VX(4, 1101), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhsmia", VX(4, 1133), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhumi",  VX(4, 1100), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwhumia", VX(4, 1132), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwlumi",  VX(4, 1096), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlumia", VX(4, 1128), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwlssiaaw",VX(4, 1345), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlsmiaaw",VX(4, 1353), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlusiaaw",VX(4, 1344), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlumiaaw",VX(4, 1352), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwlssianw",VX(4, 1473), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlsmianw",VX(4, 1481), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlusianw",VX(4, 1472), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwlumianw",VX(4, 1480), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwssf",   VX(4, 1107), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwssfa",  VX(4, 1139), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmf",   VX(4, 1115), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmfa",  VX(4, 1147), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmi",   VX(4, 1113), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmia",  VX(4, 1145), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwumi",   VX(4, 1112), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwumia",  VX(4, 1144), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwssfaa", VX(4, 1363), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmfaa", VX(4, 1371), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmiaa", VX(4, 1369), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwumiaa", VX(4, 1368), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evmwssfan", VX(4, 1491), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmfan", VX(4, 1499), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwsmian", VX(4, 1497), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evmwumian", VX(4, 1496), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "evaddssiaaw",VX(4, 1217), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evaddsmiaaw",VX(4, 1225), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evaddusiaaw",VX(4, 1216), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evaddumiaaw",VX(4, 1224), VX_MASK,	PPCSPE,		{ RS, RA } },
+
+{ "evsubfssiaaw",VX(4, 1219), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evsubfsmiaaw",VX(4, 1227), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evsubfusiaaw",VX(4, 1218), VX_MASK,	PPCSPE,		{ RS, RA } },
+{ "evsubfumiaaw",VX(4, 1226), VX_MASK,	PPCSPE,		{ RS, RA } },
+
+{ "evmra",    VX(4, 1220), VX_MASK,	PPCSPE,		{ RS, RA } },
+
+{ "evdivws",  VX(4, 1222), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+{ "evdivwu",  VX(4, 1223), VX_MASK,	PPCSPE,		{ RS, RA, RB } },
+
+{ "mulli",   OP(7),	OP_MASK,	PPCCOM,		{ RT, RA, SI } },
+{ "muli",    OP(7),	OP_MASK,	PWRCOM,		{ RT, RA, SI } },
+
+{ "subfic",  OP(8),	OP_MASK,	PPCCOM,		{ RT, RA, SI } },
+{ "sfi",     OP(8),	OP_MASK,	PWRCOM,		{ RT, RA, SI } },
+
+{ "dozi",    OP(9),	OP_MASK,	M601,		{ RT, RA, SI } },
+
+{ "bce",     B(9,0,0),	B_MASK,		BOOKE64,	{ BO, BI, BD } },
+{ "bcel",    B(9,0,1),	B_MASK,		BOOKE64,	{ BO, BI, BD } },
+{ "bcea",    B(9,1,0),	B_MASK,		BOOKE64,	{ BO, BI, BDA } },
+{ "bcela",   B(9,1,1),	B_MASK,		BOOKE64,	{ BO, BI, BDA } },
+
+{ "cmplwi",  OPL(10,0),	OPL_MASK,	PPCCOM,		{ OBF, RA, UI } },
+{ "cmpldi",  OPL(10,1), OPL_MASK,	PPC64,		{ OBF, RA, UI } },
 { "cmpli",   OP(10),	OP_MASK,	PPC,		{ BF, L, RA, UI } },
-{ "cmpli",   OP(10),	OP_MASK,	POWER,		{ BF, RA, UI } },
+{ "cmpli",   OP(10),	OP_MASK,	PWRCOM,		{ BF, RA, UI } },
 
-{ "cmpwi",   OPL(11,0),	OPL_MASK,	PPC,		{ OBF, RA, SI } },
-{ "cmpdi",   OPL(11,1),	OPL_MASK,	PPC|B64,	{ OBF, RA, SI } },
+{ "cmpwi",   OPL(11,0),	OPL_MASK,	PPCCOM,		{ OBF, RA, SI } },
+{ "cmpdi",   OPL(11,1),	OPL_MASK,	PPC64,		{ OBF, RA, SI } },
 { "cmpi",    OP(11),	OP_MASK,	PPC,		{ BF, L, RA, SI } },
-{ "cmpi",    OP(11),	OP_MASK,	POWER,		{ BF, RA, SI } },
-
-{ "addic",   OP(12),	OP_MASK,	PPC,		{ RT, RA, SI } },
-{ "ai",	     OP(12),	OP_MASK,	POWER,		{ RT, RA, SI } },
-{ "subic",   OP(12),	OP_MASK,	PPC,		{ RT, RA, NSI } },
-
-{ "addic.",  OP(13),	OP_MASK,	PPC,		{ RT, RA, SI } },
-{ "ai.",     OP(13),	OP_MASK,	POWER,		{ RT, RA, SI } },
-{ "subic.",  OP(13),	OP_MASK,	PPC,		{ RT, RA, NSI } },
-
-{ "li",	     OP(14),	DRA_MASK,	PPC,		{ RT, SI } },
-{ "lil",     OP(14),	DRA_MASK,	POWER,		{ RT, SI } },
-{ "addi",    OP(14),	OP_MASK,	PPC,		{ RT, RA, SI } },
-{ "cal",     OP(14),	OP_MASK,	POWER,		{ RT, D, RA } },
-{ "subi",    OP(14),	OP_MASK,	PPC,		{ RT, RA, NSI } },
-{ "la",	     OP(14),	OP_MASK,	PPC,		{ RT, D, RA } },
-
-{ "lis",     OP(15),	DRA_MASK,	PPC,		{ RT, SISIGNOPT } },
-{ "liu",     OP(15),	DRA_MASK,	POWER,		{ RT, SISIGNOPT } },
-{ "addis",   OP(15),	OP_MASK,	PPC,		{ RT,RA,SISIGNOPT } },
-{ "cau",     OP(15),	OP_MASK,	POWER,		{ RT,RA,SISIGNOPT } },
-{ "subis",   OP(15),	OP_MASK,	PPC,		{ RT, RA, NSI } },
-
-{ "bdnz-",   BBO(16,BODNZ,0,0), BBOYBI_MASK, PPC,	{ BDM } },
-{ "bdnz+",   BBO(16,BODNZ,0,0), BBOYBI_MASK, PPC,	{ BDP } },
-{ "bdnz",    BBO(16,BODNZ,0,0), BBOYBI_MASK, PPC,	{ BD } },
-{ "bdn",     BBO(16,BODNZ,0,0), BBOYBI_MASK, POWER,	{ BD } },
-{ "bdnzl-",  BBO(16,BODNZ,0,1), BBOYBI_MASK, PPC,	{ BDM } },
-{ "bdnzl+",  BBO(16,BODNZ,0,1), BBOYBI_MASK, PPC,	{ BDP } },
-{ "bdnzl",   BBO(16,BODNZ,0,1), BBOYBI_MASK, PPC,	{ BD } },
-{ "bdnl",    BBO(16,BODNZ,0,1), BBOYBI_MASK, POWER,	{ BD } },
-{ "bdnza-",  BBO(16,BODNZ,1,0), BBOYBI_MASK, PPC,	{ BDMA } },
-{ "bdnza+",  BBO(16,BODNZ,1,0), BBOYBI_MASK, PPC,	{ BDPA } },
-{ "bdnza",   BBO(16,BODNZ,1,0), BBOYBI_MASK, PPC,	{ BDA } },
-{ "bdna",    BBO(16,BODNZ,1,0), BBOYBI_MASK, POWER,	{ BDA } },
-{ "bdnzla-", BBO(16,BODNZ,1,1), BBOYBI_MASK, PPC,	{ BDMA } },
-{ "bdnzla+", BBO(16,BODNZ,1,1), BBOYBI_MASK, PPC,	{ BDPA } },
-{ "bdnzla",  BBO(16,BODNZ,1,1), BBOYBI_MASK, PPC,	{ BDA } },
-{ "bdnla",   BBO(16,BODNZ,1,1), BBOYBI_MASK, POWER,	{ BDA } },
-{ "bdz-",    BBO(16,BODZ,0,0), BBOYBI_MASK, PPC,	{ BDM } },
-{ "bdz+",    BBO(16,BODZ,0,0), BBOYBI_MASK, PPC,	{ BDP } },
-{ "bdz",     BBO(16,BODZ,0,0), BBOYBI_MASK, PPC|POWER,	{ BD } },
-{ "bdzl-",   BBO(16,BODZ,0,1), BBOYBI_MASK, PPC,	{ BDM } },
-{ "bdzl+",   BBO(16,BODZ,0,1), BBOYBI_MASK, PPC,	{ BDP } },
-{ "bdzl",    BBO(16,BODZ,0,1), BBOYBI_MASK, PPC|POWER,	{ BD } },
-{ "bdza-",   BBO(16,BODZ,1,0), BBOYBI_MASK, PPC,	{ BDMA } },
-{ "bdza+",   BBO(16,BODZ,1,0), BBOYBI_MASK, PPC,	{ BDPA } },
-{ "bdza",    BBO(16,BODZ,1,0), BBOYBI_MASK, PPC|POWER,	{ BDA } },
-{ "bdzla-",  BBO(16,BODZ,1,1), BBOYBI_MASK, PPC,	{ BDMA } },
-{ "bdzla+",  BBO(16,BODZ,1,1), BBOYBI_MASK, PPC,	{ BDPA } },
-{ "bdzla",   BBO(16,BODZ,1,1), BBOYBI_MASK, PPC|POWER,	{ BDA } },
-{ "blt-",    BBOCB(16,BOT,CBLT,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "blt+",    BBOCB(16,BOT,CBLT,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "blt",     BBOCB(16,BOT,CBLT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bltl-",   BBOCB(16,BOT,CBLT,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bltl+",   BBOCB(16,BOT,CBLT,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bltl",    BBOCB(16,BOT,CBLT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "blta-",   BBOCB(16,BOT,CBLT,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "blta+",   BBOCB(16,BOT,CBLT,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "blta",    BBOCB(16,BOT,CBLT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bltla-",  BBOCB(16,BOT,CBLT,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bltla+",  BBOCB(16,BOT,CBLT,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bltla",   BBOCB(16,BOT,CBLT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bgt-",    BBOCB(16,BOT,CBGT,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bgt+",    BBOCB(16,BOT,CBGT,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bgt",     BBOCB(16,BOT,CBGT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bgtl-",   BBOCB(16,BOT,CBGT,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bgtl+",   BBOCB(16,BOT,CBGT,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bgtl",    BBOCB(16,BOT,CBGT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bgta-",   BBOCB(16,BOT,CBGT,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bgta+",   BBOCB(16,BOT,CBGT,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bgta",    BBOCB(16,BOT,CBGT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bgtla-",  BBOCB(16,BOT,CBGT,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bgtla+",  BBOCB(16,BOT,CBGT,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bgtla",   BBOCB(16,BOT,CBGT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "beq-",    BBOCB(16,BOT,CBEQ,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "beq+",    BBOCB(16,BOT,CBEQ,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "beq",     BBOCB(16,BOT,CBEQ,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "beql-",   BBOCB(16,BOT,CBEQ,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "beql+",   BBOCB(16,BOT,CBEQ,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "beql",    BBOCB(16,BOT,CBEQ,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "beqa-",   BBOCB(16,BOT,CBEQ,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "beqa+",   BBOCB(16,BOT,CBEQ,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "beqa",    BBOCB(16,BOT,CBEQ,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "beqla-",  BBOCB(16,BOT,CBEQ,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "beqla+",  BBOCB(16,BOT,CBEQ,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "beqla",   BBOCB(16,BOT,CBEQ,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bso-",    BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bso+",    BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bso",     BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bsol-",   BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bsol+",   BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bsol",    BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bsoa-",   BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bsoa+",   BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bsoa",    BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bsola-",  BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bsola+",  BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bsola",   BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bun-",    BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bun+",    BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bun",     BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BD } },
-{ "bunl-",   BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bunl+",   BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bunl",    BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BD } },
-{ "buna-",   BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "buna+",   BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "buna",    BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDA } },
-{ "bunla-",  BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bunla+",  BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bunla",   BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDA } },
-{ "bge-",    BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bge+",    BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bge",     BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bgel-",   BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bgel+",   BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bgel",    BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bgea-",   BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bgea+",   BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bgea",    BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bgela-",  BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bgela+",  BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bgela",   BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bnl-",    BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bnl+",    BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bnl",     BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnll-",   BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bnll+",   BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bnll",    BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnla-",   BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnla+",   BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnla",    BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bnlla-",  BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnlla+",  BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnlla",   BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "ble-",    BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "ble+",    BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "ble",     BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "blel-",   BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "blel+",   BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "blel",    BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "blea-",   BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "blea+",   BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "blea",    BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "blela-",  BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "blela+",  BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "blela",   BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bng-",    BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bng+",    BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bng",     BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bngl-",   BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bngl+",   BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bngl",    BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnga-",   BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnga+",   BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnga",    BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bngla-",  BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bngla+",  BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bngla",   BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bne-",    BBOCB(16,BOF,CBEQ,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bne+",    BBOCB(16,BOF,CBEQ,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bne",     BBOCB(16,BOF,CBEQ,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnel-",   BBOCB(16,BOF,CBEQ,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bnel+",   BBOCB(16,BOF,CBEQ,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bnel",    BBOCB(16,BOF,CBEQ,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnea-",   BBOCB(16,BOF,CBEQ,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnea+",   BBOCB(16,BOF,CBEQ,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnea",    BBOCB(16,BOF,CBEQ,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bnela-",  BBOCB(16,BOF,CBEQ,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnela+",  BBOCB(16,BOF,CBEQ,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnela",   BBOCB(16,BOF,CBEQ,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bns-",    BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bns+",    BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bns",     BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnsl-",   BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bnsl+",   BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bnsl",    BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
-{ "bnsa-",   BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnsa+",   BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnsa",    BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bnsla-",  BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnsla+",  BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnsla",   BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
-{ "bnu-",    BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bnu+",    BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bnu",     BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC,	{ CR, BD } },
-{ "bnul-",   BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDM } },
-{ "bnul+",   BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BDP } },
-{ "bnul",    BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC,	{ CR, BD } },
-{ "bnua-",   BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnua+",   BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnua",    BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC,	{ CR, BDA } },
-{ "bnula-",  BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDMA } },
-{ "bnula+",  BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDPA } },
-{ "bnula",   BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC,	{ CR, BDA } },
-{ "bdnzt-",  BBO(16,BODNZT,0,0), BBOY_MASK, PPC,	{ BI, BDM } },
-{ "bdnzt+",  BBO(16,BODNZT,0,0), BBOY_MASK, PPC,	{ BI, BDP } },
-{ "bdnzt",   BBO(16,BODNZT,0,0), BBOY_MASK, PPC,	{ BI, BD } },
-{ "bdnztl-", BBO(16,BODNZT,0,1), BBOY_MASK, PPC,	{ BI, BDM } },
-{ "bdnztl+", BBO(16,BODNZT,0,1), BBOY_MASK, PPC,	{ BI, BDP } },
-{ "bdnztl",  BBO(16,BODNZT,0,1), BBOY_MASK, PPC,	{ BI, BD } },
-{ "bdnzta-", BBO(16,BODNZT,1,0), BBOY_MASK, PPC,	{ BI, BDMA } },
-{ "bdnzta+", BBO(16,BODNZT,1,0), BBOY_MASK, PPC,	{ BI, BDPA } },
-{ "bdnzta",  BBO(16,BODNZT,1,0), BBOY_MASK, PPC,	{ BI, BDA } },
-{ "bdnztla-",BBO(16,BODNZT,1,1), BBOY_MASK, PPC,	{ BI, BDMA } },
-{ "bdnztla+",BBO(16,BODNZT,1,1), BBOY_MASK, PPC,	{ BI, BDPA } },
-{ "bdnztla", BBO(16,BODNZT,1,1), BBOY_MASK, PPC,	{ BI, BDA } },
-{ "bdnzf-",  BBO(16,BODNZF,0,0), BBOY_MASK, PPC,	{ BI, BDM } },
-{ "bdnzf+",  BBO(16,BODNZF,0,0), BBOY_MASK, PPC,	{ BI, BDP } },
-{ "bdnzf",   BBO(16,BODNZF,0,0), BBOY_MASK, PPC,	{ BI, BD } },
-{ "bdnzfl-", BBO(16,BODNZF,0,1), BBOY_MASK, PPC,	{ BI, BDM } },
-{ "bdnzfl+", BBO(16,BODNZF,0,1), BBOY_MASK, PPC,	{ BI, BDP } },
-{ "bdnzfl",  BBO(16,BODNZF,0,1), BBOY_MASK, PPC,	{ BI, BD } },
-{ "bdnzfa-", BBO(16,BODNZF,1,0), BBOY_MASK, PPC,	{ BI, BDMA } },
-{ "bdnzfa+", BBO(16,BODNZF,1,0), BBOY_MASK, PPC,	{ BI, BDPA } },
-{ "bdnzfa",  BBO(16,BODNZF,1,0), BBOY_MASK, PPC,	{ BI, BDA } },
-{ "bdnzfla-",BBO(16,BODNZF,1,1), BBOY_MASK, PPC,	{ BI, BDMA } },
-{ "bdnzfla+",BBO(16,BODNZF,1,1), BBOY_MASK, PPC,	{ BI, BDPA } },
-{ "bdnzfla", BBO(16,BODNZF,1,1), BBOY_MASK, PPC,	{ BI, BDA } },
-{ "bt-",     BBO(16,BOT,0,0), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bt+",     BBO(16,BOT,0,0), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bt",	     BBO(16,BOT,0,0), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bbt",     BBO(16,BOT,0,0), BBOY_MASK, POWER,		{ BI, BD } },
-{ "btl-",    BBO(16,BOT,0,1), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "btl+",    BBO(16,BOT,0,1), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "btl",     BBO(16,BOT,0,1), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bbtl",    BBO(16,BOT,0,1), BBOY_MASK, POWER,		{ BI, BD } },
-{ "bta-",    BBO(16,BOT,1,0), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bta+",    BBO(16,BOT,1,0), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bta",     BBO(16,BOT,1,0), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bbta",    BBO(16,BOT,1,0), BBOY_MASK, POWER,		{ BI, BDA } },
-{ "btla-",   BBO(16,BOT,1,1), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "btla+",   BBO(16,BOT,1,1), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "btla",    BBO(16,BOT,1,1), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bbtla",   BBO(16,BOT,1,1), BBOY_MASK, POWER,		{ BI, BDA } },
-{ "bf-",     BBO(16,BOF,0,0), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bf+",     BBO(16,BOF,0,0), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bf",	     BBO(16,BOF,0,0), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bbf",     BBO(16,BOF,0,0), BBOY_MASK, POWER,		{ BI, BD } },
-{ "bfl-",    BBO(16,BOF,0,1), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bfl+",    BBO(16,BOF,0,1), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bfl",     BBO(16,BOF,0,1), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bbfl",    BBO(16,BOF,0,1), BBOY_MASK, POWER,		{ BI, BD } },
-{ "bfa-",    BBO(16,BOF,1,0), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bfa+",    BBO(16,BOF,1,0), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bfa",     BBO(16,BOF,1,0), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bbfa",    BBO(16,BOF,1,0), BBOY_MASK, POWER,		{ BI, BDA } },
-{ "bfla-",   BBO(16,BOF,1,1), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bfla+",   BBO(16,BOF,1,1), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bfla",    BBO(16,BOF,1,1), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bbfla",   BBO(16,BOF,1,1), BBOY_MASK, POWER,		{ BI, BDA } },
-{ "bdzt-",   BBO(16,BODZT,0,0), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bdzt+",   BBO(16,BODZT,0,0), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bdzt",    BBO(16,BODZT,0,0), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bdztl-",  BBO(16,BODZT,0,1), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bdztl+",  BBO(16,BODZT,0,1), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bdztl",   BBO(16,BODZT,0,1), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bdzta-",  BBO(16,BODZT,1,0), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bdzta+",  BBO(16,BODZT,1,0), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bdzta",   BBO(16,BODZT,1,0), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bdztla-", BBO(16,BODZT,1,1), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bdztla+", BBO(16,BODZT,1,1), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bdztla",  BBO(16,BODZT,1,1), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bdzf-",   BBO(16,BODZF,0,0), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bdzf+",   BBO(16,BODZF,0,0), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bdzf",    BBO(16,BODZF,0,0), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bdzfl-",  BBO(16,BODZF,0,1), BBOY_MASK, PPC,		{ BI, BDM } },
-{ "bdzfl+",  BBO(16,BODZF,0,1), BBOY_MASK, PPC,		{ BI, BDP } },
-{ "bdzfl",   BBO(16,BODZF,0,1), BBOY_MASK, PPC,		{ BI, BD } },
-{ "bdzfa-",  BBO(16,BODZF,1,0), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bdzfa+",  BBO(16,BODZF,1,0), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bdzfa",   BBO(16,BODZF,1,0), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bdzfla-", BBO(16,BODZF,1,1), BBOY_MASK, PPC,		{ BI, BDMA } },
-{ "bdzfla+", BBO(16,BODZF,1,1), BBOY_MASK, PPC,		{ BI, BDPA } },
-{ "bdzfla",  BBO(16,BODZF,1,1), BBOY_MASK, PPC,		{ BI, BDA } },
-{ "bc-",     B(16,0,0),	B_MASK,		PPC,		{ BOE, BI, BDM } },
-{ "bc+",     B(16,0,0),	B_MASK,		PPC,		{ BOE, BI, BDP } },
-{ "bc",	     B(16,0,0),	B_MASK,		PPC|POWER,	{ BO, BI, BD } },
-{ "bcl-",    B(16,0,1),	B_MASK,		PPC,		{ BOE, BI, BDM } },
-{ "bcl+",    B(16,0,1),	B_MASK,		PPC,		{ BOE, BI, BDP } },
-{ "bcl",     B(16,0,1),	B_MASK,		PPC|POWER,	{ BO, BI, BD } },
-{ "bca-",    B(16,1,0),	B_MASK,		PPC,		{ BOE, BI, BDMA } },
-{ "bca+",    B(16,1,0),	B_MASK,		PPC,		{ BOE, BI, BDPA } },
-{ "bca",     B(16,1,0),	B_MASK,		PPC|POWER,	{ BO, BI, BDA } },
-{ "bcla-",   B(16,1,1),	B_MASK,		PPC,		{ BOE, BI, BDMA } },
-{ "bcla+",   B(16,1,1),	B_MASK,		PPC,		{ BOE, BI, BDPA } },
-{ "bcla",    B(16,1,1),	B_MASK,		PPC|POWER,	{ BO, BI, BDA } },
+{ "cmpi",    OP(11),	OP_MASK,	PWRCOM,		{ BF, RA, SI } },
+
+{ "addic",   OP(12),	OP_MASK,	PPCCOM,		{ RT, RA, SI } },
+{ "ai",	     OP(12),	OP_MASK,	PWRCOM,		{ RT, RA, SI } },
+{ "subic",   OP(12),	OP_MASK,	PPCCOM,		{ RT, RA, NSI } },
+
+{ "addic.",  OP(13),	OP_MASK,	PPCCOM,		{ RT, RA, SI } },
+{ "ai.",     OP(13),	OP_MASK,	PWRCOM,		{ RT, RA, SI } },
+{ "subic.",  OP(13),	OP_MASK,	PPCCOM,		{ RT, RA, NSI } },
+
+{ "li",	     OP(14),	DRA_MASK,	PPCCOM,		{ RT, SI } },
+{ "lil",     OP(14),	DRA_MASK,	PWRCOM,		{ RT, SI } },
+{ "addi",    OP(14),	OP_MASK,	PPCCOM,		{ RT, RA, SI } },
+{ "cal",     OP(14),	OP_MASK,	PWRCOM,		{ RT, D, RA } },
+{ "subi",    OP(14),	OP_MASK,	PPCCOM,		{ RT, RA, NSI } },
+{ "la",	     OP(14),	OP_MASK,	PPCCOM,		{ RT, D, RA } },
+
+{ "lis",     OP(15),	DRA_MASK,	PPCCOM,		{ RT, SISIGNOPT } },
+{ "liu",     OP(15),	DRA_MASK,	PWRCOM,		{ RT, SISIGNOPT } },
+{ "addis",   OP(15),	OP_MASK,	PPCCOM,		{ RT,RA,SISIGNOPT } },
+{ "cau",     OP(15),	OP_MASK,	PWRCOM,		{ RT,RA,SISIGNOPT } },
+{ "subis",   OP(15),	OP_MASK,	PPCCOM,		{ RT, RA, NSI } },
+
+{ "bdnz-",   BBO(16,BODNZ,0,0),      BBOATBI_MASK, PPCCOM,	{ BDM } },
+{ "bdnz+",   BBO(16,BODNZ,0,0),      BBOATBI_MASK, PPCCOM,	{ BDP } },
+{ "bdnz",    BBO(16,BODNZ,0,0),      BBOATBI_MASK, PPCCOM,	{ BD } },
+{ "bdn",     BBO(16,BODNZ,0,0),      BBOATBI_MASK, PWRCOM,	{ BD } },
+{ "bdnzl-",  BBO(16,BODNZ,0,1),      BBOATBI_MASK, PPCCOM,	{ BDM } },
+{ "bdnzl+",  BBO(16,BODNZ,0,1),      BBOATBI_MASK, PPCCOM,	{ BDP } },
+{ "bdnzl",   BBO(16,BODNZ,0,1),      BBOATBI_MASK, PPCCOM,	{ BD } },
+{ "bdnl",    BBO(16,BODNZ,0,1),      BBOATBI_MASK, PWRCOM,	{ BD } },
+{ "bdnza-",  BBO(16,BODNZ,1,0),      BBOATBI_MASK, PPCCOM,	{ BDMA } },
+{ "bdnza+",  BBO(16,BODNZ,1,0),      BBOATBI_MASK, PPCCOM,	{ BDPA } },
+{ "bdnza",   BBO(16,BODNZ,1,0),      BBOATBI_MASK, PPCCOM,	{ BDA } },
+{ "bdna",    BBO(16,BODNZ,1,0),      BBOATBI_MASK, PWRCOM,	{ BDA } },
+{ "bdnzla-", BBO(16,BODNZ,1,1),      BBOATBI_MASK, PPCCOM,	{ BDMA } },
+{ "bdnzla+", BBO(16,BODNZ,1,1),      BBOATBI_MASK, PPCCOM,	{ BDPA } },
+{ "bdnzla",  BBO(16,BODNZ,1,1),      BBOATBI_MASK, PPCCOM,	{ BDA } },
+{ "bdnla",   BBO(16,BODNZ,1,1),      BBOATBI_MASK, PWRCOM,	{ BDA } },
+{ "bdz-",    BBO(16,BODZ,0,0),       BBOATBI_MASK, PPCCOM,	{ BDM } },
+{ "bdz+",    BBO(16,BODZ,0,0),       BBOATBI_MASK, PPCCOM,	{ BDP } },
+{ "bdz",     BBO(16,BODZ,0,0),       BBOATBI_MASK, COM,		{ BD } },
+{ "bdzl-",   BBO(16,BODZ,0,1),       BBOATBI_MASK, PPCCOM,	{ BDM } },
+{ "bdzl+",   BBO(16,BODZ,0,1),       BBOATBI_MASK, PPCCOM,	{ BDP } },
+{ "bdzl",    BBO(16,BODZ,0,1),       BBOATBI_MASK, COM,		{ BD } },
+{ "bdza-",   BBO(16,BODZ,1,0),       BBOATBI_MASK, PPCCOM,	{ BDMA } },
+{ "bdza+",   BBO(16,BODZ,1,0),       BBOATBI_MASK, PPCCOM,	{ BDPA } },
+{ "bdza",    BBO(16,BODZ,1,0),       BBOATBI_MASK, COM,		{ BDA } },
+{ "bdzla-",  BBO(16,BODZ,1,1),       BBOATBI_MASK, PPCCOM,	{ BDMA } },
+{ "bdzla+",  BBO(16,BODZ,1,1),       BBOATBI_MASK, PPCCOM,	{ BDPA } },
+{ "bdzla",   BBO(16,BODZ,1,1),       BBOATBI_MASK, COM,		{ BDA } },
+{ "blt-",    BBOCB(16,BOT,CBLT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "blt+",    BBOCB(16,BOT,CBLT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "blt",     BBOCB(16,BOT,CBLT,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bltl-",   BBOCB(16,BOT,CBLT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bltl+",   BBOCB(16,BOT,CBLT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bltl",    BBOCB(16,BOT,CBLT,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "blta-",   BBOCB(16,BOT,CBLT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "blta+",   BBOCB(16,BOT,CBLT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "blta",    BBOCB(16,BOT,CBLT,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bltla-",  BBOCB(16,BOT,CBLT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bltla+",  BBOCB(16,BOT,CBLT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bltla",   BBOCB(16,BOT,CBLT,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bgt-",    BBOCB(16,BOT,CBGT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bgt+",    BBOCB(16,BOT,CBGT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bgt",     BBOCB(16,BOT,CBGT,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bgtl-",   BBOCB(16,BOT,CBGT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bgtl+",   BBOCB(16,BOT,CBGT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bgtl",    BBOCB(16,BOT,CBGT,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bgta-",   BBOCB(16,BOT,CBGT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bgta+",   BBOCB(16,BOT,CBGT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bgta",    BBOCB(16,BOT,CBGT,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bgtla-",  BBOCB(16,BOT,CBGT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bgtla+",  BBOCB(16,BOT,CBGT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bgtla",   BBOCB(16,BOT,CBGT,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "beq-",    BBOCB(16,BOT,CBEQ,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "beq+",    BBOCB(16,BOT,CBEQ,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "beq",     BBOCB(16,BOT,CBEQ,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "beql-",   BBOCB(16,BOT,CBEQ,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "beql+",   BBOCB(16,BOT,CBEQ,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "beql",    BBOCB(16,BOT,CBEQ,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "beqa-",   BBOCB(16,BOT,CBEQ,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "beqa+",   BBOCB(16,BOT,CBEQ,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "beqa",    BBOCB(16,BOT,CBEQ,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "beqla-",  BBOCB(16,BOT,CBEQ,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "beqla+",  BBOCB(16,BOT,CBEQ,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "beqla",   BBOCB(16,BOT,CBEQ,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bso-",    BBOCB(16,BOT,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bso+",    BBOCB(16,BOT,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bso",     BBOCB(16,BOT,CBSO,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bsol-",   BBOCB(16,BOT,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bsol+",   BBOCB(16,BOT,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bsol",    BBOCB(16,BOT,CBSO,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bsoa-",   BBOCB(16,BOT,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bsoa+",   BBOCB(16,BOT,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bsoa",    BBOCB(16,BOT,CBSO,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bsola-",  BBOCB(16,BOT,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bsola+",  BBOCB(16,BOT,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bsola",   BBOCB(16,BOT,CBSO,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bun-",    BBOCB(16,BOT,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bun+",    BBOCB(16,BOT,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bun",     BBOCB(16,BOT,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BD } },
+{ "bunl-",   BBOCB(16,BOT,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bunl+",   BBOCB(16,BOT,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bunl",    BBOCB(16,BOT,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BD } },
+{ "buna-",   BBOCB(16,BOT,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "buna+",   BBOCB(16,BOT,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "buna",    BBOCB(16,BOT,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDA } },
+{ "bunla-",  BBOCB(16,BOT,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bunla+",  BBOCB(16,BOT,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bunla",   BBOCB(16,BOT,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDA } },
+{ "bge-",    BBOCB(16,BOF,CBLT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bge+",    BBOCB(16,BOF,CBLT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bge",     BBOCB(16,BOF,CBLT,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bgel-",   BBOCB(16,BOF,CBLT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bgel+",   BBOCB(16,BOF,CBLT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bgel",    BBOCB(16,BOF,CBLT,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bgea-",   BBOCB(16,BOF,CBLT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bgea+",   BBOCB(16,BOF,CBLT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bgea",    BBOCB(16,BOF,CBLT,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bgela-",  BBOCB(16,BOF,CBLT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bgela+",  BBOCB(16,BOF,CBLT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bgela",   BBOCB(16,BOF,CBLT,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bnl-",    BBOCB(16,BOF,CBLT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bnl+",    BBOCB(16,BOF,CBLT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bnl",     BBOCB(16,BOF,CBLT,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnll-",   BBOCB(16,BOF,CBLT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bnll+",   BBOCB(16,BOF,CBLT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bnll",    BBOCB(16,BOF,CBLT,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnla-",   BBOCB(16,BOF,CBLT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnla+",   BBOCB(16,BOF,CBLT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnla",    BBOCB(16,BOF,CBLT,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bnlla-",  BBOCB(16,BOF,CBLT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnlla+",  BBOCB(16,BOF,CBLT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnlla",   BBOCB(16,BOF,CBLT,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "ble-",    BBOCB(16,BOF,CBGT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "ble+",    BBOCB(16,BOF,CBGT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "ble",     BBOCB(16,BOF,CBGT,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "blel-",   BBOCB(16,BOF,CBGT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "blel+",   BBOCB(16,BOF,CBGT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "blel",    BBOCB(16,BOF,CBGT,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "blea-",   BBOCB(16,BOF,CBGT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "blea+",   BBOCB(16,BOF,CBGT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "blea",    BBOCB(16,BOF,CBGT,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "blela-",  BBOCB(16,BOF,CBGT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "blela+",  BBOCB(16,BOF,CBGT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "blela",   BBOCB(16,BOF,CBGT,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bng-",    BBOCB(16,BOF,CBGT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bng+",    BBOCB(16,BOF,CBGT,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bng",     BBOCB(16,BOF,CBGT,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bngl-",   BBOCB(16,BOF,CBGT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bngl+",   BBOCB(16,BOF,CBGT,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bngl",    BBOCB(16,BOF,CBGT,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnga-",   BBOCB(16,BOF,CBGT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnga+",   BBOCB(16,BOF,CBGT,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnga",    BBOCB(16,BOF,CBGT,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bngla-",  BBOCB(16,BOF,CBGT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bngla+",  BBOCB(16,BOF,CBGT,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bngla",   BBOCB(16,BOF,CBGT,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bne-",    BBOCB(16,BOF,CBEQ,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bne+",    BBOCB(16,BOF,CBEQ,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bne",     BBOCB(16,BOF,CBEQ,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnel-",   BBOCB(16,BOF,CBEQ,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bnel+",   BBOCB(16,BOF,CBEQ,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bnel",    BBOCB(16,BOF,CBEQ,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnea-",   BBOCB(16,BOF,CBEQ,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnea+",   BBOCB(16,BOF,CBEQ,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnea",    BBOCB(16,BOF,CBEQ,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bnela-",  BBOCB(16,BOF,CBEQ,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnela+",  BBOCB(16,BOF,CBEQ,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnela",   BBOCB(16,BOF,CBEQ,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bns-",    BBOCB(16,BOF,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bns+",    BBOCB(16,BOF,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bns",     BBOCB(16,BOF,CBSO,0,0), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnsl-",   BBOCB(16,BOF,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bnsl+",   BBOCB(16,BOF,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bnsl",    BBOCB(16,BOF,CBSO,0,1), BBOATCB_MASK, COM,		{ CR, BD } },
+{ "bnsa-",   BBOCB(16,BOF,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnsa+",   BBOCB(16,BOF,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnsa",    BBOCB(16,BOF,CBSO,1,0), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bnsla-",  BBOCB(16,BOF,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnsla+",  BBOCB(16,BOF,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnsla",   BBOCB(16,BOF,CBSO,1,1), BBOATCB_MASK, COM,		{ CR, BDA } },
+{ "bnu-",    BBOCB(16,BOF,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bnu+",    BBOCB(16,BOF,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bnu",     BBOCB(16,BOF,CBSO,0,0), BBOATCB_MASK, PPCCOM,	{ CR, BD } },
+{ "bnul-",   BBOCB(16,BOF,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDM } },
+{ "bnul+",   BBOCB(16,BOF,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BDP } },
+{ "bnul",    BBOCB(16,BOF,CBSO,0,1), BBOATCB_MASK, PPCCOM,	{ CR, BD } },
+{ "bnua-",   BBOCB(16,BOF,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnua+",   BBOCB(16,BOF,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnua",    BBOCB(16,BOF,CBSO,1,0), BBOATCB_MASK, PPCCOM,	{ CR, BDA } },
+{ "bnula-",  BBOCB(16,BOF,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDMA } },
+{ "bnula+",  BBOCB(16,BOF,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDPA } },
+{ "bnula",   BBOCB(16,BOF,CBSO,1,1), BBOATCB_MASK, PPCCOM,	{ CR, BDA } },
+{ "bdnzt-",  BBO(16,BODNZT,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdnzt+",  BBO(16,BODNZT,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdnzt",   BBO(16,BODNZT,0,0), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdnztl-", BBO(16,BODNZT,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdnztl+", BBO(16,BODNZT,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdnztl",  BBO(16,BODNZT,0,1), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdnzta-", BBO(16,BODNZT,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdnzta+", BBO(16,BODNZT,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdnzta",  BBO(16,BODNZT,1,0), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bdnztla-",BBO(16,BODNZT,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdnztla+",BBO(16,BODNZT,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdnztla", BBO(16,BODNZT,1,1), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bdnzf-",  BBO(16,BODNZF,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdnzf+",  BBO(16,BODNZF,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdnzf",   BBO(16,BODNZF,0,0), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdnzfl-", BBO(16,BODNZF,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdnzfl+", BBO(16,BODNZF,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdnzfl",  BBO(16,BODNZF,0,1), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdnzfa-", BBO(16,BODNZF,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdnzfa+", BBO(16,BODNZF,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdnzfa",  BBO(16,BODNZF,1,0), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bdnzfla-",BBO(16,BODNZF,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdnzfla+",BBO(16,BODNZF,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdnzfla", BBO(16,BODNZF,1,1), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bt-",     BBO(16,BOT,0,0), BBOAT_MASK, PPCCOM,	{ BI, BDM } },
+{ "bt+",     BBO(16,BOT,0,0), BBOAT_MASK, PPCCOM,	{ BI, BDP } },
+{ "bt",	     BBO(16,BOT,0,0), BBOAT_MASK, PPCCOM,	{ BI, BD } },
+{ "bbt",     BBO(16,BOT,0,0), BBOAT_MASK, PWRCOM,	{ BI, BD } },
+{ "btl-",    BBO(16,BOT,0,1), BBOAT_MASK, PPCCOM,	{ BI, BDM } },
+{ "btl+",    BBO(16,BOT,0,1), BBOAT_MASK, PPCCOM,	{ BI, BDP } },
+{ "btl",     BBO(16,BOT,0,1), BBOAT_MASK, PPCCOM,	{ BI, BD } },
+{ "bbtl",    BBO(16,BOT,0,1), BBOAT_MASK, PWRCOM,	{ BI, BD } },
+{ "bta-",    BBO(16,BOT,1,0), BBOAT_MASK, PPCCOM,	{ BI, BDMA } },
+{ "bta+",    BBO(16,BOT,1,0), BBOAT_MASK, PPCCOM,	{ BI, BDPA } },
+{ "bta",     BBO(16,BOT,1,0), BBOAT_MASK, PPCCOM,	{ BI, BDA } },
+{ "bbta",    BBO(16,BOT,1,0), BBOAT_MASK, PWRCOM,	{ BI, BDA } },
+{ "btla-",   BBO(16,BOT,1,1), BBOAT_MASK, PPCCOM,	{ BI, BDMA } },
+{ "btla+",   BBO(16,BOT,1,1), BBOAT_MASK, PPCCOM,	{ BI, BDPA } },
+{ "btla",    BBO(16,BOT,1,1), BBOAT_MASK, PPCCOM,	{ BI, BDA } },
+{ "bbtla",   BBO(16,BOT,1,1), BBOAT_MASK, PWRCOM,	{ BI, BDA } },
+{ "bf-",     BBO(16,BOF,0,0), BBOAT_MASK, PPCCOM,	{ BI, BDM } },
+{ "bf+",     BBO(16,BOF,0,0), BBOAT_MASK, PPCCOM,	{ BI, BDP } },
+{ "bf",	     BBO(16,BOF,0,0), BBOAT_MASK, PPCCOM,	{ BI, BD } },
+{ "bbf",     BBO(16,BOF,0,0), BBOAT_MASK, PWRCOM,	{ BI, BD } },
+{ "bfl-",    BBO(16,BOF,0,1), BBOAT_MASK, PPCCOM,	{ BI, BDM } },
+{ "bfl+",    BBO(16,BOF,0,1), BBOAT_MASK, PPCCOM,	{ BI, BDP } },
+{ "bfl",     BBO(16,BOF,0,1), BBOAT_MASK, PPCCOM,	{ BI, BD } },
+{ "bbfl",    BBO(16,BOF,0,1), BBOAT_MASK, PWRCOM,	{ BI, BD } },
+{ "bfa-",    BBO(16,BOF,1,0), BBOAT_MASK, PPCCOM,	{ BI, BDMA } },
+{ "bfa+",    BBO(16,BOF,1,0), BBOAT_MASK, PPCCOM,	{ BI, BDPA } },
+{ "bfa",     BBO(16,BOF,1,0), BBOAT_MASK, PPCCOM,	{ BI, BDA } },
+{ "bbfa",    BBO(16,BOF,1,0), BBOAT_MASK, PWRCOM,	{ BI, BDA } },
+{ "bfla-",   BBO(16,BOF,1,1), BBOAT_MASK, PPCCOM,	{ BI, BDMA } },
+{ "bfla+",   BBO(16,BOF,1,1), BBOAT_MASK, PPCCOM,	{ BI, BDPA } },
+{ "bfla",    BBO(16,BOF,1,1), BBOAT_MASK, PPCCOM,	{ BI, BDA } },
+{ "bbfla",   BBO(16,BOF,1,1), BBOAT_MASK, PWRCOM,	{ BI, BDA } },
+{ "bdzt-",   BBO(16,BODZT,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdzt+",   BBO(16,BODZT,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdzt",    BBO(16,BODZT,0,0), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdztl-",  BBO(16,BODZT,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdztl+",  BBO(16,BODZT,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdztl",   BBO(16,BODZT,0,1), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdzta-",  BBO(16,BODZT,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdzta+",  BBO(16,BODZT,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdzta",   BBO(16,BODZT,1,0), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bdztla-", BBO(16,BODZT,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdztla+", BBO(16,BODZT,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdztla",  BBO(16,BODZT,1,1), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bdzf-",   BBO(16,BODZF,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdzf+",   BBO(16,BODZF,0,0), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdzf",    BBO(16,BODZF,0,0), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdzfl-",  BBO(16,BODZF,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDM } },
+{ "bdzfl+",  BBO(16,BODZF,0,1), BBOY_MASK, NOPOWER4,	{ BI, BDP } },
+{ "bdzfl",   BBO(16,BODZF,0,1), BBOY_MASK, PPCCOM,	{ BI, BD } },
+{ "bdzfa-",  BBO(16,BODZF,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdzfa+",  BBO(16,BODZF,1,0), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdzfa",   BBO(16,BODZF,1,0), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bdzfla-", BBO(16,BODZF,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDMA } },
+{ "bdzfla+", BBO(16,BODZF,1,1), BBOY_MASK, NOPOWER4,	{ BI, BDPA } },
+{ "bdzfla",  BBO(16,BODZF,1,1), BBOY_MASK, PPCCOM,	{ BI, BDA } },
+{ "bc-",     B(16,0,0),	B_MASK,		PPCCOM,		{ BOE, BI, BDM } },
+{ "bc+",     B(16,0,0),	B_MASK,		PPCCOM,		{ BOE, BI, BDP } },
+{ "bc",	     B(16,0,0),	B_MASK,		COM,		{ BO, BI, BD } },
+{ "bcl-",    B(16,0,1),	B_MASK,		PPCCOM,		{ BOE, BI, BDM } },
+{ "bcl+",    B(16,0,1),	B_MASK,		PPCCOM,		{ BOE, BI, BDP } },
+{ "bcl",     B(16,0,1),	B_MASK,		COM,		{ BO, BI, BD } },
+{ "bca-",    B(16,1,0),	B_MASK,		PPCCOM,		{ BOE, BI, BDMA } },
+{ "bca+",    B(16,1,0),	B_MASK,		PPCCOM,		{ BOE, BI, BDPA } },
+{ "bca",     B(16,1,0),	B_MASK,		COM,		{ BO, BI, BDA } },
+{ "bcla-",   B(16,1,1),	B_MASK,		PPCCOM,		{ BOE, BI, BDMA } },
+{ "bcla+",   B(16,1,1),	B_MASK,		PPCCOM,		{ BOE, BI, BDPA } },
+{ "bcla",    B(16,1,1),	B_MASK,		COM,		{ BO, BI, BDA } },
 
 { "sc",      SC(17,1,0), 0xffffffff,	PPC,		{ 0 } },
 { "svc",     SC(17,0,0), SC_MASK,	POWER,		{ LEV, FL1, FL2 } },
 { "svcl",    SC(17,0,1), SC_MASK,	POWER,		{ LEV, FL1, FL2 } },
-{ "svca",    SC(17,1,0), SC_MASK,	POWER,		{ SV } },
+{ "svca",    SC(17,1,0), SC_MASK,	PWRCOM,		{ SV } },
 { "svcla",   SC(17,1,1), SC_MASK,	POWER,		{ SV } },
 
-{ "b",	     B(18,0,0),	B_MASK,		PPC|POWER,	{ LI } },
-{ "bl",      B(18,0,1),	B_MASK,		PPC|POWER,	{ LI } },
-{ "ba",      B(18,1,0),	B_MASK,		PPC|POWER,	{ LIA } },
-{ "bla",     B(18,1,1),	B_MASK,		PPC|POWER,	{ LIA } },
-
-{ "mcrf",    XL(19,0),	XLBB_MASK|(3<<21)|(3<<16), PPC|POWER, { BF, BFA } },
-
-{ "blr",     XLO(19,BOU,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "br",      XLO(19,BOU,16,0), XLBOBIBB_MASK, POWER,	{ 0 } },
-{ "blrl",    XLO(19,BOU,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "brl",     XLO(19,BOU,16,1), XLBOBIBB_MASK, POWER,	{ 0 } },
-{ "bdnzlr",  XLO(19,BODNZ,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdnzlr-", XLO(19,BODNZ,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdnzlr+", XLO(19,BODNZP,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdnzlrl", XLO(19,BODNZ,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdnzlrl-",XLO(19,BODNZ,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdnzlrl+",XLO(19,BODNZP,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdzlr",   XLO(19,BODZ,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdzlr-",  XLO(19,BODZ,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdzlr+",  XLO(19,BODZP,16,0), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdzlrl",  XLO(19,BODZ,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdzlrl-", XLO(19,BODZ,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bdzlrl+", XLO(19,BODZP,16,1), XLBOBIBB_MASK, PPC,	{ 0 } },
-{ "bltlr",   XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltlr-",  XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltlr+",  XLOCB(19,BOTP,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltr",    XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bltlrl",  XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltlrl-", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltlrl+", XLOCB(19,BOTP,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltrl",   XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bgtlr",   XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtlr-",  XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtlr+",  XLOCB(19,BOTP,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtr",    XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bgtlrl",  XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtlrl-", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtlrl+", XLOCB(19,BOTP,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtrl",   XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "beqlr",   XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqlr-",  XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqlr+",  XLOCB(19,BOTP,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqr",    XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "beqlrl",  XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqlrl-", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqlrl+", XLOCB(19,BOTP,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqrl",   XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bsolr",   XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsolr-",  XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsolr+",  XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsor",    XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bsolrl",  XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsolrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsolrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsorl",   XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bunlr",   XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunlr-",  XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunlr+",  XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunlrl",  XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunlrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunlrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgelr",   XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgelr-",  XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgelr+",  XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bger",    XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bgelrl",  XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgelrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgelrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgerl",   XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnllr",   XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnllr-",  XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnllr+",  XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlr",    XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnllrl",  XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnllrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnllrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlrl",   XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "blelr",   XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "blelr-",  XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "blelr+",  XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bler",    XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "blelrl",  XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "blelrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "blelrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "blerl",   XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnglr",   XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnglr-",  XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnglr+",  XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngr",    XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnglrl",  XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnglrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnglrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngrl",   XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnelr",   XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnelr-",  XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnelr+",  XLOCB(19,BOFP,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bner",    XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnelrl",  XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnelrl-", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnelrl+", XLOCB(19,BOFP,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnerl",   XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnslr",   XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnslr-",  XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnslr+",  XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsr",    XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnslrl",  XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnslrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnslrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsrl",   XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, POWER, { CR } },
-{ "bnulr",   XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnulr-",  XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnulr+",  XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnulrl",  XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnulrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnulrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "btlr",    XLO(19,BOT,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "btlr-",   XLO(19,BOT,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "btlr+",   XLO(19,BOTP,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bbtr",    XLO(19,BOT,16,0), XLBOBB_MASK, POWER,	{ BI } },
-{ "btlrl",   XLO(19,BOT,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "btlrl-",  XLO(19,BOT,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "btlrl+",  XLO(19,BOTP,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bbtrl",   XLO(19,BOT,16,1), XLBOBB_MASK, POWER,	{ BI } },
-{ "bflr",    XLO(19,BOF,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bflr-",   XLO(19,BOF,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bflr+",   XLO(19,BOFP,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bbfr",    XLO(19,BOF,16,0), XLBOBB_MASK, POWER,	{ BI } },
-{ "bflrl",   XLO(19,BOF,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bflrl-",  XLO(19,BOF,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bflrl+",  XLO(19,BOFP,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bbfrl",   XLO(19,BOF,16,1), XLBOBB_MASK, POWER,	{ BI } },
-{ "bdnztlr", XLO(19,BODNZT,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnztlr-",XLO(19,BODNZT,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnztlr+",XLO(19,BODNZTP,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnztlrl",XLO(19,BODNZT,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnztlrl-",XLO(19,BODNZT,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnztlrl+",XLO(19,BODNZTP,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnzflr", XLO(19,BODNZF,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnzflr-",XLO(19,BODNZF,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnzflr+",XLO(19,BODNZFP,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnzflrl",XLO(19,BODNZF,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnzflrl-",XLO(19,BODNZF,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdnzflrl+",XLO(19,BODNZFP,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdztlr",  XLO(19,BODZT,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdztlr-", XLO(19,BODZT,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdztlr+", XLO(19,BODZTP,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdztlrl", XLO(19,BODZT,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdztlrl-",XLO(19,BODZT,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdztlrl+",XLO(19,BODZTP,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdzflr",  XLO(19,BODZF,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdzflr-", XLO(19,BODZF,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdzflr+", XLO(19,BODZFP,16,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdzflrl", XLO(19,BODZF,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdzflrl-",XLO(19,BODZF,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bdzflrl+",XLO(19,BODZFP,16,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bclr",    XLLK(19,16,0), XLYBB_MASK,	PPC,		{ BO, BI } },
-{ "bclrl",   XLLK(19,16,1), XLYBB_MASK,	PPC,		{ BO, BI } },
-{ "bclr+",   XLYLK(19,16,1,0), XLYBB_MASK, PPC,		{ BOE, BI } },
-{ "bclrl+",  XLYLK(19,16,1,1), XLYBB_MASK, PPC,		{ BOE, BI } },
-{ "bclr-",   XLYLK(19,16,0,0), XLYBB_MASK, PPC,		{ BOE, BI } },
-{ "bclrl-",  XLYLK(19,16,0,1), XLYBB_MASK, PPC,		{ BOE, BI } },
-{ "bcr",     XLLK(19,16,0), XLBB_MASK,	POWER,		{ BO, BI } },
-{ "bcrl",    XLLK(19,16,1), XLBB_MASK,	POWER,		{ BO, BI } },
-
-{ "crnot",   XL(19,33), XL_MASK,	PPC,		{ BT, BA, BBA } },
-{ "crnor",   XL(19,33),	XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "rfi",     XL(19,50),	0xffffffff,	PPC|POWER,	{ 0 } },
-{ "rfci",    XL(19,51),	0xffffffff,	PPC,		{ 0 } },
+{ "b",	     B(18,0,0),	B_MASK,		COM,		{ LI } },
+{ "bl",      B(18,0,1),	B_MASK,		COM,		{ LI } },
+{ "ba",      B(18,1,0),	B_MASK,		COM,		{ LIA } },
+{ "bla",     B(18,1,1),	B_MASK,		COM,		{ LIA } },
+
+{ "mcrf",    XL(19,0),	XLBB_MASK|(3 << 21)|(3 << 16), COM,	{ BF, BFA } },
+
+{ "blr",     XLO(19,BOU,16,0), XLBOBIBB_MASK, PPCCOM,	{ 0 } },
+{ "br",      XLO(19,BOU,16,0), XLBOBIBB_MASK, PWRCOM,	{ 0 } },
+{ "blrl",    XLO(19,BOU,16,1), XLBOBIBB_MASK, PPCCOM,	{ 0 } },
+{ "brl",     XLO(19,BOU,16,1), XLBOBIBB_MASK, PWRCOM,	{ 0 } },
+{ "bdnzlr",  XLO(19,BODNZ,16,0), XLBOBIBB_MASK, PPCCOM,	{ 0 } },
+{ "bdnzlr-", XLO(19,BODNZ,16,0), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdnzlr-", XLO(19,BODNZM4,16,0), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdnzlr+", XLO(19,BODNZP,16,0), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdnzlr+", XLO(19,BODNZP4,16,0), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdnzlrl", XLO(19,BODNZ,16,1), XLBOBIBB_MASK, PPCCOM,	{ 0 } },
+{ "bdnzlrl-",XLO(19,BODNZ,16,1), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdnzlrl-",XLO(19,BODNZM4,16,1), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdnzlrl+",XLO(19,BODNZP,16,1), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdnzlrl+",XLO(19,BODNZP4,16,1), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdzlr",   XLO(19,BODZ,16,0), XLBOBIBB_MASK, PPCCOM,	{ 0 } },
+{ "bdzlr-",  XLO(19,BODZ,16,0), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdzlr-",  XLO(19,BODZM4,16,0), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdzlr+",  XLO(19,BODZP,16,0), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdzlr+",  XLO(19,BODZP4,16,0), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdzlrl",  XLO(19,BODZ,16,1), XLBOBIBB_MASK, PPCCOM,	{ 0 } },
+{ "bdzlrl-", XLO(19,BODZ,16,1), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdzlrl-", XLO(19,BODZM4,16,1), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bdzlrl+", XLO(19,BODZP,16,1), XLBOBIBB_MASK, NOPOWER4,	{ 0 } },
+{ "bdzlrl+", XLO(19,BODZP4,16,1), XLBOBIBB_MASK, POWER4,	{ 0 } },
+{ "bltlr",   XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bltlr-",  XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltlr-",  XLOCB(19,BOTM4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltlr+",  XLOCB(19,BOTP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltlr+",  XLOCB(19,BOTP4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltr",    XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bltlrl",  XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bltlrl-", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltlrl-", XLOCB(19,BOTM4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltlrl+", XLOCB(19,BOTP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltlrl+", XLOCB(19,BOTP4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltrl",   XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bgtlr",   XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bgtlr-",  XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtlr-",  XLOCB(19,BOTM4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtlr+",  XLOCB(19,BOTP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtlr+",  XLOCB(19,BOTP4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtr",    XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bgtlrl",  XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bgtlrl-", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtlrl-", XLOCB(19,BOTM4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtlrl+", XLOCB(19,BOTP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtlrl+", XLOCB(19,BOTP4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtrl",   XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "beqlr",   XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "beqlr-",  XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqlr-",  XLOCB(19,BOTM4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqlr+",  XLOCB(19,BOTP,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqlr+",  XLOCB(19,BOTP4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqr",    XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "beqlrl",  XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "beqlrl-", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqlrl-", XLOCB(19,BOTM4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqlrl+", XLOCB(19,BOTP,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqlrl+", XLOCB(19,BOTP4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqrl",   XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bsolr",   XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bsolr-",  XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsolr-",  XLOCB(19,BOTM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsolr+",  XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsolr+",  XLOCB(19,BOTP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsor",    XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bsolrl",  XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bsolrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsolrl-", XLOCB(19,BOTM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsolrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsolrl+", XLOCB(19,BOTP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsorl",   XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bunlr",   XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bunlr-",  XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunlr-",  XLOCB(19,BOTM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunlr+",  XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunlr+",  XLOCB(19,BOTP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunlrl",  XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bunlrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunlrl-", XLOCB(19,BOTM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunlrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunlrl+", XLOCB(19,BOTP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgelr",   XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bgelr-",  XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgelr-",  XLOCB(19,BOFM4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgelr+",  XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgelr+",  XLOCB(19,BOFP4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bger",    XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bgelrl",  XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bgelrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgelrl-", XLOCB(19,BOFM4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgelrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgelrl+", XLOCB(19,BOFP4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgerl",   XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnllr",   XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnllr-",  XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnllr-",  XLOCB(19,BOFM4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnllr+",  XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnllr+",  XLOCB(19,BOFP4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlr",    XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnllrl",  XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnllrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnllrl-", XLOCB(19,BOFM4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnllrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnllrl+", XLOCB(19,BOFP4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlrl",   XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "blelr",   XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "blelr-",  XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blelr-",  XLOCB(19,BOFM4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blelr+",  XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blelr+",  XLOCB(19,BOFP4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bler",    XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "blelrl",  XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "blelrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blelrl-", XLOCB(19,BOFM4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blelrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blelrl+", XLOCB(19,BOFP4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blerl",   XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnglr",   XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnglr-",  XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnglr-",  XLOCB(19,BOFM4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnglr+",  XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnglr+",  XLOCB(19,BOFP4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngr",    XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnglrl",  XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnglrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnglrl-", XLOCB(19,BOFM4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnglrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnglrl+", XLOCB(19,BOFP4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngrl",   XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnelr",   XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnelr-",  XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnelr-",  XLOCB(19,BOFM4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnelr+",  XLOCB(19,BOFP,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnelr+",  XLOCB(19,BOFP4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bner",    XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnelrl",  XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnelrl-", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnelrl-", XLOCB(19,BOFM4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnelrl+", XLOCB(19,BOFP,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnelrl+", XLOCB(19,BOFP4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnerl",   XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnslr",   XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnslr-",  XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnslr-",  XLOCB(19,BOFM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnslr+",  XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnslr+",  XLOCB(19,BOFP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsr",    XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnslrl",  XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnslrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnslrl-", XLOCB(19,BOFM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnslrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnslrl+", XLOCB(19,BOFP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsrl",   XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
+{ "bnulr",   XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnulr-",  XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnulr-",  XLOCB(19,BOFM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnulr+",  XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnulr+",  XLOCB(19,BOFP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnulrl",  XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
+{ "bnulrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnulrl-", XLOCB(19,BOFM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnulrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnulrl+", XLOCB(19,BOFP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "btlr",    XLO(19,BOT,16,0), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "btlr-",   XLO(19,BOT,16,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btlr-",   XLO(19,BOTM4,16,0), XLBOBB_MASK, POWER4,	{ BI } },
+{ "btlr+",   XLO(19,BOTP,16,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btlr+",   XLO(19,BOTP4,16,0), XLBOBB_MASK, POWER4,	{ BI } },
+{ "bbtr",    XLO(19,BOT,16,0), XLBOBB_MASK, PWRCOM,	{ BI } },
+{ "btlrl",   XLO(19,BOT,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "btlrl-",  XLO(19,BOT,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btlrl-",  XLO(19,BOTM4,16,1), XLBOBB_MASK, POWER4,	{ BI } },
+{ "btlrl+",  XLO(19,BOTP,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btlrl+",  XLO(19,BOTP4,16,1), XLBOBB_MASK, POWER4,	{ BI } },
+{ "bbtrl",   XLO(19,BOT,16,1), XLBOBB_MASK, PWRCOM,	{ BI } },
+{ "bflr",    XLO(19,BOF,16,0), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bflr-",   XLO(19,BOF,16,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bflr-",   XLO(19,BOFM4,16,0), XLBOBB_MASK, POWER4,	{ BI } },
+{ "bflr+",   XLO(19,BOFP,16,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bflr+",   XLO(19,BOFP4,16,0), XLBOBB_MASK, POWER4,	{ BI } },
+{ "bbfr",    XLO(19,BOF,16,0), XLBOBB_MASK, PWRCOM,	{ BI } },
+{ "bflrl",   XLO(19,BOF,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bflrl-",  XLO(19,BOF,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bflrl-",  XLO(19,BOFM4,16,1), XLBOBB_MASK, POWER4,	{ BI } },
+{ "bflrl+",  XLO(19,BOFP,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bflrl+",  XLO(19,BOFP4,16,1), XLBOBB_MASK, POWER4,	{ BI } },
+{ "bbfrl",   XLO(19,BOF,16,1), XLBOBB_MASK, PWRCOM,	{ BI } },
+{ "bdnztlr", XLO(19,BODNZT,16,0), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdnztlr-",XLO(19,BODNZT,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnztlr+",XLO(19,BODNZTP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnztlrl",XLO(19,BODNZT,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdnztlrl-",XLO(19,BODNZT,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnztlrl+",XLO(19,BODNZTP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnzflr", XLO(19,BODNZF,16,0), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdnzflr-",XLO(19,BODNZF,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnzflr+",XLO(19,BODNZFP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnzflrl",XLO(19,BODNZF,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdnzflrl-",XLO(19,BODNZF,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdnzflrl+",XLO(19,BODNZFP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdztlr",  XLO(19,BODZT,16,0), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdztlr-", XLO(19,BODZT,16,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bdztlr+", XLO(19,BODZTP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdztlrl", XLO(19,BODZT,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdztlrl-",XLO(19,BODZT,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bdztlrl+",XLO(19,BODZTP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdzflr",  XLO(19,BODZF,16,0), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdzflr-", XLO(19,BODZF,16,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bdzflr+", XLO(19,BODZFP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bdzflrl", XLO(19,BODZF,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bdzflrl-",XLO(19,BODZF,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "bdzflrl+",XLO(19,BODZFP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bclr",    XLLK(19,16,0), XLYBB_MASK,	PPCCOM,		{ BO, BI } },
+{ "bclrl",   XLLK(19,16,1), XLYBB_MASK,	PPCCOM,		{ BO, BI } },
+{ "bclr+",   XLYLK(19,16,1,0), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
+{ "bclrl+",  XLYLK(19,16,1,1), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
+{ "bclr-",   XLYLK(19,16,0,0), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
+{ "bclrl-",  XLYLK(19,16,0,1), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
+{ "bcr",     XLLK(19,16,0), XLBB_MASK,	PWRCOM,		{ BO, BI } },
+{ "bcrl",    XLLK(19,16,1), XLBB_MASK,	PWRCOM,		{ BO, BI } },
+{ "bclre",   XLLK(19,17,0), XLBB_MASK,	BOOKE64,	{ BO, BI } },
+{ "bclrel",  XLLK(19,17,1), XLBB_MASK,	BOOKE64,	{ BO, BI } },
+
+{ "rfid",    XL(19,18),	0xffffffff,	PPC64,		{ 0 } },
+
+{ "crnot",   XL(19,33), XL_MASK,	PPCCOM,		{ BT, BA, BBA } },
+{ "crnor",   XL(19,33),	XL_MASK,	COM,		{ BT, BA, BB } },
+{ "rfmci",    X(19,38), 0xffffffff,	PPCRFMCI,	{ 0 } },
+
+{ "rfi",     XL(19,50),	0xffffffff,	COM,		{ 0 } },
+{ "rfci",    XL(19,51),	0xffffffff,	PPC403 | BOOKE,	{ 0 } },
 
 { "rfsvc",   XL(19,82),	0xffffffff,	POWER,		{ 0 } },
 
-{ "crandc",  XL(19,129), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "isync",   XL(19,150), 0xffffffff,	PPC,		{ 0 } },
-{ "ics",     XL(19,150), 0xffffffff,	POWER,		{ 0 } },
-
-{ "crclr",   XL(19,193), XL_MASK,	PPC,		{ BT, BAT, BBA } },
-{ "crxor",   XL(19,193), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "crnand",  XL(19,225), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "crand",   XL(19,257), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "crset",   XL(19,289), XL_MASK,	PPC,		{ BT, BAT, BBA } },
-{ "creqv",   XL(19,289), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "crorc",   XL(19,417), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "crmove",  XL(19,449), XL_MASK,	PPC,		{ BT, BA, BBA } },
-{ "cror",    XL(19,449), XL_MASK,	PPC|POWER,	{ BT, BA, BB } },
-
-{ "bctr",    XLO(19,BOU,528,0), XLBOBIBB_MASK, PPC|POWER, { 0 } },
-{ "bctrl",   XLO(19,BOU,528,1), XLBOBIBB_MASK, PPC|POWER, { 0 } },
-{ "bltctr",  XLOCB(19,BOT,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltctr-", XLOCB(19,BOT,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltctr+", XLOCB(19,BOTP,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltctrl", XLOCB(19,BOT,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltctrl-",XLOCB(19,BOT,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bltctrl+",XLOCB(19,BOTP,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtctr",  XLOCB(19,BOT,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtctr-", XLOCB(19,BOT,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtctr+", XLOCB(19,BOTP,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtctrl", XLOCB(19,BOT,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtctrl-",XLOCB(19,BOT,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgtctrl+",XLOCB(19,BOTP,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqctr",  XLOCB(19,BOT,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqctr-", XLOCB(19,BOT,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqctr+", XLOCB(19,BOTP,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqctrl", XLOCB(19,BOT,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqctrl-",XLOCB(19,BOT,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "beqctrl+",XLOCB(19,BOTP,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsoctr",  XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsoctr-", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsoctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsoctrl", XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsoctrl-",XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bsoctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunctr",  XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunctr-", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunctrl", XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunctrl-",XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bunctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgectr",  XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgectr-", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgectr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgectrl", XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgectrl-",XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bgectrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlctr",  XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlctr-", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlctr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlctrl", XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlctrl-",XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnlctrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "blectr",  XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "blectr-", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "blectr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "blectrl", XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "blectrl-",XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "blectrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngctr",  XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngctr-", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngctr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngctrl", XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngctrl-",XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bngctrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnectr",  XLOCB(19,BOF,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnectr-", XLOCB(19,BOF,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnectr+", XLOCB(19,BOFP,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnectrl", XLOCB(19,BOF,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnectrl-",XLOCB(19,BOF,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnectrl+",XLOCB(19,BOFP,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsctr",  XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsctr-", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsctrl", XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsctrl-",XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnsctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnuctr",  XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnuctr-", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnuctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnuctrl", XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnuctrl-",XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "bnuctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
-{ "btctr",   XLO(19,BOT,528,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "btctr-",  XLO(19,BOT,528,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "btctr+",  XLO(19,BOTP,528,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "btctrl",  XLO(19,BOT,528,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "btctrl-", XLO(19,BOT,528,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "btctrl+", XLO(19,BOTP,528,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bfctr",   XLO(19,BOF,528,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bfctr-",  XLO(19,BOF,528,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bfctr+",  XLO(19,BOFP,528,0), XLBOBB_MASK, PPC,	{ BI } },
-{ "bfctrl",  XLO(19,BOF,528,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bfctrl-", XLO(19,BOF,528,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bfctrl+", XLO(19,BOFP,528,1), XLBOBB_MASK, PPC,	{ BI } },
-{ "bcctr",   XLLK(19,528,0), XLYBB_MASK, PPC,		{ BO, BI } },
-{ "bcctr-",  XLYLK(19,528,0,0), XLYBB_MASK, PPC,	{ BOE, BI } },
-{ "bcctr+",  XLYLK(19,528,1,0), XLYBB_MASK, PPC,	{ BOE, BI } },
-{ "bcctrl",  XLLK(19,528,1), XLYBB_MASK, PPC,		{ BO, BI } },
-{ "bcctrl-", XLYLK(19,528,0,1), XLYBB_MASK, PPC,	{ BOE, BI } },
-{ "bcctrl+", XLYLK(19,528,1,1), XLYBB_MASK, PPC,	{ BOE, BI } },
-{ "bcc",     XLLK(19,528,0), XLBB_MASK,	POWER,		{ BO, BI } },
-{ "bccl",    XLLK(19,528,1), XLBB_MASK,	POWER,		{ BO, BI } },
-
-{ "rlwimi",  M(20,0),	M_MASK,		PPC,		{ RA,RS,SH,MBE,ME } },
-{ "rlimi",   M(20,0),	M_MASK,		POWER,		{ RA,RS,SH,MBE,ME } },
-
-{ "rlwimi.", M(20,1),	M_MASK,		PPC,		{ RA,RS,SH,MBE,ME } },
-{ "rlimi.",  M(20,1),	M_MASK,		POWER,		{ RA,RS,SH,MBE,ME } },
-
-{ "rotlwi",  MME(21,31,0), MMBME_MASK,	PPC,		{ RA, RS, SH } },
-{ "clrlwi",  MME(21,31,0), MSHME_MASK,	PPC,		{ RA, RS, MB } },
-{ "rlwinm",  M(21,0),	M_MASK,		PPC,		{ RA,RS,SH,MBE,ME } },
-{ "rlinm",   M(21,0),	M_MASK,		POWER,		{ RA,RS,SH,MBE,ME } },
-{ "rotlwi.", MME(21,31,1), MMBME_MASK,	PPC,		{ RA,RS,SH } },
-{ "clrlwi.", MME(21,31,1), MSHME_MASK,	PPC,		{ RA, RS, MB } },
-{ "rlwinm.", M(21,1),	M_MASK,		PPC,		{ RA,RS,SH,MBE,ME } },
-{ "rlinm.",  M(21,1),	M_MASK,		POWER,		{ RA,RS,SH,MBE,ME } },
-
-{ "rlmi",    M(22,0),	M_MASK,		POWER|M601,	{ RA,RS,RB,MBE,ME } },
-{ "rlmi.",   M(22,1),	M_MASK,		POWER|M601,	{ RA,RS,RB,MBE,ME } },
-
-{ "rotlw",   MME(23,31,0), MMBME_MASK,	PPC,		{ RA, RS, RB } },
-{ "rlwnm",   M(23,0),	M_MASK,		PPC,		{ RA,RS,RB,MBE,ME } },
-{ "rlnm",    M(23,0),	M_MASK,		POWER,		{ RA,RS,RB,MBE,ME } },
-{ "rotlw.",  MME(23,31,1), MMBME_MASK,	PPC,		{ RA, RS, RB } },
-{ "rlwnm.",  M(23,1),	M_MASK,		PPC,		{ RA,RS,RB,MBE,ME } },
-{ "rlnm.",   M(23,1),	M_MASK,		POWER,		{ RA,RS,RB,MBE,ME } },
-
-{ "nop",     OP(24),	0xffffffff,	PPC,		{ 0 } },
-{ "ori",     OP(24),	OP_MASK,	PPC,		{ RA, RS, UI } },
-{ "oril",    OP(24),	OP_MASK,	POWER,		{ RA, RS, UI } },
-
-{ "oris",    OP(25),	OP_MASK,	PPC,		{ RA, RS, UI } },
-{ "oriu",    OP(25),	OP_MASK,	POWER,		{ RA, RS, UI } },
-
-{ "xori",    OP(26),	OP_MASK,	PPC,		{ RA, RS, UI } },
-{ "xoril",   OP(26),	OP_MASK,	POWER,		{ RA, RS, UI } },
-
-{ "xoris",   OP(27),	OP_MASK,	PPC,		{ RA, RS, UI } },
-{ "xoriu",   OP(27),	OP_MASK,	POWER,		{ RA, RS, UI } },
-
-{ "andi.",   OP(28),	OP_MASK,	PPC,		{ RA, RS, UI } },
-{ "andil.",  OP(28),	OP_MASK,	POWER,		{ RA, RS, UI } },
-
-{ "andis.",  OP(29),	OP_MASK,	PPC,		{ RA, RS, UI } },
-{ "andiu.",  OP(29),	OP_MASK,	POWER,		{ RA, RS, UI } },
-
-{ "rotldi",  MD(30,0,0), MDMB_MASK,	PPC|B64,	{ RA, RS, SH6 } },
-{ "clrldi",  MD(30,0,0), MDSH_MASK,	PPC|B64,	{ RA, RS, MB6 } },
-{ "rldicl",  MD(30,0,0), MD_MASK,	PPC|B64,	{ RA, RS, SH6, MB6 } },
-{ "rotldi.", MD(30,0,1), MDMB_MASK,	PPC|B64,	{ RA, RS, SH6 } },
-{ "clrldi.", MD(30,0,1), MDSH_MASK,	PPC|B64,	{ RA, RS, MB6 } },
-{ "rldicl.", MD(30,0,1), MD_MASK,	PPC|B64,	{ RA, RS, SH6, MB6 } },
-
-{ "rldicr",  MD(30,1,0), MD_MASK,	PPC|B64,	{ RA, RS, SH6, ME6 } },
-{ "rldicr.", MD(30,1,1), MD_MASK,	PPC|B64,	{ RA, RS, SH6, ME6 } },
-
-{ "rldic",   MD(30,2,0), MD_MASK,	PPC|B64,	{ RA, RS, SH6, MB6 } },
-{ "rldic.",  MD(30,2,1), MD_MASK,	PPC|B64,	{ RA, RS, SH6, MB6 } },
-
-{ "rldimi",  MD(30,3,0), MD_MASK,	PPC|B64,	{ RA, RS, SH6, MB6 } },
-{ "rldimi.", MD(30,3,1), MD_MASK,	PPC|B64,	{ RA, RS, SH6, MB6 } },
-
-{ "rotld",   MDS(30,8,0), MDSMB_MASK,	PPC|B64,	{ RA, RS, RB } },
-{ "rldcl",   MDS(30,8,0), MDS_MASK,	PPC|B64,	{ RA, RS, RB, MB6 } },
-{ "rotld.",  MDS(30,8,1), MDSMB_MASK,	PPC|B64,	{ RA, RS, RB } },
-{ "rldcl.",  MDS(30,8,1), MDS_MASK,	PPC|B64,	{ RA, RS, RB, MB6 } },
-
-{ "rldcr",   MDS(30,9,0), MDS_MASK,	PPC|B64,	{ RA, RS, RB, ME6 } },
-{ "rldcr.",  MDS(30,9,1), MDS_MASK,	PPC|B64,	{ RA, RS, RB, ME6 } },
-
-{ "cmpw",    XCMPL(31,0,0), XCMPL_MASK, PPC,		{ OBF, RA, RB } },
-{ "cmpd",    XCMPL(31,0,1), XCMPL_MASK, PPC|B64,	{ OBF, RA, RB } },
+{ "crandc",  XL(19,129), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "isync",   XL(19,150), 0xffffffff,	PPCCOM,		{ 0 } },
+{ "ics",     XL(19,150), 0xffffffff,	PWRCOM,		{ 0 } },
+
+{ "crclr",   XL(19,193), XL_MASK,	PPCCOM,		{ BT, BAT, BBA } },
+{ "crxor",   XL(19,193), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "crnand",  XL(19,225), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "crand",   XL(19,257), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "crset",   XL(19,289), XL_MASK,	PPCCOM,		{ BT, BAT, BBA } },
+{ "creqv",   XL(19,289), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "crorc",   XL(19,417), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "crmove",  XL(19,449), XL_MASK,	PPCCOM,		{ BT, BA, BBA } },
+{ "cror",    XL(19,449), XL_MASK,	COM,		{ BT, BA, BB } },
+
+{ "bctr",    XLO(19,BOU,528,0), XLBOBIBB_MASK, COM,	{ 0 } },
+{ "bctrl",   XLO(19,BOU,528,1), XLBOBIBB_MASK, COM,	{ 0 } },
+{ "bltctr",  XLOCB(19,BOT,CBLT,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bltctr-", XLOCB(19,BOT,CBLT,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltctr-", XLOCB(19,BOTM4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltctr+", XLOCB(19,BOTP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltctr+", XLOCB(19,BOTP4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltctrl", XLOCB(19,BOT,CBLT,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bltctrl-",XLOCB(19,BOT,CBLT,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltctrl-",XLOCB(19,BOTM4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltctrl+",XLOCB(19,BOTP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bltctrl+",XLOCB(19,BOTP4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtctr",  XLOCB(19,BOT,CBGT,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bgtctr-", XLOCB(19,BOT,CBGT,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtctr-", XLOCB(19,BOTM4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtctr+", XLOCB(19,BOTP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtctr+", XLOCB(19,BOTP4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtctrl", XLOCB(19,BOT,CBGT,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bgtctrl-",XLOCB(19,BOT,CBGT,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtctrl-",XLOCB(19,BOTM4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtctrl+",XLOCB(19,BOTP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgtctrl+",XLOCB(19,BOTP4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqctr",  XLOCB(19,BOT,CBEQ,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "beqctr-", XLOCB(19,BOT,CBEQ,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqctr-", XLOCB(19,BOTM4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqctr+", XLOCB(19,BOTP,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqctr+", XLOCB(19,BOTP4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqctrl", XLOCB(19,BOT,CBEQ,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "beqctrl-",XLOCB(19,BOT,CBEQ,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqctrl-",XLOCB(19,BOTM4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqctrl+",XLOCB(19,BOTP,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "beqctrl+",XLOCB(19,BOTP4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsoctr",  XLOCB(19,BOT,CBSO,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bsoctr-", XLOCB(19,BOT,CBSO,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsoctr-", XLOCB(19,BOTM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsoctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsoctr+", XLOCB(19,BOTP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsoctrl", XLOCB(19,BOT,CBSO,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bsoctrl-",XLOCB(19,BOT,CBSO,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsoctrl-",XLOCB(19,BOTM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsoctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bsoctrl+",XLOCB(19,BOTP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunctr",  XLOCB(19,BOT,CBSO,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bunctr-", XLOCB(19,BOT,CBSO,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunctr-", XLOCB(19,BOTM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunctr+", XLOCB(19,BOTP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunctrl", XLOCB(19,BOT,CBSO,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bunctrl-",XLOCB(19,BOT,CBSO,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunctrl-",XLOCB(19,BOTM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bunctrl+",XLOCB(19,BOTP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgectr",  XLOCB(19,BOF,CBLT,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bgectr-", XLOCB(19,BOF,CBLT,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgectr-", XLOCB(19,BOFM4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgectr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgectr+", XLOCB(19,BOFP4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgectrl", XLOCB(19,BOF,CBLT,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bgectrl-",XLOCB(19,BOF,CBLT,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgectrl-",XLOCB(19,BOFM4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgectrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bgectrl+",XLOCB(19,BOFP4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlctr",  XLOCB(19,BOF,CBLT,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnlctr-", XLOCB(19,BOF,CBLT,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnlctr-", XLOCB(19,BOFM4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlctr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnlctr+", XLOCB(19,BOFP4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlctrl", XLOCB(19,BOF,CBLT,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnlctrl-",XLOCB(19,BOF,CBLT,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnlctrl-",XLOCB(19,BOFM4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlctrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnlctrl+",XLOCB(19,BOFP4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blectr",  XLOCB(19,BOF,CBGT,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "blectr-", XLOCB(19,BOF,CBGT,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blectr-", XLOCB(19,BOFM4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blectr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blectr+", XLOCB(19,BOFP4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blectrl", XLOCB(19,BOF,CBGT,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "blectrl-",XLOCB(19,BOF,CBGT,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blectrl-",XLOCB(19,BOFM4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blectrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "blectrl+",XLOCB(19,BOFP4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngctr",  XLOCB(19,BOF,CBGT,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bngctr-", XLOCB(19,BOF,CBGT,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bngctr-", XLOCB(19,BOFM4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngctr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bngctr+", XLOCB(19,BOFP4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngctrl", XLOCB(19,BOF,CBGT,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bngctrl-",XLOCB(19,BOF,CBGT,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bngctrl-",XLOCB(19,BOFM4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngctrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bngctrl+",XLOCB(19,BOFP4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnectr",  XLOCB(19,BOF,CBEQ,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnectr-", XLOCB(19,BOF,CBEQ,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnectr-", XLOCB(19,BOFM4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnectr+", XLOCB(19,BOFP,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnectr+", XLOCB(19,BOFP4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnectrl", XLOCB(19,BOF,CBEQ,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnectrl-",XLOCB(19,BOF,CBEQ,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnectrl-",XLOCB(19,BOFM4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnectrl+",XLOCB(19,BOFP,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnectrl+",XLOCB(19,BOFP4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsctr",  XLOCB(19,BOF,CBSO,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnsctr-", XLOCB(19,BOF,CBSO,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnsctr-", XLOCB(19,BOFM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnsctr+", XLOCB(19,BOFP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsctrl", XLOCB(19,BOF,CBSO,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnsctrl-",XLOCB(19,BOF,CBSO,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnsctrl-",XLOCB(19,BOFM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnsctrl+",XLOCB(19,BOFP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnuctr",  XLOCB(19,BOF,CBSO,528,0),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnuctr-", XLOCB(19,BOF,CBSO,528,0),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnuctr-", XLOCB(19,BOFM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnuctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnuctr+", XLOCB(19,BOFP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnuctrl", XLOCB(19,BOF,CBSO,528,1),  XLBOCBBB_MASK, PPCCOM,	{ CR } },
+{ "bnuctrl-",XLOCB(19,BOF,CBSO,528,1),  XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnuctrl-",XLOCB(19,BOFM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnuctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
+{ "bnuctrl+",XLOCB(19,BOFP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "btctr",   XLO(19,BOT,528,0),  XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "btctr-",  XLO(19,BOT,528,0),  XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btctr-",  XLO(19,BOTM4,528,0), XLBOBB_MASK, POWER4, { BI } },
+{ "btctr+",  XLO(19,BOTP,528,0), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btctr+",  XLO(19,BOTP4,528,0), XLBOBB_MASK, POWER4, { BI } },
+{ "btctrl",  XLO(19,BOT,528,1),  XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "btctrl-", XLO(19,BOT,528,1),  XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btctrl-", XLO(19,BOTM4,528,1), XLBOBB_MASK, POWER4, { BI } },
+{ "btctrl+", XLO(19,BOTP,528,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
+{ "btctrl+", XLO(19,BOTP4,528,1), XLBOBB_MASK, POWER4, { BI } },
+{ "bfctr",   XLO(19,BOF,528,0),  XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bfctr-",  XLO(19,BOF,528,0),  XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bfctr-",  XLO(19,BOFM4,528,0), XLBOBB_MASK, POWER4, { BI } },
+{ "bfctr+",  XLO(19,BOFP,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bfctr+",  XLO(19,BOFP4,528,0), XLBOBB_MASK, POWER4, { BI } },
+{ "bfctrl",  XLO(19,BOF,528,1),  XLBOBB_MASK, PPCCOM,	{ BI } },
+{ "bfctrl-", XLO(19,BOF,528,1),  XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bfctrl-", XLO(19,BOFM4,528,1), XLBOBB_MASK, POWER4, { BI } },
+{ "bfctrl+", XLO(19,BOFP,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
+{ "bfctrl+", XLO(19,BOFP4,528,1), XLBOBB_MASK, POWER4, { BI } },
+{ "bcctr",   XLLK(19,528,0),     XLYBB_MASK,  PPCCOM,	{ BO, BI } },
+{ "bcctr-",  XLYLK(19,528,0,0),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
+{ "bcctr+",  XLYLK(19,528,1,0),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
+{ "bcctrl",  XLLK(19,528,1),     XLYBB_MASK,  PPCCOM,	{ BO, BI } },
+{ "bcctrl-", XLYLK(19,528,0,1),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
+{ "bcctrl+", XLYLK(19,528,1,1),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
+{ "bcc",     XLLK(19,528,0),     XLBB_MASK,   PWRCOM,	{ BO, BI } },
+{ "bccl",    XLLK(19,528,1),     XLBB_MASK,   PWRCOM,	{ BO, BI } },
+{ "bcctre",  XLLK(19,529,0),     XLYBB_MASK,  BOOKE64,	{ BO, BI } },
+{ "bcctrel", XLLK(19,529,1),     XLYBB_MASK,  BOOKE64,	{ BO, BI } },
+
+{ "rlwimi",  M(20,0),	M_MASK,		PPCCOM,		{ RA,RS,SH,MBE,ME } },
+{ "rlimi",   M(20,0),	M_MASK,		PWRCOM,		{ RA,RS,SH,MBE,ME } },
+
+{ "rlwimi.", M(20,1),	M_MASK,		PPCCOM,		{ RA,RS,SH,MBE,ME } },
+{ "rlimi.",  M(20,1),	M_MASK,		PWRCOM,		{ RA,RS,SH,MBE,ME } },
+
+{ "rotlwi",  MME(21,31,0), MMBME_MASK,	PPCCOM,		{ RA, RS, SH } },
+{ "clrlwi",  MME(21,31,0), MSHME_MASK,	PPCCOM,		{ RA, RS, MB } },
+{ "rlwinm",  M(21,0),	M_MASK,		PPCCOM,		{ RA,RS,SH,MBE,ME } },
+{ "rlinm",   M(21,0),	M_MASK,		PWRCOM,		{ RA,RS,SH,MBE,ME } },
+{ "rotlwi.", MME(21,31,1), MMBME_MASK,	PPCCOM,		{ RA,RS,SH } },
+{ "clrlwi.", MME(21,31,1), MSHME_MASK,	PPCCOM,		{ RA, RS, MB } },
+{ "rlwinm.", M(21,1),	M_MASK,		PPCCOM,		{ RA,RS,SH,MBE,ME } },
+{ "rlinm.",  M(21,1),	M_MASK,		PWRCOM,		{ RA,RS,SH,MBE,ME } },
+
+{ "rlmi",    M(22,0),	M_MASK,		M601,		{ RA,RS,RB,MBE,ME } },
+{ "rlmi.",   M(22,1),	M_MASK,		M601,		{ RA,RS,RB,MBE,ME } },
+
+{ "be",	     B(22,0,0),	B_MASK,		BOOKE64,	{ LI } },
+{ "bel",     B(22,0,1),	B_MASK,		BOOKE64,	{ LI } },
+{ "bea",     B(22,1,0),	B_MASK,		BOOKE64,	{ LIA } },
+{ "bela",    B(22,1,1),	B_MASK,		BOOKE64,	{ LIA } },
+
+{ "rotlw",   MME(23,31,0), MMBME_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "rlwnm",   M(23,0),	M_MASK,		PPCCOM,		{ RA,RS,RB,MBE,ME } },
+{ "rlnm",    M(23,0),	M_MASK,		PWRCOM,		{ RA,RS,RB,MBE,ME } },
+{ "rotlw.",  MME(23,31,1), MMBME_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "rlwnm.",  M(23,1),	M_MASK,		PPCCOM,		{ RA,RS,RB,MBE,ME } },
+{ "rlnm.",   M(23,1),	M_MASK,		PWRCOM,		{ RA,RS,RB,MBE,ME } },
+
+{ "nop",     OP(24),	0xffffffff,	PPCCOM,		{ 0 } },
+{ "ori",     OP(24),	OP_MASK,	PPCCOM,		{ RA, RS, UI } },
+{ "oril",    OP(24),	OP_MASK,	PWRCOM,		{ RA, RS, UI } },
+
+{ "oris",    OP(25),	OP_MASK,	PPCCOM,		{ RA, RS, UI } },
+{ "oriu",    OP(25),	OP_MASK,	PWRCOM,		{ RA, RS, UI } },
+
+{ "xori",    OP(26),	OP_MASK,	PPCCOM,		{ RA, RS, UI } },
+{ "xoril",   OP(26),	OP_MASK,	PWRCOM,		{ RA, RS, UI } },
+
+{ "xoris",   OP(27),	OP_MASK,	PPCCOM,		{ RA, RS, UI } },
+{ "xoriu",   OP(27),	OP_MASK,	PWRCOM,		{ RA, RS, UI } },
+
+{ "andi.",   OP(28),	OP_MASK,	PPCCOM,		{ RA, RS, UI } },
+{ "andil.",  OP(28),	OP_MASK,	PWRCOM,		{ RA, RS, UI } },
+
+{ "andis.",  OP(29),	OP_MASK,	PPCCOM,		{ RA, RS, UI } },
+{ "andiu.",  OP(29),	OP_MASK,	PWRCOM,		{ RA, RS, UI } },
+
+{ "rotldi",  MD(30,0,0), MDMB_MASK,	PPC64,		{ RA, RS, SH6 } },
+{ "clrldi",  MD(30,0,0), MDSH_MASK,	PPC64,		{ RA, RS, MB6 } },
+{ "rldicl",  MD(30,0,0), MD_MASK,	PPC64,		{ RA, RS, SH6, MB6 } },
+{ "rotldi.", MD(30,0,1), MDMB_MASK,	PPC64,		{ RA, RS, SH6 } },
+{ "clrldi.", MD(30,0,1), MDSH_MASK,	PPC64,		{ RA, RS, MB6 } },
+{ "rldicl.", MD(30,0,1), MD_MASK,	PPC64,		{ RA, RS, SH6, MB6 } },
+
+{ "rldicr",  MD(30,1,0), MD_MASK,	PPC64,		{ RA, RS, SH6, ME6 } },
+{ "rldicr.", MD(30,1,1), MD_MASK,	PPC64,		{ RA, RS, SH6, ME6 } },
+
+{ "rldic",   MD(30,2,0), MD_MASK,	PPC64,		{ RA, RS, SH6, MB6 } },
+{ "rldic.",  MD(30,2,1), MD_MASK,	PPC64,		{ RA, RS, SH6, MB6 } },
+
+{ "rldimi",  MD(30,3,0), MD_MASK,	PPC64,		{ RA, RS, SH6, MB6 } },
+{ "rldimi.", MD(30,3,1), MD_MASK,	PPC64,		{ RA, RS, SH6, MB6 } },
+
+{ "rotld",   MDS(30,8,0), MDSMB_MASK,	PPC64,		{ RA, RS, RB } },
+{ "rldcl",   MDS(30,8,0), MDS_MASK,	PPC64,		{ RA, RS, RB, MB6 } },
+{ "rotld.",  MDS(30,8,1), MDSMB_MASK,	PPC64,		{ RA, RS, RB } },
+{ "rldcl.",  MDS(30,8,1), MDS_MASK,	PPC64,		{ RA, RS, RB, MB6 } },
+
+{ "rldcr",   MDS(30,9,0), MDS_MASK,	PPC64,		{ RA, RS, RB, ME6 } },
+{ "rldcr.",  MDS(30,9,1), MDS_MASK,	PPC64,		{ RA, RS, RB, ME6 } },
+
+{ "cmpw",    XCMPL(31,0,0), XCMPL_MASK, PPCCOM,		{ OBF, RA, RB } },
+{ "cmpd",    XCMPL(31,0,1), XCMPL_MASK, PPC64,		{ OBF, RA, RB } },
 { "cmp",     X(31,0),	XCMP_MASK,	PPC,		{ BF, L, RA, RB } },
-{ "cmp",     X(31,0),	XCMPL_MASK,	POWER,		{ BF, RA, RB } },
-
-{ "twlgt",   XTO(31,4,TOLGT), XTO_MASK, PPC,		{ RA, RB } },
-{ "tlgt",    XTO(31,4,TOLGT), XTO_MASK, POWER,		{ RA, RB } },
-{ "twllt",   XTO(31,4,TOLLT), XTO_MASK, PPC,		{ RA, RB } },
-{ "tllt",    XTO(31,4,TOLLT), XTO_MASK, POWER,		{ RA, RB } },
-{ "tweq",    XTO(31,4,TOEQ), XTO_MASK,	PPC,		{ RA, RB } },
-{ "teq",     XTO(31,4,TOEQ), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twlge",   XTO(31,4,TOLGE), XTO_MASK, PPC,		{ RA, RB } },
-{ "tlge",    XTO(31,4,TOLGE), XTO_MASK, POWER,		{ RA, RB } },
-{ "twlnl",   XTO(31,4,TOLNL), XTO_MASK, PPC,		{ RA, RB } },
-{ "tlnl",    XTO(31,4,TOLNL), XTO_MASK, POWER,		{ RA, RB } },
-{ "twlle",   XTO(31,4,TOLLE), XTO_MASK, PPC,		{ RA, RB } },
-{ "tlle",    XTO(31,4,TOLLE), XTO_MASK, POWER,		{ RA, RB } },
-{ "twlng",   XTO(31,4,TOLNG), XTO_MASK, PPC,		{ RA, RB } },
-{ "tlng",    XTO(31,4,TOLNG), XTO_MASK, POWER,		{ RA, RB } },
-{ "twgt",    XTO(31,4,TOGT), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tgt",     XTO(31,4,TOGT), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twge",    XTO(31,4,TOGE), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tge",     XTO(31,4,TOGE), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twnl",    XTO(31,4,TONL), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tnl",     XTO(31,4,TONL), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twlt",    XTO(31,4,TOLT), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tlt",     XTO(31,4,TOLT), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twle",    XTO(31,4,TOLE), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tle",     XTO(31,4,TOLE), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twng",    XTO(31,4,TONG), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tng",     XTO(31,4,TONG), XTO_MASK,	POWER,		{ RA, RB } },
-{ "twne",    XTO(31,4,TONE), XTO_MASK,	PPC,		{ RA, RB } },
-{ "tne",     XTO(31,4,TONE), XTO_MASK,	POWER,		{ RA, RB } },
-{ "trap",    XTO(31,4,TOU), 0xffffffff,	PPC,		{ 0 } },
-{ "tw",      X(31,4),	X_MASK,		PPC,		{ TO, RA, RB } },
-{ "t",       X(31,4),	X_MASK,		POWER,		{ TO, RA, RB } },
-
-{ "subfc",   XO(31,8,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sf",      XO(31,8,0,0), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "cmp",     X(31,0),	XCMPL_MASK,	PWRCOM,		{ BF, RA, RB } },
+
+{ "twlgt",   XTO(31,4,TOLGT), XTO_MASK, PPCCOM,		{ RA, RB } },
+{ "tlgt",    XTO(31,4,TOLGT), XTO_MASK, PWRCOM,		{ RA, RB } },
+{ "twllt",   XTO(31,4,TOLLT), XTO_MASK, PPCCOM,		{ RA, RB } },
+{ "tllt",    XTO(31,4,TOLLT), XTO_MASK, PWRCOM,		{ RA, RB } },
+{ "tweq",    XTO(31,4,TOEQ), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "teq",     XTO(31,4,TOEQ), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twlge",   XTO(31,4,TOLGE), XTO_MASK, PPCCOM,		{ RA, RB } },
+{ "tlge",    XTO(31,4,TOLGE), XTO_MASK, PWRCOM,		{ RA, RB } },
+{ "twlnl",   XTO(31,4,TOLNL), XTO_MASK, PPCCOM,		{ RA, RB } },
+{ "tlnl",    XTO(31,4,TOLNL), XTO_MASK, PWRCOM,		{ RA, RB } },
+{ "twlle",   XTO(31,4,TOLLE), XTO_MASK, PPCCOM,		{ RA, RB } },
+{ "tlle",    XTO(31,4,TOLLE), XTO_MASK, PWRCOM,		{ RA, RB } },
+{ "twlng",   XTO(31,4,TOLNG), XTO_MASK, PPCCOM,		{ RA, RB } },
+{ "tlng",    XTO(31,4,TOLNG), XTO_MASK, PWRCOM,		{ RA, RB } },
+{ "twgt",    XTO(31,4,TOGT), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tgt",     XTO(31,4,TOGT), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twge",    XTO(31,4,TOGE), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tge",     XTO(31,4,TOGE), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twnl",    XTO(31,4,TONL), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tnl",     XTO(31,4,TONL), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twlt",    XTO(31,4,TOLT), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tlt",     XTO(31,4,TOLT), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twle",    XTO(31,4,TOLE), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tle",     XTO(31,4,TOLE), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twng",    XTO(31,4,TONG), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tng",     XTO(31,4,TONG), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "twne",    XTO(31,4,TONE), XTO_MASK,	PPCCOM,		{ RA, RB } },
+{ "tne",     XTO(31,4,TONE), XTO_MASK,	PWRCOM,		{ RA, RB } },
+{ "trap",    XTO(31,4,TOU), 0xffffffff,	PPCCOM,		{ 0 } },
+{ "tw",      X(31,4),	X_MASK,		PPCCOM,		{ TO, RA, RB } },
+{ "t",       X(31,4),	X_MASK,		PWRCOM,		{ TO, RA, RB } },
+
+{ "subfc",   XO(31,8,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sf",      XO(31,8,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 { "subc",    XO(31,8,0,0), XO_MASK,	PPC,		{ RT, RB, RA } },
-{ "subfc.",  XO(31,8,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sf.",     XO(31,8,0,1), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "subc.",   XO(31,8,0,1), XO_MASK,	PPC,		{ RT, RB, RA } },
-{ "subfco",  XO(31,8,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sfo",     XO(31,8,1,0), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "subfc.",  XO(31,8,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sf.",     XO(31,8,0,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "subc.",   XO(31,8,0,1), XO_MASK,	PPCCOM,		{ RT, RB, RA } },
+{ "subfco",  XO(31,8,1,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sfo",     XO(31,8,1,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 { "subco",   XO(31,8,1,0), XO_MASK,	PPC,		{ RT, RB, RA } },
-{ "subfco.", XO(31,8,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sfo.",    XO(31,8,1,1), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "subfco.", XO(31,8,1,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sfo.",    XO(31,8,1,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 { "subco.",  XO(31,8,1,1), XO_MASK,	PPC,		{ RT, RB, RA } },
 
-{ "mulhdu",  XO(31,9,0,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "mulhdu.", XO(31,9,0,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
+{ "mulhdu",  XO(31,9,0,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "mulhdu.", XO(31,9,0,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
 
-{ "addc",    XO(31,10,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "a",       XO(31,10,0,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addc.",   XO(31,10,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "a.",      XO(31,10,0,1), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addco",   XO(31,10,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "ao",      XO(31,10,1,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addco.",  XO(31,10,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "ao.",     XO(31,10,1,1), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "addc",    XO(31,10,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "a",       XO(31,10,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addc.",   XO(31,10,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "a.",      XO(31,10,0,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addco",   XO(31,10,1,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "ao",      XO(31,10,1,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addco.",  XO(31,10,1,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "ao.",     XO(31,10,1,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 
 { "mulhwu",  XO(31,11,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "mulhwu.", XO(31,11,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 
-{ "mfcr",    X(31,19),	XRARB_MASK,	POWER|PPC,	{ RT } },
+{ "isellt",  X(31,15),      X_MASK,	PPCISEL,	{ RT, RA, RB } },
+{ "iselgt",  X(31,47),      X_MASK,	PPCISEL,	{ RT, RA, RB } },
+{ "iseleq",  X(31,79),      X_MASK,	PPCISEL,	{ RT, RA, RB } },
+{ "isel",    XISEL(31,15),  XISEL_MASK,	PPCISEL,	{ RT, RA, RB, CRB } },
+
+{ "mfcr",    X(31,19),	XRARB_MASK,	NOPOWER4,	{ RT } },
+{ "mfcr",    X(31,19),	XFXFXM_MASK,	POWER4,		{ RT, FXM4 } },
 
 { "lwarx",   X(31,20),	X_MASK,		PPC,		{ RT, RA, RB } },
 
-{ "ldx",     X(31,21),	X_MASK,		PPC|B64,	{ RT, RA, RB } },
+{ "ldx",     X(31,21),	X_MASK,		PPC64,		{ RT, RA, RB } },
+
+{ "icbt",    X(31,22),	X_MASK,		BOOKE,		{ CT, RA, RB } },
+{ "icbt",    X(31,262),	XRT_MASK,	PPC403,		{ RA, RB } },
 
-{ "lwzx",    X(31,23),	X_MASK,		PPC,		{ RT, RA, RB } },
-{ "lx",      X(31,23),	X_MASK,		POWER,		{ RT, RA, RB } },
+{ "lwzx",    X(31,23),	X_MASK,		PPCCOM,		{ RT, RA, RB } },
+{ "lx",      X(31,23),	X_MASK,		PWRCOM,		{ RT, RA, RB } },
 
-{ "slw",     XRC(31,24,0), X_MASK,	PPC,		{ RA, RS, RB } },
-{ "sl",      XRC(31,24,0), X_MASK,	POWER,		{ RA, RS, RB } },
-{ "slw.",    XRC(31,24,1), X_MASK,	PPC,		{ RA, RS, RB } },
-{ "sl.",     XRC(31,24,1), X_MASK,	POWER,		{ RA, RS, RB } },
+{ "slw",     XRC(31,24,0), X_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "sl",      XRC(31,24,0), X_MASK,	PWRCOM,		{ RA, RS, RB } },
+{ "slw.",    XRC(31,24,1), X_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "sl.",     XRC(31,24,1), X_MASK,	PWRCOM,		{ RA, RS, RB } },
 
-{ "cntlzw",  XRC(31,26,0), XRB_MASK,	PPC,		{ RA, RS } },
-{ "cntlz",   XRC(31,26,0), XRB_MASK,	POWER,		{ RA, RS } },
-{ "cntlzw.", XRC(31,26,1), XRB_MASK,	PPC,		{ RA, RS } },
-{ "cntlz.",  XRC(31,26,1), XRB_MASK, 	POWER,		{ RA, RS } },
+{ "cntlzw",  XRC(31,26,0), XRB_MASK,	PPCCOM,		{ RA, RS } },
+{ "cntlz",   XRC(31,26,0), XRB_MASK,	PWRCOM,		{ RA, RS } },
+{ "cntlzw.", XRC(31,26,1), XRB_MASK,	PPCCOM,		{ RA, RS } },
+{ "cntlz.",  XRC(31,26,1), XRB_MASK, 	PWRCOM,		{ RA, RS } },
 
-{ "sld",     XRC(31,27,0), X_MASK,	PPC|B64,	{ RA, RS, RB } },
-{ "sld.",    XRC(31,27,1), X_MASK,	PPC|B64,	{ RA, RS, RB } },
+{ "sld",     XRC(31,27,0), X_MASK,	PPC64,		{ RA, RS, RB } },
+{ "sld.",    XRC(31,27,1), X_MASK,	PPC64,		{ RA, RS, RB } },
 
-{ "and",     XRC(31,28,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "and.",    XRC(31,28,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
+{ "and",     XRC(31,28,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "and.",    XRC(31,28,1), X_MASK,	COM,		{ RA, RS, RB } },
 
-{ "maskg",   XRC(31,29,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "maskg.",  XRC(31,29,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "maskg",   XRC(31,29,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "maskg.",  XRC(31,29,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "cmplw",   XCMPL(31,32,0), XCMPL_MASK, PPC,		{ OBF, RA, RB } },
-{ "cmpld",   XCMPL(31,32,1), XCMPL_MASK, PPC|B64,	{ OBF, RA, RB } },
-{ "cmpl",    X(31,32),	XCMP_MASK,	PPC,		{ BF, L, RA, RB } },
-{ "cmpl",    X(31,32),	XCMPL_MASK,	POWER,		{ BF, RA, RB } },
+{ "icbte",   X(31,30),	X_MASK,		BOOKE64,	{ CT, RA, RB } },
+
+{ "lwzxe",   X(31,31),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
+
+{ "cmplw",   XCMPL(31,32,0), XCMPL_MASK, PPCCOM,	{ OBF, RA, RB } },
+{ "cmpld",   XCMPL(31,32,1), XCMPL_MASK, PPC64,		{ OBF, RA, RB } },
+{ "cmpl",    X(31,32),	XCMP_MASK,	 PPC,		{ BF, L, RA, RB } },
+{ "cmpl",    X(31,32),	XCMPL_MASK,	 PWRCOM,	{ BF, RA, RB } },
 
 { "subf",    XO(31,40,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "sub",     XO(31,40,0,0), XO_MASK,	PPC,		{ RT, RB, RA } },
@@ -1969,279 +3277,550 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "subfo.",  XO(31,40,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "subo.",   XO(31,40,1,1), XO_MASK,	PPC,		{ RT, RB, RA } },
 
-{ "ldux",    X(31,53),	X_MASK,		PPC|B64,	{ RT, RAL, RB } },
+{ "ldux",    X(31,53),	X_MASK,		PPC64,		{ RT, RAL, RB } },
 
 { "dcbst",   X(31,54),	XRT_MASK,	PPC,		{ RA, RB } },
 
-{ "lwzux",   X(31,55),	X_MASK,		PPC,		{ RT, RAL, RB } },
-{ "lux",     X(31,55),	X_MASK,		POWER,		{ RT, RA, RB } },
-
-{ "cntlzd",  XRC(31,58,0), XRB_MASK,	PPC|B64,	{ RA, RS } },
-{ "cntlzd.", XRC(31,58,1), XRB_MASK,	PPC|B64,	{ RA, RS } },
-
-{ "andc",    XRC(31,60,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "andc.",   XRC(31,60,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-
-{ "tdlgt",   XTO(31,68,TOLGT), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdllt",   XTO(31,68,TOLLT), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdeq",    XTO(31,68,TOEQ), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdlge",   XTO(31,68,TOLGE), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdlnl",   XTO(31,68,TOLNL), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdlle",   XTO(31,68,TOLLE), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdlng",   XTO(31,68,TOLNG), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdgt",    XTO(31,68,TOGT), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdge",    XTO(31,68,TOGE), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdnl",    XTO(31,68,TONL), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdlt",    XTO(31,68,TOLT), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdle",    XTO(31,68,TOLE), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdng",    XTO(31,68,TONG), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "tdne",    XTO(31,68,TONE), XTO_MASK, PPC|B64,	{ RA, RB } },
-{ "td",	     X(31,68),	X_MASK,		PPC|B64,	{ TO, RA, RB } },
-
-{ "mulhd",   XO(31,73,0,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "mulhd.",  XO(31,73,0,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
+{ "lwzux",   X(31,55),	X_MASK,		PPCCOM,		{ RT, RAL, RB } },
+{ "lux",     X(31,55),	X_MASK,		PWRCOM,		{ RT, RA, RB } },
+
+{ "dcbste",  X(31,62),	XRT_MASK,	BOOKE64,	{ RA, RB } },
+
+{ "lwzuxe",  X(31,63),	X_MASK,		BOOKE64,	{ RT, RAL, RB } },
+
+{ "cntlzd",  XRC(31,58,0), XRB_MASK,	PPC64,		{ RA, RS } },
+{ "cntlzd.", XRC(31,58,1), XRB_MASK,	PPC64,		{ RA, RS } },
+
+{ "andc",    XRC(31,60,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "andc.",   XRC(31,60,1), X_MASK,	COM,		{ RA, RS, RB } },
+
+{ "tdlgt",   XTO(31,68,TOLGT), XTO_MASK, PPC64,		{ RA, RB } },
+{ "tdllt",   XTO(31,68,TOLLT), XTO_MASK, PPC64,		{ RA, RB } },
+{ "tdeq",    XTO(31,68,TOEQ), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdlge",   XTO(31,68,TOLGE), XTO_MASK, PPC64,		{ RA, RB } },
+{ "tdlnl",   XTO(31,68,TOLNL), XTO_MASK, PPC64,		{ RA, RB } },
+{ "tdlle",   XTO(31,68,TOLLE), XTO_MASK, PPC64,		{ RA, RB } },
+{ "tdlng",   XTO(31,68,TOLNG), XTO_MASK, PPC64,		{ RA, RB } },
+{ "tdgt",    XTO(31,68,TOGT), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdge",    XTO(31,68,TOGE), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdnl",    XTO(31,68,TONL), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdlt",    XTO(31,68,TOLT), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdle",    XTO(31,68,TOLE), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdng",    XTO(31,68,TONG), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "tdne",    XTO(31,68,TONE), XTO_MASK,  PPC64,		{ RA, RB } },
+{ "td",	     X(31,68),	X_MASK,		 PPC64,		{ TO, RA, RB } },
+
+{ "mulhd",   XO(31,73,0,0), XO_MASK,	 PPC64,		{ RT, RA, RB } },
+{ "mulhd.",  XO(31,73,0,1), XO_MASK,	 PPC64,		{ RT, RA, RB } },
 
 { "mulhw",   XO(31,75,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "mulhw.",  XO(31,75,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 
-{ "mfmsr",   X(31,83),	XRARB_MASK,	PPC|POWER,	{ RT } },
+{ "dlmzb",   XRC(31,78,0),  X_MASK,	PPC403|PPC440,	{ RA, RS, RB } },
+{ "dlmzb.",  XRC(31,78,1),  X_MASK,	PPC403|PPC440,	{ RA, RS, RB } },
+
+{ "mtsrd",   X(31,82),	XRB_MASK|(1<<20), PPC64,	{ SR, RS } },
 
-{ "ldarx",   X(31,84),	X_MASK,		PPC|B64,	{ RT, RA, RB } },
+{ "mfmsr",   X(31,83),	XRARB_MASK,	COM,		{ RT } },
+
+{ "ldarx",   X(31,84),	X_MASK,		PPC64,		{ RT, RA, RB } },
 
 { "dcbf",    X(31,86),	XRT_MASK,	PPC,		{ RA, RB } },
 
-{ "lbzx",    X(31,87),	X_MASK,		PPC|POWER,	{ RT, RA, RB } },
+{ "lbzx",    X(31,87),	X_MASK,		COM,		{ RT, RA, RB } },
+
+{ "dcbfe",   X(31,94),	XRT_MASK,	BOOKE64,	{ RA, RB } },
+
+{ "lbzxe",   X(31,95),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
+
+{ "neg",     XO(31,104,0,0), XORB_MASK,	COM,		{ RT, RA } },
+{ "neg.",    XO(31,104,0,1), XORB_MASK,	COM,		{ RT, RA } },
+{ "nego",    XO(31,104,1,0), XORB_MASK,	COM,		{ RT, RA } },
+{ "nego.",   XO(31,104,1,1), XORB_MASK,	COM,		{ RT, RA } },
+
+{ "mul",     XO(31,107,0,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "mul.",    XO(31,107,0,1), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "mulo",    XO(31,107,1,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "mulo.",   XO(31,107,1,1), XO_MASK,	M601,		{ RT, RA, RB } },
+
+{ "mtsrdin", X(31,114),	XRA_MASK,	PPC64,		{ RS, RB } },
+
+{ "clf",     X(31,118), XTO_MASK,	POWER,		{ RA, RB } },
+
+{ "lbzux",   X(31,119),	X_MASK,		COM,		{ RT, RAL, RB } },
+
+{ "not",     XRC(31,124,0), X_MASK,	COM,		{ RA, RS, RBS } },
+{ "nor",     XRC(31,124,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "not.",    XRC(31,124,1), X_MASK,	COM,		{ RA, RS, RBS } },
+{ "nor.",    XRC(31,124,1), X_MASK,	COM,		{ RA, RS, RB } },
 
-{ "neg",     XO(31,104,0,0), XORB_MASK,	PPC|POWER,	{ RT, RA } },
-{ "neg.",    XO(31,104,0,1), XORB_MASK,	PPC|POWER,	{ RT, RA } },
-{ "nego",    XO(31,104,1,0), XORB_MASK,	PPC|POWER,	{ RT, RA } },
-{ "nego.",   XO(31,104,1,1), XORB_MASK,	PPC|POWER,	{ RT, RA } },
+{ "lwarxe",  X(31,126),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
 
-{ "mul",     XO(31,107,0,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "mul.",    XO(31,107,0,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "mulo",    XO(31,107,1,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "mulo.",   XO(31,107,1,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
+{ "lbzuxe",  X(31,127),	X_MASK,		BOOKE64,	{ RT, RAL, RB } },
 
-{ "clf",     X(31,118), XRB_MASK,	POWER,		{ RT, RA } },
+{ "wrtee",   X(31,131),	XRARB_MASK,	PPC403 | BOOKE,	{ RS } },
 
-{ "lbzux",   X(31,119),	X_MASK,		PPC|POWER,	{ RT, RAL, RB } },
+{ "dcbtstls",X(31,134),	X_MASK,		PPCCHLK,	{ CT, RA, RB }},
 
-{ "not",     XRC(31,124,0), X_MASK,	PPC|POWER,	{ RA, RS, RBS } },
-{ "nor",     XRC(31,124,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "not.",    XRC(31,124,1), X_MASK,	PPC|POWER,	{ RA, RS, RBS } },
-{ "nor.",    XRC(31,124,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
+{ "subfe",   XO(31,136,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sfe",     XO(31,136,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "subfe.",  XO(31,136,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sfe.",    XO(31,136,0,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "subfeo",  XO(31,136,1,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sfeo",    XO(31,136,1,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "subfeo.", XO(31,136,1,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "sfeo.",   XO(31,136,1,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 
-{ "subfe",   XO(31,136,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sfe",     XO(31,136,0,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "subfe.",  XO(31,136,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sfe.",    XO(31,136,0,1), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "subfeo",  XO(31,136,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sfeo",    XO(31,136,1,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "subfeo.", XO(31,136,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "sfeo.",   XO(31,136,1,1), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "adde",    XO(31,138,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "ae",      XO(31,138,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "adde.",   XO(31,138,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "ae.",     XO(31,138,0,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addeo",   XO(31,138,1,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "aeo",     XO(31,138,1,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addeo.",  XO(31,138,1,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "aeo.",    XO(31,138,1,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 
-{ "adde",    XO(31,138,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "ae",      XO(31,138,0,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "adde.",   XO(31,138,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "ae.",     XO(31,138,0,1), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addeo",   XO(31,138,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "aeo",     XO(31,138,1,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addeo.",  XO(31,138,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "aeo.",    XO(31,138,1,1), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "dcbtstlse",X(31,142),X_MASK,		PPCCHLK64,	{ CT, RA, RB }},
 
-{ "mtcr",    XFXM(31,144,0xff), XFXFXM_MASK|FXM_MASK, PPC|POWER, { RS }},
-{ "mtcrf",   X(31,144),	XFXFXM_MASK,	PPC|POWER,	{ FXM, RS } },
+{ "mtcr",    XFXM(31,144,0xff), XRARB_MASK, COM,	{ RS }},
+{ "mtcrf",   X(31,144),	XFXFXM_MASK,	COM,		{ FXM, RS } },
 
-{ "mtmsr",   X(31,146),	XRARB_MASK,	PPC|POWER,	{ RS } },
-{ "mtmsrd",  X(31,178),	XRARB_MASK,	PPC|POWER,	{ RS } },
+{ "mtmsr",   X(31,146),	XRARB_MASK,	COM,		{ RS } },
 
-{ "stdx",    X(31,149), X_MASK,		PPC|B64,	{ RS, RA, RB } },
+{ "stdx",    X(31,149), X_MASK,		PPC64,		{ RS, RA, RB } },
 
 { "stwcx.",  XRC(31,150,1), X_MASK,	PPC,		{ RS, RA, RB } },
 
-{ "stwx",    X(31,151), X_MASK,		PPC,		{ RS, RA, RB } },
-{ "stx",     X(31,151), X_MASK,		POWER,		{ RS, RA, RB } },
-
-{ "slq",     XRC(31,152,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "slq.",    XRC(31,152,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-
-{ "sle",     XRC(31,153,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "sle.",    XRC(31,153,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-
-{ "stdux",   X(31,181),	X_MASK,		PPC|B64,	{ RS, RAS, RB } },
-
-{ "stwux",   X(31,183),	X_MASK,		PPC,		{ RS, RAS, RB } },
-{ "stux",    X(31,183),	X_MASK,		POWER,		{ RS, RA, RB } },
+{ "stwx",    X(31,151), X_MASK,		PPCCOM,		{ RS, RA, RB } },
+{ "stx",     X(31,151), X_MASK,		PWRCOM,		{ RS, RA, RB } },
 
-{ "sliq",    XRC(31,184,0), X_MASK,	POWER|M601,	{ RA, RS, SH } },
-{ "sliq.",   XRC(31,184,1), X_MASK,	POWER|M601,	{ RA, RS, SH } },
+{ "stwcxe.", XRC(31,158,1), X_MASK,	BOOKE64,	{ RS, RA, RB } },
 
-{ "subfze",  XO(31,200,0,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfze",    XO(31,200,0,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "subfze.", XO(31,200,0,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfze.",   XO(31,200,0,1), XORB_MASK, POWER,		{ RT, RA } },
-{ "subfzeo", XO(31,200,1,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfzeo",   XO(31,200,1,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "subfzeo.",XO(31,200,1,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfzeo.",  XO(31,200,1,1), XORB_MASK, POWER,		{ RT, RA } },
+{ "stwxe",   X(31,159), X_MASK,		BOOKE64,	{ RS, RA, RB } },
 
-{ "addze",   XO(31,202,0,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "aze",     XO(31,202,0,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "addze.",  XO(31,202,0,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "aze.",    XO(31,202,0,1), XORB_MASK, POWER,		{ RT, RA } },
-{ "addzeo",  XO(31,202,1,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "azeo",    XO(31,202,1,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "addzeo.", XO(31,202,1,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "azeo.",   XO(31,202,1,1), XORB_MASK, POWER,		{ RT, RA } },
+{ "slq",     XRC(31,152,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "slq.",    XRC(31,152,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "mtsr",    X(31,210),	XRB_MASK|(1<<20), PPC|POWER|B32, { SR, RS } },
+{ "sle",     XRC(31,153,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "sle.",    XRC(31,153,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "stdcx.",  XRC(31,214,1), X_MASK,	PPC|B64,	{ RS, RA, RB } },
+{ "wrteei",  X(31,163),	XE_MASK,	PPC403 | BOOKE,	{ E } },
 
-{ "stbx",    X(31,215),	X_MASK,		PPC|POWER,	{ RS, RA, RB } },
+{ "dcbtls",  X(31,166),	X_MASK,		PPCCHLK,	{ CT, RA, RB }},
+{ "dcbtlse", X(31,174),	X_MASK,		PPCCHLK64,	{ CT, RA, RB }},
 
-{ "sllq",    XRC(31,216,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "sllq.",   XRC(31,216,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "mtmsrd",  X(31,178),	XRLARB_MASK,	PPC64,		{ RS, MTMSRD_L } },
 
-{ "sleq",    XRC(31,217,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "sleq.",   XRC(31,217,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "stdux",   X(31,181),	X_MASK,		PPC64,		{ RS, RAS, RB } },
 
-{ "subfme",  XO(31,232,0,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfme",    XO(31,232,0,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "subfme.", XO(31,232,0,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfme.",   XO(31,232,0,1), XORB_MASK, POWER,		{ RT, RA } },
-{ "subfmeo", XO(31,232,1,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfmeo",   XO(31,232,1,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "subfmeo.",XO(31,232,1,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "sfmeo.",  XO(31,232,1,1), XORB_MASK, POWER,		{ RT, RA } },
+{ "stwux",   X(31,183),	X_MASK,		PPCCOM,		{ RS, RAS, RB } },
+{ "stux",    X(31,183),	X_MASK,		PWRCOM,		{ RS, RA, RB } },
 
-{ "mulld",   XO(31,233,0,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "mulld.",  XO(31,233,0,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "mulldo",  XO(31,233,1,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "mulldo.", XO(31,233,1,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
+{ "sliq",    XRC(31,184,0), X_MASK,	M601,		{ RA, RS, SH } },
+{ "sliq.",   XRC(31,184,1), X_MASK,	M601,		{ RA, RS, SH } },
 
-{ "addme",   XO(31,234,0,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "ame",     XO(31,234,0,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "addme.",  XO(31,234,0,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "ame.",    XO(31,234,0,1), XORB_MASK, POWER,		{ RT, RA } },
-{ "addmeo",  XO(31,234,1,0), XORB_MASK, PPC,		{ RT, RA } },
-{ "ameo",    XO(31,234,1,0), XORB_MASK, POWER,		{ RT, RA } },
-{ "addmeo.", XO(31,234,1,1), XORB_MASK, PPC,		{ RT, RA } },
-{ "ameo.",   XO(31,234,1,1), XORB_MASK, POWER,		{ RT, RA } },
+{ "stwuxe",  X(31,191),	X_MASK,		BOOKE64,	{ RS, RAS, RB } },
 
-{ "mullw",   XO(31,235,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "muls",    XO(31,235,0,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "mullw.",  XO(31,235,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "muls.",   XO(31,235,0,1), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "mullwo",  XO(31,235,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "mulso",   XO(31,235,1,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "mullwo.", XO(31,235,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "mulso.",  XO(31,235,1,1), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "subfze",  XO(31,200,0,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfze",    XO(31,200,0,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "subfze.", XO(31,200,0,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfze.",   XO(31,200,0,1), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "subfzeo", XO(31,200,1,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfzeo",   XO(31,200,1,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "subfzeo.",XO(31,200,1,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfzeo.",  XO(31,200,1,1), XORB_MASK, PWRCOM,		{ RT, RA } },
 
-{ "mtsrin",  X(31,242),	XRA_MASK,	PPC|B32,	{ RS, RB } },
-{ "mtsri",   X(31,242),	XRA_MASK,	POWER|B32,	{ RS, RB } },
+{ "addze",   XO(31,202,0,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "aze",     XO(31,202,0,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "addze.",  XO(31,202,0,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "aze.",    XO(31,202,0,1), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "addzeo",  XO(31,202,1,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "azeo",    XO(31,202,1,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "addzeo.", XO(31,202,1,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "azeo.",   XO(31,202,1,1), XORB_MASK, PWRCOM,		{ RT, RA } },
 
-{ "dcbtst",  X(31,246),	XRT_MASK,	PPC,		{ RA, RB } },
+{ "mtsr",    X(31,210),	XRB_MASK|(1<<20), COM32,	{ SR, RS } },
 
-{ "stbux",   X(31,247),	X_MASK,		PPC|POWER,	{ RS, RAS, RB } },
+{ "stdcx.",  XRC(31,214,1), X_MASK,	PPC64,		{ RS, RA, RB } },
 
-{ "slliq",   XRC(31,248,0), X_MASK,	POWER|M601,	{ RA, RS, SH } },
-{ "slliq.",  XRC(31,248,1), X_MASK,	POWER|M601,	{ RA, RS, SH } },
+{ "stbx",    X(31,215),	X_MASK,		COM,		{ RS, RA, RB } },
 
-{ "doz",     XO(31,264,0,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "doz.",    XO(31,264,0,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "dozo",    XO(31,264,1,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "dozo.",   XO(31,264,1,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
+{ "sllq",    XRC(31,216,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "sllq.",   XRC(31,216,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "add",     XO(31,266,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "cax",     XO(31,266,0,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "add.",    XO(31,266,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "cax.",    XO(31,266,0,1), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addo",    XO(31,266,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "caxo",    XO(31,266,1,0), XO_MASK,	POWER,		{ RT, RA, RB } },
-{ "addo.",   XO(31,266,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
-{ "caxo.",   XO(31,266,1,1), XO_MASK,	POWER,		{ RT, RA, RB } },
+{ "sleq",    XRC(31,217,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "sleq.",   XRC(31,217,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "lscbx",   XRC(31,277,0), X_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "lscbx.",  XRC(31,277,1), X_MASK,	POWER|M601,	{ RT, RA, RB } },
+{ "stbxe",   X(31,223),	X_MASK,		BOOKE64,	{ RS, RA, RB } },
 
-{ "dcbt",    X(31,278),	XRT_MASK,	PPC,		{ RA, RB } },
+{ "icblc",   X(31,230),	X_MASK,		PPCCHLK,	{ CT, RA, RB }},
 
-{ "lhzx",    X(31,279),	X_MASK,		PPC|POWER,	{ RT, RA, RB } },
-
-{ "icbt",    X(31,262),	XRT_MASK,	PPC,		{ RA, RB } },
-
-{ "eqv",     XRC(31,284,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "eqv.",    XRC(31,284,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-
-{ "tlbie",   X(31,306),	XRTRA_MASK,	PPC,		{ RB } },
-{ "tlbi",    X(31,306),	XRTRA_MASK,	POWER,		{ RB } },
+{ "subfme",  XO(31,232,0,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfme",    XO(31,232,0,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "subfme.", XO(31,232,0,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfme.",   XO(31,232,0,1), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "subfmeo", XO(31,232,1,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfmeo",   XO(31,232,1,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "subfmeo.",XO(31,232,1,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "sfmeo.",  XO(31,232,1,1), XORB_MASK, PWRCOM,		{ RT, RA } },
+
+{ "mulld",   XO(31,233,0,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "mulld.",  XO(31,233,0,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "mulldo",  XO(31,233,1,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "mulldo.", XO(31,233,1,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
+
+{ "addme",   XO(31,234,0,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "ame",     XO(31,234,0,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "addme.",  XO(31,234,0,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "ame.",    XO(31,234,0,1), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "addmeo",  XO(31,234,1,0), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "ameo",    XO(31,234,1,0), XORB_MASK, PWRCOM,		{ RT, RA } },
+{ "addmeo.", XO(31,234,1,1), XORB_MASK, PPCCOM,		{ RT, RA } },
+{ "ameo.",   XO(31,234,1,1), XORB_MASK, PWRCOM,		{ RT, RA } },
+
+{ "mullw",   XO(31,235,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "muls",    XO(31,235,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "mullw.",  XO(31,235,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "muls.",   XO(31,235,0,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "mullwo",  XO(31,235,1,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "mulso",   XO(31,235,1,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "mullwo.", XO(31,235,1,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "mulso.",  XO(31,235,1,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+
+{ "icblce",  X(31,238),	X_MASK,		PPCCHLK64,	{ CT, RA, RB }},
+{ "mtsrin",  X(31,242),	XRA_MASK,	PPC32,		{ RS, RB } },
+{ "mtsri",   X(31,242),	XRA_MASK,	POWER32,	{ RS, RB } },
+
+{ "dcbtst",  X(31,246),	XRT_MASK,	PPC,		{ CT, RA, RB } },
+
+{ "stbux",   X(31,247),	X_MASK,		COM,		{ RS, RAS, RB } },
+
+{ "slliq",   XRC(31,248,0), X_MASK,	M601,		{ RA, RS, SH } },
+{ "slliq.",  XRC(31,248,1), X_MASK,	M601,		{ RA, RS, SH } },
+
+{ "dcbtste", X(31,253),	X_MASK,		BOOKE64,	{ CT, RA, RB } },
+
+{ "stbuxe",  X(31,255),	X_MASK,		BOOKE64,	{ RS, RAS, RB } },
+
+{ "mfdcrx",  X(31,259),	X_MASK,		BOOKE,		{ RS, RA } },
+
+{ "doz",     XO(31,264,0,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "doz.",    XO(31,264,0,1), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "dozo",    XO(31,264,1,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "dozo.",   XO(31,264,1,1), XO_MASK,	M601,		{ RT, RA, RB } },
+
+{ "add",     XO(31,266,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "cax",     XO(31,266,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "add.",    XO(31,266,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "cax.",    XO(31,266,0,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addo",    XO(31,266,1,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "caxo",    XO(31,266,1,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+{ "addo.",   XO(31,266,1,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
+{ "caxo.",   XO(31,266,1,1), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
+
+{ "tlbiel",  X(31,274), XRTRA_MASK,	POWER4,		{ RB } },
+
+{ "mfapidi", X(31,275), X_MASK,		BOOKE,		{ RT, RA } },
+
+{ "lscbx",   XRC(31,277,0), X_MASK,	M601,		{ RT, RA, RB } },
+{ "lscbx.",  XRC(31,277,1), X_MASK,	M601,		{ RT, RA, RB } },
+
+{ "dcbt",    X(31,278),	XRT_MASK,	PPC,		{ CT, RA, RB } },
+
+{ "lhzx",    X(31,279),	X_MASK,		COM,		{ RT, RA, RB } },
+
+{ "eqv",     XRC(31,284,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "eqv.",    XRC(31,284,1), X_MASK,	COM,		{ RA, RS, RB } },
+
+{ "dcbte",   X(31,286),	X_MASK,		BOOKE64,	{ CT, RA, RB } },
+
+{ "lhzxe",   X(31,287),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
+
+{ "tlbie",   X(31,306),	XRTLRA_MASK,	PPC,		{ RB, L } },
+{ "tlbi",    X(31,306),	XRT_MASK,	POWER,		{ RA, RB } },
 
 { "eciwx",   X(31,310), X_MASK,		PPC,		{ RT, RA, RB } },
 
-{ "lhzux",   X(31,311),	X_MASK,		PPC|POWER,	{ RT, RAL, RB } },
-
-{ "xor",     XRC(31,316,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "xor.",    XRC(31,316,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-
-{ "mfdcr",   X(31,323),	X_MASK,		PPC,		{ RT, SPR } },
-
-{ "div",     XO(31,331,0,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "div.",    XO(31,331,0,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "divo",    XO(31,331,1,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "divo.",   XO(31,331,1,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-
-{ "mfmq",    XSPR(31,339,0), XSPR_MASK,	POWER|M601,	{ RT } },
-{ "mfxer",   XSPR(31,339,1), XSPR_MASK,	PPC|POWER,	{ RT } },
-{ "mfrtcu",  XSPR(31,339,4), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfrtcl",  XSPR(31,339,5), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfdec",   XSPR(31,339,6), XSPR_MASK, POWER|M601,	{ RT } },
-{ "mflr",    XSPR(31,339,8), XSPR_MASK,	PPC|POWER,	{ RT } },
-{ "mfctr",   XSPR(31,339,9), XSPR_MASK,	PPC|POWER,	{ RT } },
-{ "mftid",   XSPR(31,339,17), XSPR_MASK, POWER,		{ RT } },
-{ "mfdsisr", XSPR(31,339,18), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfdar",   XSPR(31,339,19), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfdec",   XSPR(31,339,22), XSPR_MASK, PPC,		{ RT } },
-{ "mfsdr0",  XSPR(31,339,24), XSPR_MASK, POWER,		{ RT } },
-{ "mfsdr1",  XSPR(31,339,25), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfsrr0",  XSPR(31,339,26), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfsrr1",  XSPR(31,339,27), XSPR_MASK, PPC|POWER,	{ RT } },
-{ "mfsprg",  XSPR(31,339,272), XSPRG_MASK, PPC,		{ RT, SPRG } },
-{ "mfasr",   XSPR(31,339,280), XSPR_MASK, PPC|B64,	{ RT } },
-{ "mfear",   XSPR(31,339,282), XSPR_MASK, PPC,		{ RT } },
-{ "mfpvr",   XSPR(31,339,287), XSPR_MASK, PPC,		{ RT } },
-{ "mfibatu", XSPR(31,339,528), XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
-{ "mfibatl", XSPR(31,339,529), XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
-{ "mfdbatu", XSPR(31,339,536), XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
-{ "mfdbatl", XSPR(31,339,537), XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
-{ "mfspr",   X(31,339),	X_MASK,		PPC|POWER,	{ RT, SPR } },
-
-{ "lwax",    X(31,341),	X_MASK,		PPC|B64,	{ RT, RA, RB } },
-
-{ "lhax",    X(31,343),	X_MASK,		PPC|POWER,	{ RT, RA, RB } },
-
-{ "dccci",   X(31,454),	XRT_MASK,	PPC,		{ RA, RB } },
-
-{ "abs",     XO(31,360,0,0), XORB_MASK, POWER|M601,	{ RT, RA } },
-{ "abs.",    XO(31,360,0,1), XORB_MASK, POWER|M601,	{ RT, RA } },
-{ "abso",    XO(31,360,1,0), XORB_MASK, POWER|M601,	{ RT, RA } },
-{ "abso.",   XO(31,360,1,1), XORB_MASK, POWER|M601,	{ RT, RA } },
-
-{ "divs",    XO(31,363,0,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "divs.",   XO(31,363,0,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "divso",   XO(31,363,1,0), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
-{ "divso.",  XO(31,363,1,1), XO_MASK,	POWER|M601,	{ RT, RA, RB } },
+{ "lhzux",   X(31,311),	X_MASK,		COM,		{ RT, RAL, RB } },
+
+{ "xor",     XRC(31,316,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "xor.",    XRC(31,316,1), X_MASK,	COM,		{ RA, RS, RB } },
+
+{ "lhzuxe",  X(31,319),	X_MASK,		BOOKE64,	{ RT, RAL, RB } },
+
+{ "mfexisr",  XSPR(31,323,64),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfexier",  XSPR(31,323,66),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr0",    XSPR(31,323,128), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr1",    XSPR(31,323,129), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr2",    XSPR(31,323,130), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr3",    XSPR(31,323,131), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr4",    XSPR(31,323,132), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr5",    XSPR(31,323,133), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr6",    XSPR(31,323,134), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbr7",    XSPR(31,323,135), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbear",   XSPR(31,323,144), XSPR_MASK, PPC403,	{ RT } },
+{ "mfbesr",   XSPR(31,323,145), XSPR_MASK, PPC403,	{ RT } },
+{ "mfiocr",   XSPR(31,323,160), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacr0", XSPR(31,323,192), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmact0", XSPR(31,323,193), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmada0", XSPR(31,323,194), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmasa0", XSPR(31,323,195), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacc0", XSPR(31,323,196), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacr1", XSPR(31,323,200), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmact1", XSPR(31,323,201), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmada1", XSPR(31,323,202), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmasa1", XSPR(31,323,203), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacc1", XSPR(31,323,204), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacr2", XSPR(31,323,208), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmact2", XSPR(31,323,209), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmada2", XSPR(31,323,210), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmasa2", XSPR(31,323,211), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacc2", XSPR(31,323,212), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacr3", XSPR(31,323,216), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmact3", XSPR(31,323,217), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmada3", XSPR(31,323,218), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmasa3", XSPR(31,323,219), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmacc3", XSPR(31,323,220), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdmasr",  XSPR(31,323,224), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdcr",    X(31,323),	X_MASK,	PPC403 | BOOKE,	{ RT, SPR } },
+
+{ "div",     XO(31,331,0,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "div.",    XO(31,331,0,1), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "divo",    XO(31,331,1,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "divo.",   XO(31,331,1,1), XO_MASK,	M601,		{ RT, RA, RB } },
+
+{ "mfpmr",   X(31,334),	X_MASK,		PPCPMR,		{ RT, PMR }},
+
+{ "mfmq",       XSPR(31,339,0),    XSPR_MASK, M601,	{ RT } },
+{ "mfxer",      XSPR(31,339,1),    XSPR_MASK, COM,	{ RT } },
+{ "mfrtcu",     XSPR(31,339,4),    XSPR_MASK, COM,	{ RT } },
+{ "mfrtcl",     XSPR(31,339,5),    XSPR_MASK, COM,	{ RT } },
+{ "mfdec",      XSPR(31,339,6),    XSPR_MASK, MFDEC1,	{ RT } },
+{ "mfdec",      XSPR(31,339,22),   XSPR_MASK, MFDEC2,	{ RT } },
+{ "mflr",       XSPR(31,339,8),    XSPR_MASK, COM,	{ RT } },
+{ "mfctr",      XSPR(31,339,9),    XSPR_MASK, COM,	{ RT } },
+{ "mftid",      XSPR(31,339,17),   XSPR_MASK, POWER,	{ RT } },
+{ "mfdsisr",    XSPR(31,339,18),   XSPR_MASK, COM,	{ RT } },
+{ "mfdar",      XSPR(31,339,19),   XSPR_MASK, COM,	{ RT } },
+{ "mfsdr0",     XSPR(31,339,24),   XSPR_MASK, POWER,	{ RT } },
+{ "mfsdr1",     XSPR(31,339,25),   XSPR_MASK, COM,	{ RT } },
+{ "mfsrr0",     XSPR(31,339,26),   XSPR_MASK, COM,	{ RT } },
+{ "mfsrr1",     XSPR(31,339,27),   XSPR_MASK, COM,	{ RT } },
+{ "mfpid",      XSPR(31,339,48),   XSPR_MASK, BOOKE,    { RT } },
+{ "mfpid",      XSPR(31,339,945),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfcsrr0",    XSPR(31,339,58),   XSPR_MASK, BOOKE,    { RT } },
+{ "mfcsrr1",    XSPR(31,339,59),   XSPR_MASK, BOOKE,    { RT } },
+{ "mfdear",     XSPR(31,339,61),   XSPR_MASK, BOOKE,    { RT } },
+{ "mfdear",     XSPR(31,339,981),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfesr",      XSPR(31,339,62),   XSPR_MASK, BOOKE,    { RT } },
+{ "mfesr",      XSPR(31,339,980),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfivpr",     XSPR(31,339,63),   XSPR_MASK, BOOKE,    { RT } },
+{ "mfcmpa",     XSPR(31,339,144),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmpb",     XSPR(31,339,145),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmpc",     XSPR(31,339,146),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmpd",     XSPR(31,339,147),  XSPR_MASK, PPC860,	{ RT } },
+{ "mficr",      XSPR(31,339,148),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfder",      XSPR(31,339,149),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcounta",   XSPR(31,339,150),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcountb",   XSPR(31,339,151),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmpe",     XSPR(31,339,152),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmpf",     XSPR(31,339,153),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmpg",     XSPR(31,339,154),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfcmph",     XSPR(31,339,155),  XSPR_MASK, PPC860,	{ RT } },
+{ "mflctrl1",   XSPR(31,339,156),  XSPR_MASK, PPC860,	{ RT } },
+{ "mflctrl2",   XSPR(31,339,157),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfictrl",    XSPR(31,339,158),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfbar",      XSPR(31,339,159),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfvrsave",   XSPR(31,339,256),  XSPR_MASK, PPCVEC,	{ RT } },
+{ "mfusprg0",   XSPR(31,339,256),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfsprg4",    XSPR(31,339,260),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfsprg5",    XSPR(31,339,261),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfsprg6",    XSPR(31,339,262),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfsprg7",    XSPR(31,339,263),  XSPR_MASK, PPC405,	{ RT } },
+{ "mftb",       X(31,371),	   X_MASK,    CLASSIC,	{ RT, TBR } },
+{ "mftb",       XSPR(31,339,268),  XSPR_MASK, BOOKE,    { RT } },
+{ "mftbl",      XSPR(31,371,268),  XSPR_MASK, CLASSIC,	{ RT } },
+{ "mftbl",      XSPR(31,339,268),  XSPR_MASK, BOOKE,    { RT } },
+{ "mftbu",      XSPR(31,371,269),  XSPR_MASK, CLASSIC,	{ RT } },
+{ "mftbu",      XSPR(31,339,269),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfsprg",     XSPR(31,339,272),  XSPRG_MASK, PPC,	{ RT, SPRG } },
+{ "mfsprg0",    XSPR(31,339,272),  XSPR_MASK, PPC,	{ RT } },
+{ "mfsprg1",    XSPR(31,339,273),  XSPR_MASK, PPC,	{ RT } },
+{ "mfsprg2",    XSPR(31,339,274),  XSPR_MASK, PPC,	{ RT } },
+{ "mfsprg3",    XSPR(31,339,275),  XSPR_MASK, PPC,	{ RT } },
+{ "mfasr",      XSPR(31,339,280),  XSPR_MASK, PPC64,	{ RT } },
+{ "mfear",      XSPR(31,339,282),  XSPR_MASK, PPC,	{ RT } },
+{ "mfpir",      XSPR(31,339,286),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfpvr",      XSPR(31,339,287),  XSPR_MASK, PPC,	{ RT } },
+{ "mfdbsr",     XSPR(31,339,304),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdbsr",     XSPR(31,339,1008), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdbcr0",    XSPR(31,339,308),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdbcr0",    XSPR(31,339,1010), XSPR_MASK, PPC405,	{ RT } },
+{ "mfdbcr1",    XSPR(31,339,309),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdbcr1",    XSPR(31,339,957),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfdbcr2",    XSPR(31,339,310),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfiac1",     XSPR(31,339,312),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfiac1",     XSPR(31,339,1012), XSPR_MASK, PPC403,	{ RT } },
+{ "mfiac2",     XSPR(31,339,313),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfiac2",     XSPR(31,339,1013), XSPR_MASK, PPC403,	{ RT } },
+{ "mfiac3",     XSPR(31,339,314),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfiac3",     XSPR(31,339,948),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfiac4",     XSPR(31,339,315),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfiac4",     XSPR(31,339,949),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfdac1",     XSPR(31,339,316),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdac1",     XSPR(31,339,1014), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdac2",     XSPR(31,339,317),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdac2",     XSPR(31,339,1015), XSPR_MASK, PPC403,	{ RT } },
+{ "mfdvc1",     XSPR(31,339,318),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdvc1",     XSPR(31,339,950),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfdvc2",     XSPR(31,339,319),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfdvc2",     XSPR(31,339,951),  XSPR_MASK, PPC405,	{ RT } },
+{ "mftsr",      XSPR(31,339,336),  XSPR_MASK, BOOKE,    { RT } },
+{ "mftsr",      XSPR(31,339,984),  XSPR_MASK, PPC403,	{ RT } },
+{ "mftcr",      XSPR(31,339,340),  XSPR_MASK, BOOKE,    { RT } },
+{ "mftcr",      XSPR(31,339,986),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfivor0",    XSPR(31,339,400),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor1",    XSPR(31,339,401),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor2",    XSPR(31,339,402),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor3",    XSPR(31,339,403),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor4",    XSPR(31,339,404),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor5",    XSPR(31,339,405),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor6",    XSPR(31,339,406),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor7",    XSPR(31,339,407),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor8",    XSPR(31,339,408),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor9",    XSPR(31,339,409),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor10",   XSPR(31,339,410),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor11",   XSPR(31,339,411),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor12",   XSPR(31,339,412),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor13",   XSPR(31,339,413),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor14",   XSPR(31,339,414),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfivor15",   XSPR(31,339,415),  XSPR_MASK, BOOKE,    { RT } },
+{ "mfspefscr",  XSPR(31,339,512),  XSPR_MASK, PPCSPE,	{ RT } },
+{ "mfbbear",    XSPR(31,339,513),  XSPR_MASK, PPCBRLK,  { RT } },
+{ "mfbbtar",    XSPR(31,339,514),  XSPR_MASK, PPCBRLK,  { RT } },
+{ "mfibatu",    XSPR(31,339,528),  XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
+{ "mfibatl",    XSPR(31,339,529),  XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
+{ "mfdbatu",    XSPR(31,339,536),  XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
+{ "mfdbatl",    XSPR(31,339,537),  XSPRBAT_MASK, PPC,	{ RT, SPRBAT } },
+{ "mfic_cst",   XSPR(31,339,560),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfic_adr",   XSPR(31,339,561),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfic_dat",   XSPR(31,339,562),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfdc_cst",   XSPR(31,339,568),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfdc_adr",   XSPR(31,339,569),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfdc_dat",   XSPR(31,339,570),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmcsrr0",   XSPR(31,339,570),  XSPR_MASK, PPCRFMCI, { RT } },
+{ "mfmcsrr1",   XSPR(31,339,571),  XSPR_MASK, PPCRFMCI, { RT } },
+{ "mfmcsr",     XSPR(31,339,572),  XSPR_MASK, PPCRFMCI, { RT } },
+{ "mfdpdr",     XSPR(31,339,630),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfdpir",     XSPR(31,339,631),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfimmr",     XSPR(31,339,638),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_ctr",   XSPR(31,339,784),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_ap",    XSPR(31,339,786),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_epn",   XSPR(31,339,787),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_twc",   XSPR(31,339,789),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_rpn",   XSPR(31,339,790),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_ctr",   XSPR(31,339,792),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfm_casid",  XSPR(31,339,793),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_ap",    XSPR(31,339,794),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_epn",   XSPR(31,339,795),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_twb",   XSPR(31,339,796),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_twc",   XSPR(31,339,797),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_rpn",   XSPR(31,339,798),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfm_tw",     XSPR(31,339,799),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_dbcam", XSPR(31,339,816),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_dbram0",XSPR(31,339,817),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmi_dbram1",XSPR(31,339,818),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_dbcam", XSPR(31,339,824),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_dbram0",XSPR(31,339,825),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfmd_dbram1",XSPR(31,339,826),  XSPR_MASK, PPC860,	{ RT } },
+{ "mfummcr0",   XSPR(31,339,936),  XSPR_MASK, PPC750,   { RT } },
+{ "mfupmc1",    XSPR(31,339,937),  XSPR_MASK, PPC750,   { RT } },
+{ "mfupmc2",    XSPR(31,339,938),  XSPR_MASK, PPC750,   { RT } },
+{ "mfusia",     XSPR(31,339,939),  XSPR_MASK, PPC750,   { RT } },
+{ "mfummcr1",   XSPR(31,339,940),  XSPR_MASK, PPC750,   { RT } },
+{ "mfupmc3",    XSPR(31,339,941),  XSPR_MASK, PPC750,   { RT } },
+{ "mfupmc4",    XSPR(31,339,942),  XSPR_MASK, PPC750,   { RT } },
+{ "mfzpr",   	XSPR(31,339,944),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfccr0",  	XSPR(31,339,947),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfmmcr0",	XSPR(31,339,952),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfpmc1",	XSPR(31,339,953),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfsgr",	XSPR(31,339,953),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfpmc2",	XSPR(31,339,954),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfdcwr", 	XSPR(31,339,954),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfsia",	XSPR(31,339,955),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfsler",	XSPR(31,339,955),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfmmcr1",	XSPR(31,339,956),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfsu0r",	XSPR(31,339,956),  XSPR_MASK, PPC405,	{ RT } },
+{ "mfpmc3",	XSPR(31,339,957),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfpmc4",	XSPR(31,339,958),  XSPR_MASK, PPC750,	{ RT } },
+{ "mficdbdr",   XSPR(31,339,979),  XSPR_MASK, PPC403,   { RT } },
+{ "mfevpr",     XSPR(31,339,982),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfcdbcr",    XSPR(31,339,983),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfpit",      XSPR(31,339,987),  XSPR_MASK, PPC403,	{ RT } },
+{ "mftbhi",     XSPR(31,339,988),  XSPR_MASK, PPC403,	{ RT } },
+{ "mftblo",     XSPR(31,339,989),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfsrr2",     XSPR(31,339,990),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfsrr3",     XSPR(31,339,991),  XSPR_MASK, PPC403,	{ RT } },
+{ "mfl2cr",     XSPR(31,339,1017), XSPR_MASK, PPC750,   { RT } },
+{ "mfdccr",     XSPR(31,339,1018), XSPR_MASK, PPC403,	{ RT } },
+{ "mficcr",     XSPR(31,339,1019), XSPR_MASK, PPC403,	{ RT } },
+{ "mfictc",     XSPR(31,339,1019), XSPR_MASK, PPC750,   { RT } },
+{ "mfpbl1",     XSPR(31,339,1020), XSPR_MASK, PPC403,	{ RT } },
+{ "mfthrm1",    XSPR(31,339,1020), XSPR_MASK, PPC750,   { RT } },
+{ "mfpbu1",     XSPR(31,339,1021), XSPR_MASK, PPC403,	{ RT } },
+{ "mfthrm2",    XSPR(31,339,1021), XSPR_MASK, PPC750,   { RT } },
+{ "mfpbl2",     XSPR(31,339,1022), XSPR_MASK, PPC403,	{ RT } },
+{ "mfthrm3",    XSPR(31,339,1022), XSPR_MASK, PPC750,   { RT } },
+{ "mfpbu2",     XSPR(31,339,1023), XSPR_MASK, PPC403,	{ RT } },
+{ "mfspr",      X(31,339),	   X_MASK,    COM,	{ RT, SPR } },
+
+{ "lwax",    X(31,341),	X_MASK,		PPC64,		{ RT, RA, RB } },
+
+{ "dst",     XDSS(31,342,0), XDSS_MASK,	PPCVEC,		{ RA, RB, STRM } },
+{ "dstt",    XDSS(31,342,1), XDSS_MASK,	PPCVEC,		{ RA, RB, STRM } },
+
+{ "lhax",    X(31,343),	X_MASK,		COM,		{ RT, RA, RB } },
+
+{ "lhaxe",   X(31,351),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
+
+{ "dstst",   XDSS(31,374,0), XDSS_MASK,	PPCVEC,		{ RA, RB, STRM } },
+{ "dststt",  XDSS(31,374,1), XDSS_MASK,	PPCVEC,		{ RA, RB, STRM } },
+
+{ "dccci",   X(31,454),	XRT_MASK,	PPC403|PPC440,	{ RA, RB } },
+
+{ "abs",     XO(31,360,0,0), XORB_MASK, M601,		{ RT, RA } },
+{ "abs.",    XO(31,360,0,1), XORB_MASK, M601,		{ RT, RA } },
+{ "abso",    XO(31,360,1,0), XORB_MASK, M601,		{ RT, RA } },
+{ "abso.",   XO(31,360,1,1), XORB_MASK, M601,		{ RT, RA } },
+
+{ "divs",    XO(31,363,0,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "divs.",   XO(31,363,0,1), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "divso",   XO(31,363,1,0), XO_MASK,	M601,		{ RT, RA, RB } },
+{ "divso.",  XO(31,363,1,1), XO_MASK,	M601,		{ RT, RA, RB } },
 
 { "tlbia",   X(31,370),	0xffffffff,	PPC,		{ 0 } },
 
-{ "mftbu",   XSPR(31,371,269), XSPR_MASK, PPC,		{ RT } },
-{ "mftb",    X(31,371),	X_MASK,		PPC,		{ RT, TBR } },
+{ "lwaux",   X(31,373),	X_MASK,		PPC64,		{ RT, RAL, RB } },
+
+{ "lhaux",   X(31,375),	X_MASK,		COM,		{ RT, RAL, RB } },
+
+{ "lhauxe",  X(31,383),	X_MASK,		BOOKE64,	{ RT, RAL, RB } },
+
+{ "mtdcrx",  X(31,387),	X_MASK,		BOOKE,		{ RA, RS } },
 
-{ "lwaux",   X(31,373),	X_MASK,		PPC|B64,	{ RT, RAL, RB } },
+{ "dcblc",   X(31,390),	X_MASK,		PPCCHLK,	{ CT, RA, RB }},
 
-{ "lhaux",   X(31,375),	X_MASK,		PPC|POWER,	{ RT, RAL, RB } },
+{ "subfe64", XO(31,392,0,0), XO_MASK,	BOOKE64,	{ RT, RA, RB } },
+{ "subfe64o",XO(31,392,1,0), XO_MASK,	BOOKE64,	{ RT, RA, RB } },
 
-{ "sthx",    X(31,407),	X_MASK,		PPC|POWER,	{ RS, RA, RB } },
+{ "adde64",  XO(31,394,0,0), XO_MASK,	BOOKE64,	{ RT, RA, RB } },
+{ "adde64o", XO(31,394,1,0), XO_MASK,	BOOKE64,	{ RT, RA, RB } },
+
+{ "dcblce",  X(31,398),	X_MASK,		PPCCHLK64,	{ CT, RA, RB }},
+
+{ "slbmte",  X(31,402), XRA_MASK,	PPC64,		{ RS, RB } },
+
+{ "sthx",    X(31,407),	X_MASK,		COM,		{ RS, RA, RB } },
 
 { "lfqx",    X(31,791),	X_MASK,		POWER2,		{ FRT, RA, RB } },
 
@@ -2251,280 +3830,575 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "stfqux",  X(31,951),	X_MASK,		POWER2,		{ FRS, RA, RB } },
 
-{ "orc",     XRC(31,412,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "orc.",    XRC(31,412,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-
-{ "sradi",   XS(31,413,0), XS_MASK,	PPC|B64,	{ RA, RS, SH6 } },
-{ "sradi.",  XS(31,413,1), XS_MASK,	PPC|B64,	{ RA, RS, SH6 } },
+{ "orc",     XRC(31,412,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "orc.",    XRC(31,412,1), X_MASK,	COM,		{ RA, RS, RB } },
 
-{ "slbie",   X(31,434),	XRTRA_MASK,	PPC|B64,	{ RB } },
+{ "sradi",   XS(31,413,0), XS_MASK,	PPC64,		{ RA, RS, SH6 } },
+{ "sradi.",  XS(31,413,1), XS_MASK,	PPC64,		{ RA, RS, SH6 } },
 
-{ "ecowx",   X(31,438),	X_MASK,		PPC,		{ RT, RA, RB } },
-
-{ "sthux",   X(31,439),	X_MASK,		PPC|POWER,	{ RS, RAS, RB } },
+{ "sthxe",   X(31,415),	X_MASK,		BOOKE64,	{ RS, RA, RB } },
 
-{ "mr",	     XRC(31,444,0), X_MASK,	PPC|POWER,	{ RA, RS, RBS } },
-{ "or",      XRC(31,444,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "mr.",     XRC(31,444,1), X_MASK,	PPC|POWER,	{ RA, RS, RBS } },
-{ "or.",     XRC(31,444,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
+{ "slbie",   X(31,434),	XRTRA_MASK,	PPC64,		{ RB } },
 
-{ "mtdcr",   X(31,451),	X_MASK,		PPC,		{ SPR, RS } },
+{ "ecowx",   X(31,438),	X_MASK,		PPC,		{ RT, RA, RB } },
 
-{ "divdu",   XO(31,457,0,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "divdu.",  XO(31,457,0,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "divduo",  XO(31,457,1,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "divduo.", XO(31,457,1,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
+{ "sthux",   X(31,439),	X_MASK,		COM,		{ RS, RAS, RB } },
+
+{ "sthuxe",  X(31,447),	X_MASK,		BOOKE64,	{ RS, RAS, RB } },
+
+{ "mr",	     XRC(31,444,0), X_MASK,	COM,		{ RA, RS, RBS } },
+{ "or",      XRC(31,444,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "mr.",     XRC(31,444,1), X_MASK,	COM,		{ RA, RS, RBS } },
+{ "or.",     XRC(31,444,1), X_MASK,	COM,		{ RA, RS, RB } },
+
+{ "mtexisr",  XSPR(31,451,64),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtexier",  XSPR(31,451,66),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr0",    XSPR(31,451,128), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr1",    XSPR(31,451,129), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr2",    XSPR(31,451,130), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr3",    XSPR(31,451,131), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr4",    XSPR(31,451,132), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr5",    XSPR(31,451,133), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr6",    XSPR(31,451,134), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbr7",    XSPR(31,451,135), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbear",   XSPR(31,451,144), XSPR_MASK, PPC403,	{ RS } },
+{ "mtbesr",   XSPR(31,451,145), XSPR_MASK, PPC403,	{ RS } },
+{ "mtiocr",   XSPR(31,451,160), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacr0", XSPR(31,451,192), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmact0", XSPR(31,451,193), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmada0", XSPR(31,451,194), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmasa0", XSPR(31,451,195), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacc0", XSPR(31,451,196), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacr1", XSPR(31,451,200), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmact1", XSPR(31,451,201), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmada1", XSPR(31,451,202), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmasa1", XSPR(31,451,203), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacc1", XSPR(31,451,204), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacr2", XSPR(31,451,208), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmact2", XSPR(31,451,209), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmada2", XSPR(31,451,210), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmasa2", XSPR(31,451,211), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacc2", XSPR(31,451,212), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacr3", XSPR(31,451,216), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmact3", XSPR(31,451,217), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmada3", XSPR(31,451,218), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmasa3", XSPR(31,451,219), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmacc3", XSPR(31,451,220), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdmasr",  XSPR(31,451,224), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdcr",    X(31,451),	X_MASK,	PPC403 | BOOKE,	{ SPR, RS } },
+
+{ "subfze64",XO(31,456,0,0), XORB_MASK, BOOKE64,	{ RT, RA } },
+{ "subfze64o",XO(31,456,1,0), XORB_MASK, BOOKE64,	{ RT, RA } },
+
+{ "divdu",   XO(31,457,0,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "divdu.",  XO(31,457,0,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "divduo",  XO(31,457,1,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "divduo.", XO(31,457,1,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
+
+{ "addze64", XO(31,458,0,0), XORB_MASK, BOOKE64,	{ RT, RA } },
+{ "addze64o",XO(31,458,1,0), XORB_MASK, BOOKE64,	{ RT, RA } },
 
 { "divwu",   XO(31,459,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "divwu.",  XO(31,459,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "divwuo",  XO(31,459,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "divwuo.", XO(31,459,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 
-{ "mtmq",    XSPR(31,467,0), XSPR_MASK,	POWER|M601,	{ RS } },
-{ "mtxer",   XSPR(31,467,1), XSPR_MASK,	PPC|POWER,	{ RS } },
-{ "mtlr",    XSPR(31,467,8), XSPR_MASK,	PPC|POWER,	{ RS } },
-{ "mtctr",   XSPR(31,467,9), XSPR_MASK,	PPC|POWER,	{ RS } },
-{ "mttid",   XSPR(31,467,17), XSPR_MASK, POWER,		{ RS } },
-{ "mtdsisr", XSPR(31,467,18), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtdar",   XSPR(31,467,19), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtrtcu",  XSPR(31,467,20), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtrtcl",  XSPR(31,467,21), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtdec",   XSPR(31,467,22), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtsdr0",  XSPR(31,467,24), XSPR_MASK, POWER,		{ RS } },
-{ "mtsdr1",  XSPR(31,467,25), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtsrr0",  XSPR(31,467,26), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtsrr1",  XSPR(31,467,27), XSPR_MASK, PPC|POWER,	{ RS } },
-{ "mtsprg",  XSPR(31,467,272), XSPRG_MASK, PPC,		{ SPRG, RS } },
-{ "mtasr",   XSPR(31,467,280), XSPR_MASK, PPC|B64,	{ RS } },
-{ "mtear",   XSPR(31,467,282), XSPR_MASK, PPC,		{ RS } },
-{ "mttbl",   XSPR(31,467,284), XSPR_MASK, PPC,		{ RS } },
-{ "mttbu",   XSPR(31,467,285), XSPR_MASK, PPC,		{ RS } },
-{ "mtibatu", XSPR(31,467,528), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
-{ "mtibatl", XSPR(31,467,529), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
-{ "mtdbatu", XSPR(31,467,536), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
-{ "mtdbatl", XSPR(31,467,537), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
-{ "mtspr",   X(31,467),	X_MASK,		PPC|POWER,	{ SPR, RS } },
+{ "mtmq",      XSPR(31,467,0),    XSPR_MASK, M601,	{ RS } },
+{ "mtxer",     XSPR(31,467,1),    XSPR_MASK, COM,	{ RS } },
+{ "mtlr",      XSPR(31,467,8),    XSPR_MASK, COM,	{ RS } },
+{ "mtctr",     XSPR(31,467,9),    XSPR_MASK, COM,	{ RS } },
+{ "mttid",     XSPR(31,467,17),   XSPR_MASK, POWER,	{ RS } },
+{ "mtdsisr",   XSPR(31,467,18),   XSPR_MASK, COM,	{ RS } },
+{ "mtdar",     XSPR(31,467,19),   XSPR_MASK, COM,	{ RS } },
+{ "mtrtcu",    XSPR(31,467,20),   XSPR_MASK, COM,	{ RS } },
+{ "mtrtcl",    XSPR(31,467,21),   XSPR_MASK, COM,	{ RS } },
+{ "mtdec",     XSPR(31,467,22),   XSPR_MASK, COM,	{ RS } },
+{ "mtsdr0",    XSPR(31,467,24),   XSPR_MASK, POWER,	{ RS } },
+{ "mtsdr1",    XSPR(31,467,25),   XSPR_MASK, COM,	{ RS } },
+{ "mtsrr0",    XSPR(31,467,26),   XSPR_MASK, COM,	{ RS } },
+{ "mtsrr1",    XSPR(31,467,27),   XSPR_MASK, COM,	{ RS } },
+{ "mtpid",     XSPR(31,467,48),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtpid",     XSPR(31,467,945),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtdecar",   XSPR(31,467,54),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtcsrr0",   XSPR(31,467,58),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtcsrr1",   XSPR(31,467,59),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtdear",    XSPR(31,467,61),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtdear",    XSPR(31,467,981),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtesr",     XSPR(31,467,62),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtesr",     XSPR(31,467,980),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtivpr",    XSPR(31,467,63),   XSPR_MASK, BOOKE,     { RS } },
+{ "mtcmpa",    XSPR(31,467,144),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmpb",    XSPR(31,467,145),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmpc",    XSPR(31,467,146),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmpd",    XSPR(31,467,147),  XSPR_MASK, PPC860,	{ RS } },
+{ "mticr",     XSPR(31,467,148),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtder",     XSPR(31,467,149),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcounta",  XSPR(31,467,150),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcountb",  XSPR(31,467,151),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmpe",    XSPR(31,467,152),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmpf",    XSPR(31,467,153),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmpg",    XSPR(31,467,154),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtcmph",    XSPR(31,467,155),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtlctrl1",  XSPR(31,467,156),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtlctrl2",  XSPR(31,467,157),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtictrl",   XSPR(31,467,158),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtbar",     XSPR(31,467,159),  XSPR_MASK, PPC860,	{ RS } },
+{ "mtvrsave",  XSPR(31,467,256),  XSPR_MASK, PPCVEC,	{ RS } },
+{ "mtusprg0",  XSPR(31,467,256),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtsprg",    XSPR(31,467,272),  XSPRG_MASK,PPC,	{ SPRG, RS } },
+{ "mtsprg0",   XSPR(31,467,272),  XSPR_MASK, PPC,	{ RS } },
+{ "mtsprg1",   XSPR(31,467,273),  XSPR_MASK, PPC,	{ RS } },
+{ "mtsprg2",   XSPR(31,467,274),  XSPR_MASK, PPC,	{ RS } },
+{ "mtsprg3",   XSPR(31,467,275),  XSPR_MASK, PPC,	{ RS } },
+{ "mtsprg4",   XSPR(31,467,276),  XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtsprg5",   XSPR(31,467,277),  XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtsprg6",   XSPR(31,467,278),  XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtsprg7",   XSPR(31,467,279),  XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtasr",     XSPR(31,467,280),  XSPR_MASK, PPC64,	{ RS } },
+{ "mtear",     XSPR(31,467,282),  XSPR_MASK, PPC,	{ RS } },
+{ "mttbl",     XSPR(31,467,284),  XSPR_MASK, PPC,	{ RS } },
+{ "mttbu",     XSPR(31,467,285),  XSPR_MASK, PPC,	{ RS } },
+{ "mtdbsr",    XSPR(31,467,304),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdbsr",    XSPR(31,467,1008), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdbcr0",   XSPR(31,467,308),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdbcr0",   XSPR(31,467,1010), XSPR_MASK, PPC405,	{ RS } },
+{ "mtdbcr1",   XSPR(31,467,309),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdbcr1",   XSPR(31,467,957),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtdbcr2",   XSPR(31,467,310),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtiac1",    XSPR(31,467,312),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtiac1",    XSPR(31,467,1012), XSPR_MASK, PPC403,	{ RS } },
+{ "mtiac2",    XSPR(31,467,313),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtiac2",    XSPR(31,467,1013), XSPR_MASK, PPC403,	{ RS } },
+{ "mtiac3",    XSPR(31,467,314),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtiac3",    XSPR(31,467,948),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtiac4",    XSPR(31,467,315),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtiac4",    XSPR(31,467,949),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtdac1",    XSPR(31,467,316),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdac1",    XSPR(31,467,1014), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdac2",    XSPR(31,467,317),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdac2",    XSPR(31,467,1015), XSPR_MASK, PPC403,	{ RS } },
+{ "mtdvc1",    XSPR(31,467,318),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdvc1",    XSPR(31,467,950),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtdvc2",    XSPR(31,467,319),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtdvc2",    XSPR(31,467,951),  XSPR_MASK, PPC405,	{ RS } },
+{ "mttsr",     XSPR(31,467,336),  XSPR_MASK, BOOKE,     { RS } },
+{ "mttsr",     XSPR(31,467,984),  XSPR_MASK, PPC403,	{ RS } },
+{ "mttcr",     XSPR(31,467,340),  XSPR_MASK, BOOKE,     { RS } },
+{ "mttcr",     XSPR(31,467,986),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtivor0",   XSPR(31,467,400),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor1",   XSPR(31,467,401),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor2",   XSPR(31,467,402),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor3",   XSPR(31,467,403),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor4",   XSPR(31,467,404),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor5",   XSPR(31,467,405),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor6",   XSPR(31,467,406),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor7",   XSPR(31,467,407),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor8",   XSPR(31,467,408),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor9",   XSPR(31,467,409),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor10",  XSPR(31,467,410),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor11",  XSPR(31,467,411),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor12",  XSPR(31,467,412),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor13",  XSPR(31,467,413),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor14",  XSPR(31,467,414),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtivor15",  XSPR(31,467,415),  XSPR_MASK, BOOKE,     { RS } },
+{ "mtspefscr",  XSPR(31,467,512),  XSPR_MASK, PPCSPE,   { RS } },
+{ "mtbbear",   XSPR(31,467,513),  XSPR_MASK, PPCBRLK,   { RS } },
+{ "mtbbtar",   XSPR(31,467,514),  XSPR_MASK, PPCBRLK,  { RS } },
+{ "mtibatu",   XSPR(31,467,528),  XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
+{ "mtibatl",   XSPR(31,467,529),  XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
+{ "mtdbatu",   XSPR(31,467,536),  XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
+{ "mtdbatl",   XSPR(31,467,537),  XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
+{ "mtmcsrr0",  XSPR(31,467,570),  XSPR_MASK, PPCRFMCI,  { RS } },
+{ "mtmcsrr1",  XSPR(31,467,571),  XSPR_MASK, PPCRFMCI,  { RS } },
+{ "mtmcsr",    XSPR(31,467,572),  XSPR_MASK, PPCRFMCI,  { RS } },
+{ "mtummcr0",  XSPR(31,467,936),  XSPR_MASK, PPC750,    { RS } },
+{ "mtupmc1",   XSPR(31,467,937),  XSPR_MASK, PPC750,    { RS } },
+{ "mtupmc2",   XSPR(31,467,938),  XSPR_MASK, PPC750,    { RS } },
+{ "mtusia",    XSPR(31,467,939),  XSPR_MASK, PPC750,    { RS } },
+{ "mtummcr1",  XSPR(31,467,940),  XSPR_MASK, PPC750,    { RS } },
+{ "mtupmc3",   XSPR(31,467,941),  XSPR_MASK, PPC750,    { RS } },
+{ "mtupmc4",   XSPR(31,467,942),  XSPR_MASK, PPC750,    { RS } },
+{ "mtzpr",     XSPR(31,467,944),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtccr0",    XSPR(31,467,947),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtmmcr0",   XSPR(31,467,952),  XSPR_MASK, PPC750,    { RS } },
+{ "mtsgr",     XSPR(31,467,953),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtpmc1",    XSPR(31,467,953),  XSPR_MASK, PPC750,    { RS } },
+{ "mtdcwr",    XSPR(31,467,954),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtpmc2",    XSPR(31,467,954),  XSPR_MASK, PPC750,    { RS } },
+{ "mtsler",    XSPR(31,467,955),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtsia",     XSPR(31,467,955),  XSPR_MASK, PPC750,    { RS } },
+{ "mtsu0r",    XSPR(31,467,956),  XSPR_MASK, PPC405,	{ RS } },
+{ "mtmmcr1",   XSPR(31,467,956),  XSPR_MASK, PPC750,    { RS } },
+{ "mtpmc3",    XSPR(31,467,957),  XSPR_MASK, PPC750,    { RS } },
+{ "mtpmc4",    XSPR(31,467,958),  XSPR_MASK, PPC750,    { RS } },
+{ "mticdbdr",  XSPR(31,467,979),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtevpr",    XSPR(31,467,982),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtcdbcr",   XSPR(31,467,983),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtpit",     XSPR(31,467,987),  XSPR_MASK, PPC403,	{ RS } },
+{ "mttbhi",    XSPR(31,467,988),  XSPR_MASK, PPC403,	{ RS } },
+{ "mttblo",    XSPR(31,467,989),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtsrr2",    XSPR(31,467,990),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtsrr3",    XSPR(31,467,991),  XSPR_MASK, PPC403,	{ RS } },
+{ "mtl2cr",    XSPR(31,467,1017), XSPR_MASK, PPC750,    { RS } },
+{ "mtdccr",    XSPR(31,467,1018), XSPR_MASK, PPC403,	{ RS } },
+{ "mticcr",    XSPR(31,467,1019), XSPR_MASK, PPC403,	{ RS } },
+{ "mtictc",    XSPR(31,467,1019), XSPR_MASK, PPC750,    { RS } },
+{ "mtpbl1",    XSPR(31,467,1020), XSPR_MASK, PPC403,	{ RS } },
+{ "mtthrm1",   XSPR(31,467,1020), XSPR_MASK, PPC750,    { RS } },
+{ "mtpbu1",    XSPR(31,467,1021), XSPR_MASK, PPC403,	{ RS } },
+{ "mtthrm2",   XSPR(31,467,1021), XSPR_MASK, PPC750,    { RS } },
+{ "mtpbl2",    XSPR(31,467,1022), XSPR_MASK, PPC403,	{ RS } },
+{ "mtthrm3",   XSPR(31,467,1022), XSPR_MASK, PPC750,    { RS } },
+{ "mtpbu2",    XSPR(31,467,1023), XSPR_MASK, PPC403,	{ RS } },
+{ "mtspr",     X(31,467),	  X_MASK,    COM,	{ SPR, RS } },
 
 { "dcbi",    X(31,470),	XRT_MASK,	PPC,		{ RA, RB } },
 
-{ "nand",    XRC(31,476,0), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
-{ "nand.",   XRC(31,476,1), X_MASK,	PPC|POWER,	{ RA, RS, RB } },
+{ "nand",    XRC(31,476,0), X_MASK,	COM,		{ RA, RS, RB } },
+{ "nand.",   XRC(31,476,1), X_MASK,	COM,		{ RA, RS, RB } },
+
+{ "dcbie",   X(31,478),	XRT_MASK,	BOOKE64,	{ RA, RB } },
+
+{ "dcread",  X(31,486),	X_MASK,		PPC403|PPC440,	{ RT, RA, RB }},
 
-{ "nabs",    XO(31,488,0,0), XORB_MASK, POWER|M601,	{ RT, RA } },
-{ "nabs.",   XO(31,488,0,1), XORB_MASK, POWER|M601,	{ RT, RA } },
-{ "nabso",   XO(31,488,1,0), XORB_MASK, POWER|M601,	{ RT, RA } },
-{ "nabso.",  XO(31,488,1,1), XORB_MASK, POWER|M601,	{ RT, RA } },
+{ "mtpmr",   X(31,462),	X_MASK,		PPCPMR,		{ PMR, RS }},
 
-{ "divd",    XO(31,489,0,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "divd.",   XO(31,489,0,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "divdo",   XO(31,489,1,0), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
-{ "divdo.",  XO(31,489,1,1), XO_MASK,	PPC|B64,	{ RT, RA, RB } },
+{ "icbtls",  X(31,486),	X_MASK,		PPCCHLK,	{ CT, RA, RB }},
+
+{ "nabs",    XO(31,488,0,0), XORB_MASK, M601,		{ RT, RA } },
+{ "subfme64",XO(31,488,0,0), XORB_MASK, BOOKE64,	{ RT, RA } },
+{ "nabs.",   XO(31,488,0,1), XORB_MASK, M601,		{ RT, RA } },
+{ "nabso",   XO(31,488,1,0), XORB_MASK, M601,		{ RT, RA } },
+{ "subfme64o",XO(31,488,1,0), XORB_MASK, BOOKE64,	{ RT, RA } },
+{ "nabso.",  XO(31,488,1,1), XORB_MASK, M601,		{ RT, RA } },
+
+{ "divd",    XO(31,489,0,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "divd.",   XO(31,489,0,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "divdo",   XO(31,489,1,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
+{ "divdo.",  XO(31,489,1,1), XO_MASK,	PPC64,		{ RT, RA, RB } },
+
+{ "addme64", XO(31,490,0,0), XORB_MASK, BOOKE64,	{ RT, RA } },
+{ "addme64o",XO(31,490,1,0), XORB_MASK, BOOKE64,	{ RT, RA } },
 
 { "divw",    XO(31,491,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "divw.",   XO(31,491,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "divwo",   XO(31,491,1,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "divwo.",  XO(31,491,1,1), XO_MASK,	PPC,		{ RT, RA, RB } },
 
-{ "slbia",   X(31,498),	0xffffffff,	PPC|B64,	{ 0 } },
+{ "icbtlse", X(31,494),	X_MASK,		PPCCHLK64,	{ CT, RA, RB }},
+
+{ "slbia",   X(31,498),	0xffffffff,	PPC64,		{ 0 } },
 
 { "cli",     X(31,502), XRB_MASK,	POWER,		{ RT, RA } },
 
-{ "mcrxr",   X(31,512),	XRARB_MASK|(3<<21), PPC|POWER,	{ BF } },
+{ "stdcxe.", XRC(31,511,1), X_MASK,	BOOKE64,	{ RS, RA, RB } },
 
-{ "clcs",    X(31,531), XRB_MASK,	POWER|M601,	{ RT, RA } },
+{ "mcrxr",   X(31,512),	XRARB_MASK|(3<<21), COM,	{ BF } },
 
-{ "lswx",    X(31,533),	X_MASK,		PPC,		{ RT, RA, RB } },
-{ "lsx",     X(31,533),	X_MASK,		POWER,		{ RT, RA, RB } },
+{ "bblels",  X(31,518),	X_MASK,		PPCBRLK,	{ 0 }},
+{ "mcrxr64", X(31,544),	XRARB_MASK|(3<<21), BOOKE64,	{ BF } },
 
-{ "lwbrx",   X(31,534),	X_MASK,		PPC,		{ RT, RA, RB } },
-{ "lbrx",    X(31,534),	X_MASK,		POWER,		{ RT, RA, RB } },
+{ "clcs",    X(31,531), XRB_MASK,	M601,		{ RT, RA } },
 
-{ "lfsx",    X(31,535),	X_MASK,		PPC|POWER,	{ FRT, RA, RB } },
+{ "lswx",    X(31,533),	X_MASK,		PPCCOM,		{ RT, RA, RB } },
+{ "lsx",     X(31,533),	X_MASK,		PWRCOM,		{ RT, RA, RB } },
 
-{ "srw",     XRC(31,536,0), X_MASK,	PPC,		{ RA, RS, RB } },
-{ "sr",      XRC(31,536,0), X_MASK,	POWER,		{ RA, RS, RB } },
-{ "srw.",    XRC(31,536,1), X_MASK,	PPC,		{ RA, RS, RB } },
-{ "sr.",     XRC(31,536,1), X_MASK,	POWER,		{ RA, RS, RB } },
+{ "lwbrx",   X(31,534),	X_MASK,		PPCCOM,		{ RT, RA, RB } },
+{ "lbrx",    X(31,534),	X_MASK,		PWRCOM,		{ RT, RA, RB } },
 
-{ "rrib",    XRC(31,537,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "rrib.",   XRC(31,537,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "lfsx",    X(31,535),	X_MASK,		COM,		{ FRT, RA, RB } },
 
-{ "srd",     XRC(31,539,0), X_MASK,	PPC|B64,	{ RA, RS, RB } },
-{ "srd.",    XRC(31,539,1), X_MASK,	PPC|B64,	{ RA, RS, RB } },
+{ "srw",     XRC(31,536,0), X_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "sr",      XRC(31,536,0), X_MASK,	PWRCOM,		{ RA, RS, RB } },
+{ "srw.",    XRC(31,536,1), X_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "sr.",     XRC(31,536,1), X_MASK,	PWRCOM,		{ RA, RS, RB } },
 
-{ "maskir",  XRC(31,541,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "maskir.", XRC(31,541,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "rrib",    XRC(31,537,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "rrib.",   XRC(31,537,1), X_MASK,	M601,		{ RA, RS, RB } },
 
+{ "srd",     XRC(31,539,0), X_MASK,	PPC64,		{ RA, RS, RB } },
+{ "srd.",    XRC(31,539,1), X_MASK,	PPC64,		{ RA, RS, RB } },
+
+{ "maskir",  XRC(31,541,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "maskir.", XRC(31,541,1), X_MASK,	M601,		{ RA, RS, RB } },
+
+{ "lwbrxe",  X(31,542),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
+
+{ "lfsxe",   X(31,543),	X_MASK,		BOOKE64,	{ FRT, RA, RB } },
+
+{ "bbelr",   X(31,550),	X_MASK,		PPCBRLK,	{ 0 }},
 { "tlbsync", X(31,566),	0xffffffff,	PPC,		{ 0 } },
 
-{ "lfsux",   X(31,567),	X_MASK,		PPC|POWER,	{ FRT, RAS, RB } },
+{ "lfsux",   X(31,567),	X_MASK,		COM,		{ FRT, RAS, RB } },
+
+{ "lfsuxe",  X(31,575),	X_MASK,		BOOKE64,	{ FRT, RAS, RB } },
+
+{ "mfsr",    X(31,595),	XRB_MASK|(1<<20), COM32,	{ RT, SR } },
+
+{ "lswi",    X(31,597),	X_MASK,		PPCCOM,		{ RT, RA, NB } },
+{ "lsi",     X(31,597),	X_MASK,		PWRCOM,		{ RT, RA, NB } },
+
+{ "lwsync",  XSYNC(31,598,1), 0xffffffff, PPC,		{ 0 } },
+{ "ptesync", XSYNC(31,598,2), 0xffffffff, PPC64,	{ 0 } },
+{ "msync",   X(31,598), 0xffffffff,	BOOKE,		{ 0 } },
+{ "sync",    X(31,598), XSYNC_MASK,	PPCCOM,		{ LS } },
+{ "dcs",     X(31,598), 0xffffffff,	PWRCOM,		{ 0 } },
+
+{ "lfdx",    X(31,599), X_MASK,		COM,		{ FRT, RA, RB } },
+
+{ "lfdxe",   X(31,607), X_MASK,		BOOKE64,	{ FRT, RA, RB } },
+
+{ "mfsri",   X(31,627), X_MASK,		PWRCOM,		{ RT, RA, RB } },
+
+{ "dclst",   X(31,630), XRB_MASK,	PWRCOM,		{ RS, RA } },
+
+{ "lfdux",   X(31,631), X_MASK,		COM,		{ FRT, RAS, RB } },
+
+{ "lfduxe",  X(31,639), X_MASK,		BOOKE64,	{ FRT, RAS, RB } },
+
+{ "mfsrin",  X(31,659), XRA_MASK,	PPC32,		{ RT, RB } },
+
+{ "stswx",   X(31,661), X_MASK,		PPCCOM,		{ RS, RA, RB } },
+{ "stsx",    X(31,661), X_MASK,		PWRCOM,		{ RS, RA, RB } },
+
+{ "stwbrx",  X(31,662), X_MASK,		PPCCOM,		{ RS, RA, RB } },
+{ "stbrx",   X(31,662), X_MASK,		PWRCOM,		{ RS, RA, RB } },
+
+{ "stfsx",   X(31,663), X_MASK,		COM,		{ FRS, RA, RB } },
+
+{ "srq",     XRC(31,664,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "srq.",    XRC(31,664,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "mfsr",    X(31,595),	XRB_MASK|(1<<20), PPC|POWER|B32, { RT, SR } },
+{ "sre",     XRC(31,665,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "sre.",    XRC(31,665,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "lswi",    X(31,597),	X_MASK,		PPC,		{ RT, RA, NB } },
-{ "lsi",     X(31,597),	X_MASK,		POWER,		{ RT, RA, NB } },
+{ "stwbrxe", X(31,670), X_MASK,		BOOKE64,	{ RS, RA, RB } },
 
-{ "sync",    X(31,598), 0xffffffff,	PPC,		{ 0 } },
-{ "dcs",     X(31,598), 0xffffffff,	POWER,		{ 0 } },
+{ "stfsxe",  X(31,671), X_MASK,		BOOKE64,	{ FRS, RA, RB } },
 
-{ "lfdx",    X(31,599), X_MASK,		PPC|POWER,	{ FRT, RA, RB } },
+{ "stfsux",  X(31,695),	X_MASK,		COM,		{ FRS, RAS, RB } },
 
-{ "mfsri",   X(31,627), X_MASK,		POWER,		{ RT, RA, RB } },
+{ "sriq",    XRC(31,696,0), X_MASK,	M601,		{ RA, RS, SH } },
+{ "sriq.",   XRC(31,696,1), X_MASK,	M601,		{ RA, RS, SH } },
 
-{ "dclst",   X(31,630), XRB_MASK,	POWER,		{ RS, RA } },
+{ "stfsuxe", X(31,703),	X_MASK,		BOOKE64,	{ FRS, RAS, RB } },
 
-{ "lfdux",   X(31,631), X_MASK,		PPC|POWER,	{ FRT, RAS, RB } },
+{ "stswi",   X(31,725),	X_MASK,		PPCCOM,		{ RS, RA, NB } },
+{ "stsi",    X(31,725),	X_MASK,		PWRCOM,		{ RS, RA, NB } },
 
-{ "mfsrin",  X(31,659), XRA_MASK,	PPC|B32,	{ RT, RB } },
+{ "stfdx",   X(31,727),	X_MASK,		COM,		{ FRS, RA, RB } },
 
-{ "stswx",   X(31,661), X_MASK,		PPC,		{ RS, RA, RB } },
-{ "stsx",    X(31,661), X_MASK,		POWER,		{ RS, RA, RB } },
+{ "srlq",    XRC(31,728,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "srlq.",   XRC(31,728,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "stwbrx",  X(31,662), X_MASK,		PPC,		{ RS, RA, RB } },
-{ "stbrx",   X(31,662), X_MASK,		POWER,		{ RS, RA, RB } },
+{ "sreq",    XRC(31,729,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "sreq.",   XRC(31,729,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "stfsx",   X(31,663), X_MASK,		PPC|POWER,	{ FRS, RA, RB } },
+{ "stfdxe",  X(31,735),	X_MASK,		BOOKE64,	{ FRS, RA, RB } },
 
-{ "srq",     XRC(31,664,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "srq.",    XRC(31,664,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "dcba",    X(31,758),	XRT_MASK,	PPC405 | BOOKE,	{ RA, RB } },
 
-{ "sre",     XRC(31,665,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "sre.",    XRC(31,665,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "stfdux",  X(31,759),	X_MASK,		COM,		{ FRS, RAS, RB } },
 
-{ "stfsux",  X(31,695),	X_MASK,		PPC|POWER,	{ FRS, RAS, RB } },
+{ "srliq",   XRC(31,760,0), X_MASK,	M601,		{ RA, RS, SH } },
+{ "srliq.",  XRC(31,760,1), X_MASK,	M601,		{ RA, RS, SH } },
 
-{ "sriq",    XRC(31,696,0), X_MASK,	POWER|M601,	{ RA, RS, SH } },
-{ "sriq.",   XRC(31,696,1), X_MASK,	POWER|M601,	{ RA, RS, SH } },
+{ "dcbae",   X(31,766),	XRT_MASK,	BOOKE64,	{ RA, RB } },
 
-{ "stswi",   X(31,725),	X_MASK,		PPC,		{ RS, RA, NB } },
-{ "stsi",    X(31,725),	X_MASK,		POWER,		{ RS, RA, NB } },
+{ "stfduxe", X(31,767),	X_MASK,		BOOKE64,	{ FRS, RAS, RB } },
 
-{ "stfdx",   X(31,727),	X_MASK,		PPC|POWER,	{ FRS, RA, RB } },
+{ "tlbivax", X(31,786),	XRT_MASK,	BOOKE,		{ RA, RB } },
+{ "tlbivaxe",X(31,787),	XRT_MASK,	BOOKE64,	{ RA, RB } },
 
-{ "srlq",    XRC(31,728,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "srlq.",   XRC(31,728,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "lhbrx",   X(31,790),	X_MASK,		COM,		{ RT, RA, RB } },
 
-{ "sreq",    XRC(31,729,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "sreq.",   XRC(31,729,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "sraw",    XRC(31,792,0), X_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "sra",     XRC(31,792,0), X_MASK,	PWRCOM,		{ RA, RS, RB } },
+{ "sraw.",   XRC(31,792,1), X_MASK,	PPCCOM,		{ RA, RS, RB } },
+{ "sra.",    XRC(31,792,1), X_MASK,	PWRCOM,		{ RA, RS, RB } },
 
-{ "stfdux",  X(31,759),	X_MASK,		PPC|POWER,	{ FRS, RAS, RB } },
+{ "srad",    XRC(31,794,0), X_MASK,	PPC64,		{ RA, RS, RB } },
+{ "srad.",   XRC(31,794,1), X_MASK,	PPC64,		{ RA, RS, RB } },
 
-{ "srliq",   XRC(31,760,0), X_MASK,	POWER|M601,	{ RA, RS, SH } },
-{ "srliq.",  XRC(31,760,1), X_MASK,	POWER|M601,	{ RA, RS, SH } },
+{ "lhbrxe",  X(31,798),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
 
-{ "lhbrx",   X(31,790),	X_MASK,		PPC|POWER,	{ RT, RA, RB } },
+{ "ldxe",    X(31,799),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
+{ "lduxe",   X(31,831),	X_MASK,		BOOKE64,	{ RT, RA, RB } },
 
-{ "sraw",    XRC(31,792,0), X_MASK,	PPC,		{ RA, RS, RB } },
-{ "sra",     XRC(31,792,0), X_MASK,	POWER,		{ RA, RS, RB } },
-{ "sraw.",   XRC(31,792,1), X_MASK,	PPC,		{ RA, RS, RB } },
-{ "sra.",    XRC(31,792,1), X_MASK,	POWER,		{ RA, RS, RB } },
+{ "rac",     X(31,818),	X_MASK,		PWRCOM,		{ RT, RA, RB } },
 
-{ "srad",    XRC(31,794,0), X_MASK,	PPC|B64,	{ RA, RS, RB } },
-{ "srad.",   XRC(31,794,1), X_MASK,	PPC|B64,	{ RA, RS, RB } },
+{ "dss",     XDSS(31,822,0), XDSS_MASK,	PPCVEC,		{ STRM } },
+{ "dssall",  XDSS(31,822,1), XDSS_MASK,	PPCVEC,		{ 0 } },
 
-{ "rac",     X(31,818),	X_MASK,		POWER,		{ RT, RA, RB } },
+{ "srawi",   XRC(31,824,0), X_MASK,	PPCCOM,		{ RA, RS, SH } },
+{ "srai",    XRC(31,824,0), X_MASK,	PWRCOM,		{ RA, RS, SH } },
+{ "srawi.",  XRC(31,824,1), X_MASK,	PPCCOM,		{ RA, RS, SH } },
+{ "srai.",   XRC(31,824,1), X_MASK,	PWRCOM,		{ RA, RS, SH } },
 
-{ "srawi",   XRC(31,824,0), X_MASK,	PPC,		{ RA, RS, SH } },
-{ "srai",    XRC(31,824,0), X_MASK,	POWER,		{ RA, RS, SH } },
-{ "srawi.",  XRC(31,824,1), X_MASK,	PPC,		{ RA, RS, SH } },
-{ "srai.",   XRC(31,824,1), X_MASK,	POWER,		{ RA, RS, SH } },
+{ "slbmfev", X(31,851), XRA_MASK,	PPC64,		{ RT, RB } },
 
+{ "mbar",    X(31,854),	X_MASK,		BOOKE,		{ MO } },
 { "eieio",   X(31,854),	0xffffffff,	PPC,		{ 0 } },
 
-{ "sthbrx",  X(31,918),	X_MASK,		PPC|POWER,	{ RS, RA, RB } },
+{ "tlbsx",   XRC(31,914,0), X_MASK,	BOOKE,		{ RA, RB } },
+{ "tlbsx",   XRC(31,914,0), X_MASK, 	PPC403,		{ RT, RA, RB } },
+{ "tlbsx.",  XRC(31,914,1), X_MASK,	BOOKE,		{ RA, RB } },
+{ "tlbsx.",  XRC(31,914,1), X_MASK, 	PPC403,		{ RT, RA, RB } },
+{ "tlbsxe",  XRC(31,915,0), X_MASK,	BOOKE64,	{ RA, RB } },
+{ "tlbsxe.", XRC(31,915,1), X_MASK,	BOOKE64,	{ RA, RB } },
 
-{ "sraq",    XRC(31,920,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "sraq.",   XRC(31,920,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "slbmfee", X(31,915), XRA_MASK,	PPC64,		{ RT, RB } },
 
-{ "srea",    XRC(31,921,0), X_MASK,	POWER|M601,	{ RA, RS, RB } },
-{ "srea.",   XRC(31,921,1), X_MASK,	POWER|M601,	{ RA, RS, RB } },
+{ "sthbrx",  X(31,918),	X_MASK,		COM,		{ RS, RA, RB } },
 
-{ "extsh",   XRC(31,922,0), XRB_MASK,	PPC,		{ RA, RS } },
-{ "exts",    XRC(31,922,0), XRB_MASK,	POWER,		{ RA, RS } },
-{ "extsh.",  XRC(31,922,1), XRB_MASK,	PPC,		{ RA, RS } },
-{ "exts.",   XRC(31,922,1), XRB_MASK,	POWER,		{ RA, RS } },
+{ "sraq",    XRC(31,920,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "sraq.",   XRC(31,920,1), X_MASK,	M601,		{ RA, RS, RB } },
 
-{ "sraiq",   XRC(31,952,0), X_MASK,	POWER|M601,	{ RA, RS, SH } },
-{ "sraiq.",  XRC(31,952,1), X_MASK,	POWER|M601,	{ RA, RS, SH } },
+{ "srea",    XRC(31,921,0), X_MASK,	M601,		{ RA, RS, RB } },
+{ "srea.",   XRC(31,921,1), X_MASK,	M601,		{ RA, RS, RB } },
+
+{ "extsh",   XRC(31,922,0), XRB_MASK,	PPCCOM,		{ RA, RS } },
+{ "exts",    XRC(31,922,0), XRB_MASK,	PWRCOM,		{ RA, RS } },
+{ "extsh.",  XRC(31,922,1), XRB_MASK,	PPCCOM,		{ RA, RS } },
+{ "exts.",   XRC(31,922,1), XRB_MASK,	PWRCOM,		{ RA, RS } },
+
+{ "sthbrxe", X(31,926),	X_MASK,		BOOKE64,	{ RS, RA, RB } },
+
+{ "stdxe",   X(31,927), X_MASK,		BOOKE64,	{ RS, RA, RB } },
+
+{ "tlbrehi", XTLB(31,946,0), XTLB_MASK,	PPC403,		{ RT, RA } },
+{ "tlbrelo", XTLB(31,946,1), XTLB_MASK,	PPC403,		{ RT, RA } },
+{ "tlbre",   X(31,946),	X_MASK,		BOOKE,		{ 0 } },
+{ "tlbre",   X(31,946),	X_MASK,		PPC403,		{ RS, RA, SH } },
+
+{ "sraiq",   XRC(31,952,0), X_MASK,	M601,		{ RA, RS, SH } },
+{ "sraiq.",  XRC(31,952,1), X_MASK,	M601,		{ RA, RS, SH } },
 
 { "extsb",   XRC(31,954,0), XRB_MASK,	PPC,		{ RA, RS} },
 { "extsb.",  XRC(31,954,1), XRB_MASK,	PPC,		{ RA, RS} },
 
-{ "iccci",   X(31,966),	XRT_MASK,	PPC,		{ RA, RB } },
+{ "stduxe",  X(31,959),	X_MASK,		BOOKE64,	{ RS, RAS, RB } },
+
+{ "iccci",   X(31,966),	XRT_MASK,	PPC403|PPC440,	{ RA, RB } },
+
+{ "tlbwehi", XTLB(31,978,0), XTLB_MASK,	PPC403,		{ RT, RA } },
+{ "tlbwelo", XTLB(31,978,1), XTLB_MASK,	PPC403,		{ RT, RA } },
+{ "tlbwe",   X(31,978),	X_MASK,		BOOKE,		{ 0 } },
+{ "tlbwe",   X(31,978),	X_MASK,		PPC403,		{ RS, RA, SH } },
+{ "tlbld",   X(31,978),	XRTRA_MASK,	PPC,		{ RB } },
 
 { "icbi",    X(31,982),	XRT_MASK,	PPC,		{ RA, RB } },
 
 { "stfiwx",  X(31,983),	X_MASK,		PPC,		{ FRS, RA, RB } },
 
-{ "extsw",   XRC(31,986,0), XRB_MASK,	PPC,		{ RA, RS } },
-{ "extsw.",  XRC(31,986,1), XRB_MASK,	PPC,		{ RA, RS } },
+{ "extsw",   XRC(31,986,0), XRB_MASK,	PPC64 | BOOKE64,{ RA, RS } },
+{ "extsw.",  XRC(31,986,1), XRB_MASK,	PPC64,		{ RA, RS } },
+
+{ "icread",  X(31,998),	XRT_MASK,	PPC403|PPC440,	{ RA, RB } },
+
+{ "icbie",   X(31,990),	XRT_MASK,	BOOKE64,	{ RA, RB } },
+{ "stfiwxe", X(31,991),	X_MASK,		BOOKE64,	{ FRS, RA, RB } },
+
+{ "tlbli",   X(31,1010), XRTRA_MASK,	PPC,		{ RB } },
 
 { "dcbz",    X(31,1014), XRT_MASK,	PPC,		{ RA, RB } },
 { "dclz",    X(31,1014), XRT_MASK,	PPC,		{ RA, RB } },
 
-{ "lwz",     OP(32),	OP_MASK,	PPC,		{ RT, D, RA } },
-{ "l",	     OP(32),	OP_MASK,	POWER,		{ RT, D, RA } },
+{ "dcbze",   X(31,1022), XRT_MASK,	BOOKE64,	{ RA, RB } },
+
+{ "lvebx",   X(31,   7), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "lvehx",   X(31,  39), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "lvewx",   X(31,  71), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "lvsl",    X(31,   6), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "lvsr",    X(31,  38), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "lvx",     X(31, 103), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "lvxl",    X(31, 359), X_MASK,	PPCVEC,		{ VD, RA, RB } },
+{ "stvebx",  X(31, 135), X_MASK,	PPCVEC,		{ VS, RA, RB } },
+{ "stvehx",  X(31, 167), X_MASK,	PPCVEC,		{ VS, RA, RB } },
+{ "stvewx",  X(31, 199), X_MASK,	PPCVEC,		{ VS, RA, RB } },
+{ "stvx",    X(31, 231), X_MASK,	PPCVEC,		{ VS, RA, RB } },
+{ "stvxl",   X(31, 487), X_MASK,	PPCVEC,		{ VS, RA, RB } },
+
+{ "lwz",     OP(32),	OP_MASK,	PPCCOM,		{ RT, D, RA } },
+{ "l",	     OP(32),	OP_MASK,	PWRCOM,		{ RT, D, RA } },
 
-{ "lwzu",    OP(33),	OP_MASK,	PPC,		{ RT, D, RAL } },
-{ "lu",      OP(33),	OP_MASK,	POWER,		{ RT, D, RA } },
+{ "lwzu",    OP(33),	OP_MASK,	PPCCOM,		{ RT, D, RAL } },
+{ "lu",      OP(33),	OP_MASK,	PWRCOM,		{ RT, D, RA } },
 
-{ "lbz",     OP(34),	OP_MASK,	PPC|POWER,	{ RT, D, RA } },
+{ "lbz",     OP(34),	OP_MASK,	COM,		{ RT, D, RA } },
 
-{ "lbzu",    OP(35),	OP_MASK,	PPC|POWER,	{ RT, D, RAL } },
+{ "lbzu",    OP(35),	OP_MASK,	COM,		{ RT, D, RAL } },
 
-{ "stw",     OP(36),	OP_MASK,	PPC,		{ RS, D, RA } },
-{ "st",      OP(36),	OP_MASK,	POWER,		{ RS, D, RA } },
+{ "stw",     OP(36),	OP_MASK,	PPCCOM,		{ RS, D, RA } },
+{ "st",      OP(36),	OP_MASK,	PWRCOM,		{ RS, D, RA } },
 
-{ "stwu",    OP(37),	OP_MASK,	PPC,		{ RS, D, RAS } },
-{ "stu",     OP(37),	OP_MASK,	POWER,		{ RS, D, RA } },
+{ "stwu",    OP(37),	OP_MASK,	PPCCOM,		{ RS, D, RAS } },
+{ "stu",     OP(37),	OP_MASK,	PWRCOM,		{ RS, D, RA } },
 
-{ "stb",     OP(38),	OP_MASK,	PPC|POWER,	{ RS, D, RA } },
+{ "stb",     OP(38),	OP_MASK,	COM,		{ RS, D, RA } },
 
-{ "stbu",    OP(39),	OP_MASK,	PPC|POWER,	{ RS, D, RAS } },
+{ "stbu",    OP(39),	OP_MASK,	COM,		{ RS, D, RAS } },
 
-{ "lhz",     OP(40),	OP_MASK,	PPC|POWER,	{ RT, D, RA } },
+{ "lhz",     OP(40),	OP_MASK,	COM,		{ RT, D, RA } },
 
-{ "lhzu",    OP(41),	OP_MASK,	PPC|POWER,	{ RT, D, RAL } },
+{ "lhzu",    OP(41),	OP_MASK,	COM,		{ RT, D, RAL } },
 
-{ "lha",     OP(42),	OP_MASK,	PPC|POWER,	{ RT, D, RA } },
+{ "lha",     OP(42),	OP_MASK,	COM,		{ RT, D, RA } },
 
-{ "lhau",    OP(43),	OP_MASK,	PPC|POWER,	{ RT, D, RAL } },
+{ "lhau",    OP(43),	OP_MASK,	COM,		{ RT, D, RAL } },
 
-{ "sth",     OP(44),	OP_MASK,	PPC|POWER,	{ RS, D, RA } },
+{ "sth",     OP(44),	OP_MASK,	COM,		{ RS, D, RA } },
 
-{ "sthu",    OP(45),	OP_MASK,	PPC|POWER,	{ RS, D, RAS } },
+{ "sthu",    OP(45),	OP_MASK,	COM,		{ RS, D, RAS } },
 
-{ "lmw",     OP(46),	OP_MASK,	PPC,		{ RT, D, RAM } },
-{ "lm",      OP(46),	OP_MASK,	POWER,		{ RT, D, RA } },
+{ "lmw",     OP(46),	OP_MASK,	PPCCOM,		{ RT, D, RAM } },
+{ "lm",      OP(46),	OP_MASK,	PWRCOM,		{ RT, D, RA } },
 
-{ "stmw",    OP(47),	OP_MASK,	PPC,		{ RS, D, RA } },
-{ "stm",     OP(47),	OP_MASK,	POWER,		{ RS, D, RA } },
+{ "stmw",    OP(47),	OP_MASK,	PPCCOM,		{ RS, D, RA } },
+{ "stm",     OP(47),	OP_MASK,	PWRCOM,		{ RS, D, RA } },
 
-{ "lfs",     OP(48),	OP_MASK,	PPC|POWER,	{ FRT, D, RA } },
+{ "lfs",     OP(48),	OP_MASK,	COM,		{ FRT, D, RA } },
 
-{ "lfsu",    OP(49),	OP_MASK,	PPC|POWER,	{ FRT, D, RAS } },
+{ "lfsu",    OP(49),	OP_MASK,	COM,		{ FRT, D, RAS } },
 
-{ "lfd",     OP(50),	OP_MASK,	PPC|POWER,	{ FRT, D, RA } },
+{ "lfd",     OP(50),	OP_MASK,	COM,		{ FRT, D, RA } },
 
-{ "lfdu",    OP(51),	OP_MASK,	PPC|POWER,	{ FRT, D, RAS } },
+{ "lfdu",    OP(51),	OP_MASK,	COM,		{ FRT, D, RAS } },
 
-{ "stfs",    OP(52),	OP_MASK,	PPC|POWER,	{ FRS, D, RA } },
+{ "stfs",    OP(52),	OP_MASK,	COM,		{ FRS, D, RA } },
 
-{ "stfsu",   OP(53),	OP_MASK,	PPC|POWER,	{ FRS, D, RAS } },
+{ "stfsu",   OP(53),	OP_MASK,	COM,		{ FRS, D, RAS } },
 
-{ "stfd",    OP(54),	OP_MASK,	PPC|POWER,	{ FRS, D, RA } },
+{ "stfd",    OP(54),	OP_MASK,	COM,		{ FRS, D, RA } },
 
-{ "stfdu",   OP(55),	OP_MASK,	PPC|POWER,	{ FRS, D, RAS } },
+{ "stfdu",   OP(55),	OP_MASK,	COM,		{ FRS, D, RAS } },
+
+{ "lq",      OP(56),	OP_MASK,	POWER4,		{ RTQ, DQ, RAQ } },
 
 { "lfq",     OP(56),	OP_MASK,	POWER2,		{ FRT, D, RA } },
 
 { "lfqu",    OP(57),	OP_MASK,	POWER2,		{ FRT, D, RA } },
 
-{ "ld",      DSO(58,0),	DS_MASK,	PPC|B64,	{ RT, DS, RA } },
+{ "lbze",    DEO(58,0), DE_MASK,	BOOKE64,	{ RT, DE, RA } },
+{ "lbzue",   DEO(58,1), DE_MASK,	BOOKE64,	{ RT, DE, RAL } },
+{ "lhze",    DEO(58,2), DE_MASK,	BOOKE64,	{ RT, DE, RA } },
+{ "lhzue",   DEO(58,3), DE_MASK,	BOOKE64,	{ RT, DE, RAL } },
+{ "lhae",    DEO(58,4), DE_MASK,	BOOKE64,	{ RT, DE, RA } },
+{ "lhaue",   DEO(58,5), DE_MASK,	BOOKE64,	{ RT, DE, RAL } },
+{ "lwze",    DEO(58,6), DE_MASK,	BOOKE64,	{ RT, DE, RA } },
+{ "lwzue",   DEO(58,7), DE_MASK,	BOOKE64,	{ RT, DE, RAL } },
+{ "stbe",    DEO(58,8), DE_MASK,	BOOKE64,	{ RS, DE, RA } },
+{ "stbue",   DEO(58,9), DE_MASK,	BOOKE64,	{ RS, DE, RAS } },
+{ "sthe",    DEO(58,10), DE_MASK,	BOOKE64,	{ RS, DE, RA } },
+{ "sthue",   DEO(58,11), DE_MASK,	BOOKE64,	{ RS, DE, RAS } },
+{ "stwe",    DEO(58,14), DE_MASK,	BOOKE64,	{ RS, DE, RA } },
+{ "stwue",   DEO(58,15), DE_MASK,	BOOKE64,	{ RS, DE, RAS } },
+
+{ "ld",      DSO(58,0),	DS_MASK,	PPC64,		{ RT, DS, RA } },
 
-{ "ldu",     DSO(58,1), DS_MASK,	PPC|B64,	{ RT, DS, RAL } },
+{ "ldu",     DSO(58,1), DS_MASK,	PPC64,		{ RT, DS, RAL } },
 
-{ "lwa",     DSO(58,2), DS_MASK,	PPC|B64,	{ RT, DS, RA } },
+{ "lwa",     DSO(58,2), DS_MASK,	PPC64,		{ RT, DS, RA } },
 
 { "fdivs",   A(59,18,0), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
 { "fdivs.",  A(59,18,1), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
@@ -2560,113 +4434,128 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "stfqu",   OP(61),	OP_MASK,	POWER2,		{ FRS, D, RA } },
 
-{ "std",     DSO(62,0),	DS_MASK,	PPC|B64,	{ RS, DS, RA } },
+{ "lde",     DEO(62,0), DE_MASK,	BOOKE64,	{ RT, DES, RA } },
+{ "ldue",    DEO(62,1), DE_MASK,	BOOKE64,	{ RT, DES, RA } },
+{ "lfse",    DEO(62,4), DE_MASK,	BOOKE64,	{ FRT, DES, RA } },
+{ "lfsue",   DEO(62,5), DE_MASK,	BOOKE64,	{ FRT, DES, RAS } },
+{ "lfde",    DEO(62,6), DE_MASK,	BOOKE64,	{ FRT, DES, RA } },
+{ "lfdue",   DEO(62,7), DE_MASK,	BOOKE64,	{ FRT, DES, RAS } },
+{ "stde",    DEO(62,8), DE_MASK,	BOOKE64,	{ RS, DES, RA } },
+{ "stdue",   DEO(62,9), DE_MASK,	BOOKE64,	{ RS, DES, RAS } },
+{ "stfse",   DEO(62,12), DE_MASK,	BOOKE64,	{ FRS, DES, RA } },
+{ "stfsue",  DEO(62,13), DE_MASK,	BOOKE64,	{ FRS, DES, RAS } },
+{ "stfde",   DEO(62,14), DE_MASK,	BOOKE64,	{ FRS, DES, RA } },
+{ "stfdue",  DEO(62,15), DE_MASK,	BOOKE64,	{ FRS, DES, RAS } },
 
-{ "stdu",    DSO(62,1),	DS_MASK,	PPC|B64,	{ RS, DS, RAS } },
+{ "std",     DSO(62,0),	DS_MASK,	PPC64,		{ RS, DS, RA } },
 
-{ "fcmpu",   X(63,0),	X_MASK|(3<<21),	PPC|POWER,	{ BF, FRA, FRB } },
+{ "stdu",    DSO(62,1),	DS_MASK,	PPC64,		{ RS, DS, RAS } },
 
-{ "frsp",    XRC(63,12,0), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
-{ "frsp.",   XRC(63,12,1), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
+{ "stq",     DSO(62,2),	DS_MASK,	POWER4,		{ RSQ, DS, RA } },
 
-{ "fctiw",   XRC(63,14,0), XRA_MASK,	PPC,		{ FRT, FRB } },
+{ "fcmpu",   X(63,0),	X_MASK|(3<<21),	COM,		{ BF, FRA, FRB } },
+
+{ "frsp",    XRC(63,12,0), XRA_MASK,	COM,		{ FRT, FRB } },
+{ "frsp.",   XRC(63,12,1), XRA_MASK,	COM,		{ FRT, FRB } },
+
+{ "fctiw",   XRC(63,14,0), XRA_MASK,	PPCCOM,		{ FRT, FRB } },
 { "fcir",    XRC(63,14,0), XRA_MASK,	POWER2,		{ FRT, FRB } },
-{ "fctiw.",  XRC(63,14,1), XRA_MASK,	PPC,		{ FRT, FRB } },
+{ "fctiw.",  XRC(63,14,1), XRA_MASK,	PPCCOM,		{ FRT, FRB } },
 { "fcir.",   XRC(63,14,1), XRA_MASK,	POWER2,		{ FRT, FRB } },
 
-{ "fctiwz",  XRC(63,15,0), XRA_MASK,	PPC,		{ FRT, FRB } },
+{ "fctiwz",  XRC(63,15,0), XRA_MASK,	PPCCOM,		{ FRT, FRB } },
 { "fcirz",   XRC(63,15,0), XRA_MASK,	POWER2,		{ FRT, FRB } },
-{ "fctiwz.", XRC(63,15,1), XRA_MASK,	PPC,		{ FRT, FRB } },
+{ "fctiwz.", XRC(63,15,1), XRA_MASK,	PPCCOM,		{ FRT, FRB } },
 { "fcirz.",  XRC(63,15,1), XRA_MASK,	POWER2,		{ FRT, FRB } },
 
-{ "fdiv",    A(63,18,0), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
-{ "fd",      A(63,18,0), AFRC_MASK,	POWER,		{ FRT, FRA, FRB } },
-{ "fdiv.",   A(63,18,1), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
-{ "fd.",     A(63,18,1), AFRC_MASK,	POWER,		{ FRT, FRA, FRB } },
+{ "fdiv",    A(63,18,0), AFRC_MASK,	PPCCOM,		{ FRT, FRA, FRB } },
+{ "fd",      A(63,18,0), AFRC_MASK,	PWRCOM,		{ FRT, FRA, FRB } },
+{ "fdiv.",   A(63,18,1), AFRC_MASK,	PPCCOM,		{ FRT, FRA, FRB } },
+{ "fd.",     A(63,18,1), AFRC_MASK,	PWRCOM,		{ FRT, FRA, FRB } },
 
-{ "fsub",    A(63,20,0), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
-{ "fs",      A(63,20,0), AFRC_MASK,	POWER,		{ FRT, FRA, FRB } },
-{ "fsub.",   A(63,20,1), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
-{ "fs.",     A(63,20,1), AFRC_MASK,	POWER,		{ FRT, FRA, FRB } },
+{ "fsub",    A(63,20,0), AFRC_MASK,	PPCCOM,		{ FRT, FRA, FRB } },
+{ "fs",      A(63,20,0), AFRC_MASK,	PWRCOM,		{ FRT, FRA, FRB } },
+{ "fsub.",   A(63,20,1), AFRC_MASK,	PPCCOM,		{ FRT, FRA, FRB } },
+{ "fs.",     A(63,20,1), AFRC_MASK,	PWRCOM,		{ FRT, FRA, FRB } },
 
-{ "fadd",    A(63,21,0), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
-{ "fa",      A(63,21,0), AFRC_MASK,	POWER,		{ FRT, FRA, FRB } },
-{ "fadd.",   A(63,21,1), AFRC_MASK,	PPC,		{ FRT, FRA, FRB } },
-{ "fa.",     A(63,21,1), AFRC_MASK,	POWER,		{ FRT, FRA, FRB } },
+{ "fadd",    A(63,21,0), AFRC_MASK,	PPCCOM,		{ FRT, FRA, FRB } },
+{ "fa",      A(63,21,0), AFRC_MASK,	PWRCOM,		{ FRT, FRA, FRB } },
+{ "fadd.",   A(63,21,1), AFRC_MASK,	PPCCOM,		{ FRT, FRA, FRB } },
+{ "fa.",     A(63,21,1), AFRC_MASK,	PWRCOM,		{ FRT, FRA, FRB } },
 
-{ "fsqrt",   A(63,22,0), AFRAFRC_MASK,	PPC|POWER2,	{ FRT, FRB } },
-{ "fsqrt.",  A(63,22,1), AFRAFRC_MASK,	PPC|POWER2,	{ FRT, FRB } },
+{ "fsqrt",   A(63,22,0), AFRAFRC_MASK,	PPCPWR2,	{ FRT, FRB } },
+{ "fsqrt.",  A(63,22,1), AFRAFRC_MASK,	PPCPWR2,	{ FRT, FRB } },
 
 { "fsel",    A(63,23,0), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
 { "fsel.",   A(63,23,1), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
 
-{ "fmul",    A(63,25,0), AFRB_MASK,	PPC,		{ FRT, FRA, FRC } },
-{ "fm",      A(63,25,0), AFRB_MASK,	POWER,		{ FRT, FRA, FRC } },
-{ "fmul.",   A(63,25,1), AFRB_MASK,	PPC,		{ FRT, FRA, FRC } },
-{ "fm.",     A(63,25,1), AFRB_MASK,	POWER,		{ FRT, FRA, FRC } },
+{ "fmul",    A(63,25,0), AFRB_MASK,	PPCCOM,		{ FRT, FRA, FRC } },
+{ "fm",      A(63,25,0), AFRB_MASK,	PWRCOM,		{ FRT, FRA, FRC } },
+{ "fmul.",   A(63,25,1), AFRB_MASK,	PPCCOM,		{ FRT, FRA, FRC } },
+{ "fm.",     A(63,25,1), AFRB_MASK,	PWRCOM,		{ FRT, FRA, FRC } },
 
 { "frsqrte", A(63,26,0), AFRAFRC_MASK,	PPC,		{ FRT, FRB } },
 { "frsqrte.",A(63,26,1), AFRAFRC_MASK,	PPC,		{ FRT, FRB } },
 
-{ "fmsub",   A(63,28,0), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fms",     A(63,28,0), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
-{ "fmsub.",  A(63,28,1), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fms.",    A(63,28,1), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
+{ "fmsub",   A(63,28,0), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fms",     A(63,28,0), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fmsub.",  A(63,28,1), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fms.",    A(63,28,1), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
 
-{ "fmadd",   A(63,29,0), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fma",     A(63,29,0), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
-{ "fmadd.",  A(63,29,1), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fma.",    A(63,29,1), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
+{ "fmadd",   A(63,29,0), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fma",     A(63,29,0), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fmadd.",  A(63,29,1), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fma.",    A(63,29,1), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
 
-{ "fnmsub",  A(63,30,0), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fnms",    A(63,30,0), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
-{ "fnmsub.", A(63,30,1), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fnms.",   A(63,30,1), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
+{ "fnmsub",  A(63,30,0), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fnms",    A(63,30,0), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fnmsub.", A(63,30,1), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fnms.",   A(63,30,1), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
 
-{ "fnmadd",  A(63,31,0), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fnma",    A(63,31,0), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
-{ "fnmadd.", A(63,31,1), A_MASK,	PPC,		{ FRT,FRA,FRC,FRB } },
-{ "fnma.",   A(63,31,1), A_MASK,	POWER,		{ FRT,FRA,FRC,FRB } },
+{ "fnmadd",  A(63,31,0), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fnma",    A(63,31,0), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fnmadd.", A(63,31,1), A_MASK,	PPCCOM,		{ FRT,FRA,FRC,FRB } },
+{ "fnma.",   A(63,31,1), A_MASK,	PWRCOM,		{ FRT,FRA,FRC,FRB } },
 
-{ "fcmpo",   X(63,30),	X_MASK|(3<<21),	PPC|POWER,	{ BF, FRA, FRB } },
+{ "fcmpo",   X(63,32),	X_MASK|(3<<21),	COM,		{ BF, FRA, FRB } },
 
-{ "mtfsb1",  XRC(63,38,0), XRARB_MASK,	PPC|POWER,	{ BT } },
-{ "mtfsb1.", XRC(63,38,1), XRARB_MASK,	PPC|POWER,	{ BT } },
+{ "mtfsb1",  XRC(63,38,0), XRARB_MASK,	COM,		{ BT } },
+{ "mtfsb1.", XRC(63,38,1), XRARB_MASK,	COM,		{ BT } },
 
-{ "fneg",    XRC(63,40,0), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
-{ "fneg.",   XRC(63,40,1), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
+{ "fneg",    XRC(63,40,0), XRA_MASK,	COM,		{ FRT, FRB } },
+{ "fneg.",   XRC(63,40,1), XRA_MASK,	COM,		{ FRT, FRB } },
 
-{ "mcrfs",   X(63,64),	XRB_MASK|(3<<21)|(3<<16), PPC|POWER, { BF, BFA } },
+{ "mcrfs",   X(63,64),	XRB_MASK|(3<<21)|(3<<16), COM,	{ BF, BFA } },
 
-{ "mtfsb0",  XRC(63,70,0), XRARB_MASK,	PPC|POWER,	{ BT } },
-{ "mtfsb0.", XRC(63,70,1), XRARB_MASK,	PPC|POWER,	{ BT } },
+{ "mtfsb0",  XRC(63,70,0), XRARB_MASK,	COM,		{ BT } },
+{ "mtfsb0.", XRC(63,70,1), XRARB_MASK,	COM,		{ BT } },
 
-{ "fmr",     XRC(63,72,0), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
-{ "fmr.",    XRC(63,72,1), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
+{ "fmr",     XRC(63,72,0), XRA_MASK,	COM,		{ FRT, FRB } },
+{ "fmr.",    XRC(63,72,1), XRA_MASK,	COM,		{ FRT, FRB } },
 
-{ "mtfsfi",  XRC(63,134,0), XRA_MASK|(3<<21)|(1<<11), PPC|POWER, { BF, U } },
-{ "mtfsfi.", XRC(63,134,1), XRA_MASK|(3<<21)|(1<<11), PPC|POWER, { BF, U } },
+{ "mtfsfi",  XRC(63,134,0), XRA_MASK|(3<<21)|(1<<11), COM, { BF, U } },
+{ "mtfsfi.", XRC(63,134,1), XRA_MASK|(3<<21)|(1<<11), COM, { BF, U } },
 
-{ "fnabs",   XRC(63,136,0), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
-{ "fnabs.",  XRC(63,136,1), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
+{ "fnabs",   XRC(63,136,0), XRA_MASK,	COM,		{ FRT, FRB } },
+{ "fnabs.",  XRC(63,136,1), XRA_MASK,	COM,		{ FRT, FRB } },
 
-{ "fabs",    XRC(63,264,0), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
-{ "fabs.",   XRC(63,264,1), XRA_MASK,	PPC|POWER,	{ FRT, FRB } },
+{ "fabs",    XRC(63,264,0), XRA_MASK,	COM,		{ FRT, FRB } },
+{ "fabs.",   XRC(63,264,1), XRA_MASK,	COM,		{ FRT, FRB } },
 
-{ "mffs",    XRC(63,583,0), XRARB_MASK,	PPC|POWER,	{ FRT } },
-{ "mffs.",   XRC(63,583,1), XRARB_MASK,	PPC|POWER,	{ FRT } },
+{ "mffs",    XRC(63,583,0), XRARB_MASK,	COM,		{ FRT } },
+{ "mffs.",   XRC(63,583,1), XRARB_MASK,	COM,		{ FRT } },
 
-{ "mtfsf",   XFL(63,711,0), XFL_MASK,	PPC|POWER,	{ FLM, FRB } },
-{ "mtfsf.",  XFL(63,711,1), XFL_MASK,	PPC|POWER,	{ FLM, FRB } },
+{ "mtfsf",   XFL(63,711,0), XFL_MASK,	COM,		{ FLM, FRB } },
+{ "mtfsf.",  XFL(63,711,1), XFL_MASK,	COM,		{ FLM, FRB } },
 
-{ "fctid",   XRC(63,814,0), XRA_MASK,	PPC|B64,	{ FRT, FRB } },
-{ "fctid.",  XRC(63,814,1), XRA_MASK,	PPC|B64,	{ FRT, FRB } },
+{ "fctid",   XRC(63,814,0), XRA_MASK,	PPC64,		{ FRT, FRB } },
+{ "fctid.",  XRC(63,814,1), XRA_MASK,	PPC64,		{ FRT, FRB } },
 
-{ "fctidz",  XRC(63,815,0), XRA_MASK,	PPC|B64,	{ FRT, FRB } },
-{ "fctidz.", XRC(63,815,1), XRA_MASK,	PPC|B64,	{ FRT, FRB } },
+{ "fctidz",  XRC(63,815,0), XRA_MASK,	PPC64,		{ FRT, FRB } },
+{ "fctidz.", XRC(63,815,1), XRA_MASK,	PPC64,		{ FRT, FRB } },
 
-{ "fcfid",   XRC(63,846,0), XRA_MASK,	PPC|B64,	{ FRT, FRB } },
-{ "fcfid.",  XRC(63,846,1), XRA_MASK,	PPC|B64,	{ FRT, FRB } },
+{ "fcfid",   XRC(63,846,0), XRA_MASK,	PPC64,		{ FRT, FRB } },
+{ "fcfid.",  XRC(63,846,1), XRA_MASK,	PPC64,		{ FRT, FRB } },
 
 };
 
@@ -2675,47 +4564,56 @@ const int powerpc_num_opcodes =
 
 /* The macro table.  This is only used by the assembler.  */
 
-const struct powerpc_macro powerpc_macros[] = {
-{ "extldi",  4,   PPC|B64,	"rldicr %0,%1,%3,(%2)-1" },
-{ "extldi.", 4,   PPC|B64,	"rldicr. %0,%1,%3,(%2)-1" },
-{ "extrdi",  4,   PPC|B64,	"rldicl %0,%1,(%2)+(%3),64-(%2)" },
-{ "extrdi.", 4,   PPC|B64,	"rldicl. %0,%1,(%2)+(%3),64-(%2)" },
-{ "insrdi",  4,   PPC|B64,	"rldimi %0,%1,64-((%2)+(%3)),%3" },
-{ "insrdi.", 4,   PPC|B64,	"rldimi. %0,%1,64-((%2)+(%3)),%3" },
-{ "rotrdi",  3,   PPC|B64,	"rldicl %0,%1,64-(%2),0" },
-{ "rotrdi.", 3,   PPC|B64,	"rldicl. %0,%1,64-(%2),0" },
-{ "sldi",    3,   PPC|B64,	"rldicr %0,%1,%2,63-(%2)" },
-{ "sldi.",   3,   PPC|B64,	"rldicr. %0,%1,%2,63-(%2)" },
-{ "srdi",    3,   PPC|B64,	"rldicl %0,%1,64-(%2),%2" },
-{ "srdi.",   3,   PPC|B64,	"rldicl. %0,%1,64-(%2),%2" },
-{ "clrrdi",  3,   PPC|B64,	"rldicr %0,%1,0,63-(%2)" },
-{ "clrrdi.", 3,   PPC|B64,	"rldicr. %0,%1,0,63-(%2)" },
-{ "clrlsldi",4,   PPC|B64,	"rldic %0,%1,%3,(%2)-(%3)" },
-{ "clrlsldi.",4,  PPC|B64,	"rldic. %0,%1,%3,(%2)-(%3)" },
-
-{ "extlwi",  4,   PPC,		"rlwinm %0,%1,%3,0,(%2)-1" },
-{ "extlwi.", 4,   PPC,		"rlwinm. %0,%1,%3,0,(%2)-1" },
-{ "extrwi",  4,   PPC,		"rlwinm %0,%1,(%2)+(%3),32-(%2),31" },
-{ "extrwi.", 4,   PPC,		"rlwinm. %0,%1,(%2)+(%3),32-(%2),31" },
-{ "inslwi",  4,   PPC,		"rlwimi %0,%1,32-(%3),%3,(%2)+(%3)-1" },
-{ "inslwi.", 4,   PPC,		"rlwimi. %0,%1,32-(%3),%3,(%2)+(%3)-1" },
-{ "insrwi",  4,   PPC,		"rlwimi %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1" },
-{ "insrwi.", 4,   PPC,		"rlwimi. %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1"},
-{ "rotrwi",  3,   PPC,		"rlwinm %0,%1,32-(%2),0,31" },
-{ "rotrwi.", 3,   PPC,		"rlwinm. %0,%1,32-(%2),0,31" },
-{ "slwi",    3,   PPC,		"rlwinm %0,%1,%2,0,31-(%2)" },
-{ "sli",     3,   POWER,	"rlinm %0,%1,%2,0,31-(%2)" },
-{ "slwi.",   3,   PPC,		"rlwinm. %0,%1,%2,0,31-(%2)" },
-{ "sli.",    3,   POWER,	"rlinm. %0,%1,%2,0,31-(%2)" },
-{ "srwi",    3,   PPC,		"rlwinm %0,%1,32-(%2),%2,31" },
-{ "sri",     3,   POWER,	"rlinm %0,%1,32-(%2),%2,31" },
-{ "srwi.",   3,   PPC,		"rlwinm. %0,%1,32-(%2),%2,31" },
-{ "sri.",    3,   POWER,	"rlinm. %0,%1,32-(%2),%2,31" },
-{ "clrrwi",  3,   PPC,		"rlwinm %0,%1,0,0,31-(%2)" },
-{ "clrrwi.", 3,   PPC,		"rlwinm. %0,%1,0,0,31-(%2)" },
-{ "clrlslwi",4,   PPC,		"rlwinm %0,%1,%3,(%2)-(%3),31-(%3)" },
-{ "clrlslwi.",4,  PPC,		"rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" },
+/* The expressions of the form (-x ! 31) & (x | 31) have the value 0
+   when x=0; 32-x when x is between 1 and 31; are negative if x is
+   negative; and are 32 or more otherwise.  This is what you want
+   when, for instance, you are emulating a right shift by a
+   rotate-left-and-mask, because the underlying instructions support
+   shifts of size 0 but not shifts of size 32.  By comparison, when
+   extracting x bits from some word you want to use just 32-x, because
+   the underlying instructions don't support extracting 0 bits but do
+   support extracting the whole word (32 bits in this case).  */
 
+const struct powerpc_macro powerpc_macros[] = {
+{ "extldi",  4,   PPC64,	"rldicr %0,%1,%3,(%2)-1" },
+{ "extldi.", 4,   PPC64,	"rldicr. %0,%1,%3,(%2)-1" },
+{ "extrdi",  4,   PPC64,	"rldicl %0,%1,(%2)+(%3),64-(%2)" },
+{ "extrdi.", 4,   PPC64,	"rldicl. %0,%1,(%2)+(%3),64-(%2)" },
+{ "insrdi",  4,   PPC64,	"rldimi %0,%1,64-((%2)+(%3)),%3" },
+{ "insrdi.", 4,   PPC64,	"rldimi. %0,%1,64-((%2)+(%3)),%3" },
+{ "rotrdi",  3,   PPC64,	"rldicl %0,%1,(-(%2)!63)&((%2)|63),0" },
+{ "rotrdi.", 3,   PPC64,	"rldicl. %0,%1,(-(%2)!63)&((%2)|63),0" },
+{ "sldi",    3,   PPC64,	"rldicr %0,%1,%2,63-(%2)" },
+{ "sldi.",   3,   PPC64,	"rldicr. %0,%1,%2,63-(%2)" },
+{ "srdi",    3,   PPC64,	"rldicl %0,%1,(-(%2)!63)&((%2)|63),%2" },
+{ "srdi.",   3,   PPC64,	"rldicl. %0,%1,(-(%2)!63)&((%2)|63),%2" },
+{ "clrrdi",  3,   PPC64,	"rldicr %0,%1,0,63-(%2)" },
+{ "clrrdi.", 3,   PPC64,	"rldicr. %0,%1,0,63-(%2)" },
+{ "clrlsldi",4,   PPC64,	"rldic %0,%1,%3,(%2)-(%3)" },
+{ "clrlsldi.",4,  PPC64,	"rldic. %0,%1,%3,(%2)-(%3)" },
+
+{ "extlwi",  4,   PPCCOM,	"rlwinm %0,%1,%3,0,(%2)-1" },
+{ "extlwi.", 4,   PPCCOM,	"rlwinm. %0,%1,%3,0,(%2)-1" },
+{ "extrwi",  4,   PPCCOM,	"rlwinm %0,%1,((%2)+(%3))&((%2)+(%3)<>32),32-(%2),31" },
+{ "extrwi.", 4,   PPCCOM,	"rlwinm. %0,%1,((%2)+(%3))&((%2)+(%3)<>32),32-(%2),31" },
+{ "inslwi",  4,   PPCCOM,	"rlwimi %0,%1,(-(%3)!31)&((%3)|31),%3,(%2)+(%3)-1" },
+{ "inslwi.", 4,   PPCCOM,	"rlwimi. %0,%1,(-(%3)!31)&((%3)|31),%3,(%2)+(%3)-1"},
+{ "insrwi",  4,   PPCCOM,	"rlwimi %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1" },
+{ "insrwi.", 4,   PPCCOM,	"rlwimi. %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1"},
+{ "rotrwi",  3,   PPCCOM,	"rlwinm %0,%1,(-(%2)!31)&((%2)|31),0,31" },
+{ "rotrwi.", 3,   PPCCOM,	"rlwinm. %0,%1,(-(%2)!31)&((%2)|31),0,31" },
+{ "slwi",    3,   PPCCOM,	"rlwinm %0,%1,%2,0,31-(%2)" },
+{ "sli",     3,   PWRCOM,	"rlinm %0,%1,%2,0,31-(%2)" },
+{ "slwi.",   3,   PPCCOM,	"rlwinm. %0,%1,%2,0,31-(%2)" },
+{ "sli.",    3,   PWRCOM,	"rlinm. %0,%1,%2,0,31-(%2)" },
+{ "srwi",    3,   PPCCOM,	"rlwinm %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "sri",     3,   PWRCOM,	"rlinm %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "srwi.",   3,   PPCCOM,	"rlwinm. %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "sri.",    3,   PWRCOM,	"rlinm. %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "clrrwi",  3,   PPCCOM,	"rlwinm %0,%1,0,0,31-(%2)" },
+{ "clrrwi.", 3,   PPCCOM,	"rlwinm. %0,%1,0,0,31-(%2)" },
+{ "clrlslwi",4,   PPCCOM,	"rlwinm %0,%1,%3,(%2)-(%3),31-(%3)" },
+{ "clrlslwi.",4,  PPCCOM,	"rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" },
 };
 
 const int powerpc_num_macros =
diff --git a/arch/ppc64/xmon/ppc.h b/arch/ppc64/xmon/ppc.h
index 2345ecba1..342237e8d 100644
--- a/arch/ppc64/xmon/ppc.h
+++ b/arch/ppc64/xmon/ppc.h
@@ -1,5 +1,6 @@
 /* ppc.h -- Header file for PowerPC opcode table
-   Copyright 1994 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support
 
 This file is part of GDB, GAS, and the GNU binutils.
@@ -58,24 +59,80 @@ extern const int powerpc_num_opcodes;
 /* Values defined for the flags field of a struct powerpc_opcode.  */
 
 /* Opcode is defined for the PowerPC architecture.  */
-#define PPC_OPCODE_PPC (01)
+#define PPC_OPCODE_PPC			 1
 
 /* Opcode is defined for the POWER (RS/6000) architecture.  */
-#define PPC_OPCODE_POWER (02)
+#define PPC_OPCODE_POWER		 2
 
 /* Opcode is defined for the POWER2 (Rios 2) architecture.  */
-#define PPC_OPCODE_POWER2 (04)
+#define PPC_OPCODE_POWER2		 4
 
 /* Opcode is only defined on 32 bit architectures.  */
-#define PPC_OPCODE_32 (010)
+#define PPC_OPCODE_32			 8
 
 /* Opcode is only defined on 64 bit architectures.  */
-#define PPC_OPCODE_64 (020)
+#define PPC_OPCODE_64		      0x10
 
 /* Opcode is supported by the Motorola PowerPC 601 processor.  The 601
    is assumed to support all PowerPC (PPC_OPCODE_PPC) instructions,
    but it also supports many additional POWER instructions.  */
-#define PPC_OPCODE_601 (040)
+#define PPC_OPCODE_601		      0x20
+
+/* Opcode is supported in both the Power and PowerPC architectures
+   (ie, compiler's -mcpu=common or assembler's -mcom).  */
+#define PPC_OPCODE_COMMON	      0x40
+
+/* Opcode is supported for any Power or PowerPC platform (this is
+   for the assembler's -many option, and it eliminates duplicates).  */
+#define PPC_OPCODE_ANY		      0x80
+
+/* Opcode is supported as part of the 64-bit bridge.  */
+#define PPC_OPCODE_64_BRIDGE	     0x100
+
+/* Opcode is supported by Altivec Vector Unit */
+#define PPC_OPCODE_ALTIVEC	     0x200
+
+/* Opcode is supported by PowerPC 403 processor.  */
+#define PPC_OPCODE_403		     0x400
+
+/* Opcode is supported by PowerPC BookE processor.  */
+#define PPC_OPCODE_BOOKE	     0x800
+
+/* Opcode is only supported by 64-bit PowerPC BookE processor.  */
+#define PPC_OPCODE_BOOKE64	    0x1000
+
+/* Opcode is supported by PowerPC 440 processor.  */
+#define PPC_OPCODE_440		    0x2000
+
+/* Opcode is only supported by Power4 architecture.  */
+#define PPC_OPCODE_POWER4	    0x4000
+
+/* Opcode isn't supported by Power4 architecture.  */
+#define PPC_OPCODE_NOPOWER4	    0x8000
+
+/* Opcode is only supported by POWERPC Classic architecture.  */
+#define PPC_OPCODE_CLASSIC	   0x10000
+
+/* Opcode is only supported by e500x2 Core.  */
+#define PPC_OPCODE_SPE		   0x20000
+
+/* Opcode is supported by e500x2 Integer select APU.  */
+#define PPC_OPCODE_ISEL		   0x40000
+
+/* Opcode is an e500 SPE floating point instruction.  */
+#define PPC_OPCODE_EFS		   0x80000
+
+/* Opcode is supported by branch locking APU.  */
+#define PPC_OPCODE_BRLOCK	  0x100000
+
+/* Opcode is supported by performance monitor APU.  */
+#define PPC_OPCODE_PMR		  0x200000
+
+/* Opcode is supported by cache locking APU.  */
+#define PPC_OPCODE_CACHELCK	  0x400000
+
+/* Opcode is supported by machine check APU.  */
+#define PPC_OPCODE_RFMCI	  0x800000
 
 /* A macro to extract the major opcode from an instruction.  */
 #define PPC_OP(i) (((i) >> 26) & 0x3f)
@@ -106,8 +163,8 @@ struct powerpc_operand
      string (the operand will be inserted in any case).  If the
      operand value is legal, *ERRMSG will be unchanged (most operands
      can accept any value).  */
-  unsigned long (*insert) PARAMS ((unsigned long instruction, long op,
-				   const char **errmsg));
+  unsigned long (*insert)
+    (unsigned long instruction, long op, int dialect, const char **errmsg);
 
   /* Extraction function.  This is used by the disassembler.  To
      extract this operand type from an instruction, check this field.
@@ -126,7 +183,7 @@ struct powerpc_operand
      non-zero if this operand type can not actually be extracted from
      this operand (i.e., the instruction does not match).  If the
      operand is valid, *INVALID will not be changed.  */
-  long (*extract) PARAMS ((unsigned long instruction, int *invalid));
+  long (*extract) (unsigned long instruction, int dialect, int *invalid);
 
   /* One bit syntax flags.  */
   unsigned long flags;
@@ -210,6 +267,16 @@ extern const struct powerpc_operand powerpc_operands[];
    number is allowed).  This flag will only be set for a signed
    operand.  */
 #define PPC_OPERAND_NEGATIVE (04000)
+
+/* This operand names a vector unit register.  The disassembler
+   prints these with a leading 'v'.  */
+#define PPC_OPERAND_VR (010000)
+
+/* This operand is for the DS field in a DS form instruction.  */
+#define PPC_OPERAND_DS (020000)
+
+/* This operand is for the DQ field in a DQ form instruction.  */
+#define PPC_OPERAND_DQ (040000)
 
 /* The POWER and PowerPC assemblers use a few macros.  We keep them
    with the operands table for simplicity.  The macro table is an
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
index 90fe14bac..97b1509ac 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -39,11 +39,16 @@
 
 #ifdef CONFIG_SMP
 volatile cpumask_t cpus_in_xmon = CPU_MASK_NONE;
-static unsigned long got_xmon = 0;
-static volatile int take_xmon = -1;
-static volatile int leaving_xmon = 0;
+static unsigned long xmon_taken = 1;
+static int xmon_owner;
+static int xmon_gate;
 #endif /* CONFIG_SMP */
 
+#define TRAP(regs)	((regs)->trap)
+#define FULL_REGS(regs)	1
+
+static unsigned long in_xmon = 0;
+
 static unsigned long adrs;
 static int size = 1;
 static unsigned long ndump = 64;
@@ -52,24 +57,39 @@ static unsigned long ncsum = 4096;
 static int termch;
 static char tmpstr[128];
 
-static u_int bus_error_jmp[100];
+#define JMP_BUF_LEN	(184/sizeof(long))
+static long bus_error_jmp[JMP_BUF_LEN];
+static int catch_memory_errors;
+static long *xmon_fault_jmp[NR_CPUS];
 #define setjmp xmon_setjmp
 #define longjmp xmon_longjmp
 
 /* Breakpoint stuff */
 struct bpt {
-	unsigned long address;
-	unsigned instr;
-	unsigned long count;
-	unsigned char enabled;
+	unsigned long	address;
+	unsigned int	instr[2];
+	atomic_t	ref_count;
+	int		enabled;
+	unsigned long	pad;
 };
 
-#define NBPTS	16
+/* Bits in bpt.enabled */
+#define BP_IABR_TE	1		/* IABR translation enabled */
+#define BP_IABR		2
+#define BP_TRAP		8
+#define BP_DABR		0x10
+
+#define NBPTS	256
 static struct bpt bpts[NBPTS];
 static struct bpt dabr;
-static struct bpt iabr;
+static struct bpt *iabr;
 static unsigned bpinstr = 0x7fe00008;	/* trap */
 
+#define BP_NUM(bp)	((bp) - bpts + 1)
+
+/* Bits in SRR1 that are copied from MSR */
+#define MSR_MASK	0xffffffff87c0ffff
+
 /* Prototypes */
 static int cmds(struct pt_regs *);
 static int mread(unsigned long, void *, int);
@@ -80,7 +100,7 @@ static void memex(void);
 static int bsesc(void);
 static void dump(void);
 static void prdump(unsigned long, long);
-static int ppc_inst_dump(unsigned long, long);
+static int ppc_inst_dump(unsigned long, long, int);
 void print_address(unsigned long);
 static void backtrace(struct pt_regs *);
 static void excprint(struct pt_regs *);
@@ -97,34 +117,40 @@ void getstring(char *, int);
 static void flush_input(void);
 static int inchar(void);
 static void take_input(char *);
-/* static void openforth(void); */
 static unsigned long read_spr(int);
 static void write_spr(int, unsigned long);
 static void super_regs(void);
 static void remove_bpts(void);
 static void insert_bpts(void);
+static void remove_cpu_bpts(void);
+static void insert_cpu_bpts(void);
 static struct bpt *at_breakpoint(unsigned long pc);
+static struct bpt *in_breakpoint_table(unsigned long pc, unsigned long *offp);
+static int  do_step(struct pt_regs *);
 static void bpt_cmds(void);
 static void cacheflush(void);
-#ifdef CONFIG_SMP
-static void cpu_cmd(void);
-#endif /* CONFIG_SMP */
+static int  cpu_cmd(void);
 static void csum(void);
 static void bootcmds(void);
 void dump_segments(void);
 static void symbol_lookup(void);
+static int emulate_step(struct pt_regs *regs, unsigned int instr);
+static void xmon_print_symbol(unsigned long address, const char *mid,
+			      const char *after);
+static const char *getvecname(unsigned long vec);
 
 static void debug_trace(void);
 
-extern int print_insn_big_powerpc(FILE *, unsigned long, unsigned long);
+extern int print_insn_powerpc(unsigned long, unsigned long, int);
 extern void printf(const char *fmt, ...);
 extern void xmon_vfprintf(void *f, const char *fmt, va_list ap);
 extern int xmon_putc(int c, void *f);
 extern int putchar(int ch);
 extern int xmon_read_poll(void);
-extern int setjmp(u_int *);
-extern void longjmp(u_int *, int);
+extern int setjmp(long *);
+extern void longjmp(long *, int);
 extern unsigned long _ASR;
+extern char SystemCall_common[];
 
 pte_t *find_linux_pte(pgd_t *pgdir, unsigned long va);	/* from htab.c */
 
@@ -147,7 +173,6 @@ Commands:\n\
 #ifdef CONFIG_SMP
   "\
   c	print cpus stopped in xmon\n\
-  ci	send xmon interrupt to all other cpus\n\
   c#	try to switch to cpu number h (in hex)\n"
 #endif
   "\
@@ -182,22 +207,8 @@ Commands:\n\
   zh	halt\n"
 ;
 
-static int xmon_trace[NR_CPUS];
-#define SSTEP	1		/* stepping because of 's' command */
-#define BRSTEP	2		/* stepping over breakpoint */
-
-static struct pt_regs *xmon_regs[NR_CPUS];
-
-void __xmon_print_symbol(const char *fmt, unsigned long address);
-#define xmon_print_symbol(fmt, addr)		\
-do {						\
-	__check_printsym_format(fmt, "");	\
-	__xmon_print_symbol(fmt, addr);		\
-} while(0)
+static struct pt_regs *xmon_regs;
 
-/*
- * Stuff for reading and writing memory safely
- */
 extern inline void sync(void)
 {
 	asm volatile("sync; isync");
@@ -223,22 +234,278 @@ extern inline void sync(void)
  no functions have been called from the current function.
  */
 
+/*
+ * We don't allow single-stepping an mtmsrd that would clear
+ * MSR_RI, since that would make the exception unrecoverable.
+ * Since we need to single-step to proceed from a breakpoint,
+ * we don't allow putting a breakpoint on an mtmsrd instruction.
+ * Similarly we don't allow breakpoints on rfid instructions.
+ * These macros tell us if an instruction is a mtmsrd or rfid.
+ */
+#define IS_MTMSRD(instr)	(((instr) & 0xfc0007fe) == 0x7c000164)
+#define IS_RFID(instr)		(((instr) & 0xfc0007fe) == 0x4c000024)
+
+/*
+ * Disable surveillance (the service processor watchdog function)
+ * while we are in xmon.
+ * XXX we should re-enable it when we leave. :)
+ */
 #define SURVEILLANCE_TOKEN	9000
 
 static inline void disable_surveillance(void)
 {
 #ifndef CONFIG_PPC_ISERIES
-        rtas_call(rtas_token("set-indicator"), 3, 1, NULL, SURVEILLANCE_TOKEN,
-		  0, 0);
+	/* Since this can't be a module, args should end up below 4GB. */
+	static struct rtas_args args;
+
+	if (systemcfg->platform & PLATFORM_PSERIES) {
+		/*
+		 * At this point we have got all the cpus we can into
+		 * xmon, so there is hopefully no other cpu calling RTAS
+		 * at the moment, even though we don't take rtas.lock.
+		 * If we did try to take rtas.lock there would be a
+		 * real possibility of deadlock.
+		 */
+		args.token = rtas_token("set-indicator");
+		if (args.token == RTAS_UNKNOWN_SERVICE)
+			return;
+		args.nargs = 3;
+		args.nret = 1;
+		args.rets = &args.args[3];
+		args.args[0] = SURVEILLANCE_TOKEN;
+		args.args[1] = 0;
+		args.args[2] = 0;
+		enter_rtas(__pa(&args));
+	}
 #endif
 }
 
-int
-xmon(struct pt_regs *excp)
+#ifdef CONFIG_SMP
+static int xmon_speaker;
+
+static void get_output_lock(void)
+{
+	int me = smp_processor_id() + 0x100;
+	int last_speaker = 0, prev;
+	long timeout;
+
+	if (xmon_speaker == me)
+		return;
+	for (;;) {
+		if (xmon_speaker == 0) {
+			last_speaker = cmpxchg(&xmon_speaker, 0, me);
+			if (last_speaker == 0)
+				return;
+		}
+		timeout = 10000000;
+		while (xmon_speaker == last_speaker) {
+			if (--timeout > 0)
+				continue;
+			/* hostile takeover */
+			prev = cmpxchg(&xmon_speaker, last_speaker, me);
+			if (prev == last_speaker)
+				return;
+			break;
+		}
+	}
+}
+
+static void release_output_lock(void)
+{
+	xmon_speaker = 0;
+}
+#endif
+
+int xmon_core(struct pt_regs *regs, int fromipi)
 {
-	struct pt_regs regs;
 	int cmd = 0;
 	unsigned long msr;
+	struct bpt *bp;
+	long recurse_jmp[JMP_BUF_LEN];
+	unsigned long offset;
+#ifdef CONFIG_SMP
+	int cpu;
+	int secondary;
+	unsigned long timeout;
+#endif
+
+	msr = get_msr();
+	set_msrd(msr & ~MSR_EE);	/* disable interrupts */
+
+	bp = in_breakpoint_table(regs->nip, &offset);
+	if (bp != NULL) {
+		regs->nip = bp->address + offset;
+		atomic_dec(&bp->ref_count);
+	}
+
+	remove_cpu_bpts();
+
+#ifdef CONFIG_SMP
+	cpu = smp_processor_id();
+	if (cpu_isset(cpu, cpus_in_xmon)) {
+		get_output_lock();
+		excprint(regs);
+		printf("cpu 0x%x: Exception %lx %s in xmon, "
+		       "returning to main loop\n",
+		       cpu, regs->trap, getvecname(TRAP(regs)));
+		longjmp(xmon_fault_jmp[cpu], 1);
+	}
+
+	if (setjmp(recurse_jmp) != 0) {
+		if (!in_xmon || !xmon_gate) {
+			printf("xmon: WARNING: bad recursive fault "
+			       "on cpu 0x%x\n", cpu);
+			goto waiting;
+		}
+		secondary = !(xmon_taken && cpu == xmon_owner);
+		goto cmdloop;
+	}
+
+	xmon_fault_jmp[cpu] = recurse_jmp;
+	cpu_set(cpu, cpus_in_xmon);
+
+	bp = NULL;
+	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF))
+		bp = at_breakpoint(regs->nip);
+	if (bp || (regs->msr & MSR_RI) == 0)
+		fromipi = 0;
+
+	if (!fromipi) {
+		get_output_lock();
+		excprint(regs);
+		if (bp) {
+			printf("cpu 0x%x stopped at breakpoint 0x%x (",
+			       cpu, BP_NUM(bp));
+			xmon_print_symbol(regs->nip, " ", ")\n");
+		}
+		if ((regs->msr & MSR_RI) == 0)
+			printf("WARNING: exception is not recoverable, "
+			       "can't continue\n");
+		release_output_lock();
+	}
+
+ waiting:
+	secondary = 1;
+	while (secondary && !xmon_gate) {
+		if (in_xmon == 0) {
+			if (fromipi)
+				goto leave;
+			secondary = test_and_set_bit(0, &in_xmon);
+		}
+		barrier();
+	}
+
+	if (!secondary && !xmon_gate) {
+		/* we are the first cpu to come in */
+		/* interrupt other cpu(s) */
+		int ncpus = num_online_cpus();
+
+		xmon_owner = cpu;
+		mb();
+		if (ncpus > 1) {
+			smp_send_debugger_break(MSG_ALL_BUT_SELF);
+			/* wait for other cpus to come in */
+			for (timeout = 100000000; timeout != 0; --timeout)
+				if (cpus_weight(cpus_in_xmon) >= ncpus)
+					break;
+		}
+		remove_bpts();
+		disable_surveillance();
+		/* for breakpoint or single step, print the current instr. */
+		if (bp || TRAP(regs) == 0xd00)
+			ppc_inst_dump(regs->nip, 1, 0);
+		printf("enter ? for help\n");
+		mb();
+		xmon_gate = 1;
+		barrier();
+	}
+
+ cmdloop:
+	while (in_xmon) {
+		if (secondary) {
+			if (cpu == xmon_owner) {
+				if (!test_and_set_bit(0, &xmon_taken)) {
+					secondary = 0;
+					continue;
+				}
+				/* missed it */
+				while (cpu == xmon_owner)
+					barrier();
+			}
+			barrier();
+		} else {
+			cmd = cmds(regs);
+			if (cmd != 0) {
+				/* exiting xmon */
+				insert_bpts();
+				xmon_gate = 0;
+				wmb();
+				in_xmon = 0;
+				break;
+			}
+			/* have switched to some other cpu */
+			secondary = 1;
+		}
+	}
+ leave:
+	cpu_clear(cpu, cpus_in_xmon);
+	xmon_fault_jmp[cpu] = NULL;
+
+#else
+	/* UP is simple... */
+	if (in_xmon) {
+		printf("Exception %lx %s in xmon, returning to main loop\n",
+		       regs->trap, getvecname(TRAP(regs)));
+		longjmp(xmon_fault_jmp[0], 1);
+	}
+	if (setjmp(recurse_jmp) == 0) {
+		xmon_fault_jmp[0] = recurse_jmp;
+		in_xmon = 1;
+
+		excprint(regs);
+		bp = at_breakpoint(regs->nip);
+		if (bp) {
+			printf("Stopped at breakpoint %x (", BP_NUM(bp));
+			xmon_print_symbol(regs->nip, " ", ")\n");
+		}
+		if ((regs->msr & MSR_RI) == 0)
+			printf("WARNING: exception is not recoverable, "
+			       "can't continue\n");
+		remove_bpts();
+		disable_surveillance();
+		/* for breakpoint or single step, print the current instr. */
+		if (bp || TRAP(regs) == 0xd00)
+			ppc_inst_dump(regs->nip, 1, 0);
+		printf("enter ? for help\n");
+	}
+
+	cmd = cmds(regs);
+
+	insert_bpts();
+	in_xmon = 0;
+#endif
+
+	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) {
+		bp = at_breakpoint(regs->nip);
+		if (bp != NULL) {
+			int stepped = emulate_step(regs, bp->instr[0]);
+			if (stepped == 0) {
+				regs->nip = (unsigned long) &bp->instr[0];
+				atomic_inc(&bp->ref_count);
+			}
+		}
+	}
+
+	insert_cpu_bpts();
+
+	set_msrd(msr);		/* restore interrupt enable */
+
+	return cmd != 'X';
+}
+
+int xmon(struct pt_regs *excp)
+{
+	struct pt_regs regs;
 
 	if (excp == NULL) {
 		/* Ok, grab regs as they are now.
@@ -289,142 +556,95 @@ xmon(struct pt_regs *excp)
 		regs.trap = 0;
 		excp = &regs;
 	}
+	return xmon_core(excp, 0);
+}
 
-	msr = get_msr();
-	set_msrd(msr & ~MSR_EE);	/* disable interrupts */
-	xmon_regs[smp_processor_id()] = excp;
-	excprint(excp);
-#ifdef CONFIG_SMP
-	leaving_xmon = 0;
-	/* possible race condition here if a CPU is held up and gets
-	 * here while we are exiting */
-	if (cpu_test_and_set(smp_processor_id(), cpus_in_xmon)) {
-		/* xmon probably caused an exception itself */
-		printf("We are already in xmon\n");
-		for (;;)
-			cpu_relax();
-	}
-	while (test_and_set_bit(0, &got_xmon)) {
-		if (take_xmon == smp_processor_id()) {
-			take_xmon = -1;
-			break;
-		}
-		cpu_relax();
-	}
-	/*
-	 * XXX: breakpoints are removed while any cpu is in xmon
-	 */
-#endif /* CONFIG_SMP */
-	remove_bpts();
-	disable_surveillance();
-	printf("press ? for help ");
-	cmd = cmds(excp);
-	if (cmd == 's') {
-		xmon_trace[smp_processor_id()] = SSTEP;
-		excp->msr |= MSR_SE;
-#ifdef CONFIG_SMP		
-		take_xmon = smp_processor_id();
-#endif		
-	} else if (at_breakpoint(excp->nip)) {
-		xmon_trace[smp_processor_id()] = BRSTEP;
-		excp->msr |= MSR_SE;
-	} else {
-		xmon_trace[smp_processor_id()] = 0;
-		insert_bpts();
+int xmon_bpt(struct pt_regs *regs)
+{
+	struct bpt *bp;
+	unsigned long offset;
+
+	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
+		return 0;
+
+	/* Are we at the trap at bp->instr[1] for some bp? */
+	bp = in_breakpoint_table(regs->nip, &offset);
+	if (bp != NULL && offset == 4) {
+		regs->nip = bp->address + 4;
+		atomic_dec(&bp->ref_count);
+		return 1;
 	}
-	xmon_regs[smp_processor_id()] = 0;
-#ifdef CONFIG_SMP
-	leaving_xmon = 1;
-	if (cmd != 's')
-		clear_bit(0, &got_xmon);
-	cpu_clear(smp_processor_id(), cpus_in_xmon);
-#endif /* CONFIG_SMP */
-	set_msrd(msr);		/* restore interrupt enable */
 
-	if (cmd == 'X')
+	/* Are we at a breakpoint? */
+	bp = at_breakpoint(regs->nip);
+	if (!bp)
 		return 0;
 
+	xmon_core(regs, 0);
+
 	return 1;
 }
 
-int
-xmon_bpt(struct pt_regs *regs)
+int xmon_sstep(struct pt_regs *regs)
 {
-	struct bpt *bp;
-
-	bp = at_breakpoint(regs->nip);
-	if (!bp)
+	if (user_mode(regs))
 		return 0;
-	if (bp->count) {
-		--bp->count;
-		remove_bpts();
-		excprint(regs);
-		xmon_trace[smp_processor_id()] = BRSTEP;
-		regs->msr |= MSR_SE;
-	} else {
-		printf("Stopped at breakpoint %x (%lx ", (bp - bpts) + 1,
-			bp->address);
-		xmon_print_symbol("%s)\n", bp->address);
-		xmon(regs);
-	}
+	xmon_core(regs, 0);
 	return 1;
 }
 
-int
-xmon_sstep(struct pt_regs *regs)
+int xmon_dabr_match(struct pt_regs *regs)
 {
-	if (!xmon_trace[smp_processor_id()])
+	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
 		return 0;
-	if (xmon_trace[smp_processor_id()] == BRSTEP) {
-		xmon_trace[smp_processor_id()] = 0;
-		insert_bpts();
-	} else {
-		xmon(regs);
-	}
+	xmon_core(regs, 0);
 	return 1;
 }
 
-int
-xmon_dabr_match(struct pt_regs *regs)
+int xmon_iabr_match(struct pt_regs *regs)
 {
-	if (dabr.enabled && dabr.count) {
-		--dabr.count;
-		remove_bpts();
-		excprint(regs);
-		xmon_trace[smp_processor_id()] = BRSTEP;
-		regs->msr |= MSR_SE;
-	} else {
-		dabr.instr = regs->nip;
-		xmon(regs);
-	}
+	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
+		return 0;
+	if (iabr == 0)
+		return 0;
+	xmon_core(regs, 0);
 	return 1;
 }
 
-int
-xmon_iabr_match(struct pt_regs *regs)
+int xmon_ipi(struct pt_regs *regs)
 {
-	if (iabr.enabled && iabr.count) {
-		--iabr.count;
-		remove_bpts();
-		excprint(regs);
-		xmon_trace[smp_processor_id()] = BRSTEP;
-		regs->msr |= MSR_SE;
-	} else {
-		xmon(regs);
+#ifdef CONFIG_SMP
+	if (in_xmon && !cpu_isset(smp_processor_id(), cpus_in_xmon))
+		xmon_core(regs, 1);
+#endif
+	return 0;
+}
+
+int xmon_fault_handler(struct pt_regs *regs)
+{
+	struct bpt *bp;
+	unsigned long offset;
+
+	if (in_xmon && catch_memory_errors)
+		handle_fault(regs);	/* doesn't return */
+
+	if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) {
+		bp = in_breakpoint_table(regs->nip, &offset);
+		if (bp != NULL) {
+			regs->nip = bp->address + offset;
+			atomic_dec(&bp->ref_count);
+		}
 	}
-	return 1;
+
+	return 0;
 }
 
-static struct bpt *
-at_breakpoint(unsigned long pc)
+
+static struct bpt *at_breakpoint(unsigned long pc)
 {
 	int i;
 	struct bpt *bp;
 
-	if (dabr.enabled && pc == dabr.instr)
-		return &dabr;
-	if (iabr.enabled && pc == iabr.address)
-		return &iabr;
 	bp = bpts;
 	for (i = 0; i < NBPTS; ++i, ++bp)
 		if (bp->enabled && pc == bp->address)
@@ -432,73 +652,228 @@ at_breakpoint(unsigned long pc)
 	return 0;
 }
 
-static void
-insert_bpts()
+static struct bpt *in_breakpoint_table(unsigned long nip, unsigned long *offp)
+{
+	unsigned long off;
+
+	off = nip - (unsigned long) bpts;
+	if (off >= sizeof(bpts))
+		return NULL;
+	off %= sizeof(struct bpt);
+	if (off != offsetof(struct bpt, instr[0])
+	    && off != offsetof(struct bpt, instr[1]))
+		return NULL;
+	*offp = off - offsetof(struct bpt, instr[0]);
+	return (struct bpt *) (nip - off);
+}
+
+static struct bpt *new_breakpoint(unsigned long a)
+{
+	struct bpt *bp;
+
+	a &= ~3UL;
+	bp = at_breakpoint(a);
+	if (bp)
+		return bp;
+
+	for (bp = bpts; bp < &bpts[NBPTS]; ++bp) {
+		if (!bp->enabled && atomic_read(&bp->ref_count) == 0) {
+			bp->address = a;
+			bp->instr[1] = bpinstr;
+			store_inst(&bp->instr[1]);
+			return bp;
+		}
+	}
+
+	printf("Sorry, no free breakpoints.  Please clear one first.\n");
+	return NULL;
+}
+
+static void insert_bpts(void)
 {
 	int i;
 	struct bpt *bp;
 
 	bp = bpts;
 	for (i = 0; i < NBPTS; ++i, ++bp) {
-		if (!bp->enabled)
+		if ((bp->enabled & (BP_TRAP|BP_IABR)) == 0)
 			continue;
-		if (mread(bp->address, &bp->instr, 4) != 4
-		    || mwrite(bp->address, &bpinstr, 4) != 4) {
-			printf("Couldn't insert breakpoint at %x, disabling\n",
-			       bp->address);
+		if (mread(bp->address, &bp->instr[0], 4) != 4) {
+			printf("Couldn't read instruction at %lx, "
+			       "disabling breakpoint there\n", bp->address);
 			bp->enabled = 0;
-		} else {
-			store_inst((void *)bp->address);
+			continue;
+		}
+		if (IS_MTMSRD(bp->instr[0]) || IS_RFID(bp->instr[0])) {
+			printf("Breakpoint at %lx is on an mtmsrd or rfid "
+			       "instruction, disabling it\n", bp->address);
+			bp->enabled = 0;
+			continue;
+		}
+		store_inst(&bp->instr[0]);
+		if (bp->enabled & BP_IABR)
+			continue;
+		if (mwrite(bp->address, &bpinstr, 4) != 4) {
+			printf("Couldn't write instruction at %lx, "
+			       "disabling breakpoint there\n", bp->address);
+			bp->enabled &= ~BP_TRAP;
+			continue;
 		}
+		store_inst((void *)bp->address);
 	}
+}
 
+static void insert_cpu_bpts(void)
+{
 	if (dabr.enabled)
-		set_dabr(dabr.address);
-	if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR) && iabr.enabled)
-		set_iabr(iabr.address);
+		set_dabr(dabr.address | (dabr.enabled & 7));
+	if (iabr && (cur_cpu_spec->cpu_features & CPU_FTR_IABR))
+		set_iabr(iabr->address
+			 | (iabr->enabled & (BP_IABR|BP_IABR_TE)));
 }
 
-static void
-remove_bpts()
+static void remove_bpts(void)
 {
 	int i;
 	struct bpt *bp;
 	unsigned instr;
 
-	set_dabr(0);
-	if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR))
-		set_iabr(0);
-
 	bp = bpts;
 	for (i = 0; i < NBPTS; ++i, ++bp) {
-		if (!bp->enabled)
+		if ((bp->enabled & (BP_TRAP|BP_IABR)) != BP_TRAP)
 			continue;
 		if (mread(bp->address, &instr, 4) == 4
 		    && instr == bpinstr
 		    && mwrite(bp->address, &bp->instr, 4) != 4)
-			printf("Couldn't remove breakpoint at %x\n",
+			printf("Couldn't remove breakpoint at %lx\n",
 			       bp->address);
 		else
 			store_inst((void *)bp->address);
 	}
 }
 
-static char *last_cmd;
+static void remove_cpu_bpts(void)
+{
+	set_dabr(0);
+	if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR))
+		set_iabr(0);
+}
+
+static int branch_taken(unsigned int instr, struct pt_regs *regs)
+{
+	unsigned int bo = (instr >> 21) & 0x1f;
+	unsigned int bi;
+
+	if ((bo & 4) == 0) {
+		/* decrement counter */
+		--regs->ctr;
+		if (((bo >> 1) & 1) ^ (regs->ctr == 0))
+			return 0;
+	}
+	if ((bo & 0x10) == 0) {
+		/* check bit from CR */
+		bi = (instr >> 16) & 0x1f;
+		if (((regs->ccr >> (31 - bi)) & 1) != ((bo >> 3) & 1))
+			return 0;
+	}
+	return 1;
+}
+
+/*
+ * Emulate instructions that cause a transfer of control.
+ * Returns 1 if the step was emulated, 0 if not,
+ * or -1 if the instruction is one that should not be stepped,
+ * such as an rfid, or a mtmsrd that would clear MSR_RI.
+ */
+static int emulate_step(struct pt_regs *regs, unsigned int instr)
+{
+	unsigned int opcode, rd;
+	unsigned long int imm;
+
+	opcode = instr >> 26;
+	switch (opcode) {
+	case 16:	/* bc */
+		imm = (signed short)(instr & 0xfffc);
+		if ((instr & 2) == 0)
+			imm += regs->nip;
+		regs->nip += 4;		/* XXX check 32-bit mode */
+		if (instr & 1)
+			regs->link = regs->nip;
+		if (branch_taken(instr, regs))
+			regs->nip = imm;
+		return 1;
+	case 17:	/* sc */
+		regs->gpr[9] = regs->gpr[13];
+		regs->gpr[11] = regs->nip + 4;
+		regs->gpr[12] = regs->msr & MSR_MASK;
+		regs->gpr[13] = (unsigned long) get_paca();
+		regs->nip = (unsigned long) &SystemCall_common;
+		regs->msr = MSR_KERNEL;
+		return 1;
+	case 18:	/* b */
+		imm = instr & 0x03fffffc;
+		if (imm & 0x02000000)
+			imm -= 0x04000000;
+		if ((instr & 2) == 0)
+			imm += regs->nip;
+		if (instr & 1)
+			regs->link = regs->nip + 4;
+		regs->nip = imm;
+		return 1;
+	case 19:
+		switch (instr & 0x7fe) {
+		case 0x20:	/* bclr */
+		case 0x420:	/* bcctr */
+			imm = (instr & 0x400)? regs->ctr: regs->link;
+			regs->nip += 4;		/* XXX check 32-bit mode */
+			if (instr & 1)
+				regs->link = regs->nip;
+			if (branch_taken(instr, regs))
+				regs->nip = imm;
+			return 1;
+		case 0x24:	/* rfid, scary */
+			printf("Can't single-step an rfid instruction\n");
+			return -1;
+		}
+	case 31:
+		rd = (instr >> 21) & 0x1f;
+		switch (instr & 0x7fe) {
+		case 0xa6:	/* mfmsr */
+			regs->gpr[rd] = regs->msr & MSR_MASK;
+			regs->nip += 4;
+			return 1;
+		case 0x164:	/* mtmsrd */
+			/* only MSR_EE and MSR_RI get changed if bit 15 set */
+			/* mtmsrd doesn't change MSR_HV and MSR_ME */
+			imm = (instr & 0x10000)? 0x8002: 0xefffffffffffefffUL;
+			imm = (regs->msr & MSR_MASK & ~imm)
+				| (regs->gpr[rd] & imm);
+			if ((imm & MSR_RI) == 0) {
+				printf("Can't step an instruction that would "
+				       "clear MSR.RI\n");
+				return -1;
+			}
+			regs->msr = imm;
+			regs->nip += 4;
+			return 1;
+		}
+	}
+	return 0;
+}
 
 /* Command interpreting routine */
+static char *last_cmd;
+
 static int
 cmds(struct pt_regs *excp)
 {
 	int cmd = 0;
 
 	last_cmd = NULL;
+	xmon_regs = excp;
 	for(;;) {
 #ifdef CONFIG_SMP
-		/* Need to check if we should take any commands on
-		   this CPU. */
-		if (leaving_xmon)
-			return cmd;
-		printf("%d:", smp_processor_id());
+		printf("%x:", smp_processor_id());
 #endif /* CONFIG_SMP */
 		printf("mon> ");
 		fflush(stdout);
@@ -545,10 +920,7 @@ cmds(struct pt_regs *excp)
 			prregs(excp);	/* print regs */
 			break;
 		case 'e':
-			if (excp == NULL)
-				printf("No exception information\n");
-			else
-				excprint(excp);
+			excprint(excp);
 			break;
 		case 'S':
 			super_regs();
@@ -560,6 +932,9 @@ cmds(struct pt_regs *excp)
 			cacheflush();
 			break;
 		case 's':
+			if (do_step(excp))
+				return cmd;
+			break;
 		case 'x':
 		case 'X':
 		case EOF:
@@ -576,13 +951,13 @@ cmds(struct pt_regs *excp)
 		case 'C':
 			csum();
 			break;
-#ifdef CONFIG_SMP
 		case 'c':
-			cpu_cmd();
+			if (cpu_cmd())
+				return 0;
 			break;
-#endif /* CONFIG_SMP */
 		case 'z':
 			bootcmds();
+			break;
 		case 'T':
 			debug_trace();
 			break;
@@ -592,7 +967,7 @@ cmds(struct pt_regs *excp)
 		default:
 			printf("Unrecognized command: ");
 		        do {
-				if( ' ' < cmd && cmd <= '~' )
+				if (' ' < cmd && cmd <= '~')
 					putchar(cmd);
 				else
 					printf("\\x%x", cmd);
@@ -601,10 +976,37 @@ cmds(struct pt_regs *excp)
 			printf(" (type ? for help)\n");
 			break;
 		}
-		cpu_relax();
 	}
 }
 
+/*
+ * Step a single instruction.
+ * Some instructions we emulate, others we execute with MSR_SE set.
+ */
+static int do_step(struct pt_regs *regs)
+{
+	unsigned int instr;
+	int stepped;
+
+	/* check we are in 64-bit kernel mode, translation enabled */
+	if ((regs->msr & (MSR_SF|MSR_PR|MSR_IR)) == (MSR_SF|MSR_IR)) {
+		if (mread(regs->nip, &instr, 4) == 4) {
+			stepped = emulate_step(regs, instr);
+			if (stepped < 0)
+				return 0;
+			if (stepped > 0) {
+				regs->trap = 0xd00 | (regs->trap & 1);
+				printf("stepped to ");
+				xmon_print_symbol(regs->nip, " ", "\n");
+				ppc_inst_dump(regs->nip, 1, 0);
+				return 0;
+			}
+		}
+	}
+	regs->msr |= MSR_SE;
+	return 1;
+}
+
 static void bootcmds(void)
 {
 	int cmd;
@@ -618,56 +1020,59 @@ static void bootcmds(void)
 		ppc_md.power_off();
 }
 
-#ifdef CONFIG_SMP
-static void cpu_cmd(void)
+static int cpu_cmd(void)
 {
+#ifdef CONFIG_SMP
 	unsigned long cpu;
 	int timeout;
-	int cmd;
+	int count;
 
-	cmd = inchar();
-	if (cmd == 'i') {
-		printf("stopping all cpus\n");
-		/* interrupt other cpu(s) */
-		cpu = MSG_ALL_BUT_SELF;
-		smp_send_debugger_break(cpu);
-		return;
-	}
-	termch = cmd;
 	if (!scanhex(&cpu)) {
 		/* print cpus waiting or in xmon */
 		printf("cpus stopped:");
+		count = 0;
 		for (cpu = 0; cpu < NR_CPUS; ++cpu) {
 			if (cpu_isset(cpu, cpus_in_xmon)) {
-				printf(" %x", cpu);
-				if (cpu == smp_processor_id())
-					printf("*", cpu);
+				if (count == 0)
+					printf(" %x", cpu);
+				++count;
+			} else {
+				if (count > 1)
+					printf("-%x", cpu - 1);
+				count = 0;
 			}
 		}
+		if (count > 1)
+			printf("-%x", NR_CPUS - 1);
 		printf("\n");
-		return;
+		return 0;
 	}
 	/* try to switch to cpu specified */
-	take_xmon = cpu;
+	if (!cpu_isset(cpu, cpus_in_xmon)) {
+		printf("cpu 0x%x isn't in xmon\n", cpu);
+		return 0;
+	}
+	xmon_taken = 0;
+	mb();
+	xmon_owner = cpu;
 	timeout = 10000000;
-	while (take_xmon >= 0) {
+	while (!xmon_taken) {
 		if (--timeout == 0) {
-			/* yes there's a race here */
-			take_xmon = -1;
+			if (test_and_set_bit(0, &xmon_taken))
+				break;
+			/* take control back */
+			mb();
+			xmon_owner = smp_processor_id();
 			printf("cpu %u didn't take control\n", cpu);
-			return;
-		}
-	}
-	/* now have to wait to be given control back */
-	while (test_and_set_bit(0, &got_xmon)) {
-		if (take_xmon == smp_processor_id()) {
-			take_xmon = -1;
-			break;
+			return 0;
 		}
-		cpu_relax();
+		barrier();
 	}
-}
+	return 1;
+#else
+	return 0;
 #endif /* CONFIG_SMP */
+}
 
 static unsigned short fcstab[256] = {
 	0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
@@ -728,6 +1133,30 @@ csum(void)
 	printf("%x\n", fcs);
 }
 
+/*
+ * Check if this is a suitable place to put a breakpoint.
+ */
+static long check_bp_loc(unsigned long addr)
+{
+	unsigned int instr;
+
+	addr &= ~3;
+	if (addr < KERNELBASE) {
+		printf("Breakpoints may only be placed at kernel addresses\n");
+		return 0;
+	}
+	if (!mread(addr, &instr, sizeof(instr))) {
+		printf("Can't read instruction at address %lx\n", addr);
+		return 0;
+	}
+	if (IS_MTMSRD(instr) || IS_RFID(instr)) {
+		printf("Breakpoints may not be placed on mtmsrd or rfid "
+		       "instructions\n");
+		return 0;
+	}
+	return 1;
+}
+
 static char *breakpoint_help_string = 
     "Breakpoint command usage:\n"
     "b                show breakpoints\n"
@@ -745,6 +1174,8 @@ bpt_cmds(void)
 	unsigned long a;
 	int mode, i;
 	struct bpt *bp;
+	const char badaddr[] = "Only kernel addresses are permitted "
+		"for breakpoints\n";
 
 	cmd = inchar();
 	switch (cmd) {
@@ -758,54 +1189,66 @@ bpt_cmds(void)
 		else
 			termch = cmd;
 		dabr.address = 0;
-		dabr.count = 0;
-		dabr.enabled = scanhex(&dabr.address);
-		scanhex(&dabr.count);
-		if (dabr.enabled)
-			dabr.address = (dabr.address & ~7) | mode;
+		dabr.enabled = 0;
+		if (scanhex(&dabr.address)) {
+			if (dabr.address < KERNELBASE) {
+				printf(badaddr);
+				break;
+			}
+			dabr.address &= ~7;
+			dabr.enabled = mode | BP_DABR;
+		}
 		break;
+
 	case 'i':	/* bi - hardware instr breakpoint */
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_IABR)) {
-			printf("Not implemented on POWER4\n");
+			printf("Hardware instruction breakpoint "
+			       "not supported on this cpu\n");
+			break;
+		}
+		if (iabr) {
+			iabr->enabled &= ~(BP_IABR | BP_IABR_TE);
+			iabr = NULL;
+		}
+		if (!scanhex(&a))
 			break;
+		if (!check_bp_loc(a))
+			break;
+		bp = new_breakpoint(a);
+		if (bp != NULL) {
+			bp->enabled |= BP_IABR | BP_IABR_TE;
+			iabr = bp;
 		}
-		iabr.address = 0;
-		iabr.count = 0;
-		iabr.enabled = scanhex(&iabr.address);
-		if (iabr.enabled)
-			iabr.address |= 3;
-		scanhex(&iabr.count);
 		break;
+
 	case 'c':
 		if (!scanhex(&a)) {
 			/* clear all breakpoints */
 			for (i = 0; i < NBPTS; ++i)
 				bpts[i].enabled = 0;
-			iabr.enabled = 0;
+			iabr = NULL;
 			dabr.enabled = 0;
 			printf("All breakpoints cleared\n");
+			break;
+		}
+
+		if (a <= NBPTS && a >= 1) {
+			/* assume a breakpoint number */
+			bp = &bpts[a-1];	/* bp nums are 1 based */
 		} else {
-			if (a <= NBPTS && a >= 1) {
-				/* assume a breakpoint number */
-				--a;	/* bp nums are 1 based */
-				bp = &bpts[a];
-			} else {
-				/* assume a breakpoint address */
-				bp = at_breakpoint(a);
-			}
+			/* assume a breakpoint address */
+			bp = at_breakpoint(a);
 			if (bp == 0) {
 				printf("No breakpoint at %x\n", a);
-			} else {
-				printf("Cleared breakpoint %x (%lx ", 
-					(bp - bpts) + 1, bp->address);
-				xmon_print_symbol("%s)\n", bp->address);
-				bp->enabled = 0;
+				break;
 			}
 		}
+
+		printf("Cleared breakpoint %x (", BP_NUM(bp));
+		xmon_print_symbol(bp->address, " ", ")\n");
+		bp->enabled = 0;
 		break;
-	case '?':
-	        printf(breakpoint_help_string);
-	        break;
+
 	default:
 		termch = cmd;
 	        cmd = skipbl();
@@ -816,53 +1259,30 @@ bpt_cmds(void)
 		termch = cmd;
 		if (!scanhex(&a)) {
 			/* print all breakpoints */
-			int bpnum;
-
-			printf("   type            address    count\n");
+			printf("   type            address\n");
 			if (dabr.enabled) {
-				printf("   data   %.16lx %8x [", dabr.address & ~7,
-				       dabr.count);
-				if (dabr.address & 1)
+				printf("   data   %.16lx  [", dabr.address);
+				if (dabr.enabled & 1)
 					printf("r");
-				if (dabr.address & 2)
+				if (dabr.enabled & 2)
 					printf("w");
 				printf("]\n");
 			}
-			if (iabr.enabled)
-				printf("   inst   %.16lx %8x\n", iabr.address & ~3,
-				       iabr.count);
-			for (bp = bpts, bpnum = 1; bp < &bpts[NBPTS]; ++bp, ++bpnum)
-				if (bp->enabled) {
-					printf("%2x trap   %.16lx %8x  ",
-						bpnum, bp->address, bp->count);
-					xmon_print_symbol("%s\n", bp->address);
-				}
-			break;
-		}
-		
-		if (systemcfg->platform != PLATFORM_POWERMAC &&
-		   !(systemcfg->platform & PLATFORM_PSERIES)) {
-			printf("Not supported for this platform\n");
-			break;
-		}
-
-		bp = at_breakpoint(a);
-		if (bp == 0) {
-			for (bp = bpts; bp < &bpts[NBPTS]; ++bp)
+			for (bp = bpts; bp < &bpts[NBPTS]; ++bp) {
 				if (!bp->enabled)
-					break;
-			if (bp >= &bpts[NBPTS]) {
-				printf("Sorry, no free breakpoints.  Please clear one first.\n");
-				break;
+					continue;
+				printf("%2x %s   ", BP_NUM(bp),
+				    (bp->enabled & BP_IABR)? "inst": "trap");
+				xmon_print_symbol(bp->address, "  ", "\n");
 			}
+			break;
 		}
-		bp->enabled = 1;
-		bp->address = a;
-		bp->count = 0;
-		scanhex(&bp->count);
-		printf("Set breakpoint %2x trap   %.16lx %8x  ", (bp-bpts) + 1, 
-			bp->address, bp->count);
-		xmon_print_symbol("%s\n", bp->address);
+
+		if (!check_bp_loc(a))
+			break;
+		bp = new_breakpoint(a);
+		if (bp != NULL)
+			bp->enabled |= BP_TRAP;
 		break;
 	}
 }
@@ -872,76 +1292,131 @@ static
 const char *getvecname(unsigned long vec)
 {
 	char *ret;
+
 	switch (vec) {
-	case 0x100:	ret = "(System Reset)"; break; 
-	case 0x200:	ret = "(Machine Check)"; break; 
-	case 0x300:	ret = "(Data Access)"; break; 
+	case 0x100:	ret = "(System Reset)"; break;
+	case 0x200:	ret = "(Machine Check)"; break;
+	case 0x300:	ret = "(Data Access)"; break;
 	case 0x380:	ret = "(Data SLB Access)"; break;
-	case 0x400:	ret = "(Instruction Access)"; break; 
+	case 0x400:	ret = "(Instruction Access)"; break;
 	case 0x480:	ret = "(Instruction SLB Access)"; break;
-	case 0x500:	ret = "(Hardware Interrupt)"; break; 
-	case 0x600:	ret = "(Alignment)"; break; 
-	case 0x700:	ret = "(Program Check)"; break; 
-	case 0x800:	ret = "(FPU Unavailable)"; break; 
-	case 0x900:	ret = "(Decrementer)"; break; 
-	case 0xc00:	ret = "(System Call)"; break; 
-	case 0xd00:	ret = "(Single Step)"; break; 
-	case 0xf00:	ret = "(Performance Monitor)"; break; 
+	case 0x500:	ret = "(Hardware Interrupt)"; break;
+	case 0x600:	ret = "(Alignment)"; break;
+	case 0x700:	ret = "(Program Check)"; break;
+	case 0x800:	ret = "(FPU Unavailable)"; break;
+	case 0x900:	ret = "(Decrementer)"; break;
+	case 0xc00:	ret = "(System Call)"; break;
+	case 0xd00:	ret = "(Single Step)"; break;
+	case 0xf00:	ret = "(Performance Monitor)"; break;
+	case 0xf20:	ret = "(Altivec Unavailable)"; break;
+	case 0x1300:	ret = "(Instruction Breakpoint)"; break;
 	default: ret = "";
 	}
 	return ret;
 }
 
-/*
- * Most of our exceptions are in the form:
- *    bl handler
- *    b .ret_from_exception
- * and this currently fails to catch them.
- */
-static inline int exception_frame(unsigned long ip)
+static void get_function_bounds(unsigned long pc, unsigned long *startp,
+				unsigned long *endp)
 {
-	extern void *ret_from_syscall_1, *ret_from_syscall_2, *ret_from_except;
-
-	if ((ip == (unsigned long)ret_from_syscall_1) ||
-	    (ip == (unsigned long)ret_from_syscall_2) ||
-	    (ip == (unsigned long)ret_from_except))
-		return 1;
+	unsigned long size, offset;
+	const char *name;
+	char *modname;
 
-	return 0;
+	*startp = *endp = 0;
+	if (pc == 0)
+		return;
+	if (setjmp(bus_error_jmp) == 0) {
+		catch_memory_errors = 1;
+		sync();
+		name = kallsyms_lookup(pc, &size, &offset, &modname, tmpstr);
+		if (name != NULL) {
+			*startp = pc - offset;
+			*endp = pc - offset + size;
+		}
+		sync();
+	}
+	catch_memory_errors = 0;
 }
 
 static int xmon_depth_to_print = 64;
 
-static void xmon_show_stack(unsigned long sp)
+static void xmon_show_stack(unsigned long sp, unsigned long lr,
+			    unsigned long pc)
 {
 	unsigned long ip;
 	unsigned long newsp;
+	unsigned long marker;
 	int count = 0;
 	struct pt_regs regs;
 
 	do {
 		if (sp < PAGE_OFFSET) {
-			printf("SP in userspace\n");
+			if (sp != 0)
+				printf("SP (%lx) is in userspace\n", sp);
 			break;
 		}
 
-		if (!mread((sp + 16), &ip, sizeof(unsigned long)))
+		if (!mread(sp + 16, &ip, sizeof(unsigned long))
+		    || !mread(sp, &newsp, sizeof(unsigned long))) {
+			printf("Couldn't read stack frame at %lx\n", sp);
 			break;
+		}
 
-		printf("[%016lx] [%016lx] ", sp, ip);
-		xmon_print_symbol("%s\n", ip);
+		/*
+		 * For the first stack frame, try to work out if
+		 * LR and/or the saved LR value in the bottommost
+		 * stack frame are valid.
+		 */
+		if ((pc | lr) != 0) {
+			unsigned long fnstart, fnend;
+			unsigned long nextip;
+			int printip = 1;
+
+			get_function_bounds(pc, &fnstart, &fnend);
+			nextip = 0;
+			if (newsp > sp)
+				mread(newsp + 16, &nextip,
+				      sizeof(unsigned long));
+			if (lr == ip) {
+				if (lr < PAGE_OFFSET
+				    || (fnstart <= lr && lr < fnend))
+					printip = 0;
+			} else if (lr == nextip) {
+				printip = 0;
+			} else if (lr >= PAGE_OFFSET
+				   && !(fnstart <= lr && lr < fnend)) {
+				printf("[link register   ] ");
+				xmon_print_symbol(lr, " ", "\n");
+			}
+			if (printip) {
+				printf("[%.16lx] ", sp);
+				xmon_print_symbol(ip, " ", " (unreliable)\n");
+			}
+			pc = lr = 0;
 
-		if (exception_frame(ip)) {
-			if (mread(sp+112, &regs, sizeof(regs)) != sizeof(regs))
-				break;
+		} else {
+			printf("[%.16lx] ", sp);
+			xmon_print_symbol(ip, " ", "\n");
+		}
 
-                        printf("  exception: %lx %s regs %lx\n", regs.trap,
-			       getvecname(regs.trap), sp+112);
+		/* Look for "regshere" marker to see if this is
+		   an exception frame. */
+		if (mread(sp + 0x60, &marker, sizeof(unsigned long))
+		    && marker == 0x7265677368657265ul) {
+			if (mread(sp + 0x70, &regs, sizeof(regs))
+			    != sizeof(regs)) {
+				printf("Couldn't read registers at %lx\n",
+				       sp + 0x70);
+				break;
+			}
+                        printf("--- Exception: %lx %s at ", regs.trap,
+			       getvecname(TRAP(&regs)));
+			pc = regs.nip;
+			lr = regs.link;
+			xmon_print_symbol(pc, " ", "\n");
 		}
 
-		if (!mread(sp, &newsp, sizeof(unsigned long)))
-			break;
-		if (newsp < sp)
+		if (newsp == 0)
 			break;
 
 		sp = newsp;
@@ -952,42 +1427,36 @@ static void backtrace(struct pt_regs *excp)
 {
 	unsigned long sp;
 
-	if (excp == NULL)
-		sp = __get_SP();
+	if (scanhex(&sp))
+		xmon_show_stack(sp, 0, 0);
 	else
-		sp = excp->gpr[1];
-
-	scanhex(&sp);
+		xmon_show_stack(excp->gpr[1], excp->link, excp->nip);
 	scannl();
-
-	xmon_show_stack(sp);
 }
 
-spinlock_t exception_print_lock = SPIN_LOCK_UNLOCKED;
-
 void excprint(struct pt_regs *fp)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&exception_print_lock, flags);
+	unsigned long trap;
 
 #ifdef CONFIG_SMP
-	printf("cpu %d: ", smp_processor_id());
+	printf("cpu 0x%x: ", smp_processor_id());
 #endif /* CONFIG_SMP */
 
-	printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(fp->trap), fp);
-	printf("    pc: %lx", fp->nip);
-	xmon_print_symbol(" (%s)\n", fp->nip);
+	trap = TRAP(fp);
+	printf("Vector: %lx %s at [%lx]\n", fp->trap, getvecname(trap), fp);
+	printf("    pc: ");
+	xmon_print_symbol(fp->nip, ": ", "\n");
 
-	printf("    lr: %lx", fp->link);
-	xmon_print_symbol(" (%s)\n", fp->link);
+	printf("    lr: ", fp->link);
+	xmon_print_symbol(fp->link, ": ", "\n");
 
 	printf("    sp: %lx\n", fp->gpr[1]);
 	printf("   msr: %lx\n", fp->msr);
 
-	if (fp->trap == 0x300 || fp->trap == 0x380 || fp->trap == 0x600) {
+	if (trap == 0x300 || trap == 0x380 || trap == 0x600) {
 		printf("   dar: %lx\n", fp->dar);
-		printf(" dsisr: %lx\n", fp->dsisr);
+		if (trap != 0x380)
+			printf(" dsisr: %lx\n", fp->dsisr);
 	}
 
 	printf("  current = 0x%lx\n", current);
@@ -996,39 +1465,50 @@ void excprint(struct pt_regs *fp)
 		printf("    pid   = %ld, comm = %s\n",
 		       current->pid, current->comm);
 	}
-
-	spin_unlock_irqrestore(&exception_print_lock, flags);
 }
 
 void prregs(struct pt_regs *fp)
 {
 	int n;
 	unsigned long base;
+	struct pt_regs regs;
 
-	if (scanhex((void *)&base))
-		fp = (struct pt_regs *) base;
+	if (scanhex(&base)) {
+		if (setjmp(bus_error_jmp) == 0) {
+			catch_memory_errors = 1;
+			sync();
+			regs = *(struct pt_regs *)base;
+			sync();
+			__delay(200);
+		} else {
+			catch_memory_errors = 0;
+			printf("*** Error reading registers from %.16lx\n",
+			       base);
+			return;
+		}
+		catch_memory_errors = 0;
+		fp = &regs;
+	}
 
-	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
-		sync();
+	if (FULL_REGS(fp)) {
 		for (n = 0; n < 16; ++n)
-			printf("R%.2ld = %.16lx   R%.2ld = %.16lx\n", n,
-			       fp->gpr[n], n+16, fp->gpr[n+16]);
-		printf("pc  = %.16lx   msr = %.16lx\nlr  = %.16lx   "
-		       "cr  = %.16lx\n", fp->nip, fp->msr, fp->link, fp->ccr);
-		printf("ctr = %.16lx   xer = %.16lx   trap = %8lx\n",
-		       fp->ctr, fp->xer, fp->trap);
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
+			printf("R%.2ld = %.16lx   R%.2ld = %.16lx\n",
+			       n, fp->gpr[n], n+16, fp->gpr[n+16]);
 	} else {
-		printf("*** Error reading regs\n");
+		for (n = 0; n < 7; ++n)
+			printf("R%.2ld = %.16lx   R%.2ld = %.16lx\n",
+			       n, fp->gpr[n], n+7, fp->gpr[n+7]);
 	}
+	printf("pc  = ");
+	xmon_print_symbol(fp->nip, " ", "\n");
+	printf("lr  = ");
+	xmon_print_symbol(fp->link, " ", "\n");
+	printf("msr = %.16lx   cr  = %.8lx\n", fp->msr, fp->ccr);
+	printf("ctr = %.16lx   xer = %.16lx   trap = %8lx\n",
+	       fp->ctr, fp->xer, fp->trap);
 }
 
-void
-cacheflush(void)
+void cacheflush(void)
 {
 	int cmd;
 	unsigned long nflush;
@@ -1043,7 +1523,7 @@ cacheflush(void)
 	scanhex(&nflush);
 	nflush = (nflush + L1_CACHE_BYTES - 1) / L1_CACHE_BYTES;
 	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
+		catch_memory_errors = 1;
 		sync();
 
 		if (cmd != 'i') {
@@ -1057,7 +1537,7 @@ cacheflush(void)
 		/* wait a little while to see if we get a machine check */
 		__delay(200);
 	}
-	__debugger_fault_handler = 0;
+	catch_memory_errors = 0;
 }
 
 unsigned long
@@ -1077,20 +1557,7 @@ read_spr(int n)
 	store_inst(instrs+1);
 	code = (unsigned long (*)(void)) opd;
 
-	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
-		sync();
-
-		ret = code();
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
-	} else {
-		printf("*** Error reading spr %x\n", n);
-	}
-
-	__debugger_fault_handler = 0;
+	ret = code();
 
 	return ret;
 }
@@ -1111,20 +1578,7 @@ write_spr(int n, unsigned long val)
 	store_inst(instrs+1);
 	code = (unsigned long (*)(unsigned long)) opd;
 
-	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
-		sync();
-
-		code(val);
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
-	} else {
-		printf("*** Error writing spr %x\n", n);
-	}
-
-	__debugger_fault_handler = 0;
+	code(val);
 }
 
 static unsigned long regno;
@@ -1161,15 +1615,20 @@ super_regs()
     
 		printf("  Local Processor Control Area (LpPaca): \n");
 		ptrLpPaca = ptrPaca->xLpPacaPtr;
-		printf("    Saved Srr0=%.16lx  Saved Srr1=%.16lx \n", ptrLpPaca->xSavedSrr0, ptrLpPaca->xSavedSrr1);
-		printf("    Saved Gpr3=%.16lx  Saved Gpr4=%.16lx \n", ptrLpPaca->xSavedGpr3, ptrLpPaca->xSavedGpr4);
+		printf("    Saved Srr0=%.16lx  Saved Srr1=%.16lx \n",
+		       ptrLpPaca->xSavedSrr0, ptrLpPaca->xSavedSrr1);
+		printf("    Saved Gpr3=%.16lx  Saved Gpr4=%.16lx \n",
+		       ptrLpPaca->xSavedGpr3, ptrLpPaca->xSavedGpr4);
 		printf("    Saved Gpr5=%.16lx \n", ptrLpPaca->xSavedGpr5);
     
 		printf("  Local Processor Register Save Area (LpRegSave): \n");
 		ptrLpRegSave = ptrPaca->xLpRegSavePtr;
-		printf("    Saved Sprg0=%.16lx  Saved Sprg1=%.16lx \n", ptrLpRegSave->xSPRG0, ptrLpRegSave->xSPRG0);
-		printf("    Saved Sprg2=%.16lx  Saved Sprg3=%.16lx \n", ptrLpRegSave->xSPRG2, ptrLpRegSave->xSPRG3);
-		printf("    Saved Msr  =%.16lx  Saved Nia  =%.16lx \n", ptrLpRegSave->xMSR, ptrLpRegSave->xNIA);
+		printf("    Saved Sprg0=%.16lx  Saved Sprg1=%.16lx \n",
+		       ptrLpRegSave->xSPRG0, ptrLpRegSave->xSPRG0);
+		printf("    Saved Sprg2=%.16lx  Saved Sprg3=%.16lx \n",
+		       ptrLpRegSave->xSPRG2, ptrLpRegSave->xSPRG3);
+		printf("    Saved Msr  =%.16lx  Saved Nia  =%.16lx \n",
+		       ptrLpRegSave->xMSR, ptrLpRegSave->xNIA);
 #endif
 
 		return;
@@ -1194,6 +1653,9 @@ super_regs()
 	scannl();
 }
 
+/*
+ * Stuff for reading and writing memory safely
+ */
 int
 mread(unsigned long adrs, void *buf, int size)
 {
@@ -1202,7 +1664,7 @@ mread(unsigned long adrs, void *buf, int size)
 
 	n = 0;
 	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
+		catch_memory_errors = 1;
 		sync();
 		p = (char *)adrs;
 		q = (char *)buf;
@@ -1227,7 +1689,7 @@ mread(unsigned long adrs, void *buf, int size)
 		__delay(200);
 		n = size;
 	}
-	__debugger_fault_handler = 0;
+	catch_memory_errors = 0;
 	return n;
 }
 
@@ -1239,7 +1701,7 @@ mwrite(unsigned long adrs, void *buf, int size)
 
 	n = 0;
 	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
+		catch_memory_errors = 1;
 		sync();
 		p = (char *) adrs;
 		q = (char *) buf;
@@ -1266,7 +1728,7 @@ mwrite(unsigned long adrs, void *buf, int size)
 	} else {
 		printf("*** Error writing address %x\n", adrs + n);
 	}
-	__debugger_fault_handler = 0;
+	catch_memory_errors = 0;
 	return n;
 }
 
@@ -1276,7 +1738,7 @@ static char *fault_chars[] = { "--", "**", "##" };
 static int
 handle_fault(struct pt_regs *regs)
 {
-	switch (regs->trap) {
+	switch (TRAP(regs)) {
 	case 0x200:
 		fault_type = 0;
 		break;
@@ -1541,7 +2003,7 @@ dump()
 		scanhex(&nidump);
 		if( nidump == 0 )
 			nidump = 16;
-		adrs += ppc_inst_dump(adrs, nidump);
+		adrs += ppc_inst_dump(adrs, nidump, 1);
 		last_cmd = "di\n";
 	} else {
 		scanhex(&ndump);
@@ -1559,41 +2021,43 @@ prdump(unsigned long adrs, long ndump)
 	long n, m, c, r, nr;
 	unsigned char temp[16];
 
-	for( n = ndump; n > 0; ){
+	for (n = ndump; n > 0;) {
 		printf("%.16lx", adrs);
 		putchar(' ');
 		r = n < 16? n: 16;
 		nr = mread(adrs, temp, r);
 		adrs += nr;
-		for( m = 0; m < r; ++m ){
+		for (m = 0; m < r; ++m) {
 		        if ((m & 7) == 0 && m > 0)
 			    putchar(' ');
-			if( m < nr )
+			if (m < nr)
 				printf("%.2x", temp[m]);
 			else
 				printf("%s", fault_chars[fault_type]);
 		}
-		for(; m < 16; ++m )
-			printf("   ");
+		if (m <= 8)
+			printf(" ");
+		for (; m < 16; ++m)
+			printf("  ");
 		printf("  |");
-		for( m = 0; m < r; ++m ){
-			if( m < nr ){
+		for (m = 0; m < r; ++m) {
+			if (m < nr) {
 				c = temp[m];
 				putchar(' ' <= c && c <= '~'? c: '.');
 			} else
 				putchar(' ');
 		}
 		n -= r;
-		for(; m < 16; ++m )
+		for (; m < 16; ++m)
 			putchar(' ');
 		printf("|\n");
-		if( nr < r )
+		if (nr < r)
 			break;
 	}
 }
 
 int
-ppc_inst_dump(unsigned long adr, long count)
+ppc_inst_dump(unsigned long adr, long count, int praddr)
 {
 	int nr, dotted;
 	unsigned long first_adr;
@@ -1601,11 +2065,13 @@ ppc_inst_dump(unsigned long adr, long count)
 	unsigned char val[4];
 
 	dotted = 0;
-	for (first_adr = adr; count > 0; --count, adr += 4){
+	for (first_adr = adr; count > 0; --count, adr += 4) {
 		nr = mread(adr, val, 4);
-		if( nr == 0 ){
-			const char *x = fault_chars[fault_type];
-			printf("%.16lx  %s%s%s%s\n", adr, x, x, x, x);
+		if (nr == 0) {
+			if (praddr) {
+				const char *x = fault_chars[fault_type];
+				printf("%.16lx  %s%s%s%s\n", adr, x, x, x, x);
+			}
 			break;
 		}
 		inst = GETWORD(val);
@@ -1618,9 +2084,10 @@ ppc_inst_dump(unsigned long adr, long count)
 		}
 		dotted = 0;
 		last_inst = inst;
-		printf("%.16lx  ", adr);
-		printf("%.8x\t", inst);
-		print_insn_big_powerpc(stdout, inst, adr);	/* always returns 4 */
+		if (praddr)
+			printf("%.16lx  %.8x", adr, inst);
+		printf("\t");
+		print_insn_powerpc(inst, adr, 0);	/* always returns 4 */
 		printf("\n");
 	}
 	return adr - first_adr;
@@ -1629,19 +2096,7 @@ ppc_inst_dump(unsigned long adr, long count)
 void
 print_address(unsigned long addr)
 {
-	const char *name;
-	char *modname;
-	long size, offset;
-
-	name = kallsyms_lookup(addr, &size, &offset, &modname, tmpstr);
-
-	if (name) {
-		if (modname)
-			printf("0x%lx\t# %s:%s+0x%lx", addr, modname, name, offset);
-		else
-			printf("0x%lx\t# %s+0x%lx", addr, name, offset);
-	} else
-		printf("0x%lx", addr);
+	xmon_print_symbol(addr, "\t# ", "");
 }
 
 
@@ -1781,7 +2236,7 @@ static char *regnames[N_PTREGS] = {
 	"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
 	"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
 	"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
-	"pc", "msr", "or3", "ctr", "lr", "xer", "ccr", "mq",
+	"pc", "msr", "or3", "ctr", "lr", "xer", "ccr", "softe",
 	"trap", "dar", "dsisr", "res"
 };
 
@@ -1809,13 +2264,11 @@ unsigned long *vp;
 		regname[i] = 0;
 		for (i = 0; i < N_PTREGS; ++i) {
 			if (strcmp(regnames[i], regname) == 0) {
-				unsigned long *rp = (unsigned long *)
-					xmon_regs[smp_processor_id()];
-				if (rp == NULL) {
+				if (xmon_regs == NULL) {
 					printf("regs not available\n");
 					return 0;
 				}
-				*vp = rp[i];
+				*vp = ((unsigned long *)xmon_regs)[i];
 				return 1;
 			}
 		}
@@ -1827,8 +2280,16 @@ unsigned long *vp;
 
 	if (c == '0') {
 		c = inchar();
-		if (c == 'x')
+		if (c == 'x') {
 			c = inchar();
+		} else {
+			d = hexdigit(c);
+			if (d == EOF) {
+				termch = c;
+				*vp = 0;
+				return 1;
+			}
+		}
 	} else if (c == '$') {
 		int i;
 		for (i=0; i<63; i++) {
@@ -1943,16 +2404,14 @@ symbol_lookup(void)
 
 	switch (type) {
 	case 'a':
-		if (scanhex(&addr)) {
-			printf("%lx: ", addr);
-			xmon_print_symbol("%s\n", addr);
-		}
+		if (scanhex(&addr))
+			xmon_print_symbol(addr, ": ", "\n");
 		termch = 0;
 		break;
 	case 's':
 		getstring(tmp, 64);
 		if (setjmp(bus_error_jmp) == 0) {
-			__debugger_fault_handler = handle_fault;
+			catch_memory_errors = 1;
 			sync();
 			addr = kallsyms_lookup_name(tmp);
 			if (addr)
@@ -1961,58 +2420,40 @@ symbol_lookup(void)
 				printf("Symbol '%s' not found.\n", tmp);
 			sync();
 		}
-		__debugger_fault_handler = 0;
+		catch_memory_errors = 0;
 		termch = 0;
 		break;
 	}
 }
 
 
-/* xmon version of __print_symbol */
-void __xmon_print_symbol(const char *fmt, unsigned long address)
+/* Print an address in numeric and symbolic form (if possible) */
+static void xmon_print_symbol(unsigned long address, const char *mid,
+			      const char *after)
 {
 	char *modname;
-	const char *name;
+	const char *name = NULL;
 	unsigned long offset, size;
 
+	printf("%.16lx", address);
 	if (setjmp(bus_error_jmp) == 0) {
-		__debugger_fault_handler = handle_fault;
+		catch_memory_errors = 1;
 		sync();
 		name = kallsyms_lookup(address, &size, &offset, &modname,
 				       tmpstr);
 		sync();
 		/* wait a little while to see if we get a machine check */
 		__delay(200);
-	} else {
-		name = "symbol lookup failed";
-	}
-
-	__debugger_fault_handler = 0;
-
-	if (!name) {
-		char addrstr[sizeof("0x%lx") + (BITS_PER_LONG*3/10)];
-
-		sprintf(addrstr, "0x%lx", address);
-		printf(fmt, addrstr);
-		return;
 	}
 
-	if (modname) {
-		/* This is pretty small. */
-		char buffer[sizeof("%s+%#lx/%#lx [%s]")
-			   + strlen(name) + 2*(BITS_PER_LONG*3/10)
-			   + strlen(modname)];
-
-		sprintf(buffer, "%s+%#lx/%#lx [%s]",
-			name, offset, size, modname);
-		printf(fmt, buffer);
-	} else {
-		char buffer[sizeof("%s+%#lx/%#lx")
-			   + strlen(name) + 2*(BITS_PER_LONG*3/10)];
+	catch_memory_errors = 0;
 
-		sprintf(buffer, "%s+%#lx/%#lx", name, offset, size);
-		printf(fmt, buffer);
+	if (name) {
+		printf("%s%s+%#lx/%#lx", mid, name, offset, size);
+		if (modname)
+			printf(" [%s]", modname);
 	}
+	printf("%s", after);
 }
 
 static void debug_trace(void)
@@ -2069,9 +2510,9 @@ static void dump_slb(void)
 	int i;
 	unsigned long tmp;
 
-	printf("SLB contents of cpu %d\n", smp_processor_id());
+	printf("SLB contents of cpu %x\n", smp_processor_id());
 
-	for (i = 0; i < naca->slb_size; i++) {
+	for (i = 0; i < SLB_NUM_ENTRIES; i++) {
 		asm volatile("slbmfee  %0,%1" : "=r" (tmp) : "r" (i));
 		printf("%02d %016lx ", i, tmp);
 
@@ -2085,7 +2526,7 @@ static void dump_stab(void)
 	int i;
 	unsigned long *tmp = (unsigned long *)get_paca()->xStab_data.virt;
 
-	printf("Segment table contents of cpu %d\n", smp_processor_id());
+	printf("Segment table contents of cpu %x\n", smp_processor_id());
 
 	for (i = 0; i < PAGE_SIZE/16; i++) {
 		unsigned long a, b;
@@ -2103,10 +2544,12 @@ static void dump_stab(void)
 void xmon_init(void)
 {
 	__debugger = xmon;
+	__debugger_ipi = xmon_ipi;
 	__debugger_bpt = xmon_bpt;
 	__debugger_sstep = xmon_sstep;
 	__debugger_iabr_match = xmon_iabr_match;
 	__debugger_dabr_match = xmon_dabr_match;
+	__debugger_fault_handler = xmon_fault_handler;
 }
 
 void dump_segments(void)
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 2d7efbf4f..0f8c08ad9 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -85,9 +85,10 @@ struct appldata_parameter_list {
  */
 static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
 static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
-		   		  void *buffer, size_t *lenp);
+				  void __user *buffer, size_t *lenp);
 static int appldata_interval_handler(ctl_table *ctl, int write,
-					 struct file *filp, void *buffer,
+					 struct file *filp,
+					 void __user *buffer,
 					 size_t *lenp);
 
 static struct ctl_table_header *appldata_sysctl_header;
@@ -192,7 +193,8 @@ static void appldata_tasklet_function(unsigned long data)
  * wrapper function for mod_virt_timer(), because smp_call_function_on()
  * accepts only one parameter.
  */
-static void appldata_mod_vtimer_wrap(struct appldata_mod_vtimer_args *args) {
+static void appldata_mod_vtimer_wrap(void *p) {
+	struct appldata_mod_vtimer_args *args = p;
 	mod_virt_timer(args->timer, args->expires);
 }
 
@@ -252,7 +254,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
  */
 static int
 appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
-			   void *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp)
 {
 	int len, i;
 	char buf[2];
@@ -309,7 +311,7 @@ out:
  */
 static int
 appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
-			   void *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp)
 {
 	int len, i, interval;
 	char buf[16];
@@ -347,7 +349,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
 			appldata_mod_vtimer_args.expires =
 					per_cpu_interval;
 			smp_call_function_on(
-				(void *) appldata_mod_vtimer_wrap,
+				appldata_mod_vtimer_wrap,
 				&appldata_mod_vtimer_args,
 				0, 1, i);
 		}
@@ -370,7 +372,7 @@ out:
  */
 static int
 appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
-			   void *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp)
 {
 	struct appldata_ops *ops = NULL, *tmp_ops;
 	int rc, len, found;
diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
index a67fd8afc..6ead7ff3b 100644
--- a/arch/s390/boot/Makefile
+++ b/arch/s390/boot/Makefile
@@ -15,4 +15,4 @@ $(obj)/image: vmlinux FORCE
 
 install: $(CONFIGURE) $(obj)/image
 	sh -x $(obj)/install.sh $(KERNELRELEASE) $(obj)/image \
-	      System.map Kerntypes "$(INSTALL_PATH)"
+	      System.map init/kerntypes.o "$(INSTALL_PATH)"
diff --git a/arch/s390/boot/install.sh b/arch/s390/boot/install.sh
index 278a8139c..860bebc1b 100644
--- a/arch/s390/boot/install.sh
+++ b/arch/s390/boot/install.sh
@@ -16,7 +16,8 @@
 #   $1 - kernel version
 #   $2 - kernel image file
 #   $3 - kernel map file
-#   $4 - default install path (blank if root directory)
+#   $4 - kernel type file
+#   $5 - default install path (blank if root directory)
 #
 
 # User may have a custom install script
@@ -26,13 +27,22 @@ if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
 
 # Default install - same as make zlilo
 
-if [ -f $4/vmlinuz ]; then
-	mv $4/vmlinuz $4/vmlinuz.old
+if [ -f $5/vmlinuz ]; then
+	mv $5/vmlinuz $5/vmlinuz.old
 fi
 
-if [ -f $4/System.map ]; then
-	mv $4/System.map $4/System.old
+if [ -f $5/System.map ]; then
+	mv $5/System.map $5/System.old
 fi
 
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
+if [ -f $5/Kerntypes ]; then
+	mv $5/Kerntypes $5/Kerntypes.old
+fi
+
+cat $2 > $5/vmlinuz
+cp $3 $5/System.map
+
+# copy the kernel type file if it exists
+if [ -f $4 ]; then
+	cp $4 $5/Kerntypes
+fi
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index e1fd61888..c694ae543 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -28,6 +28,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -112,7 +113,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 
@@ -126,6 +126,7 @@ CONFIG_SCSI_LOGGING=y
 # SCSI low-level drivers
 #
 # CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_DEBUG is not set
@@ -178,6 +179,8 @@ CONFIG_UNIX98_PTY_COUNT=2048
 # S/390 character device drivers
 #
 CONFIG_TN3270=y
+CONFIG_TN3270_TTY=y
+CONFIG_TN3270_FS=m
 CONFIG_TN3270_CONSOLE=y
 CONFIG_TN3215=y
 CONFIG_TN3215_CONSOLE=y
@@ -308,11 +311,7 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
 
 #
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
+# Gigabit Ethernet (1000/10000 Mbit)
 #
 
 #
@@ -433,7 +432,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -505,9 +503,11 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index a35e11af2..ce2b03578 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -32,6 +32,7 @@ int main(void)
 	DEFINE(__TI_cpu, offsetof(struct thread_info, cpu),);
 	DEFINE(__TI_precount, offsetof(struct thread_info, preempt_count),);
 	BLANK();
+	DEFINE(__PT_ARGS, offsetof(struct pt_regs, args),);
 	DEFINE(__PT_PSW, offsetof(struct pt_regs, psw),);
 	DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs),);
 	DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2),);
diff --git a/arch/s390/kernel/binfmt_elf32.c b/arch/s390/kernel/binfmt_elf32.c
index 0d7ecc85c..01c188c70 100644
--- a/arch/s390/kernel/binfmt_elf32.c
+++ b/arch/s390/kernel/binfmt_elf32.c
@@ -32,10 +32,6 @@
 #define NUM_FPRS      16
 #define NUM_ACRS      16    
 
-#define TASK31_SIZE		(0x80000000UL)
-#undef TASK_SIZE
-#define TASK_SIZE TASK31_SIZE
-
 /* For SVR4/S390 the function pointer to be registered with `atexit` is
    passed in R14. */
 #define ELF_PLAT_INIT(_r, load_addr) \
@@ -51,7 +47,7 @@
    the loader.  We need to make sure that it is out of the way of the program
    that it will "exec", and that there is sufficient room for the brk.  */
 
-#define ELF_ET_DYN_BASE         (TASK31_SIZE / 3 * 2)
+#define ELF_ET_DYN_BASE         (TASK_SIZE / 3 * 2)
 
 /* Wow, the "main" arch needs arch dependent functions too.. :) */
 
@@ -169,7 +165,6 @@ struct elf_prpsinfo32
 #undef start_thread
 #define start_thread                    start_thread31 
 #define setup_arg_pages(bprm, exec)     setup_arg_pages32(bprm, exec)
-#define elf_map				elf_map32
 
 MODULE_DESCRIPTION("Binary format loader for compatibility with 32bit Linux for S390 binaries,"
                    " Copyright 2000 IBM Corporation"); 
@@ -188,19 +183,3 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
 
 #include "../../../fs/binfmt_elf.c"
 
-static unsigned long
-elf_map32 (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
-{
-	unsigned long map_addr;
-
-	if (!addr) 
-		addr = TASK_UNMAPPED_BASE;
-
-	down_write(&current->mm->mmap_sem);
-	map_addr = do_mmap(filep, ELF_PAGESTART(addr),
-			   eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr),
-			   prot, type,
-			   eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
-	up_write(&current->mm->mmap_sem);
-	return(map_addr);
-}
diff --git a/arch/s390/kernel/compat_exec.c b/arch/s390/kernel/compat_exec.c
index 162deb2bb..595c43a89 100644
--- a/arch/s390/kernel/compat_exec.c
+++ b/arch/s390/kernel/compat_exec.c
@@ -34,9 +34,6 @@
 #endif
 
 
-#undef STACK_TOP
-#define STACK_TOP TASK31_SIZE
-
 int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack)
 {
 	unsigned long stack_base;
@@ -61,6 +58,8 @@ int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack)
 		return -ENOMEM;
 	}
 
+	memset(mpnt, 0, sizeof(*mpnt));
+
 	down_write(&mm->mmap_sem);
 	{
 		mpnt->vm_mm = mm;
@@ -69,11 +68,6 @@ int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack)
 		/* executable stack setting would be applied here */
 		mpnt->vm_page_prot = PAGE_COPY;
 		mpnt->vm_flags = VM_STACK_FLAGS;
-		mpnt->vm_ops = NULL;
-		mpnt->vm_pgoff = 0;
-		mpnt->vm_file = NULL;
-		INIT_LIST_HEAD(&mpnt->shared);
-		mpnt->vm_private_data = (void *) 0;
 		insert_vm_struct(mm, mpnt);
 		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
 	} 
@@ -82,7 +76,7 @@ int setup_arg_pages32(struct linux_binprm *bprm, int executable_stack)
 		struct page *page = bprm->page[i];
 		if (page) {
 			bprm->page[i] = NULL;
-			put_dirty_page(current,page,stack_base,PAGE_COPY);
+			install_arg_page(mpnt, page, stack_base);
 		}
 		stack_base += PAGE_SIZE;
 	}
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index df06185d5..5685c5feb 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -355,144 +355,6 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned
 		return sys_ftruncate(fd, (high << 32) | low);
 }
 
-typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *);
-typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *);
-
-static long do_readv_writev32(int type, struct file *file,
-			      const struct compat_iovec *vector, u32 count)
-{
-	unsigned long tot_len;
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov=iovstack, *ivp;
-	struct inode *inode;
-	long retval, i;
-	io_fn_t fn;
-	iov_fn_t fnv;
-
-	/* First get the "struct iovec" from user memory and
-	 * verify all the pointers
-	 */
-	if (!count)
-		return 0;
-	if (verify_area(VERIFY_READ, vector, sizeof(struct compat_iovec)*count))
-		return -EFAULT;
-	if (count > UIO_MAXIOV)
-		return -EINVAL;
-	if (count > UIO_FASTIOV) {
-		iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			return -ENOMEM;
-	}
-
-	tot_len = 0;
-	i = count;
-	ivp = iov;
-	retval = -EINVAL;
-	while(i > 0) {
-		compat_ssize_t tmp = tot_len;
-		compat_ssize_t len;
-		u32 buf;
-
-		if (__get_user(len, &vector->iov_len) ||
-		    __get_user(buf, &vector->iov_base)) {
-			retval = -EFAULT;
-			goto out;
-		}
-		if (len < 0)	/* size_t not fitting an ssize_t32 .. */
-			goto out;
-		tot_len += len;
-		if (tot_len < tmp) /* maths overflow on the compat_ssize_t */
-			goto out;
-		ivp->iov_base = (void *)A(buf);
-		ivp->iov_len = (__kernel_size_t) len;
-		vector++;
-		ivp++;
-		i--;
-	}
-	if (tot_len == 0) {
-		retval = 0;
-		goto out;
-	}
-
-	inode = file->f_dentry->d_inode;
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	retval = locks_verify_area((type == VERIFY_WRITE
-				    ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
-				   inode, file, file->f_pos, tot_len);
-	if (retval)
-		goto out;
-
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	fnv = (type == VERIFY_WRITE ? file->f_op->readv : file->f_op->writev);
-	if (fnv) {
-		retval = fnv(file, iov, count, &file->f_pos);
-		goto out;
-	}
-
-	fn = (type == VERIFY_WRITE ? file->f_op->read :
-	      (io_fn_t) file->f_op->write);
-
-	ivp = iov;
-	while (count > 0) {
-		void * base;
-		int len, nr;
-
-		base = ivp->iov_base;
-		len = ivp->iov_len;
-		ivp++;
-		count--;
-		nr = fn(file, base, len, &file->f_pos);
-		if (nr < 0) {
-			if (!retval)
-				retval = nr;
-			break;
-		}
-		retval += nr;
-		if (nr != len)
-			break;
-	}
-out:
-	if (iov != iovstack)
-		kfree(iov);
-
-	return retval;
-}
-
-asmlinkage long sys32_readv(int fd, struct compat_iovec *vector, unsigned long count)
-{
-	struct file *file;
-	long ret = -EBADF;
-
-	file = fget(fd);
-	if(!file)
-		goto bad_file;
-
-	if (file->f_op && (file->f_mode & FMODE_READ) &&
-	    (file->f_op->readv || file->f_op->read))
-		ret = do_readv_writev32(VERIFY_WRITE, file, vector, count);
-	fput(file);
-
-bad_file:
-	return ret;
-}
-
-asmlinkage long sys32_writev(int fd, struct compat_iovec *vector, unsigned long count)
-{
-	struct file *file;
-	int ret = -EBADF;
-
-	file = fget(fd);
-	if(!file)
-		goto bad_file;
-	if (file->f_op && (file->f_mode & FMODE_WRITE) &&
-	    (file->f_op->writev || file->f_op->write))
-		ret = do_readv_writev32(VERIFY_READ, file, vector, count);
-	fput(file);
-
-bad_file:
-	return ret;
-}
-
 /* readdir & getdents */
 
 #define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
@@ -623,160 +485,6 @@ out:
 
 /* end of readdir & getdents */
 
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static inline int
-get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
-{
-	if (ufdset) {
-		unsigned long odd;
-
-		if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
-#define MAX_SELECT_SECONDS \
-	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-
-asmlinkage long sys32_select(int n, u32 *inp, u32 *outp, u32 *exp,
-				struct compat_timeval *tvp)
-{
-	fd_set_bits fds;
-	char *bits;
-	unsigned long nn;
-	long timeout;
-	int ret, size;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp) {
-		int sec, usec;
-
-		if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
-		    || (ret = __get_user(sec, &tvp->tv_sec))
-		    || (ret = __get_user(usec, &tvp->tv_usec)))
-			goto out_nofds;
-
-		ret = -EINVAL;
-		if(sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-	if (n > current->files->max_fdset)
-		n = current->files->max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words. 
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = kmalloc(6 * size, GFP_KERNEL);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if ((ret = get_fd_set32(nn, fds.in, inp)) ||
-	    (ret = get_fd_set32(nn, fds.out, outp)) ||
-	    (ret = get_fd_set32(nn, fds.ex, exp)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
-		int sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		put_user(sec, &tvp->tv_sec);
-		put_user(usec, &tvp->tv_usec);
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set32(nn, inp, fds.res_in);
-	set_fd_set32(nn, outp, fds.res_out);
-	set_fd_set32(nn, exp, fds.res_ex);
-
-out:
-	kfree(bits);
-out_nofds:
-	return ret;
-}
-
 int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
 {
 	int err;
@@ -1026,188 +734,6 @@ sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo)
 	return ret;
 }
 
-extern void check_pending(int signum);
-
-/*
- * count32() counts the number of arguments/envelopes
- */
-static int count32(u32 * argv)
-{
-	int i = 0;
-
-	if (argv != NULL) {
-		for (;;) {
-			u32 p; int error;
-
-			error = get_user(p,argv);
-			if (error) return error;
-			if (!p) break;
-			argv++; i++;
-		}
-	}
-	return i;
-}
-
-/*
- * 'copy_string32()' copies argument/envelope strings from user
- * memory to free pages in kernel mem. These are in a format ready
- * to be put directly into the top of new user memory.
- */
-static int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm)
-{
-	while (argc-- > 0) {
-		u32 str;
-		int len;
-		unsigned long pos;
-
-		if (get_user(str, argv + argc) ||
-		    !str ||
-		    !(len = strnlen_user((char *)A(str), bprm->p)))
-			return -EFAULT;
-
-		if (bprm->p < len)
-			return -E2BIG;
-
-		bprm->p -= len;
-
-		pos = bprm->p;
-		while (len) {
-			char *kaddr;
-			struct page *page;
-			int offset, bytes_to_copy, new, err;
-
-			offset = pos % PAGE_SIZE;
-			page = bprm->page[pos / PAGE_SIZE];
-			new = 0;
-			if (!page) {
-				page = alloc_page(GFP_USER);
-				bprm->page[pos / PAGE_SIZE] = page;
-				if (!page)
-					return -ENOMEM;
-				new = 1;
-			}
-			kaddr = (char *)kmap(page);
-
-			if (new && offset)
-				memset(kaddr, 0, offset);
-			bytes_to_copy = PAGE_SIZE - offset;
-			if (bytes_to_copy > len) {
-				bytes_to_copy = len;
-				if (new)
-					memset(kaddr+offset+len, 0,
-					       PAGE_SIZE-offset-len);
-			}
-
-			err = copy_from_user(kaddr + offset, (char *)A(str),
-					     bytes_to_copy);
-			kunmap(page);
-
-			if (err)
-				return -EFAULT;
-
-			pos += bytes_to_copy;
-			str += bytes_to_copy;
-			len -= bytes_to_copy;
-		}
-	}
-	return 0;
-}
-
-/*
- * sys32_execve() executes a new program.
- */
-static inline int 
-do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
-{
-	struct linux_binprm bprm;
-	struct file * file;
-	int retval;
-	int i;
-
-	sched_balance_exec();
-
-	file = open_exec(filename);
-
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		return retval;
-
-	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
-	memset(bprm.page, 0, MAX_ARG_PAGES * sizeof(bprm.page[0]));
-
-	bprm.file = file;
-	bprm.filename = filename;
-	bprm.interp = filename;
-	bprm.sh_bang = 0;
-	bprm.loader = 0;
-	bprm.exec = 0;
-	bprm.mm = mm_alloc();
-	retval = -ENOMEM;
-	if (!bprm.mm)
-		goto out_file;
-
-	/* init_new_context is empty for s390x. */
-
-	bprm.argc = count32(argv);
-	if ((retval = bprm.argc) < 0)
-		goto out_mm;
-
-	bprm.envc = count32(envp);
-	if ((retval = bprm.envc) < 0)
-		goto out_mm;
-
-	retval = security_bprm_alloc(&bprm);
-	if (retval)
-		goto out;
-
-	retval = prepare_binprm(&bprm);
-	if (retval < 0)
-		goto out;
-	
-	retval = copy_strings_kernel(1, &bprm.filename, &bprm);
-	if (retval < 0)
-		goto out;
-
-	bprm.exec = bprm.p;
-	retval = copy_strings32(bprm.envc, envp, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = copy_strings32(bprm.argc, argv, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = search_binary_handler(&bprm, regs);
-	if (retval >= 0) {
-		/* execve success */
-		security_bprm_free(&bprm);
-		return retval;
-	}
-
-out:
-	/* Something went wrong, return the inode and free the argument pages*/
-	for (i=0 ; i<MAX_ARG_PAGES ; i++) {
-		struct page * page = bprm.page[i];
-		if (page)
-			__free_page(page);
-	}
-
-	if (bprm.security)
-		security_bprm_free(&bprm);
-
-out_mm:
-	if (bprm.mm)
-		mmdrop(bprm.mm);
-
-out_file:
-	if (bprm.file) {
-		allow_write_access(bprm.file);
-		fput(bprm.file);
-	}
-
-	return retval;
-}
-
 /*
  * sys32_execve() executes a new program after the asm stub has set
  * things up for us.  This should basically do what I want it to.
@@ -1218,11 +744,12 @@ sys32_execve(struct pt_regs regs)
         int error;
         char * filename;
 
-        filename = getname((char *)A(regs.orig_gpr2));
+        filename = getname(compat_ptr(regs.orig_gpr2));
         error = PTR_ERR(filename);
         if (IS_ERR(filename))
                 goto out;
-        error = do_execve32(filename, (u32 *)A(regs.gprs[3]), (u32 *)A(regs.gprs[4]), &regs);
+        error = compat_do_execve(filename, compat_ptr(regs.gprs[3]),
+				 compat_ptr(regs.gprs[4]), &regs);
 	if (error == 0)
 	{
 		current->ptrace &= ~PT_DTRACE;
@@ -1270,226 +797,6 @@ sys32_delete_module(const char __user *name_user, unsigned int flags)
 
 #endif  /* CONFIG_MODULES */
 
-/* Stuff for NFS server syscalls... */
-struct nfsctl_svc32 {
-	u16			svc32_port;
-	s32			svc32_nthreads;
-};
-
-struct nfsctl_client32 {
-	s8			cl32_ident[NFSCLNT_IDMAX+1];
-	s32			cl32_naddr;
-	struct in_addr		cl32_addrlist[NFSCLNT_ADDRMAX];
-	s32			cl32_fhkeytype;
-	s32			cl32_fhkeylen;
-	u8			cl32_fhkey[NFSCLNT_KEYMAX];
-};
-
-struct nfsctl_export32 {
-	s8			ex32_client[NFSCLNT_IDMAX+1];
-	s8			ex32_path[NFS_MAXPATHLEN+1];
-	compat_dev_t	ex32_dev;
-	compat_ino_t	ex32_ino;
-	s32			ex32_flags;
-	compat_uid_t	ex32_anon_uid;
-	compat_gid_t	ex32_anon_gid;
-};
-
-struct nfsctl_fdparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_version;
-};
-
-struct nfsctl_fsparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_maxlen;
-};
-
-struct nfsctl_arg32 {
-	s32			ca32_version;	/* safeguard */
-	union {
-		struct nfsctl_svc32	u32_svc;
-		struct nfsctl_client32	u32_client;
-		struct nfsctl_export32	u32_export;
-		struct nfsctl_fdparm32	u32_getfd;
-		struct nfsctl_fsparm32	u32_getfs;
-	} u;
-#define ca32_svc	u.u32_svc
-#define ca32_client	u.u32_client
-#define ca32_export	u.u32_export
-#define ca32_getfd	u.u32_getfd
-#define ca32_getfs	u.u32_getfs
-#define ca32_authd	u.u32_authd
-};
-
-union nfsctl_res32 {
-	__u8			cr32_getfh[NFS_FHSIZE];
-	struct knfsd_fh		cr32_getfs;
-};
-
-static int nfs_svc32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= __get_user(karg->ca_svc.svc_port, &arg32->ca32_svc.svc32_port);
-	err |= __get_user(karg->ca_svc.svc_nthreads, &arg32->ca32_svc.svc32_nthreads);
-	return err;
-}
-
-static int nfs_clnt32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_client.cl_ident[0],
-			  &arg32->ca32_client.cl32_ident[0],
-			  NFSCLNT_IDMAX);
-	err |= __get_user(karg->ca_client.cl_naddr, &arg32->ca32_client.cl32_naddr);
-	err |= copy_from_user(&karg->ca_client.cl_addrlist[0],
-			  &arg32->ca32_client.cl32_addrlist[0],
-			  (sizeof(struct in_addr) * NFSCLNT_ADDRMAX));
-	err |= __get_user(karg->ca_client.cl_fhkeytype,
-		      &arg32->ca32_client.cl32_fhkeytype);
-	err |= __get_user(karg->ca_client.cl_fhkeylen,
-		      &arg32->ca32_client.cl32_fhkeylen);
-	err |= copy_from_user(&karg->ca_client.cl_fhkey[0],
-			  &arg32->ca32_client.cl32_fhkey[0],
-			  NFSCLNT_KEYMAX);
-	return err;
-}
-
-static int nfs_exp32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_export.ex_client[0],
-			  &arg32->ca32_export.ex32_client[0],
-			  NFSCLNT_IDMAX);
-	err |= copy_from_user(&karg->ca_export.ex_path[0],
-			  &arg32->ca32_export.ex32_path[0],
-			  NFS_MAXPATHLEN);
-	err |= __get_user(karg->ca_export.ex_dev,
-		      &arg32->ca32_export.ex32_dev);
-	err |= __get_user(karg->ca_export.ex_ino,
-		      &arg32->ca32_export.ex32_ino);
-	err |= __get_user(karg->ca_export.ex_flags,
-		      &arg32->ca32_export.ex32_flags);
-	err |= __get_user(karg->ca_export.ex_anon_uid,
-		      &arg32->ca32_export.ex32_anon_uid);
-	err |= __get_user(karg->ca_export.ex_anon_gid,
-		      &arg32->ca32_export.ex32_anon_gid);
-	karg->ca_export.ex_anon_uid = high2lowuid(karg->ca_export.ex_anon_uid);
-	karg->ca_export.ex_anon_gid = high2lowgid(karg->ca_export.ex_anon_gid);
-	return err;
-}
-
-static int nfs_getfd32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfd.gd_addr,
-			  &arg32->ca32_getfd.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfd.gd_path,
-			  &arg32->ca32_getfd.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= __get_user(karg->ca_getfd.gd_version,
-		      &arg32->ca32_getfd.gd32_version);
-	return err;
-}
-
-static int nfs_getfs32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfs.gd_addr,
-			  &arg32->ca32_getfs.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfs.gd_path,
-			  &arg32->ca32_getfs.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= __get_user(karg->ca_getfs.gd_maxlen,
-		      &arg32->ca32_getfs.gd32_maxlen);
-	return err;
-}
-
-/* This really doesn't need translations, we are only passing
- * back a union which contains opaque nfs file handle data.
- */
-static int nfs_getfh32_res_trans(union nfsctl_res *kres, union nfsctl_res32 *res32)
-{
-	return copy_to_user(res32, kres, sizeof(*res32)) ? -EFAULT : 0;
-}
-
-long asmlinkage sys32_nfsservctl(int cmd, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
-{
-	struct nfsctl_arg *karg = NULL;
-	union nfsctl_res *kres = NULL;
-	mm_segment_t oldfs;
-	int err;
-
-	karg = kmalloc(sizeof(*karg), GFP_USER);
-	if(!karg)
-		return -ENOMEM;
-	if(res32) {
-		kres = kmalloc(sizeof(*kres), GFP_USER);
-		if(!kres) {
-			kfree(karg);
-			return -ENOMEM;
-		}
-	}
-	switch(cmd) {
-	case NFSCTL_SVC:
-		err = nfs_svc32_trans(karg, arg32);
-		break;
-	case NFSCTL_ADDCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_DELCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_EXPORT:
-	case NFSCTL_UNEXPORT:
-		err = nfs_exp32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFD:
-		err = nfs_getfd32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFS:
-		err = nfs_getfs32_trans(karg, arg32);
-		break;
-	default:
-		err = -EINVAL;
-		break;
-	}
-	if(err)
-		goto done;
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_nfsservctl(cmd, karg, kres);
-	set_fs(oldfs);
-
-	if (err)
-		goto done;
-
-	if((cmd == NFSCTL_GETFD) ||
-	   (cmd == NFSCTL_GETFS))
-		err = nfs_getfh32_res_trans(kres, res32);
-
-done:
-	if(karg)
-		kfree(karg);
-	if(kres)
-		kfree(kres);
-	return err;
-}
-
 /* Translations due to time_t size differences.  Which affects all
    sorts of things, like timeval and itimerval.  */
 
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 3886a27b8..67134eee7 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -53,7 +53,7 @@ typedef struct
 
 asmlinkage int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
 
-int copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from)
+int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from)
 {
 	int err;
 
@@ -130,7 +130,8 @@ sys32_sigsuspend(struct pt_regs * regs,int history0, int history1, old_sigset_t
 }
 
 asmlinkage int
-sys32_rt_sigsuspend(struct pt_regs * regs,compat_sigset_t *unewset, size_t sigsetsize)
+sys32_rt_sigsuspend(struct pt_regs * regs, compat_sigset_t __user *unewset,
+								size_t sigsetsize)
 {
 	sigset_t saveset, newset;
 	compat_sigset_t set32;
@@ -162,11 +163,11 @@ sys32_rt_sigsuspend(struct pt_regs * regs,compat_sigset_t *unewset, size_t sigse
                 if (do_signal(regs, &saveset))
                         return -EINTR;
         }
-}                                                         
+}
 
 asmlinkage long
-sys32_sigaction(int sig, const struct old_sigaction32 *act,
-		 struct old_sigaction32 *oact)
+sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
+		 struct old_sigaction32 __user *oact)
 {
         struct k_sigaction new_ka, old_ka;
         int ret;
@@ -199,9 +200,9 @@ sys32_sigaction(int sig, const struct old_sigaction32 *act,
 int
 do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact);
 
-asmlinkage long 
-sys32_rt_sigaction(int sig, const struct sigaction32 *act,
-	   struct sigaction32 *oact,  size_t sigsetsize)
+asmlinkage long
+sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
+	   struct sigaction32 __user *oact,  size_t sigsetsize)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -258,7 +259,8 @@ sys32_rt_sigaction(int sig, const struct sigaction32 *act,
 }
 
 asmlinkage long
-sys32_sigaltstack(const stack_t32 *uss, stack_t32 *uoss, struct pt_regs *regs)
+sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss,
+							struct pt_regs *regs)
 {
 	stack_t kss, koss;
 	int ret, err = 0;
@@ -275,7 +277,9 @@ sys32_sigaltstack(const stack_t32 *uss, stack_t32 *uoss, struct pt_regs *regs)
 	}
 
 	set_fs (KERNEL_DS);
-	ret = do_sigaltstack(uss ? &kss : NULL , uoss ? &koss : NULL, regs->gprs[15]);
+	ret = do_sigaltstack((stack_t __user *) (uss ? &kss : NULL),
+			     (stack_t __user *) (uoss ? &koss : NULL),
+			     regs->gprs[15]);
 	set_fs (old_fs);
 
 	if (!ret && uoss) {
@@ -290,7 +294,7 @@ sys32_sigaltstack(const stack_t32 *uss, stack_t32 *uoss, struct pt_regs *regs)
 	return ret;
 }
 
-static int save_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
+static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
 {
 	_s390_regs_common32 regs32;
 	int err, i;
@@ -311,7 +315,7 @@ static int save_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
 			      sizeof(_s390_fp_regs32));
 }
 
-static int restore_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
+static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
 {
 	_s390_regs_common32 regs32;
 	int err, i;
@@ -343,7 +347,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
 
 asmlinkage long sys32_sigreturn(struct pt_regs *regs)
 {
-	sigframe32 *frame = (sigframe32 *)regs->gprs[15];
+	sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15];
 	sigset_t set;
 
 	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
@@ -365,11 +369,11 @@ asmlinkage long sys32_sigreturn(struct pt_regs *regs)
 badframe:
 	force_sig(SIGSEGV, current);
 	return 0;
-}	
+}
 
 asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
 {
-	rt_sigframe32 *frame = (rt_sigframe32 *)regs->gprs[15];
+	rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15];
 	sigset_t set;
 	stack_t st;
 	__u32 ss_sp;
@@ -399,8 +403,8 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
 
 	/* It is more difficult to avoid calling this function than to
 	   call it and ignore errors.  */
-	set_fs (KERNEL_DS);   
-	do_sigaltstack(&st, NULL, regs->gprs[15]);
+	set_fs (KERNEL_DS);
+	do_sigaltstack((stack_t __user *)&st, NULL, regs->gprs[15]);
 	set_fs (old_fs);
 
 	return regs->gprs[2];
@@ -418,7 +422,7 @@ badframe:
 /*
  * Determine which stack to use..
  */
-static inline void *
+static inline void __user *
 get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 {
 	unsigned long sp;
@@ -439,7 +443,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 		sp = (unsigned long) ka->sa.sa_restorer;
 	}
 
-	return (void *)((sp - frame_size) & -8ul);
+	return (void __user *)((sp - frame_size) & -8ul);
 }
 
 static inline int map_signal(int sig)
@@ -455,7 +459,7 @@ static inline int map_signal(int sig)
 static void setup_frame32(int sig, struct k_sigaction *ka,
 			sigset_t *set, struct pt_regs * regs)
 {
-	sigframe32 *frame = get_sigframe(ka, regs, sizeof(sigframe32));
+	sigframe32 __user *frame = get_sigframe(ka, regs, sizeof(sigframe32));
 	if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe32)))
 		goto give_sigsegv;
 
@@ -474,12 +478,12 @@ static void setup_frame32(int sig, struct k_sigaction *ka,
 	} else {
 		regs->gprs[14] = (__u64) frame->retcode;
 		if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
-		               (u16 *)(frame->retcode)))
+		               (u16 __user *)(frame->retcode)))
 			goto give_sigsegv;
         }
 
 	/* Set up backchain. */
-	if (__put_user(regs->gprs[15], (unsigned int *) frame))
+	if (__put_user(regs->gprs[15], (unsigned int __user *) frame))
 		goto give_sigsegv;
 
 	/* Set up registers for signal handler */
@@ -505,7 +509,7 @@ static void setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
 			   sigset_t *set, struct pt_regs * regs)
 {
 	int err = 0;
-	rt_sigframe32 *frame = get_sigframe(ka, regs, sizeof(rt_sigframe32));
+	rt_sigframe32 __user *frame = get_sigframe(ka, regs, sizeof(rt_sigframe32));
 	if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe32)))
 		goto give_sigsegv;
 
@@ -531,11 +535,11 @@ static void setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
 	} else {
 		regs->gprs[14] = (__u64) frame->retcode;
 		err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
-		                  (u16 *)(frame->retcode));
+		                  (u16 __user *)(frame->retcode));
 	}
 
 	/* Set up backchain. */
-	if (__put_user(regs->gprs[15], (unsigned int *) frame))
+	if (__put_user(regs->gprs[15], (unsigned int __user *) frame))
 		goto give_sigsegv;
 
 	/* Set up registers for signal handler */
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 7187d1b62..41adc6120 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -641,14 +641,14 @@ sys32_getdents_wrapper:
 	llgfr	%r4,%r4			# unsigned int
 	jg	sys32_getdents		# branch to system call
 
-	.globl  sys32_select_wrapper 
-sys32_select_wrapper:
+	.globl  compat_sys_select_wrapper
+compat_sys_select_wrapper:
 	lgfr	%r2,%r2			# int
-	llgtr	%r3,%r3			# fd_set *
-	llgtr	%r4,%r4			# fd_set *
-	llgtr	%r5,%r5			# fd_set *
-	llgtr	%r6,%r6			# struct timeval_emu31 *
-	jg	sys32_select		# branch to system call
+	llgtr	%r3,%r3			# compat_fd_set *
+	llgtr	%r4,%r4			# compat_fd_set *
+	llgtr	%r5,%r5			# compat_fd_set *
+	llgtr	%r6,%r6			# struct compat_timeval *
+	jg	compat_sys_select	# branch to system call
 
 	.globl  sys32_flock_wrapper 
 sys32_flock_wrapper:
@@ -663,19 +663,19 @@ sys32_msync_wrapper:
 	lgfr	%r4,%r4			# int
 	jg	sys_msync		# branch to system call
 
-	.globl  sys32_readv_wrapper 
-sys32_readv_wrapper:
+	.globl  compat_sys_readv_wrapper
+compat_sys_readv_wrapper:
 	lgfr	%r2,%r2			# int
-	llgtr	%r3,%r3			# const struct iovec_emu31 *
+	llgtr	%r3,%r3			# const struct compat_iovec *
 	llgfr	%r4,%r4			# unsigned long
-	jg	sys32_readv		# branch to system call
+	jg	compat_sys_readv	# branch to system call
 
-	.globl  sys32_writev_wrapper 
-sys32_writev_wrapper:
+	.globl  compat_sys_writev_wrapper
+compat_sys_writev_wrapper:
 	lgfr	%r2,%r2			# int
-	llgtr	%r3,%r3			# const struct iovec_emu31 *
+	llgtr	%r3,%r3			# const struct compat_iovec *
 	llgfr	%r4,%r4			# unsigned long
-	jg	sys32_writev		# branch to system call
+	jg	compat_sys_writev	# branch to system call
 
 	.globl  sys32_getsid_wrapper 
 sys32_getsid_wrapper:
@@ -786,12 +786,12 @@ sys32_poll_wrapper:
 	lgfr	%r4,%r4			# long 
 	jg	sys_poll		# branch to system call
 
-	.globl  sys32_nfsservctl_wrapper 
-sys32_nfsservctl_wrapper:
+	.globl  compat_sys_nfsservctl_wrapper
+compat_sys_nfsservctl_wrapper:
 	lgfr	%r2,%r2			# int 
-	llgtr	%r3,%r3			# struct nfsctl_arg_emu31 * 
-	llgtr	%r4,%r4			# union nfsctl_res_emu31 * 
-	jg	sys32_nfsservctl	# branch to system call
+	llgtr	%r3,%r3			# struct compat_nfsctl_arg*
+	llgtr	%r4,%r4			# union compat_nfsctl_res*
+	jg	compat_sys_nfsservctl	# branch to system call
 
 	.globl  sys32_setresgid16_wrapper 
 sys32_setresgid16_wrapper:
@@ -1097,6 +1097,8 @@ compat_sys_futex_wrapper:
 	lgfr	%r4,%r4			# int
 	llgtr	%r5,%r5			# struct compat_timespec *
 	llgtr	%r6,%r6			# u32 *
+	lgf	%r0,164(%r15)		# int
+	stg	%r0,160(%r15)
 	jg	compat_sys_futex	# branch to system call
 
 	.globl	sys32_setxattr_wrapper
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index d2980b671..540a9a8bc 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -62,9 +62,9 @@ extern void tod_to_timeval(uint64_t todval, struct timeval *xtime);
 /* internal function prototyes */
 
 static int debug_init(void);
-static ssize_t debug_output(struct file *file, char *user_buf,
+static ssize_t debug_output(struct file *file, char __user *user_buf,
 			    size_t user_len, loff_t * offset);
-static ssize_t debug_input(struct file *file, const char *user_buf,
+static ssize_t debug_input(struct file *file, const char __user *user_buf,
 			   size_t user_len, loff_t * offset);
 static int debug_open(struct inode *inode, struct file *file);
 static int debug_close(struct inode *inode, struct file *file);
@@ -74,10 +74,10 @@ static void debug_info_put(debug_info_t *);
 static int debug_prolog_level_fn(debug_info_t * id,
 				 struct debug_view *view, char *out_buf);
 static int debug_input_level_fn(debug_info_t * id, struct debug_view *view,
-				struct file *file, const char *user_buf,
+				struct file *file, const char __user *user_buf,
 				size_t user_buf_size, loff_t * offset);
 static int debug_input_flush_fn(debug_info_t * id, struct debug_view *view,
-                                struct file *file, const char *user_buf,
+                                struct file *file, const char __user *user_buf,
                                 size_t user_buf_size, loff_t * offset);
 static int debug_hex_ascii_format_fn(debug_info_t * id, struct debug_view *view,
                                 char *out_buf, const char *in_buf);
@@ -416,10 +416,10 @@ out:
  * - copies formated debug entries to the user buffer
  */
 
-static ssize_t debug_output(struct file *file,	/* file descriptor */
-			    char *user_buf,	/* user buffer */
-			    size_t  len,	/* length of buffer */
-			    loff_t *offset	/* offset in the file */ )
+static ssize_t debug_output(struct file *file,		/* file descriptor */
+			    char __user *user_buf,	/* user buffer */
+			    size_t  len,		/* length of buffer */
+			    loff_t *offset)	      /* offset in the file */
 {
 	size_t count = 0;
 	size_t entry_offset, size = 0;
@@ -462,7 +462,7 @@ out:
  */
 
 static ssize_t debug_input(struct file *file,
-			   const char *user_buf, size_t length,
+			   const char __user *user_buf, size_t length,
 			   loff_t *offset)
 {
 	int rc = 0;
@@ -942,7 +942,7 @@ static int debug_prolog_level_fn(debug_info_t * id,
  */
 
 static int debug_input_level_fn(debug_info_t * id, struct debug_view *view,
-				struct file *file, const char *user_buf,
+				struct file *file, const char __user *user_buf,
 				size_t in_buf_size, loff_t * offset)
 {
 	char input_buf[1];
@@ -1004,9 +1004,9 @@ void debug_flush(debug_info_t* id, int area)
 /*
  * view function: flushes debug areas 
  */
- 
+
 static int debug_input_flush_fn(debug_info_t * id, struct debug_view *view,
-                                struct file *file, const char *user_buf,
+                                struct file *file, const char __user *user_buf,
                                 size_t in_buf_size, loff_t * offset)
 {
         char input_buf[1];
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index d5a9e1cda..f716b41f0 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -24,7 +24,8 @@
  * Stack layout for the system_call stack entry.
  * The first few entries are identical to the user_regs_struct.
  */
-SP_PTREGS    =  STACK_FRAME_OVERHEAD 
+SP_PTREGS    =  STACK_FRAME_OVERHEAD
+SP_ARGS      =  STACK_FRAME_OVERHEAD + __PT_ARGS
 SP_PSW       =  STACK_FRAME_OVERHEAD + __PT_PSW
 SP_R0        =  STACK_FRAME_OVERHEAD + __PT_GPRS
 SP_R1        =  STACK_FRAME_OVERHEAD + __PT_GPRS + 4
@@ -47,7 +48,8 @@ SP_ILC       =  STACK_FRAME_OVERHEAD + __PT_ILC
 SP_TRAP      =  STACK_FRAME_OVERHEAD + __PT_TRAP
 SP_SIZE      =  STACK_FRAME_OVERHEAD + __PT_SIZE
 
-_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_RESTART_SVC)
+_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
+		 _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
 _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
 
 #define BASED(name) name-system_call(%r13)
@@ -229,17 +231,20 @@ system_call:
 	lh	%r7,0x8a	  # get svc number from lowcore
 sysc_enter:
         GET_THREAD_INFO           # load pointer to task_struct to R9
+sysc_do_svc:
 	sla	%r7,2             # *4 and test for svc 0
-	bnz	BASED(sysc_do_restart)  # svc number > 0
+	bnz	BASED(sysc_nr_ok) # svc number > 0
 	# svc 0: system call number in %r1
 	cl	%r1,BASED(.Lnr_syscalls)
-	bnl	BASED(sysc_do_restart)
+	bnl	BASED(sysc_nr_ok)
 	lr	%r7,%r1           # copy svc number to %r7
 	sla	%r7,2             # *4
+sysc_nr_ok:
+	mvc	SP_ARGS(4,%r15),SP_R7(%r15)
 sysc_do_restart:
 	tm	__TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
         l       %r8,sys_call_table-system_call(%r7,%r13) # get system call addr.
-        bo      BASED(sysc_tracesys)
+        bnz     BASED(sysc_tracesys)
         basr    %r14,%r8          # call sys_xxxx
         st      %r2,SP_R2(%r15)   # store return value (change R2 on stack)
                                   # ATTENTION: check sys_execve_glue before
@@ -262,7 +267,6 @@ sysc_work_loop:
 	bz	BASED(sysc_leave)      # there is no work to do
 #
 # One of the work bits is on. Find out which one.
-# Checked are: _TIF_SIGPENDING and _TIF_NEED_RESCHED
 #
 sysc_work:
 	tm	__TI_flags+3(%r9),_TIF_NEED_RESCHED
@@ -271,6 +275,8 @@ sysc_work:
 	bo	BASED(sysc_sigpending)
 	tm	__TI_flags+3(%r9),_TIF_RESTART_SVC
 	bo	BASED(sysc_restart)
+	tm	__TI_flags+3(%r9),_TIF_SINGLE_STEP
+	bo	BASED(sysc_singlestep)
 	b	BASED(sysc_leave)
 
 #
@@ -304,6 +310,17 @@ sysc_restart:
 	lm	%r2,%r6,SP_R2(%r15)    # load svc arguments
 	b	BASED(sysc_do_restart) # restart svc
 
+#
+# _TIF_SINGLE_STEP is set, call do_debugger_trap
+#
+sysc_singlestep:
+	ni	__TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
+	mvi	SP_TRAP+1(%r15),0x28	# set trap indication to pgm check
+	la	%r2,SP_PTREGS(%r15)	# address of register-save area
+	l	%r1,BASED(.Lhandle_per)	# load adr. of per handler
+	la	%r14,BASED(sysc_return)	# load adr. of system return
+	br	%r1			# branch to do_debugger_trap
+
 __critical_end:
 
 #
@@ -328,7 +345,7 @@ sysc_tracego:
 	st	%r2,SP_R2(%r15)   # store return value
 sysc_tracenogo:
 	tm	__TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        bno     BASED(sysc_return)
+        bz      BASED(sysc_return)
 	l	%r1,BASED(.Ltrace)
 	la	%r2,SP_PTREGS(%r15)    # load pt_regs
 	la	%r3,1
@@ -471,9 +488,10 @@ pgm_per:
 pgm_per_std:
 	SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
 	GET_THREAD_INFO
-	mvc	__THREAD_per+__PER_atmid(2,%r9),__LC_PER_ATMID
-	mvc	__THREAD_per+__PER_address(4,%r9),__LC_PER_ADDRESS
-	mvc	__THREAD_per+__PER_access_id(1,%r9),__LC_PER_ACCESS_ID
+	l	%r1,__TI_task(%r9)
+	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
+	mvc	__THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
+	mvc	__THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
 	la	%r4,0x7f
 	l	%r3,__LC_PGM_ILC	 # load program interruption code
         nr      %r4,%r3                  # clear per-event-bit and ilc
@@ -494,70 +512,15 @@ pgm_per_only:
 #
 pgm_svcper:
 	SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
-	lh	%r7,0x8a	  # get svc number from lowcore
-        stosm   24(%r15),0x03     # reenable interrupts
-        GET_THREAD_INFO           # load pointer to task_struct to R9
-	mvc	__THREAD_per+__PER_atmid(2,%r9),__LC_PER_ATMID
-	mvc	__THREAD_per+__PER_address(4,%r9),__LC_PER_ADDRESS
-	mvc	__THREAD_per+__PER_access_id(1,%r9),__LC_PER_ACCESS_ID
-        sla     %r7,2             # *4 and test for svc 0
-	bnz	BASED(pgm_svcstd) # svc number > 0 ?
-	# svc 0: system call number in %r1
-	cl	%r1,BASED(.Lnr_syscalls)
-	bnl	BASED(pgm_svcstd)
-	lr	%r7,%r1           # copy svc number to %r7
-	sla	%r7,2             # *4
-pgm_svcstd:
-	tm	__TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        l       %r8,sys_call_table-system_call(%r7,%r13) # get system call addr.
-        bo      BASED(pgm_tracesys)
-        basr    %r14,%r8          # call sys_xxxx
-        st      %r2,SP_R2(%r15)   # store return value (change R2 on stack)
-                                  # ATTENTION: check sys_execve_glue before
-                                  # changing anything here !!
-
-pgm_svcret:
-	tm	__TI_flags+3(%r9),_TIF_SIGPENDING
-	bno	BASED(pgm_svcper_nosig)
-	la	%r2,SP_PTREGS(%r15) # load pt_regs
-	sr	%r3,%r3		  # clear *oldset
-	l	%r1,BASED(.Ldo_signal)
-	basr	%r14,%r1	  # call do_signal
-	
-pgm_svcper_nosig:
-        mvi     SP_TRAP+3(%r15),0x28     # set trap indication to pgm check
-	la      %r2,SP_PTREGS(15)        # address of register-save area
-        l       %r1,BASED(.Lhandle_per)  # load adr. of per handler
-        la      %r14,BASED(sysc_return)  # load adr. of system return
-        br      %r1                      # branch to do_debugger_trap
-#
-# call trace before and after sys_call
-#
-pgm_tracesys:
-        l       %r1,BASED(.Ltrace)
-	la	%r2,SP_PTREGS(%r15)    # load pt_regs
-	la	%r3,0
-	srl	%r7,2
-	st	%r7,SP_R2(%r15)
-        basr    %r14,%r1
-	clc	SP_R2(4,%r15),BASED(.Lnr_syscalls)
-	bnl	BASED(pgm_svc_nogo)
-	l	%r7,SP_R2(%r15)   # strace changed the syscall
-	sll     %r7,2
-	l	%r8,sys_call_table-system_call(%r7,%r13)
-pgm_svc_go:
-	lm      %r3,%r6,SP_R3(%r15)
-	l       %r2,SP_ORIG_R2(%r15)
-        basr    %r14,%r8          # call sys_xxx
-        st      %r2,SP_R2(%r15)   # store return value
-pgm_svc_nogo:
-	tm	__TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        bno     BASED(pgm_svcret)
-        l       %r1,BASED(.Ltrace)
-	la	%r2,SP_PTREGS(%r15)    # load pt_regs
-	la	%r3,1
-	la	%r14,BASED(pgm_svcret)
-        br      %r1
+	lh	%r7,0x8a		# get svc number from lowcore
+	GET_THREAD_INFO			# load pointer to task_struct to R9
+	l	%r1,__TI_task(%r9)
+	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
+	mvc	__THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
+	mvc	__THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
+	oi	__TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
+	stosm	24(%r15),0x03		# reenable interrupts
+	b	BASED(sysc_do_svc)
 
 /*
  * IO interrupt handler routine
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index e94e694d5..533fa85ce 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -24,7 +24,8 @@
  * Stack layout for the system_call stack entry.
  * The first few entries are identical to the user_regs_struct.
  */
-SP_PTREGS    =  STACK_FRAME_OVERHEAD 
+SP_PTREGS    =  STACK_FRAME_OVERHEAD
+SP_ARGS      =  STACK_FRAME_OVERHEAD + __PT_ARGS
 SP_PSW       =  STACK_FRAME_OVERHEAD + __PT_PSW
 SP_R0        =  STACK_FRAME_OVERHEAD + __PT_GPRS
 SP_R1        =  STACK_FRAME_OVERHEAD + __PT_GPRS + 8
@@ -47,7 +48,8 @@ SP_ILC       =  STACK_FRAME_OVERHEAD + __PT_ILC
 SP_TRAP      =  STACK_FRAME_OVERHEAD + __PT_TRAP
 SP_SIZE      =  STACK_FRAME_OVERHEAD + __PT_SIZE
 
-_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_RESTART_SVC)
+_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
+		 _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
 _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
 
 /*
@@ -213,14 +215,17 @@ system_call:
 	llgh    %r7,__LC_SVC_INT_CODE # get svc number from lowcore
 sysc_enter:
         GET_THREAD_INFO           # load pointer to task_struct to R9
+sysc_do_svc:
         slag    %r7,%r7,2         # *4 and test for svc 0
-	jnz	sysc_do_restart
+	jnz	sysc_nr_ok
 	# svc 0: system call number in %r1
 	lghi	%r0,NR_syscalls
 	clr	%r1,%r0
-	jnl	sysc_do_restart
+	jnl	sysc_nr_ok
 	lgfr	%r7,%r1           # clear high word in r1
 	slag    %r7,%r7,2         # svc 0: system call number in %r1
+sysc_nr_ok:
+	mvc	SP_ARGS(8,%r15),SP_R7(%r15)
 sysc_do_restart:
 	larl    %r10,sys_call_table
 #ifdef CONFIG_S390_SUPPORT
@@ -231,7 +236,7 @@ sysc_noemu:
 #endif
 	tm	__TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
         lgf     %r8,0(%r7,%r10)   # load address of system call routine
-        jo      sysc_tracesys
+        jnz     sysc_tracesys
         basr    %r14,%r8          # call sys_xxxx
         stg     %r2,SP_R2(%r15)   # store return value (change R2 on stack)
                                   # ATTENTION: check sys_execve_glue before
@@ -254,7 +259,6 @@ sysc_work_loop:
 	jz	sysc_leave        # there is no work to do
 #
 # One of the work bits is on. Find out which one.
-# Checked are: _TIF_SIGPENDING and _TIF_NEED_RESCHED
 #
 sysc_work:
 	tm	__TI_flags+7(%r9),_TIF_NEED_RESCHED
@@ -263,6 +267,8 @@ sysc_work:
 	jo	sysc_sigpending
 	tm	__TI_flags+7(%r9),_TIF_RESTART_SVC
 	jo	sysc_restart
+	tm	__TI_flags+7(%r9),_TIF_SINGLE_STEP
+	jo	sysc_singlestep
 	j	sysc_leave
 
 #
@@ -294,6 +300,17 @@ sysc_restart:
 	lmg	%r2,%r6,SP_R2(%r15)    # load svc arguments
 	j	sysc_do_restart        # restart svc
 
+#
+# _TIF_SINGLE_STEP is set, call do_debugger_trap
+#
+sysc_singlestep:
+	ni	__TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
+	mvi	SP_TRAP+1(%r15),0x28	# set trap indication to pgm check
+	la	%r2,SP_PTREGS(%r15)	# address of register-save area
+	larl	%r14,sysc_return	# load adr. of system return
+	jg	do_debugger_trap	# branch to do_debugger_trap
+
+
 __critical_end:
 
 #
@@ -319,7 +336,7 @@ sysc_tracego:
         stg     %r2,SP_R2(%r15)     # store return value
 sysc_tracenogo:
 	tm	__TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        jno     sysc_return
+        jz      sysc_return
 	la	%r2,SP_PTREGS(%r15)    # load pt_regs
 	la	%r3,1
 	larl	%r14,sysc_return    # return point is sysc_return
@@ -505,9 +522,10 @@ pgm_per:
 pgm_per_std:
 	SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
 	GET_THREAD_INFO
-	mvc	__THREAD_per+__PER_atmid(2,%r9),__LC_PER_ATMID
-	mvc	__THREAD_per+__PER_address(8,%r9),__LC_PER_ADDRESS
-	mvc	__THREAD_per+__PER_access_id(1,%r9),__LC_PER_ACCESS_ID
+	lg	%r1,__TI_task(%r9)
+	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
+	mvc	__THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
+	mvc	__THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
 	lghi    %r4,0x7f
 	lgf     %r3,__LC_PGM_ILC	 # load program interruption code
         nr      %r4,%r3			 # clear per-event-bit and ilc
@@ -527,74 +545,15 @@ pgm_per_only:
 #
 pgm_svcper:
 	SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
-	llgh    %r7,__LC_SVC_INT_CODE # get svc number from lowcore
-	stosm   48(%r15),0x03     # reenable interrupts
-        GET_THREAD_INFO           # load pointer to task_struct to R9
-	mvc	__THREAD_per+__PER_atmid(2,%r9),__LC_PER_ATMID
-	mvc	__THREAD_per+__PER_address(8,%r9),__LC_PER_ADDRESS
-	mvc	__THREAD_per+__PER_access_id(1,%r9),__LC_PER_ACCESS_ID
-	slag	%r7,%r7,2         # *4 and test for svc 0
-	jnz	pgm_svcstd
-	# svc 0: system call number in %r1
-	lghi	%r0,NR_syscalls
-	clr	%r1,%r0
-	slag	%r7,%r1,2
-pgm_svcstd:
-	larl    %r10,sys_call_table
-#ifdef CONFIG_S390_SUPPORT
-        tm      SP_PSW+3(%r15),0x01  # are we running in 31 bit mode ?
-        jo      pgm_svcper_noemu
-	larl    %r10,sys_call_table_emu # use 31 bit emulation system calls
-pgm_svcper_noemu:
-#endif
-	tm	__TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        lgf     %r8,0(%r7,%r10)   # load address of system call routine
-        jo      pgm_tracesys
-        basr    %r14,%r8          # call sys_xxxx
-        stg     %r2,SP_R2(%r15)   # store return value (change R2 on stack)
-                                  # ATTENTION: check sys_execve_glue before
-                                  # changing anything here !!
-
-pgm_svcret:
-	tm	__TI_flags+7(%r9),_TIF_SIGPENDING
-	jno	pgm_svcper_nosig
-        la      %r2,SP_PTREGS(%r15) # load pt_regs
-        sgr     %r3,%r3             # clear *oldset
-	brasl	%r14,do_signal
-	
-pgm_svcper_nosig:
-	lhi     %r0,__LC_PGM_OLD_PSW     # set trap indication back to pgm_chk
-	st      %r0,SP_TRAP(%r15)
-        la      %r2,SP_PTREGS(15) # address of register-save area
-        larl    %r14,sysc_return  # load adr. of system return
-        jg      do_debugger_trap
-#
-# call trace before and after sys_call
-#
-pgm_tracesys:
-	la	%r2,SP_PTREGS(%r15)    # load pt_regs
-	la	%r3,0
-	srlg	%r7,%r7,2
-	stg	%r7,SP_R2(%r15)
-        brasl   %r14,syscall_trace
-	lghi	%r0,NR_syscalls
-	clg	%r0,SP_R2(%r15)
-	jnh	pgm_svc_nogo
-	lg      %r7,SP_R2(%r15)
-	sllg    %r7,%r7,2           # strace wants to change the syscall
-	lgf	%r8,0(%r7,%r10)
-pgm_svc_go:
-	lmg     %r3,%r6,SP_R3(%r15)
-	lg      %r2,SP_ORIG_R2(%r15)
-        basr    %r14,%r8            # call sys_xxx
-        stg     %r2,SP_R2(%r15)     # store return value
-pgm_svc_nogo:
-	tm	__TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
-        jno     pgm_svcret
-	la	%r2,SP_PTREGS(%r15)    # load pt_regs
-	la	%r3,1
-	larl	%r14,pgm_svcret     # return point is sysc_return
-	jg	syscall_trace
+	llgh    %r7,__LC_SVC_INT_CODE	# get svc number from lowcore
+	GET_THREAD_INFO			# load pointer to task_struct to R9
+	lg	%r1,__TI_task(%r9)
+	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
+	mvc	__THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
+	mvc	__THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
+	oi	__TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
+	stosm	48(%r15),0x03		# reenable interrupts
+	j	sysc_do_svc
 
 /*
  * IO interrupt handler routine
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 229f4aff8..068653a5e 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -478,9 +478,80 @@ startup:basr  %r13,0                     # get base
         mvcle %r2,%r4,0                 # clear mem
         jo    .-4                       # branch back, if not finish
 
+	l     %r2,.Lrcp-.LPG1(%r13)	# Read SCP forced command word
+.Lservicecall:
+	stosm .Lpmask-.LPG1(%r13),0x01	# authorize ext interrupts
+
+	stctl %r0, %r0,.Lcr-.LPG1(%r13)	# get cr0
+	la    %r1,0x200			# set bit 22
+	o     %r1,.Lcr-.LPG1(%r13)	# or old cr0 with r1
+	st    %r1,.Lcr-.LPG1(%r13)
+	lctl  %r0, %r0,.Lcr-.LPG1(%r13)	# load modified cr0
+
+	mvc   __LC_EXT_NEW_PSW(8),.Lpcext-.LPG1(%r13) # set postcall psw
+	la    %r1, .Lsclph-.LPG1(%r13)
+	a     %r1,__LC_EXT_NEW_PSW+4	# set handler
+	st    %r1,__LC_EXT_NEW_PSW+4
+
+	la    %r4,_pstart-.LPG1(%r13)	# %r4 is our index for sccb stuff
+	la    %r1, .Lsccb-PARMAREA(%r4)	# our sccb
+	.insn rre,0xb2200000,%r2,%r1	# service call
+	ipm   %r1
+	srl   %r1,28			# get cc code
+	xr    %r3, %r3
+	chi   %r1,3
+	be    .Lfchunk-.LPG1(%r13)	# leave
+	chi   %r1,2
+	be    .Lservicecall-.LPG1(%r13)
+	lpsw  .Lwaitsclp-.LPG1(%r13)
+.Lsclph:
+	lh    %r1,.Lsccbr-PARMAREA(%r4)
+	chi   %r1,0x10			# 0x0010 is the sucess code
+	je    .Lprocsccb		# let's process the sccb
+	chi   %r1,0x1f0
+	bne   .Lfchunk-.LPG1(%r13)	# unhandled error code
+	c     %r2, .Lrcp-.LPG1(%r13)	# Did we try Read SCP forced
+	bne   .Lfchunk-.LPG1(%r13)	# if no, give up
+	l     %r2, .Lrcp2-.LPG1(%r13)	# try with Read SCP
+	b     .Lservicecall-.LPG1(%r13)
+.Lprocsccb:
+	lh    %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
+	chi   %r1,0x00
+	jne   .Lscnd
+	l     %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
+.Lscnd:
+	xr    %r3,%r3			# same logic
+	ic    %r3,.Lscpa1-PARMAREA(%r4)
+	chi   %r3,0x00
+	jne   .Lcompmem
+	l     %r3,.Lscpa2-PARMAREA(%r13)
+.Lcompmem:
+	mr    %r2,%r1			# mem in MB on 128-bit
+	l     %r1,.Lonemb-.LPG1(%r13)
+	mr    %r2,%r1			# mem size in bytes in %r3
+	b     .Lfchunk-.LPG1(%r13)
+
+.Lpmask:
+	.byte 0
+.align 8
+.Lpcext:.long  0x00080000,0x80000000
+.Lcr:
+	.long 0x00			# place holder for cr0
+.Lwaitsclp:
+	.long 0x020A0000
+	.long .Lsclph
+.Lrcp:
+	.int 0x00120001			# Read SCP forced code
+.Lrcp2:
+	.int 0x00020001			# Read SCP code
+.Lonemb:
+	.int 0x100000
+.Lfchunk:
+
 #
 # find memory chunks.
 #
+	lr    %r9,%r3			 # end of mem
 	mvc   __LC_PGM_NEW_PSW(8),.Lpcmem-.LPG1(%r13)
 	la    %r1,1                      # test in increments of 128KB
 	sll   %r1,17
@@ -488,38 +559,46 @@ startup:basr  %r13,0                     # get base
 	slr   %r4,%r4                    # set start of chunk to zero
 	slr   %r5,%r5                    # set end of chunk to zero
 	slr   %r6,%r6			 # set access code to zero
+	la    %r10, MEMORY_CHUNKS	 # number of chunks
 .Lloop:
 	tprot 0(%r5),0			 # test protection of first byte
 	ipm   %r7
 	srl   %r7,28
 	clr   %r6,%r7			 # compare cc with last access code
 	be    .Lsame-.LPG1(%r13)
-	clr   %r4,%r5			 # chunk size > 0?
-	be    .Lsize0-.LPG1(%r13)
-	st    %r4,0(%r3)		 # store start address of chunk
-	lr    %r0,%r5
-	slr   %r0,%r4
-	st    %r0,4(%r3)		 # store size of chunk
-	st    %r6,8(%r3)		 # store type of chunk
-	la    %r3,12(%r3)
-	lr    %r4,%r5			 # set start to end
-.Lsize0:
-	lr    %r6,%r7			 # set access code to last cc
+	b     .Lchkmem-.LPG1(%r13)
 .Lsame:
 	ar    %r5,%r1			 # add 128KB to end of chunk
 	bno   .Lloop-.LPG1(%r13)	 # r1 < 0x80000000 -> loop
 .Lchkmem:				 # > 2GB or tprot got a program check
 	clr   %r4,%r5			 # chunk size > 0?
-	be    .Ldonemem-.LPG1(%r13)
+	be    .Lchkloop-.LPG1(%r13)
 	st    %r4,0(%r3)		 # store start address of chunk
 	lr    %r0,%r5
 	slr   %r0,%r4
 	st    %r0,4(%r3)		 # store size of chunk
 	st    %r6,8(%r3)		 # store type of chunk
+	la    %r3,12(%r3)
+	l     %r4,.Lmemsize-.LPG1(%r13)	 # address of variable memory_size
+	st    %r5,0(%r4)		 # store last end to memory size
+	ahi   %r10,-1			 # update chunk number
+.Lchkloop:
+	lr    %r6,%r7			 # set access code to last cc
+	# we got an exception or we're starting a new
+	# chunk , we must check if we should
+	# still try to find valid memory (if we detected
+	# the amount of available storage), and if we
+	# have chunks left
+	xr    %r0,%r0
+	clr   %r0,%r9			 # did we detect memory?
+	je    .Ldonemem			 # if not, leave
+	chi   %r10,0			 # do we have chunks left?
+	je    .Ldonemem
+	alr   %r5,%r1			 # add 128KB to end of chunk
+	lr    %r4,%r5			 # potential new chunk
+	clr    %r5,%r9			 # should we go on?
+	jl     .Lloop
 .Ldonemem:		
-        l     %r1,.Lmemsize-.LPG1(%r13)  # address of variable memory_size
-	st    %r5,0(%r1)                 # store last end to memory size
-	
         l      %r12,.Lmflags-.LPG1(%r13) # get address of machine_flags
 #
 # find out if we are running under VM
@@ -631,6 +710,23 @@ _pstart:
     	.byte  "root=/dev/ram0 ro"
         .byte  0
 	.org   0x11000
+.Lsccb:
+	.hword 0x1000			# length, one page
+	.byte 0x00,0x00,0x00
+	.byte 0x80			# variable response bit set
+.Lsccbr:
+	.hword 0x00			# response code
+.Lscpincr1:
+	.hword 0x00
+.Lscpa1:
+	.byte 0x00
+	.fill 89,1,0
+.Lscpa2:
+	.int 0x00
+.Lscpincr2:
+	.quad 0x00
+	.fill 3984,1,0
+	.org 0x12000
 	.global _pend
 _pend:	
 
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index c380e2b9c..26caebd7d 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -480,12 +480,81 @@ startup:basr  %r13,0                     # get base
         mvcle %r2,%r4,0                 # clear mem
         jo    .-4                       # branch back, if not finish
 
+	l     %r2,.Lrcp-.LPG1(%r13)	# Read SCP forced command word
+.Lservicecall:
+	stosm .Lpmask-.LPG1(%r13),0x01	# authorize ext interrupts
+
+	stctg %r0,%r0,.Lcr-.LPG1(%r13)	# get cr0
+	la    %r1,0x200			# set bit 22
+	og    %r1,.Lcr-.LPG1(%r13)	# or old cr0 with r1
+	stg   %r1,.Lcr-.LPG1(%r13)
+	lctlg %r0,%r0,.Lcr-.LPG1(%r13)	# load modified cr0
+
+	mvc   __LC_EXT_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) # set postcall psw
+	larl  %r1,.Lsclph
+	stg   %r1,__LC_EXT_NEW_PSW+8	# set handler
+
+	larl  %r4,_pstart		# %r4 is our index for sccb stuff
+	la    %r1,.Lsccb-PARMAREA(%r4)	# our sccb
+	.insn rre,0xb2200000,%r2,%r1	# service call
+	ipm   %r1
+	srl   %r1,28			# get cc code
+	xr    %r3,%r3
+	chi   %r1,3
+	be    .Lfchunk-.LPG1(%r13)	# leave
+	chi   %r1,2
+	be    .Lservicecall-.LPG1(%r13)
+	lpsw  .Lwaitsclp-.LPG1(%r13)
+.Lsclph:
+	lh    %r1,.Lsccbr-PARMAREA(%r4)
+	chi   %r1,0x10			# 0x0010 is the sucess code
+	je    .Lprocsccb		# let's process the sccb
+	chi   %r1,0x1f0
+	bne   .Lfchunk-.LPG1(%r13)	# unhandled error code
+	c     %r2,.Lrcp-.LPG1(%r13)	# Did we try Read SCP forced
+	bne   .Lfchunk-.LPG1(%r13)	# if no, give up
+	l     %r2,.Lrcp2-.LPG1(%r13)	# try with Read SCP
+	b     .Lservicecall-.LPG1(%r13)
+.Lprocsccb:
+	lh    %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
+	chi   %r1,0x00
+	jne   .Lscnd
+	lg    %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
+.Lscnd:
+	xr    %r3,%r3			# same logic
+	ic    %r3,.Lscpa1-PARMAREA(%r4)
+	chi   %r3,0x00
+	jne   .Lcompmem
+	l     %r3,.Lscpa2-PARMAREA(%r13)
+.Lcompmem:
+	mlgr  %r2,%r1			# mem in MB on 128-bit
+	l     %r1,.Lonemb-.LPG1(%r13)
+	mlgr  %r2,%r1			# mem size in bytes in %r3
+	b     .Lfchunk-.LPG1(%r13)
+
+.Lpmask:
+	.byte 0
+	.align 8
+.Lcr:
+	.quad 0x00  # place holder for cr0
+.Lwaitsclp:
+	.long 0x020A0000
+	.quad .Lsclph
+.Lrcp:
+	.int 0x00120001 # Read SCP forced code
+.Lrcp2:
+	.int 0x00020001 # Read SCP code
+.Lonemb:
+	.int 0x100000
+
+.Lfchunk:
 					 # set program check new psw mask
 	mvc   __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
 
 #
 # find memory chunks.
 #
+	lgr   %r9,%r3			 # end of mem
 	larl  %r1,.Lchkmem               # set program check address
 	stg   %r1,__LC_PGM_NEW_PSW+8
 	la    %r1,1                      # test in increments of 128KB
@@ -494,51 +563,51 @@ startup:basr  %r13,0                     # get base
 	slgr  %r4,%r4                    # set start of chunk to zero
 	slgr  %r5,%r5                    # set end of chunk to zero
 	slr  %r6,%r6			 # set access code to zero
+	la    %r10,MEMORY_CHUNKS	 # number of chunks
 .Lloop:
 	tprot 0(%r5),0			 # test protection of first byte
 	ipm   %r7
 	srl   %r7,28
 	clr   %r6,%r7			 # compare cc with last access code
 	je    .Lsame
-	clgr  %r4,%r5			 # chunk size > 0?
-	je    .Lsize0
-	stg   %r4,0(%r3)		 # store start address of chunk
-	lgr   %r0,%r5
-	slgr  %r0,%r4
-	stg   %r0,8(%r3)		 # store size of chunk
-	st    %r6,20(%r3)		 # store type of chunk
-	la    %r3,24(%r3)
-	lgr   %r4,%r5			 # set start to end
-	larl  %r8,memory_size
-	stg   %r5,0(%r8)                 # store memory size
-.Lsize0:
-	lr    %r6,%r7			 # set access code to last cc
+	j     .Lchkmem
 .Lsame:
 	algr  %r5,%r1			 # add 128KB to end of chunk
-	brc   12,.Lloop
+					 # no need to check here,
+	brc   12,.Lloop			 # this is the same chunk
 .Lchkmem:				 # > 16EB or tprot got a program check
 	clgr  %r4,%r5			 # chunk size > 0?
-	je    .Ldonemem
+	je    .Lchkloop
 	stg   %r4,0(%r3)		 # store start address of chunk
 	lgr   %r0,%r5
 	slgr  %r0,%r4
 	stg   %r0,8(%r3)		 # store size of chunk
 	st    %r6,20(%r3)		 # store type of chunk
 	la    %r3,24(%r3)
-	lgr   %r4,%r5
 	larl  %r8,memory_size
 	stg   %r5,0(%r8)                 # store memory size
-#
-# Running native the HSA is located at 2GB and we will get an
-# addressing exception trying to access it. We have to restart
-# the scan at 2GB to find out if the machine has more than 2GB.
-#
+	ahi   %r10,-1			 # update chunk number
+.Lchkloop:
+	lr    %r6,%r7			 # set access code to last cc
+	# we got an exception or we're starting a new
+	# chunk , we must check if we should
+	# still try to find valid memory (if we detected
+	# the amount of available storage), and if we
+	# have chunks left
 	lghi  %r4,1
 	sllg  %r4,%r4,31
 	clgr  %r5,%r4
-	jhe   .Ldonemem
-	lgr   %r5,%r4
-	j     .Lloop
+	je    .Lhsaskip
+	xr    %r0, %r0
+	clgr  %r0, %r9			 # did we detect memory?
+	je    .Ldonemem			 # if not, leave
+	chi   %r10, 0			 # do we have chunks left?
+	je    .Ldonemem
+.Lhsaskip:
+	algr  %r5,%r1			 # add 128KB to end of chunk
+	lgr   %r4,%r5			 # potential new chunk
+	clgr  %r5,%r9			 # should we go on?
+	jl    .Lloop
 .Ldonemem:		
 
 	larl  %r12,machine_flags
@@ -640,6 +709,23 @@ _pstart:
     	.byte  "root=/dev/ram0 ro"
         .byte  0
 	.org   0x11000
+.Lsccb:
+	.hword 0x1000			# length, one page
+	.byte 0x00,0x00,0x00
+	.byte 0x80			# variable response bit set
+.Lsccbr:
+	.hword 0x00			# response code
+.Lscpincr1:
+	.hword 0x00
+.Lscpa1:
+	.byte 0x00
+	.fill 89,1,0
+.Lscpa2:
+	.int 0x00
+.Lscpincr2:
+	.quad 0x00
+	.fill 3984,1,0
+	.org 0x12000
 	.global _pend
 _pend:	
 
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index bae6e488b..a15f297dd 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -277,7 +277,8 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
 			*(unsigned int *) loc = val;
 		else if (r_type == R_390_GOTENT ||
 			 r_type == R_390_GOTPLTENT)
-			*(unsigned int *) loc = val >> 1;
+			*(unsigned int *) loc =
+				(val + (Elf_Addr) me->module_core - loc) >> 1;
 		else if (r_type == R_390_GOT64 ||
 			 r_type == R_390_GOTPLT64)
 			*(unsigned long *) loc = val;
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 252e652cd..63818a50e 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -16,6 +16,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -292,12 +293,12 @@ asmlinkage long sys_clone(struct pt_regs regs)
 {
         unsigned long clone_flags;
         unsigned long newsp;
-	int *parent_tidptr, *child_tidptr;
+	int __user *parent_tidptr, *child_tidptr;
 
         clone_flags = regs.gprs[3];
         newsp = regs.orig_gpr2;
-	parent_tidptr = (int *) regs.gprs[4];
-	child_tidptr = (int *) regs.gprs[5];
+	parent_tidptr = (int __user *) regs.gprs[4];
+	child_tidptr = (int __user *) regs.gprs[5];
         if (!newsp)
                 newsp = regs.gprs[15];
         return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0,
@@ -328,12 +329,12 @@ asmlinkage long sys_execve(struct pt_regs regs)
         int error;
         char * filename;
 
-        filename = getname((char *) regs.orig_gpr2);
+        filename = getname((char __user *) regs.orig_gpr2);
         error = PTR_ERR(filename);
         if (IS_ERR(filename))
                 goto out;
-        error = do_execve(filename, (char **) regs.gprs[3],
-			  (char **) regs.gprs[4], &regs);
+        error = do_execve(filename, (char __user * __user *) regs.gprs[3],
+			  (char __user * __user *) regs.gprs[4], &regs);
 	if (error == 0) {
 		current->ptrace &= ~PT_DTRACE;
 		current->thread.fp_regs.fpc = 0;
@@ -385,12 +386,6 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
 	dump->regs.per_info = current->thread.per_info;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long r14, r15, bc;
@@ -413,12 +408,10 @@ unsigned long get_wchan(struct task_struct *p)
 #else
 		r14 = *(unsigned long *) (bc+112);
 #endif
-		if (r14 < first_sched || r14 >= last_sched)
+		if (!in_sched_functions(r14))
 			return r14;
 		bc = (*(unsigned long *) bc) & PSW_ADDR_INSN;
 	} while (count++ < 16);
 	return 0;
 }
-#undef last_sched
-#undef first_sched
 
diff --git a/arch/s390/kernel/profile.c b/arch/s390/kernel/profile.c
index a6fad9c93..f219748d7 100644
--- a/arch/s390/kernel/profile.c
+++ b/arch/s390/kernel/profile.c
@@ -19,7 +19,8 @@ static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 	return len;
 }
 
-static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
+static int prof_cpu_mask_write_proc (struct file *file,
+					const char __user *buffer,
 					unsigned long count, void *data)
 {
 	cpumask_t *mask = (cpumask_t *)data;
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 1176b4f5b..a0ddc4f7d 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -141,7 +141,7 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
 		/*
 		 * psw and gprs are stored on the stack
 		 */
-		tmp = *(addr_t *)((addr_t) __KSTK_PTREGS(child) + addr);
+		tmp = *(addr_t *)((addr_t) &__KSTK_PTREGS(child)->psw + addr);
 		if (addr == (addr_t) &dummy->regs.psw.mask)
 			/* Remove per bit from user psw. */
 			tmp &= ~PSW_MASK_PER;
@@ -176,7 +176,7 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
 	} else
 		tmp = 0;
 
-	return put_user(tmp, (addr_t *) data);
+	return put_user(tmp, (addr_t __user *) data);
 }
 
 /*
@@ -215,7 +215,7 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
 			   high order bit but older gdb's rely on it */
 			data |= PSW_ADDR_AMODE;
 #endif
-		*(addr_t *)((addr_t) __KSTK_PTREGS(child) + addr) = data;
+		*(addr_t *)((addr_t) &__KSTK_PTREGS(child)->psw + addr) = data;
 
 	} else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
 		/*
@@ -269,7 +269,7 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data)
 		copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
 		if (copied != sizeof(tmp))
 			return -EIO;
-		return put_user(tmp, (unsigned long *) data);
+		return put_user(tmp, (unsigned long __user *) data);
 
 	case PTRACE_PEEKUSR:
 		/* read the word at location addr in the USER area. */
@@ -291,7 +291,8 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data)
 
 	case PTRACE_PEEKUSR_AREA:
 	case PTRACE_POKEUSR_AREA:
-		if (copy_from_user(&parea, (void *) addr, sizeof(parea)))
+		if (copy_from_user(&parea, (void __user *) addr,
+							sizeof(parea)))
 			return -EFAULT;
 		addr = parea.kernel_addr;
 		data = parea.process_addr;
@@ -301,7 +302,7 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data)
 				ret = peek_user(child, addr, data);
 			else {
 				addr_t tmp;
-				if (get_user (tmp, (addr_t *) data))
+				if (get_user (tmp, (addr_t __user *) data))
 					return -EFAULT;
 				ret = poke_user(child, addr, tmp);
 			}
@@ -360,7 +361,7 @@ peek_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
 				PSW32_ADDR_AMODE31;
 		} else {
 			/* gpr 0-15 */
-			tmp = *(__u32 *)((addr_t) __KSTK_PTREGS(child) + 
+			tmp = *(__u32 *)((addr_t) &__KSTK_PTREGS(child)->psw +
 					 addr*2 + 4);
 		}
 	} else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) {
@@ -402,7 +403,7 @@ peek_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
 	} else
 		tmp = 0;
 
-	return put_user(tmp, (__u32 *) data);
+	return put_user(tmp, (__u32 __user *) data);
 }
 
 /*
@@ -439,8 +440,8 @@ poke_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
 				(__u64) tmp & PSW32_ADDR_INSN;
 		} else {
 			/* gpr 0-15 */
-			*(__u32*)((addr_t) __KSTK_PTREGS(child) + addr*2 + 4) =
-				tmp;
+			*(__u32*)((addr_t) &__KSTK_PTREGS(child)->psw
+				  + addr*2 + 4) = tmp;
 		}
 	} else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) {
 		/*
@@ -509,7 +510,7 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
 		copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
 		if (copied != sizeof(tmp))
 			return -EIO;
-		return put_user(tmp, (unsigned int *) data);
+		return put_user(tmp, (unsigned int __user *) data);
 
 	case PTRACE_PEEKUSR:
 		/* read the word at location addr in the USER area. */
@@ -530,7 +531,8 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
 
 	case PTRACE_PEEKUSR_AREA:
 	case PTRACE_POKEUSR_AREA:
-		if (copy_from_user(&parea, (void *) addr, sizeof(parea)))
+		if (copy_from_user(&parea, (void __user *) addr,
+							sizeof(parea)))
 			return -EFAULT;
 		addr = parea.kernel_addr;
 		data = parea.process_addr;
@@ -540,7 +542,7 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
 				ret = peek_user_emu31(child, addr, data);
 			else {
 				__u32 tmp;
-				if (get_user (tmp, (__u32 *) data))
+				if (get_user (tmp, (__u32 __user *) data))
 					return -EFAULT;
 				ret = poke_user_emu31(child, addr, tmp);
 			}
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
index 832e7582a..5ba86ba1a 100644
--- a/arch/s390/kernel/s390_ksyms.c
+++ b/arch/s390/kernel/s390_ksyms.c
@@ -44,25 +44,6 @@ EXPORT_SYMBOL(__up);
 EXPORT_SYMBOL(__down);
 EXPORT_SYMBOL(__down_interruptible);
 
-/*
- * string functions
- */
-EXPORT_SYMBOL_NOVERS(memcmp);
-EXPORT_SYMBOL_NOVERS(memset);
-EXPORT_SYMBOL_NOVERS(memmove);
-EXPORT_SYMBOL_NOVERS(memscan);
-EXPORT_SYMBOL_NOVERS(strlen);
-EXPORT_SYMBOL_NOVERS(strchr);
-EXPORT_SYMBOL_NOVERS(strcmp);
-EXPORT_SYMBOL_NOVERS(strncat);
-EXPORT_SYMBOL_NOVERS(strncmp);
-EXPORT_SYMBOL_NOVERS(strncpy);
-EXPORT_SYMBOL_NOVERS(strnlen);
-EXPORT_SYMBOL_NOVERS(strrchr);
-EXPORT_SYMBOL_NOVERS(strstr);
-EXPORT_SYMBOL_NOVERS(strpbrk);
-EXPORT_SYMBOL_NOVERS(strcpy);
-
 /*
  * binfmt_elf loader 
  */
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 7ca8a8706..d549ad5c2 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -53,7 +53,9 @@ unsigned int console_device = -1;
 unsigned int console_irq = -1;
 unsigned long memory_size = 0;
 unsigned long machine_flags = 0;
-struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } };
+struct {
+	unsigned long addr, size, type;
+} memory_chunk[MEMORY_CHUNKS] = { { 0 } };
 #define CHUNK_READ_WRITE 0
 #define CHUNK_READ_ONLY 1
 int cpus_initialized = 0;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 2379b6734..d32b2c44b 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -77,8 +77,9 @@ sys_sigsuspend(struct pt_regs * regs, int history0, int history1,
 	}
 }
 
-asmlinkage int
-sys_rt_sigsuspend(struct pt_regs * regs,sigset_t *unewset, size_t sigsetsize)
+asmlinkage long
+sys_rt_sigsuspend(struct pt_regs *regs, sigset_t __user *unewset,
+						size_t sigsetsize)
 {
 	sigset_t saveset, newset;
 
@@ -105,9 +106,9 @@ sys_rt_sigsuspend(struct pt_regs * regs,sigset_t *unewset, size_t sigsetsize)
 	}
 }
 
-asmlinkage int 
-sys_sigaction(int sig, const struct old_sigaction *act,
-	      struct old_sigaction *oact)
+asmlinkage long
+sys_sigaction(int sig, const struct old_sigaction __user *act,
+	      struct old_sigaction __user *oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -137,8 +138,9 @@ sys_sigaction(int sig, const struct old_sigaction *act,
 	return ret;
 }
 
-asmlinkage int
-sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
+asmlinkage long
+sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
+					struct pt_regs *regs)
 {
 	return do_sigaltstack(uss, uoss, regs->gprs[15]);
 }
@@ -146,7 +148,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
 
 
 /* Returns non-zero on fault. */
-static int save_sigregs(struct pt_regs *regs, _sigregs *sregs)
+static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
 {
 	unsigned long old_mask = regs->psw.mask;
 	int err;
@@ -175,7 +177,7 @@ static int save_sigregs(struct pt_regs *regs, _sigregs *sregs)
 }
 
 /* Returns positive number on error */
-static int restore_sigregs(struct pt_regs *regs, _sigregs *sregs)
+static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
 {
 	unsigned long old_mask = regs->psw.mask;
 	int err;
@@ -208,7 +210,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs *sregs)
 
 asmlinkage long sys_sigreturn(struct pt_regs *regs)
 {
-	sigframe *frame = (sigframe *)regs->gprs[15];
+	sigframe __user *frame = (sigframe __user *)regs->gprs[15];
 	sigset_t set;
 
 	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
@@ -234,7 +236,7 @@ badframe:
 
 asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
 {
-	rt_sigframe *frame = (rt_sigframe *)regs->gprs[15];
+	rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
 	sigset_t set;
 
 	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
@@ -269,7 +271,7 @@ badframe:
 /*
  * Determine which stack to use..
  */
-static inline void *
+static inline void __user *
 get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 {
 	unsigned long sp;
@@ -290,7 +292,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 		sp = (unsigned long) ka->sa.sa_restorer;
 	}
 
-	return (void *)((sp - frame_size) & -8ul);
+	return (void __user *)((sp - frame_size) & -8ul);
 }
 
 static inline int map_signal(int sig)
@@ -306,7 +308,9 @@ static inline int map_signal(int sig)
 static void setup_frame(int sig, struct k_sigaction *ka,
 			sigset_t *set, struct pt_regs * regs)
 {
-	sigframe *frame = get_sigframe(ka, regs, sizeof(sigframe));
+	sigframe __user *frame;
+
+	frame = get_sigframe(ka, regs, sizeof(sigframe));
 	if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe)))
 		goto give_sigsegv;
 
@@ -326,13 +330,13 @@ static void setup_frame(int sig, struct k_sigaction *ka,
 	} else {
                 regs->gprs[14] = (unsigned long)
 			frame->retcode | PSW_ADDR_AMODE;
-		if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn, 
-	                       (u16 *)(frame->retcode)))
+		if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
+	                       (u16 __user *)(frame->retcode)))
 			goto give_sigsegv;
 	}
 
 	/* Set up backchain. */
-	if (__put_user(regs->gprs[15], (addr_t *) frame))
+	if (__put_user(regs->gprs[15], (addr_t __user *) frame))
 		goto give_sigsegv;
 
 	/* Set up registers for signal handler */
@@ -358,7 +362,9 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 			   sigset_t *set, struct pt_regs * regs)
 {
 	int err = 0;
-	rt_sigframe *frame = get_sigframe(ka, regs, sizeof(rt_sigframe));
+	rt_sigframe __user *frame;
+
+	frame = get_sigframe(ka, regs, sizeof(rt_sigframe));
 	if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe)))
 		goto give_sigsegv;
 
@@ -385,12 +391,12 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 	} else {
                 regs->gprs[14] = (unsigned long)
 			frame->retcode | PSW_ADDR_AMODE;
-		err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn, 
-	                          (u16 *)(frame->retcode));
+		err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
+	                          (u16 __user *)(frame->retcode));
 	}
 
 	/* Set up backchain. */
-	if (__put_user(regs->gprs[15], (addr_t *) frame))
+	if (__put_user(regs->gprs[15], (addr_t __user *) frame))
 		goto give_sigsegv;
 
 	/* Set up registers for signal handler */
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index de99f63ec..91746632e 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -31,6 +31,7 @@
 #include <linux/delay.h>
 #include <linux/cache.h>
 #include <linux/interrupt.h>
+#include <linux/cpu.h>
 
 #include <asm/sigp.h>
 #include <asm/pgalloc.h>
@@ -127,6 +128,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	if (cpus <= 0)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.started, 0);
@@ -648,6 +652,24 @@ int setup_profiling_timer(unsigned int multiplier)
         return 0;
 }
 
+static DEFINE_PER_CPU(struct cpu, cpu_devices);
+
+static int __init topology_init(void)
+{
+	int cpu;
+	int ret;
+
+	for_each_cpu(cpu) {
+		ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL);
+		if (ret)
+			printk(KERN_WARNING "topology_init: register_cpu %d "
+			       "failed (%d)\n", cpu, ret);
+	}
+	return 0;
+}
+
+subsys_initcall(topology_init);
+
 EXPORT_SYMBOL(cpu_possible_map);
 EXPORT_SYMBOL(lowcore_ptr);
 EXPORT_SYMBOL(smp_ctl_set_bit);
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index 6a7c59260..9ea8becb8 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -37,7 +37,7 @@
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-asmlinkage long sys_pipe(unsigned long * fildes)
+asmlinkage long sys_pipe(unsigned long __user *fildes)
 {
 	int fd[2];
 	int error;
@@ -92,7 +92,7 @@ struct mmap_arg_struct {
 	unsigned long offset;
 };
 
-asmlinkage long sys_mmap2(struct mmap_arg_struct *arg)
+asmlinkage long sys_mmap2(struct mmap_arg_struct __user  *arg)
 {
 	struct mmap_arg_struct a;
 	int error = -EFAULT;
@@ -104,7 +104,7 @@ out:
 	return error;
 }
 
-asmlinkage long old_mmap(struct mmap_arg_struct *arg)
+asmlinkage long old_mmap(struct mmap_arg_struct __user *arg)
 {
 	struct mmap_arg_struct a;
 	long error = -EFAULT;
@@ -128,7 +128,7 @@ struct sel_arg_struct {
 	struct timeval *tvp;
 };
 
-asmlinkage long old_select(struct sel_arg_struct *arg)
+asmlinkage long old_select(struct sel_arg_struct __user *arg)
 {
 	struct sel_arg_struct a;
 
@@ -138,38 +138,6 @@ asmlinkage long old_select(struct sel_arg_struct *arg)
 	return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
 
 }
-#else /* CONFIG_ARCH_S390X */
-unsigned long
-arch_get_unmapped_area(struct file *filp, unsigned long addr,
-		       unsigned long len, unsigned long pgoff,
-		       unsigned long flags)
-{
-	struct vm_area_struct *vma;
-	unsigned long end;
-
-	if (test_thread_flag(TIF_31BIT)) { 
-		if (!addr) 
-			addr = 0x40000000; 
-		end = 0x80000000;		
-	} else { 
-		if (!addr) 
-			addr = TASK_SIZE / 2;
-		end = TASK_SIZE; 
-	}
-
-	if (len > end)
-		return -ENOMEM;
-	addr = PAGE_ALIGN(addr);
-
-	for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
-		/* At this point:  (!vma || addr < vma->vm_end). */
-		if (end - len < addr)
-			return -ENOMEM;
-		if (!vma || addr + len <= vma->vm_start)
-			return addr;
-		addr = vma->vm_end;
-	}
-}
 #endif /* CONFIG_ARCH_S390X */
 
 /*
@@ -177,37 +145,37 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
  *
  * This is really horribly ugly.
  */
-asmlinkage long sys_ipc (uint call, int first, int second,
-				  unsigned long third, void *ptr)
+asmlinkage long sys_ipc(uint call, int first, int second,
+				  unsigned long third, void __user *ptr)
 {
         struct ipc_kludge tmp;
 	int ret;
 
         switch (call) {
         case SEMOP:
-		return sys_semtimedop (first, (struct sembuf *) ptr, second,
+		return sys_semtimedop (first, (struct sembuf __user *) ptr, second,
 				       NULL);
 	case SEMTIMEDOP:
-		return sys_semtimedop (first, (struct sembuf *) ptr, second,
-				       (const struct timespec *) third);
+		return sys_semtimedop (first, (struct sembuf __user *) ptr, second,
+				       (const struct timespec __user *) third);
         case SEMGET:
                 return sys_semget (first, second, third);
         case SEMCTL: {
                 union semun fourth;
                 if (!ptr)
                         return -EINVAL;
-                if (get_user(fourth.__pad, (void **) ptr))
+                if (get_user(fourth.__pad, (void __user * __user *) ptr))
                         return -EFAULT;
                 return sys_semctl (first, second, third, fourth);
-        } 
+        }
         case MSGSND:
-		return sys_msgsnd (first, (struct msgbuf *) ptr, 
+		return sys_msgsnd (first, (struct msgbuf __user *) ptr,
                                    second, third);
 		break;
         case MSGRCV:
                 if (!ptr)
                         return -EINVAL;
-                if (copy_from_user (&tmp, (struct ipc_kludge *) ptr,
+                if (copy_from_user (&tmp, (struct ipc_kludge __user *) ptr,
                                     sizeof (struct ipc_kludge)))
                         return -EFAULT;
                 return sys_msgrcv (first, tmp.msgp,
@@ -215,33 +183,33 @@ asmlinkage long sys_ipc (uint call, int first, int second,
         case MSGGET:
                 return sys_msgget ((key_t) first, second);
         case MSGCTL:
-                return sys_msgctl (first, second, (struct msqid_ds *) ptr);
-                
+                return sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
+
 	case SHMAT: {
 		ulong raddr;
-		ret = do_shmat (first, (char *) ptr, second, &raddr);
+		ret = do_shmat (first, (char __user *) ptr, second, &raddr);
 		if (ret)
 			return ret;
-		return put_user (raddr, (ulong *) third);
+		return put_user (raddr, (ulong __user *) third);
 		break;
         }
-	case SHMDT: 
-		return sys_shmdt ((char *)ptr);
+	case SHMDT:
+		return sys_shmdt ((char __user *)ptr);
 	case SHMGET:
 		return sys_shmget (first, second, third);
 	case SHMCTL:
 		return sys_shmctl (first, second,
-                                   (struct shmid_ds *) ptr);
+                                   (struct shmid_ds __user *) ptr);
 	default:
 		return -ENOSYS;
 
 	}
-        
+
 	return -EINVAL;
 }
 
 #ifdef CONFIG_ARCH_S390X
-asmlinkage long s390x_newuname(struct new_utsname * name)
+asmlinkage long s390x_newuname(struct new_utsname __user *name)
 {
 	int ret = sys_newuname(name);
 
@@ -288,7 +256,7 @@ struct fadvise64_64_args {
 };
 
 asmlinkage long
-s390_fadvise64_64(struct fadvise64_64_args *args)
+s390_fadvise64_64(struct fadvise64_64_args __user *args)
 {
 	struct fadvise64_64_args a;
 
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index da7ba3e3c..9186fe765 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -150,11 +150,11 @@ SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper)	/* old setfsuid1
 SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper)	/* old setfsgid16 syscall */
 SYSCALL(sys_llseek,sys_llseek,sys32_llseek_wrapper)		/* 140 */
 SYSCALL(sys_getdents,sys_getdents,sys32_getdents_wrapper)
-SYSCALL(sys_select,sys_select,sys32_select_wrapper)
+SYSCALL(sys_select,sys_select,compat_sys_select_wrapper)
 SYSCALL(sys_flock,sys_flock,sys32_flock_wrapper)
 SYSCALL(sys_msync,sys_msync,sys32_msync_wrapper)
-SYSCALL(sys_readv,sys_readv,sys32_readv_wrapper)		/* 145 */
-SYSCALL(sys_writev,sys_writev,sys32_writev_wrapper)
+SYSCALL(sys_readv,sys_readv,compat_sys_readv_wrapper)		/* 145 */
+SYSCALL(sys_writev,sys_writev,compat_sys_writev_wrapper)
 SYSCALL(sys_getsid,sys_getsid,sys32_getsid_wrapper)
 SYSCALL(sys_fdatasync,sys_fdatasync,sys32_fdatasync_wrapper)
 SYSCALL(sys_sysctl,sys_sysctl,sys32_sysctl_wrapper)
@@ -177,7 +177,7 @@ SYSCALL(sys_getresuid16,sys_ni_syscall,sys32_getresuid16_wrapper)	/* 165 old get
 NI_SYSCALL							/* for vm86 */
 NI_SYSCALL							/* old sys_query_module */
 SYSCALL(sys_poll,sys_poll,sys32_poll_wrapper)
-SYSCALL(sys_nfsservctl,sys_nfsservctl,sys32_nfsservctl_wrapper)
+SYSCALL(sys_nfsservctl,sys_nfsservctl,compat_sys_nfsservctl_wrapper)
 SYSCALL(sys_setresgid16,sys_ni_syscall,sys32_setresgid16_wrapper)	/* 170 old setresgid16 syscall */
 SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper)	/* old getresgid16 syscall */
 SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper)
@@ -195,7 +195,7 @@ SYSCALL(sys_getcwd,sys_getcwd,sys32_getcwd_wrapper)
 SYSCALL(sys_capget,sys_capget,sys32_capget_wrapper)
 SYSCALL(sys_capset,sys_capset,sys32_capset_wrapper)		/* 185 */
 SYSCALL(sys_sigaltstack_glue,sys_sigaltstack_glue,sys32_sigaltstack_glue)
-SYSCALL(sys_sendfile,sys_sendfile,sys32_sendfile_wrapper)
+SYSCALL(sys_sendfile,sys_sendfile64,sys32_sendfile_wrapper)
 NI_SYSCALL							/* streams1 */
 NI_SYSCALL							/* streams2 */
 SYSCALL(sys_vfork_glue,sys_vfork_glue,sys_vfork_glue)		/* 190 */
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 9b5b9f2ff..e687d0aa4 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -468,7 +468,7 @@ void start_hz_timer(struct pt_regs *regs)
 	__u64 tmp;
 	__u32 ticks;
 
-	if (!cpu_isset(smp_processor_id(), idle_cpu_mask))
+	if (!cpu_isset(smp_processor_id(), nohz_cpu_mask))
 		return;
 
 	/* Calculate how many ticks have passed */
@@ -511,7 +511,7 @@ void start_hz_timer(struct pt_regs *regs)
 			do_timer(regs);
 #endif
 	}
-	cpu_clear(smp_processor_id(), idle_cpu_mask);
+	cpu_clear(smp_processor_id(), nohz_cpu_mask);
 }
 
 /*
@@ -536,7 +536,7 @@ int stop_hz_timer(void)
 	 * This cpu is going really idle. Set up the clock comparator
 	 * for the next event.
 	 */
-	cpu_set(smp_processor_id(), idle_cpu_mask);
+	cpu_set(smp_processor_id(), nohz_cpu_mask);
 	timer = (__u64) (next_timer_interrupt() - jiffies) + jiffies_64;
 	timer = jiffies_timer_cc + timer * CLK_TICKS_PER_JIFFY;
 	asm volatile ("SCKC %0" : : "m" (timer));
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index b2e83876f..537700fbe 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -188,7 +188,7 @@ void show_registers(struct pt_regs *regs)
 	printk("%s Code: ", mode);
 	for (i = 0; i < 20; i++) {
 		unsigned char c;
-		if (__get_user(c, (char *)(regs->psw.addr + i))) {
+		if (__get_user(c, (char __user *)(regs->psw.addr + i))) {
 			printk(" Bad PSW.");
 			break;
 		}
@@ -391,7 +391,7 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
 		local_irq_enable();
 
 	if (regs->psw.mask & PSW_MASK_PSTATE)
-		get_user(*((__u16 *) opcode), location);
+		get_user(*((__u16 *) opcode), (__u16 __user *)location);
 	else
 		*((__u16 *)opcode)=*((__u16 *)location);
 	if (*((__u16 *)opcode)==S390_BREAKPOINT_U16)
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index 3cf8418ae..a8758b1d2 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -4,6 +4,6 @@
 
 EXTRA_AFLAGS := -traditional
 
-lib-y += delay.o 
-lib-$(CONFIG_ARCH_S390_31) += memset.o strcmp.o strcpy.o strncpy.o uaccess.o
-lib-$(CONFIG_ARCH_S390X) += memset64.o strcmp64.o strcpy64.o strncpy64.o uaccess64.o
+lib-y += delay.o string.o
+lib-$(CONFIG_ARCH_S390_31) += uaccess.o
+lib-$(CONFIG_ARCH_S390X) += uaccess64.o
diff --git a/arch/s390/lib/uaccess.S b/arch/s390/lib/uaccess.S
index ef26df4c9..e8029ef42 100644
--- a/arch/s390/lib/uaccess.S
+++ b/arch/s390/lib/uaccess.S
@@ -154,46 +154,57 @@ __clear_user_asm:
         .align 4
         .text
         .globl __strncpy_from_user_asm
-	# %r2 = dst, %r3 = src, %r4 = count
+	# %r2 = count, %r3 = dst, %r4 = src
 __strncpy_from_user_asm:
 	lhi	%r0,0
-	lhi	%r1,1
-	lhi	%r5,0
-0:	mvcp	0(%r1,%r2),0(%r3),%r0
-	tm	0(%r2),0xff
-	jz	1f
-	la	%r2,1(%r2)
-	la	%r3,1(%r3)
-	ahi	%r5,1
-	clr	%r5,%r4
-	jl	0b
-1:	lr	%r2,%r5
+	lr	%r1,%r4
+	la	%r4,0(%r4)	# clear high order bit from %r4
+	la	%r2,0(%r2,%r4)	# %r2 points to first byte after string
+	sacf	256
+0:	srst	%r2,%r1
+	jo	0b
+	sacf	0
+	lr	%r1,%r2
+	jh	1f		# \0 found in string ?
+	ahi	%r1,1		# include \0 in copy
+1:	slr	%r1,%r4		# %r1 = copy length (without \0)
+	slr	%r2,%r4		# %r2 = return length (including \0)
+2:	mvcp	0(%r1,%r3),0(%r4),%r0
+	jnz	3f
 	br	%r14
-2:	lhi	%r2,-EFAULT
+3:	la	%r3,256(%r3)
+	la	%r4,256(%r4)
+	ahi	%r1,-256
+	mvcp	0(%r1,%r3),0(%r4),%r0
+	jnz	3b
 	br	%r14
-        .section __ex_table,"a"
-	.long	0b,2b
+4:	sacf	0
+	lhi	%r2,-EFAULT
+	br	%r14
+	.section __ex_table,"a"
+	.long	0b,4b
 	.previous
 
         .align 4
         .text
         .globl __strnlen_user_asm
-	# %r2 = src, %r3 = count
+	# %r2 = count, %r3 = src
 __strnlen_user_asm:
 	lhi	%r0,0
-	lhi	%r1,1
-	lhi	%r5,0
-0:	mvcp	24(%r1,%r15),0(%r2),%r0
-	ahi	%r5,1
-	tm	24(%r15),0xff
-	jz	1f
-	la	%r2,1(%r2)
-	clr	%r5,%r3
-	jl	0b
-1:	lr	%r2,%r5
+	lr	%r1,%r3
+	la	%r3,0(%r3)	# clear high order bit from %r4
+	la	%r2,0(%r2,%r3)	# %r2 points to first byte after string
+	sacf	256
+0:	srst	%r2,%r1
+	jo	0b
+	sacf	0
+	jh	1f		# \0 found in string ?
+	ahi	%r2,1		# strnlen_user result includes the \0
+1:	slr	%r2,%r3
 	br	%r14
-2:	lhi	%r2,-EFAULT
+2:	sacf	0
+	lhi	%r2,-EFAULT
 	br	%r14
-        .section __ex_table,"a"
+	.section __ex_table,"a"
 	.long	0b,2b
 	.previous
diff --git a/arch/s390/lib/uaccess64.S b/arch/s390/lib/uaccess64.S
index c12f70a67..0ca56972f 100644
--- a/arch/s390/lib/uaccess64.S
+++ b/arch/s390/lib/uaccess64.S
@@ -152,46 +152,55 @@ __clear_user_asm:
         .align 4
         .text
         .globl __strncpy_from_user_asm
-	# %r2 = dst, %r3 = src, %r4 = count
+	# %r2 = count, %r3 = dst, %r4 = src
 __strncpy_from_user_asm:
 	lghi	%r0,0
-	lghi	%r1,1
-	lghi	%r5,0
-0:	mvcp	0(%r1,%r2),0(%r3),%r0
-	tm	0(%r2),0xff
-	jz	1f
-	la	%r2,1(%r2)
-	la	%r3,1(%r3)
-	aghi	%r5,1
-	clgr	%r5,%r4
-	jl	0b
-1:	lgr	%r2,%r5
+	lgr	%r1,%r4
+	la	%r2,0(%r2,%r4)	# %r2 points to first byte after string
+	sacf	256
+0:	srst	%r2,%r1
+	jo	0b
+	sacf	0
+	lgr	%r1,%r2
+	jh	1f		# \0 found in string ?
+	aghi	%r1,1		# include \0 in copy
+1:	slgr	%r1,%r4		# %r1 = copy length (without \0)
+	slgr	%r2,%r4		# %r2 = return length (including \0)
+2:	mvcp	0(%r1,%r3),0(%r4),%r0
+	jnz	3f
 	br	%r14
-2:	lghi	%r2,-EFAULT
+3:	la	%r3,256(%r3)
+	la	%r4,256(%r4)
+	aghi	%r1,-256
+	mvcp	0(%r1,%r3),0(%r4),%r0
+	jnz	3b
 	br	%r14
-        .section __ex_table,"a"
-	.quad	0b,2b
+4:	sacf	0
+	lghi	%r2,-EFAULT
+	br	%r14
+	.section __ex_table,"a"
+	.quad	0b,4b
 	.previous
 
         .align 4
         .text
         .globl __strnlen_user_asm
-	# %r2 = src, %r3 = count
+	# %r2 = count, %r3 = src
 __strnlen_user_asm:
 	lghi	%r0,0
-	lghi	%r1,1
-	lghi	%r5,0
-0:	mvcp	24(%r1,%r15),0(%r2),%r0
-	aghi	%r5,1
-	tm	24(%r15),0xff
-	jz	1f
-	la	%r2,1(%r2)
-	clgr	%r5,%r3
-	jl	0b
-1:	lgr	%r2,%r5
+	lgr	%r1,%r3
+	la	%r2,0(%r2,%r3)	# %r2 points to first byte after string
+	sacf	256
+0:	srst	%r2,%r1
+	jo	0b
+	sacf	0
+	jh	1f		# \0 found in string ?
+	aghi	%r2,1		# strnlen_user result includes the \0
+1:	slgr	%r2,%r3
 	br	%r14
-2:	lghi	%r2,-EFAULT
+2:	sacf	0
+	lghi	%r2,-EFAULT
 	br	%r14
-        .section __ex_table,"a"
+	.section __ex_table,"a"
 	.quad	0b,2b
 	.previous
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index ea3db122d..b0b2714ea 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -55,7 +55,9 @@ struct dcss_segment {
 
 static spinlock_t dcss_lock = SPIN_LOCK_UNLOCKED;
 static struct list_head dcss_list = LIST_HEAD_INIT(dcss_list);
-extern struct {unsigned long addr, size, type;} memory_chunk[16];
+extern struct {
+	unsigned long addr, size, type;
+} memory_chunk[MEMORY_CHUNKS];
 
 /*
  * Create the 8 bytes, ebcdic VM segment name from
@@ -258,16 +260,16 @@ int segment_load(char *name, int segtype, unsigned long *addr,
                    shared segment */
                 dcss_diag_query(dcss_name, &rwattr, &shattr, &segstart, &segend);
 		/* does segment collide with main memory? */
-		for (i=0; i<16; i++) {
-					if (memory_chunk[i].type != 0)
-						continue;
-					if (memory_chunk[i].addr > segend)
-						continue;
-					if (memory_chunk[i].addr + memory_chunk[i].size <= segstart)
-						continue;
-					spin_unlock(&dcss_lock);
-				        return -ENOENT;
-				}
+		for (i=0; i < MEMORY_CHUNKS; i++) {
+			if (memory_chunk[i].type != 0)
+				continue;
+			if (memory_chunk[i].addr > segend)
+				continue;
+			if (memory_chunk[i].addr + memory_chunk[i].size <= segstart)
+				continue;
+			spin_unlock(&dcss_lock);
+			return -ENOENT;
+		}
 		/* or does it collide with other (loaded) segments? */
         	list_for_each(l, &dcss_list) {
                 	tmp = list_entry(l, struct dcss_segment, list);
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index bc7062af1..177a3d26e 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -69,7 +69,7 @@ void show_mem(void)
                 else if (PageSwapCache(mem_map+i))
                         cached++;
                 else if (page_count(mem_map+i))
-                        shared += atomic_read(&mem_map[i].count) - 1;
+                        shared += page_count(mem_map+i) - 1;
         }
         printk("%d pages of RAM\n",total);
         printk("%d reserved pages\n",reserved);
diff --git a/arch/s390/mm/ioremap.c b/arch/s390/mm/ioremap.c
index b0e1ba5c4..c6c39d868 100644
--- a/arch/s390/mm/ioremap.c
+++ b/arch/s390/mm/ioremap.c
@@ -134,5 +134,5 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
 void iounmap(void *addr)
 {
 	if (addr > high_memory)
-		return vfree(addr);
+		vfree(addr);
 }
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
index 90203d8c5..60797b310 100644
--- a/arch/sh/boot/Makefile
+++ b/arch/sh/boot/Makefile
@@ -16,5 +16,5 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
 	@echo 'Kernel: $@ is ready'
 
 $(obj)/compressed/vmlinux: FORCE
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@
+	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 7d45ea0ac..6b4cb096b 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -461,12 +461,6 @@ out:
 	return error;
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long schedule_frame;
@@ -479,7 +473,7 @@ unsigned long get_wchan(struct task_struct *p)
 	 * The same comment as on the Alpha applies here, too ...
 	 */
 	pc = thread_saved_pc(p);
-	if (pc >= first_sched && pc < last_sched) {
+	if (in_sched_functions(pc)) {
 		schedule_frame = ((unsigned long *)(long)p->thread.sp)[1];
 		return (unsigned long)((unsigned long *)schedule_frame)[1];
 	}
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 97ed4345f..adb8eae9f 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -181,6 +181,9 @@ int smp_call_function(void (*func)(void *info), void *info, int retry, int wait)
 	if (nr_cpus < 2)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	spin_lock(&smp_fn_call.lock);
 
 	atomic_set(&smp_fn_call.finished, 0);
diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c
index 5309f67f6..4d5d687d1 100644
--- a/arch/sh/mm/hugetlbpage.c
+++ b/arch/sh/mm/hugetlbpage.c
@@ -248,8 +248,9 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 				goto out;
 			}
 			ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
-			unlock_page(page);
-			if (ret) {
+			if (! ret) {
+				unlock_page(page);
+			} else {
 				hugetlb_put_quota(mapping);
 				free_huge_page(page);
 				goto out;
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 9f9ef7ef2..15fcf89e1 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -13,6 +13,7 @@
 
 AS              := $(AS) -32
 LDFLAGS		:= -m elf32_sparc
+CHECK		:= $(CHECK) -D__sparc__=1
 
 #CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7
 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index f502d9b63..d01b6cc66 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -84,47 +84,44 @@ static int apc_release(struct inode *inode, struct file *f)
 }
 
 static int apc_ioctl(struct inode *inode, struct file *f, 
-		     unsigned int cmd, unsigned long arg)
+		     unsigned int cmd, unsigned long __arg)
 {
-	__u8 inarg;
+	__u8 inarg, __user *arg;
 
+	arg = (__u8 __user *) __arg;
 	switch (cmd) {
-		case APCIOCGFANCTL:
-			if(put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, (__u8*) arg)) {
+	case APCIOCGFANCTL:
+		if (put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, arg))
 				return -EFAULT;
-			}
-			break;
-		case APCIOCGCPWR:
-			if(put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, (__u8*) arg)) {
-				return -EFAULT;
-			}
-			break;
-		case APCIOCGBPORT:
-			if(put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, (__u8*) arg)) {
-				return -EFAULT;
-			}
-			break;
-
-		case APCIOCSFANCTL:
-			if(get_user(inarg, (__u8*) arg)) {
-				return -EFAULT;
-			}
-			apc_writeb(inarg & APC_REGMASK, APC_FANCTL_REG);
-			break;
-		case APCIOCSCPWR:
-			if(get_user(inarg, (__u8*) arg)) {
-				return -EFAULT;
-			}
-			apc_writeb(inarg & APC_REGMASK, APC_CPOWER_REG);
-			break;
-		case APCIOCSBPORT:
-			if(get_user(inarg, (__u8*) arg)) {
-				return -EFAULT;
-			}
-			apc_writeb(inarg & APC_BPMASK, APC_BPORT_REG);
-			break;
-		default:
-			return -EINVAL;
+		break;
+
+	case APCIOCGCPWR:
+		if (put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, arg))
+			return -EFAULT;
+		break;
+
+	case APCIOCGBPORT:
+		if (put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, arg))
+			return -EFAULT;
+		break;
+
+	case APCIOCSFANCTL:
+		if (get_user(inarg, arg))
+			return -EFAULT;
+		apc_writeb(inarg & APC_REGMASK, APC_FANCTL_REG);
+		break;
+	case APCIOCSCPWR:
+		if (get_user(inarg, arg))
+			return -EFAULT;
+		apc_writeb(inarg & APC_REGMASK, APC_CPOWER_REG);
+		break;
+	case APCIOCSBPORT:
+		if (get_user(inarg, arg))
+			return -EFAULT;
+		apc_writeb(inarg & APC_BPMASK, APC_BPORT_REG);
+		break;
+	default:
+		return -EINVAL;
 	};
 
 	return 0;
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c
index 9104114be..8ae7e5d3c 100644
--- a/arch/sparc/kernel/ebus.c
+++ b/arch/sparc/kernel/ebus.c
@@ -238,7 +238,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
 		child->bus = dev->bus;
 		fill_ebus_child(node, &regs[0], child);
 
-		while ((node = prom_getsibling(node))) {
+		while ((node = prom_getsibling(node)) != 0) {
 			child->next = (struct linux_ebus_child *)
 				ebus_alloc(sizeof(struct linux_ebus_child));
 
@@ -330,7 +330,7 @@ void __init ebus_init(void)
 		dev->bus = ebus;
 		fill_ebus_device(nd, dev);
 
-		while ((nd = prom_getsibling(nd))) {
+		while ((nd = prom_getsibling(nd)) != 0) {
 			dev->next = (struct linux_ebus_device *)
 				ebus_alloc(sizeof(struct linux_ebus_device));
 
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index 0b29e5fa1..76f53648c 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -22,6 +22,6 @@ EXPORT_SYMBOL(init_task);
  * in etrap.S which assumes it.
  */
 union thread_union init_thread_union
-	__attribute__((section (".text")))
+	__attribute__((section (".text,#alloc")))
 	__attribute__((aligned (THREAD_SIZE)))
 	= { INIT_THREAD_INFO(init_task) };
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 8df64381e..6b1698b5a 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -216,7 +216,8 @@ void free_irq(unsigned int irq, void *dev_id)
 	if (sparc_cpu_model == sun4d) {
 		extern void sun4d_free_irq(unsigned int, void *);
 		
-		return sun4d_free_irq(irq, dev_id);
+		sun4d_free_irq(irq, dev_id);
+		return;
 	}
 	cpu_irq = irq & (NR_IRQS - 1);
         if (cpu_irq > 14) {  /* 14 irq levels on the sparc */
diff --git a/arch/sparc/kernel/muldiv.c b/arch/sparc/kernel/muldiv.c
index b2cc64bb0..36a78a9f2 100644
--- a/arch/sparc/kernel/muldiv.c
+++ b/arch/sparc/kernel/muldiv.c
@@ -54,25 +54,25 @@ static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2,
 	}
 }
 
-#define fetch_reg(reg, regs) ({							\
-	struct reg_window *win;							\
-	register unsigned long ret;						\
-										\
-	if (!(reg)) ret = 0;							\
-	else if((reg) < 16) {							\
-		ret = regs->u_regs[(reg)];					\
-	} else {								\
-		/* Ho hum, the slightly complicated case. */			\
-		win = (struct reg_window *)regs->u_regs[UREG_FP];		\
-		if (get_user (ret, &win->locals[(reg) - 16])) return -1;	\
-	}									\
-	ret;									\
+#define fetch_reg(reg, regs) ({						\
+	struct reg_window __user *win;					\
+	register unsigned long ret;					\
+									\
+	if (!(reg)) ret = 0;						\
+	else if ((reg) < 16) {						\
+		ret = regs->u_regs[(reg)];				\
+	} else {							\
+		/* Ho hum, the slightly complicated case. */		\
+		win = (struct reg_window __user *)regs->u_regs[UREG_FP];\
+		if (get_user (ret, &win->locals[(reg) - 16])) return -1;\
+	}								\
+	ret;								\
 })
 
 static inline int
 store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs)
 {
-	struct reg_window *win;
+	struct reg_window __user *win;
 
 	if (!reg)
 		return 0;
@@ -81,7 +81,7 @@ store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs)
 		return 0;
 	} else {
 		/* need to use put_user() in this case: */
-		win = (struct reg_window *)regs->u_regs[UREG_FP];
+		win = (struct reg_window __user *) regs->u_regs[UREG_FP];
 		return (put_user(result, &win->locals[reg - 16]));
 	}
 }
@@ -89,23 +89,30 @@ store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs)
 extern void handle_hw_divzero (struct pt_regs *regs, unsigned long pc,
 			       unsigned long npc, unsigned long psr);
 
-/* Should return 0 if mul/div emulation succeeded and SIGILL should not be issued */
+/* Should return 0 if mul/div emulation succeeded and SIGILL should
+ * not be issued.
+ */
 int do_user_muldiv(struct pt_regs *regs, unsigned long pc)
 {
 	unsigned int insn;
 	int inst;
 	unsigned int rs1, rs2, rdv;
 
-	if (!pc) return -1; /* This happens to often, I think */
-	if (get_user (insn, (unsigned int *)pc)) return -1;
-	if ((insn & 0xc1400000) != 0x80400000) return -1;
+	if (!pc)
+		return -1; /* This happens to often, I think */
+	if (get_user (insn, (unsigned int __user *)pc))
+		return -1;
+	if ((insn & 0xc1400000) != 0x80400000)
+		return -1;
 	inst = ((insn >> 19) & 0xf);
-	if ((inst & 0xe) != 10 && (inst & 0xe) != 14) return -1;
+	if ((inst & 0xe) != 10 && (inst & 0xe) != 14)
+		return -1;
+
 	/* Now we know we have to do something with umul, smul, udiv or sdiv */
 	rs1 = (insn >> 14) & 0x1f;
 	rs2 = insn & 0x1f;
 	rdv = (insn >> 25) & 0x1f;
-	if(has_imm13(insn)) {
+	if (has_imm13(insn)) {
 		maybe_flush_windows(rs1, 0, rdv);
 		rs2 = sign_extend_imm13(insn);
 	} else {
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 13b3ac47b..277883d6c 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -400,23 +400,30 @@ void flush_thread(void)
 	}
 }
 
-static __inline__ struct sparc_stackf *
-clone_stackframe(struct sparc_stackf *dst, struct sparc_stackf *src)
+static __inline__ struct sparc_stackf __user *
+clone_stackframe(struct sparc_stackf __user *dst,
+		 struct sparc_stackf __user *src)
 {
-	unsigned long size;
-	struct sparc_stackf *sp;
+	unsigned long size, fp;
+	struct sparc_stackf *tmp;
+	struct sparc_stackf __user *sp;
+
+	if (get_user(tmp, &src->fp))
+		return NULL;
 
-	size = ((unsigned long)src->fp) - ((unsigned long)src);
-	sp = (struct sparc_stackf *)(((unsigned long)dst) - size); 
+	fp = (unsigned long) tmp;
+	size = (fp - ((unsigned long) src));
+	fp = (unsigned long) dst;
+	sp = (struct sparc_stackf __user *)(fp - size); 
 
 	/* do_fork() grabs the parent semaphore, we must release it
 	 * temporarily so we can build the child clone stack frame
 	 * without deadlocking.
 	 */
-	if (copy_to_user(sp, src, size))
-		sp = (struct sparc_stackf *) 0;
-	else if (put_user(dst, &sp->fp))
-		sp = (struct sparc_stackf *) 0;
+	if (__copy_user(sp, src, size))
+		sp = NULL;
+	else if (put_user(fp, &sp->fp))
+		sp = NULL;
 
 	return sp;
 }
@@ -435,8 +442,8 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
 
 	return do_fork(clone_flags, stack_start,
 		       regs, stack_size,
-		       (int *) parent_tid_ptr,
-		       (int *) child_tid_ptr);
+		       (int __user *) parent_tid_ptr,
+		       (int __user *) child_tid_ptr);
 }
 
 /* Copy a Sparc thread.  The fork() return value conventions
@@ -519,15 +526,17 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
 		p->thread.current_ds = USER_DS;
 
 		if (sp != regs->u_regs[UREG_FP]) {
-			struct sparc_stackf *childstack;
-			struct sparc_stackf *parentstack;
+			struct sparc_stackf __user *childstack;
+			struct sparc_stackf __user *parentstack;
 
 			/*
 			 * This is a clone() call with supplied user stack.
 			 * Set some valid stack frames to give to the child.
 			 */
-			childstack = (struct sparc_stackf *) (sp & ~0x7UL);
-			parentstack = (struct sparc_stackf *) regs->u_regs[UREG_FP];
+			childstack = (struct sparc_stackf __user *)
+				(sp & ~0x7UL);
+			parentstack = (struct sparc_stackf __user *)
+				regs->u_regs[UREG_FP];
 
 #if 0
 			printk("clone: parent stack:\n");
@@ -654,12 +663,14 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
 	if(regs->u_regs[UREG_G1] == 0)
 		base = 1;
 
-	filename = getname((char *)regs->u_regs[base + UREG_I0]);
+	filename = getname((char __user *)regs->u_regs[base + UREG_I0]);
 	error = PTR_ERR(filename);
 	if(IS_ERR(filename))
 		goto out;
-	error = do_execve(filename, (char **) regs->u_regs[base + UREG_I1],
-			  (char **) regs->u_regs[base + UREG_I2], regs);
+	error = do_execve(filename,
+			  (char __user * __user *)regs->u_regs[base + UREG_I1],
+			  (char __user * __user *)regs->u_regs[base + UREG_I2],
+			  regs);
 	putname(filename);
 	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
@@ -679,25 +690,25 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
 	long retval;
 
-	__asm__ __volatile("mov %4, %%g2\n\t"    /* Set aside fn ptr... */
-			   "mov %5, %%g3\n\t"    /* and arg. */
-			   "mov %1, %%g1\n\t"
-			   "mov %2, %%o0\n\t"    /* Clone flags. */
-			   "mov 0, %%o1\n\t"     /* usp arg == 0 */
-			   "t 0x10\n\t"          /* Linux/Sparc clone(). */
-			   "cmp %%o1, 0\n\t"
-			   "be 1f\n\t"           /* The parent, just return. */
-			   " nop\n\t"            /* Delay slot. */
-			   "jmpl %%g2, %%o7\n\t" /* Call the function. */
-			   " mov %%g3, %%o0\n\t" /* Get back the arg in delay. */
-			   "mov %3, %%g1\n\t"
-			   "t 0x10\n\t"          /* Linux/Sparc exit(). */
-			   /* Notreached by child. */
-			   "1: mov %%o0, %0\n\t" :
-			   "=r" (retval) :
-			   "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
-			   "i" (__NR_exit),  "r" (fn), "r" (arg) :
-			   "g1", "g2", "g3", "o0", "o1", "memory", "cc");
+	__asm__ __volatile__("mov %4, %%g2\n\t"    /* Set aside fn ptr... */
+			     "mov %5, %%g3\n\t"    /* and arg. */
+			     "mov %1, %%g1\n\t"
+			     "mov %2, %%o0\n\t"    /* Clone flags. */
+			     "mov 0, %%o1\n\t"     /* usp arg == 0 */
+			     "t 0x10\n\t"          /* Linux/Sparc clone(). */
+			     "cmp %%o1, 0\n\t"
+			     "be 1f\n\t"           /* The parent, just return. */
+			     " nop\n\t"            /* Delay slot. */
+			     "jmpl %%g2, %%o7\n\t" /* Call the function. */
+			     " mov %%g3, %%o0\n\t" /* Get back the arg in delay. */
+			     "mov %3, %%g1\n\t"
+			     "t 0x10\n\t"          /* Linux/Sparc exit(). */
+			     /* Notreached by child. */
+			     "1: mov %%o0, %0\n\t" :
+			     "=r" (retval) :
+			     "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
+			     "i" (__NR_exit),  "r" (fn), "r" (arg) :
+			     "g1", "g2", "g3", "o0", "o1", "memory", "cc");
 	return retval;
 }
 
@@ -721,8 +732,7 @@ unsigned long get_wchan(struct task_struct *task)
 			break;
 		rw = (struct reg_window *) fp;
 		pc = rw->ins[7];
-		if (pc < ((unsigned long) scheduling_functions_start_here) ||
-                    pc >= ((unsigned long) scheduling_functions_end_here)) {
+		if (!in_sched_functions(pc)) {
 			ret = pc;
 			goto out;
 		}
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c
index b1b6cdac7..d838bd8f6 100644
--- a/arch/sparc/kernel/ptrace.c
+++ b/arch/sparc/kernel/ptrace.c
@@ -50,8 +50,10 @@ static inline void pt_succ_return(struct pt_regs *regs, unsigned long value)
 static void
 pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
 {
-	if(put_user(value, addr))
-		return pt_error_return(regs, EFAULT);
+	if (put_user(value, (long __user *) addr)) {
+		pt_error_return(regs, EFAULT);
+		return;
+	}
 	regs->u_regs[UREG_I0] = 0;
 	regs->psr &= ~PSR_C;
 	regs->pc = regs->npc;
@@ -368,7 +370,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	}
 
 	case PTRACE_GETREGS: {
-		struct pt_regs *pregs = (struct pt_regs *) addr;
+		struct pt_regs __user *pregs = (struct pt_regs __user *) addr;
 		struct pt_regs *cregs = child->thread.kregs;
 		int rval;
 
@@ -391,7 +393,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	}
 
 	case PTRACE_SETREGS: {
-		struct pt_regs *pregs = (struct pt_regs *) addr;
+		struct pt_regs __user *pregs = (struct pt_regs __user *) addr;
 		struct pt_regs *cregs = child->thread.kregs;
 		unsigned long psr, pc, npc, y;
 		int i;
@@ -433,7 +435,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 				unsigned long *insnaddr;
 				unsigned long insn;
 			} fpq[16];
-		} *fps = (struct fps *) addr;
+		};
+		struct fps __user *fps = (struct fps __user *) addr;
 		int i;
 
 		i = verify_area(VERIFY_WRITE, fps, sizeof(struct fps));
@@ -467,7 +470,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 				unsigned long *insnaddr;
 				unsigned long insn;
 			} fpq[16];
-		} *fps = (struct fps *) addr;
+		};
+		struct fps __user *fps = (struct fps __user *) addr;
 		int i;
 
 		i = verify_area(VERIFY_READ, fps, sizeof(struct fps));
@@ -489,7 +493,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 
 	case PTRACE_READTEXT:
 	case PTRACE_READDATA: {
-		int res = ptrace_readdata(child, addr, (void *) addr2, data);
+		int res = ptrace_readdata(child, addr,
+					  (void __user *) addr2, data);
 
 		if (res == data) {
 			pt_succ_return(regs, 0);
@@ -504,7 +509,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 
 	case PTRACE_WRITETEXT:
 	case PTRACE_WRITEDATA: {
-		int res = ptrace_writedata(child, (void *) addr2, addr, data);
+		int res = ptrace_writedata(child, (void __user *) addr2,
+					   addr, data);
 
 		if (res == data) {
 			pt_succ_return(regs, 0);
diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
index 4bc6d4bc4..68847c143 100644
--- a/arch/sparc/kernel/signal.c
+++ b/arch/sparc/kernel/signal.c
@@ -234,7 +234,7 @@ static inline void do_new_sigreturn (struct pt_regs *regs)
 	if (verify_area(VERIFY_READ, sf, sizeof(*sf)))
 		goto segv_and_exit;
 
-	if (((uint) sf) & 3)
+	if (((unsigned long) sf) & 3)
 		goto segv_and_exit;
 
 	err = __get_user(pc,  &sf->info.si_regs.pc);
@@ -289,8 +289,10 @@ asmlinkage void do_sigreturn(struct pt_regs *regs)
 
 	synchronize_user_stack();
 
-	if (current->thread.new_signal)
-		return do_new_sigreturn(regs);
+	if (current->thread.new_signal) {
+		do_new_sigreturn(regs);
+		return;
+	}
 
 	scptr = (struct sigcontext __user *) regs->u_regs[UREG_I0];
 
@@ -347,6 +349,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
 	struct rt_signal_frame __user *sf;
 	unsigned int psr, pc, npc;
 	__siginfo_fpu_t __user *fpu_save;
+	mm_segment_t old_fs;
 	sigset_t set;
 	stack_t st;
 	int err;
@@ -386,7 +389,10 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
 	/* It is more difficult to avoid calling this function than to
 	 * call it and ignore errors.
 	 */
-	do_sigaltstack(&st, NULL, (unsigned long)sf);
+	old_fs = get_fs();
+	set_fs(KERNEL_DS);
+	do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf);
+	set_fs(old_fs);
 
 	sigdelsetmask(&set, ~_BLOCKABLE);
 	spin_lock_irq(&current->sighand->siglock);
@@ -849,7 +855,7 @@ setup_svr4_frame(struct sigaction *sa, unsigned long pc, unsigned long npc,
 
 	/* Arguments passed to signal handler */
 	if (regs->u_regs[14]){
-		struct reg_window *rw = (struct reg_window __user *)
+		struct reg_window __user *rw = (struct reg_window __user *)
 			regs->u_regs[14];
 
 		err |= __put_user(signr, &rw->ins[0]);
@@ -860,8 +866,8 @@ setup_svr4_frame(struct sigaction *sa, unsigned long pc, unsigned long npc,
 			goto sigsegv;
 
 		regs->u_regs[UREG_I0] = signr;
-		regs->u_regs[UREG_I1] = (uint) si;
-		regs->u_regs[UREG_I2] = (uint) uc;
+		regs->u_regs[UREG_I1] = (unsigned long) si;
+		regs->u_regs[UREG_I2] = (unsigned long) uc;
 	}
 	return;
 
@@ -932,6 +938,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
 {
 	svr4_gregset_t  __user *gr;
 	unsigned long pc, npc, psr;
+	mm_segment_t old_fs;
 	sigset_t set;
 	svr4_sigset_t setv;
 	int err;
@@ -945,7 +952,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
 	if (current_thread_info()->w_saved)
 		goto sigsegv_and_return;
 
-	if (((uint) c) & 3)
+	if (((unsigned long) c) & 3)
 		goto sigsegv_and_return;
 
 	if (!__access_ok((unsigned long)c, sizeof(*c)))
@@ -977,7 +984,11 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
 		
 	/* It is more difficult to avoid calling this function than to
 	   call it and ignore errors.  */
-	do_sigaltstack(&st, NULL, regs->u_regs[UREG_I6]);
+	old_fs = get_fs();
+	set_fs(KERNEL_DS);
+	do_sigaltstack((const stack_t __user *) &st, NULL,
+		       regs->u_regs[UREG_I6]);
+	set_fs(old_fs);
 	
 	set.sig[0] = setv.sigbits[0];
 	set.sig[1] = setv.sigbits[1];
diff --git a/arch/sparc/kernel/sunos_ioctl.c b/arch/sparc/kernel/sunos_ioctl.c
index 1afcff617..df1c0b31a 100644
--- a/arch/sparc/kernel/sunos_ioctl.c
+++ b/arch/sparc/kernel/sunos_ioctl.c
@@ -41,18 +41,19 @@ asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
 		goto out;
 
 	/* First handle an easy compat. case for tty ldisc. */
-	if(cmd == TIOCSETD) {
-		int *p, ntty = N_TTY, tmp;
+	if (cmd == TIOCSETD) {
+		int __user *p;
+		int ntty = N_TTY, tmp;
 		mm_segment_t oldfs;
 
-		p = (int *) arg;
+		p = (int __user *) arg;
 		ret = -EFAULT;
-		if(get_user(tmp, p))
+		if (get_user(tmp, p))
 			goto out;
-		if(tmp == 2) {
+		if (tmp == 2) {
 			oldfs = get_fs();
 			set_fs(KERNEL_DS);
-			ret = sys_ioctl(fd, cmd, (int) &ntty);
+			ret = sys_ioctl(fd, cmd, (unsigned long) &ntty);
 			set_fs(oldfs);
 			ret = (ret == -EINVAL ? -EOPNOTSUPP : ret);
 			goto out;
@@ -60,7 +61,7 @@ asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
 	}
 
 	/* Binary compatibility is good American knowhow fuckin' up. */
-	if(cmd == TIOCNOTTY) {
+	if (cmd == TIOCNOTTY) {
 		ret = sys_setsid();
 		goto out;
 	}
@@ -176,39 +177,39 @@ asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
 		goto out;
 	/* Non posix grp */
 	case _IOW('t', 118, int): {
-		int oldval, newval, *ptr;
+		int oldval, newval, __user *ptr;
 
 		cmd = TIOCSPGRP;
-		ptr = (int *) arg;
+		ptr = (int __user *) arg;
 		ret = -EFAULT;
-		if(get_user(oldval, ptr))
+		if (get_user(oldval, ptr))
 			goto out;
 		ret = sys_ioctl(fd, cmd, arg);
 		__get_user(newval, ptr);
-		if(newval == -1) {
+		if (newval == -1) {
 			__put_user(oldval, ptr);
 			ret = -EIO;
 		}
-		if(ret == -ENOTTY)
+		if (ret == -ENOTTY)
 			ret = -EIO;
 		goto out;
 	}
 
 	case _IOR('t', 119, int): {
-		int oldval, newval, *ptr;
+		int oldval, newval, __user *ptr;
 
 		cmd = TIOCGPGRP;
-		ptr = (int *) arg;
+		ptr = (int __user *) arg;
 		ret = -EFAULT;
-		if(get_user(oldval, ptr))
+		if (get_user(oldval, ptr))
 			goto out;
 		ret = sys_ioctl(fd, cmd, arg);
 		__get_user(newval, ptr);
-		if(newval == -1) {
+		if (newval == -1) {
 			__put_user(oldval, ptr);
 			ret = -EIO;
 		}
-		if(ret == -ENOTTY)
+		if (ret == -ENOTTY)
 			ret = -EIO;
 		goto out;
 	}
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 925efe992..1222d0192 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -136,7 +136,8 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user
 			if (!ptr)
 				goto out;
 			err = -EFAULT;
-			if(get_user(fourth.__pad, (void __user **)ptr))
+			if (get_user(fourth.__pad,
+				     (void __user * __user *)ptr))
 				goto out;
 			err = sys_semctl (first, second, third, fourth);
 			goto out;
@@ -165,7 +166,9 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user
 				goto out;
 				}
 			case 1: default:
-				err = sys_msgrcv (first, (struct msgbuf *) ptr, second, fifth, third);
+				err = sys_msgrcv (first,
+						  (struct msgbuf __user *) ptr,
+						  second, fifth, third);
 				goto out;
 			}
 		case MSGGET:
@@ -194,7 +197,8 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user
 				goto out;
 				}
 			case 1:	/* iBCS2 emulator entry point */
-				err = do_shmat (first, (char __user *) ptr, second, (ulong __user *) third);
+				err = do_shmat (first, (char __user *) ptr,
+						second, (ulong *) third);
 				goto out;
 			}
 		case SHMDT: 
diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c
index 4b0dfff58..6b2bccee7 100644
--- a/arch/sparc/kernel/sys_sunos.c
+++ b/arch/sparc/kernel/sys_sunos.c
@@ -71,7 +71,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
 	struct file * file = NULL;
 	unsigned long retval, ret_type;
 
-	if(flags & MAP_NORESERVE) {
+	if (flags & MAP_NORESERVE) {
 		static int cnt;
 		if (cnt++ < 10)
 			printk("%s: unimplemented SunOS MAP_NORESERVE mmap() flag\n",
@@ -79,7 +79,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
 		flags &= ~MAP_NORESERVE;
 	}
 	retval = -EBADF;
-	if(!(flags & MAP_ANONYMOUS)) {
+	if (!(flags & MAP_ANONYMOUS)) {
 		if (fd >= SUNOS_NR_OPEN)
 			goto out;
 		file = fget(fd);
@@ -93,8 +93,8 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
 	 * SunOS is so stupid some times... hmph!
 	 */
 	if (file) {
-		if(imajor(file->f_dentry->d_inode) == MEM_MAJOR &&
-		   iminor(file->f_dentry->d_inode) == 5) {
+		if (imajor(file->f_dentry->d_inode) == MEM_MAJOR &&
+		    iminor(file->f_dentry->d_inode) == 5) {
 			flags |= MAP_ANONYMOUS;
 			fput(file);
 			file = 0;
@@ -103,7 +103,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
 	ret_type = flags & _MAP_NEW;
 	flags &= ~_MAP_NEW;
 
-	if(!(flags & MAP_FIXED))
+	if (!(flags & MAP_FIXED))
 		addr = 0;
 	else {
 		if (ARCH_SUN4C_SUN4 &&
@@ -122,7 +122,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
 	down_write(&current->mm->mmap_sem);
 	retval = do_mmap(file, addr, len, prot, flags, off);
 	up_write(&current->mm->mmap_sem);
-	if(!ret_type)
+	if (!ret_type)
 		retval = ((retval < PAGE_OFFSET) ? 0 : retval);
 
 out_putf:
@@ -149,8 +149,8 @@ asmlinkage int sunos_brk(unsigned long brk)
 	unsigned long newbrk, oldbrk;
 
 	down_write(&current->mm->mmap_sem);
-	if(ARCH_SUN4C_SUN4) {
-		if(brk >= 0x20000000 && brk < 0xe0000000) {
+	if (ARCH_SUN4C_SUN4) {
+		if (brk >= 0x20000000 && brk < 0xe0000000) {
 			goto out;
 		}
 	}
@@ -223,7 +223,7 @@ asmlinkage unsigned long sunos_sbrk(int increment)
 	lock_kernel();
 	oldbrk = current->mm->brk;
 	error = sunos_brk(((int) current->mm->brk) + increment);
-	if(!error)
+	if (!error)
 		error = oldbrk;
 	unlock_kernel();
 	return error;
@@ -314,20 +314,20 @@ struct sunos_dirent {
 };
 
 struct sunos_dirent_callback {
-    struct sunos_dirent *curr;
-    struct sunos_dirent *previous;
+    struct sunos_dirent __user *curr;
+    struct sunos_dirent __user *previous;
     int count;
     int error;
 };
 
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
 
 static int sunos_filldir(void * __buf, const char * name, int namlen,
 			 loff_t offset, ino_t ino, unsigned int d_type)
 {
-	struct sunos_dirent * dirent;
-	struct sunos_dirent_callback * buf = (struct sunos_dirent_callback *) __buf;
+	struct sunos_dirent __user *dirent;
+	struct sunos_dirent_callback * buf = __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
 
 	buf->error = -EINVAL;	/* only used if we fail.. */
@@ -343,16 +343,16 @@ static int sunos_filldir(void * __buf, const char * name, int namlen,
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	dirent = (void *)dirent + reclen;
+	dirent = (void __user *) dirent + reclen;
 	buf->curr = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
-asmlinkage int sunos_getdents(unsigned int fd, void * dirent, int cnt)
+asmlinkage int sunos_getdents(unsigned int fd, void __user *dirent, int cnt)
 {
 	struct file * file;
-	struct sunos_dirent * lastdirent;
+	struct sunos_dirent __user *lastdirent;
 	struct sunos_dirent_callback buf;
 	int error = -EBADF;
 
@@ -367,7 +367,7 @@ asmlinkage int sunos_getdents(unsigned int fd, void * dirent, int cnt)
 	if (cnt < (sizeof(struct sunos_dirent) + 255))
 		goto out_putf;
 
-	buf.curr = (struct sunos_dirent *) dirent;
+	buf.curr = (struct sunos_dirent __user *) dirent;
 	buf.previous = NULL;
 	buf.count = cnt;
 	buf.error = 0;
@@ -398,8 +398,8 @@ struct sunos_direntry {
 };
 
 struct sunos_direntry_callback {
-    struct sunos_direntry *curr;
-    struct sunos_direntry *previous;
+    struct sunos_direntry __user *curr;
+    struct sunos_direntry __user *previous;
     int count;
     int error;
 };
@@ -407,8 +407,8 @@ struct sunos_direntry_callback {
 static int sunos_filldirentry(void * __buf, const char * name, int namlen,
 			      loff_t offset, ino_t ino, unsigned int d_type)
 {
-	struct sunos_direntry * dirent;
-	struct sunos_direntry_callback * buf = (struct sunos_direntry_callback *) __buf;
+	struct sunos_direntry __user *dirent;
+	struct sunos_direntry_callback *buf = __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
 
 	buf->error = -EINVAL;	/* only used if we fail.. */
@@ -422,16 +422,17 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen,
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	dirent = (void *)dirent + reclen;
+	dirent = (void __user *) dirent + reclen;
 	buf->curr = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
-asmlinkage int sunos_getdirentries(unsigned int fd, void * dirent, int cnt, unsigned int *basep)
+asmlinkage int sunos_getdirentries(unsigned int fd, void __user *dirent,
+				   int cnt, unsigned int __user *basep)
 {
 	struct file * file;
-	struct sunos_direntry * lastdirent;
+	struct sunos_direntry __user *lastdirent;
 	struct sunos_direntry_callback buf;
 	int error = -EBADF;
 
@@ -443,10 +444,10 @@ asmlinkage int sunos_getdirentries(unsigned int fd, void * dirent, int cnt, unsi
 		goto out;
 
 	error = -EINVAL;
-	if(cnt < (sizeof(struct sunos_direntry) + 255))
+	if (cnt < (sizeof(struct sunos_direntry) + 255))
 		goto out_putf;
 
-	buf.curr = (struct sunos_direntry *) dirent;
+	buf.curr = (struct sunos_direntry __user *) dirent;
 	buf.previous = NULL;
 	buf.count = cnt;
 	buf.error = 0;
@@ -477,7 +478,7 @@ struct sunos_utsname {
 	char mach[9];
 };
 
-asmlinkage int sunos_uname(struct sunos_utsname *name)
+asmlinkage int sunos_uname(struct sunos_utsname __user *name)
 {
 	int ret;
 	down_read(&uts_sem);
@@ -556,7 +557,7 @@ asmlinkage int sunos_fpathconf(int fd, int name)
 	return ret;
 }
 
-asmlinkage int sunos_pathconf(char *path, int name)
+asmlinkage int sunos_pathconf(char __user *path, int name)
 {
 	int ret;
 
@@ -566,7 +567,8 @@ asmlinkage int sunos_pathconf(char *path, int name)
 
 /* SunOS mount system call emulation */
 
-asmlinkage int sunos_select(int width, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
+asmlinkage int sunos_select(int width, fd_set __user *inp, fd_set __user *outp,
+			    fd_set __user *exp, struct timeval __user *tvp)
 {
 	int ret;
 
@@ -604,19 +606,19 @@ struct sunos_fh_t {
 };
 
 struct sunos_nfs_mount_args {
-	struct sockaddr_in  *addr; /* file server address */
-	struct nfs_fh *fh;     /* File handle to be mounted */
+	struct sockaddr_in  __user *addr; /* file server address */
+	struct nfs_fh __user *fh;     /* File handle to be mounted */
 	int        flags;      /* flags */
 	int        wsize;      /* write size in bytes */
 	int        rsize;      /* read size in bytes */
 	int        timeo;      /* initial timeout in .1 secs */
 	int        retrans;    /* times to retry send */
-	char       *hostname;  /* server's hostname */
+	char       __user *hostname;  /* server's hostname */
 	int        acregmin;   /* attr cache file min secs */
 	int        acregmax;   /* attr cache file max secs */
 	int        acdirmin;   /* attr cache dir min secs */
 	int        acdirmax;   /* attr cache dir max secs */
-	char       *netname;   /* server's netname */
+	char       __user *netname;   /* server's netname */
 };
 
 
@@ -680,7 +682,7 @@ static int get_default (int value, int def_value)
 	return def_value;
 }
 
-static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data)
+static int sunos_nfs_mount(char *dir_name, int linux_flags, void __user *data)
 {
 	int  server_fd, err;
 	char *the_name, *mount_page;
@@ -729,7 +731,7 @@ static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data)
 	linux_nfs_mount.acdirmax = sunos_mount.acdirmax;
 
 	the_name = getname(sunos_mount.hostname);
-	if(IS_ERR(the_name))
+	if (IS_ERR(the_name))
 		return PTR_ERR(the_name);
 
 	strlcpy(linux_nfs_mount.hostname, the_name,
@@ -749,7 +751,7 @@ static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data)
 }
 
 asmlinkage int
-sunos_mount(char *type, char *dir, int flags, void *data)
+sunos_mount(char __user *type, char __user *dir, int flags, void __user *data)
 {
 	int linux_flags = 0;
 	int ret = -EINVAL;
@@ -768,11 +770,11 @@ sunos_mount(char *type, char *dir, int flags, void *data)
 	if (flags & (SMNT_GRPID|SMNT_NOSUB|SMNT_MULTI|SMNT_SYS5))
 		goto out;
 
-	if(flags & SMNT_REMOUNT)
+	if (flags & SMNT_REMOUNT)
 		linux_flags |= MS_REMOUNT;
-	if(flags & SMNT_RDONLY)
+	if (flags & SMNT_RDONLY)
 		linux_flags |= MS_RDONLY;
-	if(flags & SMNT_NOSUID)
+	if (flags & SMNT_NOSUID)
 		linux_flags |= MS_NOSUID;
 
 	dir_page = getname(dir);
@@ -785,20 +787,20 @@ sunos_mount(char *type, char *dir, int flags, void *data)
 	if (IS_ERR(type_page))
 		goto out1;
 
-	if(strcmp(type_page, "ext2") == 0) {
+	if (strcmp(type_page, "ext2") == 0) {
 		dev_fname = getname(data);
-	} else if(strcmp(type_page, "iso9660") == 0) {
+	} else if (strcmp(type_page, "iso9660") == 0) {
 		dev_fname = getname(data);
-	} else if(strcmp(type_page, "minix") == 0) {
+	} else if (strcmp(type_page, "minix") == 0) {
 		dev_fname = getname(data);
-	} else if(strcmp(type_page, "nfs") == 0) {
+	} else if (strcmp(type_page, "nfs") == 0) {
 		ret = sunos_nfs_mount (dir_page, flags, data);
 		goto out2;
-        } else if(strcmp(type_page, "ufs") == 0) {
+        } else if (strcmp(type_page, "ufs") == 0) {
 		printk("Warning: UFS filesystem mounts unsupported.\n");
 		ret = -ENODEV;
 		goto out2;
-	} else if(strcmp(type_page, "proc")) {
+	} else if (strcmp(type_page, "proc")) {
 		ret = -ENODEV;
 		goto out2;
 	}
@@ -823,8 +825,8 @@ asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
 	int ret;
 
 	/* So stupid... */
-	if((!pid || pid == current->pid) &&
-	   !pgid) {
+	if ((!pid || pid == current->pid) &&
+	    !pgid) {
 		sys_setsid();
 		ret = 0;
 	} else {
@@ -834,7 +836,8 @@ asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
 }
 
 /* So stupid... */
-asmlinkage int sunos_wait4(pid_t pid, unsigned int *stat_addr, int options, struct rusage *ru)
+asmlinkage int sunos_wait4(pid_t pid, unsigned int __user *stat_addr,
+			   int options, struct rusage __user*ru)
 {
 	int ret;
 
@@ -861,7 +864,7 @@ asmlinkage int sunos_audit(void)
 	return -1;
 }
 
-extern asmlinkage unsigned long sunos_gethostid(void)
+asmlinkage unsigned long sunos_gethostid(void)
 {
 	unsigned long ret;
 
@@ -882,7 +885,7 @@ extern asmlinkage unsigned long sunos_gethostid(void)
 #define   _SC_SAVED_IDS           7
 #define   _SC_VERSION             8
 
-extern asmlinkage long sunos_sysconf (int name)
+asmlinkage long sunos_sysconf (int name)
 {
 	long ret;
 
@@ -947,7 +950,8 @@ asmlinkage int sunos_semsys(int op, unsigned long arg1, unsigned long arg2,
 			arg3=SETALL; break;
 		}
 		/* sys_semctl(): */
-		arg4.__pad=ptr; /* value to modify semaphore to */
+		/* value to modify semaphore to */
+		arg4.__pad = (void __user *) ptr;
 		ret = sys_semctl((int)arg1, (int)arg2, (int)arg3, arg4 );
 		break;
 	case 1:
@@ -956,7 +960,7 @@ asmlinkage int sunos_semsys(int op, unsigned long arg1, unsigned long arg2,
 		break;
 	case 2:
 		/* sys_semop(): */
-		ret = sys_semop((int)arg1, (struct sembuf *)arg2, (unsigned)arg3);
+		ret = sys_semop((int)arg1, (struct sembuf __user *)arg2, (unsigned)arg3);
 		break;
 	default:
 		ret = -EINVAL;
@@ -978,18 +982,18 @@ asmlinkage int sunos_msgsys(int op, unsigned long arg1, unsigned long arg2,
 		break;
 	case 1:
 		rval = sys_msgctl((int)arg1, (int)arg2,
-				  (struct msqid_ds *)arg3);
+				  (struct msqid_ds __user *)arg3);
 		break;
 	case 2:
 		lock_kernel();
 		sp = (struct sparc_stackf *)current->thread.kregs->u_regs[UREG_FP];
 		arg5 = sp->xxargs[0];
 		unlock_kernel();
-		rval = sys_msgrcv((int)arg1, (struct msgbuf *)arg2,
+		rval = sys_msgrcv((int)arg1, (struct msgbuf __user *)arg2,
 				  (size_t)arg3, (long)arg4, (int)arg5);
 		break;
 	case 3:
-		rval = sys_msgsnd((int)arg1, (struct msgbuf *)arg2,
+		rval = sys_msgsnd((int)arg1, (struct msgbuf __user *)arg2,
 				  (size_t)arg3, (int)arg4);
 		break;
 	default:
@@ -1008,17 +1012,17 @@ asmlinkage int sunos_shmsys(int op, unsigned long arg1, unsigned long arg2,
 	switch(op) {
 	case 0:
 		/* do_shmat(): attach a shared memory area */
-		rval = do_shmat((int)arg1,(char *)arg2,(int)arg3,&raddr);
-		if(!rval)
+		rval = do_shmat((int)arg1,(char __user *)arg2,(int)arg3,&raddr);
+		if (!rval)
 			rval = (int) raddr;
 		break;
 	case 1:
 		/* sys_shmctl(): modify shared memory area attr. */
-		rval = sys_shmctl((int)arg1,(int)arg2,(struct shmid_ds *)arg3);
+		rval = sys_shmctl((int)arg1,(int)arg2,(struct shmid_ds __user *)arg3);
 		break;
 	case 2:
 		/* sys_shmdt(): detach a shared memory area */
-		rval = sys_shmdt((char *)arg1);
+		rval = sys_shmdt((char __user *)arg1);
 		break;
 	case 3:
 		/* sys_shmget(): get a shared memory area */
@@ -1051,7 +1055,7 @@ static inline int check_nonblock(int ret, int fd)
 	return ret;
 }
 
-asmlinkage int sunos_read(unsigned int fd,char *buf,int count)
+asmlinkage int sunos_read(unsigned int fd, char __user *buf, int count)
 {
 	int ret;
 
@@ -1059,7 +1063,8 @@ asmlinkage int sunos_read(unsigned int fd,char *buf,int count)
 	return ret;
 }
 
-asmlinkage int sunos_readv(unsigned long fd, const struct iovec * vector, long count)
+asmlinkage int sunos_readv(unsigned long fd, const struct iovec __user *vector,
+			   long count)
 {
 	int ret;
 
@@ -1067,7 +1072,7 @@ asmlinkage int sunos_readv(unsigned long fd, const struct iovec * vector, long c
 	return ret;
 }
 
-asmlinkage int sunos_write(unsigned int fd,char *buf,int count)
+asmlinkage int sunos_write(unsigned int fd, char __user *buf, int count)
 {
 	int ret;
 
@@ -1075,7 +1080,8 @@ asmlinkage int sunos_write(unsigned int fd,char *buf,int count)
 	return ret;
 }
 
-asmlinkage int sunos_writev(unsigned long fd, const struct iovec * vector, long count)
+asmlinkage int sunos_writev(unsigned long fd,
+			    const struct iovec __user *vector, long count)
 {
 	int ret;
 
@@ -1083,7 +1089,7 @@ asmlinkage int sunos_writev(unsigned long fd, const struct iovec * vector, long
 	return ret;
 }
 
-asmlinkage int sunos_recv(int fd, void * ubuf, int size, unsigned flags)
+asmlinkage int sunos_recv(int fd, void __user *ubuf, int size, unsigned flags)
 {
 	int ret;
 
@@ -1091,7 +1097,7 @@ asmlinkage int sunos_recv(int fd, void * ubuf, int size, unsigned flags)
 	return ret;
 }
 
-asmlinkage int sunos_send(int fd, void * buff, int len, unsigned flags)
+asmlinkage int sunos_send(int fd, void __user *buff, int len, unsigned flags)
 {
 	int ret;
 
@@ -1099,7 +1105,8 @@ asmlinkage int sunos_send(int fd, void * buff, int len, unsigned flags)
 	return ret;
 }
 
-asmlinkage int sunos_accept(int fd, struct sockaddr *sa, int *addrlen)
+asmlinkage int sunos_accept(int fd, struct sockaddr __user *sa,
+			    int __user *addrlen)
 {
 	int ret;
 
@@ -1115,13 +1122,13 @@ asmlinkage int sunos_accept(int fd, struct sockaddr *sa, int *addrlen)
 #define SUNOS_SV_INTERRUPT 2
 
 asmlinkage int
-sunos_sigaction(int sig, const struct old_sigaction *act,
-		struct old_sigaction *oact)
+sunos_sigaction(int sig, const struct old_sigaction __user *act,
+		struct old_sigaction __user *oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
 
-	if(act) {
+	if (act) {
 		old_sigset_t mask;
 
 		if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
@@ -1156,8 +1163,8 @@ sunos_sigaction(int sig, const struct old_sigaction *act,
 }
 
 
-asmlinkage int sunos_setsockopt(int fd, int level, int optname, char *optval,
-				int optlen)
+asmlinkage int sunos_setsockopt(int fd, int level, int optname,
+				char __user *optval, int optlen)
 {
 	int tr_opt = optname;
 	int ret;
@@ -1171,8 +1178,8 @@ asmlinkage int sunos_setsockopt(int fd, int level, int optname, char *optval,
 	return ret;
 }
 
-asmlinkage int sunos_getsockopt(int fd, int level, int optname, char *optval,
-				int *optlen)
+asmlinkage int sunos_getsockopt(int fd, int level, int optname,
+				char __user *optval, int __user *optlen)
 {
 	int tr_opt = optname;
 	int ret;
diff --git a/arch/sparc/kernel/unaligned.c b/arch/sparc/kernel/unaligned.c
index 4e635aed1..a9a9e0c73 100644
--- a/arch/sparc/kernel/unaligned.c
+++ b/arch/sparc/kernel/unaligned.c
@@ -109,14 +109,14 @@ static inline unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
 
 static inline unsigned long safe_fetch_reg(unsigned int reg, struct pt_regs *regs)
 {
-	struct reg_window *win;
+	struct reg_window __user *win;
 	unsigned long ret;
 
-	if(reg < 16)
+	if (reg < 16)
 		return (!reg ? 0 : regs->u_regs[reg]);
 
 	/* Ho hum, the slightly complicated case. */
-	win = (struct reg_window *) regs->u_regs[UREG_FP];
+	win = (struct reg_window __user *) regs->u_regs[UREG_FP];
 
 	if ((unsigned long)win & 3)
 		return -1;
@@ -137,8 +137,8 @@ static inline unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *re
 	return &win->locals[reg - 16];
 }
 
-static inline unsigned long compute_effective_address(struct pt_regs *regs,
-						      unsigned int insn)
+static unsigned long compute_effective_address(struct pt_regs *regs,
+					       unsigned int insn)
 {
 	unsigned int rs1 = (insn >> 14) & 0x1f;
 	unsigned int rs2 = insn & 0x1f;
@@ -153,8 +153,8 @@ static inline unsigned long compute_effective_address(struct pt_regs *regs,
 	}
 }
 
-static inline unsigned long safe_compute_effective_address(struct pt_regs *regs,
-							   unsigned int insn)
+unsigned long safe_compute_effective_address(struct pt_regs *regs,
+					     unsigned int insn)
 {
 	unsigned int rs1 = (insn >> 14) & 0x1f;
 	unsigned int rs2 = insn & 0x1f;
@@ -431,29 +431,32 @@ static inline int ok_for_user(struct pt_regs *regs, unsigned int insn,
 	int retval, check = (dir == load) ? VERIFY_READ : VERIFY_WRITE;
 	int size = ((insn >> 19) & 3) == 3 ? 8 : 4;
 
-	if((regs->pc | regs->npc) & 3)
+	if ((regs->pc | regs->npc) & 3)
 		return 0;
 
 	/* Must verify_area() in all the necessary places. */
-#define WINREG_ADDR(regnum) ((void *)(((unsigned long *)regs->u_regs[UREG_FP])+(regnum)))
+#define WINREG_ADDR(regnum) \
+	((void __user *)(((unsigned long *)regs->u_regs[UREG_FP])+(regnum)))
+
 	retval = 0;
 	reg = (insn >> 25) & 0x1f;
-	if(reg >= 16) {
+	if (reg >= 16) {
 		retval = verify_area(check, WINREG_ADDR(reg - 16), size);
-		if(retval)
+		if (retval)
 			return retval;
 	}
 	reg = (insn >> 14) & 0x1f;
-	if(reg >= 16) {
+	if (reg >= 16) {
 		retval = verify_area(check, WINREG_ADDR(reg - 16), size);
-		if(retval)
+		if (retval)
 			return retval;
 	}
-	if(!(insn & 0x2000)) {
+	if (!(insn & 0x2000)) {
 		reg = (insn & 0x1f);
-		if(reg >= 16) {
-			retval = verify_area(check, WINREG_ADDR(reg - 16), size);
-			if(retval)
+		if (reg >= 16) {
+			retval = verify_area(check, WINREG_ADDR(reg - 16),
+					     size);
+			if (retval)
 				return retval;
 		}
 	}
diff --git a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c
index b4bd4958a..9cc93eaa4 100644
--- a/arch/sparc/kernel/windows.c
+++ b/arch/sparc/kernel/windows.c
@@ -69,8 +69,8 @@ void synchronize_user_stack(void)
 		unsigned long sp = tp->rwbuf_stkptrs[window];
 
 		/* Ok, let it rip. */
-		if(copy_to_user((char *) sp, &tp->reg_window[window],
-				sizeof(struct reg_window)))
+		if (copy_to_user((char __user *) sp, &tp->reg_window[window],
+				 sizeof(struct reg_window)))
 			continue;
 
 		shift_window_buffer(window, tp->w_saved - 1, tp);
@@ -117,8 +117,9 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who)
 	for(window = 0; window < tp->w_saved; window++) {
 		unsigned long sp = tp->rwbuf_stkptrs[window];
 
-		if((sp & 7) ||
-		   copy_to_user((char *) sp, &tp->reg_window[window], sizeof(struct reg_window)))
+		if ((sp & 7) ||
+		    copy_to_user((char __user *) sp, &tp->reg_window[window],
+				 sizeof(struct reg_window)))
 			do_exit(SIGILL);
 	}
 	tp->w_saved = 0;
diff --git a/arch/sparc/math-emu/math.c b/arch/sparc/math-emu/math.c
index deaacb893..be2c80932 100644
--- a/arch/sparc/math-emu/math.c
+++ b/arch/sparc/math-emu/math.c
@@ -175,7 +175,7 @@ int do_mathemu(struct pt_regs *regs, struct task_struct *fpt)
 #ifdef DEBUG_MATHEMU
 		printk("precise trap at %08lx\n", regs->pc);
 #endif
-		if (!get_user(insn, (u32 *)regs->pc)) {
+		if (!get_user(insn, (u32 __user *) regs->pc)) {
 			retcode = do_one_mathemu(insn, &fpt->thread.fsr, fpt->thread.float_regs);
 			if (retcode) {
 				/* in this case we need to fix up PC & nPC */
@@ -193,7 +193,7 @@ int do_mathemu(struct pt_regs *regs, struct task_struct *fpt)
 			break;
 	}
 	/* Now empty the queue and clear the queue_not_empty flag */
-	if(retcode)
+	if (retcode)
 		fpt->thread.fsr &= ~(0x3000 | FSR_CEXC_MASK);
 	else
 		fpt->thread.fsr &= ~0x3000;
@@ -219,18 +219,18 @@ static inline int record_exception(unsigned long *pfsr, int eflag)
 	would_trap = (fsr & ((long)eflag << FSR_TEM_SHIFT)) != 0UL;
 
 	/* If trapping, we only want to signal one bit. */
-	if(would_trap != 0) {
+	if (would_trap != 0) {
 		eflag &= ((fsr & FSR_TEM_MASK) >> FSR_TEM_SHIFT);
-		if((eflag & (eflag - 1)) != 0) {
-			if(eflag & FP_EX_INVALID)
+		if ((eflag & (eflag - 1)) != 0) {
+			if (eflag & FP_EX_INVALID)
 				eflag = FP_EX_INVALID;
-			else if(eflag & FP_EX_OVERFLOW)
+			else if (eflag & FP_EX_OVERFLOW)
 				eflag = FP_EX_OVERFLOW;
-			else if(eflag & FP_EX_UNDERFLOW)
+			else if (eflag & FP_EX_UNDERFLOW)
 				eflag = FP_EX_UNDERFLOW;
-			else if(eflag & FP_EX_DIVZERO)
+			else if (eflag & FP_EX_DIVZERO)
 				eflag = FP_EX_DIVZERO;
-			else if(eflag & FP_EX_INEXACT)
+			else if (eflag & FP_EX_INEXACT)
 				eflag = FP_EX_INEXACT;
 		}
 	}
@@ -250,11 +250,11 @@ static inline int record_exception(unsigned long *pfsr, int eflag)
 	 *    CEXC just generated is OR'd into the
 	 *    existing value of AEXC.
 	 */
-	if(would_trap == 0)
+	if (would_trap == 0)
 		fsr |= ((long)eflag << FSR_AEXC_SHIFT);
 
 	/* If trapping, indicate fault trap type IEEE. */
-	if(would_trap != 0)
+	if (would_trap != 0)
 		fsr |= (1UL << 14);
 
 	*pfsr = fsr;
@@ -515,7 +515,7 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
 		case 7: FP_PACK_QP (rd, QR); break;
 		}
 	}
-	if(_fex == 0)
+	if (_fex == 0)
 		return 1;				/* success! */
 	return record_exception(pfsr, _fex);
 }
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index ea2a40a46..cc857f681 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -201,6 +201,25 @@ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
 	return 0;
 }
 
+extern unsigned long safe_compute_effective_address(struct pt_regs *,
+						    unsigned int);
+
+static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
+{
+	unsigned int insn;
+
+	if (text_fault)
+		return regs->pc;
+
+	if (regs->psr & PSR_PS) {
+		insn = *(unsigned int *) regs->pc;
+	} else {
+		__get_user(insn, (unsigned int *) regs->pc);
+	}
+
+	return safe_compute_effective_address(regs, insn);
+}
+
 asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
 			       unsigned long address)
 {
@@ -307,7 +326,7 @@ bad_area_nosemaphore:
 		info.si_errno = 0;
 		/* info.si_code set above to make clear whether
 		   this was a SEGV_MAPERR or SEGV_ACCERR fault.  */
-		info.si_addr = (void *)address;
+		info.si_addr = (void *) compute_si_addr(regs, text_fault);
 		info.si_trapno = 0;
 		force_sig_info (SIGSEGV, &info, tsk);
 		return;
@@ -361,7 +380,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
+	info.si_addr = (void *) compute_si_addr(regs, text_fault);
 	info.si_trapno = 0;
 	force_sig_info (SIGBUS, &info, tsk);
 	if (!from_user)
@@ -412,10 +431,10 @@ asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write,
 		address = regs->pc;
 	} else if (!write &&
 		   !(regs->psr & PSR_PS)) {
-		unsigned int insn, *ip;
+		unsigned int insn, __user *ip;
 
-		ip = (unsigned int *)regs->pc;
-		if (! get_user(insn, ip)) {
+		ip = (unsigned int __user *)regs->pc;
+		if (!get_user(insn, ip)) {
 			if ((insn & 0xc1680000) == 0xc0680000)
 				write = 1;
 		}
@@ -530,7 +549,7 @@ bad_area:
 	info.si_errno = 0;
 	/* info.si_code set above to make clear whether
 	   this was a SEGV_MAPERR or SEGV_ACCERR fault.  */
-	info.si_addr = (void *)address;
+	info.si_addr = (void *) address;
 	info.si_trapno = 0;
 	force_sig_info (SIGSEGV, &info, tsk);
 	return;
@@ -540,7 +559,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
+	info.si_addr = (void *) address;
 	info.si_trapno = 0;
 	force_sig_info (SIGBUS, &info, tsk);
 }
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index 0bcb5c9d9..1d61ed413 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -388,7 +388,7 @@ void map_high_region(unsigned long start_pfn, unsigned long end_pfn)
 
 		ClearPageReserved(page);
 		set_bit(PG_highmem, &page->flags);
-		atomic_set(&page->count, 1);
+		set_page_count(page, 1);
 		__free_page(page);
 		totalhigh_pages++;
 	}
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 810a7ed25..45469d2f6 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -174,7 +174,7 @@ static inline int srmmu_pmd_present(pmd_t pmd)
 
 static inline void srmmu_pmd_clear(pmd_t *pmdp) {
 	int i;
-	for (i = 0; i < SRMMU_PTRS_PER_PTE_SOFT/SRMMU_PTRS_PER_PTE; i++)
+	for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++)
 		srmmu_set_pte((pte_t *)&pmdp->pmdv[i], __pte(0));
 }
 
@@ -234,9 +234,9 @@ static void srmmu_pmd_set(pmd_t *pmdp, pte_t *ptep)
 	int i;
 
 	ptp = __nocache_pa((unsigned long) ptep) >> 4;
-	for (i = 0; i < SRMMU_PTRS_PER_PTE_SOFT/SRMMU_PTRS_PER_PTE; i++) {
+	for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++) {
 		srmmu_set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp);
-		ptp += (SRMMU_PTRS_PER_PTE*sizeof(pte_t) >> 4);
+		ptp += (SRMMU_REAL_PTRS_PER_PTE*sizeof(pte_t) >> 4);
 	}
 }
 
@@ -246,9 +246,9 @@ static void srmmu_pmd_populate(pmd_t *pmdp, struct page *ptep)
 	int i;
 
 	ptp = page_to_pfn(ptep) << (PAGE_SHIFT-4);	/* watch for overflow */
-	for (i = 0; i < SRMMU_PTRS_PER_PTE_SOFT/SRMMU_PTRS_PER_PTE; i++) {
+	for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++) {
 		srmmu_set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp);
-		ptp += (SRMMU_PTRS_PER_PTE*sizeof(pte_t) >> 4);
+		ptp += (SRMMU_REAL_PTRS_PER_PTE*sizeof(pte_t) >> 4);
 	}
 }
 
@@ -263,7 +263,7 @@ extern inline pgd_t *srmmu_pgd_offset(struct mm_struct * mm, unsigned long addre
 static inline pmd_t *srmmu_pmd_offset(pgd_t * dir, unsigned long address)
 {
 	return (pmd_t *) srmmu_pgd_page(*dir) +
-	    ((address >> SRMMU_PMD_SHIFT_SOFT) & (SRMMU_PTRS_PER_PMD_SOFT - 1));
+	    ((address >> PMD_SHIFT) & (PTRS_PER_PMD - 1));
 }
 
 /* Find an entry in the third-level page table.. */ 
@@ -273,7 +273,7 @@ static inline pte_t *srmmu_pte_offset(pmd_t * dir, unsigned long address)
 
 	pte = __nocache_va((dir->pmdv[0] & SRMMU_PTD_PMASK) << 4);
 	return (pte_t *) pte +
-	    ((address >> PAGE_SHIFT) & (SRMMU_PTRS_PER_PTE_SOFT - 1));
+	    ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
 }
 
 static unsigned long srmmu_swp_type(swp_entry_t entry)
@@ -487,7 +487,7 @@ static void srmmu_pmd_free(pmd_t * pmd)
 static pte_t *
 srmmu_pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-	return (pte_t *)srmmu_get_nocache(SRMMU_PTE_SZ_SOFT, SRMMU_PTE_SZ_SOFT);
+	return (pte_t *)srmmu_get_nocache(PTE_SIZE, PTE_SIZE);
 }
 
 static struct page *
@@ -502,7 +502,7 @@ srmmu_pte_alloc_one(struct mm_struct *mm, unsigned long address)
 
 static void srmmu_free_pte_fast(pte_t *pte)
 {
-	srmmu_free_nocache((unsigned long)pte, SRMMU_PTE_SZ_SOFT);
+	srmmu_free_nocache((unsigned long)pte, PTE_SIZE);
 }
 
 static void srmmu_pte_free(struct page *pte)
@@ -514,7 +514,7 @@ static void srmmu_pte_free(struct page *pte)
 		BUG();
 	p = page_to_pfn(pte) << PAGE_SHIFT;	/* Physical address */
 	p = (unsigned long) __nocache_va(p);	/* Nocached virtual */
-	srmmu_free_nocache(p, SRMMU_PTE_SZ_SOFT);
+	srmmu_free_nocache(p, PTE_SIZE);
 }
 
 /*
@@ -829,7 +829,7 @@ static void cypress_flush_cache_range(struct vm_area_struct *vma, unsigned long
 	a = 0x20; b = 0x40; c = 0x60;
 	d = 0x80; e = 0xa0; f = 0xc0; g = 0xe0;
 
-	start &= SRMMU_PMD_MASK;
+	start &= SRMMU_REAL_PMD_MASK;
 	while(start < end) {
 		faddr = (start + (0x10000 - 0x100));
 		goto inside;
@@ -849,7 +849,7 @@ static void cypress_flush_cache_range(struct vm_area_struct *vma, unsigned long
 					     "r" (a), "r" (b), "r" (c), "r" (d),
 					     "r" (e), "r" (f), "r" (g));
 		} while (faddr != start);
-		start += SRMMU_PMD_SIZE;
+		start += SRMMU_REAL_PMD_SIZE;
 	}
 	srmmu_set_context(octx);
 	local_irq_restore(flags);
@@ -1067,16 +1067,15 @@ void __init srmmu_early_allocate_ptable_skeleton(unsigned long start, unsigned l
 		}
 		pmdp = srmmu_pmd_offset(__nocache_fix(pgdp), start);
 		if(srmmu_pmd_none(*(pmd_t *)__nocache_fix(pmdp))) {
-			ptep = (pte_t *)__srmmu_get_nocache(SRMMU_PTE_SZ_SOFT,
-			    SRMMU_PTE_SZ_SOFT);
+			ptep = (pte_t *)__srmmu_get_nocache(PTE_SIZE, PTE_SIZE);
 			if (ptep == NULL)
 				early_pgtable_allocfail("pte");
-			memset(__nocache_fix(ptep), 0, SRMMU_PTE_SZ_SOFT);
+			memset(__nocache_fix(ptep), 0, PTE_SIZE);
 			srmmu_pmd_set(__nocache_fix(pmdp), ptep);
 		}
-		if (start > (0xffffffffUL - SRMMU_PMD_SIZE_SOFT))
+		if (start > (0xffffffffUL - PMD_SIZE))
 			break;
-		start = (start + SRMMU_PMD_SIZE_SOFT) & SRMMU_PMD_MASK_SOFT;
+		start = (start + PMD_SIZE) & PMD_MASK;
 	}
 }
 
@@ -1097,16 +1096,16 @@ void __init srmmu_allocate_ptable_skeleton(unsigned long start, unsigned long en
 		}
 		pmdp = srmmu_pmd_offset(pgdp, start);
 		if(srmmu_pmd_none(*pmdp)) {
-			ptep = (pte_t *) __srmmu_get_nocache(SRMMU_PTE_SZ_SOFT,
-			    SRMMU_PTE_SZ_SOFT);
+			ptep = (pte_t *) __srmmu_get_nocache(PTE_SIZE,
+							     PTE_SIZE);
 			if (ptep == NULL)
 				early_pgtable_allocfail("pte");
-			memset(ptep, 0, SRMMU_PTE_SZ_SOFT);
+			memset(ptep, 0, PTE_SIZE);
 			srmmu_pmd_set(pmdp, ptep);
 		}
-		if (start > (0xffffffffUL - SRMMU_PMD_SIZE_SOFT))
+		if (start > (0xffffffffUL - PMD_SIZE))
 			break;
-		start = (start + SRMMU_PMD_SIZE_SOFT) & SRMMU_PMD_MASK_SOFT;
+		start = (start + PMD_SIZE) & PMD_MASK;
 	}
 }
 
@@ -1136,8 +1135,8 @@ void __init srmmu_inherit_prom_mappings(unsigned long start,unsigned long end)
 		/* A red snapper, see what it really is. */
 		what = 0;
     
-		if(!(start & ~(SRMMU_PMD_MASK))) {
-			if(srmmu_hwprobe((start-PAGE_SIZE) + SRMMU_PMD_SIZE) == prompte)
+		if(!(start & ~(SRMMU_REAL_PMD_MASK))) {
+			if(srmmu_hwprobe((start-PAGE_SIZE) + SRMMU_REAL_PMD_SIZE) == prompte)
 				what = 1;
 		}
     
@@ -1162,11 +1161,11 @@ void __init srmmu_inherit_prom_mappings(unsigned long start,unsigned long end)
 		}
 		pmdp = srmmu_pmd_offset(__nocache_fix(pgdp), start);
 		if(srmmu_pmd_none(*(pmd_t *)__nocache_fix(pmdp))) {
-			ptep = (pte_t *) __srmmu_get_nocache(SRMMU_PTE_SZ_SOFT,
-			    SRMMU_PTE_SZ_SOFT);
+			ptep = (pte_t *) __srmmu_get_nocache(PTE_SIZE,
+							     PTE_SIZE);
 			if (ptep == NULL)
 				early_pgtable_allocfail("pte");
-			memset(__nocache_fix(ptep), 0, SRMMU_PTE_SZ_SOFT);
+			memset(__nocache_fix(ptep), 0, PTE_SIZE);
 			srmmu_pmd_set(__nocache_fix(pmdp), ptep);
 		}
 		if(what == 1) {
@@ -1176,9 +1175,9 @@ void __init srmmu_inherit_prom_mappings(unsigned long start,unsigned long end)
 			 * good hardware PTE piece. Alternatives seem worse.
 			 */
 			unsigned int x;	/* Index of HW PMD in soft cluster */
-			x = (start >> SRMMU_PMD_SHIFT) & 15;
+			x = (start >> PMD_SHIFT) & 15;
 			*(unsigned long *)__nocache_fix(&pmdp->pmdv[x]) = prompte;
-			start += SRMMU_PMD_SIZE;
+			start += SRMMU_REAL_PMD_SIZE;
 			continue;
 		}
 		ptep = srmmu_pte_offset(__nocache_fix(pmdp), start);
@@ -2139,16 +2138,11 @@ void __init ld_mmu_srmmu(void)
 	extern void ld_mmu_iounit(void);
 	extern void ___xchg32_sun4md(void);
 
-	BTFIXUPSET_SIMM13(pmd_shift, SRMMU_PMD_SHIFT_SOFT);
-	BTFIXUPSET_SETHI(pmd_size, SRMMU_PMD_SIZE_SOFT);
-	BTFIXUPSET_SETHI(pmd_mask, SRMMU_PMD_MASK_SOFT);
-
 	BTFIXUPSET_SIMM13(pgdir_shift, SRMMU_PGDIR_SHIFT);
 	BTFIXUPSET_SETHI(pgdir_size, SRMMU_PGDIR_SIZE);
 	BTFIXUPSET_SETHI(pgdir_mask, SRMMU_PGDIR_MASK);
 
-	BTFIXUPSET_SIMM13(ptrs_per_pte, SRMMU_PTRS_PER_PTE_SOFT);
-	BTFIXUPSET_SIMM13(ptrs_per_pmd, SRMMU_PTRS_PER_PMD_SOFT);
+	BTFIXUPSET_SIMM13(ptrs_per_pmd, SRMMU_PTRS_PER_PMD);
 	BTFIXUPSET_SIMM13(ptrs_per_pgd, SRMMU_PTRS_PER_PGD);
 
 	BTFIXUPSET_INT(page_none, pgprot_val(SRMMU_PAGE_NONE));
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index 4b9fc1d67..f169a4838 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -2137,14 +2137,10 @@ void __init ld_mmu_sun4c(void)
 	printk("Loading sun4c MMU routines\n");
 
 	/* First the constants */
-	BTFIXUPSET_SIMM13(pmd_shift, SUN4C_PMD_SHIFT);
-	BTFIXUPSET_SETHI(pmd_size, SUN4C_PMD_SIZE);
-	BTFIXUPSET_SETHI(pmd_mask, SUN4C_PMD_MASK);
 	BTFIXUPSET_SIMM13(pgdir_shift, SUN4C_PGDIR_SHIFT);
 	BTFIXUPSET_SETHI(pgdir_size, SUN4C_PGDIR_SIZE);
 	BTFIXUPSET_SETHI(pgdir_mask, SUN4C_PGDIR_MASK);
 
-	BTFIXUPSET_SIMM13(ptrs_per_pte, SUN4C_PTRS_PER_PTE);
 	BTFIXUPSET_SIMM13(ptrs_per_pmd, SUN4C_PTRS_PER_PMD);
 	BTFIXUPSET_SIMM13(ptrs_per_pgd, SUN4C_PTRS_PER_PGD);
 	BTFIXUPSET_SIMM13(user_ptrs_per_pgd, KERNBASE / SUN4C_PGDIR_SIZE);
diff --git a/arch/sparc/prom/memory.c b/arch/sparc/prom/memory.c
index 5480edb9c..46aa51afe 100644
--- a/arch/sparc/prom/memory.c
+++ b/arch/sparc/prom/memory.c
@@ -156,7 +156,7 @@ void __init prom_meminit(void)
 			prom_prom_taken[iter].num_bytes =
 				(unsigned long) prom_reg_memlist[iter].reg_size;
 			prom_prom_taken[iter].theres_more =
-				&prom_phys_total[iter+1];
+				&prom_prom_taken[iter+1];
 		}
 		prom_prom_taken[iter-1].theres_more = 0x0;
 
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index ff9718e10..3b110a53f 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -130,7 +130,7 @@ config NR_CPUS
 	int "Maximum number of CPUs (2-64)"
 	range 2 64
 	depends on SMP
-	default "64"
+	default "32"
 
 config CPU_FREQ
 	bool "CPU Frequency scaling"
diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile
index d02592774..fc57c40c2 100644
--- a/arch/sparc64/Makefile
+++ b/arch/sparc64/Makefile
@@ -8,6 +8,8 @@
 # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
 #
 
+CHECK		:= $(CHECK) -D__sparc__=1 -D__sparc_v9__=1
+
 AFLAGS_vmlinux.lds.o += -Usparc
 
 CC		:= $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo $(CC); else echo sparc64-linux-gcc; fi )
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 7d108ee84..dfedd7e73 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -25,6 +25,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -119,6 +120,7 @@ CONFIG_FB=y
 CONFIG_FB_PM2=y
 # CONFIG_FB_PM2_FIFO_DISCONNECT is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_BW2 is not set
 # CONFIG_FB_CG3 is not set
@@ -231,7 +233,6 @@ CONFIG_BLK_DEV_IDE=y
 #
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDETAPE=m
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -277,6 +278,7 @@ CONFIG_BLK_DEV_SIIMAGE=m
 CONFIG_BLK_DEV_SLC90E66=m
 CONFIG_BLK_DEV_TRM290=m
 CONFIG_BLK_DEV_VIA82CXXX=m
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
@@ -302,7 +304,6 @@ CONFIG_CHR_DEV_SG=m
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_REPORT_LUNS=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -334,12 +335,12 @@ CONFIG_SCSI_SATA=y
 CONFIG_SCSI_SATA_SVW=m
 CONFIG_SCSI_ATA_PIIX=m
 CONFIG_SCSI_SATA_PROMISE=m
+CONFIG_SCSI_SATA_SX4=m
 CONFIG_SCSI_SATA_SIL=m
 CONFIG_SCSI_SATA_SIS=m
 CONFIG_SCSI_SATA_VIA=m
 CONFIG_SCSI_SATA_VITESSE=m
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 CONFIG_SCSI_DMX3191D=m
 # CONFIG_SCSI_EATA is not set
 CONFIG_SCSI_EATA_PIO=m
@@ -356,6 +357,9 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+CONFIG_SCSI_IPR=m
+# CONFIG_SCSI_IPR_TRACE is not set
+# CONFIG_SCSI_IPR_DUMP is not set
 CONFIG_SCSI_QLOGIC_ISP=m
 CONFIG_SCSI_QLOGIC_FC=y
 CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
@@ -1072,7 +1076,6 @@ CONFIG_MOUSE_VSXXXAA=m
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 CONFIG_INPUT_MISC=y
-# CONFIG_INPUT_PCSPKR is not set
 CONFIG_INPUT_SPARCSPKR=y
 # CONFIG_INPUT_UINPUT is not set
 
@@ -1128,6 +1131,7 @@ CONFIG_SENSORS_LM80=m
 CONFIG_SENSORS_LM83=m
 CONFIG_SENSORS_LM85=m
 CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_MAX1619=m
 CONFIG_SENSORS_VIA686A=m
 CONFIG_SENSORS_W83781D=m
 CONFIG_SENSORS_W83L785TS=m
@@ -1139,6 +1143,7 @@ CONFIG_SENSORS_W83627HF=m
 CONFIG_SENSORS_EEPROM=m
 CONFIG_SENSORS_PCF8574=m
 CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_RTC8564=m
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
@@ -1249,6 +1254,7 @@ CONFIG_RPCSEC_GSS_KRB5=m
 CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
 CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
 CONFIG_NCP_FS=m
 # CONFIG_NCPFS_PACKET_SIGNING is not set
 # CONFIG_NCPFS_IOCTL_LOCKING is not set
@@ -1260,7 +1266,6 @@ CONFIG_NCP_FS=m
 # CONFIG_NCPFS_EXTRAS is not set
 CONFIG_CODA_FS=m
 # CONFIG_CODA_FS_OLD_API is not set
-CONFIG_INTERMEZZO_FS=m
 CONFIG_AFS_FS=m
 CONFIG_RXRPC=m
 
@@ -1420,7 +1425,6 @@ CONFIG_SOUND=m
 # Advanced Linux Sound Architecture
 #
 CONFIG_SND=m
-CONFIG_SND_BIT32_EMUL=m
 CONFIG_SND_TIMER=m
 CONFIG_SND_PCM=m
 CONFIG_SND_HWDEP=m
@@ -1431,6 +1435,7 @@ CONFIG_SND_OSSEMUL=y
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_BIT32_EMUL=m
 # CONFIG_SND_RTCTIMER is not set
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
@@ -1560,6 +1565,7 @@ CONFIG_USB_WACOM=m
 CONFIG_USB_KBTAB=m
 # CONFIG_USB_POWERMATE is not set
 CONFIG_USB_MTOUCH=m
+CONFIG_USB_EGALAX=m
 # CONFIG_USB_XPAD is not set
 CONFIG_USB_ATI_REMOTE=m
 
@@ -1579,6 +1585,7 @@ CONFIG_USB_HPUSBSCSI=m
 # CONFIG_USB_IBMCAM is not set
 # CONFIG_USB_KONICAWC is not set
 # CONFIG_USB_OV511 is not set
+CONFIG_USB_PWC=m
 # CONFIG_USB_SE401 is not set
 # CONFIG_USB_STV680 is not set
 CONFIG_USB_W9968CF=m
@@ -1671,6 +1678,7 @@ CONFIG_USB_LCD=m
 CONFIG_USB_LED=m
 CONFIG_USB_CYTHERM=m
 CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_PHIDGETSERVO=m
 CONFIG_USB_TEST=m
 
 #
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 4ba5d4801..580a8c5d2 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -147,7 +147,6 @@ end_coredump:
  * memory and creates the pointer tables from them, and puts their
  * addresses on the "stack", returning the new stack pointer value.
  */
-#define A(__x) ((unsigned long)(__x))
 
 static u32 *create_aout32_tables(char * p, struct linux_binprm * bprm)
 {
@@ -171,7 +170,7 @@ static u32 *create_aout32_tables(char * p, struct linux_binprm * bprm)
 	current->mm->arg_start = (unsigned long) p;
 	while (argc-->0) {
 		char c;
-		put_user(((u32)A(p)),argv++);
+		put_user(((u32)(unsigned long)(p)),argv++);
 		do {
 			get_user(c,p++);
 		} while (c);
@@ -180,7 +179,7 @@ static u32 *create_aout32_tables(char * p, struct linux_binprm * bprm)
 	current->mm->arg_end = current->mm->env_start = (unsigned long) p;
 	while (envc-->0) {
 		char c;
-		put_user(((u32)A(p)),envp++);
+		put_user(((u32)(unsigned long)(p)),envp++);
 		do {
 			get_user(c,p++);
 		} while (c);
diff --git a/arch/sparc64/kernel/chmc.c b/arch/sparc64/kernel/chmc.c
index 6e39a101f..2296525af 100644
--- a/arch/sparc64/kernel/chmc.c
+++ b/arch/sparc64/kernel/chmc.c
@@ -243,8 +243,9 @@ int chmc_getunumber(int syndrome_code,
 static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset)
 {
 	unsigned long ret;
+	int this_cpu = get_cpu();
 
-	if (mp->portid == smp_processor_id()) {
+	if (mp->portid == this_cpu) {
 		__asm__ __volatile__("ldxa	[%1] %2, %0"
 				     : "=r" (ret)
 				     : "r" (offset), "i" (ASI_MCU_CTRL_REG));
@@ -254,6 +255,8 @@ static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset)
 				     : "r" (mp->regs + offset),
 				       "i" (ASI_PHYS_BYPASS_EC_E));
 	}
+	put_cpu();
+
 	return ret;
 }
 
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
index 130082796..044b85837 100644
--- a/arch/sparc64/kernel/ebus.c
+++ b/arch/sparc64/kernel/ebus.c
@@ -509,7 +509,7 @@ probe_interrupts:
 		fill_ebus_child(node, &regs[0],
 				child, child_regs_nonstandard(dev));
 
-		while ((node = prom_getsibling(node))) {
+		while ((node = prom_getsibling(node)) != 0) {
 			child->next = ebus_alloc(sizeof(struct linux_ebus_child));
 
 			child = child->next;
@@ -611,7 +611,7 @@ void __init ebus_init(void)
 		dev->bus = ebus;
 		fill_ebus_device(nd, dev);
 
-		while ((nd = prom_getsibling(nd))) {
+		while ((nd = prom_getsibling(nd)) != 0) {
 			dev->next = ebus_alloc(sizeof(struct linux_ebus_device));
 
 			dev = dev->next;
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index 6b6694a0e..f82adfbf7 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -1697,12 +1697,12 @@ linux_sparc_syscall32:
 	 add		%sp, PTREGS_OFF, %o0
 	srl		%i0, 0, %o0
 #endif
-	mov		%i4, %o4				! IEU1
+	srl		%i4, 0, %o4				! IEU1
 	lduw		[%l7 + %l4], %l7			! Load
 	srl		%i1, 0, %o1				! IEU0	Group
 	ldx		[%curptr + TI_FLAGS], %l0		! Load
 
-	mov		%i5, %o5				! IEU1
+	srl		%i5, 0, %o5				! IEU1
 	srl		%i2, 0, %o2				! IEU0	Group
 	andcc		%l0, _TIF_SYSCALL_TRACE, %g0		! IEU0	Group
 	bne,pn		%icc, linux_syscall_trace32		! CTI
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index dc03b247d..912e04cc6 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -60,11 +60,11 @@ static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 	u32 r, g, b;
 	mm_segment_t old_fs = get_fs();
 	
-	ret = get_user(f.index, &(((struct fbcmap32 *)arg)->index));
-	ret |= __get_user(f.count, &(((struct fbcmap32 *)arg)->count));
-	ret |= __get_user(r, &(((struct fbcmap32 *)arg)->red));
-	ret |= __get_user(g, &(((struct fbcmap32 *)arg)->green));
-	ret |= __get_user(b, &(((struct fbcmap32 *)arg)->blue));
+	ret = get_user(f.index, &(((struct fbcmap32 __user *)arg)->index));
+	ret |= __get_user(f.count, &(((struct fbcmap32 __user *)arg)->count));
+	ret |= __get_user(r, &(((struct fbcmap32 __user *)arg)->red));
+	ret |= __get_user(g, &(((struct fbcmap32 __user *)arg)->green));
+	ret |= __get_user(b, &(((struct fbcmap32 __user *)arg)->blue));
 	if (ret)
 		return -EFAULT;
 	if ((f.index < 0) || (f.index > 255)) return -EINVAL;
@@ -113,16 +113,21 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
 	u32 m, i;
 	mm_segment_t old_fs = get_fs();
 	
-	ret = copy_from_user (&f, (struct fbcursor32 *)arg, 2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
-	ret |= __get_user(f.size.x, &(((struct fbcursor32 *)arg)->size.x));
-	ret |= __get_user(f.size.y, &(((struct fbcursor32 *)arg)->size.y));
-	ret |= __get_user(f.cmap.index, &(((struct fbcursor32 *)arg)->cmap.index));
-	ret |= __get_user(f.cmap.count, &(((struct fbcursor32 *)arg)->cmap.count));
-	ret |= __get_user(r, &(((struct fbcursor32 *)arg)->cmap.red));
-	ret |= __get_user(g, &(((struct fbcursor32 *)arg)->cmap.green));
-	ret |= __get_user(b, &(((struct fbcursor32 *)arg)->cmap.blue));
-	ret |= __get_user(m, &(((struct fbcursor32 *)arg)->mask));
-	ret |= __get_user(i, &(((struct fbcursor32 *)arg)->image));
+	ret = copy_from_user (&f, (struct fbcursor32 __user *) arg,
+			      2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
+	ret |= __get_user(f.size.x,
+			  &(((struct fbcursor32 __user *)arg)->size.x));
+	ret |= __get_user(f.size.y,
+			  &(((struct fbcursor32 __user *)arg)->size.y));
+	ret |= __get_user(f.cmap.index,
+			  &(((struct fbcursor32 __user *)arg)->cmap.index));
+	ret |= __get_user(f.cmap.count,
+			  &(((struct fbcursor32 __user *)arg)->cmap.count));
+	ret |= __get_user(r, &(((struct fbcursor32 __user *)arg)->cmap.red));
+	ret |= __get_user(g, &(((struct fbcursor32 __user *)arg)->cmap.green));
+	ret |= __get_user(b, &(((struct fbcursor32 __user *)arg)->cmap.blue));
+	ret |= __get_user(m, &(((struct fbcursor32 __user *)arg)->mask));
+	ret |= __get_user(i, &(((struct fbcursor32 __user *)arg)->image));
 	if (ret)
 		return -EFAULT;
 	if (f.set & FB_CUR_SETCMAP) {
@@ -148,306 +153,6 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
 	return ret;
 }
 
-struct ncp_ioctl_request_32 {
-	unsigned int function;
-	unsigned int size;
-	compat_caddr_t data;
-};
-
-struct ncp_fs_info_v2_32 {
-	int version;
-	unsigned int mounted_uid;
-	unsigned int connection;
-	unsigned int buffer_size;
-
-	unsigned int volume_number;
-	__u32 directory_id;
-
-	__u32 dummy1;
-	__u32 dummy2;
-	__u32 dummy3;
-};
-
-struct ncp_objectname_ioctl_32
-{
-	int		auth_type;
-	unsigned int	object_name_len;
-	compat_caddr_t	object_name;	/* an userspace data, in most cases user name */
-};
-
-struct ncp_privatedata_ioctl_32
-{
-	unsigned int	len;
-	compat_caddr_t	data;		/* ~1000 for NDS */
-};
-
-#define	NCP_IOC_NCPREQUEST_32		_IOR('n', 1, struct ncp_ioctl_request_32)
-
-#define NCP_IOC_GETMOUNTUID2_32		_IOW('n', 2, unsigned int)
-
-#define NCP_IOC_GET_FS_INFO_V2_32	_IOWR('n', 4, struct ncp_fs_info_v2_32)
-
-#define NCP_IOC_GETOBJECTNAME_32	_IOWR('n', 9, struct ncp_objectname_ioctl_32)
-#define NCP_IOC_SETOBJECTNAME_32	_IOR('n', 9, struct ncp_objectname_ioctl_32)
-#define NCP_IOC_GETPRIVATEDATA_32	_IOWR('n', 10, struct ncp_privatedata_ioctl_32)
-#define NCP_IOC_SETPRIVATEDATA_32	_IOR('n', 10, struct ncp_privatedata_ioctl_32)
-
-static int do_ncp_ncprequest(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_ioctl_request_32 n32;
-	struct ncp_ioctl_request n;
-	mm_segment_t old_fs;
-	int err;
-
-	if (copy_from_user(&n32, (struct ncp_ioctl_request_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.function = n32.function;
-	n.size = n32.size;
-	if (n.size > 65536)
-		return -EINVAL;
-	n.data = vmalloc(65536);	/* 65536 must be same as NCP_PACKET_SIZE_INTERNAL in ncpfs */
-	if (!n.data)
-		return -ENOMEM;
-	err = -EFAULT;
-	if (copy_from_user(n.data, A(n32.data), n.size))
-		goto out;
-
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_NCPREQUEST, (unsigned long)&n);
-	set_fs (old_fs);
-        if(err <= 0)
-		goto out;
-	if (err > 65536) {
-		err = -EINVAL;
-		goto out;
-	}
-	if (copy_to_user(A(n32.data), n.data, err)) {
-		err = -EFAULT;
-		goto out;
-	}
- out:
-	vfree(n.data);
-	return err;
-}
-
-static int do_ncp_getmountuid2(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	mm_segment_t old_fs = get_fs();
-	__kernel_uid_t kuid;
-	int err;
-
-	cmd = NCP_IOC_GETMOUNTUID2;
-
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, cmd, (unsigned long)&kuid);
-	set_fs(old_fs);
-
-	if (!err)
-		err = put_user(kuid, (unsigned int*)arg);
-
-	return err;
-}
-
-static int do_ncp_getfsinfo2(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	mm_segment_t old_fs = get_fs();
-	struct ncp_fs_info_v2_32 n32;
-	struct ncp_fs_info_v2 n;
-	int err;
-
-	if (copy_from_user(&n32, (struct ncp_fs_info_v2_32*)arg, sizeof(n32)))
-		return -EFAULT;
-	if (n32.version != NCP_GET_FS_INFO_VERSION_V2)
-		return -EINVAL;
-	n.version = NCP_GET_FS_INFO_VERSION_V2;
-
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, NCP_IOC_GET_FS_INFO_V2, (unsigned long)&n);
-	set_fs(old_fs);
-
-	if (!err) {
-		n32.version = n.version;
-		n32.mounted_uid = n.mounted_uid;
-		n32.connection = n.connection;
-		n32.buffer_size = n.buffer_size;
-		n32.volume_number = n.volume_number;
-		n32.directory_id = n.directory_id;
-		n32.dummy1 = n.dummy1;
-		n32.dummy2 = n.dummy2;
-		n32.dummy3 = n.dummy3;
-		err = copy_to_user((struct ncp_fs_info_v2_32*)arg, &n32, sizeof(n32)) ? -EFAULT : 0;
-	}
-	return err;
-}
-
-static int do_ncp_getobjectname(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_objectname_ioctl_32 n32;
-	struct ncp_objectname_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_objectname_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.object_name_len = tl = n32.object_name_len;
-	if (tl) {
-		n.object_name = kmalloc(tl, GFP_KERNEL);
-		if (!n.object_name)
-			return -ENOMEM;
-	} else {
-		n.object_name = NULL;
-	}
-
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_GETOBJECTNAME, (unsigned long)&n);
-	set_fs (old_fs);
-        if(err)
-		goto out;
-		
-	if (tl > n.object_name_len)
-		tl = n.object_name_len;
-
-	err = -EFAULT;
-	if (tl && copy_to_user(A(n32.object_name), n.object_name, tl))
-		goto out;
-
-	n32.auth_type = n.auth_type;
-	n32.object_name_len = n.object_name_len;
-	
-	if (copy_to_user((struct ncp_objectname_ioctl_32*)arg, &n32, sizeof(n32)))
-		goto out;
-	
-	err = 0;
- out:
- 	if (n.object_name)
-		kfree(n.object_name);
-
-	return err;
-}
-
-static int do_ncp_setobjectname(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_objectname_ioctl_32 n32;
-	struct ncp_objectname_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_objectname_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.auth_type = n32.auth_type;
-	n.object_name_len = tl = n32.object_name_len;
-	if (tl) {
-		n.object_name = kmalloc(tl, GFP_KERNEL);
-		if (!n.object_name)
-			return -ENOMEM;
-		err = -EFAULT;
-		if (copy_from_user(n.object_name, A(n32.object_name), tl))
-			goto out;
-	} else {
-		n.object_name = NULL;
-	}
-	
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_SETOBJECTNAME, (unsigned long)&n);
-	set_fs (old_fs);
-		
- out:
-	if (n.object_name)
-		kfree(n.object_name);
-
-	return err;
-}
-
-static int do_ncp_getprivatedata(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_privatedata_ioctl_32 n32;
-	struct ncp_privatedata_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_privatedata_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.len = tl = n32.len;
-	if (tl) {
-		n.data = kmalloc(tl, GFP_KERNEL);
-		if (!n.data)
-			return -ENOMEM;
-	} else {
-		n.data = NULL;
-	}
-
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_GETPRIVATEDATA, (unsigned long)&n);
-	set_fs (old_fs);
-        if(err)
-		goto out;
-		
-	if (tl > n.len)
-		tl = n.len;
-
-	err = -EFAULT;
-	if (tl && copy_to_user(A(n32.data), n.data, tl))
-		goto out;
-
-	n32.len = n.len;
-	
-	if (copy_to_user((struct ncp_privatedata_ioctl_32*)arg, &n32, sizeof(n32)))
-		goto out;
-	
-	err = 0;
- out:
- 	if (n.data)
-		kfree(n.data);
-
-	return err;
-}
-
-static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct ncp_privatedata_ioctl_32 n32;
-	struct ncp_privatedata_ioctl n;
-	mm_segment_t old_fs;
-	int err;
-	size_t tl;
-
-	if (copy_from_user(&n32, (struct ncp_privatedata_ioctl_32*)arg,
-	    sizeof(n32)))
-		return -EFAULT;
-
-	n.len = tl = n32.len;
-	if (tl) {
-		n.data = kmalloc(tl, GFP_KERNEL);
-		if (!n.data)
-			return -ENOMEM;
-		err = -EFAULT;
-		if (copy_from_user(n.data, A(n32.data), tl))
-			goto out;
-	} else {
-		n.data = NULL;
-	}
-	
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, NCP_IOC_SETPRIVATEDATA, (unsigned long)&n);
-	set_fs (old_fs);
-		
- out:
-	if (n.data)
-		kfree(n.data);
-
-	return err;
-}
-
 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
 /* This really belongs in include/linux/drm.h -DaveM */
 #include "../../../drivers/char/drm/drm.h"
@@ -467,7 +172,7 @@ typedef struct drm32_version {
 
 static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_version_t *uversion = (drm32_version_t *)arg;
+	drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
 	char __user *name_ptr, *date_ptr, *desc_ptr;
 	u32 tmp1, tmp2, tmp3;
 	drm_version_t kversion;
@@ -545,7 +250,7 @@ typedef struct drm32_unique {
 
 static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_unique_t *uarg = (drm32_unique_t *)arg;
+	drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
 	drm_unique_t karg;
 	mm_segment_t old_fs;
 	char __user *uptr;
@@ -609,7 +314,7 @@ typedef struct drm32_map {
 
 static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_map_t *uarg = (drm32_map_t *) arg;
+	drm32_map_t __user *uarg = (drm32_map_t __user *) arg;
 	drm_map_t karg;
 	mm_segment_t old_fs;
 	u32 tmp;
@@ -624,7 +329,7 @@ static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 	if (ret)
 		return -EFAULT;
 
-	karg.handle = A(tmp);
+	karg.handle = (void *) (unsigned long) tmp;
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
@@ -654,7 +359,7 @@ typedef struct drm32_buf_info {
 
 static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_buf_info_t *uarg = (drm32_buf_info_t *)arg;
+	drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
 	drm_buf_desc_t __user *ulist;
 	drm_buf_info_t karg;
 	mm_segment_t old_fs;
@@ -700,7 +405,7 @@ typedef struct drm32_buf_free {
 
 static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_buf_free_t *uarg = (drm32_buf_free_t *)arg;
+	drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
 	drm_buf_free_t karg;
 	mm_segment_t old_fs;
 	int __user *ulist;
@@ -748,7 +453,7 @@ typedef struct drm32_buf_map {
 
 static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_buf_map_t *uarg = (drm32_buf_map_t *)arg;
+	drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
 	drm32_buf_pub_t __user *ulist;
 	drm_buf_map_t karg;
 	mm_segment_t old_fs;
@@ -760,7 +465,7 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 	    get_user(tmp2, &uarg->list))
 		return -EFAULT;
 
-	karg.virtual = A(tmp1);
+	karg.virtual = (void *) (unsigned long) tmp1;
 	ulist = A(tmp2);
 
 	orig_count = karg.count;
@@ -777,7 +482,7 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 		    get_user(tmp1, &ulist[i].address))
 			goto out;
 
-		karg.list[i].address = A(tmp1);
+		karg.list[i].address = (void *) (unsigned long) tmp1;
 	}
 
 	old_fs = get_fs();
@@ -827,7 +532,7 @@ typedef struct drm32_dma {
  */
 static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_dma_t *uarg = (drm32_dma_t *) arg;
+	drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
 	int __user *u_si, *u_ss, *u_ri, *u_rs;
 	drm_dma_t karg;
 	mm_segment_t old_fs;
@@ -937,7 +642,7 @@ typedef struct drm32_ctx_res {
 
 static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	drm32_ctx_res_t *uarg = (drm32_ctx_res_t *) arg;
+	drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
 	drm_ctx_t __user *ulist;
 	drm_ctx_res_t karg;
 	mm_segment_t old_fs;
@@ -1070,18 +775,6 @@ COMPATIBLE_IOCTL(AUDIO_GETDEV)
 COMPATIBLE_IOCTL(AUDIO_GETDEV_SUNOS)
 COMPATIBLE_IOCTL(AUDIO_FLUSH)
 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
-/* NCP ioctls which do not need any translations */
-COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN)
-COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT)
-COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED)
-COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED)
-COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK)
-COMPATIBLE_IOCTL(NCP_IOC_GETROOT)
-COMPATIBLE_IOCTL(NCP_IOC_SETROOT)
-COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS)
-COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
-COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
-COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
 COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
 COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
@@ -1107,14 +800,6 @@ COMPATIBLE_IOCTL(WIOCSTART)
 COMPATIBLE_IOCTL(WIOCSTOP)
 COMPATIBLE_IOCTL(WIOCGSTAT)
 /* And these ioctls need translation */
-/* NCPFS */
-HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest)
-HANDLE_IOCTL(NCP_IOC_GETMOUNTUID2_32, do_ncp_getmountuid2)
-HANDLE_IOCTL(NCP_IOC_GET_FS_INFO_V2_32, do_ncp_getfsinfo2)
-HANDLE_IOCTL(NCP_IOC_GETOBJECTNAME_32, do_ncp_getobjectname)
-HANDLE_IOCTL(NCP_IOC_SETOBJECTNAME_32, do_ncp_setobjectname)
-HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata)
-HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata)
 /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
 HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
 HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap)
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 48d96659a..b7f6a1eb9 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -174,6 +174,8 @@ void enable_irq(unsigned int irq)
 	if (imap == 0UL)
 		return;
 
+	preempt_disable();
+
 	if (tlb_type == cheetah || tlb_type == cheetah_plus) {
 		unsigned long ver;
 
@@ -214,6 +216,8 @@ void enable_irq(unsigned int irq)
 	 * Things like FFB can now be handled via the new IRQ mechanism.
 	 */
 	upa_writel(tid | IMAP_VALID, imap);
+
+	preempt_enable();
 }
 
 /* This now gets passed true ino's as well. */
@@ -1164,7 +1168,7 @@ static struct proc_dir_entry * irq_dir [NUM_IVECS];
 
 #define HEX_DIGITS 16
 
-static unsigned int parse_hex_value (const char *buffer,
+static unsigned int parse_hex_value (const char __user *buffer,
 		unsigned long count, unsigned long *ret)
 {
 	unsigned char hexnum [HEX_DIGITS];
@@ -1233,7 +1237,7 @@ static inline void set_intr_affinity(int irq, unsigned long hw_aff)
 	 */
 }
 
-static int irq_affinity_write_proc (struct file *file, const char *buffer,
+static int irq_affinity_write_proc (struct file *file, const char __user *buffer,
 					unsigned long count, void *data)
 {
 	int irq = (long) data, full_count = count, err;
diff --git a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c
index 539725c3d..a4ae2e3c4 100644
--- a/arch/sparc64/kernel/module.c
+++ b/arch/sparc64/kernel/module.c
@@ -31,7 +31,7 @@ static void module_unmap(void * addr)
 		return;
 	}
 
-	for (p = &modvmlist ; (tmp = *p) ; p = &tmp->next) {
+	for (p = &modvmlist; (tmp = *p) != NULL; p = &tmp->next) {
 		if (tmp->addr == addr) {
 			*p = tmp->next;
 			goto found;
@@ -66,7 +66,7 @@ static void *module_map(unsigned long size)
 		return NULL;
 		
 	addr = (void *) MODULES_VADDR;
-	for (p = &modvmlist; (tmp = *p) ; p = &tmp->next) {
+	for (p = &modvmlist; (tmp = *p) != NULL; p = &tmp->next) {
 		if (size + (unsigned long) addr < (unsigned long) tmp->addr)
 			break;
 		addr = (void *) (tmp->size + (unsigned long) tmp->addr);
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 4e6980688..31cc686de 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/sched.h>
@@ -799,6 +800,7 @@ int pci_domain_nr(struct pci_bus *pbus)
 
 	return ret;
 }
+EXPORT_SYMBOL(pci_domain_nr);
 
 int pci_name_bus(char *name, struct pci_bus *bus)
 {
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index 40030bc38..dc4d63084 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -42,29 +42,29 @@
 
 /* Misc. PSYCHO PCI controller register offsets and definitions. */
 #define PSYCHO_CONTROL		0x0010UL
-#define  PSYCHO_CONTROL_IMPL	 0xf000000000000000 /* Implementation of this PSYCHO*/
-#define  PSYCHO_CONTROL_VER	 0x0f00000000000000 /* Version of this PSYCHO       */
-#define  PSYCHO_CONTROL_MID	 0x00f8000000000000 /* UPA Module ID of PSYCHO      */
-#define  PSYCHO_CONTROL_IGN	 0x0007c00000000000 /* Interrupt Group Number       */
-#define  PSYCHO_CONTROL_RESV     0x00003ffffffffff0 /* Reserved                     */
-#define  PSYCHO_CONTROL_APCKEN	 0x0000000000000008 /* Address Parity Check Enable  */
-#define  PSYCHO_CONTROL_APERR	 0x0000000000000004 /* Incoming System Addr Parerr  */
-#define  PSYCHO_CONTROL_IAP	 0x0000000000000002 /* Invert UPA Parity            */
-#define  PSYCHO_CONTROL_MODE	 0x0000000000000001 /* PSYCHO clock mode            */
+#define  PSYCHO_CONTROL_IMPL	 0xf000000000000000UL /* Implementation of this PSYCHO*/
+#define  PSYCHO_CONTROL_VER	 0x0f00000000000000UL /* Version of this PSYCHO       */
+#define  PSYCHO_CONTROL_MID	 0x00f8000000000000UL /* UPA Module ID of PSYCHO      */
+#define  PSYCHO_CONTROL_IGN	 0x0007c00000000000UL /* Interrupt Group Number       */
+#define  PSYCHO_CONTROL_RESV     0x00003ffffffffff0UL /* Reserved                     */
+#define  PSYCHO_CONTROL_APCKEN	 0x0000000000000008UL /* Address Parity Check Enable  */
+#define  PSYCHO_CONTROL_APERR	 0x0000000000000004UL /* Incoming System Addr Parerr  */
+#define  PSYCHO_CONTROL_IAP	 0x0000000000000002UL /* Invert UPA Parity            */
+#define  PSYCHO_CONTROL_MODE	 0x0000000000000001UL /* PSYCHO clock mode            */
 #define PSYCHO_PCIA_CTRL	0x2000UL
 #define PSYCHO_PCIB_CTRL	0x4000UL
-#define  PSYCHO_PCICTRL_RESV1	 0xfffffff000000000 /* Reserved                     */
-#define  PSYCHO_PCICTRL_SBH_ERR	 0x0000000800000000 /* Streaming byte hole error    */
-#define  PSYCHO_PCICTRL_SERR	 0x0000000400000000 /* SERR signal asserted         */
-#define  PSYCHO_PCICTRL_SPEED	 0x0000000200000000 /* PCI speed (1 is U2P clock)   */
-#define  PSYCHO_PCICTRL_RESV2	 0x00000001ffc00000 /* Reserved                     */
-#define  PSYCHO_PCICTRL_ARB_PARK 0x0000000000200000 /* PCI arbitration parking      */
-#define  PSYCHO_PCICTRL_RESV3	 0x00000000001ff800 /* Reserved                     */
-#define  PSYCHO_PCICTRL_SBH_INT	 0x0000000000000400 /* Streaming byte hole int enab */
-#define  PSYCHO_PCICTRL_WEN	 0x0000000000000200 /* Power Mgmt Wake Enable       */
-#define  PSYCHO_PCICTRL_EEN	 0x0000000000000100 /* PCI Error Interrupt Enable   */
-#define  PSYCHO_PCICTRL_RESV4	 0x00000000000000c0 /* Reserved                     */
-#define  PSYCHO_PCICTRL_AEN	 0x000000000000003f /* PCI DVMA Arbitration Enable  */
+#define  PSYCHO_PCICTRL_RESV1	 0xfffffff000000000UL /* Reserved                     */
+#define  PSYCHO_PCICTRL_SBH_ERR	 0x0000000800000000UL /* Streaming byte hole error    */
+#define  PSYCHO_PCICTRL_SERR	 0x0000000400000000UL /* SERR signal asserted         */
+#define  PSYCHO_PCICTRL_SPEED	 0x0000000200000000UL /* PCI speed (1 is U2P clock)   */
+#define  PSYCHO_PCICTRL_RESV2	 0x00000001ffc00000UL /* Reserved                     */
+#define  PSYCHO_PCICTRL_ARB_PARK 0x0000000000200000UL /* PCI arbitration parking      */
+#define  PSYCHO_PCICTRL_RESV3	 0x00000000001ff800UL /* Reserved                     */
+#define  PSYCHO_PCICTRL_SBH_INT	 0x0000000000000400UL /* Streaming byte hole int enab */
+#define  PSYCHO_PCICTRL_WEN	 0x0000000000000200UL /* Power Mgmt Wake Enable       */
+#define  PSYCHO_PCICTRL_EEN	 0x0000000000000100UL /* PCI Error Interrupt Enable   */
+#define  PSYCHO_PCICTRL_RESV4	 0x00000000000000c0UL /* Reserved                     */
+#define  PSYCHO_PCICTRL_AEN	 0x000000000000003fUL /* PCI DVMA Arbitration Enable  */
 
 /* U2P Programmer's Manual, page 13-55, configuration space
  * address format:
@@ -403,11 +403,11 @@ enum psycho_error_type {
  */
 #define PSYCHO_STRBUF_CONTROL_A 0x2800UL
 #define PSYCHO_STRBUF_CONTROL_B 0x4800UL
-#define  PSYCHO_STRBUF_CTRL_LPTR    0x00000000000000f0 /* LRU Lock Pointer */
-#define  PSYCHO_STRBUF_CTRL_LENAB   0x0000000000000008 /* LRU Lock Enable */
-#define  PSYCHO_STRBUF_CTRL_RRDIS   0x0000000000000004 /* Rerun Disable */
-#define  PSYCHO_STRBUF_CTRL_DENAB   0x0000000000000002 /* Diagnostic Mode Enable */
-#define  PSYCHO_STRBUF_CTRL_ENAB    0x0000000000000001 /* Streaming Buffer Enable */
+#define  PSYCHO_STRBUF_CTRL_LPTR    0x00000000000000f0UL /* LRU Lock Pointer */
+#define  PSYCHO_STRBUF_CTRL_LENAB   0x0000000000000008UL /* LRU Lock Enable */
+#define  PSYCHO_STRBUF_CTRL_RRDIS   0x0000000000000004UL /* Rerun Disable */
+#define  PSYCHO_STRBUF_CTRL_DENAB   0x0000000000000002UL /* Diagnostic Mode Enable */
+#define  PSYCHO_STRBUF_CTRL_ENAB    0x0000000000000001UL /* Streaming Buffer Enable */
 #define PSYCHO_STRBUF_FLUSH_A   0x2808UL
 #define PSYCHO_STRBUF_FLUSH_B   0x4808UL
 #define PSYCHO_STRBUF_FSYNC_A   0x2810UL
@@ -416,22 +416,22 @@ enum psycho_error_type {
 #define PSYCHO_STC_DATA_B	0xc000UL
 #define PSYCHO_STC_ERR_A	0xb400UL
 #define PSYCHO_STC_ERR_B	0xc400UL
-#define  PSYCHO_STCERR_WRITE	 0x0000000000000002	/* Write Error */
-#define  PSYCHO_STCERR_READ	 0x0000000000000001	/* Read Error */
+#define  PSYCHO_STCERR_WRITE	 0x0000000000000002UL	/* Write Error */
+#define  PSYCHO_STCERR_READ	 0x0000000000000001UL	/* Read Error */
 #define PSYCHO_STC_TAG_A	0xb800UL
 #define PSYCHO_STC_TAG_B	0xc800UL
-#define  PSYCHO_STCTAG_PPN	 0x0fffffff00000000	/* Physical Page Number */
-#define  PSYCHO_STCTAG_VPN	 0x00000000ffffe000	/* Virtual Page Number */
-#define  PSYCHO_STCTAG_VALID	 0x0000000000000002	/* Valid */
-#define  PSYCHO_STCTAG_WRITE	 0x0000000000000001	/* Writable */
+#define  PSYCHO_STCTAG_PPN	 0x0fffffff00000000UL	/* Physical Page Number */
+#define  PSYCHO_STCTAG_VPN	 0x00000000ffffe000UL	/* Virtual Page Number */
+#define  PSYCHO_STCTAG_VALID	 0x0000000000000002UL	/* Valid */
+#define  PSYCHO_STCTAG_WRITE	 0x0000000000000001UL	/* Writable */
 #define PSYCHO_STC_LINE_A	0xb900UL
 #define PSYCHO_STC_LINE_B	0xc900UL
-#define  PSYCHO_STCLINE_LINDX	 0x0000000001e00000	/* LRU Index */
-#define  PSYCHO_STCLINE_SPTR	 0x00000000001f8000	/* Dirty Data Start Pointer */
-#define  PSYCHO_STCLINE_LADDR	 0x0000000000007f00	/* Line Address */
-#define  PSYCHO_STCLINE_EPTR	 0x00000000000000fc	/* Dirty Data End Pointer */
-#define  PSYCHO_STCLINE_VALID	 0x0000000000000002	/* Valid */
-#define  PSYCHO_STCLINE_FOFN	 0x0000000000000001	/* Fetch Outstanding / Flush Necessary */
+#define  PSYCHO_STCLINE_LINDX	 0x0000000001e00000UL	/* LRU Index */
+#define  PSYCHO_STCLINE_SPTR	 0x00000000001f8000UL	/* Dirty Data Start Pointer */
+#define  PSYCHO_STCLINE_LADDR	 0x0000000000007f00UL	/* Line Address */
+#define  PSYCHO_STCLINE_EPTR	 0x00000000000000fcUL	/* Dirty Data End Pointer */
+#define  PSYCHO_STCLINE_VALID	 0x0000000000000002UL	/* Valid */
+#define  PSYCHO_STCLINE_FOFN	 0x0000000000000001UL	/* Fetch Outstanding / Flush Necessary */
 
 static spinlock_t stc_buf_lock = SPIN_LOCK_UNLOCKED;
 static unsigned long stc_error_buf[128];
@@ -555,24 +555,24 @@ static void __psycho_check_stc_error(struct pci_controller_info *p,
  * interrogate the IOMMU state to see if it is the cause.
  */
 #define PSYCHO_IOMMU_CONTROL	0x0200UL
-#define  PSYCHO_IOMMU_CTRL_RESV     0xfffffffff9000000 /* Reserved                      */
-#define  PSYCHO_IOMMU_CTRL_XLTESTAT 0x0000000006000000 /* Translation Error Status      */
-#define  PSYCHO_IOMMU_CTRL_XLTEERR  0x0000000001000000 /* Translation Error encountered */
-#define  PSYCHO_IOMMU_CTRL_LCKEN    0x0000000000800000 /* Enable translation locking    */
-#define  PSYCHO_IOMMU_CTRL_LCKPTR   0x0000000000780000 /* Translation lock pointer      */
-#define  PSYCHO_IOMMU_CTRL_TSBSZ    0x0000000000070000 /* TSB Size                      */
-#define  PSYCHO_IOMMU_TSBSZ_1K      0x0000000000000000 /* TSB Table 1024 8-byte entries */
-#define  PSYCHO_IOMMU_TSBSZ_2K      0x0000000000010000 /* TSB Table 2048 8-byte entries */
-#define  PSYCHO_IOMMU_TSBSZ_4K      0x0000000000020000 /* TSB Table 4096 8-byte entries */
-#define  PSYCHO_IOMMU_TSBSZ_8K      0x0000000000030000 /* TSB Table 8192 8-byte entries */
-#define  PSYCHO_IOMMU_TSBSZ_16K     0x0000000000040000 /* TSB Table 16k 8-byte entries  */
-#define  PSYCHO_IOMMU_TSBSZ_32K     0x0000000000050000 /* TSB Table 32k 8-byte entries  */
-#define  PSYCHO_IOMMU_TSBSZ_64K     0x0000000000060000 /* TSB Table 64k 8-byte entries  */
-#define  PSYCHO_IOMMU_TSBSZ_128K    0x0000000000070000 /* TSB Table 128k 8-byte entries */
-#define  PSYCHO_IOMMU_CTRL_RESV2    0x000000000000fff8 /* Reserved                      */
-#define  PSYCHO_IOMMU_CTRL_TBWSZ    0x0000000000000004 /* Assumed page size, 0=8k 1=64k */
-#define  PSYCHO_IOMMU_CTRL_DENAB    0x0000000000000002 /* Diagnostic mode enable        */
-#define  PSYCHO_IOMMU_CTRL_ENAB     0x0000000000000001 /* IOMMU Enable                  */
+#define  PSYCHO_IOMMU_CTRL_RESV     0xfffffffff9000000UL /* Reserved                      */
+#define  PSYCHO_IOMMU_CTRL_XLTESTAT 0x0000000006000000UL /* Translation Error Status      */
+#define  PSYCHO_IOMMU_CTRL_XLTEERR  0x0000000001000000UL /* Translation Error encountered */
+#define  PSYCHO_IOMMU_CTRL_LCKEN    0x0000000000800000UL /* Enable translation locking    */
+#define  PSYCHO_IOMMU_CTRL_LCKPTR   0x0000000000780000UL /* Translation lock pointer      */
+#define  PSYCHO_IOMMU_CTRL_TSBSZ    0x0000000000070000UL /* TSB Size                      */
+#define  PSYCHO_IOMMU_TSBSZ_1K      0x0000000000000000UL /* TSB Table 1024 8-byte entries */
+#define  PSYCHO_IOMMU_TSBSZ_2K      0x0000000000010000UL /* TSB Table 2048 8-byte entries */
+#define  PSYCHO_IOMMU_TSBSZ_4K      0x0000000000020000UL /* TSB Table 4096 8-byte entries */
+#define  PSYCHO_IOMMU_TSBSZ_8K      0x0000000000030000UL /* TSB Table 8192 8-byte entries */
+#define  PSYCHO_IOMMU_TSBSZ_16K     0x0000000000040000UL /* TSB Table 16k 8-byte entries  */
+#define  PSYCHO_IOMMU_TSBSZ_32K     0x0000000000050000UL /* TSB Table 32k 8-byte entries  */
+#define  PSYCHO_IOMMU_TSBSZ_64K     0x0000000000060000UL /* TSB Table 64k 8-byte entries  */
+#define  PSYCHO_IOMMU_TSBSZ_128K    0x0000000000070000UL /* TSB Table 128k 8-byte entries */
+#define  PSYCHO_IOMMU_CTRL_RESV2    0x000000000000fff8UL /* Reserved                      */
+#define  PSYCHO_IOMMU_CTRL_TBWSZ    0x0000000000000004UL /* Assumed page size, 0=8k 1=64k */
+#define  PSYCHO_IOMMU_CTRL_DENAB    0x0000000000000002UL /* Diagnostic mode enable        */
+#define  PSYCHO_IOMMU_CTRL_ENAB     0x0000000000000001UL /* IOMMU Enable                  */
 #define PSYCHO_IOMMU_TSBBASE	0x0208UL
 #define PSYCHO_IOMMU_FLUSH	0x0210UL
 #define PSYCHO_IOMMU_TAG	0xa580UL
@@ -698,18 +698,18 @@ static void psycho_check_iommu_error(struct pci_controller_info *p,
  * relating to UPA interface transactions.
  */
 #define PSYCHO_UE_AFSR	0x0030UL
-#define  PSYCHO_UEAFSR_PPIO	0x8000000000000000 /* Primary PIO is cause         */
-#define  PSYCHO_UEAFSR_PDRD	0x4000000000000000 /* Primary DVMA read is cause   */
-#define  PSYCHO_UEAFSR_PDWR	0x2000000000000000 /* Primary DVMA write is cause  */
-#define  PSYCHO_UEAFSR_SPIO	0x1000000000000000 /* Secondary PIO is cause       */
-#define  PSYCHO_UEAFSR_SDRD	0x0800000000000000 /* Secondary DVMA read is cause */
-#define  PSYCHO_UEAFSR_SDWR	0x0400000000000000 /* Secondary DVMA write is cause*/
-#define  PSYCHO_UEAFSR_RESV1	0x03ff000000000000 /* Reserved                     */
-#define  PSYCHO_UEAFSR_BMSK	0x0000ffff00000000 /* Bytemask of failed transfer  */
-#define  PSYCHO_UEAFSR_DOFF	0x00000000e0000000 /* Doubleword Offset            */
-#define  PSYCHO_UEAFSR_MID	0x000000001f000000 /* UPA MID causing the fault    */
-#define  PSYCHO_UEAFSR_BLK	0x0000000000800000 /* Trans was block operation    */
-#define  PSYCHO_UEAFSR_RESV2	0x00000000007fffff /* Reserved                     */
+#define  PSYCHO_UEAFSR_PPIO	0x8000000000000000UL /* Primary PIO is cause         */
+#define  PSYCHO_UEAFSR_PDRD	0x4000000000000000UL /* Primary DVMA read is cause   */
+#define  PSYCHO_UEAFSR_PDWR	0x2000000000000000UL /* Primary DVMA write is cause  */
+#define  PSYCHO_UEAFSR_SPIO	0x1000000000000000UL /* Secondary PIO is cause       */
+#define  PSYCHO_UEAFSR_SDRD	0x0800000000000000UL /* Secondary DVMA read is cause */
+#define  PSYCHO_UEAFSR_SDWR	0x0400000000000000UL /* Secondary DVMA write is cause*/
+#define  PSYCHO_UEAFSR_RESV1	0x03ff000000000000UL /* Reserved                     */
+#define  PSYCHO_UEAFSR_BMSK	0x0000ffff00000000UL /* Bytemask of failed transfer  */
+#define  PSYCHO_UEAFSR_DOFF	0x00000000e0000000UL /* Doubleword Offset            */
+#define  PSYCHO_UEAFSR_MID	0x000000001f000000UL /* UPA MID causing the fault    */
+#define  PSYCHO_UEAFSR_BLK	0x0000000000800000UL /* Trans was block operation    */
+#define  PSYCHO_UEAFSR_RESV2	0x00000000007fffffUL /* Reserved                     */
 #define PSYCHO_UE_AFAR	0x0038UL
 
 static irqreturn_t psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
@@ -774,19 +774,19 @@ static irqreturn_t psycho_ue_intr(int irq, void *dev_id, struct pt_regs *regs)
 
 /* Correctable Errors. */
 #define PSYCHO_CE_AFSR	0x0040UL
-#define  PSYCHO_CEAFSR_PPIO	0x8000000000000000 /* Primary PIO is cause         */
-#define  PSYCHO_CEAFSR_PDRD	0x4000000000000000 /* Primary DVMA read is cause   */
-#define  PSYCHO_CEAFSR_PDWR	0x2000000000000000 /* Primary DVMA write is cause  */
-#define  PSYCHO_CEAFSR_SPIO	0x1000000000000000 /* Secondary PIO is cause       */
-#define  PSYCHO_CEAFSR_SDRD	0x0800000000000000 /* Secondary DVMA read is cause */
-#define  PSYCHO_CEAFSR_SDWR	0x0400000000000000 /* Secondary DVMA write is cause*/
-#define  PSYCHO_CEAFSR_RESV1	0x0300000000000000 /* Reserved                     */
-#define  PSYCHO_CEAFSR_ESYND	0x00ff000000000000 /* Syndrome Bits                */
-#define  PSYCHO_CEAFSR_BMSK	0x0000ffff00000000 /* Bytemask of failed transfer  */
-#define  PSYCHO_CEAFSR_DOFF	0x00000000e0000000 /* Double Offset                */
-#define  PSYCHO_CEAFSR_MID	0x000000001f000000 /* UPA MID causing the fault    */
-#define  PSYCHO_CEAFSR_BLK	0x0000000000800000 /* Trans was block operation    */
-#define  PSYCHO_CEAFSR_RESV2	0x00000000007fffff /* Reserved                     */
+#define  PSYCHO_CEAFSR_PPIO	0x8000000000000000UL /* Primary PIO is cause         */
+#define  PSYCHO_CEAFSR_PDRD	0x4000000000000000UL /* Primary DVMA read is cause   */
+#define  PSYCHO_CEAFSR_PDWR	0x2000000000000000UL /* Primary DVMA write is cause  */
+#define  PSYCHO_CEAFSR_SPIO	0x1000000000000000UL /* Secondary PIO is cause       */
+#define  PSYCHO_CEAFSR_SDRD	0x0800000000000000UL /* Secondary DVMA read is cause */
+#define  PSYCHO_CEAFSR_SDWR	0x0400000000000000UL /* Secondary DVMA write is cause*/
+#define  PSYCHO_CEAFSR_RESV1	0x0300000000000000UL /* Reserved                     */
+#define  PSYCHO_CEAFSR_ESYND	0x00ff000000000000UL /* Syndrome Bits                */
+#define  PSYCHO_CEAFSR_BMSK	0x0000ffff00000000UL /* Bytemask of failed transfer  */
+#define  PSYCHO_CEAFSR_DOFF	0x00000000e0000000UL /* Double Offset                */
+#define  PSYCHO_CEAFSR_MID	0x000000001f000000UL /* UPA MID causing the fault    */
+#define  PSYCHO_CEAFSR_BLK	0x0000000000800000UL /* Trans was block operation    */
+#define  PSYCHO_CEAFSR_RESV2	0x00000000007fffffUL /* Reserved                     */
 #define PSYCHO_CE_AFAR	0x0040UL
 
 static irqreturn_t psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
@@ -857,20 +857,20 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id, struct pt_regs *regs)
  */
 #define PSYCHO_PCI_AFSR_A	0x2010UL
 #define PSYCHO_PCI_AFSR_B	0x4010UL
-#define  PSYCHO_PCIAFSR_PMA	0x8000000000000000 /* Primary Master Abort Error   */
-#define  PSYCHO_PCIAFSR_PTA	0x4000000000000000 /* Primary Target Abort Error   */
-#define  PSYCHO_PCIAFSR_PRTRY	0x2000000000000000 /* Primary Excessive Retries    */
-#define  PSYCHO_PCIAFSR_PPERR	0x1000000000000000 /* Primary Parity Error         */
-#define  PSYCHO_PCIAFSR_SMA	0x0800000000000000 /* Secondary Master Abort Error */
-#define  PSYCHO_PCIAFSR_STA	0x0400000000000000 /* Secondary Target Abort Error */
-#define  PSYCHO_PCIAFSR_SRTRY	0x0200000000000000 /* Secondary Excessive Retries  */
-#define  PSYCHO_PCIAFSR_SPERR	0x0100000000000000 /* Secondary Parity Error       */
-#define  PSYCHO_PCIAFSR_RESV1	0x00ff000000000000 /* Reserved                     */
-#define  PSYCHO_PCIAFSR_BMSK	0x0000ffff00000000 /* Bytemask of failed transfer  */
-#define  PSYCHO_PCIAFSR_BLK	0x0000000080000000 /* Trans was block operation    */
-#define  PSYCHO_PCIAFSR_RESV2	0x0000000040000000 /* Reserved                     */
-#define  PSYCHO_PCIAFSR_MID	0x000000003e000000 /* MID causing the error        */
-#define  PSYCHO_PCIAFSR_RESV3	0x0000000001ffffff /* Reserved                     */
+#define  PSYCHO_PCIAFSR_PMA	0x8000000000000000UL /* Primary Master Abort Error   */
+#define  PSYCHO_PCIAFSR_PTA	0x4000000000000000UL /* Primary Target Abort Error   */
+#define  PSYCHO_PCIAFSR_PRTRY	0x2000000000000000UL /* Primary Excessive Retries    */
+#define  PSYCHO_PCIAFSR_PPERR	0x1000000000000000UL /* Primary Parity Error         */
+#define  PSYCHO_PCIAFSR_SMA	0x0800000000000000UL /* Secondary Master Abort Error */
+#define  PSYCHO_PCIAFSR_STA	0x0400000000000000UL /* Secondary Target Abort Error */
+#define  PSYCHO_PCIAFSR_SRTRY	0x0200000000000000UL /* Secondary Excessive Retries  */
+#define  PSYCHO_PCIAFSR_SPERR	0x0100000000000000UL /* Secondary Parity Error       */
+#define  PSYCHO_PCIAFSR_RESV1	0x00ff000000000000UL /* Reserved                     */
+#define  PSYCHO_PCIAFSR_BMSK	0x0000ffff00000000UL /* Bytemask of failed transfer  */
+#define  PSYCHO_PCIAFSR_BLK	0x0000000080000000UL /* Trans was block operation    */
+#define  PSYCHO_PCIAFSR_RESV2	0x0000000040000000UL /* Reserved                     */
+#define  PSYCHO_PCIAFSR_MID	0x000000003e000000UL /* MID causing the error        */
+#define  PSYCHO_PCIAFSR_RESV3	0x0000000001ffffffUL /* Reserved                     */
 #define PSYCHO_PCI_AFAR_A	0x2018UL
 #define PSYCHO_PCI_AFAR_B	0x4018UL
 
@@ -1017,9 +1017,9 @@ static irqreturn_t psycho_pcierr_intr(int irq, void *dev_id, struct pt_regs *reg
 
 /* XXX What about PowerFail/PowerManagement??? -DaveM */
 #define PSYCHO_ECC_CTRL		0x0020
-#define  PSYCHO_ECCCTRL_EE	 0x8000000000000000 /* Enable ECC Checking */
-#define  PSYCHO_ECCCTRL_UE	 0x4000000000000000 /* Enable UE Interrupts */
-#define  PSYCHO_ECCCTRL_CE	 0x2000000000000000 /* Enable CE INterrupts */
+#define  PSYCHO_ECCCTRL_EE	 0x8000000000000000UL /* Enable ECC Checking */
+#define  PSYCHO_ECCCTRL_UE	 0x4000000000000000UL /* Enable UE Interrupts */
+#define  PSYCHO_ECCCTRL_CE	 0x2000000000000000UL /* Enable CE INterrupts */
 #define PSYCHO_UE_INO		0x2e
 #define PSYCHO_CE_INO		0x2f
 #define PSYCHO_PCIERR_A_INO	0x30
@@ -1282,14 +1282,14 @@ static void __init psycho_iommu_init(struct pci_controller_info *p)
 #define PSYCHO_IRQ_RETRY	0x1a00UL
 #define PSYCHO_PCIA_DIAG	0x2020UL
 #define PSYCHO_PCIB_DIAG	0x4020UL
-#define  PSYCHO_PCIDIAG_RESV	 0xffffffffffffff80 /* Reserved                     */
-#define  PSYCHO_PCIDIAG_DRETRY	 0x0000000000000040 /* Disable retry limit          */
-#define  PSYCHO_PCIDIAG_DISYNC	 0x0000000000000020 /* Disable DMA wr / irq sync    */
-#define  PSYCHO_PCIDIAG_DDWSYNC	 0x0000000000000010 /* Disable DMA wr / PIO rd sync */
-#define  PSYCHO_PCIDIAG_IDDPAR	 0x0000000000000008 /* Invert DMA data parity       */
-#define  PSYCHO_PCIDIAG_IPDPAR	 0x0000000000000004 /* Invert PIO data parity       */
-#define  PSYCHO_PCIDIAG_IPAPAR	 0x0000000000000002 /* Invert PIO address parity    */
-#define  PSYCHO_PCIDIAG_LPBACK	 0x0000000000000001 /* Enable loopback mode         */
+#define  PSYCHO_PCIDIAG_RESV	 0xffffffffffffff80UL /* Reserved                     */
+#define  PSYCHO_PCIDIAG_DRETRY	 0x0000000000000040UL /* Disable retry limit          */
+#define  PSYCHO_PCIDIAG_DISYNC	 0x0000000000000020UL /* Disable DMA wr / irq sync    */
+#define  PSYCHO_PCIDIAG_DDWSYNC	 0x0000000000000010UL /* Disable DMA wr / PIO rd sync */
+#define  PSYCHO_PCIDIAG_IDDPAR	 0x0000000000000008UL /* Invert DMA data parity       */
+#define  PSYCHO_PCIDIAG_IPDPAR	 0x0000000000000004UL /* Invert PIO data parity       */
+#define  PSYCHO_PCIDIAG_IPAPAR	 0x0000000000000002UL /* Invert PIO address parity    */
+#define  PSYCHO_PCIDIAG_LPBACK	 0x0000000000000001UL /* Enable loopback mode         */
 
 static void psycho_controller_hwinit(struct pci_controller_info *p)
 {
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index b70e45f64..be6fa906a 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -56,24 +56,24 @@
 #define SCHIZO_STRBUF_CTRL_ENAB    0x0000000000000001UL /* Streaming Buffer Enable */
 
 /* IOMMU control register. */
-#define SCHIZO_IOMMU_CTRL_RESV     0xfffffffff9000000 /* Reserved                      */
-#define SCHIZO_IOMMU_CTRL_XLTESTAT 0x0000000006000000 /* Translation Error Status      */
-#define SCHIZO_IOMMU_CTRL_XLTEERR  0x0000000001000000 /* Translation Error encountered */
-#define SCHIZO_IOMMU_CTRL_LCKEN    0x0000000000800000 /* Enable translation locking    */
-#define SCHIZO_IOMMU_CTRL_LCKPTR   0x0000000000780000 /* Translation lock pointer      */
-#define SCHIZO_IOMMU_CTRL_TSBSZ    0x0000000000070000 /* TSB Size                      */
-#define SCHIZO_IOMMU_TSBSZ_1K      0x0000000000000000 /* TSB Table 1024 8-byte entries */
-#define SCHIZO_IOMMU_TSBSZ_2K      0x0000000000010000 /* TSB Table 2048 8-byte entries */
-#define SCHIZO_IOMMU_TSBSZ_4K      0x0000000000020000 /* TSB Table 4096 8-byte entries */
-#define SCHIZO_IOMMU_TSBSZ_8K      0x0000000000030000 /* TSB Table 8192 8-byte entries */
-#define SCHIZO_IOMMU_TSBSZ_16K     0x0000000000040000 /* TSB Table 16k 8-byte entries  */
-#define SCHIZO_IOMMU_TSBSZ_32K     0x0000000000050000 /* TSB Table 32k 8-byte entries  */
-#define SCHIZO_IOMMU_TSBSZ_64K     0x0000000000060000 /* TSB Table 64k 8-byte entries  */
-#define SCHIZO_IOMMU_TSBSZ_128K    0x0000000000070000 /* TSB Table 128k 8-byte entries */
-#define SCHIZO_IOMMU_CTRL_RESV2    0x000000000000fff8 /* Reserved                      */
-#define SCHIZO_IOMMU_CTRL_TBWSZ    0x0000000000000004 /* Assumed page size, 0=8k 1=64k */
-#define SCHIZO_IOMMU_CTRL_DENAB    0x0000000000000002 /* Diagnostic mode enable        */
-#define SCHIZO_IOMMU_CTRL_ENAB     0x0000000000000001 /* IOMMU Enable                  */
+#define SCHIZO_IOMMU_CTRL_RESV     0xfffffffff9000000UL /* Reserved                      */
+#define SCHIZO_IOMMU_CTRL_XLTESTAT 0x0000000006000000UL /* Translation Error Status      */
+#define SCHIZO_IOMMU_CTRL_XLTEERR  0x0000000001000000UL /* Translation Error encountered */
+#define SCHIZO_IOMMU_CTRL_LCKEN    0x0000000000800000UL /* Enable translation locking    */
+#define SCHIZO_IOMMU_CTRL_LCKPTR   0x0000000000780000UL /* Translation lock pointer      */
+#define SCHIZO_IOMMU_CTRL_TSBSZ    0x0000000000070000UL /* TSB Size                      */
+#define SCHIZO_IOMMU_TSBSZ_1K      0x0000000000000000UL /* TSB Table 1024 8-byte entries */
+#define SCHIZO_IOMMU_TSBSZ_2K      0x0000000000010000UL /* TSB Table 2048 8-byte entries */
+#define SCHIZO_IOMMU_TSBSZ_4K      0x0000000000020000UL /* TSB Table 4096 8-byte entries */
+#define SCHIZO_IOMMU_TSBSZ_8K      0x0000000000030000UL /* TSB Table 8192 8-byte entries */
+#define SCHIZO_IOMMU_TSBSZ_16K     0x0000000000040000UL /* TSB Table 16k 8-byte entries  */
+#define SCHIZO_IOMMU_TSBSZ_32K     0x0000000000050000UL /* TSB Table 32k 8-byte entries  */
+#define SCHIZO_IOMMU_TSBSZ_64K     0x0000000000060000UL /* TSB Table 64k 8-byte entries  */
+#define SCHIZO_IOMMU_TSBSZ_128K    0x0000000000070000UL /* TSB Table 128k 8-byte entries */
+#define SCHIZO_IOMMU_CTRL_RESV2    0x000000000000fff8UL /* Reserved                      */
+#define SCHIZO_IOMMU_CTRL_TBWSZ    0x0000000000000004UL /* Assumed page size, 0=8k 1=64k */
+#define SCHIZO_IOMMU_CTRL_DENAB    0x0000000000000002UL /* Diagnostic mode enable        */
+#define SCHIZO_IOMMU_CTRL_ENAB     0x0000000000000001UL /* IOMMU Enable                  */
 
 /* Schizo config space address format is nearly identical to
  * that of PSYCHO:
@@ -1111,9 +1111,9 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id, struct pt_regs *
 
 /* Nearly identical to PSYCHO equivalents... */
 #define SCHIZO_ECC_CTRL		0x10020UL
-#define  SCHIZO_ECCCTRL_EE	 0x8000000000000000 /* Enable ECC Checking */
-#define  SCHIZO_ECCCTRL_UE	 0x4000000000000000 /* Enable UE Interrupts */
-#define  SCHIZO_ECCCTRL_CE	 0x2000000000000000 /* Enable CE INterrupts */
+#define  SCHIZO_ECCCTRL_EE	 0x8000000000000000UL /* Enable ECC Checking */
+#define  SCHIZO_ECCCTRL_UE	 0x4000000000000000UL /* Enable UE Interrupts */
+#define  SCHIZO_ECCCTRL_CE	 0x2000000000000000UL /* Enable CE INterrupts */
 
 #define SCHIZO_SAFARI_ERRCTRL	0x10008UL
 #define  SCHIZO_SAFERRCTRL_EN	 0x8000000000000000UL
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index f6d336462..7f03853f8 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -160,39 +160,43 @@ EXPORT_SYMBOL(machine_restart);
 
 static void show_regwindow32(struct pt_regs *regs)
 {
-	struct reg_window32 *rw;
+	struct reg_window32 __user *rw;
 	struct reg_window32 r_w;
 	mm_segment_t old_fs;
 	
 	__asm__ __volatile__ ("flushw");
-	rw = (struct reg_window32 *)((long)(unsigned)regs->u_regs[14]);
+	rw = (struct reg_window32 __user *)((long)(unsigned)regs->u_regs[14]);
 	old_fs = get_fs();
 	set_fs (USER_DS);
 	if (copy_from_user (&r_w, rw, sizeof(r_w))) {
 		set_fs (old_fs);
 		return;
 	}
-	rw = &r_w;
+
 	set_fs (old_fs);			
 	printk("l0: %08x l1: %08x l2: %08x l3: %08x "
 	       "l4: %08x l5: %08x l6: %08x l7: %08x\n",
-	       rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3],
-	       rw->locals[4], rw->locals[5], rw->locals[6], rw->locals[7]);
+	       r_w.locals[0], r_w.locals[1], r_w.locals[2], r_w.locals[3],
+	       r_w.locals[4], r_w.locals[5], r_w.locals[6], r_w.locals[7]);
 	printk("i0: %08x i1: %08x i2: %08x i3: %08x "
 	       "i4: %08x i5: %08x i6: %08x i7: %08x\n",
-	       rw->ins[0], rw->ins[1], rw->ins[2], rw->ins[3],
-	       rw->ins[4], rw->ins[5], rw->ins[6], rw->ins[7]);
+	       r_w.ins[0], r_w.ins[1], r_w.ins[2], r_w.ins[3],
+	       r_w.ins[4], r_w.ins[5], r_w.ins[6], r_w.ins[7]);
 }
 
 static void show_regwindow(struct pt_regs *regs)
 {
-	struct reg_window *rw;
+	struct reg_window __user *rw;
+	struct reg_window *rwk;
 	struct reg_window r_w;
 	mm_segment_t old_fs;
 
 	if ((regs->tstate & TSTATE_PRIV) || !(test_thread_flag(TIF_32BIT))) {
 		__asm__ __volatile__ ("flushw");
-		rw = (struct reg_window *)(regs->u_regs[14] + STACK_BIAS);
+		rw = (struct reg_window __user *)
+			(regs->u_regs[14] + STACK_BIAS);
+		rwk = (struct reg_window *)
+			(regs->u_regs[14] + STACK_BIAS);
 		if (!(regs->tstate & TSTATE_PRIV)) {
 			old_fs = get_fs();
 			set_fs (USER_DS);
@@ -200,7 +204,7 @@ static void show_regwindow(struct pt_regs *regs)
 				set_fs (old_fs);
 				return;
 			}
-			rw = &r_w;
+			rwk = &r_w;
 			set_fs (old_fs);			
 		}
 	} else {
@@ -208,15 +212,15 @@ static void show_regwindow(struct pt_regs *regs)
 		return;
 	}
 	printk("l0: %016lx l1: %016lx l2: %016lx l3: %016lx\n",
-	       rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3]);
+	       rwk->locals[0], rwk->locals[1], rwk->locals[2], rwk->locals[3]);
 	printk("l4: %016lx l5: %016lx l6: %016lx l7: %016lx\n",
-	       rw->locals[4], rw->locals[5], rw->locals[6], rw->locals[7]);
+	       rwk->locals[4], rwk->locals[5], rwk->locals[6], rwk->locals[7]);
 	printk("i0: %016lx i1: %016lx i2: %016lx i3: %016lx\n",
-	       rw->ins[0], rw->ins[1], rw->ins[2], rw->ins[3]);
+	       rwk->ins[0], rwk->ins[1], rwk->ins[2], rwk->ins[3]);
 	printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
-	       rw->ins[4], rw->ins[5], rw->ins[6], rw->ins[7]);
+	       rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
 	if (regs->tstate & TSTATE_PRIV)
-		print_symbol("I7: <%s>\n", rw->ins[7]);
+		print_symbol("I7: <%s>\n", rwk->ins[7]);
 }
 
 void show_stackframe(struct sparc_stackf *sf)
@@ -471,10 +475,10 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
 	if (!(test_thread_flag(TIF_32BIT))) {
 		csp += STACK_BIAS;
 		psp += STACK_BIAS;
-		__get_user(fp, &(((struct reg_window *)psp)->ins[6]));
+		__get_user(fp, &(((struct reg_window __user *)psp)->ins[6]));
 		fp += STACK_BIAS;
 	} else
-		__get_user(fp, &(((struct reg_window32 *)psp)->ins[6]));
+		__get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));
 
 	/* Now 8-byte align the stack as this is mandatory in the
 	 * Sparc ABI due to how register windows work.  This hides
@@ -487,11 +491,12 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
 	if (copy_in_user((void __user *) rval, (void __user *) psp, distance))
 		rval = 0;
 	else if (test_thread_flag(TIF_32BIT)) {
-		if (put_user(((u32)csp), &(((struct reg_window32 *)rval)->ins[6])))
+		if (put_user(((u32)csp),
+			     &(((struct reg_window32 __user *)rval)->ins[6])))
 			rval = 0;
 	} else {
 		if (put_user(((u64)csp - STACK_BIAS),
-			     &(((struct reg_window *)rval)->ins[6])))
+			     &(((struct reg_window __user *)rval)->ins[6])))
 			rval = 0;
 		else
 			rval = rval - STACK_BIAS;
@@ -533,7 +538,7 @@ void synchronize_user_stack(void)
 			unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
 			struct reg_window *rwin = &t->reg_window[window];
 
-			if (!copy_to_user((char *)sp, rwin, winsize)) {
+			if (!copy_to_user((char __user *)sp, rwin, winsize)) {
 				shift_window_buffer(window, get_thread_wsaved() - 1, t);
 				set_thread_wsaved(get_thread_wsaved() - 1);
 			}
@@ -562,7 +567,7 @@ void fault_in_user_windows(void)
 			unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
 			struct reg_window *rwin = &t->reg_window[window];
 
-			if (copy_to_user((char *)sp, rwin, winsize))
+			if (copy_to_user((char __user *)sp, rwin, winsize))
 				goto barf;
 		} while (window--);
 	}
@@ -574,26 +579,26 @@ barf:
 	do_exit(SIGILL);
 }
 
-asmlinkage int sparc_do_fork(unsigned long clone_flags,
-			     unsigned long stack_start,
-			     struct pt_regs *regs,
-			     unsigned long stack_size)
+asmlinkage long sparc_do_fork(unsigned long clone_flags,
+			      unsigned long stack_start,
+			      struct pt_regs *regs,
+			      unsigned long stack_size)
 {
-	unsigned long parent_tid_ptr, child_tid_ptr;
+	int __user *parent_tid_ptr, *child_tid_ptr;
 
 	clone_flags &= ~CLONE_IDLETASK;
 
-	parent_tid_ptr = regs->u_regs[UREG_I2];
-	child_tid_ptr = regs->u_regs[UREG_I4];
 	if (test_thread_flag(TIF_32BIT)) {
-		parent_tid_ptr &= 0xffffffff;
-		child_tid_ptr &= 0xffffffff;
+		parent_tid_ptr = compat_ptr(regs->u_regs[UREG_I2]);
+		child_tid_ptr = compat_ptr(regs->u_regs[UREG_I4]);
+	} else {
+		parent_tid_ptr = (int __user *) regs->u_regs[UREG_I2];
+		child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
 	}
 
 	return do_fork(clone_flags, stack_start,
 		       regs, stack_size,
-		       (int *) parent_tid_ptr,
-		       (int *) child_tid_ptr);
+		       parent_tid_ptr, child_tid_ptr);
 }
 
 /* Copy a Sparc thread.  The fork() return value conventions
@@ -694,24 +699,24 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 	 * So we stash 'fn' and 'arg' into global registers which
 	 * will not be modified by the parent.
 	 */
-	__asm__ __volatile("mov %4, %%g2\n\t"	   /* Save FN into global */
-			   "mov %5, %%g3\n\t"	   /* Save ARG into global */
-			   "mov %1, %%g1\n\t"	   /* Clone syscall nr. */
-			   "mov %2, %%o0\n\t"	   /* Clone flags. */
-			   "mov 0, %%o1\n\t"	   /* usp arg == 0 */
-			   "t 0x6d\n\t"		   /* Linux/Sparc clone(). */
-			   "brz,a,pn %%o1, 1f\n\t" /* Parent, just return. */
-			   " mov %%o0, %0\n\t"
-			   "jmpl %%g2, %%o7\n\t"   /* Call the function. */
-			   " mov %%g3, %%o0\n\t"   /* Set arg in delay. */
-			   "mov %3, %%g1\n\t"
-			   "t 0x6d\n\t"		   /* Linux/Sparc exit(). */
-			   /* Notreached by child. */
-			   "1:" :
-			   "=r" (retval) :
-			   "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
-			   "i" (__NR_exit),  "r" (fn), "r" (arg) :
-			   "g1", "g2", "g3", "o0", "o1", "memory", "cc");
+	__asm__ __volatile__("mov %4, %%g2\n\t"	   /* Save FN into global */
+			     "mov %5, %%g3\n\t"	   /* Save ARG into global */
+			     "mov %1, %%g1\n\t"	   /* Clone syscall nr. */
+			     "mov %2, %%o0\n\t"	   /* Clone flags. */
+			     "mov 0, %%o1\n\t"	   /* usp arg == 0 */
+			     "t 0x6d\n\t"	   /* Linux/Sparc clone(). */
+			     "brz,a,pn %%o1, 1f\n\t" /* Parent, just return. */
+			     " mov %%o0, %0\n\t"
+			     "jmpl %%g2, %%o7\n\t"   /* Call the function. */
+			     " mov %%g3, %%o0\n\t"   /* Set arg in delay. */
+			     "mov %3, %%g1\n\t"
+			     "t 0x6d\n\t"	   /* Linux/Sparc exit(). */
+			     /* Notreached by child. */
+			     "1:" :
+			     "=r" (retval) :
+			     "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
+			     "i" (__NR_exit),  "r" (fn), "r" (arg) :
+			     "g1", "g2", "g3", "o0", "o1", "memory", "cc");
 	return retval;
 }
 
@@ -806,12 +811,15 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
 	if (regs->u_regs[UREG_G1] == 0)
 		base = 1;
 
-	filename = getname((char *)regs->u_regs[base + UREG_I0]);
+	filename = getname((char __user *)regs->u_regs[base + UREG_I0]);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
-	error = do_execve(filename, (char **) regs->u_regs[base + UREG_I1],
-			  (char **) regs->u_regs[base + UREG_I2], regs);
+	error = do_execve(filename,
+			  (char __user * __user *)
+			  regs->u_regs[base + UREG_I1],
+			  (char __user * __user *)
+			  regs->u_regs[base + UREG_I2], regs);
 	putname(filename);
 	if (!error) {
 		fprs_write(0);
@@ -847,8 +855,7 @@ unsigned long get_wchan(struct task_struct *task)
 			break;
 		rw = (struct reg_window *) fp;
 		pc = rw->ins[7];
-		if (pc < ((unsigned long) scheduling_functions_start_here) ||
-		    pc >= ((unsigned long) scheduling_functions_end_here)) {
+		if (!in_sched_functions(pc)) {
 			ret = pc;
 			goto out;
 		}
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index d935eb602..3e9aa09a9 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -53,11 +53,15 @@ static inline void
 pt_succ_return_linux(struct pt_regs *regs, unsigned long value, long *addr)
 {
 	if (test_thread_flag(TIF_32BIT)) {
-		if (put_user(value, (unsigned int *)addr))
-			return pt_error_return(regs, EFAULT);
+		if (put_user(value, (unsigned int __user *) addr)) {
+			pt_error_return(regs, EFAULT);
+			return;
+		}
 	} else {
-		if (put_user(value, addr))
-			return pt_error_return(regs, EFAULT);
+		if (put_user(value, (long __user *) addr)) {
+			pt_error_return(regs, EFAULT);
+			return;
+		}
 	}
 	regs->u_regs[UREG_I0] = 0;
 	regs->tstate &= ~(TSTATE_ICARRY | TSTATE_XCARRY);
@@ -253,7 +257,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	}
 
 	case PTRACE_GETREGS: {
-		struct pt_regs32 *pregs = (struct pt_regs32 *) addr;
+		struct pt_regs32 __user *pregs =
+			(struct pt_regs32 __user *) addr;
 		struct pt_regs *cregs = child->thread_info->kregs;
 		int rval;
 
@@ -277,7 +282,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	}
 
 	case PTRACE_GETREGS64: {
-		struct pt_regs *pregs = (struct pt_regs *) addr;
+		struct pt_regs __user *pregs = (struct pt_regs __user *) addr;
 		struct pt_regs *cregs = child->thread_info->kregs;
 		unsigned long tpc = cregs->tpc;
 		int rval;
@@ -304,7 +309,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	}
 
 	case PTRACE_SETREGS: {
-		struct pt_regs32 *pregs = (struct pt_regs32 *) addr;
+		struct pt_regs32 __user *pregs =
+			(struct pt_regs32 __user *) addr;
 		struct pt_regs *cregs = child->thread_info->kregs;
 		unsigned int psr, pc, npc, y;
 		int i;
@@ -337,7 +343,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	}
 
 	case PTRACE_SETREGS64: {
-		struct pt_regs *pregs = (struct pt_regs *) addr;
+		struct pt_regs __user *pregs = (struct pt_regs __user *) addr;
 		struct pt_regs *cregs = child->thread_info->kregs;
 		unsigned long tstate, tpc, tnpc, y;
 		int i;
@@ -385,7 +391,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 				unsigned int insnaddr;
 				unsigned int insn;
 			} fpq[16];
-		} *fps = (struct fps *) addr;
+		};
+		struct fps __user *fps = (struct fps __user *) addr;
 		unsigned long *fpregs = child->thread_info->fpregs;
 
 		if (copy_to_user(&fps->regs[0], fpregs,
@@ -406,7 +413,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 		struct fps {
 			unsigned int regs[64];
 			unsigned long fsr;
-		} *fps = (struct fps *) addr;
+		};
+		struct fps __user *fps = (struct fps __user *) addr;
 		unsigned long *fpregs = child->thread_info->fpregs;
 
 		if (copy_to_user(&fps->regs[0], fpregs,
@@ -430,7 +438,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 				unsigned int insnaddr;
 				unsigned int insn;
 			} fpq[16];
-		} *fps = (struct fps *) addr;
+		};
+		struct fps __user *fps = (struct fps __user *) addr;
 		unsigned long *fpregs = child->thread_info->fpregs;
 		unsigned fsr;
 
@@ -453,7 +462,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 		struct fps {
 			unsigned int regs[64];
 			unsigned long fsr;
-		} *fps = (struct fps *) addr;
+		};
+		struct fps __user *fps = (struct fps __user *) addr;
 		unsigned long *fpregs = child->thread_info->fpregs;
 
 		if (copy_from_user(fpregs, &fps->regs[0],
@@ -472,7 +482,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 	case PTRACE_READTEXT:
 	case PTRACE_READDATA: {
 		int res = ptrace_readdata(child, addr,
-					  (void *)addr2, data);
+					  (char __user *)addr2, data);
 		if (res == data) {
 			pt_succ_return(regs, 0);
 			goto flush_and_out;
@@ -485,7 +495,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
 
 	case PTRACE_WRITETEXT:
 	case PTRACE_WRITEDATA: {
-		int res = ptrace_writedata(child, (void *) addr2,
+		int res = ptrace_writedata(child, (char __user *) addr2,
 					   addr, data);
 		if (res == data) {
 			pt_succ_return(regs, 0);
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index e7041e2ee..549e9782b 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -810,17 +810,17 @@ unsigned int sbus_build_irq(void *buscookie, unsigned int ino)
 /* Error interrupt handling. */
 #define SYSIO_UE_AFSR	0x0030UL
 #define SYSIO_UE_AFAR	0x0038UL
-#define  SYSIO_UEAFSR_PPIO	0x8000000000000000 /* Primary PIO is cause         */
-#define  SYSIO_UEAFSR_PDRD	0x4000000000000000 /* Primary DVMA read is cause   */
-#define  SYSIO_UEAFSR_PDWR	0x2000000000000000 /* Primary DVMA write is cause  */
-#define  SYSIO_UEAFSR_SPIO	0x1000000000000000 /* Secondary PIO is cause       */
-#define  SYSIO_UEAFSR_SDRD	0x0800000000000000 /* Secondary DVMA read is cause */
-#define  SYSIO_UEAFSR_SDWR	0x0400000000000000 /* Secondary DVMA write is cause*/
-#define  SYSIO_UEAFSR_RESV1	0x03ff000000000000 /* Reserved                     */
-#define  SYSIO_UEAFSR_DOFF	0x0000e00000000000 /* Doubleword Offset            */
-#define  SYSIO_UEAFSR_SIZE	0x00001c0000000000 /* Bad transfer size is 2**SIZE */
-#define  SYSIO_UEAFSR_MID	0x000003e000000000 /* UPA MID causing the fault    */
-#define  SYSIO_UEAFSR_RESV2	0x0000001fffffffff /* Reserved                     */
+#define  SYSIO_UEAFSR_PPIO  0x8000000000000000UL /* Primary PIO cause         */
+#define  SYSIO_UEAFSR_PDRD  0x4000000000000000UL /* Primary DVMA read cause   */
+#define  SYSIO_UEAFSR_PDWR  0x2000000000000000UL /* Primary DVMA write cause  */
+#define  SYSIO_UEAFSR_SPIO  0x1000000000000000UL /* Secondary PIO is cause    */
+#define  SYSIO_UEAFSR_SDRD  0x0800000000000000UL /* Secondary DVMA read cause */
+#define  SYSIO_UEAFSR_SDWR  0x0400000000000000UL /* Secondary DVMA write cause*/
+#define  SYSIO_UEAFSR_RESV1 0x03ff000000000000UL /* Reserved                  */
+#define  SYSIO_UEAFSR_DOFF  0x0000e00000000000UL /* Doubleword Offset         */
+#define  SYSIO_UEAFSR_SIZE  0x00001c0000000000UL /* Bad transfer size 2^SIZE  */
+#define  SYSIO_UEAFSR_MID   0x000003e000000000UL /* UPA MID causing the fault */
+#define  SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved                  */
 static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sbus_bus *sbus = dev_id;
@@ -881,18 +881,18 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id, struct pt_regs *regs)
 
 #define SYSIO_CE_AFSR	0x0040UL
 #define SYSIO_CE_AFAR	0x0048UL
-#define  SYSIO_CEAFSR_PPIO	0x8000000000000000 /* Primary PIO is cause         */
-#define  SYSIO_CEAFSR_PDRD	0x4000000000000000 /* Primary DVMA read is cause   */
-#define  SYSIO_CEAFSR_PDWR	0x2000000000000000 /* Primary DVMA write is cause  */
-#define  SYSIO_CEAFSR_SPIO	0x1000000000000000 /* Secondary PIO is cause       */
-#define  SYSIO_CEAFSR_SDRD	0x0800000000000000 /* Secondary DVMA read is cause */
-#define  SYSIO_CEAFSR_SDWR	0x0400000000000000 /* Secondary DVMA write is cause*/
-#define  SYSIO_CEAFSR_RESV1	0x0300000000000000 /* Reserved                     */
-#define  SYSIO_CEAFSR_ESYND	0x00ff000000000000 /* Syndrome Bits                */
-#define  SYSIO_CEAFSR_DOFF	0x0000e00000000000 /* Double Offset                */
-#define  SYSIO_CEAFSR_SIZE	0x00001c0000000000 /* Bad transfer size is 2**SIZE */
-#define  SYSIO_CEAFSR_MID	0x000003e000000000 /* UPA MID causing the fault    */
-#define  SYSIO_CEAFSR_RESV2	0x0000001fffffffff /* Reserved                     */
+#define  SYSIO_CEAFSR_PPIO  0x8000000000000000UL /* Primary PIO cause         */
+#define  SYSIO_CEAFSR_PDRD  0x4000000000000000UL /* Primary DVMA read cause   */
+#define  SYSIO_CEAFSR_PDWR  0x2000000000000000UL /* Primary DVMA write cause  */
+#define  SYSIO_CEAFSR_SPIO  0x1000000000000000UL /* Secondary PIO cause       */
+#define  SYSIO_CEAFSR_SDRD  0x0800000000000000UL /* Secondary DVMA read cause */
+#define  SYSIO_CEAFSR_SDWR  0x0400000000000000UL /* Secondary DVMA write cause*/
+#define  SYSIO_CEAFSR_RESV1 0x0300000000000000UL /* Reserved                  */
+#define  SYSIO_CEAFSR_ESYND 0x00ff000000000000UL /* Syndrome Bits             */
+#define  SYSIO_CEAFSR_DOFF  0x0000e00000000000UL /* Double Offset             */
+#define  SYSIO_CEAFSR_SIZE  0x00001c0000000000UL /* Bad transfer size 2^SIZE  */
+#define  SYSIO_CEAFSR_MID   0x000003e000000000UL /* UPA MID causing the fault */
+#define  SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved                  */
 static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sbus_bus *sbus = dev_id;
@@ -958,18 +958,18 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id, struct pt_regs *regs)
 
 #define SYSIO_SBUS_AFSR		0x2010UL
 #define SYSIO_SBUS_AFAR		0x2018UL
-#define  SYSIO_SBAFSR_PLE	0x8000000000000000 /* Primary Late PIO Error       */
-#define  SYSIO_SBAFSR_PTO	0x4000000000000000 /* Primary SBUS Timeout         */
-#define  SYSIO_SBAFSR_PBERR	0x2000000000000000 /* Primary SBUS Error ACK       */
-#define  SYSIO_SBAFSR_SLE	0x1000000000000000 /* Secondary Late PIO Error     */
-#define  SYSIO_SBAFSR_STO	0x0800000000000000 /* Secondary SBUS Timeout       */
-#define  SYSIO_SBAFSR_SBERR	0x0400000000000000 /* Secondary SBUS Error ACK     */
-#define  SYSIO_SBAFSR_RESV1	0x03ff000000000000 /* Reserved                     */
-#define  SYSIO_SBAFSR_RD	0x0000800000000000 /* Primary was late PIO read    */
-#define  SYSIO_SBAFSR_RESV2	0x0000600000000000 /* Reserved                     */
-#define  SYSIO_SBAFSR_SIZE	0x00001c0000000000 /* Size of transfer             */
-#define  SYSIO_SBAFSR_MID	0x000003e000000000 /* MID causing the error        */
-#define  SYSIO_SBAFSR_RESV3	0x0000001fffffffff /* Reserved                     */
+#define  SYSIO_SBAFSR_PLE   0x8000000000000000UL /* Primary Late PIO Error    */
+#define  SYSIO_SBAFSR_PTO   0x4000000000000000UL /* Primary SBUS Timeout      */
+#define  SYSIO_SBAFSR_PBERR 0x2000000000000000UL /* Primary SBUS Error ACK    */
+#define  SYSIO_SBAFSR_SLE   0x1000000000000000UL /* Secondary Late PIO Error  */
+#define  SYSIO_SBAFSR_STO   0x0800000000000000UL /* Secondary SBUS Timeout    */
+#define  SYSIO_SBAFSR_SBERR 0x0400000000000000UL /* Secondary SBUS Error ACK  */
+#define  SYSIO_SBAFSR_RESV1 0x03ff000000000000UL /* Reserved                  */
+#define  SYSIO_SBAFSR_RD    0x0000800000000000UL /* Primary was late PIO read */
+#define  SYSIO_SBAFSR_RESV2 0x0000600000000000UL /* Reserved                  */
+#define  SYSIO_SBAFSR_SIZE  0x00001c0000000000UL /* Size of transfer          */
+#define  SYSIO_SBAFSR_MID   0x000003e000000000UL /* MID causing the error     */
+#define  SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved                  */
 static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct sbus_bus *sbus = dev_id;
@@ -1030,9 +1030,9 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id, struct pt_reg
 }
 
 #define ECC_CONTROL	0x0020UL
-#define  SYSIO_ECNTRL_ECCEN	0x8000000000000000 /* Enable ECC Checking          */
-#define  SYSIO_ECNTRL_UEEN	0x4000000000000000 /* Enable UE Interrupts         */
-#define  SYSIO_ECNTRL_CEEN	0x2000000000000000 /* Enable CE Interrupts         */
+#define  SYSIO_ECNTRL_ECCEN	0x8000000000000000UL /* Enable ECC Checking   */
+#define  SYSIO_ECNTRL_UEEN	0x4000000000000000UL /* Enable UE Interrupts  */
+#define  SYSIO_ECNTRL_CEEN	0x2000000000000000UL /* Enable CE Interrupts  */
 
 #define SYSIO_UE_INO		0x34
 #define SYSIO_CE_INO		0x35
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 0da430996..3d097a4bb 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -293,7 +293,7 @@ int prom_callback(long *args)
 		unsigned long tte;
 
 		tte = args[3];
-		prom_printf("%lx ", (tte & 0x07FC000000000000) >> 50);
+		prom_printf("%lx ", (tte & 0x07FC000000000000UL) >> 50);
 
 		args[2] = 2;
 		args[args[1] + 3] = 0;
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index 9a8a3b624..ba3fcb4b2 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -42,7 +42,8 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
 /* {set, get}context() needed for 64-bit SparcLinux userland. */
 asmlinkage void sparc64_set_context(struct pt_regs *regs)
 {
-	struct ucontext *ucp = (struct ucontext __user *) regs->u_regs[UREG_I0];
+	struct ucontext __user *ucp = (struct ucontext __user *)
+		regs->u_regs[UREG_I0];
 	mc_gregset_t __user *grp;
 	unsigned long pc, npc, tstate;
 	unsigned long fp, i7;
@@ -139,7 +140,8 @@ do_sigsegv:
 
 asmlinkage void sparc64_get_context(struct pt_regs *regs)
 {
-	struct ucontext *ucp = (struct ucontext __user *) regs->u_regs[UREG_I0];
+	struct ucontext __user *ucp = (struct ucontext __user *)
+		regs->u_regs[UREG_I0];
 	mc_gregset_t __user *grp;
 	mcontext_t __user *mcp;
 	unsigned long fp, i7;
@@ -427,7 +429,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
 	   call it and ignore errors.  */
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	do_sigaltstack(&st, NULL, (unsigned long)sf);
+	do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf);
 	set_fs(old_fs);
 
 	sigdelsetmask(&set, ~_BLOCKABLE);
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 6120953aa..2fb26c9b9 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -345,8 +345,10 @@ asmlinkage void do_sigreturn32(struct pt_regs *regs)
 	current_thread_info()->restart_block.fn = do_no_restart_syscall;
 
 	synchronize_user_stack();
-	if (test_thread_flag(TIF_NEWSIGNALS))
-		return do_new_sigreturn32(regs);
+	if (test_thread_flag(TIF_NEWSIGNALS)) {
+		do_new_sigreturn32(regs);
+		return;
+	}
 
 	scptr = (struct sigcontext32 __user *)
 		(regs->u_regs[UREG_I0] & 0x00000000ffffffffUL);
@@ -469,7 +471,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
 	   call it and ignore errors.  */
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	do_sigaltstack(&st, NULL, (unsigned long)sf);
+	do_sigaltstack((stack_t __user *) &st, NULL, (unsigned long)sf);
 	set_fs(old_fs);
 	
 	switch (_NSIG_WORDS) {
@@ -1039,7 +1041,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
 	   call it and ignore errors.  */
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	do_sigaltstack(&st, NULL, regs->u_regs[UREG_I6]);
+	do_sigaltstack((stack_t __user *) &st, NULL, regs->u_regs[UREG_I6]);
 	set_fs(old_fs);
 	
 	sigdelsetmask(&set, ~_BLOCKABLE);
@@ -1347,7 +1349,7 @@ out:
 	return ret;
 }
 
-asmlinkage int do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp)
+asmlinkage long do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp)
 {
 	stack_t uss, uoss;
 	u32 u_ss_sp = 0;
@@ -1361,7 +1363,8 @@ asmlinkage int do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp)
 	uss.ss_sp = (void *) (long) u_ss_sp;
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = do_sigaltstack(ussa ? &uss : NULL, uossa ? &uoss : NULL, sp);
+	ret = do_sigaltstack(ussa ? (stack_t __user *) &uss : NULL,
+			     uossa ? (stack_t __user *) &uoss : NULL, sp);
 	set_fs(old_fs);
 	if (!ret && uossa && (put_user((long)uoss.ss_sp, &((stack_t32 __user *)(long)uossa)->ss_sp) ||
 		    __put_user(uoss.ss_flags, &((stack_t32 __user *)(long)uossa)->ss_flags) ||
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 88fe64765..64b873212 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -547,15 +547,18 @@ retry:
 static void smp_cross_call_masked(unsigned long *func, u32 ctx, u64 data1, u64 data2, cpumask_t mask)
 {
 	u64 data0 = (((u64)ctx)<<32 | (((u64)func) & 0xffffffff));
+	int this_cpu = get_cpu();
 
 	cpus_and(mask, mask, cpu_online_map);
-	cpu_clear(smp_processor_id(), mask);
+	cpu_clear(this_cpu, mask);
 
 	if (tlb_type == spitfire)
 		spitfire_xcall_deliver(data0, data1, data2, mask);
 	else
 		cheetah_xcall_deliver(data0, data1, data2, mask);
 	/* NOTE: Caller runs local copy on master. */
+
+	put_cpu();
 }
 
 extern unsigned long xcall_sync_tick;
@@ -598,6 +601,9 @@ int smp_call_function(void (*func)(void *info), void *info,
 	if (!cpus)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.finished, 0);
@@ -682,11 +688,12 @@ static __inline__ void __local_flush_dcache_page(struct page *page)
 void smp_flush_dcache_page_impl(struct page *page, int cpu)
 {
 	cpumask_t mask = cpumask_of_cpu(cpu);
+	int this_cpu = get_cpu();
 
 #ifdef CONFIG_DEBUG_DCFLUSH
 	atomic_inc(&dcpage_flushes);
 #endif
-	if (cpu == smp_processor_id()) {
+	if (cpu == this_cpu) {
 		__local_flush_dcache_page(page);
 	} else if (cpu_online(cpu)) {
 		u64 data0;
@@ -711,14 +718,17 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
 		atomic_inc(&dcpage_flushes_xcall);
 #endif
 	}
+
+	put_cpu();
 }
 
 void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
 {
 	cpumask_t mask = cpu_online_map;
 	u64 data0;
+	int this_cpu = get_cpu();
 
-	cpu_clear(smp_processor_id(), mask);
+	cpu_clear(this_cpu, mask);
 
 #ifdef CONFIG_DEBUG_DCFLUSH
 	atomic_inc(&dcpage_flushes);
@@ -744,6 +754,8 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
 #endif
  flush_self:
 	__local_flush_dcache_page(page);
+
+	put_cpu();
 }
 
 void smp_receive_signal(int cpu)
@@ -839,7 +851,7 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
 
 	{
 		u32 ctx = CTX_HWBITS(mm->context);
-		int cpu = smp_processor_id();
+		int cpu = get_cpu();
 
 		if (atomic_read(&mm->mm_users) == 1) {
 			/* See smp_flush_tlb_page for info about this. */
@@ -853,6 +865,8 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
 
 	local_flush_and_out:
 		__flush_tlb_mm(ctx, SECONDARY_CONTEXT);
+
+		put_cpu();
 	}
 }
 
@@ -860,7 +874,7 @@ void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
 			 unsigned long end)
 {
 	u32 ctx = CTX_HWBITS(mm->context);
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 
 	start &= PAGE_MASK;
 	end    = PAGE_ALIGN(end);
@@ -877,6 +891,8 @@ void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
  local_flush_and_out:
 	__flush_tlb_range(ctx, start, SECONDARY_CONTEXT,
 			  end, PAGE_SIZE, (end-start));
+
+	put_cpu();
 }
 
 void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end)
@@ -895,7 +911,7 @@ void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page)
 {
 	{
 		u32 ctx = CTX_HWBITS(mm->context);
-		int cpu = smp_processor_id();
+		int cpu = get_cpu();
 
 		page &= PAGE_MASK;
 		if (mm == current->active_mm &&
@@ -935,6 +951,8 @@ void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page)
 
 	local_flush_and_out:
 		__flush_tlb_page(ctx, page, SECONDARY_CONTEXT);
+
+		put_cpu();
 	}
 }
 
@@ -1108,11 +1126,6 @@ void __init smp_tick_init(void)
 	boot_cpu_id = hard_smp_processor_id();
 	current_tick_offset = timer_tick_offset;
 
-	if (boot_cpu_id >= NR_CPUS) {
-		prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
-		prom_halt();
-	}
-
 	cpu_set(boot_cpu_id, cpu_online_map);
 	prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1;
 }
@@ -1254,6 +1267,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 
 void __devinit smp_prepare_boot_cpu(void)
 {
+	if (hard_smp_processor_id() >= NR_CPUS) {
+		prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
+		prom_halt();
+	}
+
 	current_thread_info()->cpu = hard_smp_processor_id();
 	cpu_set(smp_processor_id(), cpu_online_map);
 	cpu_set(smp_processor_id(), phys_cpu_present_map);
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 6501896d9..10c782137 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -106,6 +106,7 @@ extern void _do_read_lock(rwlock_t *rw, char *str);
 extern void _do_read_unlock(rwlock_t *rw, char *str);
 extern void _do_write_lock(rwlock_t *rw, char *str);
 extern void _do_write_unlock(rwlock_t *rw);
+extern int _do_write_trylock(rwlock_t *rw, char *str);
 #endif
 
 extern unsigned long phys_base;
@@ -133,6 +134,8 @@ EXPORT_SYMBOL(__read_unlock);
 EXPORT_SYMBOL(__write_lock);
 EXPORT_SYMBOL(__write_unlock);
 EXPORT_SYMBOL(__write_trylock);
+/* Out of line spin-locking implementation. */
+EXPORT_SYMBOL(_raw_spin_lock_flags);
 #endif
 
 /* Hard IRQ locking */
@@ -156,6 +159,7 @@ EXPORT_SYMBOL(_do_read_lock);
 EXPORT_SYMBOL(_do_read_unlock);
 EXPORT_SYMBOL(_do_write_lock);
 EXPORT_SYMBOL(_do_write_unlock);
+EXPORT_SYMBOL(_do_write_trylock);
 #endif
 
 EXPORT_SYMBOL(smp_call_function);
@@ -185,6 +189,11 @@ EXPORT_SYMBOL(___test_and_change_bit);
 EXPORT_SYMBOL(___test_and_set_le_bit);
 EXPORT_SYMBOL(___test_and_clear_le_bit);
 
+/* Bit searching */
+EXPORT_SYMBOL(find_next_bit);
+EXPORT_SYMBOL(find_next_zero_bit);
+EXPORT_SYMBOL(find_next_zero_le_bit);
+
 EXPORT_SYMBOL(ivector_table);
 EXPORT_SYMBOL(enable_irq);
 EXPORT_SYMBOL(disable_irq);
diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c
index d4a70bf2e..87c1aeb02 100644
--- a/arch/sparc64/kernel/sunos_ioctl32.c
+++ b/arch/sparc64/kernel/sunos_ioctl32.c
@@ -26,15 +26,6 @@
 #include <linux/compat.h>
 #include <asm/kbio.h>
 
-/* Use this to get at 32-bit user passed pointers. */
-#define A(__x)				\
-({	unsigned long __ret;		\
-	__asm__ ("srl	%0, 0, %0"	\
-		 : "=r" (__ret)		\
-		 : "0" (__x));		\
-	__ret;				\
-})
-
 #define SUNOS_NR_OPEN	256
 
 struct rtentry32 {
@@ -104,10 +95,11 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
 
 	if(cmd == TIOCSETD) {
 		mm_segment_t old_fs = get_fs();
-		int *p, ntty = N_TTY;
+		int __user *p;
+		int ntty = N_TTY;
 		int tmp;
 
-		p = (int *)A(arg);
+		p = (int __user *) (unsigned long) arg;
 		ret = -EFAULT;
 		if(get_user(tmp, p))
 			goto out;
@@ -237,10 +229,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
 
 	/* Non posix grp */
 	case _IOW('t', 118, int): {
-		int oldval, newval, *ptr;
+		int oldval, newval, __user *ptr;
 
 		cmd = TIOCSPGRP;
-		ptr = (int *) A(arg);
+		ptr = (int __user *) (unsigned long) arg;
 		ret = -EFAULT;
 		if(get_user(oldval, ptr))
 			goto out;
@@ -256,10 +248,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
 	}
 
 	case _IOR('t', 119, int): {
-		int oldval, newval, *ptr;
+		int oldval, newval, __user *ptr;
 
 		cmd = TIOCGPGRP;
-		ptr = (int *) A(arg);
+		ptr = (int __user *) (unsigned long) arg;
 		ret = -EFAULT;
 		if(get_user(oldval, ptr))
 			goto out;
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index e94284ae9..7a5d4f4e5 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -6,79 +6,142 @@
  * Copyright (C) 1998 Jakub Jelinek   (jj@ultra.linux.cz)
  */
 
+#include <linux/config.h>
 #include <asm/errno.h>
 
 /* NOTE: call as jump breaks return stack, we have to avoid that */
 
 	.text
 
-	.align		32
-	.globl		sys32_mmap
-sys32_mmap:
-	srl		%o4, 0, %o4
-	sethi		%hi(sys_mmap), %g1
-	jmpl		%g1 + %lo(sys_mmap), %g0
-	 srl		%o5, 0, %o5
+#define SIGN1(STUB,SYSCALL,REG1) \
+	.align	32; \
+	.globl	STUB; \
+STUB:	sethi	%hi(SYSCALL), %g1; \
+	jmpl	%g1 + %lo(SYSCALL), %g0; \
+	sra	REG1, 0, REG1
 
-	.align		32
-	.globl		sys32_lseek
-	.globl		sys32_chmod, sys32_mknod
-sys32_lseek:
-	sra		%o1, 0, %o1
-	sethi		%hi(sys_lseek), %g1
-	jmpl		%g1 + %lo(sys_lseek), %g0
-	 nop
-sys32_chmod:
-	sethi		%hi(0xffff), %g2
-	sethi		%hi(sys_chmod), %g1
-	orcc		%g2, %lo(0xffff), %g2
-	jmpl		%g1 + %lo(sys_chmod), %g0
-	 and		%o1, %g2, %o1
-sys32_mknod:
-	sethi		%hi(0xffff), %g2
-	sethi		%hi(sys_mknod), %g1
-	orcc		%g2, %lo(0xffff), %g2
-	jmpl		%g1 + %lo(sys_mknod), %g0
-	 and		%o2, %g2, %o2
+#define SIGN2(STUB,SYSCALL,REG1,REG2) \
+	.align	32; \
+	.globl	STUB; \
+STUB:	sethi	%hi(SYSCALL), %g1; \
+	sra	REG1, 0, REG1; \
+	jmpl	%g1 + %lo(SYSCALL), %g0; \
+	sra	REG2, 0, REG2
 
-	.align		32
-	.globl		sys32_sendto, sys32_recvfrom
-sys32_sendto:
-	sethi		%hi(sys_sendto), %g1
-	jmpl		%g1 + %lo(sys_sendto), %g0
-	 srl		%o4, 0, %o4
-sys32_recvfrom:
-	srl		%o4, 0, %o4
-	sethi		%hi(sys_recvfrom), %g1
-	jmpl		%g1 + %lo(sys_recvfrom), %g0
-	 srl		%o5, 0, %o5
+#define SIGN3(STUB,SYSCALL,REG1,REG2,REG3) \
+	.align	32; \
+	.globl	STUB; \
+STUB:	sra	REG1, 0, REG1; \
+	sethi	%hi(SYSCALL), %g1; \
+	sra	REG2, 0, REG2; \
+	jmpl	%g1 + %lo(SYSCALL), %g0; \
+	sra	REG3, 0, REG3
 
-	.globl		sys32_bdflush
-sys32_bdflush:
-	sethi		%hi(sys_bdflush), %g1
-	jmpl		%g1 + %lo(sys_bdflush), %g0
-	 sra		%o1, 0, %o1
+#define SIGN4(STUB,SYSCALL,REG1,REG2,REG3,REG4) \
+	.align	32; \
+	.globl	STUB; \
+STUB:	sra	REG1, 0, REG1; \
+	sethi	%hi(SYSCALL), %g1; \
+	sra	REG2, 0, REG2; \
+	sra	REG3, 0, REG3; \
+	jmpl	%g1 + %lo(SYSCALL), %g0; \
+	sra	REG4, 0, REG4
+
+SIGN1(sys32_exit, sparc_exit, %o0)
+SIGN1(sys32_exit_group, sys_exit_group, %o0)
+SIGN1(sys32_wait4, compat_sys_wait4, %o2)
+SIGN1(sys32_creat, sys_creat, %o1)
+SIGN1(sys32_mknod, sys_mknod, %o1)
+SIGN1(sys32_perfctr, sys_perfctr, %o0)
+SIGN1(sys32_umount, sys_umount, %o1)
+SIGN1(sys32_signal, sys_signal, %o0)
+SIGN1(sys32_access, sys_access, %o1)
+SIGN1(sys32_msync, sys_msync, %o2)
+SIGN2(sys32_reboot, sys_reboot, %o0, %o1)
+SIGN1(sys32_setitimer, compat_sys_setitimer, %o0)
+SIGN1(sys32_getitimer, compat_sys_getitimer, %o0)
+SIGN1(sys32_sethostname, sys_sethostname, %o1)
+SIGN1(sys32_swapon, sys_swapon, %o1)
+SIGN1(sys32_sigaction, compat_sys_sigaction, %o0)
+SIGN1(sys32_rt_sigaction, compat_sys_rt_sigaction, %o0)
+SIGN1(sys32_sigprocmask, compat_sys_sigprocmask, %o0)
+SIGN1(sys32_rt_sigprocmask, compat_sys_rt_sigprocmask, %o0)
+SIGN2(sys32_rt_sigqueueinfo, compat_sys_rt_sigqueueinfo, %o0, %o1)
+SIGN1(sys32_getrusage, compat_sys_getrusage, %o0)
+SIGN1(sys32_setxattr, sys_setxattr, %o4)
+SIGN1(sys32_lsetxattr, sys_lsetxattr, %o4)
+SIGN1(sys32_fsetxattr, sys_fsetxattr, %o4)
+SIGN1(sys32_fgetxattr, sys_fgetxattr, %o0)
+SIGN1(sys32_flistxattr, sys_flistxattr, %o0)
+SIGN1(sys32_fremovexattr, sys_fremovexattr, %o0)
+SIGN2(sys32_tkill, sys_tkill, %o0, %o1)
+SIGN1(sys32_epoll_create, sys_epoll_create, %o0)
+SIGN3(sys32_epoll_ctl, sys_epoll_ctl, %o0, %o1, %o2)
+SIGN3(sys32_epoll_wait, sys_epoll_wait, %o0, %o2, %o3)
+SIGN1(sys32_readahead, compat_sys_readahead, %o0)
+SIGN2(sys32_fadvise64, compat_sys_fadvise64, %o0, %o4)
+SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5)
+SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1)
+SIGN1(sys32_mlockall, sys_mlockall, %o0)
+SIGN1(sys32_nfsservctl, compat_sys_nfsservctl, %o0)
+SIGN1(sys32_clock_settime, compat_clock_settime, %o1)
+SIGN1(sys32_clock_nanosleep, compat_clock_nanosleep, %o1)
+SIGN1(sys32_timer_settime, compat_timer_settime, %o1)
+SIGN1(sys32_io_submit, compat_sys_io_submit, %o1)
+SIGN1(sys32_mq_open, compat_sys_mq_open, %o1)
+SIGN1(sys32_select, compat_sys_select, %o0)
+SIGN1(sys32_mkdir, sys_mkdir, %o1)
+SIGN3(sys32_futex, compat_sys_futex, %o1, %o2, %o5)
+SIGN1(sys32_sysfs, compat_sys_sysfs, %o0)
+SIGN3(sys32_ipc, compat_sys_ipc, %o1, %o2, %o3)
+SIGN2(sys32_sendfile, compat_sys_sendfile, %o0, %o1)
+SIGN2(sys32_sendfile64, compat_sys_sendfile64, %o0, %o1)
+SIGN1(sys32_prctl, sys_prctl, %o0)
+SIGN1(sys32_sched_rr_get_interval, compat_sys_sched_rr_get_interval, %o0)
+SIGN2(sys32_waitpid, sys_waitpid, %o0, %o2)
+SIGN1(sys32_getgroups, sys_getgroups, %o0)
+SIGN1(sys32_getpgid, sys_getpgid, %o0)
+SIGN2(sys32_getpriority, sys_getpriority, %o0, %o1)
+SIGN1(sys32_getsid, sys_getsid, %o0)
+SIGN2(sys32_kill, sys_kill, %o0, %o1)
+SIGN1(sys32_nice, sys_nice, %o0)
+SIGN1(sys32_lseek, sys_lseek, %o1)
+SIGN2(sys32_open, sparc32_open, %o1, %o2)
+SIGN1(sys32_readlink, sys_readlink, %o2)
+SIGN1(sys32_sched_get_priority_max, sys_sched_get_priority_max, %o0)
+SIGN1(sys32_sched_get_priority_min, sys_sched_get_priority_min, %o0)
+SIGN1(sys32_sched_getparam, sys_sched_getparam, %o0)
+SIGN1(sys32_sched_getscheduler, sys_sched_getscheduler, %o0)
+SIGN1(sys32_sched_setparam, sys_sched_setparam, %o0)
+SIGN2(sys32_sched_setscheduler, sys_sched_setscheduler, %o0, %o1)
+SIGN1(sys32_getdomainname, sys_getdomainname, %o1)
+SIGN1(sys32_setdomainname, sys_setdomainname, %o1)
+SIGN1(sys32_setgroups, sys_setgroups, %o0)
+SIGN2(sys32_setpgid, sys_setpgid, %o0, %o1)
+SIGN3(sys32_setpriority, sys_setpriority, %o0, %o1, %o2)
+SIGN1(sys32_ssetmask, sys_ssetmask, %o0)
+SIGN2(sys32_syslog, sys_syslog, %o0, %o1)
+SIGN1(sys32_umask, sys_umask, %o0)
+SIGN3(sys32_tgkill, sys_tgkill, %o0, %o1, %o2)
+SIGN1(sys32_sendto, sys_sendto, %o0)
+SIGN1(sys32_recvfrom, sys_recvfrom, %o0)
+SIGN3(sys32_socket, sys_socket, %o0, %o1, %o2)
+SIGN2(sys32_connect, sys_connect, %o0, %o2)
+SIGN2(sys32_bind, sys_bind, %o0, %o2)
+SIGN2(sys32_listen, sys_listen, %o0, %o1)
+SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0)
+SIGN1(sys32_sendmsg, compat_sys_sendmsg, %o0)
+SIGN2(sys32_shutdown, sys_shutdown, %o0, %o1)
+SIGN3(sys32_socketpair, sys_socketpair, %o0, %o1, %o2)
+SIGN1(sys32_getpeername, sys_getpeername, %o0)
+SIGN1(sys32_getsockname, sys_getsockname, %o0)
 
-	.align		32
 	.globl		sys32_mmap2
 sys32_mmap2:
-	srl		%o4, 0, %o4
 	sethi		%hi(sys_mmap), %g1
-	srl		%o5, 0, %o5
 	jmpl		%g1 + %lo(sys_mmap), %g0
 	 sllx		%o5, 12, %o5
 
-	.globl		sys32_mq_timedsend
-sys32_mq_timedsend:
-	sethi		%hi(compat_sys_mq_timedsend), %g1
-	jmpl		%g1 + %lo(compat_sys_mq_timedsend), %g0
-	 srl		%o4, 0, %o4
-	.globl		sys32_mq_timedreceive
-sys32_mq_timedreceive:
-	sethi		%hi(compat_sys_mq_timedreceive), %g1
-	jmpl		%g1 + %lo(compat_sys_mq_timedreceive), %g0
-	 srl		%o4, 0, %o4
-
 	.align		32
 	.globl		sys32_socketcall
 sys32_socketcall:	/* %o0=call, %o1=args */
@@ -186,23 +249,23 @@ do_sys_recv: /* sys_recv(int, void *, size_t, unsigned int) */
 	 lduwa		[%o1 + 0x4] %asi, %o1
 	nop
 	nop
-do_sys_sendto: /* sys32_sendto(int, u32, compat_size_t, unsigned int, u32, int) */
+do_sys_sendto: /* sys_sendto(int, u32, compat_size_t, unsigned int, u32, int) */
 	ldswa		[%o1 + 0x0] %asi, %o0
-	sethi		%hi(sys32_sendto), %g1
+	sethi		%hi(sys_sendto), %g1
 	lduwa		[%o1 + 0x8] %asi, %o2
 	lduwa		[%o1 + 0xc] %asi, %o3
 	lduwa		[%o1 + 0x10] %asi, %o4
 	ldswa		[%o1 + 0x14] %asi, %o5
-	jmpl		%g1 + %lo(sys32_sendto), %g0
+	jmpl		%g1 + %lo(sys_sendto), %g0
 	 lduwa		[%o1 + 0x4] %asi, %o1
-do_sys_recvfrom: /* sys32_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */
+do_sys_recvfrom: /* sys_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */
 	ldswa		[%o1 + 0x0] %asi, %o0
-	sethi		%hi(sys32_recvfrom), %g1
+	sethi		%hi(sys_recvfrom), %g1
 	lduwa		[%o1 + 0x8] %asi, %o2
 	lduwa		[%o1 + 0xc] %asi, %o3
 	lduwa		[%o1 + 0x10] %asi, %o4
 	lduwa		[%o1 + 0x14] %asi, %o5
-	jmpl		%g1 + %lo(sys32_recvfrom), %g0
+	jmpl		%g1 + %lo(sys_recvfrom), %g0
 	 lduwa		[%o1 + 0x4] %asi, %o1
 do_sys_shutdown: /* sys_shutdown(int, int) */
 	ldswa		[%o1 + 0x0] %asi, %o0
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 4c75f6137..5325e41e8 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -179,7 +179,7 @@ asmlinkage unsigned long sparc_brk(unsigned long brk)
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way unix traditionally does this, though.
  */
-asmlinkage int sparc_pipe(struct pt_regs *regs)
+asmlinkage long sparc_pipe(struct pt_regs *regs)
 {
 	int fd[2];
 	int error;
@@ -199,22 +199,22 @@ out:
  * This is really horribly ugly.
  */
 
-asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long third, void *ptr, long fifth)
+asmlinkage long sys_ipc(unsigned int call, int first, int second, unsigned long third, void __user *ptr, long fifth)
 {
 	int err;
 
 	/* No need for backward compatibility. We can start fresh... */
-
-	if (call <= SEMCTL)
+	if (call <= SEMCTL) {
 		switch (call) {
 		case SEMOP:
-			err = sys_semtimedop (first, (struct sembuf *)ptr, second, NULL);
+			err = sys_semtimedop(first, ptr, second, NULL);
 			goto out;
 		case SEMTIMEDOP:
-			err = sys_semtimedop (first, (struct sembuf *)ptr, second, (const struct timespec *) fifth);
+			err = sys_semtimedop(first, ptr, second,
+				(const struct timespec __user *) fifth);
 			goto out;
 		case SEMGET:
-			err = sys_semget (first, second, (int)third);
+			err = sys_semget(first, second, (int)third);
 			goto out;
 		case SEMCTL: {
 			union semun fourth;
@@ -222,79 +222,87 @@ asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
 			if (!ptr)
 				goto out;
 			err = -EFAULT;
-			if(get_user(fourth.__pad, (void **)ptr))
+			if (get_user(fourth.__pad,
+				     (void __user * __user *) ptr))
 				goto out;
-			err = sys_semctl (first, second | IPC_64, (int)third, fourth);
+			err = sys_semctl(first, second | IPC_64,
+					 (int)third, fourth);
 			goto out;
-			}
+		}
 		default:
 			err = -ENOSYS;
 			goto out;
-		}
-	if (call <= MSGCTL) 
+		};
+	}
+	if (call <= MSGCTL) {
 		switch (call) {
 		case MSGSND:
-			err = sys_msgsnd (first, (struct msgbuf *) ptr, 
-					  second, (int)third);
+			err = sys_msgsnd(first, ptr, second, (int)third);
 			goto out;
 		case MSGRCV:
-			err = sys_msgrcv (first, (struct msgbuf *) ptr, second, fifth, (int)third);
+			err = sys_msgrcv(first, ptr, second, fifth,
+					 (int)third);
 			goto out;
 		case MSGGET:
-			err = sys_msgget ((key_t) first, second);
+			err = sys_msgget((key_t) first, second);
 			goto out;
 		case MSGCTL:
-			err = sys_msgctl (first, second | IPC_64, (struct msqid_ds *) ptr);
+			err = sys_msgctl(first, second | IPC_64, ptr);
 			goto out;
 		default:
 			err = -ENOSYS;
 			goto out;
-		}
-	if (call <= SHMCTL) 
+		};
+	}
+	if (call <= SHMCTL) {
 		switch (call) {
 		case SHMAT: {
 			ulong raddr;
-			err = do_shmat (first, (char *) ptr, second, &raddr);
+			err = do_shmat(first, ptr, second, &raddr);
 			if (!err) {
-				if (put_user(raddr, (ulong __user *) third))
+				if (put_user(raddr,
+					     (ulong __user *) third))
 					err = -EFAULT;
 			}
 			goto out;
 		}
 		case SHMDT:
-			err = sys_shmdt ((char *)ptr);
+			err = sys_shmdt(ptr);
 			goto out;
 		case SHMGET:
-			err = sys_shmget (first, second, (int)third);
+			err = sys_shmget(first, second, (int)third);
 			goto out;
 		case SHMCTL:
-			err = sys_shmctl (first, second | IPC_64, (struct shmid_ds *) ptr);
+			err = sys_shmctl(first, second | IPC_64, ptr);
 			goto out;
 		default:
 			err = -ENOSYS;
 			goto out;
-		}
-	else
+		};
+	} else {
 		err = -ENOSYS;
+	}
 out:
 	return err;
 }
 
-asmlinkage int sparc64_newuname(struct new_utsname __user *name)
+asmlinkage long sparc64_newuname(struct new_utsname __user *name)
 {
 	int ret = sys_newuname(name);
 	
 	if (current->personality == PER_LINUX32 && !ret) {
-		ret = copy_to_user(name->machine, "sparc\0\0", 8) ? -EFAULT : 0;
+		ret = (copy_to_user(name->machine, "sparc\0\0", 8)
+		       ? -EFAULT : 0);
 	}
 	return ret;
 }
 
-asmlinkage int sparc64_personality(unsigned long personality)
+asmlinkage long sparc64_personality(unsigned long personality)
 {
 	int ret;
 
-	if (current->personality == PER_LINUX32 && personality == PER_LINUX)
+	if (current->personality == PER_LINUX32 &&
+	    personality == PER_LINUX)
 		personality = PER_LINUX32;
 	ret = sys_personality(personality);
 	if (ret == PER_LINUX32)
@@ -408,8 +416,7 @@ out:
 }
 
 /* we come to here via sys_nis_syscall so it can setup the regs argument */
-asmlinkage unsigned long
-c_sys_nis_syscall (struct pt_regs *regs)
+asmlinkage unsigned long c_sys_nis_syscall(struct pt_regs *regs)
 {
 	static int count;
 	
@@ -427,8 +434,7 @@ c_sys_nis_syscall (struct pt_regs *regs)
 
 /* #define DEBUG_SPARC_BREAKPOINT */
 
-asmlinkage void
-sparc_breakpoint (struct pt_regs *regs)
+asmlinkage void sparc_breakpoint(struct pt_regs *regs)
 {
 	siginfo_t info;
 
@@ -452,7 +458,7 @@ sparc_breakpoint (struct pt_regs *regs)
 
 extern void check_pending(int signum);
 
-asmlinkage int sys_getdomainname(char __user *name, int len)
+asmlinkage long sys_getdomainname(char __user *name, int len)
 {
         int nlen;
 	int err = -EFAULT;
@@ -473,7 +479,7 @@ done:
 	return err;
 }
 
-asmlinkage int solaris_syscall(struct pt_regs *regs)
+asmlinkage long solaris_syscall(struct pt_regs *regs)
 {
 	static int count;
 
@@ -493,7 +499,7 @@ asmlinkage int solaris_syscall(struct pt_regs *regs)
 }
 
 #ifndef CONFIG_SUNOS_EMUL
-asmlinkage int sunos_syscall(struct pt_regs *regs)
+asmlinkage long sunos_syscall(struct pt_regs *regs)
 {
 	static int count;
 
@@ -511,11 +517,11 @@ asmlinkage int sunos_syscall(struct pt_regs *regs)
 }
 #endif
 
-asmlinkage int sys_utrap_install(utrap_entry_t type,
-				 utrap_handler_t new_p,
-				 utrap_handler_t new_d,
-				 utrap_handler_t __user *old_p,
-				 utrap_handler_t __user *old_d)
+asmlinkage long sys_utrap_install(utrap_entry_t type,
+				  utrap_handler_t new_p,
+				  utrap_handler_t new_d,
+				  utrap_handler_t __user *old_p,
+				  utrap_handler_t __user *old_d)
 {
 	if (type < UT_INSTRUCTION_EXCEPTION || type > UT_TRAP_INSTRUCTION_31)
 		return -EINVAL;
@@ -582,12 +588,11 @@ long sparc_memory_ordering(unsigned long model, struct pt_regs *regs)
 	return 0;
 }
 
-asmlinkage long
-sys_rt_sigaction(int sig,
-		const struct sigaction __user *act,
-		struct sigaction __user *oact,
-		void __user *restorer,
-		size_t sigsetsize)
+asmlinkage long sys_rt_sigaction(int sig,
+				 const struct sigaction __user *act,
+				 struct sigaction __user *oact,
+				 void __user *restorer,
+				 size_t sigsetsize)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -615,8 +620,7 @@ sys_rt_sigaction(int sig,
 /* Invoked by rtrap code to update performance counters in
  * user space.
  */
-asmlinkage void
-update_perfctrs(void)
+asmlinkage void update_perfctrs(void)
 {
 	unsigned long pic, tmp;
 
@@ -628,16 +632,15 @@ update_perfctrs(void)
 	reset_pic();
 }
 
-asmlinkage int
-sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long arg2)
+asmlinkage long sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long arg2)
 {
 	int err = 0;
 
 	switch(opcode) {
 	case PERFCTR_ON:
 		current_thread_info()->pcr_reg = arg2;
-		current_thread_info()->user_cntd0 = (u64 *) arg0;
-		current_thread_info()->user_cntd1 = (u64 *) arg1;
+		current_thread_info()->user_cntd0 = (u64 __user *) arg0;
+		current_thread_info()->user_cntd1 = (u64 __user *) arg1;
 		current_thread_info()->kernel_cntd0 =
 			current_thread_info()->kernel_cntd1 = 0;
 		write_pcr(arg2);
@@ -684,7 +687,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
 		break;
 
 	case PERFCTR_SETPCR: {
-		u64 *user_pcr = (u64 *)arg0;
+		u64 __user *user_pcr = (u64 __user *)arg0;
+
 		if (!test_thread_flag(TIF_PERFCTR)) {
 			err = -EINVAL;
 			break;
@@ -698,7 +702,8 @@ sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
 	}
 
 	case PERFCTR_GETPCR: {
-		u64 *user_pcr = (u64 *)arg0;
+		u64 __user *user_pcr = (u64 __user *)arg0;
+
 		if (!test_thread_flag(TIF_PERFCTR)) {
 			err = -EINVAL;
 			break;
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index ff7f7d1d5..e55f9e494 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -62,37 +62,12 @@
 #include <asm/semaphore.h>
 #include <asm/mmu_context.h>
 
-/* Use this to get at 32-bit user passed pointers. */
-/* Things to consider: the low-level assembly stub does
-   srl x, 0, x for first four arguments, so if you have
-   pointer to something in the first four arguments, just
-   declare it as a pointer, not u32. On the other side, 
-   arguments from 5th onwards should be declared as u32
-   for pointers, and need AA() around each usage.
-   A() macro should be used for places where you e.g.
-   have some internal variable u32 and just want to get
-   rid of a compiler warning. AA() has to be used in
-   places where you want to convert a function argument
-   to 32bit pointer or when you e.g. access pt_regs
-   structure and want to consider 32bit registers only.
-   -jj
- */
-#define A(__x) ((unsigned long)(__x))
-#define AA(__x)				\
-({	unsigned long __ret;		\
-	__asm__ ("srl	%0, 0, %0"	\
-		 : "=r" (__ret)		\
-		 : "0" (__x));		\
-	__ret;				\
-})
-
- 
-asmlinkage long sys32_chown16(const char * filename, u16 user, u16 group)
+asmlinkage long sys32_chown16(const char __user * filename, u16 user, u16 group)
 {
 	return sys_chown(filename, low2highuid(user), low2highgid(group));
 }
 
-asmlinkage long sys32_lchown16(const char * filename, u16 user, u16 group)
+asmlinkage long sys32_lchown16(const char __user * filename, u16 user, u16 group)
 {
 	return sys_lchown(filename, low2highuid(user), low2highgid(group));
 }
@@ -128,7 +103,7 @@ asmlinkage long sys32_setresuid16(u16 ruid, u16 euid, u16 suid)
 		low2highuid(suid));
 }
 
-asmlinkage long sys32_getresuid16(u16 *ruid, u16 *euid, u16 *suid)
+asmlinkage long sys32_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid)
 {
 	int retval;
 
@@ -145,7 +120,7 @@ asmlinkage long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid)
 		low2highgid(sgid));
 }
 
-asmlinkage long sys32_getresgid16(u16 *rgid, u16 *egid, u16 *sgid)
+asmlinkage long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid)
 {
 	int retval;
 
@@ -166,7 +141,7 @@ asmlinkage long sys32_setfsgid16(u16 gid)
 	return sys_setfsgid((gid_t)gid);
 }
 
-static int groups16_to_user(u16 *grouplist, struct group_info *group_info)
+static int groups16_to_user(u16 __user *grouplist, struct group_info *group_info)
 {
 	int i;
 	u16 group;
@@ -180,7 +155,7 @@ static int groups16_to_user(u16 *grouplist, struct group_info *group_info)
 	return 0;
 }
 
-static int groups16_from_user(struct group_info *group_info, u16 *grouplist)
+static int groups16_from_user(struct group_info *group_info, u16 __user *grouplist)
 {
 	int i;
 	u16 group;
@@ -194,7 +169,7 @@ static int groups16_from_user(struct group_info *group_info, u16 *grouplist)
 	return 0;
 }
 
-asmlinkage long sys32_getgroups16(int gidsetsize, u16 *grouplist)
+asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist)
 {
 	int i;
 
@@ -218,7 +193,7 @@ out:
 	return i;
 }
 
-asmlinkage long sys32_setgroups16(int gidsetsize, u16 *grouplist)
+asmlinkage long sys32_setgroups16(int gidsetsize, u16 __user *grouplist)
 {
 	struct group_info *group_info;
 	int retval;
@@ -265,14 +240,14 @@ asmlinkage long sys32_getegid16(void)
 
 /* 32-bit timeval and related flotsam.  */
 
-static long get_tv32(struct timeval *o, struct compat_timeval *i)
+static long get_tv32(struct timeval *o, struct compat_timeval __user *i)
 {
 	return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) ||
 		(__get_user(o->tv_sec, &i->tv_sec) |
 		 __get_user(o->tv_usec, &i->tv_usec)));
 }
 
-static inline long put_tv32(struct compat_timeval *o, struct timeval *i)
+static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
 {
 	return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
 		(__put_user(i->tv_sec, &o->tv_sec) |
@@ -281,8 +256,7 @@ static inline long put_tv32(struct compat_timeval *o, struct timeval *i)
 
 struct msgbuf32 { s32 mtype; char mtext[1]; };
 
-struct ipc_perm32
-{
+struct ipc_perm32 {
 	key_t    	  key;
         compat_uid_t  uid;
         compat_gid_t  gid;
@@ -383,21 +357,22 @@ struct shmid64_ds32 {
  * This is really horribly ugly.
  */
 #define IPCOP_MASK(__x)	(1UL << ((__x)&~IPC_64))
-static int do_sys32_semctl(int first, int second, int third, void *uptr)
+static int do_sys32_semctl(int first, int second, int third,
+			   compat_uptr_t __user *uptr)
 {
 	union semun fourth;
-	u32 pad;
+	compat_uptr_t pad;
 	int err = -EINVAL;
 
 	if (!uptr)
 		goto out;
 	err = -EFAULT;
-	if (get_user (pad, (u32 *)uptr))
+	if (get_user(pad, uptr))
 		goto out;
 	if ((third & ~IPC_64) == SETVAL)
 		fourth.val = (int)pad;
 	else
-		fourth.__pad = (void *)A(pad);
+		fourth.__pad = compat_ptr(pad);
 	if (IPCOP_MASK (third) &
 	    (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (SEM_INFO) | IPCOP_MASK (GETVAL) |
 	     IPCOP_MASK (GETPID) | IPCOP_MASK (GETNCNT) | IPCOP_MASK (GETZCNT) |
@@ -405,7 +380,7 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr)
 		err = sys_semctl (first, second, third, fourth);
 	} else if (third & IPC_64) {
 		struct semid64_ds s;
-		struct semid64_ds32 *usp = (struct semid64_ds32 *)A(pad);
+		struct semid64_ds32 __user *usp = compat_ptr(pad);
 		mm_segment_t old_fs;
 		int need_back_translation;
 
@@ -415,13 +390,13 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr)
 			err |= __get_user (s.sem_perm.mode, &usp->sem_perm.mode);
 			if (err)
 				goto out;
-			fourth.__pad = &s;
+			fourth.__pad = (void __user *) &s;
 		}
 		need_back_translation =
 			(IPCOP_MASK (third) &
 			 (IPCOP_MASK (SEM_STAT) | IPCOP_MASK (IPC_STAT))) != 0;
 		if (need_back_translation)
-			fourth.__pad = &s;
+			fourth.__pad = (void __user *) &s;
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
 		err = sys_semctl (first, second, third, fourth);
@@ -433,7 +408,7 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr)
 		}
 	} else {
 		struct semid_ds s;
-		struct semid_ds32 *usp = (struct semid_ds32 *)A(pad);
+		struct semid_ds32 __user *usp = compat_ptr(pad);
 		mm_segment_t old_fs;
 		int need_back_translation;
 
@@ -443,13 +418,13 @@ static int do_sys32_semctl(int first, int second, int third, void *uptr)
 			err |= __get_user (s.sem_perm.mode, &usp->sem_perm.mode);
 			if (err)
 				goto out;
-			fourth.__pad = &s;
+			fourth.__pad = (void __user *) &s;
 		}
 		need_back_translation =
 			(IPCOP_MASK (third) &
 			 (IPCOP_MASK (SEM_STAT) | IPCOP_MASK (IPC_STAT))) != 0;
 		if (need_back_translation)
-			fourth.__pad = &s;
+			fourth.__pad = (void __user *) &s;
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
 		err = sys_semctl (first, second, third, fourth);
@@ -472,13 +447,15 @@ out:
 	return err;
 }
 
-static int do_sys32_msgsnd (int first, int second, int third, void *uptr)
+static int do_sys32_msgsnd(int first, int second, int third,
+			   void __user *uptr)
 {
-	struct msgbuf *p = kmalloc (second + sizeof (struct msgbuf), GFP_USER);
-	struct msgbuf32 *up = (struct msgbuf32 *)uptr;
+	struct msgbuf32 __user *up = uptr;
+	struct msgbuf *p;
 	mm_segment_t old_fs;
 	int err;
 
+	p = kmalloc(second + sizeof (struct msgbuf), GFP_USER);
 	if (!p)
 		return -ENOMEM;
 	err = -EFAULT;
@@ -487,45 +464,48 @@ static int do_sys32_msgsnd (int first, int second, int third, void *uptr)
 		goto out;
 	old_fs = get_fs ();
 	set_fs (KERNEL_DS);
-	err = sys_msgsnd (first, p, second, third);
+	err = sys_msgsnd (first, (struct msgbuf __user *) p,
+			  second, third);
 	set_fs (old_fs);
 out:
 	kfree (p);
 	return err;
 }
 
-static int do_sys32_msgrcv (int first, int second, int msgtyp, int third,
-			    int version, void *uptr)
+static int do_sys32_msgrcv(int first, int second, int msgtyp, int third,
+			   int version, void __user *uptr)
 {
-	struct msgbuf32 *up;
+	struct msgbuf32 __user *up;
 	struct msgbuf *p;
 	mm_segment_t old_fs;
 	int err;
 
 	if (!version) {
-		struct ipc_kludge *uipck = (struct ipc_kludge *)uptr;
+		struct ipc_kludge __user *uipck = uptr;
 		struct ipc_kludge ipck;
 
 		err = -EINVAL;
 		if (!uptr)
 			goto out;
 		err = -EFAULT;
-		if (copy_from_user (&ipck, uipck, sizeof (struct ipc_kludge)))
+		if (copy_from_user (&ipck, uipck,
+				    sizeof (struct ipc_kludge)))
 			goto out;
-		uptr = (void *)A(ipck.msgp);
+		uptr = compat_ptr(ipck.msgp);
 		msgtyp = ipck.msgtyp;
 	}
 	err = -ENOMEM;
-	p = kmalloc (second + sizeof (struct msgbuf), GFP_USER);
+	p = kmalloc(second + sizeof (struct msgbuf), GFP_USER);
 	if (!p)
 		goto out;
 	old_fs = get_fs ();
 	set_fs (KERNEL_DS);
-	err = sys_msgrcv (first, p, second, msgtyp, third);
+	err = sys_msgrcv (first, (struct msgbuf __user *) p, second,
+			  msgtyp, third);
 	set_fs (old_fs);
 	if (err < 0)
 		goto free_then_out;
-	up = (struct msgbuf32 *)uptr;
+	up = uptr;
 	if (put_user (p->mtype, &up->mtype) ||
 	    __copy_to_user (&up->mtext, p->mtext, err))
 		err = -EFAULT;
@@ -535,37 +515,46 @@ out:
 	return err;
 }
 
-static int do_sys32_msgctl (int first, int second, void *uptr)
+static int do_sys32_msgctl(int first, int second, void __user *uptr)
 {
 	int err;
 
 	if (IPCOP_MASK (second) &
 	    (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (MSG_INFO) |
 	     IPCOP_MASK (IPC_RMID))) {
-		err = sys_msgctl (first, second, (struct msqid_ds *)uptr);
+		err = sys_msgctl (first, second, uptr);
 	} else if (second & IPC_64) {
 		struct msqid64_ds m;
-		struct msqid64_ds32 *up = (struct msqid64_ds32 *)uptr;
+		struct msqid64_ds32 __user *up = uptr;
 		mm_segment_t old_fs;
 
 		if (second == (IPC_SET|IPC_64)) {
-			err = get_user (m.msg_perm.uid, &up->msg_perm.uid);
-			err |= __get_user (m.msg_perm.gid, &up->msg_perm.gid);
-			err |= __get_user (m.msg_perm.mode, &up->msg_perm.mode);
-			err |= __get_user (m.msg_qbytes, &up->msg_qbytes);
+			err = get_user (m.msg_perm.uid,
+					&up->msg_perm.uid);
+			err |= __get_user (m.msg_perm.gid,
+					   &up->msg_perm.gid);
+			err |= __get_user (m.msg_perm.mode,
+					   &up->msg_perm.mode);
+			err |= __get_user (m.msg_qbytes,
+					   &up->msg_qbytes);
 			if (err)
 				goto out;
 		}
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_msgctl (first, second, (struct msqid_ds *)&m);
+		err = sys_msgctl(first, second,
+				 (struct msqid_ds __user *)&m);
 		set_fs (old_fs);
 		if (IPCOP_MASK (second) &
 		    (IPCOP_MASK (MSG_STAT) | IPCOP_MASK (IPC_STAT))) {
-			int err2 = copy_to_user(&up->msg_perm, &m.msg_perm, sizeof(struct ipc64_perm) + 3*sizeof(time_t));
-			err2 |= __put_user (m.msg_cbytes, &up->msg_cbytes);
+			int err2 = copy_to_user(&up->msg_perm,
+						&m.msg_perm,
+						(sizeof(struct ipc64_perm) + 3*sizeof(time_t)));
+			err2 |= __put_user (m.msg_cbytes,
+					    &up->msg_cbytes);
 			err2 |= __put_user (m.msg_qnum, &up->msg_qnum);
-			err2 |= __put_user (m.msg_qbytes, &up->msg_qbytes);
+			err2 |= __put_user (m.msg_qbytes,
+					    &up->msg_qbytes);
 			err2 |= __put_user (m.msg_lspid, &up->msg_lspid);
 			err2 |= __put_user (m.msg_lrpid, &up->msg_lrpid);
 			if (err2)
@@ -573,38 +562,52 @@ static int do_sys32_msgctl (int first, int second, void *uptr)
 		}
 	} else {
 		struct msqid_ds m;
-		struct msqid_ds32 *up = (struct msqid_ds32 *)uptr;
+		struct msqid_ds32 __user *up = uptr;
 		mm_segment_t old_fs;
 
 		if (second == IPC_SET) {
-			err = get_user (m.msg_perm.uid, &up->msg_perm.uid);
-			err |= __get_user (m.msg_perm.gid, &up->msg_perm.gid);
-			err |= __get_user (m.msg_perm.mode, &up->msg_perm.mode);
-			err |= __get_user (m.msg_qbytes, &up->msg_qbytes);
+			err = get_user(m.msg_perm.uid,
+				       &up->msg_perm.uid);
+			err |= __get_user(m.msg_perm.gid,
+					  &up->msg_perm.gid);
+			err |= __get_user(m.msg_perm.mode,
+					  &up->msg_perm.mode);
+			err |= __get_user(m.msg_qbytes,
+					  &up->msg_qbytes);
 			if (err)
 				goto out;
 		}
 		old_fs = get_fs ();
 		set_fs (KERNEL_DS);
-		err = sys_msgctl (first, second, &m);
+		err = sys_msgctl(first, second,
+				 (struct msqid_ds __user *) &m);
 		set_fs (old_fs);
 		if (IPCOP_MASK (second) &
 		    (IPCOP_MASK (MSG_STAT) | IPCOP_MASK (IPC_STAT))) {
-			int err2 = put_user (m.msg_perm.key, &up->msg_perm.key);
-			err2 |= __put_user (high2lowuid(m.msg_perm.uid), &up->msg_perm.uid);
-			err2 |= __put_user (high2lowgid(m.msg_perm.gid), &up->msg_perm.gid);
-			err2 |= __put_user (high2lowuid(m.msg_perm.cuid), &up->msg_perm.cuid);
-			err2 |= __put_user (high2lowgid(m.msg_perm.cgid), &up->msg_perm.cgid);
-			err2 |= __put_user (m.msg_perm.mode, &up->msg_perm.mode);
-			err2 |= __put_user (m.msg_perm.seq, &up->msg_perm.seq);
-			err2 |= __put_user (m.msg_stime, &up->msg_stime);
-			err2 |= __put_user (m.msg_rtime, &up->msg_rtime);
-			err2 |= __put_user (m.msg_ctime, &up->msg_ctime);
-			err2 |= __put_user (m.msg_cbytes, &up->msg_cbytes);
-			err2 |= __put_user (m.msg_qnum, &up->msg_qnum);
-			err2 |= __put_user (m.msg_qbytes, &up->msg_qbytes);
-			err2 |= __put_user (m.msg_lspid, &up->msg_lspid);
-			err2 |= __put_user (m.msg_lrpid, &up->msg_lrpid);
+			int err2 = put_user(m.msg_perm.key,
+					    &up->msg_perm.key);
+			err2 |= __put_user(high2lowuid(m.msg_perm.uid),
+					   &up->msg_perm.uid);
+			err2 |= __put_user(high2lowgid(m.msg_perm.gid),
+					   &up->msg_perm.gid);
+			err2 |= __put_user(high2lowuid(m.msg_perm.cuid),
+					   &up->msg_perm.cuid);
+			err2 |= __put_user(high2lowgid(m.msg_perm.cgid),
+					   &up->msg_perm.cgid);
+			err2 |= __put_user(m.msg_perm.mode,
+					   &up->msg_perm.mode);
+			err2 |= __put_user(m.msg_perm.seq,
+					   &up->msg_perm.seq);
+			err2 |= __put_user(m.msg_stime, &up->msg_stime);
+			err2 |= __put_user(m.msg_rtime, &up->msg_rtime);
+			err2 |= __put_user(m.msg_ctime, &up->msg_ctime);
+			err2 |= __put_user(m.msg_cbytes,
+					   &up->msg_cbytes);
+			err2 |= __put_user(m.msg_qnum, &up->msg_qnum);
+			err2 |= __put_user(m.msg_qbytes,
+					   &up->msg_qbytes);
+			err2 |= __put_user(m.msg_lspid, &up->msg_lspid);
+			err2 |= __put_user(m.msg_lrpid, &up->msg_lrpid);
 			if (err2)
 				err = -EFAULT;
 		}
@@ -614,10 +617,10 @@ out:
 	return err;
 }
 
-static int do_sys32_shmat (int first, int second, int third, int version, void *uptr)
+static int do_sys32_shmat (int first, int second, int third, int version, void __user *uptr)
 {
 	unsigned long raddr;
-	u32 *uaddr = (u32 *)A((u32)third);
+	u32 __user *uaddr = compat_ptr((compat_uptr_t)third);
 	int err = -EINVAL;
 
 	if (version == 1)
@@ -630,63 +633,75 @@ out:
 	return err;
 }
 
-static int do_sys32_shmctl (int first, int second, void *uptr)
+static int do_sys32_shmctl(int first, int second, void __user *uptr)
 {
 	int err;
 
 	if (IPCOP_MASK (second) &
-	    (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (SHM_LOCK) | IPCOP_MASK (SHM_UNLOCK) |
-	     IPCOP_MASK (IPC_RMID))) {
-		if (second == (IPC_INFO|IPC_64))
-			second = IPC_INFO; /* So that we don't have to translate it */
-		err = sys_shmctl (first, second, (struct shmid_ds *)uptr);
+	    (IPCOP_MASK (IPC_INFO) | IPCOP_MASK (SHM_LOCK) |
+	     IPCOP_MASK (SHM_UNLOCK) | IPCOP_MASK (IPC_RMID))) {
+		if (second == (IPC_INFO|IPC_64)) {
+			/* So that we don't have to translate it */
+			second = IPC_INFO;
+		}
+		err = sys_shmctl(first, second, uptr);
 	} else if ((second & IPC_64) && second != (SHM_INFO|IPC_64)) {
 		struct shmid64_ds s;
-		struct shmid64_ds32 *up = (struct shmid64_ds32 *)uptr;
+		struct shmid64_ds32 __user *up = uptr;
 		mm_segment_t old_fs;
 
 		if (second == (IPC_SET|IPC_64)) {
-			err = get_user (s.shm_perm.uid, &up->shm_perm.uid);
-			err |= __get_user (s.shm_perm.gid, &up->shm_perm.gid);
-			err |= __get_user (s.shm_perm.mode, &up->shm_perm.mode);
+			err = get_user(s.shm_perm.uid,
+				       &up->shm_perm.uid);
+			err |= __get_user(s.shm_perm.gid,
+					  &up->shm_perm.gid);
+			err |= __get_user(s.shm_perm.mode,
+					  &up->shm_perm.mode);
 			if (err)
 				goto out;
 		}
-		old_fs = get_fs ();
-		set_fs (KERNEL_DS);
-		err = sys_shmctl (first, second, (struct shmid_ds *)&s);
-		set_fs (old_fs);
+		old_fs = get_fs();
+		set_fs(KERNEL_DS);
+		err = sys_shmctl(first, second,
+				 (struct shmid_ds __user *)&s);
+		set_fs(old_fs);
 		if (err < 0)
 			goto out;
 
 		/* Mask it even in this case so it becomes a CSE. */
 		if (IPCOP_MASK (second) &
 		    (IPCOP_MASK (SHM_STAT) | IPCOP_MASK (IPC_STAT))) {
-			int err2 = copy_to_user (&up->shm_perm, &s.shm_perm, sizeof(struct ipc64_perm) + 3*sizeof(time_t));
-			err2 |= __put_user (s.shm_segsz, &up->shm_segsz);
-			err2 |= __put_user (s.shm_nattch, &up->shm_nattch);
-			err2 |= __put_user (s.shm_cpid, &up->shm_cpid);
-			err2 |= __put_user (s.shm_lpid, &up->shm_lpid);
+			int err2 = copy_to_user(&up->shm_perm,
+						&s.shm_perm,
+						sizeof(struct ipc64_perm) + 3*sizeof(time_t));
+			err2 |= __put_user(s.shm_segsz, &up->shm_segsz);
+			err2 |= __put_user(s.shm_nattch,&up->shm_nattch);
+			err2 |= __put_user(s.shm_cpid, &up->shm_cpid);
+			err2 |= __put_user(s.shm_lpid, &up->shm_lpid);
 			if (err2)
 				err = -EFAULT;
 		}
 	} else {
 		struct shmid_ds s;
-		struct shmid_ds32 *up = (struct shmid_ds32 *)uptr;
+		struct shmid_ds32 __user *up = uptr;
 		mm_segment_t old_fs;
 
 		second &= ~IPC_64;
 		if (second == IPC_SET) {
-			err = get_user (s.shm_perm.uid, &up->shm_perm.uid);
-			err |= __get_user (s.shm_perm.gid, &up->shm_perm.gid);
-			err |= __get_user (s.shm_perm.mode, &up->shm_perm.mode);
+			err = get_user(s.shm_perm.uid,
+				       &up->shm_perm.uid);
+			err |= __get_user(s.shm_perm.gid,
+					  &up->shm_perm.gid);
+			err |= __get_user(s.shm_perm.mode,
+					  &up->shm_perm.mode);
 			if (err)
 				goto out;
 		}
-		old_fs = get_fs ();
-		set_fs (KERNEL_DS);
-		err = sys_shmctl (first, second, &s);
-		set_fs (old_fs);
+		old_fs = get_fs();
+		set_fs(KERNEL_DS);
+		err = sys_shmctl(first, second,
+				 (struct shmid_ds __user *) &s);
+		set_fs(old_fs);
 		if (err < 0)
 			goto out;
 
@@ -696,32 +711,46 @@ static int do_sys32_shmctl (int first, int second, void *uptr)
 				int used_ids;
 				u32 shm_tot, shm_rss, shm_swp;
 				u32 swap_attempts, swap_successes;
-			} *uip = (struct shm_info32 *)uptr;
-			struct shm_info *kp = (struct shm_info *)&s;
-			int err2 = put_user (kp->used_ids, &uip->used_ids);
-			err2 |= __put_user (kp->shm_tot, &uip->shm_tot);
-			err2 |= __put_user (kp->shm_rss, &uip->shm_rss);
-			err2 |= __put_user (kp->shm_swp, &uip->shm_swp);
-			err2 |= __put_user (kp->swap_attempts, &uip->swap_attempts);
-			err2 |= __put_user (kp->swap_successes, &uip->swap_successes);
+			};
+			struct shm_info32 __user *uip = uptr;
+			struct shm_info *kp = (struct shm_info *) &s;
+			int err2 = put_user(kp->used_ids,
+					    &uip->used_ids);
+			err2 |= __put_user(kp->shm_tot, &uip->shm_tot);
+			err2 |= __put_user(kp->shm_rss, &uip->shm_rss);
+			err2 |= __put_user(kp->shm_swp, &uip->shm_swp);
+			err2 |= __put_user(kp->swap_attempts,
+					   &uip->swap_attempts);
+			err2 |= __put_user(kp->swap_successes,
+					   &uip->swap_successes);
 			if (err2)
 				err = -EFAULT;
 		} else if (IPCOP_MASK (second) &
-			   (IPCOP_MASK (SHM_STAT) | IPCOP_MASK (IPC_STAT))) {
-			int err2 = put_user (s.shm_perm.key, &up->shm_perm.key);
-			err2 |= __put_user (high2lowuid(s.shm_perm.uid), &up->shm_perm.uid);
-			err2 |= __put_user (high2lowuid(s.shm_perm.gid), &up->shm_perm.gid);
-			err2 |= __put_user (high2lowuid(s.shm_perm.cuid), &up->shm_perm.cuid);
-			err2 |= __put_user (high2lowuid(s.shm_perm.cgid), &up->shm_perm.cgid);
-			err2 |= __put_user (s.shm_perm.mode, &up->shm_perm.mode);
-			err2 |= __put_user (s.shm_perm.seq, &up->shm_perm.seq);
-			err2 |= __put_user (s.shm_atime, &up->shm_atime);
-			err2 |= __put_user (s.shm_dtime, &up->shm_dtime);
-			err2 |= __put_user (s.shm_ctime, &up->shm_ctime);
-			err2 |= __put_user (s.shm_segsz, &up->shm_segsz);
-			err2 |= __put_user (s.shm_nattch, &up->shm_nattch);
-			err2 |= __put_user (s.shm_cpid, &up->shm_cpid);
-			err2 |= __put_user (s.shm_lpid, &up->shm_lpid);
+			   (IPCOP_MASK (SHM_STAT) |
+			    IPCOP_MASK (IPC_STAT))) {
+			int err2;
+
+			err2  = put_user(s.shm_perm.key,
+					 &up->shm_perm.key);
+			err2 |= __put_user(high2lowuid(s.shm_perm.uid),
+					   &up->shm_perm.uid);
+			err2 |= __put_user(high2lowuid(s.shm_perm.gid),
+					   &up->shm_perm.gid);
+			err2 |= __put_user(high2lowuid(s.shm_perm.cuid),
+					   &up->shm_perm.cuid);
+			err2 |= __put_user(high2lowuid(s.shm_perm.cgid),
+					   &up->shm_perm.cgid);
+			err2 |= __put_user(s.shm_perm.mode,
+					   &up->shm_perm.mode);
+			err2 |= __put_user(s.shm_perm.seq,
+					   &up->shm_perm.seq);
+			err2 |= __put_user(s.shm_atime, &up->shm_atime);
+			err2 |= __put_user(s.shm_dtime, &up->shm_dtime);
+			err2 |= __put_user(s.shm_ctime, &up->shm_ctime);
+			err2 |= __put_user(s.shm_segsz, &up->shm_segsz);
+			err2 |= __put_user(s.shm_nattch,&up->shm_nattch);
+			err2 |= __put_user(s.shm_cpid, &up->shm_cpid);
+			err2 |= __put_user(s.shm_lpid, &up->shm_lpid);
 			if (err2)
 				err = -EFAULT;
 		}
@@ -730,12 +759,14 @@ out:
 	return err;
 }
 
-static int sys32_semtimedop(int semid, struct sembuf *tsems, int nsems,
-			    const struct compat_timespec *timeout32)
+static int sys32_semtimedop(int semid, struct sembuf __user *tsems,
+		int nsems,
+		const struct compat_timespec __user *timeout32)
 {
 	struct compat_timespec t32;
-	struct timespec *t64 = compat_alloc_user_space(sizeof(*t64));
+	struct timespec __user *t64;
 
+	t64 = compat_alloc_user_space(sizeof(*t64));
 	if (copy_from_user(&t32, timeout32, sizeof(t32)))
 		return -EFAULT;
 
@@ -746,77 +777,81 @@ static int sys32_semtimedop(int semid, struct sembuf *tsems, int nsems,
 	return sys_semtimedop(semid, tsems, nsems, t64);
 }
 
-asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
+asmlinkage long compat_sys_ipc(u32 call, int first, int second, int third, compat_uptr_t __ptr, u32 fifth)
 {
 	int version, err;
+	void __user *ptr = compat_ptr(__ptr);
 
 	version = call >> 16; /* hack for backward compatibility */
 	call &= 0xffff;
 
-	if (call <= SEMCTL)
+	if (call <= SEMCTL) {
 		switch (call) {
 		case SEMOP:
-			/* struct sembuf is the same on 32 and 64bit :)) */
-			err = sys_semtimedop (first, (struct sembuf *)AA(ptr), second, NULL);
+			/* struct sembuf is the same on 32 and 64 :)) */
+			err = sys_semtimedop (first, ptr, second, NULL);
 			goto out;
 		case SEMTIMEDOP:
-			err = sys32_semtimedop (first, (struct sembuf *)AA(ptr), second, (const struct compat_timespec *) AA(fifth));
+			err = sys32_semtimedop(first, ptr, second,
+					       compat_ptr(fifth));
 		case SEMGET:
-			err = sys_semget (first, second, third);
+			err = sys_semget(first, second, third);
 			goto out;
 		case SEMCTL:
-			err = do_sys32_semctl (first, second, third, (void *)AA(ptr));
+			err = do_sys32_semctl(first, second, third, ptr);
 			goto out;
 		default:
 			err = -ENOSYS;
 			goto out;
 		};
-	if (call <= MSGCTL) 
+	}
+	if (call <= MSGCTL) {
 		switch (call) {
 		case MSGSND:
-			err = do_sys32_msgsnd (first, second, third, (void *)AA(ptr));
+			err = do_sys32_msgsnd(first, second, third, ptr);
 			goto out;
 		case MSGRCV:
-			err = do_sys32_msgrcv (first, second, fifth, third,
-					       version, (void *)AA(ptr));
+			err = do_sys32_msgrcv(first, second, fifth,
+					      third, version, ptr);
 			goto out;
 		case MSGGET:
-			err = sys_msgget ((key_t) first, second);
+			err = sys_msgget((key_t) first, second);
 			goto out;
 		case MSGCTL:
-			err = do_sys32_msgctl (first, second, (void *)AA(ptr));
+			err = do_sys32_msgctl(first, second, ptr);
 			goto out;
 		default:
 			err = -ENOSYS;
 			goto out;
-		}
-	if (call <= SHMCTL) 
+		};
+	}
+	if (call <= SHMCTL) {
 		switch (call) {
 		case SHMAT:
-			err = do_sys32_shmat (first, second, third,
-					      version, (void *)AA(ptr));
+			err = do_sys32_shmat(first, second, third,
+					     version, ptr);
 			goto out;
 		case SHMDT: 
-			err = sys_shmdt ((char *)AA(ptr));
+			err = sys_shmdt(ptr);
 			goto out;
 		case SHMGET:
-			err = sys_shmget (first, second, third);
+			err = sys_shmget(first, second, third);
 			goto out;
 		case SHMCTL:
-			err = do_sys32_shmctl (first, second, (void *)AA(ptr));
+			err = do_sys32_shmctl(first, second, ptr);
 			goto out;
 		default:
 			err = -ENOSYS;
 			goto out;
-		}
-
+		};
+	}
 	err = -ENOSYS;
 
 out:
 	return err;
 }
 
-asmlinkage int sys32_truncate64(const char * path, unsigned long high, unsigned long low)
+asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low)
 {
 	if ((int)high < 0)
 		return -EINVAL;
@@ -824,7 +859,7 @@ asmlinkage int sys32_truncate64(const char * path, unsigned long high, unsigned
 		return sys_truncate(path, (high << 32) | low);
 }
 
-asmlinkage int sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low)
+asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low)
 {
 	if ((int)high < 0)
 		return -EINVAL;
@@ -832,185 +867,9 @@ asmlinkage int sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned l
 		return sys_ftruncate(fd, (high << 32) | low);
 }
 
-typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *);
-typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *);
-
-static long do_readv_writev32(int type, struct file *file,
-			      const struct compat_iovec *vector, u32 count)
-{
-	compat_ssize_t tot_len;
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov=iovstack, *ivp;
-	struct inode *inode;
-	long retval, i;
-	io_fn_t fn;
-	iov_fn_t fnv;
-
-	/*
-	 * SuS says "The readv() function *may* fail if the iovcnt argument
-	 * was less than or equal to 0, or greater than {IOV_MAX}.  Linux has
-	 * traditionally returned zero for zero segments, so...
-	 */
-	retval = 0;
-	if (count == 0)
-		goto out;
-
-	/* First get the "struct iovec" from user memory and
-	 * verify all the pointers
-	 */
-	retval = -EINVAL;
-	if (count > UIO_MAXIOV)
-		goto out;
-	if (!file->f_op)
-		goto out;
-	if (count > UIO_FASTIOV) {
-		retval = -ENOMEM;
-		iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			goto out;
-	}
-	retval = -EFAULT;
-	if (verify_area(VERIFY_READ, vector, sizeof(struct compat_iovec)*count))
-		goto out;
-
-	/*
-	 * Single unix specification:
-	 * We should -EINVAL if an element length is not >= 0 and fitting an
-	 * ssize_t.  The total length is fitting an ssize_t
-	 *
-	 * Be careful here because iov_len is a size_t not an ssize_t
-	 */
-	tot_len = 0;
-	i = count;
-	ivp = iov;
-	retval = -EINVAL;
-	while(i > 0) {
-		compat_ssize_t tmp = tot_len;
-		compat_ssize_t len;
-		u32 buf;
-
-		if (__get_user(len, &vector->iov_len) ||
-		    __get_user(buf, &vector->iov_base)) {
-			retval = -EFAULT;
-			goto out;
-		}
-		if (len < 0)	/* size_t not fitting an ssize_t32 .. */
-			goto out;
-		tot_len += len;
-		if (tot_len < tmp) /* maths overflow on the compat_ssize_t */
-			goto out;
-		ivp->iov_base = (void *)A(buf);
-		ivp->iov_len = (__kernel_size_t) len;
-		vector++;
-		ivp++;
-		i--;
-	}
-	if (tot_len == 0) {
-		retval = 0;
-		goto out;
-	}
-
-	inode = file->f_dentry->d_inode;
-	/* VERIFY_WRITE actually means a read, as we write to user space */
-	retval = locks_verify_area((type == READ
-				    ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
-				   inode, file, file->f_pos, tot_len);
-	if (retval)
-		goto out;
-
-	if (type == READ) {
-		fn = file->f_op->read;
-		fnv = file->f_op->readv;
-	} else {
-		fn = (io_fn_t)file->f_op->write;
-		fnv = file->f_op->writev;
-	}
-	if (fnv) {
-		retval = fnv(file, iov, count, &file->f_pos);
-		goto out;
-	}
-
-	/* Do it by hand, with file-ops */
-	ivp = iov;
-	while (count > 0) {
-		void * base;
-		int len, nr;
-
-		base = ivp->iov_base;
-		len = ivp->iov_len;
-		ivp++;
-		count--;
-
-		nr = fn(file, base, len, &file->f_pos);
-
-		if (nr < 0) {
-			if (!retval)
-				retval = nr;
-			break;
-		}
-		retval += nr;
-		if (nr != len)
-			break;
-	}
-out:
-	if (iov != iovstack)
-		kfree(iov);
-	if ((retval + (type == READ)) > 0)
-		dnotify_parent(file->f_dentry,
-			(type == READ) ? DN_ACCESS : DN_MODIFY);
-
-	return retval;
-}
-
-asmlinkage long sys32_readv(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	int ret;
-
-	file = fget(fd);
-	if(!file)
-		return -EBADF;
-
-	ret = -EBADF;
-	if (!(file->f_mode & FMODE_READ))
-		goto out;
-	ret = -EINVAL;
-	if (!file->f_op || (!file->f_op->readv && !file->f_op->read))
-		goto out;
-
-	ret = do_readv_writev32(READ, file, vector, count);
-
-out:
-	fput(file);
-	return ret;
-}
-
-asmlinkage long sys32_writev(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct file *file;
-	int ret;
-
-	file = fget(fd);
-	if(!file)
-		return -EBADF;
-
-	ret = -EBADF;
-	if (!(file->f_mode & FMODE_WRITE))
-		goto out;
-	ret = -EINVAL;
-	if (!file->f_op || (!file->f_op->writev && !file->f_op->write))
-		goto out;
-
-	ret = do_readv_writev32(WRITE, file, vector, count);
-
-out:
-	fput(file);
-	return ret;
-}
-
 /* readdir & getdents */
 
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 #define ROUND_UP(x) (((x)+sizeof(u32)-1) & ~(sizeof(u32)-1))
 
 struct old_linux_dirent32 {
@@ -1021,7 +880,7 @@ struct old_linux_dirent32 {
 };
 
 struct readdir_callback32 {
-	struct old_linux_dirent32 * dirent;
+	struct old_linux_dirent32 __user * dirent;
 	int count;
 };
 
@@ -1029,7 +888,7 @@ static int fillonedir(void * __buf, const char * name, int namlen,
 		      loff_t offset, ino_t ino, unsigned int d_type)
 {
 	struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf;
-	struct old_linux_dirent32 * dirent;
+	struct old_linux_dirent32 __user * dirent;
 
 	if (buf->count)
 		return -EINVAL;
@@ -1043,7 +902,7 @@ static int fillonedir(void * __buf, const char * name, int namlen,
 	return 0;
 }
 
-asmlinkage int old32_readdir(unsigned int fd, struct old_linux_dirent32 *dirent, unsigned int count)
+asmlinkage long old32_readdir(unsigned int fd, struct old_linux_dirent32 __user *dirent, unsigned int count)
 {
 	int error = -EBADF;
 	struct file * file;
@@ -1075,8 +934,8 @@ struct linux_dirent32 {
 };
 
 struct getdents_callback32 {
-	struct linux_dirent32 * current_dir;
-	struct linux_dirent32 * previous;
+	struct linux_dirent32 __user *current_dir;
+	struct linux_dirent32 __user *previous;
 	int count;
 	int error;
 };
@@ -1084,7 +943,7 @@ struct getdents_callback32 {
 static int filldir(void * __buf, const char * name, int namlen, loff_t offset, ino_t ino,
 		   unsigned int d_type)
 {
-	struct linux_dirent32 * dirent;
+	struct linux_dirent32 __user * dirent;
 	struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
 
@@ -1100,17 +959,17 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, i
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	put_user(d_type, (char *) dirent + reclen - 1);
-	dirent = (void *) dirent + reclen;
+	put_user(d_type, (char __user *) dirent + reclen - 1);
+	dirent = (void __user *) dirent + reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
-asmlinkage int sys32_getdents(unsigned int fd, struct linux_dirent32 *dirent, unsigned int count)
+asmlinkage long sys32_getdents(unsigned int fd, struct linux_dirent32 __user *dirent, unsigned int count)
 {
 	struct file * file;
-	struct linux_dirent32 * lastdirent;
+	struct linux_dirent32 __user *lastdirent;
 	struct getdents_callback32 buf;
 	int error = -EBADF;
 
@@ -1128,7 +987,7 @@ asmlinkage int sys32_getdents(unsigned int fd, struct linux_dirent32 *dirent, un
 		goto out_putf;
 	lastdirent = buf.previous;
 	error = buf.error;
-	if(lastdirent) {
+	if (lastdirent) {
 		put_user(file->f_pos, &lastdirent->d_off);
 		error = count - buf.count;
 	}
@@ -1140,159 +999,7 @@ out:
 
 /* end of readdir & getdents */
 
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static int get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
-{
-	if (ufdset) {
-		unsigned long odd;
-
-		if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static void set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
-#define MAX_SELECT_SECONDS \
-	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-
-asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x)
-{
-	fd_set_bits fds;
-	struct compat_timeval *tvp = (struct compat_timeval *)AA(tvp_x);
-	char *bits;
-	unsigned long nn;
-	long timeout;
-	int ret, size;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp) {
-		time_t sec, usec;
-
-		if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
-		    || (ret = __get_user(sec, &tvp->tv_sec))
-		    || (ret = __get_user(usec, &tvp->tv_usec)))
-			goto out_nofds;
-
-		ret = -EINVAL;
-		if(sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-	if (n > current->files->max_fdset)
-		n = current->files->max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words. 
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = kmalloc(6 * size, GFP_KERNEL);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if ((ret = get_fd_set32(nn, fds.in, inp)) ||
-	    (ret = get_fd_set32(nn, fds.out, outp)) ||
-	    (ret = get_fd_set32(nn, fds.ex, exp)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
-		time_t sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		put_user(sec, &tvp->tv_sec);
-		put_user(usec, &tvp->tv_usec);
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set32(nn, inp, fds.res_in);
-	set_fd_set32(nn, outp, fds.res_out);
-	set_fd_set32(nn, exp, fds.res_ex);
-
-out:
-	kfree(bits);
-out_nofds:
-	return ret;
-}
-
-int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
+int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
 {
 	int err;
 
@@ -1322,7 +1029,7 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
 	return err;
 }
 
-asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2)
+asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2)
 {
 	return sys_sysfs(option, arg1, arg2);
 }
@@ -1344,7 +1051,7 @@ struct sysinfo32 {
 	char _f[20-2*sizeof(int)-sizeof(int)];
 };
 
-asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
+asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
 {
 	struct sysinfo s;
 	int ret, err;
@@ -1352,7 +1059,7 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
 	mm_segment_t old_fs = get_fs ();
 	
 	set_fs(KERNEL_DS);
-	ret = sys_sysinfo(&s);
+	ret = sys_sysinfo((struct sysinfo __user *) &s);
 	set_fs(old_fs);
 	/* Check to see if any memory value is too large for 32-bit and
          * scale down if needed.
@@ -1391,21 +1098,24 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
 	return ret;
 }
 
-asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec *interval)
+asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval)
 {
 	struct timespec t;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
 	
 	set_fs (KERNEL_DS);
-	ret = sys_sched_rr_get_interval(pid, &t);
+	ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t);
 	set_fs (old_fs);
 	if (put_compat_timespec(&t, interval))
 		return -EFAULT;
 	return ret;
 }
 
-asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset_t *oset, compat_size_t sigsetsize)
+asmlinkage long compat_sys_rt_sigprocmask(int how,
+					  compat_sigset_t __user *set,
+					  compat_sigset_t __user *oset,
+					  compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -1423,7 +1133,10 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset
 		}
 	}
 	set_fs (KERNEL_DS);
-	ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL, sigsetsize);
+	ret = sys_rt_sigprocmask(how,
+				 set ? (sigset_t __user *) &s : NULL,
+				 oset ? (sigset_t __user *) &s : NULL,
+				 sigsetsize);
 	set_fs (old_fs);
 	if (ret) return ret;
 	if (oset) {
@@ -1439,7 +1152,8 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, compat_sigset
 	return 0;
 }
 
-asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsize)
+asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
+				    compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -1447,7 +1161,7 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsiz
 	mm_segment_t old_fs = get_fs();
 		
 	set_fs (KERNEL_DS);
-	ret = sys_rt_sigpending(&s, sigsetsize);
+	ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
 	set_fs (old_fs);
 	if (!ret) {
 		switch (_NSIG_WORDS) {
@@ -1462,9 +1176,10 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t *set, compat_size_t sigsetsiz
 	return ret;
 }
 
-asmlinkage int
-sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
-		      struct compat_timespec *uts, compat_size_t sigsetsize)
+asmlinkage long sys32_rt_sigtimedwait(compat_sigset_t __user *uthese,
+				      siginfo_t32 __user *uinfo,
+				      struct compat_timespec __user *uts,
+				      compat_size_t sigsetsize)
 {
 	int ret, sig;
 	sigset_t these;
@@ -1546,8 +1261,8 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
 	return ret;
 }
 
-asmlinkage int
-sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
+asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig,
+					   siginfo_t32 __user *uinfo)
 {
 	siginfo_t info;
 	int ret;
@@ -1557,14 +1272,13 @@ sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
 	    copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE))
 		return -EFAULT;
 	set_fs (KERNEL_DS);
-	ret = sys_rt_sigqueueinfo(pid, sig, &info);
+	ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info);
 	set_fs (old_fs);
 	return ret;
 }
 
-extern void check_pending(int signum);
-
-asmlinkage int sys32_sigaction (int sig, struct old_sigaction32 *act, struct old_sigaction32 *oact)
+asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act,
+				     struct old_sigaction32 __user *oact)
 {
         struct k_sigaction new_ka, old_ka;
         int ret;
@@ -1602,9 +1316,11 @@ asmlinkage int sys32_sigaction (int sig, struct old_sigaction32 *act, struct old
 	return ret;
 }
 
-asmlinkage int
-sys32_rt_sigaction(int sig, struct sigaction32 *act, struct sigaction32 *oact,
-		   void *restorer, compat_size_t sigsetsize)
+asmlinkage long compat_sys_rt_sigaction(int sig,
+					struct sigaction32 __user *act,
+					struct sigaction32 __user *oact,
+					void __user *restorer,
+					compat_size_t sigsetsize)
 {
         struct k_sigaction new_ka, old_ka;
         int ret;
@@ -1659,218 +1375,33 @@ sys32_rt_sigaction(int sig, struct sigaction32 *act, struct sigaction32 *oact,
         return ret;
 }
 
-
-/*
- * count32() counts the number of arguments/envelopes
- */
-static int count32(u32 * argv, int max)
-{
-	int i = 0;
-
-	if (argv != NULL) {
-		for (;;) {
-			u32 p; int error;
-
-			error = get_user(p,argv);
-			if (error)
-				return error;
-			if (!p)
-				break;
-			argv++;
-			if (++i > max)
-				return -E2BIG;
-		}
-	}
-	return i;
-}
-
-/*
- * 'copy_string32()' copies argument/envelope strings from user
- * memory to free pages in kernel mem. These are in a format ready
- * to be put directly into the top of new user memory.
- */
-static int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm)
-{
-	while (argc-- > 0) {
-		u32 str;
-		int len;
-		unsigned long pos;
-
-		if (get_user(str, argv + argc) ||
-		    !str ||
-		    !(len = strnlen_user((char *)A(str), bprm->p)))
-			return -EFAULT;
-
-		if (bprm->p < len)
-			return -E2BIG;
-
-		bprm->p -= len;
-
-		pos = bprm->p;
-		while (len) {
-			char *kaddr;
-			struct page *page;
-			int offset, bytes_to_copy, new, err;
-
-			offset = pos % PAGE_SIZE;
-			page = bprm->page[pos / PAGE_SIZE];
-			new = 0;
-			if (!page) {
-				page = alloc_page(GFP_USER);
-				bprm->page[pos / PAGE_SIZE] = page;
-				if (!page)
-					return -ENOMEM;
-				new = 1;
-			}
-			kaddr = kmap(page);
-
-			if (new && offset)
-				memset(kaddr, 0, offset);
-			bytes_to_copy = PAGE_SIZE - offset;
-			if (bytes_to_copy > len) {
-				bytes_to_copy = len;
-				if (new)
-					memset(kaddr+offset+len, 0,
-					       PAGE_SIZE-offset-len);
-			}
-
-			err = copy_from_user(kaddr + offset, (char *)A(str),
-					     bytes_to_copy);
-			kunmap(page);
-
-			if (err)
-				return -EFAULT;
-
-			pos += bytes_to_copy;
-			str += bytes_to_copy;
-			len -= bytes_to_copy;
-		}
-	}
-	return 0;
-}
-
-/*
- * sys32_execve() executes a new program.
- */
-static inline int 
-do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
-{
-	struct linux_binprm bprm;
-	struct file * file;
-	int retval;
-	int i;
-
-	sched_balance_exec();
-
-	file = open_exec(filename);
-
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		return retval;
-
-	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
-	memset(bprm.page, 0, MAX_ARG_PAGES * sizeof(bprm.page[0]));
-
-	bprm.file = file;
-	bprm.filename = filename;
-	bprm.interp = filename;
-	bprm.sh_bang = 0;
-	bprm.loader = 0;
-	bprm.exec = 0;
-	bprm.security = NULL;
-	bprm.mm = mm_alloc();
-	retval = -ENOMEM;
-	if (!bprm.mm) 
-		goto out_file;
-
-	retval = init_new_context(current, bprm.mm);
-	if (retval < 0)
-		goto out_mm;
-
-	bprm.argc = count32(argv, bprm.p / sizeof(u32));
-	if ((retval = bprm.argc) < 0)
-		goto out_mm;
-
-	bprm.envc = count32(envp, bprm.p / sizeof(u32));
-	if ((retval = bprm.envc) < 0)
-		goto out_mm;
-
-	retval = security_bprm_alloc(&bprm);
-	if (retval)
-		goto out;
-
-	retval = prepare_binprm(&bprm);
-	if (retval < 0)
-		goto out;
-	
-	retval = copy_strings_kernel(1, &bprm.filename, &bprm);
-	if (retval < 0)
-		goto out;
-
-	bprm.exec = bprm.p;
-	retval = copy_strings32(bprm.envc, envp, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = copy_strings32(bprm.argc, argv, &bprm);
-	if (retval < 0)
-		goto out;
-
-	retval = search_binary_handler(&bprm, regs);
-	if (retval >= 0) {
-		/* execve success */
-		security_bprm_free(&bprm);
-		return retval;
-	}
-
-out:
-	/* Something went wrong, return the inode and free the argument pages*/
-	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
-		struct page * page = bprm.page[i];
-		if (page)
-			__free_page(page);
-	}
-
-	if (bprm.security)
-		security_bprm_free(&bprm);
-
-out_mm:
-	if (bprm.mm)
-		mmdrop(bprm.mm);
-
-out_file:
-	if (bprm.file) {
-		allow_write_access(bprm.file);
-		fput(bprm.file);
-	}
-	return retval;
-}
-
 /*
  * sparc32_execve() executes a new program after the asm stub has set
  * things up for us.  This should basically do what I want it to.
  */
-asmlinkage int sparc32_execve(struct pt_regs *regs)
+asmlinkage long sparc32_execve(struct pt_regs *regs)
 {
-        int error, base = 0;
-        char *filename;
+	int error, base = 0;
+	char *filename;
 
 	/* User register window flush is done by entry.S */
 
-        /* Check for indirect call. */
-        if((u32)regs->u_regs[UREG_G1] == 0)
-                base = 1;
+	/* Check for indirect call. */
+	if ((u32)regs->u_regs[UREG_G1] == 0)
+		base = 1;
 
-        filename = getname((char *)AA(regs->u_regs[base + UREG_I0]));
+	filename = getname(compat_ptr(regs->u_regs[base + UREG_I0]));
 	error = PTR_ERR(filename);
-        if(IS_ERR(filename))
-                goto out;
-        error = do_execve32(filename,
-        	(u32 *)AA((u32)regs->u_regs[base + UREG_I1]),
-        	(u32 *)AA((u32)regs->u_regs[base + UREG_I2]), regs);
-        putname(filename);
-
-	if(!error) {
+	if (IS_ERR(filename))
+		goto out;
+
+	error = compat_do_execve(filename,
+				 compat_ptr(regs->u_regs[base + UREG_I1]),
+				 compat_ptr(regs->u_regs[base + UREG_I2]), regs);
+
+	putname(filename);
+
+	if (!error) {
 		fprs_write(0);
 		current_thread_info()->xfsr[0] = 0;
 		current_thread_info()->fpsaved[0] = 0;
@@ -1878,269 +1409,45 @@ asmlinkage int sparc32_execve(struct pt_regs *regs)
 		current->ptrace &= ~PT_DTRACE;
 	}
 out:
-        return error;
+	return error;
 }
 
 #ifdef CONFIG_MODULES
 
-asmlinkage int sys32_init_module(void *umod, u32 len, const char *uargs)
+asmlinkage long sys32_init_module(void __user *umod, u32 len,
+				  const char __user *uargs)
 {
 	return sys_init_module(umod, len, uargs);
 }
 
-asmlinkage int sys32_delete_module(const char *name_user, unsigned int flags)
+asmlinkage long sys32_delete_module(const char __user *name_user,
+				    unsigned int flags)
 {
 	return sys_delete_module(name_user, flags);
 }
 
 #else /* CONFIG_MODULES */
 
-asmlinkage int
-sys32_init_module(const char *name_user, struct module *mod_user)
+asmlinkage long sys32_init_module(const char __user *name_user,
+				  struct module __user *mod_user)
 {
 	return -ENOSYS;
 }
 
-asmlinkage int
-sys32_delete_module(const char *name_user)
+asmlinkage long sys32_delete_module(const char __user *name_user)
 {
 	return -ENOSYS;
 }
 
 #endif  /* CONFIG_MODULES */
 
-#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)
-/* Stuff for NFS server syscalls... */
-struct nfsctl_svc32 {
-	u16			svc32_port;
-	s32			svc32_nthreads;
-};
-
-struct nfsctl_client32 {
-	s8			cl32_ident[NFSCLNT_IDMAX+1];
-	s32			cl32_naddr;
-	struct in_addr		cl32_addrlist[NFSCLNT_ADDRMAX];
-	s32			cl32_fhkeytype;
-	s32			cl32_fhkeylen;
-	u8			cl32_fhkey[NFSCLNT_KEYMAX];
-};
-
-struct nfsctl_export32 {
-	s8			ex32_client[NFSCLNT_IDMAX+1];
-	s8			ex32_path[NFS_MAXPATHLEN+1];
-	compat_dev_t	ex32_dev;
-	compat_ino_t	ex32_ino;
-	s32			ex32_flags;
-	compat_uid_t	ex32_anon_uid;
-	compat_gid_t	ex32_anon_gid;
-};
-
-struct nfsctl_fdparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_version;
-};
-
-struct nfsctl_fsparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_maxlen;
-};
-
-struct nfsctl_arg32 {
-	s32			ca32_version;	/* safeguard */
-	union {
-		struct nfsctl_svc32	u32_svc;
-		struct nfsctl_client32	u32_client;
-		struct nfsctl_export32	u32_export;
-		struct nfsctl_fdparm32	u32_getfd;
-		struct nfsctl_fsparm32	u32_getfs;
-	} u;
-#define ca32_svc	u.u32_svc
-#define ca32_client	u.u32_client
-#define ca32_export	u.u32_export
-#define ca32_getfd	u.u32_getfd
-#define ca32_getfs	u.u32_getfs
-};
-
-union nfsctl_res32 {
-	__u8			cr32_getfh[NFS_FHSIZE];
-	struct knfsd_fh		cr32_getfs;
-};
-
-static int nfs_svc32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= __get_user(karg->ca_svc.svc_port, &arg32->ca32_svc.svc32_port);
-	err |= __get_user(karg->ca_svc.svc_nthreads, &arg32->ca32_svc.svc32_nthreads);
-	return err;
-}
-
-static int nfs_clnt32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_client.cl_ident[0],
-			  &arg32->ca32_client.cl32_ident[0],
-			  NFSCLNT_IDMAX);
-	err |= __get_user(karg->ca_client.cl_naddr, &arg32->ca32_client.cl32_naddr);
-	err |= copy_from_user(&karg->ca_client.cl_addrlist[0],
-			  &arg32->ca32_client.cl32_addrlist[0],
-			  (sizeof(struct in_addr) * NFSCLNT_ADDRMAX));
-	err |= __get_user(karg->ca_client.cl_fhkeytype,
-		      &arg32->ca32_client.cl32_fhkeytype);
-	err |= __get_user(karg->ca_client.cl_fhkeylen,
-		      &arg32->ca32_client.cl32_fhkeylen);
-	err |= copy_from_user(&karg->ca_client.cl_fhkey[0],
-			  &arg32->ca32_client.cl32_fhkey[0],
-			  NFSCLNT_KEYMAX);
-	return (err ? -EFAULT : 0);
-}
-
-static int nfs_exp32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_export.ex_client[0],
-			  &arg32->ca32_export.ex32_client[0],
-			  NFSCLNT_IDMAX);
-	err |= copy_from_user(&karg->ca_export.ex_path[0],
-			  &arg32->ca32_export.ex32_path[0],
-			  NFS_MAXPATHLEN);
-	err |= __get_user(karg->ca_export.ex_dev,
-		      &arg32->ca32_export.ex32_dev);
-	err |= __get_user(karg->ca_export.ex_ino,
-		      &arg32->ca32_export.ex32_ino);
-	err |= __get_user(karg->ca_export.ex_flags,
-		      &arg32->ca32_export.ex32_flags);
-	err |= __get_user(karg->ca_export.ex_anon_uid,
-		      &arg32->ca32_export.ex32_anon_uid);
-	err |= __get_user(karg->ca_export.ex_anon_gid,
-		      &arg32->ca32_export.ex32_anon_gid);
-	karg->ca_export.ex_anon_uid = high2lowuid(karg->ca_export.ex_anon_uid);
-	karg->ca_export.ex_anon_gid = high2lowgid(karg->ca_export.ex_anon_gid);
-	return (err ? -EFAULT : 0);
-}
-
-static int nfs_getfd32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfd.gd_addr,
-			  &arg32->ca32_getfd.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfd.gd_path,
-			  &arg32->ca32_getfd.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= __get_user(karg->ca_getfd.gd_version,
-		      &arg32->ca32_getfd.gd32_version);
-	return (err ? -EFAULT : 0);
-}
-
-static int nfs_getfs32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = __get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfs.gd_addr,
-			  &arg32->ca32_getfs.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfs.gd_path,
-			  &arg32->ca32_getfs.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= __get_user(karg->ca_getfs.gd_maxlen,
-		      &arg32->ca32_getfs.gd32_maxlen);
-	return (err ? -EFAULT : 0);
-}
-
-/* This really doesn't need translations, we are only passing
- * back a union which contains opaque nfs file handle data.
- */
-static int nfs_getfh32_res_trans(union nfsctl_res *kres, union nfsctl_res32 *res32)
-{
-	return (copy_to_user(res32, kres, sizeof(*res32)) ? -EFAULT : 0);
-}
-
-int asmlinkage sys32_nfsservctl(int cmd, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
-{
-	struct nfsctl_arg *karg = NULL;
-	union nfsctl_res *kres = NULL;
-	mm_segment_t oldfs;
-	int err;
-
-	karg = kmalloc(sizeof(*karg), GFP_USER);
-	if(!karg)
-		return -ENOMEM;
-	if(res32) {
-		kres = kmalloc(sizeof(*kres), GFP_USER);
-		if(!kres) {
-			kfree(karg);
-			return -ENOMEM;
-		}
-	}
-	switch(cmd) {
-	case NFSCTL_SVC:
-		err = nfs_svc32_trans(karg, arg32);
-		break;
-	case NFSCTL_ADDCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_DELCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_EXPORT:
-	case NFSCTL_UNEXPORT:
-		err = nfs_exp32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFD:
-		err = nfs_getfd32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFS:
-		err = nfs_getfs32_trans(karg, arg32);
-		break;
-	default:
-		err = -EINVAL;
-		break;
-	}
-	if(err)
-		goto done;
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_nfsservctl(cmd, karg, kres);
-	set_fs(oldfs);
-
-	if (err)
-		goto done;
-
-	if((cmd == NFSCTL_GETFD) ||
-	   (cmd == NFSCTL_GETFS))
-		err = nfs_getfh32_res_trans(kres, res32);
-
-done:
-	if(karg)
-		kfree(karg);
-	if(kres)
-		kfree(kres);
-	return err;
-}
-#else /* !NFSD */
-int asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2)
-{
-	return sys_ni_syscall();
-}
-#endif
-
 /* Translations due to time_t size differences.  Which affects all
    sorts of things, like timeval and itimerval.  */
 
 extern struct timezone sys_tz;
 
-asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
+asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv,
+				   struct timezone __user *tz)
 {
 	if (tv) {
 		struct timeval ktv;
@@ -2155,7 +1462,7 @@ asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz
 	return 0;
 }
 
-static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
+static inline long get_ts32(struct timespec *o, struct compat_timeval __user *i)
 {
 	long usec;
 
@@ -2169,7 +1476,8 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
 	return 0;
 }
 
-asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
+asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv,
+				   struct timezone __user *tz)
 {
 	struct timespec kts;
 	struct timezone ktz;
@@ -2186,99 +1494,76 @@ asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz
 	return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 
-asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs)
+asmlinkage long sys32_utimes(char __user *filename,
+			     struct compat_timeval __user *tvs)
 {
-	char *kfilename;
 	struct timeval ktvs[2];
-	mm_segment_t old_fs;
-	int ret;
-
-	kfilename = getname(filename);
-	ret = PTR_ERR(kfilename);
-	if (!IS_ERR(kfilename)) {
-		if (tvs) {
-			if (get_tv32(&ktvs[0], tvs) ||
-			    get_tv32(&ktvs[1], 1+tvs))
-				return -EFAULT;
-		}
-
-		old_fs = get_fs();
-		set_fs(KERNEL_DS);
-		ret = do_utimes(kfilename, (tvs ? &ktvs[0] : NULL));
-		set_fs(old_fs);
 
-		putname(kfilename);
+	if (tvs) {
+		if (get_tv32(&ktvs[0], tvs) ||
+		    get_tv32(&ktvs[1], 1+tvs))
+			return -EFAULT;
 	}
-	return ret;
+
+	return do_utimes(filename, (tvs ? &ktvs[0] : NULL));
 }
 
 /* These are here just in case some old sparc32 binary calls it. */
-asmlinkage int sys32_pause(void)
+asmlinkage long sys32_pause(void)
 {
 	current->state = TASK_INTERRUPTIBLE;
 	schedule();
 	return -ERESTARTNOHAND;
 }
 
-/* PCI config space poking. */
-
-asmlinkage int sys32_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
-{
-	return sys_pciconfig_read((unsigned long) bus,
-				  (unsigned long) dfn,
-				  (unsigned long) off,
-				  (unsigned long) len,
-				  (unsigned char *)AA(ubuf));
-}
-
-asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf)
-{
-	return sys_pciconfig_write((unsigned long) bus,
-				   (unsigned long) dfn,
-				   (unsigned long) off,
-				   (unsigned long) len,
-				   (unsigned char *)AA(ubuf));
-}
-
-asmlinkage int sys32_prctl(int option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
+asmlinkage compat_ssize_t sys32_pread64(unsigned int fd,
+					char __user *ubuf,
+					compat_size_t count,
+					unsigned long poshi,
+					unsigned long poslo)
 {
-	return sys_prctl(option,
-			 (unsigned long) arg2,
-			 (unsigned long) arg3,
-			 (unsigned long) arg4,
-			 (unsigned long) arg5);
+	return sys_pread64(fd, ubuf, count, (poshi << 32) | poslo);
 }
 
-
-asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, char *ubuf,
-				   compat_size_t count, u32 poshi, u32 poslo)
+asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd,
+					 char __user *ubuf,
+					 compat_size_t count,
+					 unsigned long poshi,
+					 unsigned long poslo)
 {
-	return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
+	return sys_pwrite64(fd, ubuf, count, (poshi << 32) | poslo);
 }
 
-asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd, char *ubuf,
-				    compat_size_t count, u32 poshi, u32 poslo)
+asmlinkage long compat_sys_readahead(int fd,
+				     unsigned long offhi,
+				     unsigned long offlo,
+				     compat_size_t count)
 {
-	return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
+	return sys_readahead(fd, (offhi << 32) | offlo, count);
 }
 
-asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count)
+long compat_sys_fadvise64(int fd,
+			  unsigned long offhi,
+			  unsigned long offlo,
+			  compat_size_t len, int advice)
 {
-	return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count);
+	return sys_fadvise64_64(fd, (offhi << 32) | offlo, len, advice);
 }
 
-long sys32_fadvise64(int fd, u32 offhi, u32 offlo, s32 len, int advice)
+long compat_sys_fadvise64_64(int fd,
+			     unsigned long offhi, unsigned long offlo,
+			     unsigned long lenhi, unsigned long lenlo,
+			     int advice)
 {
-	return sys_fadvise64_64(fd, ((loff_t)AA(offhi)<<32)|AA(offlo), len, advice);
+	return sys_fadvise64_64(fd,
+				(offhi << 32) | offlo,
+				(lenhi << 32) | lenlo,
+				advice);
 }
 
-long sys32_fadvise64_64(int fd, u32 offhi, u32 offlo, u32 lenhi, u32 lenlo, int advice)
-{
-	return sys_fadvise64_64(fd, ((loff_t)AA(offhi)<<32)|AA(offlo),
-				((loff_t)AA(lenhi)<<32)|AA(lenlo), advice);
-}
-
-asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
+asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
+				    compat_off_t __user *offset,
+				    compat_size_t count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
@@ -2288,7 +1573,9 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 c
 		return -EFAULT;
 		
 	set_fs(KERNEL_DS);
-	ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
+	ret = sys_sendfile(out_fd, in_fd,
+			   offset ? (off_t __user *) &of : NULL,
+			   count);
 	set_fs(old_fs);
 	
 	if (offset && put_user(of, offset))
@@ -2297,7 +1584,9 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 c
 	return ret;
 }
 
-asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s32 count)
+asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
+				      compat_loff_t __user *offset,
+				      compat_size_t count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
@@ -2307,7 +1596,9 @@ asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s3
 		return -EFAULT;
 		
 	set_fs(KERNEL_DS);
-	ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count);
+	ret = sys_sendfile64(out_fd, in_fd,
+			     offset ? (loff_t __user *) &lof : NULL,
+			     count);
 	set_fs(old_fs);
 	
 	if (offset && put_user(lof, offset))
@@ -2333,57 +1624,57 @@ struct timex32 {
 
 extern int do_adjtimex(struct timex *);
 
-asmlinkage int sys32_adjtimex(struct timex32 *utp)
+asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
 {
 	struct timex txc;
 	int ret;
 
 	memset(&txc, 0, sizeof(struct timex));
 
-	if(get_user(txc.modes, &utp->modes) ||
-	   __get_user(txc.offset, &utp->offset) ||
-	   __get_user(txc.freq, &utp->freq) ||
-	   __get_user(txc.maxerror, &utp->maxerror) ||
-	   __get_user(txc.esterror, &utp->esterror) ||
-	   __get_user(txc.status, &utp->status) ||
-	   __get_user(txc.constant, &utp->constant) ||
-	   __get_user(txc.precision, &utp->precision) ||
-	   __get_user(txc.tolerance, &utp->tolerance) ||
-	   __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-	   __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-	   __get_user(txc.tick, &utp->tick) ||
-	   __get_user(txc.ppsfreq, &utp->ppsfreq) ||
-	   __get_user(txc.jitter, &utp->jitter) ||
-	   __get_user(txc.shift, &utp->shift) ||
-	   __get_user(txc.stabil, &utp->stabil) ||
-	   __get_user(txc.jitcnt, &utp->jitcnt) ||
-	   __get_user(txc.calcnt, &utp->calcnt) ||
-	   __get_user(txc.errcnt, &utp->errcnt) ||
-	   __get_user(txc.stbcnt, &utp->stbcnt))
+	if (get_user(txc.modes, &utp->modes) ||
+	    __get_user(txc.offset, &utp->offset) ||
+	    __get_user(txc.freq, &utp->freq) ||
+	    __get_user(txc.maxerror, &utp->maxerror) ||
+	    __get_user(txc.esterror, &utp->esterror) ||
+	    __get_user(txc.status, &utp->status) ||
+	    __get_user(txc.constant, &utp->constant) ||
+	    __get_user(txc.precision, &utp->precision) ||
+	    __get_user(txc.tolerance, &utp->tolerance) ||
+	    __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
+	    __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
+	    __get_user(txc.tick, &utp->tick) ||
+	    __get_user(txc.ppsfreq, &utp->ppsfreq) ||
+	    __get_user(txc.jitter, &utp->jitter) ||
+	    __get_user(txc.shift, &utp->shift) ||
+	    __get_user(txc.stabil, &utp->stabil) ||
+	    __get_user(txc.jitcnt, &utp->jitcnt) ||
+	    __get_user(txc.calcnt, &utp->calcnt) ||
+	    __get_user(txc.errcnt, &utp->errcnt) ||
+	    __get_user(txc.stbcnt, &utp->stbcnt))
 		return -EFAULT;
 
 	ret = do_adjtimex(&txc);
 
-	if(put_user(txc.modes, &utp->modes) ||
-	   __put_user(txc.offset, &utp->offset) ||
-	   __put_user(txc.freq, &utp->freq) ||
-	   __put_user(txc.maxerror, &utp->maxerror) ||
-	   __put_user(txc.esterror, &utp->esterror) ||
-	   __put_user(txc.status, &utp->status) ||
-	   __put_user(txc.constant, &utp->constant) ||
-	   __put_user(txc.precision, &utp->precision) ||
-	   __put_user(txc.tolerance, &utp->tolerance) ||
-	   __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
-	   __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
-	   __put_user(txc.tick, &utp->tick) ||
-	   __put_user(txc.ppsfreq, &utp->ppsfreq) ||
-	   __put_user(txc.jitter, &utp->jitter) ||
-	   __put_user(txc.shift, &utp->shift) ||
-	   __put_user(txc.stabil, &utp->stabil) ||
-	   __put_user(txc.jitcnt, &utp->jitcnt) ||
-	   __put_user(txc.calcnt, &utp->calcnt) ||
-	   __put_user(txc.errcnt, &utp->errcnt) ||
-	   __put_user(txc.stbcnt, &utp->stbcnt))
+	if (put_user(txc.modes, &utp->modes) ||
+	    __put_user(txc.offset, &utp->offset) ||
+	    __put_user(txc.freq, &utp->freq) ||
+	    __put_user(txc.maxerror, &utp->maxerror) ||
+	    __put_user(txc.esterror, &utp->esterror) ||
+	    __put_user(txc.status, &utp->status) ||
+	    __put_user(txc.constant, &utp->constant) ||
+	    __put_user(txc.precision, &utp->precision) ||
+	    __put_user(txc.tolerance, &utp->tolerance) ||
+	    __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
+	    __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
+	    __put_user(txc.tick, &utp->tick) ||
+	    __put_user(txc.ppsfreq, &utp->ppsfreq) ||
+	    __put_user(txc.jitter, &utp->jitter) ||
+	    __put_user(txc.shift, &utp->shift) ||
+	    __put_user(txc.stabil, &utp->stabil) ||
+	    __put_user(txc.jitcnt, &utp->jitcnt) ||
+	    __put_user(txc.calcnt, &utp->calcnt) ||
+	    __put_user(txc.errcnt, &utp->errcnt) ||
+	    __put_user(txc.stbcnt, &utp->stbcnt))
 		ret = -EFAULT;
 
 	return ret;
@@ -2393,7 +1684,8 @@ asmlinkage int sys32_adjtimex(struct timex32 *utp)
  * not force O_LARGEFILE on.
  */
 
-asmlinkage long sparc32_open(const char * filename, int flags, int mode)
+asmlinkage long sparc32_open(const char __user *filename,
+			     int flags, int mode)
 {
 	char * tmp;
 	int fd, error;
@@ -2430,7 +1722,7 @@ asmlinkage unsigned long sys32_mremap(unsigned long addr,
 {
 	struct vm_area_struct *vma;
 	unsigned long ret = -EINVAL;
-	unsigned long new_addr = AA(__new_addr);
+	unsigned long new_addr = __new_addr;
 
 	if (old_len > 0xf0000000UL || new_len > 0xf0000000UL)
 		goto out;
@@ -2471,13 +1763,6 @@ out:
 	return ret;       
 }
 
-asmlinkage int sys_setpriority32(u32 which, u32 who, u32 niceval)
-{
-	return sys_setpriority((int) which,
-			       (int) who,
-			       (int) niceval);
-}
-
 struct __sysctl_args32 {
 	u32 name;
 	int nlen;
@@ -2488,15 +1773,15 @@ struct __sysctl_args32 {
 	u32 __unused[4];
 };
 
-asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
+asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
 {
 #ifndef CONFIG_SYSCTL
 	return -ENOSYS;
 #else
 	struct __sysctl_args32 tmp;
 	int error;
-	size_t oldlen, *oldlenp = NULL;
-	unsigned long addr = (((long)&args->__unused[0]) + 7) & ~7;
+	size_t oldlen, __user *oldlenp = NULL;
+	unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL;
 
 	if (copy_from_user(&tmp, args, sizeof(tmp)))
 		return -EFAULT;
@@ -2508,20 +1793,24 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
 		   basically copy the whole sysctl.c here, and
 		   glibc's __sysctl uses rw memory for the structure
 		   anyway.  */
-		if (get_user(oldlen, (u32 *)A(tmp.oldlenp)) ||
-		    put_user(oldlen, (size_t *)addr))
+		if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) ||
+		    put_user(oldlen, (size_t __user *)addr))
 			return -EFAULT;
-		oldlenp = (size_t *)addr;
+		oldlenp = (size_t __user *)addr;
 	}
 
 	lock_kernel();
-	error = do_sysctl((int *)A(tmp.name), tmp.nlen, (void *)A(tmp.oldval),
-			  oldlenp, (void *)A(tmp.newval), tmp.newlen);
+	error = do_sysctl((int __user *)(unsigned long) tmp.name,
+			  tmp.nlen,
+			  (void __user *)(unsigned long) tmp.oldval,
+			  oldlenp,
+			  (void __user *)(unsigned long) tmp.newval,
+			  tmp.newlen);
 	unlock_kernel();
 	if (oldlenp) {
 		if (!error) {
-			if (get_user(oldlen, (size_t *)addr) ||
-			    put_user(oldlen, (u32 *)A(tmp.oldlenp)))
+			if (get_user(oldlen, (size_t __user *)addr) ||
+			    put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
 				error = -EFAULT;
 		}
 		copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
@@ -2530,18 +1819,22 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
 #endif
 }
 
-long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char *buf, size_t len)
+long sys32_lookup_dcookie(unsigned long cookie_high,
+			  unsigned long cookie_low,
+			  char __user *buf, size_t len)
 {
-	return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
+	return sys_lookup_dcookie((cookie_high << 32) | cookie_low,
 				  buf, len);
 }
 
 extern asmlinkage long
-sys_timer_create(clockid_t which_clock, struct sigevent *timer_event_spec,
-		 timer_t * created_timer_id);
+sys_timer_create(clockid_t which_clock,
+		 struct sigevent __user *timer_event_spec,
+		 timer_t __user *created_timer_id);
 
 long
-sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
+sys32_timer_create(u32 clock, struct sigevent32 __user *se32,
+		   timer_t __user *timer_id)
 {
 	struct sigevent se;
 	mm_segment_t oldfs;
@@ -2564,7 +1857,9 @@ sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
 
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_timer_create(clock, &se, &t);
+	err = sys_timer_create(clock,
+			       (struct sigevent __user *) &se,
+			       (timer_t __user *) &t);
 	set_fs(oldfs);
 
 	if (!err)
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index 2c963a35f..0ed11eaec 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -59,15 +59,6 @@
 #include <net/sock.h>
 #include <net/compat.h>
 
-/* Use this to get at 32-bit user passed pointers. */
-#define A(__x)				\
-({	unsigned long __ret;		\
-	__asm__ ("srl	%0, 0, %0"	\
-		 : "=r" (__ret)		\
-		 : "0" (__x));		\
-	__ret;				\
-})
-
 #define SUNOS_NR_OPEN	256
 
 asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 off)
@@ -187,7 +178,7 @@ asmlinkage u32 sunos_sbrk(int increment)
 	/* This should do it hopefully... */
 	oldbrk = (int)current->mm->brk;
 	error = sunos_brk(((int) current->mm->brk) + increment);
-	if(!error)
+	if (!error)
 		error = oldbrk;
 	return error;
 }
@@ -273,19 +264,19 @@ struct sunos_dirent {
 };
 
 struct sunos_dirent_callback {
-    struct sunos_dirent *curr;
-    struct sunos_dirent *previous;
+    struct sunos_dirent __user *curr;
+    struct sunos_dirent __user *previous;
     int count;
     int error;
 };
 
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 #define ROUND_UP(x) (((x)+sizeof(s32)-1) & ~(sizeof(s32)-1))
 
 static int sunos_filldir(void * __buf, const char * name, int namlen,
 			 loff_t offset, ino_t ino, unsigned int d_type)
 {
-	struct sunos_dirent * dirent;
+	struct sunos_dirent __user *dirent;
 	struct sunos_dirent_callback * buf = (struct sunos_dirent_callback *) __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
 
@@ -302,32 +293,31 @@ static int sunos_filldir(void * __buf, const char * name, int namlen,
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	dirent = (void *) dirent + reclen;
+	dirent = (void __user *) dirent + reclen;
 	buf->curr = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
-asmlinkage int sunos_getdents(unsigned int fd, u32 u_dirent, int cnt)
+asmlinkage int sunos_getdents(unsigned int fd, void __user *dirent, int cnt)
 {
 	struct file * file;
-	struct sunos_dirent * lastdirent;
+	struct sunos_dirent __user *lastdirent;
 	struct sunos_dirent_callback buf;
 	int error = -EBADF;
-	void *dirent = (void *)A(u_dirent);
 
-	if(fd >= SUNOS_NR_OPEN)
+	if (fd >= SUNOS_NR_OPEN)
 		goto out;
 
 	file = fget(fd);
-	if(!file)
+	if (!file)
 		goto out;
 
 	error = -EINVAL;
-	if(cnt < (sizeof(struct sunos_dirent) + 255))
+	if (cnt < (sizeof(struct sunos_dirent) + 255))
 		goto out_putf;
 
-	buf.curr = (struct sunos_dirent *) dirent;
+	buf.curr = (struct sunos_dirent __user *) dirent;
 	buf.previous = NULL;
 	buf.count = cnt;
 	buf.error = 0;
@@ -358,8 +348,8 @@ struct sunos_direntry {
 };
 
 struct sunos_direntry_callback {
-    struct sunos_direntry *curr;
-    struct sunos_direntry *previous;
+    struct sunos_direntry __user *curr;
+    struct sunos_direntry __user *previous;
     int count;
     int error;
 };
@@ -367,8 +357,9 @@ struct sunos_direntry_callback {
 static int sunos_filldirentry(void * __buf, const char * name, int namlen,
 			      loff_t offset, ino_t ino, unsigned int d_type)
 {
-	struct sunos_direntry * dirent;
-	struct sunos_direntry_callback * buf = (struct sunos_direntry_callback *) __buf;
+	struct sunos_direntry __user *dirent;
+	struct sunos_direntry_callback * buf =
+		(struct sunos_direntry_callback *) __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
 
 	buf->error = -EINVAL;	/* only used if we fail.. */
@@ -382,34 +373,34 @@ static int sunos_filldirentry(void * __buf, const char * name, int namlen,
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	dirent = (void *) dirent + reclen;
+	dirent = (void __user *) dirent + reclen;
 	buf->curr = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
-asmlinkage int sunos_getdirentries(unsigned int fd, u32 u_dirent,
-				   int cnt, u32 u_basep)
+asmlinkage int sunos_getdirentries(unsigned int fd,
+				   void __user *dirent,
+				   int cnt,
+				   unsigned int __user *basep)
 {
-	void *dirent = (void *) A(u_dirent);
-	unsigned int *basep = (unsigned int *)A(u_basep);
 	struct file * file;
-	struct sunos_direntry * lastdirent;
+	struct sunos_direntry __user *lastdirent;
 	int error = -EBADF;
 	struct sunos_direntry_callback buf;
 
-	if(fd >= SUNOS_NR_OPEN)
+	if (fd >= SUNOS_NR_OPEN)
 		goto out;
 
 	file = fget(fd);
-	if(!file)
+	if (!file)
 		goto out;
 
 	error = -EINVAL;
-	if(cnt < (sizeof(struct sunos_direntry) + 255))
+	if (cnt < (sizeof(struct sunos_direntry) + 255))
 		goto out_putf;
 
-	buf.curr = (struct sunos_direntry *) dirent;
+	buf.curr = (struct sunos_direntry __user *) dirent;
 	buf.previous = NULL;
 	buf.count = cnt;
 	buf.error = 0;
@@ -440,17 +431,22 @@ struct sunos_utsname {
 	char mach[9];
 };
 
-asmlinkage int sunos_uname(struct sunos_utsname *name)
+asmlinkage int sunos_uname(struct sunos_utsname __user *name)
 {
 	int ret;
 
 	down_read(&uts_sem);
-	ret = copy_to_user(&name->sname[0], &system_utsname.sysname[0], sizeof(name->sname) - 1);
-	ret |= copy_to_user(&name->nname[0], &system_utsname.nodename[0], sizeof(name->nname) - 1);
+	ret = copy_to_user(&name->sname[0], &system_utsname.sysname[0],
+			   sizeof(name->sname) - 1);
+	ret |= copy_to_user(&name->nname[0], &system_utsname.nodename[0],
+			    sizeof(name->nname) - 1);
 	ret |= put_user('\0', &name->nname[8]);
-	ret |= copy_to_user(&name->rel[0], &system_utsname.release[0], sizeof(name->rel) - 1);
-	ret |= copy_to_user(&name->ver[0], &system_utsname.version[0], sizeof(name->ver) - 1);
-	ret |= copy_to_user(&name->mach[0], &system_utsname.machine[0], sizeof(name->mach) - 1);
+	ret |= copy_to_user(&name->rel[0], &system_utsname.release[0],
+			    sizeof(name->rel) - 1);
+	ret |= copy_to_user(&name->ver[0], &system_utsname.version[0],
+			    sizeof(name->ver) - 1);
+	ret |= copy_to_user(&name->mach[0], &system_utsname.machine[0],
+			    sizeof(name->mach) - 1);
 	up_read(&uts_sem);
 	return (ret ? -EFAULT : 0);
 }
@@ -528,18 +524,15 @@ asmlinkage int sunos_pathconf(u32 u_path, int name)
 	return ret;
 }
 
-/* SunOS mount system call emulation */
-extern asmlinkage int
-sys32_select(int n, u32 inp, u32 outp, u32 exp, u32 tvp);
-
 asmlinkage int sunos_select(int width, u32 inp, u32 outp, u32 exp, u32 tvp_x)
 {
 	int ret;
 
 	/* SunOS binaries expect that select won't change the tvp contents */
-	ret = sys32_select (width, inp, outp, exp, tvp_x);
+	ret = compat_sys_select(width, compat_ptr(inp), compat_ptr(outp),
+				compat_ptr(exp), compat_ptr(tvp_x));
 	if (ret == -EINTR && tvp_x) {
-		struct compat_timeval *tvp = (struct compat_timeval *)A(tvp_x);
+		struct compat_timeval __user *tvp = compat_ptr(tvp_x);
 		time_t sec, usec;
 
 		__get_user(sec, &tvp->tv_sec);
@@ -555,6 +548,10 @@ asmlinkage void sunos_nop(void)
 	return;
 }
 
+#if 0 /* This code doesn't translate user pointers correctly,
+       * disable for now. -DaveM
+       */
+
 /* XXXXXXXXXX SunOS mount/umount. XXXXXXXXXXX */
 #define SMNT_RDONLY       1
 #define SMNT_NOSUID       2
@@ -603,7 +600,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
 	struct file   *file;
 
 	file = fget(fd);
-	if(!file)
+	if (!file)
 		return 0;
 
 	inode = file->f_dentry->d_inode;
@@ -648,7 +645,7 @@ static int get_default (int value, int def_value)
 }
 
 /* XXXXXXXXXXXXXXXXXXXX */
-static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data)
+static int sunos_nfs_mount(char *dir_name, int linux_flags, void __user *data)
 {
 	int  server_fd, err;
 	char *the_name, *mount_page;
@@ -668,10 +665,10 @@ static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data)
 	if (server_fd < 0)
 		return -ENXIO;
 
-	if (copy_from_user(&linux_nfs_mount.addr,sunos_mount.addr,
-				sizeof(*sunos_mount.addr)) ||
-	    copy_from_user(&linux_nfs_mount.root,sunos_mount.fh,
-				sizeof(*sunos_mount.fh))) {
+	if (copy_from_user(&linux_nfs_mount.addr, sunos_mount.addr,
+			   sizeof(*sunos_mount.addr)) ||
+	    copy_from_user(&linux_nfs_mount.root, sunos_mount.fh,
+			   sizeof(*sunos_mount.fh))) {
 		sys_close (server_fd);
 		return -EFAULT;
 	}
@@ -697,7 +694,7 @@ static int sunos_nfs_mount(char *dir_name, int linux_flags, void *data)
 	linux_nfs_mount.acdirmax = sunos_mount.acdirmax;
 
 	the_name = getname(sunos_mount.hostname);
-	if(IS_ERR(the_name))
+	if (IS_ERR(the_name))
 		return PTR_ERR(the_name);
 
 	strlcpy(linux_nfs_mount.hostname, the_name,
@@ -736,11 +733,11 @@ sunos_mount(char *type, char *dir, int flags, void *data)
 	if (flags & (SMNT_GRPID|SMNT_NOSUB|SMNT_MULTI|SMNT_SYS5))
 		goto out;
 
-	if(flags & SMNT_REMOUNT)
+	if (flags & SMNT_REMOUNT)
 		linux_flags |= MS_REMOUNT;
-	if(flags & SMNT_RDONLY)
+	if (flags & SMNT_RDONLY)
 		linux_flags |= MS_RDONLY;
-	if(flags & SMNT_NOSUID)
+	if (flags & SMNT_NOSUID)
 		linux_flags |= MS_NOSUID;
 
 	dir_page = getname(dir);
@@ -753,20 +750,20 @@ sunos_mount(char *type, char *dir, int flags, void *data)
 	if (IS_ERR(type_page))
 		goto out1;
 
-	if(strcmp(type_page, "ext2") == 0) {
+	if (strcmp(type_page, "ext2") == 0) {
 		dev_fname = getname(data);
-	} else if(strcmp(type_page, "iso9660") == 0) {
+	} else if (strcmp(type_page, "iso9660") == 0) {
 		dev_fname = getname(data);
-	} else if(strcmp(type_page, "minix") == 0) {
+	} else if (strcmp(type_page, "minix") == 0) {
 		dev_fname = getname(data);
-	} else if(strcmp(type_page, "nfs") == 0) {
+	} else if (strcmp(type_page, "nfs") == 0) {
 		ret = sunos_nfs_mount (dir_page, flags, data);
 		goto out2;
-        } else if(strcmp(type_page, "ufs") == 0) {
+        } else if (strcmp(type_page, "ufs") == 0) {
 		printk("Warning: UFS filesystem mounts unsupported.\n");
 		ret = -ENODEV;
 		goto out2;
-	} else if(strcmp(type_page, "proc")) {
+	} else if (strcmp(type_page, "proc")) {
 		ret = -ENODEV;
 		goto out2;
 	}
@@ -785,15 +782,15 @@ out1:
 out:
 	return ret;
 }
-
+#endif
 
 asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
 {
 	int ret;
 
 	/* So stupid... */
-	if((!pid || pid == current->pid) &&
-	   !pgid) {
+	if ((!pid || pid == current->pid) &&
+	    !pgid) {
 		sys_setsid();
 		ret = 0;
 	} else {
@@ -803,16 +800,15 @@ asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
 }
 
 /* So stupid... */
-extern long compat_sys_wait4(compat_pid_t, compat_uint_t *, int,
-			     struct compat_rusage *);
+extern long compat_sys_wait4(compat_pid_t, compat_uint_t __user *, int,
+			     struct compat_rusage __user *);
 
-asmlinkage int sunos_wait4(compat_pid_t pid, u32 stat_addr, int options, u32 ru)
+asmlinkage int sunos_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options, struct compat_rusage __user *ru)
 {
 	int ret;
 
 	ret = compat_sys_wait4((pid ? pid : ((compat_pid_t)-1)),
-			       (compat_uint_t *)A(stat_addr), options,
-			       (struct compat_rusage *)A(ru));
+			       stat_addr, options, ru);
 	return ret;
 }
 
@@ -828,7 +824,7 @@ asmlinkage int sunos_audit(void)
 	return -1;
 }
 
-extern asmlinkage u32 sunos_gethostid(void)
+asmlinkage u32 sunos_gethostid(void)
 {
 	u32 ret;
 
@@ -847,7 +843,7 @@ extern asmlinkage u32 sunos_gethostid(void)
 #define   _SC_SAVED_IDS           7
 #define   _SC_VERSION             8
 
-extern asmlinkage s32 sunos_sysconf (int name)
+asmlinkage s32 sunos_sysconf (int name)
 {
 	s32 ret;
 
@@ -886,7 +882,7 @@ extern asmlinkage s32 sunos_sysconf (int name)
 	return ret;
 }
 
-asmlinkage int sunos_semsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 ptr)
+asmlinkage int sunos_semsys(int op, u32 arg1, u32 arg2, u32 arg3, void __user *ptr)
 {
 	union semun arg4;
 	int ret;
@@ -911,7 +907,8 @@ asmlinkage int sunos_semsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 ptr)
 			arg3=SETALL; break;
 		}
 		/* sys_semctl(): */
-		arg4.__pad=(void *)A(ptr); /* value to modify semaphore to */
+		/* value to modify semaphore to */
+		arg4.__pad = ptr;
 		ret = sys_semctl((int)arg1, (int)arg2, (int)arg3, arg4);
 		break;
 	case 1:
@@ -920,7 +917,8 @@ asmlinkage int sunos_semsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 ptr)
 		break;
 	case 2:
 		/* sys_semop(): */
-		ret = sys_semop((int)arg1, (struct sembuf *)A(arg2), (unsigned)arg3);
+		ret = sys_semop((int)arg1, (struct sembuf __user *)(unsigned long)arg2,
+				(unsigned int) arg3);
 		break;
 	default:
 		ret = -EINVAL;
@@ -962,65 +960,65 @@ struct msqid_ds32
         compat_ipc_pid_t msg_lrpid;
 };
 
-static inline int sunos_msqid_get(struct msqid_ds32 *user,
+static inline int sunos_msqid_get(struct msqid_ds32 __user *user,
 				  struct msqid_ds *kern)
 {
-	if(get_user(kern->msg_perm.key, &user->msg_perm.key)		||
-	   __get_user(kern->msg_perm.uid, &user->msg_perm.uid)		||
-	   __get_user(kern->msg_perm.gid, &user->msg_perm.gid)		||
-	   __get_user(kern->msg_perm.cuid, &user->msg_perm.cuid)	||
-	   __get_user(kern->msg_perm.cgid, &user->msg_perm.cgid)	||
-	   __get_user(kern->msg_stime, &user->msg_stime)		||
-	   __get_user(kern->msg_rtime, &user->msg_rtime)		||
-	   __get_user(kern->msg_ctime, &user->msg_ctime)		||
-	   __get_user(kern->msg_ctime, &user->msg_cbytes)		||
-	   __get_user(kern->msg_ctime, &user->msg_qnum)			||
-	   __get_user(kern->msg_ctime, &user->msg_qbytes)		||
-	   __get_user(kern->msg_ctime, &user->msg_lspid)		||
-	   __get_user(kern->msg_ctime, &user->msg_lrpid))
+	if (get_user(kern->msg_perm.key, &user->msg_perm.key)		||
+	    __get_user(kern->msg_perm.uid, &user->msg_perm.uid)		||
+	    __get_user(kern->msg_perm.gid, &user->msg_perm.gid)		||
+	    __get_user(kern->msg_perm.cuid, &user->msg_perm.cuid)	||
+	    __get_user(kern->msg_perm.cgid, &user->msg_perm.cgid)	||
+	    __get_user(kern->msg_stime, &user->msg_stime)		||
+	    __get_user(kern->msg_rtime, &user->msg_rtime)		||
+	    __get_user(kern->msg_ctime, &user->msg_ctime)		||
+	    __get_user(kern->msg_ctime, &user->msg_cbytes)		||
+	    __get_user(kern->msg_ctime, &user->msg_qnum)		||
+	    __get_user(kern->msg_ctime, &user->msg_qbytes)		||
+	    __get_user(kern->msg_ctime, &user->msg_lspid)		||
+	    __get_user(kern->msg_ctime, &user->msg_lrpid))
 		return -EFAULT;
 	return 0;
 }
 
-static inline int sunos_msqid_put(struct msqid_ds32 *user,
+static inline int sunos_msqid_put(struct msqid_ds32 __user *user,
 				  struct msqid_ds *kern)
 {
-	if(put_user(kern->msg_perm.key, &user->msg_perm.key)		||
-	   __put_user(kern->msg_perm.uid, &user->msg_perm.uid)		||
-	   __put_user(kern->msg_perm.gid, &user->msg_perm.gid)		||
-	   __put_user(kern->msg_perm.cuid, &user->msg_perm.cuid)	||
-	   __put_user(kern->msg_perm.cgid, &user->msg_perm.cgid)	||
-	   __put_user(kern->msg_stime, &user->msg_stime)		||
-	   __put_user(kern->msg_rtime, &user->msg_rtime)		||
-	   __put_user(kern->msg_ctime, &user->msg_ctime)		||
-	   __put_user(kern->msg_ctime, &user->msg_cbytes)		||
-	   __put_user(kern->msg_ctime, &user->msg_qnum)			||
-	   __put_user(kern->msg_ctime, &user->msg_qbytes)		||
-	   __put_user(kern->msg_ctime, &user->msg_lspid)		||
-	   __put_user(kern->msg_ctime, &user->msg_lrpid))
+	if (put_user(kern->msg_perm.key, &user->msg_perm.key)		||
+	    __put_user(kern->msg_perm.uid, &user->msg_perm.uid)		||
+	    __put_user(kern->msg_perm.gid, &user->msg_perm.gid)		||
+	    __put_user(kern->msg_perm.cuid, &user->msg_perm.cuid)	||
+	    __put_user(kern->msg_perm.cgid, &user->msg_perm.cgid)	||
+	    __put_user(kern->msg_stime, &user->msg_stime)		||
+	    __put_user(kern->msg_rtime, &user->msg_rtime)		||
+	    __put_user(kern->msg_ctime, &user->msg_ctime)		||
+	    __put_user(kern->msg_ctime, &user->msg_cbytes)		||
+	    __put_user(kern->msg_ctime, &user->msg_qnum)		||
+	    __put_user(kern->msg_ctime, &user->msg_qbytes)		||
+	    __put_user(kern->msg_ctime, &user->msg_lspid)		||
+	    __put_user(kern->msg_ctime, &user->msg_lrpid))
 		return -EFAULT;
 	return 0;
 }
 
-static inline int sunos_msgbuf_get(struct msgbuf32 *user, struct msgbuf *kern, int len)
+static inline int sunos_msgbuf_get(struct msgbuf32 __user *user, struct msgbuf *kern, int len)
 {
-	if(get_user(kern->mtype, &user->mtype)	||
-	   __copy_from_user(kern->mtext, &user->mtext, len))
+	if (get_user(kern->mtype, &user->mtype)	||
+	    __copy_from_user(kern->mtext, &user->mtext, len))
 		return -EFAULT;
 	return 0;
 }
 
-static inline int sunos_msgbuf_put(struct msgbuf32 *user, struct msgbuf *kern, int len)
+static inline int sunos_msgbuf_put(struct msgbuf32 __user *user, struct msgbuf *kern, int len)
 {
-	if(put_user(kern->mtype, &user->mtype)	||
-	   __copy_to_user(user->mtext, kern->mtext, len))
+	if (put_user(kern->mtype, &user->mtype)	||
+	    __copy_to_user(user->mtext, kern->mtext, len))
 		return -EFAULT;
 	return 0;
 }
 
 asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
 {
-	struct sparc_stackf32 *sp;
+	struct sparc_stackf32 __user *sp;
 	struct msqid_ds kds;
 	struct msgbuf *kmbuf;
 	mm_segment_t old_fs = get_fs();
@@ -1032,13 +1030,13 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
 		rval = sys_msgget((key_t)arg1, (int)arg2);
 		break;
 	case 1:
-		if(!sunos_msqid_get((struct msqid_ds32 *)A(arg3), &kds)) {
+		if (!sunos_msqid_get((struct msqid_ds32 __user *)(unsigned long)arg3, &kds)) {
 			set_fs(KERNEL_DS);
 			rval = sys_msgctl((int)arg1, (int)arg2,
-					  (struct msqid_ds *)A(arg3));
+					  (struct msqid_ds __user *)(unsigned long)arg3);
 			set_fs(old_fs);
-			if(!rval)
-				rval = sunos_msqid_put((struct msqid_ds32 *)A(arg3),
+			if (!rval)
+				rval = sunos_msqid_put((struct msqid_ds32 __user *)(unsigned long)arg3,
 						       &kds);
 		} else
 			rval = -EFAULT;
@@ -1047,21 +1045,22 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
 		rval = -EFAULT;
 		kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3,
 						 GFP_KERNEL);
-		if(!kmbuf)
+		if (!kmbuf)
 			break;
-		sp = (struct sparc_stackf32 *)
+		sp = (struct sparc_stackf32 __user *)
 			(current_thread_info()->kregs->u_regs[UREG_FP] & 0xffffffffUL);
-		if(get_user(arg5, &sp->xxargs[0])) {
+		if (get_user(arg5, &sp->xxargs[0])) {
 			rval = -EFAULT;
 			kfree(kmbuf);
 			break;
 		}
 		set_fs(KERNEL_DS);
-		rval = sys_msgrcv((int)arg1, kmbuf, (size_t)arg3,
+		rval = sys_msgrcv((int)arg1, (struct msgbuf __user *) kmbuf,
+				  (size_t)arg3,
 				  (long)arg4, (int)arg5);
 		set_fs(old_fs);
-		if(!rval)
-			rval = sunos_msgbuf_put((struct msgbuf32 *)A(arg2),
+		if (!rval)
+			rval = sunos_msgbuf_put((struct msgbuf32 __user *)(unsigned long)arg2,
 						kmbuf, arg3);
 		kfree(kmbuf);
 		break;
@@ -1069,11 +1068,12 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
 		rval = -EFAULT;
 		kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3,
 						 GFP_KERNEL);
-		if(!kmbuf || sunos_msgbuf_get((struct msgbuf32 *)A(arg2),
-					      kmbuf, arg3))
+		if (!kmbuf || sunos_msgbuf_get((struct msgbuf32 __user *)(unsigned long)arg2,
+					       kmbuf, arg3))
 			break;
 		set_fs(KERNEL_DS);
-		rval = sys_msgsnd((int)arg1, kmbuf, (size_t)arg3, (int)arg4);
+		rval = sys_msgsnd((int)arg1, (struct msgbuf __user *) kmbuf,
+				  (size_t)arg3, (int)arg4);
 		set_fs(old_fs);
 		kfree(kmbuf);
 		break;
@@ -1095,40 +1095,40 @@ struct shmid_ds32 {
         unsigned short          shm_nattch;
 };
                                                         
-static inline int sunos_shmid_get(struct shmid_ds32 *user,
+static inline int sunos_shmid_get(struct shmid_ds32 __user *user,
 				  struct shmid_ds *kern)
 {
-	if(get_user(kern->shm_perm.key, &user->shm_perm.key)		||
-	   __get_user(kern->shm_perm.uid, &user->shm_perm.uid)		||
-	   __get_user(kern->shm_perm.gid, &user->shm_perm.gid)		||
-	   __get_user(kern->shm_perm.cuid, &user->shm_perm.cuid)	||
-	   __get_user(kern->shm_perm.cgid, &user->shm_perm.cgid)	||
-	   __get_user(kern->shm_segsz, &user->shm_segsz)		||
-	   __get_user(kern->shm_atime, &user->shm_atime)		||
-	   __get_user(kern->shm_dtime, &user->shm_dtime)		||
-	   __get_user(kern->shm_ctime, &user->shm_ctime)		||
-	   __get_user(kern->shm_cpid, &user->shm_cpid)			||
-	   __get_user(kern->shm_lpid, &user->shm_lpid)			||
-	   __get_user(kern->shm_nattch, &user->shm_nattch))
+	if (get_user(kern->shm_perm.key, &user->shm_perm.key)		||
+	    __get_user(kern->shm_perm.uid, &user->shm_perm.uid)		||
+	    __get_user(kern->shm_perm.gid, &user->shm_perm.gid)		||
+	    __get_user(kern->shm_perm.cuid, &user->shm_perm.cuid)	||
+	    __get_user(kern->shm_perm.cgid, &user->shm_perm.cgid)	||
+	    __get_user(kern->shm_segsz, &user->shm_segsz)		||
+	    __get_user(kern->shm_atime, &user->shm_atime)		||
+	    __get_user(kern->shm_dtime, &user->shm_dtime)		||
+	    __get_user(kern->shm_ctime, &user->shm_ctime)		||
+	    __get_user(kern->shm_cpid, &user->shm_cpid)			||
+	    __get_user(kern->shm_lpid, &user->shm_lpid)			||
+	    __get_user(kern->shm_nattch, &user->shm_nattch))
 		return -EFAULT;
 	return 0;
 }
 
-static inline int sunos_shmid_put(struct shmid_ds32 *user,
+static inline int sunos_shmid_put(struct shmid_ds32 __user *user,
 				  struct shmid_ds *kern)
 {
-	if(put_user(kern->shm_perm.key, &user->shm_perm.key)		||
-	   __put_user(kern->shm_perm.uid, &user->shm_perm.uid)		||
-	   __put_user(kern->shm_perm.gid, &user->shm_perm.gid)		||
-	   __put_user(kern->shm_perm.cuid, &user->shm_perm.cuid)	||
-	   __put_user(kern->shm_perm.cgid, &user->shm_perm.cgid)	||
-	   __put_user(kern->shm_segsz, &user->shm_segsz)		||
-	   __put_user(kern->shm_atime, &user->shm_atime)		||
-	   __put_user(kern->shm_dtime, &user->shm_dtime)		||
-	   __put_user(kern->shm_ctime, &user->shm_ctime)		||
-	   __put_user(kern->shm_cpid, &user->shm_cpid)			||
-	   __put_user(kern->shm_lpid, &user->shm_lpid)			||
-	   __put_user(kern->shm_nattch, &user->shm_nattch))
+	if (put_user(kern->shm_perm.key, &user->shm_perm.key)		||
+	    __put_user(kern->shm_perm.uid, &user->shm_perm.uid)		||
+	    __put_user(kern->shm_perm.gid, &user->shm_perm.gid)		||
+	    __put_user(kern->shm_perm.cuid, &user->shm_perm.cuid)	||
+	    __put_user(kern->shm_perm.cgid, &user->shm_perm.cgid)	||
+	    __put_user(kern->shm_segsz, &user->shm_segsz)		||
+	    __put_user(kern->shm_atime, &user->shm_atime)		||
+	    __put_user(kern->shm_dtime, &user->shm_dtime)		||
+	    __put_user(kern->shm_ctime, &user->shm_ctime)		||
+	    __put_user(kern->shm_cpid, &user->shm_cpid)			||
+	    __put_user(kern->shm_lpid, &user->shm_lpid)			||
+	    __put_user(kern->shm_nattch, &user->shm_nattch))
 		return -EFAULT;
 	return 0;
 }
@@ -1143,25 +1143,26 @@ asmlinkage int sunos_shmsys(int op, u32 arg1, u32 arg2, u32 arg3)
 	switch(op) {
 	case 0:
 		/* do_shmat(): attach a shared memory area */
-		rval = do_shmat((int)arg1,(char *)A(arg2),(int)arg3,&raddr);
-		if(!rval)
+		rval = do_shmat((int)arg1,(char __user *)(unsigned long)arg2,(int)arg3,&raddr);
+		if (!rval)
 			rval = (int) raddr;
 		break;
 	case 1:
 		/* sys_shmctl(): modify shared memory area attr. */
-		if(!sunos_shmid_get((struct shmid_ds32 *)A(arg3), &ksds)) {
+		if (!sunos_shmid_get((struct shmid_ds32 __user *)(unsigned long)arg3, &ksds)) {
 			set_fs(KERNEL_DS);
-			rval = sys_shmctl((int)arg1,(int)arg2, &ksds);
+			rval = sys_shmctl((int) arg1,(int) arg2,
+					  (struct shmid_ds __user *) &ksds);
 			set_fs(old_fs);
-			if(!rval)
-				rval = sunos_shmid_put((struct shmid_ds32 *)A(arg3),
+			if (!rval)
+				rval = sunos_shmid_put((struct shmid_ds32 __user *)(unsigned long)arg3,
 						       &ksds);
 		} else
 			rval = -EFAULT;
 		break;
 	case 2:
 		/* sys_shmdt(): detach a shared memory area */
-		rval = sys_shmdt((char *)A(arg1));
+		rval = sys_shmdt((char __user *)(unsigned long)arg1);
 		break;
 	case 3:
 		/* sys_shmget(): get a shared memory area */
@@ -1203,64 +1204,60 @@ static inline int check_nonblock(int ret, int fd)
 	return ret;
 }
 
-extern asmlinkage int sys32_readv(u32 fd, u32 vector, s32 count);
-extern asmlinkage int sys32_writev(u32 fd, u32 vector, s32 count);
-
-asmlinkage int sunos_read(unsigned int fd, u32 buf, u32 count)
+asmlinkage int sunos_read(unsigned int fd, char __user *buf, u32 count)
 {
 	int ret;
 
-	ret = check_nonblock(sys_read(fd, (char *)A(buf), count), fd);
+	ret = check_nonblock(sys_read(fd, buf, count), fd);
 	return ret;
 }
 
-asmlinkage int sunos_readv(u32 fd, u32 vector, s32 count)
+asmlinkage int sunos_readv(u32 fd, void __user *vector, s32 count)
 {
 	int ret;
 
-	ret = check_nonblock(sys32_readv(fd, vector, count), fd);
+	ret = check_nonblock(compat_sys_readv(fd, vector, count), fd);
 	return ret;
 }
 
-asmlinkage int sunos_write(unsigned int fd, u32 buf, u32 count)
+asmlinkage int sunos_write(unsigned int fd, char __user *buf, u32 count)
 {
 	int ret;
 
-	ret = check_nonblock(sys_write(fd, (char *)A(buf), count), fd);
+	ret = check_nonblock(sys_write(fd, buf, count), fd);
 	return ret;
 }
 
-asmlinkage int sunos_writev(u32 fd, u32 vector, s32 count)
+asmlinkage int sunos_writev(u32 fd, void __user *vector, s32 count)
 {
 	int ret;
 
-	ret = check_nonblock(sys32_writev(fd, vector, count), fd);
+	ret = check_nonblock(compat_sys_writev(fd, vector, count), fd);
 	return ret;
 }
 
-asmlinkage int sunos_recv(int fd, u32 ubuf, int size, unsigned flags)
+asmlinkage int sunos_recv(u32 __fd, void __user *ubuf, int size, unsigned flags)
 {
-	int ret;
+	int ret, fd = (int) __fd;
 
-	ret = check_nonblock(sys_recv(fd, (void *)A(ubuf), size, flags), fd);
+	ret = check_nonblock(sys_recv(fd, ubuf, size, flags), fd);
 	return ret;
 }
 
-asmlinkage int sunos_send(int fd, u32 buff, int len, unsigned flags)
+asmlinkage int sunos_send(u32 __fd, void __user *buff, int len, unsigned flags)
 {
-	int ret;
+	int ret, fd = (int) __fd;
 
-	ret = check_nonblock(sys_send(fd, (void *)A(buff), len, flags), fd);
+	ret = check_nonblock(sys_send(fd, buff, len, flags), fd);
 	return ret;
 }
 
-asmlinkage int sunos_accept(int fd, u32 sa, u32 addrlen)
+asmlinkage int sunos_accept(u32 __fd, struct sockaddr __user *sa, int __user *addrlen)
 {
-	int ret;
+	int ret, fd = (int) __fd;
 
 	while (1) {
-		ret = check_nonblock(sys_accept(fd, (struct sockaddr *)A(sa),
-						(int *)A(addrlen)), fd);
+		ret = check_nonblock(sys_accept(fd, sa, addrlen), fd);
 		if (ret != -ENETUNREACH && ret != -EHOSTUNREACH)
 			break;
 	}
@@ -1269,7 +1266,9 @@ asmlinkage int sunos_accept(int fd, u32 sa, u32 addrlen)
 
 #define SUNOS_SV_INTERRUPT 2
 
-asmlinkage int sunos_sigaction (int sig, u32 act, u32 oact)
+asmlinkage int sunos_sigaction (int sig,
+				struct old_sigaction32 __user *act,
+				struct old_sigaction32 __user *oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -1278,11 +1277,11 @@ asmlinkage int sunos_sigaction (int sig, u32 act, u32 oact)
 		compat_old_sigset_t mask;
 		u32 u_handler;
 
-		if (get_user(u_handler, &((struct old_sigaction32 *)A(act))->sa_handler) ||
-		    __get_user(new_ka.sa.sa_flags, &((struct old_sigaction32 *)A(act))->sa_flags))
+		if (get_user(u_handler, &act->sa_handler) ||
+		    __get_user(new_ka.sa.sa_flags, &act->sa_flags))
 			return -EFAULT;
 		new_ka.sa.sa_handler = (void *) (long) u_handler;
-		__get_user(mask, &((struct old_sigaction32 *)A(act))->sa_mask);
+		__get_user(mask, &act->sa_mask);
 		new_ka.sa.sa_restorer = NULL;
 		new_ka.ka_restorer = NULL;
 		siginitset(&new_ka.sa.sa_mask, mask);
@@ -1293,18 +1292,22 @@ asmlinkage int sunos_sigaction (int sig, u32 act, u32 oact)
 
 	if (!ret && oact) {
 		old_ka.sa.sa_flags ^= SUNOS_SV_INTERRUPT;
-		if (put_user((long)old_ka.sa.sa_handler, &((struct old_sigaction32 *)A(oact))->sa_handler) ||
-		    __put_user(old_ka.sa.sa_flags, &((struct old_sigaction32 *)A(oact))->sa_flags))
+		if (put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) ||
+		    __put_user(old_ka.sa.sa_flags, &oact->sa_flags))
 			return -EFAULT;
-		__put_user(old_ka.sa.sa_mask.sig[0], &((struct old_sigaction32 *)A(oact))->sa_mask);
+		__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
 	}
 
 	return ret;
 }
 
-asmlinkage int sunos_setsockopt(int fd, int level, int optname, u32 optval,
-				int optlen)
+asmlinkage int sunos_setsockopt(u32 __fd, u32 __level, u32 __optname,
+				char __user *optval, u32 __optlen)
 {
+	int fd = (int) __fd;
+	int level = (int) __level;
+	int optname = (int) __optname;
+	int optlen = (int) __optlen;
 	int tr_opt = optname;
 	int ret;
 
@@ -1313,13 +1316,17 @@ asmlinkage int sunos_setsockopt(int fd, int level, int optname, u32 optval,
 		if (tr_opt >=2 && tr_opt <= 6)
 			tr_opt += 30;
 	}
-	ret = sys_setsockopt(fd, level, tr_opt, (char *)A(optval), optlen);
+	ret = sys_setsockopt(fd, level, tr_opt,
+			     optval, optlen);
 	return ret;
 }
 
-asmlinkage int sunos_getsockopt(int fd, int level, int optname,
-				u32 optval, u32 optlen)
+asmlinkage int sunos_getsockopt(u32 __fd, u32 __level, u32 __optname,
+				char __user *optval, int __user *optlen)
 {
+	int fd = (int) __fd;
+	int level = (int) __level;
+	int optname = (int) __optname;
 	int tr_opt = optname;
 	int ret;
 
@@ -1328,6 +1335,7 @@ asmlinkage int sunos_getsockopt(int fd, int level, int optname,
 		if (tr_opt >=2 && tr_opt <= 6)
 			tr_opt += 30;
 	}
-	ret = compat_sys_getsockopt(fd, level, tr_opt, (void*)(unsigned long)optval, (void*)(unsigned long)optlen);
+	ret = compat_sys_getsockopt(fd, level, tr_opt,
+				    optval, optlen);
 	return ret;
 }
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 3c7ef2da1..966e2b11f 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -19,62 +19,62 @@
 
 	.globl sys_call_table32
 sys_call_table32:
-/*0*/	.word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write
-/*5*/	.word sparc32_open, sys_close, compat_sys_wait4, sys_creat, sys_link
+/*0*/	.word sys_restart_syscall, sys32_exit, sys_fork, sys_read, sys_write
+/*5*/	.word sys32_open, sys_close, sys32_wait4, sys32_creat, sys_link
 /*10*/  .word sys_unlink, sunos_execv, sys_chdir, sys32_chown16, sys32_mknod
-/*15*/	.word sys32_chmod, sys32_lchown16, sparc_brk, sys_perfctr, sys32_lseek
+/*15*/	.word sys_chmod, sys32_lchown16, sparc_brk, sys32_perfctr, sys32_lseek
 /*20*/	.word sys_getpid, sys_capget, sys_capset, sys32_setuid16, sys32_getuid16
 /*25*/	.word sys_time, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause
-/*30*/	.word compat_sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice
-	.word sys_chown, sys_sync, sys_kill, compat_sys_newstat, sys32_sendfile
+/*30*/	.word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
+	.word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile
 /*40*/	.word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid
-	.word sys_umount, sys32_setgid16, sys32_getgid16, sys_signal, sys32_geteuid16
+	.word sys32_umount, sys32_setgid16, sys32_getgid16, sys32_signal, sys32_geteuid16
 /*50*/	.word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
-	.word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve
-/*60*/	.word sys_umask, sys_chroot, compat_sys_newfstat, sys_fstat64, sys_getpagesize
-	.word sys_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid
-/*70*/	.word sys_getegid, sys32_mmap, sys_setreuid, sys_munmap, sys_mprotect
+	.word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve
+/*60*/	.word sys32_umask, sys_chroot, compat_sys_newfstat, sys_fstat64, sys_getpagesize
+	.word sys32_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid
+/*70*/	.word sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect
 	.word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys32_getgroups16
-/*80*/	.word sys32_setgroups16, sys_getpgrp, sys_setgroups, compat_sys_setitimer, sys32_ftruncate64
-	.word sys_swapon, compat_sys_getitimer, sys_setuid, sys_sethostname, sys_setgid
+/*80*/	.word sys32_setgroups16, sys_getpgrp, sys32_setgroups, sys32_setitimer, sys32_ftruncate64
+	.word sys32_swapon, sys32_getitimer, sys_setuid, sys32_sethostname, sys_setgid
 /*90*/	.word sys_dup2, sys_setfsuid, compat_sys_fcntl, sys32_select, sys_setfsgid
-	.word sys_fsync, sys_setpriority32, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall
-/*100*/ .word sys_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending
+	.word sys_fsync, sys32_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall
+/*100*/ .word sys32_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending
 	.word sys32_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_setresuid, sys_getresuid
 /*110*/	.word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall
-	.word sys_getgroups, sys32_gettimeofday, compat_sys_getrusage, sys_nis_syscall, sys_getcwd
-/*120*/	.word sys32_readv, sys32_writev, sys32_settimeofday, sys32_fchown16, sys_fchmod
+	.word sys32_getgroups, sys32_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd
+/*120*/	.word compat_sys_readv, compat_sys_writev, sys32_settimeofday, sys32_fchown16, sys_fchmod
 	.word sys_nis_syscall, sys32_setreuid16, sys32_setregid16, sys_rename, sys_truncate
 /*130*/	.word sys_ftruncate, sys_flock, sys_lstat64, sys_nis_syscall, sys_nis_syscall
-	.word sys_nis_syscall, sys_mkdir, sys_rmdir, sys32_utimes, sys_stat64
-/*140*/	.word sys32_sendfile64, sys_nis_syscall, compat_sys_futex, sys_gettid, compat_sys_getrlimit
-	.word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys32_pciconfig_read, sys32_pciconfig_write
+	.word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, sys_stat64
+/*140*/	.word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit
+	.word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write
 /*150*/	.word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64
 	.word compat_sys_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount
-/*160*/	.word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall
-	.word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys_setxattr
-/*170*/	.word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents
-	.word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
-/*180*/	.word sys_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
-	.word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname
-/*190*/	.word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
-	.word sys_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask
-/*200*/	.word sys_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, old32_readdir
-	.word sys32_readahead, sys32_socketcall, sys_syslog, sys32_lookup_dcookie, sys32_fadvise64
-/*210*/	.word sys32_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys32_sysinfo
+/*160*/	.word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall
+	.word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr
+/*170*/	.word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents
+	.word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
+/*180*/	.word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
+	.word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname
+/*190*/	.word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
+	.word sys32_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask
+/*200*/	.word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, old32_readdir
+	.word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
+/*210*/	.word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
 	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
-/*220*/	.word compat_sys_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys_getpgid
+/*220*/	.word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
 	.word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
 /*230*/	.word sys32_select, sys_time, sys_nis_syscall, sys_stime, compat_statfs64
-	.word compat_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
-/*240*/	.word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler
-	.word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
-/*250*/	.word sys32_mremap, sys32_sysctl, sys_getsid, sys_fdatasync, sys32_nfsservctl
-	.word sys_ni_syscall, compat_clock_settime, compat_clock_gettime, compat_clock_getres, compat_clock_nanosleep
-/*260*/	.word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, compat_timer_settime, compat_timer_gettime, sys_timer_getoverrun
+	.word compat_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
+/*240*/	.word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
+	.word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
+/*250*/	.word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
+	.word sys_ni_syscall, sys32_clock_settime, compat_clock_gettime, compat_clock_getres, sys32_clock_nanosleep
+/*260*/	.word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_timer_gettime, sys_timer_getoverrun
 	.word sys_timer_delete, sys32_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
-/*270*/	.word compat_sys_io_submit, sys_io_cancel, compat_sys_io_getevents, compat_sys_mq_open, sys_mq_unlink
-	.word sys32_mq_timedsend, sys32_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, sys_ni_syscall
+/*270*/	.word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
+	.word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, sys_ni_syscall
 /*280*/	.word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall
 
 	/* Now the 64-bit native Linux syscall table. */
@@ -90,7 +90,7 @@ sys_call_table:
 /*20*/	.word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
 /*25*/	.word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
 /*30*/	.word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
-	.word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile
+	.word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
 /*40*/	.word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall
 	.word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
 /*50*/	.word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
@@ -148,12 +148,12 @@ sys_call_table:
 	.align 4
 	.globl sunos_sys_table
 sunos_sys_table:
-/*0*/	.word sunos_indir, sparc_exit, sys_fork
+/*0*/	.word sunos_indir, sys32_exit, sys_fork
 	.word sunos_read, sunos_write, sunos_open
 	.word sys_close, sunos_wait4, sys_creat
 	.word sys_link, sys_unlink, sunos_execv
 	.word sys_chdir, sunos_nosys, sys32_mknod
-	.word sys32_chmod, sys32_lchown16, sunos_brk
+	.word sys_chmod, sys32_lchown16, sunos_brk
 	.word sunos_nosys, sys32_lseek, sunos_getpid
 	.word sunos_nosys, sunos_nosys, sunos_nosys
 	.word sunos_getuid, sunos_nosys, sys_ptrace
@@ -180,32 +180,32 @@ sunos_sys_table:
 	.word compat_sys_getitimer, sys_gethostname, sys_sethostname
 	.word sunos_getdtablesize, sys_dup2, sunos_nop
 	.word compat_sys_fcntl, sunos_select, sunos_nop
-	.word sys_fsync, sys_setpriority32, sys_socket
-	.word sys_connect, sunos_accept
+	.word sys_fsync, sys32_setpriority, sys32_socket
+	.word sys32_connect, sunos_accept
 /*100*/	.word sys_getpriority, sunos_send, sunos_recv
-	.word sunos_nosys, sys_bind, sunos_setsockopt
-	.word sys_listen, sunos_nosys, sunos_sigaction
+	.word sunos_nosys, sys32_bind, sunos_setsockopt
+	.word sys32_listen, sunos_nosys, sunos_sigaction
 	.word sunos_sigblock, sunos_sigsetmask, sys_sigpause
-	.word sys32_sigstack, compat_sys_recvmsg, compat_sys_sendmsg
+	.word sys32_sigstack, sys32_recvmsg, sys32_sendmsg
 	.word sunos_nosys, sys32_gettimeofday, compat_sys_getrusage
 	.word sunos_getsockopt, sunos_nosys, sunos_readv
 	.word sunos_writev, sys32_settimeofday, sys32_fchown16
 	.word sys_fchmod, sys32_recvfrom, sys32_setreuid16
 	.word sys32_setregid16, sys_rename, sys_truncate
 	.word sys_ftruncate, sys_flock, sunos_nosys
-	.word sys32_sendto, sys_shutdown, sys_socketpair
+	.word sys32_sendto, sys32_shutdown, sys32_socketpair
 	.word sys_mkdir, sys_rmdir, sys32_utimes
-	.word sys32_sigreturn, sunos_nosys, sys_getpeername
+	.word sys32_sigreturn, sunos_nosys, sys32_getpeername
 	.word sunos_gethostid, sunos_nosys, compat_sys_getrlimit
 	.word compat_sys_setrlimit, sunos_killpg, sunos_nosys
 	.word sunos_nosys, sunos_nosys
-/*150*/	.word sys_getsockname, sunos_nosys, sunos_nosys
+/*150*/	.word sys32_getsockname, sunos_nosys, sunos_nosys
 	.word sys_poll, sunos_nosys, sunos_nosys
 	.word sunos_getdirentries, compat_sys_statfs, compat_sys_fstatfs
 	.word sys_oldumount, sunos_nosys, sunos_nosys
 	.word sys_getdomainname, sys_setdomainname
 	.word sunos_nosys, sys_quotactl, sunos_nosys
-	.word sunos_mount, sys_ustat, sunos_semsys
+	.word sunos_nosys, sys_ustat, sunos_semsys
 	.word sunos_nosys, sunos_shmsys, sunos_audit
 	.word sunos_nosys, sunos_getdents, sys_setsid
 	.word sys_fchdir, sunos_nosys, sunos_nosys
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 57ebd69e5..06e1579f0 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -1035,7 +1035,8 @@ static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val
 		ft->clock_tick_ref = cpu_data(cpu).clock_tick;
 	}
 	if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
-	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
+	    (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+	    (val == CPUFREQ_RESUMECHANGE)) {
 		cpu_data(cpu).udelay_val =
 			cpufreq_scale(ft->udelay_val_ref,
 				      ft->ref_freq,
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 47d685193..b4fb0fbef 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -1708,7 +1708,7 @@ void instruction_dump (unsigned int *pc)
 	printk("\n");
 }
 
-void user_instruction_dump (unsigned int *pc)
+static void user_instruction_dump (unsigned int __user *pc)
 {
 	int i;
 	unsigned int buf[9];
@@ -1813,7 +1813,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
 			regs->tpc &= 0xffffffff;
 			regs->tnpc &= 0xffffffff;
 		}
-		user_instruction_dump ((unsigned int *) regs->tpc);
+		user_instruction_dump ((unsigned int __user *) regs->tpc);
 	}
 #ifdef CONFIG_SMP
 	smp_report_regs();
@@ -1838,7 +1838,7 @@ void do_illegal_instruction(struct pt_regs *regs)
 		die_if_kernel("Kernel illegal instruction", regs);
 	if (test_thread_flag(TIF_32BIT))
 		pc = (u32)pc;
-	if (get_user(insn, (u32 *)pc) != -EFAULT) {
+	if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
 		if ((insn & 0xc1ffc000) == 0x81700000) /* POPC */ {
 			if (handle_popc(insn, regs))
 				return;
@@ -1862,9 +1862,12 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
 	if (regs->tstate & TSTATE_PRIV) {
 		extern void kernel_unaligned_trap(struct pt_regs *regs,
 						  unsigned int insn, 
-						  unsigned long sfar, unsigned long sfsr);
+						  unsigned long sfar,
+						  unsigned long sfsr);
 
-		return kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc), sfar, sfsr);
+		kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc),
+				      sfar, sfsr);
+		return;
 	}
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index 4e4ad5e22..646a788fa 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -128,12 +128,12 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
 		win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
 		value = win->locals[reg - 16];
 	} else if (test_thread_flag(TIF_32BIT)) {
-		struct reg_window32 *win32;
-		win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
+		struct reg_window32 __user *win32;
+		win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
 		get_user(value, &win32->locals[reg - 16]);
 	} else {
-		struct reg_window *win;
-		win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
+		struct reg_window __user *win;
+		win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
 		get_user(value, &win->locals[reg - 16]);
 	}
 	return value;
@@ -158,8 +158,8 @@ static unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs)
 	}
 }
 
-static unsigned long compute_effective_address(struct pt_regs *regs,
-					       unsigned int insn, unsigned int rd)
+unsigned long compute_effective_address(struct pt_regs *regs,
+					unsigned int insn, unsigned int rd)
 {
 	unsigned int rs1 = (insn >> 14) & 0x1f;
 	unsigned int rs2 = insn & 0x1f;
@@ -175,7 +175,7 @@ static unsigned long compute_effective_address(struct pt_regs *regs,
 }
 
 /* This is just to make gcc think die_if_kernel does return... */
-static void unaligned_panic(char *str, struct pt_regs *regs)
+static void __attribute_used__ unaligned_panic(char *str, struct pt_regs *regs)
 {
 	die_if_kernel(str, regs);
 }
@@ -477,12 +477,12 @@ int handle_popc(u32 insn, struct pt_regs *regs)
 			regs->u_regs[rd] = ret;
 	} else {
 		if (test_thread_flag(TIF_32BIT)) {
-			struct reg_window32 *win32;
-			win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
+			struct reg_window32 __user *win32;
+			win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
 			put_user(ret, &win32->locals[rd - 16]);
 		} else {
-			struct reg_window *win;
-			win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
+			struct reg_window __user *win;
+			win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
 			put_user(ret, &win->locals[rd - 16]);
 		}
 	}
@@ -540,10 +540,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
 			data_access_exception(regs, 0, addr);
 			return 1;
 		}
-		if (put_user (first >> 32, (u32 *)addr) ||
-		    __put_user ((u32)first, (u32 *)(addr + 4)) ||
-		    __put_user (second >> 32, (u32 *)(addr + 8)) ||
-		    __put_user ((u32)second, (u32 *)(addr + 12))) {
+		if (put_user (first >> 32, (u32 __user *)addr) ||
+		    __put_user ((u32)first, (u32 __user *)(addr + 4)) ||
+		    __put_user (second >> 32, (u32 __user *)(addr + 8)) ||
+		    __put_user ((u32)second, (u32 __user *)(addr + 12))) {
 		    	data_access_exception(regs, 0, addr);
 		    	return 1;
 		}
@@ -568,10 +568,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
 		for (i = 0; i < size; i++)
 			data[i] = 0;
 		
-		err = get_user (data[0], (u32 *)addr);
+		err = get_user (data[0], (u32 __user *) addr);
 		if (!err) {
 			for (i = 1; i < size; i++)
-				err |= __get_user (data[i], (u32 *)(addr + 4*i));
+				err |= __get_user (data[i], (u32 __user *)(addr + 4*i));
 		}
 		if (err && !(asi & 0x2 /* NF */)) {
 			data_access_exception(regs, 0, addr);
@@ -620,13 +620,13 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs)
 		if ((insn & 0x780000) == 0x180000)
 			reg[1] = 0;
 	} else if (test_thread_flag(TIF_32BIT)) {
-		put_user(0, (int *)reg);
+		put_user(0, (int __user *) reg);
 		if ((insn & 0x780000) == 0x180000)
-			put_user(0, ((int *)reg) + 1);
+			put_user(0, ((int __user *) reg) + 1);
 	} else {
-		put_user(0, reg);
+		put_user(0, (unsigned long __user *) reg);
 		if ((insn & 0x780000) == 0x180000)
-			put_user(0, reg + 1);
+			put_user(0, (unsigned long __user *) reg + 1);
 	}
 	advance(regs);
 }
@@ -646,13 +646,13 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
 		die_if_kernel("lddfmna from kernel", regs);
 	if (test_thread_flag(TIF_32BIT))
 		pc = (u32)pc;
-	if (get_user(insn, (u32 *)pc) != -EFAULT) {
+	if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
 		asi = sfsr >> 16;
 		if ((asi > ASI_SNFL) ||
 		    (asi < ASI_P))
 			goto daex;
-		if (get_user(first, (u32 *)sfar) ||
-		     get_user(second, (u32 *)(sfar + 4))) {
+		if (get_user(first, (u32 __user *)sfar) ||
+		     get_user(second, (u32 __user *)(sfar + 4))) {
 			if (asi & 0x2) /* NF */ {
 				first = 0; second = 0;
 			} else
@@ -698,7 +698,7 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
 		die_if_kernel("stdfmna from kernel", regs);
 	if (test_thread_flag(TIF_32BIT))
 		pc = (u32)pc;
-	if (get_user(insn, (u32 *)pc) != -EFAULT) {
+	if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
 		freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20);
 		asi = sfsr >> 16;
 		value = 0;
@@ -717,8 +717,8 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
 			value = __swab64p(&value); break;
 		default: goto daex;
 		}
-		if (put_user (value >> 32, (u32 *)sfar) ||
-		    __put_user ((u32)value, (u32 *)(sfar + 4)))
+		if (put_user (value >> 32, (u32 __user *) sfar) ||
+		    __put_user ((u32)value, (u32 __user *)(sfar + 4)))
 			goto daex;
 	} else {
 daex:		data_access_exception(regs, sfsr, sfar);
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index f94b2b08b..230e59f18 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -10,7 +10,8 @@ lib-y := PeeCeeI.o blockops.o strlen.o strncmp.o \
 	 VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o \
 	 VIScsumcopyusr.o VISsave.o atomic.o rwlock.o bitops.o \
 	 U3memcpy.o U3copy_from_user.o U3copy_to_user.o \
-	 U3copy_in_user.o mcount.o ipcsum.o rwsem.o xor.o
+	 U3copy_in_user.o mcount.o ipcsum.o rwsem.o xor.o splock.o \
+	 find_bit.o
 
 lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o
 lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/sparc64/lib/debuglocks.c b/arch/sparc64/lib/debuglocks.c
index 341cce76b..9e083e27d 100644
--- a/arch/sparc64/lib/debuglocks.c
+++ b/arch/sparc64/lib/debuglocks.c
@@ -55,7 +55,7 @@ void _do_spin_lock(spinlock_t *lock, char *str)
 {
 	unsigned long caller, val;
 	int stuck = INIT_STUCK;
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 	int shown = 0;
 
 	GET_CALLER(caller);
@@ -80,12 +80,14 @@ again:
 	lock->owner_cpu = cpu;
 	current->thread.smp_lock_count++;
 	current->thread.smp_lock_pc = ((unsigned int)caller);
+
+	put_cpu();
 }
 
 int _spin_trylock(spinlock_t *lock)
 {
 	unsigned long val, caller;
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 
 	GET_CALLER(caller);
 	__asm__ __volatile__("ldstub [%1], %0"
@@ -99,6 +101,9 @@ int _spin_trylock(spinlock_t *lock)
 		current->thread.smp_lock_count++;
 		current->thread.smp_lock_pc = ((unsigned int)caller);
 	}
+
+	put_cpu();
+
 	return val == 0;
 }
 
@@ -117,7 +122,7 @@ void _do_read_lock (rwlock_t *rw, char *str)
 {
 	unsigned long caller, val;
 	int stuck = INIT_STUCK;
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 	int shown = 0;
 
 	GET_CALLER(caller);
@@ -148,13 +153,15 @@ wlock_again:
 	rw->reader_pc[cpu] = ((unsigned int)caller);
 	current->thread.smp_lock_count++;
 	current->thread.smp_lock_pc = ((unsigned int)caller);
+
+	put_cpu();
 }
 
 void _do_read_unlock (rwlock_t *rw, char *str)
 {
 	unsigned long caller, val;
 	int stuck = INIT_STUCK;
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 	int shown = 0;
 
 	GET_CALLER(caller);
@@ -181,13 +188,15 @@ runlock_again:
 		}
 		goto runlock_again;
 	}
+
+	put_cpu();
 }
 
 void _do_write_lock (rwlock_t *rw, char *str)
 {
 	unsigned long caller, val;
 	int stuck = INIT_STUCK;
-	int cpu = smp_processor_id();
+	int cpu = get_cpu();
 	int shown = 0;
 
 	GET_CALLER(caller);
@@ -263,6 +272,8 @@ wlock_again:
 	rw->writer_cpu = cpu;
 	current->thread.smp_lock_count++;
 	current->thread.smp_lock_pc = ((unsigned int)caller);
+
+	put_cpu();
 }
 
 void _do_write_unlock(rwlock_t *rw)
@@ -299,4 +310,65 @@ wlock_again:
 	}
 }
 
+int _do_write_trylock (rwlock_t *rw, char *str)
+{
+	unsigned long caller, val;
+	int cpu = get_cpu();
+
+	GET_CALLER(caller);
+
+	/* Try to acuire the write bit.  */
+	__asm__ __volatile__(
+"	mov	1, %%g3\n"
+"	sllx	%%g3, 63, %%g3\n"
+"	ldx	[%0], %%g5\n"
+"	brlz,pn	%%g5, 1f\n"
+"	 or	%%g5, %%g3, %%g7\n"
+"	casx	[%0], %%g5, %%g7\n"
+"	membar	#StoreLoad | #StoreStore\n"
+"	ba,pt	%%xcc, 2f\n"
+"	 sub	%%g5, %%g7, %0\n"
+"1:	mov	1, %0\n"
+"2:"	: "=r" (val)
+	: "0" (&(rw->lock))
+	: "g3", "g5", "g7", "memory");
+
+	if (val) {
+		put_cpu();
+		return 0;
+	}
+
+	if ((rw->lock & ((1UL<<63)-1UL)) != 0UL) {
+		/* Readers still around, drop the write
+		 * lock, return failure.
+		 */
+		__asm__ __volatile__(
+"		mov	1, %%g3\n"
+"		sllx	%%g3, 63, %%g3\n"
+"1:		ldx	[%0], %%g5\n"
+"		andn	%%g5, %%g3, %%g7\n"
+"		casx	[%0], %%g5, %%g7\n"
+"		cmp	%%g5, %%g7\n"
+"		bne,pn	%%xcc, 1b\n"
+"		 membar	#StoreLoad | #StoreStore"
+		: /* no outputs */
+		: "r" (&(rw->lock))
+		: "g3", "g5", "g7", "cc", "memory");
+
+		put_cpu();
+
+		return 0;
+	}
+
+	/* We have it, say who we are. */
+	rw->writer_pc = ((unsigned int)caller);
+	rw->writer_cpu = cpu;
+	current->thread.smp_lock_count++;
+	current->thread.smp_lock_pc = ((unsigned int)caller);
+
+	put_cpu();
+
+	return 1;
+}
+
 #endif /* CONFIG_SMP */
diff --git a/arch/sparc64/math-emu/math.c b/arch/sparc64/math-emu/math.c
index 48dfa37dd..2ae05cd7b 100644
--- a/arch/sparc64/math-emu/math.c
+++ b/arch/sparc64/math-emu/math.c
@@ -185,7 +185,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)
 		die_if_kernel("unfinished/unimplemented FPop from kernel", regs);
 	if (test_thread_flag(TIF_32BIT))
 		pc = (u32)pc;
-	if (get_user(insn, (u32 *)pc) != -EFAULT) {
+	if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
 		if ((insn & 0xc1f80000) == 0x81a00000) /* FPOP1 */ {
 			switch ((insn >> 5) & 0x1ff) {
 			/* QUAD - ftt == 3 */
@@ -298,14 +298,14 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)
 				else if (freg < 16)
 					XR = regs->u_regs[freg];
 				else if (test_thread_flag(TIF_32BIT)) {
-					struct reg_window32 *win32;
+					struct reg_window32 __user *win32;
 					flushw_user ();
-					win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
+					win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
 					get_user(XR, &win32->locals[freg - 16]);
 				} else {
-					struct reg_window *win;
+					struct reg_window __user *win;
 					flushw_user ();
-					win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
+					win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
 					get_user(XR, &win->locals[freg - 16]);
 				}
 				IR = 0;
diff --git a/arch/sparc64/math-emu/sfp-util.h b/arch/sparc64/math-emu/sfp-util.h
index bdde3da0f..31e474738 100644
--- a/arch/sparc64/math-emu/sfp-util.h
+++ b/arch/sparc64/math-emu/sfp-util.h
@@ -11,106 +11,106 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
-#define add_ssaaaa(sh, sl, ah, al, bh, bl) 						\
-  __asm__ ("addcc %4,%5,%1\n\
-  	    add %2,%3,%0\n\
-  	    bcs,a,pn %%xcc, 1f\n\
-  	    add %0, 1, %0\n\
-  	    1:"										\
-	   : "=r" ((UDItype)(sh)),				      			\
-	     "=&r" ((UDItype)(sl))				      			\
-	   : "r" ((UDItype)(ah)),				     			\
-	     "r" ((UDItype)(bh)),				      			\
-	     "r" ((UDItype)(al)),				     			\
-	     "r" ((UDItype)(bl))				       			\
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) 	\
+  __asm__ ("addcc %4,%5,%1\n\t"			\
+	   "add %2,%3,%0\n\t"			\
+  	   "bcs,a,pn %%xcc, 1f\n\t"		\
+  	   "add %0, 1, %0\n"			\
+  	   "1:"					\
+	   : "=r" ((UDItype)(sh)),		\
+	     "=&r" ((UDItype)(sl))		\
+	   : "r" ((UDItype)(ah)),		\
+	     "r" ((UDItype)(bh)),		\
+	     "r" ((UDItype)(al)),		\
+	     "r" ((UDItype)(bl))		\
 	   : "cc")
 	   
-#define sub_ddmmss(sh, sl, ah, al, bh, bl) 						\
-  __asm__ ("subcc %4,%5,%1\n\
-  	    sub %2,%3,%0\n\
-  	    bcs,a,pn %%xcc, 1f\n\
-  	    sub %0, 1, %0\n\
-  	    1:"										\
-	   : "=r" ((UDItype)(sh)),				      			\
-	     "=&r" ((UDItype)(sl))				      			\
-	   : "r" ((UDItype)(ah)),				     			\
-	     "r" ((UDItype)(bh)),				      			\
-	     "r" ((UDItype)(al)),				     			\
-	     "r" ((UDItype)(bl))				       			\
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) 	\
+  __asm__ ("subcc %4,%5,%1\n\t"			\
+  	   "sub %2,%3,%0\n\t"			\
+  	   "bcs,a,pn %%xcc, 1f\n\t"		\
+  	   "sub %0, 1, %0\n"			\
+  	   "1:"					\
+	   : "=r" ((UDItype)(sh)),		\
+	     "=&r" ((UDItype)(sl))		\
+	   : "r" ((UDItype)(ah)),		\
+	     "r" ((UDItype)(bh)),		\
+	     "r" ((UDItype)(al)),		\
+	     "r" ((UDItype)(bl))		\
 	   : "cc")
 
-#define umul_ppmm(wh, wl, u, v)								\
-  do {											\
-	  UDItype tmp1, tmp2, tmp3, tmp4;						\
-	  __asm__ __volatile__ (							\
-		   "srl %7,0,%3\n\
-		    mulx %3,%6,%1\n\
-		    srlx %6,32,%2\n\
-		    mulx %2,%3,%4\n\
-		    sllx %4,32,%5\n\
-		    srl %6,0,%3\n\
-		    sub %1,%5,%5\n\
-		    srlx %5,32,%5\n\
-		    addcc %4,%5,%4\n\
-		    srlx %7,32,%5\n\
-		    mulx %3,%5,%3\n\
-		    mulx %2,%5,%5\n\
-		    sethi %%hi(0x80000000),%2\n\
-		    addcc %4,%3,%4\n\
-		    srlx %4,32,%4\n\
-		    add %2,%2,%2\n\
-		    movcc %%xcc,%%g0,%2\n\
-		    addcc %5,%4,%5\n\
-		    sllx %3,32,%3\n\
-		    add %1,%3,%1\n\
-		    add %5,%2,%0"							\
-	   : "=r" ((UDItype)(wh)),							\
-	     "=&r" ((UDItype)(wl)),							\
-	     "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4)			\
-	   : "r" ((UDItype)(u)),							\
-	     "r" ((UDItype)(v))								\
-	   : "cc");									\
+#define umul_ppmm(wh, wl, u, v)				\
+  do {							\
+	  UDItype tmp1, tmp2, tmp3, tmp4;		\
+	  __asm__ __volatile__ (			\
+		   "srl %7,0,%3\n\t"			\
+		   "mulx %3,%6,%1\n\t"			\
+		   "srlx %6,32,%2\n\t"			\
+		   "mulx %2,%3,%4\n\t"			\
+		   "sllx %4,32,%5\n\t"			\
+		   "srl %6,0,%3\n\t"			\
+		   "sub %1,%5,%5\n\t"			\
+		   "srlx %5,32,%5\n\t"			\
+		   "addcc %4,%5,%4\n\t"			\
+		   "srlx %7,32,%5\n\t"			\
+		   "mulx %3,%5,%3\n\t"			\
+		   "mulx %2,%5,%5\n\t"			\
+		   "sethi %%hi(0x80000000),%2\n\t"	\
+		   "addcc %4,%3,%4\n\t"			\
+		   "srlx %4,32,%4\n\t"			\
+		   "add %2,%2,%2\n\t"			\
+		   "movcc %%xcc,%%g0,%2\n\t"		\
+		   "addcc %5,%4,%5\n\t"			\
+		   "sllx %3,32,%3\n\t"			\
+		   "add %1,%3,%1\n\t"			\
+		   "add %5,%2,%0"			\
+	   : "=r" ((UDItype)(wh)),			\
+	     "=&r" ((UDItype)(wl)),			\
+	     "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \
+	   : "r" ((UDItype)(u)),			\
+	     "r" ((UDItype)(v))				\
+	   : "cc");					\
   } while (0)
   
-#define udiv_qrnnd(q, r, n1, n0, d) 							\
-  do {                                                                  		\
-    UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m;                     		\
-    __d1 = (d >> 32);                                           			\
-    __d0 = (USItype)d;                                            			\
-                                                                        		\
-    __r1 = (n1) % __d1;                                                 		\
-    __q1 = (n1) / __d1;                                                 		\
-    __m = (UWtype) __q1 * __d0;                                         		\
-    __r1 = (__r1 << 32) | (n0 >> 32);                          				\
-    if (__r1 < __m)                                                     		\
-      {                                                                 		\
-        __q1--, __r1 += (d);                                            		\
-        if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */		\
-          if (__r1 < __m)                                               		\
-            __q1--, __r1 += (d);                                        		\
-      }                                                                 		\
-    __r1 -= __m;                                                        		\
-                                                                        		\
-    __r0 = __r1 % __d1;                                                 		\
-    __q0 = __r1 / __d1;                                                 		\
-    __m = (UWtype) __q0 * __d0;                                         		\
-    __r0 = (__r0 << 32) | ((USItype)n0);                           			\
-    if (__r0 < __m)                                                     		\
-      {                                                                 		\
-        __q0--, __r0 += (d);                                            		\
-        if (__r0 >= (d))                                                		\
-          if (__r0 < __m)                                               		\
-            __q0--, __r0 += (d);                                        		\
-      }                                                                 		\
-    __r0 -= __m;                                                        		\
-                                                                        		\
-    (q) = (UWtype) (__q1 << 32)  | __q0;                                		\
-    (r) = __r0;                                                         		\
+#define udiv_qrnnd(q, r, n1, n0, d) 			\
+  do {                                                  \
+    UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m;     \
+    __d1 = (d >> 32);                                   \
+    __d0 = (USItype)d;                                  \
+                                                        \
+    __r1 = (n1) % __d1;                                 \
+    __q1 = (n1) / __d1;                                 \
+    __m = (UWtype) __q1 * __d0;                         \
+    __r1 = (__r1 << 32) | (n0 >> 32);                   \
+    if (__r1 < __m)                                     \
+      {                                                 \
+        __q1--, __r1 += (d);                            \
+        if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */ \
+          if (__r1 < __m)                               \
+            __q1--, __r1 += (d);                        \
+      }                                                 \
+    __r1 -= __m;                                        \
+                                                        \
+    __r0 = __r1 % __d1;                                 \
+    __q0 = __r1 / __d1;                                 \
+    __m = (UWtype) __q0 * __d0;                         \
+    __r0 = (__r0 << 32) | ((USItype)n0);                \
+    if (__r0 < __m)                                     \
+      {                                                 \
+        __q0--, __r0 += (d);                            \
+        if (__r0 >= (d))                                \
+          if (__r0 < __m)                               \
+            __q0--, __r0 += (d);                        \
+      }                                                 \
+    __r0 -= __m;                                        \
+                                                        \
+    (q) = (UWtype) (__q1 << 32)  | __q0;                \
+    (r) = __r0;                                         \
   } while (0)
 
 #define UDIV_NEEDS_NORMALIZATION 1  
 
-#define abort()										\
+#define abort() \
 	return 0
 
 #ifdef __BIG_ENDIAN
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 348f206f0..5fc4644aa 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -207,14 +207,21 @@ outret:
 	return insn;
 }
 
-static void do_fault_siginfo(int code, int sig, unsigned long address)
+extern unsigned long compute_effective_address(struct pt_regs *, unsigned int, unsigned int);
+
+static void do_fault_siginfo(int code, int sig, struct pt_regs *regs,
+			     unsigned int insn, int fault_code)
 {
 	siginfo_t info;
 
 	info.si_code = code;
 	info.si_signo = sig;
 	info.si_errno = 0;
-	info.si_addr = (void *) address;
+	if (fault_code & FAULT_CODE_ITLB)
+		info.si_addr = (void *) regs->tpc;
+	else
+		info.si_addr = (void *)
+			compute_effective_address(regs, insn, 0);
 	info.si_trapno = 0;
 	force_sig_info(sig, &info, current);
 }
@@ -295,7 +302,7 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code,
 		/* The si_code was set to make clear whether
 		 * this was a SEGV_MAPERR or SEGV_ACCERR fault.
 		 */
-		do_fault_siginfo(si_code, SIGSEGV, address);
+		do_fault_siginfo(si_code, SIGSEGV, regs, insn, fault_code);
 		return;
 	}
 
@@ -471,7 +478,7 @@ do_sigbus:
 	 * Send a sigbus, regardless of whether we were in kernel
 	 * or user mode.
 	 */
-	do_fault_siginfo(BUS_ADRERR, SIGBUS, address);
+	do_fault_siginfo(BUS_ADRERR, SIGBUS, regs, insn, fault_code);
 
 	/* Kernel mode? Handle exceptions or die */
 	if (regs->tstate & TSTATE_PRIV)
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index 1df587bdd..6da2759c2 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -245,8 +245,9 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 				goto out;
 			}
 			ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
-			unlock_page(page);
-			if (ret) {
+			if (! ret) {
+				unlock_page(page);
+			} else {
 				hugetlb_put_quota(mapping);
 				free_huge_page(page);
 				goto out;
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index a5518c23d..043861f31 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -152,9 +152,9 @@ __inline__ void flush_dcache_page_impl(struct page *page)
 #define dcache_dirty_cpu(page) \
 	(((page)->flags >> 24) & (NR_CPUS - 1UL))
 
-static __inline__ void set_dcache_dirty(struct page *page)
+static __inline__ void set_dcache_dirty(struct page *page, int this_cpu)
 {
-	unsigned long mask = smp_processor_id();
+	unsigned long mask = this_cpu;
 	unsigned long non_cpu_bits = ~((NR_CPUS - 1UL) << 24UL);
 	mask = (mask << 24) | (1UL << PG_dcache_dirty);
 	__asm__ __volatile__("1:\n\t"
@@ -206,16 +206,19 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p
 	    (page = pfn_to_page(pfn), page_mapping(page)) &&
 	    ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
 		int cpu = ((pg_flags >> 24) & (NR_CPUS - 1UL));
+		int this_cpu = get_cpu();
 
 		/* This is just to optimize away some function calls
 		 * in the SMP case.
 		 */
-		if (cpu == smp_processor_id())
+		if (cpu == this_cpu)
 			flush_dcache_page_impl(page);
 		else
 			smp_flush_dcache_page_impl(page, cpu);
 
 		clear_dcache_dirty_cpu(page, cpu);
+
+		put_cpu();
 	}
 	if (get_thread_fault_code())
 		__update_mmu_cache(vma->vm_mm->context & TAG_CONTEXT_BITS,
@@ -227,14 +230,15 @@ void flush_dcache_page(struct page *page)
 	struct address_space *mapping = page_mapping(page);
 	int dirty = test_bit(PG_dcache_dirty, &page->flags);
 	int dirty_cpu = dcache_dirty_cpu(page);
+	int this_cpu = get_cpu();
 
 	if (mapping && !mapping_mapped(mapping)) {
 		if (dirty) {
-			if (dirty_cpu == smp_processor_id())
-				return;
+			if (dirty_cpu == this_cpu)
+				goto out;
 			smp_flush_dcache_page_impl(page, dirty_cpu);
 		}
-		set_dcache_dirty(page);
+		set_dcache_dirty(page, this_cpu);
 	} else {
 		/* We could delay the flush for the !page_mapping
 		 * case too.  But that case is for exec env/arg
@@ -243,6 +247,9 @@ void flush_dcache_page(struct page *page)
 		 */
 		flush_dcache_page_impl(page);
 	}
+
+out:
+	put_cpu();
 }
 
 /* When shared+writable mmaps of files go away, we lose all dirty
@@ -1582,7 +1589,7 @@ void __init paging_init(void)
  * prom_set_traptable() call, and OBP is allocating a scratchpad
  * for saving client program register state etc.
  */
-void __init sort_memlist(struct linux_mlist_p1275 *thislist)
+static void __init sort_memlist(struct linux_mlist_p1275 *thislist)
 {
 	int swapi = 0;
 	int i, mitr;
diff --git a/arch/sparc64/prom/memory.c b/arch/sparc64/prom/memory.c
index 92f4ff4fc..224821f62 100644
--- a/arch/sparc64/prom/memory.c
+++ b/arch/sparc64/prom/memory.c
@@ -114,7 +114,7 @@ void __init prom_meminit(void)
 		prom_prom_taken[iter].num_bytes =
 			prom_reg_memlist[iter].reg_size;
 		prom_prom_taken[iter].theres_more =
-			&prom_phys_total[iter+1];
+			&prom_prom_taken[iter+1];
 	}
 	prom_prom_taken[iter-1].theres_more = 0x0;
 
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index 2a4c8cf06..e3f3cddea 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -71,7 +71,7 @@ static int harddog_open(struct inode *inode, struct file *file)
 	if(timer_alive)
 		return -EBUSY;
 #ifdef CONFIG_HARDDOG_NOWAYOUT	 
-	MOD_INC_USE_COUNT;
+	__module_get(THIS_MODULE);
 #endif
 
 #ifdef CONFIG_MCONSOLE
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 4c2ee09b0..a52b79dfd 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -124,7 +124,6 @@ static int uml_net_open(struct net_device *dev)
 	spin_lock(&opened_lock);
 	list_add(&lp->list, &opened);
 	spin_unlock(&opened_lock);
-	MOD_INC_USE_COUNT;
  out:
 	spin_unlock(&lp->lock);
 	return(err);
@@ -144,7 +143,6 @@ static int uml_net_close(struct net_device *dev)
 	list_del(&lp->list);
 	spin_unlock(&opened_lock);
 
-	MOD_DEC_USE_COUNT;
 	spin_unlock(&lp->lock);
 	return 0;
 }
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 5bcef3e3e..ec2be14be 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -294,7 +294,7 @@ void setup_highmem(unsigned long len)
 			page = &map[i];
 			ClearPageReserved(page);
 			set_bit(PG_highmem, &page->flags);
-			atomic_set(&page->count, 1);
+			set_page_count(page, 1);
 			__free_page(page);
 		}
 		phys += cur;
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 34f826c08..b8158556c 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -266,6 +266,9 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
 	if (!cpus)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	spin_lock_bh(&call_lock);
 	atomic_set(&scf_started, 0);
 	atomic_set(&scf_finished, 0);
diff --git a/arch/v850/kernel/process.c b/arch/v850/kernel/process.c
index 2fccb4cc7..9c708c32c 100644
--- a/arch/v850/kernel/process.c
+++ b/arch/v850/kernel/process.c
@@ -203,8 +203,8 @@ int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs)
 /*
  * These bracket the sleeping functions..
  */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
+#define first_sched	((unsigned long)__sched_text_start)
+#define last_sched	((unsigned long)__sched_text_end)
 
 unsigned long get_wchan (struct task_struct *p)
 {
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 07ab0f292..59e3c28fc 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -12,6 +12,7 @@
  */
 
 #include <linux/config.h>
+#define VMLINUX_SYMBOL(_sym_) _##_sym_
 #include <asm-generic/vmlinux.lds.h>
 
 /* For most platforms, this will define useful things like RAM addr/size.  */
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index cfe5b0f8d..2122afc52 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -239,7 +239,16 @@ config PREEMPT
 	  Say Y here if you are feeling brave and building a kernel for a 
 	  desktop, embedded or real-time system.  Say N if you are unsure. 
 
-# someone write a better help text please.
+config SCHED_SMT
+	bool "SMT (Hyperthreading) scheduler support"
+	depends on SMP
+	default off
+	help
+	  SMT scheduler support improves the CPU scheduler's decision making
+	  when dealing with Intel Pentium 4 chips with HyperThreading at a
+	  cost of slightly increased overhead in some places. If unsure say
+	  N here.
+
 config K8_NUMA
        bool "K8 NUMA support"
        depends on SMP
@@ -247,9 +256,9 @@ config K8_NUMA
 	  Enable NUMA (Non Unified Memory Architecture) support for
 	  AMD Opteron Multiprocessor systems. The kernel will try to allocate
 	  memory used by a CPU on the local memory controller of the CPU
-	  and in the future do more optimizations. This may improve performance 
-	  or it may not. Code is still experimental.
-	  Say N if unsure.
+	  and add some more NUMA awareness to the kernel.
+	  This code is recommended on all multiprocessor Opteron systems
+	  and normally doesn't hurt on others.
 
 config DISCONTIGMEM
        bool
diff --git a/arch/x86_64/boot/compressed/misc.c b/arch/x86_64/boot/compressed/misc.c
index 78d4c7847..c8b9216f9 100644
--- a/arch/x86_64/boot/compressed/misc.c
+++ b/arch/x86_64/boot/compressed/misc.c
@@ -92,7 +92,7 @@ static unsigned long output_ptr = 0;
 static void *malloc(int size);
 static void free(void *where);
  
-static void puts(const char *);
+static void putstr(const char *);
   
 extern int end;
 static long free_mem_ptr = (long)&end;
@@ -153,7 +153,7 @@ static void scroll(void)
 		vidmem[i] = ' ';
 }
 
-static void puts(const char *s)
+static void putstr(const char *s)
 {
 	int x,y,pos;
 	char c;
@@ -270,9 +270,9 @@ static void flush_window(void)
 
 static void error(char *x)
 {
-	puts("\n\n");
-	puts(x);
-	puts("\n\n -- System halted");
+	putstr("\n\n");
+	putstr(x);
+	putstr("\n\n -- System halted");
 
 	while(1);
 }
@@ -346,9 +346,9 @@ int decompress_kernel(struct moveparams *mv, void *rmode)
 	else setup_output_buffer_if_we_run_high(mv);
 
 	makecrc();
-	puts(".\nDecompressing Linux...");
+	putstr(".\nDecompressing Linux...");
 	gunzip();
-	puts("done.\nBooting the kernel.\n");
+	putstr("done.\nBooting the kernel.\n");
 	if (high_loaded) close_output_buffer_if_we_run_high(mv);
 	return high_loaded;
 }
diff --git a/arch/x86_64/boot/setup.S b/arch/x86_64/boot/setup.S
index 48479ec1a..fc52ed801 100644
--- a/arch/x86_64/boot/setup.S
+++ b/arch/x86_64/boot/setup.S
@@ -132,7 +132,7 @@ ramdisk_image:	.long	0		# address of loaded ramdisk image
 ramdisk_size:	.long	0		# its size in bytes
 
 bootsect_kludge:
-		.word  bootsect_helper, SETUPSEG
+		.long	0		# obsolete
 
 heap_end_ptr:	.word	modelist+1024	# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
@@ -759,87 +759,6 @@ default_switch:
 	outb	%al, $0x70
 	lret
 
-# This routine only gets called, if we get loaded by the simple
-# bootsect loader _and_ have a bzImage to load.
-# Because there is no place left in the 512 bytes of the boot sector,
-# we must emigrate to code space here.
-bootsect_helper:
-	cmpw	$0, %cs:bootsect_es
-	jnz	bootsect_second
-
-	movb	$0x20, %cs:type_of_loader
-	movw	%es, %ax
-	shrw	$4, %ax
-	movb	%ah, %cs:bootsect_src_base+2
-	movw	%es, %ax
-	movw	%ax, %cs:bootsect_es
-	subw	$SYSSEG, %ax
-	lret					# nothing else to do for now
-
-bootsect_second:
-	pushw	%cx
-	pushw	%si
-	pushw	%bx
-	testw	%bx, %bx			# 64K full?
-	jne	bootsect_ex
-
-	movw	$0x8000, %cx			# full 64K, INT15 moves words
-	pushw	%cs
-	popw	%es
-	movw	$bootsect_gdt, %si
-	movw	$0x8700, %ax
-	int	$0x15
-	jc	bootsect_panic			# this, if INT15 fails
-
-	movw	%cs:bootsect_es, %es		# we reset %es to always point
-	incb	%cs:bootsect_dst_base+2		# to 0x10000
-bootsect_ex:
-	movb	%cs:bootsect_dst_base+2, %ah
-	shlb	$4, %ah				# we now have the number of
-						# moved frames in %ax
-	xorb	%al, %al
-	popw	%bx
-	popw	%si
-	popw	%cx
-	lret
-
-bootsect_gdt:
-	.word	0, 0, 0, 0
-	.word	0, 0, 0, 0
-
-bootsect_src:
-	.word	0xffff
-
-bootsect_src_base:
-	.byte	0x00, 0x00, 0x01		# base = 0x010000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-
-bootsect_dst:
-	.word	0xffff
-
-bootsect_dst_base:
-	.byte	0x00, 0x00, 0x10		# base = 0x100000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-	.word	0, 0, 0, 0			# BIOS CS
-	.word	0, 0, 0, 0			# BIOS DS
-
-bootsect_es:
-	.word	0
-
-bootsect_panic:
-	pushw	%cs
-	popw	%ds
-	cld
-	leaw	bootsect_panic_mess, %si
-	call	prtstr
-	
-bootsect_panic_loop:
-	jmp	bootsect_panic_loop
-
-bootsect_panic_mess:
-	.string	"INT15 refuses to access high mem, giving up."
 
 # This routine checks that the keyboard command queue is empty
 # (after emptying the output buffers)
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 60eca8295..e569a1435 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -34,6 +34,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -72,6 +73,7 @@ CONFIG_X86_LOCAL_APIC=y
 CONFIG_MTRR=y
 CONFIG_SMP=y
 # CONFIG_PREEMPT is not set
+CONFIG_SCHED_SMT=y
 CONFIG_K8_NUMA=y
 CONFIG_DISCONTIGMEM=y
 CONFIG_NUMA=y
@@ -233,6 +235,7 @@ CONFIG_BLK_DEV_PIIX=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
@@ -257,7 +260,6 @@ CONFIG_BLK_DEV_SD=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -282,6 +284,7 @@ CONFIG_SCSI_SATA=y
 # CONFIG_SCSI_SATA_SVW is not set
 CONFIG_SCSI_ATA_PIIX=y
 # CONFIG_SCSI_SATA_PROMISE is not set
+# CONFIG_SCSI_SATA_SX4 is not set
 # CONFIG_SCSI_SATA_SIL is not set
 # CONFIG_SCSI_SATA_SIS is not set
 CONFIG_SCSI_SATA_VIA=y
@@ -296,6 +299,7 @@ CONFIG_SCSI_SATA_VIA=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -331,6 +335,7 @@ CONFIG_FUSION_MAX_SGE=40
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -363,8 +368,6 @@ CONFIG_IPV6=y
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
 # CONFIG_IPV6_TUNNEL is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -372,7 +375,9 @@ CONFIG_IPV6=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -393,16 +398,23 @@ CONFIG_IPV6=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -421,6 +433,7 @@ CONFIG_MII=y
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
 CONFIG_AMD8111_ETH=y
+# CONFIG_AMD8111E_NAPI is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 CONFIG_FORCEDETH=y
@@ -436,7 +449,6 @@ CONFIG_8139TOO=m
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_8139_RXBUF_IDX=2
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -453,7 +465,6 @@ CONFIG_E1000=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
 
@@ -461,47 +472,29 @@ CONFIG_TIGON3=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-CONFIG_NETCONSOLE=y
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
 
 #
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-CONFIG_NETPOLL=y
-# CONFIG_NETPOLL_RX is not set
-# CONFIG_NETPOLL_TRAP is not set
-CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=y
 
 #
 # ISDN subsystem
@@ -685,7 +678,108 @@ CONFIG_SOUND_ICH=y
 #
 # USB support
 #
-# CONFIG_USB is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_UHCI_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH_TTY is not set
+# CONFIG_USB_MIDI is not set
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=y
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=y
+CONFIG_USB_HIDINPUT=y
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_TIGL is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_TEST is not set
 
 #
 # USB Gadget Support
@@ -714,6 +808,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=y
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -787,7 +884,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -833,3 +929,4 @@ CONFIG_MAGIC_SYSRQ=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/x86_64/ia32/fpu32.c b/arch/x86_64/ia32/fpu32.c
index c6d0b02a1..f9a2638c8 100644
--- a/arch/x86_64/ia32/fpu32.c
+++ b/arch/x86_64/ia32/fpu32.c
@@ -72,15 +72,15 @@ static inline unsigned long twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
 
 
 static inline int convert_fxsr_from_user(struct i387_fxsave_struct *fxsave,
-					 struct _fpstate_ia32 *buf)
+					 struct _fpstate_ia32 __user *buf)
 {
 	struct _fpxreg *to;
-	struct _fpreg *from;
+	struct _fpreg __user *from;
 	int i;
 	u32 v;
 	int err = 0;
 
-#define G(num,val) err |= __get_user(val, num + (u32 *)buf)
+#define G(num,val) err |= __get_user(val, num + (u32 __user *)buf)
 	G(0, fxsave->cwd);
 	G(1, fxsave->swd);
 	G(2, fxsave->twd);
@@ -104,12 +104,12 @@ static inline int convert_fxsr_from_user(struct i387_fxsave_struct *fxsave,
 }
 
 
-static inline int convert_fxsr_to_user(struct _fpstate_ia32 *buf,
+static inline int convert_fxsr_to_user(struct _fpstate_ia32 __user *buf,
 				       struct i387_fxsave_struct *fxsave,
 				       struct pt_regs *regs,
 				       struct task_struct *tsk)
 {
-	struct _fpreg *to;
+	struct _fpreg __user *to;
 	struct _fpxreg *from;
 	int i;
 	u16 cs,ds; 
@@ -125,7 +125,7 @@ static inline int convert_fxsr_to_user(struct _fpstate_ia32 *buf,
 		cs = regs->cs;
 	} 
 
-#define P(num,val) err |= __put_user(val, num + (u32 *)buf)
+#define P(num,val) err |= __put_user(val, num + (u32 __user *)buf)
 	P(0, (u32)fxsave->cwd | 0xffff0000);
 	P(1, (u32)fxsave->swd | 0xffff0000);
 	P(2, twd_fxsr_to_i387(fxsave));
@@ -147,7 +147,7 @@ static inline int convert_fxsr_to_user(struct _fpstate_ia32 *buf,
 	return 0;
 }
 
-int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 *buf, int fsave) 
+int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 __user *buf, int fsave) 
 { 
 	clear_fpu(tsk);
 	if (!fsave) { 
@@ -162,7 +162,7 @@ int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 *buf, int fs
 }  
 
 int save_i387_ia32(struct task_struct *tsk, 
-		   struct _fpstate_ia32 *buf, 
+		   struct _fpstate_ia32 __user *buf, 
 		   struct pt_regs *regs,
 		   int fsave)
 {
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index 92817f18e..8e6b845f7 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -349,6 +349,8 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 		return -ENOMEM;
 	}
 
+	memset(mpnt, 0, sizeof(*mpnt));
+
 	down_write(&mm->mmap_sem);
 	{
 		mpnt->vm_mm = mm;
@@ -362,11 +364,6 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 			mpnt->vm_flags = vm_stack_flags32;
  		mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ? 
  			PAGE_COPY_EXEC : PAGE_COPY;
-		mpnt->vm_ops = NULL;
-		mpnt->vm_pgoff = 0;
-		mpnt->vm_file = NULL;
-		INIT_LIST_HEAD(&mpnt->shared);
-		mpnt->vm_private_data = (void *) 0;
 		insert_vm_struct(mm, mpnt);
 		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
 	} 
@@ -375,7 +372,7 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 		struct page *page = bprm->page[i];
 		if (page) {
 			bprm->page[i] = NULL;
-			put_dirty_page(current,page,stack_base,mpnt->vm_page_prot);
+			install_arg_page(mpnt, page, stack_base);
 		}
 		stack_base += PAGE_SIZE;
 	}
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
index d39795746..8c6964245 100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ b/arch/x86_64/ia32/ia32_ioctl.c
@@ -21,7 +21,7 @@
 #ifndef TIOCGDEV
 #define TIOCGDEV       _IOR('T',0x32, unsigned int)
 #endif
-static int tiocgdev(unsigned fd, unsigned cmd,  unsigned int *ptr) 
+static int tiocgdev(unsigned fd, unsigned cmd,  unsigned int __user *ptr) 
 { 
 
 	struct file *file = fget(fd);
@@ -54,7 +54,7 @@ static int rtc32_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
 		ret = sys_ioctl(fd, RTC_IRQP_READ, (unsigned long)&val); 
 		set_fs(oldfs); 
 		if (!ret)
-			ret = put_user(val, (unsigned int*) arg); 
+			ret = put_user(val, (unsigned int __user *) arg); 
 		return ret; 
 
 	case RTC_IRQP_SET32: 
@@ -66,7 +66,7 @@ static int rtc32_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
 		ret = sys_ioctl(fd, RTC_EPOCH_READ, (unsigned long) &val); 
 		set_fs(oldfs); 
 		if (!ret)
-			ret = put_user(val, (unsigned int*) arg); 
+			ret = put_user(val, (unsigned int __user *) arg); 
 		return ret; 
 
 	case RTC_EPOCH_SET32:
@@ -113,7 +113,7 @@ static int mtrr_ioctl32(unsigned int fd, unsigned int cmd, unsigned long arg)
 	struct mtrr_gentry g;
 	struct mtrr_sentry s;
 	int get = 0, err = 0; 
-	struct mtrr_gentry32 *g32 = (struct mtrr_gentry32 *)arg; 
+	struct mtrr_gentry32 __user *g32 = (struct mtrr_gentry32 __user *)arg; 
 	mm_segment_t oldfs = get_fs(); 
 
 	switch (cmd) { 
@@ -139,7 +139,7 @@ static int mtrr_ioctl32(unsigned int fd, unsigned int cmd, unsigned long arg)
 
 		arg = (unsigned long)&g; 
 	} else { 
-		struct mtrr_sentry32 *s32 = (struct mtrr_sentry32 *)arg;
+		struct mtrr_sentry32 __user *s32 = (struct mtrr_sentry32 __user *)arg;
 		err = get_user(s.base, &s32->base);
 		err |= get_user(s.size, &s32->size);
 		err |= get_user(s.type, &s32->type);
diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c
index 7e56a4bc3..2fe68d976 100644
--- a/arch/x86_64/ia32/ia32_signal.c
+++ b/arch/x86_64/ia32/ia32_signal.c
@@ -42,7 +42,7 @@
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
-void signal_fault(struct pt_regs *regs, void *frame, char *where);
+void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
 
 int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from)
 {
@@ -98,6 +98,7 @@ int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from)
 int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
 {
 	int err;
+	u32 ptr32;
 	if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
 		return -EFAULT;
 
@@ -107,7 +108,8 @@ int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
 
 	err |= __get_user(to->si_pid, &from->si_pid);
 	err |= __get_user(to->si_uid, &from->si_uid);
-	err |= __get_user((u32)(u64)to->si_ptr, &from->si_ptr);
+	err |= __get_user(ptr32, &from->si_ptr);
+	to->si_ptr = (void*)(u64)ptr32;
 
 	return err;
 }
@@ -134,8 +136,9 @@ sys32_sigsuspend(int history0, int history1, old_sigset_t mask, struct pt_regs r
 }
 
 asmlinkage long
-sys32_sigaltstack(const stack_ia32_t *uss_ptr, stack_ia32_t *uoss_ptr, 
-				  struct pt_regs regs)
+sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
+		  stack_ia32_t __user *uoss_ptr, 
+		  struct pt_regs regs)
 {
 	stack_t uss,uoss; 
 	int ret;
@@ -191,7 +194,7 @@ struct rt_sigframe
 };
 
 static int
-ia32_restore_sigcontext(struct pt_regs *regs, struct sigcontext_ia32 *sc, unsigned int *peax)
+ia32_restore_sigcontext(struct pt_regs *regs, struct sigcontext_ia32 __user *sc, unsigned int *peax)
 {
 	unsigned int err = 0;
 	
@@ -250,9 +253,9 @@ ia32_restore_sigcontext(struct pt_regs *regs, struct sigcontext_ia32 *sc, unsign
 
 	{
 		u32 tmp;
-		struct _fpstate_ia32 * buf;
+		struct _fpstate_ia32 __user * buf;
 		err |= __get_user(tmp, &sc->fpstate);
-		buf = (struct _fpstate_ia32 *) (u64)tmp;
+		buf = compat_ptr(tmp);
 		if (buf) {
 			if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
 				goto badframe;
@@ -273,7 +276,7 @@ badframe:
 
 asmlinkage long sys32_sigreturn(struct pt_regs regs)
 {
-	struct sigframe *frame = (struct sigframe *)(regs.rsp - 8);
+	struct sigframe __user *frame = (struct sigframe __user *)(regs.rsp-8);
 	sigset_t set;
 	unsigned int eax;
 
@@ -302,9 +305,8 @@ badframe:
 
 asmlinkage long sys32_rt_sigreturn(struct pt_regs regs)
 {
-	struct rt_sigframe *frame = (struct rt_sigframe *)(regs.rsp - 4);
+	struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(regs.rsp - 4);
 	sigset_t set;
-	stack_t st;
 	unsigned int eax;
 
 	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
@@ -321,16 +323,8 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs regs)
 	if (ia32_restore_sigcontext(&regs, &frame->uc.uc_mcontext, &eax))
 		goto badframe;
 
-	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
+	if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, regs) == -EFAULT)
 		goto badframe;
-	/* It is more difficult to avoid calling this function than to
-	   call it and ignore errors.  */
-	{
-		mm_segment_t oldds = get_fs(); 
-		set_fs(KERNEL_DS); 
-		do_sigaltstack(&st, NULL, regs.rsp);
-		set_fs(oldds);  
-	}
 
 	return eax;
 
@@ -344,20 +338,20 @@ badframe:
  */
 
 static int
-ia32_setup_sigcontext(struct sigcontext_ia32 *sc, struct _fpstate_ia32 *fpstate,
+ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc, struct _fpstate_ia32 __user *fpstate,
 		 struct pt_regs *regs, unsigned int mask)
 {
 	int tmp, err = 0;
 
 	tmp = 0;
 	__asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->gs);
+	err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
 	__asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->fs);
+	err |= __put_user(tmp, (unsigned int __user *)&sc->fs);
 	__asm__("movl %%ds,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->ds);
+	err |= __put_user(tmp, (unsigned int __user *)&sc->ds);
 	__asm__("movl %%es,%0" : "=r"(tmp): "0"(tmp));
-	err |= __put_user(tmp, (unsigned int *)&sc->es);
+	err |= __put_user(tmp, (unsigned int __user *)&sc->es);
 
 	err |= __put_user((u32)regs->rdi, &sc->edi);
 	err |= __put_user((u32)regs->rsi, &sc->esi);
@@ -394,7 +388,7 @@ ia32_setup_sigcontext(struct sigcontext_ia32 *sc, struct _fpstate_ia32 *fpstate,
 /*
  * Determine which stack to use..
  */
-static void *
+static void __user *
 get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 {
 	unsigned long rsp;
@@ -415,13 +409,13 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 		rsp = (unsigned long) ka->sa.sa_restorer;
 	}
 
-	return (void *)((rsp - frame_size) & -8UL);
+	return (void __user *)((rsp - frame_size) & -8UL);
 }
 
 void ia32_setup_frame(int sig, struct k_sigaction *ka,
 			compat_sigset_t *set, struct pt_regs * regs)
 {
-	struct sigframe *frame;
+	struct sigframe __user *frame;
 	int err = 0;
 
 	frame = get_sigframe(ka, regs, sizeof(*frame));
@@ -508,7 +502,7 @@ give_sigsegv:
 void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 			   compat_sigset_t *set, struct pt_regs * regs)
 {
-	struct rt_sigframe *frame;
+	struct rt_sigframe __user *frame;
 	int err = 0;
 
 	frame = get_sigframe(ka, regs, sizeof(*frame));
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 863eeb7bc..0a2fb66b6 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -322,7 +322,7 @@ ia32_sys_call_table:
 	.quad sys_mknod
 	.quad sys_chmod		/* 15 */
 	.quad sys_lchown16
-	.quad ni_syscall			/* old break syscall holder */
+	.quad quiet_ni_syscall			/* old break syscall holder */
 	.quad sys_stat
 	.quad sys32_lseek
 	.quad sys_getpid		/* 20 */
@@ -336,11 +336,11 @@ ia32_sys_call_table:
 	.quad sys_fstat	/* (old)fstat */
 	.quad sys_pause
 	.quad compat_sys_utime	/* 30 */
-	.quad ni_syscall	/* old stty syscall holder */
-	.quad ni_syscall	/* old gtty syscall holder */
+	.quad quiet_ni_syscall	/* old stty syscall holder */
+	.quad quiet_ni_syscall	/* old gtty syscall holder */
 	.quad sys_access
 	.quad sys_nice	
-	.quad ni_syscall	/* 35 */	/* old ftime syscall holder */
+	.quad quiet_ni_syscall	/* 35 */	/* old ftime syscall holder */
 	.quad sys_sync
 	.quad sys32_kill
 	.quad sys_rename
@@ -349,7 +349,7 @@ ia32_sys_call_table:
 	.quad sys_dup
 	.quad sys32_pipe
 	.quad compat_sys_times
-	.quad ni_syscall			/* old prof syscall holder */
+	.quad quiet_ni_syscall			/* old prof syscall holder */
 	.quad sys_brk		/* 45 */
 	.quad sys_setgid16
 	.quad sys_getgid16
@@ -358,12 +358,12 @@ ia32_sys_call_table:
 	.quad sys_getegid16	/* 50 */
 	.quad sys_acct
 	.quad sys_umount			/* new_umount */
-	.quad ni_syscall			/* old lock syscall holder */
+	.quad quiet_ni_syscall			/* old lock syscall holder */
 	.quad compat_sys_ioctl
 	.quad compat_sys_fcntl64		/* 55 */
-	.quad ni_syscall			/* old mpx syscall holder */
+	.quad quiet_ni_syscall			/* old mpx syscall holder */
 	.quad sys_setpgid
-	.quad ni_syscall			/* old ulimit syscall holder */
+	.quad quiet_ni_syscall			/* old ulimit syscall holder */
 	.quad sys32_olduname
 	.quad sys_umask		/* 60 */
 	.quad sys_chroot
@@ -403,7 +403,7 @@ ia32_sys_call_table:
 	.quad sys_fchown16		/* 95 */
 	.quad sys_getpriority
 	.quad sys_setpriority
-	.quad ni_syscall			/* old profil syscall holder */
+	.quad quiet_ni_syscall			/* old profil syscall holder */
 	.quad compat_sys_statfs
 	.quad compat_sys_fstatfs		/* 100 */
 	.quad sys_ioperm
@@ -417,7 +417,7 @@ ia32_sys_call_table:
 	.quad sys32_uname
 	.quad stub32_iopl		/* 110 */
 	.quad sys_vhangup
-	.quad ni_syscall	/* old "idle" system call */
+	.quad quiet_ni_syscall	/* old "idle" system call */
 	.quad sys32_vm86_warning	/* vm86old */ 
 	.quad compat_sys_wait4
 	.quad sys_swapoff		/* 115 */
@@ -442,16 +442,16 @@ ia32_sys_call_table:
 	.quad quiet_ni_syscall	/* bdflush */
 	.quad sys_sysfs		/* 135 */
 	.quad sys_personality
-	.quad ni_syscall	/* for afs_syscall */
+	.quad quiet_ni_syscall	/* for afs_syscall */
 	.quad sys_setfsuid16
 	.quad sys_setfsgid16
 	.quad sys_llseek		/* 140 */
 	.quad sys32_getdents
-	.quad sys32_select
+	.quad compat_sys_select
 	.quad sys_flock
 	.quad sys_msync
-	.quad sys32_readv		/* 145 */
-	.quad sys32_writev
+	.quad compat_sys_readv		/* 145 */
+	.quad compat_sys_writev
 	.quad sys_getsid
 	.quad sys_fdatasync
 	.quad sys32_sysctl	/* sysctl */
@@ -474,7 +474,7 @@ ia32_sys_call_table:
 	.quad sys32_vm86_warning	/* vm86 */ 
 	.quad quiet_ni_syscall	/* query_module */
 	.quad sys_poll
-	.quad sys32_nfsservctl
+	.quad compat_sys_nfsservctl
 	.quad sys_setresgid16	/* 170 */
 	.quad sys_getresgid16
 	.quad sys_prctl
@@ -493,8 +493,8 @@ ia32_sys_call_table:
 	.quad sys_capset
 	.quad stub32_sigaltstack
 	.quad sys32_sendfile
-	.quad ni_syscall		/* streams1 */
-	.quad ni_syscall		/* streams2 */
+	.quad quiet_ni_syscall		/* streams1 */
+	.quad quiet_ni_syscall		/* streams2 */
 	.quad stub32_vfork            /* 190 */
 	.quad compat_sys_getrlimit
 	.quad sys32_mmap2
@@ -543,51 +543,52 @@ ia32_sys_call_table:
 	.quad sys_removexattr	/* 235 */
 	.quad sys_lremovexattr
 	.quad sys_fremovexattr
-	.quad sys_tkill		/* 238 */ 
+	.quad sys_tkill
 	.quad sys_sendfile64 
 	.quad compat_sys_futex		/* 240 */
-        .quad compat_sys_sched_setaffinity
-        .quad compat_sys_sched_getaffinity
+	.quad compat_sys_sched_setaffinity
+	.quad compat_sys_sched_getaffinity
 	.quad sys32_set_thread_area
 	.quad sys32_get_thread_area
-	.quad sys32_io_setup
+	.quad sys32_io_setup		/* 245 */
 	.quad sys_io_destroy
 	.quad sys32_io_getevents
 	.quad sys32_io_submit
 	.quad sys_io_cancel
-	.quad sys_fadvise64
-	.quad quiet_ni_syscall /* free_huge_pages */
-	.quad sys_exit_group /* exit_group */
+	.quad sys_fadvise64		/* 250 */
+	.quad quiet_ni_syscall 	/* free_huge_pages */
+	.quad sys_exit_group
 	.quad sys_lookup_dcookie
 	.quad sys_epoll_create
-	.quad sys_epoll_ctl
+	.quad sys_epoll_ctl		/* 255 */
 	.quad sys_epoll_wait
 	.quad sys_remap_file_pages
 	.quad sys_set_tid_address
 	.quad sys32_timer_create
-	.quad compat_timer_settime
+	.quad compat_timer_settime	/* 260 */
 	.quad compat_timer_gettime
 	.quad sys_timer_getoverrun
 	.quad sys_timer_delete
 	.quad compat_clock_settime
-	.quad compat_clock_gettime
+	.quad compat_clock_gettime	/* 265 */
 	.quad compat_clock_getres
 	.quad compat_clock_nanosleep
-	.quad compat_statfs64   /* statfs64 */
-	.quad compat_fstatfs64  /* fstatfs64 */
-	.quad sys_tgkill
+	.quad compat_statfs64
+	.quad compat_fstatfs64
+	.quad sys_tgkill		/* 270 */
 	.quad compat_sys_utimes
 	.quad sys32_fadvise64_64
-	.quad sys_ni_syscall	/* sys_vserver */
-	.quad sys_ni_syscall	/* sys_mbind */
-	.quad sys_ni_syscall	/* 275 sys_get_mempolicy */
-	.quad sys_ni_syscall	/* sys_set_mempolicy */
+	.quad quiet_ni_syscall	/* sys_vserver */
+	.quad sys_mbind
+	.quad compat_get_mempolicy	/* 275 */
+	.quad sys_set_mempolicy
 	.quad compat_sys_mq_open
 	.quad sys_mq_unlink
 	.quad compat_sys_mq_timedsend
 	.quad compat_sys_mq_timedreceive	/* 280 */
 	.quad compat_sys_mq_notify
 	.quad compat_sys_mq_getsetattr
+	.quad quiet_ni_syscall		/* reserved for kexec */
 	/* don't forget to change IA32_NR_syscalls */
 ia32_syscall_end:		
 	.rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
index f115f64a7..01202b792 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86_64/ia32/ptrace32.c
@@ -17,7 +17,9 @@
 #include <linux/syscalls.h>
 #include <linux/unistd.h>
 #include <linux/mm.h>
+#include <linux/ptrace.h>
 #include <asm/ptrace.h>
+#include <asm/compat.h>
 #include <asm/uaccess.h>
 #include <asm/user32.h>
 #include <asm/user.h>
@@ -25,8 +27,6 @@
 #include <asm/debugreg.h>
 #include <asm/i387.h>
 #include <asm/fpu32.h>
-#include <linux/ptrace.h>
-#include <linux/mm.h>
 
 /* determines which flags the user has access to. */
 /* 1 = access 0 = no access */
@@ -229,6 +229,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 {
 	struct task_struct *child;
 	struct pt_regs *childregs; 
+	void __user *datap = compat_ptr(data);
 	int ret;
 	__u32 val;
 
@@ -265,7 +266,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 		if (access_process_vm(child, addr, &val, sizeof(u32), 0)!=sizeof(u32))
 			ret = -EIO;
 		else
-			ret = put_user(val, (unsigned int *)(u64)data); 
+			ret = put_user(val, (unsigned int __user *)datap); 
 		break; 
 
 	case PTRACE_POKEDATA:
@@ -278,7 +279,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 	case PTRACE_PEEKUSR:
 		ret = getreg32(child, addr, &val);
 		if (ret == 0)
-			ret = put_user(val, (__u32 *)(unsigned long) data);
+			ret = put_user(val, (__u32 __user *)datap);
 		break;
 
 	case PTRACE_POKEUSR:
@@ -287,15 +288,15 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 
 	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
 		int i;
-	  	if (!access_ok(VERIFY_WRITE, (unsigned *)(unsigned long)data, 16*4)) {
+	  	if (!access_ok(VERIFY_WRITE, datap, 16*4)) {
 			ret = -EIO;
 			break;
 		}
 		ret = 0;
 		for ( i = 0; i <= 16*4 ; i += sizeof(__u32) ) {
 			getreg32(child, i, &val);
-			ret |= __put_user(val,(u32 *) (unsigned long) data);
-			data += sizeof(u32);
+			ret |= __put_user(val,(u32 __user *)datap);
+			datap += sizeof(u32);
 		}
 		break;
 	}
@@ -303,40 +304,40 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
 		unsigned long tmp;
 		int i;
-	  	if (!access_ok(VERIFY_READ, (unsigned *)(unsigned long)data, 16*4)) {
+	  	if (!access_ok(VERIFY_READ, datap, 16*4)) {
 			ret = -EIO;
 			break;
 		}
 		ret = 0; 
 		for ( i = 0; i <= 16*4; i += sizeof(u32) ) {
-			ret |= __get_user(tmp, (u32 *) (unsigned long) data);
+			ret |= __get_user(tmp, (u32 __user *)datap);
 			putreg32(child, i, tmp);
-			data += sizeof(u32);
+			datap += sizeof(u32);
 		}
 		break;
 	}
 
 	case PTRACE_GETFPREGS:
 		ret = -EIO; 
-		if (!access_ok(VERIFY_READ, (void *)(u64)data, 
+		if (!access_ok(VERIFY_READ, compat_ptr(data), 
 			       sizeof(struct user_i387_struct)))
 			break;
-		save_i387_ia32(child, (void *)(u64)data, childregs, 1);
+		save_i387_ia32(child, datap, childregs, 1);
 		ret = 0; 
 			break;
 
 	case PTRACE_SETFPREGS:
 		ret = -EIO;
-		if (!access_ok(VERIFY_WRITE, (void *)(u64)data, 
+		if (!access_ok(VERIFY_WRITE, datap, 
 			       sizeof(struct user_i387_struct)))
 			break;
 		ret = 0;
 		/* don't check EFAULT to be bug-to-bug compatible to i386 */
-		restore_i387_ia32(child, (void *)(u64)data, 1);
+		restore_i387_ia32(child, datap, 1);
 		break;
 
 	case PTRACE_GETFPXREGS: { 
-		struct user32_fxsr_struct *u = (void *)(u64)data; 
+		struct user32_fxsr_struct __user *u = datap;
 		init_fpu(child); 
 		ret = -EIO;
 		if (!access_ok(VERIFY_WRITE, u, sizeof(*u)))
@@ -349,7 +350,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
 		break; 
 	} 
 	case PTRACE_SETFPXREGS: { 
-		struct user32_fxsr_struct *u = (void *)(u64)data; 
+		struct user32_fxsr_struct __user *u = datap;
 		unlazy_fpu(child);
 		ret = -EIO;
 		if (!access_ok(VERIFY_READ, u, sizeof(*u)))
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 47c23419f..6f7622399 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -76,9 +76,9 @@
 #define A(__x)		((unsigned long)(__x))
 #define AA(__x)		((unsigned long)(__x))
 #define ROUND_UP(x,a)	((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 
-int cp_compat_stat(struct kstat *kbuf, struct compat_stat *ubuf)
+int cp_compat_stat(struct kstat *kbuf, struct compat_stat __user *ubuf)
 {
 	typeof(ubuf->st_uid) uid = 0;
 	typeof(ubuf->st_gid) gid = 0;
@@ -110,7 +110,7 @@ int cp_compat_stat(struct kstat *kbuf, struct compat_stat *ubuf)
 }
 
 asmlinkage long
-sys32_truncate64(char * filename, unsigned long offset_low, unsigned long offset_high)
+sys32_truncate64(char __user * filename, unsigned long offset_low, unsigned long offset_high)
 {
        return sys_truncate(filename, ((loff_t) offset_high << 32) | offset_low);
 }
@@ -125,7 +125,7 @@ sys32_ftruncate64(unsigned int fd, unsigned long offset_low, unsigned long offse
    support for 64bit inode numbers. */
 
 static int
-cp_stat64(struct stat64 *ubuf, struct kstat *stat)
+cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
 {
 	typeof(ubuf->st_uid) uid = 0;
 	typeof(ubuf->st_gid) gid = 0;
@@ -154,7 +154,7 @@ cp_stat64(struct stat64 *ubuf, struct kstat *stat)
 }
 
 asmlinkage long
-sys32_stat64(char * filename, struct stat64 *statbuf)
+sys32_stat64(char __user * filename, struct stat64 __user *statbuf)
 {
 	struct kstat stat;
 	int ret = vfs_stat(filename, &stat);
@@ -164,7 +164,7 @@ sys32_stat64(char * filename, struct stat64 *statbuf)
 }
 
 asmlinkage long
-sys32_lstat64(char * filename, struct stat64 *statbuf)
+sys32_lstat64(char __user * filename, struct stat64 __user *statbuf)
 {
 	struct kstat stat;
 	int ret = vfs_lstat(filename, &stat);
@@ -174,7 +174,7 @@ sys32_lstat64(char * filename, struct stat64 *statbuf)
 }
 
 asmlinkage long
-sys32_fstat64(unsigned int fd, struct stat64 *statbuf)
+sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
 {
 	struct kstat stat;
 	int ret = vfs_fstat(fd, &stat);
@@ -199,7 +199,7 @@ struct mmap_arg_struct {
 };
 
 asmlinkage long
-sys32_mmap(struct mmap_arg_struct *arg)
+sys32_mmap(struct mmap_arg_struct __user *arg)
 {
 	struct mmap_arg_struct a;
 	struct file *file = NULL;
@@ -241,7 +241,7 @@ sys32_mprotect(unsigned long start, size_t len, unsigned long prot)
 }
 
 asmlinkage long
-sys32_pipe(int *fd)
+sys32_pipe(int __user *fd)
 {
 	int retval;
 	int fds[2];
@@ -256,8 +256,8 @@ sys32_pipe(int *fd)
 }
 
 asmlinkage long
-sys32_rt_sigaction(int sig, struct sigaction32 *act,
-		   struct sigaction32 *oact,  unsigned int sigsetsize)
+sys32_rt_sigaction(int sig, struct sigaction32 __user *act,
+		   struct sigaction32 __user *oact,  unsigned int sigsetsize)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -321,7 +321,7 @@ sys32_rt_sigaction(int sig, struct sigaction32 *act,
 }
 
 asmlinkage long
-sys32_sigaction (int sig, struct old_sigaction32 *act, struct old_sigaction32 *oact)
+sys32_sigaction (int sig, struct old_sigaction32 __user *act, struct old_sigaction32 __user *oact)
 {
         struct k_sigaction new_ka, old_ka;
         int ret;
@@ -395,7 +395,7 @@ sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
 }
 
 static inline long
-get_tv32(struct timeval *o, struct compat_timeval *i)
+get_tv32(struct timeval *o, struct compat_timeval __user *i)
 {
 	int err = -EFAULT; 
 	if (access_ok(VERIFY_READ, i, sizeof(*i))) { 
@@ -406,7 +406,7 @@ get_tv32(struct timeval *o, struct compat_timeval *i)
 }
 
 static inline long
-put_tv32(struct compat_timeval *o, struct timeval *i)
+put_tv32(struct compat_timeval __user *o, struct timeval *i)
 {
 	int err = -EFAULT;
 	if (access_ok(VERIFY_WRITE, o, sizeof(*o))) { 
@@ -442,7 +442,7 @@ sys32_alarm(unsigned int seconds)
 extern struct timezone sys_tz;
 
 asmlinkage long
-sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
+sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
 {
 	if (tv) {
 		struct timeval ktv;
@@ -458,7 +458,7 @@ sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
 }
 
 asmlinkage long
-sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
+sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
 {
 	struct timeval ktv;
 	struct timespec kts;
@@ -493,14 +493,14 @@ struct old_linux32_dirent {
 };
 
 struct getdents32_callback {
-	struct linux32_dirent * current_dir;
-	struct linux32_dirent * previous;
+	struct linux32_dirent __user * current_dir;
+	struct linux32_dirent __user * previous;
 	int count;
 	int error;
 };
 
 struct readdir32_callback {
-	struct old_linux32_dirent * dirent;
+	struct old_linux32_dirent __user * dirent;
 	int count;
 };
 
@@ -508,7 +508,7 @@ static int
 filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino,
 	   unsigned int d_type)
 {
-	struct linux32_dirent * dirent;
+	struct linux32_dirent __user * dirent;
 	struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
 	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2, 4);
 
@@ -524,18 +524,18 @@ filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino,
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	put_user(d_type, (char *)dirent + reclen - 1); 
-	dirent = ((void *)dirent) + reclen;
+	put_user(d_type, (char __user *)dirent + reclen - 1); 
+	dirent = ((void __user *)dirent) + reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
 }
 
 asmlinkage long
-sys32_getdents (unsigned int fd, void * dirent, unsigned int count)
+sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
 {
 	struct file * file;
-	struct linux32_dirent * lastdirent;
+	struct linux32_dirent __user * lastdirent;
 	struct getdents32_callback buf;
 	int error;
 
@@ -544,7 +544,7 @@ sys32_getdents (unsigned int fd, void * dirent, unsigned int count)
 	if (!file)
 		goto out;
 
-	buf.current_dir = (struct linux32_dirent *) dirent;
+	buf.current_dir = (struct linux32_dirent __user *) dirent;
 	buf.previous = NULL;
 	buf.count = count;
 	buf.error = 0;
@@ -569,7 +569,7 @@ static int
 fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, unsigned d_type)
 {
 	struct readdir32_callback * buf = (struct readdir32_callback *) __buf;
-	struct old_linux32_dirent * dirent;
+	struct old_linux32_dirent __user * dirent;
 
 	if (buf->count)
 		return -EINVAL;
@@ -584,7 +584,7 @@ fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t
 }
 
 asmlinkage long
-sys32_oldreaddir (unsigned int fd, void * dirent, unsigned int count)
+sys32_oldreaddir (unsigned int fd, void __user * dirent, unsigned int count)
 {
 	int error;
 	struct file * file;
@@ -606,107 +606,6 @@ out:
 	return error;
 }
 
-/*
- * We can actually return ERESTARTSYS instead of EINTR, but I'd
- * like to be certain this leads to no problems. So I return
- * EINTR just for safety.
- *
- * Update: ERESTARTSYS breaks at least the xview clock binary, so
- * I'm trying ERESTARTNOHAND which restart only when you want to.
- */
-#define MAX_SELECT_SECONDS \
-	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
-#define ROUND_UP_TIME(x,y) (((x)+(y)-1)/(y))
-
-asmlinkage long
-sys32_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct compat_timeval *tvp32)
-{
-	fd_set_bits fds;
-	char *bits;
-	long timeout;
-	int ret, size;
-
-	timeout = MAX_SCHEDULE_TIMEOUT;
-	if (tvp32) {
-		time_t sec, usec;
-
-		get_user(sec, &tvp32->tv_sec);
-		get_user(usec, &tvp32->tv_usec);
-
-		ret = -EINVAL;
-		if (sec < 0 || usec < 0)
-			goto out_nofds;
-
-		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
-			timeout = ROUND_UP_TIME(usec, 1000000/HZ);
-			timeout += sec * (unsigned long) HZ;
-		}
-	}
-
-	ret = -EINVAL;
-	if (n < 0)
-		goto out_nofds;
-
-	if (n > current->files->max_fdset)
-		n = current->files->max_fdset;
-
-	/*
-	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
-	 * since we used fdset we need to allocate memory in units of
-	 * long-words. 
-	 */
-	ret = -ENOMEM;
-	size = FDS_BYTES(n);
-	bits = kmalloc(6 * size, GFP_KERNEL);
-	if (!bits)
-		goto out_nofds;
-	fds.in      = (unsigned long *)  bits;
-	fds.out     = (unsigned long *) (bits +   size);
-	fds.ex      = (unsigned long *) (bits + 2*size);
-	fds.res_in  = (unsigned long *) (bits + 3*size);
-	fds.res_out = (unsigned long *) (bits + 4*size);
-	fds.res_ex  = (unsigned long *) (bits + 5*size);
-
-	if ((ret = get_fd_set(n, inp, fds.in)) ||
-	    (ret = get_fd_set(n, outp, fds.out)) ||
-	    (ret = get_fd_set(n, exp, fds.ex)))
-		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
-
-	ret = do_select(n, &fds, &timeout);
-
-	if (tvp32 && !(current->personality & STICKY_TIMEOUTS)) {
-		time_t sec = 0, usec = 0;
-		if (timeout) {
-			sec = timeout / HZ;
-			usec = timeout % HZ;
-			usec *= (1000000/HZ);
-		}
-		put_user(sec, (int *)&tvp32->tv_sec);
-		put_user(usec, (int *)&tvp32->tv_usec);
-	}
-
-	if (ret < 0)
-		goto out;
-	if (!ret) {
-		ret = -ERESTARTNOHAND;
-		if (signal_pending(current))
-			goto out;
-		ret = 0;
-	}
-
-	set_fd_set(n, inp, fds.res_in);
-	set_fd_set(n, outp, fds.res_out);
-	set_fd_set(n, exp, fds.res_ex);
-
-out:
-	kfree(bits);
-out_nofds:
-	return ret;
-}
-
 struct sel_arg_struct {
 	unsigned int n;
 	unsigned int inp;
@@ -716,112 +615,14 @@ struct sel_arg_struct {
 };
 
 asmlinkage long
-sys32_old_select(struct sel_arg_struct *arg)
+sys32_old_select(struct sel_arg_struct __user *arg)
 {
 	struct sel_arg_struct a;
 
 	if (copy_from_user(&a, arg, sizeof(a)))
 		return -EFAULT;
-	return sys32_select(a.n, (fd_set *)A(a.inp), (fd_set *)A(a.outp), (fd_set *)A(a.exp),
-			    (struct compat_timeval *)A(a.tvp));
-}
-
-static struct iovec *
-get_compat_iovec(struct compat_iovec *iov32, struct iovec *iov_buf, u32 *count, int type, int *errp)
-{
-	int i;
-	u32 buf, len;
-	struct iovec *ivp, *iov;
-	unsigned long totlen; 
-
-	/* Get the "struct iovec" from user memory */
-
-	*errp = 0;
-	if (!*count)
-		return 0;
-	*errp = -EINVAL;
-	if (*count > UIO_MAXIOV)
-		return(struct iovec *)0;
-	*errp = -EFAULT;
-	if(verify_area(VERIFY_READ, iov32, sizeof(struct compat_iovec)*(*count)))
-		return(struct iovec *)0;
-	if (*count > UIO_FASTIOV) {
-		*errp = -ENOMEM; 
-		iov = kmalloc(*count*sizeof(struct iovec), GFP_KERNEL);
-		if (!iov)
-			return((struct iovec *)0);
-	} else
-		iov = iov_buf;
-
-	ivp = iov;
-	totlen = 0;
-	for (i = 0; i < *count; i++) {
-		*errp = __get_user(len, &iov32->iov_len) |
-		  	__get_user(buf, &iov32->iov_base);	
-		if (*errp)
-			goto error;
-		*errp = verify_area(type, (void *)A(buf), len);
-		if (*errp) {
-			if (i > 0) { 
-				*count = i;
-				break;
-			} 
-			goto error;
-		}
-		/* SuS checks: */
-		*errp = -EINVAL; 
-		if ((int)len < 0)
-			goto error;
-		if ((totlen += len) >= 0x7fffffff)
-			goto error;			
-		ivp->iov_base = (void *)A(buf);
-		ivp->iov_len = (__kernel_size_t)len;
-		iov32++;
-		ivp++;
-	}
-	*errp = 0;
-	return(iov);
-
-error:
-	if (iov != iov_buf)
-		kfree(iov);
-	return NULL;
-}
-
-asmlinkage long
-sys32_readv(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov;
-	int ret;
-	mm_segment_t old_fs = get_fs();
-
-	if ((iov = get_compat_iovec(vector, iovstack, &count, VERIFY_WRITE, &ret)) == NULL)
-		return ret;
-	set_fs(KERNEL_DS);
-	ret = sys_readv(fd, iov, count);
-	set_fs(old_fs);
-	if (iov != iovstack)
-		kfree(iov);
-	return ret;
-}
-
-asmlinkage long
-sys32_writev(int fd, struct compat_iovec *vector, u32 count)
-{
-	struct iovec iovstack[UIO_FASTIOV];
-	struct iovec *iov;
-	int ret;
-	mm_segment_t old_fs = get_fs();
-
-	if ((iov = get_compat_iovec(vector, iovstack, &count, VERIFY_READ, &ret)) == NULL)
-		return ret;
-	set_fs(KERNEL_DS);
-	ret = sys_writev(fd, iov, count);
-	set_fs(old_fs);
-	if (iov != iovstack)
-		kfree(iov);
-	return ret;
+	return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
+				 compat_ptr(a.exp), compat_ptr(a.tvp));
 }
 
 /*
@@ -829,7 +630,7 @@ sys32_writev(int fd, struct compat_iovec *vector, u32 count)
  * sys_gettimeofday().  x86-64 did this but i386 Linux did not
  * so we have to implement this system call here.
  */
-asmlinkage long sys32_time(int * tloc)
+asmlinkage long sys32_time(int __user * tloc)
 {
 	int i;
 	struct timeval tv;
@@ -892,7 +693,7 @@ struct sysinfo32 {
 };
 
 asmlinkage long
-sys32_sysinfo(struct sysinfo32 *info)
+sys32_sysinfo(struct sysinfo32 __user *info)
 {
 	struct sysinfo s;
 	int ret;
@@ -941,7 +742,7 @@ sys32_sysinfo(struct sysinfo32 *info)
 }
                 
 asmlinkage long
-sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec *interval)
+sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval)
 {
 	struct timespec t;
 	int ret;
@@ -981,8 +782,8 @@ sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
 
 
 asmlinkage long
-sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
-		      struct compat_timespec *uts, compat_size_t sigsetsize)
+sys32_rt_sigtimedwait(compat_sigset_t __user *uthese, siginfo_t32 __user *uinfo,
+		      struct compat_timespec __user *uts, compat_size_t sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -1019,7 +820,7 @@ sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
 }
 
 asmlinkage long
-sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 *uinfo)
+sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo)
 {
 	siginfo_t info;
 	int ret;
@@ -1055,7 +856,7 @@ struct sysctl_ia32 {
 
 
 asmlinkage long
-sys32_sysctl(struct sysctl_ia32 *args32)
+sys32_sysctl(struct sysctl_ia32 __user *args32)
 {
 #ifndef CONFIG_SYSCTL
 	return -ENOSYS; 
@@ -1105,14 +906,14 @@ sys32_sysctl(struct sysctl_ia32 *args32)
 
 /* warning: next two assume little endian */ 
 asmlinkage long
-sys32_pread(unsigned int fd, char *ubuf, u32 count, u32 poslo, u32 poshi)
+sys32_pread(unsigned int fd, char __user *ubuf, u32 count, u32 poslo, u32 poshi)
 {
 	return sys_pread64(fd, ubuf, count,
 			 ((loff_t)AA(poshi) << 32) | AA(poslo));
 }
 
 asmlinkage long
-sys32_pwrite(unsigned int fd, char *ubuf, u32 count, u32 poslo, u32 poshi)
+sys32_pwrite(unsigned int fd, char __user *ubuf, u32 count, u32 poslo, u32 poshi)
 {
 	return sys_pwrite64(fd, ubuf, count,
 			  ((loff_t)AA(poshi) << 32) | AA(poslo));
@@ -1133,7 +934,7 @@ sys32_personality(unsigned long personality)
 }
 
 asmlinkage long
-sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
+sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, s32 count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
@@ -1170,7 +971,7 @@ struct timex32 {
 extern int do_adjtimex(struct timex *);
 
 asmlinkage long
-sys32_adjtimex(struct timex32 *utp)
+sys32_adjtimex(struct timex32 __user *utp)
 {
 	struct timex txc;
 	int ret;
@@ -1255,7 +1056,7 @@ asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
 	return error;
 }
 
-asmlinkage long sys32_olduname(struct oldold_utsname * name)
+asmlinkage long sys32_olduname(struct oldold_utsname __user * name)
 {
 	int error;
 
@@ -1289,7 +1090,7 @@ asmlinkage long sys32_olduname(struct oldold_utsname * name)
 	 return error;
 }
 
-long sys32_uname(struct old_utsname * name)
+long sys32_uname(struct old_utsname __user * name)
 {
 	int err;
 	if (!name)
@@ -1323,98 +1124,27 @@ long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
 	return ret;
 } 
 
-static int nargs(u32 src, char **dst) 
-{ 
-	int cnt;
-	u32 val; 
-
-	cnt = 0; 
-	do { 		
-		int ret = get_user(val, (__u32 *)(u64)src); 
-		if (ret)
-			return ret;
-		if (dst)
-			dst[cnt] = (char *)(u64)val; 
-		cnt++;
-		src += 4; 	
-		if (cnt >= (MAX_ARG_PAGES*PAGE_SIZE)/sizeof(void*))
-			return -E2BIG; 
-	} while(val); 
-	if (dst)
-		dst[cnt-1] = 0; 
-	return cnt; 
-} 
-
-asmlinkage long sys32_execve(char *name, u32 argv, u32 envp, struct pt_regs regs)
-{ 
-	mm_segment_t oldseg; 
-	char **buf = NULL; 
-	int na = 0,ne = 0;
-	int ret;
-	unsigned sz = 0; 
-
-	if (argv) {
-	na = nargs(argv, NULL); 
-	if (na < 0) 
-		return -EFAULT; 
-	} 	
-	if (envp) { 
-	ne = nargs(envp, NULL); 
-	if (ne < 0) 
-		return -EFAULT; 
-	}
-
-	if (argv || envp) { 
-	sz = (na+ne)*sizeof(void *); 
-	if (sz > PAGE_SIZE) 
-		buf = vmalloc(sz); 
-	else
-		buf = kmalloc(sz, GFP_KERNEL); 
-	if (!buf)
-		return -ENOMEM; 
-	} 
-	
-	if (argv) { 
-	ret = nargs(argv, buf);
-	if (ret < 0)
-		goto free;
-	}
-
-	if (envp) { 
-	ret = nargs(envp, buf + na); 
-	if (ret < 0)
-		goto free; 
-	}
-
-	name = getname(name); 
-	ret = PTR_ERR(name); 
-	if (IS_ERR(name))
-		goto free; 
-
-	oldseg = get_fs(); 
-	set_fs(KERNEL_DS);
-	ret = do_execve(name, argv ? buf : NULL, envp ? buf+na : NULL, &regs);  
-	set_fs(oldseg); 
-
-	if (ret == 0)
+asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
+			     compat_uptr_t __user *envp, struct pt_regs regs)
+{
+	long error;
+	char * filename;
+
+	filename = getname(name);
+	error = PTR_ERR(filename);
+	if (IS_ERR(filename))
+		return error;
+	error = compat_do_execve(filename, argv, envp, &regs);
+	if (error == 0)
 		current->ptrace &= ~PT_DTRACE;
-
-	putname(name);
- 
-free:
-	if (argv || envp) { 
-	if (sz > PAGE_SIZE)
-		vfree(buf); 
-	else
-	kfree(buf);
-	}
-	return ret; 
-} 
+	putname(filename);
+	return error;
+}
 
 asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp, struct pt_regs regs)
 {
-	void *parent_tid = (void *)regs.rdx;
-	void *child_tid = (void *)regs.rdi; 
+	void __user *parent_tid = (void __user *)regs.rdx;
+	void __user *child_tid = (void __user *)regs.rdi; 
 	if (!newsp)
 		newsp = regs.rsp;
         return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0, 
@@ -1436,234 +1166,7 @@ long sys32_kill(int pid, int sig)
 }
  
 
-#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)
-/* Stuff for NFS server syscalls... */
-struct nfsctl_svc32 {
-	u16			svc32_port;
-	s32			svc32_nthreads;
-};
-
-struct nfsctl_client32 {
-	s8			cl32_ident[NFSCLNT_IDMAX+1];
-	s32			cl32_naddr;
-	struct in_addr		cl32_addrlist[NFSCLNT_ADDRMAX];
-	s32			cl32_fhkeytype;
-	s32			cl32_fhkeylen;
-	u8			cl32_fhkey[NFSCLNT_KEYMAX];
-};
-
-struct nfsctl_export32 {
-	s8			ex32_client[NFSCLNT_IDMAX+1];
-	s8			ex32_path[NFS_MAXPATHLEN+1];
-	compat_dev_t	ex32_dev;
-	compat_ino_t	ex32_ino;
-	s32			ex32_flags;
-	compat_pid_t	ex32_anon_uid;
-	compat_gid_t	ex32_anon_gid;
-};
-
-struct nfsctl_fdparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_version;
-};
-
-struct nfsctl_fsparm32 {
-	struct sockaddr		gd32_addr;
-	s8			gd32_path[NFS_MAXPATHLEN+1];
-	s32			gd32_maxlen;
-};
-
-struct nfsctl_arg32 {
-	s32			ca32_version;	/* safeguard */
-	union {
-		struct nfsctl_svc32	u32_svc;
-		struct nfsctl_client32	u32_client;
-		struct nfsctl_export32	u32_export;
-		struct nfsctl_fdparm32	u32_getfd;
-		struct nfsctl_fsparm32	u32_getfs;
-	} u;
-#define ca32_svc	u.u32_svc
-#define ca32_client	u.u32_client
-#define ca32_export	u.u32_export
-#define ca32_getfd	u.u32_getfd
-#define ca32_getfs	u.u32_getfs
-};
-
-union nfsctl_res32 {
-	__u8			cr32_getfh[NFS_FHSIZE];
-	struct knfsd_fh		cr32_getfs;
-};
-
-static int nfs_svc32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = get_user(karg->ca_version, &arg32->ca32_version);
-	err |= __get_user(karg->ca_svc.svc_port, &arg32->ca32_svc.svc32_port);
-	err |= __get_user(karg->ca_svc.svc_nthreads, &arg32->ca32_svc.svc32_nthreads);
-	return err;
-}
-
-static int nfs_clnt32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_client.cl_ident[0],
-			  &arg32->ca32_client.cl32_ident[0],
-			  NFSCLNT_IDMAX);
-	err |= __get_user(karg->ca_client.cl_naddr, &arg32->ca32_client.cl32_naddr);
-	err |= copy_from_user(&karg->ca_client.cl_addrlist[0],
-			  &arg32->ca32_client.cl32_addrlist[0],
-			  (sizeof(struct in_addr) * NFSCLNT_ADDRMAX));
-	err |= __get_user(karg->ca_client.cl_fhkeytype,
-		      &arg32->ca32_client.cl32_fhkeytype);
-	err |= __get_user(karg->ca_client.cl_fhkeylen,
-		      &arg32->ca32_client.cl32_fhkeylen);
-	err |= copy_from_user(&karg->ca_client.cl_fhkey[0],
-			  &arg32->ca32_client.cl32_fhkey[0],
-			  NFSCLNT_KEYMAX);
-	return err;
-}
-
-static int nfs_exp32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_export.ex_client[0],
-			  &arg32->ca32_export.ex32_client[0],
-			  NFSCLNT_IDMAX);
-	err |= copy_from_user(&karg->ca_export.ex_path[0],
-			  &arg32->ca32_export.ex32_path[0],
-			  NFS_MAXPATHLEN);
-	err |= __get_user(karg->ca_export.ex_dev,
-		      &arg32->ca32_export.ex32_dev);
-	err |= __get_user(karg->ca_export.ex_ino,
-		      &arg32->ca32_export.ex32_ino);
-	err |= __get_user(karg->ca_export.ex_flags,
-		      &arg32->ca32_export.ex32_flags);
-	err |= __get_user(karg->ca_export.ex_anon_uid,
-		      &arg32->ca32_export.ex32_anon_uid);
-	err |= __get_user(karg->ca_export.ex_anon_gid,
-		      &arg32->ca32_export.ex32_anon_gid);
-	SET_UID(karg->ca_export.ex_anon_uid, karg->ca_export.ex_anon_uid);
-	SET_GID(karg->ca_export.ex_anon_gid, karg->ca_export.ex_anon_gid);
-	return err;
-}
-
-
-static int nfs_getfd32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfd.gd_addr,
-			  &arg32->ca32_getfd.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfd.gd_path,
-			  &arg32->ca32_getfd.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= get_user(karg->ca_getfd.gd_version,
-		      &arg32->ca32_getfd.gd32_version);
-	return err;
-}
-
-static int nfs_getfs32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
-{
-	int err;
-	
-	err = get_user(karg->ca_version, &arg32->ca32_version);
-	err |= copy_from_user(&karg->ca_getfs.gd_addr,
-			  &arg32->ca32_getfs.gd32_addr,
-			  (sizeof(struct sockaddr)));
-	err |= copy_from_user(&karg->ca_getfs.gd_path,
-			  &arg32->ca32_getfs.gd32_path,
-			  (NFS_MAXPATHLEN+1));
-	err |= get_user(karg->ca_getfs.gd_maxlen,
-		      &arg32->ca32_getfs.gd32_maxlen);
-	return err;
-}
-
-/* This really doesn't need translations, we are only passing
- * back a union which contains opaque nfs file handle data.
- */
-static int nfs_getfh32_res_trans(union nfsctl_res *kres, union nfsctl_res32 *res32)
-{
-	return copy_to_user(res32, kres, sizeof(*res32)) ? -EFAULT : 0;
-}
-
-long asmlinkage sys32_nfsservctl(int cmd, struct nfsctl_arg32 *arg32, union nfsctl_res32 *res32)
-{
-	struct nfsctl_arg *karg = NULL;
-	union nfsctl_res *kres = NULL;
-	mm_segment_t oldfs;
-	int err;
-
-	karg = kmalloc(sizeof(*karg), GFP_USER);
-	if(!karg)
-		return -ENOMEM;
-	if(res32) {
-		kres = kmalloc(sizeof(*kres), GFP_USER);
-		if(!kres) {
-			kfree(karg);
-			return -ENOMEM;
-		}
-	}
-	switch(cmd) {
-	case NFSCTL_SVC:
-		err = nfs_svc32_trans(karg, arg32);
-		break;
-	case NFSCTL_ADDCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_DELCLIENT:
-		err = nfs_clnt32_trans(karg, arg32);
-		break;
-	case NFSCTL_EXPORT:
-	case NFSCTL_UNEXPORT:
-		err = nfs_exp32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFD:
-		err = nfs_getfd32_trans(karg, arg32);
-		break;
-	case NFSCTL_GETFS:
-		err = nfs_getfs32_trans(karg, arg32);
-		break;
-	default:
-		err = -EINVAL;
-		break;
-	}
-	if(err)
-		goto done;
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_nfsservctl(cmd, karg, kres);
-	set_fs(oldfs);
-
-	if (err)
-		goto done;
-
-	if((cmd == NFSCTL_GETFD) ||
-	   (cmd == NFSCTL_GETFS))
-		err = nfs_getfh32_res_trans(kres, res32);
-
-done:
-	if(karg)
-		kfree(karg);
-	if(kres)
-		kfree(kres);
-	return err;
-}
-#else /* !NFSD */
-long asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2)
-{
-	return sys_ni_syscall();
-}
-#endif
-
-long sys32_io_setup(unsigned nr_reqs, u32 *ctx32p)
+long sys32_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
 { 
 	long ret; 
 	aio_context_t ctx64;
@@ -1678,7 +1181,7 @@ long sys32_io_setup(unsigned nr_reqs, u32 *ctx32p)
 } 
 
 asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr,
-		   compat_uptr_t *iocbpp)
+		   compat_uptr_t __user *iocbpp)
 {
 	struct kioctx *ctx;
 	long ret = 0;
@@ -1698,7 +1201,8 @@ asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr,
 
 	for (i=0; i<nr; i++) {
 		compat_uptr_t p32;
-		struct iocb *user_iocb, tmp;
+		struct iocb __user *user_iocb;
+		struct iocb tmp;
 
 		if (unlikely(__get_user(p32, iocbpp + i))) {
 			ret = -EFAULT;
@@ -1724,8 +1228,8 @@ asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr,
 asmlinkage long sys32_io_getevents(aio_context_t ctx_id,
 				 unsigned long min_nr,
 				 unsigned long nr,
-				 struct io_event *events,
-				 struct compat_timespec *timeout)
+				 struct io_event __user *events,
+				 struct compat_timespec __user *timeout)
 { 	
 	long ret;
 	mm_segment_t oldfs; 
@@ -1745,7 +1249,7 @@ asmlinkage long sys32_io_getevents(aio_context_t ctx_id,
 	return ret;
 } 
 
-asmlinkage long sys32_open(const char * filename, int flags, int mode)
+asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
 {
 	char * tmp;
 	int fd, error;
@@ -1782,11 +1286,11 @@ sys_timer_create(clockid_t which_clock,
 		 timer_t __user * created_timer_id);
 
 long
-sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
+sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
 {
 	struct sigevent se;
-       mm_segment_t oldfs;
-       long err;
+	mm_segment_t oldfs;
+	long err;
 
 	if (se32) { 
 		memset(&se, 0, sizeof(struct sigevent)); 
@@ -1800,9 +1304,9 @@ sys32_timer_create(u32 clock, struct sigevent32 *se32, timer_t *timer_id)
 	if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
 		return -EFAULT;
 
-       oldfs = get_fs();
+	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-       err = sys_timer_create(clock, se32 ? &se : NULL, timer_id);
+	err = sys_timer_create(clock, se32 ? &se : NULL, timer_id);
 	set_fs(oldfs); 
 	
 	return err; 
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
index 64b7a598f..1806bff66 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86_64/ia32/syscall32.c
@@ -83,9 +83,9 @@ void __init syscall32_cpu_init(void)
 
 	/* Load these always in case some future AMD CPU supports
 	   SYSENTER from compat mode too. */
-	wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
-	wrmsr(MSR_IA32_SYSENTER_ESP, 0, 0);
-	wrmsrl(MSR_IA32_SYSENTER_EIP, ia32_sysenter_target);
+	checking_wrmsrl(MSR_IA32_SYSENTER_CS, (u64)__KERNEL_CS);
+	checking_wrmsrl(MSR_IA32_SYSENTER_ESP, 0ULL);
+	checking_wrmsrl(MSR_IA32_SYSENTER_EIP, (u64)ia32_sysenter_target);
 
 	wrmsrl(MSR_CSTAR, ia32_cstar_target);
 }
diff --git a/arch/x86_64/ia32/tls32.c b/arch/x86_64/ia32/tls32.c
index 15d02cd63..1cc4340de 100644
--- a/arch/x86_64/ia32/tls32.c
+++ b/arch/x86_64/ia32/tls32.c
@@ -28,7 +28,7 @@ static int get_free_idx(void)
  * Set a given TLS descriptor:
  * When you want addresses > 32bit use arch_prctl() 
  */
-int do_set_thread_area(struct thread_struct *t, struct user_desc *u_info)
+int do_set_thread_area(struct thread_struct *t, struct user_desc __user *u_info)
 {
 	struct user_desc info;
 	struct n_desc_struct *desc;
@@ -75,7 +75,7 @@ int do_set_thread_area(struct thread_struct *t, struct user_desc *u_info)
 	return 0;
 }
 
-asmlinkage long sys32_set_thread_area(struct user_desc *u_info)
+asmlinkage long sys32_set_thread_area(struct user_desc __user *u_info)
 { 
 	return do_set_thread_area(&current->thread, u_info); 
 } 
@@ -94,7 +94,7 @@ asmlinkage long sys32_set_thread_area(struct user_desc *u_info)
 	((desc)->a & 0x0ffff) | \
 	 ((desc)->b & 0xf0000) )
 	
-#define GET_32BIT(desc)		(((desc)->b >> 23) & 1)
+#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
 #define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
 #define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
 #define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
@@ -102,7 +102,7 @@ asmlinkage long sys32_set_thread_area(struct user_desc *u_info)
 #define GET_USEABLE(desc)	(((desc)->b >> 20) & 1)
 #define GET_LONGMODE(desc)	(((desc)->b >> 21) & 1)
 
-int do_get_thread_area(struct thread_struct *t, struct user_desc *u_info)
+int do_get_thread_area(struct thread_struct *t, struct user_desc __user *u_info)
 {
 	struct user_desc info;
 	struct n_desc_struct *desc;
@@ -132,7 +132,7 @@ int do_get_thread_area(struct thread_struct *t, struct user_desc *u_info)
 	return 0;
 }
 
-asmlinkage long sys32_get_thread_area(struct user_desc *u_info)
+asmlinkage long sys32_get_thread_area(struct user_desc __user *u_info)
 {
 	return do_get_thread_area(&current->thread, u_info);
 } 
@@ -141,10 +141,11 @@ asmlinkage long sys32_get_thread_area(struct user_desc *u_info)
 int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs)
 {
 	struct n_desc_struct *desc;
-	struct user_desc info, *cp;
+	struct user_desc info;
+	struct user_desc __user *cp;
 	int idx;
 	
-	cp = (void *)childregs->rsi;
+	cp = (void __user *)childregs->rsi;
 	if (copy_from_user(&info, cp, sizeof(info)))
 		return -EFAULT;
 	if (LDT_empty(&info))
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index e3cb55503..dc6f2695e 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 obj-$(CONFIG_GART_IOMMU)	+= pci-gart.o aperture.o
 obj-$(CONFIG_DUMMY_IOMMU)	+= pci-nommu.o pci-dma.o
 obj-$(CONFIG_SWIOTLB)		+= swiotlb.o
+obj-$(CONFIG_SCHED_SMT)		+= domain.o
 
 obj-$(CONFIG_MODULES)		+= module.o
 
diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c
index 20e9266df..3331a564f 100644
--- a/arch/x86_64/kernel/acpi/sleep.c
+++ b/arch/x86_64/kernel/acpi/sleep.c
@@ -114,7 +114,6 @@ void __init acpi_reserve_bootmem(void)
 	acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
 	if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
 		printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
-	printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
 }
 
 static int __init acpi_sleep_setup(char *str)
diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c
index b04a1add2..4055c78d2 100644
--- a/arch/x86_64/kernel/head64.c
+++ b/arch/x86_64/kernel/head64.c
@@ -73,6 +73,8 @@ static void __init setup_boot_cpu_data(void)
 	boot_cpu_data.x86_mask = eax & 0xf;
 }
 
+extern char _end[];
+
 void __init x86_64_start_kernel(char * real_mode_data)
 {
 	char *s;
@@ -80,6 +82,9 @@ void __init x86_64_start_kernel(char * real_mode_data)
 	clear_bss();
 	pda_init(0);
 	copy_bootdata(real_mode_data);
+#ifdef CONFIG_SMP
+	cpu_set(0, cpu_online_map);
+#endif
 	/* default console: */
 	if (!strstr(saved_command_line, "console="))
 		strcat(saved_command_line, " console=tty0"); 
@@ -95,6 +100,10 @@ void __init x86_64_start_kernel(char * real_mode_data)
 	if (strstr(saved_command_line, "disableapic"))
 		disable_apic = 1;
 #endif
+	/* You need early console to see that */
+	if (__pa_symbol(&_end) >= KERNEL_TEXT_SIZE)
+		panic("Kernel too big for kernel mapping\n");
+
 	setup_boot_cpu_data();
 	start_kernel();
 }
diff --git a/arch/x86_64/kernel/i387.c b/arch/x86_64/kernel/i387.c
index 1aa4deb43..6bc3d64e0 100644
--- a/arch/x86_64/kernel/i387.c
+++ b/arch/x86_64/kernel/i387.c
@@ -77,7 +77,7 @@ void init_fpu(struct task_struct *child)
  * Signal frame handlers.
  */
 
-int save_i387(struct _fpstate *buf)
+int save_i387(struct _fpstate __user *buf)
 {
 	struct task_struct *tsk = current;
 	int err = 0;
@@ -95,7 +95,7 @@ int save_i387(struct _fpstate *buf)
 		return 0;
 	tsk->used_math = 0; /* trigger finit */ 
 	if (tsk->thread_info->status & TS_USEDFPU) {
-		err = save_i387_checking((struct i387_fxsave_struct *)buf);
+		err = save_i387_checking((struct i387_fxsave_struct __user *)buf);
 		if (err) return err;
 		stts();
 		} else {
@@ -110,14 +110,14 @@ int save_i387(struct _fpstate *buf)
  * ptrace request handlers.
  */
 
-int get_fpregs(struct user_i387_struct *buf, struct task_struct *tsk)
+int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *tsk)
 {
 	init_fpu(tsk);
-	return __copy_to_user((void *)buf, &tsk->thread.i387.fxsave,
+	return __copy_to_user(buf, &tsk->thread.i387.fxsave,
 			       sizeof(struct user_i387_struct)) ? -EFAULT : 0;
 }
 
-int set_fpregs(struct task_struct *tsk, struct user_i387_struct *buf)
+int set_fpregs(struct task_struct *tsk, struct user_i387_struct __user *buf)
 {
 	if (__copy_from_user(&tsk->thread.i387.fxsave, buf, 
 			     sizeof(struct user_i387_struct)))
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 2fceed588..718504a32 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -237,6 +237,7 @@ void __init check_ioapic(void)
 			for (func = 0; func < 8; func++) { 
 				u32 class;
 				u32 vendor;
+				u8 type;
 				class = read_pci_config(num,slot,func,
 							PCI_CLASS_REVISION);
 				if (class == 0xffffffff)
@@ -251,14 +252,15 @@ void __init check_ioapic(void)
 				switch (vendor) { 
 				case PCI_VENDOR_ID_VIA:
 #ifdef CONFIG_GART_IOMMU
-					if (end_pfn >= (0xffffffff>>PAGE_SHIFT) &&
+					if ((end_pfn >= (0xffffffff>>PAGE_SHIFT) ||
+					     force_iommu) &&
 					    !iommu_aperture_allowed) {
 						printk(KERN_INFO
     "Looks like a VIA chipset. Disabling IOMMU. Overwrite with \"iommu=allowed\"\n");
 						iommu_aperture_disabled = 1;
 					}
 #endif
-					/* FALL THROUGH */
+					return;
 				case PCI_VENDOR_ID_NVIDIA:
 #ifndef CONFIG_SMP
 					printk(KERN_INFO 
@@ -270,8 +272,8 @@ void __init check_ioapic(void)
 				} 
 
 				/* No multi-function device? */
-				u8 type = read_pci_config_byte(num,slot,func,
-							       PCI_HEADER_TYPE);
+				type = read_pci_config_byte(num,slot,func,
+							    PCI_HEADER_TYPE);
 				if (!(type & 0x80))
 					break;
 			} 
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index 732a6f4d3..bfdb95e8b 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -833,7 +833,8 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off,
 	return len;
 }
 
-static int irq_affinity_write_proc (struct file *file, const char *buffer,
+static int irq_affinity_write_proc (struct file *file,
+					const char __user *buffer,
 					unsigned long count, void *data)
 {
 	int irq = (long) data, full_count = count, err;
@@ -871,7 +872,8 @@ static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 	return len;
 }
 
-static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
+static int prof_cpu_mask_write_proc (struct file *file,
+					const char __user *buffer,
 					unsigned long count, void *data)
 {
 	unsigned long full_count = count, err;
diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
index 1b6252c09..4e43e53a1 100644
--- a/arch/x86_64/kernel/ldt.c
+++ b/arch/x86_64/kernel/ldt.c
@@ -125,7 +125,7 @@ void destroy_context(struct mm_struct *mm)
 	}
 }
 
-static int read_ldt(void * ptr, unsigned long bytecount)
+static int read_ldt(void __user * ptr, unsigned long bytecount)
 {
 	int err;
 	unsigned long size;
@@ -153,7 +153,7 @@ static int read_ldt(void * ptr, unsigned long bytecount)
 	return bytecount;
 }
 
-static int read_default_ldt(void * ptr, unsigned long bytecount)
+static int read_default_ldt(void __user * ptr, unsigned long bytecount)
 {
 	/* Arbitrary number */ 
 	/* x86-64 default LDT is all zeros */
@@ -164,7 +164,7 @@ static int read_default_ldt(void * ptr, unsigned long bytecount)
 	return bytecount; 
 }
 
-static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
+static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode)
 {
 	struct task_struct *me = current;
 	struct mm_struct * mm = me->mm;
@@ -225,7 +225,7 @@ out:
 	return error;
 }
 
-asmlinkage int sys_modify_ldt(int func, void *ptr, unsigned long bytecount)
+asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
 {
 	int ret = -ENOSYS;
 
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 922d62fcf..3bb678f1e 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -25,8 +25,9 @@
 #define NR_BANKS 5
 
 static int mce_disabled __initdata;
-/* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic */ 
-static int tolerant = 2;
+/* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic,
+   3: never panic or exit (for testing only) */
+static int tolerant = 1;
 static int banks;
 static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
 
@@ -96,7 +97,8 @@ static void mce_panic(char *msg, struct mce *backup, unsigned long start)
 	int i;
 	oops_begin();
 	for (i = 0; i < MCE_LOG_LEN; i++) {
-		if (mcelog.entry[i].tsc < start)
+		unsigned long tsc = mcelog.entry[i].tsc;
+		if (time_before(tsc, start))
 			continue;
 		print_mce(&mcelog.entry[i]); 
 		if (mcelog.entry[i].tsc == backup->tsc)
@@ -104,7 +106,10 @@ static void mce_panic(char *msg, struct mce *backup, unsigned long start)
 	}
 	if (backup)
 		print_mce(backup);
-	panic(msg);
+	if (tolerant >= 3)
+		printk("Fake panic: %s\n", msg);
+	else
+		panic(msg);
 } 
 
 static int mce_available(struct cpuinfo_x86 *c)
@@ -120,8 +125,8 @@ static int mce_available(struct cpuinfo_x86 *c)
 
 void do_machine_check(struct pt_regs * regs, long error_code)
 {
-	struct mce m;
-	int nowayout = 0;
+	struct mce m, panicm;
+	int nowayout = (tolerant < 1); 
 	int kill_it = 0;
 	u64 mcestart;
 	int i;
@@ -149,13 +154,31 @@ void do_machine_check(struct pt_regs * regs, long error_code)
 	for (i = 0; i < banks; i++) {
 		if (!bank[i])
 			continue;
+		
+		m.misc = 0; 
+		m.addr = 0;
 
 		rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
 		if ((m.status & MCI_STATUS_VAL) == 0)
 			continue;
+		/* Should be implied by the banks check above, but
+		   check it anyways */
+		if ((m.status & MCI_STATUS_EN) == 0)
+			continue;
 
-		nowayout |= (tolerant < 1); 
-		nowayout |= !!(m.status & (MCI_STATUS_OVER|MCI_STATUS_PCC));
+		/* Did this bank cause the exception? */
+		/* Assume that the bank with uncorrectable errors did it,
+		   and that there is only a single one. */
+		if (m.status & MCI_STATUS_UC) {
+			panicm = m;
+		} else {
+			m.rip = 0;
+			m.cs = 0;
+		}
+
+		/* In theory _OVER could be a nowayout too, but
+		   assume any overflowed errors were no fatal. */
+		nowayout |= !!(m.status & MCI_STATUS_PCC);
 		kill_it |= !!(m.status & MCI_STATUS_UC);
 		m.bank = i;
 
@@ -176,7 +199,10 @@ void do_machine_check(struct pt_regs * regs, long error_code)
 	if (nowayout)
 		mce_panic("Machine check", &m, mcestart);
 	if (kill_it) {
-		int user_space = (m.rip && (m.cs & 3));
+		int user_space = 0;
+
+		if (m.mcgstatus & MCG_STATUS_RIPV)
+			user_space = m.rip && (m.cs & 3);
 		
 		/* When the machine was in user space and the CPU didn't get
 		   confused it's normally not necessary to panic, unless you 
@@ -187,11 +213,12 @@ void do_machine_check(struct pt_regs * regs, long error_code)
 		   it is best to just halt the machine. */
 		if ((!user_space && (panic_on_oops || tolerant < 2)) ||
 		    (unsigned)current->pid <= 1)
-			mce_panic("Uncorrected machine check", &m, mcestart);
+			mce_panic("Uncorrected machine check", &panicm, mcestart);
 
 		/* do_exit takes an awful lot of locks and has as slight risk 
 		   of deadlocking. If you don't want that don't set tolerant >= 2 */
-		do_exit(SIGBUS);
+		if (tolerant < 3)
+			do_exit(SIGBUS);
 	}
 }
 
@@ -207,7 +234,7 @@ static void mce_clear_all(void)
  * Periodic polling timer for "silent" machine check errors.
  */
 
-static int check_interval = 3600; /* one hour */
+static int check_interval = 5 * 60; /* 5 minutes */
 static void mcheck_timer(void *data);
 static DECLARE_WORK(mcheck_work, mcheck_timer, NULL);
 
@@ -297,12 +324,12 @@ static void collect_tscs(void *data)
 	rdtscll(cpu_tsc[smp_processor_id()]);
 } 
 
-static ssize_t mce_read(struct file *filp, char *ubuf, size_t usize, loff_t *off)
+static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, loff_t *off)
 {
 	unsigned long cpu_tsc[NR_CPUS];
 	static DECLARE_MUTEX(mce_read_sem);
 	unsigned next;
-	char *buf = ubuf;
+	char __user *buf = ubuf;
 	int i, err;
 
 	down(&mce_read_sem); 
@@ -348,19 +375,20 @@ static ssize_t mce_read(struct file *filp, char *ubuf, size_t usize, loff_t *off
 
 static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd, unsigned long arg)
 {
+	int __user *p = (int __user *)arg;
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM; 
 	switch (cmd) {
 	case MCE_GET_RECORD_LEN: 
-		return put_user(sizeof(struct mce), (int *)arg);
+		return put_user(sizeof(struct mce), p);
 	case MCE_GET_LOG_LEN:
-		return put_user(MCE_LOG_LEN, (int *)arg);		
+		return put_user(MCE_LOG_LEN, p);		
 	case MCE_GETCLEAR_FLAGS: {
 		unsigned flags;
 		do { 
 			flags = mcelog.flags;
 		} while (cmpxchg(&mcelog.flags, flags, 0) != flags); 
-		return put_user(flags, (int *)arg); 
+		return put_user(flags, p); 
 	}
 	default:
 		return -ENOTTY; 
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 9f805a508..7dcc1b51a 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -575,6 +575,7 @@ static int __init smp_scan_config (unsigned long base, unsigned long length)
 	extern void __bad_mpf_size(void); 
 	unsigned int *bp = phys_to_virt(base);
 	struct intel_mp_floating *mpf;
+	static int printed __initdata; 
 
 	Dprintk("Scan SMP from %p for %ld bytes.\n", bp,length);
 	if (sizeof(*mpf) != 16)
@@ -598,7 +599,10 @@ static int __init smp_scan_config (unsigned long base, unsigned long length)
 		bp += 4;
 		length -= 16;
 	}
-	printk(KERN_INFO "No mptable found.\n");
+	if (!printed) {		
+		printk(KERN_INFO "No mptable found.\n");
+		printed = 1;
+	}
 	return 0;
 }
 
@@ -920,8 +924,11 @@ void __init mp_parse_prt (void)
 		}
 
 		/* Don't set up the ACPI SCI because it's already set up */
-		if (acpi_fadt.sci_int == gsi)
+		if (acpi_fadt.sci_int == gsi) {
+			/* we still need to set up the entry's irq */
+			acpi_gsi_to_irq(gsi, &entry->irq);
 			continue;
+		}
 
 		ioapic = mp_find_ioapic(gsi);
 		if (ioapic < 0)
diff --git a/arch/x86_64/kernel/msr.c b/arch/x86_64/kernel/msr.c
index 2621d9f0b..654e4578d 100644
--- a/arch/x86_64/kernel/msr.c
+++ b/arch/x86_64/kernel/msr.c
@@ -1,4 +1,3 @@
-#ident "$Id$"
 /* ----------------------------------------------------------------------- *
  *   
  *   Copyright 2000 H. Peter Anvin - All Rights Reserved
@@ -187,10 +186,10 @@ static loff_t msr_seek(struct file *file, loff_t offset, int orig)
   return ret;
 }
 
-static ssize_t msr_read(struct file * file, char * buf,
+static ssize_t msr_read(struct file * file, char __user * buf,
 			size_t count, loff_t *ppos)
 {
-  u32 *tmp = (u32 *)buf;
+  char __user *tmp = buf;
   u32 data[2];
   size_t rv;
   u32 reg = *ppos;
@@ -206,16 +205,16 @@ static ssize_t msr_read(struct file * file, char * buf,
       return err;
     if ( copy_to_user(tmp,&data,8) )
       return -EFAULT;
-    tmp += 2;
+    tmp += 8;
   }
 
-  return ((char *)tmp) - buf;
+  return tmp - buf;
 }
 
-static ssize_t msr_write(struct file * file, const char * buf,
+static ssize_t msr_write(struct file * file, const char __user * buf,
 			 size_t count, loff_t *ppos)
 {
-  const u32 *tmp = (const u32 *)buf;
+  const char __user *tmp = buf;
   u32 data[2];
   size_t rv;
   u32 reg = *ppos;
@@ -231,10 +230,10 @@ static ssize_t msr_write(struct file * file, const char * buf,
     err = do_wrmsr(cpu, reg, data[0], data[1]);
     if ( err )
       return err;
-    tmp += 2;
+    tmp += 8;
   }
 
-  return ((char *)tmp) - buf;
+  return tmp - buf;
 }
 
 static int msr_open(struct inode *inode, struct file *file)
@@ -242,7 +241,7 @@ static int msr_open(struct inode *inode, struct file *file)
   int cpu = iminor(file->f_dentry->d_inode);
   struct cpuinfo_x86 *c = &(cpu_data)[cpu];
   
-  if (!cpu_online(cpu))
+  if (cpu >= NR_CPUS || !cpu_online(cpu))
     return -ENXIO;		/* No such CPU */
   if ( !cpu_has(c, X86_FEATURE_MSR) )
     return -EIO;		/* MSR not supported */
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 8eb20a7dc..fd1c2d791 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -30,7 +30,6 @@
 #include <asm/proto.h>
 #include <asm/cacheflush.h>
 #include <asm/kdebug.h>
-#include <asm/proto.h>
 
 #ifdef CONFIG_PREEMPT
 #define preempt_atomic() in_atomic()
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index e80d5eb1b..f7d3cf3ca 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -521,7 +521,8 @@ struct task_struct *__switch_to(struct task_struct *prev_p, struct task_struct *
  * sys_execve() executes a new program.
  */
 asmlinkage 
-long sys_execve(char *name, char **argv,char **envp, struct pt_regs regs)
+long sys_execve(char __user *name, char __user * __user *argv,
+		char __user * __user *envp, struct pt_regs regs)
 {
 	long error;
 	char * filename;
@@ -550,7 +551,7 @@ asmlinkage long sys_fork(struct pt_regs regs)
 	return do_fork(SIGCHLD, regs.rsp, &regs, 0, NULL, NULL);
 }
 
-asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, void *parent_tid, void *child_tid, struct pt_regs regs)
+asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, void __user *parent_tid, void __user *child_tid, struct pt_regs regs)
 {
 	if (!newsp)
 		newsp = regs.rsp;
@@ -574,12 +575,6 @@ asmlinkage long sys_vfork(struct pt_regs regs)
 		    NULL, NULL);
 }
 
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched	((unsigned long) scheduling_functions_start_here)
-#define last_sched	((unsigned long) scheduling_functions_end_here)
-
 unsigned long get_wchan(struct task_struct *p)
 {
 	unsigned long stack;
@@ -596,14 +591,12 @@ unsigned long get_wchan(struct task_struct *p)
 		if (fp < (unsigned long)stack || fp > (unsigned long)stack+THREAD_SIZE)
 			return 0; 
 		rip = *(u64 *)(fp+8); 
-		if (rip < first_sched || rip >= last_sched)
+		if (!in_sched_functions(rip))
 			return rip; 
 		fp = *(u64 *)fp; 
 	} while (count++ < 16); 
 	return 0;
 }
-#undef last_sched
-#undef first_sched
 
 long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
 { 
@@ -672,7 +665,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
 			rdmsrl(MSR_FS_BASE, base);
 		} else
 			base = task->thread.fs;
-		ret = put_user(base, (unsigned long *)addr); 
+		ret = put_user(base, (unsigned long __user *)addr); 
 		break; 
 	}
 	case ARCH_GET_GS: { 
@@ -683,7 +676,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
 			rdmsrl(MSR_KERNEL_GS_BASE, base);
 		} else
 			base = task->thread.gs;
-		ret = put_user(base, (unsigned long *)addr); 
+		ret = put_user(base, (unsigned long __user *)addr); 
 		break;
 	}
 
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index a97bee6f2..5dd7752ae 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -232,7 +232,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -271,7 +271,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
 			tmp = 0;
 			break;
 		}
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -360,19 +360,20 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
 		   don't use it against 64bit processes, use
 		   PTRACE_ARCH_PRCTL instead. */
 	case PTRACE_SET_THREAD_AREA: {
+		struct user_desc __user *p;
 		int old; 
-		get_user(old,  &((struct user_desc *)data)->entry_number); 
-		put_user(addr, &((struct user_desc *)data)->entry_number);
-		ret = do_set_thread_area(&child->thread, 
-					 (struct user_desc *)data);
-		put_user(old,  &((struct user_desc *)data)->entry_number); 
+		p = (struct user_desc __user *)data;
+		get_user(old,  &p->entry_number); 
+		put_user(addr, &p->entry_number);
+		ret = do_set_thread_area(&child->thread, p);
+		put_user(old,  &p->entry_number); 
 		break;
 	case PTRACE_GET_THREAD_AREA:
-		get_user(old,  &((struct user_desc *)data)->entry_number); 
-		put_user(addr, &((struct user_desc *)data)->entry_number);
-		ret = do_get_thread_area(&child->thread, 
-					 (struct user_desc *)data);
-		put_user(old,  &((struct user_desc *)data)->entry_number); 
+		p = (struct user_desc __user *)data;
+		get_user(old,  &p->entry_number); 
+		put_user(addr, &p->entry_number);
+		ret = do_get_thread_area(&child->thread, p);
+		put_user(old,  &p->entry_number); 
 		break;
 	} 
 #endif
@@ -428,12 +429,12 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
 		break;
 
 	case PTRACE_GETREGS: { /* Get all gp regs from the child. */
-	  	if (!access_ok(VERIFY_WRITE, (unsigned *)data, FRAME_SIZE)) {
+	  	if (!access_ok(VERIFY_WRITE, (unsigned __user *)data, FRAME_SIZE)) {
 			ret = -EIO;
 			break;
 		}
 		for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) {
-			__put_user(getreg(child, ui),(unsigned long *) data);
+			__put_user(getreg(child, ui),(unsigned long __user *) data);
 			data += sizeof(long);
 		}
 		ret = 0;
@@ -442,12 +443,12 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
 
 	case PTRACE_SETREGS: { /* Set all gp regs in the child. */
 		unsigned long tmp;
-	  	if (!access_ok(VERIFY_READ, (unsigned *)data, FRAME_SIZE)) {
+	  	if (!access_ok(VERIFY_READ, (unsigned __user *)data, FRAME_SIZE)) {
 			ret = -EIO;
 			break;
 		}
 		for (ui = 0; ui < sizeof(struct user_regs_struct); ui += sizeof(long)) {
-			__get_user(tmp, (unsigned long *) data);
+			__get_user(tmp, (unsigned long __user *) data);
 			putreg(child, ui, tmp);
 			data += sizeof(long);
 		}
@@ -456,23 +457,23 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
 	}
 
 	case PTRACE_GETFPREGS: { /* Get the child extended FPU state. */
-		if (!access_ok(VERIFY_WRITE, (unsigned *)data,
+		if (!access_ok(VERIFY_WRITE, (unsigned __user *)data,
 			       sizeof(struct user_i387_struct))) {
 			ret = -EIO;
 			break;
 		}
-		ret = get_fpregs((struct user_i387_struct *)data, child);
+		ret = get_fpregs((struct user_i387_struct __user *)data, child);
 		break;
 	}
 
 	case PTRACE_SETFPREGS: { /* Set the child extended FPU state. */
-		if (!access_ok(VERIFY_READ, (unsigned *)data,
+		if (!access_ok(VERIFY_READ, (unsigned __user *)data,
 			       sizeof(struct user_i387_struct))) {
 			ret = -EIO;
 			break;
 		}
 		child->used_math = 1;
-		ret = set_fpregs(child, (struct user_i387_struct *)data);
+		ret = set_fpregs(child, (struct user_i387_struct __user *)data);
 		break;
 	}
 
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c
index c7afa6c7a..3dac33924 100644
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86_64/kernel/reboot.c
@@ -29,9 +29,9 @@ static enum {
 static int reboot_mode = 0;
 
 /* reboot=b[ios] | t[riple] | k[bd] [, [w]arm | [c]old]
-   bios	  Use the CPU reboto vector for warm reset
+   bios	  Use the CPU reboot vector for warm reset
    warm   Don't set the cold reboot flag
-   cold   Set the cold reboto flag
+   cold   Set the cold reboot flag
    triple Force a triple fault (init)
    kbd    Use the keyboard controller. cold reset (default)
  */ 
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 6a21a6094..14a25720f 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -253,6 +253,8 @@ static __init void parse_cmdline_early (char ** cmdline_p)
 		/* acpi=ht just means: do ACPI MADT parsing 
 		   at bootup, but don't enable the full ACPI interpreter */
 		if (!memcmp(from, "acpi=ht", 7)) { 
+			/* if (!acpi_force) */
+				disable_acpi();
 			acpi_ht = 1; 
 		}
                 else if (!memcmp(from, "pci=noacpi", 10)) 
@@ -535,8 +537,7 @@ void __init setup_arch(char **cmdline_p)
         * the bootmem allocator) but before get_smp_config (to allow parsing
         * of MADT).
         */
-	if (!acpi_disabled)
-		acpi_boot_init();
+	acpi_boot_init();
 #endif
 #ifdef CONFIG_X86_LOCAL_APIC
 	/*
@@ -663,7 +664,7 @@ static int __init init_amd(struct cpuinfo_x86 *c)
 	return r;
 }
 
-static void __init detect_ht(void)
+static void __init detect_ht(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_SMP
 	u32 	eax, ebx, ecx, edx;
@@ -671,6 +672,9 @@ static void __init detect_ht(void)
 	int	initial_apic_id;
 	int 	cpu = smp_processor_id();
 	
+	if (!cpu_has(c, X86_FEATURE_HT))
+		return;
+
 	cpuid(1, &eax, &ebx, &ecx, &edx);
 	smp_num_siblings = (ebx & 0xff0000) >> 16;
 	
@@ -768,7 +772,6 @@ static void __init init_intel(struct cpuinfo_x86 *c)
 	unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; 
 	unsigned n;
 
-	select_idle_routine(c);
 	if (c->cpuid_level > 1) {
 		/* supports eax=2  call */
 		int i, j, n;
@@ -837,9 +840,6 @@ static void __init init_intel(struct cpuinfo_x86 *c)
 		c->x86_cache_size = l2 ? l2 : (l1i+l1d);
 	}
 
-	if (cpu_has(c, X86_FEATURE_HT))
-		detect_ht(); 
-
 	n = cpuid_eax(0x80000000);
 	if (n >= 0x80000008) {
 		unsigned eax = cpuid_eax(0x80000008);
@@ -910,7 +910,7 @@ void __init early_identify_cpu(struct cpuinfo_x86 *c)
 			c->x86_model += ((tfms >> 16) & 0xF) << 4;
 		} 
 		if (c->x86_capability[0] & (1<<19)) 
-       		c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
+			c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
 	} else {
 		/* Have CPUID level 0 only - unheard of */
 		c->x86 = 4;
@@ -968,7 +968,10 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
 			display_cacheinfo(c);
 			break;
 	}
-	
+
+	select_idle_routine(c);
+	detect_ht(c); 
+		
 	/*
 	 * On SMP, boot_cpu_data holds the common feature set between
 	 * all CPUs; so make sure that we indicate which features are
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c
index dd0d41548..9d3137a55 100644
--- a/arch/x86_64/kernel/setup64.c
+++ b/arch/x86_64/kernel/setup64.c
@@ -39,7 +39,7 @@ extern unsigned char __per_cpu_start[], __per_cpu_end[];
 extern struct desc_ptr cpu_gdt_descr[];
 struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 
 
-char boot_cpu_stack[IRQSTACKSIZE] __cacheline_aligned;
+char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
 
 unsigned long __supported_pte_mask = ~0UL;
 static int do_not_nx __initdata = 0;
@@ -190,7 +190,8 @@ void pda_init(int cpu)
 	pda->irqstackptr += IRQSTACKSIZE-64;
 } 
 
-char boot_exception_stacks[N_EXCEPTION_STACKS * EXCEPTION_STKSZ];
+char boot_exception_stacks[N_EXCEPTION_STACKS * EXCEPTION_STKSZ] 
+__attribute__((section(".bss.page_aligned")));
 
 void __init syscall_init(void)
 {
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index ecf0e46d7..d814db6e3 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -40,7 +40,7 @@ void ia32_setup_frame(int sig, struct k_sigaction *ka,
             sigset_t *set, struct pt_regs * regs); 
 
 asmlinkage long
-sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs regs)
+sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, struct pt_regs regs)
 {
 	sigset_t saveset, newset;
 
@@ -57,7 +57,7 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs regs)
 	current->blocked = newset;
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("rt_sigsuspend savset(%lx) newset(%lx) regs(%p) rip(%lx)\n",
 		saveset, newset, &regs, regs.rip);
 #endif 
@@ -71,7 +71,7 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs regs)
 }
 
 asmlinkage long
-sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs regs)
+sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, struct pt_regs regs)
 {
 	return do_sigaltstack(uss, uoss, regs.rsp);
 }
@@ -89,7 +89,7 @@ struct rt_sigframe
 };
 
 static int
-restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, unsigned long *prax)
+restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned long *prax)
 {
 	unsigned int err = 0;
 
@@ -117,7 +117,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, unsigned long *p
 	}
 
 	{
-		struct _fpstate * buf;
+		struct _fpstate __user * buf;
 		err |= __get_user(buf, &sc->fpstate);
 
 		if (buf) {
@@ -136,11 +136,11 @@ badframe:
 
 asmlinkage long sys_rt_sigreturn(struct pt_regs regs)
 {
-	struct rt_sigframe *frame = (struct rt_sigframe *)(regs.rsp - 8);
+	struct rt_sigframe __user *frame;
 	sigset_t set;
-	stack_t st;
 	long eax;
 
+	frame = (struct rt_sigframe __user *)(regs.rsp - 8);
 	if (verify_area(VERIFY_READ, frame, sizeof(*frame))) { 
 		goto badframe;
 	} 
@@ -158,16 +158,12 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs regs)
 		goto badframe;
 	} 
 
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("%d sigreturn rip:%lx rsp:%lx frame:%p rax:%lx\n",current->pid,regs.rip,regs.rsp,frame,eax);
 #endif
 
-	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) {
+	if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs.rsp) == -EFAULT)
 		goto badframe;
-	} 
-	/* It is more difficult to avoid calling this function than to
-	   call it and ignore errors.  */
-	do_sigaltstack(&st, NULL, regs.rsp);
 
 	return eax;
 
@@ -181,7 +177,7 @@ badframe:
  */
 
 static inline int
-setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, unsigned long mask, struct task_struct *me)
+setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask, struct task_struct *me)
 {
 	int err = 0;
 
@@ -218,7 +214,7 @@ setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, unsigned long mask
  * Determine which stack to use..
  */
 
-static void *
+static void __user *
 get_stack(struct k_sigaction *ka, struct pt_regs *regs, unsigned long size)
 {
 	unsigned long rsp;
@@ -233,20 +229,20 @@ get_stack(struct k_sigaction *ka, struct pt_regs *regs, unsigned long size)
 			rsp = current->sas_ss_sp + current->sas_ss_size;
 	}
 
-	return (void *)round_down(rsp - size, 16); 
+	return (void __user *)round_down(rsp - size, 16); 
 }
 
 static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 			   sigset_t *set, struct pt_regs * regs)
 {
-	struct rt_sigframe *frame;
-	struct _fpstate *fp = NULL; 
+	struct rt_sigframe __user *frame;
+	struct _fpstate __user *fp = NULL; 
 	int err = 0;
 	struct task_struct *me = current;
 
 	if (me->used_math) {
 		fp = get_stack(ka, regs, sizeof(struct _fpstate)); 
-		frame = (void *)round_down((u64)fp - sizeof(struct rt_sigframe), 16) - 8;
+		frame = (void __user *)round_down((u64)fp - sizeof(struct rt_sigframe), 16) - 8;
 
 		if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) { 
 		goto give_sigsegv;
@@ -299,7 +295,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 		goto give_sigsegv;
 	} 
 
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("%d old rip %lx old rsp %lx old rax %lx\n", current->pid,regs->rip,regs->rsp,regs->rax);
 #endif
 
@@ -324,7 +320,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 	set_fs(USER_DS);
 	regs->eflags &= ~TF_MASK;
 
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
 		current->comm, current->pid, frame, regs->rip, frame->pretcode);
 #endif
@@ -347,7 +343,7 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
 {
 	struct k_sigaction *ka = &current->sighand->action[sig-1];
 
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("handle_signal pid:%d sig:%lu rip:%lx rsp:%lx regs=%p\n", current->pid, sig, 
 		regs->rip, regs->rsp, regs);
 #endif
@@ -459,7 +455,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
 
 void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, __u32 thread_info_flags)
 {
-#if DEBUG_SIG
+#ifdef DEBUG_SIG
 	printk("do_notify_resume flags:%x rip:%lx rsp:%lx caller:%lx pending:%lx\n",
 	       thread_info_flags, regs->rip, regs->rsp, __builtin_return_address(0),signal_pending(current)); 
 #endif
@@ -475,7 +471,7 @@ void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, __u32 thread_info_
 		do_signal(regs,oldset);
 }
 
-void signal_fault(struct pt_regs *regs, void *frame, char *where)
+void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
 { 
 	struct task_struct *me = current; 
 	if (exception_trace)
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index 7ee5cea79..fec777046 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -404,6 +404,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	if (!cpus)
 		return 0;
 
+	/* Can deadlock when called with interrupts disabled */
+	WARN_ON(irqs_disabled());
+
 	data.func = func;
 	data.info = info;
 	atomic_set(&data.started, 0);
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 4d9c47feb..ba2cba68d 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -73,7 +73,7 @@ struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
 /* Set when the idlers are all forked */
 int smp_threads_ready;
 
-char cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned;
 
 /*
  * Trampoline 80x86 program as an array.
@@ -874,31 +874,38 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
 	}
 
 	/*
-	 * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
-	 * that we can tell the sibling CPU efficiently.
+	 * Construct cpu_sibling_map[], so that we can tell the
+	 * sibling CPU efficiently.
 	 */
-	if (cpu_has_ht && smp_num_siblings > 1) {
-		for (cpu = 0; cpu < NR_CPUS; cpu++)
-			cpu_sibling_map[cpu] = NO_PROC_ID;
-		
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			int 	i;
-			if (!cpu_isset(cpu, cpu_callout_map))
-				continue;
+	for (cpu = 0; cpu < NR_CPUS; cpu++)
+		cpus_clear(cpu_sibling_map[cpu]);
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		int siblings = 0;
+		int i;
+		if (!cpu_isset(cpu, cpu_callout_map))
+			continue;
 
+		if (smp_num_siblings > 1) {
 			for (i = 0; i < NR_CPUS; i++) {
-				if (i == cpu || !cpu_isset(i, cpu_callout_map))
+				if (!cpu_isset(i, cpu_callout_map))
 					continue;
 				if (phys_proc_id[cpu] == phys_proc_id[i]) {
-					cpu_sibling_map[cpu] = i;
-					break;
+					siblings++;
+					cpu_set(i, cpu_sibling_map[cpu]);
 				}
 			}
-			if (cpu_sibling_map[cpu] == (char)NO_PROC_ID) {
-				smp_num_siblings = 1;
-				printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
-			}
+		} else { 
+			siblings++;
+			cpu_set(cpu, cpu_sibling_map[cpu]);
 		}
+
+		if (siblings != smp_num_siblings) {
+			printk(KERN_WARNING 
+	       "WARNING: %d siblings found for CPU%d, should be %d\n", 
+			       siblings, cpu, smp_num_siblings);
+			smp_num_siblings = siblings;
+		}       
 	}
 
 	Dprintk("Boot done.\n");
diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c
index e518c1f29..38a286ca3 100644
--- a/arch/x86_64/kernel/sys_x86_64.c
+++ b/arch/x86_64/kernel/sys_x86_64.c
@@ -25,7 +25,7 @@
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-asmlinkage long sys_pipe(int *fildes)
+asmlinkage long sys_pipe(int __user *fildes)
 {
 	int fd[2];
 	int error;
@@ -142,7 +142,7 @@ full_search:
 	}
 }
 
-asmlinkage long sys_uname(struct new_utsname * name)
+asmlinkage long sys_uname(struct new_utsname __user * name)
 {
 	int err;
 	down_read(&uts_sem);
@@ -153,13 +153,13 @@ asmlinkage long sys_uname(struct new_utsname * name)
 	return err ? -EFAULT : 0;
 }
 
-asmlinkage long wrap_sys_shmat(int shmid, char *shmaddr, int shmflg)
+asmlinkage long wrap_sys_shmat(int shmid, char __user *shmaddr, int shmflg)
 {
 	unsigned long raddr;
 	return do_shmat(shmid,shmaddr,shmflg,&raddr) ?: (long)raddr;
 }
 
-asmlinkage long sys_time64(long * tloc)
+asmlinkage long sys_time64(long __user * tloc)
 {
 	struct timeval now; 
 	int i; 
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 39fe36fa8..d47d3f8de 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -27,6 +27,7 @@
 #include <linux/sysdev.h>
 #include <linux/bcd.h>
 #include <linux/kallsyms.h>
+#include <asm/8253pit.h>
 #include <asm/pgtable.h>
 #include <asm/vsyscall.h>
 #include <asm/timex.h>
@@ -54,7 +55,7 @@ static int nohpet __initdata = 0;
 unsigned int cpu_khz;					/* TSC clocks / usec, not used here */
 unsigned long hpet_period;				/* fsecs / HPET clock */
 unsigned long hpet_tick;				/* HPET clocks / interrupt */
-unsigned long vxtime_hz = 1193182;
+unsigned long vxtime_hz = PIT_TICK_RATE;
 int report_lost_ticks;				/* command line option */
 unsigned long long monotonic_base;
 
@@ -531,7 +532,8 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 		cpu_khz_ref = cpu_khz;
 	}
         if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
-            (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
+            (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+	    (val == CPUFREQ_RESUMECHANGE)) {
                 *lpj =
 		cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
 
@@ -600,8 +602,8 @@ static unsigned int __init pit_calibrate_tsc(void)
 	outb((inb(0x61) & ~0x02) | 0x01, 0x61);
 
 	outb(0xb0, 0x43);
-	outb((1193182 / (1000 / 50)) & 0xff, 0x42);
-	outb((1193182 / (1000 / 50)) >> 8, 0x42);
+	outb((PIT_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
+	outb((PIT_TICK_RATE / (1000 / 50)) >> 8, 0x42);
 	rdtscll(start);
 	sync_core();
 	while ((inb(0x61) & 0x20) == 0);
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 2efdbaa1e..d82da80d8 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -256,8 +256,8 @@ void show_registers(struct pt_regs *regs)
 
 	printk("CPU %d ", cpu);
 	__show_regs(regs);
-	printk("Process %s (pid: %d, stackpage=%08lx)\n",
-		cur->comm, cur->pid, 4096+(unsigned long)cur);
+	printk("Process %s (pid: %d, threadinfo %p, task %p)\n",
+		cur->comm, cur->pid, cur->thread_info, cur);
 
 	/*
 	 * When in-kernel, we also print out the stack and code at the
@@ -302,7 +302,7 @@ void handle_BUG(struct pt_regs *regs)
 	if (__get_user(tmp, f.filename))
 		f.filename = "unmapped filename"; 
 	printk("----------- [cut here ] --------- [please bite here ] ---------\n");
-	printk("Kernel BUG at %.50s:%d\n", f.filename, f.line); 	
+	printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
 } 
 
 void out_of_line_bug(void)
@@ -356,7 +356,7 @@ void __die(const char * str, struct pt_regs * regs, long err)
 	notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
 	show_registers(regs);
 	/* Executive summary in case the oops scrolled away */
-	printk("RIP "); 
+	printk(KERN_ALERT "RIP ");
 	printk_address(regs->rip); 
 	printk(" RSP <%016lx>\n", regs->rsp); 
 }
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index c612e4d21..21383547b 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -39,6 +39,7 @@ SECTIONS
 
   __bss_start = .;		/* BSS */
   .bss : {
+	*(.bss.page_aligned)	
 	*(.bss)
 	}
   __bss_end = .;
@@ -75,8 +76,8 @@ SECTIONS
   . = ALIGN(8192);		/* init_task */
   .data.init_task : { *(.data.init_task) }
 
-  . = ALIGN(4096); 
-  .data.boot_pgt : { *(.data.boot_pgt) }
+  . = ALIGN(4096);
+  .data.page_aligned : { *(.data.page_aligned) }
 
   . = ALIGN(4096);		/* Init code and data */
   __init_begin = .;
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index 3a73b20df..2b0d63924 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -151,6 +151,7 @@ EXPORT_SYMBOL_GPL(unset_nmi_callback);
 #undef strcmp 
 #undef strcpy 
 #undef strcat
+#undef memcmp
 
 extern void * memset(void *,int,__kernel_size_t);
 extern size_t strlen(const char *);
@@ -161,6 +162,7 @@ extern void *memchr(const void *s, int c, size_t n);
 extern void * memcpy(void *,const void *,__kernel_size_t);
 extern void * __memcpy(void *,const void *,__kernel_size_t);
 extern char * strcat(char *, const char *);
+extern int memcmp(const void * cs,const void * ct,size_t count);
 
 EXPORT_SYMBOL_NOVERS(memset);
 EXPORT_SYMBOL_NOVERS(strlen);
@@ -178,6 +180,7 @@ EXPORT_SYMBOL_NOVERS(strnlen);
 EXPORT_SYMBOL_NOVERS(memscan);
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(__memcpy);
+EXPORT_SYMBOL_NOVERS(memcmp);
 
 /* syscall export needed for misdesigned sound drivers. */
 EXPORT_SYMBOL(sys_read);
@@ -216,6 +219,3 @@ EXPORT_SYMBOL_GPL(flush_tlb_all);
 #endif
 
 EXPORT_SYMBOL(sys_ioctl);
-
-EXPORT_SYMBOL(memcpy_toio);
-EXPORT_SYMBOL(memcpy_fromio);
diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile
index f09cbc34c..32b206440 100644
--- a/arch/x86_64/lib/Makefile
+++ b/arch/x86_64/lib/Makefile
@@ -4,9 +4,11 @@
 
 CFLAGS_csum-partial.o := -funroll-loops
 
+obj-y := io.o
+
 lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
 	usercopy.o getuser.o putuser.o  \
-	thunk.o io.o clear_page.o copy_page.o bitstr.o
+	thunk.o clear_page.o copy_page.o bitstr.o
 lib-y += memcpy.o memmove.o memset.o copy_user.o
 
 lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/x86_64/lib/csum-wrappers.c b/arch/x86_64/lib/csum-wrappers.c
index b89aca460..a8e4c189f 100644
--- a/arch/x86_64/lib/csum-wrappers.c
+++ b/arch/x86_64/lib/csum-wrappers.c
@@ -19,7 +19,7 @@
  * src and dst are best aligned to 64bits. 
  */ 
 unsigned int 
-csum_partial_copy_from_user(const char *src, char *dst, 
+csum_partial_copy_from_user(const char __user *src, char *dst, 
 			    int len, unsigned int isum, int *errp)
 { 
 	*errp = 0;
@@ -33,7 +33,7 @@ csum_partial_copy_from_user(const char *src, char *dst,
 		if (unlikely((unsigned long)src & 6)) {			
 			while (((unsigned long)src & 6) && len >= 2) { 
 				__u16 val16;			
-				*errp = __get_user(val16, (__u16 *)src); 
+				*errp = __get_user(val16, (__u16 __user *)src); 
 				if (*errp)
 					return isum;
 				*(__u16 *)dst = val16;
@@ -43,7 +43,7 @@ csum_partial_copy_from_user(const char *src, char *dst,
 				len -= 2;
 			}
 		}
-		isum = csum_partial_copy_generic(src,dst,len,isum,errp,NULL);
+		isum = csum_partial_copy_generic((void *)src,dst,len,isum,errp,NULL);
 		if (likely(*errp == 0)) 
 			return isum;
 	} 
@@ -66,7 +66,7 @@ EXPORT_SYMBOL(csum_partial_copy_from_user);
  * src and dst are best aligned to 64bits.
  */ 
 unsigned int 
-csum_partial_copy_to_user(const char *src, char *dst, 
+csum_partial_copy_to_user(const char *src, char __user *dst, 
 			  int len, unsigned int isum, int *errp)
 { 
 	if (unlikely(!access_ok(VERIFY_WRITE, dst, len))) {
@@ -78,7 +78,7 @@ csum_partial_copy_to_user(const char *src, char *dst,
 		while (((unsigned long)dst & 6) && len >= 2) { 
 			__u16 val16 = *(__u16 *)src;
 			isum = add32_with_carry(isum, val16);
-			*errp = __put_user(val16, (__u16 *)dst);
+			*errp = __put_user(val16, (__u16 __user *)dst);
 			if (*errp)
 				return isum;
 			src += 2; 
@@ -88,7 +88,7 @@ csum_partial_copy_to_user(const char *src, char *dst,
 	}
 
 	*errp = 0;
-	return csum_partial_copy_generic(src,dst,len,isum,NULL,errp); 
+	return csum_partial_copy_generic(src, (void *)dst,len,isum,NULL,errp); 
 } 
 
 EXPORT_SYMBOL(csum_partial_copy_to_user);
diff --git a/arch/x86_64/lib/io.c b/arch/x86_64/lib/io.c
index ca08e3141..5950b821d 100644
--- a/arch/x86_64/lib/io.c
+++ b/arch/x86_64/lib/io.c
@@ -2,12 +2,14 @@
 #include <asm/io.h>
 #include <linux/module.h>
 
-void *memcpy_toio(void *dst,const void*src,unsigned len)
+void *__memcpy_toio(unsigned long dst,const void*src,unsigned len)
 {
-	return __inline_memcpy(dst,src,len);
+	return __inline_memcpy((void *) dst,src,len);
 }
+EXPORT_SYMBOL(__memcpy_toio);
 
-void *memcpy_fromio(void *dst,const void*src,unsigned len)
+void *__memcpy_fromio(void *dst,unsigned long src,unsigned len)
 {
-	return __inline_memcpy(dst,src,len);
+	return __inline_memcpy(dst,(const void *) src,len);
 }
+EXPORT_SYMBOL(__memcpy_fromio);
diff --git a/arch/x86_64/lib/usercopy.c b/arch/x86_64/lib/usercopy.c
index 4a8603efa..c83825e5c 100644
--- a/arch/x86_64/lib/usercopy.c
+++ b/arch/x86_64/lib/usercopy.c
@@ -40,7 +40,7 @@ do {									   \
 } while (0)
 
 long
-__strncpy_from_user(char *dst, const char *src, long count)
+__strncpy_from_user(char *dst, const char __user *src, long count)
 {
 	long res;
 	__do_strncpy_from_user(dst, src, count, res);
@@ -48,7 +48,7 @@ __strncpy_from_user(char *dst, const char *src, long count)
 }
 
 long
-strncpy_from_user(char *dst, const char *src, long count)
+strncpy_from_user(char *dst, const char __user *src, long count)
 {
 	long res = -EFAULT;
 	if (access_ok(VERIFY_READ, src, 1))
@@ -60,7 +60,7 @@ strncpy_from_user(char *dst, const char *src, long count)
  * Zero Userspace
  */
 
-unsigned long __clear_user(void *addr, unsigned long size)
+unsigned long __clear_user(void __user *addr, unsigned long size)
 {
 	long __d0;
 	/* no memory constraint because it doesn't change any memory gcc knows
@@ -94,7 +94,7 @@ unsigned long __clear_user(void *addr, unsigned long size)
 }
 
 
-unsigned long clear_user(void *to, unsigned long n)
+unsigned long clear_user(void __user *to, unsigned long n)
 {
 	if (access_ok(VERIFY_WRITE, to, n))
 		return __clear_user(to, n);
@@ -107,7 +107,7 @@ unsigned long clear_user(void *to, unsigned long n)
  * Return 0 on exception, a value greater than N if too long
  */
 
-long strnlen_user(const char *s, long n)
+long strnlen_user(const char __user *s, long n)
 {
 	long res = 0;
 	char c;
@@ -127,7 +127,7 @@ long strnlen_user(const char *s, long n)
 	}
 }
 
-long strlen_user(const char *s)
+long strlen_user(const char __user *s)
 {
 	long res = 0;
 	char c;
@@ -142,10 +142,10 @@ long strlen_user(const char *s)
 	}
 }
 
-unsigned long copy_in_user(void *to, const void *from, unsigned len)
+unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len)
 {
 	if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { 
-		return copy_user_generic(to, from, len);
+		return copy_user_generic((void *)to, (void *)from, len);
 	} 
 	return len;		
 }
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index e5fd0d445..2cdf34b99 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -211,7 +211,8 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
 int unhandled_signal(struct task_struct *tsk, int sig)
 {
 	/* Warn for strace, but not for gdb */
-	if ((tsk->ptrace & (PT_PTRACED|PT_TRACESYSGOOD)) == PT_PTRACED)
+	if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) &&
+	    (tsk->ptrace & PT_PTRACED))
 		return 0;
 	return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
 		(tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
@@ -374,7 +375,7 @@ bad_area_nosemaphore:
 		    (address >> 32))
 			return;
 
-		if (exception_trace && !unhandled_signal(tsk, SIGSEGV)) { 
+		if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
 		printk(KERN_INFO 
 		       "%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
 					tsk->comm, tsk->pid, address, regs->rip,
@@ -423,8 +424,9 @@ no_context:
 		printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
 	else
 		printk(KERN_ALERT "Unable to handle kernel paging request");
-	printk(" at %016lx RIP: \n",address);	
+	printk(" at %016lx RIP: \n" KERN_ALERT,address);
 	printk_address(regs->rip);
+	printk("\n");
 	dump_pagetable(address);
 	__die("Oops", regs, error_code);
 	/* Executive summary in case the body of the oops scrolled away */
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 863ed7ac6..fa8cc3648 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -512,9 +512,7 @@ void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
 	/* Should check here against the e820 map to avoid double free */ 
 #ifdef CONFIG_DISCONTIGMEM
 	int nid = phys_to_nid(phys);
-	if (phys < HIGH_MEMORY && nid) 
-		panic("reserve of %lx at node %d", phys, nid);
-	reserve_bootmem_node(NODE_DATA(nid), phys, len);
+  	reserve_bootmem_node(NODE_DATA(nid), phys, len);
 #else       		
 	reserve_bootmem(phys, len);    
 #endif
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c
index 59bd4ccee..0cc4a612f 100644
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86_64/mm/ioremap.c
@@ -132,13 +132,13 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
 	 * Don't allow anybody to remap normal RAM that we're using..
 	 */
 	if (phys_addr < virt_to_phys(high_memory)) {
+#ifndef CONFIG_DISCONTIGMEM
 		char *t_addr, *t_end;
+ 		struct page *page;
 
 		t_addr = __va(phys_addr);
 		t_end = t_addr + (size - 1);
 	   
-#ifndef CONFIG_DISCONTIGMEM	 
- 		struct page *page;
 		for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
 			if(!PageReserved(page))
 				return NULL;
@@ -158,6 +158,7 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
 	area = get_vm_area(size, VM_IOREMAP);
 	if (!area)
 		return NULL;
+	area->phys_addr = phys_addr;
 	addr = area->addr;
 	if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
 		vunmap(addr);
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index e891e9dc3..36743bf53 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -124,7 +124,7 @@ void __init setup_node_zones(int nodeid)
 	start_pfn = node_start_pfn(nodeid);
 	end_pfn = node_end_pfn(nodeid);
 
-	printk(KERN_INFO "setting up node %d %lx-%lx\n", nodeid, start_pfn, end_pfn); 
+	Dprintk(KERN_INFO "setting up node %d %lx-%lx\n", nodeid, start_pfn, end_pfn);
 	
 	/* All nodes > 0 have a zero length zone DMA */ 
 	dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT; 
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index c91b22c7a..550770815 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -32,7 +32,8 @@ static inline pte_t *lookup_address(unsigned long address)
 	return pte;
 } 
 
-static struct page *split_large_page(unsigned long address, pgprot_t prot)
+static struct page *split_large_page(unsigned long address, pgprot_t prot,
+				     pgprot_t ref_prot)
 { 
 	int i; 
 	unsigned long addr;
@@ -45,7 +46,7 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot)
 	pbase = (pte_t *)page_address(base);
 	for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
 		pbase[i] = pfn_pte(addr >> PAGE_SHIFT, 
-				   addr == address ? prot : PAGE_KERNEL);
+				   addr == address ? prot : ref_prot);
 	}
 	return base;
 } 
@@ -95,7 +96,7 @@ static inline void save_page(unsigned long address, struct page *fpage)
  * No more special protections in this 2/4MB area - revert to a
  * large page again. 
  */
-static void revert_page(struct page *kpte_page, unsigned long address)
+static void revert_page(unsigned long address, pgprot_t ref_prot)
 {
        pgd_t *pgd;
        pmd_t *pmd; 
@@ -104,12 +105,14 @@ static void revert_page(struct page *kpte_page, unsigned long address)
        pgd = pgd_offset_k(address); 
        pmd = pmd_offset(pgd, address);
        BUG_ON(pmd_val(*pmd) & _PAGE_PSE); 
-       large_pte = mk_pte_phys(__pa(address) & LARGE_PAGE_MASK, PAGE_KERNEL_LARGE);
+       pgprot_val(ref_prot) |= _PAGE_PSE;
+       large_pte = mk_pte_phys(__pa(address) & LARGE_PAGE_MASK, ref_prot);
        set_pte((pte_t *)pmd, large_pte);
 }      
 
 static int
-__change_page_attr(unsigned long address, struct page *page, pgprot_t prot)
+__change_page_attr(unsigned long address, struct page *page, pgprot_t prot, 
+		   pgprot_t ref_prot)
 { 
 	pte_t *kpte; 
 	struct page *kpte_page;
@@ -119,29 +122,29 @@ __change_page_attr(unsigned long address, struct page *page, pgprot_t prot)
 	if (!kpte) return 0;
 	kpte_page = virt_to_page(((unsigned long)kpte) & PAGE_MASK);
 	kpte_flags = pte_val(*kpte); 
-	if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { 
+	if (pgprot_val(prot) != pgprot_val(ref_prot)) { 
 		if ((kpte_flags & _PAGE_PSE) == 0) { 
 			pte_t old = *kpte;
-			pte_t standard = mk_pte(page, PAGE_KERNEL); 
+			pte_t standard = mk_pte(page, ref_prot); 
 
 			set_pte(kpte, mk_pte(page, prot)); 
 			if (pte_same(old,standard))
-				atomic_inc(&kpte_page->count);
+				get_page(kpte_page);
 		} else {
-			struct page *split = split_large_page(address, prot); 
+			struct page *split = split_large_page(address, prot, ref_prot); 
 			if (!split)
 				return -ENOMEM;
-			atomic_inc(&kpte_page->count);
-			set_pte(kpte,mk_pte(split, PAGE_KERNEL));
+			get_page(kpte_page);
+			set_pte(kpte,mk_pte(split, ref_prot));
 		}	
 	} else if ((kpte_flags & _PAGE_PSE) == 0) { 
-		set_pte(kpte, mk_pte(page, PAGE_KERNEL));
-		atomic_dec(&kpte_page->count); 
+		set_pte(kpte, mk_pte(page, ref_prot));
+		__put_page(kpte_page);
 	}
 
-	if (atomic_read(&kpte_page->count) == 1) { 
+	if (page_count(kpte_page) == 1) {
 		save_page(address, kpte_page); 		     
-		revert_page(kpte_page, address);
+		revert_page(address, ref_prot);
 	} 
 	return 0;
 } 
@@ -167,13 +170,17 @@ int change_page_attr(struct page *page, int numpages, pgprot_t prot)
 	down_write(&init_mm.mmap_sem);
 	for (i = 0; i < numpages; !err && i++, page++) { 
 		unsigned long address = (unsigned long)page_address(page); 
-		err = __change_page_attr(address, page, prot); 
+		err = __change_page_attr(address, page, prot, PAGE_KERNEL); 
 		if (err) 
 			break; 
-		/* Handle kernel mapping too which aliases part of the lowmem */
-		if (page_to_phys(page) < KERNEL_TEXT_SIZE) {		
-			unsigned long addr2 = __START_KERNEL_map + page_to_phys(page);
-			err = __change_page_attr(addr2, page, prot);
+		/* Handle kernel mapping too which aliases part of the
+		 * lowmem */
+		/* Disabled right now. Fixme */ 
+		if (0 && page_to_phys(page) < KERNEL_TEXT_SIZE) {		
+			unsigned long addr2;
+			addr2 = __START_KERNEL_map + page_to_phys(page);
+			err = __change_page_attr(addr2, page, prot, 
+						 PAGE_KERNEL_EXECUTABLE);
 		} 
 	} 	
 	up_write(&init_mm.mmap_sem); 
diff --git a/crypto/cipher.c b/crypto/cipher.c
index 9abe5b9ea..cdcf3472e 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -68,19 +68,20 @@ static int crypt(struct crypto_tfm *tfm,
 
 	for(;;) {
 		u8 *src_p, *dst_p;
+		int in_place;
 
 		scatterwalk_map(&walk_in, 0);
 		scatterwalk_map(&walk_out, 1);
 		src_p = scatterwalk_whichbuf(&walk_in, bsize, tmp_src);
 		dst_p = scatterwalk_whichbuf(&walk_out, bsize, tmp_dst);
+		in_place = scatterwalk_samebuf(&walk_in, &walk_out,
+					       src_p, dst_p);
 
 		nbytes -= bsize;
 
 		scatterwalk_copychunks(src_p, &walk_in, bsize, 0);
 
-		prfn(tfm, dst_p, src_p, crfn, enc, info,
-		     scatterwalk_samebuf(&walk_in, &walk_out,
-					 src_p, dst_p));
+		prfn(tfm, dst_p, src_p, crfn, enc, info, in_place);
 
 		scatterwalk_done(&walk_in, 0, nbytes);
 
diff --git a/crypto/digest.c b/crypto/digest.c
index 30dabe203..d9b6ac9db 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -27,13 +27,28 @@ static void update(struct crypto_tfm *tfm,
                    struct scatterlist *sg, unsigned int nsg)
 {
 	unsigned int i;
-	
+
 	for (i = 0; i < nsg; i++) {
-		char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset;
-		tfm->__crt_alg->cra_digest.dia_update(crypto_tfm_ctx(tfm),
-		                                      p, sg[i].length);
-		crypto_kunmap(p, 0);
-		crypto_yield(tfm);
+
+		struct page *pg = sg[i].page;
+		unsigned int offset = sg[i].offset;
+		unsigned int l = sg[i].length;
+
+		do {
+			unsigned int bytes_from_page = min(l, ((unsigned int)
+							   (PAGE_SIZE)) - 
+							   offset);
+			char *p = crypto_kmap(pg, 0) + offset;
+
+			tfm->__crt_alg->cra_digest.dia_update
+					(crypto_tfm_ctx(tfm), p,
+					 bytes_from_page);
+			crypto_kunmap(p, 0);
+			crypto_yield(tfm);
+			offset = 0;
+			pg++;
+			l -= bytes_from_page;
+		} while (l > 0);
 	}
 }
 
diff --git a/crypto/scatterwalk.h b/crypto/scatterwalk.h
index 4d56c9217..b16446519 100644
--- a/crypto/scatterwalk.h
+++ b/crypto/scatterwalk.h
@@ -38,6 +38,7 @@ static inline int scatterwalk_samebuf(struct scatter_walk *walk_in,
 				      void *src_p, void *dst_p)
 {
 	return walk_in->page == walk_out->page &&
+	       walk_in->offset == walk_out->offset &&
 	       walk_in->data == src_p && walk_out->data == dst_p;
 }
 
diff --git a/drivers/Makefile b/drivers/Makefile
index c767329e9..5f838a59f 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -49,4 +49,5 @@ obj-$(CONFIG_ISDN)		+= isdn/
 obj-$(CONFIG_MCA)		+= mca/
 obj-$(CONFIG_EISA)		+= eisa/
 obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
+obj-$(CONFIG_CRASH_DUMP)	+= dump/
 obj-y				+= firmware/
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index e617af9e1..7333d5ffc 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -185,6 +185,9 @@ acpi_ac_remove_fs (
 	ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
 
 	if (acpi_device_dir(device)) {
+		remove_proc_entry(ACPI_AC_FILE_STATE,
+				  acpi_device_dir(device));
+
 		remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
 		acpi_device_dir(device) = NULL;
 	}
diff --git a/drivers/acpi/acpi_ksyms.c b/drivers/acpi/acpi_ksyms.c
index 177d179b5..c918088a4 100644
--- a/drivers/acpi/acpi_ksyms.c
+++ b/drivers/acpi/acpi_ksyms.c
@@ -106,7 +106,7 @@ EXPORT_SYMBOL(acpi_os_signal_semaphore);
 EXPORT_SYMBOL(acpi_os_create_semaphore);
 EXPORT_SYMBOL(acpi_os_delete_semaphore);
 EXPORT_SYMBOL(acpi_os_wait_semaphore);
-
+EXPORT_SYMBOL(acpi_os_wait_events_complete);
 EXPORT_SYMBOL(acpi_os_read_pci_configuration);
 
 /* ACPI Utilities (acpi_utils.c) */
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index b9d5bdc89..c884d4aaa 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -40,6 +40,7 @@
 #include <linux/proc_fs.h>
 #include <acpi/acpi_drivers.h>
 #include <acpi/acpi_bus.h>
+#include <asm/uaccess.h>
 
 #define ASUS_ACPI_VERSION "0.28"
 
@@ -480,16 +481,31 @@ read_led(struct asus_hotk *hotk, const char *ledname, int ledmask)
 	return (hotk->status & ledmask) ? 1 : 0;
 }
 
+static int parse_arg(const char __user *buf, unsigned long count, int *val)
+{
+	char s[32];
+	if (!count)
+		return 0;
+	if (count > 31)
+		return -EINVAL;
+	if (copy_from_user(s, buf, count))
+		return -EFAULT;
+	s[count] = 0;
+	if (sscanf(s, "%i", val) != 1)
+		return -EINVAL;
+	return count;
+}
 
 /* FIXME: kill extraneous args so it can be called independently */
 static int
-write_led(const char *buffer, unsigned long count, struct asus_hotk *hotk, 
+write_led(const char __user *buffer, unsigned long count, struct asus_hotk *hotk, 
           char *ledname, int ledmask, int invert)
 {
 	int value;
 	int led_out = 0;
 
-	if (sscanf(buffer, "%i", &value) == 1)
+	count = parse_arg(buffer, count, &value);
+	if (count > 0)
 		led_out = value ? 1 : 0;
 
 	hotk->status =
@@ -518,7 +534,7 @@ proc_read_mled(char *page, char **start, off_t off, int count, int *eof,
 
 
 static int
-proc_write_mled(struct file *file, const char *buffer,
+proc_write_mled(struct file *file, const char __user *buffer,
 		unsigned long count, void *data)
 {
 	struct asus_hotk *hotk = (struct asus_hotk *) data;
@@ -537,7 +553,7 @@ proc_read_wled(char *page, char **start, off_t off, int count, int *eof,
 }
 
 static int
-proc_write_wled(struct file *file, const char *buffer,
+proc_write_wled(struct file *file, const char __user *buffer,
 		unsigned long count, void *data)
 {
 	struct asus_hotk *hotk = (struct asus_hotk *) data;
@@ -556,7 +572,7 @@ proc_read_tled(char *page, char **start, off_t off, int count, int *eof,
 }
 
 static int
-proc_write_tled(struct file *file, const char *buffer,
+proc_write_tled(struct file *file, const char __user *buffer,
 		unsigned long count, void *data)
 {
 	struct asus_hotk *hotk = (struct asus_hotk *) data;
@@ -640,13 +656,14 @@ proc_read_lcd(char *page, char **start, off_t off, int count, int *eof,
 
 
 static int
-proc_write_lcd(struct file *file, const char *buffer,
+proc_write_lcd(struct file *file, const char __user *buffer,
 	       unsigned long count, void *data)
 {
 	int value;
 	struct asus_hotk *hotk = (struct asus_hotk *) data;
 	
-	if (sscanf(buffer, "%i", &value) == 1)
+	count = parse_arg(buffer, count, &value);
+	if (count > 0)
 		set_lcd_state(hotk, value);
 	return count;
 }
@@ -707,17 +724,18 @@ proc_read_brn(char *page, char **start, off_t off, int count, int *eof,
 }
 
 static int
-proc_write_brn(struct file *file, const char *buffer,
+proc_write_brn(struct file *file, const char __user *buffer,
 	       unsigned long count, void *data)
 {
 	int value;
 	struct asus_hotk *hotk = (struct asus_hotk *) data;
 
-	if (sscanf(buffer, "%d", &value) == 1) {
+	count = parse_arg(buffer, count, &value);
+	if (count > 0) {
 		value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
 			/* 0 <= value <= 15 */
 		set_brightness(value, hotk);
-	} else {
+	} else if (count < 0) {
 		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
 	}
 
@@ -756,17 +774,17 @@ proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
  * simultaneously, so be warned. See the acpi4asus README for more info.
  */
 static int
-proc_write_disp(struct file *file, const char *buffer,
+proc_write_disp(struct file *file, const char __user *buffer,
 	       unsigned long count, void *data)
 {
 	int value;
 	struct asus_hotk *hotk = (struct asus_hotk *) data;
 
-	if (sscanf(buffer, "%d", &value) == 1)
+	count = parse_arg(buffer, count, &value);
+	if (count > 0)
 		set_display(value, hotk);
-	else {
+	else if (count < 0)
 		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
-	}
 
 	return count;
 }
@@ -774,7 +792,7 @@ proc_write_disp(struct file *file, const char *buffer,
 
 typedef int (proc_readfunc)(char *page, char **start, off_t off, int count,
 	                     int *eof, void *data);
-typedef int (proc_writefunc)(struct file *file, const char *buffer,
+typedef int (proc_writefunc)(struct file *file, const char __user *buffer,
 	                      unsigned long count, void *data);
 
 static int
@@ -863,6 +881,29 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
 	return 0;
 }
 
+static int asus_hotk_remove_fs(struct acpi_device* device)
+{
+	struct asus_hotk* hotk = acpi_driver_data(device);
+
+
+	if(acpi_device_dir(device)){
+		remove_proc_entry(PROC_INFO,acpi_device_dir(device));
+		if (hotk->methods->mt_wled)
+			remove_proc_entry(PROC_WLED,acpi_device_dir(device));
+		if (hotk->methods->mt_mled)
+			remove_proc_entry(PROC_MLED,acpi_device_dir(device));
+		if (hotk->methods->mt_tled)
+			remove_proc_entry(PROC_TLED,acpi_device_dir(device));
+		if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) 
+			remove_proc_entry(PROC_LCD, acpi_device_dir(device));
+		if ((hotk->methods->brightness_up && hotk->methods->brightness_down) || (hotk->methods->brightness_get && hotk->methods->brightness_get)) 
+			remove_proc_entry(PROC_BRN, acpi_device_dir(device));
+		if (hotk->methods->display_set) 
+			remove_proc_entry(PROC_DISP, acpi_device_dir(device));
+	}
+	return 0;
+}
+
 
 static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
 {
@@ -1111,7 +1152,6 @@ static int __init asus_hotk_add(struct acpi_device *device)
 	return(result);
 }
 
-
 static int asus_hotk_remove(struct acpi_device *device, int type)
 {
 	acpi_status status = 0;
@@ -1127,6 +1167,8 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
 	if (ACPI_FAILURE(status))
 		printk(KERN_ERR "Asus ACPI: Error removing notify handler\n");
 
+	asus_hotk_remove_fs(device);
+
 	kfree(hotk);
 
 	return(0);
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index cfc777424..f6218dd8f 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -582,7 +582,7 @@ end:
 static int
 acpi_battery_write_alarm (
 	struct file		*file,
-	const char		*buffer,
+	const char		__user *buffer,
 	unsigned long		count,
 	void			*data)
 {
@@ -679,6 +679,13 @@ acpi_battery_remove_fs (
 	ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
 
 	if (acpi_device_dir(device)) {
+		remove_proc_entry(ACPI_BATTERY_FILE_ALARM,
+				  acpi_device_dir(device));
+		remove_proc_entry(ACPI_BATTERY_FILE_STATUS,
+				  acpi_device_dir(device));
+		remove_proc_entry(ACPI_BATTERY_FILE_INFO,
+				  acpi_device_dir(device));
+
 		remove_proc_entry(acpi_device_bid(device), acpi_battery_dir);
 		acpi_device_dir(device) = NULL;
 	}
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 7d35c674d..51362331a 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -112,6 +112,14 @@ acpi_bus_get_status (
 	else
 		STRUCT_TO_INT(device->status) = 0x0F;
 
+	if (device->status.functional && !device->status.present) {
+		printk(KERN_WARNING PREFIX "Device [%s] status [%08x]: "
+			"functional but not present; setting present\n",
+			device->pnp.bus_id,
+			(u32) STRUCT_TO_INT(device->status));
+		device->status.present = 1;
+	}
+
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n", 
 		device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status)));
 
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 11fb71e11..a5b45095d 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -108,9 +108,6 @@ static struct file_operations acpi_button_state_fops = {
    -------------------------------------------------------------------------- */
 
 static struct proc_dir_entry	*acpi_button_dir;
-extern struct acpi_device 	*acpi_fixed_pwr_button;
-extern struct acpi_device	*acpi_fixed_sleep_button;
-
 
 static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
 {
@@ -241,6 +238,16 @@ acpi_button_remove_fs (
 
 	button = acpi_driver_data(device);
 	if (acpi_device_dir(device)) {
+		if (button->type == ACPI_BUTTON_TYPE_LID)
+			remove_proc_entry(ACPI_BUTTON_FILE_STATE,
+					     acpi_device_dir(device));
+		remove_proc_entry(ACPI_BUTTON_FILE_INFO,
+				     acpi_device_dir(device));
+
+		remove_proc_entry(acpi_device_bid(device),
+				     acpi_device_dir(device)->parent);
+
+
 		switch (button->type) {
 			case ACPI_BUTTON_TYPE_POWER:
 			case ACPI_BUTTON_TYPE_POWERF:
@@ -530,12 +537,6 @@ acpi_button_exit (void)
 {
 	ACPI_FUNCTION_TRACE("acpi_button_exit");
 
-	if(acpi_fixed_pwr_button) 
-		acpi_button_remove(acpi_fixed_pwr_button, ACPI_BUS_TYPE_POWER_BUTTON);
-
-	if(acpi_fixed_sleep_button)
-		acpi_button_remove(acpi_fixed_sleep_button, ACPI_BUS_TYPE_SLEEP_BUTTON);
-
 	acpi_bus_unregister_driver(&acpi_button_driver);
 
 	remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c
index dd1ca5b2f..585f59db4 100644
--- a/drivers/acpi/debug.c
+++ b/drivers/acpi/debug.c
@@ -55,7 +55,7 @@ end:
 static int
 acpi_system_write_debug (
 	struct file             *file,
-        const char              *buffer,
+        const char              __user *buffer,
 	unsigned long           count,
         void                    *data)
 {
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d1d509f27..56bb801e2 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -548,6 +548,12 @@ acpi_ec_remove_fs (
 {
 	ACPI_FUNCTION_TRACE("acpi_ec_remove_fs");
 
+	if (acpi_device_dir(device)) {
+		remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
+		remove_proc_entry(acpi_device_bid(device), acpi_ec_dir);
+		acpi_device_dir(device) = NULL;
+	}
+
 	return_VALUE(0);
 }
 
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index 43323b4e0..385fc65bf 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -42,7 +42,7 @@ out_busy:
 static ssize_t
 acpi_system_read_event (
 	struct file		*file,
-	char			*buffer,
+	char			__user *buffer,
 	size_t			count,
 	loff_t			*ppos)
 {
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index d2fe466e7..d33b99057 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -406,6 +406,15 @@ acpi_remove_notify_handler (
 			goto unlock_and_exit;
 		}
 
+		/* Make sure all deferred tasks are completed */
+
+		(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+		acpi_os_wait_events_complete(NULL);
+		status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+ 		}
+
 		if (handler_type == ACPI_SYSTEM_NOTIFY) {
 			acpi_gbl_system_notify.node  = NULL;
 			acpi_gbl_system_notify.handler = NULL;
@@ -452,6 +461,15 @@ acpi_remove_notify_handler (
 			goto unlock_and_exit;
 		}
 
+		/* Make sure all deferred tasks are completed */
+
+		(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+		acpi_os_wait_events_complete(NULL);
+		status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
+		if (ACPI_FAILURE (status)) {
+			return_ACPI_STATUS (status);
+ 		}
+
 		/* Remove the handler */
 
 		if (handler_type == ACPI_SYSTEM_NOTIFY) {
@@ -614,6 +632,15 @@ acpi_remove_gpe_handler (
 		goto unlock_and_exit;
 	}
 
+	/* Make sure all deferred tasks are completed */
+
+	(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
+	acpi_os_wait_events_complete(NULL);
+	status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE (status)) {
+		return_ACPI_STATUS (status);
+ 	}
+
 	/* Remove the handler */
 
 	acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 9af986206..fa2a1b414 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -114,7 +114,7 @@ end:
 static int
 acpi_fan_write_state (
 	struct file		*file,
-	const char		*buffer,
+	const char		__user *buffer,
 	unsigned long		count,
 	void			*data)
 {
@@ -185,6 +185,8 @@ acpi_fan_remove_fs (
 	ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
 
 	if (acpi_device_dir(device)) {
+		remove_proc_entry(ACPI_FAN_FILE_STATE,
+				  acpi_device_dir(device));
 		remove_proc_entry(acpi_device_bid(device), acpi_fan_dir);
 		acpi_device_dir(device) = NULL;
 	}
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 77e1c629a..433fdd701 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -66,6 +66,7 @@ extern char line_buf[80];
 static unsigned int acpi_irq_irq;
 static OSD_HANDLER acpi_irq_handler;
 static void *acpi_irq_context;
+static struct workqueue_struct *kacpid_wq;
 
 acpi_status
 acpi_os_initialize(void)
@@ -80,6 +81,8 @@ acpi_os_initialize(void)
 		return AE_NULL_ENTRY;
 	}
 #endif
+	kacpid_wq = create_singlethread_workqueue("kacpid");
+	BUG_ON(!kacpid_wq);
 
 	return AE_OK;
 }
@@ -92,6 +95,8 @@ acpi_os_terminate(void)
 						 acpi_irq_handler);
 	}
 
+	destroy_workqueue(kacpid_wq);
+
 	return AE_OK;
 }
 
@@ -654,8 +659,8 @@ acpi_os_queue_for_execution(
 	task = (void *)(dpc+1);
 	INIT_WORK(task, acpi_os_execute_deferred, (void*)dpc);
 
-	if (!schedule_work(task)) {
-		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_work() failed.\n"));
+	if (!queue_work(kacpid_wq, task)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to queue_work() failed.\n"));
 		kfree(dpc);
 		status = AE_ERROR;
 	}
@@ -663,6 +668,13 @@ acpi_os_queue_for_execution(
 	return_ACPI_STATUS (status);
 }
 
+void
+acpi_os_wait_events_complete(
+	void *context)
+{
+	flush_workqueue(kacpid_wq);
+}
+
 /*
  * Allocate the memory for a spinlock and initialize it.
  */
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index b9ab88fef..8940e11df 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -479,7 +479,7 @@ static int __initdata acpi_irq_penalty[ACPI_MAX_IRQS] = {
 	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ9  PCI, often acpi */
 	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ10 PCI */
 	PIRQ_PENALTY_PCI_AVAILABLE,	/* IRQ11 PCI */
-	PIRQ_PENALTY_ISA_TYPICAL,	/* IRQ12 mouse */
+	PIRQ_PENALTY_ISA_USED,	/* IRQ12 mouse */
 	PIRQ_PENALTY_ISA_USED,	/* IRQ13 fpe, sometimes */
 	PIRQ_PENALTY_ISA_USED,	/* IRQ14 ide0 */
 	PIRQ_PENALTY_ISA_USED,	/* IRQ15 ide1 */
@@ -546,17 +546,23 @@ static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
 		if (link->irq.active == link->irq.possible[i])
 			break;
 	}
+	/*
+	 * forget active IRQ that is not in possible list
+	 */
+	if (i == link->irq.possible_count) {
+		if (acpi_strict)
+			printk(KERN_WARNING PREFIX "_CRS %d not found"
+				" in _PRS\n", link->irq.active);
+		link->irq.active = 0;
+	}
 
 	/*
 	 * if active found, use it; else pick entry from end of possible list.
 	 */
-	if (i != link->irq.possible_count) {
+	if (link->irq.active) {
 		irq = link->irq.active;
 	} else {
 		irq = link->irq.possible[link->irq.possible_count - 1];
-		if (acpi_strict)
-			printk(KERN_WARNING PREFIX "_CRS %d not found"
-				" in _PRS\n", link->irq.active);
 	}
 
 	if (acpi_irq_balance || !link->irq.active) {
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 4dcfcd566..657ddef48 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -482,6 +482,8 @@ acpi_power_remove_fs (
 	ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
 
 	if (acpi_device_dir(device)) {
+		remove_proc_entry(ACPI_POWER_FILE_STATUS,
+				  acpi_device_dir(device));
 		remove_proc_entry(acpi_device_bid(device), acpi_power_dir);
 		acpi_device_dir(device) = NULL;
 	}
diff --git a/drivers/acpi/processor.c b/drivers/acpi/processor.c
index 99c02080f..8d7b78df6 100644
--- a/drivers/acpi/processor.c
+++ b/drivers/acpi/processor.c
@@ -1948,7 +1948,7 @@ static int acpi_processor_throttling_open_fs(struct inode *inode, struct file *f
 static ssize_t
 acpi_processor_write_throttling (
         struct file		*file,
-        const char		*buffer,
+        const char		__user *buffer,
         size_t			count,
         loff_t			*data)
 {
@@ -2009,7 +2009,7 @@ static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
 static ssize_t
 acpi_processor_write_limit (
 	struct file		*file,
-	const char		*buffer,
+	const char		__user *buffer,
 	size_t			count,
 	loff_t			*data)
 {
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e386f28a5..8f3557bd1 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -4,7 +4,6 @@
 
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/module.h>
 
 #include <acpi/acpi_drivers.h>
 #include <acpi/acinterp.h>	/* for acpi_ex_eisa_id_to_string() */
@@ -16,12 +15,6 @@ ACPI_MODULE_NAME		("scan")
 #define STRUCT_TO_INT(s)	(*((int*)&s))
 
 extern struct acpi_device		*acpi_root;
-struct acpi_device 		*acpi_fixed_pwr_button;
-struct acpi_device 		*acpi_fixed_sleep_button;
-
-EXPORT_SYMBOL(acpi_fixed_pwr_button);
-EXPORT_SYMBOL(acpi_fixed_sleep_button);
-
 
 
 #define ACPI_BUS_CLASS			"system_bus"
@@ -318,8 +311,10 @@ static int acpi_driver_detach(struct acpi_driver * drv)
 		struct acpi_device * dev = container_of(node,struct acpi_device,g_list);
 
 		if (dev->driver == drv) {
+			spin_unlock(&acpi_device_lock);
 			if (drv->ops.remove)
 				drv->ops.remove(dev,ACPI_BUS_REMOVAL_NORMAL);
+			spin_lock(&acpi_device_lock);
 			dev->driver = NULL;
 			dev->driver_data = NULL;
 			atomic_dec(&drv->references);
@@ -907,13 +902,10 @@ acpi_bus_scan_fixed (
 	struct acpi_device	*root)
 {
 	int			result = 0;
+	struct acpi_device	*device = NULL;
 
 	ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");
 
-	acpi_fixed_pwr_button = NULL;
-	acpi_fixed_sleep_button = NULL;
-
-
 	if (!root)
 		return_VALUE(-ENODEV);
 
@@ -921,11 +913,11 @@ acpi_bus_scan_fixed (
 	 * Enumerate all fixed-feature devices.
 	 */
 	if (acpi_fadt.pwr_button == 0)
-		result = acpi_bus_add(&acpi_fixed_pwr_button, acpi_root, 
+		result = acpi_bus_add(&device, acpi_root, 
 			NULL, ACPI_BUS_TYPE_POWER_BUTTON);
 
 	if (acpi_fadt.sleep_button == 0)
-		result = acpi_bus_add(&acpi_fixed_sleep_button, acpi_root, 
+		result = acpi_bus_add(&device, acpi_root, 
 			NULL, ACPI_BUS_TYPE_SLEEP_BUTTON);
 
 	return_VALUE(result);
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index bee370aed..892184a9e 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -77,7 +77,7 @@ end:
 	return_VALUE(size);
 }
 
-static ssize_t acpi_system_read_dsdt (struct file*, char*, size_t, loff_t*);
+static ssize_t acpi_system_read_dsdt (struct file*, char __user *, size_t, loff_t*);
 
 static struct file_operations acpi_system_dsdt_ops = {
 	.read =			acpi_system_read_dsdt,
@@ -86,7 +86,7 @@ static struct file_operations acpi_system_dsdt_ops = {
 static ssize_t
 acpi_system_read_dsdt (
 	struct file		*file,
-	char			*buffer,
+	char			__user *buffer,
 	size_t			count,
 	loff_t			*ppos)
 {
@@ -120,7 +120,7 @@ acpi_system_read_dsdt (
 }
 
 
-static ssize_t acpi_system_read_fadt (struct file*, char*, size_t, loff_t*);
+static ssize_t acpi_system_read_fadt (struct file*, char __user *, size_t, loff_t*);
 
 static struct file_operations acpi_system_fadt_ops = {
 	.read =			acpi_system_read_fadt,
@@ -129,7 +129,7 @@ static struct file_operations acpi_system_fadt_ops = {
 static ssize_t
 acpi_system_read_fadt (
 	struct file		*file,
-	char			*buffer,
+	char			__user *buffer,
 	size_t			count,
 	loff_t			*ppos)
 {
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 621640e80..d87764ebd 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -343,10 +343,11 @@ acpi_table_parse_madt_family (
 	entry = (acpi_table_entry_header *)
 		((unsigned long) madt + madt_size);
 
-	while (((unsigned long) entry) < madt_end) {
+	while (((unsigned long) entry) + sizeof(acpi_table_entry_header) < madt_end) {
 		if (entry->type == entry_id &&
 		    (!max_entries || count++ < max_entries))
-			handler(entry);
+			if (handler(entry, madt_end))
+				return -EINVAL;
 
 		entry = (acpi_table_entry_header *)
 			((unsigned long) entry + entry->length);
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index a103ee7fa..00c80593a 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -84,11 +84,11 @@ static int acpi_thermal_remove (struct acpi_device *device, int type);
 static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file);
 static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file);
 static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file);
-static ssize_t acpi_thermal_write_trip_points (struct file*,const char *,size_t,loff_t *);
+static ssize_t acpi_thermal_write_trip_points (struct file*,const char __user *,size_t,loff_t *);
 static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file);
-static ssize_t acpi_thermal_write_cooling_mode (struct file*,const char *,size_t,loff_t *);
+static ssize_t acpi_thermal_write_cooling_mode (struct file*,const char __user *,size_t,loff_t *);
 static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file);
-static ssize_t acpi_thermal_write_polling(struct file*,const char *,size_t,loff_t *);
+static ssize_t acpi_thermal_write_polling(struct file*,const char __user *,size_t,loff_t *);
 
 static struct acpi_driver acpi_thermal_driver = {
 	.name =		ACPI_THERMAL_DRIVER_NAME,
@@ -885,7 +885,7 @@ static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file)
 static ssize_t
 acpi_thermal_write_trip_points (
         struct file		*file,
-        const char		*buffer,
+        const char		__user *buffer,
         size_t			count,
         loff_t			*ppos)
 {
@@ -954,7 +954,7 @@ static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file)
 static ssize_t
 acpi_thermal_write_cooling_mode (
 	struct file		*file,
-	const char		*buffer,
+	const char		__user *buffer,
 	size_t			count,
 	loff_t			*ppos)
 {
@@ -1015,7 +1015,7 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file)
 static ssize_t
 acpi_thermal_write_polling (
 	struct file		*file,
-	const char		*buffer,
+	const char		__user *buffer,
 	size_t			count,
 	loff_t			*ppos)
 {
@@ -1139,6 +1139,16 @@ acpi_thermal_remove_fs (
 	ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
 
 	if (acpi_device_dir(device)) {
+		remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ,
+				  acpi_device_dir(device));
+		remove_proc_entry(ACPI_THERMAL_FILE_COOLING_MODE,
+				  acpi_device_dir(device));
+		remove_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS,
+				  acpi_device_dir(device));
+		remove_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
+				  acpi_device_dir(device));
+		remove_proc_entry(ACPI_THERMAL_FILE_STATE,
+				  acpi_device_dir(device));
 		remove_proc_entry(acpi_device_bid(device), acpi_thermal_dir);
 		acpi_device_dir(device) = NULL;
 	}
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 80a320361..508bcb495 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -252,7 +252,7 @@ dispatch_read(char* page, char** start, off_t off, int count, int* eof,
 }
 
 static int
-dispatch_write(struct file* file, __user const char* buffer,
+dispatch_write(struct file* file, const char __user * buffer,
 	unsigned long count, ProcItem* item)
 {
 	int result;
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index b293bb7f9..c26a12e56 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -1706,105 +1706,108 @@ static void destroy_queues (amb_dev * dev) {
 }
 
 /********** basic loader commands and error handling **********/
+// centisecond timeouts - guessing away here
+static unsigned int command_timeouts [] = {
+	[host_memory_test]     = 15,
+	[read_adapter_memory]  = 2,
+	[write_adapter_memory] = 2,
+	[adapter_start]        = 50,
+	[get_version_number]   = 10,
+	[interrupt_host]       = 1,
+	[flash_erase_sector]   = 1,
+	[adap_download_block]  = 1,
+	[adap_erase_flash]     = 1,
+	[adap_run_in_iram]     = 1,
+	[adap_end_download]    = 1
+};
+
+
+unsigned int command_successes [] = {
+	[host_memory_test]     = COMMAND_PASSED_TEST,
+	[read_adapter_memory]  = COMMAND_READ_DATA_OK,
+	[write_adapter_memory] = COMMAND_WRITE_DATA_OK,
+	[adapter_start]        = COMMAND_COMPLETE,
+	[get_version_number]   = COMMAND_COMPLETE,
+	[interrupt_host]       = COMMAND_COMPLETE,
+	[flash_erase_sector]   = COMMAND_COMPLETE,
+	[adap_download_block]  = COMMAND_COMPLETE,
+	[adap_erase_flash]     = COMMAND_COMPLETE,
+	[adap_run_in_iram]     = COMMAND_COMPLETE,
+	[adap_end_download]    = COMMAND_COMPLETE
+};
+  
+static  int decode_loader_result (loader_command cmd, u32 result)
+{
+	int res;
+	const char *msg;
+
+	if (result == command_successes[cmd])
+		return 0;
+
+	switch (result) {
+		case BAD_COMMAND:
+			res = -EINVAL;
+			msg = "bad command";
+			break;
+		case COMMAND_IN_PROGRESS:
+			res = -ETIMEDOUT;
+			msg = "command in progress";
+			break;
+		case COMMAND_PASSED_TEST:
+			res = 0;
+			msg = "command passed test";
+			break;
+		case COMMAND_FAILED_TEST:
+			res = -EIO;
+			msg = "command failed test";
+			break;
+		case COMMAND_READ_DATA_OK:
+			res = 0;
+			msg = "command read data ok";
+			break;
+		case COMMAND_READ_BAD_ADDRESS:
+			res = -EINVAL;
+			msg = "command read bad address";
+			break;
+		case COMMAND_WRITE_DATA_OK:
+			res = 0;
+			msg = "command write data ok";
+			break;
+		case COMMAND_WRITE_BAD_ADDRESS:
+			res = -EINVAL;
+			msg = "command write bad address";
+			break;
+		case COMMAND_WRITE_FLASH_FAILURE:
+			res = -EIO;
+			msg = "command write flash failure";
+			break;
+		case COMMAND_COMPLETE:
+			res = 0;
+			msg = "command complete";
+			break;
+		case COMMAND_FLASH_ERASE_FAILURE:
+			res = -EIO;
+			msg = "command flash erase failure";
+			break;
+		case COMMAND_WRITE_BAD_DATA:
+			res = -EINVAL;
+			msg = "command write bad data";
+			break;
+		default:
+			res = -EINVAL;
+			msg = "unknown error";
+			PRINTD (DBG_LOAD|DBG_ERR,
+				"decode_loader_result got %d=%x !",
+				result, result);
+			break;
+	}
+
+	PRINTK (KERN_ERR, "%s", msg);
+	return res;
+}
 
 static int __init do_loader_command (volatile loader_block * lb,
 				     const amb_dev * dev, loader_command cmd) {
-  // centisecond timeouts - guessing away here
-  unsigned int command_timeouts [] = {
-    [host_memory_test]     = 15,
-    [read_adapter_memory]  = 2,
-    [write_adapter_memory] = 2,
-    [adapter_start]        = 50,
-    [get_version_number]   = 10,
-    [interrupt_host]       = 1,
-    [flash_erase_sector]   = 1,
-    [adap_download_block]  = 1,
-    [adap_erase_flash]     = 1,
-    [adap_run_in_iram]     = 1,
-    [adap_end_download]    = 1
-  };
-  
-  unsigned int command_successes [] = {
-    [host_memory_test]     = COMMAND_PASSED_TEST,
-    [read_adapter_memory]  = COMMAND_READ_DATA_OK,
-    [write_adapter_memory] = COMMAND_WRITE_DATA_OK,
-    [adapter_start]        = COMMAND_COMPLETE,
-    [get_version_number]   = COMMAND_COMPLETE,
-    [interrupt_host]       = COMMAND_COMPLETE,
-    [flash_erase_sector]   = COMMAND_COMPLETE,
-    [adap_download_block]  = COMMAND_COMPLETE,
-    [adap_erase_flash]     = COMMAND_COMPLETE,
-    [adap_run_in_iram]     = COMMAND_COMPLETE,
-    [adap_end_download]    = COMMAND_COMPLETE
-  };
-  
-  int decode_loader_result (loader_command cmd, u32 result) {
-    int res;
-    const char * msg;
-    
-    if (result == command_successes[cmd])
-      return 0;
-    
-    switch (result) {
-      case BAD_COMMAND:
-	res = -EINVAL;
-	msg = "bad command";
-	break;
-      case COMMAND_IN_PROGRESS:
-	res = -ETIMEDOUT;
-	msg = "command in progress";
-	break;
-      case COMMAND_PASSED_TEST:
-	res = 0;
-	msg = "command passed test";
-	break;
-      case COMMAND_FAILED_TEST:
-	res = -EIO;
-	msg = "command failed test";
-	break;
-      case COMMAND_READ_DATA_OK:
-	res = 0;
-	msg = "command read data ok";
-	break;
-      case COMMAND_READ_BAD_ADDRESS:
-	res = -EINVAL;
-	msg = "command read bad address";
-	break;
-      case COMMAND_WRITE_DATA_OK:
-	res = 0;
-	msg = "command write data ok";
-	break;
-      case COMMAND_WRITE_BAD_ADDRESS:
-	res = -EINVAL;
-	msg = "command write bad address";
-	break;
-      case COMMAND_WRITE_FLASH_FAILURE:
-	res = -EIO;
-	msg = "command write flash failure";
-	break;
-      case COMMAND_COMPLETE:
-	res = 0;
-	msg = "command complete";
-	break;
-      case COMMAND_FLASH_ERASE_FAILURE:
-	res = -EIO;
-	msg = "command flash erase failure";
-	break;
-      case COMMAND_WRITE_BAD_DATA:
-	res = -EINVAL;
-	msg = "command write bad data";
-	break;
-      default:
-	res = -EINVAL;
-	msg = "unknown error";
-	PRINTD (DBG_LOAD|DBG_ERR, "decode_loader_result got %d=%x !",
-		result, result);
-	break;
-    }
-    
-    PRINTK (KERN_ERR, "%s", msg);
-    return res;
-  }
   
   unsigned long timeout;
   
@@ -1930,6 +1933,11 @@ static int __init loader_start (loader_block * lb,
 
 /********** reset card **********/
 
+static inline void sf (const char * msg)
+{
+	PRINTK (KERN_ERR, "self-test failed: %s", msg);
+}
+
 static int amb_reset (amb_dev * dev, int diags) {
   u32 word;
   
@@ -1974,9 +1982,6 @@ static int amb_reset (amb_dev * dev, int diags) {
     // XXX double check byte-order
     word = rd_mem (dev, offsetof(amb_mem, mb.loader.result));
     if (word & SELF_TEST_FAILURE) {
-      void sf (const char * msg) {
-	PRINTK (KERN_ERR, "self-test failed: %s", msg);
-      }
       if (word & GPINT_TST_FAILURE)
 	sf ("interrupt");
       if (word & SUNI_DATA_PATTERN_FAILURE)
@@ -2044,31 +2049,31 @@ static int __init ucode_init (loader_block * lb, amb_dev * dev) {
 }
 
 /********** give adapter parameters **********/
+  
+static inline u32 bus_addr(void * addr) {
+    return cpu_to_be32 (virt_to_bus (addr));
+}
 
 static int __init amb_talk (amb_dev * dev) {
   adap_talk_block a;
   unsigned char pool;
   unsigned long timeout;
   
-  u32 x (void * addr) {
-    return cpu_to_be32 (virt_to_bus (addr));
-  }
-  
   PRINTD (DBG_FLOW, "amb_talk %p", dev);
   
-  a.command_start = x (dev->cq.ptrs.start);
-  a.command_end   = x (dev->cq.ptrs.limit);
-  a.tx_start      = x (dev->txq.in.start);
-  a.tx_end        = x (dev->txq.in.limit);
-  a.txcom_start   = x (dev->txq.out.start);
-  a.txcom_end     = x (dev->txq.out.limit);
+  a.command_start = bus_addr (dev->cq.ptrs.start);
+  a.command_end   = bus_addr (dev->cq.ptrs.limit);
+  a.tx_start      = bus_addr (dev->txq.in.start);
+  a.tx_end        = bus_addr (dev->txq.in.limit);
+  a.txcom_start   = bus_addr (dev->txq.out.start);
+  a.txcom_end     = bus_addr (dev->txq.out.limit);
   
   for (pool = 0; pool < NUM_RX_POOLS; ++pool) {
     // the other "a" items are set up by the adapter
-    a.rec_struct[pool].buffer_start = x (dev->rxq[pool].in.start);
-    a.rec_struct[pool].buffer_end   = x (dev->rxq[pool].in.limit);
-    a.rec_struct[pool].rx_start     = x (dev->rxq[pool].out.start);
-    a.rec_struct[pool].rx_end       = x (dev->rxq[pool].out.limit);
+    a.rec_struct[pool].buffer_start = bus_addr (dev->rxq[pool].in.start);
+    a.rec_struct[pool].buffer_end   = bus_addr (dev->rxq[pool].in.limit);
+    a.rec_struct[pool].rx_start     = bus_addr (dev->rxq[pool].out.start);
+    a.rec_struct[pool].rx_end       = bus_addr (dev->rxq[pool].out.limit);
     a.rec_struct[pool].buffer_size = cpu_to_be32 (dev->rxq[pool].buffer_size);
   }
   
@@ -2111,15 +2116,10 @@ static void __init amb_ucode_version (amb_dev * dev) {
   minor = be32_to_cpu (cmd.args.version.minor);
   PRINTK (KERN_INFO, "microcode version is %u.%u", major, minor);
 }
-
-// get end station address
-static void __init amb_esi (amb_dev * dev, u8 * esi) {
-  u32 lower4;
-  u16 upper2;
-  command cmd;
   
-  // swap bits within byte to get Ethernet ordering
-  u8 bit_swap (u8 byte) {
+// swap bits within byte to get Ethernet ordering
+u8 bit_swap (u8 byte)
+{
     const u8 swap[] = {
       0x0, 0x8, 0x4, 0xc,
       0x2, 0xa, 0x6, 0xe,
@@ -2127,7 +2127,13 @@ static void __init amb_esi (amb_dev * dev, u8 * esi) {
       0x3, 0xb, 0x7, 0xf
     };
     return ((swap[byte & 0xf]<<4) | swap[byte>>4]);
-  }
+}
+
+// get end station address
+static void __init amb_esi (amb_dev * dev, u8 * esi) {
+  u32 lower4;
+  u16 upper2;
+  command cmd;
   
   cmd.request = cpu_to_be32 (SRB_GET_BIA);
   while (command_do (dev, &cmd)) {
@@ -2155,29 +2161,31 @@ static void __init amb_esi (amb_dev * dev, u8 * esi) {
   
   return;
 }
+  
+static void fixup_plx_window (amb_dev *dev, loader_block *lb)
+{
+	// fix up the PLX-mapped window base address to match the block
+	unsigned long blb;
+	u32 mapreg;
+	blb = virt_to_bus(lb);
+	// the kernel stack had better not ever cross a 1Gb boundary!
+	mapreg = rd_plain (dev, offsetof(amb_mem, stuff[10]));
+	mapreg &= ~onegigmask;
+	mapreg |= blb & onegigmask;
+	wr_plain (dev, offsetof(amb_mem, stuff[10]), mapreg);
+	return;
+}
 
-static int __init amb_init (amb_dev * dev) {
+static int __init amb_init (amb_dev * dev)
+{
   loader_block lb;
   
-  void fixup_plx_window (void) {
-    // fix up the PLX-mapped window base address to match the block
-    unsigned long blb;
-    u32 mapreg;
-    blb = virt_to_bus (&lb);
-    // the kernel stack had better not ever cross a 1Gb boundary!
-    mapreg = rd_plain (dev, offsetof(amb_mem, stuff[10]));
-    mapreg &= ~onegigmask;
-    mapreg |= blb & onegigmask;
-    wr_plain (dev, offsetof(amb_mem, stuff[10]), mapreg);
-    return;
-  }
-  
   u32 version;
   
   if (amb_reset (dev, 1)) {
     PRINTK (KERN_ERR, "card reset failed!");
   } else {
-    fixup_plx_window ();
+    fixup_plx_window (dev, &lb);
     
     if (get_loader_version (&lb, dev, &version)) {
       PRINTK (KERN_INFO, "failed to get loader version");
@@ -2207,31 +2215,20 @@ static int __init amb_init (amb_dev * dev) {
     
   } /* amb_reset */
   
-  return -1;
+  return -EINVAL;
 }
 
-static int __init amb_probe (void) {
-  struct pci_dev * pci_dev;
-  int devs;
-  
-  void __init do_pci_device (void) {
-    amb_dev * dev;
-    
-    // read resources from PCI configuration space
-    u8 irq = pci_dev->irq;
-    u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 0));
-    u32 iobase = pci_resource_start (pci_dev, 1);
-    
-    void setup_dev (void) {
+static void setup_dev(amb_dev *dev, struct pci_dev *pci_dev) 
+{
       unsigned char pool;
       memset (dev, 0, sizeof(amb_dev));
       
       // set up known dev items straight away
       dev->pci_dev = pci_dev; 
       
-      dev->iobase = iobase;
-      dev->irq = irq; 
-      dev->membase = membase;
+      dev->iobase = pci_resource_start (pci_dev, 1);
+      dev->irq = pci_dev->irq; 
+      dev->membase = bus_to_virt(pci_resource_start(pci_dev, 0));
       
       // flags (currently only dead)
       dev->flags = 0;
@@ -2258,101 +2255,125 @@ static int __init amb_probe (void) {
       spin_lock_init (&dev->txq.lock);
       for (pool = 0; pool < NUM_RX_POOLS; ++pool)
 	spin_lock_init (&dev->rxq[pool].lock);
-    }
-    
-    void setup_pci_dev (void) {
-      unsigned char lat;
-      
-      /* XXX check return value */
-      pci_enable_device (pci_dev);
+}
 
-      // enable bus master accesses
-      pci_set_master (pci_dev);
-      
-      // frobnicate latency (upwards, usually)
-      pci_read_config_byte (pci_dev, PCI_LATENCY_TIMER, &lat);
-      if (pci_lat) {
-	PRINTD (DBG_INIT, "%s PCI latency timer from %hu to %hu",
-		"changing", lat, pci_lat);
-	pci_write_config_byte (pci_dev, PCI_LATENCY_TIMER, pci_lat);
-      } else if (lat < MIN_PCI_LATENCY) {
-	PRINTK (KERN_INFO, "%s PCI latency timer from %hu to %hu",
-		"increasing", lat, MIN_PCI_LATENCY);
-	pci_write_config_byte (pci_dev, PCI_LATENCY_TIMER, MIN_PCI_LATENCY);
-      }
-    }
-    
-    PRINTD (DBG_INFO, "found Madge ATM adapter (amb) at"
-	    " IO %x, IRQ %u, MEM %p", iobase, irq, membase);
-    
-    // check IO region
-    if (!request_region (iobase, AMB_EXTENT, DEV_LABEL)) {
-      PRINTK (KERN_ERR, "IO range already in use!");
-      return;
-    }
-    
-    dev = kmalloc (sizeof(amb_dev), GFP_KERNEL);
-    if (!dev) {
-      // perhaps we should be nice: deregister all adapters and abort?
-      PRINTK (KERN_ERR, "out of memory!");
-      release_region (iobase, AMB_EXTENT);
-      return;
-    }
-    
-    setup_dev();
-    
-    if (amb_init (dev)) {
-      PRINTK (KERN_ERR, "adapter initialisation failure");
-    } else {
+static int setup_pci_dev(struct pci_dev *pci_dev)
+{
+	unsigned char lat;
+	int ret;
       
-      setup_pci_dev();
+	// enable bus master accesses
+	pci_set_master(pci_dev);
       
-      // grab (but share) IRQ and install handler
-      if (request_irq (irq, interrupt_handler, SA_SHIRQ, DEV_LABEL, dev)) {
-	PRINTK (KERN_ERR, "request IRQ failed!");
-	// free_irq is at "endif"
-      } else {
-	
+	ret = pci_enable_device(pci_dev);
+	if (ret < 0)
+		goto out;
+
+	// frobnicate latency (upwards, usually)
+	pci_read_config_byte (pci_dev, PCI_LATENCY_TIMER, &lat);
+
+	if (!pci_lat)
+		pci_lat = (lat < MIN_PCI_LATENCY) ? MIN_PCI_LATENCY : lat;
+
+	if (lat != pci_lat) {
+		PRINTK (KERN_INFO, "Changing PCI latency timer from %hu to %hu",
+			lat, pci_lat);
+		pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, pci_lat);
+	}
+out:
+	return ret;
+}
+
+static int __init do_pci_device(struct pci_dev *pci_dev)
+{
+	amb_dev * dev;
+	int err;
+
+	// read resources from PCI configuration space
+	u8 irq = pci_dev->irq;
+	u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 0));
+	u32 iobase = pci_resource_start (pci_dev, 1);
+
+	PRINTD (DBG_INFO, "found Madge ATM adapter (amb) at"
+		" IO %x, IRQ %u, MEM %p", iobase, irq, membase);
+
+	// check IO region
+	err = pci_request_region(pci_dev, 1, DEV_LABEL);
+	if (err < 0) {
+		PRINTK (KERN_ERR, "IO range already in use!");
+		goto out;
+	}
+
+	dev = kmalloc (sizeof(amb_dev), GFP_KERNEL);
+	if (!dev) {
+		PRINTK (KERN_ERR, "out of memory!");
+		err = -ENOMEM;
+		goto out_release;
+	}
+
+	setup_dev(dev, pci_dev);
+
+	err = amb_init(dev);
+	if (err < 0) {
+		PRINTK (KERN_ERR, "adapter initialisation failure");
+		goto out_free;
+	}
+
+	err = setup_pci_dev(pci_dev);
+	if (err < 0)
+		goto out_reset;
+
+	// grab (but share) IRQ and install handler
+	err = request_irq(irq, interrupt_handler, SA_SHIRQ, DEV_LABEL, dev);
+	if (err < 0) {
+		PRINTK (KERN_ERR, "request IRQ failed!");
+		goto out_disable;
+	}
+
 	dev->atm_dev = atm_dev_register (DEV_LABEL, &amb_ops, -1, NULL);
 	if (!dev->atm_dev) {
-	  PRINTD (DBG_ERR, "failed to register Madge ATM adapter");
-	} else {
-	  
-	  PRINTD (DBG_INFO, "registered Madge ATM adapter (no. %d) (%p) at %p",
-		  dev->atm_dev->number, dev, dev->atm_dev);
-	  dev->atm_dev->dev_data = (void *) dev;
-	  
-	  // register our address
-	  amb_esi (dev, dev->atm_dev->esi);
-	  
-	  // 0 bits for vpi, 10 bits for vci
-	  dev->atm_dev->ci_range.vpi_bits = NUM_VPI_BITS;
-	  dev->atm_dev->ci_range.vci_bits = NUM_VCI_BITS;
-	  
-	  // update count and linked list
-	  ++devs;
-	  dev->prev = amb_devs;
-	  amb_devs = dev;
-	  
-	  // enable host interrupts
-	  interrupts_on (dev);
-	  
-	  // success
-	  return;
-	  
-	  // not currently reached
-	  atm_dev_deregister (dev->atm_dev);
-	} /* atm_dev_register */
-	
-	free_irq (irq, dev);
-      } /* request_irq */
-      
-      amb_reset (dev, 0);
-    } /* amb_init */
-    
-    kfree (dev);
-    release_region (iobase, AMB_EXTENT);
-  } /* kmalloc, end-of-fn */
+		PRINTD (DBG_ERR, "failed to register Madge ATM adapter");
+		err = -EINVAL;
+		goto out_free_irq;
+	}
+
+	PRINTD (DBG_INFO, "registered Madge ATM adapter (no. %d) (%p) at %p",
+		dev->atm_dev->number, dev, dev->atm_dev);
+		dev->atm_dev->dev_data = (void *) dev;
+
+	// register our address
+	amb_esi (dev, dev->atm_dev->esi);
+
+	// 0 bits for vpi, 10 bits for vci
+	dev->atm_dev->ci_range.vpi_bits = NUM_VPI_BITS;
+	dev->atm_dev->ci_range.vci_bits = NUM_VCI_BITS;
+
+	// update linked list
+	dev->prev = amb_devs;
+	amb_devs = dev;
+
+	// enable host interrupts
+	interrupts_on (dev);
+
+out:
+	return err;
+
+out_free_irq:
+	free_irq(irq, dev);
+out_disable:
+	pci_disable_device(pci_dev);
+out_reset:
+	amb_reset(dev, 0);
+out_free:
+	kfree(dev);
+out_release:
+	pci_release_region(pci_dev, 1);
+	goto out;
+}
+
+static int __init amb_probe (void) {
+  struct pci_dev * pci_dev;
+  int devs;
   
   PRINTD (DBG_FLOW, "amb_probe");
   
@@ -2360,8 +2381,11 @@ static int __init amb_probe (void) {
   pci_dev = NULL;
   while ((pci_dev = pci_find_device
           (PCI_VENDOR_ID_MADGE, PCI_DEVICE_ID_MADGE_AMBASSADOR, pci_dev)
-          ))
-    do_pci_device();
+          )) {
+	if (do_pci_device(pci_dev) == 0)
+		devs++;
+  }
+
   
   pci_dev = NULL;
   while ((pci_dev = pci_find_device
@@ -2474,7 +2498,10 @@ static void __exit amb_module_exit (void) {
   del_timer_sync(&housekeeping);
   
   while (amb_devs) {
+    struct pci_dev *pdev;
+
     dev = amb_devs;
+    pdev = dev->pci_dev;
     amb_devs = dev->prev;
     
     PRINTD (DBG_INFO|DBG_INIT, "closing %p (atm_dev = %p)", dev, dev->atm_dev);
@@ -2482,11 +2509,12 @@ static void __exit amb_module_exit (void) {
     drain_rx_pools (dev);
     interrupts_off (dev);
     amb_reset (dev, 0);
+    free_irq (dev->irq, dev);
+    pci_disable_device (pdev);
     destroy_queues (dev);
     atm_dev_deregister (dev->atm_dev);
-    free_irq (dev->irq, dev);
-    release_region (dev->iobase, AMB_EXTENT);
     kfree (dev);
+    pci_release_region (pdev, 1);
   }
   
   return;
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
index aa1cbe395..0572f724b 100644
--- a/drivers/atm/atmtcp.c
+++ b/drivers/atm/atmtcp.c
@@ -152,7 +152,7 @@ static void atmtcp_v_close(struct atm_vcc *vcc)
 }
 
 
-static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
 	struct atm_cirange ci;
 	struct atm_vcc *vcc;
@@ -161,7 +161,7 @@ static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 	int i;
 
 	if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD;
-	if (copy_from_user(&ci,(void *) arg,sizeof(ci))) return -EFAULT;
+	if (copy_from_user(&ci, arg,sizeof(ci))) return -EFAULT;
 	if (ci.vpi_bits == ATM_CI_MAX) ci.vpi_bits = MAX_VPI_BITS;
 	if (ci.vci_bits == ATM_CI_MAX) ci.vci_bits = MAX_VCI_BITS;
 	if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 ||
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index b76058900..8b137034d 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1968,7 +1968,7 @@ static int eni_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flgs)
 }
 
 
-static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
 	struct eni_dev *eni_dev = ENI_DEV(dev);
 
@@ -1983,7 +1983,7 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 		struct eni_multipliers mult;
 
 		if (!capable(CAP_NET_ADMIN)) return -EPERM;
-		if (copy_from_user(&mult,(void *) arg,
+		if (copy_from_user(&mult, arg,
 		    sizeof(struct eni_multipliers)))
 			return -EFAULT;
 		if ((mult.tx && mult.tx <= 100) || (mult.rx &&mult.rx <= 100) ||
@@ -1996,7 +1996,7 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 	if (cmd == ATM_SETCIRANGE) {
 		struct atm_cirange ci;
 
-		if (copy_from_user(&ci,(void *) arg,sizeof(struct atm_cirange)))
+		if (copy_from_user(&ci, arg,sizeof(struct atm_cirange)))
 			return -EFAULT;
 		if ((ci.vpi_bits == 0 || ci.vpi_bits == ATM_CI_MAX) &&
 		    (ci.vci_bits == NR_VCI_LD || ci.vpi_bits == ATM_CI_MAX))
@@ -2009,14 +2009,14 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 
 
 static int eni_getsockopt(struct atm_vcc *vcc,int level,int optname,
-    void *optval,int optlen)
+    void __user *optval,int optlen)
 {
 	return -EINVAL;
 }
 
 
 static int eni_setsockopt(struct atm_vcc *vcc,int level,int optname,
-    void *optval,int optlen)
+    void __user *optval,int optlen)
 {
 	return -EINVAL;
 }
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index f45adbb4c..025c692fd 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1220,7 +1220,7 @@ static int fs_send (struct atm_vcc *atm_vcc, struct sk_buff *skb)
 /* Some function placeholders for functions we don't yet support. */
 
 #if 0
-static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
 	func_enter ();
 	func_exit ();
@@ -1229,7 +1229,7 @@ static int fs_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 
 
 static int fs_getsockopt(struct atm_vcc *vcc,int level,int optname,
-			 void *optval,int optlen)
+			 void __user *optval,int optlen)
 {
 	func_enter ();
 	func_exit ();
@@ -1238,7 +1238,7 @@ static int fs_getsockopt(struct atm_vcc *vcc,int level,int optname,
 
 
 static int fs_setsockopt(struct atm_vcc *vcc,int level,int optname,
-			 void *optval,int optlen)
+			 void __user *optval,int optlen)
 {
 	func_enter ();
 	func_exit ();
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index c41bbe20c..e33b5357e 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -38,6 +38,7 @@
 #include <linux/atmdev.h>
 #include <linux/sonet.h>
 #include <linux/atm_suni.h>
+#include <linux/dma-mapping.h>
 #include <asm/io.h>
 #include <asm/string.h>
 #include <asm/page.h>
@@ -682,7 +683,7 @@ fore200e_pca_prom_read(struct fore200e* fore200e, struct prom_data* prom)
     opcode.opcode = OPCODE_GET_PROM;
     opcode.pad    = 0;
 
-    prom_dma = fore200e->bus->dma_map(fore200e, prom, sizeof(struct prom_data), FORE200E_DMA_FROMDEVICE);
+    prom_dma = fore200e->bus->dma_map(fore200e, prom, sizeof(struct prom_data), DMA_FROM_DEVICE);
 
     fore200e->bus->write(prom_dma, &entry->cp_entry->cmd.prom_block.prom_haddr);
     
@@ -694,7 +695,7 @@ fore200e_pca_prom_read(struct fore200e* fore200e, struct prom_data* prom)
 
     *entry->status = STATUS_FREE;
 
-    fore200e->bus->dma_unmap(fore200e, prom_dma, sizeof(struct prom_data), FORE200E_DMA_FROMDEVICE);
+    fore200e->bus->dma_unmap(fore200e, prom_dma, sizeof(struct prom_data), DMA_FROM_DEVICE);
 
     if (ok == 0) {
 	printk(FORE200E "unable to get PROM data from device %s\n", fore200e->name);
@@ -1003,7 +1004,7 @@ fore200e_tx_irq(struct fore200e* fore200e)
 	
 	/* remove DMA mapping */
 	fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length,
-				 FORE200E_DMA_TODEVICE);
+				 DMA_TO_DEVICE);
 
 	vc_map = entry->vc_map;
 
@@ -1228,12 +1229,12 @@ fore200e_push_rpd(struct fore200e* fore200e, struct atm_vcc* vcc, struct rpd* rp
 	buffer = FORE200E_HDL2BUF(rpd->rsd[ i ].handle);
 	
 	/* Make device DMA transfer visible to CPU.  */
-	fore200e->bus->dma_sync_for_cpu(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, FORE200E_DMA_FROMDEVICE);
+	fore200e->bus->dma_sync_for_cpu(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, DMA_FROM_DEVICE);
 	
 	memcpy(skb_put(skb, rpd->rsd[ i ].length), buffer->data.align_addr, rpd->rsd[ i ].length);
 
 	/* Now let the device get at it again.  */
-	fore200e->bus->dma_sync_for_device(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, FORE200E_DMA_FROMDEVICE);
+	fore200e->bus->dma_sync_for_device(fore200e, buffer->data.dma_addr, rpd->rsd[ i ].length, DMA_FROM_DEVICE);
     }
 
     DPRINTK(3, "rx skb: len = %d, truesize = %d\n", skb->len, skb->truesize);
@@ -1656,7 +1657,7 @@ fore200e_close(struct atm_vcc* vcc)
     vcc->itf = vcc->vci = vcc->vpi = 0;
 
     fore200e_vcc = FORE200E_VCC(vcc);
-    FORE200E_VCC(vcc) = NULL;
+    vcc->dev_data = NULL;
 
     spin_unlock_irqrestore(&fore200e->q_lock, flags);
 
@@ -1807,7 +1808,7 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb)
     entry->data   = tx_copy ? data : NULL;
 
     tpd = entry->tpd;
-    tpd->tsd[ 0 ].buffer = fore200e->bus->dma_map(fore200e, data, tx_len, FORE200E_DMA_TODEVICE);
+    tpd->tsd[ 0 ].buffer = fore200e->bus->dma_map(fore200e, data, tx_len, DMA_TO_DEVICE);
     tpd->tsd[ 0 ].length = tx_len;
 
     FORE200E_NEXT_ENTRY(txq->head, QUEUE_SIZE_TX);
@@ -1881,7 +1882,7 @@ fore200e_getstats(struct fore200e* fore200e)
     }
     
     stats_dma_addr = fore200e->bus->dma_map(fore200e, fore200e->stats,
-					    sizeof(struct stats), FORE200E_DMA_FROMDEVICE);
+					    sizeof(struct stats), DMA_FROM_DEVICE);
     
     FORE200E_NEXT_ENTRY(cmdq->head, QUEUE_SIZE_CMD);
 
@@ -1898,7 +1899,7 @@ fore200e_getstats(struct fore200e* fore200e)
 
     *entry->status = STATUS_FREE;
 
-    fore200e->bus->dma_unmap(fore200e, stats_dma_addr, sizeof(struct stats), FORE200E_DMA_FROMDEVICE);
+    fore200e->bus->dma_unmap(fore200e, stats_dma_addr, sizeof(struct stats), DMA_FROM_DEVICE);
     
     if (ok == 0) {
 	printk(FORE200E "unable to get statistics from device %s\n", fore200e->name);
@@ -1910,7 +1911,7 @@ fore200e_getstats(struct fore200e* fore200e)
 
 
 static int
-fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, int optlen)
+fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, int optlen)
 {
     /* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */
 
@@ -1922,7 +1923,7 @@ fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, i
 
 
 static int
-fore200e_setsockopt(struct atm_vcc* vcc, int level, int optname, void* optval, int optlen)
+fore200e_setsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, int optlen)
 {
     /* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */
     
@@ -1943,7 +1944,7 @@ fore200e_get_oc3(struct fore200e* fore200e, struct oc3_regs* regs)
     int                     ok;
     u32                     oc3_regs_dma_addr;
 
-    oc3_regs_dma_addr = fore200e->bus->dma_map(fore200e, regs, sizeof(struct oc3_regs), FORE200E_DMA_FROMDEVICE);
+    oc3_regs_dma_addr = fore200e->bus->dma_map(fore200e, regs, sizeof(struct oc3_regs), DMA_FROM_DEVICE);
 
     FORE200E_NEXT_ENTRY(cmdq->head, QUEUE_SIZE_CMD);
 
@@ -1962,7 +1963,7 @@ fore200e_get_oc3(struct fore200e* fore200e, struct oc3_regs* regs)
 
     *entry->status = STATUS_FREE;
 
-    fore200e->bus->dma_unmap(fore200e, oc3_regs_dma_addr, sizeof(struct oc3_regs), FORE200E_DMA_FROMDEVICE);
+    fore200e->bus->dma_unmap(fore200e, oc3_regs_dma_addr, sizeof(struct oc3_regs), DMA_FROM_DEVICE);
     
     if (ok == 0) {
 	printk(FORE200E "unable to get OC-3 regs of device %s\n", fore200e->name);
@@ -2058,7 +2059,7 @@ fore200e_swap(unsigned int in)
 
 
 static int
-fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats* arg)
+fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg)
 {
     struct sonet_stats tmp;
 
@@ -2087,7 +2088,7 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats* arg)
 
 
 static int
-fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void* arg)
+fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void __user * arg)
 {
     struct fore200e* fore200e = FORE200E_DEV(dev);
     
@@ -2096,19 +2097,19 @@ fore200e_ioctl(struct atm_dev* dev, unsigned int cmd, void* arg)
     switch (cmd) {
 
     case SONET_GETSTAT:
-	return fore200e_fetch_stats(fore200e, (struct sonet_stats*)arg);
+	return fore200e_fetch_stats(fore200e, (struct sonet_stats __user *)arg);
 
     case SONET_GETDIAG:
-	return put_user(0, (int*)arg) ? -EFAULT : 0;
+	return put_user(0, (int __user *)arg) ? -EFAULT : 0;
 
     case ATM_SETLOOP:
 	return fore200e_setloop(fore200e, (int)(unsigned long)arg);
 
     case ATM_GETLOOP:
-	return put_user(fore200e->loop_mode, (int*)arg) ? -EFAULT : 0;
+	return put_user(fore200e->loop_mode, (int __user *)arg) ? -EFAULT : 0;
 
     case ATM_QUERYLOOP:
-	return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY, (int*)arg) ? -EFAULT : 0;
+	return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY, (int __user *)arg) ? -EFAULT : 0;
     }
 
     return -ENOSYS; /* not implemented */
@@ -2257,7 +2258,7 @@ fore200e_alloc_rx_buf(struct fore200e* fore200e)
 		/* allocate the receive buffer body */
 		if (fore200e_chunk_alloc(fore200e,
 					 &buffer[ i ].data, size, fore200e->bus->buffer_alignment,
-					 FORE200E_DMA_FROMDEVICE) < 0) {
+					 DMA_FROM_DEVICE) < 0) {
 		    
 		    while (i > 0)
 			fore200e_chunk_free(fore200e, &buffer[ --i ].data);
diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h
index 0b2168274..aca550b66 100644
--- a/drivers/atm/fore200e.h
+++ b/drivers/atm/fore200e.h
@@ -556,7 +556,7 @@ typedef struct host_bsq_entry {
 
 typedef struct host_cmdq_entry {
     struct cp_cmdq_entry* cp_entry;    /* addr of cp resident cmd queue entry */
-    enum   status*        status;      /* addr of host resident status        */
+    enum status *status;	       /* addr of host resident status        */
 } host_cmdq_entry_t;
 
 
@@ -668,7 +668,7 @@ typedef struct bs_spec {
 
 typedef struct init_block {
     enum opcode  opcode;               /* initialize command             */
-    enum status  status;	       /* related status word            */
+    enum status	 status;	       /* related status word            */
     u32          receive_threshold;    /* not used                       */
     u32          num_connect;          /* ATM connections                */
     u32          cmd_queue_len;        /* length of command queue        */
@@ -827,36 +827,6 @@ typedef struct fore200e_bus {
     int                  (*proc_read)(struct fore200e*, char*);
 } fore200e_bus_t;
 
-
-#if defined(CONFIG_ATM_FORE200E_SBA)
-#  if defined(CONFIG_ATM_FORE200E_PCA)
-#    if (PCI_DMA_BIDIRECTIONAL == SBUS_DMA_BIDIRECTIONAL) && \
-        (PCI_DMA_TODEVICE      == SBUS_DMA_TODEVICE)      && \
-        (PCI_DMA_FROMDEVICE    == SBUS_DMA_FROMDEVICE)
-#      define FORE200E_DMA_BIDIRECTIONAL PCI_DMA_BIDIRECTIONAL
-#      define FORE200E_DMA_TODEVICE      PCI_DMA_TODEVICE
-#      define FORE200E_DMA_FROMDEVICE    PCI_DMA_FROMDEVICE
-#    else
-       /* in that case, we'll need to add an extra indirection, e.g.
-	  fore200e->bus->dma_direction[ fore200e_dma_direction ] */
-#      error PCI and SBUS DMA direction flags have different values!
-#    endif
-#  else
-#    define FORE200E_DMA_BIDIRECTIONAL SBUS_DMA_BIDIRECTIONAL
-#    define FORE200E_DMA_TODEVICE      SBUS_DMA_TODEVICE
-#    define FORE200E_DMA_FROMDEVICE    SBUS_DMA_FROMDEVICE
-#  endif
-#else
-#  ifndef CONFIG_ATM_FORE200E_PCA
-#    warning compiling the fore200e driver without any hardware support enabled!
-#    include <linux/pci.h>
-#  endif
-#  define FORE200E_DMA_BIDIRECTIONAL PCI_DMA_BIDIRECTIONAL
-#  define FORE200E_DMA_TODEVICE      PCI_DMA_TODEVICE
-#  define FORE200E_DMA_FROMDEVICE    PCI_DMA_FROMDEVICE
-#endif
-
-
 /* vc mapping */
 
 typedef struct fore200e_vc_map {
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 72123ecfb..ad746d981 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -134,7 +134,7 @@ static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
 static int he_open(struct atm_vcc *vcc);
 static void he_close(struct atm_vcc *vcc);
 static int he_send(struct atm_vcc *vcc, struct sk_buff *skb);
-static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg);
+static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg);
 static irqreturn_t he_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
 static void he_tasklet(unsigned long data);
 static int he_proc_read(struct atm_dev *dev,loff_t *pos,char *page);
@@ -2809,7 +2809,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
 }
 
 static int
-he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
+he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg)
 {
 	unsigned long flags;
 	struct he_dev *he_dev = HE_DEV(atm_dev);
@@ -2821,8 +2821,8 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
 			if (!capable(CAP_NET_ADMIN))
 				return -EPERM;
 
-			if (copy_from_user(&reg, (struct he_ioctl_reg *) arg,
-						sizeof(struct he_ioctl_reg)))
+			if (copy_from_user(&reg, arg,
+					   sizeof(struct he_ioctl_reg)))
 				return -EFAULT;
 			
 			spin_lock_irqsave(&he_dev->global_lock, flags);
@@ -2848,7 +2848,7 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
 			}
 			spin_unlock_irqrestore(&he_dev->global_lock, flags);
 			if (err == 0)
-				if (copy_to_user((struct he_ioctl_reg *) arg, &reg,
+				if (copy_to_user(arg, &reg,
 							sizeof(struct he_ioctl_reg)))
 					return -EFAULT;
 			break;
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index 90e407a9a..a794610da 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -597,126 +597,112 @@ static inline u16 rx_q_entry_to_rx_channel (u32 x) {
 
 // p ranges from 1 to a power of 2
 #define CR_MAXPEXP 4
-
+ 
 static int make_rate (const hrz_dev * dev, u32 c, rounding r,
-		      u16 * bits, unsigned int * actual) {
-  
-  // note: rounding the rate down means rounding 'p' up
-  
-  const unsigned long br = test_bit(ultra, &dev->flags) ? BR_ULT : BR_HRZ;
-  
-  u32 div = CR_MIND;
-  u32 pre;
+		      u16 * bits, unsigned int * actual)
+{
+	// note: rounding the rate down means rounding 'p' up
+	const unsigned long br = test_bit(ultra, &dev->flags) ? BR_ULT : BR_HRZ;
   
-  // local fn to build the timer bits
-  int set_cr (void) {
-    // paranoia
-    if (div > CR_MAXD || (!pre) || pre > 1<<CR_MAXPEXP) {
-      PRINTD (DBG_QOS, "set_cr internal failure: d=%u p=%u",
-	      div, pre);
-      return -EINVAL;
-    } else {
-      if (bits)
-	*bits = (div<<CLOCK_SELECT_SHIFT) | (pre-1);
-      if (actual) {
-	*actual = (br + (pre<<div) - 1) / (pre<<div);
-	PRINTD (DBG_QOS, "actual rate: %u", *actual);
-      }
-      return 0;
-    }
-  }
+	u32 div = CR_MIND;
+	u32 pre;
   
-  // br_exp and br_man are used to avoid overflowing (c*maxp*2^d) in
-  // the tests below. We could think harder about exact possibilities
-  // of failure...
+	// br_exp and br_man are used to avoid overflowing (c*maxp*2^d) in
+	// the tests below. We could think harder about exact possibilities
+	// of failure...
   
-  unsigned long br_man = br;
-  unsigned int br_exp = 0;
+	unsigned long br_man = br;
+	unsigned int br_exp = 0;
   
-  PRINTD (DBG_QOS|DBG_FLOW, "make_rate b=%lu, c=%u, %s", br, c,
-	  (r == round_up) ? "up" : (r == round_down) ? "down" : "nearest");
+	PRINTD (DBG_QOS|DBG_FLOW, "make_rate b=%lu, c=%u, %s", br, c,
+		r == round_up ? "up" : r == round_down ? "down" : "nearest");
   
-  // avoid div by zero
-  if (!c) {
-    PRINTD (DBG_QOS|DBG_ERR, "zero rate is not allowed!");
-    return -EINVAL;
-  }
+	// avoid div by zero
+	if (!c) {
+		PRINTD (DBG_QOS|DBG_ERR, "zero rate is not allowed!");
+		return -EINVAL;
+	}
   
-  while (br_exp < CR_MAXPEXP + CR_MIND && (br_man % 2 == 0)) {
-    br_man = br_man >> 1;
-    ++br_exp;
-  }
-  // (br >>br_exp) <<br_exp == br and
-  // br_exp <= CR_MAXPEXP+CR_MIND
+	while (br_exp < CR_MAXPEXP + CR_MIND && (br_man % 2 == 0)) {
+		br_man = br_man >> 1;
+		++br_exp;
+	}
+	// (br >>br_exp) <<br_exp == br and
+	// br_exp <= CR_MAXPEXP+CR_MIND
+  
+	if (br_man <= (c << (CR_MAXPEXP+CR_MIND-br_exp))) {
+		// Equivalent to: B <= (c << (MAXPEXP+MIND))
+		// take care of rounding
+		switch (r) {
+			case round_down:
+				pre = (br+(c<<div)-1)/(c<<div);
+				// but p must be non-zero
+				if (!pre)
+					pre = 1;
+				break;
+			case round_nearest:
+				pre = (br+(c<<div)/2)/(c<<div);
+				// but p must be non-zero
+				if (!pre)
+					pre = 1;
+				break;
+			default:	/* round_up */
+				pre = br/(c<<div);
+				// but p must be non-zero
+				if (!pre)
+					return -EINVAL;
+		}
+		PRINTD (DBG_QOS, "A: p=%u, d=%u", pre, div);
+		goto got_it;
+	}
   
-  if (br_man <= (c << (CR_MAXPEXP+CR_MIND-br_exp))) {
-    // Equivalent to: B <= (c << (MAXPEXP+MIND))
-    // take care of rounding
-    switch (r) {
-      case round_down:
-	pre = (br+(c<<div)-1)/(c<<div);
-	// but p must be non-zero
-	if (!pre)
-	  pre = 1;
-	break;
-      case round_nearest:
-	pre = (br+(c<<div)/2)/(c<<div);
-	// but p must be non-zero
-	if (!pre)
-	  pre = 1;
-	break;
-      case round_up:
-	pre = br/(c<<div);
-	// but p must be non-zero
-	if (!pre)
-	  return -EINVAL;
-	break;
-    }
-    PRINTD (DBG_QOS, "A: p=%u, d=%u", pre, div);
-    return set_cr ();
-  }
-  
-  // at this point we have
-  // d == MIND and (c << (MAXPEXP+MIND)) < B
-  while (div < CR_MAXD) {
-    div++;
-    if (br_man <= (c << (CR_MAXPEXP+div-br_exp))) {
-      // Equivalent to: B <= (c << (MAXPEXP+d))
-      // c << (MAXPEXP+d-1) < B <= c << (MAXPEXP+d)
-      // 1 << (MAXPEXP-1) < B/2^d/c <= 1 << MAXPEXP
-      // MAXP/2 < B/c2^d <= MAXP
-      // take care of rounding
-      switch (r) {
-	case round_down:
-	  pre = (br+(c<<div)-1)/(c<<div);
-	  break;
-	case round_nearest:
-	  pre = (br+(c<<div)/2)/(c<<div);
-	  break;
-	case round_up:
-	  pre = br/(c<<div);
-	  break;
-      }
-      PRINTD (DBG_QOS, "B: p=%u, d=%u", pre, div);
-      return set_cr ();
-    }
-  }
-  // at this point we have
-  // d == MAXD and (c << (MAXPEXP+MAXD)) < B
-  // but we cannot go any higher
-  // take care of rounding
-  switch (r) {
-    case round_down:
-      return -EINVAL;
-      break;
-    case round_nearest:
-      break;
-    case round_up:
-      break;
-  }
-  pre = 1 << CR_MAXPEXP;
-  PRINTD (DBG_QOS, "C: p=%u, d=%u", pre, div);
-  return set_cr ();
+	// at this point we have
+	// d == MIND and (c << (MAXPEXP+MIND)) < B
+	while (div < CR_MAXD) {
+		div++;
+		if (br_man <= (c << (CR_MAXPEXP+div-br_exp))) {
+			// Equivalent to: B <= (c << (MAXPEXP+d))
+			// c << (MAXPEXP+d-1) < B <= c << (MAXPEXP+d)
+			// 1 << (MAXPEXP-1) < B/2^d/c <= 1 << MAXPEXP
+			// MAXP/2 < B/c2^d <= MAXP
+			// take care of rounding
+			switch (r) {
+				case round_down:
+					pre = (br+(c<<div)-1)/(c<<div);
+					break;
+				case round_nearest:
+					pre = (br+(c<<div)/2)/(c<<div);
+					break;
+				default: /* round_up */
+					pre = br/(c<<div);
+			}
+			PRINTD (DBG_QOS, "B: p=%u, d=%u", pre, div);
+			goto got_it;
+		}
+	}
+	// at this point we have
+	// d == MAXD and (c << (MAXPEXP+MAXD)) < B
+	// but we cannot go any higher
+	// take care of rounding
+	if (r == round_down)
+		return -EINVAL;
+	pre = 1 << CR_MAXPEXP;
+	PRINTD (DBG_QOS, "C: p=%u, d=%u", pre, div);
+got_it:
+	// paranoia
+	if (div > CR_MAXD || (!pre) || pre > 1<<CR_MAXPEXP) {
+		PRINTD (DBG_QOS, "set_cr internal failure: d=%u p=%u",
+			div, pre);
+		return -EINVAL;
+	} else {
+		if (bits)
+			*bits = (div<<CLOCK_SELECT_SHIFT) | (pre-1);
+		if (actual) {
+			*actual = (br + (pre<<div) - 1) / (pre<<div);
+			PRINTD (DBG_QOS, "actual rate: %u", *actual);
+		}
+		return 0;
+	}
 }
 
 static int make_rate_with_tolerance (const hrz_dev * dev, u32 c, rounding r, unsigned int tol,
@@ -1823,23 +1809,23 @@ static void hrz_reset (const hrz_dev * dev) {
 
 /********** read the burnt in address **********/
 
-static u16 __init read_bia (const hrz_dev * dev, u16 addr) {
+static inline void WRITE_IT_WAIT (const hrz_dev *dev, u32 ctrl)
+{
+	wr_regl (dev, CONTROL_0_REG, ctrl);
+	udelay (5);
+}
   
+static inline void CLOCK_IT (const hrz_dev *dev, u32 ctrl)
+{
+	// DI must be valid around rising SK edge
+	WRITE_IT_WAIT(dev, ctrl & ~SEEPROM_SK);
+	WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK);
+}
+
+static u16 __init read_bia (const hrz_dev * dev, u16 addr)
+{
   u32 ctrl = rd_regl (dev, CONTROL_0_REG);
   
-  void WRITE_IT_WAIT (void) {
-    wr_regl (dev, CONTROL_0_REG, ctrl);
-    udelay (5);
-  }
-  
-  void CLOCK_IT (void) {
-    // DI must be valid around rising SK edge
-    ctrl &= ~SEEPROM_SK;
-    WRITE_IT_WAIT();
-    ctrl |= SEEPROM_SK;
-    WRITE_IT_WAIT();
-  }
-  
   const unsigned int addr_bits = 6;
   const unsigned int data_bits = 16;
   
@@ -1848,17 +1834,17 @@ static u16 __init read_bia (const hrz_dev * dev, u16 addr) {
   u16 res;
   
   ctrl &= ~(SEEPROM_CS | SEEPROM_SK | SEEPROM_DI);
-  WRITE_IT_WAIT();
+  WRITE_IT_WAIT(dev, ctrl);
   
   // wake Serial EEPROM and send 110 (READ) command
   ctrl |=  (SEEPROM_CS | SEEPROM_DI);
-  CLOCK_IT();
+  CLOCK_IT(dev, ctrl);
   
   ctrl |= SEEPROM_DI;
-  CLOCK_IT();
+  CLOCK_IT(dev, ctrl);
   
   ctrl &= ~SEEPROM_DI;
-  CLOCK_IT();
+  CLOCK_IT(dev, ctrl);
   
   for (i=0; i<addr_bits; i++) {
     if (addr & (1 << (addr_bits-1)))
@@ -1866,7 +1852,7 @@ static u16 __init read_bia (const hrz_dev * dev, u16 addr) {
     else
       ctrl &= ~SEEPROM_DI;
     
-    CLOCK_IT();
+    CLOCK_IT(dev, ctrl);
     
     addr = addr << 1;
   }
@@ -1878,14 +1864,14 @@ static u16 __init read_bia (const hrz_dev * dev, u16 addr) {
   for (i=0;i<data_bits;i++) {
     res = res >> 1;
     
-    CLOCK_IT();
+    CLOCK_IT(dev, ctrl);
     
     if (rd_regl (dev, CONTROL_0_REG) & SEEPROM_DO)
       res |= (1 << (data_bits-1));
   }
   
   ctrl &= ~(SEEPROM_SK | SEEPROM_CS);
-  WRITE_IT_WAIT();
+  WRITE_IT_WAIT(dev, ctrl);
   
   return res;
 }
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index c95ca296b..c1fb6c710 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -141,7 +141,7 @@ static void idt77105_restart_timer_func(unsigned long dummy)
 }
 
 
-static int fetch_stats(struct atm_dev *dev,struct idt77105_stats *arg,int zero)
+static int fetch_stats(struct atm_dev *dev,struct idt77105_stats __user *arg,int zero)
 {
 	unsigned long flags;
 	struct idt77105_stats stats;
@@ -188,7 +188,7 @@ static int set_loopback(struct atm_dev *dev,int mode)
 }
 
 
-static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
         printk(KERN_NOTICE "%s(%d) idt77105_ioctl() called\n",dev->type,dev->number);
 	switch (cmd) {
@@ -196,16 +196,15 @@ static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 			if (!capable(CAP_NET_ADMIN)) return -EPERM;
 			/* fall through */
 		case IDT77105_GETSTAT:
-			return fetch_stats(dev,(struct idt77105_stats *) arg,
-			    cmd == IDT77105_GETSTATZ);
+			return fetch_stats(dev, arg, cmd == IDT77105_GETSTATZ);
 		case ATM_SETLOOP:
 			return set_loopback(dev,(int) (long) arg);
 		case ATM_GETLOOP:
-			return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
+			return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
 			    -EFAULT : 0;
 		case ATM_QUERYLOOP:
 			return put_user(ATM_LM_LOC_ATM | ATM_LM_RMT_ATM,
-			    (int *) arg) ? -EFAULT : 0;
+			    (int __user *) arg) ? -EFAULT : 0;
 		default:
 			return -ENOIOCTLCMD;
 	}
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 2b6b9c6eb..3c964ecfb 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2738,12 +2738,12 @@ static int ia_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flags)
 	return 0;  
 }  
   
-static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)  
+static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)  
 {  
    IA_CMDBUF ia_cmds;
    IADEV *iadev;
    int i, board;
-   u16 *tmps;
+   u16 __user *tmps;
    IF_EVENT(printk(">ia_ioctl\n");)  
    if (cmd != IA_CMD) {
       if (!dev->phy->ioctl) return -EINVAL;
@@ -2766,7 +2766,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
              break;
           case MEMDUMP_SEGREG:
 	     if (!capable(CAP_NET_ADMIN)) return -EPERM;
-             tmps = (u16 *)ia_cmds.buf;
+             tmps = (u16 __user *)ia_cmds.buf;
              for(i=0; i<0x80; i+=2, tmps++)
                 if(put_user((u16)(readl(iadev->seg_reg+i) & 0xffff), tmps)) return -EFAULT;
              ia_cmds.status = 0;
@@ -2774,7 +2774,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
              break;
           case MEMDUMP_REASSREG:
 	     if (!capable(CAP_NET_ADMIN)) return -EPERM;
-             tmps = (u16 *)ia_cmds.buf;
+             tmps = (u16 __user *)ia_cmds.buf;
              for(i=0; i<0x80; i+=2, tmps++)
                 if(put_user((u16)(readl(iadev->reass_reg+i) & 0xffff), tmps)) return -EFAULT;
              ia_cmds.status = 0;
@@ -2874,14 +2874,14 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
 }  
   
 static int ia_getsockopt(struct atm_vcc *vcc, int level, int optname,   
-	void *optval, int optlen)  
+	void __user *optval, int optlen)  
 {  
 	IF_EVENT(printk(">ia_getsockopt\n");)  
 	return -EINVAL;  
 }  
   
 static int ia_setsockopt(struct atm_vcc *vcc, int level, int optname,   
-	void *optval, int optlen)  
+	void __user *optval, int optlen)  
 {  
 	IF_EVENT(printk(">ia_setsockopt\n");)  
 	return -EINVAL;  
diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h
index 1134bda43..92e514c79 100644
--- a/drivers/atm/iphase.h
+++ b/drivers/atm/iphase.h
@@ -141,7 +141,7 @@ typedef struct {
         int len;
         u32 maddr;
         int status;
-        void *buf;
+        void __user *buf;
 } IA_CMDBUF, *PIA_CMDBUF;
 
 /* cmds */
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 5a7037af6..ac80b9efd 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -2435,7 +2435,7 @@ static int lanai_open(struct atm_vcc *atmvcc)
 #if 0
 /* ioctl operations for card */
 /* NOTE: these are all DEBUGGING ONLY currently */
-static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void *arg)
+static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg)
 {
 	int result = 0;
 	struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 11875f784..b63669c1f 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -239,7 +239,7 @@ static void recycle_iov_buf(ns_dev *card, struct sk_buff *iovb);
 static void dequeue_sm_buf(ns_dev *card, struct sk_buff *sb);
 static void dequeue_lg_buf(ns_dev *card, struct sk_buff *lb);
 static int ns_proc_read(struct atm_dev *dev, loff_t *pos, char *page);
-static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg);
+static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg);
 static void which_list(ns_dev *card, struct sk_buff *skb);
 static void ns_poll(unsigned long arg);
 static int ns_parse_mac(char *mac, unsigned char *esi);
@@ -2765,7 +2765,7 @@ static int ns_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
 
 
 
-static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
+static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
 {
    ns_dev *card;
    pool_levels pl;
@@ -2776,7 +2776,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
    switch (cmd)
    {
       case NS_GETPSTAT:
-         if (get_user(pl.buftype, &((pool_levels *) arg)->buftype))
+         if (get_user(pl.buftype, &((pool_levels __user *) arg)->buftype))
 	    return -EFAULT;
          switch (pl.buftype)
 	 {
@@ -2812,7 +2812,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
 	       return -ENOIOCTLCMD;
 
 	 }
-         if (!copy_to_user((pool_levels *) arg, &pl, sizeof(pl)))
+         if (!copy_to_user((pool_levels __user *) arg, &pl, sizeof(pl)))
 	    return (sizeof(pl));
 	 else
 	    return -EFAULT;
@@ -2820,7 +2820,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
       case NS_SETBUFLEV:
          if (!capable(CAP_NET_ADMIN))
 	    return -EPERM;
-         if (copy_from_user(&pl, (pool_levels *) arg, sizeof(pl)))
+         if (copy_from_user(&pl, (pool_levels __user *) arg, sizeof(pl)))
 	    return -EFAULT;
 	 if (pl.level.min >= pl.level.init || pl.level.init >= pl.level.max)
 	    return -EINVAL;
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
index e245e94bd..e5a0f5cbd 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -95,7 +95,7 @@ static void suni_hz(unsigned long from_timer)
 #undef ADD_LIMITED
 
 
-static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
+static int fetch_stats(struct atm_dev *dev,struct sonet_stats __user *arg,int zero)
 {
 	struct sonet_stats tmp;
 	int error = 0;
@@ -115,11 +115,11 @@ static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
   }
 
 
-static int change_diag(struct atm_dev *dev,void *arg,int set)
+static int change_diag(struct atm_dev *dev,void __user *arg,int set)
 {
 	int todo;
 
-	if (get_user(todo,(int *) arg)) return -EFAULT;
+	if (get_user(todo,(int __user *)arg)) return -EFAULT;
 	HANDLE_FLAG(SONET_INS_SBIP,TSOP_DIAG,SUNI_TSOP_DIAG_DBIP8);
 	HANDLE_FLAG(SONET_INS_LBIP,TLOP_DIAG,SUNI_TLOP_DIAG_DBIP);
 	HANDLE_FLAG(SONET_INS_PBIP,TPOP_CD,SUNI_TPOP_DIAG_DB3);
@@ -128,14 +128,14 @@ static int change_diag(struct atm_dev *dev,void *arg,int set)
 	HANDLE_FLAG(SONET_INS_PAIS,TPOP_CD,SUNI_TPOP_DIAG_PAIS);
 	HANDLE_FLAG(SONET_INS_LOS,TSOP_DIAG,SUNI_TSOP_DIAG_DLOS);
 	HANDLE_FLAG(SONET_INS_HCS,TACP_CS,SUNI_TACP_CS_DHCS);
-	return put_user(todo,(int *) arg) ? -EFAULT : 0;
+	return put_user(todo,(int __user *)arg) ? -EFAULT : 0;
 }
 
 
 #undef HANDLE_FLAG
 
 
-static int get_diag(struct atm_dev *dev,void *arg)
+static int get_diag(struct atm_dev *dev,void __user *arg)
 {
 	int set;
 
@@ -148,7 +148,7 @@ static int get_diag(struct atm_dev *dev,void *arg)
 	if (GET(TPOP_CD) & SUNI_TPOP_DIAG_PAIS) set |= SONET_INS_PAIS;
 	if (GET(TSOP_DIAG) & SUNI_TSOP_DIAG_DLOS) set |= SONET_INS_LOS;
 	if (GET(TACP_CS) & SUNI_TACP_CS_DHCS) set |= SONET_INS_HCS;
-	return put_user(set,(int *) arg) ? -EFAULT : 0;
+	return put_user(set,(int __user *)arg) ? -EFAULT : 0;
 }
 
 
@@ -175,13 +175,12 @@ static int set_loopback(struct atm_dev *dev,int mode)
 }
 
 
-static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
 	switch (cmd) {
 		case SONET_GETSTATZ:
 		case SONET_GETSTAT:
-			return fetch_stats(dev,(struct sonet_stats *) arg,
-			    cmd == SONET_GETSTATZ);
+			return fetch_stats(dev, arg, cmd == SONET_GETSTATZ);
 		case SONET_SETDIAG:
 			return change_diag(dev,arg,1);
 		case SONET_CLRDIAG:
@@ -192,18 +191,18 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 			if (arg != SONET_FRAME_SONET) return -EINVAL;
 			return 0;
 		case SONET_GETFRAMING:
-			return put_user(SONET_FRAME_SONET,(int *) arg) ?
+			return put_user(SONET_FRAME_SONET,(int __user *)arg) ?
 			    -EFAULT : 0;
 		case SONET_GETFRSENSE:
 			return -EINVAL;
 		case ATM_SETLOOP:
 			return set_loopback(dev,(int) (long) arg);
 		case ATM_GETLOOP:
-			return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
+			return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
 			    -EFAULT : 0;
 		case ATM_QUERYLOOP:
 			return put_user(ATM_LM_LOC_PHY | ATM_LM_RMT_PHY,
-			    (int *) arg) ? -EFAULT : 0;
+			    (int __user *) arg) ? -EFAULT : 0;
 		default:
 			return -ENOIOCTLCMD;
 	}
diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
index 0bc05c960..da33eaddc 100644
--- a/drivers/atm/uPD98402.c
+++ b/drivers/atm/uPD98402.c
@@ -37,7 +37,7 @@ struct uPD98402_priv {
 #define GET(reg) dev->ops->phy_get(dev,uPD98402_##reg)
 
 
-static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
+static int fetch_stats(struct atm_dev *dev,struct sonet_stats __user *arg,int zero)
 {
 	struct sonet_stats tmp;
  	int error = 0;
@@ -83,7 +83,7 @@ static int set_framing(struct atm_dev *dev,unsigned char framing)
 }
 
 
-static int get_sense(struct atm_dev *dev,u8 *arg)
+static int get_sense(struct atm_dev *dev,u8 __user *arg)
 {
 	unsigned long flags;
 	unsigned char s[3];
@@ -132,29 +132,28 @@ static int set_loopback(struct atm_dev *dev,int mode)
 }
 
 
-static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
 	switch (cmd) {
 
 		case SONET_GETSTATZ:
                 case SONET_GETSTAT:
-			return fetch_stats(dev,(struct sonet_stats *) arg,
-			    cmd == SONET_GETSTATZ);
+			return fetch_stats(dev,arg, cmd == SONET_GETSTATZ);
 		case SONET_SETFRAMING:
 			return set_framing(dev,(int) (long) arg);
 		case SONET_GETFRAMING:
-			return put_user(PRIV(dev)->framing,(int *) arg) ?
+			return put_user(PRIV(dev)->framing,(int __user *)arg) ?
 			    -EFAULT : 0;
 		case SONET_GETFRSENSE:
 			return get_sense(dev,arg);
 		case ATM_SETLOOP:
 			return set_loopback(dev,(int) (long) arg);
 		case ATM_GETLOOP:
-			return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
+			return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
 			    -EFAULT : 0;
 		case ATM_QUERYLOOP:
 			return put_user(ATM_LM_LOC_PHY | ATM_LM_LOC_ATM |
-			    ATM_LM_RMT_PHY,(int *) arg) ? -EFAULT : 0;
+			    ATM_LM_RMT_PHY,(int __user *)arg) ? -EFAULT : 0;
 		default:
 			return -ENOIOCTLCMD;
 	}
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 9027baa42..88d548a18 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1429,7 +1429,7 @@ static int zatm_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flags)
 }
 
 
-static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
+static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 {
 	struct zatm_dev *zatm_dev;
 	unsigned long flags;
@@ -1445,7 +1445,7 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 				int pool;
 
 				if (get_user(pool,
-				    &((struct zatm_pool_req *) arg)->pool_num))
+				    &((struct zatm_pool_req __user *) arg)->pool_num))
 					return -EFAULT;
 				if (pool < 0 || pool > ZATM_LAST_POOL)
 					return -EINVAL;
@@ -1457,7 +1457,7 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 				}
 				spin_unlock_irqrestore(&zatm_dev->lock, flags);
 				return copy_to_user(
-				    &((struct zatm_pool_req *) arg)->info,
+				    &((struct zatm_pool_req __user *) arg)->info,
 				    &info,sizeof(info)) ? -EFAULT : 0;
 			}
 		case ZATM_SETPOOL:
@@ -1467,12 +1467,12 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 
 				if (!capable(CAP_NET_ADMIN)) return -EPERM;
 				if (get_user(pool,
-				    &((struct zatm_pool_req *) arg)->pool_num))
+				    &((struct zatm_pool_req __user *) arg)->pool_num))
 					return -EFAULT;
 				if (pool < 0 || pool > ZATM_LAST_POOL)
 					return -EINVAL;
 				if (copy_from_user(&info,
-				    &((struct zatm_pool_req *) arg)->info,
+				    &((struct zatm_pool_req __user *) arg)->info,
 				    sizeof(info))) return -EFAULT;
 				if (!info.low_water)
 					info.low_water = zatm_dev->
@@ -1504,14 +1504,14 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
 
 
 static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname,
-    void *optval,int optlen)
+    void __user *optval,int optlen)
 {
 	return -EINVAL;
 }
 
 
 static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname,
-    void *optval,int optlen)
+    void __user *optval,int optlen)
 {
 	return -EINVAL;
 }
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index ebb0ec31f..b40af6a72 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -451,7 +451,11 @@ int bus_add_driver(struct device_driver * drv)
 
 	if (bus) {
 		pr_debug("bus %s: add driver %s\n",bus->name,drv->name);
-		kobject_set_name(&drv->kobj,drv->name);
+		error = kobject_set_name(&drv->kobj,drv->name);
+		if (error) {
+			put_bus(bus);
+			return error;
+		}
 		drv->kobj.kset = &bus->drivers;
 		if ((error = kobject_register(&drv->kobj))) {
 			put_bus(bus);
@@ -555,21 +559,39 @@ struct bus_type * find_bus(char * name)
  */
 int bus_register(struct bus_type * bus)
 {
-	kobject_set_name(&bus->subsys.kset.kobj,bus->name);
+	int retval;
+
+	retval = kobject_set_name(&bus->subsys.kset.kobj,bus->name);
+	if (retval)
+		goto out;
+
 	subsys_set_kset(bus,bus_subsys);
-	subsystem_register(&bus->subsys);
+	retval = subsystem_register(&bus->subsys);
+	if (retval) 
+		goto out;
 
 	kobject_set_name(&bus->devices.kobj, "devices");
 	bus->devices.subsys = &bus->subsys;
-	kset_register(&bus->devices);
+	retval = kset_register(&bus->devices);
+	if (retval)
+		goto bus_devices_fail;
 
 	kobject_set_name(&bus->drivers.kobj, "drivers");
 	bus->drivers.subsys = &bus->subsys;
 	bus->drivers.ktype = &ktype_driver;
-	kset_register(&bus->drivers);
+	retval = kset_register(&bus->drivers);
+	if (retval)
+		goto bus_drivers_fail;
 
 	pr_debug("bus type '%s' registered\n",bus->name);
 	return 0;
+
+bus_drivers_fail:
+	kset_unregister(&bus->devices);
+bus_devices_fail:
+	subsystem_unregister(&bus->subsys);
+out:
+	return retval;
 }
 
 
diff --git a/drivers/base/class.c b/drivers/base/class.c
index b9fdce488..ed13d9de0 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -361,6 +361,8 @@ void class_device_unregister(struct class_device *class_dev)
 
 int class_device_rename(struct class_device *class_dev, char *new_name)
 {
+	int error = 0;
+
 	class_dev = class_device_get(class_dev);
 	if (!class_dev)
 		return -EINVAL;
@@ -370,11 +372,11 @@ int class_device_rename(struct class_device *class_dev, char *new_name)
 
 	strlcpy(class_dev->class_id, new_name, KOBJ_NAME_LEN);
 
-	kobject_rename(&class_dev->kobj, new_name);
+	error = kobject_rename(&class_dev->kobj, new_name);
 
 	class_device_put(class_dev);
 
-	return 0;
+	return error;
 }
 
 struct class_device * class_device_get(struct class_device *class_dev)
diff --git a/drivers/base/map.c b/drivers/base/map.c
index 1effe3a30..aab93fc2a 100644
--- a/drivers/base/map.c
+++ b/drivers/base/map.c
@@ -138,6 +138,13 @@ struct kobj_map *kobj_map_init(kobj_probe_t *base_probe,
 	struct kobj_map *p = kmalloc(sizeof(struct kobj_map), GFP_KERNEL);
 	struct probe *base = kmalloc(sizeof(struct probe), GFP_KERNEL);
 	int i;
+
+	if ((p == NULL) || (base == NULL)) {
+		kfree(p);
+		kfree(base);
+		return NULL;
+	}
+
 	memset(base, 0, sizeof(struct probe));
 	base->dev = 1;
 	base->range = ~0;
diff --git a/drivers/base/node.c b/drivers/base/node.c
index a35701c4a..b5aa9dc6c 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -21,22 +21,30 @@ static ssize_t node_read_cpumap(struct sys_device * dev, char * buf)
 	cpumask_t mask = node_dev->cpumap;
 	int len;
 
-	/* FIXME - someone should pass us a buffer size (count) or
-	 * use seq_file or something to avoid buffer overrun risk. */
-	len = cpumask_scnprintf(buf, 99 /* XXX FIXME */, mask);
+	/* 2004/06/03: buf currently PAGE_SIZE, need > 1 char per 4 bits. */
+	BUILD_BUG_ON(NR_CPUS/4 > PAGE_SIZE/2);
+
+	len = cpumask_scnprintf(buf, PAGE_SIZE-1, mask);
 	len += sprintf(buf + len, "\n");
 	return len;
 }
 
 static SYSDEV_ATTR(cpumap,S_IRUGO,node_read_cpumap,NULL);
 
+/* Can be overwritten by architecture specific code. */
+int __attribute__((weak)) hugetlb_report_node_meminfo(int node, char *buf)
+{
+	return 0;
+}
+
 #define K(x) ((x) << (PAGE_SHIFT - 10))
 static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
 {
+	int n;
 	int nid = dev->id;
 	struct sysinfo i;
 	si_meminfo_node(&i, nid);
-	return sprintf(buf, "\n"
+	n = sprintf(buf, "\n"
 		       "Node %d MemTotal:     %8lu kB\n"
 		       "Node %d MemFree:      %8lu kB\n"
 		       "Node %d MemUsed:      %8lu kB\n"
@@ -51,10 +59,52 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
 		       nid, K(i.freehigh),
 		       nid, K(i.totalram-i.totalhigh),
 		       nid, K(i.freeram-i.freehigh));
+	n += hugetlb_report_node_meminfo(nid, buf + n);
+	return n;
 }
+
 #undef K 
 static SYSDEV_ATTR(meminfo,S_IRUGO,node_read_meminfo,NULL);
 
+static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
+{
+	unsigned long numa_hit, numa_miss, interleave_hit, numa_foreign;
+	unsigned long local_node, other_node;
+	int i, cpu;
+	pg_data_t *pg = NODE_DATA(dev->id);
+	numa_hit = 0;
+	numa_miss = 0;
+	interleave_hit = 0;
+	numa_foreign = 0;
+	local_node = 0;
+	other_node = 0;
+	for (i = 0; i < MAX_NR_ZONES; i++) {
+		struct zone *z = &pg->node_zones[i];
+		for (cpu = 0; cpu < NR_CPUS; cpu++) {
+			struct per_cpu_pageset *ps = &z->pageset[cpu];
+			numa_hit += ps->numa_hit;
+			numa_miss += ps->numa_miss;
+			numa_foreign += ps->numa_foreign;
+			interleave_hit += ps->interleave_hit;
+			local_node += ps->local_node;
+			other_node += ps->other_node;
+		}
+	}
+	return sprintf(buf,
+		       "numa_hit %lu\n"
+		       "numa_miss %lu\n"
+		       "numa_foreign %lu\n"
+		       "interleave_hit %lu\n"
+		       "local_node %lu\n"
+		       "other_node %lu\n",
+		       numa_hit,
+		       numa_miss,
+		       numa_foreign,
+		       interleave_hit,
+		       local_node,
+		       other_node);
+}
+static SYSDEV_ATTR(numastat,S_IRUGO,node_read_numastat,NULL);
 
 /*
  * register_node - Setup a driverfs device for a node.
@@ -74,6 +124,7 @@ int __init register_node(struct node *node, int num, struct node *parent)
 	if (!error){
 		sysdev_create_file(&node->sysdev, &attr_cpumap);
 		sysdev_create_file(&node->sysdev, &attr_meminfo);
+		sysdev_create_file(&node->sysdev, &attr_numastat);
 	}
 	return error;
 }
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index e55900732..0d75909a4 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -57,8 +57,9 @@ void platform_device_unregister(struct platform_device * pdev)
  *	type of device, like "pci" or "floppy", and <instance> is the 
  *	enumerated instance of the device, like '0' or '42'.
  *	Driver IDs are simply "<name>". 
- *	So, extract the <name> from the device, and compare it against 
- *	the name of the driver. Return whether they match or not.
+ *	So, extract the <name> from the platform_device structure, 
+ *	and compare it against the name of the driver. Return whether 
+ *	they match or not.
  */
 
 static int platform_match(struct device * dev, struct device_driver * drv)
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 637c52ad6..21d4b56de 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -35,7 +35,10 @@ void dpm_resume(void)
 		struct list_head * entry = dpm_off.next;
 		struct device * dev = to_device(entry);
 		list_del_init(entry);
-		resume_device(dev);
+
+		if (!dev->power.prev_state)
+			resume_device(dev);
+
 		list_add_tail(entry,&dpm_active);
 	}
 }
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index d901a6fd6..4ff5340e9 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -12,9 +12,11 @@
 
 static void runtime_resume(struct device * dev)
 {
+	dev_dbg(dev, "resuming\n");
 	if (!dev->power.power_state)
 		return;
-	resume_device(dev);
+	if (!resume_device(dev))
+		dev->power.power_state = 0;
 }
 
 
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index 1164fcb7a..6725ffacb 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -34,8 +34,8 @@ int device_detach_shutdown(struct device * dev)
 
 
 /**
- * We handle system devices differently - we suspend and shut them 
- * down first and resume them first. That way, we do anything stupid like
+ * We handle system devices differently - we suspend and shut them
+ * down last and resume them first. That way, we don't do anything stupid like
  * shutting down the interrupt controller before any devices..
  *
  * Note that there are not different stages for power management calls - 
@@ -45,7 +45,7 @@ int device_detach_shutdown(struct device * dev)
 extern int sysdev_shutdown(void);
 
 /**
- * device_shutdown - call ->remove() on each device to shutdown. 
+ * device_shutdown - call ->shutdown() on each device to shutdown.
  */
 void device_shutdown(void)
 {
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index 19e660a21..a2bc41cc9 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -39,16 +39,13 @@ int suspend_device(struct device * dev, u32 state)
 {
 	int error = 0;
 
-	if (dev->bus && dev->bus->suspend)
+	dev_dbg(dev, "suspending\n");
+
+	dev->power.prev_state = dev->power.power_state;
+
+	if (dev->bus && dev->bus->suspend && !dev->power.power_state)
 		error = dev->bus->suspend(dev,state);
 
-	if (!error) {
-		list_del(&dev->power.entry);
-		list_add(&dev->power.entry,&dpm_off);
-	} else if (error == -EAGAIN) {
-		list_del(&dev->power.entry);
-		list_add(&dev->power.entry,&dpm_off_irq);
-	}
 	return error;
 }
 
@@ -81,11 +78,18 @@ int device_suspend(u32 state)
 	while(!list_empty(&dpm_active)) {
 		struct list_head * entry = dpm_active.prev;
 		struct device * dev = to_device(entry);
-		if ((error = suspend_device(dev,state))) {
-			if (error != -EAGAIN)
-				goto Error;
-			else
-				error = 0;
+		error = suspend_device(dev,state);
+
+		if (!error) {
+			list_del(&dev->power.entry);
+			list_add(&dev->power.entry,&dpm_off);
+		} else if (error == -EAGAIN) {
+			list_del(&dev->power.entry);
+			list_add(&dev->power.entry,&dpm_off_irq);
+		} else {
+			printk(KERN_ERR "Could not suspend device %s: "
+				"error %d\n", kobject_name(&dev->kobj), error);
+			goto Error;
 		}
 	}
  Done:
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 420cb3cf6..b0d55a930 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -180,8 +180,11 @@ int sysdev_register(struct sys_device * sysdev)
 
 	/* But make sure we point to the right type for sysfs translation */
 	sysdev->kobj.ktype = &ktype_sysdev;
-	kobject_set_name(&sysdev->kobj,"%s%d",
+	error = kobject_set_name(&sysdev->kobj,"%s%d",
 			 kobject_name(&cls->kset.kobj),sysdev->id);
+	if (error)
+		return error;
+
 	pr_debug("Registering sys device '%s'\n",kobject_name(&sysdev->kobj));
 
 	/* Register the object */
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 29035ddd3..56b9ce97c 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -97,7 +97,8 @@ static int DAC960_ioctl(struct inode *inode, struct file *file,
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	DAC960_Controller_T *p = disk->queue->queuedata;
 	int drive_nr = (long)disk->private_data;
-	struct hd_geometry g, *loc = (struct hd_geometry *)arg;
+	struct hd_geometry g;
+	struct hd_geometry __user *loc = (struct hd_geometry __user *)arg;
 
 	if (cmd != HDIO_GETGEO || !loc)
 		return -EINVAL;
@@ -6455,7 +6456,8 @@ static int DAC960_ProcReadUserCommand(char *Page, char **Start, off_t Offset,
   DAC960_ProcWriteUserCommand implements writing /proc/rd/cN/user_command.
 */
 
-static int DAC960_ProcWriteUserCommand(struct file *file, const char *Buffer,
+static int DAC960_ProcWriteUserCommand(struct file *file,
+				       const char __user *Buffer,
 				       unsigned long Count, void *Data)
 {
   DAC960_Controller_T *Controller = (DAC960_Controller_T *) Data;
@@ -6543,8 +6545,8 @@ static int DAC960_gam_ioctl(struct inode *inode, struct file *file,
       return DAC960_ControllerCount;
     case DAC960_IOCTL_GET_CONTROLLER_INFO:
       {
-	DAC960_ControllerInfo_T *UserSpaceControllerInfo =
-	  (DAC960_ControllerInfo_T *) Argument;
+	DAC960_ControllerInfo_T __user *UserSpaceControllerInfo =
+	  (DAC960_ControllerInfo_T __user *) Argument;
 	DAC960_ControllerInfo_T ControllerInfo;
 	DAC960_Controller_T *Controller;
 	int ControllerNumber;
@@ -6574,8 +6576,8 @@ static int DAC960_gam_ioctl(struct inode *inode, struct file *file,
       }
     case DAC960_IOCTL_V1_EXECUTE_COMMAND:
       {
-	DAC960_V1_UserCommand_T *UserSpaceUserCommand =
-	  (DAC960_V1_UserCommand_T *) Argument;
+	DAC960_V1_UserCommand_T __user *UserSpaceUserCommand =
+	  (DAC960_V1_UserCommand_T __user *) Argument;
 	DAC960_V1_UserCommand_T UserCommand;
 	DAC960_Controller_T *Controller;
 	DAC960_Command_T *Command = NULL;
@@ -6734,8 +6736,8 @@ static int DAC960_gam_ioctl(struct inode *inode, struct file *file,
       }
     case DAC960_IOCTL_V2_EXECUTE_COMMAND:
       {
-	DAC960_V2_UserCommand_T *UserSpaceUserCommand =
-	  (DAC960_V2_UserCommand_T *) Argument;
+	DAC960_V2_UserCommand_T __user *UserSpaceUserCommand =
+	  (DAC960_V2_UserCommand_T __user *) Argument;
 	DAC960_V2_UserCommand_T UserCommand;
 	DAC960_Controller_T *Controller;
 	DAC960_Command_T *Command = NULL;
@@ -6888,8 +6890,8 @@ static int DAC960_gam_ioctl(struct inode *inode, struct file *file,
       }
     case DAC960_IOCTL_V2_GET_HEALTH_STATUS:
       {
-	DAC960_V2_GetHealthStatus_T *UserSpaceGetHealthStatus =
-	  (DAC960_V2_GetHealthStatus_T *) Argument;
+	DAC960_V2_GetHealthStatus_T __user *UserSpaceGetHealthStatus =
+	  (DAC960_V2_GetHealthStatus_T __user *) Argument;
 	DAC960_V2_GetHealthStatus_T GetHealthStatus;
 	DAC960_V2_HealthStatusBuffer_T HealthStatusBuffer;
 	DAC960_Controller_T *Controller;
diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h
index 676c07808..be8f8992a 100644
--- a/drivers/block/DAC960.h
+++ b/drivers/block/DAC960.h
@@ -1914,8 +1914,8 @@ typedef struct DAC960_V1_UserCommand
   unsigned char ControllerNumber;
   DAC960_V1_CommandMailbox_T CommandMailbox;
   int DataTransferLength;
-  void *DataTransferBuffer;
-  DAC960_V1_DCDB_T *DCDB;
+  void __user *DataTransferBuffer;
+  DAC960_V1_DCDB_T __user *DCDB;
 }
 DAC960_V1_UserCommand_T;
 
@@ -1948,8 +1948,8 @@ typedef struct DAC960_V2_UserCommand
   DAC960_V2_CommandMailbox_T CommandMailbox;
   int DataTransferLength;
   int RequestSenseLength;
-  void *DataTransferBuffer;
-  void *RequestSenseBuffer;
+  void __user *DataTransferBuffer;
+  void __user *RequestSenseBuffer;
 }
 DAC960_V2_UserCommand_T;
 
@@ -1980,7 +1980,7 @@ DAC960_V2_KernelCommand_T;
 typedef struct DAC960_V2_GetHealthStatus
 {
   unsigned char ControllerNumber;
-  DAC960_V2_HealthStatusBuffer_T *HealthStatusBuffer;
+  DAC960_V2_HealthStatusBuffer_T __user *HealthStatusBuffer;
 }
 DAC960_V2_GetHealthStatus_T;
 
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 643fc4659..ecbc4e489 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -321,12 +321,13 @@ config BLK_DEV_RAM
 	  thus say N here.
 
 config BLK_DEV_RAM_SIZE
-	int "Default RAM disk size"
+	int "Default RAM disk size (kbytes)"
 	depends on BLK_DEV_RAM
 	default "4096"
 	help
-	  The default value is 4096. Only change this if you know what are
-	  you doing. If you are using IBM S/390, then set this to 8192.
+	  The default value is 4096 kilobytes. Only change this if you know
+	  what are you doing. If you are using IBM S/390, then set this to
+	  8192.
 
 config BLK_DEV_INITRD
 	bool "Initial RAM disk (initrd) support"
diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
index 5d13891ef..0ef6a665d 100644
--- a/drivers/block/as-iosched.c
+++ b/drivers/block/as-iosched.c
@@ -43,7 +43,7 @@
  * read_batch_expire describes how long we will allow a stream of reads to
  * persist before looking to see whether it is time to switch over to writes.
  */
-#define default_read_batch_expire (HZ / 4)
+#define default_read_batch_expire (HZ / 2)
 
 /*
  * write_batch_expire describes how long we want a stream of writes to run for.
@@ -51,7 +51,7 @@
  * See, the problem is: we can send a lot of writes to disk cache / TCQ in
  * a short amount of time...
  */
-#define default_write_batch_expire (HZ / 16)
+#define default_write_batch_expire (HZ / 8)
 
 /*
  * max time we may wait to anticipate a read (default around 6ms)
@@ -1216,13 +1216,12 @@ static void as_move_to_dispatch(struct as_data *ad, struct as_rq *arq)
 	}
 
 	as_remove_queued_request(ad->q, rq);
+	WARN_ON(arq->state != AS_RQ_QUEUED);
+
 	list_add(&rq->queuelist, insert);
+	arq->state = AS_RQ_DISPATCHED;
 	if (arq->io_context && arq->io_context->aic)
 		atomic_inc(&arq->io_context->aic->nr_dispatched);
-
-	WARN_ON(arq->state != AS_RQ_QUEUED);
-	arq->state = AS_RQ_DISPATCHED;
-
 	ad->nr_dispatched++;
 }
 
@@ -1492,6 +1491,21 @@ static void as_requeue_request(request_queue_t *q, struct request *rq)
 	as_antic_stop(ad);
 }
 
+/*
+ * Account a request that is inserted directly onto the dispatch queue.
+ * arq->io_context->aic->nr_dispatched should not need to be incremented
+ * because only new requests should come through here: requeues go through
+ * our explicit requeue handler.
+ */
+static void as_account_queued_request(struct as_data *ad, struct request *rq)
+{
+	if (blk_fs_request(rq)) {
+		struct as_rq *arq = RQ_DATA(rq);
+		arq->state = AS_RQ_DISPATCHED;
+		ad->nr_dispatched++;
+	}
+}
+
 static void
 as_insert_request(request_queue_t *q, struct request *rq, int where)
 {
@@ -1522,10 +1536,12 @@ as_insert_request(request_queue_t *q, struct request *rq, int where)
 				as_move_to_dispatch(ad, ad->next_arq[REQ_ASYNC]);
 
 			list_add_tail(&rq->queuelist, ad->dispatch);
+			as_account_queued_request(ad, rq);
 			as_antic_stop(ad);
 			break;
 		case ELEVATOR_INSERT_FRONT:
 			list_add(&rq->queuelist, ad->dispatch);
+			as_account_queued_request(ad, rq);
 			as_antic_stop(ad);
 			break;
 		case ELEVATOR_INSERT_SORT:
diff --git a/drivers/block/carmel.c b/drivers/block/carmel.c
index 81819216d..38fd6fe42 100644
--- a/drivers/block/carmel.c
+++ b/drivers/block/carmel.c
@@ -413,7 +413,7 @@ static unsigned long carm_major_alloc;
 static int carm_bdev_ioctl(struct inode *ino, struct file *fil,
 			   unsigned int cmd, unsigned long arg)
 {
-	void __user *usermem = (void *) arg;
+	void __user *usermem = (void __user *) arg;
 	struct carm_port *port = ino->i_bdev->bd_disk->private_data;
 	struct hd_geometry geom;
 
@@ -438,17 +438,6 @@ static int carm_bdev_ioctl(struct inode *ino, struct file *fil,
 	return -EOPNOTSUPP;
 }
 
-static inline unsigned long msecs_to_jiffies(unsigned long msecs)
-{
-	return ((HZ * msecs + 999) / 1000);
-}
-
-static void msleep(unsigned long msecs)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(msecs_to_jiffies(msecs));
-}
-
 static const u32 msg_sizes[] = { 32, 64, 128, CARM_MSG_SIZE };
 
 static inline int carm_lookup_bucket(u32 msg_size)
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index b22099f1f..0d45b81e1 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -135,7 +135,6 @@ static int register_new_disk(ctlr_info_t *h);
 
 static void cciss_getgeometry(int cntl_num);
 
-static inline void addQ(CommandList_struct **Qptr, CommandList_struct *c);
 static void start_io( ctlr_info_t *h);
 static int sendcmd( __u8 cmd, int ctlr, void *buff, size_t size,
 	unsigned int use_unit_num, unsigned int log_unit, __u8 page_code,
@@ -157,6 +156,36 @@ static struct block_device_operations cciss_fops  = {
 	.revalidate_disk= cciss_revalidate,
 };
 
+/*
+ * Enqueuing and dequeuing functions for cmdlists.
+ */
+static inline void addQ(CommandList_struct **Qptr, CommandList_struct *c)
+{
+        if (*Qptr == NULL) {
+                *Qptr = c;
+                c->next = c->prev = c;
+        } else {
+                c->prev = (*Qptr)->prev;
+                c->next = (*Qptr);
+                (*Qptr)->prev->next = c;
+                (*Qptr)->prev = c;
+        }
+}
+
+static inline CommandList_struct *removeQ(CommandList_struct **Qptr, 
+						CommandList_struct *c)
+{
+        if (c && c->next != c) {
+                if (*Qptr == c) *Qptr = c->next;
+                c->prev->next = c->next;
+                c->next->prev = c->prev;
+        } else {
+                *Qptr = NULL;
+        }
+        return c;
+}
+#ifdef CONFIG_PROC_FS
+
 #include "cciss_scsi.c"		/* For SCSI tape support */
 
 /*
@@ -167,7 +196,6 @@ static struct block_device_operations cciss_fops  = {
 #define RAID_UNKNOWN 6
 static const char *raid_label[] = {"0","4","1(0+1)","5","5+1","ADG",
 	                                   "UNKNOWN"};
-#ifdef CONFIG_PROC_FS
 
 static struct proc_dir_entry *proc_cciss;
 
@@ -257,7 +285,7 @@ static int cciss_proc_get_info(char *buffer, char **start, off_t offset,
 }
 
 static int 
-cciss_proc_write(struct file *file, const char *buffer, 
+cciss_proc_write(struct file *file, const char __user *buffer, 
 			unsigned long count, void *data)
 {
 	unsigned char cmd[80];
@@ -462,6 +490,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 	ctlr_info_t *host = get_host(disk);
 	drive_info_struct *drv = get_drv(disk);
 	int ctlr = host->ctlr;
+	void __user *argp = (void __user *)arg;
 
 #ifdef CCISS_DEBUG
 	printk(KERN_DEBUG "cciss_ioctl: Called with cmd=%x %lx\n", cmd, arg);
@@ -478,8 +507,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
                 } else
 			return -ENXIO;
                 driver_geo.start= get_start_sect(inode->i_bdev);
-                if (copy_to_user((void *) arg, &driver_geo,
-                                sizeof( struct hd_geometry)))
+                if (copy_to_user(argp, &driver_geo, sizeof(struct hd_geometry)))
                         return  -EFAULT;
                 return(0);
 	}
@@ -492,7 +520,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		pciinfo.bus = host->pdev->bus->number;
 		pciinfo.dev_fn = host->pdev->devfn;
 		pciinfo.board_id = host->board_id;
-		if (copy_to_user((void *) arg, &pciinfo,  sizeof( cciss_pci_info_struct )))
+		if (copy_to_user(argp, &pciinfo,  sizeof( cciss_pci_info_struct )))
 			return  -EFAULT;
 		return(0);
 	}	
@@ -502,7 +530,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		if (!arg) return -EINVAL;
 		intinfo.delay = readl(&host->cfgtable->HostWrite.CoalIntDelay);
 		intinfo.count = readl(&host->cfgtable->HostWrite.CoalIntCount);
-		if (copy_to_user((void *) arg, &intinfo, sizeof( cciss_coalint_struct )))
+		if (copy_to_user(argp, &intinfo, sizeof( cciss_coalint_struct )))
 			return -EFAULT;
                 return(0);
         }
@@ -514,7 +542,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 
 		if (!arg) return -EINVAL;	
 		if (!capable(CAP_SYS_ADMIN)) return -EPERM;
-		if (copy_from_user(&intinfo, (void *) arg, sizeof( cciss_coalint_struct)))
+		if (copy_from_user(&intinfo, argp, sizeof( cciss_coalint_struct)))
 			return -EFAULT;
 		if ( (intinfo.delay == 0 ) && (intinfo.count == 0))
 
@@ -550,7 +578,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		if (!arg) return -EINVAL;
 		for(i=0;i<16;i++)
 			NodeName[i] = readb(&host->cfgtable->ServerName[i]);
-                if (copy_to_user((void *) arg, NodeName, sizeof( NodeName_type)))
+                if (copy_to_user(argp, NodeName, sizeof( NodeName_type)))
                 	return  -EFAULT;
                 return(0);
         }
@@ -563,7 +591,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		if (!arg) return -EINVAL;
 		if (!capable(CAP_SYS_ADMIN)) return -EPERM;
 		
-		if (copy_from_user(NodeName, (void *) arg, sizeof( NodeName_type)))
+		if (copy_from_user(NodeName, argp, sizeof( NodeName_type)))
 			return -EFAULT;
 
 		spin_lock_irqsave(CCISS_LOCK(ctlr), flags);
@@ -593,7 +621,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 
 		if (!arg) return -EINVAL;
                 heartbeat = readl(&host->cfgtable->HeartBeat);
-                if (copy_to_user((void *) arg, &heartbeat, sizeof( Heartbeat_type)))
+                if (copy_to_user(argp, &heartbeat, sizeof( Heartbeat_type)))
                 	return -EFAULT;
                 return(0);
         }
@@ -603,7 +631,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 
 		if (!arg) return -EINVAL;
                 BusTypes = readl(&host->cfgtable->BusTypes);
-                if (copy_to_user((void *) arg, &BusTypes, sizeof( BusTypes_type) ))
+                if (copy_to_user(argp, &BusTypes, sizeof( BusTypes_type) ))
                 	return  -EFAULT;
                 return(0);
         }
@@ -614,7 +642,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		if (!arg) return -EINVAL;
 		memcpy(firmware, host->firm_ver, 4);
 
-                if (copy_to_user((void *) arg, firmware, sizeof( FirmwareVer_type)))
+                if (copy_to_user(argp, firmware, sizeof( FirmwareVer_type)))
                 	return -EFAULT;
                 return(0);
         }
@@ -624,7 +652,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 
                 if (!arg) return -EINVAL;
 
-                if (copy_to_user((void *) arg, &DriverVer, sizeof( DriverVer_type) ))
+                if (copy_to_user(argp, &DriverVer, sizeof( DriverVer_type) ))
                 	return -EFAULT;
                 return(0);
         }
@@ -648,7 +676,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 			if (disk->part[i]->nr_sects != 0)
 				luninfo.num_parts++;
 		}
- 		if (copy_to_user((void *) arg, &luninfo,
+ 		if (copy_to_user(argp, &luninfo,
  				sizeof(LogvolInfo_struct)))
  			return -EFAULT;
  		return(0);
@@ -672,7 +700,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 	
 		if (!capable(CAP_SYS_RAWIO)) return -EPERM;
 
-		if (copy_from_user(&iocommand, (void *) arg, sizeof( IOCTL_Command_struct) ))
+		if (copy_from_user(&iocommand, argp, sizeof( IOCTL_Command_struct) ))
 			return -EFAULT;
 		if((iocommand.buf_size < 1) && 
 				(iocommand.Request.Type.Direction != XFER_NONE))
@@ -753,7 +781,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 
 		/* Copy the error information out */ 
 		iocommand.error_info = *(c->err_info);
-		if ( copy_to_user((void *) arg, &iocommand, sizeof( IOCTL_Command_struct) ) )
+		if ( copy_to_user(argp, &iocommand, sizeof( IOCTL_Command_struct) ) )
 		{
 			kfree(buff);
 			cmd_free(host, c, 0);
@@ -787,7 +815,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		DECLARE_COMPLETION(wait);
 		__u32   left;
 		__u32	sz;
-		BYTE    *data_ptr;
+		BYTE    __user *data_ptr;
 
 		if (!arg)
 			return -EINVAL;
@@ -799,7 +827,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 			status = -ENOMEM;
 			goto cleanup1;
 		}
-		if (copy_from_user(ioc, (void *) arg, sizeof(*ioc))) {
+		if (copy_from_user(ioc, argp, sizeof(*ioc))) {
 			status = -EFAULT;
 			goto cleanup1;
 		}
@@ -831,7 +859,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 			goto cleanup1;
 		}
 		left = ioc->buf_size;
-		data_ptr = (BYTE *) ioc->buf;
+		data_ptr = ioc->buf;
 		while (left) {
 			sz = (left > ioc->malloc_size) ? ioc->malloc_size : left;
 			buff_size[sg_used] = sz;
@@ -896,14 +924,14 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
 		}
 		/* Copy the error information out */
 		ioc->error_info = *(c->err_info);
-		if (copy_to_user((void *) arg, ioc, sizeof(*ioc))) {
+		if (copy_to_user(argp, ioc, sizeof(*ioc))) {
 			cmd_free(host, c, 0);
 			status = -EFAULT;
 			goto cleanup1;
 		}
 		if (ioc->Request.Type.Direction == XFER_READ) {
 			/* Copy the data out of the buffer we created */
-			BYTE *ptr = (BYTE  *) ioc->buf;
+			BYTE __user *ptr = ioc->buf;
 	        	for(i=0; i< sg_used; i++) {
 				if (copy_to_user(ptr, buff[i], buff_size[i])) {
 					cmd_free(host, c, 0);
@@ -1685,35 +1713,6 @@ static ulong remap_pci_mem(ulong base, ulong size)
         return (ulong) (page_remapped ? (page_remapped + page_offs) : 0UL);
 }
 
-/*
- * Enqueuing and dequeuing functions for cmdlists.
- */
-static inline void addQ(CommandList_struct **Qptr, CommandList_struct *c)
-{
-        if (*Qptr == NULL) {
-                *Qptr = c;
-                c->next = c->prev = c;
-        } else {
-                c->prev = (*Qptr)->prev;
-                c->next = (*Qptr);
-                (*Qptr)->prev->next = c;
-                (*Qptr)->prev = c;
-        }
-}
-
-static inline CommandList_struct *removeQ(CommandList_struct **Qptr, 
-						CommandList_struct *c)
-{
-        if (c && c->next != c) {
-                if (*Qptr == c) *Qptr = c->next;
-                c->prev->next = c->next;
-                c->next->prev = c->prev;
-        } else {
-                *Qptr = NULL;
-        }
-        return c;
-}
-
 /* 
  * Takes jobs of the Q and sends them to the hardware, then puts it on 
  * the Q to wait for completion. 
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 53e90fcbc..b42a8d33f 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -418,7 +418,8 @@ static int cpqarray_register_ctlr( int i, struct pci_dev *pdev)
 	}
 	hba[i]->access.set_intr_mask(hba[i], 0);
 	if (request_irq(hba[i]->intr, do_ida_intr,
-		SA_INTERRUPT|SA_SHIRQ, hba[i]->devname, hba[i]))
+		SA_INTERRUPT|SA_SHIRQ|SA_SAMPLE_RANDOM,
+		hba[i]->devname, hba[i]))
 	{
 		printk(KERN_ERR "cpqarray: Unable to get irq %d for %s\n",
 				hba[i]->intr, hba[i]->devname);
@@ -1156,8 +1157,8 @@ static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 	ctlr_info_t *host = get_host(inode->i_bdev->bd_disk);
 	int error;
 	int diskinfo[4];
-	struct hd_geometry *geo = (struct hd_geometry *)arg;
-	ida_ioctl_t *io = (ida_ioctl_t*)arg;
+	struct hd_geometry __user *geo = (struct hd_geometry __user *)arg;
+	ida_ioctl_t __user *io = (ida_ioctl_t __user *)arg;
 	ida_ioctl_t *my_io;
 
 	switch(cmd) {
@@ -1193,7 +1194,7 @@ static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 		if (error)
 			goto out_passthru;
 		error = -EFAULT;
-		if (copy_to_user(io, &my_io, sizeof(*my_io)))
+		if (copy_to_user(io, my_io, sizeof(*my_io)))
 			goto out_passthru;
 		error = 0;
 out_passthru:
@@ -1201,7 +1202,7 @@ out_passthru:
 		return error;
 	case IDAGETCTLRSIG:
 		if (!arg) return -EINVAL;
-		put_user(host->ctlr_sig, (int*)arg);
+		put_user(host->ctlr_sig, (int __user *)arg);
 		return 0;
 	case IDAREVALIDATEVOLS:
 		if (iminor(inode) != 0)
@@ -1209,7 +1210,7 @@ out_passthru:
 		return revalidate_allvol(host);
 	case IDADRIVERVERSION:
 		if (!arg) return -EINVAL;
-		put_user(DRIVER_VERSION, (unsigned long*)arg);
+		put_user(DRIVER_VERSION, (unsigned long __user *)arg);
 		return 0;
 	case IDAGETPCIINFO:
 	{
@@ -1220,7 +1221,7 @@ out_passthru:
 		pciinfo.bus = host->pci_dev->bus->number;
 		pciinfo.dev_fn = host->pci_dev->devfn;
 		pciinfo.board_id = host->board_id;
-		if(copy_to_user((void *) arg, &pciinfo,  
+		if(copy_to_user((void __user *) arg, &pciinfo,  
 			sizeof( ida_pci_info_struct)))
 				return -EFAULT;
 		return(0);
@@ -1271,7 +1272,7 @@ static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io)
 			cmd_free(h, c, 0); 
 			return(error);
 		}
-		if (copy_from_user(p, (void*)io->sg[0].addr, io->sg[0].size)) {
+		if (copy_from_user(p, io->sg[0].addr, io->sg[0].size)) {
 			kfree(p);
 			cmd_free(h, c, 0); 
 			return -EFAULT;
@@ -1312,7 +1313,7 @@ static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io)
                         cmd_free(h, c, 0);
                         return(error);
                 }
-		if (copy_from_user(p, (void*)io->sg[0].addr, io->sg[0].size)) {
+		if (copy_from_user(p, io->sg[0].addr, io->sg[0].size)) {
 			kfree(p);
                         cmd_free(h, c, 0);
 			return -EFAULT;
@@ -1353,7 +1354,7 @@ static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io)
 	case DIAG_PASS_THRU:
 	case SENSE_CONTROLLER_PERFORMANCE:
 	case READ_FLASH_ROM:
-		if (copy_to_user((void*)io->sg[0].addr, p, io->sg[0].size)) {
+		if (copy_to_user(io->sg[0].addr, p, io->sg[0].size)) {
 			kfree(p);
 			return -EFAULT;
 		}
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c
index c42fd0ddd..4ce5ca130 100644
--- a/drivers/block/elevator.c
+++ b/drivers/block/elevator.c
@@ -169,6 +169,13 @@ void elv_requeue_request(request_queue_t *q, struct request *rq)
 void __elv_add_request(request_queue_t *q, struct request *rq, int where,
 		       int plug)
 {
+	/*
+	 * barriers implicitly indicate back insertion
+	 */
+	if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER) &&
+	    where == ELEVATOR_INSERT_SORT)
+		where = ELEVATOR_INSERT_BACK;
+
 	if (plug)
 		blk_plug_device(q);
 
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 2ef418b07..70375a056 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -604,28 +604,27 @@ static inline int fd_eject(int drive)
 }
 #endif
 
-#ifdef DEBUGT
-static long unsigned debugtimer;
-#endif
-
 /*
  * Debugging
  * =========
  */
+#ifdef DEBUGT
+static long unsigned debugtimer;
+
 static inline void set_debugt(void)
 {
-#ifdef DEBUGT
 	debugtimer = jiffies;
-#endif
 }
 
 static inline void debugt(const char *message)
 {
-#ifdef DEBUGT
 	if (DP->flags & DEBUGT)
 		printk("%s dtime=%lu\n", message, jiffies - debugtimer);
-#endif
 }
+#else
+static inline void set_debugt(void) { }
+static inline void debugt(const char *message) { }
+#endif /* DEBUGT */
 
 typedef void (*timeout_fn) (unsigned long);
 static struct timer_list fd_timeout = TIMER_INITIALIZER(floppy_shutdown, 0, 0);
@@ -1546,9 +1545,8 @@ static void setup_rw_floppy(void)
 	for (i = 0; i < raw_cmd->cmd_count; i++)
 		r |= output_byte(raw_cmd->cmd[i]);
 
-#ifdef DEBUGT
 	debugt("rw_command: ");
-#endif
+
 	if (r) {
 		cont->error();
 		reset_fdc();
@@ -1570,9 +1568,7 @@ static int blind_seek;
  */
 static void seek_interrupt(void)
 {
-#ifdef DEBUGT
 	debugt("seek interrupt:");
-#endif
 	if (inr != 2 || (ST0 & 0xF8) != 0x20) {
 		DPRINT("seek failed\n");
 		DRS->track = NEED_2_RECAL;
@@ -1676,24 +1672,18 @@ static void seek_floppy(void)
 	output_byte(FD_SEEK);
 	output_byte(UNIT(current_drive));
 	LAST_OUT(track);
-#ifdef DEBUGT
 	debugt("seek command:");
-#endif
 }
 
 static void recal_interrupt(void)
 {
-#ifdef DEBUGT
 	debugt("recal interrupt:");
-#endif
 	if (inr != 2)
 		FDCS->reset = 1;
 	else if (ST0 & ST0_ECE) {
 		switch (DRS->track) {
 		case NEED_1_RECAL:
-#ifdef DEBUGT
 			debugt("recal interrupt need 1 recal:");
-#endif
 			/* after a second recalibrate, we still haven't
 			 * reached track 0. Probably no drive. Raise an
 			 * error, as failing immediately might upset
@@ -1702,9 +1692,7 @@ static void recal_interrupt(void)
 			cont->redo();
 			return;
 		case NEED_2_RECAL:
-#ifdef DEBUGT
 			debugt("recal interrupt need 2 recal:");
-#endif
 			/* If we already did a recalibrate,
 			 * and we are not at track 0, this
 			 * means we have moved. (The only way
@@ -1722,9 +1710,7 @@ static void recal_interrupt(void)
 			DRS->select_date = jiffies;
 			/* fall through */
 		default:
-#ifdef DEBUGT
 			debugt("recal interrupt default:");
-#endif
 			/* Recalibrate moves the head by at
 			 * most 80 steps. If after one
 			 * recalibrate we don't have reached
@@ -1813,9 +1799,7 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static void recalibrate_floppy(void)
 {
-#ifdef DEBUGT
 	debugt("recalibrate floppy:");
-#endif
 	do_floppy = recal_interrupt;
 	output_byte(FD_RECALIBRATE);
 	LAST_OUT(UNIT(current_drive));
@@ -1826,9 +1810,7 @@ static void recalibrate_floppy(void)
  */
 static void reset_interrupt(void)
 {
-#ifdef DEBUGT
 	debugt("reset interrupt:");
-#endif
 	result();		/* get the status ready for set_fdc */
 	if (FDCS->reset) {
 		printk("reset set in interrupt, calling %p\n", cont->error);
@@ -2266,9 +2248,7 @@ static void redo_format(void)
 	buffer_track = -1;
 	setup_format_params(format_req.track << STRETCH(_floppy));
 	floppy_start();
-#ifdef DEBUGT
 	debugt("queue format request");
-#endif
 }
 
 static struct cont_t format_cont = {
@@ -2992,9 +2972,7 @@ static void redo_fd_request(void)
 		if (TESTF(FD_NEED_TWADDLE))
 			twaddle();
 		schedule_bh(floppy_start);
-#ifdef DEBUGT
 		debugt("queue fd request");
-#endif
 		return;
 	}
 #undef REPEAT
@@ -3101,19 +3079,19 @@ static int user_reset_fdc(int drive, int arg, int interruptible)
  * Misc Ioctl's and support
  * ========================
  */
-static inline int fd_copyout(void *param, const void *address,
+static inline int fd_copyout(void __user *param, const void *address,
 			     unsigned long size)
 {
 	return copy_to_user(param, address, size) ? -EFAULT : 0;
 }
 
-static inline int fd_copyin(void *param, void *address, unsigned long size)
+static inline int fd_copyin(void __user *param, void *address, unsigned long size)
 {
 	return copy_from_user(address, param, size) ? -EFAULT : 0;
 }
 
-#define _COPYOUT(x) (copy_to_user((void *)param, &(x), sizeof(x)) ? -EFAULT : 0)
-#define _COPYIN(x) (copy_from_user(&(x), (void *)param, sizeof(x)) ? -EFAULT : 0)
+#define _COPYOUT(x) (copy_to_user((void __user *)param, &(x), sizeof(x)) ? -EFAULT : 0)
+#define _COPYIN(x) (copy_from_user(&(x), (void __user *)param, sizeof(x)) ? -EFAULT : 0)
 
 #define COPYOUT(x) ECALL(_COPYOUT(x))
 #define COPYIN(x) ECALL(_COPYIN(x))
@@ -3188,7 +3166,7 @@ static struct cont_t raw_cmd_cont = {
 	.done		= raw_cmd_done
 };
 
-static inline int raw_cmd_copyout(int cmd, char *param,
+static inline int raw_cmd_copyout(int cmd, char __user *param,
 				  struct floppy_raw_cmd *ptr)
 {
 	int ret;
@@ -3226,7 +3204,7 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr)
 	}
 }
 
-static inline int raw_cmd_copyin(int cmd, char *param,
+static inline int raw_cmd_copyin(int cmd, char __user *param,
 				 struct floppy_raw_cmd **rcmd)
 {
 	struct floppy_raw_cmd *ptr;
@@ -3280,7 +3258,7 @@ static inline int raw_cmd_copyin(int cmd, char *param,
 	}
 }
 
-static int raw_cmd_ioctl(int cmd, void *param)
+static int raw_cmd_ioctl(int cmd, void __user *param)
 {
 	int drive, ret, ret2;
 	struct floppy_raw_cmd *my_raw_cmd;
@@ -3530,7 +3508,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 	/* copyin */
 	CLEARSTRUCT(&inparam);
 	if (_IOC_DIR(cmd) & _IOC_WRITE)
-	    ECALL(fd_copyin((void *)param, &inparam, size))
+	    ECALL(fd_copyin((void __user *)param, &inparam, size))
 
 		switch (cmd) {
 		case FDEJECT:
@@ -3626,7 +3604,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 				return -EINVAL;
 			LOCK_FDC(drive, 1);
 			set_floppy(drive);
-			CALL(i = raw_cmd_ioctl(cmd, (void *)param));
+			CALL(i = raw_cmd_ioctl(cmd, (void __user *)param));
 			process_fd_request();
 			return i;
 
@@ -3641,7 +3619,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 		}
 
 	if (_IOC_DIR(cmd) & _IOC_READ)
-		return fd_copyout((void *)param, outparam, size);
+		return fd_copyout((void __user *)param, outparam, size);
 	else
 		return 0;
 #undef OUT
@@ -4247,35 +4225,40 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data)
 int __init floppy_init(void)
 {
 	int i, unit, drive;
-	int err;
+	int err, dr;
 
 	raw_cmd = NULL;
+	i = 0;
 
-	for (i = 0; i < N_DRIVE; i++) {
-		disks[i] = alloc_disk(1);
-		if (!disks[i])
-			goto Enomem;
+	for (dr = 0; dr < N_DRIVE; dr++) {
+		disks[dr] = alloc_disk(1);
+		if (!disks[dr]) {
+			err = -ENOMEM;
+			goto out_put_disk;
+		}
 
-		disks[i]->major = FLOPPY_MAJOR;
-		disks[i]->first_minor = TOMINOR(i);
-		disks[i]->fops = &floppy_fops;
-		sprintf(disks[i]->disk_name, "fd%d", i);
+		disks[dr]->major = FLOPPY_MAJOR;
+		disks[dr]->first_minor = TOMINOR(dr);
+		disks[dr]->fops = &floppy_fops;
+		sprintf(disks[dr]->disk_name, "fd%d", dr);
 
-		init_timer(&motor_off_timer[i]);
-		motor_off_timer[i].data = i;
-		motor_off_timer[i].function = motor_off_callback;
+		init_timer(&motor_off_timer[dr]);
+		motor_off_timer[dr].data = dr;
+		motor_off_timer[dr].function = motor_off_callback;
 	}
 
 	devfs_mk_dir("floppy");
-	if ((err = register_blkdev(FLOPPY_MAJOR, "fd")))
-		goto out;
+
+	err = register_blkdev(FLOPPY_MAJOR, "fd");
+	if (err)
+		goto out_devfs_remove;
 
 	floppy_queue = blk_init_queue(do_fd_request, &floppy_lock);
-	blk_queue_max_sectors(floppy_queue, 64);
 	if (!floppy_queue) {
 		err = -ENOMEM;
-		goto fail_queue;
+		goto out_unreg_blkdev;
 	}
+	blk_queue_max_sectors(floppy_queue, 64);
 
 	blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
 			    floppy_find, NULL, NULL);
@@ -4306,17 +4289,20 @@ int __init floppy_init(void)
 	use_virtual_dma = can_use_virtual_dma & 1;
 	fdc_state[0].address = FDC1;
 	if (fdc_state[0].address == -1) {
+		del_timer(&fd_timeout);
 		err = -ENODEV;
-		goto out1;
+		goto out_unreg_region;
 	}
 #if N_FDC > 1
 	fdc_state[1].address = FDC2;
 #endif
 
 	fdc = 0;		/* reset fdc in case of unexpected interrupt */
-	if (floppy_grab_irq_and_dma()) {
+	err = floppy_grab_irq_and_dma();
+	if (err) {
+		del_timer(&fd_timeout);
 		err = -EBUSY;
-		goto out1;
+		goto out_unreg_region;
 	}
 
 	/* initialise drive state */
@@ -4373,11 +4359,8 @@ int __init floppy_init(void)
 	initialising = 0;
 	if (have_no_fdc) {
 		DPRINT("no floppy controllers found\n");
-		flush_scheduled_work();
-		if (usage_count)
-			floppy_release_irq_and_dma();
 		err = have_no_fdc;
-		goto out2;
+		goto out_flush_work;
 	}
 
 	for (drive = 0; drive < N_DRIVE; drive++) {
@@ -4392,26 +4375,37 @@ int __init floppy_init(void)
 		add_disk(disks[drive]);
 	}
 
-	platform_device_register(&floppy_device);
+	err = platform_device_register(&floppy_device);
+	if (err)
+		goto out_del_disk;
+
 	return 0;
 
-out1:
-	del_timer(&fd_timeout);
-out2:
+out_del_disk:
+	for (drive = 0; drive < N_DRIVE; drive++) {
+		if (!(allowed_drive_mask & (1 << drive)))
+			continue;
+		if (fdc_state[FDC(drive)].version == FDC_NONE)
+			continue;
+		del_gendisk(disks[drive]);
+	}
+out_flush_work:
+	flush_scheduled_work();
+	if (usage_count)
+		floppy_release_irq_and_dma();
+out_unreg_region:
 	blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
 	blk_cleanup_queue(floppy_queue);
-fail_queue:
+out_unreg_blkdev:
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
-out:
-	for (i = 0; i < N_DRIVE; i++)
-		put_disk(disks[i]);
+out_devfs_remove:
 	devfs_remove("floppy");
+out_put_disk:
+	while (dr--) {
+		del_timer(&motor_off_timer[dr]);
+		put_disk(disks[dr]);
+	}
 	return err;
-
-Enomem:
-	while (i--)
-		put_disk(disks[i]);
-	return -ENOMEM;
 }
 
 static spinlock_t floppy_usage_lock = SPIN_LOCK_UNLOCKED;
diff --git a/drivers/block/floppy98.c b/drivers/block/floppy98.c
index 81b28c1b7..95031f1e8 100644
--- a/drivers/block/floppy98.c
+++ b/drivers/block/floppy98.c
@@ -704,15 +704,16 @@ static int output_log_pos;
 
 static void reschedule_timeout(int drive, const char *message, int marg)
 {
+	unsigned long delay;
+
 	if (drive == current_reqD)
 		drive = current_drive;
-	del_timer(&fd_timeout);
 	if (drive < 0 || drive > N_DRIVE) {
-		fd_timeout.expires = jiffies + 20UL*HZ;
+		delay = 20UL*HZ;
 		drive=0;
 	} else
-		fd_timeout.expires = jiffies + UDP->timeout;
-	add_timer(&fd_timeout);
+		delay = UDP->timeout;
+	mod_timer(&fd_timeout, delay + jiffies);
 	if (UDP->flags & FD_DEBUG){
 		DPRINT("reschedule timeout ");
 		printk(message, marg);
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index a0d7ef607..2c849532f 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -357,16 +357,6 @@ static ssize_t disk_size_read(struct gendisk * disk, char *page)
 	return sprintf(page, "%llu\n", (unsigned long long)get_capacity(disk));
 }
 
-static inline unsigned jiffies_to_msec(unsigned jif)
-{
-#if 1000 % HZ == 0
-	return jif * (1000 / HZ);
-#elif HZ % 1000 == 0
-	return jif / (HZ / 1000);
-#else
-	return (jif / HZ) * 1000 + (jif % HZ) * 1000 / HZ;
-#endif
-}
 static ssize_t disk_stats_read(struct gendisk * disk, char *page)
 {
 	disk_round_stats(disk);
@@ -377,14 +367,14 @@ static ssize_t disk_stats_read(struct gendisk * disk, char *page)
 		"\n",
 		disk_stat_read(disk, reads), disk_stat_read(disk, read_merges),
 		(unsigned long long)disk_stat_read(disk, read_sectors),
-		jiffies_to_msec(disk_stat_read(disk, read_ticks)),
+		jiffies_to_msecs(disk_stat_read(disk, read_ticks)),
 		disk_stat_read(disk, writes), 
 		disk_stat_read(disk, write_merges),
 		(unsigned long long)disk_stat_read(disk, write_sectors),
-		jiffies_to_msec(disk_stat_read(disk, write_ticks)),
+		jiffies_to_msecs(disk_stat_read(disk, write_ticks)),
 		disk->in_flight,
-		jiffies_to_msec(disk_stat_read(disk, io_ticks)),
-		jiffies_to_msec(disk_stat_read(disk, time_in_queue)));
+		jiffies_to_msecs(disk_stat_read(disk, io_ticks)),
+		jiffies_to_msecs(disk_stat_read(disk, time_in_queue)));
 }
 static struct disk_attribute disk_attr_dev = {
 	.attr = {.name = "dev", .mode = S_IRUGO },
@@ -498,13 +488,13 @@ static int diskstats_show(struct seq_file *s, void *v)
 		gp->major, n + gp->first_minor, disk_name(gp, n, buf),
 		disk_stat_read(gp, reads), disk_stat_read(gp, read_merges),
 		(unsigned long long)disk_stat_read(gp, read_sectors),
-		jiffies_to_msec(disk_stat_read(gp, read_ticks)),
+		jiffies_to_msecs(disk_stat_read(gp, read_ticks)),
 		disk_stat_read(gp, writes), disk_stat_read(gp, write_merges),
 		(unsigned long long)disk_stat_read(gp, write_sectors),
-		jiffies_to_msec(disk_stat_read(gp, write_ticks)),
+		jiffies_to_msecs(disk_stat_read(gp, write_ticks)),
 		gp->in_flight,
-		jiffies_to_msec(disk_stat_read(gp, io_ticks)),
-		jiffies_to_msec(disk_stat_read(gp, time_in_queue)));
+		jiffies_to_msecs(disk_stat_read(gp, io_ticks)),
+		jiffies_to_msecs(disk_stat_read(gp, time_in_queue)));
 
 	/* now show all non-0 size partitions of it */
 	for (n = 0; n < gp->minors - 1; n++) {
diff --git a/drivers/block/ida_cmd.h b/drivers/block/ida_cmd.h
index 299748f44..e5f096e26 100644
--- a/drivers/block/ida_cmd.h
+++ b/drivers/block/ida_cmd.h
@@ -67,7 +67,7 @@ typedef struct {
 	__u8	reserved;
 } rhdr_t;
 
-#define SG_MAX			31
+#define SG_MAX			32
 typedef struct {
 	rhdr_t	hdr;
 	sg_t	sg[SG_MAX];
diff --git a/drivers/block/ida_ioctl.h b/drivers/block/ida_ioctl.h
index e90825be7..4159e52e8 100644
--- a/drivers/block/ida_ioctl.h
+++ b/drivers/block/ida_ioctl.h
@@ -57,7 +57,7 @@ typedef struct {
 
 /* currently, sg_cnt is assumed to be 1: only the 0th element of sg is used */
 	struct {
-		void	*addr;
+		void	__user *addr;
 		size_t	size;
 	} sg[SG_MAX];
 	int	sg_cnt;
diff --git a/drivers/block/ioctl.c b/drivers/block/ioctl.c
index b813739b3..283a9f2fa 100644
--- a/drivers/block/ioctl.c
+++ b/drivers/block/ioctl.c
@@ -5,7 +5,7 @@
 #include <linux/buffer_head.h>
 #include <asm/uaccess.h>
 
-static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg *arg)
+static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user *arg)
 {
 	struct block_device *bdevp;
 	struct gendisk *disk;
@@ -109,27 +109,27 @@ static int blkdev_reread_part(struct block_device *bdev)
 
 static int put_ushort(unsigned long arg, unsigned short val)
 {
-	return put_user(val, (unsigned short *)arg);
+	return put_user(val, (unsigned short __user *)arg);
 }
 
 static int put_int(unsigned long arg, int val)
 {
-	return put_user(val, (int *)arg);
+	return put_user(val, (int __user *)arg);
 }
 
 static int put_long(unsigned long arg, long val)
 {
-	return put_user(val, (long *)arg);
+	return put_user(val, (long __user *)arg);
 }
 
 static int put_ulong(unsigned long arg, unsigned long val)
 {
-	return put_user(val, (unsigned long *)arg);
+	return put_user(val, (unsigned long __user *)arg);
 }
 
 static int put_u64(unsigned long arg, u64 val)
 {
-	return put_user(val, (u64 *)arg);
+	return put_user(val, (u64 __user *)arg);
 }
 
 int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
@@ -172,7 +172,7 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
 			return -EACCES;
 		if (!arg)
 			return -EINVAL;
-		if (get_user(n, (int *) arg))
+		if (get_user(n, (int __user *) arg))
 			return -EFAULT;
 		if (bd_claim(bdev, file) < 0)
 			return -EBUSY;
@@ -180,7 +180,7 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
 		bd_release(bdev);
 		return ret;
 	case BLKPG:
-		return blkpg_ioctl(bdev, (struct blkpg_ioctl_arg *) arg);
+		return blkpg_ioctl(bdev, (struct blkpg_ioctl_arg __user *) arg);
 	case BLKRRPART:
 		return blkdev_reread_part(bdev);
 	case BLKGETSIZE:
@@ -203,12 +203,13 @@ int blkdev_ioctl(struct inode *inode, struct file *file, unsigned cmd,
 	case BLKROSET:
 		if (disk->fops->ioctl) {
 			ret = disk->fops->ioctl(inode, file, cmd, arg);
-			if (ret != -EINVAL)
+			/* -EINVAL to handle old uncorrected drivers */
+			if (ret != -EINVAL && ret != -ENOTTY)
 				return ret;
 		}
 		if (!capable(CAP_SYS_ADMIN))
 			return -EACCES;
-		if (get_user(n, (int *)(arg)))
+		if (get_user(n, (int __user *)(arg)))
 			return -EFAULT;
 		set_device_ro(bdev, n);
 		return 0;
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index 9d8fabf41..5baa11da0 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -42,6 +42,16 @@ static void blk_unplug_timeout(unsigned long data);
  */
 static kmem_cache_t *request_cachep;
 
+/*
+ * For queue allocation
+ */
+static kmem_cache_t *requestq_cachep;
+
+/*
+ * For io context allocations
+ */
+static kmem_cache_t *iocontext_cachep;
+
 static wait_queue_head_t congestion_wqh[2] = {
 		__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
 		__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
@@ -70,14 +80,7 @@ EXPORT_SYMBOL(blk_max_pfn);
  */
 static inline int queue_congestion_on_threshold(struct request_queue *q)
 {
-	int ret;
-
-	ret = q->nr_requests - (q->nr_requests / 8) + 1;
-
-	if (ret > q->nr_requests)
-		ret = q->nr_requests;
-
-	return ret;
+	return q->nr_congestion_on;
 }
 
 /*
@@ -85,14 +88,22 @@ static inline int queue_congestion_on_threshold(struct request_queue *q)
  */
 static inline int queue_congestion_off_threshold(struct request_queue *q)
 {
-	int ret;
+	return q->nr_congestion_off;
+}
 
-	ret = q->nr_requests - (q->nr_requests / 8) - 1;
+static void blk_queue_congestion_threshold(struct request_queue *q)
+{
+	int nr;
 
-	if (ret < 1)
-		ret = 1;
+	nr = q->nr_requests - (q->nr_requests / 8) + 1;
+	if (nr > q->nr_requests)
+		nr = q->nr_requests;
+	q->nr_congestion_on = nr;
 
-	return ret;
+	nr = q->nr_requests - (q->nr_requests / 8) - 1;
+	if (nr < 1)
+		nr = 1;
+	q->nr_congestion_off = nr;
 }
 
 /*
@@ -229,6 +240,7 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn)
 	blk_queue_max_sectors(q, MAX_SECTORS);
 	blk_queue_hardsect_size(q, 512);
 	blk_queue_dma_alignment(q, 511);
+	blk_queue_congestion_threshold(q);
 
 	q->unplug_thresh = 4;		/* hmm */
 	q->unplug_delay = (3 * HZ) / 1000;	/* 3 milliseconds */
@@ -265,8 +277,6 @@ EXPORT_SYMBOL(blk_queue_make_request);
 void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr)
 {
 	unsigned long bounce_pfn = dma_addr >> PAGE_SHIFT;
-	unsigned long mb = dma_addr >> 20;
-	static request_queue_t *last_q;
 
 	/*
 	 * set appropriate bounce gfp mask -- unfortunately we don't have a
@@ -280,19 +290,7 @@ void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr)
 	} else
 		q->bounce_gfp = GFP_NOIO;
 
-	/*
-	 * keep this for debugging for now...
-	 */
-	if (dma_addr != BLK_BOUNCE_HIGH && q != last_q) {
-		printk("blk: queue %p, ", q);
-		if (dma_addr == BLK_BOUNCE_ANY)
-			printk("no I/O memory limit\n");
-		else
-			printk("I/O limit %luMb (mask 0x%Lx)\n", mb, (long long) dma_addr);
-	}
-
 	q->bounce_pfn = bounce_pfn;
-	last_q = q;
 }
 
 EXPORT_SYMBOL(blk_queue_bounce_limit);
@@ -1142,7 +1140,7 @@ static inline void __generic_unplug_device(request_queue_t *q)
 
 /**
  * generic_unplug_device - fire a request queue
- * @data:    The &request_queue_t in question
+ * @q:    The &request_queue_t in question
  *
  * Description:
  *   Linux uses plugging to build bigger requests queues before letting
@@ -1159,7 +1157,8 @@ void generic_unplug_device(request_queue_t *q)
 }
 EXPORT_SYMBOL(generic_unplug_device);
 
-static void blk_backing_dev_unplug(struct backing_dev_info *bdi)
+static void blk_backing_dev_unplug(struct backing_dev_info *bdi,
+				   struct page *page)
 {
 	request_queue_t *q = bdi->unplug_io_data;
 
@@ -1206,7 +1205,7 @@ void blk_start_queue(request_queue_t *q)
 		clear_bit(QUEUE_FLAG_REENTER, &q->queue_flags);
 	} else {
 		blk_plug_device(q);
-		schedule_work(&q->unplug_work);
+		kblockd_schedule_work(&q->unplug_work);
 	}
 }
 
@@ -1283,7 +1282,7 @@ void blk_cleanup_queue(request_queue_t * q)
 	if (blk_queue_tagged(q))
 		blk_queue_free_tags(q);
 
-	kfree(q);
+	kmem_cache_free(requestq_cachep, q);
 }
 
 EXPORT_SYMBOL(blk_cleanup_queue);
@@ -1347,7 +1346,7 @@ __setup("elevator=", elevator_setup);
 
 request_queue_t *blk_alloc_queue(int gfp_mask)
 {
-	request_queue_t *q = kmalloc(sizeof(*q), gfp_mask);
+	request_queue_t *q = kmem_cache_alloc(requestq_cachep, gfp_mask);
 
 	if (!q)
 		return NULL;
@@ -1436,7 +1435,7 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock)
 out_elv:
 	blk_cleanup_queue(q);
 out_init:
-	kfree(q);
+	kmem_cache_free(requestq_cachep, q);
 	return NULL;
 }
 
@@ -1877,6 +1876,7 @@ int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk,
 	elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1);
 	generic_unplug_device(q);
 	wait_for_completion(&wait);
+	rq->waiting = NULL;
 
 	if (rq->errors)
 		err = -EIO;
@@ -2444,7 +2444,7 @@ void submit_bio(int rw, struct bio *bio)
 
 	if (unlikely(block_dump)) {
 		char b[BDEVNAME_SIZE];
-		printk("%s(%d): %s block %Lu on %s\n",
+		printk(KERN_DEBUG "%s(%d): %s block %Lu on %s\n",
 			current->comm, current->pid,
 			(rw & WRITE) ? "WRITE" : "READ",
 			(unsigned long long)bio->bi_sector,
@@ -2824,9 +2824,13 @@ int __init blk_dev_init(void)
 		panic("Failed to create kblockd\n");
 
 	request_cachep = kmem_cache_create("blkdev_requests",
-			sizeof(struct request), 0, 0, NULL, NULL);
-	if (!request_cachep)
-		panic("Can't create request pool slab cache\n");
+			sizeof(struct request), 0, SLAB_PANIC, NULL, NULL);
+
+	requestq_cachep = kmem_cache_create("blkdev_queue",
+			sizeof(request_queue_t), 0, SLAB_PANIC, NULL, NULL);
+
+	iocontext_cachep = kmem_cache_create("blkdev_ioc",
+			sizeof(struct io_context), 0, SLAB_PANIC, NULL, NULL);
 
 	blk_max_low_pfn = max_low_pfn;
 	blk_max_pfn = max_pfn;
@@ -2846,7 +2850,7 @@ void put_io_context(struct io_context *ioc)
 	if (atomic_dec_and_test(&ioc->refcount)) {
 		if (ioc->aic && ioc->aic->dtor)
 			ioc->aic->dtor(ioc->aic);
-		kfree(ioc);
+		kmem_cache_free(iocontext_cachep, ioc);
 	}
 }
 
@@ -2885,7 +2889,7 @@ struct io_context *get_io_context(int gfp_flags)
 	local_irq_save(flags);
 	ret = tsk->io_context;
 	if (ret == NULL) {
-		ret = kmalloc(sizeof(*ret), GFP_ATOMIC);
+		ret = kmem_cache_alloc(iocontext_cachep, GFP_ATOMIC);
 		if (ret) {
 			atomic_set(&ret->refcount, 1);
 			ret->pid = tsk->pid;
@@ -2960,6 +2964,7 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
 	int ret = queue_var_store(&q->nr_requests, page, count);
 	if (q->nr_requests < BLKDEV_MIN_RQ)
 		q->nr_requests = BLKDEV_MIN_RQ;
+	blk_queue_congestion_threshold(q);
 
 	if (rl->count[READ] >= queue_congestion_on_threshold(q))
 		set_queue_congested(q, READ);
@@ -2987,14 +2992,41 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
 	return ret;
 }
 
+static ssize_t queue_ra_show(struct request_queue *q, char *page)
+{
+	int ra_kb = q->backing_dev_info.ra_pages << (PAGE_CACHE_SHIFT - 10);
+
+	return queue_var_show(ra_kb, (page));
+}
+
+static ssize_t
+queue_ra_store(struct request_queue *q, const char *page, size_t count)
+{
+	unsigned long ra_kb;
+	ssize_t ret = queue_var_store(&ra_kb, page, count);
+
+	if (ra_kb > (q->max_sectors >> 1))
+		ra_kb = (q->max_sectors >> 1);
+
+	q->backing_dev_info.ra_pages = ra_kb >> (PAGE_CACHE_SHIFT - 10);
+	return ret;
+}
+
 static struct queue_sysfs_entry queue_requests_entry = {
 	.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
 	.show = queue_requests_show,
 	.store = queue_requests_store,
 };
 
+static struct queue_sysfs_entry queue_ra_entry = {
+	.attr = {.name = "read_ahead_kb", .mode = S_IRUGO | S_IWUSR },
+	.show = queue_ra_show,
+	.store = queue_ra_store,
+};
+
 static struct attribute *default_attrs[] = {
 	&queue_requests_entry.attr,
+	&queue_ra_entry.attr,
 	NULL,
 };
 
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 37afd96d7..f1250943c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -308,7 +308,9 @@ lo_read_actor(read_descriptor_t *desc, struct page *page,
 		       page->index);
 		desc->error = -EINVAL;
 	}
-	
+
+	flush_dcache_page(p->page);
+
 	desc->count = count - size;
 	desc->written += size;
 	p->offset += size;
@@ -949,7 +951,7 @@ loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info)
 }
 
 static int
-loop_set_status_old(struct loop_device *lo, const struct loop_info *arg)
+loop_set_status_old(struct loop_device *lo, const struct loop_info __user *arg)
 {
 	struct loop_info info;
 	struct loop_info64 info64;
@@ -961,7 +963,7 @@ loop_set_status_old(struct loop_device *lo, const struct loop_info *arg)
 }
 
 static int
-loop_set_status64(struct loop_device *lo, const struct loop_info64 *arg)
+loop_set_status64(struct loop_device *lo, const struct loop_info64 __user *arg)
 {
 	struct loop_info64 info64;
 
@@ -971,7 +973,7 @@ loop_set_status64(struct loop_device *lo, const struct loop_info64 *arg)
 }
 
 static int
-loop_get_status_old(struct loop_device *lo, struct loop_info *arg) {
+loop_get_status_old(struct loop_device *lo, struct loop_info __user *arg) {
 	struct loop_info info;
 	struct loop_info64 info64;
 	int err = 0;
@@ -989,7 +991,7 @@ loop_get_status_old(struct loop_device *lo, struct loop_info *arg) {
 }
 
 static int
-loop_get_status64(struct loop_device *lo, struct loop_info64 *arg) {
+loop_get_status64(struct loop_device *lo, struct loop_info64 __user *arg) {
 	struct loop_info64 info64;
 	int err = 0;
 
@@ -1021,16 +1023,16 @@ static int lo_ioctl(struct inode * inode, struct file * file,
 		err = loop_clr_fd(lo, inode->i_bdev);
 		break;
 	case LOOP_SET_STATUS:
-		err = loop_set_status_old(lo, (struct loop_info *) arg);
+		err = loop_set_status_old(lo, (struct loop_info __user *) arg);
 		break;
 	case LOOP_GET_STATUS:
-		err = loop_get_status_old(lo, (struct loop_info *) arg);
+		err = loop_get_status_old(lo, (struct loop_info __user *) arg);
 		break;
 	case LOOP_SET_STATUS64:
-		err = loop_set_status64(lo, (struct loop_info64 *) arg);
+		err = loop_set_status64(lo, (struct loop_info64 __user *) arg);
 		break;
 	case LOOP_GET_STATUS64:
-		err = loop_get_status64(lo, (struct loop_info64 *) arg);
+		err = loop_get_status64(lo, (struct loop_info64 __user *) arg);
 		break;
 	default:
 		err = lo->ioctl ? lo->ioctl(lo, cmd, arg) : -EINVAL;
diff --git a/drivers/block/paride/epat.c b/drivers/block/paride/epat.c
index 4f090dcc5..55d1c0a1f 100644
--- a/drivers/block/paride/epat.c
+++ b/drivers/block/paride/epat.c
@@ -31,6 +31,12 @@
 #define j44(a,b)		(((a>>4)&0x0f)+(b&0xf0))
 #define j53(a,b)		(((a>>3)&0x1f)+((b<<4)&0xe0))
 
+static int epatc8;
+
+module_param(epatc8, int, 0);
+MODULE_PARM_DESC(epatc8, "support for the Shuttle EP1284 chip, "
+	"used in any recent Imation SuperDisk (LS-120) drive.");
+
 /* cont =  0   IDE register file
    cont =  1   IDE control registers
    cont =  2   internal EPAT registers
@@ -209,15 +215,18 @@ static void epat_connect ( PIA *pi )
 {       pi->saved_r0 = r0();
         pi->saved_r2 = r2();
 
-#ifdef CONFIG_PARIDE_EPATC8
  	/* Initialize the chip */
-        CPP(0);CPP(0x40);CPP(0xe0);              
-        w0(0);w2(1);w2(4);
-        WR(0x8,0x12);WR(0xc,0x14);WR(0x12,0x10);
-        WR(0xe,0xf);WR(0xf,4);
-     /* WR(0xe,0xa);WR(0xf,4); */
-        WR(0xe,0xd);WR(0xf,0);
-     /* CPP(0x30); */
+	CPP(0);
+
+	if (epatc8) {
+		CPP(0x40);CPP(0xe0);
+		w0(0);w2(1);w2(4);
+		WR(0x8,0x12);WR(0xc,0x14);WR(0x12,0x10);
+		WR(0xe,0xf);WR(0xf,4);
+		/* WR(0xe,0xa);WR(0xf,4); */
+		WR(0xe,0xd);WR(0xf,0);
+		/* CPP(0x30); */
+	}
 
         /* Connect to the chip */
 	CPP(0xe0);
@@ -227,15 +236,10 @@ static void epat_connect ( PIA *pi )
           /* Request EPP */
           w0(0x40);w2(6);w2(7);w2(4);w2(0xc);w2(4);
         }
-#else
- 	CPP(0); CPP(0xe0);
-	w0(0); w2(1); w2(4);
-	if (pi->mode >= 3) {
-		w0(0); w2(1); w2(4); w2(0xc);
-		w0(0x40); w2(6); w2(7); w2(4); w2(0xc); w2(4);
+
+	if (!epatc8) {
+		WR(8,0x10); WR(0xc,0x14); WR(0xa,0x38); WR(0x12,0x10);
 	}
-	WR(8,0x10); WR(0xc,0x14); WR(0xa,0x38); WR(0x12,0x10);
-#endif
 }
 
 static void epat_disconnect (PIA *pi)
@@ -320,6 +324,9 @@ static struct pi_protocol epat = {
 
 static int __init epat_init(void)
 {
+#ifdef CONFIG_PARIDE_EPATC8
+	epatc8 = 1;
+#endif
 	return pi_register(&epat)-1;
 }
 
diff --git a/drivers/block/paride/paride.h b/drivers/block/paride/paride.h
index 46bd0a47f..e8e2a934b 100644
--- a/drivers/block/paride/paride.h
+++ b/drivers/block/paride/paride.h
@@ -99,7 +99,7 @@ extern int pi_schedule_claimed(PIA *pi, void (*cont)(void));
 
 /* macros and functions exported to the protocol modules */
 
-#define delay_p			(pi->delay?udelay(pi->delay):0)
+#define delay_p			(pi->delay?udelay(pi->delay):(void)0)
 #define out_p(offs,byte)	outb(byte,pi->port+offs); delay_p;
 #define in_p(offs)		(delay_p,inb(pi->port+offs))
 
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 46beeab5d..4ab5efad0 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -198,7 +198,7 @@ static int pcd_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn);
 static int pcd_audio_ioctl(struct cdrom_device_info *cdi,
 			   unsigned int cmd, void *arg);
 static int pcd_packet(struct cdrom_device_info *cdi,
-		      struct cdrom_generic_command *cgc);
+		      struct packet_command *cgc);
 
 static int pcd_detect(void);
 static void pcd_probe_capabilities(void);
@@ -501,7 +501,7 @@ static int pcd_atapi(struct pcd_unit *cd, char *cmd, int dlen, char *buf, char *
 	return r;
 }
 
-static int pcd_packet(struct cdrom_device_info *cdi, struct cdrom_generic_command *cgc)
+static int pcd_packet(struct cdrom_device_info *cdi, struct packet_command *cgc)
 {
 	return pcd_atapi(cdi->handle, cgc->cmd, cgc->buflen, cgc->buffer,
 			 "generic packet");
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 0d2c19d2a..5f6534daa 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -771,7 +771,7 @@ static int pd_ioctl(struct inode *inode, struct file *file,
 	 unsigned int cmd, unsigned long arg)
 {
 	struct pd_unit *disk = inode->i_bdev->bd_disk->private_data;
-	struct hd_geometry *geo = (struct hd_geometry *) arg;
+	struct hd_geometry __user *geo = (struct hd_geometry __user *) arg;
 	struct hd_geometry g;
 
 	switch (cmd) {
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index 1e430e5c8..b4a696e73 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -337,7 +337,7 @@ static int pf_open(struct inode *inode, struct file *file)
 static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct pf_unit *pf = inode->i_bdev->bd_disk->private_data;
-	struct hd_geometry *geo = (struct hd_geometry *) arg;
+	struct hd_geometry __user *geo = (struct hd_geometry __user *) arg;
 	struct hd_geometry g;
 	sector_t capacity;
 
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 506f982e5..d73e3ec9f 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -161,6 +161,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY};
 #include <linux/slab.h>
 #include <linux/mtio.h>
 #include <linux/pg.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 
@@ -211,9 +212,9 @@ MODULE_PARM(drive3, "1-6i");
 
 static int pg_open(struct inode *inode, struct file *file);
 static int pg_release(struct inode *inode, struct file *file);
-static ssize_t pg_read(struct file *filp, char *buf,
+static ssize_t pg_read(struct file *filp, char __user *buf,
 		       size_t count, loff_t * ppos);
-static ssize_t pg_write(struct file *filp, const char *buf,
+static ssize_t pg_write(struct file *filp, const char __user *buf,
 			size_t count, loff_t * ppos);
 static int pg_detect(void);
 
@@ -240,6 +241,8 @@ static int pg_identify(struct pg *dev, int log);
 
 static char pg_scratch[512];	/* scratch block buffer */
 
+static struct class_simple *pg_class;
+
 /* kernel glue structures */
 
 static struct file_operations pg_fops = {
@@ -568,7 +571,7 @@ static int pg_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t *ppos)
+static ssize_t pg_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct pg *dev = filp->private_data;
 	struct pg_write_hdr hdr;
@@ -579,7 +582,7 @@ static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t
 	if (count < hs)
 		return -EINVAL;
 
-	if (copy_from_user((char *) &hdr, buf, hs))
+	if (copy_from_user(&hdr, buf, hs))
 		return -EFAULT;
 
 	if (hdr.magic != PG_MAGIC)
@@ -616,7 +619,7 @@ static ssize_t pg_write(struct file *filp, const char *buf, size_t count, loff_t
 	return count;
 }
 
-static ssize_t pg_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
+static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct pg *dev = filp->private_data;
 	struct pg_read_hdr hdr;
@@ -648,7 +651,7 @@ static ssize_t pg_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
 	hdr.duration = (jiffies - dev->start + HZ / 2) / HZ;
 	hdr.scsi = dev->status & 0x0f;
 
-	if (copy_to_user(buf, (char *) &hdr, hs))
+	if (copy_to_user(buf, &hdr, hs))
 		return -EFAULT;
 	if (copy > 0)
 		if (copy_to_user(buf + hs, dev->bufptr, copy))
@@ -658,15 +661,19 @@ static ssize_t pg_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
 
 static int __init pg_init(void)
 {
-	int unit;
+	int unit, err = 0;
 
-	if (disable)
-		return -1;
+	if (disable){
+		err = -1;
+		goto out;
+	}
 
 	pg_init_units();
 
-	if (pg_detect())
-		return -1;
+	if (pg_detect()) {
+		err = -1;
+		goto out;
+	}
 
 	if (register_chrdev(major, name, &pg_fops)) {
 		printk("pg_init: unable to get major number %d\n", major);
@@ -675,18 +682,37 @@ static int __init pg_init(void)
 			if (dev->present)
 				pi_release(dev->pi);
 		}
-		return -1;
+		err = -1;
+		goto out;
+	}
+	pg_class = class_simple_create(THIS_MODULE, "pg");
+	if (IS_ERR(pg_class)) {
+		err = PTR_ERR(pg_class);
+		goto out_chrdev;
 	}
 	devfs_mk_dir("pg");
 	for (unit = 0; unit < PG_UNITS; unit++) {
 		struct pg *dev = &devices[unit];
 		if (dev->present) {
-			devfs_mk_cdev(MKDEV(major, unit),
+			class_simple_device_add(pg_class, MKDEV(major, unit), 
+					NULL, "pg%u", unit);
+			err = devfs_mk_cdev(MKDEV(major, unit),
 				      S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u",
 				      unit);
+			if (err) 
+				goto out_class;
 		}
 	}
-	return 0;
+	err = 0;
+	goto out;
+
+out_class:
+	class_simple_device_remove(MKDEV(major, unit));
+	class_simple_destroy(pg_class);
+out_chrdev:
+	unregister_chrdev(major, "pg");
+out:
+	return err;
 }
 
 static void __exit pg_exit(void)
@@ -695,10 +721,12 @@ static void __exit pg_exit(void)
 
 	for (unit = 0; unit < PG_UNITS; unit++) {
 		struct pg *dev = &devices[unit];
-		if (dev->present)
+		if (dev->present) {
+			class_simple_device_remove(MKDEV(major, unit));
 			devfs_remove("pg/%u", unit);
+		}
 	}
-
+	class_simple_destroy(pg_class);
 	devfs_remove("pg");
 	unregister_chrdev(major, name);
 
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 7db4fc758..44b12134d 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -145,6 +145,7 @@ static int (*drives[4])[6] = {&drive0, &drive1, &drive2, &drive3};
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/mtio.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 
@@ -211,9 +212,9 @@ static int pt_open(struct inode *inode, struct file *file);
 static int pt_ioctl(struct inode *inode, struct file *file,
 		    unsigned int cmd, unsigned long arg);
 static int pt_release(struct inode *inode, struct file *file);
-static ssize_t pt_read(struct file *filp, char *buf,
+static ssize_t pt_read(struct file *filp, char __user *buf,
 		       size_t count, loff_t * ppos);
-static ssize_t pt_write(struct file *filp, const char *buf,
+static ssize_t pt_write(struct file *filp, const char __user *buf,
 			size_t count, loff_t * ppos);
 static int pt_detect(void);
 
@@ -260,6 +261,9 @@ static struct file_operations pt_fops = {
 	.release = pt_release,
 };
 
+/* sysfs class support */
+static struct class_simple *pt_class;
+
 static inline int status_reg(struct pi_adapter *pi)
 {
 	return pi_read_regr(pi, 1, 6);
@@ -706,12 +710,12 @@ static int pt_ioctl(struct inode *inode, struct file *file,
 	 unsigned int cmd, unsigned long arg)
 {
 	struct pt_unit *tape = file->private_data;
+	struct mtop __user *p = (void __user *)arg;
 	struct mtop mtop;
 
 	switch (cmd) {
 	case MTIOCTOP:
-		if (copy_from_user((char *) &mtop, (char *) arg,
-				   sizeof (struct mtop)))
+		if (copy_from_user(&mtop, p, sizeof(struct mtop)))
 			return -EFAULT;
 
 		switch (mtop.mt_op) {
@@ -760,7 +764,7 @@ pt_release(struct inode *inode, struct file *file)
 
 }
 
-static ssize_t pt_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+static ssize_t pt_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 {
 	struct pt_unit *tape = filp->private_data;
 	struct pi_adapter *pi = tape->pi;
@@ -857,7 +861,7 @@ static ssize_t pt_read(struct file *filp, char *buf, size_t count, loff_t * ppos
 
 }
 
-static ssize_t pt_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+static ssize_t pt_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 {
 	struct pt_unit *tape = filp->private_data;
 	struct pi_adapter *pi = tape->pi;
@@ -959,33 +963,62 @@ static ssize_t pt_write(struct file *filp, const char *buf, size_t count, loff_t
 
 static int __init pt_init(void)
 {
-	int unit;
+	int unit, err = 0;
 
-	if (disable)
-		return -1;
+	if (disable) {
+		err = -1;
+		goto out;
+	}
 
-	if (pt_detect())
-		return -1;
+	if (pt_detect()) {
+		err = -1;
+		goto out;
+	}
 
 	if (register_chrdev(major, name, &pt_fops)) {
 		printk("pt_init: unable to get major number %d\n", major);
 		for (unit = 0; unit < PT_UNITS; unit++)
 			if (pt[unit].present)
 				pi_release(pt[unit].pi);
-		return -1;
+		err = -1;
+		goto out;
+	}
+	pt_class = class_simple_create(THIS_MODULE, "pt");
+	if (IS_ERR(pt_class)) {
+		err = PTR_ERR(pt_class);
+		goto out_chrdev;
 	}
 
 	devfs_mk_dir("pt");
 	for (unit = 0; unit < PT_UNITS; unit++)
 		if (pt[unit].present) {
-			devfs_mk_cdev(MKDEV(major, unit),
+			class_simple_device_add(pt_class, MKDEV(major, unit), 
+					NULL, "pt%d", unit);
+			err = devfs_mk_cdev(MKDEV(major, unit),
 				      S_IFCHR | S_IRUSR | S_IWUSR,
 				      "pt/%d", unit);
-			devfs_mk_cdev(MKDEV(major, unit + 128),
+			if (err) {
+				class_simple_device_remove(MKDEV(major, unit));
+				goto out_class;
+			}
+			class_simple_device_add(pt_class, MKDEV(major, unit + 128),
+					NULL, "pt%dn", unit);
+			err = devfs_mk_cdev(MKDEV(major, unit + 128),
 				      S_IFCHR | S_IRUSR | S_IWUSR,
 				      "pt/%dn", unit);
+			if (err) {
+				class_simple_device_remove(MKDEV(major, unit + 128));
+				goto out_class;
+			}
 		}
-	return 0;
+	goto out;
+
+out_class:
+	class_simple_destroy(pt_class);
+out_chrdev:
+	unregister_chrdev(major, "pt");
+out:
+	return err;
 }
 
 static void __exit pt_exit(void)
@@ -993,9 +1026,12 @@ static void __exit pt_exit(void)
 	int unit;
 	for (unit = 0; unit < PT_UNITS; unit++)
 		if (pt[unit].present) {
+			class_simple_device_remove(MKDEV(major, unit));
 			devfs_remove("pt/%d", unit);
+			class_simple_device_remove(MKDEV(major, unit + 128));
 			devfs_remove("pt/%dn", unit);
 		}
+	class_simple_destroy(pt_class);
 	devfs_remove("pt");
 	unregister_chrdev(major, name);
 	for (unit = 0; unit < PT_UNITS; unit++)
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index 63e30e07f..82a5f19fd 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -180,7 +180,7 @@ static int sect[MAX_HD] = {-1, -1};
 MODULE_PARM(tp720esdi, "i");
 MODULE_PARM(cyl, "i");
 MODULE_PARM(head, "i");
-MODULE_PARM(track, "i");
+MODULE_PARM(sect, "i");
 MODULE_LICENSE("GPL");
 
 int init_module(void) {
@@ -1063,17 +1063,17 @@ static int ps2esdi_ioctl(struct inode *inode,
 			 struct file *file, u_int cmd, u_long arg)
 {
 	struct ps2esdi_i_struct *p = inode->i_bdev->bd_disk->private_data;
-	struct ps2esdi_geometry *geometry = (struct ps2esdi_geometry *) arg;
-	int err;
+	struct ps2esdi_geometry geom;
 
 	if (cmd != HDIO_GETGEO)
 		return -EINVAL;
-	if ((err = verify_area(VERIFY_WRITE, geometry, sizeof(*geometry))))
-		return (err);
-	put_user(p->head, (char *) &geometry->heads);
-	put_user(p->sect, (char *) &geometry->sectors);
-	put_user(p->cyl, (short *) &geometry->cylinders);
-	put_user(get_start_sect(inode->i_bdev), (long *) &geometry->start);
+	memset(&geom, 0, sizeof(geom));
+	geom.heads = p->head;
+	geom.sectors = p->sect;
+	geom.cylinders = p->cyl;
+	geom.start = get_start_sect(inode->i_bdev);
+	if (copy_to_user((void __user *)arg, &geom, sizeof(geom)))
+		return -EFAULT;
 	return 0;
 }
 
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 3dd9163a6..fe8332e34 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -53,10 +53,11 @@
 #include <linux/pagemap.h>
 #include <linux/blkdev.h>
 #include <linux/genhd.h>
-#include <linux/bio.h>
 #include <linux/buffer_head.h>		/* for invalidate_bdev() */
 #include <linux/backing-dev.h>
 #include <linux/blkpg.h>
+#include <linux/writeback.h>
+
 #include <asm/uaccess.h>
 
 /* The RAM disk size is now a parameter */
@@ -94,16 +95,46 @@ int rd_blocksize = BLOCK_SIZE;			/* blocksize of the RAM disks */
  *               2000 Transmeta Corp.
  * aops copied from ramfs.
  */
-static int ramdisk_readpage(struct file *file, struct page *page)
-{
-	if (!PageUptodate(page)) {
-		void *kaddr = kmap_atomic(page, KM_USER0);
 
-		memset(kaddr, 0, PAGE_CACHE_SIZE);
-		flush_dcache_page(page);
-		kunmap_atomic(kaddr, KM_USER0);
-		SetPageUptodate(page);
+/*
+ * If a ramdisk page has buffers, some may be uptodate and some may be not.
+ * To bring the page uptodate we zero out the non-uptodate buffers.  The
+ * page must be locked.
+ */
+static void make_page_uptodate(struct page *page)
+{
+	if (page_has_buffers(page)) {
+		struct buffer_head *bh = page_buffers(page);
+		struct buffer_head *head = bh;
+
+		do {
+			if (!buffer_uptodate(bh)) {
+				memset(bh->b_data, 0, bh->b_size);
+				/*
+				 * akpm: I'm totally undecided about this.  The
+				 * buffer has just been magically brought "up to
+				 * date", but nobody should want to be reading
+				 * it anyway, because it hasn't been used for
+				 * anything yet.  It is still in a "not read
+				 * from disk yet" state.
+				 *
+				 * But non-uptodate buffers against an uptodate
+				 * page are against the rules.  So do it anyway.
+				 */
+				 set_buffer_uptodate(bh);
+			}
+		} while ((bh = bh->b_this_page) != head);
+	} else {
+		memset(page_address(page), 0, PAGE_CACHE_SIZE);
 	}
+	flush_dcache_page(page);
+	SetPageUptodate(page);
+}
+
+static int ramdisk_readpage(struct file *file, struct page *page)
+{
+	if (!PageUptodate(page))
+		make_page_uptodate(page);
 	unlock_page(page);
 	return 0;
 }
@@ -111,34 +142,69 @@ static int ramdisk_readpage(struct file *file, struct page *page)
 static int ramdisk_prepare_write(struct file *file, struct page *page,
 				unsigned offset, unsigned to)
 {
-	if (!PageUptodate(page)) {
-		void *kaddr = kmap_atomic(page, KM_USER0);
-
-		memset(kaddr, 0, PAGE_CACHE_SIZE);
-		flush_dcache_page(page);
-		kunmap_atomic(kaddr, KM_USER0);
-		SetPageUptodate(page);
-	}
-	SetPageDirty(page);
+	if (!PageUptodate(page))
+		make_page_uptodate(page);
 	return 0;
 }
 
 static int ramdisk_commit_write(struct file *file, struct page *page,
 				unsigned offset, unsigned to)
 {
+	set_page_dirty(page);
+	return 0;
+}
+
+/*
+ * ->writepage to the the blockdev's mapping has to redirty the page so that the
+ * VM doesn't go and steal it.  We return WRITEPAGE_ACTIVATE so that the VM
+ * won't try to (pointlessly) write the page again for a while.
+ *
+ * Really, these pages should not be on the LRU at all.
+ */
+static int ramdisk_writepage(struct page *page, struct writeback_control *wbc)
+{
+	if (!PageUptodate(page))
+		make_page_uptodate(page);
+	SetPageDirty(page);
+	if (wbc->for_reclaim)
+		return WRITEPAGE_ACTIVATE;
+	unlock_page(page);
+	return 0;
+}
+
+/*
+ * This is a little speedup thing: short-circuit attempts to write back the
+ * ramdisk blockdev inode to its non-existent backing store.
+ */
+static int ramdisk_writepages(struct address_space *mapping,
+				struct writeback_control *wbc)
+{
+	return 0;
+}
+
+/*
+ * ramdisk blockdev pages have their own ->set_page_dirty() because we don't
+ * want them to contribute to dirty memory accounting.
+ */
+static int ramdisk_set_page_dirty(struct page *page)
+{
+	SetPageDirty(page);
 	return 0;
 }
 
 static struct address_space_operations ramdisk_aops = {
-	.readpage = ramdisk_readpage,
-	.prepare_write = ramdisk_prepare_write,
-	.commit_write = ramdisk_commit_write,
+	.readpage	= ramdisk_readpage,
+	.prepare_write	= ramdisk_prepare_write,
+	.commit_write	= ramdisk_commit_write,
+	.writepage	= ramdisk_writepage,
+	.set_page_dirty	= ramdisk_set_page_dirty,
+	.writepages	= ramdisk_writepages,
 };
 
 static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec, sector_t sector,
 				struct address_space *mapping)
 {
-	unsigned long index = sector >> (PAGE_CACHE_SHIFT - 9);
+	pgoff_t index = sector >> (PAGE_CACHE_SHIFT - 9);
 	unsigned int vec_offset = vec->bv_offset;
 	int offset = (sector << 9) & ~PAGE_CACHE_MASK;
 	int size = vec->bv_len;
@@ -146,60 +212,47 @@ static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec, sector_t sector,
 
 	do {
 		int count;
-		struct page * page;
-		char * src, * dst;
-		int unlock = 0;
+		struct page *page;
+		char *src;
+		char *dst;
 
 		count = PAGE_CACHE_SIZE - offset;
 		if (count > size)
 			count = size;
 		size -= count;
 
-		page = find_get_page(mapping, index);
+		page = grab_cache_page(mapping, index);
 		if (!page) {
-			page = grab_cache_page(mapping, index);
 			err = -ENOMEM;
-			if (!page)
-				goto out;
-			err = 0;
-
-			if (!PageUptodate(page)) {
-				void *kaddr = kmap_atomic(page, KM_USER0);
-
-				memset(kaddr, 0, PAGE_CACHE_SIZE);
-				flush_dcache_page(page);
-				kunmap_atomic(kaddr, KM_USER0);
-				SetPageUptodate(page);
-			}
-
-			unlock = 1;
+			goto out;
 		}
 
+		if (!PageUptodate(page))
+			make_page_uptodate(page);
+
 		index++;
 
 		if (rw == READ) {
-			src = kmap(page) + offset;
-			dst = kmap(vec->bv_page) + vec_offset;
+			src = kmap_atomic(page, KM_USER0) + offset;
+			dst = kmap_atomic(vec->bv_page, KM_USER1) + vec_offset;
 		} else {
-			dst = kmap(page) + offset;
-			src = kmap(vec->bv_page) + vec_offset;
+			src = kmap_atomic(vec->bv_page, KM_USER0) + vec_offset;
+			dst = kmap_atomic(page, KM_USER1) + offset;
 		}
 		offset = 0;
 		vec_offset += count;
 
 		memcpy(dst, src, count);
 
-		kunmap(page);
-		kunmap(vec->bv_page);
+		kunmap_atomic(src, KM_USER0);
+		kunmap_atomic(dst, KM_USER1);
 
-		if (rw == READ) {
+		if (rw == READ)
 			flush_dcache_page(vec->bv_page);
-		} else {
-			SetPageDirty(page);
-		}
-		if (unlock)
-			unlock_page(page);
-		__free_page(page);
+		else
+			set_page_dirty(page);
+		unlock_page(page);
+		put_page(page);
 	} while (size);
 
  out:
@@ -251,7 +304,7 @@ static int rd_ioctl(struct inode *inode, struct file *file,
 	struct block_device *bdev = inode->i_bdev;
 
 	if (cmd != BLKFLSBUF)
-		return -EINVAL;
+		return -ENOTTY;
 
 	/*
 	 * special: we want to release the ramdisk memory, it's not like with
@@ -268,28 +321,65 @@ static int rd_ioctl(struct inode *inode, struct file *file,
 	return error;
 }
 
+/*
+ * This is the backing_dev_info for the blockdev inode itself.  It doesn't need
+ * writeback and it does not contribute to dirty memory accounting.
+ */
 static struct backing_dev_info rd_backing_dev_info = {
 	.ra_pages	= 0,	/* No readahead */
 	.memory_backed	= 1,	/* Does not contribute to dirty memory */
-	.unplug_io_fn = default_unplug_io_fn,
+	.unplug_io_fn	= default_unplug_io_fn,
+};
+
+/*
+ * This is the backing_dev_info for the files which live atop the ramdisk
+ * "device".  These files do need writeback and they do contribute to dirty
+ * memory accounting.
+ */
+static struct backing_dev_info rd_file_backing_dev_info = {
+	.ra_pages	= 0,	/* No readahead */
+	.memory_backed	= 0,	/* Does contribute to dirty memory */
+	.unplug_io_fn	= default_unplug_io_fn,
 };
 
 static int rd_open(struct inode *inode, struct file *filp)
 {
 	unsigned unit = iminor(inode);
 
-	/*
-	 * Immunize device against invalidate_buffers() and prune_icache().
-	 */
 	if (rd_bdev[unit] == NULL) {
 		struct block_device *bdev = inode->i_bdev;
+		struct address_space *mapping;
+		int gfp_mask;
+
 		inode = igrab(bdev->bd_inode);
 		rd_bdev[unit] = bdev;
 		bdev->bd_openers++;
 		bdev->bd_block_size = rd_blocksize;
 		inode->i_size = get_capacity(rd_disks[unit])<<9;
-		inode->i_mapping->a_ops = &ramdisk_aops;
-		inode->i_mapping->backing_dev_info = &rd_backing_dev_info;
+		mapping = inode->i_mapping;
+		mapping->a_ops = &ramdisk_aops;
+		mapping->backing_dev_info = &rd_backing_dev_info;
+		bdev->bd_inode_backing_dev_info = &rd_file_backing_dev_info;
+
+		/*
+		 * Deep badness.  rd_blkdev_pagecache_IO() needs to allocate
+		 * pagecache pages within a request_fn.  We cannot recur back
+		 * into the filesytem which is mounted atop the ramdisk, because
+		 * that would deadlock on fs locks.  And we really don't want
+		 * to reenter rd_blkdev_pagecache_IO when we're already within
+		 * that function.
+		 *
+		 * So we turn off __GFP_FS and __GFP_IO.
+		 *
+		 * And to give this thing a hope of working, turn on __GFP_HIGH.
+		 * Hopefully, there's enough regular memory allocation going on
+		 * for the page allocator emergency pools to keep the ramdisk
+		 * driver happy.
+		 */
+		gfp_mask = mapping_gfp_mask(mapping);
+		gfp_mask &= ~(__GFP_FS|__GFP_IO);
+		gfp_mask |= __GFP_HIGH;
+		mapping_set_gfp_mask(mapping, gfp_mask);
 	}
 
 	return 0;
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
index e88b6eca9..93ebb681c 100644
--- a/drivers/block/scsi_ioctl.c
+++ b/drivers/block/scsi_ioctl.c
@@ -44,18 +44,18 @@ EXPORT_SYMBOL(scsi_command_size);
 
 #include <scsi/sg.h>
 
-static int sg_get_version(int *p)
+static int sg_get_version(int __user *p)
 {
 	static int sg_version_num = 30527;
 	return put_user(sg_version_num, p);
 }
 
-static int scsi_get_idlun(request_queue_t *q, int *p)
+static int scsi_get_idlun(request_queue_t *q, int __user *p)
 {
 	return put_user(0, p);
 }
 
-static int scsi_get_bus(request_queue_t *q, int *p)
+static int scsi_get_bus(request_queue_t *q, int __user *p)
 {
 	return put_user(0, p);
 }
@@ -65,7 +65,7 @@ static int sg_get_timeout(request_queue_t *q)
 	return q->sg_timeout / (HZ / USER_HZ);
 }
 
-static int sg_set_timeout(request_queue_t *q, int *p)
+static int sg_set_timeout(request_queue_t *q, int __user *p)
 {
 	int timeout, err = get_user(timeout, p);
 
@@ -75,12 +75,12 @@ static int sg_set_timeout(request_queue_t *q, int *p)
 	return err;
 }
 
-static int sg_get_reserved_size(request_queue_t *q, int *p)
+static int sg_get_reserved_size(request_queue_t *q, int __user *p)
 {
 	return put_user(q->sg_reserved_size, p);
 }
 
-static int sg_set_reserved_size(request_queue_t *q, int *p)
+static int sg_set_reserved_size(request_queue_t *q, int __user *p)
 {
 	int size, err = get_user(size, p);
 
@@ -100,7 +100,7 @@ static int sg_set_reserved_size(request_queue_t *q, int *p)
  * will always return that we are ATAPI even for a real SCSI drive, I'm not
  * so sure this is worth doing anything about (why would you care??)
  */
-static int sg_emulated_host(request_queue_t *q, int *p)
+static int sg_emulated_host(request_queue_t *q, int __user *p)
 {
 	return put_user(1, p);
 }
@@ -113,11 +113,14 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 	struct request *rq;
 	struct bio *bio;
 	char sense[SCSI_SENSE_BUFFERSIZE];
+	unsigned char cmd[BLK_MAX_CDB];
 
 	if (hdr->interface_id != 'S')
 		return -EINVAL;
-	if (hdr->cmd_len > sizeof(rq->cmd))
+	if (hdr->cmd_len > BLK_MAX_CDB)
 		return -EINVAL;
+	if (copy_from_user(cmd, hdr->cmdp, hdr->cmd_len))
+		return -EFAULT;
 
 	/*
 	 * we'll do that later
@@ -156,7 +159,7 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 	 * fill in request structure
 	 */
 	rq->cmd_len = hdr->cmd_len;
-	memcpy(rq->cmd, hdr->cmdp, hdr->cmd_len);
+	memcpy(rq->cmd, cmd, hdr->cmd_len);
 	if (sizeof(rq->cmd) != hdr->cmd_len)
 		memset(rq->cmd + hdr->cmd_len, 0, sizeof(rq->cmd) - hdr->cmd_len);
 
@@ -217,7 +220,7 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 #define OMAX_SB_LEN 16          /* For backward compatibility */
 
 static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
-			 Scsi_Ioctl_Command *sic)
+			 Scsi_Ioctl_Command __user *sic)
 {
 	struct request *rq;
 	int err, in_len, out_len, bytes, opcode, cmdlen;
@@ -309,7 +312,7 @@ error:
 	return err;
 }
 
-int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
+int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
 {
 	request_queue_t *q;
 	struct request *rq;
@@ -327,51 +330,40 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
 		 * new sgv3 interface
 		 */
 		case SG_GET_VERSION_NUM:
-			err = sg_get_version((int *) arg);
+			err = sg_get_version(arg);
 			break;
 		case SCSI_IOCTL_GET_IDLUN:
-			err = scsi_get_idlun(q, (int *) arg);
+			err = scsi_get_idlun(q, arg);
 			break;
 		case SCSI_IOCTL_GET_BUS_NUMBER:
-			err = scsi_get_bus(q, (int *) arg);
+			err = scsi_get_bus(q, arg);
 			break;
 		case SG_SET_TIMEOUT:
-			err = sg_set_timeout(q, (int *) arg);
+			err = sg_set_timeout(q, arg);
 			break;
 		case SG_GET_TIMEOUT:
 			err = sg_get_timeout(q);
 			break;
 		case SG_GET_RESERVED_SIZE:
-			err = sg_get_reserved_size(q, (int *) arg);
+			err = sg_get_reserved_size(q, arg);
 			break;
 		case SG_SET_RESERVED_SIZE:
-			err = sg_set_reserved_size(q, (int *) arg);
+			err = sg_set_reserved_size(q, arg);
 			break;
 		case SG_EMULATED_HOST:
-			err = sg_emulated_host(q, (int *) arg);
+			err = sg_emulated_host(q, arg);
 			break;
 		case SG_IO: {
 			struct sg_io_hdr hdr;
-			unsigned char cdb[BLK_MAX_CDB], *old_cdb;
 
 			err = -EFAULT;
-			if (copy_from_user(&hdr, (struct sg_io_hdr *) arg, sizeof(hdr)))
-				break;
-			err = -EINVAL;
-			if (hdr.cmd_len > sizeof(rq->cmd))
-				break;
-			err = -EFAULT;
-			if (copy_from_user(cdb, hdr.cmdp, hdr.cmd_len))
+			if (copy_from_user(&hdr, arg, sizeof(hdr)))
 				break;
-
-			old_cdb = hdr.cmdp;
-			hdr.cmdp = cdb;
 			err = sg_io(q, bd_disk, &hdr);
 			if (err == -EFAULT)
 				break;
 
-			hdr.cmdp = old_cdb;
-			if (copy_to_user((struct sg_io_hdr *) arg, &hdr, sizeof(hdr)))
+			if (copy_to_user(arg, &hdr, sizeof(hdr)))
 				err = -EFAULT;
 			break;
 		}
@@ -380,7 +372,7 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
 			struct sg_io_hdr hdr;
 
 			err = -EFAULT;
-			if (copy_from_user(&cgc, (struct cdrom_generic_command *) arg, sizeof(cgc)))
+			if (copy_from_user(&cgc, arg, sizeof(cgc)))
 				break;
 			cgc.timeout = clock_t_to_jiffies(cgc.timeout);
 			memset(&hdr, 0, sizeof(hdr));
@@ -408,11 +400,11 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
 				break;
 
 			hdr.dxferp = cgc.buffer;
-			hdr.sbp = (char *) cgc.sense;
+			hdr.sbp = cgc.sense;
 			if (hdr.sbp)
 				hdr.mx_sb_len = sizeof(struct request_sense);
 			hdr.timeout = cgc.timeout;
-			hdr.cmdp = cgc.cmd;
+			hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd;
 			hdr.cmd_len = sizeof(cgc.cmd);
 
 			err = sg_io(q, bd_disk, &hdr);
@@ -424,7 +416,7 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
 
 			cgc.stat = err;
 			cgc.buflen = hdr.resid;
-			if (copy_to_user((struct cdrom_generic_command *) arg, &cgc, sizeof(cgc)))
+			if (copy_to_user(arg, &cgc, sizeof(cgc)))
 				err = -EFAULT;
 
 			break;
@@ -438,8 +430,7 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, unsigned long arg)
 			if (!arg)
 				break;
 
-			err = sg_scsi_ioctl(q, bd_disk,
-					    (Scsi_Ioctl_Command *)arg);
+			err = sg_scsi_ioctl(q, bd_disk, arg);
 			break;
 		case CDROMCLOSETRAY:
 			close = 1;
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 8337eeb9a..73554d3fe 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1145,3 +1145,7 @@ static int swim3_add_device(struct device_node *swim)
 }
 
 module_init(swim3_init)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Paul Mackerras");
+MODULE_ALIAS_BLOCKDEV_MAJOR(FLOPPY_MAJOR);
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 5a1e349b1..2b126d8d2 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -278,7 +278,7 @@ static void dump_dmastat(struct cardinfo *card, unsigned int dmastat)
  * Whenever IO on the active page completes, the Ready page is activated
  * and the ex-Active page is clean out and made Ready.
  * Otherwise the Ready page is only activated when it becomes full, or
- * when mm_unplug_device is called via blk_run_queues().
+ * when mm_unplug_device is called via the unplug_io_fn.
  *
  * If a request arrives while both pages a full, it is queued, and b_rdev is
  * overloaded to record whether it was a read or a write.
@@ -833,7 +833,7 @@ static int mm_ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned
 		geo.start     = get_start_sect(i->i_bdev);
 		geo.cylinders = size / (geo.heads * geo.sectors);
 
-		if (copy_to_user((void *) arg, &geo, sizeof(geo)))
+		if (copy_to_user((void __user *) arg, &geo, sizeof(geo)))
 			return -EFAULT;
 		return 0;
 	}
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index ada4336bf..fdac6e366 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -40,8 +40,11 @@
 #include <linux/string.h>
 #include <linux/dma-mapping.h>
 #include <linux/completion.h>
+#include <linux/device.h>
+#include <linux/kernel.h>
 
 #include <asm/uaccess.h>
+#include <asm/vio.h>
 #include <asm/iSeries/HvTypes.h>
 #include <asm/iSeries/HvLpEvent.h>
 #include <asm/iSeries/HvLpConfig.h>
@@ -175,6 +178,13 @@ static int viodasd_open(struct inode *ino, struct file *fil)
 	struct viodasd_device *d = ino->i_bdev->bd_disk->private_data;
 	HvLpEvent_Rc hvrc;
 	struct viodasd_waitevent we;
+	u16 flags = 0;
+
+	if (d->read_only) {
+		if ((fil != NULL) && (fil->f_mode & FMODE_WRITE))
+			return -EROFS;
+		flags = vioblockflags_ro;
+	}
 
 	init_completion(&we.com);
 
@@ -186,7 +196,7 @@ static int viodasd_open(struct inode *ino, struct file *fil)
 			viopath_sourceinst(viopath_hostLp),
 			viopath_targetinst(viopath_hostLp),
 			(u64)(unsigned long)&we, VIOVERSION << 16,
-			((u64)DEVICE_NO(d) << 48) /* | ((u64)flags << 32) */,
+			((u64)DEVICE_NO(d) << 48) | ((u64)flags << 32),
 			0, 0, 0);
 	if (hvrc != 0) {
 		printk(VIOD_KERN_WARNING "HV open failed %d\n", (int)hvrc);
@@ -456,7 +466,9 @@ static void probe_disk(struct viodasd_device *d)
 	int dev_no = DEVICE_NO(d);
 	struct gendisk *g;
 	struct request_queue *q;
+	u16 flags = 0;
 
+retry:
 	init_completion(&we.com);
 
 	/* Send the open event to OS/400 */
@@ -467,7 +479,7 @@ static void probe_disk(struct viodasd_device *d)
 			viopath_sourceinst(viopath_hostLp),
 			viopath_targetinst(viopath_hostLp),
 			(u64)(unsigned long)&we, VIOVERSION << 16,
-			((u64)dev_no << 48) | ((u64)vioblockflags_ro << 32),
+			((u64)dev_no << 48) | ((u64)flags<< 32),
 			0, 0, 0);
 	if (hvrc != 0) {
 		printk(VIOD_KERN_WARNING "bad rc on HV open %d\n", (int)hvrc);
@@ -476,8 +488,13 @@ static void probe_disk(struct viodasd_device *d)
 
 	wait_for_completion(&we.com);
 
-	if (we.rc != 0)
-		return;
+	if (we.rc != 0) {
+		if (flags != 0)
+			return;
+		/* try again with read only flag set */
+		flags = vioblockflags_ro;
+		goto retry;
+	}
 	if (we.max_disk > (MAX_DISKNO - 1)) {
 		static int warned;
 
@@ -498,19 +515,13 @@ static void probe_disk(struct viodasd_device *d)
 			viopath_sourceinst(viopath_hostLp),
 			viopath_targetinst(viopath_hostLp),
 			0, VIOVERSION << 16,
-			((u64)dev_no << 48) | ((u64)vioblockflags_ro << 32),
+			((u64)dev_no << 48) | ((u64)flags << 32),
 			0, 0, 0);
 	if (hvrc != 0) {
 		printk(VIOD_KERN_WARNING
 		       "bad rc sending event to OS/400 %d\n", (int)hvrc);
 		return;
 	}
-	printk(VIOD_KERN_INFO "disk %d: %lu sectors (%lu MB) "
-			"CHS=%d/%d/%d sector size %d\n",
-			dev_no, (unsigned long)(d->size >> 9),
-			(unsigned long)(d->size >> 20),
-			(int)d->cylinders, (int)d->tracks,
-			(int)d->sectors, (int)d->bytes_per_sector);
 	/* create the request queue for the disk */
 	spin_lock_init(&d->q_lock);
 	q = blk_init_queue(do_viodasd_request, &d->q_lock);
@@ -548,6 +559,14 @@ static void probe_disk(struct viodasd_device *d)
 	g->private_data = d;
 	set_capacity(g, d->size >> 9);
 
+	printk(VIOD_KERN_INFO "disk %d: %lu sectors (%lu MB) "
+			"CHS=%d/%d/%d sector size %d%s\n",
+			dev_no, (unsigned long)(d->size >> 9),
+			(unsigned long)(d->size >> 20),
+			(int)d->cylinders, (int)d->tracks,
+			(int)d->sectors, (int)d->bytes_per_sector,
+			d->read_only ? " (RO)" : "");
+
 	/* register us in the global list */
 	add_disk(g);
 }
@@ -709,6 +728,26 @@ static void handle_block_event(struct HvLpEvent *event)
 	}
 }
 
+/*
+ * Get the driver to reprobe for more disks.
+ */
+static ssize_t probe_disks(struct device_driver *drv, const char *buf,
+		size_t count)
+{
+	struct viodasd_device *d;
+
+	for (d = viodasd_devices; d < &viodasd_devices[MAX_DISKNO]; d++) {
+		if (d->disk == NULL)
+			probe_disk(d);
+	}
+	return count;
+}
+static DRIVER_ATTR(probe, S_IWUSR, NULL, probe_disks)
+
+static struct vio_driver viodasd_driver = {
+	.name = "viodasd"
+};
+
 /*
  * Initialize the whole device driver.  Handle module and non-module
  * versions
@@ -752,6 +791,9 @@ static int __init viodasd_init(void)
 	for (i = 0; i < MAX_DISKNO; i++)
 		probe_disk(&viodasd_devices[i]);
 
+	vio_register_driver(&viodasd_driver);	/* FIX ME - error checking */
+	driver_create_file(&viodasd_driver.driver, &driver_attr_probe);
+
 	return 0;
 }
 module_init(viodasd_init);
@@ -761,6 +803,9 @@ void viodasd_exit(void)
 	int i;
 	struct viodasd_device *d;
 
+	driver_remove_file(&viodasd_driver.driver, &driver_attr_probe);
+	vio_unregister_driver(&viodasd_driver);
+
         for (i = 0; i < MAX_DISKNO; i++) {
 		d = &viodasd_devices[i];
 		if (d->disk) {
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index b4ae8414c..1fd72e005 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -330,12 +330,12 @@ static int xd_ioctl (struct inode *inode,struct file *file,u_int cmd,u_long arg)
 		case HDIO_GETGEO:
 		{
 			struct hd_geometry g;
-			struct hd_geometry *geometry = (struct hd_geometry *) arg;
+			struct hd_geometry __user *geom= (void __user *)arg;
 			g.heads = p->heads;
 			g.sectors = p->sectors;
 			g.cylinders = p->cylinders;
 			g.start = get_start_sect(inode->i_bdev);
-			return copy_to_user(geometry, &g, sizeof g) ? -EFAULT : 0;
+			return copy_to_user(geom, &g, sizeof(g)) ? -EFAULT : 0;
 		}
 		case HDIO_SET_DMA:
 			if (!capable(CAP_SYS_ADMIN)) return -EACCES;
@@ -354,9 +354,9 @@ static int xd_ioctl (struct inode *inode,struct file *file,u_int cmd,u_long arg)
 			}
 			return 0;
 		case HDIO_GET_DMA:
-			return put_user(!nodma, (long *) arg);
+			return put_user(!nodma, (long __user *) arg);
 		case HDIO_GET_MULTCOUNT:
-			return put_user(xd_maxsectors, (long *) arg);
+			return put_user(xd_maxsectors, (long __user *) arg);
 		default:
 			return -EINVAL;
 	}
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 02a95b2cd..1de33046e 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -174,7 +174,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
 
 	BT_DBG("intf %p id %p", intf, id);
 
-	if (intf->altsetting->desc.bInterfaceNumber != 0)
+	if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
 		return -ENODEV;
 
 	data = kmalloc(sizeof(*data), GFP_KERNEL);
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 81c216eb2..45e35bc21 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -98,14 +98,6 @@ struct bfusb_scb {
 static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs);
 static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs);
 
-static inline void bfusb_wait_for_urb(struct urb *urb)
-{
-	while (atomic_read(&urb->count) > 1) {
-		current->state = TASK_UNINTERRUPTIBLE;
-		schedule_timeout((5 * HZ + 999) / 1000);
-	}
-}
-
 static struct urb *bfusb_get_completed(struct bfusb *bfusb)
 {
 	struct sk_buff *skb;
@@ -132,7 +124,6 @@ static void bfusb_unlink_urbs(struct bfusb *bfusb)
 	while ((skb = skb_dequeue(&bfusb->pending_q))) {
 		urb = ((struct bfusb_scb *) skb->cb)->urb;
 		usb_unlink_urb(urb);
-		bfusb_wait_for_urb(urb);
 		skb_queue_tail(&bfusb->completed_q, skb);
 	}
 
@@ -661,11 +652,11 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 	BT_DBG("intf %p id %p", intf, id);
 
 	/* Check number of endpoints */
-	if (intf->altsetting[0].desc.bNumEndpoints < 2)
+	if (intf->cur_altsetting->desc.bNumEndpoints < 2)
 		return -EIO;
 
-	bulk_out_ep = &intf->altsetting[0].endpoint[0];
-	bulk_in_ep  = &intf->altsetting[0].endpoint[1];
+	bulk_out_ep = &intf->cur_altsetting->endpoint[0];
+	bulk_in_ep  = &intf->cur_altsetting->endpoint[1];
 
 	if (!bulk_out_ep || !bulk_in_ep) {
 		BT_ERR("Bulk endpoints not found");
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 8cd5d0e2c..5aa5cd3a2 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -491,6 +491,9 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
 
 static struct device bt3c_device = {
 	.bus_id = "pcmcia",
+	.kobj = {
+		.k_name = "bt3c"
+	}
 };
 
 
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 60e01f517..ab3c28d49 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -33,7 +33,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 5964684d7..5ba134216 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -32,7 +32,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -499,11 +498,11 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
 /*
  * We don't provide read/write/poll interface for user space.
  */
-static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file, unsigned char *buf, size_t nr)
+static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file, unsigned char __user *buf, size_t nr)
 {
 	return 0;
 }
-static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, const unsigned char *data, size_t count)
+static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, const unsigned char __user *data, size_t count)
 {
 	return 0;
 }
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index ed961bbe6..1874debfa 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -29,9 +29,7 @@
  *    Copyright (c) 2000 Greg Kroah-Hartman        <greg@kroah.com>
  *    Copyright (c) 2000 Mark Douglas Corner       <mcorner@umich.edu>
  *
- * $Id: hci_usb.c,v 1.8 2002/07/18 17:23:09 maxk Exp $    
  */
-#define VERSION "2.5"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -57,9 +55,9 @@
 
 #ifndef CONFIG_BT_HCIUSB_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #undef  BT_DMP
-#define BT_DMP( A... )
+#define BT_DMP(D...)
 #endif
 
 #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET
@@ -67,6 +65,8 @@
 #define URB_ZERO_PACKET 0
 #endif
 
+#define VERSION "2.6"
+
 static struct usb_driver hci_usb_driver; 
 
 static struct usb_device_id bluetooth_ids[] = {
@@ -100,7 +100,10 @@ static struct usb_device_id blacklist_ids[] = {
 	/* Digianswer device */
 	{ USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
 
-	{ }     /* Terminating entry */
+	/* RTX Telecom based adapter with buggy SCO support */
+	{ USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
+
+	{ }	/* Terminating entry */
 };
 
 struct _urb *_urb_alloc(int isoc, int gfp)
@@ -342,7 +345,7 @@ static int hci_usb_flush(struct hci_dev *hdev)
 
 static inline void hci_usb_wait_for_urb(struct urb *urb)
 {
-	while (atomic_read(&urb->count) > 1) {
+	while (atomic_read(&urb->kref.refcount) > 1) {
 		current->state = TASK_UNINTERRUPTIBLE;
 		schedule_timeout((5 * HZ + 999) / 1000);
 	}
@@ -393,7 +396,7 @@ static int hci_usb_close(struct hci_dev *hdev)
 {
 	struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
 	unsigned long flags;
-	
+
 	if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
 		return 0;
 
@@ -402,7 +405,7 @@ static int hci_usb_close(struct hci_dev *hdev)
 	/* Synchronize with completion handlers */
 	write_lock_irqsave(&husb->completion_lock, flags);
 	write_unlock_irqrestore(&husb->completion_lock, flags);
-	
+
 	hci_usb_unlink_urbs(husb);
 	hci_usb_flush(hdev);
 	return 0;
@@ -414,7 +417,7 @@ static int __tx_submit(struct hci_usb *husb, struct _urb *_urb)
 	int err;
 
 	BT_DBG("%s urb %p type %d", husb->hdev->name, urb, _urb->type);
-	
+
 	_urb_queue_tail(__pending_q(husb, _urb->type), _urb);
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err) {
@@ -551,7 +554,7 @@ static void hci_usb_tx_process(struct hci_usb *husb)
 				skb_queue_head(q, skb);
 		}
 #endif
-		
+
 		/* Process ACL queue */
 		q = __transmit_q(husb, HCI_ACLDATA_PKT);
 		while (atomic_read(__pending_tx(husb, HCI_ACLDATA_PKT)) < HCI_MAX_BULK_TX &&
@@ -656,7 +659,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c
 				if (count >= HCI_SCO_HDR_SIZE) {
 					struct hci_sco_hdr *h = data;
 					len = HCI_SCO_HDR_SIZE + h->dlen;
-				} else 
+				} else
 					return -EILSEQ;
 				break;
 #endif
@@ -702,7 +705,7 @@ static void hci_usb_rx_complete(struct urb *urb, struct pt_regs *regs)
 	struct _urb *_urb = container_of(urb, struct _urb, urb);
 	struct hci_usb *husb = (void *) urb->context;
 	struct hci_dev *hdev = husb->hdev;
-	int    err, count = urb->actual_length;
+	int err, count = urb->actual_length;
 
 	BT_DBG("%s urb %p type %d status %d count %d flags %x", hdev->name, urb,
 			_urb->type, urb->status, count, urb->transfer_flags);
@@ -743,7 +746,7 @@ static void hci_usb_rx_complete(struct urb *urb, struct pt_regs *regs)
 
 resubmit:
 	urb->dev = husb->udev;
-	err      = usb_submit_urb(urb, GFP_ATOMIC);
+	err = usb_submit_urb(urb, GFP_ATOMIC);
 	BT_DBG("%s urb %p type %d resubmit status %d", hdev->name, urb,
 			_urb->type, err);
 
@@ -779,7 +782,7 @@ static void hci_usb_tx_complete(struct urb *urb, struct pt_regs *regs)
 	_urb_queue_tail(__completed_q(husb, _urb->type), _urb);
 
 	hci_usb_tx_wakeup(husb);
-	
+
 	read_unlock(&husb->completion_lock);
 }
 
@@ -795,17 +798,15 @@ static void hci_usb_destruct(struct hci_dev *hdev)
 int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
 	struct usb_device *udev = interface_to_usbdev(intf);
-	struct usb_host_endpoint *bulk_out_ep[HCI_MAX_IFACE_NUM];
-	struct usb_host_endpoint *isoc_out_ep[HCI_MAX_IFACE_NUM];
-	struct usb_host_endpoint *bulk_in_ep[HCI_MAX_IFACE_NUM];
-	struct usb_host_endpoint *isoc_in_ep[HCI_MAX_IFACE_NUM];
-	struct usb_host_endpoint *intr_in_ep[HCI_MAX_IFACE_NUM];
+	struct usb_host_endpoint *bulk_out_ep = NULL;
+	struct usb_host_endpoint *bulk_in_ep = NULL;
+	struct usb_host_endpoint *intr_in_ep = NULL;
 	struct usb_host_endpoint  *ep;
 	struct usb_host_interface *uif;
-	struct usb_interface *iface, *isoc_iface;
+	struct usb_interface *isoc_iface;
 	struct hci_usb *husb;
 	struct hci_dev *hdev;
-	int i, a, e, size, ifn, isoc_ifnum, isoc_alts;
+	int i, e, size, isoc_ifnum, isoc_alts;
 
 	BT_DBG("udev %p intf %p", udev, intf);
 
@@ -816,84 +817,37 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 			id = match;
 	}
 
-	iface = udev->actconfig->interface[0];
-
 	if (id->driver_info & HCI_IGNORE)
 		return -ENODEV;
 
-	if (intf->altsetting->desc.bInterfaceNumber > 0)
+	if (intf->cur_altsetting->desc.bInterfaceNumber > 0)
 		return -ENODEV;
 
-	/* Check number of endpoints */
-	if (intf->altsetting[0].desc.bNumEndpoints < 3)
-		return -EIO;
-
-	memset(bulk_out_ep, 0, sizeof(bulk_out_ep));
-	memset(isoc_out_ep, 0, sizeof(isoc_out_ep));
-	memset(bulk_in_ep,  0, sizeof(bulk_in_ep));
-	memset(isoc_in_ep,  0, sizeof(isoc_in_ep));
-	memset(intr_in_ep,  0, sizeof(intr_in_ep));
-
-	size = 0; 
-	isoc_iface = NULL;
-	isoc_alts  = isoc_ifnum = 0;
-	
 	/* Find endpoints that we need */
-
-	ifn = min_t(unsigned int, udev->actconfig->desc.bNumInterfaces, HCI_MAX_IFACE_NUM);
-	for (i = 0; i < ifn; i++) {
-		iface = udev->actconfig->interface[i];
-		for (a = 0; a < iface->num_altsetting; a++) {
-			uif = &iface->altsetting[a];
-			for (e = 0; e < uif->desc.bNumEndpoints; e++) {
-				ep = &uif->endpoint[e];
-
-				switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
-				case USB_ENDPOINT_XFER_INT:
-					if (ep->desc.bEndpointAddress & USB_DIR_IN)
-						intr_in_ep[i] = ep;
-					break;
-
-				case USB_ENDPOINT_XFER_BULK:
-					if (ep->desc.bEndpointAddress & USB_DIR_IN)
-						bulk_in_ep[i]  = ep;
-					else
-						bulk_out_ep[i] = ep;
-					break;
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-				case USB_ENDPOINT_XFER_ISOC:
-					if (ep->desc.wMaxPacketSize < size || a > 2)
-						break;
-					size = ep->desc.wMaxPacketSize;
-
-					isoc_iface = iface;
-					isoc_alts  = a;
-					isoc_ifnum = i;
-
-					if (ep->desc.bEndpointAddress & USB_DIR_IN)
-						isoc_in_ep[i]  = ep;
-					else
-						isoc_out_ep[i] = ep;
-					break;
-#endif
-				}
-			}
+	uif = intf->cur_altsetting;
+	for (e = 0; e < uif->desc.bNumEndpoints; e++) {
+		ep = &uif->endpoint[e];
+
+		switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
+		case USB_ENDPOINT_XFER_INT:
+			if (ep->desc.bEndpointAddress & USB_DIR_IN)
+				intr_in_ep = ep;
+			break;
+
+		case USB_ENDPOINT_XFER_BULK:
+			if (ep->desc.bEndpointAddress & USB_DIR_IN)
+				bulk_in_ep  = ep;
+			else
+				bulk_out_ep = ep;
+			break;
 		}
 	}
 
-	if (!bulk_in_ep[0] || !bulk_out_ep[0] || !intr_in_ep[0]) {
+	if (!bulk_in_ep || !bulk_out_ep || !intr_in_ep) {
 		BT_DBG("Bulk endpoints not found");
 		goto done;
 	}
 
-#ifdef CONFIG_BT_HCIUSB_SCO
-	if (!isoc_in_ep[1] || !isoc_out_ep[1]) {
-		BT_DBG("Isoc endpoints not found");
-		isoc_iface = NULL;
-	}
-#endif
-
 	if (!(husb = kmalloc(sizeof(struct hci_usb), GFP_KERNEL))) {
 		BT_ERR("Can't allocate: control structure");
 		goto done;
@@ -902,32 +856,74 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	memset(husb, 0, sizeof(struct hci_usb));
 
 	husb->udev = udev;
-	husb->bulk_out_ep = bulk_out_ep[0];
-	husb->bulk_in_ep  = bulk_in_ep[0];
-	husb->intr_in_ep  = intr_in_ep[0];
+	husb->bulk_out_ep = bulk_out_ep;
+	husb->bulk_in_ep  = bulk_in_ep;
+	husb->intr_in_ep  = intr_in_ep;
 
 	if (id->driver_info & HCI_DIGIANSWER)
 		husb->ctrl_req = HCI_DIGI_REQ;
 	else
 		husb->ctrl_req = HCI_CTRL_REQ;
 
+	/* Find isochronous endpoints that we can use */
+	size = 0; 
+	isoc_iface = NULL;
+	isoc_alts  = 0;
+	isoc_ifnum = 1;
+
 #ifdef CONFIG_BT_HCIUSB_SCO
+	if (!(id->driver_info & HCI_BROKEN_ISOC))
+		isoc_iface = usb_ifnum_to_if(udev, isoc_ifnum);
+
 	if (isoc_iface) {
-		BT_DBG("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts);
-		if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {
-			BT_ERR("Can't set isoc interface settings");
-			isoc_iface = NULL;
+		int a;
+		struct usb_host_endpoint *isoc_out_ep = NULL;
+		struct usb_host_endpoint *isoc_in_ep = NULL;
+
+		for (a = 0; a < isoc_iface->num_altsetting; a++) {
+			uif = &isoc_iface->altsetting[a];
+			for (e = 0; e < uif->desc.bNumEndpoints; e++) {
+				ep = &uif->endpoint[e];
+
+				switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
+				case USB_ENDPOINT_XFER_ISOC:
+					if (ep->desc.wMaxPacketSize < size ||
+							uif->desc.bAlternateSetting > 2)
+						break;
+					size = ep->desc.wMaxPacketSize;
+
+					isoc_alts = uif->desc.bAlternateSetting;
+
+					if (ep->desc.bEndpointAddress & USB_DIR_IN)
+						isoc_in_ep  = ep;
+					else
+						isoc_out_ep = ep;
+					break;
+				}
+			}
+		}
+
+		if (!isoc_in_ep || !isoc_out_ep)
+			BT_DBG("Isoc endpoints not found");
+		else {
+			BT_DBG("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts);
+			if (usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb) != 0)
+				BT_ERR("Can't claim isoc interface");
+			else if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {
+				BT_ERR("Can't set isoc interface settings");
+				usb_driver_release_interface(&hci_usb_driver, isoc_iface);
+			} else {
+				husb->isoc_iface  = isoc_iface;
+				husb->isoc_in_ep  = isoc_in_ep;
+				husb->isoc_out_ep = isoc_out_ep;
+			}
 		}
-		usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb);
-		husb->isoc_iface  = isoc_iface;
-		husb->isoc_in_ep  = isoc_in_ep[isoc_ifnum];
-		husb->isoc_out_ep = isoc_out_ep[isoc_ifnum];
 	}
 #endif
-	
+
 	husb->completion_lock = RW_LOCK_UNLOCKED;
 
-	for (i = 0; i < 4; i++) {	
+	for (i = 0; i < 4; i++) {
 		skb_queue_head_init(&husb->transmit_q[i]);
 		_urb_queue_init(&husb->pending_q[i]);
 		_urb_queue_init(&husb->completed_q[i]);
@@ -946,10 +942,10 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	hdev->driver_data = husb;
 	SET_HCIDEV_DEV(hdev, &intf->dev);
 
-	hdev->open  = hci_usb_open;
-	hdev->close = hci_usb_close;
-	hdev->flush = hci_usb_flush;
-	hdev->send  = hci_usb_send_frame;
+	hdev->open     = hci_usb_open;
+	hdev->close    = hci_usb_close;
+	hdev->flush    = hci_usb_flush;
+	hdev->send     = hci_usb_send_frame;
 	hdev->destruct = hci_usb_destruct;
 
 	hdev->owner = THIS_MODULE;
@@ -967,6 +963,8 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	return 0;
 
 probe_error:
+	if (husb->isoc_iface)
+		usb_driver_release_interface(&hci_usb_driver, husb->isoc_iface);
 	kfree(husb);
 
 done:
@@ -976,11 +974,13 @@ done:
 static void hci_usb_disconnect(struct usb_interface *intf)
 {
 	struct hci_usb *husb = usb_get_intfdata(intf);
-	struct hci_dev *hdev = husb->hdev;
+	struct hci_dev *hdev;
 
-	if (!husb)
+	if (!husb || intf == husb->isoc_iface)
 		return;
+
 	usb_set_intfdata(intf, NULL);
+	hdev = husb->hdev;
 
 	BT_DBG("%s", hdev->name);
 
@@ -996,11 +996,11 @@ static void hci_usb_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver hci_usb_driver = {
-	.owner      =  THIS_MODULE,
-	.name       =  "hci_usb",
-	.probe      =  hci_usb_probe,
-	.disconnect =  hci_usb_disconnect,
-	.id_table   =  bluetooth_ids,
+	.owner		= THIS_MODULE,
+	.name		= "hci_usb",
+	.probe		= hci_usb_probe,
+	.disconnect	= hci_usb_disconnect,
+	.id_table	= bluetooth_ids,
 };
 
 static int __init hci_usb_init(void)
diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h
index 94437b0c8..da4561ef7 100644
--- a/drivers/bluetooth/hci_usb.h
+++ b/drivers/bluetooth/hci_usb.h
@@ -23,33 +23,28 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * $Id: hci_usb.h,v 1.2 2002/03/18 19:10:04 maxk Exp $
- */
-
-#ifdef __KERNEL__
-
 /* Class, SubClass, and Protocol codes that describe a Bluetooth device */
-#define HCI_DEV_CLASS        0xe0	/* Wireless class */
-#define HCI_DEV_SUBCLASS     0x01	/* RF subclass */
-#define HCI_DEV_PROTOCOL     0x01	/* Bluetooth programming protocol */
+#define HCI_DEV_CLASS		0xe0	/* Wireless class */
+#define HCI_DEV_SUBCLASS	0x01	/* RF subclass */
+#define HCI_DEV_PROTOCOL	0x01	/* Bluetooth programming protocol */
 
-#define HCI_CTRL_REQ	     0x20
-#define HCI_DIGI_REQ	     0x40
+#define HCI_CTRL_REQ		0x20
+#define HCI_DIGI_REQ		0x40
 
-#define HCI_IGNORE           0x01
-#define HCI_RESET            0x02
-#define HCI_DIGIANSWER       0x04
+#define HCI_IGNORE		0x01
+#define HCI_RESET		0x02
+#define HCI_DIGIANSWER		0x04
+#define HCI_BROKEN_ISOC		0x08
 
-#define HCI_MAX_IFACE_NUM	3 
+#define HCI_MAX_IFACE_NUM	3
 
-#define HCI_MAX_BULK_TX     	4
-#define HCI_MAX_BULK_RX     	1
+#define HCI_MAX_BULK_TX		4
+#define HCI_MAX_BULK_RX		1
 
 #define HCI_MAX_ISOC_RX		2
 #define HCI_MAX_ISOC_TX		2
 
-#define HCI_MAX_ISOC_FRAMES     10
+#define HCI_MAX_ISOC_FRAMES	10
 
 struct _urb_queue {
 	struct list_head head;
@@ -79,16 +74,16 @@ static inline void _urb_queue_init(struct _urb_queue *q)
 
 static inline void _urb_queue_head(struct _urb_queue *q, struct _urb *_urb)
 {
-        unsigned long flags;
-        spin_lock_irqsave(&q->lock, flags);
+	unsigned long flags;
+	spin_lock_irqsave(&q->lock, flags);
 	list_add(&_urb->list, &q->head); _urb->queue = q;
 	spin_unlock_irqrestore(&q->lock, flags);
 }
 
 static inline void _urb_queue_tail(struct _urb_queue *q, struct _urb *_urb)
 {
-        unsigned long flags;
-        spin_lock_irqsave(&q->lock, flags);
+	unsigned long flags;
+	spin_lock_irqsave(&q->lock, flags);
 	list_add_tail(&_urb->list, &q->head); _urb->queue = q;
 	spin_unlock_irqrestore(&q->lock, flags);
 }
@@ -96,9 +91,9 @@ static inline void _urb_queue_tail(struct _urb_queue *q, struct _urb *_urb)
 static inline void _urb_unlink(struct _urb *_urb)
 {
 	struct _urb_queue *q = _urb->queue;
-        unsigned long flags;
+	unsigned long flags;
 	if (q) {
-        	spin_lock_irqsave(&q->lock, flags);
+		spin_lock_irqsave(&q->lock, flags);
 		list_del(&_urb->list); _urb->queue = NULL;
 		spin_unlock_irqrestore(&q->lock, flags);
 	}
@@ -106,41 +101,33 @@ static inline void _urb_unlink(struct _urb *_urb)
 
 struct _urb *_urb_dequeue(struct _urb_queue *q);
 
-#ifndef container_of
-#define container_of(ptr, type, member) ({                      \
-		        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
-			        (type *)( (char *)__mptr - offsetof(type,member) );})
-#endif
-
 struct hci_usb {
 	struct hci_dev		*hdev;
 
 	unsigned long		state;
 	
-	struct usb_device 	*udev;
+	struct usb_device	*udev;
 	
 	struct usb_host_endpoint	*bulk_in_ep;
 	struct usb_host_endpoint	*bulk_out_ep;
 	struct usb_host_endpoint	*intr_in_ep;
 
-	struct usb_interface            *isoc_iface;
+	struct usb_interface		*isoc_iface;
 	struct usb_host_endpoint	*isoc_out_ep;
 	struct usb_host_endpoint	*isoc_in_ep;
 
 	__u8			ctrl_req;
 
 	struct sk_buff_head	transmit_q[4];
-	struct sk_buff		*reassembly[4]; // Reassembly buffers
+	struct sk_buff		*reassembly[4];		/* Reassembly buffers */
 
 	rwlock_t		completion_lock;
 
-	atomic_t		pending_tx[4];  // Number of pending requests 
-	struct _urb_queue	pending_q[4];   // Pending requests
-	struct _urb_queue	completed_q[4]; // Completed requests
+	atomic_t		pending_tx[4];		/* Number of pending requests */
+	struct _urb_queue	pending_q[4];		/* Pending requests */
+	struct _urb_queue	completed_q[4];		/* Completed requests */
 };
 
 /* States  */
 #define HCI_USB_TX_PROCESS	1
 #define HCI_USB_TX_WAKEUP	2
-
-#endif /* __KERNEL__ */
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 871f38329..9faa8a08a 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -127,7 +127,7 @@ static unsigned int hci_vhci_chr_poll(struct file *file, poll_table * wait)
 }
 
 /* Get packet from user space buffer(already verified) */
-static inline ssize_t hci_vhci_get_user(struct hci_vhci_struct *hci_vhci, const char *buf, size_t count)
+static inline ssize_t hci_vhci_get_user(struct hci_vhci_struct *hci_vhci, const char __user *buf, size_t count)
 {
 	struct sk_buff *skb;
 
@@ -152,7 +152,7 @@ static inline ssize_t hci_vhci_get_user(struct hci_vhci_struct *hci_vhci, const
 } 
 
 /* Write */
-static ssize_t hci_vhci_chr_write(struct file * file, const char * buf, 
+static ssize_t hci_vhci_chr_write(struct file * file, const char __user * buf, 
 			     size_t count, loff_t *pos)
 {
 	struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
@@ -165,10 +165,11 @@ static ssize_t hci_vhci_chr_write(struct file * file, const char * buf,
 
 /* Put packet to user space buffer(already verified) */
 static inline ssize_t hci_vhci_put_user(struct hci_vhci_struct *hci_vhci,
-				       struct sk_buff *skb, char *buf, int count)
+				       struct sk_buff *skb, char __user *buf,
+				       int count)
 {
 	int len = count, total = 0;
-	char *ptr = buf;
+	char __user *ptr = buf;
 
 	len = min_t(unsigned int, skb->len, len);
 	if (copy_to_user(ptr, skb->data, len))
@@ -194,7 +195,7 @@ static inline ssize_t hci_vhci_put_user(struct hci_vhci_struct *hci_vhci,
 }
 
 /* Read */
-static ssize_t hci_vhci_chr_read(struct file * file, char * buf, size_t count, loff_t *pos)
+static ssize_t hci_vhci_chr_read(struct file * file, char __user * buf, size_t count, loff_t *pos)
 {
 	struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index 8503b193a..97ab1b33f 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -374,6 +374,7 @@ static void op_ok(void)
 }
 
 /* Wait for PA_OK = drive answers with AFL_PA_OK after receiving parameters*/
+#if 0
 # define PA_OK pa_ok()
 static void pa_ok(void)
 {
@@ -387,6 +388,7 @@ static void pa_ok(void)
 		}
 	} while (aztIndatum != AFL_PA_OK);
 }
+#endif
 
 /* Wait for STEN=Low = handshake signal 'AFL_.._OK available or command executed*/
 # define STEN_LOW  sten_low()
@@ -871,7 +873,7 @@ static int aztUpdateToc(void)
 /* Read the table of contents header, i.e. no. of tracks and start of first 
  * track
  */
-static int aztGetDiskInfo()
+static int aztGetDiskInfo(void)
 {
 	int limit;
 	unsigned char test;
@@ -1165,6 +1167,7 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 	struct azt_Toc *tocPtr;
 	struct cdrom_subchnl subchnl;
 	struct cdrom_volctrl volctrl;
+	void __user *argp = (void __user *)arg;
 
 #ifdef AZT_DEBUG
 	printk("aztcd: starting aztcd_ioctl - Command:%x   Time: %li\n",
@@ -1228,8 +1231,7 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 #ifdef AZT_DEBUG
 			printk("aztcd ioctl MULTISESSION\n");
 #endif
-			if (copy_from_user
-			    (&ms, (void *) arg,
+			if (copy_from_user(&ms, argp,
 			     sizeof(struct cdrom_multisession)))
 				return -EFAULT;
 			if (ms.addr_format == CDROM_MSF) {
@@ -1246,8 +1248,7 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 			else
 				return -EINVAL;
 			ms.xa_flag = DiskInfo.xa;
-			if (copy_to_user
-			    ((void *) arg, &ms,
+			if (copy_to_user(argp, &ms,
 			     sizeof(struct cdrom_multisession)))
 				return -EFAULT;
 #ifdef AZT_DEBUG
@@ -1270,7 +1271,7 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 			return 0;
 		}
 	case CDROMPLAYTRKIND:	/* Play a track.  This currently ignores index. */
-		if (copy_from_user(&ti, (void *) arg, sizeof ti))
+		if (copy_from_user(&ti, argp, sizeof ti))
 			return -EFAULT;
 		if (ti.cdti_trk0 < DiskInfo.first
 		    || ti.cdti_trk0 > DiskInfo.last
@@ -1301,7 +1302,7 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 		  aztAudioStatus = CDROM_AUDIO_NO_STATUS;
 		}
 */
-		if (copy_from_user(&msf, (void *) arg, sizeof msf))
+		if (copy_from_user(&msf, argp, sizeof msf))
 			return -EFAULT;
 		/* convert to bcd */
 		azt_bin2bcd(&msf.cdmsf_min0);
@@ -1333,11 +1334,11 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 	case CDROMREADTOCHDR:	/* Read the table of contents header */
 		tocHdr.cdth_trk0 = DiskInfo.first;
 		tocHdr.cdth_trk1 = DiskInfo.last;
-		if (copy_to_user((void *) arg, &tocHdr, sizeof tocHdr))
+		if (copy_to_user(argp, &tocHdr, sizeof tocHdr))
 			return -EFAULT;
 		break;
 	case CDROMREADTOCENTRY:	/* Read an entry in the table of contents */
-		if (copy_from_user(&entry, (void *) arg, sizeof entry))
+		if (copy_from_user(&entry, argp, sizeof entry))
 			return -EFAULT;
 		if ((!aztTocUpToDate) || aztDiskChanged)
 			aztUpdateToc();
@@ -1363,12 +1364,12 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 		} else {
 			return -EINVAL;
 		}
-		if (copy_to_user((void *) arg, &entry, sizeof entry))
+		if (copy_to_user(argp, &entry, sizeof entry))
 			return -EFAULT;
 		break;
 	case CDROMSUBCHNL:	/* Get subchannel info */
 		if (copy_from_user
-		    (&subchnl, (void *) arg, sizeof(struct cdrom_subchnl)))
+		    (&subchnl, argp, sizeof(struct cdrom_subchnl)))
 			return -EFAULT;
 		if (aztGetQChannelInfo(&qInfo) < 0) {
 #ifdef AZT_DEBUG
@@ -1403,16 +1404,14 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 			subchnl.cdsc_reladdr.msf.frame =
 			    azt_bcd2bin(qInfo.trackTime.frame);
 		}
-		if (copy_to_user
-		    ((void *) arg, &subchnl, sizeof(struct cdrom_subchnl)))
+		if (copy_to_user(argp, &subchnl, sizeof(struct cdrom_subchnl)))
 			return -EFAULT;
 		break;
 	case CDROMVOLCTRL:	/* Volume control 
 				   * With my Aztech CD268-01A volume control does not work, I can only
 				   turn the channels on (any value !=0) or off (value==0). Maybe it
 				   works better with your drive */
-		if (copy_from_user
-		    (&volctrl, (char *) arg, sizeof(volctrl)))
+		if (copy_from_user(&volctrl, argp, sizeof(volctrl)))
 			return -EFAULT;
 		azt_Play.start.min = 0x21;
 		azt_Play.start.sec = 0x84;
@@ -1455,7 +1454,7 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 	case CDROMREADCOOKED:	/*read data in mode 1 (2048 Bytes) */
 	case CDROMREADRAW:	/*read data in mode 2 (2336 Bytes) */
 		{
-			if (copy_from_user(&msf, (void *) arg, sizeof msf))
+			if (copy_from_user(&msf, argp, sizeof msf))
 				return -EFAULT;
 			/* convert to bcd */
 			azt_bin2bcd(&msf.cdmsf_min0);
@@ -1474,16 +1473,11 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 				if (DiskInfo.xa) {
 					return -1;	/*XA Disks can't be read raw */
 				} else {
-					if (sendAztCmd
-					    (ACMD_PLAY_READ_RAW,
-					     &azt_Play))
+					if (sendAztCmd(ACMD_PLAY_READ_RAW, &azt_Play))
 						return -1;
 					DTEN_LOW;
-					insb(DATA_PORT, buf,
-					     CD_FRAMESIZE_RAW);
-					if (copy_to_user
-					    ((void *) arg, &buf,
-					     CD_FRAMESIZE_RAW))
+					insb(DATA_PORT, buf, CD_FRAMESIZE_RAW);
+					if (copy_to_user(argp, &buf, CD_FRAMESIZE_RAW))
 						return -EFAULT;
 				}
 			} else
@@ -1492,14 +1486,13 @@ static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 					return -1;
 				DTEN_LOW;
 				insb(DATA_PORT, buf, CD_FRAMESIZE);
-				if (copy_to_user
-				    ((void *) arg, &buf, CD_FRAMESIZE))
+				if (copy_to_user(argp, &buf, CD_FRAMESIZE))
 					return -EFAULT;
 				}
 		}
 		break;
 	case CDROMSEEK:	/*seek msf address */
-		if (copy_from_user(&msf, (void *) arg, sizeof msf))
+		if (copy_from_user(&msf, argp, sizeof msf))
 			return -EFAULT;
 		/* convert to bcd */
 		azt_bin2bcd(&msf.cdmsf_min0);
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 1f65c1e72..d82006ca7 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -318,11 +318,11 @@ static const char *mrw_address_space[] = { "DMA", "GAA" };
 
 /* These are used to simplify getting data in from and back to user land */
 #define IOCTL_IN(arg, type, in)					\
-	if (copy_from_user(&(in), (type *) (arg), sizeof (in)))	\
+	if (copy_from_user(&(in), (type __user *) (arg), sizeof (in)))	\
 		return -EFAULT;
 
 #define IOCTL_OUT(arg, type, out) \
-	if (copy_to_user((type *) (arg), &(out), sizeof (out)))	\
+	if (copy_to_user((type __user *) (arg), &(out), sizeof (out)))	\
 		return -EFAULT;
 
 /* The (cdo->capability & ~cdi->mask & CDC_XXX) construct was used in
@@ -455,7 +455,7 @@ int unregister_cdrom(struct cdrom_device_info *unreg)
 int cdrom_get_media_event(struct cdrom_device_info *cdi,
 			  struct media_event_desc *med)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	unsigned char buffer[8];
 	struct event_header *eh = (struct event_header *) buffer;
 
@@ -482,7 +482,7 @@ int cdrom_get_media_event(struct cdrom_device_info *cdi,
  */
 int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char buffer[16];
 
 	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
@@ -503,7 +503,7 @@ int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
 
 int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct mrw_feature_desc *mfd;
 	unsigned char buffer[16];
 	int ret;
@@ -529,7 +529,7 @@ int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
 
 static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	unsigned char buffer[12];
 	int ret;
 
@@ -570,7 +570,7 @@ static int cdrom_mrw_bgformat(struct cdrom_device_info *cdi, int cont)
 
 static int cdrom_mrw_bgformat_susp(struct cdrom_device_info *cdi, int immed)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
 	init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE);
 	cgc.cmd[0] = GPCMD_CLOSE_TRACK;
@@ -588,7 +588,7 @@ static int cdrom_mrw_bgformat_susp(struct cdrom_device_info *cdi, int immed)
 
 static int cdrom_flush_cache(struct cdrom_device_info *cdi)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
 	init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE);
 	cgc.cmd[0] = GPCMD_FLUSH_CACHE;
@@ -619,7 +619,7 @@ static int cdrom_mrw_exit(struct cdrom_device_info *cdi)
 
 static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct mode_page_header *mph;
 	char buffer[16];
 	int ret, offset, size;
@@ -649,9 +649,8 @@ static int cdrom_mrw_set_lba_space(struct cdrom_device_info *cdi, int space)
 int cdrom_get_random_writable(struct cdrom_device_info *cdi,
 			      struct rwrt_feature_desc *rfd)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char buffer[24];
-	struct feature_header *fh;
 	int ret;
 
 	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
@@ -664,43 +663,32 @@ int cdrom_get_random_writable(struct cdrom_device_info *cdi,
 	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
 		return ret;
 
-	fh = (struct feature_header *)&buffer[0];
-	if (be32_to_cpu(fh->data_len) >= (sizeof(struct feature_header)+
-					  sizeof(struct rwrt_feature_desc)))
-		memcpy(rfd, &buffer[sizeof(struct feature_header)],
-		       sizeof (*rfd));
-	else
-		memset(rfd, 0, sizeof(*rfd));
-
+	memcpy(rfd, &buffer[sizeof(struct feature_header)], sizeof (*rfd));
 	return 0;
 }
 
 int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char buffer[16];
-	struct feature_header *fh;
 	__u16 *feature_code;
 	int ret;
 
 	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
 
-	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;	/* often 0x46 */
-	cgc.cmd[3] = CDF_HWDM;			/* often 0x0024 */
-	cgc.cmd[8] = sizeof(buffer);		/* often 0x10 */
+	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
+	cgc.cmd[3] = CDF_HWDM;
+	cgc.cmd[8] = sizeof(buffer);
 	cgc.quiet = 1;
 
 	if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
 		return ret;
 
-	fh = (struct feature_header *)&buffer[0];
-	ret = 1;
-	if (be32_to_cpu(fh->data_len) >= (sizeof(struct feature_header)+8)) {
-		feature_code = (__u16 *)&buffer[sizeof(struct feature_header)];
-		if (CDF_HWDM == be16_to_cpu(*feature_code))
-			ret = 0;
-	}
-	return ret;
+	feature_code = (__u16 *) &buffer[sizeof(struct feature_header)];
+	if (be16_to_cpu(*feature_code) == CDF_HWDM)
+		return 0;
+
+	return 1;
 }
 
 
@@ -785,7 +773,7 @@ static int cdrom_mrw_open_write(struct cdrom_device_info *cdi)
 
 static int mo_open_write(struct cdrom_device_info *cdi)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char buffer[255];
 	int ret;
 
@@ -1102,7 +1090,7 @@ int cdrom_release(struct cdrom_device_info *cdi, struct file *fp)
 static int cdrom_read_mech_status(struct cdrom_device_info *cdi, 
 				  struct cdrom_changer_info *buf)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 	int length;
 
@@ -1185,7 +1173,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
 /* If SLOT < 0, unload the current slot.  Otherwise, try to load SLOT. */
 static int cdrom_load_unload(struct cdrom_device_info *cdi, int slot) 
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
 	cdinfo(CD_CHANGER, "entering cdrom_load_unload()\n"); 
 	if (cdi->sanyo_slot && slot < 0)
@@ -1384,10 +1372,10 @@ void sanitize_format(union cdrom_addr *addr,
 	*curr = requested;
 }
 
-void init_cdrom_command(struct cdrom_generic_command *cgc, void *buf, int len,
+void init_cdrom_command(struct packet_command *cgc, void *buf, int len,
 			int type)
 {
-	memset(cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(cgc, 0, sizeof(struct packet_command));
 	if (buf)
 		memset(buf, 0, len);
 	cgc->buffer = (char *) buf;
@@ -1401,7 +1389,7 @@ void init_cdrom_command(struct cdrom_generic_command *cgc, void *buf, int len,
 #define copy_key(dest,src)	memcpy((dest), (src), sizeof(dvd_key))
 #define copy_chal(dest,src)	memcpy((dest), (src), sizeof(dvd_challenge))
 
-static void setup_report_key(struct cdrom_generic_command *cgc, unsigned agid, unsigned type)
+static void setup_report_key(struct packet_command *cgc, unsigned agid, unsigned type)
 {
 	cgc->cmd[0] = GPCMD_REPORT_KEY;
 	cgc->cmd[10] = type | (agid << 6);
@@ -1423,7 +1411,7 @@ static void setup_report_key(struct cdrom_generic_command *cgc, unsigned agid, u
 	cgc->data_direction = CGC_DATA_READ;
 }
 
-static void setup_send_key(struct cdrom_generic_command *cgc, unsigned agid, unsigned type)
+static void setup_send_key(struct packet_command *cgc, unsigned agid, unsigned type)
 {
 	cgc->cmd[0] = GPCMD_SEND_KEY;
 	cgc->cmd[10] = type | (agid << 6);
@@ -1449,7 +1437,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 {
 	int ret;
 	u_char buf[20];
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 	rpc_state_t rpc_state;
 
@@ -1595,7 +1583,7 @@ static int dvd_read_physical(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	unsigned char buf[21], *base;
 	struct dvd_layer *layer;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 	int ret, layer_num = s->physical.layer_num;
 
@@ -1645,7 +1633,7 @@ static int dvd_read_copyright(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	int ret;
 	u_char buf[8];
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 
 	init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
@@ -1668,7 +1656,7 @@ static int dvd_read_disckey(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	int ret, size;
 	u_char *buf;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 
 	size = sizeof(s->disckey.value) + 4;
@@ -1694,7 +1682,7 @@ static int dvd_read_bca(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	int ret;
 	u_char buf[4 + 188];
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 
 	init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
@@ -1719,7 +1707,7 @@ static int dvd_read_manufact(struct cdrom_device_info *cdi, dvd_struct *s)
 {
 	int ret = 0, size;
 	u_char *buf;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct cdrom_device_ops *cdo = cdi->ops;
 
 	size = sizeof(s->manufact.value) + 4;
@@ -1777,7 +1765,7 @@ static int dvd_read_struct(struct cdrom_device_info *cdi, dvd_struct *s)
 }
 
 int cdrom_mode_sense(struct cdrom_device_info *cdi,
-		     struct cdrom_generic_command *cgc,
+		     struct packet_command *cgc,
 		     int page_code, int page_control)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
@@ -1793,7 +1781,7 @@ int cdrom_mode_sense(struct cdrom_device_info *cdi,
 }
 
 int cdrom_mode_select(struct cdrom_device_info *cdi,
-		      struct cdrom_generic_command *cgc)
+		      struct packet_command *cgc)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
 
@@ -1811,7 +1799,7 @@ static int cdrom_read_subchannel(struct cdrom_device_info *cdi,
 				 struct cdrom_subchnl *subchnl, int mcn)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char buffer[32];
 	int ret;
 
@@ -1845,7 +1833,7 @@ static int cdrom_read_subchannel(struct cdrom_device_info *cdi,
  * Specific READ_10 interface
  */
 static int cdrom_read_cd(struct cdrom_device_info *cdi,
-			 struct cdrom_generic_command *cgc, int lba,
+			 struct packet_command *cgc, int lba,
 			 int blocksize, int nblocks)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
@@ -1865,7 +1853,7 @@ static int cdrom_read_cd(struct cdrom_device_info *cdi,
 
 /* very generic interface for reading the various types of blocks */
 static int cdrom_read_block(struct cdrom_device_info *cdi,
-			    struct cdrom_generic_command *cgc,
+			    struct packet_command *cgc,
 			    int lba, int nblocks, int format, int blksize)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
@@ -1899,7 +1887,7 @@ static int cdrom_read_block(struct cdrom_device_info *cdi,
 static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 			       int lba, int nframes)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int nr, ret;
 
 	memset(&cgc, 0, sizeof(cgc));
@@ -2052,7 +2040,7 @@ int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip,
 	int ret;
 
 	/* Try the generic SCSI command ioctl's first.. */
-	ret = scsi_cmd_ioctl(ip->i_bdev->bd_disk, cmd, arg);
+	ret = scsi_cmd_ioctl(ip->i_bdev->bd_disk, cmd, (void __user *)arg);
 	if (ret != -ENOTTY)
 		return ret;
 
@@ -2446,7 +2434,7 @@ int msf_to_lba(char m, char s, char f)
 static int cdrom_switch_blocksize(struct cdrom_device_info *cdi, int size)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct modesel_head mh;
 
 	memset(&mh, 0, sizeof(mh));
@@ -2472,7 +2460,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
 		     unsigned long arg)
 {		
 	struct cdrom_device_ops *cdo = cdi->ops;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct request_sense sense;
 	char buffer[32];
 	int ret = 0;
@@ -2526,7 +2514,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
 			ret = cdrom_read_cd(cdi, &cgc, lba, blocksize, 1);
 			ret |= cdrom_switch_blocksize(cdi, blocksize);
 		}
-		if (!ret && copy_to_user((char *)arg, cgc.buffer, blocksize))
+		if (!ret && copy_to_user((char __user *)arg, cgc.buffer, blocksize))
 			ret = -EFAULT;
 		kfree(cgc.buffer);
 		return ret;
@@ -2678,7 +2666,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
 		if ((s = (dvd_struct *) kmalloc(size, GFP_KERNEL)) == NULL)
 			return -ENOMEM;
 		cdinfo(CD_DO_IOCTL, "entering DVD_READ_STRUCT\n"); 
-		if (copy_from_user(s, (dvd_struct *)arg, size)) {
+		if (copy_from_user(s, (dvd_struct __user *)arg, size)) {
 			kfree(s);
 			return -EFAULT;
 		}
@@ -2686,7 +2674,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
 			kfree(s);
 			return ret;
 		}
-		if (copy_to_user((dvd_struct *)arg, s, size))
+		if (copy_to_user((dvd_struct __user *)arg, s, size))
 			ret = -EFAULT;
 		kfree(s);
 		return ret;
@@ -2729,7 +2717,7 @@ static int cdrom_get_track_info(struct cdrom_device_info *cdi, __u16 track, __u8
 			 track_information *ti)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int ret;
 
 	init_cdrom_command(&cgc, ti, 8, CGC_DATA_READ);
@@ -2757,7 +2745,7 @@ static int cdrom_get_track_info(struct cdrom_device_info *cdi, __u16 track, __u8
 static int cdrom_get_disc_info(struct cdrom_device_info *cdi, disc_information *di)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int ret;
 
 	/* set up command and get the disc info */
@@ -2906,7 +2894,7 @@ struct cdrom_sysctl_settings {
 } cdrom_sysctl_settings;
 
 int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
-                           void *buffer, size_t *lenp)
+                           void __user *buffer, size_t *lenp)
 {
         int pos;
 	struct cdrom_device_info *cdi;
@@ -3033,7 +3021,7 @@ void cdrom_update_settings(void)
 }
 
 static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
-				void *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp)
 {
 	int *valp = ctl->data;
 	int val = *valp;
diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c
index 4b3834923..3a758a020 100644
--- a/drivers/cdrom/cdu31a.c
+++ b/drivers/cdrom/cdu31a.c
@@ -2595,11 +2595,10 @@ static int read_audio(struct cdrom_read_audio *ra)
 						retval = -EIO;
 						goto exit_read_audio;
 					}
-				} else if (copy_to_user((char *)(ra->buf +
+				} else if (copy_to_user(ra->buf +
 							       (CD_FRAMESIZE_RAW
-								* cframe)),
-							(char *)
-							       readahead_buffer,
+								* cframe),
+						        readahead_buffer,
 							CD_FRAMESIZE_RAW)) {
 					retval = -EFAULT;
 					goto exit_read_audio;
@@ -2612,8 +2611,7 @@ static int read_audio(struct cdrom_read_audio *ra)
 				retval = -EIO;
 				goto exit_read_audio;
 			}
-		} else if (copy_to_user((char *)(ra->buf + (CD_FRAMESIZE_RAW *
-							    cframe)),
+		} else if (copy_to_user(ra->buf + (CD_FRAMESIZE_RAW * cframe),
 					(char *)readahead_buffer,
 					CD_FRAMESIZE_RAW)) {
 			retval = -EFAULT;
@@ -2945,6 +2943,7 @@ static int scd_audio_ioctl(struct cdrom_device_info *cdi,
 static int scd_dev_ioctl(struct cdrom_device_info *cdi,
 			 unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
 	int i;
 
 	switch (cmd) {
@@ -2959,7 +2958,7 @@ static int scd_dev_ioctl(struct cdrom_device_info *cdi,
 				return -EIO;
 			}
 
-			if (copy_from_user(&ra, (char *) arg, sizeof(ra)))
+			if (copy_from_user(&ra, argp, sizeof(ra)))
 				return -EFAULT;
 
 			if (ra.nframes == 0) {
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index 7e9758fe7..62e2d11b3 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -1440,12 +1440,12 @@ static int cdromresume(void)
 }
 
 
-static int cdromplaymsf(unsigned long arg)
+static int cdromplaymsf(void __user *arg)
 {
 	int status;
 	struct cdrom_msf msf;
 
-	if (copy_from_user(&msf, (void *) arg, sizeof msf))
+	if (copy_from_user(&msf, arg, sizeof msf))
 		return -EFAULT;
 
 	bin2bcd(&msf);
@@ -1461,13 +1461,13 @@ static int cdromplaymsf(unsigned long arg)
 }
 
 
-static int cdromplaytrkind(unsigned long arg)
+static int cdromplaytrkind(void __user *arg)
 {
 	int status;
 	struct cdrom_ti ti;
 	struct cdrom_msf msf;
 
-	if (copy_from_user(&ti, (void *) arg, sizeof ti))
+	if (copy_from_user(&ti, arg, sizeof ti))
 		return -EFAULT;
 
 	if (ti.cdti_trk0 < disk_info.first
@@ -1505,23 +1505,23 @@ static int cdromplaytrkind(unsigned long arg)
 }
 
 
-static int cdromreadtochdr(unsigned long arg)
+static int cdromreadtochdr(void __user *arg)
 {
 	struct cdrom_tochdr tochdr;
 
 	tochdr.cdth_trk0 = disk_info.first;
 	tochdr.cdth_trk1 = disk_info.last;
 
-	return copy_to_user((void *)arg, &tochdr, sizeof tochdr) ? -EFAULT : 0;
+	return copy_to_user(arg, &tochdr, sizeof tochdr) ? -EFAULT : 0;
 }
 
 
-static int cdromreadtocentry(unsigned long arg)
+static int cdromreadtocentry(void __user *arg)
 {
 	struct cdrom_tocentry entry;
 	struct cdrom_subchnl *tocptr;
 
-	if (copy_from_user(&entry, (void *) arg, sizeof entry))
+	if (copy_from_user(&entry, arg, sizeof entry))
 		return -EFAULT;
 
 	if (entry.cdte_track == CDROM_LEADOUT)
@@ -1544,17 +1544,17 @@ static int cdromreadtocentry(unsigned long arg)
 	else if (entry.cdte_format != CDROM_MSF)
 		return -EINVAL;
 
-	return copy_to_user((void *)arg, &entry, sizeof entry) ? -EFAULT : 0;
+	return copy_to_user(arg, &entry, sizeof entry) ? -EFAULT : 0;
 }
 
 
-static int cdromvolctrl(unsigned long arg)
+static int cdromvolctrl(void __user *arg)
 {
 	int status;
 	struct cdrom_volctrl volctrl;
 	struct cdrom_msf msf;
 
-	if (copy_from_user(&volctrl, (char *) arg, sizeof volctrl))
+	if (copy_from_user(&volctrl, arg, sizeof volctrl))
 		return -EFAULT;
 
 	msf.cdmsf_min0 = 0x10;
@@ -1573,12 +1573,12 @@ static int cdromvolctrl(unsigned long arg)
 }
 
 
-static int cdromsubchnl(unsigned long arg)
+static int cdromsubchnl(void __user *arg)
 {
 	int status;
 	struct cdrom_subchnl subchnl;
 
-	if (copy_from_user(&subchnl, (void *) arg, sizeof subchnl))
+	if (copy_from_user(&subchnl, arg, sizeof subchnl))
 		return -EFAULT;
 
 	if (subchnl.cdsc_format != CDROM_LBA
@@ -1591,7 +1591,7 @@ static int cdromsubchnl(unsigned long arg)
 		return -EIO;
 	}
 
-	if (copy_to_user((void *)arg, &subchnl, sizeof subchnl))
+	if (copy_to_user(arg, &subchnl, sizeof subchnl))
 		return -EFAULT;
 	return 0;
 }
@@ -1600,12 +1600,12 @@ static int cdromsubchnl(unsigned long arg)
 static struct gendisk *optcd_disk;
 
 
-static int cdromread(unsigned long arg, int blocksize, int cmd)
+static int cdromread(void __user *arg, int blocksize, int cmd)
 {
 	int status;
 	struct cdrom_msf msf;
 
-	if (copy_from_user(&msf, (void *) arg, sizeof msf))
+	if (copy_from_user(&msf, arg, sizeof msf))
 		return -EFAULT;
 
 	bin2bcd(&msf);
@@ -1621,19 +1621,19 @@ static int cdromread(unsigned long arg, int blocksize, int cmd)
 
 	fetch_data(optcd_disk->private_data, blocksize);
 
-	if (copy_to_user((void *)arg, optcd_disk->private_data, blocksize))
+	if (copy_to_user(arg, optcd_disk->private_data, blocksize))
 		return -EFAULT;
 
 	return 0;
 }
 
 
-static int cdromseek(unsigned long arg)
+static int cdromseek(void __user *arg)
 {
 	int status;
 	struct cdrom_msf msf;
 
-	if (copy_from_user(&msf, (void *)arg, sizeof msf))
+	if (copy_from_user(&msf, arg, sizeof msf))
 		return -EFAULT;
 
 	bin2bcd(&msf);
@@ -1648,11 +1648,11 @@ static int cdromseek(unsigned long arg)
 
 
 #ifdef MULTISESSION
-static int cdrommultisession(unsigned long arg)
+static int cdrommultisession(void __user *arg)
 {
 	struct cdrom_multisession ms;
 
-	if (copy_from_user(&ms, (void*) arg, sizeof ms))
+	if (copy_from_user(&ms, arg, sizeof ms))
 		return -EFAULT;
 
 	ms.addr.msf.minute = disk_info.last_session.minute;
@@ -1667,7 +1667,7 @@ static int cdrommultisession(unsigned long arg)
 
 	ms.xa_flag = disk_info.xa;
 
-  	if (copy_to_user((void *)arg, &ms, sizeof(struct cdrom_multisession)))
+  	if (copy_to_user(arg, &ms, sizeof(struct cdrom_multisession)))
 		return -EFAULT;
 
 #if DEBUG_MULTIS
@@ -1717,6 +1717,7 @@ static int opt_ioctl(struct inode *ip, struct file *fp,
                      unsigned int cmd, unsigned long arg)
 {
 	int status, err, retval = 0;
+	void __user *argp = (void __user *)arg;
 
 	DEBUG((DEBUG_VFS, "starting opt_ioctl"));
 
@@ -1767,10 +1768,10 @@ static int opt_ioctl(struct inode *ip, struct file *fp,
 	switch (cmd) {
 	case CDROMPAUSE:	retval = cdrompause(); break;
 	case CDROMRESUME:	retval = cdromresume(); break;
-	case CDROMPLAYMSF:	retval = cdromplaymsf(arg); break;
-	case CDROMPLAYTRKIND:	retval = cdromplaytrkind(arg); break;
-	case CDROMREADTOCHDR:	retval = cdromreadtochdr(arg); break;
-	case CDROMREADTOCENTRY:	retval = cdromreadtocentry(arg); break;
+	case CDROMPLAYMSF:	retval = cdromplaymsf(argp); break;
+	case CDROMPLAYTRKIND:	retval = cdromplaytrkind(argp); break;
+	case CDROMREADTOCHDR:	retval = cdromreadtochdr(argp); break;
+	case CDROMREADTOCENTRY:	retval = cdromreadtocentry(argp); break;
 
 	case CDROMSTOP:		err = exec_cmd(COMSTOP);
 				if (err < 0) {
@@ -1799,8 +1800,8 @@ static int opt_ioctl(struct inode *ip, struct file *fp,
 				}
 				break;
 
-	case CDROMVOLCTRL:	retval = cdromvolctrl(arg); break;
-	case CDROMSUBCHNL:	retval = cdromsubchnl(arg); break;
+	case CDROMVOLCTRL:	retval = cdromvolctrl(argp); break;
+	case CDROMSUBCHNL:	retval = cdromsubchnl(argp); break;
 
 	/* The drive detects the mode and automatically delivers the
 	   correct 2048 bytes, so we don't need these IOCTLs */
@@ -1814,7 +1815,7 @@ static int opt_ioctl(struct inode *ip, struct file *fp,
 				break;
 
 #ifdef MULTISESSION
-	case CDROMMULTISESSION:	retval = cdrommultisession(arg); break;
+	case CDROMMULTISESSION:	retval = cdrommultisession(argp); break;
 #endif
 
 	case CDROM_GET_MCN:	retval = -EINVAL; break; /* not implemented */
@@ -1822,16 +1823,16 @@ static int opt_ioctl(struct inode *ip, struct file *fp,
 
 	case CDROMREADRAW:
 			/* this drive delivers 2340 bytes in raw mode */
-			retval = cdromread(arg, CD_FRAMESIZE_RAW1, COMREADRAW);
+			retval = cdromread(argp, CD_FRAMESIZE_RAW1, COMREADRAW);
 			break;
 	case CDROMREADCOOKED:
-			retval = cdromread(arg, CD_FRAMESIZE, COMREAD);
+			retval = cdromread(argp, CD_FRAMESIZE, COMREAD);
 			break;
 	case CDROMREADALL:
-			retval = cdromread(arg, CD_FRAMESIZE_RAWER, COMREADALL);
+			retval = cdromread(argp, CD_FRAMESIZE_RAWER, COMREADALL);
 			break;
 
-	case CDROMSEEK:		retval = cdromseek(arg); break;
+	case CDROMSEEK:		retval = cdromseek(argp); break;
 	case CDROMPLAYBLK:	retval = -EINVAL; break; /* not implemented */
 	case CDROMCLOSETRAY:	break;	/* The action was taken earlier */
 	default:		retval = -EINVAL;
diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c
index 810887818..0e60b5c6a 100644
--- a/drivers/cdrom/sjcd.c
+++ b/drivers/cdrom/sjcd.c
@@ -716,13 +716,11 @@ static int sjcd_tray_open(void)
 static int sjcd_ioctl(struct inode *ip, struct file *fp,
 		      unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
 #if defined( SJCD_TRACE )
 	printk("SJCD:ioctl\n");
 #endif
 
-	if (ip == NULL)
-		return (-EINVAL);
-
 	sjcd_get_status();
 	if (!sjcd_status_valid)
 		return (-EIO);
@@ -795,7 +793,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 #if defined( SJCD_TRACE )
 			printk("SJCD: ioctl: playtrkind\n");
 #endif
-			if (!copy_from_user(&ti, (void *) arg, sizeof(ti))) {
+			if (!copy_from_user(&ti, argp, sizeof(ti))) {
 				s = 0;
 				if (ti.cdti_trk0 < sjcd_first_track_no)
 					return (-EINVAL);
@@ -833,7 +831,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 			printk("SJCD: ioctl: playmsf\n");
 #endif
 			if ((s =
-			     verify_area(VERIFY_READ, (void *) arg,
+			     verify_area(VERIFY_READ, argp,
 					 sizeof(sjcd_msf))) == 0) {
 				if (sjcd_audio_status == CDROM_AUDIO_PLAY) {
 					sjcd_send_cmd(SCMD_PAUSE);
@@ -842,7 +840,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 					    CDROM_AUDIO_NO_STATUS;
 				}
 
-				if (copy_from_user(&sjcd_msf, (void *) arg,
+				if (copy_from_user(&sjcd_msf, argp,
 					       sizeof(sjcd_msf)))
 					return (-EFAULT);
 
@@ -877,7 +875,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 #endif
 			toc_header.cdth_trk0 = sjcd_first_track_no;
 			toc_header.cdth_trk1 = sjcd_last_track_no;
-			if (copy_to_user((void *)arg, &toc_header,
+			if (copy_to_user(argp, &toc_header,
 					 sizeof(toc_header)))
 				return -EFAULT;
 			return 0;
@@ -890,11 +888,11 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 			printk("SJCD: ioctl: readtocentry\n");
 #endif
 			if ((s =
-			     verify_area(VERIFY_WRITE, (void *) arg,
+			     verify_area(VERIFY_WRITE, argp,
 					 sizeof(toc_entry))) == 0) {
 				struct sjcd_hw_disk_info *tp;
 
-				if (copy_from_user(&toc_entry, (void *) arg,
+				if (copy_from_user(&toc_entry, argp,
 					       sizeof(toc_entry)))
 					return (-EFAULT);
 				if (toc_entry.cdte_track == CDROM_LEADOUT)
@@ -931,7 +929,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 				default:
 					return (-EINVAL);
 				}
-				if (copy_to_user((void *) arg, &toc_entry,
+				if (copy_to_user(argp, &toc_entry,
 						 sizeof(toc_entry)))
 					s = -EFAULT;
 			}
@@ -945,11 +943,11 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 			printk("SJCD: ioctl: subchnl\n");
 #endif
 			if ((s =
-			     verify_area(VERIFY_WRITE, (void *) arg,
+			     verify_area(VERIFY_WRITE, argp,
 					 sizeof(subchnl))) == 0) {
 				struct sjcd_hw_qinfo q_info;
 
-				if (copy_from_user(&subchnl, (void *) arg,
+				if (copy_from_user(&subchnl, argp,
 					       sizeof(subchnl)))
 					return (-EFAULT);
 
@@ -990,7 +988,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 				default:
 					return (-EINVAL);
 				}
-				if (copy_to_user((void *) arg, &subchnl,
+				if (copy_to_user(argp, &subchnl,
 					         sizeof(subchnl)))
 					s = -EFAULT;
 			}
@@ -1004,11 +1002,11 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 			printk("SJCD: ioctl: volctrl\n");
 #endif
 			if ((s =
-			     verify_area(VERIFY_READ, (void *) arg,
+			     verify_area(VERIFY_READ, argp,
 					 sizeof(vol_ctrl))) == 0) {
 				unsigned char dummy[4];
 
-				if (copy_from_user(&vol_ctrl, (void *) arg,
+				if (copy_from_user(&vol_ctrl, argp,
 					       sizeof(vol_ctrl)))
 					return (-EFAULT);
 				sjcd_send_4_cmd(SCMD_SET_VOLUME,
@@ -1038,8 +1036,7 @@ static int sjcd_ioctl(struct inode *ip, struct file *fp,
 #if defined( SJCD_TRACE )
 			printk("SJCD: ioctl: statistic\n");
 #endif
-			if (copy_to_user((void *)arg, &statistic,
-					 sizeof(statistic)))
+			if (copy_to_user(argp, &statistic, sizeof(statistic)))
 				return -EFAULT;
 			return 0;
 		}
diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
index 1d55bf861..a0c9c8d42 100644
--- a/drivers/cdrom/sonycd535.c
+++ b/drivers/cdrom/sonycd535.c
@@ -997,7 +997,7 @@ read_subcode(void)
  * (not BCD), so all the conversions are done.
  */
 static int
-sony_get_subchnl_info(long arg)
+sony_get_subchnl_info(void __user *arg)
 {
 	struct cdrom_subchnl schi;
 
@@ -1009,7 +1009,7 @@ sony_get_subchnl_info(long arg)
 	if (!sony_toc_read) {
 		return -EIO;
 	}
-	if (copy_from_user(&schi, (char *)arg, sizeof schi))
+	if (copy_from_user(&schi, arg, sizeof schi))
 		return -EFAULT;
 
 	switch (sony_audio_status) {
@@ -1025,7 +1025,7 @@ sony_get_subchnl_info(long arg)
 
 	case CDROM_AUDIO_NO_STATUS:
 		schi.cdsc_audiostatus = sony_audio_status;
-		if (copy_to_user((char *)arg, &schi, sizeof schi))
+		if (copy_to_user(arg, &schi, sizeof schi))
 			return -EFAULT;
 		return 0;
 		break;
@@ -1053,7 +1053,7 @@ sony_get_subchnl_info(long arg)
 		schi.cdsc_absaddr.lba = msf_to_log(last_sony_subcode->abs_msf);
 		schi.cdsc_reladdr.lba = msf_to_log(last_sony_subcode->rel_msf);
 	}
-	return copy_to_user((char *)arg, &schi, sizeof schi) ? -EFAULT : 0;
+	return copy_to_user(arg, &schi, sizeof schi) ? -EFAULT : 0;
 }
 
 
@@ -1070,6 +1070,7 @@ cdu_ioctl(struct inode *inode,
 	Byte cmd_buff[10], params[10];
 	int  i;
 	int  dsc_status;
+	void __user *argp = (void __user *)arg;
 
 	if (check_drive_status() != 0)
 		return -EIO;
@@ -1152,7 +1153,7 @@ cdu_ioctl(struct inode *inode,
 		break;
 
 	case CDROMPLAYMSF:			/* Play starting at the given MSF address. */
-		if (copy_from_user(params, (void *)arg, 6))
+		if (copy_from_user(params, argp, 6))
 			return -EFAULT;
 		spin_up_drive(status);
 		set_drive_mode(SONY535_AUDIO_DRIVE_MODE, status);
@@ -1184,13 +1185,12 @@ cdu_ioctl(struct inode *inode,
 
 	case CDROMREADTOCHDR:		/* Read the table of contents header */
 		{
-			struct cdrom_tochdr *hdr;
+			struct cdrom_tochdr __user *hdr = argp;
 			struct cdrom_tochdr loc_hdr;
 
 			sony_get_toc();
 			if (!sony_toc_read)
 				return -EIO;
-			hdr = (struct cdrom_tochdr *)arg;
 			loc_hdr.cdth_trk0 = bcd_to_int(sony_toc->first_track_num);
 			loc_hdr.cdth_trk1 = bcd_to_int(sony_toc->last_track_num);
 			if (copy_to_user(hdr, &loc_hdr, sizeof *hdr))
@@ -1201,7 +1201,7 @@ cdu_ioctl(struct inode *inode,
 
 	case CDROMREADTOCENTRY:	/* Read a given table of contents entry */
 		{
-			struct cdrom_tocentry *entry;
+			struct cdrom_tocentry __user *entry = argp;
 			struct cdrom_tocentry loc_entry;
 			int  track_idx;
 			Byte *msf_val = NULL;
@@ -1210,7 +1210,6 @@ cdu_ioctl(struct inode *inode,
 			if (!sony_toc_read) {
 				return -EIO;
 			}
-			entry = (struct cdrom_tocentry *)arg;
 
 			if (copy_from_user(&loc_entry, entry, sizeof loc_entry))
 				return -EFAULT;
@@ -1252,7 +1251,7 @@ cdu_ioctl(struct inode *inode,
 			if (!sony_toc_read)
 				return -EIO;
 
-			if (copy_from_user(&ti, (char *)arg, sizeof ti))
+			if (copy_from_user(&ti, argp, sizeof ti))
 				return -EFAULT;
 			if ((ti.cdti_trk0 < sony_toc->first_track_num)
 				|| (sony_toc->last_track_num < ti.cdti_trk0)
@@ -1314,14 +1313,13 @@ cdu_ioctl(struct inode *inode,
 		}
 
 	case CDROMSUBCHNL:			/* Get subchannel info */
-		return sony_get_subchnl_info(arg);
+		return sony_get_subchnl_info(argp);
 
 	case CDROMVOLCTRL:			/* Volume control.  What volume does this change, anyway? */
 		{
 			struct cdrom_volctrl volctrl;
 
-			if (copy_from_user(&volctrl, (char *)arg,
-					   sizeof volctrl))
+			if (copy_from_user(&volctrl, argp, sizeof volctrl))
 				return -EFAULT;
 			cmd_buff[0] = SONY535_SET_VOLUME;
 			cmd_buff[1] = volctrl.channel0;
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 3419e8267..69122d880 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -112,15 +112,13 @@ config CYCLADES
 	tristate "Cyclades async mux support"
 	depends on SERIAL_NONSTANDARD
 	---help---
-	  This is a driver for a card that gives you many serial ports. You
-	  would need something like this to connect more than two modems to
+	  This driver supports Cyclades Z and Y multiserial boards.
+	  You would need something like this to connect more than two modems to
 	  your Linux box, for instance in order to become a dial-in server.
+
 	  For information about the Cyclades-Z card, read
 	  <file:drivers/char/README.cycladesZ>.
 
-	  As of 1.3.9x kernels, this driver's minor numbers start at 0 instead
-	  of 32.
-
 	  To compile this driver as a module, choose M here: the
 	  module will be called cyclades.
 
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 8942d16c3..2a42fd3c7 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_N_HDLC)		+= n_hdlc.o
 obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
 obj-$(CONFIG_SX)		+= sx.o generic_serial.o
 obj-$(CONFIG_RIO)		+= rio/ generic_serial.o
-obj-$(CONFIG_SH_SCI)		+= sh-sci.o generic_serial.o
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_console.o
 obj-$(CONFIG_RAW_DRIVER)	+= raw.o
 obj-$(CONFIG_SGI_L1_SERIAL)	+= sn_serial.o
@@ -70,7 +69,6 @@ obj-$(CONFIG_QIC02_TAPE) += tpqic02.o
 obj-$(CONFIG_FTAPE) += ftape/
 obj-$(CONFIG_H8) += h8.o
 obj-$(CONFIG_PPDEV) += ppdev.o
-obj-$(CONFIG_DZ) += dz.o
 obj-$(CONFIG_NWBUTTON) += nwbutton.o
 obj-$(CONFIG_NWFLASH) += nwflash.o
 obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
index b1b532459..f1db2f86a 100644
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
@@ -20,6 +20,8 @@
 #define AMD_TLBFLUSH	0x0c	/* In mmio region (32-bit register) */
 #define AMD_CACHEENTRY	0x10	/* In mmio region (32-bit register) */
 
+static struct pci_device_id agp_amdk7_pci_table[];
+
 struct amd_page_map {
 	unsigned long *real;
 	unsigned long *remapped;
@@ -41,7 +43,7 @@ static int amd_create_page_map(struct amd_page_map *page_map)
 
 	SetPageReserved(virt_to_page(page_map->real));
 	global_cache_flush();
-	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 
+	page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
 					    PAGE_SIZE);
 	if (page_map->remapped == NULL) {
 		ClearPageReserved(virt_to_page(page_map->real));
@@ -90,7 +92,7 @@ static int amd_create_gatt_pages(int nr_tables)
 	int retval = 0;
 	int i;
 
-	tables = kmalloc((nr_tables + 1) * sizeof(struct amd_page_map *), 
+	tables = kmalloc((nr_tables + 1) * sizeof(struct amd_page_map *),
 			 GFP_KERNEL);
 	if (tables == NULL)
 		return -ENOMEM;
@@ -124,7 +126,7 @@ static int amd_create_gatt_pages(int nr_tables)
 #define GET_PAGE_DIR_OFF(addr) (addr >> 22)
 #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr) - \
 	GET_PAGE_DIR_OFF(agp_bridge->gart_bus_addr))
-#define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12) 
+#define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12)
 #define GET_GATT(addr) (amd_irongate_private.gatt_pages[\
 	GET_PAGE_DIR_IDX(addr)]->remapped)
 
@@ -174,7 +176,7 @@ static int amd_create_gatt_table(void)
 static int amd_free_gatt_table(void)
 {
 	struct amd_page_map page_dir;
-   
+
 	page_dir.real = (unsigned long *)agp_bridge->gatt_table_real;
 	page_dir.remapped = (unsigned long *)agp_bridge->gatt_table;
 
@@ -224,9 +226,9 @@ static int amd_irongate_configure(void)
 
 	/* Write the Sync register */
 	pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL, 0x80);
-   
-   	/* Set indexing mode */
-   	pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL2, 0x00);
+
+	/* Set indexing mode */
+	pci_write_config_byte(agp_bridge->dev, AMD_MODECNTL2, 0x00);
 
 	/* Write the enable register */
 	enable_reg = INREG16(amd_irongate_private.registers, AMD_GARTENABLE);
@@ -394,7 +396,6 @@ static struct agp_device_ids amd_agp_device_ids[] __devinitdata =
 static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
 				     const struct pci_device_id *ent)
 {
-	struct agp_device_ids *devs = amd_agp_device_ids;
 	struct agp_bridge_data *bridge;
 	u8 cap_ptr;
 	int j;
@@ -403,19 +404,10 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
 	if (!cap_ptr)
 		return -ENODEV;
 
-	for (j = 0; devs[j].chipset_name; j++) {
-		if (pdev->device == devs[j].device_id) {
-			printk (KERN_INFO PFX "Detected AMD %s chipset\n",
-					devs[j].chipset_name);
-			goto found;
-		}
-	}
-
-	printk(KERN_ERR PFX "Unsupported AMD chipset (device id: %04x)\n",
-		    pdev->device);
-	return -ENODEV;
+	j = ent - agp_amdk7_pci_table;
+	printk(KERN_INFO PFX "Detected AMD %s chipset\n",
+	       amd_agp_device_ids[j].chipset_name);
 
-found:
 	bridge = agp_alloc_bridge();
 	if (!bridge)
 		return -ENOMEM;
@@ -442,12 +434,29 @@ static void __devexit agp_amdk7_remove(struct pci_dev *pdev)
 	agp_put_bridge(bridge);
 }
 
+/* must be the same order as name table above */
 static struct pci_device_id agp_amdk7_pci_table[] = {
 	{
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
 	.class_mask	= ~0,
 	.vendor		= PCI_VENDOR_ID_AMD,
-	.device		= PCI_ANY_ID,
+	.device		= PCI_DEVICE_ID_AMD_FE_GATE_7006,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_AMD,
+	.device		= PCI_DEVICE_ID_AMD_FE_GATE_700E,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_AMD,
+	.device		= PCI_DEVICE_ID_AMD_FE_GATE_700C,
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index def65689a..06a7ef269 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -1,7 +1,7 @@
-/* 
+/*
  * Copyright 2001-2003 SuSE Labs.
  * Distributed under the GNU public license, v2.
- * 
+ *
  * This is a GART driver for the AMD Opteron/Athlon64 on-CPU northbridge.
  * It also includes support for the AMD 8151 AGP bridge,
  * although it doesn't actually do much, as all the real
@@ -194,7 +194,7 @@ static u64 amd64_configure (struct pci_dev *hammer, u64 gatt_table)
 
 	/* keep CPU's coherent. */
 	flush_amd64_tlb (hammer);
-	
+
 	return aper_base;
 }
 
@@ -261,53 +261,53 @@ struct agp_bridge_driver amd_8151_driver = {
 
 /* Some basic sanity checks for the aperture. */
 static int __devinit aperture_valid(u64 aper, u32 size)
-{ 
+{
 	u32 pfn, c;
-	if (aper == 0) { 
+	if (aper == 0) {
 		printk(KERN_ERR PFX "No aperture\n");
-		return 0; 
+		return 0;
 	}
 	if (size < 32*1024*1024) {
 		printk(KERN_ERR PFX "Aperture too small (%d MB)\n", size>>20);
 		return 0;
 	}
-	if (aper + size > 0xffffffff) { 
-		printk(KERN_ERR PFX "Aperture out of bounds\n"); 
+	if (aper + size > 0xffffffff) {
+		printk(KERN_ERR PFX "Aperture out of bounds\n");
 		return 0;
-	} 
+	}
 	pfn = aper >> PAGE_SHIFT;
-	for (c = 0; c < size/PAGE_SIZE; c++) { 
+	for (c = 0; c < size/PAGE_SIZE; c++) {
 		if (!pfn_valid(pfn + c))
 			break;
-		if (!PageReserved(pfn_to_page(pfn + c))) { 
+		if (!PageReserved(pfn_to_page(pfn + c))) {
 			printk(KERN_ERR PFX "Aperture pointing to RAM\n");
 			return 0;
 		}
 	}
 
 	/* Request the Aperture. This catches cases when someone else
-	   already put a mapping in there - happens with some very broken BIOS 
+	   already put a mapping in there - happens with some very broken BIOS
 
-	   Maybe better to use pci_assign_resource/pci_enable_device instead trusting
-	   the bridges? */
+	   Maybe better to use pci_assign_resource/pci_enable_device instead
+	   trusting the bridges? */
 	if (!aperture_resource &&
 	    !(aperture_resource = request_mem_region(aper, size, "aperture"))) {
-		printk(KERN_ERR PFX "Aperture conflicts with PCI mapping.\n"); 
+		printk(KERN_ERR PFX "Aperture conflicts with PCI mapping.\n");
 		return 0;
 	}
 	return 1;
-} 
+}
 
-/* 
+/*
  * W*s centric BIOS sometimes only set up the aperture in the AGP
- * bridge, not the northbridge. On AMD64 this is handled early 
+ * bridge, not the northbridge. On AMD64 this is handled early
  * in aperture.c, but when GART_IOMMU is not enabled or we run
- * on a 32bit kernel this needs to be redone. 
+ * on a 32bit kernel this needs to be redone.
  * Unfortunately it is impossible to fix the aperture here because it's too late
  * to allocate that much memory. But at least error out cleanly instead of
  * crashing.
- */ 
-static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, 
+ */
+static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
 								 u16 cap)
 {
 	u32 aper_low, aper_hi;
@@ -316,38 +316,38 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
 	u32 nb_order, nb_base;
 	u16 apsize;
 
-	pci_read_config_dword(nb, 0x90, &nb_order); 
+	pci_read_config_dword(nb, 0x90, &nb_order);
 	nb_order = (nb_order >> 1) & 7;
-	pci_read_config_dword(nb, 0x94, &nb_base); 
-	nb_aper = nb_base << 25;	
-	if (aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) { 
+	pci_read_config_dword(nb, 0x94, &nb_base);
+	nb_aper = nb_base << 25;
+	if (aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) {
 		return 0;
 	}
 
 	/* Northbridge seems to contain crap. Try the AGP bridge. */
 
-	pci_read_config_word(agp, cap+0x14, &apsize); 
-	if (apsize == 0xffff) 
-		return -1; 
+	pci_read_config_word(agp, cap+0x14, &apsize);
+	if (apsize == 0xffff)
+		return -1;
 
 	apsize &= 0xfff;
 	/* Some BIOS use weird encodings not in the AGPv3 table. */
-	if (apsize & 0xff) 
-		apsize |= 0xf00; 
-	order = 7 - hweight16(apsize); 
+	if (apsize & 0xff)
+		apsize |= 0xf00;
+	order = 7 - hweight16(apsize);
 
 	pci_read_config_dword(agp, 0x10, &aper_low);
 	pci_read_config_dword(agp, 0x14, &aper_hi);
-	aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32); 
+	aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32);
 	printk(KERN_INFO PFX "Aperture from AGP @ %Lx size %u MB\n", aper, 32 << order);
 	if (order < 0 || !aperture_valid(aper, (32*1024*1024)<<order))
-		return -1; 
-	
-	pci_write_config_dword(nb, 0x90, order << 1); 
-	pci_write_config_dword(nb, 0x94, aper >> 25); 
+		return -1;
+
+	pci_write_config_dword(nb, 0x90, order << 1);
+	pci_write_config_dword(nb, 0x94, aper >> 25);
 
 	return 0;
-} 
+}
 
 static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
 {
@@ -355,19 +355,19 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
 	int i = 0;
 
 	/* cache pci_devs of northbridges. */
-	while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) 
+	while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev))
 			!= NULL) {
-		if (i == MAX_HAMMER_GARTS) { 
+		if (i == MAX_HAMMER_GARTS) {
 			printk(KERN_ERR PFX "Too many northbridges for AGP\n");
 			return -1;
 		}
-		if (fix_northbridge(loop_dev, pdev, cap_ptr) < 0) { 
+		if (fix_northbridge(loop_dev, pdev, cap_ptr) < 0) {
 			printk(KERN_ERR PFX "No usable aperture found.\n");
-#ifdef __x86_64__ 
+#ifdef __x86_64__
 			/* should port this to i386 */
 			printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
-#endif 
-			return -1;  
+#endif
+			return -1;
 		}
 		hammers[i++] = loop_dev;
 	}
@@ -377,8 +377,7 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
 
 /* Handle AMD 8151 quirks */
 static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data *bridge)
-
-{		
+{
 	char *revstring;
 	u8 rev_id;
 
@@ -417,12 +416,12 @@ static struct aper_size_info_32 nforce3_sizes[5] =
 
 /* Handle shadow device of the Nvidia NForce3 */
 /* CHECK-ME original 2.4 version set up some IORRs. Check if that is needed. */
-static int __devinit nforce3_agp_init(struct pci_dev *pdev) 
-{ 
+static int __devinit nforce3_agp_init(struct pci_dev *pdev)
+{
 	u32 tmp, apbase, apbar, aplimit;
-	struct pci_dev *dev1; 
+	struct pci_dev *dev1;
 	int i;
-	unsigned size = amd64_fetch_size(); 
+	unsigned size = amd64_fetch_size();
 
 	printk(KERN_INFO PFX "Setting up Nforce3 AGP.\n");
 
@@ -432,17 +431,17 @@ static int __devinit nforce3_agp_init(struct pci_dev *pdev)
 			"nForce3 chipset, but could not find "
 			"the secondary device.\n");
 		return -ENODEV;
-	}	
+	}
 
-	for (i = 0; i < ARRAY_SIZE(nforce3_sizes); i++) 
+	for (i = 0; i < ARRAY_SIZE(nforce3_sizes); i++)
 		if (nforce3_sizes[i].size == size)
-			break; 
+			break;
 
 	if (i == ARRAY_SIZE(nforce3_sizes)) {
-		printk(KERN_INFO PFX "No NForce3 size found for %d\n", size); 
-		return -ENODEV; 
+		printk(KERN_INFO PFX "No NForce3 size found for %d\n", size);
+		return -ENODEV;
 	}
-	
+
 	pci_read_config_dword(dev1, NVIDIA_X86_64_1_APSIZE, &tmp);
 	tmp &= ~(0xf);
 	tmp |= nforce3_sizes[i].size_value;
@@ -491,8 +490,7 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
 	    pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
 		amd8151_init(pdev, bridge);
 	} else {
-		printk(KERN_INFO PFX "Detected AGP bridge %x\n",
-			pdev->devfn);
+		printk(KERN_INFO PFX "Detected AGP bridge %x\n", pdev->devfn);
 	}
 
 	bridge->driver = &amd_8151_driver;
@@ -507,10 +505,10 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
 		return -ENODEV;
 	}
 
-	if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) { 
+	if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) {
 		int ret = nforce3_agp_init(pdev);
-		if (ret) { 
-			agp_put_bridge(bridge); 
+		if (ret) {
+			agp_put_bridge(bridge);
 			return ret;
 		}
 	}
@@ -523,8 +521,8 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
 {
 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
 
-	release_mem_region(virt_to_phys(bridge->gatt_table_real), 
-			   amd64_aperture_sizes[bridge->aperture_size_idx].size); 
+	release_mem_region(virt_to_phys(bridge->gatt_table_real),
+			   amd64_aperture_sizes[bridge->aperture_size_idx].size);
 	agp_remove_bridge(bridge);
 	agp_put_bridge(bridge);
 }
@@ -581,6 +579,15 @@ static struct pci_device_id agp_amd64_pci_table[] = {
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
+	/* SIS 755 */
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_SI,
+	.device		= PCI_DEVICE_ID_SI_755,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
 	{ }
 };
 
@@ -600,15 +607,15 @@ int __init agp_amd64_init(void)
 	int err = 0;
 	if (agp_off)
 		return -EINVAL;
-	if (pci_module_init(&agp_amd64_pci_driver) > 0) { 
+	if (pci_module_init(&agp_amd64_pci_driver) > 0) {
 		struct pci_dev *dev;
-		if (!agp_try_unsupported && !agp_try_unsupported_boot) { 
+		if (!agp_try_unsupported && !agp_try_unsupported_boot) {
 			printk(KERN_INFO PFX "No supported AGP bridge found.\n");
-#ifdef MODULE			
+#ifdef MODULE
 			printk(KERN_INFO PFX "You can try agp_try_unsupported=1\n");
 #else
 			printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n");
-#endif			
+#endif
 			return -ENODEV;
 		}
 
@@ -622,12 +629,12 @@ int __init agp_amd64_init(void)
 		while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) {
 			if (!pci_find_capability(dev, PCI_CAP_ID_AGP))
 				continue;
-			/* Only one bridge supported right now */	
+			/* Only one bridge supported right now */
 			if (agp_amd64_probe(dev, NULL) == 0) {
 				err = 0;
 				break;
-			}	
-		}		
+			}
+		}
 	}
 	return err;
 }
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
index 35f71bbf8..bc88d6991 100644
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
@@ -131,6 +131,7 @@ static int ati_create_gatt_pages(int nr_tables)
 				i--;
 			}
 			kfree (tables);
+			tables = NULL;
 			retval = -ENOMEM;
 			break;
 		}
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 7b3f652f6..33e1c707d 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -238,11 +238,14 @@ void agp_put_bridge(struct agp_bridge_data *bridge)
 }
 EXPORT_SYMBOL(agp_put_bridge);
 
- 
+
 int agp_add_bridge(struct agp_bridge_data *bridge)
 {
 	int error;
 
+	if (agp_off)
+		return -ENODEV;
+
 	if (!bridge->dev) {
 		printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n");
 		return -EINVAL;
@@ -308,9 +311,9 @@ EXPORT_SYMBOL(agp_try_unsupported_boot);
 
 static int __init agp_init(void)
 {
-	if (!agp_off) 
-	printk(KERN_INFO "Linux agpgart interface v%d.%d (c) Dave Jones\n",
-	       AGPGART_VERSION_MAJOR, AGPGART_VERSION_MINOR);
+	if (!agp_off)
+		printk(KERN_INFO "Linux agpgart interface v%d.%d (c) Dave Jones\n",
+			AGPGART_VERSION_MAJOR, AGPGART_VERSION_MINOR);
 	return 0;
 }
 
@@ -325,7 +328,7 @@ static __init int agp_setup(char *s)
 		agp_off = 1;
 	if (!strcmp(s,"try_unsupported"))
 		agp_try_unsupported_boot = 1;
-	return 1;	
+	return 1;
 }
 __setup("agp=", agp_setup);
 #endif
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 256ac1acf..f8b991673 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -1233,7 +1233,7 @@ static int find_i810(u16 device, const char *name)
 				name);
 		return 0;
 	}
-	
+
 	intel_i810_private.i810_dev = i810_dev;
 	return 1;
 }
@@ -1382,8 +1382,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
 		name = "E7205";
 		break;
 	default:
-		printk(KERN_ERR PFX "Unsupported Intel chipset (device id: %04x)\n",
+		if (cap_ptr)
+			printk(KERN_WARNING PFX "Unsupported Intel chipset (device id: %04x)\n",
 			    pdev->device);
+		agp_put_bridge(bridge);
 		return -ENODEV;
 	};
 
@@ -1406,7 +1408,8 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
 	if (!r->start && r->end) {
 		if(pci_assign_resource(pdev, 0)) {
 			printk(KERN_ERR PFX "could not assign resource 0\n");
-			return (-ENODEV);
+			agp_put_bridge(bridge);
+			return -ENODEV;
 		}
 	}
 
@@ -1417,7 +1420,8 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
 	*/
 	if (pci_enable_device(pdev)) {
 		printk(KERN_ERR PFX "Unable to Enable PCI device\n");
-		return (-ENODEV);
+		agp_put_bridge(bridge);
+		return -ENODEV;
 	}
 
 	/* Fill in the mode register */
@@ -1442,14 +1446,11 @@ static void __devexit agp_intel_remove(struct pci_dev *pdev)
 	agp_put_bridge(bridge);
 }
 
-static int agp_intel_suspend(struct pci_dev *dev, u32 state)
-{
-	return 0;
-}
-
 static int agp_intel_resume(struct pci_dev *pdev)
 {
 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
+	
+	pci_restore_state(pdev, pdev->saved_config_space);
 
 	if (bridge->driver == &intel_generic_driver)
 		intel_configure();
@@ -1462,14 +1463,36 @@ static int agp_intel_resume(struct pci_dev *pdev)
 }
 
 static struct pci_device_id agp_intel_pci_table[] = {
-	{
-	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
-	.class_mask	= ~0,
-	.vendor		= PCI_VENDOR_ID_INTEL,
-	.device		= PCI_ANY_ID,
-	.subvendor	= PCI_ANY_ID,
-	.subdevice	= PCI_ANY_ID,
-	},
+#define ID(x)						\
+	{ 						\
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),	\
+	.class_mask	= ~0,				\
+	.vendor		= PCI_VENDOR_ID_INTEL,		\
+	.device		= x,				\
+	.subvendor	= PCI_ANY_ID,			\
+	.subdevice	= PCI_ANY_ID,			\
+	}
+	ID(PCI_DEVICE_ID_INTEL_82443LX_0),
+	ID(PCI_DEVICE_ID_INTEL_82443BX_0),
+	ID(PCI_DEVICE_ID_INTEL_82443GX_0),
+	ID(PCI_DEVICE_ID_INTEL_82810_MC1),
+	ID(PCI_DEVICE_ID_INTEL_82810_MC3),
+	ID(PCI_DEVICE_ID_INTEL_82810E_MC),
+	ID(PCI_DEVICE_ID_INTEL_82815_MC),
+	ID(PCI_DEVICE_ID_INTEL_82820_HB),
+	ID(PCI_DEVICE_ID_INTEL_82820_UP_HB),
+	ID(PCI_DEVICE_ID_INTEL_82830_HB),
+	ID(PCI_DEVICE_ID_INTEL_82840_HB),
+	ID(PCI_DEVICE_ID_INTEL_82845_HB),
+	ID(PCI_DEVICE_ID_INTEL_82845G_HB),
+	ID(PCI_DEVICE_ID_INTEL_82850_HB),
+	ID(PCI_DEVICE_ID_INTEL_82855PM_HB),
+	ID(PCI_DEVICE_ID_INTEL_82855GM_HB),
+	ID(PCI_DEVICE_ID_INTEL_82860_HB),
+	ID(PCI_DEVICE_ID_INTEL_82865_HB),
+	ID(PCI_DEVICE_ID_INTEL_82875_HB),
+	ID(PCI_DEVICE_ID_INTEL_7505_0),
+	ID(PCI_DEVICE_ID_INTEL_7205_0),	
 	{ }
 };
 
@@ -1480,7 +1503,6 @@ static struct pci_driver agp_intel_pci_driver = {
 	.id_table	= agp_intel_pci_table,
 	.probe		= agp_intel_probe,
 	.remove		= agp_intel_remove,
-	.suspend	= agp_intel_suspend,
 	.resume		= agp_intel_resume,
 };
 
diff --git a/drivers/char/agp/intel-mch-agp.c b/drivers/char/agp/intel-mch-agp.c
index f40942e3a..dff4d9933 100644
--- a/drivers/char/agp/intel-mch-agp.c
+++ b/drivers/char/agp/intel-mch-agp.c
@@ -491,10 +491,9 @@ static int __devinit agp_intelmch_probe(struct pci_dev *pdev,
 	char *name = "(unknown)";
 	u8 cap_ptr = 0;
 
-	if (!boot_cpu_has(X86_FEATURE_LM))
-		return -ENODEV;
-
 	cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
+	if (!cap_ptr) 
+		return -ENODEV;
 
 	bridge = agp_alloc_bridge();
 	if (!bridge)
@@ -570,14 +569,11 @@ static void __devexit agp_intelmch_remove(struct pci_dev *pdev)
 	agp_put_bridge(bridge);
 }
 
-static int agp_intelmch_suspend(struct pci_dev *dev, u32 state)
-{
-	return 0;
-}
-
 static int agp_intelmch_resume(struct pci_dev *pdev)
 {
 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
+	
+	pci_restore_state(pdev, pdev->saved_config_space);
 
 	if (bridge->driver == &intel_845_driver)
 		intel_845_configure();
@@ -590,7 +586,15 @@ static struct pci_device_id agp_intelmch_pci_table[] = {
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
 	.class_mask	= ~0,
 	.vendor		= PCI_VENDOR_ID_INTEL,
-	.device		= PCI_ANY_ID,
+	.device		= PCI_DEVICE_ID_INTEL_82865_HB,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_INTEL,
+	.device		= PCI_DEVICE_ID_INTEL_82875_HB,
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
@@ -604,7 +608,6 @@ static struct pci_driver agp_intelmch_pci_driver = {
 	.id_table	= agp_intelmch_pci_table,
 	.probe		= agp_intelmch_probe,
 	.remove		= agp_intelmch_remove,
-	.suspend	= agp_intelmch_suspend,
 	.resume		= agp_intelmch_resume,
 };
 
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 2981fa1fc..28e7fc4bc 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -380,7 +380,15 @@ static struct pci_device_id agp_nvidia_pci_table[] = {
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
 	.class_mask	= ~0,
 	.vendor		= PCI_VENDOR_ID_NVIDIA,
-	.device		= PCI_ANY_ID,
+	.device		= PCI_DEVICE_ID_NVIDIA_NFORCE,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_NVIDIA,
+	.device		= PCI_DEVICE_ID_NVIDIA_NFORCE2,
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index 16bfef56a..549149ff5 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -13,6 +13,8 @@
 #define SIS_TLBCNTRL	0x97
 #define SIS_TLBFLUSH	0x98
 
+static int __devinitdata agp_sis_force_delay = 0;
+static int __devinitdata agp_sis_agp_spec = -1;
 
 static int sis_fetch_size(void)
 {
@@ -67,7 +69,7 @@ static void sis_cleanup(void)
 			      (previous_size->size_value & ~(0x03)));
 }
 
-static void sis_648_enable(u32 mode)
+static void sis_delayed_enable(u32 mode)
 {
 	struct pci_dev *device = NULL;
 	u32 command;
@@ -94,13 +96,12 @@ static void sis_648_enable(u32 mode)
 		pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command);
 
 		/*
-		 * Weird: on 648(fx) and 746(fx) chipsets any rate change in the target
+		 * Weird: on some sis chipsets any rate change in the target
 		 * command register triggers a 5ms screwup during which the master
 		 * cannot be configured		 
 		 */
-		if (device->device == PCI_DEVICE_ID_SI_648 ||
-		    device->device == PCI_DEVICE_ID_SI_746) {
-			printk(KERN_INFO PFX "SiS chipset with AGP problems detected. Giving bridge time to recover.\n");
+		if (device->device == agp_bridge->dev->device) {
+			printk(KERN_INFO PFX "SiS delay workaround: giving bridge time to recover.\n");
 			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout (1+(HZ*10)/1000);
 		}
@@ -223,28 +224,35 @@ static struct agp_device_ids sis_agp_device_ids[] __devinitdata =
 };
 
 
+// chipsets that require the 'delay hack'
+static int sis_broken_chipsets[] __devinitdata = {
+	PCI_DEVICE_ID_SI_648,
+	PCI_DEVICE_ID_SI_746,
+	0 // terminator
+};
+
 static void __devinit sis_get_driver(struct agp_bridge_data *bridge)
 {
-	if (bridge->dev->device == PCI_DEVICE_ID_SI_648) { 
-		sis_driver.agp_enable=sis_648_enable;
-		if (agp_bridge->major_version == 3) {
-			sis_driver.aperture_sizes = agp3_generic_sizes;
-			sis_driver.size_type = U16_APER_SIZE;
-			sis_driver.num_aperture_sizes = AGP_GENERIC_SIZES_ENTRIES;
-			sis_driver.configure = agp3_generic_configure;
-			sis_driver.fetch_size = agp3_generic_fetch_size;
-			sis_driver.cleanup = agp3_generic_cleanup;
-			sis_driver.tlb_flush = agp3_generic_tlbflush;
-		}
-	}
+	int i;
 
-	if (bridge->dev->device == PCI_DEVICE_ID_SI_746) {
-		/*
-		 * We don't know enough about the 746 to enable it properly.
-		 * Though we do know that it needs the 'delay' hack to settle
-		 * after changing modes.
-		 */
-		sis_driver.agp_enable=sis_648_enable;
+	for(i=0; sis_broken_chipsets[i]!=0; ++i)
+		if(bridge->dev->device==sis_broken_chipsets[i])
+			break;
+
+	if(sis_broken_chipsets[i] || agp_sis_force_delay)
+		sis_driver.agp_enable=sis_delayed_enable;
+
+	// sis chipsets that indicate less than agp3.5
+	// are not actually fully agp3 compliant
+	if ((agp_bridge->major_version == 3 && agp_bridge->minor_version >= 5
+	     && agp_sis_agp_spec!=0) || agp_sis_agp_spec==1) {
+		sis_driver.aperture_sizes = agp3_generic_sizes;
+		sis_driver.size_type = U16_APER_SIZE;
+		sis_driver.num_aperture_sizes = AGP_GENERIC_SIZES_ENTRIES;
+		sis_driver.configure = agp3_generic_configure;
+		sis_driver.fetch_size = agp3_generic_fetch_size;
+		sis_driver.cleanup = agp3_generic_cleanup;
+		sis_driver.tlb_flush = agp3_generic_tlbflush;
 	}
 }
 
@@ -335,4 +343,8 @@ static void __exit agp_sis_cleanup(void)
 module_init(agp_sis_init);
 module_exit(agp_sis_cleanup);
 
+MODULE_PARM(agp_sis_force_delay,"i");
+MODULE_PARM_DESC(agp_sis_force_delay,"forces sis delay hack");
+MODULE_PARM(agp_sis_agp_spec,"i");
+MODULE_PARM_DESC(agp_sis_agp_spec,"0=force sis init, 1=force generic agp3 init, default: autodetect");
 MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index e08c241cd..d3f3e80ff 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -248,26 +248,13 @@ static int serverworks_fetch_size(void)
  */
 static void serverworks_tlbflush(struct agp_memory *temp)
 {
-	unsigned long end;
-
-	OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 0x01);
-	end = jiffies + 3*HZ;
-	while(INREG8(serverworks_private.registers, 
-		     SVWRKS_POSTFLUSH) == 0x01) {
-		if((signed)(end - jiffies) <= 0) {
-			printk(KERN_ERR PFX "Posted write buffer flush took more"
-			       "then 3 seconds\n");
-		}
-	}
-	OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 0x00000001);
-	end = jiffies + 3*HZ;
-	while(INREG32(serverworks_private.registers, 
-		     SVWRKS_DIRFLUSH) == 0x00000001) {
-		if((signed)(end - jiffies) <= 0) {
-			printk(KERN_ERR PFX "TLB flush took more"
-			       "then 3 seconds\n");
-		}
-	}
+	OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 1);
+	while(INREG8(serverworks_private.registers, SVWRKS_POSTFLUSH) == 1)
+		cpu_relax();
+
+	OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 1);
+	while(INREG32(serverworks_private.registers, SVWRKS_DIRFLUSH) == 1)
+		cpu_relax();
 }
 
 static int serverworks_configure(void)
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
index de9aa85e5..2f5c50c29 100644
--- a/drivers/char/agp/via-agp.c
+++ b/drivers/char/agp/via-agp.c
@@ -9,6 +9,8 @@
 #include <linux/agp_backend.h>
 #include "agp.h"
 
+static struct pci_device_id agp_via_pci_table[];
+
 #define VIA_GARTCTRL	0x80
 #define VIA_APSIZE	0x84
 #define VIA_ATTBASE	0x88
@@ -378,20 +380,9 @@ static int __devinit agp_via_probe(struct pci_dev *pdev,
 	if (!cap_ptr)
 		return -ENODEV;
 
-	/* probe for known chipsets */
-	for (j = 0; devs[j].chipset_name; j++) {
-		if (pdev->device == devs[j].device_id) {
-			printk (KERN_INFO PFX "Detected VIA %s chipset\n",
-					devs[j].chipset_name);
-			goto found;
-		}
-	}
-
-	printk(KERN_ERR PFX "Unsupported VIA chipset (device id: %04x)\n",
-		    pdev->device);
-	return -ENODEV;
+	j = ent - agp_via_pci_table;
+	printk (KERN_INFO PFX "Detected VIA %s chipset\n", devs[j].chipset_name);
 
-found:
 	bridge = agp_alloc_bridge();
 	if (!bridge)
 		return -ENOMEM;
@@ -432,15 +423,40 @@ static void __devexit agp_via_remove(struct pci_dev *pdev)
 	agp_put_bridge(bridge);
 }
 
+/* must be the same order as name table above */
 static struct pci_device_id agp_via_pci_table[] = {
-	{
-	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
-	.class_mask	= ~0,
-	.vendor		= PCI_VENDOR_ID_VIA,
-	.device		= PCI_ANY_ID,
-	.subvendor	= PCI_ANY_ID,
-	.subdevice	= PCI_ANY_ID,
-	},
+#define ID(x) \
+	{						\
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),	\
+	.class_mask	= ~0,				\
+	.vendor		= PCI_VENDOR_ID_VIA,		\
+	.device		= x,				\
+	.subvendor	= PCI_ANY_ID,			\
+	.subdevice	= PCI_ANY_ID,			\
+	}
+	ID(PCI_DEVICE_ID_VIA_82C598_0),
+	ID(PCI_DEVICE_ID_VIA_8501_0),
+	ID(PCI_DEVICE_ID_VIA_8601_0),
+	ID(PCI_DEVICE_ID_VIA_82C691_0),
+	ID(PCI_DEVICE_ID_VIA_8371_0),
+	ID(PCI_DEVICE_ID_VIA_8633_0),
+	ID(PCI_DEVICE_ID_VIA_XN266),
+	ID(PCI_DEVICE_ID_VIA_8361),
+	ID(PCI_DEVICE_ID_VIA_8363_0),
+	ID(PCI_DEVICE_ID_VIA_8753_0),
+	ID(PCI_DEVICE_ID_VIA_8367_0),
+	ID(PCI_DEVICE_ID_VIA_8653_0),
+	ID(PCI_DEVICE_ID_VIA_XM266),
+	ID(PCI_DEVICE_ID_VIA_862X_0),
+	ID(PCI_DEVICE_ID_VIA_8377_0),
+	ID(PCI_DEVICE_ID_VIA_8605_0),
+	ID(PCI_DEVICE_ID_VIA_8703_51_0),
+	ID(PCI_DEVICE_ID_VIA_8754C_0),
+	ID(PCI_DEVICE_ID_VIA_8763_0),
+	ID(PCI_DEVICE_ID_VIA_8378_0),
+	ID(PCI_DEVICE_ID_VIA_PT880),
+	ID(PCI_DEVICE_ID_VIA_8783_0),
+	ID(PCI_DEVICE_ID_VIA_PX8X0_0),	
 	{ }
 };
 
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c
index 72ba2932f..bfe300b42 100644
--- a/drivers/char/consolemap.c
+++ b/drivers/char/consolemap.c
@@ -257,12 +257,12 @@ static void update_user_maps(void)
  * 0xf000-0xf0ff "transparent" Unicodes) whereas the "new" variants set
  * Unicodes explicitly.
  */
-int con_set_trans_old(unsigned char * arg)
+int con_set_trans_old(unsigned char __user * arg)
 {
 	int i;
 	unsigned short *p = translations[USER_MAP];
 
-	i = verify_area(VERIFY_READ, (void *)arg, E_TABSZ);
+	i = verify_area(VERIFY_READ, arg, E_TABSZ);
 	if (i)
 		return i;
 
@@ -276,12 +276,12 @@ int con_set_trans_old(unsigned char * arg)
 	return 0;
 }
 
-int con_get_trans_old(unsigned char * arg)
+int con_get_trans_old(unsigned char __user * arg)
 {
 	int i, ch;
 	unsigned short *p = translations[USER_MAP];
 
-	i = verify_area(VERIFY_WRITE, (void *)arg, E_TABSZ);
+	i = verify_area(VERIFY_WRITE, arg, E_TABSZ);
 	if (i)
 		return i;
 
@@ -293,13 +293,12 @@ int con_get_trans_old(unsigned char * arg)
 	return 0;
 }
 
-int con_set_trans_new(ushort * arg)
+int con_set_trans_new(ushort __user * arg)
 {
 	int i;
 	unsigned short *p = translations[USER_MAP];
 
-	i = verify_area(VERIFY_READ, (void *)arg,
-			E_TABSZ*sizeof(unsigned short));
+	i = verify_area(VERIFY_READ, arg, E_TABSZ*sizeof(unsigned short));
 	if (i)
 		return i;
 
@@ -313,13 +312,12 @@ int con_set_trans_new(ushort * arg)
 	return 0;
 }
 
-int con_get_trans_new(ushort * arg)
+int con_get_trans_new(ushort __user * arg)
 {
 	int i;
 	unsigned short *p = translations[USER_MAP];
 
-	i = verify_area(VERIFY_WRITE, (void *)arg,
-			E_TABSZ*sizeof(unsigned short));
+	i = verify_area(VERIFY_WRITE, arg, E_TABSZ*sizeof(unsigned short));
 	if (i)
 		return i;
 
@@ -470,7 +468,7 @@ int con_clear_unimap(int con, struct unimapinit *ui)
 }
 
 int
-con_set_unimap(int con, ushort ct, struct unipair *list)
+con_set_unimap(int con, ushort ct, struct unipair __user *list)
 {
 	int err = 0, err1, i;
 	struct uni_pagedir *p, *q;
@@ -577,6 +575,7 @@ con_set_default_unimap(int con)
 	dflt = p;
 	return err;
 }
+EXPORT_SYMBOL(con_set_default_unimap);
 
 int
 con_copy_unimap(int dstcon, int srccon)
@@ -597,7 +596,7 @@ con_copy_unimap(int dstcon, int srccon)
 }
 
 int
-con_get_unimap(int con, ushort ct, ushort *uct, struct unipair *list)
+con_get_unimap(int con, ushort ct, ushort __user *uct, struct unipair __user *list)
 {
 	int i, j, k, ect;
 	u16 **p1, *p2;
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 7ed0e09ce..48ae91c92 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -681,20 +681,6 @@ static char rcsid[] =
 static void cy_throttle (struct tty_struct *tty);
 static void cy_send_xchar (struct tty_struct *tty, char ch);
 
-static unsigned long 
-cy_get_user(unsigned long *addr)
-{
-	unsigned long result = 0;
-	int error = get_user (result, addr);
-	if (error)
-		printk ("cyclades: cy_get_user: error == %d\n", error);
-	return result;
-}
-
-#ifndef MIN
-#define MIN(a,b)        ((a) < (b) ? (a) : (b))
-#endif
-
 #define IS_CYC_Z(card) ((card).num_chips == -1)
 
 #define Z_FPGA_CHECK(card) \
@@ -708,7 +694,7 @@ cy_get_user(unsigned long *addr)
 			((card).base_addr+ID_ADDRESS))->signature)))
 
 #ifndef SERIAL_XMIT_SIZE
-#define	SERIAL_XMIT_SIZE	(MIN(PAGE_SIZE, 4096))
+#define	SERIAL_XMIT_SIZE	(min(PAGE_SIZE, 4096))
 #endif
 #define WAKEUP_CHARS		256
 
@@ -2680,7 +2666,7 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout)
   unsigned char *base_addr;
   int card,chip,channel,index;
   unsigned long orig_jiffies;
-  signed long char_time;
+  int char_time;
 	
     if (serial_paranoia_check(info, tty->name, "cy_wait_until_sent"))
 	return;
@@ -2705,7 +2691,7 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout)
     if (timeout < 0)
 	timeout = 0;
     if (timeout)
-	char_time = MIN(char_time, timeout);
+	char_time = min(char_time, timeout);
     /*
      * If the transmitter hasn't cleared in twice the approximate
      * amount of time to send the entire FIFO, it probably won't
@@ -2932,8 +2918,8 @@ cy_write(struct tty_struct * tty, int from_user,
 	while (1) {
 	    int c1;
 	    
-	    c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
-				SERIAL_XMIT_SIZE - info->xmit_head));
+	    c = min(count, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1),
+				(int)(SERIAL_XMIT_SIZE - info->xmit_head)));
 	    if (c <= 0)
 		break;
 
@@ -2945,8 +2931,8 @@ cy_write(struct tty_struct * tty, int from_user,
 		break;
 	    }
 	    CY_LOCK(info, flags);
-	    c1 = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
-			SERIAL_XMIT_SIZE - info->xmit_head));
+	    c1 = min(c, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1),
+			(int)(SERIAL_XMIT_SIZE - info->xmit_head)));
 			
 	    if (c1 < c)
 	    	c = c1;
@@ -2962,8 +2948,8 @@ cy_write(struct tty_struct * tty, int from_user,
     } else {
 	CY_LOCK(info, flags);
 	while (1) {
-	    c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, 
-			SERIAL_XMIT_SIZE - info->xmit_head));
+	    c = min(count, min((int)(SERIAL_XMIT_SIZE - info->xmit_cnt - 1),
+			(int)(SERIAL_XMIT_SIZE - info->xmit_head)));
 	        
 	    if (c <= 0)
 		break;
@@ -5648,8 +5634,10 @@ cy_cleanup_module(void)
 #endif /* CONFIG_CYZ_INTR */
 	    )
 		free_irq(cy_card[i].irq, &cy_card[i]);
+#ifdef CONFIG_PCI
 		if (cy_card[i].pdev)
 			pci_release_regions(cy_card[i].pdev);
+#endif
         }
     }
     if (tmp_buf) {
diff --git a/drivers/char/drm/ati_pcigart.h b/drivers/char/drm/ati_pcigart.h
index 3c678dbfa..0d7df0f38 100644
--- a/drivers/char/drm/ati_pcigart.h
+++ b/drivers/char/drm/ati_pcigart.h
@@ -67,7 +67,7 @@ static unsigned long DRM(ati_alloc_pcigart_table)( void )
 	page = virt_to_page( address );
 
 	for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
-		atomic_inc( &page->count );
+		get_page(page);
 		SetPageReserved( page );
 	}
 
@@ -84,7 +84,7 @@ static void DRM(ati_free_pcigart_table)( unsigned long address )
 	page = virt_to_page( address );
 
 	for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
-		atomic_dec( &page->count );
+		__put_page(page);
 		ClearPageReserved( page );
 	}
 
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index 0a8eeb4f2..ea37452f8 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -46,8 +46,8 @@
 #define DRM_IOC_WRITE		_IOC_WRITE
 #define DRM_IOC_READWRITE	_IOC_READ|_IOC_WRITE
 #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
-#if defined(__FreeBSD__) && defined(XFree86Server)
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) && defined(IN_MODULE)
 /* Prevent name collision when including sys/ioccom.h */
 #undef ioctl
 #include <sys/ioccom.h>
@@ -130,6 +130,18 @@ typedef struct drm_tex_region {
 	unsigned int	age;
 } drm_tex_region_t;
 
+/**
+ * Hardware lock.
+ *
+ * The lock structure is a simple cache-line aligned integer.  To avoid
+ * processor bus contention on a multiprocessor system, there should not be any
+ * other data stored in the same cache line.
+ */
+typedef struct drm_hw_lock {
+	__volatile__ unsigned int lock;		/**< lock variable */
+	char			  padding[60];	/**< Pad to cache line */
+} drm_hw_lock_t;
+
 
 /**
  * DRM_IOCTL_VERSION ioctl argument type.
@@ -580,6 +592,16 @@ typedef struct drm_scatter_gather {
 	unsigned long handle;	/**< Used for mapping / unmapping */
 } drm_scatter_gather_t;
 
+/**
+ * DRM_IOCTL_SET_VERSION ioctl argument type.
+ */
+typedef struct drm_set_version {
+	int drm_di_major;
+	int drm_di_minor;
+	int drm_dd_major;
+	int drm_dd_minor;
+} drm_set_version_t;
+
 
 #define DRM_IOCTL_BASE			'd'
 #define DRM_IO(nr)			_IO(DRM_IOCTL_BASE,nr)
@@ -594,6 +616,7 @@ typedef struct drm_scatter_gather {
 #define DRM_IOCTL_GET_MAP               DRM_IOWR(0x04, drm_map_t)
 #define DRM_IOCTL_GET_CLIENT            DRM_IOWR(0x05, drm_client_t)
 #define DRM_IOCTL_GET_STATS             DRM_IOR( 0x06, drm_stats_t)
+#define DRM_IOCTL_SET_VERSION		DRM_IOWR(0x07, drm_set_version_t)
 
 #define DRM_IOCTL_SET_UNIQUE		DRM_IOW( 0x10, drm_unique_t)
 #define DRM_IOCTL_AUTH_MAGIC		DRM_IOW( 0x11, drm_auth_t)
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 2c9d6b651..8bd842346 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -92,8 +92,8 @@
 #ifndef __HAVE_DMA
 #define __HAVE_DMA		0
 #endif
-#ifndef __HAVE_DMA_IRQ
-#define __HAVE_DMA_IRQ		0
+#ifndef __HAVE_IRQ
+#define __HAVE_IRQ		0
 #endif
 #ifndef __HAVE_DMA_WAITLIST
 #define __HAVE_DMA_WAITLIST	0
@@ -148,6 +148,7 @@
 #define DRM_MEM_CTXBITMAP 18
 #define DRM_MEM_STUB      19
 #define DRM_MEM_SGLISTS   20
+#define DRM_MEM_CTXLIST  21
 
 #define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
 	
@@ -324,6 +325,7 @@ do {											\
 #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
 #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist)
 
+#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
 /**
  * Get the private SAREA mapping.
  *
@@ -362,11 +364,6 @@ do {									\
 typedef int drm_ioctl_t( struct inode *inode, struct file *filp,
 			 unsigned int cmd, unsigned long arg );
 
-typedef struct drm_pci_list {
-	u16 vendor;
-	u16 device;
-} drm_pci_list_t;
-
 typedef struct drm_ioctl_desc {
 	drm_ioctl_t	     *func;
 	int		     auth_needed;
@@ -463,18 +460,6 @@ typedef struct drm_buf_entry {
 	drm_freelist_t	  freelist;
 } drm_buf_entry_t;
 
-/**
- * Hardware lock.
- *
- * The lock structure is a simple cache-line aligned integer.  To avoid
- * processor bus contention on a multiprocessor system, there should not be any
- * other data stored in the same cache line.
- */
-typedef struct drm_hw_lock {
-	__volatile__ unsigned int lock;		/**< lock variable */
-	char			  padding[60];	/**< Pad to cache line */
-} drm_hw_lock_t;
-
 /** File private data */
 typedef struct drm_file {
 	int		  authenticated;
@@ -488,6 +473,9 @@ typedef struct drm_file {
 	struct drm_device *dev;
 	int 		  remove_auth_on_close;
 	unsigned long     lock_count;
+#ifdef DRIVER_FILE_FIELDS
+	DRIVER_FILE_FIELDS;
+#endif
 } drm_file_t;
 
 /** Wait queue */
@@ -602,6 +590,15 @@ typedef struct drm_map_list {
 
 typedef drm_map_t drm_local_map_t;
 
+/**
+ * Context handle list
+ */
+typedef struct drm_ctx_list {
+	struct list_head	head;   /**< list head */
+	drm_context_t		handle; /**< context handle */
+	drm_file_t		*tag;   /**< associated fd private data */
+} drm_ctx_list_t;
+
 #if __HAVE_VBL_IRQ
 
 typedef struct drm_vbl_sig {
@@ -622,6 +619,8 @@ typedef struct drm_device {
 	int		  unique_len;	/**< Length of unique field */
 	dev_t		  device;	/**< Device number for mknod */
 	char		  *devname;	/**< For /proc/interrupts */
+	int		  minor;        /**< Minor device number */
+	int		  if_version;	/**< Highest interface version set */
 
 	int		  blocked;	/**< Blocked due to VC switch? */
 	struct proc_dir_entry *root;	/**< Root for this device's entries */
@@ -660,6 +659,12 @@ typedef struct drm_device {
 	drm_map_list_t	  *maplist;	/**< Linked list of regions */
 	int		  map_count;	/**< Number of mappable regions */
 
+	/** \name Context handle management */
+	/*@{*/
+	drm_ctx_list_t	  *ctxlist;	/**< Linked list of context handles */
+	int		  ctx_count;	/**< Number of context handles */
+	struct semaphore  ctxlist_sem;	/**< For ctxlist */
+
 	drm_map_t	  **context_sareas; /**< per-context SAREA's */
 	int		  max_context;
 
@@ -679,6 +684,7 @@ typedef struct drm_device {
 	/** \name Context support */
 	/*@{*/
 	int		  irq;		/**< Interrupt used by board */
+	int		  irq_enabled;	/**< True if irq handler is enabled */
 	__volatile__ long context_flag;	/**< Context swapping flag */
 	__volatile__ long interrupt_flag; /**< Interruption handler flag */
 	__volatile__ long dma_flag;	/**< DMA dispatch flag */
@@ -714,7 +720,12 @@ typedef struct drm_device {
 #if __REALLY_HAVE_AGP
 	drm_agp_head_t    *agp;	/**< AGP data */
 #endif
-	struct pci_dev *pdev;		/**< PCI device structure */
+
+	struct pci_dev    *pdev;	/**< PCI device structure */
+	int               pci_domain;	/**< PCI bus domain number */
+	int               pci_bus;	/**< PCI bus number */
+	int               pci_slot;	/**< PCI slot number */
+	int               pci_func;	/**< PCI function number */
 #ifdef __alpha__
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3)
 	struct pci_controler *hose;
@@ -758,18 +769,6 @@ extern int	     DRM(flush)(struct file *filp);
 extern int	     DRM(fasync)(int fd, struct file *filp, int on);
 
 				/* Mapping support (drm_vm.h) */
-extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
-				   unsigned long address,
-				   int *type);
-extern struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
-				       unsigned long address,
-				       int *type);
-extern struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
-				       unsigned long address,
-				       int *type);
-extern struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
-				      unsigned long address,
-				      int *type);
 extern void	     DRM(vm_open)(struct vm_area_struct *vma);
 extern void	     DRM(vm_close)(struct vm_area_struct *vma);
 extern void	     DRM(vm_shm_close)(struct vm_area_struct *vma);
@@ -804,8 +803,8 @@ extern int           DRM(unbind_agp)(DRM_AGP_MEM *handle);
 #endif
 
 				/* Misc. IOCTL support (drm_ioctl.h) */
-extern int	     DRM(irq_busid)(struct inode *inode, struct file *filp,
-				    unsigned int cmd, unsigned long arg);
+extern int	     DRM(irq_by_busid)(struct inode *inode, struct file *filp,
+				       unsigned int cmd, unsigned long arg);
 extern int	     DRM(getunique)(struct inode *inode, struct file *filp,
 				    unsigned int cmd, unsigned long arg);
 extern int	     DRM(setunique)(struct inode *inode, struct file *filp,
@@ -816,6 +815,8 @@ extern int	     DRM(getclient)(struct inode *inode, struct file *filp,
 				    unsigned int cmd, unsigned long arg);
 extern int	     DRM(getstats)(struct inode *inode, struct file *filp,
 				   unsigned int cmd, unsigned long arg);
+extern int	     DRM(setversion)(struct inode *inode, struct file *filp,
+				     unsigned int cmd, unsigned long arg);
 
 				/* Context IOCTL support (drm_context.h) */
 extern int	     DRM(resctx)( struct inode *inode, struct file *filp,
@@ -900,12 +901,17 @@ extern int	     DRM(dma_setup)(drm_device_t *dev);
 extern void	     DRM(dma_takedown)(drm_device_t *dev);
 extern void	     DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf);
 extern void	     DRM(reclaim_buffers)( struct file *filp );
-#if __HAVE_DMA_IRQ
+#endif /* __HAVE_DMA */
+
+				/* IRQ support (drm_irq.h) */
+#if __HAVE_IRQ || __HAVE_DMA
 extern int           DRM(control)( struct inode *inode, struct file *filp,
 				   unsigned int cmd, unsigned long arg );
-extern int           DRM(irq_install)( drm_device_t *dev, int irq );
+#endif
+#if __HAVE_IRQ
+extern int           DRM(irq_install)( drm_device_t *dev );
 extern int           DRM(irq_uninstall)( drm_device_t *dev );
-extern irqreturn_t   DRM(dma_service)( DRM_IRQ_ARGS );
+extern irqreturn_t   DRM(irq_handler)( DRM_IRQ_ARGS );
 extern void          DRM(driver_irq_preinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_postinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_uninstall)( drm_device_t *dev );
@@ -915,12 +921,11 @@ extern int           DRM(wait_vblank)(struct inode *inode, struct file *filp,
 extern int           DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
 extern void          DRM(vbl_send_signals)( drm_device_t *dev );
 #endif
-#if __HAVE_DMA_IRQ_BH
-extern void          DRM(dma_immediate_bh)( void *dev );
+#if __HAVE_IRQ_BH
+extern void          DRM(irq_immediate_bh)( void *dev );
 #endif
 #endif
 
-#endif /* __HAVE_DMA */
 
 #if __REALLY_HAVE_AGP
 				/* AGP/GART support (drm_agpsupport.h) */
diff --git a/drivers/char/drm/drm_agpsupport.h b/drivers/char/drm/drm_agpsupport.h
index 8b3439fac..aa7fd54bb 100644
--- a/drivers/char/drm/drm_agpsupport.h
+++ b/drivers/char/drm/drm_agpsupport.h
@@ -103,7 +103,11 @@ int DRM(agp_acquire)(struct inode *inode, struct file *filp,
 	drm_device_t	 *dev	 = priv->dev;
 	int              retcode;
 
-	if (!dev->agp || dev->agp->acquired || !drm_agp->acquire)
+	if (!dev->agp)
+		return -ENODEV;
+	if (dev->agp->acquired)
+		return -EBUSY;
+	if (!drm_agp->acquire)
 		return -EINVAL;
 	if ((retcode = drm_agp->acquire()))
 		return retcode;
diff --git a/drivers/char/drm/drm_bufs.h b/drivers/char/drm/drm_bufs.h
index e4cce8daf..a0361c03b 100644
--- a/drivers/char/drm/drm_bufs.h
+++ b/drivers/char/drm/drm_bufs.h
@@ -147,7 +147,9 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
 					      MTRR_TYPE_WRCOMB, 1 );
 		}
 #endif
-		map->handle = DRM(ioremap)( map->offset, map->size, dev );
+		if (map->type == _DRM_REGISTERS)
+			map->handle = DRM(ioremap)( map->offset, map->size,
+						    dev );
 		break;
 
 	case _DRM_SHM:
@@ -160,6 +162,12 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
 		}
 		map->offset = (unsigned long)map->handle;
 		if ( map->flags & _DRM_CONTAINS_LOCK ) {
+			/* Prevent a 2nd X Server from creating a 2nd lock */
+			if (dev->lock.hw_lock != NULL) {
+				vfree( map->handle );
+				DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
+				return -EBUSY;
+			}
 			dev->sigdata.lock =
 			dev->lock.hw_lock = map->handle; /* Pointer to lock */
 		}
@@ -767,7 +775,7 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
 }
 #endif /* __HAVE_PCI_DMA */
 
-#ifdef __HAVE_SG
+#if __HAVE_SG
 int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
                      unsigned int cmd, unsigned long arg )
 {
diff --git a/drivers/char/drm/drm_context.h b/drivers/char/drm/drm_context.h
index 64d32d6c9..79b200e08 100644
--- a/drivers/char/drm/drm_context.h
+++ b/drivers/char/drm/drm_context.h
@@ -401,6 +401,7 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
+	drm_ctx_list_t * ctx_entry;
 	drm_ctx_t ctx;
 
 	if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
@@ -421,6 +422,20 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
 	if ( ctx.handle != DRM_KERNEL_CONTEXT )
 		DRIVER_CTX_CTOR(ctx.handle); /* XXX: also pass dev ? */
 #endif
+	ctx_entry = DRM(alloc)( sizeof(*ctx_entry), DRM_MEM_CTXLIST );
+	if ( !ctx_entry ) {
+		DRM_DEBUG("out of memory\n");
+		return -ENOMEM;
+	}
+
+	INIT_LIST_HEAD( &ctx_entry->head );
+	ctx_entry->handle = ctx.handle;
+	ctx_entry->tag = priv;
+
+	down( &dev->ctxlist_sem );
+	list_add( &ctx_entry->head, &dev->ctxlist->head );
+	++dev->ctx_count;
+	up( &dev->ctxlist_sem );
 
 	if ( copy_to_user( (drm_ctx_t *)arg, &ctx, sizeof(ctx) ) )
 		return -EFAULT;
@@ -543,6 +558,20 @@ int DRM(rmctx)( struct inode *inode, struct file *filp,
 		DRM(ctxbitmap_free)( dev, ctx.handle );
 	}
 
+	down( &dev->ctxlist_sem );
+	if ( !list_empty( &dev->ctxlist->head ) ) {
+		drm_ctx_list_t *pos, *n;
+
+		list_for_each_entry_safe( pos, n, &dev->ctxlist->head, head ) {
+			if ( pos->handle == ctx.handle ) {
+				list_del( &pos->head );
+				DRM(free)( pos, sizeof(*pos), DRM_MEM_CTXLIST );
+				--dev->ctx_count;
+			}
+		}
+	}
+	up( &dev->ctxlist_sem );
+
 	return 0;
 }
 
diff --git a/drivers/char/drm/drm_dma.h b/drivers/char/drm/drm_dma.h
index 5aa8ae9c9..f0230ebec 100644
--- a/drivers/char/drm/drm_dma.h
+++ b/drivers/char/drm/drm_dma.h
@@ -35,7 +35,6 @@
 
 #include "drmP.h"
 
-#include <linux/interrupt.h>	/* For task queue support */
 
 #ifndef __HAVE_DMA_WAITQUEUE
 #define __HAVE_DMA_WAITQUEUE	0
@@ -43,15 +42,6 @@
 #ifndef __HAVE_DMA_RECLAIM
 #define __HAVE_DMA_RECLAIM	0
 #endif
-#ifndef __HAVE_SHARED_IRQ
-#define __HAVE_SHARED_IRQ	0
-#endif
-
-#if __HAVE_SHARED_IRQ
-#define DRM_IRQ_TYPE		SA_SHIRQ
-#else
-#define DRM_IRQ_TYPE		0
-#endif
 
 #if __HAVE_DMA
 
@@ -214,293 +204,11 @@ void DRM(reclaim_buffers)( struct file *filp )
 }
 #endif
 
-
-
-
-#if __HAVE_DMA_IRQ
-
-/**
- * Install IRQ handler.
- *
- * \param dev DRM device.
- * \param irq IRQ number.
- *
- * Initializes the IRQ related data, and setups drm_device::vbl_queue. Installs the handler, calling the driver
- * \c DRM(driver_irq_preinstall)() and \c DRM(driver_irq_postinstall)() functions
- * before and after the installation.
- */
-int DRM(irq_install)( drm_device_t *dev, int irq )
-{
-	int ret;
-
-	if ( !irq )
-		return -EINVAL;
-
-	down( &dev->struct_sem );
-
-	/* Driver must have been initialized */
-	if ( !dev->dev_private ) {
-		up( &dev->struct_sem );
-		return -EINVAL;
-	}
-
-	if ( dev->irq ) {
-		up( &dev->struct_sem );
-		return -EBUSY;
-	}
-	dev->irq = irq;
-	up( &dev->struct_sem );
-
-	DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq );
-
-	dev->context_flag = 0;
-	dev->interrupt_flag = 0;
-	dev->dma_flag = 0;
-
-	dev->dma->next_buffer = NULL;
-	dev->dma->next_queue = NULL;
-	dev->dma->this_buffer = NULL;
-
-#if __HAVE_DMA_IRQ_BH
-	INIT_WORK(&dev->work, DRM(dma_immediate_bh), dev);
-#endif
-
-#if __HAVE_VBL_IRQ
-	init_waitqueue_head(&dev->vbl_queue);
-
-	spin_lock_init( &dev->vbl_lock );
-
-	INIT_LIST_HEAD( &dev->vbl_sigs.head );
-
-	dev->vbl_pending = 0;
-#endif
-
-				/* Before installing handler */
-	DRM(driver_irq_preinstall)(dev);
-
-				/* Install handler */
-	ret = request_irq( dev->irq, DRM(dma_service),
-			   DRM_IRQ_TYPE, dev->devname, dev );
-	if ( ret < 0 ) {
-		down( &dev->struct_sem );
-		dev->irq = 0;
-		up( &dev->struct_sem );
-		return ret;
-	}
-
-				/* After installing handler */
-	DRM(driver_irq_postinstall)(dev);
-
-	return 0;
-}
-
-/**
- * Uninstall the IRQ handler.
- *
- * \param dev DRM device.
- *
- * Calls the driver's \c DRM(driver_irq_uninstall)() function, and stops the irq.
- */
-int DRM(irq_uninstall)( drm_device_t *dev )
-{
-	int irq;
-
-	down( &dev->struct_sem );
-	irq = dev->irq;
-	dev->irq = 0;
-	up( &dev->struct_sem );
-
-	if ( !irq )
-		return -EINVAL;
-
-	DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq );
-
-	DRM(driver_irq_uninstall)( dev );
-
-	free_irq( irq, dev );
-
-	return 0;
-}
-
-/**
- * IRQ control ioctl.
- *
- * \param inode device inode.
- * \param filp file pointer.
- * \param cmd command.
- * \param arg user argument, pointing to a drm_control structure.
- * \return zero on success or a negative number on failure.
- *
- * Calls irq_install() or irq_uninstall() according to \p arg.
- */
-int DRM(control)( struct inode *inode, struct file *filp,
-		  unsigned int cmd, unsigned long arg )
-{
-	drm_file_t *priv = filp->private_data;
-	drm_device_t *dev = priv->dev;
-	drm_control_t ctl;
-
-	if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
-		return -EFAULT;
-
-	switch ( ctl.func ) {
-	case DRM_INST_HANDLER:
-		return DRM(irq_install)( dev, ctl.irq );
-	case DRM_UNINST_HANDLER:
-		return DRM(irq_uninstall)( dev );
-	default:
-		return -EINVAL;
-	}
-}
-
-#if __HAVE_VBL_IRQ
-
-/**
- * Wait for VBLANK.
- *
- * \param inode device inode.
- * \param filp file pointer.
- * \param cmd command.
- * \param data user argument, pointing to a drm_wait_vblank structure.
- * \return zero on success or a negative number on failure.
- *
- * Verifies the IRQ is installed. 
- *
- * If a signal is requested checks if this task has already scheduled the same signal
- * for the same vblank sequence number - nothing to be done in
- * that case. If the number of tasks waiting for the interrupt exceeds 100 the
- * function fails. Otherwise adds a new entry to drm_device::vbl_sigs for this
- * task.
- *
- * If a signal is not requested, then calls vblank_wait().
+#if !__HAVE_IRQ
+/* This stub DRM_IOCTL_CONTROL handler is for the drivers that used to require
+ * IRQs for DMA but no longer do.  It maintains compatibility with the X Servers
+ * that try to use the control ioctl by simply returning success.
  */
-int DRM(wait_vblank)( DRM_IOCTL_ARGS )
-{
-	drm_file_t *priv = filp->private_data;
-	drm_device_t *dev = priv->dev;
-	drm_wait_vblank_t vblwait;
-	struct timeval now;
-	int ret = 0;
-	unsigned int flags;
-
-	if (!dev->irq)
-		return -EINVAL;
-
-	DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
-				  sizeof(vblwait) );
-
-	switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
-	case _DRM_VBLANK_RELATIVE:
-		vblwait.request.sequence += atomic_read( &dev->vbl_received );
-		vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
-	case _DRM_VBLANK_ABSOLUTE:
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
-	
-	if ( flags & _DRM_VBLANK_SIGNAL ) {
-		unsigned long irqflags;
-		drm_vbl_sig_t *vbl_sig;
-		
-		vblwait.reply.sequence = atomic_read( &dev->vbl_received );
-
-		spin_lock_irqsave( &dev->vbl_lock, irqflags );
-
-		/* Check if this task has already scheduled the same signal
-		 * for the same vblank sequence number; nothing to be done in
-		 * that case
-		 */
-		list_for_each_entry( vbl_sig, &dev->vbl_sigs.head, head ) {
-			if (vbl_sig->sequence == vblwait.request.sequence
-			    && vbl_sig->info.si_signo == vblwait.request.signal
-			    && vbl_sig->task == current)
-			{
-				spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-				goto done;
-			}
-		}
-
-		if ( dev->vbl_pending >= 100 ) {
-			spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-			return -EBUSY;
-		}
-
-		dev->vbl_pending++;
-
-		spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-
-		if ( !( vbl_sig = DRM_MALLOC( sizeof( drm_vbl_sig_t ) ) ) ) {
-			return -ENOMEM;
-		}
-
-		memset( (void *)vbl_sig, 0, sizeof(*vbl_sig) );
-
-		vbl_sig->sequence = vblwait.request.sequence;
-		vbl_sig->info.si_signo = vblwait.request.signal;
-		vbl_sig->task = current;
-
-		spin_lock_irqsave( &dev->vbl_lock, irqflags );
-
-		list_add_tail( (struct list_head *) vbl_sig, &dev->vbl_sigs.head );
-
-		spin_unlock_irqrestore( &dev->vbl_lock, irqflags );
-	} else {
-		ret = DRM(vblank_wait)( dev, &vblwait.request.sequence );
-
-		do_gettimeofday( &now );
-		vblwait.reply.tval_sec = now.tv_sec;
-		vblwait.reply.tval_usec = now.tv_usec;
-	}
-
-done:
-	DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
-				sizeof(vblwait) );
-
-	return ret;
-}
-
-/**
- * Send the VBLANK signals.
- *
- * \param dev DRM device.
- *
- * Sends a signal for each task in drm_device::vbl_sigs and empties the list.
- *
- * If a signal is not requested, then calls vblank_wait().
- */
-void DRM(vbl_send_signals)( drm_device_t *dev )
-{
-	struct list_head *list, *tmp;
-	drm_vbl_sig_t *vbl_sig;
-	unsigned int vbl_seq = atomic_read( &dev->vbl_received );
-	unsigned long flags;
-
-	spin_lock_irqsave( &dev->vbl_lock, flags );
-
-	list_for_each_safe( list, tmp, &dev->vbl_sigs.head ) {
-		vbl_sig = list_entry( list, drm_vbl_sig_t, head );
-		if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
-			vbl_sig->info.si_code = vbl_seq;
-			send_sig_info( vbl_sig->info.si_signo, &vbl_sig->info, vbl_sig->task );
-
-			list_del( list );
-
-			DRM_FREE( vbl_sig, sizeof(*vbl_sig) );
-
-			dev->vbl_pending--;
-		}
-	}
-
-	spin_unlock_irqrestore( &dev->vbl_lock, flags );
-}
-
-#endif	/* __HAVE_VBL_IRQ */
-
-#else
-
 int DRM(control)( struct inode *inode, struct file *filp,
 		  unsigned int cmd, unsigned long arg )
 {
@@ -517,7 +225,6 @@ int DRM(control)( struct inode *inode, struct file *filp,
 		return -EINVAL;
 	}
 }
-
-#endif /* __HAVE_DMA_IRQ */
+#endif
 
 #endif /* __HAVE_DMA */
diff --git a/drivers/char/drm/drm_drv.h b/drivers/char/drm/drm_drv.h
index 35ecd064c..4e67b7bd4 100644
--- a/drivers/char/drm/drm_drv.h
+++ b/drivers/char/drm/drm_drv.h
@@ -58,8 +58,8 @@
 #ifndef __HAVE_CTX_BITMAP
 #define __HAVE_CTX_BITMAP		0
 #endif
-#ifndef __HAVE_DMA_IRQ
-#define __HAVE_DMA_IRQ			0
+#ifndef __HAVE_IRQ
+#define __HAVE_IRQ			0
 #endif
 #ifndef __HAVE_DMA_QUEUE
 #define __HAVE_DMA_QUEUE		0
@@ -126,6 +126,9 @@
 #ifndef DRIVER_IOCTLS
 #define DRIVER_IOCTLS
 #endif
+#ifndef DRIVER_OPEN_HELPER
+#define DRIVER_OPEN_HELPER( priv, dev )
+#endif
 #ifndef DRIVER_FOPS
 #define DRIVER_FOPS				\
 static struct file_operations	DRM(fops) = {	\
@@ -159,15 +162,8 @@ __setup( DRIVER_NAME "=", DRM_OPTIONS_FUNC );
 #undef DRM_OPTIONS_FUNC
 #endif
 
-/**
- * The default number of instances (minor numbers) to initialize.
- */
-#ifndef DRIVER_NUM_CARDS
-#define DRIVER_NUM_CARDS 1
-#endif
-
-static drm_device_t	*DRM(device);
-static int		*DRM(minor);
+#define MAX_DEVICES 4
+static drm_device_t	DRM(device)[MAX_DEVICES];
 static int		DRM(numdevs) = 0;
 
 DRIVER_FOPS;
@@ -177,10 +173,13 @@ static drm_ioctl_desc_t		  DRM(ioctls)[] = {
 	[DRM_IOCTL_NR(DRM_IOCTL_VERSION)]       = { DRM(version),     0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)]    = { DRM(getunique),   0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)]     = { DRM(getmagic),    0, 0 },
-	[DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)]     = { DRM(irq_busid),   0, 1 },
+#if __HAVE_IRQ
+	[DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)]     = { DRM(irq_by_busid), 0, 1 },
+#endif
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_MAP)]       = { DRM(getmap),      0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_CLIENT)]    = { DRM(getclient),   0, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_GET_STATS)]     = { DRM(getstats),    0, 0 },
+	[DRM_IOCTL_NR(DRM_IOCTL_SET_VERSION)]   = { DRM(setversion),  0, 1 },
 
 	[DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)]    = { DRM(setunique),   1, 1 },
 	[DRM_IOCTL_NR(DRM_IOCTL_BLOCK)]         = { DRM(noop),        1, 1 },
@@ -222,9 +221,9 @@ static drm_ioctl_desc_t		  DRM(ioctls)[] = {
 	[DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)]     = { DRM(infobufs),    1, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_MAP_BUFS)]      = { DRM(mapbufs),     1, 0 },
 	[DRM_IOCTL_NR(DRM_IOCTL_FREE_BUFS)]     = { DRM(freebufs),    1, 0 },
-
-	/* The DRM_IOCTL_DMA ioctl should be defined by the driver.
-	 */
+	/* The DRM_IOCTL_DMA ioctl should be defined by the driver. */
+#endif
+#if __HAVE_IRQ || __HAVE_DMA
 	[DRM_IOCTL_NR(DRM_IOCTL_CONTROL)]       = { DRM(control),     1, 1 },
 #endif
 
@@ -330,6 +329,12 @@ static int DRM(setup)( drm_device_t *dev )
 	memset(dev->maplist, 0, sizeof(*dev->maplist));
 	INIT_LIST_HEAD(&dev->maplist->head);
 
+	dev->ctxlist = DRM(alloc)(sizeof(*dev->ctxlist),
+				  DRM_MEM_CTXLIST);
+	if(dev->ctxlist == NULL) return -ENOMEM;
+	memset(dev->ctxlist, 0, sizeof(*dev->ctxlist));
+	INIT_LIST_HEAD(&dev->ctxlist->head);
+
 	dev->vmalist = NULL;
 	dev->sigdata.lock = dev->lock.hw_lock = NULL;
 	init_waitqueue_head( &dev->lock.lock_queue );
@@ -337,7 +342,7 @@ static int DRM(setup)( drm_device_t *dev )
 	dev->queue_reserved = 0;
 	dev->queue_slots = 0;
 	dev->queuelist = NULL;
-	dev->irq = 0;
+	dev->irq_enabled = 0;
 	dev->context_flag = 0;
 	dev->interrupt_flag = 0;
 	dev->dma_flag = 0;
@@ -345,6 +350,7 @@ static int DRM(setup)( drm_device_t *dev )
 	dev->last_switch = 0;
 	dev->last_checked = 0;
 	init_waitqueue_head( &dev->context_wait );
+	dev->if_version = 0;
 
 	dev->ctx_start = 0;
 	dev->lck_start = 0;
@@ -391,8 +397,8 @@ static int DRM(takedown)( drm_device_t *dev )
 	DRM_DEBUG( "\n" );
 
 	DRIVER_PRETAKEDOWN();
-#if __HAVE_DMA_IRQ
-	if ( dev->irq ) DRM(irq_uninstall)( dev );
+#if __HAVE_IRQ
+	if ( dev->irq_enabled ) DRM(irq_uninstall)( dev );
 #endif
 
 	down( &dev->struct_sem );
@@ -534,43 +540,104 @@ static int DRM(takedown)( drm_device_t *dev )
 	return 0;
 }
 
-/**
- * Figure out how many instances to initialize.
- *
- * \return number of cards found.
- *
- * Searches for every PCI card in \c DRIVER_CARD_LIST with matching vendor and device ids.
- */
-static int drm_count_cards(void)
+#include "drm_pciids.h"
+
+static struct pci_device_id DRM(pciidlist)[] = {
+	DRM(PCI_IDS)
+};
+
+static int DRM(probe)(struct pci_dev *pdev)
 {
-	int num = 0;
-#if defined(DRIVER_CARD_LIST)
-	int i;
-	drm_pci_list_t *l;
-	u16 device, vendor;
-	struct pci_dev *pdev = NULL;
+	drm_device_t *dev;
+#if __HAVE_CTX_BITMAP
+	int retcode;
 #endif
+	int i;
+	int is_compat = 0;
 
 	DRM_DEBUG( "\n" );
 
-#if defined(DRIVER_COUNT_CARDS)
-	num = DRIVER_COUNT_CARDS();
-#elif defined(DRIVER_CARD_LIST)
-	for (i = 0, l = DRIVER_CARD_LIST; l[i].vendor != 0; i++) {
-		pdev = NULL;
-		vendor = l[i].vendor;
-		device = l[i].device;
-		if(device == 0xffff) device = PCI_ANY_ID;
-		if(vendor == 0xffff) vendor = PCI_ANY_ID;
-		while ((pdev = pci_find_device(vendor, device, pdev))) {
-			num++;
+	for (i = 0; DRM(pciidlist)[i].vendor != 0; i++) {
+		if ((DRM(pciidlist)[i].vendor == pdev->vendor) &&
+		    (DRM(pciidlist)[i].device == pdev->device)) {
+			is_compat = 1;
 		}
 	}
+	if (is_compat == 0)
+		return -ENODEV;
+
+	if (DRM(numdevs) >= MAX_DEVICES)
+		return -ENODEV;
+
+	dev = &(DRM(device)[DRM(numdevs)]);
+
+	memset( (void *)dev, 0, sizeof(*dev) );
+	dev->count_lock = SPIN_LOCK_UNLOCKED;
+	init_timer( &dev->timer );
+	sema_init( &dev->struct_sem, 1 );
+	sema_init( &dev->ctxlist_sem, 1 );
+
+	if ((dev->minor = DRM(stub_register)(DRIVER_NAME, &DRM(fops),dev)) < 0)
+		return -EPERM;
+	dev->device = MKDEV(DRM_MAJOR, dev->minor );
+	dev->name   = DRIVER_NAME;
+
+	dev->pdev   = pdev;
+#ifdef __alpha__
+	dev->hose   = pdev->sysdata;
+	dev->pci_domain = dev->hose->bus->number;
 #else
-	num = DRIVER_NUM_CARDS;
+	dev->pci_domain = 0;
+#endif
+	dev->pci_bus = pdev->bus->number;
+	dev->pci_slot = PCI_SLOT(pdev->devfn);
+	dev->pci_func = PCI_FUNC(pdev->devfn);
+	dev->irq = pdev->irq;
+
+	DRIVER_PREINIT();
+
+#if __REALLY_HAVE_AGP
+	dev->agp = DRM(agp_init)();
+#if __MUST_HAVE_AGP
+	if ( dev->agp == NULL ) {
+		DRM_ERROR( "Cannot initialize the agpgart module.\n" );
+		DRM(stub_unregister)(dev->minor);
+		DRM(takedown)( dev );
+		return -EINVAL;
+	}
+#endif
+#if __REALLY_HAVE_MTRR
+	if (dev->agp)
+		dev->agp->agp_mtrr = mtrr_add( dev->agp->agp_info.aper_base,
+					dev->agp->agp_info.aper_size*1024*1024,
+					MTRR_TYPE_WRCOMB,
+					1 );
+#endif
+#endif
+
+#if __HAVE_CTX_BITMAP
+	retcode = DRM(ctxbitmap_init)( dev );
+	if( retcode ) {
+		DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
+		DRM(stub_unregister)(dev->minor);
+		DRM(takedown)( dev );
+		return retcode;
+ 	}
 #endif
-	DRM_DEBUG("numdevs = %d\n", num);
-	return num;
+	DRM(numdevs)++; /* no errors, mark it reserved */
+	
+	DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n",
+		DRIVER_NAME,
+		DRIVER_MAJOR,
+		DRIVER_MINOR,
+		DRIVER_PATCHLEVEL,
+		DRIVER_DATE,
+		dev->minor,
+		pci_pretty_name(pdev));
+
+	DRIVER_POSTINIT();
+
+	return 0;
 }
 
 /**
@@ -579,7 +646,7 @@ static int drm_count_cards(void)
  *
  * \return zero on success or a negative number on failure.
  *
- * Allocates and initialize an array of drm_device structures, and attempts to
+ * Initializes an array of drm_device structures, and attempts to
  * initialize all available devices, using consecutive minors, registering the
  * stubs and initializing the AGP device.
  * 
@@ -588,88 +655,19 @@ static int drm_count_cards(void)
  */
 static int __init drm_init( void )
 {
+	struct pci_dev *pdev = NULL;
 
-	drm_device_t *dev;
-	int i;
-#if __HAVE_CTX_BITMAP
-	int retcode;
-#endif
 	DRM_DEBUG( "\n" );
 
 #ifdef MODULE
 	DRM(parse_options)( drm_opts );
 #endif
 
-	DRM(numdevs) = drm_count_cards();
-	/* Force at least one instance. */
-	if (DRM(numdevs) <= 0)
-		DRM(numdevs) = 1;
-
-	DRM(device) = kmalloc(sizeof(*DRM(device)) * DRM(numdevs), GFP_KERNEL);
-	if (!DRM(device)) {
-		return -ENOMEM;
-	}
-	DRM(minor) = kmalloc(sizeof(*DRM(minor)) * DRM(numdevs), GFP_KERNEL);
-	if (!DRM(minor)) {
-		kfree(DRM(device));
-		return -ENOMEM;
-	}
-
-	DRIVER_PREINIT();
-
 	DRM(mem_init)();
 
-	for (i = 0; i < DRM(numdevs); i++) {
-		dev = &(DRM(device)[i]);
-		memset( (void *)dev, 0, sizeof(*dev) );
-		dev->count_lock = SPIN_LOCK_UNLOCKED;
-		init_timer( &dev->timer );
-		sema_init( &dev->struct_sem, 1 );
-
-		if ((DRM(minor)[i] = DRM(stub_register)(DRIVER_NAME, &DRM(fops),dev)) < 0)
-			return -EPERM;
-		dev->device = MKDEV(DRM_MAJOR, DRM(minor)[i] );
-		dev->name   = DRIVER_NAME;
-
-#if __REALLY_HAVE_AGP
-		dev->agp = DRM(agp_init)();
-#if __MUST_HAVE_AGP
-		if ( dev->agp == NULL ) {
-			DRM_ERROR( "Cannot initialize the agpgart module.\n" );
-			DRM(stub_unregister)(DRM(minor)[i]);
-			DRM(takedown)( dev );
-			return -EINVAL;
-		}
-#endif
-#if __REALLY_HAVE_MTRR
-		if (dev->agp)
-			dev->agp->agp_mtrr = mtrr_add( dev->agp->agp_info.aper_base,
-				       dev->agp->agp_info.aper_size*1024*1024,
-				       MTRR_TYPE_WRCOMB,
-				       1 );
-#endif
-#endif
-
-#if __HAVE_CTX_BITMAP
-		retcode = DRM(ctxbitmap_init)( dev );
-		if( retcode ) {
-			DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
-			DRM(stub_unregister)(DRM(minor)[i]);
-			DRM(takedown)( dev );
-			return retcode;
-		}
-#endif
-		DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d\n",
-		  	DRIVER_NAME,
-		  	DRIVER_MAJOR,
-		  	DRIVER_MINOR,
-		  	DRIVER_PATCHLEVEL,
-		  	DRIVER_DATE,
-		  	DRM(minor)[i] );
+	while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+		DRM(probe)(pdev);
 	}
-
-	DRIVER_POSTINIT();
-
 	return 0;
 }
 
@@ -689,10 +687,10 @@ static void __exit drm_cleanup( void )
 
 	for (i = DRM(numdevs) - 1; i >= 0; i--) {
 		dev = &(DRM(device)[i]);
-		if ( DRM(stub_unregister)(DRM(minor)[i]) ) {
+		if ( DRM(stub_unregister)(dev->minor) ) {
 			DRM_ERROR( "Cannot unload module\n" );
 		} else {
-			DRM_DEBUG("minor %d unregistered\n", DRM(minor)[i]);
+			DRM_DEBUG("minor %d unregistered\n", dev->minor);
 			if (i == 0) {
 				DRM_INFO( "Module unloaded\n" );
 			}
@@ -722,8 +720,6 @@ static void __exit drm_cleanup( void )
 #endif
 	}
 	DRIVER_POSTCLEANUP();
-	kfree(DRM(minor));
-	kfree(DRM(device));
 	DRM(numdevs) = 0;
 }
 
@@ -795,7 +791,7 @@ int DRM(open)( struct inode *inode, struct file *filp )
 	int i;
 
 	for (i = 0; i < DRM(numdevs); i++) {
-		if (iminor(inode) == DRM(minor)[i]) {
+		if (iminor(inode) == DRM(device)[i].minor) {
 			dev = &(DRM(device)[i]);
 			break;
 		}
@@ -908,6 +904,26 @@ int DRM(release)( struct inode *inode, struct file *filp )
 
 	DRM(fasync)( -1, filp, 0 );
 
+	down( &dev->ctxlist_sem );
+	if ( !list_empty( &dev->ctxlist->head ) ) {
+		drm_ctx_list_t *pos, *n;
+
+		list_for_each_entry_safe( pos, n, &dev->ctxlist->head, head ) {
+			if ( pos->tag == priv &&
+			     pos->handle != DRM_KERNEL_CONTEXT ) {
+#ifdef DRIVER_CTX_DTOR
+				DRIVER_CTX_DTOR(pos->handle);
+#endif
+#if __HAVE_CTX_BITMAP
+				DRM(ctxbitmap_free)( dev, pos->handle );
+#endif
+				list_del( &pos->head );
+				DRM(free)( pos, sizeof(*pos), DRM_MEM_CTXLIST );
+			}
+		}
+	}
+	up( &dev->ctxlist_sem );
+
 	down( &dev->struct_sem );
 	if ( priv->remove_auth_on_close == 1 ) {
 		drm_file_t *temp = dev->file_first;
diff --git a/drivers/char/drm/drm_fops.h b/drivers/char/drm/drm_fops.h
index dac209f94..48ceabdb0 100644
--- a/drivers/char/drm/drm_fops.h
+++ b/drivers/char/drm/drm_fops.h
@@ -72,6 +72,8 @@ int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
 	priv->authenticated = capable(CAP_SYS_ADMIN);
 	priv->lock_count    = 0;
 
+	DRIVER_OPEN_HELPER( priv, dev );
+
 	down(&dev->struct_sem);
 	if (!dev->file_last) {
 		priv->next	= NULL;
diff --git a/drivers/char/drm/drm_ioctl.h b/drivers/char/drm/drm_ioctl.h
index a78ee563a..cbf2dbf02 100644
--- a/drivers/char/drm/drm_ioctl.h
+++ b/drivers/char/drm/drm_ioctl.h
@@ -35,69 +35,7 @@
 
 #include "drmP.h"
 
-
-/**
- * Get interrupt from bus id.
- * 
- * \param inode device inode.
- * \param filp file pointer.
- * \param cmd command.
- * \param arg user argument, pointing to a drm_irq_busid structure.
- * \return zero on success or a negative number on failure.
- * 
- * Finds the PCI device with the specified bus id and gets its IRQ number.
- */
-int DRM(irq_busid)(struct inode *inode, struct file *filp,
-		   unsigned int cmd, unsigned long arg)
-{
-	drm_irq_busid_t p;
-	struct pci_dev	*dev;
-
-	if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
-		return -EFAULT;
-#ifdef __alpha__
-	{
-		int domain = p.busnum >> 8;
-		p.busnum &= 0xff;
-
-		/*
-		 * Find the hose the device is on (the domain number is the
-		 * hose index) and offset the bus by the root bus of that
-		 * hose.
-		 */
-                for(dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,NULL);
-                    dev;
-                    dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,dev)) {
-			struct pci_controller *hose = dev->sysdata;
-			
-			if (hose->index == domain) {
-				p.busnum += hose->bus->number;
-				break;
-			}
-		}
-	}
-#endif
-	dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
-	if (!dev) {
-		DRM_ERROR("pci_find_slot failed for %d:%d:%d\n",
-			  p.busnum, p.devnum, p.funcnum);
-		p.irq = 0;
-		goto out;
-	}			
-	if (pci_enable_device(dev) != 0) {
-		DRM_ERROR("pci_enable_device failed for %d:%d:%d\n",
-			  p.busnum, p.devnum, p.funcnum);
-		p.irq = 0;
-		goto out;
-	}		
-	p.irq = dev->irq;
- out:
-	DRM_DEBUG("%d:%d:%d => IRQ %d\n",
-		  p.busnum, p.devnum, p.funcnum, p.irq);
-	if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
-		return -EFAULT;
-	return 0;
-}
+#include "linux/pci.h"
 
 /**
  * Get the bus id.
@@ -138,8 +76,10 @@ int DRM(getunique)(struct inode *inode, struct file *filp,
  * \param arg user argument, pointing to a drm_unique structure.
  * \return zero on success or a negative number on failure.
  *
- * Copies the bus id from userspace into drm_device::unique, and searches for
- * the respective PCI device, updating drm_device::pdev.
+ * Copies the bus id from userspace into drm_device::unique, and verifies that
+ * it matches the device this DRM is attached to (EINVAL otherwise).  Deprecated
+ * in interface version 1.1 and will return EBUSY when setversion has requested
+ * version 1.1 or greater.
  */
 int DRM(setunique)(struct inode *inode, struct file *filp,
 		   unsigned int cmd, unsigned long arg)
@@ -147,6 +87,7 @@ int DRM(setunique)(struct inode *inode, struct file *filp,
 	drm_file_t	 *priv	 = filp->private_data;
 	drm_device_t	 *dev	 = priv->dev;
 	drm_unique_t	 u;
+	int		 domain, bus, slot, func, ret;
 
 	if (dev->unique_len || dev->unique) return -EBUSY;
 
@@ -164,55 +105,49 @@ int DRM(setunique)(struct inode *inode, struct file *filp,
 
 	dev->devname = DRM(alloc)(strlen(dev->name) + strlen(dev->unique) + 2,
 				  DRM_MEM_DRIVER);
-	if(!dev->devname) {
-		DRM(free)(dev->devname, sizeof(*dev->devname), DRM_MEM_DRIVER);
+	if (!dev->devname)
 		return -ENOMEM;
-	}
+
 	sprintf(dev->devname, "%s@%s", dev->name, dev->unique);
 
-	do {
-		struct pci_dev *pci_dev;
-                int domain, b, d, f;
-                char *p;
- 
-                for(p = dev->unique; p && *p && *p != ':'; p++);
-                if (!p || !*p) break;
-                b = (int)simple_strtoul(p+1, &p, 10);
-                if (*p != ':') break;
-                d = (int)simple_strtoul(p+1, &p, 10);
-                if (*p != ':') break;
-                f = (int)simple_strtoul(p+1, &p, 10);
-                if (*p) break;
- 
-		domain = b >> 8;
-		b &= 0xff;
-
-#ifdef __alpha__
-		/*
-		 * Find the hose the device is on (the domain number is the
-		 * hose index) and offset the bus by the root bus of that
-		 * hose.
-		 */
-                for(pci_dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,NULL);
-                    pci_dev;
-                    pci_dev = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,pci_dev)) {
-			struct pci_controller *hose = pci_dev->sysdata;
-			
-			if (hose->index == domain) {
-				b += hose->bus->number;
-				break;
-			}
-		}
-#endif
+	/* Return error if the busid submitted doesn't match the device's actual
+	 * busid.
+	 */
+	ret = sscanf(dev->unique, "PCI:%d:%d:%d", &bus, &slot, &func);
+	if (ret != 3)
+		return DRM_ERR(EINVAL);
+	domain = bus >> 8;
+	bus &= 0xff;
+	
+	if ((domain != dev->pci_domain) ||
+	    (bus != dev->pci_bus) ||
+	    (slot != dev->pci_slot) ||
+	    (func != dev->pci_func))
+		return -EINVAL;
 
-                pci_dev = pci_find_slot(b, PCI_DEVFN(d,f));
-                if (pci_dev) {
-			dev->pdev = pci_dev;
-#ifdef __alpha__
-			dev->hose = pci_dev->sysdata;
-#endif
-		}
-        } while(0);
+	return 0;
+}
+
+static int
+DRM(set_busid)(drm_device_t *dev)
+{
+	if (dev->unique != NULL)
+		return EBUSY;
+
+	dev->unique_len = 20;
+	dev->unique = DRM(alloc)(dev->unique_len + 1, DRM_MEM_DRIVER);
+	if (dev->unique == NULL)
+		return ENOMEM;
+
+	snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
+		dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func);
+
+	dev->devname = DRM(alloc)(strlen(dev->name) + dev->unique_len + 2,
+				DRM_MEM_DRIVER);
+	if (dev->devname == NULL)
+		return ENOMEM;
+
+	sprintf(dev->devname, "%s@%s", dev->name, dev->unique);
 
 	return 0;
 }
@@ -363,3 +298,47 @@ int DRM(getstats)( struct inode *inode, struct file *filp,
 		return -EFAULT;
 	return 0;
 }
+
+#define DRM_IF_MAJOR	1
+#define DRM_IF_MINOR	2
+
+int DRM(setversion)(DRM_IOCTL_ARGS)
+{
+	DRM_DEVICE;
+	drm_set_version_t sv;
+	drm_set_version_t retv;
+	int if_version;
+
+	DRM_COPY_FROM_USER_IOCTL(sv, (drm_set_version_t *)data, sizeof(sv));
+
+	retv.drm_di_major = DRM_IF_MAJOR;
+	retv.drm_di_minor = DRM_IF_MINOR;
+	retv.drm_dd_major = DRIVER_MAJOR;
+	retv.drm_dd_minor = DRIVER_MINOR;
+
+	DRM_COPY_TO_USER_IOCTL((drm_set_version_t *)data, retv, sizeof(sv));
+
+	if (sv.drm_di_major != -1) {
+		if (sv.drm_di_major != DRM_IF_MAJOR ||
+		    sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR)
+			return EINVAL;
+		if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_dd_minor);
+		dev->if_version = DRM_MAX(if_version, dev->if_version);
+		if (sv.drm_di_minor >= 1) {
+			/*
+			 * Version 1.1 includes tying of DRM to specific device
+			 */
+			DRM(set_busid)(dev);
+		}
+	}
+
+	if (sv.drm_dd_major != -1) {
+		if (sv.drm_dd_major != DRIVER_MAJOR ||
+		    sv.drm_dd_minor < 0 || sv.drm_dd_minor > DRIVER_MINOR)
+			return EINVAL;
+#ifdef DRIVER_SETVERSION
+		DRIVER_SETVERSION(dev, &sv);
+#endif
+	}
+	return 0;
+}
diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h
index 4d5797955..74d3c499e 100644
--- a/drivers/char/drm/drm_memory_debug.h
+++ b/drivers/char/drm/drm_memory_debug.h
@@ -67,6 +67,7 @@ static drm_mem_stats_t	  DRM(mem_stats)[]   = {
 	[DRM_MEM_TOTALAGP]  = { "totalagp" },
 	[DRM_MEM_BOUNDAGP]  = { "boundagp" },
 	[DRM_MEM_CTXBITMAP] = { "ctxbitmap"},
+	[DRM_MEM_CTXLIST]   = { "ctxlist"  },
 	[DRM_MEM_STUB]      = { "stub"     },
 	{ NULL, 0, }		/* Last entry must be null */
 };
diff --git a/drivers/char/drm/drm_os_linux.h b/drivers/char/drm/drm_os_linux.h
index 03bbc91b6..6b69f0aa3 100644
--- a/drivers/char/drm/drm_os_linux.h
+++ b/drivers/char/drm/drm_os_linux.h
@@ -62,8 +62,12 @@
 	verify_area( VERIFY_READ, uaddr, size )
 #define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3) 	\
 	__copy_from_user(arg1, arg2, arg3)
+#define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3)	\
+	__copy_to_user(arg1, arg2, arg3)
 #define DRM_GET_USER_UNCHECKED(val, uaddr)		\
 	__get_user(val, uaddr)
+#define DRM_PUT_USER_UNCHECKED(uaddr, val)		\
+	__put_user(val, uaddr)
 
 
 /** 'malloc' without the overhead of DRM(alloc)() */
@@ -71,6 +75,8 @@
 /** 'free' without the overhead of DRM(free)() */
 #define DRM_FREE(x,size) kfree(x)
 
+#define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data
+
 /** 
  * Get the pointer to the SAREA.
  *
diff --git a/drivers/char/drm/drm_sarea.h b/drivers/char/drm/drm_sarea.h
index dd3f617a3..de782ed2f 100644
--- a/drivers/char/drm/drm_sarea.h
+++ b/drivers/char/drm/drm_sarea.h
@@ -32,9 +32,23 @@
 #ifndef _DRM_SAREA_H_
 #define _DRM_SAREA_H_
 
+#include "drm.h"
+
+/* SAREA area needs to be at least a page */
+#if defined(__alpha__)
+#define SAREA_MAX                       0x2000
+#elif defined(__ia64__)
+#define SAREA_MAX                       0x10000         /* 64kB */
+#else
+/* Intel 830M driver needs at least 8k SAREA */
+#define SAREA_MAX                       0x2000
+#endif
+
 /** Maximum number of drawables in the SAREA */
 #define SAREA_MAX_DRAWABLES 		256
 
+#define SAREA_DRAWABLE_CLAIMED_ENTRY    0x80000000
+
 /** SAREA drawable */
 typedef struct drm_sarea_drawable {
     unsigned int	stamp;
diff --git a/drivers/char/drm/drm_stub.h b/drivers/char/drm/drm_stub.h
index bf31eeff4..4e98feb67 100644
--- a/drivers/char/drm/drm_stub.h
+++ b/drivers/char/drm/drm_stub.h
@@ -209,8 +209,8 @@ int DRM(stub_register)(const char *name, struct file_operations *fops,
 		ret2 = DRM(stub_info).info_register(name, fops, dev);
 		if (ret2) {
 			if (!ret1) {
-			unregister_chrdev(DRM_MAJOR, "drm");
-			class_simple_destroy(drm_class);
+				unregister_chrdev(DRM_MAJOR, "drm");
+				class_simple_destroy(drm_class);
 			}
 			if (!i)
 				inter_module_unregister("drm");
diff --git a/drivers/char/drm/drm_vm.h b/drivers/char/drm/drm_vm.h
index cf641664a..844ab32e0 100644
--- a/drivers/char/drm/drm_vm.h
+++ b/drivers/char/drm/drm_vm.h
@@ -35,48 +35,19 @@
 
 #include "drmP.h"
 
-/** AGP virtual memory operations */
-struct vm_operations_struct   DRM(vm_ops) = {
-	.nopage = DRM(vm_nopage),
-	.open	= DRM(vm_open),
-	.close	= DRM(vm_close),
-};
-
-/** Shared virtual memory operations */
-struct vm_operations_struct   DRM(vm_shm_ops) = {
-	.nopage = DRM(vm_shm_nopage),
-	.open	= DRM(vm_open),
-	.close	= DRM(vm_shm_close),
-};
-
-/** DMA virtual memory operations */
-struct vm_operations_struct   DRM(vm_dma_ops) = {
-	.nopage = DRM(vm_dma_nopage),
-	.open	= DRM(vm_open),
-	.close	= DRM(vm_close),
-};
-
-/** Scatter-gather virtual memory operations */
-struct vm_operations_struct   DRM(vm_sg_ops) = {
-	.nopage = DRM(vm_sg_nopage),
-	.open   = DRM(vm_open),
-	.close  = DRM(vm_close),
-};
 
 /**
  * \c nopage method for AGP virtual memory.
  *
  * \param vma virtual memory area.
  * \param address access address.
- * \param write_access sharing.
  * \return pointer to the page structure.
  * 
  * Find the right map and if it's AGP memory find the real physical page to
  * map, get the page, increment the use count and return it.
  */
-struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
-			    unsigned long address,
-			    int *type)
+static __inline__ struct page *DRM(do_vm_nopage)(struct vm_area_struct *vma,
+						 unsigned long address)
 {
 #if __REALLY_HAVE_AGP
 	drm_file_t *priv  = vma->vm_file->private_data;
@@ -131,10 +102,8 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
 
 		DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx, count=%d\n",
 			  baddr, __va(agpmem->memory->memory[offset]), offset,
-			  atomic_read(&page->count));
+			  page_count(page));
 
-		if (type)
-			*type = VM_FAULT_MINOR;
 		return page;
         }
 vm_nopage_error:
@@ -148,15 +117,13 @@ vm_nopage_error:
  *
  * \param vma virtual memory area.
  * \param address access address.
- * \param write_access sharing.
  * \return pointer to the page structure.
  * 
  * Get the the mapping, find the real physical page to map, get the page, and
  * return it.
  */
-struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
-				unsigned long address,
-				int *type)
+static __inline__ struct page *DRM(do_vm_shm_nopage)(struct vm_area_struct *vma,
+						     unsigned long address)
 {
 	drm_map_t	 *map	 = (drm_map_t *)vma->vm_private_data;
 	unsigned long	 offset;
@@ -172,8 +139,6 @@ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
 	if (!page)
 		return NOPAGE_OOM;
 	get_page(page);
-	if (type)
-		*type = VM_FAULT_MINOR;
 
 	DRM_DEBUG("shm_nopage 0x%lx\n", address);
 	return page;
@@ -265,14 +230,12 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma)
  *
  * \param vma virtual memory area.
  * \param address access address.
- * \param write_access sharing.
  * \return pointer to the page structure.
  * 
  * Determine the page number from the page offset and get it from drm_device_dma::pagelist.
  */
-struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
-				unsigned long address,
-				int *type)
+static __inline__ struct page *DRM(do_vm_dma_nopage)(struct vm_area_struct *vma,
+						     unsigned long address)
 {
 	drm_file_t	 *priv	 = vma->vm_file->private_data;
 	drm_device_t	 *dev	 = priv->dev;
@@ -291,8 +254,6 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
 			     (offset & (~PAGE_MASK))));
 
 	get_page(page);
-	if (type)
-		*type = VM_FAULT_MINOR;
 
 	DRM_DEBUG("dma_nopage 0x%lx (page %lu)\n", address, page_nr);
 	return page;
@@ -303,14 +264,12 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
  *
  * \param vma virtual memory area.
  * \param address access address.
- * \param write_access sharing.
  * \return pointer to the page structure.
  * 
  * Determine the map offset from the page offset and get it from drm_sg_mem::pagelist.
  */
-struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
-			       unsigned long address,
-			       int *type)
+static __inline__ struct page *DRM(do_vm_sg_nopage)(struct vm_area_struct *vma,
+						    unsigned long address)
 {
 	drm_map_t        *map    = (drm_map_t *)vma->vm_private_data;
 	drm_file_t *priv = vma->vm_file->private_data;
@@ -331,12 +290,99 @@ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
 	page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT);
 	page = entry->pagelist[page_offset];
 	get_page(page);
-	if (type)
-		*type = VM_FAULT_MINOR;
 
 	return page;
 }
 
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+
+static struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
+				   unsigned long address,
+				   int *type) {
+	if (type) *type = VM_FAULT_MINOR;
+	return DRM(do_vm_nopage)(vma, address);
+}
+
+static struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
+				       unsigned long address,
+				       int *type) {
+	if (type) *type = VM_FAULT_MINOR;
+	return DRM(do_vm_shm_nopage)(vma, address);
+}
+
+static struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
+				       unsigned long address,
+				       int *type) {
+	if (type) *type = VM_FAULT_MINOR;
+	return DRM(do_vm_dma_nopage)(vma, address);
+}
+
+static struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
+				      unsigned long address,
+				      int *type) {
+	if (type) *type = VM_FAULT_MINOR;
+	return DRM(do_vm_sg_nopage)(vma, address);
+}
+
+#else	/* LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,0) */
+
+static struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
+				   unsigned long address,
+				   int unused) {
+	return DRM(do_vm_nopage)(vma, address);
+}
+
+static struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
+				       unsigned long address,
+				       int unused) {
+	return DRM(do_vm_shm_nopage)(vma, address);
+}
+
+static struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
+				       unsigned long address,
+				       int unused) {
+	return DRM(do_vm_dma_nopage)(vma, address);
+}
+
+static struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
+				      unsigned long address,
+				      int unused) {
+	return DRM(do_vm_sg_nopage)(vma, address);
+}
+
+#endif
+
+
+/** AGP virtual memory operations */
+static struct vm_operations_struct   DRM(vm_ops) = {
+	.nopage = DRM(vm_nopage),
+	.open	= DRM(vm_open),
+	.close	= DRM(vm_close),
+};
+
+/** Shared virtual memory operations */
+static struct vm_operations_struct   DRM(vm_shm_ops) = {
+	.nopage = DRM(vm_shm_nopage),
+	.open	= DRM(vm_open),
+	.close	= DRM(vm_shm_close),
+};
+
+/** DMA virtual memory operations */
+static struct vm_operations_struct   DRM(vm_dma_ops) = {
+	.nopage = DRM(vm_dma_nopage),
+	.open	= DRM(vm_open),
+	.close	= DRM(vm_close),
+};
+
+/** Scatter-gather virtual memory operations */
+static struct vm_operations_struct   DRM(vm_sg_ops) = {
+	.nopage = DRM(vm_sg_nopage),
+	.open   = DRM(vm_open),
+	.close  = DRM(vm_close),
+};
+
+
 /**
  * \c open method for shared virtual memory.
  * 
diff --git a/drivers/char/drm/ffb.h b/drivers/char/drm/ffb.h
index 01a676a64..af35783b2 100644
--- a/drivers/char/drm/ffb.h
+++ b/drivers/char/drm/ffb.h
@@ -13,3 +13,4 @@
 #define __HAVE_KERNEL_CTX_SWITCH	1
 #define __HAVE_RELEASE			1
 #endif
+
diff --git a/drivers/char/drm/gamma.h b/drivers/char/drm/gamma.h
index 54dafcfc8..dcd649048 100644
--- a/drivers/char/drm/gamma.h
+++ b/drivers/char/drm/gamma.h
@@ -104,8 +104,8 @@
 	return 0;							\
 } while (0)
 
-#define __HAVE_DMA_IRQ			1
-#define __HAVE_DMA_IRQ_BH		1
+#define __HAVE_IRQ			1
+#define __HAVE_IRQ_BH			1
 
 #define DRIVER_AGP_BUFFERS_MAP( dev )					\
 	((drm_gamma_private_t *)((dev)->dev_private))->buffers
diff --git a/drivers/char/drm/gamma_dma.c b/drivers/char/drm/gamma_dma.c
index 8b612488f..ed6a8358d 100644
--- a/drivers/char/drm/gamma_dma.c
+++ b/drivers/char/drm/gamma_dma.c
@@ -116,7 +116,7 @@ static inline int gamma_dma_is_ready(drm_device_t *dev)
 	return (!GAMMA_READ(GAMMA_DMACOUNT));
 }
 
-irqreturn_t gamma_dma_service( DRM_IRQ_ARGS )
+irqreturn_t gamma_irq_handler( DRM_IRQ_ARGS )
 {
 	drm_device_t	 *dev = (drm_device_t *)arg;
 	drm_device_dma_t *dma = dev->dma;
@@ -262,7 +262,7 @@ static void gamma_dma_timer_bh(unsigned long dev)
 	gamma_dma_schedule((drm_device_t *)dev, 0);
 }
 
-void gamma_dma_immediate_bh(void *dev)
+void gamma_irq_immediate_bh(void *dev)
 {
 	gamma_dma_schedule(dev, 0);
 }
@@ -346,6 +346,9 @@ static int gamma_dma_priority(struct file *filp,
 	drm_buf_t	  *buf;
 	drm_buf_t	  *last_buf = NULL;
 	drm_device_dma_t  *dma	    = dev->dma;
+	int		  *send_indices = NULL;
+	int		  *send_sizes = NULL;
+
 	DECLARE_WAITQUEUE(entry, current);
 
 				/* Turn off interrupt handling */
@@ -365,11 +368,31 @@ static int gamma_dma_priority(struct file *filp,
 		++must_free;
 	}
 
+	send_indices = DRM(alloc)(d->send_count * sizeof(*send_indices),
+				  DRM_MEM_DRIVER);
+	if (send_indices == NULL)
+		return -ENOMEM;
+	if (copy_from_user(send_indices, d->send_indices, 
+			   d->send_count * sizeof(*send_indices))) {
+		retcode = -EFAULT;
+                goto cleanup;
+	}
+	
+	send_sizes = DRM(alloc)(d->send_count * sizeof(*send_sizes),
+				DRM_MEM_DRIVER);
+	if (send_sizes == NULL)
+		return -ENOMEM;
+	if (copy_from_user(send_sizes, d->send_sizes, 
+			   d->send_count * sizeof(*send_sizes))) {
+		retcode = -EFAULT;
+                goto cleanup;
+	}
+
 	for (i = 0; i < d->send_count; i++) {
-		idx = d->send_indices[i];
+		idx = send_indices[i];
 		if (idx < 0 || idx >= dma->buf_count) {
 			DRM_ERROR("Index %d (of %d max)\n",
-				  d->send_indices[i], dma->buf_count - 1);
+				  send_indices[i], dma->buf_count - 1);
 			continue;
 		}
 		buf = dma->buflist[ idx ];
@@ -391,7 +414,7 @@ static int gamma_dma_priority(struct file *filp,
 				   process closes the /dev/drm? handle, so
 				   it can't also be doing DMA. */
 		buf->list	  = DRM_LIST_PRIO;
-		buf->used	  = d->send_sizes[i];
+		buf->used	  = send_sizes[i];
 		buf->context	  = d->context;
 		buf->while_locked = d->flags & _DRM_DMA_WHILE_LOCKED;
 		address		  = (unsigned long)buf->address;
@@ -402,14 +425,14 @@ static int gamma_dma_priority(struct file *filp,
 		if (buf->pending) {
 			DRM_ERROR("Sending pending buffer:"
 				  " buffer %d, offset %d\n",
-				  d->send_indices[i], i);
+				  send_indices[i], i);
 			retcode = -EINVAL;
 			goto cleanup;
 		}
 		if (buf->waiting) {
 			DRM_ERROR("Sending waiting buffer:"
 				  " buffer %d, offset %d\n",
-				  d->send_indices[i], i);
+				  send_indices[i], i);
 			retcode = -EINVAL;
 			goto cleanup;
 		}
@@ -458,6 +481,12 @@ cleanup:
 		gamma_dma_ready(dev);
 		gamma_free_buffer(dev, last_buf);
 	}
+	if (send_indices)
+		DRM(free)(send_indices, d->send_count * sizeof(*send_indices), 
+			  DRM_MEM_DRIVER);
+	if (send_sizes)
+		DRM(free)(send_sizes, d->send_count * sizeof(*send_sizes), 
+			  DRM_MEM_DRIVER);
 
 	if (must_free && !dev->context_flag) {
 		if (gamma_lock_free(dev, &dev->lock.hw_lock->lock,
@@ -476,9 +505,13 @@ static int gamma_dma_send_buffers(struct file *filp,
 	drm_buf_t	  *last_buf = NULL;
 	int		  retcode   = 0;
 	drm_device_dma_t  *dma	    = dev->dma;
+	int               send_index;
+
+	if (get_user(send_index, &d->send_indices[d->send_count-1]))
+		return -EFAULT;
 
 	if (d->flags & _DRM_DMA_BLOCK) {
-		last_buf = dma->buflist[d->send_indices[d->send_count-1]];
+		last_buf = dma->buflist[send_index];
 		add_wait_queue(&last_buf->dma_wait, &entry);
 	}
 
@@ -656,12 +689,12 @@ int gamma_do_cleanup_dma( drm_device_t *dev )
 {
 	DRM_DEBUG( "%s\n", __FUNCTION__ );
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
diff --git a/drivers/char/drm/gamma_drv.c b/drivers/char/drm/gamma_drv.c
index f1b8b205f..b1fb05055 100644
--- a/drivers/char/drm/gamma_drv.c
+++ b/drivers/char/drm/gamma_drv.c
@@ -48,6 +48,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "gamma_lists.h"        /* NOTE */
 #include "drm_lock.h"
 #include "gamma_lock.h"		/* NOTE */
diff --git a/drivers/char/drm/i810.h b/drivers/char/drm/i810.h
index a5d300a24..aee2efff1 100644
--- a/drivers/char/drm/i810.h
+++ b/drivers/char/drm/i810.h
@@ -77,7 +77,6 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_I810_MC)]      = { i810_dma_mc,     1, 1 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus,    1, 0 }, \
 	[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] =    { i810_flip_bufs,  1, 0 }
- 
 
 #define __HAVE_COUNTERS         4
 #define __HAVE_COUNTER6         _DRM_STAT_IRQ
@@ -112,7 +111,7 @@
  * a noop stub is generated for compatibility.
  */
 /* XXX: Add vblank support? */
-#define __HAVE_DMA_IRQ		0
+#define __HAVE_IRQ		0
 
 /* Buffer customization:
  */
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
index e1ebc7033..84823f664 100644
--- a/drivers/char/drm/i810_dma.c
+++ b/drivers/char/drm/i810_dma.c
@@ -232,12 +232,12 @@ int i810_dma_cleanup(drm_device_t *dev)
 {
 	drm_device_dma_t *dma = dev->dma;
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if (dev->irq) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if (dev->dev_private) {
diff --git a/drivers/char/drm/i830.h b/drivers/char/drm/i830.h
index 5775162ae..b4a361bf0 100644
--- a/drivers/char/drm/i830.h
+++ b/drivers/char/drm/i830.h
@@ -115,10 +115,10 @@
 #define USE_IRQS 0
 
 #if USE_IRQS
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_SHARED_IRQ	1
 #else
-#define __HAVE_DMA_IRQ          0
+#define __HAVE_IRQ          0
 #endif
 
 
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c
index 03daa46ae..86c4e4204 100644
--- a/drivers/char/drm/i830_dma.c
+++ b/drivers/char/drm/i830_dma.c
@@ -232,12 +232,12 @@ int i830_dma_cleanup(drm_device_t *dev)
 {
 	drm_device_dma_t *dma = dev->dma;
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if (dev->irq) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if (dev->dev_private) {
@@ -1540,7 +1540,7 @@ int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
 
 	switch( param.param ) {
 	case I830_PARAM_IRQ_ACTIVE:
-		value = dev->irq ? 1 : 0;
+		value = dev->irq_enabled;
 		break;
 	default:
 		return -EINVAL;
diff --git a/drivers/char/drm/i830_drv.c b/drivers/char/drm/i830_drv.c
index 0735c94db..2f4e81572 100644
--- a/drivers/char/drm/i830_drv.c
+++ b/drivers/char/drm/i830_drv.c
@@ -50,6 +50,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
diff --git a/drivers/char/drm/i830_irq.c b/drivers/char/drm/i830_irq.c
index 3ec4e98ad..b90670882 100644
--- a/drivers/char/drm/i830_irq.c
+++ b/drivers/char/drm/i830_irq.c
@@ -35,7 +35,7 @@
 #include <linux/delay.h>
 
 
-irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(irq_handler)( DRM_IRQ_ARGS )
 {
 	drm_device_t	 *dev = (drm_device_t *)arg;
       	drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
diff --git a/drivers/char/drm/mga.h b/drivers/char/drm/mga.h
index 96179627c..702857a32 100644
--- a/drivers/char/drm/mga.h
+++ b/drivers/char/drm/mga.h
@@ -78,7 +78,7 @@
 /* DMA customization:
  */
 #define __HAVE_DMA		1
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_VBL_IRQ		1
 #define __HAVE_SHARED_IRQ       1
 
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index bfaee0d83..5e5c407d1 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -500,14 +500,6 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
-	if(!dev_priv->fb) {
-		DRM_ERROR( "failed to find framebuffer!\n" );
-		/* Assign dev_private so we can do cleanup. */
-		dev->dev_private = (void *)dev_priv;
-		mga_do_cleanup_dma( dev );
-		return DRM_ERR(EINVAL);
-	}
 	DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
 	if(!dev_priv->mmio) {
 		DRM_ERROR( "failed to find mmio region!\n" );
@@ -639,12 +631,12 @@ int mga_do_cleanup_dma( drm_device_t *dev )
 {
 	DRM_DEBUG( "\n" );
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
diff --git a/drivers/char/drm/mga_drm.h b/drivers/char/drm/mga_drm.h
index b19bc0113..989889068 100644
--- a/drivers/char/drm/mga_drm.h
+++ b/drivers/char/drm/mga_drm.h
@@ -117,6 +117,8 @@
 #define MGA_NR_TEX_REGIONS		16
 #define MGA_LOG_MIN_TEX_REGION_SIZE	16
 
+#define  DRM_MGA_IDLE_RETRY          2048
+
 #endif /* __MGA_SAREA_DEFINES__ */
 
 
@@ -230,16 +232,27 @@ typedef struct _drm_mga_sarea {
 /* MGA specific ioctls
  * The device specific ioctl range is 0x40 to 0x79.
  */
-#define DRM_IOCTL_MGA_INIT		DRM_IOW( 0x40, drm_mga_init_t)
-#define DRM_IOCTL_MGA_FLUSH		DRM_IOW( 0x41, drm_lock_t)
-#define DRM_IOCTL_MGA_RESET		DRM_IO(  0x42)
-#define DRM_IOCTL_MGA_SWAP		DRM_IO(  0x43)
-#define DRM_IOCTL_MGA_CLEAR		DRM_IOW( 0x44, drm_mga_clear_t)
-#define DRM_IOCTL_MGA_VERTEX		DRM_IOW( 0x45, drm_mga_vertex_t)
-#define DRM_IOCTL_MGA_INDICES		DRM_IOW( 0x46, drm_mga_indices_t)
-#define DRM_IOCTL_MGA_ILOAD		DRM_IOW( 0x47, drm_mga_iload_t)
-#define DRM_IOCTL_MGA_BLIT		DRM_IOW( 0x48, drm_mga_blit_t)
-#define DRM_IOCTL_MGA_GETPARAM		DRM_IOWR(0x49, drm_mga_getparam_t)
+#define DRM_MGA_INIT     0x00
+#define DRM_MGA_FLUSH    0x01
+#define DRM_MGA_RESET    0x02
+#define DRM_MGA_SWAP     0x03
+#define DRM_MGA_CLEAR    0x04
+#define DRM_MGA_VERTEX   0x05
+#define DRM_MGA_INDICES  0x06
+#define DRM_MGA_ILOAD    0x07
+#define DRM_MGA_BLIT     0x08
+#define DRM_MGA_GETPARAM 0x09
+
+#define DRM_IOCTL_MGA_INIT     DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t)
+#define DRM_IOCTL_MGA_FLUSH    DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_FLUSH, drm_lock_t)
+#define DRM_IOCTL_MGA_RESET    DRM_IO(  DRM_COMMAND_BASE + DRM_MGA_RESET)
+#define DRM_IOCTL_MGA_SWAP     DRM_IO(  DRM_COMMAND_BASE + DRM_MGA_SWAP)
+#define DRM_IOCTL_MGA_CLEAR    DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t)
+#define DRM_IOCTL_MGA_VERTEX   DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t)
+#define DRM_IOCTL_MGA_INDICES  DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t)
+#define DRM_IOCTL_MGA_ILOAD    DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
+#define DRM_IOCTL_MGA_BLIT     DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
+#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
 
 typedef struct _drm_mga_warp_index {
    	int installed;
@@ -330,7 +343,7 @@ typedef struct _drm_mga_blit {
 
 typedef struct drm_mga_getparam {
 	int param;
-	int *value;
+	void *value;
 } drm_mga_getparam_t;
 
 #endif
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
index f0d4935df..6bcad048f 100644
--- a/drivers/char/drm/mga_drv.c
+++ b/drivers/char/drm/mga_drv.c
@@ -45,6 +45,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h
index 9396ae926..65847165c 100644
--- a/drivers/char/drm/mga_drv.h
+++ b/drivers/char/drm/mga_drv.h
@@ -91,7 +91,6 @@ typedef struct drm_mga_private {
 	unsigned int texture_size;
 
 	drm_local_map_t *sarea;
-	drm_local_map_t *fb;
 	drm_local_map_t *mmio;
 	drm_local_map_t *status;
 	drm_local_map_t *warp;
diff --git a/drivers/char/drm/mga_irq.c b/drivers/char/drm/mga_irq.c
index ccced64f2..e486618b2 100644
--- a/drivers/char/drm/mga_irq.c
+++ b/drivers/char/drm/mga_irq.c
@@ -36,7 +36,7 @@
 #include "mga_drm.h"
 #include "mga_drv.h"
 
-irqreturn_t mga_dma_service( DRM_IRQ_ARGS )
+irqreturn_t mga_irq_handler( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_mga_private_t *dev_priv = 
diff --git a/drivers/char/drm/r128.h b/drivers/char/drm/r128.h
index 9c3363bda..9dfe18974 100644
--- a/drivers/char/drm/r128.h
+++ b/drivers/char/drm/r128.h
@@ -97,7 +97,7 @@
 /* DMA customization:
  */
 #define __HAVE_DMA		1
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_VBL_IRQ		1
 #define __HAVE_SHARED_IRQ       1
 
diff --git a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c
index d0394a0c3..bf4b4d95d 100644
--- a/drivers/char/drm/r128_cce.c
+++ b/drivers/char/drm/r128_cce.c
@@ -212,7 +212,7 @@ int r128_do_cce_idle( drm_r128_private_t *dev_priv )
 	int i;
 
 	for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
-		if ( GET_RING_HEAD( &dev_priv->ring ) == dev_priv->ring.tail ) {
+		if ( GET_RING_HEAD( dev_priv ) == dev_priv->ring.tail ) {
 			int pm4stat = R128_READ( R128_PM4_STAT );
 			if ( ( (pm4stat & R128_PM4_FIFOCNT_MASK) >=
 			       dev_priv->cce_fifo_size ) &&
@@ -238,7 +238,8 @@ static void r128_do_cce_start( drm_r128_private_t *dev_priv )
 	r128_do_wait_for_idle( dev_priv );
 
 	R128_WRITE( R128_PM4_BUFFER_CNTL,
-		    dev_priv->cce_mode | dev_priv->ring.size_l2qw );
+		    dev_priv->cce_mode | dev_priv->ring.size_l2qw
+		    | R128_PM4_BUFFER_CNTL_NOUPDATE );
 	R128_READ( R128_PM4_BUFFER_ADDR ); /* as per the sample code */
 	R128_WRITE( R128_PM4_MICRO_CNTL, R128_PM4_MICRO_FREERUN );
 
@@ -253,7 +254,6 @@ static void r128_do_cce_reset( drm_r128_private_t *dev_priv )
 {
 	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, 0 );
 	R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 );
-	SET_RING_HEAD( &dev_priv->ring, 0 );
 	dev_priv->ring.tail = 0;
 }
 
@@ -264,7 +264,8 @@ static void r128_do_cce_reset( drm_r128_private_t *dev_priv )
 static void r128_do_cce_stop( drm_r128_private_t *dev_priv )
 {
 	R128_WRITE( R128_PM4_MICRO_CNTL, 0 );
-	R128_WRITE( R128_PM4_BUFFER_CNTL, R128_PM4_NONPM4 );
+	R128_WRITE( R128_PM4_BUFFER_CNTL,
+		    R128_PM4_NONPM4 | R128_PM4_BUFFER_CNTL_NOUPDATE );
 
 	dev_priv->cce_running = 0;
 }
@@ -333,26 +334,6 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev,
 	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, 0 );
 	R128_WRITE( R128_PM4_BUFFER_DL_RPTR, 0 );
 
-	/* DL_RPTR_ADDR is a physical address in AGP space. */
-	SET_RING_HEAD( &dev_priv->ring, 0 );
-
-	if ( !dev_priv->is_pci ) {
-		R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR,
-			    dev_priv->ring_rptr->offset );
-	} else {
-		drm_sg_mem_t *entry = dev->sg;
-		unsigned long tmp_ofs, page_ofs;
-
-		tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle;
-		page_ofs = tmp_ofs >> PAGE_SHIFT;
-
-		R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR,
-     			    entry->busaddr[page_ofs]);
-		DRM_DEBUG( "ring rptr: offset=0x%08lx handle=0x%08lx\n",
-			   (unsigned long) entry->busaddr[page_ofs],
-     			   entry->handle + tmp_ofs );
-	}
-
 	/* Set watermark control */
 	R128_WRITE( R128_PM4_BUFFER_WM_CNTL,
 		    ((R128_WATERMARK_L/4) << R128_WMA_SHIFT)
@@ -486,13 +467,6 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
-	if(!dev_priv->fb) {
-		DRM_ERROR("could not find framebuffer!\n");
-		dev->dev_private = (void *)dev_priv;
-		r128_do_cleanup_cce( dev );
-		return DRM_ERR(EINVAL);
-	}
 	DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
 	if(!dev_priv->mmio) {
 		DRM_ERROR("could not find mmio region!\n");
@@ -567,9 +541,6 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
 #endif
 		dev_priv->cce_buffers_offset = dev->sg->handle;
 
-	dev_priv->ring.head = ((__volatile__ u32 *)
-			       dev_priv->ring_rptr->handle);
-
 	dev_priv->ring.start = (u32 *)dev_priv->cce_ring->handle;
 	dev_priv->ring.end = ((u32 *)dev_priv->cce_ring->handle
 			      + init->ring_size / sizeof(u32));
@@ -580,7 +551,6 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
 		(dev_priv->ring.size / sizeof(u32)) - 1;
 
 	dev_priv->ring.high_mark = 128;
-	dev_priv->ring.ring_rptr = dev_priv->ring_rptr;
 
 	dev_priv->sarea_priv->last_frame = 0;
 	R128_WRITE( R128_LAST_FRAME_REG, dev_priv->sarea_priv->last_frame );
@@ -589,8 +559,9 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
 	R128_WRITE( R128_LAST_DISPATCH_REG,
 		    dev_priv->sarea_priv->last_dispatch );
 
-#if __REALLY_HAVE_SG
+#if __REALLY_HAVE_AGP
 	if ( dev_priv->is_pci ) {
+#endif
 		if (!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart,
      					    &dev_priv->bus_pci_gart) ) {
 			DRM_ERROR( "failed to init PCI GART!\n" );
@@ -599,6 +570,7 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
 			return DRM_ERR(ENOMEM);
 		}
 		R128_WRITE( R128_PCI_GART_PAGE, dev_priv->bus_pci_gart );
+#if __REALLY_HAVE_AGP
 	}
 #endif
 
@@ -615,12 +587,12 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
 int r128_do_cleanup_cce( drm_device_t *dev )
 {
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
@@ -901,7 +873,7 @@ int r128_wait_ring( drm_r128_private_t *dev_priv, int n )
 	int i;
 
 	for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
-		r128_update_ring_snapshot( ring );
+		r128_update_ring_snapshot( dev_priv );
 		if ( ring->space >= n )
 			return 0;
 		DRM_UDELAY( 1 );
diff --git a/drivers/char/drm/r128_drm.h b/drivers/char/drm/r128_drm.h
index efa13a422..ae51de34b 100644
--- a/drivers/char/drm/r128_drm.h
+++ b/drivers/char/drm/r128_drm.h
@@ -176,24 +176,47 @@ typedef struct drm_r128_sarea {
 /* Rage 128 specific ioctls
  * The device specific ioctl range is 0x40 to 0x79.
  */
-#define DRM_IOCTL_R128_INIT		DRM_IOW( 0x40, drm_r128_init_t)
-#define DRM_IOCTL_R128_CCE_START	DRM_IO(  0x41)
-#define DRM_IOCTL_R128_CCE_STOP		DRM_IOW( 0x42, drm_r128_cce_stop_t)
-#define DRM_IOCTL_R128_CCE_RESET	DRM_IO(  0x43)
-#define DRM_IOCTL_R128_CCE_IDLE		DRM_IO(  0x44)
-#define DRM_IOCTL_R128_RESET		DRM_IO(  0x46)
-#define DRM_IOCTL_R128_SWAP		DRM_IO(  0x47)
-#define DRM_IOCTL_R128_CLEAR		DRM_IOW( 0x48, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX		DRM_IOW( 0x49, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES		DRM_IOW( 0x4a, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT		DRM_IOW( 0x4b, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH		DRM_IOW( 0x4c, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE		DRM_IOW( 0x4d, drm_r128_stipple_t)
-#define DRM_IOCTL_R128_INDIRECT		DRM_IOWR(0x4f, drm_r128_indirect_t)
-#define DRM_IOCTL_R128_FULLSCREEN	DRM_IOW( 0x50, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_CLEAR2		DRM_IOW( 0x51, drm_r128_clear2_t)
-#define DRM_IOCTL_R128_GETPARAM		DRM_IOW( 0x52, drm_r128_getparam_t)
-#define DRM_IOCTL_R128_FLIP		DRM_IO(  0x53)
+#define DRM_R128_INIT       0x00
+#define DRM_R128_CCE_START  0x01
+#define DRM_R128_CCE_STOP   0x02
+#define DRM_R128_CCE_RESET  0x03
+#define DRM_R128_CCE_IDLE   0x04
+/* 0x05 not used */
+#define DRM_R128_RESET      0x06
+#define DRM_R128_SWAP       0x07
+#define DRM_R128_CLEAR      0x08
+#define DRM_R128_VERTEX     0x09
+#define DRM_R128_INDICES    0x0a
+#define DRM_R128_BLIT       0x0b
+#define DRM_R128_DEPTH      0x0c
+#define DRM_R128_STIPPLE    0x0d
+/* 0x0e not used */
+#define DRM_R128_INDIRECT   0x0f
+#define DRM_R128_FULLSCREEN 0x10
+#define DRM_R128_CLEAR2     0x11
+#define DRM_R128_GETPARAM   0x12
+#define DRM_R128_FLIP       0x13
+
+#define DRM_IOCTL_R128_INIT       DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
+#define DRM_IOCTL_R128_CCE_START  DRM_IO(  DRM_COMMAND_BASE + DRM_R128_CCE_START)
+#define DRM_IOCTL_R128_CCE_STOP   DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
+#define DRM_IOCTL_R128_CCE_RESET  DRM_IO(  DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
+#define DRM_IOCTL_R128_CCE_IDLE   DRM_IO(  DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
+/* 0x05 not used */
+#define DRM_IOCTL_R128_RESET      DRM_IO(  DRM_COMMAND_BASE + DRM_R128_RESET)
+#define DRM_IOCTL_R128_SWAP       DRM_IO(  DRM_COMMAND_BASE + DRM_R128_SWAP)
+#define DRM_IOCTL_R128_CLEAR      DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
+#define DRM_IOCTL_R128_VERTEX     DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
+#define DRM_IOCTL_R128_INDICES    DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
+#define DRM_IOCTL_R128_BLIT       DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
+#define DRM_IOCTL_R128_DEPTH      DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
+#define DRM_IOCTL_R128_STIPPLE    DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
+/* 0x0e not used */
+#define DRM_IOCTL_R128_INDIRECT   DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
+#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
+#define DRM_IOCTL_R128_CLEAR2     DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
+#define DRM_IOCTL_R128_GETPARAM   DRM_IOW( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
+#define DRM_IOCTL_R128_FLIP       DRM_IO(  DRM_COMMAND_BASE + DRM_R128_FLIP)
 
 typedef struct drm_r128_init {
 	enum {
@@ -316,7 +339,7 @@ typedef struct drm_r128_fullscreen {
 
 typedef struct drm_r128_getparam {
 	int param;
-	int *value;
+	void *value;
 } drm_r128_getparam_t;
 
 #endif
diff --git a/drivers/char/drm/r128_drv.c b/drivers/char/drm/r128_drv.c
index e2e426907..1dee16159 100644
--- a/drivers/char/drm/r128_drv.c
+++ b/drivers/char/drm/r128_drv.c
@@ -47,6 +47,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
diff --git a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h
index 26f7cf86e..9df32e566 100644
--- a/drivers/char/drm/r128_drv.h
+++ b/drivers/char/drm/r128_drv.h
@@ -34,8 +34,7 @@
 #ifndef __R128_DRV_H__
 #define __R128_DRV_H__
 
-#define GET_RING_HEAD(ring)		DRM_READ32(  (ring)->ring_rptr, 0 ) /* (ring)->head */
-#define SET_RING_HEAD(ring,val)		DRM_WRITE32( (ring)->ring_rptr, 0, (val) ) /* (ring)->head */
+#define GET_RING_HEAD(dev_priv)		R128_READ( R128_PM4_BUFFER_DL_RPTR )
 
 typedef struct drm_r128_freelist {
    	unsigned int age;
@@ -50,13 +49,11 @@ typedef struct drm_r128_ring_buffer {
 	int size;
 	int size_l2qw;
 
-	volatile u32 *head;
 	u32 tail;
 	u32 tail_mask;
 	int space;
 
 	int high_mark;
-	drm_local_map_t *ring_rptr;
 } drm_r128_ring_buffer_t;
 
 typedef struct drm_r128_private {
@@ -100,7 +97,6 @@ typedef struct drm_r128_private {
 	u32 span_pitch_offset_c;
 
 	drm_local_map_t *sarea;
-	drm_local_map_t *fb;
 	drm_local_map_t *mmio;
 	drm_local_map_t *cce_ring;
 	drm_local_map_t *ring_rptr;
@@ -132,14 +128,6 @@ extern drm_buf_t *r128_freelist_get( drm_device_t *dev );
 
 extern int r128_wait_ring( drm_r128_private_t *dev_priv, int n );
 
-static __inline__ void
-r128_update_ring_snapshot( drm_r128_ring_buffer_t *ring )
-{
-	ring->space = (GET_RING_HEAD( ring ) - ring->tail) * sizeof(u32);
-	if ( ring->space <= 0 )
-		ring->space += ring->size;
-}
-
 extern int r128_do_cce_idle( drm_r128_private_t *dev_priv );
 extern int r128_do_cleanup_cce( drm_device_t *dev );
 extern int r128_do_cleanup_pageflip( drm_device_t *dev );
@@ -279,6 +267,7 @@ extern int r128_cce_indirect( DRM_IOCTL_ARGS );
 #	define R128_PM4_64PIO_64VCBM_64INDBM	(7  << 28)
 #	define R128_PM4_64BM_64VCBM_64INDBM	(8  << 28)
 #	define R128_PM4_64PIO_64VCPIO_64INDPIO	(15 << 28)
+#	define R128_PM4_BUFFER_CNTL_NOUPDATE	(1  << 27)
 
 #define R128_PM4_BUFFER_WM_CNTL		0x0708
 #	define R128_WMA_SHIFT			0
@@ -403,6 +392,15 @@ extern int R128_READ_PLL(drm_device_t *dev, int addr);
 					 (pkt) | ((n) << 16))
 
 
+static __inline__ void
+r128_update_ring_snapshot( drm_r128_private_t *dev_priv )
+{
+	drm_r128_ring_buffer_t *ring = &dev_priv->ring;
+	ring->space = (GET_RING_HEAD( dev_priv ) - ring->tail) * sizeof(u32);
+	if ( ring->space <= 0 )
+		ring->space += ring->size;
+}
+
 /* ================================================================
  * Misc helper macros
  */
@@ -412,7 +410,7 @@ do {									\
 	drm_r128_ring_buffer_t *ring = &dev_priv->ring; int i;		\
 	if ( ring->space < ring->high_mark ) {				\
 		for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {	\
-			r128_update_ring_snapshot( ring );		\
+			r128_update_ring_snapshot( dev_priv );		\
 			if ( ring->space >= ring->high_mark )		\
 				goto __ring_space_done;			\
 			DRM_UDELAY(1);				\
@@ -445,17 +443,10 @@ do {									\
  * Ring control
  */
 
-#if defined(__powerpc__)
-#define r128_flush_write_combine()	(void) GET_RING_HEAD( &dev_priv->ring )
-#else
-#define r128_flush_write_combine()	DRM_WRITEMEMORYBARRIER()
-#endif
-
-
 #define R128_VERBOSE	0
 
 #define RING_LOCALS							\
-	int write; unsigned int tail_mask; volatile u32 *ring;
+	int write, _nr; unsigned int tail_mask; volatile u32 *ring;
 
 #define BEGIN_RING( n ) do {						\
 	if ( R128_VERBOSE ) {						\
@@ -463,9 +454,10 @@ do {									\
 			   (n), __FUNCTION__ );				\
 	}								\
 	if ( dev_priv->ring.space <= (n) * sizeof(u32) ) {		\
+		COMMIT_RING();						\
 		r128_wait_ring( dev_priv, (n) * sizeof(u32) );		\
 	}								\
-	dev_priv->ring.space -= (n) * sizeof(u32);			\
+	_nr = n; dev_priv->ring.space -= (n) * sizeof(u32);		\
 	ring = dev_priv->ring.start;					\
 	write = dev_priv->ring.tail;					\
 	tail_mask = dev_priv->ring.tail_mask;				\
@@ -488,9 +480,23 @@ do {									\
 			dev_priv->ring.start,				\
 			write * sizeof(u32) );				\
 	}								\
-	r128_flush_write_combine();					\
-	dev_priv->ring.tail = write;					\
-	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, write );			\
+	if (((dev_priv->ring.tail + _nr) & tail_mask) != write) {	\
+		DRM_ERROR( 						\
+			"ADVANCE_RING(): mismatch: nr: %x write: %x line: %d\n",	\
+			((dev_priv->ring.tail + _nr) & tail_mask),	\
+			write, __LINE__);				\
+	} else								\
+		dev_priv->ring.tail = write;				\
+} while (0)
+
+#define COMMIT_RING() do {						\
+	if ( R128_VERBOSE ) {						\
+		DRM_INFO( "COMMIT_RING() tail=0x%06x\n",		\
+			dev_priv->ring.tail );				\
+	}								\
+	DRM_MEMORYBARRIER();						\
+	R128_WRITE( R128_PM4_BUFFER_DL_WPTR, dev_priv->ring.tail );	\
+	R128_READ( R128_PM4_BUFFER_DL_WPTR );				\
 } while (0)
 
 #define OUT_RING( x ) do {						\
diff --git a/drivers/char/drm/r128_irq.c b/drivers/char/drm/r128_irq.c
index c060e1871..e77a5538b 100644
--- a/drivers/char/drm/r128_irq.c
+++ b/drivers/char/drm/r128_irq.c
@@ -36,7 +36,7 @@
 #include "r128_drm.h"
 #include "r128_drv.h"
 
-irqreturn_t r128_dma_service( DRM_IRQ_ARGS )
+irqreturn_t r128_irq_handler( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_r128_private_t *dev_priv = 
diff --git a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c
index 17ac69d41..6ec11b025 100644
--- a/drivers/char/drm/r128_state.c
+++ b/drivers/char/drm/r128_state.c
@@ -45,7 +45,7 @@ static void r128_emit_clip_rects( drm_r128_private_t *dev_priv,
 	RING_LOCALS;
 	DRM_DEBUG( "    %s\n", __FUNCTION__ );
 
-	BEGIN_RING( 17 );
+	BEGIN_RING( (count < 3? count: 3) * 5 + 2 );
 
 	if ( count >= 1 ) {
 		OUT_RING( CCE_PACKET0( R128_AUX1_SC_LEFT, 3 ) );
@@ -916,7 +916,7 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
 
 	count = depth->n;
 	if (count > 4096 || count <= 0)
-		return -EMSGSIZE;
+		return DRM_ERR(EMSGSIZE);
 
 	if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
 		return DRM_ERR(EFAULT);
@@ -1011,8 +1011,8 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
 	DRM_DEBUG( "\n" );
 
 	count = depth->n;
-	if (count > 4096  || count <= 0)
-		return -EMSGSIZE;
+	if (count > 4096 || count <= 0)
+		return DRM_ERR(EMSGSIZE);
 
 	xbuf_size = count * sizeof(*x);
 	ybuf_size = count * sizeof(*y);
@@ -1131,7 +1131,7 @@ static int r128_cce_dispatch_read_span( drm_device_t *dev,
 
 	count = depth->n;
 	if (count > 4096 || count <= 0)
-		return -EMSGSIZE;
+		return DRM_ERR(EMSGSIZE);
 
 	if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
 		return DRM_ERR(EFAULT);
@@ -1176,7 +1176,7 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev,
 
 	count = depth->n;
 	if (count > 4096 || count <= 0)
-		return -EMSGSIZE;
+		return DRM_ERR(EMSGSIZE);
 
 	if ( count > dev_priv->depth_pitch ) {
 		count = dev_priv->depth_pitch;
@@ -1280,6 +1280,7 @@ int r128_cce_clear( DRM_IOCTL_ARGS )
 		sarea_priv->nbox = R128_NR_SAREA_CLIPRECTS;
 
 	r128_cce_dispatch_clear( dev, &clear );
+	COMMIT_RING();
 
 	/* Make sure we restore the 3D state next time.
 	 */
@@ -1315,8 +1316,10 @@ int r128_do_cleanup_pageflip( drm_device_t *dev )
 	R128_WRITE( R128_CRTC_OFFSET,      dev_priv->crtc_offset );
 	R128_WRITE( R128_CRTC_OFFSET_CNTL, dev_priv->crtc_offset_cntl );
 
-	if (dev_priv->current_page != 0)
+	if (dev_priv->current_page != 0) {
 		r128_cce_dispatch_flip( dev );
+		COMMIT_RING();
+	}
 
 	dev_priv->page_flipping = 0;
 	return 0;
@@ -1341,6 +1344,7 @@ int r128_cce_flip( DRM_IOCTL_ARGS )
 
 	r128_cce_dispatch_flip( dev );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1362,6 +1366,7 @@ int r128_cce_swap( DRM_IOCTL_ARGS )
 	dev_priv->sarea_priv->dirty |= (R128_UPLOAD_CONTEXT |
 					R128_UPLOAD_MASKS);
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1421,6 +1426,7 @@ int r128_cce_vertex( DRM_IOCTL_ARGS )
 
 	r128_cce_dispatch_vertex( dev, buf );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1492,6 +1498,7 @@ int r128_cce_indices( DRM_IOCTL_ARGS )
 
 	r128_cce_dispatch_indices( dev, buf, elts.start, elts.end, count );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1501,6 +1508,7 @@ int r128_cce_blit( DRM_IOCTL_ARGS )
 	drm_device_dma_t *dma = dev->dma;
 	drm_r128_private_t *dev_priv = dev->dev_private;
 	drm_r128_blit_t blit;
+	int ret;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
@@ -1518,7 +1526,10 @@ int r128_cce_blit( DRM_IOCTL_ARGS )
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
 	VB_AGE_TEST_WITH_RETURN( dev_priv );
 
-	return r128_cce_dispatch_blit( filp, dev, &blit );
+	ret = r128_cce_dispatch_blit( filp, dev, &blit );
+
+	COMMIT_RING();
+	return ret;
 }
 
 int r128_cce_depth( DRM_IOCTL_ARGS )
@@ -1526,6 +1537,7 @@ int r128_cce_depth( DRM_IOCTL_ARGS )
 	DRM_DEVICE;
 	drm_r128_private_t *dev_priv = dev->dev_private;
 	drm_r128_depth_t depth;
+	int ret;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
@@ -1534,18 +1546,20 @@ int r128_cce_depth( DRM_IOCTL_ARGS )
 
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
 
+	ret = DRM_ERR(EINVAL);
 	switch ( depth.func ) {
 	case R128_WRITE_SPAN:
-		return r128_cce_dispatch_write_span( dev, &depth );
+		ret = r128_cce_dispatch_write_span( dev, &depth );
 	case R128_WRITE_PIXELS:
-		return r128_cce_dispatch_write_pixels( dev, &depth );
+		ret = r128_cce_dispatch_write_pixels( dev, &depth );
 	case R128_READ_SPAN:
-		return r128_cce_dispatch_read_span( dev, &depth );
+		ret = r128_cce_dispatch_read_span( dev, &depth );
 	case R128_READ_PIXELS:
-		return r128_cce_dispatch_read_pixels( dev, &depth );
+		ret = r128_cce_dispatch_read_pixels( dev, &depth );
 	}
 
-	return DRM_ERR(EINVAL);
+	COMMIT_RING();
+	return ret;
 }
 
 int r128_cce_stipple( DRM_IOCTL_ARGS )
@@ -1568,6 +1582,7 @@ int r128_cce_stipple( DRM_IOCTL_ARGS )
 
 	r128_cce_dispatch_stipple( dev, mask );
 
+	COMMIT_RING();
 	return 0;
 }
 
@@ -1643,6 +1658,7 @@ int r128_cce_indirect( DRM_IOCTL_ARGS )
 	 */
 	r128_cce_dispatch_indirect( dev, buf, indirect.start, indirect.end );
 
+	COMMIT_RING();
 	return 0;
 }
 
diff --git a/drivers/char/drm/radeon.h b/drivers/char/drm/radeon.h
index 480991fe8..54fac7940 100644
--- a/drivers/char/drm/radeon.h
+++ b/drivers/char/drm/radeon.h
@@ -51,7 +51,7 @@
 #define DRIVER_DATE		"20020828"
 
 #define DRIVER_MAJOR		1
-#define DRIVER_MINOR		9
+#define DRIVER_MINOR		11
 #define DRIVER_PATCHLEVEL	0
 
 /* Interface history:
@@ -81,6 +81,11 @@
  *       Add 'GET' queries for starting additional clients on different VT's.
  * 1.9 - Add DRM_IOCTL_RADEON_CP_RESUME ioctl.
  *       Add texture rectangle support for r100.
+ * 1.10- Add SETPARAM ioctl; first parameter to set is FB_LOCATION, which
+ *       clients use to tell the DRM where they think the framebuffer is 
+ *       located in the card's address space
+ * 1.11- Add packet R200_EMIT_RB3D_BLENDCOLOR to support GL_EXT_blend_color
+ *       and GL_EXT_blend_[func|equation]_separate on r200
  */
 #define DRIVER_IOCTLS							     \
  [DRM_IOCTL_NR(DRM_IOCTL_DMA)]               = { radeon_cp_buffers,  1, 0 }, \
@@ -106,10 +111,21 @@
  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_ALLOC)]      = { radeon_mem_alloc,   1, 0 }, \
  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_FREE)]       = { radeon_mem_free,    1, 0 }, \
  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INIT_HEAP)]  = { radeon_mem_init_heap, 1, 1 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_EMIT)]   = { radeon_irq_emit, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_WAIT)]   = { radeon_irq_wait, 1, 0 },
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_EMIT)]   = { radeon_irq_emit,    1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_WAIT)]   = { radeon_irq_wait,    1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_RADEON_SETPARAM)]   = { radeon_cp_setparam, 1, 0 }, \
 
+#define DRIVER_FILE_FIELDS						\
+	int64_t radeon_fb_delta;					\
 
+#define DRIVER_OPEN_HELPER( filp_priv, dev )				\
+do {									\
+	drm_radeon_private_t *dev_priv = dev->dev_private;		\
+	if ( dev_priv )							\
+		filp_priv->radeon_fb_delta = dev_priv->fb_location;	\
+	else								\
+		filp_priv->radeon_fb_delta = 0;				\
+} while( 0 )
 
 /* When a client dies:
  *    - Check for and clean up flipped page state
@@ -142,7 +158,7 @@ do {						\
 /* DMA customization:
  */
 #define __HAVE_DMA		1
-#define __HAVE_DMA_IRQ		1
+#define __HAVE_IRQ		1
 #define __HAVE_VBL_IRQ		1
 #define __HAVE_SHARED_IRQ       1
 
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 3e3618e36..e145c78e7 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -855,7 +855,8 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
 
 	/* Initialize the memory controller */
 	RADEON_WRITE( RADEON_MC_FB_LOCATION,
-		      (dev_priv->gart_vm_start - 1) & 0xffff0000 );
+		      ( ( dev_priv->gart_vm_start - 1 ) & 0xffff0000 )
+		    | ( dev_priv->fb_location >> 16 ) );
 
 #if __REALLY_HAVE_AGP
 	if ( !dev_priv->is_pci ) {
@@ -1071,13 +1072,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
 	dev_priv->depth_offset	= init->depth_offset;
 	dev_priv->depth_pitch	= init->depth_pitch;
 
-	dev_priv->front_pitch_offset = (((dev_priv->front_pitch/64) << 22) |
-					(dev_priv->front_offset >> 10));
-	dev_priv->back_pitch_offset = (((dev_priv->back_pitch/64) << 22) |
-				       (dev_priv->back_offset >> 10));
-	dev_priv->depth_pitch_offset = (((dev_priv->depth_pitch/64) << 22) |
-					(dev_priv->depth_offset >> 10));
-
 	/* Hardware state for depth clears.  Remove this if/when we no
 	 * longer clear the depth buffer with a 3D rectangle.  Hard-code
 	 * all values to prevent unwanted 3D state from slipping through
@@ -1124,13 +1118,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
-	if(!dev_priv->fb) {
-		DRM_ERROR("could not find framebuffer!\n");
-		dev->dev_private = (void *)dev_priv;
-		radeon_do_cleanup_cp(dev);
-		return DRM_ERR(EINVAL);
-	}
 	DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
 	if(!dev_priv->mmio) {
 		DRM_ERROR("could not find mmio region!\n");
@@ -1204,9 +1191,26 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
 			   dev_priv->buffers->handle );
 	}
 
+	dev_priv->fb_location = ( RADEON_READ( RADEON_MC_FB_LOCATION )
+				& 0xffff ) << 16;
+
+	dev_priv->front_pitch_offset = (((dev_priv->front_pitch/64) << 22) |
+					( ( dev_priv->front_offset
+					  + dev_priv->fb_location ) >> 10 ) );
+
+	dev_priv->back_pitch_offset = (((dev_priv->back_pitch/64) << 22) |
+				       ( ( dev_priv->back_offset
+					 + dev_priv->fb_location ) >> 10 ) );
+
+	dev_priv->depth_pitch_offset = (((dev_priv->depth_pitch/64) << 22) |
+					( ( dev_priv->depth_offset
+					  + dev_priv->fb_location ) >> 10 ) );
+
 
 	dev_priv->gart_size = init->gart_size;
-	dev_priv->gart_vm_start = RADEON_READ( RADEON_CONFIG_APER_SIZE );
+	dev_priv->gart_vm_start = dev_priv->fb_location
+				+ RADEON_READ( RADEON_CONFIG_APER_SIZE );
+
 #if __REALLY_HAVE_AGP
 	if ( !dev_priv->is_pci )
 		dev_priv->gart_buffers_offset = (dev_priv->buffers->offset
@@ -1271,12 +1275,12 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
 {
 	DRM_DEBUG( "\n" );
 
-#if _HAVE_DMA_IRQ
+#if __HAVE_IRQ
 	/* Make sure interrupts are disabled here because the uninstall ioctl
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if ( dev->irq ) DRM(irq_uninstall)(dev);
+	if ( dev->irq_enabled ) DRM(irq_uninstall)(dev);
 #endif
 
 	if ( dev->dev_private ) {
diff --git a/drivers/char/drm/radeon_drm.h b/drivers/char/drm/radeon_drm.h
index c4a746490..735e04ef4 100644
--- a/drivers/char/drm/radeon_drm.h
+++ b/drivers/char/drm/radeon_drm.h
@@ -144,7 +144,8 @@
 #define RADEON_EMIT_PP_TEX_SIZE_0                   73
 #define RADEON_EMIT_PP_TEX_SIZE_1                   74
 #define RADEON_EMIT_PP_TEX_SIZE_2                   75
-#define RADEON_MAX_STATE_PACKETS                    76
+#define R200_EMIT_RB3D_BLENDCOLOR                   76
+#define RADEON_MAX_STATE_PACKETS                    77
 
 
 /* Commands understood by cmd_buffer ioctl.  More can be added but
@@ -226,6 +227,13 @@ typedef union {
 #define RADEON_MAX_TEXTURE_LEVELS	12
 #define RADEON_MAX_TEXTURE_UNITS	3
 
+/* Blits have strict offset rules.  All blit offset must be aligned on
+ * a 1K-byte boundary.
+ */
+#define RADEON_OFFSET_SHIFT             10
+#define RADEON_OFFSET_ALIGN             (1 << RADEON_OFFSET_SHIFT)
+#define RADEON_OFFSET_MASK              (RADEON_OFFSET_ALIGN - 1)
+
 #endif /* __RADEON_SAREA_DEFINES__ */
 
 typedef struct {
@@ -365,31 +373,58 @@ typedef struct {
 /* Radeon specific ioctls
  * The device specific ioctl range is 0x40 to 0x79.
  */
-#define DRM_IOCTL_RADEON_CP_INIT    DRM_IOW( 0x40, drm_radeon_init_t)
-#define DRM_IOCTL_RADEON_CP_START   DRM_IO(  0x41)
-#define DRM_IOCTL_RADEON_CP_STOP    DRM_IOW( 0x42, drm_radeon_cp_stop_t)
-#define DRM_IOCTL_RADEON_CP_RESET   DRM_IO(  0x43)
-#define DRM_IOCTL_RADEON_CP_IDLE    DRM_IO(  0x44)
-#define DRM_IOCTL_RADEON_RESET      DRM_IO(  0x45)
-#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( 0x46, drm_radeon_fullscreen_t)
-#define DRM_IOCTL_RADEON_SWAP       DRM_IO(  0x47)
-#define DRM_IOCTL_RADEON_CLEAR      DRM_IOW( 0x48, drm_radeon_clear_t)
-#define DRM_IOCTL_RADEON_VERTEX     DRM_IOW( 0x49, drm_radeon_vertex_t)
-#define DRM_IOCTL_RADEON_INDICES    DRM_IOW( 0x4a, drm_radeon_indices_t)
-#define DRM_IOCTL_RADEON_STIPPLE    DRM_IOW( 0x4c, drm_radeon_stipple_t)
-#define DRM_IOCTL_RADEON_INDIRECT   DRM_IOWR(0x4d, drm_radeon_indirect_t)
-#define DRM_IOCTL_RADEON_TEXTURE    DRM_IOWR(0x4e, drm_radeon_texture_t)
-#define DRM_IOCTL_RADEON_VERTEX2    DRM_IOW( 0x4f, drm_radeon_vertex2_t)
-#define DRM_IOCTL_RADEON_CMDBUF     DRM_IOW( 0x50, drm_radeon_cmd_buffer_t)
-#define DRM_IOCTL_RADEON_GETPARAM   DRM_IOWR(0x51, drm_radeon_getparam_t)
-#define DRM_IOCTL_RADEON_FLIP	    DRM_IO(  0x52)
-#define DRM_IOCTL_RADEON_ALLOC      DRM_IOWR( 0x53, drm_radeon_mem_alloc_t)
-#define DRM_IOCTL_RADEON_FREE       DRM_IOW( 0x54, drm_radeon_mem_free_t)
-#define DRM_IOCTL_RADEON_INIT_HEAP  DRM_IOW( 0x55, drm_radeon_mem_init_heap_t)
-#define DRM_IOCTL_RADEON_IRQ_EMIT   DRM_IOWR( 0x56, drm_radeon_irq_emit_t)
-#define DRM_IOCTL_RADEON_IRQ_WAIT   DRM_IOW( 0x57, drm_radeon_irq_wait_t)
-/* added by Charl P. Botha - see radeon_cp.c for details */
-#define DRM_IOCTL_RADEON_CP_RESUME  DRM_IO(0x58)
+#define DRM_RADEON_CP_INIT    0x00 
+#define DRM_RADEON_CP_START   0x01 
+#define DRM_RADEON_CP_STOP    0x02
+#define DRM_RADEON_CP_RESET   0x03
+#define DRM_RADEON_CP_IDLE    0x04
+#define DRM_RADEON_RESET      0x05 
+#define DRM_RADEON_FULLSCREEN 0x06
+#define DRM_RADEON_SWAP       0x07 
+#define DRM_RADEON_CLEAR      0x08 
+#define DRM_RADEON_VERTEX     0x09
+#define DRM_RADEON_INDICES    0x0A
+#define DRM_RADEON_NOT_USED
+#define DRM_RADEON_STIPPLE    0x0C
+#define DRM_RADEON_INDIRECT   0x0D
+#define DRM_RADEON_TEXTURE    0x0E
+#define DRM_RADEON_VERTEX2    0x0F
+#define DRM_RADEON_CMDBUF     0x10
+#define DRM_RADEON_GETPARAM   0x11
+#define DRM_RADEON_FLIP       0x12
+#define DRM_RADEON_ALLOC      0x13
+#define DRM_RADEON_FREE       0x14
+#define DRM_RADEON_INIT_HEAP  0x15
+#define DRM_RADEON_IRQ_EMIT   0x16
+#define DRM_RADEON_IRQ_WAIT   0x17
+#define DRM_RADEON_CP_RESUME  0x18
+#define DRM_RADEON_SETPARAM   0x19
+
+#define DRM_IOCTL_RADEON_CP_INIT    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
+#define DRM_IOCTL_RADEON_CP_START   DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_START)
+#define DRM_IOCTL_RADEON_CP_STOP    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
+#define DRM_IOCTL_RADEON_CP_RESET   DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
+#define DRM_IOCTL_RADEON_CP_IDLE    DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
+#define DRM_IOCTL_RADEON_RESET      DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_RESET)
+#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
+#define DRM_IOCTL_RADEON_SWAP       DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_SWAP)
+#define DRM_IOCTL_RADEON_CLEAR      DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
+#define DRM_IOCTL_RADEON_VERTEX     DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
+#define DRM_IOCTL_RADEON_INDICES    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
+#define DRM_IOCTL_RADEON_STIPPLE    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
+#define DRM_IOCTL_RADEON_INDIRECT   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
+#define DRM_IOCTL_RADEON_TEXTURE    DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
+#define DRM_IOCTL_RADEON_VERTEX2    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
+#define DRM_IOCTL_RADEON_CMDBUF     DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
+#define DRM_IOCTL_RADEON_GETPARAM   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
+#define DRM_IOCTL_RADEON_FLIP       DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_FLIP)
+#define DRM_IOCTL_RADEON_ALLOC      DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
+#define DRM_IOCTL_RADEON_FREE       DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
+#define DRM_IOCTL_RADEON_INIT_HEAP  DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
+#define DRM_IOCTL_RADEON_IRQ_EMIT   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
+#define DRM_IOCTL_RADEON_IRQ_WAIT   DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
+#define DRM_IOCTL_RADEON_CP_RESUME  DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
+#define DRM_IOCTL_RADEON_SETPARAM   DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
 
 typedef struct drm_radeon_init {
 	enum {
@@ -502,7 +537,7 @@ typedef struct drm_radeon_tex_image {
 } drm_radeon_tex_image_t;
 
 typedef struct drm_radeon_texture {
-	int offset;
+	unsigned int offset;
 	int pitch;
 	int format;
 	int width;			/* Texture image coordinates */
@@ -537,10 +572,11 @@ typedef struct drm_radeon_indirect {
 #define RADEON_PARAM_STATUS_HANDLE         8
 #define RADEON_PARAM_SAREA_HANDLE          9
 #define RADEON_PARAM_GART_TEX_HANDLE       10
+#define RADEON_PARAM_SCRATCH_OFFSET        11
 
 typedef struct drm_radeon_getparam {
 	int param;
-	int *value;
+	void *value;
 } drm_radeon_getparam_t;
 
 /* 1.6: Set up a memory manager for regions of shared memory:
@@ -578,4 +614,16 @@ typedef struct drm_radeon_irq_wait {
 } drm_radeon_irq_wait_t;
 
 
+/* 1.10: Clients tell the DRM where they think the framebuffer is located in
+ * the card's address space, via a new generic ioctl to set parameters
+ */
+
+typedef struct drm_radeon_setparam {
+	unsigned int param;
+	int64_t      value;
+} drm_radeon_setparam_t;
+
+#define RADEON_SETPARAM_FB_LOCATION    1 /* determined framebuffer location */
+
+
 #endif
diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c
index 6152b8a5b..74e32df01 100644
--- a/drivers/char/drm/radeon_drv.c
+++ b/drivers/char/drm/radeon_drv.c
@@ -48,6 +48,7 @@
 #include "drm_fops.h"
 #include "drm_init.h"
 #include "drm_ioctl.h"
+#include "drm_irq.h"
 #include "drm_lock.h"
 #include "drm_memory.h"
 #include "drm_proc.h"
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index fd23aa28e..45eafd056 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -73,6 +73,8 @@ typedef struct drm_radeon_private {
 	drm_radeon_ring_buffer_t ring;
 	drm_radeon_sarea_t *sarea_priv;
 
+	u32 fb_location;
+
 	int gart_size;
 	u32 gart_vm_start;
 	unsigned long gart_buffers_offset;
@@ -133,7 +135,6 @@ typedef struct drm_radeon_private {
 	unsigned long gart_textures_offset;
 
 	drm_local_map_t *sarea;
-	drm_local_map_t *fb;
 	drm_local_map_t *mmio;
 	drm_local_map_t *cp_ring;
 	drm_local_map_t *ring_rptr;
@@ -184,6 +185,7 @@ extern int radeon_cp_indirect( DRM_IOCTL_ARGS );
 extern int radeon_cp_vertex2( DRM_IOCTL_ARGS );
 extern int radeon_cp_cmdbuf( DRM_IOCTL_ARGS );
 extern int radeon_cp_getparam( DRM_IOCTL_ARGS );
+extern int radeon_cp_setparam( DRM_IOCTL_ARGS );
 extern int radeon_cp_flip( DRM_IOCTL_ARGS );
 
 extern int radeon_mem_alloc( DRM_IOCTL_ARGS );
@@ -239,6 +241,7 @@ extern void radeon_do_release(drm_device_t *dev);
 #define RADEON_CRTC2_OFFSET		0x0324
 #define RADEON_CRTC2_OFFSET_CNTL	0x0328
 
+#define RADEON_RB3D_COLOROFFSET		0x1c40
 #define RADEON_RB3D_COLORPITCH		0x1c48
 
 #define RADEON_DP_GUI_MASTER_CNTL	0x146c
@@ -332,6 +335,7 @@ extern void radeon_do_release(drm_device_t *dev);
 #define RADEON_PP_MISC			0x1c14
 #define RADEON_PP_ROT_MATRIX_0		0x1d58
 #define RADEON_PP_TXFILTER_0		0x1c54
+#define RADEON_PP_TXOFFSET_0		0x1c5c
 #define RADEON_PP_TXFILTER_1		0x1c6c
 #define RADEON_PP_TXFILTER_2		0x1c84
 
@@ -686,6 +690,7 @@ extern void radeon_do_release(drm_device_t *dev);
 #define R200_SE_VTX_FMT_1                 0x208c
 #define R200_RE_CNTL                      0x1c50 
 
+#define R200_RB3D_BLENDCOLOR              0x3218
 
 /* Constants */
 #define RADEON_MAX_USEC_TIMEOUT		100000	/* 100 ms */
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
index 1d339f281..f503153a9 100644
--- a/drivers/char/drm/radeon_irq.c
+++ b/drivers/char/drm/radeon_irq.c
@@ -54,7 +54,7 @@
  * tied to dma at all, this is just a hangover from dri prehistory.
  */
 
-irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(irq_handler)( DRM_IRQ_ARGS )
 {
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_radeon_private_t *dev_priv = 
diff --git a/drivers/char/drm/radeon_mem.c b/drivers/char/drm/radeon_mem.c
index 3a3bf011a..83e2f6c04 100644
--- a/drivers/char/drm/radeon_mem.c
+++ b/drivers/char/drm/radeon_mem.c
@@ -137,12 +137,12 @@ static int init_heap(struct mem_block **heap, int start, int size)
 	struct mem_block *blocks = DRM_MALLOC(sizeof(*blocks));
 
 	if (!blocks) 
-		return -ENOMEM;
+		return DRM_ERR(ENOMEM);
 	
 	*heap = DRM_MALLOC(sizeof(**heap));
 	if (!*heap) {
 		DRM_FREE( blocks, sizeof(*blocks) );
-		return -ENOMEM;
+		return DRM_ERR(ENOMEM);
 	}
 
 	blocks->start = start;
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 29038ea00..64143d190 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -35,6 +35,241 @@
 #include "radeon_drv.h"
 
 
+/* ================================================================
+ * Helper functions for client state checking and fixup
+ */
+
+static __inline__ int radeon_check_and_fixup_offset( drm_radeon_private_t *dev_priv,
+						     drm_file_t *filp_priv,
+						     u32 *offset ) {
+	u32 off = *offset;
+
+	if ( off >= dev_priv->fb_location &&
+	     off < ( dev_priv->gart_vm_start + dev_priv->gart_size ) )
+		return 0;
+
+	off += filp_priv->radeon_fb_delta;
+
+	DRM_DEBUG( "offset fixed up to 0x%x\n", off );
+
+	if ( off < dev_priv->fb_location ||
+	     off >= ( dev_priv->gart_vm_start + dev_priv->gart_size ) )
+		return DRM_ERR( EINVAL );
+
+	*offset = off;
+
+	return 0;
+}
+
+static __inline__ int radeon_check_and_fixup_offset_user( drm_radeon_private_t *dev_priv,
+							  drm_file_t *filp_priv,
+							  u32 *offset ) {
+	u32 off;
+
+	DRM_GET_USER_UNCHECKED( off, offset );
+
+	if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &off ) )
+		return DRM_ERR( EINVAL );
+
+	DRM_PUT_USER_UNCHECKED( offset, off );
+
+	return 0;
+}
+
+static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_priv,
+						      drm_file_t *filp_priv,
+						      int id,
+						      u32 *data ) {
+	switch ( id ) {
+
+	case RADEON_EMIT_PP_MISC:
+		if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							 &data[( RADEON_RB3D_DEPTHOFFSET
+								 - RADEON_PP_MISC ) / 4] ) ) {
+			DRM_ERROR( "Invalid depth buffer offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+		break;
+
+	case RADEON_EMIT_PP_CNTL:
+		if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							 &data[( RADEON_RB3D_COLOROFFSET
+								 - RADEON_PP_CNTL ) / 4] ) ) {
+			DRM_ERROR( "Invalid colour buffer offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+		break;
+
+	case R200_EMIT_PP_TXOFFSET_0:
+	case R200_EMIT_PP_TXOFFSET_1:
+	case R200_EMIT_PP_TXOFFSET_2:
+	case R200_EMIT_PP_TXOFFSET_3:
+	case R200_EMIT_PP_TXOFFSET_4:
+	case R200_EMIT_PP_TXOFFSET_5:
+		if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							 &data[0] ) ) {
+			DRM_ERROR( "Invalid R200 texture offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+		break;
+
+	case RADEON_EMIT_PP_TXFILTER_0:
+	case RADEON_EMIT_PP_TXFILTER_1:
+	case RADEON_EMIT_PP_TXFILTER_2:
+		if ( radeon_check_and_fixup_offset_user( dev_priv, filp_priv,
+							 &data[( RADEON_PP_TXOFFSET_0
+								 - RADEON_PP_TXFILTER_0 ) / 4] ) ) {
+			DRM_ERROR( "Invalid R100 texture offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+		break;
+
+	case R200_EMIT_PP_CUBIC_OFFSETS_0:
+	case R200_EMIT_PP_CUBIC_OFFSETS_1:
+	case R200_EMIT_PP_CUBIC_OFFSETS_2:
+	case R200_EMIT_PP_CUBIC_OFFSETS_3:
+	case R200_EMIT_PP_CUBIC_OFFSETS_4:
+	case R200_EMIT_PP_CUBIC_OFFSETS_5: {
+		int i;
+		for ( i = 0; i < 5; i++ ) {
+			if ( radeon_check_and_fixup_offset_user( dev_priv,
+								 filp_priv,
+								 &data[i] ) ) {
+				DRM_ERROR( "Invalid R200 cubic texture offset\n" );
+				return DRM_ERR( EINVAL );
+			}
+		}
+		break;
+	}
+
+	case RADEON_EMIT_RB3D_COLORPITCH:
+	case RADEON_EMIT_RE_LINE_PATTERN:
+	case RADEON_EMIT_SE_LINE_WIDTH:
+	case RADEON_EMIT_PP_LUM_MATRIX:
+	case RADEON_EMIT_PP_ROT_MATRIX_0:
+	case RADEON_EMIT_RB3D_STENCILREFMASK:
+	case RADEON_EMIT_SE_VPORT_XSCALE:
+	case RADEON_EMIT_SE_CNTL:
+	case RADEON_EMIT_SE_CNTL_STATUS:
+	case RADEON_EMIT_RE_MISC:
+	case RADEON_EMIT_PP_BORDER_COLOR_0:
+	case RADEON_EMIT_PP_BORDER_COLOR_1:
+	case RADEON_EMIT_PP_BORDER_COLOR_2:
+	case RADEON_EMIT_SE_ZBIAS_FACTOR:
+	case RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT:
+	case RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED:
+	case R200_EMIT_PP_TXCBLEND_0:
+	case R200_EMIT_PP_TXCBLEND_1:
+	case R200_EMIT_PP_TXCBLEND_2:
+	case R200_EMIT_PP_TXCBLEND_3:
+	case R200_EMIT_PP_TXCBLEND_4:
+	case R200_EMIT_PP_TXCBLEND_5:
+	case R200_EMIT_PP_TXCBLEND_6:
+	case R200_EMIT_PP_TXCBLEND_7:
+	case R200_EMIT_TCL_LIGHT_MODEL_CTL_0:
+	case R200_EMIT_TFACTOR_0:
+	case R200_EMIT_VTX_FMT_0:
+	case R200_EMIT_VAP_CTL:
+	case R200_EMIT_MATRIX_SELECT_0:
+	case R200_EMIT_TEX_PROC_CTL_2:
+	case R200_EMIT_TCL_UCP_VERT_BLEND_CTL:
+	case R200_EMIT_PP_TXFILTER_0:
+	case R200_EMIT_PP_TXFILTER_1:
+	case R200_EMIT_PP_TXFILTER_2:
+	case R200_EMIT_PP_TXFILTER_3:
+	case R200_EMIT_PP_TXFILTER_4:
+	case R200_EMIT_PP_TXFILTER_5:
+	case R200_EMIT_VTE_CNTL:
+	case R200_EMIT_OUTPUT_VTX_COMP_SEL:
+	case R200_EMIT_PP_TAM_DEBUG3:
+	case R200_EMIT_PP_CNTL_X:
+	case R200_EMIT_RB3D_DEPTHXY_OFFSET:
+	case R200_EMIT_RE_AUX_SCISSOR_CNTL:
+	case R200_EMIT_RE_SCISSOR_TL_0:
+	case R200_EMIT_RE_SCISSOR_TL_1:
+	case R200_EMIT_RE_SCISSOR_TL_2:
+	case R200_EMIT_SE_VAP_CNTL_STATUS:
+	case R200_EMIT_SE_VTX_STATE_CNTL:
+	case R200_EMIT_RE_POINTSIZE:
+	case R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0:
+	case R200_EMIT_PP_CUBIC_FACES_0:
+	case R200_EMIT_PP_CUBIC_FACES_1:
+	case R200_EMIT_PP_CUBIC_FACES_2:
+	case R200_EMIT_PP_CUBIC_FACES_3:
+	case R200_EMIT_PP_CUBIC_FACES_4:
+	case R200_EMIT_PP_CUBIC_FACES_5:
+	case RADEON_EMIT_PP_TEX_SIZE_0:
+	case RADEON_EMIT_PP_TEX_SIZE_1:
+	case RADEON_EMIT_PP_TEX_SIZE_2:
+	case R200_EMIT_RB3D_BLENDCOLOR:
+		/* These packets don't contain memory offsets */
+		break;
+
+	default:
+		DRM_ERROR( "Unknown state packet ID %d\n", id );
+		return DRM_ERR( EINVAL );
+	}
+
+	return 0;
+}
+
+static __inline__ int radeon_check_and_fixup_packet3( drm_radeon_private_t *dev_priv,
+						      drm_file_t *filp_priv,
+						      drm_radeon_cmd_buffer_t *cmdbuf,
+						      unsigned int *cmdsz ) {
+	u32 tmp[4], *cmd = ( u32* )cmdbuf->buf;
+
+	if ( DRM_COPY_FROM_USER_UNCHECKED( tmp, cmd, sizeof( tmp ) ) ) {
+		DRM_ERROR( "Failed to copy data from user space\n" );
+		return DRM_ERR( EFAULT );
+	}
+
+	*cmdsz = 2 + ( ( tmp[0] & RADEON_CP_PACKET_COUNT_MASK ) >> 16 );
+
+	if ( ( tmp[0] & 0xc0000000 ) != RADEON_CP_PACKET3 ) {
+		DRM_ERROR( "Not a type 3 packet\n" );
+		return DRM_ERR( EINVAL );
+	}
+
+	if ( 4 * *cmdsz > cmdbuf->bufsz ) {
+		DRM_ERROR( "Packet size larger than size of data provided\n" );
+		return DRM_ERR( EINVAL );
+	}
+
+	/* Check client state and fix it up if necessary */
+	if ( tmp[0] & 0x8000 ) { /* MSB of opcode: next DWORD GUI_CNTL */
+		u32 offset;
+
+		if ( tmp[1] & ( RADEON_GMC_SRC_PITCH_OFFSET_CNTL
+			      | RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) {
+			offset = tmp[2] << 10;
+			if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &offset ) ) {
+				DRM_ERROR( "Invalid first packet offset\n" );
+				return DRM_ERR( EINVAL );
+			}
+			tmp[2] = ( tmp[2] & 0xffc00000 ) | offset >> 10;
+		}
+
+		if ( ( tmp[1] & RADEON_GMC_SRC_PITCH_OFFSET_CNTL ) &&
+		     ( tmp[1] & RADEON_GMC_DST_PITCH_OFFSET_CNTL ) ) {
+			offset = tmp[3] << 10;
+			if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &offset ) ) {
+				DRM_ERROR( "Invalid second packet offset\n" );
+				return DRM_ERR( EINVAL );
+			}
+			tmp[3] = ( tmp[3] & 0xffc00000 ) | offset >> 10;
+		}
+
+		if ( DRM_COPY_TO_USER_UNCHECKED( cmd, tmp, sizeof( tmp ) ) ) {
+			DRM_ERROR( "Failed to copy data to user space\n" );
+			return DRM_ERR( EFAULT );
+		}
+	}
+
+	return 0;
+}
+
+
 /* ================================================================
  * CP hardware state programming functions
  */
@@ -57,15 +292,28 @@ static __inline__ void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
 
 /* Emit 1.1 state
  */
-static void radeon_emit_state( drm_radeon_private_t *dev_priv,
-			       drm_radeon_context_regs_t *ctx,
-			       drm_radeon_texture_regs_t *tex,
-			       unsigned int dirty )
+static int radeon_emit_state( drm_radeon_private_t *dev_priv,
+			      drm_file_t *filp_priv,
+			      drm_radeon_context_regs_t *ctx,
+			      drm_radeon_texture_regs_t *tex,
+			      unsigned int dirty )
 {
 	RING_LOCALS;
 	DRM_DEBUG( "dirty=0x%08x\n", dirty );
 
 	if ( dirty & RADEON_UPLOAD_CONTEXT ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &ctx->rb3d_depthoffset ) ) {
+			DRM_ERROR( "Invalid depth buffer offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &ctx->rb3d_coloroffset ) ) {
+			DRM_ERROR( "Invalid depth buffer offset\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 14 );
 		OUT_RING( CP_PACKET0( RADEON_PP_MISC, 6 ) );
 		OUT_RING( ctx->pp_misc );
@@ -149,6 +397,12 @@ static void radeon_emit_state( drm_radeon_private_t *dev_priv,
 	}
 
 	if ( dirty & RADEON_UPLOAD_TEX0 ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &tex[0].pp_txoffset ) ) {
+			DRM_ERROR( "Invalid texture offset for unit 0\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 9 );
 		OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_0, 5 ) );
 		OUT_RING( tex[0].pp_txfilter );
@@ -163,6 +417,12 @@ static void radeon_emit_state( drm_radeon_private_t *dev_priv,
 	}
 
 	if ( dirty & RADEON_UPLOAD_TEX1 ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &tex[1].pp_txoffset ) ) {
+			DRM_ERROR( "Invalid texture offset for unit 1\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 9 );
 		OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_1, 5 ) );
 		OUT_RING( tex[1].pp_txfilter );
@@ -177,6 +437,12 @@ static void radeon_emit_state( drm_radeon_private_t *dev_priv,
 	}
 
 	if ( dirty & RADEON_UPLOAD_TEX2 ) {
+		if ( radeon_check_and_fixup_offset( dev_priv, filp_priv,
+						    &tex[2].pp_txoffset ) ) {
+			DRM_ERROR( "Invalid texture offset for unit 2\n" );
+			return DRM_ERR( EINVAL );
+		}
+
 		BEGIN_RING( 9 );
 		OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_2, 5 ) );
 		OUT_RING( tex[2].pp_txfilter );
@@ -189,12 +455,15 @@ static void radeon_emit_state( drm_radeon_private_t *dev_priv,
 		OUT_RING( tex[2].pp_border_color );
 		ADVANCE_RING();
 	}
+
+	return 0;
 }
 
 /* Emit 1.2 state
  */
-static void radeon_emit_state2( drm_radeon_private_t *dev_priv,
-				drm_radeon_state_t *state )
+static int radeon_emit_state2( drm_radeon_private_t *dev_priv,
+			       drm_file_t *filp_priv,
+			       drm_radeon_state_t *state )
 {
 	RING_LOCALS;
 
@@ -206,7 +475,7 @@ static void radeon_emit_state2( drm_radeon_private_t *dev_priv,
 		ADVANCE_RING();
 	}
 
-	radeon_emit_state( dev_priv, &state->context, 
+	return radeon_emit_state( dev_priv, filp_priv, &state->context,
 			   state->tex, state->dirty );
 }
 
@@ -295,6 +564,7 @@ static struct {
 	{ RADEON_PP_TEX_SIZE_0, 2, "RADEON_PP_TEX_SIZE_0" },
 	{ RADEON_PP_TEX_SIZE_1, 2, "RADEON_PP_TEX_SIZE_1" },
 	{ RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_1" },
+	{ R200_RB3D_BLENDCOLOR, 3, "R200_RB3D_BLENDCOLOR" },
 };
 
 
@@ -1065,6 +1335,7 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
 				       drm_radeon_tex_image_t *image )
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_buf_t *buf;
 	u32 format;
 	u32 *buffer;
@@ -1074,6 +1345,13 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
 	int i;
 	RING_LOCALS;
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
+	if ( radeon_check_and_fixup_offset( dev_priv, filp_priv, &tex->offset ) ) {
+		DRM_ERROR( "Invalid destination offset\n" );
+		return DRM_ERR( EINVAL );
+	}
+
 	dev_priv->stats.boxes |= RADEON_BOX_TEXTURE_LOAD;
 
 	/* Flush the pixel cache.  This ensures no pixel data gets mixed
@@ -1377,6 +1655,7 @@ int radeon_cp_vertex( DRM_IOCTL_ARGS )
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf;
@@ -1390,6 +1669,8 @@ int radeon_cp_vertex( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex_t *)data,
 			     sizeof(vertex) );
 
@@ -1429,11 +1710,14 @@ int radeon_cp_vertex( DRM_IOCTL_ARGS )
 		buf->used = vertex.count; /* not used? */
 
 		if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
-			radeon_emit_state( dev_priv,
-					   &sarea_priv->context_state,
-					   sarea_priv->tex_state,
-					   sarea_priv->dirty );
-			
+			if ( radeon_emit_state( dev_priv, filp_priv,
+						&sarea_priv->context_state,
+						sarea_priv->tex_state,
+						sarea_priv->dirty ) ) {
+				DRM_ERROR( "radeon_emit_state failed\n" );
+				return DRM_ERR( EINVAL );
+			}
+
 			sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
 					       RADEON_UPLOAD_TEX1IMAGES |
 					       RADEON_UPLOAD_TEX2IMAGES |
@@ -1461,6 +1745,7 @@ int radeon_cp_indices( DRM_IOCTL_ARGS )
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf;
@@ -1475,6 +1760,8 @@ int radeon_cp_indices( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( elts, (drm_radeon_indices_t *)data,
 			     sizeof(elts) );
 
@@ -1523,10 +1810,13 @@ int radeon_cp_indices( DRM_IOCTL_ARGS )
 	buf->used = elts.end;
 
 	if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
-		radeon_emit_state( dev_priv,
-				   &sarea_priv->context_state,
-				   sarea_priv->tex_state,
-				   sarea_priv->dirty );
+		if ( radeon_emit_state( dev_priv, filp_priv,
+					&sarea_priv->context_state,
+					sarea_priv->tex_state,
+					sarea_priv->dirty ) ) {
+			DRM_ERROR( "radeon_emit_state failed\n" );
+			return DRM_ERR( EINVAL );
+		}
 
 		sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
 				       RADEON_UPLOAD_TEX1IMAGES |
@@ -1686,6 +1976,7 @@ int radeon_cp_vertex2( DRM_IOCTL_ARGS )
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf;
@@ -1700,6 +1991,8 @@ int radeon_cp_vertex2( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex2_t *)data,
 			     sizeof(vertex) );
 
@@ -1747,7 +2040,10 @@ int radeon_cp_vertex2( DRM_IOCTL_ARGS )
 					     sizeof(state) ) )
 				return DRM_ERR(EFAULT);
 
-			radeon_emit_state2( dev_priv, &state );
+			if ( radeon_emit_state2( dev_priv, filp_priv, &state ) ) {
+				DRM_ERROR( "radeon_emit_state2 failed\n" );
+				return DRM_ERR( EINVAL );
+			}
 
 			laststate = prim.stateidx;
 		}
@@ -1784,6 +2080,7 @@ int radeon_cp_vertex2( DRM_IOCTL_ARGS )
 
 static int radeon_emit_packets( 
 	drm_radeon_private_t *dev_priv,
+	drm_file_t *filp_priv,
 	drm_radeon_cmd_header_t header,
 	drm_radeon_cmd_buffer_t *cmdbuf )
 {
@@ -1798,8 +2095,15 @@ static int radeon_emit_packets(
 	sz = packet[id].len;
 	reg = packet[id].start;
 
-	if (sz * sizeof(int) > cmdbuf->bufsz) 
+	if (sz * sizeof(int) > cmdbuf->bufsz) {
+		DRM_ERROR( "Packet size provided larger than data provided\n" );
 		return DRM_ERR(EINVAL);
+	}
+
+	if ( radeon_check_and_fixup_packets( dev_priv, filp_priv, id, data ) ) {
+		DRM_ERROR( "Packet verification failed\n" );
+		return DRM_ERR( EINVAL );
+	}
 
 	BEGIN_RING(sz+1);
 	OUT_RING( CP_PACKET0( reg, (sz-1) ) );
@@ -1882,24 +2186,21 @@ static __inline__ int radeon_emit_vectors(
 
 
 static int radeon_emit_packet3( drm_device_t *dev,
+				drm_file_t *filp_priv,
 				drm_radeon_cmd_buffer_t *cmdbuf )
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
-	int cmdsz, tmp;
-	int *cmd = (int *)cmdbuf->buf;
+	unsigned int cmdsz;
+	int *cmd = (int *)cmdbuf->buf, ret;
 	RING_LOCALS;
 
-
 	DRM_DEBUG("\n");
 
-	if (DRM_GET_USER_UNCHECKED( tmp, &cmd[0]))
-		return DRM_ERR(EFAULT);
-
-	cmdsz = 2 + ((tmp & RADEON_CP_PACKET_COUNT_MASK) >> 16);
-
-	if ((tmp & 0xc0000000) != RADEON_CP_PACKET3 ||
-	    cmdsz * 4 > cmdbuf->bufsz)
-		return DRM_ERR(EINVAL);
+	if ( ( ret = radeon_check_and_fixup_packet3( dev_priv, filp_priv,
+						     cmdbuf, &cmdsz ) ) ) {
+		DRM_ERROR( "Packet verification failed\n" );
+		return ret;
+	}
 
 	BEGIN_RING( cmdsz );
 	OUT_RING_USER_TABLE( cmd, cmdsz );
@@ -1912,27 +2213,25 @@ static int radeon_emit_packet3( drm_device_t *dev,
 
 
 static int radeon_emit_packet3_cliprect( drm_device_t *dev,
+					 drm_file_t *filp_priv,
 					 drm_radeon_cmd_buffer_t *cmdbuf,
 					 int orig_nbox )
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 	drm_clip_rect_t box;
-	int cmdsz, tmp;
-	int *cmd = (int *)cmdbuf->buf;
+	unsigned int cmdsz;
+	int *cmd = (int *)cmdbuf->buf, ret;
 	drm_clip_rect_t *boxes = cmdbuf->boxes;
 	int i = 0;
 	RING_LOCALS;
 
 	DRM_DEBUG("\n");
 
-	if (DRM_GET_USER_UNCHECKED( tmp, &cmd[0]))
-		return DRM_ERR(EFAULT);
-
-	cmdsz = 2 + ((tmp & RADEON_CP_PACKET_COUNT_MASK) >> 16);
-
-	if ((tmp & 0xc0000000) != RADEON_CP_PACKET3 ||
-	    cmdsz * 4 > cmdbuf->bufsz)
-		return DRM_ERR(EINVAL);
+	if ( ( ret = radeon_check_and_fixup_packet3( dev_priv, filp_priv,
+						     cmdbuf, &cmdsz ) ) ) {
+		DRM_ERROR( "Packet verification failed\n" );
+		return ret;
+	}
 
 	if (!orig_nbox)
 		goto out;
@@ -2009,6 +2308,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 {
 	DRM_DEVICE;
 	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_t *buf = 0;
 	int idx;
@@ -2023,6 +2323,8 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
 	DRM_COPY_FROM_USER_IOCTL( cmdbuf, (drm_radeon_cmd_buffer_t *)data,
 			     sizeof(cmdbuf) );
 
@@ -2053,7 +2355,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 		switch (header.header.cmd_type) {
 		case RADEON_CMD_PACKET: 
 			DRM_DEBUG("RADEON_CMD_PACKET\n");
-			if (radeon_emit_packets( dev_priv, header, &cmdbuf )) {
+			if (radeon_emit_packets( dev_priv, filp_priv, header, &cmdbuf )) {
 				DRM_ERROR("radeon_emit_packets failed\n");
 				return DRM_ERR(EINVAL);
 			}
@@ -2096,7 +2398,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 
 		case RADEON_CMD_PACKET3:
 			DRM_DEBUG("RADEON_CMD_PACKET3\n");
-			if (radeon_emit_packet3( dev, &cmdbuf )) {
+			if (radeon_emit_packet3( dev, filp_priv, &cmdbuf )) {
 				DRM_ERROR("radeon_emit_packet3 failed\n");
 				return DRM_ERR(EINVAL);
 			}
@@ -2104,7 +2406,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 
 		case RADEON_CMD_PACKET3_CLIP:
 			DRM_DEBUG("RADEON_CMD_PACKET3_CLIP\n");
-			if (radeon_emit_packet3_cliprect( dev, &cmdbuf, orig_nbox )) {
+			if (radeon_emit_packet3_cliprect( dev, filp_priv, &cmdbuf, orig_nbox )) {
 				DRM_ERROR("radeon_emit_packet3_clip failed\n");
 				return DRM_ERR(EINVAL);
 			}
@@ -2214,3 +2516,31 @@ int radeon_cp_getparam( DRM_IOCTL_ARGS )
 	
 	return 0;
 }
+
+int radeon_cp_setparam( DRM_IOCTL_ARGS ) {
+	DRM_DEVICE;
+	drm_radeon_private_t *dev_priv = dev->dev_private;
+	drm_file_t *filp_priv;
+	drm_radeon_setparam_t sp;
+
+	if ( !dev_priv ) {
+		DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+		return DRM_ERR( EINVAL );
+	}
+
+	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
+
+	DRM_COPY_FROM_USER_IOCTL( sp, ( drm_radeon_setparam_t* )data,
+				  sizeof( sp ) );
+
+	switch( sp.param ) {
+	case RADEON_SETPARAM_FB_LOCATION:
+		filp_priv->radeon_fb_delta = dev_priv->fb_location - sp.value;
+		break;
+	default:
+		DRM_DEBUG( "Invalid parameter %d\n", sp.param );
+		return DRM_ERR( EINVAL );
+	}
+
+	return 0;
+}
diff --git a/drivers/char/drm/tdfx.h b/drivers/char/drm/tdfx.h
index 40aba8fb2..6b067db78 100644
--- a/drivers/char/drm/tdfx.h
+++ b/drivers/char/drm/tdfx.h
@@ -39,4 +39,14 @@
 #define __HAVE_MTRR		1
 #define __HAVE_CTX_BITMAP	1
 
+#define DRIVER_AUTHOR		"VA Linux Systems Inc."
+
+#define DRIVER_NAME		"tdfx"
+#define DRIVER_DESC		"3dfx Banshee/Voodoo3+"
+#define DRIVER_DATE		"20010216"
+
+#define DRIVER_MAJOR		1
+#define DRIVER_MINOR		0
+#define DRIVER_PATCHLEVEL	0
+
 #endif
diff --git a/drivers/char/drm/tdfx_drv.c b/drivers/char/drm/tdfx_drv.c
index 8b7901889..fafa1f922 100644
--- a/drivers/char/drm/tdfx_drv.c
+++ b/drivers/char/drm/tdfx_drv.c
@@ -34,47 +34,6 @@
 #include "tdfx.h"
 #include "drmP.h"
 
-#define DRIVER_AUTHOR		"VA Linux Systems Inc."
-
-#define DRIVER_NAME		"tdfx"
-#define DRIVER_DESC		"3dfx Banshee/Voodoo3+"
-#define DRIVER_DATE		"20010216"
-
-#define DRIVER_MAJOR		1
-#define DRIVER_MINOR		0
-#define DRIVER_PATCHLEVEL	0
-
-#ifndef PCI_VENDOR_ID_3DFX
-#define PCI_VENDOR_ID_3DFX 0x121A
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO5
-#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO4
-#define PCI_DEVICE_ID_3DFX_VOODOO4 0x0007
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO3_3000 /* Voodoo3 3000 */
-#define PCI_DEVICE_ID_3DFX_VOODOO3_3000 0x0005
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_VOODOO3_2000 /* Voodoo3 3000 */
-#define PCI_DEVICE_ID_3DFX_VOODOO3_2000 0x0004
-#endif
-#ifndef PCI_DEVICE_ID_3DFX_BANSHEE
-#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003
-#endif
-
-static drm_pci_list_t DRM(idlist)[] = {
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_2000 },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_3000 },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO4 },
-	{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5 },
-	{ 0, 0 }
-};
-
-#define DRIVER_CARD_LIST DRM(idlist)
-
-
 #include "drm_auth.h"
 #include "drm_bufs.h"
 #include "drm_context.h"
diff --git a/drivers/char/hw_random.c b/drivers/char/hw_random.c
index 87da25c19..090ce07a1 100644
--- a/drivers/char/hw_random.c
+++ b/drivers/char/hw_random.c
@@ -79,7 +79,7 @@
 #define RNG_MISCDEV_MINOR		183 /* official */
 
 static int rng_dev_open (struct inode *inode, struct file *filp);
-static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size,
+static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
 			     loff_t * offp);
 
 static int __init intel_init (struct pci_dev *dev);
@@ -482,7 +482,7 @@ static int rng_dev_open (struct inode *inode, struct file *filp)
 }
 
 
-static ssize_t rng_dev_read (struct file *filp, char *buf, size_t size,
+static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
 			     loff_t * offp)
 {
 	static spinlock_t rng_lock = SPIN_LOCK_UNLOCKED;
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 577950510..ad4a96704 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -79,7 +79,7 @@ MODULE_PARM_DESC(force, "Force loading without checking for supported models");
 MODULE_PARM_DESC(restricted, "Allow fan control if SYS_ADMIN capability set");
 MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
 
-static ssize_t i8k_read(struct file *, char *, size_t, loff_t *);
+static ssize_t i8k_read(struct file *, char __user *, size_t, loff_t *);
 static int i8k_ioctl(struct inode *, struct file *, unsigned int,
 		     unsigned long);
 
@@ -330,10 +330,10 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
     int val;
     int speed;
     unsigned char buff[16];
+    int __user *argp = (int __user *)arg;
 
-    if (!arg) {
+    if (!argp)
 	return -EINVAL;
-    }
 
     switch (cmd) {
     case I8K_BIOS_VERSION:
@@ -358,14 +358,14 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 	break;
 
     case I8K_GET_SPEED:
-	if (copy_from_user(&val, (int *)arg, sizeof(int))) {
+	if (copy_from_user(&val, argp, sizeof(int))) {
 	    return -EFAULT;
 	}
 	val = i8k_get_fan_speed(val);
 	break;
 
     case I8K_GET_FAN:
-	if (copy_from_user(&val, (int *)arg, sizeof(int))) {
+	if (copy_from_user(&val, argp, sizeof(int))) {
 	    return -EFAULT;
 	}
 	val = i8k_get_fan_status(val);
@@ -375,10 +375,10 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 	if (restricted && !capable(CAP_SYS_ADMIN)) {
 	    return -EPERM;
 	}
-	if (copy_from_user(&val, (int *)arg, sizeof(int))) {
+	if (copy_from_user(&val, argp, sizeof(int))) {
 	    return -EFAULT;
 	}
-	if (copy_from_user(&speed, (int *)arg+1, sizeof(int))) {
+	if (copy_from_user(&speed, argp+1, sizeof(int))) {
 	    return -EFAULT;
 	}
 	val = i8k_set_fan(val, speed);
@@ -394,17 +394,17 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 
     switch (cmd) {
     case I8K_BIOS_VERSION:
-	if (copy_to_user((int *)arg, &val, 4)) {
+	if (copy_to_user(argp, &val, 4)) {
 	    return -EFAULT;
 	}
 	break;
     case I8K_MACHINE_ID:
-	if (copy_to_user((int *)arg, buff, 16)) {
+	if (copy_to_user(argp, buff, 16)) {
 	    return -EFAULT;
 	}
 	break;
     default:
-	if (copy_to_user((int *)arg, &val, sizeof(int))) {
+	if (copy_to_user(argp, &val, sizeof(int))) {
 	    return -EFAULT;
 	}
 	break;
@@ -462,7 +462,7 @@ static int i8k_get_info(char *buffer, char **start, off_t fpos, int length)
     return n;
 }
 
-static ssize_t i8k_read(struct file *f, char *buffer, size_t len, loff_t *fpos)
+static ssize_t i8k_read(struct file *f, char __user *buffer, size_t len, loff_t *fpos)
 {
     int n;
     char info[128];
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index 043cff46f..d5c18535b 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -99,6 +99,7 @@
 #include <linux/slab.h>
 #include <linux/major.h>
 #include <linux/wait.h>
+#include <linux/device.h>
 
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
@@ -301,6 +302,9 @@ static int iindx;
 static char rirqs[IP2_MAX_BOARDS];
 static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0};
 
+/* for sysfs class support */
+static struct class_simple *ip2_class;
+
 // Some functions to keep track of what irq's we have
 
 static int __init
@@ -411,7 +415,9 @@ cleanup_module(void)
 			iiResetDelay( i2BoardPtrTable[i] );
 			/* free io addresses and Tibet */
 			release_region( ip2config.addr[i], 8 );
+			class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i)); 
 			devfs_remove("ip2/ipl%d", i);
+			class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
 			devfs_remove("ip2/stat%d", i);
 		}
 		/* Disable and remove interrupt handler. */
@@ -420,6 +426,7 @@ cleanup_module(void)
 			clear_requested_irq( ip2config.irq[i]);
 		}
 	}
+	class_simple_destroy(ip2_class);
 	devfs_remove("ip2");
 	if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) {
 		printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
@@ -494,7 +501,7 @@ int
 ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) 
 {
 	int i, j, box;
-	int err;
+	int err = 0;
 	int status = 0;
 	static int loaded;
 	i2eBordStrPtr pB = NULL;
@@ -683,7 +690,14 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
 	/* Register the IPL driver. */
 	if ( ( err = register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl ) ) ) {
 		printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err );
-	} else
+	} else {
+		/* create the sysfs class */
+		ip2_class = class_simple_create(THIS_MODULE, "ip2");
+		if (IS_ERR(ip2_class)) {
+			err = PTR_ERR(ip2_class);
+			goto out_chrdev;	
+		}
+	}
 	/* Register the read_procmem thing */
 	if (!create_proc_info_entry("ip2mem",0,&proc_root,ip2_read_procmem)) {
 		printk(KERN_ERR "IP2: failed to register read_procmem\n");
@@ -700,13 +714,27 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
 			}
 
 			if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
-				devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
+				class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, 
+						4 * i), NULL, "ipl%d", i);
+				err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
 						S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
 						"ip2/ipl%d", i);
+				if (err) {
+					class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 
+						4 * i));
+					goto out_class;
+				}
 
-				devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
+				class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, 
+						4 * i + 1), NULL, "stat%d", i);
+				err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
 						S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
 						"ip2/stat%d", i);
+				if (err) {
+					class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 
+						4 * i + 1));
+					goto out_class;
+				}
 
 			    for ( box = 0; box < ABS_MAX_BOXES; ++box )
 			    {
@@ -759,8 +787,14 @@ retry:
 		}
 	}
 	ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_RETURN, 0 );
-
-	return 0;
+	goto out;
+
+out_class:
+	class_simple_destroy(ip2_class);
+out_chrdev:
+	unregister_chrdev(IP2_IPL_MAJOR, "ip2");
+out:
+	return err;
 }
 
 EXPORT_SYMBOL(ip2_loadmain);
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c
index 622456a52..6fc7077d9 100644
--- a/drivers/char/ipmi/ipmi_bt_sm.c
+++ b/drivers/char/ipmi/ipmi_bt_sm.c
@@ -445,7 +445,7 @@ static enum si_sm_result bt_event(struct si_sm_data *bt, long time)
 
 	case BT_STATE_RESET1:
     		reset_flags(bt);
-    		bt->timeout = BT_RESET_DELAY;;
+    		bt->timeout = BT_RESET_DELAY;
 		bt->state = BT_STATE_RESET2;
 		break;
 
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index c1e4abf14..aa0fe2dbf 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -123,6 +123,12 @@ struct ipmi_channel
 	unsigned char protocol;
 };
 
+struct ipmi_proc_entry
+{
+	char                   *name;
+	struct ipmi_proc_entry *next;
+};
+
 #define IPMI_IPMB_NUM_SEQ	64
 #define IPMI_MAX_CHANNELS       8
 struct ipmi_smi
@@ -149,6 +155,11 @@ struct ipmi_smi
 	struct ipmi_smi_handlers *handlers;
 	void                     *send_info;
 
+	/* A list of proc entries for this interface.  This does not
+	   need a lock, only one thread creates it and only one thread
+	   destroys it. */
+	struct ipmi_proc_entry *proc_entries;
+
 	/* A table of sequence numbers for this interface.  We use the
            sequence numbers for IPMB messages that go out of the
            interface to match them up with their responses.  A routine
@@ -1515,18 +1526,36 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
 			    read_proc_t *read_proc, write_proc_t *write_proc,
 			    void *data, struct module *owner)
 {
-	struct proc_dir_entry *file;
-	int                   rv = 0;
+	struct proc_dir_entry  *file;
+	int                    rv = 0;
+	struct ipmi_proc_entry *entry;
+
+	/* Create a list element. */
+	entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+	if (!entry)
+		return -ENOMEM;
+	entry->name = kmalloc(strlen(name)+1, GFP_KERNEL);
+	if (!entry->name) {
+		kfree(entry);
+		return -ENOMEM;
+	}
+	strcpy(entry->name, name);
 
 	file = create_proc_entry(name, 0, smi->proc_dir);
-	if (!file)
+	if (!file) {
+		kfree(entry->name);
+		kfree(entry);
 		rv = -ENOMEM;
-	else {
+	} else {
 		file->nlink = 1;
 		file->data = data;
 		file->read_proc = read_proc;
 		file->write_proc = write_proc;
 		file->owner = owner;
+
+		/* Stick it on the list. */
+		entry->next = smi->proc_entries;
+		smi->proc_entries = entry;
 	}
 
 	return rv;
@@ -1562,6 +1591,21 @@ static int add_proc_entries(ipmi_smi_t smi, int num)
 	return rv;
 }
 
+static void remove_proc_entries(ipmi_smi_t smi)
+{
+	struct ipmi_proc_entry *entry;
+
+	while (smi->proc_entries) {
+		entry = smi->proc_entries;
+		smi->proc_entries = entry->next;
+
+		remove_proc_entry(entry->name, smi->proc_dir);
+		kfree(entry->name);
+		kfree(entry);
+	}
+	remove_proc_entry(smi->proc_dir_name, proc_ipmi_root);
+}
+
 static int
 send_channel_info_cmd(ipmi_smi_t intf, int chan)
 {
@@ -1749,8 +1793,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
 
 	if (rv) {
 		if (new_intf->proc_dir)
-			remove_proc_entry(new_intf->proc_dir_name,
-					  proc_ipmi_root);
+			remove_proc_entries(new_intf);
 		kfree(new_intf);
 	}
 
@@ -1806,8 +1849,7 @@ int ipmi_unregister_smi(ipmi_smi_t intf)
 	{
 		for (i=0; i<MAX_IPMI_INTERFACES; i++) {
 			if (ipmi_interfaces[i] == intf) {
-				remove_proc_entry(intf->proc_dir_name,
-						  proc_ipmi_root);
+				remove_proc_entries(intf);
 				spin_lock_irqsave(&interfaces_lock, flags);
 				ipmi_interfaces[i] = NULL;
 				clean_up_interface_data(intf);
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 34ceaeed6..8a1fd40d5 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -905,10 +905,10 @@ MODULE_PARM_DESC(irqs, "Sets the interrupt of each interface, the"
 		 " has an interrupt.  Otherwise, set it to zero or leave"
 		 " it blank.");
 
-
-#if defined(CONFIG_ACPI_INTERPETER) || defined(CONFIG_X86) || defined(CONFIG_PCI)
 #define IPMI_MEM_ADDR_SPACE 1
 #define IPMI_IO_ADDR_SPACE  2
+
+#if defined(CONFIG_ACPI_INTERPETER) || defined(CONFIG_X86) || defined(CONFIG_PCI)
 static int is_new_interface(int intf, u8 addr_space, unsigned long base_addr)
 {
 	int i;
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index c1437fb24..6110dbf40 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -291,7 +291,7 @@ static int lp_wait_ready(int minor, int nonblock)
 	return error;
 }
 
-static ssize_t lp_write(struct file * file, const char * buf,
+static ssize_t lp_write(struct file * file, const char __user * buf,
 		        size_t count, loff_t *ppos)
 {
 	unsigned int minor = iminor(file->f_dentry->d_inode);
@@ -407,7 +407,7 @@ static ssize_t lp_write(struct file * file, const char * buf,
 #ifdef CONFIG_PARPORT_1284
 
 /* Status readback conforming to ieee1284 */
-static ssize_t lp_read(struct file * file, char * buf,
+static ssize_t lp_read(struct file * file, char __user * buf,
 		       size_t count, loff_t *ppos)
 {
 	unsigned int minor=iminor(file->f_dentry->d_inode);
@@ -560,6 +560,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
 	unsigned int minor = iminor(inode);
 	int status;
 	int retval = 0;
+	void __user *argp = (void __user *)arg;
 
 #ifdef LP_DEBUG
 	printk(KERN_DEBUG "lp%d ioctl, cmd: 0x%x, arg: 0x%lx\n", minor, cmd, arg);
@@ -603,7 +604,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
 			return -EINVAL;
 			break;
 		case LPGETIRQ:
-			if (copy_to_user((int *) arg, &LP_IRQ(minor),
+			if (copy_to_user(argp, &LP_IRQ(minor),
 					sizeof(int)))
 				return -EFAULT;
 			break;
@@ -612,7 +613,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
 			status = r_str(minor);
 			lp_release_parport (&lp_table[minor]);
 
-			if (copy_to_user((int *) arg, &status, sizeof(int)))
+			if (copy_to_user(argp, &status, sizeof(int)))
 				return -EFAULT;
 			break;
 		case LPRESET:
@@ -620,7 +621,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
 			break;
 #ifdef LP_STATS
 		case LPGETSTATS:
-			if (copy_to_user((int *) arg, &LP_STAT(minor),
+			if (copy_to_user(argp, &LP_STAT(minor),
 					sizeof(struct lp_stats)))
 				return -EFAULT;
 			if (capable(CAP_SYS_ADMIN))
@@ -630,13 +631,12 @@ static int lp_ioctl(struct inode *inode, struct file *file,
 #endif
  		case LPGETFLAGS:
  			status = LP_F(minor);
-			if (copy_to_user((int *) arg, &status, sizeof(int)))
+			if (copy_to_user(argp, &status, sizeof(int)))
 				return -EFAULT;
 			break;
 
 		case LPSETTIMEOUT:
-			if (copy_from_user (&par_timeout,
-					    (struct timeval *) arg,
+			if (copy_from_user (&par_timeout, argp,
 					    sizeof (struct timeval))) {
 				return -EFAULT;
 			}
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 477c63d6b..50a32d17e 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -62,6 +62,19 @@ static inline int uncached_access(struct file *file, unsigned long addr)
 		  test_bit(X86_FEATURE_CYRIX_ARR, boot_cpu_data.x86_capability) ||
 		  test_bit(X86_FEATURE_CENTAUR_MCR, boot_cpu_data.x86_capability) )
 	  && addr >= __pa(high_memory);
+#elif defined(__x86_64__)
+	/* 
+	 * This is broken because it can generate memory type aliases,
+	 * which can cause cache corruptions
+	 * But it is only available for root and we have to be bug-to-bug
+	 * compatible with i386.
+	 */
+	if (file->f_flags & O_SYNC)
+		return 1;
+	/* same behaviour as i386. PAT always set to cached and MTRRs control the
+	   caching behaviour. 
+	   Hopefully a full PAT implementation will fix that soon. */	   
+	return 0;
 #elif defined(CONFIG_IA64)
 	/*
 	 * On ia64, we ignore O_SYNC because we cannot tolerate memory attribute aliases.
@@ -103,7 +116,7 @@ static inline int valid_phys_addr_range(unsigned long addr, size_t *count)
 #endif
 
 static ssize_t do_write_mem(void *p, unsigned long realp,
-			    const char * buf, size_t count, loff_t *ppos)
+			    const char __user * buf, size_t count, loff_t *ppos)
 {
 	ssize_t written;
 	unsigned long copied;
@@ -139,7 +152,7 @@ static ssize_t do_write_mem(void *p, unsigned long realp,
  * This funcion reads the *physical* memory. The f_pos points directly to the 
  * memory location. 
  */
-static ssize_t read_mem(struct file * file, char * buf,
+static ssize_t read_mem(struct file * file, char __user * buf,
 			size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
@@ -171,7 +184,7 @@ static ssize_t read_mem(struct file * file, char * buf,
 	return read;
 }
 
-static ssize_t write_mem(struct file * file, const char * buf, 
+static ssize_t write_mem(struct file * file, const char __user * buf, 
 			 size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
@@ -213,7 +226,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);
 /*
  * This function reads the *virtual* memory as seen by the kernel.
  */
-static ssize_t read_kmem(struct file *file, char *buf, 
+static ssize_t read_kmem(struct file *file, char __user *buf, 
 			 size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
@@ -276,7 +289,7 @@ static ssize_t read_kmem(struct file *file, char *buf,
 /*
  * This function writes to the *virtual* memory as seen by the kernel.
  */
-static ssize_t write_kmem(struct file * file, const char * buf, 
+static ssize_t write_kmem(struct file * file, const char __user * buf, 
 			  size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
@@ -333,11 +346,11 @@ static ssize_t write_kmem(struct file * file, const char * buf,
 }
 
 #if defined(CONFIG_ISA) || !defined(__mc68000__)
-static ssize_t read_port(struct file * file, char * buf,
+static ssize_t read_port(struct file * file, char __user * buf,
 			 size_t count, loff_t *ppos)
 {
 	unsigned long i = *ppos;
-	char *tmp = buf;
+	char __user *tmp = buf;
 
 	if (verify_area(VERIFY_WRITE,buf,count))
 		return -EFAULT; 
@@ -351,11 +364,11 @@ static ssize_t read_port(struct file * file, char * buf,
 	return tmp-buf;
 }
 
-static ssize_t write_port(struct file * file, const char * buf,
+static ssize_t write_port(struct file * file, const char __user * buf,
 			  size_t count, loff_t *ppos)
 {
 	unsigned long i = *ppos;
-	const char * tmp = buf;
+	const char __user * tmp = buf;
 
 	if (verify_area(VERIFY_READ,buf,count))
 		return -EFAULT;
@@ -372,13 +385,13 @@ static ssize_t write_port(struct file * file, const char * buf,
 }
 #endif
 
-static ssize_t read_null(struct file * file, char * buf,
+static ssize_t read_null(struct file * file, char __user * buf,
 			 size_t count, loff_t *ppos)
 {
 	return 0;
 }
 
-static ssize_t write_null(struct file * file, const char * buf,
+static ssize_t write_null(struct file * file, const char __user * buf,
 			  size_t count, loff_t *ppos)
 {
 	return count;
@@ -388,7 +401,7 @@ static ssize_t write_null(struct file * file, const char * buf,
 /*
  * For fun, we are using the MMU for this.
  */
-static inline size_t read_zero_pagealigned(char * buf, size_t size)
+static inline size_t read_zero_pagealigned(char __user * buf, size_t size)
 {
 	struct mm_struct *mm;
 	struct vm_area_struct * vma;
@@ -438,7 +451,7 @@ out_up:
 	return size;
 }
 
-static ssize_t read_zero(struct file * file, char * buf, 
+static ssize_t read_zero(struct file * file, char __user * buf, 
 			 size_t count, loff_t *ppos)
 {
 	unsigned long left, unwritten, written = 0;
@@ -510,7 +523,7 @@ static int mmap_zero(struct file * file, struct vm_area_struct * vma)
 }
 #endif /* CONFIG_MMU */
 
-static ssize_t write_full(struct file * file, const char * buf,
+static ssize_t write_full(struct file * file, const char __user * buf,
 			  size_t count, loff_t *ppos)
 {
 	return -ENOSPC;
@@ -615,7 +628,7 @@ static struct file_operations full_fops = {
 	.write		= write_full,
 };
 
-static ssize_t kmsg_write(struct file * file, const char * buf,
+static ssize_t kmsg_write(struct file * file, const char __user * buf,
 			  size_t count, loff_t *ppos)
 {
 	char *tmp;
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index 1a332b2f8..f2365385c 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -466,6 +466,7 @@ static struct file_operations mwave_fops = {
 
 static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops };
 
+#if 0 /* totally b0rked */
 /*
  * sysfs support <paulsch@us.ibm.com>
  */
@@ -499,6 +500,7 @@ static struct device_attribute * const mwave_dev_attrs[] = {
 	&dev_attr_uart_irq,
 	&dev_attr_uart_io,
 };
+#endif
 
 /*
 * mwave_init is called on module load
@@ -508,11 +510,11 @@ static struct device_attribute * const mwave_dev_attrs[] = {
 */
 static void mwave_exit(void)
 {
-	int i;
 	pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
 
 	PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit entry\n");
 
+#if 0
 	for (i = 0; i < pDrvData->nr_registered_attrs; i++)
 		device_remove_file(&mwave_device, mwave_dev_attrs[i]);
 	pDrvData->nr_registered_attrs = 0;
@@ -521,6 +523,7 @@ static void mwave_exit(void)
 		device_unregister(&mwave_device);
 		pDrvData->device_registered = FALSE;
 	}
+#endif
 
 	if ( pDrvData->sLine >= 0 ) {
 		unregister_serial(pDrvData->sLine);
@@ -638,6 +641,7 @@ static int __init mwave_init(void)
 	}
 	/* uart is registered */
 
+#if 0
 	/* sysfs */
 	memset(&mwave_device, 0, sizeof (struct device));
 	snprintf(mwave_device.bus_id, BUS_ID_SIZE, "mwave");
@@ -655,6 +659,7 @@ static int __init mwave_init(void)
 		}
 		pDrvData->nr_registered_attrs++;
 	}
+#endif
 
 	/* SUCCESS! */
 	return 0;
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 65ff46a57..64ffd8d31 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -35,6 +35,8 @@
  *    Added support for: C102, CI-132, CI-134, CP-132, CP-114, CT-114 cards
  *                        by Damian Wrobel <dwrobel@ertel.com.pl>
  *
+ *    Added support for serial card CP104
+ *			  by James Nelson Provident Solutions <linux-info@provident-solutions.com>
  */
 
 #include <linux/config.h>
@@ -116,6 +118,9 @@
 #ifndef PCI_DEVICE_ID_C104
 #define PCI_DEVICE_ID_C104	0x1040
 #endif
+#ifndef PCI_DEVICE_ID_CP104
+#define PCI_DEVICE_ID_CP104	0x1041
+#endif
 #ifndef PCI_DEVICE_ID_CP132
 #define PCI_DEVICE_ID_CP132	0x1320
 #endif
@@ -139,6 +144,7 @@ enum {
 	MXSER_BOARD_CI104J,
 	MXSER_BOARD_C168_PCI,
 	MXSER_BOARD_C104_PCI,
+	MXSER_BOARD_CP104_PCI,
 	MXSER_BOARD_C102_ISA,
 	MXSER_BOARD_CI132,
 	MXSER_BOARD_CI134,
@@ -154,6 +160,7 @@ static char *mxser_brdname[] =
 	"CI-104J series",
 	"C168H/PCI series",
 	"C104H/PCI series",
+	"CP104/PCI series",
 	"C102 series",
 	"CI-132 series",
 	"CI-134 series",
@@ -169,6 +176,7 @@ static int mxser_numports[] =
 	4,
 	8,
 	4,
+	4,
 	2,
 	2,
 	4,
@@ -195,6 +203,8 @@ static struct pci_device_id mxser_pcibrds[] = {
 	  MXSER_BOARD_C168_PCI },
 	{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C104, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 	  MXSER_BOARD_C104_PCI },
+	{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_CP104, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
+	  MXSER_BOARD_CP104_PCI },
 	{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_CP132, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 	  MXSER_BOARD_CP132_PCI },
 	{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_CP114, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 08f46259e..9382646e8 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -249,7 +249,7 @@ static int opost(unsigned char c, struct tty_struct *tty)
  * things.
  */
 static ssize_t opost_block(struct tty_struct * tty,
-		       const unsigned char * inbuf, unsigned int nr)
+		       const unsigned char __user * inbuf, unsigned int nr)
 {
 	char	buf[80];
 	int	space;
@@ -946,7 +946,7 @@ static inline int input_available_p(struct tty_struct *tty, int amt)
  * the buffer to head pointer.
  */
 static inline int copy_from_read_buf(struct tty_struct *tty,
-				      unsigned char **b,
+				      unsigned char __user **b,
 				      size_t *nr)
 
 {
@@ -976,9 +976,9 @@ static inline int copy_from_read_buf(struct tty_struct *tty,
 extern ssize_t redirected_tty_write(struct file *,const char *,size_t,loff_t *);
 
 static ssize_t read_chan(struct tty_struct *tty, struct file *file,
-			 unsigned char *buf, size_t nr)
+			 unsigned char __user *buf, size_t nr)
 {
-	unsigned char *b = buf;
+	unsigned char __user *b = buf;
 	DECLARE_WAITQUEUE(wait, current);
 	int c;
 	int minimum, time;
@@ -1183,9 +1183,9 @@ do_it_again:
 }
 
 static ssize_t write_chan(struct tty_struct * tty, struct file * file,
-			  const unsigned char * buf, size_t nr)
+			  const unsigned char __user * buf, size_t nr)
 {
-	const unsigned char *b = buf;
+	const unsigned char __user *b = buf;
 	DECLARE_WAITQUEUE(wait, current);
 	int c;
 	ssize_t retval = 0;
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 7b6ee59ed..b5f32d65e 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -250,7 +250,7 @@ static loff_t nvram_llseek(struct file *file,loff_t offset, int origin )
 }
 
 static ssize_t
-nvram_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+nvram_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned char contents[NVRAM_BYTES];
 	unsigned i = *ppos;
@@ -279,7 +279,7 @@ nvram_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 }
 
 static ssize_t
-nvram_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+nvram_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned char contents[NVRAM_BYTES];
 	unsigned i = *ppos;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index fb87f872f..970e2331a 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1,7 +1,7 @@
 /*
  * linux/drivers/char/pcmcia/synclink_cs.c
  *
- * $Id: synclink_cs.c,v 4.21 2004/03/08 15:29:23 paulkf Exp $
+ * $Id: synclink_cs.c,v 4.22 2004/06/01 20:27:46 paulkf Exp $
  *
  * Device driver for Microgate SyncLink PC Card
  * multiprotocol serial adapter.
@@ -438,15 +438,15 @@ static void bh_status(MGSLPC_INFO *info);
 static int tiocmget(struct tty_struct *tty, struct file *file);
 static int tiocmset(struct tty_struct *tty, struct file *file,
 		    unsigned int set, unsigned int clear);
-static int get_stats(MGSLPC_INFO *info, struct mgsl_icount *user_icount);
-static int get_params(MGSLPC_INFO *info, MGSL_PARAMS *user_params);
-static int set_params(MGSLPC_INFO *info, MGSL_PARAMS *new_params);
-static int get_txidle(MGSLPC_INFO *info, int*idle_mode);
+static int get_stats(MGSLPC_INFO *info, struct mgsl_icount __user *user_icount);
+static int get_params(MGSLPC_INFO *info, MGSL_PARAMS __user *user_params);
+static int set_params(MGSLPC_INFO *info, MGSL_PARAMS __user *new_params);
+static int get_txidle(MGSLPC_INFO *info, int __user *idle_mode);
 static int set_txidle(MGSLPC_INFO *info, int idle_mode);
 static int set_txenable(MGSLPC_INFO *info, int enable);
 static int tx_abort(MGSLPC_INFO *info);
 static int set_rxenable(MGSLPC_INFO *info, int enable);
-static int wait_events(MGSLPC_INFO *info, int *mask);
+static int wait_events(MGSLPC_INFO *info, int __user *mask);
 
 #define jiffies_from_ms(a) ((((a) * HZ)/1000)+1)
 
@@ -489,7 +489,7 @@ MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICE_COUNT) "i");
 MODULE_LICENSE("GPL");
 
 static char *driver_name = "SyncLink PC Card driver";
-static char *driver_version = "$Revision: 4.21 $";
+static char *driver_version = "$Revision: 4.22 $";
 
 static struct tty_driver *serial_driver;
 
@@ -521,8 +521,10 @@ static dev_link_t *dev_list = NULL;
  * (gdb) to get the .text address for the add-symbol-file command.
  * This allows remote debugging of dynamically loadable modules.
  */
-static void* mgslpc_get_text_ptr(void);
-static void* mgslpc_get_text_ptr() {return mgslpc_get_text_ptr;}
+static void* mgslpc_get_text_ptr(void)
+{
+	return mgslpc_get_text_ptr;
+}
 
 static dev_link_t *mgslpc_attach(void)
 {
@@ -1955,7 +1957,7 @@ static void mgslpc_unthrottle(struct tty_struct * tty)
 
 /* get the current serial statistics
  */
-static int get_stats(MGSLPC_INFO * info, struct mgsl_icount *user_icount)
+static int get_stats(MGSLPC_INFO * info, struct mgsl_icount __user *user_icount)
 {
 	int err;
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -1968,7 +1970,7 @@ static int get_stats(MGSLPC_INFO * info, struct mgsl_icount *user_icount)
 
 /* get the current serial parameters
  */
-static int get_params(MGSLPC_INFO * info, MGSL_PARAMS *user_params)
+static int get_params(MGSLPC_INFO * info, MGSL_PARAMS __user *user_params)
 {
 	int err;
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -1988,7 +1990,7 @@ static int get_params(MGSLPC_INFO * info, MGSL_PARAMS *user_params)
  *
  * Returns:	0 if success, otherwise error code
  */
-static int set_params(MGSLPC_INFO * info, MGSL_PARAMS *new_params)
+static int set_params(MGSLPC_INFO * info, MGSL_PARAMS __user *new_params)
 {
  	unsigned long flags;
 	MGSL_PARAMS tmp_params;
@@ -2014,7 +2016,7 @@ static int set_params(MGSLPC_INFO * info, MGSL_PARAMS *new_params)
 	return 0;
 }
 
-static int get_txidle(MGSLPC_INFO * info, int*idle_mode)
+static int get_txidle(MGSLPC_INFO * info, int __user *idle_mode)
 {
 	int err;
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2037,7 +2039,7 @@ static int set_txidle(MGSLPC_INFO * info, int idle_mode)
 	return 0;
 }
 
-static int get_interface(MGSLPC_INFO * info, int*if_mode)
+static int get_interface(MGSLPC_INFO * info, int __user *if_mode)
 {
 	int err;
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2136,7 +2138,7 @@ static int set_rxenable(MGSLPC_INFO * info, int enable)
  *				of events triggerred,
  * 			otherwise error code
  */
-static int wait_events(MGSLPC_INFO * info, int * mask_ptr)
+static int wait_events(MGSLPC_INFO * info, int __user *mask_ptr)
 {
  	unsigned long flags;
 	int s;
@@ -2409,20 +2411,21 @@ int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg)
 {
 	int error;
 	struct mgsl_icount cnow;	/* kernel counter temps */
-	struct serial_icounter_struct *p_cuser;	/* user space */
+	struct serial_icounter_struct __user *p_cuser;	/* user space */
+	void __user *argp = (void __user *)arg;
 	unsigned long flags;
 	
 	switch (cmd) {
 	case MGSL_IOCGPARAMS:
-		return get_params(info,(MGSL_PARAMS *)arg);
+		return get_params(info, argp);
 	case MGSL_IOCSPARAMS:
-		return set_params(info,(MGSL_PARAMS *)arg);
+		return set_params(info, argp);
 	case MGSL_IOCGTXIDLE:
-		return get_txidle(info,(int*)arg);
+		return get_txidle(info, argp);
 	case MGSL_IOCSTXIDLE:
-		return set_txidle(info,(int)arg);
+		return set_txidle(info, (int)arg);
 	case MGSL_IOCGIF:
-		return get_interface(info,(int*)arg);
+		return get_interface(info, argp);
 	case MGSL_IOCSIF:
 		return set_interface(info,(int)arg);
 	case MGSL_IOCTXENABLE:
@@ -2432,16 +2435,16 @@ int ioctl_common(MGSLPC_INFO *info, unsigned int cmd, unsigned long arg)
 	case MGSL_IOCTXABORT:
 		return tx_abort(info);
 	case MGSL_IOCGSTATS:
-		return get_stats(info,(struct mgsl_icount*)arg);
+		return get_stats(info, argp);
 	case MGSL_IOCWAITEVENT:
-		return wait_events(info,(int*)arg);
+		return wait_events(info, argp);
 	case TIOCMIWAIT:
 		return modem_input_wait(info,(int)arg);
 	case TIOCGICOUNT:
 		spin_lock_irqsave(&info->lock,flags);
 		cnow = info->icount;
 		spin_unlock_irqrestore(&info->lock,flags);
-		p_cuser = (struct serial_icounter_struct *) arg;
+		p_cuser = argp;
 		PUT_USER(error,cnow.cts, &p_cuser->cts);
 		if (error) return error;
 		PUT_USER(error,cnow.dsr, &p_cuser->dsr);
@@ -3130,9 +3133,35 @@ static struct tty_operations mgslpc_ops = {
 	.tiocmset = tiocmset,
 };
 
+static void synclink_cs_cleanup(void)
+{
+	int rc;
+
+	printk("Unloading %s: version %s\n", driver_name, driver_version);
+
+	while(mgslpc_device_list)
+		mgslpc_remove_device(mgslpc_device_list);
+
+	if (serial_driver) {
+		if ((rc = tty_unregister_driver(serial_driver)))
+			printk("%s(%d) failed to unregister tty driver err=%d\n",
+			       __FILE__,__LINE__,rc);
+		put_tty_driver(serial_driver);
+	}
+
+	pcmcia_unregister_driver(&mgslpc_driver);
+
+	/* XXX: this really needs to move into generic code.. */
+	while (dev_list != NULL) {
+		if (dev_list->state & DEV_CONFIG)
+			mgslpc_release((u_long)dev_list);
+		mgslpc_detach(dev_list);
+	}
+}
+
 static int __init synclink_cs_init(void)
 {
-    int error;
+    int rc;
 
     if (break_on_load) {
 	    mgslpc_get_text_ptr();
@@ -3141,14 +3170,13 @@ static int __init synclink_cs_init(void)
 
     printk("%s %s\n", driver_name, driver_version);
 
-    serial_driver = alloc_tty_driver(MAX_DEVICE_COUNT);
-    if (!serial_driver)
-	    return -ENOMEM;
+    if ((rc = pcmcia_register_driver(&mgslpc_driver)) < 0)
+	    return rc;
 
-    error = pcmcia_register_driver(&mgslpc_driver);
-    if (error) {
-	    put_tty_driver(serial_driver);
-	    return error;
+    serial_driver = alloc_tty_driver(MAX_DEVICE_COUNT);
+    if (!serial_driver) {
+	    rc = -ENOMEM;
+	    goto error;
     }
 
     /* Initialize the tty_driver structure */
@@ -3166,39 +3194,28 @@ static int __init synclink_cs_init(void)
     serial_driver->flags = TTY_DRIVER_REAL_RAW;
     tty_set_operations(serial_driver, &mgslpc_ops);
 
-    if (tty_register_driver(serial_driver) < 0)
+    if ((rc = tty_register_driver(serial_driver)) < 0) {
 	    printk("%s(%d):Couldn't register serial driver\n",
 		   __FILE__,__LINE__);
+	    put_tty_driver(serial_driver);
+	    serial_driver = NULL;
+	    goto error;
+    }
 			
     printk("%s %s, tty major#%d\n",
 	   driver_name, driver_version,
 	   serial_driver->major);
 	
     return 0;
+
+error:
+    synclink_cs_cleanup();
+    return rc;
 }
 
 static void __exit synclink_cs_exit(void) 
 {
-	int rc;
-
-	printk("Unloading %s: version %s\n", driver_name, driver_version);
-
-	while(mgslpc_device_list)
-		mgslpc_remove_device(mgslpc_device_list);
-
-	if ((rc = tty_unregister_driver(serial_driver)))
-		printk("%s(%d) failed to unregister tty driver err=%d\n",
-		       __FILE__,__LINE__,rc);
-	put_tty_driver(serial_driver);
-
-	pcmcia_unregister_driver(&mgslpc_driver);
-
-	/* XXX: this really needs to move into generic code.. */
-	while (dev_list != NULL) {
-		if (dev_list->state & DEV_CONFIG)
-			mgslpc_release((u_long)dev_list);
-		mgslpc_detach(dev_list);
-	}
+	synclink_cs_cleanup();
 }
 
 module_init(synclink_cs_init);
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 525905c07..5eda075c6 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -59,6 +59,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/device.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/ioctl.h>
 #include <linux/parport.h>
@@ -102,7 +103,7 @@ static inline void pp_enable_irq (struct pp_struct *pp)
 	port->ops->enable_irq (port);
 }
 
-static ssize_t pp_read (struct file * file, char * buf, size_t count,
+static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
 			loff_t * ppos)
 {
 	unsigned int minor = iminor(file->f_dentry->d_inode);
@@ -185,8 +186,8 @@ static ssize_t pp_read (struct file * file, char * buf, size_t count,
 	return bytes_read;
 }
 
-static ssize_t pp_write (struct file * file, const char * buf, size_t count,
-			 loff_t * ppos)
+static ssize_t pp_write (struct file * file, const char __user * buf,
+			 size_t count, loff_t * ppos)
 {
 	unsigned int minor = iminor(file->f_dentry->d_inode);
 	struct pp_struct *pp = file->private_data;
@@ -334,6 +335,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 	unsigned int minor = iminor(inode);
 	struct pp_struct *pp = file->private_data;
 	struct parport * port;
+	void __user *argp = (void __user *)arg;
 
 	/* First handle the cases that don't take arguments. */
 	switch (cmd) {
@@ -395,7 +397,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 	case PPSETMODE:
 	    {
 		int mode;
-		if (copy_from_user (&mode, (int *) arg, sizeof (mode)))
+		if (copy_from_user (&mode, argp, sizeof (mode)))
 			return -EFAULT;
 		/* FIXME: validate mode */
 		pp->state.mode = mode;
@@ -417,7 +419,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		} else {
 			mode = pp->state.mode;
 		}
-		if (copy_to_user ((int *)arg, &mode, sizeof (mode))) {
+		if (copy_to_user (argp, &mode, sizeof (mode))) {
 			return -EFAULT;
 		}
 		return 0;
@@ -425,7 +427,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 	case PPSETPHASE:
 	    {
 		int phase;
-		if (copy_from_user (&phase, (int *) arg, sizeof (phase))) {
+		if (copy_from_user (&phase, argp, sizeof (phase))) {
 			return -EFAULT;
 		}
 		/* FIXME: validate phase */
@@ -446,7 +448,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		} else {
 			phase = pp->state.phase;
 		}
-		if (copy_to_user ((int *)arg, &phase, sizeof (phase))) {
+		if (copy_to_user (argp, &phase, sizeof (phase))) {
 			return -EFAULT;
 		}
 		return 0;
@@ -460,7 +462,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 			return -ENODEV;
 
 		modes = port->modes;
-		if (copy_to_user ((unsigned int *)arg, &modes, sizeof (modes))) {
+		if (copy_to_user (argp, &modes, sizeof (modes))) {
 			return -EFAULT;
 		}
 		return 0;
@@ -469,7 +471,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 	    {
 		int uflags;
 
-		if (copy_from_user (&uflags, (int *)arg, sizeof (uflags))) {
+		if (copy_from_user (&uflags, argp, sizeof (uflags))) {
 			return -EFAULT;
 		}
 		pp->flags &= ~PP_FLAGMASK;
@@ -481,7 +483,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		int uflags;
 
 		uflags = pp->flags & PP_FLAGMASK;
-		if (copy_to_user ((int *)arg, &uflags, sizeof (uflags))) {
+		if (copy_to_user (argp, &uflags, sizeof (uflags))) {
 			return -EFAULT;
 		}
 		return 0;
@@ -508,17 +510,17 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 
 	case PPRSTATUS:
 		reg = parport_read_status (port);
-		if (copy_to_user ((unsigned char *) arg, &reg, sizeof (reg)))
+		if (copy_to_user (argp, &reg, sizeof (reg)))
 			return -EFAULT;
 		return 0;
 	case PPRDATA:
 		reg = parport_read_data (port);
-		if (copy_to_user ((unsigned char *) arg, &reg, sizeof (reg)))
+		if (copy_to_user (argp, &reg, sizeof (reg)))
 			return -EFAULT;
 		return 0;
 	case PPRCONTROL:
 		reg = parport_read_control (port);
-		if (copy_to_user ((unsigned char *) arg, &reg, sizeof (reg)))
+		if (copy_to_user (argp, &reg, sizeof (reg)))
 			return -EFAULT;
 		return 0;
 	case PPYIELD:
@@ -537,29 +539,29 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case PPWCONTROL:
-		if (copy_from_user (&reg, (unsigned char *) arg, sizeof (reg)))
+		if (copy_from_user (&reg, argp, sizeof (reg)))
 			return -EFAULT;
 		parport_write_control (port, reg);
 		return 0;
 
 	case PPWDATA:
-		if (copy_from_user (&reg, (unsigned char *) arg, sizeof (reg)))
+		if (copy_from_user (&reg, argp, sizeof (reg)))
 			return -EFAULT;
 		parport_write_data (port, reg);
 		return 0;
 
 	case PPFCONTROL:
-		if (copy_from_user (&mask, (unsigned char *) arg,
+		if (copy_from_user (&mask, argp,
 				    sizeof (mask)))
 			return -EFAULT;
-		if (copy_from_user (&reg, 1 + (unsigned char *) arg,
+		if (copy_from_user (&reg, 1 + (unsigned char __user *) arg,
 				    sizeof (reg)))
 			return -EFAULT;
 		parport_frob_control (port, mask, reg);
 		return 0;
 
 	case PPDATADIR:
-		if (copy_from_user (&mode, (int *) arg, sizeof (mode)))
+		if (copy_from_user (&mode, argp, sizeof (mode)))
 			return -EFAULT;
 		if (mode)
 			port->ops->data_reverse (port);
@@ -568,7 +570,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case PPNEGOT:
-		if (copy_from_user (&mode, (int *) arg, sizeof (mode)))
+		if (copy_from_user (&mode, argp, sizeof (mode)))
 			return -EFAULT;
 		switch ((ret = parport_negotiate (port, mode))) {
 		case 0: break;
@@ -583,8 +585,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		return ret;
 
 	case PPWCTLONIRQ:
-		if (copy_from_user (&reg, (unsigned char *) arg,
-				    sizeof (reg)))
+		if (copy_from_user (&reg, argp, sizeof (reg)))
 			return -EFAULT;
 
 		/* Remember what to set the control lines to, for next
@@ -595,14 +596,13 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 
 	case PPCLRIRQ:
 		ret = atomic_read (&pp->irqc);
-		if (copy_to_user ((int *) arg, &ret, sizeof (ret)))
+		if (copy_to_user (argp, &ret, sizeof (ret)))
 			return -EFAULT;
 		atomic_sub (ret, &pp->irqc);
 		return 0;
 
 	case PPSETTIME:
-		if (copy_from_user (&par_timeout, (struct timeval *)arg,
-				    sizeof(struct timeval))) {
+		if (copy_from_user (&par_timeout, argp, sizeof(struct timeval))) {
 			return -EFAULT;
 		}
 		/* Convert to jiffies, place in pp->pdev->timeout */
@@ -621,10 +621,8 @@ static int pp_ioctl(struct inode *inode, struct file *file,
 		to_jiffies = pp->pdev->timeout;
 		par_timeout.tv_sec = to_jiffies / HZ;
 		par_timeout.tv_usec = (to_jiffies % (long)HZ) * (1000000/HZ);
-		if (copy_to_user ((struct timeval *)arg, &par_timeout,
-				  sizeof(struct timeval))) {
+		if (copy_to_user (argp, &par_timeout, sizeof(struct timeval)))
 			return -EFAULT;
-		}
 		return 0;
 
 	default:
@@ -739,6 +737,8 @@ static unsigned int pp_poll (struct file * file, poll_table * wait)
 	return mask;
 }
 
+static struct class_simple *ppdev_class;
+
 static struct file_operations pp_fops = {
 	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
@@ -750,23 +750,59 @@ static struct file_operations pp_fops = {
 	.release	= pp_release,
 };
 
+static void pp_attach(struct parport *port)
+{
+	class_simple_device_add(ppdev_class, MKDEV(PP_MAJOR, port->number),
+			NULL, "parport%d", port->number);
+}
+
+static void pp_detach(struct parport *port)
+{
+	class_simple_device_remove(MKDEV(PP_MAJOR, port->number));
+}
+
+static struct parport_driver pp_driver = {
+	.name		= CHRDEV,
+	.attach		= pp_attach,
+	.detach		= pp_detach,
+};
+
 static int __init ppdev_init (void)
 {
-	int i;
+	int i, err = 0;
 
 	if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
 		printk (KERN_WARNING CHRDEV ": unable to get major %d\n",
 			PP_MAJOR);
 		return -EIO;
 	}
+	ppdev_class = class_simple_create(THIS_MODULE, CHRDEV);
+	if (IS_ERR(ppdev_class)) {
+		err = PTR_ERR(ppdev_class);
+		goto out_chrdev;
+	}
 	devfs_mk_dir("parports");
 	for (i = 0; i < PARPORT_MAX; i++) {
 		devfs_mk_cdev(MKDEV(PP_MAJOR, i),
 				S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i);
 	}
+	if (parport_register_driver(&pp_driver)) {
+		printk (KERN_WARNING CHRDEV ": unable to register with parport\n");
+		goto out_class;
+	}
 
 	printk (KERN_INFO PP_VERSION "\n");
-	return 0;
+	goto out;
+
+out_class:
+	for (i = 0; i < PARPORT_MAX; i++)
+		devfs_remove("parports/%d", i);
+	devfs_remove("parports");
+	class_simple_destroy(ppdev_class);
+out_chrdev:
+	unregister_chrdev(PP_MAJOR, CHRDEV);
+out:
+	return err;
 }
 
 static void __exit ppdev_cleanup (void)
@@ -775,7 +811,9 @@ static void __exit ppdev_cleanup (void)
 	/* Clean up all parport stuff */
 	for (i = 0; i < PARPORT_MAX; i++)
 		devfs_remove("parports/%d", i);
+	parport_unregister_driver(&pp_driver);
 	devfs_remove("parports");
+	class_simple_destroy(ppdev_class);
 	unregister_chrdev (PP_MAJOR, CHRDEV);
 }
 
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 4abc4d95b..4cea8c05c 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -211,7 +211,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty)
  * one we got after it is open, with an ioctl.
  */
 #ifdef CONFIG_UNIX98_PTYS
-static int pty_get_device_number(struct tty_struct *tty, unsigned int *value)
+static int pty_get_device_number(struct tty_struct *tty, unsigned __user *value)
 {
 	unsigned int result = tty->index;
 	return put_user(result, value);
@@ -219,7 +219,7 @@ static int pty_get_device_number(struct tty_struct *tty, unsigned int *value)
 #endif
 
 /* Set the lock flag on a pty */
-static int pty_set_lock(struct tty_struct *tty, int * arg)
+static int pty_set_lock(struct tty_struct *tty, int __user * arg)
 {
 	int val;
 	if (get_user(val,arg))
@@ -241,7 +241,7 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct file *file,
 	}
 	switch(cmd) {
 	case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */
-		return pty_set_lock(tty, (int *) arg);
+		return pty_set_lock(tty, (int __user *) arg);
 	}
 	return -ENOIOCTLCMD;
 }
@@ -257,9 +257,9 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file,
 	}
 	switch(cmd) {
 	case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */
-		return pty_set_lock(tty, (int *)arg);
+		return pty_set_lock(tty, (int __user *)arg);
 	case TIOCGPTN: /* Get PT Number */
-		return pty_get_device_number(tty, (unsigned int *)arg);
+		return pty_get_device_number(tty, (unsigned int __user *)arg);
 	}
 
 	return -ENOIOCTLCMD;
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 6941fdeb6..f51b54112 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1586,7 +1586,7 @@ void rand_initialize_disk(struct gendisk *disk)
 }
 
 static ssize_t
-random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
+random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t			n, retval = 0, count = 0;
@@ -1666,7 +1666,7 @@ random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
 }
 
 static ssize_t
-urandom_read(struct file * file, char * buf,
+urandom_read(struct file * file, char __user * buf,
 		      size_t nbytes, loff_t *ppos)
 {
 	return extract_entropy(sec_random_state, buf, nbytes,
@@ -1690,13 +1690,13 @@ random_poll(struct file *file, poll_table * wait)
 }
 
 static ssize_t
-random_write(struct file * file, const char * buffer,
+random_write(struct file * file, const char __user * buffer,
 	     size_t count, loff_t *ppos)
 {
 	int		ret = 0;
 	size_t		bytes;
 	__u32 		buf[16];
-	const char 	*p = buffer;
+	const char 	__user *p = buffer;
 	size_t		c = count;
 
 	while (c > 0) {
@@ -1725,20 +1725,21 @@ static int
 random_ioctl(struct inode * inode, struct file * file,
 	     unsigned int cmd, unsigned long arg)
 {
-	int *p, *tmp, size, ent_count;
+	int *tmp, size, ent_count;
+	int __user *p = (int __user *)arg;
 	int retval;
 	unsigned long flags;
 	
 	switch (cmd) {
 	case RNDGETENTCNT:
 		ent_count = random_state->entropy_count;
-		if (put_user(ent_count, (int *) arg))
+		if (put_user(ent_count, p))
 			return -EFAULT;
 		return 0;
 	case RNDADDTOENTCNT:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
-		if (get_user(ent_count, (int *) arg))
+		if (get_user(ent_count, p))
 			return -EFAULT;
 		credit_entropy_store(random_state, ent_count);
 		/*
@@ -1751,7 +1752,6 @@ random_ioctl(struct inode * inode, struct file * file,
 	case RNDGETPOOL:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
-		p = (int *) arg;
 		if (get_user(size, p) ||
 		    put_user(random_state->poolinfo.poolwords, p++))
 			return -EFAULT;
@@ -1786,14 +1786,13 @@ random_ioctl(struct inode * inode, struct file * file,
 	case RNDADDENTROPY:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
-		p = (int *) arg;
 		if (get_user(ent_count, p++))
 			return -EFAULT;
 		if (ent_count < 0)
 			return -EINVAL;
 		if (get_user(size, p++))
 			return -EFAULT;
-		retval = random_write(file, (const char *) p,
+		retval = random_write(file, (const char __user *) p,
 				      size, &file->f_pos);
 		if (retval < 0)
 			return retval;
@@ -1895,7 +1894,7 @@ static int change_poolsize(int poolsize)
 }
 
 static int proc_do_poolsize(ctl_table *table, int write, struct file *filp,
-			    void *buffer, size_t *lenp)
+			    void __user *buffer, size_t *lenp)
 {
 	int	ret;
 
@@ -1909,9 +1908,9 @@ static int proc_do_poolsize(ctl_table *table, int write, struct file *filp,
 	return change_poolsize(sysctl_poolsize);
 }
 
-static int poolsize_strategy(ctl_table *table, int *name, int nlen,
-			     void *oldval, size_t *oldlenp,
-			     void *newval, size_t newlen, void **context)
+static int poolsize_strategy(ctl_table *table, int __user *name, int nlen,
+			     void __user *oldval, size_t __user *oldlenp,
+			     void __user *newval, size_t newlen, void **context)
 {
 	int	len;
 	
@@ -1946,7 +1945,7 @@ static int poolsize_strategy(ctl_table *table, int *name, int nlen,
  * sysctl system call, it is returned as 16 bytes of binary data.
  */
 static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
-			void *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp)
 {
 	ctl_table	fake_table;
 	unsigned char	buf[64], tmp_uuid[16], *uuid;
@@ -1971,9 +1970,9 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
 	return proc_dostring(&fake_table, write, filp, buffer, lenp);
 }
 
-static int uuid_strategy(ctl_table *table, int *name, int nlen,
-			 void *oldval, size_t *oldlenp,
-			 void *newval, size_t newlen, void **context)
+static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
+			 void __user *oldval, size_t __user *oldlenp,
+			 void __user *newval, size_t newlen, void **context)
 {
 	unsigned char	tmp_uuid[16], *uuid;
 	unsigned int	len;
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index e58dab4e2..9c19dbc8e 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -140,7 +140,7 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
 
 		/* First, find out which raw minor we want */
 
-		if (copy_from_user(&rq, (void *) arg, sizeof(rq))) {
+		if (copy_from_user(&rq, (void __user *) arg, sizeof(rq))) {
 			err = -EFAULT;
 			goto out;
 		}
@@ -211,7 +211,7 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
 				rq.block_major = rq.block_minor = 0;
 			}
 			up(&raw_mutex);
-			if (copy_to_user((void *)arg, &rq, sizeof(rq))) {
+			if (copy_to_user((void __user *)arg, &rq, sizeof(rq))) {
 				err = -EFAULT;
 				goto out;
 			}
@@ -225,18 +225,24 @@ out:
 	return err;
 }
 
-static ssize_t raw_file_write(struct file *file, const char *buf,
+static ssize_t raw_file_write(struct file *file, const char __user *buf,
 				   size_t count, loff_t *ppos)
 {
-	struct iovec local_iov = { .iov_base = (void *)buf, .iov_len = count };
+	struct iovec local_iov = {
+		.iov_base = (char __user *)buf,
+		.iov_len = count
+	};
 
 	return generic_file_write_nolock(file, &local_iov, 1, ppos);
 }
 
-static ssize_t raw_file_aio_write(struct kiocb *iocb, const char *buf,
+static ssize_t raw_file_aio_write(struct kiocb *iocb, const char __user *buf,
 					size_t count, loff_t pos)
 {
-	struct iovec local_iov = { .iov_base = (void *)buf, .iov_len = count };
+	struct iovec local_iov = {
+		.iov_base = (char __user *)buf,
+		.iov_len = count
+	};
 
 	return generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
 }
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index fddefbb11..03b4f2097 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -97,7 +97,7 @@ static unsigned long rtc_port;
 static int rtc_irq = PCI_IRQ_NONE;
 #endif
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 static int rtc_has_irq = 1;
 #endif
 
@@ -125,30 +125,28 @@ static struct fasync_struct *rtc_async_queue;
 
 static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 static struct timer_list rtc_irq_timer;
 #endif
 
-static ssize_t rtc_read(struct file *file, char *buf,
+static ssize_t rtc_read(struct file *file, char __user *buf,
 			size_t count, loff_t *ppos);
 
 static int rtc_ioctl(struct inode *inode, struct file *file,
 		     unsigned int cmd, unsigned long arg);
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 static unsigned int rtc_poll(struct file *file, poll_table *wait);
 #endif
 
 static void get_rtc_alm_time (struct rtc_time *alm_tm);
-#if RTC_IRQ
+#ifdef RTC_IRQ
 static void rtc_dropped_irq(unsigned long data);
 
 static void set_rtc_irq_bit(unsigned char bit);
 static void mask_rtc_irq_bit(unsigned char bit);
 #endif
 
-static inline unsigned char rtc_is_updating(void);
-
 static int rtc_read_proc(char *page, char **start, off_t off,
                          int count, int *eof, void *data);
 
@@ -171,7 +169,7 @@ static unsigned long rtc_freq = 0;	/* Current periodic IRQ rate	*/
 static unsigned long rtc_irq_data = 0;	/* our output to the world	*/
 static unsigned long rtc_max_user_freq = 64; /* > this, need CAP_SYS_RESOURCE */
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 /*
  * rtc_task_lock nests inside rtc_lock.
  */
@@ -189,7 +187,20 @@ static unsigned long epoch = 1900;	/* year corresponding to 0x00	*/
 static const unsigned char days_in_mo[] = 
 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
-#if RTC_IRQ
+/*
+ * Returns true if a clock update is in progress
+ */
+static inline unsigned char rtc_is_updating(void)
+{
+	unsigned char uip;
+
+	spin_lock_irq(&rtc_lock);
+	uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
+	spin_unlock_irq(&rtc_lock);
+	return uip;
+}
+
+#ifdef RTC_IRQ
 /*
  *	A very tiny interrupt handler. It runs with SA_INTERRUPT set,
  *	but there is possibility of conflicting with the set_rtc_mmss()
@@ -295,10 +306,10 @@ static void __exit cleanup_sysctl(void)
  *	Now all the various file operations that we export.
  */
 
-static ssize_t rtc_read(struct file *file, char *buf,
+static ssize_t rtc_read(struct file *file, char __user *buf,
 			size_t count, loff_t *ppos)
 {
-#if !RTC_IRQ
+#ifndef RTC_IRQ
 	return -EIO;
 #else
 	DECLARE_WAITQUEUE(wait, current);
@@ -340,9 +351,9 @@ static ssize_t rtc_read(struct file *file, char *buf,
 	} while (1);
 
 	if (count < sizeof(unsigned long))
-		retval = put_user(data, (unsigned int *)buf) ?: sizeof(int); 
+		retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int); 
 	else
-		retval = put_user(data, (unsigned long *)buf) ?: sizeof(long);
+		retval = put_user(data, (unsigned long __user *)buf) ?: sizeof(long);
  out:
 	current->state = TASK_RUNNING;
 	remove_wait_queue(&rtc_wait, &wait);
@@ -355,7 +366,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 {
 	struct rtc_time wtime; 
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	if (rtc_has_irq == 0) {
 		switch (cmd) {
 		case RTC_AIE_OFF:
@@ -372,7 +383,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 #endif
 
 	switch (cmd) {
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	case RTC_AIE_OFF:	/* Mask alarm int. enab. bit	*/
 	{
 		mask_rtc_irq_bit(RTC_AIE);
@@ -447,7 +458,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 		unsigned char hrs, min, sec;
 		struct rtc_time alm_tm;
 
-		if (copy_from_user(&alm_tm, (struct rtc_time*)arg,
+		if (copy_from_user(&alm_tm, (struct rtc_time __user *)arg,
 				   sizeof(struct rtc_time)))
 			return -EFAULT;
 
@@ -500,7 +511,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 		if (!capable(CAP_SYS_TIME))
 			return -EACCES;
 
-		if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
+		if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg,
 				   sizeof(struct rtc_time)))
 			return -EFAULT;
 
@@ -584,10 +595,10 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 		spin_unlock_irq(&rtc_lock);
 		return 0;
 	}
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	case RTC_IRQP_READ:	/* Read the periodic IRQ rate.	*/
 	{
-		return put_user(rtc_freq, (unsigned long *)arg);
+		return put_user(rtc_freq, (unsigned long __user *)arg);
 	}
 	case RTC_IRQP_SET:	/* Set periodic IRQ rate.	*/
 	{
@@ -631,7 +642,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 #endif
 	case RTC_EPOCH_READ:	/* Read the epoch.	*/
 	{
-		return put_user (epoch, (unsigned long *)arg);
+		return put_user (epoch, (unsigned long __user *)arg);
 	}
 	case RTC_EPOCH_SET:	/* Set the epoch.	*/
 	{
@@ -650,7 +661,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 	default:
 		return -ENOTTY;
 	}
-	return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
+	return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
 }
 
 static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
@@ -693,7 +704,7 @@ static int rtc_fasync (int fd, struct file *filp, int on)
 
 static int rtc_release(struct inode *inode, struct file *file)
 {
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	unsigned char tmp;
 
 	if (rtc_has_irq == 0)
@@ -732,7 +743,7 @@ no_irq:
 	return 0;
 }
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 /* Called without the kernel lock - fine */
 static unsigned int rtc_poll(struct file *file, poll_table *wait)
 {
@@ -763,7 +774,7 @@ EXPORT_SYMBOL(rtc_control);
 
 int rtc_register(rtc_task_t *task)
 {
-#if !RTC_IRQ
+#ifndef RTC_IRQ
 	return -EIO;
 #else
 	if (task == NULL || task->func == NULL)
@@ -789,7 +800,7 @@ int rtc_register(rtc_task_t *task)
 
 int rtc_unregister(rtc_task_t *task)
 {
-#if !RTC_IRQ
+#ifndef RTC_IRQ
 	return -EIO;
 #else
 	unsigned char tmp;
@@ -825,7 +836,7 @@ int rtc_unregister(rtc_task_t *task)
 
 int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg)
 {
-#if !RTC_IRQ
+#ifndef RTC_IRQ
 	return -EIO;
 #else
 	spin_lock_irq(&rtc_task_lock);
@@ -847,7 +858,7 @@ static struct file_operations rtc_fops = {
 	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
 	.read		= rtc_read,
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	.poll		= rtc_poll,
 #endif
 	.ioctl		= rtc_ioctl,
@@ -863,7 +874,7 @@ static struct miscdevice rtc_dev=
 	&rtc_fops
 };
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 static irqreturn_t (*rtc_int_handler_ptr)(int irq, void *dev_id, struct pt_regs *regs);
 #endif
 
@@ -933,7 +944,7 @@ no_irq:
 		return -EIO;
 	}
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	if (is_hpet_enabled()) {
 		rtc_int_handler_ptr = hpet_rtc_interrupt;
 	} else {
@@ -953,14 +964,14 @@ no_irq:
 #endif /* __sparc__ vs. others */
 
 	if (misc_register(&rtc_dev)) {
-#if RTC_IRQ
+#ifdef RTC_IRQ
 		free_irq(RTC_IRQ, NULL);
 #endif
 		release_region(RTC_PORT(0), RTC_IO_EXTENT);
 		return -ENODEV;
 	}
 	if (create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL) == NULL) {
-#if RTC_IRQ
+#ifdef RTC_IRQ
 		free_irq(RTC_IRQ, NULL);
 #endif
 		release_region(RTC_PORT(0), RTC_IO_EXTENT);
@@ -1011,7 +1022,7 @@ no_irq:
 	if (guess)
 		printk(KERN_INFO "rtc: %s epoch (%lu) detected\n", guess, epoch);
 #endif
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	if (rtc_has_irq == 0)
 		goto no_irq2;
 
@@ -1045,7 +1056,7 @@ static void __exit rtc_exit (void)
 		free_irq (rtc_irq, &rtc_port);
 #else
 	release_region (RTC_PORT (0), RTC_IO_EXTENT);
-#if RTC_IRQ
+#ifdef RTC_IRQ
 	if (rtc_has_irq)
 		free_irq (RTC_IRQ, NULL);
 #endif
@@ -1055,7 +1066,7 @@ static void __exit rtc_exit (void)
 module_init(rtc_init);
 module_exit(rtc_exit);
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 /*
  * 	At IRQ rates >= 4096Hz, an interrupt may get lost altogether.
  *	(usually during an IDE disk interrupt, with IRQ unmasking off)
@@ -1194,20 +1205,6 @@ static int rtc_read_proc(char *page, char **start, off_t off,
         return len;
 }
 
-/*
- * Returns true if a clock update is in progress
- */
-/* FIXME shouldn't this be above rtc_init to make it fully inlined? */
-static inline unsigned char rtc_is_updating(void)
-{
-	unsigned char uip;
-
-	spin_lock_irq(&rtc_lock);
-	uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
-	spin_unlock_irq(&rtc_lock);
-	return uip;
-}
-
 void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
 	unsigned long uip_watchdog = jiffies;
@@ -1298,7 +1295,7 @@ static void get_rtc_alm_time(struct rtc_time *alm_tm)
 	}
 }
 
-#if RTC_IRQ
+#ifdef RTC_IRQ
 /*
  * Used to disable/enable interrupts for any one of UIE, AIE, PIE.
  * Rumour has it that if you frob the interrupt enable/disable
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index 3758fb1b1..e937346e1 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -26,7 +26,7 @@ static int major = 0;		/* default to dynamic major */
 MODULE_PARM(major, "i");
 MODULE_PARM_DESC(major, "Major device number");
 
-static ssize_t scx200_gpio_write(struct file *file, const char *data, 
+static ssize_t scx200_gpio_write(struct file *file, const char __user *data, 
 				 size_t len, loff_t *ppos)
 {
 	unsigned m = iminor(file->f_dentry->d_inode);
@@ -77,7 +77,7 @@ static ssize_t scx200_gpio_write(struct file *file, const char *data,
 	return len;
 }
 
-static ssize_t scx200_gpio_read(struct file *file, char *buf,
+static ssize_t scx200_gpio_read(struct file *file, char __user *buf,
 				size_t len, loff_t *ppos)
 {
 	unsigned m = iminor(file->f_dentry->d_inode);
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index 74e78b721..f08fd7920 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -3,10 +3,10 @@
  *
  * This module exports the functions:
  *
- *     'int set_selection(const unsigned long arg)'
+ *     'int set_selection(struct tiocl_selection __user *, struct tty_struct *)'
  *     'void clear_selection(void)'
- *     'int paste_selection(struct tty_struct *tty)'
- *     'int sel_loadlut(const unsigned long arg)'
+ *     'int paste_selection(struct tty_struct *)'
+ *     'int sel_loadlut(char __user *)'
  *
  * Now that /dev/vcs exists, most of this can disappear again.
  */
@@ -95,9 +95,9 @@ static inline int inword(const unsigned char c) {
 }
 
 /* set inwordLut contents. Invoked by ioctl(). */
-int sel_loadlut(const unsigned long arg)
+int sel_loadlut(char __user *p)
 {
-	return copy_from_user(inwordLut, (u32 *)(arg+4), 32) ? -EFAULT : 0;
+	return copy_from_user(inwordLut, (u32 __user *)(p+4), 32) ? -EFAULT : 0;
 }
 
 /* does screen address p correspond to character at LH/RH edge of screen? */
@@ -113,7 +113,7 @@ static inline unsigned short limit(const unsigned short v, const unsigned short
 }
 
 /* set the current selection. Invoked by ioctl() or by kernel code. */
-int set_selection(const struct tiocl_selection *sel, struct tty_struct *tty, int user)
+int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty)
 {
 	int sel_mode, new_sel_start, new_sel_end, spc;
 	char *bp, *obp;
@@ -124,21 +124,13 @@ int set_selection(const struct tiocl_selection *sel, struct tty_struct *tty, int
 
 	{ unsigned short xs, ys, xe, ye;
 
-	  if (user) {
-		  if (verify_area(VERIFY_READ, sel, sizeof(*sel)))
-		  	return -EFAULT;
-		  __get_user(xs, &sel->xs);
-		  __get_user(ys, &sel->ys);
-		  __get_user(xe, &sel->xe);
-		  __get_user(ye, &sel->ye);
-		  __get_user(sel_mode, &sel->sel_mode);
-	  } else {
-		  xs = sel->xs; /* set selection from kernel */
-		  ys = sel->ys;
-		  xe = sel->xe;
-		  ye = sel->ye;
-		  sel_mode = sel->sel_mode;
-	  }
+	  if (verify_area(VERIFY_READ, sel, sizeof(*sel)))
+		return -EFAULT;
+	  __get_user(xs, &sel->xs);
+	  __get_user(ys, &sel->ys);
+	  __get_user(xe, &sel->xe);
+	  __get_user(ye, &sel->ye);
+	  __get_user(sel_mode, &sel->sel_mode);
 	  xs--; ys--; xe--; ye--;
 	  xs = limit(xs, video_num_columns - 1);
 	  ys = limit(ys, video_num_lines - 1);
diff --git a/drivers/char/sn_serial.c b/drivers/char/sn_serial.c
index d87cf9372..c3ba299a5 100644
--- a/drivers/char/sn_serial.c
+++ b/drivers/char/sn_serial.c
@@ -502,7 +502,7 @@ sn_sal_connect_interrupt(void)
 	int result;
 
 	console_nasid = ia64_sn_get_console_nasid();
-	intr_cpuid = NODEPDA(NASID_TO_COMPACT_NODEID(console_nasid))->node_first_cpu;
+	intr_cpuid = first_cpu(node_to_cpumask(nasid_to_cnodeid(console_nasid)));
 	intr_cpuloc = cpu_physical_id(intr_cpuid);
 	console_irq = CPU_VECTOR_TO_IRQ(intr_cpuloc, SGI_UART_VECTOR);
 
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index a3780cdef..a906dfad2 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -461,8 +461,9 @@ static int sonypi_misc_open(struct inode * inode, struct file * file) {
 	return 0;
 }
 
-static ssize_t sonypi_misc_read(struct file * file, char * buf, 
-		                size_t count, loff_t *pos) {
+static ssize_t sonypi_misc_read(struct file * file, char __user * buf,
+			size_t count, loff_t *pos)
+{
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t i = count;
 	unsigned char c;
@@ -504,6 +505,7 @@ static unsigned int sonypi_misc_poll(struct file *file, poll_table * wait) {
 static int sonypi_misc_ioctl(struct inode *ip, struct file *fp, 
 			     unsigned int cmd, unsigned long arg) {
 	int ret = 0;
+	void __user *argp = (void __user *)arg;
 	u8 val8;
 	u16 val16;
 
@@ -514,11 +516,11 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
 			ret = -EIO;
 			break;
 		}
-		if (copy_to_user((u8 *)arg, &val8, sizeof(val8)))
+		if (copy_to_user(argp, &val8, sizeof(val8)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCSBRT:
-		if (copy_from_user(&val8, (u8 *)arg, sizeof(val8))) {
+		if (copy_from_user(&val8, argp, sizeof(val8))) {
 			ret = -EFAULT;
 			break;
 		}
@@ -530,7 +532,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
 			ret = -EIO;
 			break;
 		}
-		if (copy_to_user((u16 *)arg, &val16, sizeof(val16)))
+		if (copy_to_user(argp, &val16, sizeof(val16)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCGBAT1REM:
@@ -538,7 +540,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
 			ret = -EIO;
 			break;
 		}
-		if (copy_to_user((u16 *)arg, &val16, sizeof(val16)))
+		if (copy_to_user(argp, &val16, sizeof(val16)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCGBAT2CAP:
@@ -546,7 +548,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
 			ret = -EIO;
 			break;
 		}
-		if (copy_to_user((u16 *)arg, &val16, sizeof(val16)))
+		if (copy_to_user(argp, &val16, sizeof(val16)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCGBAT2REM:
@@ -554,7 +556,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
 			ret = -EIO;
 			break;
 		}
-		if (copy_to_user((u16 *)arg, &val16, sizeof(val16)))
+		if (copy_to_user(argp, &val16, sizeof(val16)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCGBATFLAGS:
@@ -563,16 +565,16 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
 			break;
 		}
 		val8 &= 0x07;
-		if (copy_to_user((u8 *)arg, &val8, sizeof(val8)))
+		if (copy_to_user(argp, &val8, sizeof(val8)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCGBLUE:
 		val8 = sonypi_device.bluetooth_power;
-		if (copy_to_user((u8 *)arg, &val8, sizeof(val8)))
+		if (copy_to_user(argp, &val8, sizeof(val8)))
 			ret = -EFAULT;
 		break;
 	case SONYPI_IOCSBLUE:
-		if (copy_from_user(&val8, (u8 *)arg, sizeof(val8))) {
+		if (copy_from_user(&val8, argp, sizeof(val8))) {
 			ret = -EFAULT;
 			break;
 		}
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index deefd713a..89f04b737 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -1,7 +1,7 @@
 /*
  * linux/drivers/char/synclink.c
  *
- * $Id: synclink.c,v 4.21 2004/03/08 15:29:22 paulkf Exp $
+ * $Id: synclink.c,v 4.24 2004/06/03 14:50:09 paulkf Exp $
  *
  * Device driver for Microgate SyncLink ISA and PCI
  * high speed multiprotocol serial adapters.
@@ -782,7 +782,6 @@ int mgsl_claim_resources(struct mgsl_struct *info);
 void mgsl_release_resources(struct mgsl_struct *info);
 void mgsl_add_device(struct mgsl_struct *info);
 struct mgsl_struct* mgsl_allocate_device(void);
-int mgsl_enum_isa_devices(void);
 
 /*
  * DMA buffer manupulation functions.
@@ -853,19 +852,22 @@ static int tiocmget(struct tty_struct *tty, struct file *file);
 static int tiocmset(struct tty_struct *tty, struct file *file,
 		    unsigned int set, unsigned int clear);
 static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount
-	*user_icount);
-static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS *user_params);
-static int mgsl_set_params(struct mgsl_struct * info, MGSL_PARAMS *new_params);
-static int mgsl_get_txidle(struct mgsl_struct * info, int*idle_mode);
+	__user *user_icount);
+static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS  __user *user_params);
+static int mgsl_set_params(struct mgsl_struct * info, MGSL_PARAMS  __user *new_params);
+static int mgsl_get_txidle(struct mgsl_struct * info, int __user *idle_mode);
 static int mgsl_set_txidle(struct mgsl_struct * info, int idle_mode);
 static int mgsl_txenable(struct mgsl_struct * info, int enable);
 static int mgsl_txabort(struct mgsl_struct * info);
 static int mgsl_rxenable(struct mgsl_struct * info, int enable);
-static int mgsl_wait_event(struct mgsl_struct * info, int * mask);
+static int mgsl_wait_event(struct mgsl_struct * info, int __user *mask);
 static int mgsl_loopmode_send_done( struct mgsl_struct * info );
 
 #define jiffies_from_ms(a) ((((a) * HZ)/1000)+1)
 
+/* set non-zero on successful registration with PCI subsystem */
+static int pci_registered;
+
 /*
  * Global linked list of SyncLink devices
  */
@@ -909,7 +911,7 @@ MODULE_PARM(txdmabufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
 MODULE_PARM(txholdbufs,"1-" __MODULE_STRING(MAX_TOTAL_DEVICES) "i");
 
 static char *driver_name = "SyncLink serial driver";
-static char *driver_version = "$Revision: 4.21 $";
+static char *driver_version = "$Revision: 4.24 $";
 
 static int synclink_init_one (struct pci_dev *dev,
 				     const struct pci_device_id *ent);
@@ -950,8 +952,10 @@ static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout);
  * (gdb) to get the .text address for the add-symbol-file command.
  * This allows remote debugging of dynamically loadable modules.
  */
-void* mgsl_get_text_ptr(void);
-void* mgsl_get_text_ptr() {return mgsl_get_text_ptr;}
+void* mgsl_get_text_ptr(void)
+{
+	return mgsl_get_text_ptr;
+}
 
 /*
  * tmp_buf is used as a temporary buffer by mgsl_write.  We need to
@@ -2521,7 +2525,7 @@ static void mgsl_unthrottle(struct tty_struct * tty)
  * 	
  * Return Value:	0 if success, otherwise error code
  */
-static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount *user_icount)
+static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount __user *user_icount)
 {
 	int err;
 	
@@ -2550,7 +2554,7 @@ static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount *user_ic
  * 	
  * Return Value:	0 if success, otherwise error code
  */
-static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS *user_params)
+static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS __user *user_params)
 {
 	int err;
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2580,7 +2584,7 @@ static int mgsl_get_params(struct mgsl_struct * info, MGSL_PARAMS *user_params)
  *
  * Return Value:	0 if success, otherwise error code
  */
-static int mgsl_set_params(struct mgsl_struct * info, MGSL_PARAMS *new_params)
+static int mgsl_set_params(struct mgsl_struct * info, MGSL_PARAMS __user *new_params)
 {
  	unsigned long flags;
 	MGSL_PARAMS tmp_params;
@@ -2616,7 +2620,7 @@ static int mgsl_set_params(struct mgsl_struct * info, MGSL_PARAMS *new_params)
  * 	
  * Return Value:	0 if success, otherwise error code
  */
-static int mgsl_get_txidle(struct mgsl_struct * info, int*idle_mode)
+static int mgsl_get_txidle(struct mgsl_struct * info, int __user *idle_mode)
 {
 	int err;
 	
@@ -2763,7 +2767,7 @@ static int mgsl_rxenable(struct mgsl_struct * info, int enable)
  *				of events triggerred,
  * 			otherwise error code
  */
-static int mgsl_wait_event(struct mgsl_struct * info, int * mask_ptr)
+static int mgsl_wait_event(struct mgsl_struct * info, int __user * mask_ptr)
 {
  	unsigned long flags;
 	int s;
@@ -3051,16 +3055,17 @@ int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long
 {
 	int error;
 	struct mgsl_icount cnow;	/* kernel counter temps */
-	struct serial_icounter_struct *p_cuser;	/* user space */
+	void __user *argp = (void __user *)arg;
+	struct serial_icounter_struct __user *p_cuser;	/* user space */
 	unsigned long flags;
 	
 	switch (cmd) {
 		case MGSL_IOCGPARAMS:
-			return mgsl_get_params(info,(MGSL_PARAMS *)arg);
+			return mgsl_get_params(info, argp);
 		case MGSL_IOCSPARAMS:
-			return mgsl_set_params(info,(MGSL_PARAMS *)arg);
+			return mgsl_set_params(info, argp);
 		case MGSL_IOCGTXIDLE:
-			return mgsl_get_txidle(info,(int*)arg);
+			return mgsl_get_txidle(info, argp);
 		case MGSL_IOCSTXIDLE:
 			return mgsl_set_txidle(info,(int)arg);
 		case MGSL_IOCTXENABLE:
@@ -3070,9 +3075,9 @@ int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long
 		case MGSL_IOCTXABORT:
 			return mgsl_txabort(info);
 		case MGSL_IOCGSTATS:
-			return mgsl_get_stats(info,(struct mgsl_icount*)arg);
+			return mgsl_get_stats(info, argp);
 		case MGSL_IOCWAITEVENT:
-			return mgsl_wait_event(info,(int*)arg);
+			return mgsl_wait_event(info, argp);
 		case MGSL_IOCLOOPTXDONE:
 			return mgsl_loopmode_send_done(info);
 		/* Wait for modem input (DCD,RI,DSR,CTS) change
@@ -3091,7 +3096,7 @@ int mgsl_ioctl_common(struct mgsl_struct *info, unsigned int cmd, unsigned long
 			spin_lock_irqsave(&info->irq_spinlock,flags);
 			cnow = info->icount;
 			spin_unlock_irqrestore(&info->irq_spinlock,flags);
-			p_cuser = (struct serial_icounter_struct *) arg;
+			p_cuser = argp;
 			PUT_USER(error,cnow.cts, &p_cuser->cts);
 			if (error) return error;
 			PUT_USER(error,cnow.dsr, &p_cuser->dsr);
@@ -4425,7 +4430,7 @@ void mgsl_add_device( struct mgsl_struct *info )
  * Arguments:		none
  * Return Value:	pointer to mgsl_struct if success, otherwise NULL
  */
-struct mgsl_struct* mgsl_allocate_device()
+struct mgsl_struct* mgsl_allocate_device(void)
 {
 	struct mgsl_struct *info;
 	
@@ -4484,10 +4489,11 @@ static struct tty_operations mgsl_ops = {
 /*
  * perform tty device initialization
  */
-int mgsl_init_tty(void);
-int mgsl_init_tty()
+static int mgsl_init_tty(void)
 {
-	serial_driver = alloc_tty_driver(mgsl_device_count);
+	int rc;
+
+	serial_driver = alloc_tty_driver(128);
 	if (!serial_driver)
 		return -ENOMEM;
 	
@@ -4503,9 +4509,13 @@ int mgsl_init_tty()
 		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
 	serial_driver->flags = TTY_DRIVER_REAL_RAW;
 	tty_set_operations(serial_driver, &mgsl_ops);
-	if (tty_register_driver(serial_driver) < 0)
+	if ((rc = tty_register_driver(serial_driver)) < 0) {
 		printk("%s(%d):Couldn't register serial driver\n",
 			__FILE__,__LINE__);
+		put_tty_driver(serial_driver);
+		serial_driver = NULL;
+		return rc;
+	}
 			
  	printk("%s %s, tty major#%d\n",
 		driver_name, driver_version,
@@ -4515,7 +4525,7 @@ int mgsl_init_tty()
 
 /* enumerate user specified ISA adapters
  */
-int mgsl_enum_isa_devices()
+static void mgsl_enum_isa_devices(void)
 {
 	struct mgsl_struct *info;
 	int i;
@@ -4546,51 +4556,9 @@ int mgsl_enum_isa_devices()
 		
 		mgsl_add_device( info );
 	}
-	
-	return 0;
 }
 
-/* mgsl_init()
- * 
- * 	Driver initialization entry point.
- * 	
- * Arguments:	None
- * Return Value:	0 if success, otherwise error code
- */
-int __init mgsl_init(void)
-{
-	int rc;
-
- 	printk("%s %s\n", driver_name, driver_version);
-	
-	mgsl_enum_isa_devices();
-	pci_register_driver(&synclink_pci_driver);
-
-	if ( !mgsl_device_list ) {
-		printk("%s(%d):No SyncLink devices found.\n",__FILE__,__LINE__);
-		return -ENODEV;
-	}
-	if ((rc = mgsl_init_tty()))
-		return rc;
-	
-	return 0;
-}
-
-static int __init synclink_init(void)
-{
-/* Uncomment this to kernel debug module.
- * mgsl_get_text_ptr() leaves the .text address in eax
- * which can be used with add-symbol-file with gdb.
- */
-	if (break_on_load) {
-	 	mgsl_get_text_ptr();
-  		BREAKPOINT();
-	}
-	
-	return mgsl_init();
-}
-
-static void __exit synclink_exit(void) 
+static void synclink_cleanup(void)
 {
 	int rc;
 	struct mgsl_struct *info;
@@ -4598,11 +4566,13 @@ static void __exit synclink_exit(void)
 
 	printk("Unloading %s: %s\n", driver_name, driver_version);
 
-	if ((rc = tty_unregister_driver(serial_driver)))
-		printk("%s(%d) failed to unregister tty driver err=%d\n",
-		       __FILE__,__LINE__,rc);
+	if (serial_driver) {
+		if ((rc = tty_unregister_driver(serial_driver)))
+			printk("%s(%d) failed to unregister tty driver err=%d\n",
+			       __FILE__,__LINE__,rc);
+		put_tty_driver(serial_driver);
+	}
 
-	put_tty_driver(serial_driver);
 	info = mgsl_device_list;
 	while(info) {
 #ifdef CONFIG_SYNCLINK_SYNCPPP
@@ -4620,7 +4590,40 @@ static void __exit synclink_exit(void)
 		tmp_buf = NULL;
 	}
 	
-	pci_unregister_driver(&synclink_pci_driver);
+	if (pci_registered)
+		pci_unregister_driver(&synclink_pci_driver);
+}
+
+static int __init synclink_init(void)
+{
+	int rc;
+
+	if (break_on_load) {
+	 	mgsl_get_text_ptr();
+  		BREAKPOINT();
+	}
+
+ 	printk("%s %s\n", driver_name, driver_version);
+
+	mgsl_enum_isa_devices();
+	if ((rc = pci_register_driver(&synclink_pci_driver)) < 0)
+		printk("%s:failed to register PCI driver, error=%d\n",__FILE__,rc);
+	else
+		pci_registered = 1;
+
+	if ((rc = mgsl_init_tty()) < 0)
+		goto error;
+
+	return 0;
+
+error:
+	synclink_cleanup();
+	return rc;
+}
+
+static void __exit synclink_exit(void)
+{
+	synclink_cleanup();
 }
 
 module_init(synclink_init);
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index d82335ed7..e76454311 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -1,5 +1,5 @@
 /*
- * $Id: synclinkmp.c,v 4.19 2004/03/08 15:29:23 paulkf Exp $
+ * $Id: synclinkmp.c,v 4.22 2004/06/03 14:50:10 paulkf Exp $
  *
  * Device driver for Microgate SyncLink Multiport
  * high speed multiprotocol serial adapter.
@@ -494,7 +494,7 @@ MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_DEVICES) "i");
 MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICES) "i");
 
 static char *driver_name = "SyncLink MultiPort driver";
-static char *driver_version = "$Revision: 4.19 $";
+static char *driver_version = "$Revision: 4.22 $";
 
 static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);
 static void synclinkmp_remove_one(struct pci_dev *dev);
@@ -3781,56 +3781,7 @@ static struct tty_operations ops = {
 	.tiocmset = tiocmset,
 };
 
-/* Driver initialization entry point.
- */
-
-static int __init synclinkmp_init(void)
-{
-	if (break_on_load) {
-	 	synclinkmp_get_text_ptr();
-  		BREAKPOINT();
-	}
-
- 	printk("%s %s\n", driver_name, driver_version);
-
-	synclinkmp_adapter_count = -1;
-	pci_register_driver(&synclinkmp_pci_driver);
-
-	if ( !synclinkmp_device_list ) {
-		printk("%s(%d):No SyncLink devices found.\n",__FILE__,__LINE__);
-		return -ENODEV;
-	}
-
-	serial_driver = alloc_tty_driver(synclinkmp_device_count);
-	if (!serial_driver)
-		return -ENOMEM;
-
-	/* Initialize the tty_driver structure */
-
-	serial_driver->owner = THIS_MODULE;
-	serial_driver->driver_name = "synclinkmp";
-	serial_driver->name = "ttySLM";
-	serial_driver->major = ttymajor;
-	serial_driver->minor_start = 64;
-	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;
-	tty_set_operations(serial_driver, &ops);
-	if (tty_register_driver(serial_driver) < 0)
-		printk("%s(%d):Couldn't register serial driver\n",
-			__FILE__,__LINE__);
-
- 	printk("%s %s, tty major#%d\n",
-		driver_name, driver_version,
-		serial_driver->major);
-
-	return 0;
-}
-
-static void __exit synclinkmp_exit(void)
+static void synclinkmp_cleanup(void)
 {
 	unsigned long flags;
 	int rc;
@@ -3839,10 +3790,12 @@ static void __exit synclinkmp_exit(void)
 
 	printk("Unloading %s %s\n", driver_name, driver_version);
 
-	if ((rc = tty_unregister_driver(serial_driver)))
-		printk("%s(%d) failed to unregister tty driver err=%d\n",
-		       __FILE__,__LINE__,rc);
-	put_tty_driver(serial_driver);
+	if (serial_driver) {
+		if ((rc = tty_unregister_driver(serial_driver)))
+			printk("%s(%d) failed to unregister tty driver err=%d\n",
+			       __FILE__,__LINE__,rc);
+		put_tty_driver(serial_driver);
+	}
 
 	info = synclinkmp_device_list;
 	while(info) {
@@ -3882,6 +3835,69 @@ static void __exit synclinkmp_exit(void)
 	pci_unregister_driver(&synclinkmp_pci_driver);
 }
 
+/* Driver initialization entry point.
+ */
+
+static int __init synclinkmp_init(void)
+{
+	int rc;
+
+	if (break_on_load) {
+	 	synclinkmp_get_text_ptr();
+  		BREAKPOINT();
+	}
+
+ 	printk("%s %s\n", driver_name, driver_version);
+
+	if ((rc = pci_register_driver(&synclinkmp_pci_driver)) < 0) {
+		printk("%s:failed to register PCI driver, error=%d\n",__FILE__,rc);
+		return rc;
+	}
+
+	serial_driver = alloc_tty_driver(128);
+	if (!serial_driver) {
+		rc = -ENOMEM;
+		goto error;
+	}
+
+	/* Initialize the tty_driver structure */
+
+	serial_driver->owner = THIS_MODULE;
+	serial_driver->driver_name = "synclinkmp";
+	serial_driver->name = "ttySLM";
+	serial_driver->major = ttymajor;
+	serial_driver->minor_start = 64;
+	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;
+	tty_set_operations(serial_driver, &ops);
+	if ((rc = tty_register_driver(serial_driver)) < 0) {
+		printk("%s(%d):Couldn't register serial driver\n",
+			__FILE__,__LINE__);
+		put_tty_driver(serial_driver);
+		serial_driver = NULL;
+		goto error;
+	}
+
+ 	printk("%s %s, tty major#%d\n",
+		driver_name, driver_version,
+		serial_driver->major);
+
+	return 0;
+
+error:
+	synclinkmp_cleanup();
+	return rc;
+}
+
+static void __exit synclinkmp_exit(void)
+{
+	synclinkmp_cleanup();
+}
+
 module_init(synclinkmp_init);
 module_exit(synclinkmp_exit);
 
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 249935804..da52bff37 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -312,37 +312,19 @@ void __sysrq_put_key_op (int key, struct sysrq_key_op *op_p) {
                 sysrq_key_table[i] = op_p;
 }
 
-/*
- * This function is called by the keyboard handler when SysRq is pressed
- * and any other keycode arrives.
- */
-
-void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
-{
-	if (!sysrq_enabled)
-		return;
-
-	__sysrq_lock_table();
-	__handle_sysrq_nolock(key, pt_regs, tty);
-	__sysrq_unlock_table();
-}
-
 /*
  * This is the non-locking version of handle_sysrq
  * It must/can only be called by sysrq key handlers,
  * as they are inside of the lock
  */
 
-void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
-		  	   struct tty_struct *tty) 
+void __handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
 {
 	struct sysrq_key_op *op_p;
 	int orig_log_level;
 	int i, j;
-	
-	if (!sysrq_enabled)
-		return;
 
+	__sysrq_lock_table();
 	orig_log_level = console_loglevel;
 	console_loglevel = 7;
 	printk(KERN_INFO "SysRq : ");
@@ -364,10 +346,22 @@ void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
 		printk ("\n");
 		console_loglevel = orig_log_level;
 	}
+	__sysrq_unlock_table();
+}
+
+/*
+ * This function is called by the keyboard handler when SysRq is pressed
+ * and any other keycode arrives.
+ */
+
+void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
+{
+	if (!sysrq_enabled)
+		return;
+	__handle_sysrq(key, pt_regs, tty);
 }
 
 EXPORT_SYMBOL(handle_sysrq);
-EXPORT_SYMBOL(__handle_sysrq_nolock);
 EXPORT_SYMBOL(__sysrq_lock_table);
 EXPORT_SYMBOL(__sysrq_unlock_table);
 EXPORT_SYMBOL(__sysrq_get_key_op);
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index 3632e2864..8cbf15bb5 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -58,6 +58,7 @@
 #include <asm/bitops.h>
 #include <linux/devfs_fs_kernel.h>	/* DevFs support */
 #include <linux/parport.h>	/* Our code depend on parport */
+#include <linux/device.h>
 
 /*
  * TI definitions
@@ -92,6 +93,8 @@ static int timeout = TIMAXTIME;	/* timeout in tenth of seconds     */
 static unsigned int tp_count;	/* tipar count */
 static unsigned long opened;	/* opened devices */
 
+static struct class_simple *tipar_class;
+
 /* --- macros for parport access -------------------------------------- */
 
 #define r_dtr(x)        (parport_read_data(table[(x)].dev->port))
@@ -424,18 +427,26 @@ tipar_setup(char *str)
 static int
 tipar_register(int nr, struct parport *port)
 {
+	int err = 0;
+
 	/* Register our module into parport */
 	table[nr].dev = parport_register_device(port, "tipar",
 						NULL, NULL, NULL, 0,
 						(void *) &table[nr]);
 
-	if (table[nr].dev == NULL)
-		return 1;
+	if (table[nr].dev == NULL) {
+		err = 1;
+		goto out;
+	}
 
+	class_simple_device_add(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
+			NULL, "par%d", nr);
 	/* Use devfs, tree: /dev/ticables/par/[0..2] */
-	devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
+	err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
 			S_IFCHR | S_IRUGO | S_IWUGO,
 			"ticables/par/%d", nr);
+	if (err)
+		goto out_class;
 
 	/* Display informations */
 	printk(KERN_INFO "tipar%d: using %s (%s).\n", nr, port->name,
@@ -447,7 +458,14 @@ tipar_register(int nr, struct parport *port)
 	else
 		printk("tipar%d: link cable not found.\n", nr);
 
-	return 0;
+	err = 0;
+	goto out;
+
+out_class:
+	class_simple_device_remove(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr));
+	class_simple_destroy(tipar_class);
+out:
+	return err;
 }
 
 static void
@@ -477,23 +495,38 @@ static struct parport_driver tipar_driver = {
 int __init
 tipar_init_module(void)
 {
+	int err = 0;
+
 	printk("tipar: parallel link cable driver, version %s\n",
 	       DRIVER_VERSION);
 
 	if (register_chrdev(TIPAR_MAJOR, "tipar", &tipar_fops)) {
 		printk("tipar: unable to get major %d\n", TIPAR_MAJOR);
-		return -EIO;
+		err = -EIO;
+		goto out;
 	}
 
 	/* Use devfs with tree: /dev/ticables/par/[0..2] */
 	devfs_mk_dir("ticables/par");
 
+	tipar_class = class_simple_create(THIS_MODULE, "ticables");
+	if (IS_ERR(tipar_class)) {
+		err = PTR_ERR(tipar_class);
+		goto out_chrdev;
+	}
 	if (parport_register_driver(&tipar_driver)) {
 		printk("tipar: unable to register with parport\n");
-		return -EIO;
+		err = -EIO;
+		goto out;
 	}
 
-	return 0;
+	err = 0;
+	goto out;
+
+out_chrdev:
+	unregister_chrdev(TIPAR_MAJOR, "tipar");
+out:
+	return err;	
 }
 
 void __exit
@@ -510,8 +543,10 @@ tipar_cleanup_module(void)
 		if (table[i].dev == NULL)
 			continue;
 		parport_unregister_device(table[i].dev);
+		class_simple_device_remove(MKDEV(TIPAR_MAJOR, i));
 		devfs_remove("ticables/par/%d", i);
 	}
+	class_simple_destroy(tipar_class);
 	devfs_remove("ticables/par");
 
 	printk("tipar: module unloaded !\n");
diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c
index 15e2c72ed..5b84af027 100644
--- a/drivers/char/toshiba.c
+++ b/drivers/char/toshiba.c
@@ -251,13 +251,14 @@ static int tosh_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 	unsigned long arg)
 {
 	SMMRegisters regs;
+	SMMRegisters __user *argp = (SMMRegisters __user *)arg;
 	unsigned short ax,bx;
 	int err;
 
-	if (!arg)
+	if (!argp)
 		return -EINVAL;
 
-	if (copy_from_user(&regs, (SMMRegisters *) arg, sizeof(SMMRegisters)))
+	if (copy_from_user(&regs, argp, sizeof(SMMRegisters)))
 		return -EFAULT;
 
 	switch (cmd) {
@@ -281,7 +282,7 @@ static int tosh_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 			return -EINVAL;
 	}
 
-        if (copy_to_user((SMMRegisters *) arg, &regs, sizeof(SMMRegisters)))
+        if (copy_to_user(argp, &regs, sizeof(SMMRegisters)))
         	return -EFAULT;
 
 	return (err==0) ? 0:-EINVAL;
diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
index 698c2c451..6ee95af21 100644
--- a/drivers/char/tpqic02.c
+++ b/drivers/char/tpqic02.c
@@ -1727,7 +1727,7 @@ static irqreturn_t qic02_tape_interrupt(int irq, void *dev_id,
  * request would return the EOF flag for the previous file.
  */
 
-static ssize_t qic02_tape_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_tape_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 {
 	int type = iminor(filp->f_dentry->d_inode);
 	unsigned short flags = filp->f_flags;
@@ -1905,7 +1905,7 @@ static ssize_t qic02_tape_read(struct file *filp, char *buf, size_t count, loff_
  * tape device again. The driver will detect an exception status in (No Cartridge)
  * and force a rewind. After that tar may continue writing.
  */
-static ssize_t qic02_tape_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_tape_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 {
 	int type = iminor(filp->f_dentry->d_inode);
 	unsigned short flags = filp->f_flags;
@@ -2400,6 +2400,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 	struct mtop operation;
 	unsigned char blk_addr[6];
 	struct mtpos ioctl_tell;
+	void __user *argp = (void __user *)ioarg;
 
 
 	if (TP_DIAGS(current_type))
@@ -2416,7 +2417,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 	if (c == _IOC_NR(MTIOCGETCONFIG)) {
 		CHECK_IOC_SIZE(mtconfiginfo);
 
-		if (copy_to_user((char *) ioarg, (char *) &qic02_tape_dynconf, sizeof(qic02_tape_dynconf)))
+		if (copy_to_user(argp, &qic02_tape_dynconf, sizeof(qic02_tape_dynconf)))
 			return -EFAULT;
 		return 0;
 	} else if (c == _IOC_NR(MTIOCSETCONFIG)) {
@@ -2438,7 +2439,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 			qic02_release_resources();	/* and go zombie */
 
 		/* copy struct from user space to kernel space */
-		if (copy_from_user((char *) &qic02_tape_dynconf, (char *) ioarg, sizeof(qic02_tape_dynconf)))
+		if (copy_from_user(&qic02_tape_dynconf, argp, sizeof(qic02_tape_dynconf)))
 			return -EFAULT;
 		
 		return update_ifc_masks(qic02_tape_dynconf.ifc_type);
@@ -2452,7 +2453,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 		CHECK_IOC_SIZE(mtop);
 
 		/* copy mtop struct from user space to kernel space */
-		if (copy_from_user((char *) &operation, (char *) ioarg, sizeof(operation)))
+		if (copy_from_user(&operation, argp, sizeof(operation)))
 			return -EFAULT;
 
 		/* ---note: mt_count is signed, negative seeks must be
@@ -2507,7 +2508,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 		 */
 
 		/* copy results to user space */
-		if (copy_to_user((char *) ioarg, (char *) &ioctl_status, sizeof(ioctl_status)))
+		if (copy_to_user(argp, &ioctl_status, sizeof(ioctl_status)))
 			return -EFAULT;
 		return 0;
 	} else if (TP_HAVE_TELL && (c == _IOC_NR(MTIOCPOS))) {
@@ -2527,7 +2528,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 		ioctl_tell.mt_blkno = (blk_addr[3] << 16) | (blk_addr[4] << 8) | blk_addr[5];
 
 		/* copy results to user space */
-		if (copy_to_user((char *) ioarg, (char *) &ioctl_tell, sizeof(ioctl_tell)))
+		if (copy_to_user(argp, &ioctl_tell, sizeof(ioctl_tell)))
 			return -EFAULT;
 		return 0;
 
@@ -2536,7 +2537,7 @@ static int qic02_tape_ioctl(struct inode *inode, struct file *filp, unsigned int
 }				/* qic02_tape_ioctl */
 
 
-static ssize_t qic02_do_tape_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_do_tape_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 {
 	int err;
 	
@@ -2547,7 +2548,7 @@ static ssize_t qic02_do_tape_read(struct file *filp, char *buf, size_t count, lo
 	return err;
 }
 
-static ssize_t qic02_do_tape_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+static ssize_t qic02_do_tape_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 {
 	int err;
 
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e4607d86a..0c762379a 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -134,9 +134,9 @@ extern void disable_early_printk(void);
 
 static void initialize_tty_struct(struct tty_struct *tty);
 
-static ssize_t tty_read(struct file *, char *, size_t, loff_t *);
-static ssize_t tty_write(struct file *, const char *, size_t, loff_t *);
-ssize_t redirected_tty_write(struct file *, const char *, size_t, loff_t *);
+static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *);
+ssize_t redirected_tty_write(struct file *, const char __user *, size_t, loff_t *);
 static unsigned int tty_poll(struct file *, poll_table *);
 static int tty_open(struct inode *, struct file *);
 static int tty_release(struct inode *, struct file *);
@@ -339,7 +339,7 @@ int tty_check_change(struct tty_struct * tty)
 
 EXPORT_SYMBOL(tty_check_change);
 
-static ssize_t hung_up_tty_read(struct file * file, char * buf,
+static ssize_t hung_up_tty_read(struct file * file, char __user * buf,
 				size_t count, loff_t *ppos)
 {
 	/* Can't seek (pread) on ttys.  */
@@ -348,7 +348,7 @@ static ssize_t hung_up_tty_read(struct file * file, char * buf,
 	return 0;
 }
 
-static ssize_t hung_up_tty_write(struct file * file, const char * buf,
+static ssize_t hung_up_tty_write(struct file * file, const char __user * buf,
 				 size_t count, loff_t *ppos)
 {
 	/* Can't seek (pwrite) on ttys.  */
@@ -638,7 +638,7 @@ void start_tty(struct tty_struct *tty)
 
 EXPORT_SYMBOL(start_tty);
 
-static ssize_t tty_read(struct file * file, char * buf, size_t count, 
+static ssize_t tty_read(struct file * file, char __user * buf, size_t count, 
 			loff_t *ppos)
 {
 	int i;
@@ -672,10 +672,10 @@ static ssize_t tty_read(struct file * file, char * buf, size_t count,
  * denial-of-service type attacks
  */
 static inline ssize_t do_tty_write(
-	ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t),
+	ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char __user *, size_t),
 	struct tty_struct *tty,
 	struct file *file,
-	const unsigned char *buf,
+	const unsigned char __user *buf,
 	size_t count)
 {
 	ssize_t ret = 0, written = 0;
@@ -717,7 +717,7 @@ static inline ssize_t do_tty_write(
 }
 
 
-static ssize_t tty_write(struct file * file, const char * buf, size_t count,
+static ssize_t tty_write(struct file * file, const char __user * buf, size_t count,
 			 loff_t *ppos)
 {
 	struct tty_struct * tty;
@@ -735,10 +735,10 @@ static ssize_t tty_write(struct file * file, const char * buf, size_t count,
 	if (!tty->ldisc.write)
 		return -EIO;
 	return do_tty_write(tty->ldisc.write, tty, file,
-			    (const unsigned char *)buf, count);
+			    (const unsigned char __user *)buf, count);
 }
 
-ssize_t redirected_tty_write(struct file * file, const char * buf, size_t count,
+ssize_t redirected_tty_write(struct file * file, const char __user * buf, size_t count,
 			 loff_t *ppos)
 {
 	struct file *p = NULL;
@@ -1266,6 +1266,18 @@ static void release_dev(struct file * filp)
 	printk(KERN_DEBUG "freeing tty structure...");
 #endif
 
+	/*
+	 * Prevent flush_to_ldisc() from rescheduling the work for later.  Then
+	 * kill any delayed work.
+	 */
+	clear_bit(TTY_DONT_FLIP, &tty->flags);
+	cancel_delayed_work(&tty->flip.work);
+
+	/*
+	 * Wait for ->hangup_work and ->flip.work handlers to terminate
+	 */
+	flush_scheduled_work();
+
 	/*
 	 * Shutdown the current line discipline, and reset it to N_TTY.
 	 * N.B. why reset ldisc when we're releasing the memory??
@@ -1282,18 +1294,6 @@ static void release_dev(struct file * filp)
 		module_put(o_tty->ldisc.owner);
 		o_tty->ldisc = ldiscs[N_TTY];
 	}
-	
-	/*
-	 * Prevent flush_to_ldisc() from rescheduling the work for later.  Then
-	 * kill any delayed work.
-	 */
-	clear_bit(TTY_DONT_FLIP, &tty->flags);
-	cancel_delayed_work(&tty->flip.work);
-
-	/*
-	 * Wait for ->hangup_work and ->flip.work handlers to terminate
-	 */
-	flush_scheduled_work();
 
 	/* 
 	 * The release_mem function takes care of the details of clearing
@@ -1490,19 +1490,19 @@ static int tty_fasync(int fd, struct file * filp, int on)
 	return 0;
 }
 
-static int tiocsti(struct tty_struct *tty, char * arg)
+static int tiocsti(struct tty_struct *tty, char __user *p)
 {
 	char ch, mbz = 0;
 
 	if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
-	if (get_user(ch, arg))
+	if (get_user(ch, p))
 		return -EFAULT;
 	tty->ldisc.receive_buf(tty, &ch, &mbz, 1);
 	return 0;
 }
 
-static int tiocgwinsz(struct tty_struct *tty, struct winsize * arg)
+static int tiocgwinsz(struct tty_struct *tty, struct winsize __user * arg)
 {
 	if (copy_to_user(arg, &tty->winsize, sizeof(*arg)))
 		return -EFAULT;
@@ -1510,7 +1510,7 @@ static int tiocgwinsz(struct tty_struct *tty, struct winsize * arg)
 }
 
 static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty,
-	struct winsize * arg)
+	struct winsize __user * arg)
 {
 	struct winsize tmp_ws;
 
@@ -1565,11 +1565,11 @@ static int tioccons(struct file *file)
 }
 
 
-static int fionbio(struct file *file, int *arg)
+static int fionbio(struct file *file, int __user *p)
 {
 	int nonblock;
 
-	if (get_user(nonblock, arg))
+	if (get_user(nonblock, p))
 		return -EFAULT;
 
 	if (nonblock)
@@ -1620,7 +1620,7 @@ static int tiocsctty(struct tty_struct *tty, int arg)
 	return 0;
 }
 
-static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t *arg)
+static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p)
 {
 	/*
 	 * (tty == real_tty) is a cheap way of
@@ -1628,10 +1628,10 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
 	 */
 	if (tty == real_tty && current->signal->tty != real_tty)
 		return -ENOTTY;
-	return put_user(real_tty->pgrp, arg);
+	return put_user(real_tty->pgrp, p);
 }
 
-static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t *arg)
+static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p)
 {
 	pid_t pgrp;
 	int retval = tty_check_change(real_tty);
@@ -1644,7 +1644,7 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
 	    (current->signal->tty != real_tty) ||
 	    (real_tty->session != current->signal->session))
 		return -ENOTTY;
-	if (get_user(pgrp, (pid_t *) arg))
+	if (get_user(pgrp, p))
 		return -EFAULT;
 	if (pgrp < 0)
 		return -EINVAL;
@@ -1654,7 +1654,7 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
 	return 0;
 }
 
-static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t *arg)
+static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p)
 {
 	/*
 	 * (tty == real_tty) is a cheap way of
@@ -1664,14 +1664,14 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t *
 		return -ENOTTY;
 	if (real_tty->session <= 0)
 		return -ENOTTY;
-	return put_user(real_tty->session, arg);
+	return put_user(real_tty->session, p);
 }
 
-static int tiocsetd(struct tty_struct *tty, int *arg)
+static int tiocsetd(struct tty_struct *tty, int __user *p)
 {
 	int ldisc;
 
-	if (get_user(ldisc, arg))
+	if (get_user(ldisc, p))
 		return -EFAULT;
 	return tty_set_ldisc(tty, ldisc);
 }
@@ -1690,7 +1690,7 @@ static int send_break(struct tty_struct *tty, int duration)
 }
 
 static int
-tty_tiocmget(struct tty_struct *tty, struct file *file, unsigned long arg)
+tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p)
 {
 	int retval = -EINVAL;
 
@@ -1698,21 +1698,21 @@ tty_tiocmget(struct tty_struct *tty, struct file *file, unsigned long arg)
 		retval = tty->driver->tiocmget(tty, file);
 
 		if (retval >= 0)
-			retval = put_user(retval, (int *)arg);
+			retval = put_user(retval, p);
 	}
 	return retval;
 }
 
 static int
 tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int cmd,
-	     unsigned long arg)
+	     unsigned __user *p)
 {
 	int retval = -EINVAL;
 
 	if (tty->driver->tiocmset) {
 		unsigned int set, clear, val;
 
-		retval = get_user(val, (unsigned int *)arg);
+		retval = get_user(val, p);
 		if (retval)
 			return retval;
 
@@ -1745,6 +1745,7 @@ int tty_ioctl(struct inode * inode, struct file * file,
 	      unsigned int cmd, unsigned long arg)
 {
 	struct tty_struct *tty, *real_tty;
+	void __user *p = (void __user *)arg;
 	int retval;
 	
 	tty = (struct tty_struct *)file->private_data;
@@ -1802,15 +1803,15 @@ int tty_ioctl(struct inode * inode, struct file * file,
 
 	switch (cmd) {
 		case TIOCSTI:
-			return tiocsti(tty, (char *)arg);
+			return tiocsti(tty, p);
 		case TIOCGWINSZ:
-			return tiocgwinsz(tty, (struct winsize *) arg);
+			return tiocgwinsz(tty, p);
 		case TIOCSWINSZ:
-			return tiocswinsz(tty, real_tty, (struct winsize *) arg);
+			return tiocswinsz(tty, real_tty, p);
 		case TIOCCONS:
 			return real_tty!=tty ? -EINVAL : tioccons(file);
 		case FIONBIO:
-			return fionbio(file, (int *) arg);
+			return fionbio(file, p);
 		case TIOCEXCL:
 			set_bit(TTY_EXCLUSIVE, &tty->flags);
 			return 0;
@@ -1829,15 +1830,15 @@ int tty_ioctl(struct inode * inode, struct file * file,
 		case TIOCSCTTY:
 			return tiocsctty(tty, arg);
 		case TIOCGPGRP:
-			return tiocgpgrp(tty, real_tty, (pid_t *) arg);
+			return tiocgpgrp(tty, real_tty, p);
 		case TIOCSPGRP:
-			return tiocspgrp(tty, real_tty, (pid_t *) arg);
+			return tiocspgrp(tty, real_tty, p);
 		case TIOCGSID:
-			return tiocgsid(tty, real_tty, (pid_t *) arg);
+			return tiocgsid(tty, real_tty, p);
 		case TIOCGETD:
-			return put_user(tty->ldisc.num, (int *) arg);
+			return put_user(tty->ldisc.num, (int __user *)p);
 		case TIOCSETD:
-			return tiocsetd(tty, (int *) arg);
+			return tiocsetd(tty, p);
 #ifdef CONFIG_VT
 		case TIOCLINUX:
 			return tioclinux(tty, arg);
@@ -1865,12 +1866,12 @@ int tty_ioctl(struct inode * inode, struct file * file,
 			return send_break(tty, arg ? arg*(HZ/10) : HZ/4);
 
 		case TIOCMGET:
-			return tty_tiocmget(tty, file, arg);
+			return tty_tiocmget(tty, file, p);
 
 		case TIOCMSET:
 		case TIOCMBIC:
 		case TIOCMBIS:
-			return tty_tiocmset(tty, file, cmd, arg);
+			return tty_tiocmset(tty, file, cmd, p);
 	}
 	if (tty->driver->ioctl) {
 		int retval = (tty->driver->ioctl)(tty, file, cmd, arg);
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 81eff0d25..ae924c7cb 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -140,7 +140,7 @@ static void change_termios(struct tty_struct * tty, struct termios * new_termios
 		(*tty->ldisc.set_termios)(tty, &old_termios);
 }
 
-static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
+static int set_termios(struct tty_struct * tty, void __user *arg, int opt)
 {
 	struct termios tmp_termios;
 	int retval = tty_check_change(tty);
@@ -151,11 +151,11 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
 	if (opt & TERMIOS_TERMIO) {
 		memcpy(&tmp_termios, tty->termios, sizeof(struct termios));
 		if (user_termio_to_kernel_termios(&tmp_termios,
-						  (struct termio *) arg))
+						(struct termio __user *)arg))
 			return -EFAULT;
 	} else {
 		if (user_termios_to_kernel_termios(&tmp_termios,
-						   (struct termios *) arg))
+						(struct termios __user *)arg))
 			return -EFAULT;
 	}
 
@@ -172,7 +172,7 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
 	return 0;
 }
 
-static int get_termio(struct tty_struct * tty, struct termio * termio)
+static int get_termio(struct tty_struct * tty, struct termio __user * termio)
 {
 	if (kernel_termios_to_user_termio(termio, tty->termios))
 		return -EFAULT;
@@ -222,7 +222,7 @@ static int get_sgflags(struct tty_struct * tty)
 	return flags;
 }
 
-static int get_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
+static int get_sgttyb(struct tty_struct * tty, struct sgttyb __user * sgttyb)
 {
 	struct sgttyb tmp;
 
@@ -260,7 +260,7 @@ static void set_sgflags(struct termios * termios, int flags)
 	}
 }
 
-static int set_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
+static int set_sgttyb(struct tty_struct * tty, struct sgttyb __user * sgttyb)
 {
 	int retval;
 	struct sgttyb tmp;
@@ -281,7 +281,7 @@ static int set_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
 #endif
 
 #ifdef TIOCGETC
-static int get_tchars(struct tty_struct * tty, struct tchars * tchars)
+static int get_tchars(struct tty_struct * tty, struct tchars __user * tchars)
 {
 	struct tchars tmp;
 
@@ -294,7 +294,7 @@ static int get_tchars(struct tty_struct * tty, struct tchars * tchars)
 	return copy_to_user(tchars, &tmp, sizeof(tmp)) ? -EFAULT : 0;
 }
 
-static int set_tchars(struct tty_struct * tty, struct tchars * tchars)
+static int set_tchars(struct tty_struct * tty, struct tchars __user * tchars)
 {
 	struct tchars tmp;
 
@@ -311,7 +311,7 @@ static int set_tchars(struct tty_struct * tty, struct tchars * tchars)
 #endif
 
 #ifdef TIOCGLTC
-static int get_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
+static int get_ltchars(struct tty_struct * tty, struct ltchars __user * ltchars)
 {
 	struct ltchars tmp;
 
@@ -324,7 +324,7 @@ static int get_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
 	return copy_to_user(ltchars, &tmp, sizeof(tmp)) ? -EFAULT : 0;
 }
 
-static int set_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
+static int set_ltchars(struct tty_struct * tty, struct ltchars __user * ltchars)
 {
 	struct ltchars tmp;
 
@@ -363,6 +363,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
 		       unsigned int cmd, unsigned long arg)
 {
 	struct tty_struct * real_tty;
+	void __user *p = (void __user *)arg;
 	int retval;
 
 	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
@@ -374,41 +375,41 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
 	switch (cmd) {
 #ifdef TIOCGETP
 		case TIOCGETP:
-			return get_sgttyb(real_tty, (struct sgttyb *) arg);
+			return get_sgttyb(real_tty, (struct sgttyb __user *) arg);
 		case TIOCSETP:
 		case TIOCSETN:
-			return set_sgttyb(real_tty, (struct sgttyb *) arg);
+			return set_sgttyb(real_tty, (struct sgttyb __user *) arg);
 #endif
 #ifdef TIOCGETC
 		case TIOCGETC:
-			return get_tchars(real_tty, (struct tchars *) arg);
+			return get_tchars(real_tty, p);
 		case TIOCSETC:
-			return set_tchars(real_tty, (struct tchars *) arg);
+			return set_tchars(real_tty, p);
 #endif
 #ifdef TIOCGLTC
 		case TIOCGLTC:
-			return get_ltchars(real_tty, (struct ltchars *) arg);
+			return get_ltchars(real_tty, p);
 		case TIOCSLTC:
-			return set_ltchars(real_tty, (struct ltchars *) arg);
+			return set_ltchars(real_tty, p);
 #endif
 		case TCGETS:
-			if (kernel_termios_to_user_termios((struct termios *)arg, real_tty->termios))
+			if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios))
 				return -EFAULT;
 			return 0;
 		case TCSETSF:
-			return set_termios(real_tty, arg,  TERMIOS_FLUSH | TERMIOS_WAIT);
+			return set_termios(real_tty, p,  TERMIOS_FLUSH | TERMIOS_WAIT);
 		case TCSETSW:
-			return set_termios(real_tty, arg, TERMIOS_WAIT);
+			return set_termios(real_tty, p, TERMIOS_WAIT);
 		case TCSETS:
-			return set_termios(real_tty, arg, 0);
+			return set_termios(real_tty, p, 0);
 		case TCGETA:
-			return get_termio(real_tty,(struct termio *) arg);
+			return get_termio(real_tty, p);
 		case TCSETAF:
-			return set_termios(real_tty, arg, TERMIOS_FLUSH | TERMIOS_WAIT | TERMIOS_TERMIO);
+			return set_termios(real_tty, p, TERMIOS_FLUSH | TERMIOS_WAIT | TERMIOS_TERMIO);
 		case TCSETAW:
-			return set_termios(real_tty, arg, TERMIOS_WAIT | TERMIOS_TERMIO);
+			return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO);
 		case TCSETA:
-			return set_termios(real_tty, arg, TERMIOS_TERMIO);
+			return set_termios(real_tty, p, TERMIOS_TERMIO);
 		case TCXONC:
 			retval = tty_check_change(tty);
 			if (retval)
@@ -462,21 +463,21 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
 		case TIOCOUTQ:
 			return put_user(tty->driver->chars_in_buffer ?
 					tty->driver->chars_in_buffer(tty) : 0,
-					(int *) arg);
+					(int __user *) arg);
 		case TIOCINQ:
 			retval = tty->read_cnt;
 			if (L_ICANON(tty))
 				retval = inq_canon(tty);
-			return put_user(retval, (unsigned int *) arg);
+			return put_user(retval, (unsigned int __user *) arg);
 		case TIOCGLCKTRMIOS:
-			if (kernel_termios_to_user_termios((struct termios *)arg, real_tty->termios_locked))
+			if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
 				return -EFAULT;
 			return 0;
 
 		case TIOCSLCKTRMIOS:
 			if (!capable(CAP_SYS_ADMIN))
 				return -EPERM;
-			if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios *) arg))
+			if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
 				return -EFAULT;
 			return 0;
 
@@ -487,7 +488,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
 			if (tty->driver->type != TTY_DRIVER_TYPE_PTY ||
 			    tty->driver->subtype != PTY_TYPE_MASTER)
 				return -ENOTTY;
-			if (get_user(pktmode, (int *) arg))
+			if (get_user(pktmode, (int __user *) arg))
 				return -EFAULT;
 			if (pktmode) {
 				if (!tty->packet) {
@@ -499,9 +500,9 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
 			return 0;
 		}
 		case TIOCGSOFTCAR:
-			return put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg);
+			return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg);
 		case TIOCSSOFTCAR:
-			if (get_user(arg, (unsigned int *) arg))
+			if (get_user(arg, (unsigned int __user *) arg))
 				return -EFAULT;
 			tty->termios->c_cflag =
 				((tty->termios->c_cflag & ~CLOCAL) |
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 5b51a76b2..c357ab7f9 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -102,7 +102,7 @@ extern char con_buf[PAGE_SIZE];
 extern struct semaphore con_buf_sem;
 
 static ssize_t
-vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
 	unsigned int currcons = iminor(inode);
@@ -271,7 +271,7 @@ unlock_out:
 }
 
 static ssize_t
-vcs_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
 	unsigned int currcons = iminor(inode);
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index f3d43dcdd..521b6fbff 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -152,7 +152,7 @@ static void gotoxy(int currcons, int new_x, int new_y);
 static void save_cur(int currcons);
 static void reset_terminal(int currcons, int do_clear);
 static void con_flush_chars(struct tty_struct *tty);
-static void set_vesa_blanking(unsigned long arg);
+static void set_vesa_blanking(char __user *p);
 static void set_cursor(int currcons);
 static void hide_cursor(int currcons);
 static void console_callback(void *ignored);
@@ -661,11 +661,14 @@ int vc_cons_allocated(unsigned int i)
 static void visual_init(int currcons, int init)
 {
     /* ++Geert: sw->con_init determines console size */
+    if (sw)
+	module_put(sw->owner);
     sw = conswitchp;
 #ifndef VT_SINGLE_DRIVER
     if (con_driver_map[currcons])
 	sw = con_driver_map[currcons];
 #endif
+    __module_get(sw->owner);
     cons_num = currcons;
     display_fg = &master_display_fg;
     vc_cons[currcons].d->vc_uni_pagedir_loc = &vc_cons[currcons].d->vc_uni_pagedir;
@@ -773,17 +776,17 @@ int vc_resize(int currcons, unsigned int cols, unsigned int lines)
 	old_row_size = video_size_row;
 	old_screen_size = screenbuf_size;
 
-	video_num_lines = new_rows;
-	video_num_columns = new_cols;
-	video_size_row = new_row_size;
-	screenbuf_size = new_screen_size;
-
 	err = resize_screen(currcons, new_cols, new_rows);
 	if (err) {
 		kfree(newscreen);
 		return err;
 	}
 
+	video_num_lines = new_rows;
+	video_num_columns = new_cols;
+	video_size_row = new_row_size;
+	screenbuf_size = new_screen_size;
+
 	rlth = min(old_row_size, new_row_size);
 	rrem = new_row_size - rlth;
 	old_origin = origin;
@@ -808,8 +811,6 @@ int vc_resize(int currcons, unsigned int cols, unsigned int lines)
 	screenbuf = newscreen;
 	kmalloced = 1;
 	screenbuf_size = new_screen_size;
-	if (IS_VISIBLE)
-		err = resize_screen(currcons, new_cols, new_rows);
 	set_origin(currcons);
 
 	/* do part of a reset_terminal() */
@@ -2273,6 +2274,7 @@ struct console vt_console_driver = {
 int tioclinux(struct tty_struct *tty, unsigned long arg)
 {
 	char type, data;
+	char __user *p = (char __user *)arg;
 	int lines;
 	int ret;
 
@@ -2280,14 +2282,14 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
 		return -EINVAL;
 	if (current->signal->tty != tty && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
-	if (get_user(type, (char *)arg))
+	if (get_user(type, p))
 		return -EFAULT;
 	ret = 0;
 	switch (type)
 	{
 		case TIOCL_SETSEL:
 			acquire_console_sem();
-			ret = set_selection((struct tiocl_selection *)((char *)arg+1), tty, 1);
+			ret = set_selection((struct tiocl_selection __user *)(p+1), tty);
 			release_console_sem();
 			break;
 		case TIOCL_PASTESEL:
@@ -2297,7 +2299,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
 			unblank_screen();
 			break;
 		case TIOCL_SELLOADLUT:
-			ret = sel_loadlut(arg);
+			ret = sel_loadlut(p);
 			break;
 		case TIOCL_GETSHIFTSTATE:
 			
@@ -2308,20 +2310,20 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
 	 * related to the kernel should not use this.
 	 */
 	 		data = shift_state;
-			ret = __put_user(data, (char *) arg);
+			ret = __put_user(data, p);
 			break;
 		case TIOCL_GETMOUSEREPORTING:
 			data = mouse_reporting();
-			ret = __put_user(data, (char *) arg);
+			ret = __put_user(data, p);
 			break;
 		case TIOCL_SETVESABLANK:
-			set_vesa_blanking(arg);
+			set_vesa_blanking(p);
 			break;
 		case TIOCL_SETKMSGREDIRECT:
 			if (!capable(CAP_SYS_ADMIN)) {
 				ret = -EPERM;
 			} else {
-				if (get_user(data, (char *)arg+1))
+				if (get_user(data, p+1))
 					ret = -EFAULT;
 				else
 					kmsg_redirect = data;
@@ -2331,7 +2333,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
 			ret = fg_console;
 			break;
 		case TIOCL_SCROLLCONSOLE:
-			if (get_user(lines, (s32 *)((char *)arg+4))) {
+			if (get_user(lines, (s32 __user *)(p+4))) {
 				ret = -EFAULT;
 			} else {
 				scrollfront(lines);
@@ -2668,25 +2670,38 @@ static void clear_buffer_attributes(int currcons)
  *	and become default driver for newly opened ones.
  */
 
-void take_over_console(const struct consw *csw, int first, int last, int deflt)
+int take_over_console(const struct consw *csw, int first, int last, int deflt)
 {
 	int i, j = -1;
 	const char *desc;
+	struct module *owner;
+
+	owner = csw->owner;
+	if (!try_module_get(owner))
+		return -ENODEV;
 
 	acquire_console_sem();
 
 	desc = csw->con_startup();
 	if (!desc) {
 		release_console_sem();
-		return;
+		module_put(owner);
+		return -ENODEV;
 	}
-	if (deflt)
+	if (deflt) {
+		if (conswitchp)
+			module_put(conswitchp->owner);
+		__module_get(owner);
 		conswitchp = csw;
+	}
 
 	for (i = first; i <= last; i++) {
 		int old_was_color;
 		int currcons = i;
 
+		if (con_driver_map[i])
+			module_put(con_driver_map[i]->owner);
+		__module_get(owner);
 		con_driver_map[i] = csw;
 
 		if (!vc_cons[i].d || !vc_cons[i].d->vc_sw)
@@ -2721,6 +2736,9 @@ void take_over_console(const struct consw *csw, int first, int last, int deflt)
 		printk("to %s\n", desc);
 
 	release_console_sem();
+
+	module_put(owner);
+	return 0;
 }
 
 void give_up_console(const struct consw *csw)
@@ -2728,8 +2746,10 @@ void give_up_console(const struct consw *csw)
 	int i;
 
 	for(i = 0; i < MAX_NR_CONSOLES; i++)
-		if (con_driver_map[i] == csw)
+		if (con_driver_map[i] == csw) {
+			module_put(csw->owner);
 			con_driver_map[i] = NULL;
+		}
 }
 
 #endif
@@ -2738,11 +2758,10 @@ void give_up_console(const struct consw *csw)
  *	Screen blanking
  */
 
-static void set_vesa_blanking(unsigned long arg)
+static void set_vesa_blanking(char __user *p)
 {
-    char *argp = (char *)arg + 1;
     unsigned int mode;
-    get_user(mode, argp);
+    get_user(mode, p + 1);
     vesa_blank_mode = (mode < 4) ? mode : 0;
 }
 
@@ -2918,7 +2937,7 @@ void set_palette(int currcons)
 		sw->con_set_palette(vc_cons[currcons].d, color_table);
 }
 
-static int set_get_cmap(unsigned char *arg, int set)
+static int set_get_cmap(unsigned char __user *arg, int set)
 {
     int i, j, k;
 
@@ -2953,7 +2972,7 @@ static int set_get_cmap(unsigned char *arg, int set)
  * map, 3 bytes per colour, 16 colours, range from 0 to 255.
  */
 
-int con_set_cmap(unsigned char *arg)
+int con_set_cmap(unsigned char __user *arg)
 {
 	int rc;
 
@@ -2964,7 +2983,7 @@ int con_set_cmap(unsigned char *arg)
 	return rc;
 }
 
-int con_get_cmap(unsigned char *arg)
+int con_get_cmap(unsigned char __user *arg)
 {
 	int rc;
 
@@ -3018,7 +3037,8 @@ int con_font_op(int currcons, struct console_font_op *op)
 			goto quit;
 		if (!op->height) {		/* Need to guess font height [compat] */
 			int h, i;
-			u8 *charmap = op->data, tmp;
+			u8 __user *charmap = op->data;
+			u8 tmp;
 			
 			/* If from KDFONTOP ioctl, don't allow things which can be done in userland,
 			   so that we can get rid of this soon */
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 0685fe7be..2cd1770eb 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -75,7 +75,7 @@ unsigned char keyboard_type = KB_101;
 #define s (tmp.kb_table)
 #define v (tmp.kb_value)
 static inline int
-do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kbd)
+do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_struct *kbd)
 {
 	struct kbentry tmp;
 	ushort *key_map, val, ov;
@@ -160,7 +160,7 @@ do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kb
 #undef v
 
 static inline int 
-do_kbkeycode_ioctl(int cmd, struct kbkeycode *user_kbkc, int perm)
+do_kbkeycode_ioctl(int cmd, struct kbkeycode __user *user_kbkc, int perm)
 {
 	struct kbkeycode tmp;
 	int kc = 0;
@@ -183,11 +183,12 @@ do_kbkeycode_ioctl(int cmd, struct kbkeycode *user_kbkc, int perm)
 }
 
 static inline int
-do_kdgkb_ioctl(int cmd, struct kbsentry *user_kdgkb, int perm)
+do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm)
 {
 	struct kbsentry *kbs;
 	char *p;
 	u_char *q;
+	u_char __user *up;
 	int sz;
 	int delta;
 	char *first_free, *fj, *fnw;
@@ -212,15 +213,15 @@ do_kdgkb_ioctl(int cmd, struct kbsentry *user_kdgkb, int perm)
 	case KDGKBSENT:
 		sz = sizeof(kbs->kb_string) - 1; /* sz should have been
 						  a struct member */
-		q = user_kdgkb->kb_string;
+		up = user_kdgkb->kb_string;
 		p = func_table[i];
 		if(p)
 			for ( ; *p && sz; p++, sz--)
-				if (put_user(*p, q++)) {
+				if (put_user(*p, up++)) {
 					ret = -EFAULT;
 					goto reterr;
 				}
-		if (put_user('\0', q)) {
+		if (put_user('\0', up)) {
 			ret = -EFAULT;
 			goto reterr;
 		}
@@ -292,7 +293,7 @@ reterr:
 }
 
 static inline int 
-do_fontx_ioctl(int cmd, struct consolefontdesc *user_cfd, int perm, struct console_font_op *op)
+do_fontx_ioctl(int cmd, struct consolefontdesc __user *user_cfd, int perm, struct console_font_op *op)
 {
 	struct consolefontdesc cfdarg;
 	int i;
@@ -332,7 +333,7 @@ do_fontx_ioctl(int cmd, struct consolefontdesc *user_cfd, int perm, struct conso
 }
 
 static inline int 
-do_unimap_ioctl(int cmd, struct unimapdesc *user_ud, int perm, unsigned int console)
+do_unimap_ioctl(int cmd, struct unimapdesc __user *user_ud, int perm, unsigned int console)
 {
 	struct unimapdesc tmp;
 	int i = 0; 
@@ -370,6 +371,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	struct kbd_struct * kbd;
 	unsigned int console;
 	unsigned char ucval;
+	void __user *up = (void __user *)arg;
 	int i, perm;
 	
 	console = vt->vc_num;
@@ -453,14 +455,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 		if (!capable(CAP_SYS_TTY_CONFIG))
 			return -EPERM;
 
-		if (copy_from_user(&kbrep, (void *)arg,
-				   sizeof(struct kbd_repeat)))
+		if (copy_from_user(&kbrep, up, sizeof(struct kbd_repeat)))
 			return -EFAULT;
 		err = kbd_rate(&kbrep);
 		if (err)
 			return err;
-		if (copy_to_user((void *)arg, &kbrep,
-				 sizeof(struct kbd_repeat)))
+		if (copy_to_user(up, &kbrep, sizeof(struct kbd_repeat)))
 			return -EFAULT;
 		return 0;
 	}
@@ -565,25 +565,25 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	case KDGKBMETA:
 		ucval = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT);
 	setint:
-		return put_user(ucval, (int *)arg); 
+		return put_user(ucval, (int __user *)arg); 
 
 	case KDGETKEYCODE:
 	case KDSETKEYCODE:
 		if(!capable(CAP_SYS_TTY_CONFIG))
 			perm=0;
-		return do_kbkeycode_ioctl(cmd, (struct kbkeycode *)arg, perm);
+		return do_kbkeycode_ioctl(cmd, up, perm);
 
 	case KDGKBENT:
 	case KDSKBENT:
-		return do_kdsk_ioctl(cmd, (struct kbentry *)arg, perm, kbd);
+		return do_kdsk_ioctl(cmd, up, perm, kbd);
 
 	case KDGKBSENT:
 	case KDSKBSENT:
-		return do_kdgkb_ioctl(cmd, (struct kbsentry *)arg, perm);
+		return do_kdgkb_ioctl(cmd, up, perm);
 
 	case KDGKBDIACR:
 	{
-		struct kbdiacrs *a = (struct kbdiacrs *)arg;
+		struct kbdiacrs __user *a = up;
 
 		if (put_user(accent_table_size, &a->kb_cnt))
 			return -EFAULT;
@@ -594,7 +594,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 
 	case KDSKBDIACR:
 	{
-		struct kbdiacrs *a = (struct kbdiacrs *)arg;
+		struct kbdiacrs __user *a = up;
 		unsigned int ct;
 
 		if (!perm)
@@ -630,7 +630,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	case KDGETLED:
 		ucval = getledstate();
 	setchar:
-		return put_user(ucval, (char*)arg);
+		return put_user(ucval, (char __user *)arg);
 
 	case KDSETLED:
 		if (!perm)
@@ -643,10 +643,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	 * generated by pressing an appropriate key combination.
 	 * Thus, one can have a daemon that e.g. spawns a new console
 	 * upon a keypress and then changes to it.
-	 * Probably init should be changed to do this (and have a
-	 * field ks (`keyboard signal') in inittab describing the
-	 * desired action), so that the number of background daemons
-	 * does not increase.
+	 * See also the kbrequest field of inittab(5).
 	 */
 	case KDSIGACCEPT:
 	{
@@ -666,7 +663,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 
 		if (!perm)
 			return -EPERM;
-		if (copy_from_user(&tmp, (void*)arg, sizeof(struct vt_mode)))
+		if (copy_from_user(&tmp, up, sizeof(struct vt_mode)))
 			return -EFAULT;
 		if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS)
 			return -EINVAL;
@@ -690,7 +687,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 		memcpy(&tmp, &vt_cons[console]->vt_mode, sizeof(struct vt_mode));
 		release_console_sem();
 
-		rc = copy_to_user((void*)arg, &tmp, sizeof(struct vt_mode));
+		rc = copy_to_user(up, &tmp, sizeof(struct vt_mode));
 		return rc ? -EFAULT : 0;
 	}
 
@@ -701,7 +698,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	 */
 	case VT_GETSTATE:
 	{
-		struct vt_stat *vtstat = (struct vt_stat *)arg;
+		struct vt_stat __user *vtstat = up;
 		unsigned short state, mask;
 
 		if (put_user(fg_console + 1, &vtstat->v_active))
@@ -847,7 +844,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 
 	case VT_RESIZE:
 	{
-		struct vt_sizes *vtsizes = (struct vt_sizes *) arg;
+		struct vt_sizes __user *vtsizes = up;
 		ushort ll,cc;
 		if (!perm)
 			return -EPERM;
@@ -864,11 +861,11 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 
 	case VT_RESIZEX:
 	{
-		struct vt_consize *vtconsize = (struct vt_consize *) arg;
+		struct vt_consize __user *vtconsize = up;
 		ushort ll,cc,vlin,clin,vcol,ccol;
 		if (!perm)
 			return -EPERM;
-		if (verify_area(VERIFY_READ, (void *)vtconsize,
+		if (verify_area(VERIFY_READ, vtconsize,
 				sizeof(struct vt_consize)))
 			return -EFAULT;
 		__get_user(ll, &vtconsize->v_rows);
@@ -935,14 +932,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	case PIO_CMAP:
                 if (!perm)
 			return -EPERM;
-                return con_set_cmap((char *)arg);
+                return con_set_cmap(up);
 
 	case GIO_CMAP:
-                return con_get_cmap((char *)arg);
+                return con_get_cmap(up);
 
 	case PIO_FONTX:
 	case GIO_FONTX:
-		return do_fontx_ioctl(cmd, (struct consolefontdesc *)arg, perm, &op);
+		return do_fontx_ioctl(cmd, up, perm, &op);
 
 	case PIO_FONTRESET:
 	{
@@ -966,13 +963,13 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	}
 
 	case KDFONTOP: {
-		if (copy_from_user(&op, (void *) arg, sizeof(op)))
+		if (copy_from_user(&op, up, sizeof(op)))
 			return -EFAULT;
 		if (!perm && op.op != KD_FONT_OP_GET)
 			return -EPERM;
 		i = con_font_op(console, &op);
 		if (i) return i;
-		if (copy_to_user((void *) arg, &op, sizeof(op)))
+		if (copy_to_user(up, &op, sizeof(op)))
 			return -EFAULT;
 		return 0;
 	}
@@ -980,24 +977,24 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 	case PIO_SCRNMAP:
 		if (!perm)
 			return -EPERM;
-		return con_set_trans_old((unsigned char *)arg);
+		return con_set_trans_old(up);
 
 	case GIO_SCRNMAP:
-		return con_get_trans_old((unsigned char *)arg);
+		return con_get_trans_old(up);
 
 	case PIO_UNISCRNMAP:
 		if (!perm)
 			return -EPERM;
-		return con_set_trans_new((unsigned short *)arg);
+		return con_set_trans_new(up);
 
 	case GIO_UNISCRNMAP:
-		return con_get_trans_new((unsigned short *)arg);
+		return con_get_trans_new(up);
 
 	case PIO_UNIMAPCLR:
 	      { struct unimapinit ui;
 		if (!perm)
 			return -EPERM;
-		i = copy_from_user(&ui, (void *)arg, sizeof(struct unimapinit));
+		i = copy_from_user(&ui, up, sizeof(struct unimapinit));
 		if (i) return -EFAULT;
 		con_clear_unimap(console, &ui);
 		return 0;
@@ -1005,7 +1002,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 
 	case PIO_UNIMAP:
 	case GIO_UNIMAP:
-		return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm, console);
+		return do_unimap_ioctl(cmd, up, perm, console);
 
 	case VT_LOCKSWITCH:
 		if (!capable(CAP_SYS_TTY_CONFIG))
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index 7cd60dc50..c2b2dec80 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -84,6 +84,17 @@ config 977_WATCHDOG
 
 	  Not sure? It's safe to say N.
 
+config IXP4XX_WATCHDOG
+	tristate "IXP4xx Watchdog"
+	depends on WATCHDOG && ARCH_IXP4XX
+	help
+	  Say Y here if to include support for the watchdog timer
+	  in the Intel IXP4xx network processors. This driver can
+	  be built as a module by choosing M. The module will
+	  be called ixp4xx_wdt.
+
+	  Say N if you are unsure.
+
 config SA1100_WATCHDOG
 	tristate "SA1100 watchdog"
 	depends on WATCHDOG && ARCH_SA1100
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
index 6eb9a783d..76d260550 100644
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -35,3 +35,4 @@ obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
 obj-$(CONFIG_INDYDOG) += indydog.o
 obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o
 obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
+obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
index eeeefab42..9a3207d81 100644
--- a/drivers/char/watchdog/alim1535_wdt.c
+++ b/drivers/char/watchdog/alim1535_wdt.c
@@ -16,6 +16,7 @@
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/fs.h>
 #include <linux/pci.h>
 
 #include <asm/uaccess.h>
diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
index fb62ddb8f..00baec945 100644
--- a/drivers/char/watchdog/alim7101_wdt.c
+++ b/drivers/char/watchdog/alim7101_wdt.c
@@ -24,6 +24,7 @@
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/fs.h>
 #include <linux/pci.h>
 
 #include <asm/io.h>
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
index 14afe80a5..2e259a10f 100644
--- a/drivers/char/watchdog/ib700wdt.c
+++ b/drivers/char/watchdog/ib700wdt.c
@@ -135,7 +135,7 @@ static void
 ibwdt_ping(void)
 {
 	/* Write a watchdog value */
-	outb_p(wd_times[wd_margin], WDT_START);
+	outb_p(wd_margin, WDT_START);
 }
 
 static ssize_t
@@ -234,7 +234,7 @@ ibwdt_close(struct inode *inode, struct file *file)
 {
 	spin_lock(&ibwdt_lock);
 	if (expect_close == 42)
-		outb_p(wd_times[wd_margin], WDT_STOP);
+		outb_p(0, WDT_STOP);
 	else
 		printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
 
@@ -254,7 +254,7 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code,
 {
 	if (code == SYS_DOWN || code == SYS_HALT) {
 		/* Turn the WDT off */
-		outb_p(wd_times[wd_margin], WDT_STOP);
+		outb_p(0, WDT_STOP);
 	}
 	return NOTIFY_DONE;
 }
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
index bd24b5348..295e11461 100644
--- a/drivers/char/watchdog/pcwd.c
+++ b/drivers/char/watchdog/pcwd.c
@@ -70,7 +70,7 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-#define WD_VER                  "1.16 (03/27/2004)"
+#define WD_VER                  "1.16 (06/12/2004)"
 #define PFX			"pcwd: "
 
 /*
@@ -299,10 +299,11 @@ static int pcwd_stop(void)
 	return 0;
 }
 
-static void pcwd_keepalive(void)
+static int pcwd_keepalive(void)
 {
 	/* user land ping */
 	next_heartbeat = jiffies + (heartbeat * HZ);
+	return 0;
 }
 
 static int pcwd_set_heartbeat(int t)
@@ -404,6 +405,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
 	int status;
 	int temperature;
 	int new_heartbeat;
+	int __user *argp = (int __user *)arg;
 	static struct watchdog_info ident = {
 		.options =		WDIOF_OVERHEAT |
 					WDIOF_CARDRESET |
@@ -419,27 +421,27 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
 		return -ENOIOCTLCMD;
 
 	case WDIOC_GETSUPPORT:
-		if(copy_to_user((void*)arg, &ident, sizeof(ident)))
+		if(copy_to_user(argp, &ident, sizeof(ident)))
 			return -EFAULT;
 		return 0;
 
 	case WDIOC_GETSTATUS:
 		pcwd_get_status(&status);
-		return put_user(status, (int *) arg);
+		return put_user(status, argp);
 
 	case WDIOC_GETBOOTSTATUS:
-		return put_user(initial_status, (int *) arg);
+		return put_user(initial_status, argp);
 
 	case WDIOC_GETTEMP:
 		if (pcwd_get_temperature(&temperature))
 			return -EFAULT;
 
-		return put_user(temperature, (int *) arg);
+		return put_user(temperature, argp);
 
 	case WDIOC_SETOPTIONS:
 		if (revision == PCWD_REVISION_C)
 		{
-			if(copy_from_user(&rv, (int*) arg, sizeof(int)))
+			if(copy_from_user(&rv, argp, sizeof(int)))
 				return -EFAULT;
 
 			if (rv & WDIOS_DISABLECARD)
@@ -464,7 +466,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case WDIOC_SETTIMEOUT:
-		if (get_user(new_heartbeat, (int *) arg))
+		if (get_user(new_heartbeat, argp))
 			return -EFAULT;
 
 		if (pcwd_set_heartbeat(new_heartbeat))
@@ -474,13 +476,13 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
 		/* Fall */
 
 	case WDIOC_GETTIMEOUT:
-		return put_user(heartbeat, (int *)arg);
+		return put_user(heartbeat, argp);
 	}
 
 	return 0;
 }
 
-static ssize_t pcwd_write(struct file *file, const char *buf, size_t len,
+static ssize_t pcwd_write(struct file *file, const char __user *buf, size_t len,
 			  loff_t *ppos)
 {
 	/*  Can't seek (pwrite) on this device  */
@@ -528,12 +530,12 @@ static int pcwd_close(struct inode *inode, struct file *file)
 {
 	if (expect_close == 42) {
 		pcwd_stop();
-		atomic_inc( &open_allowed );
 	} else {
 		printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
 		pcwd_keepalive();
 	}
 	expect_close = 0;
+	atomic_inc( &open_allowed );
 	return 0;
 }
 
@@ -541,7 +543,7 @@ static int pcwd_close(struct inode *inode, struct file *file)
  *	/dev/temperature handling
  */
 
-static ssize_t pcwd_temp_read(struct file *file, char *buf, size_t count,
+static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
 			 loff_t *ppos)
 {
 	int temperature;
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
index e24694c3e..0b3c727e5 100644
--- a/drivers/char/watchdog/pcwd_pci.c
+++ b/drivers/char/watchdog/pcwd_pci.c
@@ -49,7 +49,7 @@
 
 /* Module and version information */
 #define WATCHDOG_VERSION "1.00"
-#define WATCHDOG_DATE "13/03/2004"
+#define WATCHDOG_DATE "12 Jun 2004"
 #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
 #define WATCHDOG_NAME "pcwd_pci"
 #define PFX WATCHDOG_NAME ": "
@@ -73,7 +73,7 @@
 #define WD_PCI_TTRP             0x04	/* Temperature Trip status */
 
 /* according to documentation max. time to process a command for the pci
-   watchdog card is 100 ms, so we give it 150 ms to do it's job */
+ * watchdog card is 100 ms, so we give it 150 ms to do it's job */
 #define PCI_COMMAND_TIMEOUT	150
 
 /* Watchdog's internal commands */
@@ -404,8 +404,8 @@ static int pcipcwd_release(struct inode *inode, struct file *file)
 		printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
 		pcipcwd_keepalive();
 	}
-	clear_bit(0, &is_active);
 	expect_release = 0;
+	clear_bit(0, &is_active);
 	return 0;
 }
 
@@ -585,15 +585,12 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
 		printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
 
 	/* Check that the heartbeat value is within it's range ; if not reset to the default */
-	if (heartbeat < 1 || heartbeat > 0xFFFF) {
-		heartbeat = WATCHDOG_HEARTBEAT;
+	if (pcipcwd_set_heartbeat(heartbeat)) {
+		pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
 		printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-			heartbeat);
+			WATCHDOG_HEARTBEAT);
 	}
 
-	/* Calculate the watchdog's heartbeat */
-	pcipcwd_set_heartbeat(heartbeat);
-
 	ret = register_reboot_notifier(&pcipcwd_notifier);
 	if (ret != 0) {
 		printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
@@ -601,29 +598,30 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
 		goto err_out_release_region;
 	}
 
-	ret = misc_register(&pcipcwd_miscdev);
-	if (ret != 0) {
-		printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-			WATCHDOG_MINOR, ret);
-		goto err_out_unregister_reboot;
-	}
-
 	if (pcipcwd_private.supports_temp) {
 		ret = misc_register(&pcipcwd_temp_miscdev);
 		if (ret != 0) {
 			printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
 				TEMP_MINOR, ret);
-			goto err_out_misc_deregister;
+			goto err_out_unregister_reboot;
 		}
 	}
 
+	ret = misc_register(&pcipcwd_miscdev);
+	if (ret != 0) {
+		printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+			WATCHDOG_MINOR, ret);
+		goto err_out_misc_deregister;
+	}
+
 	printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
 		heartbeat, nowayout);
 
 	return 0;
 
 err_out_misc_deregister:
-	misc_deregister(&pcipcwd_miscdev);
+	if (pcipcwd_private.supports_temp)
+		misc_deregister(&pcipcwd_temp_miscdev);
 err_out_unregister_reboot:
 	unregister_reboot_notifier(&pcipcwd_notifier);
 err_out_release_region:
@@ -640,9 +638,9 @@ static void __devexit pcipcwd_card_exit(struct pci_dev *pdev)
 		pcipcwd_stop();
 
 	/* Deregister */
+	misc_deregister(&pcipcwd_miscdev);
 	if (pcipcwd_private.supports_temp)
 		misc_deregister(&pcipcwd_temp_miscdev);
-	misc_deregister(&pcipcwd_miscdev);
 	unregister_reboot_notifier(&pcipcwd_notifier);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
index d88228eb5..0f4c1ca0c 100644
--- a/drivers/char/watchdog/pcwd_usb.c
+++ b/drivers/char/watchdog/pcwd_usb.c
@@ -56,7 +56,8 @@
 
 
 /* Module and Version Information */
-#define DRIVER_VERSION "v1.00 (28/02/2004)"
+#define DRIVER_VERSION "1.00"
+#define DRIVER_DATE "12 Jun 2004"
 #define DRIVER_AUTHOR "Wim Van Sebroeck <wim@iguana.be>"
 #define DRIVER_DESC "Berkshire USB-PC Watchdog driver"
 #define DRIVER_LICENSE "GPL"
@@ -456,8 +457,8 @@ static int usb_pcwd_release(struct inode *inode, struct file *file)
 		printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
 		usb_pcwd_keepalive(usb_pcwd_device);
 	}
-	clear_bit(0, &is_active);
 	expect_release = 0;
+	clear_bit(0, &is_active);
 	return 0;
 }
 
@@ -681,15 +682,12 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
 		((option_switches & 0x08) ? "ON" : "OFF"));
 
 	/* Check that the heartbeat value is within it's range ; if not reset to the default */
-	if (heartbeat < 1 || heartbeat > 0xFFFF) {
-		heartbeat = WATCHDOG_HEARTBEAT;
+	if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) {
+		usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT);
 		printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-			heartbeat);
+			WATCHDOG_HEARTBEAT);
 	}
 
-	/* Calculate the watchdog's heartbeat */
-	usb_pcwd_set_heartbeat(usb_pcwd, heartbeat);
-
 	retval = register_reboot_notifier(&usb_pcwd_notifier);
 	if (retval != 0) {
 		printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
@@ -697,17 +695,17 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
 		goto error;
 	}
 
-	retval = misc_register(&usb_pcwd_miscdev);
+	retval = misc_register(&usb_pcwd_temperature_miscdev);
 	if (retval != 0) {
 		printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-			WATCHDOG_MINOR, retval);
+			TEMP_MINOR, retval);
 		goto err_out_unregister_reboot;
 	}
 
-	retval = misc_register(&usb_pcwd_temperature_miscdev);
+	retval = misc_register(&usb_pcwd_miscdev);
 	if (retval != 0) {
 		printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-			TEMP_MINOR, retval);
+			WATCHDOG_MINOR, retval);
 		goto err_out_misc_deregister;
 	}
 
@@ -720,7 +718,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
 	return 0;
 
 err_out_misc_deregister:
-	misc_deregister(&usb_pcwd_miscdev);
+	misc_deregister(&usb_pcwd_temperature_miscdev);
 err_out_unregister_reboot:
 	unregister_reboot_notifier(&usb_pcwd_notifier);
 error:
@@ -758,8 +756,8 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
 	usb_pcwd->exists = 0;
 
 	/* Deregister */
-	misc_deregister(&usb_pcwd_temperature_miscdev);
 	misc_deregister(&usb_pcwd_miscdev);
+	misc_deregister(&usb_pcwd_temperature_miscdev);
 	unregister_reboot_notifier(&usb_pcwd_notifier);
 
 	up (&usb_pcwd->sem);
@@ -791,7 +789,7 @@ static int __init usb_pcwd_init(void)
 		return result;
 	}
 
-	printk(KERN_INFO PFX DRIVER_DESC " " DRIVER_VERSION "\n");
+	printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION " (" DRIVER_DATE ")\n");
 	return 0;
 }
 
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
index c0bfea220..b7e48851f 100644
--- a/drivers/char/watchdog/sc1200wdt.c
+++ b/drivers/char/watchdog/sc1200wdt.c
@@ -38,6 +38,7 @@
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/pnp.h>
+#include <linux/fs.h>
 #include <linux/pci.h>
 
 #include <asm/semaphore.h>
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c
index ce99e3664..b54c47b72 100644
--- a/drivers/char/watchdog/sc520_wdt.c
+++ b/drivers/char/watchdog/sc520_wdt.c
@@ -23,22 +23,25 @@
  *	-	Switched to private locks not lock_kernel
  *	-	Used ioremap/writew/readw
  *	-	Added NOWAYOUT support
- *
- *     4/12 - 2002 Changes by Rob Radez <rob@osinvestor.com>
- *     -       Change comments
- *     -       Eliminate fop_llseek
- *     -       Change CONFIG_WATCHDOG_NOWAYOUT semantics
- *     -       Add KERN_* tags to printks
- *     -       fix possible wdt_is_open race
- *     -       Report proper capabilities in watchdog_info
- *     -       Add WDIOC_{GETSTATUS, GETBOOTSTATUS, SETTIMEOUT,
- *             GETTIMEOUT, SETOPTIONS} ioctls
- *     09/8 - 2003 Changes by Wim Van Sebroeck <wim@iguana.be>
- *     -       cleanup of trailing spaces
- *     -       added extra printk's for startup problems
- *     -       use module_param
- *     -       made timeout (the emulated heartbeat) a module_param
- *     -       made the keepalive ping an internal subroutine
+ *	4/12 - 2002 Changes by Rob Radez <rob@osinvestor.com>
+ *	-	Change comments
+ *	-	Eliminate fop_llseek
+ *	-	Change CONFIG_WATCHDOG_NOWAYOUT semantics
+ *	-	Add KERN_* tags to printks
+ *	-	fix possible wdt_is_open race
+ *	-	Report proper capabilities in watchdog_info
+ *	-	Add WDIOC_{GETSTATUS, GETBOOTSTATUS, SETTIMEOUT,
+ *		GETTIMEOUT, SETOPTIONS} ioctls
+ *	09/8 - 2003 Changes by Wim Van Sebroeck <wim@iguana.be>
+ *	-	cleanup of trailing spaces
+ *	-	added extra printk's for startup problems
+ *	-	use module_param
+ *	-	made timeout (the emulated heartbeat) a module_param
+ *	-	made the keepalive ping an internal subroutine
+ *	3/27 - 2004 Changes by Sean Young <sean@mess.org>
+ *	-	set MMCR_BASE to 0xfffef000
+ *	-	CBAR does not need to be read
+ *	-	removed debugging printks
  *
  *  This WDT driver is different from most other Linux WDT
  *  drivers in that the driver will ping the watchdog by itself,
@@ -65,8 +68,16 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
+#define OUR_NAME "sc520_wdt"
+#define PFX OUR_NAME ": "
+
 /*
- * The SC520 can timeout anywhere from 492us to 32.21s.
+ * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7)
+ *
+ *   0: 492us    2: 1.01s    4: 4.03s   6: 16.22s
+ *   1: 503ms    3: 2.01s    5: 8.05s   7: 32.21s
+ *
+ * We will program the SC520 watchdog for a timeout of 2.01s.
  * If we reset the watchdog every ~250ms we should be safe.
  */
 
@@ -83,25 +94,33 @@ static int timeout = WATCHDOG_TIMEOUT;	/* in seconds, will be multiplied by HZ t
 module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
 
-/*
- * AMD Elan SC520 timeout value is 492us times a power of 2 (0-7)
- *
- *   0: 492us    2: 1.01s    4: 4.03s   6: 16.22s
- *   1: 503ms    3: 2.01s    5: 8.05s   7: 32.21s
- */
-
-#define TIMEOUT_EXPONENT ( 1 << 3 )  /* 0x08 = 2.01s */
-
-/* #define MMCR_BASE_DEFAULT 0xfffef000 */
-#define MMCR_BASE_DEFAULT ((__u16 *)0xffffe)
-#define OFFS_WDTMRCTL ((unsigned int)0xcb0)
-#define WDT_ENB 0x8000		/* [15] Watchdog Timer Enable */
-#define WDT_WRST_ENB 0x4000	/* [14] Watchdog Timer Reset Enable */
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+static int nowayout = 1;
+#else
+static int nowayout = 0;
+#endif
 
-#define OUR_NAME "sc520_wdt"
-#define PFX OUR_NAME ": "
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
-#define WRT_DOG(data) *wdtmrctl=data
+/*
+ * AMD Elan SC520 - Watchdog Timer Registers
+ */
+#define MMCR_BASE	0xfffef000	/* The default base address */
+#define OFFS_WDTMRCTL	0xCB0	/* Watchdog Timer Control Register */
+
+/* WDT Control Register bit definitions */
+#define WDT_EXP_SEL_01	0x0001	/* [01] Time-out = 496 us (with 33 Mhz clk). */
+#define WDT_EXP_SEL_02	0x0002	/* [02] Time-out = 508 ms (with 33 Mhz clk). */
+#define WDT_EXP_SEL_03	0x0004	/* [03] Time-out = 1.02 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_04	0x0008	/* [04] Time-out = 2.03 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_05	0x0010	/* [05] Time-out = 4.07 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_06	0x0020	/* [06] Time-out = 8.13 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_07	0x0040	/* [07] Time-out = 16.27s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_08	0x0080	/* [08] Time-out = 32.54s (with 33 Mhz clk). */
+#define WDT_IRQ_FLG	0x1000	/* [12] Interrupt Request Flag */
+#define WDT_WRST_ENB	0x4000	/* [14] Watchdog Timer Reset Enable */
+#define WDT_ENB		0x8000	/* [15] Watchdog Timer Enable */
 
 static __u16 *wdtmrctl;
 
@@ -112,15 +131,6 @@ static unsigned long wdt_is_open;
 static char wdt_expect_close;
 static spinlock_t wdt_spinlock;
 
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-static int nowayout = 1;
-#else
-static int nowayout = 0;
-#endif
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
-
 /*
  *	Whack the dog
  */
@@ -147,7 +157,7 @@ static void wdt_timer_ping(unsigned long data)
 }
 
 /*
- * Utility routines
+ *	Utility routines
  */
 
 static void wdt_config(int writeval)
@@ -157,10 +167,10 @@ static void wdt_config(int writeval)
 
 	/* buy some time (ping) */
 	spin_lock_irqsave(&wdt_spinlock, flags);
-	dummy=readw(wdtmrctl);  /* ensure write synchronization */
+	dummy=readw(wdtmrctl);	/* ensure write synchronization */
 	writew(0xAAAA, wdtmrctl);
 	writew(0x5555, wdtmrctl);
-	/* make WDT configuration register writable one time */
+	/* unlock WDT = make WDT configuration register writable one time */
 	writew(0x3333, wdtmrctl);
 	writew(0xCCCC, wdtmrctl);
 	/* write WDT configuration register */
@@ -168,7 +178,7 @@ static void wdt_config(int writeval)
 	spin_unlock_irqrestore(&wdt_spinlock, flags);
 }
 
-static void wdt_startup(void)
+static int wdt_startup(void)
 {
 	next_heartbeat = jiffies + (timeout * HZ);
 
@@ -176,28 +186,43 @@ static void wdt_startup(void)
 	timer.expires = jiffies + WDT_INTERVAL;
 	add_timer(&timer);
 
-	wdt_config(WDT_ENB | WDT_WRST_ENB | TIMEOUT_EXPONENT);
+	/* Start the watchdog */
+	wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04);
+
 	printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
+	return 0;
 }
 
-static void wdt_turnoff(void)
+static int wdt_turnoff(void)
 {
-	if (!nowayout) {
-		/* Stop the timer */
-		del_timer(&timer);
-		wdt_config(0);
-		printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
-	}
+	/* Stop the timer */
+	del_timer(&timer);
+
+	/* Stop the watchdog */
+	wdt_config(0);
+
+	printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
+	return 0;
 }
 
-static void wdt_keepalive(void)
+static int wdt_keepalive(void)
 {
 	/* user land ping */
 	next_heartbeat = jiffies + (timeout * HZ);
+	return 0;
+}
+
+static int wdt_set_heartbeat(int t)
+{
+	if ((t < 1) || (t > 3600))	/* arbitrary upper limit */
+		return -EINVAL;
+
+	timeout = t;
+	return 0;
 }
 
 /*
- * /dev/watchdog handling
+ *	/dev/watchdog handling
  */
 
 static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos)
@@ -207,10 +232,8 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
 		return -ESPIPE;
 
 	/* See if we got the magic character 'V' and reload the timer */
-	if(count)
-	{
-		if (!nowayout)
-		{
+	if(count) {
+		if (!nowayout) {
 			size_t ofs;
 
 			/* note: just in case someone wrote the magic character
@@ -248,11 +271,11 @@ static int fop_open(struct inode * inode, struct file * file)
 
 static int fop_close(struct inode * inode, struct file * file)
 {
-	if(wdt_expect_close == 42)
+	if(wdt_expect_close == 42) {
 		wdt_turnoff();
-	else {
-		del_timer(&timer);
-		printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
+	} else {
+		printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+		wdt_keepalive();
 	}
 	clear_bit(0, &wdt_is_open);
 	wdt_expect_close = 0;
@@ -262,8 +285,7 @@ static int fop_close(struct inode * inode, struct file * file)
 static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
-	static struct watchdog_info ident=
-	{
+	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
 		.identity = "SC520",
@@ -307,10 +329,9 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			if(get_user(new_timeout, (int *)arg))
 				return -EFAULT;
 
-			if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
+			if(wdt_set_heartbeat(new_timeout))
 				return -EINVAL;
 
-			timeout = new_timeout;
 			wdt_keepalive();
 			/* Fall through */
 		}
@@ -351,81 +372,59 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
  *	turn the timebomb registers off.
  */
 
-static struct notifier_block wdt_notifier=
-{
+static struct notifier_block wdt_notifier = {
 	.notifier_call = wdt_notify_sys,
 };
 
 static void __exit sc520_wdt_unload(void)
 {
-	wdt_turnoff();
+	if (!nowayout)
+		wdt_turnoff();
 
 	/* Deregister */
 	misc_deregister(&wdt_miscdev);
-	iounmap(wdtmrctl);
 	unregister_reboot_notifier(&wdt_notifier);
+	iounmap(wdtmrctl);
 }
 
 static int __init sc520_wdt_init(void)
 {
 	int rc = -EBUSY;
-	unsigned long cbar;
 
 	spin_lock_init(&wdt_spinlock);
 
-	if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
-	{
-		timeout = WATCHDOG_TIMEOUT;
-		printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
-			timeout);
-	}
-
 	init_timer(&timer);
 	timer.function = wdt_timer_ping;
 	timer.data = 0;
 
-	rc = misc_register(&wdt_miscdev);
-	if (rc)
-	{
-		printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-			wdt_miscdev.minor, rc);
+	/* Check that the timeout value is within it's range ; if not reset to the default */
+	if (wdt_set_heartbeat(timeout)) {
+		wdt_set_heartbeat(WATCHDOG_TIMEOUT);
+		printk(KERN_INFO PFX "timeout value must be 1<=timeout<=3600, using %d\n",
+			WATCHDOG_TIMEOUT);
+	}
+
+	wdtmrctl = ioremap((unsigned long)(MMCR_BASE + OFFS_WDTMRCTL), 2);
+	if (!wdtmrctl) {
+		printk(KERN_ERR PFX "Unable to remap memory\n");
+		rc = -ENOMEM;
 		goto err_out_region2;
 	}
 
 	rc = register_reboot_notifier(&wdt_notifier);
-	if (rc)
-	{
+	if (rc) {
 		printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
 			rc);
-		goto err_out_miscdev;
+		goto err_out_ioremap;
 	}
 
-	/* get the Base Address Register */
-	cbar = inl_p(0xfffc);
-	printk(KERN_INFO PFX "CBAR: 0x%08lx\n", cbar);
-	/* check if MMCR aliasing bit is set */
-	if (cbar & 0x80000000) {
-		printk(KERN_INFO PFX "MMCR Aliasing enabled.\n");
-		wdtmrctl = (__u16 *)(cbar & 0x3fffffff);
-	} else {
-		printk(KERN_INFO PFX "!!! WARNING !!!\n"
-		  "\t MMCR Aliasing found NOT enabled!\n"
-		  "\t Using default value of: %p\n"
-		  "\t This has not been tested!\n"
-		  "\t Please email Scott Jennings <smj@oro.net>\n"
-		  "\t  and Bill Jennings <bj@oro.net> if it works!\n"
-		  , MMCR_BASE_DEFAULT
-		  );
-	  wdtmrctl = MMCR_BASE_DEFAULT;
-	}
-
-	wdtmrctl = (__u16 *)((char *)wdtmrctl + OFFS_WDTMRCTL);
-	wdtmrctl = ioremap((unsigned long)wdtmrctl, 2);
-	if (!wdtmrctl) {
-		printk (KERN_ERR PFX "Unable to remap memory.\n");
-		rc = -ENOMEM;
+	rc = misc_register(&wdt_miscdev);
+	if (rc) {
+		printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+			WATCHDOG_MINOR, rc);
 		goto err_out_notifier;
 	}
+
 	printk(KERN_INFO PFX "WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n",
 		timeout,nowayout);
 
@@ -433,8 +432,8 @@ static int __init sc520_wdt_init(void)
 
 err_out_notifier:
 	unregister_reboot_notifier(&wdt_notifier);
-err_out_miscdev:
-	misc_deregister(&wdt_miscdev);
+err_out_ioremap:
+	iounmap(wdtmrctl);
 err_out_region2:
 	return rc;
 }
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
index 4020ab0f0..6f0657b2b 100644
--- a/drivers/char/watchdog/scx200_wdt.c
+++ b/drivers/char/watchdog/scx200_wdt.c
@@ -25,6 +25,7 @@
 #include <linux/watchdog.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
+#include <linux/fs.h>
 #include <linux/pci.h>
 #include <linux/scx200.h>
 
@@ -220,10 +221,16 @@ static int __init scx200_wdt_init(void)
 
 	printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n");
 
-	/* First check that this really is a NatSemi SCx200 CPU */
+	/*
+	 * First check that this really is a NatSemi SCx200 CPU or a Geode
+	 * SC1100 processor
+	 */
 	if ((pci_find_device(PCI_VENDOR_ID_NS,
 			     PCI_DEVICE_ID_NS_SCx200_BRIDGE,
-			     NULL)) == NULL)
+			     NULL)) == NULL
+	    && (pci_find_device(PCI_VENDOR_ID_NS,
+				PCI_DEVICE_ID_NS_SC1100_BRIDGE,
+				NULL)) == NULL)
 		return -ENODEV;
 
 	/* More sanity checks, verify that the configuration block is there */
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
index ea14405b5..e4c235de7 100644
--- a/drivers/char/watchdog/shwdt.c
+++ b/drivers/char/watchdog/shwdt.c
@@ -64,7 +64,6 @@
  */
 static int clock_division_ratio = WTCSR_CKS_4096;
 
-#define msecs_to_jiffies(msecs)	(jiffies + (HZ * msecs + 9999) / 10000)
 #define next_ping_period(cks)	msecs_to_jiffies(cks - 4)
 
 static unsigned long shwdt_is_open;
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
index bbf8d06a0..7a129302c 100644
--- a/drivers/char/watchdog/w83627hf_wdt.c
+++ b/drivers/char/watchdog/w83627hf_wdt.c
@@ -72,7 +72,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CON
 #define WDT_EFDR (WDT_EFIR+1) /* Extended Function Data Register */
 
 static void
-wdt_ctrl(int timeout)
+w83627hf_select_wd_register(void)
 {
 	outb_p(0x87, WDT_EFER); /* Enter extended function mode */
 	outb_p(0x87, WDT_EFER); /* Again according to manual */
@@ -81,23 +81,64 @@ wdt_ctrl(int timeout)
 	outb_p(0x08, WDT_EFDR); /* select logical device 8 (GPIO2) */
 	outb_p(0x30, WDT_EFER); /* select CR30 */
 	outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
+}
+
+static void
+w83627hf_unselect_wd_register(void)
+{
+	outb_p(0xAA, WDT_EFER); /* Leave extended function mode */
+}
+
+/* tyan motherboards seem to set F5 to 0x4C ?
+ * So explicitly init to appropriate value. */
+static void
+w83627hf_init(void)
+{
+	unsigned char t;
+
+	w83627hf_select_wd_register();
+
+	outb_p(0xF5, WDT_EFER); /* Select CRF5 */
+	t=inb_p(WDT_EFDR);      /* read CRF5 */
+	t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */
+	outb_p(t, WDT_EFDR);    /* Write back to CRF5 */
+
+	w83627hf_unselect_wd_register();
+}
+
+static void
+wdt_ctrl(int timeout)
+{
+	w83627hf_select_wd_register();
 
 	outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
 	outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */
 
-	outb_p(0xAA, WDT_EFER); /* Leave extended function mode */
+	w83627hf_unselect_wd_register();
 }
 
-static void
+static int
 wdt_ping(void)
 {
 	wdt_ctrl(timeout);
+	return 0;
 }
 
-static void
+static int
 wdt_disable(void)
 {
 	wdt_ctrl(0);
+	return 0;
+}
+
+static int
+wdt_set_heartbeat(int t)
+{
+	if ((t < 1) || (t > 63))
+		return -EINVAL;
+
+	timeout = t;
+	return 0;
 }
 
 static ssize_t
@@ -134,7 +175,7 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
-		.identity = "Advantech WDT",
+		.identity = "W83627HF WDT",
 	};
 
 	switch (cmd) {
@@ -154,9 +195,8 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	case WDIOC_SETTIMEOUT:
 	  if (get_user(new_timeout, (int *)arg))
 		  return -EFAULT;
-	  if ((new_timeout < 1) || (new_timeout > 63))
+	  if (wdt_set_heartbeat(new_timeout))
 		  return -EINVAL;
-	  timeout = new_timeout;
 	  wdt_ping();
 	  /* Fall */
 
@@ -211,8 +251,8 @@ wdt_close(struct inode *inode, struct file *file)
 		printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
 		wdt_ping();
 	}
-	clear_bit(0, &wdt_is_open);
 	expect_close = 0;
+	clear_bit(0, &wdt_is_open);
 	return 0;
 }
 
@@ -264,12 +304,12 @@ wdt_init(void)
 {
 	int ret;
 
-	printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n");
+	printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF Super I/O chip initialising.\n");
 
-	if (timeout < 1 || timeout > 63) {
-		timeout = WATCHDOG_TIMEOUT;
-		printk (KERN_INFO PFX "timeout value must be 1<=x<=63, using %d\n",
-			timeout);
+	if (wdt_set_heartbeat(timeout)) {
+		wdt_set_heartbeat(WATCHDOG_TIMEOUT);
+		printk (KERN_INFO PFX "timeout value must be 1<=timeout<=63, using %d\n",
+			WATCHDOG_TIMEOUT);
 	}
 
 	if (!request_region(wdt_io, 1, WATCHDOG_NAME)) {
@@ -279,6 +319,8 @@ wdt_init(void)
 		goto out;
 	}
 
+	w83627hf_init();
+
 	ret = register_reboot_notifier(&wdt_notifier);
 	if (ret != 0) {
 		printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
index 9ab9ff2c0..c606ce433 100644
--- a/drivers/char/watchdog/wdt.c
+++ b/drivers/char/watchdog/wdt.c
@@ -633,8 +633,8 @@ out:
 outmisc:
 #ifdef CONFIG_WDT_501
 	misc_deregister(&temp_miscdev);
-#endif /* CONFIG_WDT_501 */
 outrbt:
+#endif /* CONFIG_WDT_501 */
 	unregister_reboot_notifier(&wdt_notifier);
 outirq:
 	free_irq(irq, NULL);
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 2c5afb666..a7fa79f5b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -33,9 +33,10 @@ static struct cpufreq_driver   	*cpufreq_driver;
 static struct cpufreq_policy	*cpufreq_cpu_data[NR_CPUS];
 static spinlock_t		cpufreq_driver_lock = SPIN_LOCK_UNLOCKED;
 
-/* internal prototype */
+/* internal prototypes */
 static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event);
-
+static void handle_update(void *data);
+static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci);
 
 /**
  * Two notifier lists: the "policy" list is involved in the 
@@ -161,6 +162,7 @@ show_one(cpuinfo_min_freq, cpuinfo.min_freq);
 show_one(cpuinfo_max_freq, cpuinfo.max_freq);
 show_one(scaling_min_freq, min);
 show_one(scaling_max_freq, max);
+show_one(scaling_cur_freq, cur);
 
 /**
  * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
@@ -188,6 +190,18 @@ static ssize_t store_##file_name					\
 store_one(scaling_min_freq,min);
 store_one(scaling_max_freq,max);
 
+/**
+ * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware
+ */
+static ssize_t show_cpuinfo_cur_freq (struct cpufreq_policy * policy, char *buf)
+{
+	unsigned int cur_freq = cpufreq_get(policy->cpu);
+	if (!cur_freq)
+		return sprintf(buf, "<unknown>");
+	return sprintf(buf, "%u\n", cur_freq);
+}
+
+
 /**
  * show_scaling_governor - show the current policy for the specified CPU
  */
@@ -268,6 +282,12 @@ struct freq_attr _name = { \
 	.show = show_##_name, \
 }
 
+#define define_one_ro0400(_name) \
+struct freq_attr _name = { \
+	.attr = { .name = __stringify(_name), .mode = 0400 }, \
+	.show = show_##_name, \
+}
+
 #define define_one_rw(_name) \
 struct freq_attr _name = { \
 	.attr = { .name = __stringify(_name), .mode = 0644 }, \
@@ -275,10 +295,12 @@ struct freq_attr _name = { \
 	.store = store_##_name, \
 }
 
+define_one_ro0400(cpuinfo_cur_freq);
 define_one_ro(cpuinfo_min_freq);
 define_one_ro(cpuinfo_max_freq);
 define_one_ro(scaling_available_governors);
 define_one_ro(scaling_driver);
+define_one_ro(scaling_cur_freq);
 define_one_rw(scaling_min_freq);
 define_one_rw(scaling_max_freq);
 define_one_rw(scaling_governor);
@@ -369,6 +391,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
 	policy->cpu = cpu;
 	init_MUTEX_LOCKED(&policy->lock);
 	init_completion(&policy->kobj_unregister);
+	INIT_WORK(&policy->update, handle_update, (void *)(long)cpu);
 
 	/* call driver. From then on the cpufreq must be able
 	 * to accept all calls to ->verify and ->setpolicy for this CPU
@@ -394,6 +417,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
 		sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
 		drv_attr++;
 	}
+	if (cpufreq_driver->get)
+		sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
+	if (cpufreq_driver->target)
+		sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
 
 	spin_lock_irqsave(&cpufreq_driver_lock, flags);
 	cpufreq_cpu_data[cpu] = policy;
@@ -474,11 +501,86 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
 	return 0;
 }
 
+
+static void handle_update(void *data)
+{
+	unsigned int cpu = (unsigned int)(long)data;
+	cpufreq_update_policy(cpu);
+}
+
 /**
- *	cpufreq_resume - restore the CPU clock frequency after resume
+ *	cpufreq_out_of_sync - If actual and saved CPU frequency differs, we're in deep trouble.
+ *	@cpu: cpu number
+ *	@old_freq: CPU frequency the kernel thinks the CPU runs at
+ *	@new_freq: CPU frequency the CPU actually runs at
  *
- *	Restore the CPU clock frequency so that our idea of the current
- *	frequency reflects the actual hardware.
+ *	We adjust to current frequency first, and need to clean up later. So either call
+ *	to cpufreq_update_policy() or schedule handle_update()).
+ */
+static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigned int new_freq)
+{
+	struct cpufreq_freqs freqs;
+
+	if (cpufreq_driver->flags & CPUFREQ_PANIC_OUTOFSYNC)
+		panic("CPU Frequency is out of sync.");
+
+	printk(KERN_WARNING "Warning: CPU frequency out of sync: cpufreq and timing "
+	       "core thinks of %u, is %u kHz.\n", old_freq, new_freq);
+
+	freqs.cpu = cpu;
+	freqs.old = old_freq;
+	freqs.new = new_freq;
+	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+}
+
+
+/** 
+ * cpufreq_get - get the current CPU frequency (in kHz)
+ * @cpu: CPU number
+ *
+ * Get the CPU current (static) CPU frequency
+ */
+unsigned int cpufreq_get(unsigned int cpu)
+{
+	struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
+	unsigned int ret = 0;
+
+	if (!policy)
+		return 0;
+
+	if (!cpufreq_driver->get)
+		goto out;
+
+	down(&policy->lock);
+
+	ret = cpufreq_driver->get(cpu);
+
+	if (ret && policy->cur && !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) 
+	{
+		/* verify no discrepancy between actual and saved value exists */
+		if (unlikely(ret != policy->cur)) {
+			cpufreq_out_of_sync(cpu, policy->cur, ret);
+			schedule_work(&policy->update);
+		}
+	}
+
+	up(&policy->lock);
+
+ out:
+	cpufreq_cpu_put(policy);
+
+	return (ret);
+}
+EXPORT_SYMBOL(cpufreq_get);
+
+
+/**
+ *	cpufreq_resume -  restore proper CPU frequency handling after resume
+ *
+ *	1.) resume CPUfreq hardware support (cpufreq_driver->resume())
+ *	2.) if ->target and !CPUFREQ_CONST_LOOPS: verify we're in sync
+ *	3.) schedule call cpufreq_update_policy() ASAP as interrupts are restored.
  */
 static int cpufreq_resume(struct sys_device * sysdev)
 {
@@ -498,25 +600,37 @@ static int cpufreq_resume(struct sys_device * sysdev)
 	if (!cpu_policy)
 		return -EINVAL;
 
-	if (cpufreq_driver->resume)
-		ret = cpufreq_driver->resume(cpu_policy);
-	if (ret) {
-		printk(KERN_ERR "cpufreq: resume failed in ->resume step on CPU %u\n", cpu_policy->cpu);
-		goto out;
-	}
+	if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
+		unsigned int cur_freq = 0;
 
-	if (cpufreq_driver->setpolicy)
-		ret = cpufreq_driver->setpolicy(cpu_policy);
-	else
-		/* CPUFREQ_RELATION_H or CPUFREQ_RELATION_L have the same effect here, as cpu_policy->cur is known
-		 * to be a valid and exact target frequency
-		 */
-		ret = cpufreq_driver->target(cpu_policy, cpu_policy->cur, CPUFREQ_RELATION_H);
+		if (cpufreq_driver->get)
+			cur_freq = cpufreq_driver->get(cpu_policy->cpu);
 
-	if (ret)
-		printk(KERN_ERR "cpufreq: resume failed in ->setpolicy/target step on CPU %u\n", cpu_policy->cpu);
+		if (!cur_freq || !cpu_policy->cur) {
+			printk(KERN_ERR "cpufreq: resume failed to assert current frequency is what timing core thinks it is.\n");
+			goto out;
+		}
+
+		if (unlikely(cur_freq != cpu_policy->cur)) {
+			struct cpufreq_freqs freqs;
+
+			if (cpufreq_driver->flags & CPUFREQ_PANIC_RESUME_OUTOFSYNC)
+				panic("CPU Frequency is out of sync.");
+
+			printk(KERN_WARNING "Warning: CPU frequency out of sync: cpufreq and timing"
+			       "core thinks of %u, is %u kHz.\n", cpu_policy->cur, cur_freq);
+
+			freqs.cpu = cpu;
+			freqs.old = cpu_policy->cur;
+			freqs.new = cur_freq;
+
+			notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_RESUMECHANGE, &freqs);
+			adjust_jiffies(CPUFREQ_RESUMECHANGE, &freqs);
+		}
+	}
 
 out:
+	schedule_work(&cpu_policy->update);
 	cpufreq_cpu_put(cpu_policy);
 	return ret;
 }
@@ -608,7 +722,12 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
 			    unsigned int target_freq,
 			    unsigned int relation)
 {
-	return cpufreq_driver->target(policy, target_freq, relation);
+	int retval = -EINVAL;
+	lock_cpu_hotplug();
+	if (cpu_online(policy->cpu))
+		retval = cpufreq_driver->target(policy, target_freq, relation);
+	unlock_cpu_hotplug();
+	return retval;
 }
 EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
 
@@ -904,16 +1023,20 @@ static unsigned int  l_p_j_ref_freq;
 
 static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
 {
+	if (ci->flags & CPUFREQ_CONST_LOOPS)
+		return;
+
 	if (!l_p_j_ref_freq) {
 		l_p_j_ref = loops_per_jiffy;
 		l_p_j_ref_freq = ci->old;
 	}
 	if ((val == CPUFREQ_PRECHANGE  && ci->old < ci->new) ||
-	    (val == CPUFREQ_POSTCHANGE && ci->old > ci->new))
+	    (val == CPUFREQ_POSTCHANGE && ci->old > ci->new) ||
+	    (val == CPUFREQ_RESUMECHANGE))
 		loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq, ci->new);
 }
 #else
-#define adjust_jiffies(x...) do {} while (0)
+static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) { return; }
 #endif
 
 
@@ -925,13 +1048,29 @@ static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
  */
 void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
 {
-	if (irqs_disabled())
-		return;   /* Only valid if we're in the resume process where
-			   * everyone knows what CPU frequency we are at */
+	BUG_ON(irqs_disabled());
+
+	freqs->flags = cpufreq_driver->flags;
 
 	down_read(&cpufreq_notifier_rwsem);
 	switch (state) {
 	case CPUFREQ_PRECHANGE:
+		/* detect if the driver reported a value as "old frequency" which
+		 * is not equal to what the cpufreq core thinks is "old frequency".
+		 */
+		if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
+			if ((likely(cpufreq_cpu_data[freqs->cpu]->cur)) &&
+			    (unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur)))
+			{
+				if (cpufreq_driver->flags & CPUFREQ_PANIC_OUTOFSYNC)
+					panic("CPU Frequency is out of sync.");
+
+				printk(KERN_WARNING "Warning: CPU frequency out of sync: "
+				       "cpufreq and timing core thinks of %u, is %u kHz.\n", 
+				       cpufreq_cpu_data[freqs->cpu]->cur, freqs->old);
+				freqs->old = cpufreq_cpu_data[freqs->cpu]->cur;
+			}
+		}
 		notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_PRECHANGE, freqs);
 		adjust_jiffies(CPUFREQ_PRECHANGE, freqs);
 		break;
@@ -970,6 +1109,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
 	    ((!driver_data->setpolicy) && (!driver_data->target)))
 		return -EINVAL;
 
+	if (driver_data->setpolicy)
+		driver_data->flags |= CPUFREQ_CONST_LOOPS;
+
 	spin_lock_irqsave(&cpufreq_driver_lock, flags);
 	if (cpufreq_driver) {
 		spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 99ac1419d..510214470 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -145,19 +145,6 @@ int cpufreq_setmax(unsigned int cpu)
 EXPORT_SYMBOL_GPL(cpufreq_setmax);
 
 
-/** 
- * cpufreq_get - get the current CPU frequency (in kHz)
- * @cpu: CPU number
- *
- * Get the CPU current (static) CPU frequency
- */
-unsigned int cpufreq_get(unsigned int cpu)
-{
-	return cpu_cur_freq[cpu];
-}
-EXPORT_SYMBOL(cpufreq_get);
-
-
 #ifdef CONFIG_CPU_FREQ_24_API
 
 
@@ -219,7 +206,7 @@ cpufreq_sysctl(ctl_table *table, int __user *name, int nlen,
 		if (oldlen != sizeof(unsigned int))
 			return -EINVAL;
 
-		if (put_user(cpufreq_get(cpu), (unsigned int *)oldval) ||
+		if (put_user(cpufreq_get(cpu), (unsigned int __user *)oldval) ||
 		    put_user(sizeof(unsigned int), oldlenp))
 			return -EFAULT;
 	}
@@ -229,7 +216,7 @@ cpufreq_sysctl(ctl_table *table, int __user *name, int nlen,
 		if (newlen != sizeof(unsigned int))
 			return -EINVAL;
 
-		if (get_user(freq, (unsigned int *)newval))
+		if (get_user(freq, (unsigned int __user *)newval))
 			return -EFAULT;
 
 		cpufreq_set(freq, cpu);
@@ -542,20 +529,6 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
 	return 0;
 }
 
-/* on ARM SA1100 we need to rely on the values of cpufreq_get() - because 
- * of this, cpu_cur_freq[] needs to be set early.
- */
-#if defined(CONFIG_ARM) && defined(CONFIG_ARCH_SA1100)
-extern unsigned int sa11x0_getspeed(void);
-
-static void cpufreq_sa11x0_compat(void)
-{
-	cpu_cur_freq[0] = sa11x0_getspeed();
-}
-#else
-#define cpufreq_sa11x0_compat() do {} while(0)
-#endif
-
 
 struct cpufreq_governor cpufreq_gov_userspace = {
 	.name		= "userspace",
@@ -564,21 +537,12 @@ struct cpufreq_governor cpufreq_gov_userspace = {
 };
 EXPORT_SYMBOL(cpufreq_gov_userspace);
 
-static int already_init = 0;
-
-int cpufreq_gov_userspace_init(void)
+static int __init cpufreq_gov_userspace_init(void)
 {
-	if (!already_init) {
-		down(&userspace_sem);
-		cpufreq_sa11x0_compat();
-		cpufreq_sysctl_init();
-		cpufreq_register_notifier(&userspace_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
-		already_init = 1;
-		up(&userspace_sem);
-	}
+	cpufreq_sysctl_init();
+	cpufreq_register_notifier(&userspace_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
 	return cpufreq_register_governor(&cpufreq_gov_userspace);
 }
-EXPORT_SYMBOL(cpufreq_gov_userspace_init);
 
 
 static void __exit cpufreq_gov_userspace_exit(void)
diff --git a/drivers/cpufreq/proc_intf.c b/drivers/cpufreq/proc_intf.c
index 81d58c7b7..a0eaf6f1d 100644
--- a/drivers/cpufreq/proc_intf.c
+++ b/drivers/cpufreq/proc_intf.c
@@ -164,7 +164,7 @@ end:
  */
 static int cpufreq_proc_write (
         struct file		*file,
-        const char		*buffer,
+        const char		__user *buffer,
         unsigned long		count,
         void			*data)
 {
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index 2329dd0e4..e5f41e017 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -59,8 +59,6 @@
 #define dma_unmap_single(d,h,s,dir) sbus_unmap_single(d,h,s,dir)
 #define dma_map_sg(d,s,n,dir) sbus_map_sg(d,s,n,dir)
 #define dma_unmap_sg(d,s,n,dir) sbus_unmap_sg(d,s,n,dir)
-#define scsi_to_fc_dma_dir(dir)	scsi_to_sbus_dma_dir(dir)
-#define FC_DMA_BIDIRECTIONAL	SBUS_DMA_BIDIRECTIONAL
 #else
 #define dma_alloc_consistent(d,s,p) pci_alloc_consistent(d,s,p)
 #define dma_free_consistent(d,s,v,h) pci_free_consistent(d,s,v,h)
@@ -68,8 +66,6 @@
 #define dma_unmap_single(d,h,s,dir) pci_unmap_single(d,h,s,dir)
 #define dma_map_sg(d,s,n,dir) pci_map_sg(d,s,n,dir)
 #define dma_unmap_sg(d,s,n,dir) pci_unmap_sg(d,s,n,dir)
-#define scsi_to_fc_dma_dir(dir)	scsi_to_pci_dma_dir(dir)
-#define FC_DMA_BIDIRECTIONAL	PCI_DMA_BIDIRECTIONAL
 #endif							       
 
 #define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
@@ -167,7 +163,7 @@ static void fcp_login_done(fc_channel *fc, int i, int status)
 			fcmd = l->fcmds + i;
 			plogi = l->logi + 3 * i;
 			dma_unmap_single (fc->dev, fcmd->cmd, 3 * sizeof(logi),
-					  FC_DMA_BIDIRECTIONAL);
+					  DMA_BIDIRECTIONAL);
 			plogi->code = LS_PLOGI;
 			memcpy (&plogi->nport_wwn, &fc->wwn_nport, sizeof(fc_wwn));
 			memcpy (&plogi->node_wwn, &fc->wwn_node, sizeof(fc_wwn));
@@ -188,7 +184,7 @@ static void fcp_login_done(fc_channel *fc, int i, int status)
 			}
 #endif			
 			fcmd->cmd = dma_map_single (fc->dev, plogi, 3 * sizeof(logi),
-						    FC_DMA_BIDIRECTIONAL);
+						    DMA_BIDIRECTIONAL);
 			fcmd->rsp = fcmd->cmd + 2 * sizeof(logi);
 			if (fc->hw_enque (fc, fcmd))
 				printk ("FC: Cannot enque PLOGI packet on %s\n", fc->name);
@@ -212,7 +208,7 @@ static void fcp_login_done(fc_channel *fc, int i, int status)
 		case FC_STATUS_OK:
 			plogi = l->logi + 3 * i;
 			dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi),
-					  FC_DMA_BIDIRECTIONAL);
+					  DMA_BIDIRECTIONAL);
 			if (!fc->wwn_dest.lo && !fc->wwn_dest.hi) {
 				memcpy (&fc->wwn_dest, &plogi[1].node_wwn, sizeof(fc_wwn)); 
 				FCD(("Dest WWN %08x%08x\n", *(u32 *)&fc->wwn_dest, fc->wwn_dest.lo))
@@ -231,7 +227,7 @@ static void fcp_login_done(fc_channel *fc, int i, int status)
 		case FC_STATUS_ERR_OFFLINE:
 			fc->state = FC_STATE_OFFLINE;
 			dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi),
-					  FC_DMA_BIDIRECTIONAL);
+					  DMA_BIDIRECTIONAL);
 			printk ("%s: FC is offline\n", fc->name);
 			if (atomic_dec_and_test (&l->todo))
 				up(&l->sem);
@@ -256,7 +252,7 @@ static void fcp_report_map_done(fc_channel *fc, int i, int status)
 	switch (status) {
 	case FC_STATUS_OK: /* Ok, let's have a fun on a loop */
 		dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi),
-				  FC_DMA_BIDIRECTIONAL);
+				  DMA_BIDIRECTIONAL);
 		p = (fc_al_posmap *)(l->logi + 3 * i);
 #ifdef FCDEBUG
 		{
@@ -306,7 +302,7 @@ static void fcp_report_map_done(fc_channel *fc, int i, int status)
 		FCD(("SID %d DID %d\n", fc->sid, fc->did))
 		fcmd = l->fcmds + i;
 		dma_unmap_single(fc->dev, fcmd->cmd, 3 * sizeof(logi),
-				 FC_DMA_BIDIRECTIONAL);
+				 DMA_BIDIRECTIONAL);
 		fch = &fcmd->fch;
 		memset(l->logi + 3 * i, 0, 3 * sizeof(logi));
 		FILL_FCHDR_RCTL_DID(fch, R_CTL_ELS_REQ, FS_FABRIC_F_PORT);
@@ -317,7 +313,7 @@ static void fcp_report_map_done(fc_channel *fc, int i, int status)
 		fch->param = 0;
 		l->logi [3 * i].code = LS_FLOGI;
 		fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi),
-					    FC_DMA_BIDIRECTIONAL);
+					    DMA_BIDIRECTIONAL);
 		fcmd->rsp = fcmd->cmd + sizeof(logi);
 		fcmd->cmdlen = sizeof(logi);
 		fcmd->rsplen = sizeof(logi);
@@ -434,11 +430,12 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
 		
 		if (fcmd->data) {
 			if (SCpnt->use_sg)
-				dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->buffer, SCpnt->use_sg,
-					     scsi_to_fc_dma_dir(SCpnt->sc_data_direction));
+				dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->buffer,
+						SCpnt->use_sg,
+						SCpnt->sc_data_direction);
 			else
 				dma_unmap_single(fc->dev, fcmd->data, SCpnt->request_bufflen,
-						 scsi_to_fc_dma_dir(SCpnt->sc_data_direction));
+						 SCpnt->sc_data_direction);
 		}
 		break;
 	default:
@@ -579,7 +576,7 @@ int fcp_initialize(fc_channel *fcchain, int count)
 		fc->ls = (void *)l;
 		/* Assumes sizeof(fc_al_posmap) < 3 * sizeof(logi), which is true */
 		fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi),
-					    FC_DMA_BIDIRECTIONAL);
+					    DMA_BIDIRECTIONAL);
 		fcmd->proto = PROTO_REPORT_AL_MAP;
 		fcmd->token = i;
 		fcmd->fc = fc;
@@ -598,7 +595,7 @@ int fcp_initialize(fc_channel *fcchain, int count)
 				} else {
 					fc->state = FC_STATE_OFFLINE;
 					enable_irq(fc->irq);
-					dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL);
+					dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), DMA_BIDIRECTIONAL);
 					if (atomic_dec_and_test (&l->todo))
 						goto all_done;
 				}
@@ -615,7 +612,7 @@ int fcp_initialize(fc_channel *fcchain, int count)
 
 				FCD(("SID %d DID %d\n", fc->sid, fc->did))
 				fcmd = l->fcmds + i;
-				dma_unmap_single(fc->dev, fcmd->cmd, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL);
+				dma_unmap_single(fc->dev, fcmd->cmd, 3 * sizeof(logi), DMA_BIDIRECTIONAL);
 				fch = &fcmd->fch;
 				FILL_FCHDR_RCTL_DID(fch, R_CTL_ELS_REQ, FS_FABRIC_F_PORT);
 				FILL_FCHDR_SID(fch, 0);
@@ -624,7 +621,7 @@ int fcp_initialize(fc_channel *fcchain, int count)
 				FILL_FCHDR_OXRX(fch, 0xffff, 0xffff);
 				fch->param = 0;
 				l->logi [3 * i].code = LS_FLOGI;
-				fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL);
+				fcmd->cmd = dma_map_single (fc->dev, l->logi + 3 * i, 3 * sizeof(logi), DMA_BIDIRECTIONAL);
 				fcmd->rsp = fcmd->cmd + sizeof(logi);
 				fcmd->cmdlen = sizeof(logi);
 				fcmd->rsplen = sizeof(logi);
@@ -652,7 +649,7 @@ all_done:
 		switch (fc->state) {
 		case FC_STATE_ONLINE: break;
 		case FC_STATE_OFFLINE: break;
-		default: dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), FC_DMA_BIDIRECTIONAL);
+		default: dma_unmap_single (fc->dev, l->fcmds[i].cmd, 3 * sizeof(logi), DMA_BIDIRECTIONAL);
 			break;
 		}
 	}
@@ -821,14 +818,14 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
 				cmd->fcp_data_len = SCpnt->request_bufflen;
 				fcmd->data = dma_map_single (fc->dev, (char *)SCpnt->request_buffer,
 							     SCpnt->request_bufflen,
-							     scsi_to_fc_dma_dir(SCpnt->sc_data_direction));
+							     SCpnt->sc_data_direction);
 			} else {
 				struct scatterlist *sg = (struct scatterlist *)SCpnt->buffer;
 				int nents;
 
 				FCD(("XXX: Use_sg %d %d\n", SCpnt->use_sg, sg->length))
 				nents = dma_map_sg (fc->dev, sg, SCpnt->use_sg,
-						    scsi_to_fc_dma_dir(SCpnt->sc_data_direction));
+						    SCpnt->sc_data_direction);
 				if (nents > 1) printk ("%s: SG for nents %d (use_sg %d) not handled yet\n", fc->name, nents, SCpnt->use_sg);
 				fcmd->data = sg_dma_address(sg);
 				cmd->fcp_data_len = sg_dma_len(sg);
@@ -1065,7 +1062,7 @@ static int fc_do_els(fc_channel *fc, unsigned int alpa, void *data, int len)
 	FILL_FCHDR_SEQ_DF_SEQ(fch, 0, 0, 0);
 	FILL_FCHDR_OXRX(fch, 0xffff, 0xffff);
 	fch->param = 0;
-	fcmd->cmd = dma_map_single (fc->dev, data, 2 * len, FC_DMA_BIDIRECTIONAL);
+	fcmd->cmd = dma_map_single (fc->dev, data, 2 * len, DMA_BIDIRECTIONAL);
 	fcmd->rsp = fcmd->cmd + len;
 	fcmd->cmdlen = len;
 	fcmd->rsplen = len;
@@ -1100,7 +1097,7 @@ static int fc_do_els(fc_channel *fc, unsigned int alpa, void *data, int len)
 	
 	clear_bit(fcmd->token, fc->scsi_bitmap);
 	fc->scsi_free++;
-	dma_unmap_single (fc->dev, fcmd->cmd, 2 * len, FC_DMA_BIDIRECTIONAL);
+	dma_unmap_single (fc->dev, fcmd->cmd, 2 * len, DMA_BIDIRECTIONAL);
 	return l.status;
 }
 
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index f5a883e5b..597bf5f04 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -12,7 +12,7 @@ config EDD
 	help
 	  Say Y or M here if you want to enable BIOS Enhanced Disk Drive
 	  Services real mode BIOS calls to determine which disk
-	  BIOS tries boot from.  This information is then exported via driverfs.
+	  BIOS tries boot from.  This information is then exported via sysfs.
 
 	  This option is experimental, but believed to be safe,
 	  and most disk controller BIOS vendors do not yet implement this feature.
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index ac2246dd7..40257f7ef 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -15,9 +15,8 @@
  * made in setup.S, copied to safe structures in setup.c,
  * and presents it in sysfs.
  *
- * Please see http://domsch.com/linux/edd30/results.html for
+ * Please see http://linux.dell.com/edd30/results.html for
  * the list of BIOSs which have been reported to implement EDD.
- * If you don't see yours listed, please send a report as described there.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License v2.0 as published by
@@ -30,15 +29,6 @@
  *
  */
 
-/*
- * Known issues:
- * - refcounting of struct device objects could be improved.
- *
- * TODO:
- * - Add IDE and USB disk device support
- * - move edd.[ch] to better locations if/when one is decided
- */
-
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/types.h>
@@ -50,20 +40,16 @@
 #include <linux/limits.h>
 #include <linux/device.h>
 #include <linux/pci.h>
-#include <linux/device.h>
 #include <linux/blkdev.h>
 #include <linux/edd.h>
-/* FIXME - this really belongs in include/scsi/scsi.h */
-#include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
+
+#define EDD_VERSION "0.15"
+#define EDD_DATE    "2004-May-17"
 
 MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
 MODULE_DESCRIPTION("sysfs interface to BIOS EDD information");
 MODULE_LICENSE("GPL");
-
-#define EDD_VERSION "0.13 2004-Mar-09"
-#define EDD_DEVICE_NAME_SIZE 16
-#define REPORT_URL "http://linux.dell.com/edd/results.html"
+MODULE_VERSION(EDD_VERSION);
 
 #define left (PAGE_SIZE - (p - buf) - 1)
 
@@ -334,7 +320,7 @@ edd_show_info_flags(struct edd_device *edev, char *buf)
 }
 
 static ssize_t
-edd_show_legacy_cylinders(struct edd_device *edev, char *buf)
+edd_show_legacy_max_cylinder(struct edd_device *edev, char *buf)
 {
 	struct edd_info *info;
 	char *p = buf;
@@ -344,12 +330,12 @@ edd_show_legacy_cylinders(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += snprintf(p, left, "0x%x\n", info->legacy_cylinders);
+	p += snprintf(p, left, "%u\n", info->legacy_max_cylinder);
 	return (p - buf);
 }
 
 static ssize_t
-edd_show_legacy_heads(struct edd_device *edev, char *buf)
+edd_show_legacy_max_head(struct edd_device *edev, char *buf)
 {
 	struct edd_info *info;
 	char *p = buf;
@@ -359,12 +345,12 @@ edd_show_legacy_heads(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += snprintf(p, left, "0x%x\n", info->legacy_heads);
+	p += snprintf(p, left, "%u\n", info->legacy_max_head);
 	return (p - buf);
 }
 
 static ssize_t
-edd_show_legacy_sectors(struct edd_device *edev, char *buf)
+edd_show_legacy_sectors_per_track(struct edd_device *edev, char *buf)
 {
 	struct edd_info *info;
 	char *p = buf;
@@ -374,7 +360,7 @@ edd_show_legacy_sectors(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += snprintf(p, left, "0x%x\n", info->legacy_sectors);
+	p += snprintf(p, left, "%u\n", info->legacy_sectors_per_track);
 	return (p - buf);
 }
 
@@ -389,7 +375,7 @@ edd_show_default_cylinders(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += scnprintf(p, left, "0x%x\n", info->params.num_default_cylinders);
+	p += scnprintf(p, left, "%u\n", info->params.num_default_cylinders);
 	return (p - buf);
 }
 
@@ -404,7 +390,7 @@ edd_show_default_heads(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += scnprintf(p, left, "0x%x\n", info->params.num_default_heads);
+	p += scnprintf(p, left, "%u\n", info->params.num_default_heads);
 	return (p - buf);
 }
 
@@ -419,7 +405,7 @@ edd_show_default_sectors_per_track(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += scnprintf(p, left, "0x%x\n", info->params.sectors_per_track);
+	p += scnprintf(p, left, "%u\n", info->params.sectors_per_track);
 	return (p - buf);
 }
 
@@ -434,7 +420,7 @@ edd_show_sectors(struct edd_device *edev, char *buf)
 	if (!info || !buf)
 		return -EINVAL;
 
-	p += scnprintf(p, left, "0x%llx\n", info->params.number_of_sectors);
+	p += scnprintf(p, left, "%llu\n", info->params.number_of_sectors);
 	return (p - buf);
 }
 
@@ -450,7 +436,7 @@ edd_show_sectors(struct edd_device *edev, char *buf)
  */
 
 static int
-edd_has_legacy_cylinders(struct edd_device *edev)
+edd_has_legacy_max_cylinder(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
@@ -458,11 +444,11 @@ edd_has_legacy_cylinders(struct edd_device *edev)
 	info = edd_dev_get_info(edev);
 	if (!info)
 		return -EINVAL;
-	return info->legacy_cylinders > 0;
+	return info->legacy_max_cylinder > 0;
 }
 
 static int
-edd_has_legacy_heads(struct edd_device *edev)
+edd_has_legacy_max_head(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
@@ -470,11 +456,11 @@ edd_has_legacy_heads(struct edd_device *edev)
 	info = edd_dev_get_info(edev);
 	if (!info)
 		return -EINVAL;
-	return info->legacy_heads > 0;
+	return info->legacy_max_head > 0;
 }
 
 static int
-edd_has_legacy_sectors(struct edd_device *edev)
+edd_has_legacy_sectors_per_track(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
@@ -482,7 +468,7 @@ edd_has_legacy_sectors(struct edd_device *edev)
 	info = edd_dev_get_info(edev);
 	if (!info)
 		return -EINVAL;
-	return info->legacy_sectors > 0;
+	return info->legacy_sectors_per_track > 0;
 }
 
 static int
@@ -569,12 +555,14 @@ static EDD_DEVICE_ATTR(version, 0444, edd_show_version, NULL);
 static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, NULL);
 static EDD_DEVICE_ATTR(info_flags, 0444, edd_show_info_flags, NULL);
 static EDD_DEVICE_ATTR(sectors, 0444, edd_show_sectors, NULL);
-static EDD_DEVICE_ATTR(legacy_cylinders, 0444, edd_show_legacy_cylinders,
-		       edd_has_legacy_cylinders);
-static EDD_DEVICE_ATTR(legacy_heads, 0444, edd_show_legacy_heads,
-		       edd_has_legacy_heads);
-static EDD_DEVICE_ATTR(legacy_sectors, 0444, edd_show_legacy_sectors,
-		       edd_has_legacy_sectors);
+static EDD_DEVICE_ATTR(legacy_max_cylinder, 0444,
+                       edd_show_legacy_max_cylinder,
+		       edd_has_legacy_max_cylinder);
+static EDD_DEVICE_ATTR(legacy_max_head, 0444, edd_show_legacy_max_head,
+		       edd_has_legacy_max_head);
+static EDD_DEVICE_ATTR(legacy_sectors_per_track, 0444,
+                       edd_show_legacy_sectors_per_track,
+		       edd_has_legacy_sectors_per_track);
 static EDD_DEVICE_ATTR(default_cylinders, 0444, edd_show_default_cylinders,
 		       edd_has_default_cylinders);
 static EDD_DEVICE_ATTR(default_heads, 0444, edd_show_default_heads,
@@ -601,9 +589,9 @@ static struct attribute * def_attrs[] = {
 
 /* These attributes are conditional and only added for some devices. */
 static struct edd_attribute * edd_attrs[] = {
-	&edd_attr_legacy_cylinders,
-	&edd_attr_legacy_heads,
-	&edd_attr_legacy_sectors,
+	&edd_attr_legacy_max_cylinder,
+	&edd_attr_legacy_max_head,
+	&edd_attr_legacy_sectors_per_track,
 	&edd_attr_default_cylinders,
 	&edd_attr_default_heads,
 	&edd_attr_default_sectors_per_track,
@@ -690,103 +678,6 @@ edd_create_symlink_to_pcidev(struct edd_device *edev)
 	return sysfs_create_link(&edev->kobj,&pci_dev->dev.kobj,"pci_dev");
 }
 
-/*
- * FIXME - as of 15-Jan-2003, there are some non-"scsi_device"s on the
- * scsi_bus list.  The following functions could possibly mis-access
- * memory in that case.  This is actually a problem with the SCSI
- * layer, which is being addressed there.  Until then, don't use the
- * SCSI functions.
- */
-
-#undef CONFIG_SCSI
-#undef CONFIG_SCSI_MODULE
-#if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE)
-
-struct edd_match_data {
-	struct edd_device	* edev;
-	struct scsi_device	* sd;
-};
-
-/**
- * edd_match_scsidev()
- * @edev - EDD device is a known SCSI device
- * @sd - scsi_device with host who's parent is a PCI controller
- *
- * returns 1 if a match is found, 0 if not.
- */
-static int edd_match_scsidev(struct device * dev, void * d)
-{
-	struct edd_match_data * data = (struct edd_match_data *)d;
-	struct edd_info *info = edd_dev_get_info(data->edev);
-	struct scsi_device * sd = to_scsi_device(dev);
-
-	if (info) {
-		if ((sd->channel == info->params.interface_path.pci.channel) &&
-		    (sd->id == info->params.device_path.scsi.id) &&
-		    (sd->lun == info->params.device_path.scsi.lun)) {
-			data->sd = sd;
-			return 1;
-		}
-	}
-	return 0;
-}
-
-/**
- * edd_find_matching_device()
- * @edev - edd_device to match
- *
- * Search the SCSI devices for a drive that matches the EDD
- * device descriptor we have. If we find a match, return it,
- * otherwise, return NULL.
- */
-
-static struct scsi_device *
-edd_find_matching_scsi_device(struct edd_device *edev)
-{
-	struct edd_match_data data;
-	struct bus_type * scsi_bus = find_bus("scsi");
-
-	if (!scsi_bus) {
-		return NULL;
-	}
-
-	data.edev = edev;
-
-	if (edd_dev_is_type(edev, "SCSI")) {
-		if (bus_for_each_dev(scsi_bus,NULL,&data,edd_match_scsidev))
-			return data.sd;
-	}
-	return NULL;
-}
-
-static int
-edd_create_symlink_to_scsidev(struct edd_device *edev)
-{
-	struct pci_dev *pci_dev;
-	int rc = -EINVAL;
-
-	pci_dev = edd_get_pci_dev(edev);
-	if (pci_dev) {
-		struct scsi_device * sdev = edd_find_matching_scsi_device(edev);
-		if (sdev && get_device(&sdev->sdev_driverfs_dev)) {
-			rc = sysfs_create_link(&edev->kobj,
-					       &sdev->sdev_driverfs_dev.kobj,
-					       "disc");
-			put_device(&sdev->sdev_driverfs_dev);
-		}
-	}
-	return rc;
-}
-
-#else
-static int
-edd_create_symlink_to_scsidev(struct edd_device *edev)
-{
-	return -ENOSYS;
-}
-#endif
-
-
 static inline void
 edd_device_unregister(struct edd_device *edev)
 {
@@ -807,7 +698,6 @@ static void edd_populate_dir(struct edd_device * edev)
 
 	if (!error) {
 		edd_create_symlink_to_pcidev(edev);
-		edd_create_symlink_to_scsidev(edev);
 	}
 }
 
@@ -820,8 +710,8 @@ edd_device_register(struct edd_device *edev, int i)
 		return 1;
 	memset(edev, 0, sizeof (*edev));
 	edd_dev_set_info(edev, &edd[i]);
-	snprintf(edev->kobj.name, EDD_DEVICE_NAME_SIZE, "int13_dev%02x",
-		 edd[i].device);
+	kobject_set_name(&edev->kobj, "int13_dev%02x",
+			 edd[i].device);
 	kobj_set_kset_s(edev,edd_subsys);
 	error = kobject_register(&edev->kobj);
 	if (!error)
@@ -842,9 +732,8 @@ edd_init(void)
 	int rc=0;
 	struct edd_device *edev;
 
-	printk(KERN_INFO "BIOS EDD facility v%s, %d devices found\n",
-	       EDD_VERSION, eddnr);
-	printk(KERN_INFO "Please report your BIOS at %s\n", REPORT_URL);
+	printk(KERN_INFO "BIOS EDD facility v%s %s, %d devices found\n",
+	       EDD_VERSION, EDD_DATE, eddnr);
 
 	if (!eddnr) {
 		printk(KERN_INFO "EDD information not available.\n");
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index ddaf82f86..429070cd8 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -23,6 +23,10 @@
  *
  * Changelog:
  *
+ *  17 May 2004 - Matt Domsch <Matt_Domsch@dell.com>
+ *   remove check for efi_enabled in exit
+ *   add MODULE_VERSION
+ *
  *  26 Apr 2004 - Matt Domsch <Matt_Domsch@dell.com>
  *   minor bug fixes
  *
@@ -77,11 +81,13 @@
 
 #include <asm/uaccess.h>
 
+#define EFIVARS_VERSION "0.08"
+#define EFIVARS_DATE "2004-May-17"
+
 MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
 MODULE_DESCRIPTION("sysfs interface to EFI Variables");
 MODULE_LICENSE("GPL");
-
-#define EFIVARS_VERSION "0.07 2004-Apr-26"
+MODULE_VERSION(EFIVARS_VERSION);
 
 /*
  * efivars_lock protects two things:
@@ -664,7 +670,11 @@ efivars_init(void)
 	unsigned long variable_name_size = 1024;
 	int i, rc = 0, error = 0;
 
-	printk(KERN_INFO "EFI Variables Facility v%s\n", EFIVARS_VERSION);
+	if (!efi_enabled)
+		return -ENODEV;
+
+	printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,
+	       EFIVARS_DATE);
 
 	/*
 	 * For now we'll register the efi subsys within this driver
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index efcb77524..afbd48fe8 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -381,7 +381,13 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
 			break;
 		}
 
-		if ( count > 1 ) {		/* send ack */
+		temp++;
+		count--;
+
+		if (msg->flags & I2C_M_NO_RD_ACK)
+			continue;
+
+		if ( count > 0 ) {		/* send ack */
 			sdalo(adap);
 			DEBPROTO(printk(" Am "));
 		} else {
@@ -395,8 +401,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
 		};
 		scllo(adap);
 		sdahi(adap);
-		temp++;
-		count--;
 	}
 	return rdcount;
 }
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 65a118038..3628b099f 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -95,6 +95,8 @@ config I2C_I801
 	    82801CA/CAM
 	    82801DB
 	    82801EB
+	    6300ESB
+	    ICH6
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-i801.
@@ -116,8 +118,14 @@ config I2C_I810
 	  will be called i2c-i810.
 
 config I2C_IBM_IIC
-	tristate "IBM IIC I2C"
+	tristate "IBM PPC 4xx on-chip I2C interface"
 	depends on IBM_OCP && I2C
+	help
+	  Say Y here if you want to use IIC peripheral found on 
+	  embedded IBM PPC 4xx based systems. 
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-ibm_iic.
 
 config I2C_IOP3XX
 	tristate "Intel XScale IOP3xx on-chip I2C interface"
@@ -145,16 +153,16 @@ config I2C_ITE
 	  This support is also available as a module.  If so, the module 
 	  will be called i2c-ite.
 
-config I2C_IXP42X
-	tristate "IXP42x GPIO-Based I2C Interface"
-	depends on I2C && ARCH_IXP425
+config I2C_IXP4XX
+	tristate "IXP4xx GPIO-Based I2C Interface"
+	depends on I2C && ARCH_IXP4XX
 	select I2C_ALGOBIT
 	help
-	  Say Y here if you have an Intel IXP42x(420,421,422,425) based 
+	  Say Y here if you have an Intel IXP4xx(420,421,422,425) based 
 	  system and are using GPIO lines for an I2C bus.
 
 	  This support is also available as a module. If so, the module
-	  will be called i2c-ixp42x.
+	  will be called i2c-ixp4xx.
 
 config I2C_KEYWEST
 	tristate "Powermac Keywest I2C interface"
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 13d07d54a..83391986c 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_I2C_IBM_IIC)	+= i2c-ibm_iic.o
 obj-$(CONFIG_I2C_IOP3XX)	+= i2c-iop3xx.o
 obj-$(CONFIG_I2C_ISA)		+= i2c-isa.o
 obj-$(CONFIG_I2C_ITE)		+= i2c-ite.o
-obj-$(CONFIG_I2C_IXP42X)	+= i2c-ixp42x.o
+obj-$(CONFIG_I2C_IXP4XX)	+= i2c-ixp4xx.o
 obj-$(CONFIG_I2C_KEYWEST)	+= i2c-keywest.o
 obj-$(CONFIG_I2C_NFORCE2)	+= i2c-nforce2.o
 obj-$(CONFIG_I2C_PARPORT)	+= i2c-parport.o
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
index 6715b0d14..c0a85e2b8 100644
--- a/drivers/i2c/busses/i2c-ali1535.c
+++ b/drivers/i2c/busses/i2c-ali1535.c
@@ -59,6 +59,7 @@
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
@@ -276,7 +277,7 @@ static int ali1535_transaction(struct i2c_adapter *adap)
 	/* We will always wait for a fraction of a second! */
 	timeout = 0;
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	} while (((temp & ALI1535_STS_BUSY) && !(temp & ALI1535_STS_IDLE))
 		 && (timeout++ < MAX_TIMEOUT));
@@ -350,7 +351,7 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr,
 	for (timeout = 0;
 	     (timeout < MAX_TIMEOUT) && !(temp & ALI1535_STS_IDLE);
 	     timeout++) {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	}
 	if (timeout >= MAX_TIMEOUT)
@@ -480,7 +481,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter ali1535_adapter = {
 	.owner		= THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c
index 3807c9682..f77ae846e 100644
--- a/drivers/i2c/busses/i2c-ali1563.c
+++ b/drivers/i2c/busses/i2c-ali1563.c
@@ -16,6 +16,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/pci.h>
 #include <linux/init.h>
@@ -82,7 +83,7 @@ static int ali1563_transaction(struct i2c_adapter * a)
 
 	timeout = ALI1563_MAX_TIMEOUT;
 	do
-		i2c_delay(1);
+		msleep(1);
 	while (((data = inb_p(SMB_HST_STS)) & HST_STS_BUSY) && --timeout);
 
 	dev_dbg(&a->dev, "Transaction (post): STS=%02x, CNTL1=%02x, "
@@ -137,7 +138,7 @@ static int ali1563_block_start(struct i2c_adapter * a)
 
 	timeout = ALI1563_MAX_TIMEOUT;
 	do
-		i2c_delay(1);
+		msleep(1);
 	while (!((data = inb_p(SMB_HST_STS)) & HST_STS_DONE) && --timeout);
 
 	dev_dbg(&a->dev, "Block (post): STS=%02x, CNTL1=%02x, "
@@ -357,7 +358,7 @@ static struct i2c_algorithm ali1563_algorithm = {
 
 static struct i2c_adapter ali1563_adapter = {
 	.owner	= THIS_MODULE,
-	.class	= I2C_ADAP_CLASS_SMBUS,
+	.class	= I2C_CLASS_HWMON,
 	.algo	= &ali1563_algorithm,
 };
 
diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
index 446606c91..ef4a62524 100644
--- a/drivers/i2c/busses/i2c-ali15x3.c
+++ b/drivers/i2c/busses/i2c-ali15x3.c
@@ -67,6 +67,7 @@
 #include <linux/stddef.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
+#include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
 #include <asm/io.h>
@@ -296,7 +297,7 @@ static int ali15x3_transaction(struct i2c_adapter *adap)
 	/* We will always wait for a fraction of a second! */
 	timeout = 0;
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	} while ((!(temp & (ALI15X3_STS_ERR | ALI15X3_STS_DONE)))
 		 && (timeout++ < MAX_TIMEOUT));
@@ -353,7 +354,7 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
 	for (timeout = 0;
 	     (timeout < MAX_TIMEOUT) && !(temp & ALI15X3_STS_IDLE);
 	     timeout++) {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	}
 	if (timeout >= MAX_TIMEOUT) {
@@ -470,7 +471,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter ali15x3_adapter = {
 	.owner		= THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
index 261b5d916..4b1151373 100644
--- a/drivers/i2c/busses/i2c-amd756.c
+++ b/drivers/i2c/busses/i2c-amd756.c
@@ -41,6 +41,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
+#include <linux/delay.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
@@ -124,7 +125,7 @@ static int amd756_transaction(struct i2c_adapter *adap)
 	if ((temp = inw_p(SMB_GLOBAL_STATUS)) & (GS_HST_STS | GS_SMB_STS)) {
 		dev_dbg(&adap->dev, ": SMBus busy (%04x). Waiting... \n", temp);
 		do {
-			i2c_delay(1);
+			msleep(1);
 			temp = inw_p(SMB_GLOBAL_STATUS);
 		} while ((temp & (GS_HST_STS | GS_SMB_STS)) &&
 		         (timeout++ < MAX_TIMEOUT));
@@ -141,7 +142,7 @@ static int amd756_transaction(struct i2c_adapter *adap)
 
 	/* We will always wait for a fraction of a second! */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = inw_p(SMB_GLOBAL_STATUS);
 	} while ((temp & GS_HST_STS) && (timeout++ < MAX_TIMEOUT));
 
@@ -188,7 +189,7 @@ static int amd756_transaction(struct i2c_adapter *adap)
  abort:
 	dev_warn(&adap->dev, ": Sending abort.\n");
 	outw_p(inw(SMB_GLOBAL_ENABLE) | GE_ABORT, SMB_GLOBAL_ENABLE);
-	i2c_delay(100);
+	msleep(100);
 	outw_p(GS_CLEAR_STS, SMB_GLOBAL_STATUS);
 	return -1;
 }
@@ -303,7 +304,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter amd756_adapter = {
 	.owner		= THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
index 7ad6f7e50..b0e597049 100644
--- a/drivers/i2c/busses/i2c-amd8111.c
+++ b/drivers/i2c/busses/i2c-amd8111.c
@@ -276,7 +276,7 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags,
 	}
 
 	if (~temp[0] & AMD_SMB_STS_DONE) {
-		i2c_delay(HZ/100);
+		msleep(1);
 		amd_ec_read(smbus, AMD_SMB_STS, temp + 0);
 	}
 
@@ -359,7 +359,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
 	smbus->adapter.owner = THIS_MODULE;
 	snprintf(smbus->adapter.name, I2C_NAME_SIZE,
 		"SMBus2 AMD8111 adapter at %04x", smbus->base);
-	smbus->adapter.class = I2C_ADAP_CLASS_SMBUS;
+	smbus->adapter.class = I2C_CLASS_HWMON;
 	smbus->adapter.algo = &smbus_algorithm;
 	smbus->adapter.algo_data = smbus;
 
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index d0612fb8d..4689bd01d 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -28,7 +28,8 @@
     82801CA/CAM		2483           
     82801DB		24C3   (HW PEC supported, 32 byte buffer not supported)
     82801EB		24D3   (HW PEC supported, 32 byte buffer not supported)
-
+    6300ESB		25A4
+    ICH6		266A
     This driver supports several versions of Intel's I/O Controller Hubs (ICH).
     For SMBus support, they are similar to the PIIX4 and are part
     of Intel's '810' and other chipsets.
@@ -43,6 +44,7 @@
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
+#include <linux/delay.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -121,7 +123,8 @@ static int i801_setup(struct pci_dev *dev)
 
 	I801_dev = dev;
 	if ((dev->device == PCI_DEVICE_ID_INTEL_82801DB_3) ||
-	    (dev->device == PCI_DEVICE_ID_INTEL_82801EB_3))
+	    (dev->device == PCI_DEVICE_ID_INTEL_82801EB_3) ||
+	    (dev->device == PCI_DEVICE_ID_INTEL_ESB_4))
 		isich4 = 1;
 	else
 		isich4 = 0;
@@ -205,7 +208,7 @@ static int i801_transaction(void)
 
 	/* We will always wait for a fraction of a second! */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
 
@@ -333,7 +336,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
 		timeout = 0;
 		do {
 			temp = inb_p(SMBHSTSTS);
-			i2c_delay(1);
+			msleep(1);
 		}
 		    while ((!(temp & 0x80))
 			   && (timeout++ < MAX_TIMEOUT));
@@ -393,7 +396,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
 		timeout = 0;
 		do {
 			temp = inb_p(SMBHSTSTS);
-			i2c_delay(1);
+			msleep(1);
 		} while ((!(temp & 0x02))
 			   && (timeout++ < MAX_TIMEOUT));
 
@@ -539,7 +542,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter i801_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
@@ -576,10 +579,22 @@ static struct pci_device_id i801_ids[] = {
 		.subdevice =	PCI_ANY_ID,
 	},
 	{
-		.vendor =   PCI_VENDOR_ID_INTEL,
-		.device =   PCI_DEVICE_ID_INTEL_82801EB_3,
-		.subvendor =    PCI_ANY_ID,
-		.subdevice =    PCI_ANY_ID,
+		.vendor =	PCI_VENDOR_ID_INTEL,
+		.device =	PCI_DEVICE_ID_INTEL_82801EB_3,
+		.subvendor =	PCI_ANY_ID,
+		.subdevice =	PCI_ANY_ID,
+	},
+	{
+		.vendor =	PCI_VENDOR_ID_INTEL,
+		.device =	PCI_DEVICE_ID_INTEL_ESB_4,
+		.subvendor =	PCI_ANY_ID,
+		.subdevice = 	PCI_ANY_ID,
+	},
+	{
+		.vendor =	PCI_VENDOR_ID_INTEL,
+		.device =	PCI_DEVICE_ID_INTEL_ICH6_16,
+		.subvendor =	PCI_ANY_ID,
+		.subdevice =	PCI_ANY_ID,
 	},
 	{ 0, }
 };
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 35c771478..962184be1 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -3,7 +3,7 @@
  *
  * Support for the IIC peripheral on IBM PPC 4xx
  *
- * Copyright (c) 2003 Zultys Technologies.
+ * Copyright (c) 2003, 2004 Zultys Technologies.
  * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
  *
  * Based on original work by 
@@ -45,7 +45,7 @@
 
 #include "i2c-ibm_iic.h"
 
-#define DRIVER_VERSION "2.0"
+#define DRIVER_VERSION "2.01"
 
 MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION);
 MODULE_LICENSE("GPL");
@@ -69,14 +69,14 @@ MODULE_PARM_DESC(iic_fast_poll, "Force fast mode (400 kHz)");
 #endif
 
 #if DBG_LEVEL > 0
-#  define DBG(x...)	printk(KERN_DEBUG "ibm-iic" ##x)
+#  define DBG(f,x...)	printk(KERN_DEBUG "ibm-iic" f, ##x)
 #else
-#  define DBG(x...)	((void)0)
+#  define DBG(f,x...)	((void)0)
 #endif
 #if DBG_LEVEL > 1
-#  define DBG2(x...) 	DBG( ##x )
+#  define DBG2(f,x...) 	DBG(f, ##x)
 #else
-#  define DBG2(x...) 	((void)0)
+#  define DBG2(f,x...) 	((void)0)
 #endif
 #if DBG_LEVEL > 2
 static void dump_iic_regs(const char* header, struct ibm_iic_private* dev)
@@ -455,6 +455,16 @@ static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 	}		
 	for (i = 0; i < num; ++i){
 		if (unlikely(msgs[i].len <= 0)){
+			if (num == 1 && !msgs[0].len){
+				/* Special case for I2C_SMBUS_QUICK emulation.
+				 * Although this logic is FAR FROM PERFECT, this 
+				 * is what previous driver version did.
+				 * IBM IIC doesn't support 0-length transactions
+				 * (except bit-banging through IICx_DIRECTCNTL).
+				 */
+				DBG("%d: zero-length msg kludge\n", dev->idx); 
+				return 0;
+			}
 			DBG("%d: invalid len %d in msg[%d]\n", dev->idx, 
 				msgs[i].len, i);
 			return -EINVAL;
@@ -549,19 +559,24 @@ static int __devinit iic_probe(struct ocp_device *ocp){
 
 	struct ibm_iic_private* dev;
 	struct i2c_adapter* adap;
+	struct ocp_func_iic_data* iic_data = ocp->def->additions;
 	int ret;
-	bd_t* bd = (bd_t*)&__res;
 	
+	if (!iic_data)
+		printk(KERN_WARNING"ibm-iic%d: missing additional data!\n",
+			ocp->def->index);
+
 	if (!(dev = kmalloc(sizeof(*dev), GFP_KERNEL))){
-		printk(KERN_CRIT "ibm-iic: failed to allocate device data\n");
+		printk(KERN_CRIT "ibm-iic%d: failed to allocate device data\n",
+			ocp->def->index);
 		return -ENOMEM;
 	}
 
 	memset(dev, 0, sizeof(*dev));
-	dev->idx = ocp->num;
+	dev->idx = ocp->def->index;
 	ocp_set_drvdata(ocp, dev);
 	
-	if (!(dev->vaddr = ioremap(ocp->paddr, sizeof(struct iic_regs)))){
+	if (!(dev->vaddr = ioremap(ocp->def->paddr, sizeof(struct iic_regs)))){
 		printk(KERN_CRIT "ibm-iic%d: failed to ioremap device registers\n",
 			dev->idx);
 		ret = -ENXIO;
@@ -570,7 +585,7 @@ static int __devinit iic_probe(struct ocp_device *ocp){
 	
 	init_waitqueue_head(&dev->wq);
 
-	dev->irq = iic_force_poll ? -1 : ocp->irq;
+	dev->irq = iic_force_poll ? -1 : ocp->def->irq;
 	if (dev->irq >= 0){
 		/* Disable interrupts until we finish intialization,
 		   assumes level-sensitive IRQ setup...
@@ -589,13 +604,12 @@ static int __devinit iic_probe(struct ocp_device *ocp){
 			dev->idx);
 		
 	/* Board specific settings */
-	BUG_ON(dev->idx >= sizeof(bd->bi_iic_fast) / sizeof(bd->bi_iic_fast[0]));
-	dev->fast_mode = iic_force_fast ? 1 : bd->bi_iic_fast[dev->idx];
+	dev->fast_mode = iic_force_fast ? 1 : (iic_data ? iic_data->fast_mode : 0);
 	
 	/* clckdiv is the same for *all* IIC interfaces, 
 	 * but I'd rather make a copy than introduce another global. --ebs
 	 */
-	dev->clckdiv = iic_clckdiv(bd->bi_opb_busfreq);
+	dev->clckdiv = iic_clckdiv(ocp_sys_info.opb_bus_freq);
 	DBG("%d: clckdiv = %d\n", dev->idx, dev->clckdiv);
 	
 	/* Initialize IIC interface */
@@ -664,7 +678,7 @@ static void __devexit iic_remove(struct ocp_device *ocp)
 
 static struct ocp_device_id ibm_iic_ids[] __devinitdata = 
 {
-	{ .vendor = OCP_VENDOR_IBM, .device = OCP_FUNC_IIC },
+	{ .vendor = OCP_VENDOR_IBM, .function = OCP_FUNC_IIC },
 	{ .vendor = OCP_VENDOR_INVALID }
 };
 
@@ -672,7 +686,7 @@ MODULE_DEVICE_TABLE(ocp, ibm_iic_ids);
 
 static struct ocp_driver ibm_iic_driver =
 {
-	.name 		= "ocp_iic",
+	.name 		= "iic",
 	.id_table	= ibm_iic_ids,
 	.probe		= iic_probe,
 	.remove		= __devexit_p(iic_remove),
@@ -685,7 +699,7 @@ static struct ocp_driver ibm_iic_driver =
 static int __init iic_init(void)
 {
 	printk(KERN_INFO "IBM IIC driver v" DRIVER_VERSION "\n");
-	return ocp_module_init(&ibm_iic_driver);
+	return ocp_register_driver(&ibm_iic_driver);
 }
 
 static void __exit iic_exit(void)
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
index 73387ad26..0f54a2a0a 100644
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -43,7 +43,7 @@ static struct i2c_algorithm isa_algorithm = {
 /* There can only be one... */
 static struct i2c_adapter isa_adapter = {
 	.owner		= THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.algo		= &isa_algorithm,
 	.name		= "ISA main adapter",
 };
diff --git a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
index 3c65c9d03..0b606e88d 100644
--- a/drivers/i2c/busses/i2c-keywest.c
+++ b/drivers/i2c/busses/i2c-keywest.c
@@ -48,7 +48,6 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 214f5644c..774a7ef52 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -119,7 +119,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter nforce2_adapter = {
 	.owner          = THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.algo           = &smbus_algorithm,
 	.name   	= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c
index c73fadc06..6798954f0 100644
--- a/drivers/i2c/busses/i2c-parport-light.c
+++ b/drivers/i2c/busses/i2c-parport-light.c
@@ -112,7 +112,7 @@ static struct i2c_algo_bit_data parport_algo_data = {
 
 static struct i2c_adapter parport_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.id		= I2C_HW_B_LP,
 	.algo_data	= &parport_algo_data,
 	.name		= "Parallel port adapter (light)",
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 6a9b764ca..e9560bab5 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -147,7 +147,7 @@ static struct i2c_algo_bit_data parport_algo_data = {
 
 static struct i2c_adapter parport_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.id		= I2C_HW_B_LP,
 	.name		= "Parallel port adapter",
 };
diff --git a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h
index 1f0441e42..284d3f5d3 100644
--- a/drivers/i2c/busses/i2c-parport.h
+++ b/drivers/i2c/busses/i2c-parport.h
@@ -67,13 +67,18 @@ static struct adapter_parm adapter_parm[] = {
 		.getsda	= { 0x40, STAT, 1 },
 		.getscl	= { 0x08, STAT, 1 },
 	},
-	/* type 4: ADM1025 and ADM1032 evaluation boards */
+	/* type 4: ADM1032 evaluation board */
+	{
+		.setsda	= { 0x02, DATA, 1 },
+		.setscl	= { 0x01, DATA, 1 },
+		.getsda	= { 0x10, STAT, 1 },
+		.init	= { 0xf0, DATA, 0 },
+	},
+	/* type 5: ADM1025, ADM1030 and ADM1031 evaluation boards */
 	{
 		.setsda	= { 0x02, DATA, 1 },
 		.setscl	= { 0x01, DATA, 1 },
 		.getsda	= { 0x10, STAT, 1 },
-		.init	= { 0xf0, DATA, 0 }, /* ADM1025 doesn't need this,
-						but it doesn't hurt */
 	},
 };
 
@@ -85,4 +90,5 @@ MODULE_PARM_DESC(type,
 	" 1 = home brew teletext adapter\n"
 	" 2 = Velleman K8000 adapter\n"
 	" 3 = ELV adapter\n"
-	" 4 = ADM1025 and ADM1032 evaluation boards\n");
+	" 4 = ADM1032 evaluation board\n"
+	" 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n");
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 8edc957e5..31ee54341 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -31,9 +31,9 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
+#include <linux/delay.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
@@ -261,7 +261,7 @@ static int piix4_transaction(void)
 
 	/* We will always wait for a fraction of a second! (See PIIX4 docs errata) */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
 
@@ -410,7 +410,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter piix4_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c
index 90b726909..a5040cca3 100644
--- a/drivers/i2c/busses/i2c-sis5595.c
+++ b/drivers/i2c/busses/i2c-sis5595.c
@@ -58,6 +58,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -239,7 +240,7 @@ static int sis5595_transaction(struct i2c_adapter *adap)
 
 	/* We will always wait for a fraction of a second! */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = sis5595_read(SMB_STS_LO);
 	} while (!(temp & 0x40) && (timeout++ < MAX_TIMEOUT));
 
@@ -360,7 +361,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter sis5595_adapter = {
 	.owner		= THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.name		= "unset",
 	.algo		= &smbus_algorithm,
 };
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c
index 516f51abe..437ee28d3 100644
--- a/drivers/i2c/busses/i2c-sis630.c
+++ b/drivers/i2c/busses/i2c-sis630.c
@@ -51,6 +51,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -165,7 +166,7 @@ static int sis630_transaction_wait(struct i2c_adapter *adap, int size)
 
 	/* We will always wait for a fraction of a second! */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = sis630_read(SMB_STS);
 		/* check if block transmitted */
 		if (size == SIS630_BLOCK_DATA && (temp & 0x10))
@@ -456,7 +457,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter sis630_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.name		= "unset",
 	.algo		= &smbus_algorithm,
 };
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
index c1d456b04..c71daa347 100644
--- a/drivers/i2c/busses/i2c-sis96x.c
+++ b/drivers/i2c/busses/i2c-sis96x.c
@@ -36,6 +36,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
+#include <linux/delay.h>
 #include <linux/stddef.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
@@ -139,7 +140,7 @@ static int sis96x_transaction(int size)
 
 	/* We will always wait for a fraction of a second! */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = sis96x_read(SMB_STS);
 	} while (!(temp & 0x0e) && (timeout++ < MAX_TIMEOUT));
 
@@ -260,7 +261,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter sis96x_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c
index 6ed3ff080..fba8f0eae 100644
--- a/drivers/i2c/busses/i2c-via.c
+++ b/drivers/i2c/busses/i2c-via.c
@@ -88,7 +88,7 @@ static struct i2c_algo_bit_data bit_data = {
 
 static struct i2c_adapter vt586b_adapter = {
 	.owner		= THIS_MODULE,
-	.class          = I2C_ADAP_CLASS_SMBUS,
+	.class          = I2C_CLASS_HWMON,
 	.name		= "VIA i2c",
 	.algo_data	= &bit_data,
 };
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
index c45b33f38..fbd4a15d8 100644
--- a/drivers/i2c/busses/i2c-viapro.c
+++ b/drivers/i2c/busses/i2c-viapro.c
@@ -35,6 +35,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
@@ -138,7 +139,7 @@ static int vt596_transaction(void)
 	/* We will always wait for a fraction of a second! 
 	   I don't know if VIA needs this, Intel did  */
 	do {
-		i2c_delay(1);
+		msleep(1);
 		temp = inb_p(SMBHSTSTS);
 	} while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));
 
@@ -289,7 +290,7 @@ static struct i2c_algorithm smbus_algorithm = {
 
 static struct i2c_adapter vt596_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_SMBUS,
+	.class		= I2C_CLASS_HWMON,
 	.algo		= &smbus_algorithm,
 	.name		= "unset",
 };
diff --git a/drivers/i2c/busses/i2c-voodoo3.c b/drivers/i2c/busses/i2c-voodoo3.c
index 3d4fad692..efb677d24 100644
--- a/drivers/i2c/busses/i2c-voodoo3.c
+++ b/drivers/i2c/busses/i2c-voodoo3.c
@@ -167,7 +167,7 @@ static struct i2c_algo_bit_data voo_i2c_bit_data = {
 
 static struct i2c_adapter voodoo3_i2c_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_TV_ANALOG, 
+	.class		= I2C_CLASS_TV_ANALOG, 
 	.name		= "I2C Voodoo3/Banshee adapter",
 	.algo_data	= &voo_i2c_bit_data,
 };
@@ -184,7 +184,7 @@ static struct i2c_algo_bit_data voo_ddc_bit_data = {
 
 static struct i2c_adapter voodoo3_ddc_adapter = {
 	.owner		= THIS_MODULE,
-	.class		= I2C_ADAP_CLASS_DDC, 
+	.class		= I2C_CLASS_DDC, 
 	.name		= "DDC Voodoo3/Banshee adapter",
 	.algo_data	= &voo_ddc_bit_data,
 };
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 2a33ae416..76a9d68c0 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -24,7 +24,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
@@ -44,7 +43,7 @@ MODULE_DESCRIPTION("NatSemi SCx200 ACCESS.bus Driver");
 MODULE_LICENSE("GPL");
 
 #define MAX_DEVICES 4
-static int base[MAX_DEVICES] = { 0x840 };
+static int base[MAX_DEVICES] = { 0x820, 0x840 };
 MODULE_PARM(base, "1-4i");
 MODULE_PARM_DESC(base, "Base addresses for the ACCESS.bus controllers");
 
@@ -511,7 +510,10 @@ static int __init scx200_acb_init(void)
 	/* Verify that this really is a SCx200 processor */
 	if (pci_find_device(PCI_VENDOR_ID_NS,
 			    PCI_DEVICE_ID_NS_SCx200_BRIDGE,
-			    NULL) == NULL)
+			    NULL) == NULL
+	    && pci_find_device(PCI_VENDOR_ID_NS,
+			       PCI_DEVICE_ID_NS_SC1100_BRIDGE,
+			       NULL) == NULL)
 		return -ENODEV;
 
 	rc = -ENXIO;
diff --git a/drivers/i2c/busses/scx200_i2c.c b/drivers/i2c/busses/scx200_i2c.c
index 14bcb0aee..b472fe81a 100644
--- a/drivers/i2c/busses/scx200_i2c.c
+++ b/drivers/i2c/busses/scx200_i2c.c
@@ -21,7 +21,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.		     
 */
 
-#include <linux/config.h>
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index e005b0248..29ba21651 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -136,15 +136,25 @@ config SENSORS_LM85
 
 config SENSORS_LM90
 	tristate "National Semiconductor LM90 and compatibles"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	select I2C_SENSOR
 	help
-	  If you say yes here you get support for National Semiconductor LM90
-	  and Analog Devices ADM1032 sensor chips.
+	  If you say yes here you get support for National Semiconductor LM90,
+	  LM89 and LM99, and Analog Devices ADM1032 sensor chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm90.
 
+config SENSORS_MAX1619
+	tristate "Maxim MAX1619 sensor chip"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for MAX1619 sensor chip.
+	  
+	  This driver can also be built as a module.  If so, the module
+	  will be called max1619.
+
 config SENSORS_VIA686A
 	tristate "VIA686A"
 	depends on I2C && EXPERIMENTAL
@@ -163,7 +173,7 @@ config SENSORS_W83781D
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for the Winbond W8378x series
-	  of sensor chips: the W83781D, W83782D, W83783S and W83682HF,
+	  of sensor chips: the W83781D, W83782D, W83783S and W83627HF,
 	  and the similar Asus AS99127F.
 	  
 	  This driver can also be built as a module.  If so, the module
@@ -230,4 +240,14 @@ config SENSORS_PCF8591
 	  This driver can also be built as a module.  If so, the module
 	  will be called pcf8591.
 
+config SENSORS_RTC8564
+	tristate "Epson 8564 RTC chip"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for the Epson 8564 RTC chip.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-rtc8564.
+
 endmenu
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 6de7d4711..6e85e3f62 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -19,8 +19,10 @@ obj-$(CONFIG_SENSORS_LM80)	+= lm80.o
 obj-$(CONFIG_SENSORS_LM83)	+= lm83.o
 obj-$(CONFIG_SENSORS_LM85)	+= lm85.o
 obj-$(CONFIG_SENSORS_LM90)	+= lm90.o
+obj-$(CONFIG_SENSORS_MAX1619)	+= max1619.o
 obj-$(CONFIG_SENSORS_PCF8574)	+= pcf8574.o
 obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591.o
+obj-$(CONFIG_SENSORS_RTC8564)	+= rtc8564.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
 
diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c
index 5010461cc..73ca01db6 100644
--- a/drivers/i2c/chips/adm1021.c
+++ b/drivers/i2c/chips/adm1021.c
@@ -200,7 +200,7 @@ static DEVICE_ATTR(die_code, S_IRUGO, show_die_code, NULL);
 
 static int adm1021_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, adm1021_detect);
 }
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
index 355972cff..f93b6f676 100644
--- a/drivers/i2c/chips/asb100.c
+++ b/drivers/i2c/chips/asb100.c
@@ -609,7 +609,7 @@ static DEVICE_ATTR(fan1_pwm_enable, S_IRUGO | S_IWUSR,
  */
 static int asb100_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, asb100_detect);
 }
@@ -855,7 +855,13 @@ static int asb100_detach_client(struct i2c_client *client)
 		return err;
 	}
 
-	kfree(i2c_get_clientdata(client));
+	if (i2c_get_clientdata(client)==NULL) {
+		/* subclients */
+		kfree(client);
+	} else {
+		/* main client */
+		kfree(i2c_get_clientdata(client));
+	}
 
 	return 0;
 }
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
index 5d1492ac4..6617ff76c 100644
--- a/drivers/i2c/chips/eeprom.c
+++ b/drivers/i2c/chips/eeprom.c
@@ -203,11 +203,12 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
 	new_client->driver = &eeprom_driver;
 	new_client->flags = 0;
 
+	/* prevent 24RF08 corruption */
+	i2c_smbus_write_quick(new_client, 0);
+
 	/* Now, we do the remaining detection. It is not there, unless you force
 	   the checksum to work out. */
 	if (checksum) {
-		/* prevent 24RF08 corruption */
-		i2c_smbus_write_quick(new_client, 0);
 		cs = 0;
 		for (i = 0; i <= 0x3e; i++)
 			cs += i2c_smbus_read_byte_data(new_client, i);
diff --git a/drivers/i2c/chips/fscher.c b/drivers/i2c/chips/fscher.c
index 1901a524a..ab5b70f86 100644
--- a/drivers/i2c/chips/fscher.c
+++ b/drivers/i2c/chips/fscher.c
@@ -293,7 +293,7 @@ do { \
 
 static int fscher_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, fscher_detect);
 }
diff --git a/drivers/i2c/chips/gl518sm.c b/drivers/i2c/chips/gl518sm.c
index 3258a2892..3481ddbf0 100644
--- a/drivers/i2c/chips/gl518sm.c
+++ b/drivers/i2c/chips/gl518sm.c
@@ -335,7 +335,7 @@ static DEVICE_ATTR(beep_mask, S_IWUSR|S_IRUGO,
 
 static int gl518_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, gl518_detect);
 }
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
index 856d5f572..061a0b800 100644
--- a/drivers/i2c/chips/it87.c
+++ b/drivers/i2c/chips/it87.c
@@ -49,6 +49,54 @@ static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 /* Insmod parameters */
 SENSORS_INSMOD_1(it87);
 
+#define	REG	0x2e	/* The register to read/write */
+#define	DEV	0x07	/* Register: Logical device select */
+#define	VAL	0x2f	/* The value to read/write */
+#define PME	0x04	/* The device with the fan registers in it */
+#define	DEVID	0x20	/* Register: Device ID */
+
+static inline void
+superio_outb(int reg, int val)
+{
+	outb(reg, REG);
+	outb(val, VAL);
+}
+
+static inline int
+superio_inb(int reg)
+{
+	outb(reg, REG);
+	return inb(VAL);
+}
+
+static inline void
+superio_select(void)
+{
+	outb(DEV, REG);
+	outb(PME, VAL);
+}
+
+static inline void
+superio_enter(void)
+{
+	outb(0x87, REG);
+	outb(0x01, REG);
+	outb(0x55, REG);
+	outb(0x55, REG);
+}
+
+static inline void
+superio_exit(void)
+{
+	outb(0x02, REG);
+	outb(0x02, VAL);
+}
+
+/* just IT8712F for now - this should be extended to support the other
+   chips as well */
+#define IT8712F_DEVID 0x8712
+#define IT87_ACT_REG  0x30
+#define IT87_BASE_REG 0x60
 
 /* Update battery voltage after every reading if true */
 static int update_vbat;
@@ -158,6 +206,7 @@ struct it87_data {
 
 
 static int it87_attach_adapter(struct i2c_adapter *adapter);
+static int it87_find(int *address);
 static int it87_detect(struct i2c_adapter *adapter, int address, int kind);
 static int it87_detach_client(struct i2c_client *client);
 
@@ -500,11 +549,35 @@ static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL);
      * when a new adapter is inserted (and it87_driver is still present) */
 static int it87_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, it87_detect);
 }
 
+/* SuperIO detection - will change normal_isa[0] if a chip is found */
+static int it87_find(int *address)
+{
+	u16 val;
+
+	superio_enter();
+	val = (superio_inb(DEVID) << 8) |
+	       superio_inb(DEVID + 1);
+	if (val != IT8712F_DEVID) {
+		superio_exit();
+		return -ENODEV;
+	}
+
+	superio_select();
+	val = (superio_inb(IT87_BASE_REG) << 8) |
+	       superio_inb(IT87_BASE_REG + 1);
+	superio_exit();
+	*address = val & ~(IT87_EXTENT - 1);
+	if (*address == 0) {
+		return -ENODEV;
+	}
+	return 0;
+}
+
 /* This function is called by i2c_detect */
 int it87_detect(struct i2c_adapter *adapter, int address, int kind)
 {
@@ -853,6 +926,11 @@ static struct it87_data *it87_update_device(struct device *dev)
 
 static int __init sm_it87_init(void)
 {
+	int addr;
+
+	if (!it87_find(&addr)) {
+		normal_isa[0] = addr;
+	}
 	return i2c_add_driver(&it87_driver);
 }
 
diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
index 5c6ebdc09..e431db905 100644
--- a/drivers/i2c/chips/lm75.c
+++ b/drivers/i2c/chips/lm75.c
@@ -105,7 +105,7 @@ static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL);
 
 static int lm75_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, lm75_detect);
 }
diff --git a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
index 2d697f428..74a1ca76c 100644
--- a/drivers/i2c/chips/lm78.c
+++ b/drivers/i2c/chips/lm78.c
@@ -488,7 +488,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
      * when a new adapter is inserted (and lm78_driver is still present) */
 static int lm78_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, lm78_detect);
 }
diff --git a/drivers/i2c/chips/lm80.c b/drivers/i2c/chips/lm80.c
index ec8cbe68d..fe78d98a6 100644
--- a/drivers/i2c/chips/lm80.c
+++ b/drivers/i2c/chips/lm80.c
@@ -376,7 +376,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
 static int lm80_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, lm80_detect);
 }
diff --git a/drivers/i2c/chips/lm83.c b/drivers/i2c/chips/lm83.c
index f50e93446..f6023e989 100644
--- a/drivers/i2c/chips/lm83.c
+++ b/drivers/i2c/chips/lm83.c
@@ -216,7 +216,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
 static int lm83_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, lm83_detect);
 }
diff --git a/drivers/i2c/chips/lm90.c b/drivers/i2c/chips/lm90.c
index 111781a50..f28b6679f 100644
--- a/drivers/i2c/chips/lm90.c
+++ b/drivers/i2c/chips/lm90.c
@@ -1,7 +1,7 @@
 /*
  * lm90.c - Part of lm_sensors, Linux kernel modules for hardware
  *          monitoring
- * Copyright (C) 2003  Jean Delvare <khali@linux-fr.org>
+ * Copyright (C) 2003-2004  Jean Delvare <khali@linux-fr.org>
  *
  * Based on the lm83 driver. The LM90 is a sensor chip made by National
  * Semiconductor. It reports up to two temperatures (its own plus up to
@@ -10,6 +10,17 @@
  * obtained from National's website at:
  *   http://www.national.com/pf/LM/LM90.html
  *
+ * This driver also supports the LM89 and LM99, two other sensor chips
+ * made by National Semiconductor. Both have an increased remote
+ * temperature measurement accuracy (1 degree), and the LM99
+ * additionally shifts remote temperatures (measured and limits) by 16
+ * degrees, which allows for higher temperatures measurement. The
+ * driver doesn't handle it since it can be done easily in user-space.
+ * Complete datasheets can be obtained from National's website at:
+ *   http://www.national.com/pf/LM/LM89.html
+ *   http://www.national.com/pf/LM/LM99.html
+ * Note that there is no way to differenciate between both chips.
+ *
  * This driver also supports the ADM1032, a sensor chip made by Analog
  * Devices. That chip is similar to the LM90, with a few differences
  * that are not handled by this driver. Complete datasheet can be
@@ -45,9 +56,11 @@
 /*
  * Addresses to scan
  * Address is fully defined internally and cannot be changed.
+ * LM89, LM90, LM99 and ADM1032 have address 0x4c.
+ * LM89-1, and LM99-1 have address 0x4d.
  */
 
-static unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END };
+static unsigned short normal_i2c[] = { 0x4c, 0x4d, I2C_CLIENT_END };
 static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
 static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
@@ -56,7 +69,7 @@ static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
  * Insmod parameters
  */
 
-SENSORS_INSMOD_2(lm90, adm1032);
+SENSORS_INSMOD_3(lm90, adm1032, lm99);
 
 /*
  * The LM90 registers
@@ -261,7 +274,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
 static int lm90_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, lm90_detect);
 }
@@ -330,16 +343,26 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
 			  LM90_REG_R_CHIP_ID);
 		
 		if (man_id == 0x01) { /* National Semiconductor */
-			if (chip_id >= 0x21 && chip_id < 0x30 /* LM90 */
-			 && (kind == 0 /* skip detection */
-			  || ((i2c_smbus_read_byte_data(new_client,
-				LM90_REG_R_CONFIG2) & 0xF8) == 0x00
-			   && reg_convrate <= 0x09))) {
-				kind = lm90;
+			u8 reg_config2;
+
+			reg_config2 = i2c_smbus_read_byte_data(new_client,
+				      LM90_REG_R_CONFIG2);
+
+			if (kind == 0 /* skip detection */
+			 || ((reg_config2 & 0xF8) == 0x00
+			  && reg_convrate <= 0x09)) {
+				if (address == 0x4C
+				 && (chip_id & 0xF0) == 0x20) { /* LM90 */
+					kind = lm90;
+				} else
+				if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */
+					kind = lm99;
+				}
 			}
-		}
-		else if (man_id == 0x41) { /* Analog Devices */
-			if ((chip_id & 0xF0) == 0x40 /* ADM1032 */
+		} else
+		if (man_id == 0x41) { /* Analog Devices */
+			if (address == 0x4C
+			 && (chip_id & 0xF0) == 0x40 /* ADM1032 */
 			 && (kind == 0 /* skip detection */
 			  || (reg_config1 & 0x3F) == 0x00)) {
 				kind = adm1032;
@@ -358,6 +381,8 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
 		name = "lm90";
 	} else if (kind == adm1032) {
 		name = "adm1032";
+	} else if (kind == lm99) {
+		name = "lm99";
 	}
 
 	/* We can fill in the remaining client fields */
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index d3f14e965..a5ec359b0 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -108,7 +108,7 @@ static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e };
 #define VIA686A_TEMP_MODE_MASK 0x3F
 #define VIA686A_TEMP_MODE_CONTINUOUS (0x00)
 
-/* Conversions. Rounding and limit checking is only done on the TO_REG
+/* Conversions. Limit checking is only done on the TO_REG
    variants. 
 
 ********* VOLTAGE CONVERSIONS (Bob Dougherty) ********
@@ -123,49 +123,41 @@ static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e };
  volts = (25*regVal+133)*factor
  regVal = (volts/factor-133)/25
  (These conversions were contributed by Jonathan Teh Soon Yew 
- <j.teh@iname.com>)
- 
- These get us close, but they don't completely agree with what my BIOS 
- says- they are all a bit low.  But, it all we have to go on... */
+ <j.teh@iname.com>) */
 static inline u8 IN_TO_REG(long val, int inNum)
 {
-	/* to avoid floating point, we multiply everything by 100.
-	 val is guaranteed to be positive, so we can achieve the effect of 
-	 rounding by (...*10+5)/10.  Note that the *10 is hidden in the 
-	 /250 (which should really be /2500).
-	 At the end, we need to /100 because we *100 everything and we need
-	 to /10 because of the rounding thing, so we /1000.   */
+	/* To avoid floating point, we multiply constants by 10 (100 for +12V).
+	   Rounding is done (120500 is actually 133000 - 12500).
+	   Remember that val is expressed in 0.001V/bit, which is why we divide
+	   by an additional 10000 (100000 for +12V): 1000 for val and 10 (100)
+	   for the constants. */
 	if (inNum <= 1)
 		return (u8)
-		    SENSORS_LIMIT(((val * 210240 - 13300) / 250 + 5) / 1000, 
-				  0, 255);
+		    SENSORS_LIMIT((val * 21024 - 1205000) / 250000, 0, 255);
 	else if (inNum == 2)
 		return (u8)
-		    SENSORS_LIMIT(((val * 157370 - 13300) / 250 + 5) / 1000, 
-				  0, 255);
+		    SENSORS_LIMIT((val * 15737 - 1205000) / 250000, 0, 255);
 	else if (inNum == 3)
 		return (u8)
-		    SENSORS_LIMIT(((val * 101080 - 13300) / 250 + 5) / 1000, 
-				  0, 255);
+		    SENSORS_LIMIT((val * 10108 - 1205000) / 250000, 0, 255);
 	else
-		return (u8) SENSORS_LIMIT(((val * 41714 - 13300) / 250 + 5)
-					  / 1000, 0, 255);
+		return (u8)
+		    SENSORS_LIMIT((val * 41714 - 12050000) / 2500000, 0, 255);
 }
 
 static inline long IN_FROM_REG(u8 val, int inNum)
 {
-	/* to avoid floating point, we multiply everything by 100.
-	 val is guaranteed to be positive, so we can achieve the effect of
-	 rounding by adding 0.5.  Or, to avoid fp math, we do (...*10+5)/10.
-	 We need to scale with *100 anyway, so no need to /100 at the end. */
+	/* To avoid floating point, we multiply constants by 10 (100 for +12V).
+	   We also multiply them by 1000 because we want 0.001V/bit for the
+	   output value. Rounding is done. */
 	if (inNum <= 1)
-		return (long) (((250000 * val + 13300) / 210240 * 10 + 5) /10);
+		return (long) ((250000 * val + 1330000 + 21024 / 2) / 21024);
 	else if (inNum == 2)
-		return (long) (((250000 * val + 13300) / 157370 * 10 + 5) /10);
+		return (long) ((250000 * val + 1330000 + 15737 / 2) / 15737);
 	else if (inNum == 3)
-		return (long) (((250000 * val + 13300) / 101080 * 10 + 5) /10);
+		return (long) ((250000 * val + 1330000 + 10108 / 2) / 10108);
 	else
-		return (long) (((250000 * val + 13300) / 41714 * 10 + 5) /10);
+		return (long) ((2500000 * val + 13300000 + 41714 / 2) / 41714);
 }
 
 /********* FAN RPM CONVERSIONS ********/
@@ -276,52 +268,31 @@ static const u8 viaLUT[] =
 	    239, 240
 };
 
-/* Converting temps to (8-bit) hyst and over registers 
- No interpolation here.  Just check the limits and go.
- The +5 effectively rounds off properly and the +50 is because 
- the temps start at -50 */
+/* Converting temps to (8-bit) hyst and over registers
+   No interpolation here.
+   The +50 is because the temps start at -50 */
 static inline u8 TEMP_TO_REG(long val)
 {
-	return (u8)
-	    SENSORS_LIMIT(viaLUT[((val <= -500) ? 0 : (val >= 1100) ? 160 : 
-				  ((val + 5) / 10 + 50))], 0, 255);
+	return viaLUT[val <= -50000 ? 0 : val >= 110000 ? 160 : 
+		      (val < 0 ? val - 500 : val + 500) / 1000 + 50];
 }
 
-/* for 8-bit temperature hyst and over registers 
- The temp values are already *10, so we don't need to do that.
- But we _will_ round these off to the nearest degree with (...*10+5)/10 */
-#define TEMP_FROM_REG(val) ((tempLUT[(val)]*10+5)/10)
+/* for 8-bit temperature hyst and over registers */
+#define TEMP_FROM_REG(val) (tempLUT[(val)] * 100)
 
-/* for 10-bit temperature readings 
- You might _think_ this is too long to inline, but's it's really only
- called once... */
+/* for 10-bit temperature readings */
 static inline long TEMP_FROM_REG10(u16 val)
 {
-	/* the temp values are already *10, so we don't need to do that. */
-	long temp;
 	u16 eightBits = val >> 2;
 	u16 twoBits = val & 3;
 
-	/* handle the extremes first (they won't interpolate well! ;-) */
-	if (val == 0)
-		return (long) tempLUT[0];
-	if (val == 1023)
-		return (long) tempLUT[255];
-
-	if (twoBits == 0)
-		return (long) tempLUT[eightBits];
-	else {
-		/* do some interpolation by multipying the lower and upper
-		 bounds by 25, 50 or 75, then /100. */
-		temp = ((25 * (4 - twoBits)) * tempLUT[eightBits]
-			+ (25 * twoBits) * tempLUT[eightBits + 1]);
-		/* increase the magnitude by 50 to achieve rounding. */
-		if (temp > 0)
-			temp += 50;
-		else
-			temp -= 50;
-		return (temp / 100);
-	}
+	/* no interpolation for these */
+	if (twoBits == 0 || eightBits == 255)
+		return TEMP_FROM_REG(eightBits);
+
+	/* do some linear interpolation */
+	return (tempLUT[eightBits] * (4 - twoBits) +
+	        tempLUT[eightBits + 1] * twoBits) * 25;
 }
 
 #define ALARMS_FROM_REG(val) (val)
@@ -375,24 +346,24 @@ static void via686a_init_client(struct i2c_client *client);
 /* 7 voltage sensors */
 static ssize_t show_in(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in[nr], nr)*10 );
+	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in[nr], nr));
 }
 
 static ssize_t show_in_min(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_min[nr], nr)*10 );
+	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_min[nr], nr));
 }
 
 static ssize_t show_in_max(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_max[nr], nr)*10 );
+	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_max[nr], nr));
 }
 
 static ssize_t set_in_min(struct device *dev, const char *buf, 
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
-	unsigned long val = simple_strtoul(buf, NULL, 10)/10;
+	unsigned long val = simple_strtoul(buf, NULL, 10);
 	data->in_min[nr] = IN_TO_REG(val,nr);
 	via686a_write_value(client, VIA686A_REG_IN_MIN(nr), 
 			data->in_min[nr]);
@@ -402,7 +373,7 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
-	unsigned long val = simple_strtoul(buf, NULL, 10)/10;
+	unsigned long val = simple_strtoul(buf, NULL, 10);
 	data->in_max[nr] = IN_TO_REG(val,nr);
 	via686a_write_value(client, VIA686A_REG_IN_MAX(nr), 
 			data->in_max[nr]);
@@ -449,21 +420,21 @@ show_in_offset(4);
 /* 3 temperatures */
 static ssize_t show_temp(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf, "%ld\n", TEMP_FROM_REG10(data->temp[nr])*100 );
+	return sprintf(buf, "%ld\n", TEMP_FROM_REG10(data->temp[nr]));
 }
 static ssize_t show_temp_over(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_over[nr])*100);
+	return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_over[nr]));
 }
 static ssize_t show_temp_hyst(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_hyst[nr])*100);
+	return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_hyst[nr]));
 }
 static ssize_t set_temp_over(struct device *dev, const char *buf, 
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
-	int val = simple_strtol(buf, NULL, 10)/100;
+	int val = simple_strtol(buf, NULL, 10);
 	data->temp_over[nr] = TEMP_TO_REG(val);
 	via686a_write_value(client, VIA686A_REG_TEMP_OVER(nr), data->temp_over[nr]);
 	return count;
@@ -472,7 +443,7 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
-	int val = simple_strtol(buf, NULL, 10)/100;
+	int val = simple_strtol(buf, NULL, 10);
 	data->temp_hyst[nr] = TEMP_TO_REG(val);
 	via686a_write_value(client, VIA686A_REG_TEMP_HYST(nr), data->temp_hyst[nr]);
 	return count;
@@ -602,7 +573,7 @@ static struct i2c_driver via686a_driver = {
 /* This is called when the module is loaded */
 static int via686a_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, via686a_detect);
 }
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
index b2274c5b7..ac378b54b 100644
--- a/drivers/i2c/chips/w83781d.c
+++ b/drivers/i2c/chips/w83781d.c
@@ -183,8 +183,10 @@ FAN_TO_REG(long rpm, int div)
 #define ALARMS_FROM_REG(val)		(val)
 #define PWM_FROM_REG(val)		(val)
 #define PWM_TO_REG(val)			(SENSORS_LIMIT((val),0,255))
-#define BEEP_MASK_FROM_REG(val)		(val)
-#define BEEP_MASK_TO_REG(val)		((val) & 0xffffff)
+#define BEEP_MASK_FROM_REG(val,type)	((type) == as99127f ? \
+					 (val) ^ 0x7fff : (val))
+#define BEEP_MASK_TO_REG(val,type)	((type) == as99127f ? \
+					 (~(val)) & 0x7fff : (val) & 0xffffff)
 
 #define BEEP_ENABLE_TO_REG(val)		((val) ? 1 : 0)
 #define BEEP_ENABLE_FROM_REG(val)	((val) ? 1 : 0)
@@ -539,14 +541,18 @@ static
 DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL)
 #define device_create_file_alarms(client) \
 device_create_file(&client->dev, &dev_attr_alarms);
-#define show_beep_reg(REG, reg) \
-static ssize_t show_beep_##reg (struct device *dev, char *buf) \
-{ \
-	struct w83781d_data *data = w83781d_update_device(dev); \
-	return sprintf(buf,"%ld\n", (long)BEEP_##REG##_FROM_REG(data->beep_##reg)); \
+static ssize_t show_beep_mask (struct device *dev, char *buf)
+{
+	struct w83781d_data *data = w83781d_update_device(dev);
+	return sprintf(buf, "%ld\n",
+		       (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type));
+}
+static ssize_t show_beep_enable (struct device *dev, char *buf)
+{
+	struct w83781d_data *data = w83781d_update_device(dev);
+	return sprintf(buf, "%ld\n",
+		       (long)BEEP_ENABLE_FROM_REG(data->beep_enable));
 }
-show_beep_reg(ENABLE, enable);
-show_beep_reg(MASK, mask);
 
 #define BEEP_ENABLE			0	/* Store beep_enable */
 #define BEEP_MASK			1	/* Store beep_mask */
@@ -562,7 +568,7 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
 	val = simple_strtoul(buf, NULL, 10);
 
 	if (update_mask == BEEP_MASK) {	/* We are storing beep_mask */
-		data->beep_mask = BEEP_MASK_TO_REG(val);
+		data->beep_mask = BEEP_MASK_TO_REG(val, data->type);
 		w83781d_write_value(client, W83781D_REG_BEEP_INTS1,
 				    data->beep_mask & 0xff);
 
@@ -905,7 +911,7 @@ device_create_file(&client->dev, &dev_attr_rt##offset); \
 static int
 w83781d_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, w83781d_detect);
 }
@@ -1330,7 +1336,13 @@ w83781d_detach_client(struct i2c_client *client)
 		return err;
 	}
 
-	kfree(i2c_get_clientdata(client));
+	if (i2c_get_clientdata(client)==NULL) {
+		/* subclients */
+		kfree(client);
+	} else {
+		/* main client */
+		kfree(i2c_get_clientdata(client));
+	}
 
 	return 0;
 }
diff --git a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c
index 0062d86f1..52118f9bf 100644
--- a/drivers/i2c/chips/w83l785ts.c
+++ b/drivers/i2c/chips/w83l785ts.c
@@ -32,6 +32,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
@@ -145,7 +146,7 @@ static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL)
 
 static int w83l785ts_attach_adapter(struct i2c_adapter *adapter)
 {
-	if (!(adapter->class & I2C_ADAP_CLASS_SMBUS))
+	if (!(adapter->class & I2C_CLASS_HWMON))
 		return 0;
 	return i2c_detect(adapter, &addr_data, w83l785ts_detect);
 }
@@ -284,7 +285,7 @@ static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval)
 		if (value >= 0)
 			return value;
 		dev_dbg(&client->dev, "Read failed, will retry in %d.\n", i);
-		i2c_delay(i);
+		msleep(i);
 	}
 
 	dev_err(&client->dev, "Couldn't read value from register. "
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 8663e1b8a..56225a516 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
+#include <linux/idr.h>
 #include <linux/seq_file.h>
 #include <asm/uaccess.h>
 
@@ -35,6 +36,7 @@
 static LIST_HEAD(adapters);
 static LIST_HEAD(drivers);
 static DECLARE_MUTEX(core_lists);
+static DEFINE_IDR(i2c_adapter_idr);
 
 int i2c_device_probe(struct device *dev)
 {
@@ -113,13 +115,19 @@ static struct device_attribute dev_attr_client_name = {
  */
 int i2c_add_adapter(struct i2c_adapter *adap)
 {
-	static int nr = 0;
+	int id, res = 0;
 	struct list_head   *item;
 	struct i2c_driver  *driver;
 
 	down(&core_lists);
 
-	adap->nr = nr++;
+	if (idr_pre_get(&i2c_adapter_idr, GFP_KERNEL) == 0) {
+		res = -ENOMEM;
+		goto out_unlock;
+	}
+
+	id = idr_get_new(&i2c_adapter_idr, NULL);
+	adap->nr =  id & MAX_ID_MASK;
 	init_MUTEX(&adap->bus_lock);
 	init_MUTEX(&adap->clist_lock);
 	list_add_tail(&adap->list,&adapters);
@@ -151,10 +159,12 @@ int i2c_add_adapter(struct i2c_adapter *adap)
 			/* We ignore the return code; if it fails, too bad */
 			driver->attach_adapter(adap);
 	}
-	up(&core_lists);
 
 	dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr);
-	return 0;
+
+ out_unlock:
+	up(&core_lists);
+	return res;
 }
 
 
@@ -208,6 +218,9 @@ int i2c_del_adapter(struct i2c_adapter *adap)
 	wait_for_completion(&adap->dev_released);
 	wait_for_completion(&adap->class_dev_released);
 
+	/* free dynamically allocated bus id */
+	idr_remove(&i2c_adapter_idr, adap->nr);
+
 	dev_dbg(&adap->dev, "adapter unregistered\n");
 
  out_unlock:
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 6e9badb85..91e9282b4 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -157,20 +157,6 @@ config IDEDISK_MULTI_MODE
 
 	  If in doubt, say N.
 
-config IDEDISK_STROKE
-	bool "Auto-Geometry Resizing support"
-	depends on BLK_DEV_IDEDISK
-	help
-	  Should you have a system w/ an AWARD Bios and your drives are larger
-	  than 32GB and it will not boot, one is required to perform a few OEM
-	  operations first.  The option is called "STROKE" because it allows
-	  one to "soft clip" the drive to work around a barrier limit.  For
-	  Maxtor drives it is called "jumpon.exe".  Please search Maxtor's
-	  web-site for "JUMPON.EXE".  IBM has a similar tool at:
-	  <http://www.storage.ibm.com/hdd/support/download.htm>.
-
-	  If you are unsure, say N here.
-
 config BLK_DEV_IDECS
 	tristate "PCMCIA IDE support"
 	depends on PCMCIA
@@ -387,8 +373,8 @@ config BLK_DEV_OFFBOARD
 	  If in doubt, say N.
 
 config BLK_DEV_GENERIC
-	bool "Generic PCI IDE Chipset Support"
-	depends on PCI && BLK_DEV_IDEPCI
+	tristate "Generic PCI IDE Chipset Support"
+	depends on BLK_DEV_IDEPCI
 
 config BLK_DEV_OPTI621
 	tristate "OPTi 82C621 chipset enhanced support (EXPERIMENTAL)"
@@ -438,48 +424,6 @@ config BLK_DEV_IDEDMA_PCI
 
 if BLK_DEV_IDEDMA_PCI
 
-# TCQ is disabled for now
-config BLK_DEV_IDE_TCQ
-	bool "ATA tagged command queueing (EXPERIMENTAL)"
-	depends on EXPERIMENTAL && n
-	help
-	  Support for tagged command queueing on ATA disk drives. This enables
-	  the IDE layer to have multiple in-flight requests on hardware that
-	  supports it. For now this includes the IBM Deskstar series drives,
-	  such as the 22GXP, 75GXP, 40GV, 60GXP, and 120GXP (ie any Deskstar made
-	  in the last couple of years), and at least some of the Western
-	  Digital drives in the Expert series (by nature of really being IBM
-	  drives).
-
-	  If you have such a drive, say Y here.
-
-config BLK_DEV_IDE_TCQ_DEFAULT
-	bool "TCQ on by default"
-	depends on BLK_DEV_IDE_TCQ
-	---help---
-	  Enable tagged command queueing unconditionally on drives that report
-	  support for it. Regardless of the chosen value here, tagging can be
-	  controlled at run time:
-
-	  echo "using_tcq:32" > /proc/ide/hdX/settings
-
-	  where any value between 1-32 selects chosen queue depth and enables
-	  TCQ, and 0 disables it. hdparm version 4.7 an above also support
-	  TCQ manipulations.
-
-	  Generally say Y here.
-
-config BLK_DEV_IDE_TCQ_DEPTH
-	int "Default queue depth"
-	depends on BLK_DEV_IDE_TCQ
-	default "8"
-	help
-	  Maximum size of commands to enable per-drive. Any value between 1
-	  and 32 is valid, with 32 being the maxium that the hardware supports.
-
-	  You probably just want the default of 32 here. If you enter an invalid
-	  number, the default value will be used.
-
 config BLK_DEV_IDEDMA_FORCED
 	bool "Force enable legacy 2.0.X HOSTS to use DMA"
 	help
@@ -851,9 +795,8 @@ config BLK_DEV_IDEDMA_PMAC_AUTO
 	  hardware may have caused damage.  Saying Y should be safe on all
 	  Apple machines.
 
-config BLK_DEV_IDE_SWARM
-	bool "SWARM onboard IDE support"
-	depends on SIBYTE_SWARM
+config IDE_ARM
+	def_bool ARM && (ARCH_A5K || ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
 
 config BLK_DEV_IDE_ICSIDE
 	tristate "ICS IDE interface support"
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile
index 7cc48f1f4..462976033 100644
--- a/drivers/ide/Makefile
+++ b/drivers/ide/Makefile
@@ -25,6 +25,9 @@ ide-core-$(CONFIG_BLK_DEV_IDE_TCQ)	+= ide-tcq.o
 ide-core-$(CONFIG_PROC_FS)		+= ide-proc.o
 ide-core-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
 
+# built-in only drivers from arm/
+ide-core-$(CONFIG_IDE_ARM)		+= arm/ide_arm.o
+
 # built-in only drivers from legacy/
 ide-core-$(CONFIG_BLK_DEV_IDE_PC9800)	+= legacy/pc9800.o
 ide-core-$(CONFIG_BLK_DEV_BUDDHA)	+= legacy/buddha.o
@@ -36,7 +39,9 @@ ide-core-$(CONFIG_BLK_DEV_Q40IDE)	+= legacy/q40ide.o
 # built-in only drivers from ppc/
 ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE)	+= ppc/mpc8xx.o
 ide-core-$(CONFIG_BLK_DEV_IDE_PMAC)	+= ppc/pmac.o
-ide-core-$(CONFIG_BLK_DEV_IDE_SWARM)	+= ppc/swarm.o
+
+# built-in only drivers from h8300/
+ide-core-$(CONFIG_H8300)		+= h8300/ide-h8300.o
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= ide-core.o
 obj-$(CONFIG_IDE_GENERIC)		+= ide-generic.o
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 95a44a93b..6f14bbfc3 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -535,9 +535,7 @@ static void cdrom_prepare_request(struct request *rq)
 	rq->flags = REQ_PC;
 }
 
-static void cdrom_queue_request_sense(ide_drive_t *drive, 
-				      struct completion *wait,
-				      void *sense,
+static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
 				      struct request *failed_command)
 {
 	struct cdrom_info *info		= drive->driver_data;
@@ -554,7 +552,6 @@ static void cdrom_queue_request_sense(ide_drive_t *drive,
 	rq->cmd[4] = rq->data_len = 18;
 
 	rq->flags = REQ_SENSE;
-	rq->waiting = wait;
 
 	/* NOTE! Save the failed command in "rq->buffer" */
 	rq->buffer = (void *) failed_command;
@@ -574,7 +571,7 @@ ide_startstop_t ide_cdrom_error (ide_drive_t *drive, const char *msg, byte stat)
 	if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
 		return ide_stopped;
 	/* retry only "normal" I/O: */
-	if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK)) {
+	if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) {
 		rq->errors = 1;
 		ide_end_drive_cmd(drive, stat, err);
 		return ide_stopped;
@@ -608,7 +605,7 @@ ide_startstop_t ide_cdrom_abort (ide_drive_t *drive, const char *msg)
 	if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
 		return ide_stopped;
 	/* retry only "normal" I/O: */
-	if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK)) {
+	if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) {
 		rq->errors = 1;
 		ide_end_drive_cmd(drive, BUSY_STAT, 0);
 		return ide_stopped;
@@ -631,10 +628,21 @@ static void cdrom_end_request (ide_drive_t *drive, int uptodate)
 		struct request *failed = (struct request *) rq->buffer;
 		struct cdrom_info *info = drive->driver_data;
 		void *sense = &info->sense_data;
-		
-		if (failed && failed->sense) {
-			sense = failed->sense;
-			failed->sense_len = rq->sense_len;
+		unsigned long flags;
+
+		if (failed) {
+			if (failed->sense) {
+				sense = failed->sense;
+				failed->sense_len = rq->sense_len;
+			}
+
+			/*
+			 * now end failed request
+			 */
+			spin_lock_irqsave(&ide_lock, flags);
+			end_that_request_chunk(failed, 0, failed->data_len);
+			end_that_request_last(failed);
+			spin_unlock_irqrestore(&ide_lock, flags);
 		}
 
 		cdrom_analyze_sense_data(drive, failed, sense);
@@ -642,6 +650,9 @@ static void cdrom_end_request (ide_drive_t *drive, int uptodate)
 
 	if (!rq->current_nr_sectors && blk_fs_request(rq))
 		uptodate = 1;
+	/* make sure it's fully ended */
+	if (blk_pc_request(rq))
+		nsectors = (rq->data_len + 511) >> 9;
 	if (!nsectors)
 		nsectors = 1;
 
@@ -684,7 +695,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 
 	} else if (rq->flags & (REQ_PC | REQ_BLOCK_PC)) {
 		/* All other functions, except for READ. */
-		struct completion *wait = NULL;
+		unsigned long flags;
 
 		/*
 		 * if we have an error, pass back CHECK_CONDITION as the
@@ -706,30 +717,23 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 			ide_dump_status(drive, "packet command error", stat);
 		}
 		
-		/* Set the error flag and complete the request.
-		   Then, if we have a CHECK CONDITION status,
-		   queue a request sense command.  We must be careful,
-		   though: we don't want the thread in
-		   cdrom_queue_packet_command to wake up until
-		   the request sense has completed.  We do this
-		   by transferring the semaphore from the packet
-		   command request to the request sense request. */
-
 		rq->flags |= REQ_FAILED;
-		if ((stat & ERR_STAT) != 0) {
-			wait = rq->waiting;
-			rq->waiting = NULL;
-			if ((rq->flags & REQ_BLOCK_PC) != 0) {
-				cdrom_queue_request_sense(drive, wait,
-							  rq->sense, rq);
-				return 1; /* REQ_BLOCK_PC self-cares */
-			}
-		}
 
-		cdrom_end_request(drive, 0);
+		/*
+		 * instead of playing games with moving completions around,
+		 * remove failed request completely and end it when the
+		 * request sense has completed
+		 */
+		if (stat & ERR_STAT) {
+			spin_lock_irqsave(&ide_lock, flags);
+			blkdev_dequeue_request(rq);
+			HWGROUP(drive)->rq = NULL;
+			spin_unlock_irqrestore(&ide_lock, flags);
+
+			cdrom_queue_request_sense(drive, rq->sense, rq);
+		} else
+			cdrom_end_request(drive, 0);
 
-		if ((stat & ERR_STAT) != 0)
-			cdrom_queue_request_sense(drive, wait, rq->sense, rq);
 	} else if (blk_fs_request(rq)) {
 		int do_end_request = 0;
 
@@ -818,7 +822,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 		/* If we got a CHECK_CONDITION status,
 		   queue a request sense command. */
 		if ((stat & ERR_STAT) != 0)
-			cdrom_queue_request_sense(drive, NULL, NULL, NULL);
+			cdrom_queue_request_sense(drive, NULL, NULL);
 	} else {
 		blk_dump_rq_flags(rq, "ide-cd: bad rq");
 		cdrom_end_request(drive, 0);
@@ -1666,14 +1670,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
 		dma_error = HWIF(drive)->ide_dma_end(drive);
 	}
 
-	if (cdrom_decode_status(drive, 0, &stat)) {
-		if ((stat & ERR_STAT) != 0) {
-			end_that_request_chunk(rq, 0, rq->data_len);
-			goto end_request; /* purge the whole thing... */
-		}
-		end_that_request_chunk(rq, 1, rq->data_len);
+	if (cdrom_decode_status(drive, 0, &stat))
 		return ide_stopped;
-	}
 
 	/*
 	 * using dma, transfer is complete now
@@ -2491,7 +2489,7 @@ static int cdrom_get_toc_entry(ide_drive_t *drive, int track,
 
 /* the generic packet interface to cdrom.c */
 static int ide_cdrom_packet(struct cdrom_device_info *cdi,
-			    struct cdrom_generic_command *cgc)
+			    struct packet_command *cgc)
 {
 	struct request req;
 	ide_drive_t *drive = (ide_drive_t*) cdi->handle;
@@ -2524,7 +2522,7 @@ static
 int ide_cdrom_dev_ioctl (struct cdrom_device_info *cdi,
 			 unsigned int cmd, unsigned long arg)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char buffer[16];
 	int stat;
 
@@ -2535,7 +2533,7 @@ int ide_cdrom_dev_ioctl (struct cdrom_device_info *cdi,
  	case CDROMSETSPINDOWN: {
  		char spindown;
  
- 		if (copy_from_user(&spindown, (void *) arg, sizeof(char)))
+ 		if (copy_from_user(&spindown, (void __user *) arg, sizeof(char)))
 			return -EFAULT;
  
                 if ((stat = cdrom_mode_sense(cdi, &cgc, GPMODE_CDROM_PAGE, 0)))
@@ -2554,7 +2552,7 @@ int ide_cdrom_dev_ioctl (struct cdrom_device_info *cdi,
  
  		spindown = buffer[11] & 0x0f;
  
-		if (copy_to_user((void *) arg, &spindown, sizeof (char)))
+		if (copy_to_user((void __user *) arg, &spindown, sizeof (char)))
 			return -EFAULT;
  
  		return 0;
@@ -2908,7 +2906,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, struct atapi_capabilities_pag
 {
 	struct cdrom_info *info = drive->driver_data;
 	struct cdrom_device_info *cdi = &info->devinfo;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int stat, attempts = 3, size = sizeof(*cap);
 
 	/*
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index ac94367ee..9217f0ced 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -45,6 +45,8 @@
 
 #undef REALLY_SLOW_IO		/* most systems can safely undef this */
 
+//#define DEBUG
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -118,20 +120,6 @@ static int lba_capacity_is_ok (struct hd_driveid *id)
 	return 0;	/* lba_capacity value may be bad */
 }
 
-static int idedisk_start_tag(ide_drive_t *drive, struct request *rq)
-{
-	unsigned long flags;
-	int ret = 1;
-
-	spin_lock_irqsave(&ide_lock, flags);
-
-	if (ata_pending_commands(drive) < drive->queue_depth)
-		ret = blk_queue_start_tag(drive->queue, rq);
-
-	spin_unlock_irqrestore(&ide_lock, flags);
-	return ret;
-}
-
 #ifndef CONFIG_IDE_TASKFILE_IO
 
 /*
@@ -358,13 +346,6 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 
 	nsectors.all		= (u16) rq->nr_sectors;
 
-	if (drive->using_tcq && idedisk_start_tag(drive, rq)) {
-		if (!ata_pending_commands(drive))
-			BUG();
-
-		return ide_started;
-	}
-
 	if (IDE_CONTROL_REG)
 		hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
 
@@ -372,18 +353,12 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 		if (drive->addressing == 1) {
 			task_ioreg_t tasklets[10];
 
-			if (blk_rq_tagged(rq)) {
-				tasklets[0] = nsectors.b.low;
-				tasklets[1] = nsectors.b.high;
-				tasklets[2] = rq->tag << 3;
-				tasklets[3] = 0;
-			} else {
-				tasklets[0] = 0;
-				tasklets[1] = 0;
-				tasklets[2] = nsectors.b.low;
-				tasklets[3] = nsectors.b.high;
-			}
+			pr_debug("%s: LBA=0x%012llx\n", drive->name, block);
 
+			tasklets[0] = 0;
+			tasklets[1] = 0;
+			tasklets[2] = nsectors.b.low;
+			tasklets[3] = nsectors.b.high;
 			tasklets[4] = (task_ioreg_t) block;
 			tasklets[5] = (task_ioreg_t) (block>>8);
 			tasklets[6] = (task_ioreg_t) (block>>16);
@@ -396,14 +371,6 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 				tasklets[9] = (task_ioreg_t)((u64)block >> 40);
 			}
 #ifdef DEBUG
-			printk("%s: %sing: LBAsect=%lu, sectors=%ld, "
-				"buffer=0x%08lx, LBAsect=0x%012lx\n",
-				drive->name,
-				rq_data_dir(rq)==READ?"read":"writ",
-				block,
-				rq->nr_sectors,
-				(unsigned long) rq->buffer,
-				block);
 			printk("%s: 0x%02x%02x 0x%02x%02x%02x%02x%02x%02x\n",
 				drive->name, tasklets[3], tasklets[2],
 				tasklets[9], tasklets[8], tasklets[7],
@@ -422,22 +389,8 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 			hwif->OUTB(tasklets[6], IDE_HCYL_REG);
 			hwif->OUTB(0x00|drive->select.all,IDE_SELECT_REG);
 		} else {
-#ifdef DEBUG
-			printk("%s: %sing: LBAsect=%llu, sectors=%ld, "
-				"buffer=0x%08lx\n",
-				drive->name,
-				rq_data_dir(rq)==READ?"read":"writ",
-				(unsigned long long)block, rq->nr_sectors,
-				(unsigned long) rq->buffer);
-#endif
-			if (blk_rq_tagged(rq)) {
-				hwif->OUTB(nsectors.b.low, IDE_FEATURE_REG);
-				hwif->OUTB(rq->tag << 3, IDE_NSECTOR_REG);
-			} else {
-				hwif->OUTB(0x00, IDE_FEATURE_REG);
-				hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
-			}
-
+			hwif->OUTB(0x00, IDE_FEATURE_REG);
+			hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
 			hwif->OUTB(block, IDE_SECTOR_REG);
 			hwif->OUTB(block>>=8, IDE_LCYL_REG);
 			hwif->OUTB(block>>=8, IDE_HCYL_REG);
@@ -451,29 +404,16 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 		head  = track % drive->head;
 		cyl   = track / drive->head;
 
-		if (blk_rq_tagged(rq)) {
-			hwif->OUTB(nsectors.b.low, IDE_FEATURE_REG);
-			hwif->OUTB(rq->tag << 3, IDE_NSECTOR_REG);
-		} else {
-			hwif->OUTB(0x00, IDE_FEATURE_REG);
-			hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
-		}
+		pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);
 
+		hwif->OUTB(0x00, IDE_FEATURE_REG);
+		hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
 		hwif->OUTB(cyl, IDE_LCYL_REG);
 		hwif->OUTB(cyl>>8, IDE_HCYL_REG);
 		hwif->OUTB(head|drive->select.all,IDE_SELECT_REG);
-#ifdef DEBUG
-		printk("%s: %sing: CHS=%d/%d/%d, sectors=%ld, buffer=0x%08lx\n",
-			drive->name, rq_data_dir(rq)==READ?"read":"writ", cyl,
-			head, sect, rq->nr_sectors, (unsigned long) rq->buffer);
-#endif
 	}
 
 	if (rq_data_dir(rq) == READ) {
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-		if (blk_rq_tagged(rq))
-			return __ide_dma_queued_read(drive);
-#endif
 		if (drive->using_dma && !hwif->ide_dma_read(drive))
 			return ide_started;
 
@@ -482,12 +422,9 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 			   ((lba48) ? WIN_READ_EXT : WIN_READ));
 		ide_execute_command(drive, command, &read_intr, WAIT_CMD, NULL);
 		return ide_started;
-	} else if (rq_data_dir(rq) == WRITE) {
+	} else {
 		ide_startstop_t startstop;
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-		if (blk_rq_tagged(rq))
-			return __ide_dma_queued_write(drive);
-#endif
+
 		if (drive->using_dma && !(HWIF(drive)->ide_dma_write(drive)))
 			return ide_started;
 
@@ -520,9 +457,6 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
 		}
 		return ide_started;
 	}
-	blk_dump_rq_flags(rq, "__ide_do_rw_disk - bad command");
-	ide_end_request(drive, 0, 0);
-	return ide_stopped;
 }
 EXPORT_SYMBOL_GPL(__ide_do_rw_disk);
 
@@ -539,26 +473,11 @@ static ide_startstop_t lba_48_rw_disk(ide_drive_t *, struct request *, unsigned
  */
 ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block)
 {
-	BUG_ON(drive->blocked);
-	if (!blk_fs_request(rq)) {
-		blk_dump_rq_flags(rq, "__ide_do_rw_disk - bad command");
-		ide_end_request(drive, 0, 0);
-		return ide_stopped;
-	}
-
 	/*
 	 * 268435455  == 137439 MB or 28bit limit
 	 *
 	 * need to add split taskfile operations based on 28bit threshold.
 	 */
-
-	if (drive->using_tcq && idedisk_start_tag(drive, rq)) {
-		if (!ata_pending_commands(drive))
-			BUG();
-
-		return ide_started;
-	}
-
 	if (drive->addressing == 1)		/* 48-bit LBA */
 		return lba_48_rw_disk(drive, rq, (unsigned long long) block);
 	if (drive->select.b.lba)		/* 28-bit LBA */
@@ -575,8 +494,6 @@ static u8 get_command(ide_drive_t *drive, int cmd, ide_task_t *task)
 
 	if (cmd == READ) {
 		task->command_type = IDE_DRIVE_TASK_IN;
-		if (drive->using_tcq)
-			return lba48 ? WIN_READDMA_QUEUED_EXT : WIN_READDMA_QUEUED;
 		if (drive->using_dma)
 			return lba48 ? WIN_READDMA_EXT : WIN_READDMA;
 		if (drive->mult_count) {
@@ -587,8 +504,6 @@ static u8 get_command(ide_drive_t *drive, int cmd, ide_task_t *task)
 		return lba48 ? WIN_READ_EXT : WIN_READ;
 	} else {
 		task->command_type = IDE_DRIVE_TASK_RAW_WRITE;
-		if (drive->using_tcq)
-			return lba48 ? WIN_WRITEDMA_QUEUED_EXT : WIN_WRITEDMA_QUEUED;
 		if (drive->using_dma)
 			return lba48 ? WIN_WRITEDMA_EXT : WIN_WRITEDMA;
 		if (drive->mult_count) {
@@ -614,23 +529,13 @@ static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsi
 
 	nsectors.all = (u16) rq->nr_sectors;
 
-#ifdef DEBUG
-	printk("%s: %sing: ", drive->name, (rq_data_dir(rq)==READ) ? "read" : "writ");
-	printk("CHS=%d/%d/%d, ", cyl, head, sect);
-	printk("sectors=%ld, ", rq->nr_sectors);
-	printk("buffer=0x%08lx\n", (unsigned long) rq->buffer);
-#endif
+	pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);
 
 	memset(&args, 0, sizeof(ide_task_t));
 
 	sectors	= (rq->nr_sectors == 256) ? 0x00 : rq->nr_sectors;
 
-	if (blk_rq_tagged(rq)) {
-		args.tfRegister[IDE_FEATURE_OFFSET] = sectors;
-		args.tfRegister[IDE_NSECTOR_OFFSET] = rq->tag << 3;
-	} else
-		args.tfRegister[IDE_NSECTOR_OFFSET] = sectors;
-
+	args.tfRegister[IDE_NSECTOR_OFFSET]	= sectors;
 	args.tfRegister[IDE_SECTOR_OFFSET]	= sect;
 	args.tfRegister[IDE_LCYL_OFFSET]	= cyl;
 	args.tfRegister[IDE_HCYL_OFFSET]	= (cyl>>8);
@@ -650,23 +555,11 @@ static ide_startstop_t lba_28_rw_disk (ide_drive_t *drive, struct request *rq, u
 
 	nsectors.all = (u16) rq->nr_sectors;
 
-#ifdef DEBUG
-	printk("%s: %sing: ", drive->name, (rq_data_dir(rq)==READ) ? "read" : "writ");
-	printk("LBAsect=%lld, ", block);
-	printk("sectors=%ld, ", rq->nr_sectors);
-	printk("buffer=0x%08lx\n", (unsigned long) rq->buffer);
-#endif
-
 	memset(&args, 0, sizeof(ide_task_t));
 
 	sectors = (rq->nr_sectors == 256) ? 0x00 : rq->nr_sectors;
 
-	if (blk_rq_tagged(rq)) {
-		args.tfRegister[IDE_FEATURE_OFFSET] = sectors;
-		args.tfRegister[IDE_NSECTOR_OFFSET] = rq->tag << 3;
-	} else
-		args.tfRegister[IDE_NSECTOR_OFFSET] = sectors;
-
+	args.tfRegister[IDE_NSECTOR_OFFSET]	= sectors;
 	args.tfRegister[IDE_SECTOR_OFFSET]	= block;
 	args.tfRegister[IDE_LCYL_OFFSET]	= (block>>=8);
 	args.tfRegister[IDE_HCYL_OFFSET]	= (block>>=8);
@@ -692,27 +585,12 @@ static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, u
 
 	nsectors.all = (u16) rq->nr_sectors;
 
-#ifdef DEBUG
-	printk("%s: %sing: ", drive->name, (rq_data_dir(rq)==READ) ? "read" : "writ");
-	printk("LBAsect=%lld, ", block);
-	printk("sectors=%ld, ", rq->nr_sectors);
-	printk("buffer=0x%08lx\n", (unsigned long) rq->buffer);
-#endif
-
 	memset(&args, 0, sizeof(ide_task_t));
 
 	sectors = (rq->nr_sectors == 65536) ? 0 : rq->nr_sectors;
 
-	if (blk_rq_tagged(rq)) {
-		args.tfRegister[IDE_FEATURE_OFFSET] = sectors;
-		args.tfRegister[IDE_NSECTOR_OFFSET] = rq->tag << 3;
-		args.hobRegister[IDE_FEATURE_OFFSET] = sectors >> 8;
-		args.hobRegister[IDE_NSECTOR_OFFSET] = 0;
-	} else {
-		args.tfRegister[IDE_NSECTOR_OFFSET] = sectors;
-		args.hobRegister[IDE_NSECTOR_OFFSET] = sectors >> 8;
-	}
-
+	args.tfRegister[IDE_NSECTOR_OFFSET]	= sectors;
+	args.hobRegister[IDE_NSECTOR_OFFSET]	= sectors >> 8;
 	args.tfRegister[IDE_SECTOR_OFFSET]	= block;	/* low lba */
 	args.tfRegister[IDE_LCYL_OFFSET]	= (block>>=8);	/* mid lba */
 	args.tfRegister[IDE_HCYL_OFFSET]	= (block>>=8);	/* hi  lba */
@@ -734,14 +612,24 @@ static ide_startstop_t ide_do_rw_disk (ide_drive_t *drive, struct request *rq, s
 {
 	ide_hwif_t *hwif = HWIF(drive);
 
+	BUG_ON(drive->blocked);
+
+	if (!blk_fs_request(rq)) {
+		blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command");
+		ide_end_request(drive, 0, 0);
+		return ide_stopped;
+	}
+
+	pr_debug("%s: %sing: block=%llu, sectors=%lu, buffer=0x%08lx\n",
+		 drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
+		 block, rq->nr_sectors, (unsigned long)rq->buffer);
+
 	if (hwif->rw_disk)
 		return hwif->rw_disk(drive, rq, block);
 	else
 		return __ide_do_rw_disk(drive, rq, block);
 }
 
-static int do_idedisk_flushcache(ide_drive_t *drive);
-
 static u8 idedisk_dump_status (ide_drive_t *drive, const char *msg, u8 stat)
 {
 	ide_hwif_t *hwif = HWIF(drive);
@@ -823,7 +711,6 @@ ide_startstop_t idedisk_error (ide_drive_t *drive, const char *msg, u8 stat)
 	ide_hwif_t *hwif;
 	struct request *rq;
 	u8 err;
-	int i = (drive->mult_count ? drive->mult_count : 1) * SECTOR_WORDS;
 
 	err = idedisk_dump_status(drive, msg, stat);
 
@@ -863,22 +750,8 @@ ide_startstop_t idedisk_error (ide_drive_t *drive, const char *msg, u8 stat)
 			rq->errors |= ERROR_RECAL;
 		}
 	}
-	if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ) {
-		/*
-		 * try_to_flush_leftover_data() is invoked in response to
-		 * a drive unexpectedly having its DRQ_STAT bit set.  As
-		 * an alternative to resetting the drive, this routine
-		 * tries to clear the condition by read a sector's worth
-		 * of data from the drive.  Of course, this may not help
-		 * if the drive is *waiting* for data from *us*.
-		 */
-		while (i > 0) {
-			u32 buffer[16];
-			unsigned int wcount = (i > 16) ? 16 : i;
-			i -= wcount;
-			taskfile_input_data(drive, buffer, wcount);
-		}
-	}
+	if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ)
+		try_to_flush_leftover_data(drive);
 	if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) {
 		/* force an abort */
 		hwif->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG);
@@ -975,7 +848,6 @@ static unsigned long long idedisk_read_native_max_address_ext(ide_drive_t *drive
 	return addr;
 }
 
-#ifdef CONFIG_IDEDISK_STROKE
 /*
  * Sets maximum virtual LBA address of the drive.
  * Returns new maximum virtual LBA address (> 0) or 0 on failure.
@@ -1044,8 +916,6 @@ static unsigned long long idedisk_set_max_address_ext(ide_drive_t *drive, unsign
 	return addr_set;
 }
 
-#endif /* CONFIG_IDEDISK_STROKE */
-
 static unsigned long long sectors_to_MB(unsigned long long n)
 {
 	n <<= 9;		/* make it bytes */
@@ -1092,7 +962,10 @@ static inline void idedisk_check_hpa(ide_drive_t *drive)
 			 drive->name,
 			 capacity, sectors_to_MB(capacity),
 			 set_max, sectors_to_MB(set_max));
-#ifdef CONFIG_IDEDISK_STROKE
+
+	if (!drive->stroke)
+		return;
+
 	if (lba48)
 		set_max = idedisk_set_max_address_ext(drive, set_max);
 	else
@@ -1102,7 +975,6 @@ static inline void idedisk_check_hpa(ide_drive_t *drive)
 		printk(KERN_INFO "%s: Host Protected Area disabled.\n",
 				 drive->name);
 	}
-#endif
 }
 
 /*
@@ -1359,11 +1231,18 @@ static int set_nowerr(ide_drive_t *drive, int arg)
 	return 0;
 }
 
+/* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */
+#define ide_id_has_flush_cache(id)	((id)->cfs_enable_2 & 0x3000)
+
+/* some Maxtor disks have bit 13 defined incorrectly so check bit 10 too */
+#define ide_id_has_flush_cache_ext(id)	\
+	(((id)->cfs_enable_2 & 0x2400) == 0x2400)
+
 static int write_cache (ide_drive_t *drive, int arg)
 {
 	ide_task_t args;
 
-	if (!(drive->id->cfs_enable_2 & 0x3000))
+	if (!ide_id_has_flush_cache(drive->id))
 		return 1;
 
 	memset(&args, 0, sizeof(ide_task_t));
@@ -1383,7 +1262,7 @@ static int do_idedisk_flushcache (ide_drive_t *drive)
 	ide_task_t args;
 
 	memset(&args, 0, sizeof(ide_task_t));
-	if (drive->id->cfs_enable_2 & 0x2400)
+	if (ide_id_has_flush_cache_ext(drive->id))
 		args.tfRegister[IDE_COMMAND_OFFSET]	= WIN_FLUSH_CACHE_EXT;
 	else
 		args.tfRegister[IDE_COMMAND_OFFSET]	= WIN_FLUSH_CACHE;
@@ -1408,34 +1287,6 @@ static int set_acoustic (ide_drive_t *drive, int arg)
 	return 0;
 }
 
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-static int set_using_tcq(ide_drive_t *drive, int arg)
-{
-	int ret;
-
-	if (!drive->driver)
-		return -EPERM;
-	if (arg == drive->queue_depth && drive->using_tcq)
-		return 0;
-
-	/*
-	 * set depth, but check also id for max supported depth
-	 */
-	drive->queue_depth = arg ? arg : 1;
-	if (drive->id) {
-		if (drive->queue_depth > drive->id->queue_depth + 1)
-			drive->queue_depth = drive->id->queue_depth + 1;
-	}
-
-	if (arg)
-		ret = __ide_dma_queued_on(drive);
-	else
-		ret = __ide_dma_queued_off(drive);
-
-	return ret ? -EIO : 0;
-}
-#endif
-
 /*
  * drive->addressing:
  *	0: 28-bit
@@ -1471,9 +1322,6 @@ static void idedisk_add_settings(ide_drive_t *drive)
 	ide_add_setting(drive,	"acoustic",		SETTING_RW,					HDIO_GET_ACOUSTIC,	HDIO_SET_ACOUSTIC,	TYPE_BYTE,	0,	254,				1,	1,	&drive->acoustic,		set_acoustic);
  	ide_add_setting(drive,	"failures",		SETTING_RW,					-1,			-1,			TYPE_INT,	0,	65535,				1,	1,	&drive->failures,		NULL);
  	ide_add_setting(drive,	"max_failures",		SETTING_RW,					-1,			-1,			TYPE_INT,	0,	65535,				1,	1,	&drive->max_failures,		NULL);
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-	ide_add_setting(drive,	"using_tcq",		SETTING_RW,					HDIO_GET_QDMA,		HDIO_SET_QDMA,		TYPE_BYTE,	0,	IDE_MAX_TAG,			1,		1,		&drive->using_tcq,		set_using_tcq);
-#endif
 }
 
 /*
@@ -1513,11 +1361,11 @@ static ide_startstop_t idedisk_start_power_step (ide_drive_t *drive, struct requ
 	switch (rq->pm->pm_step) {
 	case idedisk_pm_flush_cache:	/* Suspend step 1 (flush cache) */
 		/* Not supported? Switch to next step now. */
-		if (!drive->wcache) {
+		if (!drive->wcache || !ide_id_has_flush_cache(drive->id)) {
 			idedisk_complete_power_step(drive, rq, 0, 0);
 			return ide_stopped;
 		}
-		if (drive->id->cfs_enable_2 & 0x2400)
+		if (ide_id_has_flush_cache_ext(drive->id))
 			args->tfRegister[IDE_COMMAND_OFFSET] = WIN_FLUSH_CACHE_EXT;
 		else
 			args->tfRegister[IDE_COMMAND_OFFSET] = WIN_FLUSH_CACHE;
@@ -1678,18 +1526,25 @@ static void idedisk_setup (ide_drive_t *drive)
 #endif	/* CONFIG_IDEDISK_MULTI_MODE */
 	}
 	drive->no_io_32bit = id->dword_io ? 1 : 0;
-	if (drive->id->cfs_enable_2 & 0x3000)
-		write_cache(drive, (id->cfs_enable_2 & 0x3000));
 
-#ifdef CONFIG_BLK_DEV_IDE_TCQ_DEFAULT
-	if (drive->using_dma)
-		__ide_dma_queued_on(drive);
-#endif
+	/* write cache enabled? */
+	if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5)))
+		drive->wcache = 1;
+
+	write_cache(drive, 1);
+}
+
+static void ide_cacheflush_p(ide_drive_t *drive)
+{
+	if (!drive->wcache || !ide_id_has_flush_cache(drive->id))
+		return;
+
+	if (do_idedisk_flushcache(drive))
+		printk(KERN_INFO "%s: wcache flush failed!\n", drive->name);
 }
 
 static int idedisk_cleanup (ide_drive_t *drive)
 {
-	static int ide_cacheflush_p(ide_drive_t *drive);
 	struct gendisk *g = drive->disk;
 	ide_cacheflush_p(drive);
 	if (ide_unregister_subdriver(drive))
@@ -1706,6 +1561,26 @@ static void ide_device_shutdown(struct device *dev)
 {
 	ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
 
+#ifdef	CONFIG_ALPHA
+	/* On Alpha, halt(8) doesn't actually turn the machine off,
+	   it puts you into the sort of firmware monitor. Typically,
+	   it's used to boot another kernel image, so it's not much
+	   different from reboot(8). Therefore, we don't need to
+	   spin down the disk in this case, especially since Alpha
+	   firmware doesn't handle disks in standby mode properly.
+	   On the other hand, it's reasonably safe to turn the power
+	   off when the shutdown process reaches the firmware prompt,
+	   as the firmware initialization takes rather long time -
+	   at least 10 seconds, which should be sufficient for
+	   the disk to expire its write cache. */
+	if (system_state != SYSTEM_POWER_OFF) {
+#else
+	if (system_state == SYSTEM_RESTART) {
+#endif
+		ide_cacheflush_p(drive);
+		return;
+	}
+
 	printk("Shutdown: %s\n", drive->name);
 	dev->bus->suspend(dev, PM_SUSPEND_STANDBY);
 }
@@ -1740,7 +1615,6 @@ static ide_driver_t idedisk_driver = {
 
 static int idedisk_open(struct inode *inode, struct file *filp)
 {
-	u8 cf;
 	ide_drive_t *drive = inode->i_bdev->bd_disk->private_data;
 	drive->usage++;
 	if (drive->removable && drive->usage == 1) {
@@ -1758,35 +1632,6 @@ static int idedisk_open(struct inode *inode, struct file *filp)
 		if (drive->doorlocking && ide_raw_taskfile(drive, &args, NULL))
 			drive->doorlocking = 0;
 	}
-	drive->wcache = 0;
-	/* Cache enabled? */
-	if (drive->id->csfo & 1)
-		drive->wcache = 1;
-	/* Cache command set available? */
-	if (drive->id->cfs_enable_1 & (1 << 5))
-		drive->wcache = 1;
-	/* ATA6 cache extended commands */
-	cf = drive->id->command_set_2 >> 24;
-	if ((cf & 0xC0) == 0x40 && (cf & 0x30) != 0)
-		drive->wcache = 1;
-	return 0;
-}
-
-static int ide_cacheflush_p(ide_drive_t *drive)
-{
-	if (!(drive->id->cfs_enable_2 & 0x3000))
-		return 0;
-
-	if(drive->wcache)
-	{
-		if (do_idedisk_flushcache(drive))
-		{
-			printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
-				drive->name);
-			return -EIO;
-		}
-		return 1;
-	}
 	return 0;
 }
 
@@ -1867,10 +1712,7 @@ static int idedisk_attach(ide_drive_t *drive)
 	if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
 		printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
 			drive->name, drive->head);
-		if ((drive->id->cfs_enable_2 & 0x3000) && drive->wcache)
-			if (do_idedisk_flushcache(drive))
-				printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
-					drive->name);
+		ide_cacheflush_p(drive);
 		ide_unregister_subdriver(drive);
 		DRIVER(drive)->busy--;
 		goto failed;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 4f44c2976..19ae46dc0 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -513,9 +513,7 @@ int __ide_dma_off_quietly (ide_drive_t *drive)
 
 	if (HWIF(drive)->ide_dma_host_off(drive))
 		return 1;
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-	__ide_dma_queued_off(drive);
-#endif
+
 	return 0;
 }
 
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index ae2d5b912..56fec5ca1 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1482,7 +1482,7 @@ static int idefloppy_get_capacity (ide_drive_t *drive)
 **
 */
 
-static int idefloppy_get_format_capacities(ide_drive_t *drive, int *arg)
+static int idefloppy_get_format_capacities(ide_drive_t *drive, int __user *arg)
 {
         idefloppy_pc_t pc;
 	idefloppy_capacity_header_t *header;
@@ -1490,7 +1490,7 @@ static int idefloppy_get_format_capacities(ide_drive_t *drive, int *arg)
 	int i, descriptors, blocks, length;
 	int u_array_size;
 	int u_index;
-	int *argp;
+	int __user *argp;
 
 	if (get_user(u_array_size, arg))
 		return (-EFAULT);
@@ -1558,7 +1558,7 @@ static int idefloppy_get_format_capacities(ide_drive_t *drive, int *arg)
 **        0x01 - verify media after format.
 */
 
-static int idefloppy_begin_format(ide_drive_t *drive, int *arg)
+static int idefloppy_begin_format(ide_drive_t *drive, int __user *arg)
 {
 	int blocks;
 	int length;
@@ -1591,7 +1591,7 @@ static int idefloppy_begin_format(ide_drive_t *drive, int *arg)
 ** the dsc bit, and return either 0 or 65536.
 */
 
-static int idefloppy_get_format_progress(ide_drive_t *drive, int *arg)
+static int idefloppy_get_format_progress(ide_drive_t *drive, int __user *arg)
 {
 	idefloppy_floppy_t *floppy = drive->driver_data;
 	idefloppy_pc_t pc;
@@ -1945,6 +1945,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
 	struct block_device *bdev = inode->i_bdev;
 	ide_drive_t *drive = bdev->bd_disk->private_data;
 	idefloppy_floppy_t *floppy = drive->driver_data;
+	void __user *argp = (void __user *)arg;
 	int err = generic_ide_ioctl(bdev, cmd, arg);
 	int prevent = (arg) ? 1 : 0;
 	idefloppy_pc_t pc;
@@ -1972,7 +1973,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
 	case IDEFLOPPY_IOCTL_FORMAT_SUPPORTED:
 		return 0;
 	case IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY:
-		return idefloppy_get_format_capacities(drive, (int *)arg);
+		return idefloppy_get_format_capacities(drive, argp);
 	case IDEFLOPPY_IOCTL_FORMAT_START:
 
 		if (!(file->f_mode & 2))
@@ -1988,7 +1989,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
 
 		set_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags);
 
-		err = idefloppy_begin_format(drive, (int *)arg);
+		err = idefloppy_begin_format(drive, argp);
 		if (err)
 			clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags);
 		return err;
@@ -1999,7 +2000,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
 		** format progress reporting.
 		*/
 	case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
-		return idefloppy_get_format_progress(drive, (int *)arg);
+		return idefloppy_get_format_progress(drive, argp);
 	}
  	return -EINVAL;
 }
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 8ae497455..ff5b16a87 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -97,10 +97,7 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
 
 	if (!end_that_request_first(rq, uptodate, nr_sectors)) {
 		add_disk_randomness(rq->rq_disk);
-		if (!blk_rq_tagged(rq))
-			blkdev_dequeue_request(rq);
-		else
-			blk_queue_end_tag(drive->queue, rq);
+		blkdev_dequeue_request(rq);
 		HWGROUP(drive)->rq = NULL;
 		end_that_request_last(rq);
 		ret = 0;
@@ -855,18 +852,7 @@ void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
 		drive->sleep = 0;
 		drive->service_start = jiffies;
 
-queue_next:
-		if (!ata_can_queue(drive)) {
-			if (!ata_pending_commands(drive))
-				hwgroup->busy = 0;
-
-			break;
-		}
-
 		if (blk_queue_plugged(drive->queue)) {
-			if (drive->using_tcq)
-				break;
-
 			printk(KERN_ERR "ide: huh? queue was plugged!\n");
 			break;
 		}
@@ -877,7 +863,7 @@ queue_next:
 		 */
 		rq = elv_next_request(drive->queue);
 		if (!rq) {
-			hwgroup->busy = !!ata_pending_commands(drive);
+			hwgroup->busy = 0;
 			break;
 		}
 
@@ -900,9 +886,6 @@ queue_next:
 			break;
 		}
 
-		if (!rq->bio && ata_pending_commands(drive))
-			break;
-
 		hwgroup->rq = rq;
 
 		/*
@@ -922,8 +905,6 @@ queue_next:
 		spin_lock_irq(&ide_lock);
 		if (hwif->irq != masked_irq)
 			enable_irq(hwif->irq);
-		if (startstop == ide_released)
-			goto queue_next;
 		if (startstop == ide_stopped)
 			hwgroup->busy = 0;
 	}
@@ -1388,6 +1369,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
 	err = 0;
 	if (must_wait) {
 		wait_for_completion(&wait);
+		rq->waiting = NULL;
 		if (rq->errors)
 			err = -EIO;
 
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index eb943429b..b7c47d235 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -46,7 +46,7 @@ static u16 ide_inw (unsigned long port)
 
 static void ide_insw (unsigned long port, void *addr, u32 count)
 {
-	return insw(port, addr, count);
+	insw(port, addr, count);
 }
 
 static u32 ide_inl (unsigned long port)
@@ -767,7 +767,7 @@ int ide_driveid_update (ide_drive_t *drive)
 	SELECT_MASK(drive, 1);
 	if (IDE_CONTROL_REG)
 		hwif->OUTB(drive->ctl,IDE_CONTROL_REG);
-	ide_delay_50ms();
+	msleep(50);
 	hwif->OUTB(WIN_IDENTIFY, IDE_COMMAND_REG);
 	timeout = jiffies + WAIT_WORSTCASE;
 	do {
@@ -775,9 +775,9 @@ int ide_driveid_update (ide_drive_t *drive)
 			SELECT_MASK(drive, 0);
 			return 0;	/* drive timed-out */
 		}
-		ide_delay_50ms();	/* give drive a breather */
+		msleep(50);	/* give drive a breather */
 	} while (hwif->INB(IDE_ALTSTATUS_REG) & BUSY_STAT);
-	ide_delay_50ms();	/* wait for IRQ and DRQ_STAT */
+	msleep(50);	/* wait for IRQ and DRQ_STAT */
 	if (!OK_STAT(hwif->INB(IDE_STATUS_REG),DRQ_STAT,BAD_R_STAT)) {
 		SELECT_MASK(drive, 0);
 		printk("%s: CHECK for good STATUS\n", drive->name);
@@ -827,7 +827,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
 	u8 stat;
 
 //	while (HWGROUP(drive)->busy)
-//		ide_delay_50ms();
+//		msleep(50);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
 	if (hwif->ide_dma_check)	 /* check if host supports DMA */
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
index 5b5db4781..6b9bcdb6c 100644
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -16,25 +16,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
  */
 
-#include <linux/ide.h>
 #include <linux/init.h>
-
 #include <linux/pnp.h>
-
-#define GENERIC_HD_DATA		0
-#define GENERIC_HD_ERROR	1
-#define GENERIC_HD_NSECTOR	2
-#define GENERIC_HD_SECTOR	3
-#define GENERIC_HD_LCYL		4
-#define GENERIC_HD_HCYL		5
-#define GENERIC_HD_SELECT	6
-#define GENERIC_HD_STATUS	7
-
-static int generic_ide_offsets[IDE_NR_PORTS] = {
-	GENERIC_HD_DATA, GENERIC_HD_ERROR, GENERIC_HD_NSECTOR, 
-	GENERIC_HD_SECTOR, GENERIC_HD_LCYL, GENERIC_HD_HCYL,
-	GENERIC_HD_SELECT, GENERIC_HD_STATUS, -1, -1
-};
+#include <linux/ide.h>
 
 /* Add your devices here :)) */
 struct pnp_device_id idepnp_devices[] = {
@@ -52,12 +36,11 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
 	if (!(pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && pnp_irq_valid(dev, 0)))
 		return -1;
 
-	ide_setup_ports(&hw, (unsigned long) pnp_port_start(dev, 0),
-			generic_ide_offsets,
-			(unsigned long) pnp_port_start(dev, 1),
-			0, NULL,
-//			generic_pnp_ide_iops,
-			pnp_irq(dev, 0));
+	memset(&hw, 0, sizeof(hw));
+	ide_std_init_ports(&hw, pnp_port_start(dev, 0),
+				pnp_port_start(dev, 1));
+	hw.irq = pnp_irq(dev, 0);
+	hw.dma = NO_DMA;
 
 	index = ide_register_hw(&hw, &hwif);
 
@@ -86,11 +69,7 @@ static struct pnp_driver idepnp_driver = {
 	.remove		= idepnp_remove,
 };
 
-
-void pnpide_init(int enable)
+void __init pnpide_init(void)
 {
-	if(enable)
-		pnp_register_driver(&idepnp_driver);
-	else
-		pnp_unregister_driver(&idepnp_driver);
+	pnp_register_driver(&idepnp_driver);
 }
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 4257350fa..4ffaf9016 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -241,17 +241,6 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
 	drive->media = ide_disk;
 	printk("%s DISK drive\n", (drive->is_flash) ? "CFA" : "ATA" );
 	QUIRK_LIST(drive);
-
-	/* Initialize queue depth settings */
-	drive->queue_depth = 1;
-#ifdef CONFIG_BLK_DEV_IDE_TCQ_DEPTH
-	drive->queue_depth = CONFIG_BLK_DEV_IDE_TCQ_DEPTH;
-#else
-	drive->queue_depth = drive->id->queue_depth + 1;
-#endif
-	if (drive->queue_depth < 1 || drive->queue_depth > IDE_MAX_TAG)
-		drive->queue_depth = IDE_MAX_TAG;
-
 	return;
 
 err_misc:
@@ -283,9 +272,10 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
 	unsigned long timeout;
 	u8 s = 0, a = 0;
 
+	/* take a deep breath */
+	msleep(50);
+
 	if (IDE_CONTROL_REG) {
-		/* take a deep breath */
-		ide_delay_50ms();
 		a = hwif->INB(IDE_ALTSTATUS_REG);
 		s = hwif->INB(IDE_STATUS_REG);
 		if ((a ^ s) & ~INDEX_STAT) {
@@ -297,10 +287,8 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
 			/* use non-intrusive polling */
 			hd_status = IDE_ALTSTATUS_REG;
 		}
-	} else {
-		ide_delay_50ms();
+	} else
 		hd_status = IDE_STATUS_REG;
-	}
 
 	/* set features register for atapi
 	 * identify command to be sure of reply
@@ -324,11 +312,11 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
 			return 1;
 		}
 		/* give drive a breather */
-		ide_delay_50ms();
+		msleep(50);
 	} while ((hwif->INB(hd_status)) & BUSY_STAT);
 
 	/* wait for IRQ and DRQ_STAT */
-	ide_delay_50ms();
+	msleep(50);
 	if (OK_STAT((hwif->INB(IDE_STATUS_REG)), DRQ_STAT, BAD_R_STAT)) {
 		unsigned long flags;
 
@@ -457,15 +445,15 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 	/* needed for some systems
 	 * (e.g. crw9624 as drive0 with disk as slave)
 	 */
-	ide_delay_50ms();
+	msleep(50);
 	SELECT_DRIVE(drive);
-	ide_delay_50ms();
+	msleep(50);
 	if (hwif->INB(IDE_SELECT_REG) != drive->select.all && !drive->present) {
 		if (drive->select.b.unit != 0) {
 			/* exit with drive0 selected */
 			SELECT_DRIVE(&hwif->drives[0]);
 			/* allow BUSY_STAT to assert & clear */
-			ide_delay_50ms();
+			msleep(50);
 		}
 		/* no i/f present: mmm.. this should be a 4 -ml */
 		return 3;
@@ -488,14 +476,14 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 			printk("%s: no response (status = 0x%02x), "
 				"resetting drive\n", drive->name,
 				hwif->INB(IDE_STATUS_REG));
-			ide_delay_50ms();
+			msleep(50);
 			hwif->OUTB(drive->select.all, IDE_SELECT_REG);
-			ide_delay_50ms();
+			msleep(50);
 			hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);
 			timeout = jiffies;
 			while (((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) &&
 			       time_before(jiffies, timeout + WAIT_WORSTCASE))
-				ide_delay_50ms();
+				msleep(50);
 			rc = try_to_identify(drive, cmd);
 		}
 		if (rc == 1)
@@ -510,7 +498,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 	if (drive->select.b.unit != 0) {
 		/* exit with drive0 selected */
 		SELECT_DRIVE(&hwif->drives[0]);
-		ide_delay_50ms();
+		msleep(50);
 		/* ensure drive irq is clear */
 		(void) hwif->INB(IDE_STATUS_REG);
 	}
@@ -527,7 +515,7 @@ static void enable_nest (ide_drive_t *drive)
 
 	printk("%s: enabling %s -- ", hwif->name, drive->id->model);
 	SELECT_DRIVE(drive);
-	ide_delay_50ms();
+	msleep(50);
 	hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG);
 	timeout = jiffies + WAIT_WORSTCASE;
 	do {
@@ -535,10 +523,10 @@ static void enable_nest (ide_drive_t *drive)
 			printk("failed (timeout)\n");
 			return;
 		}
-		ide_delay_50ms();
+		msleep(50);
 	} while ((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT);
 
-	ide_delay_50ms();
+	msleep(50);
 
 	if (!OK_STAT((hwif->INB(IDE_STATUS_REG)), 0, BAD_STAT)) {
 		printk("failed (status = 0x%02x)\n", hwif->INB(IDE_STATUS_REG));
@@ -647,8 +635,6 @@ static void hwif_register (ide_hwif_t *hwif)
 	device_register(&hwif->gendev);
 }
 
-//EXPORT_SYMBOL(hwif_register);
-
 #ifdef CONFIG_PPC
 static int wait_hwif_ready(ide_hwif_t *hwif)
 {
@@ -691,7 +677,7 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
  * This routine only knows how to look for drive units 0 and 1
  * on an interface, so any setting of MAX_DRIVES > 2 won't work here.
  */
-void probe_hwif (ide_hwif_t *hwif)
+static void probe_hwif(ide_hwif_t *hwif)
 {
 	unsigned int unit;
 	unsigned long flags;
@@ -781,7 +767,7 @@ void probe_hwif (ide_hwif_t *hwif)
 		udelay(10);
 		hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
 		do {
-			ide_delay_50ms();
+			msleep(50);
 			stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
 		} while ((stat & BUSY_STAT) && time_after(timeout, jiffies));
 
@@ -801,18 +787,12 @@ void probe_hwif (ide_hwif_t *hwif)
 
 	for (unit = 0; unit < MAX_DRIVES; ++unit) {
 		ide_drive_t *drive = &hwif->drives[unit];
-		int enable_dma = 1;
 
 		if (drive->present) {
 			if (hwif->tuneproc != NULL && 
 				drive->autotune == IDE_TUNE_AUTO)
 				/* auto-tune PIO mode */
 				hwif->tuneproc(drive, 255);
-
-#ifdef CONFIG_IDEDMA_ONLYDISK
-			if (drive->media != ide_disk)
-				enable_dma = 0;
-#endif
 			/*
 			 * MAJOR HACK BARF :-/
 			 *
@@ -832,16 +812,16 @@ void probe_hwif (ide_hwif_t *hwif)
 				 *   PARANOIA!!!
 				 */
 				hwif->ide_dma_off_quietly(drive);
-				if (enable_dma)
+#ifdef CONFIG_IDEDMA_ONLYDISK
+				if (drive->media == ide_disk)
+#endif
 					hwif->ide_dma_check(drive);
 			}
 		}
 	}
 }
 
-EXPORT_SYMBOL(probe_hwif);
-
-int hwif_init (ide_hwif_t *hwif);
+static int hwif_init(ide_hwif_t *hwif);
 int probe_hwif_init (ide_hwif_t *hwif)
 {
 	probe_hwif(hwif);
@@ -876,7 +856,7 @@ EXPORT_SYMBOL(probe_hwif_init);
  *
  * This routine detects and reports such situations, but does not fix them.
  */
-void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
+static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
 {
 	ide_hwif_t *m = *match;
 
@@ -889,7 +869,6 @@ void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
 	if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */
 		*match = new;
 }
-EXPORT_SYMBOL(save_match);
 #endif /* MAX_HWIFS > 1 */
 
 /*
@@ -1236,9 +1215,7 @@ static void init_gendisk (ide_hwif_t *hwif)
 			THIS_MODULE, ata_probe, ata_lock, hwif);
 }
 
-EXPORT_SYMBOL(init_gendisk);
-
-int hwif_init (ide_hwif_t *hwif)
+static int hwif_init(ide_hwif_t *hwif)
 {
 	int old_irq, unit;
 
@@ -1306,8 +1283,6 @@ out:
 	return 0;
 }
 
-EXPORT_SYMBOL(hwif_init);
-
 int ideprobe_init (void)
 {
 	unsigned int index;
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index eff7a8ba3..96c8e0021 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -74,210 +74,191 @@
 
 #include <asm/io.h>
 
-static int ide_getxdigit(char c)
-{
-	int digit;
-	if (isdigit(c))
-		digit = c - '0';
-	else if (isxdigit(c))
-		digit = tolower(c) - 'a' + 10;
-	else
-		digit = -1;
-	return digit;
-}
-
-static int xx_xx_parse_error (const char *data, unsigned long len, const char *msg)
-{
-	char errbuf[16];
-	int i;
-	if (len >= sizeof(errbuf))
-		len = sizeof(errbuf) - 1;
-	for (i = 0; i < len; ++i) {
-		char c = data[i];
-		if (!c || c == '\n')
-			c = '\0';
-		else if (iscntrl(c))
-			c = '?';
-		errbuf[i] = c;
-	}
-	errbuf[i] = '\0';
-	printk("proc_ide: error: %s: '%s'\n", msg, errbuf);
-	return -EINVAL;
-}
-
-static int proc_ide_write_config
-	(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_ide_write_config(struct file *file, const char __user *buffer,
+				 unsigned long count, void *data)
 {
 	ide_hwif_t	*hwif = (ide_hwif_t *)data;
-	int		for_real = 0;
-	unsigned long	startn = 0, n, flags;
-	const char	*start = NULL, *msg = NULL;
+	ide_hwgroup_t *mygroup = (ide_hwgroup_t *)(hwif->hwgroup);
+	ide_hwgroup_t *mategroup = NULL;
+	unsigned long timeout;
+	unsigned long flags;
+	const char *start = NULL, *msg = NULL;
+	struct entry { u32 val; u16 reg; u8 size; u8 pci; } *prog, *q, *r;
+	int want_pci = 0;
+	char *buf, *s;
+	int err;
+
+	if (hwif->mate && hwif->mate->hwgroup)
+		mategroup = (ide_hwgroup_t *)(hwif->mate->hwgroup);
 
 	if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
 		return -EACCES;
-	/*
-	 * Skip over leading whitespace
-	 */
-	while (count && isspace(*buffer)) {
-		--count;
-		++buffer;
+
+	if (count >= PAGE_SIZE)
+		return -EINVAL;
+
+	s = buf = (char *)__get_free_page(GFP_USER);
+	if (!buf)
+		return -ENOMEM;
+
+	err = -ENOMEM;
+	q = prog = (struct entry *)__get_free_page(GFP_USER);
+	if (!prog)
+		goto out;
+
+	err = -EFAULT;
+	if (copy_from_user(buf, buffer, count))
+		goto out1;
+
+	buf[count] = '\0';
+
+	while (isspace(*s))
+		s++;
+
+	while (*s) {
+		char *p;
+		int digits;
+
+		start = s;
+
+		if ((char *)(q + 1) > (char *)prog + PAGE_SIZE) {
+			msg = "too many entries";
+			goto parse_error;
+		}
+
+		switch (*s++) {
+			case 'R':	q->pci = 0;
+					break;
+			case 'P':	q->pci = 1;
+					want_pci = 1;
+					break;
+			default:	msg = "expected 'R' or 'P'";
+					goto parse_error;
+		}
+
+		q->reg = simple_strtoul(s, &p, 16);
+		digits = p - s;
+		if (!digits || digits > 4 || (q->pci && q->reg > 0xff)) {
+			msg = "bad/missing register number";
+			goto parse_error;
+		}
+		if (*p++ != ':') {
+			msg = "missing ':'";
+			goto parse_error;
+		}
+		q->val = simple_strtoul(p, &s, 16);
+		digits = s - p;
+		if (digits != 2 && digits != 4 && digits != 8) {
+			msg = "bad data, 2/4/8 digits required";
+			goto parse_error;
+		}
+		q->size = digits / 2;
+
+		if (q->pci) {
+#ifdef CONFIG_BLK_DEV_IDEPCI
+			if (q->reg & (q->size - 1)) {
+				msg = "misaligned access";
+				goto parse_error;
+			}
+#else
+			msg = "not a PCI device";
+			goto parse_error;
+#endif	/* CONFIG_BLK_DEV_IDEPCI */
+		}
+
+		q++;
+
+		if (*s && !isspace(*s++)) {
+			msg = "expected whitespace after data";
+			goto parse_error;
+		}
+		while (isspace(*s))
+			s++;
 	}
+
 	/*
-	 * Do one full pass to verify all parameters,
-	 * then do another to actually write the regs.
+	 * What follows below is fucking insane, even for IDE people.
+	 * For now I've dealt with the obvious problems on the parsing
+	 * side, but IMNSHO we should simply remove the write access
+	 * to /proc/ide/.../config, killing that FPOS completely.
 	 */
+
+	err = -EBUSY;
+	timeout = jiffies + (3 * HZ);
 	spin_lock_irqsave(&ide_lock, flags);
-	do {
-		const char *p;
-		if (for_real) {
-			unsigned long timeout = jiffies + (3 * HZ);
-			ide_hwgroup_t *mygroup = (ide_hwgroup_t *)(hwif->hwgroup);
-			ide_hwgroup_t *mategroup = NULL;
-			if (hwif->mate && hwif->mate->hwgroup)
-				mategroup = (ide_hwgroup_t *)(hwif->mate->hwgroup);
-			spin_lock_irqsave(&ide_lock, flags);
-			while (mygroup->busy ||
-			       (mategroup && mategroup->busy)) {
-				spin_unlock_irqrestore(&ide_lock, flags);
-				if (time_after(jiffies, timeout)) {
-					printk("/proc/ide/%s/config: channel(s) busy, cannot write\n", hwif->name);
-					spin_unlock_irqrestore(&ide_lock, flags);
-					return -EBUSY;
-				}
-				spin_lock_irqsave(&ide_lock, flags);
-			}
+	while (mygroup->busy ||
+	       (mategroup && mategroup->busy)) {
+		spin_unlock_irqrestore(&ide_lock, flags);
+		if (time_after(jiffies, timeout)) {
+			printk("/proc/ide/%s/config: channel(s) busy, cannot write\n", hwif->name);
+			goto out1;
 		}
-		p = buffer;
-		n = count;
-		while (n > 0) {
-			int d, digits;
-			unsigned int reg = 0, val = 0, is_pci;
-			start = p;
-			startn = n--;
-			switch (*p++) {
-				case 'R':	is_pci = 0;
-						break;
-				case 'P':	is_pci = 1;
+		spin_lock_irqsave(&ide_lock, flags);
+	}
+
 #ifdef CONFIG_BLK_DEV_IDEPCI
-						if (hwif->pci_dev && !hwif->pci_dev->vendor)
-							break;
+	if (want_pci && (!hwif->pci_dev || hwif->pci_dev->vendor)) {
+		spin_unlock_irqrestore(&ide_lock, flags);
+		printk("proc_ide: PCI registers not accessible for %s\n",
+			hwif->name);
+		err = -EINVAL;
+		goto out1;
+	}
 #endif	/* CONFIG_BLK_DEV_IDEPCI */
-						msg = "not a PCI device";
-						goto parse_error;
-				default:	msg = "expected 'R' or 'P'";
-						goto parse_error;
-			}
-			digits = 0;
-			while (n > 0 && (d = ide_getxdigit(*p)) >= 0) {
-				reg = (reg << 4) | d;
-				--n;
-				++p;
-				++digits;
-			}
-			if (!digits || (digits > 4) || (is_pci && reg > 0xff)) {
-				msg = "bad/missing register number";
-				goto parse_error;
-			}
-			if (n-- == 0 || *p++ != ':') {
-				msg = "missing ':'";
-				goto parse_error;
-			}
-			digits = 0;
-			while (n > 0 && (d = ide_getxdigit(*p)) >= 0) {
-				val = (val << 4) | d;
-				--n;
-				++p;
-				++digits;
-			}
-			if (digits != 2 && digits != 4 && digits != 8) {
-				msg = "bad data, 2/4/8 digits required";
-				goto parse_error;
-			}
-			if (n > 0 && !isspace(*p)) {
-				msg = "expected whitespace after data";
-				goto parse_error;
-			}
-			while (n > 0 && isspace(*p)) {
-				--n;
-				++p;
-			}
+
+	for (r = prog; r < q; r++) {
+		unsigned int reg = r->reg, val = r->val;
+		if (r->pci) {
 #ifdef CONFIG_BLK_DEV_IDEPCI
-			if (is_pci && (reg & ((digits >> 1) - 1))) {
-				msg = "misaligned access";
-				goto parse_error;
+			int rc = 0;
+			struct pci_dev *dev = hwif->pci_dev;
+			switch (q->size) {
+				case 1:	msg = "byte";
+					rc = pci_write_config_byte(dev, reg, val);
+					break;
+				case 2:	msg = "word";
+					rc = pci_write_config_word(dev, reg, val);
+					break;
+				case 4:	msg = "dword";
+					rc = pci_write_config_dword(dev, reg, val);
+					break;
+			}
+			if (rc) {
+				spin_unlock_irqrestore(&ide_lock, flags);
+				printk("proc_ide_write_config: error writing %s at bus %02x dev %02x reg 0x%x value 0x%x\n",
+					msg, dev->bus->number, dev->devfn, reg, val);
+				printk("proc_ide_write_config: error %d\n", rc);
+				err = -EIO;
+				goto out1;
 			}
 #endif	/* CONFIG_BLK_DEV_IDEPCI */
-			if (for_real) {
-#if 0
-				printk("proc_ide_write_config: type=%c, reg=0x%x, val=0x%x, digits=%d\n", is_pci ? "PCI" : "non-PCI", reg, val, digits);
-#endif
-				if (is_pci) {
-#ifdef CONFIG_BLK_DEV_IDEPCI
-					int rc = 0;
-					struct pci_dev *dev = hwif->pci_dev;
-					switch (digits) {
-						case 2:	msg = "byte";
-							rc = pci_write_config_byte(dev, reg, val);
-							break;
-						case 4:	msg = "word";
-							rc = pci_write_config_word(dev, reg, val);
-							break;
-						case 8:	msg = "dword";
-							rc = pci_write_config_dword(dev, reg, val);
-							break;
-					}
-					if (rc) {
-						spin_unlock_irqrestore(&ide_lock, flags);
-						printk("proc_ide_write_config: error writing %s at bus %02x dev %02x reg 0x%x value 0x%x\n",
-							msg, dev->bus->number, dev->devfn, reg, val);
-						printk("proc_ide_write_config: error %d\n", rc);
-						return -EIO;
-					}
-#endif	/* CONFIG_BLK_DEV_IDEPCI */
-				} else {	/* not pci */
-#if !defined(__mc68000__) && !defined(CONFIG_APUS)
-
-/*
- * Geert Uytterhoeven
- *
- * unless you can explain me what it really does.
- * On m68k, we don't have outw() and outl() yet,
- * and I need a good reason to implement it.
- * 
- * BTW, IMHO the main remaining portability problem with the IDE driver 
- * is that it mixes IO (ioport) and MMIO (iomem) access on different platforms.
- * 
- * I think all accesses should be done using
- * 
- *     ide_in[bwl](ide_device_instance, offset)
- *     ide_out[bwl](ide_device_instance, value, offset)
- * 
- * so the architecture specific code can #define ide_{in,out}[bwl] to the
- * appropriate function.
- * 
- */
-					switch (digits) {
-						case 2:	hwif->OUTB(val, reg);
-							break;
-						case 4:	hwif->OUTW(val, reg);
-							break;
-						case 8:	hwif->OUTL(val, reg);
-							break;
-					}
-#endif /* !__mc68000__ && !CONFIG_APUS */
-				}
+		} else {	/* not pci */
+			switch (r->size) {
+				case 1:	hwif->OUTB(val, reg);
+					break;
+				case 2:	hwif->OUTW(val, reg);
+					break;
+				case 4:	hwif->OUTL(val, reg);
+					break;
 			}
 		}
-	} while (!for_real++);
+	}
 	spin_unlock_irqrestore(&ide_lock, flags);
-	return count;
+	err = count;
+out1:
+	free_page((unsigned long)prog);
+out:
+	free_page((unsigned long)buf);
+	return err;
+
 parse_error:
-	spin_unlock_irqrestore(&ide_lock, flags);
 	printk("parse error\n");
-	return xx_xx_parse_error(start, startn, msg);
+	printk("proc_ide: error: %s: '%s'\n", msg, start);
+	err = -EINVAL;
+	goto out1;
 }
 
-int proc_ide_read_config
+static int proc_ide_read_config
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	char		*out = page;
@@ -314,18 +295,6 @@ int proc_ide_read_config
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_config);
-
-static int ide_getdigit(char c)
-{
-	int digit;
-	if (isdigit(c))
-		digit = c - '0';
-	else
-		digit = -1;
-	return digit;
-}
-
 static int proc_ide_read_imodel
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -359,9 +328,7 @@ static int proc_ide_read_imodel
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_imodel);
-
-int proc_ide_read_mate
+static int proc_ide_read_mate
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_hwif_t	*hwif = (ide_hwif_t *) data;
@@ -374,9 +341,7 @@ int proc_ide_read_mate
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_mate);
-
-int proc_ide_read_channel
+static int proc_ide_read_channel
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_hwif_t	*hwif = (ide_hwif_t *) data;
@@ -388,9 +353,7 @@ int proc_ide_read_channel
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_channel);
-
-int proc_ide_read_identify
+static int proc_ide_read_identify
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *)data;
@@ -432,9 +395,7 @@ int proc_ide_read_identify
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_identify);
-
-int proc_ide_read_settings
+static int proc_ide_read_settings
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *) data;
@@ -466,41 +427,52 @@ int proc_ide_read_settings
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_settings);
-
 #define MAX_LEN	30
 
-int proc_ide_write_settings
-	(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_ide_write_settings(struct file *file, const char __user *buffer,
+				   unsigned long count, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *) data;
 	char		name[MAX_LEN + 1];
-	int		for_real = 0, len;
+	int		for_real = 0;
 	unsigned long	n;
-	const char	*start = NULL;
 	ide_settings_t	*setting;
+	char *buf, *s;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
+
+	if (count >= PAGE_SIZE)
+		return -EINVAL;
+
+	s = buf = (char *)__get_free_page(GFP_USER);
+	if (!buf)
+		return -ENOMEM;
+
+	if (copy_from_user(buf, buffer, count)) {
+		free_page((unsigned long)buf);
+		return -EFAULT;
+	}
+
+	buf[count] = '\0';
+
 	/*
 	 * Skip over leading whitespace
 	 */
-	while (count && isspace(*buffer)) {
+	while (count && isspace(*s)) {
 		--count;
-		++buffer;
+		++s;
 	}
 	/*
 	 * Do one full pass to verify all parameters,
 	 * then do another to actually write the new settings.
 	 */
 	do {
-		const char *p;
-		p = buffer;
+		char *p = s;
 		n = count;
 		while (n > 0) {
-			int d, digits;
-			unsigned int val = 0;
-			start = p;
+			unsigned val;
+			char *q = p;
 
 			while (n > 0 && *p != ':') {
 				--n;
@@ -508,30 +480,27 @@ int proc_ide_write_settings
 			}
 			if (*p != ':')
 				goto parse_error;
-			len = min(p - start, MAX_LEN);
-			strncpy(name, start, min(len, MAX_LEN));
-			name[len] = 0;
+			if (p - q > MAX_LEN)
+				goto parse_error;
+			memcpy(name, q, p - q);
+			name[p - q] = 0;
 
 			if (n > 0) {
 				--n;
 				p++;
 			} else
 				goto parse_error;
-			
-			digits = 0;
-			while (n > 0 && (d = ide_getdigit(*p)) >= 0) {
-				val = (val * 10) + d;
-				--n;
-				++p;
-				++digits;
-			}
+
+			val = simple_strtoul(p, &q, 10);
+			n -= q - p;
+			p = q;
 			if (n > 0 && !isspace(*p))
 				goto parse_error;
 			while (n > 0 && isspace(*p)) {
 				--n;
 				++p;
 			}
-			
+
 			down(&ide_setting_sem);
 			setting = ide_find_setting_by_name(drive, name);
 			if (!setting)
@@ -544,14 +513,14 @@ int proc_ide_write_settings
 			up(&ide_setting_sem);
 		}
 	} while (!for_real++);
+	free_page((unsigned long)buf);
 	return count;
 parse_error:
+	free_page((unsigned long)buf);
 	printk("proc_ide_write_settings(): parse error\n");
 	return -EINVAL;
 }
 
-EXPORT_SYMBOL(proc_ide_write_settings);
-
 int proc_ide_read_capacity
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -563,8 +532,6 @@ int proc_ide_read_capacity
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_capacity);
-
 int proc_ide_read_geometry
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -583,7 +550,7 @@ int proc_ide_read_geometry
 
 EXPORT_SYMBOL(proc_ide_read_geometry);
 
-int proc_ide_read_dmodel
+static int proc_ide_read_dmodel
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *) data;
@@ -595,9 +562,7 @@ int proc_ide_read_dmodel
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_dmodel);
-
-int proc_ide_read_driver
+static int proc_ide_read_driver
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *) data;
@@ -609,23 +574,25 @@ int proc_ide_read_driver
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_driver);
-
-int proc_ide_write_driver
-	(struct file *file, const char *buffer, unsigned long count, void *data)
+static int proc_ide_write_driver
+	(struct file *file, const char __user *buffer, unsigned long count, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *) data;
+	char name[32];
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
-	if (ide_replace_subdriver(drive, buffer))
+	if (count > 31)
+		count = 31;
+	if (copy_from_user(name, buffer, count))
+		return -EFAULT;
+	name[count] = '\0';
+	if (ide_replace_subdriver(drive, name))
 		return -EINVAL;
 	return count;
 }
 
-EXPORT_SYMBOL(proc_ide_write_driver);
-
-int proc_ide_read_media
+static int proc_ide_read_media
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	ide_drive_t	*drive = (ide_drive_t *) data;
@@ -649,8 +616,6 @@ int proc_ide_read_media
 	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
 }
 
-EXPORT_SYMBOL(proc_ide_read_media);
-
 static ide_proc_entry_t generic_drive_entries[] = {
 	{ "driver",	S_IFREG|S_IRUGO,	proc_ide_read_driver,	proc_ide_write_driver },
 	{ "identify",	S_IFREG|S_IRUSR,	proc_ide_read_identify,	NULL },
@@ -677,8 +642,6 @@ void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void
 	}
 }
 
-EXPORT_SYMBOL(ide_add_proc_entries);
-
 void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p)
 {
 	if (!dir || !p)
@@ -689,9 +652,7 @@ void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p)
 	}
 }
 
-EXPORT_SYMBOL(ide_remove_proc_entries);
-
-void create_proc_ide_drives(ide_hwif_t *hwif)
+static void create_proc_ide_drives(ide_hwif_t *hwif)
 {
 	int	d;
 	struct proc_dir_entry *ent;
@@ -715,9 +676,7 @@ void create_proc_ide_drives(ide_hwif_t *hwif)
 	}
 }
 
-EXPORT_SYMBOL(create_proc_ide_drives);
-
-void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
+static void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
 {
 	ide_driver_t *driver = drive->driver;
 
@@ -730,8 +689,6 @@ void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
 	}
 }
 
-EXPORT_SYMBOL(destroy_proc_ide_device);
-
 void destroy_proc_ide_drives(ide_hwif_t *hwif)
 {
 	int	d;
@@ -743,8 +700,6 @@ void destroy_proc_ide_drives(ide_hwif_t *hwif)
 	}
 }
 
-EXPORT_SYMBOL(destroy_proc_ide_drives);
-
 static ide_proc_entry_t hwif_entries[] = {
 	{ "channel",	S_IFREG|S_IRUGO,	proc_ide_read_channel,	NULL },
 	{ "config",	S_IFREG|S_IRUGO|S_IWUSR,proc_ide_read_config,	proc_ide_write_config },
@@ -832,13 +787,9 @@ void proc_ide_create(void)
 		entry->proc_fops = &ide_drivers_operations;
 }
 
-EXPORT_SYMBOL(proc_ide_create);
-
 void proc_ide_destroy(void)
 {
 	remove_proc_entry("ide/drivers", proc_ide_root);
 	destroy_proc_ide_interfaces();
 	remove_proc_entry("ide", 0);
 }
-
-EXPORT_SYMBOL(proc_ide_destroy);
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 9a92a8203..98f4f3e4d 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -201,14 +201,6 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
 			if (!hwif->ide_dma_read(drive))
 				return ide_started;
 			break;
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-		case WIN_READDMA_QUEUED:
-		case WIN_READDMA_QUEUED_EXT:
-			return __ide_dma_queued_read(drive);
-		case WIN_WRITEDMA_QUEUED:
-		case WIN_WRITEDMA_QUEUED_EXT:
-			return __ide_dma_queued_write(drive);
-#endif
 		default:
 			if (task->handler == NULL)
 				return ide_stopped;
@@ -309,38 +301,18 @@ EXPORT_SYMBOL(task_no_data_intr);
  */
 #ifndef CONFIG_IDE_TASKFILE_IO
 
-#define task_map_rq(rq, flags)		ide_map_buffer((rq), (flags))
-#define task_unmap_rq(rq, buf, flags)	ide_unmap_buffer((rq), (buf), (flags))
-
 /*
  * Handler for command with PIO data-in phase, READ
  */
-/*
- * FIXME before 2.4 enable ...
- *	DATA integrity issue upon error. <andre@linux-ide.org>
- */
 ide_startstop_t task_in_intr (ide_drive_t *drive)
 {
 	struct request *rq	= HWGROUP(drive)->rq;
 	ide_hwif_t *hwif	= HWIF(drive);
 	char *pBuf		= NULL;
 	u8 stat;
-	unsigned long flags;
 
 	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) {
 		if (stat & (ERR_STAT|DRQ_STAT)) {
-#if 0
-			DTF("%s: attempting to recover last " \
-				"sector counter status=0x%02x\n",
-				drive->name, stat);
-			/*
-			 * Expect a BUG BOMB if we attempt to rewind the
-			 * offset in the BH aka PAGE in the current BLOCK
-			 * segment.  This is different than the HOST segment.
-			 */
-#endif
-			if (!rq->bio)
-				rq->current_nr_sectors++;
 			return DRIVER(drive)->error(drive, "task_in_intr", stat);
 		}
 		if (!(stat & BUSY_STAT)) {
@@ -350,39 +322,13 @@ ide_startstop_t task_in_intr (ide_drive_t *drive)
 			return ide_started;  
 		}
 	}
-#if 0
 
-	/*
-	 * Holding point for a brain dump of a thought :-/
-	 */
-
-	if (!OK_STAT(stat,DRIVE_READY,drive->bad_wstat)) {
-		DTF("%s: READ attempting to recover last " \
-			"sector counter status=0x%02x\n",
-			drive->name, stat);
-		rq->current_nr_sectors++;
-		return DRIVER(drive)->error(drive, "task_in_intr", stat);
-        }
-	if (!rq->current_nr_sectors)
-		if (!DRIVER(drive)->end_request(drive, 1, 0))
-			return ide_stopped;
-
-	if (--rq->current_nr_sectors <= 0)
-		if (!DRIVER(drive)->end_request(drive, 1, 0))
-			return ide_stopped;
-#endif
-
-	pBuf = task_map_rq(rq, &flags);
+	pBuf = rq->buffer + task_rq_offset(rq);
 	DTF("Read: %p, rq->current_nr_sectors: %d, stat: %02x\n",
 		pBuf, (int) rq->current_nr_sectors, stat);
 	taskfile_input_data(drive, pBuf, SECTOR_WORDS);
-	task_unmap_rq(rq, pBuf, &flags);
-	/*
-	 * FIXME :: We really can not legally get a new page/bh
-	 * regardless, if this is the end of our segment.
-	 * BH walking or segment can only be updated after we have a good
-	 * hwif->INB(IDE_STATUS_REG); return.
-	 */
+
+	/* FIXME: check drive status */
 	if (--rq->current_nr_sectors <= 0)
 		if (!DRIVER(drive)->end_request(drive, 1, 0))
 			return ide_stopped;
@@ -407,21 +353,10 @@ ide_startstop_t task_mulin_intr (ide_drive_t *drive)
 	char *pBuf		= NULL;
 	unsigned int msect	= drive->mult_count;
 	unsigned int nsect;
-	unsigned long flags;
 	u8 stat;
 
 	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) {
 		if (stat & (ERR_STAT|DRQ_STAT)) {
-			if (!rq->bio) {
-				rq->current_nr_sectors += drive->mult_count;
-				/*
-				 * NOTE: could rewind beyond beginning :-/
-				 */
-			} else {
-				printk(KERN_ERR "%s: MULTI-READ assume all data " \
-					"transfered is bad status=0x%02x\n",
-					drive->name, stat);
-			}
 			return DRIVER(drive)->error(drive, "task_mulin_intr", stat);
 		}
 		/* no data yet, so wait for another interrupt */
@@ -434,21 +369,16 @@ ide_startstop_t task_mulin_intr (ide_drive_t *drive)
 		nsect = rq->current_nr_sectors;
 		if (nsect > msect)
 			nsect = msect;
-		pBuf = task_map_rq(rq, &flags);
+		pBuf = rq->buffer + task_rq_offset(rq);
 		DTF("Multiread: %p, nsect: %d, msect: %d, " \
 			" rq->current_nr_sectors: %d\n",
 			pBuf, nsect, msect, rq->current_nr_sectors);
 		taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS);
-		task_unmap_rq(rq, pBuf, &flags);
 		rq->errors = 0;
 		rq->current_nr_sectors -= nsect;
 		msect -= nsect;
-		/*
-		 * FIXME :: We really can not legally get a new page/bh
-		 * regardless, if this is the end of our segment.
-		 * BH walking or segment can only be updated after we have a
-		 * good hwif->INB(IDE_STATUS_REG); return.
-		 */
+
+		/* FIXME: check drive status */
 		if (!rq->current_nr_sectors) {
 			if (!DRIVER(drive)->end_request(drive, 1, 0))
 				return ide_stopped;
@@ -467,8 +397,6 @@ EXPORT_SYMBOL(task_mulin_intr);
  */
 ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq)
 {
-	char *pBuf		= NULL;
-	unsigned long flags;
 	ide_startstop_t startstop;
 
 	if (ide_wait_stat(&startstop, drive, DATA_READY,
@@ -479,10 +407,8 @@ ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq)
 		return startstop;
 	}
 	/* For Write_sectors we need to stuff the first sector */
-	pBuf = task_map_rq(rq, &flags);
-	taskfile_output_data(drive, pBuf, SECTOR_WORDS);
+	taskfile_output_data(drive, rq->buffer + task_rq_offset(rq), SECTOR_WORDS);
 	rq->current_nr_sectors--;
-	task_unmap_rq(rq, pBuf, &flags);
 	return ide_started;
 }
 
@@ -498,14 +424,9 @@ ide_startstop_t task_out_intr (ide_drive_t *drive)
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct request *rq	= HWGROUP(drive)->rq;
 	char *pBuf		= NULL;
-	unsigned long flags;
 	u8 stat;
 
 	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), DRIVE_READY, drive->bad_wstat)) {
-		DTF("%s: WRITE attempting to recover last " \
-			"sector counter status=0x%02x\n",
-			drive->name, stat);
-		rq->current_nr_sectors++;
 		return DRIVER(drive)->error(drive, "task_out_intr", stat);
 	}
 	/*
@@ -517,11 +438,10 @@ ide_startstop_t task_out_intr (ide_drive_t *drive)
 			return ide_stopped;
 	if ((rq->current_nr_sectors==1) ^ (stat & DRQ_STAT)) {
 		rq = HWGROUP(drive)->rq;
-		pBuf = task_map_rq(rq, &flags);
+		pBuf = rq->buffer + task_rq_offset(rq);
 		DTF("write: %p, rq->current_nr_sectors: %d\n",
 			pBuf, (int) rq->current_nr_sectors);
 		taskfile_output_data(drive, pBuf, SECTOR_WORDS);
-		task_unmap_rq(rq, pBuf, &flags);
 		rq->errors = 0;
 		rq->current_nr_sectors--;
 	}
@@ -532,28 +452,11 @@ ide_startstop_t task_out_intr (ide_drive_t *drive)
 
 EXPORT_SYMBOL(task_out_intr);
 
-#undef ALTERNATE_STATE_DIAGRAM_MULTI_OUT
-
 ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
 {
-#ifdef ALTERNATE_STATE_DIAGRAM_MULTI_OUT
-	ide_hwif_t *hwif		= HWIF(drive);
-	char *pBuf			= NULL;
-	unsigned int nsect = 0, msect	= drive->mult_count;
-        u8 stat;
-	unsigned long flags;
-#endif /* ALTERNATE_STATE_DIAGRAM_MULTI_OUT */
-
 	ide_task_t *args = rq->special;
 	ide_startstop_t startstop;
 
-#if 0
-	/*
-	 * assign private copy for multi-write
-	 */
-	memcpy(&HWGROUP(drive)->wrq, rq, sizeof(struct request));
-#endif
-
 	if (ide_wait_stat(&startstop, drive, DATA_READY,
 			drive->bad_wstat, WAIT_DRQ)) {
 		printk(KERN_ERR "%s: no DRQ after issuing %s\n",
@@ -561,31 +464,6 @@ ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
 			drive->addressing ? "MULTWRITE_EXT" : "MULTWRITE");
 		return startstop;
 	}
-#ifdef ALTERNATE_STATE_DIAGRAM_MULTI_OUT
-
-	do {
-		nsect = rq->current_nr_sectors;
-		if (nsect > msect)
-			nsect = msect;
-		pBuf = task_map_rq(rq, &flags);
-		DTF("Pre-Multiwrite: %p, nsect: %d, msect: %d, " \
-			"rq->current_nr_sectors: %ld\n",
-			pBuf, nsect, msect, rq->current_nr_sectors);
-		msect -= nsect;
-		taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS);
-		task_unmap_rq(rq, pBuf, &flags);
-		rq->current_nr_sectors -= nsect;
-		if (!rq->current_nr_sectors) {
-			if (!DRIVER(drive)->end_request(drive, 1, 0))
-				if (!rq->bio) {
-					stat = hwif->INB(IDE_STATUS_REG);
-					return ide_stopped;
-				}
-		}
-	} while (msect);
-	rq->errors = 0;
-	return ide_started;
-#else /* ! ALTERNATE_STATE_DIAGRAM_MULTI_OUT */
 	if (!(drive_is_ready(drive))) {
 		int i;
 		for (i=0; i<100; i++) {
@@ -599,14 +477,10 @@ ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
 	 * move the DATA-TRANSFER T-Bar as BSY != 0. <andre@linux-ide.org>
 	 */
 	return args->handler(drive);
-#endif /* ALTERNATE_STATE_DIAGRAM_MULTI_OUT */
 }
 
 EXPORT_SYMBOL(pre_task_mulout_intr);
 
-/*
- * FIXME before enabling in 2.4 ... DATA integrity issue upon error.
- */
 /*
  * Handler for command write multiple
  * Called directly from execute_drive_cmd for the first bunch of sectors,
@@ -618,49 +492,17 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
 	u8 stat				= hwif->INB(IDE_STATUS_REG);
 	struct request *rq		= HWGROUP(drive)->rq;
 	char *pBuf			= NULL;
-	ide_startstop_t startstop	= ide_stopped;
 	unsigned int msect		= drive->mult_count;
 	unsigned int nsect;
-	unsigned long flags;
 
-	/*
-	 * (ks/hs): Handle last IRQ on multi-sector transfer,
-	 * occurs after all data was sent in this chunk
-	 */
-	if (rq->current_nr_sectors == 0) {
+	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT) || !rq->current_nr_sectors) {
 		if (stat & (ERR_STAT|DRQ_STAT)) {
-			if (!rq->bio) {
-                                rq->current_nr_sectors += drive->mult_count;
-				/*
-				 * NOTE: could rewind beyond beginning :-/
-				 */
-			} else {
-				printk(KERN_ERR "%s: MULTI-WRITE assume all data " \
-					"transfered is bad status=0x%02x\n",
-					drive->name, stat);
-			}
 			return DRIVER(drive)->error(drive, "task_mulout_intr", stat);
 		}
-		if (!rq->bio)
+		/* Handle last IRQ, occurs after all data was sent. */
+		if (!rq->current_nr_sectors) {
 			DRIVER(drive)->end_request(drive, 1, 0);
-		return startstop;
-	}
-	/*
-	 * DON'T be lazy code the above and below togather !!!
-	 */
-	if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) {
-		if (stat & (ERR_STAT|DRQ_STAT)) {
-			if (!rq->bio) {
-				rq->current_nr_sectors += drive->mult_count;
-				/*
-				 * NOTE: could rewind beyond beginning :-/
-				 */
-			} else {
-				printk("%s: MULTI-WRITE assume all data " \
-					"transfered is bad status=0x%02x\n",
-					drive->name, stat);
-			}
-			return DRIVER(drive)->error(drive, "task_mulout_intr", stat);
+			return ide_stopped;
 		}
 		/* no data yet, so wait for another interrupt */
 		if (HWGROUP(drive)->handler == NULL)
@@ -668,7 +510,6 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
 		return ide_started;
 	}
 
-#ifndef ALTERNATE_STATE_DIAGRAM_MULTI_OUT
 	if (HWGROUP(drive)->handler != NULL) {
 		unsigned long lflags;
 		spin_lock_irqsave(&ide_lock, lflags);
@@ -676,26 +517,20 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
 		del_timer(&HWGROUP(drive)->timer);
 		spin_unlock_irqrestore(&ide_lock, lflags);
 	}
-#endif /* ALTERNATE_STATE_DIAGRAM_MULTI_OUT */
 
 	do {
 		nsect = rq->current_nr_sectors;
 		if (nsect > msect)
 			nsect = msect;
-		pBuf = task_map_rq(rq, &flags);
+		pBuf = rq->buffer + task_rq_offset(rq);
 		DTF("Multiwrite: %p, nsect: %d, msect: %d, " \
 			"rq->current_nr_sectors: %ld\n",
 			pBuf, nsect, msect, rq->current_nr_sectors);
 		msect -= nsect;
 		taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS);
-		task_unmap_rq(rq, pBuf, &flags);
 		rq->current_nr_sectors -= nsect;
-		/*
-		 * FIXME :: We really can not legally get a new page/bh
-		 * regardless, if this is the end of our segment.
-		 * BH walking or segment can only be updated after we
-		 * have a good  hwif->INB(IDE_STATUS_REG); return.
-		 */
+
+		/* FIXME: check drive status */
 		if (!rq->current_nr_sectors) {
 			if (!DRIVER(drive)->end_request(drive, 1, 0))
 				if (!rq->bio)
@@ -1011,6 +846,12 @@ int ide_diag_taskfile (ide_drive_t *drive, ide_task_t *args, unsigned long data_
 		else
 			rq.nr_sectors = data_size / SECTOR_SIZE;
 
+		if (!rq.nr_sectors) {
+			printk(KERN_ERR "%s: in/out command without data\n",
+					drive->name);
+			return -EFAULT;
+		}
+
 		rq.hard_nr_sectors = rq.nr_sectors;
 		rq.hard_cur_sectors = rq.current_nr_sectors = rq.nr_sectors;
 	}
@@ -1052,13 +893,14 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 	int taskin		= 0;
 	int taskout		= 0;
 	u8 io_32bit		= drive->io_32bit;
+	char __user *buf = (char __user *)arg;
 
 //	printk("IDE Taskfile ...\n");
 
 	req_task = kmalloc(tasksize, GFP_KERNEL);
 	if (req_task == NULL) return -ENOMEM;
 	memset(req_task, 0, tasksize);
-	if (copy_from_user(req_task, (void *) arg, tasksize)) {
+	if (copy_from_user(req_task, buf, tasksize)) {
 		kfree(req_task);
 		return -EFAULT;
 	}
@@ -1074,7 +916,7 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 			goto abort;
 		}
 		memset(outbuf, 0, taskout);
-		if (copy_from_user(outbuf, (void *)arg + outtotal, taskout)) {
+		if (copy_from_user(outbuf, buf + outtotal, taskout)) {
 			err = -EFAULT;
 			goto abort;
 		}
@@ -1088,7 +930,7 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 			goto abort;
 		}
 		memset(inbuf, 0, taskin);
-		if (copy_from_user(inbuf, (void *)arg + intotal , taskin)) {
+		if (copy_from_user(inbuf, buf + intotal, taskin)) {
 			err = -EFAULT;
 			goto abort;
 		}
@@ -1196,20 +1038,20 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 	req_task->in_flags  = args.tf_in_flags;
 	req_task->out_flags = args.tf_out_flags;
 
-	if (copy_to_user((void *)arg, req_task, tasksize)) {
+	if (copy_to_user(buf, req_task, tasksize)) {
 		err = -EFAULT;
 		goto abort;
 	}
 	if (taskout) {
 		int outtotal = tasksize;
-		if (copy_to_user((void *)arg+outtotal, outbuf, taskout)) {
+		if (copy_to_user(buf + outtotal, outbuf, taskout)) {
 			err = -EFAULT;
 			goto abort;
 		}
 	}
 	if (taskin) {
 		int intotal = tasksize + taskout;
-		if (copy_to_user((void *)arg+intotal, inbuf, taskin)) {
+		if (copy_to_user(buf + intotal, inbuf, taskin)) {
 			err = -EFAULT;
 			goto abort;
 		}
@@ -1266,7 +1108,7 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 		return ide_do_drive_cmd(drive, &rq, ide_wait);
 	}
 
-	if (copy_from_user(args, (void *)arg, 4))
+	if (copy_from_user(args, (void __user *)arg, 4))
 		return -EFAULT;
 
 	memset(&tfargs, 0, sizeof(ide_task_t));
@@ -1299,7 +1141,7 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 		ide_driveid_update(drive);
 	}
 abort:
-	if (copy_to_user((void *)arg, argbuf, argsize))
+	if (copy_to_user((void __user *)arg, argbuf, argsize))
 		err = -EFAULT;
 	if (argsize > 4)
 		kfree(argbuf);
@@ -1325,14 +1167,15 @@ EXPORT_SYMBOL(ide_wait_cmd_task);
  */
 int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 {
+	void __user *p = (void __user *)arg;
 	int err = 0;
 	u8 args[7], *argbuf = args;
 	int argsize = 7;
 
-	if (copy_from_user(args, (void *)arg, 7))
+	if (copy_from_user(args, p, 7))
 		return -EFAULT;
 	err = ide_wait_cmd_task(drive, argbuf);
-	if (copy_to_user((void *)arg, argbuf, argsize))
+	if (copy_to_user(p, argbuf, argsize))
 		err = -EFAULT;
 	return err;
 }
@@ -1493,9 +1336,6 @@ ide_startstop_t flagged_task_in_intr (ide_drive_t *drive)
 	char *pBuf		= NULL;
 	int retries             = 5;
 
-	if (rq->current_nr_sectors == 0) 
-		return DRIVER(drive)->error(drive, "flagged_task_in_intr (no data requested)", stat); 
-
 	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
 		if (stat & ERR_STAT) {
 			return DRIVER(drive)->error(drive, "flagged_task_in_intr", stat);
@@ -1542,9 +1382,6 @@ ide_startstop_t flagged_task_mulin_intr (ide_drive_t *drive)
 	int retries             = 5;
 	unsigned int msect, nsect;
 
-	if (rq->current_nr_sectors == 0) 
-		return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (no data requested)", stat); 
-
 	msect = drive->mult_count;
 	if (msect == 0) 
 		return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (multimode not set)", stat); 
@@ -1596,14 +1433,8 @@ ide_startstop_t flagged_task_mulin_intr (ide_drive_t *drive)
  */
 ide_startstop_t flagged_pre_task_out_intr (ide_drive_t *drive, struct request *rq)
 {
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 stat			= hwif->INB(IDE_STATUS_REG);
 	ide_startstop_t startstop;
 
-	if (!rq->current_nr_sectors) {
-		return DRIVER(drive)->error(drive, "flagged_pre_task_out_intr (write data not specified)", stat);
-	}
-
 	if (ide_wait_stat(&startstop, drive, DATA_READY,
 			BAD_W_STAT, WAIT_DRQ)) {
 		printk(KERN_ERR "%s: No DRQ bit after issuing write command.\n", drive->name);
@@ -1665,9 +1496,6 @@ ide_startstop_t flagged_pre_task_mulout_intr (ide_drive_t *drive, struct request
 	ide_startstop_t startstop;
 	unsigned int msect, nsect;
 
-	if (!rq->current_nr_sectors) 
-		return DRIVER(drive)->error(drive, "flagged_pre_task_mulout_intr (write data not specified)", stat);
-
 	msect = drive->mult_count;
 	if (msect == 0)
 		return DRIVER(drive)->error(drive, "flagged_pre_task_mulout_intr (multimode not set)", stat);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 4e2b9934b..2714aa1a3 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -188,7 +188,6 @@ int noautodma = 1;
 #endif
 
 EXPORT_SYMBOL(noautodma);
-EXPORT_SYMBOL(ide_bus_type);
 
 /*
  * This is declared extern in ide.h, for access by other IDE modules:
@@ -272,6 +271,8 @@ static void init_hwif_default(ide_hwif_t *hwif, unsigned int index)
 #endif
 }
 
+extern void ide_arm_init(void);
+
 /*
  * init_ide_data() sets reasonable default values into all fields
  * of all instances of the hwifs and drives, but only on the first call.
@@ -312,12 +313,9 @@ static void __init init_ide_data (void)
 			ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);
 #endif
 	}
-
-/* OBSOLETE: still needed on arm26 and arm */
-#ifdef CONFIG_ARM
-	/* Add default hw interfaces */
+#ifdef CONFIG_IDE_ARM
 	initializing = 1;
-	ide_init_default_hwifs();
+	ide_arm_init();
 	initializing = 0;
 #endif
 }
@@ -555,8 +553,6 @@ control_region_busy:
 	return -EBUSY;
 }
 
-EXPORT_SYMBOL(ide_hwif_request_regions);
-
 /**
  *	ide_hwif_release_regions - free IDE resources
  *
@@ -585,7 +581,101 @@ void ide_hwif_release_regions(ide_hwif_t *hwif)
 			release_region(hwif->io_ports[i], 1);
 }
 
-EXPORT_SYMBOL(ide_hwif_release_regions);
+/* restore hwif to a sane state */
+static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
+{
+	hwif->hwgroup			= tmp_hwif->hwgroup;
+
+	hwif->gendev.parent		= tmp_hwif->gendev.parent;
+
+	hwif->proc			= tmp_hwif->proc;
+
+	hwif->major			= tmp_hwif->major;
+	hwif->straight8			= tmp_hwif->straight8;
+	hwif->bus_state			= tmp_hwif->bus_state;
+
+	hwif->atapi_dma			= tmp_hwif->atapi_dma;
+	hwif->ultra_mask		= tmp_hwif->ultra_mask;
+	hwif->mwdma_mask		= tmp_hwif->mwdma_mask;
+	hwif->swdma_mask		= tmp_hwif->swdma_mask;
+
+	hwif->chipset			= tmp_hwif->chipset;
+	hwif->hold			= tmp_hwif->hold;
+
+#ifdef CONFIG_BLK_DEV_IDEPCI
+	hwif->pci_dev			= tmp_hwif->pci_dev;
+	hwif->cds			= tmp_hwif->cds;
+#endif
+
+	hwif->identify			= tmp_hwif->identify;
+	hwif->tuneproc			= tmp_hwif->tuneproc;
+	hwif->speedproc			= tmp_hwif->speedproc;
+	hwif->selectproc		= tmp_hwif->selectproc;
+	hwif->reset_poll		= tmp_hwif->reset_poll;
+	hwif->pre_reset			= tmp_hwif->pre_reset;
+	hwif->resetproc			= tmp_hwif->resetproc;
+	hwif->intrproc			= tmp_hwif->intrproc;
+	hwif->maskproc			= tmp_hwif->maskproc;
+	hwif->quirkproc			= tmp_hwif->quirkproc;
+	hwif->busproc			= tmp_hwif->busproc;
+
+	hwif->ata_input_data		= tmp_hwif->ata_input_data;
+	hwif->ata_output_data		= tmp_hwif->ata_output_data;
+	hwif->atapi_input_bytes		= tmp_hwif->atapi_input_bytes;
+	hwif->atapi_output_bytes	= tmp_hwif->atapi_output_bytes;
+
+	hwif->ide_dma_read		= tmp_hwif->ide_dma_read;
+	hwif->ide_dma_write		= tmp_hwif->ide_dma_write;
+	hwif->ide_dma_begin		= tmp_hwif->ide_dma_begin;
+	hwif->ide_dma_end		= tmp_hwif->ide_dma_end;
+	hwif->ide_dma_check		= tmp_hwif->ide_dma_check;
+	hwif->ide_dma_on		= tmp_hwif->ide_dma_on;
+	hwif->ide_dma_off_quietly	= tmp_hwif->ide_dma_off_quietly;
+	hwif->ide_dma_test_irq		= tmp_hwif->ide_dma_test_irq;
+	hwif->ide_dma_host_on		= tmp_hwif->ide_dma_host_on;
+	hwif->ide_dma_host_off		= tmp_hwif->ide_dma_host_off;
+	hwif->ide_dma_verbose		= tmp_hwif->ide_dma_verbose;
+	hwif->ide_dma_lostirq		= tmp_hwif->ide_dma_lostirq;
+	hwif->ide_dma_timeout		= tmp_hwif->ide_dma_timeout;
+
+	hwif->OUTB			= tmp_hwif->OUTB;
+	hwif->OUTBSYNC			= tmp_hwif->OUTBSYNC;
+	hwif->OUTW			= tmp_hwif->OUTW;
+	hwif->OUTL			= tmp_hwif->OUTL;
+	hwif->OUTSW			= tmp_hwif->OUTSW;
+	hwif->OUTSL			= tmp_hwif->OUTSL;
+
+	hwif->INB			= tmp_hwif->INB;
+	hwif->INW			= tmp_hwif->INW;
+	hwif->INL			= tmp_hwif->INL;
+	hwif->INSW			= tmp_hwif->INSW;
+	hwif->INSL			= tmp_hwif->INSL;
+
+	hwif->mmio			= tmp_hwif->mmio;
+	hwif->rqsize			= tmp_hwif->rqsize;
+	hwif->no_lba48			= tmp_hwif->no_lba48;
+
+#ifndef CONFIG_BLK_DEV_IDECS
+	hwif->irq			= tmp_hwif->irq;
+#endif
+
+	hwif->dma_base			= tmp_hwif->dma_base;
+	hwif->dma_master		= tmp_hwif->dma_master;
+	hwif->dma_command		= tmp_hwif->dma_command;
+	hwif->dma_vendor1		= tmp_hwif->dma_vendor1;
+	hwif->dma_status		= tmp_hwif->dma_status;
+	hwif->dma_vendor3		= tmp_hwif->dma_vendor3;
+	hwif->dma_prdtable		= tmp_hwif->dma_prdtable;
+
+	hwif->dma_extra			= tmp_hwif->dma_extra;
+	hwif->config_data		= tmp_hwif->config_data;
+	hwif->select_data		= tmp_hwif->select_data;
+	hwif->autodma			= tmp_hwif->autodma;
+	hwif->udma_four			= tmp_hwif->udma_four;
+	hwif->no_dsc			= tmp_hwif->no_dsc;
+
+	hwif->hwif_data			= tmp_hwif->hwif_data;
+}
 
 /**
  *	ide_unregister		-	free an ide interface
@@ -608,18 +698,22 @@ EXPORT_SYMBOL(ide_hwif_release_regions);
  *	Unregister restores the hwif structures to the default state.
  *	This is raving bonkers.
  */
- 
-void ide_unregister (unsigned int index)
+
+void ide_unregister(unsigned int index)
 {
 	ide_drive_t *drive;
-	ide_hwif_t *hwif, *g;
+	ide_hwif_t *hwif, *g, *tmp_hwif;
 	ide_hwgroup_t *hwgroup;
 	int irq_count = 0, unit, i;
-	ide_hwif_t old_hwif;
 
-	if (index >= MAX_HWIFS)
-		BUG();
-		
+	BUG_ON(index >= MAX_HWIFS);
+
+	tmp_hwif = kmalloc(sizeof(*tmp_hwif), GFP_KERNEL|__GFP_NOFAIL);
+	if (!tmp_hwif) {
+		printk(KERN_ERR "%s: unable to allocate memory\n", __FUNCTION__);
+		return;
+	}
+
 	BUG_ON(in_interrupt());
 	BUG_ON(irqs_disabled());
 	down(&ide_cfg_sem);
@@ -636,7 +730,7 @@ void ide_unregister (unsigned int index)
 		drive->dead = 1;
 	}
 	hwif->present = 0;
-	
+
 	spin_unlock_irq(&ide_lock);
 
 	for (unit = 0; unit < MAX_DRIVES; ++unit) {
@@ -645,7 +739,7 @@ void ide_unregister (unsigned int index)
 			continue;
 		DRIVER(drive)->cleanup(drive);
 	}
-	
+
 #ifdef CONFIG_PROC_FS
 	destroy_proc_ide_drives(hwif);
 #endif
@@ -765,122 +859,20 @@ void ide_unregister (unsigned int index)
 		hwif->dma_prdtable = 0;
 	}
 
-	old_hwif			= *hwif;
+	/* copy original settings */
+	*tmp_hwif = *hwif;
 
-	init_hwif_data(hwif, index);	/* restore hwif data to pristine status */
+	/* restore hwif data to pristine status */
+	init_hwif_data(hwif, index);
 	init_hwif_default(hwif, index);
 
-	hwif->hwgroup			= old_hwif.hwgroup;
-
-	hwif->gendev.parent		= old_hwif.gendev.parent;
-
-	hwif->proc			= old_hwif.proc;
-
-	hwif->major			= old_hwif.major;
-//	hwif->index			= old_hwif.index;
-//	hwif->channel			= old_hwif.channel;
-	hwif->straight8			= old_hwif.straight8;
-	hwif->bus_state			= old_hwif.bus_state;
-
-	hwif->atapi_dma			= old_hwif.atapi_dma;
-	hwif->ultra_mask		= old_hwif.ultra_mask;
-	hwif->mwdma_mask		= old_hwif.mwdma_mask;
-	hwif->swdma_mask		= old_hwif.swdma_mask;
+	ide_hwif_restore(hwif, tmp_hwif);
 
-	hwif->chipset			= old_hwif.chipset;
-	hwif->hold			= old_hwif.hold;
-
-#ifdef CONFIG_BLK_DEV_IDEPCI
-	hwif->pci_dev			= old_hwif.pci_dev;
-	hwif->cds			= old_hwif.cds;
-#endif /* CONFIG_BLK_DEV_IDEPCI */
-
-#if 0
-	hwif->hwifops			= old_hwif.hwifops;
-#else
-	hwif->identify			= old_hwif.identify;
-	hwif->tuneproc			= old_hwif.tuneproc;
-	hwif->speedproc			= old_hwif.speedproc;
-	hwif->selectproc		= old_hwif.selectproc;
-	hwif->reset_poll		= old_hwif.reset_poll;
-	hwif->pre_reset			= old_hwif.pre_reset;
-	hwif->resetproc			= old_hwif.resetproc;
-	hwif->intrproc			= old_hwif.intrproc;
-	hwif->maskproc			= old_hwif.maskproc;
-	hwif->quirkproc			= old_hwif.quirkproc;
-	hwif->busproc			= old_hwif.busproc;
-#endif
-
-#if 0
-	hwif->pioops			= old_hwif.pioops;
-#else
-	hwif->ata_input_data		= old_hwif.ata_input_data;
-	hwif->ata_output_data		= old_hwif.ata_output_data;
-	hwif->atapi_input_bytes		= old_hwif.atapi_input_bytes;
-	hwif->atapi_output_bytes	= old_hwif.atapi_output_bytes;
-#endif
-
-#if 0
-	hwif->dmaops			= old_hwif.dmaops;
-#else
-	hwif->ide_dma_read		= old_hwif.ide_dma_read;
-	hwif->ide_dma_write		= old_hwif.ide_dma_write;
-	hwif->ide_dma_begin		= old_hwif.ide_dma_begin;
-	hwif->ide_dma_end		= old_hwif.ide_dma_end;
-	hwif->ide_dma_check		= old_hwif.ide_dma_check;
-	hwif->ide_dma_on		= old_hwif.ide_dma_on;
-	hwif->ide_dma_off_quietly	= old_hwif.ide_dma_off_quietly;
-	hwif->ide_dma_test_irq		= old_hwif.ide_dma_test_irq;
-	hwif->ide_dma_host_on		= old_hwif.ide_dma_host_on;
-	hwif->ide_dma_host_off		= old_hwif.ide_dma_host_off;
-	hwif->ide_dma_verbose		= old_hwif.ide_dma_verbose;
-	hwif->ide_dma_lostirq		= old_hwif.ide_dma_lostirq;
-	hwif->ide_dma_timeout		= old_hwif.ide_dma_timeout;
-#endif
-
-#if 0
-	hwif->iops			= old_hwif.iops;
-#else
-	hwif->OUTB		= old_hwif.OUTB;
-	hwif->OUTBSYNC		= old_hwif.OUTBSYNC;
-	hwif->OUTW		= old_hwif.OUTW;
-	hwif->OUTL		= old_hwif.OUTL;
-	hwif->OUTSW		= old_hwif.OUTSW;
-	hwif->OUTSL		= old_hwif.OUTSL;
-
-	hwif->INB		= old_hwif.INB;
-	hwif->INW		= old_hwif.INW;
-	hwif->INL		= old_hwif.INL;
-	hwif->INSW		= old_hwif.INSW;
-	hwif->INSL		= old_hwif.INSL;
-#endif
-
-	hwif->mmio			= old_hwif.mmio;
-	hwif->rqsize			= old_hwif.rqsize;
-	hwif->no_lba48			= old_hwif.no_lba48;
-#ifndef CONFIG_BLK_DEV_IDECS
-	hwif->irq			= old_hwif.irq;
-#endif /* CONFIG_BLK_DEV_IDECS */
-
-	hwif->dma_base			= old_hwif.dma_base;
-	hwif->dma_master		= old_hwif.dma_master;
-	hwif->dma_command		= old_hwif.dma_command;
-	hwif->dma_vendor1		= old_hwif.dma_vendor1;
-	hwif->dma_status		= old_hwif.dma_status;
-	hwif->dma_vendor3		= old_hwif.dma_vendor3;
-	hwif->dma_prdtable		= old_hwif.dma_prdtable;
-
-	hwif->dma_extra			= old_hwif.dma_extra;
-	hwif->config_data		= old_hwif.config_data;
-	hwif->select_data		= old_hwif.select_data;
-	hwif->autodma			= old_hwif.autodma;
-	hwif->udma_four			= old_hwif.udma_four;
-	hwif->no_dsc			= old_hwif.no_dsc;
-
-	hwif->hwif_data			= old_hwif.hwif_data;
 abort:
 	spin_unlock_irq(&ide_lock);
 	up(&ide_cfg_sem);
+
+	kfree(tmp_hwif);
 }
 
 EXPORT_SYMBOL(ide_unregister);
@@ -939,8 +931,6 @@ void ide_setup_ports (	hw_regs_t *hw,
  */
 }
 
-EXPORT_SYMBOL(ide_setup_ports);
-
 /*
  * Register an IDE interface, specifying exactly the registers etc
  * Set init=1 iff calling before probes have taken place.
@@ -1001,7 +991,6 @@ EXPORT_SYMBOL(ide_register_hw);
  */
 
 DECLARE_MUTEX(ide_setting_sem);
-EXPORT_SYMBOL(ide_setting_sem);
 
 /**
  *	ide_add_setting	-	add an ide setting option
@@ -1094,26 +1083,6 @@ static void __ide_remove_setting (ide_drive_t *drive, char *name)
 	kfree(setting);
 }
 
-/**
- *	ide_remove_setting	-	remove an ide setting option
- *	@drive: drive to use
- *	@name: setting name
- *
- *	Removes the setting named from the device if it is present.
- *	The function takes the settings_lock to protect against 
- *	parallel changes. This function must not be called from IRQ
- *	context.
- */
- 
-void ide_remove_setting (ide_drive_t *drive, char *name)
-{
-	down(&ide_setting_sem);
-	__ide_remove_setting(drive, name);
-	up(&ide_setting_sem);
-}
-
-EXPORT_SYMBOL(ide_remove_setting);
-
 /**
  *	ide_find_setting_by_ioctl	-	find a drive specific ioctl
  *	@drive: drive to scan
@@ -1295,8 +1264,6 @@ int ide_write_setting (ide_drive_t *drive, ide_settings_t *setting, int val)
 	return 0;
 }
 
-EXPORT_SYMBOL(ide_write_setting);
-
 static int set_io_32bit(ide_drive_t *drive, int arg)
 {
 	drive->io_32bit = arg;
@@ -1390,26 +1357,6 @@ void ide_add_generic_settings (ide_drive_t *drive)
 		ide_add_setting(drive,	"ide-scsi",		SETTING_RW,					-1,		HDIO_SET_IDE_SCSI,		TYPE_BYTE,	0,	1,				1,		1,		&drive->scsi,			ide_atapi_to_scsi);
 }
 
-/*
- * Delay for *at least* 50ms.  As we don't know how much time is left
- * until the next tick occurs, we wait an extra tick to be safe.
- * This is used only during the probing/polling for drives at boot time.
- *
- * However, its usefullness may be needed in other places, thus we export it now.
- * The future may change this to a millisecond setable delay.
- */
-void ide_delay_50ms (void)
-{
-#ifndef CONFIG_BLK_DEV_IDECS
-	mdelay(50);
-#else
-	__set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(1+HZ/20);
-#endif /* CONFIG_BLK_DEV_IDECS */
-}
-
-EXPORT_SYMBOL(ide_delay_50ms);
-
 int system_bus_clock (void)
 {
 	return((int) ((!system_bus_speed) ? ide_system_bus_speed() : system_bus_speed ));
@@ -1444,8 +1391,6 @@ abort:
 	return 1;
 }
 
-EXPORT_SYMBOL(ide_replace_subdriver);
-
 int ata_attach(ide_drive_t *drive)
 {
 	struct list_head *p;
@@ -1470,8 +1415,6 @@ int ata_attach(ide_drive_t *drive)
 	return 1;
 }
 
-EXPORT_SYMBOL(ata_attach);
-
 static int generic_ide_suspend(struct device *dev, u32 state)
 {
 	ide_drive_t *drive = dev->driver_data;
@@ -1516,13 +1459,14 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 	ide_drive_t *drive = bdev->bd_disk->private_data;
 	ide_settings_t *setting;
 	int err = 0;
+	void __user *p = (void __user *)arg;
 
 	down(&ide_setting_sem);
 	if ((setting = ide_find_setting_by_ioctl(drive, cmd)) != NULL) {
 		if (cmd == setting->read_ioctl) {
 			err = ide_read_setting(drive, setting);
 			up(&ide_setting_sem);
-			return err >= 0 ? put_user(err, (long *) arg) : err;
+			return err >= 0 ? put_user(err, (long __user *)arg) : err;
 		} else {
 			if (bdev != bdev->bd_contains)
 				err = -EINVAL;
@@ -1537,14 +1481,14 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 	switch (cmd) {
 		case HDIO_GETGEO:
 		{
-			struct hd_geometry *loc = (struct hd_geometry *) arg;
-			u16 bios_cyl = drive->bios_cyl; /* truncate */
-			if (!loc || (drive->media != ide_disk && drive->media != ide_floppy)) return -EINVAL;
-			if (put_user(drive->bios_head, (u8 *) &loc->heads)) return -EFAULT;
-			if (put_user(drive->bios_sect, (u8 *) &loc->sectors)) return -EFAULT;
-			if (put_user(bios_cyl, (u16 *) &loc->cylinders)) return -EFAULT;
-			if (put_user((unsigned)get_start_sect(bdev),
-				(unsigned long *) &loc->start)) return -EFAULT;
+			struct hd_geometry geom;
+			if (!p || (drive->media != ide_disk && drive->media != ide_floppy)) return -EINVAL;
+			geom.heads = drive->bios_head;
+			geom.sectors = drive->bios_sect;
+			geom.cylinders = (u16)drive->bios_cyl; /* truncate */
+			geom.start = get_start_sect(bdev);
+			if (copy_to_user(p, &geom, sizeof(struct hd_geometry)))
+				return -EFAULT;
 			return 0;
 		}
 
@@ -1554,7 +1498,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 				return -EINVAL;
 			if (drive->id_read == 0)
 				return -ENOMSG;
-			if (copy_to_user((char *)arg, (char *)drive->id, (cmd == HDIO_GET_IDENTITY) ? sizeof(*drive->id) : 142))
+			if (copy_to_user(p, drive->id, (cmd == HDIO_GET_IDENTITY) ? sizeof(*drive->id) : 142))
 				return -EFAULT;
 			return 0;
 
@@ -1564,7 +1508,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 					drive->nice0		<< 	IDE_NICE_0		|
 					drive->nice1		<<	IDE_NICE_1		|
 					drive->nice2		<<	IDE_NICE_2,
-					(long *) arg);
+					(long __user *) arg);
 
 #ifdef CONFIG_IDE_TASK_IOCTL
 		case HDIO_DRIVE_TASKFILE:
@@ -1593,7 +1537,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 			hw_regs_t hw;
 			int args[3];
 			if (!capable(CAP_SYS_RAWIO)) return -EACCES;
-			if (copy_from_user(args, (void *)arg, 3 * sizeof(int)))
+			if (copy_from_user(args, p, 3 * sizeof(int)))
 				return -EFAULT;
 			memset(&hw, 0, sizeof(hw));
 			ide_init_hwif_ports(&hw, (unsigned long) args[0],
@@ -1661,12 +1605,12 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 
 		case CDROMEJECT:
 		case CDROMCLOSETRAY:
-			return scsi_cmd_ioctl(bdev->bd_disk, cmd, arg);
+			return scsi_cmd_ioctl(bdev->bd_disk, cmd, p);
 
 		case HDIO_GET_BUSSTATE:
 			if (!capable(CAP_SYS_ADMIN))
 				return -EACCES;
-			if (put_user(HWIF(drive)->bus_state, (long *)arg))
+			if (put_user(HWIF(drive)->bus_state, (long __user *)arg))
 				return -EFAULT;
 			return 0;
 
@@ -1828,7 +1772,7 @@ int __init ide_setup (char *s)
 	if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
 		const char *hd_words[] = {
 			"none", "noprobe", "nowerr", "cdrom", "serialize",
-			"autotune", "noautotune", "minus8", "swapdata", "bswap",
+			"autotune", "noautotune", "stroke", "swapdata", "bswap",
 			"minus11", "remap", "remap63", "scsi", NULL };
 		unit = s[2] - 'a';
 		hw   = unit / MAX_DRIVES;
@@ -1862,6 +1806,9 @@ int __init ide_setup (char *s)
 			case -7: /* "noautotune" */
 				drive->autotune = IDE_TUNE_NOAUTO;
 				goto done;
+			case -8: /* stroke */
+				drive->stroke = 1;
+				goto done;
 			case -9: /* "swapdata" */
 			case -10: /* "bswap" */
 				drive->bswap = 1;
@@ -2056,6 +2003,9 @@ done:
 	return 1;
 }
 
+extern void pnpide_init(void);
+extern void h8300_ide_init(void);
+
 /*
  * probe_for_hwifs() finds/initializes "known" IDE interfaces
  */
@@ -2090,12 +2040,6 @@ static void __init probe_for_hwifs (void)
 		pmac_ide_probe();
 	}
 #endif /* CONFIG_BLK_DEV_IDE_PMAC */
-#ifdef CONFIG_BLK_DEV_IDE_SWARM
-	{
-		extern void swarm_ide_probe(void);
-		swarm_ide_probe();
-	}
-#endif /* CONFIG_BLK_DEV_IDE_SWARM */
 #ifdef CONFIG_BLK_DEV_GAYLE
 	{
 		extern void gayle_init(void);
@@ -2126,12 +2070,12 @@ static void __init probe_for_hwifs (void)
 		buddha_init();
 	}
 #endif /* CONFIG_BLK_DEV_BUDDHA */
-#if defined(CONFIG_BLK_DEV_IDEPNP) && defined(CONFIG_PNP)
-	{
-		extern void pnpide_init(int enable);
-		pnpide_init(1);
-	}
-#endif /* CONFIG_BLK_DEV_IDEPNP */
+#ifdef CONFIG_BLK_DEV_IDEPNP
+	pnpide_init();
+#endif
+#ifdef CONFIG_H8300
+	h8300_ide_init();
+#endif
 }
 
 /*
@@ -2266,9 +2210,6 @@ int ide_unregister_subdriver (ide_drive_t *drive)
 		up(&ide_setting_sem);
 		return 1;
 	}
-#if defined(CONFIG_BLK_DEV_IDEPNP) && defined(CONFIG_PNP) && defined(MODULE)
-	pnpide_init(0);
-#endif /* CONFIG_BLK_DEV_IDEPNP */
 #ifdef CONFIG_PROC_FS
 	ide_remove_proc_entries(drive->proc, DRIVER(drive)->proc);
 	ide_remove_proc_entries(drive->proc, generic_subdriver_entries);
diff --git a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c
index 802e1f64a..73e833d0f 100644
--- a/drivers/ide/legacy/pdc4030.c
+++ b/drivers/ide/legacy/pdc4030.c
@@ -282,8 +282,8 @@ int __init detect_pdc4030(ide_hwif_t *hwif)
 	hwif->OUTB(0xF3, IDE_SECTOR_REG);
 	hwif->OUTB(0x14, IDE_SELECT_REG);
 	hwif->OUTB(PROMISE_EXTENDED_COMMAND, IDE_COMMAND_REG);
-	
-	ide_delay_50ms();
+
+	msleep(50);
 
 	if (hwif->INB(IDE_ERROR_REG) == 'P' &&
 	    hwif->INB(IDE_NSECTOR_REG) == 'T' &&
@@ -756,18 +756,6 @@ static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq,
 
 	BUG_ON(rq->nr_sectors > 127);
 
-	if (!blk_fs_request(rq)) {
-		blk_dump_rq_flags(rq, "promise_rw_disk - bad command");
-		DRIVER(drive)->end_request(drive, 0, 0);
-		return ide_stopped;
-	}
-
-#ifdef DEBUG
-	printk(KERN_DEBUG "%s: %sing: LBAsect=%lu, sectors=%lu\n",
-			  drive->name, rq_data_dir(rq) ? "writ" : "read",
-			  block, rq->nr_sectors);
-#endif
-
 #ifndef CONFIG_IDE_TASKFILE_IO
 	if (IDE_CONTROL_REG)
 		hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
diff --git a/drivers/ide/pci/adma100.h b/drivers/ide/pci/adma100.h
index 4fb0e6dd7..f357b8ca8 100644
--- a/drivers/ide/pci/adma100.h
+++ b/drivers/ide/pci/adma100.h
@@ -17,19 +17,11 @@ static ide_pci_device_t pdcadma_chipsets[] __devinitdata = {
 		.name		= "ADMA100",
 		.init_setup	= init_setup_pdcadma,
 		.init_chipset	= init_chipset_pdcadma,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdcadma,
 		.init_dma	= init_dma_pdcadma,
 		.channels	= 2,
 		.autodma	= NODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 }
 
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index f474e1dbe..b032d2459 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -409,7 +409,7 @@ static int aec62xx_irq_timeout (ide_drive_t *drive)
 	return 0;
 }
 
-static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
 {
 	int bus_speed = system_bus_clock();
 
@@ -435,7 +435,7 @@ static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char
 	return dev->irq;
 }
 
-static void __init init_hwif_aec62xx (ide_hwif_t *hwif)
+static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
 {
 	hwif->autodma = 0;
 	hwif->tuneproc = &aec62xx_tune_drive;
@@ -468,7 +468,7 @@ static void __init init_hwif_aec62xx (ide_hwif_t *hwif)
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
-static void __init init_dma_aec62xx (ide_hwif_t *hwif, unsigned long dmabase)
+static void __devinit init_dma_aec62xx(ide_hwif_t *hwif, unsigned long dmabase)
 {
 	struct pci_dev *dev	= hwif->pci_dev;
 
@@ -490,12 +490,12 @@ static void __init init_dma_aec62xx (ide_hwif_t *hwif, unsigned long dmabase)
 	ide_setup_dma(hwif, dmabase, 8);
 }
 
-static void __init init_setup_aec62xx (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_aec6x80(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	unsigned long bar4reg = pci_resource_start(dev, 4);
 
@@ -525,8 +525,6 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
 {
 	ide_pci_device_t *d = &aec62xx_chipsets[id->driver_data];
 
-	if (dev->device != d->device)
-		BUG();
 	d->init_setup(dev, d);
 	return 0;
 }
diff --git a/drivers/ide/pci/aec62xx.h b/drivers/ide/pci/aec62xx.h
index c4145488d..3f272752c 100644
--- a/drivers/ide/pci/aec62xx.h
+++ b/drivers/ide/pci/aec62xx.h
@@ -78,75 +78,53 @@ static void init_dma_aec62xx(ide_hwif_t *, unsigned long);
 
 static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_ARTOP,
-		.device		= PCI_DEVICE_ID_ARTOP_ATP850UF,
 		.name		= "AEC6210",
 		.init_setup	= init_setup_aec62xx,
 		.init_chipset	= init_chipset_aec62xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_aec62xx,
 		.init_dma	= init_dma_aec62xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_ARTOP,
-		.device		= PCI_DEVICE_ID_ARTOP_ATP860,
 		.name		= "AEC6260",
 		.init_setup	= init_setup_aec62xx,
 		.init_chipset	= init_chipset_aec62xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_aec62xx,
 		.init_dma	= init_dma_aec62xx,
 		.channels	= 2,
 		.autodma	= NOAUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_ARTOP,
-		.device		= PCI_DEVICE_ID_ARTOP_ATP860R,
 		.name		= "AEC6260R",
 		.init_setup	= init_setup_aec62xx,
 		.init_chipset	= init_chipset_aec62xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_aec62xx,
 		.init_dma	= init_dma_aec62xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
 		.bootable	= NEVER_BOARD,
-		.extra		= 0,
 	},{	/* 3 */
-		.vendor		= PCI_VENDOR_ID_ARTOP,
-		.device		= PCI_DEVICE_ID_ARTOP_ATP865,
 		.name		= "AEC6X80",
 		.init_setup	= init_setup_aec6x80,
 		.init_chipset	= init_chipset_aec62xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_aec62xx,
 		.init_dma	= init_dma_aec62xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 4 */
-		.vendor		= PCI_VENDOR_ID_ARTOP,
-		.device		= PCI_DEVICE_ID_ARTOP_ATP865R,
 		.name		= "AEC6X80R",
 		.init_setup	= init_setup_aec6x80,
 		.init_chipset	= init_chipset_aec62xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_aec62xx,
 		.init_dma	= init_dma_aec62xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	}
 };
 
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index eb51201ab..2a343679a 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -38,7 +38,7 @@
 
 #include <asm/io.h>
 
-#include "alim15x3.h"
+#define DISPLAY_ALI_TIMINGS
 
 /*
  *	ALi devices are not plug in. Otherwise these static values would
@@ -853,6 +853,16 @@ static void __init init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
 	ide_setup_dma(hwif, dmabase, 8);
 }
 
+static ide_pci_device_t ali15x3_chipset __devinitdata = {
+	.name		= "ALI15X3",
+	.init_chipset	= init_chipset_ali15x3,
+	.init_hwif	= init_hwif_ali15x3,
+	.init_dma	= init_dma_ali15x3,
+	.channels	= 2,
+	.autodma	= AUTODMA,
+	.bootable	= ON_BOARD,
+};
+
 /**
  *	alim15x3_init_one	-	set up an ALi15x3 IDE controller
  *	@dev: PCI device to set up
@@ -863,8 +873,8 @@ static void __init init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
  
 static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &ali15x3_chipsets[id->driver_data];
-	
+	ide_pci_device_t *d = &ali15x3_chipset;
+
 	if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, NULL))
 		printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not yet fully tested.\n");
 
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 5093d3cff..d6b052300 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -1,7 +1,8 @@
 /*
  * Version 2.13
  *
- * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s IDE driver for Linux.
+ * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
+ * IDE driver for Linux.
  *
  * Copyright (c) 2000-2002 Vojtech Pavlik
  *
@@ -26,7 +27,8 @@
 #include <asm/io.h>
 
 #include "ide-timing.h"
-#include "amd74xx.h"
+
+#define DISPLAY_AMD_TIMINGS
 
 #define AMD_IDE_ENABLE		(0x00 + amd_config->base)
 #define AMD_IDE_CONFIG		(0x01 + amd_config->base)
@@ -68,6 +70,12 @@ static struct amd_ide_chip {
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE,	0x50, AMD_UDMA_133 },
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,	0x50, AMD_UDMA_133 },
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,	0x50, AMD_UDMA_133 },
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE,	0x50, AMD_UDMA_133 },
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA,	0x50, AMD_UDMA_133 },
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2,	0x50, AMD_UDMA_133 },
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE,	0x50, AMD_UDMA_133 },
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA,	0x50, AMD_UDMA_133 },
+	{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2,	0x50, AMD_UDMA_133 },
 	{ 0 }
 };
 
@@ -441,11 +449,55 @@ static void __init init_hwif_amd74xx(ide_hwif_t *hwif)
         hwif->drives[1].autodma = hwif->autodma;
 }
 
+#define DECLARE_AMD_DEV(name_str)					\
+	{								\
+		.name		= name_str,				\
+		.init_chipset	= init_chipset_amd74xx,			\
+		.init_hwif	= init_hwif_amd74xx,			\
+		.channels	= 2,					\
+		.autodma	= AUTODMA,				\
+		.enablebits	= {{0x40,0x02,0x02}, {0x40,0x01,0x01}},	\
+		.bootable	= ON_BOARD,				\
+	}
+
+#define DECLARE_NV_DEV(name_str)					\
+	{								\
+		.name		= name_str,				\
+		.init_chipset	= init_chipset_amd74xx,			\
+		.init_hwif	= init_hwif_amd74xx,			\
+		.channels	= 2,					\
+		.autodma	= AUTODMA,				\
+		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x01,0x01}},	\
+		.bootable	= ON_BOARD,				\
+	}
+
+static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
+	/*  0 */ DECLARE_AMD_DEV("AMD7401"),
+	/*  1 */ DECLARE_AMD_DEV("AMD7409"),
+	/*  2 */ DECLARE_AMD_DEV("AMD7411"),
+	/*  3 */ DECLARE_AMD_DEV("AMD7441"),
+	/*  4 */ DECLARE_AMD_DEV("AMD8111"),
+
+	/*  5 */ DECLARE_NV_DEV("NFORCE"),
+	/*  6 */ DECLARE_NV_DEV("NFORCE2"),
+	/*  7 */ DECLARE_NV_DEV("NFORCE2-U400R"),
+	/*  8 */ DECLARE_NV_DEV("NFORCE2-U400R-SATA"),
+	/*  9 */ DECLARE_NV_DEV("NFORCE3-150"),
+	/* 10 */ DECLARE_NV_DEV("NFORCE3-250"),
+	/* 11 */ DECLARE_NV_DEV("NFORCE3-250-SATA"),
+	/* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2"),
+	/* 13 */ DECLARE_NV_DEV("NFORCE-CK804"),
+	/* 14 */ DECLARE_NV_DEV("NFORCE-CK804-SATA"),
+	/* 15 */ DECLARE_NV_DEV("NFORCE-CK804-SATA2"),
+	/* 16 */ DECLARE_NV_DEV("NFORCE-MCP04"),
+	/* 17 */ DECLARE_NV_DEV("NFORCE-MCP04-SATA"),
+	/* 18 */ DECLARE_NV_DEV("NFORCE-MCP04-SATA2")
+};
+
 static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	amd_chipset = amd74xx_chipsets + id->driver_data;
 	amd_config = amd_ide_chips + id->driver_data;
-	if (dev->device != amd_chipset->device) BUG();
 	if (dev->device != amd_config->id) BUG();
 	ide_setup_pci_device(dev, amd_chipset);
 	return 0;
@@ -465,6 +517,12 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18 },
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 18475a89b..bd3708568 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -458,8 +458,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
 
 static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_ATI,
-		.device		= PCI_DEVICE_ID_ATI_IXP_IDE,
 		.name		= "ATIIXP",
 		.init_chipset	= init_chipset_atiixp,
 		.init_hwif	= init_hwif_atiixp,
@@ -481,11 +479,7 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
 
 static int __devinit atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &atiixp_pci_info[id->driver_data];
-
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &atiixp_pci_info[id->driver_data]);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index c04122f8a..06b00a3c3 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -586,7 +586,7 @@ static int cmd646_1_ide_dma_end (ide_drive_t *drive)
 	return (dma_stat & 7) != 4;
 }
 
-static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const char *name)
 {
 	u32 class_rev = 0;
 	u8 mrdmode = 0;
@@ -674,7 +674,7 @@ static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char
 	return 0;
 }
 
-static unsigned int __init ata66_cmd64x (ide_hwif_t *hwif)
+static unsigned int __devinit ata66_cmd64x(ide_hwif_t *hwif)
 {
 	u8 ata66 = 0, mask = (hwif->channel) ? 0x02 : 0x01;
 
@@ -689,7 +689,7 @@ static unsigned int __init ata66_cmd64x (ide_hwif_t *hwif)
 	return (ata66 & mask) ? 1 : 0;
 }
 
-static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
+static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
 {
 	struct pci_dev *dev	= hwif->pci_dev;
 	unsigned int class_rev;
@@ -746,10 +746,7 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
 
 static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &cmd64x_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &cmd64x_chipsets[id->driver_data]);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/cmd64x.h b/drivers/ide/pci/cmd64x.h
index ae6359c2e..f5dde235a 100644
--- a/drivers/ide/pci/cmd64x.h
+++ b/drivers/ide/pci/cmd64x.h
@@ -65,58 +65,34 @@ static void init_hwif_cmd64x(ide_hwif_t *);
 
 static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_CMD,
-		.device		= PCI_DEVICE_ID_CMD_643,
 		.name		= "CMD643",
 		.init_chipset	= init_chipset_cmd64x,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_cmd64x,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_CMD,
-		.device		= PCI_DEVICE_ID_CMD_646,
 		.name		= "CMD646",
 		.init_chipset	= init_chipset_cmd64x,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_cmd64x,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_CMD,
-		.device	= PCI_DEVICE_ID_CMD_648,
 		.name		= "CMD648",
 		.init_chipset	= init_chipset_cmd64x,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_cmd64x,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{
-		.vendor		= PCI_VENDOR_ID_CMD,
-		.device		= PCI_DEVICE_ID_CMD_649,
 		.name		= "CMD649",
 		.init_chipset	= init_chipset_cmd64x,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_cmd64x,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 2,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index dc0f6c804..5882693d0 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -51,7 +51,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include "cs5520.h"
+#define DISPLAY_CS5520_TIMINGS
 
 #if defined(DISPLAY_CS5520_TIMINGS) && defined(CONFIG_PROC_FS)
 #include <linux/stat.h>
@@ -251,7 +251,24 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
 	hwif->drives[0].autodma = hwif->autodma;
 	hwif->drives[1].autodma = hwif->autodma;
 }
-		
+
+#define DECLARE_CS_DEV(name_str)				\
+	{							\
+		.name		= name_str,			\
+		.init_chipset	= init_chipset_cs5520,		\
+		.init_setup_dma = cs5520_init_setup_dma,	\
+		.init_hwif	= init_hwif_cs5520,		\
+		.channels	= 2,				\
+		.autodma	= AUTODMA,			\
+		.bootable	= ON_BOARD,			\
+		.flags		= IDEPCI_FLAG_ISA_PORTS,	\
+	}
+
+static ide_pci_device_t cyrix_chipsets[] __devinitdata = {
+	/* 0 */ DECLARE_CS_DEV("Cyrix 5510"),
+	/* 1 */ DECLARE_CS_DEV("Cyrix 5520")
+};
+
 /*
  *	The 5510/5520 are a bit weird. They don't quite set up the way
  *	the PCI helper layer expects so we must do much of the set up 
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 7544904e9..b63e2d611 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -31,7 +31,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include "cs5530.h"
+#define DISPLAY_CS5530_TIMINGS
 
 #if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS)
 #include <linux/stat.h>
@@ -404,12 +404,19 @@ static void __init init_hwif_cs5530 (ide_hwif_t *hwif)
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
+static ide_pci_device_t cs5530_chipset __devinitdata = {
+	.name		= "CS5530",
+	.init_chipset	= init_chipset_cs5530,
+	.init_hwif	= init_hwif_cs5530,
+	.channels	= 2,
+	.autodma	= AUTODMA,
+	.bootable	= ON_BOARD,
+	.flags		= IDEPCI_FLAG_FORCE_MASTER,
+};
+
 static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &cs5530_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &cs5530_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/cy82c693.h b/drivers/ide/pci/cy82c693.h
index 33c0b6466..cccb69b4d 100644
--- a/drivers/ide/pci/cy82c693.h
+++ b/drivers/ide/pci/cy82c693.h
@@ -70,23 +70,13 @@ static void init_iops_cy82c693(ide_hwif_t *);
 
 static ide_pci_device_t cy82c693_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_CONTAQ,
-		.device		= PCI_DEVICE_ID_CONTAQ_82C693,
 		.name		= "CY82C693",
 		.init_chipset	= init_chipset_cy82c693,
 		.init_iops	= init_iops_cy82c693,
 		.init_hwif	= init_hwif_cy82c693,
-		.init_dma	= NULL,
 		.channels	= 1,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index ca9997738..e73279563 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -77,8 +77,6 @@ static void __init init_hwif_generic (ide_hwif_t *hwif)
 
 	if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
 		ide_pci_device_t *unknown = unknown_chipset;
-//		unknown->vendor = dev->vendor;
-//		unknown->device = dev->device;
 		init_setup_unknown(dev, unknown);
 		return 1;
 	}
@@ -99,15 +97,13 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
 	ide_pci_device_t *d = &generic_chipsets[id->driver_data];
 	u16 command;
 
-	if (dev->device != d->device)
-		BUG();
-	if ((d->vendor == PCI_VENDOR_ID_UMC) &&
-	    (d->device == PCI_DEVICE_ID_UMC_UM8886A) &&
+	if (dev->vendor == PCI_VENDOR_ID_UMC &&
+	    dev->device == PCI_DEVICE_ID_UMC_UM8886A &&
 	    (!(PCI_FUNC(dev->devfn) & 1)))
 		return 1; /* UM8886A/BF pair */
 
-	if ((d->vendor == PCI_VENDOR_ID_OPTI) &&
-	    (d->device == PCI_DEVICE_ID_OPTI_82C558) &&
+	if (dev->vendor == PCI_VENDOR_ID_OPTI &&
+	    dev->device == PCI_DEVICE_ID_OPTI_82C558 &&
 	    (!(PCI_FUNC(dev->devfn) & 1)))
 		return 1;
 
diff --git a/drivers/ide/pci/generic.h b/drivers/ide/pci/generic.h
index 953cc118d..a66692026 100644
--- a/drivers/ide/pci/generic.h
+++ b/drivers/ide/pci/generic.h
@@ -10,128 +10,77 @@ static void init_hwif_generic(ide_hwif_t *);
 
 static ide_pci_device_t generic_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_NS,
-		.device		= PCI_DEVICE_ID_NS_87410,
 		.name		= "NS87410",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
         },{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_PCTECH,
-		.device		= PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
 		.name		= "SAMURAI",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_HOLTEK,
-		.device		= PCI_DEVICE_ID_HOLTEK_6565,
 		.name		= "HT6565",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 3 */
-		.vendor		= PCI_VENDOR_ID_UMC,
-		.device		= PCI_DEVICE_ID_UMC_UM8673F,
 		.name		= "UM8673F",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= NODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 4 */
-		.vendor		= PCI_VENDOR_ID_UMC,
-		.device		= PCI_DEVICE_ID_UMC_UM8886A,
 		.name		= "UM8886A",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= NODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 5 */
-		.vendor		= PCI_VENDOR_ID_UMC,
-		.device		= PCI_DEVICE_ID_UMC_UM8886BF,
 		.name		= "UM8886BF",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= NODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 6 */
-		.vendor		= PCI_VENDOR_ID_HINT,
-		.device		= PCI_DEVICE_ID_HINT_VXPROII_IDE,
 		.name		= "HINT_IDE",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 7 */
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device		= PCI_DEVICE_ID_VIA_82C561,
 		.name		= "VIA_IDE",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= NOAUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 8 */
-		.vendor		= PCI_VENDOR_ID_OPTI,
-		.device		= PCI_DEVICE_ID_OPTI_82C558,
 		.name		= "OPTI621V",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= NOAUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 9 */
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device		= PCI_DEVICE_ID_VIA_8237_SATA,
 		.name		= "VIA8237SATA",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{ /* 10 */
-		.vendor		= PCI_VENDOR_ID_TOSHIBA,
-		.device		= PCI_DEVICE_ID_TOSHIBA_PICCOLO,
 		.name 		= "Piccolo0102",
 		.init_chipset	= init_chipset_generic,
 		.init_hwif	= init_hwif_generic,
@@ -139,8 +88,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
 		.autodma	= NOAUTODMA,
 		.bootable	= ON_BOARD,
 	},{ /* 11 */
-		.vendor		= PCI_VENDOR_ID_TOSHIBA,
-		.device		= PCI_DEVICE_ID_TOSHIBA_PICCOLO_1,
 		.name 		= "Piccolo0103",
 		.init_chipset	= init_chipset_generic,
 		.init_hwif	= init_hwif_generic,
@@ -148,43 +95,25 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
 		.autodma	= NOAUTODMA,
 		.bootable	= ON_BOARD,
 	},{ /* 12 */
-		.vendor		= PCI_VENDOR_ID_TOSHIBA,
-		.device		= PCI_DEVICE_ID_TOSHIBA_PICCOLO_2,
 		.name 		= "Piccolo0105",
 		.init_chipset	= init_chipset_generic,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= NOAUTODMA,
 		.bootable	= ON_BOARD,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
 #if 0
 static ide_pci_device_t unknown_chipset[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= 0,
-		.device		= 0,
 		.name		= "PCI_IDE",
 		.init_chipset	= init_chipset_generic,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_generic,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
-
 };
 #endif
 
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index c33cd8ee3..f9c9ab664 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -235,7 +235,7 @@ no_dma_set:
  */
 #define	HPT34X_PCI_INIT_REG		0x80
 
-static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const char *name)
 {
 	int i = 0;
 	unsigned long hpt34xIoBase = pci_resource_start(dev, 4);
@@ -289,7 +289,7 @@ static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char
 	return dev->irq;
 }
 
-static void __init init_hwif_hpt34x (ide_hwif_t *hwif)
+static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
 {
 	u16 pcicmd = 0;
 
diff --git a/drivers/ide/pci/hpt34x.h b/drivers/ide/pci/hpt34x.h
index 47b4be100..465f56715 100644
--- a/drivers/ide/pci/hpt34x.h
+++ b/drivers/ide/pci/hpt34x.h
@@ -18,22 +18,13 @@ static void init_hwif_hpt34x(ide_hwif_t *);
 
 static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_TTI,
-		.device		= PCI_DEVICE_ID_TTI_HPT343,
 		.name		= "HPT34X",
 		.init_chipset	= init_chipset_hpt34x,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_hpt34x,
 		.channels	= 2,
 		.autodma	= NOAUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= NEVER_BOARD,
 		.extra		= 16
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index d3129b2a9..77bc20861 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -795,7 +795,7 @@ static int hpt370_busproc(ide_drive_t * drive, int state)
 	return 0;
 }
 
-static int __init init_hpt37x(struct pci_dev *dev)
+static int __devinit init_hpt37x(struct pci_dev *dev)
 {
 	int adjust, i;
 	u16 freq;
@@ -923,7 +923,7 @@ init_hpt37X_done:
 	return 0;
 }
 
-static int __init init_hpt366 (struct pci_dev *dev)
+static int __devinit init_hpt366(struct pci_dev *dev)
 {
 	u32 reg1	= 0;
 	u8 drive_fast	= 0;
@@ -958,7 +958,7 @@ static int __init init_hpt366 (struct pci_dev *dev)
 	return 0;
 }
 
-static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const char *name)
 {
 	int ret = 0;
 	u8 test = 0;
@@ -1004,7 +1004,7 @@ static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char
 	return dev->irq;
 }
 
-static void __init init_hwif_hpt366 (ide_hwif_t *hwif)
+static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
 {
 	struct pci_dev *dev		= hwif->pci_dev;
 	u8 ata66 = 0, regmask		= (hwif->channel) ? 0x01 : 0x02;
@@ -1116,7 +1116,7 @@ static void __init init_hwif_hpt366 (ide_hwif_t *hwif)
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
-static void __init init_dma_hpt366 (ide_hwif_t *hwif, unsigned long dmabase)
+static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
 {
 	u8 masterdma	= 0, slavedma = 0;
 	u8 dma_new	= 0, dma_old = 0;
@@ -1151,7 +1151,7 @@ static void __init init_dma_hpt366 (ide_hwif_t *hwif, unsigned long dmabase)
 	ide_setup_dma(hwif, dmabase, 8);
 }
 
-static void __init init_setup_hpt374 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_hpt374(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	struct pci_dev *findev = NULL;
 
@@ -1176,12 +1176,12 @@ static void __init init_setup_hpt374 (struct pci_dev *dev, ide_pci_device_t *d)
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_hpt37x (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_hpt37x(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	struct pci_dev *findev = NULL;
 	u8 pin1 = 0, pin2 = 0;
@@ -1241,8 +1241,6 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
 {
 	ide_pci_device_t *d = &hpt366_chipsets[id->driver_data];
 
-	if (dev->device != d->device)
-		BUG();
 	d->init_setup(dev, d);
 	return 0;
 }
diff --git a/drivers/ide/pci/hpt366.h b/drivers/ide/pci/hpt366.h
index d9f69f086..7b3d8b410 100644
--- a/drivers/ide/pci/hpt366.h
+++ b/drivers/ide/pci/hpt366.h
@@ -425,80 +425,51 @@ static void init_dma_hpt366(ide_hwif_t *, unsigned long);
 
 static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_TTI,
-		.device		= PCI_DEVICE_ID_TTI_HPT366,
 		.name		= "HPT366",
 		.init_setup	= init_setup_hpt366,
 		.init_chipset	= init_chipset_hpt366,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_hpt366,
 		.init_dma	= init_dma_hpt366,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
 		.extra		= 240
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_TTI,
-		.device		= PCI_DEVICE_ID_TTI_HPT372,
 		.name		= "HPT372A",
 		.init_setup	= init_setup_hpt37x,
 		.init_chipset	= init_chipset_hpt366,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_hpt366,
 		.init_dma	= init_dma_hpt366,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_TTI,
-		.device		= PCI_DEVICE_ID_TTI_HPT302,
 		.name		= "HPT302",
 		.init_setup	= init_setup_hpt37x,
 		.init_chipset	= init_chipset_hpt366,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_hpt366,
 		.init_dma	= init_dma_hpt366,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0
 	},{	/* 3 */
-		.vendor		= PCI_VENDOR_ID_TTI,
-		.device		= PCI_DEVICE_ID_TTI_HPT371,
 		.name		= "HPT371",
 		.init_setup	= init_setup_hpt37x,
 		.init_chipset	= init_chipset_hpt366,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_hpt366,
 		.init_dma	= init_dma_hpt366,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0
 	},{	/* 4 */
-		.vendor		= PCI_VENDOR_ID_TTI,
-		.device		= PCI_DEVICE_ID_TTI_HPT374,
 		.name		= "HPT374",
 		.init_setup	= init_setup_hpt374,
 		.init_chipset	= init_chipset_hpt366,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_hpt366,
 		.init_dma	= init_dma_hpt366,
 		.channels	= 2,	/* 4 */
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c
index 873e56e6a..b65ce0877 100644
--- a/drivers/ide/pci/it8172.c
+++ b/drivers/ide/pci/it8172.c
@@ -288,11 +288,10 @@ static void __init init_hwif_it8172 (ide_hwif_t *hwif)
 
 static int __devinit it8172_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &it8172_chipsets[id->driver_data];
         if ((!(PCI_FUNC(dev->devfn) & 1) ||
             (!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
                 return 1; /* IT8172 is more than only a IDE controller */
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &it8172_chipsets[id->driver_data]);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/it8172.h b/drivers/ide/pci/it8172.h
index 6c49b6f41..fbc2b6400 100644
--- a/drivers/ide/pci/it8172.h
+++ b/drivers/ide/pci/it8172.h
@@ -20,23 +20,14 @@ static void init_hwif_it8172(ide_hwif_t *);
 
 static ide_pci_device_t it8172_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_ITE,
-		.device		= PCI_DEVICE_ID_ITE_IT8172G,
 		.name		= "IT8172G",
 		.init_setup	= init_setup_it8172,
 		.init_chipset	= init_chipset_it8172,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_it8172,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x00,0x00,0x00}, {0x40,0x00,0x01}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index 279c0323c..a5b6e7e5c 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -25,8 +25,6 @@
 
 #include <asm/io.h>
 
-#include "ns87415.h"
-
 static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 };
 
 /*
@@ -217,12 +215,17 @@ static void __init init_hwif_ns87415 (ide_hwif_t *hwif)
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
+static ide_pci_device_t ns87415_chipset __devinitdata = {
+	.name		= "NS87415",
+	.init_hwif	= init_hwif_ns87415,
+	.channels	= 2,
+	.autodma	= AUTODMA,
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &ns87415_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &ns87415_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
index 8a6c31649..3ca7db7d5 100644
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -355,10 +355,7 @@ static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d)
 
 static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &opti621_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &opti621_chipsets[id->driver_data]);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/opti621.h b/drivers/ide/pci/opti621.h
index c0190467c..a0e6504c3 100644
--- a/drivers/ide/pci/opti621.h
+++ b/drivers/ide/pci/opti621.h
@@ -10,36 +10,21 @@ static void init_hwif_opti621(ide_hwif_t *);
 
 static ide_pci_device_t opti621_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_OPTI,
-		.device		= PCI_DEVICE_ID_OPTI_82C621,
 		.name		= "OPTI621",
 		.init_setup	= init_setup_opti621,
-		.init_chipset	= NULL,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_opti621,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_OPTI,
-		.device		= PCI_DEVICE_ID_OPTI_82C825,
 		.name		= "OPTI621X",
 		.init_setup	= init_setup_opti621,
-		.init_chipset	= NULL,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_opti621,
 		.channels	= 2,
 		.autodma	= AUTODMA,
 		.enablebits	= {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index f753c6316..f493b29ce 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -404,7 +404,7 @@ static void __devinit apple_kiwi_init(struct pci_dev *pdev)
 }
 #endif /* CONFIG_PPC_PMAC */
 
-static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const char *name)
 {
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
@@ -429,7 +429,7 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char
 	return dev->irq;
 }
 
-static void __init init_hwif_pdc202new (ide_hwif_t *hwif)
+static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
 {
 	hwif->autodma = 0;
 
@@ -457,12 +457,12 @@ static void __init init_hwif_pdc202new (ide_hwif_t *hwif)
 #endif /* PDC202_DEBUG_CABLE */
 }
 
-static void __init init_setup_pdcnew (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_pdcnew(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_pdc20270(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	struct pci_dev *findev = NULL;
 
@@ -488,7 +488,7 @@ static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_pdc20276 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_pdc20276(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	if ((dev->bus->self) &&
 	    (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) &&
@@ -514,8 +514,6 @@ static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_de
 {
 	ide_pci_device_t *d = &pdcnew_chipsets[id->driver_data];
 
-	if (dev->device != d->device)
-		BUG();
 	d->init_setup(dev, d);
 	return 0;
 }
diff --git a/drivers/ide/pci/pdc202xx_new.h b/drivers/ide/pci/pdc202xx_new.h
index e33c0d0e0..0abec0ed7 100644
--- a/drivers/ide/pci/pdc202xx_new.h
+++ b/drivers/ide/pci/pdc202xx_new.h
@@ -53,109 +53,67 @@ static void init_hwif_pdc202new(ide_hwif_t *);
 
 static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20268,
 		.name		= "PDC20268",
 		.init_setup	= init_setup_pdcnew,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20269,
 		.name		= "PDC20269",
 		.init_setup	= init_setup_pdcnew,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20270,
 		.name		= "PDC20270",
 		.init_setup	= init_setup_pdc20270,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 3 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20271,
 		.name		= "PDC20271",
 		.init_setup	= init_setup_pdcnew,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 4 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20275,
 		.name		= "PDC20275",
 		.init_setup	= init_setup_pdcnew,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 5 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20276,
 		.name		= "PDC20276",
 		.init_setup	= init_setup_pdc20276,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
 	},{	/* 6 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20277,
 		.name		= "PDC20277",
 		.init_setup	= init_setup_pdcnew,
 		.init_chipset	= init_chipset_pdcnew,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202new,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= OFF_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index aa04a13c1..cf6082ad7 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -670,7 +670,7 @@ static int pdc202xx_tristate (ide_drive_t * drive, int state)
 	return 0;
 }
 
-static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, const char *name)
 {
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
@@ -715,7 +715,7 @@ static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const cha
 	return dev->irq;
 }
 
-static void __init init_hwif_pdc202xx (ide_hwif_t *hwif)
+static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
 {
 	hwif->autodma = 0;
 	hwif->tuneproc  = &config_chipset_for_pio;
@@ -755,7 +755,7 @@ static void __init init_hwif_pdc202xx (ide_hwif_t *hwif)
 #endif /* PDC202_DEBUG_CABLE */	
 }
 
-static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase)
+static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
 {
 	u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0;
 
@@ -807,7 +807,7 @@ static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase)
 	ide_setup_dma(hwif, dmabase, 8);
 }
 
-static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
 		u8 irq = 0, irq2 = 0;
@@ -837,7 +837,7 @@ static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_pdc20265(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	if ((dev->bus->self) &&
 	    (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) &&
@@ -866,7 +866,7 @@ static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d
 	ide_setup_pci_device(dev, d);
 }
 
-static void __init init_setup_pdc202xx (struct pci_dev *dev, ide_pci_device_t *d)
+static void __devinit init_setup_pdc202xx(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	ide_setup_pci_device(dev, d);
 }
@@ -884,8 +884,6 @@ static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_dev
 {
 	ide_pci_device_t *d = &pdc202xx_chipsets[id->driver_data];
 
-	if (dev->device != d->device)
-		BUG();
 	d->init_setup(dev, d);
 	return 0;
 }
diff --git a/drivers/ide/pci/pdc202xx_old.h b/drivers/ide/pci/pdc202xx_old.h
index 82b773bf4..95ea2c8aa 100644
--- a/drivers/ide/pci/pdc202xx_old.h
+++ b/drivers/ide/pci/pdc202xx_old.h
@@ -180,62 +180,46 @@ static void init_dma_pdc202xx(ide_hwif_t *, unsigned long);
 
 static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20246,
 		.name		= "PDC20246",
 		.init_setup	= init_setup_pdc202ata4,
 		.init_chipset	= init_chipset_pdc202xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202xx,
 		.init_dma	= init_dma_pdc202xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
 		.extra		= 16,
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20262,
 		.name		= "PDC20262",
 		.init_setup	= init_setup_pdc202ata4,
 		.init_chipset	= init_chipset_pdc202xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202xx,
 		.init_dma	= init_dma_pdc202xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
 		.extra		= 48,
+		.flags		= IDEPCI_FLAG_FORCE_PDC,
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20263,
 		.name		= "PDC20263",
 		.init_setup	= init_setup_pdc202ata4,
 		.init_chipset	= init_chipset_pdc202xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202xx,
 		.init_dma	= init_dma_pdc202xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
 		.extra		= 48,
 	},{	/* 3 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20265,
 		.name		= "PDC20265",
 		.init_setup	= init_setup_pdc20265,
 		.init_chipset	= init_chipset_pdc202xx,
@@ -243,36 +227,25 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
 		.init_dma	= init_dma_pdc202xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
 		.extra		= 48,
+		.flags		= IDEPCI_FLAG_FORCE_PDC,
 	},{	/* 4 */
-		.vendor		= PCI_VENDOR_ID_PROMISE,
-		.device		= PCI_DEVICE_ID_PROMISE_20267,
 		.name		= "PDC20267",
 		.init_setup	= init_setup_pdc202xx,
 		.init_chipset	= init_chipset_pdc202xx,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_pdc202xx,
 		.init_dma	= init_dma_pdc202xx,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-#ifdef CONFIG_PDC202XX_FORCE
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
-#else /* !CONFIG_PDC202XX_FORCE */
+#ifndef CONFIG_PDC202XX_FORCE
 		.enablebits	= {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
 #endif
 		.bootable	= OFF_BOARD,
 		.extra		= 48,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 1126ed907..fec700bba 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -49,9 +49,9 @@
  * pci_read_config_word(HWIF(drive)->pci_dev, 0x40, &reg40);
  * pci_read_config_word(HWIF(drive)->pci_dev, 0x42, &reg42);
  * pci_read_config_word(HWIF(drive)->pci_dev, 0x44, &reg44);
- * pci_read_config_word(HWIF(drive)->pci_dev, 0x48, &reg48);
+ * pci_read_config_byte(HWIF(drive)->pci_dev, 0x48, &reg48);
  * pci_read_config_word(HWIF(drive)->pci_dev, 0x4a, &reg4a);
- * pci_read_config_word(HWIF(drive)->pci_dev, 0x54, &reg54);
+ * pci_read_config_byte(HWIF(drive)->pci_dev, 0x54, &reg54);
  *
  * Documentation
  *	Publically available from Intel web site. Errata documentation
@@ -153,7 +153,7 @@ static int piix_get_info (char *buffer, char **addr, off_t offset, int count)
 			case PCI_DEVICE_ID_INTEL_82801EB_11:
 			case PCI_DEVICE_ID_INTEL_82801E_11:
 			case PCI_DEVICE_ID_INTEL_ESB_2:
-			case PCI_DEVICE_ID_INTEL_ICH6_2:
+			case PCI_DEVICE_ID_INTEL_ICH6_19:
 				p += sprintf(p, "PIIX4 Ultra 100 ");
 				break;
 			case PCI_DEVICE_ID_INTEL_82372FB_1:
@@ -292,7 +292,7 @@ static u8 piix_ratemask (ide_drive_t *drive)
 		case PCI_DEVICE_ID_INTEL_82801DB_11:
 		case PCI_DEVICE_ID_INTEL_82801EB_11:
 		case PCI_DEVICE_ID_INTEL_ESB_2:
-		case PCI_DEVICE_ID_INTEL_ICH6_2:
+		case PCI_DEVICE_ID_INTEL_ICH6_19:
 			mode = 3;
 			break;
 		/* UDMA 66 capable */
@@ -432,15 +432,14 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 	int w_flag		= 0x10 << drive->dn;
 	int u_speed		= 0;
 	int			sitre;
-	u16			reg4042, reg44, reg48, reg4a, reg54;
-	u8			reg55;
+	u16			reg4042, reg4a;
+	u8			reg48, reg54, reg55;
 
 	pci_read_config_word(dev, maslave, &reg4042);
 	sitre = (reg4042 & 0x4000) ? 1 : 0;
-	pci_read_config_word(dev, 0x44, &reg44);
-	pci_read_config_word(dev, 0x48, &reg48);
+	pci_read_config_byte(dev, 0x48, &reg48);
 	pci_read_config_word(dev, 0x4a, &reg4a);
-	pci_read_config_word(dev, 0x54, &reg54);
+	pci_read_config_byte(dev, 0x54, &reg54);
 	pci_read_config_byte(dev, 0x55, &reg55);
 
 	switch(speed) {
@@ -462,30 +461,26 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 
 	if (speed >= XFER_UDMA_0) {
 		if (!(reg48 & u_flag))
-			pci_write_config_word(dev, 0x48, reg48|u_flag);
+			pci_write_config_byte(dev, 0x48, reg48 | u_flag);
 		if (speed == XFER_UDMA_5) {
 			pci_write_config_byte(dev, 0x55, (u8) reg55|w_flag);
 		} else {
 			pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
 		}
-		if (!(reg4a & u_speed)) {
-			pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
-			pci_write_config_word(dev, 0x4a, reg4a|u_speed);
-		}
+		if ((reg4a & a_speed) != u_speed)
+			pci_write_config_word(dev, 0x4a, (reg4a & ~a_speed) | u_speed);
 		if (speed > XFER_UDMA_2) {
-			if (!(reg54 & v_flag)) {
-				pci_write_config_word(dev, 0x54, reg54|v_flag);
-			}
-		} else {
-			pci_write_config_word(dev, 0x54, reg54 & ~v_flag);
-		}
+			if (!(reg54 & v_flag))
+				pci_write_config_byte(dev, 0x54, reg54 | v_flag);
+		} else
+			pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
 	} else {
 		if (reg48 & u_flag)
-			pci_write_config_word(dev, 0x48, reg48 & ~u_flag);
+			pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
 		if (reg4a & a_speed)
 			pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
 		if (reg54 & v_flag)
-			pci_write_config_word(dev, 0x54, reg54 & ~v_flag);
+			pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
 		if (reg55 & w_flag)
 			pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
 	}
@@ -627,7 +622,7 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char
 		case PCI_DEVICE_ID_INTEL_82801EB_11:
 		case PCI_DEVICE_ID_INTEL_82801E_11:
 		case PCI_DEVICE_ID_INTEL_ESB_2:
-		case PCI_DEVICE_ID_INTEL_ICH6_2:
+		case PCI_DEVICE_ID_INTEL_ICH6_19:
 		{
 			unsigned int extra = 0;
 			pci_read_config_dword(dev, 0x54, &extra);
@@ -655,8 +650,8 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char
  *	Set up the ide_hwif_t for the PIIX interface according to the
  *	capabilities of the hardware.
  */
- 
-static void __init init_hwif_piix (ide_hwif_t *hwif)
+
+static void __devinit init_hwif_piix(ide_hwif_t *hwif)
 {
 	u8 reg54h = 0, reg55h = 0, ata66 = 0;
 	u8 mask = hwif->channel ? 0xc0 : 0x30;
@@ -725,8 +720,8 @@ static void __init init_hwif_piix (ide_hwif_t *hwif)
  *	Enable the xp fixup for the PIIX controller and then perform
  *	a standard ide PCI setup
  */
- 
-static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d)
+
+static void __devinit init_setup_piix(struct pci_dev *dev, ide_pci_device_t *d)
 {
 	ide_setup_pci_device(dev, d);
 }
@@ -744,8 +739,6 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_
 {
 	ide_pci_device_t *d = &piix_pci_info[id->driver_data];
 
-	if (dev->device != d->device)
-		BUG();
 	d->init_setup(dev, d);
 	return 0;
 }
@@ -756,8 +749,8 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_
  *	Check for the present of 450NX errata #19 and errata #25. If
  *	they are found, disable use of DMA IDE
  */
- 
-static void __init piix_check_450nx(void)
+
+static void __devinit piix_check_450nx(void)
 {
 	struct pci_dev *pdev = NULL;
 	u16 cfg;
@@ -804,7 +797,7 @@ static struct pci_device_id piix_pci_tbl[] = {
  	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
 #endif /* !CONFIG_SCSI_SATA */
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
-	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20},
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_19, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
diff --git a/drivers/ide/pci/piix.h b/drivers/ide/pci/piix.h
index bdf164a31..f71db14ae 100644
--- a/drivers/ide/pci/piix.h
+++ b/drivers/ide/pci/piix.h
@@ -13,20 +13,16 @@ static void init_setup_piix(struct pci_dev *, ide_pci_device_t *);
 static unsigned int __devinit init_chipset_piix(struct pci_dev *, const char *);
 static void init_hwif_piix(ide_hwif_t *);
 
-#define DECLARE_PIIX_DEV(pci_id, name_str) \
+#define DECLARE_PIIX_DEV(name_str) \
 	{						\
-		.vendor		= PCI_VENDOR_ID_INTEL,	\
-		.device		= pci_id,		\
 		.name		= name_str,		\
 		.init_setup	= init_setup_piix,	\
 		.init_chipset	= init_chipset_piix,	\
-		.init_iops	= NULL,			\
 		.init_hwif	= init_hwif_piix,	\
 		.channels	= 2,			\
 		.autodma	= AUTODMA,		\
 		.enablebits	= {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
 		.bootable	= ON_BOARD,		\
-		.extra		= 0,			\
 	}
 
 /*
@@ -35,49 +31,37 @@ static void init_hwif_piix(ide_hwif_t *);
  */
  
 static ide_pci_device_t piix_pci_info[] __devinitdata = {
-	/* 0  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82371FB_0,  "PIIXa"),
-	/* 1  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82371FB_1,  "PIIXb"),
+	/*  0 */ DECLARE_PIIX_DEV("PIIXa"),
+	/*  1 */ DECLARE_PIIX_DEV("PIIXb"),
 
 	{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_INTEL,
-		.device		= PCI_DEVICE_ID_INTEL_82371MX,
 		.name		= "MPIIX",
 		.init_setup	= init_setup_piix,
-		.init_chipset	= NULL,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_piix,
 		.channels	= 2,
 		.autodma	= NODMA,
 		.enablebits	= {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},
 
-	/* 3  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82371SB_1,  "PIIX3"),
-	/* 4  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82371AB,    "PIIX4"),
-	/* 5  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801AB_1,  "ICH0"),
-	/* 6  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82443MX_1,  "PIIX4"),
-	/* 7  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801AA_1,  "ICH"),
-	/* 8  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82372FB_1,  "PIIX4"),
-	/* 9  */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82451NX,    "PIIX4"),
-	/* 10 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801BA_9,  "ICH2"),
-	/* 11 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801BA_8,  "ICH2M"),
-	/* 12 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801CA_10, "ICH3M"),
-	/* 13 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801CA_11, "ICH3"),
-	/* 14 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801DB_11, "ICH4"),
-	/* 15 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801EB_11, "ICH5"),
-	/* 16 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801E_11,  "C-ICH"),
-	/* 17 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801DB_10, "ICH4"),
-	/* 18 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_82801EB_1,  "ICH5-SATA"),
-	/* 19 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_ESB_2,      "ICH5"),
-	/* 20 */ DECLARE_PIIX_DEV(PCI_DEVICE_ID_INTEL_ICH6_2,     "ICH6"),
-	{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.init_setup	= NULL,
-		.bootable	= EOL,
-	}
+	/*  3 */ DECLARE_PIIX_DEV("PIIX3"),
+	/*  4 */ DECLARE_PIIX_DEV("PIIX4"),
+	/*  5 */ DECLARE_PIIX_DEV("ICH0"),
+	/*  6 */ DECLARE_PIIX_DEV("PIIX4"),
+	/*  7 */ DECLARE_PIIX_DEV("ICH"),
+	/*  8 */ DECLARE_PIIX_DEV("PIIX4"),
+	/*  9 */ DECLARE_PIIX_DEV("PIIX4"),
+	/* 10 */ DECLARE_PIIX_DEV("ICH2"),
+	/* 11 */ DECLARE_PIIX_DEV("ICH2M"),
+	/* 12 */ DECLARE_PIIX_DEV("ICH3M"),
+	/* 13 */ DECLARE_PIIX_DEV("ICH3"),
+	/* 14 */ DECLARE_PIIX_DEV("ICH4"),
+	/* 15 */ DECLARE_PIIX_DEV("ICH5"),
+	/* 16 */ DECLARE_PIIX_DEV("C-ICH"),
+	/* 17 */ DECLARE_PIIX_DEV("ICH4"),
+	/* 18 */ DECLARE_PIIX_DEV("ICH5-SATA"),
+	/* 19 */ DECLARE_PIIX_DEV("ICH5"),
+	/* 20 */ DECLARE_PIIX_DEV("ICH6")
 };
 
 #endif /* PIIX_H */
diff --git a/drivers/ide/pci/rz1000.c b/drivers/ide/pci/rz1000.c
index 963b8458b..3405e6a1b 100644
--- a/drivers/ide/pci/rz1000.c
+++ b/drivers/ide/pci/rz1000.c
@@ -33,8 +33,6 @@
 
 #include <asm/io.h>
 
-#include "rz1000.h"
-
 static void __init init_hwif_rz1000 (ide_hwif_t *hwif)
 {
 	u16 reg;
@@ -54,18 +52,23 @@ static void __init init_hwif_rz1000 (ide_hwif_t *hwif)
 	}
 }
 
+static ide_pci_device_t rz1000_chipset __devinitdata = {
+	.name		= "RZ100x",
+	.init_hwif	= init_hwif_rz1000,
+	.channels	= 2,
+	.autodma	= NODMA,
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &rz1000_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &rz1000_chipset);
 	return 0;
 }
 
 static struct pci_device_id rz1000_pci_tbl[] = {
 	{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+	{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, rz1000_pci_tbl);
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 29a263add..902408d18 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -29,8 +29,6 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include "sc1200.h"
-
 #define SC1200_REV_A	0x00
 #define SC1200_REV_B1	0x01
 #define SC1200_REV_B3	0x02
@@ -545,12 +543,18 @@ static void __init init_hwif_sc1200 (ide_hwif_t *hwif)
         hwif->drives[1].autodma = hwif->autodma;
 }
 
+static ide_pci_device_t sc1200_chipset __devinitdata = {
+	.name		= "SC1200",
+	.init_chipset	= init_chipset_sc1200,
+	.init_hwif	= init_hwif_sc1200,
+	.channels	= 2,
+	.autodma	= AUTODMA,
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &sc1200_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &sc1200_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 3418232fc..27d907c9b 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -777,8 +777,8 @@ static void __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
 		d->autodma = AUTODMA;
 #endif
 
-	d->channels = (((d->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
-			(d->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) &&
+	d->channels = ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE ||
+			dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) &&
 		       (!(PCI_FUNC(dev->devfn) & 1))) ? 1 : 2;
 
 	ide_setup_pci_device(dev, d);
@@ -798,8 +798,6 @@ static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device
 {
 	ide_pci_device_t *d = &serverworks_chipsets[id->driver_data];
 
-	if (dev->device != d->device)
-		BUG();
 	d->init_setup(dev, d);
 	return 0;
 }
diff --git a/drivers/ide/pci/serverworks.h b/drivers/ide/pci/serverworks.h
index eba6e0bbb..aa8bd8b9d 100644
--- a/drivers/ide/pci/serverworks.h
+++ b/drivers/ide/pci/serverworks.h
@@ -31,66 +31,40 @@ static void init_dma_svwks(ide_hwif_t *, unsigned long);
 
 static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
 	{	/* 0 */
-		.vendor		= PCI_VENDOR_ID_SERVERWORKS,
-		.device		= PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
 		.name		= "SvrWks OSB4",
 		.init_setup	= init_setup_svwks,
 		.init_chipset	= init_chipset_svwks,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_svwks,
-		.init_dma	= NULL,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 1 */
-		.vendor		= PCI_VENDOR_ID_SERVERWORKS,
-		.device		= PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
 		.name		= "SvrWks CSB5",
 		.init_setup	= init_setup_svwks,
 		.init_chipset	= init_chipset_svwks,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_svwks,
 		.init_dma	= init_dma_svwks,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 2 */
-		.vendor		= PCI_VENDOR_ID_SERVERWORKS,
-		.device		= PCI_DEVICE_ID_SERVERWORKS_CSB6IDE,
 		.name		= "SvrWks CSB6",
 		.init_setup	= init_setup_csb6,
 		.init_chipset	= init_chipset_svwks,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_svwks,
 		.init_dma	= init_dma_svwks,
 		.channels	= 2,
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
 	},{	/* 3 */
-		.vendor		= PCI_VENDOR_ID_SERVERWORKS,
-		.device		= PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2,
 		.name		= "SvrWks CSB6",
 		.init_setup	= init_setup_csb6,
 		.init_chipset	= init_chipset_svwks,
-		.init_iops	= NULL,
 		.init_hwif	= init_hwif_svwks,
 		.init_dma	= init_dma_svwks,
 		.channels	= 1,	/* 2 */
 		.autodma	= AUTODMA,
-		.enablebits	= {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
 		.bootable	= ON_BOARD,
-		.extra		= 0,
-	},{
-		.vendor		= 0,
-		.device		= 0,
-		.channels	= 0,
-		.bootable	= EOL,
 	}
 };
 
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index d8e739f1c..0187aafac 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -757,8 +757,6 @@ pci_init_sgiioc4(struct pci_dev *dev, ide_pci_device_t * d)
 static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
 	{
 	 /* Channel 0 */
-	 .vendor = PCI_VENDOR_ID_SGI,
-	 .device = PCI_DEVICE_ID_SGI_IOC4,
 	 .name = "SGIIOC4",
 	 .init_hwif = ide_init_sgiioc4,
 	 .init_dma = ide_dma_sgiioc4,
@@ -772,16 +770,7 @@ static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
 static int __devinit
 sgiioc4_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &sgiioc4_chipsets[id->driver_data];
-	if (dev->device != d->device) {
-		printk(KERN_ERR "Error in %s(dev 0x%p | id 0x%p )\n",
-		       __FUNCTION__, (void *) dev, (void *) id);
-		BUG();
-	}
-
-	if (pci_init_sgiioc4(dev, d))
-		return 0;
-
+	pci_init_sgiioc4(dev, &sgiioc4_chipsets[id->driver_data]);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index ff530bf14..5a7483ef6 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -21,7 +21,6 @@
  *	if neccessary
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -32,16 +31,8 @@
 
 #include <asm/io.h>
 
-#include "siimage.h"
-
-#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS)
-#include <linux/proc_fs.h>
-
-static u8 siimage_proc = 0;
-#define SIIMAGE_MAX_DEVS		16
-static struct pci_dev *siimage_devs[SIIMAGE_MAX_DEVS];
-static int n_siimage_devs;
-#endif /* defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) */
+#undef SIIMAGE_VIRTUAL_DMAPIO
+#undef SIIMAGE_LARGE_DMA
 
 /**
  *	pdev_is_sata		-	check if device is SATA
@@ -121,67 +112,6 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
 	return base;
 }
 
-#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS)
-/**
- *	print_siimage_get_info	-	print minimal proc information
- *	@buf: buffer to write into (kernel space)
- *	@dev: PCI device we are describing
- *	@index: Controller number
- *
- *	Print the basic information for the state of the CMD680/SI3112
- *	channel. We don't actually dump a lot of information out for
- *	this controller although we could expand it if we needed.
- */
- 
-static char *print_siimage_get_info (char *buf, struct pci_dev *dev, int index)
-{
-	char *p		= buf;
-	u8 mmio		= (pci_get_drvdata(dev) != NULL) ? 1 : 0;
-	unsigned long bmdma = pci_resource_start(dev, 4);
-	
-	if(mmio)
-		bmdma = pci_resource_start(dev, 5);
-
-	p += sprintf(p, "\nController: %d\n", index);
-	p += sprintf(p, "SiI%x Chipset.\n", dev->device);
-	if (mmio)
-		p += sprintf(p, "MMIO Base 0x%lx\n", bmdma);
-	p += sprintf(p, "%s-DMA Base 0x%lx\n", (mmio)?"MMIO":"BM", bmdma);
-	p += sprintf(p, "%s-DMA Base 0x%lx\n", (mmio)?"MMIO":"BM", bmdma+8);
-	return (char *)p;
-}
-
-/**
- *	siimage_get_info	-	proc callback
- *	@buffer: kernel buffer to complete
- *	@addr: written with base of data to return
- *	offset: seek offset
- *	count: bytes to fill in 
- *
- *	Called when the user reads data from the virtual file for this
- *	controller from /proc
- */
- 
-static int siimage_get_info (char *buffer, char **addr, off_t offset, int count)
-{
-	char *p = buffer;
-	int len;
-	u16 i;
-
-	p += sprintf(p, "\n");
-	for (i = 0; i < n_siimage_devs; i++) {
-		struct pci_dev *dev	= siimage_devs[i];
-		p = print_siimage_get_info(p, dev, i);
-	}
-	/* p - buffer must be less than 4k! */
-	len = (p - buffer) - offset;
-	*addr = buffer + offset;
-	
-	return len > count ? count : len;
-}
-
-#endif	/* defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) */
-
 /**
  *	siimage_ratemask	-	Compute available modes
  *	@drive: IDE drive
@@ -779,15 +709,6 @@ static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *
 			case 0x00: printk("== 100\n"); break;
 		}
 	}
-
-#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS)
-	siimage_devs[n_siimage_devs++] = dev;
-
-	if (!siimage_proc) {
-		siimage_proc = 1;
-		ide_pci_create_host_proc("siimage", siimage_get_info);
-	}
-#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */
 }
 
 /**
@@ -892,7 +813,7 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
  *	to 133MHz clocking if the system isn't already set up to do it.
  */
 
-static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name)
 {
 	u32 class_rev	= 0;
 	u8 tmpbyte	= 0;
@@ -957,8 +878,8 @@ static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char
  *	The hardware supports buffered taskfiles and also some rather nice
  *	extended PRD tables. Unfortunately right now we don't.
  */
- 
-static void __init init_mmio_iops_siimage (ide_hwif_t *hwif)
+
+static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
 {
 	struct pci_dev *dev	= hwif->pci_dev;
 	void *addr		= pci_get_drvdata(dev);
@@ -1076,8 +997,8 @@ static int is_dev_seagate_sata(ide_drive_t *drive)
  *	look in we get for setting up the hwif so that we
  *	can get the iops right before using them.
  */
- 
-static void __init init_iops_siimage (ide_hwif_t *hwif)
+
+static void __devinit init_iops_siimage(ide_hwif_t *hwif)
 {
 	struct pci_dev *dev	= hwif->pci_dev;
 	u32 class_rev		= 0;
@@ -1103,8 +1024,8 @@ static void __init init_iops_siimage (ide_hwif_t *hwif)
  *	Check for the presence of an ATA66 capable cable on the
  *	interface.
  */
- 
-static unsigned int __init ata66_siimage (ide_hwif_t *hwif)
+
+static unsigned int __devinit ata66_siimage(ide_hwif_t *hwif)
 {
 	unsigned long addr = siimage_selreg(hwif, 0);
 	if (pci_get_drvdata(hwif->pci_dev) == NULL) {
@@ -1124,8 +1045,8 @@ static unsigned int __init ata66_siimage (ide_hwif_t *hwif)
  *	requires several custom handlers so we override the default
  *	ide DMA handlers appropriately
  */
- 
-static void __init init_hwif_siimage (ide_hwif_t *hwif)
+
+static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
 {
 	hwif->autodma = 0;
 	
@@ -1172,6 +1093,23 @@ static void __init init_hwif_siimage (ide_hwif_t *hwif)
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
+#define DECLARE_SII_DEV(name_str)			\
+	{						\
+		.name		= name_str,		\
+		.init_chipset	= init_chipset_siimage,	\
+		.init_iops	= init_iops_siimage,	\
+		.init_hwif	= init_hwif_siimage,	\
+		.channels	= 2,			\
+		.autodma	= AUTODMA,		\
+		.bootable	= ON_BOARD,		\
+	}
+
+static ide_pci_device_t siimage_chipsets[] __devinitdata = {
+	/* 0 */ DECLARE_SII_DEV("SiI680"),
+	/* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA"),
+	/* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA")
+};
+
 /**
  *	siimage_init_one	-	pci layer discovery entry
  *	@dev: PCI device
@@ -1183,10 +1121,7 @@ static void __init init_hwif_siimage (ide_hwif_t *hwif)
  
 static int __devinit siimage_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &siimage_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &siimage_chipsets[id->driver_data]);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 6c56f5670..d06b1fd8c 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -63,7 +63,8 @@
 #include <asm/irq.h>
 
 #include "ide-timing.h"
-#include "sis5513.h"
+
+#define DISPLAY_SIS_TIMINGS
 
 /* registers layout and init values are chipset family dependant */
 
@@ -944,12 +945,19 @@ static void __init init_hwif_sis5513 (ide_hwif_t *hwif)
 	return;
 }
 
+static ide_pci_device_t sis5513_chipset __devinitdata = {
+	.name		= "SIS5513",
+	.init_chipset	= init_chipset_sis5513,
+	.init_hwif	= init_hwif_sis5513,
+	.channels	= 2,
+	.autodma	= NOAUTODMA,
+	.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &sis5513_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &sis5513_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 516f799cb..38bd8077b 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -29,8 +29,6 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 
-#include "sl82c105.h"
-
 #undef DEBUG
 
 #ifdef DEBUG
@@ -481,12 +479,20 @@ static void __init init_hwif_sl82c105(ide_hwif_t *hwif)
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 }
 
+static ide_pci_device_t sl82c105_chipset __devinitdata = {
+	.name		= "W82C105",
+	.init_chipset	= init_chipset_sl82c105,
+	.init_hwif	= init_hwif_sl82c105,
+	.init_dma	= init_dma_sl82c105,
+	.channels	= 2,
+	.autodma	= NOAUTODMA,
+	.enablebits	= {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &sl82c105_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &sl82c105_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 7fa07e13a..1a0183d1b 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -21,7 +21,7 @@
 
 #include <asm/io.h>
 
-#include "slc90e66.h"
+#define DISPLAY_SLC90E66_TIMINGS
 
 #if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS)
 #include <linux/stat.h>
@@ -364,12 +364,19 @@ static void __init init_hwif_slc90e66 (ide_hwif_t *hwif)
 #endif /* !CONFIG_BLK_DEV_IDEDMA */
 }
 
+static ide_pci_device_t slc90e66_chipset __devinitdata = {
+	.name		= "SLC90E66",
+	.init_chipset	= init_chipset_slc90e66,
+	.init_hwif	= init_hwif_slc90e66,
+	.channels	= 2,
+	.autodma	= AUTODMA,
+	.enablebits	= {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &slc90e66_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &slc90e66_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index f7ff2f4d1..52e088e25 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -41,8 +41,6 @@
 #include <linux/ide.h>
 #include <linux/init.h>
 
-#include "triflex.h"
-
 static struct pci_dev *triflex_dev;
 
 #ifdef CONFIG_PROC_FS
@@ -217,19 +215,32 @@ static unsigned int __init init_chipset_triflex(struct pci_dev *dev,
 	return 0;	
 }
 
+static ide_pci_device_t triflex_device __devinitdata = {
+	.name		= "TRIFLEX",
+	.init_chipset	= init_chipset_triflex,
+	.init_hwif	= init_hwif_triflex,
+	.channels	= 2,
+	.autodma	= AUTODMA,
+	.enablebits	= {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit triflex_init_one(struct pci_dev *dev, 
 		const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &triflex_devices[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &triflex_device);
 	triflex_dev = dev;
-	
+
 	return 0;
 }
 
+static struct pci_device_id triflex_pci_tbl[] = {
+	{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ 0, },
+};
+MODULE_DEVICE_TABLE(pci, triflex_pci_tbl);
+
 static struct pci_driver driver = {
 	.name		= "TRIFLEX IDE",
 	.id_table	= triflex_pci_tbl,
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index 8a1f88fac..d482d8310 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -140,8 +140,6 @@
 
 #include <asm/io.h>
 
-#include "trm290.h"
-
 static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma)
 {
 	ide_hwif_t *hwif = HWIF(drive);
@@ -302,7 +300,7 @@ static int trm290_ide_dma_test_irq (ide_drive_t *drive)
 /*
  * Invoked from ide-dma.c at boot time.
  */
-void __init init_hwif_trm290 (ide_hwif_t *hwif)
+void __devinit init_hwif_trm290(ide_hwif_t *hwif)
 {
 	unsigned int cfgbase = 0;
 	unsigned long flags;
@@ -395,12 +393,17 @@ void __init init_hwif_trm290 (ide_hwif_t *hwif)
 #endif
 }
 
+static ide_pci_device_t trm290_chipset __devinitdata = {
+	.name		= "TRM290",
+	.init_hwif	= init_hwif_trm290,
+	.channels	= 2,
+	.autodma	= NOAUTODMA,
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &trm290_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &trm290_chipset);
 	return 0;
 }
 
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 044b6c492..9aa563300 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -37,7 +37,8 @@
 #include <asm/io.h>
 
 #include "ide-timing.h"
-#include "via82cxxx.h"
+
+#define DISPLAY_VIA_TIMINGS
 
 #define VIA_IDE_ENABLE		0x40
 #define VIA_IDE_CONFIG		0x41
@@ -607,18 +608,25 @@ static void __init init_hwif_via82cxxx(ide_hwif_t *hwif)
 	hwif->drives[1].autodma = hwif->autodma;
 }
 
+static ide_pci_device_t via82cxxx_chipset __devinitdata = {
+	.name		= "VP_IDE",
+	.init_chipset	= init_chipset_via82cxxx,
+	.init_hwif	= init_hwif_via82cxxx,
+	.channels	= 2,
+	.autodma	= NOAUTODMA,
+	.enablebits	= {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+	.bootable	= ON_BOARD,
+};
+
 static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	ide_pci_device_t *d = &via82cxxx_chipsets[id->driver_data];
-	if (dev->device != d->device)
-		BUG();
-	ide_setup_pci_device(dev, d);
+	ide_setup_pci_device(dev, &via82cxxx_chipset);
 	return 0;
 }
 
 static struct pci_device_id via_pci_tbl[] = {
 	{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+	{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, via_pci_tbl);
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 62484715f..b485e6b70 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -285,14 +285,8 @@ second_chance_to_dma:
 
 void ide_setup_pci_noise (struct pci_dev *dev, ide_pci_device_t *d)
 {
-	if ((d->vendor != dev->vendor) && (d->device != dev->device)) {
-		printk(KERN_INFO "%s: unknown IDE controller at PCI slot "
-			"%s, VID=%04x, DID=%04x\n",
-			d->name, pci_name(dev), dev->vendor, dev->device);
-        } else {
-		printk(KERN_INFO "%s: IDE controller at PCI slot %s\n",
-			d->name, pci_name(dev));
-	}
+	printk(KERN_INFO "%s: IDE controller at PCI slot %s\n",
+			 d->name, pci_name(dev));
 }
 
 EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
@@ -422,8 +416,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
 	unsigned long ctl = 0, base = 0;
 	ide_hwif_t *hwif;
 
-	if(!d->isa_ports)
-	{
+	if ((d->flags & IDEPCI_FLAG_ISA_PORTS) == 0) {
 		/*  Possibly we should fail if these checks report true */
 		ide_pci_check_iomem(dev, d, 2*port);
 		ide_pci_check_iomem(dev, d, 2*port+1);
@@ -444,13 +437,12 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
 	}
 	if ((hwif = ide_match_hwif(base, d->bootable, d->name)) == NULL)
 		return NULL;	/* no room in ide_hwifs[] */
-	if (hwif->io_ports[IDE_DATA_OFFSET] != base) {
-fixup_address:
+	if (hwif->io_ports[IDE_DATA_OFFSET] != base ||
+	    hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) {
+		memset(&hwif->hw, 0, sizeof(hwif->hw));
 		ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL);
 		memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
 		hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
-	} else if (hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) {
-		goto fixup_address;
 	}
 	hwif->chipset = ide_pci;
 	hwif->pci_dev = dev;
@@ -496,9 +488,7 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
  			 * Set up BM-DMA capability
 			 * (PnP BIOS should have done this)
  			 */
-			if (!((d->device == PCI_DEVICE_ID_CYRIX_5530_IDE && d->vendor == PCI_VENDOR_ID_CYRIX)
-			    ||(d->device == PCI_DEVICE_ID_NS_SCx200_IDE && d->vendor == PCI_VENDOR_ID_NS)))
-			{
+			if ((d->flags & IDEPCI_FLAG_FORCE_MASTER) == 0) {
 				/*
 				 * default DMA off if we had to
 				 * configure it here
@@ -614,9 +604,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int autodma,
 		 * by the bios for raid purposes. 
 		 * Skip the normal "is it enabled" test for those.
 		 */
-		if (((d->vendor == PCI_VENDOR_ID_PROMISE) &&
-		     ((d->device == PCI_DEVICE_ID_PROMISE_20262) ||
-		      (d->device == PCI_DEVICE_ID_PROMISE_20265))) &&
+		if ((d->flags & IDEPCI_FLAG_FORCE_PDC) &&
 		    (secondpdc++==1) && (port==1))
 			goto controller_ok;
 			
diff --git a/drivers/ieee1394/csr.c b/drivers/ieee1394/csr.c
index 219fde126..6bfc74d87 100644
--- a/drivers/ieee1394/csr.c
+++ b/drivers/ieee1394/csr.c
@@ -251,8 +251,6 @@ static void add_host(struct hpsb_host *host)
 
 	csr1212_init_local_csr(host->csr.rom, bus_info, host->csr.max_rom);
 
-	host->csr.rom->max_rom = host->csr.max_rom;
-
 	root = host->csr.rom->root_kv;
 
 	if(csr1212_attach_keyval_to_directory(root, node_cap) != CSR1212_SUCCESS) {
diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c
index ce47add9d..931464b6c 100644
--- a/drivers/ieee1394/csr1212.c
+++ b/drivers/ieee1394/csr1212.c
@@ -206,7 +206,9 @@ struct csr1212_csr *csr1212_create_csr(struct csr1212_bus_ops *ops,
 void csr1212_init_local_csr(struct csr1212_csr *csr,
 			    const u_int32_t *bus_info_data, int max_rom)
 {
-	csr->max_rom = max_rom;
+	static const int mr_map[] = { 4, 64, 1024, 0 };
+
+	csr->max_rom = mr_map[max_rom];
 	memcpy(csr->bus_info_data, bus_info_data, csr->bus_info_len);
 }
 
@@ -1059,6 +1061,10 @@ void csr1212_fill_cache(struct csr1212_csr_rom_cache *cache)
 		}
 
 		nkv = kv->next;
+		if (kv->prev)
+			kv->prev->next = NULL;
+		if (kv->next)
+			kv->next->prev = NULL;
 		kv->prev = NULL;
 		kv->next = NULL;
 	}
@@ -1132,7 +1138,7 @@ int csr1212_generate_csr_image(struct csr1212_csr *csr)
 			/* Make sure the Extended ROM leaf is a multiple of
 			 * max_rom in size. */
 			leaf_size = (cache->len + (csr->max_rom - 1)) &
-				(csr->max_rom - 1);
+				~(csr->max_rom - 1);
 
 			/* Zero out the unused ROM region */
 			memset(cache->data + bytes_to_quads(cache->len), 0x00,
diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h
index e7f1d30c6..e6734263a 100644
--- a/drivers/ieee1394/csr1212.h
+++ b/drivers/ieee1394/csr1212.h
@@ -38,9 +38,11 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
+#include <linux/vmalloc.h>
+#include <asm/pgalloc.h>
 
-#define CSR1212_MALLOC(size)		kmalloc((size), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL)
-#define CSR1212_FREE(ptr)		kfree(ptr)
+#define CSR1212_MALLOC(size)		vmalloc((size))
+#define CSR1212_FREE(ptr)		vfree(ptr)
 #define CSR1212_BE16_TO_CPU(quad)	be16_to_cpu(quad)
 #define CSR1212_CPU_TO_BE16(quad)	cpu_to_be16(quad)
 #define CSR1212_BE32_TO_CPU(quad)	be32_to_cpu(quad)
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index d99ac5dda..48a7c5049 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -89,7 +89,7 @@
 #define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__)
 
 static char version[] __devinitdata =
-	"$Rev: 1198 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 1224 $ Ben Collins <bcollins@debian.org>";
 
 struct fragment_info {
 	struct list_head list;
@@ -191,7 +191,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev);
 static void ether1394_iso(struct hpsb_iso *iso);
 
 static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr);
+static int ether1394_ethtool_ioctl(struct net_device *dev, void __user *useraddr);
 
 static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
 			   quadlet_t *data, u64 addr, size_t len, u16 flags);
@@ -1770,7 +1770,7 @@ static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd
 {
 	switch(cmd) {
 		case SIOCETHTOOL:
-			return ether1394_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+			return ether1394_ethtool_ioctl(dev, ifr->ifr_data);
 
 		case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
 		case SIOCGMIIREG:		/* Read MII PHY register. */
@@ -1782,18 +1782,18 @@ static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd
 	return 0;
 }
 
-static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int ether1394_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	u32 ethcmd;
 
-	if (get_user(ethcmd, (u32 *)useraddr))
+	if (get_user(ethcmd, (u32 __user *)useraddr))
 		return -EFAULT;
 
 	switch (ethcmd) {
 		case ETHTOOL_GDRVINFO: {
 			struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
 			strcpy (info.driver, driver_name);
-			strcpy (info.version, "$Rev: 1198 $");
+			strcpy (info.version, "$Rev: 1224 $");
 			/* FIXME XXX provide sane businfo */
 			strcpy (info.bus_info, "ieee1394");
 			if (copy_to_user (useraddr, &info, sizeof (info)))
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
index 67fc9f7b6..50c403c6c 100644
--- a/drivers/ieee1394/highlevel.c
+++ b/drivers/ieee1394/highlevel.c
@@ -383,7 +383,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
 		a2sa = a2->start & align_mask;
 		a2ea = (a2->end + alignment -1) & align_mask;
 
-		if ((a2sa - a1ea >= size) && (a2sa - start >= size) && (end - a1ea >= size)) {
+		if ((a2sa - a1ea >= size) && (a2sa - start >= size) && (a2sa > start)) {
 			as->start = max(start, a1ea);
 			as->end = as->start + size;
 			list_add(&as->host_list, entry);
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c
index b205d80cd..c502c6e9c 100644
--- a/drivers/ieee1394/hosts.c
+++ b/drivers/ieee1394/hosts.c
@@ -30,7 +30,7 @@
 #include "config_roms.h"
 
 
-static void delayed_reset_bus(unsigned long __reset_info)
+static void delayed_reset_bus(void * __reset_info)
 {
 	struct hpsb_host *host = (struct hpsb_host*)__reset_info;
 	int generation = host->csr.generation + 1;
@@ -129,9 +129,6 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
 	skb_queue_head_init(&h->pending_packet_queue);
 	INIT_LIST_HEAD(&h->addr_space);
 
-	init_timer(&h->delayed_reset);
-	h->delayed_reset.function = delayed_reset_bus;
-	h->delayed_reset.data = (unsigned long)h;
 	for (i = 2; i < 16; i++)
 		h->csr.gen_timestamp[i] = jiffies - 60 * HZ;
 
@@ -140,6 +137,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
 
 	atomic_set(&h->generation, 0);
 
+	INIT_WORK(&h->delayed_reset, delayed_reset_bus, h);
+	
 	init_timer(&h->timeout);
 	h->timeout.data = (unsigned long) h;
 	h->timeout.function = abort_timedouts;
@@ -187,6 +186,10 @@ int hpsb_add_host(struct hpsb_host *host)
 void hpsb_remove_host(struct hpsb_host *host)
 {
         host->is_shutdown = 1;
+
+	cancel_delayed_work(&host->delayed_reset);
+	flush_scheduled_work();
+
         host->driver = &dummy_driver;
 
         highlevel_remove_host(host);
@@ -199,7 +202,7 @@ void hpsb_remove_host(struct hpsb_host *host)
 
 int hpsb_update_config_rom_image(struct hpsb_host *host)
 {
-	unsigned long reset_time;
+	unsigned long reset_delay;
 	int next_gen = host->csr.generation + 1;
 
 	if (!host->update_config_rom)
@@ -210,21 +213,21 @@ int hpsb_update_config_rom_image(struct hpsb_host *host)
 
 	/* Stop the delayed interrupt, we're about to change the config rom and
 	 * it would be a waste to do a bus reset twice. */
-	del_timer_sync(&host->delayed_reset);
+	cancel_delayed_work(&host->delayed_reset);
 
 	/* IEEE 1394a-2000 prohibits using the same generation number
 	 * twice in a 60 second period. */
 	if (jiffies - host->csr.gen_timestamp[next_gen] < 60 * HZ)
 		/* Wait 60 seconds from the last time this generation number was
 		 * used. */
-		reset_time = (60 * HZ) + host->csr.gen_timestamp[next_gen];
+		reset_delay = (60 * HZ) + host->csr.gen_timestamp[next_gen] - jiffies;
 	else
 		/* Wait 1 second in case some other code wants to change the
 		 * Config ROM in the near future. */
-		reset_time = jiffies + HZ;
+		reset_delay = HZ;
 
-	/* This will add the timer as well as modify it */
-	mod_timer(&host->delayed_reset, reset_time);
+	PREPARE_WORK(&host->delayed_reset, delayed_reset_bus, host);
+	schedule_delayed_work(&host->delayed_reset, reset_delay);
 
 	return 0;
 }
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h
index 000e44cab..739e76840 100644
--- a/drivers/ieee1394/hosts.h
+++ b/drivers/ieee1394/hosts.h
@@ -66,7 +66,7 @@ struct hpsb_host {
 	struct class_device class_dev;
 
 	int update_config_rom;
-	struct timer_list delayed_reset;
+	struct work_struct delayed_reset;
 
 	unsigned int config_roms;
 
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index 65a796e67..9a3c58654 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -32,6 +32,7 @@
 #include <linux/bitops.h>
 #include <linux/kdev_t.h>
 #include <linux/skbuff.h>
+#include <linux/suspend.h>
 
 #include <asm/byteorder.h>
 #include <asm/semaphore.h>
@@ -400,31 +401,35 @@ void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot)
 void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
                       int ackcode)
 {
+	unsigned long flags;
+
+	spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
+
 	packet->ack_code = ackcode;
 
-	if (packet->no_waiter) {
-		/* must not have a tlabel allocated */
+	if (packet->no_waiter || packet->state == hpsb_complete) {
+		/* if packet->no_waiter, must not have a tlabel allocated */
+		spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
 		hpsb_free_packet(packet);
 		return;
 	}
 
+	atomic_dec(&packet->refcnt);	/* drop HC's reference */
+	/* here the packet must be on the host->pending_packet_queue */
+
 	if (ackcode != ACK_PENDING || !packet->expect_response) {
-		atomic_dec(&packet->refcnt);
-		skb_unlink(packet->skb);
 		packet->state = hpsb_complete;
+		__skb_unlink(packet->skb, &host->pending_packet_queue);
+		spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
 		queue_packet_complete(packet);
 		return;
 	}
 
-	if (packet->state == hpsb_complete) {
-		hpsb_free_packet(packet);
-		return;
-	}
-
-	atomic_dec(&packet->refcnt);
 	packet->state = hpsb_pending;
 	packet->sendtime = jiffies;
 
+	spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
+
 	mod_timer(&host->timeout, jiffies + host->timeout_interval);
 }
 
@@ -658,14 +663,13 @@ static void handle_packet_response(struct hpsb_host *host, int tcode,
         }
 
         if (!tcode_match) {
+		spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
                 HPSB_INFO("unsolicited response packet received - tcode mismatch");
                 dump_packet("contents:", data, 16);
-		spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
                 return;
         }
 
 	__skb_unlink(skb, skb->list);
-	spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
 
 	if (packet->state == hpsb_queued) {
 		packet->sendtime = jiffies;
@@ -673,6 +677,8 @@ static void handle_packet_response(struct hpsb_host *host, int tcode,
 	}
 
 	packet->state = hpsb_complete;
+	spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
+
 	queue_packet_complete(packet);
 }
 
@@ -1002,6 +1008,10 @@ static DECLARE_MUTEX_LOCKED(khpsbpkt_sig);
 
 static void queue_packet_complete(struct hpsb_packet *packet)
 {
+	if (packet->no_waiter) {
+		hpsb_free_packet(packet);
+		return;
+	}
 	if (packet->complete_routine != NULL) {
 		skb_queue_tail(&hpsbpkt_queue, packet->skb);
 
@@ -1024,6 +1034,11 @@ static int hpsbpkt_thread(void *__hi)
 		if (khpsbpkt_kill)
 			break;
 
+		if (current->flags & PF_FREEZE) {
+			refrigerator(0);
+			continue;
+		}
+
 		while ((skb = skb_dequeue(&hpsbpkt_queue)) != NULL) {
 			packet = (struct hpsb_packet *)skb->data;
 
@@ -1042,10 +1057,11 @@ static int hpsbpkt_thread(void *__hi)
 
 static int __init ieee1394_init(void)
 {
-	int i;
+	int i, ret;
 
 	skb_queue_head_init(&hpsbpkt_queue);
 
+	/* non-fatal error */
 	if (hpsb_init_config_roms()) {
 		HPSB_ERR("Failed to initialize some config rom entries.\n");
 		HPSB_ERR("Some features may not be available\n");
@@ -1054,32 +1070,85 @@ static int __init ieee1394_init(void)
 	khpsbpkt_pid = kernel_thread(hpsbpkt_thread, NULL, CLONE_KERNEL);
 	if (khpsbpkt_pid < 0) {
 		HPSB_ERR("Failed to start hpsbpkt thread!\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto exit_cleanup_config_roms;
 	}
 
-	devfs_mk_dir("ieee1394");
-
 	if (register_chrdev_region(IEEE1394_CORE_DEV, 256, "ieee1394")) {
 		HPSB_ERR("unable to register character device major %d!\n", IEEE1394_MAJOR);
-		return -ENODEV;
+		ret = -ENODEV;
+		goto exit_release_kernel_thread;
 	}
 
-	devfs_mk_dir("ieee1394");
+	/* actually this is a non-fatal error */
+	ret = devfs_mk_dir("ieee1394");
+	if (ret < 0) {
+		HPSB_ERR("unable to make devfs dir for device major %d!\n", IEEE1394_MAJOR);
+		goto release_chrdev;
+	}
 
-	bus_register(&ieee1394_bus_type);
-	for (i = 0; fw_bus_attrs[i]; i++)
-		bus_create_file(&ieee1394_bus_type, fw_bus_attrs[i]);
-	class_register(&hpsb_host_class);
+	ret = bus_register(&ieee1394_bus_type);
+	if (ret < 0) {
+		HPSB_INFO("bus register failed");
+		goto release_devfs;
+	}
 
-	if (init_csr())
-		return -ENOMEM;
+	for (i = 0; fw_bus_attrs[i]; i++) {
+		ret = bus_create_file(&ieee1394_bus_type, fw_bus_attrs[i]);
+		if (ret < 0) {
+			while (i >= 0) {
+				bus_remove_file(&ieee1394_bus_type,
+						fw_bus_attrs[i--]);
+			}
+			bus_unregister(&ieee1394_bus_type);
+			goto release_devfs;
+		}
+	}
 
-	if (!disable_nodemgr)
-		init_ieee1394_nodemgr();
-	else
+	ret = class_register(&hpsb_host_class);
+	if (ret < 0)
+		goto release_all_bus;
+
+	ret = init_csr();
+	if (ret) {
+		HPSB_INFO("init csr failed");
+		ret = -ENOMEM;
+		goto release_class;
+	}
+
+	if (disable_nodemgr) {
 		HPSB_INFO("nodemgr functionality disabled");
+		return 0;
+	}
+
+	ret = init_ieee1394_nodemgr();
+	if (ret < 0) {
+		HPSB_INFO("init nodemgr failed");
+		goto cleanup_csr;
+	}
 
 	return 0;
+
+cleanup_csr:
+	cleanup_csr();
+release_class:
+	class_unregister(&hpsb_host_class);
+release_all_bus:
+	for (i = 0; fw_bus_attrs[i]; i++)
+		bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
+	bus_unregister(&ieee1394_bus_type);
+release_devfs:
+	devfs_remove("ieee1394");
+release_chrdev:
+	unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
+exit_release_kernel_thread:
+	if (khpsbpkt_pid >= 0) {
+		kill_proc(khpsbpkt_pid, SIGTERM, 1);
+		wait_for_completion(&khpsbpkt_complete);
+	}
+exit_cleanup_config_roms:
+	hpsb_cleanup_config_roms();
+	return ret;
 }
 
 static void __exit ieee1394_cleanup(void)
diff --git a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h
index ec3221980..8e4b62c23 100644
--- a/drivers/ieee1394/ieee1394_core.h
+++ b/drivers/ieee1394/ieee1394_core.h
@@ -101,8 +101,6 @@ void hpsb_free_packet(struct hpsb_packet *packet);
  *
  * Use the functions, not the variable.
  */
-#include <asm/atomic.h>
-
 static inline unsigned int get_hpsb_generation(struct hpsb_host *host)
 {
         return atomic_read(&host->generation);
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 1d22fe847..c912be4b2 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -19,6 +19,7 @@
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/moduleparam.h>
+#include <linux/suspend.h>
 #include <asm/atomic.h>
 
 #include "ieee1394_types.h"
@@ -1474,11 +1475,20 @@ static int nodemgr_host_thread(void *__hi)
 
 	/* Sit and wait for a signal to probe the nodes on the bus. This
 	 * happens when we get a bus reset. */
-	while (!down_interruptible(&hi->reset_sem) &&
-	       !down_interruptible(&nodemgr_serialize)) {
+	while (1) {
 		unsigned int generation = 0;
 		int i;
 
+		if (down_interruptible(&hi->reset_sem) ||
+		    down_interruptible(&nodemgr_serialize)) {
+			if (current->flags & PF_FREEZE) {
+				refrigerator(0);
+				continue;
+			}
+			printk("NodeMgr: received unexpected signal?!\n" );
+			break;
+		}
+
 		if (hi->kill_me)
 			break;
 
@@ -1502,6 +1512,10 @@ static int nodemgr_host_thread(void *__hi)
 			 * start the the waiting over again */
 			while (!down_trylock(&hi->reset_sem))
 				i = 0;
+
+			/* Check the kill_me again */
+			if (hi->kill_me)
+				goto caught_signal;
 		}
 
 		if (!nodemgr_check_irm_capability(host, reset_cycles)) {
@@ -1702,12 +1716,23 @@ static struct hpsb_highlevel nodemgr_highlevel = {
 	.remove_host =	nodemgr_remove_host,
 };
 
-void init_ieee1394_nodemgr(void)
+int init_ieee1394_nodemgr(void)
 {
-	class_register(&nodemgr_ne_class);
-	class_register(&nodemgr_ud_class);
+	int ret;
+
+	ret = class_register(&nodemgr_ne_class);
+	if (ret < 0)
+		return ret;
+
+	ret = class_register(&nodemgr_ud_class);
+	if (ret < 0) {
+		class_unregister(&nodemgr_ne_class);
+		return ret;
+	}
 
 	hpsb_register_highlevel(&nodemgr_highlevel);
+
+	return 0;
 }
 
 void cleanup_ieee1394_nodemgr(void)
diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
index 65e3f0685..f27ea3a25 100644
--- a/drivers/ieee1394/nodemgr.h
+++ b/drivers/ieee1394/nodemgr.h
@@ -192,7 +192,7 @@ int hpsb_node_lock(struct node_entry *ne, u64 addr,
 int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *));
 
 
-void init_ieee1394_nodemgr(void);
+int init_ieee1394_nodemgr(void);
 void cleanup_ieee1394_nodemgr(void);
 
 
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 88438b58b..afcf7f89e 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -162,7 +162,7 @@ printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args)
 printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , ## args)
 
 static char version[] __devinitdata =
-	"$Rev: 1203 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 1223 $ Ben Collins <bcollins@debian.org>";
 
 /* Module Parameters */
 static int phys_dma = 1;
@@ -516,6 +516,12 @@ static void ohci_initialize(struct ti_ohci *ohci)
 	ohci->max_packet_size =
 		1<<(((reg_read(ohci, OHCI1394_BusOptions)>>12)&0xf)+1);
 
+	if (ohci->max_packet_size < 512) {
+		HPSB_ERR("warning: Invalid max packet size of %d, setting to 512",
+			     ohci->max_packet_size);
+		ohci->max_packet_size = 512;
+	}
+		
 	/* Don't accept phy packets into AR request context */
 	reg_write(ohci, OHCI1394_LinkControlClear, 0x00000400);
 
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 17f17e21d..78a4f8ed5 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -78,7 +78,7 @@
 #include "sbp2.h"
 
 static char version[] __devinitdata =
-	"$Rev: 1205 $ Ben Collins <bcollins@debian.org>";
+	"$Rev: 1219 $ Ben Collins <bcollins@debian.org>";
 
 /*
  * Module load parameter definitions
@@ -876,10 +876,10 @@ alloc_fail:
 			SBP2_DMA_FREE("login FIFO DMA");
 		}
 
-		kfree(scsi_id);
-
 		list_del(&scsi_id->scsi_list);
 
+		kfree(scsi_id);
+
 		SBP2_ERR ("Could not allocate memory for scsi_id");
 
 		return -ENOMEM;
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index a9b92c1ed..7a757fc43 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -864,6 +864,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
+		if (d == NULL) return -EFAULT;
 
 		if ((v.buffer<0) || (v.buffer>d->num_desc)) {
 			PRINT(KERN_ERR, ohci->host->id,
@@ -926,6 +927,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
+		if (d == NULL) return -EFAULT;
 
 		if ((v.buffer<0) || (v.buffer>d->num_desc)) {
 			PRINT(KERN_ERR, ohci->host->id,
@@ -1009,6 +1011,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
+		if (d == NULL) return -EFAULT;
 
 		if ((v.buffer<0) || (v.buffer>d->num_desc)) {
 			PRINT(KERN_ERR, ohci->host->id,
@@ -1112,6 +1115,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
+		if (d == NULL) return -EFAULT;
 
 		if ((v.buffer<0) || (v.buffer>d->num_desc)) {
 			PRINT(KERN_ERR, ohci->host->id,
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index 96fb7dc03..94dece474 100644
--- a/drivers/input/Kconfig
+++ b/drivers/input/Kconfig
@@ -41,9 +41,16 @@ config INPUT_MOUSEDEV
 	  module will be called mousedev.
 
 config INPUT_MOUSEDEV_PSAUX
-	bool "Provide legacy /dev/psaux device" if EMBEDDED
+	bool "Provide legacy /dev/psaux device"
 	default y
 	depends on INPUT_MOUSEDEV
+	---help---
+	  Say Y here if you want your mouse also be accessible as char device
+	  10:1 - /dev/psaux. The data available through /dev/psaux is exactly
+	  the same as the data from /dev/input/mice.
+
+	  If unsure, say Y.
+
 
 config INPUT_MOUSEDEV_SCREEN_X
 	int "Horizontal screen resolution"
diff --git a/drivers/input/evbug.c b/drivers/input/evbug.c
index c31f5abcb..7eabb5f4e 100644
--- a/drivers/input/evbug.c
+++ b/drivers/input/evbug.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -35,7 +35,7 @@
 #include <linux/device.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION("Input driver event debug module"); 
+MODULE_DESCRIPTION("Input driver event debug module");
 MODULE_LICENSE("GPL");
 
 static char evbug_name[] = "evbug";
@@ -67,7 +67,7 @@ static struct input_handle *evbug_connect(struct input_handler *handler, struct
 static void evbug_disconnect(struct input_handle *handle)
 {
 	printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n", handle->dev->phys);
-	
+
 	input_close_device(handle);
 
 	kfree(handle);
@@ -79,7 +79,7 @@ static struct input_device_id evbug_ids[] = {
 };
 
 MODULE_DEVICE_TABLE(input, evbug_ids);
-	
+
 static struct input_handler evbug_handler = {
 	.event =	evbug_event,
 	.connect =	evbug_connect,
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 906673ec5..3737e5abc 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -126,7 +126,7 @@ static int evdev_open(struct inode * inode, struct file * file)
 	int i = iminor(inode) - EVDEV_MINOR_BASE;
 	int accept_err;
 
-	if (i >= EVDEV_MINORS || !evdev_table[i])
+	if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist)
 		return -ENODEV;
 
 	if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
@@ -147,7 +147,7 @@ static int evdev_open(struct inode * inode, struct file * file)
 	return 0;
 }
 
-static ssize_t evdev_write(struct file * file, const char * buffer, size_t count, loff_t *ppos)
+static ssize_t evdev_write(struct file * file, const char __user * buffer, size_t count, loff_t *ppos)
 {
 	struct evdev_list *list = file->private_data;
 	struct input_event event;
@@ -166,7 +166,7 @@ static ssize_t evdev_write(struct file * file, const char * buffer, size_t count
 	return retval;
 }
 
-static ssize_t evdev_read(struct file * file, char * buffer, size_t count, loff_t *ppos)
+static ssize_t evdev_read(struct file * file, char __user * buffer, size_t count, loff_t *ppos)
 {
 	struct evdev_list *list = file->private_data;
 	int retval;
@@ -175,7 +175,7 @@ static ssize_t evdev_read(struct file * file, char * buffer, size_t count, loff_
 		return -EAGAIN;
 
 	retval = wait_event_interruptible(list->evdev->wait,
-		list->head != list->tail && list->evdev->exist);
+		list->head != list->tail || (!list->evdev->exist));
 
 	if (retval)
 		return retval;
@@ -209,6 +209,8 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	struct evdev *evdev = list->evdev;
 	struct input_dev *dev = evdev->handle.dev;
 	struct input_absinfo abs;
+	void __user *p = (void __user *)arg;
+	int __user *ip = (int __user *)arg;
 	int i, t, u, v;
 
 	if (!evdev->exist) return -ENODEV;
@@ -216,21 +218,21 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	switch (cmd) {
 
 		case EVIOCGVERSION:
-			return put_user(EV_VERSION, (int *) arg);
+			return put_user(EV_VERSION, ip);
 
 		case EVIOCGID:
-			return copy_to_user((void *) arg, &dev->id, sizeof(struct input_id)) ? -EFAULT : 0;
-		
+			return copy_to_user(p, &dev->id, sizeof(struct input_id)) ? -EFAULT : 0;
+
 		case EVIOCGKEYCODE:
-			if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
+			if (get_user(t, ip)) return -EFAULT;
 			if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
-			if (put_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
+			if (put_user(INPUT_KEYCODE(dev, t), ip + 1)) return -EFAULT;
 			return 0;
 
 		case EVIOCSKEYCODE:
-			if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
+			if (get_user(t, ip)) return -EFAULT;
 			if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
-			if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
+			if (get_user(v, ip + 1)) return -EFAULT;
 			u = SET_INPUT_KEYCODE(dev, t, v);
 			clear_bit(u, dev->keybit);
 			set_bit(v, dev->keybit);
@@ -244,10 +246,10 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				struct ff_effect effect;
 				int err;
 
-				if (copy_from_user((void*)(&effect), (void*)arg, sizeof(effect)))
+				if (copy_from_user(&effect, p, sizeof(effect)))
 					return -EFAULT;
 				err = dev->upload_effect(dev, &effect);
-				if (put_user(effect.id, &(((struct ff_effect*)arg)->id)))
+				if (put_user(effect.id, &(((struct ff_effect __user *)arg)->id)))
 					return -EFAULT;
 				return err;
 			}
@@ -260,7 +262,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			else return -ENOSYS;
 
 		case EVIOCGEFFECTS:
-			if (put_user(dev->ff_effects_max, (int*) arg))
+			if (put_user(dev->ff_effects_max, ip))
 				return -EFAULT;
 			return 0;
 
@@ -303,28 +305,28 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				}
 				len = NBITS(len) * sizeof(long);
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, bits, len) ? -EFAULT : len;
+				return copy_to_user(p, bits, len) ? -EFAULT : len;
 			}
 
 			if (_IOC_NR(cmd) == _IOC_NR(EVIOCGKEY(0))) {
 				int len;
 				len = NBITS(KEY_MAX) * sizeof(long);
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, dev->key, len) ? -EFAULT : len;
+				return copy_to_user(p, dev->key, len) ? -EFAULT : len;
 			}
 
 			if (_IOC_NR(cmd) == _IOC_NR(EVIOCGLED(0))) {
 				int len;
 				len = NBITS(LED_MAX) * sizeof(long);
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, dev->led, len) ? -EFAULT : len;
+				return copy_to_user(p, dev->led, len) ? -EFAULT : len;
 			}
 
 			if (_IOC_NR(cmd) == _IOC_NR(EVIOCGSND(0))) {
 				int len;
 				len = NBITS(SND_MAX) * sizeof(long);
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, dev->snd, len) ? -EFAULT : len;
+				return copy_to_user(p, dev->snd, len) ? -EFAULT : len;
 			}
 
 			if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) {
@@ -332,7 +334,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				if (!dev->name) return -ENOENT;
 				len = strlen(dev->name) + 1;
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, dev->name, len) ? -EFAULT : len;
+				return copy_to_user(p, dev->name, len) ? -EFAULT : len;
 			}
 
 			if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0))) {
@@ -340,7 +342,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				if (!dev->phys) return -ENOENT;
 				len = strlen(dev->phys) + 1;
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, dev->phys, len) ? -EFAULT : len;
+				return copy_to_user(p, dev->phys, len) ? -EFAULT : len;
 			}
 
 			if (_IOC_NR(cmd) == _IOC_NR(EVIOCGUNIQ(0))) {
@@ -348,7 +350,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				if (!dev->uniq) return -ENOENT;
 				len = strlen(dev->uniq) + 1;
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				return copy_to_user((char *) arg, dev->uniq, len) ? -EFAULT : len;
+				return copy_to_user(p, dev->uniq, len) ? -EFAULT : len;
 			}
 
 			if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) {
@@ -361,7 +363,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				abs.fuzz = dev->absfuzz[t];
 				abs.flat = dev->absflat[t];
 
-				if (copy_to_user((void *) arg, &abs, sizeof(struct input_absinfo)))
+				if (copy_to_user(p, &abs, sizeof(struct input_absinfo)))
 					return -EFAULT;
 
 				return 0;
@@ -371,7 +373,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 				int t = _IOC_NR(cmd) & ABS_MAX;
 
-				if (copy_from_user(&abs, (void *) arg, sizeof(struct input_absinfo)))
+				if (copy_from_user(&abs, p, sizeof(struct input_absinfo)))
 					return -EFAULT;
 
 				dev->abs[t] = abs.value;
@@ -428,7 +430,7 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct
 
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor);
-	class_simple_device_add(input_class, 
+	class_simple_device_add(input_class,
 				MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
 				dev->dev, "event%d", minor);
 
diff --git a/drivers/input/gameport/cs461x.c b/drivers/input/gameport/cs461x.c
index 0ec91ea49..71fcad10c 100644
--- a/drivers/input/gameport/cs461x.c
+++ b/drivers/input/gameport/cs461x.c
@@ -1,8 +1,8 @@
 /*
-	The all defines and part of code (such as cs461x_*) are 
-	contributed from ALSA 0.5.8 sources. 
+	The all defines and part of code (such as cs461x_*) are
+	contributed from ALSA 0.5.8 sources.
 	See http://www.alsa-project.org/ for sources
-	
+
 	Tested on Linux 686 2.4.0-test9, ALSA 0.5.8a and CS4610
 */
 
@@ -89,8 +89,8 @@ MODULE_LICENSE("GPL");
 #define JSIO_BXOE                               0x00000040
 #define JSIO_BYOE                               0x00000080
 
-/* 
-   The card initialization code is obfuscated; the module cs461x 
+/*
+   The card initialization code is obfuscated; the module cs461x
    need to be loaded after ALSA modules initialized and something
    played on the CS 4610 chip (see sources for details of CS4610
    initialization code from ALSA)
@@ -112,7 +112,7 @@ MODULE_LICENSE("GPL");
 #define BA1_DWORD_SIZE          (13 * 1024 + 512)
 #define BA1_MEMORY_COUNT        3
 
-/* 
+/*
    Only one CS461x card is still suppoted; the code requires
    redesign to avoid this limitatuion.
 */
@@ -163,7 +163,7 @@ static int cs461x_free(struct pci_dev *pdev)
 	if(port){
 	    gameport_unregister_port(port);
 	    kfree(port);
-	}    
+	}
 	if (ba0) iounmap(ba0);
 #ifdef CS461X_FULL_MAP
 	if (ba1.name.data0) iounmap(ba1.name.data0);
@@ -187,13 +187,13 @@ static unsigned char cs461x_gameport_read(struct gameport *gameport)
 static int cs461x_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
 {
 	unsigned js1, js2, jst;
-	
+
 	js1 = cs461x_peekBA0(BA0_JSC1);
 	js2 = cs461x_peekBA0(BA0_JSC2);
 	jst = cs461x_peekBA0(BA0_JSPT);
-	
-	*buttons = (~jst >> 4) & 0x0F; 
-	
+
+	*buttons = (~jst >> 4) & 0x0F;
+
 	axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
 	axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
 	axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
@@ -228,7 +228,7 @@ static int __devinit cs461x_pci_probe(struct pci_dev *pdev, const struct pci_dev
 {
 	int rc;
 	struct gameport* port;
-	
+
 	rc = pci_enable_device(pdev);
 	if (rc) {
 		printk(KERN_ERR "cs461x: Cannot enable PCI gameport (bus %d, devfn %d) error=%d\n",
@@ -240,7 +240,7 @@ static int __devinit cs461x_pci_probe(struct pci_dev *pdev, const struct pci_dev
 #ifdef CS461X_FULL_MAP
 	ba1_addr = pci_resource_start(pdev, 1);
 #endif
-	if (ba0_addr == 0 || ba0_addr == ~0 
+	if (ba0_addr == 0 || ba0_addr == ~0
 #ifdef CS461X_FULL_MAP
             || ba1_addr == 0 || ba1_addr == ~0
 #endif
@@ -281,7 +281,7 @@ static int __devinit cs461x_pci_probe(struct pci_dev *pdev, const struct pci_dev
 	memset(port, 0, sizeof(struct gameport));
 
 	pci_set_drvdata(pdev, port);
-	
+
 	port->open = cs461x_gameport_open;
 	port->trigger = cs461x_gameport_trigger;
 	port->read = cs461x_gameport_read;
@@ -310,7 +310,7 @@ static void __devexit cs461x_pci_remove(struct pci_dev *pdev)
 {
 	cs461x_free(pdev);
 }
-	
+
 static struct pci_driver cs461x_pci_driver = {
         .name =         "CS461x Gameport",
         .id_table =     cs461x_pci_tbl,
diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c
index ec18fb32b..89d469378 100644
--- a/drivers/input/gameport/emu10k1-gp.c
+++ b/drivers/input/gameport/emu10k1-gp.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -48,7 +48,7 @@ struct emu {
 	int size;
 	char phys[32];
 };
-	
+
 static struct pci_device_id emu_tbl[] = {
 	{ 0x1102, 0x7002, PCI_ANY_ID, PCI_ANY_ID }, /* SB Live gameport */
 	{ 0x1102, 0x7003, PCI_ANY_ID, PCI_ANY_ID }, /* Audigy gameport */
@@ -61,7 +61,7 @@ static int __devinit emu_probe(struct pci_dev *pdev, const struct pci_device_id
 {
 	int ioport, iolen;
 	struct emu *emu;
-        
+
 	if (pci_enable_device(pdev))
 		return -EBUSY;
 
diff --git a/drivers/input/gameport/fm801-gp.c b/drivers/input/gameport/fm801-gp.c
index 7cd7deb9c..ff3b620b8 100644
--- a/drivers/input/gameport/fm801-gp.c
+++ b/drivers/input/gameport/fm801-gp.c
@@ -111,7 +111,7 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
 
 	pci_set_drvdata(pci, gp);
 
-	outb(0x60, gp->gameport.io + 0x0d); /* enable joystick 1 and 2 */ 
+	outb(0x60, gp->gameport.io + 0x0d); /* enable joystick 1 and 2 */
 
 	gameport_register_port(&gp->gameport);
 
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 431883c5f..b2a68ab2a 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -168,7 +168,7 @@ int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode)
 		return -1;
 
 	gameport->dev = dev;
-	
+
 	return 0;
 }
 
diff --git a/drivers/input/gameport/lightning.c b/drivers/input/gameport/lightning.c
index 8a8adb558..7d1d3832c 100644
--- a/drivers/input/gameport/lightning.c
+++ b/drivers/input/gameport/lightning.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -106,7 +106,7 @@ static int l4_cooked_read(struct gameport *gameport, int *axes, int *buttons)
 
 	result = 0;
 
-fail:	outb(L4_SELECT_ANALOG, L4_PORT);	
+fail:	outb(L4_SELECT_ANALOG, L4_PORT);
 	return result;
 }
 
@@ -126,7 +126,7 @@ static int l4_open(struct gameport *gameport, int mode)
 static int l4_getcal(int port, int *cal)
 {
 	int i, result = -1;
-	
+
 	outb(L4_SELECT_ANALOG, L4_PORT);
 	outb(L4_SELECT_DIGITAL + (port >> 2), L4_PORT);
 
@@ -208,7 +208,7 @@ static int l4_calibrate(struct gameport *gameport, int *axes, int *max)
 
 	return 0;
 }
-	
+
 static int __init l4_init(void)
 {
 	int cal[4] = {255,255,255,255};
@@ -266,7 +266,7 @@ static int __init l4_init(void)
 
 			if (rev > 0x28)		/* on 2.9+ the setcal command works correctly */
 				l4_setcal(l4->port, cal);
-			
+
 			gameport_register_port(gameport);
 		}
 
diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
index 4b52ffe25..f31ce0bad 100644
--- a/drivers/input/gameport/ns558.c
+++ b/drivers/input/gameport/ns558.c
@@ -12,18 +12,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -35,6 +35,7 @@
 #include <linux/ioport.h>
 #include <linux/config.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 #include <linux/gameport.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
@@ -58,7 +59,7 @@ struct ns558 {
 	char phys[32];
 	char name[32];
 };
-	
+
 static LIST_HEAD(ns558_list);
 
 /*
@@ -103,7 +104,7 @@ static void ns558_isa_probe(int io)
 		i = 0;
 		goto out;
 	}
-	wait_ms(3);
+	msleep(3);
 /*
  * After some time (4ms) the axes shouldn't change anymore.
  */
@@ -115,7 +116,7 @@ static void ns558_isa_probe(int io)
 			i = 0;
 			goto out;
 		}
-/* 
+/*
  * And now find the number of mirrors of the port.
  */
 
@@ -129,7 +130,7 @@ static void ns558_isa_probe(int io)
 		outb(0xff, io & (-1 << i));
 		for (j = b = 0; j < 1000; j++)
 			if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++;
-		wait_ms(3);
+		msleep(3);
 
 		if (b > 300) {					/* We allow 30% difference */
 			release_region(io & (-1 << i), (1 << i));
@@ -291,7 +292,7 @@ void __exit ns558_exit(void)
 				release_region(port->gameport.io & ~(port->size - 1), port->size);
 				kfree(port);
 				break;
-		
+
 			default:
 				break;
 		}
diff --git a/drivers/input/gameport/vortex.c b/drivers/input/gameport/vortex.c
index 55d475d40..02c31b779 100644
--- a/drivers/input/gameport/vortex.c
+++ b/drivers/input/gameport/vortex.c
@@ -40,6 +40,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/delay.h>
 #include <linux/gameport.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
@@ -82,7 +83,7 @@ static int vortex_cooked_read(struct gameport *gameport, int *axes, int *buttons
 		axes[i] = readw(vortex->io + VORTEX_AXD + i * sizeof(u32));
 		if (axes[i] == 0x1fff) axes[i] = -1;
 	}
-        
+
         return 0;
 }
 
@@ -93,7 +94,7 @@ static int vortex_open(struct gameport *gameport, int mode)
 	switch (mode) {
 		case GAMEPORT_MODE_COOKED:
 			writeb(0x40, vortex->io + VORTEX_GCR);
-			wait_ms(VORTEX_DATA_WAIT);
+			msleep(VORTEX_DATA_WAIT);
 			return 0;
 		case GAMEPORT_MODE_RAW:
 			writeb(0x00, vortex->io + VORTEX_GCR);
@@ -121,7 +122,7 @@ static int __devinit vortex_probe(struct pci_dev *dev, const struct pci_device_i
 
 	vortex->gameport.driver = vortex;
 	vortex->gameport.fuzz = 64;
-	
+
 	vortex->gameport.read = vortex_read;
 	vortex->gameport.trigger = vortex_trigger;
 	vortex->gameport.cooked_read = vortex_cooked_read;
@@ -144,7 +145,7 @@ static int __devinit vortex_probe(struct pci_dev *dev, const struct pci_device_i
 	vortex->io = vortex->base + id->driver_data;
 
 	gameport_register_port(&vortex->gameport);
-	
+
 	printk(KERN_INFO "gameport at pci%s speed %d kHz\n",
 		pci_name(dev), vortex->gameport.speed);
 
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 41bb52187..73b17418a 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -106,7 +106,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
 			}
 
 			break;
-		
+
 		case EV_ABS:
 
 			if (code > ABS_MAX || !test_bit(code, dev->absbit))
@@ -144,27 +144,27 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
 			if (code > MSC_MAX || !test_bit(code, dev->mscbit))
 				return;
 
-			if (dev->event) dev->event(dev, type, code, value);	
-	
+			if (dev->event) dev->event(dev, type, code, value);
+
 			break;
 
 		case EV_LED:
-	
+
 			if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value)
 				return;
 
 			change_bit(code, dev->led);
-			if (dev->event) dev->event(dev, type, code, value);	
-	
+			if (dev->event) dev->event(dev, type, code, value);
+
 			break;
 
 		case EV_SND:
-	
+
 			if (code > SND_MAX || !test_bit(code, dev->sndbit))
 				return;
 
-			if (dev->event) dev->event(dev, type, code, value);	
-	
+			if (dev->event) dev->event(dev, type, code, value);
+
 			break;
 
 		case EV_REP:
@@ -181,7 +181,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
 			break;
 	}
 
-	if (type != EV_SYN) 
+	if (type != EV_SYN)
 		dev->sync = 0;
 
 	if (dev->grab)
@@ -282,11 +282,11 @@ static struct input_device_id *input_match_device(struct input_device_id *id, st
 		if (id->flags & INPUT_DEVICE_ID_MATCH_VENDOR)
 			if (id->id.vendor != dev->id.vendor)
 				continue;
-	
+
 		if (id->flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
 			if (id->id.product != dev->id.product)
 				continue;
-		
+
 		if (id->flags & INPUT_DEVICE_ID_MATCH_VERSION)
 			if (id->id.version != dev->id.version)
 				continue;
@@ -351,11 +351,11 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
 	}
 	if (in_interrupt()) {
 		printk(KERN_ERR "input.c: calling hotplug from interrupt\n");
-		return; 
+		return;
 	}
 	if (!current->fs->root) {
 		printk(KERN_WARNING "input.c: calling hotplug without valid filesystem\n");
-		return; 
+		return;
 	}
 	if (!(envp = (char **) kmalloc(20 * sizeof(char *), GFP_KERNEL))) {
 		printk(KERN_ERR "input.c: not enough memory allocating hotplug environment\n");
@@ -381,17 +381,17 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
 
 	envp[i++] = scratch;
 	scratch += sprintf(scratch, "PRODUCT=%x/%x/%x/%x",
-		dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1; 
-	
+		dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version) + 1;
+
 	if (dev->name) {
 		envp[i++] = scratch;
-		scratch += sprintf(scratch, "NAME=%s", dev->name) + 1; 
+		scratch += sprintf(scratch, "NAME=%s", dev->name) + 1;
 	}
 
 	if (dev->phys) {
 		envp[i++] = scratch;
-		scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1; 
-	}	
+		scratch += sprintf(scratch, "PHYS=%s", dev->phys) + 1;
+	}
 
 	SPRINTF_BIT_A(evbit, "EV=", EV_MAX);
 	SPRINTF_BIT_A2(keybit, "KEY=", KEY_MAX, EV_KEY);
@@ -506,7 +506,7 @@ void input_register_handler(struct input_handler *handler)
 		input_table[handler->minor >> 5] = handler;
 
 	list_add_tail(&handler->node, &input_handler_list);
-	
+
 	list_for_each_entry(dev, &input_dev_list, node)
 		if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
 			if ((id = input_match_device(handler->id_table, dev)))
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index abc2e107e..3cc849e03 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -1,12 +1,12 @@
 /*
  * Joystick device driver for the input driver suite.
  *
- * Copyright (c) 1999-2002 Vojtech Pavlik 
- * Copyright (c) 1999 Colin Van Dyke 
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ * Copyright (c) 1999 Colin Van Dyke
  *
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
 
@@ -34,7 +34,7 @@ MODULE_SUPPORTED_DEVICE("input/js");
 MODULE_LICENSE("GPL");
 
 #define JOYDEV_MINOR_BASE	0
-#define JOYDEV_MINORS		16	
+#define JOYDEV_MINORS		16
 #define JOYDEV_BUFFER_SIZE	64
 
 #define MSECS(t)	(1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
@@ -115,7 +115,7 @@ static void joydev_event(struct input_handle *handle, unsigned int type, unsigne
 
 		default:
 			return;
-	}  
+	}
 
 	event.time = MSECS(jiffies);
 
@@ -449,10 +449,10 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
 	}
 
 	joydev_table[minor] = joydev;
-	
+
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
-	class_simple_device_add(input_class, 
+	class_simple_device_add(input_class,
 				MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
 				dev->dev, "js%d", minor);
 
@@ -466,7 +466,7 @@ static void joydev_disconnect(struct input_handle *handle)
 	joydev->exist = 0;
 
 	if (joydev->open)
-		input_close_device(handle);	
+		input_close_device(handle);
 	else
 		joydev_free(joydev);
 }
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index 1ae033888..7d506f1f7 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -22,7 +22,7 @@ config JOYSTICK_ANALOG
 	  supports many extensions, including joysticks with throttle control,
 	  with rudders, additional hats and buttons compatible with CH
 	  Flightstick Pro, ThrustMaster FCS, 6 and 8 button gamepads, or
-	  Saitek Cyborg joysticks. 
+	  Saitek Cyborg joysticks.
 
 	  Please read the file <file:Documentation/input/joystick.txt> which
 	  contains more information.
@@ -35,7 +35,7 @@ config JOYSTICK_A3D
 	depends on INPUT && INPUT_JOYSTICK && GAMEPORT
 	help
 	  Say Y here if you have an FPGaming or MadCatz controller using the
-	  A3D protocol over the PC gameport. 
+	  A3D protocol over the PC gameport.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called a3d.
@@ -45,7 +45,7 @@ config JOYSTICK_ADI
 	depends on INPUT && INPUT_JOYSTICK && GAMEPORT
 	help
 	  Say Y here if you have a Logitech controller using the ADI
-	  protocol over the PC gameport. 
+	  protocol over the PC gameport.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called adi.
@@ -74,7 +74,7 @@ config JOYSTICK_GRIP
 	depends on INPUT && INPUT_JOYSTICK && GAMEPORT
 	help
 	  Say Y here if you have a Gravis controller using the GrIP protocol
-	  over the PC gameport. 
+	  over the PC gameport.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called grip.
@@ -94,7 +94,7 @@ config JOYSTICK_GUILLEMOT
 	depends on INPUT && INPUT_JOYSTICK && GAMEPORT
 	help
 	  Say Y here if you have a Guillemot joystick using a digital
-	  protocol over the PC gameport. 
+	  protocol over the PC gameport.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called guillemot.
@@ -124,7 +124,7 @@ config JOYSTICK_TMDC
 	depends on INPUT && INPUT_JOYSTICK && GAMEPORT
 	help
 	  Say Y here if you have a ThrustMaster controller using the
-	  DirectConnect (BSP) protocol over the PC gameport. 
+	  DirectConnect (BSP) protocol over the PC gameport.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called tmdc.
@@ -137,7 +137,7 @@ config JOYSTICK_WARRIOR
 	select SERIO
 	help
 	  Say Y here if you have a Logitech WingMan Warrior joystick connected
-	  to your computer's serial port. 
+	  to your computer's serial port.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called warrior.
@@ -253,7 +253,7 @@ config INPUT_JOYDUMP
 	help
 	  Say Y here if you want to dump data from your joystick into the system
 	  log for debugging purposes. Say N if you are making a production
-	  configuration or aren't sure. 
+	  configuration or aren't sure.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called joydump.
diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c
index 9d66a654e..b3eb64fdc 100644
--- a/drivers/input/joystick/a3d.c
+++ b/drivers/input/joystick/a3d.c
@@ -39,8 +39,8 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("FP-Gaming Assasin 3D joystick driver");
 MODULE_LICENSE("GPL");
 
-#define A3D_MAX_START		400	/* 400 us */ 
-#define A3D_MAX_STROBE		60	/* 40 us */ 
+#define A3D_MAX_START		400	/* 400 us */
+#define A3D_MAX_STROBE		60	/* 40 us */
 #define A3D_DELAY_READ		3	/* 3 ms */
 #define A3D_MAX_LENGTH		40	/* 40*3 bits */
 #define A3D_REFRESH_TIME	HZ/50	/* 20 ms */
@@ -125,7 +125,7 @@ static void a3d_read(struct a3d *a3d, unsigned char *data)
 
 			input_report_rel(dev, REL_X, ((data[5] << 6) | (data[6] << 3) | data[ 7]) - ((data[5] & 4) << 7));
 			input_report_rel(dev, REL_Y, ((data[8] << 6) | (data[9] << 3) | data[10]) - ((data[8] & 4) << 7));
-			
+
 			input_report_key(dev, BTN_RIGHT,  data[2] & 1);
 			input_report_key(dev, BTN_LEFT,   data[3] & 2);
 			input_report_key(dev, BTN_MIDDLE, data[3] & 4);
@@ -201,7 +201,7 @@ int a3d_adc_cooked_read(struct gameport *gameport, int *axes, int *buttons)
 	int i;
 	for (i = 0; i < 4; i++)
 		axes[i] = (a3d->axes[i] < 254) ? a3d->axes[i] : -1;
-	*buttons = a3d->buttons; 
+	*buttons = a3d->buttons;
 	return 0;
 }
 
@@ -216,7 +216,7 @@ int a3d_adc_open(struct gameport *gameport, int mode)
 	if (mode != GAMEPORT_MODE_COOKED)
 		return -1;
 	if (!a3d->used++)
-		mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME);	
+		mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME);
 	return 0;
 }
 
@@ -239,7 +239,7 @@ static int a3d_open(struct input_dev *dev)
 {
 	struct a3d *a3d = dev->private;
 	if (!a3d->used++)
-		mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME);	
+		mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME);
 	return 0;
 }
 
@@ -340,7 +340,7 @@ static void a3d_connect(struct gameport *gameport, struct gameport_dev *dev)
 		a3d->adc.open = a3d_adc_open;
 		a3d->adc.close = a3d_adc_close;
 		a3d->adc.cooked_read = a3d_adc_cooked_read;
-		a3d->adc.fuzz = 1; 
+		a3d->adc.fuzz = 1;
 
 		a3d->adc.name = a3d_names[a3d->mode];
 		a3d->adc.phys = a3d->adcphys;
diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
index 82929b1db..da70b5dea 100644
--- a/drivers/input/joystick/adi.c
+++ b/drivers/input/joystick/adi.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -72,8 +72,8 @@ MODULE_LICENSE("GPL");
  */
 
 static char *adi_names[] = {	"WingMan Extreme Digital", "ThunderPad Digital", "SideCar", "CyberMan 2",
-				"WingMan Interceptor", "WingMan Formula", "WingMan GamePad", 
-				"WingMan Extreme Digital 3D", "WingMan GamePad Extreme", 
+				"WingMan Interceptor", "WingMan Formula", "WingMan GamePad",
+				"WingMan Extreme Digital 3D", "WingMan GamePad Extreme",
 				"WingMan GamePad USB", "Unknown Device %#x" };
 
 static char adi_wmgpe_abs[] =	{ ABS_X, ABS_Y, ABS_HAT0X, ABS_HAT0Y };
@@ -178,7 +178,7 @@ static void adi_read_packet(struct adi_port *port)
 
 /*
  * adi_move_bits() detects a possible 2-stream mode, and moves
- * the bits accordingly. 
+ * the bits accordingly.
  */
 
 static void adi_move_bits(struct adi_port *port, int length)
@@ -208,7 +208,7 @@ static inline int adi_get_bits(struct adi *adi, int count)
 	int i;
 	if ((adi->idx += count) > adi->ret) return 0;
 	for (i = 0; i < count; i++)
-		bits |= ((adi->data[adi->idx - i] >> 5) & 1) << i; 
+		bits |= ((adi->data[adi->idx - i] >> 5) & 1) << i;
 	return bits;
 }
 
@@ -224,12 +224,12 @@ static int adi_decode(struct adi *adi)
 	int i, t;
 
 	if (adi->ret < adi->length || adi->id != (adi_get_bits(adi, 4) | (adi_get_bits(adi, 4) << 4)))
-		return -1;	
+		return -1;
 
-	for (i = 0; i < adi->axes10; i++) 
+	for (i = 0; i < adi->axes10; i++)
 		input_report_abs(dev, *abs++, adi_get_bits(adi, 10));
 
-	for (i = 0; i < adi->axes8; i++) 
+	for (i = 0; i < adi->axes8; i++)
 		input_report_abs(dev, *abs++, adi_get_bits(adi, 8));
 
 	for (i = 0; i < adi->buttons && i < 63; i++) {
@@ -249,7 +249,7 @@ static int adi_decode(struct adi *adi)
 
 	for (i = 63; i < adi->buttons; i++)
 		input_report_key(dev, *key++, adi_get_bits(adi, 1));
-	
+
 	input_sync(dev);
 
 	return 0;
@@ -294,7 +294,7 @@ static int adi_open(struct input_dev *dev)
 {
 	struct adi_port *port = dev->private;
 	if (!port->used++)
-		mod_timer(&port->timer, jiffies + ADI_REFRESH_TIME);	
+		mod_timer(&port->timer, jiffies + ADI_REFRESH_TIME);
 	return 0;
 }
 
@@ -321,7 +321,7 @@ static void adi_init_digital(struct gameport *gameport)
 
 	for (i = 0; seq[i]; i++) {
 		gameport_trigger(gameport);
-		if (seq[i] > 0) wait_ms(seq[i]);
+		if (seq[i] > 0) msleep(seq[i]);
 		if (seq[i] < 0) mdelay(-seq[i]);
 	}
 }
@@ -334,7 +334,7 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port)
 		return;
 
 	if (adi->ret < (t = adi_get_bits(adi, 10))) {
-		printk(KERN_WARNING "adi: Short ID packet: reported: %d != read: %d\n", t, adi->ret); 
+		printk(KERN_WARNING "adi: Short ID packet: reported: %d != read: %d\n", t, adi->ret);
 		return;
 	}
 
@@ -498,7 +498,7 @@ static void adi_connect(struct gameport *gameport, struct gameport_dev *dev)
 
 	adi_init_digital(gameport);
 	adi_read_packet(port);
-	
+
 	if (port->adi[0].ret >= ADI_MIN_LEN_LENGTH)
 		adi_move_bits(port, adi_get_bits(port->adi, 10));
 
@@ -513,9 +513,9 @@ static void adi_connect(struct gameport *gameport, struct gameport_dev *dev)
 		return;
 	}
 
-	wait_ms(ADI_INIT_DELAY);
+	msleep(ADI_INIT_DELAY);
 	if (adi_read(port)) {
-		wait_ms(ADI_DATA_DELAY);
+		msleep(ADI_DATA_DELAY);
 		adi_read(port);
 	}
 
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index df57287cc..8b5fc358d 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -46,7 +46,7 @@ MODULE_DESCRIPTION("Driver for Amiga joysticks");
 MODULE_LICENSE("GPL");
 
 static int amijoy[2] = { 0, 1 };
-static int amijoy_nargs;  
+static int amijoy_nargs;
 module_param_array_named(map, amijoy, uint, amijoy_nargs, 0);
 MODULE_PARM_DESC(map, "Map of attached joysticks in form of <a>,<b> (default is 0,1)");
 
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index d76c5fbdf..3e83968a9 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -142,7 +142,7 @@ struct analog_port {
 
 #ifdef __i386__
 #define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
-#define DELTA(x,y)	(cpu_has_tsc?((y)-(x)):((x)-(y)+((x)<(y)?1193182L/HZ:0)))
+#define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
 #define TIME_NAME	(cpu_has_tsc?"TSC":"PIT")
 static unsigned int get_time_pit(void)
 {
@@ -237,7 +237,7 @@ static int analog_cooked_read(struct analog_port *port)
 
 	loopout = (ANALOG_LOOP_TIME * port->loop) / 1000;
 	timeout = ANALOG_MAX_TIME * port->speed;
-	
+
 	local_irq_save(flags);
 	gameport_trigger(gameport);
 	GET_TIME(now);
@@ -284,7 +284,7 @@ static int analog_button_read(struct analog_port *port, char saitek, char chf)
 
 	u = gameport_read(port->gameport);
 
-	if (!chf) { 
+	if (!chf) {
 		port->buttons = (~u >> 4) & 0xf;
 		return 0;
 	}
@@ -333,7 +333,7 @@ static void analog_timer(unsigned long data)
 		}
 	}
 
-	for (i = 0; i < 2; i++) 
+	for (i = 0; i < 2; i++)
 		if (port->analog[i].mask)
 			analog_decode(port->analog + i, port->axes, port->initial, port->buttons);
 
@@ -348,7 +348,7 @@ static int analog_open(struct input_dev *dev)
 {
 	struct analog_port *port = dev->private;
 	if (!port->used++)
-		mod_timer(&port->timer, jiffies + ANALOG_REFRESH_TIME);	
+		mod_timer(&port->timer, jiffies + ANALOG_REFRESH_TIME);
 	return 0;
 }
 
@@ -408,7 +408,7 @@ static void analog_calibrate_timer(struct analog_port *port)
 
 static void analog_name(struct analog *analog)
 {
-	sprintf(analog->name, "Analog %d-axis %d-button", 
+	sprintf(analog->name, "Analog %d-axis %d-button",
 		hweight8(analog->mask & ANALOG_AXES_STD),
 		hweight8(analog->mask & ANALOG_BTNS_STD) + !!(analog->mask & ANALOG_BTNS_CHF) * 2 +
 		hweight16(analog->mask & ANALOG_BTNS_GAMEPAD) + !!(analog->mask & ANALOG_HBTN_CHF) * 4);
@@ -450,10 +450,10 @@ static void analog_init_device(struct analog_port *port, struct analog *analog,
 	analog->dev.close = analog_close;
 	analog->dev.private = port;
 	analog->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-	
+
 	for (i = j = 0; i < 4; i++)
 		if (analog->mask & (1 << i)) {
-			
+
 			t = analog_axes[j];
 			x = port->axes[i];
 			y = (port->axes[0] + port->axes[1]) >> 1;
@@ -481,8 +481,8 @@ static void analog_init_device(struct analog_port *port, struct analog *analog,
 			j++;
 		}
 
-	for (i = j = 0; i < 3; i++) 
-		if (analog->mask & analog_exts[i]) 
+	for (i = j = 0; i < 3; i++)
+		if (analog->mask & analog_exts[i])
 			for (x = 0; x < 2; x++) {
 				t = analog_hats[j++];
 				set_bit(t, analog->dev.absbit);
@@ -517,7 +517,7 @@ static void analog_init_device(struct analog_port *port, struct analog *analog,
 	else
 		printk(" [%s timer, %d %sHz clock, %d ns res]\n", TIME_NAME,
 		port->speed > 10000 ? (port->speed + 800) / 1000 : port->speed,
-		port->speed > 10000 ? "M" : "k", 
+		port->speed > 10000 ? "M" : "k",
 		port->speed > 10000 ? (port->loop * 1000) / (port->speed / 1000)
 				    : (port->loop * 1000000) / port->speed);
 }
@@ -580,11 +580,11 @@ static int analog_init_masks(struct analog_port *port)
 
 		gameport_calibrate(port->gameport, port->axes, max);
 	}
-		
-	for (i = 0; i < 4; i++) 
+
+	for (i = 0; i < 4; i++)
 		port->initial[i] = port->axes[i];
 
-	return -!(analog[0].mask || analog[1].mask);	
+	return -!(analog[0].mask || analog[1].mask);
 }
 
 static int analog_init_port(struct gameport *gameport, struct gameport_dev *dev, struct analog_port *port)
@@ -603,25 +603,25 @@ static int analog_init_port(struct gameport *gameport, struct gameport_dev *dev,
 
 		gameport_trigger(gameport);
 		t = gameport_read(gameport);
-		wait_ms(ANALOG_MAX_TIME);
+		msleep(ANALOG_MAX_TIME);
 		port->mask = (gameport_read(gameport) ^ t) & t & 0xf;
 		port->fuzz = (port->speed * ANALOG_FUZZ_MAGIC) / port->loop / 1000 + ANALOG_FUZZ_BITS;
-	
+
 		for (i = 0; i < ANALOG_INIT_RETRIES; i++) {
 			if (!analog_cooked_read(port)) break;
-			wait_ms(ANALOG_MAX_TIME);
+			msleep(ANALOG_MAX_TIME);
 		}
 
 		u = v = 0;
 
-		wait_ms(ANALOG_MAX_TIME);
+		msleep(ANALOG_MAX_TIME);
 		t = gameport_time(gameport, ANALOG_MAX_TIME * 1000);
 		gameport_trigger(gameport);
-		while ((gameport_read(port->gameport) & port->mask) && (u < t)) u++; 
+		while ((gameport_read(port->gameport) & port->mask) && (u < t)) u++;
 		udelay(ANALOG_SAITEK_DELAY);
 		t = gameport_time(gameport, ANALOG_SAITEK_TIME);
 		gameport_trigger(gameport);
-		while ((gameport_read(port->gameport) & port->mask) && (v < t)) v++; 
+		while ((gameport_read(port->gameport) & port->mask) && (v < t)) v++;
 
 		if (v < (u >> 1)) { /* FIXME - more than one port */
 			analog_options[0] |= /* FIXME - more than one port */
@@ -721,7 +721,7 @@ static void analog_parse_options(void)
 			if (!strcmp(analog_types[j].name, js[i])) {
 				analog_options[i] = analog_types[j].value;
 				break;
-			} 
+			}
 		if (analog_types[j].name) continue;
 
 		analog_options[i] = simple_strtoul(js[i], &end, 0);
diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c
index 9ca36edd1..fc29ad79b 100644
--- a/drivers/input/joystick/cobra.c
+++ b/drivers/input/joystick/cobra.c
@@ -72,7 +72,7 @@ static unsigned char cobra_read_packet(struct gameport *gameport, unsigned int *
 		r[i] = buf[i] = 0;
 		t[i] = COBRA_MAX_STROBE;
 	}
-	
+
 	local_irq_save(flags);
 
 	u = gameport_read(gameport);
@@ -140,14 +140,14 @@ static void cobra_timer(unsigned long private)
 
 		}
 
-	mod_timer(&cobra->timer, jiffies + COBRA_REFRESH_TIME);	
+	mod_timer(&cobra->timer, jiffies + COBRA_REFRESH_TIME);
 }
 
 static int cobra_open(struct input_dev *dev)
 {
 	struct cobra *cobra = dev->private;
 	if (!cobra->used++)
-		mod_timer(&cobra->timer, jiffies + COBRA_REFRESH_TIME);	
+		mod_timer(&cobra->timer, jiffies + COBRA_REFRESH_TIME);
 	return 0;
 }
 
@@ -180,7 +180,7 @@ static void cobra_connect(struct gameport *gameport, struct gameport_dev *dev)
 
 	cobra->exists = cobra_read_packet(gameport, data);
 
-	for (i = 0; i < 2; i++) 
+	for (i = 0; i < 2; i++)
 		if ((cobra->exists >> i) & data[i] & 1) {
 			printk(KERN_WARNING "cobra.c: Device %d on %s has the Ext bit set. ID is: %d"
 				" Contact vojtech@ucw.cz\n", i, gameport->phys, (data[i] >> 2) & 7);
@@ -205,7 +205,7 @@ static void cobra_connect(struct gameport *gameport, struct gameport_dev *dev)
 			cobra->dev[i].id.vendor = GAMEPORT_ID_VENDOR_CREATIVE;
 			cobra->dev[i].id.product = 0x0008;
 			cobra->dev[i].id.version = 0x0100;
-		
+
 			cobra->dev[i].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 			cobra->dev[i].absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
 
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index f7d3eebd7..5ad612751 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -14,14 +14,14 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -95,7 +95,7 @@ __obsolete_setup("db9_3=");
 struct db9 {
 	struct input_dev dev[DB9_MAX_DEVICES];
 	struct timer_list timer;
-	struct pardevice *pd;	
+	struct pardevice *pd;
 	int mode;
 	int used;
 	char phys[2][32];
@@ -188,7 +188,7 @@ static unsigned char db9_saturn_read_analog(struct parport *port, int type, int
 }
 
 /*
- * db9_saturn_read_packet() reads whole saturn packet at connector 
+ * db9_saturn_read_packet() reads whole saturn packet at connector
  * and returns device identifier code.
  */
 static unsigned char db9_saturn_read_packet(struct parport *port, unsigned char *data, int type, int powered)
@@ -481,16 +481,16 @@ static void db9_timer(unsigned long private)
 			input_report_abs(dev, ABS_X, (data & DB9_RIGHT ? 0 : 1) - (data & DB9_LEFT ? 0 : 1));
 			input_report_abs(dev, ABS_Y, (data & DB9_DOWN  ? 0 : 1) - (data & DB9_UP   ? 0 : 1));
 
-			parport_write_control(port, 0x0a); 
+			parport_write_control(port, 0x0a);
 
-			for (i = 0; i < 7; i++) { 
+			for (i = 0; i < 7; i++) {
 				data = parport_read_data(port);
-				parport_write_control(port, 0x02); 
-				parport_write_control(port, 0x0a); 
+				parport_write_control(port, 0x02);
+				parport_write_control(port, 0x0a);
 				input_report_key(dev, db9_cd32_btn[i], ~data & DB9_FIRE2);
 				}
 
-			parport_write_control(port, 0x00); 
+			parport_write_control(port, 0x00);
 			break;
 		}
 
@@ -600,7 +600,7 @@ static struct db9 __init *db9_probe(int *config, int nargs)
 
 		db9->dev[i].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 		for (j = 0; j < db9_buttons[db9->mode]; j++)
-			set_bit(db9_btn[db9->mode][j], db9->dev[i].keybit); 
+			set_bit(db9_btn[db9->mode][j], db9->dev[i].keybit);
 		for (j = 0; j < db9_num_axis[db9->mode]; j++) {
 			set_bit(db9_abs[j], db9->dev[i].absbit);
 			if (j < 2) {
@@ -635,7 +635,7 @@ void __exit db9_exit(void)
 {
 	int i, j;
 
-	for (i = 0; i < 3; i++) 
+	for (i = 0; i < 3; i++)
 		if (db9_base[i]) {
 			for (j = 0; j < min(db9_max_pads[db9_base[i]->mode], DB9_MAX_DEVICES); j++)
 				input_unregister_device(db9_base[i]->dev + j);
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index 02ee05a98..555fb362b 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -15,14 +15,14 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -70,13 +70,13 @@ __obsolete_setup("gc_3=");
 #define GC_NES4		3
 #define GC_MULTI	4
 #define GC_MULTI2	5
-#define GC_N64		6	
+#define GC_N64		6
 #define GC_PSX		7
 
 #define GC_MAX		7
 
 #define GC_REFRESH_TIME	HZ/100
- 
+
 struct gc {
 	struct pardevice *pd;
 	struct input_dev dev[5];
@@ -104,7 +104,7 @@ static short gc_n64_btn[] = { BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL,
 #define GC_N64_DELAY		133		/* delay between transmit request, and response ready (us) */
 #define GC_N64_REQUEST		0x1dd1111111ULL /* the request data command (encoded for 000000011) */
 #define GC_N64_DWS		3		/* delay between write segments (required for sound playback because of ISA DMA) */
-						/* GC_N64_DWS > 24 is known to fail */ 
+						/* GC_N64_DWS > 24 is known to fail */
 #define GC_N64_POWER_W		0xe2		/* power during write (transmit request) */
 #define GC_N64_POWER_R		0xfd		/* power during read */
 #define GC_N64_OUT		0x1d		/* output bits to the 4 pads */
@@ -113,8 +113,8 @@ static short gc_n64_btn[] = { BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL,
 						/* than 123 us */
 #define GC_N64_CLOCK		0x02		/* clock bits for read */
 
-/* 
- * gc_n64_read_packet() reads an N64 packet. 
+/*
+ * gc_n64_read_packet() reads an N64 packet.
  * Each pad uses one bit per byte. So all pads connected to this port are read in parallel.
  */
 
@@ -224,7 +224,7 @@ static void gc_multi_read_packet(struct gc *gc, int length, unsigned char *data)
  *	http://www.dim.com/~mackys/psxmemcard/ps-eng2.txt
  *	http://www.gamesx.com/controldata/psxcont/psxcont.htm
  *	ftp://milano.usal.es/pablo/
- *	
+ *
  */
 
 #define GC_PSX_DELAY	25		/* 25 usec */
@@ -331,13 +331,13 @@ static void gc_timer(unsigned long private)
 			s = gc_status_bit[i];
 
 			if (s & gc->pads[GC_N64] & ~(data[8] | data[9])) {
-	
+
 				signed char axes[2];
 				axes[0] = axes[1] = 0;
 
 				for (j = 0; j < 8; j++) {
-					if (data[23 - j] & s) axes[0] |= 1 << j; 
-					if (data[31 - j] & s) axes[1] |= 1 << j; 
+					if (data[23 - j] & s) axes[0] |= 1 << j;
+					if (data[31 - j] & s) axes[1] |= 1 << j;
 				}
 
 				input_report_abs(dev + i, ABS_X,  axes[0]);
@@ -588,7 +588,7 @@ static struct gc __init *gc_probe(int *config, int nargs)
 				break;
 
 			case GC_PSX:
-				
+
 				psx = gc_psx_read_packet(gc, data);
 
 				switch(psx) {
@@ -629,7 +629,7 @@ static struct gc __init *gc_probe(int *config, int nargs)
 		}
 
 		sprintf(gc->phys[i], "%s/input%d", gc->pd->port->name, i);
-		
+
                 gc->dev[i].name = gc_names[config[i + 1]];
 		gc->dev[i].phys = gc->phys[i];
                 gc->dev[i].id.bustype = BUS_PARPORT;
@@ -646,7 +646,7 @@ static struct gc __init *gc_probe(int *config, int nargs)
 		return NULL;
 	}
 
-	for (i = 0; i < 5; i++) 
+	for (i = 0; i < 5; i++)
 		if (gc->pads[0] & gc_status_bit[i]) {
 			input_register_device(gc->dev + i);
 			printk(KERN_INFO "input: %s on %s\n", gc->dev[i].name, gc->pd->port->name);
@@ -675,7 +675,7 @@ void __exit gc_exit(void)
 		if (gc_base[i]) {
 			for (j = 0; j < 5; j++)
 				if (gc_base[i]->pads[0] & gc_status_bit[j])
-					input_unregister_device(gc_base[i]->dev + j); 
+					input_unregister_device(gc_base[i]->dev + j);
 			parport_unregister_device(gc_base[i]->pd);
 		}
 }
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c
index 986b45a25..10cc6ca9c 100644
--- a/drivers/input/joystick/gf2k.c
+++ b/drivers/input/joystick/gf2k.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -223,7 +223,7 @@ static int gf2k_open(struct input_dev *dev)
 {
 	struct gf2k *gf2k = dev->private;
 	if (!gf2k->used++)
-		mod_timer(&gf2k->timer, jiffies + GF2K_REFRESH);	
+		mod_timer(&gf2k->timer, jiffies + GF2K_REFRESH);
 	return 0;
 }
 
@@ -260,11 +260,11 @@ static void gf2k_connect(struct gameport *gameport, struct gameport_dev *dev)
 
 	gf2k_trigger_seq(gameport, gf2k_seq_reset);
 
-	wait_ms(GF2K_TIMEOUT);
+	msleep(GF2K_TIMEOUT);
 
 	gf2k_trigger_seq(gameport, gf2k_seq_digital);
 
-	wait_ms(GF2K_TIMEOUT);
+	msleep(GF2K_TIMEOUT);
 
 	if (gf2k_read_packet(gameport, GF2K_LENGTH, data) < 12)
 		goto fail2;
@@ -324,7 +324,7 @@ static void gf2k_connect(struct gameport *gameport, struct gameport_dev *dev)
 
 	for (i = 0; i < gf2k_axes[gf2k->id]; i++) {
 		gf2k->dev.absmax[gf2k_abs[i]] = (i < 2) ? gf2k->dev.abs[gf2k_abs[i]] * 2 - 32 :
-	      		  gf2k->dev.abs[gf2k_abs[0]] + gf2k->dev.abs[gf2k_abs[1]] - 32; 
+	      		  gf2k->dev.abs[gf2k_abs[0]] + gf2k->dev.abs[gf2k_abs[1]] - 32;
 		gf2k->dev.absmin[gf2k_abs[i]] = 32;
 		gf2k->dev.absfuzz[gf2k_abs[i]] = 8;
 		gf2k->dev.absflat[gf2k_abs[i]] = (i < 2) ? 24 : 0;
diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c
index 9acf65af4..3b1b07e2d 100644
--- a/drivers/input/joystick/grip.c
+++ b/drivers/input/joystick/grip.c
@@ -48,8 +48,8 @@ MODULE_LICENSE("GPL");
 #define GRIP_STROBE_GPP		200	/* 200 us */
 #define GRIP_LENGTH_XT		4
 #define GRIP_STROBE_XT		64	/* 64 us */
-#define GRIP_MAX_CHUNKS_XT	10	
-#define GRIP_MAX_BITS_XT	30	
+#define GRIP_MAX_CHUNKS_XT	10
+#define GRIP_MAX_BITS_XT	30
 
 #define GRIP_REFRESH_TIME	HZ/50	/* 20 ms */
 
@@ -153,7 +153,7 @@ static int grip_xt_read_packet(struct gameport *gameport, int shift, unsigned in
 				buf = (buf << 1) | (u >> 1);
 				t = strobe;
 				i++;
-			} else 
+			} else
 
 			if ((((u ^ v) & (v ^ w)) >> 1) & ~(u | v | w) & 1) {
 				if (i == 20) {
diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c
index d7623485f..995caa3e4 100644
--- a/drivers/input/joystick/grip_mp.c
+++ b/drivers/input/joystick/grip_mp.c
@@ -69,7 +69,7 @@ struct grip_mp {
 #define IO_MODE_FAST         0x0200           /* Used 3 data bits per gameport read     */
 #define IO_SLOT_CHANGE       0x0800           /* Multiport physical slot status changed */
 #define IO_DONE              0x1000           /* Multiport is done sending packets      */
-#define IO_RETRY             0x4000           /* Try again later to get packet          */ 
+#define IO_RETRY             0x4000           /* Try again later to get packet          */
 #define IO_RESET             0x8000           /* Force multiport to resend all packets  */
 
 /*
@@ -144,8 +144,8 @@ static inline int poll_until(u8 onbits, u8 offbits, int u_sec, struct gameport*
 /*
  * Gets a 28-bit packet from the multiport.
  *
- * After getting a packet successfully, commands encoded by sendcode may 
- * be sent to the multiport.  
+ * After getting a packet successfully, commands encoded by sendcode may
+ * be sent to the multiport.
  *
  * The multiport clock value is reflected in gameport bit B4.
  *
@@ -169,7 +169,7 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 
 	*packet = 0;
 	raw_data = gameport_read(gameport);
-	if (raw_data & 1)                          
+	if (raw_data & 1)
  		return IO_RETRY;
 
 	for (i = 0; i < 64; i++) {
@@ -183,11 +183,11 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 
 		if (raw_data & 0x31)
 			return IO_RESET;
-		gameport_trigger(gameport); 
+		gameport_trigger(gameport);
 
 		if (!poll_until(0x10, 0, 308, gameport, &raw_data))
 			return IO_RESET;
-	} else 
+	} else
 		return IO_RETRY;
 
 	/* Determine packet transfer mode and prepare for packet construction. */
@@ -195,7 +195,7 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 	if (raw_data & 0x20) {                 /* 3 data bits/read */
 		portvals |= raw_data >> 4;     /* Compare B4-B7 before & after trigger */
 
-		if (portvals != 0xb)           
+		if (portvals != 0xb)
 			return 0;
 		data_mask = 7;
 		bits_per_read = 3;
@@ -221,7 +221,7 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 			return IO_RESET;
 	}
 
-	if (raw_data)                            
+	if (raw_data)
 		return IO_RESET;
 
 	/* If 3 bits/read used, drop from 30 bits to 28. */
@@ -231,7 +231,7 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 		pkt = (pkt >> 2) | 0xf0000000;
 	}
 
-	if (bit_parity(pkt) == 1) 
+	if (bit_parity(pkt) == 1)
 		return IO_RESET;
 
 	/* Acknowledge packet receipt */
@@ -251,10 +251,10 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 
         /* Return if we just wanted the packet or multiport wants to send more */
 
-	*packet = pkt;	                             
+	*packet = pkt;
 	if ((sendflags == 0) || ((sendflags & IO_RETRY) && !(pkt & PACKET_MP_DONE)))
 		return IO_GOT_PACKET;
-	
+
 	if (pkt & PACKET_MP_MORE)
 		return IO_GOT_PACKET | IO_RETRY;
 
@@ -277,7 +277,7 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
 		if (!poll_until(0x30, 0, 193, gameport, &raw_data))
 			return IO_GOT_PACKET | IO_RESET;
 
-		if (raw_data & 1)   
+		if (raw_data & 1)
 			return IO_GOT_PACKET | IO_RESET;
 
 		if (sendcode & 1)
@@ -429,19 +429,19 @@ static int get_and_decode_packet(struct grip_mp *grip, int flags)
 			strange_code = joytype;
 		}
 	}
-	return flags;  
+	return flags;
 }
 
 /*
  * Returns true if all multiport slot states appear valid.
  */
- 
+
 static int slots_valid(struct grip_mp *grip)
 {
 	int flags, slot, invalid = 0, active = 0;
 
 	flags = get_and_decode_packet(grip, 0);
-	if (!(flags & IO_GOT_PACKET))          
+	if (!(flags & IO_GOT_PACKET))
 		return 0;
 
 	for (slot = 0; slot < 4; slot++) {
@@ -463,7 +463,7 @@ static int slots_valid(struct grip_mp *grip)
  * Returns whether the multiport was placed into digital mode and
  * able to communicate its state successfully.
  */
- 
+
 static int multiport_init(struct grip_mp *grip)
 {
 	int dig_mode, initialized = 0, tries = 0;
@@ -481,7 +481,7 @@ static int multiport_init(struct grip_mp *grip)
 		dbg("multiport_init(): unable to achieve digital mode.\n");
 		return 0;
 	}
-	
+
 	/* Get packets, store multiport state, and check state's validity */
 	for (tries = 0; tries < 4096; tries++) {
 		if ( slots_valid(grip) ) {
@@ -520,9 +520,9 @@ static void report_slot(struct grip_mp *grip, int slot)
 }
 
 /*
- * Get the multiport state.  
+ * Get the multiport state.
  */
- 
+
 static void get_and_report_mp_state(struct grip_mp *grip)
 {
 	int i, npkts, flags;
@@ -538,7 +538,7 @@ static void get_and_report_mp_state(struct grip_mp *grip)
 			break;
 	}
 
-	for (i = 0; i < 4; i++)      
+	for (i = 0; i < 4; i++)
 		if (grip->dirty[i])
 			report_slot(grip, i);
 }
@@ -546,7 +546,7 @@ static void get_and_report_mp_state(struct grip_mp *grip)
 /*
  * Called when a joystick device file is opened
  */
- 
+
 static int grip_open(struct input_dev *dev)
 {
 	struct grip_mp *grip = dev->private;
@@ -607,7 +607,7 @@ static void register_slot(int slot, struct grip_mp *grip)
 /*
  * Repeatedly polls the multiport and generates events.
  */
- 
+
 static void grip_timer(unsigned long private)
 {
 	struct grip_mp *grip = (void*) private;
diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c
index 456e19983..cfe8c6be1 100644
--- a/drivers/input/joystick/guillemot.c
+++ b/drivers/input/joystick/guillemot.c
@@ -45,7 +45,7 @@ MODULE_LICENSE("GPL");
 #define GUILLEMOT_MAX_LENGTH	17	/* 17 bytes */
 #define GUILLEMOT_REFRESH_TIME	HZ/50	/* 20 ms */
 
-static short guillemot_abs_pad[] = 
+static short guillemot_abs_pad[] =
 	{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, -1 };
 
 static short guillemot_btn_pad[] =
@@ -160,7 +160,7 @@ static int guillemot_open(struct input_dev *dev)
 {
 	struct guillemot *guillemot = dev->private;
 	if (!guillemot->used++)
-		mod_timer(&guillemot->timer, jiffies + GUILLEMOT_REFRESH_TIME);	
+		mod_timer(&guillemot->timer, jiffies + GUILLEMOT_REFRESH_TIME);
 	return 0;
 }
 
@@ -211,7 +211,7 @@ static void guillemot_connect(struct gameport *gameport, struct gameport_dev *de
 	if (!guillemot_type[i].name) {
 		printk(KERN_WARNING "guillemot.c: Unknown joystick on %s. [ %02x%02x:%04x, ver %d.%02d ]\n",
 			gameport->phys, data[12], data[13], data[11], data[14], data[15]);
-		goto fail2;	
+		goto fail2;
 	}
 
 	sprintf(guillemot->phys, "%s/input0", gameport->phys);
@@ -237,7 +237,7 @@ static void guillemot_connect(struct gameport *gameport, struct gameport_dev *de
 		guillemot->dev.absmax[t] = 255;
 	}
 
-	if (guillemot->type->hat) 
+	if (guillemot->type->hat)
 		for (i = 0; i < 2; i++) {
 			t = ABS_HAT0X + i;
 			set_bit(t, guillemot->dev.absbit);
diff --git a/drivers/input/joystick/iforce/Kconfig b/drivers/input/joystick/iforce/Kconfig
index 8b0195748..2e964e5f5 100644
--- a/drivers/input/joystick/iforce/Kconfig
+++ b/drivers/input/joystick/iforce/Kconfig
@@ -17,7 +17,7 @@ config JOYSTICK_IFORCE_USB
 	depends on JOYSTICK_IFORCE && (JOYSTICK_IFORCE=m || USB=y) && USB
 	help
 	  Say Y here if you have an I-Force joystick or steering wheel
-	  connected to your USB port. 
+	  connected to your USB port.
 
 config JOYSTICK_IFORCE_232
 	bool "I-Force Serial joysticks and wheels"
diff --git a/drivers/input/joystick/iforce/Makefile b/drivers/input/joystick/iforce/Makefile
index 96a077172..17ae42bf9 100644
--- a/drivers/input/joystick/iforce/Makefile
+++ b/drivers/input/joystick/iforce/Makefile
@@ -7,14 +7,14 @@
 # Goal definition
 iforce-objs	:= iforce-ff.o iforce-main.o iforce-packets.o
 
-obj-$(CONFIG_JOYSTICK_IFORCE)	+= iforce.o 
+obj-$(CONFIG_JOYSTICK_IFORCE)	+= iforce.o
 
 ifeq ($(CONFIG_JOYSTICK_IFORCE_232),y)
-	iforce-objs += iforce-serio.o 
+	iforce-objs += iforce-serio.o
 endif
 
 ifeq ($(CONFIG_JOYSTICK_IFORCE_USB),y)
-	iforce-objs += iforce-usb.o 
+	iforce-objs += iforce-usb.o
 endif
 
 EXTRA_CFLAGS = -Werror-implicit-function-declaration
diff --git a/drivers/input/joystick/iforce/iforce-ff.c b/drivers/input/joystick/iforce/iforce-ff.c
index 267f92f0a..4678b6dab 100644
--- a/drivers/input/joystick/iforce/iforce-ff.c
+++ b/drivers/input/joystick/iforce/iforce-ff.c
@@ -195,7 +195,7 @@ static unsigned char find_button(struct iforce *iforce, signed short button)
 }
 
 /*
- * Analyse the changes in an effect, and tell if we need to send an condition 
+ * Analyse the changes in an effect, and tell if we need to send an condition
  * parameter packet
  */
 static int need_condition_modifier(struct iforce* iforce, struct ff_effect* new)
@@ -372,7 +372,7 @@ int iforce_upload_periodic(struct iforce* iforce, struct ff_effect* effect, int
 	int core_err = 0;
 
 	if (!is_update || need_period_modifier(iforce, effect)) {
-		param1_err = make_period_modifier(iforce, mod1_chunk, 
+		param1_err = make_period_modifier(iforce, mod1_chunk,
 			is_update,
 			effect->u.periodic.magnitude, effect->u.periodic.offset,
 			effect->u.periodic.period, effect->u.periodic.phase);
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
index c53e61acb..71cb7db75 100644
--- a/drivers/input/joystick/iforce/iforce-main.c
+++ b/drivers/input/joystick/iforce/iforce-main.c
@@ -166,7 +166,7 @@ static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect)
 	else {
 		/* We want to update an effect */
 		if (!CHECK_OWNERSHIP(effect->id, iforce)) return -EACCES;
-		
+
 		/* Parameter type cannot be updated */
 		if (effect->type != iforce->core_effects[effect->id].effect.type)
 			return -EINVAL;
@@ -273,7 +273,7 @@ static int iforce_flush(struct input_dev *dev, struct file *file)
 
 		if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags) &&
 			current->pid == iforce->core_effects[i].owner) {
-			
+
 			/* Stop effect */
 			input_report_ff(dev, i, 0);
 
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 0c37044ef..58728ebaa 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -56,7 +56,7 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
 	int empty;
 	int head, tail;
 	unsigned long flags;
-			
+
 /*
  * Update head and tail of xmit buffer
  */
@@ -108,7 +108,7 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
 		break;
 #endif
 #ifdef CONFIG_JOYSTICK_IFORCE_USB
-		case IFORCE_USB: 
+		case IFORCE_USB:
 
 		if (iforce->usbdev && empty &&
 			!test_and_set_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags)) {
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c
index e17c2e8a5..0665b5460 100644
--- a/drivers/input/joystick/iforce/iforce-serio.c
+++ b/drivers/input/joystick/iforce/iforce-serio.c
@@ -62,7 +62,7 @@ again:
 		cs ^= iforce->xmit.buf[iforce->xmit.tail];
 		XMIT_INC(iforce->xmit.tail, 1);
 	}
-	
+
 	serio_write(iforce->serio, cs);
 
 	if (test_and_clear_bit(IFORCE_XMIT_AGAIN, iforce->xmit_flags))
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
index 5b902522e..a8586abf5 100644
--- a/drivers/input/joystick/iforce/iforce.h
+++ b/drivers/input/joystick/iforce/iforce.h
@@ -141,7 +141,7 @@ struct iforce {
 	struct circ_buf xmit;
 	unsigned char xmit_data[XMIT_SIZE];
 	long xmit_flags[1];
-	
+
 					/* Force Feedback */
 	wait_queue_head_t wait;
 	struct resource device_memory;
diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c
index adc20ac50..b2d7cad81 100644
--- a/drivers/input/joystick/interact.c
+++ b/drivers/input/joystick/interact.c
@@ -63,7 +63,7 @@ struct interact {
 	char phys[32];
 };
 
-static short interact_abs_hhfx[] = 
+static short interact_abs_hhfx[] =
 	{ ABS_RX, ABS_RY, ABS_X, ABS_Y, ABS_HAT0X, ABS_HAT0Y, -1 };
 static short interact_abs_pp8d[] =
 	{ ABS_X, ABS_Y, -1 };
@@ -166,7 +166,7 @@ static void interact_timer(unsigned long private)
 			case INTERACT_TYPE_PP8D:
 
 				for (i = 0; i < 2; i++)
-					input_report_abs(dev, interact_abs_pp8d[i], 
+					input_report_abs(dev, interact_abs_pp8d[i],
 						((data[0] >> ((i << 1) + 20)) & 1)  - ((data[0] >> ((i << 1) + 21)) & 1));
 
 				for (i = 0; i < 8; i++)
@@ -190,7 +190,7 @@ static int interact_open(struct input_dev *dev)
 {
 	struct interact *interact = dev->private;
 	if (!interact->used++)
-		mod_timer(&interact->timer, jiffies + INTERACT_REFRESH_TIME);	
+		mod_timer(&interact->timer, jiffies + INTERACT_REFRESH_TIME);
 	return 0;
 }
 
@@ -242,7 +242,7 @@ static void interact_connect(struct gameport *gameport, struct gameport_dev *dev
 	if (!interact_type[i].length) {
 		printk(KERN_WARNING "interact.c: Unknown joystick on %s. [len %d d0 %08x d1 %08x i2 %08x]\n",
 			gameport->phys, i, data[0], data[1], data[2]);
-		goto fail2;	
+		goto fail2;
 	}
 
 	sprintf(interact->phys, "%s/input0", gameport->phys);
diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c
index 9f3bed21b..15962a684 100644
--- a/drivers/input/joystick/joydump.c
+++ b/drivers/input/joystick/joydump.c
@@ -12,18 +12,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -63,7 +63,7 @@ static void __devinit joydump_connect(struct gameport *gameport, struct gameport
 		printk(KERN_INFO "joydump: | Raw mode not available - trying cooked.    |\n");
 
 		if (gameport_open(gameport, dev, GAMEPORT_MODE_COOKED)) {
-			
+
 			printk(KERN_INFO "joydump: | Cooked not available either. Failing.      |\n");
 			printk(KERN_INFO "joydump: `-------------------- END -------------------'\n");
 			return;
diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c
index 992511d83..f326299b4 100644
--- a/drivers/input/joystick/magellan.c
+++ b/drivers/input/joystick/magellan.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  *  Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -159,7 +159,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
 
 	memset(magellan, 0, sizeof(struct magellan));
 
-	magellan->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
+	magellan->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 
 	for (i = 0; i < 9; i++)
 		set_bit(magellan_buttons[i], magellan->dev.keybit);
@@ -181,7 +181,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
 	magellan->dev.id.vendor = SERIO_MAGELLAN;
 	magellan->dev.id.product = 0x0001;
 	magellan->dev.id.version = 0x0100;
-	
+
 	serio->private = magellan;
 
 	if (serio_open(serio, dev)) {
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
index af8263e02..084643d58 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -176,19 +176,19 @@ static int sw_read_packet(struct gameport *gameport, unsigned char *buf, int len
 				buf[i] = v >> 5;		/* Store it */
 			i++;					/* Advance index */
 			bitout = strobe;			/* Extend timeout for next bit */
-		} 
+		}
 
 		if (kick && (~v & u & 0x01)) {			/* Falling edge on axis 0 */
 			sched = kick;				/* Schedule second trigger */
 			kick = 0;				/* Don't schedule next time on falling edge */
 			pending = 1;				/* Mark schedule */
-		} 
+		}
 
 		if (pending && sched < 0 && (i > -SW_END)) {	/* Second trigger time */
 			gameport_trigger(gameport);		/* Trigger */
 			bitout = start;				/* Long bit timeout */
 			pending = 0;				/* Unmark schedule */
-			timeout = 0;				/* Switch from global to bit timeouts */ 
+			timeout = 0;				/* Switch from global to bit timeouts */
 		}
 	}
 
@@ -482,14 +482,14 @@ static int sw_read(struct sw *sw)
 	sw_read_packet(sw->gameport, buf, SW_LENGTH, i);			/* Read ID packet, this initializes the stick */
 
 	sw->fail = SW_FAIL;
-	
+
 	return -1;
 }
 
 static void sw_timer(unsigned long private)
 {
 	struct sw *sw = (void *) private;
-	
+
 	sw->reads++;
 	if (sw_read(sw)) sw->bads++;
 	mod_timer(&sw->timer, jiffies + SW_REFRESH);
@@ -653,7 +653,7 @@ static void sw_connect(struct gameport *gameport, struct gameport_dev *dev)
 				case 60:
 					sw->number++;
 				case 45:				/* Ambiguous packet length */
-					if (j <= 40) {			/* ID length less or eq 40 -> FSP */	
+					if (j <= 40) {			/* ID length less or eq 40 -> FSP */
 				case 43:
 						sw->type = SW_ID_FSP;
 						break;
diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
index 4e288b58c..eb5b6f76c 100644
--- a/drivers/input/joystick/spaceball.c
+++ b/drivers/input/joystick/spaceball.c
@@ -15,18 +15,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  *  Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -59,8 +59,8 @@ MODULE_LICENSE("GPL");
 
 static int spaceball_axes[] = { ABS_X, ABS_Z, ABS_Y, ABS_RX, ABS_RZ, ABS_RY };
 static char *spaceball_names[] = {
-	"?", "SpaceTec SpaceBall 1003", "SpaceTec SpaceBall 2003", "SpaceTec SpaceBall 2003B", 
-	"SpaceTec SpaceBall 2003C", "SpaceTec SpaceBall 3003", "SpaceTec SpaceBall SpaceController", 
+	"?", "SpaceTec SpaceBall 1003", "SpaceTec SpaceBall 2003", "SpaceTec SpaceBall 2003B",
+	"SpaceTec SpaceBall 2003C", "SpaceTec SpaceBall 3003", "SpaceTec SpaceBall SpaceController",
 	"SpaceTec SpaceBall 3003C", "SpaceTec SpaceBall 4000FLX", "SpaceTec SpaceBall 4000FLX Lefty" };
 
 /*
@@ -96,7 +96,7 @@ static void spaceball_process_packet(struct spaceball* spaceball, struct pt_regs
 		case 'D':					/* Ball data */
 			if (spaceball->idx != 15) return;
 			for (i = 0; i < 6; i++)
-				input_report_abs(dev, spaceball_axes[i], 
+				input_report_abs(dev, spaceball_axes[i],
 					(__s16)((data[2 * i + 3] << 8) | data[2 * i + 2]));
 			break;
 
@@ -216,7 +216,7 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev)
 		return;
 	memset(spaceball, 0, sizeof(struct spaceball));
 
-	spaceball->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
+	spaceball->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 
 	switch (id) {
 		case SPACEBALL_4000FLX:
@@ -224,7 +224,7 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev)
 			spaceball->dev.keybit[LONG(BTN_0)] |= BIT(BTN_9);
 			spaceball->dev.keybit[LONG(BTN_A)] |= BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_MODE);
 		default:
-			spaceball->dev.keybit[LONG(BTN_0)] |= BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) 
+			spaceball->dev.keybit[LONG(BTN_0)] |= BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4)
 				| BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7) | BIT(BTN_8);
 		case SPACEBALL_3003C:
 			spaceball->dev.keybit[LONG(BTN_0)] |= BIT(BTN_1) | BIT(BTN_8);
@@ -251,7 +251,7 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev)
 	spaceball->dev.id.vendor = SERIO_SPACEBALL;
 	spaceball->dev.id.product = id;
 	spaceball->dev.id.version = 0x0100;
-	
+
 	serio->private = spaceball;
 
 	if (serio_open(serio, dev)) {
diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c
index 593dcac96..00da66c4b 100644
--- a/drivers/input/joystick/spaceorb.c
+++ b/drivers/input/joystick/spaceorb.c
@@ -2,7 +2,7 @@
  * $Id: spaceorb.c,v 1.15 2002/01/22 20:29:19 vojtech Exp $
  *
  *  Copyright (c) 1999-2001 Vojtech Pavlik
- * 
+ *
  *  Based on the work of:
  *  	David Thompson
  */
@@ -14,18 +14,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  *  Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -67,7 +67,7 @@ struct spaceorb {
 static unsigned char spaceorb_xor[] = "SpaceWare";
 
 static unsigned char *spaceorb_errors[] = { "EEPROM storing 0 failed", "Receive queue overflow", "Transmit queue timeout",
-		"Bad packet", "Power brown-out", "EEPROM checksum error", "Hardware fault" }; 
+		"Bad packet", "Power brown-out", "EEPROM checksum error", "Hardware fault" };
 
 /*
  * spaceorb_process_packet() decodes packets the driver receives from the
@@ -99,7 +99,7 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb, struct pt_regs *r
 
 		case 'D':				/* Ball + button data */
 			if (spaceorb->idx != 12) return;
-			for (i = 0; i < 9; i++) spaceorb->data[i+2] ^= spaceorb_xor[i]; 
+			for (i = 0; i < 9; i++) spaceorb->data[i+2] ^= spaceorb_xor[i];
 			axes[0] = ( data[2]	 << 3) | (data[ 3] >> 4);
 			axes[1] = ((data[3] & 0x0f) << 6) | (data[ 4] >> 1);
 			axes[2] = ((data[4] & 0x01) << 9) | (data[ 5] << 2) | (data[4] >> 5);
@@ -174,7 +174,7 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev)
 		return;
 	memset(spaceorb, 0, sizeof(struct spaceorb));
 
-	spaceorb->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
+	spaceorb->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 
 	for (i = 0; i < 6; i++)
 		set_bit(spaceorb_buttons[i], spaceorb->dev.keybit);
@@ -198,7 +198,7 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev)
 	spaceorb->dev.id.vendor = SERIO_SPACEORB;
 	spaceorb->dev.id.product = 0x0001;
 	spaceorb->dev.id.version = 0x0100;
-	
+
 	serio->private = spaceorb;
 
 	if (serio_open(serio, dev)) {
diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c
index f68d3add2..ce9be4563 100644
--- a/drivers/input/joystick/stinger.c
+++ b/drivers/input/joystick/stinger.c
@@ -147,7 +147,7 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
 
 	memset(stinger, 0, sizeof(struct stinger));
 
-	stinger->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
+	stinger->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 	stinger->dev.keybit[LONG(BTN_A)] = BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_X) | \
 					   BIT(BTN_Y) | BIT(BTN_Z) | BIT(BTN_TL) | BIT(BTN_TR) | \
 					   BIT(BTN_START) | BIT(BTN_SELECT);
@@ -164,8 +164,8 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
 	stinger->dev.id.version = 0x0100;
 
 	for (i = 0; i < 2; i++) {
-		stinger->dev.absmax[ABS_X+i] =  64;	
-		stinger->dev.absmin[ABS_X+i] = -64;	
+		stinger->dev.absmax[ABS_X+i] =  64;
+		stinger->dev.absmin[ABS_X+i] = -64;
 		stinger->dev.absflat[ABS_X+i] = 4;
 	}
 
diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c
index 93efe7520..6ed46ec46 100644
--- a/drivers/input/joystick/tmdc.c
+++ b/drivers/input/joystick/tmdc.c
@@ -4,7 +4,7 @@
  *  Copyright (c) 1998-2001 Vojtech Pavlik
  *
  *   Based on the work of:
- *	Trystan Larey-Williams 
+ *	Trystan Larey-Williams
  */
 
 /*
@@ -14,18 +14,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL");
 #define TMDC_BYTE_REV		11
 #define TMDC_BYTE_DEF		12
 
-#define TMDC_ABS		7	
+#define TMDC_ABS		7
 #define TMDC_ABS_HAT		4
 #define TMDC_BTN		16
 
@@ -104,7 +104,7 @@ struct tmdc {
 	unsigned char btno[2][4];
 	int used;
 	int reads;
-	int bads;	
+	int bads;
 	unsigned char exists;
 };
 
@@ -127,7 +127,7 @@ static int tmdc_read_packet(struct gameport *gameport, unsigned char data[2][TMD
 
 	local_irq_save(flags);
 	gameport_trigger(gameport);
-	
+
 	w = gameport_read(gameport) >> 4;
 
 	do {
@@ -148,7 +148,7 @@ static int tmdc_read_packet(struct gameport *gameport, unsigned char data[2][TMD
 				}
 				data[k][i[k]] |= (~v & 1) << (j[k]++ - 1);	/* Data bit */
 			}
-			t[k]--; 
+			t[k]--;
 		}
 	} while (t[0] > 0 || t[1] > 0);
 
@@ -175,7 +175,7 @@ static void tmdc_timer(unsigned long private)
 		bad = 1;
 	else
 
-	for (j = 0; j < 2; j++) 
+	for (j = 0; j < 2; j++)
 		if (r & (1 << j) & tmdc->exists) {
 
 			if (data[j][TMDC_BYTE_ID] != tmdc->mode[j]) {
@@ -227,7 +227,7 @@ static int tmdc_open(struct input_dev *dev)
 {
 	struct tmdc *tmdc = dev->private;
 	if (!tmdc->used++)
-		mod_timer(&tmdc->timer, jiffies + TMDC_REFRESH_TIME);	
+		mod_timer(&tmdc->timer, jiffies + TMDC_REFRESH_TIME);
 	return 0;
 }
 
@@ -356,7 +356,7 @@ static void tmdc_disconnect(struct gameport *gameport)
 	struct tmdc *tmdc = gameport->private;
 	int i;
 	for (i = 0; i < 2; i++)
-		if (tmdc->exists & (1 << i)) 
+		if (tmdc->exists & (1 << i))
 			input_unregister_device(tmdc->dev + i);
 	gameport_close(gameport);
 	kfree(tmdc);
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c
index 8cf86aa83..123ff5f9d 100644
--- a/drivers/input/joystick/turbografx.c
+++ b/drivers/input/joystick/turbografx.c
@@ -14,18 +14,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -65,7 +65,7 @@ __obsolete_setup("tgfx_3=");
 
 #define TGFX_TRIGGER		0x08
 #define TGFX_UP			0x10
-#define TGFX_DOWN		0x20	
+#define TGFX_DOWN		0x20
 #define TGFX_LEFT		0x40
 #define TGFX_RIGHT		0x80
 
@@ -126,7 +126,7 @@ static int tgfx_open(struct input_dev *dev)
         if (!tgfx->used++) {
 		parport_claim(tgfx->pd);
 		parport_write_control(tgfx->pd->port, 0x04);
-                mod_timer(&tgfx->timer, jiffies + TGFX_REFRESH_TIME); 
+                mod_timer(&tgfx->timer, jiffies + TGFX_REFRESH_TIME);
 	}
         return 0;
 }
@@ -173,7 +173,7 @@ static struct tgfx __init *tgfx_probe(int *config, int nargs)
 	memset(tgfx, 0, sizeof(struct tgfx));
 
 	tgfx->pd = parport_register_device(pp, "turbografx", NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL);
-		
+
 	parport_put_port(pp);
 
 	if (!tgfx->pd) {
@@ -210,7 +210,7 @@ static struct tgfx __init *tgfx_probe(int *config, int nargs)
 			tgfx->dev[i].absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
 
 			for (j = 0; j < config[i+1]; j++)
-				set_bit(tgfx_buttons[j], tgfx->dev[i].keybit); 
+				set_bit(tgfx_buttons[j], tgfx->dev[i].keybit);
 
 			tgfx->dev[i].absmin[ABS_X] = -1; tgfx->dev[i].absmax[ABS_X] = 1;
 			tgfx->dev[i].absmin[ABS_Y] = -1; tgfx->dev[i].absmax[ABS_Y] = 1;
@@ -225,7 +225,7 @@ static struct tgfx __init *tgfx_probe(int *config, int nargs)
 		kfree(tgfx);
 		return NULL;
         }
-		
+
 	return tgfx;
 }
 
@@ -245,7 +245,7 @@ void __exit tgfx_exit(void)
 {
 	int i, j;
 
-	for (i = 0; i < 3; i++) 
+	for (i = 0; i < 3; i++)
 		if (tgfx_base[i]) {
 			for (j = 0; j < 7; j++)
 				if (tgfx_base[i]->sticks & (1 << j))
diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c
index 8a98be150..eb5c935a6 100644
--- a/drivers/input/joystick/twidjoy.c
+++ b/drivers/input/joystick/twidjoy.c
@@ -58,6 +58,9 @@
 #include <linux/serio.h>
 #include <linux/init.h>
 
+MODULE_DESCRIPTION("Handykey Twiddler keyboard as a joystick driver");
+MODULE_LICENSE("GPL");
+
 /*
  * Constants.
  */
@@ -142,7 +145,7 @@ static void twidjoy_process_packet(struct twidjoy *twidjoy, struct pt_regs *regs
  * packet processing routine.
  */
 
-static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struc pt_regs *regs)
+static irqreturn_t twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct twidjoy *twidjoy = serio->private;
 
@@ -153,7 +156,7 @@ static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned
 	if ((data & 0x80) == 0)
 		twidjoy->idx = 0;	/* this byte starts a new packet */
 	else if (twidjoy->idx == 0)
-		return;			/* wrong MSB -- ignore this byte */
+		return IRQ_HANDLED;	/* wrong MSB -- ignore this byte */
 
 	if (twidjoy->idx < TWIDJOY_MAX_LENGTH)
 		twidjoy->data[twidjoy->idx++] = data;
@@ -163,7 +166,7 @@ static void twidjoy_interrupt(struct serio *serio, unsigned char data, unsigned
 		twidjoy->idx = 0;
 	}
 
-	return;
+	return IRQ_HANDLED;
 }
 
 /*
@@ -208,7 +211,7 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev)
 	twidjoy->dev.id.product = 0x0001;
 	twidjoy->dev.id.version = 0x0100;
 
-	twidjoy->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
+	twidjoy->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 
 	for (bp = twidjoy_buttons; bp->bitmask; bp++) {
 		for (i = 0; i < bp->bitmask; i++)
@@ -218,8 +221,8 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev)
 	twidjoy->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
 
 	for (i = 0; i < 2; i++) {
-		twidjoy->dev.absmax[ABS_X+i] =  50;	
-		twidjoy->dev.absmin[ABS_X+i] = -50;	
+		twidjoy->dev.absmax[ABS_X+i] =  50;
+		twidjoy->dev.absmin[ABS_X+i] = -50;
 
 		/* TODO: arndt 20010708: Are these values appropriate? */
 		twidjoy->dev.absfuzz[ABS_X+i] = 4;
diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
index 426ce2d5e..32ec90e81 100644
--- a/drivers/input/joystick/warrior.c
+++ b/drivers/input/joystick/warrior.c
@@ -11,18 +11,18 @@
 /*
  * This program is free warftware; 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  *  Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -44,7 +44,7 @@ MODULE_LICENSE("GPL");
  */
 
 #define WARRIOR_MAX_LENGTH	16
-static char warrior_lengths[] = { 0, 4, 12, 3, 4, 4, 0, 0 }; 
+static char warrior_lengths[] = { 0, 4, 12, 3, 4, 4, 0, 0 };
 static char *warrior_name = "Logitech WingMan Warrior";
 
 /*
@@ -114,7 +114,7 @@ static irqreturn_t warrior_interrupt(struct serio *serio,
 		warrior->data[warrior->idx++] = data;
 
 	if (warrior->idx == warrior->len) {
-		if (warrior->idx) warrior_process_packet(warrior, regs);	
+		if (warrior->idx) warrior_process_packet(warrior, regs);
 		warrior->idx = 0;
 		warrior->len = 0;
 	}
@@ -152,7 +152,7 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev)
 
 	memset(warrior, 0, sizeof(struct warrior));
 
-	warrior->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);	
+	warrior->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
 	warrior->dev.keybit[LONG(BTN_TRIGGER)] = BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) | BIT(BTN_TOP2);
 	warrior->dev.relbit[0] = BIT(REL_DIAL);
 	warrior->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_HAT0X) | BIT(ABS_HAT0Y);
@@ -168,24 +168,24 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev)
 	warrior->dev.id.version = 0x0100;
 
 	for (i = 0; i < 2; i++) {
-		warrior->dev.absmax[ABS_X+i] = -64;	
-		warrior->dev.absmin[ABS_X+i] =  64;	
-		warrior->dev.absflat[ABS_X+i] = 8;	
+		warrior->dev.absmax[ABS_X+i] = -64;
+		warrior->dev.absmin[ABS_X+i] =  64;
+		warrior->dev.absflat[ABS_X+i] = 8;
 	}
 
-	warrior->dev.absmax[ABS_THROTTLE] = -112;	
-	warrior->dev.absmin[ABS_THROTTLE] =  112;	
+	warrior->dev.absmax[ABS_THROTTLE] = -112;
+	warrior->dev.absmin[ABS_THROTTLE] =  112;
 
 	for (i = 0; i < 2; i++) {
-		warrior->dev.absmax[ABS_HAT0X+i] = -1;	
-		warrior->dev.absmin[ABS_HAT0X+i] =  1;	
+		warrior->dev.absmax[ABS_HAT0X+i] = -1;
+		warrior->dev.absmin[ABS_HAT0X+i] =  1;
 	}
 
 	warrior->dev.private = warrior;
-	
+
 	serio->private = warrior;
 
-	if (serio_open(serio, dev)) { 
+	if (serio_open(serio, dev)) {
 		kfree(warrior);
 		return;
 	}
diff --git a/drivers/input/keyboard/98kbd.c b/drivers/input/keyboard/98kbd.c
index 803df0db0..970a5ae1a 100644
--- a/drivers/input/keyboard/98kbd.c
+++ b/drivers/input/keyboard/98kbd.c
@@ -12,18 +12,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  */
 
 #include <linux/delay.h>
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
 #define KBD98_KEY	0x7f
 #define KBD98_RELEASE	0x80
 
-static unsigned char kbd98_keycode[256] = {	 
+static unsigned char kbd98_keycode[256] = {
 	  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 43, 14, 15,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 41, 26, 28, 30, 31, 32,
 	 33, 34, 35, 36, 37, 38, 39, 40, 27, 44, 45, 46, 47, 48, 49, 50,
@@ -109,8 +109,8 @@ struct kbd98 {
 	struct jis_kbd_conv jis[16];
 };
 
-void kbd98_interrupt(struct serio *serio, unsigned char data,
-			unsigned int flags, struct pt_regs *regs)
+irqreturn_t kbd98_interrupt(struct serio *serio, unsigned char data,
+			    unsigned int flags, struct pt_regs *regs)
 {
 	struct kbd98 *kbd98 = serio->private;
 	unsigned char scancode, keycode;
@@ -119,15 +119,15 @@ void kbd98_interrupt(struct serio *serio, unsigned char data,
 	switch (data) {
 		case KBD98_RET_ACK:
 			kbd98->ack = 1;
-			return;
+			goto out;
 		case KBD98_RET_NAK:
 			kbd98->ack = -1;
-			return;
+			goto out;
 	}
 
 	if (kbd98->cmdcnt) {
 		kbd98->cmdbuf[--kbd98->cmdcnt] = data;
-		return;
+		goto out;
 	}
 
 	scancode = data & KBD98_KEY;
@@ -164,7 +164,7 @@ void kbd98_interrupt(struct serio *serio, unsigned char data,
 
 			keycode = kbd98->jis[i].emul[kbd98->shift].keycode;
 			if (keycode == KBD98_KEY_NULL)
-				return;
+				break;
 
 			if (press) {
 				kbd98->emul.scancode = scancode;
@@ -187,27 +187,31 @@ void kbd98_interrupt(struct serio *serio, unsigned char data,
 			}
 
 			input_sync(&kbd98->dev);
-			return;
+			break;
 
 		case KEY_CAPSLOCK:
 			input_report_key(&kbd98->dev, keycode, 1);
 			input_sync(&kbd98->dev);
 			input_report_key(&kbd98->dev, keycode, 0);
 			input_sync(&kbd98->dev);
-			return;
+			break;
 
 		case KBD98_KEY_NULL:
-			return;
+			break;
 
 		case 0:
 			printk(KERN_WARNING "kbd98.c: Unknown key (scancode %#x) %s.\n",
 				data & KBD98_KEY, data & KBD98_RELEASE ? "released" : "pressed");
-			return;
+			break;
 
 		default:
 			input_report_key(&kbd98->dev, keycode, press);
 			input_sync(&kbd98->dev);
-		}
+			break;
+	}
+
+out:
+	return IRQ_HANDLED;
 }
 
 /*
@@ -243,7 +247,7 @@ static int kbd98_command(struct kbd98 *kbd98, unsigned char *param, int command)
 	int i;
 
 	kbd98->cmdcnt = receive;
-	
+
 	if (command & 0xff)
 		if (kbd98_sendbyte(kbd98, command & 0xff))
 			return (kbd98->cmdcnt = 0) - 1;
@@ -258,7 +262,7 @@ static int kbd98_command(struct kbd98 *kbd98, unsigned char *param, int command)
 		for (i = 0; i < receive; i++)
 			param[i] = kbd98->cmdbuf[(receive - 1) - i];
 
-	if (kbd98->cmdcnt) 
+	if (kbd98->cmdcnt)
 		return (kbd98->cmdcnt = 0) - 1;
 
 	return 0;
@@ -318,7 +322,7 @@ void kbd98_connect(struct serio *serio, struct serio_dev *dev)
 
 	memset(kbd98, 0, sizeof(struct kbd98));
 	kbd98->emul.scancode = KBD98_KEY_UNKNOWN;
-	
+
 	kbd98->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
 	kbd98->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_KANA);
 
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 36d32820d..45322b41a 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -62,7 +62,7 @@ config KEYBOARD_XTKBD
 	  Say Y here if you want to use the old IBM PC/XT keyboard (or
 	  compatible) on your system. This is only possible with a
 	  parallel port keyboard adapter, you cannot connect it to the
-	  keyboard port on a PC that runs Linux. 
+	  keyboard port on a PC that runs Linux.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called xtkbd.
@@ -92,7 +92,7 @@ config KEYBOARD_AMIGA
 	depends on AMIGA && INPUT && INPUT_KEYBOARD
 	help
 	  Say Y here if you are running Linux on any AMIGA and have a keyboard
-	  attached.	
+	  attached.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called amikbd.
@@ -103,7 +103,7 @@ config KEYBOARD_98KBD
 	select SERIO
 	help
 	  Say Y here if you want to use the NEC PC-9801/PC-9821 keyboard (or
-	  compatible) on your system. 
+	  compatible) on your system.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called 98kbd.
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 871440418..026fc13ea 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -26,7 +26,6 @@
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/workqueue.h>
-#include <linux/timer.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
@@ -173,22 +172,24 @@ struct atkbd {
 	unsigned char keycode[512];
 	struct input_dev dev;
 	struct serio *serio;
-	struct timer_list timer;
+
 	char name[64];
 	char phys[32];
+	unsigned short id;
+	unsigned char set;
+	unsigned int translated:1;
+	unsigned int extra:1;
+	unsigned int write:1;
+
 	unsigned char cmdbuf[4];
 	unsigned char cmdcnt;
-	unsigned char set;
-	unsigned char extra;
-	unsigned char release;
-	int lastkey;
 	volatile signed char ack;
 	unsigned char emul;
-	unsigned short id;
-	unsigned char write;
-	unsigned char translated;
-	unsigned char resend;
-	unsigned char bat_xl;
+	unsigned int resend:1;
+	unsigned int release:1;
+	unsigned int bat_xl:1;
+	unsigned int enabled:1;
+
 	unsigned int last;
 	unsigned long time;
 };
@@ -248,6 +249,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
 		goto out;
 	}
 
+	if (!atkbd->enabled)
+		goto out;
+
 	if (atkbd->translated) {
 
 		if (atkbd->emul ||
@@ -300,15 +304,20 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
 		case ATKBD_KEY_NULL:
 			break;
 		case ATKBD_KEY_UNKNOWN:
-			printk(KERN_WARNING "atkbd.c: Unknown key %s (%s set %d, code %#x on %s).\n",
-				atkbd->release ? "released" : "pressed",
-				atkbd->translated ? "translated" : "raw",
-				atkbd->set, code, serio->phys);
-			if (atkbd->translated && atkbd->set == 2 && code == 0x7a)
-				printk(KERN_WARNING "atkbd.c: This is an XFree86 bug. It shouldn't access"
-					" hardware directly.\n");
-			else
-				printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n",						code & 0x80 ? "e0" : "", code & 0x7f);
+			if (data == ATKBD_RET_ACK || data == ATKBD_RET_NAK) {
+				printk(KERN_WARNING "atkbd.c: Spurious %s on %s. Some program, "
+				       "like XFree86, might be trying access hardware directly.\n",
+				       data == ATKBD_RET_ACK ? "ACK" : "NAK", serio->phys);
+			} else {
+				printk(KERN_WARNING "atkbd.c: Unknown key %s "
+				       "(%s set %d, code %#x on %s).\n",
+				       atkbd->release ? "released" : "pressed",
+				       atkbd->translated ? "translated" : "raw",
+				       atkbd->set, code, serio->phys);
+				printk(KERN_WARNING "atkbd.c: Use 'setkeycodes %s%02x <keycode>' "
+				       "to make it known.\n",
+				       code & 0x80 ? "e0" : "", code & 0x7f);
+			}
 			break;
 		case ATKBD_SCR_1:
 			scroll = 1 - atkbd->release * 2;
@@ -745,6 +754,8 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
 		atkbd->id = 0xab00;
 	}
 
+	atkbd->enabled = 1;
+
 	if (atkbd->extra) {
 		atkbd->dev.ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC);
 		sprintf(atkbd->name, "AT Set 2 Extra keyboard");
@@ -809,12 +820,12 @@ static int atkbd_reconnect(struct serio *serio)
 		param[0] = (test_bit(LED_SCROLLL, atkbd->dev.led) ? 1 : 0)
 		         | (test_bit(LED_NUML,    atkbd->dev.led) ? 2 : 0)
  		         | (test_bit(LED_CAPSL,   atkbd->dev.led) ? 4 : 0);
-		
+
 		if (atkbd_probe(atkbd))
 			return -1;
 		if (atkbd->set != atkbd_set_3(atkbd))
 			return -1;
-		
+
 		atkbd_enable(atkbd);
 
 		if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c
index eb5fe4d83..859ed771e 100644
--- a/drivers/input/keyboard/maple_keyb.c
+++ b/drivers/input/keyboard/maple_keyb.c
@@ -139,7 +139,7 @@ static int dc_kbd_connect(struct maple_device *dev)
 
 	kbd->dev.name = dev->product_name;
 	kbd->dev.id.bustype = BUS_MAPLE;
-	
+
 	input_register_device(&kbd->dev);
 
 	maple_getcond_callback(dev, dc_kbd_callback, 1, MAPLE_FUNC_KEYBOARD);
diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
index d2f70364a..1bb8a57e2 100644
--- a/drivers/input/keyboard/sunkbd.c
+++ b/drivers/input/keyboard/sunkbd.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -148,7 +148,7 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c
 		case EV_LED:
 
 			sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED);
-			sunkbd->serio->write(sunkbd->serio, 
+			sunkbd->serio->write(sunkbd->serio,
 				(!!test_bit(LED_CAPSL, dev->led) << 3) | (!!test_bit(LED_SCROLLL, dev->led) << 2) |
 				(!!test_bit(LED_COMPOSE, dev->led) << 1) | !!test_bit(LED_NUML, dev->led));
 			return 0;
@@ -160,7 +160,7 @@ static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int c
 				case SND_CLICK:
 					sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_NOCLICK - value);
 					return 0;
-	
+
 				case SND_BELL:
 					sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_BELLOFF - value);
 					return 0;
@@ -210,7 +210,7 @@ static void sunkbd_reinit(void *data)
 	wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);
 
 	sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_SETLED);
-	sunkbd->serio->write(sunkbd->serio, 
+	sunkbd->serio->write(sunkbd->serio,
 		(!!test_bit(LED_CAPSL, sunkbd->dev.led) << 3) | (!!test_bit(LED_SCROLLL, sunkbd->dev.led) << 2) |
 		(!!test_bit(LED_COMPOSE, sunkbd->dev.led) << 1) | !!test_bit(LED_NUML, sunkbd->dev.led));
 	sunkbd->serio->write(sunkbd->serio, SUNKBD_CMD_NOCLICK - !!test_bit(SND_CLICK, sunkbd->dev.snd));
@@ -231,7 +231,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
 
 	if ((serio->type & SERIO_PROTO) && (serio->type & SERIO_PROTO) != SERIO_SUNKBD)
 		return;
-	
+
 	if (!(sunkbd = kmalloc(sizeof(struct sunkbd), GFP_KERNEL)))
 		return;
 
diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c
index 78847c60f..56adfa1cc 100644
--- a/drivers/input/keyboard/xtkbd.c
+++ b/drivers/input/keyboard/xtkbd.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
 #define XTKBD_KEY	0x7f
 #define XTKBD_RELEASE	0x80
 
-static unsigned char xtkbd_keycode[256] = {	 
+static unsigned char xtkbd_keycode[256] = {
 	  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
 	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
 	 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@@ -98,7 +98,7 @@ void xtkbd_connect(struct serio *serio, struct serio_dev *dev)
 		return;
 
 	memset(xtkbd, 0, sizeof(struct xtkbd));
-	
+
 	xtkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
 
 	xtkbd->serio = serio;
diff --git a/drivers/input/misc/98spkr.c b/drivers/input/misc/98spkr.c
index d50ac2a8a..cdb6c0d14 100644
--- a/drivers/input/misc/98spkr.c
+++ b/drivers/input/misc/98spkr.c
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/input.h>
+#include <asm/8253pit.h>
 #include <asm/io.h>
 
 MODULE_AUTHOR("Osamu Tomita <tomita@cinet.co.jp>");
@@ -41,11 +42,11 @@ static int spkr98_event(struct input_dev *dev, unsigned int type, unsigned int c
 		case SND_BELL: if (value) value = 1000;
 		case SND_TONE: break;
 		default: return -1;
-	} 
+	}
 
 	if (value > 20 && value < 32767)
-		count = CLOCK_TICK_RATE / value;
-	
+		count = PIT_TICK_RATE / value;
+
 	spin_lock_irqsave(&i8253_beep_lock, flags);
 
 	if (count) {
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 347660ca1..d31aaffa5 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -14,7 +14,7 @@ config INPUT_MISC
 
 config INPUT_PCSPKR
 	tristate "PC Speaker support"
-	depends on INPUT && INPUT_MISC
+	depends on (ALPHA || X86 || X86_64 || MIPS) && INPUT && INPUT_MISC
 	help
 	  Say Y here if you want the standard PC Speaker to be used for
 	  bells and whistles.
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index cfc821785..830d1c37c 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/input.h>
+#include <asm/8253pit.h>
 #include <asm/io.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
@@ -40,11 +41,11 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
 		case SND_BELL: if (value) value = 1000;
 		case SND_TONE: break;
 		default: return -1;
-	} 
+	}
 
 	if (value > 20 && value < 32767)
-		count = CLOCK_TICK_RATE / value;
-	
+		count = PIT_TICK_RATE / value;
+
 	spin_lock_irqsave(&i8253_beep_lock, flags);
 
 	if (count) {
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 6c5c08ded..6d793addf 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -53,11 +53,11 @@ static int ebus_spkr_event(struct input_dev *dev, unsigned int type, unsigned in
 		case SND_BELL: if (value) value = 1000;
 		case SND_TONE: break;
 		default: return -1;
-	} 
+	}
 
 	if (value > 20 && value < 32767)
 		count = 1193182 / value;
-	
+
 	spin_lock_irqsave(&beep_lock, flags);
 
 	/* EBUS speaker only has on/off state, the frequency does not
@@ -108,11 +108,11 @@ static int isa_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
 		case SND_BELL: if (value) value = 1000;
 		case SND_TONE: break;
 		default: return -1;
-	} 
+	}
 
 	if (value > 20 && value < 32767)
 		count = 1193182 / value;
-	
+
 	spin_lock_irqsave(&beep_lock, flags);
 
 	if (count) {
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index cc8c05b59..2e097dc66 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
- * 
+ *
  * Changes/Revisions:
  *	0.1	20/06/2002
  *		- first public version
@@ -68,7 +68,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff
 static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id)
 {
 	return 0;
-}					
+}
 
 static int uinput_create_device(struct uinput_device *udev)
 {
@@ -123,7 +123,7 @@ static int uinput_open(struct inode *inode, struct file *file)
 	memset(newinput, 0, sizeof(struct input_dev));
 
 	newdev->dev = newinput;
-	
+
 	file->private_data = newdev;
 
 	return 0;
@@ -137,16 +137,16 @@ static int uinput_validate_absbits(struct input_dev *dev)
 {
 	unsigned int cnt;
 	int retval = 0;
-	
+
 	for (cnt = 0; cnt < ABS_MAX; cnt++) {
-		if (!test_bit(cnt, dev->absbit)) 
+		if (!test_bit(cnt, dev->absbit))
 			continue;
-		
+
 		if (/*!dev->absmin[cnt] || !dev->absmax[cnt] || */
 		    (dev->absmax[cnt] <= dev->absmin[cnt])) {
-			printk(KERN_DEBUG 
+			printk(KERN_DEBUG
 				"%s: invalid abs[%02x] min:%d max:%d\n",
-				UINPUT_NAME, cnt, 
+				UINPUT_NAME, cnt,
 				dev->absmin[cnt], dev->absmax[cnt]);
 			retval = -EINVAL;
 			break;
@@ -154,7 +154,7 @@ static int uinput_validate_absbits(struct input_dev *dev)
 
 		if ((dev->absflat[cnt] < dev->absmin[cnt]) ||
 		    (dev->absflat[cnt] > dev->absmax[cnt])) {
-			printk(KERN_DEBUG 
+			printk(KERN_DEBUG
 				"%s: absflat[%02x] out of range: %d "
 				"(min:%d/max:%d)\n",
 				UINPUT_NAME, cnt, dev->absflat[cnt],
@@ -190,7 +190,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
 		goto exit;
 	}
 
-	if (NULL != dev->name) 
+	if (NULL != dev->name)
 		kfree(dev->name);
 
 	size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;
@@ -229,7 +229,7 @@ exit:
 static ssize_t uinput_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
 {
 	struct uinput_device	*udev = file->private_data;
-	
+
 	if (test_bit(UIST_CREATED, &(udev->state))) {
 		struct input_event	ev;
 
@@ -247,7 +247,7 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
 {
 	struct uinput_device *udev = file->private_data;
 	int retval = 0;
-	
+
 	if (!test_bit(UIST_CREATED, &(udev->state)))
 		return -ENODEV;
 
@@ -255,16 +255,16 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
 		return -EAGAIN;
 
 	retval = wait_event_interruptible(udev->waitq,
-			(udev->head != udev->tail) || 
+			(udev->head != udev->tail) ||
 			!test_bit(UIST_CREATED, &(udev->state)));
-	
+
 	if (retval)
 		return retval;
 
 	if (!test_bit(UIST_CREATED, &(udev->state)))
 		return -ENODEV;
 
-	while ((udev->head != udev->tail) && 
+	while ((udev->head != udev->tail) &&
 	    (retval + sizeof(struct input_event) <= count)) {
 		if (copy_to_user(buffer + retval, &(udev->buff[udev->tail]),
 		    sizeof(struct input_event))) return -EFAULT;
@@ -284,7 +284,7 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait)
 	if (udev->head != udev->tail)
 		return POLLIN | POLLRDNORM;
 
-	return 0;			
+	return 0;
 }
 
 static int uinput_burn_device(struct uinput_device *udev)
@@ -318,7 +318,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		case UI_DEV_CREATE:
 			retval = uinput_create_device(udev);
 			break;
-			
+
 		case UI_DEV_DESTROY:
 			retval = uinput_destroy_device(udev);
 			break;
@@ -330,7 +330,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->evbit);
 			break;
-			
+
 		case UI_SET_KEYBIT:
 			if (arg > KEY_MAX) {
 				retval = -EINVAL;
@@ -338,7 +338,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->keybit);
 			break;
-			
+
 		case UI_SET_RELBIT:
 			if (arg > REL_MAX) {
 				retval = -EINVAL;
@@ -346,7 +346,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->relbit);
 			break;
-			
+
 		case UI_SET_ABSBIT:
 			if (arg > ABS_MAX) {
 				retval = -EINVAL;
@@ -354,7 +354,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->absbit);
 			break;
-			
+
 		case UI_SET_MSCBIT:
 			if (arg > MSC_MAX) {
 				retval = -EINVAL;
@@ -362,7 +362,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->mscbit);
 			break;
-			
+
 		case UI_SET_LEDBIT:
 			if (arg > LED_MAX) {
 				retval = -EINVAL;
@@ -370,7 +370,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->ledbit);
 			break;
-			
+
 		case UI_SET_SNDBIT:
 			if (arg > SND_MAX) {
 				retval = -EINVAL;
@@ -378,7 +378,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->sndbit);
 			break;
-			
+
 		case UI_SET_FFBIT:
 			if (arg > FF_MAX) {
 				retval = -EINVAL;
@@ -386,7 +386,7 @@ static int uinput_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			set_bit(arg, udev->dev->ffbit);
 			break;
-			
+
 		default:
 			retval = -EFAULT;
 	}
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
index 846b5e880..0063af037 100644
--- a/drivers/input/mouse/logips2pp.c
+++ b/drivers/input/mouse/logips2pp.c
@@ -14,6 +14,25 @@
 #include "psmouse.h"
 #include "logips2pp.h"
 
+/* Logitech mouse types */
+#define PS2PP_KIND_WHEEL	1
+#define PS2PP_KIND_MX		2
+#define PS2PP_KIND_TP3		3
+
+/* Logitech mouse features */
+#define PS2PP_WHEEL		0x01
+#define PS2PP_HWHEEL		0x02
+#define PS2PP_SIDE_BTN		0x04
+#define PS2PP_EXTRA_BTN		0x08
+#define PS2PP_TASK_BTN		0x10
+#define PS2PP_NAV_BTN		0x20
+
+struct ps2pp_info {
+	const int model;
+	unsigned const int kind;
+	unsigned const int features;
+};
+
 /*
  * Process a PS2++ or PS2T++ packet.
  */
@@ -63,7 +82,6 @@ void ps2pp_process_packet(struct psmouse *psmouse)
 		packet[0] &= 0x0f;
 		packet[1] = 0;
 		packet[2] = 0;
-
 	}
 }
 
@@ -76,18 +94,9 @@ void ps2pp_process_packet(struct psmouse *psmouse)
 
 static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned char command)
 {
-	unsigned char d;
-	int i;
-
-	if (psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11))
+	if (psmouse_sliced_command(psmouse, command))
 		return -1;
 
-	for (i = 6; i >= 0; i -= 2) {
-		d = (command >> i) & 3;
-		if(psmouse_command(psmouse, &d, PSMOUSE_CMD_SETRES))
-			return -1;
-	}
-
 	if (psmouse_command(psmouse, param, PSMOUSE_CMD_POLL))
 		return -1;
 
@@ -99,7 +108,7 @@ static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned cha
  * enabled if we do nothing to it. Of course I put this in because I want it
  * disabled :P
  * 1 - enabled (if previously disabled, also default)
- * 0/2 - disabled 
+ * 0/2 - disabled
  */
 
 static void ps2pp_set_smartscroll(struct psmouse *psmouse)
@@ -113,14 +122,11 @@ static void ps2pp_set_smartscroll(struct psmouse *psmouse)
 	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
 	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
 
-	if (psmouse_smartscroll == 1) 
-		param[0] = 1;
-	else
-	if (psmouse_smartscroll > 2)
-		return;
-
-	/* else leave param[0] == 0 to disable */
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	if (psmouse_smartscroll < 2) {
+		/* 0 - disabled, 1 - enabled */
+		param[0] = psmouse_smartscroll;
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	}
 }
 
 /*
@@ -138,133 +144,167 @@ void ps2pp_set_800dpi(struct psmouse *psmouse)
 	psmouse_command(psmouse, &param, PSMOUSE_CMD_SETRES);
 }
 
+static struct ps2pp_info *get_model_info(unsigned char model)
+{
+	static struct ps2pp_info ps2pp_list[] = {
+		{ 12,	0,			PS2PP_SIDE_BTN},
+		{ 13,	0,			0 },
+		{ 40,	0,			PS2PP_SIDE_BTN },
+		{ 41,	0,			PS2PP_SIDE_BTN },
+		{ 42,	0,			PS2PP_SIDE_BTN },
+		{ 43,	0,			PS2PP_SIDE_BTN },
+		{ 50,	0,			0 },
+		{ 51,	0,			0 },
+		{ 52,	PS2PP_KIND_WHEEL,	PS2PP_SIDE_BTN | PS2PP_WHEEL },
+		{ 53,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
+		{ 61,	PS2PP_KIND_MX,
+				PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
+				PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },	/* MX700 */
+		{ 73,	0,			PS2PP_SIDE_BTN },
+		{ 75,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
+		{ 76,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
+		{ 80,	PS2PP_KIND_WHEEL,	PS2PP_SIDE_BTN | PS2PP_WHEEL },
+		{ 81,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
+		{ 83,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
+		{ 88,	PS2PP_KIND_WHEEL,	PS2PP_WHEEL },
+		{ 96,	0,			0 },
+		{ 97,	PS2PP_KIND_TP3,		PS2PP_WHEEL | PS2PP_HWHEEL },
+		{ 100,	PS2PP_KIND_MX,
+				PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
+				PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },	/* MX510 */
+		{ 112,	PS2PP_KIND_MX,
+				PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
+				PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },	/* MX500 */
+		{ 114,	PS2PP_KIND_MX,
+				PS2PP_WHEEL | PS2PP_SIDE_BTN |
+				PS2PP_TASK_BTN | PS2PP_EXTRA_BTN },	/* M310 */
+		{ }
+	};
+	int i;
+
+	for (i = 0; ps2pp_list[i].model; i++)
+		if (model == ps2pp_list[i].model)
+			return &ps2pp_list[i];
+	return NULL;
+}
+
 /*
- * Detect the exact model and features of a PS2++ or PS2T++ Logitech mouse or
- * touchpad.
+ * Set up input device's properties based on the detected mouse model.
  */
 
-static int ps2pp_detect_model(struct psmouse *psmouse, unsigned char *param)
+static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_info *model_info)
 {
-	int i;
-	static struct _logips2_list {
-		const int model;
-		unsigned const int features;
-	} logips2pp_list [] = {
-		{ 12,	PS2PP_4BTN},
-		{ 13,	0 },
-		{ 40,	PS2PP_4BTN },
-		{ 41,	PS2PP_4BTN },
-		{ 42,	PS2PP_4BTN },
-		{ 43,	PS2PP_4BTN },
-		{ 50,	0 },
-		{ 51,	0 },
-		{ 52,	PS2PP_4BTN | PS2PP_WHEEL },
-		{ 53,	PS2PP_WHEEL },
-		{ 61,	PS2PP_WHEEL | PS2PP_MX },	/* MX700 */
-		{ 73,	PS2PP_4BTN },
-		{ 75,	PS2PP_WHEEL },
-		{ 76,	PS2PP_WHEEL },
-		{ 80,	PS2PP_4BTN | PS2PP_WHEEL },
-		{ 81,	PS2PP_WHEEL },
-		{ 83,	PS2PP_WHEEL },
-		{ 88,	PS2PP_WHEEL },
-		{ 96,	0 },
-		{ 97,	0 },
-		{ 100 ,	PS2PP_WHEEL | PS2PP_MX },	/* MX510 */
-		{ 112 ,	PS2PP_WHEEL | PS2PP_MX },	/* MX500 */
-		{ 114 ,	PS2PP_WHEEL | PS2PP_MX | PS2PP_MX310 },	/* MX310 */
-		{ }
-	};
+	if (model_info->features & PS2PP_SIDE_BTN)
+		set_bit(BTN_SIDE, psmouse->dev.keybit);
+
+	if (model_info->features & PS2PP_EXTRA_BTN)
+		set_bit(BTN_EXTRA, psmouse->dev.keybit);
 
-	psmouse->vendor = "Logitech";
-	psmouse->model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
+	if (model_info->features & PS2PP_TASK_BTN)
+		set_bit(BTN_TASK, psmouse->dev.keybit);
 
-	if (param[1] < 3)
-		clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
-	if (param[1] < 2)
-		clear_bit(BTN_RIGHT, psmouse->dev.keybit);
+	if (model_info->features & PS2PP_NAV_BTN) {
+		set_bit(BTN_FORWARD, psmouse->dev.keybit);
+		set_bit(BTN_BACK, psmouse->dev.keybit);
+	}
 
-	psmouse->type = PSMOUSE_PS2;
+	if (model_info->features & PS2PP_WHEEL)
+		set_bit(REL_WHEEL, psmouse->dev.relbit);
 
-	for (i = 0; logips2pp_list[i].model; i++){
-		if (logips2pp_list[i].model == psmouse->model){
-			psmouse->type = PSMOUSE_PS2PP;
-			if (logips2pp_list[i].features & PS2PP_4BTN)
-				set_bit(BTN_SIDE, psmouse->dev.keybit);
+	if (model_info->features & PS2PP_HWHEEL)
+		set_bit(REL_HWHEEL, psmouse->dev.relbit);
 
-			if (logips2pp_list[i].features & PS2PP_WHEEL){
-				set_bit(REL_WHEEL, psmouse->dev.relbit);
-				psmouse->name = "Wheel Mouse";
-			}
-			if (logips2pp_list[i].features & PS2PP_MX) {
-				set_bit(BTN_SIDE, psmouse->dev.keybit);
-				set_bit(BTN_EXTRA, psmouse->dev.keybit);
-				set_bit(BTN_TASK, psmouse->dev.keybit);
-				if (!(logips2pp_list[i].features & PS2PP_MX310)){
-					set_bit(BTN_BACK, psmouse->dev.keybit);
-					set_bit(BTN_FORWARD, psmouse->dev.keybit);
-				}
-				psmouse->name = "MX Mouse";
-			}
+	switch (model_info->kind) {
+		case PS2PP_KIND_WHEEL:
+			psmouse->name = "Wheel Mouse";
+			break;
+
+		case PS2PP_KIND_MX:
+			psmouse->name = "MX Mouse";
+			break;
+
+		case PS2PP_KIND_TP3:
+			psmouse->name = "TouchPad 3";
 			break;
-		}
 	}
+}
+
+
 /*
- * Do Logitech PS2++ / PS2T++ magic init.
+ * Logitech magic init. Detect whether the mouse is a Logitech one
+ * and its exact model and try turning on extended protocol for ones
+ * that support it.
  */
-	if (psmouse->type == PSMOUSE_PS2PP) {
 
-		if (psmouse->model == 97) { /* TouchPad 3 */
+int ps2pp_init(struct psmouse *psmouse, int set_properties)
+{
+	unsigned char param[4];
+	unsigned char protocol = PSMOUSE_PS2;
+	unsigned char model, buttons;
+	struct ps2pp_info *model_info;
+
+	param[0] = 0;
+	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+	param[1] = 0;
+	psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+
+	if (param[1] != 0) {
+		model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
+		buttons = param[1];
+		model_info = get_model_info(model);
 
-			set_bit(REL_WHEEL, psmouse->dev.relbit);
-			set_bit(REL_HWHEEL, psmouse->dev.relbit);
+/*
+ * Do Logitech PS2++ / PS2T++ magic init.
+ */
+		if (model == 97) { /* Touch Pad 3 */
 
-			param[0] = 0x11; param[1] = 0x04; param[2] = 0x68; /* Unprotect RAM */
+			/* Unprotect RAM */
+			param[0] = 0x11; param[1] = 0x04; param[2] = 0x68;
 			psmouse_command(psmouse, param, 0x30d1);
-			param[0] = 0x11; param[1] = 0x05; param[2] = 0x0b; /* Enable features */
+			/* Enable features */
+			param[0] = 0x11; param[1] = 0x05; param[2] = 0x0b;
 			psmouse_command(psmouse, param, 0x30d1);
-			param[0] = 0x11; param[1] = 0x09; param[2] = 0xc3; /* Enable PS2++ */
+			/* Enable PS2++ */
+			param[0] = 0x11; param[1] = 0x09; param[2] = 0xc3;
 			psmouse_command(psmouse, param, 0x30d1);
 
 			param[0] = 0;
 			if (!psmouse_command(psmouse, param, 0x13d1) &&
-				param[0] == 0x06 && param[1] == 0x00 && param[2] == 0x14) {
-				psmouse->name = "TouchPad 3";
-				return PSMOUSE_PS2TPP;
+			    param[0] == 0x06 && param[1] == 0x00 && param[2] == 0x14) {
+				protocol = PSMOUSE_PS2TPP;
 			}
 
-		} else {
+		} else if (get_model_info(model) != NULL) {
 
 			param[0] = param[1] = param[2] = 0;
 			ps2pp_cmd(psmouse, param, 0x39); /* Magic knock */
 			ps2pp_cmd(psmouse, param, 0xDB);
 
-			if ((param[0] & 0x78) == 0x48 && (param[1] & 0xf3) == 0xc2 &&
-				(param[2] & 3) == ((param[1] >> 2) & 3)) {
-					ps2pp_set_smartscroll(psmouse);
-					return PSMOUSE_PS2PP;
+			if ((param[0] & 0x78) == 0x48 &&
+			    (param[1] & 0xf3) == 0xc2 &&
+			    (param[2] & 0x03) == ((param[1] >> 2) & 3)) {
+				ps2pp_set_smartscroll(psmouse);
+				protocol = PSMOUSE_PS2PP;
 			}
 		}
-	}
 
-	return 0;
-}
+		if (set_properties) {
+			psmouse->vendor = "Logitech";
+			psmouse->model = model;
 
-/*
- * Logitech magic init.
- */
-int ps2pp_detect(struct psmouse *psmouse)
-{
-	unsigned char param[4];
+			if (buttons < 3)
+				clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
+			if (buttons < 2)
+				clear_bit(BTN_RIGHT, psmouse->dev.keybit);
 
-	param[0] = 0;
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	param[1] = 0;
-	psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+			if (model_info)
+				ps2pp_set_model_properties(psmouse, model_info);
+		}
+	}
 
-	return param[1] != 0 ? ps2pp_detect_model(psmouse, param) : 0;
+	return protocol;
 }
 
diff --git a/drivers/input/mouse/logips2pp.h b/drivers/input/mouse/logips2pp.h
index d5e05defe..959743a9e 100644
--- a/drivers/input/mouse/logips2pp.h
+++ b/drivers/input/mouse/logips2pp.h
@@ -11,13 +11,8 @@
 #ifndef _LOGIPS2PP_H
 #define _LOGIPS2PP_H
 
-#define PS2PP_4BTN	0x01
-#define PS2PP_WHEEL	0x02
-#define PS2PP_MX	0x04
-#define PS2PP_MX310	0x08
-
-struct psmouse;
 void ps2pp_process_packet(struct psmouse *psmouse);
 void ps2pp_set_800dpi(struct psmouse *psmouse);
-int ps2pp_detect(struct psmouse *psmouse);
+int ps2pp_init(struct psmouse *psmouse, int set_properties);
+
 #endif
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 3d4a30060..0b3826724 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -43,9 +43,9 @@ int psmouse_smartscroll = 1;
 module_param_named(smartscroll, psmouse_smartscroll, bool, 0);
 MODULE_PARM_DESC(smartscroll, "Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled.");
 
-unsigned int psmouse_resetafter;
+static unsigned int psmouse_resetafter;
 module_param_named(resetafter, psmouse_resetafter, uint, 0);
-MODULE_PARM_DESC(resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never).");
+MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never).");
 
 __obsolete_setup("psmouse_noext");
 __obsolete_setup("psmouse_resolution=");
@@ -56,15 +56,22 @@ __obsolete_setup("psmouse_rate=");
 static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2"};
 
 /*
- * psmouse_process_packet() analyzes the PS/2 mouse packet contents and
- * reports relevant events to the input module.
+ * psmouse_process_byte() analyzes the PS/2 data stream and reports
+ * relevant events to the input module once full packet has arrived.
  */
 
-static void psmouse_process_packet(struct psmouse *psmouse, struct pt_regs *regs)
+static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
 {
 	struct input_dev *dev = &psmouse->dev;
 	unsigned char *packet = psmouse->packet;
 
+	if (psmouse->pktcnt < 3 + (psmouse->type >= PSMOUSE_GENPS))
+		return PSMOUSE_GOOD_DATA;
+
+/*
+ * Full packet accumulated, process it
+ */
+
 	input_regs(dev, regs);
 
 /*
@@ -112,6 +119,8 @@ static void psmouse_process_packet(struct psmouse *psmouse, struct pt_regs *regs
 	input_report_rel(dev, REL_Y, packet[2] ? (int) ((packet[0] << 3) & 0x100) - (int) packet[2] : 0);
 
 	input_sync(dev);
+
+	return PSMOUSE_FULL_PACKET;
 }
 
 /*
@@ -123,6 +132,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
 		unsigned char data, unsigned int flags, struct pt_regs *regs)
 {
 	struct psmouse *psmouse = serio->private;
+	psmouse_ret_t rc;
 
 	if (psmouse->state == PSMOUSE_IGNORE)
 		goto out;
@@ -180,7 +190,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
 		if (psmouse->pktcnt == 2) {
 			if (psmouse->packet[1] == PSMOUSE_RET_ID) {
 				psmouse->state = PSMOUSE_IGNORE;
-				serio_rescan(serio);
+				serio_reconnect(serio);
 				goto out;
 			}
 			if (psmouse->type == PSMOUSE_SYNAPTICS) {
@@ -193,19 +203,32 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
 		}
 	}
 
-	if (psmouse->type == PSMOUSE_SYNAPTICS) {
-		/*
-		 * The synaptics driver has its own resync logic,
-		 * so it needs to receive all bytes one at a time.
-		 */
-		synaptics_process_byte(psmouse, regs);
-		goto out;
-	}
+	rc = psmouse->protocol_handler(psmouse, regs);
 
-	if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
-		psmouse_process_packet(psmouse, regs);
-		psmouse->pktcnt = 0;
-		goto out;
+	switch (rc) {
+		case PSMOUSE_BAD_DATA:
+			printk(KERN_WARNING "psmouse.c: %s at %s lost sync at byte %d\n",
+				psmouse->name, psmouse->phys, psmouse->pktcnt);
+			psmouse->pktcnt = 0;
+
+			if (++psmouse->out_of_sync == psmouse_resetafter) {
+				psmouse->state = PSMOUSE_IGNORE;
+				printk(KERN_NOTICE "psmouse.c: issuing reconnect request\n");
+				serio_reconnect(psmouse->serio);
+			}
+			break;
+
+		case PSMOUSE_FULL_PACKET:
+			psmouse->pktcnt = 0;
+			if (psmouse->out_of_sync) {
+				psmouse->out_of_sync = 0;
+				printk(KERN_NOTICE "psmouse.c: %s at %s - driver resynched.\n",
+					psmouse->name, psmouse->phys);
+			}
+			break;
+
+		case PSMOUSE_GOOD_DATA:
+			break;
 	}
 out:
 	return IRQ_HANDLED;
@@ -288,6 +311,30 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
 }
 
 
+/*
+ * psmouse_sliced_command() sends an extended PS/2 command to the mouse
+ * using sliced syntax, understood by advanced devices, such as Logitech
+ * or Synaptics touchpads. The command is encoded as:
+ * 0xE6 0xE8 rr 0xE8 ss 0xE8 tt 0xE8 uu where (rr*64)+(ss*16)+(tt*4)+uu
+ * is the command.
+ */
+int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command)
+{
+	int i;
+
+	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11))
+		return -1;
+
+	for (i = 6; i >= 0; i -= 2) {
+		unsigned char d = (command >> i) & 3;
+		if (psmouse_command(psmouse, &d, PSMOUSE_CMD_SETRES))
+			return -1;
+	}
+
+	return 0;
+}
+
+
 /*
  * psmouse_reset() resets the mouse into power-on state.
  */
@@ -363,31 +410,31 @@ static int im_explorer_detect(struct psmouse *psmouse)
  * the mouse may have.
  */
 
-static int psmouse_extensions(struct psmouse *psmouse)
+static int psmouse_extensions(struct psmouse *psmouse,
+			      unsigned int max_proto, int set_properties)
 {
 	int synaptics_hardware = 0;
 
-	psmouse->vendor = "Generic";
-	psmouse->name = "Mouse";
-	psmouse->model = 0;
-
 /*
  * Try Synaptics TouchPad
  */
-	if (psmouse_max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse)) {
+	if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse)) {
 		synaptics_hardware = 1;
-		psmouse->vendor = "Synaptics";
-		psmouse->name = "TouchPad";
 
-		if (psmouse_max_proto > PSMOUSE_IMEX) {
-			if (synaptics_init(psmouse) == 0)
+		if (set_properties) {
+			psmouse->vendor = "Synaptics";
+			psmouse->name = "TouchPad";
+		}
+
+		if (max_proto > PSMOUSE_IMEX) {
+			if (!set_properties || synaptics_init(psmouse) == 0)
 				return PSMOUSE_SYNAPTICS;
 /*
  * Some Synaptics touchpads can emulate extended protocols (like IMPS/2).
  * Unfortunately Logitech/Genius probes confuse some firmware versions so
  * we'll have to skip them.
  */
-			psmouse_max_proto = PSMOUSE_IMEX;
+			max_proto = PSMOUSE_IMEX;
 		}
 /*
  * Make sure that touchpad is in relative mode, gestures (taps) are enabled
@@ -395,35 +442,46 @@ static int psmouse_extensions(struct psmouse *psmouse)
 		synaptics_reset(psmouse);
 	}
 
-	if (psmouse_max_proto > PSMOUSE_IMEX && genius_detect(psmouse)) {
-		set_bit(BTN_EXTRA, psmouse->dev.keybit);
-		set_bit(BTN_SIDE, psmouse->dev.keybit);
-		set_bit(REL_WHEEL, psmouse->dev.relbit);
+	if (max_proto > PSMOUSE_IMEX && genius_detect(psmouse)) {
+
+		if (set_properties) {
+			set_bit(BTN_EXTRA, psmouse->dev.keybit);
+			set_bit(BTN_SIDE, psmouse->dev.keybit);
+			set_bit(REL_WHEEL, psmouse->dev.relbit);
+			psmouse->vendor = "Genius";
+			psmouse->name = "Wheel Mouse";
+		}
 
-		psmouse->vendor = "Genius";
-		psmouse->name = "Wheel Mouse";
 		return PSMOUSE_GENPS;
 	}
 
-	if (psmouse_max_proto > PSMOUSE_IMEX) {
-		int type = ps2pp_detect(psmouse);
-		if (type)
+	if (max_proto > PSMOUSE_IMEX) {
+		int type = ps2pp_init(psmouse, set_properties);
+		if (type > PSMOUSE_PS2)
 			return type;
 	}
 
-	if (psmouse_max_proto >= PSMOUSE_IMPS && intellimouse_detect(psmouse)) {
-		set_bit(REL_WHEEL, psmouse->dev.relbit);
+	if (max_proto >= PSMOUSE_IMEX && im_explorer_detect(psmouse)) {
 
-		if (psmouse_max_proto >= PSMOUSE_IMEX &&
-					im_explorer_detect(psmouse)) {
+		if (set_properties) {
+			set_bit(REL_WHEEL, psmouse->dev.relbit);
 			set_bit(BTN_SIDE, psmouse->dev.keybit);
 			set_bit(BTN_EXTRA, psmouse->dev.keybit);
+			if (!psmouse->name)
+				psmouse->name = "Explorer Mouse";
+		}
+
+		return PSMOUSE_IMEX;
+	}
+
+	if (max_proto >= PSMOUSE_IMPS && intellimouse_detect(psmouse)) {
 
-			psmouse->name = "Explorer Mouse";
-			return PSMOUSE_IMEX;
+		if (set_properties) {
+			set_bit(REL_WHEEL, psmouse->dev.relbit);
+			if (!psmouse->name)
+				psmouse->name = "Wheel Mouse";
 		}
 
-		psmouse->name = "Wheel Mouse";
 		return PSMOUSE_IMPS;
 	}
 
@@ -473,12 +531,7 @@ static int psmouse_probe(struct psmouse *psmouse)
 	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_RESET_DIS))
 		printk(KERN_WARNING "psmouse.c: Failed to reset mouse on %s\n", psmouse->serio->phys);
 
-/*
- * And here we try to determine if it has any extensions over the
- * basic PS/2 3-button mouse.
- */
-
-	return psmouse->type = psmouse_extensions(psmouse);
+	return 0;
 }
 
 /*
@@ -616,7 +669,6 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
 	psmouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
 	psmouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
 	psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
-
 	psmouse->state = PSMOUSE_CMD_MODE;
 	psmouse->serio = serio;
 	psmouse->dev.private = psmouse;
@@ -628,13 +680,21 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
 		return;
 	}
 
-	if (psmouse_probe(psmouse) <= 0) {
+	if (psmouse_probe(psmouse) < 0) {
 		serio_close(serio);
 		kfree(psmouse);
 		serio->private = NULL;
 		return;
 	}
 
+	psmouse->type = psmouse_extensions(psmouse, psmouse_max_proto, 1);
+	if (!psmouse->vendor)
+		psmouse->vendor = "Generic";
+	if (!psmouse->name)
+		psmouse->name = "Mouse";
+	if (!psmouse->protocol_handler)
+		psmouse->protocol_handler = psmouse_process_byte;
+
 	sprintf(psmouse->devname, "%s %s %s",
 		psmouse_protocols[psmouse->type], psmouse->vendor, psmouse->name);
 	sprintf(psmouse->phys, "%s/input0",
@@ -668,27 +728,24 @@ static int psmouse_reconnect(struct serio *serio)
 {
 	struct psmouse *psmouse = serio->private;
 	struct serio_dev *dev = serio->dev;
-	int old_type;
 
 	if (!dev || !psmouse) {
 		printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n");
 		return -1;
 	}
 
-	old_type = psmouse->type;
-
 	psmouse->state = PSMOUSE_CMD_MODE;
-	psmouse->type = psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = 0;
+	psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = psmouse->out_of_sync = 0;
 	if (psmouse->reconnect) {
 	       if (psmouse->reconnect(psmouse))
 			return -1;
-	} else if (psmouse_probe(psmouse) != old_type)
+	} else if (psmouse_probe(psmouse) < 0 ||
+		   psmouse->type != psmouse_extensions(psmouse, psmouse_max_proto, 0))
 		return -1;
 
 	/* ok, the device type (and capabilities) match the old one,
 	 * we can continue using it, complete intialization
 	 */
-	psmouse->type = old_type;
 	psmouse_initialize(psmouse);
 
 	if (psmouse->ptport) {
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index e54841ad1..47fbc48f6 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -22,6 +22,13 @@
 #define PSMOUSE_ACTIVATED	1
 #define PSMOUSE_IGNORE		2
 
+/* psmouse protocol handler return codes */
+typedef enum {
+	PSMOUSE_BAD_DATA,
+	PSMOUSE_GOOD_DATA,
+	PSMOUSE_FULL_PACKET
+} psmouse_ret_t;
+
 struct psmouse;
 
 struct psmouse_ptport {
@@ -45,6 +52,7 @@ struct psmouse {
 	unsigned char type;
 	unsigned char model;
 	unsigned long last;
+	unsigned long out_of_sync;
 	unsigned char state;
 	char acking;
 	volatile char ack;
@@ -52,6 +60,7 @@ struct psmouse {
 	char devname[64];
 	char phys[32];
 
+	psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse, struct pt_regs *regs); 
 	int (*reconnect)(struct psmouse *psmouse);
 	void (*disconnect)(struct psmouse *psmouse);
 };
@@ -65,10 +74,10 @@ struct psmouse {
 #define PSMOUSE_SYNAPTICS 	7
 
 int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
+int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
 int psmouse_reset(struct psmouse *psmouse);
 
 extern int psmouse_smartscroll;
 extern unsigned int psmouse_rate;
-extern unsigned int psmouse_resetafter;
 
 #endif /* _PSMOUSE_H */
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index a182ce7f4..2bd152fe0 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -43,34 +43,12 @@
  *	Synaptics communications functions
  ****************************************************************************/
 
-/*
- * Use the Synaptics extended ps/2 syntax to write a special command byte.
- * special command: 0xE8 rr 0xE8 ss 0xE8 tt 0xE8 uu where (rr*64)+(ss*16)+(tt*4)+uu
- *                  is the command. A 0xF3 or 0xE9 must follow (see synaptics_send_cmd
- *                  and synaptics_mode_cmd)
- */
-static int synaptics_special_cmd(struct psmouse *psmouse, unsigned char command)
-{
-	int i;
-
-	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11))
-		return -1;
-
-	for (i = 6; i >= 0; i -= 2) {
-		unsigned char d = (command >> i) & 3;
-		if (psmouse_command(psmouse, &d, PSMOUSE_CMD_SETRES))
-			return -1;
-	}
-
-	return 0;
-}
-
 /*
  * Send a command to the synpatics touchpad by special commands
  */
 static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param)
 {
-	if (synaptics_special_cmd(psmouse, c))
+	if (psmouse_sliced_command(psmouse, c))
 		return -1;
 	if (psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO))
 		return -1;
@@ -84,7 +62,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
 {
 	unsigned char param[1];
 
-	if (synaptics_special_cmd(psmouse, mode))
+	if (psmouse_sliced_command(psmouse, mode))
 		return -1;
 	param[0] = SYN_PS_SET_MODE2;
 	if (psmouse_command(psmouse, param, PSMOUSE_CMD_SETRATE))
@@ -118,17 +96,31 @@ static int synaptics_capability(struct psmouse *psmouse)
 
 	if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap))
 		return -1;
-	priv->capabilities = (cap[0]<<16) | (cap[1]<<8) | cap[2];
+	priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
 	priv->ext_cap = 0;
 	if (!SYN_CAP_VALID(priv->capabilities))
 		return -1;
 
-	if (SYN_EXT_CAP_REQUESTS(priv->capabilities)) {
+	/*
+	 * Unless capExtended is set the rest of the flags should be ignored
+	 */
+	if (!SYN_CAP_EXTENDED(priv->capabilities))
+		priv->capabilities = 0;
+
+	if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) {
 		if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) {
 			printk(KERN_ERR "Synaptics claims to have extended capabilities,"
 			       " but I'm not able to read them.");
-		} else
-			priv->ext_cap = (cap[0]<<16) | (cap[1]<<8) | cap[2];
+		} else {
+			priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2];
+
+			/*
+			 * if nExtBtn is greater than 8 it should be considered
+			 * invalid and treated as 0
+			 */
+			if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) > 8)
+				priv->ext_cap &= 0xff0fff;
+		}
 	}
 	return 0;
 }
@@ -167,11 +159,12 @@ static void print_ident(struct synaptics_data *priv)
 
 	if (SYN_CAP_EXTENDED(priv->capabilities)) {
 		printk(KERN_INFO " Touchpad has extended capability bits\n");
-		if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
-		    SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) <= 8)
+		if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
 			printk(KERN_INFO " -> %d multi-buttons, i.e. besides standard buttons\n",
 			       (int)(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)));
-		else if (SYN_CAP_FOUR_BUTTON(priv->capabilities))
+		if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
+			printk(KERN_INFO " -> middle button\n");
+		if (SYN_CAP_FOUR_BUTTON(priv->capabilities))
 			printk(KERN_INFO " -> four buttons\n");
 		if (SYN_CAP_MULTIFINGER(priv->capabilities))
 			printk(KERN_INFO " -> multifinger detection\n");
@@ -219,21 +212,12 @@ static int synaptics_set_mode(struct psmouse *psmouse, int mode)
 /*****************************************************************************
  *	Synaptics pass-through PS/2 port support
  ****************************************************************************/
-static int synaptics_pt_open(struct serio *port)
-{
-	return 0;
-}
-
-static void synaptics_pt_close(struct serio *port)
-{
-}
-
 static int synaptics_pt_write(struct serio *port, unsigned char c)
 {
 	struct psmouse *parent = port->driver;
 	char rate_param = SYN_PS_CLIENT_CMD; /* indicates that we want pass-through port */
 
-	if (synaptics_special_cmd(parent, c))
+	if (psmouse_sliced_command(parent, c))
 		return -1;
 	if (psmouse_command(parent, &rate_param, PSMOUSE_CMD_SETRATE))
 		return -1;
@@ -289,165 +273,11 @@ static void synaptics_pt_create(struct psmouse *psmouse)
 	port->serio.name = "Synaptics pass-through";
 	port->serio.phys = "synaptics-pt/serio0";
 	port->serio.write = synaptics_pt_write;
-	port->serio.open = synaptics_pt_open;
-	port->serio.close = synaptics_pt_close;
 	port->serio.driver = psmouse;
 
 	port->activate = synaptics_pt_activate;
 }
 
-/*****************************************************************************
- *	Driver initialization/cleanup functions
- ****************************************************************************/
-
-static inline void set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
-{
-	dev->absmin[axis] = min;
-	dev->absmax[axis] = max;
-	dev->absfuzz[axis] = fuzz;
-	dev->absflat[axis] = flat;
-
-	set_bit(axis, dev->absbit);
-}
-
-static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
-{
-	set_bit(EV_ABS, dev->evbit);
-	set_abs_params(dev, ABS_X, XMIN_NOMINAL, XMAX_NOMINAL, 0, 0);
-	set_abs_params(dev, ABS_Y, YMIN_NOMINAL, YMAX_NOMINAL, 0, 0);
-	set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
-	set_bit(ABS_TOOL_WIDTH, dev->absbit);
-
-	set_bit(EV_KEY, dev->evbit);
-	set_bit(BTN_TOUCH, dev->keybit);
-	set_bit(BTN_TOOL_FINGER, dev->keybit);
-	set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
-	set_bit(BTN_TOOL_TRIPLETAP, dev->keybit);
-
-	set_bit(BTN_LEFT, dev->keybit);
-	set_bit(BTN_RIGHT, dev->keybit);
-	set_bit(BTN_FORWARD, dev->keybit);
-	set_bit(BTN_BACK, dev->keybit);
-	if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)) {
-		switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
-		default:
-			/*
-			 * if nExtBtn is greater than 8 it should be considered
-			 * invalid and treated as 0
-			 */
-			break;
-		case 8:
-			set_bit(BTN_7, dev->keybit);
-			set_bit(BTN_6, dev->keybit);
-		case 6:
-			set_bit(BTN_5, dev->keybit);
-			set_bit(BTN_4, dev->keybit);
-		case 4:
-			set_bit(BTN_3, dev->keybit);
-			set_bit(BTN_2, dev->keybit);
-		case 2:
-			set_bit(BTN_1, dev->keybit);
-			set_bit(BTN_0, dev->keybit);
-			break;
-		}
-	}
-
-	clear_bit(EV_REL, dev->evbit);
-	clear_bit(REL_X, dev->relbit);
-	clear_bit(REL_Y, dev->relbit);
-}
-
-void synaptics_reset(struct psmouse *psmouse)
-{
-	/* reset touchpad back to relative mode, gestures enabled */
-	synaptics_mode_cmd(psmouse, 0);
-}
-
-static void synaptics_disconnect(struct psmouse *psmouse)
-{
-	synaptics_reset(psmouse);
-	kfree(psmouse->private);
-}
-
-static int synaptics_reconnect(struct psmouse *psmouse)
-{
-	struct synaptics_data *priv = psmouse->private;
-	struct synaptics_data old_priv = *priv;
-
-	if (!synaptics_detect(psmouse))
-		return -1;
-
-	if (synaptics_query_hardware(psmouse)) {
-		printk(KERN_ERR "Unable to query Synaptics hardware.\n");
-		return -1;
-	}
-
-	if (old_priv.identity != priv->identity ||
-	    old_priv.model_id != priv->model_id ||
-	    old_priv.capabilities != priv->capabilities ||
-    	    old_priv.ext_cap != priv->ext_cap)
-    		return -1;
-
-	if (synaptics_set_mode(psmouse, 0)) {
-		printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
-		return -1;
-	}
-
-	return 0;
-}
-
-int synaptics_detect(struct psmouse *psmouse)
-{
-	unsigned char param[4];
-
-	param[0] = 0;
-
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
-
-	return param[1] == 0x47;
-}
-
-int synaptics_init(struct psmouse *psmouse)
-{
-	struct synaptics_data *priv;
-
-	psmouse->private = priv = kmalloc(sizeof(struct synaptics_data), GFP_KERNEL);
-	if (!priv)
-		return -1;
-	memset(priv, 0, sizeof(struct synaptics_data));
-
-	if (synaptics_query_hardware(psmouse)) {
-		printk(KERN_ERR "Unable to query Synaptics hardware.\n");
-		goto init_fail;
-	}
-
-	if (synaptics_set_mode(psmouse, 0)) {
-		printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
-		goto init_fail;
-	}
-
-	priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
-
-	if (SYN_CAP_EXTENDED(priv->capabilities) && SYN_CAP_PASS_THROUGH(priv->capabilities))
-       		synaptics_pt_create(psmouse);
-
-	print_ident(priv);
-	set_input_params(&psmouse->dev, priv);
-
-	psmouse->disconnect = synaptics_disconnect;
-	psmouse->reconnect = synaptics_reconnect;
-
-	return 0;
-
- init_fail:
-	kfree(priv);
-	return -1;
-}
-
 /*****************************************************************************
  *	Functions to interpret the absolute mode packets
  ****************************************************************************/
@@ -471,17 +301,17 @@ static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data
 
 		hw->left  = (buf[0] & 0x01) ? 1 : 0;
 		hw->right = (buf[0] & 0x02) ? 1 : 0;
-		if (SYN_CAP_EXTENDED(priv->capabilities) &&
-		    (SYN_CAP_FOUR_BUTTON(priv->capabilities))) {
-			hw->up = ((buf[3] & 0x01)) ? 1 : 0;
-			if (hw->left)
-				hw->up = !hw->up;
-			hw->down = ((buf[3] & 0x02)) ? 1 : 0;
-			if (hw->right)
-				hw->down = !hw->down;
+
+		if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
+			hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
+
+		if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {
+			hw->up   = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
+			hw->down = ((buf[0] ^ buf[3]) & 0x02) ? 1 : 0;
 		}
+
 		if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
-		    ((buf[3] & 2) ? !hw->right : hw->right)) {
+		    ((buf[0] ^ buf[3]) & 0x02)) {
 			switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
 			default:
 				/*
@@ -490,17 +320,17 @@ static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data
 				 */
 				break;
 			case 8:
-				hw->b7 = ((buf[5] & 0x08)) ? 1 : 0;
-				hw->b6 = ((buf[4] & 0x08)) ? 1 : 0;
+				hw->ext_buttons |= ((buf[5] & 0x08)) ? 0x80 : 0;
+				hw->ext_buttons |= ((buf[4] & 0x08)) ? 0x40 : 0;
 			case 6:
-				hw->b5 = ((buf[5] & 0x04)) ? 1 : 0;
-				hw->b4 = ((buf[4] & 0x04)) ? 1 : 0;
+				hw->ext_buttons |= ((buf[5] & 0x04)) ? 0x20 : 0;
+				hw->ext_buttons |= ((buf[4] & 0x04)) ? 0x10 : 0;
 			case 4:
-				hw->b3 = ((buf[5] & 0x02)) ? 1 : 0;
-				hw->b2 = ((buf[4] & 0x02)) ? 1 : 0;
+				hw->ext_buttons |= ((buf[5] & 0x02)) ? 0x08 : 0;
+				hw->ext_buttons |= ((buf[4] & 0x02)) ? 0x04 : 0;
 			case 2:
-				hw->b1 = ((buf[5] & 0x01)) ? 1 : 0;
-				hw->b0 = ((buf[4] & 0x01)) ? 1 : 0;
+				hw->ext_buttons |= ((buf[5] & 0x01)) ? 0x02 : 0;
+				hw->ext_buttons |= ((buf[4] & 0x01)) ? 0x01 : 0;
 			}
 		}
 	} else {
@@ -525,6 +355,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
 	struct synaptics_hw_state hw;
 	int num_fingers;
 	int finger_width;
+	int i;
 
 	synaptics_parse_hw_state(psmouse->packet, priv, &hw);
 
@@ -570,32 +401,20 @@ static void synaptics_process_packet(struct psmouse *psmouse)
 	input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);
 	input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);
 
-	input_report_key(dev, BTN_LEFT,    hw.left);
-	input_report_key(dev, BTN_RIGHT,   hw.right);
-	input_report_key(dev, BTN_FORWARD, hw.up);
-	input_report_key(dev, BTN_BACK,    hw.down);
-	if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
-		switch(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
-		default:
-			/*
-			 * if nExtBtn is greater than 8 it should be considered
-			 * invalid and treated as 0
-			 */
-			break;
-		case 8:
-			input_report_key(dev, BTN_7,       hw.b7);
-			input_report_key(dev, BTN_6,       hw.b6);
-		case 6:
-			input_report_key(dev, BTN_5,       hw.b5);
-			input_report_key(dev, BTN_4,       hw.b4);
-		case 4:
-			input_report_key(dev, BTN_3,       hw.b3);
-			input_report_key(dev, BTN_2,       hw.b2);
-		case 2:
-			input_report_key(dev, BTN_1,       hw.b1);
-			input_report_key(dev, BTN_0,       hw.b0);
-			break;
-		}
+	input_report_key(dev, BTN_LEFT, hw.left);
+	input_report_key(dev, BTN_RIGHT, hw.right);
+
+	if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
+		input_report_key(dev, BTN_MIDDLE, hw.middle);
+
+	if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {
+		input_report_key(dev, BTN_FORWARD, hw.up);
+		input_report_key(dev, BTN_BACK, hw.down);
+	}
+
+	for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
+		input_report_key(dev, BTN_0 + i, hw.ext_buttons & (1 << i));
+
 	input_sync(dev);
 }
 
@@ -607,6 +426,9 @@ static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned cha
 	static unsigned char oldabs_mask[]	= { 0xC0, 0x60, 0x00, 0xC0, 0x60 };
 	static unsigned char oldabs_rslt[]	= { 0xC0, 0x00, 0x00, 0x80, 0x00 };
 
+	if (idx < 0 || idx > 4)
+		return 0;
+
 	switch (pkt_type) {
 		case SYN_NEWABS:
 		case SYN_NEWABS_RELAXED:
@@ -637,7 +459,7 @@ static unsigned char synaptics_detect_pkt_type(struct psmouse *psmouse)
 	return SYN_NEWABS_STRICT;
 }
 
-void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
+static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
 {
 	struct input_dev *dev = &psmouse->dev;
 	struct synaptics_data *priv = psmouse->private;
@@ -645,11 +467,6 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
 	input_regs(dev, regs);
 
 	if (psmouse->pktcnt >= 6) { /* Full packet received */
-		if (priv->out_of_sync) {
-			priv->out_of_sync = 0;
-			printk(KERN_NOTICE "Synaptics driver resynced.\n");
-		}
-
 		if (unlikely(priv->pkt_type == SYN_NEWABS))
 			priv->pkt_type = synaptics_detect_pkt_type(psmouse);
 
@@ -657,16 +474,142 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
 			synaptics_pass_pt_packet(&psmouse->ptport->serio, psmouse->packet);
 		else
 			synaptics_process_packet(psmouse);
-		psmouse->pktcnt = 0;
-
-	} else if (psmouse->pktcnt &&
-		   !synaptics_validate_byte(psmouse->packet, psmouse->pktcnt - 1, priv->pkt_type)) {
-		printk(KERN_WARNING "Synaptics driver lost sync at byte %d\n", psmouse->pktcnt);
-		psmouse->pktcnt = 0;
-		if (++priv->out_of_sync == psmouse_resetafter) {
-			psmouse->state = PSMOUSE_IGNORE;
-			printk(KERN_NOTICE "synaptics: issuing reconnect request\n");
-			serio_reconnect(psmouse->serio);
-		}
+
+		return PSMOUSE_FULL_PACKET;
+	}
+
+	return synaptics_validate_byte(psmouse->packet, psmouse->pktcnt - 1, priv->pkt_type) ?
+		PSMOUSE_GOOD_DATA : PSMOUSE_BAD_DATA;
+}
+
+/*****************************************************************************
+ *	Driver initialization/cleanup functions
+ ****************************************************************************/
+static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
+{
+	int i;
+
+	set_bit(EV_ABS, dev->evbit);
+	input_set_abs_params(dev, ABS_X, XMIN_NOMINAL, XMAX_NOMINAL, 0, 0);
+	input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, YMAX_NOMINAL, 0, 0);
+	input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
+	set_bit(ABS_TOOL_WIDTH, dev->absbit);
+
+	set_bit(EV_KEY, dev->evbit);
+	set_bit(BTN_TOUCH, dev->keybit);
+	set_bit(BTN_TOOL_FINGER, dev->keybit);
+	set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
+	set_bit(BTN_TOOL_TRIPLETAP, dev->keybit);
+
+	set_bit(BTN_LEFT, dev->keybit);
+	set_bit(BTN_RIGHT, dev->keybit);
+
+	if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
+		set_bit(BTN_MIDDLE, dev->keybit);
+
+	if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) {
+		set_bit(BTN_FORWARD, dev->keybit);
+		set_bit(BTN_BACK, dev->keybit);
+	}
+
+	for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
+		set_bit(BTN_0 + i, dev->keybit);
+
+	clear_bit(EV_REL, dev->evbit);
+	clear_bit(REL_X, dev->relbit);
+	clear_bit(REL_Y, dev->relbit);
+}
+
+void synaptics_reset(struct psmouse *psmouse)
+{
+	/* reset touchpad back to relative mode, gestures enabled */
+	synaptics_mode_cmd(psmouse, 0);
+}
+
+static void synaptics_disconnect(struct psmouse *psmouse)
+{
+	synaptics_reset(psmouse);
+	kfree(psmouse->private);
+}
+
+static int synaptics_reconnect(struct psmouse *psmouse)
+{
+	struct synaptics_data *priv = psmouse->private;
+	struct synaptics_data old_priv = *priv;
+
+	if (!synaptics_detect(psmouse))
+		return -1;
+
+	if (synaptics_query_hardware(psmouse)) {
+		printk(KERN_ERR "Unable to query Synaptics hardware.\n");
+		return -1;
+	}
+
+	if (old_priv.identity != priv->identity ||
+	    old_priv.model_id != priv->model_id ||
+	    old_priv.capabilities != priv->capabilities ||
+	    old_priv.ext_cap != priv->ext_cap)
+		return -1;
+
+	if (synaptics_set_mode(psmouse, 0)) {
+		printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+int synaptics_detect(struct psmouse *psmouse)
+{
+	unsigned char param[4];
+
+	param[0] = 0;
+
+	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+	psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+
+	return param[1] == 0x47;
+}
+
+int synaptics_init(struct psmouse *psmouse)
+{
+	struct synaptics_data *priv;
+
+	psmouse->private = priv = kmalloc(sizeof(struct synaptics_data), GFP_KERNEL);
+	if (!priv)
+		return -1;
+	memset(priv, 0, sizeof(struct synaptics_data));
+
+	if (synaptics_query_hardware(psmouse)) {
+		printk(KERN_ERR "Unable to query Synaptics hardware.\n");
+		goto init_fail;
+	}
+
+	if (synaptics_set_mode(psmouse, 0)) {
+		printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
+		goto init_fail;
 	}
+
+	priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
+
+	if (SYN_CAP_PASS_THROUGH(priv->capabilities))
+		synaptics_pt_create(psmouse);
+
+	print_ident(priv);
+	set_input_params(&psmouse->dev, priv);
+
+	psmouse->protocol_handler = synaptics_process_byte;
+	psmouse->disconnect = synaptics_disconnect;
+	psmouse->reconnect = synaptics_reconnect;
+
+	return 0;
+
+ init_fail:
+	kfree(priv);
+	return -1;
 }
+
+
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 69764deb6..eb64431a7 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -9,7 +9,6 @@
 #ifndef _SYNAPTICS_H
 #define _SYNAPTICS_H
 
-extern void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs);
 extern int synaptics_detect(struct psmouse *psmouse);
 extern int synaptics_init(struct psmouse *psmouse);
 extern void synaptics_reset(struct psmouse *psmouse);
@@ -44,13 +43,14 @@ extern void synaptics_reset(struct psmouse *psmouse);
 
 /* synaptics capability bits */
 #define SYN_CAP_EXTENDED(c)		((c) & (1 << 23))
+#define SYN_CAP_MIDDLE_BUTTON(c)	((c) & (1 << 18))
 #define SYN_CAP_PASS_THROUGH(c)		((c) & (1 << 7))
 #define SYN_CAP_SLEEP(c)		((c) & (1 << 4))
 #define SYN_CAP_FOUR_BUTTON(c)		((c) & (1 << 3))
 #define SYN_CAP_MULTIFINGER(c)		((c) & (1 << 1))
 #define SYN_CAP_PALMDETECT(c)		((c) & (1 << 0))
 #define SYN_CAP_VALID(c)		((((c) & 0x00ff00) >> 8) == 0x47)
-#define SYN_EXT_CAP_REQUESTS(c)		((((c) & 0x700000) >> 20) == 1)
+#define SYN_EXT_CAP_REQUESTS(c)		(((c) & 0x700000) >> 20)
 #define SYN_CAP_MULTI_BUTTON_NO(ec)	(((ec) & 0x00f000) >> 12)
 
 /* synaptics modes query bits */
@@ -86,18 +86,12 @@ struct synaptics_hw_state {
 	int y;
 	int z;
 	int w;
-	int left;
-	int right;
-	int up;
-	int down;
-	int b0;
-	int b1;
-	int b2;
-	int b3;
-	int b4;
-	int b5;
-	int b6;
-	int b7;
+	unsigned int left:1;
+	unsigned int right:1;
+	unsigned int middle:1;
+	unsigned int up:1;
+	unsigned int down:1;
+	unsigned char ext_buttons;
 };
 
 struct synaptics_data {
@@ -108,7 +102,6 @@ struct synaptics_data {
 	unsigned long int identity;		/* Identification */
 
 	/* Data for normal processing */
-	unsigned int out_of_sync;		/* # of packets out of sync */
 	int old_w;				/* Previous w value */
 	unsigned char pkt_type;			/* packet type - old, new, etc */
 };
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index a2ac08ad8..f266b7ef5 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -2,6 +2,7 @@
  * Input driver to ExplorerPS/2 device driver module.
  *
  * Copyright (c) 1999-2002 Vojtech Pavlik
+ * Copyright (c) 2004      Dmitry Torokhov
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as published by
@@ -47,15 +48,24 @@ static int yres = CONFIG_INPUT_MOUSEDEV_SCREEN_Y;
 module_param(yres, uint, 0);
 MODULE_PARM_DESC(yres, "Vertical screen resolution");
 
+struct mousedev_motion {
+	int dx, dy, dz;
+};
+
 struct mousedev {
 	int exist;
 	int open;
 	int minor;
-	int misc;
 	char name[16];
 	wait_queue_head_t wait;
 	struct list_head list;
 	struct input_handle handle;
+
+	struct mousedev_motion packet;
+	unsigned long buttons;
+	unsigned int pkt_count;
+	int old_x[4], old_y[4];
+	unsigned int touch;
 };
 
 struct mousedev_list {
@@ -63,13 +73,10 @@ struct mousedev_list {
 	struct mousedev *mousedev;
 	struct list_head node;
 	int dx, dy, dz;
-	int old_x[4], old_y[4];
 	unsigned long buttons;
 	signed char ps2[6];
 	unsigned char ready, buffer, bufsiz;
 	unsigned char mode, imexseq, impsseq;
-	unsigned int pkt_count;
-	unsigned char touch;
 };
 
 #define MOUSEDEV_SEQ_LEN	6
@@ -82,135 +89,157 @@ static struct input_handler mousedev_handler;
 static struct mousedev *mousedev_table[MOUSEDEV_MINORS];
 static struct mousedev mousedev_mix;
 
-#define fx(i)  (list->old_x[(list->pkt_count - (i)) & 03])
-#define fy(i)  (list->old_y[(list->pkt_count - (i)) & 03])
+#define fx(i)  (mousedev->old_x[(mousedev->pkt_count - (i)) & 03])
+#define fy(i)  (mousedev->old_y[(mousedev->pkt_count - (i)) & 03])
 
-static void mousedev_abs_event(struct input_handle *handle, struct mousedev_list *list, unsigned int code, int value)
+static void mousedev_touchpad_event(struct mousedev *mousedev, unsigned int code, int value)
 {
-	int size;
-	int touchpad;
+	if (mousedev->touch) {
+		switch (code) {
+			case ABS_X:
+				fx(0) = value;
+				if (mousedev->pkt_count >= 2)
+					mousedev->packet.dx = ((fx(0) - fx(1)) / 2 + (fx(1) - fx(2)) / 2) / 8;
+				break;
 
-	/* Ignore joysticks */
-	if (test_bit(BTN_TRIGGER, handle->dev->keybit))
-		return;
+			case ABS_Y:
+				fy(0) = value;
+				if (mousedev->pkt_count >= 2)
+					mousedev->packet.dy = -((fy(0) - fy(1)) / 2 + (fy(1) - fy(2)) / 2) / 8;
+				break;
+		}
+	}
+}
 
-	touchpad = test_bit(BTN_TOOL_FINGER, handle->dev->keybit);
+static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev, unsigned int code, int value)
+{
+	int size;
 
 	switch (code) {
 		case ABS_X:
-			if (touchpad) {
-				if (list->touch) {
-					fx(0) = value;
-					if (list->pkt_count >= 2)
-						list->dx = ((fx(0) - fx(1)) / 2 + (fx(1) - fx(2)) / 2) / 8;
-				}
-			} else {
-				size = handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X];
-				if (size == 0) size = xres;
-				list->dx += (value * xres - list->old_x[0]) / size;
-				list->old_x[0] += list->dx * size;
-			}
+			size = dev->absmax[ABS_X] - dev->absmin[ABS_X];
+			if (size == 0) size = xres;
+			mousedev->packet.dx = (value * xres - mousedev->old_x[0]) / size;
+			mousedev->old_x[0] = mousedev->packet.dx * size;
 			break;
+
 		case ABS_Y:
-			if (touchpad) {
-				if (list->touch) {
-					fy(0) = value;
-					if (list->pkt_count >= 2)
-						list->dy = -((fy(0) - fy(1)) / 2 + (fy(1) - fy(2)) / 2) / 8;
-				}
-			} else {
-				size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
-				if (size == 0) size = yres;
-				list->dy -= (value * yres - list->old_y[0]) / size;
-				list->old_y[0] -= list->dy * size;
-			}
+			size = dev->absmax[ABS_Y] - dev->absmin[ABS_Y];
+			if (size == 0) size = yres;
+			mousedev->packet.dy = (value * yres - mousedev->old_y[0]) / size;
+			mousedev->old_y[0] = mousedev->packet.dy * size;
 			break;
 	}
 }
 
-static void mousedev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
+static void mousedev_rel_event(struct mousedev *mousedev, unsigned int code, int value)
+{
+	switch (code) {
+		case REL_X:	mousedev->packet.dx += value; break;
+		case REL_Y:	mousedev->packet.dy -= value; break;
+		case REL_WHEEL:	mousedev->packet.dz -= value; break;
+	}
+}
+
+static void mousedev_key_event(struct mousedev *mousedev, unsigned int code, int value)
+{
+	int index;
+
+	switch (code) {
+		case BTN_TOUCH:
+		case BTN_0:
+		case BTN_FORWARD:
+		case BTN_LEFT:		index = 0; break;
+		case BTN_STYLUS:
+		case BTN_1:
+		case BTN_RIGHT:		index = 1; break;
+		case BTN_2:
+		case BTN_STYLUS2:
+		case BTN_MIDDLE:	index = 2; break;
+		case BTN_3:
+		case BTN_BACK:
+		case BTN_SIDE:		index = 3; break;
+		case BTN_4:
+		case BTN_EXTRA:		index = 4; break;
+		default: 		return;
+	}
+
+	if (value) {
+		set_bit(index, &mousedev->buttons);
+		set_bit(index, &mousedev_mix.buttons);
+	} else {
+		clear_bit(index, &mousedev->buttons);
+		clear_bit(index, &mousedev_mix.buttons);
+	}
+}
+
+static void mousedev_notify_readers(struct mousedev *mousedev, struct mousedev_motion *packet)
 {
-	struct mousedev *mousedevs[3] = { handle->private, &mousedev_mix, NULL };
-	struct mousedev **mousedev = mousedevs;
 	struct mousedev_list *list;
-	int index, wake;
-
-	while (*mousedev) {
-
-		wake = 0;
-
-		list_for_each_entry(list, &(*mousedev)->list, node)
-			switch (type) {
-				case EV_ABS:
-					mousedev_abs_event(handle, list, code, value);
-					break;
-
-				case EV_REL:
-					switch (code) {
-						case REL_X:	list->dx += value; break;
-						case REL_Y:	list->dy -= value; break;
-						case REL_WHEEL:	if (list->mode) list->dz -= value; break;
-					}
-					break;
-
-				case EV_KEY:
-					if (code == BTN_TOUCH && test_bit(BTN_TOOL_FINGER, handle->dev->keybit)) {
-						/* Handle touchpad data */
-						list->touch = value;
-						if (!list->touch)
-							list->pkt_count = 0;
-						break;
-					}
-
-					switch (code) {
-						case BTN_TOUCH:
-						case BTN_0:
-						case BTN_FORWARD:
-						case BTN_LEFT:   index = 0; break;
-						case BTN_4:
-						case BTN_EXTRA:  if (list->mode == 2) { index = 4; break; }
-						case BTN_STYLUS:
-						case BTN_1:
-						case BTN_RIGHT:  index = 1; break;
-						case BTN_3:
-						case BTN_BACK:
-						case BTN_SIDE:   if (list->mode == 2) { index = 3; break; }
-						case BTN_2:
-						case BTN_STYLUS2:
-						case BTN_MIDDLE: index = 2; break;	
-						default: return;
-					}
-					switch (value) {
-						case 0: clear_bit(index, &list->buttons); break;
-						case 1: set_bit(index, &list->buttons); break;
-						case 2: return;
-					}
-					break;
-
-				case EV_SYN:
-					switch (code) {
-						case SYN_REPORT:
-							if (list->touch) {
-								list->pkt_count++;
-								/* Input system eats duplicate events,
-								 * but we need all of them to do correct
-								 * averaging so apply present one forward
-								 */
-								fx(0) = fx(1);
-								fy(0) = fy(1);
-							}
-
-							list->ready = 1;
-							kill_fasync(&list->fasync, SIGIO, POLL_IN);
-							wake = 1;
-							break;
-					}
+
+	list_for_each_entry(list, &mousedev->list, node) {
+		list->dx += packet->dx;
+		list->dy += packet->dy;
+		list->dz += packet->dz;
+		list->buttons = mousedev->buttons;
+		list->ready = 1;
+		kill_fasync(&list->fasync, SIGIO, POLL_IN);
+	}
+
+	wake_up_interruptible(&mousedev->wait);
+}
+
+static void mousedev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
+{
+	struct mousedev *mousedev = handle->private;
+
+	switch (type) {
+		case EV_ABS:
+			/* Ignore joysticks */
+			if (test_bit(BTN_TRIGGER, handle->dev->keybit))
+				return;
+
+			if (test_bit(BTN_TOOL_FINGER, handle->dev->keybit))
+				mousedev_touchpad_event(mousedev, code, value);
+			else
+				mousedev_abs_event(handle->dev, mousedev, code, value);
+
+			break;
+
+		case EV_REL:
+			mousedev_rel_event(mousedev, code, value);
+			break;
+
+		case EV_KEY:
+			if (value != 2) {
+				if (code == BTN_TOUCH && test_bit(BTN_TOOL_FINGER, handle->dev->keybit)) {
+					/* Handle touchpad data */
+					mousedev->touch = value;
+					if (!mousedev->touch)
+						mousedev->pkt_count = 0;
+				}
+				else
+					mousedev_key_event(mousedev, code, value);
 			}
+			break;
+
+		case EV_SYN:
+			if (code == SYN_REPORT) {
+				if (mousedev->touch) {
+					mousedev->pkt_count++;
+					/* Input system eats duplicate events, but we need all of them
+					 * to do correct averaging so apply present one forward
+			 		 */
+					fx(0) = fx(1);
+					fy(0) = fy(1);
+				}
 
-		if (wake)
-			wake_up_interruptible(&((*mousedev)->wait));
+				mousedev_notify_readers(mousedev, &mousedev->packet);
+				mousedev_notify_readers(&mousedev_mix, &mousedev->packet);
 
-		mousedev++;
+				memset(&mousedev->packet, 0, sizeof(struct mousedev_motion));
+			}
+			break;
 	}
 }
 
@@ -267,7 +296,7 @@ static int mousedev_release(struct inode * inode, struct file * file)
 				mousedev_free(list->mousedev);
 		}
 	}
-	
+
 	kfree(list);
 	return 0;
 }
@@ -301,11 +330,11 @@ static int mousedev_open(struct inode * inode, struct file * file)
 		if (list->mousedev->minor == MOUSEDEV_MIX) {
 			list_for_each_entry(handle, &mousedev_handler.h_list, h_node) {
 				mousedev = handle->private;
-				if (!mousedev->open && mousedev->exist)	
+				if (!mousedev->open && mousedev->exist)
 					input_open_device(handle);
 			}
-		} else 
-			if (!mousedev_mix.open && list->mousedev->exist)	
+		} else
+			if (!mousedev_mix.open && list->mousedev->exist)
 				input_open_device(&list->mousedev->handle);
 	}
 
@@ -326,8 +355,10 @@ static void mousedev_packet(struct mousedev_list *list, unsigned char off)
 		list->dz -= list->ps2[off + 3];
 		list->ps2[off + 3] = (list->ps2[off + 3] & 0x0f) | ((list->buttons & 0x18) << 1);
 		list->bufsiz++;
+	} else {
+		list->ps2[off] |= ((list->buttons & 0x10) >> 3) | ((list->buttons & 0x08) >> 1);
 	}
-	
+
 	if (list->mode == 1) {
 		list->ps2[off + 3] = (list->dz > 127 ? 127 : (list->dz < -127 ? -127 : list->dz));
 		list->dz -= list->ps2[off + 3];
@@ -339,7 +370,7 @@ static void mousedev_packet(struct mousedev_list *list, unsigned char off)
 }
 
 
-static ssize_t mousedev_write(struct file * file, const char * buffer, size_t count, loff_t *ppos)
+static ssize_t mousedev_write(struct file * file, const char __user * buffer, size_t count, loff_t *ppos)
 {
 	struct mousedev_list *list = file->private_data;
 	unsigned char c;
@@ -391,9 +422,9 @@ static ssize_t mousedev_write(struct file * file, const char * buffer, size_t co
 				list->impsseq = 0;
 				list->imexseq = 0;
 				list->mode = 0;
-				list->ps2[0] = 0xaa;
-				list->ps2[1] = 0x00;
-				list->bufsiz = 2;
+				list->ps2[1] = 0xaa;
+				list->ps2[2] = 0x00;
+				list->bufsiz = 3;
 				break;
 		}
 
@@ -403,11 +434,11 @@ static ssize_t mousedev_write(struct file * file, const char * buffer, size_t co
 	kill_fasync(&list->fasync, SIGIO, POLL_IN);
 
 	wake_up_interruptible(&list->mousedev->wait);
-		
+
 	return count;
 }
 
-static ssize_t mousedev_read(struct file * file, char * buffer, size_t count, loff_t *ppos)
+static ssize_t mousedev_read(struct file * file, char __user * buffer, size_t count, loff_t *ppos)
 {
 	struct mousedev_list *list = file->private_data;
 	int retval = 0;
@@ -431,7 +462,7 @@ static ssize_t mousedev_read(struct file * file, char * buffer, size_t count, lo
 	if (copy_to_user(buffer, list->ps2 + list->bufsiz - list->buffer - count, count))
 		return -EFAULT;
 
-	return count;	
+	return count;
 }
 
 /* No kernel lock - fine */
@@ -487,7 +518,7 @@ static struct input_handle *mousedev_connect(struct input_handler *handler, stru
 
 	devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
 			S_IFCHR|S_IRUGO|S_IWUSR, "input/mouse%d", minor);
-	class_simple_device_add(input_class, 
+	class_simple_device_add(input_class,
 				MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
 				dev->dev, "mouse%d", minor);
 
@@ -538,7 +569,7 @@ static struct input_device_id mousedev_ids[] = {
 };
 
 MODULE_DEVICE_TABLE(input, mousedev_ids);
-	
+
 static struct input_handler mousedev_handler = {
 	.event =	mousedev_event,
 	.connect =	mousedev_connect,
@@ -553,6 +584,7 @@ static struct input_handler mousedev_handler = {
 static struct miscdevice psaux_mouse = {
 	PSMOUSE_MINOR, "psaux", &mousedev_fops
 };
+static int psaux_registered;
 #endif
 
 static int __init mousedev_init(void)
@@ -572,7 +604,7 @@ static int __init mousedev_init(void)
 				NULL, "mice");
 
 #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
-	if (!(mousedev_mix.misc = !misc_register(&psaux_mouse)))
+	if (!(psaux_registered = !misc_register(&psaux_mouse)))
 		printk(KERN_WARNING "mice: could not misc_register the device\n");
 #endif
 
@@ -584,7 +616,7 @@ static int __init mousedev_init(void)
 static void __exit mousedev_exit(void)
 {
 #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
-	if (mousedev_mix.misc)
+	if (psaux_registered)
 		misc_deregister(&psaux_mouse);
 #endif
 	devfs_remove("input/mice");
diff --git a/drivers/input/power.c b/drivers/input/power.c
index 552dcd870..f7469b55e 100644
--- a/drivers/input/power.c
+++ b/drivers/input/power.c
@@ -1,7 +1,7 @@
 /*
  * $Id: power.c,v 1.10 2001/09/25 09:17:15 vojtech Exp $
  *
- *  Copyright (c) 2001 "Crazy" James Simmons  
+ *  Copyright (c) 2001 "Crazy" James Simmons
  *
  *  Input driver Power Management.
  *
@@ -51,7 +51,7 @@ static void suspend_button_task_handler(void *data)
 
 static DECLARE_WORK(suspend_button_task, suspend_button_task_handler, NULL);
 
-static void power_event(struct input_handle *handle, unsigned int type, 
+static void power_event(struct input_handle *handle, unsigned int type,
 		        unsigned int code, int down)
 {
 	struct input_dev *dev = handle->dev;
@@ -73,7 +73,7 @@ static void power_event(struct input_handle *handle, unsigned int type,
 			case KEY_POWER:
 				/* Hum power down the machine. */
 				break;
-			default:	
+			default:
 				return;
 		}
 	} else {
@@ -83,9 +83,9 @@ static void power_event(struct input_handle *handle, unsigned int type,
 				/* This is risky. See pm.h for details. */
 				if (dev->state != PM_RESUME)
 					dev->state = PM_RESUME;
-				else 
-					dev->state = PM_SUSPEND;	
-				pm_send(dev->pm_dev, dev->state, dev); 	
+				else
+					dev->state = PM_SUSPEND;
+				pm_send(dev->pm_dev, dev->state, dev);
 				break;
 			case KEY_POWER:
 				/* Turn the input device off completely ? */
@@ -97,14 +97,14 @@ static void power_event(struct input_handle *handle, unsigned int type,
 	return;
 }
 
-static struct input_handle *power_connect(struct input_handler *handler, 
-					  struct input_dev *dev, 
+static struct input_handle *power_connect(struct input_handler *handler,
+					  struct input_dev *dev,
 					  struct input_device_id *id)
 {
 	struct input_handle *handle;
 
 	if (!test_bit(EV_KEY, dev->evbit) || !test_bit(EV_PWR, dev->evbit))
-		return NULL;	
+		return NULL;
 
 	if (!test_bit(KEY_SUSPEND, dev->keybit) || (!test_bit(KEY_POWER, dev->keybit)))
 		return NULL;
@@ -133,21 +133,21 @@ static struct input_device_id power_ids[] = {
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT(EV_KEY) },
 		.keybit = { [LONG(KEY_SUSPEND)] = BIT(KEY_SUSPEND) }
-	},	
+	},
 	{
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT(EV_KEY) },
 		.keybit = { [LONG(KEY_POWER)] = BIT(KEY_POWER) }
-	},	
+	},
 	{
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
 		.evbit = { BIT(EV_PWR) },
-	},	
+	},
 	{ }, 	/* Terminating entry */
 };
 
 MODULE_DEVICE_TABLE(input, power_ids);
-	
+
 static struct input_handler power_handler = {
 	.event =	power_event,
 	.connect =	power_connect,
@@ -172,3 +172,4 @@ module_exit(power_exit);
 
 MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>");
 MODULE_DESCRIPTION("Input Power Management driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/input/serio/98kbd-io.c b/drivers/input/serio/98kbd-io.c
index 25f64c999..32bd067a9 100644
--- a/drivers/input/serio/98kbd-io.c
+++ b/drivers/input/serio/98kbd-io.c
@@ -42,8 +42,8 @@ MODULE_LICENSE("GPL");
  * Register numbers.
  */
 
-#define KBD98_COMMAND_REG	0x43	
-#define KBD98_STATUS_REG	0x43	
+#define KBD98_COMMAND_REG	0x43
+#define KBD98_STATUS_REG	0x43
 #define KBD98_DATA_REG		0x41
 
 spinlock_t kbd98io_lock = SPIN_LOCK_UNLOCKED;
@@ -51,7 +51,7 @@ spinlock_t kbd98io_lock = SPIN_LOCK_UNLOCKED;
 static struct serio kbd98_port;
 extern struct pt_regs *kbd_pt_regs;
 
-static void kbd98io_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t kbd98io_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 /*
  * kbd98_flush() flushes all data that may be in the keyboard buffers
@@ -143,7 +143,7 @@ static struct serio kbd98_port =
  * to the upper layers.
  */
 
-static void kbd98io_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t kbd98io_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
 	unsigned char data;
@@ -154,6 +154,7 @@ static void kbd98io_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	spin_unlock_irqrestore(&kbd98io_lock, flags);
 	serio_interrupt(&kbd98_port, data, 0, regs);
 
+	return IRQ_HANDLED;
 }
 
 int __init kbd98io_init(void)
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
index b7fc99e5b..2234ff39d 100644
--- a/drivers/input/serio/ct82c710.c
+++ b/drivers/input/serio/ct82c710.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index 6f6bf4296..48a0ad587 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -16,7 +16,7 @@
  * 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.
- * 
+ *
  * TODO:
  * - Dino testing (did HP ever shipped a machine on which this port
  *                 was usable/enabled ?)
@@ -44,7 +44,7 @@ MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl);
 
 #define PFX "gscps2.c: "
 
-/* 
+/*
  * Driver constants
  */
 
@@ -222,7 +222,7 @@ static LIST_HEAD(ps2port_list);
 /**
  * gscps2_interrupt() - Interruption service routine
  *
- * This function reads received PS/2 bytes and processes them on 
+ * This function reads received PS/2 bytes and processes them on
  * all interfaces.
  * The problematic part here is, that the keyboard and mouse PS/2 port
  * share the same interrupt and it's not possible to send data if any
@@ -240,9 +240,9 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs)
 	  unsigned long flags;
 	  spin_lock_irqsave(&ps2port->lock, flags);
 
-	  while ( (ps2port->buffer[ps2port->append].str = 
+	  while ( (ps2port->buffer[ps2port->append].str =
 		   gscps2_readb_status(ps2port->addr)) & GSC_STAT_RBNE ) {
-		ps2port->buffer[ps2port->append].data = 
+		ps2port->buffer[ps2port->append].data =
 				gscps2_readb_input(ps2port->addr);
 		ps2port->append = ((ps2port->append+1) & BUFFER_SIZE);
 	  }
@@ -349,7 +349,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
 
 	if (!dev->irq)
 		return -ENODEV;
-	
+
 	/* Offset for DINO PS/2. Works with LASI even */
 	if (dev->id.sversion == 0x96)
 		hpa += GSC_DINO_OFFSET;
@@ -368,7 +368,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
 	gscps2_reset(ps2port);
 	ps2port->id = readb(ps2port->addr+GSC_ID) & 0x0f;
 	snprintf(ps2port->name, sizeof(ps2port->name)-1, "%s %s",
-		gscps2_serio_port.name, 
+		gscps2_serio_port.name,
 		(ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse" );
 
 	memcpy(&ps2port->port, &gscps2_serio_port, sizeof(gscps2_serio_port));
@@ -401,9 +401,9 @@ static int __init gscps2_probe(struct parisc_device *dev)
 		ps2port->port.phys);
 
 	serio_register_port(&ps2port->port);
-	
+
 	return 0;
-	
+
 fail:
 	free_irq(dev->irq, ps2port);
 
@@ -430,7 +430,7 @@ static int __devexit gscps2_remove(struct parisc_device *dev)
 	list_del(&ps2port->node);
 	iounmap(ps2port->addr);
 #if 0
-	release_mem_region(dev->hpa, GSC_STATUS + 4); 
+	release_mem_region(dev->hpa, GSC_STATUS + 4);
 #endif
 	dev_set_drvdata(&dev->dev, NULL);
 	kfree(ps2port);
@@ -441,7 +441,7 @@ static int __devexit gscps2_remove(struct parisc_device *dev)
 static struct parisc_device_id gscps2_device_tbl[] = {
 	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00084 }, /* LASI PS/2 */
 #ifdef DINO_TESTED
-	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00096 }, /* DINO PS/2 */ 
+	{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00096 }, /* DINO PS/2 */
 #endif
 	{ 0, }	/* 0 terminated list */
 };
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index efe3c289b..e9d8dabd1 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -150,7 +150,7 @@ static int i8042_flush(void)
  */
 
 static int i8042_command(unsigned char *param, int command)
-{ 
+{
 	unsigned long flags;
 	int retval = 0, i = 0;
 
@@ -161,7 +161,7 @@ static int i8042_command(unsigned char *param, int command)
 		dbg("%02x -> i8042 (command)", command & 0xff);
 		i8042_write_command(command & 0xff);
 	}
-	
+
 	if (!retval)
 		for (i = 0; i < ((command >> 12) & 0xf); i++) {
 			if ((retval = i8042_wait_write())) break;
@@ -172,7 +172,7 @@ static int i8042_command(unsigned char *param, int command)
 	if (!retval)
 		for (i = 0; i < ((command >> 8) & 0xf); i++) {
 			if ((retval = i8042_wait_read())) break;
-			if (i8042_read_status() & I8042_STR_AUXDATA) 
+			if (i8042_read_status() & I8042_STR_AUXDATA)
 				param[i] = ~i8042_read_data();
 			else
 				param[i] = i8042_read_data();
@@ -415,17 +415,17 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 		} else dfl = 0;
 
 		dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
-			data, (str >> 6), irq, 
+			data, (str >> 6), irq,
 			dfl & SERIO_PARITY ? ", bad parity" : "",
 			dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
 		serio_interrupt(i8042_mux_port + ((str >> 6) & 3), data, dfl, regs);
-		
+
 		goto irq_ret;
 	}
 
 	dbg("%02x <- i8042 (interrupt, %s, %d%s%s)",
-		data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, 
+		data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq,
 		dfl & SERIO_PARITY ? ", bad parity" : "",
 		dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
@@ -474,8 +474,17 @@ static int i8042_enable_mux_mode(struct i8042_values *values, unsigned char *mux
 	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa9)
 		return -1;
 	param = 0xa4;
-	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param == 0x5b)
+	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param == 0x5b) {
+
+/*
+ * Do another loop test with the 0x5a value. Doing anything else upsets
+ * Profusion/ServerWorks OSB4 chipsets.
+ */
+
+		param = 0x5a;
+		i8042_command(&param, I8042_CMD_AUX_LOOP);
 		return -1;
+	}
 
 	if (mux_version)
 		*mux_version = ~param;
@@ -530,10 +539,10 @@ static int __init i8042_check_mux(struct i8042_values *values)
 
 	if (i8042_enable_mux_mode(values, &mux_version))
 		return -1;
-	
+
 	/* Workaround for broken chips which seem to support MUX, but in reality don't. */
-	/* They all report version 12.10 */
-	if (mux_version == 0xCA)
+	/* They all report version 10.12 */
+	if (mux_version == 0xAC)
 		return -1;
 
 	printk(KERN_INFO "i8042.c: Detected active multiplexing controller, rev %d.%d.\n",
@@ -598,7 +607,7 @@ static int __init i8042_check_aux(struct i8042_values *values)
 /*
  * Bit assignment test - filters out PS/2 i8042's in AT mode
  */
-	
+
 	if (i8042_command(&param, I8042_CMD_AUX_DISABLE))
 		return -1;
 	if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) {
@@ -609,7 +618,7 @@ static int __init i8042_check_aux(struct i8042_values *values)
 	if (i8042_command(&param, I8042_CMD_AUX_ENABLE))
 		return -1;
 	if (i8042_command(&param, I8042_CMD_CTL_RCTR) || (param & I8042_CTR_AUXDIS))
-		return -1;	
+		return -1;
 
 /*
  * Disable the interface.
@@ -639,7 +648,7 @@ static int __init i8042_port_register(struct i8042_values *values, struct serio
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
 		printk(KERN_WARNING "i8042.c: Can't write CTR while registering.\n");
 		values->exists = 0;
-		return -1; 
+		return -1;
 	}
 
 	printk(KERN_INFO "serio: i8042 %s port at %#lx,%#lx irq %d\n",
@@ -868,7 +877,7 @@ static int i8042_controller_resume(void)
 static int i8042_notify_sys(struct notifier_block *this, unsigned long code,
         		    void *unused)
 {
-        if (code==SYS_DOWN || code==SYS_HALT) 
+        if (code == SYS_DOWN || code == SYS_HALT)
         	i8042_controller_cleanup();
         return NOTIFY_DONE;
 }
@@ -997,19 +1006,18 @@ void __exit i8042_exit(void)
 		sysdev_class_unregister(&kbc_sysclass);
 	}
 
-	del_timer_sync(&i8042_timer);
-
 	i8042_controller_cleanup();
-	
+
 	if (i8042_kbd_values.exists)
 		serio_unregister_port(&i8042_kbd_port);
 
 	if (i8042_aux_values.exists)
 		serio_unregister_port(&i8042_aux_port);
-	
+
 	for (i = 0; i < 4; i++)
 		if (i8042_mux_values[i].exists)
 			serio_unregister_port(i8042_mux_port + i);
+	del_timer_sync(&i8042_timer);
 
 	i8042_platform_exit();
 }
diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
index 1df2dd1d2..5f25b21be 100644
--- a/drivers/input/serio/parkbd.c
+++ b/drivers/input/serio/parkbd.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -86,20 +86,9 @@ static int parkbd_write(struct serio *port, unsigned char c)
 	return 0;
 }
 
-static int parkbd_open(struct serio *port)
-{
-	return 0;
-}
-
-static void parkbd_close(struct serio *port)
-{
-}
-
 static struct serio parkbd_port =
 {
 	.write	= parkbd_write,
-	.open	= parkbd_open,
-	.close	= parkbd_close,
 	.name	= parkbd_name,
 	.phys	= parkbd_phys,
 };
@@ -115,7 +104,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 			parkbd_writing = 0;
 			parkbd_writelines(3);
 			return;
-		}	
+		}
 
 		parkbd_writelines(((parkbd_buffer >> parkbd_counter++) & 1) | 2);
 
@@ -131,7 +120,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 		if ((parkbd_counter == parkbd_mode + 10) || time_after(jiffies, parkbd_last + HZ/100)) {
 			parkbd_counter = 0;
 			parkbd_buffer = 0;
-		}	
+		}
 
 		parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++;
 
diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c
index 021763a3e..7f4a26287 100644
--- a/drivers/input/serio/q40kbd.c
+++ b/drivers/input/serio/q40kbd.c
@@ -4,7 +4,7 @@
  *  Copyright (c) 2000-2001 Vojtech Pavlik
  *
  *  Based on the work of:
- *	Richard Zidlicky <Richard.Zidlicky@stud.informatik.uni-erlangen.de>	
+ *	Richard Zidlicky <Richard.Zidlicky@stud.informatik.uni-erlangen.de>
  */
 
 /*
@@ -47,23 +47,12 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver");
 MODULE_LICENSE("GPL");
 
-
-static int q40kbd_open(struct serio *port)
-{
-	return 0;
-}
-static void q40kbd_close(struct serio *port)
-{
-}
-
 static struct serio q40kbd_port =
 {
 	.type	= SERIO_8042,
 	.name	= "Q40 kbd port",
 	.phys	= "Q40",
 	.write	= NULL,
-	.open	= q40kbd_open,
-	.close	= q40kbd_close,
 };
 
 static irqreturn_t q40kbd_interrupt(int irq, void *dev_id,
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index bcd1aa89a..a2e4be7ae 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -98,7 +98,7 @@ static int rpckbd_open(struct serio *port)
 static void rpckbd_close(struct serio *port)
 {
 	free_irq(IRQ_KEYBOARDRX, port);
-	free_irq(IRQ_KEYBOARDTX, port);	
+	free_irq(IRQ_KEYBOARDTX, port);
 }
 
 static struct serio rpckbd_port =
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index d8fbab330..9beb7575c 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -45,7 +45,6 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct ps2if *ps2if = dev_id;
 	unsigned int scancode, flag, status;
-	int handled = IRQ_NONE;
 
 	status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
 	while (status & PS2STAT_RXF) {
@@ -63,11 +62,9 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
 		serio_interrupt(&ps2if->io, scancode, flag, regs);
 
 		status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
-
-		handled = IRQ_HANDLED;
         }
 
-        return handled;
+        return IRQ_HANDLED;
 }
 
 /*
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 13d21bf45..6f003197b 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -11,18 +11,18 @@
 /*
  * 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 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -108,7 +108,7 @@ void serio_handle_events(void)
 	struct serio_event *event;
 
 	list_for_each_safe(node, next, &serio_event_list) {
-		event = container_of(node, struct serio_event, node);	
+		event = container_of(node, struct serio_event, node);
 
 		down(&serio_sem);
 		if (event->serio == NULL)
@@ -152,7 +152,7 @@ static int serio_thread(void *nothing)
 
 	do {
 		serio_handle_events();
-		wait_event_interruptible(serio_wait, !list_empty(&serio_event_list)); 
+		wait_event_interruptible(serio_wait, !list_empty(&serio_event_list));
 		if (current->flags & PF_FREEZE)
 			refrigerator(PF_FREEZE);
 	} while (!signal_pending(current));
@@ -293,7 +293,7 @@ void serio_unregister_device(struct serio_dev *dev)
 int serio_open(struct serio *serio, struct serio_dev *dev)
 {
 	serio->dev = dev;
-	if (serio->open(serio)) {
+	if (serio->open && serio->open(serio)) {
 		serio->dev = NULL;
 		return -1;
 	}
@@ -303,7 +303,8 @@ int serio_open(struct serio *serio, struct serio_dev *dev)
 /* called from serio_dev->connect/disconnect methods under serio_sem */
 void serio_close(struct serio *serio)
 {
-	serio->close(serio);
+	if (serio->close)
+		serio->close(serio);
 	serio->dev = NULL;
 }
 
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
index 5045d195f..19e269249 100644
--- a/drivers/input/serio/serport.c
+++ b/drivers/input/serio/serport.c
@@ -48,11 +48,6 @@ static int serport_serio_write(struct serio *serio, unsigned char data)
 	return -(serport->tty->driver->write(serport->tty, 0, &data, 1) != 1);
 }
 
-static int serport_serio_open(struct serio *serio)
-{
-        return 0;
-}
-
 static void serport_serio_close(struct serio *serio)
 {
 	struct serport *serport = serio->driver;
@@ -87,7 +82,6 @@ static int serport_ldisc_open(struct tty_struct *tty)
 
 	serport->serio.type = SERIO_RS232;
 	serport->serio.write = serport_serio_write;
-	serport->serio.open = serport_serio_open;
 	serport->serio.close = serport_serio_close;
 	serport->serio.driver = serport;
 
@@ -135,12 +129,12 @@ static int serport_ldisc_room(struct tty_struct *tty)
 }
 
 /*
- * serport_ldisc_read() just waits indefinitely if everything goes well. 
+ * serport_ldisc_read() just waits indefinitely if everything goes well.
  * However, when the serio driver closes the serio port, it finishes,
  * returning 0 characters.
  */
 
-static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, unsigned char * buf, size_t nr)
+static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, unsigned char __user * buf, size_t nr)
 {
 	struct serport *serport = (struct serport*) tty->disc_data;
 	char name[64];
@@ -165,9 +159,9 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, u
 static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg)
 {
 	struct serport *serport = (struct serport*) tty->disc_data;
-	
+
 	if (cmd == SPIOCSTYPE)
-		return get_user(serport->serio.type, (unsigned long *) arg);
+		return get_user(serport->serio.type, (unsigned long __user *) arg);
 
 	return -EINVAL;
 }
diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c
index 9aec2e1d1..775914980 100644
--- a/drivers/input/touchscreen/gunze.c
+++ b/drivers/input/touchscreen/gunze.c
@@ -124,12 +124,10 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev)
 	memset(gunze, 0, sizeof(struct gunze));
 
 	init_input_dev(&gunze->dev);
-	gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
-	gunze->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
+	gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 	gunze->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
-
-	gunze->dev.absmin[ABS_X] = 96;   gunze->dev.absmin[ABS_Y] = 72;
-	gunze->dev.absmax[ABS_X] = 4000; gunze->dev.absmax[ABS_Y] = 3000;
+	input_set_abs_params(&gunze->dev, ABS_X, 96, 4000, 0, 0);
+	input_set_abs_params(&gunze->dev, ABS_Y, 72, 3000, 0, 0);
 
 	gunze->serio = serio;
 	serio->private = gunze;
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c
index 2f2855a5c..7b4c16d6f 100644
--- a/drivers/input/touchscreen/h3600_ts_input.c
+++ b/drivers/input/touchscreen/h3600_ts_input.c
@@ -1,11 +1,11 @@
 /*
  * $Id: h3600_ts_input.c,v 1.4 2002/01/23 06:39:37 jsimmons Exp $
  *
- *  Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com 
+ *  Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com
  *
- *  Sponsored by Transvirtual Technology. 
- * 
- *  Derived from the code in h3600_ts.[ch] by Charles Flynn  
+ *  Sponsored by Transvirtual Technology.
+ *
+ *  Derived from the code in h3600_ts.[ch] by Charles Flynn
  */
 
 /*
@@ -45,6 +45,10 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/irqs.h>
 
+MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>");
+MODULE_DESCRIPTION("H3600 touchscreen driver");
+MODULE_LICENSE("GPL");
+
 /*
  * Definitions & global arrays.
  */
@@ -75,7 +79,7 @@
 #define MAX_ID                  14
 
 #define H3600_MAX_LENGTH 16
-#define H3600_KEY 0xf 
+#define H3600_KEY 0xf
 
 #define H3600_SCANCODE_RECORD	1	 /* 1 -> record button */
 #define H3600_SCANCODE_CALENDAR 2	 /* 2 -> calendar */
@@ -103,7 +107,7 @@ struct h3600_dev {
 	char phys[32];
 };
 
-static void action_button_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t action_button_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
         int down = (GPLR & GPIO_BITSY_ACTION_BUTTON) ? 0 : 1;
 	struct input_dev *dev = (struct input_dev *) dev_id;
@@ -111,21 +115,25 @@ static void action_button_handler(int irq, void *dev_id, struct pt_regs *regs)
 	input_regs(dev, regs);
 	input_report_key(dev, KEY_ENTER, down);
 	input_sync(dev);
+
+	return IRQ_HANDLED;
 }
 
-static void npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t npower_button_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
         int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1;
 	struct input_dev *dev = (struct input_dev *) dev_id;
 
-	/* 
-	 * This interrupt is only called when we release the key. So we have 
+	/*
+	 * This interrupt is only called when we release the key. So we have
 	 * to fake a key press.
-	 */ 	
+	 */
 	input_regs(dev, regs);
 	input_report_key(dev, KEY_SUSPEND, 1);
-	input_report_key(dev, KEY_SUSPEND, down); 	
+	input_report_key(dev, KEY_SUSPEND, down);
 	input_sync(dev);
+
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_PM
@@ -141,21 +149,21 @@ enum flite_pwr {
  * h3600_flite_power: enables or disables power to frontlight, using last bright */
 unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr)
 {
-	unsigned char brightness = ((pwr==FLITE_PWR_OFF) ? 0:flite_brightness);
+	unsigned char brightness = (pwr == FLITE_PWR_OFF) ? 0 : flite_brightness;
 	struct h3600_dev *ts = dev->private;
 
-	/* Must be in this order */	
+	/* Must be in this order */
        	ts->serio->write(ts->serio, 1);
 	ts->serio->write(ts->serio, pwr);
-      	ts->serio->write(ts->serio, brightness); 
+      	ts->serio->write(ts->serio, brightness);
 	return 0;
 }
 
 static int suspended = 0;
-static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req, 
+static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
 				void *data)
 {
-	struct input_dev *dev = (struct input_dev *) data;	
+	struct input_dev *dev = (struct input_dev *) data;
 
         switch (req) {
         case PM_SUSPEND: /* enter D1-D3 */
@@ -183,7 +191,7 @@ static int h3600ts_pm_callback(struct pm_dev *pm_dev, pm_request_t req,
 /*
  * This function translates the native event packets to linux input event
  * packets. Some packets coming from serial are not touchscreen related. In
- * this case we send them off to be processed elsewhere. 
+ * this case we send them off to be processed elsewhere.
  */
 static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
 {
@@ -206,7 +214,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
                 Note: This is true for non interrupt generated key events.
                 */
                 case KEYBD_ID:
-			down = (ts->buf[0] & 0x80) ? 0 : 1; 
+			down = (ts->buf[0] & 0x80) ? 0 : 1;
 
 			switch (ts->buf[0] & 0x7f) {
 				case H3600_SCANCODE_RECORD:
@@ -218,7 +226,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
 				case H3600_SCANCODE_CONTACTS:
 					key = KEY_PROG2;
                                         break;
-				case H3600_SCANCODE_Q:        
+				case H3600_SCANCODE_Q:
 					key = KEY_Q;
                                         break;
 				case H3600_SCANCODE_START:
@@ -237,9 +245,9 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
 					key = KEY_DOWN;
                                         break;
 				default:
-					key = 0;	
-			}	
-                        if (key) 
+					key = 0;
+			}
+                        if (key)
                         	input_report_key(dev, key, down);
                         break;
                 /*
@@ -251,13 +259,13 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
                  *       byte 0    1       2       3
                  */
                 case TOUCHS_ID:
-			if (!touched) { 
+			if (!touched) {
 				input_report_key(dev, BTN_TOUCH, 1);
 				touched = 1;
-			}			
+			}
 
 			if (ts->len) {
-				unsigned short x, y;				
+				unsigned short x, y;
 
 				x = ts->buf[0]; x <<= 8; x += ts->buf[1];
                                 y = ts->buf[2]; y <<= 8; y += ts->buf[3];
@@ -267,7 +275,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
 			} else {
 		               	input_report_key(dev, BTN_TOUCH, 0);
 				touched = 0;
-			}	
+			}
                         break;
 		default:
 			/* Send a non input event elsewhere */
@@ -280,7 +288,7 @@ static void h3600ts_process_packet(struct h3600_dev *ts, struct pt_regs *regs)
 /*
  * h3600ts_event() handles events from the input module.
  */
-static int h3600ts_event(struct input_dev *dev, unsigned int type, 
+static int h3600ts_event(struct input_dev *dev, unsigned int type,
 		 	 unsigned int code, int value)
 {
 	struct h3600_dev *ts = dev->private;
@@ -290,7 +298,7 @@ static int h3600ts_event(struct input_dev *dev, unsigned int type,
 		//	ts->serio->write(ts->serio, SOME_CMD);
 			return 0;
 		}
-	}					
+	}
 	return -1;
 }
 
@@ -317,19 +325,19 @@ static int state;
 #define STATE_DATA      2       /* state where we decode data */
 #define STATE_EOF       3       /* state where we decode checksum or EOF */
 
-static void h3600ts_interrupt(struct serio *serio, unsigned char data,
-                              unsigned int flags)
+static irqreturn_t h3600ts_interrupt(struct serio *serio, unsigned char data,
+                                     unsigned int flags, struct pt_regs *regs)
 {
         struct h3600_dev *ts = serio->private;
 
 	/*
-         * We have a new frame coming in. 
+         * We have a new frame coming in.
          */
 	switch (state) {
 		case STATE_SOF:
         		if (data == CHAR_SOF)
-                		state = STATE_ID;	
-			return;
+                		state = STATE_ID;
+			break;
         	case STATE_ID:
 			ts->event = (data & 0xf0) >> 4;
 			ts->len = (data & 0xf);
@@ -339,23 +347,25 @@ static void h3600ts_interrupt(struct serio *serio, unsigned char data,
                         	break;
 			}
 			ts->chksum = data;
-                	state=(ts->len > 0 ) ? STATE_DATA : STATE_EOF;
+                	state = (ts->len > 0) ? STATE_DATA : STATE_EOF;
 			break;
 		case STATE_DATA:
 			ts->chksum += data;
 			ts->buf[ts->idx]= data;
-			if(++ts->idx == ts->len) 
+			if(++ts->idx == ts->len)
                         	state = STATE_EOF;
 			break;
 		case STATE_EOF:
                 	state = STATE_SOF;
-                	if (data == CHAR_EOF || data == ts->chksum )
-				h3600ts_process_packet(ts);
+                	if (data == CHAR_EOF || data == ts->chksum)
+				h3600ts_process_packet(ts, regs);
                 	break;
         	default:
                 	printk("Error3\n");
                 	break;
 	}
+
+	return IRQ_HANDLED;
 }
 
 /*
@@ -378,11 +388,11 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
 	init_input_dev(&ts->dev);
 
 	/* Device specific stuff */
-        set_GPIO_IRQ_edge( GPIO_BITSY_ACTION_BUTTON, GPIO_BOTH_EDGES );
-        set_GPIO_IRQ_edge( GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE );
+        set_GPIO_IRQ_edge(GPIO_BITSY_ACTION_BUTTON, GPIO_BOTH_EDGES);
+        set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE);
 
         if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler,
-			SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,	
+			SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
 			"h3600_action", &ts->dev)) {
 		printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n");
 		kfree(ts);
@@ -390,24 +400,19 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
 	}
 
         if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler,
-			SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM, 
+			SA_SHIRQ | SA_INTERRUPT | SA_SAMPLE_RANDOM,
 			"h3600_suspend", &ts->dev)) {
 		free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev);
 		printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n");
 		kfree(ts);
 		return;
 	}
+
 	/* Now we have things going we setup our input device */
 	ts->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_LED) | BIT(EV_PWR);
-	ts->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
-	ts->dev.ledbit[0] = BIT(LED_SLEEP); 
-
-	ts->dev.absmin[ABS_X] = 60;   ts->dev.absmin[ABS_Y] = 35;
-	ts->dev.absmax[ABS_X] = 985; ts->dev.absmax[ABS_Y] = 1024;
-	ts->dev.absfuzz[ABS_X] = 0; ts->dev.absfuzz[ABS_Y] = 0;
-
-	ts->serio = serio;
-	serio->private = ts;
+	ts->dev.ledbit[0] = BIT(LED_SLEEP);
+	input_set_abs_params(&ts->dev, ABS_X, 60, 985, 0, 0);
+	input_set_abs_params(&ts->dev, ABS_Y, 35, 1024, 0, 0);
 
 	set_bit(KEY_RECORD, ts->dev.keybit);
 	set_bit(KEY_Q, ts->dev.keybit);
@@ -422,6 +427,9 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
 	ts->dev.keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
 	ts->dev.keybit[LONG(KEY_SUSPEND)] |= BIT(KEY_SUSPEND);
 
+	ts->serio = serio;
+	serio->private = ts;
+
 	sprintf(ts->phys, "%s/input0", serio->phys);
 
        	ts->dev.event = h3600ts_event;
@@ -442,7 +450,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
 
 	//h3600_flite_control(1, 25);     /* default brightness */
 #ifdef CONFIG_PM
-	ts->dev.pm_dev = pm_register(PM_ILLUMINATION_DEV, PM_SYS_LIGHT, 
+	ts->dev.pm_dev = pm_register(PM_ILLUMINATION_DEV, PM_SYS_LIGHT,
 					h3600ts_pm_callback);
 	printk("registered pm callback\n");
 #endif
@@ -458,7 +466,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
 static void h3600ts_disconnect(struct serio *serio)
 {
 	struct h3600_dev *ts = serio->private;
-	
+
         free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, &ts->dev);
         free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, &ts->dev);
 	input_unregister_device(&ts->dev);
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 8cb940877..9661806d0 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -505,12 +505,12 @@ static int avmcs_event(event_t event, int priority,
 } /* avmcs_event */
 
 static struct pcmcia_driver avmcs_driver = {
-	.owner		= THIS_MODULE,
-	.drv		= {
-		.name	= "avmcs_cs",
+	.owner	= THIS_MODULE,
+	.drv	= {
+		.name	= "avm_cs",
 	},
-	.attach		= avmcs_attach,
-	.detach		= avmcs_detach,
+	.attach	= avmcs_attach,
+	.detach	= avmcs_detach,
 };
 
 static int __init avmcs_init(void)
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index d3b93f855..f00f6ba19 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -1,4 +1,4 @@
-/* $Id: divasmain.c,v 1.55 2004/04/08 01:17:58 armin Exp $
+/* $Id: divasmain.c,v 1.55.4.1 2004/05/21 12:15:00 armin Exp $
  *
  * Low level driver for Eicon DIVA Server ISDN cards.
  *
@@ -41,7 +41,7 @@
 #include "diva_dma.h"
 #include "diva_pci.h"
 
-static char *main_revision = "$Revision: 1.55 $";
+static char *main_revision = "$Revision: 1.55.4.1 $";
 
 static int major;
 
@@ -157,7 +157,7 @@ MODULE_DEVICE_TABLE(pci, divas_pci_tbl);
 
 static int divas_init_one(struct pci_dev *pdev,
 			  const struct pci_device_id *ent);
-static void divas_remove_one(struct pci_dev *pdev);
+static void __devexit divas_remove_one(struct pci_dev *pdev);
 
 static struct pci_driver diva_pci_driver = {
 	.name     = "divas",
diff --git a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c
index 5fd47f618..8b5822c42 100644
--- a/drivers/isdn/hisax/nj_s.c
+++ b/drivers/isdn/hisax/nj_s.c
@@ -104,9 +104,12 @@ reset_netjet_s(struct IsdnCardState *cs)
 	cs->hw.njet.ctrl_reg = 0xff;  /* Reset On */
 	byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
 	mdelay(10);
-	cs->hw.njet.ctrl_reg = 0x00;  /* Reset Off and status read clear */
 	/* now edge triggered for TJ320 GE 13/07/00 */
 	/* see comment in IRQ function */
+	if (cs->subtyp) /* TJ320 */
+		cs->hw.njet.ctrl_reg = 0x40;  /* Reset Off and status read clear */
+	else
+		cs->hw.njet.ctrl_reg = 0x00;  /* Reset Off and status read clear */
 	byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
 	mdelay(10);
 	cs->hw.njet.auxd = 0;
@@ -151,7 +154,7 @@ static struct pci_dev *dev_netjet __initdata = NULL;
 int __init
 setup_netjet_s(struct IsdnCard *card)
 {
-	int bytecnt;
+	int bytecnt,cfg;
 	struct IsdnCardState *cs = card->cs;
 	char tmp[64];
 
@@ -183,6 +186,15 @@ setup_netjet_s(struct IsdnCard *card)
 				printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
 				return(0);
 			}
+			/* the TJ300 and TJ320 must be detected, the IRQ handling is different
+			 * unfortunatly the chips use the same device ID, but the TJ320 has
+			 * the bit20 in status PCI cfg register set
+			 */
+			pci_read_config_dword(dev_netjet, 0x04, &cfg);
+			if (cfg & 0x00100000)
+				cs->subtyp = 1; /* TJ320 */
+			else
+				cs->subtyp = 0; /* TJ300 */
 			/* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
 			if ((dev_netjet->subsystem_vendor == 0x55) &&
 				(dev_netjet->subsystem_device == 0x02)) {
@@ -240,8 +252,8 @@ setup_netjet_s(struct IsdnCard *card)
 	bytecnt = 256;
 
 	printk(KERN_INFO
-		"NETjet-S: PCI card configured at %#lx IRQ %d\n",
-		cs->hw.njet.base, cs->irq);
+		"NETjet-S: %s card configured at %#lx IRQ %d\n",
+		cs->subtyp ? "TJ320" : "TJ300", cs->hw.njet.base, cs->irq);
 	if (!request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn")) {
 		printk(KERN_WARNING
 		       "HiSax: %s config port %#lx-%#lx already in use\n",
diff --git a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c
index 010d55996..880d07b3f 100644
--- a/drivers/isdn/hisax/st5481_b.c
+++ b/drivers/isdn/hisax/st5481_b.c
@@ -257,13 +257,18 @@ static void st5481B_mode(struct st5481_bcs *bcs, int mode)
 static int st5481_setup_b_out(struct st5481_bcs *bcs)
 {
 	struct usb_device *dev = bcs->adapter->usb_dev;
-	struct usb_host_interface *altsetting;
+	struct usb_interface *intf;
+	struct usb_host_interface *altsetting = NULL;
 	struct usb_host_endpoint *endpoint;
   	struct st5481_b_out *b_out = &bcs->b_out;
 
 	DBG(4,"");
 
-	altsetting = &(dev->config->interface[0]->altsetting[3]);
+	intf = usb_ifnum_to_if(dev, 0);
+	if (intf)
+		altsetting = usb_altnum_to_altsetting(intf, 3);
+	if (!altsetting)
+		return -ENXIO;
 
 	// Allocate URBs and buffers for the B channel out
 	endpoint = &altsetting->endpoint[EP_B1_OUT - 1 + bcs->channel * 2];
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
index 45a0300d0..5ff7fdf72 100644
--- a/drivers/isdn/hisax/st5481_d.c
+++ b/drivers/isdn/hisax/st5481_d.c
@@ -652,13 +652,18 @@ static void ph_disconnect(struct st5481_adapter *adapter)
 static int st5481_setup_d_out(struct st5481_adapter *adapter)
 {
 	struct usb_device *dev = adapter->usb_dev;
-	struct usb_host_interface *altsetting;
+	struct usb_interface *intf;
+	struct usb_host_interface *altsetting = NULL;
 	struct usb_host_endpoint *endpoint;
 	struct st5481_d_out *d_out = &adapter->d_out;
 
 	DBG(2,"");
 
-	altsetting = &(dev->config->interface[0]->altsetting[3]);
+	intf = usb_ifnum_to_if(dev, 0);
+	if (intf)
+		altsetting = usb_altnum_to_altsetting(intf, 3);
+	if (!altsetting)
+		return -ENXIO;
 
 	// Allocate URBs and buffers for the D channel out
 	endpoint = &altsetting->endpoint[EP_D_OUT-1];
diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c
index bf5f0f09e..04f9c5ce2 100644
--- a/drivers/isdn/hisax/st5481_usb.c
+++ b/drivers/isdn/hisax/st5481_usb.c
@@ -244,7 +244,8 @@ int st5481_setup_usb(struct st5481_adapter *adapter)
 	struct usb_device *dev = adapter->usb_dev;
 	struct st5481_ctrl *ctrl = &adapter->ctrl;
 	struct st5481_intr *intr = &adapter->intr;
-	struct usb_host_interface *altsetting;
+	struct usb_interface *intf;
+	struct usb_host_interface *altsetting = NULL;
 	struct usb_host_endpoint *endpoint;
 	int status;
 	struct urb *urb;
@@ -257,8 +258,11 @@ int st5481_setup_usb(struct st5481_adapter *adapter)
 		return status;
 	}
 
-	
-	altsetting = &(dev->config->interface[0]->altsetting[3]);	
+	intf = usb_ifnum_to_if(dev, 0);
+	if (intf)
+		altsetting = usb_altnum_to_altsetting(intf, 3);
+	if (!altsetting)
+		return -ENXIO;
 
 	// Check if the config is sane
 	if ( altsetting->desc.bNumEndpoints != 7 ) {
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index daec60351..1b95f6005 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -386,7 +386,7 @@ isdn_all_eaz(int di, int ch)
  * Begin of a CAPI like LL<->HL interface, currently used only for 
  * supplementary service (CAPI 2.0 part III)
  */
-#include <linux/isdn//capicmd.h>
+#include <linux/isdn/capicmd.h>
 
 int
 isdn_capi_rec_hl_msg(capi_msg *cm) {
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 8a6fb9fd4..80b5a8200 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -127,7 +127,7 @@ config MAC_FLOPPY
 
 config MAC_SERIAL
 	tristate "Support for PowerMac serial ports (OBSOLETE DRIVER)"
-	depends on PPC_PMAC
+	depends on PPC_PMAC && BROKEN
 	help
 	  This driver is obsolete. Use CONFIG_SERIAL_PMACZILOG in
 	  "Character devices --> Serial drivers --> PowerMac z85c30" option.
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index f100c194b..3d2357e50 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -10,7 +10,7 @@
  *
  * To do:
  *
- * - /proc/adb to list the devices and infos
+ * - /sys/bus/adb to list the devices and infos
  * - more /dev/adb to allow userland to receive the
  *   flow of auto-polling datas from a given device.
  * - move bus probe to a kernel thread
@@ -23,7 +23,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/fs.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
@@ -36,6 +35,9 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/completion.h>
+#include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
+
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #ifdef CONFIG_PPC
@@ -75,6 +77,8 @@ static struct adb_driver *adb_driver_list[] = {
 	NULL
 };
 
+static struct class_simple *adb_dev_class;
+
 struct adb_driver *adb_controller;
 struct notifier_block *adb_client_list = NULL;
 static int adb_got_sleep;
@@ -883,6 +887,7 @@ out:
 }
 
 static struct file_operations adb_fops = {
+	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
 	.read		= adb_read,
 	.write		= adb_write,
@@ -893,9 +898,16 @@ static struct file_operations adb_fops = {
 static void
 adbdev_init(void)
 {
-	if (register_chrdev(ADB_MAJOR, "adb", &adb_fops))
+	if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
 		printk(KERN_ERR "adb: unable to get major %d\n", ADB_MAJOR);
-	else
-		devfs_mk_cdev(MKDEV(ADB_MAJOR, 0),
-				S_IFCHR | S_IRUSR | S_IWUSR, "adb");
+		return;
+	}
+
+	devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb");
+
+	adb_dev_class = class_simple_create(THIS_MODULE, "adb");
+	if (IS_ERR(adb_dev_class)) {
+		return;
+	}
+	class_simple_device_add(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
 }
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 05bd57a29..37f06c81d 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -246,8 +246,7 @@ static int monitor_task(void *arg)
 
 	while(monitor_running)
 	{
-		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(2*HZ);
+		msleep(2000);
 
 		/* Check status */
 		/* local   : chip */
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 6636567f4..fb2e0707b 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -146,13 +146,6 @@ static struct i2c_driver therm_pm72_driver =
 	.detach_adapter	= therm_pm72_detach,
 };
 
-
-static inline void wait_ms(unsigned int ms)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(1 + (ms * HZ + 999) / 1000);
-}
-
 /*
  * Utility function to create an i2c_client structure and
  * attach it to one of u3 adapters
@@ -251,7 +244,7 @@ static int read_smon_adc(struct cpu_pid_state *state, int chan)
 		if (rc <= 0)
 			goto error;
 		/* Wait for convertion */
-		wait_ms(1);
+		msleep(1);
 		/* Switch to data register */
 		buf[0] = 4;
 		rc = i2c_master_send(state->monitor, buf, 1);
@@ -269,7 +262,7 @@ static int read_smon_adc(struct cpu_pid_state *state, int chan)
 			printk(KERN_ERR "therm_pm72: Error reading ADC !\n");
 			return -1;
 		}
-		wait_ms(10);
+		msleep(10);
 	}
 }
 
@@ -283,7 +276,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb)
 		nw = i2c_master_send(fcu, buf, 1);
 		if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
 			break;
-		wait_ms(10);
+		msleep(10);
 		++tries;
 	}
 	if (nw <= 0) {
@@ -295,7 +288,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb)
 		nr = i2c_master_recv(fcu, buf, nb);
 		if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
 			break;
-		wait_ms(10);
+		msleep(10);
 		++tries;
 	}
 	if (nr <= 0)
@@ -316,7 +309,7 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
 		nw = i2c_master_send(fcu, buf, nb);
 		if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
 			break;
-		wait_ms(10);
+		msleep(10);
 		++tries;
 	}
 	if (nw < 0)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 26e07286e..e1703f77c 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -46,7 +46,7 @@ struct vers_iter {
 static struct list_head _name_buckets[NUM_BUCKETS];
 static struct list_head _uuid_buckets[NUM_BUCKETS];
 
-void dm_hash_remove_all(void);
+static void dm_hash_remove_all(void);
 
 /*
  * Guards access to both hash tables.
@@ -61,7 +61,7 @@ static void init_buckets(struct list_head *buckets)
 		INIT_LIST_HEAD(buckets + i);
 }
 
-int dm_hash_init(void)
+static int dm_hash_init(void)
 {
 	init_buckets(_name_buckets);
 	init_buckets(_uuid_buckets);
@@ -69,7 +69,7 @@ int dm_hash_init(void)
 	return 0;
 }
 
-void dm_hash_exit(void)
+static void dm_hash_exit(void)
 {
 	dm_hash_remove_all();
 	devfs_remove(DM_DIR);
@@ -195,7 +195,7 @@ static int unregister_with_devfs(struct hash_cell *hc)
  * The kdev_t and uuid of a device can never change once it is
  * initially inserted.
  */
-int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md)
+static int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md)
 {
 	struct hash_cell *cell;
 
@@ -234,7 +234,7 @@ int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md)
 	return -EBUSY;
 }
 
-void __hash_remove(struct hash_cell *hc)
+static void __hash_remove(struct hash_cell *hc)
 {
 	/* remove from the dev hash */
 	list_del(&hc->uuid_list);
@@ -246,7 +246,7 @@ void __hash_remove(struct hash_cell *hc)
 	free_cell(hc);
 }
 
-void dm_hash_remove_all(void)
+static void dm_hash_remove_all(void)
 {
 	int i;
 	struct hash_cell *hc;
@@ -262,7 +262,7 @@ void dm_hash_remove_all(void)
 	up_write(&_hash_lock);
 }
 
-int dm_hash_rename(const char *old, const char *new)
+static int dm_hash_rename(const char *old, const char *new)
 {
 	char *new_name, *old_name;
 	struct hash_cell *hc;
@@ -377,7 +377,7 @@ static int list_devices(struct dm_ioctl *param, size_t param_size)
 	for (i = 0; i < NUM_BUCKETS; i++) {
 		list_for_each_entry (hc, _name_buckets + i, name_list) {
 			needed += sizeof(struct dm_name_list);
-			needed += strlen(hc->name);
+			needed += strlen(hc->name) + 1;
 			needed += ALIGN_MASK;
 		}
 	}
@@ -417,9 +417,9 @@ static int list_devices(struct dm_ioctl *param, size_t param_size)
 	return 0;
 }
 
-static void list_version_get_needed(struct target_type *tt, void *param)
+static void list_version_get_needed(struct target_type *tt, void *needed_param)
 {
-    int *needed = param;
+    size_t *needed = needed_param;
 
     *needed += strlen(tt->name);
     *needed += sizeof(tt->version);
@@ -850,7 +850,6 @@ static int dev_wait(struct dm_ioctl *param, size_t param_size)
 	int r;
 	struct mapped_device *md;
 	struct dm_table *table;
-	DECLARE_WAITQUEUE(wq, current);
 
 	md = find_device(param);
 	if (!md)
@@ -859,12 +858,10 @@ static int dev_wait(struct dm_ioctl *param, size_t param_size)
 	/*
 	 * Wait for a notification event
 	 */
-	set_current_state(TASK_INTERRUPTIBLE);
-	if (!dm_add_wait_queue(md, &wq, param->event_nr)) {
-		schedule();
-		dm_remove_wait_queue(md, &wq);
+	if (dm_wait_event(md, param->event_nr)) {
+		r = -ERESTARTSYS;
+		goto out;
 	}
- 	set_current_state(TASK_RUNNING);
 
 	/*
 	 * The userland program is going to want to know what
@@ -1136,7 +1133,7 @@ static ioctl_fn lookup_ioctl(unsigned int cmd)
  * As well as checking the version compatibility this always
  * copies the kernel interface version out.
  */
-static int check_version(unsigned int cmd, struct dm_ioctl *user)
+static int check_version(unsigned int cmd, struct dm_ioctl __user *user)
 {
 	uint32_t version[3];
 	int r = 0;
@@ -1171,7 +1168,7 @@ static void free_params(struct dm_ioctl *param)
 	vfree(param);
 }
 
-static int copy_params(struct dm_ioctl *user, struct dm_ioctl **param)
+static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param)
 {
 	struct dm_ioctl tmp, *dmi;
 
@@ -1228,7 +1225,7 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
 	int r = 0;
 	unsigned int cmd;
 	struct dm_ioctl *param;
-	struct dm_ioctl *user = (struct dm_ioctl *) u;
+	struct dm_ioctl __user *user = (struct dm_ioctl __user *) u;
 	ioctl_fn fn = NULL;
 	size_t param_size;
 
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 87df3e90f..14cabe53f 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -181,8 +181,8 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
 	/*
 	 * Allocate both the target array and offset array at once.
 	 */
-	n_highs = (sector_t *) dm_vcalloc(sizeof(struct dm_target) +
-					  sizeof(sector_t), num);
+	n_highs = (sector_t *) dm_vcalloc(num, sizeof(struct dm_target) +
+					  sizeof(sector_t));
 	if (!n_highs)
 		return -ENOMEM;
 
diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c
index 7a9122d70..2f67b4d68 100644
--- a/drivers/md/dm-target.c
+++ b/drivers/md/dm-target.c
@@ -7,6 +7,7 @@
 #include "dm.h"
 
 #include <linux/module.h>
+#include <linux/init.h>
 #include <linux/kmod.h>
 #include <linux/bio.h>
 #include <linux/slab.h>
@@ -181,7 +182,7 @@ static struct target_type error_target = {
 	.map  = io_err_map,
 };
 
-int dm_target_init(void)
+int __init dm_target_init(void)
 {
 	return dm_register_target(&error_target);
 }
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index bdfcbe09d..03381e003 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -80,7 +80,7 @@ struct mapped_device {
 	/*
 	 * Event handling.
 	 */
-	uint32_t event_nr;
+	atomic_t event_nr;
 	wait_queue_head_t eventq;
 
 	/*
@@ -93,7 +93,7 @@ struct mapped_device {
 static kmem_cache_t *_io_cache;
 static kmem_cache_t *_tio_cache;
 
-static __init int local_init(void)
+static int __init local_init(void)
 {
 	int r;
 
@@ -369,6 +369,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
 		struct dm_io *io = tio->io;
 		free_tio(tio->io->md, tio);
 		dec_pending(io, -EIO);
+		bio_put(clone);
 	}
 }
 
@@ -662,6 +663,8 @@ static int next_free_minor(unsigned int *minor)
 	return r;
 }
 
+static struct block_device_operations dm_blk_dops;
+
 /*
  * Allocate and initialise a blank device with a given minor.
  */
@@ -684,6 +687,7 @@ static struct mapped_device *alloc_dev(unsigned int minor, int persistent)
 	init_rwsem(&md->lock);
 	rwlock_init(&md->map_lock);
 	atomic_set(&md->holders, 1);
+	atomic_set(&md->event_nr, 0);
 
 	md->queue = blk_alloc_queue(GFP_KERNEL);
 	if (!md->queue)
@@ -753,10 +757,8 @@ static void event_callback(void *context)
 {
 	struct mapped_device *md = (struct mapped_device *) context;
 
-	down_write(&md->lock);
-	md->event_nr++;
+	atomic_inc(&md->event_nr);;
 	wake_up(&md->eventq);
-	up_write(&md->lock);
 }
 
 static void __set_size(struct gendisk *disk, sector_t size)
@@ -1054,35 +1056,13 @@ int dm_resume(struct mapped_device *md)
  *---------------------------------------------------------------*/
 uint32_t dm_get_event_nr(struct mapped_device *md)
 {
-	uint32_t r;
-
-	down_read(&md->lock);
-	r = md->event_nr;
-	up_read(&md->lock);
-
-	return r;
+	return atomic_read(&md->event_nr);
 }
 
-int dm_add_wait_queue(struct mapped_device *md, wait_queue_t *wq,
-		      uint32_t event_nr)
+int dm_wait_event(struct mapped_device *md, int event_nr)
 {
-	down_write(&md->lock);
-	if (event_nr != md->event_nr) {
-		up_write(&md->lock);
-		return 1;
-	}
-
-	add_wait_queue(&md->eventq, wq);
-	up_write(&md->lock);
-
-	return 0;
-}
-
-void dm_remove_wait_queue(struct mapped_device *md, wait_queue_t *wq)
-{
-	down_write(&md->lock);
-	remove_wait_queue(&md->eventq, wq);
-	up_write(&md->lock);
+	return wait_event_interruptible(md->eventq,
+			(event_nr != atomic_read(&md->event_nr)));
 }
 
 /*
@@ -1099,7 +1079,7 @@ int dm_suspended(struct mapped_device *md)
 	return test_bit(DMF_SUSPENDED, &md->flags);
 }
 
-struct block_device_operations dm_blk_dops = {
+static struct block_device_operations dm_blk_dops = {
 	.open = dm_blk_open,
 	.release = dm_blk_close,
 	.owner = THIS_MODULE
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 34bf0e7cc..b4b915fbd 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -31,8 +31,6 @@
 
 #define SECTOR_SHIFT 9
 
-extern struct block_device_operations dm_blk_dops;
-
 /*
  * List of devices that a metadevice uses and should open/close.
  */
@@ -81,9 +79,7 @@ struct dm_table *dm_get_table(struct mapped_device *md);
  * Event functions.
  */
 uint32_t dm_get_event_nr(struct mapped_device *md);
-int dm_add_wait_queue(struct mapped_device *md, wait_queue_t *wq,
-		      uint32_t event_nr);
-void dm_remove_wait_queue(struct mapped_device *md, wait_queue_t *wq);
+int dm_wait_event(struct mapped_device *md, int event_nr);
 
 /*
  * Info functions.
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c451c8dba..77cd6e9f3 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1607,7 +1607,7 @@ static int do_md_run(mddev_t * mddev)
 	spin_lock(&pers_lock);
 	if (!pers[pnum] || !try_module_get(pers[pnum]->owner)) {
 		spin_unlock(&pers_lock);
-		printk(KERN_ERR "md: personality %d is not loaded!\n",
+		printk(KERN_WARNING "md: personality %d is not loaded!\n",
 		       pnum);
 		return -EINVAL;
 	}
@@ -1934,7 +1934,7 @@ static int autostart_array(dev_t startdev)
 }
 
 
-static int get_version(void * arg)
+static int get_version(void __user * arg)
 {
 	mdu_version_t ver;
 
@@ -1948,7 +1948,7 @@ static int get_version(void * arg)
 	return 0;
 }
 
-static int get_array_info(mddev_t * mddev, void * arg)
+static int get_array_info(mddev_t * mddev, void __user * arg)
 {
 	mdu_array_info_t info;
 	int nr,working,active,failed,spare;
@@ -1998,7 +1998,7 @@ static int get_array_info(mddev_t * mddev, void * arg)
 	return 0;
 }
 
-static int get_disk_info(mddev_t * mddev, void * arg)
+static int get_disk_info(mddev_t * mddev, void __user * arg)
 {
 	mdu_disk_info_t info;
 	unsigned int nr;
@@ -2251,7 +2251,12 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
 		return -EINVAL;
 	}
 
-	rdev->sb_offset = calc_dev_sboffset(rdev->bdev);
+	if (mddev->persistent)
+		rdev->sb_offset = calc_dev_sboffset(rdev->bdev);
+	else
+		rdev->sb_offset =
+			rdev->bdev->bd_inode->i_size >> BLOCK_SIZE_BITS;
+
 	size = calc_dev_size(rdev, mddev->chunk_size);
 	rdev->size = size;
 
@@ -2372,6 +2377,103 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info)
 	return 0;
 }
 
+/*
+ * update_array_info is used to change the configuration of an
+ * on-line array.
+ * The version, ctime,level,size,raid_disks,not_persistent, layout,chunk_size
+ * fields in the info are checked against the array.
+ * Any differences that cannot be handled will cause an error.
+ * Normally, only one change can be managed at a time.
+ */
+static int update_array_info(mddev_t *mddev, mdu_array_info_t *info)
+{
+	int rv = 0;
+	int cnt = 0;
+
+	if (mddev->major_version != info->major_version ||
+	    mddev->minor_version != info->minor_version ||
+/*	    mddev->patch_version != info->patch_version || */
+	    mddev->ctime         != info->ctime         ||
+	    mddev->level         != info->level         ||
+	    mddev->layout        != info->layout        ||
+	    !mddev->persistent	 != info->not_persistent||
+	    mddev->chunk_size    != info->chunk_size    )
+		return -EINVAL;
+	/* Check there is only one change */
+	if (mddev->size != info->size) cnt++;
+	if (mddev->raid_disks != info->raid_disks) cnt++;
+	if (cnt == 0) return 0;
+	if (cnt > 1) return -EINVAL;
+
+	if (mddev->size != info->size) {
+		mdk_rdev_t * rdev;
+		struct list_head *tmp;
+		if (mddev->pers->resize == NULL)
+			return -EINVAL;
+		/* The "size" is the amount of each device that is used.
+		 * This can only make sense for arrays with redundancy.
+		 * linear and raid0 always use whatever space is available
+		 * We can only consider changing the size of no resync
+		 * or reconstruction is happening, and if the new size
+		 * is acceptable. It must fit before the sb_offset or,
+		 * if that is <data_offset, it must fit before the
+		 * size of each device.
+		 * If size is zero, we find the largest size that fits.
+		 */
+		if (mddev->sync_thread)
+			return -EBUSY;
+		ITERATE_RDEV(mddev,rdev,tmp) {
+			sector_t avail;
+			int fit = (info->size == 0);
+			if (rdev->sb_offset > rdev->data_offset)
+				avail = (rdev->sb_offset*2) - rdev->data_offset;
+			else
+				avail = get_capacity(rdev->bdev->bd_disk)
+					- rdev->data_offset;
+			if (fit && (info->size == 0 || info->size > avail/2))
+				info->size = avail/2;
+			if (avail < ((sector_t)info->size << 1))
+				return -ENOSPC;
+		}
+		rv = mddev->pers->resize(mddev, (sector_t)info->size *2);
+		if (!rv) {
+			struct block_device *bdev;
+
+			bdev = bdget_disk(mddev->gendisk, 0);
+			if (bdev) {
+				down(&bdev->bd_inode->i_sem);
+				i_size_write(bdev->bd_inode, mddev->array_size << 10);
+				up(&bdev->bd_inode->i_sem);
+				bdput(bdev);
+			}
+		}
+	}
+	if (mddev->raid_disks    != info->raid_disks) {
+		/* change the number of raid disks */
+		if (mddev->pers->reshape == NULL)
+			return -EINVAL;
+		if (info->raid_disks <= 0 ||
+		    info->raid_disks >= mddev->max_disks)
+			return -EINVAL;
+		if (mddev->sync_thread)
+			return -EBUSY;
+		rv = mddev->pers->reshape(mddev, info->raid_disks);
+		if (!rv) {
+			struct block_device *bdev;
+
+			bdev = bdget_disk(mddev->gendisk, 0);
+			if (bdev) {
+				down(&bdev->bd_inode->i_sem);
+				i_size_write(bdev->bd_inode, mddev->array_size << 10);
+				up(&bdev->bd_inode->i_sem);
+				bdput(bdev);
+			}
+		}
+	}
+	md_update_sb(mddev);
+	return rv;
+}
+
 static int set_disk_faulty(mddev_t *mddev, dev_t dev)
 {
 	mdk_rdev_t *rdev;
@@ -2389,7 +2491,8 @@ static int md_ioctl(struct inode *inode, struct file *file,
 {
 	char b[BDEVNAME_SIZE];
 	int err = 0;
-	struct hd_geometry *loc = (struct hd_geometry *) arg;
+	void __user *argp = (void __user *)arg;
+	struct hd_geometry __user *loc = argp;
 	mddev_t *mddev = NULL;
 
 	if (!capable(CAP_SYS_ADMIN))
@@ -2402,7 +2505,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
 	switch (cmd)
 	{
 		case RAID_VERSION:
-			err = get_version((void *)arg);
+			err = get_version(argp);
 			goto done;
 
 		case PRINT_RAID_DEBUG:
@@ -2463,33 +2566,41 @@ static int md_ioctl(struct inode *inode, struct file *file,
 	switch (cmd)
 	{
 		case SET_ARRAY_INFO:
-
-			if (!list_empty(&mddev->disks)) {
-				printk(KERN_WARNING 
-					"md: array %s already has disks!\n",
-					mdname(mddev));
-				err = -EBUSY;
-				goto abort_unlock;
-			}
-			if (mddev->raid_disks) {
-				printk(KERN_WARNING 
-					"md: array %s already initialised!\n",
-					mdname(mddev));
-				err = -EBUSY;
-				goto abort_unlock;
-			}
 			{
 				mdu_array_info_t info;
 				if (!arg)
 					memset(&info, 0, sizeof(info));
-				else if (copy_from_user(&info, (void*)arg, sizeof(info))) {
+				else if (copy_from_user(&info, argp, sizeof(info))) {
 					err = -EFAULT;
 					goto abort_unlock;
 				}
+				if (mddev->pers) {
+					err = update_array_info(mddev, &info);
+					if (err) {
+						printk(KERN_WARNING "md: couldn't update"
+						       " array info. %d\n", err);
+						goto abort_unlock;
+					}
+					goto done_unlock;
+				}
+				if (!list_empty(&mddev->disks)) {
+					printk(KERN_WARNING
+					       "md: array %s already has disks!\n",
+					       mdname(mddev));
+					err = -EBUSY;
+					goto abort_unlock;
+				}
+				if (mddev->raid_disks) {
+					printk(KERN_WARNING
+					       "md: array %s already initialised!\n",
+					       mdname(mddev));
+					err = -EBUSY;
+					goto abort_unlock;
+				}
 				err = set_array_info(mddev, &info);
 				if (err) {
 					printk(KERN_WARNING "md: couldn't set"
-						" array info. %d\n", err);
+					       " array info. %d\n", err);
 					goto abort_unlock;
 				}
 			}
@@ -2513,11 +2624,11 @@ static int md_ioctl(struct inode *inode, struct file *file,
 	switch (cmd)
 	{
 		case GET_ARRAY_INFO:
-			err = get_array_info(mddev, (void *)arg);
+			err = get_array_info(mddev, argp);
 			goto done_unlock;
 
 		case GET_DISK_INFO:
-			err = get_disk_info(mddev, (void *)arg);
+			err = get_disk_info(mddev, argp);
 			goto done_unlock;
 
 		case RESTART_ARRAY_RW:
@@ -2543,18 +2654,18 @@ static int md_ioctl(struct inode *inode, struct file *file,
 				err = -EINVAL;
 				goto abort_unlock;
 			}
-			err = put_user (2, (char *) &loc->heads);
+			err = put_user (2, (char __user *) &loc->heads);
 			if (err)
 				goto abort_unlock;
-			err = put_user (4, (char *) &loc->sectors);
+			err = put_user (4, (char __user *) &loc->sectors);
 			if (err)
 				goto abort_unlock;
 			err = put_user(get_capacity(mddev->gendisk)/8,
-						(short *) &loc->cylinders);
+					(short __user *) &loc->cylinders);
 			if (err)
 				goto abort_unlock;
 			err = put_user (get_start_sect(inode->i_bdev),
-						(long *) &loc->start);
+						(long __user *) &loc->start);
 			goto done_unlock;
 	}
 
@@ -2573,7 +2684,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
 		case ADD_NEW_DISK:
 		{
 			mdu_disk_info_t info;
-			if (copy_from_user(&info, (void*)arg, sizeof(info)))
+			if (copy_from_user(&info, argp, sizeof(info)))
 				err = -EFAULT;
 			else
 				err = add_new_disk(mddev, &info);
@@ -3278,7 +3389,7 @@ static void md_do_sync(mddev_t *mddev)
 		j += sectors;
 		if (j>1) mddev->curr_resync = j;
 
-		if (last_check + window > j)
+		if (last_check + window > j || j == max_sectors)
 			continue;
 
 		last_check = j;
@@ -3444,8 +3555,8 @@ void md_check_recovery(mddev_t *mddev)
 			if (rdev->raid_disk >= 0 &&
 			    rdev->faulty &&
 			    atomic_read(&rdev->nr_pending)==0) {
-				mddev->pers->hot_remove_disk(mddev, rdev->raid_disk);
-				rdev->raid_disk = -1;
+				if (mddev->pers->hot_remove_disk(mddev, rdev->raid_disk)==0)
+					rdev->raid_disk = -1;
 			}
 			if (!rdev->faulty && rdev->raid_disk >= 0 && !rdev->in_sync)
 				spares++;
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 9114c7c26..3d8790135 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -54,9 +54,8 @@ static void mp_pool_free(void *mpb, void *data)
 	kfree(mpb);
 }
 
-static int multipath_map (mddev_t *mddev, mdk_rdev_t **rdevp)
+static int multipath_map (multipath_conf_t *conf)
 {
-	multipath_conf_t *conf = mddev_to_conf(mddev);
 	int i, disks = conf->raid_disks;
 
 	/*
@@ -68,10 +67,9 @@ static int multipath_map (mddev_t *mddev, mdk_rdev_t **rdevp)
 	for (i = 0; i < disks; i++) {
 		mdk_rdev_t *rdev = conf->multipaths[i].rdev;
 		if (rdev && rdev->in_sync) {
-			*rdevp = rdev;
 			atomic_inc(&rdev->nr_pending);
 			spin_unlock_irq(&conf->device_lock);
-			return 0;
+			return i;
 		}
 	}
 	spin_unlock_irq(&conf->device_lock);
@@ -133,25 +131,7 @@ int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error)
 		       (unsigned long long)bio->bi_sector);
 		multipath_reschedule_retry(mp_bh);
 	}
-	atomic_dec(&rdev->nr_pending);
-	return 0;
-}
-
-/*
- * This routine returns the disk from which the requested read should
- * be done.
- */
-
-static int multipath_read_balance (multipath_conf_t *conf)
-{
-	int disk;
-
-	for (disk = 0; disk < conf->raid_disks; disk++) {
-		mdk_rdev_t *rdev = conf->multipaths[disk].rdev;
-		if (rdev && rdev->in_sync)
-			return disk;
-	}
-	BUG();
+	rdev_dec_pending(rdev, conf->mddev);
 	return 0;
 }
 
@@ -159,16 +139,25 @@ static void unplug_slaves(mddev_t *mddev)
 {
 	multipath_conf_t *conf = mddev_to_conf(mddev);
 	int i;
+	unsigned long flags;
 
+	spin_lock_irqsave(&conf->device_lock, flags);
 	for (i=0; i<mddev->raid_disks; i++) {
 		mdk_rdev_t *rdev = conf->multipaths[i].rdev;
 		if (rdev && !rdev->faulty) {
 			request_queue_t *r_queue = bdev_get_queue(rdev->bdev);
 
+			atomic_inc(&rdev->nr_pending);
+			spin_unlock_irqrestore(&conf->device_lock, flags);
+
 			if (r_queue->unplug_fn)
 				r_queue->unplug_fn(r_queue);
+
+			spin_lock_irqsave(&conf->device_lock, flags);
+			atomic_dec(&rdev->nr_pending);
 		}
 	}
+	spin_unlock_irqrestore(&conf->device_lock, flags);
 }
 static void multipath_unplug(request_queue_t *q)
 {
@@ -195,14 +184,14 @@ static int multipath_make_request (request_queue_t *q, struct bio * bio)
 		disk_stat_inc(mddev->gendisk, reads);
 		disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
 	}
-	/*
-	 * read balancing logic:
-	 */
-	spin_lock_irq(&conf->device_lock);
-	mp_bh->path = multipath_read_balance(conf);
+
+	mp_bh->path = multipath_map(conf);
+	if (mp_bh->path < 0) {
+		bio_endio(bio, bio->bi_size, -EIO);
+		mempool_free(mp_bh, conf->pool);
+		return 0;
+	}
 	multipath = conf->multipaths + mp_bh->path;
-	atomic_inc(&multipath->rdev->nr_pending);
-	spin_unlock_irq(&conf->device_lock);
 
 	mp_bh->bio = *bio;
 	mp_bh->bio.bi_bdev = multipath->rdev->bdev;
@@ -366,7 +355,7 @@ static void multipathd (mddev_t *mddev)
 	struct multipath_bh *mp_bh;
 	struct bio *bio;
 	unsigned long flags;
-	mdk_rdev_t *rdev;
+	multipath_conf_t *conf = mddev_to_conf(mddev);
 
 	md_check_recovery(mddev);
 	for (;;) {
@@ -382,8 +371,7 @@ static void multipathd (mddev_t *mddev)
 		bio = &mp_bh->bio;
 		bio->bi_sector = mp_bh->master_bio->bi_sector;
 		
-		rdev = NULL;
-		if (multipath_map (mddev, &rdev)<0) {
+		if ((mp_bh->path = multipath_map (conf))<0) {
 			printk(KERN_ALERT "multipath: %s: unrecoverable IO read"
 				" error for block %llu\n",
 				bdevname(bio->bi_bdev,b),
@@ -394,7 +382,7 @@ static void multipathd (mddev_t *mddev)
 				" to another IO path\n",
 				bdevname(bio->bi_bdev,b),
 				(unsigned long long)bio->bi_sector);
-			bio->bi_bdev = rdev->bdev;
+			bio->bi_bdev = conf->multipaths[mp_bh->path].rdev->bdev;
 			generic_make_request(bio);
 		}
 	}
@@ -522,6 +510,7 @@ static int multipath_stop (mddev_t *mddev)
 	multipath_conf_t *conf = mddev_to_conf(mddev);
 
 	md_unregister_thread(mddev->thread);
+	mddev->thread = NULL;
 	mempool_destroy(conf->pool);
 	kfree(conf->multipaths);
 	kfree(conf);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index bcc81ef13..1b80c5b68 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -42,16 +42,17 @@ static void unplug_slaves(mddev_t *mddev);
 
 static void * r1bio_pool_alloc(int gfp_flags, void *data)
 {
-	mddev_t *mddev = data;
+	struct pool_info *pi = data;
 	r1bio_t *r1_bio;
 
 	/* allocate a r1bio with room for raid_disks entries in the bios array */
-	r1_bio = kmalloc(sizeof(r1bio_t) + sizeof(struct bio*)*mddev->raid_disks,
+	r1_bio = kmalloc(sizeof(r1bio_t) + sizeof(struct bio*)*pi->raid_disks,
 			 gfp_flags);
 	if (r1_bio)
-		memset(r1_bio, 0, sizeof(*r1_bio) + sizeof(struct bio*)*mddev->raid_disks);
+		memset(r1_bio, 0, sizeof(*r1_bio) +
+			       sizeof(struct bio*) * pi->raid_disks);
 	else
-		unplug_slaves(mddev);
+		unplug_slaves(pi->mddev);
 
 	return r1_bio;
 }
@@ -69,22 +70,22 @@ static void r1bio_pool_free(void *r1_bio, void *data)
 
 static void * r1buf_pool_alloc(int gfp_flags, void *data)
 {
-	conf_t *conf = data;
+	struct pool_info *pi = data;
 	struct page *page;
 	r1bio_t *r1_bio;
 	struct bio *bio;
 	int i, j;
 
-	r1_bio = r1bio_pool_alloc(gfp_flags, conf->mddev);
+	r1_bio = r1bio_pool_alloc(gfp_flags, pi);
 	if (!r1_bio) {
-		unplug_slaves(conf->mddev);
+		unplug_slaves(pi->mddev);
 		return NULL;
 	}
 
 	/*
 	 * Allocate bios : 1 for reading, n-1 for writing
 	 */
-	for (j = conf->raid_disks ; j-- ; ) {
+	for (j = pi->raid_disks ; j-- ; ) {
 		bio = bio_alloc(gfp_flags, RESYNC_PAGES);
 		if (!bio)
 			goto out_free_bio;
@@ -111,16 +112,16 @@ out_free_pages:
 	for ( ; i > 0 ; i--)
 		__free_page(bio->bi_io_vec[i-1].bv_page);
 out_free_bio:
-	while ( ++j < conf->raid_disks )
+	while ( ++j < pi->raid_disks )
 		bio_put(r1_bio->bios[j]);
-	r1bio_pool_free(r1_bio, conf->mddev);
+	r1bio_pool_free(r1_bio, data);
 	return NULL;
 }
 
 static void r1buf_pool_free(void *__r1_bio, void *data)
 {
+	struct pool_info *pi = data;
 	int i;
-	conf_t *conf = data;
 	r1bio_t *r1bio = __r1_bio;
 	struct bio *bio = r1bio->bios[0];
 
@@ -128,10 +129,10 @@ static void r1buf_pool_free(void *__r1_bio, void *data)
 		__free_page(bio->bi_io_vec[i].bv_page);
 		bio->bi_io_vec[i].bv_page = NULL;
 	}
-	for (i=0 ; i < conf->raid_disks; i++)
+	for (i=0 ; i < pi->raid_disks; i++)
 		bio_put(r1bio->bios[i]);
 
-	r1bio_pool_free(r1bio, conf->mddev);
+	r1bio_pool_free(r1bio, data);
 }
 
 static void put_all_bios(conf_t *conf, r1bio_t *r1_bio)
@@ -296,7 +297,7 @@ static int raid1_end_read_request(struct bio *bio, unsigned int bytes_done, int
 		reschedule_retry(r1_bio);
 	}
 
-	atomic_dec(&conf->mirrors[mirror].rdev->nr_pending);
+	rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
 	return 0;
 }
 
@@ -343,7 +344,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
 		raid_end_bio_io(r1_bio);
 	}
 
-	atomic_dec(&conf->mirrors[mirror].rdev->nr_pending);
+	rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
 	return 0;
 }
 
@@ -459,11 +460,17 @@ static void unplug_slaves(mddev_t *mddev)
 	spin_lock_irqsave(&conf->device_lock, flags);
 	for (i=0; i<mddev->raid_disks; i++) {
 		mdk_rdev_t *rdev = conf->mirrors[i].rdev;
-		if (rdev && !rdev->faulty) {
+		if (rdev && atomic_read(&rdev->nr_pending)) {
 			request_queue_t *r_queue = bdev_get_queue(rdev->bdev);
 
+			atomic_inc(&rdev->nr_pending);
+			spin_unlock_irqrestore(&conf->device_lock, flags);
+
 			if (r_queue->unplug_fn)
 				r_queue->unplug_fn(r_queue);
+
+			spin_lock_irqsave(&conf->device_lock, flags);
+			atomic_dec(&rdev->nr_pending);
 		}
 	}
 	spin_unlock_irqrestore(&conf->device_lock, flags);
@@ -504,7 +511,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
 	mirror_info_t *mirror;
 	r1bio_t *r1_bio;
 	struct bio *read_bio;
-	int i, disks = conf->raid_disks;
+	int i, disks;
 
 	/*
 	 * Register the new request and wait if the reconstruction
@@ -564,6 +571,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
 	 * inc refcount on their rdev.  Record them by setting
 	 * bios[x] to bio
 	 */
+	disks = conf->raid_disks;
 	spin_lock_irq(&conf->device_lock);
 	for (i = 0;  i < disks; i++) {
 		if (conf->mirrors[i].rdev &&
@@ -799,7 +807,7 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error)
 			 conf->mirrors[r1_bio->read_disk].rdev);
 	else
 		set_bit(R1BIO_Uptodate, &r1_bio->state);
-	atomic_dec(&conf->mirrors[r1_bio->read_disk].rdev->nr_pending);
+	rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev);
 	reschedule_retry(r1_bio);
 	return 0;
 }
@@ -829,7 +837,7 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error)
 		md_done_sync(mddev, r1_bio->sectors, uptodate);
 		put_buf(r1_bio);
 	}
-	atomic_dec(&conf->mirrors[mirror].rdev->nr_pending);
+	rdev_dec_pending(conf->mirrors[mirror].rdev, mddev);
 	return 0;
 }
 
@@ -947,7 +955,8 @@ static int init_resync(conf_t *conf)
 	buffs = RESYNC_WINDOW / RESYNC_BLOCK_SIZE;
 	if (conf->r1buf_pool)
 		BUG();
-	conf->r1buf_pool = mempool_create(buffs, r1buf_pool_alloc, r1buf_pool_free, conf);
+	conf->r1buf_pool = mempool_create(buffs, r1buf_pool_alloc, r1buf_pool_free,
+					  conf->poolinfo);
 	if (!conf->r1buf_pool)
 		return -ENOMEM;
 	conf->next_resync = 0;
@@ -973,6 +982,7 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
 	sector_t max_sector, nr_sectors;
 	int disk;
 	int i;
+	int write_targets = 0;
 
 	if (!conf->r1buf_pool)
 		if (init_resync(conf))
@@ -1049,12 +1059,24 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
 			    sector_nr + RESYNC_SECTORS > mddev->recovery_cp)) {
 			bio->bi_rw = WRITE;
 			bio->bi_end_io = end_sync_write;
+			write_targets ++;
 		} else
 			continue;
 		bio->bi_sector = sector_nr + conf->mirrors[i].rdev->data_offset;
 		bio->bi_bdev = conf->mirrors[i].rdev->bdev;
 		bio->bi_private = r1_bio;
 	}
+	if (write_targets == 0) {
+		/* There is nowhere to write, so all non-sync
+		 * drives must be failed - so we are finished
+		 */
+		int rv = max_sector - sector_nr;
+		md_done_sync(mddev, rv, 1);
+		put_buf(r1_bio);
+		atomic_dec(&conf->mirrors[disk].rdev->nr_pending);
+		return rv;
+	}
+
 	nr_sectors = 0;
 	do {
 		struct page *page;
@@ -1117,28 +1139,28 @@ static int run(mddev_t *mddev)
 	 */
 	conf = kmalloc(sizeof(conf_t), GFP_KERNEL);
 	mddev->private = conf;
-	if (!conf) {
-		printk(KERN_ERR "raid1: couldn't allocate memory for %s\n",
-			mdname(mddev));
-		goto out;
-	}
+	if (!conf)
+		goto out_no_mem;
+
 	memset(conf, 0, sizeof(*conf));
 	conf->mirrors = kmalloc(sizeof(struct mirror_info)*mddev->raid_disks, 
 				 GFP_KERNEL);
-	if (!conf->mirrors) {
-		printk(KERN_ERR "raid1: couldn't allocate memory for %s\n",
-		       mdname(mddev));
-		goto out_free_conf;
-	}
+	if (!conf->mirrors)
+		goto out_no_mem;
+
 	memset(conf->mirrors, 0, sizeof(struct mirror_info)*mddev->raid_disks);
 
+	conf->poolinfo = kmalloc(sizeof(*conf->poolinfo), GFP_KERNEL);
+	if (!conf->poolinfo)
+		goto out_no_mem;
+	conf->poolinfo->mddev = mddev;
+	conf->poolinfo->raid_disks = mddev->raid_disks;
 	conf->r1bio_pool = mempool_create(NR_RAID1_BIOS, r1bio_pool_alloc,
-						r1bio_pool_free, mddev);
-	if (!conf->r1bio_pool) {
-		printk(KERN_ERR "raid1: couldn't allocate memory for %s\n", 
-			mdname(mddev));
-		goto out_free_conf;
-	}
+					  r1bio_pool_free,
+					  conf->poolinfo);
+	if (!conf->r1bio_pool)
+		goto out_no_mem;
+
 	mddev->queue->unplug_fn = raid1_unplug;
 
 
@@ -1224,13 +1246,21 @@ static int run(mddev_t *mddev)
 
 	return 0;
 
+out_no_mem:
+	printk(KERN_ERR "raid1: couldn't allocate memory for %s\n",
+	       mdname(mddev));
+
 out_free_conf:
-	if (conf->r1bio_pool)
-		mempool_destroy(conf->r1bio_pool);
-	if (conf->mirrors)
-		kfree(conf->mirrors);
-	kfree(conf);
-	mddev->private = NULL;
+	if (conf) {
+		if (conf->r1bio_pool)
+			mempool_destroy(conf->r1bio_pool);
+		if (conf->mirrors)
+			kfree(conf->mirrors);
+		if (conf->poolinfo)
+			kfree(conf->poolinfo);
+		kfree(conf);
+		mddev->private = NULL;
+	}
 out:
 	return -EIO;
 }
@@ -1245,11 +1275,108 @@ static int stop(mddev_t *mddev)
 		mempool_destroy(conf->r1bio_pool);
 	if (conf->mirrors)
 		kfree(conf->mirrors);
+	if (conf->poolinfo)
+		kfree(conf->poolinfo);
 	kfree(conf);
 	mddev->private = NULL;
 	return 0;
 }
 
+static int raid1_resize(mddev_t *mddev, sector_t sectors)
+{
+	/* no resync is happening, and there is enough space
+	 * on all devices, so we can resize.
+	 * We need to make sure resync covers any new space.
+	 * If the array is shrinking we should possibly wait until
+	 * any io in the removed space completes, but it hardly seems
+	 * worth it.
+	 */
+	mddev->array_size = sectors>>1;
+	set_capacity(mddev->gendisk, mddev->array_size << 1);
+	mddev->changed = 1;
+	if (mddev->array_size > mddev->size && mddev->recovery_cp == MaxSector) {
+		mddev->recovery_cp = mddev->size << 1;
+		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+	}
+	mddev->size = mddev->array_size;
+	return 0;
+}
+
+static int raid1_reshape(mddev_t *mddev, int raid_disks)
+{
+	/* We need to:
+	 * 1/ resize the r1bio_pool
+	 * 2/ resize conf->mirrors
+	 *
+	 * We allocate a new r1bio_pool if we can.
+	 * Then raise a device barrier and wait until all IO stops.
+	 * Then resize conf->mirrors and swap in the new r1bio pool.
+	 */
+	mempool_t *newpool, *oldpool;
+	struct pool_info *newpoolinfo;
+	mirror_info_t *newmirrors;
+	conf_t *conf = mddev_to_conf(mddev);
+
+	int d;
+
+	for (d= raid_disks; d < conf->raid_disks; d++)
+		if (conf->mirrors[d].rdev)
+			return -EBUSY;
+
+	newpoolinfo = kmalloc(sizeof(newpoolinfo), GFP_KERNEL);
+	if (!newpoolinfo)
+		return -ENOMEM;
+	newpoolinfo->mddev = mddev;
+	newpoolinfo->raid_disks = raid_disks;
+
+	newpool = mempool_create(NR_RAID1_BIOS, r1bio_pool_alloc,
+				 r1bio_pool_free, newpoolinfo);
+	if (!newpool) {
+		kfree(newpoolinfo);
+		return -ENOMEM;
+	}
+	newmirrors = kmalloc(sizeof(struct mirror_info) * raid_disks, GFP_KERNEL);
+	if (!newmirrors) {
+		kfree(newpoolinfo);
+		mempool_destroy(newpool);
+		return -ENOMEM;
+	}
+	memset(newmirrors, 0, sizeof(struct mirror_info)*raid_disks);
+
+	spin_lock_irq(&conf->resync_lock);
+	conf->barrier++;
+	wait_event_lock_irq(conf->wait_idle, !conf->nr_pending,
+			    conf->resync_lock, unplug_slaves(mddev));
+	spin_unlock_irq(&conf->resync_lock);
+
+	/* ok, everything is stopped */
+	oldpool = conf->r1bio_pool;
+	conf->r1bio_pool = newpool;
+	for (d=0; d < raid_disks && d < conf->raid_disks; d++)
+		newmirrors[d] = conf->mirrors[d];
+	kfree(conf->mirrors);
+	conf->mirrors = newmirrors;
+	kfree(conf->poolinfo);
+	conf->poolinfo = newpoolinfo;
+
+	mddev->degraded += (raid_disks - conf->raid_disks);
+	conf->raid_disks = mddev->raid_disks = raid_disks;
+
+	spin_lock_irq(&conf->resync_lock);
+	conf->barrier--;
+	spin_unlock_irq(&conf->resync_lock);
+	wake_up(&conf->wait_resume);
+	wake_up(&conf->wait_idle);
+
+
+	set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+	md_wakeup_thread(mddev->thread);
+
+	mempool_destroy(oldpool);
+	return 0;
+}
+
+
 static mdk_personality_t raid1_personality =
 {
 	.name		= "raid1",
@@ -1263,6 +1390,8 @@ static mdk_personality_t raid1_personality =
 	.hot_remove_disk= raid1_remove_disk,
 	.spare_active	= raid1_spare_active,
 	.sync_request	= sync_request,
+	.resize		= raid1_resize,
+	.reshape	= raid1_reshape,
 };
 
 static int __init raid_init(void)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a88c56a94..773f9bfe7 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -395,7 +395,7 @@ static int raid5_end_read_request (struct bio * bi, unsigned int bytes_done,
 		md_error(conf->mddev, conf->disks[i].rdev);
 		clear_bit(R5_UPTODATE, &sh->dev[i].flags);
 	}
-	atomic_dec(&conf->disks[i].rdev->nr_pending);
+	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
 #if 0
 	/* must restore b_page before unlocking buffer... */
 	if (sh->bh_page[i] != bh->b_page) {
@@ -438,7 +438,7 @@ static int raid5_end_write_request (struct bio *bi, unsigned int bytes_done,
 	if (!uptodate)
 		md_error(conf->mddev, conf->disks[i].rdev);
 
-	atomic_dec(&conf->disks[i].rdev->nr_pending);
+	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
 	
 	clear_bit(R5_LOCKED, &sh->dev[i].flags);
 	set_bit(STRIPE_HANDLE, &sh->state);
@@ -1037,7 +1037,7 @@ static void handle_stripe(struct stripe_head *sh)
 	 * parity, or to satisfy requests
 	 * or to load a block that is being partially written.
 	 */
-	if (to_read || non_overwrite || (syncing && (uptodate+failed < disks))) {
+	if (to_read || non_overwrite || (syncing && (uptodate < disks))) {
 		for (i=disks; i--;) {
 			dev = &sh->dev[i];
 			if (!test_bit(R5_LOCKED, &dev->flags) && !test_bit(R5_UPTODATE, &dev->flags) &&
@@ -1301,18 +1301,25 @@ static void unplug_slaves(mddev_t *mddev)
 {
 	raid5_conf_t *conf = mddev_to_conf(mddev);
 	int i;
+	unsigned long flags;
 
+	spin_lock_irqsave(&conf->device_lock, flags);
 	for (i=0; i<mddev->raid_disks; i++) {
 		mdk_rdev_t *rdev = conf->disks[i].rdev;
-		if (rdev && !rdev->faulty) {
-			struct block_device *bdev = rdev->bdev;
-			if (bdev) {
-				request_queue_t *r_queue = bdev_get_queue(bdev);
-				if (r_queue && r_queue->unplug_fn)
-					r_queue->unplug_fn(r_queue);
-			}
+		if (rdev && atomic_read(&rdev->nr_pending)) {
+			request_queue_t *r_queue = bdev_get_queue(rdev->bdev);
+
+			atomic_inc(&rdev->nr_pending);
+			spin_unlock_irqrestore(&conf->device_lock, flags);
+
+			if (r_queue && r_queue->unplug_fn)
+				r_queue->unplug_fn(r_queue);
+
+			spin_lock_irqsave(&conf->device_lock, flags);
+			atomic_dec(&rdev->nr_pending);
 		}
 	}
+	spin_unlock_irqrestore(&conf->device_lock, flags);
 }
 
 static void raid5_unplug_device(request_queue_t *q)
@@ -1570,6 +1577,9 @@ static int run (mddev_t *mddev)
 	conf->algorithm = mddev->layout;
 	conf->max_nr_stripes = NR_STRIPES;
 
+	/* device size must be a multiple of chunk size */
+	mddev->size &= ~(mddev->chunk_size/1024 -1);
+
 	if (!conf->chunk_size || conf->chunk_size % 4) {
 		printk(KERN_ERR "raid5: invalid chunk size %d for %s\n",
 			conf->chunk_size, mdname(mddev));
@@ -1821,6 +1831,27 @@ static int raid5_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
 	return found;
 }
 
+static int raid5_resize(mddev_t *mddev, sector_t sectors)
+{
+	/* no resync is happening, and there is enough space
+	 * on all devices, so we can resize.
+	 * We need to make sure resync covers any new space.
+	 * If the array is shrinking we should possibly wait until
+	 * any io in the removed space completes, but it hardly seems
+	 * worth it.
+	 */
+	sectors &= ~((sector_t)mddev->chunk_size/512 - 1);
+	mddev->array_size = (sectors * (mddev->raid_disks-1))>>1;
+	set_capacity(mddev->gendisk, mddev->array_size << 1);
+	mddev->changed = 1;
+	if (sectors/2  > mddev->size && mddev->recovery_cp == MaxSector) {
+		mddev->recovery_cp = mddev->size << 1;
+		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+	}
+	mddev->size = sectors /2;
+	return 0;
+}
+
 static mdk_personality_t raid5_personality=
 {
 	.name		= "raid5",
@@ -1834,6 +1865,7 @@ static mdk_personality_t raid5_personality=
 	.hot_remove_disk= raid5_remove_disk,
 	.spare_active	= raid5_spare_active,
 	.sync_request	= sync_request,
+	.resize		= raid5_resize,
 };
 
 static int __init raid5_init (void)
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c
index 3055f2d31..714dfb2e1 100644
--- a/drivers/md/raid6main.c
+++ b/drivers/md/raid6main.c
@@ -414,7 +414,7 @@ static int raid6_end_read_request (struct bio * bi, unsigned int bytes_done,
 		md_error(conf->mddev, conf->disks[i].rdev);
 		clear_bit(R5_UPTODATE, &sh->dev[i].flags);
 	}
-	atomic_dec(&conf->disks[i].rdev->nr_pending);
+	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
 #if 0
 	/* must restore b_page before unlocking buffer... */
 	if (sh->bh_page[i] != bh->b_page) {
@@ -457,7 +457,7 @@ static int raid6_end_write_request (struct bio *bi, unsigned int bytes_done,
 	if (!uptodate)
 		md_error(conf->mddev, conf->disks[i].rdev);
 
-	atomic_dec(&conf->disks[i].rdev->nr_pending);
+	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
 
 	clear_bit(R5_LOCKED, &sh->dev[i].flags);
 	set_bit(STRIPE_HANDLE, &sh->state);
@@ -1157,7 +1157,7 @@ static void handle_stripe(struct stripe_head *sh)
 	 * parity, or to satisfy requests
 	 * or to load a block that is being partially written.
 	 */
-	if (to_read || non_overwrite || (syncing && (uptodate+failed < disks))) {
+	if (to_read || non_overwrite || (syncing && (uptodate < disks))) {
 		for (i=disks; i--;) {
 			dev = &sh->dev[i];
 			if (!test_bit(R5_LOCKED, &dev->flags) && !test_bit(R5_UPTODATE, &dev->flags) &&
@@ -1461,21 +1461,27 @@ static inline void raid6_activate_delayed(raid6_conf_t *conf)
 
 static void unplug_slaves(mddev_t *mddev)
 {
-	/* note: this is always called with device_lock held */
 	raid6_conf_t *conf = mddev_to_conf(mddev);
 	int i;
+	unsigned long flags;
 
+	spin_lock_irqsave(&conf->device_lock, flags);
 	for (i=0; i<mddev->raid_disks; i++) {
 		mdk_rdev_t *rdev = conf->disks[i].rdev;
-		if (rdev && !rdev->faulty) {
-			struct block_device *bdev = rdev->bdev;
-			if (bdev) {
-				request_queue_t *r_queue = bdev_get_queue(bdev);
-				if (r_queue && r_queue->unplug_fn)
-					r_queue->unplug_fn(r_queue);
-			}
+		if (rdev && atomic_read(&rdev->nr_pending)) {
+			request_queue_t *r_queue = bdev_get_queue(rdev->bdev);
+
+			atomic_inc(&rdev->nr_pending);
+			spin_unlock_irqrestore(&conf->device_lock, flags);
+
+			if (r_queue && r_queue->unplug_fn)
+				r_queue->unplug_fn(r_queue);
+
+			spin_lock_irqsave(&conf->device_lock, flags);
+			atomic_dec(&rdev->nr_pending);
 		}
 	}
+	spin_unlock_irqrestore(&conf->device_lock, flags);
 }
 
 static void raid6_unplug_device(request_queue_t *q)
@@ -1735,6 +1741,9 @@ static int run (mddev_t *mddev)
 	conf->algorithm = mddev->layout;
 	conf->max_nr_stripes = NR_STRIPES;
 
+	/* device size must be a multiple of chunk size */
+	mddev->size &= ~(mddev->chunk_size/1024 -1);
+
 	if (conf->raid_disks < 4) {
 		printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n",
 		       mdname(mddev), conf->raid_disks);
@@ -1991,6 +2000,27 @@ static int raid6_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
 	return found;
 }
 
+static int raid6_resize(mddev_t *mddev, sector_t sectors)
+{
+	/* no resync is happening, and there is enough space
+	 * on all devices, so we can resize.
+	 * We need to make sure resync covers any new space.
+	 * If the array is shrinking we should possibly wait until
+	 * any io in the removed space completes, but it hardly seems
+	 * worth it.
+	 */
+	sectors &= ~((sector_t)mddev->chunk_size/512 - 1);
+	mddev->array_size = (sectors * (mddev->raid_disks-2))>>1;
+	set_capacity(mddev->gendisk, mddev->array_size << 1);
+	mddev->changed = 1;
+	if (sectors/2  > mddev->size && mddev->recovery_cp == MaxSector) {
+		mddev->recovery_cp = mddev->size << 1;
+		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+	}
+	mddev->size = sectors /2;
+	return 0;
+}
+
 static mdk_personality_t raid6_personality=
 {
 	.name		= "raid6",
@@ -2004,6 +2034,7 @@ static mdk_personality_t raid6_personality=
 	.hot_remove_disk= raid6_remove_disk,
 	.spare_active	= raid6_spare_active,
 	.sync_request	= sync_request,
+	.resize		= raid6_resize,
 };
 
 static int __init raid6_init (void)
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index 26995e2d5..a61e91ac7 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -396,7 +396,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
 	return 0;
 }
 
-static ssize_t fops_read(struct file *file, char *data, size_t count, loff_t *ppos)
+static ssize_t fops_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
 {
 	struct saa7146_fh *fh = file->private_data;
 
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index 02dc94dca..20d86a8c4 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -190,6 +190,7 @@ static int tda10045h_fwinfo_count = sizeof(tda10045h_fwinfo) / sizeof(struct fwi
 static struct fwinfo tda10046h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x3c4f9,.fw_size = 24479} };
 static int tda10046h_fwinfo_count = sizeof(tda10046h_fwinfo) / sizeof(struct fwinfo);
 
+static int errno;
 
 
 static int tda1004x_write_byte(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_state, int reg, int data)
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index fd3f10015..842e14baa 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -45,7 +45,7 @@ static int users=0;
 static int curtuner=0;
 static int tunestat=0;
 static int sigstrength=0;
-static wait_queue_head_t readq;
+static wait_queue_head_t read_queue;
 struct timer_list tunertimer,rdstimer,readtimer;
 static __u8 rdsin=0,rdsout=0,rdsstat=0;
 static unsigned char rdsbuf[RDS_BUFFER];
@@ -309,7 +309,7 @@ void cadet_handler(unsigned long data)
 	 * Service pending read
 	 */
 	if( rdsin!=rdsout)
-	        wake_up_interruptible(&readq);
+	        wake_up_interruptible(&read_queue);
 
 	/* 
 	 * Clean up and exit
@@ -343,7 +343,7 @@ static ssize_t cadet_read(struct file *file, char *data,
 	if(rdsin==rdsout) {
   	        if (file->f_flags & O_NONBLOCK)
 		        return -EWOULDBLOCK;
-	        interruptible_sleep_on(&readq);
+	        interruptible_sleep_on(&read_queue);
 	}		
 	while( i<count && rdsin!=rdsout)
 	        readbuf[i++]=rdsbuf[rdsout++];
@@ -473,7 +473,7 @@ static int cadet_open(struct inode *inode, struct file *file)
 	if(users)
 		return -EBUSY;
 	users++;
-	init_waitqueue_head(&readq);
+	init_waitqueue_head(&read_queue);
 	return 0;
 }
 
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index f1db827ee..ea1dbce24 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -326,7 +326,6 @@ static int __init typhoon_init(void)
 		return -EINVAL;
 	}
 	typhoon_unit.iobase = io;
-	init_MUTEX(&typhoon_unit.lock);
 
 	if (mutefreq < 87000 || mutefreq > 108500) {
 		printk(KERN_ERR "radio-typhoon: You must set a frequency (in kHz) used when muting the card,\n");
@@ -337,6 +336,7 @@ static int __init typhoon_init(void)
 #endif /* MODULE */
 
 	printk(KERN_INFO BANNER);
+	init_MUTEX(&typhoon_unit.lock);
 	io = typhoon_unit.iobase;
 	if (!request_region(io, 8, "typhoon")) {
 		printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 1138d4f30..90249af1e 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -33,7 +33,7 @@ config VIDEO_PMS
 
 config VIDEO_PLANB
 	tristate "PlanB Video-In on PowerMac"
-	depends on PPC_PMAC && VIDEO_DEV
+	depends on PPC_PMAC && VIDEO_DEV && BROKEN
 	help
 	  PlanB is the V4L driver for the PowerMac 7x00/8x00 series video
 	  input hardware. If you want to experiment with this, say Y.
diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c
index 3a84f9752..efe605a11 100644
--- a/drivers/media/video/bt832.c
+++ b/drivers/media/video/bt832.c
@@ -197,7 +197,7 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,
 
 static int bt832_probe(struct i2c_adapter *adap)
 {
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, bt832_attach);
 	return 0;
 }
diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
index c5c38e1ff..c07a0d9c0 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -108,8 +108,8 @@ static struct i2c_adapter bttv_i2c_adap_sw_template = {
 	.inc_use           = bttv_inc_use,
 	.dec_use           = bttv_dec_use,
 #endif
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	.class             = I2C_ADAP_CLASS_TV_ANALOG,
+#ifdef I2C_CLASS_TV_ANALOG
+	.class             = I2C_CLASS_TV_ANALOG,
 #endif
 	I2C_DEVNAME("bt848"),
 	.id                = I2C_HW_B_BT848,
@@ -291,8 +291,8 @@ static struct i2c_adapter bttv_i2c_adap_hw_template = {
 	.inc_use       = bttv_inc_use,
 	.dec_use       = bttv_dec_use,
 #endif
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	.class         = I2C_ADAP_CLASS_TV_ANALOG,
+#ifdef I2C_CLASS_TV_ANALOG
+	.class         = I2C_CLASS_TV_ANALOG,
 #endif
 	I2C_DEVNAME("bt878"),
 	.id            = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */,
diff --git a/drivers/media/video/cpia_usb.c b/drivers/media/video/cpia_usb.c
index 6b602be7f..0bf9349db 100644
--- a/drivers/media/video/cpia_usb.c
+++ b/drivers/media/video/cpia_usb.c
@@ -499,7 +499,7 @@ static int cpia_probe(struct usb_interface *intf,
 	if (udev->descriptor.bNumConfigurations != 1)
 		return -ENODEV;
 
-	interface = &intf->altsetting[0];
+	interface = intf->cur_altsetting;
 
 	printk(KERN_INFO "USB CPiA camera found\n");
 
@@ -620,8 +620,6 @@ static void cpia_disconnect(struct usb_interface *intf)
 		wake_up_interruptible(&ucpia->wq_stream);
 
 	udev = interface_to_usbdev(intf);
-	usb_driver_release_interface(&cpia_driver,
-				     udev->actconfig->interface[0]);
 
 	ucpia->curbuff = ucpia->workbuff = NULL;
 
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index a1a269eab..9396ec27c 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -128,8 +128,8 @@ static struct i2c_adapter cx8800_i2c_adap_template = {
 	.inc_use           = cx8800_inc_use,
 	.dec_use           = cx8800_dec_use,
 #endif
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	.class             = I2C_ADAP_CLASS_TV_ANALOG,
+#ifdef I2C_CLASS_TV_ANALOG
+	.class             = I2C_CLASS_TV_ANALOG,
 #endif
 	I2C_DEVNAME("cx2388x"),
 	.id                = I2C_HW_B_BT848,
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c
index 86ca8a438..7fb4ae734 100644
--- a/drivers/media/video/dpc7146.c
+++ b/drivers/media/video/dpc7146.c
@@ -106,7 +106,7 @@ static int dpc_probe(struct saa7146_dev* dev)
 	   video port pins should be enabled here ?! */
 	saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
 
-	saa7146_i2c_adapter_prepare(dev, &dpc->i2c_adapter, I2C_ADAP_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
+	saa7146_i2c_adapter_prepare(dev, &dpc->i2c_adapter, I2C_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
 	if(i2c_add_adapter(&dpc->i2c_adapter) < 0) {
 		DEB_S(("cannot register i2c-device. skipping.\n"));
 		kfree(dpc);
diff --git a/drivers/media/video/hexium_gemini.c b/drivers/media/video/hexium_gemini.c
index 748ba676c..885e504de 100644
--- a/drivers/media/video/hexium_gemini.c
+++ b/drivers/media/video/hexium_gemini.c
@@ -250,7 +250,7 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
 	/* enable i2c-port pins */
 	saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
 
-	saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, I2C_ADAP_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
+	saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, I2C_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
 	if (i2c_add_adapter(&hexium->i2c_adapter) < 0) {
 		DEB_S(("cannot register i2c-device. skipping.\n"));
 		kfree(hexium);
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c
index cdb82726c..1a3bbb6d3 100644
--- a/drivers/media/video/hexium_orion.c
+++ b/drivers/media/video/hexium_orion.c
@@ -237,7 +237,7 @@ static int hexium_probe(struct saa7146_dev *dev)
 	saa7146_write(dev, DD1_STREAM_B, 0x00000000);
 	saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
 
-	saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, I2C_ADAP_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
+	saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, I2C_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
 	if (i2c_add_adapter(&hexium->i2c_adapter) < 0) {
 		DEB_S(("cannot register i2c-device. skipping.\n"));
 		kfree(hexium);
diff --git a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c
index e8d0d5f38..0298392e7 100644
--- a/drivers/media/video/ir-kbd-gpio.c
+++ b/drivers/media/video/ir-kbd-gpio.c
@@ -20,7 +20,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
-#include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
@@ -65,7 +64,7 @@ static IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE] = {
 	[ 13 ] = KEY_STOP,        // freeze 
 	[ 29 ] = KEY_RECORD,      // capture 
 	[  3 ] = KEY_PLAY,        // unmarked
-	[ 24 ] = KEY_RED,         // unmarked
+	[ 23 ] = KEY_RED,         // unmarked
 	[  7 ] = KEY_GREEN,       // unmarked
 
 #if 0
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index 3576ba504..e2ecf212c 100644
--- a/drivers/media/video/msp3400.c
+++ b/drivers/media/video/msp3400.c
@@ -1353,8 +1353,8 @@ static int msp_detach(struct i2c_client *client)
 
 static int msp_probe(struct i2c_adapter *adap)
 {
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+#ifdef I2C_CLASS_TV_ANALOG
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, msp_attach);
 #else
 	switch (adap->id) {
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index cad4049a3..56b42fde4 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -24,42 +24,15 @@
 #define DEBUG_VARIABLE debug
 
 #include <media/saa7146_vv.h>
-#include <linux/video_decoder.h>	/* for saa7111a */
+#include <media/tuner.h>
+#include <linux/video_decoder.h>
 
 #include "mxb.h"
 #include "tea6415c.h"
 #include "tea6420.h"
 #include "tda9840.h"
-#include <media/tuner.h>
 
-#define I2C_SAA7111A            0x24
-
-/* All unused bytes are reserverd. */
-#define SAA711X_CHIP_VERSION            0x00
-#define SAA711X_ANALOG_INPUT_CONTROL_1  0x02
-#define SAA711X_ANALOG_INPUT_CONTROL_2  0x03
-#define SAA711X_ANALOG_INPUT_CONTROL_3  0x04
-#define SAA711X_ANALOG_INPUT_CONTROL_4  0x05
-#define SAA711X_HORIZONTAL_SYNC_START   0x06
-#define SAA711X_HORIZONTAL_SYNC_STOP    0x07
-#define SAA711X_SYNC_CONTROL            0x08
-#define SAA711X_LUMINANCE_CONTROL       0x09
-#define SAA711X_LUMINANCE_BRIGHTNESS    0x0A
-#define SAA711X_LUMINANCE_CONTRAST      0x0B
-#define SAA711X_CHROMA_SATURATION       0x0C
-#define SAA711X_CHROMA_HUE_CONTROL      0x0D
-#define SAA711X_CHROMA_CONTROL          0x0E
-#define SAA711X_FORMAT_DELAY_CONTROL    0x10
-#define SAA711X_OUTPUT_CONTROL_1        0x11
-#define SAA711X_OUTPUT_CONTROL_2        0x12
-#define SAA711X_OUTPUT_CONTROL_3        0x13
-#define SAA711X_V_GATE_1_START          0x15
-#define SAA711X_V_GATE_1_STOP           0x16
-#define SAA711X_V_GATE_1_MSB            0x17
-#define SAA711X_TEXT_SLICER_STATUS      0x1A
-#define SAA711X_DECODED_BYTES_OF_TS_1   0x1B
-#define SAA711X_DECODED_BYTES_OF_TS_2   0x1C
-#define SAA711X_STATUS_BYTE             0x1F
+#define I2C_SAA7111 0x24
 
 #define MXB_BOARD_CAN_DO_VBI(dev)   (dev->revision != 0) 
 
@@ -175,42 +148,33 @@ struct mxb
 
 static struct saa7146_extension extension;
 
-static int mxb_vbi_bypass(struct saa7146_dev* dev)
-{
-	struct mxb* mxb = (struct mxb*)dev->ext_priv;
-	s32 byte = 0x0;
-	int result = 0;
-
-	DEB_EE(("dev:%p\n",dev));
-
-	/* switch bypass in saa7111a, this should be done in the
-	   saa7111a driver of course... */
-	if ( -1 == (result = i2c_smbus_read_byte_data(mxb->saa7111a, SAA711X_OUTPUT_CONTROL_3))) {
-		DEB_D(("could not read from saa7111a.\n"));
-		return -EFAULT;
-	}
-	byte = result;
-	byte &= 0xf0;
-	byte |= 0x0a;
-
-	if ( 0 != (result = i2c_smbus_write_byte_data(mxb->saa7111a, SAA711X_OUTPUT_CONTROL_3, byte))) {
-		DEB_D(("could not write to saa7111a.\n"));
-		return -EFAULT;
-	}
-	return 0;
-}
-
 static int mxb_probe(struct saa7146_dev* dev)
 {
 	struct mxb* mxb = 0;
 	struct i2c_client *client;
 	struct list_head *item;
+	int result;
 
-	request_module("tuner");
-	request_module("tea6420");
-	request_module("tea6415c");
-	request_module("tda9840");
-	request_module("saa7111");
+	if ((result = request_module("saa7111")) < 0) {
+		printk("mxb: saa7111 i2c module not available.\n");
+		return -ENODEV;
+	}
+	if ((result = request_module("tuner")) < 0) {
+		printk("mxb: tuner i2c module not available.\n");
+		return -ENODEV;
+	}
+	if ((result = request_module("tea6420")) < 0) {
+		printk("mxb: tea6420 i2c module not available.\n");
+		return -ENODEV;
+	}
+	if ((result = request_module("tea6415c")) < 0) {
+		printk("mxb: tea6415c i2c module not available.\n");
+		return -ENODEV;
+	}
+	if ((result = request_module("tda9840")) < 0) {
+		printk("mxb: tda9840 i2c module not available.\n");
+		return -ENODEV;
+	}
 
 	mxb = (struct mxb*)kmalloc(sizeof(struct mxb), GFP_KERNEL);
 	if( NULL == mxb ) {
@@ -219,11 +183,7 @@ static int mxb_probe(struct saa7146_dev* dev)
 	}
 	memset(mxb, 0x0, sizeof(struct mxb));	
 
-	/* FIXME: enable i2c-port pins, video-port-pins
-	   video port pins should be enabled here ?! */
-	saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
-
-	saa7146_i2c_adapter_prepare(dev, &mxb->i2c_adapter, I2C_ADAP_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
+	saa7146_i2c_adapter_prepare(dev, &mxb->i2c_adapter, I2C_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
 	if(i2c_add_adapter(&mxb->i2c_adapter) < 0) {
 		DEB_S(("cannot register i2c-device. skipping.\n"));
 		kfree(mxb);
@@ -241,7 +201,7 @@ static int mxb_probe(struct saa7146_dev* dev)
 			mxb->tea6415c = client;
 		if( I2C_TDA9840 == client->addr ) 
 			mxb->tda9840 = client;
-		if( I2C_SAA7111A == client->addr ) 
+		if( I2C_SAA7111 == client->addr )
 			mxb->saa7111a = client;
 		if( 0x60 == client->addr ) 
 			mxb->tuner = client;
@@ -251,8 +211,7 @@ static int mxb_probe(struct saa7146_dev* dev)
 	if(    0 == mxb->tea6420_1	|| 0 == mxb->tea6420_2	|| 0 == mxb->tea6415c
 	    || 0 == mxb->tda9840	|| 0 == mxb->saa7111a	|| 0 == mxb->tuner ) {
 
-		printk("mxb: did not find all i2c devices. are you sure you\n");
-		printk("mxb: insmod'ed tea6420, tea6415c, saa7111, tea6415c and tuner?\n");
+		printk("mxb: did not find all i2c devices. aborting\n");
 		i2c_del_adapter(&mxb->i2c_adapter);
 		kfree(mxb);
 		return -ENODEV;
@@ -322,37 +281,35 @@ static struct {
 	{-1, { 0} }
 };
 
-static unsigned char mxb_saa7111_init[25] = {
-	0x00,
-	
-	0x00,	  /* 00 - ID byte */
-	0x00,	  /* 01 - reserved */
+static const unsigned char mxb_saa7111_init[] = {
+	0x00, 0x00,	  /* 00 - ID byte */
+	0x01, 0x00,	  /* 01 - reserved */
 
 	/*front end */
-	0xd8,	  /* 02 - FUSE=x, GUDL=x, MODE=x */
-	0x23,	  /* 03 - HLNRS=0, VBSL=1, WPOFF=0, HOLDG=0, GAFIX=0, GAI1=256, GAI2=256 */
-	0x00,	  /* 04 - GAI1=256 */
-	0x00,	  /* 05 - GAI2=256 */
+	0x02, 0xd8,	  /* 02 - FUSE=x, GUDL=x, MODE=x */
+	0x03, 0x23,	  /* 03 - HLNRS=0, VBSL=1, WPOFF=0, HOLDG=0, GAFIX=0, GAI1=256, GAI2=256 */
+	0x04, 0x00,	  /* 04 - GAI1=256 */
+	0x05, 0x00,	  /* 05 - GAI2=256 */
 
 	/* decoder */
-	0xf0,	  /* 06 - HSB at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
-	0x30,	  /* 07 - HSS at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
-	0xa8,	  /* 08 - AUFD=x, FSEL=x, EXFIL=x, VTRC=x, HPLL=x, VNOI=x */
-	0x02,	  /* 09 - BYPS=x, PREF=x, BPSS=x, VBLB=x, UPTCV=x, APER=x */
-	0x80,	  /* 0a - BRIG=128 */
-	0x47,	  /* 0b - CONT=1.109 */
-	0x40,	  /* 0c - SATN=1.0 */
-	0x00,	  /* 0d - HUE=0 */
-	0x01,	  /* 0e - CDTO=0, CSTD=0, DCCF=0, FCTC=0, CHBW=1 */
-	0x00,	  /* 0f - reserved */
-	0xd0,	  /* 10 - OFTS=x, HDEL=x, VRLN=x, YDEL=x */
-	0x8c,	  /* 11 - GPSW=x, CM99=x, FECO=x, COMPO=x, OEYC=1, OEHV=1, VIPB=0, COLO=0 */
-	0x80,	  /* 12 - xx output control 2 */
-	0x30,	  /* 13 - xx output control 3 */
-	0x00,	  /* 14 - reserved */
-	0x15,	  /* 15 - VBI */
-	0x04,	  /* 16 - VBI */
-	0x00,	  /* 17 - VBI */
+	0x06, 0xf0,	  /* 06 - HSB at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
+	0x07, 0x30,	  /* 07 - HSS at  xx(50Hz) /  xx(60Hz) pixels after end of last line */
+	0x08, 0xa8,	  /* 08 - AUFD=x, FSEL=x, EXFIL=x, VTRC=x, HPLL=x, VNOI=x */
+	0x09, 0x02,	  /* 09 - BYPS=x, PREF=x, BPSS=x, VBLB=x, UPTCV=x, APER=x */
+	0x0a, 0x80,	  /* 0a - BRIG=128 */
+	0x0b, 0x47,	  /* 0b - CONT=1.109 */
+	0x0c, 0x40,	  /* 0c - SATN=1.0 */
+	0x0d, 0x00,	  /* 0d - HUE=0 */
+	0x0e, 0x01,	  /* 0e - CDTO=0, CSTD=0, DCCF=0, FCTC=0, CHBW=1 */
+	0x0f, 0x00,	  /* 0f - reserved */
+	0x10, 0xd0,	  /* 10 - OFTS=x, HDEL=x, VRLN=x, YDEL=x */
+	0x11, 0x8c,	  /* 11 - GPSW=x, CM99=x, FECO=x, COMPO=x, OEYC=1, OEHV=1, VIPB=0, COLO=0 */
+	0x12, 0x80,	  /* 12 - xx output control 2 */
+	0x13, 0x30,	  /* 13 - xx output control 3 */
+	0x14, 0x00,	  /* 14 - reserved */
+	0x15, 0x15,	  /* 15 - VBI */
+	0x16, 0x04,	  /* 16 - VBI */
+	0x17, 0x00,	  /* 17 - VBI */
 };
 
 /* bring hardware to a sane state. this has to be done, just in case someone
@@ -362,25 +319,29 @@ static unsigned char mxb_saa7111_init[25] = {
 static int mxb_init_done(struct saa7146_dev* dev)
 {
 	struct mxb* mxb = (struct mxb*)dev->ext_priv;
-	
+	struct video_decoder_init init;
 	struct i2c_msg msg;
 
 	int i = 0, err = 0;
 	struct	tea6415c_multiplex vm;	
 
+	/* select video mode in saa7111a */
+	i = VIDEO_MODE_PAL;
+	/* fixme: currently pointless: gets overwritten by configuration below */
+	mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_NORM, &i);
+
 	/* write configuration to saa7111a */
-	i = i2c_master_send(mxb->saa7111a, mxb_saa7111_init, sizeof(mxb_saa7111_init));
-	if (i < 0) {
-		printk("failed to initialize saa7111a. this should never happen.\n");
-	}
+	init.data = mxb_saa7111_init;
+	init.len = sizeof(mxb_saa7111_init);
+	mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_INIT, &init);
 
 	/* select tuner-output on saa7111a */
 	i = 0;
 	mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_INPUT, &i);
-//	i = VIDEO_MODE_PAL;
-//	mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_NORM, &i);
 
-	mxb_vbi_bypass(dev);
+	/* enable vbi bypass */
+	i = 1;
+	mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_VBI_BYPASS, &i);
 
 	/* select a tuner type */
 	i = 5; 
@@ -538,36 +499,6 @@ static int mxb_detach(struct saa7146_dev* dev)
 	return 0;
 }
 
-/* hack: this should go into saa711x */
-static int saa7111_set_gpio(struct saa7146_dev *dev, int bl)
-{
-	struct mxb* mxb = (struct mxb*)dev->ext_priv;
-	s32 byte = 0x0;
-	int result = 0;
-	
-	DEB_EE(("dev:%p\n",dev));
-
-	/* get the old register contents */
-	if ( -1 == (byte = i2c_smbus_read_byte_data(mxb->saa7111a, SAA711X_OUTPUT_CONTROL_1))) {
-		DEB_D(("could not read from saa711x\n"));
-		return -EFAULT;
-	}
-	
-	if( 0 == bl ) {
-		byte &= 0x7f;
-	} else {
-		byte |= 0x80;
-	}
-
-	/* write register contents back */
-	if ( 0 != (result = i2c_smbus_write_byte_data(mxb->saa7111a, SAA711X_OUTPUT_CONTROL_1, byte))) {
-		DEB_D(("could not write to saa711x\n"));
-		return -EFAULT;
-	}
-
-	return 0;
-}
-
 static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 
 {
 	struct saa7146_dev *dev = fh->dev;
@@ -988,18 +919,22 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
 
 static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std)
 {
+	struct mxb* mxb = (struct mxb*)dev->ext_priv;
+	int zero = 0;
+	int one = 1;
+
 	if(V4L2_STD_PAL_I == std->id ) {
 		DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n"));
 		/* set the 7146 gpio register -- I don't know what this does exactly */
       		saa7146_write(dev, GPIO_CTRL, 0x00404050);
 		/* unset the 7111 gpio register -- I don't know what this does exactly */
-		saa7111_set_gpio(dev,0);
+		mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero);
 	} else {
 		DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n"));
 		/* set the 7146 gpio register -- I don't know what this does exactly */
       		saa7146_write(dev, GPIO_CTRL, 0x00404050);
 		/* set the 7111 gpio register -- I don't know what this does exactly */
-		saa7111_set_gpio(dev,1);
+		mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one);
 	}
 	return 0;
 }
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c
index b790765a4..ebf130f16 100644
--- a/drivers/media/video/planb.c
+++ b/drivers/media/video/planb.c
@@ -1383,8 +1383,6 @@ static int planb_open(struct video_device *dev, int mode)
 	pb->user++;
 
 	DEBUG("PlanB: device opened\n");
-
-	MOD_INC_USE_COUNT;
 	return 0;   
 }
 
@@ -1407,8 +1405,6 @@ static void planb_close(struct video_device *dev)
 	planb_unlock(pb);
 
 	DEBUG("PlanB: device closed\n");
-
-	MOD_DEC_USE_COUNT;  
 }
 
 static long planb_read(struct video_device *v, char *buf, unsigned long count,
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 715a7cc5f..eecc102db 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -143,7 +143,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind)
  */
 static int saa5246a_probe(struct i2c_adapter *adap)
 {
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, saa5246a_attach);
 	return 0;
 }
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 5bcdc178a..d486fb7fa 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -219,7 +219,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
  
 static int saa5249_probe(struct i2c_adapter *adap)
 {
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, saa5249_attach);
 	return 0;
 }
diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c
index 4e43ba879..5202dcc5a 100644
--- a/drivers/media/video/saa7111.c
+++ b/drivers/media/video/saa7111.c
@@ -9,6 +9,9 @@
  * Changes by Ronald Bultje <rbultje@ronald.bitfreak.net>
  *    - moved over to linux>=2.4.x i2c protocol (1/1/2003)
  *
+ * Changes by Michael Hunold <michael@mihu.de>
+ *    - implemented DECODER_SET_GPIO, DECODER_INIT, DECODER_SET_VBI_BYPASS
+ *
  * 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
@@ -112,7 +115,7 @@ saa7111_write_block (struct i2c_client *client,
 		u8 block_data[32];
 
 		msg.addr = client->addr;
-		msg.flags = client->flags;
+		msg.flags = 0;
 		while (len >= 2) {
 			msg.buf = (char *) block_data;
 			msg.len = 0;
@@ -142,6 +145,13 @@ saa7111_write_block (struct i2c_client *client,
 	return ret;
 }
 
+static int
+saa7111_init_decoder (struct i2c_client *client,
+	      struct video_decoder_init *init)
+{
+	return saa7111_write_block(client, init->data, init->len);
+}
+
 static inline int
 saa7111_read (struct i2c_client *client,
 	      u8                 reg)
@@ -151,7 +161,7 @@ saa7111_read (struct i2c_client *client,
 
 /* ----------------------------------------------------------------------- */
 
-static const unsigned char init[] = {
+static const unsigned char saa7111_i2c_init[] = {
 	0x00, 0x00,		/* 00 - ID byte */
 	0x01, 0x00,		/* 01 - reserved */
 
@@ -201,8 +211,18 @@ saa7111_command (struct i2c_client *client,
 	switch (cmd) {
 
 	case 0:
-		//saa7111_write_block(client, init, sizeof(init));
-		break;
+	case DECODER_INIT:
+	{
+		struct video_decoder_init *init = arg;
+		if (NULL != init)
+			return saa7111_init_decoder(client, init);
+		else {
+			struct video_decoder_init vdi;
+			vdi.data = saa7111_i2c_init;
+			vdi.len = sizeof(saa7111_i2c_init);
+			return saa7111_init_decoder(client, &vdi);
+		}
+	}
 
 	case DECODER_DUMP:
 	{
@@ -274,6 +294,32 @@ saa7111_command (struct i2c_client *client,
 	}
 		break;
 
+	case DECODER_SET_GPIO:
+	{
+		int *iarg = arg;
+		if (0 != *iarg) {
+			saa7111_write(client, 0x11,
+				(decoder->reg[0x11] | 0x80));
+		} else {
+			saa7111_write(client, 0x11,
+				(decoder->reg[0x11] & 0x7f));
+		}
+		break;
+	}
+
+	case DECODER_SET_VBI_BYPASS:
+	{
+		int *iarg = arg;
+		if (0 != *iarg) {
+			saa7111_write(client, 0x13,
+				(decoder->reg[0x13] & 0xf0) | 0x0a);
+		} else {
+			saa7111_write(client, 0x13,
+				(decoder->reg[0x13] & 0xf0));
+		}
+		break;
+	}
+
 	case DECODER_SET_NORM:
 	{
 		int *iarg = arg;
@@ -465,6 +511,7 @@ saa7111_detect_client (struct i2c_adapter *adapter,
 	int i;
 	struct i2c_client *client;
 	struct saa7111 *decoder;
+	struct video_decoder_init vdi;
 
 	dprintk(1,
 		KERN_INFO
@@ -509,7 +556,9 @@ saa7111_detect_client (struct i2c_adapter *adapter,
 		return i;
 	}
 
-	i = saa7111_write_block(client, init, sizeof(init));
+	vdi.data = saa7111_i2c_init;
+	vdi.len = sizeof(saa7111_i2c_init);
+	i = saa7111_init_decoder(client, &vdi);
 	if (i < 0) {
 		dprintk(1, KERN_ERR "%s_attach error: init status %d\n",
 			I2C_NAME(client), i);
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
index d52cecb58..5ea367e0e 100644
--- a/drivers/media/video/saa7134/saa6752hs.c
+++ b/drivers/media/video/saa7134/saa6752hs.c
@@ -335,7 +335,7 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind)
 
 static int saa6752hs_probe(struct i2c_adapter *adap)
 {
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, saa6752hs_attach);
 
 	return 0;
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index cc1aaaa94..61305cf18 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -347,8 +347,8 @@ static struct i2c_adapter saa7134_adap_template = {
 	.inc_use       = inc_use,
 	.dec_use       = dec_use,
 #endif
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	.class         = I2C_ADAP_CLASS_TV_ANALOG,
+#ifdef I2C_CLASS_TV_ANALOG
+	.class         = I2C_CLASS_TV_ANALOG,
 #endif
 	I2C_DEVNAME("saa7134"),
 	.id            = I2C_ALGO_SAA7134,
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index b53946a51..e5ff0e5b6 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -19,7 +19,6 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c
index 015f2f5fe..4365d9485 100644
--- a/drivers/media/video/tda7432.c
+++ b/drivers/media/video/tda7432.c
@@ -338,8 +338,8 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind)
 
 static int tda7432_probe(struct i2c_adapter *adap)
 {
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+#ifdef I2C_CLASS_TV_ANALOG
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tda7432_attach);
 #else
 	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848))
diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c
index 8c7a57944..ae5fd316f 100644
--- a/drivers/media/video/tda9875.c
+++ b/drivers/media/video/tda9875.c
@@ -272,8 +272,8 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind)
 
 static int tda9875_probe(struct i2c_adapter *adap)
 {
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+#ifdef I2C_CLASS_TV_ANALOG
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tda9875_attach);
 #else
 	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848))
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index aef701636..ddc380e1a 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -370,8 +370,8 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
 
 static int tda9887_probe(struct i2c_adapter *adap)
 {
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+#ifdef I2C_CLASS_TV_ANALOG
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tda9887_attach);
 #else
 	switch (adap->id) {
diff --git a/drivers/media/video/tuner.c b/drivers/media/video/tuner.c
index d1150b7ba..ab7030447 100644
--- a/drivers/media/video/tuner.c
+++ b/drivers/media/video/tuner.c
@@ -1067,8 +1067,8 @@ static int tuner_probe(struct i2c_adapter *adap)
 	}
 	this_adap = 0;
 
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+#ifdef I2C_CLASS_TV_ANALOG
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, tuner_attach);
 #else
 	switch (adap->id) {
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index ce2588a2f..bf5017a77 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -1497,8 +1497,8 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
 
 static int chip_probe(struct i2c_adapter *adap)
 {
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (adap->class & I2C_ADAP_CLASS_TV_ANALOG)
+#ifdef I2C_CLASS_TV_ANALOG
+	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, chip_attach);
 #else
 	switch (adap->id) {
diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c
index 677eb1604..f690126f0 100644
--- a/drivers/media/video/tvmixer.c
+++ b/drivers/media/video/tvmixer.c
@@ -263,8 +263,8 @@ static int tvmixer_clients(struct i2c_client *client)
 	struct video_audio va;
 	int i,minor;
 
-#ifdef I2C_ADAP_CLASS_TV_ANALOG
-	if (!(client->adapter->class & I2C_ADAP_CLASS_TV_ANALOG))
+#ifdef I2C_CLASS_TV_ANALOG
+	if (!(client->adapter->class & I2C_CLASS_TV_ANALOG))
 		return -1;
 #else
 	/* TV card ??? */
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c
index 34c929049..f541a06df 100644
--- a/drivers/media/video/video-buf.c
+++ b/drivers/media/video/video-buf.c
@@ -1176,7 +1176,7 @@ int videobuf_mmap_mapper(struct vm_area_struct *vma,
 	map->end      = vma->vm_end;
 	map->q        = q;
 	vma->vm_ops   = &videobuf_vm_ops;
-	vma->vm_flags |= VM_DONTEXPAND;
+	vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED;
 	vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */
 	vma->vm_private_data = map;
 	dprintk(1,"mmap %p: %08lx-%08lx pgoff %08lx bufs %d-%d\n",
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index e73da1070..afaf612fc 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -397,12 +397,21 @@ static struct file_operations video_fops=
  
 static int __init videodev_init(void)
 {
+	int ret;
+
 	printk(KERN_INFO "Linux video capture interface: v1.00\n");
-	if (register_chrdev(VIDEO_MAJOR,VIDEO_NAME, &video_fops)) {
-		printk("video_dev: unable to get major %d\n", VIDEO_MAJOR);
+	if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME, &video_fops)) {
+		printk(KERN_WARNING "video_dev: unable to get major %d\n", VIDEO_MAJOR);
 		return -EIO;
 	}
-	class_register(&video_class);
+
+	ret = class_register(&video_class);
+	if (ret < 0) {
+		unregister_chrdev(VIDEO_MAJOR, VIDEO_NAME);
+		printk(KERN_WARNING "video_dev: class_register failed\n");
+		return -EIO;
+	}
+
 	return 0;
 }
 
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig
index c78ecc4b2..aa1c657dd 100644
--- a/drivers/message/fusion/Kconfig
+++ b/drivers/message/fusion/Kconfig
@@ -3,7 +3,7 @@ menu "Fusion MPT device support"
 
 config FUSION
 	tristate "Fusion MPT (base + ScsiHost) drivers"
-	depends on PCI
+	depends on PCI && SCSI
 	---help---
 	  LSI Logic Fusion(TM) Message Passing Technology (MPT) device support
 	  provides high performance SCSI host initiator, and LAN [1] interface
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 2797d881d..fba96eb6d 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -223,6 +223,7 @@ static void	mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc);
 
 //int		mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag);
 static int	ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers);
+static void	mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf);
 static void	mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
 static void	mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info);
 
@@ -263,6 +264,8 @@ struct _mpt_ioc_proc_list {
  */
 
 static struct pci_device_id mptbase_pci_table[] = {
+	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
+		PCI_ANY_ID, PCI_ANY_ID },
 	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
 		PCI_ANY_ID, PCI_ANY_ID },
 	{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
@@ -389,6 +392,12 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
 				else
 					mpt_sp_log_info(ioc, log_info);
 			}
+			if (ioc_stat & MPI_IOCSTATUS_MASK) {
+				if ((int)ioc->chip_type <= (int)FC929)
+						;
+				else
+					mpt_sp_ioc_info(ioc, (u32)ioc_stat, mf);
+			}
 		} else {
 			/*
 			 *  Process turbo (context) reply...
@@ -1350,6 +1359,10 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	ioc->chip_type = FCUNK;
+	if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC909) {
+		ioc->chip_type = FC909;
+		ioc->prod_name = "LSIFC909";
+	}
 	if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) {
 		ioc->chip_type = FC929;
 		ioc->prod_name = "LSIFC929";
@@ -6086,11 +6099,155 @@ mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info)
 	case 0x00080000:
 		desc = "Outbound DMA Overrun";
 		break;
+	
+	case 0x00090000:
+		desc = "Task Management";
+		break;
+
+	case 0x000A0000:
+		desc = "Device Problem";
+		break;
+
+	case 0x000B0000:
+		desc = "Invalid Phase Change";
+		break;
+
+	case 0x000C0000:
+		desc = "Untagged Table Size";
+		break;
+	
 	}
 
 	printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): F/W: %s\n", ioc->name, log_info, desc);
 }
 
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *	mpt_sp_ioc_info - IOC information returned from SCSI Parallel IOC.
+ *	@ioc: Pointer to MPT_ADAPTER structure
+ *	@ioc_status: U32 IOCStatus word from IOC
+ *	@mf: Pointer to MPT request frame
+ *
+ *	Refer to lsi/mpi.h.
+ */
+static void
+mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
+{
+	u32 status = ioc_status & MPI_IOCSTATUS_MASK;
+	char *desc = "";
+
+	switch (status) {
+	case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */
+		desc = "Invalid Function";
+		break;
+
+	case MPI_IOCSTATUS_BUSY: /* 0x0002 */
+		desc = "Busy";
+		break;
+
+	case MPI_IOCSTATUS_INVALID_SGL: /* 0x0003 */
+		desc = "Invalid SGL";
+		break;
+
+	case MPI_IOCSTATUS_INTERNAL_ERROR: /* 0x0004 */
+		desc = "Internal Error";
+		break;
+
+	case MPI_IOCSTATUS_RESERVED: /* 0x0005 */
+		desc = "Reserved";
+		break;
+
+	case MPI_IOCSTATUS_INSUFFICIENT_RESOURCES: /* 0x0006 */
+		desc = "Insufficient Resources";
+		break;
+
+	case MPI_IOCSTATUS_INVALID_FIELD: /* 0x0007 */
+		desc = "Invalid Field";
+		break;
+
+	case MPI_IOCSTATUS_INVALID_STATE: /* 0x0008 */
+		desc = "Invalid State";
+		break;
+
+	case MPI_IOCSTATUS_CONFIG_INVALID_ACTION: /* 0x0020 */
+	case MPI_IOCSTATUS_CONFIG_INVALID_TYPE:   /* 0x0021 */
+	case MPI_IOCSTATUS_CONFIG_INVALID_PAGE:   /* 0x0022 */
+	case MPI_IOCSTATUS_CONFIG_INVALID_DATA:   /* 0x0023 */
+	case MPI_IOCSTATUS_CONFIG_NO_DEFAULTS:    /* 0x0024 */
+	case MPI_IOCSTATUS_CONFIG_CANT_COMMIT:    /* 0x0025 */
+		/* No message for Config IOCStatus values */
+		break;
+
+	case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
+		/* No message for recovered error
+		desc = "SCSI Recovered Error";
+		*/
+		break;
+
+	case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */
+		desc = "SCSI Invalid Bus";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_INVALID_TARGETID: /* 0x0042 */
+		desc = "SCSI Invalid TargetID";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */
+	  {
+		SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf;
+		U8 cdb = pScsiReq->CDB[0];
+		if (cdb != 0x12) { /* Inquiry is issued for device scanning */
+			desc = "SCSI Device Not There";
+		}
+		break;
+	  }
+
+	case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */
+		desc = "SCSI Data Overrun";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */
+		/* This error is checked in scsi_io_done(). Skip. 
+		desc = "SCSI Data Underrun";
+		*/
+		break;
+
+	case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */
+		desc = "SCSI I/O Data Error";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */
+		desc = "SCSI Protocol Error";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */
+		desc = "SCSI Task Terminated";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */
+		desc = "SCSI Residual Mismatch";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */
+		desc = "SCSI Task Management Failed";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */
+		desc = "SCSI IOC Terminated";
+		break;
+
+	case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */
+		desc = "SCSI Ext Terminated";
+		break;
+
+	default:
+		desc = "Others";
+		break;
+	}
+	if (desc != "")
+		printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04x): %s\n", ioc->name, status, desc);
+}
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  *	mpt_register_ascqops_strings - Register SCSI ASC/ASCQ and SCSI
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index dbadc8224..8b4484404 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -81,8 +81,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2004 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON	"3.01.03"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.01.03"
+#define MPT_LINUX_VERSION_COMMON	"3.01.06"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.01.06"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 40379f916..434ceb1ca 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -1199,7 +1199,7 @@ static int
 mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 {
 	struct mpt_ioctl_iocinfo *uarg = (struct mpt_ioctl_iocinfo *) arg;
-	struct mpt_ioctl_iocinfo karg;
+	struct mpt_ioctl_iocinfo *karg;
 	MPT_ADAPTER		*ioc;
 	struct pci_dev		*pdev;
 	struct Scsi_Host	*sh;
@@ -1219,34 +1219,46 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 	 */
 	if (data_size == sizeof(struct mpt_ioctl_iocinfo_rev0))
 		cim_rev = 0;
-	else if (data_size == sizeof(struct mpt_ioctl_iocinfo))
+	else if (data_size == sizeof(struct mpt_ioctl_iocinfo_rev1))
 		cim_rev = 1;
+	else if (data_size == sizeof(struct mpt_ioctl_iocinfo))
+		cim_rev = 2;
 	else if (data_size == (sizeof(struct mpt_ioctl_iocinfo_rev0)+12))
 		cim_rev = 0;	/* obsolete */
 	else
 		return -EFAULT;
-
-	if (copy_from_user(&karg, uarg, data_size)) {
+	
+	karg = kmalloc(data_size, GFP_KERNEL);
+	if (karg == NULL) {
+		printk(KERN_ERR "%s::mpt_ioctl_iocinfo() @%d - no memory available!\n",
+				__FILE__, __LINE__);
+		return -ENOMEM;
+	}
+		
+	if (copy_from_user(karg, uarg, data_size)) {
 		printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
 			"Unable to read in mpt_ioctl_iocinfo struct @ %p\n",
 				__FILE__, __LINE__, (void*)uarg);
+		kfree(karg);
 		return -EFAULT;
 	}
 
-	if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
+	if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) ||
 	    (ioc == NULL)) {
 		dctlprintk((KERN_ERR "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
 				__FILE__, __LINE__, iocnum));
+		kfree(karg);
 		return -ENODEV;
 	}
 
 	/* Verify the data transfer size is correct.
 	 * Ignore the port setting.
 	 */
-	if (karg.hdr.maxDataSize != data_size) {
+	if (karg->hdr.maxDataSize != data_size) {
 		printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
 			"Structure size mismatch. Command not completed.\n",
 				__FILE__, __LINE__);
+		kfree(karg);
 		return -EFAULT;
 	}
 
@@ -1254,29 +1266,37 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 	 * program
 	 */
 	if ((int)ioc->chip_type <= (int) FC929)
-		karg.adapterType = MPT_IOCTL_INTERFACE_FC;
+		karg->adapterType = MPT_IOCTL_INTERFACE_FC;
 	else
-		karg.adapterType = MPT_IOCTL_INTERFACE_SCSI;
+		karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
 
-	port = karg.hdr.port;
+	port = karg->hdr.port;
 
-	karg.port = port;
+	karg->port = port;
 	pdev = (struct pci_dev *) ioc->pcidev;
 
-	karg.pciId = pdev->device;
+	karg->pciId = pdev->device;
 	pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
-	karg.hwRev = revision;
+	karg->hwRev = revision;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
-	karg.subSystemDevice = pdev->subsystem_device;
-	karg.subSystemVendor = pdev->subsystem_vendor;
+	karg->subSystemDevice = pdev->subsystem_device;
+	karg->subSystemVendor = pdev->subsystem_vendor;
 #endif
 
 	if (cim_rev == 1) {
 		/* Get the PCI bus, device, and function numbers for the IOC
 		 */
-		karg.pciInfo.u.bits.busNumber = pdev->bus->number;
-		karg.pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
-		karg.pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
+		karg->pciInfo.u.bits.busNumber = pdev->bus->number;
+		karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
+		karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
+	} else if (cim_rev == 2) {
+		/* Get the PCI bus, device, function and segment ID numbers 
+		   for the IOC */
+		karg->pciInfo.u.bits.busNumber = pdev->bus->number;
+		karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
+		karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
+		karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
+		karg->pciInfo.segmentID = pci_domain_nr(pdev->bus);
 	}
 
 	/* Get number of devices
@@ -1297,31 +1317,33 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 			}
 		}
 	}
-	karg.numDevices = numDevices;
+	karg->numDevices = numDevices;
 
 	/* Set the BIOS and FW Version
 	 */
-	karg.FWVersion = ioc->facts.FWVersion.Word;
-	karg.BIOSVersion = ioc->biosVersion;
+	karg->FWVersion = ioc->facts.FWVersion.Word;
+	karg->BIOSVersion = ioc->biosVersion;
 
 	/* Set the Version Strings.
 	 */
-	strncpy (karg.driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH);
-	karg.driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0';
+	strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH);
+	karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0';
 
-	karg.busChangeEvent = 0;
-	karg.hostId = ioc->pfacts[port].PortSCSIID;
-	karg.rsvd[0] = karg.rsvd[1] = 0;
+	karg->busChangeEvent = 0;
+	karg->hostId = ioc->pfacts[port].PortSCSIID;
+	karg->rsvd[0] = karg->rsvd[1] = 0;
 
 	/* Copy the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, &karg, data_size)) {
+	if (copy_to_user((char *)arg, karg, data_size)) {
 		printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
 			"Unable to write out mpt_ioctl_iocinfo struct @ %p\n",
 				__FILE__, __LINE__, (void*)uarg);
+		kfree(karg);
 		return -EFAULT;
 	}
 
+	kfree(karg);
 	return 0;
 }
 
@@ -2909,6 +2931,8 @@ int __init mptctl_init(void)
 	if (++where && err) goto out_fail;
 	err = register_ioctl32_conversion(MPTIOCINFO1, compat_mptctl_ioctl);
 	if (++where && err) goto out_fail;
+	err = register_ioctl32_conversion(MPTIOCINFO2, compat_mptctl_ioctl);
+	if (++where && err) goto out_fail;
 	err = register_ioctl32_conversion(MPTTARGETINFO, compat_mptctl_ioctl);
 	if (++where && err) goto out_fail;
 	err = register_ioctl32_conversion(MPTTEST, compat_mptctl_ioctl);
@@ -2968,6 +2992,7 @@ out_fail:
 			" (%d:err=%d)\n", where, err);
 	unregister_ioctl32_conversion(MPTIOCINFO);
 	unregister_ioctl32_conversion(MPTIOCINFO1);
+	unregister_ioctl32_conversion(MPTIOCINFO2);
 	unregister_ioctl32_conversion(MPTTARGETINFO);
 	unregister_ioctl32_conversion(MPTTEST);
 	unregister_ioctl32_conversion(MPTEVENTQUERY);
@@ -3018,6 +3043,7 @@ void mptctl_exit(void)
 #ifdef CONFIG_COMPAT
 	unregister_ioctl32_conversion(MPTIOCINFO);
 	unregister_ioctl32_conversion(MPTIOCINFO1);
+	unregister_ioctl32_conversion(MPTIOCINFO2);
 	unregister_ioctl32_conversion(MPTTARGETINFO);
 	unregister_ioctl32_conversion(MPTTEST);
 	unregister_ioctl32_conversion(MPTEVENTQUERY);
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index e751165f5..47ffd977d 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -91,6 +91,7 @@
 
 #define MPTIOCINFO		_IOWR(MPT_MAGIC_NUMBER,17,struct mpt_ioctl_iocinfo)
 #define MPTIOCINFO1		_IOWR(MPT_MAGIC_NUMBER,17,struct mpt_ioctl_iocinfo_rev0)
+#define MPTIOCINFO2		_IOWR(MPT_MAGIC_NUMBER,17,struct mpt_ioctl_iocinfo_rev1)
 #define MPTTARGETINFO		_IOWR(MPT_MAGIC_NUMBER,18,struct mpt_ioctl_targetinfo)
 #define MPTTEST			_IOWR(MPT_MAGIC_NUMBER,19,struct mpt_ioctl_test)
 #define MPTEVENTQUERY		_IOWR(MPT_MAGIC_NUMBER,21,struct mpt_ioctl_eventquery)
@@ -165,6 +166,18 @@ struct mpt_ioctl_pci_info {
 	} u;
 };
 
+struct mpt_ioctl_pci_info2 {
+	union {
+		struct {
+			unsigned int  deviceNumber   :  5;
+			unsigned int  functionNumber :  3;
+			unsigned int  busNumber      : 24;
+		} bits;
+		unsigned int  asUlong;
+	} u;
+  int segmentID;
+};
+
 /*
  *  Adapter Information Page
  *  Read only.
@@ -175,6 +188,24 @@ struct mpt_ioctl_pci_info {
 #define MPT_IOCTL_VERSION_LENGTH	(32)
 
 struct mpt_ioctl_iocinfo {
+	mpt_ioctl_header hdr;
+	int		 adapterType;	/* SCSI or FCP */
+	int		 port;		/* port number */
+	int		 pciId;		/* PCI Id. */
+	int		 hwRev;		/* hardware revision */
+	int		 subSystemDevice;	/* PCI subsystem Device ID */
+	int		 subSystemVendor;	/* PCI subsystem Vendor ID */
+	int		 numDevices;		/* number of devices */
+	int		 FWVersion;		/* FW Version (integer) */
+	int		 BIOSVersion;		/* BIOS Version (integer) */
+	char		 driverVersion[MPT_IOCTL_VERSION_LENGTH];	/* Driver Version (string) */
+	char		 busChangeEvent;
+	char		 hostId;
+	char		 rsvd[2];
+	struct mpt_ioctl_pci_info2  pciInfo; /* Added Rev 2 */
+};
+
+struct mpt_ioctl_iocinfo_rev1 {
 	mpt_ioctl_header hdr;
 	int		 adapterType;	/* SCSI or FCP */
 	int		 port;		/* port number */
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index a0cef8c98..ce66f4176 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -805,6 +805,14 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 
 		if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID)
 			copy_sense_data(sc, hd, mf, pScsiReply);
+                
+		/*
+		 *  Look for + dump FCP ResponseInfo[]!
+		 */
+		if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID) {
+			printk(KERN_NOTICE "  FCP_ResponseInfo=%08xh\n",
+			le32_to_cpu(pScsiReply->ResponseInfo));
+		}
 
 		switch(status) {
 		case MPI_IOCSTATUS_BUSY:			/* 0x0002 */
@@ -932,10 +940,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 			break;
 
 		case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR:		/* 0x0047 */
-			if (pScsiReply->SCSIState & MPI_SCSI_STATE_TERMINATED) {
-				/*  Not real sure here either...  */
-				sc->result = DID_RESET << 16;
-			} else
 				sc->result = DID_SOFT_ERROR << 16;
 			break;
 
@@ -1106,16 +1110,21 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
 			 * Do OS callback
 			 * Free driver resources (chain, msg buffers)
 			 */
-			if (SCpnt->use_sg) {
-				pci_unmap_sg(hd->ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer,
-					    SCpnt->use_sg, scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
-			} else if (SCpnt->request_bufflen) {
-				scPrivate	*my_priv;
-
-				my_priv = (scPrivate *) &SCpnt->SCp;
-				pci_unmap_single(hd->ioc->pcidev, (dma_addr_t)(ulong)my_priv->p1,
-					   SCpnt->request_bufflen,
-					   scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+			if (scsi_device_online(SCpnt->device)) {
+				if (SCpnt->use_sg) {
+					pci_unmap_sg(hd->ioc->pcidev,
+						(struct scatterlist *) SCpnt->request_buffer,
+						SCpnt->use_sg,
+						scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+				} else if (SCpnt->request_bufflen) {
+					scPrivate	*my_priv;
+
+					my_priv = (scPrivate *) &SCpnt->SCp;
+					pci_unmap_single(hd->ioc->pcidev,
+						(dma_addr_t)(ulong)my_priv->p1,
+						SCpnt->request_bufflen,
+						scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+				}
 			}
 			SCpnt->result = DID_RESET << 16;
 			SCpnt->host_scribble = NULL;
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig
index 90b18e76c..8d132b0d6 100644
--- a/drivers/message/i2o/Kconfig
+++ b/drivers/message/i2o/Kconfig
@@ -3,7 +3,7 @@ menu "I2O device support"
 
 config I2O
 	tristate "I2O support"
-	depends on PCI && !64BIT
+	depends on PCI
 	---help---
 	  The Intelligent Input/Output (I2O) architecture allows hardware
 	  drivers to be split into two parts: an operating system specific
@@ -20,19 +20,20 @@ config I2O
 	  drivers and OSM's with the following questions.
 
 	  To compile this support as a module, choose M here: the
-	  modules will be called i2o_core and i2o_config.
+	  modules will be called i2o_core.
 
 	  If unsure, say N.
 
-config I2O_PCI
-	tristate "I2O PCI support"
+config I2O_CONFIG
+	tristate "I2O Configuration support"
 	depends on PCI && I2O
 	help
-	  Say Y for support of PCI bus I2O interface adapters. Currently this
-	  is the only variety supported, so you should say Y.
+	  Say Y for support of the configuration interface for the I2O adapters.
+	  If you have a RAID controller from Adaptec and you want to use the
+	  raidutils to manage your RAID array, you have to say Y here.
 
 	  To compile this support as a module, choose M here: the
-	  module will be called i2o_pci.
+	  module will be called i2o_config.
 
 config I2O_BLOCK
 	tristate "I2O Block OSM"
diff --git a/drivers/message/i2o/Makefile b/drivers/message/i2o/Makefile
index 099e75f88..e3169dbd9 100644
--- a/drivers/message/i2o/Makefile
+++ b/drivers/message/i2o/Makefile
@@ -5,7 +5,8 @@
 # In the future, some of these should be built conditionally.
 #
 
-obj-$(CONFIG_I2O)	+= i2o_core.o i2o_config.o
+obj-$(CONFIG_I2O)	+= i2o_core.o
+obj-$(CONFIG_I2O_CONFIG)+= i2o_config.o
 obj-$(CONFIG_I2O_BLOCK)	+= i2o_block.o
 obj-$(CONFIG_I2O_SCSI)	+= i2o_scsi.o
 obj-$(CONFIG_I2O_PROC)	+= i2o_proc.o
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 49f850e64..76de2d7ae 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -83,7 +83,6 @@
 #include <asm/semaphore.h>
 #include <linux/completion.h>
 #include <asm/io.h>
-#include <asm/atomic.h>
 #include <linux/smp_lock.h>
 #include <linux/wait.h>
 
@@ -111,16 +110,12 @@
 				 I2O_EVT_IND_BSA_SCSI_SMART )
 
 
-#define I2O_LOCK(unit)	(i2ob_dev[(unit)].req_queue->queue_lock)
-
 /*
  *	Some of these can be made smaller later
  */
 
-static int i2ob_media_change_flag[MAX_I2OB];
-static u32 i2ob_max_sectors[MAX_I2OB<<4];
-
 static int i2ob_context;
+static struct block_device_operations i2ob_fops;
 
 /*
  * I2O Block device descriptor 
@@ -143,6 +138,9 @@ struct i2ob_device
 	int wcache;
 	int power;
 	int index;
+	int media_change_flag;
+	u32 max_sectors;
+	struct gendisk *gd;
 };
 
 /*
@@ -162,16 +160,16 @@ struct i2ob_request
 };
 
 /*
- * Per IOP requst queue information
+ * Per IOP request queue information
  *
- * We have a separate requeust_queue_t per IOP so that a heavilly
+ * We have a separate request_queue_t per IOP so that a heavilly
  * loaded I2O block device on an IOP does not starve block devices
  * across all I2O controllers.
  * 
  */
 struct i2ob_iop_queue
 {
-	atomic_t queue_depth;
+	unsigned int queue_depth;
 	struct i2ob_request request_queue[MAX_I2OB_DEPTH];
 	struct i2ob_request *i2ob_qhead;
 	request_queue_t *req_queue;
@@ -183,9 +181,8 @@ static struct i2ob_iop_queue *i2ob_queues[MAX_I2O_CONTROLLERS];
  *	Each I2O disk is one of these.
  */
 
-static struct i2ob_device i2ob_dev[MAX_I2OB<<4];
+static struct i2ob_device i2ob_dev[MAX_I2OB];
 static int i2ob_dev_count = 0;
-static struct gendisk *i2ob_disk[MAX_I2OB];
 
 /*
  * Mutex and spin lock for event handling synchronization
@@ -312,7 +309,6 @@ static int i2ob_send(u32 m, struct i2ob_device *dev, struct i2ob_request *ireq,
 	/* 
 	 * Mask out partitions from now on
 	 */
-	unit &= 0xF0;
 		
 	/* This can be optimised later - just want to be sure its right for
 	   starters */
@@ -402,7 +398,7 @@ static int i2ob_send(u32 m, struct i2ob_device *dev, struct i2ob_request *ireq,
 	}
 
 	i2o_post_message(c,m);
-	atomic_inc(&i2ob_queues[c->unit]->queue_depth);
+	i2ob_queues[c->unit]->queue_depth ++;
 
 	return 0;
 }
@@ -453,8 +449,8 @@ static void i2o_block_reply(struct i2o_handler *h, struct i2o_controller *c, str
 	struct i2ob_request *ireq = NULL;
 	u8 st;
 	u32 *m = (u32 *)msg;
-	u8 unit = (m[2]>>8)&0xF0;	/* low 4 bits are partition */
-	struct i2ob_device *dev = &i2ob_dev[(unit&0xF0)];
+	u8 unit = m[2]>>8;
+	struct i2ob_device *dev = &i2ob_dev[unit];
 
 	/*
 	 * FAILed message
@@ -475,10 +471,10 @@ static void i2o_block_reply(struct i2o_handler *h, struct i2o_controller *c, str
 		ireq=&i2ob_queues[c->unit]->request_queue[m[3]];
 		ireq->req->errors++;
 
-		spin_lock_irqsave(I2O_LOCK(c->unit), flags);
+		spin_lock_irqsave(dev->req_queue->queue_lock, flags);
 		i2ob_unhook_request(ireq, c->unit);
 		i2ob_end_request(ireq->req);
-		spin_unlock_irqrestore(I2O_LOCK(c->unit), flags);
+		spin_unlock_irqrestore(dev->req_queue->queue_lock, flags);
 	
 		/* Now flush the message by making it a NOP */
 		m[0]&=0x00FFFFFF;
@@ -509,10 +505,10 @@ static void i2o_block_reply(struct i2o_handler *h, struct i2o_controller *c, str
 		ireq=&i2ob_queues[c->unit]->request_queue[m[3]];
 		ireq->req->errors++;
 		printk(KERN_WARNING "I2O Block: Data transfer to deleted device!\n");
-		spin_lock_irqsave(I2O_LOCK(c->unit), flags);
+		spin_lock_irqsave(dev->req_queue->queue_lock, flags);
 		i2ob_unhook_request(ireq, c->unit);
 		i2ob_end_request(ireq->req);
-		spin_unlock_irqrestore(I2O_LOCK(c->unit), flags);
+		spin_unlock_irqrestore(dev->req_queue->queue_lock, flags);
 		return;
 	}	
 
@@ -576,17 +572,17 @@ static void i2o_block_reply(struct i2o_handler *h, struct i2o_controller *c, str
 	 */
 	
 	i2ob_free_sglist(dev, ireq);
-	spin_lock_irqsave(I2O_LOCK(c->unit), flags);
+	spin_lock_irqsave(dev->req_queue->queue_lock, flags);
 	i2ob_unhook_request(ireq, c->unit);
 	i2ob_end_request(ireq->req);
-	atomic_dec(&i2ob_queues[c->unit]->queue_depth);
+	i2ob_queues[c->unit]->queue_depth --;
 	
 	/*
 	 *	We may be able to do more I/O
 	 */
 	 
-	i2ob_request(dev->req_queue);
-	spin_unlock_irqrestore(I2O_LOCK(c->unit), flags);
+	i2ob_request(dev->gd->queue);
+	spin_unlock_irqrestore(dev->req_queue->queue_lock, flags);
 }
 
 /* 
@@ -598,8 +594,8 @@ static int i2ob_evt(void *dummy)
 {
 	unsigned int evt;
 	unsigned long flags;
+	struct i2ob_device *dev;
 	int unit;
-	int i;
 	//The only event that has data is the SCSI_SMART event.
 	struct i2o_reply {
 		u32 header[4];
@@ -638,6 +634,7 @@ static int i2ob_evt(void *dummy)
 		unit = le32_to_cpu(evt_local->header[3]);
 		evt = le32_to_cpu(evt_local->evt_indicator);
 
+		dev = &i2ob_dev[unit];
 		switch(evt)
 		{
 			/*
@@ -648,10 +645,9 @@ static int i2ob_evt(void *dummy)
 			 */
 			case I2O_EVT_IND_BSA_VOLUME_LOAD:
 			{
-				struct gendisk *p = i2ob_disk[unit>>4];
-				i2ob_install_device(i2ob_dev[unit].i2odev->controller, 
-					i2ob_dev[unit].i2odev, unit);
-				add_disk(p);
+				i2ob_install_device(dev->i2odev->controller,
+					dev->i2odev, unit);
+				add_disk(dev->gd);
 				break;
 			}
 
@@ -663,17 +659,18 @@ static int i2ob_evt(void *dummy)
 			 */
 			case I2O_EVT_IND_BSA_VOLUME_UNLOAD:
 			{
-				struct gendisk *p = i2ob_disk[unit>>4];
+				struct gendisk *p = dev->gd;
+				blk_queue_max_sectors(dev->gd->queue, 0);
 				del_gendisk(p);
-				for(i = unit; i <= unit+15; i++)
-					blk_queue_max_sectors(i2ob_dev[i].req_queue, 0);
-				i2ob_media_change_flag[unit] = 1;
+				put_disk(p);
+				dev->gd = NULL;
+				dev->media_change_flag = 1;
 				break;
 			}
 
 			case I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ:
 				printk(KERN_WARNING "%s: Attempt to eject locked media\n", 
-					i2ob_dev[unit].i2odev->dev_name);
+					dev->i2odev->dev_name);
 				break;
 
 			/*
@@ -691,12 +688,12 @@ static int i2ob_evt(void *dummy)
 			{
 				u64 size;
 
-	  			if(i2ob_query_device(&i2ob_dev[unit], 0x0004, 0, &size, 8) !=0 )
-					i2ob_query_device(&i2ob_dev[unit], 0x0000, 4, &size, 8);
+	  			if(i2ob_query_device(dev, 0x0004, 0, &size, 8) !=0 )
+					i2ob_query_device(dev, 0x0000, 4, &size, 8);
 
-				spin_lock_irqsave(I2O_LOCK(unit), flags);	
-				set_capacity(i2ob_disk[unit>>4], size>>9);
-				spin_unlock_irqrestore(I2O_LOCK(unit), flags);	
+				spin_lock_irqsave(dev->req_queue->queue_lock, flags);
+				set_capacity(dev->gd, size>>9);
+				spin_unlock_irqrestore(dev->req_queue->queue_lock, flags);
 				break;
 			}
 
@@ -708,7 +705,7 @@ static int i2ob_evt(void *dummy)
 			case I2O_EVT_IND_BSA_SCSI_SMART:
 			{
 				char buf[16];
-				printk(KERN_INFO "I2O Block: %s received a SCSI SMART Event\n",i2ob_dev[unit].i2odev->dev_name);
+				printk(KERN_INFO "I2O Block: %s received a SCSI SMART Event\n",dev->i2odev->dev_name);
 				evt_local->data[16]='\0';
 				sprintf(buf,"%s",&evt_local->data[0]);
 				printk(KERN_INFO "      Disk Serial#:%s\n",buf);
@@ -735,12 +732,12 @@ static int i2ob_evt(void *dummy)
 				 * hit the fan big time. The card seems to recover but loses
 				 * the pending writes. Deeply ungood except for testing fsck
 				 */
-				if(i2ob_dev[unit].i2odev->controller->promise)
+				if(dev->i2odev->controller->promise)
 					panic("I2O controller firmware failed. Reboot and force a filesystem check.\n");
 			default:
 				printk(KERN_INFO "%s: Received event 0x%X we didn't register for\n"
 					KERN_INFO "   Blame the I2O card manufacturer 8)\n", 
-					i2ob_dev[unit].i2odev->dev_name, evt);
+					dev->i2odev->dev_name, evt);
 				break;
 		}
 	};
@@ -765,14 +762,6 @@ static void i2ob_request(request_queue_t *q)
 	u32 m;
 	
 	while ((req = elv_next_request(q)) != NULL) {
-		/*
-		 *	On an IRQ completion if there is an inactive
-		 *	request on the queue head it means it isnt yet
-		 *	ready to dispatch.
-		 */
-		if(req->rq_status == RQ_INACTIVE)
-			return;
-
 		dev = req->rq_disk->private_data;
 
 		/* 
@@ -780,7 +769,7 @@ static void i2ob_request(request_queue_t *q)
 		 *	generic IOP commit control. Certainly it's not right 
 		 *	its global!  
 		 */
-		if(atomic_read(&i2ob_queues[dev->unit]->queue_depth) >= dev->depth)
+		if(i2ob_queues[dev->unit]->queue_depth >= dev->depth)
 			break;
 		
 		/* Get a message */
@@ -788,7 +777,7 @@ static void i2ob_request(request_queue_t *q)
 
 		if(m==0xFFFFFFFF)
 		{
-			if(atomic_read(&i2ob_queues[dev->unit]->queue_depth) == 0)
+			if(i2ob_queues[dev->unit]->queue_depth == 0)
 				printk(KERN_ERR "i2o_block: message queue and request queue empty!!\n");
 			break;
 		}
@@ -797,13 +786,12 @@ static void i2ob_request(request_queue_t *q)
 		 */
 		req->errors = 0;
 		blkdev_dequeue_request(req);	
-		req->waiting = NULL;
 		
 		ireq = i2ob_queues[dev->unit]->i2ob_qhead;
 		i2ob_queues[dev->unit]->i2ob_qhead = ireq->next;
 		ireq->req = req;
 
-		i2ob_send(m, dev, ireq, (dev->unit&0xF0));
+		i2ob_send(m, dev, ireq, dev->index);
 	}
 }
 
@@ -1065,7 +1053,10 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
 	u16 power;
 	u32 flags, status;
 	struct i2ob_device *dev=&i2ob_dev[unit];
-	int i;
+	struct gendisk *disk;
+	request_queue_t *q;
+	int segments;
+
 
 	/*
 	 * For logging purposes...
@@ -1079,21 +1070,35 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
 	 * before any I/O can be performed. If it fails, this
 	 * device is useless.
 	 */
-	if(!i2ob_queues[unit]) {
-		if(i2ob_init_iop(unit))
+	if(!i2ob_queues[c->unit]) {
+		if(i2ob_init_iop(c->unit))
 			return 1;
 	}
 
+	q = i2ob_queues[c->unit]->req_queue;
+
 	/*
 	 * This will save one level of lookup/indirection in critical
 	 * code so that we can directly get the queue ptr from the
 	 * device instead of having to go the IOP data structure.
 	 */
-	dev->req_queue = i2ob_queues[unit]->req_queue;
+	dev->req_queue = q;
 
+	/*
+	 * Allocate a gendisk structure and initialize it
+	 */
+	disk = alloc_disk(16);
+	if (!disk)
+		return 1;
+
+	dev->gd = disk;
 	/* initialize gendik structure */
-	i2ob_disk[unit>>4]->private_data = dev;
-	i2ob_disk[unit>>4]->queue = dev->req_queue;
+	disk->major = MAJOR_NR;
+	disk->first_minor = unit<<4;
+	disk->queue = q;
+	disk->fops = &i2ob_fops;
+	sprintf(disk->disk_name, "i2o/hd%c", 'a' + unit);
+	disk->private_data = dev;
 
 	/*
 	 *	Ask for the current media data. If that isn't supported
@@ -1110,53 +1115,49 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
 		power = 0;
 	i2ob_query_device(dev, 0x0000, 5, &flags, 4);
 	i2ob_query_device(dev, 0x0000, 6, &status, 4);
-	set_capacity(i2ob_disk[unit>>4], size>>9);
+	set_capacity(disk, size>>9);
 
 	/*
 	 * Max number of Scatter-Gather Elements
 	 */	
 
-	i2ob_dev[unit].power = power;	/* Save power state in device proper */
-	i2ob_dev[unit].flags = flags;
+	dev->power = power;	/* Save power state in device proper */
+	dev->flags = flags;
 
-	for(i=unit;i<=unit+15;i++)
-	{
-		request_queue_t *q = i2ob_dev[unit].req_queue;
-		int segments = (d->controller->status_block->inbound_frame_size - 7) / 2;
-
-		if(segments > 16)
-			segments = 16;
-					
-		i2ob_dev[i].power = power;	/* Save power state */
-		i2ob_dev[unit].flags = flags;	/* Keep the type info */
+	segments = (d->controller->status_block->inbound_frame_size - 7) / 2;
+
+	if(segments > 16)
+		segments = 16;
+
+	dev->power = power;	/* Save power state */
+	dev->flags = flags;	/* Keep the type info */
 		
-		blk_queue_max_sectors(q, 96);	/* 256 might be nicer but many controllers 
+	blk_queue_max_sectors(q, 96);	/* 256 might be nicer but many controllers
 						   explode on 65536 or higher */
-		blk_queue_max_phys_segments(q, segments);
-		blk_queue_max_hw_segments(q, segments);
+	blk_queue_max_phys_segments(q, segments);
+	blk_queue_max_hw_segments(q, segments);
 		
-		i2ob_dev[i].rcache = CACHE_SMARTFETCH;
-		i2ob_dev[i].wcache = CACHE_WRITETHROUGH;
+	dev->rcache = CACHE_SMARTFETCH;
+	dev->wcache = CACHE_WRITETHROUGH;
 		
-		if(d->controller->battery == 0)
-			i2ob_dev[i].wcache = CACHE_WRITETHROUGH;
+	if(d->controller->battery == 0)
+		dev->wcache = CACHE_WRITETHROUGH;
 
-		if(d->controller->promise)
-			i2ob_dev[i].wcache = CACHE_WRITETHROUGH;
+	if(d->controller->promise)
+		dev->wcache = CACHE_WRITETHROUGH;
 
-		if(d->controller->short_req)
-		{
-			blk_queue_max_sectors(q, 8);
-			blk_queue_max_phys_segments(q, 8);
-			blk_queue_max_hw_segments(q, 8);
-		}
+	if(d->controller->short_req)
+	{
+		blk_queue_max_sectors(q, 8);
+		blk_queue_max_phys_segments(q, 8);
+		blk_queue_max_hw_segments(q, 8);
 	}
 
-	strcpy(d->dev_name, i2ob_disk[unit>>4]->disk_name);
-	strcpy(i2ob_disk[unit>>4]->devfs_name, i2ob_disk[unit>>4]->disk_name);
+	strcpy(d->dev_name, disk->disk_name);
+	strcpy(disk->devfs_name, disk->disk_name);
 
 	printk(KERN_INFO "%s: Max segments %d, queue depth %d, byte limit %d.\n",
-		 d->dev_name, i2ob_dev[unit].max_segments, i2ob_dev[unit].depth, i2ob_max_sectors[unit]<<9);
+		 d->dev_name, dev->max_segments, dev->depth, dev->max_sectors<<9);
 
 	i2ob_query_device(dev, 0x0000, 0, &type, 1);
 
@@ -1197,7 +1198,7 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
 	}
 	printk(".\n");
 	printk(KERN_INFO "%s: Maximum sectors/read set to %d.\n", 
-		d->dev_name, i2ob_max_sectors[unit]);
+		d->dev_name, dev->max_sectors);
 
 	/*
 	 * Register for the events we're interested in and that the
@@ -1233,7 +1234,7 @@ static int i2ob_init_iop(unsigned int unit)
 	/* Queue is MAX_I2OB + 1... */
 	i2ob_queues[unit]->request_queue[i].next = NULL;
 	i2ob_queues[unit]->i2ob_qhead = &i2ob_queues[unit]->request_queue[0];
-	atomic_set(&i2ob_queues[unit]->queue_depth, 0);
+	i2ob_queues[unit]->queue_depth = 0;
 
 	i2ob_queues[unit]->lock = SPIN_LOCK_UNLOCKED;
 	i2ob_queues[unit]->req_queue = blk_init_queue(i2ob_request, &i2ob_queues[unit]->lock);
@@ -1257,7 +1258,6 @@ static void i2ob_scan(int bios)
 
 	struct i2o_device *d, *b=NULL;
 	struct i2o_controller *c;
-	struct i2ob_device *dev;
 		
 	for(i=0; i< MAX_I2O_CONTROLLERS; i++)
 	{
@@ -1313,44 +1313,12 @@ static void i2ob_scan(int bios)
 					continue; /*Already claimed on pass 1 */
 			}
 
-			if(i2o_claim_device(d, &i2o_block_handler))
-			{
-				printk(KERN_WARNING "i2o_block: Controller %d, TID %d\n", c->unit,
-					d->lct_data.tid);
-				printk(KERN_WARNING "\t%sevice refused claim! Skipping installation\n", bios?"Boot d":"D");
-				continue;
-			}
-
-			i2o_release_device(d, &i2o_block_handler);
-
-			if(scan_unit<MAX_I2OB<<4)
-			{
- 				/*
-				 * Get the device and fill in the
-				 * Tid and controller.
-				 */
-				dev=&i2ob_dev[scan_unit];
-				dev->i2odev = d; 
-				dev->controller = c;
-				dev->unit = c->unit;
-				dev->tid = d->lct_data.tid;
-
-				if(i2ob_install_device(c,d,scan_unit))
-					printk(KERN_WARNING "Could not install I2O block device\n");
-				else
-				{
-					add_disk(i2ob_disk[scan_unit>>4]);
-					scan_unit+=16;
-					i2ob_dev_count++;
-
-					/* We want to know when device goes away */
-					i2o_device_notify_on(d, &i2o_block_handler);
-				}
-			}
+			if(scan_unit<MAX_I2OB)
+				i2ob_new_device(c, d);
 			else
 			{
 				if(!warned++)
-					printk(KERN_WARNING "i2o_block: too many device, registering only %d.\n", scan_unit>>4);
+					printk(KERN_WARNING "i2o_block: too many device, registering only %d.\n", scan_unit);
 			}
 		}
 		i2o_unlock_controller(c);
@@ -1399,12 +1367,12 @@ void i2ob_new_device(struct i2o_controller *c, struct i2o_device *d)
 	printk(KERN_INFO "   Controller %d Tid %d\n",c->unit, d->lct_data.tid);
 
 	/* Check for available space */
-	if(i2ob_dev_count>=MAX_I2OB<<4)
+	if(i2ob_dev_count>=MAX_I2OB)
 	{
 		printk(KERN_ERR "i2o_block: No more devices allowed!\n");
 		return;
 	}
-	for(unit = 0; unit < (MAX_I2OB<<4); unit += 16)
+	for(unit = 0; unit < MAX_I2OB; unit ++)
 	{
 		if(!i2ob_dev[unit].i2odev)
 			break;
@@ -1420,18 +1388,20 @@ void i2ob_new_device(struct i2o_controller *c, struct i2o_device *d)
 	dev->i2odev = d; 
 	dev->controller = c;
 	dev->tid = d->lct_data.tid;
+	dev->unit = c->unit;
 
-	if(i2ob_install_device(c,d,unit))
+	if(i2ob_install_device(c,d,unit)) {
+		i2o_release_device(d, &i2o_block_handler);
 		printk(KERN_ERR "i2o_block: Could not install new device\n");
+	}
 	else	
 	{
-		add_disk(i2ob_disk[unit>>4]);
+		i2o_release_device(d, &i2o_block_handler);
+		add_disk(dev->gd);
 		i2ob_dev_count++;
 		i2o_device_notify_on(d, &i2o_block_handler);
 	}
 
-	i2o_release_device(d, &i2o_block_handler);
- 
 	return;
 }
 
@@ -1443,64 +1413,58 @@ void i2ob_new_device(struct i2o_controller *c, struct i2o_device *d)
 void i2ob_del_device(struct i2o_controller *c, struct i2o_device *d)
 {	
 	int unit = 0;
-	int i = 0;
 	unsigned long flags;
+	struct i2ob_device *dev;
 
-	spin_lock_irqsave(I2O_LOCK(c->unit), flags);
-
-	/*
-	 * Need to do this...we somtimes get two events from the IRTOS
-	 * in a row and that causes lots of problems.
-	 */
-	i2o_device_notify_off(d, &i2o_block_handler);
-
-	printk(KERN_INFO "I2O Block Device Deleted\n");
-
-	for(unit = 0; unit < MAX_I2OB<<4; unit += 16)
+	for(unit = 0; unit < MAX_I2OB; unit ++)
 	{
-		if(i2ob_dev[unit].i2odev == d)
+		dev = &i2ob_dev[unit];
+		if(dev->i2odev == d)
 		{
 			printk(KERN_INFO "  /dev/%s: Controller %d Tid %d\n", 
 				d->dev_name, c->unit, d->lct_data.tid);
 			break;
 		}
 	}
-	if(unit >= MAX_I2OB<<4)
+
+	printk(KERN_INFO "I2O Block Device Deleted\n");
+
+	if(unit >= MAX_I2OB)
 	{
 		printk(KERN_ERR "i2ob_del_device called, but not in dev table!\n");
-		spin_unlock_irqrestore(I2O_LOCK(c->unit), flags);
 		return;
 	}
 
+	spin_lock_irqsave(dev->req_queue->queue_lock, flags);
+
+	/*
+	 * Need to do this...we somtimes get two events from the IRTOS
+	 * in a row and that causes lots of problems.
+	 */
+	i2o_device_notify_off(d, &i2o_block_handler);
+
 	/* 
 	 * This will force errors when i2ob_get_queue() is called
 	 * by the kenrel.
 	 */
-	del_gendisk(i2ob_disk[unit>>4]);
-	i2ob_dev[unit].req_queue = NULL;
-	for(i = unit; i <= unit+15; i++)
-	{
-		i2ob_dev[i].i2odev = NULL;
-		blk_queue_max_sectors(i2ob_dev[i].req_queue, 0);
+	if(dev->gd) {
+		struct gendisk *gd = dev->gd;
+		gd->queue = NULL;
+		del_gendisk(gd);
+		put_disk(gd);
+		dev->gd = NULL;
 	}
-	spin_unlock_irqrestore(I2O_LOCK(c->unit), flags);
-
-	/*
-	 * Decrease usage count for module
-	 */	
-
-	while(i2ob_dev[unit].refcnt--)
-		MOD_DEC_USE_COUNT;
-
-	i2ob_dev[unit].refcnt = 0;
-	
-	i2ob_dev[i].tid = 0;
+	spin_unlock_irqrestore(dev->req_queue->queue_lock, flags);
+	dev->req_queue = NULL;
+	dev->i2odev = NULL;
+	dev->refcnt = 0;
+	dev->tid = 0;
 
 	/* 
 	 * Do we need this?
 	 * The media didn't really change...the device is just gone
 	 */
-	i2ob_media_change_flag[unit] = 1;
+	dev->media_change_flag = 1;
 
 	i2ob_dev_count--;	
 }
@@ -1511,10 +1475,9 @@ void i2ob_del_device(struct i2o_controller *c, struct i2o_device *d)
 static int i2ob_media_change(struct gendisk *disk)
 {
 	struct i2ob_device *p = disk->private_data;
-	int i = p->index;
-	if(i2ob_media_change_flag[i])
+	if(p->media_change_flag)
 	{
-		i2ob_media_change_flag[i]=0;
+		p->media_change_flag=0;
 		return 1;
 	}
 	return 0;
@@ -1523,7 +1486,7 @@ static int i2ob_media_change(struct gendisk *disk)
 static int i2ob_revalidate(struct gendisk *disk)
 {
 	struct i2ob_device *p = disk->private_data;
-	return i2ob_install_device(p->controller, p->i2odev, p->index<<4);
+	return i2ob_install_device(p->controller, p->i2odev, p->index);
 }
 
 /*
@@ -1536,7 +1499,7 @@ static void i2ob_reboot_event(void)
 	
 	for(i=0;i<MAX_I2OB;i++)
 	{
-		struct i2ob_device *dev=&i2ob_dev[(i<<4)];
+		struct i2ob_device *dev=&i2ob_dev[i];
 		
 		if(dev->refcnt!=0)
 		{
@@ -1598,50 +1561,35 @@ static int i2o_block_init(void)
 	if (register_blkdev(MAJOR_NR, "i2o_block"))
 		return -EIO;
 
-	for (i = 0; i < MAX_I2OB; i++) {
-		struct gendisk *disk = alloc_disk(16);
-		if (!disk)
-			goto oom;
-		i2ob_dev[i<<4].index = i;
-		disk->queue = i2ob_dev[i<<4].req_queue;
-		i2ob_disk[i] = disk;
-	}
 #ifdef MODULE
 	printk(KERN_INFO "i2o_block: registered device at major %d\n", MAJOR_NR);
 #endif
 
+	/*
+	 *	Set up the queue
+	 */
+	for(i = 0; i < MAX_I2O_CONTROLLERS; i++)
+		i2ob_queues[i] = NULL;
+
 	/*
 	 *	Now fill in the boiler plate
 	 */
 	 
-	for (i = 0; i < MAX_I2OB << 4; i++) {
-		i2ob_dev[i].refcnt = 0;
-		i2ob_dev[i].flags = 0;
-		i2ob_dev[i].controller = NULL;
-		i2ob_dev[i].i2odev = NULL;
-		i2ob_dev[i].tid = 0;
-		i2ob_dev[i].head = NULL;
-		i2ob_dev[i].tail = NULL;
-		i2ob_dev[i].depth = MAX_I2OB_DEPTH;
-		i2ob_max_sectors[i] = 2;
-	}
-	
 	for (i = 0; i < MAX_I2OB; i++) {
-		struct gendisk *disk = i2ob_disk[i];
-		disk->major = MAJOR_NR;
-		disk->first_minor = i<<4;
-		disk->fops = &i2ob_fops;
-		sprintf(disk->disk_name, "i2o/hd%c", 'a' + i);
+		struct i2ob_device *dev = &i2ob_dev[i];
+		dev->index = i;
+		dev->refcnt = 0;
+		dev->flags = 0;
+		dev->controller = NULL;
+		dev->i2odev = NULL;
+		dev->tid = 0;
+		dev->head = NULL;
+		dev->tail = NULL;
+		dev->depth = MAX_I2OB_DEPTH;
+		dev->max_sectors = 2;
+		dev->gd = NULL;
 	}
 	
-	/*
-	 *	Set up the queue
-	 */
-	for(i = 0; i < MAX_I2O_CONTROLLERS; i++)
-	{
-		i2ob_queues[i] = NULL;
-	}
-
 	/*
 	 *	Register the OSM handler as we will need this to probe for
 	 *	drives, geometry and other goodies.
@@ -1671,9 +1619,6 @@ static int i2o_block_init(void)
 
 	return 0;
 
-oom:
-	while (i--)
-		put_disk(i2ob_disk[i]);
 	unregister_blkdev(MAJOR_NR, "i2o_block");
 	return -ENOMEM;
 }
@@ -1701,11 +1646,8 @@ static void i2o_block_exit(void)
 	if(i2ob_dev_count) {
 		struct i2o_device *d;
 		for(i = 0; i < MAX_I2OB; i++)
-		if((d=i2ob_dev[i<<4].i2odev)) {
-			i2o_device_notify_off(d, &i2o_block_handler);
-			i2o_event_register(d->controller, d->lct_data.tid, 
-				i2ob_context, i<<4, 0);
-		}
+			if((d = i2ob_dev[i].i2odev))
+				i2ob_del_device(d->controller, d);
 	}
 	
 	/*
@@ -1725,15 +1667,21 @@ static void i2o_block_exit(void)
 	 */
 
 	i2o_remove_handler(&i2o_block_handler);
-		 
-	for (i = 0; i < MAX_I2OB; i++)
-		put_disk(i2ob_disk[i]);
 
 	/*
 	 *	Return the block device
 	 */
 	if (unregister_blkdev(MAJOR_NR, "i2o_block") != 0)
 		printk("i2o_block: cleanup_module failed\n");
+
+	/*
+	 *	release request queue
+	 */
+	for (i = 0; i < MAX_I2O_CONTROLLERS; i ++)
+		if(i2ob_queues[i]) {
+			blk_cleanup_queue(i2ob_queues[i]->req_queue);
+			kfree(i2ob_queues[i]);
+		}
 }
 
 MODULE_AUTHOR("Red Hat");
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 1aa5dd6c0..f417bac42 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -5,21 +5,24 @@
  *	
  * Written by Alan Cox, Building Number Three Ltd
  *
- * Modified 04/20/1999 by Deepak Saxena
- *   - Added basic ioctl() support
- * Modified 06/07/1999 by Deepak Saxena
- *   - Added software download ioctl (still testing)
- * Modified 09/10/1999 by Auvo Häkkinen
- *   - Changes to i2o_cfg_reply(), ioctl_parms()
- *   - Added ioct_validate()
- * Modified 09/30/1999 by Taneli Vähäkangas
- *   - Fixed ioctl_swdl()
- * Modified 10/04/1999 by Taneli Vähäkangas
- *   - Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel()
- * Modified 11/18/1999 by Deepak Saxena
- *   - Added event managmenet support
- *
- * 2.4 rewrite ported to 2.5 - Alan Cox <alan@redhat.com>
+ * Fixes/additions:
+ *	Deepak Saxena (04/20/1999):
+ *		Added basic ioctl() support
+ *	Deepak Saxena (06/07/1999):
+ *		Added software download ioctl (still testing)
+ *	Auvo Häkkinen (09/10/1999):
+ *		Changes to i2o_cfg_reply(), ioctl_parms()
+ *		Added ioct_validate()
+ *	Taneli Vähäkangas (09/30/1999):
+ *		Fixed ioctl_swdl()
+ *	Taneli Vähäkangas (10/04/1999):
+ *		Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel()
+ *	Deepak Saxena (11/18/1999):
+ *		Added event managmenet support
+ *	Alan Cox <alan@redhat.com>:
+ *		2.4 rewrite ported to 2.5
+ *	Markus Lidel <Markus.Lidel@shadowconnect.com>:
+ *		Added pass-thru support for Adaptec's raidutils
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -49,6 +52,11 @@ struct wait_queue *i2o_wait_queue;
 
 #define MODINC(x,y) ((x) = ((x) + 1) % (y))
 
+struct sg_simple_element {
+	u32  flag_count;
+	u32 addr_bus;
+};
+
 struct i2o_cfg_info
 {
 	struct file* fp;
@@ -75,6 +83,7 @@ static int ioctl_swdel(unsigned long);
 static int ioctl_validate(unsigned long); 
 static int ioctl_evt_reg(unsigned long, struct file *);
 static int ioctl_evt_get(unsigned long, struct file *);
+static int ioctl_passthru(unsigned long);
 static int cfg_fasync(int, struct file*, int);
 
 /*
@@ -256,6 +265,10 @@ static int cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd,
 			ret = ioctl_evt_get(arg, fp);
 			break;
 
+		case I2OPASSTHRU:
+			ret = ioctl_passthru(arg);
+			break;
+
 		default:
 			ret = -EINVAL;
 	}
@@ -827,6 +840,165 @@ static int ioctl_evt_get(unsigned long arg, struct file *fp)
 	return 0;
 }
 
+static int ioctl_passthru(unsigned long arg)
+{
+	struct i2o_cmd_passthru *cmd = (struct i2o_cmd_passthru *) arg;
+	struct i2o_controller *c;
+	u32 msg[MSG_FRAME_SIZE];
+	u32 *user_msg = (u32*)cmd->msg;
+	u32 *reply = NULL;
+	u32 *user_reply = NULL;
+	u32 size = 0;
+	u32 reply_size = 0;
+	u32 rcode = 0;
+	ulong sg_list[SG_TABLESIZE];
+	u32 sg_offset = 0;
+	u32 sg_count = 0;
+	int sg_index = 0;
+	u32 i = 0;
+	ulong p = 0;
+
+	c = i2o_find_controller(cmd->iop);
+	if(!c)
+                return -ENXIO;
+
+	memset(&msg, 0, MSG_FRAME_SIZE*4);
+	if(get_user(size, &user_msg[0]))
+		return -EFAULT;
+	size = size>>16;
+
+	user_reply = &user_msg[size];
+	if(size > MSG_FRAME_SIZE)
+		return -EFAULT;
+	size *= 4; // Convert to bytes
+
+	/* Copy in the user's I2O command */
+	if(copy_from_user((void*)msg, (void*)user_msg, size))
+		return -EFAULT;
+	if(get_user(reply_size, &user_reply[0]) < 0)
+		return -EFAULT;
+
+	reply_size = reply_size>>16;
+	reply = kmalloc(REPLY_FRAME_SIZE*4, GFP_KERNEL);
+	if(!reply) {
+		printk(KERN_WARNING"%s: Could not allocate reply buffer\n",c->name);
+		return -ENOMEM;
+	}
+	memset(reply, 0, REPLY_FRAME_SIZE*4);
+	sg_offset = (msg[0]>>4)&0x0f;
+	msg[2] = (u32)i2o_cfg_context;
+	msg[3] = (u32)reply;
+
+	memset(sg_list,0, sizeof(sg_list[0])*SG_TABLESIZE);
+	if(sg_offset) {
+		struct sg_simple_element *sg;
+
+		if(sg_offset * 4 >= size) {
+			rcode = -EFAULT;
+			goto cleanup;
+		}
+		// TODO 64bit fix
+		sg = (struct sg_simple_element*) (msg+sg_offset);
+		sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
+		if (sg_count > SG_TABLESIZE) {
+			printk(KERN_DEBUG"%s:IOCTL SG List too large (%u)\n", c->name,sg_count);
+			kfree (reply);
+			return -EINVAL;
+		}
+
+		for(i = 0; i < sg_count; i++) {
+			int sg_size;
+
+			if (!(sg[i].flag_count & 0x10000000 /*I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT*/)) {
+				printk(KERN_DEBUG"%s:Bad SG element %d - not simple (%x)\n",c->name,i,  sg[i].flag_count);
+				rcode = -EINVAL;
+				goto cleanup;
+			}
+			sg_size = sg[i].flag_count & 0xffffff;
+			/* Allocate memory for the transfer */
+			p = (ulong)kmalloc(sg_size, GFP_KERNEL);
+			if (!p) {
+				printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", c->name,sg_size,i,sg_count);
+				rcode = -ENOMEM;
+				goto cleanup;
+			}
+			sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame.
+			/* Copy in the user's SG buffer if necessary */
+			if(sg[i].flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR*/) {
+				// TODO 64bit fix
+			        if (copy_from_user((void*)p,(void*)sg[i].addr_bus, sg_size)) {
+					printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",c->name,i);
+					rcode = -EFAULT;
+					goto cleanup;
+				}
+			}
+			//TODO 64bit fix
+			sg[i].addr_bus = (u32)virt_to_bus((void*)p);
+		}
+	}
+
+	rcode = i2o_post_wait(c, msg, size, 60);
+	if(rcode)
+		goto cleanup;
+
+	if(sg_offset) {
+		/* Copy back the Scatter Gather buffers back to user space */
+		u32 j;
+		// TODO 64bit fix
+		struct sg_simple_element* sg;
+		int sg_size;
+
+		// re-acquire the original message to handle correctly the sg copy operation
+		memset(&msg, 0, MSG_FRAME_SIZE*4);
+		// get user msg size in u32s
+		if (get_user(size, &user_msg[0])) {
+			rcode = -EFAULT;
+			goto cleanup;
+		}
+		size = size>>16;
+		size *= 4;
+		/* Copy in the user's I2O command */
+		if (copy_from_user ((void*)msg, (void*)user_msg, size)) {
+			rcode = -EFAULT;
+			goto cleanup;
+		}
+		sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
+
+		 // TODO 64bit fix
+		sg = (struct sg_simple_element*)(msg + sg_offset);
+		for (j = 0; j < sg_count; j++) {
+			/* Copy out the SG list to user's buffer if necessary */
+			if (!(sg[j].flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR*/)) {
+				sg_size = sg[j].flag_count & 0xffffff;
+				// TODO 64bit fix
+				if (copy_to_user((void*)sg[j].addr_bus,(void*)sg_list[j], sg_size)) {
+					printk(KERN_WARNING"%s: Could not copy %lx TO user %x\n",c->name, sg_list[j], sg[j].addr_bus);
+					rcode = -EFAULT;
+					goto cleanup;
+				}
+			}
+		}
+	}
+
+	/* Copy back the reply to user space */
+        if (reply_size) {
+		// we wrote our own values for context - now restore the user supplied ones
+		if(copy_from_user(reply+2, user_msg+2, sizeof(u32)*2)) {
+			printk(KERN_WARNING"%s: Could not copy message context FROM user\n",c->name);
+			rcode = -EFAULT;
+		}
+		if(copy_to_user(user_reply, reply, reply_size)) {
+			printk(KERN_WARNING"%s: Could not copy reply TO user\n",c->name);
+			rcode = -EFAULT;
+		}
+	}
+
+cleanup:
+	kfree(reply);
+	i2o_unlock_controller(c);
+	return rcode;
+}
+
 static int cfg_open(struct inode *inode, struct file *file)
 {
 	struct i2o_cfg_info *tmp = 
diff --git a/drivers/message/i2o/i2o_core.c b/drivers/message/i2o/i2o_core.c
index 36a745ea5..e5afe8dc2 100644
--- a/drivers/message/i2o/i2o_core.c
+++ b/drivers/message/i2o/i2o_core.c
@@ -213,6 +213,135 @@ static struct notifier_block i2o_reboot_notifier =
 
 static int verbose;
 
+#if BITS_PER_LONG == 64
+/**
+ *      i2o_context_list_add -	append an ptr to the context list and return a
+ *				matching context id.
+ *	@ptr: pointer to add to the context list
+ *	@c: controller to which the context list belong
+ *	returns context id, which could be used in the transaction context
+ *	field.
+ *
+ *	Because the context field in I2O is only 32-bit large, on 64-bit the
+ *	pointer is to large to fit in the context field. The i2o_context_list
+ *	functiones map pointers to context fields.
+ */
+u32 i2o_context_list_add(void *ptr, struct i2o_controller *c) {
+	u32 context = 1;
+	struct i2o_context_list_element **entry = &c->context_list;
+	struct i2o_context_list_element *element;
+	unsigned long flags;
+
+	spin_lock_irqsave(&c->context_list_lock, flags);
+	while(*entry && ((*entry)->flags & I2O_CONTEXT_LIST_USED)) {
+		if((*entry)->context >= context)
+			context = (*entry)->context + 1;
+		entry = &((*entry)->next);
+	}
+
+	if(!*entry) {
+		if(unlikely(!context)) {
+			spin_unlock_irqrestore(&c->context_list_lock, flags);
+			printk(KERN_EMERG "i2o_core: context list overflow\n");
+			return 0;
+		}
+
+		element = kmalloc(sizeof(struct i2o_context_list_element), GFP_KERNEL);
+		if(!element) {
+			printk(KERN_EMERG "i2o_core: could not allocate memory for context list element\n");
+			return 0;
+		}
+		element->context = context;
+		element->next = NULL;
+		*entry = element;
+	} else
+		element = *entry;
+
+	element->ptr = ptr;
+	element->flags = I2O_CONTEXT_LIST_USED;
+
+	spin_unlock_irqrestore(&c->context_list_lock, flags);
+	dprintk(KERN_DEBUG "i2o_core: add context to list %p -> %d\n", ptr, context);
+	return context;
+}
+
+/**
+ *      i2o_context_list_remove - remove a ptr from the context list and return
+ *				  the matching context id.
+ *	@ptr: pointer to be removed from the context list
+ *	@c: controller to which the context list belong
+ *	returns context id, which could be used in the transaction context
+ *	field.
+ */
+u32 i2o_context_list_remove(void *ptr, struct i2o_controller *c) {
+	struct i2o_context_list_element **entry = &c->context_list;
+	struct i2o_context_list_element *element;
+	u32 context;
+	unsigned long flags;
+
+	spin_lock_irqsave(&c->context_list_lock, flags);
+	while(*entry && ((*entry)->ptr != ptr))
+		entry = &((*entry)->next);
+
+	if(unlikely(!*entry)) {
+		spin_unlock_irqrestore(&c->context_list_lock, flags);
+		printk(KERN_WARNING "i2o_core: could not remove nonexistent ptr %p\n", ptr);
+		return 0;
+	}
+
+	element = *entry;
+
+	context = element->context;
+	element->ptr = NULL;
+	element->flags |= I2O_CONTEXT_LIST_DELETED;
+
+	spin_unlock_irqrestore(&c->context_list_lock, flags);
+	dprintk(KERN_DEBUG "i2o_core: markt as deleted in context list %p -> %d\n", ptr, context);
+	return context;
+}
+
+/**
+ *      i2o_context_list_get -	get a ptr from the context list and remove it
+ *				from the list.
+ *	@context: context id to which the pointer belong
+ *	@c: controller to which the context list belong
+ *	returns pointer to the matching context id
+ */
+void *i2o_context_list_get(u32 context, struct i2o_controller *c) {
+	struct i2o_context_list_element **entry = &c->context_list;
+	struct i2o_context_list_element *element;
+	void *ptr;
+	int count = 0;
+	unsigned long flags;
+
+	spin_lock_irqsave(&c->context_list_lock, flags);
+	while(*entry && ((*entry)->context != context)) {
+		entry = &((*entry)->next);
+		count ++;
+	}
+
+	if(unlikely(!*entry)) {
+		spin_unlock_irqrestore(&c->context_list_lock, flags);
+		printk(KERN_WARNING "i2o_core: context id %d not found\n", context);
+		return NULL;
+	}
+
+	element = *entry;
+	ptr = element->ptr;
+	if(count >= I2O_CONTEXT_LIST_MIN_LENGTH) {
+		*entry = (*entry)->next;
+		kfree(element);
+	} else {
+		element->ptr = NULL;
+		element->flags &= !I2O_CONTEXT_LIST_USED;
+	}
+
+	spin_unlock_irqrestore(&c->context_list_lock, flags);
+	dprintk(KERN_DEBUG "i2o_core: get ptr from context list %d -> %p\n", context, ptr);
+	return ptr;
+}
+#endif
+
 /*
  * I2O Core reply handler
  */
@@ -3551,6 +3680,10 @@ int __init i2o_pci_install(struct pci_dev *dev)
 	c->short_req = 0;
 	c->pdev = dev;
 
+#if BITS_PER_LONG == 64
+	c->context_list_lock = SPIN_LOCK_UNLOCKED;
+#endif
+
 	c->irq_mask = mem+0x34;
 	c->post_port = mem+0x40;
 	c->reply_port = mem+0x44;
@@ -3788,3 +3921,6 @@ EXPORT_SYMBOL(i2o_event_ack);
 EXPORT_SYMBOL(i2o_report_status);
 EXPORT_SYMBOL(i2o_dump_message);
 EXPORT_SYMBOL(i2o_get_class_name);
+EXPORT_SYMBOL(i2o_context_list_add);
+EXPORT_SYMBOL(i2o_context_list_get);
+EXPORT_SYMBOL(i2o_context_list_remove);
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 81bf4435f..7622e0aa3 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -43,6 +43,7 @@
 #include <linux/pci.h>
 #include <linux/i2o.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/errno.h>
@@ -64,13 +65,14 @@ typedef struct _i2o_proc_entry_t
 	mode_t mode;			/* mode */
 	read_proc_t *read_proc;		/* read func */
 	write_proc_t *write_proc;	/* write func */
+	struct file_operations *fops_proc;	/* file operations func */
 } i2o_proc_entry;
 
 // #define DRIVERDEBUG
 
-static int i2o_proc_read_lct(char *, char **, off_t, int, int *, void *);
-static int i2o_proc_read_hrt(char *, char **, off_t, int, int *, void *);
-static int i2o_proc_read_status(char *, char **, off_t, int, int *, void *);
+static int i2o_seq_show_lct(struct seq_file *, void *);
+static int i2o_seq_show_hrt(struct seq_file *, void *);
+static int i2o_seq_show_status(struct seq_file *, void *);
 
 static int i2o_proc_read_hw(char *, char **, off_t, int, int *, void *);
 static int i2o_proc_read_ddm_table(char *, char **, off_t, int, int *, void *);
@@ -151,20 +153,56 @@ static struct i2o_handler i2o_proc_handler =
 	0xffffffff	// All classes
 };
 
+static int i2o_seq_open_hrt(struct inode *inode, struct file *file)
+{
+	return single_open(file, i2o_seq_show_hrt, PDE(inode)->data);
+};
+
+struct file_operations i2o_seq_fops_hrt = {
+	.open	= i2o_seq_open_hrt,
+	.read	= seq_read,
+	.llseek	= seq_lseek,
+	.release = single_release
+};
+
+static int i2o_seq_open_lct(struct inode *inode, struct file *file)
+{
+	return single_open(file, i2o_seq_show_lct, PDE(inode)->data);
+};
+
+struct file_operations i2o_seq_fops_lct = {
+	.open	= i2o_seq_open_lct,
+	.read	= seq_read,
+	.llseek	= seq_lseek,
+	.release = single_release
+};
+
+static int i2o_seq_open_status(struct inode *inode, struct file *file)
+{
+	return single_open(file, i2o_seq_show_status, PDE(inode)->data);
+};
+
+struct file_operations i2o_seq_fops_status = {
+	.open	= i2o_seq_open_status,
+	.read	= seq_read,
+	.llseek	= seq_lseek,
+	.release = single_release
+};
+
 /*
  * IOP specific entries...write field just in case someone 
  * ever wants one.
  */
 static i2o_proc_entry generic_iop_entries[] = 
 {
-	{"hrt", S_IFREG|S_IRUGO, i2o_proc_read_hrt, NULL},
-	{"lct", S_IFREG|S_IRUGO, i2o_proc_read_lct, NULL},
-	{"status", S_IFREG|S_IRUGO, i2o_proc_read_status, NULL},
-	{"hw", S_IFREG|S_IRUGO, i2o_proc_read_hw, NULL},
-	{"ddm_table", S_IFREG|S_IRUGO, i2o_proc_read_ddm_table, NULL},
-	{"driver_store", S_IFREG|S_IRUGO, i2o_proc_read_driver_store, NULL},
-	{"drivers_stored", S_IFREG|S_IRUGO, i2o_proc_read_drivers_stored, NULL},
-	{NULL, 0, NULL, NULL}
+	{"hrt", S_IFREG|S_IRUGO, NULL, NULL, &i2o_seq_fops_hrt},
+	{"lct", S_IFREG|S_IRUGO, NULL, NULL, &i2o_seq_fops_lct},
+	{"status", S_IFREG|S_IRUGO, NULL, NULL, &i2o_seq_fops_status},
+	{"hw", S_IFREG|S_IRUGO, i2o_proc_read_hw, NULL, NULL},
+	{"ddm_table", S_IFREG|S_IRUGO, i2o_proc_read_ddm_table, NULL, NULL},
+	{"driver_store", S_IFREG|S_IRUGO, i2o_proc_read_driver_store, NULL, NULL},
+	{"drivers_stored", S_IFREG|S_IRUGO, i2o_proc_read_drivers_stored, NULL, NULL},
+	{NULL, 0, NULL, NULL, NULL}
 };
 
 /*
@@ -172,18 +210,18 @@ static i2o_proc_entry generic_iop_entries[] =
  */
 static i2o_proc_entry generic_dev_entries[] = 
 {
-	{"groups", S_IFREG|S_IRUGO, i2o_proc_read_groups, NULL},
-	{"phys_dev", S_IFREG|S_IRUGO, i2o_proc_read_phys_device, NULL},
-	{"claimed", S_IFREG|S_IRUGO, i2o_proc_read_claimed, NULL},
-	{"users", S_IFREG|S_IRUGO, i2o_proc_read_users, NULL},
-	{"priv_msgs", S_IFREG|S_IRUGO, i2o_proc_read_priv_msgs, NULL},
-	{"authorized_users", S_IFREG|S_IRUGO, i2o_proc_read_authorized_users, NULL},
-	{"dev_identity", S_IFREG|S_IRUGO, i2o_proc_read_dev_identity, NULL},
-	{"ddm_identity", S_IFREG|S_IRUGO, i2o_proc_read_ddm_identity, NULL},
-	{"user_info", S_IFREG|S_IRUGO, i2o_proc_read_uinfo, NULL},
-	{"sgl_limits", S_IFREG|S_IRUGO, i2o_proc_read_sgl_limits, NULL},
-	{"sensors", S_IFREG|S_IRUGO, i2o_proc_read_sensors, NULL},
-	{NULL, 0, NULL, NULL}
+	{"groups", S_IFREG|S_IRUGO, i2o_proc_read_groups, NULL, NULL},
+	{"phys_dev", S_IFREG|S_IRUGO, i2o_proc_read_phys_device, NULL, NULL},
+	{"claimed", S_IFREG|S_IRUGO, i2o_proc_read_claimed, NULL, NULL},
+	{"users", S_IFREG|S_IRUGO, i2o_proc_read_users, NULL, NULL},
+	{"priv_msgs", S_IFREG|S_IRUGO, i2o_proc_read_priv_msgs, NULL, NULL},
+	{"authorized_users", S_IFREG|S_IRUGO, i2o_proc_read_authorized_users, NULL, NULL},
+	{"dev_identity", S_IFREG|S_IRUGO, i2o_proc_read_dev_identity, NULL, NULL},
+	{"ddm_identity", S_IFREG|S_IRUGO, i2o_proc_read_ddm_identity, NULL, NULL},
+	{"user_info", S_IFREG|S_IRUGO, i2o_proc_read_uinfo, NULL, NULL},
+	{"sgl_limits", S_IFREG|S_IRUGO, i2o_proc_read_sgl_limits, NULL, NULL},
+	{"sensors", S_IFREG|S_IRUGO, i2o_proc_read_sensors, NULL, NULL},
+	{NULL, 0, NULL, NULL, NULL}
 };
 
 /*
@@ -191,7 +229,7 @@ static i2o_proc_entry generic_dev_entries[] =
  */
 static i2o_proc_entry rbs_dev_entries[] = 
 {
-	{"dev_name", S_IFREG|S_IRUGO, i2o_proc_read_dev_name, NULL},
+	{"dev_name", S_IFREG|S_IRUGO, i2o_proc_read_dev_name, NULL, NULL},
 	{NULL, 0, NULL, NULL}
 };
 
@@ -223,21 +261,21 @@ static char *scsi_devices[] =
  */
 static i2o_proc_entry lan_entries[] = 
 {
-	{"lan_dev_info", S_IFREG|S_IRUGO, i2o_proc_read_lan_dev_info, NULL},
-	{"lan_mac_addr", S_IFREG|S_IRUGO, i2o_proc_read_lan_mac_addr, NULL},
+	{"lan_dev_info", S_IFREG|S_IRUGO, i2o_proc_read_lan_dev_info, NULL, NULL},
+	{"lan_mac_addr", S_IFREG|S_IRUGO, i2o_proc_read_lan_mac_addr, NULL, NULL},
 	{"lan_mcast_addr", S_IFREG|S_IRUGO|S_IWUSR,
-	 i2o_proc_read_lan_mcast_addr, NULL},
+	 i2o_proc_read_lan_mcast_addr, NULL, NULL},
 	{"lan_batch_ctrl", S_IFREG|S_IRUGO|S_IWUSR,
-	 i2o_proc_read_lan_batch_control, NULL},
-	{"lan_operation", S_IFREG|S_IRUGO, i2o_proc_read_lan_operation, NULL},
+	 i2o_proc_read_lan_batch_control, NULL, NULL},
+	{"lan_operation", S_IFREG|S_IRUGO, i2o_proc_read_lan_operation, NULL, NULL},
 	{"lan_media_operation", S_IFREG|S_IRUGO,
-	 i2o_proc_read_lan_media_operation, NULL},
-	{"lan_alt_addr", S_IFREG|S_IRUGO, i2o_proc_read_lan_alt_addr, NULL},
-	{"lan_tx_info", S_IFREG|S_IRUGO, i2o_proc_read_lan_tx_info, NULL},
-	{"lan_rx_info", S_IFREG|S_IRUGO, i2o_proc_read_lan_rx_info, NULL},
+	 i2o_proc_read_lan_media_operation, NULL, NULL},
+	{"lan_alt_addr", S_IFREG|S_IRUGO, i2o_proc_read_lan_alt_addr, NULL, NULL},
+	{"lan_tx_info", S_IFREG|S_IRUGO, i2o_proc_read_lan_tx_info, NULL, NULL},
+	{"lan_rx_info", S_IFREG|S_IRUGO, i2o_proc_read_lan_rx_info, NULL, NULL},
 
-	{"lan_hist_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_hist_stats, NULL},
-	{NULL, 0, NULL, NULL}
+	{"lan_hist_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_hist_stats, NULL, NULL},
+	{NULL, 0, NULL, NULL, NULL}
 };
 
 /*
@@ -246,20 +284,20 @@ static i2o_proc_entry lan_entries[] =
  */
 static i2o_proc_entry lan_eth_entries[] = 
 {
-	{"lan_eth_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_eth_stats, NULL},
-	{NULL, 0, NULL, NULL}
+	{"lan_eth_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_eth_stats, NULL, NULL},
+	{NULL, 0, NULL, NULL, NULL}
 };
 
 static i2o_proc_entry lan_tr_entries[] = 
 {
-	{"lan_tr_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_tr_stats, NULL},
-	{NULL, 0, NULL, NULL}
+	{"lan_tr_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_tr_stats, NULL, NULL},
+	{NULL, 0, NULL, NULL, NULL}
 };
 
 static i2o_proc_entry lan_fddi_entries[] = 
 {
-	{"lan_fddi_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_fddi_stats, NULL},
-	{NULL, 0, NULL, NULL}
+	{"lan_fddi_stats", S_IFREG|S_IRUGO, i2o_proc_read_lan_fddi_stats, NULL, NULL},
+	{NULL, 0, NULL, NULL, NULL}
 };
 
 
@@ -300,116 +338,98 @@ static char* bus_strings[] =
 
 static spinlock_t i2o_proc_lock = SPIN_LOCK_UNLOCKED;
 
-int i2o_proc_read_hrt(char *buf, char **start, off_t offset, int count, 
-		      int *eof, void *data)
+int i2o_seq_show_hrt(struct seq_file *seq, void *v)
 {
-	struct i2o_controller *c = (struct i2o_controller *)data;
+	struct i2o_controller *c = (struct i2o_controller *)seq->private;
 	i2o_hrt *hrt = (i2o_hrt *)c->hrt;
 	u32 bus;
-	int len, i;
-
-	spin_lock(&i2o_proc_lock);
-
-	len = 0;
+	int i;
 
 	if(hrt->hrt_version)
 	{
-		len += sprintf(buf+len, 
-			       "HRT table for controller is too new a version.\n");
-		spin_unlock(&i2o_proc_lock);
-		return len;
+		seq_printf(seq, "HRT table for controller is too new a version.\n");
+		return 0;
 	}
 
-	if((hrt->num_entries * hrt->entry_len + 8) > 2048) {
-		printk(KERN_WARNING "i2o_proc: HRT does not fit into buffer\n");
-		len += sprintf(buf+len,
-			       "HRT table too big to fit in buffer.\n");
-		spin_unlock(&i2o_proc_lock);
-		return len;
-	}
-	
-	len += sprintf(buf+len, "HRT has %d entries of %d bytes each.\n",
+	seq_printf(seq, "HRT has %d entries of %d bytes each.\n",
 		       hrt->num_entries, hrt->entry_len << 2);
 
-	for(i = 0; i < hrt->num_entries && len < count; i++)
+	for(i = 0; i < hrt->num_entries; i++)
 	{
-		len += sprintf(buf+len, "Entry %d:\n", i);
-		len += sprintf(buf+len, "   Adapter ID: %0#10x\n", 
+		seq_printf(seq, "Entry %d:\n", i);
+		seq_printf(seq, "   Adapter ID: %0#10x\n",
 					hrt->hrt_entry[i].adapter_id);
-		len += sprintf(buf+len, "   Controlling tid: %0#6x\n",
+		seq_printf(seq, "   Controlling tid: %0#6x\n",
 					hrt->hrt_entry[i].parent_tid);
 
 		if(hrt->hrt_entry[i].bus_type != 0x80)
 		{
 			bus = hrt->hrt_entry[i].bus_type;
-			len += sprintf(buf+len, "   %s Information\n", bus_strings[bus]);
+			seq_printf(seq, "   %s Information\n", bus_strings[bus]);
 
 			switch(bus)
 			{
 				case I2O_BUS_LOCAL:
-					len += sprintf(buf+len, "     IOBase: %0#6x,",
+					seq_printf(seq, "     IOBase: %0#6x,",
 								hrt->hrt_entry[i].bus.local_bus.LbBaseIOPort);
-					len += sprintf(buf+len, " MemoryBase: %0#10x\n",
+					seq_printf(seq, " MemoryBase: %0#10x\n",
 								hrt->hrt_entry[i].bus.local_bus.LbBaseMemoryAddress);
 					break;
 
 				case I2O_BUS_ISA:
-					len += sprintf(buf+len, "     IOBase: %0#6x,",
+					seq_printf(seq, "     IOBase: %0#6x,",
 								hrt->hrt_entry[i].bus.isa_bus.IsaBaseIOPort);
-					len += sprintf(buf+len, " MemoryBase: %0#10x,",
+					seq_printf(seq, " MemoryBase: %0#10x,",
 								hrt->hrt_entry[i].bus.isa_bus.IsaBaseMemoryAddress);
-					len += sprintf(buf+len, " CSN: %0#4x,",
+					seq_printf(seq, " CSN: %0#4x,",
 								hrt->hrt_entry[i].bus.isa_bus.CSN);
 					break;
 
 				case I2O_BUS_EISA:
-					len += sprintf(buf+len, "     IOBase: %0#6x,",
+					seq_printf(seq, "     IOBase: %0#6x,",
 								hrt->hrt_entry[i].bus.eisa_bus.EisaBaseIOPort);
-					len += sprintf(buf+len, " MemoryBase: %0#10x,",
+					seq_printf(seq, " MemoryBase: %0#10x,",
 								hrt->hrt_entry[i].bus.eisa_bus.EisaBaseMemoryAddress);
-					len += sprintf(buf+len, " Slot: %0#4x,",
+					seq_printf(seq, " Slot: %0#4x,",
 								hrt->hrt_entry[i].bus.eisa_bus.EisaSlotNumber);
 					break;
 			 
 				case I2O_BUS_MCA:
-					len += sprintf(buf+len, "     IOBase: %0#6x,",
+					seq_printf(seq, "     IOBase: %0#6x,",
 								hrt->hrt_entry[i].bus.mca_bus.McaBaseIOPort);
-					len += sprintf(buf+len, " MemoryBase: %0#10x,",
+					seq_printf(seq, " MemoryBase: %0#10x,",
 								hrt->hrt_entry[i].bus.mca_bus.McaBaseMemoryAddress);
-					len += sprintf(buf+len, " Slot: %0#4x,",
+					seq_printf(seq, " Slot: %0#4x,",
 								hrt->hrt_entry[i].bus.mca_bus.McaSlotNumber);
 					break;
 
 				case I2O_BUS_PCI:
-					len += sprintf(buf+len, "     Bus: %0#4x",
+					seq_printf(seq, "     Bus: %0#4x",
 								hrt->hrt_entry[i].bus.pci_bus.PciBusNumber);
-					len += sprintf(buf+len, " Dev: %0#4x",
+					seq_printf(seq, " Dev: %0#4x",
 								hrt->hrt_entry[i].bus.pci_bus.PciDeviceNumber);
-					len += sprintf(buf+len, " Func: %0#4x",
+					seq_printf(seq, " Func: %0#4x",
 								hrt->hrt_entry[i].bus.pci_bus.PciFunctionNumber);
-					len += sprintf(buf+len, " Vendor: %0#6x",
+					seq_printf(seq, " Vendor: %0#6x",
 								hrt->hrt_entry[i].bus.pci_bus.PciVendorID);
-					len += sprintf(buf+len, " Device: %0#6x\n",
+					seq_printf(seq, " Device: %0#6x\n",
 								hrt->hrt_entry[i].bus.pci_bus.PciDeviceID);
 					break;
 
 				default:
-					len += sprintf(buf+len, "      Unsupported Bus Type\n");
+					seq_printf(seq, "      Unsupported Bus Type\n");
 			}
 		}
 		else
-			len += sprintf(buf+len, "   Unknown Bus Type\n");
+			seq_printf(seq, "   Unknown Bus Type\n");
 	}
-
-	spin_unlock(&i2o_proc_lock);
 	
-	return len;
+	return 0;
 }
 
-int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len,
-	int *eof, void *data)
+int i2o_seq_show_lct(struct seq_file *seq, void *v)
 {
-	struct i2o_controller *c = (struct i2o_controller*)data;
+	struct i2o_controller *c = (struct i2o_controller*)seq->private;
 	i2o_lct *lct = (i2o_lct *)c->lct;
 	int entries;
 	int i;
@@ -422,23 +442,19 @@ int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len,
 		"Fibre Channel Bus"
 	};
 
-	spin_lock(&i2o_proc_lock);
-	len = 0;
-
 	entries = (lct->table_size - 3)/9;
 
-	len += sprintf(buf, "LCT contains %d %s\n", entries,
+	seq_printf(seq, "LCT contains %d %s\n", entries,
 						entries == 1 ? "entry" : "entries");
 	if(lct->boot_tid)	
-		len += sprintf(buf+len, "Boot Device @ ID %d\n", lct->boot_tid);
+		seq_printf(seq, "Boot Device @ ID %d\n", lct->boot_tid);
 
-	len += 
-		sprintf(buf+len, "Current Change Indicator: %#10x\n", lct->change_ind);
+	seq_printf(seq, "Current Change Indicator: %#10x\n", lct->change_ind);
 
 	for(i = 0; i < entries; i++)
 	{
-		len += sprintf(buf+len, "Entry %d\n", i);
-		len += sprintf(buf+len, "  Class, SubClass  : %s", i2o_get_class_name(lct->lct_entry[i].class_id));
+		seq_printf(seq, "Entry %d\n", i);
+		seq_printf(seq, "  Class, SubClass  : %s", i2o_get_class_name(lct->lct_entry[i].class_id));
 	
 		/*
 		 *	Classes which we'll print subclass info for
@@ -449,23 +465,23 @@ int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len,
 				switch(lct->lct_entry[i].sub_class)
 				{
 					case 0x00:
-						len += sprintf(buf+len, ", Direct-Access Read/Write");
+						seq_printf(seq, ", Direct-Access Read/Write");
 						break;
 
 					case 0x04:
-						len += sprintf(buf+len, ", WORM Drive");
+						seq_printf(seq, ", WORM Drive");
 						break;
 	
 					case 0x05:
-						len += sprintf(buf+len, ", CD-ROM Drive");
+						seq_printf(seq, ", CD-ROM Drive");
 						break;
 
 					case 0x07:
-						len += sprintf(buf+len, ", Optical Memory Device");
+						seq_printf(seq, ", Optical Memory Device");
 						break;
 
 					default:
-						len += sprintf(buf+len, ", Unknown (0x%02x)",
+						seq_printf(seq, ", Unknown (0x%02x)",
 							       lct->lct_entry[i].sub_class);
 						break;
 				}
@@ -475,27 +491,27 @@ int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len,
 				switch(lct->lct_entry[i].sub_class & 0xFF)
 				{
 					case 0x30:
-						len += sprintf(buf+len, ", Ethernet");
+						seq_printf(seq, ", Ethernet");
 						break;
 
 					case 0x40:
-						len += sprintf(buf+len, ", 100base VG");
+						seq_printf(seq, ", 100base VG");
 						break;
 
 					case 0x50:
-						len += sprintf(buf+len, ", IEEE 802.5/Token-Ring");
+						seq_printf(seq, ", IEEE 802.5/Token-Ring");
 						break;
 
 					case 0x60:
-						len += sprintf(buf+len, ", ANSI X3T9.5 FDDI");
+						seq_printf(seq, ", ANSI X3T9.5 FDDI");
 						break;
 		
 					case 0x70:
-						len += sprintf(buf+len, ", Fibre Channel");
+						seq_printf(seq, ", Fibre Channel");
 						break;
 
 					default:
-						len += sprintf(buf+len, ", Unknown Sub-Class (0x%02x)",
+						seq_printf(seq, ", Unknown Sub-Class (0x%02x)",
 							       lct->lct_entry[i].sub_class & 0xFF);
 						break;
 				}
@@ -503,27 +519,27 @@ int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len,
 
 			case I2O_CLASS_SCSI_PERIPHERAL:
 				if(lct->lct_entry[i].sub_class < SCSI_TABLE_SIZE)
-					len += sprintf(buf+len, ", %s", 
+					seq_printf(seq, ", %s",
 								scsi_devices[lct->lct_entry[i].sub_class]);
 				else
-					len += sprintf(buf+len, ", Unknown Device Type");
+					seq_printf(seq, ", Unknown Device Type");
 				break;
 
 			case I2O_CLASS_BUS_ADAPTER_PORT:
 				if(lct->lct_entry[i].sub_class < BUS_TABLE_SIZE)
-					len += sprintf(buf+len, ", %s", 
+					seq_printf(seq, ", %s",
 								bus_ports[lct->lct_entry[i].sub_class]);
 				else
-					len += sprintf(buf+len, ", Unknown Bus Type");
+					seq_printf(seq, ", Unknown Bus Type");
 				break;
 		}
-		len += sprintf(buf+len, "\n");
+		seq_printf(seq, "\n");
 		
-		len += sprintf(buf+len, "  Local TID        : 0x%03x\n", lct->lct_entry[i].tid);
-		len += sprintf(buf+len, "  User TID         : 0x%03x\n", lct->lct_entry[i].user_tid);
-		len += sprintf(buf+len, "  Parent TID       : 0x%03x\n", 
+		seq_printf(seq, "  Local TID        : 0x%03x\n", lct->lct_entry[i].tid);
+		seq_printf(seq, "  User TID         : 0x%03x\n", lct->lct_entry[i].user_tid);
+		seq_printf(seq, "  Parent TID       : 0x%03x\n",
 					lct->lct_entry[i].parent_tid);
-		len += sprintf(buf+len, "  Identity Tag     : 0x%x%x%x%x%x%x%x%x\n",
+		seq_printf(seq, "  Identity Tag     : 0x%x%x%x%x%x%x%x%x\n",
 					lct->lct_entry[i].identity_tag[0],
 					lct->lct_entry[i].identity_tag[1],
 					lct->lct_entry[i].identity_tag[2],
@@ -532,214 +548,207 @@ int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len,
 					lct->lct_entry[i].identity_tag[5],
 					lct->lct_entry[i].identity_tag[6],
 					lct->lct_entry[i].identity_tag[7]);
-		len += sprintf(buf+len, "  Change Indicator : %0#10x\n", 
+		seq_printf(seq, "  Change Indicator : %0#10x\n",
 				lct->lct_entry[i].change_ind);
-		len += sprintf(buf+len, "  Event Capab Mask : %0#10x\n", 
+		seq_printf(seq, "  Event Capab Mask : %0#10x\n",
 				lct->lct_entry[i].device_flags);
 	}
 
-	spin_unlock(&i2o_proc_lock);
-	return len;
+	return 0;
 }
 
-int i2o_proc_read_status(char *buf, char **start, off_t offset, int len, 
-			 int *eof, void *data)
+int i2o_seq_show_status(struct seq_file *seq, void *v)
 {
-	struct i2o_controller *c = (struct i2o_controller*)data;
+	struct i2o_controller *c = (struct i2o_controller*)seq->private;
 	char prodstr[25];
 	int version;
 	
-	spin_lock(&i2o_proc_lock);
-	len = 0;
-
 	i2o_status_get(c); // reread the status block
 
-	len += sprintf(buf+len,"Organization ID        : %0#6x\n", 
+	seq_printf(seq, "Organization ID        : %0#6x\n",
 				c->status_block->org_id);
 
 	version = c->status_block->i2o_version;
 	
 /* FIXME for Spec 2.0
 	if (version == 0x02) {
-		len += sprintf(buf+len,"Lowest I2O version supported: ");
+		seq_printf(seq, "Lowest I2O version supported: ");
 		switch(workspace[2]) {
 			case 0x00:
-				len += sprintf(buf+len,"1.0\n");
+				seq_printf(seq, "1.0\n");
 				break;
 			case 0x01:
-				len += sprintf(buf+len,"1.5\n");
+				seq_printf(seq, "1.5\n");
 				break;
 			case 0x02:
-				len += sprintf(buf+len,"2.0\n");
+				seq_printf(seq, "2.0\n");
 				break;
 		}
 
-		len += sprintf(buf+len, "Highest I2O version supported: ");
+		seq_printf(seq, "Highest I2O version supported: ");
 		switch(workspace[3]) {
 			case 0x00:
-				len += sprintf(buf+len,"1.0\n");
+				seq_printf(seq, "1.0\n");
 				break;
 			case 0x01:
-				len += sprintf(buf+len,"1.5\n");
+				seq_printf(seq, "1.5\n");
 				break;
 			case 0x02:
-				len += sprintf(buf+len,"2.0\n");
+				seq_printf(seq, "2.0\n");
 				break;
 		}
 	}
 */
-	len += sprintf(buf+len,"IOP ID                 : %0#5x\n", 
+	seq_printf(seq, "IOP ID                 : %0#5x\n",
 				c->status_block->iop_id);
-	len += sprintf(buf+len,"Host Unit ID           : %0#6x\n",
+	seq_printf(seq, "Host Unit ID           : %0#6x\n",
 				c->status_block->host_unit_id);
-	len += sprintf(buf+len,"Segment Number         : %0#5x\n",
+	seq_printf(seq, "Segment Number         : %0#5x\n",
 				c->status_block->segment_number);
 
-	len += sprintf(buf+len, "I2O version            : ");
+	seq_printf(seq, "I2O version            : ");
 	switch (version) {
 		case 0x00:
-			len += sprintf(buf+len,"1.0\n");
+			seq_printf(seq, "1.0\n");
 			break;
 		case 0x01:
-			len += sprintf(buf+len,"1.5\n");
+			seq_printf(seq, "1.5\n");
 			break;
 		case 0x02:
-			len += sprintf(buf+len,"2.0\n");
+			seq_printf(seq, "2.0\n");
 			break;
 		default:
-			len += sprintf(buf+len,"Unknown version\n");
+			seq_printf(seq, "Unknown version\n");
 	}
 
-	len += sprintf(buf+len, "IOP State              : ");
+	seq_printf(seq, "IOP State              : ");
 	switch (c->status_block->iop_state) {
 		case 0x01:
-			len += sprintf(buf+len,"INIT\n");
+			seq_printf(seq, "INIT\n");
 			break;
 
 		case 0x02:
-			len += sprintf(buf+len,"RESET\n");
+			seq_printf(seq, "RESET\n");
 			break;
 
 		case 0x04:
-			len += sprintf(buf+len,"HOLD\n");
+			seq_printf(seq, "HOLD\n");
 			break;
 
 		case 0x05:
-			len += sprintf(buf+len,"READY\n");
+			seq_printf(seq, "READY\n");
 			break;
 
 		case 0x08:
-			len += sprintf(buf+len,"OPERATIONAL\n");
+			seq_printf(seq, "OPERATIONAL\n");
 			break;
 
 		case 0x10:
-			len += sprintf(buf+len,"FAILED\n");
+			seq_printf(seq, "FAILED\n");
 			break;
 
 		case 0x11:
-			len += sprintf(buf+len,"FAULTED\n");
+			seq_printf(seq, "FAULTED\n");
 			break;
 
 		default:
-			len += sprintf(buf+len,"Unknown\n");
+			seq_printf(seq, "Unknown\n");
 			break;
 	}
 
-	len += sprintf(buf+len,"Messenger Type         : ");
+	seq_printf(seq, "Messenger Type         : ");
 	switch (c->status_block->msg_type) { 
 		case 0x00:
-			len += sprintf(buf+len,"Memory mapped\n");
+			seq_printf(seq, "Memory mapped\n");
 			break;
 		case 0x01:
-			len += sprintf(buf+len,"Memory mapped only\n");
+			seq_printf(seq, "Memory mapped only\n");
 			break;
 		case 0x02:
-			len += sprintf(buf+len,"Remote only\n");
+			seq_printf(seq,"Remote only\n");
 			break;
 		case 0x03:
-			len += sprintf(buf+len,"Memory mapped and remote\n");
+			seq_printf(seq, "Memory mapped and remote\n");
 			break;
 		default:
-			len += sprintf(buf+len,"Unknown\n");
+			seq_printf(seq, "Unknown\n");
 	}
 
-	len += sprintf(buf+len,"Inbound Frame Size     : %d bytes\n", 
+	seq_printf(seq, "Inbound Frame Size     : %d bytes\n",
 				c->status_block->inbound_frame_size<<2);
-	len += sprintf(buf+len,"Max Inbound Frames     : %d\n", 
+	seq_printf(seq, "Max Inbound Frames     : %d\n",
 				c->status_block->max_inbound_frames);
-	len += sprintf(buf+len,"Current Inbound Frames : %d\n", 
+	seq_printf(seq, "Current Inbound Frames : %d\n",
 				c->status_block->cur_inbound_frames);
-	len += sprintf(buf+len,"Max Outbound Frames    : %d\n", 
+	seq_printf(seq, "Max Outbound Frames    : %d\n",
 				c->status_block->max_outbound_frames);
 
 	/* Spec doesn't say if NULL terminated or not... */
 	memcpy(prodstr, c->status_block->product_id, 24);
 	prodstr[24] = '\0';
-	len += sprintf(buf+len,"Product ID             : %s\n", prodstr);
-	len += sprintf(buf+len,"Expected LCT Size      : %d bytes\n", 
+	seq_printf(seq, "Product ID             : %s\n", prodstr);
+	seq_printf(seq, "Expected LCT Size      : %d bytes\n",
 				c->status_block->expected_lct_size);
 
-	len += sprintf(buf+len,"IOP Capabilities\n");
-	len += sprintf(buf+len,"    Context Field Size Support : ");
+	seq_printf(seq, "IOP Capabilities\n");
+	seq_printf(seq, "    Context Field Size Support : ");
 	switch (c->status_block->iop_capabilities & 0x0000003) {
 		case 0:
-			len += sprintf(buf+len,"Supports only 32-bit context fields\n");
+			seq_printf(seq, "Supports only 32-bit context fields\n");
 			break;
 		case 1:
-			len += sprintf(buf+len,"Supports only 64-bit context fields\n");
+			seq_printf(seq, "Supports only 64-bit context fields\n");
 			break;
 		case 2:
-			len += sprintf(buf+len,"Supports 32-bit and 64-bit context fields, "
+			seq_printf(seq, "Supports 32-bit and 64-bit context fields, "
 						"but not concurrently\n");
 			break;
 		case 3:
-			len += sprintf(buf+len,"Supports 32-bit and 64-bit context fields "
+			seq_printf(seq, "Supports 32-bit and 64-bit context fields "
 						"concurrently\n");
 			break;
 		default:
-			len += sprintf(buf+len,"0x%08x\n",c->status_block->iop_capabilities);
+			seq_printf(seq, "0x%08x\n",c->status_block->iop_capabilities);
 	}
-	len += sprintf(buf+len,"    Current Context Field Size : ");
+	seq_printf(seq, "    Current Context Field Size : ");
 	switch (c->status_block->iop_capabilities & 0x0000000C) {
 		case 0:
-			len += sprintf(buf+len,"not configured\n");
+			seq_printf(seq, "not configured\n");
 			break;
 		case 4:
-			len += sprintf(buf+len,"Supports only 32-bit context fields\n");
+			seq_printf(seq, "Supports only 32-bit context fields\n");
 			break;
 		case 8:
-			len += sprintf(buf+len,"Supports only 64-bit context fields\n");
+			seq_printf(seq, "Supports only 64-bit context fields\n");
 			break;
 		case 12:
-			len += sprintf(buf+len,"Supports both 32-bit or 64-bit context fields "
+			seq_printf(seq, "Supports both 32-bit or 64-bit context fields "
 						"concurrently\n");
 			break;
 		default:
-			len += sprintf(buf+len,"\n");
+			seq_printf(seq, "\n");
 	}
-	len += sprintf(buf+len,"    Inbound Peer Support       : %s\n",
+	seq_printf(seq, "    Inbound Peer Support       : %s\n",
 			(c->status_block->iop_capabilities & 0x00000010) ? "Supported" : "Not supported");
-	len += sprintf(buf+len,"    Outbound Peer Support      : %s\n",
+	seq_printf(seq, "    Outbound Peer Support      : %s\n",
 			(c->status_block->iop_capabilities & 0x00000020) ? "Supported" : "Not supported");
-	len += sprintf(buf+len,"    Peer to Peer Support       : %s\n",
+	seq_printf(seq, "    Peer to Peer Support       : %s\n",
 			(c->status_block->iop_capabilities & 0x00000040) ? "Supported" : "Not supported");
 
-	len += sprintf(buf+len, "Desired private memory size   : %d kB\n", 
+	seq_printf(seq, "Desired private memory size   : %d kB\n",
 				c->status_block->desired_mem_size>>10);
-	len += sprintf(buf+len, "Allocated private memory size : %d kB\n", 
+	seq_printf(seq, "Allocated private memory size : %d kB\n",
 				c->status_block->current_mem_size>>10);
-	len += sprintf(buf+len, "Private memory base address   : %0#10x\n", 
+	seq_printf(seq, "Private memory base address   : %0#10x\n",
 				c->status_block->current_mem_base);
-	len += sprintf(buf+len, "Desired private I/O size      : %d kB\n", 
+	seq_printf(seq, "Desired private I/O size      : %d kB\n",
 				c->status_block->desired_io_size>>10);
-	len += sprintf(buf+len, "Allocated private I/O size    : %d kB\n", 
+	seq_printf(seq, "Allocated private I/O size    : %d kB\n",
 				c->status_block->current_io_size>>10);
-	len += sprintf(buf+len, "Private I/O base address      : %0#10x\n", 
+	seq_printf(seq, "Private I/O base address      : %0#10x\n",
 				c->status_block->current_io_base);
 
-	spin_unlock(&i2o_proc_lock);
-
-	return len;
+	return 0;
 }
 
 int i2o_proc_read_hw(char *buf, char **start, off_t offset, int len, 
@@ -3146,6 +3155,9 @@ static int i2o_proc_create_entries(void *data, i2o_proc_entry *pentry,
 		ent->data = data;
 		ent->read_proc = pentry->read_proc;
 		ent->write_proc = pentry->write_proc;
+		if(pentry->fops_proc)
+			ent->proc_fops = pentry->fops_proc;
+
 		ent->nlink = 1;
 
 		pentry++;
@@ -3266,7 +3278,6 @@ static void i2o_proc_remove_controller(struct i2o_controller *pctrl,
 		sprintf(buff, "iop%d", pctrl->unit);
 
 		i2o_proc_remove_entries(generic_iop_entries, pctrl->proc_entry);
-
 		remove_proc_entry(buff, parent);
 		pctrl->proc_entry = NULL;
 	}
@@ -3306,8 +3317,8 @@ void i2o_proc_remove_device(struct i2o_device *dev)
 					break;
 				}
 			}
-			remove_proc_entry(dev_id, dev->controller->proc_entry);
 		}
+		remove_proc_entry(dev_id, dev->controller->proc_entry);
 	}
 }
 	
@@ -3329,6 +3340,7 @@ static int create_i2o_procfs(void)
 	i2o_proc_dir_root = proc_mkdir("i2o", 0);
 	if(!i2o_proc_dir_root)
 		return -1;
+	i2o_proc_dir_root->owner = THIS_MODULE;
 
 	for(i = 0; i < MAX_I2O_CONTROLLERS; i++)
 	{
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index 829178506..a0f99f6e8 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -62,9 +62,6 @@
 #include "../../scsi/scsi.h"
 #include "../../scsi/hosts.h"
 
-#if BITS_PER_LONG == 64
-#error FIXME: driver does not support 64-bit platforms
-#endif
 
 
 #define VERSION_STRING        "Version 0.1.2"
@@ -233,7 +230,10 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
 		{
 			spin_unlock_irqrestore(&retry_lock, flags);
 			/* Create a scsi error for this */
-			current_command = (Scsi_Cmnd *)m[3];
+			current_command = (Scsi_Cmnd *)i2o_context_list_get(m[3], c);
+			if(!current_command)
+				return;
+
 			lock = current_command->device->host->host_lock;
 			printk("Aborted %ld\n", current_command->serial_number);
 
@@ -276,16 +276,15 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
 		printk(KERN_INFO "i2o_scsi: bus reset completed.\n");
 		return;
 	}
-	/*
- 	 *	FIXME: 64bit breakage
-	 */
 
-	current_command = (Scsi_Cmnd *)m[3];
+	current_command = (Scsi_Cmnd *)i2o_context_list_get(m[3], c);
 	
 	/*
 	 *	Is this a control request coming back - eg an abort ?
 	 */
 	 
+	atomic_dec(&queue_depth);
+
 	if(current_command==NULL)
 	{
 		if(st)
@@ -296,8 +295,6 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
 	
 	dprintk(KERN_INFO "Completed %ld\n", current_command->serial_number);
 	
-	atomic_dec(&queue_depth);
-	
 	if(st == 0x06)
 	{
 		if(le32_to_cpu(m[5]) < current_command->underflow)
@@ -647,9 +644,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 	if(tid == -1)
 	{
 		SCpnt->result = DID_NO_CONNECT << 16;
-		spin_lock_irqsave(host->host_lock, flags);
 		done(SCpnt);
-		spin_unlock_irqrestore(host->host_lock, flags);
 		return 0;
 	}
 	
@@ -699,8 +694,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 	
 	i2o_raw_writel(I2O_CMD_SCSI_EXEC<<24|HOST_TID<<12|tid, &msg[1]);
 	i2o_raw_writel(scsi_context, &msg[2]);	/* So the I2O layer passes to us */
-	/* Sorry 64bit folks. FIXME */
-	i2o_raw_writel((u32)SCpnt, &msg[3]);	/* We want the SCSI control block back */
+	i2o_raw_writel(i2o_context_list_add(SCpnt, c), &msg[3]);	/* We want the SCSI control block back */
 
 	/* LSI_920_PCI_QUIRK
 	 *
@@ -883,7 +877,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
  *	@SCpnt: command to abort
  *
  *	Ask the I2O controller to abort a command. This is an asynchrnous
- *	process and oru callback handler will see the command complete
+ *	process and our callback handler will see the command complete
  *	with an aborted message if it succeeds. 
  *
  *	Locks: no locks are held or needed
@@ -894,10 +888,9 @@ int i2o_scsi_abort(Scsi_Cmnd * SCpnt)
 	struct i2o_controller *c;
 	struct Scsi_Host *host;
 	struct i2o_scsi_host *hostdata;
-	unsigned long msg;
-	u32 m;
+	u32 msg[5];
 	int tid;
-	unsigned long timeout;
+	int status = FAILED;
 	
 	printk(KERN_WARNING "i2o_scsi: Aborting command block.\n");
 	
@@ -907,37 +900,22 @@ int i2o_scsi_abort(Scsi_Cmnd * SCpnt)
 	if(tid==-1)
 	{
 		printk(KERN_ERR "i2o_scsi: Impossible command to abort!\n");
-		return FAILED;
+		return status;
 	}
 	c = hostdata->controller;
 
 	spin_unlock_irq(host->host_lock);
 		
-	timeout = jiffies+2*HZ;
-	do
-	{
-		m = le32_to_cpu(I2O_POST_READ32(c));
-		if(m != 0xFFFFFFFF)
-			break;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
-		mb();
-	}
-	while(time_before(jiffies, timeout));
-	
-	msg = c->mem_offset + m;
-	
-	i2o_raw_writel(FIVE_WORD_MSG_SIZE, msg);
-	i2o_raw_writel(I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|tid, msg+4);
-	i2o_raw_writel(scsi_context, msg+8);
-	i2o_raw_writel(0, msg+12);	/* Not needed for an abort */
-	i2o_raw_writel((u32)SCpnt, msg+16);	
-	wmb();
-	i2o_post_message(c,m);
-	wmb();
-	
+	msg[0] = FIVE_WORD_MSG_SIZE;
+	msg[1] = I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|tid;
+	msg[2] = scsi_context;
+	msg[3] = 0;
+	msg[4] = i2o_context_list_remove(SCpnt, c);
+	if(i2o_post_wait(c, msg, sizeof(msg), 240))
+		status = SUCCESS;
+
 	spin_lock_irq(host->host_lock);
-	return SUCCESS;
+	return status;
 }
 
 /**
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 9fb3e6524..fdd0be1a8 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -6,7 +6,7 @@ menu "Misc devices"
 
 config IBM_ASM
 	tristate "Device driver for IBM RSA service processor"
-	depends on X86
+	depends on X86 && EXPERIMENTAL
 	default n
 	---help---
 	  This option enables device driver support for in-band access to the
@@ -20,6 +20,12 @@ config IBM_ASM
 	  this feature serial driver support (CONFIG_SERIAL_8250) must be
 	  enabled.
 	  
+	  WARNING: This software may not be supported or function
+	  correctly on your IBM server. Please consult the IBM ServerProven
+	  website http://www.pc.ibm/ww/eserver/xseries/serverproven for
+	  information on the specific driver level and support statement
+	  for your IBM server.
+
 
 	  If unsure, say N.
 
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index 190349fbb..ee29ced87 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -126,6 +126,13 @@ static int __init ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_
 
 	ibmasm_register_uart(sp);
 
+	dev_printk(KERN_DEBUG, &pdev->dev, "WARNING: This software may not be supported or function\n");
+	dev_printk(KERN_DEBUG, &pdev->dev, "correctly on your IBM server. Please consult the IBM\n");
+	dev_printk(KERN_DEBUG, &pdev->dev, "ServerProven website\n");
+	dev_printk(KERN_DEBUG, &pdev->dev, "http://www.pc.ibm.com/ww/eserver/xseries/serverproven\n");
+	dev_printk(KERN_DEBUG, &pdev->dev, "for information on the specific driver level and support\n");
+	dev_printk(KERN_DEBUG, &pdev->dev, "statement for your IBM server.\n");
+
 	return 0;
 
 error_send_message:
diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c
index 6021b8b3c..6606b9373 100644
--- a/drivers/mtd/chips/amd_flash.c
+++ b/drivers/mtd/chips/amd_flash.c
@@ -780,8 +780,8 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
 	map->fldrv_priv = private;
 
 	map->fldrv = &amd_flash_chipdrv;
-	MOD_INC_USE_COUNT;
 
+	__module_get(THIS_MODULE);
 	return mtd;
 }
 
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 2b220085e..18cc31d39 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -431,6 +431,7 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
 		break;
 
 	case FL_READY:
+	case FL_STATUS:
 		/* We should really make set_vpp() count, rather than doing this */
 		DISABLE_VPP(map);
 		break;
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 7e471fe1d..159ccc0b6 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -16,7 +16,6 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
-#include <linux/init.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
@@ -109,6 +108,9 @@
 #define M29W160DT	0x22C4
 #define M29W160DB	0x2249
 #define M29W040B	0x00E3
+#define M50FW040	0x002C
+#define M50FW080	0x002D
+#define M50FW016	0x002E
 
 /* SST */
 #define SST29EE512	0x005d
@@ -1234,6 +1236,45 @@ static const struct amd_flash_info jedec_table[] = {
 		.regions	= {
 			ERASEINFO(0x10000,8),
 		}
+        }, {
+		.mfr_id		= MANUFACTURER_ST,
+		.dev_id		= M50FW040,
+		.name		= "ST M50FW040",
+		.uaddr		= {
+			[0] = MTD_UADDR_UNNECESSARY,    /* x8 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_INTEL_EXT,
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x10000,8),
+		}
+        }, {
+		.mfr_id		= MANUFACTURER_ST,
+		.dev_id		= M50FW080,
+		.name		= "ST M50FW080",
+		.uaddr		= {
+			[0] = MTD_UADDR_UNNECESSARY,    /* x8 */
+		},
+		.DevSize	= SIZE_1MiB,
+		.CmdSet		= P_ID_INTEL_EXT,
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x10000,16),
+		}
+        }, {
+		.mfr_id		= MANUFACTURER_ST,
+		.dev_id		= M50FW016,
+		.name		= "ST M50FW016",
+		.uaddr		= {
+			[0] = MTD_UADDR_UNNECESSARY,    /* x8 */
+		},
+		.DevSize	= SIZE_2MiB,
+		.CmdSet		= P_ID_INTEL_EXT,
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x10000,32),
+		}
 	}, {
 		.mfr_id		= MANUFACTURER_TOSHIBA,
 		.dev_id		= TC58FVT160,
diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c
index 0a5d4f138..bd0ed8905 100644
--- a/drivers/mtd/chips/sharp.c
+++ b/drivers/mtd/chips/sharp.c
@@ -30,6 +30,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/cfi.h>
 #include <linux/delay.h>
+#include <linux/init.h>
 
 #define CMD_RESET		0xffffffff
 #define CMD_READ_ID		0x90909090
@@ -154,7 +155,7 @@ struct mtd_info *sharp_probe(struct map_info *map)
 	map->fldrv = &sharp_chipdrv;
 	map->fldrv_priv = sharp;
 
-	MOD_INC_USE_COUNT;
+	__module_get(THIS_MODULE);
 	return mtd;
 }
 
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 7b6da6af7..03d39d703 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -404,6 +404,15 @@ config MTD_IQ80310
 	  IQ80310 evaluation board. If you have one of these boards and would 
 	  like to use the flash chips on it, say 'Y'.
 
+config MTD_IXP4XX
+	tristate "CFI Flash device mapped on Intel IXP4xx based systems"
+	depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
+	help
+	  This eables MTD access to flash devices on platforms based 
+	  on Intel's IXP4xx family of network processors such as the
+	  IXDP425 and Coyote. If you have an IXP4xx based board and
+	  would like to use the flash chips on it, say 'Y'.
+
 config MTD_EPXA10DB
 	tristate "CFI Flash device mapped on Epxa10db"
 	depends on ARM && MTD_CFI && MTD_PARTITIONS && ARCH_CAMELOT
@@ -480,5 +489,13 @@ config MTD_UCLINUX
 	help
 	  Map driver to support image based filesystems for uClinux.
 
+config MTD_WRSBC8260
+	tristate "Map driver for WindRiver PowerQUICC II MPC82xx board"
+	depends on MTD_PARTITIONS && SBC82xx
+	help
+	  Map driver for WindRiver PowerQUICC II MPC82xx board. Drives
+	  all three flash regions on CS0, CS1 and CS6 if they are configured
+	  correctly by the boot loader.
+
 endmenu
 
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 6c82870b3..929d66861 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -55,3 +55,5 @@ obj-$(CONFIG_MTD_EBONY)		+= ebony.o
 obj-$(CONFIG_MTD_BEECH)		+= beech-mtd.o
 obj-$(CONFIG_MTD_ARCTIC)	+= arctic-mtd.o
 obj-$(CONFIG_MTD_H720X)		+= h720x-flash.o
+obj-$(CONFIG_MTD_IXP4XX)	+= ixp4xx.o
+obj-$(CONFIG_MTD_WRSBC8260)	+= wr_sbc82xx_flash.o
diff --git a/drivers/mtd/maps/lubbock-flash.c b/drivers/mtd/maps/lubbock-flash.c
index c7e25466c..5f7bdd883 100644
--- a/drivers/mtd/maps/lubbock-flash.c
+++ b/drivers/mtd/maps/lubbock-flash.c
@@ -15,11 +15,12 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <asm/io.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
+#include <asm/io.h>
 #include <asm/hardware.h>
+#include <asm/arch/lubbock.h>
 
 
 #define ROM_ADDR	0x00000000
diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c
index 5607a2954..8ba73f107 100644
--- a/drivers/mtd/maps/tqm8xxl.c
+++ b/drivers/mtd/maps/tqm8xxl.c
@@ -105,7 +105,7 @@ static struct mtd_partition tqm8xxl_fs_partitions[] = {
 	  .name = "jffs",
 	  .offset = 0x00200000,
 	  .size = 0x00200000,
-	  .//size = MTDPART_SIZ_FULL,
+	  //.size = MTDPART_SIZ_FULL,
 	}
 };
 #endif
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index f72239066..44d13f561 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/major.h>
+#include <linux/root_dev.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 707da8106..ab7ee8837 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -1315,7 +1315,7 @@ el3_netdev_set_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
  */
 
 static int
-netdev_ethtool_ioctl (struct net_device *dev, void *useraddr)
+netdev_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
 {
 	u32 ethcmd;
 	struct el3_private *lp = netdev_priv(dev);
@@ -1323,7 +1323,7 @@ netdev_ethtool_ioctl (struct net_device *dev, void *useraddr)
 	/* dev_ioctl() in ../../net/core/dev.c has already checked
 	   capable(CAP_NET_ADMIN), so don't bother with that here.  */
 
-	if (get_user(ethcmd, (u32 *)useraddr))
+	if (get_user(ethcmd, (u32 __user *)useraddr))
 		return -EFAULT;
 
 	switch (ethcmd) {
@@ -1412,7 +1412,7 @@ netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 
 	switch (cmd) {
 	case SIOCETHTOOL:
-		rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
 		break;
 
 	default:
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index df3240c3c..a3b67aef2 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -287,6 +287,7 @@ struct net_device *__init mc32_probe(int unit)
 			
 		}
 	}
+	free_netdev(dev);
 	return ERR_PTR(-ENODEV);
 }
 
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 761a3ea33..a450864a9 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -2873,7 +2873,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct vortex_private *vp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	int phy = vp->phys[0] & 0x1f;
 	int retval;
 
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index da9836612..62dd13951 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1546,7 +1546,6 @@ static struct ethtool_ops cp_ethtool_ops = {
 static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct cp_private *cp = netdev_priv(dev);
-	struct mii_ioctl_data *mii = (struct mii_ioctl_data *) &rq->ifr_data;
 	int rc;
 	unsigned long flags;
 
@@ -1554,7 +1553,7 @@ static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 		return -EINVAL;
 
 	spin_lock_irqsave(&cp->lock, flags);
-	rc = generic_mii_ioctl(&cp->mii_if, mii, cmd, NULL);
+	rc = generic_mii_ioctl(&cp->mii_if, if_mii(rq), cmd, NULL);
 	spin_unlock_irqrestore(&cp->lock, flags);
 	return rc;
 }
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 426273c0c..83a1bd11b 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -171,7 +171,11 @@ static int debug = -1;
  * Receive ring size 
  * Warning: 64K ring has hardware issues and may lock up.
  */
+#if defined(CONFIG_SH_DREAMCAST)
+#define RX_BUF_IDX	1	/* 16K ring */
+#else
 #define RX_BUF_IDX	2	/* 32K ring */
+#endif
 #define RX_BUF_LEN	(8192 << RX_BUF_IDX)
 #define RX_BUF_PAD	16
 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */
@@ -1677,11 +1681,17 @@ static void rtl8139_tx_timeout (struct net_device *dev)
 	u8 tmp8;
 	unsigned long flags;
 
-	DPRINTK ("%s: Transmit timeout, status %2.2x %4.4x "
-		 "media %2.2x.\n", dev->name,
-		 RTL_R8 (ChipCmd),
-		 RTL_R16 (IntrStatus),
-		 RTL_R8 (MediaStatus));
+	printk (KERN_DEBUG "%s: Transmit timeout, status %2.2x %4.4x %4.4x "
+		"media %2.2x.\n", dev->name, RTL_R8 (ChipCmd),
+		RTL_R16(IntrStatus), RTL_R16(IntrMask), RTL_R8(MediaStatus));
+	/* Emit info to figure out what went wrong. */
+	printk (KERN_DEBUG "%s: Tx queue start entry %ld  dirty entry %ld.\n",
+		dev->name, tp->cur_tx, tp->dirty_tx);
+	for (i = 0; i < NUM_TX_DESC; i++)
+		printk (KERN_DEBUG "%s:  Tx descriptor %d is %8.8lx.%s\n",
+			dev->name, i, RTL_R32 (TxStatus0 + (i * 4)),
+			i == tp->dirty_tx % NUM_TX_DESC ?
+				" (queue head)" : "");
 
 	tp->xstats.tx_timeouts++;
 
@@ -1694,15 +1704,6 @@ static void rtl8139_tx_timeout (struct net_device *dev)
 	/* Disable interrupts by clearing the interrupt mask. */
 	RTL_W16 (IntrMask, 0x0000);
 
-	/* Emit info to figure out what went wrong. */
-	printk (KERN_DEBUG "%s: Tx queue start entry %ld  dirty entry %ld.\n",
-		dev->name, tp->cur_tx, tp->dirty_tx);
-	for (i = 0; i < NUM_TX_DESC; i++)
-		printk (KERN_DEBUG "%s:  Tx descriptor %d is %8.8lx.%s\n",
-			dev->name, i, RTL_R32 (TxStatus0 + (i * 4)),
-			i == tp->dirty_tx % NUM_TX_DESC ?
-				" (queue head)" : "");
-
 	/* Stop a shared interrupt from scavenging while we are. */
 	spin_lock_irqsave (&tp->lock, flags);
 	rtl8139_tx_clear (tp);
@@ -1714,7 +1715,6 @@ static void rtl8139_tx_timeout (struct net_device *dev)
 		netif_wake_queue (dev);
 	}
 	spin_unlock(&tp->rx_lock);
-	
 }
 
 
@@ -2458,14 +2458,13 @@ static struct ethtool_ops rtl8139_ethtool_ops = {
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct rtl8139_private *np = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
 	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
 	spin_lock_irq(&np->lock);
-	rc = generic_mii_ioctl(&np->mii, data, cmd, NULL);
+	rc = generic_mii_ioctl(&np->mii, if_mii(rq), cmd, NULL);
 	spin_unlock_irq(&np->lock);
 
 	return rc;
@@ -2558,6 +2557,8 @@ static int rtl8139_suspend (struct pci_dev *pdev, u32 state)
 	void *ioaddr = tp->mmio_addr;
 	unsigned long flags;
 
+	pci_save_state (pdev, tp->pci_state);
+
 	if (!netif_running (dev))
 		return 0;
 
@@ -2576,7 +2577,6 @@ static int rtl8139_suspend (struct pci_dev *pdev, u32 state)
 	spin_unlock_irqrestore (&tp->lock, flags);
 
 	pci_set_power_state (pdev, 3);
-	pci_save_state (pdev, tp->pci_state);
 
 	return 0;
 }
@@ -2587,9 +2587,9 @@ static int rtl8139_resume (struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata (pdev);
 	struct rtl8139_private *tp = dev->priv;
 
+	pci_restore_state (pdev, tp->pci_state);
 	if (!netif_running (dev))
 		return 0;
-	pci_restore_state (pdev, tp->pci_state);
 	pci_set_power_state (pdev, 0);
 	rtl8139_init_ring (dev);
 	rtl8139_hw_start (dev);
diff --git a/drivers/net/8390.h b/drivers/net/8390.h
index 2dd2c7317..58fd65e03 100644
--- a/drivers/net/8390.h
+++ b/drivers/net/8390.h
@@ -143,7 +143,7 @@ struct ei_device {
 #define inb_p(_p)	inb(_p)
 #define outb_p(_v,_p)	outb(_v,_p)
 
-#elif defined(CONFIG_NET_CBUS)
+#elif defined(CONFIG_NET_CBUS) || defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE)
 #define EI_SHIFT(x)	(ei_local->reg_offset[x])
 #else
 #define EI_SHIFT(x)	(x)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 69da46717..23ae50c44 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1210,6 +1210,39 @@ config IBMVETH
 	  <file:Documentation/networking/net-modules.txt>. The module will
 	  be called ibmveth.
 
+config IBM_EMAC
+       tristate "IBM PPC4xx EMAC driver support"
+       depends on 4xx
+       ---help---
+       This driver supports the IBM PPC4xx EMAC family of on-chip
+       Ethernet controllers.
+
+config IBM_EMAC_ERRMSG
+       bool "Verbose error messages"
+       depends on IBM_EMAC
+
+config IBM_EMAC_RXB
+       int "Number of receive buffers"
+       depends on IBM_EMAC
+       default "128" if IBM_EMAC4
+       default "64"
+
+config IBM_EMAC_TXB
+       int "Number of transmit buffers"
+       depends on IBM_EMAC
+       default "128" if IBM_EMAC4
+       default "8"
+
+config IBM_EMAC_FGAP
+       int "Frame gap"
+       depends on IBM_EMAC
+       default "8"
+
+config IBM_EMAC_SKBRES
+       int "Skb reserve amount"
+       depends on IBM_EMAC
+       default "0"
+
 config NET_PCI
 	bool "EISA, VLB, PCI and on board controllers"
 	depends on NET_ETHERNET && (ISA || EISA || PCI)
@@ -1828,6 +1861,13 @@ config FEC
 	  Say Y here if you want to use the built-in 10/100 Fast ethernet
 	  controller on the Motorola ColdFire 5272 processor.
 
+config NE_H8300
+	tristate "NE2000 compatible support for H8/300"
+	depends on H8300 && NET_ETHERNET
+	help
+	  Say Y here if you want to use the NE2000 compatible
+	  controller on the Renesas H8/300 processor.
+
 endmenu
 
 #
@@ -2480,16 +2520,6 @@ config IPHASE5526
 	  To compile this driver as a module, choose M here: the module
 	  will be called iph5526.
 
-config RCPCI
-	tristate "Red Creek Hardware VPN (EXPERIMENTAL)"
-	depends on NETDEVICES && EXPERIMENTAL && PCI && !64BIT
-	help
-	  This is a driver for hardware which provides a Virtual Private
-	  Network (VPN). Say Y if you have it.
-
-	  To compile this driver as a module, choose M here: the module
-	  will be called rcpci.
-
 config SHAPER
 	tristate "Traffic Shaper (EXPERIMENTAL)"
 	depends on NETDEVICES && EXPERIMENTAL
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index f0b6a61bb..d8d8d90c0 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -2,13 +2,12 @@
 # Makefile for the Linux network (ethercard) device drivers.
 #
 
-rcpci-objs	:=	rcpci45.o rclanmtl.o
-
 ifeq ($(CONFIG_ISDN_PPP),y)
   obj-$(CONFIG_ISDN) += slhc.o
 endif
 
 obj-$(CONFIG_E1000) += e1000/
+obj-$(CONFIG_IBM_EMAC) += ibm_emac/
 obj-$(CONFIG_IXGB) += ixgb/
 obj-$(CONFIG_BONDING) += bonding/
 
@@ -32,7 +31,6 @@ obj-$(CONFIG_BMAC) += bmac.o
 obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
 
 obj-$(CONFIG_DGRS) += dgrs.o
-obj-$(CONFIG_RCPCI) += rcpci.o
 obj-$(CONFIG_VORTEX) += 3c59x.o
 obj-$(CONFIG_TYPHOON) += typhoon.o
 obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o
@@ -95,6 +93,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
 obj-$(CONFIG_NET_SB1250_MAC) += sb1250-mac.o
 obj-$(CONFIG_B44) += b44.o
 obj-$(CONFIG_FORCEDETH) += forcedeth.o
+obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
 
 obj-$(CONFIG_PPP) += ppp_generic.o slhc.o
 obj-$(CONFIG_PPP_ASYNC) += ppp_async.o
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index 820e5afa6..7df6debfd 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -191,7 +191,8 @@ static struct devprobe2 isa_probes[] __initdata = {
 #ifdef CONFIG_E2100		/* Cabletron E21xx series. */
 	{e2100_probe, 0},
 #endif
-#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS)	/* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */
+#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS)	|| \
+    defined(CONFIG_NE_H8300)  /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */
 	{ne_probe, 0},
 #endif
 #ifdef CONFIG_LANCE		/* ISA/VLB (use pcnet32 for PCI cards) */
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 55717e5df..51cf16430 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -131,7 +131,6 @@
 #define PCI_DEVICE_ID_SGI_ACENIC	0x0009
 #endif
 
-#if LINUX_VERSION_CODE >= 0x20400
 static struct pci_device_id acenic_pci_tbl[] = {
 	{ PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE,
 	  PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
@@ -156,37 +155,6 @@ static struct pci_device_id acenic_pci_tbl[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, acenic_pci_tbl);
-#endif
-
-
-#ifndef MODULE_LICENSE
-#define MODULE_LICENSE(a)
-#endif
-
-#ifndef wmb
-#define wmb()	mb()
-#endif
-
-#ifndef __exit
-#define __exit
-#endif
-
-#ifndef __devinit
-#define __devinit	__init
-#endif
-
-#ifndef SMP_CACHE_BYTES
-#define SMP_CACHE_BYTES	L1_CACHE_BYTES
-#endif
-
-#ifndef SET_MODULE_OWNER
-#define SET_MODULE_OWNER(dev)		do{} while(0)
-#define ACE_MOD_INC_USE_COUNT		MOD_INC_USE_COUNT
-#define ACE_MOD_DEC_USE_COUNT		MOD_DEC_USE_COUNT
-#else
-#define ACE_MOD_INC_USE_COUNT		do{} while(0)
-#define ACE_MOD_DEC_USE_COUNT		do{} while(0)
-#endif
 
 #ifndef SET_NETDEV_DEV
 #define SET_NETDEV_DEV(net, pdev)	do{} while(0)
@@ -198,151 +166,8 @@ MODULE_DEVICE_TABLE(pci, acenic_pci_tbl);
 #define ace_sync_irq(irq)	synchronize_irq()
 #endif
 
-#if LINUX_VERSION_CODE < 0x2051e
-#define local_irq_save(flags)		do{__save_flags(flags) ; \
-					   __cli();} while(0)
-#define local_irq_restore(flags)	__restore_flags(flags)
-#endif
-
-#if (LINUX_VERSION_CODE < 0x02030d)
-#define pci_resource_start(dev, bar)	dev->base_address[bar]
-#elif (LINUX_VERSION_CODE < 0x02032c)
-#define pci_resource_start(dev, bar)	dev->resource[bar].start
-#endif
-
-#if (LINUX_VERSION_CODE < 0x02030e)
-#define net_device device
-#endif
-
-
-#if (LINUX_VERSION_CODE < 0x02032a)
-typedef u32 dma_addr_t;
-
-static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
-					 dma_addr_t *dma_handle)
-{
-	void *virt_ptr;
-
-	virt_ptr = kmalloc(size, GFP_KERNEL);
-	if (!virt_ptr)
-		return NULL;
-	*dma_handle = virt_to_bus(virt_ptr);
-	return virt_ptr;
-}
-
-#define pci_free_consistent(cookie, size, ptr, dma_ptr)	kfree(ptr)
-#define pci_map_page(cookie, page, off, size, dir)	\
-	virt_to_bus(page_address(page)+(off))
-#define pci_unmap_page(cookie, address, size, dir)
-#define pci_set_dma_mask(dev, mask)		\
-	(((u64)(mask) & 0xffffffff00000000) == 0 ? 0 : -EIO)
-#define pci_dma_supported(dev, mask)		\
-	(((u64)(mask) & 0xffffffff00000000) == 0 ? 1 : 0)
-
-#elif (LINUX_VERSION_CODE < 0x02040d)
-
-/*
- * 2.4.13 introduced pci_map_page()/pci_unmap_page() - for 2.4.12 and prior,
- * fall back on pci_map_single()/pci_unnmap_single().
- *
- * We are guaranteed that the page is mapped at this point since
- * pci_map_page() is only used upon valid struct skb's.
- */
-static inline dma_addr_t
-pci_map_page(struct pci_dev *cookie, struct page *page, unsigned long off,
-	     size_t size, int dir)
-{
-	void *page_virt;
-
-	page_virt = page_address(page);
-	if (!page_virt)
-		BUG();
-	return pci_map_single(cookie, (page_virt + off), size, dir);
-}
-#define pci_unmap_page(cookie, dma_addr, size, dir)	\
-	pci_unmap_single(cookie, dma_addr, size, dir)
-#endif
-
-#if (LINUX_VERSION_CODE < 0x020412)
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME)		0
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)	do{} while(0)
-#define pci_unmap_len(PTR, LEN_NAME)		0
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL)	do{} while(0)
-#endif
-
-
-#if (LINUX_VERSION_CODE < 0x02032b)
-/*
- * SoftNet
- *
- * For pre-softnet kernels we need to tell the upper layer not to
- * re-enter start_xmit() while we are in there. However softnet
- * guarantees not to enter while we are in there so there is no need
- * to do the netif_stop_queue() dance unless the transmit queue really
- * gets stuck. This should also improve performance according to tests
- * done by Aman Singla.
- */
-#define dev_kfree_skb_irq(a)			dev_kfree_skb(a)
-#define netif_wake_queue(dev)			clear_bit(0, &dev->tbusy)
-#define netif_stop_queue(dev)			set_bit(0, &dev->tbusy)
-#define late_stop_netif_stop_queue(dev)		do{} while(0)
-#define early_stop_netif_stop_queue(dev)	test_and_set_bit(0,&dev->tbusy)
-#define early_stop_netif_wake_queue(dev)	netif_wake_queue(dev)
-
-static inline void netif_start_queue(struct net_device *dev)
-{
-	dev->tbusy = 0;
-	dev->interrupt = 0;
-	dev->start = 1;
-}
-
-#define ace_mark_net_bh()			mark_bh(NET_BH)
-#define netif_queue_stopped(dev)		dev->tbusy
-#define netif_running(dev)			dev->start
-#define ace_if_down(dev)			do{dev->start = 0;} while(0)
-
-#define tasklet_struct				tq_struct
-static inline void tasklet_schedule(struct tasklet_struct *tasklet)
-{
-	queue_task(tasklet, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
-}
-
-static inline void tasklet_init(struct tasklet_struct *tasklet,
-				void (*func)(unsigned long),
-				unsigned long data)
-{
-	tasklet->next = NULL;
-	tasklet->sync = 0;
-	tasklet->routine = (void (*)(void *))func;
-	tasklet->data = (void *)data;
-}
-#define tasklet_kill(tasklet)			do{} while(0)
-#else
-#define late_stop_netif_stop_queue(dev)		netif_stop_queue(dev)
-#define early_stop_netif_stop_queue(dev)	0
-#define early_stop_netif_wake_queue(dev)	do{} while(0)
-#define ace_mark_net_bh()			do{} while(0)
-#define ace_if_down(dev)			do{} while(0)
-#endif
-
-#if (LINUX_VERSION_CODE >= 0x02031b)
-#define NEW_NETINIT
-#define ACE_PROBE_ARG				void
-#else
-#define ACE_PROBE_ARG				struct net_device *dev
-#endif
-
-#ifndef min_t
-#define min_t(type,a,b)	(((a)<(b))?(a):(b))
-#endif
-
-#ifndef ARCH_HAS_PREFETCHW
-#ifndef prefetchw
-#define prefetchw(x)				do{} while(0)
-#endif
+#ifndef offset_in_page
+#define offset_in_page(ptr)	((unsigned long)(ptr) & ~PAGE_MASK)
 #endif
 
 #define ACE_MAX_MOD_PARMS	8
@@ -595,407 +420,323 @@ static int max_rx_desc[ACE_MAX_MOD_PARMS];
 static int tx_ratio[ACE_MAX_MOD_PARMS];
 static int dis_pci_mem_inval[ACE_MAX_MOD_PARMS] = {1, 1, 1, 1, 1, 1, 1, 1};
 
+MODULE_AUTHOR("Jes Sorensen <jes@trained-monkey.org>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver");
+MODULE_PARM(link, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM(trace, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM(tx_coal_tick, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM(max_tx_desc, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM(rx_coal_tick, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM(max_rx_desc, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM(tx_ratio, "1-" __MODULE_STRING(8) "i");
+MODULE_PARM_DESC(link, "AceNIC/3C985/NetGear link state");
+MODULE_PARM_DESC(trace, "AceNIC/3C985/NetGear firmware trace level");
+MODULE_PARM_DESC(tx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first tx descriptor arrives");
+MODULE_PARM_DESC(max_tx_desc, "AceNIC/3C985/GA620 max number of transmit descriptors to wait");
+MODULE_PARM_DESC(rx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first rx descriptor arrives");
+MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descriptors to wait");
+MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
+
+
 static char version[] __initdata = 
   "acenic.c: v0.92 08/05/2002  Jes Sorensen, linux-acenic@SunSITE.dk\n"
   "                            http://home.cern.ch/~jes/gige/acenic.html\n";
 
-static struct net_device *root_dev;
-
-static int probed __initdata = 0;
-
-
-int __devinit acenic_probe (ACE_PROBE_ARG)
+static int __devinit acenic_probe_one(struct pci_dev *pdev,
+		const struct pci_device_id *id)
 {
-#ifdef NEW_NETINIT
 	struct net_device *dev;
-#endif
 	struct ace_private *ap;
-	struct pci_dev *pdev = NULL;
-	int boards_found = 0;
-	int version_disp;
-
-	if (probed)
-		return -ENODEV;
-	probed++;
-
-	version_disp = 0;
-
-	while ((pdev = pci_find_class(PCI_CLASS_NETWORK_ETHERNET<<8, pdev))) {
-
-		if (!((pdev->vendor == PCI_VENDOR_ID_ALTEON) &&
-		      ((pdev->device == PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE) ||
-		       (pdev->device == PCI_DEVICE_ID_ALTEON_ACENIC_COPPER)))&&
-		    !((pdev->vendor == PCI_VENDOR_ID_3COM) &&
-		      (pdev->device == PCI_DEVICE_ID_3COM_3C985)) &&
-		    !((pdev->vendor == PCI_VENDOR_ID_NETGEAR) &&
-		      ((pdev->device == PCI_DEVICE_ID_NETGEAR_GA620) || 
-		       (pdev->device == PCI_DEVICE_ID_NETGEAR_GA620T))) &&
-		/*
-		 * Farallon used the DEC vendor ID on their cards by
-		 * mistake for a while
-		 */
-		    !((pdev->vendor == PCI_VENDOR_ID_DEC) &&
-		      (pdev->device == PCI_DEVICE_ID_FARALLON_PN9000SX)) &&
-		    !((pdev->vendor == PCI_VENDOR_ID_ALTEON) &&
-		      (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T)) &&
-		    !((pdev->vendor == PCI_VENDOR_ID_SGI) &&
-		      (pdev->device == PCI_DEVICE_ID_SGI_ACENIC)))
-			continue;
-
-		dev = alloc_etherdev(sizeof(struct ace_private));
-		if (dev == NULL) {
-			printk(KERN_ERR "acenic: Unable to allocate "
-			       "net_device structure!\n");
-			break;
-		}
+	static int boards_found;
 
-		SET_MODULE_OWNER(dev);
-		SET_NETDEV_DEV(dev, &pdev->dev);
+	dev = alloc_etherdev(sizeof(struct ace_private));
+	if (dev == NULL) {
+		printk(KERN_ERR "acenic: Unable to allocate "
+		       "net_device structure!\n");
+		return -ENOMEM;
+	}
 
-		ap = dev->priv;
-		ap->pdev = pdev;
+	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &pdev->dev);
 
-		dev->open = &ace_open;
-		dev->hard_start_xmit = &ace_start_xmit;
-		dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+	ap = dev->priv;
+	ap->pdev = pdev;
+
+	dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
 #if ACENIC_DO_VLAN
-		dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-		dev->vlan_rx_register = ace_vlan_rx_register;
-		dev->vlan_rx_kill_vid = ace_vlan_rx_kill_vid;
+	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+	dev->vlan_rx_register = ace_vlan_rx_register;
+	dev->vlan_rx_kill_vid = ace_vlan_rx_kill_vid;
 #endif
-		if (1) {
-			static void ace_watchdog(struct net_device *dev);
-			dev->tx_timeout = &ace_watchdog;
-			dev->watchdog_timeo = 5*HZ;
-		}
-		dev->stop = &ace_close;
-		dev->get_stats = &ace_get_stats;
-		dev->set_multicast_list = &ace_set_multicast_list;
-		dev->do_ioctl = &ace_ioctl;
-		dev->set_mac_address = &ace_set_mac_addr;
-		dev->change_mtu = &ace_change_mtu;
-
-		/* display version info if adapter is found */
-		if (!version_disp)
-		{
-			/* set display flag to TRUE so that */
-			/* we only display this string ONCE */
-			version_disp = 1;
-			printk(version);
-		}
+	if (1) {
+		static void ace_watchdog(struct net_device *dev);
+		dev->tx_timeout = &ace_watchdog;
+		dev->watchdog_timeo = 5*HZ;
+	}
 
-		if (pci_enable_device(pdev)) {
-			free_netdev(dev);
-			continue;
-		}
+	dev->open = &ace_open;
+	dev->stop = &ace_close;
+	dev->hard_start_xmit = &ace_start_xmit;
+	dev->get_stats = &ace_get_stats;
+	dev->set_multicast_list = &ace_set_multicast_list;
+	dev->do_ioctl = &ace_ioctl;
+	dev->set_mac_address = &ace_set_mac_addr;
+	dev->change_mtu = &ace_change_mtu;
 
-		/*
-		 * Enable master mode before we start playing with the
-		 * pci_command word since pci_set_master() will modify
-		 * it.
-		 */
-		pci_set_master(pdev);
+	/* we only display this string ONCE */
+	if (!boards_found)
+		printk(version);
 
-		pci_read_config_word(pdev, PCI_COMMAND, &ap->pci_command);
+	if (pci_enable_device(pdev))
+		goto fail_free_netdev;
 
-		/* OpenFirmware on Mac's does not set this - DOH.. */ 
-		if (!(ap->pci_command & PCI_COMMAND_MEMORY)) {
-			printk(KERN_INFO "%s: Enabling PCI Memory Mapped "
-			       "access - was not enabled by BIOS/Firmware\n",
-			       dev->name);
-			ap->pci_command = ap->pci_command | PCI_COMMAND_MEMORY;
-			pci_write_config_word(ap->pdev, PCI_COMMAND,
-					      ap->pci_command);
-			wmb();
-		}
+	/*
+	 * Enable master mode before we start playing with the
+	 * pci_command word since pci_set_master() will modify
+	 * it.
+	 */
+	pci_set_master(pdev);
 
-		pci_read_config_byte(pdev, PCI_LATENCY_TIMER,
-				     &ap->pci_latency);
-		if (ap->pci_latency <= 0x40) {
-			ap->pci_latency = 0x40;
-			pci_write_config_byte(pdev, PCI_LATENCY_TIMER,
-					      ap->pci_latency);
-		}
+	pci_read_config_word(pdev, PCI_COMMAND, &ap->pci_command);
 
-		/*
-		 * Remap the regs into kernel space - this is abuse of
-		 * dev->base_addr since it was means for I/O port
-		 * addresses but who gives a damn.
-		 */
-		dev->base_addr = pci_resource_start(pdev, 0);
-		ap->regs = (struct ace_regs *)ioremap(dev->base_addr, 0x4000);
-		if (!ap->regs) {
-			printk(KERN_ERR "%s:  Unable to map I/O register, "
-			       "AceNIC %i will be disabled.\n",
-			       dev->name, boards_found);
-			break;
-		}
+	/* OpenFirmware on Mac's does not set this - DOH.. */ 
+	if (!(ap->pci_command & PCI_COMMAND_MEMORY)) {
+		printk(KERN_INFO "%s: Enabling PCI Memory Mapped "
+		       "access - was not enabled by BIOS/Firmware\n",
+		       dev->name);
+		ap->pci_command = ap->pci_command | PCI_COMMAND_MEMORY;
+		pci_write_config_word(ap->pdev, PCI_COMMAND,
+				      ap->pci_command);
+		wmb();
+	}
 
-		switch(pdev->vendor) {
-		case PCI_VENDOR_ID_ALTEON:
-			if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) {
-				strncpy(ap->name, "Farallon PN9100-T "
-					"Gigabit Ethernet", sizeof (ap->name));
-				printk(KERN_INFO "%s: Farallon PN9100-T ",
-				       dev->name);
-			} else {
-				strncpy(ap->name, "AceNIC Gigabit Ethernet",
-					sizeof (ap->name));
-				printk(KERN_INFO "%s: Alteon AceNIC ",
-				       dev->name);
-			}
-			break;
-		case PCI_VENDOR_ID_3COM:
-			strncpy(ap->name, "3Com 3C985 Gigabit Ethernet",
-				sizeof (ap->name));
-			printk(KERN_INFO "%s: 3Com 3C985 ", dev->name);
-			break;
-		case PCI_VENDOR_ID_NETGEAR:
-			strncpy(ap->name, "NetGear GA620 Gigabit Ethernet",
-				sizeof (ap->name));
-			printk(KERN_INFO "%s: NetGear GA620 ", dev->name);
-			break;
-		case PCI_VENDOR_ID_DEC:
-			if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9000SX) {
-				strncpy(ap->name, "Farallon PN9000-SX "
-					"Gigabit Ethernet", sizeof (ap->name));
-				printk(KERN_INFO "%s: Farallon PN9000-SX ",
-				       dev->name);
-				break;
-			}
-		case PCI_VENDOR_ID_SGI:
-			strncpy(ap->name, "SGI AceNIC Gigabit Ethernet",
+	pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &ap->pci_latency);
+	if (ap->pci_latency <= 0x40) {
+		ap->pci_latency = 0x40;
+		pci_write_config_byte(pdev, PCI_LATENCY_TIMER, ap->pci_latency);
+	}
+
+	/*
+	 * Remap the regs into kernel space - this is abuse of
+	 * dev->base_addr since it was means for I/O port
+	 * addresses but who gives a damn.
+	 */
+	dev->base_addr = pci_resource_start(pdev, 0);
+	ap->regs = (struct ace_regs *)ioremap(dev->base_addr, 0x4000);
+	if (!ap->regs) {
+		printk(KERN_ERR "%s:  Unable to map I/O register, "
+		       "AceNIC %i will be disabled.\n",
+		       dev->name, boards_found);
+		goto fail_free_netdev;
+	}
+
+	switch(pdev->vendor) {
+	case PCI_VENDOR_ID_ALTEON:
+		if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) {
+			strncpy(ap->name, "Farallon PN9100-T "
+				"Gigabit Ethernet", sizeof (ap->name));
+			printk(KERN_INFO "%s: Farallon PN9100-T ",
+			       dev->name);
+		} else {
+			strncpy(ap->name, "AceNIC Gigabit Ethernet",
 				sizeof (ap->name));
-			printk(KERN_INFO "%s: SGI AceNIC ", dev->name);
-			break;
-		default:
- 			strncpy(ap->name, "Unknown AceNIC based Gigabit "
-				"Ethernet", sizeof (ap->name));
-			printk(KERN_INFO "%s: Unknown AceNIC ", dev->name);
+			printk(KERN_INFO "%s: Alteon AceNIC ",
+			       dev->name);
+		}
+		break;
+	case PCI_VENDOR_ID_3COM:
+		strncpy(ap->name, "3Com 3C985 Gigabit Ethernet",
+			sizeof (ap->name));
+		printk(KERN_INFO "%s: 3Com 3C985 ", dev->name);
+		break;
+	case PCI_VENDOR_ID_NETGEAR:
+		strncpy(ap->name, "NetGear GA620 Gigabit Ethernet",
+			sizeof (ap->name));
+		printk(KERN_INFO "%s: NetGear GA620 ", dev->name);
+		break;
+	case PCI_VENDOR_ID_DEC:
+		if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9000SX) {
+			strncpy(ap->name, "Farallon PN9000-SX "
+				"Gigabit Ethernet", sizeof (ap->name));
+			printk(KERN_INFO "%s: Farallon PN9000-SX ",
+			       dev->name);
 			break;
 		}
-		ap->name [sizeof (ap->name) - 1] = '\0';
-		printk("Gigabit Ethernet at 0x%08lx, ", dev->base_addr);
+	case PCI_VENDOR_ID_SGI:
+		strncpy(ap->name, "SGI AceNIC Gigabit Ethernet",
+			sizeof (ap->name));
+		printk(KERN_INFO "%s: SGI AceNIC ", dev->name);
+		break;
+	default:
+ 		strncpy(ap->name, "Unknown AceNIC based Gigabit "
+			"Ethernet", sizeof (ap->name));
+		printk(KERN_INFO "%s: Unknown AceNIC ", dev->name);
+		break;
+	}
+
+	ap->name [sizeof (ap->name) - 1] = '\0';
+	printk("Gigabit Ethernet at 0x%08lx, ", dev->base_addr);
 #ifdef __sparc__
-		printk("irq %s\n", __irq_itoa(pdev->irq));
+	printk("irq %s\n", __irq_itoa(pdev->irq));
 #else
-		printk("irq %i\n", pdev->irq);
+	printk("irq %i\n", pdev->irq);
 #endif
 
 #ifdef CONFIG_ACENIC_OMIT_TIGON_I
-		if ((readl(&ap->regs->HostCtrl) >> 28) == 4) {
-			printk(KERN_ERR "%s: Driver compiled without Tigon I"
-			       " support - NIC disabled\n", dev->name);
-			ace_init_cleanup(dev);
-			free_netdev(dev);
-			continue;
-		}
+	if ((readl(&ap->regs->HostCtrl) >> 28) == 4) {
+		printk(KERN_ERR "%s: Driver compiled without Tigon I"
+		       " support - NIC disabled\n", dev->name);
+		goto fail_uninit;
+	}
 #endif
 
-		if (ace_allocate_descriptors(dev)) {
-			/*
-			 * ace_allocate_descriptors() calls
-			 * ace_init_cleanup() on error.
-			 */
-			free_netdev(dev);
-			continue;
-		}
+	if (ace_allocate_descriptors(dev))
+		goto fail_free_netdev;
 
 #ifdef MODULE
-		if (boards_found >= ACE_MAX_MOD_PARMS)
-			ap->board_idx = BOARD_IDX_OVERFLOW;
-		else
-			ap->board_idx = boards_found;
+	if (boards_found >= ACE_MAX_MOD_PARMS)
+		ap->board_idx = BOARD_IDX_OVERFLOW;
+	else
+		ap->board_idx = boards_found;
 #else
-		ap->board_idx = BOARD_IDX_STATIC;
+	ap->board_idx = BOARD_IDX_STATIC;
 #endif
 
-		if (ace_init(dev)) {
-			/*
-			 * ace_init() calls ace_init_cleanup() on error.
-			 */
-			free_netdev(dev);
-			continue;
-		}
-
-		if (register_netdev(dev)) {
-			printk(KERN_ERR "acenic: device registration failed\n");
-			ace_init_cleanup(dev);
-			free_netdev(dev);
-			continue;
-		}
-
-		if (ap->pci_using_dac)
-			dev->features |= NETIF_F_HIGHDMA;
+	if (ace_init(dev))
+		goto fail_free_netdev;
 
-		boards_found++;
+	if (register_netdev(dev)) {
+		printk(KERN_ERR "acenic: device registration failed\n");
+		goto fail_uninit;
 	}
 
-	/*
-	 * If we're at this point we're going through ace_probe() for
-	 * the first time.  Return success (0) if we've initialized 1
-	 * or more boards. Otherwise, return failure (-ENODEV).
-	 */
-
-	if (boards_found > 0)
-		return 0;
-	else
-		return -ENODEV;
-}
+	if (ap->pci_using_dac)
+		dev->features |= NETIF_F_HIGHDMA;
 
+	pci_set_drvdata(pdev, dev);
 
-#ifdef MODULE
-MODULE_AUTHOR("Jes Sorensen <jes@trained-monkey.org>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver");
-MODULE_PARM(link, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM(trace, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM(tx_coal_tick, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM(max_tx_desc, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM(rx_coal_tick, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM(max_rx_desc, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM(tx_ratio, "1-" __MODULE_STRING(8) "i");
-MODULE_PARM_DESC(link, "AceNIC/3C985/NetGear link state");
-MODULE_PARM_DESC(trace, "AceNIC/3C985/NetGear firmware trace level");
-MODULE_PARM_DESC(tx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first tx descriptor arrives");
-MODULE_PARM_DESC(max_tx_desc, "AceNIC/3C985/GA620 max number of transmit descriptors to wait");
-MODULE_PARM_DESC(rx_coal_tick, "AceNIC/3C985/GA620 max clock ticks to wait from first rx descriptor arrives");
-MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descriptors to wait");
-MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
-#endif
+	boards_found++;
+	return 0;
 
+ fail_uninit:
+	ace_init_cleanup(dev);
+ fail_free_netdev:
+	free_netdev(dev);
+	return -ENODEV;
+}
 
-static void __exit ace_module_cleanup(void)
+static void __devexit acenic_remove_one(struct pci_dev *pdev)
 {
-	struct ace_private *ap;
-	struct ace_regs *regs;
-	struct net_device *next;
+	struct net_device *dev = pci_get_drvdata(pdev);
+	struct ace_private *ap = dev->priv;
+	struct ace_regs *regs = ap->regs;
 	short i;
 
-	while (root_dev) {
-		ap = root_dev->priv;
-		next = ap->next;
-		unregister_netdev(root_dev);
+	unregister_netdev(dev);
 
-		regs = ap->regs;
-
-		writel(readl(&regs->CpuCtrl) | CPU_HALT, &regs->CpuCtrl);
-		if (ap->version >= 2)
-			writel(readl(&regs->CpuBCtrl) | CPU_HALT,
-			       &regs->CpuBCtrl);
-		/*
-		 * This clears any pending interrupts
-		 */
-		writel(1, &regs->Mb0Lo);
-		readl(&regs->CpuCtrl);	/* flush */
+	writel(readl(&regs->CpuCtrl) | CPU_HALT, &regs->CpuCtrl);
+	if (ap->version >= 2)
+		writel(readl(&regs->CpuBCtrl) | CPU_HALT, &regs->CpuBCtrl);
+	
+	/*
+	 * This clears any pending interrupts
+	 */
+	writel(1, &regs->Mb0Lo);
+	readl(&regs->CpuCtrl);	/* flush */
 
-		/*
-		 * Make sure no other CPUs are processing interrupts
-		 * on the card before the buffers are being released.
-		 * Otherwise one might experience some `interesting'
-		 * effects.
-		 *
-		 * Then release the RX buffers - jumbo buffers were
-		 * already released in ace_close().
-		 */
-		ace_sync_irq(root_dev->irq);
+	/*
+	 * Make sure no other CPUs are processing interrupts
+	 * on the card before the buffers are being released.
+	 * Otherwise one might experience some `interesting'
+	 * effects.
+	 *
+	 * Then release the RX buffers - jumbo buffers were
+	 * already released in ace_close().
+	 */
+	ace_sync_irq(dev->irq);
 
-		for (i = 0; i < RX_STD_RING_ENTRIES; i++) {
-			struct sk_buff *skb = ap->skb->rx_std_skbuff[i].skb;
+	for (i = 0; i < RX_STD_RING_ENTRIES; i++) {
+		struct sk_buff *skb = ap->skb->rx_std_skbuff[i].skb;
 
-			if (skb) {
-				struct ring_info *ringp;
-				dma_addr_t mapping;
+		if (skb) {
+			struct ring_info *ringp;
+			dma_addr_t mapping;
 
-				ringp = &ap->skb->rx_std_skbuff[i];
-				mapping = pci_unmap_addr(ringp, mapping);
-				pci_unmap_page(ap->pdev, mapping,
-					       ACE_STD_BUFSIZE - (2 + 16),
-					       PCI_DMA_FROMDEVICE);
+			ringp = &ap->skb->rx_std_skbuff[i];
+			mapping = pci_unmap_addr(ringp, mapping);
+			pci_unmap_page(ap->pdev, mapping,
+				       ACE_STD_BUFSIZE - (2 + 16),
+				       PCI_DMA_FROMDEVICE);
 
-				ap->rx_std_ring[i].size = 0;
-				ap->skb->rx_std_skbuff[i].skb = NULL;
-				dev_kfree_skb(skb);
-			}
-		}
-		if (ap->version >= 2) {
-			for (i = 0; i < RX_MINI_RING_ENTRIES; i++) {
-				struct sk_buff *skb = ap->skb->rx_mini_skbuff[i].skb;
-
-				if (skb) {
-					struct ring_info *ringp;
-					dma_addr_t mapping;
-
-					ringp = &ap->skb->rx_mini_skbuff[i];
-					mapping = pci_unmap_addr(ringp,mapping);
-					pci_unmap_page(ap->pdev, mapping,
-						       ACE_MINI_BUFSIZE - (2 + 16),
-						       PCI_DMA_FROMDEVICE);
-
-					ap->rx_mini_ring[i].size = 0;
-					ap->skb->rx_mini_skbuff[i].skb = NULL;
-					dev_kfree_skb(skb);
-				}
-			}
+			ap->rx_std_ring[i].size = 0;
+			ap->skb->rx_std_skbuff[i].skb = NULL;
+			dev_kfree_skb(skb);
 		}
-		for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) {
-			struct sk_buff *skb = ap->skb->rx_jumbo_skbuff[i].skb;
+	}
+
+	if (ap->version >= 2) {
+		for (i = 0; i < RX_MINI_RING_ENTRIES; i++) {
+			struct sk_buff *skb = ap->skb->rx_mini_skbuff[i].skb;
+
 			if (skb) {
 				struct ring_info *ringp;
 				dma_addr_t mapping;
 
-				ringp = &ap->skb->rx_jumbo_skbuff[i];
-				mapping = pci_unmap_addr(ringp, mapping);
+				ringp = &ap->skb->rx_mini_skbuff[i];
+				mapping = pci_unmap_addr(ringp,mapping);
 				pci_unmap_page(ap->pdev, mapping,
-					       ACE_JUMBO_BUFSIZE - (2 + 16),
+					       ACE_MINI_BUFSIZE - (2 + 16),
 					       PCI_DMA_FROMDEVICE);
 
-				ap->rx_jumbo_ring[i].size = 0;
-				ap->skb->rx_jumbo_skbuff[i].skb = NULL;
+				ap->rx_mini_ring[i].size = 0;
+				ap->skb->rx_mini_skbuff[i].skb = NULL;
 				dev_kfree_skb(skb);
 			}
 		}
-
-		ace_init_cleanup(root_dev);
-		free_netdev(root_dev);
-		root_dev = next;
 	}
-}
 
+	for (i = 0; i < RX_JUMBO_RING_ENTRIES; i++) {
+		struct sk_buff *skb = ap->skb->rx_jumbo_skbuff[i].skb;
+		if (skb) {
+			struct ring_info *ringp;
+			dma_addr_t mapping;
 
-int __init ace_module_init(void)
-{
-	int status;
+			ringp = &ap->skb->rx_jumbo_skbuff[i];
+			mapping = pci_unmap_addr(ringp, mapping);
+			pci_unmap_page(ap->pdev, mapping,
+				       ACE_JUMBO_BUFSIZE - (2 + 16),
+				       PCI_DMA_FROMDEVICE);
 
-	root_dev = NULL;
+			ap->rx_jumbo_ring[i].size = 0;
+			ap->skb->rx_jumbo_skbuff[i].skb = NULL;
+			dev_kfree_skb(skb);
+		}
+	}
 
-#ifdef NEW_NETINIT
-	status = acenic_probe();
-#else
-	status = acenic_probe(NULL);
-#endif
-	return status;
+	ace_init_cleanup(dev);
+	free_netdev(dev);
 }
 
+static struct pci_driver acenic_pci_driver = {
+	.name		= "acenic",
+	.id_table	= acenic_pci_tbl,
+	.probe		= acenic_probe_one,
+	.remove		= __devexit_p(acenic_remove_one),
+};
 
-#if (LINUX_VERSION_CODE < 0x02032a)
-#ifdef MODULE
-int init_module(void)
+static int __init acenic_init(void)
 {
-	return ace_module_init();
+	return pci_module_init(&acenic_pci_driver);
 }
 
-
-void cleanup_module(void)
+static void __exit acenic_exit(void)
 {
-	ace_module_cleanup();
+	pci_unregister_driver(&acenic_pci_driver);
 }
-#endif
-#else
-module_init(ace_module_init);
-module_exit(ace_module_cleanup);
-#endif
 
+module_init(acenic_init);
+module_exit(acenic_exit);
 
 static void ace_free_descriptors(struct net_device *dev)
 {
@@ -1462,13 +1203,6 @@ static int __init ace_init(struct net_device *dev)
 	} else
 		dev->irq = pdev->irq;
 
-	/*
-	 * Register the device here to be able to catch allocated
-	 * interrupt handlers in case the firmware doesn't come up.
-	 */
-	ap->next = root_dev;
-	root_dev = dev;
-
 #ifdef INDEX_DEBUG
 	spin_lock_init(&ap->debug_lock);
 	ap->last_tx = ACE_TX_RING_ENTRIES(ap) - 1;
@@ -2642,8 +2376,6 @@ static int ace_open(struct net_device *dev)
 
 	netif_start_queue(dev);
 
-	ACE_MOD_INC_USE_COUNT;
-
 	/*
 	 * Setup the bottom half rx ring refill handler
 	 */
@@ -2660,8 +2392,6 @@ static int ace_close(struct net_device *dev)
 	unsigned long flags;
 	short i;
 
-	ace_if_down(dev);
-
 	/*
 	 * Without (or before) releasing irq and stopping hardware, this
 	 * is an absolute non-sense, by the way. It will be reset instantly
@@ -2733,7 +2463,6 @@ static int ace_close(struct net_device *dev)
 	ace_unmask_irq(dev);
 	local_irq_restore(flags);
 
-	ACE_MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -2790,12 +2519,6 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct tx_desc *desc;
 	u32 idx, flagsize;
 
- 	/*
-	 * This only happens with pre-softnet, ie. 2.2.x kernels.
- 	 */
-	if (early_stop_netif_stop_queue(dev))
- 		return 1;
-
 restart:
 	idx = ap->tx_prd;
 
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index c4491dab9..7b96c017d 100755
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -1571,7 +1571,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
 This function handles all the  ethtool ioctls. It gives driver info, gets/sets driver speed, gets memory mapped register values, forces auto negotiation, sets/gets WOL options for ethtool application. 
 */
 	
-static int amd8111e_ethtool_ioctl(struct net_device* dev, void* useraddr)
+static int amd8111e_ethtool_ioctl(struct net_device* dev, void __user *useraddr)
 {
 	struct amd8111e_priv *lp = netdev_priv(dev);
 	struct pci_dev *pci_dev = lp->pci_dev;
@@ -1694,7 +1694,7 @@ static int amd8111e_ethtool_ioctl(struct net_device* dev, void* useraddr)
 }
 static int amd8111e_ioctl(struct net_device * dev , struct ifreq *ifr, int cmd)
 {
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
+	struct mii_ioctl_data *data = if_mii(ifr);
 	struct amd8111e_priv *lp = netdev_priv(dev);
 	int err;
 	u32 mii_regval;
@@ -1704,7 +1704,7 @@ static int amd8111e_ioctl(struct net_device * dev , struct ifreq *ifr, int cmd)
 
 	switch(cmd) {
 	case SIOCETHTOOL:
-		return amd8111e_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+		return amd8111e_ethtool_ioctl(dev, ifr->ifr_data);
 	case SIOCGMIIPHY:
 		data->phy_id = PHY_ID;
 
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index db21e0c41..925dd0477 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -524,7 +524,7 @@ static void cops_reset(struct net_device *dev, int sleep)
 static void cops_load (struct net_device *dev)
 {
         struct ifreq ifr;
-        struct ltfirmware *ltf= (struct ltfirmware *)&ifr.ifr_data;
+        struct ltfirmware *ltf= (struct ltfirmware *)&ifr.ifr_ifru;
         struct cops_local *lp = netdev_priv(dev);
         int ioaddr=dev->base_addr;
 	int length, i = 0;
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index 8c0a962d5..8bf0bba62 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -259,7 +259,7 @@ static struct ipddp_route* ipddp_find_route(struct ipddp_route *rt)
 
 static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-        struct ipddp_route *rt = (struct ipddp_route *)ifr->ifr_data;
+        struct ipddp_route __user *rt = ifr->ifr_data;
         struct ipddp_route rcp;
 
         if(!capable(CAP_NET_ADMIN))
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index 0f51997ca..05a832a2f 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -155,7 +155,7 @@ static void __init com90xx_probe(void)
 		ioaddr = *port;
 
 		if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) {
-			BUGMSG2(D_INIT_REASONS, "(check_region)\n");
+			BUGMSG2(D_INIT_REASONS, "(request_region)\n");
 			BUGMSG2(D_INIT_REASONS, "S1: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
 			*port-- = ports[--numports];
@@ -214,7 +214,7 @@ static void __init com90xx_probe(void)
 		BUGMSG2(D_INIT, "%lXh ", *p);
 
 		if (!request_mem_region(*p, BUFFER_SIZE, "arcnet (90xx)")) {
-			BUGMSG2(D_INIT_REASONS, "(check_mem_region)\n");
+			BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n");
 			BUGMSG2(D_INIT_REASONS, "Stage 3: ");
 			BUGLVL(D_INIT_REASONS) numprint = 0;
 			*p-- = shmems[--numshmems];
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 8bd25b970..6b28a3d9b 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -53,25 +53,31 @@ static const char version[] =
 #ifdef __arm__
 static void write_rreg(u_long base, u_int reg, u_int val)
 {
-	__asm__("str%?h	%1, [%2]	@ NET_RAP
-		str%?h	%0, [%2, #-4]	@ NET_RDP
-		" : : "r" (val), "r" (reg), "r" (ISAIO_BASE + 0x0464));
+	__asm__(
+	"str%?h	%1, [%2]	@ NET_RAP\n\t"
+	"str%?h	%0, [%2, #-4]	@ NET_RDP"
+	:
+	: "r" (val), "r" (reg), "r" (ISAIO_BASE + 0x0464));
 }
 
 static inline unsigned short read_rreg(u_long base_addr, u_int reg)
 {
 	unsigned short v;
-	__asm__("str%?h	%1, [%2]	@ NET_RAP
-		ldr%?h	%0, [%2, #-4]	@ NET_RDP
-		" : "=r" (v): "r" (reg), "r" (ISAIO_BASE + 0x0464));
+	__asm__(
+	"str%?h	%1, [%2]	@ NET_RAP\n\t"
+	"ldr%?h	%0, [%2, #-4]	@ NET_RDP"
+	: "=r" (v)
+	: "r" (reg), "r" (ISAIO_BASE + 0x0464));
 	return v;
 }
 
 static inline void write_ireg(u_long base, u_int reg, u_int val)
 {
-	__asm__("str%?h	%1, [%2]	@ NET_RAP
-		str%?h	%0, [%2, #8]	@ NET_IDP
-		" : : "r" (val), "r" (reg), "r" (ISAIO_BASE + 0x0464));
+	__asm__(
+	"str%?h	%1, [%2]	@ NET_RAP\n\t"
+	"str%?h	%0, [%2, #8]	@ NET_IDP"
+	:
+	: "r" (val), "r" (reg), "r" (ISAIO_BASE + 0x0464));
 }
 
 static inline unsigned short read_ireg(u_long base_addr, u_int reg)
@@ -101,16 +107,16 @@ am_writebuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigne
 	}
 	while (length > 8) {
 		unsigned int tmp, tmp2;
-		__asm__ __volatile__("
-			ldm%?ia	%1!, {%2, %3}
-			str%?h	%2, [%0], #4
-			mov%?	%2, %2, lsr #16
-			str%?h	%2, [%0], #4
-			str%?h	%3, [%0], #4
-			mov%?	%3, %3, lsr #16
-			str%?h	%3, [%0], #4
-		" : "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2)
-		  : "0" (offset), "1" (buf));
+		__asm__ __volatile__(
+			"ldm%?ia	%1!, {%2, %3}\n\t"
+			"str%?h	%2, [%0], #4\n\t"
+			"mov%?	%2, %2, lsr #16\n\t"
+			"str%?h	%2, [%0], #4\n\t"
+			"str%?h	%3, [%0], #4\n\t"
+			"mov%?	%3, %3, lsr #16\n\t"
+			"str%?h	%3, [%0], #4"
+		: "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2)
+		: "0" (offset), "1" (buf));
 		length -= 8;
 	}
 	while (length > 0) {
@@ -128,36 +134,36 @@ am_readbuffer(struct net_device *dev, u_int offset, unsigned char *buf, unsigned
 	length = (length + 1) & ~1;
 	if ((int)buf & 2) {
 		unsigned int tmp;
-		__asm__ __volatile__("
-			ldr%?h	%2, [%0], #4
-			str%?b	%2, [%1], #1
-			mov%?	%2, %2, lsr #8
-			str%?b	%2, [%1], #1
-		" : "=&r" (offset), "=&r" (buf), "=r" (tmp): "0" (offset), "1" (buf));
+		__asm__ __volatile__(
+			"ldr%?h	%2, [%0], #4\n\t"
+			"str%?b	%2, [%1], #1\n\t"
+			"mov%?	%2, %2, lsr #8\n\t"
+			"str%?b	%2, [%1], #1"
+		: "=&r" (offset), "=&r" (buf), "=r" (tmp): "0" (offset), "1" (buf));
 		length -= 2;
 	}
 	while (length > 8) {
 		unsigned int tmp, tmp2, tmp3;
-		__asm__ __volatile__("
-			ldr%?h	%2, [%0], #4
-			ldr%?h	%3, [%0], #4
-			orr%?	%2, %2, %3, lsl #16
-			ldr%?h	%3, [%0], #4
-			ldr%?h	%4, [%0], #4
-			orr%?	%3, %3, %4, lsl #16
-			stm%?ia	%1!, {%2, %3}
-		" : "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2), "=r" (tmp3)
-		  : "0" (offset), "1" (buf));
+		__asm__ __volatile__(
+			"ldr%?h	%2, [%0], #4\n\t"
+			"ldr%?h	%3, [%0], #4\n\t"
+			"orr%?	%2, %2, %3, lsl #16\n\t"
+			"ldr%?h	%3, [%0], #4\n\t"
+			"ldr%?h	%4, [%0], #4\n\t"
+			"orr%?	%3, %3, %4, lsl #16\n\t"
+			"stm%?ia	%1!, {%2, %3}"
+		: "=&r" (offset), "=&r" (buf), "=r" (tmp), "=r" (tmp2), "=r" (tmp3)
+		: "0" (offset), "1" (buf));
 		length -= 8;
 	}
 	while (length > 0) {
 		unsigned int tmp;
-		__asm__ __volatile__("
-			ldr%?h	%2, [%0], #4
-			str%?b	%2, [%1], #1
-			mov%?	%2, %2, lsr #8
-			str%?b	%2, [%1], #1
-		" : "=&r" (offset), "=&r" (buf), "=r" (tmp) : "0" (offset), "1" (buf));
+		__asm__ __volatile__(
+			"ldr%?h	%2, [%0], #4\n\t"
+			"str%?b	%2, [%1], #1\n\t"
+			"mov%?	%2, %2, lsr #8\n\t"
+			"str%?b	%2, [%1], #1"
+		: "=&r" (offset), "=&r" (buf), "=r" (tmp) : "0" (offset), "1" (buf));
 		length -= 2;
 	}
 }
@@ -618,6 +624,7 @@ am79c961_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 		if (status & CSR0_CERR) {
 			handled = 1;
 			mod_timer(&priv->timer, jiffies);
+		}
 	} while (--n && status & (CSR0_RINT | CSR0_TINT));
 
 	return IRQ_RETVAL(handled);
diff --git a/drivers/net/arm/ether00.c b/drivers/net/arm/ether00.c
index 87917571e..4f1f4e31b 100644
--- a/drivers/net/arm/ether00.c
+++ b/drivers/net/arm/ether00.c
@@ -21,7 +21,6 @@
 /* includes */
 #include <linux/config.h>
 #include <linux/pci.h>
-#include <linux/netdevice.h>
 #include <linux/sched.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 7543bfbac..9981968a8 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -242,7 +242,7 @@ static void cleanup_card(struct net_device *dev)
 {
 #ifdef CONFIG_MCA	
 	struct net_local *lp = netdev_priv(dev);
-	if (lp->mca_slot)
+	if (lp->mca_slot >= 0)
 		mca_mark_as_unused(lp->mca_slot);
 #endif	
 	free_irq(dev->irq, NULL);
@@ -444,11 +444,11 @@ found:
 					break;
 			}
 			if (i == 8) {
-				goto err_out;
+				goto err_mca;
 			}
 		} else {
 			if (fmv18x_probe_list[inb(ioaddr + IOCONFIG) & 0x07] != ioaddr)
-				goto err_out;
+				goto err_mca;
 			irq = fmv_irqmap[(inb(ioaddr + IOCONFIG)>>6) & 0x03];
 		}
 	}
@@ -546,11 +546,16 @@ found:
 	if (ret) {
 		printk ("  AT1700 at %#3x is unusable due to a conflict on"
 				"IRQ %d.\n", ioaddr, irq);
-		goto err_out;
+		goto err_mca;
 	}
 
 	return 0;
 
+err_mca:
+#ifdef CONFIG_MCA
+	if (slot >= 0)
+		mca_mark_as_unused(slot);
+#endif
 err_out:
 #ifndef CONFIG_X86_PC9800
 	release_region(ioaddr, AT1700_IO_EXTENT);
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 2bd0ac959..afcdcffc7 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -1269,7 +1269,7 @@ static void set_rx_mode(struct net_device *dev)
 
 static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	u16 *data = (u16 *)&rq->ifr_data;
+	u16 *data = (u16 *)&rq->ifr_ifru;
 
 	/* fixme */
 	switch(cmd) { 
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 01c18e5aa..ba1d4fc9a 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -27,8 +27,8 @@
 
 #define DRV_MODULE_NAME		"b44"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"0.93"
-#define DRV_MODULE_RELDATE	"Mar, 2004"
+#define DRV_MODULE_VERSION	"0.94"
+#define DRV_MODULE_RELDATE	"May 4, 2004"
 
 #define B44_DEF_MSG_ENABLE	  \
 	(NETIF_MSG_DRV		| \
@@ -96,7 +96,7 @@ MODULE_DEVICE_TABLE(pci, b44_pci_tbl);
 
 static void b44_halt(struct b44 *);
 static void b44_init_rings(struct b44 *);
-static int b44_init_hw(struct b44 *);
+static void b44_init_hw(struct b44 *);
 
 static int b44_wait_bit(struct b44 *bp, unsigned long reg,
 			u32 bit, unsigned long timeout, const int clear)
@@ -331,6 +331,29 @@ static int b44_writephy(struct b44 *bp, int reg, u32 val)
 	return b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
 }
 
+/* miilib interface */
+/* FIXME FIXME: phy_id is ignored, bp->phy_addr use is unconditional
+ * due to code existing before miilib use was added to this driver.
+ * Someone should remove this artificial driver limitation in
+ * b44_{read,write}phy.  bp->phy_addr itself is fine (and needed).
+ */
+static int b44_mii_read(struct net_device *dev, int phy_id, int location)
+{
+	u32 val;
+	struct b44 *bp = netdev_priv(dev);
+	int rc = b44_readphy(bp, location, &val);
+	if (rc)
+		return 0xffffffff;
+	return val;
+}
+
+static void b44_mii_write(struct net_device *dev, int phy_id, int location,
+			 int val)
+{
+	struct b44 *bp = netdev_priv(dev);
+	b44_writephy(bp, location, val);
+}
+
 static int b44_phy_reset(struct b44 *bp)
 {
 	u32 val;
@@ -771,7 +794,7 @@ static int b44_rx(struct b44 *bp, int budget)
 
 static int b44_poll(struct net_device *netdev, int *budget)
 {
-	struct b44 *bp = netdev->priv;
+	struct b44 *bp = netdev_priv(netdev);
 	int done;
 
 	spin_lock_irq(&bp->lock);
@@ -821,7 +844,7 @@ static int b44_poll(struct net_device *netdev, int *budget)
 static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 	unsigned long flags;
 	u32 istat, imask;
 	int handled = 0;
@@ -858,7 +881,7 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static void b44_tx_timeout(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 
 	printk(KERN_ERR PFX "%s: transmit timed out, resetting\n",
 	       dev->name);
@@ -878,7 +901,7 @@ static void b44_tx_timeout(struct net_device *dev)
 
 static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 	dma_addr_t mapping;
 	u32 len, entry, ctrl;
 
@@ -932,7 +955,7 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 static int b44_change_mtu(struct net_device *dev, int new_mtu)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 
 	if (new_mtu < B44_MIN_MTU || new_mtu > B44_MAX_MTU)
 		return -EINVAL;
@@ -1161,7 +1184,7 @@ static void __b44_set_mac_addr(struct b44 *bp)
 
 static int b44_set_mac_addr(struct net_device *dev, void *p)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 	struct sockaddr *addr = p;
 
 	if (netif_running(dev))
@@ -1180,15 +1203,16 @@ static int b44_set_mac_addr(struct net_device *dev, void *p)
  * packet processing.  Invoked with bp->lock held.
  */
 static void __b44_set_rx_mode(struct net_device *);
-static int b44_init_hw(struct b44 *bp)
+static void b44_init_hw(struct b44 *bp)
 {
 	u32 val;
 
 	b44_chip_reset(bp);
 	b44_phy_reset(bp);
 	b44_setup_phy(bp);
-	val = br32(B44_MAC_CTRL);
-	bw32(B44_MAC_CTRL, val | MAC_CTRL_CRC32_ENAB);
+
+	/* Enable CRC32, set proper LED modes and power on PHY */
+	bw32(B44_MAC_CTRL, MAC_CTRL_CRC32_ENAB | MAC_CTRL_PHY_LEDCTRL);
 	bw32(B44_RCV_LAZY, (1 << RCV_LAZY_FC_SHIFT));
 
 	/* This sets the MAC address too.  */
@@ -1212,13 +1236,11 @@ static int b44_init_hw(struct b44 *bp)
 
 	val = br32(B44_ENET_CTRL);
 	bw32(B44_ENET_CTRL, (val | ENET_CTRL_ENABLE));
-
-	return 0;
 }
 
 static int b44_open(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 	int err;
 
 	err = b44_alloc_consistent(bp);
@@ -1232,9 +1254,7 @@ static int b44_open(struct net_device *dev)
 	spin_lock_irq(&bp->lock);
 
 	b44_init_rings(bp);
-	err = b44_init_hw(bp);
-	if (err)
-		goto err_out_noinit;
+	b44_init_hw(bp);
 	bp->flags |= B44_FLAG_INIT_COMPLETE;
 
 	spin_unlock_irq(&bp->lock);
@@ -1249,11 +1269,6 @@ static int b44_open(struct net_device *dev)
 
 	return 0;
 
-err_out_noinit:
-	b44_halt(bp);
-	b44_free_rings(bp);
-	spin_unlock_irq(&bp->lock);
-	free_irq(dev->irq, dev);
 err_out_free:
 	b44_free_consistent(bp);
 	return err;
@@ -1273,7 +1288,7 @@ err_out_free:
 
 static int b44_close(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 
 	netif_stop_queue(dev);
 
@@ -1300,7 +1315,7 @@ static int b44_close(struct net_device *dev)
 
 static struct net_device_stats *b44_get_stats(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 	struct net_device_stats *nstat = &bp->stats;
 	struct b44_hw_stats *hwstat = &bp->hw_stats;
 
@@ -1337,7 +1352,7 @@ static struct net_device_stats *b44_get_stats(struct net_device *dev)
 	return nstat;
 }
 
-static void __b44_load_mcast(struct b44 *bp, struct net_device *dev)
+static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
 {
 	struct dev_mc_list *mclist;
 	int i, num_ents;
@@ -1347,12 +1362,15 @@ static void __b44_load_mcast(struct b44 *bp, struct net_device *dev)
 	for (i = 0; mclist && i < num_ents; i++, mclist = mclist->next) {
 		__b44_cam_write(bp, mclist->dmi_addr, i + 1);
 	}
+	return i+1;
 }
 
 static void __b44_set_rx_mode(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 	u32 val;
+	int i=0;
+	unsigned char zero[6] = {0,0,0,0,0,0};
 
 	val = br32(B44_RXCONFIG);
 	val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI);
@@ -1365,8 +1383,11 @@ static void __b44_set_rx_mode(struct net_device *dev)
 		if (dev->flags & IFF_ALLMULTI)
 			val |= RXCONFIG_ALLMULTI;
 		else
-			__b44_load_mcast(bp, dev);
-
+			i=__b44_load_mcast(bp, dev);
+		
+		for(;i<64;i++) {
+			__b44_cam_write(bp, zero, i);			
+		}
 		bw32(B44_RXCONFIG, val);
         	val = br32(B44_CAM_CTRL);
 	        bw32(B44_CAM_CTRL, val | CAM_CTRL_ENABLE);
@@ -1375,295 +1396,252 @@ static void __b44_set_rx_mode(struct net_device *dev)
 
 static void b44_set_rx_mode(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
 
 	spin_lock_irq(&bp->lock);
 	__b44_set_rx_mode(dev);
 	spin_unlock_irq(&bp->lock);
 }
 
-static int b44_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
+static u32 b44_get_msglevel(struct net_device *dev)
 {
-	struct b44 *bp = dev->priv;
+	struct b44 *bp = netdev_priv(dev);
+	return bp->msg_enable;
+}
+
+static void b44_set_msglevel(struct net_device *dev, u32 value)
+{
+	struct b44 *bp = netdev_priv(dev);
+	bp->msg_enable = value;
+}
+
+static void b44_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
+{
+	struct b44 *bp = netdev_priv(dev);
 	struct pci_dev *pci_dev = bp->pdev;
-	u32 ethcmd;
-
-	if (copy_from_user (&ethcmd, useraddr, sizeof (ethcmd)))
-		return -EFAULT;
-
-	switch (ethcmd) {
-	case ETHTOOL_GDRVINFO:{
-		struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
-		strcpy (info.driver, DRV_MODULE_NAME);
-		strcpy (info.version, DRV_MODULE_VERSION);
-		memset(&info.fw_version, 0, sizeof(info.fw_version));
-		strcpy (info.bus_info, pci_name(pci_dev));
-		info.eedump_len = 0;
-		info.regdump_len = 0;
-		if (copy_to_user (useraddr, &info, sizeof (info)))
-			return -EFAULT;
-		return 0;
-	}
 
-	case ETHTOOL_GSET: {
-		struct ethtool_cmd cmd = { ETHTOOL_GSET };
+	strcpy (info->driver, DRV_MODULE_NAME);
+	strcpy (info->version, DRV_MODULE_VERSION);
+	strcpy (info->bus_info, pci_name(pci_dev));
+}
 
-		if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
-			return -EAGAIN;
-		cmd.supported = (SUPPORTED_Autoneg);
-		cmd.supported |= (SUPPORTED_100baseT_Half |
-				  SUPPORTED_100baseT_Full |
-				  SUPPORTED_10baseT_Half |
-				  SUPPORTED_10baseT_Full |
-				  SUPPORTED_MII);
+static int b44_nway_reset(struct net_device *dev)
+{
+	struct b44 *bp = netdev_priv(dev);
+	u32 bmcr;
+	int r;
 
-		cmd.advertising = 0;
-		if (bp->flags & B44_FLAG_ADV_10HALF)
-			cmd.advertising |= ADVERTISE_10HALF;
-		if (bp->flags & B44_FLAG_ADV_10FULL)
-			cmd.advertising |= ADVERTISE_10FULL;
-		if (bp->flags & B44_FLAG_ADV_100HALF)
-			cmd.advertising |= ADVERTISE_100HALF;
-		if (bp->flags & B44_FLAG_ADV_100FULL)
-			cmd.advertising |= ADVERTISE_100FULL;
-		cmd.advertising |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
-		cmd.speed = (bp->flags & B44_FLAG_100_BASE_T) ?
-			SPEED_100 : SPEED_10;
-		cmd.duplex = (bp->flags & B44_FLAG_FULL_DUPLEX) ?
-			DUPLEX_FULL : DUPLEX_HALF;
-		cmd.port = 0;
-		cmd.phy_address = bp->phy_addr;
-		cmd.transceiver = (bp->flags & B44_FLAG_INTERNAL_PHY) ?
-			XCVR_INTERNAL : XCVR_EXTERNAL;
-		cmd.autoneg = (bp->flags & B44_FLAG_FORCE_LINK) ?
-			AUTONEG_DISABLE : AUTONEG_ENABLE;
-		cmd.maxtxpkt = 0;
-		cmd.maxrxpkt = 0;
-		if (copy_to_user(useraddr, &cmd, sizeof(cmd)))
-			return -EFAULT;
-		return 0;
+	spin_lock_irq(&bp->lock);
+	b44_readphy(bp, MII_BMCR, &bmcr);
+	b44_readphy(bp, MII_BMCR, &bmcr);
+	r = -EINVAL;
+	if (bmcr & BMCR_ANENABLE) {
+		b44_writephy(bp, MII_BMCR,
+			     bmcr | BMCR_ANRESTART);
+		r = 0;
 	}
-	case ETHTOOL_SSET: {
-		struct ethtool_cmd cmd;
-
-		if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
-			return -EAGAIN;
-
-		if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
-			return -EFAULT;
-
-		/* We do not support gigabit. */
-		if (cmd.autoneg == AUTONEG_ENABLE) {
-			if (cmd.advertising &
-			    (ADVERTISED_1000baseT_Half |
-			     ADVERTISED_1000baseT_Full))
-				return -EINVAL;
-		} else if ((cmd.speed != SPEED_100 &&
-			    cmd.speed != SPEED_10) ||
-			   (cmd.duplex != DUPLEX_HALF &&
-			    cmd.duplex != DUPLEX_FULL)) {
-				return -EINVAL;
-		}
-
-		spin_lock_irq(&bp->lock);
+	spin_unlock_irq(&bp->lock);
 
-		if (cmd.autoneg == AUTONEG_ENABLE) {
-			bp->flags &= ~B44_FLAG_FORCE_LINK;
-			bp->flags &= ~(B44_FLAG_ADV_10HALF |
-				       B44_FLAG_ADV_10FULL |
-				       B44_FLAG_ADV_100HALF |
-				       B44_FLAG_ADV_100FULL);
-			if (cmd.advertising & ADVERTISE_10HALF)
-				bp->flags |= B44_FLAG_ADV_10HALF;
-			if (cmd.advertising & ADVERTISE_10FULL)
-				bp->flags |= B44_FLAG_ADV_10FULL;
-			if (cmd.advertising & ADVERTISE_100HALF)
-				bp->flags |= B44_FLAG_ADV_100HALF;
-			if (cmd.advertising & ADVERTISE_100FULL)
-				bp->flags |= B44_FLAG_ADV_100FULL;
-		} else {
-			bp->flags |= B44_FLAG_FORCE_LINK;
-			if (cmd.speed == SPEED_100)
-				bp->flags |= B44_FLAG_100_BASE_T;
-			if (cmd.duplex == DUPLEX_FULL)
-				bp->flags |= B44_FLAG_FULL_DUPLEX;
-		}
+	return r;
+}
 
-		b44_setup_phy(bp);
+static int b44_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+	struct b44 *bp = netdev_priv(dev);
+
+	if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
+		return -EAGAIN;
+	cmd->supported = (SUPPORTED_Autoneg);
+	cmd->supported |= (SUPPORTED_100baseT_Half |
+			  SUPPORTED_100baseT_Full |
+			  SUPPORTED_10baseT_Half |
+			  SUPPORTED_10baseT_Full |
+			  SUPPORTED_MII);
+
+	cmd->advertising = 0;
+	if (bp->flags & B44_FLAG_ADV_10HALF)
+		cmd->advertising |= ADVERTISE_10HALF;
+	if (bp->flags & B44_FLAG_ADV_10FULL)
+		cmd->advertising |= ADVERTISE_10FULL;
+	if (bp->flags & B44_FLAG_ADV_100HALF)
+		cmd->advertising |= ADVERTISE_100HALF;
+	if (bp->flags & B44_FLAG_ADV_100FULL)
+		cmd->advertising |= ADVERTISE_100FULL;
+	cmd->advertising |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
+	cmd->speed = (bp->flags & B44_FLAG_100_BASE_T) ?
+		SPEED_100 : SPEED_10;
+	cmd->duplex = (bp->flags & B44_FLAG_FULL_DUPLEX) ?
+		DUPLEX_FULL : DUPLEX_HALF;
+	cmd->port = 0;
+	cmd->phy_address = bp->phy_addr;
+	cmd->transceiver = (bp->flags & B44_FLAG_INTERNAL_PHY) ?
+		XCVR_INTERNAL : XCVR_EXTERNAL;
+	cmd->autoneg = (bp->flags & B44_FLAG_FORCE_LINK) ?
+		AUTONEG_DISABLE : AUTONEG_ENABLE;
+	cmd->maxtxpkt = 0;
+	cmd->maxrxpkt = 0;
+	return 0;
+}
 
-		spin_unlock_irq(&bp->lock);
+static int b44_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+	struct b44 *bp = netdev_priv(dev);
 
-		return 0;
-	}
+	if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
+		return -EAGAIN;
 
-	case ETHTOOL_GMSGLVL: {
-		struct ethtool_value edata = { ETHTOOL_GMSGLVL };
-		edata.data = bp->msg_enable;
-		if (copy_to_user(useraddr, &edata, sizeof(edata)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SMSGLVL: {
-		struct ethtool_value edata;
-		if (copy_from_user(&edata, useraddr, sizeof(edata)))
-			return -EFAULT;
-		bp->msg_enable = edata.data;
-		return 0;
+	/* We do not support gigabit. */
+	if (cmd->autoneg == AUTONEG_ENABLE) {
+		if (cmd->advertising &
+		    (ADVERTISED_1000baseT_Half |
+		     ADVERTISED_1000baseT_Full))
+			return -EINVAL;
+	} else if ((cmd->speed != SPEED_100 &&
+		    cmd->speed != SPEED_10) ||
+		   (cmd->duplex != DUPLEX_HALF &&
+		    cmd->duplex != DUPLEX_FULL)) {
+			return -EINVAL;
 	}
-	case ETHTOOL_NWAY_RST: {
-		u32 bmcr;
-		int r;
 
-		spin_lock_irq(&bp->lock);
-		b44_readphy(bp, MII_BMCR, &bmcr);
-		b44_readphy(bp, MII_BMCR, &bmcr);
-		r = -EINVAL;
-		if (bmcr & BMCR_ANENABLE) {
-			b44_writephy(bp, MII_BMCR,
-				     bmcr | BMCR_ANRESTART);
-			r = 0;
-		}
-		spin_unlock_irq(&bp->lock);
+	spin_lock_irq(&bp->lock);
 
-		return r;
-	}
-	case ETHTOOL_GLINK: {
-		struct ethtool_value edata = { ETHTOOL_GLINK };
-		edata.data = netif_carrier_ok(bp->dev) ? 1 : 0;
-		if (copy_to_user(useraddr, &edata, sizeof(edata)))
-			return -EFAULT;
-		return 0;
+	if (cmd->autoneg == AUTONEG_ENABLE) {
+		bp->flags &= ~B44_FLAG_FORCE_LINK;
+		bp->flags &= ~(B44_FLAG_ADV_10HALF |
+			       B44_FLAG_ADV_10FULL |
+			       B44_FLAG_ADV_100HALF |
+			       B44_FLAG_ADV_100FULL);
+		if (cmd->advertising & ADVERTISE_10HALF)
+			bp->flags |= B44_FLAG_ADV_10HALF;
+		if (cmd->advertising & ADVERTISE_10FULL)
+			bp->flags |= B44_FLAG_ADV_10FULL;
+		if (cmd->advertising & ADVERTISE_100HALF)
+			bp->flags |= B44_FLAG_ADV_100HALF;
+		if (cmd->advertising & ADVERTISE_100FULL)
+			bp->flags |= B44_FLAG_ADV_100FULL;
+	} else {
+		bp->flags |= B44_FLAG_FORCE_LINK;
+		if (cmd->speed == SPEED_100)
+			bp->flags |= B44_FLAG_100_BASE_T;
+		if (cmd->duplex == DUPLEX_FULL)
+			bp->flags |= B44_FLAG_FULL_DUPLEX;
 	}
-	case ETHTOOL_GRINGPARAM: {
-		struct ethtool_ringparam ering = { ETHTOOL_GRINGPARAM };
 
-		ering.rx_max_pending = B44_RX_RING_SIZE - 1;
-		ering.rx_pending = bp->rx_pending;
-
-		/* XXX ethtool lacks a tx_max_pending, oops... */
+	b44_setup_phy(bp);
 
-		if (copy_to_user(useraddr, &ering, sizeof(ering)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SRINGPARAM: {
-		struct ethtool_ringparam ering;
+	spin_unlock_irq(&bp->lock);
 
-		if (copy_from_user(&ering, useraddr, sizeof(ering)))
-			return -EFAULT;
+	return 0;
+}
 
-		if ((ering.rx_pending > B44_RX_RING_SIZE - 1) ||
-		    (ering.rx_mini_pending != 0) ||
-		    (ering.rx_jumbo_pending != 0) ||
-		    (ering.tx_pending > B44_TX_RING_SIZE - 1))
-			return -EINVAL;
+static void b44_get_ringparam(struct net_device *dev,
+			      struct ethtool_ringparam *ering)
+{
+	struct b44 *bp = netdev_priv(dev);
 
-		spin_lock_irq(&bp->lock);
+	ering->rx_max_pending = B44_RX_RING_SIZE - 1;
+	ering->rx_pending = bp->rx_pending;
 
-		bp->rx_pending = ering.rx_pending;
-		bp->tx_pending = ering.tx_pending;
+	/* XXX ethtool lacks a tx_max_pending, oops... */
+}
 
-		b44_halt(bp);
-		b44_init_rings(bp);
-		b44_init_hw(bp);
-		netif_wake_queue(bp->dev);
-		spin_unlock_irq(&bp->lock);
+static int b44_set_ringparam(struct net_device *dev,
+			     struct ethtool_ringparam *ering)
+{
+	struct b44 *bp = netdev_priv(dev);
 
-		b44_enable_ints(bp);
-		
-		return 0;
-	}
-	case ETHTOOL_GPAUSEPARAM: {
-		struct ethtool_pauseparam epause = { ETHTOOL_GPAUSEPARAM };
-
-		epause.autoneg =
-			(bp->flags & B44_FLAG_PAUSE_AUTO) != 0;
-		epause.rx_pause =
-			(bp->flags & B44_FLAG_RX_PAUSE) != 0;
-		epause.tx_pause =
-			(bp->flags & B44_FLAG_TX_PAUSE) != 0;
-		if (copy_to_user(useraddr, &epause, sizeof(epause)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SPAUSEPARAM: {
-		struct ethtool_pauseparam epause;
+	if ((ering->rx_pending > B44_RX_RING_SIZE - 1) ||
+	    (ering->rx_mini_pending != 0) ||
+	    (ering->rx_jumbo_pending != 0) ||
+	    (ering->tx_pending > B44_TX_RING_SIZE - 1))
+		return -EINVAL;
 
-		if (copy_from_user(&epause, useraddr, sizeof(epause)))
-			return -EFAULT;
+	spin_lock_irq(&bp->lock);
 
-		spin_lock_irq(&bp->lock);
-		if (epause.autoneg)
-			bp->flags |= B44_FLAG_PAUSE_AUTO;
-		else
-			bp->flags &= ~B44_FLAG_PAUSE_AUTO;
-		if (epause.rx_pause)
-			bp->flags |= B44_FLAG_RX_PAUSE;
-		else
-			bp->flags &= ~B44_FLAG_RX_PAUSE;
-		if (epause.tx_pause)
-			bp->flags |= B44_FLAG_TX_PAUSE;
-		else
-			bp->flags &= ~B44_FLAG_TX_PAUSE;
-		if (bp->flags & B44_FLAG_PAUSE_AUTO) {
-			b44_halt(bp);
-			b44_init_rings(bp);
-			b44_init_hw(bp);
-		} else {
-			__b44_set_flow_ctrl(bp, bp->flags);
-		}
-		spin_unlock_irq(&bp->lock);
+	bp->rx_pending = ering->rx_pending;
+	bp->tx_pending = ering->tx_pending;
 
-		b44_enable_ints(bp);
-		
-		return 0;
-	}
-	};
+	b44_halt(bp);
+	b44_init_rings(bp);
+	b44_init_hw(bp);
+	netif_wake_queue(bp->dev);
+	spin_unlock_irq(&bp->lock);
 
-	return -EOPNOTSUPP;
+	b44_enable_ints(bp);
+	
+	return 0;
 }
 
-static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+static void b44_get_pauseparam(struct net_device *dev,
+				struct ethtool_pauseparam *epause)
 {
-	struct mii_ioctl_data __user *data = (struct mii_ioctl_data __user *)&ifr->ifr_data;
-	struct b44 *bp = dev->priv;
-	int err;
-
-	switch (cmd) {
-	case SIOCETHTOOL:
-		return b44_ethtool_ioctl(dev, (void __user*) ifr->ifr_data);
-
-	case SIOCGMIIPHY:
-		data->phy_id = bp->phy_addr;
-
-		/* fallthru */
-	case SIOCGMIIREG: {
-		u32 mii_regval;
-
-		spin_lock_irq(&bp->lock);
-		err = b44_readphy(bp, data->reg_num & 0x1f, &mii_regval);
-		spin_unlock_irq(&bp->lock);
+	struct b44 *bp = netdev_priv(dev);
+
+	epause->autoneg =
+		(bp->flags & B44_FLAG_PAUSE_AUTO) != 0;
+	epause->rx_pause =
+		(bp->flags & B44_FLAG_RX_PAUSE) != 0;
+	epause->tx_pause =
+		(bp->flags & B44_FLAG_TX_PAUSE) != 0;
+}
 
-		data->val_out = mii_regval;
+static int b44_set_pauseparam(struct net_device *dev,
+				struct ethtool_pauseparam *epause)
+{
+	struct b44 *bp = netdev_priv(dev);
 
-		return err;
+	spin_lock_irq(&bp->lock);
+	if (epause->autoneg)
+		bp->flags |= B44_FLAG_PAUSE_AUTO;
+	else
+		bp->flags &= ~B44_FLAG_PAUSE_AUTO;
+	if (epause->rx_pause)
+		bp->flags |= B44_FLAG_RX_PAUSE;
+	else
+		bp->flags &= ~B44_FLAG_RX_PAUSE;
+	if (epause->tx_pause)
+		bp->flags |= B44_FLAG_TX_PAUSE;
+	else
+		bp->flags &= ~B44_FLAG_TX_PAUSE;
+	if (bp->flags & B44_FLAG_PAUSE_AUTO) {
+		b44_halt(bp);
+		b44_init_rings(bp);
+		b44_init_hw(bp);
+	} else {
+		__b44_set_flow_ctrl(bp, bp->flags);
 	}
+	spin_unlock_irq(&bp->lock);
 
-	case SIOCSMIIREG:
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+	b44_enable_ints(bp);
+	
+	return 0;
+}
 
-		spin_lock_irq(&bp->lock);
-		err = b44_writephy(bp, data->reg_num & 0x1f, data->val_in);
-		spin_unlock_irq(&bp->lock);
+static struct ethtool_ops b44_ethtool_ops = {
+	.get_drvinfo		= b44_get_drvinfo,
+	.get_settings		= b44_get_settings,
+	.set_settings		= b44_set_settings,
+	.nway_reset		= b44_nway_reset,
+	.get_link		= ethtool_op_get_link,
+	.get_ringparam		= b44_get_ringparam,
+	.set_ringparam		= b44_set_ringparam,
+	.get_pauseparam		= b44_get_pauseparam,
+	.set_pauseparam		= b44_set_pauseparam,
+	.get_msglevel		= b44_get_msglevel,
+	.set_msglevel		= b44_set_msglevel,
+};
 
-		return err;
+static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	struct mii_ioctl_data *data = if_mii(ifr);
+	struct b44 *bp = netdev_priv(dev);
+	int err;
 
-	default:
-		/* do nothing */
-		break;
-	};
-	return -EOPNOTSUPP;
+	spin_lock_irq(&bp->lock);
+	err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
+	spin_unlock_irq(&bp->lock);
+
+	return err;
 }
 
 /* Read 128-bytes of EEPROM. */
@@ -1772,7 +1750,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
 	/* No interesting netdevice features in this card... */
 	dev->features |= 0;
 
-	bp = dev->priv;
+	bp = netdev_priv(dev);
 	bp->pdev = pdev;
 	bp->dev = dev;
 	if (b44_debug >= 0)
@@ -1806,6 +1784,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
 	dev->watchdog_timeo = B44_TX_TIMEOUT;
 	dev->change_mtu = b44_change_mtu;
 	dev->irq = pdev->irq;
+	SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
 
 	err = b44_get_invariants(bp);
 	if (err) {
@@ -1814,6 +1793,13 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
 		goto err_out_iounmap;
 	}
 
+	bp->mii_if.dev = dev;
+	bp->mii_if.mdio_read = b44_mii_read;
+	bp->mii_if.mdio_write = b44_mii_write;
+	bp->mii_if.phy_id = bp->phy_addr;
+	bp->mii_if.phy_id_mask = 0x1f;
+	bp->mii_if.reg_num_mask = 0x1f;
+
 	/* By default, advertise all speed/duplex settings. */
 	bp->flags |= (B44_FLAG_ADV_10HALF | B44_FLAG_ADV_10FULL |
 		      B44_FLAG_ADV_100HALF | B44_FLAG_ADV_100FULL);
@@ -1859,8 +1845,10 @@ static void __devexit b44_remove_one(struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata(pdev);
 
 	if (dev) {
+		struct b44 *bp = netdev_priv(dev);
+
 		unregister_netdev(dev);
-		iounmap((void *) ((struct b44 *)(dev->priv))->regs);
+		iounmap((void *) bp->regs);
 		free_netdev(dev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
@@ -1894,11 +1882,11 @@ static int b44_resume(struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct b44 *bp = dev->priv;
 
+	pci_restore_state(pdev, bp->pci_cfg_state);
+
 	if (!netif_running(dev))
 		return 0;
 
-	pci_restore_state(pdev, bp->pci_cfg_state);
-
 	spin_lock_irq(&bp->lock);
 
 	b44_init_rings(bp);
diff --git a/drivers/net/b44.h b/drivers/net/b44.h
index 9c9d4f8ba..23bee93fe 100644
--- a/drivers/net/b44.h
+++ b/drivers/net/b44.h
@@ -542,6 +542,8 @@ struct b44 {
 	u8			phy_addr;
 	u8			mdc_port;
 	u8			core_unit;
+
+	struct mii_if_info	mii_if;
 };
 
 #endif /* _B44_H */
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 778fd0754..6e57c1434 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1103,7 +1103,7 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
 
 		/* Yes, the mii is overlaid on the ifreq.ifr_ifru */
 		strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
-		mii = (struct mii_ioctl_data *)&ifr.ifr_data;
+		mii = if_mii(&ifr);
 		if (IOCTL(slave_dev, &ifr, SIOCGMIIPHY) == 0) {
 			mii->reg_num = MII_BMSR;
 			if (IOCTL(slave_dev, &ifr, SIOCGMIIREG) == 0) {
@@ -2357,10 +2357,10 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
 static int bond_ethtool_ioctl(struct net_device *bond_dev, struct ifreq *ifr)
 {
 	struct ethtool_drvinfo info;
-	void *addr = ifr->ifr_data;
+	void __user *addr = ifr->ifr_data;
 	uint32_t cmd;
 
-	if (get_user(cmd, (uint32_t *)addr)) {
+	if (get_user(cmd, (uint32_t __user *)addr)) {
 		return -EFAULT;
 	}
 
@@ -3667,8 +3667,10 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
 static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
 {
 	struct net_device *slave_dev = NULL;
-	struct ifbond *u_binfo = NULL, k_binfo;
-	struct ifslave *u_sinfo = NULL, k_sinfo;
+	struct ifbond k_binfo;
+	struct ifbond __user *u_binfo = NULL;
+	struct ifslave k_sinfo;
+	struct ifslave __user *u_sinfo = NULL;
 	struct mii_ioctl_data *mii = NULL;
 	int prev_abi_ver = orig_app_abi_ver;
 	int res = 0;
@@ -3680,7 +3682,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
 	case SIOCETHTOOL:
 		return bond_ethtool_ioctl(bond_dev, ifr);
 	case SIOCGMIIPHY:
-		mii = (struct mii_ioctl_data *)&ifr->ifr_data;
+		mii = if_mii(ifr);
 		if (!mii) {
 			return -EINVAL;
 		}
@@ -3691,7 +3693,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
 		 * We do this again just in case we were called by SIOCGMIIREG
 		 * instead of SIOCGMIIPHY.
 		 */
-		mii = (struct mii_ioctl_data *)&ifr->ifr_data;
+		mii = if_mii(ifr);
 		if (!mii) {
 			return -EINVAL;
 		}
@@ -3711,7 +3713,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
 		return 0;
 	case BOND_INFO_QUERY_OLD:
 	case SIOCBONDINFOQUERY:
-		u_binfo = (struct ifbond *)ifr->ifr_data;
+		u_binfo = (struct ifbond __user *)ifr->ifr_data;
 
 		if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond))) {
 			return -EFAULT;
@@ -3727,7 +3729,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
 		return res;
 	case BOND_SLAVE_INFO_QUERY_OLD:
 	case SIOCBONDSLAVEINFOQUERY:
-		u_sinfo = (struct ifslave *)ifr->ifr_data;
+		u_sinfo = (struct ifslave __user *)ifr->ifr_data;
 
 		if (copy_from_user(&k_sinfo, u_sinfo, sizeof(ifslave))) {
 			return -EFAULT;
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 80e8617dc..5d62a032b 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1937,7 +1937,7 @@ static void depca_dbg_open(struct net_device *dev)
 static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct depca_private *lp = (struct depca_private *) dev->priv;
-	struct depca_ioctl *ioc = (struct depca_ioctl *) &rq->ifr_data;
+	struct depca_ioctl *ioc = (struct depca_ioctl *) &rq->ifr_ifru;
 	int i, status = 0;
 	u_long ioaddr = dev->base_addr;
 	union {
diff --git a/drivers/net/depca.h b/drivers/net/depca.h
index 2fa155843..11785275a 100644
--- a/drivers/net/depca.h
+++ b/drivers/net/depca.h
@@ -162,7 +162,7 @@
 struct depca_ioctl {
 	unsigned short cmd;                /* Command to run */
 	unsigned short len;                /* Length of the data buffer */
-	unsigned char  *data;              /* Pointer to the data buffer */
+	unsigned char  __user *data;       /* Pointer to the data buffer */
 };
 
 /* 
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 4673bd829..39cabaf80 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -107,7 +107,7 @@ static int change_mtu (struct net_device *dev, int new_mtu);
 static void set_multicast (struct net_device *dev);
 static struct net_device_stats *get_stats (struct net_device *dev);
 static int clear_stats (struct net_device *dev);
-static int rio_ethtool_ioctl (struct net_device *dev, void *useraddr);
+static int rio_ethtool_ioctl (struct net_device *dev, void __user *useraddr);
 static int rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
 static int rio_close (struct net_device *dev);
 static int find_miiphy (struct net_device *dev);
@@ -1195,7 +1195,7 @@ set_multicast (struct net_device *dev)
 }
 
 static int
-rio_ethtool_ioctl (struct net_device *dev, void *useraddr)
+rio_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
 {
 	struct netdev_private *np = dev->priv;
        	u32 ethcmd;
@@ -1325,7 +1325,7 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	int phy_addr;
 	struct netdev_private *np = dev->priv;
-	struct mii_data *miidata = (struct mii_data *) &rq->ifr_data;
+	struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru;
 	
 	struct netdev_desc *desc;
 	int i;
@@ -1333,7 +1333,7 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 	phy_addr = np->phy_addr;
 	switch (cmd) {
 	case SIOCETHTOOL:
-		return rio_ethtool_ioctl (dev, (void *) rq->ifr_data);		
+		return rio_ethtool_ioctl(dev, rq->ifr_data);		
 	case SIOCDEVPRIVATE:
 		break;
 	
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index a98e84391..8855b20e3 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -158,7 +158,7 @@
 
 
 #define DRV_NAME		"e100"
-#define DRV_VERSION		"3.0.17"
+#define DRV_VERSION		"3.0.18"
 #define DRV_DESCRIPTION		"Intel(R) PRO/100 Network Driver"
 #define DRV_COPYRIGHT		"Copyright(c) 1999-2004 Intel Corporation"
 #define PFX			DRV_NAME ": "
@@ -641,7 +641,8 @@ static void e100_eeprom_write(struct nic *nic, u16 addr_len, u16 addr, u16 data)
 
 	/* Three cmds: write/erase enable, write data, write/erase disable */
 	cmd_addr_data[0] = op_ewen << (addr_len - 2);
-	cmd_addr_data[1] = (((op_write << addr_len) | addr) << 16) | data;
+	cmd_addr_data[1] = (((op_write << addr_len) | addr) << 16) |
+		cpu_to_le16(data);
 	cmd_addr_data[2] = op_ewds << (addr_len - 2);
 
 	/* Bit-bang cmds to write word to eeprom */
@@ -668,7 +669,6 @@ static void e100_eeprom_write(struct nic *nic, u16 addr_len, u16 addr, u16 data)
 		writeb(0, &nic->csr->eeprom_ctrl_lo);
 		e100_write_flush(nic); udelay(4);
 	}
-
 };
 
 /* General technique stolen from the eepro100 driver - very clever */
@@ -709,7 +709,7 @@ static u16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
 	writeb(0, &nic->csr->eeprom_ctrl_lo);
 	e100_write_flush(nic); udelay(4);
 
-	return data;
+	return le16_to_cpu(data);
 };
 
 /* Load entire EEPROM image into driver cache and validate checksum */
@@ -724,12 +724,12 @@ static int e100_eeprom_load(struct nic *nic)
 	for(addr = 0; addr < nic->eeprom_wc; addr++) {
 		nic->eeprom[addr] = e100_eeprom_read(nic, &addr_len, addr);
 		if(addr < nic->eeprom_wc - 1)
-			checksum += nic->eeprom[addr];
+			checksum += cpu_to_le16(nic->eeprom[addr]);
 	}
 
 	/* The checksum, stored in the last word, is calculated such that
 	 * the sum of words should be 0xBABA */
-	checksum = 0xBABA - checksum;
+	checksum = le16_to_cpu(0xBABA - checksum);
 	if(checksum != nic->eeprom[nic->eeprom_wc - 1]) {
 		DPRINTK(PROBE, ERR, "EEPROM corrupted\n");
 		return -EAGAIN;
@@ -756,9 +756,10 @@ static int e100_eeprom_save(struct nic *nic, u16 start, u16 count)
 	/* The checksum, stored in the last word, is calculated such that
 	 * the sum of words should be 0xBABA */
 	for(addr = 0; addr < nic->eeprom_wc - 1; addr++)
-		checksum += nic->eeprom[addr];
-	nic->eeprom[nic->eeprom_wc - 1] = 0xBABA - checksum;
-	e100_eeprom_write(nic, addr_len, nic->eeprom_wc - 1, 0xBABA - checksum);
+		checksum += cpu_to_le16(nic->eeprom[addr]);
+	nic->eeprom[nic->eeprom_wc - 1] = le16_to_cpu(0xBABA - checksum);
+	e100_eeprom_write(nic, addr_len, nic->eeprom_wc - 1,
+		nic->eeprom[nic->eeprom_wc - 1]);
 
 	return 0;
 }
@@ -826,8 +827,8 @@ static inline int e100_exec_cb(struct nic *nic, struct sk_buff *skb,
 	cb->prev->command &= cpu_to_le16(~cb_s);
 
 	while(nic->cb_to_send != nic->cb_to_use) {
-		if(unlikely((err = e100_exec_cmd(nic, nic->cuc_cmd,
-			nic->cb_to_send->dma_addr)))) {
+		if(unlikely(e100_exec_cmd(nic, nic->cuc_cmd,
+			nic->cb_to_send->dma_addr))) {
 			/* Ok, here's where things get sticky.  It's
 			 * possible that we can't schedule the command
 			 * because the controller is too busy, so
@@ -867,12 +868,12 @@ static u16 mdio_ctrl(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
 
 static int mdio_read(struct net_device *netdev, int addr, int reg)
 {
-	return mdio_ctrl(netdev->priv, addr, mdi_read, reg, 0);
+	return mdio_ctrl(netdev_priv(netdev), addr, mdi_read, reg, 0);
 }
 
 static void mdio_write(struct net_device *netdev, int addr, int reg, int data)
 {
-	mdio_ctrl(netdev->priv, addr, mdi_write, reg, data);
+	mdio_ctrl(netdev_priv(netdev), addr, mdi_write, reg, data);
 }
 
 static void e100_get_defaults(struct nic *nic)
@@ -1098,7 +1099,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
 
 static void e100_set_multicast_list(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n",
 		netdev->mc_count, netdev->flags);
@@ -1251,7 +1252,7 @@ static inline void e100_xmit_prepare(struct nic *nic, struct cb *cb,
 
 static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	int err;
 
 	if(nic->flags & ich_10h_workaround) {
@@ -1322,7 +1323,7 @@ static inline int e100_tx_clean(struct nic *nic)
 static void e100_clean_cbs(struct nic *nic)
 {
 	if(nic->cbs) {
-		while(nic->cb_to_clean != nic->cb_to_use) {
+		while(nic->cbs_avail != nic->params.cbs.count) {
 			struct cb *cb = nic->cb_to_clean;
 			if(cb->skb) {
 				pci_unmap_single(nic->pdev,
@@ -1332,8 +1333,8 @@ static void e100_clean_cbs(struct nic *nic)
 				dev_kfree_skb(cb->skb);
 			}
 			nic->cb_to_clean = nic->cb_to_clean->next;
+			nic->cbs_avail++;
 		}
-		nic->cbs_avail = nic->params.cbs.count;
 		pci_free_consistent(nic->pdev,
 			sizeof(struct cb) * nic->params.cbs.count,
 			nic->cbs, nic->cbs_dma_addr);
@@ -1392,12 +1393,12 @@ static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
 	if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + rx_offset)))
 		return -ENOMEM;
 
-	/* Align, init, and map the RFA. */
+	/* Align, init, and map the RFD. */
 	rx->skb->dev = nic->netdev;
 	skb_reserve(rx->skb, rx_offset);
 	memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
 	rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
-		RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+		RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL);
 
 	/* Link the RFD to end of RFA by linking previous RFD to
 	 * this one, and clearing EL bit of previous.  */
@@ -1408,7 +1409,7 @@ static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
 		wmb();
 		prev_rfd->command &= ~cpu_to_le16(cb_el);
 		pci_dma_sync_single_for_device(nic->pdev, rx->prev->dma_addr,
-					       sizeof(struct rfd), PCI_DMA_TODEVICE);
+			sizeof(struct rfd), PCI_DMA_TODEVICE);
 	}
 
 	return 0;
@@ -1426,7 +1427,7 @@ static inline int e100_rx_indicate(struct nic *nic, struct rx *rx,
 
 	/* Need to sync before taking a peek at cb_complete bit */
 	pci_dma_sync_single_for_cpu(nic->pdev, rx->dma_addr,
-				    sizeof(struct rfd), PCI_DMA_FROMDEVICE);
+		sizeof(struct rfd), PCI_DMA_FROMDEVICE);
 	rfd_status = le16_to_cpu(rfd->status);
 
 	DPRINTK(RX_STATUS, DEBUG, "status=0x%04X\n", rfd_status);
@@ -1442,7 +1443,7 @@ static inline int e100_rx_indicate(struct nic *nic, struct rx *rx,
 
 	/* Get data */
 	pci_unmap_single(nic->pdev, rx->dma_addr,
-			 RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+		RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
 
 	/* Pull off the RFD and put the actual data (minus eth hdr) */
 	skb_reserve(skb, sizeof(struct rfd));
@@ -1545,7 +1546,7 @@ static int e100_rx_alloc_list(struct nic *nic)
 static irqreturn_t e100_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *netdev = dev_id;
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	u8 stat_ack = readb(&nic->csr->scb.stat_ack);
 
 	DPRINTK(INTR, DEBUG, "stat_ack = 0x%02X\n", stat_ack);
@@ -1577,7 +1578,7 @@ static irqreturn_t e100_intr(int irq, void *dev_id, struct pt_regs *regs)
 #ifdef CONFIG_E100_NAPI
 static int e100_poll(struct net_device *netdev, int *budget)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	unsigned int work_to_do = min(netdev->quota, *budget);
 	unsigned int work_done = 0;
 	int tx_cleaned;
@@ -1602,7 +1603,7 @@ static int e100_poll(struct net_device *netdev, int *budget)
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void e100_netpoll(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	e100_disable_irq(nic);
 	e100_intr(nic->pdev->irq, netdev, NULL);
 	e100_enable_irq(nic);
@@ -1611,13 +1612,13 @@ static void e100_netpoll(struct net_device *netdev)
 
 static struct net_device_stats *e100_get_stats(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	return &nic->net_stats;
 }
 
 static int e100_set_mac_address(struct net_device *netdev, void *p)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	struct sockaddr *addr = p;
 
 	if (!is_valid_ether_addr(addr->sa_data))
@@ -1658,17 +1659,16 @@ static int e100_up(struct nic *nic)
 		goto err_clean_cbs;
 	e100_set_multicast_list(nic->netdev);
 	e100_start_receiver(nic);
-	netif_start_queue(nic->netdev);
 	mod_timer(&nic->watchdog, jiffies);
 	if((err = request_irq(nic->pdev->irq, e100_intr, SA_SHIRQ,
 		nic->netdev->name, nic->netdev)))
 		goto err_no_irq;
 	e100_enable_irq(nic);
+	netif_wake_queue(nic->netdev);
 	return 0;
 
 err_no_irq:
 	del_timer_sync(&nic->watchdog);
-	netif_stop_queue(nic->netdev);
 err_clean_cbs:
 	e100_clean_cbs(nic);
 err_rx_clean_list:
@@ -1689,12 +1689,12 @@ static void e100_down(struct nic *nic)
 
 static void e100_tx_timeout(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n",
 		readb(&nic->csr->scb.status));
-	e100_down(netdev->priv);
-	e100_up(netdev->priv);
+	e100_down(netdev_priv(netdev));
+	e100_up(netdev_priv(netdev));
 }
 
 static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)
@@ -1770,13 +1770,13 @@ static void e100_blink_led(unsigned long data)
 
 static int e100_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	return mii_ethtool_gset(&nic->mii, cmd);
 }
 
 static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	int err;
 
 	mdio_write(netdev, nic->mii.phy_id, MII_BMCR, BMCR_RESET);
@@ -1789,7 +1789,7 @@ static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
 static void e100_get_drvinfo(struct net_device *netdev,
 	struct ethtool_drvinfo *info)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	strcpy(info->driver, DRV_NAME);
 	strcpy(info->version, DRV_VERSION);
 	strcpy(info->fw_version, "N/A");
@@ -1798,7 +1798,7 @@ static void e100_get_drvinfo(struct net_device *netdev,
 
 static int e100_get_regs_len(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 #define E100_PHY_REGS		0x1C
 #define E100_REGS_LEN		1 + E100_PHY_REGS + \
 	sizeof(nic->mem->dump_buf) / sizeof(u32)
@@ -1808,7 +1808,7 @@ static int e100_get_regs_len(struct net_device *netdev)
 static void e100_get_regs(struct net_device *netdev,
 	struct ethtool_regs *regs, void *p)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	u32 *buff = p;
 	int i;
 
@@ -1829,14 +1829,14 @@ static void e100_get_regs(struct net_device *netdev,
 
 static void e100_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	wol->supported = (nic->mac >= mac_82558_D101_A4) ?  WAKE_MAGIC : 0;
 	wol->wolopts = (nic->flags & wol_magic) ? WAKE_MAGIC : 0;
 }
 
 static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0)
 		return -EOPNOTSUPP;
@@ -1854,31 +1854,31 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
 
 static u32 e100_get_msglevel(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	return nic->msg_enable;
 }
 
 static void e100_set_msglevel(struct net_device *netdev, u32 value)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	nic->msg_enable = value;
 }
 
 static int e100_nway_reset(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	return mii_nway_restart(&nic->mii);
 }
 
 static u32 e100_get_link(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	return mii_link_ok(&nic->mii);
 }
 
 static int e100_get_eeprom_len(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	return nic->eeprom_wc << 1;
 }
 
@@ -1886,7 +1886,7 @@ static int e100_get_eeprom_len(struct net_device *netdev)
 static int e100_get_eeprom(struct net_device *netdev,
 	struct ethtool_eeprom *eeprom, u8 *bytes)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	eeprom->magic = E100_EEPROM_MAGIC;
 	memcpy(bytes, &((u8 *)nic->eeprom)[eeprom->offset], eeprom->len);
@@ -1897,10 +1897,11 @@ static int e100_get_eeprom(struct net_device *netdev,
 static int e100_set_eeprom(struct net_device *netdev,
 	struct ethtool_eeprom *eeprom, u8 *bytes)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	if(eeprom->magic != E100_EEPROM_MAGIC)
 		return -EINVAL;
+
 	memcpy(&((u8 *)nic->eeprom)[eeprom->offset], bytes, eeprom->len);
 
 	return e100_eeprom_save(nic, eeprom->offset >> 1,
@@ -1910,7 +1911,7 @@ static int e100_set_eeprom(struct net_device *netdev,
 static void e100_get_ringparam(struct net_device *netdev,
 	struct ethtool_ringparam *ring)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	struct param_range *rfds = &nic->params.rfds;
 	struct param_range *cbs = &nic->params.cbs;
 
@@ -1927,7 +1928,7 @@ static void e100_get_ringparam(struct net_device *netdev,
 static int e100_set_ringparam(struct net_device *netdev,
 	struct ethtool_ringparam *ring)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	struct param_range *rfds = &nic->params.rfds;
 	struct param_range *cbs = &nic->params.cbs;
 
@@ -1960,7 +1961,7 @@ static int e100_diag_test_count(struct net_device *netdev)
 static void e100_diag_test(struct net_device *netdev,
 	struct ethtool_test *test, u64 *data)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	int i;
 
 	memset(data, 0, E100_TEST_LEN * sizeof(u64));
@@ -1981,7 +1982,7 @@ static void e100_diag_test(struct net_device *netdev,
 
 static int e100_phys_id(struct net_device *netdev, u32 data)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
 		data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
@@ -2017,7 +2018,7 @@ static int e100_get_stats_count(struct net_device *netdev)
 static void e100_get_ethtool_stats(struct net_device *netdev,
 	struct ethtool_stats *stats, u64 *data)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	int i;
 
 	for(i = 0; i < E100_NET_STATS_LEN; i++)
@@ -2072,10 +2073,9 @@ static struct ethtool_ops e100_ethtool_ops = {
 
 static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 {
-	struct nic *nic = netdev->priv;
-	struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&ifr->ifr_data;
+	struct nic *nic = netdev_priv(netdev);
 
-	return generic_mii_ioctl(&nic->mii, mii, cmd, NULL);
+	return generic_mii_ioctl(&nic->mii, if_mii(ifr), cmd, NULL);
 }
 
 static int e100_alloc(struct nic *nic)
@@ -2096,7 +2096,7 @@ static void e100_free(struct nic *nic)
 
 static int e100_open(struct net_device *netdev)
 {
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 	int err = 0;
 
 	netif_carrier_off(netdev);
@@ -2107,7 +2107,7 @@ static int e100_open(struct net_device *netdev)
 
 static int e100_close(struct net_device *netdev)
 {
-	e100_down(netdev->priv);
+	e100_down(netdev_priv(netdev));
 	return 0;
 }
 
@@ -2143,7 +2143,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 	netdev->poll_controller = e100_netpoll;
 #endif
 
-	nic = netdev->priv;
+	nic = netdev_priv(netdev);
 	nic->netdev = netdev;
 	nic->pdev = pdev;
 	nic->msg_enable = (1 << debug) - 1;
@@ -2209,9 +2209,8 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 
 	if((err = e100_eeprom_load(nic)))
 		goto err_out_free;
-	((u16 *)netdev->dev_addr)[0] = le16_to_cpu(nic->eeprom[0]);
-	((u16 *)netdev->dev_addr)[1] = le16_to_cpu(nic->eeprom[1]);
-	((u16 *)netdev->dev_addr)[2] = le16_to_cpu(nic->eeprom[2]);
+
+	memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN);
 	if(!is_valid_ether_addr(netdev->dev_addr)) {
 		DPRINTK(PROBE, ERR, "Invalid MAC address from "
 			"EEPROM, aborting.\n");
@@ -2258,7 +2257,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 
 	if(netdev) {
-		struct nic *nic = netdev->priv;
+		struct nic *nic = netdev_priv(netdev);
 		unregister_netdev(netdev);
 		e100_free(nic);
 		iounmap(nic->csr);
@@ -2273,7 +2272,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 static int e100_suspend(struct pci_dev *pdev, u32 state)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	if(netif_running(netdev))
 		e100_down(nic);
@@ -2291,7 +2290,7 @@ static int e100_suspend(struct pci_dev *pdev, u32 state)
 static int e100_resume(struct pci_dev *pdev)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
-	struct nic *nic = netdev->priv;
+	struct nic *nic = netdev_priv(netdev);
 
 	pci_set_power_state(pdev, 0);
 	pci_restore_state(pdev, nic->pm_state);
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index afdf5b1d7..d9225b32e 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -71,6 +71,7 @@
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/if_vlan.h>
+#include <linux/moduleparam.h>
 
 #define BAR_0		0
 #define BAR_1		1
@@ -89,6 +90,12 @@ struct e1000_adapter;
 
 #define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
 
+#define PFX "e1000: "
+#define DPRINTK(nlevel, klevel, fmt, args...) \
+	(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
+	printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
+		__FUNCTION__ , ## args))
+
 #define E1000_MAX_INTR 10
 
 /* How many descriptors for TX and RX ? */
@@ -245,5 +252,6 @@ struct e1000_adapter {
 
 
 	uint32_t pci_state[16];
+	int msg_enable;
 };
 #endif /* _E1000_H_ */
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 1572d6167..0394fd28c 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -53,7 +53,7 @@ struct e1000_stats {
 
 #define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
 		      offsetof(struct e1000_adapter, m)
-static struct e1000_stats e1000_gstrings_stats[] = {
+static const struct e1000_stats e1000_gstrings_stats[] = {
 	{ "rx_packets", E1000_STAT(net_stats.rx_packets) },
 	{ "tx_packets", E1000_STAT(net_stats.tx_packets) },
 	{ "rx_bytes", E1000_STAT(net_stats.rx_bytes) },
@@ -89,20 +89,22 @@ static struct e1000_stats e1000_gstrings_stats[] = {
 	{ "tx_flow_control_xon", E1000_STAT(stats.xontxc) },
 	{ "tx_flow_control_xoff", E1000_STAT(stats.xofftxc) },
 	{ "rx_csum_offload_good", E1000_STAT(hw_csum_good) },
-	{ "rx_csum_offload_errors", E1000_STAT(hw_csum_err) }
+        { "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
+	{ "rx_long_byte_count", E1000_STAT(stats.gorcl) }
 };
 #define E1000_STATS_LEN	\
 	sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
-static char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
+static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
 	"Register test  (offline)", "Eeprom test    (offline)",
 	"Interrupt test (offline)", "Loopback test  (offline)",
 	"Link test   (on/offline)"
 };
 #define E1000_TEST_LEN sizeof(e1000_gstrings_test) / ETH_GSTRING_LEN
 
-static void
-e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
+static int
+e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
 
 	if(hw->media_type == e1000_media_type_copper) {
@@ -169,11 +171,13 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
 	}
 
 	ecmd->autoneg = (hw->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
+	return 0;
 }
 
 static int
-e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
+e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
 
 	if(ecmd->autoneg == AUTONEG_ENABLE) {
@@ -195,42 +199,41 @@ e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
 	return 0;
 }
 
-static int
-e1000_ethtool_gpause(struct e1000_adapter *adapter,
-                     struct ethtool_pauseparam *epause)
+static void 
+e1000_get_pauseparam(struct net_device *netdev,
+                    struct ethtool_pauseparam *pause)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
-	
-	epause->autoneg = 
+	pause->autoneg = 
 		(adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
 	
 	if(hw->fc == e1000_fc_rx_pause)
-		epause->rx_pause = 1;
+		pause->rx_pause = 1;
 	else if(hw->fc == e1000_fc_tx_pause)
-		epause->tx_pause = 1;
+		pause->tx_pause = 1;
 	else if(hw->fc == e1000_fc_full) {
-		epause->rx_pause = 1;
-		epause->tx_pause = 1;
+		pause->rx_pause = 1;
+		pause->tx_pause = 1;
 	}
-	
-	return 0;
 }
 
-static int
-e1000_ethtool_spause(struct e1000_adapter *adapter,
-                     struct ethtool_pauseparam *epause)
+static int 
+e1000_set_pauseparam(struct net_device *netdev,
+                    struct ethtool_pauseparam *pause)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
 	
-	adapter->fc_autoneg = epause->autoneg;
+	adapter->fc_autoneg = pause->autoneg;
 
-	if(epause->rx_pause && epause->tx_pause)
+	if(pause->rx_pause && pause->tx_pause)
 		hw->fc = e1000_fc_full;
-	else if(epause->rx_pause && !epause->tx_pause)
+	else if(pause->rx_pause && !pause->tx_pause)
 		hw->fc = e1000_fc_rx_pause;
-	else if(!epause->rx_pause && epause->tx_pause)
+	else if(!pause->rx_pause && pause->tx_pause)
 		hw->fc = e1000_fc_tx_pause;
-	else if(!epause->rx_pause && !epause->tx_pause)
+	else if(!pause->rx_pause && !pause->tx_pause)
 		hw->fc = e1000_fc_none;
 
 	hw->original_fc = hw->fc;
@@ -248,28 +251,101 @@ e1000_ethtool_spause(struct e1000_adapter *adapter,
 	return 0;
 }
 
+static uint32_t
+e1000_get_rx_csum(struct net_device *netdev)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	return adapter->rx_csum;
+}
+
+static int
+e1000_set_rx_csum(struct net_device *netdev, uint32_t data)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	adapter->rx_csum = data;
+
+	if(netif_running(netdev)) {
+		e1000_down(adapter);
+		e1000_up(adapter);
+	} else
+		e1000_reset(adapter);
+	return 0;
+}
+
+static uint32_t
+e1000_get_tx_csum(struct net_device *netdev)
+{
+	return (netdev->features & NETIF_F_HW_CSUM) != 0;
+}
+
+static int
+e1000_set_tx_csum(struct net_device *netdev, uint32_t data)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+
+	if(adapter->hw.mac_type < e1000_82543) {
+		if (!data)
+			return -EINVAL;
+		return 0;
+	}
+
+	if (data)
+		netdev->features |= NETIF_F_HW_CSUM;
+	else
+		netdev->features &= ~NETIF_F_HW_CSUM;
+
+	return 0;
+}
+
+#ifdef NETIF_F_TSO
+static int
+e1000_set_tso(struct net_device *netdev, uint32_t data)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	if ((adapter->hw.mac_type < e1000_82544) ||
+	    (adapter->hw.mac_type == e1000_82547)) 
+		return data ? -EINVAL : 0;
+
+	if (data)
+		netdev->features |= NETIF_F_TSO;
+	else
+		netdev->features &= ~NETIF_F_TSO;
+	return 0;
+} 
+#endif /* NETIF_F_TSO */
+
+static uint32_t
+e1000_get_msglevel(struct net_device *netdev)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	return adapter->msg_enable;
+}
+
 static void
-e1000_ethtool_gdrvinfo(struct e1000_adapter *adapter,
-                       struct ethtool_drvinfo *drvinfo)
+e1000_set_msglevel(struct net_device *netdev, uint32_t data)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	adapter->msg_enable = data;
+}
+
+static int 
+e1000_get_regs_len(struct net_device *netdev)
 {
-	strncpy(drvinfo->driver,  e1000_driver_name, 32);
-	strncpy(drvinfo->version, e1000_driver_version, 32);
-	strncpy(drvinfo->fw_version, "N/A", 32);
-	strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
-	drvinfo->n_stats = E1000_STATS_LEN;
-	drvinfo->testinfo_len = E1000_TEST_LEN;
 #define E1000_REGS_LEN 32
-	drvinfo->regdump_len  = E1000_REGS_LEN * sizeof(uint32_t);
-	drvinfo->eedump_len = adapter->hw.eeprom.word_size * 2;
+	return E1000_REGS_LEN * sizeof(uint32_t);
 }
 
 static void
-e1000_ethtool_gregs(struct e1000_adapter *adapter,
-                    struct ethtool_regs *regs, uint32_t *regs_buff)
+e1000_get_regs(struct net_device *netdev,
+                    struct ethtool_regs *regs, void *p)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
+	uint32_t *regs_buff = p;
 	uint16_t phy_data;
 
+	memset(p, 0, E1000_REGS_LEN * sizeof(uint32_t));
+
 	regs->version = (1 << 24) | (hw->revision_id << 16) | hw->device_id;
 
 	regs_buff[0]  = E1000_READ_REG(hw, CTRL);
@@ -342,37 +418,39 @@ e1000_ethtool_gregs(struct e1000_adapter *adapter,
 	e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data);
 	regs_buff[24] = (uint32_t)phy_data;  /* phy local receiver status */
 	regs_buff[25] = regs_buff[24];  /* phy remote receiver status */
+}
 
-	return;
+static int
+e1000_get_eeprom_len(struct net_device *netdev)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	return adapter->hw.eeprom.word_size * 2;
 }
 
 static int
-e1000_ethtool_geeprom(struct e1000_adapter *adapter,
-                      struct ethtool_eeprom *eeprom, uint16_t *eeprom_buff)
+e1000_get_eeprom(struct net_device *netdev,
+                      struct ethtool_eeprom *eeprom, uint8_t *bytes)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
+	uint16_t *eeprom_buff;
 	int first_word, last_word;
 	int ret_val = 0;
 	uint16_t i;
 
-	if(eeprom->len == 0) {
-		ret_val = -EINVAL;
-		goto geeprom_error;
-	}
+	if(eeprom->len == 0) 
+		return -EINVAL;
 
 	eeprom->magic = hw->vendor_id | (hw->device_id << 16);
 
-	if(eeprom->offset > eeprom->offset + eeprom->len) {
-		ret_val = -EINVAL;
-		goto geeprom_error;
-	}
-
-	if((eeprom->offset + eeprom->len) > (hw->eeprom.word_size * 2))
-		eeprom->len = ((hw->eeprom.word_size * 2) - eeprom->offset);
-
 	first_word = eeprom->offset >> 1;
 	last_word = (eeprom->offset + eeprom->len - 1) >> 1;
 
+	eeprom_buff = kmalloc(sizeof(uint16_t) * 
+			(last_word - first_word + 1), GFP_KERNEL);
+	if (!eeprom_buff)
+		return -ENOMEM;
+
 	if(hw->eeprom.type == e1000_eeprom_spi)
 		ret_val = e1000_read_eeprom(hw, first_word,
 					    last_word - first_word + 1,
@@ -388,14 +466,19 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
 	for (i = 0; i < last_word - first_word + 1; i++)
 		le16_to_cpus(&eeprom_buff[i]);
 
-geeprom_error:
+
+	memcpy(bytes, (uint8_t *)eeprom_buff + (eeprom->offset%2), 
+				eeprom->len);
+	kfree(eeprom_buff);
+
 	return ret_val;
 }
 
 static int
-e1000_ethtool_seeprom(struct e1000_adapter *adapter,
-                      struct ethtool_eeprom *eeprom, void *user_data)
+e1000_set_eeprom(struct net_device *netdev,
+                      struct ethtool_eeprom *eeprom, uint8_t *bytes)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
 	uint16_t *eeprom_buff;
 	void *ptr;
@@ -410,9 +493,6 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
 
 	max_len = hw->eeprom.word_size * 2;
 
-	if((eeprom->offset + eeprom->len) > max_len)
-		eeprom->len = (max_len - eeprom->offset);
-
 	first_word = eeprom->offset >> 1;
 	last_word = (eeprom->offset + eeprom->len - 1) >> 1;
 	eeprom_buff = kmalloc(max_len, GFP_KERNEL);
@@ -439,11 +519,7 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
 	for (i = 0; i < last_word - first_word + 1; i++)
 		le16_to_cpus(&eeprom_buff[i]);
 
-	if((ret_val != 0) || copy_from_user(ptr, user_data, eeprom->len)) {
-		ret_val = -EFAULT;
-		goto seeprom_error;
-	}
-
+	memcpy(ptr, bytes, eeprom->len);
 	for (i = 0; i < last_word - first_word + 1; i++)
 		eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]);
 
@@ -454,15 +530,31 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
 	if((ret_val == 0) && first_word <= EEPROM_CHECKSUM_REG)
 		e1000_update_eeprom_checksum(hw);
 
-seeprom_error:
 	kfree(eeprom_buff);
 	return ret_val;
 }
 
-static int
-e1000_ethtool_gring(struct e1000_adapter *adapter,
+static void
+e1000_get_drvinfo(struct net_device *netdev,
+                       struct ethtool_drvinfo *drvinfo)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+
+	strncpy(drvinfo->driver,  e1000_driver_name, 32);
+	strncpy(drvinfo->version, e1000_driver_version, 32);
+	strncpy(drvinfo->fw_version, "N/A", 32);
+	strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
+	drvinfo->n_stats = E1000_STATS_LEN;
+	drvinfo->testinfo_len = E1000_TEST_LEN;
+	drvinfo->regdump_len = e1000_get_regs_len(netdev);
+	drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
+}
+
+static void
+e1000_get_ringparam(struct net_device *netdev,
                     struct ethtool_ringparam *ring)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	e1000_mac_type mac_type = adapter->hw.mac_type;
 	struct e1000_desc_ring *txdr = &adapter->tx_ring;
 	struct e1000_desc_ring *rxdr = &adapter->rx_ring;
@@ -477,14 +569,14 @@ e1000_ethtool_gring(struct e1000_adapter *adapter,
 	ring->tx_pending = txdr->count;
 	ring->rx_mini_pending = 0;
 	ring->rx_jumbo_pending = 0;
-
-	return 0;
 }
+
 static int 
-e1000_ethtool_sring(struct e1000_adapter *adapter,
+e1000_set_ringparam(struct net_device *netdev,
                     struct ethtool_ringparam *ring)
 {
 	int err;
+	struct e1000_adapter *adapter = netdev->priv;
 	e1000_mac_type mac_type = adapter->hw.mac_type;
 	struct e1000_desc_ring *txdr = &adapter->tx_ring;
 	struct e1000_desc_ring *rxdr = &adapter->rx_ring;
@@ -538,6 +630,7 @@ err_setup_rx:
 	return err;
 }
 
+
 #define REG_PATTERN_TEST(R, M, W)                                              \
 {                                                                              \
 	uint32_t pat, value;                                                   \
@@ -628,6 +721,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
 	for(i = 0; i < E1000_MC_TBL_SIZE; i++)
 		REG_PATTERN_TEST(MTA + (i << 2), 0xFFFFFFFF, 0xFFFFFFFF);
 
+	*data = 0;
 	return 0;
 }
 
@@ -939,8 +1033,6 @@ e1000_phy_disable_receiver(struct e1000_adapter *adapter)
 	e1000_write_phy_reg(&adapter->hw, 30, 0x8FFC);
 	e1000_write_phy_reg(&adapter->hw, 29, 0x001A);
 	e1000_write_phy_reg(&adapter->hw, 30, 0x8FF0);
-
-	return;
 }
 
 static void
@@ -1219,16 +1311,16 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
 
 	for(i = 0; i < 64; i++) {
 		e1000_create_lbtest_frame(txdr->buffer_info[i].skb, 1024);
-		pci_dma_sync_single_for_device(pdev, txdr->buffer_info[i].dma,
-					       txdr->buffer_info[i].length,
-					       PCI_DMA_TODEVICE);
+		pci_dma_sync_single(pdev, txdr->buffer_info[i].dma,
+				    txdr->buffer_info[i].length,
+				    PCI_DMA_TODEVICE);
 	}
 	E1000_WRITE_REG(&adapter->hw, TDT, i);
 
 	msec_delay(200);
 
-	pci_dma_sync_single_for_cpu(pdev, rxdr->buffer_info[0].dma,
-				    rxdr->buffer_info[0].length, PCI_DMA_FROMDEVICE);
+	pci_dma_sync_single(pdev, rxdr->buffer_info[0].dma,
+			    rxdr->buffer_info[0].length, PCI_DMA_FROMDEVICE);
 
 	return e1000_check_lbtest_frame(rxdr->buffer_info[0].skb, 1024);
 }
@@ -1257,15 +1349,27 @@ e1000_link_test(struct e1000_adapter *adapter, uint64_t *data)
 	return *data;
 }
 
-static int
-e1000_ethtool_test(struct e1000_adapter *adapter,
+static int 
+e1000_diag_test_count(struct net_device *netdev)
+{
+	return E1000_TEST_LEN;
+}
+
+static void
+e1000_diag_test(struct net_device *netdev, 
 		   struct ethtool_test *eth_test, uint64_t *data)
 {
-	boolean_t if_running = netif_running(adapter->netdev);
+	struct e1000_adapter *adapter = netdev->priv;
+	boolean_t if_running = netif_running(netdev);
 
 	if(eth_test->flags == ETH_TEST_FL_OFFLINE) {
 		/* Offline tests */
 
+		/* save speed, duplex, autoneg settings */
+		uint16_t autoneg_advertised = adapter->hw.autoneg_advertised;
+    		uint8_t forced_speed_duplex = adapter->hw.forced_speed_duplex;
+		uint8_t autoneg = adapter->hw.autoneg;
+
 		/* Link test performed before hardware reset so autoneg doesn't
 		 * interfere with test result */
 		if(e1000_link_test(adapter, &data[4]))
@@ -1291,6 +1395,10 @@ e1000_ethtool_test(struct e1000_adapter *adapter,
 		if(e1000_loopback_test(adapter, &data[3]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
+		/* restore Autoneg/speed/duplex settings */
+		adapter->hw.autoneg_advertised = autoneg_advertised;
+    		adapter->hw.forced_speed_duplex = forced_speed_duplex;
+    		adapter->hw.autoneg = autoneg;
 		e1000_reset(adapter);
 		if(if_running)
 			e1000_up(adapter);
@@ -1305,12 +1413,12 @@ e1000_ethtool_test(struct e1000_adapter *adapter,
 		data[2] = 0;
 		data[3] = 0;
 	}
-	return 0;
 }
 
 static void
-e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
+e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
 
 	switch(adapter->hw.device_id) {
@@ -1350,8 +1458,9 @@ e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
 }
 
 static int
-e1000_ethtool_swol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
+e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
 {
+	struct e1000_adapter *adapter = netdev->priv;
 	struct e1000_hw *hw = &adapter->hw;
 
 	switch(adapter->hw.device_id) {
@@ -1387,7 +1496,6 @@ e1000_ethtool_swol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
 	return 0;
 }
 
-
 /* toggle LED 4 times per second = 2 "blinks" per second */
 #define E1000_ID_INTERVAL	(HZ/4)
 
@@ -1408,8 +1516,13 @@ e1000_led_blink_callback(unsigned long data)
 }
 
 static int
-e1000_ethtool_led_blink(struct e1000_adapter *adapter, struct ethtool_value *id)
+e1000_phys_id(struct net_device *netdev, uint32_t data)
 {
+	struct e1000_adapter *adapter = netdev->priv;
+
+	if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ))
+		data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ);
+
 	if(!adapter->blink_timer.function) {
 		init_timer(&adapter->blink_timer);
 		adapter->blink_timer.function = e1000_led_blink_callback;
@@ -1420,11 +1533,8 @@ e1000_ethtool_led_blink(struct e1000_adapter *adapter, struct ethtool_value *id)
 	mod_timer(&adapter->blink_timer, jiffies);
 
 	set_current_state(TASK_INTERRUPTIBLE);
-	if(id->data)
-		schedule_timeout(id->data * HZ);
-	else
-		schedule_timeout(MAX_SCHEDULE_TIMEOUT);
 
+	schedule_timeout(data * HZ);
 	del_timer_sync(&adapter->blink_timer);
 	e1000_led_off(&adapter->hw);
 	clear_bit(E1000_LED_ON, &adapter->led_status);
@@ -1433,345 +1543,96 @@ e1000_ethtool_led_blink(struct e1000_adapter *adapter, struct ethtool_value *id)
 	return 0;
 }
 
-int
-e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
+static int
+e1000_nway_reset(struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev->priv;
-	void *addr = ifr->ifr_data;
-	uint32_t cmd;
-
-	if(get_user(cmd, (uint32_t *) addr))
-		return -EFAULT;
-
-	switch(cmd) {
-	case ETHTOOL_GSET: {
-		struct ethtool_cmd ecmd = {ETHTOOL_GSET};
-		e1000_ethtool_gset(adapter, &ecmd);
-		if(copy_to_user(addr, &ecmd, sizeof(ecmd)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SSET: {
-		struct ethtool_cmd ecmd;
-		if(copy_from_user(&ecmd, addr, sizeof(ecmd)))
-			return -EFAULT;
-		return e1000_ethtool_sset(adapter, &ecmd);
-	}
-	case ETHTOOL_GDRVINFO: {
-		struct ethtool_drvinfo drvinfo = {ETHTOOL_GDRVINFO};
-		e1000_ethtool_gdrvinfo(adapter, &drvinfo);
-		if(copy_to_user(addr, &drvinfo, sizeof(drvinfo)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_GSTRINGS: {
-		struct ethtool_gstrings gstrings = { ETHTOOL_GSTRINGS };
-		char *strings = NULL;
-		int err = 0;
-
-		if(copy_from_user(&gstrings, addr, sizeof(gstrings)))
-			return -EFAULT;
-		switch(gstrings.string_set) {
-		case ETH_SS_TEST:
-			gstrings.len = E1000_TEST_LEN;
-			strings = kmalloc(E1000_TEST_LEN * ETH_GSTRING_LEN,
-					  GFP_KERNEL);
-			if(!strings)
-				return -ENOMEM;
-			memcpy(strings, e1000_gstrings_test, E1000_TEST_LEN *
-			       ETH_GSTRING_LEN);
-			break;
-		case ETH_SS_STATS: {
-			int i;
-			gstrings.len = E1000_STATS_LEN;
-			strings = kmalloc(E1000_STATS_LEN * ETH_GSTRING_LEN,
-					  GFP_KERNEL);
-			if(!strings)
-				return -ENOMEM;
-			for(i=0; i < E1000_STATS_LEN; i++) {
-				memcpy(&strings[i * ETH_GSTRING_LEN],
-				       e1000_gstrings_stats[i].stat_string,
-				       ETH_GSTRING_LEN);
-			}
-			break;
-		}
-		default:
-			return -EOPNOTSUPP;
-		}
-		if(copy_to_user(addr, &gstrings, sizeof(gstrings)))
-			err = -EFAULT;
-		addr += offsetof(struct ethtool_gstrings, data);
-		if(!err && copy_to_user(addr, strings,
-		   gstrings.len * ETH_GSTRING_LEN))
-			err = -EFAULT;
-
-		kfree(strings);
-		return err;
-	}
-	case ETHTOOL_GREGS: {
-		struct ethtool_regs regs = {ETHTOOL_GREGS};
-		uint32_t regs_buff[E1000_REGS_LEN];
-
-		if(copy_from_user(&regs, addr, sizeof(regs)))
-			return -EFAULT;
-		memset(regs_buff, 0, sizeof(regs_buff));
-		if (regs.len > E1000_REGS_LEN)
-			regs.len = E1000_REGS_LEN;
-		e1000_ethtool_gregs(adapter, &regs, regs_buff);
-		if(copy_to_user(addr, &regs, sizeof(regs)))
-			return -EFAULT;
-
-		addr += offsetof(struct ethtool_regs, data);
-		if(copy_to_user(addr, regs_buff, regs.len))
-			return -EFAULT;
-
-		return 0;
-	}
-	case ETHTOOL_NWAY_RST: {
-		if(netif_running(netdev)) {
-			e1000_down(adapter);
-			e1000_up(adapter);
-		}
-		return 0;
-	}
-	case ETHTOOL_PHYS_ID: {
-		struct ethtool_value id;
-		if(copy_from_user(&id, addr, sizeof(id)))
-			return -EFAULT;
-		return e1000_ethtool_led_blink(adapter, &id);
-	}
-	case ETHTOOL_GLINK: {
-		struct ethtool_value link = {ETHTOOL_GLINK};
-		link.data = netif_carrier_ok(netdev);
-		if(copy_to_user(addr, &link, sizeof(link)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_GWOL: {
-		struct ethtool_wolinfo wol = {ETHTOOL_GWOL};
-		e1000_ethtool_gwol(adapter, &wol);
-		if(copy_to_user(addr, &wol, sizeof(wol)) != 0)
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SWOL: {
-		struct ethtool_wolinfo wol;
-		if(copy_from_user(&wol, addr, sizeof(wol)) != 0)
-			return -EFAULT;
-		return e1000_ethtool_swol(adapter, &wol);
-	}
-	case ETHTOOL_GEEPROM: {
-		struct ethtool_eeprom eeprom = {ETHTOOL_GEEPROM};
-		struct e1000_hw *hw = &adapter->hw;
-		uint16_t *eeprom_buff;
-		void *ptr;
-		int err = 0;
-
-		if(copy_from_user(&eeprom, addr, sizeof(eeprom)))
-			return -EFAULT;
-
-		eeprom_buff = kmalloc(hw->eeprom.word_size * 2, GFP_KERNEL);
-
-		if(!eeprom_buff)
-			return -ENOMEM;
-
-		if((err = e1000_ethtool_geeprom(adapter, &eeprom,
-						eeprom_buff)))
-			goto err_geeprom_ioctl;
-
-		if(copy_to_user(addr, &eeprom, sizeof(eeprom))) {
-			err = -EFAULT;
-			goto err_geeprom_ioctl;
-		}
-
-		addr += offsetof(struct ethtool_eeprom, data);
-		ptr = ((void *)eeprom_buff) + (eeprom.offset & 1);
-
-		if(copy_to_user(addr, ptr, eeprom.len))
-			err = -EFAULT;
-
-err_geeprom_ioctl:
-		kfree(eeprom_buff);
-		return err;
-	}
-	case ETHTOOL_SEEPROM: {
-		struct ethtool_eeprom eeprom;
-
-		if(copy_from_user(&eeprom, addr, sizeof(eeprom)))
-			return -EFAULT;
-
-		addr += offsetof(struct ethtool_eeprom, data);
-		return e1000_ethtool_seeprom(adapter, &eeprom, addr);
-	}
-	case ETHTOOL_GRINGPARAM: {
-		struct ethtool_ringparam ering = {ETHTOOL_GRINGPARAM};
-		e1000_ethtool_gring(adapter, &ering);
-		if(copy_to_user(addr, &ering, sizeof(ering)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SRINGPARAM: {
-		struct ethtool_ringparam ering;
-		if(copy_from_user(&ering, addr, sizeof(ering)))
-			return -EFAULT;
-		return e1000_ethtool_sring(adapter, &ering);
-	}
-	case ETHTOOL_GPAUSEPARAM: {
-		struct ethtool_pauseparam epause = {ETHTOOL_GPAUSEPARAM};
-		e1000_ethtool_gpause(adapter, &epause);
-		if(copy_to_user(addr, &epause, sizeof(epause)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SPAUSEPARAM: {
-		struct ethtool_pauseparam epause;
-		if(copy_from_user(&epause, addr, sizeof(epause)))
-			return -EFAULT;
-		return e1000_ethtool_spause(adapter, &epause);
-	}
-	case ETHTOOL_GSTATS: {
-		struct {
-			struct ethtool_stats eth_stats;
-			uint64_t data[E1000_STATS_LEN];
-		} stats = { {ETHTOOL_GSTATS, E1000_STATS_LEN} };
-		int i;
-
-		e1000_update_stats(adapter);
-		for(i = 0; i < E1000_STATS_LEN; i++)
-			stats.data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
-					sizeof(uint64_t)) ?
-				*(uint64_t *)((char *)adapter +
-					e1000_gstrings_stats[i].stat_offset) :
-				*(uint32_t *)((char *)adapter +
-					e1000_gstrings_stats[i].stat_offset);
-		if(copy_to_user(addr, &stats, sizeof(stats)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_TEST: {
-		struct {
-			struct ethtool_test eth_test;
-			uint64_t data[E1000_TEST_LEN];
-		} test = { {ETHTOOL_TEST} };
-		int err;
-
-		if(copy_from_user(&test.eth_test, addr, sizeof(test.eth_test)))
-			return -EFAULT;
-
-		test.eth_test.len = E1000_TEST_LEN;
-
-		if((err = e1000_ethtool_test(adapter, &test.eth_test,
-					     test.data)))
-			return err;
-
-		if(copy_to_user(addr, &test, sizeof(test)) != 0)
-			return -EFAULT;
-		return 0;
+	if(netif_running(netdev)) {
+		e1000_down(adapter);
+		e1000_up(adapter);
 	}
-	case ETHTOOL_GRXCSUM: {
-		struct ethtool_value edata = { ETHTOOL_GRXCSUM };
+	return 0;
+}
 
-		edata.data = adapter->rx_csum;
-		if (copy_to_user(addr, &edata, sizeof(edata)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_SRXCSUM: {
-		struct ethtool_value edata;
+static int 
+e1000_get_stats_count(struct net_device *netdev)
+{
+	return E1000_STATS_LEN;
+}
 
-		if (copy_from_user(&edata, addr, sizeof(edata)))
-			return -EFAULT;
-		adapter->rx_csum = edata.data;
-		if(netif_running(netdev)) {
-			e1000_down(adapter);
-			e1000_up(adapter);
-		} else
-			e1000_reset(adapter);
-		return 0;
-	}
-	case ETHTOOL_GTXCSUM: {
-		struct ethtool_value edata = { ETHTOOL_GTXCSUM };
+static void 
+e1000_get_ethtool_stats(struct net_device *netdev, 
+		struct ethtool_stats *stats, uint64_t *data)
+{
+	struct e1000_adapter *adapter = netdev->priv;
+	int i;
 
-		edata.data =
-			(netdev->features & NETIF_F_HW_CSUM) != 0;
-		if (copy_to_user(addr, &edata, sizeof(edata)))
-			return -EFAULT;
-		return 0;
+	e1000_update_stats(adapter);
+	for(i = 0; i < E1000_STATS_LEN; i++) {
+		char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;	
+		data[i] = (e1000_gstrings_stats[i].sizeof_stat == sizeof(uint64_t)) 
+			? *(uint64_t *)p : *(uint32_t *)p;
 	}
-	case ETHTOOL_STXCSUM: {
-		struct ethtool_value edata;
+}
 
-		if (copy_from_user(&edata, addr, sizeof(edata)))
-			return -EFAULT;
+static void 
+e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
+{
+	int i;
 
-		if(adapter->hw.mac_type < e1000_82543) {
-			if (edata.data != 0)
-				return -EINVAL;
-			return 0;
+	switch(stringset) {
+	case ETH_SS_TEST:
+		memcpy(data, *e1000_gstrings_test, 
+			E1000_TEST_LEN*ETH_GSTRING_LEN);
+		break;
+	case ETH_SS_STATS:
+		for (i=0; i < E1000_STATS_LEN; i++) {
+			memcpy(data + i * ETH_GSTRING_LEN, 
+			e1000_gstrings_stats[i].stat_string,
+			ETH_GSTRING_LEN);
 		}
-
-		if (edata.data)
-			netdev->features |= NETIF_F_HW_CSUM;
-		else
-			netdev->features &= ~NETIF_F_HW_CSUM;
-
-		return 0;
-	}
-	case ETHTOOL_GSG: {
-		struct ethtool_value edata = { ETHTOOL_GSG };
-
-		edata.data =
-			(netdev->features & NETIF_F_SG) != 0;
-		if (copy_to_user(addr, &edata, sizeof(edata)))
-			return -EFAULT;
-		return 0;
+		break;
 	}
-	case ETHTOOL_SSG: {
-		struct ethtool_value edata;
-
-		if (copy_from_user(&edata, addr, sizeof(edata)))
-			return -EFAULT;
-
-		if (edata.data)
-			netdev->features |= NETIF_F_SG;
-		else
-			netdev->features &= ~NETIF_F_SG;
+}
 
-		return 0;
-	}
+struct ethtool_ops e1000_ethtool_ops = {
+	.get_settings           = e1000_get_settings,
+	.set_settings           = e1000_set_settings,
+	.get_drvinfo            = e1000_get_drvinfo,
+	.get_regs_len           = e1000_get_regs_len,
+	.get_regs               = e1000_get_regs,
+	.get_wol                = e1000_get_wol,
+	.set_wol                = e1000_set_wol,
+	.get_msglevel	        = e1000_get_msglevel,
+	.set_msglevel	        = e1000_set_msglevel,
+	.nway_reset             = e1000_nway_reset,
+	.get_link               = ethtool_op_get_link,
+	.get_eeprom_len         = e1000_get_eeprom_len,
+	.get_eeprom             = e1000_get_eeprom,
+	.set_eeprom             = e1000_set_eeprom,
+	.get_ringparam          = e1000_get_ringparam,
+	.set_ringparam          = e1000_set_ringparam,
+	.get_pauseparam		= e1000_get_pauseparam,
+	.set_pauseparam		= e1000_set_pauseparam,
+	.get_rx_csum		= e1000_get_rx_csum,
+	.set_rx_csum		= e1000_set_rx_csum,
+	.get_tx_csum		= e1000_get_tx_csum,
+	.set_tx_csum		= e1000_set_tx_csum,
+	.get_sg			= ethtool_op_get_sg,
+	.set_sg			= ethtool_op_set_sg,
 #ifdef NETIF_F_TSO
-	case ETHTOOL_GTSO: {
-		struct ethtool_value edata = { ETHTOOL_GTSO };
-
-		edata.data = (netdev->features & NETIF_F_TSO) != 0;
-		if (copy_to_user(addr, &edata, sizeof(edata)))
-			return -EFAULT;
-		return 0;
-	}
-	case ETHTOOL_STSO: {
-		struct ethtool_value edata;
-
-		if (copy_from_user(&edata, addr, sizeof(edata)))
-			return -EFAULT;
-
-		if ((adapter->hw.mac_type < e1000_82544) ||
-		    (adapter->hw.mac_type == e1000_82547)) {
-			if (edata.data != 0)
-				return -EINVAL;
-			return 0;
-		}
-
-		if (edata.data)
-			netdev->features |= NETIF_F_TSO;
-		else
-			netdev->features &= ~NETIF_F_TSO;
-
-		return 0;
-	}
+	.get_tso		= ethtool_op_get_tso,
+	.set_tso		= e1000_set_tso,
 #endif
-	default:
-		return -EOPNOTSUPP;
-	}
-}
-
+	.self_test_count        = e1000_diag_test_count,
+	.self_test              = e1000_diag_test,
+	.get_strings            = e1000_get_strings,
+	.phys_id                = e1000_phys_id,
+	.get_stats_count        = e1000_get_stats_count,
+	.get_ethtool_stats      = e1000_get_ethtool_stats,
+};
 
+void set_ethtool_ops(struct net_device *netdev)
+{
+	SET_ETHTOOL_OPS(netdev, &e1000_ethtool_ops);
+}
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 5d58928f9..a4d68616c 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -470,7 +470,6 @@ e1000_init_hw(struct e1000_hw *hw)
     uint16_t pcix_stat_hi_word;
     uint16_t cmd_mmrbc;
     uint16_t stat_mmrbc;
-
     DEBUGFUNC("e1000_init_hw");
 
     /* Initialize Identification LED */
@@ -910,6 +909,12 @@ e1000_setup_copper_link(struct e1000_hw *hw)
     if(ret_val)
         return ret_val;
 
+    if(hw->mac_type == e1000_82545_rev_3) {
+        ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
+        phy_data |= 0x00000008;
+        ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
+    }
+
     if(hw->mac_type <= e1000_82543 ||
        hw->mac_type == e1000_82541 || hw->mac_type == e1000_82547 ||
        hw->mac_type == e1000_82541_rev_2 || hw->mac_type == e1000_82547_rev_2)
@@ -1961,7 +1966,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
 int32_t
 e1000_check_for_link(struct e1000_hw *hw)
 {
-    uint32_t rxcw;
+    uint32_t rxcw = 0;
     uint32_t ctrl;
     uint32_t status;
     uint32_t rctl;
@@ -1971,16 +1976,23 @@ e1000_check_for_link(struct e1000_hw *hw)
 
     DEBUGFUNC("e1000_check_for_link");
 
+    ctrl = E1000_READ_REG(hw, CTRL);
+    status = E1000_READ_REG(hw, STATUS);
+
     /* On adapters with a MAC newer than 82544, SW Defineable pin 1 will be
      * set when the optics detect a signal. On older adapters, it will be
      * cleared when there is a signal.  This applies to fiber media only.
      */
-    if(hw->media_type == e1000_media_type_fiber)
-        signal = (hw->mac_type > e1000_82544) ? E1000_CTRL_SWDPIN1 : 0;
+    if((hw->media_type == e1000_media_type_fiber) ||
+       (hw->media_type == e1000_media_type_internal_serdes)) {
+        rxcw = E1000_READ_REG(hw, RXCW);
 
-    ctrl = E1000_READ_REG(hw, CTRL);
-    status = E1000_READ_REG(hw, STATUS);
-    rxcw = E1000_READ_REG(hw, RXCW);
+        if(hw->media_type == e1000_media_type_fiber) {
+            signal = (hw->mac_type > e1000_82544) ? E1000_CTRL_SWDPIN1 : 0;
+            if(status & E1000_STATUS_LU)
+                hw->get_link_status = FALSE;
+        }
+    }
 
     /* If we have a copper PHY then we only want to go out to the PHY
      * registers to see if Auto-Neg has completed and/or if our link
@@ -2093,8 +2105,8 @@ e1000_check_for_link(struct e1000_hw *hw)
      * in. The autoneg_failed flag does this.
      */
     else if((((hw->media_type == e1000_media_type_fiber) &&
-            ((ctrl & E1000_CTRL_SWDPIN1) == signal)) ||
-            (hw->media_type == e1000_media_type_internal_serdes)) &&
+              ((ctrl & E1000_CTRL_SWDPIN1) == signal)) ||
+             (hw->media_type == e1000_media_type_internal_serdes)) &&
             (!(status & E1000_STATUS_LU)) &&
             (!(rxcw & E1000_RXCW_C))) {
         if(hw->autoneg_failed == 0) {
@@ -2125,8 +2137,7 @@ e1000_check_for_link(struct e1000_hw *hw)
      */
     else if(((hw->media_type == e1000_media_type_fiber) ||
              (hw->media_type == e1000_media_type_internal_serdes)) &&
-              (ctrl & E1000_CTRL_SLU) &&
-              (rxcw & E1000_RXCW_C)) {
+            (ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
         DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\r\n");
         E1000_WRITE_REG(hw, TXCW, hw->txcw);
         E1000_WRITE_REG(hw, CTRL, (ctrl & ~E1000_CTRL_SLU));
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index e2a9d4f87..da964359d 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -2019,7 +2019,7 @@ struct e1000_hw {
 #define IGP01E1000_PSSR_MDIX_SHIFT             0x000B /* shift right 11 */
 
 /* IGP01E1000 Specific Port Control Register - R/W */
-#define IGP01E1000_PSCR_TP_LOOPBACK            0x0001
+#define IGP01E1000_PSCR_TP_LOOPBACK            0x0010
 #define IGP01E1000_PSCR_CORRECT_NC_SCMBLR      0x0200
 #define IGP01E1000_PSCR_TEN_CRS_SELECT         0x0400
 #define IGP01E1000_PSCR_FLIP_CHIP              0x0800
@@ -2029,16 +2029,18 @@ struct e1000_hw {
 /* IGP01E1000 Specific Port Link Health Register */
 #define IGP01E1000_PLHR_SS_DOWNGRADE           0x8000
 #define IGP01E1000_PLHR_GIG_SCRAMBLER_ERROR    0x4000
+#define IGP01E1000_PLHR_MASTER_FAULT           0x2000
+#define IGP01E1000_PLHR_MASTER_RESOLUTION      0x1000
 #define IGP01E1000_PLHR_GIG_REM_RCVR_NOK       0x0800 /* LH */
 #define IGP01E1000_PLHR_IDLE_ERROR_CNT_OFLOW   0x0400 /* LH */
 #define IGP01E1000_PLHR_DATA_ERR_1             0x0200 /* LH */
 #define IGP01E1000_PLHR_DATA_ERR_0             0x0100
-#define IGP01E1000_PLHR_AUTONEG_FAULT          0x0010
-#define IGP01E1000_PLHR_AUTONEG_ACTIVE         0x0008
-#define IGP01E1000_PLHR_VALID_CHANNEL_D        0x0004
-#define IGP01E1000_PLHR_VALID_CHANNEL_C        0x0002
-#define IGP01E1000_PLHR_VALID_CHANNEL_B        0x0001
-#define IGP01E1000_PLHR_VALID_CHANNEL_A        0x0000
+#define IGP01E1000_PLHR_AUTONEG_FAULT          0x0040
+#define IGP01E1000_PLHR_AUTONEG_ACTIVE         0x0010
+#define IGP01E1000_PLHR_VALID_CHANNEL_D        0x0008
+#define IGP01E1000_PLHR_VALID_CHANNEL_C        0x0004
+#define IGP01E1000_PLHR_VALID_CHANNEL_B        0x0002
+#define IGP01E1000_PLHR_VALID_CHANNEL_A        0x0001
 
 /* IGP01E1000 Channel Quality Register */
 #define IGP01E1000_MSE_CHANNEL_D        0x000F
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 3a0da3285..256e86c1b 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -27,55 +27,32 @@
 *******************************************************************************/
 
 #include "e1000.h"
+#include <linux/rtnetlink.h>
 
 /* Change Log
  *
+ * 5.2.51   5/14/04
+ *   o set default configuration to 'NAPI disabled'. NAPI enabled driver
+ *     causes kernel panic when the interface is shutdown while data is being
+ *     transferred.
+ * 5.2.47   5/04/04
+ *   o fixed ethtool -t implementation
+ * 5.2.45   4/29/04
+ *   o fixed ethtool -e implementation
+ *   o Support for ethtool ops [Stephen Hemminger (shemminger@osdl.org)]
+ * 5.2.42   4/26/04
+ *   o Added support for the DPRINTK macro for enhanced error logging.  Some
+ *     parts of the patch were supplied by Jon Mason.
+ *   o Move the register_netdevice() donw in the probe routine due to a 
+ *     loading/unloading test issue.
+ *   o Added a long RX byte count the the extra ethtool data members for BER
+ *     testing purposes.
  * 5.2.39	3/12/04
- *   o Added support to read/write eeprom data in proper order.
- *     By default device eeprom is always little-endian, word
- *     addressable 
- *   o Disable TSO as the default for the driver until hangs
- *     reported against non-IA acrhs can be root-caused.
- *   o Back out the CSA fix for 82547 as it continues to cause
- *     systems lock-ups with production systems.
- *   o Fixed FC high/low water mark values to actually be in the
- *     range of the Rx FIFO area.  It was a math error.
- *     [Dainis Jonitis (dainis_jonitis@exigengroup.lv)]
- *   o Handle failure to get new resources when doing ethtool
- *     ring paramater changes.  Previously, driver would free old,
- *     but fails to allocate new, causing problems.  Now, driver 
- *     allocates new, and if sucessful, frees old.
- *   o Changed collision threshold from 16 to 15 to comply with IEEE
- *     spec.
- *   o Toggle chip-select when checking ready status on SPI eeproms.
- *   o Put PHY into class A mode to pass IEEE tests on some designs.
- *     Designs with EEPROM word 0x7, bit 15 set will have their PHYs
- *     set to class A mode, rather than the default class AB.
- *   o Handle failures of register_netdev.  Stephen Hemminger
- *     [shemminger@osdl.org].
- *   o updated README & MAN pages, number of Transmit/Receive
- *     descriptors may be denied depending on system resources.
- *
- * 5.2.30	1/14/03
- *   o Set VLAN filtering to IEEE 802.1Q after reset so we don't break
- *     SoL connections that use VLANs.
- *   o Allow 1000/Full setting for AutoNeg param for Fiber connections
- *     Jon D Mason [jonmason@us.ibm.com].
- *   o Race between Tx queue and Tx clean fixed with a spin lock.
- *   o Added netpoll support.
- *   o Fixed endianess bug causing ethtool loopback diags to fail on ppc.
- *   o Use pdev->irq rather than netdev->irq in preparation for MSI support.
- *   o Report driver message on user override of InterruptThrottleRate
- *     module parameter.
- *   o Change I/O address storage from uint32_t to unsigned long.
- *   o Added ethtool RINGPARAM support.
- *
- * 5.2.22	10/15/03
  */
 
 char e1000_driver_name[] = "e1000";
 char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
-char e1000_driver_version[] = "5.2.39-k2";
+char e1000_driver_version[] = "5.2.52-k4";
 char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
 
 /* e1000_pci_tbl - PCI Device ID Table
@@ -170,6 +147,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter);
 static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
 			   int cmd);
+void set_ethtool_ops(struct net_device *netdev);
 static void e1000_enter_82542_rst(struct e1000_adapter *adapter);
 static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
 static inline void e1000_rx_checksum(struct e1000_adapter *adapter,
@@ -206,7 +184,7 @@ struct notifier_block e1000_notifier_reboot = {
 /* Exported from other modules */
 
 extern void e1000_check_options(struct e1000_adapter *adapter);
-extern int e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr);
+
 
 static struct pci_driver e1000_driver = {
 	.name     = e1000_driver_name,
@@ -224,6 +202,10 @@ MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
 MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
 MODULE_LICENSE("GPL");
 
+static int debug = 3;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
+
 /**
  * e1000_init_module - Driver Registration Routine
  *
@@ -419,6 +401,12 @@ e1000_probe(struct pci_dev *pdev,
 	adapter->netdev = netdev;
 	adapter->pdev = pdev;
 	adapter->hw.back = adapter;
+	adapter->msg_enable = (1 << debug) - 1;
+
+	rtnl_lock();
+	/* we need to set the name early since the DPRINTK macro needs it set */
+	if (dev_alloc_name(netdev, netdev->name) < 0) 
+		goto err_free_unlock;
 
 	mmio_start = pci_resource_start(pdev, BAR_0);
 	mmio_len = pci_resource_len(pdev, BAR_0);
@@ -446,6 +434,7 @@ e1000_probe(struct pci_dev *pdev,
 	netdev->set_mac_address = &e1000_set_mac;
 	netdev->change_mtu = &e1000_change_mtu;
 	netdev->do_ioctl = &e1000_ioctl;
+	set_ethtool_ops(netdev);
 	netdev->tx_timeout = &e1000_tx_timeout;
 	netdev->watchdog_timeo = 5 * HZ;
 #ifdef CONFIG_E1000_NAPI
@@ -502,7 +491,7 @@ e1000_probe(struct pci_dev *pdev,
 	/* make sure the EEPROM is good */
 
 	if(e1000_validate_eeprom_checksum(&adapter->hw) < 0) {
-		printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n");
+		DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
 		err = -EIO;
 		goto err_eeprom;
 	}
@@ -536,16 +525,12 @@ e1000_probe(struct pci_dev *pdev,
 	INIT_WORK(&adapter->tx_timeout_task,
 		(void (*)(void *))e1000_tx_timeout_task, netdev);
 
-	if((err = register_netdev(netdev)))
-		goto err_register;
-
 	/* we're going to reset, so assume we have no link for now */
 
 	netif_carrier_off(netdev);
 	netif_stop_queue(netdev);
 
-	printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Connection\n",
-	       netdev->name);
+	DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n");
 	e1000_check_options(adapter);
 
 	/* Initial Wake on LAN setting
@@ -579,7 +564,12 @@ e1000_probe(struct pci_dev *pdev,
 
 	e1000_reset(adapter);
 
+	/* since we are holding the rtnl lock already, call the no-lock version */
+	if((err = register_netdevice(netdev)))
+		goto err_register;
+
 	cards_found++;
+	rtnl_unlock();
 	return 0;
 
 err_register:
@@ -587,6 +577,8 @@ err_sw_init:
 err_eeprom:
 	iounmap(adapter->hw.hw_addr);
 err_ioremap:
+err_free_unlock:
+	rtnl_unlock();
 	free_netdev(netdev);
 err_alloc_etherdev:
 	pci_release_regions(pdev);
@@ -664,7 +656,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
 	/* identify the MAC */
 
 	if (e1000_set_mac_type(hw)) {
-		E1000_ERR("Unknown MAC Type\n");
+		DPRINTK(PROBE, ERR, "Unknown MAC Type\n");
 		return -EIO;
 	}
 
@@ -1391,9 +1383,8 @@ e1000_watchdog(unsigned long data)
 			                           &adapter->link_speed,
 			                           &adapter->link_duplex);
 
-			printk(KERN_INFO
-			       "e1000: %s NIC Link is Up %d Mbps %s\n",
-			       netdev->name, adapter->link_speed,
+			DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s\n",
+			       adapter->link_speed,
 			       adapter->link_duplex == FULL_DUPLEX ?
 			       "Full Duplex" : "Half Duplex");
 
@@ -1406,9 +1397,7 @@ e1000_watchdog(unsigned long data)
 		if(netif_carrier_ok(netdev)) {
 			adapter->link_speed = 0;
 			adapter->link_duplex = 0;
-			printk(KERN_INFO
-			       "e1000: %s NIC Link is Down\n",
-			       netdev->name);
+			DPRINTK(LINK, INFO, "NIC Link is Down\n");
 			netif_carrier_off(netdev);
 			netif_stop_queue(netdev);
 			mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ);
@@ -1560,33 +1549,17 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
 
 static inline int
 e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb,
-	unsigned int first)
+	unsigned int first, unsigned int max_per_txd,
+	unsigned int nr_frags, unsigned int mss)
 {
 	struct e1000_desc_ring *tx_ring = &adapter->tx_ring;
-	struct e1000_tx_desc *tx_desc;
 	struct e1000_buffer *buffer_info;
-	unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD;
+	unsigned int len = skb->len;
 	unsigned int offset = 0, size, count = 0, i;
-#ifdef NETIF_F_TSO
-	unsigned int mss;
-#endif
-	unsigned int nr_frags;
 	unsigned int f;
-
-#ifdef NETIF_F_TSO
-	mss = skb_shinfo(skb)->tso_size;
-	/* The controller does a simple calculation to 
-	 * make sure there is enough room in the FIFO before
-	 * initiating the DMA for each buffer.  The calc is:
-	 * 4 = ceil(buffer len/mss).  To make sure we don't
-	 * overrun the FIFO, adjust the max buffer len if mss
-	 * drops. */
-	if(mss)
-		max_per_txd = min(mss << 2, max_per_txd);
-#endif
-	nr_frags = skb_shinfo(skb)->nr_frags;
 	len -= skb->data_len;
 
+
 	i = tx_ring->next_to_use;
 
 	while(len) {
@@ -1658,46 +1631,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb,
 			if(++i == tx_ring->count) i = 0;
 		}
 	}
-
-	if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) {
-
-		/* There aren't enough descriptors available to queue up
-		 * this send (need: count + 1 context desc + 1 desc gap
-		 * to keep tail from touching head), so undo the mapping
-		 * and abort the send.  We could have done the check before
-		 * we mapped the skb, but because of all the workarounds
-		 * (above), it's too difficult to predict how many we're
-		 * going to need.*/
-		i = tx_ring->next_to_use;
-
-		if(i == first) {
-			/* Cleanup after e1000_tx_[csum|tso] scribbling
-			 * on descriptors. */
-			tx_desc = E1000_TX_DESC(*tx_ring, first);
-			tx_desc->buffer_addr = 0;
-			tx_desc->lower.data = 0;
-			tx_desc->upper.data = 0;
-		}
-
-		while(count--) {
-			buffer_info = &tx_ring->buffer_info[i];
-
-			if(buffer_info->dma) {
-				pci_unmap_page(adapter->pdev,
-					       buffer_info->dma,
-					       buffer_info->length,
-					       PCI_DMA_TODEVICE);
-				buffer_info->dma = 0;
-			}
-
-			if(++i == tx_ring->count) i = 0;
-		}
-
-		tx_ring->next_to_use = first;
-
-		return 0;
-	}
-
 	i = (i == 0) ? tx_ring->count - 1 : i - 1;
 	tx_ring->buffer_info[i].skb = skb;
 	tx_ring->buffer_info[first].next_to_watch = i;
@@ -1792,27 +1725,72 @@ no_fifo_stall_required:
 	return 0;
 }
 
+#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) 
 static int
 e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev->priv;
-	unsigned int first;
+	unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD;
+	unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
 	unsigned int tx_flags = 0;
 	unsigned long flags;
-	int count;
-
+	unsigned int len = skb->len;
+	int count = 0;
+	unsigned int mss = 0;
+	unsigned int nr_frags = 0;
+	unsigned int f;
+	nr_frags = skb_shinfo(skb)->nr_frags;
+	len -= skb->data_len;
 	if(skb->len <= 0) {
 		dev_kfree_skb_any(skb);
 		return 0;
 	}
 
+#ifdef NETIF_F_TSO
+	mss = skb_shinfo(skb)->tso_size;
+	/* The controller does a simple calculation to 
+	 * make sure there is enough room in the FIFO before
+	 * initiating the DMA for each buffer.  The calc is:
+	 * 4 = ceil(buffer len/mss).  To make sure we don't
+	 * overrun the FIFO, adjust the max buffer len if mss
+	 * drops. */
+	if(mss) {
+		max_per_txd = min(mss << 2, max_per_txd);
+		max_txd_pwr = fls(max_per_txd) - 1;
+	}
+	if((mss) || (skb->ip_summed == CHECKSUM_HW))
+		count++;
+	count++;	/*for sentinel desc*/
+#else
+	if(skb->ip_summed == CHECKSUM_HW)
+		count++;
+#endif
+
+	count += TXD_USE_COUNT(len, max_txd_pwr);
+	if(adapter->pcix_82544)
+		count++;
+
+	nr_frags = skb_shinfo(skb)->nr_frags;
+	for(f = 0; f < nr_frags; f++)
+		count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,
+		                       max_txd_pwr);
+	if(adapter->pcix_82544)
+		count += nr_frags;
+	
 	spin_lock_irqsave(&adapter->tx_lock, flags);
+	/* need: count +  2 desc gap to keep tail from touching 
+	 * head, otherwise try next time */
+	if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2 ) {
+		netif_stop_queue(netdev);
+		spin_unlock_irqrestore(&adapter->tx_lock, flags);
+		return 1;
+	}
+	spin_unlock_irqrestore(&adapter->tx_lock, flags);
 
 	if(adapter->hw.mac_type == e1000_82547) {
 		if(e1000_82547_fifo_workaround(adapter, skb)) {
 			netif_stop_queue(netdev);
 			mod_timer(&adapter->tx_fifo_stall_timer, jiffies);
-			spin_unlock_irqrestore(&adapter->tx_lock, flags);
 			return 1;
 		}
 	}
@@ -1829,18 +1807,12 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	else if(e1000_tx_csum(adapter, skb))
 		tx_flags |= E1000_TX_FLAGS_CSUM;
 
-	if((count = e1000_tx_map(adapter, skb, first)))
-		e1000_tx_queue(adapter, count, tx_flags);
-	else {
-		netif_stop_queue(netdev);
-		spin_unlock_irqrestore(&adapter->tx_lock, flags);
-		return 1;
-	}
+	e1000_tx_queue(adapter, 
+		e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss), 
+		tx_flags);
 
 	netdev->trans_start = jiffies;
 
-	spin_unlock_irqrestore(&adapter->tx_lock, flags);
-	
 	return 0;
 }
 
@@ -1903,7 +1875,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
 
 	if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
 	   (max_frame > MAX_JUMBO_FRAME_SIZE)) {
-		E1000_ERR("Invalid MTU setting\n");
+		DPRINTK(PROBE, ERR, "Invalid MTU setting\n");
 		return -EINVAL;
 	}
 
@@ -1911,7 +1883,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
 		adapter->rx_buffer_len = E1000_RXBUFFER_2048;
 
 	} else if(adapter->hw.mac_type < e1000_82543) {
-		E1000_ERR("Jumbo Frames not supported on 82542\n");
+		DPRINTK(PROBE, ERR, "Jumbo Frames not supported on 82542\n");
 		return -EINVAL;
 
 	} else if(max_frame <= E1000_RXBUFFER_4096) {
@@ -2171,6 +2143,7 @@ e1000_clean(struct net_device *netdev, int *budget)
 	if(work_done < work_to_do || !netif_running(netdev)) {
 		netif_rx_complete(netdev);
 		e1000_irq_enable(adapter);
+		return 0;
 	}
 
 	return (work_done >= work_to_do);
@@ -2193,7 +2166,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter)
 	unsigned int i, eop;
 	boolean_t cleaned = FALSE;
 
-	spin_lock(&adapter->tx_lock);
 
 	i = tx_ring->next_to_clean;
 	eop = tx_ring->buffer_info[i].next_to_watch;
@@ -2236,6 +2208,8 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter)
 
 	tx_ring->next_to_clean = i;
 
+	spin_lock(&adapter->tx_lock);
+
 	if(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev))
 		netif_wake_queue(netdev);
 
@@ -2296,7 +2270,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter)
 
 			/* All receives must fit into a single buffer */
 
-			E1000_DBG("Receive packet consumed multiple buffers\n");
+			E1000_DBG("%s: Receive packet consumed multiple buffers\n",
+				netdev->name);
 
 			dev_kfree_skb_irq(skb);
 			rx_desc->status = 0;
@@ -2513,8 +2488,6 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 	case SIOCGMIIREG:
 	case SIOCSMIIREG:
 		return e1000_mii_ioctl(netdev, ifr, cmd);
-	case SIOCETHTOOL:
-		return e1000_ethtool_ioctl(netdev, ifr);
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -2531,7 +2504,7 @@ static int
 e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 {
 	struct e1000_adapter *adapter = netdev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
+	struct mii_ioctl_data *data = if_mii(ifr);
 	int retval;
 	uint16_t mii_reg;
 	uint16_t spddplx;
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index d8d8c7e56..3e79a45de 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -234,7 +234,8 @@ struct e1000_option {
 };
 
 static int __devinit
-e1000_validate_option(int *value, struct e1000_option *opt)
+e1000_validate_option(int *value, struct e1000_option *opt,
+	struct e1000_adapter *adapter)
 {
 	if(*value == OPTION_UNSET) {
 		*value = opt->def;
@@ -245,16 +246,17 @@ e1000_validate_option(int *value, struct e1000_option *opt)
 	case enable_option:
 		switch (*value) {
 		case OPTION_ENABLED:
-			printk(KERN_INFO "%s Enabled\n", opt->name);
+			DPRINTK(PROBE, INFO, "%s Enabled\n", opt->name);
 			return 0;
 		case OPTION_DISABLED:
-			printk(KERN_INFO "%s Disabled\n", opt->name);
+			DPRINTK(PROBE, INFO, "%s Disabled\n", opt->name);
 			return 0;
 		}
 		break;
 	case range_option:
 		if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
-			printk(KERN_INFO "%s set to %i\n", opt->name, *value);
+			DPRINTK(PROBE, INFO,
+				"%s set to %i\n", opt->name, *value);
 			return 0;
 		}
 		break;
@@ -266,7 +268,7 @@ e1000_validate_option(int *value, struct e1000_option *opt)
 			ent = &opt->arg.l.p[i];
 			if(*value == ent->i) {
 				if(ent->str[0] != '\0')
-					printk(KERN_INFO "%s\n", ent->str);
+					DPRINTK(PROBE, INFO, "%s\n", ent->str);
 				return 0;
 			}
 		}
@@ -276,7 +278,7 @@ e1000_validate_option(int *value, struct e1000_option *opt)
 		BUG();
 	}
 
-	printk(KERN_INFO "Invalid %s specified (%i) %s\n",
+	DPRINTK(PROBE, INFO, "Invalid %s specified (%i) %s\n",
 	       opt->name, *value, opt->err);
 	*value = opt->def;
 	return -1;
@@ -300,9 +302,9 @@ e1000_check_options(struct e1000_adapter *adapter)
 {
 	int bd = adapter->bd_number;
 	if(bd >= E1000_MAX_NIC) {
-		printk(KERN_NOTICE
+		DPRINTK(PROBE, NOTICE,
 		       "Warning: no configuration for board #%i\n", bd);
-		printk(KERN_NOTICE "Using defaults for all values\n");
+		DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
 		bd = E1000_MAX_NIC;
 	}
 
@@ -321,7 +323,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 			E1000_MAX_TXD : E1000_MAX_82544_TXD;
 
 		tx_ring->count = TxDescriptors[bd];
-		e1000_validate_option(&tx_ring->count, &opt);
+		e1000_validate_option(&tx_ring->count, &opt, adapter);
 		E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
 	}
 	{ /* Receive Descriptor Count */
@@ -339,7 +341,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 			E1000_MAX_82544_RXD;
 
 		rx_ring->count = RxDescriptors[bd];
-		e1000_validate_option(&rx_ring->count, &opt);
+		e1000_validate_option(&rx_ring->count, &opt, adapter);
 		E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
 	}
 	{ /* Checksum Offload Enable/Disable */
@@ -351,7 +353,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 		};
 
 		int rx_csum = XsumRX[bd];
-		e1000_validate_option(&rx_csum, &opt);
+		e1000_validate_option(&rx_csum, &opt, adapter);
 		adapter->rx_csum = rx_csum;
 	}
 	{ /* Flow Control */
@@ -373,7 +375,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 		};
 
 		int fc = FlowControl[bd];
-		e1000_validate_option(&fc, &opt);
+		e1000_validate_option(&fc, &opt, adapter);
 		adapter->hw.fc = adapter->hw.original_fc = fc;
 	}
 	{ /* Transmit Interrupt Delay */
@@ -387,7 +389,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 		};
 
 		adapter->tx_int_delay = TxIntDelay[bd];
-		e1000_validate_option(&adapter->tx_int_delay, &opt);
+		e1000_validate_option(&adapter->tx_int_delay, &opt, adapter);
 	}
 	{ /* Transmit Absolute Interrupt Delay */
 		struct e1000_option opt = {
@@ -400,7 +402,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 		};
 
 		adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
-		e1000_validate_option(&adapter->tx_abs_int_delay, &opt);
+		e1000_validate_option(&adapter->tx_abs_int_delay, &opt, adapter);
 	}
 	{ /* Receive Interrupt Delay */
 		struct e1000_option opt = {
@@ -413,7 +415,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 		};
 
 		adapter->rx_int_delay = RxIntDelay[bd];
-		e1000_validate_option(&adapter->rx_int_delay, &opt);
+		e1000_validate_option(&adapter->rx_int_delay, &opt, adapter);
 	}
 	{ /* Receive Absolute Interrupt Delay */
 		struct e1000_option opt = {
@@ -426,7 +428,7 @@ e1000_check_options(struct e1000_adapter *adapter)
 		};
 
 		adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
-		e1000_validate_option(&adapter->rx_abs_int_delay, &opt);
+		e1000_validate_option(&adapter->rx_abs_int_delay, &opt, adapter);
 	}
 	{ /* Interrupt Throttling Rate */
 		struct e1000_option opt = {
@@ -444,13 +446,14 @@ e1000_check_options(struct e1000_adapter *adapter)
 			adapter->itr = 1;
 			break;
 		case 0:
-			printk(KERN_INFO "%s turned off\n", opt.name);
+			DPRINTK(PROBE, INFO, "%s turned off\n", opt.name);
 			break;
 		case 1:
-			printk(KERN_INFO "%s set to dynamic mode\n", opt.name);
+			DPRINTK(PROBE, INFO,
+				"%s set to dynamic mode\n", opt.name);
 			break;
 		default:
-			e1000_validate_option(&adapter->itr, &opt);
+			e1000_validate_option(&adapter->itr, &opt, adapter);
 			break;
 		}
 	}
@@ -482,15 +485,15 @@ e1000_check_fiber_options(struct e1000_adapter *adapter)
 	bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
 
 	if((Speed[bd] != OPTION_UNSET)) {
-		printk(KERN_INFO "Speed not valid for fiber adapters, "
+		DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, "
 		       "parameter ignored\n");
 	}
 	if((Duplex[bd] != OPTION_UNSET)) {
-		printk(KERN_INFO "Duplex not valid for fiber adapters, "
+		DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, "
 		       "parameter ignored\n");
 	}
 	if((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) {
-		printk(KERN_INFO "AutoNeg other than Full/1000 is "
+		DPRINTK(PROBE, INFO, "AutoNeg other than Full/1000 is "
 		       "not valid for fiber adapters, parameter ignored\n");
 	}
 }
@@ -525,7 +528,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
 		};
 
 		speed = Speed[bd];
-		e1000_validate_option(&speed, &opt);
+		e1000_validate_option(&speed, &opt, adapter);
 	}
 	{ /* Duplex */
 		struct e1000_opt_list dplx_list[] = {{           0, "" },
@@ -542,11 +545,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
 		};
 
 		dplx = Duplex[bd];
-		e1000_validate_option(&dplx, &opt);
+		e1000_validate_option(&dplx, &opt, adapter);
 	}
 
 	if(AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) {
-		printk(KERN_INFO
+		DPRINTK(PROBE, INFO,
 		       "AutoNeg specified along with Speed or Duplex, "
 		       "parameter ignored\n");
 		adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
@@ -595,7 +598,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
 		};
 
 		int an = AutoNeg[bd];
-		e1000_validate_option(&an, &opt);
+		e1000_validate_option(&an, &opt, adapter);
 		adapter->hw.autoneg_advertised = an;
 	}
 
@@ -603,78 +606,85 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
 	case 0:
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
-			printk(KERN_INFO
+			DPRINTK(PROBE, INFO,
 			       "Speed and duplex autonegotiation enabled\n");
 		break;
 	case HALF_DUPLEX:
-		printk(KERN_INFO "Half Duplex specified without Speed\n");
-		printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n");
+		DPRINTK(PROBE, INFO, "Half Duplex specified without Speed\n");
+		DPRINTK(PROBE, INFO,
+			"Using Autonegotiation at Half Duplex only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
 		                                 ADVERTISE_100_HALF;
 		break;
 	case FULL_DUPLEX:
-		printk(KERN_INFO "Full Duplex specified without Speed\n");
-		printk(KERN_INFO "Using Autonegotiation at Full Duplex only\n");
+		DPRINTK(PROBE, INFO, "Full Duplex specified without Speed\n");
+		DPRINTK(PROBE, INFO,
+			"Using Autonegotiation at Full Duplex only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
 		                                 ADVERTISE_100_FULL |
 		                                 ADVERTISE_1000_FULL;
 		break;
 	case SPEED_10:
-		printk(KERN_INFO "10 Mbps Speed specified without Duplex\n");
-		printk(KERN_INFO "Using Autonegotiation at 10 Mbps only\n");
+		DPRINTK(PROBE, INFO,
+			"10 Mbps Speed specified without Duplex\n");
+		DPRINTK(PROBE, INFO, "Using Autonegotiation at 10 Mbps only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
 		                                 ADVERTISE_10_FULL;
 		break;
 	case SPEED_10 + HALF_DUPLEX:
-		printk(KERN_INFO "Forcing to 10 Mbps Half Duplex\n");
+		DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Half Duplex\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 0;
 		adapter->hw.forced_speed_duplex = e1000_10_half;
 		adapter->hw.autoneg_advertised = 0;
 		break;
 	case SPEED_10 + FULL_DUPLEX:
-		printk(KERN_INFO "Forcing to 10 Mbps Full Duplex\n");
+		DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Full Duplex\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 0;
 		adapter->hw.forced_speed_duplex = e1000_10_full;
 		adapter->hw.autoneg_advertised = 0;
 		break;
 	case SPEED_100:
-		printk(KERN_INFO "100 Mbps Speed specified without Duplex\n");
-		printk(KERN_INFO "Using Autonegotiation at 100 Mbps only\n");
+		DPRINTK(PROBE, INFO,
+			"100 Mbps Speed specified without Duplex\n");
+		DPRINTK(PROBE, INFO,
+			"Using Autonegotiation at 100 Mbps only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
 		                                 ADVERTISE_100_FULL;
 		break;
 	case SPEED_100 + HALF_DUPLEX:
-		printk(KERN_INFO "Forcing to 100 Mbps Half Duplex\n");
+		DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Half Duplex\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 0;
 		adapter->hw.forced_speed_duplex = e1000_100_half;
 		adapter->hw.autoneg_advertised = 0;
 		break;
 	case SPEED_100 + FULL_DUPLEX:
-		printk(KERN_INFO "Forcing to 100 Mbps Full Duplex\n");
+		DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Full Duplex\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 0;
 		adapter->hw.forced_speed_duplex = e1000_100_full;
 		adapter->hw.autoneg_advertised = 0;
 		break;
 	case SPEED_1000:
-		printk(KERN_INFO "1000 Mbps Speed specified without Duplex\n");
-		printk(KERN_INFO
+		DPRINTK(PROBE, INFO,
+			"1000 Mbps Speed specified without Duplex\n");
+		DPRINTK(PROBE, INFO,
 		       "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
 		break;
 	case SPEED_1000 + HALF_DUPLEX:
-		printk(KERN_INFO "Half Duplex is not supported at 1000 Mbps\n");
-		printk(KERN_INFO
+		DPRINTK(PROBE, INFO,
+			"Half Duplex is not supported at 1000 Mbps\n");
+		DPRINTK(PROBE, INFO,
 		       "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
 		break;
 	case SPEED_1000 + FULL_DUPLEX:
-		printk(KERN_INFO
+		DPRINTK(PROBE, INFO,
 		       "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
 		adapter->hw.autoneg = adapter->fc_autoneg = 1;
 		adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
@@ -685,7 +695,8 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
 
 	/* Speed, AutoNeg and MDI/MDI-X must all play nice */
 	if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
-		printk(KERN_INFO "Speed, AutoNeg and MDI-X specifications are "
+		DPRINTK(PROBE, INFO,
+		       "Speed, AutoNeg and MDI-X specifications are "
 		       "incompatible. Setting MDI-X to a compatible value.\n");
 	}
 }
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index cc83bdd17..56fc87881 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -120,7 +120,6 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 #include <linux/rtnetlink.h>
 #include <linux/skbuff.h>
 #include <linux/ethtool.h>
-#include <linux/mii.h>
 
 /* enable PIO instead of MMIO, if CONFIG_EEPRO100_PIO is selected */
 #ifdef CONFIG_EEPRO100_PIO
@@ -2018,7 +2017,7 @@ speedo_get_stats(struct net_device *dev)
 	return &sp->stats;
 }
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	u32 ethcmd;
 	struct speedo_private *sp = netdev_priv(dev);
@@ -2097,7 +2096,7 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
 static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct speedo_private *sp = netdev_priv(dev);
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	int phy = sp->phy[0] & 0x1f;
 	int saved_acpi;
 	int t;
@@ -2130,7 +2129,7 @@ static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		pci_set_power_state(sp->pdev, saved_acpi);
 		return 0;
 	case SIOCETHTOOL:
-		return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return netdev_ethtool_ioctl(dev, rq->ifr_data);
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index cf7ae0569..64e4aeb63 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -66,12 +66,15 @@
 	LK1.1.14 (Kryzsztof Halasa):
 	* fix spurious bad initializations
 	* pound phy a la SMSC's app note on the subject
+	
+	AC1.1.14ac
+	* fix power up/down for ethtool that broke in 1.11
 
 */
 
 #define DRV_NAME        "epic100"
-#define DRV_VERSION     "1.11+LK1.1.14"
-#define DRV_RELDATE     "Aug 4, 2002"
+#define DRV_VERSION     "1.11+LK1.1.14+AC1.1.14"
+#define DRV_RELDATE     "June 2, 2004"
 
 /* The user-configurable values.
    These may be modified when a driver module is loaded.*/
@@ -1424,6 +1427,27 @@ static void netdev_set_msglevel(struct net_device *dev, u32 value)
 	debug = value;
 }
 
+static int ethtool_begin(struct net_device *dev)
+{
+	unsigned long ioaddr = dev->base_addr;
+	/* power-up, if interface is down */
+	if (! netif_running(dev)) {
+		outl(0x0200, ioaddr + GENCTL);
+		outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
+	}
+	return 0;
+}
+
+static void ethtool_complete(struct net_device *dev)
+{
+	unsigned long ioaddr = dev->base_addr;
+	/* power-down, if interface is down */
+	if (! netif_running(dev)) {
+		outl(0x0008, ioaddr + GENCTL);
+		outl((inl(ioaddr + NVCTL) & ~0x483C) | 0x0000, ioaddr + NVCTL);
+	}
+}
+
 static struct ethtool_ops netdev_ethtool_ops = {
 	.get_drvinfo		= netdev_get_drvinfo,
 	.get_settings		= netdev_get_settings,
@@ -1434,13 +1458,15 @@ static struct ethtool_ops netdev_ethtool_ops = {
 	.set_msglevel		= netdev_set_msglevel,
 	.get_sg			= ethtool_op_get_sg,
 	.get_tx_csum		= ethtool_op_get_tx_csum,
+	.begin			= ethtool_begin,
+	.complete		= ethtool_complete
 };
 
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct epic_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	int rc;
 
 	/* power-up, if interface is down */
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index 0ee18be4a..816534011 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -255,14 +255,14 @@ static int eql_close(struct net_device *dev)
 	return 0;
 }
 
-static int eql_enslave(struct net_device *dev,  slaving_request_t *srq);
-static int eql_emancipate(struct net_device *dev, slaving_request_t *srq);
+static int eql_enslave(struct net_device *dev,  slaving_request_t __user *srq);
+static int eql_emancipate(struct net_device *dev, slaving_request_t __user *srq);
 
-static int eql_g_slave_cfg(struct net_device *dev, slave_config_t *sc);
-static int eql_s_slave_cfg(struct net_device *dev, slave_config_t *sc);
+static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *sc);
+static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *sc);
 
-static int eql_g_master_cfg(struct net_device *dev, master_config_t *mc);
-static int eql_s_master_cfg(struct net_device *dev, master_config_t *mc);
+static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mc);
+static int eql_s_master_cfg(struct net_device *dev, master_config_t __user *mc);
 
 static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {  
@@ -272,23 +272,17 @@ static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 
 	switch (cmd) {
 		case EQL_ENSLAVE:
-			return eql_enslave(dev,
-					   (slaving_request_t *) ifr->ifr_data);
+			return eql_enslave(dev, ifr->ifr_data);
 		case EQL_EMANCIPATE:
-			return eql_emancipate(dev,
-					      (slaving_request_t *) ifr->ifr_data);
+			return eql_emancipate(dev, ifr->ifr_data);
 		case EQL_GETSLAVECFG:
-			return eql_g_slave_cfg(dev,
-					       (slave_config_t *) ifr->ifr_data);
+			return eql_g_slave_cfg(dev, ifr->ifr_data);
 		case EQL_SETSLAVECFG:
-			return eql_s_slave_cfg(dev,
-					       (slave_config_t *) ifr->ifr_data);
+			return eql_s_slave_cfg(dev, ifr->ifr_data);
 		case EQL_GETMASTRCFG:
-			return eql_g_master_cfg(dev,
-						(master_config_t *) ifr->ifr_data);
+			return eql_g_master_cfg(dev, ifr->ifr_data);
 		case EQL_SETMASTRCFG:
-			return eql_s_master_cfg(dev,
-						(master_config_t *) ifr->ifr_data);
+			return eql_s_master_cfg(dev, ifr->ifr_data);
 		default:
 			return -EOPNOTSUPP;
 	};
@@ -411,7 +405,7 @@ static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
 	return -ENOSPC;
 }
 
-static int eql_enslave(struct net_device *master_dev, slaving_request_t *srqp)
+static int eql_enslave(struct net_device *master_dev, slaving_request_t __user *srqp)
 {
 	struct net_device *slave_dev;
 	slaving_request_t srq;
@@ -457,7 +451,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t *srqp)
 	return -EINVAL;
 }
 
-static int eql_emancipate(struct net_device *master_dev, slaving_request_t *srqp)
+static int eql_emancipate(struct net_device *master_dev, slaving_request_t __user *srqp)
 {
 	equalizer_t *eql = master_dev->priv;
 	struct net_device *slave_dev;
@@ -489,7 +483,7 @@ static int eql_emancipate(struct net_device *master_dev, slaving_request_t *srqp
 	return ret;
 }
 
-static int eql_g_slave_cfg(struct net_device *dev, slave_config_t *scp)
+static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
 {
 	equalizer_t *eql = dev->priv;
 	slave_t *slave;
@@ -522,7 +516,7 @@ static int eql_g_slave_cfg(struct net_device *dev, slave_config_t *scp)
 	return ret;
 }
 
-static int eql_s_slave_cfg(struct net_device *dev, slave_config_t *scp)
+static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
 {
 	slave_t *slave;
 	equalizer_t *eql;
@@ -553,7 +547,7 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t *scp)
 	return ret;
 }
 
-static int eql_g_master_cfg(struct net_device *dev, master_config_t *mcp)
+static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
 {
 	equalizer_t *eql;
 	master_config_t mc;
@@ -569,7 +563,7 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t *mcp)
 	return -EINVAL;
 }
 
-static int eql_s_master_cfg(struct net_device *dev, master_config_t *mcp)
+static int eql_s_master_cfg(struct net_device *dev, master_config_t __user *mcp)
 {
 	equalizer_t *eql;
 	master_config_t mc;
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index 3bf22730e..eb9f346d1 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -1518,13 +1518,13 @@ static int __init EISA_signature(char *name, s32 eisa_id)
 	return status;		/* return the device name string */
 }
 
-static int ewrk3_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int ewrk3_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv;
 	u_long iobase = dev->base_addr;
 	u32 ethcmd;
 
-	if (get_user(ethcmd, (u32 *)useraddr))
+	if (get_user(ethcmd, (u32 __user *)useraddr))
 		return -EFAULT;
 
 	switch (ethcmd) {
@@ -1707,7 +1707,7 @@ static int ewrk3_ethtool_ioctl(struct net_device *dev, void *useraddr)
 static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv;
-	struct ewrk3_ioctl *ioc = (struct ewrk3_ioctl *) &rq->ifr_data;
+	struct ewrk3_ioctl *ioc = (struct ewrk3_ioctl *) &rq->ifr_ifru;
 	u_long iobase = dev->base_addr;
 	int i, j, status = 0;
 	u_char csr;
@@ -1721,7 +1721,7 @@ static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
 	/* ethtool IOCTLs are handled elsewhere */
 	if (cmd == SIOCETHTOOL)
-		return ewrk3_ethtool_ioctl(dev, (void *)rq->ifr_data);
+		return ewrk3_ethtool_ioctl(dev, rq->ifr_data);
 
 	/* Other than ethtool, all we handle are private IOCTLs */
 	if (cmd != EWRK3IOCTL)
diff --git a/drivers/net/ewrk3.h b/drivers/net/ewrk3.h
index 46ec00996..fb74bd053 100644
--- a/drivers/net/ewrk3.h
+++ b/drivers/net/ewrk3.h
@@ -296,7 +296,7 @@
 struct ewrk3_ioctl {
 	unsigned short cmd;                /* Command to run */
 	unsigned short len;                /* Length of the data buffer */
-	unsigned char  *data;              /* Pointer to the data buffer */
+	unsigned char  __user *data;       /* Pointer to the data buffer */
 };
 
 /* 
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 24b6aa9ee..b0fbb861c 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -84,6 +84,7 @@ static int full_duplex[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/crc32.h>
+#include <linux/delay.h>
 
 #include <asm/processor.h>	/* Processor type for cache alignment. */
 #include <asm/bitops.h>
@@ -233,15 +234,29 @@ enum intr_status_bits {
 	RxErr = 0x00000002,	/* receive error */
 };
 
-/* Bits in the NetworkConfig register. */
+/* Bits in the NetworkConfig register, W for writing, R for reading */
+/* FIXME: some names are invented by me. Marked with (name?) */
+/* If you have docs and know bit names, please fix 'em */
 enum rx_mode_bits {
-	RxModeMask = 0xe0,
-	PROM = 0x80,		/* promiscuous mode */
-	AB = 0x40,		/* accept broadcast */
-	AM = 0x20,		/* accept mutlicast */
-	ARP = 0x08,		/* receive runt pkt */
-	ALP = 0x04,		/* receive long pkt */
-	SEP = 0x02,		/* receive error pkt */
+	CR_W_ENH	= 0x02000000,	/* enhanced mode (name?) */
+	CR_W_FD		= 0x00100000,	/* full duplex */
+	CR_W_PS10	= 0x00080000,	/* 10 mbit */
+	CR_W_TXEN	= 0x00040000,	/* tx enable (name?) */
+	CR_W_PS1000	= 0x00010000,	/* 1000 mbit */
+     /* CR_W_RXBURSTMASK= 0x00000e00, Im unsure about this */
+	CR_W_RXMODEMASK	= 0x000000e0,
+	CR_W_PROM	= 0x00000080,	/* promiscuous mode */
+	CR_W_AB		= 0x00000040,	/* accept broadcast */
+	CR_W_AM		= 0x00000020,	/* accept mutlicast */
+	CR_W_ARP	= 0x00000008,	/* receive runt pkt */
+	CR_W_ALP	= 0x00000004,	/* receive long pkt */
+	CR_W_SEP	= 0x00000002,	/* receive error pkt */
+	CR_W_RXEN	= 0x00000001,	/* rx enable (unicast?) (name?) */
+
+	CR_R_TXSTOP	= 0x04000000,	/* tx stopped (name?) */
+	CR_R_FD		= 0x00100000,	/* full duplex detected */
+	CR_R_PS10	= 0x00080000,	/* 10 mbit detected */
+	CR_R_RXSTOP	= 0x00008000,	/* rx stopped (name?) */
 };
 
 /* The Tulip Rx and Tx buffer descriptors. */
@@ -375,10 +390,7 @@ enum tx_desc_control_bits {
 #define LXT1000_Full    0x200
 // 89/12/29 add, for phy specific status register, levelone phy, (end)
 
-/* for 3-in-1 case */
-#define PS10            0x00080000
-#define FD              0x00100000
-#define PS1000          0x00010000
+/* for 3-in-1 case, BMCRSR register */
 #define LinkIsUp2	0x00040000
 
 /* for PHY */
@@ -400,6 +412,12 @@ struct netdev_private {
 	/* Media monitoring timer. */
 	struct timer_list timer;
 
+	/* Reset timer */
+	struct timer_list reset_timer;
+	int reset_timer_armed;
+	unsigned long crvalue_sv;
+	unsigned long imrvalue_sv;
+
 	/* Frequently used values: keep some adjacent for cache effect. */
 	int flags;
 	struct pci_dev *pci_dev;
@@ -435,49 +453,44 @@ static int netdev_open(struct net_device *dev);
 static void getlinktype(struct net_device *dev);
 static void getlinkstatus(struct net_device *dev);
 static void netdev_timer(unsigned long data);
+static void reset_timer(unsigned long data);
 static void tx_timeout(struct net_device *dev);
 static void init_ring(struct net_device *dev);
 static int start_tx(struct sk_buff *skb, struct net_device *dev);
 static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *regs);
 static int netdev_rx(struct net_device *dev);
 static void set_rx_mode(struct net_device *dev);
+static void __set_rx_mode(struct net_device *dev);
 static struct net_device_stats *get_stats(struct net_device *dev);
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static struct ethtool_ops netdev_ethtool_ops;
 static int netdev_close(struct net_device *dev);
 static void reset_rx_descriptors(struct net_device *dev);
+static void reset_tx_descriptors(struct net_device *dev);
 
-void stop_nic_tx(long ioaddr, long crvalue)
+static void stop_nic_rx(long ioaddr, long crvalue)
 {
-	writel(crvalue & (~0x40000), ioaddr + TCRRCR);
-
-	/* wait for tx stop */
-	{
-		int i = 0, delay = 0x1000;
-
-		while ((!(readl(ioaddr + TCRRCR) & 0x04000000)) && (i < delay)) {
-			++i;
-		}
+	int delay = 0x1000;
+	writel(crvalue & ~(CR_W_RXEN), ioaddr + TCRRCR);
+	while (--delay) {
+		if ( (readl(ioaddr + TCRRCR) & CR_R_RXSTOP) == CR_R_RXSTOP)
+			break;
 	}
 }
 
 
-void stop_nic_rx(long ioaddr, long crvalue)
+static void stop_nic_rxtx(long ioaddr, long crvalue)
 {
-	writel(crvalue & (~0x1), ioaddr + TCRRCR);
-
-	/* wait for rx stop */
-	{
-		int i = 0, delay = 0x1000;
-
-		while ((!(readl(ioaddr + TCRRCR) & 0x00008000)) && (i < delay)) {
-			++i;
-		}
+	int delay = 0x1000;
+	writel(crvalue & ~(CR_W_RXEN+CR_W_TXEN), ioaddr + TCRRCR);
+	while (--delay) {
+		if ( (readl(ioaddr + TCRRCR) & (CR_R_RXSTOP+CR_R_TXSTOP))
+					    == (CR_R_RXSTOP+CR_R_TXSTOP) )
+			break;
 	}
 }
 
 
-
 static int __devinit fealnx_init_one(struct pci_dev *pdev,
 				     const struct pci_device_id *ent)
 {
@@ -495,7 +508,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 #ifndef MODULE
 	static int printed_version;
 	if (!printed_version++)
-		printk (version);
+		printk(version);
 #endif
 	
 	card_idx++;
@@ -622,7 +635,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 		np->phys[0] = 32;
 /* 89/6/23 add, (begin) */
 		/* get phy type */
-		if (readl(dev->base_addr + PHYIDENTIFIER) == MysonPHYID)
+		if (readl(ioaddr + PHYIDENTIFIER) == MysonPHYID)
 			np->PHYType = MysonPHY;
 		else
 			np->PHYType = OtherPHY;
@@ -657,7 +670,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 		if (np->flags == HAS_MII_XCVR)
 			mdio_write(dev, np->phys[0], MII_ADVERTISE, ADVERTISE_FULL);
 		else
-			writel(ADVERTISE_FULL, dev->base_addr + ANARANLPAR);
+			writel(ADVERTISE_FULL, ioaddr + ANARANLPAR);
 		np->mii.force_media = 1;
 	}
 
@@ -669,7 +682,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
 	dev->set_multicast_list = &set_rx_mode;
 	dev->do_ioctl = &mii_ioctl;
 	dev->ethtool_ops = &netdev_ethtool_ops;
-	dev->tx_timeout = tx_timeout;
+	dev->tx_timeout = &tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 	
 	err = register_netdev(dev);
@@ -699,6 +712,7 @@ err_out_res:
 	return err;
 }
 
+
 static void __devexit fealnx_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
@@ -721,42 +735,6 @@ static void __devexit fealnx_remove_one(struct pci_dev *pdev)
 		printk(KERN_ERR "fealnx: remove for unknown device\n");
 }
 
-unsigned int m80x_read_tick(void)
-/* function: Reads the Timer tick count register which decrements by 2 from  */
-/*           65536 to 0 every 1/36.414 of a second. Each 2 decrements of the *//*           count represents 838 nsec's.                                    */
-/* input   : none.                                                           */
-/* output  : none.                                                           */
-{
-	unsigned char tmp;
-	int value;
-
-	writeb((char) 0x06, 0x43);	// Command 8254 to latch T0's count
-
-	// now read the count.
-	tmp = (unsigned char) readb(0x40);
-	value = ((int) tmp) << 8;
-	tmp = (unsigned char) readb(0x40);
-	value |= (((int) tmp) & 0xff);
-	return (value);
-}
-
-
-void m80x_delay(unsigned int interval)
-/* function: to wait for a specified time.                                   */
-/* input   : interval ... the specified time.                                */
-/* output  : none.                                                           */
-{
-	unsigned int interval1, interval2, i = 0;
-
-	interval1 = m80x_read_tick();	// get initial value
-	do {
-		interval2 = m80x_read_tick();
-		if (interval1 < interval2)
-			interval1 = interval2;
-		++i;
-	} while (((interval1 - interval2) < (ushort) interval) && (i < 65535));
-}
-
 
 static ulong m80x_send_cmd_to_phy(long miiport, int opcode, int phyad, int regad)
 {
@@ -796,7 +774,7 @@ static ulong m80x_send_cmd_to_phy(long miiport, int opcode, int phyad, int regad
 		/* high MDC */
 		miir |= MASK_MIIR_MII_MDC;
 		writel(miir, miiport);
-		m80x_delay(30);
+		udelay(30);
 
 		/* next */
 		mask >>= 1;
@@ -831,7 +809,7 @@ static int mdio_read(struct net_device *dev, int phyad, int regad)
 		/* high MDC, and wait */
 		miir |= MASK_MIIR_MII_MDC;
 		writel(miir, miiport);
-		m80x_delay((int) 30);
+		udelay(30);
 
 		/* next */
 		mask >>= 1;
@@ -873,8 +851,6 @@ static void mdio_write(struct net_device *dev, int phyad, int regad, int data)
 	/* low MDC */
 	miir &= ~MASK_MIIR_MII_MDC;
 	writel(miir, miiport);
-
-	return;
 }
 
 
@@ -949,7 +925,7 @@ static int netdev_open(struct net_device *dev)
 	np->imrvalue = TUNF | CNTOVF | RBU | TI | RI;
 	if (np->pci_dev->device == 0x891) {
 		np->bcrvalue |= 0x200;	/* set PROG bit */
-		np->crvalue |= 0x02000000;	/* set enhanced bit */
+		np->crvalue |= CR_W_ENH;	/* set enhanced bit */
 		np->imrvalue |= ETI;
 	}
 	writel(np->bcrvalue, ioaddr + BCR);
@@ -957,7 +933,7 @@ static int netdev_open(struct net_device *dev)
 	if (dev->if_port == 0)
 		dev->if_port = np->default_port;
 
-	writel(0, dev->base_addr + RXPDR);
+	writel(0, ioaddr + RXPDR);
 // 89/9/1 modify,
 //   np->crvalue = 0x00e40001;    /* tx store and forward, tx/rx enable */
 	np->crvalue |= 0x00e40001;	/* tx store and forward, tx/rx enable */
@@ -965,7 +941,7 @@ static int netdev_open(struct net_device *dev)
 	getlinkstatus(dev);
 	if (np->linkok)
 		getlinktype(dev);
-	set_rx_mode(dev);
+	__set_rx_mode(dev);
 
 	netif_start_queue(dev);
 
@@ -985,6 +961,11 @@ static int netdev_open(struct net_device *dev)
 	/* timer handler */
 	add_timer(&np->timer);
 
+	init_timer(&np->reset_timer);
+	np->reset_timer.data = (unsigned long) dev;
+	np->reset_timer.function = &reset_timer;
+	np->reset_timer_armed = 0;
+
 	return 0;
 }
 
@@ -1005,8 +986,7 @@ static void getlinkstatus(struct net_device *dev)
 				np->linkok = 1;
 				return;
 			}
-			// delay
-			m80x_delay(100);
+			udelay(100);
 		}
 	} else {
 		for (i = 0; i < DelayTime; ++i) {
@@ -1014,8 +994,7 @@ static void getlinkstatus(struct net_device *dev)
 				np->linkok = 1;
 				return;
 			}
-			// delay
-			m80x_delay(100);
+			udelay(100);
 		}
 	}
 }
@@ -1026,11 +1005,11 @@ static void getlinktype(struct net_device *dev)
 	struct netdev_private *np = dev->priv;
 
 	if (np->PHYType == MysonPHY) {	/* 3-in-1 case */
-		if (readl(dev->base_addr + TCRRCR) & FD)
+		if (readl(dev->base_addr + TCRRCR) & CR_R_FD)
 			np->duplexmode = 2;	/* full duplex */
 		else
 			np->duplexmode = 1;	/* half duplex */
-		if (readl(dev->base_addr + TCRRCR) & PS10)
+		if (readl(dev->base_addr + TCRRCR) & CR_R_PS10)
 			np->line_speed = 1;	/* 10M */
 		else
 			np->line_speed = 2;	/* 100M */
@@ -1112,19 +1091,18 @@ static void getlinktype(struct net_device *dev)
 			else
 				np->line_speed = 1;	/* 10M */
 		}
-		// chage crvalue
-		// np->crvalue&=(~PS10)&(~FD);
-		np->crvalue &= (~PS10) & (~FD) & (~PS1000);
+		np->crvalue &= (~CR_W_PS10) & (~CR_W_FD) & (~CR_W_PS1000);
 		if (np->line_speed == 1)
-			np->crvalue |= PS10;
+			np->crvalue |= CR_W_PS10;
 		else if (np->line_speed == 3)
-			np->crvalue |= PS1000;
+			np->crvalue |= CR_W_PS1000;
 		if (np->duplexmode == 2)
-			np->crvalue |= FD;
+			np->crvalue |= CR_W_FD;
 	}
 }
 
 
+/* Take lock before calling this */
 static void allocate_rx_buffers(struct net_device *dev)
 {
 	struct netdev_private *np = dev->priv;
@@ -1134,15 +1112,17 @@ static void allocate_rx_buffers(struct net_device *dev)
 		struct sk_buff *skb;
 
 		skb = dev_alloc_skb(np->rx_buf_sz);
-		np->lack_rxbuf->skbuff = skb;
-
 		if (skb == NULL)
 			break;	/* Better luck next round. */
 
+		while (np->lack_rxbuf->skbuff)
+			np->lack_rxbuf = np->lack_rxbuf->next_desc_logical;
+
 		skb->dev = dev;	/* Mark as being used by this device. */
+		np->lack_rxbuf->skbuff = skb;
 		np->lack_rxbuf->buffer = pci_map_single(np->pci_dev, skb->tail,
 			np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-		np->lack_rxbuf = np->lack_rxbuf->next_desc_logical;
+		np->lack_rxbuf->status = RXOWN;
 		++np->really_rx_count;
 	}
 }
@@ -1153,22 +1133,23 @@ static void netdev_timer(unsigned long data)
 	struct net_device *dev = (struct net_device *) data;
 	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
-	int next_tick = 10 * HZ;
 	int old_crvalue = np->crvalue;
 	unsigned int old_linkok = np->linkok;
+	unsigned long flags;
 
 	if (debug)
 		printk(KERN_DEBUG "%s: Media selection timer tick, status %8.8x "
 		       "config %8.8x.\n", dev->name, readl(ioaddr + ISR),
 		       readl(ioaddr + TCRRCR));
 
+	spin_lock_irqsave(&np->lock, flags);
+
 	if (np->flags == HAS_MII_XCVR) {
 		getlinkstatus(dev);
 		if ((old_linkok == 0) && (np->linkok == 1)) {	/* we need to detect the media type again */
 			getlinktype(dev);
 			if (np->crvalue != old_crvalue) {
-				stop_nic_tx(ioaddr, np->crvalue);
-				stop_nic_rx(ioaddr, np->crvalue & (~0x40000));
+				stop_nic_rxtx(ioaddr, np->crvalue);
 				writel(np->crvalue, ioaddr + TCRRCR);
 			}
 		}
@@ -1176,69 +1157,120 @@ static void netdev_timer(unsigned long data)
 
 	allocate_rx_buffers(dev);
 
-	np->timer.expires = RUN_AT(next_tick);
+	spin_unlock_irqrestore(&np->lock, flags);
+
+	np->timer.expires = RUN_AT(10 * HZ);
 	add_timer(&np->timer);
 }
 
 
-static void tx_timeout(struct net_device *dev)
+/* Take lock before calling */
+/* Reset chip and disable rx, tx and interrupts */
+static void reset_and_disable_rxtx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
-	int i;
-
-	printk(KERN_WARNING "%s: Transmit timed out, status %8.8x,"
-	       " resetting...\n", dev->name, readl(ioaddr + ISR));
-
-	{
-
-		printk(KERN_DEBUG "  Rx ring %p: ", np->rx_ring);
-		for (i = 0; i < RX_RING_SIZE; i++)
-			printk(" %8.8x", (unsigned int) np->rx_ring[i].status);
-		printk("\n" KERN_DEBUG "  Tx ring %p: ", np->tx_ring);
-		for (i = 0; i < TX_RING_SIZE; i++)
-			printk(" %4.4x", np->tx_ring[i].status);
-		printk("\n");
-	}
-
-	/* Reinit. Gross */
+	int delay=51;
 
 	/* Reset the chip's Tx and Rx processes. */
-	stop_nic_tx(ioaddr, 0);
-	reset_rx_descriptors(dev);
+	stop_nic_rxtx(ioaddr, 0);
 
 	/* Disable interrupts by clearing the interrupt mask. */
-	writel(0x0000, ioaddr + IMR);
+	writel(0, ioaddr + IMR);
 
 	/* Reset the chip to erase previous misconfiguration. */
 	writel(0x00000001, ioaddr + BCR);
 
 	/* Ueimor: wait for 50 PCI cycles (and flush posted writes btw). 
-	   We surely wait too long (address+data phase). Who cares ? */
-	for (i = 0; i < 50; i++) {
+	   We surely wait too long (address+data phase). Who cares? */
+	while (--delay) {
 		readl(ioaddr + BCR);
 		rmb();
 	}
+}
+
+
+/* Take lock before calling */
+/* Restore chip after reset */
+static void enable_rxtx(struct net_device *dev)
+{
+	struct netdev_private *np = dev->priv;
+	long ioaddr = dev->base_addr;
 
-	writel((np->cur_tx - np->tx_ring)*sizeof(struct fealnx_desc) +
-		np->tx_ring_dma, ioaddr + TXLBA);
-	writel((np->cur_rx - np->rx_ring)*sizeof(struct fealnx_desc) +
-		np->rx_ring_dma, ioaddr + RXLBA);
+	reset_rx_descriptors(dev);
+
+	writel(np->tx_ring_dma + ((char*)np->cur_tx - (char*)np->tx_ring),
+		ioaddr + TXLBA);
+	writel(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring),
+		ioaddr + RXLBA);
 
 	writel(np->bcrvalue, ioaddr + BCR);
 
-	writel(0, dev->base_addr + RXPDR);
-	set_rx_mode(dev);
+	writel(0, ioaddr + RXPDR);
+	__set_rx_mode(dev); /* changes np->crvalue, writes it into TCRRCR */
+
 	/* Clear and Enable interrupts by setting the interrupt mask. */
 	writel(FBE | TUNF | CNTOVF | RBU | TI | RI, ioaddr + ISR);
 	writel(np->imrvalue, ioaddr + IMR);
 
-	writel(0, dev->base_addr + TXPDR);
+	writel(0, ioaddr + TXPDR);
+}
+
+
+static void reset_timer(unsigned long data)
+{
+	struct net_device *dev = (struct net_device *) data;
+	struct netdev_private *np = dev->priv;
+	unsigned long flags;
+
+	printk(KERN_WARNING "%s: resetting tx and rx machinery\n", dev->name);
+
+	spin_lock_irqsave(&np->lock, flags);
+	np->crvalue = np->crvalue_sv;
+	np->imrvalue = np->imrvalue_sv;
+
+	reset_and_disable_rxtx(dev);
+	/* works for me without this:
+	reset_tx_descriptors(dev); */
+	enable_rxtx(dev);
+	netif_start_queue(dev); /* FIXME: or netif_wake_queue(dev); ? */
+		
+	np->reset_timer_armed = 0;
+
+	spin_unlock_irqrestore(&np->lock, flags);
+}
+
+
+static void tx_timeout(struct net_device *dev)
+{
+	struct netdev_private *np = dev->priv;
+	long ioaddr = dev->base_addr;
+	unsigned long flags;
+	int i;
+
+	printk(KERN_WARNING "%s: Transmit timed out, status %8.8x,"
+	       " resetting...\n", dev->name, readl(ioaddr + ISR));
+
+	{
+		printk(KERN_DEBUG "  Rx ring %p: ", np->rx_ring);
+		for (i = 0; i < RX_RING_SIZE; i++)
+			printk(" %8.8x", (unsigned int) np->rx_ring[i].status);
+		printk("\n" KERN_DEBUG "  Tx ring %p: ", np->tx_ring);
+		for (i = 0; i < TX_RING_SIZE; i++)
+			printk(" %4.4x", np->tx_ring[i].status);
+		printk("\n");
+	}
+	
+	spin_lock_irqsave(&np->lock, flags);
+
+	reset_and_disable_rxtx(dev);
+	reset_tx_descriptors(dev);
+	enable_rxtx(dev);
+
+	spin_unlock_irqrestore(&np->lock, flags);
 
 	dev->trans_start = jiffies;
 	np->stats.tx_errors++;
-
-	return;
+	netif_wake_queue(dev); /* or .._start_.. ?? */
 }
 
 
@@ -1251,7 +1283,7 @@ static void init_ring(struct net_device *dev)
 	/* initialize rx variables */
 	np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
 	np->cur_rx = &np->rx_ring[0];
-	np->lack_rxbuf = NULL;
+	np->lack_rxbuf = np->rx_ring;
 	np->really_rx_count = 0;
 
 	/* initial rx descriptors. */
@@ -1294,6 +1326,7 @@ static void init_ring(struct net_device *dev)
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		np->tx_ring[i].status = 0;
+		/* do we need np->tx_ring[i].control = XXX; ?? */
 		np->tx_ring[i].next_desc = np->tx_ring_dma +
 			(i + 1)*sizeof(struct fealnx_desc);
 		np->tx_ring[i].next_desc_logical = &np->tx_ring[i + 1];
@@ -1341,7 +1374,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
 		np->cur_tx_copy->control |= (BPT << TBSShift);	/* buffer size */
 
 		/* for the last descriptor */
-		next = (struct fealnx *) np->cur_tx_copy.next_desc_logical;
+		next = np->cur_tx_copy->next_desc_logical;
 		next->skbuff = skb;
 		next->control = TXIC | TXLD | CRCEnable | PADEnable;
 		next->control |= (skb->len << PKTSShift);	/* pkt size */
@@ -1383,35 +1416,59 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
 }
 
 
-void free_one_rx_descriptor(struct netdev_private *np)
+/* Take lock before calling */
+/* Chip probably hosed tx ring. Clean up. */
+static void reset_tx_descriptors(struct net_device *dev)
 {
-	if (np->really_rx_count == RX_RING_SIZE)
-		np->cur_rx->status = RXOWN;
-	else {
-		np->lack_rxbuf->skbuff = np->cur_rx->skbuff;
-		np->lack_rxbuf->buffer = np->cur_rx->buffer;
-		np->lack_rxbuf->status = RXOWN;
-		++np->really_rx_count;
-		np->lack_rxbuf = np->lack_rxbuf->next_desc_logical;
+	struct netdev_private *np = dev->priv;
+	struct fealnx_desc *cur;
+	int i;
+
+	/* initialize tx variables */
+	np->cur_tx = &np->tx_ring[0];
+	np->cur_tx_copy = &np->tx_ring[0];
+	np->really_tx_count = 0;
+	np->free_tx_count = TX_RING_SIZE;
+
+	for (i = 0; i < TX_RING_SIZE; i++) {
+		cur = &np->tx_ring[i];
+		if (cur->skbuff) {
+			pci_unmap_single(np->pci_dev, cur->buffer,
+				cur->skbuff->len, PCI_DMA_TODEVICE);
+			dev_kfree_skb(cur->skbuff);
+			/* or dev_kfree_skb_irq(cur->skbuff); ? */
+			cur->skbuff = NULL;
+		}
+		cur->status = 0;
+		cur->control = 0;	/* needed? */
+		/* probably not needed. We do it for purely paranoid reasons */
+		cur->next_desc = np->tx_ring_dma +
+			(i + 1)*sizeof(struct fealnx_desc);
+		cur->next_desc_logical = &np->tx_ring[i + 1];
 	}
-	np->cur_rx = np->cur_rx->next_desc_logical;
+	/* for the last tx descriptor */
+	np->tx_ring[TX_RING_SIZE - 1].next_desc = np->tx_ring_dma;
+	np->tx_ring[TX_RING_SIZE - 1].next_desc_logical = &np->tx_ring[0];
 }
 
 
-void reset_rx_descriptors(struct net_device *dev)
+/* Take lock and stop rx before calling this */
+static void reset_rx_descriptors(struct net_device *dev)
 {
 	struct netdev_private *np = dev->priv;
-
-	stop_nic_rx(dev->base_addr, np->crvalue);
-
-	while (!(np->cur_rx->status & RXOWN))
-		free_one_rx_descriptor(np);
+	struct fealnx_desc *cur = np->cur_rx;
+	int i;
 
 	allocate_rx_buffers(dev);
 
-	writel(np->rx_ring_dma + (np->cur_rx - np->rx_ring),
+	for (i = 0; i < RX_RING_SIZE; i++) {
+		if (cur->skbuff)
+			cur->status = RXOWN;
+		cur = cur->next_desc_logical;
+	}
+
+	writel(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring),
 		dev->base_addr + RXLBA);
-	writel(np->crvalue, dev->base_addr + TCRRCR);
 }
 
 
@@ -1421,16 +1478,14 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 {
 	struct net_device *dev = (struct net_device *) dev_instance;
 	struct netdev_private *np = dev->priv;
-	long ioaddr, boguscnt = max_interrupt_work;
+	long ioaddr = dev->base_addr;
+	long boguscnt = max_interrupt_work;
 	unsigned int num_tx = 0;
 	int handled = 0;
 
 	spin_lock(&np->lock);
 
-	writel(0, dev->base_addr + IMR);
-
-	ioaddr = dev->base_addr;
-	np = dev->priv;
+	writel(0, ioaddr + IMR);
 
 	do {
 		u32 intr_status = readl(ioaddr + ISR);
@@ -1471,8 +1526,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 		if (intr_status & (RI | RBU)) {
 			if (intr_status & RI)
 				netdev_rx(dev);
-			else
+			else {
+				stop_nic_rx(ioaddr, np->crvalue);
 				reset_rx_descriptors(dev);
+				writel(np->crvalue, ioaddr + TCRRCR);
+			}				
 		}
 
 		while (np->really_tx_count) {
@@ -1490,7 +1548,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 			if (tx_status & TXOWN)
 				break;
 
-			if (!(np->crvalue & 0x02000000)) {
+			if (!(np->crvalue & CR_W_ENH)) {
 				if (tx_status & (CSL | LC | EC | UDF | HF)) {
 					np->stats.tx_errors++;
 					if (tx_status & EC)
@@ -1539,7 +1597,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 			netif_wake_queue(dev);
 
 		/* read transmit status for enhanced mode only */
-		if (np->crvalue & 0x02000000) {
+		if (np->crvalue & CR_W_ENH) {
 			long data;
 
 			data = readl(ioaddr + TSR);
@@ -1552,6 +1610,20 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 		if (--boguscnt < 0) {
 			printk(KERN_WARNING "%s: Too much work at interrupt, "
 			       "status=0x%4.4x.\n", dev->name, intr_status);
+			if (!np->reset_timer_armed) {
+				np->reset_timer_armed = 1;
+				np->reset_timer.expires = RUN_AT(HZ/2);
+				add_timer(&np->reset_timer);
+				stop_nic_rxtx(ioaddr, 0);
+				netif_stop_queue(dev);
+				/* or netif_tx_disable(dev); ?? */
+				/* Prevent other paths from enabling tx,rx,intrs */
+				np->crvalue_sv = np->crvalue;
+				np->imrvalue_sv = np->imrvalue;
+				np->crvalue &= ~(CR_W_TXEN | CR_W_RXEN); /* or simply = 0? */
+				np->imrvalue = 0;
+			}
+
 			break;
 		}
 	} while (1);
@@ -1580,9 +1652,10 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 static int netdev_rx(struct net_device *dev)
 {
 	struct netdev_private *np = dev->priv;
+	long ioaddr = dev->base_addr;
 
 	/* If EOP is set on the next entry, it's a new packet. Send it up. */
-	while (!(np->cur_rx->status & RXOWN)) {
+	while (!(np->cur_rx->status & RXOWN) && np->cur_rx->skbuff) {
 		s32 rx_status = np->cur_rx->status;
 
 		if (np->really_rx_count == 0)
@@ -1634,11 +1707,20 @@ static int netdev_rx(struct net_device *dev)
 					np->stats.rx_length_errors++;
 
 					/* free all rx descriptors related this long pkt */
-					for (i = 0; i < desno; ++i)
-						free_one_rx_descriptor(np);
+					for (i = 0; i < desno; ++i) {
+						if (!np->cur_rx->skbuff) {
+							printk(KERN_DEBUG
+								"%s: I'm scared\n", dev->name);
+							break;
+						}
+						np->cur_rx->status = RXOWN;
+						np->cur_rx = np->cur_rx->next_desc_logical;
+					}
 					continue;
-				} else {	/* something error, need to reset this chip */
+				} else {        /* rx error, need to reset this chip */
+					stop_nic_rx(ioaddr, np->crvalue);
 					reset_rx_descriptors(dev);
+					writel(np->crvalue, ioaddr + TCRRCR);
 				}
 				break;	/* exit the while loop */
 			}
@@ -1685,8 +1767,6 @@ static int netdev_rx(struct net_device *dev)
 						 PCI_DMA_FROMDEVICE);
 				skb_put(skb = np->cur_rx->skbuff, pkt_len);
 				np->cur_rx->skbuff = NULL;
-				if (np->really_rx_count == RX_RING_SIZE)
-					np->lack_rxbuf = np->cur_rx;
 				--np->really_rx_count;
 			}
 			skb->protocol = eth_type_trans(skb, dev);
@@ -1696,24 +1776,7 @@ static int netdev_rx(struct net_device *dev)
 			np->stats.rx_bytes += pkt_len;
 		}
 
-		if (np->cur_rx->skbuff == NULL) {
-			struct sk_buff *skb;
-
-			skb = dev_alloc_skb(np->rx_buf_sz);
-
-			if (skb != NULL) {
-				skb->dev = dev;	/* Mark as being used by this device. */
-				np->cur_rx->buffer = pci_map_single(np->pci_dev,
-								    skb->tail,
-								    np->rx_buf_sz,
-								    PCI_DMA_FROMDEVICE);
-				np->cur_rx->skbuff = skb;
-				++np->really_rx_count;
-			}
-		}
-
-		if (np->cur_rx->skbuff != NULL)
-			free_one_rx_descriptor(np);
+		np->cur_rx = np->cur_rx->next_desc_logical;
 	}			/* end of while loop */
 
 	/*  allocate skb for rx buffers */
@@ -1737,7 +1800,20 @@ static struct net_device_stats *get_stats(struct net_device *dev)
 	return &np->stats;
 }
 
+
+/* for dev->set_multicast_list */
 static void set_rx_mode(struct net_device *dev)
+{
+	spinlock_t *lp = &((struct netdev_private *)dev->priv)->lock;
+	unsigned long flags;
+	spin_lock_irqsave(lp, flags);
+	__set_rx_mode(dev);
+	spin_unlock_irqrestore(lp, flags);
+}
+
+
+/* Take lock before calling */
+static void __set_rx_mode(struct net_device *dev)
 {
 	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
@@ -1748,12 +1824,12 @@ static void set_rx_mode(struct net_device *dev)
 		/* Unconditionally log net taps. */
 		printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
 		memset(mc_filter, 0xff, sizeof(mc_filter));
-		rx_mode = PROM | AB | AM;
+		rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM;
 	} else if ((dev->mc_count > multicast_filter_limit)
 		   || (dev->flags & IFF_ALLMULTI)) {
 		/* Too many to match, or accept all multicasts. */
 		memset(mc_filter, 0xff, sizeof(mc_filter));
-		rx_mode = AB | AM;
+		rx_mode = CR_W_AB | CR_W_AM;
 	} else {
 		struct dev_mc_list *mclist;
 		int i;
@@ -1765,26 +1841,25 @@ static void set_rx_mode(struct net_device *dev)
 			bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F;
 			mc_filter[bit >> 5] |= (1 << bit);
 		}
-		rx_mode = AB | AM;
+		rx_mode = CR_W_AB | CR_W_AM;
 	}
 
-	stop_nic_tx(ioaddr, np->crvalue);
-	stop_nic_rx(ioaddr, np->crvalue & (~0x40000));
+	stop_nic_rxtx(ioaddr, np->crvalue);
 
 	writel(mc_filter[0], ioaddr + MAR0);
 	writel(mc_filter[1], ioaddr + MAR1);
-	np->crvalue &= ~RxModeMask;
+	np->crvalue &= ~CR_W_RXMODEMASK;
 	np->crvalue |= rx_mode;
 	writel(np->crvalue, ioaddr + TCRRCR);
 }
 
-static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
+static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
 	struct netdev_private *np = dev->priv;
 
-	strcpy (info->driver, DRV_NAME);
-	strcpy (info->version, DRV_VERSION);
-	strcpy (info->bus_info, pci_name(np->pci_dev));
+	strcpy(info->driver, DRV_NAME);
+	strcpy(info->version, DRV_VERSION);
+	strcpy(info->bus_info, pci_name(np->pci_dev));
 }
 
 static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
@@ -1848,14 +1923,13 @@ static struct ethtool_ops netdev_ethtool_ops = {
 static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct netdev_private *np = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
 	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
 	spin_lock_irq(&np->lock);
-	rc = generic_mii_ioctl(&np->mii, data, cmd, NULL);
+	rc = generic_mii_ioctl(&np->mii, if_mii(rq), cmd, NULL);
 	spin_unlock_irq(&np->lock);
 
 	return rc;
@@ -1874,10 +1948,10 @@ static int netdev_close(struct net_device *dev)
 	writel(0x0000, ioaddr + IMR);
 
 	/* Stop the chip's Tx and Rx processes. */
-	stop_nic_tx(ioaddr, 0);
-	stop_nic_rx(ioaddr, 0);
+	stop_nic_rxtx(ioaddr, 0);
 
 	del_timer_sync(&np->timer);
+	del_timer_sync(&np->reset_timer);
 
 	free_irq(dev->irq, dev);
 
@@ -1928,7 +2002,7 @@ static int __init fealnx_init(void)
 {
 /* when a module, this is printed whether or not devices are found in probe */
 #ifdef MODULE
-	printk (version);
+	printk(version);
 #endif
 
 	return pci_module_init(&fealnx_driver);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 73dcb6883..503e8f6c9 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -556,7 +556,7 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
 	return &np->stats;
 }
 
-static int nv_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int nv_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct fe_priv *np = get_nvpriv(dev);
 	u8 *base = get_hwbase(dev);
@@ -634,7 +634,7 @@ static int nv_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	switch(cmd) {
 	case SIOCETHTOOL:
-		return nv_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return nv_ethtool_ioctl(dev, rq->ifr_data);
 
 	default:
 		return -EOPNOTSUPP;
diff --git a/drivers/net/gt96100eth.c b/drivers/net/gt96100eth.c
index 9c84abba0..0cbf1d143 100644
--- a/drivers/net/gt96100eth.c
+++ b/drivers/net/gt96100eth.c
@@ -1070,22 +1070,18 @@ gt96100_open(struct net_device *dev)
 {
 	int retval;
     
-	MOD_INC_USE_COUNT;
-
 	dbg(2, "%s: dev=%p\n", __FUNCTION__, dev);
 
 	// Initialize and startup the GT-96100 ethernet port
 	if ((retval = gt96100_init(dev))) {
 		err("error in gt96100_init\n");
 		free_irq(dev->irq, dev);
-		MOD_DEC_USE_COUNT;
 		return retval;
 	}
 
 	if ((retval = request_irq(dev->irq, &gt96100_interrupt,
 				  SA_SHIRQ, dev->name, dev))) {
 		err("unable to get IRQ %d\n", dev->irq);
-		MOD_DEC_USE_COUNT;
 		return retval;
 	}
 	
@@ -1106,8 +1102,6 @@ gt96100_close(struct net_device *dev)
 	}
 
 	free_irq(dev->irq, dev);
-    
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 2089b1a1e..f1ec80665 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -1869,7 +1869,7 @@ static void set_rx_mode(struct net_device *dev)
 	}
 }
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct hamachi_private *np = dev->priv;
 	u32 ethcmd;
@@ -1937,17 +1937,17 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct hamachi_private *np = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
 	if (cmd == SIOCETHTOOL)
-		rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
 
 	else if (cmd == (SIOCDEVPRIVATE+3)) { /* set rx,tx intr params */
-		u32 *d = (u32 *)&rq->ifr_data;
+		u32 *d = (u32 *)&rq->ifr_ifru;
 		/* Should add this check here or an ordinary user can do nasty
 		 * things. -KDU
 		 *
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index d5b7fd96f..d5b7db1bd 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -1166,8 +1166,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	bc = netdev_priv(dev);
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
-	if (get_user(cmd, (int *)ifr->ifr_data))
-		return -EFAULT;
 
 	if (copy_from_user(&hi, ifr->ifr_data, sizeof(hi)))
 		return -EFAULT;
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 28e9da3db..4bd7c0965 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -414,7 +414,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 {
 	struct baycom_state *bc;
 	struct baycom_ioctl bi;
-	int cmd2;
 
 	if (!dev || !dev->priv ||
 	    ((struct baycom_state *)dev->priv)->hdrv.magic != HDLCDRV_MAGIC) {
@@ -425,8 +424,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
-	if (get_user(cmd2, (int *)ifr->ifr_data))
-		return -EFAULT;
 	switch (hi->cmd) {
 	default:
 		break;
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 2dc64f049..5c6257ee5 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -529,7 +529,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 {
 	struct baycom_state *bc;
 	struct baycom_ioctl bi;
-	int cmd2;
 
 	if (!dev || !dev->priv ||
 	    ((struct baycom_state *)dev->priv)->hdrv.magic != HDLCDRV_MAGIC) {
@@ -540,8 +539,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
-	if (get_user(cmd2, (int *)ifr->ifr_data))
-		return -EFAULT;
 	switch (hi->cmd) {
 	default:
 		break;
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index f288c9241..4aef97039 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -569,7 +569,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 {
 	struct baycom_state *bc;
 	struct baycom_ioctl bi;
-	int cmd2;
 
 	if (!dev || !dev->priv ||
 	    ((struct baycom_state *)dev->priv)->hdrv.magic != HDLCDRV_MAGIC) {
@@ -580,8 +579,6 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
-	if (get_user(cmd2, (int *)ifr->ifr_data))
-		return -EFAULT;
 	switch (hi->cmd) {
 	default:
 		break;
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index fda187222..6b85ab3c9 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -331,7 +331,7 @@ static int bpq_set_mac_address(struct net_device *dev, void *addr)
  */
 static int bpq_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	struct bpq_ethaddr *ethaddr = (struct bpq_ethaddr *)ifr->ifr_data;
+	struct bpq_ethaddr __user *ethaddr = ifr->ifr_data;
 	struct bpqdev *bpq = dev->priv;
 	struct bpq_req req;
 
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index e1222036f..9f3dac7d2 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -48,21 +48,6 @@
 #include "z8530.h"
 
 
-/* Linux 2.2 and 2.3 compatibility */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14)
-#define net_device device
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)
-#define netif_start_queue(dev) { dev->tbusy = 0; }
-#define netif_stop_queue(dev) { dev->tbusy = 1; }
-#define netif_wake_queue(dev) { dev->tbusy = 0; mark_bh(NET_BH); }
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,47)
-#define netif_running(dev) (dev->flags & IFF_UP)
-#endif
-
-
 /* Number of buffers per channel */
 
 #define NUM_TX_BUF      2          /* NUM_TX_BUF >= 1 (min. 2 recommended) */
@@ -210,9 +195,6 @@ struct scc_hardware {
 };
 
 struct scc_priv {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-  char name[IFNAMSIZ];
-#endif
   int type;
   int chip;
   struct net_device *dev;
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 0e6844fc3..f7fc3b9c0 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1714,13 +1714,11 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	struct scc_mem_config memcfg;
 	struct scc_hw_config hwcfg;
 	struct scc_calibrate cal;
-	struct scc_channel *scc;
+	struct scc_channel *scc = (struct scc_channel *) dev->priv;
 	int chan;
 	unsigned char device_name[IFNAMSIZ];
-	void *arg;
+	void __user *arg = ifr->ifr_data;
 	
-	scc = (struct scc_channel *) dev->priv;
-	arg = (void *) ifr->ifr_data;
 	
 	if (!Driver_Initialized)
 	{
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 0bc7f8242..2ca3de076 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -1556,7 +1556,7 @@ static struct ethtool_ops emac_ethtool_ops = {
 static int emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct ocp_enet_private *fep = dev->priv;
-	uint *data = (uint *) & rq->ifr_data;
+	uint *data = (uint *) & rq->ifr_ifru;
 
 	switch (cmd) {
 	case SIOCGMIIPHY:
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 9fb3c9964..a0eaa80aa 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -4,7 +4,8 @@ net-3-driver for the IBM LAN Adapter/A
 This is an extension to the Linux operating system, and is covered by the
 same GNU General Public License that covers that work.
 
-Copyright 1999 by Alfred Arnold (alfred@ccac.rwth-aachen.de, aarnold@elsa.de)
+Copyright 1999 by Alfred Arnold (alfred@ccac.rwth-aachen.de,
+                                 alfred.arnold@lancom.de)
 
 This driver is based both on the SK_MCA driver, which is itself based on the
 SK_G16 and 3C523 driver.
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index c3836f6de..5fa162f6c 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -55,7 +55,6 @@
 #include <asm/iommu.h>
 #include <asm/vio.h>
 #include <asm/uaccess.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 
 #include "ibmveth.h"
@@ -874,14 +873,14 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 	struct net_device *netdev;
 	struct ibmveth_adapter *adapter;
 
-	unsigned int *mac_addr_p;
+	unsigned char *mac_addr_p;
 	unsigned int *mcastFilterSize_p;
 
 
 	ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", 
 					dev->unit_address);
 
-	mac_addr_p = (unsigned int *) vio_get_attribute(dev, VETH_MAC_ADDR, 0);
+	mac_addr_p = (unsigned char *) vio_get_attribute(dev, VETH_MAC_ADDR, 0);
 	if(!mac_addr_p) {
 		ibmveth_error_printk("Can't find VETH_MAC_ADDR attribute\n");
 		return 0;
@@ -902,7 +901,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 
 	adapter = netdev->priv;
 	memset(adapter, 0, sizeof(adapter));
-	dev->driver_data = netdev;
+	dev->dev.driver_data = netdev;
 
 	adapter->vdev = dev;
 	adapter->netdev = netdev;
@@ -916,8 +915,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 		The RPA doc specifies that the first byte must be 10b, so 
 		we'll just look for it to solve this 8 vs. 6 byte field issue */
 
-	while (*((char*)mac_addr_p) != (char)(0x02))
-		((char*)mac_addr_p)++;
+	if ((*mac_addr_p & 0x3) != 0x02)
+		mac_addr_p += 2;
 
 	adapter->mac_addr = 0;
 	memcpy(&adapter->mac_addr, mac_addr_p, 6);
@@ -935,6 +934,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 	netdev->do_ioctl           = ibmveth_ioctl;
 	netdev->ethtool_ops           = &netdev_ethtool_ops;
 	netdev->change_mtu         = ibmveth_change_mtu;
+	SET_NETDEV_DEV(netdev, &dev->dev);
 
 	memcpy(&netdev->dev_addr, &adapter->mac_addr, netdev->addr_len);
 
@@ -971,7 +971,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 
 static int __devexit ibmveth_remove(struct vio_dev *dev)
 {
-	struct net_device *netdev = dev->driver_data;
+	struct net_device *netdev = dev->dev.driver_data;
 	struct ibmveth_adapter *adapter = netdev->priv;
 
 	unregister_netdev(netdev);
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 654fd6907..a93cda669 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1529,12 +1529,11 @@ static struct ethtool_ops ioc3_ethtool_ops = {
 
 static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
 	struct ioc3_private *ip = netdev_priv(dev);
 	int rc;
 
 	spin_lock_irq(&ip->ioc3_lock);
-	rc = generic_mii_ioctl(&ip->mii, data, cmd, NULL);
+	rc = generic_mii_ioctl(&ip->mii, if_mii(rq), cmd, NULL);
 	spin_unlock_irq(&ip->ioc3_lock);
 
 	return rc;
diff --git a/drivers/net/irda/act200l-sir.c b/drivers/net/irda/act200l-sir.c
index 4b7a227fd..dac04fad0 100644
--- a/drivers/net/irda/act200l-sir.c
+++ b/drivers/net/irda/act200l-sir.c
@@ -178,7 +178,7 @@ static int act200l_change_speed(struct sir_dev *dev, unsigned speed)
 	/* Write control bytes */
 	sirdev_raw_write(dev, control, 3);
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MSECS_TO_JIFFIES(5));
+	schedule_timeout(msecs_to_jiffies(5));
 
 	/* Go back to normal mode */
 	sirdev_set_dtr_rts(dev, TRUE, TRUE);
diff --git a/drivers/net/irda/act200l.c b/drivers/net/irda/act200l.c
index e844feb35..e18de72c4 100644
--- a/drivers/net/irda/act200l.c
+++ b/drivers/net/irda/act200l.c
@@ -148,7 +148,7 @@ static int act200l_change_speed(struct irda_task *task)
 			irda_task_next_state(task, IRDA_TASK_CHILD_WAIT);
 
 			/* Give reset 1 sec to finish */
-			ret = MSECS_TO_JIFFIES(1000);
+			ret = msecs_to_jiffies(1000);
 		}
 		break;
 	case IRDA_TASK_CHILD_WAIT:
@@ -187,7 +187,7 @@ static int act200l_change_speed(struct irda_task *task)
 		/* Write control bytes */
 		self->write(self->dev, control, 3);
 		irda_task_next_state(task, IRDA_TASK_WAIT);
-		ret = MSECS_TO_JIFFIES(5);
+		ret = msecs_to_jiffies(5);
 		break;
 	case IRDA_TASK_WAIT:
 		/* Go back to normal mode */
@@ -237,14 +237,14 @@ static int act200l_reset(struct irda_task *task)
 		self->set_dtr_rts(self->dev, TRUE, TRUE);
 
 		irda_task_next_state(task, IRDA_TASK_WAIT1);
-		ret = MSECS_TO_JIFFIES(50);
+		ret = msecs_to_jiffies(50);
 		break;
 	case IRDA_TASK_WAIT1:
 		/* Reset the dongle : set RTS low for 25 ms */
 		self->set_dtr_rts(self->dev, TRUE, FALSE);
 
 		irda_task_next_state(task, IRDA_TASK_WAIT2);
-		ret = MSECS_TO_JIFFIES(50);
+		ret = msecs_to_jiffies(50);
 		break;
 	case IRDA_TASK_WAIT2:
 		/* Clear DTR and set RTS to enter command mode */
@@ -253,7 +253,7 @@ static int act200l_reset(struct irda_task *task)
 		/* Write control bytes */
 		self->write(self->dev, control, 9);
 		irda_task_next_state(task, IRDA_TASK_WAIT3);
-		ret = MSECS_TO_JIFFIES(15);
+		ret = msecs_to_jiffies(15);
 		break;
 	case IRDA_TASK_WAIT3:
 		/* Go back to normal mode */
diff --git a/drivers/net/irda/actisys.c b/drivers/net/irda/actisys.c
index 9a5889151..75344d648 100644
--- a/drivers/net/irda/actisys.c
+++ b/drivers/net/irda/actisys.c
@@ -238,7 +238,7 @@ static int actisys_reset(struct irda_task *task)
 		self->set_dtr_rts(self->dev, TRUE, TRUE);
 		
 		/* Sleep 50 ms to make sure capacitor is charged */
-		ret = MSECS_TO_JIFFIES(50);
+		ret = msecs_to_jiffies(50);
 		irda_task_next_state(task, IRDA_TASK_WAIT);
 		break;
 	case IRDA_TASK_WAIT:			
diff --git a/drivers/net/irda/girbil.c b/drivers/net/irda/girbil.c
index 575600ebd..ecac87df9 100644
--- a/drivers/net/irda/girbil.c
+++ b/drivers/net/irda/girbil.c
@@ -119,7 +119,7 @@ static int girbil_change_speed(struct irda_task *task)
 			irda_task_next_state(task, IRDA_TASK_CHILD_WAIT);
 
 			/* Give reset 1 sec to finish */
-			ret = MSECS_TO_JIFFIES(1000);
+			ret = msecs_to_jiffies(1000);
 		}
 		break;
 	case IRDA_TASK_CHILD_WAIT:
@@ -153,7 +153,7 @@ static int girbil_change_speed(struct irda_task *task)
 		/* Write control bytes */
 		self->write(self->dev, control, 2);
 		irda_task_next_state(task, IRDA_TASK_WAIT);
-		ret = MSECS_TO_JIFFIES(100);
+		ret = msecs_to_jiffies(100);
 		break;
 	case IRDA_TASK_WAIT:
 		/* Go back to normal mode */
@@ -194,19 +194,19 @@ static int girbil_reset(struct irda_task *task)
 		self->set_dtr_rts(self->dev, TRUE, FALSE);
 		irda_task_next_state(task, IRDA_TASK_WAIT1);
 		/* Sleep at least 5 ms */
-		ret = MSECS_TO_JIFFIES(20);
+		ret = msecs_to_jiffies(20);
 		break;
 	case IRDA_TASK_WAIT1:
 		/* Set DTR and clear RTS to enter command mode */
 		self->set_dtr_rts(self->dev, FALSE, TRUE);
 		irda_task_next_state(task, IRDA_TASK_WAIT2);
-		ret = MSECS_TO_JIFFIES(20);
+		ret = msecs_to_jiffies(20);
 		break;
 	case IRDA_TASK_WAIT2:
 		/* Write control byte */
 		self->write(self->dev, &control, 1);
 		irda_task_next_state(task, IRDA_TASK_WAIT3);
-		ret = MSECS_TO_JIFFIES(20);
+		ret = msecs_to_jiffies(20);
 		break;
 	case IRDA_TASK_WAIT3:
 		/* Go back to normal mode */
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 8da8524e5..6ae10e514 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -268,7 +268,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
                       speed_bulk_callback, self);
 	urb->transfer_buffer_length = USB_IRDA_HEADER;
 	urb->transfer_flags = URB_ASYNC_UNLINK;
-	urb->timeout = MSECS_TO_JIFFIES(100);
+	urb->timeout = msecs_to_jiffies(100);
 
 	/* Irq disabled -> GFP_ATOMIC */
 	if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) {
@@ -412,7 +412,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
 	 * This is how the dongle will detect the end of packet - Jean II */
 	urb->transfer_flags |= URB_ZERO_PACKET;
 	/* Timeout need to be shorter than NET watchdog timer */
-	urb->timeout = MSECS_TO_JIFFIES(200);
+	urb->timeout = msecs_to_jiffies(200);
 
 	/* Generate min turn time. FIXME: can we do better than this? */
 	/* Trying to a turnaround time at this level is trying to measure
@@ -1311,7 +1311,7 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
 		IU_REQ_GET_CLASS_DESC,
 		USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
 		0, intf->altsetting->desc.bInterfaceNumber, desc,
-		sizeof(*desc), MSECS_TO_JIFFIES(500));
+		sizeof(*desc), msecs_to_jiffies(500));
 	
 	IRDA_DEBUG(1, "%s(), ret=%d\n", __FUNCTION__, ret);
 	if (ret < sizeof(*desc)) {
@@ -1421,7 +1421,7 @@ static int irda_usb_probe(struct usb_interface *intf,
 	}
 
 	/* Find our endpoints */
-	interface = &intf->altsetting[0];
+	interface = intf->cur_altsetting;
 	if(!irda_usb_parse_endpoints(self, interface->endpoint,
 				     interface->desc.bNumEndpoints)) {
 		ERROR("%s(), Bogus endpoints...\n", __FUNCTION__);
diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c
index aee6526cb..6ad80edb2 100644
--- a/drivers/net/irda/irport.c
+++ b/drivers/net/irda/irport.c
@@ -452,7 +452,7 @@ int __irport_change_speed(struct irda_task *task)
 			task->state = IRDA_TASK_WAIT;
 
 			/* Try again later */
-			ret = MSECS_TO_JIFFIES(20);
+			ret = msecs_to_jiffies(20);
 			break;
 		}
 
@@ -474,7 +474,7 @@ int __irport_change_speed(struct irda_task *task)
 			irda_task_next_state(task, IRDA_TASK_CHILD_WAIT);
 
 			/* Give dongle 1 sec to finish */
-			ret = MSECS_TO_JIFFIES(1000);
+			ret = msecs_to_jiffies(1000);
 		} else
 			/* Child finished immediately */
 			irda_task_next_state(task, IRDA_TASK_CHILD_DONE);
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index c3c47e1d2..035da952e 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -93,12 +93,12 @@ static void irtty_wait_until_sent(struct sir_dev *dev)
 	tty = priv->tty;
 	if (tty->driver->wait_until_sent) {
 		lock_kernel();
-		tty->driver->wait_until_sent(tty, MSECS_TO_JIFFIES(100));
+		tty->driver->wait_until_sent(tty, msecs_to_jiffies(100));
 		unlock_kernel();
 	}
 	else {
 		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MSECS_TO_JIFFIES(USBSERIAL_TX_DONE_DELAY));
+		schedule_timeout(msecs_to_jiffies(USBSERIAL_TX_DONE_DELAY));
 	}
 }
 
diff --git a/drivers/net/irda/ma600-sir.c b/drivers/net/irda/ma600-sir.c
index 1bbf8850c..9c0a5d60d 100644
--- a/drivers/net/irda/ma600-sir.c
+++ b/drivers/net/irda/ma600-sir.c
@@ -192,7 +192,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
 
 	/* Wait at least 10ms: fake wait_until_sent - 10 bits at 9600 baud*/
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MSECS_TO_JIFFIES(15));		/* old ma600 uses 15ms */
+	schedule_timeout(msecs_to_jiffies(15));		/* old ma600 uses 15ms */
 
 #if 1
 	/* read-back of the control byte. ma600 is the first dongle driver
@@ -216,7 +216,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
 
 	/* Wait at least 10ms */
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MSECS_TO_JIFFIES(10));
+	schedule_timeout(msecs_to_jiffies(10));
 
 	/* dongle is now switched to the new speed */
 	dev->speed = speed;
@@ -246,12 +246,12 @@ int ma600_reset(struct sir_dev *dev)
 	/* Reset the dongle : set DTR low for 10 ms */
 	sirdev_set_dtr_rts(dev, FALSE, TRUE);
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MSECS_TO_JIFFIES(10));
+	schedule_timeout(msecs_to_jiffies(10));
 
 	/* Go back to normal mode */
 	sirdev_set_dtr_rts(dev, TRUE, TRUE);
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MSECS_TO_JIFFIES(10));
+	schedule_timeout(msecs_to_jiffies(10));
 
 	dev->speed = 9600;      /* That's the dongle-default */
 
diff --git a/drivers/net/irda/ma600.c b/drivers/net/irda/ma600.c
index ab2b2b694..c3dfd34d7 100644
--- a/drivers/net/irda/ma600.c
+++ b/drivers/net/irda/ma600.c
@@ -184,7 +184,7 @@ static int ma600_change_speed(struct irda_task *task)
 
 	if (self->speed_task && self->speed_task != task) {
 		IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__);
-		return MSECS_TO_JIFFIES(10);
+		return msecs_to_jiffies(10);
 	} else {
 		self->speed_task = task;
 	}
@@ -202,7 +202,7 @@ static int ma600_change_speed(struct irda_task *task)
 			irda_task_next_state(task, IRDA_TASK_CHILD_WAIT);
 	
 			/* give 1 second to finish */
-			ret = MSECS_TO_JIFFIES(1000);
+			ret = msecs_to_jiffies(1000);
 		} else {
 			irda_task_next_state(task, IRDA_TASK_CHILD_DONE);
 		}
@@ -217,7 +217,7 @@ static int ma600_change_speed(struct irda_task *task)
 		/* Set DTR, Clear RTS */
 		self->set_dtr_rts(self->dev, TRUE, FALSE);
 	
-		ret = MSECS_TO_JIFFIES(1);		/* Sleep 1 ms */
+		ret = msecs_to_jiffies(1);		/* Sleep 1 ms */
 		irda_task_next_state(task, IRDA_TASK_WAIT);
 		break;
 
@@ -231,7 +231,7 @@ static int ma600_change_speed(struct irda_task *task)
 		irda_task_next_state(task, IRDA_TASK_WAIT1);
 
 		/* Wait at least 10 ms */
-		ret = MSECS_TO_JIFFIES(15);
+		ret = msecs_to_jiffies(15);
 		break;
 
 	case IRDA_TASK_WAIT1:
@@ -258,7 +258,7 @@ static int ma600_change_speed(struct irda_task *task)
 		irda_task_next_state(task, IRDA_TASK_WAIT2);
 
 		/* Wait at least 10 ms */
-		ret = MSECS_TO_JIFFIES(10);
+		ret = msecs_to_jiffies(10);
 		break;
 
 	case IRDA_TASK_WAIT2:
@@ -298,7 +298,7 @@ int ma600_reset(struct irda_task *task)
 
 	if (self->reset_task && self->reset_task != task) {
 		IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__);
-		return MSECS_TO_JIFFIES(10);
+		return msecs_to_jiffies(10);
 	} else
 		self->reset_task = task;
 	
@@ -307,13 +307,13 @@ int ma600_reset(struct irda_task *task)
 		/* Clear DTR and Set RTS */
 		self->set_dtr_rts(self->dev, FALSE, TRUE);
 		irda_task_next_state(task, IRDA_TASK_WAIT1);
-		ret = MSECS_TO_JIFFIES(10);		/* Sleep 10 ms */
+		ret = msecs_to_jiffies(10);		/* Sleep 10 ms */
 		break;
 	case IRDA_TASK_WAIT1:
 		/* Set DTR and RTS */
 		self->set_dtr_rts(self->dev, TRUE, TRUE);
 		irda_task_next_state(task, IRDA_TASK_WAIT2);
-		ret = MSECS_TO_JIFFIES(10);		/* Sleep 10 ms */
+		ret = msecs_to_jiffies(10);		/* Sleep 10 ms */
 		break;
 	case IRDA_TASK_WAIT2:
 		irda_task_next_state(task, IRDA_TASK_DONE);
diff --git a/drivers/net/irda/mcp2120.c b/drivers/net/irda/mcp2120.c
index 57cc14716..d170df507 100644
--- a/drivers/net/irda/mcp2120.c
+++ b/drivers/net/irda/mcp2120.c
@@ -99,7 +99,7 @@ static int mcp2120_change_speed(struct irda_task *task)
 			irda_task_next_state(task, IRDA_TASK_CHILD_WAIT);
 
 			/* Give reset 1 sec to finish */
-			ret = MSECS_TO_JIFFIES(1000);
+			ret = msecs_to_jiffies(1000);
 		}
 		break;
 	case IRDA_TASK_CHILD_WAIT:
@@ -140,7 +140,7 @@ static int mcp2120_change_speed(struct irda_task *task)
                 self->write(self->dev, control, 2);
  
                 irda_task_next_state(task, IRDA_TASK_WAIT);
-		ret = MSECS_TO_JIFFIES(100);
+		ret = msecs_to_jiffies(100);
                 //printk("mcp2120_change_speed irda_child_done\n");
 		break;
 	case IRDA_TASK_WAIT:
@@ -189,14 +189,14 @@ static int mcp2120_reset(struct irda_task *task)
 		/* Reset dongle by setting RTS*/
 		self->set_dtr_rts(self->dev, TRUE, TRUE);
 		irda_task_next_state(task, IRDA_TASK_WAIT1);
-		ret = MSECS_TO_JIFFIES(50);
+		ret = msecs_to_jiffies(50);
 		break;
 	case IRDA_TASK_WAIT1:
                 //printk("mcp2120_reset irda_task_wait1\n");
                 /* clear RTS and wait for at least 30 ms. */
 		self->set_dtr_rts(self->dev, FALSE, FALSE);
 		irda_task_next_state(task, IRDA_TASK_WAIT2);
-		ret = MSECS_TO_JIFFIES(50);
+		ret = msecs_to_jiffies(50);
 		break;
 	case IRDA_TASK_WAIT2:
                 //printk("mcp2120_reset irda_task_wait2\n");
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
index 9581f165b..2d7f183d7 100644
--- a/drivers/net/irda/sir_dev.c
+++ b/drivers/net/irda/sir_dev.c
@@ -74,7 +74,7 @@ int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len)
 	while (dev->tx_buff.len > 0) {			/* wait until tx idle */
 		spin_unlock_irqrestore(&dev->tx_lock, flags);
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MSECS_TO_JIFFIES(10));
+		schedule_timeout(msecs_to_jiffies(10));
 		spin_lock_irqsave(&dev->tx_lock, flags);
 	}
 
@@ -163,10 +163,8 @@ void sirdev_write_complete(struct sir_dev *dev)
 			}
 			dev->tx_buff.len = 0;
 		}
-		if (dev->tx_buff.len > 0) {
-			spin_unlock_irqrestore(&dev->tx_lock, flags);
-			return;
-		}
+		if (dev->tx_buff.len > 0)
+			goto done;	/* more data to send later */
 	}
 
 	if (unlikely(dev->raw_tx != 0)) {
@@ -179,7 +177,7 @@ void sirdev_write_complete(struct sir_dev *dev)
 
 		IRDA_DEBUG(3, "%s(), raw-tx done\n", __FUNCTION__);
 		dev->raw_tx = 0;
-		return;
+		goto done;	/* no post-frame handling in raw mode */
 	}
 
 	/* we have finished now sending this skb.
@@ -224,6 +222,7 @@ void sirdev_write_complete(struct sir_dev *dev)
 		netif_wake_queue(dev->netdev);
 	}
 
+done:
 	spin_unlock_irqrestore(&dev->tx_lock, flags);
 }
 
diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
index e53c6a54c..d1a656f74 100644
--- a/drivers/net/irda/sir_kthread.c
+++ b/drivers/net/irda/sir_kthread.c
@@ -415,7 +415,7 @@ static void irda_config_fsm(void *data)
 		fsm->state = next_state;
 	} while(!delay);
 
-	irda_queue_delayed_request(&fsm->rq, MSECS_TO_JIFFIES(delay));
+	irda_queue_delayed_request(&fsm->rq, msecs_to_jiffies(delay));
 }
 
 /* schedule some device configuration task for execution by kIrDAd
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index f00f9c4bc..81282d94f 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -48,6 +48,7 @@
 #include <linux/netdevice.h>
 #include <linux/suspend.h>
 #include <linux/slab.h>
+#include <linux/delay.h>
 #include <linux/usb.h>
 #include <linux/crc32.h>
 #include <net/irda/irda.h>
@@ -208,7 +209,7 @@ static int write_reg(struct stir_cb *stir, __u16 reg, __u8 value)
 			       REQ_WRITE_SINGLE,
 			       USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_DEVICE,
 			       value, reg, NULL, 0,
-			       MSECS_TO_JIFFIES(CTRL_TIMEOUT));
+			       msecs_to_jiffies(CTRL_TIMEOUT));
 }
 
 /* Send control message to read multiple registers */
@@ -221,7 +222,7 @@ static inline int read_reg(struct stir_cb *stir, __u16 reg,
 			       REQ_READ_REG,
 			       USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			       0, reg, data, count,
-			       MSECS_TO_JIFFIES(CTRL_TIMEOUT));
+			       msecs_to_jiffies(CTRL_TIMEOUT));
 }
 
 static inline int isfir(u32 speed)
@@ -652,7 +653,7 @@ static int fifo_txwait(struct stir_cb *stir, int space)
 			return 0;
 
 		/* estimate transfer time for remaining chars */
-		wait_ms((count * 8000) / stir->speed);
+		msleep((count * 8000) / stir->speed);
 	}
 			
 	err = write_reg(stir, REG_FIFOCTL, FIFOCTL_CLR);
@@ -745,7 +746,7 @@ static void stir_send(struct stir_cb *stir, struct sk_buff *skb)
 
 	if (usb_bulk_msg(stir->usbdev, usb_sndbulkpipe(stir->usbdev, 1),
 			 stir->io_buf, wraplen,
-			 NULL, MSECS_TO_JIFFIES(TRANSMIT_TIMEOUT))) 
+			 NULL, msecs_to_jiffies(TRANSMIT_TIMEOUT)))
 		stir->stats.tx_errors++;
 }
 
@@ -810,7 +811,7 @@ static int stir_transmit_thread(void *arg)
 					info("%s: receive usb submit failed",
 					     stir->netdev->name);
 				stir->receiving = 0;
-				wait_ms(10);
+				msleep(10);
 				continue;
 			}
 		}
diff --git a/drivers/net/irda/tekram-sir.c b/drivers/net/irda/tekram-sir.c
index 0cc1c71f8..8d3d775b7 100644
--- a/drivers/net/irda/tekram-sir.c
+++ b/drivers/net/irda/tekram-sir.c
@@ -211,7 +211,7 @@ static int tekram_reset(struct sir_dev *dev)
 
 	/* Should sleep 1 ms */
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MSECS_TO_JIFFIES(1));
+	schedule_timeout(msecs_to_jiffies(1));
 
 	/* Set DTR, Set RTS */
 	sirdev_set_dtr_rts(dev, TRUE, TRUE);
diff --git a/drivers/net/irda/tekram.c b/drivers/net/irda/tekram.c
index cb1441ecd..d0de866fd 100644
--- a/drivers/net/irda/tekram.c
+++ b/drivers/net/irda/tekram.c
@@ -113,7 +113,7 @@ static int tekram_change_speed(struct irda_task *task)
 
 	if (self->speed_task && self->speed_task != task) {
 		IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__ );
-		return MSECS_TO_JIFFIES(10);
+		return msecs_to_jiffies(10);
 	} else
 		self->speed_task = task;
 
@@ -150,7 +150,7 @@ static int tekram_change_speed(struct irda_task *task)
 			irda_task_next_state(task, IRDA_TASK_CHILD_WAIT);
 
 			/* Give reset 1 sec to finish */
-			ret = MSECS_TO_JIFFIES(1000);
+			ret = msecs_to_jiffies(1000);
 		} else
 			irda_task_next_state(task, IRDA_TASK_CHILD_DONE);
 		break;
@@ -171,7 +171,7 @@ static int tekram_change_speed(struct irda_task *task)
 		irda_task_next_state(task, IRDA_TASK_WAIT);
 
 		/* Wait at least 100 ms */
-		ret = MSECS_TO_JIFFIES(150);
+		ret = msecs_to_jiffies(150);
 		break;
 	case IRDA_TASK_WAIT:
 		/* Set DTR, Set RTS */
@@ -214,7 +214,7 @@ int tekram_reset(struct irda_task *task)
 
 	if (self->reset_task && self->reset_task != task) {
 		IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__ );
-		return MSECS_TO_JIFFIES(10);
+		return msecs_to_jiffies(10);
 	} else
 		self->reset_task = task;
 	
@@ -227,7 +227,7 @@ int tekram_reset(struct irda_task *task)
 		irda_task_next_state(task, IRDA_TASK_WAIT1);
 
 		/* Sleep 50 ms */
-		ret = MSECS_TO_JIFFIES(50);
+		ret = msecs_to_jiffies(50);
 		break;
 	case IRDA_TASK_WAIT1:
 		/* Clear DTR, Set RTS */
@@ -236,7 +236,7 @@ int tekram_reset(struct irda_task *task)
 		irda_task_next_state(task, IRDA_TASK_WAIT2);
 		
 		/* Should sleep 1 ms */
-		ret = MSECS_TO_JIFFIES(1);
+		ret = msecs_to_jiffies(1);
 		break;
 	case IRDA_TASK_WAIT2:
 		/* Set DTR, Set RTS */
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 97fd269a9..634cb049c 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -461,6 +461,11 @@ static void veth_statemachine(void *p)
 		if (cnx->msgs)
 			for (i = 0; i < VETH_NUMBUFFERS; ++i)
 				veth_recycle_msg(cnx, cnx->msgs + i);
+		spin_unlock_irq(&cnx->lock);
+		veth_flush_pending(cnx);
+		spin_lock_irq(&cnx->lock);
+		if (cnx->state & VETH_STATE_RESET)
+			goto restart;
 	}
 
 	if (cnx->state & VETH_STATE_SHUTDOWN)
@@ -796,6 +801,48 @@ static int veth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	return -EOPNOTSUPP;
 }
 
+static void veth_tx_timeout(struct net_device *dev)
+{
+	struct veth_port *port = (struct veth_port *)dev->priv;
+	struct net_device_stats *stats = &port->stats;
+	unsigned long flags;
+	int i;
+
+	stats->tx_errors++;
+
+	spin_lock_irqsave(&port->pending_gate, flags);
+
+	printk(KERN_WARNING "%s: Tx timeout!  Resetting lp connections: %08x\n",
+	       dev->name, port->pending_lpmask);
+
+	/* If we've timed out the queue must be stopped, which should
+	 * only ever happen when there is a pending packet. */
+	WARN_ON(! port->pending_lpmask);
+
+	for (i = 0; i < HVMAXARCHITECTEDLPS; i++) {
+		struct veth_lpar_connection *cnx = veth_cnx[i];
+
+		if (! (port->pending_lpmask & (1<<i)))
+			continue;
+
+		/* If we're pending on it, we must be connected to it,
+		 * so we should certainly have a structure for it. */
+		BUG_ON(! cnx);
+
+		/* Theoretically we could be kicking a connection
+		 * which doesn't deserve it, but in practice if we've
+		 * had a Tx timeout, the pending_lpmask will have
+		 * exactly one bit set - the connection causing the
+		 * problem. */
+		spin_lock(&cnx->lock);
+		cnx->state |= VETH_STATE_RESET;
+		veth_kick_statemachine(cnx);
+		spin_unlock(&cnx->lock);
+	}
+
+	spin_unlock_irqrestore(&port->pending_gate, flags);
+}
+
 struct net_device * __init veth_probe_one(int vlan)
 {
 	struct net_device *dev;
@@ -843,6 +890,9 @@ struct net_device * __init veth_probe_one(int vlan)
 	dev->set_multicast_list = veth_set_multicast_list;
 	dev->do_ioctl = veth_ioctl;
 
+	dev->watchdog_timeo = 2 * (VETH_ACKTIMEOUT * HZ / 1000000);
+	dev->tx_timeout = veth_tx_timeout;
+
 	rc = register_netdev(dev);
 	if (rc != 0) {
 		veth_printk(KERN_ERR,
@@ -938,19 +988,10 @@ static HvLpIndexMap veth_transmit_to_many(struct sk_buff *skb,
 	int rc;
 
 	for (i = 0; i < HVMAXARCHITECTEDLPS; i++) {
-		struct sk_buff *clone;
-
-		if (! lpmask & (1<<i))
+		if ((lpmask & (1 << i)) == 0)
 			continue;
 
-		clone = skb_clone(skb, GFP_ATOMIC);
-		if (! clone) {
-			veth_error("%s: skb_clone failed %p\n",
-				   dev->name, skb);
-			continue;
-		}
-
-		rc = veth_transmit_to_one(clone, i, dev);
+		rc = veth_transmit_to_one(skb_get(skb), i, dev);
 		if (! rc)
 			lpmask &= ~(1<<i);
 	}
@@ -984,26 +1025,28 @@ static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		lpmask = port->lpar_map;
 	}
 
+	spin_lock_irqsave(&port->pending_gate, flags);
+
 	lpmask = veth_transmit_to_many(skb, lpmask, dev);
 
 	if (! lpmask) {
 		dev_kfree_skb(skb);
 	} else {
-		spin_lock_irqsave(&port->pending_gate, flags);
 		if (port->pending_skb) {
 			veth_error("%s: Tx while skb was pending!\n",
 				   dev->name);
 			dev_kfree_skb(skb);
+			spin_unlock_irqrestore(&port->pending_gate, flags);
 			return 1;
 		}
 
 		port->pending_skb = skb;
 		port->pending_lpmask = lpmask;
 		netif_stop_queue(dev);
-
-		spin_unlock_irqrestore(&port->pending_gate, flags);
 	}
 
+	spin_unlock_irqrestore(&port->pending_gate, flags);
+
 	return 0;
 }
 
@@ -1057,7 +1100,7 @@ static void veth_flush_pending(struct veth_lpar_connection *cnx)
 			if (! port->pending_lpmask) {
 				dev_kfree_skb_any(port->pending_skb);
 				port->pending_skb = NULL;
-				netif_start_queue(dev);
+				netif_wake_queue(dev);
 			}
 		}
 		spin_unlock_irqrestore(&port->pending_gate, flags);
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index 6f09f7a61..d6c008b26 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 #ifndef _IXGB_H_
@@ -34,39 +35,44 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 #include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
+#include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/timer.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
 #include <linux/string.h>
 #include <linux/pagemap.h>
 #include <linux/dma-mapping.h>
-#include <linux/bitops.h>
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <linux/capability.h>
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/udp.h>
 #include <net/pkt_sched.h>
 #include <linux/list.h>
-#include <linux/workqueue.h>
 #include <linux/reboot.h>
 #ifdef NETIF_F_TSO
 #include <net/checksum.h>
 #endif
 
-/* ethtool support */
 #include <linux/ethtool.h>
 #include <linux/if_vlan.h>
 
-struct ixgb_adapter;
-
-#define BAR_0           0
-#define BAR_1           1
-#define BAR_5           5
+#define BAR_0		0
+#define BAR_1		1
+#define BAR_5		5
 
+struct ixgb_adapter;
 #include "ixgb_hw.h"
 #include "ixgb_ee.h"
 #include "ixgb_ids.h"
@@ -89,7 +95,7 @@ struct ixgb_adapter;
 #define IXGB_TX_QUEUE_WAKE 16
 
 /* How many Rx Buffers do we bundle into one write to the hardware ? */
-#define IXGB_RX_BUFFER_WRITE    16
+#define IXGB_RX_BUFFER_WRITE	16	/* Must be power of 2 */
 
 /* only works for sizes that are powers of 2 */
 #define IXGB_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
@@ -101,71 +107,66 @@ struct ixgb_buffer {
 	uint64_t dma;
 	unsigned long length;
 	unsigned long time_stamp;
+	unsigned int next_to_watch;
 };
 
 struct ixgb_desc_ring {
-	/* pointer to the descriptor ring memory  */
+	/* pointer to the descriptor ring memory */
 	void *desc;
-	/* physical address of the descriptor ring  */
+	/* physical address of the descriptor ring */
 	dma_addr_t dma;
-	/* length of descriptor ring in bytes  */
+	/* length of descriptor ring in bytes */
 	unsigned int size;
-	/* number of descriptors in the ring  */
+	/* number of descriptors in the ring */
 	unsigned int count;
-	/* next descriptor to associate a buffer with  */
+	/* next descriptor to associate a buffer with */
 	unsigned int next_to_use;
-	/* next descriptor to check for DD status bit  */
+	/* next descriptor to check for DD status bit */
 	unsigned int next_to_clean;
-	/* array of buffer information structs  */
+	/* array of buffer information structs */
 	struct ixgb_buffer *buffer_info;
 };
 
 #define IXGB_DESC_UNUSED(R) \
-((((R)->next_to_clean + (R)->count) - ((R)->next_to_use + 1)) % ((R)->count))
+	((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
+	(R)->next_to_clean - (R)->next_to_use - 1)
 
-#define IXGB_GET_DESC(R, i, type)       (&(((struct type *)((R).desc))[i]))
-#define IXGB_RX_DESC(R, i)              IXGB_GET_DESC(R, i, ixgb_rx_desc)
-#define IXGB_TX_DESC(R, i)              IXGB_GET_DESC(R, i, ixgb_tx_desc)
-#define IXGB_CONTEXT_DESC(R, i)         IXGB_GET_DESC(R, i, ixgb_context_desc)
+#define IXGB_GET_DESC(R, i, type)	(&(((struct type *)((R).desc))[i]))
+#define IXGB_RX_DESC(R, i)		IXGB_GET_DESC(R, i, ixgb_rx_desc)
+#define IXGB_TX_DESC(R, i)		IXGB_GET_DESC(R, i, ixgb_tx_desc)
+#define IXGB_CONTEXT_DESC(R, i)	IXGB_GET_DESC(R, i, ixgb_context_desc)
 
 /* board specific private data structure */
 
 struct ixgb_adapter {
 	struct timer_list watchdog_timer;
 	struct vlan_group *vlgrp;
-	char *id_string;
-	u32 bd_number;
-	u32 rx_buffer_len;
-	u32 part_num;
-	u16 link_speed;
-	u16 link_duplex;
+	uint32_t bd_number;
+	uint32_t rx_buffer_len;
+	uint32_t part_num;
+	uint16_t link_speed;
+	uint16_t link_duplex;
+	spinlock_t tx_lock;
 	atomic_t irq_sem;
 	struct work_struct tx_timeout_task;
 
-#ifdef ETHTOOL_PHYS_ID
 	struct timer_list blink_timer;
 	unsigned long led_status;
-#endif
-#ifdef _INTERNAL_LOOPBACK_DRIVER_
-	struct ixgb_desc_ring diag_tx_ring;
-	struct ixgb_desc_ring diag_rx_ring;
-#endif
+
 	/* TX */
 	struct ixgb_desc_ring tx_ring;
 	unsigned long timeo_start;
-	u32 tx_cmd_type;
-	int max_data_per_txd;
+	uint32_t tx_cmd_type;
 	uint64_t hw_csum_tx_good;
 	uint64_t hw_csum_tx_error;
-	boolean_t tx_csum;
-	u32 tx_int_delay;
+	uint32_t tx_int_delay;
 	boolean_t tx_int_delay_enable;
 
 	/* RX */
 	struct ixgb_desc_ring rx_ring;
 	uint64_t hw_csum_rx_error;
 	uint64_t hw_csum_rx_good;
-	u32 rx_int_delay;
+	uint32_t rx_int_delay;
 	boolean_t raidc;
 	boolean_t rx_csum;
 
@@ -177,8 +178,6 @@ struct ixgb_adapter {
 	/* structs defined in ixgb_hw.h */
 	struct ixgb_hw hw;
 	struct ixgb_hw_stats stats;
-	u32 pci_state[16];
-	char ifname[IFNAMSIZ];
+	uint32_t pci_state[16];
 };
-
 #endif				/* _IXGB_H_ */
diff --git a/drivers/net/ixgb/ixgb_ee.c b/drivers/net/ixgb/ixgb_ee.c
index b89e0430b..c8adde5c9 100644
--- a/drivers/net/ixgb/ixgb_ee.c
+++ b/drivers/net/ixgb/ixgb_ee.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,15 +23,16 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 #include "ixgb_hw.h"
 #include "ixgb_ee.h"
 /* Local prototypes */
-static u16 ixgb_shift_in_bits(struct ixgb_hw *hw);
+static uint16_t ixgb_shift_in_bits(struct ixgb_hw *hw);
 
 static void ixgb_shift_out_bits(struct ixgb_hw *hw,
-				u16 data, u16 count);
+				uint16_t data, uint16_t count);
 static void ixgb_standby_eeprom(struct ixgb_hw *hw);
 
 static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw);
@@ -44,8 +45,7 @@ static void ixgb_cleanup_eeprom(struct ixgb_hw *hw);
  * hw - Struct containing variables accessed by shared code
  * eecd_reg - EECD's current value
  *****************************************************************************/
-static void
-ixgb_raise_clock(struct ixgb_hw *hw, u32 * eecd_reg)
+static void ixgb_raise_clock(struct ixgb_hw *hw, uint32_t * eecd_reg)
 {
 	/* Raise the clock input to the EEPROM (by setting the SK bit), and then
 	 *  wait 50 microseconds.
@@ -59,14 +59,13 @@ ixgb_raise_clock(struct ixgb_hw *hw, u32 * eecd_reg)
 /******************************************************************************
  * Lowers the EEPROM's clock input.
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  * eecd_reg - EECD's current value
  *****************************************************************************/
-static void
-ixgb_lower_clock(struct ixgb_hw *hw, u32 * eecd_reg)
+static void ixgb_lower_clock(struct ixgb_hw *hw, uint32_t * eecd_reg)
 {
-	/* Lower the clock input to the EEPROM (by clearing the SK bit), and then 
-	 * wait 50 microseconds. 
+	/* Lower the clock input to the EEPROM (by clearing the SK bit), and then
+	 * wait 50 microseconds.
 	 */
 	*eecd_reg = *eecd_reg & ~IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, *eecd_reg);
@@ -82,14 +81,14 @@ ixgb_lower_clock(struct ixgb_hw *hw, u32 * eecd_reg)
  * count - number of bits to shift out
  *****************************************************************************/
 static void
-ixgb_shift_out_bits(struct ixgb_hw *hw, u16 data, u16 count)
+ixgb_shift_out_bits(struct ixgb_hw *hw, uint16_t data, uint16_t count)
 {
-	u32 eecd_reg;
-	u32 mask;
+	uint32_t eecd_reg;
+	uint32_t mask;
 
 	/* We need to shift "count" bits out to the EEPROM. So, value in the
 	 * "data" parameter will be shifted out to the EEPROM one bit at a time.
-	 * In order to do this, "data" must be broken down into bits. 
+	 * In order to do this, "data" must be broken down into bits.
 	 */
 	mask = 0x01 << (count - 1);
 	eecd_reg = IXGB_READ_REG(hw, EECD);
@@ -127,17 +126,16 @@ ixgb_shift_out_bits(struct ixgb_hw *hw, u16 data, u16 count)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-static u16
-ixgb_shift_in_bits(struct ixgb_hw *hw)
+static uint16_t ixgb_shift_in_bits(struct ixgb_hw *hw)
 {
-	u32 eecd_reg;
-	u32 i;
-	u16 data;
+	uint32_t eecd_reg;
+	uint32_t i;
+	uint16_t data;
 
-	/* In order to read a register from the EEPROM, we need to shift 16 bits 
+	/* In order to read a register from the EEPROM, we need to shift 16 bits
 	 * in from the EEPROM. Bits are "shifted in" by raising the clock input to
 	 * the EEPROM (setting the SK bit), and then reading the value of the "DO"
-	 * bit.  During this "shifting in" process the "DI" bit should always be 
+	 * bit.  During this "shifting in" process the "DI" bit should always be
 	 * clear..
 	 */
 
@@ -167,13 +165,12 @@ ixgb_shift_in_bits(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *
- * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This 
+ * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This
  * function should be called before issuing a command to the EEPROM.
  *****************************************************************************/
-static void
-ixgb_setup_eeprom(struct ixgb_hw *hw)
+static void ixgb_setup_eeprom(struct ixgb_hw *hw)
 {
-	u32 eecd_reg;
+	uint32_t eecd_reg;
 
 	eecd_reg = IXGB_READ_REG(hw, EECD);
 
@@ -189,13 +186,12 @@ ixgb_setup_eeprom(struct ixgb_hw *hw)
 
 /******************************************************************************
  * Returns EEPROM to a "standby" state
- * 
+ *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-static void
-ixgb_standby_eeprom(struct ixgb_hw *hw)
+static void ixgb_standby_eeprom(struct ixgb_hw *hw)
 {
-	u32 eecd_reg;
+	uint32_t eecd_reg;
 
 	eecd_reg = IXGB_READ_REG(hw, EECD);
 
@@ -226,10 +222,9 @@ ixgb_standby_eeprom(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-static void
-ixgb_clock_eeprom(struct ixgb_hw *hw)
+static void ixgb_clock_eeprom(struct ixgb_hw *hw)
 {
-	u32 eecd_reg;
+	uint32_t eecd_reg;
 
 	eecd_reg = IXGB_READ_REG(hw, EECD);
 
@@ -250,10 +245,9 @@ ixgb_clock_eeprom(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-static void
-ixgb_cleanup_eeprom(struct ixgb_hw *hw)
+static void ixgb_cleanup_eeprom(struct ixgb_hw *hw)
 {
-	u32 eecd_reg;
+	uint32_t eecd_reg;
 
 	eecd_reg = IXGB_READ_REG(hw, EECD);
 
@@ -271,18 +265,17 @@ ixgb_cleanup_eeprom(struct ixgb_hw *hw)
  * hw - Struct containing variables accessed by shared code
  *
  * The command is done when the EEPROM's data out pin goes high.
- * 
+ *
  * Returns:
  *      TRUE: EEPROM data pin is high before timeout.
  *      FALSE:  Time expired.
  *****************************************************************************/
-static boolean_t
-ixgb_wait_eeprom_command(struct ixgb_hw *hw)
+static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw)
 {
-	u32 eecd_reg;
-	u32 i;
+	uint32_t eecd_reg;
+	uint32_t i;
 
-	/* Toggle the CS line.  This in effect tells to EEPROM to actually execute 
+	/* Toggle the CS line.  This in effect tells to EEPROM to actually execute
 	 * the command in question.
 	 */
 	ixgb_standby_eeprom(hw);
@@ -305,7 +298,7 @@ ixgb_wait_eeprom_command(struct ixgb_hw *hw)
 
 /******************************************************************************
  * Verifies that the EEPROM has a valid checksum
- * 
+ *
  * hw - Struct containing variables accessed by shared code
  *
  * Reads the first 64 16 bit words of the EEPROM and sums the values read.
@@ -316,16 +309,15 @@ ixgb_wait_eeprom_command(struct ixgb_hw *hw)
  *  TRUE: Checksum is valid
  *  FALSE: Checksum is not valid.
  *****************************************************************************/
-boolean_t
-ixgb_validate_eeprom_checksum(struct ixgb_hw * hw)
+boolean_t ixgb_validate_eeprom_checksum(struct ixgb_hw * hw)
 {
-	u16 checksum = 0;
-	u16 i;
+	uint16_t checksum = 0;
+	uint16_t i;
 
 	for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++)
 		checksum += ixgb_read_eeprom(hw, i);
 
-	if (checksum == (u16) EEPROM_SUM)
+	if (checksum == (uint16_t) EEPROM_SUM)
 		return (TRUE);
 	else
 		return (FALSE);
@@ -339,16 +331,15 @@ ixgb_validate_eeprom_checksum(struct ixgb_hw * hw)
  * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA.
  * Writes the difference to word offset 63 of the EEPROM.
  *****************************************************************************/
-void
-ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
+void ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
 {
-	u16 checksum = 0;
-	u16 i;
+	uint16_t checksum = 0;
+	uint16_t i;
 
 	for (i = 0; i < EEPROM_CHECKSUM_REG; i++)
 		checksum += ixgb_read_eeprom(hw, i);
 
-	checksum = (u16) EEPROM_SUM - checksum;
+	checksum = (uint16_t) EEPROM_SUM - checksum;
 
 	ixgb_write_eeprom(hw, EEPROM_CHECKSUM_REG, checksum);
 	return;
@@ -361,18 +352,17 @@ ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
  * reg - offset within the EEPROM to be written to
  * data - 16 bit word to be writen to the EEPROM
  *
- * If ixgb_update_eeprom_checksum is not called after this function, the 
+ * If ixgb_update_eeprom_checksum is not called after this function, the
  * EEPROM will most likely contain an invalid checksum.
  *
  *****************************************************************************/
-void
-ixgb_write_eeprom(struct ixgb_hw *hw, u16 offset, u16 data)
+void ixgb_write_eeprom(struct ixgb_hw *hw, uint16_t offset, uint16_t data)
 {
 	/*  Prepare the EEPROM for writing  */
 	ixgb_setup_eeprom(hw);
 
 	/*  Send the 9-bit EWEN (write enable) command to the EEPROM (5-bit opcode
-	 *  plus 4-bit dummy).  This puts the EEPROM into write/erase mode. 
+	 *  plus 4-bit dummy).  This puts the EEPROM into write/erase mode.
 	 */
 	ixgb_shift_out_bits(hw, EEPROM_EWEN_OPCODE, 5);
 	ixgb_shift_out_bits(hw, 0, 4);
@@ -414,17 +404,16 @@ ixgb_write_eeprom(struct ixgb_hw *hw, u16 offset, u16 data)
  * Returns:
  *  The 16-bit value read from the eeprom
  *****************************************************************************/
-u16
-ixgb_read_eeprom(struct ixgb_hw * hw, u16 offset)
+uint16_t ixgb_read_eeprom(struct ixgb_hw * hw, uint16_t offset)
 {
-	u16 data;
+	uint16_t data;
 
 	/*  Prepare the EEPROM for reading  */
 	ixgb_setup_eeprom(hw);
 
 	/*  Send the READ command (opcode + addr)  */
 	ixgb_shift_out_bits(hw, EEPROM_READ_OPCODE, 3);
-	/* 
+	/*
 	 * We have a 64 word EEPROM, there are 6 address bits
 	 */
 	ixgb_shift_out_bits(hw, offset, 6);
@@ -442,32 +431,31 @@ ixgb_read_eeprom(struct ixgb_hw * hw, u16 offset)
  * Reads eeprom and stores data in shared structure.
  * Validates eeprom checksum and eeprom signature.
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
  * Returns:
  *      TRUE: if eeprom read is successful
  *      FALSE: otherwise.
  *****************************************************************************/
-boolean_t
-ixgb_get_eeprom_data(struct ixgb_hw * hw)
+boolean_t ixgb_get_eeprom_data(struct ixgb_hw * hw)
 {
-	u16 i;
-	u16 checksum = 0;
+	uint16_t i;
+	uint16_t checksum = 0;
 	struct ixgb_ee_map_type *ee_map;
 
 	DEBUGFUNC("ixgb_get_eeprom_data");
 
-	ee_map = (struct ixgb_ee_map_type *) hw->eeprom;
+	ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	DEBUGOUT("ixgb_ee: Reading eeprom data\n");
 	for (i = 0; i < IXGB_EEPROM_SIZE; i++) {
-		u16 ee_data;
+		uint16_t ee_data;
 		ee_data = ixgb_read_eeprom(hw, i);
 		checksum += ee_data;
 		hw->eeprom[i] = le16_to_cpu(ee_data);
 	}
 
-	if (checksum != (u16) EEPROM_SUM) {
+	if (checksum != (uint16_t) EEPROM_SUM) {
 		DEBUGOUT("ixgb_ee: Checksum invalid.\n");
 		return (FALSE);
 	}
@@ -485,17 +473,15 @@ ixgb_get_eeprom_data(struct ixgb_hw * hw)
  * Local function to check if the eeprom signature is good
  * If the eeprom signature is good, calls ixgb)get_eeprom_data.
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
  * Returns:
  *      TRUE: eeprom signature was good and the eeprom read was successful
  *      FALSE: otherwise.
  ******************************************************************************/
-static boolean_t
-ixgb_check_and_get_eeprom_data(struct ixgb_hw *hw)
+static boolean_t ixgb_check_and_get_eeprom_data(struct ixgb_hw *hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if ((ee_map->init_ctrl_reg_1 & le16_to_cpu(EEPROM_ICW1_SIGNATURE_MASK))
 	    == le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) {
@@ -505,20 +491,38 @@ ixgb_check_and_get_eeprom_data(struct ixgb_hw *hw)
 	}
 }
 
+/******************************************************************************
+ * return a word from the eeprom
+ *
+ * hw - Struct containing variables accessed by shared code
+ * index - Offset of eeprom word
+ *
+ * Returns:
+ *          Word at indexed offset in eeprom, if valid, 0 otherwise.
+ ******************************************************************************/
+uint16_t ixgb_get_eeprom_word(struct ixgb_hw * hw, uint16_t index)
+{
+
+	if ((index < IXGB_EEPROM_SIZE) &&
+	    (ixgb_check_and_get_eeprom_data(hw) == TRUE)) {
+		return (hw->eeprom[index]);
+	}
+
+	return (0);
+}
+
 /******************************************************************************
  * return the mac address from EEPROM
  *
- * hw       - Struct containing variables accessed by shared code 
+ * hw       - Struct containing variables accessed by shared code
  * mac_addr - Ethernet Address if EEPROM contents are valid, 0 otherwise
  *
  * Returns: None.
  ******************************************************************************/
-void
-ixgb_get_ee_mac_addr(struct ixgb_hw *hw, u8 * mac_addr)
+void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t * mac_addr)
 {
 	int i;
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	DEBUGFUNC("ixgb_get_ee_mac_addr");
 
@@ -533,16 +537,14 @@ ixgb_get_ee_mac_addr(struct ixgb_hw *hw, u8 * mac_addr)
 /******************************************************************************
  * return the compatibility flags from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          compatibility flags if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_compatibility(struct ixgb_hw *hw)
+uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->compatibility);
@@ -553,13 +555,12 @@ ixgb_get_ee_compatibility(struct ixgb_hw *hw)
 /******************************************************************************
  * return the Printed Board Assembly number from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          PBA number if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u32
-ixgb_get_ee_pba_number(struct ixgb_hw * hw)
+uint32_t ixgb_get_ee_pba_number(struct ixgb_hw * hw)
 {
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG])
@@ -576,11 +577,9 @@ ixgb_get_ee_pba_number(struct ixgb_hw * hw)
  * Returns:
  *          Initialization Control Word 1 if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->init_ctrl_reg_1);
@@ -591,16 +590,14 @@ ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw * hw)
 /******************************************************************************
  * return the Initialization Control Word 2 from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          Initialization Control Word 2 if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->init_ctrl_reg_2);
@@ -611,16 +608,14 @@ ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw * hw)
 /******************************************************************************
  * return the Subsystem Id from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          Subsystem Id if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_subsystem_id(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_subsystem_id(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->subsystem_id);
@@ -631,16 +626,14 @@ ixgb_get_ee_subsystem_id(struct ixgb_hw * hw)
 /******************************************************************************
  * return the Sub Vendor Id from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          Sub Vendor Id if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_subvendor_id(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_subvendor_id(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->subvendor_id);
@@ -651,16 +644,14 @@ ixgb_get_ee_subvendor_id(struct ixgb_hw * hw)
 /******************************************************************************
  * return the Device Id from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          Device Id if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_device_id(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_device_id(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->device_id);
@@ -671,16 +662,14 @@ ixgb_get_ee_device_id(struct ixgb_hw * hw)
 /******************************************************************************
  * return the Vendor Id from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          Device Id if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_vendor_id(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_vendor_id(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->vendor_id);
@@ -691,16 +680,14 @@ ixgb_get_ee_vendor_id(struct ixgb_hw * hw)
 /******************************************************************************
  * return the Software Defined Pins Register from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          SDP Register if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u16
-ixgb_get_ee_swdpins_reg(struct ixgb_hw * hw)
+uint16_t ixgb_get_ee_swdpins_reg(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->swdpins_reg);
@@ -711,16 +698,14 @@ ixgb_get_ee_swdpins_reg(struct ixgb_hw * hw)
 /******************************************************************************
  * return the D3 Power Management Bits from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          D3 Power Management Bits if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u8
-ixgb_get_ee_d3_power(struct ixgb_hw * hw)
+uint8_t ixgb_get_ee_d3_power(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->d3_power);
@@ -731,16 +716,14 @@ ixgb_get_ee_d3_power(struct ixgb_hw * hw)
 /******************************************************************************
  * return the D0 Power Management Bits from EEPROM
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
- * Returns: 
+ * Returns:
  *          D0 Power Management Bits if EEPROM contents are valid, 0 otherwise
  ******************************************************************************/
-u8
-ixgb_get_ee_d0_power(struct ixgb_hw * hw)
+uint8_t ixgb_get_ee_d0_power(struct ixgb_hw * hw)
 {
-	struct ixgb_ee_map_type *ee_map =
-	    (struct ixgb_ee_map_type *) hw->eeprom;
+	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
 
 	if (ixgb_check_and_get_eeprom_data(hw) == TRUE)
 		return (ee_map->d0_power);
diff --git a/drivers/net/ixgb/ixgb_ee.h b/drivers/net/ixgb/ixgb_ee.h
index f19bb5486..5c473572f 100644
--- a/drivers/net/ixgb/ixgb_ee.h
+++ b/drivers/net/ixgb/ixgb_ee.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 #ifndef _IXGB_EE_H_
@@ -33,9 +34,9 @@
 #define IXGB_ETH_LENGTH_OF_ADDRESS   6
 
 /* EEPROM Commands */
-#define EEPROM_READ_OPCODE  0x6		/* EERPOM read opcode */
-#define EEPROM_WRITE_OPCODE 0x5		/* EERPOM write opcode */
-#define EEPROM_ERASE_OPCODE 0x7		/* EERPOM erase opcode */
+#define EEPROM_READ_OPCODE  0x6	/* EERPOM read opcode */
+#define EEPROM_WRITE_OPCODE 0x5	/* EERPOM write opcode */
+#define EEPROM_ERASE_OPCODE 0x7	/* EERPOM erase opcode */
 #define EEPROM_EWEN_OPCODE  0x13	/* EERPOM erase/write enable */
 #define EEPROM_EWDS_OPCODE  0x10	/* EERPOM erast/write disable */
 
@@ -73,32 +74,32 @@
 
 /* EEPROM structure */
 struct ixgb_ee_map_type {
-	u8 mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS];
-	u16 compatibility;
-	u16 reserved1[4];
-	u32 pba_number;
-	u16 init_ctrl_reg_1;
-	u16 subsystem_id;
-	u16 subvendor_id;
-	u16 device_id;
-	u16 vendor_id;
-	u16 init_ctrl_reg_2;
-	u16 oem_reserved[16];
-	u16 swdpins_reg;
-	u16 circuit_ctrl_reg;
-	u8 d3_power;
-	u8 d0_power;
-	u16 reserved2[28];
-	u16 checksum;
+	uint8_t mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS];
+	uint16_t compatibility;
+	uint16_t reserved1[4];
+	uint32_t pba_number;
+	uint16_t init_ctrl_reg_1;
+	uint16_t subsystem_id;
+	uint16_t subvendor_id;
+	uint16_t device_id;
+	uint16_t vendor_id;
+	uint16_t init_ctrl_reg_2;
+	uint16_t oem_reserved[16];
+	uint16_t swdpins_reg;
+	uint16_t circuit_ctrl_reg;
+	uint8_t d3_power;
+	uint8_t d0_power;
+	uint16_t reserved2[28];
+	uint16_t checksum;
 };
 
 /* EEPROM Functions */
-u16 ixgb_read_eeprom(struct ixgb_hw *hw, u16 reg);
+uint16_t ixgb_read_eeprom(struct ixgb_hw *hw, uint16_t reg);
 
 boolean_t ixgb_validate_eeprom_checksum(struct ixgb_hw *hw);
 
 void ixgb_update_eeprom_checksum(struct ixgb_hw *hw);
 
-void ixgb_write_eeprom(struct ixgb_hw *hw, u16 reg, u16 data);
+void ixgb_write_eeprom(struct ixgb_hw *hw, uint16_t reg, uint16_t data);
 
 #endif				/* IXGB_EE_H */
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 78469e91e..605a6873e 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 /* ethtool support for ixgb */
@@ -35,22 +36,63 @@ extern char ixgb_driver_name[];
 extern char ixgb_driver_version[];
 
 extern int ixgb_up(struct ixgb_adapter *adapter);
-extern int ixgb_down(struct ixgb_adapter *adapter);
-
-/**
- * ixgb_ethtool_ioctl - Ethtool Ioctl Support
- * @netdev: net device structure
- * @ifr: interface request structure
- **/
+extern void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog);
 
-static inline int
-ixgb_eeprom_size(struct ixgb_hw *hw)
+static inline int ixgb_eeprom_size(struct ixgb_hw *hw)
 {
 	/* return size in bytes */
 	return (IXGB_EEPROM_SIZE << 1);
 }
 
-#define SPEED_10000 10000
+struct ixgb_stats {
+	char stat_string[ETH_GSTRING_LEN];
+	int sizeof_stat;
+	int stat_offset;
+};
+
+#define IXGB_STAT(m) sizeof(((struct ixgb_adapter *)0)->m), \
+		      offsetof(struct ixgb_adapter, m)
+static struct ixgb_stats ixgb_gstrings_stats[] = {
+	{"rx_packets", IXGB_STAT(net_stats.rx_packets)},
+	{"tx_packets", IXGB_STAT(net_stats.tx_packets)},
+	{"rx_bytes", IXGB_STAT(net_stats.rx_bytes)},
+	{"tx_bytes", IXGB_STAT(net_stats.tx_bytes)},
+	{"rx_errors", IXGB_STAT(net_stats.rx_errors)},
+	{"tx_errors", IXGB_STAT(net_stats.tx_errors)},
+	{"rx_dropped", IXGB_STAT(net_stats.rx_dropped)},
+	{"tx_dropped", IXGB_STAT(net_stats.tx_dropped)},
+	{"multicast", IXGB_STAT(net_stats.multicast)},
+	{"collisions", IXGB_STAT(net_stats.collisions)},
+/*	{ "rx_length_errors", IXGB_STAT(net_stats.rx_length_errors) },	*/
+	{"rx_over_errors", IXGB_STAT(net_stats.rx_over_errors)},
+	{"rx_crc_errors", IXGB_STAT(net_stats.rx_crc_errors)},
+	{"rx_frame_errors", IXGB_STAT(net_stats.rx_frame_errors)},
+	{"rx_fifo_errors", IXGB_STAT(net_stats.rx_fifo_errors)},
+	{"rx_missed_errors", IXGB_STAT(net_stats.rx_missed_errors)},
+	{"tx_aborted_errors", IXGB_STAT(net_stats.tx_aborted_errors)},
+	{"tx_carrier_errors", IXGB_STAT(net_stats.tx_carrier_errors)},
+	{"tx_fifo_errors", IXGB_STAT(net_stats.tx_fifo_errors)},
+	{"tx_heartbeat_errors", IXGB_STAT(net_stats.tx_heartbeat_errors)},
+	{"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)},
+	{"tx_deferred_ok", IXGB_STAT(stats.dc)},
+	{"rx_long_length_errors", IXGB_STAT(stats.roc)},
+	{"rx_short_length_errors", IXGB_STAT(stats.ruc)},
+#ifdef NETIF_F_TSO
+	{"tx_tcp_seg_good", IXGB_STAT(stats.tsctc)},
+	{"tx_tcp_seg_failed", IXGB_STAT(stats.tsctfc)},
+#endif
+	{"rx_flow_control_xon", IXGB_STAT(stats.xonrxc)},
+	{"rx_flow_control_xoff", IXGB_STAT(stats.xoffrxc)},
+	{"tx_flow_control_xon", IXGB_STAT(stats.xontxc)},
+	{"tx_flow_control_xoff", IXGB_STAT(stats.xofftxc)},
+	{"rx_csum_offload_good", IXGB_STAT(hw_csum_rx_good)},
+	{"rx_csum_offload_errors", IXGB_STAT(hw_csum_rx_error)},
+	{"tx_csum_offload_good", IXGB_STAT(hw_csum_tx_good)},
+	{"tx_csum_offload_errors", IXGB_STAT(hw_csum_tx_error)}
+};
+
+#define IXGB_STATS_LEN	\
+	sizeof(ixgb_gstrings_stats) / sizeof(struct ixgb_stats)
 
 static void
 ixgb_ethtool_gset(struct ixgb_adapter *adapter, struct ethtool_cmd *ecmd)
@@ -61,7 +103,7 @@ ixgb_ethtool_gset(struct ixgb_adapter *adapter, struct ethtool_cmd *ecmd)
 	ecmd->transceiver = XCVR_EXTERNAL;
 
 	if (netif_carrier_ok(adapter->netdev)) {
-		ecmd->speed = 10000;
+		ecmd->speed = SPEED_10000;
 		ecmd->duplex = DUPLEX_FULL;
 	} else {
 		ecmd->speed = -1;
@@ -78,64 +120,80 @@ ixgb_ethtool_sset(struct ixgb_adapter *adapter, struct ethtool_cmd *ecmd)
 	    ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)
 		return -EINVAL;
 	else {
-		ixgb_down(adapter);
+		ixgb_down(adapter, TRUE);
 		ixgb_up(adapter);
 	}
 
 	return 0;
 }
 
-#if 0
 static int
-ixgb_ethtool_promiscuous(struct ixgb_adapter *adapter,
-			 struct ethtool_pmode *pmode)
+ixgb_ethtool_gpause(struct ixgb_adapter *adapter,
+		    struct ethtool_pauseparam *epause)
 {
-	u32 rctl = IXGB_READ_REG(&adapter->hw, RCTL);
+	struct ixgb_hw *hw = &adapter->hw;
 
-	pmode->rctl_old = rctl;
-	if (pmode->upe)
-		rctl |= IXGB_RCTL_UPE;
-	else
-		rctl &= ~IXGB_RCTL_UPE;
+	epause->autoneg = AUTONEG_DISABLE;
 
-	if (pmode->mpe)
-		rctl |= IXGB_RCTL_MPE;
-	else
-		rctl &= ~IXGB_RCTL_MPE;
+	if (hw->fc.type == ixgb_fc_rx_pause)
+		epause->rx_pause = 1;
+	else if (hw->fc.type == ixgb_fc_tx_pause)
+		epause->tx_pause = 1;
+	else if (hw->fc.type == ixgb_fc_full) {
+		epause->rx_pause = 1;
+		epause->tx_pause = 1;
+	}
+
+	return 0;
+}
+
+static int
+ixgb_ethtool_spause(struct ixgb_adapter *adapter,
+		    struct ethtool_pauseparam *epause)
+{
+	struct ixgb_hw *hw = &adapter->hw;
+
+	if (epause->autoneg == AUTONEG_ENABLE)
+		return -EINVAL;
 
-	IXGB_WRITE_REG(&adapter->hw, RCTL, rctl);
+	if (epause->rx_pause && epause->tx_pause)
+		hw->fc.type = ixgb_fc_full;
+	else if (epause->rx_pause && !epause->tx_pause)
+		hw->fc.type = ixgb_fc_rx_pause;
+	else if (!epause->rx_pause && epause->tx_pause)
+		hw->fc.type = ixgb_fc_tx_pause;
+	else if (!epause->rx_pause && !epause->tx_pause)
+		hw->fc.type = ixgb_fc_none;
 
-	pmode->rctl_new = IXGB_READ_REG(&adapter->hw, RCTL);
+	ixgb_down(adapter, TRUE);
+	ixgb_up(adapter);
 
 	return 0;
 }
-#endif
 
-#define IXGB_REG_DUMP_LEN  136*sizeof(u32)
 static void
 ixgb_ethtool_gdrvinfo(struct ixgb_adapter *adapter,
 		      struct ethtool_drvinfo *drvinfo)
 {
 	strncpy(drvinfo->driver, ixgb_driver_name, 32);
 	strncpy(drvinfo->version, ixgb_driver_version, 32);
-	strncpy(drvinfo->fw_version, "", 32);
+	strncpy(drvinfo->fw_version, "N/A", 32);
 	strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
-#ifdef ETHTOOL_GREGS
+	drvinfo->n_stats = IXGB_STATS_LEN;
+#define IXGB_REG_DUMP_LEN  136*sizeof(uint32_t)
 	drvinfo->regdump_len = IXGB_REG_DUMP_LEN;
-#endif				/* ETHTOOL_GREGS */
 	drvinfo->eedump_len = ixgb_eeprom_size(&adapter->hw);
 }
 
-#ifdef  ETHTOOL_GREGS
 #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_
 static void
 ixgb_ethtool_gregs(struct ixgb_adapter *adapter,
-		   struct ethtool_regs *regs, u8 * regs_buff)
+		   struct ethtool_regs *regs, uint32_t * regs_buff)
 {
 	struct ixgb_hw *hw = &adapter->hw;
-	u32 *reg = (u32 *) regs_buff;
-	u32 *reg_start = reg;
-	u8 i;
+	uint32_t *reg = regs_buff;
+	uint32_t *reg_start = reg;
+	uint8_t i;
 
 	regs->version =
 	    (adapter->hw.device_id << 16) | adapter->hw.subsystem_id;
@@ -199,15 +257,6 @@ ixgb_ethtool_gregs(struct ixgb_adapter *adapter,
 	*reg++ = IXGB_READ_REG(hw, MSCA);	/*  74 */
 	*reg++ = IXGB_READ_REG(hw, MSRWD);	/*  75 */
 
-#if 0
-	/* Wake-up */
-	reg[IXGB_WUFC] = IXGB_READ_REG(hw, WUFC);
-	reg[IXGB_WUS] = IXGB_READ_REG(hw, WUS);
-	reg[IXGB_FFLT] = IXGB_READ_REG(hw, FFLT);
-	reg[IXGB_FFMT] = IXGB_READ_REG(hw, FFMT);
-	reg[IXGB_FTVT] = IXGB_READ_REG(hw, FTVT);
-#endif
-
 	/* Statistics */
 	*reg++ = IXGB_GET_STAT(adapter, tprl);	/*  76 */
 	*reg++ = IXGB_GET_STAT(adapter, tprh);	/*  77 */
@@ -270,22 +319,21 @@ ixgb_ethtool_gregs(struct ixgb_adapter *adapter,
 	*reg++ = IXGB_GET_STAT(adapter, xofftxc);	/* 134 */
 	*reg++ = IXGB_GET_STAT(adapter, rjc);	/* 135 */
 
-#if 0
-#endif
-	regs->len = (reg - reg_start) * sizeof (u32);
+	regs->len = (reg - reg_start) * sizeof(uint32_t);
 }
-#endif				/* ETHTOOL_GREGS */
 
 static int
 ixgb_ethtool_geeprom(struct ixgb_adapter *adapter,
-		     struct ethtool_eeprom *eeprom, u16 * eeprom_buff)
+		     struct ethtool_eeprom *eeprom, uint16_t * eeprom_buff)
 {
 	struct ixgb_hw *hw = &adapter->hw;
 	int i, max_len, first_word, last_word;
-	IXGB_DBG("ixgb_ethtool_geeprom\n");
+	int ret_val = 0;
 
-	if (eeprom->len == 0)
-		return -EINVAL;
+	if (eeprom->len == 0) {
+		ret_val = -EINVAL;
+		goto geeprom_error;
+	}
 
 	eeprom->magic = hw->vendor_id | (hw->device_id << 16);
 
@@ -294,8 +342,10 @@ ixgb_ethtool_geeprom(struct ixgb_adapter *adapter,
 	/* use our function to read the eeprom and update our cache */
 	ixgb_get_eeprom_data(hw);
 
-	if (eeprom->offset > eeprom->offset + eeprom->len)
-		return -EINVAL;
+	if (eeprom->offset > eeprom->offset + eeprom->len) {
+		ret_val = -EINVAL;
+		goto geeprom_error;
+	}
 
 	if ((eeprom->offset + eeprom->len) > max_len)
 		eeprom->len = (max_len - eeprom->offset);
@@ -306,15 +356,16 @@ ixgb_ethtool_geeprom(struct ixgb_adapter *adapter,
 	for (i = 0; i <= (last_word - first_word); i++) {
 		eeprom_buff[i] = hw->eeprom[first_word + i];
 	}
-
-	return 0;
+      geeprom_error:
+	return ret_val;
 }
+
 static int
 ixgb_ethtool_seeprom(struct ixgb_adapter *adapter,
-		     struct ethtool_eeprom *eeprom, void *user_data)
+		     struct ethtool_eeprom *eeprom, void __user *user_data)
 {
 	struct ixgb_hw *hw = &adapter->hw;
-	u16 eeprom_buff[256];
+	uint16_t eeprom_buff[256];
 	int i, max_len, first_word, last_word;
 	void *ptr;
 
@@ -334,7 +385,7 @@ ixgb_ethtool_seeprom(struct ixgb_adapter *adapter,
 
 	first_word = eeprom->offset >> 1;
 	last_word = (eeprom->offset + eeprom->len - 1) >> 1;
-	ptr = (void *) eeprom_buff;
+	ptr = (void *)eeprom_buff;
 
 	if (eeprom->offset & 1) {
 		/* need read/modify/write of first changed EEPROM word */
@@ -361,18 +412,15 @@ ixgb_ethtool_seeprom(struct ixgb_adapter *adapter,
 	return 0;
 }
 
-#ifdef  ETHTOOL_PHYS_ID
-
 /* toggle LED 4 times per second = 2 "blinks" per second */
-#define IXGB_ID_INTERVAL    (HZ/4)
+#define IXGB_ID_INTERVAL	(HZ/4)
 
 /* bit defines for adapter->led_status */
-#define IXGB_LED_ON     0
+#define IXGB_LED_ON		0
 
-static void
-ixgb_led_blink_callback(unsigned long data)
+static void ixgb_led_blink_callback(unsigned long data)
 {
-	struct ixgb_adapter *adapter = (struct ixgb_adapter *) data;
+	struct ixgb_adapter *adapter = (struct ixgb_adapter *)data;
 
 	if (test_and_change_bit(IXGB_LED_ON, &adapter->led_status))
 		ixgb_led_off(&adapter->hw);
@@ -388,7 +436,7 @@ ixgb_ethtool_led_blink(struct ixgb_adapter *adapter, struct ethtool_value *id)
 	if (!adapter->blink_timer.function) {
 		init_timer(&adapter->blink_timer);
 		adapter->blink_timer.function = ixgb_led_blink_callback;
-		adapter->blink_timer.data = (unsigned long) adapter;
+		adapter->blink_timer.data = (unsigned long)adapter;
 	}
 
 	mod_timer(&adapter->blink_timer, jiffies);
@@ -405,114 +453,121 @@ ixgb_ethtool_led_blink(struct ixgb_adapter *adapter, struct ethtool_value *id)
 
 	return 0;
 }
-#endif				/* ETHTOOL_PHYS_ID */
 
-int
-ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
+int ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-	void *addr = ifr->ifr_data;
-	u32 cmd;
+	void __user *addr = ifr->ifr_data;
+	uint32_t cmd;
 
-	if (get_user(cmd, (u32 *) addr))
+	if (get_user(cmd, (uint32_t __user *) addr))
 		return -EFAULT;
 
 	switch (cmd) {
-#if 0
-	case ETHTOOL_PROMISCUOUS:{
-			struct ethtool_pmode pmode;
-
-			if (copy_from_user(&pmode, addr, sizeof (pmode)))
-				return -EFAULT;
-
-			ixgb_ethtool_promiscuous(adapter, &pmode);
-
-			if (copy_to_user(addr, &pmode, sizeof (pmode)))
-				return -EFAULT;
-
-			return 0;
-		}
-	case ETHTOOL_DOWN_UP:
-		ixgb_down(netdev->priv);
-		ixgb_up(netdev->priv);
-		return 0;
-#endif
 	case ETHTOOL_GSET:{
 			struct ethtool_cmd ecmd = { ETHTOOL_GSET };
-
 			ixgb_ethtool_gset(adapter, &ecmd);
-			if (copy_to_user(addr, &ecmd, sizeof (ecmd)))
+			if (copy_to_user(addr, &ecmd, sizeof(ecmd)))
 				return -EFAULT;
 			return 0;
 		}
 	case ETHTOOL_SSET:{
 			struct ethtool_cmd ecmd;
-
-			if (copy_from_user(&ecmd, addr, sizeof (ecmd)))
+			if (copy_from_user(&ecmd, addr, sizeof(ecmd)))
 				return -EFAULT;
 			return ixgb_ethtool_sset(adapter, &ecmd);
 		}
-	case ETHTOOL_GDRVINFO:
-		{
+	case ETHTOOL_GDRVINFO:{
 			struct ethtool_drvinfo drvinfo = { ETHTOOL_GDRVINFO };
-
 			ixgb_ethtool_gdrvinfo(adapter, &drvinfo);
-			if (copy_to_user(addr, &drvinfo, sizeof (drvinfo)))
+			if (copy_to_user(addr, &drvinfo, sizeof(drvinfo)))
 				return -EFAULT;
 			return 0;
 		}
-#if defined(ETHTOOL_GREGS) && defined(ETHTOOL_GEEPROM)
+	case ETHTOOL_GSTRINGS:{
+			struct ethtool_gstrings gstrings = { ETHTOOL_GSTRINGS };
+			char *strings = NULL;
+			int err = 0;
+
+			if (copy_from_user(&gstrings, addr, sizeof(gstrings)))
+				return -EFAULT;
+			switch (gstrings.string_set) {
+			case ETH_SS_STATS:{
+					int i;
+					gstrings.len = IXGB_STATS_LEN;
+					strings =
+					    kmalloc(IXGB_STATS_LEN *
+						    ETH_GSTRING_LEN,
+						    GFP_KERNEL);
+					if (!strings)
+						return -ENOMEM;
+					for (i = 0; i < IXGB_STATS_LEN; i++) {
+						memcpy(&strings
+						       [i * ETH_GSTRING_LEN],
+						       ixgb_gstrings_stats[i].
+						       stat_string,
+						       ETH_GSTRING_LEN);
+					}
+					break;
+				}
+			default:
+				return -EOPNOTSUPP;
+			}
+			if (copy_to_user(addr, &gstrings, sizeof(gstrings)))
+				err = -EFAULT;
+			addr += offsetof(struct ethtool_gstrings, data);
+			if (!err && copy_to_user(addr, strings,
+						 gstrings.len *
+						 ETH_GSTRING_LEN))
+				err = -EFAULT;
+
+			kfree(strings);
+			return err;
+		}
 	case ETHTOOL_GREGS:{
 			struct ethtool_regs regs = { ETHTOOL_GREGS };
-			u8 regs_buff[IXGB_REG_DUMP_LEN];
+			uint32_t regs_buff[IXGB_REG_DUMP_LEN];
 
+			if (copy_from_user(&regs, addr, sizeof(regs)))
+				return -EFAULT;
 			ixgb_ethtool_gregs(adapter, &regs, regs_buff);
-
-			if (copy_to_user(addr, &regs, sizeof (regs)))
+			if (copy_to_user(addr, &regs, sizeof(regs)))
 				return -EFAULT;
 
 			addr += offsetof(struct ethtool_regs, data);
-
 			if (copy_to_user(addr, regs_buff, regs.len))
 				return -EFAULT;
+
 			return 0;
 		}
-#endif				/* ETHTOOL_GREGS */
 	case ETHTOOL_NWAY_RST:{
-			IXGB_DBG("ETHTOOL_NWAY_RST\n");
-			ixgb_down(adapter);
-			ixgb_up(adapter);
-
+			if (netif_running(netdev)) {
+				ixgb_down(adapter, TRUE);
+				ixgb_up(adapter);
+			}
 			return 0;
 		}
-#ifdef  ETHTOOL_PHYS_ID
 	case ETHTOOL_PHYS_ID:{
 			struct ethtool_value id;
-
-			IXGB_DBG("ETHTOOL_PHYS_ID\n");
-			if (copy_from_user(&id, addr, sizeof (id)))
+			if (copy_from_user(&id, addr, sizeof(id)))
 				return -EFAULT;
 			return ixgb_ethtool_led_blink(adapter, &id);
 		}
-#endif				/* ETHTOOL_PHYS_ID */
 	case ETHTOOL_GLINK:{
 			struct ethtool_value link = { ETHTOOL_GLINK };
-
-			IXGB_DBG("ETHTOOL_GLINK\n");
 			link.data = netif_carrier_ok(netdev);
-			if (copy_to_user(addr, &link, sizeof (link)))
+			if (copy_to_user(addr, &link, sizeof(link)))
 				return -EFAULT;
 			return 0;
 		}
 
 	case ETHTOOL_GEEPROM:{
 			struct ethtool_eeprom eeprom = { ETHTOOL_GEEPROM };
-			u16 eeprom_buff[IXGB_EEPROM_SIZE];
+			uint16_t eeprom_buff[IXGB_EEPROM_SIZE];
 			void *ptr;
-			int err;
+			int err = 0;
 
-			IXGB_DBG("ETHTOOL_GEEPROM\n");
-			if (copy_from_user(&eeprom, addr, sizeof (eeprom)))
+			if (copy_from_user(&eeprom, addr, sizeof(eeprom)))
 				return -EFAULT;
 
 			if ((err =
@@ -520,12 +575,12 @@ ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
 						  eeprom_buff)) < 0)
 				return err;
 
-			if (copy_to_user(addr, &eeprom, sizeof (eeprom)))
+			if (copy_to_user(addr, &eeprom, sizeof(eeprom)))
 				return -EFAULT;
 
 			addr += offsetof(struct ethtool_eeprom, data);
+			ptr = ((void *)eeprom_buff) + (eeprom.offset & 1);
 
-			ptr = ((void *) eeprom_buff) + (eeprom.offset & 1);
 			if (copy_to_user(addr, ptr, eeprom.len))
 				return -EFAULT;
 			return 0;
@@ -533,13 +588,133 @@ ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
 	case ETHTOOL_SEEPROM:{
 			struct ethtool_eeprom eeprom;
 
-			IXGB_DBG("ETHTOOL_SEEPROM\n");
-			if (copy_from_user(&eeprom, addr, sizeof (eeprom)))
+			if (copy_from_user(&eeprom, addr, sizeof(eeprom)))
 				return -EFAULT;
 
 			addr += offsetof(struct ethtool_eeprom, data);
 			return ixgb_ethtool_seeprom(adapter, &eeprom, addr);
 		}
+	case ETHTOOL_GPAUSEPARAM:{
+			struct ethtool_pauseparam epause =
+			    { ETHTOOL_GPAUSEPARAM };
+			ixgb_ethtool_gpause(adapter, &epause);
+			if (copy_to_user(addr, &epause, sizeof(epause)))
+				return -EFAULT;
+			return 0;
+		}
+	case ETHTOOL_SPAUSEPARAM:{
+			struct ethtool_pauseparam epause;
+			if (copy_from_user(&epause, addr, sizeof(epause)))
+				return -EFAULT;
+			return ixgb_ethtool_spause(adapter, &epause);
+		}
+	case ETHTOOL_GSTATS:{
+			struct {
+				struct ethtool_stats eth_stats;
+				uint64_t data[IXGB_STATS_LEN];
+			} stats = { {
+			ETHTOOL_GSTATS, IXGB_STATS_LEN}};
+			int i;
+
+			for (i = 0; i < IXGB_STATS_LEN; i++)
+				stats.data[i] =
+				    (ixgb_gstrings_stats[i].sizeof_stat ==
+				     sizeof(uint64_t)) ? *(uint64_t *) ((char *)
+									adapter
+									+
+									ixgb_gstrings_stats
+									[i].
+									stat_offset)
+				    : *(uint32_t *) ((char *)adapter +
+						     ixgb_gstrings_stats[i].
+						     stat_offset);
+			if (copy_to_user(addr, &stats, sizeof(stats)))
+				return -EFAULT;
+			return 0;
+		}
+	case ETHTOOL_GRXCSUM:{
+			struct ethtool_value edata = { ETHTOOL_GRXCSUM };
+
+			edata.data = adapter->rx_csum;
+			if (copy_to_user(addr, &edata, sizeof(edata)))
+				return -EFAULT;
+			return 0;
+		}
+	case ETHTOOL_SRXCSUM:{
+			struct ethtool_value edata;
+
+			if (copy_from_user(&edata, addr, sizeof(edata)))
+				return -EFAULT;
+			adapter->rx_csum = edata.data;
+			ixgb_down(adapter, TRUE);
+			ixgb_up(adapter);
+			return 0;
+		}
+	case ETHTOOL_GTXCSUM:{
+			struct ethtool_value edata = { ETHTOOL_GTXCSUM };
+
+			edata.data = (netdev->features & NETIF_F_HW_CSUM) != 0;
+			if (copy_to_user(addr, &edata, sizeof(edata)))
+				return -EFAULT;
+			return 0;
+		}
+	case ETHTOOL_STXCSUM:{
+			struct ethtool_value edata;
+
+			if (copy_from_user(&edata, addr, sizeof(edata)))
+				return -EFAULT;
+
+			if (edata.data)
+				netdev->features |= NETIF_F_HW_CSUM;
+			else
+				netdev->features &= ~NETIF_F_HW_CSUM;
+
+			return 0;
+		}
+	case ETHTOOL_GSG:{
+			struct ethtool_value edata = { ETHTOOL_GSG };
+
+			edata.data = (netdev->features & NETIF_F_SG) != 0;
+			if (copy_to_user(addr, &edata, sizeof(edata)))
+				return -EFAULT;
+			return 0;
+		}
+	case ETHTOOL_SSG:{
+			struct ethtool_value edata;
+
+			if (copy_from_user(&edata, addr, sizeof(edata)))
+				return -EFAULT;
+
+			if (edata.data)
+				netdev->features |= NETIF_F_SG;
+			else
+				netdev->features &= ~NETIF_F_SG;
+
+			return 0;
+		}
+#ifdef NETIF_F_TSO
+	case ETHTOOL_GTSO:{
+			struct ethtool_value edata = { ETHTOOL_GTSO };
+
+			edata.data = (netdev->features & NETIF_F_TSO) != 0;
+			if (copy_to_user(addr, &edata, sizeof(edata)))
+				return -EFAULT;
+			return 0;
+		}
+	case ETHTOOL_STSO:{
+			struct ethtool_value edata;
+
+			if (copy_from_user(&edata, addr, sizeof(edata)))
+				return -EFAULT;
+
+			if (edata.data)
+				netdev->features |= NETIF_F_TSO;
+			else
+				netdev->features &= ~NETIF_F_TSO;
+
+			return 0;
+		}
+#endif
 	default:
 		return -EOPNOTSUPP;
 	}
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index 54490f738..590873328 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 /* ixgb_hw.c
@@ -34,32 +35,31 @@
 
 /*  Local function prototypes */
 
-static u32 ixgb_hash_mc_addr(struct ixgb_hw *hw, u8 * mc_addr);
+static uint32_t ixgb_hash_mc_addr(struct ixgb_hw *hw, uint8_t * mc_addr);
 
-static void ixgb_mta_set(struct ixgb_hw *hw, u32 hash_value);
+static void ixgb_mta_set(struct ixgb_hw *hw, uint32_t hash_value);
 
 static void ixgb_get_bus_info(struct ixgb_hw *hw);
 
-boolean_t mac_addr_valid(u8 * mac_addr);
-
 static boolean_t ixgb_link_reset(struct ixgb_hw *hw);
 
 static void ixgb_optics_reset(struct ixgb_hw *hw);
 
-u32 ixgb_mac_reset(struct ixgb_hw *hw);
+static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw);
+
+uint32_t ixgb_mac_reset(struct ixgb_hw *hw);
 
-u32
-ixgb_mac_reset(struct ixgb_hw *hw)
+uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 {
-	u32 ctrl_reg;
+	uint32_t ctrl_reg;
 
-	/* Setup up hardware to known state with RESET.  */
 	ctrl_reg = IXGB_CTRL0_RST | IXGB_CTRL0_SDP3_DIR |	/* All pins are Output=1 */
 	    IXGB_CTRL0_SDP2_DIR | IXGB_CTRL0_SDP1_DIR | IXGB_CTRL0_SDP0_DIR | IXGB_CTRL0_SDP3 |	/* Initial value 1101   */
 	    IXGB_CTRL0_SDP2 | IXGB_CTRL0_SDP0;
+
 #ifdef HP_ZX1
-	outl(IXGB_CTRL0, hw->io_base);
-	outl(ctrl_reg, hw->io_base + 4);
+	/* Workaround for 82597EX reset errata */
+	IXGB_WRITE_REG_IO(hw, CTRL0, ctrl_reg);
 #else
 	IXGB_WRITE_REG(hw, CTRL0, ctrl_reg);
 #endif
@@ -72,7 +72,10 @@ ixgb_mac_reset(struct ixgb_hw *hw)
 	ASSERT(!(ctrl_reg & IXGB_CTRL0_RST));
 #endif
 
-	ixgb_optics_reset(hw);
+	if (hw->phy_type == ixgb_phy_type_txn17401) {
+		ixgb_optics_reset(hw);
+	}
+
 	return ctrl_reg;
 }
 
@@ -81,11 +84,10 @@ ixgb_mac_reset(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-boolean_t
-ixgb_adapter_stop(struct ixgb_hw * hw)
+boolean_t ixgb_adapter_stop(struct ixgb_hw * hw)
 {
-	u32 ctrl_reg;
-	u32 icr_reg;
+	uint32_t ctrl_reg;
+	uint32_t icr_reg;
 
 	DEBUGFUNC("ixgb_adapter_stop");
 
@@ -133,28 +135,112 @@ ixgb_adapter_stop(struct ixgb_hw * hw)
 	return (ctrl_reg & IXGB_CTRL0_RST);
 }
 
+/******************************************************************************
+ * Identifies the vendor of the optics module on the adapter.  The SR adapters
+ * support two different types of XPAK optics, so it is necessary to determine
+ * which optics are present before applying any optics-specific workarounds.
+ *
+ * hw - Struct containing variables accessed by shared code.
+ *
+ * Returns: the vendor of the XPAK optics module.
+ *****************************************************************************/
+static ixgb_xpak_vendor ixgb_identify_xpak_vendor(struct ixgb_hw *hw)
+{
+	uint32_t i;
+	uint16_t vendor_name[5];
+	ixgb_xpak_vendor xpak_vendor;
+
+	DEBUGFUNC("ixgb_identify_xpak_vendor");
+
+	/* Read the first few bytes of the vendor string from the XPAK NVR
+	 * registers.  These are standard XENPAK/XPAK registers, so all XPAK
+	 * devices should implement them. */
+	for (i = 0; i < 5; i++) {
+		vendor_name[i] = ixgb_read_phy_reg(hw,
+						   MDIO_PMA_PMD_XPAK_VENDOR_NAME
+						   + i, IXGB_PHY_ADDRESS,
+						   MDIO_PMA_PMD_DID);
+	}
+
+	/* Determine the actual vendor */
+	if (vendor_name[0] == 'I' &&
+	    vendor_name[1] == 'N' &&
+	    vendor_name[2] == 'T' &&
+	    vendor_name[3] == 'E' && vendor_name[4] == 'L') {
+		xpak_vendor = ixgb_xpak_vendor_intel;
+	} else {
+		xpak_vendor = ixgb_xpak_vendor_infineon;
+	}
+
+	return (xpak_vendor);
+}
+
+/******************************************************************************
+ * Determine the physical layer module on the adapter.
+ *
+ * hw - Struct containing variables accessed by shared code.  The device_id
+ *      field must be (correctly) populated before calling this routine.
+ *
+ * Returns: the phy type of the adapter.
+ *****************************************************************************/
+static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw)
+{
+	ixgb_phy_type phy_type;
+	ixgb_xpak_vendor xpak_vendor;
+
+	DEBUGFUNC("ixgb_identify_phy");
+
+	/* Infer the transceiver/phy type from the device id */
+	switch (hw->device_id) {
+	case IXGB_DEVICE_ID_82597EX:
+		DEBUGOUT("Identified TXN17401 optics\n");
+		phy_type = ixgb_phy_type_txn17401;
+		break;
+
+	case IXGB_DEVICE_ID_82597EX_SR:
+		/* The SR adapters carry two different types of XPAK optics
+		 * modules; read the vendor identifier to determine the exact
+		 * type of optics. */
+		xpak_vendor = ixgb_identify_xpak_vendor(hw);
+		if (xpak_vendor == ixgb_xpak_vendor_intel) {
+			DEBUGOUT("Identified TXN17201 optics\n");
+			phy_type = ixgb_phy_type_txn17201;
+		} else {
+			DEBUGOUT("Identified G6005 optics\n");
+			phy_type = ixgb_phy_type_g6005;
+		}
+		break;
+
+	default:
+		DEBUGOUT("Unknown physical layer module\n");
+		phy_type = ixgb_phy_type_unknown;
+		break;
+	}
+
+	return (phy_type);
+}
+
 /******************************************************************************
  * Performs basic configuration of the adapter.
  *
  * hw - Struct containing variables accessed by shared code
- * 
- * Resets the controller.  
+ *
+ * Resets the controller.
  * Reads and validates the EEPROM.
  * Initializes the receive address registers.
  * Initializes the multicast table.
- * Clears all on-chip counters. 
- * Calls routine to setup flow control settings. 
+ * Clears all on-chip counters.
+ * Calls routine to setup flow control settings.
  * Leaves the transmit and receive units disabled and uninitialized.
- * 
+ *
  * Returns:
- *      TRUE if successful, 
+ *      TRUE if successful,
  *      FALSE if unrecoverable problems were encountered.
  *****************************************************************************/
-boolean_t
-ixgb_init_hw(struct ixgb_hw * hw)
+boolean_t ixgb_init_hw(struct ixgb_hw * hw)
 {
-	u32 i;
-	u32 ctrl_reg;
+	uint32_t i;
+	uint32_t ctrl_reg;
 	boolean_t status;
 
 	DEBUGFUNC("ixgb_init_hw");
@@ -170,8 +256,8 @@ ixgb_init_hw(struct ixgb_hw * hw)
 
 	DEBUGOUT("Issuing an EE reset to MAC\n");
 #ifdef HP_ZX1
-	outl(IXGB_CTRL1, hw->io_base);
-	outl(IXGB_CTRL1_EE_RST, hw->io_base + 4);
+	/* Workaround for 82597EX reset errata */
+	IXGB_WRITE_REG_IO(hw, CTRL1, IXGB_CTRL1_EE_RST);
 #else
 	IXGB_WRITE_REG(hw, CTRL1, IXGB_CTRL1_EE_RST);
 #endif
@@ -183,12 +269,16 @@ ixgb_init_hw(struct ixgb_hw * hw)
 		return (FALSE);
 	}
 
-	/* Setup the receive addresses. 
+	/* Use the device id to determine the type of phy/transceiver. */
+	hw->device_id = ixgb_get_ee_device_id(hw);
+	hw->phy_type = ixgb_identify_phy(hw);
+
+	/* Setup the receive addresses.
 	 * Receive Address Registers (RARs 0 - 15).
 	 */
 	ixgb_init_rx_addrs(hw);
 
-	/* 
+	/*
 	 * Check that a valid MAC address has been set.
 	 * If it is not valid, we fail hardware init.
 	 */
@@ -217,7 +307,7 @@ ixgb_init_hw(struct ixgb_hw * hw)
 	/* Call a subroutine to setup flow control. */
 	status = ixgb_setup_fc(hw);
 
-	/* check-for-link in case lane deskew is locked */
+	/* 82597EX errata: Call check-for-link in case lane deskew is locked */
 	ixgb_check_for_link(hw);
 
 	return (status);
@@ -226,20 +316,19 @@ ixgb_init_hw(struct ixgb_hw * hw)
 /******************************************************************************
  * Initializes receive address filters.
  *
- * hw - Struct containing variables accessed by shared code 
+ * hw - Struct containing variables accessed by shared code
  *
  * Places the MAC address in receive address register 0 and clears the rest
  * of the receive addresss registers. Clears the multicast table. Assumes
  * the receiver is in reset when the routine is called.
  *****************************************************************************/
-void
-ixgb_init_rx_addrs(struct ixgb_hw *hw)
+void ixgb_init_rx_addrs(struct ixgb_hw *hw)
 {
-	u32 i;
+	uint32_t i;
 
 	DEBUGFUNC("ixgb_init_rx_addrs");
 
-	/* 
+	/*
 	 * If the current mac address is valid, assume it is a software override
 	 * to the permanent address.
 	 * Otherwise, use the permanent address from the eeprom.
@@ -289,17 +378,17 @@ ixgb_init_rx_addrs(struct ixgb_hw *hw)
  *
  * The given list replaces any existing list. Clears the last 15 receive
  * address registers and the multicast table. Uses receive address registers
- * for the first 15 multicast addresses, and hashes the rest into the 
+ * for the first 15 multicast addresses, and hashes the rest into the
  * multicast table.
  *****************************************************************************/
 void
 ixgb_mc_addr_list_update(struct ixgb_hw *hw,
-			 u8 * mc_addr_list,
-			 u32 mc_addr_count, u32 pad)
+			 uint8_t * mc_addr_list,
+			 uint32_t mc_addr_count, uint32_t pad)
 {
-	u32 hash_value;
-	u32 i;
-	u32 rar_used_count = 1;	/* RAR[0] is used for our MAC address */
+	uint32_t hash_value;
+	uint32_t i;
+	uint32_t rar_used_count = 1;	/* RAR[0] is used for our MAC address */
 
 	DEBUGFUNC("ixgb_mc_addr_list_update");
 
@@ -336,7 +425,7 @@ ixgb_mc_addr_list_update(struct ixgb_hw *hw,
 				       5]);
 
 		/* Place this multicast address in the RAR if there is room, *
-		 * else put it in the MTA            
+		 * else put it in the MTA
 		 */
 		if (rar_used_count < IXGB_RAR_ENTRIES) {
 			ixgb_rar_set(hw,
@@ -366,20 +455,19 @@ ixgb_mc_addr_list_update(struct ixgb_hw *hw,
  * Hashes an address to determine its location in the multicast table
  *
  * hw - Struct containing variables accessed by shared code
- * mc_addr - the multicast address to hash 
+ * mc_addr - the multicast address to hash
  *
  * Returns:
  *      The hash value
  *****************************************************************************/
-static u32
-ixgb_hash_mc_addr(struct ixgb_hw *hw, u8 * mc_addr)
+static uint32_t ixgb_hash_mc_addr(struct ixgb_hw *hw, uint8_t * mc_addr)
 {
-	u32 hash_value = 0;
+	uint32_t hash_value = 0;
 
 	DEBUGFUNC("ixgb_hash_mc_addr");
 
 	/* The portion of the address that is used for the hash table is
-	 * determined by the mc_filter_type setting.  
+	 * determined by the mc_filter_type setting.
 	 */
 	switch (hw->mc_filter_type) {
 		/* [0] [1] [2] [3] [4] [5]
@@ -388,18 +476,18 @@ ixgb_hash_mc_addr(struct ixgb_hw *hw, u8 * mc_addr)
 	case 0:
 		/* [47:36] i.e. 0x563 for above example address */
 		hash_value =
-		    ((mc_addr[4] >> 4) | (((u16) mc_addr[5]) << 4));
+		    ((mc_addr[4] >> 4) | (((uint16_t) mc_addr[5]) << 4));
 		break;
 	case 1:		/* [46:35] i.e. 0xAC6 for above example address */
 		hash_value =
-		    ((mc_addr[4] >> 3) | (((u16) mc_addr[5]) << 5));
+		    ((mc_addr[4] >> 3) | (((uint16_t) mc_addr[5]) << 5));
 		break;
 	case 2:		/* [45:34] i.e. 0x5D8 for above example address */
 		hash_value =
-		    ((mc_addr[4] >> 2) | (((u16) mc_addr[5]) << 6));
+		    ((mc_addr[4] >> 2) | (((uint16_t) mc_addr[5]) << 6));
 		break;
 	case 3:		/* [43:32] i.e. 0x634 for above example address */
-		hash_value = ((mc_addr[4]) | (((u16) mc_addr[5]) << 8));
+		hash_value = ((mc_addr[4]) | (((uint16_t) mc_addr[5]) << 8));
 		break;
 	default:
 		/* Invalid mc_filter_type, what should we do? */
@@ -418,18 +506,17 @@ ixgb_hash_mc_addr(struct ixgb_hw *hw, u8 * mc_addr)
  * hw - Struct containing variables accessed by shared code
  * hash_value - Multicast address hash value
  *****************************************************************************/
-static void
-ixgb_mta_set(struct ixgb_hw *hw, u32 hash_value)
+static void ixgb_mta_set(struct ixgb_hw *hw, uint32_t hash_value)
 {
-	u32 hash_bit, hash_reg;
-	u32 mta_reg;
+	uint32_t hash_bit, hash_reg;
+	uint32_t mta_reg;
 
-	/* The MTA is a register array of 128 32-bit registers.  
-	 * It is treated like an array of 4096 bits.  We want to set 
+	/* The MTA is a register array of 128 32-bit registers.
+	 * It is treated like an array of 4096 bits.  We want to set
 	 * bit BitArray[hash_value]. So we figure out what register
 	 * the bit is in, read it, OR in the new bit, then write
-	 * back the new value.  The register is determined by the 
-	 * upper 7 bits of the hash value and the bit within that 
+	 * back the new value.  The register is determined by the
+	 * upper 7 bits of the hash value and the bit within that
 	 * register are determined by the lower 5 bits of the value.
 	 */
 	hash_reg = (hash_value >> 5) & 0x7F;
@@ -451,22 +538,21 @@ ixgb_mta_set(struct ixgb_hw *hw, u32 hash_value)
  * addr - Address to put into receive address register
  * index - Receive address register to write
  *****************************************************************************/
-void
-ixgb_rar_set(struct ixgb_hw *hw, u8 * addr, u32 index)
+void ixgb_rar_set(struct ixgb_hw *hw, uint8_t * addr, uint32_t index)
 {
-	u32 rar_low, rar_high;
+	uint32_t rar_low, rar_high;
 
 	DEBUGFUNC("ixgb_rar_set");
 
 	/* HW expects these in little endian so we reverse the byte order
-	 * from network order (big endian) to little endian              
+	 * from network order (big endian) to little endian
 	 */
-	rar_low = ((u32) addr[0] |
-		   ((u32) addr[1] << 8) |
-		   ((u32) addr[2] << 16) | ((u32) addr[3] << 24));
+	rar_low = ((uint32_t) addr[0] |
+		   ((uint32_t) addr[1] << 8) |
+		   ((uint32_t) addr[2] << 16) | ((uint32_t) addr[3] << 24));
 
-	rar_high = ((u32) addr[4] |
-		    ((u32) addr[5] << 8) | IXGB_RAH_AV);
+	rar_high = ((uint32_t) addr[4] |
+		    ((uint32_t) addr[5] << 8) | IXGB_RAH_AV);
 
 	IXGB_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low);
 	IXGB_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high);
@@ -480,8 +566,7 @@ ixgb_rar_set(struct ixgb_hw *hw, u8 * addr, u32 index)
  * offset - Offset in VLAN filer table to write
  * value - Value to write into VLAN filter table
  *****************************************************************************/
-void
-ixgb_write_vfta(struct ixgb_hw *hw, u32 offset, u32 value)
+void ixgb_write_vfta(struct ixgb_hw *hw, uint32_t offset, uint32_t value)
 {
 	IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, value);
 	return;
@@ -492,10 +577,9 @@ ixgb_write_vfta(struct ixgb_hw *hw, u32 offset, u32 value)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
-ixgb_clear_vfta(struct ixgb_hw *hw)
+void ixgb_clear_vfta(struct ixgb_hw *hw)
 {
-	u32 offset;
+	uint32_t offset;
 
 	for (offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++)
 		IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, 0);
@@ -508,11 +592,10 @@ ixgb_clear_vfta(struct ixgb_hw *hw)
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
 
-boolean_t
-ixgb_setup_fc(struct ixgb_hw * hw)
+boolean_t ixgb_setup_fc(struct ixgb_hw * hw)
 {
-	u32 ctrl_reg;
-	u32 pap_reg = 0;	/* by default, assume no pause time */
+	uint32_t ctrl_reg;
+	uint32_t pap_reg = 0;	/* by default, assume no pause time */
 	boolean_t status = TRUE;
 
 	DEBUGFUNC("ixgb_setup_fc");
@@ -534,6 +617,8 @@ ixgb_setup_fc(struct ixgb_hw * hw)
 	 */
 	switch (hw->fc.type) {
 	case ixgb_fc_none:	/* 0 */
+		/* Set CMDC bit to disable Rx Flow control */
+		ctrl_reg |= (IXGB_CTRL0_CMDC);
 		break;
 	case ixgb_fc_rx_pause:	/* 1 */
 		/* RX Flow control is enabled, and TX Flow control is
@@ -573,7 +658,7 @@ ixgb_setup_fc(struct ixgb_hw * hw)
 	 * these registers will be set to a default threshold that may be
 	 * adjusted later by the driver's runtime code.  However, if the
 	 * ability to transmit pause frames in not enabled, then these
-	 * registers will be set to 0. 
+	 * registers will be set to 0.
 	 */
 	if (!(hw->fc.type & ixgb_fc_tx_pause)) {
 		IXGB_WRITE_REG(hw, FCRTL, 0);
@@ -603,18 +688,19 @@ ixgb_setup_fc(struct ixgb_hw * hw)
  *
  * Returns:  Data word (16 bits) from MDI device.
  *
- * This routine uses the new protocol MDI Single Command and Address Operation.
+ * The 82597EX has support for several MDI access methods.  This routine
+ * uses the new protocol MDI Single Command and Address Operation.
  * This requires that first an address cycle command is sent, followed by a
  * read command.
  *****************************************************************************/
-u16
+uint16_t
 ixgb_read_phy_reg(struct ixgb_hw * hw,
-		  u32 reg_address,
-		  u32 phy_address, u32 device_type)
+		  uint32_t reg_address,
+		  uint32_t phy_address, uint32_t device_type)
 {
-	u32 i;
-	u32 data;
-	u32 command = 0;
+	uint32_t i;
+	uint32_t data;
+	uint32_t command = 0;
 
 	ASSERT(reg_address <= IXGB_MAX_PHY_REG_ADDRESS);
 	ASSERT(phy_address <= IXGB_MAX_PHY_ADDRESS);
@@ -673,11 +759,11 @@ ixgb_read_phy_reg(struct ixgb_hw * hw,
 	ASSERT((command & IXGB_MSCA_MDI_COMMAND) == 0);
 
 	/* Operation is complete, get the data from the MDIO Read/Write Data
-	 * register and return. 
+	 * register and return.
 	 */
 	data = IXGB_READ_REG(hw, MSRWD);
 	data >>= IXGB_MSRWD_READ_DATA_SHIFT;
-	return ((u16) data);
+	return ((uint16_t) data);
 }
 
 /******************************************************************************
@@ -692,24 +778,25 @@ ixgb_read_phy_reg(struct ixgb_hw * hw,
  *
  * Returns:  void.
  *
- * This routine uses the new protocol MDI Single Command and Address Operation.
+ * The 82597EX has support for several MDI access methods.  This routine
+ * uses the new protocol MDI Single Command and Address Operation.
  * This requires that first an address cycle command is sent, followed by a
  * write command.
  *****************************************************************************/
 void
 ixgb_write_phy_reg(struct ixgb_hw *hw,
-		   u32 reg_address,
-		   u32 phy_address, u32 device_type, u16 data)
+		   uint32_t reg_address,
+		   uint32_t phy_address, uint32_t device_type, uint16_t data)
 {
-	u32 i;
-	u32 command = 0;
+	uint32_t i;
+	uint32_t command = 0;
 
 	ASSERT(reg_address <= IXGB_MAX_PHY_REG_ADDRESS);
 	ASSERT(phy_address <= IXGB_MAX_PHY_ADDRESS);
 	ASSERT(device_type <= IXGB_MAX_PHY_DEV_TYPE);
 
 	/* Put the data in the MDIO Read/Write Data register */
-	IXGB_WRITE_REG(hw, MSRWD, (u32) data);
+	IXGB_WRITE_REG(hw, MSRWD, (uint32_t) data);
 
 	/* Setup and write the address cycle command */
 	command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) |
@@ -773,11 +860,10 @@ ixgb_write_phy_reg(struct ixgb_hw *hw,
  *
  * Called by any function that needs to check the link status of the adapter.
  *****************************************************************************/
-void
-ixgb_check_for_link(struct ixgb_hw *hw)
+void ixgb_check_for_link(struct ixgb_hw *hw)
 {
-	u32 status_reg;
-	u32 xpcss_reg;
+	uint32_t status_reg;
+	uint32_t xpcss_reg;
 
 	DEBUGFUNC("ixgb_check_for_link");
 
@@ -792,42 +878,53 @@ ixgb_check_for_link(struct ixgb_hw *hw)
 		DEBUGOUT("XPCSS Not Aligned while Status:LU is set.\n");
 		hw->link_up = ixgb_link_reset(hw);
 	} else {
+		/*
+		 * 82597EX errata.  Since the lane deskew problem may prevent
+		 * link, reset the link before reporting link down.
+		 */
 		hw->link_up = ixgb_link_reset(hw);
 	}
-
 	/*  Anything else for 10 Gig?? */
 }
 
-boolean_t
-ixgb_check_for_bad_link(struct ixgb_hw *hw)
+/******************************************************************************
+ * Check for a bad link condition that may have occured.
+ * The indication is that the RFC / LFC registers may be incrementing
+ * continually.  A full adapter reset is required to recover.
+ *
+ * hw - Struct containing variables accessed by hw code
+ *
+ * Called by any function that needs to check the link status of the adapter.
+ *****************************************************************************/
+boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw)
 {
-	u32 newLFC, newRFC;
+	uint32_t newLFC, newRFC;
 	boolean_t bad_link_returncode = FALSE;
 
-	/* check for a bad reset that may have occured
-	 * the indication is that the RFC / LFC registers may be incrementing
-	 * continually. Do a full adapter reset to recover
-	 */
-	newLFC = IXGB_READ_REG(hw, LFC);
-	newRFC = IXGB_READ_REG(hw, RFC);
-	if ((hw->lastLFC + 250 < newLFC) || (hw->lastRFC + 250 < newRFC)) {
-		DEBUGOUT("BAD LINK! too many LFC/RFC since last check\n");
-		bad_link_returncode = TRUE;
+	if (hw->phy_type == ixgb_phy_type_txn17401) {
+		newLFC = IXGB_READ_REG(hw, LFC);
+		newRFC = IXGB_READ_REG(hw, RFC);
+		if ((hw->lastLFC + 250 < newLFC)
+		    || (hw->lastRFC + 250 < newRFC)) {
+			DEBUGOUT
+			    ("BAD LINK! too many LFC/RFC since last check\n");
+			bad_link_returncode = TRUE;
+		}
+		hw->lastLFC = newLFC;
+		hw->lastRFC = newRFC;
 	}
-	hw->lastLFC = newLFC;
-	hw->lastRFC = newRFC;
+
 	return bad_link_returncode;
 }
 
 /******************************************************************************
- * Clears all hardware statistics counters. 
+ * Clears all hardware statistics counters.
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
-ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
+void ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
 {
-	volatile u32 temp_reg;
+	volatile uint32_t temp_reg;
 
 	DEBUGFUNC("ixgb_clear_hw_cntrs");
 
@@ -905,10 +1002,9 @@ ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
-ixgb_led_on(struct ixgb_hw *hw)
+void ixgb_led_on(struct ixgb_hw *hw)
 {
-	u32 ctrl0_reg = IXGB_READ_REG(hw, CTRL0);
+	uint32_t ctrl0_reg = IXGB_READ_REG(hw, CTRL0);
 
 	/* To turn on the LED, clear software-definable pin 0 (SDP0). */
 	ctrl0_reg &= ~IXGB_CTRL0_SDP0;
@@ -921,10 +1017,9 @@ ixgb_led_on(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
-ixgb_led_off(struct ixgb_hw *hw)
+void ixgb_led_off(struct ixgb_hw *hw)
 {
-	u32 ctrl0_reg = IXGB_READ_REG(hw, CTRL0);
+	uint32_t ctrl0_reg = IXGB_READ_REG(hw, CTRL0);
 
 	/* To turn off the LED, set software-definable pin 0 (SDP0). */
 	ctrl0_reg |= IXGB_CTRL0_SDP0;
@@ -937,10 +1032,9 @@ ixgb_led_off(struct ixgb_hw *hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-static void
-ixgb_get_bus_info(struct ixgb_hw *hw)
+static void ixgb_get_bus_info(struct ixgb_hw *hw)
 {
-	u32 status_reg;
+	uint32_t status_reg;
 
 	status_reg = IXGB_READ_REG(hw, STATUS);
 
@@ -976,11 +1070,10 @@ ixgb_get_bus_info(struct ixgb_hw *hw)
 /******************************************************************************
  * Tests a MAC address to ensure it is a valid Individual Address
  *
- * mac_addr - pointer to MAC address. 
+ * mac_addr - pointer to MAC address.
  *
  *****************************************************************************/
-boolean_t
-mac_addr_valid(u8 * mac_addr)
+boolean_t mac_addr_valid(uint8_t * mac_addr)
 {
 	boolean_t is_valid = TRUE;
 	DEBUGFUNC("mac_addr_valid");
@@ -1007,22 +1100,23 @@ mac_addr_valid(u8 * mac_addr)
 }
 
 /******************************************************************************
- * Resets the 10GbE link.  Waits the settle time and returns the state of 
+ * Resets the 10GbE link.  Waits the settle time and returns the state of
  * the link.
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-boolean_t
-ixgb_link_reset(struct ixgb_hw * hw)
+boolean_t ixgb_link_reset(struct ixgb_hw * hw)
 {
 	boolean_t link_status = FALSE;
-	u8 wait_retries = MAX_RESET_ITERATIONS;
-	u8 lrst_retries = MAX_RESET_ITERATIONS;
+	uint8_t wait_retries = MAX_RESET_ITERATIONS;
+	uint8_t lrst_retries = MAX_RESET_ITERATIONS;
 
 	do {
+		/* Reset the link */
 		IXGB_WRITE_REG(hw, CTRL0,
 			       IXGB_READ_REG(hw, CTRL0) | IXGB_CTRL0_LRST);
 
+		/* Wait for link-up and lane re-alignment */
 		do {
 			udelay(IXGB_DELAY_USECS_AFTER_LINK_RESET);
 			link_status =
@@ -1030,6 +1124,7 @@ ixgb_link_reset(struct ixgb_hw * hw)
 			     && (IXGB_READ_REG(hw, XPCSS) &
 				 IXGB_XPCSS_ALIGN_STATUS)) ? TRUE : FALSE;
 		} while (!link_status && --wait_retries);
+
 	} while (!link_status && --lrst_retries);
 
 	return link_status;
@@ -1040,16 +1135,21 @@ ixgb_link_reset(struct ixgb_hw * hw)
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
-ixgb_optics_reset(struct ixgb_hw *hw)
+void ixgb_optics_reset(struct ixgb_hw *hw)
 {
-	u16 mdio_reg;
-
-	ixgb_write_phy_reg(hw,
-			   TXN17401_PMA_PMD_CR1,
-			   IXGB_PHY_ADDRESS,
-			   TXN17401_PMA_PMD_DID, TXN17401_PMA_PMD_CR1_RESET);
-	mdio_reg = ixgb_read_phy_reg(hw,
-				     TXN17401_PMA_PMD_CR1,
-				     IXGB_PHY_ADDRESS, TXN17401_PMA_PMD_DID);
+	if (hw->phy_type == ixgb_phy_type_txn17401) {
+		uint16_t mdio_reg;
+
+		ixgb_write_phy_reg(hw,
+				   MDIO_PMA_PMD_CR1,
+				   IXGB_PHY_ADDRESS,
+				   MDIO_PMA_PMD_DID, MDIO_PMA_PMD_CR1_RESET);
+
+		mdio_reg = ixgb_read_phy_reg(hw,
+					     MDIO_PMA_PMD_CR1,
+					     IXGB_PHY_ADDRESS,
+					     MDIO_PMA_PMD_DID);
+	}
+
+	return;
 }
diff --git a/drivers/net/ixgb/ixgb_hw.h b/drivers/net/ixgb/ixgb_hw.h
index 2129ae9f8..c6898ca61 100644
--- a/drivers/net/ixgb/ixgb_hw.h
+++ b/drivers/net/ixgb/ixgb_hw.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 #ifndef _IXGB_HW_H_
@@ -37,6 +38,21 @@ typedef enum {
 	ixgb_num_macs
 } ixgb_mac_type;
 
+/* Types of physical layer modules */
+typedef enum {
+	ixgb_phy_type_unknown = 0,
+	ixgb_phy_type_g6005,	/* 850nm, MM fiber, XPAK transceiver */
+	ixgb_phy_type_g6104,	/* 1310nm, SM fiber, XPAK transceiver */
+	ixgb_phy_type_txn17201,	/* 850nm, MM fiber, XPAK transceiver */
+	ixgb_phy_type_txn17401	/* 1310nm, SM fiber, XENPAK transceiver */
+} ixgb_phy_type;
+
+/* XPAK transceiver vendors, for the SR adapters */
+typedef enum {
+	ixgb_xpak_vendor_intel,
+	ixgb_xpak_vendor_infineon
+} ixgb_xpak_vendor;
+
 /* Media Types */
 typedef enum {
 	ixgb_media_type_unknown = 0,
@@ -84,6 +100,9 @@ typedef enum {
 #define SPEED_10000  10000
 #define FULL_DUPLEX  2
 
+#define MIN_NUMBER_OF_DESCRIPTORS       8
+#define MAX_NUMBER_OF_DESCRIPTORS  0xFFF8	/* 13 bits in RDLEN/TDLEN, 128B aligned     */
+
 #define IXGB_DELAY_BEFORE_RESET        10	/* allow 10ms after idling rx/tx units      */
 #define IXGB_DELAY_AFTER_RESET          1	/* allow 1ms after the reset                */
 #define IXGB_DELAY_AFTER_EE_RESET      10	/* allow 10ms after the EEPROM reset        */
@@ -225,6 +244,9 @@ typedef enum {
 /* CTRL0 Bit Masks */
 #define IXGB_CTRL0_LRST     0x00000008
 #define IXGB_CTRL0_JFE      0x00000010
+#define IXGB_CTRL0_XLE      0x00000020
+#define IXGB_CTRL0_MDCS     0x00000040
+#define IXGB_CTRL0_CMDC     0x00000080
 #define IXGB_CTRL0_SDP0     0x00040000
 #define IXGB_CTRL0_SDP1     0x00080000
 #define IXGB_CTRL0_SDP2     0x00100000
@@ -239,14 +261,36 @@ typedef enum {
 #define IXGB_CTRL0_VME      0x40000000
 
 /* CTRL1 Bit Masks */
-
+#define IXGB_CTRL1_GPI0_EN     0x00000001
+#define IXGB_CTRL1_GPI1_EN     0x00000002
+#define IXGB_CTRL1_GPI2_EN     0x00000004
+#define IXGB_CTRL1_GPI3_EN     0x00000008
+#define IXGB_CTRL1_SDP4        0x00000010
+#define IXGB_CTRL1_SDP5        0x00000020
+#define IXGB_CTRL1_SDP6        0x00000040
+#define IXGB_CTRL1_SDP7        0x00000080
+#define IXGB_CTRL1_SDP4_DIR    0x00000100
+#define IXGB_CTRL1_SDP5_DIR    0x00000200
+#define IXGB_CTRL1_SDP6_DIR    0x00000400
+#define IXGB_CTRL1_SDP7_DIR    0x00000800
 #define IXGB_CTRL1_EE_RST      0x00002000
+#define IXGB_CTRL1_RO_DIS      0x00020000
+#define IXGB_CTRL1_PCIXHM_MASK 0x00C00000
+#define IXGB_CTRL1_PCIXHM_1_2  0x00000000
+#define IXGB_CTRL1_PCIXHM_5_8  0x00400000
+#define IXGB_CTRL1_PCIXHM_3_4  0x00800000
+#define IXGB_CTRL1_PCIXHM_7_8  0x00C00000
 
 /* STATUS Bit Masks */
 #define IXGB_STATUS_LU            0x00000002
-
+#define IXGB_STATUS_AIP           0x00000004
 #define IXGB_STATUS_TXOFF         0x00000010
-
+#define IXGB_STATUS_XAUIME        0x00000020
+#define IXGB_STATUS_RES           0x00000040
+#define IXGB_STATUS_RIS           0x00000080
+#define IXGB_STATUS_RIE           0x00000100
+#define IXGB_STATUS_RLF           0x00000200
+#define IXGB_STATUS_RRF           0x00000400
 #define IXGB_STATUS_PCI_SPD       0x00000800
 #define IXGB_STATUS_BUS64         0x00001000
 #define IXGB_STATUS_PCIX_MODE     0x00002000
@@ -254,31 +298,52 @@ typedef enum {
 #define IXGB_STATUS_PCIX_SPD_66   0x00000000
 #define IXGB_STATUS_PCIX_SPD_100  0x00004000
 #define IXGB_STATUS_PCIX_SPD_133  0x00008000
+#define IXGB_STATUS_REV_ID_MASK   0x000F0000
+#define IXGB_STATUS_REV_ID_SHIFT  16
 
 /* EECD Bit Masks */
 #define IXGB_EECD_SK       0x00000001
 #define IXGB_EECD_CS       0x00000002
 #define IXGB_EECD_DI       0x00000004
 #define IXGB_EECD_DO       0x00000008
+#define IXGB_EECD_FWE_MASK 0x00000030
+#define IXGB_EECD_FWE_DIS  0x00000010
+#define IXGB_EECD_FWE_EN   0x00000020
 
 /* MFS */
 #define IXGB_MFS_SHIFT 16
 
 /* Interrupt Register Bit Masks (used for ICR, ICS, IMS, and IMC) */
 #define IXGB_INT_TXDW     0x00000001
+#define IXGB_INT_TXQE     0x00000002
 #define IXGB_INT_LSC      0x00000004
 #define IXGB_INT_RXSEQ    0x00000008
 #define IXGB_INT_RXDMT0   0x00000010
 #define IXGB_INT_RXO      0x00000040
 #define IXGB_INT_RXT0     0x00000080
+#define IXGB_INT_AUTOSCAN 0x00000200
+#define IXGB_INT_GPI0     0x00000800
+#define IXGB_INT_GPI1     0x00001000
+#define IXGB_INT_GPI2     0x00002000
+#define IXGB_INT_GPI3     0x00004000
 
 /* RCTL Bit Masks */
 #define IXGB_RCTL_RXEN        0x00000002
+#define IXGB_RCTL_SBP         0x00000004
 #define IXGB_RCTL_UPE         0x00000008
 #define IXGB_RCTL_MPE         0x00000010
+#define IXGB_RCTL_RDMTS_MASK  0x00000300
 #define IXGB_RCTL_RDMTS_1_2   0x00000000
+#define IXGB_RCTL_RDMTS_1_4   0x00000100
+#define IXGB_RCTL_RDMTS_1_8   0x00000200
+#define IXGB_RCTL_MO_MASK     0x00003000
+#define IXGB_RCTL_MO_47_36    0x00000000
+#define IXGB_RCTL_MO_46_35    0x00001000
+#define IXGB_RCTL_MO_45_34    0x00002000
+#define IXGB_RCTL_MO_43_32    0x00003000
 #define IXGB_RCTL_MO_SHIFT    12
 #define IXGB_RCTL_BAM         0x00008000
+#define IXGB_RCTL_BSIZE_MASK  0x00030000
 #define IXGB_RCTL_BSIZE_2048  0x00000000
 #define IXGB_RCTL_BSIZE_4096  0x00010000
 #define IXGB_RCTL_BSIZE_8192  0x00020000
@@ -286,27 +351,48 @@ typedef enum {
 #define IXGB_RCTL_VFE         0x00040000
 #define IXGB_RCTL_CFIEN       0x00080000
 #define IXGB_RCTL_CFI         0x00100000
+#define IXGB_RCTL_RPDA_MASK   0x00600000
+#define IXGB_RCTL_RPDA_MC_MAC 0x00000000
+#define IXGB_RCTL_MC_ONLY     0x00400000
 #define IXGB_RCTL_CFF         0x00800000
 #define IXGB_RCTL_SECRC       0x04000000
+#define IXGB_RDT_FPDB         0x80000000
+
+#define IXGB_RCTL_IDLE_RX_UNIT 0
 
 /* FCRTL Bit Masks */
 #define IXGB_FCRTL_XONE       0x80000000
 
 /* RXDCTL Bit Masks */
+#define IXGB_RXDCTL_PTHRESH_MASK  0x000001FF
 #define IXGB_RXDCTL_PTHRESH_SHIFT 0
+#define IXGB_RXDCTL_HTHRESH_MASK  0x0003FE00
 #define IXGB_RXDCTL_HTHRESH_SHIFT 9
+#define IXGB_RXDCTL_WTHRESH_MASK  0x07FC0000
 #define IXGB_RXDCTL_WTHRESH_SHIFT 18
 
 /* RAIDC Bit Masks */
+#define IXGB_RAIDC_HIGHTHRS_MASK 0x0000003F
+#define IXGB_RAIDC_DELAY_MASK    0x000FF800
 #define IXGB_RAIDC_DELAY_SHIFT   11
+#define IXGB_RAIDC_POLL_MASK     0x1FF00000
 #define IXGB_RAIDC_POLL_SHIFT    20
 #define IXGB_RAIDC_RXT_GATE      0x40000000
 #define IXGB_RAIDC_EN            0x80000000
 
+#define IXGB_RAIDC_POLL_1000_INTERRUPTS_PER_SECOND      1220
+#define IXGB_RAIDC_POLL_5000_INTERRUPTS_PER_SECOND      244
+#define IXGB_RAIDC_POLL_10000_INTERRUPTS_PER_SECOND     122
+#define IXGB_RAIDC_POLL_20000_INTERRUPTS_PER_SECOND     61
+
 /* RXCSUM Bit Masks */
+#define IXGB_RXCSUM_IPOFL 0x00000100
 #define IXGB_RXCSUM_TUOFL 0x00000200
 
 /* RAH Bit Masks */
+#define IXGB_RAH_ASEL_MASK 0x00030000
+#define IXGB_RAH_ASEL_DEST 0x00000000
+#define IXGB_RAH_ASEL_SRC  0x00010000
 #define IXGB_RAH_AV        0x80000000
 
 /* TCTL Bit Masks */
@@ -314,64 +400,145 @@ typedef enum {
 #define IXGB_TCTL_TXEN 0x00000002
 #define IXGB_TCTL_TPDE 0x00000004
 
+#define IXGB_TCTL_IDLE_TX_UNIT  0
+
 /* TXDCTL Bit Masks */
+#define IXGB_TXDCTL_PTHRESH_MASK  0x0000007F
+#define IXGB_TXDCTL_HTHRESH_MASK  0x00007F00
 #define IXGB_TXDCTL_HTHRESH_SHIFT 8
+#define IXGB_TXDCTL_WTHRESH_MASK  0x007F0000
+#define IXGB_TXDCTL_WTHRESH_SHIFT 16
 
 /* TSPMT Bit Masks */
+#define IXGB_TSPMT_TSMT_MASK   0x0000FFFF
+#define IXGB_TSPMT_TSPBP_MASK  0xFFFF0000
+#define IXGB_TSPMT_TSPBP_SHIFT 16
 
 /* PAP Bit Masks */
+#define IXGB_PAP_TXPC_MASK 0x0000FFFF
+#define IXGB_PAP_TXPV_MASK 0x000F0000
+#define IXGB_PAP_TXPV_10G  0x00000000
+#define IXGB_PAP_TXPV_1G   0x00010000
+#define IXGB_PAP_TXPV_2G   0x00020000
+#define IXGB_PAP_TXPV_3G   0x00030000
+#define IXGB_PAP_TXPV_4G   0x00040000
+#define IXGB_PAP_TXPV_5G   0x00050000
+#define IXGB_PAP_TXPV_6G   0x00060000
+#define IXGB_PAP_TXPV_7G   0x00070000
+#define IXGB_PAP_TXPV_8G   0x00080000
+#define IXGB_PAP_TXPV_9G   0x00090000
+#define IXGB_PAP_TXPV_WAN  0x000F0000
 
 /* PCSC1 Bit Masks */
+#define IXGB_PCSC1_LOOPBACK 0x00004000
 
 /* PCSC2 Bit Masks */
+#define IXGB_PCSC2_PCS_TYPE_MASK  0x00000003
+#define IXGB_PCSC2_PCS_TYPE_10GBX 0x00000001
 
 /* PCSS1 Bit Masks */
+#define IXGB_PCSS1_LOCAL_FAULT    0x00000080
+#define IXGB_PCSS1_RX_LINK_STATUS 0x00000004
 
 /* PCSS2 Bit Masks */
+#define IXGB_PCSS2_DEV_PRES_MASK 0x0000C000
+#define IXGB_PCSS2_DEV_PRES      0x00004000
+#define IXGB_PCSS2_TX_LF         0x00000800
+#define IXGB_PCSS2_RX_LF         0x00000400
+#define IXGB_PCSS2_10GBW         0x00000004
+#define IXGB_PCSS2_10GBX         0x00000002
+#define IXGB_PCSS2_10GBR         0x00000001
 
 /* XPCSS Bit Masks */
 #define IXGB_XPCSS_ALIGN_STATUS 0x00001000
+#define IXGB_XPCSS_PATTERN_TEST 0x00000800
+#define IXGB_XPCSS_LANE_3_SYNC  0x00000008
+#define IXGB_XPCSS_LANE_2_SYNC  0x00000004
+#define IXGB_XPCSS_LANE_1_SYNC  0x00000002
+#define IXGB_XPCSS_LANE_0_SYNC  0x00000001
 
 /* XPCSTC Bit Masks */
+#define IXGB_XPCSTC_BERT_TRIG       0x00200000
+#define IXGB_XPCSTC_BERT_SST        0x00100000
+#define IXGB_XPCSTC_BERT_PSZ_MASK   0x000C0000
+#define IXGB_XPCSTC_BERT_PSZ_SHIFT  17
+#define IXGB_XPCSTC_BERT_PSZ_INF    0x00000003
+#define IXGB_XPCSTC_BERT_PSZ_68     0x00000001
+#define IXGB_XPCSTC_BERT_PSZ_1028   0x00000000
 
 /* MSCA bit Masks */
 /* New Protocol Address */
+#define IXGB_MSCA_NP_ADDR_MASK      0x0000FFFF
 #define IXGB_MSCA_NP_ADDR_SHIFT     0
 /* Either Device Type or Register Address,depending on ST_CODE */
+#define IXGB_MSCA_DEV_TYPE_MASK     0x001F0000
 #define IXGB_MSCA_DEV_TYPE_SHIFT    16
+#define IXGB_MSCA_PHY_ADDR_MASK     0x03E00000
 #define IXGB_MSCA_PHY_ADDR_SHIFT    21
+#define IXGB_MSCA_OP_CODE_MASK      0x0C000000
+/* OP_CODE == 00, Address cycle, New Protocol           */
+/* OP_CODE == 01, Write operation                       */
+/* OP_CODE == 10, Read operation                        */
+/* OP_CODE == 11, Read, auto increment, New Protocol    */
 #define IXGB_MSCA_ADDR_CYCLE        0x00000000
 #define IXGB_MSCA_WRITE             0x04000000
 #define IXGB_MSCA_READ              0x08000000
+#define IXGB_MSCA_READ_AUTOINC      0x0C000000
+#define IXGB_MSCA_OP_CODE_SHIFT     26
+#define IXGB_MSCA_ST_CODE_MASK      0x30000000
+/* ST_CODE == 00, New Protocol  */
+/* ST_CODE == 01, Old Protocol  */
+#define IXGB_MSCA_NEW_PROTOCOL      0x00000000
+#define IXGB_MSCA_OLD_PROTOCOL      0x10000000
+#define IXGB_MSCA_ST_CODE_SHIFT     28
 /* Initiate command, self-clearing when command completes */
 #define IXGB_MSCA_MDI_COMMAND       0x40000000
 /*MDI In Progress Enable. */
+#define IXGB_MSCA_MDI_IN_PROG_EN    0x80000000
 
 /* MSRWD bit masks */
+#define IXGB_MSRWD_WRITE_DATA_MASK  0x0000FFFF
+#define IXGB_MSRWD_WRITE_DATA_SHIFT 0
+#define IXGB_MSRWD_READ_DATA_MASK   0xFFFF0000
 #define IXGB_MSRWD_READ_DATA_SHIFT  16
 
-/* Definitions for the TXN17401 devices on the MDIO bus. */
+/* Definitions for the optics devices on the MDIO bus. */
 #define IXGB_PHY_ADDRESS             0x0	/* Single PHY, multiple "Devices" */
 
-/* Five bit Device IDs */
-#define TXN17401_PMA_PMD_DID    0x01
-#define TXN17401_PCS_DID        0x03
-#define TXN17401_XGXS_DID       0x04
+/* Standard five-bit Device IDs.  See IEEE 802.3ae, clause 45 */
+#define MDIO_PMA_PMD_DID        0x01
+#define MDIO_WIS_DID            0x02
+#define MDIO_PCS_DID            0x03
+#define MDIO_XGXS_DID           0x04
 
-/* PMA/PMD registers and bit definitions. */
+/* Standard PMA/PMD registers and bit definitions. */
 /* Note: This is a very limited set of definitions,      */
 /* only implemented features are defined.                */
-#define TXN17401_PMA_PMD_CR1        0x0000
+#define MDIO_PMA_PMD_CR1        0x0000
+#define MDIO_PMA_PMD_CR1_RESET  0x8000
+
+#define MDIO_PMA_PMD_XPAK_VENDOR_NAME       0x803A	/* XPAK/XENPAK devices only */
 
-#define TXN17401_PMA_PMD_CR1_RESET  0x8000
+/* Vendor-specific MDIO registers */
+#define G6XXX_PMA_PMD_VS1                   0xC001	/* Vendor-specific register */
+#define G6XXX_XGXS_XAUI_VS2                 0x18	/* Vendor-specific register */
 
+#define G6XXX_PMA_PMD_VS1_PLL_RESET         0x80
+#define G6XXX_PMA_PMD_VS1_REMOVE_PLL_RESET  0x00
+#define G6XXX_XGXS_XAUI_VS2_INPUT_MASK      0x0F	/* XAUI lanes synchronized */
+
+/* Layout of a single receive descriptor.  The controller assumes that this
+ * structure is packed into 16 bytes, which is a safe assumption with most
+ * compilers.  However, some compilers may insert padding between the fields,
+ * in which case the structure must be packed in some compiler-specific
+ * manner. */
 struct ixgb_rx_desc {
 	uint64_t buff_addr;
-	u16 length;
-	u16 reserved;
-	u8 status;
-	u8 errors;
-	u16 special;
+	uint16_t length;
+	uint16_t reserved;
+	uint8_t status;
+	uint8_t errors;
+	uint16_t special;
 };
 
 #define IXGB_RX_DESC_STATUS_DD    0x01
@@ -379,23 +546,38 @@ struct ixgb_rx_desc {
 #define IXGB_RX_DESC_STATUS_IXSM  0x04
 #define IXGB_RX_DESC_STATUS_VP    0x08
 #define IXGB_RX_DESC_STATUS_TCPCS 0x20
+#define IXGB_RX_DESC_STATUS_IPCS  0x40
+#define IXGB_RX_DESC_STATUS_PIF   0x80
 
 #define IXGB_RX_DESC_ERRORS_CE   0x01
 #define IXGB_RX_DESC_ERRORS_SE   0x02
 #define IXGB_RX_DESC_ERRORS_P    0x08
 #define IXGB_RX_DESC_ERRORS_TCPE 0x20
+#define IXGB_RX_DESC_ERRORS_IPE  0x40
 #define IXGB_RX_DESC_ERRORS_RXE  0x80
 
 #define IXGB_RX_DESC_SPECIAL_VLAN_MASK  0x0FFF	/* VLAN ID is in lower 12 bits */
-
+#define IXGB_RX_DESC_SPECIAL_PRI_MASK   0xE000	/* Priority is in upper 3 bits */
+#define IXGB_RX_DESC_SPECIAL_PRI_SHIFT  0x000D	/* Priority is in upper 3 of 16 */
+
+/* Layout of a single transmit descriptor.  The controller assumes that this
+ * structure is packed into 16 bytes, which is a safe assumption with most
+ * compilers.  However, some compilers may insert padding between the fields,
+ * in which case the structure must be packed in some compiler-specific
+ * manner. */
 struct ixgb_tx_desc {
 	uint64_t buff_addr;
-	u32 cmd_type_len;
-	u8 status;
-	u8 popts;
-	u16 vlan;
+	uint32_t cmd_type_len;
+	uint8_t status;
+	uint8_t popts;
+	uint16_t vlan;
 };
 
+#define IXGB_TX_DESC_LENGTH_MASK    0x000FFFFF
+#define IXGB_TX_DESC_TYPE_MASK      0x00F00000
+#define IXGB_TX_DESC_TYPE_SHIFT     20
+#define IXGB_TX_DESC_CMD_MASK       0xFF000000
+#define IXGB_TX_DESC_CMD_SHIFT      24
 #define IXGB_TX_DESC_CMD_EOP        0x01000000
 #define IXGB_TX_DESC_CMD_TSE        0x04000000
 #define IXGB_TX_DESC_CMD_RS         0x08000000
@@ -408,18 +590,19 @@ struct ixgb_tx_desc {
 
 #define IXGB_TX_DESC_POPTS_IXSM 0x01
 #define IXGB_TX_DESC_POPTS_TXSM 0x02
+#define IXGB_TX_DESC_SPECIAL_PRI_SHIFT  IXGB_RX_DESC_SPECIAL_PRI_SHIFT	/* Priority is in upper 3 of 16 */
 
 struct ixgb_context_desc {
-	u8 ipcss;
-	u8 ipcso;
-	u16 ipcse;
-	u8 tucss;
-	u8 tucso;
-	u16 tucse;
-	u32 cmd_type_len;
-	u8 status;
-	u8 hdr_len;
-	u16 mss;
+	uint8_t ipcss;
+	uint8_t ipcso;
+	uint16_t ipcse;
+	uint8_t tucss;
+	uint8_t tucso;
+	uint16_t tucse;
+	uint32_t cmd_type_len;
+	uint8_t status;
+	uint8_t hdr_len;
+	uint16_t mss;
 };
 
 #define IXGB_CONTEXT_DESC_CMD_TCP 0x01000000
@@ -430,11 +613,14 @@ struct ixgb_context_desc {
 
 #define IXGB_CONTEXT_DESC_TYPE 0x00000000
 
+#define IXGB_CONTEXT_DESC_STATUS_DD 0x01
+
 /* Filters */
 #define IXGB_RAR_ENTRIES          16	/* Number of entries in Rx Address array */
 #define IXGB_MC_TBL_SIZE          128	/* Multicast Filter Table (4096 bits) */
 #define IXGB_VLAN_FILTER_TBL_SIZE 128	/* VLAN Filter Table (4096 bits) */
 
+#define IXGB_MEMORY_REGISTER_BASE_ADDRESS   0
 #define ENET_HEADER_SIZE            14
 #define ENET_FCS_LENGTH             4
 #define IXGB_MAX_NUM_MULTICAST_ADDRESSES    128
@@ -443,29 +629,46 @@ struct ixgb_context_desc {
 #define IXGB_MAX_JUMBO_FRAME_SIZE       0x3F00
 
 /* Phy Addresses */
+#define IXGB_OPTICAL_PHY_ADDR 0x0	/* Optical Module phy address */
+#define IXGB_XAUII_PHY_ADDR   0x1	/* Xauii transceiver phy address */
+#define IXGB_DIAG_PHY_ADDR    0x1F	/* Diagnostic Device phy address */
+
+/* This structure takes a 64k flash and maps it for identification commands */
+struct ixgb_flash_buffer {
+	uint8_t manufacturer_id;
+	uint8_t device_id;
+	uint8_t filler1[0x2AA8];
+	uint8_t cmd2;
+	uint8_t filler2[0x2AAA];
+	uint8_t cmd1;
+	uint8_t filler3[0xAAAA];
+};
 
 /*
  * This is a little-endian specific check.
  */
 #define IS_MULTICAST(Address) \
-    (boolean_t)(((u8 *)(Address))[0] & ((u8)0x01))
+    (boolean_t)(((uint8_t *)(Address))[0] & ((uint8_t)0x01))
 
 /*
  * Check whether an address is broadcast.
  */
 #define IS_BROADCAST(Address)               \
-    ((((u8 *)(Address))[0] == ((u8)0xff)) && (((u8 *)(Address))[1] == ((u8)0xff)))
+    ((((uint8_t *)(Address))[0] == ((uint8_t)0xff)) && (((uint8_t *)(Address))[1] == ((uint8_t)0xff)))
 
 /* Flow control parameters */
 struct ixgb_fc {
-	u32 high_water;	/* Flow Control High-water          */
-	u32 low_water;	/* Flow Control Low-water           */
-	u16 pause_time;	/* Flow Control Pause timer         */
+	uint32_t high_water;	/* Flow Control High-water          */
+	uint32_t low_water;	/* Flow Control Low-water           */
+	uint16_t pause_time;	/* Flow Control Pause timer         */
 	boolean_t send_xon;	/* Flow control send XON            */
 	ixgb_fc_type type;	/* Type of flow control             */
 };
 
 /* The historical defaults for the flow control values are given below. */
+#define FC_DEFAULT_HI_THRESH        (0x8000)	/* 32KB */
+#define FC_DEFAULT_LO_THRESH        (0x4000)	/* 16KB */
+#define FC_DEFAULT_TX_TIMER         (0x100)	/* ~130 us */
 
 /* Phy definitions */
 #define IXGB_MAX_PHY_REG_ADDRESS    0xFFFF
@@ -480,32 +683,40 @@ struct ixgb_bus {
 };
 
 struct ixgb_hw {
-	u8 *hw_addr;	/* Base Address of the hardware     */
+	uint8_t *hw_addr;	/* Base Address of the hardware     */
 	void *back;		/* Pointer to OS-dependent struct   */
 	struct ixgb_fc fc;	/* Flow control parameters          */
 	struct ixgb_bus bus;	/* Bus parameters                   */
-	u32 phy_id;	/* Phy Identifier                   */
-	u32 phy_addr;	/* XGMII address of Phy             */
+	uint32_t phy_id;	/* Phy Identifier                   */
+	uint32_t phy_addr;	/* XGMII address of Phy             */
 	ixgb_mac_type mac_type;	/* Identifier for MAC controller    */
-	u32 max_frame_size;	/* Maximum frame size supported     */
-	u32 mc_filter_type;	/* Multicast filter hash type       */
-	u32 num_mc_addrs;	/* Number of current Multicast addrs */
-	u8 curr_mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS];	/* Individual address currently programmed in MAC */
-	u32 num_tx_desc;	/* Number of Transmit descriptors   */
-	u32 num_rx_desc;	/* Number of Receive descriptors    */
-	u32 rx_buffer_size;	/* Size of Receive buffer           */
+	ixgb_phy_type phy_type;	/* Transceiver/phy identifier       */
+	uint32_t max_frame_size;	/* Maximum frame size supported     */
+	uint32_t mc_filter_type;	/* Multicast filter hash type       */
+	uint32_t num_mc_addrs;	/* Number of current Multicast addrs */
+	uint8_t curr_mac_addr[IXGB_ETH_LENGTH_OF_ADDRESS];	/* Individual address currently programmed in MAC */
+	uint32_t num_tx_desc;	/* Number of Transmit descriptors   */
+	uint32_t num_rx_desc;	/* Number of Receive descriptors    */
+	uint32_t rx_buffer_size;	/* Size of Receive buffer           */
 	boolean_t link_up;	/* TRUE if link is valid            */
 	boolean_t adapter_stopped;	/* State of adapter                 */
-	u16 device_id;	/* device id from PCI configuration space */
-	u16 vendor_id;	/* vendor id from PCI configuration space */
-	u16 subsystem_vendor_id;	/* subsystem vendor id from PCI configuration space */
-	u16 subsystem_id;	/* subsystem id from PCI configuration space */
-	u16 eeprom[IXGB_EEPROM_SIZE];	/* EEPROM contents read at init time  */
-	uint64_t io_base;	/* Our I/O mapped location */
-	u32 lastLFC;
-	u32 lastRFC;
+	uint16_t device_id;	/* device id from PCI configuration space */
+	uint16_t vendor_id;	/* vendor id from PCI configuration space */
+	uint8_t revision_id;	/* revision id from PCI configuration space */
+	uint16_t subsystem_vendor_id;	/* subsystem vendor id from PCI configuration space */
+	uint16_t subsystem_id;	/* subsystem id from PCI configuration space */
+	uint32_t bar0;		/* Base Address registers           */
+	uint32_t bar1;
+	uint32_t bar2;
+	uint32_t bar3;
+	uint16_t pci_cmd_word;	/* PCI command register id from PCI configuration space */
+	uint16_t eeprom[IXGB_EEPROM_SIZE];	/* EEPROM contents read at init time  */
+	unsigned long io_base;	/* Our I/O mapped location */
+	uint32_t lastLFC;
+	uint32_t lastRFC;
 };
 
+/* Statistics reported by the hardware */
 struct ixgb_hw_stats {
 	uint64_t tprl;
 	uint64_t tprh;
@@ -578,48 +789,49 @@ extern void ixgb_check_for_link(struct ixgb_hw *hw);
 extern boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw);
 extern boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
 extern void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
-extern boolean_t mac_addr_valid(u8 * mac_addr);
+extern boolean_t mac_addr_valid(uint8_t * mac_addr);
 
-extern u16 ixgb_read_phy_reg(struct ixgb_hw *hw,
-				  u32 reg_addr,
-				  u32 phy_addr, u32 device_type);
+extern uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
+				  uint32_t reg_addr,
+				  uint32_t phy_addr, uint32_t device_type);
 
 extern void ixgb_write_phy_reg(struct ixgb_hw *hw,
-			       u32 reg_addr,
-			       u32 phy_addr,
-			       u32 device_type, u16 data);
+			       uint32_t reg_addr,
+			       uint32_t phy_addr,
+			       uint32_t device_type, uint16_t data);
 
-extern void ixgb_rar_set(struct ixgb_hw *hw, u8 * addr, u32 index);
+extern void ixgb_rar_set(struct ixgb_hw *hw, uint8_t * addr, uint32_t index);
 
 /* Filters (multicast, vlan, receive) */
 extern void ixgb_mc_addr_list_update(struct ixgb_hw *hw,
-				     u8 * mc_addr_list,
-				     u32 mc_addr_count, u32 pad);
+				     uint8_t * mc_addr_list,
+				     uint32_t mc_addr_count, uint32_t pad);
 
 /* Vfta functions */
 extern void ixgb_write_vfta(struct ixgb_hw *hw,
-			    u32 offset, u32 value);
+			    uint32_t offset, uint32_t value);
 
 extern void ixgb_clear_vfta(struct ixgb_hw *hw);
 
 /* Access functions to eeprom data */
-void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, u8 * mac_addr);
-u16 ixgb_get_ee_compatibility(struct ixgb_hw *hw);
-u32 ixgb_get_ee_pba_number(struct ixgb_hw *hw);
-u16 ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw);
-u16 ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw);
-u16 ixgb_get_ee_subsystem_id(struct ixgb_hw *hw);
-u16 ixgb_get_ee_subvendor_id(struct ixgb_hw *hw);
-u16 ixgb_get_ee_device_id(struct ixgb_hw *hw);
-u16 ixgb_get_ee_vendor_id(struct ixgb_hw *hw);
-u16 ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw);
-u8 ixgb_get_ee_d3_power(struct ixgb_hw *hw);
-u8 ixgb_get_ee_d0_power(struct ixgb_hw *hw);
+void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t * mac_addr);
+uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw);
+uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_subsystem_id(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_subvendor_id(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_device_id(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_vendor_id(struct ixgb_hw *hw);
+uint16_t ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw);
+uint8_t ixgb_get_ee_d3_power(struct ixgb_hw *hw);
+uint8_t ixgb_get_ee_d0_power(struct ixgb_hw *hw);
 boolean_t ixgb_get_eeprom_data(struct ixgb_hw *hw);
+uint16_t ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index);
 
 /* Everything else */
 void ixgb_led_on(struct ixgb_hw *hw);
 void ixgb_led_off(struct ixgb_hw *hw);
-void ixgb_write_pci_cfg(struct ixgb_hw *hw, u32 reg, u16 * value);
+void ixgb_write_pci_cfg(struct ixgb_hw *hw, uint32_t reg, uint16_t * value);
 
 #endif				/* _IXGB_HW_H_ */
diff --git a/drivers/net/ixgb/ixgb_ids.h b/drivers/net/ixgb/ixgb_ids.h
index f1f1e0580..ea04cee12 100644
--- a/drivers/net/ixgb/ixgb_ids.h
+++ b/drivers/net/ixgb/ixgb_ids.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 #ifndef _IXGB_IDS_H_
@@ -35,9 +36,17 @@
 #define INTEL_VENDOR_ID         0x8086
 #define INTEL_SUBVENDOR_ID      0x8086
 
-#define IXGB_DEVICE_ID_82597EX 	0x1048
-#define IXGB_SUBDEVICE_ID_A11F  0xA11F	/* Adapter-OEM-1310nm-Fiber */
-#define IXGB_SUBDEVICE_ID_A01F	0xA01F	/* Adapter-Retail-1310nm-Fiber */
+#define IXGB_DEVICE_ID_82597EX      0x1048
+#define IXGB_DEVICE_ID_82597EX_SR   0x1A48
+
+#define IXGB_SUBDEVICE_ID_A11F  0xA11F
+#define IXGB_SUBDEVICE_ID_A01F  0xA01F
+
+#define IXGB_SUBDEVICE_ID_A15F  0xA15F
+#define IXGB_SUBDEVICE_ID_A05F  0xA05F
+
+#define IXGB_SUBDEVICE_ID_A12F  0xA12F
+#define IXGB_SUBDEVICE_ID_A02F  0xA02F
 
 #endif				/* #ifndef _IXGB_IDS_H_ */
 
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 1637e8c8b..0bd434898 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,36 +23,29 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-*******************************************************************************/
 
-#define __IXGB_MAIN__
+*******************************************************************************/
 
 #include "ixgb.h"
 
 char ixgb_driver_name[] = "ixgb";
 char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
-char ixgb_driver_version[] = "1.0.47-k1jg";
-char ixgb_copyright[] = "Copyright (c) 2001-2003 Intel Corporation.";
+char ixgb_driver_version[] = "1.0.66";
+char ixgb_copyright[] = "Copyright (c) 2001-2004 Intel Corporation.";
 
 /* ixgb_pci_tbl - PCI Device ID Table
  *
- * For selecting devices to load on private driver_data field (last one) 
- * stores an index into ixgb_strings.
  * Wildcard entries (PCI_ANY_ID) should come last
  * Last entry must be all 0s
  *
  * { Vendor ID, Device ID, SubVendor ID, SubDevice ID,
- *   Class, Class Mask, String Index }
+ *   Class, Class Mask, private data (not used) }
  */
 static struct pci_device_id ixgb_pci_tbl[] = {
-	/* Intel(R) PRO/10GbE Network Connection */
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX,
-	 INTEL_SUBVENDOR_ID, IXGB_SUBDEVICE_ID_A11F, 0, 0, 0},
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX,
-	 INTEL_SUBVENDOR_ID, IXGB_SUBDEVICE_ID_A01F, 0, 0, 0},
-	/* Generic */
 	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR,
+	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 
 	/* required last entry */
 	{0,}
@@ -60,10 +53,6 @@ static struct pci_device_id ixgb_pci_tbl[] = {
 
 MODULE_DEVICE_TABLE(pci, ixgb_pci_tbl);
 
-static char *ixgb_strings[] = {
-	"Intel(R) PRO/10GbE Network Connection"
-};
-
 /* Local Function Prototypes */
 
 int ixgb_up(struct ixgb_adapter *adapter);
@@ -73,8 +62,8 @@ void ixgb_reset(struct ixgb_adapter *adapter);
 static int ixgb_init_module(void);
 static void ixgb_exit_module(void);
 static int ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
-static void ixgb_remove(struct pci_dev *pdev);
-static void ixgb_sw_init(struct ixgb_adapter *adapter);
+static void __devexit ixgb_remove(struct pci_dev *pdev);
+static int ixgb_sw_init(struct ixgb_adapter *adapter);
 static int ixgb_open(struct net_device *netdev);
 static int ixgb_close(struct net_device *netdev);
 static int ixgb_setup_tx_resources(struct ixgb_adapter *adapter);
@@ -88,16 +77,7 @@ static void ixgb_free_tx_resources(struct ixgb_adapter *adapter);
 static void ixgb_free_rx_resources(struct ixgb_adapter *adapter);
 static void ixgb_set_multi(struct net_device *netdev);
 static void ixgb_watchdog(unsigned long data);
-static inline boolean_t ixgb_tso(struct ixgb_adapter *adapter,
-				 struct sk_buff *skb);
 static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
-static void ixgb_tx_timeout(struct net_device *netdev);
-static void ixgb_tx_timeout_task(struct net_device *netdev);
-static void ixgb_vlan_rx_register(struct net_device *netdev,
-				  struct vlan_group *grp);
-static void ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
-static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
-static void ixgb_restore_vlan(struct ixgb_adapter *adapter);
 static struct net_device_stats *ixgb_get_stats(struct net_device *netdev);
 static int ixgb_change_mtu(struct net_device *netdev, int new_mtu);
 static int ixgb_set_mac(struct net_device *netdev, void *p);
@@ -105,25 +85,40 @@ static void ixgb_update_stats(struct ixgb_adapter *adapter);
 static inline void ixgb_irq_disable(struct ixgb_adapter *adapter);
 static inline void ixgb_irq_enable(struct ixgb_adapter *adapter);
 static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs);
-static void ixgb_clean_tx_irq(struct ixgb_adapter *adapter);
+static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter);
 #ifdef CONFIG_IXGB_NAPI
-static int ixgb_poll(struct net_device *netdev, int *budget);
+static int ixgb_clean(struct net_device *netdev, int *budget);
+static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter,
+				   int *work_done, int work_to_do);
 #else
-static void ixgb_clean_rx_irq(struct ixgb_adapter *adapter);
+static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter);
 #endif
 static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter);
 static int ixgb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 static inline void ixgb_rx_checksum(struct ixgb_adapter *adapter,
 				    struct ixgb_rx_desc *rx_desc,
 				    struct sk_buff *skb);
+static void ixgb_tx_timeout(struct net_device *dev);
+static void ixgb_tx_timeout_task(struct net_device *dev);
+static void ixgb_vlan_rx_register(struct net_device *netdev,
+				  struct vlan_group *grp);
+static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
+static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
+static void ixgb_restore_vlan(struct ixgb_adapter *adapter);
+
 static int ixgb_notify_reboot(struct notifier_block *, unsigned long event,
 			      void *ptr);
-static int ixgb_suspend(struct pci_dev *pdev, u32 state);
+static int ixgb_suspend(struct pci_dev *pdev, uint32_t state);
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/* for netdump / net console */
+static void ixgb_netpoll(struct net_device *dev);
+#endif
 
 struct notifier_block ixgb_notifier_reboot = {
-	.notifier_call	= ixgb_notify_reboot,
-	.next		= NULL,
-	.priority	= 0
+	.notifier_call = ixgb_notify_reboot,
+	.next = NULL,
+	.priority = 0
 };
 
 /* Exported from other modules */
@@ -132,13 +127,13 @@ extern void ixgb_check_options(struct ixgb_adapter *adapter);
 extern int ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr);
 
 static struct pci_driver ixgb_driver = {
-	.name		= ixgb_driver_name,
-	.id_table	= ixgb_pci_tbl,
-	.probe		= ixgb_probe,
-	.remove		= __devexit_p(ixgb_remove),
+	.name = ixgb_driver_name,
+	.id_table = ixgb_pci_tbl,
+	.probe = ixgb_probe,
+	.remove = __devexit_p(ixgb_remove),
 	/* Power Managment Hooks */
-	.suspend	= NULL,
-	.resume		= NULL
+	.suspend = NULL,
+	.resume = NULL
 };
 
 MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
@@ -152,24 +147,20 @@ MODULE_LICENSE("GPL");
 #define RXDCTL_WTHRESH_DEFAULT 16	/* chip writes back at this many or RXT0 */
 
 /**
- * ixgb_init_module - Driver Registration Routine.
+ * ixgb_init_module - Driver Registration Routine
  *
  * ixgb_init_module is the first routine called when the driver is
  * loaded. All it does is register with the PCI subsystem.
  **/
 
-static int __init
-ixgb_init_module(void)
+static int __init ixgb_init_module(void)
 {
 	int ret;
-	IXGB_DBG("ixgb_init_module\n");
+	printk(KERN_INFO "%s - version %s\n",
+	       ixgb_driver_string, ixgb_driver_version);
 
-	printk(KERN_INFO "%s - version %s\n", ixgb_driver_string,
-	       ixgb_driver_version);
 	printk(KERN_INFO "%s\n", ixgb_copyright);
-#ifdef CONFIG_IXGB_NAPI
-	printk(KERN_INFO "NAPI Enabled\n");
-#endif
+
 	ret = pci_module_init(&ixgb_driver);
 	if (ret >= 0) {
 		register_reboot_notifier(&ixgb_notifier_reboot);
@@ -180,47 +171,31 @@ ixgb_init_module(void)
 module_init(ixgb_init_module);
 
 /**
- * ixgb_exit_module - Driver Exit Cleanup Routine.
+ * ixgb_exit_module - Driver Exit Cleanup Routine
  *
  * ixgb_exit_module is called just before the driver is removed
  * from memory.
  **/
 
-static void __exit
-ixgb_exit_module(void)
+static void __exit ixgb_exit_module(void)
 {
-
-	IXGB_DBG("ixgb_exit_module\n");
 	unregister_reboot_notifier(&ixgb_notifier_reboot);
 	pci_unregister_driver(&ixgb_driver);
 }
 
 module_exit(ixgb_exit_module);
 
-/**
- * ixgb_up - Driver ifconfig UP routine.
- *
- * ixgb_up is called to initialize and bring online an interface.
- * @param adapter board private structure
- **/
-
-int
-ixgb_up(struct ixgb_adapter *adapter)
+int ixgb_up(struct ixgb_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
+	int err;
+	int max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
+	struct ixgb_hw *hw = &adapter->hw;
 
-	IXGB_DBG("ixgb_up\n");
+	/* hardware has been reset, we need to reload some things */
 
-	if (request_irq(netdev->irq, &ixgb_intr, SA_SHIRQ | SA_SAMPLE_RANDOM,
-			netdev->name, netdev)) {
-		IXGB_DBG("%s: request_irq failed\n", netdev->name);
-		return -1;
-	}
-	/* disable interrupts and get the hardware into a known state */
-	IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff);
-
-	/* hardware was reset in probe/down, we need to reload some things */
 	ixgb_set_multi(netdev);
+
 	ixgb_restore_vlan(adapter);
 
 	ixgb_configure_tx(adapter);
@@ -228,31 +203,45 @@ ixgb_up(struct ixgb_adapter *adapter)
 	ixgb_configure_rx(adapter);
 	ixgb_alloc_rx_buffers(adapter);
 
+	if ((err = request_irq(adapter->pdev->irq, &ixgb_intr,
+			       SA_SHIRQ | SA_SAMPLE_RANDOM,
+			       netdev->name, netdev)))
+		return err;
+
+	/* disable interrupts and get the hardware into a known state */
+	IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff);
+
+	if ((hw->max_frame_size != max_frame) ||
+	    (hw->max_frame_size !=
+	     (IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) {
+
+		hw->max_frame_size = max_frame;
+
+		IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT);
+
+		if (hw->max_frame_size >
+		    IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) {
+			uint32_t ctrl0 = IXGB_READ_REG(hw, CTRL0);
+
+			if (!(ctrl0 & IXGB_CTRL0_JFE)) {
+				ctrl0 |= IXGB_CTRL0_JFE;
+				IXGB_WRITE_REG(hw, CTRL0, ctrl0);
+			}
+		}
+	}
+
 	mod_timer(&adapter->watchdog_timer, jiffies);
 	ixgb_irq_enable(adapter);
 
-	IXGB_DBG("ixgb_up: RAH_0 is <%x>\n", IXGB_READ_REG(&adapter->hw, RAH));
-	IXGB_DBG("ixgb_up: RDBAL is <%x>\n",
-		 IXGB_READ_REG(&adapter->hw, RDBAL));
 	return 0;
 }
 
-/**
- * ixgb_down - Driver ifconfig DOWN routine.
- *
- * ixgb_down is called to uninitialize and take offline an interface.
- * @param adapter board private structure
- * @param kill_watchdog
- **/
-void
-ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
+void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
 {
 	struct net_device *netdev = adapter->netdev;
 
-	IXGB_DBG("ixgb_down\n");
-
 	ixgb_irq_disable(adapter);
-	free_irq(netdev->irq, netdev);
+	free_irq(adapter->pdev->irq, netdev);
 	if (kill_watchdog)
 		del_timer_sync(&adapter->watchdog_timer);
 	adapter->link_speed = 0;
@@ -261,21 +250,12 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
 	netif_stop_queue(netdev);
 
 	ixgb_reset(adapter);
-
 	ixgb_clean_tx_ring(adapter);
 	ixgb_clean_rx_ring(adapter);
 }
 
-/**
- * ixgb_reset - hardware reset.
- *
- * ixgb_reset is called to initialize hardware to a known state.
- * @param adapter board private structure
- **/
-void
-ixgb_reset(struct ixgb_adapter *adapter)
+void ixgb_reset(struct ixgb_adapter *adapter)
 {
-	IXGB_DBG("ixgb_reset\n");
 
 	ixgb_adapter_stop(&adapter->hw);
 	if (!ixgb_init_hw(&adapter->hw))
@@ -283,11 +263,15 @@ ixgb_reset(struct ixgb_adapter *adapter)
 }
 
 /**
- * ixgb_probe - Device Initialization Routine.
- * @param pdev PCI device information struct
- * @param ent entry in ixgb_pci_table
+ * ixgb_probe - Device Initialization Routine
+ * @pdev: PCI device information struct
+ * @ent: entry in ixgb_pci_tbl
  *
  * Returns 0 on success, negative on failure
+ *
+ * ixgb_probe initializes an adapter identified by a pci_dev structure.
+ * The OS initialization, configuring of the adapter private structure,
+ * and a hardware reset occur.
  **/
 
 static int __devinit
@@ -300,35 +284,29 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int mmio_len;
 	int pci_using_dac;
 	int i;
+	int err;
 
-	IXGB_DBG("ixgb_probe\n");
+	if ((err = pci_enable_device(pdev)))
+		return err;
 
-	if ((i = pci_enable_device(pdev))) {
-		IXGB_ERR("pci_enable_device failed\n");
-		return i;
-	}
-
-	if (!(i = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
+	if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
 		pci_using_dac = 1;
 	} else {
-		if ((i = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
+		if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
 			IXGB_ERR("No usable DMA configuration, aborting\n");
-			return i;
+			return err;
 		}
 		pci_using_dac = 0;
 	}
 
-	if ((i = pci_request_regions(pdev, ixgb_driver_name))) {
-		IXGB_ERR("Failed to reserve PCI I/O and Memory resources.\n");
-		return i;
-	}
+	if ((err = pci_request_regions(pdev, ixgb_driver_name)))
+		return err;
 
 	pci_set_master(pdev);
 
-	/* alloc_etherdev clears the memory for us */
-	netdev = alloc_etherdev(sizeof (struct ixgb_adapter));
+	netdev = alloc_etherdev(sizeof(struct ixgb_adapter));
 	if (!netdev) {
-		IXGB_ERR("Unable to allocate net_device struct\n");
+		err = -ENOMEM;
 		goto err_alloc_etherdev;
 	}
 
@@ -345,8 +323,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	mmio_len = pci_resource_len(pdev, BAR_0);
 
 	adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
-	if (!adapter->hw.hw_addr)
+	if (!adapter->hw.hw_addr) {
+		err = -EIO;
 		goto err_ioremap;
+	}
 
 	for (i = BAR_1; i <= BAR_5; i++) {
 		if (pci_resource_len(pdev, i) == 0)
@@ -356,8 +336,6 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			break;
 		}
 	}
-	IXGB_DBG("mmio_start<%lx> hw_addr<%p>\n", mmio_start,
-		 adapter->hw.hw_addr);
 
 	netdev->open = &ixgb_open;
 	netdev->stop = &ixgb_close;
@@ -370,25 +348,28 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	netdev->tx_timeout = &ixgb_tx_timeout;
 	netdev->watchdog_timeo = HZ;
 #ifdef CONFIG_IXGB_NAPI
-	netdev->poll = &ixgb_poll;
+	netdev->poll = &ixgb_clean;
 	netdev->weight = 64;
 #endif
 	netdev->vlan_rx_register = ixgb_vlan_rx_register;
 	netdev->vlan_rx_add_vid = ixgb_vlan_rx_add_vid;
 	netdev->vlan_rx_kill_vid = ixgb_vlan_rx_kill_vid;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	netdev->poll_controller = ixgb_netpoll;
+#endif
 
-	netdev->irq = pdev->irq;
 	netdev->mem_start = mmio_start;
 	netdev->mem_end = mmio_start + mmio_len;
 	netdev->base_addr = adapter->hw.io_base;
 
 	adapter->bd_number = cards_found;
-	adapter->id_string = ixgb_strings[ent->driver_data];
 	adapter->link_speed = 0;
 	adapter->link_duplex = 0;
 
 	/* setup the private structure */
-	ixgb_sw_init(adapter);
+
+	if ((err = ixgb_sw_init(adapter)))
+		goto err_sw_init;
 
 	netdev->features = NETIF_F_SG |
 	    NETIF_F_HW_CSUM |
@@ -403,57 +384,59 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* make sure the EEPROM is good */
 
 	if (!ixgb_validate_eeprom_checksum(&adapter->hw)) {
-		IXGB_DBG("Invalid EEPROM checksum.\n");
+		printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n");
+		err = -EIO;
 		goto err_eeprom;
 	}
 
 	ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr);
 
 	if (!is_valid_ether_addr(netdev->dev_addr)) {
-		IXGB_DBG("Invalid MAC address in EEPROM.\n");
+		err = -EIO;
 		goto err_eeprom;
 	}
 
-	adapter->max_data_per_txd = IXGB_MAX_JUMBO_FRAME_SIZE;
 	adapter->part_num = ixgb_get_ee_pba_number(&adapter->hw);
 
 	init_timer(&adapter->watchdog_timer);
 	adapter->watchdog_timer.function = &ixgb_watchdog;
-	adapter->watchdog_timer.data = (unsigned long) adapter;
+	adapter->watchdog_timer.data = (unsigned long)adapter;
 
 	INIT_WORK(&adapter->tx_timeout_task,
-		  (void (*)(void *)) ixgb_tx_timeout_task, netdev);
+		  (void (*)(void *))ixgb_tx_timeout_task, netdev);
 
-	register_netdev(netdev);
-	memcpy(adapter->ifname, netdev->name, IFNAMSIZ);
-	adapter->ifname[IFNAMSIZ - 1] = 0;
+	if ((err = register_netdev(netdev)))
+		goto err_register;
 
 	/* we're going to reset, so assume we have no link for now */
 
 	netif_carrier_off(netdev);
 	netif_stop_queue(netdev);
 
-	printk(KERN_INFO "%s: %s\n", netdev->name, adapter->id_string);
+	printk(KERN_INFO "%s: Intel(R) PRO/10GbE Network Connection\n",
+	       netdev->name);
 	ixgb_check_options(adapter);
-
 	/* reset the hardware with the new settings */
+
 	ixgb_reset(adapter);
 
 	cards_found++;
 	return 0;
 
+      err_register:
+      err_sw_init:
       err_eeprom:
 	iounmap(adapter->hw.hw_addr);
       err_ioremap:
-	pci_release_regions(pdev);
 	free_netdev(netdev);
       err_alloc_etherdev:
-	return -ENOMEM;
+	pci_release_regions(pdev);
+	return err;
 }
 
 /**
- * ixgb_remove - Device Removal Routine.
- * @param pdev PCI device information struct
+ * ixgb_remove - Device Removal Routine
+ * @pdev: PCI device information struct
  *
  * ixgb_remove is called by the PCI subsystem to alert the driver
  * that it should release a PCI device.  The could be caused by a
@@ -461,49 +444,36 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  * memory.
  **/
 
-static void __devexit
-ixgb_remove(struct pci_dev *pdev)
+static void __devexit ixgb_remove(struct pci_dev *pdev)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct ixgb_adapter *adapter = netdev->priv;
 
-	IXGB_DBG("ixgb_remove\n");
-
 	unregister_netdev(netdev);
 
-#ifdef ETHTOOL_IDENTIFY
-	ixgb_identify_stop(adapter);
-#endif
-
-	iounmap((void *) adapter->hw.hw_addr);
+	iounmap(adapter->hw.hw_addr);
 	pci_release_regions(pdev);
 
 	free_netdev(netdev);
 }
 
 /**
- * ixgb_sw_init - Initialize general software structures (struct ixgb_adapter).
- * @param adapter board private structure to initialize
+ * ixgb_sw_init - Initialize general software structures (struct ixgb_adapter)
+ * @adapter: board private structure to initialize
  *
- * ixgb_sw_init initializes the adapter private data structure.
+ * ixgb_sw_init initializes the Adapter private data structure.
  * Fields are initialized based on PCI device information and
  * OS network device settings (MTU size).
  **/
 
-static void __devinit
-ixgb_sw_init(struct ixgb_adapter *adapter)
+static int __devinit ixgb_sw_init(struct ixgb_adapter *adapter)
 {
 	struct ixgb_hw *hw = &adapter->hw;
 	struct net_device *netdev = adapter->netdev;
 	struct pci_dev *pdev = adapter->pdev;
 
-	IXGB_DBG("ixgb_sw_init\n");
-
 	/* PCI config space info */
 
-	/* FIXME: do not store, instead directly use struct pci_dev
-	 * where needed
-	 */
 	hw->vendor_id = pdev->vendor;
 	hw->device_id = pdev->device;
 	hw->subsystem_vendor_id = pdev->subsystem_vendor;
@@ -513,7 +483,8 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
 
 	hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
 
-	if (hw->device_id == IXGB_DEVICE_ID_82597EX)
+	if ((hw->device_id == IXGB_DEVICE_ID_82597EX)
+	    || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR))
 		hw->mac_type = ixgb_82597;
 	else {
 		/* should never have loaded on this device */
@@ -524,11 +495,14 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
 	hw->fc.send_xon = 1;
 
 	atomic_set(&adapter->irq_sem, 1);
+	spin_lock_init(&adapter->tx_lock);
+
+	return 0;
 }
 
 /**
- * ixgb_open - Called when a network interface is made active.
- * @param netdev network interface device structure
+ * ixgb_open - Called when a network interface is made active
+ * @netdev: network interface device structure
  *
  * Returns 0 on success, negative value on failure
  *
@@ -539,27 +513,22 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
  * and the stack is notified that the interface is ready.
  **/
 
-static int
-ixgb_open(struct net_device *netdev)
+static int ixgb_open(struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-
-	IXGB_DBG("ixgb_open\n");
+	int err;
 
 	/* allocate transmit descriptors */
 
-	if (ixgb_setup_tx_resources(adapter)) {
-		IXGB_DBG("ixgb_open: failed ixgb_setup_tx_resources.\n");
+	if ((err = ixgb_setup_tx_resources(adapter)))
 		goto err_setup_tx;
-	}
 
-	/* allocate receive descriptors and buffers */
+	/* allocate receive descriptors */
 
-	if (ixgb_setup_rx_resources(adapter)) {
-		IXGB_DBG("ixgb_open: failed ixgb_setup_rx_resources.\n");
+	if ((err = ixgb_setup_rx_resources(adapter)))
 		goto err_setup_rx;
-	}
-	if (ixgb_up(adapter))
+
+	if ((err = ixgb_up(adapter)))
 		goto err_up;
 
 	return 0;
@@ -570,12 +539,13 @@ ixgb_open(struct net_device *netdev)
 	ixgb_free_tx_resources(adapter);
       err_setup_tx:
 	ixgb_reset(adapter);
-	return -EBUSY;
+
+	return err;
 }
 
 /**
- * ixgb_close - Disables a network interface.
- * @param netdev network interface device structure
+ * ixgb_close - Disables a network interface
+ * @netdev: network interface device structure
  *
  * Returns 0, this is not allowed to fail
  *
@@ -585,13 +555,10 @@ ixgb_open(struct net_device *netdev)
  * hardware, and all transmit and receive resources are freed.
  **/
 
-static int
-ixgb_close(struct net_device *netdev)
+static int ixgb_close(struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
 
-	IXGB_DBG("ixgb_close\n");
-
 	ixgb_down(adapter, TRUE);
 
 	ixgb_free_tx_resources(adapter);
@@ -601,22 +568,19 @@ ixgb_close(struct net_device *netdev)
 }
 
 /**
- * ixgb_setup_tx_resources - allocate Tx resources (Descriptors).
- * @param adapter board private structure
+ * ixgb_setup_tx_resources - allocate Tx resources (Descriptors)
+ * @adapter: board private structure
  *
  * Return 0 on success, negative on failure
  **/
 
-static int
-ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
+static int ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
 {
-	struct pci_dev *pdev = adapter->pdev;
 	struct ixgb_desc_ring *txdr = &adapter->tx_ring;
+	struct pci_dev *pdev = adapter->pdev;
 	int size;
 
-	IXGB_DBG("ixgb_setup_tx_resources\n");
-
-	size = sizeof (struct ixgb_buffer) * txdr->count;
+	size = sizeof(struct ixgb_buffer) * txdr->count;
 	txdr->buffer_info = kmalloc(size, GFP_KERNEL);
 	if (!txdr->buffer_info) {
 		return -ENOMEM;
@@ -624,7 +588,8 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
 	memset(txdr->buffer_info, 0, size);
 
 	/* round up to nearest 4K */
-	txdr->size = txdr->count * sizeof (struct ixgb_tx_desc);
+
+	txdr->size = txdr->count * sizeof(struct ixgb_tx_desc);
 	IXGB_ROUNDUP(txdr->size, 4096);
 
 	txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
@@ -634,10 +599,6 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
 	}
 	memset(txdr->desc, 0, txdr->size);
 
-	IXGB_DBG("txdr->desc <%p>\n", txdr->desc);
-	IXGB_DBG("txdr->next_to_use = <%p>\n", &txdr->next_to_use);
-	IXGB_DBG("txdr->next_to_clean = <%p>\n", &txdr->next_to_clean);
-
 	txdr->next_to_use = 0;
 	txdr->next_to_clean = 0;
 
@@ -646,21 +607,18 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
 
 /**
  * ixgb_configure_tx - Configure 82597 Transmit Unit after Reset.
- * @adapter board private structure
+ * @adapter: board private structure
  *
  * Configure the Tx unit of the MAC after a reset.
  **/
 
-static void
-ixgb_configure_tx(struct ixgb_adapter *adapter)
+static void ixgb_configure_tx(struct ixgb_adapter *adapter)
 {
-	u32 tctl;
-	u32 tdlen = adapter->tx_ring.count * sizeof (struct ixgb_tx_desc);
 	uint64_t tdba = adapter->tx_ring.dma;
+	uint32_t tdlen = adapter->tx_ring.count * sizeof(struct ixgb_tx_desc);
+	uint32_t tctl;
 	struct ixgb_hw *hw = &adapter->hw;
 
-	IXGB_DBG("ixgb_configure_tx\n");
-
 	/* Setup the Base and Length of the Tx Descriptor Ring 
 	 * tx_ring.dma can be either a 32 or 64 bit value 
 	 */
@@ -694,27 +652,24 @@ ixgb_configure_tx(struct ixgb_adapter *adapter)
 
 	/* Setup Transmit Descriptor Settings for this adapter */
 	adapter->tx_cmd_type =
-	    IXGB_TX_DESC_TYPE | IXGB_TX_DESC_CMD_RS
+	    IXGB_TX_DESC_TYPE
 	    | (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0);
 }
 
 /**
- * ixgb_setup_rx_resources - allocate Rx resources (Descriptors).
- * @param adapter board private structure
- * 
+ * ixgb_setup_rx_resources - allocate Rx resources (Descriptors)
+ * @adapter: board private structure
+ *
  * Returns 0 on success, negative on failure
  **/
 
-static int
-ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
+static int ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
 {
-	struct pci_dev *pdev = adapter->pdev;
 	struct ixgb_desc_ring *rxdr = &adapter->rx_ring;
+	struct pci_dev *pdev = adapter->pdev;
 	int size;
 
-	IXGB_DBG("ixgb_setup_rx_resources.\n");
-
-	size = sizeof (struct ixgb_buffer) * rxdr->count;
+	size = sizeof(struct ixgb_buffer) * rxdr->count;
 	rxdr->buffer_info = kmalloc(size, GFP_KERNEL);
 	if (!rxdr->buffer_info) {
 		return -ENOMEM;
@@ -722,42 +677,35 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
 	memset(rxdr->buffer_info, 0, size);
 
 	/* Round up to nearest 4K */
-	rxdr->size = rxdr->count * sizeof (struct ixgb_rx_desc);
+
+	rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
 	IXGB_ROUNDUP(rxdr->size, 4096);
 
 	rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
 
 	if (!rxdr->desc) {
-		IXGB_DBG("pci_alloc_consistent failed.\n");
 		kfree(rxdr->buffer_info);
 		return -ENOMEM;
 	}
 	memset(rxdr->desc, 0, rxdr->size);
 
-	IXGB_DBG("rxdr->desc <%p>\n", rxdr->desc);
-	IXGB_DBG("rxdr->next_to_use = <%p>\n", &rxdr->next_to_use);
-	IXGB_DBG("rxdr->next_to_clean = <%p>\n", &rxdr->next_to_clean);
-
-	rxdr->next_to_use = 0;
 	rxdr->next_to_clean = 0;
+	rxdr->next_to_use = 0;
 
 	return 0;
 }
 
 /**
- * ixgb_setup_rctl - configure the receive control register.
- * @param adapter Board private structure
+ * ixgb_setup_rctl - configure the receive control register
+ * @adapter: Board private structure
  **/
 
-static void
-ixgb_setup_rctl(struct ixgb_adapter *adapter)
+static void ixgb_setup_rctl(struct ixgb_adapter *adapter)
 {
-	u32 rctl;
+	uint32_t rctl;
 
 	rctl = IXGB_READ_REG(&adapter->hw, RCTL);
 
-	IXGB_DBG("ixgb_setup_rctl\n");
-
 	rctl &= ~(3 << IXGB_RCTL_MO_SHIFT);
 
 	rctl |=
@@ -782,35 +730,37 @@ ixgb_setup_rctl(struct ixgb_adapter *adapter)
 		rctl |= IXGB_RCTL_BSIZE_16384;
 		break;
 	}
+
 	IXGB_WRITE_REG(&adapter->hw, RCTL, rctl);
 }
 
 /**
  * ixgb_configure_rx - Configure 82597 Receive Unit after Reset.
- * @param adapter board private structure
+ * @adapter: board private structure
  *
  * Configure the Rx unit of the MAC after a reset.
  **/
 
-static void
-ixgb_configure_rx(struct ixgb_adapter *adapter)
+static void ixgb_configure_rx(struct ixgb_adapter *adapter)
 {
 	uint64_t rdba = adapter->rx_ring.dma;
-	u32 rdlen = adapter->rx_ring.count * sizeof (struct ixgb_rx_desc);
+	uint32_t rdlen = adapter->rx_ring.count * sizeof(struct ixgb_rx_desc);
 	struct ixgb_hw *hw = &adapter->hw;
-	u32 rctl;
-	u32 rxcsum;
-
-	IXGB_DBG("ixgb_configure_rx\n");
+	uint32_t rctl;
+	uint32_t rxcsum;
+	uint32_t rxdctl;
 
 	/* make sure receives are disabled while setting up the descriptors */
+
 	rctl = IXGB_READ_REG(hw, RCTL);
 	IXGB_WRITE_REG(hw, RCTL, rctl & ~IXGB_RCTL_RXEN);
 
 	/* set the Receive Delay Timer Register */
+
 	IXGB_WRITE_REG(hw, RDTR, adapter->rx_int_delay);
 
 	/* Setup the Base and Length of the Rx Descriptor Ring */
+
 	IXGB_WRITE_REG(hw, RDBAL, (rdba & 0x00000000ffffffffULL));
 	IXGB_WRITE_REG(hw, RDBAH, (rdba >> 32));
 
@@ -820,18 +770,15 @@ ixgb_configure_rx(struct ixgb_adapter *adapter)
 	IXGB_WRITE_REG(hw, RDH, 0);
 	IXGB_WRITE_REG(hw, RDT, 0);
 
-	{
-		u32 rxdctl;
-		/* burst 16 or burst when RXT0 */
-		rxdctl = RXDCTL_WTHRESH_DEFAULT << IXGB_RXDCTL_WTHRESH_SHIFT
-		    | RXDCTL_HTHRESH_DEFAULT << IXGB_RXDCTL_HTHRESH_SHIFT
-		    | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT;
-		IXGB_WRITE_REG(hw, RXDCTL, rxdctl);
-	}
+	/* burst 16 or burst when RXT0 */
+	rxdctl = RXDCTL_WTHRESH_DEFAULT << IXGB_RXDCTL_WTHRESH_SHIFT
+	    | RXDCTL_HTHRESH_DEFAULT << IXGB_RXDCTL_HTHRESH_SHIFT
+	    | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT;
+	IXGB_WRITE_REG(hw, RXDCTL, rxdctl);
 
 	if (adapter->raidc) {
-		u32 raidc;
-		u8 poll_threshold;
+		uint32_t raidc;
+		uint8_t poll_threshold;
 
 		/* Poll every rx_int_delay period, if RBD exists
 		 * Receive Backlog Detection is set to <threshold> 
@@ -879,167 +826,180 @@ ixgb_configure_rx(struct ixgb_adapter *adapter)
 }
 
 /**
- * ixgb_free_tx_resources - Free Tx Resources.
- * @param adapter board private structure
+ * ixgb_free_tx_resources - Free Tx Resources
+ * @adapter: board private structure
  *
  * Free all transmit software resources
  **/
 
-static void
-ixgb_free_tx_resources(struct ixgb_adapter *adapter)
+static void ixgb_free_tx_resources(struct ixgb_adapter *adapter)
 {
 	struct pci_dev *pdev = adapter->pdev;
 
-	IXGB_DBG("ixgb_free_tx_resources\n");
-
 	ixgb_clean_tx_ring(adapter);
 
 	kfree(adapter->tx_ring.buffer_info);
 	adapter->tx_ring.buffer_info = NULL;
 
-	pci_free_consistent(pdev, adapter->tx_ring.size, adapter->tx_ring.desc,
-			    adapter->tx_ring.dma);
+	pci_free_consistent(pdev, adapter->tx_ring.size,
+			    adapter->tx_ring.desc, adapter->tx_ring.dma);
 
 	adapter->tx_ring.desc = NULL;
 }
 
 /**
- * ixgb_clean_tx_ring - Free Tx Buffers.
- * @param adapter board private structure
+ * ixgb_clean_tx_ring - Free Tx Buffers
+ * @adapter: board private structure
  **/
 
-static void
-ixgb_clean_tx_ring(struct ixgb_adapter *adapter)
+static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter)
 {
+	struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
+	struct ixgb_buffer *buffer_info;
 	struct pci_dev *pdev = adapter->pdev;
 	unsigned long size;
-	int i;
-
-	IXGB_DBG("ixgb_clean_tx_ring\n");
+	unsigned int i;
 
 	/* Free all the Tx ring sk_buffs */
 
-	for (i = 0; i < adapter->tx_ring.count; i++) {
-		if (adapter->tx_ring.buffer_info[i].skb) {
+	for (i = 0; i < tx_ring->count; i++) {
+		buffer_info = &tx_ring->buffer_info[i];
+		if (buffer_info->skb) {
 
 			pci_unmap_page(pdev,
-				       adapter->tx_ring.buffer_info[i].dma,
-				       adapter->tx_ring.buffer_info[i].length,
-				       PCI_DMA_TODEVICE);
+				       buffer_info->dma,
+				       buffer_info->length, PCI_DMA_TODEVICE);
 
-			dev_kfree_skb(adapter->tx_ring.buffer_info[i].skb);
+			dev_kfree_skb(buffer_info->skb);
 
-			adapter->tx_ring.buffer_info[i].skb = NULL;
+			buffer_info->skb = NULL;
 		}
 	}
 
-	size = sizeof (struct ixgb_buffer) * adapter->tx_ring.count;
-	memset(adapter->tx_ring.buffer_info, 0, size);
+	size = sizeof(struct ixgb_buffer) * tx_ring->count;
+	memset(tx_ring->buffer_info, 0, size);
 
 	/* Zero out the descriptor ring */
 
-	memset(adapter->tx_ring.desc, 0, adapter->tx_ring.size);
+	memset(tx_ring->desc, 0, tx_ring->size);
 
-	adapter->tx_ring.next_to_use = 0;
-	adapter->tx_ring.next_to_clean = 0;
+	tx_ring->next_to_use = 0;
+	tx_ring->next_to_clean = 0;
 
 	IXGB_WRITE_REG(&adapter->hw, TDH, 0);
 	IXGB_WRITE_REG(&adapter->hw, TDT, 0);
 }
 
 /**
- * ixgb_free_rx_resources - Free Rx Resources.
- * @param adapter board private structure
+ * ixgb_free_rx_resources - Free Rx Resources
+ * @adapter: board private structure
  *
  * Free all receive software resources
  **/
 
-static void
-ixgb_free_rx_resources(struct ixgb_adapter *adapter)
+static void ixgb_free_rx_resources(struct ixgb_adapter *adapter)
 {
+	struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
 	struct pci_dev *pdev = adapter->pdev;
 
-	IXGB_DBG("ixgb_free_rx_resources\n");
-
 	ixgb_clean_rx_ring(adapter);
 
-	kfree(adapter->rx_ring.buffer_info);
-	adapter->rx_ring.buffer_info = NULL;
+	kfree(rx_ring->buffer_info);
+	rx_ring->buffer_info = NULL;
 
-	pci_free_consistent(pdev, adapter->rx_ring.size,
-			    adapter->rx_ring.desc, adapter->rx_ring.dma);
+	pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);
 
-	adapter->rx_ring.desc = NULL;
+	rx_ring->desc = NULL;
 }
 
 /**
- * ixgb_clean_rx_ring - Free Rx Buffers.
- * @param adapter board private structure
+ * ixgb_clean_rx_ring - Free Rx Buffers
+ * @adapter: board private structure
  **/
 
-static void
-ixgb_clean_rx_ring(struct ixgb_adapter *adapter)
+static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter)
 {
+	struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
+	struct ixgb_buffer *buffer_info;
 	struct pci_dev *pdev = adapter->pdev;
 	unsigned long size;
-	int i;
-
-	IXGB_DBG("ixgb_free_rx_ring\n");
+	unsigned int i;
 
 	/* Free all the Rx ring sk_buffs */
 
-	for (i = 0; i < adapter->rx_ring.count; i++) {
-		if (adapter->rx_ring.buffer_info[i].skb) {
+	for (i = 0; i < rx_ring->count; i++) {
+		buffer_info = &rx_ring->buffer_info[i];
+		if (buffer_info->skb) {
 
 			pci_unmap_single(pdev,
-					 adapter->rx_ring.buffer_info[i].dma,
-					 adapter->rx_ring.buffer_info[i].length,
+					 buffer_info->dma,
+					 buffer_info->length,
 					 PCI_DMA_FROMDEVICE);
 
-			dev_kfree_skb(adapter->rx_ring.buffer_info[i].skb);
+			dev_kfree_skb(buffer_info->skb);
 
-			adapter->rx_ring.buffer_info[i].skb = NULL;
+			buffer_info->skb = NULL;
 		}
 	}
 
-	size = sizeof (struct ixgb_buffer) * adapter->rx_ring.count;
-	memset(adapter->rx_ring.buffer_info, 0, size);
+	size = sizeof(struct ixgb_buffer) * rx_ring->count;
+	memset(rx_ring->buffer_info, 0, size);
 
 	/* Zero out the descriptor ring */
 
-	memset(adapter->rx_ring.desc, 0, adapter->rx_ring.size);
+	memset(rx_ring->desc, 0, rx_ring->size);
 
-	adapter->rx_ring.next_to_clean = 0;
-	adapter->rx_ring.next_to_use = 0;
+	rx_ring->next_to_clean = 0;
+	rx_ring->next_to_use = 0;
 
 	IXGB_WRITE_REG(&adapter->hw, RDH, 0);
 	IXGB_WRITE_REG(&adapter->hw, RDT, 0);
 }
 
 /**
- * ixgb_set_multi - Multicast and Promiscuous mode set.
- * @param netdev network interface device structure
+ * ixgb_set_mac - Change the Ethernet Address of the NIC
+ * @netdev: network interface device structure
+ * @p: pointer to an address structure
+ *
+ * Returns 0 on success, negative on failure
+ **/
+
+static int ixgb_set_mac(struct net_device *netdev, void *p)
+{
+	struct ixgb_adapter *adapter = netdev->priv;
+	struct sockaddr *addr = p;
+
+	if (!is_valid_ether_addr(addr->sa_data))
+		return -EADDRNOTAVAIL;
+
+	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+
+	ixgb_rar_set(&adapter->hw, addr->sa_data, 0);
+
+	return 0;
+}
+
+/**
+ * ixgb_set_multi - Multicast and Promiscuous mode set
+ * @netdev: network interface device structure
  *
  * The set_multi entry point is called whenever the multicast address
  * list or the network interface flags are updated.  This routine is
- * resposible for configuring the hardware for proper multicast,
+ * responsible for configuring the hardware for proper multicast,
  * promiscuous mode, and all-multi behavior.
  **/
 
-void
-ixgb_set_multi(struct net_device *netdev)
+static void ixgb_set_multi(struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
 	struct ixgb_hw *hw = &adapter->hw;
-	u32 rctl;
-	int i;
 	struct dev_mc_list *mc_ptr;
-
-	IXGB_DBG("ixgb_set_multi <%x>\n", netdev->flags);
+	uint32_t rctl;
+	int i;
 
 	/* Check for Promiscuous and All Multicast modes */
 
-	rctl = IXGB_READ_REG(&adapter->hw, RCTL);
+	rctl = IXGB_READ_REG(hw, RCTL);
 
 	if (netdev->flags & IFF_PROMISC) {
 		rctl |= (IXGB_RCTL_UPE | IXGB_RCTL_MPE);
@@ -1054,7 +1014,7 @@ ixgb_set_multi(struct net_device *netdev)
 		rctl |= IXGB_RCTL_MPE;
 		IXGB_WRITE_REG(hw, RCTL, rctl);
 	} else {
-		u8 mta[netdev->mc_count * IXGB_ETH_LENGTH_OF_ADDRESS];
+		uint8_t mta[netdev->mc_count * IXGB_ETH_LENGTH_OF_ADDRESS];
 
 		IXGB_WRITE_REG(hw, RCTL, rctl);
 
@@ -1068,15 +1028,16 @@ ixgb_set_multi(struct net_device *netdev)
 }
 
 /**
- * ixgb_watchdog - Timer Call-back.
- * @param data pointer to adapter cast into an unsigned long
+ * ixgb_watchdog - Timer Call-back
+ * @data: pointer to netdev cast into an unsigned long
  **/
 
-void
-ixgb_watchdog(unsigned long data)
+static void ixgb_watchdog(unsigned long data)
 {
-	struct ixgb_adapter *adapter = (struct ixgb_adapter *) data;
+	struct ixgb_adapter *adapter = (struct ixgb_adapter *)data;
 	struct net_device *netdev = adapter->netdev;
+	struct ixgb_desc_ring *txdr = &adapter->tx_ring;
+	unsigned int i;
 
 	ixgb_check_for_link(&adapter->hw);
 
@@ -1096,36 +1057,35 @@ ixgb_watchdog(unsigned long data)
 		}
 	} else {
 		if (netif_carrier_ok(netdev)) {
-			printk(KERN_INFO "ixgb: %s NIC Link is Down\n",
-			       netdev->name);
 			adapter->link_speed = 0;
 			adapter->link_duplex = 0;
+			printk(KERN_INFO
+			       "ixgb: %s NIC Link is Down\n", netdev->name);
 			netif_carrier_off(netdev);
 			netif_stop_queue(netdev);
 
-			ixgb_down(adapter, FALSE);
-			ixgb_up(adapter);
 		}
 	}
 
 	ixgb_update_stats(adapter);
 
-	/* Early detection of hung controller */
-	{
-		struct ixgb_desc_ring *txdr = &adapter->tx_ring;
-		int i = txdr->next_to_clean;
-
-		if (txdr->buffer_info[i].dma &&
-		    time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) &&
-		    !(IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_TXOFF))
-		{
-			IXGB_DBG
-			    ("ixgb: %s Hung controller? Watchdog stopping queue\n",
-			     netdev->name);
-			netif_stop_queue(netdev);
+	if (!netif_carrier_ok(netdev)) {
+		if (IXGB_DESC_UNUSED(txdr) + 1 < txdr->count) {
+			/* We've lost link, so the controller stops DMA,
+			 * but we've got queued Tx work that's never going
+			 * to get done, so reset controller to flush Tx.
+			 * (Do the reset outside of interrupt context). */
+			schedule_work(&adapter->tx_timeout_task);
 		}
 	}
 
+	/* Early detection of hung controller */
+	i = txdr->next_to_clean;
+	if (txdr->buffer_info[i].dma &&
+	    time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) &&
+	    !(IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_TXOFF))
+		netif_stop_queue(netdev);
+
 	/* generate an interrupt to force clean up of any stragglers */
 	IXGB_WRITE_REG(&adapter->hw, ICS, IXGB_INT_TXDW);
 
@@ -1133,24 +1093,18 @@ ixgb_watchdog(unsigned long data)
 	mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
 }
 
-#define IXGB_TX_FLAGS_CSUM	0x00000001
-#define IXGB_TX_FLAGS_VLAN	0x00000002
-#define IXGB_TX_FLAGS_TSO	0x00000004
-
-/** Transmit Segmentation offload setup.
- * ixgb_tso - (Large Send) setup where the initial descriptor is prepared
- * @param adapter adapter specific information
- * @param skb the skb we are trying to set up for segmentation
- **/
+#define IXGB_TX_FLAGS_CSUM		0x00000001
+#define IXGB_TX_FLAGS_VLAN		0x00000002
+#define IXGB_TX_FLAGS_TSO		0x00000004
 
 static inline boolean_t
 ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
 {
 #ifdef NETIF_F_TSO
 	struct ixgb_context_desc *context_desc;
-	int i;
-	u8 ipcss, ipcso, tucss, tucso, hdr_len;
-	u16 ipcse, tucse, mss;
+	unsigned int i;
+	uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
+	uint16_t ipcse, tucse, mss;
 
 	if (likely(skb_shinfo(skb)->tso_size)) {
 		hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
@@ -1161,10 +1115,10 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
 						      skb->nh.iph->daddr,
 						      0, IPPROTO_TCP, 0);
 		ipcss = skb->nh.raw - skb->data;
-		ipcso = (void *) &(skb->nh.iph->check) - (void *) skb->data;
+		ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data;
 		ipcse = skb->h.raw - skb->data - 1;
 		tucss = skb->h.raw - skb->data;
-		tucso = (void *) &(skb->h.th->check) - (void *) skb->data;
+		tucso = (void *)&(skb->h.th->check) - (void *)skb->data;
 		tucse = 0;
 
 		i = adapter->tx_ring.next_to_use;
@@ -1193,32 +1147,28 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb)
 							 | (skb->len -
 							    (hdr_len)));
 
-		i = (i + 1) % adapter->tx_ring.count;
+		if (++i == adapter->tx_ring.count)
+			i = 0;
 		adapter->tx_ring.next_to_use = i;
 
 		return TRUE;
 	}
 #endif
+
 	return FALSE;
 }
 
-/**
- * ixgb_tx_csum - prepare context descriptor for checksum offload.
- *
- * ixgb_tx_csum is called to prepare for checksumming a packet in hw.
- * @param adapter board private structure
- * @param skb structure containing data to send
- **/
 static inline boolean_t
 ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
 {
 	struct ixgb_context_desc *context_desc;
-	int i;
-	u8 css, cso;
+	unsigned int i;
+	uint8_t css, cso;
 
 	if (likely(skb->ip_summed == CHECKSUM_HW)) {
 		css = skb->h.raw - skb->data;
 		cso = (skb->h.raw + skb->csum) - skb->data;
+
 		i = adapter->tx_ring.next_to_use;
 		context_desc = IXGB_CONTEXT_DESC(adapter->tx_ring, i);
 
@@ -1226,7 +1176,7 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
 		context_desc->tucso = cso;
 		context_desc->tucse = 0;
 		/* zero out any previously existing data in one instruction */
-		*(u32 *) & (context_desc->ipcss) = 0;
+		*(uint32_t *) & (context_desc->ipcss) = 0;
 		context_desc->status = 0;
 		context_desc->hdr_len = 0;
 		context_desc->mss = 0;
@@ -1234,7 +1184,8 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
 		    cpu_to_le32(IXGB_CONTEXT_DESC_TYPE
 				| IXGB_TX_DESC_CMD_RS | IXGB_TX_DESC_CMD_IDE);
 
-		i = (i + 1) % adapter->tx_ring.count;
+		if (++i == adapter->tx_ring.count)
+			i = 0;
 		adapter->tx_ring.next_to_use = i;
 
 		return TRUE;
@@ -1243,43 +1194,41 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
 	return FALSE;
 }
 
-/**
- * ixgb_tx_map - private function for mapping send data to hardware addresses.
- *
- * @param adapter board private structure
- * @param skb structure containing data to send
- **/
+#define IXGB_MAX_TXD_PWR	14
+#define IXGB_MAX_DATA_PER_TXD	(1<<IXGB_MAX_TXD_PWR)
 
 static inline int
-ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb)
+ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
+	    unsigned int first)
 {
 	struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
-	int len, offset, count, size, i;
+	struct ixgb_buffer *buffer_info;
+	int len = skb->len;
+	unsigned int offset = 0, size, count = 0, i;
 
-	int f;
-	len = skb->len - skb->data_len;
+	unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
+	unsigned int f;
+	len -= skb->data_len;
 
-	i = (tx_ring->next_to_use + tx_ring->count - 1) % tx_ring->count;
-	count = 0;
-
-	offset = 0;
+	i = tx_ring->next_to_use;
 
 	while (len) {
-		i = (i + 1) % tx_ring->count;
-		size = min(len, adapter->max_data_per_txd);
-		tx_ring->buffer_info[i].length = size;
-		tx_ring->buffer_info[i].dma =
-		    pci_map_single(adapter->pdev, skb->data + offset, size,
-				   PCI_DMA_TODEVICE);
-
-		tx_ring->buffer_info[i].time_stamp = jiffies;
+		buffer_info = &tx_ring->buffer_info[i];
+		size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
+		buffer_info->length = size;
+		buffer_info->dma =
+		    pci_map_single(adapter->pdev,
+				   skb->data + offset, size, PCI_DMA_TODEVICE);
+		buffer_info->time_stamp = jiffies;
 
 		len -= size;
 		offset += size;
 		count++;
+		if (++i == tx_ring->count)
+			i = 0;
 	}
 
-	for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+	for (f = 0; f < nr_frags; f++) {
 		struct skb_frag_struct *frag;
 
 		frag = &skb_shinfo(skb)->frags[f];
@@ -1287,44 +1236,41 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb)
 		offset = 0;
 
 		while (len) {
-			i = (i + 1) % tx_ring->count;
-			size = min(len, adapter->max_data_per_txd);
-			tx_ring->buffer_info[i].length = size;
-			tx_ring->buffer_info[i].dma =
-			    pci_map_page(adapter->pdev, frag->page,
-					 frag->page_offset + offset, size,
-					 PCI_DMA_TODEVICE);
-
-			tx_ring->buffer_info[i].time_stamp = jiffies;
+			buffer_info = &tx_ring->buffer_info[i];
+			size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
+			buffer_info->length = size;
+			buffer_info->dma =
+			    pci_map_page(adapter->pdev,
+					 frag->page,
+					 frag->page_offset + offset,
+					 size, PCI_DMA_TODEVICE);
+			buffer_info->time_stamp = jiffies;
+
 			len -= size;
 			offset += size;
 			count++;
+			if (++i == tx_ring->count)
+				i = 0;
 		}
 	}
+	i = (i == 0) ? tx_ring->count - 1 : i - 1;
 	tx_ring->buffer_info[i].skb = skb;
+	tx_ring->buffer_info[first].next_to_watch = i;
 
 	return count;
 }
 
-/**
- * ixgb_tx_queue - private function to start transmit on hardware.
- *
- * @param adapter board private structure
- * @param count number of tx_descriptors to initialize (consume)
- * @param vlan_id the vlan tag to insert (if necessary)
- * @param tx_flags special handling for this transmit, if any
- **/
-
 static inline void
 ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,
 	      int tx_flags)
 {
 	struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
 	struct ixgb_tx_desc *tx_desc = NULL;
-	u32 cmd_type_len = adapter->tx_cmd_type;
-	u8 status = 0;
-	u8 popts = 0;
-	int i;
+	struct ixgb_buffer *buffer_info;
+	uint32_t cmd_type_len = adapter->tx_cmd_type;
+	uint8_t status = 0;
+	uint8_t popts = 0;
+	unsigned int i;
 
 	if (tx_flags & IXGB_TX_FLAGS_TSO) {
 		cmd_type_len |= IXGB_TX_DESC_CMD_TSE;
@@ -1341,18 +1287,21 @@ ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,
 	i = tx_ring->next_to_use;
 
 	while (count--) {
+		buffer_info = &tx_ring->buffer_info[i];
 		tx_desc = IXGB_TX_DESC(*tx_ring, i);
-		tx_desc->buff_addr = cpu_to_le64(tx_ring->buffer_info[i].dma);
+		tx_desc->buff_addr = cpu_to_le64(buffer_info->dma);
 		tx_desc->cmd_type_len =
-		    cpu_to_le32(cmd_type_len | tx_ring->buffer_info[i].length);
+		    cpu_to_le32(cmd_type_len | buffer_info->length);
 		tx_desc->status = status;
 		tx_desc->popts = popts;
 		tx_desc->vlan = cpu_to_le16(vlan_id);
 
-		i = (i + 1) % tx_ring->count;
+		if (++i == tx_ring->count)
+			i = 0;
 	}
 
-	tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP);
+	tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP
+					     | IXGB_TX_DESC_CMD_RS);
 
 	/* Force memory writes to complete before letting h/w
 	 * know there are new descriptors to fetch.  (Only
@@ -1364,95 +1313,70 @@ ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,
 	IXGB_WRITE_REG(&adapter->hw, TDT, i);
 }
 
-#define TXD_USE_COUNT(S, X) (((S) / (X)) + (((S) % (X)) ? 1 : 0))
+/* Tx Descriptors needed, worst case */
+#define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \
+			 (((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
+#define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \
+	MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1
 
-/**
- * ixgb_xmit_frame - hard_start_xmit linked function, transmit entry point.
- *
- * ixgb_xmit_frame is called to send an skb on the wire.
- * @param skb contains data to send
- * @param netdev network interface device structure 
- **/
-
-static int
-ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
+static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
+	unsigned int first;
+	unsigned int tx_flags = 0;
+	unsigned long flags;
 	int vlan_id = 0;
-	int tx_flags = 0, count;
-	int f;
-
-	count =
-	    TXD_USE_COUNT(skb->len - skb->data_len, adapter->max_data_per_txd);
 
-	if (count == 0) {
+	if (skb->len <= 0) {
 		dev_kfree_skb_any(skb);
 		return 0;
 	}
 
-	for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
-		count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,
-				       adapter->max_data_per_txd);
-#ifdef NETIF_F_TSO
-	if ((skb_shinfo(skb)->tso_size) || (skb->ip_summed == CHECKSUM_HW))
-		count++;
-#else
-	if (skb->ip_summed == CHECKSUM_HW)
-		count++;
-#endif
-
-	if (unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < count)) {
+	spin_lock_irqsave(&adapter->tx_lock, flags);
+	if (unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) {
 		netif_stop_queue(netdev);
+		spin_unlock_irqrestore(&adapter->tx_lock, flags);
 		return 1;
 	}
+	spin_unlock_irqrestore(&adapter->tx_lock, flags);
 
 	if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
 		tx_flags |= IXGB_TX_FLAGS_VLAN;
 		vlan_id = vlan_tx_tag_get(skb);
 	}
 
+	first = adapter->tx_ring.next_to_use;
+
 	if (ixgb_tso(adapter, skb))
 		tx_flags |= IXGB_TX_FLAGS_TSO;
 	else if (ixgb_tx_csum(adapter, skb))
 		tx_flags |= IXGB_TX_FLAGS_CSUM;
 
-	count = ixgb_tx_map(adapter, skb);
-	ixgb_tx_queue(adapter, count, vlan_id, tx_flags);
+	ixgb_tx_queue(adapter, ixgb_tx_map(adapter, skb, first), vlan_id,
+		      tx_flags);
+
 	netdev->trans_start = jiffies;
 
 	return 0;
 }
 
 /**
- * ixgb_tx_timeout - Respond to a Tx Hang by resetting the adapter.
- * @param netdev network interface device structure
+ * ixgb_tx_timeout - Respond to a Tx Hang
+ * @netdev: network interface device structure
  **/
 
-static void
-ixgb_tx_timeout(struct net_device *netdev)
+static void ixgb_tx_timeout(struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
 
-	IXGB_DBG("ixgb_tx_timeout\n");
-
 	/* Do the reset outside of interrupt context */
 	schedule_work(&adapter->tx_timeout_task);
 }
 
-/**
- * ixgb_tx_timeout_task - worker function to reset hardware and dump queues.
- * This function is pointed to by adapter->tx_timeout_task
- *
- * @param netdev network interface device structure 
- **/
-
-static void
-ixgb_tx_timeout_task(struct net_device *netdev)
+static void ixgb_tx_timeout_task(struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
 
-	IXGB_DBG("ixgb_tx_timeout_task\n");
-
 	netif_device_detach(netdev);
 	ixgb_down(adapter, TRUE);
 	ixgb_up(adapter);
@@ -1460,15 +1384,14 @@ ixgb_tx_timeout_task(struct net_device *netdev)
 }
 
 /**
- * ixgb_get_stats - Get System Network Statistics.
- * @param netdev network interface device structure
+ * ixgb_get_stats - Get System Network Statistics
+ * @netdev: network interface device structure
  *
  * Returns the address of the device statistics structure.
  * The statistics are actually updated from the timer callback.
  **/
 
-static struct net_device_stats *
-ixgb_get_stats(struct net_device *netdev)
+static struct net_device_stats *ixgb_get_stats(struct net_device *netdev)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
 
@@ -1476,22 +1399,19 @@ ixgb_get_stats(struct net_device *netdev)
 }
 
 /**
- * ixgb_change_mtu - Change the Maximum Transfer Unit.
- * @param netdev network interface device structure
- * @param new_mtu new value for maximum frame size
+ * ixgb_change_mtu - Change the Maximum Transfer Unit
+ * @netdev: network interface device structure
+ * @new_mtu: new value for maximum frame size
  *
  * Returns 0 on success, negative on failure
  **/
 
-static int
-ixgb_change_mtu(struct net_device *netdev, int new_mtu)
+static int ixgb_change_mtu(struct net_device *netdev, int new_mtu)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-	u32 old_mtu = adapter->rx_buffer_len;
+	uint32_t old_mtu = adapter->rx_buffer_len;
 	int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
 
-	IXGB_DBG("ixgb_change_mtu\n");
-
 	if ((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH)
 	    || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) {
 		IXGB_ERR("Invalid MTU setting\n");
@@ -1513,69 +1433,23 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
 		adapter->rx_buffer_len = IXGB_RXBUFFER_16384;
 	}
 
+	netdev->mtu = new_mtu;
+
 	if (old_mtu != adapter->rx_buffer_len && netif_running(netdev)) {
 
 		ixgb_down(adapter, TRUE);
 		ixgb_up(adapter);
 	}
 
-	if (adapter->hw.max_frame_size != max_frame) {
-		struct ixgb_hw *hw = &adapter->hw;
-
-		adapter->hw.max_frame_size = max_frame;
-
-		IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT);
-
-		if (hw->max_frame_size >
-		    IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) {
-			u32 ctrl0 = IXGB_READ_REG(hw, CTRL0);
-
-			if (!(ctrl0 & IXGB_CTRL0_JFE)) {
-				ctrl0 |= IXGB_CTRL0_JFE;
-				IXGB_WRITE_REG(hw, CTRL0, ctrl0);
-			}
-		}
-
-		printk(KERN_ERR "%s: ixgb_change_mtu MFS is set to <%x>\n",
-		       adapter->netdev->name,
-		       (IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT));
-	}
-
-	netdev->mtu = new_mtu;
-
-	return 0;
-}
-
-/**
- * ixgb_set_mac - Change the Ethernet Address of the NIC.
- * @param netdev network interface device structure
- * @param p pointer to an address structure
- * 
- * Returns 0 on success, negative on failure
- **/
-
-static int
-ixgb_set_mac(struct net_device *netdev, void *p)
-{
-	struct ixgb_adapter *adapter = netdev->priv;
-	struct sockaddr *addr = (struct sockaddr *) p;
-
-	IXGB_DBG("ixgb_set_mac\n");
-
-	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
-
-	ixgb_rar_set(&adapter->hw, addr->sa_data, 0);
-
 	return 0;
 }
 
 /**
  * ixgb_update_stats - Update the board statistics counters.
- * @param adapter board private structure
+ * @adapter: board private structure
  **/
 
-static void
-ixgb_update_stats(struct ixgb_adapter *adapter)
+static void ixgb_update_stats(struct ixgb_adapter *adapter)
 {
 	adapter->stats.tprl += IXGB_READ_REG(&adapter->hw, TPRL);
 	adapter->stats.tprh += IXGB_READ_REG(&adapter->hw, TPRH);
@@ -1678,309 +1552,241 @@ ixgb_update_stats(struct ixgb_adapter *adapter)
 
 /**
  * ixgb_irq_disable - Mask off interrupt generation on the NIC
- * @param adapter board private structure
+ * @adapter: board private structure
  **/
 
-static inline void
-ixgb_irq_disable(struct ixgb_adapter *adapter)
+static inline void ixgb_irq_disable(struct ixgb_adapter *adapter)
 {
-	IXGB_DBG("ixgb_irq_disable\n");
-
 	atomic_inc(&adapter->irq_sem);
 	IXGB_WRITE_REG(&adapter->hw, IMC, ~0);
-	synchronize_irq(adapter->netdev->irq);
+	IXGB_WRITE_FLUSH(&adapter->hw);
+	synchronize_irq(adapter->pdev->irq);
 }
 
 /**
- * ixgb_irq_enable - Enable default interrupt generation settings.
- * @param adapter board private structure
+ * ixgb_irq_enable - Enable default interrupt generation settings
+ * @adapter: board private structure
  **/
 
-static inline void
-ixgb_irq_enable(struct ixgb_adapter *adapter)
+static inline void ixgb_irq_enable(struct ixgb_adapter *adapter)
 {
-	IXGB_DBG("ixgb_irq_enable\n");
-
 	if (atomic_dec_and_test(&adapter->irq_sem)) {
 		IXGB_WRITE_REG(&adapter->hw, IMS,
 			       IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW |
 			       IXGB_INT_RXO | IXGB_INT_LSC);
+		IXGB_WRITE_FLUSH(&adapter->hw);
 	}
 }
 
 #define IXGB_MAX_INTR 10
 /**
- * ixgb_intr - Interrupt Handler.
- * @param irq interrupt number
- * @param data pointer to a network interface device structure
- * @param regs CPU registers structure
+ * ixgb_intr - Interrupt Handler
+ * @irq: interrupt number
+ * @data: pointer to a network interface device structure
+ * @pt_regs: CPU registers structure
  **/
 
-static irqreturn_t
-ixgb_intr(int irq, void *data, struct pt_regs *regs)
+static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs)
 {
-	struct net_device *netdev = (struct net_device *) data;
+	struct net_device *netdev = data;
 	struct ixgb_adapter *adapter = netdev->priv;
-#ifdef CONFIG_IXGB_NAPI
-	if (netif_rx_schedule_prep(netdev)) {
-		ixgb_irq_disable(adapter);
-		__netif_rx_schedule(netdev);
-	}
-
-	return IRQ_HANDLED; /* FIXME: check for shared interrupts */
-#else
 	struct ixgb_hw *hw = &adapter->hw;
-	u32 icr;
-	uint i = IXGB_MAX_INTR;
-	boolean_t rxdmt0 = FALSE;
-	int handled = 0;
-
-	while (i && (icr = IXGB_READ_REG(hw, ICR))) {
-		handled = 1;
+	uint32_t icr = IXGB_READ_REG(&adapter->hw, ICR);
+#ifndef CONFIG_IXGB_NAPI
+	unsigned int i;
+#endif
 
-		if (icr & IXGB_INT_RXDMT0)
-			rxdmt0 = TRUE;
+	if (unlikely(!icr))
+		return IRQ_NONE;	/* Not our interrupt */
 
-		if (unlikely(icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC))) {
-			mod_timer(&adapter->watchdog_timer, jiffies);
-		}
+	if (unlikely(icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC))) {
+		mod_timer(&adapter->watchdog_timer, jiffies);
+	}
+#ifdef CONFIG_IXGB_NAPI
+	if (netif_rx_schedule_prep(netdev)) {
 
-		/* adapter->generate_int = 0; */
-		ixgb_clean_rx_irq(adapter);
-		ixgb_clean_tx_irq(adapter);
+		/* Disable interrupts and register for poll. The flush 
+		   of the posted write is intentionally left out.
+		 */
 
-		i--;
+		atomic_inc(&adapter->irq_sem);
+		IXGB_WRITE_REG(hw, IMC, ~0);
+		__netif_rx_schedule(netdev);
 	}
-
+#else
+	for (i = 0; i < IXGB_MAX_INTR; i++)
+		if (!ixgb_clean_rx_irq(adapter) & !ixgb_clean_tx_irq(adapter))
+			break;
 	/* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to
 	 * set IMS:RXDMT0 to 1 to restart the RBD timer (POLL)
 	 */
-	if (rxdmt0 && adapter->raidc) {
+	if ((icr & IXGB_INT_RXDMT0) && adapter->raidc) {
 		/* ready the timer by writing the clear reg */
 		IXGB_WRITE_REG(hw, IMC, IXGB_INT_RXDMT0);
 		/* now restart it, h/w will decide if its necessary */
 		IXGB_WRITE_REG(hw, IMS, IXGB_INT_RXDMT0);
 	}
-
-	return IRQ_RETVAL(handled);
-#endif				// NAPI else
+#endif
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_IXGB_NAPI
-static int
-ixgb_process_intr(struct net_device *netdev)
+/**
+ * ixgb_clean - NAPI Rx polling callback
+ * @adapter: board private structure
+ **/
+
+static int ixgb_clean(struct net_device *netdev, int *budget)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-	u32 icr;
-	int i = IXGB_MAX_INTR;
-	int hasReceived = 0;
+	int work_to_do = min(*budget, netdev->quota);
+	int work_done = 0;
 
-	while (i && (icr = IXGB_READ_REG(&adapter->hw, ICR))) {
-		if (icr & IXGB_INT_RXT0)
-			hasReceived = 1;
+	ixgb_clean_tx_irq(adapter);
+	ixgb_clean_rx_irq(adapter, &work_done, work_to_do);
 
-		if (!(icr & ~(IXGB_INT_RXT0)))
-			break;
+	*budget -= work_done;
+	netdev->quota -= work_done;
 
-		if (icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC)) {
-			mod_timer(&adapter->watchdog_timer, jiffies);
-		}
-
-		ixgb_clean_tx_irq(adapter);
-		i--;
+	if (work_done < work_to_do || !netif_running(netdev)) {
+		netif_rx_complete(netdev);
+		/* RAIDC will be automatically restarted by irq_enable */
+		ixgb_irq_enable(adapter);
 	}
 
-	return hasReceived;
+	return (work_done >= work_to_do);
 }
-
 #endif
+
 /**
- * ixgb_clean_tx_irq - Reclaim resources after transmit completes.
- * @param adapter board private structure
+ * ixgb_clean_tx_irq - Reclaim resources after transmit completes
+ * @adapter: board private structure
  **/
 
-static void
-ixgb_clean_tx_irq(struct ixgb_adapter *adapter)
+static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter)
 {
 	struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
 	struct net_device *netdev = adapter->netdev;
 	struct pci_dev *pdev = adapter->pdev;
-	int i = adapter->tx_ring.next_to_clean;
-	struct ixgb_tx_desc *tx_desc = IXGB_TX_DESC(*tx_ring, i);
-	while ((tx_desc->status & IXGB_TX_DESC_STATUS_DD)) {
-		if (tx_desc->popts
-		    & (IXGB_TX_DESC_POPTS_TXSM | IXGB_TX_DESC_POPTS_IXSM))
-			adapter->hw_csum_tx_good++;
-
-		if (tx_ring->buffer_info[i].dma) {
-			pci_unmap_page(pdev, tx_ring->buffer_info[i].dma,
-				       tx_ring->buffer_info[i].length,
-				       PCI_DMA_TODEVICE);
-			tx_ring->buffer_info[i].dma = 0;
-		}
-
-		if (tx_ring->buffer_info[i].skb) {
-			dev_kfree_skb_any(tx_ring->buffer_info[i].skb);
-			tx_ring->buffer_info[i].skb = NULL;
-		}
-
-		*(u32 *) & (tx_desc->status) = 0;
-
-		i = (i + 1) % tx_ring->count;
-		tx_desc = IXGB_TX_DESC(*tx_ring, i);
-	}
-
-	tx_ring->next_to_clean = i;
-
-	if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev) &&
-	    (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) {
-
-		netif_wake_queue(netdev);
-	}
-}
-
-#ifdef CONFIG_IXGB_NAPI
-static int
-ixgb_poll(struct net_device *netdev, int *budget)
-{
-	struct ixgb_adapter *adapter = netdev->priv;
-	struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
-	struct pci_dev *pdev = adapter->pdev;
-	struct ixgb_rx_desc *rx_desc;
-	struct sk_buff *skb;
-	u32 length;
-	int i;
-	int received = 0;
-	int rx_work_limit = *budget;
-
-	if (rx_work_limit > netdev->quota)
-		rx_work_limit = netdev->quota;
-
-	ixgb_process_intr(netdev);
-
-	i = rx_ring->next_to_clean;
-	rx_desc = IXGB_RX_DESC(*rx_ring, i);
-
-	while ((rx_desc->status & IXGB_RX_DESC_STATUS_DD)) {
-		if (--rx_work_limit < 0)
-			goto not_done;
-
-		pci_unmap_single(pdev,
-				 rx_ring->buffer_info[i].dma,
-				 rx_ring->buffer_info[i].length,
-				 PCI_DMA_FROMDEVICE);
+	struct ixgb_tx_desc *tx_desc, *eop_desc;
+	struct ixgb_buffer *buffer_info;
+	unsigned int i, eop;
+	boolean_t cleaned = FALSE;
 
-		skb = rx_ring->buffer_info[i].skb;
-		length = le16_to_cpu(rx_desc->length);
+	i = tx_ring->next_to_clean;
+	eop = tx_ring->buffer_info[i].next_to_watch;
+	eop_desc = IXGB_TX_DESC(*tx_ring, eop);
 
-		if (!(rx_desc->status & IXGB_RX_DESC_STATUS_EOP)) {
+	while (eop_desc->status & cpu_to_le32(IXGB_TX_DESC_STATUS_DD)) {
 
-			/* All receives must fit into a single buffer */
+		for (cleaned = FALSE; !cleaned;) {
+			tx_desc = IXGB_TX_DESC(*tx_ring, i);
+			buffer_info = &tx_ring->buffer_info[i];
 
-			IXGB_DBG("Receive packet consumed multiple buffers\n");
+			if (tx_desc->popts
+			    & (IXGB_TX_DESC_POPTS_TXSM |
+			       IXGB_TX_DESC_POPTS_IXSM))
+				adapter->hw_csum_tx_good++;
 
-			dev_kfree_skb_irq(skb);
-			rx_desc->status = 0;
-			rx_ring->buffer_info[i].skb = NULL;
+			if (buffer_info->dma) {
 
-			i = (i + 1) % rx_ring->count;
+				pci_unmap_page(pdev,
+					       buffer_info->dma,
+					       buffer_info->length,
+					       PCI_DMA_TODEVICE);
 
-			rx_desc = IXGB_RX_DESC(*rx_ring, i);
-			continue;
-		}
-
-		if (rx_desc->
-		    errors & (IXGB_RX_DESC_ERRORS_CE | IXGB_RX_DESC_ERRORS_SE |
-			      IXGB_RX_DESC_ERRORS_P | IXGB_RX_DESC_ERRORS_RXE))
-		{
+				buffer_info->dma = 0;
+			}
 
-			IXGB_DBG("Receive Errors Reported by Hardware-%x.\n",
-				 rx_desc->errors);
+			if (buffer_info->skb) {
 
-			dev_kfree_skb_irq(skb);
-			rx_desc->status = 0;
-			rx_ring->buffer_info[i].skb = NULL;
-			i = (i + 1) % rx_ring->count;
-			rx_desc = IXGB_RX_DESC(*rx_ring, i);
-			continue;
-		}
+				dev_kfree_skb_any(buffer_info->skb);
 
-		/* Good Receive */
-		skb_put(skb, length);
+				buffer_info->skb = NULL;
+			}
 
-		/* Receive Checksum Offload */
-		ixgb_rx_checksum(adapter, rx_desc, skb);
+			*(uint32_t *) & (tx_desc->status) = 0;
 
-		skb->protocol = eth_type_trans(skb, netdev);
-		if (adapter->vlgrp
-		    && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) {
-			vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-				(rx_desc-> special & IXGB_RX_DESC_SPECIAL_VLAN_MASK));
-		} else {
-			netif_receive_skb(skb);
+			cleaned = (i == eop);
+			if (++i == tx_ring->count)
+				i = 0;
 		}
-		netdev->last_rx = jiffies;
-
-		rx_desc->status = 0;
-		rx_ring->buffer_info[i].skb = NULL;
 
-		i = (i + 1) % rx_ring->count;
-
-		rx_desc = IXGB_RX_DESC(*rx_ring, i);
-		received++;
+		eop = tx_ring->buffer_info[i].next_to_watch;
+		eop_desc = IXGB_TX_DESC(*tx_ring, eop);
 	}
 
-	if (!received)
-		received = 1;
-
-	ixgb_alloc_rx_buffers(adapter);
-
-	rx_ring->next_to_clean = i;
-	netdev->quota -= received;
-	*budget -= received;
-
-	netif_rx_complete(netdev);
-
-	/* NOTE: RAIDC will be automatically restarted by this enable */
-	ixgb_irq_enable(adapter);
-	return 0;
+	tx_ring->next_to_clean = i;
 
-      not_done:
+	spin_lock(&adapter->tx_lock);
+	if (cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev)
+	    && (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) {
 
-	ixgb_alloc_rx_buffers(adapter);
-
-	rx_ring->next_to_clean = i;
-	netdev->quota -= received;
-	*budget -= received;
+		netif_wake_queue(netdev);
+	}
+	spin_unlock(&adapter->tx_lock);
 
-	return 1;
+	return cleaned;
 }
-#else
+
 /**
- * ixgb_clean_rx_irq - Send received data up the network stack.
- * @param adapter board private structure
+ * ixgb_clean_rx_irq - Send received data up the network stack,
+ * @adapter: board private structure
  **/
 
-static void
+static boolean_t
+#ifdef CONFIG_IXGB_NAPI
+ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do)
+#else
 ixgb_clean_rx_irq(struct ixgb_adapter *adapter)
+#endif
 {
 	struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
 	struct net_device *netdev = adapter->netdev;
 	struct pci_dev *pdev = adapter->pdev;
-	struct ixgb_rx_desc *rx_desc;
-	struct sk_buff *skb;
-	u32 length;
-	int i;
+	struct ixgb_rx_desc *rx_desc, *next_rxd;
+	struct ixgb_buffer *buffer_info, *next_buffer, *next2_buffer;
+	struct sk_buff *skb, *next_skb;
+	uint32_t length;
+	unsigned int i, j;
+	boolean_t cleaned = FALSE;
 
 	i = rx_ring->next_to_clean;
 	rx_desc = IXGB_RX_DESC(*rx_ring, i);
+	buffer_info = &rx_ring->buffer_info[i];
+
+	while (rx_desc->status & IXGB_RX_DESC_STATUS_DD) {
+
+		skb = buffer_info->skb;
+		prefetch(skb->data);
 
-	while ((rx_desc->status & IXGB_RX_DESC_STATUS_DD)) {
-		pci_unmap_single(pdev, rx_ring->buffer_info[i].dma,
-				 rx_ring->buffer_info[i].length,
-				 PCI_DMA_FROMDEVICE);
+		if (++i == rx_ring->count)
+			i = 0;
+		next_rxd = IXGB_RX_DESC(*rx_ring, i);
+		prefetch(next_rxd);
+
+		if ((j = i + 1) == rx_ring->count)
+			j = 0;
+		next2_buffer = &rx_ring->buffer_info[j];
+		prefetch(next2_buffer);
+
+		next_buffer = &rx_ring->buffer_info[i];
+		next_skb = next_buffer->skb;
+		prefetch(next_skb);
+
+#ifdef CONFIG_IXGB_NAPI
+		if (*work_done >= work_to_do)
+			break;
+
+		(*work_done)++;
+#endif
+
+		cleaned = TRUE;
+
+		pci_unmap_single(pdev,
+				 buffer_info->dma,
+				 buffer_info->length, PCI_DMA_FROMDEVICE);
 
-		skb = rx_ring->buffer_info[i].skb;
 		length = le16_to_cpu(rx_desc->length);
 
 		if (unlikely(!(rx_desc->status & IXGB_RX_DESC_STATUS_EOP))) {
@@ -1992,9 +1798,10 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter)
 
 			dev_kfree_skb_irq(skb);
 			rx_desc->status = 0;
-			rx_ring->buffer_info[i].skb = NULL;
-			i = (i + 1) % rx_ring->count;
-			rx_desc = IXGB_RX_DESC(*rx_ring, i);
+			buffer_info->skb = NULL;
+
+			rx_desc = next_rxd;
+			buffer_info = next_buffer;
 			continue;
 		}
 
@@ -2003,14 +1810,12 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter)
 				| IXGB_RX_DESC_ERRORS_P |
 				IXGB_RX_DESC_ERRORS_RXE))) {
 
-			IXGB_DBG("Receive Errors Reported by Hardware-%x.\n",
-				 rx_desc->errors);
-
 			dev_kfree_skb_irq(skb);
 			rx_desc->status = 0;
-			rx_ring->buffer_info[i].skb = NULL;
-			i = (i + 1) % rx_ring->count;
-			rx_desc = IXGB_RX_DESC(*rx_ring, i);
+			buffer_info->skb = NULL;
+
+			rx_desc = next_rxd;
+			buffer_info = next_buffer;
 			continue;
 		}
 
@@ -2021,53 +1826,63 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter)
 		ixgb_rx_checksum(adapter, rx_desc, skb);
 
 		skb->protocol = eth_type_trans(skb, netdev);
+#ifdef CONFIG_IXGB_NAPI
+		if (adapter->vlgrp
+		    && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) {
+			vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
+						 le16_to_cpu(rx_desc->
+							     special &
+							     IXGB_RX_DESC_SPECIAL_VLAN_MASK));
+		} else {
+			netif_receive_skb(skb);
+		}
+#else				/* CONFIG_IXGB_NAPI */
 		if (adapter->vlgrp
 		    && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) {
 			vlan_hwaccel_rx(skb, adapter->vlgrp,
-					(rx_desc->
-					 special &
-					 IXGB_RX_DESC_SPECIAL_VLAN_MASK));
+					le16_to_cpu(rx_desc->
+						    special &
+						    IXGB_RX_DESC_SPECIAL_VLAN_MASK));
 		} else {
 			netif_rx(skb);
 		}
-
+#endif				/* CONFIG_IXGB_NAPI */
 		netdev->last_rx = jiffies;
 
 		rx_desc->status = 0;
+		buffer_info->skb = NULL;
 
-		rx_ring->buffer_info[i].skb = NULL;
-		i = (i + 1) % rx_ring->count;
-
-		rx_desc = IXGB_RX_DESC(*rx_ring, i);
-	}			/* while */
+		rx_desc = next_rxd;
+		buffer_info = next_buffer;
+	}
 
 	rx_ring->next_to_clean = i;
 
 	ixgb_alloc_rx_buffers(adapter);
+
+	return cleaned;
 }
-#endif
 
 /**
- * ixgb_alloc_rx_buffers - Replace used receive buffers.
- * @param adapter address of board private structure
+ * ixgb_alloc_rx_buffers - Replace used receive buffers
+ * @adapter: address of board private structure
  **/
 
-static void
-ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
+static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
 {
 	struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
 	struct net_device *netdev = adapter->netdev;
 	struct pci_dev *pdev = adapter->pdev;
 	struct ixgb_rx_desc *rx_desc;
+	struct ixgb_buffer *buffer_info;
 	struct sk_buff *skb;
-	int reserve_len;
-	int i;
+	int reserve_len = 2;
+	unsigned int i;
 	int num_group_tail_writes;
 	long cleancount;
 
-	reserve_len = 2;
-
 	i = rx_ring->next_to_use;
+	buffer_info = &rx_ring->buffer_info[i];
 	cleancount = IXGB_DESC_UNUSED(rx_ring);
 
 	/* lessen this to 4 if we're
@@ -2080,14 +1895,13 @@ ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
 	while (--cleancount > 0) {
 		rx_desc = IXGB_RX_DESC(*rx_ring, i);
 
-		/* allocate a new one */
 		skb = dev_alloc_skb(adapter->rx_buffer_len + reserve_len);
 
 		if (unlikely(!skb)) {
-			/* better luck next time around */
-			IXGB_DBG("Could not allocate SKB\n");
+			/* Better luck next round */
 			break;
 		}
+
 		/* Make buffer alignment 2 beyond a 16 byte boundary
 		 * this will result in a 16 byte aligned IP header after
 		 * the 14 byte MAC header is removed
@@ -2096,24 +1910,28 @@ ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
 
 		skb->dev = netdev;
 
-		rx_ring->buffer_info[i].skb = skb;
-		rx_ring->buffer_info[i].length = adapter->rx_buffer_len;
-		rx_ring->buffer_info[i].dma =
-		    pci_map_single(pdev, skb->data, adapter->rx_buffer_len,
-				   PCI_DMA_FROMDEVICE);
+		buffer_info->skb = skb;
+		buffer_info->length = adapter->rx_buffer_len;
+		buffer_info->dma =
+		    pci_map_single(pdev,
+				   skb->data,
+				   adapter->rx_buffer_len, PCI_DMA_FROMDEVICE);
 
-		rx_desc->buff_addr = cpu_to_le64(rx_ring->buffer_info[i].dma);
+		rx_desc->buff_addr = cpu_to_le64(buffer_info->dma);
 
-		if (!(i % num_group_tail_writes)) {
+		if ((i & ~(num_group_tail_writes - 1)) == i) {
 			/* Force memory writes to complete before letting h/w
 			 * know there are new descriptors to fetch.  (Only
 			 * applicable for weak-ordered memory model archs,
 			 * such as IA-64). */
 			wmb();
-			/* move tail */
+
 			IXGB_WRITE_REG(&adapter->hw, RDT, i);
 		}
-		i = (i + 1) % rx_ring->count;
+
+		if (++i == rx_ring->count)
+			i = 0;
+		buffer_info = &rx_ring->buffer_info[i];
 	}
 
 	rx_ring->next_to_use = i;
@@ -2126,14 +1944,11 @@ ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
  * @param cmd ioctl command to execute
  **/
 
-int
-ixgb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+static int ixgb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 {
-
 	switch (cmd) {
 	case SIOCETHTOOL:
 		return ixgb_ethtool_ioctl(netdev, ifr);
-
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -2141,18 +1956,50 @@ ixgb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
 	return 0;
 }
 
+/**
+ * ixgb_rx_checksum - Receive Checksum Offload for 82597.
+ * @adapter: board private structure
+ * @rx_desc: receive descriptor
+ * @sk_buff: socket buffer with received data
+ **/
+
+static inline void
+ixgb_rx_checksum(struct ixgb_adapter *adapter,
+		 struct ixgb_rx_desc *rx_desc, struct sk_buff *skb)
+{
+	/* Ignore Checksum bit is set OR 
+	 * TCP Checksum has not been calculated 
+	 */
+	if ((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) ||
+	    (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) {
+		skb->ip_summed = CHECKSUM_NONE;
+		return;
+	}
+
+	/* At this point we know the hardware did the TCP checksum */
+	/* now look at the TCP checksum error bit */
+	if (rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) {
+		/* let the stack verify checksum errors */
+		skb->ip_summed = CHECKSUM_NONE;
+		adapter->hw_csum_rx_error++;
+	} else {
+		/* TCP checksum is good */
+		skb->ip_summed = CHECKSUM_UNNECESSARY;
+		adapter->hw_csum_rx_good++;
+	}
+}
+
 /**
  * ixgb_vlan_rx_register - enables or disables vlan tagging/stripping.
  * 
  * @param netdev network interface device structure
  * @param grp indicates to enable or disable tagging/stripping
  **/
-
 static void
 ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-	u32 ctrl, rctl;
+	uint32_t ctrl, rctl;
 
 	ixgb_irq_disable(adapter);
 	adapter->vlgrp = grp;
@@ -2164,17 +2011,20 @@ ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 		IXGB_WRITE_REG(&adapter->hw, CTRL0, ctrl);
 
 		/* enable VLAN receive filtering */
+
 		rctl = IXGB_READ_REG(&adapter->hw, RCTL);
 		rctl |= IXGB_RCTL_VFE;
 		rctl &= ~IXGB_RCTL_CFIEN;
 		IXGB_WRITE_REG(&adapter->hw, RCTL, rctl);
 	} else {
 		/* disable VLAN tag insert/strip */
+
 		ctrl = IXGB_READ_REG(&adapter->hw, CTRL0);
 		ctrl &= ~IXGB_CTRL0_VME;
 		IXGB_WRITE_REG(&adapter->hw, CTRL0, ctrl);
 
 		/* disable VLAN filtering */
+
 		rctl = IXGB_READ_REG(&adapter->hw, RCTL);
 		rctl &= ~IXGB_RCTL_VFE;
 		IXGB_WRITE_REG(&adapter->hw, RCTL, rctl);
@@ -2183,17 +2033,10 @@ ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 	ixgb_irq_enable(adapter);
 }
 
-/**
- * ixgb_vlan_rx_add_vid - adds a vlan id to be tagged/stripped in packet data.
- * @param netdev network interface device structure
- * @param vid the vlan to be added
- **/
-
-static void
-ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-	u32 vfta, index;
+	uint32_t vfta, index;
 
 	/* add VID to filter table */
 
@@ -2203,17 +2046,10 @@ ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
 	ixgb_write_vfta(&adapter->hw, index, vfta);
 }
 
-/**
- * ixgb_vlan_rx_kill_vid - removes a vlan id from tag/strip tables.
- * @param netdev network interface device structure
- * @param vid the vlan to be deleted
- **/
-
-static void
-ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
 {
 	struct ixgb_adapter *adapter = netdev->priv;
-	u32 vfta, index;
+	uint32_t vfta, index;
 
 	ixgb_irq_disable(adapter);
 
@@ -2230,17 +2066,12 @@ ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
 	ixgb_write_vfta(&adapter->hw, index, vfta);
 }
 
-/**
- * ixgb_restore_vlan - restores vlan settings after adapter reset.
- * @param adapter the address of the board private structure
- **/
-static void
-ixgb_restore_vlan(struct ixgb_adapter *adapter)
+static void ixgb_restore_vlan(struct ixgb_adapter *adapter)
 {
 	ixgb_vlan_rx_register(adapter->netdev, adapter->vlgrp);
 
 	if (adapter->vlgrp) {
-		u16 vid;
+		uint16_t vid;
 		for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
 			if (!adapter->vlgrp->vlan_devices[vid])
 				continue;
@@ -2249,55 +2080,6 @@ ixgb_restore_vlan(struct ixgb_adapter *adapter)
 	}
 }
 
-/**
- * ixgb_rx_checksum - Receive Checksum Offload for 82597.
- * @param adapter board private structure
- * @param rx_desc receive descriptor
- * @param skb socket buffer with received data
- **/
-
-static inline void
-ixgb_rx_checksum(struct ixgb_adapter *adapter,
-		 struct ixgb_rx_desc *rx_desc, struct sk_buff *skb)
-{
-	/* Ignore Checksum bit is set OR 
-	 * TCP Checksum has not been calculated 
-	 */
-	if ((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) ||
-	    (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) {
-		skb->ip_summed = CHECKSUM_NONE;
-		return;
-	}
-
-	/* At this point we know the hardware did the TCP checksum 
-	 * now look at the TCP checksum error bit
-	 */
-	if (rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) {
-		/* let the stack verify checksum errors */
-		skb->ip_summed = CHECKSUM_NONE;
-		adapter->hw_csum_rx_error++;
-	} else {
-		/* TCP checksum is good */
-		skb->ip_summed = CHECKSUM_UNNECESSARY;
-		adapter->hw_csum_rx_good++;
-	}
-}
-
-/**
- * ixgb_write_pci_cfg - write PCI configuration space.
- * @param hw board specific data structure
- * @param reg PCI configuration space register to write to
- * @param value Value to be written to reg
- **/
-
-void
-ixgb_write_pci_cfg(struct ixgb_hw *hw, u32 reg, u16 * value)
-{
-	struct ixgb_adapter *adapter = (struct ixgb_adapter *) hw->back;
-
-	pci_write_config_word(adapter->pdev, reg, *value);
-}
-
 /**
  * ixgb_notify_reboot - handles OS notification of reboot event.
  * @param nb notifier block, unused
@@ -2313,7 +2095,7 @@ ixgb_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
 	case SYS_DOWN:
 	case SYS_HALT:
 	case SYS_POWER_OFF:
-		while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+		while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
 			if (pci_dev_driver(pdev) == &ixgb_driver)
 				ixgb_suspend(pdev, 3);
 		}
@@ -2326,8 +2108,7 @@ ixgb_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
  * @param pdev pci driver structure used for passing to
  * @param state power state to enter 
  **/
-static int
-ixgb_suspend(struct pci_dev *pdev, u32 state)
+static int ixgb_suspend(struct pci_dev *pdev, uint32_t state)
 {
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct ixgb_adapter *adapter = netdev->priv;
@@ -2346,4 +2127,20 @@ ixgb_suspend(struct pci_dev *pdev, u32 state)
 	return 0;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+static void ixgb_netpoll(struct net_device *dev)
+{
+	struct ixgb_adapter *adapter = dev->priv;
+	disable_irq(adapter->pdev->irq);
+	ixgb_intr(adapter->pdev->irq, dev, NULL);
+	enable_irq(adapter->pdev->irq);
+}
+#endif
+
 /* ixgb_main.c */
diff --git a/drivers/net/ixgb/ixgb_osdep.h b/drivers/net/ixgb/ixgb_osdep.h
index 4d07e66b2..f1184e412 100644
--- a/drivers/net/ixgb/ixgb_osdep.h
+++ b/drivers/net/ixgb/ixgb_osdep.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,14 +23,15 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
-/* glue for the OS independant part of ixgb 
+/* glue for the OS independent part of ixgb
  * includes register access macros
  */
 
-#ifndef IXGB_OSDEP_H
-#define IXGB_OSDEP_H
+#ifndef _IXGB_OSDEP_H_
+#define _IXGB_OSDEP_H_
 
 #include <linux/types.h>
 #include <linux/pci.h>
@@ -39,35 +40,42 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 
-/* FIXME: eliminate me */
+#ifndef msec_delay
 #define msec_delay(x)	do { if(in_interrupt()) { \
-	                	mdelay(x); \
+				/* Don't mdelay in interrupt context! */ \
+	                	BUG(); \
 			} else { \
 				set_current_state(TASK_UNINTERRUPTIBLE); \
-				schedule_timeout((x * HZ)/1000); \
+				schedule_timeout((x * HZ)/1000 + 2); \
 			} } while(0)
+#endif
+
+#define PCI_COMMAND_REGISTER   PCI_COMMAND
+#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
 
 typedef enum {
+#undef FALSE
 	FALSE = 0,
+#undef TRUE
 	TRUE = 1
 } boolean_t;
 
+#undef ASSERT
+#define ASSERT(x)	if(!(x)) BUG()
 #define MSGOUT(S, A, B)	printk(KERN_DEBUG S "\n", A, B)
 
 #if DBG
-#define ASSERT(x)	if(!(x)) BUG()
-#define DEBUGOUT(S)		printk(KERN_ERR S "\n")
-#define DEBUGOUT1(S, A...)	printk(KERN_ERR S "\n", A)
+#define DEBUGOUT(S)		printk(KERN_DEBUG S "\n")
+#define DEBUGOUT1(S, A...)	printk(KERN_DEBUG S "\n", A)
 #else
-#define ASSERT(x)
 #define DEBUGOUT(S)
 #define DEBUGOUT1(S, A...)
 #endif
 
+#define DEBUGFUNC(F) DEBUGOUT(F)
 #define DEBUGOUT2 DEBUGOUT1
-#define DEBUGOUT3 DEBUGOUT1
-#define DEBUGOUT7 DEBUGOUT1
-#define DEBUGFUNC(F)        DEBUGOUT(F)
+#define DEBUGOUT3 DEBUGOUT2
+#define DEBUGOUT7 DEBUGOUT3
 
 #define IXGB_WRITE_REG(a, reg, value) ( \
     writel((value), ((a)->hw_addr + IXGB_##reg)))
@@ -81,4 +89,8 @@ typedef enum {
 #define IXGB_READ_REG_ARRAY(a, reg, offset) ( \
     readl((a)->hw_addr + IXGB_##reg + ((offset) << 2)))
 
-#endif				/* IXGB_OSDEP_H */
+#define IXGB_WRITE_FLUSH(a) IXGB_READ_REG(a, STATUS)
+
+#define IXGB_MEMCPY memcpy
+
+#endif				/* _IXGB_OSDEP_H_ */
diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index d86afcc34..9c66a259e 100644
--- a/drivers/net/ixgb/ixgb_param.c
+++ b/drivers/net/ixgb/ixgb_param.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
   
   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 
@@ -23,6 +23,7 @@
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
 *******************************************************************************/
 
 #include "ixgb.h"
@@ -31,11 +32,11 @@
  * maximum number of ports that the driver can manage.
  */
 
-#define IXGB_MAX_NIC			 8
+#define IXGB_MAX_NIC 8
 
-#define OPTION_UNSET			-1
-#define OPTION_DISABLED			 0
-#define OPTION_ENABLED			 1
+#define OPTION_UNSET    -1
+#define OPTION_DISABLED 0
+#define OPTION_ENABLED  1
 
 /* Module Parameters are always initialized to -1, so that the driver
  * can tell the difference between no user specified value or the
@@ -102,17 +103,14 @@ IXGB_PARAM(FlowControl, "Flow Control setting");
 
 IXGB_PARAM(XsumRX, "Disable or enable Receive Checksum offload");
 
-/* XsumTX - Transmit Checksum Offload Enable/Disable
+/* Transmit Interrupt Delay in units of 0.8192 microseconds
  *
- * Valid Range: 0, 1
- *  - 0 - disables all checksum offload
- *  - 1 - enables transmmit IP/TCP/UDP checksum offload
- *        on 82597 based NICs
+ * Valid Range: 0-65535
  *
- * Default Value: 1
+ * Default Value: 32
  */
 
-IXGB_PARAM(XsumTX, "Disable or enable Transmit Checksum offload");
+IXGB_PARAM(TxIntDelay, "Transmit Interrupt Delay");
 
 /* Receive Interrupt Delay in units of 0.8192 microseconds
  *
@@ -163,15 +161,6 @@ IXGB_PARAM(RxFCLowThresh, "Receive Flow Control Low Threshold");
 
 IXGB_PARAM(FCReqTimeout, "Flow Control Request Timeout");
 
-/* Transmit Interrupt Delay in units of 0.8192 microseconds
- *
- * Valid Range: 0-65535
- *
- * Default Value: 32
- */
-
-IXGB_PARAM(TxIntDelay, "Transmit Interrupt Delay");
-
 /* Interrupt Delay Enable
  *
  * Valid Range: 0, 1
@@ -187,25 +176,31 @@ IXGB_PARAM(IntDelayEnable, "Transmit Interrupt Delay Enable");
 #define DEFAULT_TXD			    256
 #define MAX_TXD				   4096
 #define MIN_TXD				     64
+
 #define DEFAULT_RXD			   1024
 #define MAX_RXD				   4096
 #define MIN_RXD				     64
-#define DEFAULT_TIDV			     32
-#define MAX_TIDV		         0xFFFF
+
+#define DEFAULT_TIDV	   		     32
+#define MAX_TIDV			 0xFFFF
 #define MIN_TIDV			      0
-#define DEFAULT_RDTR			     72
+
+#define DEFAULT_RDTR		   	     72
 #define MAX_RDTR			 0xFFFF
 #define MIN_RDTR			      0
+
 #define XSUMRX_DEFAULT		 OPTION_ENABLED
+
 #define FLOW_CONTROL_FULL	   ixgb_fc_full
 #define FLOW_CONTROL_DEFAULT  FLOW_CONTROL_FULL
-#define DEFAULT_FCRTL	    		0x28000
+#define DEFAULT_FCRTL	  		0x28000
 #define DEFAULT_FCRTH			0x30000
 #define MIN_FCRTL			      0
 #define MAX_FCRTL			0x3FFE8
 #define MIN_FCRTH			      8
 #define MAX_FCRTH			0x3FFF0
-#define DEFAULT_FCPAUSE		 	  0x100
+
+#define DEFAULT_FCPAUSE		  	0x100	/* this may be too long */
 #define MIN_FCPAUSE			      1
 #define MAX_FCPAUSE			 0xffff
 
@@ -215,11 +210,11 @@ struct ixgb_option {
 	char *err;
 	int def;
 	union {
-		struct {	/* range option information */
+		struct {	/* range_option info */
 			int min;
 			int max;
 		} r;
-		struct {	/* list option information */
+		struct {	/* list_option info */
 			int nr;
 			struct ixgb_opt_list {
 				int i;
@@ -229,8 +224,7 @@ struct ixgb_option {
 	} arg;
 };
 
-static int __devinit
-ixgb_validate_option(int *value, struct ixgb_option *opt)
+static int __devinit ixgb_validate_option(int *value, struct ixgb_option *opt)
 {
 	if (*value == OPTION_UNSET) {
 		*value = opt->def;
@@ -254,8 +248,7 @@ ixgb_validate_option(int *value, struct ixgb_option *opt)
 			return 0;
 		}
 		break;
-	case list_option:
-		{
+	case list_option:{
 			int i;
 			struct ixgb_opt_list *ent;
 
@@ -263,7 +256,7 @@ ixgb_validate_option(int *value, struct ixgb_option *opt)
 				ent = &opt->arg.l.p[i];
 				if (*value == ent->i) {
 					if (ent->str[0] != '\0')
-						printk(KERN_INFO "%s",
+						printk(KERN_INFO "%s\n",
 						       ent->str);
 					return 0;
 				}
@@ -274,8 +267,8 @@ ixgb_validate_option(int *value, struct ixgb_option *opt)
 		BUG();
 	}
 
-	printk(KERN_INFO "Invalid %s specified (%i) %s\n", opt->name, *value,
-	       opt->err);
+	printk(KERN_INFO "Invalid %s specified (%i) %s\n",
+	       opt->name, *value, opt->err);
 	*value = opt->def;
 	return -1;
 }
@@ -286,24 +279,20 @@ ixgb_validate_option(int *value, struct ixgb_option *opt)
  * ixgb_check_options - Range Checking for Command Line Parameters
  * @adapter: board private structure
  *
- * This routine checks all command line paramters for valid user
+ * This routine checks all command line parameters for valid user
  * input.  If an invalid value is given, or if no user specified
  * value exists, a default value is used.  The final value is stored
  * in a variable in the adapter structure.
  **/
 
-void __devinit
-ixgb_check_options(struct ixgb_adapter *adapter)
+void __devinit ixgb_check_options(struct ixgb_adapter *adapter)
 {
-	int board = adapter->bd_number;
-
-	IXGB_DBG("ixgb_check_options\n");
-
-	if (board >= IXGB_MAX_NIC) {
-		printk(KERN_NOTICE "Warning: no configuration for board #%i\n",
-		       board);
+	int bd = adapter->bd_number;
+	if (bd >= IXGB_MAX_NIC) {
+		printk(KERN_NOTICE
+		       "Warning: no configuration for board #%i\n", bd);
 		printk(KERN_NOTICE "Using defaults for all values\n");
-		board = IXGB_MAX_NIC;
+		bd = IXGB_MAX_NIC;
 	}
 
 	{			/* Transmit Descriptor Count */
@@ -312,63 +301,50 @@ ixgb_check_options(struct ixgb_adapter *adapter)
 			.name = "Transmit Descriptors",
 			.err = "using default of " __MODULE_STRING(DEFAULT_TXD),
 			.def = DEFAULT_TXD,
-			.arg = {.r = {.min = MIN_TXD,.max = MAX_TXD}}
+			.arg = {.r = {.min = MIN_TXD,
+				      .max = MAX_TXD}}
 		};
 		struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
 
-		tx_ring->count = TxDescriptors[board];
+		tx_ring->count = TxDescriptors[bd];
 		ixgb_validate_option(&tx_ring->count, &opt);
 		IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
 	}
-
 	{			/* Receive Descriptor Count */
 		struct ixgb_option opt = {
 			.type = range_option,
 			.name = "Receive Descriptors",
 			.err = "using default of " __MODULE_STRING(DEFAULT_RXD),
 			.def = DEFAULT_RXD,
-			.arg = {.r = {.min = MIN_RXD,.max = MAX_RXD}}
+			.arg = {.r = {.min = MIN_RXD,
+				      .max = MAX_RXD}}
 		};
 		struct ixgb_desc_ring *rx_ring = &adapter->rx_ring;
 
-		rx_ring->count = RxDescriptors[board];
+		rx_ring->count = RxDescriptors[bd];
 		ixgb_validate_option(&rx_ring->count, &opt);
 		IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
 	}
-
 	{			/* Receive Checksum Offload Enable */
 		struct ixgb_option opt = {
 			.type = enable_option,
 			.name = "Receive Checksum Offload",
 			.err = "defaulting to Enabled",
-			.def = OPTION_ENABLED,
+			.def = OPTION_ENABLED
 		};
-		int rx_csum = XsumRX[board];
 
+		int rx_csum = XsumRX[bd];
 		ixgb_validate_option(&rx_csum, &opt);
 		adapter->rx_csum = rx_csum;
 	}
-
-	{			/* Transmit Checksum Offload Enable */
-		struct ixgb_option opt = {
-			.type = enable_option,
-			.name = "Transmit Checksum Offload",
-			.err = "defaulting to Enabled",
-			.def = OPTION_ENABLED,
-		};
-		int tx_csum = XsumTX[board];
-
-		ixgb_validate_option(&tx_csum, &opt);
-		adapter->tx_csum = tx_csum;
-	}
-
 	{			/* Flow Control */
-		struct ixgb_opt_list fc_list[] = {
-			{ixgb_fc_none, "Flow Control Disabled\n"},
-			{ixgb_fc_rx_pause, "Flow Control Receive Only\n"},
-			{ixgb_fc_tx_pause, "Flow Control Transmit Only\n"},
-			{ixgb_fc_full, "Flow Control Enabled\n"},
-			{ixgb_fc_default, "Flow Control Hardware Default\n"}
+
+		struct ixgb_opt_list fc_list[] =
+		    { {ixgb_fc_none, "Flow Control Disabled"},
+		{ixgb_fc_rx_pause, "Flow Control Receive Only"},
+		{ixgb_fc_tx_pause, "Flow Control Transmit Only"},
+		{ixgb_fc_full, "Flow Control Enabled"},
+		{ixgb_fc_default, "Flow Control Hardware Default"}
 		};
 
 		struct ixgb_option opt = {
@@ -376,60 +352,63 @@ ixgb_check_options(struct ixgb_adapter *adapter)
 			.name = "Flow Control",
 			.err = "reading default settings from EEPROM",
 			.def = ixgb_fc_full,
-			.arg = {.l = {.nr = LIST_LEN(fc_list),.p = fc_list}}
+			.arg = {.l = {.nr = LIST_LEN(fc_list),
+				      .p = fc_list}}
 		};
 
-		int fc = FlowControl[board];
-
+		int fc = FlowControl[bd];
 		ixgb_validate_option(&fc, &opt);
 		adapter->hw.fc.type = fc;
 	}
 	{			/* Receive Flow Control High Threshold */
-		struct ixgb_option fcrth = {
+		struct ixgb_option opt = {
 			.type = range_option,
 			.name = "Rx Flow Control High Threshold",
 			.err =
 			    "using default of " __MODULE_STRING(DEFAULT_FCRTH),
 			.def = DEFAULT_FCRTH,
-			.arg = {.r = {.min = MIN_FCRTH,.max = MAX_FCRTH}}
+			.arg = {.r = {.min = MIN_FCRTH,
+				      .max = MAX_FCRTH}}
 		};
 
-		adapter->hw.fc.high_water = RxFCHighThresh[board];
-		ixgb_validate_option(&adapter->hw.fc.high_water, &fcrth);
+		adapter->hw.fc.high_water = RxFCHighThresh[bd];
+		ixgb_validate_option(&adapter->hw.fc.high_water, &opt);
 		if (!(adapter->hw.fc.type & ixgb_fc_rx_pause))
 			printk(KERN_INFO
 			       "Ignoring RxFCHighThresh when no RxFC\n");
 	}
 	{			/* Receive Flow Control Low Threshold */
-		struct ixgb_option fcrtl = {
+		struct ixgb_option opt = {
 			.type = range_option,
 			.name = "Rx Flow Control Low Threshold",
 			.err =
 			    "using default of " __MODULE_STRING(DEFAULT_FCRTL),
 			.def = DEFAULT_FCRTL,
-			.arg = {.r = {.min = MIN_FCRTL,.max = MAX_FCRTL}}
+			.arg = {.r = {.min = MIN_FCRTL,
+				      .max = MAX_FCRTL}}
 		};
 
-		adapter->hw.fc.low_water = RxFCLowThresh[board];
-		ixgb_validate_option(&adapter->hw.fc.low_water, &fcrtl);
+		adapter->hw.fc.low_water = RxFCLowThresh[bd];
+		ixgb_validate_option(&adapter->hw.fc.low_water, &opt);
 		if (!(adapter->hw.fc.type & ixgb_fc_rx_pause))
 			printk(KERN_INFO
 			       "Ignoring RxFCLowThresh when no RxFC\n");
 	}
 	{			/* Flow Control Pause Time Request */
-		struct ixgb_option fcpap = {
+		struct ixgb_option opt = {
 			.type = range_option,
 			.name = "Flow Control Pause Time Request",
 			.err =
 			    "using default of "
 			    __MODULE_STRING(DEFAULT_FCPAUSE),
 			.def = DEFAULT_FCPAUSE,
-			.arg = {.r = {.min = MIN_FCPAUSE,.max = MAX_FCPAUSE}}
+			.arg = {.r = {.min = MIN_FCPAUSE,
+				      .max = MAX_FCPAUSE}}
 		};
 
-		int pause_time = FCReqTimeout[board];
+		int pause_time = FCReqTimeout[bd];
 
-		ixgb_validate_option(&pause_time, &fcpap);
+		ixgb_validate_option(&pause_time, &opt);
 		if (!(adapter->hw.fc.type & ixgb_fc_rx_pause))
 			printk(KERN_INFO
 			       "Ignoring FCReqTimeout when no RxFC\n");
@@ -454,10 +433,11 @@ ixgb_check_options(struct ixgb_adapter *adapter)
 			.err =
 			    "using default of " __MODULE_STRING(DEFAULT_RDTR),
 			.def = DEFAULT_RDTR,
-			.arg = {.r = {.min = MIN_RDTR,.max = MAX_RDTR}}
+			.arg = {.r = {.min = MIN_RDTR,
+				      .max = MAX_RDTR}}
 		};
 
-		adapter->rx_int_delay = RxIntDelay[board];
+		adapter->rx_int_delay = RxIntDelay[bd];
 		ixgb_validate_option(&adapter->rx_int_delay, &opt);
 	}
 	{			/* Receive Interrupt Moderation */
@@ -465,14 +445,13 @@ ixgb_check_options(struct ixgb_adapter *adapter)
 			.type = enable_option,
 			.name = "Advanced Receive Interrupt Moderation",
 			.err = "defaulting to Enabled",
-			.def = OPTION_ENABLED,
+			.def = OPTION_ENABLED
 		};
-		int raidc = RAIDC[board];
+		int raidc = RAIDC[bd];
 
 		ixgb_validate_option(&raidc, &opt);
 		adapter->raidc = raidc;
 	}
-
 	{			/* Transmit Interrupt Delay */
 		struct ixgb_option opt = {
 			.type = range_option,
@@ -480,10 +459,11 @@ ixgb_check_options(struct ixgb_adapter *adapter)
 			.err =
 			    "using default of " __MODULE_STRING(DEFAULT_TIDV),
 			.def = DEFAULT_TIDV,
-			.arg = {.r = {.min = MIN_TIDV,.max = MAX_TIDV}}
+			.arg = {.r = {.min = MIN_TIDV,
+				      .max = MAX_TIDV}}
 		};
 
-		adapter->tx_int_delay = TxIntDelay[board];
+		adapter->tx_int_delay = TxIntDelay[bd];
 		ixgb_validate_option(&adapter->tx_int_delay, &opt);
 	}
 
@@ -492,9 +472,9 @@ ixgb_check_options(struct ixgb_adapter *adapter)
 			.type = enable_option,
 			.name = "Tx Interrupt Delay Enable",
 			.err = "defaulting to Enabled",
-			.def = OPTION_ENABLED,
+			.def = OPTION_ENABLED
 		};
-		int ide = IntDelayEnable[board];
+		int ide = IntDelayEnable[bd];
 
 		ixgb_validate_option(&ide, &opt);
 		adapter->tx_int_delay_enable = ide;
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index fc1f9e902..a39f7a7fc 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -37,6 +37,9 @@
 
     Get rid of check_region, check kmalloc return in lance_probe1
     Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 11/01/2001
+
+	Reworked detection, added support for Racal InterLan EtherBlaster cards
+	Vesselin Kostadinov <vesok at yahoo dot com > - 22/4/2004
 */
 
 static const char version[] = "lance.c:v1.15ac 1999/11/13 dplatt@3do.com, becker@cesdis.gsfc.nasa.gov\n";
@@ -62,6 +65,26 @@ static unsigned int lance_portlist[] __initdata = { 0x300, 0x320, 0x340, 0x360,
 static int lance_probe1(struct net_device *dev, int ioaddr, int irq, int options);
 static int __init do_lance_probe(struct net_device *dev);
 
+
+static struct card {
+	char id_offset14;
+	char id_offset15;
+} cards[] = {
+	{	//"normal"
+		.id_offset14 = 0x57,
+		.id_offset15 = 0x57,
+	},
+	{	//NI6510EB
+		.id_offset14 = 0x52,
+		.id_offset15 = 0x44,
+	},
+	{	//Racal InterLan EtherBlaster
+		.id_offset14 = 0x52,
+		.id_offset15 = 0x49,
+	},
+};
+#define NUM_CARDS 3
+
 #ifdef LANCE_DEBUG
 static int lance_debug = LANCE_DEBUG;
 #else
@@ -380,13 +403,20 @@ static int __init do_lance_probe(struct net_device *dev)
 							"lance-probe");
 
 		if (r) {
-			/* Detect "normal" 0x57 0x57 and the NI6510EB 0x52 0x44
-			   signatures w/ minimal I/O reads */
-			char offset15, offset14 = inb(ioaddr + 14);
-			
-			if ((offset14 == 0x52 || offset14 == 0x57) &&
-				((offset15 = inb(ioaddr + 15)) == 0x57 ||
-				 offset15 == 0x44)) {
+			/* Detect the card with minimal I/O reads */
+			char offset14 = inb(ioaddr + 14);
+			int card;
+			for (card = 0; card < NUM_CARDS; ++card)
+				if (cards[card].id_offset14 == offset14)
+					break;
+			if (card < NUM_CARDS) {/*yes, the first byte matches*/
+				char offset15 = inb(ioaddr + 15);
+				for (card = 0; card < NUM_CARDS; ++card)
+					if ((cards[card].id_offset14 == offset14) &&
+						(cards[card].id_offset15 == offset15))
+						break;
+			}
+			if (card < NUM_CARDS) { /*Signature OK*/
 				result = lance_probe1(dev, ioaddr, 0, 0);
 				if (!result) {
 					struct lance_private *lp = dev->priv;
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 9bae8d9ab..8c45911fe 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -1961,12 +1961,12 @@ static void set_rx_mode(struct net_device *dev)
 	spin_unlock_irq(&np->lock);
 }
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct netdev_private *np = dev->priv;
 	u32 cmd;
 
-	if (get_user(cmd, (u32 *)useraddr))
+	if (get_user(cmd, (u32 __user *)useraddr))
 		return -EFAULT;
 
 	switch (cmd) {
@@ -2417,11 +2417,11 @@ static int netdev_get_eeprom(struct net_device *dev, u8 *buf)
 
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 
 	switch(cmd) {
 	case SIOCETHTOOL:
-		return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return netdev_ethtool_ioctl(dev, rq->ifr_data);
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
 	case SIOCDEVPRIVATE:		/* for binary compat, remove in 2.5 */
 		data->phy_id = 1;
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ae97cd628..29c98d655 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -40,7 +40,6 @@
 #include <linux/module.h>
 #include <linux/console.h>
 #include <linux/tty_driver.h>
-#include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/string.h>
 #include <linux/sysrq.h>
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 41fc5f9df..0ff2d4223 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1190,7 +1190,7 @@ static struct net_device_stats *ns83820_get_stats(struct net_device *ndev)
 	return &dev->stats;
 }
 
-static int ns83820_ethtool_ioctl (struct ns83820 *dev, void *useraddr)
+static int ns83820_ethtool_ioctl (struct ns83820 *dev, void __user *useraddr)
 {
 	u32 ethcmd;
 
@@ -1236,7 +1236,7 @@ static int ns83820_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
 
 	switch(cmd) {
 	case SIOCETHTOOL:
-		return ns83820_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return ns83820_ethtool_ioctl(dev, rq->ifr_data);
 
 	default:
 		return -EOPNOTSUPP;
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 28d8b5342..238538660 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -1778,7 +1778,7 @@ static int netdrv_close (struct net_device *dev)
 static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct netdrv_private *tp = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	unsigned long flags;
 	int rc = 0;
 
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 47a102fd6..59d80ebbe 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -1196,7 +1196,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct el3_private *lp = netdev_priv(dev);
 	ioaddr_t ioaddr = dev->base_addr;
-	u16 *data = (u16 *)&rq->ifr_data;
+	u16 *data = (u16 *)&rq->ifr_ifru;
 	int phy = lp->phys & 0x1f;
 
 	DEBUG(2, "%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n",
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 67e1526df..ea5a88cf7 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -778,7 +778,7 @@ static struct ethtool_ops netdev_ethtool_ops = {
 static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
     axnet_dev_t *info = PRIV(dev);
-    u16 *data = (u16 *)&rq->ifr_data;
+    u16 *data = (u16 *)&rq->ifr_ifru;
     ioaddr_t mii_addr = dev->base_addr + AXNET_MII_EEP;
     switch (cmd) {
     case SIOCGMIIPHY:
@@ -937,7 +937,6 @@ module_exit(exit_axnet_cs);
 static const char *version_8390 =
     "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@scyld.com)\n";
 
-#include <asm/uaccess.h>
 #include <asm/bitops.h>
 #include <asm/irq.h>
 #include <linux/fcntl.h>
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index d073093dd..b53f5fcf5 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1281,7 +1281,7 @@ static struct ethtool_ops netdev_ethtool_ops = {
 static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
     pcnet_dev_t *info = PRIV(dev);
-    u16 *data = (u16 *)&rq->ifr_data;
+    u16 *data = (u16 *)&rq->ifr_ifru;
     ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
     switch (cmd) {
     case SIOCGMIIPHY:
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 13ed04f1b..7c1bd346e 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -2119,12 +2119,12 @@ static int smc_netdev_set_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
     return 0;
 }
 
-static int smc_ethtool_ioctl (struct net_device *dev, void *useraddr)
+static int smc_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
 {
     u32 ethcmd;
     struct smc_private *smc = netdev_priv(dev);
 
-    if (get_user(ethcmd, (u32 *)useraddr))
+    if (get_user(ethcmd, (u32 __user *)useraddr))
 	return -EFAULT;
 
     switch (ethcmd) {
@@ -2221,7 +2221,7 @@ static int smc_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
     u_short saved_bank;
     ioaddr_t ioaddr = dev->base_addr;
 
-    mii = (struct mii_ioctl_data *) &rq->ifr_data;
+    mii = if_mii(rq);
     if (!netif_running(dev))
     	return -EINVAL;
 
@@ -2229,7 +2229,7 @@ static int smc_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
     case SIOCETHTOOL:
 	saved_bank = inw(ioaddr + BANK_SELECT);
 	SMC_SELECT_BANK(3);
-	rc = smc_ethtool_ioctl(dev, (void *) rq->ifr_data);
+	rc = smc_ethtool_ioctl(dev, rq->ifr_data);
 	SMC_SELECT_BANK(saved_bank);
 	break;
 
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 5671f1234..d4cc26902 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -1681,7 +1681,7 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
     local_info_t *local = netdev_priv(dev);
     ioaddr_t ioaddr = dev->base_addr;
-    u16 *data = (u16 *)&rq->ifr_data;
+    u16 *data = (u16 *)&rq->ifr_ifru;
 
     DEBUG(1, "%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n",
 	  dev->name, rq->ifr_ifrn.ifrn_name, cmd,
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 515f1e2e5..bdf90d4e6 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -22,8 +22,8 @@
  *************************************************************************/
 
 #define DRV_NAME	"pcnet32"
-#define DRV_VERSION	"1.29"
-#define DRV_RELDATE	"04.06.2004"
+#define DRV_VERSION	"1.30c"
+#define DRV_RELDATE	"05.25.2004"
 #define PFX		DRV_NAME ": "
 
 static const char *version =
@@ -86,7 +86,7 @@ static int pcnet32vlb;	 /* check for VLB cards ? */
 
 static struct net_device *pcnet32_dev;
 
-static int max_interrupt_work = 80;
+static int max_interrupt_work = 2;
 static int rx_copybreak = 200;
 
 #define PCNET32_PORT_AUI      0x00
@@ -132,6 +132,8 @@ static const char pcnet32_gstrings_test[][ETH_GSTRING_LEN] = {
 };
 #define PCNET32_TEST_LEN (sizeof(pcnet32_gstrings_test) / ETH_GSTRING_LEN)
 
+#define PCNET32_NUM_REGS 168
+
 #define MAX_UNITS 8	/* More are supported, limit only on options */
 static int options[MAX_UNITS];
 static int full_duplex[MAX_UNITS];
@@ -234,7 +236,15 @@ static int full_duplex[MAX_UNITS];
  *	   Jim Lewis <jklewis@us.ibm.com> added ethernet loopback test.
  *	   Thomas Munck Steenholdt <tmus@tmus.dk> non-mii ioctl corrections.
  * v1.29   6 Apr 2004 Jim Lewis <jklewis@us.ibm.com> added physical
- *	   identification code (blink led's).
+ *	   identification code (blink led's) and register dump.
+ *	   Don Fry added timer for 971/972 so skbufs don't remain on tx ring
+ *	   forever.
+ * v1.30   18 May 2004 Don Fry removed timer and Last Transmit Interrupt
+ *	   (ltint) as they added complexity and didn't give good throughput.
+ * v1.30a  22 May 2004 Don Fry limit frames received during interrupt.
+ * v1.30b  24 May 2004 Don Fry fix bogus tx carrier errors with 79c973,
+ *	   assisted by Bruce Penrod <bmpenrod@endruntechnologies.com>.
+ * v1.30c  25 May 2004 Don Fry added netif_wake_queue after pcnet32_restart.
  */
 
 
@@ -339,7 +349,6 @@ struct pcnet32_private {
     char		tx_full;
     int			options;
     int	shared_irq:1,			/* shared irq possible */
-	ltint:1,			/* enable TxDone-intr inhibitor */
 	dxsuflo:1,			/* disable transmit stop on uflo */
 	mii:1;				/* mii port available */
     struct net_device	*next;
@@ -372,6 +381,9 @@ static void pcnet32_ethtool_test(struct net_device *dev,
 static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1);
 static int pcnet32_phys_id(struct net_device *dev, u32 data);
 static void pcnet32_led_blink_callback(struct net_device *dev);
+static int pcnet32_get_regs_len(struct net_device *dev);
+static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+	void *ptr);
 
 enum pci_flags_bit {
     PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
@@ -492,9 +504,9 @@ static struct pcnet32_access pcnet32_dwio = {
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void pcnet32_poll_controller(struct net_device *dev)
 {
-	disable_irq(dev->irq);
-	pcnet32_interrupt(0, dev, NULL);
-	enable_irq(dev->irq);
+    disable_irq(dev->irq);
+    pcnet32_interrupt(0, dev, NULL);
+    enable_irq(dev->irq);
 }
 #endif
 
@@ -681,7 +693,7 @@ static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1)
 	    for (i=0; i<6; i++)
 		*packet++ = dev->dev_addr[i];
 	    for (i=0; i<6; i++)
-		*packet++ = dev->dev_addr[i]; 
+		*packet++ = dev->dev_addr[i];
 	    /* type */
 	    *packet++ = 0x08;
 	    *packet++ = 0x06;
@@ -837,6 +849,82 @@ static int pcnet32_phys_id(struct net_device *dev, u32 data)
     return 0;
 }
 
+static int pcnet32_get_regs_len(struct net_device *dev)
+{
+    return(PCNET32_NUM_REGS * sizeof(u16));
+}
+
+static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+	void *ptr)
+{
+    int i, csr0;
+    u16 *buff = ptr;
+    struct pcnet32_private *lp = dev->priv;
+    struct pcnet32_access *a = &lp->a;
+    ulong ioaddr = dev->base_addr;
+    int ticks;
+    unsigned long flags;
+
+    spin_lock_irqsave(&lp->lock, flags);
+
+    csr0 = a->read_csr(ioaddr, 0);
+    if (!(csr0 & 0x0004)) {	/* If not stopped */
+	/* set SUSPEND (SPND) - CSR5 bit 0 */
+	a->write_csr(ioaddr, 5, 0x0001);
+
+	/* poll waiting for bit to be set */
+	ticks = 0;
+	while (!(a->read_csr(ioaddr, 5) & 0x0001)) {
+	    spin_unlock_irqrestore(&lp->lock, flags);
+	    mdelay(1);
+	    spin_lock_irqsave(&lp->lock, flags);
+	    ticks++;
+	    if (ticks > 200) {
+		if (netif_msg_hw(lp))
+		    printk(KERN_DEBUG "%s: Error getting into suspend!\n",
+			    dev->name);
+		break;
+	    }
+	}
+    }
+
+    /* read address PROM */
+    for (i=0; i<16; i += 2)
+	*buff++ = inw(ioaddr + i);
+
+    /* read control and status registers */
+    for (i=0; i<90; i++) {
+	*buff++ = a->read_csr(ioaddr, i);
+    }
+
+    *buff++ = a->read_csr(ioaddr, 112);
+    *buff++ = a->read_csr(ioaddr, 114);
+
+    /* read bus configuration registers */
+    for (i=0; i<36; i++) {
+	*buff++ = a->read_bcr(ioaddr, i);
+    }
+
+    /* read mii phy registers */
+    if (lp->mii) {
+	for (i=0; i<32; i++) {
+	    lp->a.write_bcr(ioaddr, 33, ((lp->mii_if.phy_id) << 5) | i);
+	    *buff++ = lp->a.read_bcr(ioaddr, 34);
+	}
+    }
+
+    if (!(csr0 & 0x0004)) {	/* If not stopped */
+	/* clear SUSPEND (SPND) - CSR5 bit 0 */
+	a->write_csr(ioaddr, 5, 0x0000);
+    }
+
+    i = buff - (u16 *)ptr;
+    for (; i < PCNET32_NUM_REGS; i++)
+	*buff++ = 0;
+
+    spin_unlock_irqrestore(&lp->lock, flags);
+}
+
 static struct ethtool_ops pcnet32_ethtool_ops = {
     .get_settings	= pcnet32_get_settings,
     .set_settings	= pcnet32_set_settings,
@@ -853,6 +941,8 @@ static struct ethtool_ops pcnet32_ethtool_ops = {
     .self_test_count	= pcnet32_self_test_count,
     .self_test		= pcnet32_ethtool_test,
     .phys_id		= pcnet32_phys_id,
+    .get_regs_len	= pcnet32_get_regs_len,
+    .get_regs		= pcnet32_get_regs,
 };
 
 /* only probes for non-PCI devices, the rest are handled by
@@ -924,7 +1014,7 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
     struct pcnet32_private *lp;
     dma_addr_t lp_dma_addr;
     int i, media;
-    int fdx, mii, fset, dxsuflo, ltint;
+    int fdx, mii, fset, dxsuflo;
     int chip_version;
     char *chipname;
     struct net_device *dev;
@@ -956,7 +1046,7 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
     }
 
     /* initialize variables */
-    fdx = mii = fset = dxsuflo = ltint = 0;
+    fdx = mii = fset = dxsuflo = 0;
     chip_version = (chip_version >> 12) & 0xffff;
 
     switch (chip_version) {
@@ -976,7 +1066,6 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
     case 0x2623:
 	chipname = "PCnet/FAST 79C971"; /* PCI */
 	fdx = 1; mii = 1; fset = 1;
-	ltint = 1;
 	break;
     case 0x2624:
 	chipname = "PCnet/FAST+ 79C972"; /* PCI */
@@ -1007,7 +1096,7 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
 	fdx = 1; mii = 1;
 	break;
     case 0x2628:
-	chipname = "PCnet/FAST III 79C976";
+	chipname = "PCnet/PRO 79C976";
 	fdx = 1; mii = 1;
 	break;
     default:
@@ -1029,7 +1118,6 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
 	a->write_bcr(ioaddr, 18, (a->read_bcr(ioaddr, 18) | 0x0860));
 	a->write_csr(ioaddr, 80, (a->read_csr(ioaddr, 80) & 0x0C00) | 0x0c00);
 	dxsuflo = 1;
-	ltint = 1;
     }
 
     dev = alloc_etherdev(0);
@@ -1136,7 +1224,6 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
     lp->mii_if.phy_id_mask = 0x1f;
     lp->mii_if.reg_num_mask = 0x1f;
     lp->dxsuflo = dxsuflo;
-    lp->ltint = ltint;
     lp->mii = mii;
     lp->msg_enable = pcnet32_debug;
     if ((cards_found >= MAX_UNITS) || (options[cards_found] > sizeof(options_mapping)))
@@ -1355,12 +1442,6 @@ pcnet32_open(struct net_device *dev)
     }
 #endif
 
-    if (lp->ltint) { /* Enable TxDone-intr inhibitor */
-	val = lp->a.read_csr (ioaddr, 5);
-	val |= (1<<14);
-	lp->a.write_csr (ioaddr, 5, val);
-    }
-
     lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7);
     pcnet32_load_multicast(dev);
 
@@ -1371,7 +1452,7 @@ pcnet32_open(struct net_device *dev)
 
     /* Re-initialize the PCNET32, and start it when done. */
     lp->a.write_csr (ioaddr, 1, (lp->dma_addr +
-	     offsetof(struct pcnet32_private, init_block)) & 0xffff);
+		offsetof(struct pcnet32_private, init_block)) & 0xffff);
     lp->a.write_csr (ioaddr, 2, (lp->dma_addr +
 		offsetof(struct pcnet32_private, init_block)) >> 16);
 
@@ -1553,12 +1634,16 @@ pcnet32_tx_timeout (struct net_device *dev)
 	   lp->cur_rx);
 	for (i = 0 ; i < RX_RING_SIZE; i++)
 	printk("%s %08x %04x %08x %04x", i & 1 ? "" : "\n ",
-	       lp->rx_ring[i].base, -lp->rx_ring[i].buf_length,
-	       lp->rx_ring[i].msg_length, (unsigned)lp->rx_ring[i].status);
+	       le32_to_cpu(lp->rx_ring[i].base),
+	       (-le16_to_cpu(lp->rx_ring[i].buf_length)) & 0xffff,
+	       le32_to_cpu(lp->rx_ring[i].msg_length),
+	       le16_to_cpu(lp->rx_ring[i].status));
 	for (i = 0 ; i < TX_RING_SIZE; i++)
 	printk("%s %08x %04x %08x %04x", i & 1 ? "" : "\n ",
-	       lp->tx_ring[i].base, -lp->tx_ring[i].length,
-	       lp->tx_ring[i].misc, (unsigned)lp->tx_ring[i].status);
+	       le32_to_cpu(lp->tx_ring[i].base),
+	       (-le16_to_cpu(lp->tx_ring[i].length)) & 0xffff,
+	       le32_to_cpu(lp->tx_ring[i].misc),
+	       le16_to_cpu(lp->tx_ring[i].status));
 	printk("\n");
     }
     pcnet32_restart(dev, 0x0042);
@@ -1579,30 +1664,17 @@ pcnet32_start_xmit(struct sk_buff *skb, struct net_device *dev)
     int entry;
     unsigned long flags;
 
+    spin_lock_irqsave(&lp->lock, flags);
+
     if (netif_msg_tx_queued(lp)) {
 	printk(KERN_DEBUG "%s: pcnet32_start_xmit() called, csr0 %4.4x.\n",
 	       dev->name, lp->a.read_csr(ioaddr, 0));
     }
 
-    spin_lock_irqsave(&lp->lock, flags);
-
     /* Default status -- will not enable Successful-TxDone
      * interrupt when that option is available to us.
      */
     status = 0x8300;
-    entry = (lp->cur_tx - lp->dirty_tx) & TX_RING_MOD_MASK;
-    if ((lp->ltint) &&
-	((entry == TX_RING_SIZE/3) ||
-	 (entry == (TX_RING_SIZE*2)/3) ||
-	 (entry >= TX_RING_SIZE-2)))
-    {
-	/* Enable Successful-TxDone interrupt if we have
-	 * 1/3, 2/3 or nearly all of, our ring buffer Tx'd
-	 * but not yet cleaned up.  Thus, most of the time,
-	 * we will not enable Successful-TxDone interrupts.
-	 */
-	status = 0x9300;
-    }
 
     /* Fill in a Tx ring entry */
 
@@ -1696,6 +1768,9 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 		    /* There was an major error, log it. */
 		    int err_status = le32_to_cpu(lp->tx_ring[entry].misc);
 		    lp->stats.tx_errors++;
+		    if (netif_msg_tx_err(lp))
+			printk(KERN_ERR "%s: Tx error status=%04x err_status=%08x\n",
+				dev->name, status, err_status);
 		    if (err_status & 0x04000000) lp->stats.tx_aborted_errors++;
 		    if (err_status & 0x08000000) lp->stats.tx_carrier_errors++;
 		    if (err_status & 0x10000000) lp->stats.tx_window_errors++;
@@ -1740,7 +1815,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	    }
 
 	    delta = (lp->cur_tx - dirty_tx) & (TX_RING_MOD_MASK + TX_RING_SIZE);
-	    if (delta >= TX_RING_SIZE) {
+	    if (delta > TX_RING_SIZE) {
 		if (netif_msg_drv(lp))
 		    printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n",
 			    dev->name, dirty_tx, lp->cur_tx, lp->tx_full);
@@ -1785,6 +1860,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	    /* stop the chip to clear the error condition, then restart */
 	    lp->a.write_csr (ioaddr, 0, 0x0004);
 	    pcnet32_restart(dev, 0x0002);
+	    netif_wake_queue(dev);
 	}
     }
 
@@ -1806,6 +1882,7 @@ pcnet32_rx(struct net_device *dev)
 {
     struct pcnet32_private *lp = dev->priv;
     int entry = lp->cur_rx & RX_RING_MOD_MASK;
+    int boguscnt = RX_RING_SIZE / 2;
 
     /* If we own the next entry, it's a new packet. Send it up. */
     while ((short)le16_to_cpu(lp->rx_ring[entry].status) >= 0) {
@@ -1872,6 +1949,7 @@ pcnet32_rx(struct net_device *dev)
 		    if (i > RX_RING_SIZE -2) {
 			lp->stats.rx_dropped++;
 			lp->rx_ring[entry].status |= le16_to_cpu(0x8000);
+			wmb();	/* Make sure adapter sees owner change */
 			lp->cur_rx++;
 		    }
 		    break;
@@ -1907,6 +1985,7 @@ pcnet32_rx(struct net_device *dev)
 	wmb(); /* Make sure owner changes after all others are visible */
 	lp->rx_ring[entry].status |= le16_to_cpu(0x8000);
 	entry = (++lp->cur_rx) & RX_RING_MOD_MASK;
+	if (--boguscnt <= 0) break;	/* don't stay in loop forever */
     }
 
     return 0;
@@ -1945,9 +2024,12 @@ pcnet32_close(struct net_device *dev)
 
     free_irq(dev->irq, dev);
 
+    spin_lock_irqsave(&lp->lock, flags);
+
     /* free all allocated skbuffs */
     for (i = 0; i < RX_RING_SIZE; i++) {
 	lp->rx_ring[i].status = 0;
+	wmb();		/* Make sure adapter sees owner change */
 	if (lp->rx_skbuff[i]) {
 	    pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2,
 		    PCI_DMA_FROMDEVICE);
@@ -1958,6 +2040,8 @@ pcnet32_close(struct net_device *dev)
     }
 
     for (i = 0; i < TX_RING_SIZE; i++) {
+	lp->tx_ring[i].status = 0;	/* CPU owns buffer */
+	wmb();		/* Make sure adapter sees owner change */
 	if (lp->tx_skbuff[i]) {
 	    pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i],
 		    lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
@@ -1967,6 +2051,8 @@ pcnet32_close(struct net_device *dev)
 	lp->tx_dma_addr[i] = 0;
     }
 
+    spin_unlock_irqrestore(&lp->lock, flags);
+
     return 0;
 }
 
@@ -2046,57 +2132,51 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
     }
 
     lp->a.write_csr (ioaddr, 0, 0x0004); /* Temporarily stop the lance. */
-
     pcnet32_restart(dev, 0x0042); /*  Resume normal operation */
+    netif_wake_queue(dev);
+
     spin_unlock_irqrestore(&lp->lock, flags);
 }
 
+/* This routine assumes that the lp->lock is held */
 static int mdio_read(struct net_device *dev, int phy_id, int reg_num)
 {
     struct pcnet32_private *lp = dev->priv;
     unsigned long ioaddr = dev->base_addr;
     u16 val_out;
-    int phyaddr;
 
     if (!lp->mii)
 	return 0;
 
-    phyaddr = lp->a.read_bcr(ioaddr, 33);
-
     lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
     val_out = lp->a.read_bcr(ioaddr, 34);
-    lp->a.write_bcr(ioaddr, 33, phyaddr);
 
     return val_out;
 }
 
+/* This routine assumes that the lp->lock is held */
 static void mdio_write(struct net_device *dev, int phy_id, int reg_num, int val)
 {
     struct pcnet32_private *lp = dev->priv;
     unsigned long ioaddr = dev->base_addr;
-    int phyaddr;
 
     if (!lp->mii)
 	return;
 
-    phyaddr = lp->a.read_bcr(ioaddr, 33);
-
     lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
     lp->a.write_bcr(ioaddr, 34, val);
-    lp->a.write_bcr(ioaddr, 33, phyaddr);
 }
 
 static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
     struct pcnet32_private *lp = dev->priv;
-    struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
     int rc;
     unsigned long flags;
 
     /* SIOC[GS]MIIxxx ioctls */
     if (lp->mii) {
 	spin_lock_irqsave(&lp->lock, flags);
-	rc = generic_mii_ioctl(&lp->mii_if, data, cmd, NULL);
+	rc = generic_mii_ioctl(&lp->mii_if, if_mii(rq), cmd, NULL);
 	spin_unlock_irqrestore(&lp->lock, flags);
     } else {
 	rc = -EOPNOTSUPP;
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index 4b8256c64..43f923c96 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -1217,7 +1217,10 @@ static int
 plip_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct net_local *nl = netdev_priv(dev);
-	struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
+	struct plipconf *pc = (struct plipconf *) &rq->ifr_ifru;
+
+	if (cmd != SIOCDEVPLIP)
+		return -EOPNOTSUPP;
 
 	switch(pc->pcmd) {
 	case PLIP_GET_TIMEOUT:
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 338f2cde7..0394ee0ad 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -205,10 +205,10 @@ ppp_asynctty_close(struct tty_struct *tty)
 {
 	struct asyncppp *ap;
 
-	write_lock(&disc_data_lock);
+	write_lock_irq(&disc_data_lock);
 	ap = tty->disc_data;
 	tty->disc_data = 0;
-	write_unlock(&disc_data_lock);
+	write_unlock_irq(&disc_data_lock);
 	if (ap == 0)
 		return;
 
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index fc93451e6..0e1e057a8 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -251,10 +251,10 @@ ppp_sync_close(struct tty_struct *tty)
 {
 	struct syncppp *ap;
 
-	write_lock(&disc_data_lock);
+	write_lock_irq(&disc_data_lock);
 	ap = tty->disc_data;
 	tty->disc_data = 0;
-	write_unlock(&disc_data_lock);
+	write_unlock_irq(&disc_data_lock);
 	if (ap == 0)
 		return;
 
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 6f1eb3006..0e270770c 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1156,7 +1156,7 @@ rtl8169_hw_start(struct net_device *dev)
 
 static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
 {
-	desc->addr = 0x0badbadbadbadbad;
+	desc->addr = 0x0badbadbadbadbadull;
 	desc->status &= ~cpu_to_le32(OWNbit | RsvdMask);
 }
 
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index a6d09dd83..d77314518 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -1715,7 +1715,7 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		return error;
 		
 	case SIOCRRID:
-		return put_user(0x52523032, (int *)(&rq->ifr_data[0]));
+		return put_user(0x52523032, (int __user *)rq->ifr_data);
 	default:
 		return error;
 	}
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 022e32246..14dc145e0 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -99,45 +99,45 @@ static char s2io_gstrings[][ETH_GSTRING_LEN] = {
 };
 
 static char ethtool_stats_keys[][ETH_GSTRING_LEN] = {
-	{"tmac_frms"},
-	{"tmac_data_octets"},
-	{"tmac_drop_frms"},
-	{"tmac_mcst_frms"},
-	{"tmac_bcst_frms"},
-	{"tmac_pause_ctrl_frms"},
-	{"tmac_any_err_frms"},
-	{"tmac_vld_ip_octets"},
-	{"tmac_vld_ip"},
-	{"tmac_drop_ip"},
-	{"tmac_icmp"},
-	{"tmac_rst_tcp"},
-	{"tmac_tcp"},
-	{"tmac_udp"},
-	{"rmac_vld_frms"},
-	{"rmac_data_octets"},
-	{"rmac_fcs_err_frms"},
-	{"rmac_drop_frms"},
-	{"rmac_vld_mcst_frms"},
-	{"rmac_vld_bcst_frms"},
-	{"rmac_in_rng_len_err_frms"},
-	{"rmac_long_frms"},
-	{"rmac_pause_ctrl_frms"},
-	{"rmac_discarded_frms"},
-	{"rmac_usized_frms"},
-	{"rmac_osized_frms"},
-	{"rmac_frag_frms"},
-	{"rmac_jabber_frms"},
-	{"rmac_ip"},
-	{"rmac_ip_octets"},
-	{"rmac_hdr_err_ip"},
-	{"rmac_drop_ip"},
-	{"rmac_icmp"},
-	{"rmac_tcp"},
-	{"rmac_udp"},
-	{"rmac_err_drp_udp"},
-	{"rmac_pause_cnt"},
-	{"rmac_accepted_ip"},
-	{"rmac_err_tcp"},
+	"tmac_frms",
+	"tmac_data_octets",
+	"tmac_drop_frms",
+	"tmac_mcst_frms",
+	"tmac_bcst_frms",
+	"tmac_pause_ctrl_frms",
+	"tmac_any_err_frms",
+	"tmac_vld_ip_octets",
+	"tmac_vld_ip",
+	"tmac_drop_ip",
+	"tmac_icmp",
+	"tmac_rst_tcp",
+	"tmac_tcp",
+	"tmac_udp",
+	"rmac_vld_frms",
+	"rmac_data_octets",
+	"rmac_fcs_err_frms",
+	"rmac_drop_frms",
+	"rmac_vld_mcst_frms",
+	"rmac_vld_bcst_frms",
+	"rmac_in_rng_len_err_frms",
+	"rmac_long_frms",
+	"rmac_pause_ctrl_frms",
+	"rmac_discarded_frms",
+	"rmac_usized_frms",
+	"rmac_osized_frms",
+	"rmac_frag_frms",
+	"rmac_jabber_frms",
+	"rmac_ip",
+	"rmac_ip_octets",
+	"rmac_hdr_err_ip",
+	"rmac_drop_ip",
+	"rmac_icmp",
+	"rmac_tcp",
+	"rmac_udp",
+	"rmac_err_drp_udp",
+	"rmac_pause_cnt",
+	"rmac_accepted_ip",
+	"rmac_err_tcp",
 };
 
 #define S2IO_STAT_LEN sizeof(ethtool_stats_keys)/ ETH_GSTRING_LEN
@@ -238,7 +238,7 @@ static struct pci_driver s2io_driver = {
       name:"S2IO",
       id_table:s2io_tbl,
       probe:s2io_init_nic,
-      remove:s2io_rem_nic,
+      remove:__devexit_p(s2io_rem_nic),
 };
 
 /*  
@@ -2339,9 +2339,6 @@ static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs)
 	struct net_device *dev = (struct net_device *) dev_id;
 	nic_t *sp = dev->priv;
 	XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0;
-#ifndef CONFIG_S2IO_NAPI
-	int i, ret;
-#endif
 	u64 reason = 0, general_mask = 0;
 	mac_info_t *mac_control;
 	struct config_param *config;
@@ -4358,7 +4355,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
 *  and free up all resource held up by the device. This could be in response 
 *  to a Hot plug event or when the driver is to be removed from memory.
 */
-static void __exit s2io_rem_nic(struct pci_dev *pdev)
+static void __devexit s2io_rem_nic(struct pci_dev *pdev)
 {
 	struct net_device *dev =
 	    (struct net_device *) pci_get_drvdata(pdev);
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 31035dbfc..41cb60f55 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -825,7 +825,7 @@ static inline void writeq(u64 val, void *addr)
  */
 static int __devinit s2io_init_nic(struct pci_dev *pdev,
 				   const struct pci_device_id *pre);
-static void __exit s2io_rem_nic(struct pci_dev *pdev);
+static void __devexit s2io_rem_nic(struct pci_dev *pdev);
 static int initSharedMem(struct s2io_nic *sp);
 static void freeSharedMem(struct s2io_nic *sp);
 static int initNic(struct s2io_nic *nic);
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index 32b5b9222..8ac2d8109 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -49,6 +49,7 @@ static char version[] = "sb1000.c:v1.1.2 6/01/98 (fventuri@mediaone.net)\n";
 #include <linux/delay.h>	/* for udelay() */
 #include <linux/etherdevice.h>
 #include <linux/pnp.h>
+#include <linux/init.h>
 
 #include <asm/bitops.h>
 #include <asm/io.h>
@@ -1030,14 +1031,14 @@ static int sb1000_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	case SIOCGCMFREQUENCY:		/* get frequency */
 		if ((status = sb1000_get_frequency(ioaddr, name, &frequency)))
 			return status;
-		if(put_user(frequency, (int*) ifr->ifr_data))
+		if(put_user(frequency, (int __user *) ifr->ifr_data))
 			return -EFAULT;
 		break;
 
 	case SIOCSCMFREQUENCY:		/* set frequency */
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
-		if(get_user(frequency, (int*) ifr->ifr_data))
+		if(get_user(frequency, (int __user *) ifr->ifr_data))
 			return -EFAULT;
 		if ((status = sb1000_set_frequency(ioaddr, name, frequency)))
 			return status;
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index 0b15d6513..7914167ac 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -2721,7 +2721,7 @@ static void sbmac_set_rx_mode(struct net_device *dev)
 static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct sbmac_softc *sc = netdev_priv(dev);
-	u16 *data = (u16 *)&rq->ifr_data;
+	u16 *data = (u16 *)&rq->ifr_ifru;
 	unsigned long flags;
 	int retval;
 	
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
index 9352fc63c..2351e186a 100644
--- a/drivers/net/shaper.c
+++ b/drivers/net/shaper.c
@@ -579,7 +579,7 @@ static int shaper_attach(struct net_device *shdev, struct shaper *sh, struct net
 
 static int shaper_ioctl(struct net_device *dev,  struct ifreq *ifr, int cmd)
 {
-	struct shaperconf *ss= (struct shaperconf *)&ifr->ifr_data;
+	struct shaperconf *ss= (struct shaperconf *)&ifr->ifr_ifru;
 	struct shaper *sh=dev->priv;
 	
 	if(ss->ss_cmd == SHAPER_SET_DEV || ss->ss_cmd == SHAPER_SET_SPEED)
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 4b6ea4b45..aa045b62c 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -260,9 +260,13 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, struct net_d
 	u8 reg;
 	int i;
 
-	if ((isa_bridge = pci_find_device(0x1039, 0x0008, isa_bridge)) == NULL) {
-		printk("%s: Can not find ISA bridge\n", net_dev->name);
-		return 0;
+	isa_bridge = pci_find_device(PCI_VENDOR_ID_SI, 0x0008, isa_bridge);
+	if (!isa_bridge) {
+		isa_bridge = pci_find_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge);
+		if (!isa_bridge) {
+			printk("%s: Can not find ISA bridge\n", net_dev->name);
+			return 0;
+		}
 	}
 	pci_read_config_byte(isa_bridge, 0x48, &reg);
 	pci_write_config_byte(isa_bridge, 0x48, reg | 0x40);
@@ -1889,7 +1893,7 @@ static struct ethtool_ops sis900_ethtool_ops = {
 static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
 {
 	struct sis900_private *sis_priv = net_dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 
 	switch(cmd) {
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
@@ -2195,6 +2199,7 @@ static int sis900_suspend(struct pci_dev *pci_dev, u32 state)
 		return 0;
 
 	netif_stop_queue(net_dev);
+	netif_device_detach(net_dev);
 
 	/* Stop the chip's Tx and Rx Status Machine */
 	outl(RxDIS | TxDIS | inl(ioaddr + cr), ioaddr + cr);
diff --git a/drivers/net/sis900.h b/drivers/net/sis900.h
index 763c7a39b..de3c06735 100644
--- a/drivers/net/sis900.h
+++ b/drivers/net/sis900.h
@@ -77,7 +77,7 @@ enum sis900_interrupt_enable_reigster_bits {
 	IE = 0x00000001
 };
 
-/* maximum dma burst fro transmission and receive*/
+/* maximum dma burst for transmission and receive */
 #define MAX_DMA_RANGE	7	/* actually 0 means MAXIMUM !! */
 #define TxMXDMA_shift   	20
 #define RxMXDMA_shift    20
@@ -86,7 +86,7 @@ enum sis900_tx_rx_dma{
 	DMA_BURST_512 = 0,	DMA_BURST_64 = 5
 };
 
-/* transmit FIFO threshholds */
+/* transmit FIFO thresholds */
 #define TX_FILL_THRESH   16	/* 1/4 FIFO size */
 #define TxFILLT_shift   	8
 #define TxDRNT_shift    	0
@@ -140,7 +140,7 @@ enum sis96x_eeprom_command {
 	EEREQ = 0x00000400, EEDONE = 0x00000200, EEGNT = 0x00000100
 };
 
-/* Manamgement Data I/O (mdio) frame */
+/* Management Data I/O (mdio) frame */
 #define MIIread         0x6000
 #define MIIwrite        0x5002
 #define MIIpmdShift     7
diff --git a/drivers/net/sk98lin/skvpd.c b/drivers/net/sk98lin/skvpd.c
index adf26b626..83ac42c82 100644
--- a/drivers/net/sk98lin/skvpd.c
+++ b/drivers/net/sk98lin/skvpd.c
@@ -468,6 +468,17 @@ SK_IOC	IoC)	/* IO Context */
 	
 	pAC->vpd.vpd_size = vpd_size;
 
+	/* Asus K8V Se Deluxe bugfix. Correct VPD content */
+	/* MBo April 2004 */
+	if (((unsigned char)pAC->vpd.vpd_buf[0x3f] == 0x38) &&
+	    ((unsigned char)pAC->vpd.vpd_buf[0x40] == 0x3c) &&
+	    ((unsigned char)pAC->vpd.vpd_buf[0x41] == 0x45)) {
+		printk("sk98lin: Asus mainboard with buggy VPD? "
+				"Correcting data.\n");
+		pAC->vpd.vpd_buf[0x40] = 0x38;
+	}
+
+
 	/* find the end tag of the RO area */
 	if (!(r = vpd_find_para(pAC, VPD_RV, &rp))) {
 		SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR | SK_DBGCAT_FATAL,
diff --git a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c
index 2d0d92954..2039f2233 100644
--- a/drivers/net/sk_mca.c
+++ b/drivers/net/sk_mca.c
@@ -4,7 +4,8 @@ net-3-driver for the SKNET MCA-based cards
 This is an extension to the Linux operating system, and is covered by the
 same GNU General Public License that covers that work.
 
-Copyright 1999 by Alfred Arnold (alfred@ccac.rwth-aachen.de, aarnold@elsa.de)
+Copyright 1999 by Alfred Arnold (alfred@ccac.rwth-aachen.de,
+                                 alfred.arnold@lancom.de)
 
 This driver is based both on the 3C523 driver and the SK_G16 driver.
 
diff --git a/drivers/net/sk_mca.h b/drivers/net/sk_mca.h
index da43d5bcd..acf21be7b 100644
--- a/drivers/net/sk_mca.h
+++ b/drivers/net/sk_mca.h
@@ -100,7 +100,7 @@ typedef struct {
 #define CSR3_ALE_HIGH      0	/* Bit 1 = 0 -> ALE asserted high    */
 #define CSR3_ALE_LOW       2	/* Bit 1 = 1 -> ALE asserted low     */
 #define CSR3_BSWAP_OFF     0	/* Bit 2 = 0 -> no byte swap         */
-#define CSR3_BSWAP_ON      0	/* Bit 2 = 1 -> byte swap            */
+#define CSR3_BSWAP_ON      4	/* Bit 2 = 1 -> byte swap            */
 
 /* LANCE structures */
 
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index e783ac0fa..a8967112f 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -1138,6 +1138,7 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 {
 	struct slip *sl = (struct slip *) tty->disc_data;
 	unsigned int tmp;
+	int __user *p = (int __user *)arg;
 
 	/* First make sure we're connected. */
 	if (!sl || sl->magic != SLIP_MAGIC) {
@@ -1147,17 +1148,17 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 	switch(cmd) {
 	 case SIOCGIFNAME:
 		tmp = strlen(sl->dev->name) + 1;
-		if (copy_to_user((void *)arg, sl->dev->name, tmp))
+		if (copy_to_user((void __user *)arg, sl->dev->name, tmp))
 			return -EFAULT;
 		return 0;
 
 	case SIOCGIFENCAP:
-		if (put_user(sl->mode, (int *)arg))
+		if (put_user(sl->mode, p))
 			return -EFAULT;
 		return 0;
 
 	case SIOCSIFENCAP:
-		if (get_user(tmp,(int *)arg))
+		if (get_user(tmp, p))
 			return -EFAULT;
 #ifndef SL_INCLUDE_CSLIP
 		if (tmp & (SL_MODE_CSLIP|SL_MODE_ADAPTIVE))  {
@@ -1185,7 +1186,7 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 #ifdef CONFIG_SLIP_SMART
 	/* VSV changes start here */
         case SIOCSKEEPALIVE:
-		if (get_user(tmp,(int *)arg))
+		if (get_user(tmp, p))
 			return -EFAULT;
                 if (tmp > 255) /* max for unchar */
 			return -EINVAL;
@@ -1205,12 +1206,12 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 		return 0;
 
         case SIOCGKEEPALIVE:
-		if (put_user(sl->keepalive, (int *)arg))
+		if (put_user(sl->keepalive, p))
 			return -EFAULT;
 		return 0;
 
         case SIOCSOUTFILL:
-		if (get_user(tmp,(int *)arg))
+		if (get_user(tmp, p))
 			return -EFAULT;
                 if (tmp > 255) /* max for unchar */
 			return -EINVAL;
@@ -1229,7 +1230,7 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
                 return 0;
 
         case SIOCGOUTFILL:
-		if (put_user(sl->outfill, (int *)arg))
+		if (put_user(sl->outfill, p))
 			return -EFAULT;
 		return 0;
 	/* VSV changes end */
@@ -1254,6 +1255,7 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
 {
 	struct slip *sl = (struct slip*)(dev->priv);
+	unsigned long *p = (unsigned long *)&rq->ifr_ifru;
 
 	if (sl == NULL)		/* Allocation failed ?? */
 		return -ENODEV;
@@ -1268,11 +1270,11 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
 	switch(cmd){
         case SIOCSKEEPALIVE:
 		/* max for unchar */
-                if (((unsigned int)((unsigned long)rq->ifr_data)) > 255) {
+                if ((unsigned)*p > 255) {
 			spin_unlock_bh(&sl->lock);
 			return -EINVAL;
 		}
-		sl->keepalive = (unchar) ((unsigned long)rq->ifr_data);
+		sl->keepalive = (unchar) *p;
 		if (sl->keepalive != 0) {
 			sl->keepalive_timer.expires=jiffies+sl->keepalive*HZ;
 			mod_timer(&sl->keepalive_timer, jiffies+sl->keepalive*HZ);
@@ -1283,15 +1285,15 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
 		break;
 
         case SIOCGKEEPALIVE:
-		rq->ifr_data=(caddr_t)((unsigned long)sl->keepalive);
+		*p = sl->keepalive;
 		break;
 
         case SIOCSOUTFILL:
-                if (((unsigned)((unsigned long)rq->ifr_data)) > 255) { /* max for unchar */
+                if ((unsigned)*p > 255) { /* max for unchar */
 			spin_unlock_bh(&sl->lock);
 			return -EINVAL;
 		}
-                if ((sl->outfill = (unchar)((unsigned long) rq->ifr_data)) != 0){
+                if ((sl->outfill = (unchar)*p) != 0){
 			mod_timer(&sl->outfill_timer, jiffies+sl->outfill*HZ);
 			set_bit(SLF_OUTWAIT, &sl->flags);
 		} else {
@@ -1300,7 +1302,7 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
                 break;
 
         case SIOCGOUTFILL:
-		rq->ifr_data=(caddr_t)((unsigned long)sl->outfill);
+		*p = sl->outfill;
 		break;
 
         case SIOCSLEASE:
@@ -1312,12 +1314,12 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
 			return -EPERM;
 		}
 		sl->leased = 0;
-                if ((unsigned long)rq->ifr_data)
+                if (*p)
 			sl->leased = 1;
                 break;
 
         case SIOCGLEASE:
-		rq->ifr_data=(caddr_t)((unsigned long)sl->leased);
+		*p = sl->leased;
 	};
 	spin_unlock_bh(&sl->lock);
 	return 0;
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 9b47edbd9..0eb660aa7 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1997,7 +1997,7 @@ static void set_rx_mode(struct net_device *dev)
 }
 
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct ethtool_cmd ecmd;
 	struct netdev_private *np = dev->priv;
@@ -2079,16 +2079,16 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct netdev_private *np = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
 	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
 	if (cmd == SIOCETHTOOL)
-		rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
 
 	else {
+		struct mii_ioctl_data *data = if_mii(rq);
 		spin_lock_irq(&np->lock);
 		rc = generic_mii_ioctl(&np->mii_if, data, cmd, NULL);
 		spin_unlock_irq(&np->lock);
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 838c9c50a..e5069fca1 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1576,7 +1576,7 @@ static int __set_mac_addr(struct net_device *dev)
 }
 	
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct netdev_private *np = dev->priv;
 	u32 ethcmd;
@@ -1659,7 +1659,6 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct netdev_private *np = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
 	int rc;
 	int i;
 	long ioaddr = dev->base_addr;
@@ -1668,11 +1667,11 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		return -EINVAL;
 
 	if (cmd == SIOCETHTOOL)
-		rc = netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		rc = netdev_ethtool_ioctl(dev, rq->ifr_data);
 
 	else {
 		spin_lock_irq(&np->lock);
-		rc = generic_mii_ioctl(&np->mii_if, data, cmd, NULL);
+		rc = generic_mii_ioctl(&np->mii_if, if_mii(rq), cmd, NULL);
 		spin_unlock_irq(&np->lock);
 	}
 	switch (cmd) {
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 36ddb6d84..cb890cd3e 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2510,7 +2510,7 @@ static struct ethtool_ops gem_ethtool_ops = {
 static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	struct gem *gp = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
+	struct mii_ioctl_data *data = if_mii(ifr);
 	int rc = -EOPNOTSUPP;
 	
 	/* Hold the PM semaphore while doing ioctl's or we may collide
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index d3da9cea9..6b2a16825 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -56,8 +56,8 @@
 
 #define DRV_MODULE_NAME		"tg3"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"3.3"
-#define DRV_MODULE_RELDATE	"April 27, 2004"
+#define DRV_MODULE_VERSION	"3.6"
+#define DRV_MODULE_RELDATE	"June 12, 2004"
 
 #define TG3_DEF_MAC_MODE	0
 #define TG3_DEF_RX_MODE		0
@@ -80,7 +80,8 @@
 /* hardware minimum and maximum for a single frame's data payload */
 #define TG3_MIN_MTU			60
 #define TG3_MAX_MTU(tp)	\
-	(GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 ? 9000 : 1500)
+	((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 && \
+	  GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) ? 9000 : 1500)
 
 /* These numbers seem to be hard coded in the NIC firmware somehow.
  * You can't change the ring sizes, but you can change where you place
@@ -98,7 +99,8 @@
  * replace things like '% foo' with '& (foo - 1)'.
  */
 #define TG3_RX_RCB_RING_SIZE(tp)	\
-	(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ? \
+	((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 || \
+	  GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) ? \
 	 512 : 1024)
 
 #define TG3_TX_RING_SIZE		512
@@ -126,7 +128,8 @@
 /* minimum number of free TX descriptors required to wake up TX process */
 #define TG3_TX_WAKEUP_THRESH		(TG3_TX_RING_SIZE / 4)
 
-#define TG3_NUM_STATS		25	/* number of ETHTOOL_GSTATS u64's */
+/* number of ETHTOOL_GSTATS u64's */
+#define TG3_NUM_STATS		(sizeof(struct tg3_ethtool_stats)/sizeof(u64))
 
 static char version[] __devinitdata =
 	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -174,6 +177,8 @@ static struct pci_device_id tg3_pci_tbl[] = {
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5788,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5789,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901_2,
@@ -182,6 +187,20 @@ static struct pci_device_id tg3_pci_tbl[] = {
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5705F,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5720,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5721,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750M,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751M,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751F,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 	{ PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX,
@@ -204,10 +223,13 @@ MODULE_DEVICE_TABLE(pci, tg3_pci_tbl);
 struct {
 	char string[ETH_GSTRING_LEN];
 } ethtool_stats_keys[TG3_NUM_STATS] = {
+	{ "rx_octets" },
 	{ "rx_fragments" },
 	{ "rx_ucast_packets" },
+	{ "rx_mcast_packets" },
 	{ "rx_bcast_packets" },
 	{ "rx_fcs_errors" },
+	{ "rx_align_errors" },
 	{ "rx_xon_pause_rcvd" },
 	{ "rx_xoff_pause_rcvd" },
 	{ "rx_mac_ctrl_rcvd" },
@@ -217,6 +239,19 @@ struct {
 	{ "rx_undersize_packets" },
 	{ "rx_in_length_errors" },
 	{ "rx_out_length_errors" },
+	{ "rx_64_or_less_octet_packets" },
+	{ "rx_65_to_127_octet_packets" },
+	{ "rx_128_to_255_octet_packets" },
+	{ "rx_256_to_511_octet_packets" },
+	{ "rx_512_to_1023_octet_packets" },
+	{ "rx_1024_to_1522_octet_packets" },
+	{ "rx_1523_to_2047_octet_packets" },
+	{ "rx_2048_to_4095_octet_packets" },
+	{ "rx_4096_to_8191_octet_packets" },
+	{ "rx_8192_to_9022_octet_packets" },
+
+	{ "tx_octets" },
+	{ "tx_collisions" },
 
 	{ "tx_xon_sent" },
 	{ "tx_xoff_sent" },
@@ -227,9 +262,43 @@ struct {
 	{ "tx_deferred" },
 	{ "tx_excessive_collisions" },
 	{ "tx_late_collisions" },
+	{ "tx_collide_2times" },
+	{ "tx_collide_3times" },
+	{ "tx_collide_4times" },
+	{ "tx_collide_5times" },
+	{ "tx_collide_6times" },
+	{ "tx_collide_7times" },
+	{ "tx_collide_8times" },
+	{ "tx_collide_9times" },
+	{ "tx_collide_10times" },
+	{ "tx_collide_11times" },
+	{ "tx_collide_12times" },
+	{ "tx_collide_13times" },
+	{ "tx_collide_14times" },
+	{ "tx_collide_15times" },
 	{ "tx_ucast_packets" },
 	{ "tx_mcast_packets" },
-	{ "tx_bcast_packets" }
+	{ "tx_bcast_packets" },
+	{ "tx_carrier_sense_errors" },
+	{ "tx_discards" },
+	{ "tx_errors" },
+
+	{ "dma_writeq_full" },
+	{ "dma_write_prioq_full" },
+	{ "rxbds_empty" },
+	{ "rx_discards" },
+	{ "rx_errors" },
+	{ "rx_threshold_hit" },
+
+	{ "dma_readq_full" },
+	{ "dma_read_prioq_full" },
+	{ "tx_comp_queue_full" },
+
+	{ "ring_set_send_prod_index" },
+	{ "ring_status_update" },
+	{ "nic_irqs" },
+	{ "nic_avoided_irqs" },
+	{ "nic_tx_threshold_hit" }
 };
 
 static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
@@ -373,6 +442,7 @@ static void tg3_switch_clocks(struct tg3 *tp)
 	tp->pci_clock_ctrl = clock_ctrl;
 
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750 &&
 	    (orig_clock_ctrl & CLOCK_CTRL_44MHZ_CORE) != 0) {
 		tw32_f(TG3PCI_CLOCK_CTRL,
 		     clock_ctrl |
@@ -396,7 +466,7 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
 	if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
 		tw32_f(MAC_MI_MODE,
 		     (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL));
-		udelay(40);
+		udelay(80);
 	}
 
 	*val = 0xffffffff;
@@ -429,7 +499,7 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val)
 
 	if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
 		tw32_f(MAC_MI_MODE, tp->mi_mode);
-		udelay(40);
+		udelay(80);
 	}
 
 	return ret;
@@ -443,7 +513,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
 	if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
 		tw32_f(MAC_MI_MODE,
 		     (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL));
-		udelay(40);
+		udelay(80);
 	}
 
 	frame_val  = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) &
@@ -472,7 +542,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
 
 	if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
 		tw32_f(MAC_MI_MODE, tp->mi_mode);
-		udelay(40);
+		udelay(80);
 	}
 
 	return ret;
@@ -748,8 +818,8 @@ out:
 	if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
 		/* Cannot do read-modify-write on 5401 */
 		tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20);
-	}
-	else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+	} else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+		   GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 		u32 phy_reg;
 
 		/* Set bit 14 with read-modify-write to preserve other bits */
@@ -842,6 +912,12 @@ static void tg3_frob_aux_power(struct tg3 *tp)
 
 static int tg3_setup_phy(struct tg3 *, int);
 
+#define RESET_KIND_SHUTDOWN	0
+#define RESET_KIND_INIT		1
+#define RESET_KIND_SUSPEND	2
+
+static void tg3_write_sig_post_reset(struct tg3 *, int);
+
 static int tg3_set_power_state(struct tg3 *tp, int state)
 {
 	u32 misc_host_ctrl;
@@ -928,6 +1004,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
 			mac_mode = MAC_MODE_PORT_MODE_TBI;
 		}
 
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750)
+			tw32(MAC_LED_CTRL, tp->led_ctrl);
 
 		if (((power_caps & PCI_PM_CAP_PME_D3cold) &&
 		     (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)))
@@ -953,7 +1031,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
 		     CLOCK_CTRL_ALTCLK |
 		     CLOCK_CTRL_PWRDOWN_PLL133);
 		udelay(40);
-	} else {
+	} else if (!((GET_ASIC_REV(tp->pci_chip_rev_id) == 5750) &&
+		     (tp->tg3_flags & TG3_FLAG_ENABLE_ASF))) {
 		u32 newbits1, newbits2;
 
 		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
@@ -962,7 +1041,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
 				    CLOCK_CTRL_TXCLK_DISABLE |
 				    CLOCK_CTRL_ALTCLK);
 			newbits2 = newbits1 | CLOCK_CTRL_44MHZ_CORE;
-		} else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+		} else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+			   GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
 			newbits1 = CLOCK_CTRL_625_CORE;
 			newbits2 = newbits1 | CLOCK_CTRL_ALTCLK;
 		} else {
@@ -976,7 +1056,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
 		tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2);
 		udelay(40);
 
-		if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+		    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 			u32 newbits3;
 
 			if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
@@ -999,6 +1080,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
 	/* Finally, set the new power state. */
 	pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
 
+	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
+
 	return 0;
 }
 
@@ -1027,6 +1110,8 @@ static void tg3_link_report(struct tg3 *tp)
 static void tg3_setup_flow_control(struct tg3 *tp, u32 local_adv, u32 remote_adv)
 {
 	u32 new_tg3_flags = 0;
+	u32 old_rx_mode = tp->rx_mode;
+	u32 old_tx_mode = tp->tx_mode;
 
 	if (local_adv & ADVERTISE_PAUSE_CAP) {
 		if (local_adv & ADVERTISE_PAUSE_ASYM) {
@@ -1057,10 +1142,18 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 local_adv, u32 remote_adv
 	else
 		tp->rx_mode &= ~RX_MODE_FLOW_CTRL_ENABLE;
 
+	if (old_rx_mode != tp->rx_mode) {
+		tw32_f(MAC_RX_MODE, tp->rx_mode);
+	}
+	
 	if (new_tg3_flags & TG3_FLAG_TX_PAUSE)
 		tp->tx_mode |= TX_MODE_FLOW_CTRL_ENABLE;
 	else
 		tp->tx_mode &= ~TX_MODE_FLOW_CTRL_ENABLE;
+
+	if (old_tx_mode != tp->tx_mode) {
+		tw32_f(MAC_TX_MODE, tp->tx_mode);
+	}
 }
 
 static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u16 *speed, u8 *duplex)
@@ -1311,7 +1404,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
 
 	tp->mi_mode = MAC_MI_MODE_BASE;
 	tw32_f(MAC_MI_MODE, tp->mi_mode);
-	udelay(40);
+	udelay(80);
 
 	tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x02);
 
@@ -1380,11 +1473,14 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
 	else
 		tg3_writephy(tp, MII_TG3_IMASK, ~0);
 
-	if (tp->led_mode == led_mode_three_link)
-		tg3_writephy(tp, MII_TG3_EXT_CTRL,
-			     MII_TG3_EXT_CTRL_LNK3_LED_MODE);
-	else
-		tg3_writephy(tp, MII_TG3_EXT_CTRL, 0);
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) {
+		if (tp->led_ctrl == LED_CTRL_MODE_PHY_1)
+			tg3_writephy(tp, MII_TG3_EXT_CTRL,
+				     MII_TG3_EXT_CTRL_LNK3_LED_MODE);
+		else
+			tg3_writephy(tp, MII_TG3_EXT_CTRL, 0);
+	}
 
 	current_link_up = 0;
 	current_speed = SPEED_INVALID;
@@ -1497,14 +1593,13 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
 
 	tp->mac_mode &= ~MAC_MODE_LINK_POLARITY;
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) {
-		if ((tp->led_mode == led_mode_link10) ||
+		if ((tp->led_ctrl == LED_CTRL_MODE_PHY_2) ||
 		    (current_link_up == 1 &&
 		     tp->link_config.active_speed == SPEED_10))
 			tp->mac_mode |= MAC_MODE_LINK_POLARITY;
 	} else {
 		if (current_link_up == 1)
 			tp->mac_mode |= MAC_MODE_LINK_POLARITY;
-		tw32(MAC_LED_CTRL, LED_CTRL_PHY_MODE_1);
 	}
 
 	/* ??? Without this setting Netgear GA302T PHY does not
@@ -1514,7 +1609,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
 	    tp->pci_chip_rev_id == CHIPREV_ID_5700_ALTIMA) {
 		tp->mi_mode |= MAC_MI_MODE_AUTO_POLL;
 		tw32_f(MAC_MI_MODE, tp->mi_mode);
-		udelay(40);
+		udelay(80);
 	}
 
 	tw32_f(MAC_MODE, tp->mac_mode);
@@ -2038,9 +2133,15 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
 	if (current_link_up == 1) {
 		tp->link_config.active_speed = SPEED_1000;
 		tp->link_config.active_duplex = DUPLEX_FULL;
+		tw32(MAC_LED_CTRL, (tp->led_ctrl |
+				    LED_CTRL_LNKLED_OVERRIDE |
+				    LED_CTRL_1000MBPS_ON));
 	} else {
 		tp->link_config.active_speed = SPEED_INVALID;
 		tp->link_config.active_duplex = DUPLEX_INVALID;
+		tw32(MAC_LED_CTRL, (tp->led_ctrl |
+				    LED_CTRL_LNKLED_OVERRIDE |
+				    LED_CTRL_TRAFFIC_OVERRIDE));
 	}
 
 	if (current_link_up != netif_carrier_ok(tp->dev)) {
@@ -2093,11 +2194,14 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
 		      (6 << TX_LENGTHS_IPG_SHIFT) |
 		      (32 << TX_LENGTHS_SLOT_TIME_SHIFT)));
 
-	if (netif_carrier_ok(tp->dev)) {
-		tw32(HOSTCC_STAT_COAL_TICKS,
-		     DEFAULT_STAT_COAL_TICKS);
-	} else {
-		tw32(HOSTCC_STAT_COAL_TICKS, 0);
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
+		if (netif_carrier_ok(tp->dev)) {
+			tw32(HOSTCC_STAT_COAL_TICKS,
+			     DEFAULT_STAT_COAL_TICKS);
+		} else {
+			tw32(HOSTCC_STAT_COAL_TICKS, 0);
+		}
 	}
 
 	return err;
@@ -2435,7 +2539,7 @@ next_pkt_nopost:
 
 static int tg3_poll(struct net_device *netdev, int *budget)
 {
-	struct tg3 *tp = netdev->priv;
+	struct tg3 *tp = netdev_priv(netdev);
 	struct tg3_hw_status *sblk = tp->hw_status;
 	unsigned long flags;
 	int done;
@@ -2517,7 +2621,7 @@ static inline unsigned int tg3_has_work(struct net_device *dev, struct tg3 *tp)
 static irqreturn_t tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = dev_id;
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	struct tg3_hw_status *sblk = tp->hw_status;
 	unsigned long flags;
 	unsigned int handled = 1;
@@ -2597,7 +2701,7 @@ static void tg3_reset_task(void *_data)
 
 static void tg3_tx_timeout(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	printk(KERN_ERR PFX "%s: transmit timed out, resetting\n",
 	       dev->name);
@@ -2713,7 +2817,7 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
 
 static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	dma_addr_t mapping;
 	unsigned int i;
 	u32 len, entry, base_flags, mss;
@@ -2841,8 +2945,12 @@ static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
 				would_hit_hwbug = entry + 1;
 			}
 
-			tg3_set_txd(tp, entry, mapping, len,
-				    base_flags, (i == last));
+			if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+				tg3_set_txd(tp, entry, mapping, len,
+					    base_flags, (i == last)|(mss << 1));
+			else
+				tg3_set_txd(tp, entry, mapping, len,
+					    base_flags, (i == last));
 
 			entry = NEXT_TX(entry);
 		}
@@ -2913,7 +3021,7 @@ out_unlock:
 
 static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	dma_addr_t mapping;
 	u32 len, entry, base_flags, mss;
 	unsigned long flags;
@@ -3028,8 +3136,12 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
 			tp->tx_buffers[entry].skb = NULL;
 			pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping);
 
-			tg3_set_txd(tp, entry, mapping, len,
-				    base_flags, (i == last));
+			if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+				tg3_set_txd(tp, entry, mapping, len,
+					    base_flags, (i == last)|(mss << 1));
+			else
+				tg3_set_txd(tp, entry, mapping, len,
+					    base_flags, (i == last));
 
 			entry = NEXT_TX(entry);
 		}
@@ -3079,7 +3191,7 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
 
 static int tg3_change_mtu(struct net_device *dev, int new_mtu)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp))
 		return -EINVAL;
@@ -3387,7 +3499,8 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit)
 	unsigned int i;
 	u32 val;
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
 		switch (ofs) {
 		case RCVLSC_MODE:
 		case DMAC_MODE:
@@ -3395,7 +3508,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit)
 		case BUFMGR_MODE:
 		case MEMARB_MODE:
 			/* We can't enable/disable these bits of the
-			 * 5705, just say success.
+			 * 5705/5750, just say success.
 			 */
 			return 0;
 
@@ -3493,6 +3606,107 @@ out:
 	return err;
 }
 
+/* tp->lock is held. */
+static int tg3_nvram_lock(struct tg3 *tp)
+{
+	if (tp->tg3_flags & TG3_FLAG_NVRAM) {
+		int i;
+
+		tw32(NVRAM_SWARB, SWARB_REQ_SET1);
+		for (i = 0; i < 8000; i++) {
+			if (tr32(NVRAM_SWARB) & SWARB_GNT1)
+				break;
+			udelay(20);
+		}
+		if (i == 8000)
+			return -ENODEV;
+	}
+	return 0;
+}
+
+/* tp->lock is held. */
+static void tg3_nvram_unlock(struct tg3 *tp)
+{
+	if (tp->tg3_flags & TG3_FLAG_NVRAM)
+		tw32_f(NVRAM_SWARB, SWARB_REQ_CLR1);
+}
+
+/* tp->lock is held. */
+static void tg3_write_sig_pre_reset(struct tg3 *tp, int kind)
+{
+	tg3_write_mem(tp, NIC_SRAM_FIRMWARE_MBOX,
+		      NIC_SRAM_FIRMWARE_MBOX_MAGIC1);
+
+	if (tp->tg3_flags2 & TG3_FLG2_ASF_NEW_HANDSHAKE) {
+		switch (kind) {
+		case RESET_KIND_INIT:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_START);
+			break;
+
+		case RESET_KIND_SHUTDOWN:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_UNLOAD);
+			break;
+
+		case RESET_KIND_SUSPEND:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_SUSPEND);
+			break;
+
+		default:
+			break;
+		};
+	}
+}
+
+/* tp->lock is held. */
+static void tg3_write_sig_post_reset(struct tg3 *tp, int kind)
+{
+	if (tp->tg3_flags2 & TG3_FLG2_ASF_NEW_HANDSHAKE) {
+		switch (kind) {
+		case RESET_KIND_INIT:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_START_DONE);
+			break;
+
+		case RESET_KIND_SHUTDOWN:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_UNLOAD_DONE);
+			break;
+
+		default:
+			break;
+		};
+	}
+}
+
+/* tp->lock is held. */
+static void tg3_write_sig_legacy(struct tg3 *tp, int kind)
+{
+	if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
+		switch (kind) {
+		case RESET_KIND_INIT:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_START);
+			break;
+
+		case RESET_KIND_SHUTDOWN:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_UNLOAD);
+			break;
+
+		case RESET_KIND_SUSPEND:
+			tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
+				      DRV_STATE_SUSPEND);
+			break;
+
+		default:
+			break;
+		};
+	}
+}
+
 /* tp->lock is held. */
 static int tg3_chip_reset(struct tg3 *tp)
 {
@@ -3500,22 +3714,8 @@ static int tg3_chip_reset(struct tg3 *tp)
 	u32 flags_save;
 	int i;
 
-	if (!(tp->tg3_flags2 & TG3_FLG2_SUN_5704)) {
-		/* Force NVRAM to settle.
-		 * This deals with a chip bug which can result in EEPROM
-		 * corruption.
-		 */
-		if (tp->tg3_flags & TG3_FLAG_NVRAM) {
-			int i;
-
-			tw32(NVRAM_SWARB, SWARB_REQ_SET1);
-			for (i = 0; i < 100000; i++) {
-				if (tr32(NVRAM_SWARB) & SWARB_GNT1)
-					break;
-				udelay(10);
-			}
-		}
-	}
+	if (!(tp->tg3_flags2 & TG3_FLG2_SUN_5704))
+		tg3_nvram_lock(tp);
 
 	/*
 	 * We must avoid the readl() that normally takes place.
@@ -3528,7 +3728,19 @@ static int tg3_chip_reset(struct tg3 *tp)
 
 	/* do the reset */
 	val = GRC_MISC_CFG_CORECLK_RESET;
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
+
+	if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+		if (tr32(0x7e2c) == 0x60) {
+			tw32(0x7e2c, 0x20);
+		}
+		if (tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
+			tw32(GRC_MISC_CFG, (1 << 29));
+			val |= (1 << 29);
+		}
+	}
+
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
 		val |= GRC_MISC_CFG_KEEP_GPHY_POWER;
 	tw32(GRC_MISC_CFG, val);
 
@@ -3542,9 +3754,24 @@ static int tg3_chip_reset(struct tg3 *tp)
 	 */
 	pci_read_config_dword(tp->pdev, PCI_COMMAND, &val);
 
-	udelay(40);
-	udelay(40);
-	udelay(40);
+	udelay(120);
+
+	if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+		if (tp->pci_chip_rev_id == CHIPREV_ID_5750_A0) {
+			int i;
+			u32 cfg_val;
+
+			/* Wait for link training to complete.  */
+			for (i = 0; i < 5000; i++)
+				udelay(100);
+
+			pci_read_config_dword(tp->pdev, 0xc4, &cfg_val);
+			pci_write_config_dword(tp->pdev, 0xc4,
+					       cfg_val | (1 << 15));
+		}
+		/* Set PCIE max payload size and clear error status.  */
+		pci_write_config_dword(tp->pdev, 0xd8, 0xf5000);
+	}
 
 	/* Re-enable indirect register accesses. */
 	pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
@@ -3568,18 +3795,20 @@ static int tg3_chip_reset(struct tg3 *tp)
 
 	tw32(GRC_MODE, tp->grc_mode);
 
+	if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A0) {
+		u32 val = tr32(0xc4);
+
+		tw32(0xc4, val | (1 << 15));
+	}
+
 	if ((tp->nic_sram_data_cfg & NIC_SRAM_DATA_CFG_MINI_PCI) != 0 &&
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
-		tp->pci_clock_ctrl |=
-			(CLOCK_CTRL_FORCE_CLKRUN | CLOCK_CTRL_CLKRUN_OENABLE);
+		tp->pci_clock_ctrl |= CLOCK_CTRL_CLKRUN_OENABLE;
+		if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A0)
+			tp->pci_clock_ctrl |= CLOCK_CTRL_FORCE_CLKRUN;
 		tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
 	}
 
-	/* Prevent PXE from restarting.  */
-	tg3_write_mem(tp,
-		      NIC_SRAM_FIRMWARE_MBOX,
-		      NIC_SRAM_FIRMWARE_MBOX_MAGIC1);
-
 	if (tp->phy_id == PHY_ID_SERDES) {
 		tp->mac_mode = MAC_MODE_PORT_MODE_TBI;
 		tw32_f(MAC_MODE, tp->mac_mode);
@@ -3602,15 +3831,26 @@ static int tg3_chip_reset(struct tg3 *tp)
 		return -ENODEV;
 	}
 
+	if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+	    tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
+		u32 val = tr32(0x7c00);
+
+		tw32(0x7c00, val | (1 << 25));
+	}
+
 	/* Reprobe ASF enable state.  */
 	tp->tg3_flags &= ~TG3_FLAG_ENABLE_ASF;
+	tp->tg3_flags2 &= ~TG3_FLG2_ASF_NEW_HANDSHAKE;
 	tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val);
 	if (val == NIC_SRAM_DATA_SIG_MAGIC) {
 		u32 nic_cfg;
 
 		tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg);
-		if (nic_cfg & NIC_SRAM_DATA_CFG_ASF_ENABLE)
+		if (nic_cfg & NIC_SRAM_DATA_CFG_ASF_ENABLE) {
 			tp->tg3_flags |= TG3_FLAG_ENABLE_ASF;
+			if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+				tp->tg3_flags2 |= TG3_FLG2_ASF_NEW_HANDSHAKE;
+		}
 	}
 
 	return 0;
@@ -3643,15 +3883,18 @@ static int tg3_halt(struct tg3 *tp)
 	int err;
 
 	tg3_stop_fw(tp);
+
+	tg3_write_sig_pre_reset(tp, RESET_KIND_SHUTDOWN);
+
 	tg3_abort_hw(tp);
 	err = tg3_chip_reset(tp);
+
+	tg3_write_sig_legacy(tp, RESET_KIND_SHUTDOWN);
+	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
+
 	if (err)
 		return err;
 
-	if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF)
-		tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
-			      DRV_STATE_UNLOAD);
-
 	return 0;
 }
 
@@ -3951,305 +4194,305 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
 #if TG3_TSO_SUPPORT != 0
 
 #define TG3_TSO_FW_RELEASE_MAJOR	0x1
-#define TG3_TSO_FW_RELASE_MINOR		0x4
+#define TG3_TSO_FW_RELASE_MINOR		0x6
 #define TG3_TSO_FW_RELEASE_FIX		0x0
 #define TG3_TSO_FW_START_ADDR		0x08000000
 #define TG3_TSO_FW_TEXT_ADDR		0x08000000
-#define TG3_TSO_FW_TEXT_LEN		0x1a90
-#define TG3_TSO_FW_RODATA_ADDR		0x08001a90
+#define TG3_TSO_FW_TEXT_LEN		0x1aa0
+#define TG3_TSO_FW_RODATA_ADDR		0x08001aa0
 #define TG3_TSO_FW_RODATA_LEN		0x60
 #define TG3_TSO_FW_DATA_ADDR		0x08001b20
-#define TG3_TSO_FW_DATA_LEN		0x20
-#define TG3_TSO_FW_SBSS_ADDR		0x08001b40
+#define TG3_TSO_FW_DATA_LEN		0x30
+#define TG3_TSO_FW_SBSS_ADDR		0x08001b50
 #define TG3_TSO_FW_SBSS_LEN		0x2c
-#define TG3_TSO_FW_BSS_ADDR		0x08001b70
+#define TG3_TSO_FW_BSS_ADDR		0x08001b80
 #define TG3_TSO_FW_BSS_LEN		0x894
 
-static u32 tg3TsoFwText[] = {
-	0x00000000, 0x10000003, 0x00000000, 0x0000000d, 0x0000000d, 0x3c1d0800,
-	0x37bd4000, 0x03a0f021, 0x3c100800, 0x26100000, 0x0e000010, 0x00000000,
-	0x0000000d, 0x00000000, 0x00000000, 0x00000000, 0x27bdffe0, 0x3c04fefe,
-	0xafbf0018, 0x0e0005d4, 0x34840002, 0x0e000664, 0x00000000, 0x3c030800,
-	0x90631b58, 0x24020002, 0x3c040800, 0x24841a9c, 0x14620003, 0x24050001,
-	0x3c040800, 0x24841a90, 0x24060003, 0x00003821, 0xafa00010, 0x0e000678,
+static u32 tg3TsoFwText[(TG3_TSO_FW_TEXT_LEN / 4) + 1] = {
+	0x0e000003, 0x00000000, 0x08001b24, 0x00000000, 0x10000003, 0x00000000,
+	0x0000000d, 0x0000000d, 0x3c1d0800, 0x37bd4000, 0x03a0f021, 0x3c100800,
+	0x26100000, 0x0e000010, 0x00000000, 0x0000000d, 0x27bdffe0, 0x3c04fefe,
+	0xafbf0018, 0x0e0005d8, 0x34840002, 0x0e000668, 0x00000000, 0x3c030800,
+	0x90631b68, 0x24020002, 0x3c040800, 0x24841aac, 0x14620003, 0x24050001,
+	0x3c040800, 0x24841aa0, 0x24060006, 0x00003821, 0xafa00010, 0x0e00067c,
 	0xafa00014, 0x8f625c50, 0x34420001, 0xaf625c50, 0x8f625c90, 0x34420001,
 	0xaf625c90, 0x2402ffff, 0x0e000034, 0xaf625404, 0x8fbf0018, 0x03e00008,
 	0x27bd0020, 0x00000000, 0x00000000, 0x00000000, 0x27bdffe0, 0xafbf001c,
 	0xafb20018, 0xafb10014, 0x0e00005b, 0xafb00010, 0x24120002, 0x24110001,
 	0x8f706820, 0x32020100, 0x10400003, 0x00000000, 0x0e0000bb, 0x00000000,
-	0x8f706820, 0x32022000, 0x10400004, 0x32020001, 0x0e0001ef, 0x24040001,
+	0x8f706820, 0x32022000, 0x10400004, 0x32020001, 0x0e0001f0, 0x24040001,
 	0x32020001, 0x10400003, 0x00000000, 0x0e0000a3, 0x00000000, 0x3c020800,
-	0x90421b88, 0x14520003, 0x00000000, 0x0e0004bf, 0x00000000, 0x0a00003c,
+	0x90421b98, 0x14520003, 0x00000000, 0x0e0004c0, 0x00000000, 0x0a00003c,
 	0xaf715028, 0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008,
-	0x27bd0020, 0x27bdffe0, 0x3c040800, 0x24841ab0, 0x00002821, 0x00003021,
-	0x00003821, 0xafbf0018, 0xafa00010, 0x0e000678, 0xafa00014, 0x3c040800,
-	0x248423c8, 0xa4800000, 0x3c010800, 0xa0201b88, 0x3c010800, 0xac201b8c,
-	0x3c010800, 0xac201b90, 0x3c010800, 0xac201b94, 0x3c010800, 0xac201b9c,
-	0x3c010800, 0xac201ba8, 0x3c010800, 0xac201bac, 0x8f624434, 0x3c010800,
-	0xac221b78, 0x8f624438, 0x3c010800, 0xac221b7c, 0x8f624410, 0xac80f7a8,
-	0x3c010800, 0xac201b74, 0x3c010800, 0xac2023d0, 0x3c010800, 0xac2023b8,
-	0x3c010800, 0xac2023bc, 0x3c010800, 0xac2023f0, 0x3c010800, 0xac221b80,
+	0x27bd0020, 0x27bdffe0, 0x3c040800, 0x24841ac0, 0x00002821, 0x00003021,
+	0x00003821, 0xafbf0018, 0xafa00010, 0x0e00067c, 0xafa00014, 0x3c040800,
+	0x248423d8, 0xa4800000, 0x3c010800, 0xa0201b98, 0x3c010800, 0xac201b9c,
+	0x3c010800, 0xac201ba0, 0x3c010800, 0xac201ba4, 0x3c010800, 0xac201bac,
+	0x3c010800, 0xac201bb8, 0x3c010800, 0xac201bbc, 0x8f624434, 0x3c010800,
+	0xac221b88, 0x8f624438, 0x3c010800, 0xac221b8c, 0x8f624410, 0xac80f7a8,
+	0x3c010800, 0xac201b84, 0x3c010800, 0xac2023e0, 0x3c010800, 0xac2023c8,
+	0x3c010800, 0xac2023cc, 0x3c010800, 0xac202400, 0x3c010800, 0xac221b90,
 	0x8f620068, 0x24030007, 0x00021702, 0x10430005, 0x00000000, 0x8f620068,
-	0x00021702, 0x14400004, 0x24020001, 0x3c010800, 0x0a000097, 0xac2023fc,
-	0xac820034, 0x3c040800, 0x24841abc, 0x3c050800, 0x8ca523fc, 0x00003021,
-	0x00003821, 0xafa00010, 0x0e000678, 0xafa00014, 0x8fbf0018, 0x03e00008,
-	0x27bd0020, 0x27bdffe0, 0x3c040800, 0x24841ac8, 0x00002821, 0x00003021,
-	0x00003821, 0xafbf0018, 0xafa00010, 0x0e000678, 0xafa00014, 0x0e00005b,
+	0x00021702, 0x14400004, 0x24020001, 0x3c010800, 0x0a000097, 0xac20240c,
+	0xac820034, 0x3c040800, 0x24841acc, 0x3c050800, 0x8ca5240c, 0x00003021,
+	0x00003821, 0xafa00010, 0x0e00067c, 0xafa00014, 0x8fbf0018, 0x03e00008,
+	0x27bd0020, 0x27bdffe0, 0x3c040800, 0x24841ad8, 0x00002821, 0x00003021,
+	0x00003821, 0xafbf0018, 0xafa00010, 0x0e00067c, 0xafa00014, 0x0e00005b,
 	0x00000000, 0x0e0000b4, 0x00002021, 0x8fbf0018, 0x03e00008, 0x27bd0020,
 	0x24020001, 0x8f636820, 0x00821004, 0x00021027, 0x00621824, 0x03e00008,
 	0xaf636820, 0x27bdffd0, 0xafbf002c, 0xafb60028, 0xafb50024, 0xafb40020,
 	0xafb3001c, 0xafb20018, 0xafb10014, 0xafb00010, 0x8f675c5c, 0x3c030800,
-	0x24631bac, 0x8c620000, 0x14470005, 0x3c0200ff, 0x3c020800, 0x90421b88,
-	0x14400118, 0x3c0200ff, 0x3442fff8, 0x00e28824, 0xac670000, 0x00111902,
+	0x24631bbc, 0x8c620000, 0x14470005, 0x3c0200ff, 0x3c020800, 0x90421b98,
+	0x14400119, 0x3c0200ff, 0x3442fff8, 0x00e28824, 0xac670000, 0x00111902,
 	0x306300ff, 0x30e20003, 0x000211c0, 0x00622825, 0x00a04021, 0x00071602,
-	0x3c030800, 0x90631b88, 0x3044000f, 0x14600036, 0x00804821, 0x24020001,
-	0x3c010800, 0xa0221b88, 0x00051100, 0x00821025, 0x3c010800, 0xac201b8c,
-	0x3c010800, 0xac201b90, 0x3c010800, 0xac201b94, 0x3c010800, 0xac201b9c,
-	0x3c010800, 0xac201ba8, 0x3c010800, 0xac201ba0, 0x3c010800, 0xac201ba4,
-	0x3c010800, 0xa42223c8, 0x9622000c, 0x30437fff, 0x3c010800, 0xa4222400,
-	0x30428000, 0x3c010800, 0xa4231bb6, 0x10400005, 0x24020001, 0x3c010800,
-	0xac2223e4, 0x0a000102, 0x2406003e, 0x24060036, 0x3c010800, 0xac2023e4,
-	0x9622000a, 0x3c030800, 0x94631bb6, 0x3c010800, 0xac2023e0, 0x3c010800,
-	0xac2023e8, 0x00021302, 0x00021080, 0x00c21021, 0x00621821, 0x3c010800,
-	0xa42223c0, 0x3c010800, 0x0a000115, 0xa4231b86, 0x9622000c, 0x3c010800,
-	0xa42223dc, 0x3c040800, 0x24841b8c, 0x8c820000, 0x00021100, 0x3c010800,
-	0x00220821, 0xac311bb8, 0x8c820000, 0x00021100, 0x3c010800, 0x00220821,
-	0xac271bbc, 0x8c820000, 0x25030001, 0x306601ff, 0x00021100, 0x3c010800,
-	0x00220821, 0xac261bc0, 0x8c820000, 0x00021100, 0x3c010800, 0x00220821,
-	0xac291bc4, 0x96230008, 0x3c020800, 0x8c421b9c, 0x00432821, 0x3c010800,
-	0xac251b9c, 0x9622000a, 0x30420004, 0x14400018, 0x00061100, 0x8f630c14,
+	0x3c030800, 0x90631b98, 0x3044000f, 0x14600036, 0x00804821, 0x24020001,
+	0x3c010800, 0xa0221b98, 0x00051100, 0x00821025, 0x3c010800, 0xac201b9c,
+	0x3c010800, 0xac201ba0, 0x3c010800, 0xac201ba4, 0x3c010800, 0xac201bac,
+	0x3c010800, 0xac201bb8, 0x3c010800, 0xac201bb0, 0x3c010800, 0xac201bb4,
+	0x3c010800, 0xa42223d8, 0x9622000c, 0x30437fff, 0x3c010800, 0xa4222410,
+	0x30428000, 0x3c010800, 0xa4231bc6, 0x10400005, 0x24020001, 0x3c010800,
+	0xac2223f4, 0x0a000102, 0x2406003e, 0x24060036, 0x3c010800, 0xac2023f4,
+	0x9622000a, 0x3c030800, 0x94631bc6, 0x3c010800, 0xac2023f0, 0x3c010800,
+	0xac2023f8, 0x00021302, 0x00021080, 0x00c21021, 0x00621821, 0x3c010800,
+	0xa42223d0, 0x3c010800, 0x0a000115, 0xa4231b96, 0x9622000c, 0x3c010800,
+	0xa42223ec, 0x3c040800, 0x24841b9c, 0x8c820000, 0x00021100, 0x3c010800,
+	0x00220821, 0xac311bc8, 0x8c820000, 0x00021100, 0x3c010800, 0x00220821,
+	0xac271bcc, 0x8c820000, 0x25030001, 0x306601ff, 0x00021100, 0x3c010800,
+	0x00220821, 0xac261bd0, 0x8c820000, 0x00021100, 0x3c010800, 0x00220821,
+	0xac291bd4, 0x96230008, 0x3c020800, 0x8c421bac, 0x00432821, 0x3c010800,
+	0xac251bac, 0x9622000a, 0x30420004, 0x14400018, 0x00061100, 0x8f630c14,
 	0x3063000f, 0x2c620002, 0x1440000b, 0x3c02c000, 0x8f630c14, 0x3c020800,
-	0x8c421b30, 0x3063000f, 0x24420001, 0x3c010800, 0xac221b30, 0x2c620002,
+	0x8c421b40, 0x3063000f, 0x24420001, 0x3c010800, 0xac221b40, 0x2c620002,
 	0x1040fff7, 0x3c02c000, 0x00e21825, 0xaf635c5c, 0x8f625c50, 0x30420002,
-	0x10400014, 0x00000000, 0x0a000147, 0x00000000, 0x3c030800, 0x8c631b70,
-	0x3c040800, 0x94841b84, 0x01221025, 0x3c010800, 0xa42223ca, 0x24020001,
-	0x3c010800, 0xac221ba8, 0x24630001, 0x0085202a, 0x3c010800, 0x10800003,
-	0xac231b70, 0x3c010800, 0xa4251b84, 0x3c060800, 0x24c61b8c, 0x8cc20000,
-	0x24420001, 0xacc20000, 0x28420080, 0x14400005, 0x00000000, 0x0e000652,
-	0x24040002, 0x0a0001e5, 0x00000000, 0x3c020800, 0x8c421ba8, 0x10400077,
-	0x24020001, 0x3c050800, 0x90a51b88, 0x14a20071, 0x00000000, 0x3c150800,
-	0x96b51b86, 0x3c040800, 0x8c841b9c, 0x32a3ffff, 0x0083102a, 0x1440006b,
-	0x00000000, 0x14830003, 0x00000000, 0x3c010800, 0xac2523e0, 0x1060005b,
+	0x10400014, 0x00000000, 0x0a000147, 0x00000000, 0x3c030800, 0x8c631b80,
+	0x3c040800, 0x94841b94, 0x01221025, 0x3c010800, 0xa42223da, 0x24020001,
+	0x3c010800, 0xac221bb8, 0x24630001, 0x0085202a, 0x3c010800, 0x10800003,
+	0xac231b80, 0x3c010800, 0xa4251b94, 0x3c060800, 0x24c61b9c, 0x8cc20000,
+	0x24420001, 0xacc20000, 0x28420080, 0x14400005, 0x00000000, 0x0e000656,
+	0x24040002, 0x0a0001e6, 0x00000000, 0x3c020800, 0x8c421bb8, 0x10400078,
+	0x24020001, 0x3c050800, 0x90a51b98, 0x14a20072, 0x00000000, 0x3c150800,
+	0x96b51b96, 0x3c040800, 0x8c841bac, 0x32a3ffff, 0x0083102a, 0x1440006c,
+	0x00000000, 0x14830003, 0x00000000, 0x3c010800, 0xac2523f0, 0x1060005c,
 	0x00009021, 0x24d60004, 0x0060a021, 0x24d30014, 0x8ec20000, 0x00028100,
-	0x3c110800, 0x02308821, 0x0e000621, 0x8e311bb8, 0x00402821, 0x10a00053,
-	0x00000000, 0x9628000a, 0x31020040, 0x10400004, 0x2407180c, 0x8e22000c,
-	0x2407188c, 0xaca20018, 0x3c030800, 0x00701821, 0x8c631bc0, 0x3c020800,
-	0x00501021, 0x8c421bc4, 0x00031d00, 0x00021400, 0x00621825, 0xaca30014,
-	0x8ec30004, 0x96220008, 0x00432023, 0x3242ffff, 0x3083ffff, 0x00431021,
-	0x0282102a, 0x14400002, 0x02b23023, 0x00803021, 0x8e620000, 0x30c4ffff,
-	0x00441021, 0xae620000, 0x8e220000, 0xaca20000, 0x8e220004, 0x8e63fff4,
-	0x00431021, 0xaca20004, 0xa4a6000e, 0x8e62fff4, 0x00441021, 0xae62fff4,
-	0x96230008, 0x0043102a, 0x14400005, 0x02469021, 0x8e62fff0, 0xae60fff4,
-	0x24420001, 0xae62fff0, 0xaca00008, 0x3242ffff, 0x14540008, 0x24020305,
-	0x31020080, 0x54400001, 0x34e70010, 0x24020905, 0xa4a2000c, 0x0a0001ca,
-	0x34e70020, 0xa4a2000c, 0x3c020800, 0x8c4223e0, 0x10400003, 0x3c024b65,
-	0x0a0001d2, 0x34427654, 0x3c02b49a, 0x344289ab, 0xaca2001c, 0x30e2ffff,
-	0xaca20010, 0x0e00059f, 0x00a02021, 0x3242ffff, 0x0054102b, 0x1440ffaa,
-	0x00000000, 0x24020002, 0x3c010800, 0x0a0001e5, 0xa0221b88, 0x8ec2083c,
-	0x24420001, 0x0a0001e5, 0xaec2083c, 0x0e0004bf, 0x00000000, 0x8fbf002c,
-	0x8fb60028, 0x8fb50024, 0x8fb40020, 0x8fb3001c, 0x8fb20018, 0x8fb10014,
-	0x8fb00010, 0x03e00008, 0x27bd0030, 0x27bdffd0, 0xafbf0028, 0xafb30024,
-	0xafb20020, 0xafb1001c, 0xafb00018, 0x8f725c9c, 0x3c0200ff, 0x3442fff8,
-	0x3c060800, 0x24c61ba4, 0x02428824, 0x9623000e, 0x8cc20000, 0x00431021,
-	0xacc20000, 0x8e220010, 0x30420020, 0x14400011, 0x00809821, 0x0e000637,
-	0x02202021, 0x3c02c000, 0x02421825, 0xaf635c9c, 0x8f625c90, 0x30420002,
-	0x10400121, 0x00000000, 0xaf635c9c, 0x8f625c90, 0x30420002, 0x1040011c,
-	0x00000000, 0x0a00020c, 0x00000000, 0x8e240008, 0x8e230014, 0x00041402,
-	0x000241c0, 0x00031502, 0x304201ff, 0x2442ffff, 0x3042007f, 0x00031942,
-	0x30637800, 0x00021100, 0x24424000, 0x00625021, 0x9542000a, 0x3084ffff,
-	0x30420008, 0x104000b3, 0x000429c0, 0x3c020800, 0x8c4223f0, 0x1440002d,
-	0x25050008, 0x95020014, 0x3c010800, 0xa42223c0, 0x8d070010, 0x00071402,
-	0x3c010800, 0xa42223c2, 0x3c010800, 0xa42723c4, 0x9502000e, 0x30e3ffff,
-	0x00431023, 0x3c010800, 0xac2223f8, 0x8f626800, 0x3c030010, 0x00431024,
-	0x10400005, 0x00000000, 0x9503001a, 0x9502001c, 0x0a000241, 0x00431021,
-	0x9502001a, 0x3c010800, 0xac2223ec, 0x3c02c000, 0x02421825, 0x3c010800,
-	0xac2823f0, 0x3c010800, 0xac3223f4, 0xaf635c9c, 0x8f625c90, 0x30420002,
-	0x104000df, 0x00000000, 0xaf635c9c, 0x8f625c90, 0x30420002, 0x104000da,
-	0x00000000, 0x0a00024e, 0x00000000, 0x9502000e, 0x3c030800, 0x946323c4,
-	0x00434823, 0x3123ffff, 0x2c620008, 0x1040001c, 0x00000000, 0x95020014,
-	0x24420028, 0x00a22821, 0x00031042, 0x1840000b, 0x00002021, 0x24c60848,
-	0x00403821, 0x94a30000, 0x8cc20000, 0x24840001, 0x00431021, 0xacc20000,
-	0x0087102a, 0x1440fff9, 0x24a50002, 0x31220001, 0x1040001f, 0x3c024000,
-	0x3c040800, 0x248423ec, 0xa0a00001, 0x94a30000, 0x8c820000, 0x00431021,
-	0x0a00028d, 0xac820000, 0x8f626800, 0x3c030010, 0x00431024, 0x10400009,
-	0x00000000, 0x9502001a, 0x3c030800, 0x8c6323ec, 0x00431021, 0x3c010800,
-	0xac2223ec, 0x0a00028e, 0x3c024000, 0x9502001a, 0x9504001c, 0x3c030800,
-	0x8c6323ec, 0x00441023, 0x00621821, 0x3c010800, 0xac2323ec, 0x3c024000,
-	0x02421825, 0xaf635c9c, 0x8f625c90, 0x30420002, 0x1440fffc, 0x00000000,
-	0x9542000a, 0x30420010, 0x10400095, 0x00000000, 0x3c060800, 0x24c623f0,
-	0x3c020800, 0x944223c4, 0x8cc50000, 0x3c040800, 0x8c8423f8, 0x24420030,
-	0x00a22821, 0x94a20004, 0x3c030800, 0x8c6323ec, 0x00441023, 0x00621821,
-	0x00603821, 0x00032402, 0x30e2ffff, 0x00823821, 0x00071402, 0x00e23821,
-	0x00071027, 0x3c010800, 0xac2323ec, 0xa4a20006, 0x3c030800, 0x8c6323f4,
-	0x3c0200ff, 0x3442fff8, 0x00628824, 0x96220008, 0x24040001, 0x24034000,
-	0x000241c0, 0x00e01021, 0xa502001a, 0xa500001c, 0xacc00000, 0x3c010800,
-	0xac241b50, 0xaf635cb8, 0x8f625cb0, 0x30420002, 0x10400003, 0x00000000,
-	0x3c010800, 0xac201b50, 0x8e220008, 0xaf625cb8, 0x8f625cb0, 0x30420002,
-	0x10400003, 0x00000000, 0x3c010800, 0xac201b50, 0x3c020800, 0x8c421b50,
-	0x1040ffec, 0x00000000, 0x3c040800, 0x0e000637, 0x8c8423f4, 0x0a00032c,
-	0x00000000, 0x3c030800, 0x90631b88, 0x24020002, 0x14620003, 0x3c034b65,
-	0x0a0002e3, 0x00008021, 0x8e22001c, 0x34637654, 0x10430002, 0x24100002,
-	0x24100001, 0x01002021, 0x0e000352, 0x02003021, 0x24020003, 0x3c010800,
-	0xa0221b88, 0x24020002, 0x1202000a, 0x24020001, 0x3c030800, 0x8c6323e0,
-	0x10620006, 0x00000000, 0x3c020800, 0x944223c8, 0x00021400, 0x0a000321,
-	0xae220014, 0x3c040800, 0x248423ca, 0x94820000, 0x00021400, 0xae220014,
-	0x3c020800, 0x8c421bac, 0x3c03c000, 0x3c010800, 0xa0201b88, 0x00431025,
-	0xaf625c5c, 0x8f625c50, 0x30420002, 0x10400009, 0x00000000, 0x2484f7e2,
-	0x8c820000, 0x00431025, 0xaf625c5c, 0x8f625c50, 0x30420002, 0x1440fffa,
-	0x00000000, 0x3c020800, 0x24421b74, 0x8c430000, 0x24630001, 0xac430000,
-	0x8f630c14, 0x3063000f, 0x2c620002, 0x1440000c, 0x3c024000, 0x8f630c14,
-	0x3c020800, 0x8c421b30, 0x3063000f, 0x24420001, 0x3c010800, 0xac221b30,
-	0x2c620002, 0x1040fff7, 0x00000000, 0x3c024000, 0x02421825, 0xaf635c9c,
-	0x8f625c90, 0x30420002, 0x1440fffc, 0x00000000, 0x12600003, 0x00000000,
-	0x0e0004bf, 0x00000000, 0x8fbf0028, 0x8fb30024, 0x8fb20020, 0x8fb1001c,
-	0x8fb00018, 0x03e00008, 0x27bd0030, 0x8f634450, 0x3c040800, 0x24841b78,
-	0x8c820000, 0x00031c02, 0x0043102b, 0x14400007, 0x3c038000, 0x8c840004,
-	0x8f624450, 0x00021c02, 0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444,
-	0x8f624444, 0x00431024, 0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008,
-	0x3042ffff, 0x3c024000, 0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002,
-	0x1440fffc, 0x00000000, 0x03e00008, 0x00000000, 0x27bdffe0, 0x00805821,
-	0x14c00011, 0x256e0008, 0x3c020800, 0x8c4223e4, 0x10400007, 0x24020016,
-	0x3c010800, 0xa42223c2, 0x2402002a, 0x3c010800, 0x0a000366, 0xa42223c4,
-	0x8d670010, 0x00071402, 0x3c010800, 0xa42223c2, 0x3c010800, 0xa42723c4,
-	0x3c040800, 0x948423c4, 0x3c030800, 0x946323c2, 0x95cf0006, 0x3c020800,
-	0x944223c0, 0x00832023, 0x01e2c023, 0x3065ffff, 0x24a20028, 0x01c24821,
-	0x3082ffff, 0x14c0001a, 0x01226021, 0x9582000c, 0x3042003f, 0x3c010800,
-	0xa42223c6, 0x95820004, 0x95830006, 0x3c010800, 0xac2023d4, 0x3c010800,
-	0xac2023d8, 0x00021400, 0x00431025, 0x3c010800, 0xac221bb0, 0x95220004,
-	0x3c010800, 0xa4221bb4, 0x95230002, 0x01e51023, 0x0043102a, 0x10400010,
-	0x24020001, 0x3c010800, 0x0a00039a, 0xac2223e8, 0x3c030800, 0x8c6323d8,
-	0x3c020800, 0x94421bb4, 0x00431021, 0xa5220004, 0x3c020800, 0x94421bb0,
-	0xa5820004, 0x3c020800, 0x8c421bb0, 0xa5820006, 0x3c020800, 0x8c4223e0,
-	0x3c0d0800, 0x8dad23d4, 0x3c0a0800, 0x144000e5, 0x8d4a23d8, 0x3c020800,
-	0x94421bb4, 0x004a1821, 0x3063ffff, 0x0062182b, 0x24020002, 0x10c2000d,
-	0x01435023, 0x3c020800, 0x944223c6, 0x30420009, 0x10400008, 0x00000000,
-	0x9582000c, 0x3042fff6, 0xa582000c, 0x3c020800, 0x944223c6, 0x30420009,
-	0x01a26823, 0x3c020800, 0x8c4223e8, 0x1040004a, 0x01203821, 0x3c020800,
-	0x944223c2, 0x00004021, 0xa520000a, 0x01e21023, 0xa5220002, 0x3082ffff,
-	0x00021042, 0x18400008, 0x00003021, 0x00401821, 0x94e20000, 0x25080001,
-	0x00c23021, 0x0103102a, 0x1440fffb, 0x24e70002, 0x00061c02, 0x30c2ffff,
-	0x00623021, 0x00061402, 0x00c23021, 0x00c02821, 0x00061027, 0xa522000a,
-	0x00003021, 0x2527000c, 0x00004021, 0x94e20000, 0x25080001, 0x00c23021,
-	0x2d020004, 0x1440fffb, 0x24e70002, 0x95220002, 0x00004021, 0x91230009,
-	0x00442023, 0x01803821, 0x3082ffff, 0xa4e00010, 0x00621821, 0x00021042,
-	0x18400010, 0x00c33021, 0x00404821, 0x94e20000, 0x24e70002, 0x00c23021,
+	0x3c110800, 0x02308821, 0x0e000625, 0x8e311bc8, 0x00402821, 0x10a00054,
+	0x00000000, 0x9628000a, 0x31020040, 0x10400005, 0x2407180c, 0x8e22000c,
+	0x2407188c, 0x00021400, 0xaca20018, 0x3c030800, 0x00701821, 0x8c631bd0,
+	0x3c020800, 0x00501021, 0x8c421bd4, 0x00031d00, 0x00021400, 0x00621825,
+	0xaca30014, 0x8ec30004, 0x96220008, 0x00432023, 0x3242ffff, 0x3083ffff,
+	0x00431021, 0x0282102a, 0x14400002, 0x02b23023, 0x00803021, 0x8e620000,
+	0x30c4ffff, 0x00441021, 0xae620000, 0x8e220000, 0xaca20000, 0x8e220004,
+	0x8e63fff4, 0x00431021, 0xaca20004, 0xa4a6000e, 0x8e62fff4, 0x00441021,
+	0xae62fff4, 0x96230008, 0x0043102a, 0x14400005, 0x02469021, 0x8e62fff0,
+	0xae60fff4, 0x24420001, 0xae62fff0, 0xaca00008, 0x3242ffff, 0x14540008,
+	0x24020305, 0x31020080, 0x54400001, 0x34e70010, 0x24020905, 0xa4a2000c,
+	0x0a0001cb, 0x34e70020, 0xa4a2000c, 0x3c020800, 0x8c4223f0, 0x10400003,
+	0x3c024b65, 0x0a0001d3, 0x34427654, 0x3c02b49a, 0x344289ab, 0xaca2001c,
+	0x30e2ffff, 0xaca20010, 0x0e0005a2, 0x00a02021, 0x3242ffff, 0x0054102b,
+	0x1440ffa9, 0x00000000, 0x24020002, 0x3c010800, 0x0a0001e6, 0xa0221b98,
+	0x8ec2083c, 0x24420001, 0x0a0001e6, 0xaec2083c, 0x0e0004c0, 0x00000000,
+	0x8fbf002c, 0x8fb60028, 0x8fb50024, 0x8fb40020, 0x8fb3001c, 0x8fb20018,
+	0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0030, 0x27bdffd0, 0xafbf0028,
+	0xafb30024, 0xafb20020, 0xafb1001c, 0xafb00018, 0x8f725c9c, 0x3c0200ff,
+	0x3442fff8, 0x3c070800, 0x24e71bb4, 0x02428824, 0x9623000e, 0x8ce20000,
+	0x00431021, 0xace20000, 0x8e220010, 0x30420020, 0x14400011, 0x00809821,
+	0x0e00063b, 0x02202021, 0x3c02c000, 0x02421825, 0xaf635c9c, 0x8f625c90,
+	0x30420002, 0x1040011e, 0x00000000, 0xaf635c9c, 0x8f625c90, 0x30420002,
+	0x10400119, 0x00000000, 0x0a00020d, 0x00000000, 0x8e240008, 0x8e230014,
+	0x00041402, 0x000231c0, 0x00031502, 0x304201ff, 0x2442ffff, 0x3042007f,
+	0x00031942, 0x30637800, 0x00021100, 0x24424000, 0x00624821, 0x9522000a,
+	0x3084ffff, 0x30420008, 0x104000b0, 0x000429c0, 0x3c020800, 0x8c422400,
+	0x14400024, 0x24c50008, 0x94c20014, 0x3c010800, 0xa42223d0, 0x8cc40010,
+	0x00041402, 0x3c010800, 0xa42223d2, 0x3c010800, 0xa42423d4, 0x94c2000e,
+	0x3083ffff, 0x00431023, 0x3c010800, 0xac222408, 0x94c2001a, 0x3c010800,
+	0xac262400, 0x3c010800, 0xac322404, 0x3c010800, 0xac2223fc, 0x3c02c000,
+	0x02421825, 0xaf635c9c, 0x8f625c90, 0x30420002, 0x104000e5, 0x00000000,
+	0xaf635c9c, 0x8f625c90, 0x30420002, 0x104000e0, 0x00000000, 0x0a000246,
+	0x00000000, 0x94c2000e, 0x3c030800, 0x946323d4, 0x00434023, 0x3103ffff,
+	0x2c620008, 0x1040001c, 0x00000000, 0x94c20014, 0x24420028, 0x00a22821,
+	0x00031042, 0x1840000b, 0x00002021, 0x24e60848, 0x00403821, 0x94a30000,
+	0x8cc20000, 0x24840001, 0x00431021, 0xacc20000, 0x0087102a, 0x1440fff9,
+	0x24a50002, 0x31020001, 0x1040001f, 0x3c024000, 0x3c040800, 0x248423fc,
+	0xa0a00001, 0x94a30000, 0x8c820000, 0x00431021, 0x0a000285, 0xac820000,
+	0x8f626800, 0x3c030010, 0x00431024, 0x10400009, 0x00000000, 0x94c2001a,
+	0x3c030800, 0x8c6323fc, 0x00431021, 0x3c010800, 0xac2223fc, 0x0a000286,
+	0x3c024000, 0x94c2001a, 0x94c4001c, 0x3c030800, 0x8c6323fc, 0x00441023,
+	0x00621821, 0x3c010800, 0xac2323fc, 0x3c024000, 0x02421825, 0xaf635c9c,
+	0x8f625c90, 0x30420002, 0x1440fffc, 0x00000000, 0x9522000a, 0x30420010,
+	0x1040009b, 0x00000000, 0x3c030800, 0x946323d4, 0x3c070800, 0x24e72400,
+	0x8ce40000, 0x8f626800, 0x24630030, 0x00832821, 0x3c030010, 0x00431024,
+	0x1440000a, 0x00000000, 0x94a20004, 0x3c040800, 0x8c842408, 0x3c030800,
+	0x8c6323fc, 0x00441023, 0x00621821, 0x3c010800, 0xac2323fc, 0x3c040800,
+	0x8c8423fc, 0x00041c02, 0x3082ffff, 0x00622021, 0x00041402, 0x00822021,
+	0x00041027, 0xa4a20006, 0x3c030800, 0x8c632404, 0x3c0200ff, 0x3442fff8,
+	0x00628824, 0x96220008, 0x24050001, 0x24034000, 0x000231c0, 0x00801021,
+	0xa4c2001a, 0xa4c0001c, 0xace00000, 0x3c010800, 0xac251b60, 0xaf635cb8,
+	0x8f625cb0, 0x30420002, 0x10400003, 0x00000000, 0x3c010800, 0xac201b60,
+	0x8e220008, 0xaf625cb8, 0x8f625cb0, 0x30420002, 0x10400003, 0x00000000,
+	0x3c010800, 0xac201b60, 0x3c020800, 0x8c421b60, 0x1040ffec, 0x00000000,
+	0x3c040800, 0x0e00063b, 0x8c842404, 0x0a00032a, 0x00000000, 0x3c030800,
+	0x90631b98, 0x24020002, 0x14620003, 0x3c034b65, 0x0a0002e1, 0x00008021,
+	0x8e22001c, 0x34637654, 0x10430002, 0x24100002, 0x24100001, 0x00c02021,
+	0x0e000350, 0x02003021, 0x24020003, 0x3c010800, 0xa0221b98, 0x24020002,
+	0x1202000a, 0x24020001, 0x3c030800, 0x8c6323f0, 0x10620006, 0x00000000,
+	0x3c020800, 0x944223d8, 0x00021400, 0x0a00031f, 0xae220014, 0x3c040800,
+	0x248423da, 0x94820000, 0x00021400, 0xae220014, 0x3c020800, 0x8c421bbc,
+	0x3c03c000, 0x3c010800, 0xa0201b98, 0x00431025, 0xaf625c5c, 0x8f625c50,
+	0x30420002, 0x10400009, 0x00000000, 0x2484f7e2, 0x8c820000, 0x00431025,
+	0xaf625c5c, 0x8f625c50, 0x30420002, 0x1440fffa, 0x00000000, 0x3c020800,
+	0x24421b84, 0x8c430000, 0x24630001, 0xac430000, 0x8f630c14, 0x3063000f,
+	0x2c620002, 0x1440000c, 0x3c024000, 0x8f630c14, 0x3c020800, 0x8c421b40,
+	0x3063000f, 0x24420001, 0x3c010800, 0xac221b40, 0x2c620002, 0x1040fff7,
+	0x00000000, 0x3c024000, 0x02421825, 0xaf635c9c, 0x8f625c90, 0x30420002,
+	0x1440fffc, 0x00000000, 0x12600003, 0x00000000, 0x0e0004c0, 0x00000000,
+	0x8fbf0028, 0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, 0x03e00008,
+	0x27bd0030, 0x8f634450, 0x3c040800, 0x24841b88, 0x8c820000, 0x00031c02,
+	0x0043102b, 0x14400007, 0x3c038000, 0x8c840004, 0x8f624450, 0x00021c02,
+	0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444, 0x00431024,
+	0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff, 0x3c024000,
+	0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc, 0x00000000,
+	0x03e00008, 0x00000000, 0x27bdffe0, 0x00805821, 0x14c00011, 0x256e0008,
+	0x3c020800, 0x8c4223f4, 0x10400007, 0x24020016, 0x3c010800, 0xa42223d2,
+	0x2402002a, 0x3c010800, 0x0a000364, 0xa42223d4, 0x8d670010, 0x00071402,
+	0x3c010800, 0xa42223d2, 0x3c010800, 0xa42723d4, 0x3c040800, 0x948423d4,
+	0x3c030800, 0x946323d2, 0x95cf0006, 0x3c020800, 0x944223d0, 0x00832023,
+	0x01e2c023, 0x3065ffff, 0x24a20028, 0x01c24821, 0x3082ffff, 0x14c0001a,
+	0x01226021, 0x9582000c, 0x3042003f, 0x3c010800, 0xa42223d6, 0x95820004,
+	0x95830006, 0x3c010800, 0xac2023e4, 0x3c010800, 0xac2023e8, 0x00021400,
+	0x00431025, 0x3c010800, 0xac221bc0, 0x95220004, 0x3c010800, 0xa4221bc4,
+	0x95230002, 0x01e51023, 0x0043102a, 0x10400010, 0x24020001, 0x3c010800,
+	0x0a000398, 0xac2223f8, 0x3c030800, 0x8c6323e8, 0x3c020800, 0x94421bc4,
+	0x00431021, 0xa5220004, 0x3c020800, 0x94421bc0, 0xa5820004, 0x3c020800,
+	0x8c421bc0, 0xa5820006, 0x3c020800, 0x8c4223f0, 0x3c0d0800, 0x8dad23e4,
+	0x3c0a0800, 0x144000e5, 0x8d4a23e8, 0x3c020800, 0x94421bc4, 0x004a1821,
+	0x3063ffff, 0x0062182b, 0x24020002, 0x10c2000d, 0x01435023, 0x3c020800,
+	0x944223d6, 0x30420009, 0x10400008, 0x00000000, 0x9582000c, 0x3042fff6,
+	0xa582000c, 0x3c020800, 0x944223d6, 0x30420009, 0x01a26823, 0x3c020800,
+	0x8c4223f8, 0x1040004a, 0x01203821, 0x3c020800, 0x944223d2, 0x00004021,
+	0xa520000a, 0x01e21023, 0xa5220002, 0x3082ffff, 0x00021042, 0x18400008,
+	0x00003021, 0x00401821, 0x94e20000, 0x25080001, 0x00c23021, 0x0103102a,
+	0x1440fffb, 0x24e70002, 0x00061c02, 0x30c2ffff, 0x00623021, 0x00061402,
+	0x00c23021, 0x00c02821, 0x00061027, 0xa522000a, 0x00003021, 0x2527000c,
+	0x00004021, 0x94e20000, 0x25080001, 0x00c23021, 0x2d020004, 0x1440fffb,
+	0x24e70002, 0x95220002, 0x00004021, 0x91230009, 0x00442023, 0x01803821,
+	0x3082ffff, 0xa4e00010, 0x00621821, 0x00021042, 0x18400010, 0x00c33021,
+	0x00404821, 0x94e20000, 0x24e70002, 0x00c23021, 0x30e2007f, 0x14400006,
+	0x25080001, 0x8d630000, 0x3c02007f, 0x3442ff80, 0x00625824, 0x25670008,
+	0x0109102a, 0x1440fff3, 0x00000000, 0x30820001, 0x10400005, 0x00061c02,
+	0xa0e00001, 0x94e20000, 0x00c23021, 0x00061c02, 0x30c2ffff, 0x00623021,
+	0x00061402, 0x00c23021, 0x0a00047d, 0x30c6ffff, 0x24020002, 0x14c20081,
+	0x00000000, 0x3c020800, 0x8c42240c, 0x14400007, 0x00000000, 0x3c020800,
+	0x944223d2, 0x95230002, 0x01e21023, 0x10620077, 0x00000000, 0x3c020800,
+	0x944223d2, 0x01e21023, 0xa5220002, 0x3c020800, 0x8c42240c, 0x1040001a,
+	0x31e3ffff, 0x8dc70010, 0x3c020800, 0x94421b96, 0x00e04021, 0x00072c02,
+	0x00aa2021, 0x00431023, 0x00823823, 0x00072402, 0x30e2ffff, 0x00823821,
+	0x00071027, 0xa522000a, 0x3102ffff, 0x3c040800, 0x948423d4, 0x00453023,
+	0x00e02821, 0x00641823, 0x006d1821, 0x00c33021, 0x00061c02, 0x30c2ffff,
+	0x0a00047d, 0x00623021, 0x01203821, 0x00004021, 0x3082ffff, 0x00021042,
+	0x18400008, 0x00003021, 0x00401821, 0x94e20000, 0x25080001, 0x00c23021,
+	0x0103102a, 0x1440fffb, 0x24e70002, 0x00061c02, 0x30c2ffff, 0x00623021,
+	0x00061402, 0x00c23021, 0x00c02821, 0x00061027, 0xa522000a, 0x00003021,
+	0x2527000c, 0x00004021, 0x94e20000, 0x25080001, 0x00c23021, 0x2d020004,
+	0x1440fffb, 0x24e70002, 0x95220002, 0x00004021, 0x91230009, 0x00442023,
+	0x01803821, 0x3082ffff, 0xa4e00010, 0x3c040800, 0x948423d4, 0x00621821,
+	0x00c33021, 0x00061c02, 0x30c2ffff, 0x00623021, 0x00061c02, 0x3c020800,
+	0x944223d0, 0x00c34821, 0x00441023, 0x00021fc2, 0x00431021, 0x00021043,
+	0x18400010, 0x00003021, 0x00402021, 0x94e20000, 0x24e70002, 0x00c23021,
 	0x30e2007f, 0x14400006, 0x25080001, 0x8d630000, 0x3c02007f, 0x3442ff80,
-	0x00625824, 0x25670008, 0x0109102a, 0x1440fff3, 0x00000000, 0x30820001,
-	0x10400005, 0x00061c02, 0xa0e00001, 0x94e20000, 0x00c23021, 0x00061c02,
-	0x30c2ffff, 0x00623021, 0x00061402, 0x00c23021, 0x0a00047f, 0x30c6ffff,
-	0x24020002, 0x14c20081, 0x00000000, 0x3c020800, 0x8c4223fc, 0x14400007,
-	0x00000000, 0x3c020800, 0x944223c2, 0x95230002, 0x01e21023, 0x10620077,
-	0x00000000, 0x3c020800, 0x944223c2, 0x01e21023, 0xa5220002, 0x3c020800,
-	0x8c4223fc, 0x1040001a, 0x31e3ffff, 0x8dc70010, 0x3c020800, 0x94421b86,
-	0x00e04021, 0x00072c02, 0x00aa2021, 0x00431023, 0x00823823, 0x00072402,
-	0x30e2ffff, 0x00823821, 0x00071027, 0xa522000a, 0x3102ffff, 0x3c040800,
-	0x948423c4, 0x00453023, 0x00e02821, 0x00641823, 0x006d1821, 0x00c33021,
-	0x00061c02, 0x30c2ffff, 0x0a00047f, 0x00623021, 0x01203821, 0x00004021,
-	0x3082ffff, 0x00021042, 0x18400008, 0x00003021, 0x00401821, 0x94e20000,
-	0x25080001, 0x00c23021, 0x0103102a, 0x1440fffb, 0x24e70002, 0x00061c02,
-	0x30c2ffff, 0x00623021, 0x00061402, 0x00c23021, 0x00c02821, 0x00061027,
-	0xa522000a, 0x00003021, 0x2527000c, 0x00004021, 0x94e20000, 0x25080001,
-	0x00c23021, 0x2d020004, 0x1440fffb, 0x24e70002, 0x95220002, 0x00004021,
-	0x91230009, 0x00442023, 0x01803821, 0x3082ffff, 0xa4e00010, 0x3c040800,
-	0x948423c4, 0x00621821, 0x00c33021, 0x00061c02, 0x30c2ffff, 0x00623021,
-	0x00061c02, 0x3c020800, 0x944223c0, 0x00c34821, 0x00441023, 0x00021fc2,
-	0x00431021, 0x00021043, 0x18400010, 0x00003021, 0x00402021, 0x94e20000,
-	0x24e70002, 0x00c23021, 0x30e2007f, 0x14400006, 0x25080001, 0x8d630000,
-	0x3c02007f, 0x3442ff80, 0x00625824, 0x25670008, 0x0104102a, 0x1440fff3,
-	0x00000000, 0x3c020800, 0x944223dc, 0x00c23021, 0x3122ffff, 0x00c23021,
-	0x00061c02, 0x30c2ffff, 0x00623021, 0x00061402, 0x00c23021, 0x00c04021,
-	0x00061027, 0xa5820010, 0xadc00014, 0x0a00049f, 0xadc00000, 0x8dc70010,
-	0x00e04021, 0x11400007, 0x00072c02, 0x00aa3021, 0x00061402, 0x30c3ffff,
-	0x00433021, 0x00061402, 0x00c22821, 0x00051027, 0xa522000a, 0x3c030800,
-	0x946323c4, 0x3102ffff, 0x01e21021, 0x00433023, 0x00cd3021, 0x00061c02,
-	0x30c2ffff, 0x00623021, 0x00061402, 0x00c23021, 0x00c04021, 0x00061027,
-	0xa5820010, 0x3102ffff, 0x00051c00, 0x00431025, 0xadc20010, 0x3c020800,
-	0x8c4223e4, 0x10400002, 0x25e2fff2, 0xa5c20034, 0x3c020800, 0x8c4223d8,
-	0x3c040800, 0x8c8423d4, 0x24420001, 0x3c010800, 0xac2223d8, 0x3c020800,
-	0x8c421bb0, 0x3303ffff, 0x00832021, 0x3c010800, 0xac2423d4, 0x00431821,
-	0x0062102b, 0x10400003, 0x2482ffff, 0x3c010800, 0xac2223d4, 0x3c010800,
-	0xac231bb0, 0x03e00008, 0x27bd0020, 0x27bdffb8, 0x3c050800, 0x24a51b86,
-	0xafbf0044, 0xafbe0040, 0xafb7003c, 0xafb60038, 0xafb50034, 0xafb40030,
-	0xafb3002c, 0xafb20028, 0xafb10024, 0xafb00020, 0x94a90000, 0x3c020800,
-	0x944223c0, 0x3c030800, 0x8c631ba0, 0x3c040800, 0x8c841b9c, 0x01221023,
-	0x0064182a, 0xa7a9001e, 0x106000bc, 0xa7a20016, 0x24be0022, 0x97b6001e,
-	0x24b3001a, 0x24b70016, 0x8fc20000, 0x14400008, 0x00000000, 0x8fc2fff8,
-	0x97a30016, 0x8fc4fff4, 0x00431021, 0x0082202a, 0x148000ae, 0x00000000,
-	0x97d50818, 0x32a2ffff, 0x104000a1, 0x00009021, 0x0040a021, 0x00008821,
-	0x0e000621, 0x00000000, 0x00403021, 0x14c00007, 0x00000000, 0x3c020800,
-	0x8c4223cc, 0x24420001, 0x3c010800, 0x0a000593, 0xac2223cc, 0x3c100800,
-	0x02118021, 0x8e101bb8, 0x9608000a, 0x31020040, 0x10400004, 0x2407180c,
-	0x8e02000c, 0x2407188c, 0xacc20018, 0x31020080, 0x54400001, 0x34e70010,
-	0x3c020800, 0x00511021, 0x8c421bc0, 0x3c030800, 0x00711821, 0x8c631bc4,
-	0x00021500, 0x00031c00, 0x00431025, 0xacc20014, 0x96040008, 0x3242ffff,
-	0x00821021, 0x0282102a, 0x14400002, 0x02b22823, 0x00802821, 0x8e020000,
-	0x02459021, 0xacc20000, 0x8e020004, 0x00c02021, 0x26310010, 0xac820004,
-	0x30e2ffff, 0xac800008, 0xa485000e, 0xac820010, 0x24020305, 0x0e00059f,
-	0xa482000c, 0x3242ffff, 0x0054102b, 0x1440ffc6, 0x3242ffff, 0x0a00058b,
-	0x00000000, 0x8e620000, 0x8e63fffc, 0x0043102a, 0x10400066, 0x00000000,
-	0x8e62fff0, 0x00028900, 0x3c100800, 0x02118021, 0x0e000621, 0x8e101bb8,
-	0x00403021, 0x14c00005, 0x00000000, 0x8e62082c, 0x24420001, 0x0a000593,
-	0xae62082c, 0x9608000a, 0x31020040, 0x10400004, 0x2407180c, 0x8e02000c,
-	0x2407188c, 0xacc20018, 0x3c020800, 0x00511021, 0x8c421bc0, 0x3c030800,
-	0x00711821, 0x8c631bc4, 0x00021500, 0x00031c00, 0x00431025, 0xacc20014,
-	0x8e63fff4, 0x96020008, 0x00432023, 0x3242ffff, 0x3083ffff, 0x00431021,
-	0x02c2102a, 0x10400003, 0x00802821, 0x97a9001e, 0x01322823, 0x8e620000,
-	0x30a4ffff, 0x00441021, 0xae620000, 0xa4c5000e, 0x8e020000, 0xacc20000,
-	0x8e020004, 0x8e63fff4, 0x00431021, 0xacc20004, 0x8e63fff4, 0x96020008,
-	0x00641821, 0x0062102a, 0x14400006, 0x02459021, 0x8e62fff0, 0xae60fff4,
-	0x24420001, 0x0a00056e, 0xae62fff0, 0xae63fff4, 0xacc00008, 0x3242ffff,
-	0x10560003, 0x31020004, 0x10400006, 0x24020305, 0x31020080, 0x54400001,
-	0x34e70010, 0x34e70020, 0x24020905, 0xa4c2000c, 0x8ee30000, 0x8ee20004,
-	0x14620007, 0x3c02b49a, 0x8ee20860, 0x54400001, 0x34e70400, 0x3c024b65,
-	0x0a000585, 0x34427654, 0x344289ab, 0xacc2001c, 0x30e2ffff, 0xacc20010,
-	0x0e00059f, 0x00c02021, 0x3242ffff, 0x0056102b, 0x1440ff9c, 0x00000000,
-	0x8e620000, 0x8e63fffc, 0x0043102a, 0x1440ff4a, 0x00000000, 0x8fbf0044,
-	0x8fbe0040, 0x8fb7003c, 0x8fb60038, 0x8fb50034, 0x8fb40030, 0x8fb3002c,
-	0x8fb20028, 0x8fb10024, 0x8fb00020, 0x03e00008, 0x27bd0048, 0x27bdffe8,
-	0xafbf0014, 0xafb00010, 0x8f624450, 0x8f634410, 0x0a0005ae, 0x00808021,
-	0x8f626820, 0x30422000, 0x10400003, 0x00000000, 0x0e0001ef, 0x00002021,
-	0x8f624450, 0x8f634410, 0x3042ffff, 0x0043102b, 0x1440fff5, 0x00000000,
-	0x8f630c14, 0x3063000f, 0x2c620002, 0x1440000b, 0x00000000, 0x8f630c14,
-	0x3c020800, 0x8c421b30, 0x3063000f, 0x24420001, 0x3c010800, 0xac221b30,
-	0x2c620002, 0x1040fff7, 0x00000000, 0xaf705c18, 0x8f625c10, 0x30420002,
-	0x10400009, 0x00000000, 0x8f626820, 0x30422000, 0x1040fff8, 0x00000000,
-	0x0e0001ef, 0x00002021, 0x0a0005c1, 0x00000000, 0x8fbf0014, 0x8fb00010,
-	0x03e00008, 0x27bd0018, 0x00000000, 0x00000000, 0x27bdffe8, 0x3c1bc000,
-	0xafbf0014, 0xafb00010, 0xaf60680c, 0x8f626804, 0x34420082, 0xaf626804,
-	0x8f634000, 0x24020b50, 0x3c010800, 0xac221b44, 0x24020b78, 0x3c010800,
-	0xac221b54, 0x34630002, 0xaf634000, 0x0e000601, 0x00808021, 0x3c010800,
-	0xa0221b58, 0x304200ff, 0x24030002, 0x14430005, 0x00000000, 0x3c020800,
-	0x8c421b44, 0x0a0005f4, 0xac5000c0, 0x3c020800, 0x8c421b44, 0xac5000bc,
-	0x8f624434, 0x8f634438, 0x8f644410, 0x3c010800, 0xac221b4c, 0x3c010800,
-	0xac231b5c, 0x3c010800, 0xac241b48, 0x8fbf0014, 0x8fb00010, 0x03e00008,
-	0x27bd0018, 0x3c040800, 0x8c870000, 0x3c03aa55, 0x3463aa55, 0x3c06c003,
-	0xac830000, 0x8cc20000, 0x14430007, 0x24050002, 0x3c0355aa, 0x346355aa,
-	0xac830000, 0x8cc20000, 0x50430001, 0x24050001, 0x3c020800, 0xac470000,
-	0x03e00008, 0x00a01021, 0x27bdfff8, 0x18800009, 0x00002821, 0x8f63680c,
-	0x8f62680c, 0x1043fffe, 0x00000000, 0x24a50001, 0x00a4102a, 0x1440fff9,
-	0x00000000, 0x03e00008, 0x27bd0008, 0x8f634450, 0x3c020800, 0x8c421b4c,
-	0x00031c02, 0x0043102b, 0x14400008, 0x3c038000, 0x3c040800, 0x8c841b5c,
-	0x8f624450, 0x00021c02, 0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444,
-	0x8f624444, 0x00431024, 0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008,
-	0x3042ffff, 0x3082ffff, 0x2442e000, 0x2c422001, 0x14400003, 0x3c024000,
-	0x0a000644, 0x2402ffff, 0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002,
-	0x1440fffc, 0x00001021, 0x03e00008, 0x00000000, 0x8f624450, 0x3c030800,
-	0x8c631b48, 0x0a00064d, 0x3042ffff, 0x8f624450, 0x3042ffff, 0x0043102b,
-	0x1440fffc, 0x00000000, 0x03e00008, 0x00000000, 0x27bdffe0, 0x00802821,
-	0x3c040800, 0x24841ae0, 0x00003021, 0x00003821, 0xafbf0018, 0xafa00010,
-	0x0e000678, 0xafa00014, 0x0a00065c, 0x00000000, 0x8fbf0018, 0x03e00008,
-	0x27bd0020, 0x00000000, 0x00000000, 0x00000000, 0x3c020800, 0x34423000,
-	0x3c030800, 0x34633000, 0x3c040800, 0x348437ff, 0x3c010800, 0xac221b64,
-	0x24020040, 0x3c010800, 0xac221b68, 0x3c010800, 0xac201b60, 0xac600000,
-	0x24630004, 0x0083102b, 0x5040fffd, 0xac600000, 0x03e00008, 0x00000000,
-	0x00804821, 0x8faa0010, 0x3c020800, 0x8c421b60, 0x3c040800, 0x8c841b68,
-	0x8fab0014, 0x24430001, 0x0044102b, 0x3c010800, 0xac231b60, 0x14400003,
-	0x00004021, 0x3c010800, 0xac201b60, 0x3c020800, 0x8c421b60, 0x3c030800,
-	0x8c631b64, 0x91240000, 0x00021140, 0x00431021, 0x00481021, 0x25080001,
-	0xa0440000, 0x29020008, 0x1440fff4, 0x25290001, 0x3c020800, 0x8c421b60,
-	0x3c030800, 0x8c631b64, 0x8f64680c, 0x00021140, 0x00431021, 0xac440008,
-	0xac45000c, 0xac460010, 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c,
-	0x00000000, 0x00000000,
+	0x00625824, 0x25670008, 0x0104102a, 0x1440fff3, 0x00000000, 0x3c020800,
+	0x944223ec, 0x00c23021, 0x3122ffff, 0x00c23021, 0x00061c02, 0x30c2ffff,
+	0x00623021, 0x00061402, 0x00c23021, 0x00c04021, 0x00061027, 0xa5820010,
+	0xadc00014, 0x0a00049d, 0xadc00000, 0x8dc70010, 0x00e04021, 0x11400007,
+	0x00072c02, 0x00aa3021, 0x00061402, 0x30c3ffff, 0x00433021, 0x00061402,
+	0x00c22821, 0x00051027, 0xa522000a, 0x3c030800, 0x946323d4, 0x3102ffff,
+	0x01e21021, 0x00433023, 0x00cd3021, 0x00061c02, 0x30c2ffff, 0x00623021,
+	0x00061402, 0x00c23021, 0x00c04021, 0x00061027, 0xa5820010, 0x3102ffff,
+	0x00051c00, 0x00431025, 0xadc20010, 0x3c020800, 0x8c4223f4, 0x10400005,
+	0x2de205eb, 0x14400002, 0x25e2fff2, 0x34028870, 0xa5c20034, 0x3c030800,
+	0x246323e8, 0x8c620000, 0x24420001, 0xac620000, 0x3c040800, 0x8c8423e4,
+	0x3c020800, 0x8c421bc0, 0x3303ffff, 0x00832021, 0x00431821, 0x0062102b,
+	0x3c010800, 0xac2423e4, 0x10400003, 0x2482ffff, 0x3c010800, 0xac2223e4,
+	0x3c010800, 0xac231bc0, 0x03e00008, 0x27bd0020, 0x27bdffb8, 0x3c050800,
+	0x24a51b96, 0xafbf0044, 0xafbe0040, 0xafb7003c, 0xafb60038, 0xafb50034,
+	0xafb40030, 0xafb3002c, 0xafb20028, 0xafb10024, 0xafb00020, 0x94a90000,
+	0x3c020800, 0x944223d0, 0x3c030800, 0x8c631bb0, 0x3c040800, 0x8c841bac,
+	0x01221023, 0x0064182a, 0xa7a9001e, 0x106000be, 0xa7a20016, 0x24be0022,
+	0x97b6001e, 0x24b3001a, 0x24b70016, 0x8fc20000, 0x14400008, 0x00000000,
+	0x8fc2fff8, 0x97a30016, 0x8fc4fff4, 0x00431021, 0x0082202a, 0x148000b0,
+	0x00000000, 0x97d50818, 0x32a2ffff, 0x104000a3, 0x00009021, 0x0040a021,
+	0x00008821, 0x0e000625, 0x00000000, 0x00403021, 0x14c00007, 0x00000000,
+	0x3c020800, 0x8c4223dc, 0x24420001, 0x3c010800, 0x0a000596, 0xac2223dc,
+	0x3c100800, 0x02118021, 0x8e101bc8, 0x9608000a, 0x31020040, 0x10400005,
+	0x2407180c, 0x8e02000c, 0x2407188c, 0x00021400, 0xacc20018, 0x31020080,
+	0x54400001, 0x34e70010, 0x3c020800, 0x00511021, 0x8c421bd0, 0x3c030800,
+	0x00711821, 0x8c631bd4, 0x00021500, 0x00031c00, 0x00431025, 0xacc20014,
+	0x96040008, 0x3242ffff, 0x00821021, 0x0282102a, 0x14400002, 0x02b22823,
+	0x00802821, 0x8e020000, 0x02459021, 0xacc20000, 0x8e020004, 0x00c02021,
+	0x26310010, 0xac820004, 0x30e2ffff, 0xac800008, 0xa485000e, 0xac820010,
+	0x24020305, 0x0e0005a2, 0xa482000c, 0x3242ffff, 0x0054102b, 0x1440ffc5,
+	0x3242ffff, 0x0a00058e, 0x00000000, 0x8e620000, 0x8e63fffc, 0x0043102a,
+	0x10400067, 0x00000000, 0x8e62fff0, 0x00028900, 0x3c100800, 0x02118021,
+	0x0e000625, 0x8e101bc8, 0x00403021, 0x14c00005, 0x00000000, 0x8e62082c,
+	0x24420001, 0x0a000596, 0xae62082c, 0x9608000a, 0x31020040, 0x10400005,
+	0x2407180c, 0x8e02000c, 0x2407188c, 0x00021400, 0xacc20018, 0x3c020800,
+	0x00511021, 0x8c421bd0, 0x3c030800, 0x00711821, 0x8c631bd4, 0x00021500,
+	0x00031c00, 0x00431025, 0xacc20014, 0x8e63fff4, 0x96020008, 0x00432023,
+	0x3242ffff, 0x3083ffff, 0x00431021, 0x02c2102a, 0x10400003, 0x00802821,
+	0x97a9001e, 0x01322823, 0x8e620000, 0x30a4ffff, 0x00441021, 0xae620000,
+	0xa4c5000e, 0x8e020000, 0xacc20000, 0x8e020004, 0x8e63fff4, 0x00431021,
+	0xacc20004, 0x8e63fff4, 0x96020008, 0x00641821, 0x0062102a, 0x14400006,
+	0x02459021, 0x8e62fff0, 0xae60fff4, 0x24420001, 0x0a000571, 0xae62fff0,
+	0xae63fff4, 0xacc00008, 0x3242ffff, 0x10560003, 0x31020004, 0x10400006,
+	0x24020305, 0x31020080, 0x54400001, 0x34e70010, 0x34e70020, 0x24020905,
+	0xa4c2000c, 0x8ee30000, 0x8ee20004, 0x14620007, 0x3c02b49a, 0x8ee20860,
+	0x54400001, 0x34e70400, 0x3c024b65, 0x0a000588, 0x34427654, 0x344289ab,
+	0xacc2001c, 0x30e2ffff, 0xacc20010, 0x0e0005a2, 0x00c02021, 0x3242ffff,
+	0x0056102b, 0x1440ff9b, 0x00000000, 0x8e620000, 0x8e63fffc, 0x0043102a,
+	0x1440ff48, 0x00000000, 0x8fbf0044, 0x8fbe0040, 0x8fb7003c, 0x8fb60038,
+	0x8fb50034, 0x8fb40030, 0x8fb3002c, 0x8fb20028, 0x8fb10024, 0x8fb00020,
+	0x03e00008, 0x27bd0048, 0x27bdffe8, 0xafbf0014, 0xafb00010, 0x8f624450,
+	0x8f634410, 0x0a0005b1, 0x00808021, 0x8f626820, 0x30422000, 0x10400003,
+	0x00000000, 0x0e0001f0, 0x00002021, 0x8f624450, 0x8f634410, 0x3042ffff,
+	0x0043102b, 0x1440fff5, 0x00000000, 0x8f630c14, 0x3063000f, 0x2c620002,
+	0x1440000b, 0x00000000, 0x8f630c14, 0x3c020800, 0x8c421b40, 0x3063000f,
+	0x24420001, 0x3c010800, 0xac221b40, 0x2c620002, 0x1040fff7, 0x00000000,
+	0xaf705c18, 0x8f625c10, 0x30420002, 0x10400009, 0x00000000, 0x8f626820,
+	0x30422000, 0x1040fff8, 0x00000000, 0x0e0001f0, 0x00002021, 0x0a0005c4,
+	0x00000000, 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x00000000,
+	0x00000000, 0x00000000, 0x27bdffe8, 0x3c1bc000, 0xafbf0014, 0xafb00010,
+	0xaf60680c, 0x8f626804, 0x34420082, 0xaf626804, 0x8f634000, 0x24020b50,
+	0x3c010800, 0xac221b54, 0x24020b78, 0x3c010800, 0xac221b64, 0x34630002,
+	0xaf634000, 0x0e000605, 0x00808021, 0x3c010800, 0xa0221b68, 0x304200ff,
+	0x24030002, 0x14430005, 0x00000000, 0x3c020800, 0x8c421b54, 0x0a0005f8,
+	0xac5000c0, 0x3c020800, 0x8c421b54, 0xac5000bc, 0x8f624434, 0x8f634438,
+	0x8f644410, 0x3c010800, 0xac221b5c, 0x3c010800, 0xac231b6c, 0x3c010800,
+	0xac241b58, 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c040800,
+	0x8c870000, 0x3c03aa55, 0x3463aa55, 0x3c06c003, 0xac830000, 0x8cc20000,
+	0x14430007, 0x24050002, 0x3c0355aa, 0x346355aa, 0xac830000, 0x8cc20000,
+	0x50430001, 0x24050001, 0x3c020800, 0xac470000, 0x03e00008, 0x00a01021,
+	0x27bdfff8, 0x18800009, 0x00002821, 0x8f63680c, 0x8f62680c, 0x1043fffe,
+	0x00000000, 0x24a50001, 0x00a4102a, 0x1440fff9, 0x00000000, 0x03e00008,
+	0x27bd0008, 0x8f634450, 0x3c020800, 0x8c421b5c, 0x00031c02, 0x0043102b,
+	0x14400008, 0x3c038000, 0x3c040800, 0x8c841b6c, 0x8f624450, 0x00021c02,
+	0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444, 0x00431024,
+	0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff, 0x3082ffff,
+	0x2442e000, 0x2c422001, 0x14400003, 0x3c024000, 0x0a000648, 0x2402ffff,
+	0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc, 0x00001021,
+	0x03e00008, 0x00000000, 0x8f624450, 0x3c030800, 0x8c631b58, 0x0a000651,
+	0x3042ffff, 0x8f624450, 0x3042ffff, 0x0043102b, 0x1440fffc, 0x00000000,
+	0x03e00008, 0x00000000, 0x27bdffe0, 0x00802821, 0x3c040800, 0x24841af0,
+	0x00003021, 0x00003821, 0xafbf0018, 0xafa00010, 0x0e00067c, 0xafa00014,
+	0x0a000660, 0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x00000000,
+	0x00000000, 0x00000000, 0x3c020800, 0x34423000, 0x3c030800, 0x34633000,
+	0x3c040800, 0x348437ff, 0x3c010800, 0xac221b74, 0x24020040, 0x3c010800,
+	0xac221b78, 0x3c010800, 0xac201b70, 0xac600000, 0x24630004, 0x0083102b,
+	0x5040fffd, 0xac600000, 0x03e00008, 0x00000000, 0x00804821, 0x8faa0010,
+	0x3c020800, 0x8c421b70, 0x3c040800, 0x8c841b78, 0x8fab0014, 0x24430001,
+	0x0044102b, 0x3c010800, 0xac231b70, 0x14400003, 0x00004021, 0x3c010800,
+	0xac201b70, 0x3c020800, 0x8c421b70, 0x3c030800, 0x8c631b74, 0x91240000,
+	0x00021140, 0x00431021, 0x00481021, 0x25080001, 0xa0440000, 0x29020008,
+	0x1440fff4, 0x25290001, 0x3c020800, 0x8c421b70, 0x3c030800, 0x8c631b74,
+	0x8f64680c, 0x00021140, 0x00431021, 0xac440008, 0xac45000c, 0xac460010,
+	0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c, 0x00000000, 0x00000000,
 };
 
 u32 tg3TsoFwRodata[] = {
@@ -4257,201 +4500,200 @@ u32 tg3TsoFwRodata[] = {
 	0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x496e0000, 0x73746b6f,
 	0x66662a2a, 0x00000000, 0x53774576, 0x656e7430, 0x00000000, 0x00000000,
 	0x00000000, 0x00000000, 0x66617461, 0x6c457272, 0x00000000, 0x00000000,
+	0x00000000,
 };
 
-#if 0 /* All zeros, don't eat up space with it. */
 u32 tg3TsoFwData[] = {
+	0x00000000, 0x73746b6f, 0x66666c64, 0x5f76312e, 0x362e3000, 0x00000000,
 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-	0x00000000, 0x00000000, 0x00000000
+	0x00000000,
 };
-#endif
 
 /* 5705 needs a special version of the TSO firmware.  */
 #define TG3_TSO5_FW_RELEASE_MAJOR	0x1
-#define TG3_TSO5_FW_RELASE_MINOR	0x1
+#define TG3_TSO5_FW_RELASE_MINOR	0x2
 #define TG3_TSO5_FW_RELEASE_FIX		0x0
 #define TG3_TSO5_FW_START_ADDR		0x00010000
 #define TG3_TSO5_FW_TEXT_ADDR		0x00010000
-#define TG3_TSO5_FW_TEXT_LEN		0xeb0
-#define TG3_TSO5_FW_RODATA_ADDR		0x00010eb0
+#define TG3_TSO5_FW_TEXT_LEN		0xe90
+#define TG3_TSO5_FW_RODATA_ADDR		0x00010e90
 #define TG3_TSO5_FW_RODATA_LEN		0x50
-#define TG3_TSO5_FW_DATA_ADDR		0x00010f20
+#define TG3_TSO5_FW_DATA_ADDR		0x00010f00
 #define TG3_TSO5_FW_DATA_LEN		0x20
-#define TG3_TSO5_FW_SBSS_ADDR		0x00010f40
+#define TG3_TSO5_FW_SBSS_ADDR		0x00010f20
 #define TG3_TSO5_FW_SBSS_LEN		0x28
-#define TG3_TSO5_FW_BSS_ADDR		0x00010f70
+#define TG3_TSO5_FW_BSS_ADDR		0x00010f50
 #define TG3_TSO5_FW_BSS_LEN		0x88
 
-static u32 tg3Tso5FwText[] = {
-	0x0c004003, 0x00000000, 0x00010f30, 0x00000000, 0x10000003, 0x00000000,
+static u32 tg3Tso5FwText[(TG3_TSO5_FW_TEXT_LEN / 4) + 1] = {
+	0x0c004003, 0x00000000, 0x00010f04, 0x00000000, 0x10000003, 0x00000000,
 	0x0000000d, 0x0000000d, 0x3c1d0001, 0x37bde000, 0x03a0f021, 0x3c100001,
 	0x26100000, 0x0c004010, 0x00000000, 0x0000000d, 0x27bdffe0, 0x3c04fefe,
-	0xafbf0018, 0x0c0042f0, 0x34840002, 0x0c00436c, 0x00000000, 0x3c030001,
-	0x90630f54, 0x24020002, 0x3c040001, 0x24840ebc, 0x14620003, 0x24050001,
-	0x3c040001, 0x24840eb0, 0x24060001, 0x00003821, 0xafa00010, 0x0c004380,
+	0xafbf0018, 0x0c0042e8, 0x34840002, 0x0c004364, 0x00000000, 0x3c030001,
+	0x90630f34, 0x24020002, 0x3c040001, 0x24840e9c, 0x14620003, 0x24050001,
+	0x3c040001, 0x24840e90, 0x24060002, 0x00003821, 0xafa00010, 0x0c004378,
 	0xafa00014, 0x0c00402c, 0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020,
 	0x00000000, 0x00000000, 0x27bdffe0, 0xafbf001c, 0xafb20018, 0xafb10014,
-	0x0c0042d3, 0xafb00010, 0x3c128000, 0x24110001, 0x8f706810, 0x32020400,
+	0x0c0042d4, 0xafb00010, 0x3c128000, 0x24110001, 0x8f706810, 0x32020400,
 	0x10400007, 0x00000000, 0x8f641008, 0x00921024, 0x14400003, 0x00000000,
-	0x0c004064, 0x00000000, 0x3c020001, 0x90420f76, 0x10510003, 0x32020200,
+	0x0c004064, 0x00000000, 0x3c020001, 0x90420f56, 0x10510003, 0x32020200,
 	0x1040fff1, 0x00000000, 0x0c0041b4, 0x00000000, 0x08004034, 0x00000000,
 	0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020,
-	0x27bdffe0, 0x3c040001, 0x24840ed0, 0x00002821, 0x00003021, 0x00003821,
-	0xafbf0018, 0xafa00010, 0x0c004380, 0xafa00014, 0x0000d021, 0x24020130,
-	0xaf625000, 0x3c010001, 0xa4200f70, 0x3c010001, 0xa0200f77, 0x8fbf0018,
-	0x03e00008, 0x27bd0020, 0x00000000, 0x00000000, 0x3c030001, 0x24630f80,
+	0x27bdffe0, 0x3c040001, 0x24840eb0, 0x00002821, 0x00003021, 0x00003821,
+	0xafbf0018, 0xafa00010, 0x0c004378, 0xafa00014, 0x0000d021, 0x24020130,
+	0xaf625000, 0x3c010001, 0xa4200f50, 0x3c010001, 0xa0200f57, 0x8fbf0018,
+	0x03e00008, 0x27bd0020, 0x00000000, 0x00000000, 0x3c030001, 0x24630f60,
 	0x90620000, 0x27bdfff0, 0x14400003, 0x0080c021, 0x08004073, 0x00004821,
 	0x3c022000, 0x03021024, 0x10400003, 0x24090002, 0x08004073, 0xa0600000,
 	0x24090001, 0x00181040, 0x30431f80, 0x346f8008, 0x1520004b, 0x25eb0028,
-	0x3c040001, 0x00832021, 0x8c848010, 0x3c050001, 0x24a50f9a, 0x00041402,
-	0xa0a20000, 0x3c010001, 0xa0240f9b, 0x3c020001, 0x00431021, 0x94428014,
-	0x3c010001, 0xa0220f9c, 0x3c0c0001, 0x01836021, 0x8d8c8018, 0x304200ff,
-	0x24420008, 0x000220c3, 0x24020001, 0x3c010001, 0xa0220f80, 0x0124102b,
+	0x3c040001, 0x00832021, 0x8c848010, 0x3c050001, 0x24a50f7a, 0x00041402,
+	0xa0a20000, 0x3c010001, 0xa0240f7b, 0x3c020001, 0x00431021, 0x94428014,
+	0x3c010001, 0xa0220f7c, 0x3c0c0001, 0x01836021, 0x8d8c8018, 0x304200ff,
+	0x24420008, 0x000220c3, 0x24020001, 0x3c010001, 0xa0220f60, 0x0124102b,
 	0x1040000c, 0x00003821, 0x24a6000e, 0x01602821, 0x8ca20000, 0x8ca30004,
 	0x24a50008, 0x24e70001, 0xacc20000, 0xacc30004, 0x00e4102b, 0x1440fff8,
-	0x24c60008, 0x00003821, 0x3c080001, 0x25080f9b, 0x91060000, 0x3c020001,
-	0x90420f9c, 0x2503000d, 0x00c32821, 0x00461023, 0x00021fc2, 0x00431021,
+	0x24c60008, 0x00003821, 0x3c080001, 0x25080f7b, 0x91060000, 0x3c020001,
+	0x90420f7c, 0x2503000d, 0x00c32821, 0x00461023, 0x00021fc2, 0x00431021,
 	0x00021043, 0x1840000c, 0x00002021, 0x91020001, 0x00461023, 0x00021fc2,
 	0x00431021, 0x00021843, 0x94a20000, 0x24e70001, 0x00822021, 0x00e3102a,
 	0x1440fffb, 0x24a50002, 0x00041c02, 0x3082ffff, 0x00622021, 0x00041402,
 	0x00822021, 0x3c02ffff, 0x01821024, 0x3083ffff, 0x00431025, 0x3c010001,
-	0x080040fa, 0xac220fa0, 0x3c050001, 0x24a50f9c, 0x90a20000, 0x3c0c0001,
+	0x080040fa, 0xac220f80, 0x3c050001, 0x24a50f7c, 0x90a20000, 0x3c0c0001,
 	0x01836021, 0x8d8c8018, 0x000220c2, 0x1080000e, 0x00003821, 0x01603021,
 	0x24a5000c, 0x8ca20000, 0x8ca30004, 0x24a50008, 0x24e70001, 0xacc20000,
-	0xacc30004, 0x00e4102b, 0x1440fff8, 0x24c60008, 0x3c050001, 0x24a50f9c,
+	0xacc30004, 0x00e4102b, 0x1440fff8, 0x24c60008, 0x3c050001, 0x24a50f7c,
 	0x90a20000, 0x30430007, 0x24020004, 0x10620011, 0x28620005, 0x10400005,
 	0x24020002, 0x10620008, 0x000710c0, 0x080040fa, 0x00000000, 0x24020006,
 	0x1062000e, 0x000710c0, 0x080040fa, 0x00000000, 0x00a21821, 0x9463000c,
 	0x004b1021, 0x080040fa, 0xa4430000, 0x000710c0, 0x00a21821, 0x8c63000c,
 	0x004b1021, 0x080040fa, 0xac430000, 0x00a21821, 0x8c63000c, 0x004b2021,
 	0x00a21021, 0xac830000, 0x94420010, 0xa4820004, 0x95e70006, 0x3c020001,
-	0x90420f9c, 0x3c030001, 0x90630f9a, 0x00e2c823, 0x3c020001, 0x90420f9b,
+	0x90420f7c, 0x3c030001, 0x90630f7a, 0x00e2c823, 0x3c020001, 0x90420f7b,
 	0x24630028, 0x01e34021, 0x24420028, 0x15200012, 0x01e23021, 0x94c2000c,
-	0x3c010001, 0xa4220f98, 0x94c20004, 0x94c30006, 0x3c010001, 0xa4200f96,
-	0x3c010001, 0xa4200f92, 0x00021400, 0x00431025, 0x3c010001, 0xac220f8c,
-	0x95020004, 0x3c010001, 0x08004124, 0xa4220f90, 0x3c020001, 0x94420f90,
-	0x3c030001, 0x94630f92, 0x00431021, 0xa5020004, 0x3c020001, 0x94420f8c,
-	0xa4c20004, 0x3c020001, 0x8c420f8c, 0xa4c20006, 0x3c040001, 0x94840f92,
-	0x3c020001, 0x94420f90, 0x3c0a0001, 0x954a0f96, 0x00441821, 0x3063ffff,
-	0x0062182a, 0x24020002, 0x1122000b, 0x00832023, 0x3c030001, 0x94630f98,
-	0x30620009, 0x10400006, 0x3062fff6, 0xa4c2000c, 0x3c020001, 0x94420f98,
+	0x3c010001, 0xa4220f78, 0x94c20004, 0x94c30006, 0x3c010001, 0xa4200f76,
+	0x3c010001, 0xa4200f72, 0x00021400, 0x00431025, 0x3c010001, 0xac220f6c,
+	0x95020004, 0x3c010001, 0x08004124, 0xa4220f70, 0x3c020001, 0x94420f70,
+	0x3c030001, 0x94630f72, 0x00431021, 0xa5020004, 0x3c020001, 0x94420f6c,
+	0xa4c20004, 0x3c020001, 0x8c420f6c, 0xa4c20006, 0x3c040001, 0x94840f72,
+	0x3c020001, 0x94420f70, 0x3c0a0001, 0x954a0f76, 0x00441821, 0x3063ffff,
+	0x0062182a, 0x24020002, 0x1122000b, 0x00832023, 0x3c030001, 0x94630f78,
+	0x30620009, 0x10400006, 0x3062fff6, 0xa4c2000c, 0x3c020001, 0x94420f78,
 	0x30420009, 0x01425023, 0x24020001, 0x1122001b, 0x29220002, 0x50400005,
 	0x24020002, 0x11200007, 0x31a2ffff, 0x08004197, 0x00000000, 0x1122001d,
-	0x24020016, 0x08004197, 0x31a2ffff, 0x3c0e0001, 0x95ce0fa0, 0x10800005,
+	0x24020016, 0x08004197, 0x31a2ffff, 0x3c0e0001, 0x95ce0f80, 0x10800005,
 	0x01806821, 0x01c42021, 0x00041c02, 0x3082ffff, 0x00627021, 0x000e1027,
-	0xa502000a, 0x3c030001, 0x90630f9b, 0x31a2ffff, 0x00e21021, 0x0800418d,
-	0x00432023, 0x3c020001, 0x94420fa0, 0x00442021, 0x00041c02, 0x3082ffff,
+	0xa502000a, 0x3c030001, 0x90630f7b, 0x31a2ffff, 0x00e21021, 0x0800418d,
+	0x00432023, 0x3c020001, 0x94420f80, 0x00442021, 0x00041c02, 0x3082ffff,
 	0x00622021, 0x00807021, 0x00041027, 0x08004185, 0xa502000a, 0x3c050001,
-	0x24a50f9a, 0x90a30000, 0x14620002, 0x24e2fff2, 0xa5e20034, 0x90a20000,
-	0x00e21023, 0xa5020002, 0x3c030001, 0x94630fa0, 0x3c020001, 0x94420f7a,
+	0x24a50f7a, 0x90a30000, 0x14620002, 0x24e2fff2, 0xa5e20034, 0x90a20000,
+	0x00e21023, 0xa5020002, 0x3c030001, 0x94630f80, 0x3c020001, 0x94420f5a,
 	0x30e5ffff, 0x00641821, 0x00451023, 0x00622023, 0x00041c02, 0x3082ffff,
-	0x00622021, 0x00041027, 0xa502000a, 0x3c030001, 0x90630f9c, 0x24620001,
+	0x00622021, 0x00041027, 0xa502000a, 0x3c030001, 0x90630f7c, 0x24620001,
 	0x14a20005, 0x00807021, 0x01631021, 0x90420000, 0x08004185, 0x00026200,
 	0x24620002, 0x14a20003, 0x306200fe, 0x004b1021, 0x944c0000, 0x3c020001,
-	0x94420fa2, 0x3183ffff, 0x3c040001, 0x90840f9b, 0x00431021, 0x00e21021,
+	0x94420f82, 0x3183ffff, 0x3c040001, 0x90840f7b, 0x00431021, 0x00e21021,
 	0x00442023, 0x008a2021, 0x00041c02, 0x3082ffff, 0x00622021, 0x00041402,
 	0x00822021, 0x00806821, 0x00041027, 0xa4c20010, 0x31a2ffff, 0x000e1c00,
-	0x00431025, 0x3c040001, 0x24840f92, 0xade20010, 0x94820000, 0x3c050001,
-	0x94a50f96, 0x3c030001, 0x8c630f8c, 0x24420001, 0x00b92821, 0xa4820000,
-	0x3322ffff, 0x00622021, 0x0083182b, 0x3c010001, 0xa4250f96, 0x10600003,
-	0x24a2ffff, 0x3c010001, 0xa4220f96, 0x3c024000, 0x03021025, 0x3c010001,
-	0xac240f8c, 0xaf621008, 0x03e00008, 0x27bd0010, 0x3c030001, 0x90630f76,
+	0x00431025, 0x3c040001, 0x24840f72, 0xade20010, 0x94820000, 0x3c050001,
+	0x94a50f76, 0x3c030001, 0x8c630f6c, 0x24420001, 0x00b92821, 0xa4820000,
+	0x3322ffff, 0x00622021, 0x0083182b, 0x3c010001, 0xa4250f76, 0x10600003,
+	0x24a2ffff, 0x3c010001, 0xa4220f76, 0x3c024000, 0x03021025, 0x3c010001,
+	0xac240f6c, 0xaf621008, 0x03e00008, 0x27bd0010, 0x3c030001, 0x90630f56,
 	0x27bdffe8, 0x24020001, 0xafbf0014, 0x10620026, 0xafb00010, 0x8f620cf4,
-	0x2442ffff, 0x3042007f, 0x00021100, 0x8c434000, 0x3c010001, 0xac230f84,
+	0x2442ffff, 0x3042007f, 0x00021100, 0x8c434000, 0x3c010001, 0xac230f64,
 	0x8c434008, 0x24444000, 0x8c5c4004, 0x30620040, 0x14400002, 0x24020088,
-	0x24020008, 0x3c010001, 0xa4220f88, 0x30620004, 0x10400005, 0x24020001,
-	0x3c010001, 0xa0220f77, 0x080041d5, 0x00031402, 0x3c010001, 0xa0200f77,
-	0x00031402, 0x3c010001, 0xa4220f74, 0x9483000c, 0x24020001, 0x3c010001,
-	0xa4200f70, 0x3c010001, 0xa0220f76, 0x3c010001, 0xa4230f82, 0x24020001,
+	0x24020008, 0x3c010001, 0xa4220f68, 0x30620004, 0x10400005, 0x24020001,
+	0x3c010001, 0xa0220f57, 0x080041d5, 0x00031402, 0x3c010001, 0xa0200f57,
+	0x00031402, 0x3c010001, 0xa4220f54, 0x9483000c, 0x24020001, 0x3c010001,
+	0xa4200f50, 0x3c010001, 0xa0220f56, 0x3c010001, 0xa4230f62, 0x24020001,
 	0x1342001e, 0x00000000, 0x13400005, 0x24020003, 0x13420067, 0x00000000,
-	0x080042cf, 0x00000000, 0x3c020001, 0x94420f82, 0x241a0001, 0x3c010001,
-	0xa4200f7e, 0x3c010001, 0xa4200f72, 0x304407ff, 0x00021bc2, 0x00031823,
+	0x080042cf, 0x00000000, 0x3c020001, 0x94420f62, 0x241a0001, 0x3c010001,
+	0xa4200f5e, 0x3c010001, 0xa4200f52, 0x304407ff, 0x00021bc2, 0x00031823,
 	0x3063003e, 0x34630036, 0x00021242, 0x3042003c, 0x00621821, 0x3c010001,
-	0xa4240f78, 0x00832021, 0x24630030, 0x3c010001, 0xa4240f7a, 0x3c010001,
-	0xa4230f7c, 0x3c060001, 0x24c60f72, 0x94c50000, 0x94c30002, 0x3c040001,
-	0x94840f7a, 0x00651021, 0x0044102a, 0x10400013, 0x3c108000, 0x00a31021,
-	0xa4c20000, 0x3c02a000, 0xaf620cf4, 0x3c010001, 0xa0200f76, 0x8f641008,
+	0xa4240f58, 0x00832021, 0x24630030, 0x3c010001, 0xa4240f5a, 0x3c010001,
+	0xa4230f5c, 0x3c060001, 0x24c60f52, 0x94c50000, 0x94c30002, 0x3c040001,
+	0x94840f5a, 0x00651021, 0x0044102a, 0x10400013, 0x3c108000, 0x00a31021,
+	0xa4c20000, 0x3c02a000, 0xaf620cf4, 0x3c010001, 0xa0200f56, 0x8f641008,
 	0x00901024, 0x14400003, 0x00000000, 0x0c004064, 0x00000000, 0x8f620cf4,
 	0x00501024, 0x104000b7, 0x00000000, 0x0800420f, 0x00000000, 0x3c030001,
-	0x94630f70, 0x00851023, 0xa4c40000, 0x00621821, 0x3042ffff, 0x3c010001,
-	0xa4230f70, 0xaf620ce8, 0x3c020001, 0x94420f88, 0x34420024, 0xaf620cec,
-	0x94c30002, 0x3c020001, 0x94420f70, 0x14620012, 0x3c028000, 0x3c108000,
-	0x3c02a000, 0xaf620cf4, 0x3c010001, 0xa0200f76, 0x8f641008, 0x00901024,
+	0x94630f50, 0x00851023, 0xa4c40000, 0x00621821, 0x3042ffff, 0x3c010001,
+	0xa4230f50, 0xaf620ce8, 0x3c020001, 0x94420f68, 0x34420024, 0xaf620cec,
+	0x94c30002, 0x3c020001, 0x94420f50, 0x14620012, 0x3c028000, 0x3c108000,
+	0x3c02a000, 0xaf620cf4, 0x3c010001, 0xa0200f56, 0x8f641008, 0x00901024,
 	0x14400003, 0x00000000, 0x0c004064, 0x00000000, 0x8f620cf4, 0x00501024,
 	0x1440fff7, 0x00000000, 0x080042cf, 0x241a0003, 0xaf620cf4, 0x3c108000,
 	0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064, 0x00000000,
 	0x8f620cf4, 0x00501024, 0x1440fff7, 0x00000000, 0x080042cf, 0x241a0003,
-	0x3c070001, 0x24e70f70, 0x94e20000, 0x03821021, 0xaf620ce0, 0x3c020001,
-	0x8c420f84, 0xaf620ce4, 0x3c050001, 0x94a50f74, 0x94e30000, 0x3c040001,
-	0x94840f78, 0x3c020001, 0x94420f7e, 0x00a32823, 0x00822023, 0x30a6ffff,
-	0x3083ffff, 0x00c3102b, 0x14400043, 0x00000000, 0x3c020001, 0x94420f7c,
-	0x00021400, 0x00621025, 0xaf620ce8, 0x94e20000, 0x3c030001, 0x94630f74,
+	0x3c070001, 0x24e70f50, 0x94e20000, 0x03821021, 0xaf620ce0, 0x3c020001,
+	0x8c420f64, 0xaf620ce4, 0x3c050001, 0x94a50f54, 0x94e30000, 0x3c040001,
+	0x94840f58, 0x3c020001, 0x94420f5e, 0x00a32823, 0x00822023, 0x30a6ffff,
+	0x3083ffff, 0x00c3102b, 0x14400043, 0x00000000, 0x3c020001, 0x94420f5c,
+	0x00021400, 0x00621025, 0xaf620ce8, 0x94e20000, 0x3c030001, 0x94630f54,
 	0x00441021, 0xa4e20000, 0x3042ffff, 0x14430021, 0x3c020008, 0x3c020001,
-	0x90420f77, 0x10400006, 0x3c03000c, 0x3c020001, 0x94420f88, 0x34630624,
-	0x0800427c, 0x0000d021, 0x3c020001, 0x94420f88, 0x3c030008, 0x34630624,
+	0x90420f57, 0x10400006, 0x3c03000c, 0x3c020001, 0x94420f68, 0x34630624,
+	0x0800427c, 0x0000d021, 0x3c020001, 0x94420f68, 0x3c030008, 0x34630624,
 	0x00431025, 0xaf620cec, 0x3c108000, 0x3c02a000, 0xaf620cf4, 0x3c010001,
-	0xa0200f76, 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064,
+	0xa0200f56, 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064,
 	0x00000000, 0x8f620cf4, 0x00501024, 0x10400015, 0x00000000, 0x08004283,
-	0x00000000, 0x3c030001, 0x94630f88, 0x34420624, 0x3c108000, 0x00621825,
+	0x00000000, 0x3c030001, 0x94630f68, 0x34420624, 0x3c108000, 0x00621825,
 	0x3c028000, 0xaf630cec, 0xaf620cf4, 0x8f641008, 0x00901024, 0x14400003,
 	0x00000000, 0x0c004064, 0x00000000, 0x8f620cf4, 0x00501024, 0x1440fff7,
-	0x00000000, 0x3c010001, 0x080042cf, 0xa4200f7e, 0x3c020001, 0x94420f7c,
-	0x00021400, 0x00c21025, 0xaf620ce8, 0x3c020001, 0x90420f77, 0x10400009,
-	0x3c03000c, 0x3c020001, 0x94420f88, 0x34630624, 0x0000d021, 0x00431025,
-	0xaf620cec, 0x080042c1, 0x3c108000, 0x3c020001, 0x94420f88, 0x3c030008,
-	0x34630604, 0x00431025, 0xaf620cec, 0x3c020001, 0x94420f7e, 0x00451021,
-	0x3c010001, 0xa4220f7e, 0x3c108000, 0x3c02a000, 0xaf620cf4, 0x3c010001,
-	0xa0200f76, 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064,
+	0x00000000, 0x3c010001, 0x080042cf, 0xa4200f5e, 0x3c020001, 0x94420f5c,
+	0x00021400, 0x00c21025, 0xaf620ce8, 0x3c020001, 0x90420f57, 0x10400009,
+	0x3c03000c, 0x3c020001, 0x94420f68, 0x34630624, 0x0000d021, 0x00431025,
+	0xaf620cec, 0x080042c1, 0x3c108000, 0x3c020001, 0x94420f68, 0x3c030008,
+	0x34630604, 0x00431025, 0xaf620cec, 0x3c020001, 0x94420f5e, 0x00451021,
+	0x3c010001, 0xa4220f5e, 0x3c108000, 0x3c02a000, 0xaf620cf4, 0x3c010001,
+	0xa0200f56, 0x8f641008, 0x00901024, 0x14400003, 0x00000000, 0x0c004064,
 	0x00000000, 0x8f620cf4, 0x00501024, 0x1440fff7, 0x00000000, 0x8fbf0014,
-	0x8fb00010, 0x03e00008, 0x27bd0018, 0x27bdffe0, 0x3c040001, 0x24840ee0,
-	0x00002821, 0x00003021, 0x00003821, 0xafbf0018, 0xafa00010, 0x0c004380,
-	0xafa00014, 0x0000d021, 0x24020130, 0xaf625000, 0x3c010001, 0xa4200f70,
-	0x3c010001, 0xa0200f77, 0x8f636804, 0x3c020001, 0x3442e000, 0x00621824,
-	0x3c020001, 0x14620003, 0x00000000, 0x080042eb, 0x00000000, 0x8fbf0018,
-	0x03e00008, 0x27bd0020, 0x27bdffe8, 0x3c1bc000, 0xafbf0014, 0xafb00010,
-	0xaf60680c, 0x8f626804, 0x34420082, 0xaf626804, 0x8f634000, 0x24020b50,
-	0x3c010001, 0xac220f40, 0x24020b78, 0x3c010001, 0xac220f50, 0x34630002,
-	0xaf634000, 0x0c00431d, 0x00808021, 0x3c010001, 0xa0220f54, 0x304200ff,
-	0x24030002, 0x14430005, 0x00000000, 0x3c020001, 0x8c420f40, 0x08004310,
-	0xac5000c0, 0x3c020001, 0x8c420f40, 0xac5000bc, 0x8f624434, 0x8f634438,
-	0x8f644410, 0x3c010001, 0xac220f48, 0x3c010001, 0xac230f58, 0x3c010001,
-	0xac240f44, 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x03e00008,
-	0x24020001, 0x27bdfff8, 0x18800009, 0x00002821, 0x8f63680c, 0x8f62680c,
-	0x1043fffe, 0x00000000, 0x24a50001, 0x00a4102a, 0x1440fff9, 0x00000000,
-	0x03e00008, 0x27bd0008, 0x8f634450, 0x3c020001, 0x8c420f48, 0x00031c02,
-	0x0043102b, 0x14400008, 0x3c038000, 0x3c040001, 0x8c840f58, 0x8f624450,
-	0x00021c02, 0x0083102b, 0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444,
-	0x00431024, 0x1440fffd, 0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff,
-	0x3082ffff, 0x2442e000, 0x2c422001, 0x14400003, 0x3c024000, 0x0800434f,
-	0x2402ffff, 0x00822025, 0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc,
-	0x00001021, 0x03e00008, 0x00000000, 0x8f624450, 0x3c030001, 0x8c630f44,
-	0x08004358, 0x3042ffff, 0x8f624450, 0x3042ffff, 0x0043102b, 0x1440fffc,
-	0x00000000, 0x03e00008, 0x00000000, 0x27bdffe0, 0x00802821, 0x3c040001,
-	0x24840ef0, 0x00003021, 0x00003821, 0xafbf0018, 0xafa00010, 0x0c004380,
-	0xafa00014, 0x08004367, 0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020,
-	0x3c020001, 0x3442d600, 0x3c030001, 0x3463d600, 0x3c040001, 0x3484ddff,
-	0x3c010001, 0xac220f60, 0x24020040, 0x3c010001, 0xac220f64, 0x3c010001,
-	0xac200f5c, 0xac600000, 0x24630004, 0x0083102b, 0x5040fffd, 0xac600000,
-	0x03e00008, 0x00000000, 0x00804821, 0x8faa0010, 0x3c020001, 0x8c420f5c,
-	0x3c040001, 0x8c840f64, 0x8fab0014, 0x24430001, 0x0044102b, 0x3c010001,
-	0xac230f5c, 0x14400003, 0x00004021, 0x3c010001, 0xac200f5c, 0x3c020001,
-	0x8c420f5c, 0x3c030001, 0x8c630f60, 0x91240000, 0x00021140, 0x00431021,
-	0x00481021, 0x25080001, 0xa0440000, 0x29020008, 0x1440fff4, 0x25290001,
-	0x3c020001, 0x8c420f5c, 0x3c030001, 0x8c630f60, 0x8f64680c, 0x00021140,
-	0x00431021, 0xac440008, 0xac45000c, 0xac460010, 0xac470014, 0xac4a0018,
-	0x03e00008, 0xac4b001c, 0x00000000, 0x00000000,
+	0x8fb00010, 0x03e00008, 0x27bd0018, 0x00000000, 0x27bdffe0, 0x3c040001,
+	0x24840ec0, 0x00002821, 0x00003021, 0x00003821, 0xafbf0018, 0xafa00010,
+	0x0c004378, 0xafa00014, 0x0000d021, 0x24020130, 0xaf625000, 0x3c010001,
+	0xa4200f50, 0x3c010001, 0xa0200f57, 0x8fbf0018, 0x03e00008, 0x27bd0020,
+	0x27bdffe8, 0x3c1bc000, 0xafbf0014, 0xafb00010, 0xaf60680c, 0x8f626804,
+	0x34420082, 0xaf626804, 0x8f634000, 0x24020b50, 0x3c010001, 0xac220f20,
+	0x24020b78, 0x3c010001, 0xac220f30, 0x34630002, 0xaf634000, 0x0c004315,
+	0x00808021, 0x3c010001, 0xa0220f34, 0x304200ff, 0x24030002, 0x14430005,
+	0x00000000, 0x3c020001, 0x8c420f20, 0x08004308, 0xac5000c0, 0x3c020001,
+	0x8c420f20, 0xac5000bc, 0x8f624434, 0x8f634438, 0x8f644410, 0x3c010001,
+	0xac220f28, 0x3c010001, 0xac230f38, 0x3c010001, 0xac240f24, 0x8fbf0014,
+	0x8fb00010, 0x03e00008, 0x27bd0018, 0x03e00008, 0x24020001, 0x27bdfff8,
+	0x18800009, 0x00002821, 0x8f63680c, 0x8f62680c, 0x1043fffe, 0x00000000,
+	0x24a50001, 0x00a4102a, 0x1440fff9, 0x00000000, 0x03e00008, 0x27bd0008,
+	0x8f634450, 0x3c020001, 0x8c420f28, 0x00031c02, 0x0043102b, 0x14400008,
+	0x3c038000, 0x3c040001, 0x8c840f38, 0x8f624450, 0x00021c02, 0x0083102b,
+	0x1040fffc, 0x3c038000, 0xaf634444, 0x8f624444, 0x00431024, 0x1440fffd,
+	0x00000000, 0x8f624448, 0x03e00008, 0x3042ffff, 0x3082ffff, 0x2442e000,
+	0x2c422001, 0x14400003, 0x3c024000, 0x08004347, 0x2402ffff, 0x00822025,
+	0xaf645c38, 0x8f625c30, 0x30420002, 0x1440fffc, 0x00001021, 0x03e00008,
+	0x00000000, 0x8f624450, 0x3c030001, 0x8c630f24, 0x08004350, 0x3042ffff,
+	0x8f624450, 0x3042ffff, 0x0043102b, 0x1440fffc, 0x00000000, 0x03e00008,
+	0x00000000, 0x27bdffe0, 0x00802821, 0x3c040001, 0x24840ed0, 0x00003021,
+	0x00003821, 0xafbf0018, 0xafa00010, 0x0c004378, 0xafa00014, 0x0800435f,
+	0x00000000, 0x8fbf0018, 0x03e00008, 0x27bd0020, 0x3c020001, 0x3442d600,
+	0x3c030001, 0x3463d600, 0x3c040001, 0x3484ddff, 0x3c010001, 0xac220f40,
+	0x24020040, 0x3c010001, 0xac220f44, 0x3c010001, 0xac200f3c, 0xac600000,
+	0x24630004, 0x0083102b, 0x5040fffd, 0xac600000, 0x03e00008, 0x00000000,
+	0x00804821, 0x8faa0010, 0x3c020001, 0x8c420f3c, 0x3c040001, 0x8c840f44,
+	0x8fab0014, 0x24430001, 0x0044102b, 0x3c010001, 0xac230f3c, 0x14400003,
+	0x00004021, 0x3c010001, 0xac200f3c, 0x3c020001, 0x8c420f3c, 0x3c030001,
+	0x8c630f40, 0x91240000, 0x00021140, 0x00431021, 0x00481021, 0x25080001,
+	0xa0440000, 0x29020008, 0x1440fff4, 0x25290001, 0x3c020001, 0x8c420f3c,
+	0x3c030001, 0x8c630f40, 0x8f64680c, 0x00021140, 0x00431021, 0xac440008,
+	0xac45000c, 0xac460010, 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c,
+	0x00000000, 0x00000000, 0x00000000,
 };
 
-u32 tg3Tso5FwRodata[] = {
+u32 tg3Tso5FwRodata[(TG3_TSO5_FW_RODATA_LEN / 4) + 1] = {
 	0x4d61696e, 0x43707542, 0x00000000, 0x4d61696e, 0x43707541, 0x00000000,
 	0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x00000000, 0x00000000,
 	0x73746b6f, 0x66666c64, 0x00000000, 0x00000000, 0x66617461, 0x6c457272,
-	0x00000000, 0x00000000, 0x00000000
+	0x00000000, 0x00000000, 0x00000000,
 };
 
-u32 tg3Tso5FwData[] = {
-	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x73746b6f, 
-	0x66666c64, 0x5f76312e, 0x312e3000, 0x00000000
+u32 tg3Tso5FwData[(TG3_TSO5_FW_DATA_LEN / 4) + 1] = {
+	0x00000000, 0x73746b6f, 0x66666c64, 0x5f76312e, 0x322e3000, 0x00000000,
+	0x00000000, 0x00000000, 0x00000000,
 };
 
 /* tp->lock is held. */
@@ -4461,6 +4703,9 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
 	unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size;
 	int err, i;
 
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+		return 0;
+
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
 		info.text_base = TG3_TSO5_FW_TEXT_ADDR;
 		info.text_len = TG3_TSO5_FW_TEXT_LEN;
@@ -4487,7 +4732,7 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
 		info.rodata_data = &tg3TsoFwRodata[0];
 		info.data_base = TG3_TSO_FW_DATA_ADDR;
 		info.data_len = TG3_TSO_FW_DATA_LEN;
-		info.data_data = NULL;
+		info.data_data = &tg3TsoFwData[0];
 		cpu_base = TX_CPU_BASE;
 		cpu_scratch_base = TX_CPU_SCRATCH_BASE;
 		cpu_scratch_size = TX_CPU_SCRATCH_SIZE;
@@ -4563,7 +4808,7 @@ static void __tg3_set_mac_addr(struct tg3 *tp)
 
 static int tg3_set_mac_addr(struct net_device *dev, void *p)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	struct sockaddr *addr = p;
 
 	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -4608,6 +4853,8 @@ static int tg3_reset_hw(struct tg3 *tp)
 
 	tg3_stop_fw(tp);
 
+	tg3_write_sig_pre_reset(tp, RESET_KIND_INIT);
+
 	if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) {
 		err = tg3_abort_hw(tp);
 		if (err)
@@ -4618,18 +4865,15 @@ static int tg3_reset_hw(struct tg3 *tp)
 	if (err)
 		return err;
 
-	if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF)
-		tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
-			      DRV_STATE_START);
-	else
-		tg3_write_mem(tp, NIC_SRAM_FW_DRV_STATE_MBOX,
-			      DRV_STATE_SUSPEND);
+	tg3_write_sig_legacy(tp, RESET_KIND_INIT);
 
 	/* This works around an issue with Athlon chipsets on
 	 * B3 tigon3 silicon.  This bit has no effect on any
-	 * other revision.
+	 * other revision.  But do not set this on PCI Express
+	 * chips.
 	 */
-	tp->pci_clock_ctrl |= CLOCK_CTRL_DELAY_PCI_GRANT;
+	if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS))
+		tp->pci_clock_ctrl |= CLOCK_CTRL_DELAY_PCI_GRANT;
 	tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
 
 	if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0 &&
@@ -4682,7 +4926,9 @@ static int tg3_reset_hw(struct tg3 *tp)
 	tw32(GRC_MISC_CFG, val);
 
 	/* Initialize MBUF/DESC pool. */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+		/* Do nothing.  */
+	} else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
 		tw32(BUFMGR_MB_POOL_ADDR, NIC_SRAM_MBUF_POOL_BASE);
 		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
 			tw32(BUFMGR_MB_POOL_SIZE, NIC_SRAM_MBUF_POOL_SIZE64);
@@ -4740,17 +4986,6 @@ static int tg3_reset_hw(struct tg3 *tp)
 		return -ENODEV;
 	}
 
-	/* Clear statistics/status block in chip, and status block in ram. */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
-		for (i = NIC_SRAM_STATS_BLK;
-	     	     i < NIC_SRAM_STATUS_BLK + TG3_HW_STATUS_SIZE;
-	     	     i += sizeof(u32)) {
-			tg3_write_mem(tp, i, 0);
-			udelay(40);
-		}
-	}
-	memset(tp->hw_status, 0, TG3_HW_STATUS_SIZE);
-
 	/* Setup replenish threshold. */
 	tw32(RCVBDI_STD_THRESH, tp->rx_pending / 8);
 
@@ -4781,7 +5016,8 @@ static int tg3_reset_hw(struct tg3 *tp)
 	/* Don't even try to program the JUMBO/MINI buffer descriptor
 	 * configs on 5705.
 	 */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
 		tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS,
 		     RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT);
 	} else {
@@ -4810,10 +5046,11 @@ static int tg3_reset_hw(struct tg3 *tp)
 
 	}
 
-	/* There is only one send ring on 5705, no need to explicitly
+	/* There is only one send ring on 5705/5750, no need to explicitly
 	 * disable the others.
 	 */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 		/* Clear out send RCB ring in SRAM. */
 		for (i = NIC_SRAM_SEND_RCB; i < NIC_SRAM_RCV_RET_RCB; i += TG3_BDINFO_SIZE)
 			tg3_write_mem(tp, i + TG3_BDINFO_MAXLEN_FLAGS,
@@ -4838,10 +5075,11 @@ static int tg3_reset_hw(struct tg3 *tp)
 			       NIC_SRAM_TX_BUFFER_DESC);
 	}
 
-	/* There is only one receive return ring on 5705, no need to explicitly
-	 * disable the others.
+	/* There is only one receive return ring on 5705/5750, no need
+	 * to explicitly disable the others.
 	 */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 		for (i = NIC_SRAM_RCV_RET_RCB; i < NIC_SRAM_STATS_BLK;
 		     i += TG3_BDINFO_SIZE) {
 			tg3_write_mem(tp, i + TG3_BDINFO_MAXLEN_FLAGS,
@@ -4895,17 +5133,24 @@ static int tg3_reset_hw(struct tg3 *tp)
 		      RDMAC_MODE_LNGREAD_ENAB);
 	if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE)
 		rdmac_mode |= RDMAC_MODE_SPLIT_ENABLE;
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
-		if (tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) {
-			if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
-				rdmac_mode |= RDMAC_MODE_FIFO_SIZE_128;
-			} else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
-				   !(tp->tg3_flags2 & TG3_FLG2_IS_5788)) {
-				rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST;
-			}
+	if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
+	     tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
+	    (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)) {
+		if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE &&
+		    (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
+		     tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
+			rdmac_mode |= RDMAC_MODE_FIFO_SIZE_128;
+		} else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
+			   !(tp->tg3_flags2 & TG3_FLG2_IS_5788)) {
+			rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST;
 		}
 	}
 
+#if TG3_TSO_SUPPORT != 0
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+		rdmac_mode |= (1 << 27);
+#endif
+
 	/* Receive/send statistics. */
 	if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) &&
 	    (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) {
@@ -4933,10 +5178,11 @@ static int tg3_reset_hw(struct tg3 *tp)
 	tw32(HOSTCC_TXCOL_TICKS, LOW_TXCOL_TICKS);
 	tw32(HOSTCC_RXMAX_FRAMES, 1);
 	tw32(HOSTCC_TXMAX_FRAMES, LOW_RXMAX_FRAMES);
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 		tw32(HOSTCC_RXCOAL_TICK_INT, 0);
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705)
 		tw32(HOSTCC_TXCOAL_TICK_INT, 0);
+	}
 	tw32(HOSTCC_RXCOAL_MAXF_INT, 1);
 	tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
 
@@ -4946,10 +5192,11 @@ static int tg3_reset_hw(struct tg3 *tp)
 	tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW,
 	     ((u64) tp->status_mapping & 0xffffffff));
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 		/* Status/statistics block address.  See tg3_timer,
 		 * the tg3_periodic_fetch_stats call there, and
-		 * tg3_get_stats to see how this works for 5705 chips.
+		 * tg3_get_stats to see how this works for 5705/5750 chips.
 		 */
 		tw32(HOSTCC_STAT_COAL_TICKS,
 		     DEFAULT_STAT_COAL_TICKS);
@@ -4965,9 +5212,19 @@ static int tg3_reset_hw(struct tg3 *tp)
 
 	tw32(RCVCC_MODE, RCVCC_MODE_ENABLE | RCVCC_MODE_ATTN_ENABLE);
 	tw32(RCVLPC_MODE, RCVLPC_MODE_ENABLE);
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750)
 		tw32(RCVLSC_MODE, RCVLSC_MODE_ENABLE | RCVLSC_MODE_ATTN_ENABLE);
 
+	/* Clear statistics/status block in chip, and status block in ram. */
+	for (i = NIC_SRAM_STATS_BLK;
+	     i < NIC_SRAM_STATUS_BLK + TG3_HW_STATUS_SIZE;
+	     i += sizeof(u32)) {
+		tg3_write_mem(tp, i, 0);
+		udelay(40);
+	}
+	memset(tp->hw_status, 0, TG3_HW_STATUS_SIZE);
+
 	tp->mac_mode = MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE |
 		MAC_MODE_TDE_ENABLE | MAC_MODE_RDE_ENABLE | MAC_MODE_FHDE_ENABLE;
 	tw32_f(MAC_MODE, tp->mac_mode | MAC_MODE_RXSTAT_CLEAR | MAC_MODE_TXSTAT_CLEAR);
@@ -4983,7 +5240,8 @@ static int tg3_reset_hw(struct tg3 *tp)
 	tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0);
 	tr32(MAILBOX_INTERRUPT_0);
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750) {
 		tw32_f(DMAC_MODE, DMAC_MODE_ENABLE);
 		udelay(40);
 	}
@@ -4993,10 +5251,21 @@ static int tg3_reset_hw(struct tg3 *tp)
 	       WDMAC_MODE_ADDROFLOW_ENAB | WDMAC_MODE_FIFOOFLOW_ENAB |
 	       WDMAC_MODE_FIFOURUN_ENAB | WDMAC_MODE_FIFOOREAD_ENAB |
 	       WDMAC_MODE_LNGREAD_ENAB);
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
-	    (tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) != 0 &&
-	    !(tp->tg3_flags2 & TG3_FLG2_IS_5788))
-		val |= WDMAC_MODE_RX_ACCEL;
+
+	if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
+	     tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+		if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
+		    (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
+		     tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
+			/* nothing */
+		} else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
+			   !(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
+			   !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
+			val |= WDMAC_MODE_RX_ACCEL;
+		}
+	}
+
 	tw32_f(WDMAC_MODE, val);
 	udelay(40);
 
@@ -5019,13 +5288,18 @@ static int tg3_reset_hw(struct tg3 *tp)
 	udelay(40);
 
 	tw32(RCVDCC_MODE, RCVDCC_MODE_ENABLE | RCVDCC_MODE_ATTN_ENABLE);
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750)
 		tw32(MBFREE_MODE, MBFREE_MODE_ENABLE);
 	tw32(SNDDATAC_MODE, SNDDATAC_MODE_ENABLE);
 	tw32(SNDBDC_MODE, SNDBDC_MODE_ENABLE | SNDBDC_MODE_ATTN_ENABLE);
 	tw32(RCVBDI_MODE, RCVBDI_MODE_ENABLE | RCVBDI_MODE_RCB_ATTN_ENAB);
 	tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ);
 	tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE);
+#if TG3_TSO_SUPPORT != 0
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+		tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8);
+#endif
 	tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE);
 	tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE);
 
@@ -5060,9 +5334,10 @@ static int tg3_reset_hw(struct tg3 *tp)
 
 	tp->mi_mode = MAC_MI_MODE_BASE;
 	tw32_f(MAC_MI_MODE, tp->mi_mode);
-	udelay(40);
+	udelay(80);
+
+	tw32(MAC_LED_CTRL, tp->led_ctrl);
 
-	tw32(MAC_LED_CTRL, 0);
 	tw32(MAC_MI_STAT, MAC_MI_STAT_LNKSTAT_ATTN_ENAB);
 	if (tp->phy_id == PHY_ID_SERDES) {
 		tw32_f(MAC_RX_MODE, RX_MODE_RESET);
@@ -5109,7 +5384,8 @@ static int tg3_reset_hw(struct tg3 *tp)
 	tw32(MAC_RCV_RULE_1,  0x86000004 & RCV_RULE_DISABLE_MASK);
 	tw32(MAC_RCV_VALUE_1, 0xffffffff & RCV_RULE_DISABLE_MASK);
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
 		limit = 8;
 	else
 		limit = 16;
@@ -5151,6 +5427,8 @@ static int tg3_reset_hw(struct tg3 *tp)
 		break;
 	};
 
+	tg3_write_sig_post_reset(tp, RESET_KIND_INIT);
+
 	if (tp->tg3_flags & TG3_FLAG_INIT_COMPLETE)
 		tg3_enable_ints(tp);
 
@@ -5251,7 +5529,8 @@ static void tg3_timer(unsigned long __opaque)
 		return;
 	}
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
 		tg3_periodic_fetch_stats(tp);
 
 	/* This part only runs once per second. */
@@ -5321,7 +5600,7 @@ static void tg3_timer(unsigned long __opaque)
 
 static int tg3_open(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	int err;
 
 	spin_lock_irq(&tp->lock);
@@ -5624,7 +5903,7 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *);
 
 static int tg3_close(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	netif_stop_queue(dev);
 
@@ -5709,10 +5988,13 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
 	if (!hw_stats)
 		return old_estats;
 
+	ESTAT_ADD(rx_octets);
 	ESTAT_ADD(rx_fragments);
 	ESTAT_ADD(rx_ucast_packets);
+	ESTAT_ADD(rx_mcast_packets);
 	ESTAT_ADD(rx_bcast_packets);
 	ESTAT_ADD(rx_fcs_errors);
+	ESTAT_ADD(rx_align_errors);
 	ESTAT_ADD(rx_xon_pause_rcvd);
 	ESTAT_ADD(rx_xoff_pause_rcvd);
 	ESTAT_ADD(rx_mac_ctrl_rcvd);
@@ -5722,7 +6004,19 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
 	ESTAT_ADD(rx_undersize_packets);
 	ESTAT_ADD(rx_in_length_errors);
 	ESTAT_ADD(rx_out_length_errors);
-
+	ESTAT_ADD(rx_64_or_less_octet_packets);
+	ESTAT_ADD(rx_65_to_127_octet_packets);
+	ESTAT_ADD(rx_128_to_255_octet_packets);
+	ESTAT_ADD(rx_256_to_511_octet_packets);
+	ESTAT_ADD(rx_512_to_1023_octet_packets);
+	ESTAT_ADD(rx_1024_to_1522_octet_packets);
+	ESTAT_ADD(rx_1523_to_2047_octet_packets);
+	ESTAT_ADD(rx_2048_to_4095_octet_packets);
+	ESTAT_ADD(rx_4096_to_8191_octet_packets);
+	ESTAT_ADD(rx_8192_to_9022_octet_packets);
+
+	ESTAT_ADD(tx_octets);
+	ESTAT_ADD(tx_collisions);
 	ESTAT_ADD(tx_xon_sent);
 	ESTAT_ADD(tx_xoff_sent);
 	ESTAT_ADD(tx_flow_control);
@@ -5732,16 +6026,50 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp)
 	ESTAT_ADD(tx_deferred);
 	ESTAT_ADD(tx_excessive_collisions);
 	ESTAT_ADD(tx_late_collisions);
+	ESTAT_ADD(tx_collide_2times);
+	ESTAT_ADD(tx_collide_3times);
+	ESTAT_ADD(tx_collide_4times);
+	ESTAT_ADD(tx_collide_5times);
+	ESTAT_ADD(tx_collide_6times);
+	ESTAT_ADD(tx_collide_7times);
+	ESTAT_ADD(tx_collide_8times);
+	ESTAT_ADD(tx_collide_9times);
+	ESTAT_ADD(tx_collide_10times);
+	ESTAT_ADD(tx_collide_11times);
+	ESTAT_ADD(tx_collide_12times);
+	ESTAT_ADD(tx_collide_13times);
+	ESTAT_ADD(tx_collide_14times);
+	ESTAT_ADD(tx_collide_15times);
 	ESTAT_ADD(tx_ucast_packets);
 	ESTAT_ADD(tx_mcast_packets);
 	ESTAT_ADD(tx_bcast_packets);
+	ESTAT_ADD(tx_carrier_sense_errors);
+	ESTAT_ADD(tx_discards);
+	ESTAT_ADD(tx_errors);
+
+	ESTAT_ADD(dma_writeq_full);
+	ESTAT_ADD(dma_write_prioq_full);
+	ESTAT_ADD(rxbds_empty);
+	ESTAT_ADD(rx_discards);
+	ESTAT_ADD(rx_errors);
+	ESTAT_ADD(rx_threshold_hit);
+
+	ESTAT_ADD(dma_readq_full);
+	ESTAT_ADD(dma_read_prioq_full);
+	ESTAT_ADD(tx_comp_queue_full);
+
+	ESTAT_ADD(ring_set_send_prod_index);
+	ESTAT_ADD(ring_status_update);
+	ESTAT_ADD(nic_irqs);
+	ESTAT_ADD(nic_avoided_irqs);
+	ESTAT_ADD(nic_tx_threshold_hit);
 
 	return estats;
 }
 
 static struct net_device_stats *tg3_get_stats(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	struct net_device_stats *stats = &tp->net_stats;
 	struct net_device_stats *old_stats = &tp->net_stats_prev;
 	struct tg3_hw_stats *hw_stats = tp->hw_stats;
@@ -5765,7 +6093,8 @@ static struct net_device_stats *tg3_get_stats(struct net_device *dev)
 		get_stat64(&hw_stats->tx_octets);
 
 	stats->rx_errors = old_stats->rx_errors +
-		get_stat64(&hw_stats->rx_errors);
+		get_stat64(&hw_stats->rx_errors) +
+		get_stat64(&hw_stats->rx_discards);
 	stats->tx_errors = old_stats->tx_errors +
 		get_stat64(&hw_stats->tx_errors) +
 		get_stat64(&hw_stats->tx_mac_errors) +
@@ -5832,7 +6161,7 @@ static void tg3_set_multi(struct tg3 *tp, unsigned int accept_all)
 
 static void __tg3_set_rx_mode(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	u32 rx_mode;
 
 	rx_mode = tp->rx_mode & ~(RX_MODE_PROMISC |
@@ -5896,7 +6225,7 @@ static void __tg3_set_rx_mode(struct net_device *dev)
 
 static void tg3_set_rx_mode(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	spin_lock_irq(&tp->lock);
 	__tg3_set_rx_mode(dev);
@@ -5914,7 +6243,7 @@ static void tg3_get_regs(struct net_device *dev,
 		struct ethtool_regs *regs, void *_p)
 {
 	u32 *p = _p;
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	u8 *orig_p = _p;
 	int i;
 
@@ -5977,9 +6306,75 @@ do {	p = (u32 *)(orig_p + (reg));		\
 	spin_unlock_irq(&tp->lock);
 }
 
+static int tg3_get_eeprom_len(struct net_device *dev)
+{
+	return EEPROM_CHIP_SIZE;
+}
+
+static int __devinit tg3_nvram_read_using_eeprom(struct tg3 *tp,
+						 u32 offset, u32 *val);
+static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data)
+{
+	struct tg3 *tp = dev->priv;
+	int ret;
+	u8  *pd;
+	u32 i, offset, len, val, b_offset, b_count;
+
+	offset = eeprom->offset;
+	len = eeprom->len;
+	eeprom->len = 0;
+
+	ret = tg3_nvram_read_using_eeprom(tp, 0, &eeprom->magic);
+	if (ret)
+		return ret;
+	eeprom->magic = swab32(eeprom->magic);
+
+	if (offset & 3) {
+		/* adjustments to start on required 4 byte boundary */
+		b_offset = offset & 3;
+		b_count = 4 - b_offset;
+		if (b_count > len) {
+			/* i.e. offset=1 len=2 */
+			b_count = len;
+		}
+		ret = tg3_nvram_read_using_eeprom(tp, offset-b_offset, &val);
+		if (ret)
+			return ret;
+		memcpy(data, ((char*)&val) + b_offset, b_count);
+		len -= b_count;
+		offset += b_count;
+	        eeprom->len += b_count;
+	}
+
+	/* read bytes upto the last 4 byte boundary */
+	pd = &data[eeprom->len];
+	for (i = 0; i < (len - (len & 3)); i += 4) {
+		ret = tg3_nvram_read_using_eeprom(tp, offset + i, 
+				(u32*)(pd + i));
+		if (ret) {
+			eeprom->len += i;
+			return ret;
+		}
+	}
+	eeprom->len += i;
+
+	if (len & 3) {
+		/* read last bytes not ending on 4 byte boundary */
+		pd = &data[eeprom->len];
+		b_count = len & 3;
+		b_offset = offset + len - b_count;
+		ret = tg3_nvram_read_using_eeprom(tp, b_offset, &val);
+		if (ret)
+			return ret;
+		memcpy(pd, ((char*)&val), b_count);
+		eeprom->len += b_count;
+	}
+	return 0;
+}
+
 static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-  	struct tg3 *tp = dev->priv;
+  	struct tg3 *tp = netdev_priv(dev);
   
 	if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) ||
 					tp->link_config.phy_is_low_power)
@@ -6014,7 +6409,7 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
   
 static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) ||
 	    tp->link_config.phy_is_low_power)
@@ -6053,7 +6448,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
   
 static void tg3_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	strcpy(info->driver, DRV_MODULE_NAME);
 	strcpy(info->version, DRV_MODULE_VERSION);
@@ -6062,7 +6457,7 @@ static void tg3_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
   
 static void tg3_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	wol->supported = WAKE_MAGIC;
 	wol->wolopts = 0;
@@ -6073,7 +6468,7 @@ static void tg3_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
   
 static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	if (wol->wolopts & ~WAKE_MAGIC)
 		return -EINVAL;
@@ -6094,20 +6489,20 @@ static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
   
 static u32 tg3_get_msglevel(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	return tp->msg_enable;
 }
   
 static void tg3_set_msglevel(struct net_device *dev, u32 value)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	tp->msg_enable = value;
 }
   
 #if TG3_TSO_SUPPORT != 0
 static int tg3_set_tso(struct net_device *dev, u32 value)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	if (!(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) {
 		if (value)
@@ -6120,7 +6515,7 @@ static int tg3_set_tso(struct net_device *dev, u32 value)
   
 static int tg3_nway_reset(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	u32 bmcr;
 	int r;
   
@@ -6139,7 +6534,7 @@ static int tg3_nway_reset(struct net_device *dev)
   
 static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	ering->rx_max_pending = TG3_RX_RING_SIZE - 1;
 	ering->rx_mini_max_pending = 0;
@@ -6153,7 +6548,7 @@ static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *
   
 static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) ||
 	    (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) ||
@@ -6184,7 +6579,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
   
 static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	epause->autoneg = (tp->tg3_flags & TG3_FLAG_PAUSE_AUTONEG) != 0;
 	epause->rx_pause = (tp->tg3_flags & TG3_FLAG_PAUSE_RX) != 0;
@@ -6193,7 +6588,7 @@ static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam
   
 static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	tg3_netif_stop(tp);
 	spin_lock_irq(&tp->lock);
@@ -6221,13 +6616,13 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
   
 static u32 tg3_get_rx_csum(struct net_device *dev)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	return (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0;
 }
   
 static int tg3_set_rx_csum(struct net_device *dev, u32 data)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	if (tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) {
 		if (data != 0)
@@ -6247,7 +6642,7 @@ static int tg3_set_rx_csum(struct net_device *dev, u32 data)
   
 static int tg3_set_tx_csum(struct net_device *dev, u32 data)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
   
 	if (tp->tg3_flags & TG3_FLAG_BROKEN_CHECKSUMS) {
 		if (data != 0)
@@ -6284,13 +6679,13 @@ static void tg3_get_ethtool_stats (struct net_device *dev,
 				   struct ethtool_stats *estats, u64 *tmp_stats)
 {
 	struct tg3 *tp = dev->priv;
-	memcpy(tmp_stats, &tp->estats, sizeof(tp->estats));
+	memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
 }
 
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
-	struct tg3 *tp = dev->priv;
+	struct mii_ioctl_data *data = if_mii(ifr);
+	struct tg3 *tp = netdev_priv(dev);
 	int err;
 
 	switch(cmd) {
@@ -6330,7 +6725,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 #if TG3_VLAN_TAG_USED
 static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	spin_lock_irq(&tp->lock);
 	spin_lock(&tp->tx_lock);
@@ -6346,7 +6741,7 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 
 static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 {
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 
 	spin_lock_irq(&tp->lock);
 	spin_lock(&tp->tx_lock);
@@ -6369,6 +6764,8 @@ static struct ethtool_ops tg3_ethtool_ops = {
 	.set_msglevel		= tg3_set_msglevel,
 	.nway_reset		= tg3_nway_reset,
 	.get_link		= ethtool_op_get_link,
+	.get_eeprom_len		= tg3_get_eeprom_len,
+	.get_eeprom		= tg3_get_eeprom,
 	.get_ringparam		= tg3_get_ringparam,
 	.set_ringparam		= tg3_set_ringparam,
 	.get_pauseparam		= tg3_get_pauseparam,
@@ -6412,7 +6809,15 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
 
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
 	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) {
-		u32 nvcfg1 = tr32(NVRAM_CFG1);
+		u32 nvcfg1;
+
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+			u32 nvaccess = tr32(NVRAM_ACCESS);
+
+			tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
+		}
+
+		nvcfg1 = tr32(NVRAM_CFG1);
 
 		tp->tg3_flags |= TG3_FLAG_NVRAM;
 		if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) {
@@ -6423,6 +6828,11 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
 			tw32(NVRAM_CFG1, nvcfg1);
 		}
 
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+			u32 nvaccess = tr32(NVRAM_ACCESS);
+
+			tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
+		}
 	} else {
 		tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED);
 	}
@@ -6465,7 +6875,7 @@ static int __devinit tg3_nvram_read_using_eeprom(struct tg3 *tp,
 static int __devinit tg3_nvram_read(struct tg3 *tp,
 				    u32 offset, u32 *val)
 {
-	int i, saw_done_clear;
+	int i;
 
 	if (tp->tg3_flags2 & TG3_FLG2_SUN_5704) {
 		printk(KERN_ERR PFX "Attempt to do nvram_read on Sun 5704\n");
@@ -6483,11 +6893,12 @@ static int __devinit tg3_nvram_read(struct tg3 *tp,
 	if (offset > NVRAM_ADDR_MSK)
 		return -EINVAL;
 
-	tw32(NVRAM_SWARB, SWARB_REQ_SET1);
-	for (i = 0; i < 1000; i++) {
-		if (tr32(NVRAM_SWARB) & SWARB_GNT1)
-			break;
-		udelay(20);
+	tg3_nvram_lock(tp);
+
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+		u32 nvaccess = tr32(NVRAM_ACCESS);
+
+		tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE);
 	}
 
 	tw32(NVRAM_ADDR, offset);
@@ -6495,24 +6906,26 @@ static int __devinit tg3_nvram_read(struct tg3 *tp,
 	     NVRAM_CMD_RD | NVRAM_CMD_GO |
 	     NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE);
 
-	/* Wait for done bit to clear then set again. */
-	saw_done_clear = 0;
+	/* Wait for done bit to clear. */
 	for (i = 0; i < 1000; i++) {
 		udelay(10);
-		if (!saw_done_clear &&
-		    !(tr32(NVRAM_CMD) & NVRAM_CMD_DONE))
-			saw_done_clear = 1;
-		else if (saw_done_clear &&
-			 (tr32(NVRAM_CMD) & NVRAM_CMD_DONE))
+		if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
+			udelay(10);
+			*val = swab32(tr32(NVRAM_RDDATA));
 			break;
+		}
 	}
-	if (i >= 1000) {
-		tw32(NVRAM_SWARB, SWARB_REQ_CLR1);
-		return -EBUSY;
+
+	tg3_nvram_unlock(tp);
+
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+		u32 nvaccess = tr32(NVRAM_ACCESS);
+
+		tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE);
 	}
 
-	*val = swab32(tr32(NVRAM_RDDATA));
-	tw32(NVRAM_SWARB, 0x20);
+	if (i >= 1000)
+		return -EBUSY;
 
 	return 0;
 }
@@ -6564,7 +6977,6 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
 {
 	u32 eeprom_phy_id, hw_phy_id_1, hw_phy_id_2;
 	u32 hw_phy_id, hw_phy_id_masked;
-	enum phy_led_mode eeprom_led_mode;
 	u32 val;
 	int i, eeprom_signature_found, err;
 
@@ -6580,11 +6992,10 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
 	}
 
 	eeprom_phy_id = PHY_ID_INVALID;
-	eeprom_led_mode = led_mode_auto;
 	eeprom_signature_found = 0;
 	tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val);
 	if (val == NIC_SRAM_DATA_SIG_MAGIC) {
-		u32 nic_cfg;
+		u32 nic_cfg, led_cfg;
 
 		tg3_read_mem(tp, NIC_SRAM_DATA_CFG, &nic_cfg);
 		tp->nic_sram_data_cfg = nic_cfg;
@@ -6608,28 +7019,64 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
 			}
 		}
 
-		switch (nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK) {
-		case NIC_SRAM_DATA_CFG_LED_TRIPLE_SPD:
-			eeprom_led_mode = led_mode_three_link;
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
+			tg3_read_mem(tp, NIC_SRAM_DATA_CFG_2, &led_cfg);
+			led_cfg &= (NIC_SRAM_DATA_CFG_LED_MODE_MASK |
+				    SHASTA_EXT_LED_MODE_MASK);
+		} else
+			led_cfg = nic_cfg & NIC_SRAM_DATA_CFG_LED_MODE_MASK;
+
+		switch (led_cfg) {
+		default:
+		case NIC_SRAM_DATA_CFG_LED_MODE_PHY_1:
+			tp->led_ctrl = LED_CTRL_MODE_PHY_1;
 			break;
 
-		case NIC_SRAM_DATA_CFG_LED_LINK_SPD:
-			eeprom_led_mode = led_mode_link10;
+		case NIC_SRAM_DATA_CFG_LED_MODE_PHY_2:
+			tp->led_ctrl = LED_CTRL_MODE_PHY_2;
 			break;
 
-		default:
-			eeprom_led_mode = led_mode_auto;
+		case NIC_SRAM_DATA_CFG_LED_MODE_MAC:
+			tp->led_ctrl = LED_CTRL_MODE_MAC;
+			break;
+
+		case SHASTA_EXT_LED_SHARED:
+			tp->led_ctrl = LED_CTRL_MODE_SHARED;
+			if (tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
+			    tp->pci_chip_rev_id != CHIPREV_ID_5750_A1)
+				tp->led_ctrl |= (LED_CTRL_MODE_PHY_1 |
+						 LED_CTRL_MODE_PHY_2);
 			break;
+
+		case SHASTA_EXT_LED_MAC:
+			tp->led_ctrl = LED_CTRL_MODE_SHASTA_MAC;
+			break;
+
+		case SHASTA_EXT_LED_COMBO:
+			tp->led_ctrl = LED_CTRL_MODE_COMBO;
+			if (tp->pci_chip_rev_id != CHIPREV_ID_5750_A0)
+				tp->led_ctrl |= (LED_CTRL_MODE_PHY_1 |
+						 LED_CTRL_MODE_PHY_2);
+			break;
+
 		};
 
+		if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
+		     GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) &&
+		    tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+			tp->led_ctrl = LED_CTRL_MODE_PHY_2;
+
 		if (((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) ||
 		     (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
 		     (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) &&
 		    (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP))
 			tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT;
 
-		if (nic_cfg & NIC_SRAM_DATA_CFG_ASF_ENABLE)
+		if (nic_cfg & NIC_SRAM_DATA_CFG_ASF_ENABLE) {
 			tp->tg3_flags |= TG3_FLAG_ENABLE_ASF;
+			if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+				tp->tg3_flags2 |= TG3_FLG2_ASF_NEW_HANDSHAKE;
+		}
 		if (nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL)
 			tp->tg3_flags |= TG3_FLAG_SERDES_WOL_CAP;
 	}
@@ -6678,10 +7125,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
 		tg3_readphy(tp, MII_BMSR, &bmsr);
 		tg3_readphy(tp, MII_BMSR, &bmsr);
 
-		if ((bmsr & BMSR_LSTATUS) &&
-		    !(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
-		      GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
-		      GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705))
+		if (bmsr & BMSR_LSTATUS)
 			goto skip_phy_reset;
 		    
 		err = tg3_phy_reset(tp);
@@ -6728,15 +7172,8 @@ skip_phy_reset:
 		err = tg3_init_5401phy_dsp(tp);
 	}
 
-	/* Determine the PHY led mode. */
-	if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL) {
-		tp->led_mode = led_mode_link10;
-	} else {
-		tp->led_mode = led_mode_three_link;
-		if (eeprom_signature_found &&
-		    eeprom_led_mode != led_mode_auto)
-			tp->led_mode = eeprom_led_mode;
-	}
+	if (!eeprom_signature_found)
+		tp->led_ctrl = LED_CTRL_MODE_PHY_1;
 
 	if (tp->phy_id == PHY_ID_SERDES)
 		tp->link_config.advertising =
@@ -6918,6 +7355,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	tp->pci_hdr_type     = (cacheline_sz_reg >> 16) & 0xff;
 	tp->pci_bist         = (cacheline_sz_reg >> 24) & 0xff;
 
+	if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0)
+		tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
+
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 &&
 	    tp->pci_lat_timer < 64) {
 		tp->pci_lat_timer = 64;
@@ -6970,8 +7410,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	/* Back to back register writes can cause problems on this chip,
 	 * the workaround is to read back all reg writes except those to
 	 * mailbox regs.  See tg3_write_indirect_reg32().
+	 *
+	 * PCI Express 5750_A0 rev chips need this workaround too.
 	 */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
+	    ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
+	     tp->pci_chip_rev_id == CHIPREV_ID_5750_A0))
 		tp->tg3_flags |= TG3_FLAG_5701_REG_WRITE_BUG;
 
 	if ((pci_state_reg & PCISTATE_BUS_SPEED_HIGH) != 0)
@@ -7038,8 +7482,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0)
 		tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG;
 
-	/* Note: 5750 also needs this flag set to improve bit error rate. */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
 		tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
 
 	/* Only 5701 and later support tagged irq status mode.
@@ -7057,7 +7501,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 
 	/* Initialize MAC MI mode, polling disabled. */
 	tw32_f(MAC_MI_MODE, tp->mi_mode);
-	udelay(40);
+	udelay(80);
 
 	/* Initialize data/descriptor byte/word swapping. */
 	val = tr32(GRC_MODE);
@@ -7098,12 +7542,22 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	udelay(50);
 	tg3_nvram_init(tp);
 
+	/* Always use host TXDs, it performs better in particular
+	 * with multi-frag packets.  The tests below are kept here
+	 * as documentation should we change this decision again
+	 * in the future.
+	 */
+	tp->tg3_flags |= TG3_FLAG_HOST_TXDS;
+
+#if 0
 	/* Determine if TX descriptors will reside in
 	 * main memory or in the chip SRAM.
 	 */
 	if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) != 0 ||
-	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
 		tp->tg3_flags |= TG3_FLAG_HOST_TXDS;
+#endif
 
 	grc_misc_cfg = tr32(GRC_MISC_CFG);
 	grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK;
@@ -7126,7 +7580,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	     tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
 	     (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901 ||
 	      tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901_2 ||
-	      tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)))
+	      tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)) ||
+	    (tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
+	     tp->pdev->device == PCI_DEVICE_ID_TIGON3_5751F))
 		tp->tg3_flags |= TG3_FLAG_10_100_ONLY;
 
 	err = tg3_phy_probe(tp);
@@ -7140,11 +7596,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 
 	if (tp->phy_id == PHY_ID_SERDES) {
 		tp->tg3_flags &= ~TG3_FLAG_USE_MI_INTERRUPT;
-
-		/* And override led_mode in case Dell ever makes
-		 * a fibre board.
-		 */
-		tp->led_mode = led_mode_three_link;
 	} else {
 		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700)
 			tp->tg3_flags |= TG3_FLAG_USE_MI_INTERRUPT;
@@ -7161,7 +7612,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	else
 		tp->tg3_flags &= ~TG3_FLAG_USE_LINKCHG_REG;
 
-	/* The led_mode is set during tg3_phy_probe, here we might
+	/* The led_ctrl is set during tg3_phy_probe, here we might
 	 * have to force the link status polling mechanism based
 	 * upon subsystem IDs.
 	 */
@@ -7244,10 +7695,16 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
 		return 0;
 #endif
 
-	if (PCI_FUNC(tp->pdev->devfn) == 0)
-		mac_offset = 0x7c;
-	else
-		mac_offset = 0xcc;
+	mac_offset = 0x7c;
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
+	    !(tp->tg3_flags & TG3_FLG2_SUN_5704)) {
+		if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID)
+			mac_offset = 0xcc;
+		if (tg3_nvram_lock(tp))
+			tw32_f(NVRAM_CMD, NVRAM_CMD_RESET);
+		else
+			tg3_nvram_unlock(tp);
+	}
 
 	/* First try to get it from MAC address mailbox. */
 	tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_HIGH_MBOX, &hi);
@@ -7390,50 +7847,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
 		goto out_nofree;
 	}
 
-	if ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) == 0) {
-		tp->dma_rwctrl =
-			(0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
-			(0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT) |
-			(0x7 << DMA_RWCTRL_WRITE_WATER_SHIFT) |
-			(0x7 << DMA_RWCTRL_READ_WATER_SHIFT) |
-			(0x0f << DMA_RWCTRL_MIN_DMA_SHIFT);
-		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
-			tp->dma_rwctrl &= ~(DMA_RWCTRL_MIN_DMA
-					    << DMA_RWCTRL_MIN_DMA_SHIFT);
-	} else {
-		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
-			tp->dma_rwctrl =
-				(0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
-				(0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT) |
-				(0x3 << DMA_RWCTRL_WRITE_WATER_SHIFT) |
-				(0x7 << DMA_RWCTRL_READ_WATER_SHIFT) |
-				(0x00 << DMA_RWCTRL_MIN_DMA_SHIFT);
-		else
-			tp->dma_rwctrl =
-				(0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
-				(0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT) |
-				(0x3 << DMA_RWCTRL_WRITE_WATER_SHIFT) |
-				(0x3 << DMA_RWCTRL_READ_WATER_SHIFT) |
-				(0x0f << DMA_RWCTRL_MIN_DMA_SHIFT);
-
-		/* Wheee, some more chip bugs... */
-		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
-		    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
-			u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f);
-
-			if (ccval == 0x6 || ccval == 0x7)
-				tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA;
-		}
-	}
+	tp->dma_rwctrl = ((0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
+			  (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT));
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
-	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
-		tp->dma_rwctrl &= ~(DMA_RWCTRL_MIN_DMA
-				    << DMA_RWCTRL_MIN_DMA_SHIFT);
-
-	/* We don't do this on x86 because it seems to hurt performace.
-	 * It does help things on other platforms though.
-	 */
 #ifndef CONFIG_X86
 	{
 		u8 byte;
@@ -7445,55 +7861,63 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
 		else
 			cacheline_size = (int) byte * 4;
 
-		tp->dma_rwctrl &= ~(DMA_RWCTRL_READ_BNDRY_MASK |
-				    DMA_RWCTRL_WRITE_BNDRY_MASK);
-
 		switch (cacheline_size) {
 		case 16:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_16 |
-				 DMA_RWCTRL_WRITE_BNDRY_16);
-			break;
-
 		case 32:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_32 |
-				 DMA_RWCTRL_WRITE_BNDRY_32);
-			break;
-
 		case 64:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_64 |
-				 DMA_RWCTRL_WRITE_BNDRY_64);
-			break;
-
 		case 128:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_128 |
-				 DMA_RWCTRL_WRITE_BNDRY_128);
-			break;
-
+			if ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) &&
+			    !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
+				tp->dma_rwctrl |=
+					DMA_RWCTRL_WRITE_BNDRY_384_PCIX;
+				break;
+			} else if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+				tp->dma_rwctrl &=
+					~(DMA_RWCTRL_PCI_WRITE_CMD);
+				tp->dma_rwctrl |=
+					DMA_RWCTRL_WRITE_BNDRY_128_PCIE;
+				break;
+			}
+			/* fallthrough */
 		case 256:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_256 |
-				 DMA_RWCTRL_WRITE_BNDRY_256);
-			break;
-
-		case 512:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_512 |
-				 DMA_RWCTRL_WRITE_BNDRY_512);
-			break;
-
-		case 1024:
-			tp->dma_rwctrl |=
-				(DMA_RWCTRL_READ_BNDRY_1024 |
-				 DMA_RWCTRL_WRITE_BNDRY_1024);
-			break;
+			if (!(tp->tg3_flags & TG3_FLAG_PCIX_MODE) &&
+			    !(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS))
+				tp->dma_rwctrl |=
+					DMA_RWCTRL_WRITE_BNDRY_256;
+			else if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS))
+				tp->dma_rwctrl |=
+					DMA_RWCTRL_WRITE_BNDRY_256_PCIX;
 		};
 	}
 #endif
 
+	if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
+		tp->dma_rwctrl |= 0x001f0000;
+	} else if (!(tp->tg3_flags & TG3_FLAG_PCIX_MODE)) {
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+		    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
+			tp->dma_rwctrl |= 0x003f0000;
+		else
+			tp->dma_rwctrl |= 0x003f000f;
+	} else {
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
+		    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
+			u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f);
+
+			if (ccval == 0x6 || ccval == 0x7)
+				tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA;
+
+			/* Set bit 23 to renable PCIX hw bug fix */
+			tp->dma_rwctrl |= 0x009f0000;
+		} else {
+			tp->dma_rwctrl |= 0x001b000f;
+		}
+	}
+
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
+		tp->dma_rwctrl &= 0xfffffff0;
+
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) {
 		/* Remove this if it causes problems for some boards. */
@@ -7636,6 +8060,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
 	case PHY_ID_BCM5703:	return "5703";
 	case PHY_ID_BCM5704:	return "5704";
 	case PHY_ID_BCM5705:	return "5705";
+	case PHY_ID_BCM5750:	return "5750";
 	case PHY_ID_BCM8002:	return "8002";
 	case PHY_ID_SERDES:	return "serdes";
 	default:		return "unknown";
@@ -7750,7 +8175,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 	dev->vlan_rx_kill_vid = tg3_vlan_rx_kill_vid;
 #endif
 
-	tp = dev->priv;
+	tp = netdev_priv(dev);
 	tp->pdev = pdev;
 	tp->dev = dev;
 	tp->pm_cap = pm_cap;
@@ -7829,7 +8254,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 		goto err_out_iounmap;
 	}
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
+	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
 		tp->bufmgr_config.mbuf_read_dma_low_water =
 			DEFAULT_MB_RDMA_LOW_WATER_5705;
 		tp->bufmgr_config.mbuf_mac_rx_low_water =
@@ -7842,8 +8268,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
 	    tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 ||
-	    (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 ||
-	    (tp->tg3_flags2 & TG3_FLG2_IS_5788)) {
+	    ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 &&
+	     GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750)) {
 		tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
 	} else {
 		tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
@@ -7970,8 +8396,10 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata(pdev);
 
 	if (dev) {
+		struct tg3 *tp = netdev_priv(dev);
+
 		unregister_netdev(dev);
-		iounmap((void *) ((struct tg3 *)(dev->priv))->regs);
+		iounmap((void *)tp->regs);
 		free_netdev(dev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
@@ -7982,7 +8410,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 static int tg3_suspend(struct pci_dev *pdev, u32 state)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	int err;
 
 	if (!netif_running(dev))
@@ -8029,12 +8457,14 @@ static int tg3_suspend(struct pci_dev *pdev, u32 state)
 static int tg3_resume(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct tg3 *tp = dev->priv;
+	struct tg3 *tp = netdev_priv(dev);
 	int err;
 
 	if (!netif_running(dev))
 		return 0;
 
+	pci_restore_state(tp->pdev, tp->pci_cfg_state);
+
 	err = tg3_set_power_state(tp, 0);
 	if (err)
 		return err;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c837e89f7..fabc65f7a 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -118,12 +118,17 @@
 #define  CHIPREV_ID_5704_A2		 0x2002
 #define  CHIPREV_ID_5705_A0		 0x3000
 #define  CHIPREV_ID_5705_A1		 0x3001
+#define  CHIPREV_ID_5705_A2		 0x3002
+#define  CHIPREV_ID_5705_A3		 0x3003
+#define  CHIPREV_ID_5750_A0		 0x4000
+#define  CHIPREV_ID_5750_A1		 0x4001
 #define  GET_ASIC_REV(CHIP_REV_ID)	((CHIP_REV_ID) >> 12)
 #define   ASIC_REV_5700			 0x07
 #define   ASIC_REV_5701			 0x00
 #define   ASIC_REV_5703			 0x01
 #define   ASIC_REV_5704			 0x02
 #define   ASIC_REV_5705			 0x03
+#define   ASIC_REV_5750			 0x04
 #define  GET_CHIP_REV(CHIP_REV_ID)	((CHIP_REV_ID) >> 8)
 #define   CHIPREV_5700_AX		 0x70
 #define   CHIPREV_5700_BX		 0x71
@@ -144,8 +149,11 @@
 #define  DMA_RWCTRL_READ_BNDRY_MASK	 0x00000700
 #define  DMA_RWCTRL_READ_BNDRY_DISAB	 0x00000000
 #define  DMA_RWCTRL_READ_BNDRY_16	 0x00000100
+#define  DMA_RWCTRL_READ_BNDRY_128_PCIX	 0x00000100
 #define  DMA_RWCTRL_READ_BNDRY_32	 0x00000200
+#define  DMA_RWCTRL_READ_BNDRY_256_PCIX	 0x00000200
 #define  DMA_RWCTRL_READ_BNDRY_64	 0x00000300
+#define  DMA_RWCTRL_READ_BNDRY_384_PCIX	 0x00000300
 #define  DMA_RWCTRL_READ_BNDRY_128	 0x00000400
 #define  DMA_RWCTRL_READ_BNDRY_256	 0x00000500
 #define  DMA_RWCTRL_READ_BNDRY_512	 0x00000600
@@ -153,8 +161,11 @@
 #define  DMA_RWCTRL_WRITE_BNDRY_MASK	 0x00003800
 #define  DMA_RWCTRL_WRITE_BNDRY_DISAB	 0x00000000
 #define  DMA_RWCTRL_WRITE_BNDRY_16	 0x00000800
+#define  DMA_RWCTRL_WRITE_BNDRY_128_PCIX 0x00000800
 #define  DMA_RWCTRL_WRITE_BNDRY_32	 0x00001000
+#define  DMA_RWCTRL_WRITE_BNDRY_256_PCIX 0x00001000
 #define  DMA_RWCTRL_WRITE_BNDRY_64	 0x00001800
+#define  DMA_RWCTRL_WRITE_BNDRY_384_PCIX 0x00001800
 #define  DMA_RWCTRL_WRITE_BNDRY_128	 0x00002000
 #define  DMA_RWCTRL_WRITE_BNDRY_256	 0x00002800
 #define  DMA_RWCTRL_WRITE_BNDRY_512	 0x00003000
@@ -170,6 +181,9 @@
 #define  DMA_RWCTRL_PCI_READ_CMD_SHIFT	 24
 #define  DMA_RWCTRL_PCI_WRITE_CMD	 0xf0000000
 #define  DMA_RWCTRL_PCI_WRITE_CMD_SHIFT	 28
+#define  DMA_RWCTRL_WRITE_BNDRY_64_PCIE	 0x10000000
+#define  DMA_RWCTRL_WRITE_BNDRY_128_PCIE 0x30000000
+#define  DMA_RWCTRL_WRITE_BNDRY_DISAB_PCIE 0x70000000
 #define TG3PCI_PCISTATE			0x00000070
 #define  PCISTATE_FORCE_RESET		 0x00000001
 #define  PCISTATE_INT_NOT_ACTIVE	 0x00000002
@@ -202,7 +216,11 @@
 #define TG3PCI_STD_RING_PROD_IDX	0x00000098 /* 64-bit */
 #define TG3PCI_RCV_RET_RING_CON_IDX	0x000000a0 /* 64-bit */
 #define TG3PCI_SND_PROD_IDX		0x000000a8 /* 64-bit */
-/* 0xb0 --> 0x100 unused */
+/* 0xb0 --> 0xb8 unused */
+#define TG3PCI_DUAL_MAC_CTRL		0x000000b8
+#define  DUAL_MAC_CTRL_CH_MASK		 0x00000003
+#define  DUAL_MAC_CTRL_ID		 0x00000004
+/* 0xbc --> 0x100 unused */
 
 /* 0x100 --> 0x200 unused */
 
@@ -334,9 +352,12 @@
 #define  LED_CTRL_100MBPS_STATUS	 0x00000100
 #define  LED_CTRL_10MBPS_STATUS		 0x00000200
 #define  LED_CTRL_TRAFFIC_STATUS	 0x00000400
-#define  LED_CTRL_MAC_MODE		 0x00000000
-#define  LED_CTRL_PHY_MODE_1		 0x00000800
-#define  LED_CTRL_PHY_MODE_2		 0x00001000
+#define  LED_CTRL_MODE_MAC		 0x00000000
+#define  LED_CTRL_MODE_PHY_1		 0x00000800
+#define  LED_CTRL_MODE_PHY_2		 0x00001000
+#define  LED_CTRL_MODE_SHASTA_MAC	 0x00002000
+#define  LED_CTRL_MODE_SHARED		 0x00004000
+#define  LED_CTRL_MODE_COMBO		 0x00008000
 #define  LED_CTRL_BLINK_RATE_MASK	 0x7ff80000
 #define  LED_CTRL_BLINK_RATE_SHIFT	 19
 #define  LED_CTRL_BLINK_PER_OVERRIDE	 0x00080000
@@ -1332,6 +1353,9 @@
 #define  SWARB_REQ3			 0x00008000
 #define    NVRAM_BUFFERED_PAGE_SIZE	   264
 #define    NVRAM_BUFFERED_PAGE_POS	   9
+#define NVRAM_ACCESS			0x00007024
+#define  ACCESS_ENABLE			 0x00000001
+#define  ACCESS_WR_ENABLE		 0x00000002
 /* 0x7024 --> 0x7400 unused */
 
 /* 0x7400 --> 0x8000 unused */
@@ -1355,11 +1379,9 @@
 
 #define NIC_SRAM_DATA_CFG			0x00000b58
 #define  NIC_SRAM_DATA_CFG_LED_MODE_MASK	 0x0000000c
-#define  NIC_SRAM_DATA_CFG_LED_MODE_UNKNOWN	 0x00000000
-#define  NIC_SRAM_DATA_CFG_LED_TRIPLE_SPD	 0x00000004
-#define  NIC_SRAM_DATA_CFG_LED_OPEN_DRAIN	 0x00000004
-#define  NIC_SRAM_DATA_CFG_LED_LINK_SPD		 0x00000008
-#define  NIC_SRAM_DATA_CFG_LED_OUTPUT		 0x00000008
+#define  NIC_SRAM_DATA_CFG_LED_MODE_MAC		 0x00000000
+#define  NIC_SRAM_DATA_CFG_LED_MODE_PHY_1	 0x00000004
+#define  NIC_SRAM_DATA_CFG_LED_MODE_PHY_2	 0x00000008
 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_MASK	 0x00000030
 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_UNKNOWN	 0x00000000
 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_COPPER	 0x00000010
@@ -1386,7 +1408,9 @@
 #define NIC_SRAM_FW_ASF_STATUS_MBOX	0x00000c00
 #define NIC_SRAM_FW_DRV_STATE_MBOX	0x00000c04
 #define  DRV_STATE_START		 0x00000001
+#define  DRV_STATE_START_DONE		 0x80000001
 #define  DRV_STATE_UNLOAD		 0x00000002
+#define  DRV_STATE_UNLOAD_DONE		 0x80000002
 #define  DRV_STATE_WOL			 0x00000003
 #define  DRV_STATE_SUSPEND		 0x00000004
 
@@ -1395,6 +1419,14 @@
 #define NIC_SRAM_MAC_ADDR_HIGH_MBOX	0x00000c14
 #define NIC_SRAM_MAC_ADDR_LOW_MBOX	0x00000c18
 
+#define NIC_SRAM_DATA_CFG_2		0x00000d38
+
+#define  SHASTA_EXT_LED_MODE_MASK	 0x00018000
+#define  SHASTA_EXT_LED_LEGACY		 0x00000000
+#define  SHASTA_EXT_LED_SHARED		 0x00008000
+#define  SHASTA_EXT_LED_MAC		 0x00010000
+#define  SHASTA_EXT_LED_COMBO		 0x00018000
+
 #define NIC_SRAM_RX_MINI_BUFFER_DESC	0x00001000
 
 #define NIC_SRAM_DMA_DESC_POOL_BASE	0x00002000
@@ -1756,12 +1788,6 @@ struct tg3_hw_stats {
 	u8				__reserved4[0xb00-0x9c0];
 };
 
-enum phy_led_mode {
-	led_mode_auto,
-	led_mode_three_link,
-	led_mode_link10
-};
-
 /* 'mapping' is superfluous as the chip does not write into
  * the tx/rx post rings so we could just fetch it from there.
  * But the cache behavior is better how we are doing it now.
@@ -1819,10 +1845,13 @@ struct tg3_bufmgr_config {
 
 struct tg3_ethtool_stats {
 	/* Statistics maintained by Receive MAC. */
+	u64 	    	rx_octets;
 	u64		rx_fragments;
 	u64		rx_ucast_packets;
+	u64		rx_mcast_packets;
 	u64		rx_bcast_packets;
 	u64		rx_fcs_errors;
+	u64		rx_align_errors;
 	u64		rx_xon_pause_rcvd;
 	u64		rx_xoff_pause_rcvd;
 	u64		rx_mac_ctrl_rcvd;
@@ -1832,8 +1861,20 @@ struct tg3_ethtool_stats {
 	u64		rx_undersize_packets;
 	u64		rx_in_length_errors;
 	u64		rx_out_length_errors;
+	u64		rx_64_or_less_octet_packets;
+	u64		rx_65_to_127_octet_packets;
+	u64		rx_128_to_255_octet_packets;
+	u64		rx_256_to_511_octet_packets;
+	u64		rx_512_to_1023_octet_packets;
+	u64		rx_1024_to_1522_octet_packets;
+	u64		rx_1523_to_2047_octet_packets;
+	u64		rx_2048_to_4095_octet_packets;
+	u64		rx_4096_to_8191_octet_packets;
+	u64		rx_8192_to_9022_octet_packets;
 
 	/* Statistics maintained by Transmit MAC. */
+	u64		tx_octets;
+	u64		tx_collisions;
 	u64		tx_xon_sent;
 	u64		tx_xoff_sent;
 	u64		tx_flow_control;
@@ -1843,9 +1884,46 @@ struct tg3_ethtool_stats {
 	u64		tx_deferred;
 	u64		tx_excessive_collisions;
 	u64		tx_late_collisions;
+	u64		tx_collide_2times;
+	u64		tx_collide_3times;
+	u64		tx_collide_4times;
+	u64		tx_collide_5times;
+	u64		tx_collide_6times;
+	u64		tx_collide_7times;
+	u64		tx_collide_8times;
+	u64		tx_collide_9times;
+	u64		tx_collide_10times;
+	u64		tx_collide_11times;
+	u64		tx_collide_12times;
+	u64		tx_collide_13times;
+	u64		tx_collide_14times;
+	u64		tx_collide_15times;
 	u64		tx_ucast_packets;
 	u64		tx_mcast_packets;
 	u64		tx_bcast_packets;
+	u64		tx_carrier_sense_errors;
+	u64		tx_discards;
+	u64		tx_errors;
+
+	/* Statistics maintained by Receive List Placement. */
+	u64		dma_writeq_full;
+	u64		dma_write_prioq_full;
+	u64		rxbds_empty;
+	u64		rx_discards;
+	u64		rx_errors;
+	u64		rx_threshold_hit;
+
+	/* Statistics maintained by Send Data Initiator. */
+	u64		dma_readq_full;
+	u64		dma_read_prioq_full;
+	u64		tx_comp_queue_full;
+
+	/* Statistics maintained by Host Coalescing. */
+	u64		ring_set_send_prod_index;
+	u64		ring_status_update;
+	u64		nic_irqs;
+	u64		nic_avoided_irqs;
+	u64		nic_tx_threshold_hit;
 };
 
 struct tg3 {
@@ -1964,6 +2042,8 @@ struct tg3 {
 #define TG3_FLG2_PHY_ADC_BUG		0x00000040
 #define TG3_FLG2_PHY_5704_A0_BUG	0x00000080
 #define TG3_FLG2_PHY_BER_BUG		0x00000100
+#define TG3_FLG2_PCI_EXPRESS		0x00000200
+#define TG3_FLG2_ASF_NEW_HANDSHAKE	0x00000400
 
 	u32				split_mode_max_reqs;
 #define SPLIT_MODE_5704_MAX_REQ		3
@@ -2009,6 +2089,7 @@ struct tg3 {
 #define PHY_ID_BCM5703			0x60008160
 #define PHY_ID_BCM5704			0x60008190
 #define PHY_ID_BCM5705			0x600081a0
+#define PHY_ID_BCM5750			0x60008180
 #define PHY_ID_BCM8002			0x60010140
 #define PHY_ID_SERDES			0xfeedbee0
 #define PHY_ID_INVALID			0xffffffff
@@ -2018,7 +2099,7 @@ struct tg3 {
 #define PHY_REV_BCM5401_C0		0x6
 #define PHY_REV_BCM5411_X0		0x1 /* Found on Netgear GA302T */
 
-	enum phy_led_mode		led_mode;
+	u32				led_ctrl;
 
 	char				board_part_number[24];
 	u32				nic_sram_data_cfg;
@@ -2032,7 +2113,7 @@ struct tg3 {
 	((X) == PHY_ID_BCM5400 || (X) == PHY_ID_BCM5401 || \
 	 (X) == PHY_ID_BCM5411 || (X) == PHY_ID_BCM5701 || \
 	 (X) == PHY_ID_BCM5703 || (X) == PHY_ID_BCM5704 || \
-	 (X) == PHY_ID_BCM5705 || \
+	 (X) == PHY_ID_BCM5705 || (X) == PHY_ID_BCM5750 || \
 	 (X) == PHY_ID_BCM8002 || (X) == PHY_ID_SERDES)
 
 	struct tg3_hw_stats		*hw_stats;
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 747f8717d..4c57ab290 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -446,7 +446,9 @@ static void __devexit tlan_remove_one( struct pci_dev *pdev)
 		pci_free_consistent(priv->pciDev, priv->dmaSize, priv->dmaStorage, priv->dmaStorageDMA );
 	}
 
+#ifdef CONFIG_PCI
 	pci_release_regions(pdev);
+#endif
 	
 	free_netdev( dev );
 		
@@ -673,8 +675,10 @@ err_out_uninit:
 err_out_free_dev:
 	free_netdev(dev);
 err_out_regions:
+#ifdef CONFIG_PCI
 	if (pdev)
 		pci_release_regions(pdev);
+#endif
 err_out:
 	if (pdev)
 		pci_disable_device(pdev);
@@ -980,7 +984,7 @@ static int TLan_Open( struct net_device *dev )
 static int TLan_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	TLanPrivateInfo *priv = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	u32 phy   = priv->phy[priv->phyNum];
 	
 	if (!priv->phyOnline)
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index d469a96b0..e8ff967b6 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -1806,7 +1806,7 @@ static int __init olympic_pci_init(void)
 
 static void __exit olympic_pci_cleanup(void)
 {
-	return pci_unregister_driver(&olympic_driver) ; 
+	pci_unregister_driver(&olympic_driver) ; 
 }	
 
 
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index be797b537..71fc3d084 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -357,13 +357,6 @@ static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
 static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
 
 
-static inline unsigned long
-msec_to_jiffies(unsigned long ms)
-{
-	return (((ms)*HZ+999)/1000);
-}
-
-
 #define dr32(reg)		readl(de->regs + (reg))
 #define dw32(reg,val)		writel((val), de->regs + (reg))
 
@@ -1216,7 +1209,7 @@ static void de_adapter_wake (struct de_private *de)
 
 		/* de4x5.c delays, so we do too */
 		current->state = TASK_UNINTERRUPTIBLE;
-		schedule_timeout(msec_to_jiffies(10));
+		schedule_timeout(msecs_to_jiffies(10));
 	}
 }
 
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 3fb06e5cb..d59d46ecd 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -5535,7 +5535,7 @@ static int
 de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
     struct de4x5_private *lp = netdev_priv(dev);
-    struct de4x5_ioctl *ioc = (struct de4x5_ioctl *) &rq->ifr_data;
+    struct de4x5_ioctl *ioc = (struct de4x5_ioctl *) &rq->ifr_ifru;
     u_long iobase = dev->base_addr;
     int i, j, status = 0;
     s32 omr;
diff --git a/drivers/net/tulip/de4x5.h b/drivers/net/tulip/de4x5.h
index 7f02aacd3..ad37a4074 100644
--- a/drivers/net/tulip/de4x5.h
+++ b/drivers/net/tulip/de4x5.h
@@ -1005,7 +1005,7 @@
 struct de4x5_ioctl {
 	unsigned short cmd;                /* Command to run */
 	unsigned short len;                /* Length of the data buffer */
-	unsigned char  *data;              /* Pointer to the data buffer */
+	unsigned char  __user *data;       /* Pointer to the data buffer */
 };
 
 /* 
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 5bbf0261e..666f926e9 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -299,6 +299,9 @@ static void dmfe_set_filter_mode(struct DEVICE *);
 static struct ethtool_ops netdev_ethtool_ops;
 static u16 read_srom_word(long ,int);
 static irqreturn_t dmfe_interrupt(int , void *, struct pt_regs *);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void poll_dmfe (struct net_device *dev);
+#endif
 static void dmfe_descriptor_init(struct dmfe_board_info *, unsigned long);
 static void allocate_rx_buffer(struct dmfe_board_info *);
 static void update_cr6(u32, unsigned long);
@@ -417,6 +420,9 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
 	dev->stop = &dmfe_stop;
 	dev->get_stats = &dmfe_get_stats;
 	dev->set_multicast_list = &dmfe_set_filter_mode;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = &poll_dmfe;
+#endif
 	dev->ethtool_ops = &netdev_ethtool_ops;
 	spin_lock_init(&db->lock);
 
@@ -791,6 +797,23 @@ static irqreturn_t dmfe_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+static void poll_dmfe (struct net_device *dev)
+{
+	/* disable_irq here is not very nice, but with the lockless
+	   interrupt handler we have no other choice. */
+	disable_irq(dev->irq);
+	dmfe_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 /*
  *	Free TX resource after TX complete
  */
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 1736c1dc0..b266bfec3 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -90,12 +90,8 @@ static const char *block_name[] __devinitdata = {
  */
 static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
 {
-#ifdef __hppa__
-	unsigned char *ee_data = tp->eeprom;
-
-	if (ee_data[0] == 0x3c && ee_data[1] == 0x10 && 
-		(ee_data[2] == 0x63 || ee_data[2] == 0x61) && ee_data[3] == 0x10) {
-
+#ifdef CONFIG_GSC
+	if (tp->flags & NEEDS_FAKE_MEDIA_TABLE) {
 		static unsigned char leafdata[] =
 			{ 0x01,       /* phy number */
 			  0x02,       /* gpr setup sequence length */
@@ -306,12 +302,12 @@ subsequent_board:
 
 /*  EEPROM_Ctrl bits. */
 #define EE_SHIFT_CLK	0x02	/* EEPROM shift clock. */
-#define EE_CS			0x01	/* EEPROM chip select. */
+#define EE_CS		0x01	/* EEPROM chip select. */
 #define EE_DATA_WRITE	0x04	/* Data from the Tulip to EEPROM. */
-#define EE_WRITE_0		0x01
-#define EE_WRITE_1		0x05
+#define EE_WRITE_0	0x01
+#define EE_WRITE_1	0x05
 #define EE_DATA_READ	0x08	/* Data from the EEPROM chip. */
-#define EE_ENB			(0x4800 | EE_CS)
+#define EE_ENB		(0x4800 | EE_CS)
 
 /* Delay between EEPROM clock transitions.
    Even at 33Mhz current PCI implementations don't overrun the EEPROM clock.
@@ -322,11 +318,12 @@ subsequent_board:
 #define EE_READ_CMD		(6)
 
 /* Note: this routine returns extra data bits for size detection. */
-int __devinit tulip_read_eeprom(long ioaddr, int location, int addr_len)
+int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_len)
 {
 	int i;
 	unsigned retval = 0;
-	long ee_addr = ioaddr + CSR9;
+	struct tulip_private *tp = dev->priv;
+	long ee_addr = tp->base_addr + CSR9;
 	int read_cmd = location | (EE_READ_CMD << addr_len);
 
 	outl(EE_ENB & ~EE_CS, ee_addr);
@@ -354,6 +351,6 @@ int __devinit tulip_read_eeprom(long ioaddr, int location, int addr_len)
 
 	/* Terminate the EEPROM access. */
 	outl(EE_ENB & ~EE_CS, ee_addr);
-	return retval;
+	return (tp->flags & HAS_SWAPPED_SEEPROM) ? swab16(retval) : retval;
 }
 
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index cb0e30486..f86170e9b 100644
--- a/drivers/net/tulip/interrupt.c
+++ b/drivers/net/tulip/interrupt.c
@@ -133,6 +133,10 @@ int tulip_poll(struct net_device *dev, int *budget)
 			   tp->rx_ring[entry].status);
 
        do {
+		if (inl(dev->base_addr + CSR5) == 0xffffffff) {
+			printk(KERN_DEBUG " In tulip_poll(), hardware disappeared.\n");
+			break;
+		}
                /* Acknowledge current RX interrupt sources. */
                outl((RxIntr | RxNoBuf), dev->base_addr + CSR5);
  
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
index e21e7c3a3..56d18cc18 100644
--- a/drivers/net/tulip/tulip.h
+++ b/drivers/net/tulip/tulip.h
@@ -64,6 +64,8 @@ enum tbl_flag {
 	COMET_MAC_ADDR		= 0x0800,
 	HAS_PCI_MWI		= 0x1000,
 	HAS_PHY_IRQ		= 0x2000,
+	HAS_SWAPPED_SEEPROM	= 0x4000,
+	NEEDS_FAKE_MEDIA_TABLE	= 0x8000,
 };
 
 
@@ -407,7 +409,7 @@ void pnic2_lnk_change(struct net_device *dev, int csr5);
 
 /* eeprom.c */
 void tulip_parse_eeprom(struct net_device *dev);
-int tulip_read_eeprom(long ioaddr, int location, int addr_len);
+int tulip_read_eeprom(struct net_device *dev, int location, int addr_len);
 
 /* interrupt.c */
 extern unsigned int tulip_max_interrupt_work;
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index c3b4d91bc..498f612cf 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -226,8 +226,9 @@ static struct pci_device_id tulip_pci_tbl[] = {
 	{ 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
 	{ 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
-	{ 0x14f1, 0x1803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CONEXANT },
+	{ 0x1186, 0x1541, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1186, 0x1561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+	{ 0x14f1, 0x1803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CONEXANT },
 	{ 0x1626, 0x8410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1737, 0xAB09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1737, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
@@ -829,7 +830,7 @@ static struct net_device_stats *tulip_get_stats(struct net_device *dev)
 }
 
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct tulip_private *np = netdev_priv(dev);
 	u32 ethcmd;
@@ -858,14 +859,14 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct tulip_private *tp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 	const unsigned int phy_idx = 0;
 	int phy = tp->phys[phy_idx] & 0x1f;
 	unsigned int regnum = data->reg_num;
 
 	switch (cmd) {
 	case SIOCETHTOOL:
-		return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return netdev_ethtool_ioctl(dev, rq->ifr_data);
 
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
 		if (tp->mii_cnt)
@@ -1245,6 +1246,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
 	long ioaddr;
 	static int board_idx = -1;
 	int chip_idx = ent->driver_data;
+	const char *chip_name = tulip_tbl[chip_idx].chip_name;
 	unsigned int eeprom_missing = 0;
 	unsigned int force_csr0 = 0;
 
@@ -1413,6 +1415,23 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
 
 	pci_set_master(pdev);
 
+#ifdef CONFIG_GSC
+	if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP) {
+		switch (pdev->subsystem_device) {
+		default:
+			break;
+		case 0x1061:
+		case 0x1062:
+		case 0x1063:
+		case 0x1098:
+		case 0x1099:
+		case 0x10EE:
+			tp->flags |= HAS_SWAPPED_SEEPROM | NEEDS_FAKE_MEDIA_TABLE;
+			chip_name = "GSC DS21140 Tulip";
+		}
+	}
+#endif
+
 	/* Clear the missed-packet counter. */
 	inl(ioaddr + CSR8);
 
@@ -1441,11 +1460,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
 	} else {
 		/* A serial EEPROM interface, we read now and sort it out later. */
 		int sa_offset = 0;
-		int ee_addr_size = tulip_read_eeprom(ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
+		int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6;
 
-		for (i = 0; i < sizeof(tp->eeprom)/2; i++)
-			((u16 *)ee_data)[i] =
-				le16_to_cpu(tulip_read_eeprom(ioaddr, i, ee_addr_size));
+		for (i = 0; i < sizeof(tp->eeprom); i+=2) {
+			u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size);
+			ee_data[i] = data & 0xff;
+			ee_data[i + 1] = data >> 8;
+		}
 
 		/* DEC now has a specification (see Notes) but early board makers
 		   just put the address in the first EEPROM locations. */
@@ -1488,25 +1509,26 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
                        tp->flags &= ~HAS_MEDIA_TABLE;
                }
 #endif
-#ifdef __hppa__
-		/* 3x5 HSC (J3514A) has a broken srom */
-		if(ee_data[0] == 0x61 && ee_data[1] == 0x10) {
+#ifdef CONFIG_GSC
+		/* Check to see if we have a broken srom */
+		if (ee_data[0] == 0x61 && ee_data[1] == 0x10) {
 			/* pci_vendor_id and subsystem_id are swapped */
 			ee_data[0] = ee_data[2];
 			ee_data[1] = ee_data[3];
 			ee_data[2] = 0x61;
 			ee_data[3] = 0x10;
 
-			/* srom need to be byte-swaped and shifted up 1 word.  
-			 * This shift needs to happen at the end of the MAC
-			 * first because of the 2 byte overlap.
+			/* HSC-PCI boards need to be byte-swaped and shifted
+			 * up 1 word.  This shift needs to happen at the end
+			 * of the MAC first because of the 2 byte overlap.
 			 */
-			for(i = 4; i >= 0; i -= 2) {
+			for (i = 4; i >= 0; i -= 2) {
 				ee_data[17 + i + 3] = ee_data[17 + i];
 				ee_data[16 + i + 5] = ee_data[16 + i];
 			}
 		}
 #endif
+
 		for (i = 0; i < 6; i ++) {
 			dev->dev_addr[i] = ee_data[i + sa_offset];
 			sum += ee_data[i + sa_offset];
@@ -1627,7 +1649,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
 		goto err_out_free_ring;
 
 	printk(KERN_INFO "%s: %s rev %d at %#3lx,",
-	       dev->name, tulip_tbl[chip_idx].chip_name, chip_rev, ioaddr);
+	       dev->name, chip_name, chip_rev, ioaddr);
 	pci_set_drvdata(pdev, dev);
 
 	if (eeprom_missing)
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 8272d605e..f5aeb3dda 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -1526,8 +1526,8 @@ static struct ethtool_ops netdev_ethtool_ops = {
 
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
-	struct netdev_private *np = dev->priv;
+	struct mii_ioctl_data *data = if_mii(rq);
+	struct netdev_private *np = netdev_priv(dev);
 
 	switch(cmd) {
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
@@ -1733,10 +1733,7 @@ static struct pci_driver w840_driver = {
 
 static int __init w840_init(void)
 {
-/* when a module, this is printed whether or not devices are found in probe */
-#ifdef MODULE
 	printk(version);
-#endif
 	return pci_module_init(&w840_driver);
 }
 
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c
index 5f6cea1b2..a01cc1b09 100644
--- a/drivers/net/tulip/xircom_tulip_cb.c
+++ b/drivers/net/tulip/xircom_tulip_cb.c
@@ -1369,7 +1369,7 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev)
 }
 
 
-static int xircom_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int xircom_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct ethtool_cmd ecmd;
 	struct xircom_private *tp = dev->priv;
@@ -1471,13 +1471,13 @@ static int xircom_ethtool_ioctl(struct net_device *dev, void *useraddr)
 static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct xircom_private *tp = dev->priv;
-	u16 *data = (u16 *)&rq->ifr_data;
+	u16 *data = (u16 *)&rq->ifr_ifru;
 	int phy = tp->phys[0] & 0x1f;
 	unsigned long flags;
 
 	switch(cmd) {
 	case SIOCETHTOOL:
-		return xircom_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return xircom_ethtool_ioctl(dev, rq->ifr_data);
 
 	/* Legacy mii-diag interface */
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index e6df23fea..d0fe0f656 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -129,8 +129,8 @@ static void tun_net_init(struct net_device *dev)
 		dev->addr_len = 0;
 		dev->mtu = 1500;
 
-		/* Type PPP seems most suitable */
-		dev->type = ARPHRD_PPP; 
+		/* Zero header length */
+		dev->type = ARPHRD_NONE; 
 		dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
 		dev->tx_queue_len = 10;
 		break;
@@ -241,10 +241,10 @@ static ssize_t tun_chr_writev(struct file * file, const struct iovec *iv,
 }
 
 /* Write */
-static ssize_t tun_chr_write(struct file * file, const char * buf, 
+static ssize_t tun_chr_write(struct file * file, const char __user * buf, 
 			     size_t count, loff_t *pos)
 {
-	struct iovec iv = { (void *) buf, count };
+	struct iovec iv = { (void __user *) buf, count };
 	return tun_chr_writev(file, &iv, 1, pos);
 }
 
@@ -333,7 +333,7 @@ static ssize_t tun_chr_readv(struct file *file, const struct iovec *iv,
 }
 
 /* Read */
-static ssize_t tun_chr_read(struct file * file, char * buf, 
+static ssize_t tun_chr_read(struct file * file, char __user * buf, 
 			    size_t count, loff_t *pos)
 {
 	struct iovec iv = { buf, count };
@@ -462,7 +462,7 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
 		struct ifreq ifr;
 		int err;
 
-		if (copy_from_user(&ifr, (void *)arg, sizeof(ifr)))
+		if (copy_from_user(&ifr, (void __user *)arg, sizeof(ifr)))
 			return -EFAULT;
 		ifr.ifr_name[IFNAMSIZ-1] = '\0';
 
@@ -473,7 +473,7 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
 		if (err)
 			return err;
 
-		if (copy_to_user((void *)arg, &ifr, sizeof(ifr)))
+		if (copy_to_user((void __user *)arg, &ifr, sizeof(ifr)))
 			return -EFAULT;
 		return 0;
 	}
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 39949dbb1..45ab1999d 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -1162,7 +1162,7 @@ typhoon_ethtool_sset(struct typhoon *tp, struct ethtool_cmd *cmd)
 }
 
 static inline int
-typhoon_ethtool_ioctl(struct net_device *dev, void *useraddr)
+typhoon_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct typhoon *tp = (struct typhoon *) dev->priv;
 	u32 ethcmd;
@@ -1237,7 +1237,7 @@ typhoon_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	switch (cmd) {
 	case SIOCETHTOOL:
-		return typhoon_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+		return typhoon_ethtool_ioctl(dev, ifr->ifr_data);
 	default:
 		break;
 	}
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 853100220..721e92f49 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -74,8 +74,8 @@
 
 	LK1.1.11:
 	- David Woodhouse: Set dev->base_addr before the first time we call
-					   wait_for_reset(). It's a lot happier that way.
-					   Free np->tx_bufs only if we actually allocated it.
+			   wait_for_reset(). It's a lot happier that way.
+			   Free np->tx_bufs only if we actually allocated it.
 
 	LK1.1.12:
 	- Martin Eriksson: Allow Memory-Mapped IO to be enabled.
@@ -85,7 +85,7 @@
 	- Replace some MII-related magic numbers with constants
 
 	LK1.1.14 (Ivan G.):
- 	- fixes comments for Rhine-III
+	- fixes comments for Rhine-III
 	- removes W_MAX_TIMEOUT (unused)
 	- adds HasDavicomPhy for Rhine-I (basis: linuxfet driver; my card
 	  is R-I and has Davicom chip, flag is referenced in kernel driver)
@@ -96,10 +96,10 @@
 	- transmit frame queue message is off by one - fixed
 	- adds IntrNormalSummary to "Something Wicked" exclusion list
 	  so normal interrupts will not trigger the message (src: Donald Becker)
- 	(Roger Luethi)
- 	- show confused chip where to continue after Tx error
- 	- location of collision counter is chip specific
- 	- allow selecting backoff algorithm (module parameter)
+	(Roger Luethi)
+	- show confused chip where to continue after Tx error
+	- location of collision counter is chip specific
+	- allow selecting backoff algorithm (module parameter)
 
 	LK1.1.15 (jgarzik):
 	- Use new MII lib helper generic_mii_ioctl
@@ -128,14 +128,14 @@
 */
 
 #define DRV_NAME	"via-rhine"
-#define DRV_VERSION	"1.1.19-2.5"
-#define DRV_RELDATE	"July-12-2003"
+#define DRV_VERSION	"1.1.20-2.6"
+#define DRV_RELDATE	"May-23-2004"
 
 
 /* A few user-configurable values.
    These may be modified when a driver module is loaded. */
 
-static int debug = 1;			/* 1 normal messages, 0 quiet .. 7 verbose. */
+static int debug = 1;	/* 1 normal messages, 0 quiet .. 7 verbose. */
 static int max_interrupt_work = 20;
 
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
@@ -155,12 +155,12 @@ static int backoff;
    Use option values 0x10 and 0x100 for forcing half duplex fixed speed.
    Use option values 0x20 and 0x200 for forcing full duplex operation.
 */
-#define MAX_UNITS 8		/* More are supported, limit only on options */
+#define MAX_UNITS	8	/* More are supported, limit only on options */
 static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
-   The Rhine has a 64 element 8390-like hash table.  */
+   The Rhine has a 64 element 8390-like hash table. */
 static const int multicast_filter_limit = 32;
 
 
@@ -172,16 +172,16 @@ static const int multicast_filter_limit = 32;
    bonding and packet priority.
    There are no ill effects from too-large receive rings. */
 #define TX_RING_SIZE	16
-#define TX_QUEUE_LEN	10		/* Limit ring entries actually used.  */
+#define TX_QUEUE_LEN	10	/* Limit ring entries actually used. */
 #define RX_RING_SIZE	16
 
 
 /* Operational parameters that usually are not changed. */
 
 /* Time in jiffies before concluding the transmitter is hung. */
-#define TX_TIMEOUT  (2*HZ)
+#define TX_TIMEOUT	(2*HZ)
 
-#define PKT_BUF_SZ		1536			/* Size of each temporary Rx buffer.*/
+#define PKT_BUF_SZ	1536	/* Size of each temporary Rx buffer.*/
 
 #if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
 #warning  You must compile this file with the correct options!
@@ -206,7 +206,7 @@ static const int multicast_filter_limit = 32;
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/crc32.h>
-#include <asm/processor.h>		/* Processor type for cache alignment. */
+#include <asm/processor.h>	/* Processor type for cache alignment. */
 #include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -214,18 +214,16 @@ static const int multicast_filter_limit = 32;
 
 /* These identify the driver base version and may not be removed. */
 static char version[] __devinitdata =
-KERN_INFO DRV_NAME ".c:v1.10-LK" DRV_VERSION "  " DRV_RELDATE "  Written by Donald Becker\n"
-KERN_INFO "  http://www.scyld.com/network/via-rhine.html\n";
+KERN_INFO DRV_NAME ".c:v1.10-LK" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n";
 
 static char shortname[] = DRV_NAME;
 
 
-/* This driver was written to use PCI memory space, however most versions
-   of the Rhine only work correctly with I/O space accesses. */
+/* This driver was written to use PCI memory space. Some early versions
+   of the Rhine may only work correctly with I/O space accesses. */
 #ifdef CONFIG_VIA_RHINE_MMIO
-#define USE_MEM
+#define USE_MMIO
 #else
-#define USE_IO
 #undef readb
 #undef readw
 #undef readl
@@ -258,7 +256,7 @@ MODULE_PARM_DESC(options, "VIA Rhine: Bits 0-3: media type, bit 17: full duplex"
 MODULE_PARM_DESC(full_duplex, "VIA Rhine full duplex setting(s) (1)");
 
 /*
-				Theory of Operation
+		Theory of Operation
 
 I. Board Compatibility
 
@@ -281,7 +279,7 @@ IIIa. Ring buffers
 
 This driver uses two statically allocated fixed-size descriptor lists
 formed into rings by a branch from the final descriptor to the beginning of
-the list.  The ring sizes are set at compile time by RX/TX_RING_SIZE.
+the list. The ring sizes are set at compile time by RX/TX_RING_SIZE.
 
 IIIb/c. Transmit/Receive Structure
 
@@ -292,29 +290,29 @@ the driver must often copy transmit packets into bounce buffers.
 
 The driver allocates full frame size skbuffs for the Rx ring buffers at
 open() time and passes the skb->data field to the chip as receive data
-buffers.  When an incoming frame is less than RX_COPYBREAK bytes long,
+buffers. When an incoming frame is less than RX_COPYBREAK bytes long,
 a fresh skbuff is allocated and the frame is copied to the new skbuff.
 When the incoming frame is larger, the skbuff is passed directly up the
-protocol stack.  Buffers consumed this way are replaced by newly allocated
-skbuffs in the last phase of via_rhine_rx().
+protocol stack. Buffers consumed this way are replaced by newly allocated
+skbuffs in the last phase of rhine_rx().
 
 The RX_COPYBREAK value is chosen to trade-off the memory wasted by
 using a full-sized skbuff for small frames vs. the copying costs of larger
-frames.  New boards are typically used in generously configured machines
+frames. New boards are typically used in generously configured machines
 and the underfilled buffers have negligible impact compared to the benefit of
 a single allocation size, so the default value of zero results in never
-copying packets.  When copying is done, the cost is usually mitigated by using
-a combined copy/checksum routine.  Copying also preloads the cache, which is
+copying packets. When copying is done, the cost is usually mitigated by using
+a combined copy/checksum routine. Copying also preloads the cache, which is
 most useful with small frames.
 
 Since the VIA chips are only able to transfer data to buffers on 32 bit
 boundaries, the IP header at offset 14 in an ethernet frame isn't
-longword aligned for further processing.  Copying these unaligned buffers
+longword aligned for further processing. Copying these unaligned buffers
 has the beneficial effect of 16-byte aligning the IP header.
 
 IIId. Synchronization
 
-The driver runs as two independent, single-threaded flows of control.  One
+The driver runs as two independent, single-threaded flows of control. One
 is the send-packet routine, which enforces single-threaded use by the
 dev->priv->lock spinlock. The other thread is the interrupt handler, which
 is single threaded by the hardware and interrupt handling software.
@@ -324,7 +322,7 @@ dev->priv->lock whenever it's queuing a Tx packet. If the next slot in the ring
 is not available it stops the transmit queue by calling netif_stop_queue.
 
 The interrupt handler has exclusive control over the Rx ring and records stats
-from the Tx ring.  After reaping the stats, it marks the Tx queue entry as
+from the Tx ring. After reaping the stats, it marks the Tx queue entry as
 empty by incrementing the dirty_tx mark. If at least half of the entries in
 the Rx ring are available the transmit queue is woken up if it was stopped.
 
@@ -350,7 +348,7 @@ The chip does not pad to minimum transmit length.
 */
 
 
-/* This table drives the PCI probe routines.  It's mostly boilerplate in all
+/* This table drives the PCI probe routines. It's mostly boilerplate in all
    of the drivers, and will likely be provided by some future kernel.
    Note the matching code -- the first table entry matchs all 56** cards but
    second only the 1234 card.
@@ -361,14 +359,14 @@ enum pci_flags_bit {
 	PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3,
 };
 
-enum via_rhine_chips {
+enum rhine_chips {
 	VT86C100A = 0,
 	VT6102,
 	VT6105,
 	VT6105M
 };
 
-struct via_rhine_chip_info {
+struct rhine_chip_info {
 	const char *name;
 	u16 pci_flags;
 	int io_size;
@@ -378,9 +376,10 @@ struct via_rhine_chip_info {
 
 enum chip_capability_flags {
 	CanHaveMII=1, HasESIPhy=2, HasDavicomPhy=4,
-	ReqTxAlign=0x10, HasWOL=0x20, };
+	ReqTxAlign=0x10, HasWOL=0x20,
+};
 
-#ifdef USE_MEM
+#ifdef USE_MMIO
 #define RHINE_IOTYPE (PCI_USES_MEM | PCI_USES_MASTER | PCI_ADDR1)
 #else
 #define RHINE_IOTYPE (PCI_USES_IO  | PCI_USES_MASTER | PCI_ADDR0)
@@ -388,8 +387,8 @@ enum chip_capability_flags {
 /* Beware of PCI posted writes */
 #define IOSYNC	do { readb(dev->base_addr + StationAddr); } while (0)
 
-/* directly indexed by enum via_rhine_chips, above */
-static struct via_rhine_chip_info via_rhine_chip_info[] __devinitdata =
+/* directly indexed by enum rhine_chips, above */
+static struct rhine_chip_info rhine_chip_info[] __devinitdata =
 {
 	{ "VIA VT86C100A Rhine", RHINE_IOTYPE, 128,
 	  CanHaveMII | ReqTxAlign | HasDavicomPhy },
@@ -401,15 +400,15 @@ static struct via_rhine_chip_info via_rhine_chip_info[] __devinitdata =
 	  CanHaveMII | HasWOL },
 };
 
-static struct pci_device_id via_rhine_pci_tbl[] =
+static struct pci_device_id rhine_pci_tbl[] =
 {
 	{0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A},
 	{0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6102},
 	{0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105}, /* 6105{,L,LOM} */
 	{0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105M},
-	{0,}			/* terminate list */
+	{0,}	/* terminate list */
 };
-MODULE_DEVICE_TABLE(pci, via_rhine_pci_tbl);
+MODULE_DEVICE_TABLE(pci, rhine_pci_tbl);
 
 
 /* Offsets to the device registers. */
@@ -432,7 +431,7 @@ enum backoff_bits {
 	BackCaptureEffect=0x04, BackRandom=0x08
 };
 
-#ifdef USE_MEM
+#ifdef USE_MMIO
 /* Registers we check that mmio and reg are the same. */
 int mmio_verify_registers[] = {
 	RxConfig, TxConfig, IntrEnable, ConfigA, ConfigB, ConfigC, ConfigD,
@@ -469,7 +468,7 @@ struct tx_desc {
 };
 
 /* Initial value for tx_desc.desc_length, Buffer size goes to bits 0-10 */
-#define TXDESC 0x00e08000
+#define TXDESC		0x00e08000
 
 enum rx_status_bits {
 	RxOK=0x8000, RxWholePkt=0x0300, RxErr=0x008F
@@ -489,7 +488,7 @@ enum chip_cmd_bits {
 };
 
 #define MAX_MII_CNT	4
-struct netdev_private {
+struct rhine_private {
 	/* Descriptor rings */
 	struct rx_desc *rx_ring;
 	struct tx_desc *tx_ring;
@@ -517,48 +516,48 @@ struct netdev_private {
 	/* Frequently used values: keep some adjacent for cache effect. */
 	int chip_id, drv_flags;
 	struct rx_desc *rx_head_desc;
-	unsigned int cur_rx, dirty_rx;		/* Producer/consumer ring indices */
+	unsigned int cur_rx, dirty_rx;	/* Producer/consumer ring indices */
 	unsigned int cur_tx, dirty_tx;
-	unsigned int rx_buf_sz;				/* Based on MTU+slack. */
-	u16 chip_cmd;						/* Current setting for ChipCmd */
+	unsigned int rx_buf_sz;		/* Based on MTU+slack. */
+	u16 chip_cmd;			/* Current setting for ChipCmd */
 
 	/* These values are keep track of the transceiver/media in use. */
-	unsigned int default_port:4;		/* Last dev->if_port value. */
+	unsigned int default_port:4;	/* Last dev->if_port value. */
 	u8 tx_thresh, rx_thresh;
 
 	/* MII transceiver section. */
-	unsigned char phys[MAX_MII_CNT];			/* MII device addresses. */
-	unsigned int mii_cnt;			/* number of MIIs found, but only the first one is used */
-	u16 mii_status;						/* last read MII status */
+	unsigned char phys[MAX_MII_CNT];	/* MII device addresses. */
+	unsigned int mii_cnt;		/* number of MIIs found, but only the first one is used */
+	u16 mii_status;			/* last read MII status */
 	struct mii_if_info mii_if;
 };
 
 static int  mdio_read(struct net_device *dev, int phy_id, int location);
 static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
-static int  via_rhine_open(struct net_device *dev);
-static void via_rhine_check_duplex(struct net_device *dev);
-static void via_rhine_timer(unsigned long data);
-static void via_rhine_tx_timeout(struct net_device *dev);
-static int  via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
-static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-static void via_rhine_tx(struct net_device *dev);
-static void via_rhine_rx(struct net_device *dev);
-static void via_rhine_error(struct net_device *dev, int intr_status);
-static void via_rhine_set_rx_mode(struct net_device *dev);
-static struct net_device_stats *via_rhine_get_stats(struct net_device *dev);
+static int  rhine_open(struct net_device *dev);
+static void rhine_check_duplex(struct net_device *dev);
+static void rhine_timer(unsigned long data);
+static void rhine_tx_timeout(struct net_device *dev);
+static int  rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
+static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static void rhine_tx(struct net_device *dev);
+static void rhine_rx(struct net_device *dev);
+static void rhine_error(struct net_device *dev, int intr_status);
+static void rhine_set_rx_mode(struct net_device *dev);
+static struct net_device_stats *rhine_get_stats(struct net_device *dev);
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static struct ethtool_ops netdev_ethtool_ops;
-static int  via_rhine_close(struct net_device *dev);
+static int  rhine_close(struct net_device *dev);
 
 static inline u32 get_intr_status(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	u32 intr_status;
 
 	intr_status = readw(ioaddr + IntrStatus);
 	/* On Rhine-II, Bit 3 indicates Tx descriptor write-back race. */
-	if (np->chip_id == VT6102)
+	if (rp->chip_id == VT6102)
 		intr_status |= readb(ioaddr + IntrStatus2) << 16;
 	return intr_status;
 }
@@ -590,7 +589,7 @@ static void wait_for_reset(struct net_device *dev, int chip_id, char *name)
 			boguscnt ? "succeeded" : "failed");
 }
 
-#ifdef USE_MEM
+#ifdef USE_MMIO
 static void __devinit enable_mmio(long ioaddr, int chip_id)
 {
 	int n;
@@ -616,19 +615,19 @@ static void __devinit reload_eeprom(long ioaddr)
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
-static void via_rhine_poll(struct net_device *dev)
+static void rhine_poll(struct net_device *dev)
 {
 	disable_irq(dev->irq);
-	via_rhine_interrupt(dev->irq, (void *)dev, NULL);
+	rhine_interrupt(dev->irq, (void *)dev, NULL);
 	enable_irq(dev->irq);
 }
 #endif
 
-static int __devinit via_rhine_init_one (struct pci_dev *pdev,
-					 const struct pci_device_id *ent)
+static int __devinit rhine_init_one(struct pci_dev *pdev,
+				    const struct pci_device_id *ent)
 {
 	struct net_device *dev;
-	struct netdev_private *np;
+	struct rhine_private *rp;
 	int i, option;
 	int chip_id = (int) ent->driver_data;
 	static int card_idx = -1;
@@ -636,7 +635,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 	long memaddr;
 	int io_size;
 	int pci_flags;
-#ifdef USE_MEM
+#ifdef USE_MMIO
 	long ioaddr0;
 #endif
 
@@ -649,34 +648,36 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 
 	card_idx++;
 	option = card_idx < MAX_UNITS ? options[card_idx] : 0;
-	io_size = via_rhine_chip_info[chip_id].io_size;
-	pci_flags = via_rhine_chip_info[chip_id].pci_flags;
+	io_size = rhine_chip_info[chip_id].io_size;
+	pci_flags = rhine_chip_info[chip_id].pci_flags;
 
-	if (pci_enable_device (pdev))
+	if (pci_enable_device(pdev))
 		goto err_out;
 
 	/* this should always be supported */
 	if (pci_set_dma_mask(pdev, 0xffffffff)) {
-		printk(KERN_ERR "32-bit PCI DMA addresses not supported by the card!?\n");
+		printk(KERN_ERR "32-bit PCI DMA addresses not supported by "
+		       "the card!?\n");
 		goto err_out;
 	}
 
 	/* sanity check */
-	if ((pci_resource_len (pdev, 0) < io_size) ||
-	    (pci_resource_len (pdev, 1) < io_size)) {
-		printk (KERN_ERR "Insufficient PCI resources, aborting\n");
+	if ((pci_resource_len(pdev, 0) < io_size) ||
+	    (pci_resource_len(pdev, 1) < io_size)) {
+		printk(KERN_ERR "Insufficient PCI resources, aborting\n");
 		goto err_out;
 	}
 
-	ioaddr = pci_resource_start (pdev, 0);
-	memaddr = pci_resource_start (pdev, 1);
+	ioaddr = pci_resource_start(pdev, 0);
+	memaddr = pci_resource_start(pdev, 1);
 
 	if (pci_flags & PCI_USES_MASTER)
-		pci_set_master (pdev);
+		pci_set_master(pdev);
 
-	dev = alloc_etherdev(sizeof(*np));
+	dev = alloc_etherdev(sizeof(*rp));
 	if (dev == NULL) {
-		printk (KERN_ERR "init_ethernet failed for card #%d\n", card_idx);
+		printk(KERN_ERR "init_ethernet failed for card #%d\n",
+		       card_idx);
 		goto err_out;
 	}
 	SET_MODULE_OWNER(dev);
@@ -685,14 +686,14 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 	if (pci_request_regions(pdev, shortname))
 		goto err_out_free_netdev;
 
-#ifdef USE_MEM
+#ifdef USE_MMIO
 	ioaddr0 = ioaddr;
 	enable_mmio(ioaddr0, chip_id);
 
-	ioaddr = (long) ioremap (memaddr, io_size);
+	ioaddr = (long) ioremap(memaddr, io_size);
 	if (!ioaddr) {
-		printk (KERN_ERR "ioremap failed for device %s, region 0x%X @ 0x%lX\n",
-				pci_name(pdev), io_size, memaddr);
+		printk(KERN_ERR "ioremap failed for device %s, region 0x%X "
+		       "@ 0x%lX\n", pci_name(pdev), io_size, memaddr);
 		goto err_out_free_res;
 	}
 
@@ -703,15 +704,15 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 		unsigned char a = inb(ioaddr0+reg);
 		unsigned char b = readb(ioaddr+reg);
 		if (a != b) {
-			printk (KERN_ERR "MMIO do not match PIO [%02x] (%02x != %02x)\n",
-					reg, a, b);
+			printk(KERN_ERR "MMIO do not match PIO [%02x] "
+			       "(%02x != %02x)\n", reg, a, b);
 			goto err_out_unmap;
 		}
 	}
-#endif
+#endif /* USE_MMIO */
 
 	/* D-Link provided reset code (with comment additions) */
-	if (via_rhine_chip_info[chip_id].drv_flags & HasWOL) {
+	if (rhine_chip_info[chip_id].drv_flags & HasWOL) {
 		unsigned char byOrgValue;
 
 		/* clear sticky bit before reset & read ethernet address */
@@ -735,14 +736,14 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 	wait_for_reset(dev, chip_id, shortname);
 
 	/* Reload the station address from the EEPROM. */
-#ifdef USE_IO
-	reload_eeprom(ioaddr);
-#else
+#ifdef USE_MMIO
 	reload_eeprom(ioaddr0);
 	/* Reloading from eeprom overwrites cfgA-D, so we must re-enable MMIO.
 	   If reload_eeprom() was done first this could be avoided, but it is
 	   not known if that still works with the "win98-reboot" problem. */
 	enable_mmio(ioaddr0, chip_id);
+#else
+	reload_eeprom(ioaddr);
 #endif
 
 	for (i = 0; i < 6; i++)
@@ -756,7 +757,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 	if (chip_id == VT6102) {
 		/*
 		 * for 3065D, EEPROM reloaded will cause bit 0 in MAC_REG_CFGA
-		 * turned on.  it makes MAC receive magic packet
+		 * turned on. it makes MAC receive magic packet
 		 * automatically. So, we turn it off. (D-Link)
 		 */
 		writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA);
@@ -765,38 +766,38 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 	/* Select backoff algorithm */
 	if (backoff)
 		writeb(readb(ioaddr + ConfigD) & (0xF0 | backoff),
-			ioaddr + ConfigD);
+		       ioaddr + ConfigD);
 
 	dev->irq = pdev->irq;
 
-	np = dev->priv;
-	spin_lock_init (&np->lock);
-	np->chip_id = chip_id;
-	np->drv_flags = via_rhine_chip_info[chip_id].drv_flags;
-	np->pdev = pdev;
-	np->mii_if.dev = dev;
-	np->mii_if.mdio_read = mdio_read;
-	np->mii_if.mdio_write = mdio_write;
-	np->mii_if.phy_id_mask = 0x1f;
-	np->mii_if.reg_num_mask = 0x1f;
+	rp = netdev_priv(dev);
+	spin_lock_init(&rp->lock);
+	rp->chip_id = chip_id;
+	rp->drv_flags = rhine_chip_info[chip_id].drv_flags;
+	rp->pdev = pdev;
+	rp->mii_if.dev = dev;
+	rp->mii_if.mdio_read = mdio_read;
+	rp->mii_if.mdio_write = mdio_write;
+	rp->mii_if.phy_id_mask = 0x1f;
+	rp->mii_if.reg_num_mask = 0x1f;
 
 	if (dev->mem_start)
 		option = dev->mem_start;
 
 	/* The chip-specific entries in the device structure. */
-	dev->open = via_rhine_open;
-	dev->hard_start_xmit = via_rhine_start_tx;
-	dev->stop = via_rhine_close;
-	dev->get_stats = via_rhine_get_stats;
-	dev->set_multicast_list = via_rhine_set_rx_mode;
+	dev->open = rhine_open;
+	dev->hard_start_xmit = rhine_start_tx;
+	dev->stop = rhine_close;
+	dev->get_stats = rhine_get_stats;
+	dev->set_multicast_list = rhine_set_rx_mode;
 	dev->do_ioctl = netdev_ioctl;
 	dev->ethtool_ops = &netdev_ethtool_ops;
-	dev->tx_timeout = via_rhine_tx_timeout;
+	dev->tx_timeout = rhine_tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	dev->poll_controller = via_rhine_poll;
+	dev->poll_controller = rhine_poll;
 #endif
-	if (np->drv_flags & ReqTxAlign)
+	if (rp->drv_flags & ReqTxAlign)
 		dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
 
 	/* dev->name not defined before register_netdev()! */
@@ -807,40 +808,41 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 	/* The lower four bits are the media type. */
 	if (option > 0) {
 		if (option & 0x220)
-			np->mii_if.full_duplex = 1;
-		np->default_port = option & 15;
+			rp->mii_if.full_duplex = 1;
+		rp->default_port = option & 15;
 	}
-	if (card_idx < MAX_UNITS  &&  full_duplex[card_idx] > 0)
-		np->mii_if.full_duplex = 1;
+	if (card_idx < MAX_UNITS && full_duplex[card_idx] > 0)
+		rp->mii_if.full_duplex = 1;
 
-	if (np->mii_if.full_duplex) {
-		printk(KERN_INFO "%s: Set to forced full duplex, autonegotiation"
-			   " disabled.\n", dev->name);
-		np->mii_if.force_media = 1;
+	if (rp->mii_if.full_duplex) {
+		printk(KERN_INFO "%s: Set to forced full duplex, "
+		       "autonegotiation disabled.\n", dev->name);
+		rp->mii_if.force_media = 1;
 	}
 
 	printk(KERN_INFO "%s: %s at 0x%lx, ",
-		   dev->name, via_rhine_chip_info[chip_id].name,
-		   (pci_flags & PCI_USES_IO) ? ioaddr : memaddr);
+	       dev->name, rhine_chip_info[chip_id].name,
+	       (pci_flags & PCI_USES_IO) ? ioaddr : memaddr);
 
 	for (i = 0; i < 5; i++)
-			printk("%2.2x:", dev->dev_addr[i]);
+		printk("%2.2x:", dev->dev_addr[i]);
 	printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], pdev->irq);
 
 	pci_set_drvdata(pdev, dev);
 
-	if (np->drv_flags & CanHaveMII) {
+	if (rp->drv_flags & CanHaveMII) {
 		int phy, phy_idx = 0;
-		np->phys[0] = 1;		/* Standard for this chip. */
+		rp->phys[0] = 1;		/* Standard for this chip. */
 		for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) {
 			int mii_status = mdio_read(dev, phy, 1);
-			if (mii_status != 0xffff  &&  mii_status != 0x0000) {
-				np->phys[phy_idx++] = phy;
-				np->mii_if.advertising = mdio_read(dev, phy, 4);
-				printk(KERN_INFO "%s: MII PHY found at address %d, status "
-					   "0x%4.4x advertising %4.4x Link %4.4x.\n",
-					   dev->name, phy, mii_status, np->mii_if.advertising,
-					   mdio_read(dev, phy, 5));
+			if (mii_status != 0xffff && mii_status != 0x0000) {
+				rp->phys[phy_idx++] = phy;
+				rp->mii_if.advertising = mdio_read(dev, phy, 4);
+				printk(KERN_INFO "%s: MII PHY found at address "
+				       "%d, status 0x%4.4x advertising %4.4x "
+				       "Link %4.4x.\n", dev->name, phy,
+				       mii_status, rp->mii_if.advertising,
+				       mdio_read(dev, phy, 5));
 
 				/* set IFF_RUNNING */
 				if (mii_status & BMSR_LSTATUS)
@@ -851,49 +853,50 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
 				break;
 			}
 		}
-		np->mii_cnt = phy_idx;
-		np->mii_if.phy_id = np->phys[0];
+		rp->mii_cnt = phy_idx;
+		rp->mii_if.phy_id = rp->phys[0];
 	}
 
 	/* Allow forcing the media type. */
 	if (option > 0) {
 		if (option & 0x220)
-			np->mii_if.full_duplex = 1;
-		np->default_port = option & 0x3ff;
-		if (np->default_port & 0x330) {
+			rp->mii_if.full_duplex = 1;
+		rp->default_port = option & 0x3ff;
+		if (option & 0x330) {
 			/* FIXME: shouldn't someone check this variable? */
-			/* np->medialock = 1; */
-			printk(KERN_INFO "  Forcing %dMbs %s-duplex operation.\n",
-				   (option & 0x300 ? 100 : 10),
-				   (option & 0x220 ? "full" : "half"));
-			if (np->mii_cnt)
-				mdio_write(dev, np->phys[0], MII_BMCR,
-						   ((option & 0x300) ? 0x2000 : 0) |  /* 100mbps? */
-						   ((option & 0x220) ? 0x0100 : 0));  /* Full duplex? */
+			/* rp->medialock = 1; */
+			printk(KERN_INFO " Forcing %dMbs %s-duplex "
+				"operation.\n",
+			       (option & 0x300 ? 100 : 10),
+			       (option & 0x220 ? "full" : "half"));
+			if (rp->mii_cnt)
+				mdio_write(dev, rp->phys[0], MII_BMCR,
+					   ((option & 0x300) ? 0x2000 : 0) | /* 100mbps? */
+					   ((option & 0x220) ? 0x0100 : 0)); /* Full duplex? */
 		}
 	}
 
 	return 0;
 
 err_out_unmap:
-#ifdef USE_MEM
+#ifdef USE_MMIO
 	iounmap((void *)ioaddr);
 err_out_free_res:
 #endif
 	pci_release_regions(pdev);
 err_out_free_netdev:
-	free_netdev (dev);
+	free_netdev(dev);
 err_out:
 	return -ENODEV;
 }
 
 static int alloc_ring(struct net_device* dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	void *ring;
 	dma_addr_t ring_dma;
 
-	ring = pci_alloc_consistent(np->pdev,
+	ring = pci_alloc_consistent(rp->pdev,
 				    RX_RING_SIZE * sizeof(struct rx_desc) +
 				    TX_RING_SIZE * sizeof(struct tx_desc),
 				    &ring_dma);
@@ -901,11 +904,12 @@ static int alloc_ring(struct net_device* dev)
 		printk(KERN_ERR "Could not allocate DMA memory.\n");
 		return -ENOMEM;
 	}
-	if (np->drv_flags & ReqTxAlign) {
-		np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
-								   &np->tx_bufs_dma);
-		if (np->tx_bufs == NULL) {
-			pci_free_consistent(np->pdev,
+	if (rp->drv_flags & ReqTxAlign) {
+		rp->tx_bufs = pci_alloc_consistent(rp->pdev,
+						   PKT_BUF_SZ * TX_RING_SIZE,
+						   &rp->tx_bufs_dma);
+		if (rp->tx_bufs == NULL) {
+			pci_free_consistent(rp->pdev,
 				    RX_RING_SIZE * sizeof(struct rx_desc) +
 				    TX_RING_SIZE * sizeof(struct tx_desc),
 				    ring, ring_dma);
@@ -913,137 +917,138 @@ static int alloc_ring(struct net_device* dev)
 		}
 	}
 
-	np->rx_ring = ring;
-	np->tx_ring = ring + RX_RING_SIZE * sizeof(struct rx_desc);
-	np->rx_ring_dma = ring_dma;
-	np->tx_ring_dma = ring_dma + RX_RING_SIZE * sizeof(struct rx_desc);
+	rp->rx_ring = ring;
+	rp->tx_ring = ring + RX_RING_SIZE * sizeof(struct rx_desc);
+	rp->rx_ring_dma = ring_dma;
+	rp->tx_ring_dma = ring_dma + RX_RING_SIZE * sizeof(struct rx_desc);
 
 	return 0;
 }
 
 void free_ring(struct net_device* dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 
-	pci_free_consistent(np->pdev,
+	pci_free_consistent(rp->pdev,
 			    RX_RING_SIZE * sizeof(struct rx_desc) +
 			    TX_RING_SIZE * sizeof(struct tx_desc),
-			    np->rx_ring, np->rx_ring_dma);
-	np->tx_ring = NULL;
+			    rp->rx_ring, rp->rx_ring_dma);
+	rp->tx_ring = NULL;
 
-	if (np->tx_bufs)
-		pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
-							np->tx_bufs, np->tx_bufs_dma);
+	if (rp->tx_bufs)
+		pci_free_consistent(rp->pdev, PKT_BUF_SZ * TX_RING_SIZE,
+				    rp->tx_bufs, rp->tx_bufs_dma);
 
-	np->tx_bufs = NULL;
+	rp->tx_bufs = NULL;
 
 }
 
 static void alloc_rbufs(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	dma_addr_t next;
 	int i;
 
-	np->dirty_rx = np->cur_rx = 0;
+	rp->dirty_rx = rp->cur_rx = 0;
 
-	np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
-	np->rx_head_desc = &np->rx_ring[0];
-	next = np->rx_ring_dma;
+	rp->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
+	rp->rx_head_desc = &rp->rx_ring[0];
+	next = rp->rx_ring_dma;
 
 	/* Init the ring entries */
 	for (i = 0; i < RX_RING_SIZE; i++) {
-		np->rx_ring[i].rx_status = 0;
-		np->rx_ring[i].desc_length = cpu_to_le32(np->rx_buf_sz);
+		rp->rx_ring[i].rx_status = 0;
+		rp->rx_ring[i].desc_length = cpu_to_le32(rp->rx_buf_sz);
 		next += sizeof(struct rx_desc);
-		np->rx_ring[i].next_desc = cpu_to_le32(next);
-		np->rx_skbuff[i] = 0;
+		rp->rx_ring[i].next_desc = cpu_to_le32(next);
+		rp->rx_skbuff[i] = 0;
 	}
 	/* Mark the last entry as wrapping the ring. */
-	np->rx_ring[i-1].next_desc = cpu_to_le32(np->rx_ring_dma);
+	rp->rx_ring[i-1].next_desc = cpu_to_le32(rp->rx_ring_dma);
 
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
-		struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
-		np->rx_skbuff[i] = skb;
+		struct sk_buff *skb = dev_alloc_skb(rp->rx_buf_sz);
+		rp->rx_skbuff[i] = skb;
 		if (skb == NULL)
 			break;
 		skb->dev = dev;                 /* Mark as being used by this device. */
 
-		np->rx_skbuff_dma[i] =
-			pci_map_single(np->pdev, skb->tail, np->rx_buf_sz,
-						   PCI_DMA_FROMDEVICE);
+		rp->rx_skbuff_dma[i] =
+			pci_map_single(rp->pdev, skb->tail, rp->rx_buf_sz,
+				       PCI_DMA_FROMDEVICE);
 
-		np->rx_ring[i].addr = cpu_to_le32(np->rx_skbuff_dma[i]);
-		np->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
+		rp->rx_ring[i].addr = cpu_to_le32(rp->rx_skbuff_dma[i]);
+		rp->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
 	}
-	np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
+	rp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
 }
 
 static void free_rbufs(struct net_device* dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	int i;
 
 	/* Free all the skbuffs in the Rx queue. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
-		np->rx_ring[i].rx_status = 0;
-		np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
-		if (np->rx_skbuff[i]) {
-			pci_unmap_single(np->pdev,
-							 np->rx_skbuff_dma[i],
-							 np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-			dev_kfree_skb(np->rx_skbuff[i]);
+		rp->rx_ring[i].rx_status = 0;
+		rp->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
+		if (rp->rx_skbuff[i]) {
+			pci_unmap_single(rp->pdev,
+					 rp->rx_skbuff_dma[i],
+					 rp->rx_buf_sz, PCI_DMA_FROMDEVICE);
+			dev_kfree_skb(rp->rx_skbuff[i]);
 		}
-		np->rx_skbuff[i] = 0;
+		rp->rx_skbuff[i] = 0;
 	}
 }
 
 static void alloc_tbufs(struct net_device* dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	dma_addr_t next;
 	int i;
 
-	np->dirty_tx = np->cur_tx = 0;
-	next = np->tx_ring_dma;
+	rp->dirty_tx = rp->cur_tx = 0;
+	next = rp->tx_ring_dma;
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_skbuff[i] = 0;
-		np->tx_ring[i].tx_status = 0;
-		np->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
+		rp->tx_skbuff[i] = 0;
+		rp->tx_ring[i].tx_status = 0;
+		rp->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
 		next += sizeof(struct tx_desc);
-		np->tx_ring[i].next_desc = cpu_to_le32(next);
-		np->tx_buf[i] = &np->tx_bufs[i * PKT_BUF_SZ];
+		rp->tx_ring[i].next_desc = cpu_to_le32(next);
+		rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];
 	}
-	np->tx_ring[i-1].next_desc = cpu_to_le32(np->tx_ring_dma);
+	rp->tx_ring[i-1].next_desc = cpu_to_le32(rp->tx_ring_dma);
 
 }
 
 static void free_tbufs(struct net_device* dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	int i;
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_ring[i].tx_status = 0;
-		np->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
-		np->tx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
-		if (np->tx_skbuff[i]) {
-			if (np->tx_skbuff_dma[i]) {
-				pci_unmap_single(np->pdev,
-								 np->tx_skbuff_dma[i],
-								 np->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
+		rp->tx_ring[i].tx_status = 0;
+		rp->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
+		rp->tx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
+		if (rp->tx_skbuff[i]) {
+			if (rp->tx_skbuff_dma[i]) {
+				pci_unmap_single(rp->pdev,
+						 rp->tx_skbuff_dma[i],
+						 rp->tx_skbuff[i]->len,
+						 PCI_DMA_TODEVICE);
 			}
-			dev_kfree_skb(np->tx_skbuff[i]);
+			dev_kfree_skb(rp->tx_skbuff[i]);
 		}
-		np->tx_skbuff[i] = 0;
-		np->tx_buf[i] = 0;
+		rp->tx_skbuff[i] = 0;
+		rp->tx_buf[i] = 0;
 	}
 }
 
 static void init_registers(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int i;
 
@@ -1054,38 +1059,39 @@ static void init_registers(struct net_device *dev)
 	writew(0x0006, ioaddr + PCIBusConfig);	/* Tune configuration??? */
 	/* Configure initial FIFO thresholds. */
 	writeb(0x20, ioaddr + TxConfig);
-	np->tx_thresh = 0x20;
-	np->rx_thresh = 0x60;			/* Written in via_rhine_set_rx_mode(). */
-	np->mii_if.full_duplex = 0;
+	rp->tx_thresh = 0x20;
+	rp->rx_thresh = 0x60;		/* Written in rhine_set_rx_mode(). */
+	rp->mii_if.full_duplex = 0;
 
 	if (dev->if_port == 0)
-		dev->if_port = np->default_port;
+		dev->if_port = rp->default_port;
 
-	writel(np->rx_ring_dma, ioaddr + RxRingPtr);
-	writel(np->tx_ring_dma, ioaddr + TxRingPtr);
+	writel(rp->rx_ring_dma, ioaddr + RxRingPtr);
+	writel(rp->tx_ring_dma, ioaddr + TxRingPtr);
 
-	via_rhine_set_rx_mode(dev);
+	rhine_set_rx_mode(dev);
 
 	/* Enable interrupts by setting the interrupt mask. */
 	writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
-		   IntrRxDropped | IntrRxNoBuf | IntrTxAborted |
-		   IntrTxDone | IntrTxError | IntrTxUnderrun |
-		   IntrPCIErr | IntrStatsMax | IntrLinkChange,
-		   ioaddr + IntrEnable);
+	       IntrRxDropped | IntrRxNoBuf | IntrTxAborted |
+	       IntrTxDone | IntrTxError | IntrTxUnderrun |
+	       IntrPCIErr | IntrStatsMax | IntrLinkChange,
+	       ioaddr + IntrEnable);
 
-	np->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll;
-	if (np->mii_if.force_media)
-		np->chip_cmd |= CmdFDuplex;
-	writew(np->chip_cmd, ioaddr + ChipCmd);
+	rp->chip_cmd = CmdStart|CmdTxOn|CmdRxOn|CmdNoTxPoll;
+	if (rp->mii_if.force_media)
+		rp->chip_cmd |= CmdFDuplex;
+	writew(rp->chip_cmd, ioaddr + ChipCmd);
 
-	via_rhine_check_duplex(dev);
+	rhine_check_duplex(dev);
 
-	/* The LED outputs of various MII xcvrs should be configured.  */
+	/* The LED outputs of various MII xcvrs should be configured. */
 	/* For NS or Mison phys, turn on bit 1 in register 0x17 */
 	/* For ESI phys, turn on bit 7 in register 0x17. */
-	mdio_write(dev, np->phys[0], 0x17, mdio_read(dev, np->phys[0], 0x17) |
-			   (np->drv_flags & HasESIPhy) ? 0x0080 : 0x0001);
+	mdio_write(dev, rp->phys[0], 0x17, mdio_read(dev, rp->phys[0], 0x17) |
+		   (rp->drv_flags & HasESIPhy) ? 0x0080 : 0x0001);
 }
+
 /* Read and write over the MII Management Data I/O (MDIO) interface. */
 
 static int mdio_read(struct net_device *dev, int phy_id, int regnum)
@@ -1099,7 +1105,7 @@ static int mdio_read(struct net_device *dev, int phy_id, int regnum)
 	writeb(0x00, ioaddr + MIICmd);
 	writeb(phy_id, ioaddr + MIIPhyAddr);
 	writeb(regnum, ioaddr + MIIRegAddr);
-	writeb(0x40, ioaddr + MIICmd);			/* Trigger read */
+	writeb(0x40, ioaddr + MIICmd);		/* Trigger read */
 	boguscnt = 1024;
 	while ((readb(ioaddr + MIICmd) & 0x40) && --boguscnt > 0)
 		;
@@ -1108,20 +1114,20 @@ static int mdio_read(struct net_device *dev, int phy_id, int regnum)
 
 static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int boguscnt = 1024;
 
-	if (phy_id == np->phys[0]) {
+	if (phy_id == rp->phys[0]) {
 		switch (regnum) {
-		case MII_BMCR:					/* Is user forcing speed/duplex? */
-			if (value & 0x9000)			/* Autonegotiation. */
-				np->mii_if.force_media = 0;
+		case MII_BMCR:		/* Is user forcing speed/duplex? */
+			if (value & 0x9000)	/* Autonegotiation. */
+				rp->mii_if.force_media = 0;
 			else
-				np->mii_if.full_duplex = (value & 0x0100) ? 1 : 0;
+				rp->mii_if.full_duplex = (value & 0x0100) ? 1 : 0;
 			break;
 		case MII_ADVERTISE:
-			np->mii_if.advertising = value;
+			rp->mii_if.advertising = value;
 			break;
 		}
 	}
@@ -1133,128 +1139,130 @@ static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value
 	writeb(phy_id, ioaddr + MIIPhyAddr);
 	writeb(regnum, ioaddr + MIIRegAddr);
 	writew(value, ioaddr + MIIData);
-	writeb(0x20, ioaddr + MIICmd);			/* Trigger write. */
+	writeb(0x20, ioaddr + MIICmd);		/* Trigger write. */
 }
 
 
-static int via_rhine_open(struct net_device *dev)
+static int rhine_open(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int i;
 
 	/* Reset the chip. */
 	writew(CmdReset, ioaddr + ChipCmd);
 
-	i = request_irq(np->pdev->irq, &via_rhine_interrupt, SA_SHIRQ, dev->name, dev);
+	i = request_irq(rp->pdev->irq, &rhine_interrupt, SA_SHIRQ, dev->name,
+			dev);
 	if (i)
 		return i;
 
 	if (debug > 1)
-		printk(KERN_DEBUG "%s: via_rhine_open() irq %d.\n",
-			   dev->name, np->pdev->irq);
+		printk(KERN_DEBUG "%s: rhine_open() irq %d.\n",
+		       dev->name, rp->pdev->irq);
 
 	i = alloc_ring(dev);
 	if (i)
 		return i;
 	alloc_rbufs(dev);
 	alloc_tbufs(dev);
-	wait_for_reset(dev, np->chip_id, dev->name);
+	wait_for_reset(dev, rp->chip_id, dev->name);
 	init_registers(dev);
 	if (debug > 2)
-		printk(KERN_DEBUG "%s: Done via_rhine_open(), status %4.4x "
-			   "MII status: %4.4x.\n",
-			   dev->name, readw(ioaddr + ChipCmd),
-			   mdio_read(dev, np->phys[0], MII_BMSR));
+		printk(KERN_DEBUG "%s: Done rhine_open(), status %4.4x "
+		       "MII status: %4.4x.\n",
+		       dev->name, readw(ioaddr + ChipCmd),
+		       mdio_read(dev, rp->phys[0], MII_BMSR));
 
 	netif_start_queue(dev);
 
 	/* Set the timer to check for link beat. */
-	init_timer(&np->timer);
-	np->timer.expires = jiffies + 2 * HZ/100;
-	np->timer.data = (unsigned long)dev;
-	np->timer.function = &via_rhine_timer;				/* timer handler */
-	add_timer(&np->timer);
+	init_timer(&rp->timer);
+	rp->timer.expires = jiffies + 2 * HZ/100;
+	rp->timer.data = (unsigned long)dev;
+	rp->timer.function = &rhine_timer;		/* timer handler */
+	add_timer(&rp->timer);
 
 	return 0;
 }
 
-static void via_rhine_check_duplex(struct net_device *dev)
+static void rhine_check_duplex(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
-	int mii_lpa = mdio_read(dev, np->phys[0], MII_LPA);
-	int negotiated = mii_lpa & np->mii_if.advertising;
+	int mii_lpa = mdio_read(dev, rp->phys[0], MII_LPA);
+	int negotiated = mii_lpa & rp->mii_if.advertising;
 	int duplex;
 
-	if (np->mii_if.force_media  ||  mii_lpa == 0xffff)
+	if (rp->mii_if.force_media || mii_lpa == 0xffff)
 		return;
 	duplex = (negotiated & 0x0100) || (negotiated & 0x01C0) == 0x0040;
-	if (np->mii_if.full_duplex != duplex) {
-		np->mii_if.full_duplex = duplex;
+	if (rp->mii_if.full_duplex != duplex) {
+		rp->mii_if.full_duplex = duplex;
 		if (debug)
-			printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d link"
-				   " partner capability of %4.4x.\n", dev->name,
-				   duplex ? "full" : "half", np->phys[0], mii_lpa);
+			printk(KERN_INFO "%s: Setting %s-duplex based on "
+			       "MII #%d link partner capability of %4.4x.\n",
+			       dev->name, duplex ? "full" : "half",
+			       rp->phys[0], mii_lpa);
 		if (duplex)
-			np->chip_cmd |= CmdFDuplex;
+			rp->chip_cmd |= CmdFDuplex;
 		else
-			np->chip_cmd &= ~CmdFDuplex;
-		writew(np->chip_cmd, ioaddr + ChipCmd);
+			rp->chip_cmd &= ~CmdFDuplex;
+		writew(rp->chip_cmd, ioaddr + ChipCmd);
 	}
 }
 
 
-static void via_rhine_timer(unsigned long data)
+static void rhine_timer(unsigned long data)
 {
 	struct net_device *dev = (struct net_device *)data;
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int next_tick = 10*HZ;
 	int mii_status;
 
 	if (debug > 3) {
 		printk(KERN_DEBUG "%s: VIA Rhine monitor tick, status %4.4x.\n",
-			   dev->name, readw(ioaddr + IntrStatus));
+		       dev->name, readw(ioaddr + IntrStatus));
 	}
 
-	spin_lock_irq (&np->lock);
+	spin_lock_irq (&rp->lock);
 
-	via_rhine_check_duplex(dev);
+	rhine_check_duplex(dev);
 
 	/* make IFF_RUNNING follow the MII status bit "Link established" */
-	mii_status = mdio_read(dev, np->phys[0], MII_BMSR);
-	if ( (mii_status & BMSR_LSTATUS) != (np->mii_status & BMSR_LSTATUS) ) {
+	mii_status = mdio_read(dev, rp->phys[0], MII_BMSR);
+	if ((mii_status & BMSR_LSTATUS) != (rp->mii_status & BMSR_LSTATUS)) {
 		if (mii_status & BMSR_LSTATUS)
 			netif_carrier_on(dev);
 		else
 			netif_carrier_off(dev);
 	}
-	np->mii_status = mii_status;
+	rp->mii_status = mii_status;
 
-	spin_unlock_irq (&np->lock);
+	spin_unlock_irq(&rp->lock);
 
-	np->timer.expires = jiffies + next_tick;
-	add_timer(&np->timer);
+	rp->timer.expires = jiffies + next_tick;
+	add_timer(&rp->timer);
 }
 
 
-static void via_rhine_tx_timeout (struct net_device *dev)
+static void rhine_tx_timeout(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 
-	printk (KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
-		"%4.4x, resetting...\n",
-		dev->name, readw (ioaddr + IntrStatus),
-		mdio_read (dev, np->phys[0], MII_BMSR));
+	printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
+	       "%4.4x, resetting...\n",
+	       dev->name, readw(ioaddr + IntrStatus),
+	       mdio_read(dev, rp->phys[0], MII_BMSR));
 
 	dev->if_port = 0;
 
 	/* protect against concurrent rx interrupts */
-	disable_irq(np->pdev->irq);
+	disable_irq(rp->pdev->irq);
 
-	spin_lock(&np->lock);
+	spin_lock(&rp->lock);
 
 	/* Reset the chip. */
 	writew(CmdReset, ioaddr + ChipCmd);
@@ -1266,20 +1274,20 @@ static void via_rhine_tx_timeout (struct net_device *dev)
 	alloc_rbufs(dev);
 
 	/* Reinitialize the hardware. */
-	wait_for_reset(dev, np->chip_id, dev->name);
+	wait_for_reset(dev, rp->chip_id, dev->name);
 	init_registers(dev);
 
-	spin_unlock(&np->lock);
-	enable_irq(np->pdev->irq);
+	spin_unlock(&rp->lock);
+	enable_irq(rp->pdev->irq);
 
 	dev->trans_start = jiffies;
-	np->stats.tx_errors++;
+	rp->stats.tx_errors++;
 	netif_wake_queue(dev);
 }
 
-static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
+static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	unsigned entry;
 	u32 intr_status;
 
@@ -1287,7 +1295,7 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
 	   with the "ownership" bits last. */
 
 	/* Calculate the next Tx descriptor entry. */
-	entry = np->cur_tx % TX_RING_SIZE;
+	entry = rp->cur_tx % TX_RING_SIZE;
 
 	if (skb->len < ETH_ZLEN) {
 		skb = skb_padto(skb, ETH_ZLEN);
@@ -1295,39 +1303,40 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
 			return 0;
 	}
 
-	np->tx_skbuff[entry] = skb;
+	rp->tx_skbuff[entry] = skb;
 
-	if ((np->drv_flags & ReqTxAlign) &&
-		(((long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)
-		) {
+	if ((rp->drv_flags & ReqTxAlign) &&
+	    (((long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)) {
 		/* Must use alignment buffer. */
 		if (skb->len > PKT_BUF_SZ) {
 			/* packet too long, drop it */
 			dev_kfree_skb(skb);
-			np->tx_skbuff[entry] = NULL;
-			np->stats.tx_dropped++;
+			rp->tx_skbuff[entry] = NULL;
+			rp->stats.tx_dropped++;
 			return 0;
 		}
-		skb_copy_and_csum_dev(skb, np->tx_buf[entry]);
-		np->tx_skbuff_dma[entry] = 0;
-		np->tx_ring[entry].addr = cpu_to_le32(np->tx_bufs_dma +
-										  (np->tx_buf[entry] - np->tx_bufs));
+		skb_copy_and_csum_dev(skb, rp->tx_buf[entry]);
+		rp->tx_skbuff_dma[entry] = 0;
+		rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_bufs_dma +
+						      (rp->tx_buf[entry] -
+						       rp->tx_bufs));
 	} else {
-		np->tx_skbuff_dma[entry] =
-			pci_map_single(np->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
-		np->tx_ring[entry].addr = cpu_to_le32(np->tx_skbuff_dma[entry]);
+		rp->tx_skbuff_dma[entry] =
+			pci_map_single(rp->pdev, skb->data, skb->len,
+				       PCI_DMA_TODEVICE);
+		rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_skbuff_dma[entry]);
 	}
 
-	np->tx_ring[entry].desc_length =
+	rp->tx_ring[entry].desc_length =
 		cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
 
 	/* lock eth irq */
-	spin_lock_irq (&np->lock);
+	spin_lock_irq(&rp->lock);
 	wmb();
-	np->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
+	rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
 	wmb();
 
-	np->cur_tx++;
+	rp->cur_tx++;
 
 	/* Non-x86 Todo: explicitly flush cache lines here. */
 
@@ -1337,27 +1346,27 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
 	 */
 	intr_status = get_intr_status(dev);
 	if ((intr_status & IntrTxErrSummary) == 0) {
-		writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd);
+		writew(CmdTxDemand | rp->chip_cmd, dev->base_addr + ChipCmd);
 	}
 	IOSYNC;
 
-	if (np->cur_tx == np->dirty_tx + TX_QUEUE_LEN)
+	if (rp->cur_tx == rp->dirty_tx + TX_QUEUE_LEN)
 		netif_stop_queue(dev);
 
 	dev->trans_start = jiffies;
 
-	spin_unlock_irq (&np->lock);
+	spin_unlock_irq(&rp->lock);
 
 	if (debug > 4) {
 		printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d.\n",
-			   dev->name, np->cur_tx-1, entry);
+		       dev->name, rp->cur_tx-1, entry);
 	}
 	return 0;
 }
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
+static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
 	long ioaddr;
@@ -1378,11 +1387,11 @@ static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_re
 
 		if (debug > 4)
 			printk(KERN_DEBUG "%s: Interrupt, status %8.8x.\n",
-				   dev->name, intr_status);
+			       dev->name, intr_status);
 
 		if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped |
-						   IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf))
-			via_rhine_rx(dev);
+		    IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf))
+			rhine_rx(dev);
 
 		if (intr_status & (IntrTxErrSummary | IntrTxDone)) {
 			if (intr_status & IntrTxErrSummary) {
@@ -1391,140 +1400,147 @@ static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_re
 				while ((readw(ioaddr+ChipCmd) & CmdTxOn) && --cnt)
 					udelay(5);
 				if (debug > 2 && !cnt)
-					printk(KERN_WARNING "%s: via_rhine_interrupt() "
-						   "Tx engine still on.\n",
-						   dev->name);
+					printk(KERN_WARNING "%s: "
+					       "rhine_interrupt() Tx engine"
+					       "still on.\n", dev->name);
 			}
-			via_rhine_tx(dev);
+			rhine_tx(dev);
 		}
 
 		/* Abnormal error summary/uncommon events handlers. */
 		if (intr_status & (IntrPCIErr | IntrLinkChange |
 				   IntrStatsMax | IntrTxError | IntrTxAborted |
 				   IntrTxUnderrun | IntrTxDescRace))
-			via_rhine_error(dev, intr_status);
+			rhine_error(dev, intr_status);
 
 		if (--boguscnt < 0) {
 			printk(KERN_WARNING "%s: Too much work at interrupt, "
-				   "status=%#8.8x.\n",
-				   dev->name, intr_status);
+			       "status=%#8.8x.\n",
+			       dev->name, intr_status);
 			break;
 		}
 	}
 
 	if (debug > 3)
 		printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n",
-			   dev->name, readw(ioaddr + IntrStatus));
+		       dev->name, readw(ioaddr + IntrStatus));
 	return IRQ_RETVAL(handled);
 }
 
 /* This routine is logically part of the interrupt handler, but isolated
    for clarity. */
-static void via_rhine_tx(struct net_device *dev)
+static void rhine_tx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
-	int txstatus = 0, entry = np->dirty_tx % TX_RING_SIZE;
+	struct rhine_private *rp = netdev_priv(dev);
+	int txstatus = 0, entry = rp->dirty_tx % TX_RING_SIZE;
 
-	spin_lock (&np->lock);
+	spin_lock(&rp->lock);
 
 	/* find and cleanup dirty tx descriptors */
-	while (np->dirty_tx != np->cur_tx) {
-		txstatus = le32_to_cpu(np->tx_ring[entry].tx_status);
+	while (rp->dirty_tx != rp->cur_tx) {
+		txstatus = le32_to_cpu(rp->tx_ring[entry].tx_status);
 		if (debug > 6)
 			printk(KERN_DEBUG " Tx scavenge %d status %8.8x.\n",
-				   entry, txstatus);
+			       entry, txstatus);
 		if (txstatus & DescOwn)
 			break;
 		if (txstatus & 0x8000) {
 			if (debug > 1)
-				printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n",
-					   dev->name, txstatus);
-			np->stats.tx_errors++;
-			if (txstatus & 0x0400) np->stats.tx_carrier_errors++;
-			if (txstatus & 0x0200) np->stats.tx_window_errors++;
-			if (txstatus & 0x0100) np->stats.tx_aborted_errors++;
-			if (txstatus & 0x0080) np->stats.tx_heartbeat_errors++;
-			if (((np->chip_id == VT86C100A) && txstatus & 0x0002) ||
-				(txstatus & 0x0800) || (txstatus & 0x1000)) {
-				np->stats.tx_fifo_errors++;
-				np->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
+				printk(KERN_DEBUG "%s: Transmit error, "
+				       "Tx status %8.8x.\n",
+				       dev->name, txstatus);
+			rp->stats.tx_errors++;
+			if (txstatus & 0x0400) rp->stats.tx_carrier_errors++;
+			if (txstatus & 0x0200) rp->stats.tx_window_errors++;
+			if (txstatus & 0x0100) rp->stats.tx_aborted_errors++;
+			if (txstatus & 0x0080) rp->stats.tx_heartbeat_errors++;
+			if (((rp->chip_id == VT86C100A) && txstatus & 0x0002) ||
+			    (txstatus & 0x0800) || (txstatus & 0x1000)) {
+				rp->stats.tx_fifo_errors++;
+				rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
 				break; /* Keep the skb - we try again */
 			}
 			/* Transmitter restarted in 'abnormal' handler. */
 		} else {
-			if (np->chip_id == VT86C100A)
-				np->stats.collisions += (txstatus >> 3) & 0x0F;
+			if (rp->chip_id == VT86C100A)
+				rp->stats.collisions += (txstatus >> 3) & 0x0F;
 			else
-				np->stats.collisions += txstatus & 0x0F;
+				rp->stats.collisions += txstatus & 0x0F;
 			if (debug > 6)
 				printk(KERN_DEBUG "collisions: %1.1x:%1.1x\n",
-					(txstatus >> 3) & 0xF,
-					txstatus & 0xF);
-			np->stats.tx_bytes += np->tx_skbuff[entry]->len;
-			np->stats.tx_packets++;
+				       (txstatus >> 3) & 0xF,
+				       txstatus & 0xF);
+			rp->stats.tx_bytes += rp->tx_skbuff[entry]->len;
+			rp->stats.tx_packets++;
 		}
 		/* Free the original skb. */
-		if (np->tx_skbuff_dma[entry]) {
-			pci_unmap_single(np->pdev,
-							 np->tx_skbuff_dma[entry],
-							 np->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
+		if (rp->tx_skbuff_dma[entry]) {
+			pci_unmap_single(rp->pdev,
+					 rp->tx_skbuff_dma[entry],
+					 rp->tx_skbuff[entry]->len,
+					 PCI_DMA_TODEVICE);
 		}
-		dev_kfree_skb_irq(np->tx_skbuff[entry]);
-		np->tx_skbuff[entry] = NULL;
-		entry = (++np->dirty_tx) % TX_RING_SIZE;
+		dev_kfree_skb_irq(rp->tx_skbuff[entry]);
+		rp->tx_skbuff[entry] = NULL;
+		entry = (++rp->dirty_tx) % TX_RING_SIZE;
 	}
-	if ((np->cur_tx - np->dirty_tx) < TX_QUEUE_LEN - 4)
-		netif_wake_queue (dev);
+	if ((rp->cur_tx - rp->dirty_tx) < TX_QUEUE_LEN - 4)
+		netif_wake_queue(dev);
 
-	spin_unlock (&np->lock);
+	spin_unlock(&rp->lock);
 }
 
 /* This routine is logically part of the interrupt handler, but isolated
    for clarity and better register allocation. */
-static void via_rhine_rx(struct net_device *dev)
+static void rhine_rx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
-	int entry = np->cur_rx % RX_RING_SIZE;
-	int boguscnt = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
+	struct rhine_private *rp = netdev_priv(dev);
+	int entry = rp->cur_rx % RX_RING_SIZE;
+	int boguscnt = rp->dirty_rx + RX_RING_SIZE - rp->cur_rx;
 
 	if (debug > 4) {
-		printk(KERN_DEBUG "%s: via_rhine_rx(), entry %d status %8.8x.\n",
-			   dev->name, entry, le32_to_cpu(np->rx_head_desc->rx_status));
+		printk(KERN_DEBUG "%s: rhine_rx(), entry %d status %8.8x.\n",
+		       dev->name, entry,
+		       le32_to_cpu(rp->rx_head_desc->rx_status));
 	}
 
 	/* If EOP is set on the next entry, it's a new packet. Send it up. */
-	while ( ! (np->rx_head_desc->rx_status & cpu_to_le32(DescOwn))) {
-		struct rx_desc *desc = np->rx_head_desc;
+	while (!(rp->rx_head_desc->rx_status & cpu_to_le32(DescOwn))) {
+		struct rx_desc *desc = rp->rx_head_desc;
 		u32 desc_status = le32_to_cpu(desc->rx_status);
 		int data_size = desc_status >> 16;
 
 		if (debug > 4)
-			printk(KERN_DEBUG "  via_rhine_rx() status is %8.8x.\n",
-				   desc_status);
+			printk(KERN_DEBUG " rhine_rx() status is %8.8x.\n",
+			       desc_status);
 		if (--boguscnt < 0)
 			break;
-		if ( (desc_status & (RxWholePkt | RxErr)) !=  RxWholePkt) {
-			if ((desc_status & RxWholePkt) !=  RxWholePkt) {
-				printk(KERN_WARNING "%s: Oversized Ethernet frame spanned "
-					   "multiple buffers, entry %#x length %d status %8.8x!\n",
-					   dev->name, entry, data_size, desc_status);
-				printk(KERN_WARNING "%s: Oversized Ethernet frame %p vs %p.\n",
-					   dev->name, np->rx_head_desc, &np->rx_ring[entry]);
-				np->stats.rx_length_errors++;
+		if ((desc_status & (RxWholePkt | RxErr)) != RxWholePkt) {
+			if ((desc_status & RxWholePkt) != RxWholePkt) {
+				printk(KERN_WARNING "%s: Oversized Ethernet "
+				       "frame spanned multiple buffers, entry "
+				       "%#x length %d status %8.8x!\n",
+				       dev->name, entry, data_size,
+				       desc_status);
+				printk(KERN_WARNING "%s: Oversized Ethernet "
+				       "frame %p vs %p.\n", dev->name,
+				       rp->rx_head_desc, &rp->rx_ring[entry]);
+				rp->stats.rx_length_errors++;
 			} else if (desc_status & RxErr) {
 				/* There was a error. */
 				if (debug > 2)
-					printk(KERN_DEBUG "  via_rhine_rx() Rx error was %8.8x.\n",
-						   desc_status);
-				np->stats.rx_errors++;
-				if (desc_status & 0x0030) np->stats.rx_length_errors++;
-				if (desc_status & 0x0048) np->stats.rx_fifo_errors++;
-				if (desc_status & 0x0004) np->stats.rx_frame_errors++;
+					printk(KERN_DEBUG " rhine_rx() Rx "
+					       "error was %8.8x.\n",
+					       desc_status);
+				rp->stats.rx_errors++;
+				if (desc_status & 0x0030) rp->stats.rx_length_errors++;
+				if (desc_status & 0x0048) rp->stats.rx_fifo_errors++;
+				if (desc_status & 0x0004) rp->stats.rx_frame_errors++;
 				if (desc_status & 0x0002) {
 					/* this can also be updated outside the interrupt handler */
-					spin_lock (&np->lock);
-					np->stats.rx_crc_errors++;
-					spin_unlock (&np->lock);
+					spin_lock(&rp->lock);
+					rp->stats.rx_crc_errors++;
+					spin_unlock(&rp->lock);
 				}
 			}
 		} else {
@@ -1532,76 +1548,89 @@ static void via_rhine_rx(struct net_device *dev)
 			/* Length should omit the CRC */
 			int pkt_len = data_size - 4;
 
-			/* Check if the packet is long enough to accept without copying
-			   to a minimally-sized skbuff. */
+			/* Check if the packet is long enough to accept without
+			   copying to a minimally-sized skbuff. */
 			if (pkt_len < rx_copybreak &&
 				(skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
 				skb->dev = dev;
 				skb_reserve(skb, 2);	/* 16 byte align the IP header */
-				pci_dma_sync_single_for_cpu(np->pdev, np->rx_skbuff_dma[entry],
-						    np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-
-				/* *_IP_COPYSUM isn't defined anywhere and eth_copy_and_sum
-				   is memcpy for all archs so this is kind of pointless right
-				   now ... or? */
-#if HAS_IP_COPYSUM                     /* Call copy + cksum if available. */
-				eth_copy_and_sum(skb, np->rx_skbuff[entry]->tail, pkt_len, 0);
+				pci_dma_sync_single_for_cpu(rp->pdev,
+							    rp->rx_skbuff_dma[entry],
+							    rp->rx_buf_sz,
+							    PCI_DMA_FROMDEVICE);
+
+				/* *_IP_COPYSUM isn't defined anywhere and
+				   eth_copy_and_sum is memcpy for all archs so
+				   this is kind of pointless right now
+				   ... or? */
+#if HAS_IP_COPYSUM		/* Call copy + cksum if available. */
+				eth_copy_and_sum(skb,
+						 rp->rx_skbuff[entry]->tail,
+						 pkt_len, 0);
 				skb_put(skb, pkt_len);
 #else
-				memcpy(skb_put(skb, pkt_len), np->rx_skbuff[entry]->tail,
-					   pkt_len);
+				memcpy(skb_put(skb, pkt_len),
+				       rp->rx_skbuff[entry]->tail, pkt_len);
 #endif
-				pci_dma_sync_single_for_device(np->pdev, np->rx_skbuff_dma[entry],
-						    np->rx_buf_sz, PCI_DMA_FROMDEVICE);
+				pci_dma_sync_single_for_device(rp->pdev,
+							       rp->rx_skbuff_dma[entry],
+							       rp->rx_buf_sz,
+							       PCI_DMA_FROMDEVICE);
 			} else {
-				skb = np->rx_skbuff[entry];
+				skb = rp->rx_skbuff[entry];
 				if (skb == NULL) {
-					printk(KERN_ERR "%s: Inconsistent Rx descriptor chain.\n",
-						   dev->name);
+					printk(KERN_ERR "%s: Inconsistent Rx "
+					       "descriptor chain.\n",
+					       dev->name);
 					break;
 				}
-				np->rx_skbuff[entry] = NULL;
+				rp->rx_skbuff[entry] = NULL;
 				skb_put(skb, pkt_len);
-				pci_unmap_single(np->pdev, np->rx_skbuff_dma[entry],
-								 np->rx_buf_sz, PCI_DMA_FROMDEVICE);
+				pci_unmap_single(rp->pdev,
+						 rp->rx_skbuff_dma[entry],
+						 rp->rx_buf_sz,
+						 PCI_DMA_FROMDEVICE);
 			}
 			skb->protocol = eth_type_trans(skb, dev);
 			netif_rx(skb);
 			dev->last_rx = jiffies;
-			np->stats.rx_bytes += pkt_len;
-			np->stats.rx_packets++;
+			rp->stats.rx_bytes += pkt_len;
+			rp->stats.rx_packets++;
 		}
-		entry = (++np->cur_rx) % RX_RING_SIZE;
-		np->rx_head_desc = &np->rx_ring[entry];
+		entry = (++rp->cur_rx) % RX_RING_SIZE;
+		rp->rx_head_desc = &rp->rx_ring[entry];
 	}
 
 	/* Refill the Rx ring buffers. */
-	for (; np->cur_rx - np->dirty_rx > 0; np->dirty_rx++) {
+	for (; rp->cur_rx - rp->dirty_rx > 0; rp->dirty_rx++) {
 		struct sk_buff *skb;
-		entry = np->dirty_rx % RX_RING_SIZE;
-		if (np->rx_skbuff[entry] == NULL) {
-			skb = dev_alloc_skb(np->rx_buf_sz);
-			np->rx_skbuff[entry] = skb;
+		entry = rp->dirty_rx % RX_RING_SIZE;
+		if (rp->rx_skbuff[entry] == NULL) {
+			skb = dev_alloc_skb(rp->rx_buf_sz);
+			rp->rx_skbuff[entry] = skb;
 			if (skb == NULL)
-				break;			/* Better luck next round. */
-			skb->dev = dev;			/* Mark as being used by this device. */
-			np->rx_skbuff_dma[entry] =
-				pci_map_single(np->pdev, skb->tail, np->rx_buf_sz,
-							   PCI_DMA_FROMDEVICE);
-			np->rx_ring[entry].addr = cpu_to_le32(np->rx_skbuff_dma[entry]);
+				break;	/* Better luck next round. */
+			skb->dev = dev;	/* Mark as being used by this device. */
+			rp->rx_skbuff_dma[entry] =
+				pci_map_single(rp->pdev, skb->tail,
+					       rp->rx_buf_sz,
+					       PCI_DMA_FROMDEVICE);
+			rp->rx_ring[entry].addr = cpu_to_le32(rp->rx_skbuff_dma[entry]);
 		}
-		np->rx_ring[entry].rx_status = cpu_to_le32(DescOwn);
+		rp->rx_ring[entry].rx_status = cpu_to_le32(DescOwn);
 	}
 
 	/* Pre-emptively restart Rx engine. */
 	writew(readw(dev->base_addr + ChipCmd) | CmdRxOn | CmdRxDemand,
-		   dev->base_addr + ChipCmd);
+	       dev->base_addr + ChipCmd);
 }
 
-/* Clears the "tally counters" for CRC errors and missed frames(?).
-   It has been reported that some chips need a write of 0 to clear
-   these, for others the counters are set to 1 when written to and
-   instead cleared when read. So we clear them both ways ... */
+/*
+ * Clears the "tally counters" for CRC errors and missed frames(?).
+ * It has been reported that some chips need a write of 0 to clear
+ * these, for others the counters are set to 1 when written to and
+ * instead cleared when read. So we clear them both ways ...
+ */
 static inline void clear_tally_counters(const long ioaddr)
 {
 	writel(0, ioaddr + RxMissed);
@@ -1609,10 +1638,10 @@ static inline void clear_tally_counters(const long ioaddr)
 	readw(ioaddr + RxMissed);
 }
 
-static void via_rhine_restart_tx(struct net_device *dev) {
-	struct netdev_private *np = dev->priv;
+static void rhine_restart_tx(struct net_device *dev) {
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
-	int entry = np->dirty_tx % TX_RING_SIZE;
+	int entry = rp->dirty_tx % TX_RING_SIZE;
 	u32 intr_status;
 
 	/*
@@ -1624,120 +1653,123 @@ static void via_rhine_restart_tx(struct net_device *dev) {
 	if ((intr_status & IntrTxErrSummary) == 0) {
 
 		/* We know better than the chip where it should continue. */
-		writel(np->tx_ring_dma + entry * sizeof(struct tx_desc),
-			   ioaddr + TxRingPtr);
+		writel(rp->tx_ring_dma + entry * sizeof(struct tx_desc),
+		       ioaddr + TxRingPtr);
 
-		writew(CmdTxDemand | np->chip_cmd, ioaddr + ChipCmd);
+		writew(CmdTxDemand | rp->chip_cmd, ioaddr + ChipCmd);
 		IOSYNC;
 	}
 	else {
 		/* This should never happen */
 		if (debug > 1)
-			printk(KERN_WARNING "%s: via_rhine_restart_tx() "
-				   "Another error occured %8.8x.\n",
-				   dev->name, intr_status);
+			printk(KERN_WARNING "%s: rhine_restart_tx() "
+			       "Another error occured %8.8x.\n",
+			       dev->name, intr_status);
 	}
 
 }
 
-static void via_rhine_error(struct net_device *dev, int intr_status)
+static void rhine_error(struct net_device *dev, int intr_status)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 
-	spin_lock (&np->lock);
+	spin_lock(&rp->lock);
 
 	if (intr_status & (IntrLinkChange)) {
 		if (readb(ioaddr + MIIStatus) & 0x02) {
 			/* Link failed, restart autonegotiation. */
-			if (np->drv_flags & HasDavicomPhy)
-				mdio_write(dev, np->phys[0], MII_BMCR, 0x3300);
+			if (rp->drv_flags & HasDavicomPhy)
+				mdio_write(dev, rp->phys[0], MII_BMCR, 0x3300);
 		} else
-			via_rhine_check_duplex(dev);
+			rhine_check_duplex(dev);
 		if (debug)
-			printk(KERN_ERR "%s: MII status changed: Autonegotiation "
-				   "advertising %4.4x  partner %4.4x.\n", dev->name,
-			   mdio_read(dev, np->phys[0], MII_ADVERTISE),
-			   mdio_read(dev, np->phys[0], MII_LPA));
+			printk(KERN_ERR "%s: MII status changed: "
+			       "Autonegotiation advertising %4.4x partner "
+			       "%4.4x.\n", dev->name,
+			       mdio_read(dev, rp->phys[0], MII_ADVERTISE),
+			       mdio_read(dev, rp->phys[0], MII_LPA));
 	}
 	if (intr_status & IntrStatsMax) {
-		np->stats.rx_crc_errors	+= readw(ioaddr + RxCRCErrs);
-		np->stats.rx_missed_errors	+= readw(ioaddr + RxMissed);
+		rp->stats.rx_crc_errors += readw(ioaddr + RxCRCErrs);
+		rp->stats.rx_missed_errors += readw(ioaddr + RxMissed);
 		clear_tally_counters(ioaddr);
 	}
 	if (intr_status & IntrTxAborted) {
 		if (debug > 1)
 			printk(KERN_INFO "%s: Abort %8.8x, frame dropped.\n",
-				   dev->name, intr_status);
+			       dev->name, intr_status);
 	}
 	if (intr_status & IntrTxUnderrun) {
-		if (np->tx_thresh < 0xE0)
-			writeb(np->tx_thresh += 0x20, ioaddr + TxConfig);
+		if (rp->tx_thresh < 0xE0)
+			writeb(rp->tx_thresh += 0x20, ioaddr + TxConfig);
 		if (debug > 1)
 			printk(KERN_INFO "%s: Transmitter underrun, Tx "
-				   "threshold now %2.2x.\n",
-				   dev->name, np->tx_thresh);
+			       "threshold now %2.2x.\n",
+			       dev->name, rp->tx_thresh);
 	}
 	if (intr_status & IntrTxDescRace) {
 		if (debug > 2)
 			printk(KERN_INFO "%s: Tx descriptor write-back race.\n",
-				   dev->name);
+			       dev->name);
 	}
-	if ((intr_status & IntrTxError) && ~( IntrTxAborted | IntrTxUnderrun |
-										   IntrTxDescRace )) {
-		if (np->tx_thresh < 0xE0) {
-			writeb(np->tx_thresh += 0x20, ioaddr + TxConfig);
+	if ((intr_status & IntrTxError) &&
+	    (intr_status & (IntrTxAborted |
+	     IntrTxUnderrun | IntrTxDescRace)) == 0) {
+		if (rp->tx_thresh < 0xE0) {
+			writeb(rp->tx_thresh += 0x20, ioaddr + TxConfig);
 		}
 		if (debug > 1)
 			printk(KERN_INFO "%s: Unspecified error. Tx "
-				   "threshold now %2.2x.\n",
-				   dev->name, np->tx_thresh);
+			       "threshold now %2.2x.\n",
+			       dev->name, rp->tx_thresh);
 	}
-	if (intr_status & ( IntrTxAborted | IntrTxUnderrun | IntrTxDescRace |
-						IntrTxError ))
-		via_rhine_restart_tx(dev);
+	if (intr_status & (IntrTxAborted | IntrTxUnderrun | IntrTxDescRace |
+			   IntrTxError))
+		rhine_restart_tx(dev);
 
-	if (intr_status & ~( IntrLinkChange | IntrStatsMax | IntrTxUnderrun |
-						 IntrTxError | IntrTxAborted | IntrNormalSummary |
-						 IntrTxDescRace )) {
+	if (intr_status & ~(IntrLinkChange | IntrStatsMax | IntrTxUnderrun |
+			    IntrTxError | IntrTxAborted | IntrNormalSummary |
+			    IntrTxDescRace)) {
 		if (debug > 1)
-			printk(KERN_ERR "%s: Something Wicked happened! %8.8x.\n",
-				   dev->name, intr_status);
+			printk(KERN_ERR "%s: Something Wicked happened! "
+			       "%8.8x.\n", dev->name, intr_status);
 	}
 
-	spin_unlock (&np->lock);
+	spin_unlock(&rp->lock);
 }
 
-static struct net_device_stats *via_rhine_get_stats(struct net_device *dev)
+static struct net_device_stats *rhine_get_stats(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	unsigned long flags;
 
-	spin_lock_irqsave(&np->lock, flags);
-	np->stats.rx_crc_errors	+= readw(ioaddr + RxCRCErrs);
-	np->stats.rx_missed_errors	+= readw(ioaddr + RxMissed);
+	spin_lock_irqsave(&rp->lock, flags);
+	rp->stats.rx_crc_errors += readw(ioaddr + RxCRCErrs);
+	rp->stats.rx_missed_errors += readw(ioaddr + RxMissed);
 	clear_tally_counters(ioaddr);
-	spin_unlock_irqrestore(&np->lock, flags);
+	spin_unlock_irqrestore(&rp->lock, flags);
 
-	return &np->stats;
+	return &rp->stats;
 }
 
-static void via_rhine_set_rx_mode(struct net_device *dev)
+static void rhine_set_rx_mode(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
-	u32 mc_filter[2];			/* Multicast hash filter */
-	u8 rx_mode;					/* Note: 0x02=accept runt, 0x01=accept errs */
+	u32 mc_filter[2];	/* Multicast hash filter */
+	u8 rx_mode;		/* Note: 0x02=accept runt, 0x01=accept errs */
 
-	if (dev->flags & IFF_PROMISC) {			/* Set promiscuous. */
+	if (dev->flags & IFF_PROMISC) {		/* Set promiscuous. */
 		/* Unconditionally log net taps. */
-		printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
+		printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n",
+		       dev->name);
 		rx_mode = 0x1C;
 		writel(0xffffffff, ioaddr + MulticastFilter0);
 		writel(0xffffffff, ioaddr + MulticastFilter1);
 	} else if ((dev->mc_count > multicast_filter_limit)
-			   ||  (dev->flags & IFF_ALLMULTI)) {
+		   || (dev->flags & IFF_ALLMULTI)) {
 		/* Too many to match, or accept all multicasts. */
 		writel(0xffffffff, ioaddr + MulticastFilter0);
 		writel(0xffffffff, ioaddr + MulticastFilter1);
@@ -1747,7 +1779,7 @@ static void via_rhine_set_rx_mode(struct net_device *dev)
 		int i;
 		memset(mc_filter, 0, sizeof(mc_filter));
 		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-			 i++, mclist = mclist->next) {
+		     i++, mclist = mclist->next) {
 			int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
 
 			mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31));
@@ -1756,66 +1788,66 @@ static void via_rhine_set_rx_mode(struct net_device *dev)
 		writel(mc_filter[1], ioaddr + MulticastFilter1);
 		rx_mode = 0x0C;
 	}
-	writeb(np->rx_thresh | rx_mode, ioaddr + RxConfig);
+	writeb(rp->rx_thresh | rx_mode, ioaddr + RxConfig);
 }
 
-static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
+static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 
-	strcpy (info->driver, DRV_NAME);
-	strcpy (info->version, DRV_VERSION);
-	strcpy (info->bus_info, pci_name(np->pdev));
+	strcpy(info->driver, DRV_NAME);
+	strcpy(info->version, DRV_VERSION);
+	strcpy(info->bus_info, pci_name(rp->pdev));
 }
 
 static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	int rc;
 
-	if (!(np->drv_flags & CanHaveMII))
+	if (!(rp->drv_flags & CanHaveMII))
 		return -EINVAL;
 
-	spin_lock_irq(&np->lock);
-	rc = mii_ethtool_gset(&np->mii_if, cmd);
-	spin_unlock_irq(&np->lock);
+	spin_lock_irq(&rp->lock);
+	rc = mii_ethtool_gset(&rp->mii_if, cmd);
+	spin_unlock_irq(&rp->lock);
 
 	return rc;
 }
 
 static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 	int rc;
 
-	if (!(np->drv_flags & CanHaveMII))
+	if (!(rp->drv_flags & CanHaveMII))
 		return -EINVAL;
 
-	spin_lock_irq(&np->lock);
-	rc = mii_ethtool_sset(&np->mii_if, cmd);
-	spin_unlock_irq(&np->lock);
+	spin_lock_irq(&rp->lock);
+	rc = mii_ethtool_sset(&rp->mii_if, cmd);
+	spin_unlock_irq(&rp->lock);
 
 	return rc;
 }
 
 static int netdev_nway_reset(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 
-	if (!(np->drv_flags & CanHaveMII))
+	if (!(rp->drv_flags & CanHaveMII))
 		return -EINVAL;
 
-	return mii_nway_restart(&np->mii_if);
+	return mii_nway_restart(&rp->mii_if);
 }
 
 static u32 netdev_get_link(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 
-	if (!(np->drv_flags & CanHaveMII))
+	if (!(rp->drv_flags & CanHaveMII))
 		return 0;	/* -EINVAL */
 
-	return mii_link_ok(&np->mii_if);
+	return mii_link_ok(&rp->mii_if);
 }
 
 static u32 netdev_get_msglevel(struct net_device *dev)
@@ -1842,37 +1874,37 @@ static struct ethtool_ops netdev_ethtool_ops = {
 
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct netdev_private *np = dev->priv;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *) & rq->ifr_data;
+	struct rhine_private *rp = netdev_priv(dev);
 	int rc;
 
 	if (!netif_running(dev))
 		return -EINVAL;
 
-	spin_lock_irq(&np->lock);
-	rc = generic_mii_ioctl(&np->mii_if, data, cmd, NULL);
-	spin_unlock_irq(&np->lock);
+	spin_lock_irq(&rp->lock);
+	rc = generic_mii_ioctl(&rp->mii_if, if_mii(rq), cmd, NULL);
+	spin_unlock_irq(&rp->lock);
 
 	return rc;
 }
 
-static int via_rhine_close(struct net_device *dev)
+static int rhine_close(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct rhine_private *rp = netdev_priv(dev);
 
-	del_timer_sync(&np->timer);
+	del_timer_sync(&rp->timer);
 
-	spin_lock_irq(&np->lock);
+	spin_lock_irq(&rp->lock);
 
 	netif_stop_queue(dev);
 
 	if (debug > 1)
-		printk(KERN_DEBUG "%s: Shutting down ethercard, status was %4.4x.\n",
-			   dev->name, readw(ioaddr + ChipCmd));
+		printk(KERN_DEBUG "%s: Shutting down ethercard, "
+		       "status was %4.4x.\n",
+		       dev->name, readw(ioaddr + ChipCmd));
 
 	/* Switch to loopback mode to avoid hardware races. */
-	writeb(np->tx_thresh | 0x02, ioaddr + TxConfig);
+	writeb(rp->tx_thresh | 0x02, ioaddr + TxConfig);
 
 	/* Disable interrupts by clearing the interrupt mask. */
 	writew(0x0000, ioaddr + IntrEnable);
@@ -1880,9 +1912,9 @@ static int via_rhine_close(struct net_device *dev)
 	/* Stop the chip's Tx and Rx processes. */
 	writew(CmdStop, ioaddr + ChipCmd);
 
-	spin_unlock_irq(&np->lock);
+	spin_unlock_irq(&rp->lock);
 
-	free_irq(np->pdev->irq, dev);
+	free_irq(rp->pdev->irq, dev);
 	free_rbufs(dev);
 	free_tbufs(dev);
 	free_ring(dev);
@@ -1891,7 +1923,7 @@ static int via_rhine_close(struct net_device *dev)
 }
 
 
-static void __devexit via_rhine_remove_one (struct pci_dev *pdev)
+static void __devexit rhine_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 
@@ -1899,7 +1931,7 @@ static void __devexit via_rhine_remove_one (struct pci_dev *pdev)
 
 	pci_release_regions(pdev);
 
-#ifdef USE_MEM
+#ifdef USE_MMIO
 	iounmap((char *)(dev->base_addr));
 #endif
 
@@ -1909,39 +1941,29 @@ static void __devexit via_rhine_remove_one (struct pci_dev *pdev)
 }
 
 
-static struct pci_driver via_rhine_driver = {
+static struct pci_driver rhine_driver = {
 	.name		= "via-rhine",
-	.id_table	= via_rhine_pci_tbl,
-	.probe		= via_rhine_init_one,
-	.remove		= __devexit_p(via_rhine_remove_one),
+	.id_table	= rhine_pci_tbl,
+	.probe		= rhine_init_one,
+	.remove		= __devexit_p(rhine_remove_one),
 };
 
 
-static int __init via_rhine_init (void)
+static int __init rhine_init(void)
 {
 /* when a module, this is printed whether or not devices are found in probe */
 #ifdef MODULE
 	printk(version);
 #endif
-	return pci_module_init (&via_rhine_driver);
+	return pci_module_init(&rhine_driver);
 }
 
 
-static void __exit via_rhine_cleanup (void)
+static void __exit rhine_cleanup(void)
 {
-	pci_unregister_driver (&via_rhine_driver);
+	pci_unregister_driver(&rhine_driver);
 }
 
 
-module_init(via_rhine_init);
-module_exit(via_rhine_cleanup);
-
-
-/*
- * Local variables:
- *  compile-command: "gcc -DMODULE -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -c via-rhine.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 4
- * End:
- */
+module_init(rhine_init);
+module_exit(rhine_cleanup);
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index 2baf40a8a..4d5844f75 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -57,119 +57,6 @@ config COSA
 	  The driver will be compiled as a module: the
 	  module will be called cosa.
 
-#
-# COMX drivers
-#
-# Not updated to 2.6.
-config COMX
-	tristate "MultiGate (COMX) synchronous serial boards support"
-	depends on WAN && (ISA || PCI) && BROKEN
-	---help---
-	  Drivers for the PC synchronous serial adapters by
-	  ITConsult-Pro Co, Hungary.
-
-	  Read <file:Documentation/networking/comx.txt> for help on configuring
-	  and using COMX interfaces. Further info on these cards can be found
-	  at <http://www.itc.hu/> or <info@itc.hu>.
-
-	  Say Y if you want to use any board from the MultiGate (COMX)
-	  family, you must also say Y to "/proc file system support"
-	  (CONFIG_PROC_FS) in order to use these drivers.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called comx.
-
-config COMX_HW_COMX
-	tristate "Support for COMX/CMX/HiCOMX boards"
-	depends on COMX
-	help
-	  Driver for the 'CMX', 'COMX' and 'HiCOMX' boards.
-
-	  You will need additional firmware to use these cards, which are
-	  downloadable from <ftp://ftp.itc.hu/>.
-
-	  Say Y if you have a board like this.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called comx-hw-comx.
-
-config COMX_HW_LOCOMX
-	tristate "Support for LoCOMX board"
-	depends on COMX
-	help
-	  Driver for the 'LoCOMX' board.
-
-	  Say Y if you have a board like this.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called comx-hw-locomx.
-
-config COMX_HW_MIXCOM
-	tristate "Support for MixCOM board"
-	depends on COMX
-	---help---
-	  Driver for the 'MixCOM' board.
-
-	  If you want to use the watchdog device on this card, you should
-	  select it in the Watchdog Cards section of the Character Devices
-	  configuration. The ISDN interface of this card is Teles 16.3
-	  compatible, you should enable it in the ISDN configuration menu. The
-	  driver for the flash ROM of this card is available separately on
-	  <ftp://ftp.itc.hu/>.
-
-	  Say Y if you have a board like this.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called comx-hw-mixcom.
-
-config COMX_HW_MUNICH
-	tristate "Support for MUNICH based boards: SliceCOM, PCICOM (WelCOM)"
-	depends on COMX
-	---help---
-	  Driver for the 'SliceCOM' (channelized E1) and 'PciCOM' (X21) boards.
-
-	  Read <file:Documentation/networking/slicecom.txt> for help on
-	  configuring and using SliceCOM interfaces. Further info on these
-	  cards can be found at <http://www.itc.hu> or <info@itc.hu>.
-
-	  Say Y if you have a board like this.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called comx-hw-munich.
-
-config COMX_PROTO_PPP
-	tristate "Support for HDLC and syncPPP protocols on MultiGate boards"
-	depends on COMX
-	help
-	  Cisco-HDLC and synchronous PPP protocol driver.
-
-	  Say Y if you want to use either protocol.
-
-	  To compile this as a module, choose M here: the
-	  module will be called comx-proto-ppp.
-
-config COMX_PROTO_LAPB
-	tristate "Support for LAPB protocol on MultiGate boards"
-	depends on WAN && (COMX!=n && LAPB=m && LAPB || LAPB=y && COMX)
-	help
-	  LAPB protocol driver.
-
-	  Say Y if you want to use this protocol.
-
-	  To compile this as a module, choose M here: the
-	  module will be called comx-proto-lapb.
-
-config COMX_PROTO_FR
-	tristate "Support for Frame Relay on MultiGate boards"
-	depends on COMX
-	help
-	  Frame Relay protocol driver.
-
-	  Say Y if you want to use this protocol.
-
-	  To compile this as a module, choose M here: the
-	  module will be called comx-proto-fr.
-
 config DSCC4
 	tristate "Etinc PCISYNC serial board support"
 	depends on WAN && PCI && m
diff --git a/drivers/net/wan/Makefile b/drivers/net/wan/Makefile
index 6bc9ddf07..ce6c56b90 100644
--- a/drivers/net/wan/Makefile
+++ b/drivers/net/wan/Makefile
@@ -32,14 +32,6 @@ pc300-objs			:= $(pc300-y)
 
 obj-$(CONFIG_HOSTESS_SV11)	+= z85230.o	syncppp.o	hostess_sv11.o
 obj-$(CONFIG_SEALEVEL_4021)	+= z85230.o	syncppp.o	sealevel.o
-obj-$(CONFIG_COMX)		+= 				comx.o
-obj-$(CONFIG_COMX_HW_COMX)	+= 				comx-hw-comx.o
-obj-$(CONFIG_COMX_HW_LOCOMX)	+= z85230.o	syncppp.o	comx-hw-locomx.o
-obj-$(CONFIG_COMX_HW_MIXCOM)	+=				comx-hw-mixcom.o
-obj-$(CONFIG_COMX_HW_MUNICH)	+=				comx-hw-munich.o
-obj-$(CONFIG_COMX_PROTO_PPP)	+=		syncppp.o	comx-proto-ppp.o
-obj-$(CONFIG_COMX_PROTO_LAPB)	+=				comx-proto-lapb.o
-obj-$(CONFIG_COMX_PROTO_FR)	+=				comx-proto-fr.o
 obj-$(CONFIG_COSA)		+=		syncppp.o	cosa.o
 obj-$(CONFIG_FARSYNC)		+=		syncppp.o	farsync.o
 obj-$(CONFIG_DSCC4)             +=				dscc4.o
@@ -69,6 +61,9 @@ obj-$(CONFIG_C101)		+= c101.o
 obj-$(CONFIG_WANXL)		+= wanxl.o
 obj-$(CONFIG_PCI200SYN)		+= pci200syn.o
 
+clean-files := wanxlfw.inc
+$(obj)/wanxl.o:	$(obj)/wanxlfw.inc
+
 ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y)
 ifeq ($(ARCH),m68k)
   AS68K = $(AS)
@@ -80,12 +75,12 @@ endif
 
 quiet_cmd_build_wanxlfw = BLD FW  $@
       cmd_build_wanxlfw = \
-	$(CPP) -Wp,-MD,$(depfile) -Iinclude $(obj)/wanxlfw.S | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \
+	$(CPP) -Wp,-MD,$(depfile) -I$(srctree)/include $< | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \
 	$(LD68K) --oformat binary -Ttext 0x1000 $(obj)/wanxlfw.o -o $(obj)/wanxlfw.bin; \
 	hexdump -ve '"\n" 16/1 "0x%02X,"' $(obj)/wanxlfw.bin | sed 's/0x  ,//g;1s/^/static u8 firmware[]={/;$$s/,$$/\n};\n/' >$(obj)/wanxlfw.inc; \
 	rm -f $(obj)/wanxlfw.bin $(obj)/wanxlfw.o
 
-$(obj)/wanxlfw.inc:	$(obj)/wanxlfw.S
+$(obj)/wanxlfw.inc:	$(src)/wanxlfw.S
 	$(call if_changed_dep,build_wanxlfw)
 targets += wanxlfw.inc
 endif
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index a5445c1a6..7f4718040 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -379,8 +379,6 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
 		return result;
 	}
 
-	/* XXX: are we OK with having that done when card is already up? */
-
 	sca_init_sync_port(card); /* Set up C101 memory */
 	hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev);
 
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 00d0b751e..a4d0452c3 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -93,6 +93,7 @@
 #include <linux/netdevice.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
+#include <linux/device.h>
 
 #undef COSA_SLOW_IO	/* for testing purposes only */
 #undef REALLY_SLOW_IO
@@ -233,6 +234,9 @@ static int dma[MAX_CARDS+1];
 /* IRQ can be safely autoprobed */
 static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, };
 
+/* for class stuff*/
+static struct class_simple *cosa_class;
+
 #ifdef MODULE
 MODULE_PARM(io, "1-" __MODULE_STRING(MAX_CARDS) "i");
 MODULE_PARM_DESC(io, "The I/O bases of the COSA or SRP cards");
@@ -359,7 +363,7 @@ static void debug_status_out(struct cosa_data *cosa, int status);
 
 static int __init cosa_init(void)
 {
-	int i;
+	int i, err = 0;
 
 	printk(KERN_INFO "cosa v1.08 (c) 1997-2000 Jan Kasprzak <kas@fi.muni.cz>\n");
 #ifdef CONFIG_SMP
@@ -369,12 +373,14 @@ static int __init cosa_init(void)
 		if (register_chrdev(cosa_major, "cosa", &cosa_fops)) {
 			printk(KERN_WARNING "cosa: unable to get major %d\n",
 				cosa_major);
-			return -EIO;
+			err = -EIO;
+			goto out;
 		}
 	} else {
 		if (!(cosa_major=register_chrdev(0, "cosa", &cosa_fops))) {
 			printk(KERN_WARNING "cosa: unable to register chardev\n");
-			return -EIO;
+			err = -EIO;
+			goto out;
 		}
 	}
 	for (i=0; i<MAX_CARDS; i++)
@@ -384,15 +390,33 @@ static int __init cosa_init(void)
 	if (!nr_cards) {
 		printk(KERN_WARNING "cosa: no devices found.\n");
 		unregister_chrdev(cosa_major, "cosa");
-		return -ENODEV;
+		err = -ENODEV;
+		goto out;
 	}
 	devfs_mk_dir("cosa");
+	cosa_class = class_simple_create(THIS_MODULE, "cosa");
+	if (IS_ERR(cosa_class)) {
+		err = PTR_ERR(cosa_class);
+		goto out_chrdev;
+	}
 	for (i=0; i<nr_cards; i++) {
-		devfs_mk_cdev(MKDEV(cosa_major, i),
+		class_simple_device_add(cosa_class, MKDEV(cosa_major, i),
+				NULL, "cosa%d", i);
+		err = devfs_mk_cdev(MKDEV(cosa_major, i),
 				S_IFCHR|S_IRUSR|S_IWUSR,
 				"cosa/%d", i);
+		if (err) {
+			class_simple_device_remove(MKDEV(cosa_major, i));
+			goto out_chrdev;		
+		}
 	}
-	return 0;
+	err = 0;
+	goto out;
+	
+out_chrdev:
+	unregister_chrdev(cosa_major, "cosa");
+out:
+	return err;
 }
 module_init(cosa_init);
 
@@ -402,8 +426,11 @@ static void __exit cosa_exit(void)
 	int i;
 	printk(KERN_INFO "Unloading the cosa module\n");
 
-	for (i=0; i<nr_cards; i++)
+	for (i=0; i<nr_cards; i++) {
+		class_simple_device_remove(MKDEV(cosa_major, i));
 		devfs_remove("cosa/%d", i);
+	}
+	class_simple_destroy(cosa_class);
 	devfs_remove("cosa");
 	for (cosa=cosa_cards; nr_cards--; cosa++) {
 		/* Clean up the per-channel data */
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 82798fd0e..bad0d4185 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -229,7 +229,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
 	return(ret);
 }
 
-static int dlci_config(struct net_device *dev, struct dlci_conf *conf, int get)
+static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, int get)
 {
 	struct dlci_conf	config;
 	struct dlci_local	*dlp;
@@ -286,7 +286,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 			if (!*(short *)(dev->dev_addr))
 				return(-EINVAL);
 
-			return(dlci_config(dev, (struct dlci_conf *) ifr->ifr_data, cmd == DLCI_GET_CONF));
+			return(dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF));
 			break;
 
 		default: 
@@ -454,7 +454,7 @@ static int dlci_del(struct dlci_add *dlci)
 	return(err);
 }
 
-static int dlci_ioctl(unsigned int cmd, void *arg)
+static int dlci_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct dlci_add add;
 	int err;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index e52664dfd..d805ac786 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -1,9 +1,9 @@
 /*
- *      FarSync X21 driver for Linux (generic HDLC version)
+ *      FarSync WAN driver for Linux (2.6.x kernel version)
  *
  *      Actually sync driver for X.21, V.35 and V.24 on FarSync T-series cards
  *
- *      Copyright (C) 2001 FarSite Communications Ltd.
+ *      Copyright (C) 2001-2004 FarSite Communications Ltd.
  *      www.farsite.co.uk
  *
  *      This program is free software; you can redistribute it and/or
@@ -11,63 +11,79 @@
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
  *
- *      Author: R.J.Dunlop      <bob.dunlop@farsite.co.uk>
+ *      Author:      R.J.Dunlop    <bob.dunlop@farsite.co.uk>
+ *      Maintainer:  Kevin Curtis  <kevin.curtis@farsite.co.uk>
  */
 
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/version.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
-#include <asm/uaccess.h>
 #include <linux/if.h>
 #include <linux/hdlc.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
 
 #include "farsync.h"
 
-
 /*
  *      Module info
  */
 MODULE_AUTHOR("R.J.Dunlop <bob.dunlop@farsite.co.uk>");
-MODULE_DESCRIPTION("FarSync T-Series X21 driver. FarSite Communications Ltd.");
+MODULE_DESCRIPTION("FarSync T-Series WAN driver. FarSite Communications Ltd.");
+MODULE_PARM(fst_txq_low, "i");
+MODULE_PARM(fst_txq_high, "i");
+MODULE_PARM(fst_max_reads, "i");
+MODULE_PARM(fst_excluded_cards, "i");
+MODULE_PARM(fst_excluded_list, "0-32i");
 MODULE_LICENSE("GPL");
 
 /*      Driver configuration and global parameters
  *      ==========================================
  */
 
-/*      Number of ports (per card) supported
+/*      Number of ports (per card) and cards supported
  */
 #define FST_MAX_PORTS           4
-
-
-/*      PCI vendor and device IDs
- */
-#define FSC_PCI_VENDOR_ID       0x1619  /* FarSite Communications Ltd */
-#define T2P_PCI_DEVICE_ID       0x0400  /* T2P X21 2 port card */
-#define T4P_PCI_DEVICE_ID       0x0440  /* T4P X21 4 port card */
-
+#define FST_MAX_CARDS           32
 
 /*      Default parameters for the link
  */
-#define FST_TX_QUEUE_LEN        100     /* At 8Mbps a longer queue length is
-                                         * useful, the syncppp module forces
-                                         * this down assuming a slower line I
-                                         * guess.
-                                         */
-#define FST_MAX_MTU             8000    /* Huge but possible */
-#define FST_DEF_MTU             1500    /* Common sane value */
+#define FST_TX_QUEUE_LEN        100	/* At 8Mbps a longer queue length is
+					 * useful, the syncppp module forces
+					 * this down assuming a slower line I
+					 * guess.
+					 */
+#define FST_TXQ_DEPTH           16	/* This one is for the buffering
+					 * of frames on the way down to the card
+					 * so that we can keep the card busy
+					 * and maximise throughput
+					 */
+#define FST_HIGH_WATER_MARK     12	/* Point at which we flow control
+					 * network layer */
+#define FST_LOW_WATER_MARK      8	/* Point at which we remove flow
+					 * control from network layer */
+#define FST_MAX_MTU             8000	/* Huge but possible */
+#define FST_DEF_MTU             1500	/* Common sane value */
 
 #define FST_TX_TIMEOUT          (2*HZ)
 
-
 #ifdef ARPHRD_RAWHDLC
-#define ARPHRD_MYTYPE   ARPHRD_RAWHDLC  /* Raw frames */
+#define ARPHRD_MYTYPE   ARPHRD_RAWHDLC	/* Raw frames */
 #else
-#define ARPHRD_MYTYPE   ARPHRD_HDLC     /* Cisco-HDLC (keepalives etc) */
+#define ARPHRD_MYTYPE   ARPHRD_HDLC	/* Cisco-HDLC (keepalives etc) */
 #endif
 
+/*
+ * Modules parameters and associated varaibles
+ */
+int fst_txq_low = FST_LOW_WATER_MARK;
+int fst_txq_high = FST_HIGH_WATER_MARK;
+int fst_max_reads = 7;
+int fst_excluded_cards = 0;
+int fst_excluded_list[FST_MAX_CARDS];
 
 /*      Card shared memory layout
  *      =========================
@@ -84,58 +100,57 @@ MODULE_LICENSE("GPL");
  *      be used to check that we have not got out of step with the firmware
  *      contained in the .CDE files.
  */
-#define SMC_VERSION 11
+#define SMC_VERSION 24
 
-#define FST_MEMSIZE 0x100000    /* Size of card memory (1Mb) */
+#define FST_MEMSIZE 0x100000	/* Size of card memory (1Mb) */
 
-#define SMC_BASE 0x00002000L    /* Base offset of the shared memory window main
-                                 * configuration structure */
-#define BFM_BASE 0x00010000L    /* Base offset of the shared memory window DMA
-                                 * buffers */
+#define SMC_BASE 0x00002000L	/* Base offset of the shared memory window main
+				 * configuration structure */
+#define BFM_BASE 0x00010000L	/* Base offset of the shared memory window DMA
+				 * buffers */
 
-#define LEN_TX_BUFFER 8192      /* Size of packet buffers */
+#define LEN_TX_BUFFER 8192	/* Size of packet buffers */
 #define LEN_RX_BUFFER 8192
 
-#define LEN_SMALL_TX_BUFFER 256 /* Size of obsolete buffs used for DOS diags */
+#define LEN_SMALL_TX_BUFFER 256	/* Size of obsolete buffs used for DOS diags */
 #define LEN_SMALL_RX_BUFFER 256
 
-#define NUM_TX_BUFFER 2         /* Must be power of 2. Fixed by firmware */
+#define NUM_TX_BUFFER 2		/* Must be power of 2. Fixed by firmware */
 #define NUM_RX_BUFFER 8
 
 /* Interrupt retry time in milliseconds */
 #define INT_RETRY_TIME 2
 
-
 /*      The Am186CH/CC processors support a SmartDMA mode using circular pools
  *      of buffer descriptors. The structure is almost identical to that used
  *      in the LANCE Ethernet controllers. Details available as PDF from the
  *      AMD web site: http://www.amd.com/products/epd/processors/\
  *                    2.16bitcont/3.am186cxfa/a21914/21914.pdf
  */
-struct txdesc {                 /* Transmit descriptor */
-        volatile u16 ladr;      /* Low order address of packet. This is a
-                                 * linear address in the Am186 memory space
-                                 */
-        volatile u8  hadr;      /* High order address. Low 4 bits only, high 4
-                                 * bits must be zero
-                                 */
-        volatile u8  bits;      /* Status and config */
-        volatile u16 bcnt;      /* 2s complement of packet size in low 15 bits.
-                                 * Transmit terminal count interrupt enable in
-                                 * top bit.
-                                 */
-                 u16 unused;    /* Not used in Tx */
+struct txdesc {			/* Transmit descriptor */
+	volatile u16 ladr;	/* Low order address of packet. This is a
+				 * linear address in the Am186 memory space
+				 */
+	volatile u8 hadr;	/* High order address. Low 4 bits only, high 4
+				 * bits must be zero
+				 */
+	volatile u8 bits;	/* Status and config */
+	volatile u16 bcnt;	/* 2s complement of packet size in low 15 bits.
+				 * Transmit terminal count interrupt enable in
+				 * top bit.
+				 */
+	u16 unused;		/* Not used in Tx */
 };
 
-struct rxdesc {                 /* Receive descriptor */
-        volatile u16 ladr;      /* Low order address of packet */
-        volatile u8  hadr;      /* High order address */
-        volatile u8  bits;      /* Status and config */
-        volatile u16 bcnt;      /* 2s complement of buffer size in low 15 bits.
-                                 * Receive terminal count interrupt enable in
-                                 * top bit.
-                                 */
-        volatile u16 mcnt;      /* Message byte count (15 bits) */
+struct rxdesc {			/* Receive descriptor */
+	volatile u16 ladr;	/* Low order address of packet */
+	volatile u8 hadr;	/* High order address */
+	volatile u8 bits;	/* Status and config */
+	volatile u16 bcnt;	/* 2s complement of buffer size in low 15 bits.
+				 * Receive terminal count interrupt enable in
+				 * top bit.
+				 */
+	volatile u16 mcnt;	/* Message byte count (15 bits) */
 };
 
 /* Convert a length into the 15 bit 2's complement */
@@ -146,57 +161,99 @@ struct rxdesc {                 /* Receive descriptor */
 #define cnv_bcnt(len)   (-(len))
 
 /* Status and config bits for the above */
-#define DMA_OWN         0x80            /* SmartDMA owns the descriptor */
-#define TX_STP          0x02            /* Tx: start of packet */
-#define TX_ENP          0x01            /* Tx: end of packet */
-#define RX_ERR          0x40            /* Rx: error (OR of next 4 bits) */
-#define RX_FRAM         0x20            /* Rx: framing error */
-#define RX_OFLO         0x10            /* Rx: overflow error */
-#define RX_CRC          0x08            /* Rx: CRC error */
-#define RX_HBUF         0x04            /* Rx: buffer error */
-#define RX_STP          0x02            /* Rx: start of packet */
-#define RX_ENP          0x01            /* Rx: end of packet */
-
-
-/* Interrupts from the card are caused by various events and these are presented
+#define DMA_OWN         0x80	/* SmartDMA owns the descriptor */
+#define TX_STP          0x02	/* Tx: start of packet */
+#define TX_ENP          0x01	/* Tx: end of packet */
+#define RX_ERR          0x40	/* Rx: error (OR of next 4 bits) */
+#define RX_FRAM         0x20	/* Rx: framing error */
+#define RX_OFLO         0x10	/* Rx: overflow error */
+#define RX_CRC          0x08	/* Rx: CRC error */
+#define RX_HBUF         0x04	/* Rx: buffer error */
+#define RX_STP          0x02	/* Rx: start of packet */
+#define RX_ENP          0x01	/* Rx: end of packet */
+
+/* Interrupts from the card are caused by various events which are presented
  * in a circular buffer as several events may be processed on one physical int
  */
 #define MAX_CIRBUFF     32
 
 struct cirbuff {
-        u8 rdindex;             /* read, then increment and wrap */
-        u8 wrindex;             /* write, then increment and wrap */
-        u8 evntbuff[MAX_CIRBUFF];
+	u8 rdindex;		/* read, then increment and wrap */
+	u8 wrindex;		/* write, then increment and wrap */
+	u8 evntbuff[MAX_CIRBUFF];
 };
 
 /* Interrupt event codes.
  * Where appropriate the two low order bits indicate the port number
  */
-#define CTLA_CHG        0x18    /* Control signal changed */
+#define CTLA_CHG        0x18	/* Control signal changed */
 #define CTLB_CHG        0x19
 #define CTLC_CHG        0x1A
 #define CTLD_CHG        0x1B
 
-#define INIT_CPLT       0x20    /* Initialisation complete */
-#define INIT_FAIL       0x21    /* Initialisation failed */
+#define INIT_CPLT       0x20	/* Initialisation complete */
+#define INIT_FAIL       0x21	/* Initialisation failed */
 
-#define ABTA_SENT       0x24    /* Abort sent */
+#define ABTA_SENT       0x24	/* Abort sent */
 #define ABTB_SENT       0x25
 #define ABTC_SENT       0x26
 #define ABTD_SENT       0x27
 
-#define TXA_UNDF        0x28    /* Transmission underflow */
+#define TXA_UNDF        0x28	/* Transmission underflow */
 #define TXB_UNDF        0x29
 #define TXC_UNDF        0x2A
 #define TXD_UNDF        0x2B
 
+#define F56_INT         0x2C
+#define M32_INT         0x2D
+
+#define TE1_ALMA        0x30
 
 /* Port physical configuration. See farsync.h for field values */
 struct port_cfg {
-        u16  lineInterface;     /* Physical interface type */
-        u8   x25op;             /* Unused at present */
-        u8   internalClock;     /* 1 => internal clock, 0 => external */
-        u32  lineSpeed;         /* Speed in bps */
+	u16 lineInterface;	/* Physical interface type */
+	u8 x25op;		/* Unused at present */
+	u8 internalClock;	/* 1 => internal clock, 0 => external */
+	u8 transparentMode;	/* 1 => on, 0 => off */
+	u8 invertClock;		/* 0 => normal, 1 => inverted */
+	u8 padBytes[6];		/* Padding */
+	u32 lineSpeed;		/* Speed in bps */
+};
+
+/* TE1 port physical configuration */
+struct su_config {
+	u32 dataRate;
+	u8 clocking;
+	u8 framing;
+	u8 structure;
+	u8 interface;
+	u8 coding;
+	u8 lineBuildOut;
+	u8 equalizer;
+	u8 transparentMode;
+	u8 loopMode;
+	u8 range;
+	u8 txBufferMode;
+	u8 rxBufferMode;
+	u8 startingSlot;
+	u8 losThreshold;
+	u8 enableIdleCode;
+	u8 idleCode;
+	u8 spare[44];
+};
+
+/* TE1 Status */
+struct su_status {
+	u32 receiveBufferDelay;
+	u32 framingErrorCount;
+	u32 codeViolationCount;
+	u32 crcErrorCount;
+	u32 lineAttenuation;
+	u8 portStarted;
+	u8 lossOfSignal;
+	u8 receiveRemoteAlarm;
+	u8 alarmIndicationSignal;
+	u8 spare[40];
 };
 
 /* Finally sling all the above together into the shared memory structure.
@@ -206,154 +263,216 @@ struct port_cfg {
  * See farsync.h for some field values.
  */
 struct fst_shared {
-                                /* DMA descriptor rings */
-        struct rxdesc rxDescrRing[FST_MAX_PORTS][NUM_RX_BUFFER];
-        struct txdesc txDescrRing[FST_MAX_PORTS][NUM_TX_BUFFER];
+	/* DMA descriptor rings */
+	struct rxdesc rxDescrRing[FST_MAX_PORTS][NUM_RX_BUFFER];
+	struct txdesc txDescrRing[FST_MAX_PORTS][NUM_TX_BUFFER];
 
-                                /* Obsolete small buffers */
-        u8  smallRxBuffer[FST_MAX_PORTS][NUM_RX_BUFFER][LEN_SMALL_RX_BUFFER];
-        u8  smallTxBuffer[FST_MAX_PORTS][NUM_TX_BUFFER][LEN_SMALL_TX_BUFFER];
+	/* Obsolete small buffers */
+	u8 smallRxBuffer[FST_MAX_PORTS][NUM_RX_BUFFER][LEN_SMALL_RX_BUFFER];
+	u8 smallTxBuffer[FST_MAX_PORTS][NUM_TX_BUFFER][LEN_SMALL_TX_BUFFER];
 
-        u8  taskStatus;         /* 0x00 => initialising, 0x01 => running,
-                                 * 0xFF => halted
-                                 */
+	u8 taskStatus;		/* 0x00 => initialising, 0x01 => running,
+				 * 0xFF => halted
+				 */
 
-        u8  interruptHandshake; /* Set to 0x01 by adapter to signal interrupt,
-                                 * set to 0xEE by host to acknowledge interrupt
-                                 */
+	u8 interruptHandshake;	/* Set to 0x01 by adapter to signal interrupt,
+				 * set to 0xEE by host to acknowledge interrupt
+				 */
 
-        u16 smcVersion;         /* Must match SMC_VERSION */
+	u16 smcVersion;		/* Must match SMC_VERSION */
 
-        u32 smcFirmwareVersion; /* 0xIIVVRRBB where II = product ID, VV = major
-                                 * version, RR = revision and BB = build
-                                 */
+	u32 smcFirmwareVersion;	/* 0xIIVVRRBB where II = product ID, VV = major
+				 * version, RR = revision and BB = build
+				 */
 
-        u16 txa_done;           /* Obsolete completion flags */
-        u16 rxa_done;
-        u16 txb_done;
-        u16 rxb_done;
-        u16 txc_done;
-        u16 rxc_done;
-        u16 txd_done;
-        u16 rxd_done;
+	u16 txa_done;		/* Obsolete completion flags */
+	u16 rxa_done;
+	u16 txb_done;
+	u16 rxb_done;
+	u16 txc_done;
+	u16 rxc_done;
+	u16 txd_done;
+	u16 rxd_done;
 
-        u16 mailbox[4];         /* Diagnostics mailbox. Not used */
+	u16 mailbox[4];		/* Diagnostics mailbox. Not used */
 
-        struct cirbuff interruptEvent;  /* interrupt causes */
+	struct cirbuff interruptEvent;	/* interrupt causes */
 
-        u32 v24IpSts[FST_MAX_PORTS];    /* V.24 control input status */
-        u32 v24OpSts[FST_MAX_PORTS];    /* V.24 control output status */
+	u32 v24IpSts[FST_MAX_PORTS];	/* V.24 control input status */
+	u32 v24OpSts[FST_MAX_PORTS];	/* V.24 control output status */
 
-        struct port_cfg portConfig[FST_MAX_PORTS];
+	struct port_cfg portConfig[FST_MAX_PORTS];
 
-        u16 clockStatus[FST_MAX_PORTS]; /* lsb: 0=> present, 1=> absent */
+	u16 clockStatus[FST_MAX_PORTS];	/* lsb: 0=> present, 1=> absent */
 
-        u16 cableStatus;                /* lsb: 0=> present, 1=> absent */
+	u16 cableStatus;	/* lsb: 0=> present, 1=> absent */
 
-        u16 txDescrIndex[FST_MAX_PORTS]; /* transmit descriptor ring index */
-        u16 rxDescrIndex[FST_MAX_PORTS]; /* receive descriptor ring index */
+	u16 txDescrIndex[FST_MAX_PORTS];	/* transmit descriptor ring index */
+	u16 rxDescrIndex[FST_MAX_PORTS];	/* receive descriptor ring index */
 
-        u16 portMailbox[FST_MAX_PORTS][2];      /* command, modifier */
-        u16 cardMailbox[4];                     /* Not used */
+	u16 portMailbox[FST_MAX_PORTS][2];	/* command, modifier */
+	u16 cardMailbox[4];	/* Not used */
 
-                                /* Number of times that card thinks the host has
-                                 * missed an interrupt by not acknowledging
-                                 * within 2mS (I guess NT has problems)
-                                 */
-        u32 interruptRetryCount;
+	/* Number of times the card thinks the host has
+	 * missed an interrupt by not acknowledging
+	 * within 2mS (I guess NT has problems)
+	 */
+	u32 interruptRetryCount;
 
-                                /* Driver private data used as an ID. We'll not
-                                 * use this on Linux I'd rather keep such things
-                                 * in main memory rather than on the PCI bus
-                                 */
-        u32 portHandle[FST_MAX_PORTS];
+	/* Driver private data used as an ID. We'll not
+	 * use this as I'd rather keep such things
+	 * in main memory rather than on the PCI bus
+	 */
+	u32 portHandle[FST_MAX_PORTS];
 
-                                /* Count of Tx underflows for stats */
-        u32 transmitBufferUnderflow[FST_MAX_PORTS];
+	/* Count of Tx underflows for stats */
+	u32 transmitBufferUnderflow[FST_MAX_PORTS];
 
-                                /* Debounced V.24 control input status */
-        u32 v24DebouncedSts[FST_MAX_PORTS];
+	/* Debounced V.24 control input status */
+	u32 v24DebouncedSts[FST_MAX_PORTS];
 
-                                /* Adapter debounce timers. Don't touch */
-        u32 ctsTimer[FST_MAX_PORTS];
-        u32 ctsTimerRun[FST_MAX_PORTS];
-        u32 dcdTimer[FST_MAX_PORTS];
-        u32 dcdTimerRun[FST_MAX_PORTS];
+	/* Adapter debounce timers. Don't touch */
+	u32 ctsTimer[FST_MAX_PORTS];
+	u32 ctsTimerRun[FST_MAX_PORTS];
+	u32 dcdTimer[FST_MAX_PORTS];
+	u32 dcdTimerRun[FST_MAX_PORTS];
 
-        u32 numberOfPorts;      /* Number of ports detected at startup */
+	u32 numberOfPorts;	/* Number of ports detected at startup */
 
-        u16 _reserved[64];
+	u16 _reserved[64];
 
-        u16 cardMode;           /* Bit-mask to enable features:
-                                 * Bit 0: 1 enables LED identify mode
-                                 */
+	u16 cardMode;		/* Bit-mask to enable features:
+				 * Bit 0: 1 enables LED identify mode
+				 */
 
-        u16 portScheduleOffset;
+	u16 portScheduleOffset;
 
-        u32 endOfSmcSignature;  /* endOfSmcSignature MUST be the last member of
-                                 * the structure and marks the end of the shared
-                                 * memory. Adapter code initializes its value as
-                                 * END_SIG.
-                                 */
+	struct su_config suConfig;	/* TE1 Bits */
+	struct su_status suStatus;
+
+	u32 endOfSmcSignature;	/* endOfSmcSignature MUST be the last member of
+				 * the structure and marks the end of shared
+				 * memory. Adapter code initializes it as
+				 * END_SIG.
+				 */
 };
 
 /* endOfSmcSignature value */
 #define END_SIG                 0x12345678
 
 /* Mailbox values. (portMailbox) */
-#define NOP             0       /* No operation */
-#define ACK             1       /* Positive acknowledgement to PC driver */
-#define NAK             2       /* Negative acknowledgement to PC driver */
-#define STARTPORT       3       /* Start an HDLC port */
-#define STOPPORT        4       /* Stop an HDLC port */
-#define ABORTTX         5       /* Abort the transmitter for a port */
-#define SETV24O         6       /* Set V24 outputs */
-
+#define NOP             0	/* No operation */
+#define ACK             1	/* Positive acknowledgement to PC driver */
+#define NAK             2	/* Negative acknowledgement to PC driver */
+#define STARTPORT       3	/* Start an HDLC port */
+#define STOPPORT        4	/* Stop an HDLC port */
+#define ABORTTX         5	/* Abort the transmitter for a port */
+#define SETV24O         6	/* Set V24 outputs */
+
+/* PLX Chip Register Offsets */
+#define CNTRL_9052      0x50	/* Control Register */
+#define CNTRL_9054      0x6c	/* Control Register */
+
+#define INTCSR_9052     0x4c	/* Interrupt control/status register */
+#define INTCSR_9054     0x68	/* Interrupt control/status register */
+
+/* 9054 DMA Registers */
+/*
+ * Note that we will be using DMA Channel 0 for copying rx data
+ * and Channel 1 for copying tx data
+ */
+#define DMAMODE0        0x80
+#define DMAPADR0        0x84
+#define DMALADR0        0x88
+#define DMASIZ0         0x8c
+#define DMADPR0         0x90
+#define DMAMODE1        0x94
+#define DMAPADR1        0x98
+#define DMALADR1        0x9c
+#define DMASIZ1         0xa0
+#define DMADPR1         0xa4
+#define DMACSR0         0xa8
+#define DMACSR1         0xa9
+#define DMAARB          0xac
+#define DMATHR          0xb0
+#define DMADAC0         0xb4
+#define DMADAC1         0xb8
+#define DMAMARBR        0xac
+
+#define FST_MIN_DMA_LEN 64
+#define FST_RX_DMA_INT  0x01
+#define FST_TX_DMA_INT  0x02
+#define FST_CARD_INT    0x04
 
 /* Larger buffers are positioned in memory at offset BFM_BASE */
 struct buf_window {
-        u8 txBuffer[FST_MAX_PORTS][NUM_TX_BUFFER][LEN_TX_BUFFER];
-        u8 rxBuffer[FST_MAX_PORTS][NUM_RX_BUFFER][LEN_RX_BUFFER];
+	u8 txBuffer[FST_MAX_PORTS][NUM_TX_BUFFER][LEN_TX_BUFFER];
+	u8 rxBuffer[FST_MAX_PORTS][NUM_RX_BUFFER][LEN_RX_BUFFER];
 };
 
 /* Calculate offset of a buffer object within the shared memory window */
-#define BUF_OFFSET(X)   offsetof(struct buf_window, X)
+#define BUF_OFFSET(X)   ((unsigned int)&(((struct buf_window *)BFM_BASE)->X))
 
 #pragma pack()
 
-
 /*      Device driver private information
  *      =================================
  */
 /*      Per port (line or channel) information
  */
 struct fst_port_info {
-        struct net_device      *dev;
-        struct fst_card_info   *card;   /* Card we're associated with */
-        int                     index;  /* Port index on the card */
-        int                     hwif;   /* Line hardware (lineInterface copy) */
-        int                     run;    /* Port is running */
-        int                     rxpos;  /* Next Rx buffer to use */
-        int                     txpos;  /* Next Tx buffer to use */
-        int                     txipos; /* Next Tx buffer to check for free */
-        int                     txcnt;  /* Count of Tx buffers in use */
+        struct net_device *dev; /* Device struct - must be first */
+	struct fst_card_info *card;	/* Card we're associated with */
+	int index;		/* Port index on the card */
+	int hwif;		/* Line hardware (lineInterface copy) */
+	int run;		/* Port is running */
+	int mode;		/* Normal or FarSync raw */
+	int rxpos;		/* Next Rx buffer to use */
+	int txpos;		/* Next Tx buffer to use */
+	int txipos;		/* Next Tx buffer to check for free */
+	int start;		/* Indication of start/stop to network */
+	/*
+	 * A sixteen entry transmit queue
+	 */
+	int txqs;		/* index to get next buffer to tx */
+	int txqe;		/* index to queue next packet */
+	struct sk_buff *txq[FST_TXQ_DEPTH];	/* The queue */
+	int rxqdepth;
 };
 
 /*      Per card information
  */
 struct fst_card_info {
-        char          *mem;             /* Card memory mapped to kernel space */
-        char          *ctlmem;          /* Control memory for PCI cards */
-        unsigned int   phys_mem;        /* Physical memory window address */
-        unsigned int   phys_ctlmem;     /* Physical control memory address */
-        unsigned int   irq;             /* Interrupt request line number */
-        unsigned int   nports;          /* Number of serial ports */
-        unsigned int   type;            /* Type index of card */
-        unsigned int   state;           /* State of card */
-        spinlock_t     card_lock;       /* Lock for SMP access */
-        unsigned short pci_conf;        /* PCI card config in I/O space */
-                                        /* Per port info */
-        struct fst_port_info ports[ FST_MAX_PORTS ];
+	char *mem;		/* Card memory mapped to kernel space */
+	char *ctlmem;		/* Control memory for PCI cards */
+	unsigned int phys_mem;	/* Physical memory window address */
+	unsigned int phys_ctlmem;	/* Physical control memory address */
+	unsigned int irq;	/* Interrupt request line number */
+	unsigned int nports;	/* Number of serial ports */
+	unsigned int type;	/* Type index of card */
+	unsigned int state;	/* State of card */
+	spinlock_t card_lock;	/* Lock for SMP access */
+	unsigned short pci_conf;	/* PCI card config in I/O space */
+	/* Per port info */
+	struct fst_port_info ports[FST_MAX_PORTS];
+	struct pci_dev *device;	/* Information about the pci device */
+	int card_no;		/* Inst of the card on the system */
+	int family;		/* TxP or TxU */
+	int dmarx_in_progress;
+	int dmatx_in_progress;
+	unsigned long int_count;
+	unsigned long int_time_ave;
+	void *rx_dma_handle_host;
+	dma_addr_t rx_dma_handle_card;
+	void *tx_dma_handle_host;
+	dma_addr_t tx_dma_handle_card;
+	struct sk_buff *dma_skb_rx;
+	struct fst_port_info *dma_port_rx;
+	struct fst_port_info *dma_port_tx;
+	int dma_len_rx;
+	int dma_len_tx;
+	int dma_txpos;
+	int dma_rxpos;
 };
 
 /* Convert an HDLC device pointer into a port info pointer and similar */
@@ -380,7 +499,6 @@ struct fst_card_info {
 #define FST_WRW(C,E,W)  writew ((W), (C)->mem + WIN_OFFSET(E))
 #define FST_WRL(C,E,L)  writel ((L), (C)->mem + WIN_OFFSET(E))
 
-
 /*
  *      Debug support
  */
@@ -399,30 +517,151 @@ static int fst_debug_mask = { FST_DEBUG };
                                 printk ( KERN_DEBUG FST_NAME ": " fmt, ## A )
 
 #else
-# define dbg(X...)      /* NOP */
+#define dbg(X...)		/* NOP */
 #endif
 
-
 /*      Printing short cuts
  */
 #define printk_err(fmt,A...)    printk ( KERN_ERR     FST_NAME ": " fmt, ## A )
 #define printk_warn(fmt,A...)   printk ( KERN_WARNING FST_NAME ": " fmt, ## A )
 #define printk_info(fmt,A...)   printk ( KERN_INFO    FST_NAME ": " fmt, ## A )
 
-
 /*
  *      PCI ID lookup table
  */
-static struct pci_device_id fst_pci_dev_id[] = {
-        { FSC_PCI_VENDOR_ID, T2P_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-                                        FST_TYPE_T2P },
-        { FSC_PCI_VENDOR_ID, T4P_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-                                        FST_TYPE_T4P },
-        { 0, }                          /* End */
+static struct pci_device_id fst_pci_dev_id[] __devinitdata = {
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T2P, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_T2P},
+
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T4P, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_T4P},
+
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T1U, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_T1U},
+
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T2U, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_T2U},
+
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T4U, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_T4U},
+
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_TE1, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_TE1},
+
+	{PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_TE1C, PCI_ANY_ID, 
+	 PCI_ANY_ID, 0, 0, FST_TYPE_TE1},
+	{0,}			/* End */
 };
 
-MODULE_DEVICE_TABLE ( pci, fst_pci_dev_id );
+MODULE_DEVICE_TABLE(pci, fst_pci_dev_id);
+
+/*
+ *      Device Driver Work Queues
+ *
+ *      So that we don't spend too much time processing events in the 
+ *      Interrupt Service routine, we will declare a work queue per Card 
+ *      and make the ISR schedule a task in the queue for later execution.
+ *      In the 2.4 Kernel we used to use the immediate queue for BH's
+ *      Now that they are gone, tasklets seem to be much better than work 
+ *      queues.
+ */
+
+static void do_bottom_half_tx(struct fst_card_info *card);
+static void do_bottom_half_rx(struct fst_card_info *card);
+static void fst_process_tx_work_q(unsigned long work_q);
+static void fst_process_int_work_q(unsigned long work_q);
+
+DECLARE_TASKLET(fst_tx_task, fst_process_tx_work_q, 0);
+DECLARE_TASKLET(fst_int_task, fst_process_int_work_q, 0);
+
+struct fst_card_info *fst_card_array[FST_MAX_CARDS];
+spinlock_t fst_work_q_lock;
+u64 fst_work_txq;
+u64 fst_work_intq;
+
+static void
+fst_q_work_item(u64 * queue, int card_index)
+{
+	unsigned long flags;
+	u64 mask;
+
+	/*
+	 * Grab the queue exclusively
+	 */
+	spin_lock_irqsave(&fst_work_q_lock, flags);
+
+	/*
+	 * Making an entry in the queue is simply a matter of setting
+	 * a bit for the card indicating that there is work to do in the
+	 * bottom half for the card.  Note the limitation of 64 cards.
+	 * That ought to be enough
+	 */
+	mask = 1 << card_index;
+	*queue |= mask;
+	spin_unlock_irqrestore(&fst_work_q_lock, flags);
+}
+
+static void
+fst_process_tx_work_q(unsigned long /*void **/work_q)
+{
+	unsigned long flags;
+	u64 work_txq;
+	int i;
 
+	/*
+	 * Grab the queue exclusively
+	 */
+	dbg(DBG_TX, "fst_process_tx_work_q\n");
+	spin_lock_irqsave(&fst_work_q_lock, flags);
+	work_txq = fst_work_txq;
+	fst_work_txq = 0;
+	spin_unlock_irqrestore(&fst_work_q_lock, flags);
+
+	/*
+	 * Call the bottom half for each card with work waiting
+	 */
+	for (i = 0; i < FST_MAX_CARDS; i++) {
+		if (work_txq & 0x01) {
+			if (fst_card_array[i] != NULL) {
+				dbg(DBG_TX, "Calling tx bh for card %d\n", i);
+				do_bottom_half_tx(fst_card_array[i]);
+			}
+		}
+		work_txq = work_txq >> 1;
+	}
+}
+
+static void
+fst_process_int_work_q(unsigned long /*void **/work_q)
+{
+	unsigned long flags;
+	u64 work_intq;
+	int i;
+
+	/*
+	 * Grab the queue exclusively
+	 */
+	dbg(DBG_INTR, "fst_process_int_work_q\n");
+	spin_lock_irqsave(&fst_work_q_lock, flags);
+	work_intq = fst_work_intq;
+	fst_work_intq = 0;
+	spin_unlock_irqrestore(&fst_work_q_lock, flags);
+
+	/*
+	 * Call the bottom half for each card with work waiting
+	 */
+	for (i = 0; i < FST_MAX_CARDS; i++) {
+		if (work_intq & 0x01) {
+			if (fst_card_array[i] != NULL) {
+				dbg(DBG_INTR,
+				    "Calling rx & tx bh for card %d\n", i);
+				do_bottom_half_rx(fst_card_array[i]);
+				do_bottom_half_tx(fst_card_array[i]);
+			}
+		}
+		work_intq = work_intq >> 1;
+	}
+}
 
 /*      Card control functions
  *      ======================
@@ -432,1005 +671,1725 @@ MODULE_DEVICE_TABLE ( pci, fst_pci_dev_id );
  * Used to be a simple write to card control space but a glitch in the latest
  * AMD Am186CH processor means that we now have to do it by asserting and de-
  * asserting the PLX chip PCI Adapter Software Reset. Bit 30 in CNTRL register
- * at offset 0x50.
+ * at offset 9052_CNTRL.  Note the updates for the TXU.
  */
 static inline void
-fst_cpureset ( struct fst_card_info *card )
+fst_cpureset(struct fst_card_info *card)
 {
-        unsigned int regval;
+	unsigned char interrupt_line_register;
+	unsigned long j = jiffies + 1;
+	unsigned int regval;
+
+	if (card->family == FST_FAMILY_TXU) {
+		if (pci_read_config_byte
+		    (card->device, PCI_INTERRUPT_LINE, &interrupt_line_register)) {
+			dbg(DBG_ASS,
+			    "Error in reading interrupt line register\n");
+		}
+		/*
+		 * Assert PLX software reset and Am186 hardware reset
+		 * and then deassert the PLX software reset but 186 still in reset
+		 */
+		outw(0x440f, card->pci_conf + CNTRL_9054 + 2);
+		outw(0x040f, card->pci_conf + CNTRL_9054 + 2);
+		/*
+		 * We are delaying here to allow the 9054 to reset itself
+		 */
+		j = jiffies + 1;
+		while (jiffies < j)
+			/* Do nothing */ ;
+		outw(0x240f, card->pci_conf + CNTRL_9054 + 2);
+		/*
+		 * We are delaying here to allow the 9054 to reload its eeprom
+		 */
+		j = jiffies + 1;
+		while (jiffies < j)
+			/* Do nothing */ ;
+		outw(0x040f, card->pci_conf + CNTRL_9054 + 2);
+
+		if (pci_write_config_byte
+		    (card->device, PCI_INTERRUPT_LINE, interrupt_line_register)) {
+			dbg(DBG_ASS,
+			    "Error in writing interrupt line register\n");
+		}
 
-        regval = inl ( card->pci_conf + 0x50 );
+	} else {
+		regval = inl(card->pci_conf + CNTRL_9052);
 
-        outl ( regval |  0x40000000, card->pci_conf + 0x50 );
-        outl ( regval & ~0x40000000, card->pci_conf + 0x50 );
+		outl(regval | 0x40000000, card->pci_conf + CNTRL_9052);
+		outl(regval & ~0x40000000, card->pci_conf + CNTRL_9052);
+	}
 }
 
 /*      Release the processor from reset
  */
 static inline void
-fst_cpurelease ( struct fst_card_info *card )
+fst_cpurelease(struct fst_card_info *card)
 {
-        (void) readb ( card->ctlmem );
+	if (card->family == FST_FAMILY_TXU) {
+		/*
+		 * Force posted writes to complete
+		 */
+		(void) readb(card->mem);
+
+		/*
+		 * Release LRESET DO = 1
+		 * Then release Local Hold, DO = 1
+		 */
+		outw(0x040e, card->pci_conf + CNTRL_9054 + 2);
+		outw(0x040f, card->pci_conf + CNTRL_9054 + 2);
+	} else {
+		(void) readb(card->ctlmem);
+	}
 }
 
 /*      Clear the cards interrupt flag
  */
 static inline void
-fst_clear_intr ( struct fst_card_info *card )
+fst_clear_intr(struct fst_card_info *card)
 {
-        /* Poke the appropriate PLX chip register (same as enabling interrupts)
-         */
-        outw ( 0x0543, card->pci_conf + 0x4C );
+	if (card->family == FST_FAMILY_TXU) {
+		(void) readb(card->ctlmem);
+	} else {
+		/* Poke the appropriate PLX chip register (same as enabling interrupts)
+		 */
+		outw(0x0543, card->pci_conf + INTCSR_9052);
+	}
+}
+
+/*      Enable card interrupts
+ */
+static inline void
+fst_enable_intr(struct fst_card_info *card)
+{
+	if (card->family == FST_FAMILY_TXU) {
+		outl(0x0f0c0900, card->pci_conf + INTCSR_9054);
+	} else {
+		outw(0x0543, card->pci_conf + INTCSR_9052);
+	}
 }
 
 /*      Disable card interrupts
  */
 static inline void
-fst_disable_intr ( struct fst_card_info *card )
+fst_disable_intr(struct fst_card_info *card)
+{
+	if (card->family == FST_FAMILY_TXU) {
+		outl(0x00000000, card->pci_conf + INTCSR_9054);
+	} else {
+		outw(0x0000, card->pci_conf + INTCSR_9052);
+	}
+}
+
+/*      Process the result of trying to pass a recieved frame up the stack
+ */
+static void
+fst_process_rx_status(int rx_status, char *name)
+{
+	switch (rx_status) {
+	case NET_RX_SUCCESS:
+		{
+			/*
+			 * Nothing to do here
+			 */
+			break;
+		}
+
+	case NET_RX_CN_LOW:
+		{
+			dbg(DBG_ASS, "%s: Receive Low Congestion\n", name);
+			break;
+		}
+
+	case NET_RX_CN_MOD:
+		{
+			dbg(DBG_ASS, "%s: Receive Moderate Congestion\n", name);
+			break;
+		}
+
+	case NET_RX_CN_HIGH:
+		{
+			dbg(DBG_ASS, "%s: Receive High Congestion\n", name);
+			break;
+		}
+
+	case NET_RX_DROP:
+		{
+			dbg(DBG_ASS, "%s: Received packet dropped\n", name);
+			break;
+		}
+	}
+}
+
+/*      Initilaise DMA for PLX 9054
+ */
+static inline void
+fst_init_dma(struct fst_card_info *card)
 {
-        outw ( 0x0000, card->pci_conf + 0x4C );
+	/*
+	 * This is only required for the PLX 9054
+	 */
+	if (card->family == FST_FAMILY_TXU) {
+	        pci_set_master(card->device);
+		outl(0x00020441, card->pci_conf + DMAMODE0);
+		outl(0x00020441, card->pci_conf + DMAMODE1);
+		outl(0x0, card->pci_conf + DMATHR);
+	}
 }
 
+/*      Tx dma complete interrupt
+ */
+static void
+fst_tx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
+		    int len, int txpos)
+{
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
+
+	/*
+	 * Everything is now set, just tell the card to go
+	 */
+	dbg(DBG_TX, "fst_tx_dma_complete\n");
+	FST_WRB(card, txDescrRing[port->index][txpos].bits,
+		DMA_OWN | TX_STP | TX_ENP);
+	stats->tx_packets++;
+	stats->tx_bytes += len;
+	dev->trans_start = jiffies;
+}
+
+/*      Rx dma complete interrupt
+ */
+static void
+fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
+		    int len, struct sk_buff *skb, int rxp)
+{
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
+	int pi;
+	int rx_status;
+
+	dbg(DBG_TX, "fst_rx_dma_complete\n");
+	pi = port->index;
+	memcpy(skb_put(skb, len), card->rx_dma_handle_host, len);
+
+	/* Reset buffer descriptor */
+	FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
+
+	/* Update stats */
+	stats->rx_packets++;
+	stats->rx_bytes += len;
+
+	/* Push upstream */
+	dbg(DBG_RX, "Pushing the frame up the stack\n");
+	skb->mac.raw = skb->data;
+	skb->dev = dev;
+	if (port->mode == FST_RAW) {
+		/*
+		 * Mark it for our own raw sockets interface
+		 */
+		skb->protocol = htons(ETH_P_CUST);
+		skb->pkt_type = PACKET_HOST;
+	} else {
+		skb->protocol = hdlc_type_trans(skb, skb->dev);
+	}
+	rx_status = netif_rx(skb);
+	fst_process_rx_status(rx_status, port_to_dev(port)->name);
+	if (rx_status == NET_RX_DROP)
+		stats->rx_dropped++;
+	dev->last_rx = jiffies;
+}
+
+/*
+ *      Receive a frame through the DMA
+ */
+static inline void
+fst_rx_dma(struct fst_card_info *card, unsigned char *skb,
+	   unsigned char *mem, int len)
+{
+	/*
+	 * This routine will setup the DMA and start it
+	 */
+
+	dbg(DBG_RX, "In fst_rx_dma %p %p %d\n", skb, mem, len);
+	if (card->dmarx_in_progress) {
+		dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n");
+	}
+
+	outl((unsigned long) skb, card->pci_conf + DMAPADR0);	/* Copy to here */
+	outl((unsigned long) mem, card->pci_conf + DMALADR0);	/* from here */
+	outl(len, card->pci_conf + DMASIZ0);	/* for this length */
+	outl(0x00000000c, card->pci_conf + DMADPR0);	/* In this direction */
+
+	/*
+	 * We use the dmarx_in_progress flag to flag the channel as busy
+	 */
+	card->dmarx_in_progress = 1;
+	outb(0x03, card->pci_conf + DMACSR0);	/* Start the transfer */
+}
+
+/*
+ *      Send a frame through the DMA
+ */
+static inline void
+fst_tx_dma(struct fst_card_info *card, unsigned char *skb,
+	   unsigned char *mem, int len)
+{
+	/*
+	 * This routine will setup the DMA and start it.
+	 */
+
+	dbg(DBG_TX, "In fst_tx_dma %p %p %d\n", skb, mem, len);
+	if (card->dmatx_in_progress) {
+		dbg(DBG_ASS, "In fst_tx_dma while dma in progress\n");
+	}
+
+	outl((unsigned long) skb, card->pci_conf + DMAPADR1);	/* Copy from here */
+	outl((unsigned long) mem, card->pci_conf + DMALADR1);	/* to here */
+	outl(len, card->pci_conf + DMASIZ1);	/* for this length */
+	outl(0x000000004, card->pci_conf + DMADPR1);	/* In this direction */
+
+	/*
+	 * We use the dmatx_in_progress to flag the channel as busy
+	 */
+	card->dmatx_in_progress = 1;
+	outb(0x03, card->pci_conf + DMACSR1);	/* Start the transfer */
+}
 
 /*      Issue a Mailbox command for a port.
  *      Note we issue them on a fire and forget basis, not expecting to see an
  *      error and not waiting for completion.
  */
 static void
-fst_issue_cmd ( struct fst_port_info *port, unsigned short cmd )
+fst_issue_cmd(struct fst_port_info *port, unsigned short cmd)
 {
-        struct fst_card_info *card;
-        unsigned short mbval;
-        unsigned long flags;
-        int safety;
-
-        card = port->card;
-        spin_lock_irqsave ( &card->card_lock, flags );
-        mbval = FST_RDW ( card, portMailbox[port->index][0]);
-
-        safety = 0;
-        /* Wait for any previous command to complete */
-        while ( mbval > NAK )
-        {
-                spin_unlock_irqrestore ( &card->card_lock, flags );
-                schedule_timeout ( 1 );
-                spin_lock_irqsave ( &card->card_lock, flags );
-
-                if ( ++safety > 1000 )
-                {
-                        printk_err ("Mailbox safety timeout\n");
-                        break;
-                }
+	struct fst_card_info *card;
+	unsigned short mbval;
+	unsigned long flags;
+	int safety;
+
+	card = port->card;
+	spin_lock_irqsave(&card->card_lock, flags);
+	mbval = FST_RDW(card, portMailbox[port->index][0]);
+
+	safety = 0;
+	/* Wait for any previous command to complete */
+	while (mbval > NAK) {
+		spin_unlock_irqrestore(&card->card_lock, flags);
+		schedule_timeout(1);
+		spin_lock_irqsave(&card->card_lock, flags);
+
+		if (++safety > 2000) {
+			printk_err("Mailbox safety timeout\n");
+			break;
+		}
 
-                mbval = FST_RDW ( card, portMailbox[port->index][0]);
-        }
-        if ( safety > 0 )
-        {
-                dbg ( DBG_CMD,"Mailbox clear after %d jiffies\n", safety );
-        }
-        if ( mbval == NAK )
-        {
-                dbg ( DBG_CMD,"issue_cmd: previous command was NAK'd\n");
-        }
-
-        FST_WRW ( card, portMailbox[port->index][0], cmd );
-
-        if ( cmd == ABORTTX || cmd == STARTPORT )
-        {
-                port->txpos  = 0;
-                port->txipos = 0;
-                port->txcnt  = 0;
-        }
-
-        spin_unlock_irqrestore ( &card->card_lock, flags );
-}
+		mbval = FST_RDW(card, portMailbox[port->index][0]);
+	}
+	if (safety > 0) {
+		dbg(DBG_CMD, "Mailbox clear after %d jiffies\n", safety);
+	}
+	if (mbval == NAK) {
+		dbg(DBG_CMD, "issue_cmd: previous command was NAK'd\n");
+	}
+
+	FST_WRW(card, portMailbox[port->index][0], cmd);
+
+	if (cmd == ABORTTX || cmd == STARTPORT) {
+		port->txpos = 0;
+		port->txipos = 0;
+		port->start = 0;
+	}
 
+	spin_unlock_irqrestore(&card->card_lock, flags);
+}
 
 /*      Port output signals control
  */
 static inline void
-fst_op_raise ( struct fst_port_info *port, unsigned int outputs )
+fst_op_raise(struct fst_port_info *port, unsigned int outputs)
 {
-        outputs |= FST_RDL ( port->card, v24OpSts[port->index]);
-        FST_WRL ( port->card, v24OpSts[port->index], outputs );
+	outputs |= FST_RDL(port->card, v24OpSts[port->index]);
+	FST_WRL(port->card, v24OpSts[port->index], outputs);
 
-        if ( port->run )
-                fst_issue_cmd ( port, SETV24O );
+	if (port->run)
+		fst_issue_cmd(port, SETV24O);
 }
 
 static inline void
-fst_op_lower ( struct fst_port_info *port, unsigned int outputs )
+fst_op_lower(struct fst_port_info *port, unsigned int outputs)
 {
-        outputs = ~outputs & FST_RDL ( port->card, v24OpSts[port->index]);
-        FST_WRL ( port->card, v24OpSts[port->index], outputs );
+	outputs = ~outputs & FST_RDL(port->card, v24OpSts[port->index]);
+	FST_WRL(port->card, v24OpSts[port->index], outputs);
 
-        if ( port->run )
-                fst_issue_cmd ( port, SETV24O );
+	if (port->run)
+		fst_issue_cmd(port, SETV24O);
 }
 
-
 /*
  *      Setup port Rx buffers
  */
 static void
-fst_rx_config ( struct fst_port_info *port )
+fst_rx_config(struct fst_port_info *port)
 {
-        int i;
-        int pi;
-        unsigned int offset;
-        unsigned long flags;
-        struct fst_card_info *card;
-
-        pi   = port->index;
-        card = port->card;
-        spin_lock_irqsave ( &card->card_lock, flags );
-        for ( i = 0 ; i < NUM_RX_BUFFER ; i++ )
-        {
-                offset = BUF_OFFSET ( rxBuffer[pi][i][0]);
-
-                FST_WRW ( card, rxDescrRing[pi][i].ladr, (u16) offset );
-                FST_WRB ( card, rxDescrRing[pi][i].hadr, (u8)( offset >> 16 ));
-                FST_WRW ( card, rxDescrRing[pi][i].bcnt,
-                                        cnv_bcnt ( LEN_RX_BUFFER ));
-                FST_WRW ( card, rxDescrRing[pi][i].mcnt, 0 );
-                FST_WRB ( card, rxDescrRing[pi][i].bits, DMA_OWN );
-        }
-        port->rxpos  = 0;
-        spin_unlock_irqrestore ( &card->card_lock, flags );
+	int i;
+	int pi;
+	unsigned int offset;
+	unsigned long flags;
+	struct fst_card_info *card;
+
+	pi = port->index;
+	card = port->card;
+	spin_lock_irqsave(&card->card_lock, flags);
+	for (i = 0; i < NUM_RX_BUFFER; i++) {
+		offset = BUF_OFFSET(rxBuffer[pi][i][0]);
+
+		FST_WRW(card, rxDescrRing[pi][i].ladr, (u16) offset);
+		FST_WRB(card, rxDescrRing[pi][i].hadr, (u8) (offset >> 16));
+		FST_WRW(card, rxDescrRing[pi][i].bcnt, cnv_bcnt(LEN_RX_BUFFER));
+		FST_WRW(card, rxDescrRing[pi][i].mcnt, LEN_RX_BUFFER);
+		FST_WRB(card, rxDescrRing[pi][i].bits, DMA_OWN);
+	}
+	port->rxpos = 0;
+	spin_unlock_irqrestore(&card->card_lock, flags);
 }
 
-
 /*
  *      Setup port Tx buffers
  */
 static void
-fst_tx_config ( struct fst_port_info *port )
+fst_tx_config(struct fst_port_info *port)
 {
-        int i;
-        int pi;
-        unsigned int offset;
-        unsigned long flags;
-        struct fst_card_info *card;
-
-        pi   = port->index;
-        card = port->card;
-        spin_lock_irqsave ( &card->card_lock, flags );
-        for ( i = 0 ; i < NUM_TX_BUFFER ; i++ )
-        {
-                offset = BUF_OFFSET ( txBuffer[pi][i][0]);
-
-                FST_WRW ( card, txDescrRing[pi][i].ladr, (u16) offset );
-                FST_WRB ( card, txDescrRing[pi][i].hadr, (u8)( offset >> 16 ));
-                FST_WRW ( card, txDescrRing[pi][i].bcnt, 0 );
-                FST_WRB ( card, txDescrRing[pi][i].bits, 0 );
-        }
-        port->txpos  = 0;
-        port->txipos = 0;
-        port->txcnt  = 0;
-        spin_unlock_irqrestore ( &card->card_lock, flags );
+	int i;
+	int pi;
+	unsigned int offset;
+	unsigned long flags;
+	struct fst_card_info *card;
+
+	pi = port->index;
+	card = port->card;
+	spin_lock_irqsave(&card->card_lock, flags);
+	for (i = 0; i < NUM_TX_BUFFER; i++) {
+		offset = BUF_OFFSET(txBuffer[pi][i][0]);
+
+		FST_WRW(card, txDescrRing[pi][i].ladr, (u16) offset);
+		FST_WRB(card, txDescrRing[pi][i].hadr, (u8) (offset >> 16));
+		FST_WRW(card, txDescrRing[pi][i].bcnt, 0);
+		FST_WRB(card, txDescrRing[pi][i].bits, 0);
+	}
+	port->txpos = 0;
+	port->txipos = 0;
+	port->start = 0;
+	spin_unlock_irqrestore(&card->card_lock, flags);
 }
 
+/*      TE1 Alarm change interrupt event
+ */
+static void
+fst_intr_te1_alarm(struct fst_card_info *card, struct fst_port_info *port)
+{
+	u8 los;
+	u8 rra;
+	u8 ais;
+
+	los = FST_RDB(card, suStatus.lossOfSignal);
+	rra = FST_RDB(card, suStatus.receiveRemoteAlarm);
+	ais = FST_RDB(card, suStatus.alarmIndicationSignal);
+
+	if (los) {
+		/*
+		 * Lost the link
+		 */
+		if (netif_carrier_ok(port_to_dev(port))) {
+			dbg(DBG_INTR, "Net carrier off\n");
+			netif_carrier_off(port_to_dev(port));
+		}
+	} else {
+		/*
+		 * Link available
+		 */
+		if (!netif_carrier_ok(port_to_dev(port))) {
+			dbg(DBG_INTR, "Net carrier on\n");
+			netif_carrier_on(port_to_dev(port));
+		}
+	}
+
+	if (los)
+		dbg(DBG_INTR, "Assert LOS Alarm\n");
+	else
+		dbg(DBG_INTR, "De-assert LOS Alarm\n");
+	if (rra)
+		dbg(DBG_INTR, "Assert RRA Alarm\n");
+	else
+		dbg(DBG_INTR, "De-assert RRA Alarm\n");
+
+	if (ais)
+		dbg(DBG_INTR, "Assert AIS Alarm\n");
+	else
+		dbg(DBG_INTR, "De-assert AIS Alarm\n");
+}
 
 /*      Control signal change interrupt event
  */
-static irqreturn_t
-fst_intr_ctlchg ( struct fst_card_info *card, struct fst_port_info *port )
+static void
+fst_intr_ctlchg(struct fst_card_info *card, struct fst_port_info *port)
 {
-        int signals;
+	int signals;
 
-        signals = FST_RDL ( card, v24DebouncedSts[port->index]);
+	signals = FST_RDL(card, v24DebouncedSts[port->index]);
 
-        if ( signals & (( port->hwif == X21 ) ? IPSTS_INDICATE : IPSTS_DCD ))
-        {
-                if ( ! netif_carrier_ok ( port_to_dev ( port )))
-                {
-                        dbg ( DBG_INTR,"DCD active\n");
-                        netif_carrier_on ( port_to_dev ( port ));
-                }
-        }
-        else
-        {
-                if ( netif_carrier_ok ( port_to_dev ( port )))
-                {
-                        dbg ( DBG_INTR,"DCD lost\n");
-                        netif_carrier_off ( port_to_dev ( port ));
-                }
-        }
-	return IRQ_HANDLED;
+	if (signals & (((port->hwif == X21) || (port->hwif == X21D))
+		       ? IPSTS_INDICATE : IPSTS_DCD)) {
+		if (!netif_carrier_ok(port_to_dev(port))) {
+			dbg(DBG_INTR, "DCD active\n");
+			netif_carrier_on(port_to_dev(port));
+		}
+	} else {
+		if (netif_carrier_ok(port_to_dev(port))) {
+			dbg(DBG_INTR, "DCD lost\n");
+			netif_carrier_off(port_to_dev(port));
+		}
+	}
+}
+
+/*      Log Rx Errors
+ */
+static void
+fst_log_rx_error(struct fst_card_info *card, struct fst_port_info *port,
+		 unsigned char dmabits, int rxp, unsigned short len)
+{
+	struct net_device *dev = port_to_dev(port);
+	struct net_device_stats *stats = hdlc_stats(dev);
+
+	/* 
+	 * Increment the appropriate error counter
+	 */
+	stats->rx_errors++;
+	if (dmabits & RX_OFLO) {
+		stats->rx_fifo_errors++;
+		dbg(DBG_ASS, "Rx fifo error on card %d port %d buffer %d\n",
+		    card->card_no, port->index, rxp);
+	}
+	if (dmabits & RX_CRC) {
+		stats->rx_crc_errors++;
+		dbg(DBG_ASS, "Rx crc error on card %d port %d\n",
+		    card->card_no, port->index);
+	}
+	if (dmabits & RX_FRAM) {
+		stats->rx_frame_errors++;
+		dbg(DBG_ASS, "Rx frame error on card %d port %d\n",
+		    card->card_no, port->index);
+	}
+	if (dmabits == (RX_STP | RX_ENP)) {
+		stats->rx_length_errors++;
+		dbg(DBG_ASS, "Rx length error (%d) on card %d port %d\n",
+		    len, card->card_no, port->index);
+	}
 }
 
+/*      Rx Error Recovery
+ */
+static void
+fst_recover_rx_error(struct fst_card_info *card, struct fst_port_info *port,
+		     unsigned char dmabits, int rxp, unsigned short len)
+{
+	int i;
+	int pi;
+
+	pi = port->index;
+	/* 
+	 * Discard buffer descriptors until we see the start of the
+	 * next frame.  Note that for long frames this could be in
+	 * a subsequent interrupt. 
+	 */
+	i = 0;
+	while ((dmabits & (DMA_OWN | RX_STP)) == 0) {
+		FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
+		rxp = (rxp+1) % NUM_RX_BUFFER;
+		if (++i > NUM_RX_BUFFER) {
+			dbg(DBG_ASS, "intr_rx: Discarding more bufs"
+			    " than we have\n");
+			break;
+		}
+		dmabits = FST_RDB(card, rxDescrRing[pi][rxp].bits);
+		dbg(DBG_ASS, "DMA Bits of next buffer was %x\n", dmabits);
+	}
+	dbg(DBG_ASS, "There were %d subsequent buffers in error\n", i);
+
+	/* Discard the terminal buffer */
+	if (!(dmabits & DMA_OWN)) {
+		FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
+		rxp = (rxp+1) % NUM_RX_BUFFER;
+	}
+	port->rxpos = rxp;
+	return;
+
+}
 
 /*      Rx complete interrupt
  */
 static void
-fst_intr_rx ( struct fst_card_info *card, struct fst_port_info *port )
+fst_intr_rx(struct fst_card_info *card, struct fst_port_info *port)
 {
-        unsigned char dmabits;
-        int pi;
-        int rxp;
-        unsigned short len;
-        struct sk_buff *skb;
+	unsigned char dmabits;
+	int pi;
+	int rxp;
+	int rx_status;
+	unsigned short len;
+	struct sk_buff *skb;
 	struct net_device *dev = port_to_dev(port);
 	struct net_device_stats *stats = hdlc_stats(dev);
-        int i;
-
-
-        /* Check we have a buffer to process */
-        pi  = port->index;
-        rxp = port->rxpos;
-        dmabits = FST_RDB ( card, rxDescrRing[pi][rxp].bits );
-        if ( dmabits & DMA_OWN )
-        {
-                dbg ( DBG_RX | DBG_INTR,"intr_rx: No buffer port %d pos %d\n",
-                                        pi, rxp );
-                return;
-        }
-
-        /* Get buffer length */
-        len = FST_RDW ( card, rxDescrRing[pi][rxp].mcnt );
-        /* Discard the CRC */
-        len -= 2;
-
-        /* Check buffer length and for other errors. We insist on one packet
-         * in one buffer. This simplifies things greatly and since we've
-         * allocated 8K it shouldn't be a real world limitation
-         */
-        dbg ( DBG_RX,"intr_rx: %d,%d: flags %x len %d\n", pi, rxp, dmabits,
-                                        len );
-        if ( dmabits != ( RX_STP | RX_ENP ) || len > LEN_RX_BUFFER - 2 )
-        {
-                stats->rx_errors++;
-
-                /* Update error stats and discard buffer */
-                if ( dmabits & RX_OFLO )
-                {
-                        stats->rx_fifo_errors++;
-                }
-                if ( dmabits & RX_CRC )
-                {
-                        stats->rx_crc_errors++;
-                }
-                if ( dmabits & RX_FRAM )
-                {
-                        stats->rx_frame_errors++;
-                }
-                if ( dmabits == ( RX_STP | RX_ENP ))
-                {
-                        stats->rx_length_errors++;
-                }
 
-                /* Discard buffer descriptors until we see the end of packet
-                 * marker
-                 */
-                i = 0;
-                while (( dmabits & ( DMA_OWN | RX_ENP )) == 0 )
-                {
-                        FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );
-                        if ( ++rxp >= NUM_RX_BUFFER )
-                                rxp = 0;
-                        if ( ++i > NUM_RX_BUFFER )
-                        {
-                                dbg ( DBG_ASS,"intr_rx: Discarding more bufs"
-                                                " than we have\n");
-                                break;
-                        }
-                        dmabits = FST_RDB ( card, rxDescrRing[pi][rxp].bits );
-                }
+	/* Check we have a buffer to process */
+	pi = port->index;
+	rxp = port->rxpos;
+	dmabits = FST_RDB(card, rxDescrRing[pi][rxp].bits);
+	if (dmabits & DMA_OWN) {
+		dbg(DBG_RX | DBG_INTR, "intr_rx: No buffer port %d pos %d\n",
+		    pi, rxp);
+		return;
+	}
+	if (card->dmarx_in_progress) {
+		return;
+	}
 
-                /* Discard the terminal buffer */
-                if ( ! ( dmabits & DMA_OWN ))
-                {
-                        FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );
-                        if ( ++rxp >= NUM_RX_BUFFER )
-                                rxp = 0;
-                }
-                port->rxpos = rxp;
-                return;
-        }
-
-        /* Allocate SKB */
-        if (( skb = dev_alloc_skb ( len )) == NULL )
-        {
-                dbg ( DBG_RX,"intr_rx: can't allocate buffer\n");
-
-                stats->rx_dropped++;
-
-                /* Return descriptor to card */
-                FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );
-
-                if ( ++rxp >= NUM_RX_BUFFER )
-                        port->rxpos = 0;
-                else
-                        port->rxpos = rxp;
-                return;
-        }
-
-        memcpy_fromio ( skb_put ( skb, len ),
-                                card->mem + BUF_OFFSET ( rxBuffer[pi][rxp][0]),
-                                len );
-
-        /* Reset buffer descriptor */
-        FST_WRB ( card, rxDescrRing[pi][rxp].bits, DMA_OWN );
-        if ( ++rxp >= NUM_RX_BUFFER )
-                port->rxpos = 0;
-        else
-                port->rxpos = rxp;
-
-        /* Update stats */
-        stats->rx_packets++;
-        stats->rx_bytes += len;
-
-        /* Push upstream */
-        skb->mac.raw = skb->data;
-        skb->dev = dev;
-        skb->protocol = hdlc_type_trans(skb, skb->dev);
-        netif_rx ( skb );
-
-        dev->last_rx = jiffies;
+	/* Get buffer length */
+	len = FST_RDW(card, rxDescrRing[pi][rxp].mcnt);
+	/* Discard the CRC */
+	len -= 2;
+	if (len == 0) {
+		/*
+		 * This seems to happen on the TE1 interface sometimes
+		 * so throw the frame away and log the event.
+		 */
+		printk_err("Frame received with 0 length. Card %d Port %d\n",
+			   card->card_no, port->index);
+		/* Return descriptor to card */
+		FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
+
+		rxp = (rxp+1) % NUM_RX_BUFFER;
+		port->rxpos = rxp;
+		return;
+	}
+
+	/* Check buffer length and for other errors. We insist on one packet
+	 * in one buffer. This simplifies things greatly and since we've
+	 * allocated 8K it shouldn't be a real world limitation
+	 */
+	dbg(DBG_RX, "intr_rx: %d,%d: flags %x len %d\n", pi, rxp, dmabits, len);
+	if (dmabits != (RX_STP | RX_ENP) || len > LEN_RX_BUFFER - 2) {
+		fst_log_rx_error(card, port, dmabits, rxp, len);
+		fst_recover_rx_error(card, port, dmabits, rxp, len);
+		return;
+	}
+
+	/* Allocate SKB */
+	if ((skb = dev_alloc_skb(len)) == NULL) {
+		dbg(DBG_RX, "intr_rx: can't allocate buffer\n");
+
+		stats->rx_dropped++;
+
+		/* Return descriptor to card */
+		FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
+
+		rxp = (rxp+1) % NUM_RX_BUFFER;
+		port->rxpos = rxp;
+		return;
+	}
+
+	/*
+	 * We know the length we need to receive, len.
+	 * It's not worth using the DMA for reads of less than
+	 * FST_MIN_DMA_LEN
+	 */
+
+	if ((len < FST_MIN_DMA_LEN) || (card->family == FST_FAMILY_TXP)) {
+		memcpy_fromio(skb_put(skb, len),
+			      card->mem + BUF_OFFSET(rxBuffer[pi][rxp][0]),
+			      len);
+
+		/* Reset buffer descriptor */
+		FST_WRB(card, rxDescrRing[pi][rxp].bits, DMA_OWN);
+
+		/* Update stats */
+		stats->rx_packets++;
+		stats->rx_bytes += len;
+
+		/* Push upstream */
+		dbg(DBG_RX, "Pushing frame up the stack\n");
+		skb->mac.raw = skb->data;
+		skb->dev = dev;
+		if (port->mode == FST_RAW) {
+			/*
+			 * Mark it for our own raw sockets interface
+			 */
+			skb->protocol = htons(ETH_P_CUST);
+			skb->pkt_type = PACKET_HOST;
+		} else {
+			skb->protocol = hdlc_type_trans(skb, skb->dev);
+		}
+		rx_status = netif_rx(skb);
+		fst_process_rx_status(rx_status, port_to_dev(port)->name);
+		if (rx_status == NET_RX_DROP) {
+			stats->rx_dropped++;
+		}
+		dev->last_rx = jiffies;
+	} else {
+		card->dma_skb_rx = skb;
+		card->dma_port_rx = port;
+		card->dma_len_rx = len;
+		card->dma_rxpos = rxp;
+		fst_rx_dma(card, (char *) card->rx_dma_handle_card,
+			   (char *) BUF_OFFSET(rxBuffer[pi][rxp][0]), len);
+	}
+	if (rxp != port->rxpos) {
+		dbg(DBG_ASS, "About to increment rxpos by more than 1\n");
+		dbg(DBG_ASS, "rxp = %d rxpos = %d\n", rxp, port->rxpos);
+	}
+	rxp = (rxp+1) % NUM_RX_BUFFER;
+	port->rxpos = rxp;
 }
 
+/*
+ *      The bottom halfs to the ISR
+ *
+ */
+
+static void
+do_bottom_half_tx(struct fst_card_info *card)
+{
+	struct fst_port_info *port;
+	int pi;
+	int txq_length;
+	struct sk_buff *skb;
+	unsigned long flags;
+	struct net_device *dev;
+	struct net_device_stats *stats;
+
+	/*
+	 *  Find a free buffer for the transmit
+	 *  Step through each port on this card
+	 */
+
+	dbg(DBG_TX, "do_bottom_half_tx\n");
+	for (pi = 0, port = card->ports; pi < card->nports; pi++, port++) {
+		if (!port->run)
+			continue;
+
+                dev = port_to_dev(port);
+                stats = hdlc_stats(dev);
+		while (!
+		       (FST_RDB(card, txDescrRing[pi][port->txpos].bits) &
+			DMA_OWN)
+                       && !(card->dmatx_in_progress)) {
+			/*
+			 * There doesn't seem to be a txdone event per-se
+			 * We seem to have to deduce it, by checking the DMA_OWN
+			 * bit on the next buffer we think we can use
+			 */
+			spin_lock_irqsave(&card->card_lock, flags);
+			if ((txq_length = port->txqe - port->txqs) < 0) {
+				/*
+				 * This is the case where one has wrapped and the
+				 * maths gives us a negative number
+				 */
+				txq_length = txq_length + FST_TXQ_DEPTH;
+			}
+			spin_unlock_irqrestore(&card->card_lock, flags);
+			if (txq_length > 0) {
+				/*
+				 * There is something to send
+				 */
+				spin_lock_irqsave(&card->card_lock, flags);
+				skb = port->txq[port->txqs];
+				port->txqs++;
+				if (port->txqs == FST_TXQ_DEPTH) {
+					port->txqs = 0;
+				}
+				spin_unlock_irqrestore(&card->card_lock, flags);
+				/*
+				 * copy the data and set the required indicators on the
+				 * card.
+				 */
+				FST_WRW(card, txDescrRing[pi][port->txpos].bcnt,
+					cnv_bcnt(skb->len));
+				if ((skb->len < FST_MIN_DMA_LEN)
+				    || (card->family == FST_FAMILY_TXP)) {
+					/* Enqueue the packet with normal io */
+					memcpy_toio(card->mem +
+						    BUF_OFFSET(txBuffer[pi]
+							       [port->
+								txpos][0]),
+						    skb->data, skb->len);
+					FST_WRB(card,
+						txDescrRing[pi][port->txpos].
+						bits,
+						DMA_OWN | TX_STP | TX_ENP);
+					stats->tx_packets++;
+					stats->tx_bytes += skb->len;
+					dev->trans_start = jiffies;
+				} else {
+					/* Or do it through dma */
+					memcpy(card->tx_dma_handle_host,
+					       skb->data, skb->len);
+					card->dma_port_tx = port;
+					card->dma_len_tx = skb->len;
+					card->dma_txpos = port->txpos;
+					fst_tx_dma(card,
+						   (char *) card->
+						   tx_dma_handle_card,
+						   (char *)
+						   BUF_OFFSET(txBuffer[pi]
+							      [port->txpos][0]),
+						   skb->len);
+				}
+				if (++port->txpos >= NUM_TX_BUFFER)
+					port->txpos = 0;
+				/*
+				 * If we have flow control on, can we now release it?
+				 */
+				if (port->start) {
+					if (txq_length < fst_txq_low) {
+						netif_wake_queue(port_to_dev
+								 (port));
+						port->start = 0;
+					}
+				}
+				dev_kfree_skb(skb);
+			} else {
+				/*
+				 * Nothing to send so break out of the while loop
+				 */
+				break;
+			}
+		}
+	}
+}
+
+static void
+do_bottom_half_rx(struct fst_card_info *card)
+{
+	struct fst_port_info *port;
+	int pi;
+	int rx_count = 0;
+
+	/* Check for rx completions on all ports on this card */
+	dbg(DBG_RX, "do_bottom_half_rx\n");
+	for (pi = 0, port = card->ports; pi < card->nports; pi++, port++) {
+		if (!port->run)
+			continue;
+
+		while (!(FST_RDB(card, rxDescrRing[pi][port->rxpos].bits)
+			 & DMA_OWN) && !(card->dmarx_in_progress)) {
+			if (rx_count > fst_max_reads) {
+				/*
+				 * Don't spend forever in receive processing
+				 * Schedule another event
+				 */
+				fst_q_work_item(&fst_work_intq, card->card_no);
+				tasklet_schedule(&fst_int_task);
+				break;	/* Leave the loop */
+			}
+			fst_intr_rx(card, port);
+			rx_count++;
+		}
+	}
+}
 
 /*
  *      The interrupt service routine
  *      Dev_id is our fst_card_info pointer
  */
-static irqreturn_t
-fst_intr ( int irq, void *dev_id, struct pt_regs *regs )
+irqreturn_t
+fst_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
-        struct fst_card_info *card;
-        struct fst_port_info *port;
-        int rdidx;                      /* Event buffer indices */
-        int wridx;
-        int event;                      /* Actual event for processing */
-        int pi;
-
-        if (( card = dev_id ) == NULL )
-        {
-                dbg ( DBG_INTR,"intr: spurious %d\n", irq );
-                return IRQ_NONE;
-        }
-
-        dbg ( DBG_INTR,"intr: %d %p\n", irq, card );
-
-        spin_lock ( &card->card_lock );
-
-        /* Clear and reprime the interrupt source */
-        fst_clear_intr ( card );
-
-        /* Set the software acknowledge */
-        FST_WRB ( card, interruptHandshake, 0xEE );
-
-        /* Drain the event queue */
-        rdidx = FST_RDB ( card, interruptEvent.rdindex );
-        wridx = FST_RDB ( card, interruptEvent.wrindex );
-        while ( rdidx != wridx )
-        {
-                event = FST_RDB ( card, interruptEvent.evntbuff[rdidx]);
-
-                port = &card->ports[event & 0x03];
-
-                dbg ( DBG_INTR,"intr: %x\n", event );
-
-                switch ( event )
-                {
-                case CTLA_CHG:
-                case CTLB_CHG:
-                case CTLC_CHG:
-                case CTLD_CHG:
-                        if ( port->run )
-                                fst_intr_ctlchg ( card, port );
-                        break;
-
-                case ABTA_SENT:
-                case ABTB_SENT:
-                case ABTC_SENT:
-                case ABTD_SENT:
-                        dbg ( DBG_TX,"Abort complete port %d\n", event & 0x03 );
-                        break;
-
-                case TXA_UNDF:
-                case TXB_UNDF:
-                case TXC_UNDF:
-                case TXD_UNDF:
-                        /* Difficult to see how we'd get this given that we
-                         * always load up the entire packet for DMA.
-                         */
-                        dbg ( DBG_TX,"Tx underflow port %d\n", event & 0x03 );
-                        hdlc_stats(port_to_dev(port))->tx_errors++;
-                        hdlc_stats(port_to_dev(port))->tx_fifo_errors++;
-                        break;
+	struct fst_card_info *card;
+	struct fst_port_info *port;
+	int rdidx;		/* Event buffer indices */
+	int wridx;
+	int event;		/* Actual event for processing */
+	unsigned int dma_intcsr = 0;
+	unsigned int do_card_interrupt;
+	unsigned int int_retry_count;
+
+	if ((card = dev_id) == NULL) {
+		dbg(DBG_INTR, "intr: spurious %d\n", irq);
+		return IRQ_NONE;
+	}
 
-                case INIT_CPLT:
-                        dbg ( DBG_INIT,"Card init OK intr\n");
-                        break;
+	/*
+	 * Check to see if the interrupt was for this card
+	 * return if not
+	 * Note that the call to clear the interrupt is important
+	 */
+	dbg(DBG_INTR, "intr: %d %p\n", irq, card);
+	if (card->state != FST_RUNNING) {
+		printk_err
+		    ("Interrupt received for card %d in a non running state (%d)\n",
+		     card->card_no, card->state);
+
+		/* 
+		 * It is possible to really be running, i.e. we have re-loaded
+		 * a running card
+		 * Clear and reprime the interrupt source 
+		 */
+		fst_clear_intr(card);
+		return IRQ_HANDLED;
+	}
 
-                case INIT_FAIL:
-                        dbg ( DBG_INIT,"Card init FAILED intr\n");
-                        card->state = FST_IFAILED;
-                        break;
+	/* Clear and reprime the interrupt source */
+	fst_clear_intr(card);
+
+	/*
+	 * Is the interrupt for this card (handshake == 1)
+	 */
+	do_card_interrupt = 0;
+	if (FST_RDB(card, interruptHandshake) == 1) {
+		do_card_interrupt += FST_CARD_INT;
+		/* Set the software acknowledge */
+		FST_WRB(card, interruptHandshake, 0xEE);
+	}
+	if (card->family == FST_FAMILY_TXU) {
+		/*
+		 * Is it a DMA Interrupt
+		 */
+		dma_intcsr = inl(card->pci_conf + INTCSR_9054);
+		if (dma_intcsr & 0x00200000) {
+			/*
+			 * DMA Channel 0 (Rx transfer complete)
+			 */
+			dbg(DBG_RX, "DMA Rx xfer complete\n");
+			outb(0x8, card->pci_conf + DMACSR0);
+			fst_rx_dma_complete(card, card->dma_port_rx,
+					    card->dma_len_rx, card->dma_skb_rx,
+					    card->dma_rxpos);
+			card->dmarx_in_progress = 0;
+			do_card_interrupt += FST_RX_DMA_INT;
+		}
+		if (dma_intcsr & 0x00400000) {
+			/*
+			 * DMA Channel 1 (Tx transfer complete)
+			 */
+			dbg(DBG_TX, "DMA Tx xfer complete\n");
+			outb(0x8, card->pci_conf + DMACSR1);
+			fst_tx_dma_complete(card, card->dma_port_tx,
+					    card->dma_len_tx, card->dma_txpos);
+			card->dmatx_in_progress = 0;
+			do_card_interrupt += FST_TX_DMA_INT;
+		}
+	}
 
-                default:
-                        printk_err ("intr: unknown card event code. ignored\n");
-                        break;
-                }
+	/*
+	 * Have we been missing Interrupts
+	 */
+	int_retry_count = FST_RDL(card, interruptRetryCount);
+	if (int_retry_count) {
+		dbg(DBG_ASS, "Card %d int_retry_count is  %d\n",
+		    card->card_no, int_retry_count);
+		FST_WRL(card, interruptRetryCount, 0);
+	}
 
-                /* Bump and wrap the index */
-                if ( ++rdidx >= MAX_CIRBUFF )
-                        rdidx = 0;
-        }
-        FST_WRB ( card, interruptEvent.rdindex, rdidx );
-
-        for ( pi = 0, port = card->ports ; pi < card->nports ; pi++, port++ )
-        {
-                if ( ! port->run )
-                        continue;
-
-                /* Check for rx completions */
-                while ( ! ( FST_RDB ( card, rxDescrRing[pi][port->rxpos].bits )
-                                                                & DMA_OWN ))
-                {
-                        fst_intr_rx ( card, port );
-                }
+	if (!do_card_interrupt) {
+		return IRQ_HANDLED;
+	}
 
-                /* Check for Tx completions */
-                while ( port->txcnt > 0 && ! ( FST_RDB ( card,
-                        txDescrRing[pi][port->txipos].bits ) & DMA_OWN ))
-                {
-                        --port->txcnt;
-                        if ( ++port->txipos >= NUM_TX_BUFFER )
-                                port->txipos = 0;
-                        netif_wake_queue ( port_to_dev ( port ));
-                }
-        }
+	/* Scehdule the bottom half of the ISR */
+	fst_q_work_item(&fst_work_intq, card->card_no);
+	tasklet_schedule(&fst_int_task);
+
+	/* Drain the event queue */
+	rdidx = FST_RDB(card, interruptEvent.rdindex) & 0x1f;
+	wridx = FST_RDB(card, interruptEvent.wrindex) & 0x1f;
+	while (rdidx != wridx) {
+		event = FST_RDB(card, interruptEvent.evntbuff[rdidx]);
+		port = &card->ports[event & 0x03];
+
+		dbg(DBG_INTR, "Processing Interrupt event: %x\n", event);
+
+		switch (event) {
+		case TE1_ALMA:
+			dbg(DBG_INTR, "TE1 Alarm intr\n");
+			if (port->run)
+				fst_intr_te1_alarm(card, port);
+			break;
+
+		case CTLA_CHG:
+		case CTLB_CHG:
+		case CTLC_CHG:
+		case CTLD_CHG:
+			if (port->run)
+				fst_intr_ctlchg(card, port);
+			break;
+
+		case ABTA_SENT:
+		case ABTB_SENT:
+		case ABTC_SENT:
+		case ABTD_SENT:
+			dbg(DBG_TX, "Abort complete port %d\n", port->index);
+			break;
+
+		case TXA_UNDF:
+		case TXB_UNDF:
+		case TXC_UNDF:
+		case TXD_UNDF:
+			/* Difficult to see how we'd get this given that we
+			 * always load up the entire packet for DMA.
+			 */
+			dbg(DBG_TX, "Tx underflow port %d\n", port->index);
+                        hdlc_stats(port_to_dev(port))->tx_errors++;
+                        hdlc_stats(port_to_dev(port))->tx_fifo_errors;
+			dbg(DBG_ASS, "Tx underflow on card %d port %d\n",
+			    card->card_no, port->index);
+			break;
+
+		case INIT_CPLT:
+			dbg(DBG_INIT, "Card init OK intr\n");
+			break;
+
+		case INIT_FAIL:
+			dbg(DBG_INIT, "Card init FAILED intr\n");
+			card->state = FST_IFAILED;
+			break;
+
+		default:
+			printk_err("intr: unknown card event %d. ignored\n",
+				   event);
+			break;
+		}
 
-        spin_unlock ( &card->card_lock );
-	return IRQ_HANDLED;
+		/* Bump and wrap the index */
+		if (++rdidx >= MAX_CIRBUFF)
+			rdidx = 0;
+	}
+	FST_WRB(card, interruptEvent.rdindex, rdidx);
+        return IRQ_HANDLED;
 }
 
-
 /*      Check that the shared memory configuration is one that we can handle
  *      and that some basic parameters are correct
  */
 static void
-check_started_ok ( struct fst_card_info *card )
+check_started_ok(struct fst_card_info *card)
 {
-        int i;
-
-        /* Check structure version and end marker */
-        if ( FST_RDW ( card, smcVersion ) != SMC_VERSION )
-        {
-                printk_err ("Bad shared memory version %d expected %d\n",
-                                FST_RDW ( card, smcVersion ), SMC_VERSION );
-                card->state = FST_BADVERSION;
-                return;
-        }
-        if ( FST_RDL ( card, endOfSmcSignature ) != END_SIG )
-        {
-                printk_err ("Missing shared memory signature\n");
-                card->state = FST_BADVERSION;
-                return;
-        }
-        /* Firmware status flag, 0x00 = initialising, 0x01 = OK, 0xFF = fail */
-        if (( i = FST_RDB ( card, taskStatus )) == 0x01 )
-        {
-                card->state = FST_RUNNING;
-        }
-        else if ( i == 0xFF )
-        {
-                printk_err ("Firmware initialisation failed. Card halted\n");
-                card->state = FST_HALTED;
-                return;
-        }
-        else if ( i != 0x00 )
-        {
-                printk_err ("Unknown firmware status 0x%x\n", i );
-                card->state = FST_HALTED;
-                return;
-        }
-
-        /* Finally check the number of ports reported by firmware against the
-         * number we assumed at card detection. Should never happen with
-         * existing firmware etc so we just report it for the moment.
-         */
-        if ( FST_RDL ( card, numberOfPorts ) != card->nports )
-        {
-                printk_warn ("Port count mismatch."
-                                " Firmware thinks %d we say %d\n",
-                                FST_RDL ( card, numberOfPorts ), card->nports );
-        }
-}
+	int i;
 
+	/* Check structure version and end marker */
+	if (FST_RDW(card, smcVersion) != SMC_VERSION) {
+		printk_err("Bad shared memory version %d expected %d\n",
+			   FST_RDW(card, smcVersion), SMC_VERSION);
+		card->state = FST_BADVERSION;
+		return;
+	}
+	if (FST_RDL(card, endOfSmcSignature) != END_SIG) {
+		printk_err("Missing shared memory signature\n");
+		card->state = FST_BADVERSION;
+		return;
+	}
+	/* Firmware status flag, 0x00 = initialising, 0x01 = OK, 0xFF = fail */
+	if ((i = FST_RDB(card, taskStatus)) == 0x01) {
+		card->state = FST_RUNNING;
+	} else if (i == 0xFF) {
+		printk_err("Firmware initialisation failed. Card halted\n");
+		card->state = FST_HALTED;
+		return;
+	} else if (i != 0x00) {
+		printk_err("Unknown firmware status 0x%x\n", i);
+		card->state = FST_HALTED;
+		return;
+	}
+
+	/* Finally check the number of ports reported by firmware against the
+	 * number we assumed at card detection. Should never happen with
+	 * existing firmware etc so we just report it for the moment.
+	 */
+	if (FST_RDL(card, numberOfPorts) != card->nports) {
+		printk_warn("Port count mismatch on card %d."
+			    " Firmware thinks %d we say %d\n", card->card_no,
+			    FST_RDL(card, numberOfPorts), card->nports);
+	}
+}
 
 static int
-set_conf_from_info ( struct fst_card_info *card, struct fst_port_info *port,
-                struct fstioc_info *info )
+set_conf_from_info(struct fst_card_info *card, struct fst_port_info *port,
+		   struct fstioc_info *info)
 {
-        int err;
-
-        /* Set things according to the user set valid flags.
-         * Several of the old options have been invalidated/replaced by the
-         * generic HDLC package.
-         */
-        err = 0;
-        if ( info->valid & FSTVAL_PROTO )
-                err = -EINVAL;
-        if ( info->valid & FSTVAL_CABLE )
-                err = -EINVAL;
-        if ( info->valid & FSTVAL_SPEED )
-                err = -EINVAL;
-
-        if ( info->valid & FSTVAL_MODE )
-                FST_WRW ( card, cardMode, info->cardMode );
+	int err;
+	unsigned char my_framing;
+
+	/* Set things according to the user set valid flags 
+	 * Several of the old options have been invalidated/replaced by the 
+	 * generic hdlc package.
+	 */
+	err = 0;
+	if (info->valid & FSTVAL_PROTO) {
+		if (info->proto == FST_RAW)
+			port->mode = FST_RAW;
+		else
+			port->mode = FST_GEN_HDLC;
+	}
+
+	if (info->valid & FSTVAL_CABLE)
+		err = -EINVAL;
+
+	if (info->valid & FSTVAL_SPEED)
+		err = -EINVAL;
+
+	if (info->valid & FSTVAL_PHASE)
+		FST_WRB(card, portConfig[port->index].invertClock,
+			info->invertClock);
+	if (info->valid & FSTVAL_MODE)
+		FST_WRW(card, cardMode, info->cardMode);
+	if (info->valid & FSTVAL_TE1) {
+		FST_WRL(card, suConfig.dataRate, info->lineSpeed);
+		FST_WRB(card, suConfig.clocking, info->clockSource);
+		my_framing = FRAMING_E1;
+		if (info->framing == E1)
+			my_framing = FRAMING_E1;
+		if (info->framing == T1)
+			my_framing = FRAMING_T1;
+		if (info->framing == J1)
+			my_framing = FRAMING_J1;
+		FST_WRB(card, suConfig.framing, my_framing);
+		FST_WRB(card, suConfig.structure, info->structure);
+		FST_WRB(card, suConfig.interface, info->interface);
+		FST_WRB(card, suConfig.coding, info->coding);
+		FST_WRB(card, suConfig.lineBuildOut, info->lineBuildOut);
+		FST_WRB(card, suConfig.equalizer, info->equalizer);
+		FST_WRB(card, suConfig.transparentMode, info->transparentMode);
+		FST_WRB(card, suConfig.loopMode, info->loopMode);
+		FST_WRB(card, suConfig.range, info->range);
+		FST_WRB(card, suConfig.txBufferMode, info->txBufferMode);
+		FST_WRB(card, suConfig.rxBufferMode, info->rxBufferMode);
+		FST_WRB(card, suConfig.startingSlot, info->startingSlot);
+		FST_WRB(card, suConfig.losThreshold, info->losThreshold);
+		if (info->idleCode)
+			FST_WRB(card, suConfig.enableIdleCode, 1);
+		else
+			FST_WRB(card, suConfig.enableIdleCode, 0);
+		FST_WRB(card, suConfig.idleCode, info->idleCode);
 #if FST_DEBUG
-        if ( info->valid & FSTVAL_DEBUG )
-                fst_debug_mask = info->debug;
+		if (info->valid & FSTVAL_TE1) {
+			printk("Setting TE1 data\n");
+			printk("Line Speed = %d\n", info->lineSpeed);
+			printk("Start slot = %d\n", info->startingSlot);
+			printk("Clock source = %d\n", info->clockSource);
+			printk("Framing = %d\n", my_framing);
+			printk("Structure = %d\n", info->structure);
+			printk("interface = %d\n", info->interface);
+			printk("Coding = %d\n", info->coding);
+			printk("Line build out = %d\n", info->lineBuildOut);
+			printk("Equaliser = %d\n", info->equalizer);
+			printk("Transparent mode = %d\n",
+			       info->transparentMode);
+			printk("Loop mode = %d\n", info->loopMode);
+			printk("Range = %d\n", info->range);
+			printk("Tx Buffer mode = %d\n", info->txBufferMode);
+			printk("Rx Buffer mode = %d\n", info->rxBufferMode);
+			printk("LOS Threshold = %d\n", info->losThreshold);
+			printk("Idle Code = %d\n", info->idleCode);
+		}
+#endif
+	}
+#if FST_DEBUG
+	if (info->valid & FSTVAL_DEBUG) {
+		fst_debug_mask = info->debug;
+	}
 #endif
 
-        return err;
+	return err;
 }
 
 static void
-gather_conf_info ( struct fst_card_info *card, struct fst_port_info *port,
-                struct fstioc_info *info )
+gather_conf_info(struct fst_card_info *card, struct fst_port_info *port,
+		 struct fstioc_info *info)
 {
-        int i;
+	int i;
 
-        memset ( info, 0, sizeof ( struct fstioc_info ));
+	memset(info, 0, sizeof (struct fstioc_info));
 
-        i = port->index;
-        info->nports = card->nports;
-        info->type   = card->type;
-        info->state  = card->state;
-        info->proto  = FST_GEN_HDLC;
-        info->index  = i;
+	i = port->index;
+	info->kernelVersion = LINUX_VERSION_CODE;
+	info->nports = card->nports;
+	info->type = card->type;
+	info->state = card->state;
+	info->proto = FST_GEN_HDLC;
+	info->index = i;
 #if FST_DEBUG
-        info->debug  = fst_debug_mask;
+	info->debug = fst_debug_mask;
 #endif
 
-        /* Only mark information as valid if card is running.
-         * Copy the data anyway in case it is useful for diagnostics
-         */
-        info->valid
-                = (( card->state == FST_RUNNING ) ? FSTVAL_ALL : FSTVAL_CARD )
+	/* Only mark information as valid if card is running.
+	 * Copy the data anyway in case it is useful for diagnostics
+	 */
+	info->valid = ((card->state == FST_RUNNING) ? FSTVAL_ALL : FSTVAL_CARD)
 #if FST_DEBUG
-                | FSTVAL_DEBUG
+	    | FSTVAL_DEBUG
 #endif
-                ;
-
-        info->lineInterface = FST_RDW ( card, portConfig[i].lineInterface );
-        info->internalClock = FST_RDB ( card, portConfig[i].internalClock );
-        info->lineSpeed     = FST_RDL ( card, portConfig[i].lineSpeed );
-        info->v24IpSts      = FST_RDL ( card, v24IpSts[i] );
-        info->v24OpSts      = FST_RDL ( card, v24OpSts[i] );
-        info->clockStatus   = FST_RDW ( card, clockStatus[i] );
-        info->cableStatus   = FST_RDW ( card, cableStatus );
-        info->cardMode      = FST_RDW ( card, cardMode );
-        info->smcFirmwareVersion  = FST_RDL ( card, smcFirmwareVersion );
+	    ;
+
+	info->lineInterface = FST_RDW(card, portConfig[i].lineInterface);
+	info->internalClock = FST_RDB(card, portConfig[i].internalClock);
+	info->lineSpeed = FST_RDL(card, portConfig[i].lineSpeed);
+	info->invertClock = FST_RDB(card, portConfig[i].invertClock);
+	info->v24IpSts = FST_RDL(card, v24IpSts[i]);
+	info->v24OpSts = FST_RDL(card, v24OpSts[i]);
+	info->clockStatus = FST_RDW(card, clockStatus[i]);
+	info->cableStatus = FST_RDW(card, cableStatus);
+	info->cardMode = FST_RDW(card, cardMode);
+	info->smcFirmwareVersion = FST_RDL(card, smcFirmwareVersion);
+
+	/*
+	 * The T2U can report cable presence for both A or B
+	 * in bits 0 and 1 of cableStatus.  See which port we are and 
+	 * do the mapping.
+	 */
+	if (card->family == FST_FAMILY_TXU) {
+		if (port->index == 0) {
+			/*
+			 * Port A
+			 */
+			info->cableStatus = info->cableStatus & 1;
+		} else {
+			/*
+			 * Port B
+			 */
+			info->cableStatus = info->cableStatus >> 1;
+			info->cableStatus = info->cableStatus & 1;
+		}
+	}
+	/*
+	 * Some additional bits if we are TE1
+	 */
+	if (card->type == FST_TYPE_TE1) {
+		info->lineSpeed = FST_RDL(card, suConfig.dataRate);
+		info->clockSource = FST_RDB(card, suConfig.clocking);
+		info->framing = FST_RDB(card, suConfig.framing);
+		info->structure = FST_RDB(card, suConfig.structure);
+		info->interface = FST_RDB(card, suConfig.interface);
+		info->coding = FST_RDB(card, suConfig.coding);
+		info->lineBuildOut = FST_RDB(card, suConfig.lineBuildOut);
+		info->equalizer = FST_RDB(card, suConfig.equalizer);
+		info->loopMode = FST_RDB(card, suConfig.loopMode);
+		info->range = FST_RDB(card, suConfig.range);
+		info->txBufferMode = FST_RDB(card, suConfig.txBufferMode);
+		info->rxBufferMode = FST_RDB(card, suConfig.rxBufferMode);
+		info->startingSlot = FST_RDB(card, suConfig.startingSlot);
+		info->losThreshold = FST_RDB(card, suConfig.losThreshold);
+		if (FST_RDB(card, suConfig.enableIdleCode))
+			info->idleCode = FST_RDB(card, suConfig.idleCode);
+		else
+			info->idleCode = 0;
+		info->receiveBufferDelay =
+		    FST_RDL(card, suStatus.receiveBufferDelay);
+		info->framingErrorCount =
+		    FST_RDL(card, suStatus.framingErrorCount);
+		info->codeViolationCount =
+		    FST_RDL(card, suStatus.codeViolationCount);
+		info->crcErrorCount = FST_RDL(card, suStatus.crcErrorCount);
+		info->lineAttenuation = FST_RDL(card, suStatus.lineAttenuation);
+		info->lossOfSignal = FST_RDB(card, suStatus.lossOfSignal);
+		info->receiveRemoteAlarm =
+		    FST_RDB(card, suStatus.receiveRemoteAlarm);
+		info->alarmIndicationSignal =
+		    FST_RDB(card, suStatus.alarmIndicationSignal);
+	}
 }
 
-
 static int
-fst_set_iface ( struct fst_card_info *card, struct fst_port_info *port,
-                struct ifreq *ifr )
+fst_set_iface(struct fst_card_info *card, struct fst_port_info *port,
+	      struct ifreq *ifr)
 {
-        sync_serial_settings sync;
-        int i;
-
-        if (copy_from_user (&sync, ifr->ifr_settings.ifs_ifsu.sync,
-			    sizeof (sync)))
-                return -EFAULT;
-
-        if ( sync.loopback )
-                return -EINVAL;
-
-        i = port->index;
-
-        switch (ifr->ifr_settings.type)
-        {
-        case IF_IFACE_V35:
-                FST_WRW ( card, portConfig[i].lineInterface, V35 );
-                port->hwif = V35;
-                break;
-
-        case IF_IFACE_V24:
-                FST_WRW ( card, portConfig[i].lineInterface, V24 );
-                port->hwif = V24;
-                break;
-
-        case IF_IFACE_X21:
-                FST_WRW ( card, portConfig[i].lineInterface, X21 );
-                port->hwif = X21;
-                break;
-
-        case IF_IFACE_SYNC_SERIAL:
-                break;
-
-        default:
-                return -EINVAL;
-        }
-
-        switch ( sync.clock_type )
-        {
-        case CLOCK_EXT:
-                FST_WRB ( card, portConfig[i].internalClock, EXTCLK );
-                break;
-
-        case CLOCK_INT:
-                FST_WRB ( card, portConfig[i].internalClock, INTCLK );
-                break;
-
-        default:
-                return -EINVAL;
-        }
-        FST_WRL ( card, portConfig[i].lineSpeed, sync.clock_rate );
-        return 0;
+	sync_serial_settings sync;
+	int i;
+
+	if (ifr->ifr_settings.size != sizeof (sync)) {
+		return -ENOMEM;
+	}
+
+	if (copy_from_user
+	    (&sync, ifr->ifr_settings.ifs_ifsu.sync, sizeof (sync))) {
+		return -EFAULT;
+	}
+
+	if (sync.loopback)
+		return -EINVAL;
+
+	i = port->index;
+
+	switch (ifr->ifr_settings.type) {
+	case IF_IFACE_V35:
+		FST_WRW(card, portConfig[i].lineInterface, V35);
+		port->hwif = V35;
+		break;
+
+	case IF_IFACE_V24:
+		FST_WRW(card, portConfig[i].lineInterface, V24);
+		port->hwif = V24;
+		break;
+
+	case IF_IFACE_X21:
+		FST_WRW(card, portConfig[i].lineInterface, X21);
+		port->hwif = X21;
+		break;
+
+	case IF_IFACE_X21D:
+		FST_WRW(card, portConfig[i].lineInterface, X21D);
+		port->hwif = X21D;
+		break;
+
+	case IF_IFACE_T1:
+		FST_WRW(card, portConfig[i].lineInterface, T1);
+		port->hwif = T1;
+		break;
+
+	case IF_IFACE_E1:
+		FST_WRW(card, portConfig[i].lineInterface, E1);
+		port->hwif = E1;
+		break;
+
+	case IF_IFACE_SYNC_SERIAL:
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	switch (sync.clock_type) {
+	case CLOCK_EXT:
+		FST_WRB(card, portConfig[i].internalClock, EXTCLK);
+		break;
+
+	case CLOCK_INT:
+		FST_WRB(card, portConfig[i].internalClock, INTCLK);
+		break;
+
+	default:
+		return -EINVAL;
+	}
+	FST_WRL(card, portConfig[i].lineSpeed, sync.clock_rate);
+	return 0;
 }
 
 static int
-fst_get_iface ( struct fst_card_info *card, struct fst_port_info *port,
-                struct ifreq *ifr )
+fst_get_iface(struct fst_card_info *card, struct fst_port_info *port,
+	      struct ifreq *ifr)
 {
-        sync_serial_settings sync;
-        int i;
-
-        /* First check what line type is set, we'll default to reporting X.21
-         * if nothing is set as IF_IFACE_SYNC_SERIAL implies it can't be
-         * changed
-         */
-        switch ( port->hwif )
-        {
-        case V35:
-                ifr->ifr_settings.type = IF_IFACE_V35;
-                break;
-        case V24:
-                ifr->ifr_settings.type = IF_IFACE_V24;
-                break;
-        case X21:
-        default:
-                ifr->ifr_settings.type = IF_IFACE_X21;
-                break;
-        }
-
-	if (ifr->ifr_settings.size < sizeof(sync)) {
-		ifr->ifr_settings.size = sizeof(sync); /* data size wanted */
-		return -ENOBUFS;
-	}
-
-        i = port->index;
-        sync.clock_rate = FST_RDL ( card, portConfig[i].lineSpeed );
-        /* Lucky card and linux use same encoding here */
-        sync.clock_type = FST_RDB ( card, portConfig[i].internalClock );
-        sync.loopback = 0;
-
-        if (copy_to_user (ifr->ifr_settings.ifs_ifsu.sync, &sync,
-			  sizeof(sync)))
-                return -EFAULT;
-
-        return 0;
-}
+	sync_serial_settings sync;
+	int i;
+
+	/* First check what line type is set, we'll default to reporting X.21
+	 * if nothing is set as IF_IFACE_SYNC_SERIAL implies it can't be
+	 * changed
+	 */
+	switch (port->hwif) {
+	case E1:
+		ifr->ifr_settings.type = IF_IFACE_E1;
+		break;
+	case T1:
+		ifr->ifr_settings.type = IF_IFACE_T1;
+		break;
+	case V35:
+		ifr->ifr_settings.type = IF_IFACE_V35;
+		break;
+	case V24:
+		ifr->ifr_settings.type = IF_IFACE_V24;
+		break;
+	case X21D:
+		ifr->ifr_settings.type = IF_IFACE_X21D;
+		break;
+	case X21:
+	default:
+		ifr->ifr_settings.type = IF_IFACE_X21;
+		break;
+	}
+	if (ifr->ifr_settings.size == 0) {
+		return 0;	/* only type requested */
+	}
+	if (ifr->ifr_settings.size < sizeof (sync)) {
+		return -ENOMEM;
+	}
 
+	i = port->index;
+	sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed);
+	/* Lucky card and linux use same encoding here */
+	sync.clock_type = FST_RDB(card, portConfig[i].internalClock) ==
+	    INTCLK ? CLOCK_INT : CLOCK_EXT;
+	sync.loopback = 0;
+
+	if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &sync, sizeof (sync))) {
+		return -EFAULT;
+	}
+
+	ifr->ifr_settings.size = sizeof (sync);
+	return 0;
+}
 
 static int
-fst_ioctl ( struct net_device *dev, struct ifreq *ifr, int cmd )
+fst_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-        struct fst_card_info *card;
-        struct fst_port_info *port;
-        struct fstioc_write wrthdr;
-        struct fstioc_info info;
-        unsigned long flags;
-
-        dbg ( DBG_IOCTL,"ioctl: %x, %p\n", cmd, ifr->ifr_data );
-
-        port = dev_to_port ( dev );
-        card = port->card;
-
-        if ( !capable ( CAP_NET_ADMIN ))
-                return -EPERM;
-
-        switch ( cmd )
-        {
-        case FSTCPURESET:
-                fst_cpureset ( card );
-                card->state = FST_RESET;
-                return 0;
-
-        case FSTCPURELEASE:
-                fst_cpurelease ( card );
-                card->state = FST_STARTING;
-                return 0;
-
-        case FSTWRITE:                  /* Code write (download) */
-
-                /* First copy in the header with the length and offset of data
-                 * to write
-                 */
-                if ( ifr->ifr_data == NULL )
-                {
-                        return -EINVAL;
-                }
-                if ( copy_from_user ( &wrthdr, ifr->ifr_data,
-                                        sizeof ( struct fstioc_write )))
-                {
-                        return -EFAULT;
-                }
+	struct fst_card_info *card;
+	struct fst_port_info *port;
+	struct fstioc_write wrthdr;
+	struct fstioc_info info;
+	unsigned long flags;
 
-                /* Sanity check the parameters. We don't support partial writes
-                 * when going over the top
-                 */
-                if ( wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE
-				|| wrthdr.size + wrthdr.offset > FST_MEMSIZE )
-                {
-                        return -ENXIO;
-                }
+	dbg(DBG_IOCTL, "ioctl: %x, %p\n", cmd, ifr->ifr_data);
 
-                /* Now copy the data to the card.
-                 * This will probably break on some architectures.
-                 * I'll fix it when I have something to test on.
-                 */
-                if ( copy_from_user ( card->mem + wrthdr.offset,
-                                ifr->ifr_data + sizeof ( struct fstioc_write ),
-                                wrthdr.size ))
-                {
-                        return -EFAULT;
-                }
+	port = dev_to_port(dev);
+	card = port->card;
 
-                /* Writes to the memory of a card in the reset state constitute
-                 * a download
-                 */
-                if ( card->state == FST_RESET )
-                {
-                        card->state = FST_DOWNLOAD;
-                }
-                return 0;
-
-        case FSTGETCONF:
-
-                /* If card has just been started check the shared memory config
-                 * version and marker
-                 */
-                if ( card->state == FST_STARTING )
-                {
-                        check_started_ok ( card );
-
-                        /* If everything checked out enable card interrupts */
-                        if ( card->state == FST_RUNNING )
-                        {
-                                spin_lock_irqsave ( &card->card_lock, flags );
-                                fst_clear_intr ( card );
-                                FST_WRB ( card, interruptHandshake, 0xEE );
-                                spin_unlock_irqrestore ( &card->card_lock,
-                                                                flags );
-                        }
-                }
+	if (!capable(CAP_NET_ADMIN))
+		return -EPERM;
 
-                if ( ifr->ifr_data == NULL )
-                {
-                        return -EINVAL;
-                }
+	switch (cmd) {
+	case FSTCPURESET:
+		fst_cpureset(card);
+		card->state = FST_RESET;
+		return 0;
 
-                gather_conf_info ( card, port, &info );
+	case FSTCPURELEASE:
+		fst_cpurelease(card);
+		card->state = FST_STARTING;
+		return 0;
 
-                if ( copy_to_user ( ifr->ifr_data, &info, sizeof ( info )))
-                {
-                        return -EFAULT;
-                }
-                return 0;
+	case FSTWRITE:		/* Code write (download) */
 
-        case FSTSETCONF:
+		/* First copy in the header with the length and offset of data
+		 * to write
+		 */
+		if (ifr->ifr_data == NULL) {
+			return -EINVAL;
+		}
+		if (copy_from_user(&wrthdr, ifr->ifr_data,
+				   sizeof (struct fstioc_write))) {
+			return -EFAULT;
+		}
 
-                /* Most of the setting have been moved to the generic ioctls
-                 * this just covers debug and board ident mode now
-                 */
-                if ( copy_from_user ( &info,  ifr->ifr_data, sizeof ( info )))
-                {
-                        return -EFAULT;
-                }
+		/* Sanity check the parameters. We don't support partial writes
+		 * when going over the top
+		 */
+		if (wrthdr.size > FST_MEMSIZE || wrthdr.offset > FST_MEMSIZE
+		    || wrthdr.size + wrthdr.offset > FST_MEMSIZE) {
+			return -ENXIO;
+		}
 
-                return set_conf_from_info ( card, port, &info );
+		/* Now copy the data to the card.
+		 * This will probably break on some architectures.
+		 * I'll fix it when I have something to test on.
+		 */
+		if (copy_from_user(card->mem + wrthdr.offset,
+				   ifr->ifr_data + sizeof (struct fstioc_write),
+				   wrthdr.size)) {
+			return -EFAULT;
+		}
 
-        case SIOCWANDEV:
-                switch (ifr->ifr_settings.type)
-                {
-                case IF_GET_IFACE:
-                        return fst_get_iface ( card, port, ifr );
+		/* Writes to the memory of a card in the reset state constitute
+		 * a download
+		 */
+		if (card->state == FST_RESET) {
+			card->state = FST_DOWNLOAD;
+		}
+		return 0;
 
-                case IF_IFACE_SYNC_SERIAL:
-                case IF_IFACE_V35:
-                case IF_IFACE_V24:
-                case IF_IFACE_X21:
-                        return fst_set_iface ( card, port, ifr );
+	case FSTGETCONF:
 
-                default:
-                        return hdlc_ioctl ( dev, ifr, cmd );
-                }
+		/* If card has just been started check the shared memory config
+		 * version and marker
+		 */
+		if (card->state == FST_STARTING) {
+			check_started_ok(card);
+
+			/* If everything checked out enable card interrupts */
+			if (card->state == FST_RUNNING) {
+				spin_lock_irqsave(&card->card_lock, flags);
+				fst_enable_intr(card);
+				FST_WRB(card, interruptHandshake, 0xEE);
+				spin_unlock_irqrestore(&card->card_lock, flags);
+			}
+		}
 
-        default:
-                /* Not one of ours. Pass through to HDLC package */
-                return hdlc_ioctl ( dev, ifr, cmd );
-        }
-}
+		if (ifr->ifr_data == NULL) {
+			return -EINVAL;
+		}
+
+		gather_conf_info(card, port, &info);
+
+		if (copy_to_user(ifr->ifr_data, &info, sizeof (info))) {
+			return -EFAULT;
+		}
+		return 0;
+
+	case FSTSETCONF:
+
+		/*
+		 * Most of the settings have been moved to the generic ioctls
+		 * this just covers debug and board ident now
+		 */
+
+		if (card->state != FST_RUNNING) {
+			printk_err
+			    ("Attempt to configure card %d in non-running state (%d)\n",
+			     card->card_no, card->state);
+			return -EIO;
+		}
+		if (copy_from_user(&info, ifr->ifr_data, sizeof (info))) {
+			return -EFAULT;
+		}
 
+		return set_conf_from_info(card, port, &info);
+
+	case SIOCWANDEV:
+		switch (ifr->ifr_settings.type) {
+		case IF_GET_IFACE:
+			return fst_get_iface(card, port, ifr);
+
+		case IF_IFACE_SYNC_SERIAL:
+		case IF_IFACE_V35:
+		case IF_IFACE_V24:
+		case IF_IFACE_X21:
+		case IF_IFACE_X21D:
+		case IF_IFACE_T1:
+		case IF_IFACE_E1:
+			return fst_set_iface(card, port, ifr);
+
+		case IF_PROTO_RAW:
+			port->mode = FST_RAW;
+			return 0;
+
+		case IF_GET_PROTO:
+			if (port->mode == FST_RAW) {
+				ifr->ifr_settings.type = IF_PROTO_RAW;
+				return 0;
+			}
+			return hdlc_ioctl(dev, ifr, cmd);
+
+		default:
+			port->mode = FST_GEN_HDLC;
+			dbg(DBG_IOCTL, "Passing this type to hdlc %x\n",
+			    ifr->ifr_settings.type);
+			return hdlc_ioctl(dev, ifr, cmd);
+		}
+
+	default:
+		/* Not one of ours. Pass through to HDLC package */
+		return hdlc_ioctl(dev, ifr, cmd);
+	}
+}
 
 static void
-fst_openport ( struct fst_port_info *port )
+fst_openport(struct fst_port_info *port)
 {
-        int signals;
-
-        /* Only init things if card is actually running. This allows open to
-         * succeed for downloads etc.
-         */
-        if ( port->card->state == FST_RUNNING )
-        {
-                if ( port->run )
-                {
-                        dbg ( DBG_OPEN,"open: found port already running\n");
-
-                        fst_issue_cmd ( port, STOPPORT );
-                        port->run = 0;
-                }
+	int signals;
+	int txq_length;
+
+	/* Only init things if card is actually running. This allows open to
+	 * succeed for downloads etc.
+	 */
+	if (port->card->state == FST_RUNNING) {
+		if (port->run) {
+			dbg(DBG_OPEN, "open: found port already running\n");
+
+			fst_issue_cmd(port, STOPPORT);
+			port->run = 0;
+		}
+
+		fst_rx_config(port);
+		fst_tx_config(port);
+		fst_op_raise(port, OPSTS_RTS | OPSTS_DTR);
+
+		fst_issue_cmd(port, STARTPORT);
+		port->run = 1;
 
-                fst_rx_config ( port );
-                fst_tx_config ( port );
-                fst_op_raise ( port, OPSTS_RTS | OPSTS_DTR );
+		signals = FST_RDL(port->card, v24DebouncedSts[port->index]);
+		if (signals & (((port->hwif == X21) || (port->hwif == X21D))
+			       ? IPSTS_INDICATE : IPSTS_DCD))
+			netif_carrier_on(port_to_dev(port));
+		else
+			netif_carrier_off(port_to_dev(port));
 
-                fst_issue_cmd ( port, STARTPORT );
-                port->run = 1;
+		txq_length = port->txqe - port->txqs;
+		port->txqe = 0;
+		port->txqs = 0;
+	}
 
-                signals = FST_RDL ( port->card, v24DebouncedSts[port->index]);
-                if ( signals & (( port->hwif == X21 ) ? IPSTS_INDICATE
-                                                      : IPSTS_DCD ))
-                        netif_carrier_on ( port_to_dev ( port ));
-                else
-                        netif_carrier_off ( port_to_dev ( port ));
-        }
 }
 
 static void
-fst_closeport ( struct fst_port_info *port )
+fst_closeport(struct fst_port_info *port)
 {
-        if ( port->card->state == FST_RUNNING )
-        {
-                if ( port->run )
-                {
-                        port->run = 0;
-                        fst_op_lower ( port, OPSTS_RTS | OPSTS_DTR );
-
-                        fst_issue_cmd ( port, STOPPORT );
-                }
-                else
-                {
-                        dbg ( DBG_OPEN,"close: port not running\n");
-                }
-        }
+	if (port->card->state == FST_RUNNING) {
+		if (port->run) {
+			port->run = 0;
+			fst_op_lower(port, OPSTS_RTS | OPSTS_DTR);
+
+			fst_issue_cmd(port, STOPPORT);
+		} else {
+			dbg(DBG_OPEN, "close: port not running\n");
+		}
+	}
 }
 
-
 static int
-fst_open ( struct net_device *dev )
+fst_open(struct net_device *dev)
 {
-        int err;
+	int err;
+	struct fst_port_info *port;
 
-        err = hdlc_open (dev);
-        if ( err )
-                return err;
+	port = dev_to_port(dev);
+	if (!try_module_get(THIS_MODULE))
+          return -EBUSY;
 
-        fst_openport ( dev_to_port ( dev ));
-        netif_wake_queue ( dev );
-        return 0;
+	if (port->mode != FST_RAW) {
+		err = hdlc_open(dev);
+		if (err)
+			return err;
+	}
+
+	fst_openport(port);
+	netif_wake_queue(dev);
+	return 0;
 }
 
 static int
-fst_close ( struct net_device *dev )
+fst_close(struct net_device *dev)
 {
-        netif_stop_queue ( dev );
-        fst_closeport ( dev_to_port ( dev ));
-        hdlc_close ( dev );
-        return 0;
+	struct fst_port_info *port;
+	struct fst_card_info *card;
+	unsigned char tx_dma_done;
+	unsigned char rx_dma_done;
+
+	port = dev_to_port(dev);
+	card = port->card;
+
+	tx_dma_done = inb(card->pci_conf + DMACSR1);
+	rx_dma_done = inb(card->pci_conf + DMACSR0);
+	dbg(DBG_OPEN,
+	    "Port Close: tx_dma_in_progress = %d (%x) rx_dma_in_progress = %d (%x)\n",
+	    card->dmatx_in_progress, tx_dma_done, card->dmarx_in_progress,
+	    rx_dma_done);
+
+	netif_stop_queue(dev);
+	fst_closeport(dev_to_port(dev));
+	if (port->mode != FST_RAW) {
+		hdlc_close(dev);
+	}
+	module_put(THIS_MODULE);
+	return 0;
 }
 
 static int
-fst_attach ( struct net_device *dev, unsigned short encoding, unsigned short parity )
+fst_attach(struct net_device *dev, unsigned short encoding, unsigned short parity)
 {
-        /* Setting currently fixed in FarSync card so we check and forget */
-        if ( encoding != ENCODING_NRZ || parity != PARITY_CRC16_PR1_CCITT )
-                return -EINVAL;
-        return 0;
+	/*
+	 * Setting currently fixed in FarSync card so we check and forget
+	 */
+	if (encoding != ENCODING_NRZ || parity != PARITY_CRC16_PR1_CCITT)
+		return -EINVAL;
+	return 0;
 }
 
-
 static void
-fst_tx_timeout ( struct net_device *dev )
+fst_tx_timeout(struct net_device *dev)
 {
-        struct fst_port_info *port;
+	struct fst_port_info *port;
+	struct fst_card_info *card;
 	struct net_device_stats *stats = hdlc_stats(dev);
 
-        dbg ( DBG_INTR | DBG_TX,"tx_timeout\n");
-
-        port = dev_to_port ( dev );
-
-        stats->tx_errors++;
-        stats->tx_aborted_errors++;
-
-        if ( port->txcnt > 0 )
-                fst_issue_cmd ( port, ABORTTX );
-
-        dev->trans_start = jiffies;
-        netif_wake_queue ( dev );
+	port = dev_to_port(dev);
+	card = port->card;
+	stats->tx_errors++;
+	stats->tx_aborted_errors++;
+	dbg(DBG_ASS, "Tx timeout card %d port %d\n",
+	    card->card_no, port->index);
+	fst_issue_cmd(port, ABORTTX);
+
+	dev->trans_start = jiffies;
+	netif_wake_queue(dev);
+	port->start = 0;
 }
 
-
 static int
-fst_start_xmit ( struct sk_buff *skb, struct net_device *dev )
+fst_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
+	struct fst_card_info *card;
+	struct fst_port_info *port;
 	struct net_device_stats *stats = hdlc_stats(dev);
-        struct fst_card_info *card;
-        struct fst_port_info *port;
-        unsigned char dmabits;
-        unsigned long flags;
-        int pi;
-        int txp;
-
-        port = dev_to_port ( dev );
-        card = port->card;
-
-        /* Drop packet with error if we don't have carrier */
-        if ( ! netif_carrier_ok ( dev ))
-        {
-                dev_kfree_skb ( skb );
-                stats->tx_errors++;
-                stats->tx_carrier_errors++;
-                return 0;
-        }
-
-        /* Drop it if it's too big! MTU failure ? */
-        if ( skb->len > LEN_TX_BUFFER )
-        {
-                dbg ( DBG_TX,"Packet too large %d vs %d\n", skb->len,
-                                                LEN_TX_BUFFER );
-                dev_kfree_skb ( skb );
-                stats->tx_errors++;
-                return 0;
-        }
-
-        /* Check we have a buffer */
-        pi = port->index;
-        spin_lock_irqsave ( &card->card_lock, flags );
-        txp = port->txpos;
-        dmabits = FST_RDB ( card, txDescrRing[pi][txp].bits );
-        if ( dmabits & DMA_OWN )
-        {
-                spin_unlock_irqrestore ( &card->card_lock, flags );
-                dbg ( DBG_TX,"Out of Tx buffers\n");
-                dev_kfree_skb ( skb );
-                stats->tx_errors++;
-                return 0;
-        }
-        if ( ++port->txpos >= NUM_TX_BUFFER )
-                port->txpos = 0;
-
-        if ( ++port->txcnt >= NUM_TX_BUFFER )
-                netif_stop_queue ( dev );
-
-        /* Release the card lock before we copy the data as we now have
-         * exclusive access to the buffer.
-         */
-        spin_unlock_irqrestore ( &card->card_lock, flags );
-
-        /* Enqueue the packet */
-        memcpy_toio ( card->mem + BUF_OFFSET ( txBuffer[pi][txp][0]),
-                                                skb->data, skb->len );
-        FST_WRW ( card, txDescrRing[pi][txp].bcnt, cnv_bcnt ( skb->len ));
-        FST_WRB ( card, txDescrRing[pi][txp].bits, DMA_OWN | TX_STP | TX_ENP );
-
-        stats->tx_packets++;
-        stats->tx_bytes += skb->len;
-
-        dev_kfree_skb ( skb );
-
-        dev->trans_start = jiffies;
-        return 0;
-}
+	unsigned long flags;
+	int txq_length;
+
+	port = dev_to_port(dev);
+	card = port->card;
+	dbg(DBG_TX, "fst_start_xmit: length = %d\n", skb->len);
+
+	/* Drop packet with error if we don't have carrier */
+	if (!netif_carrier_ok(dev)) {
+		dev_kfree_skb(skb);
+		stats->tx_errors++;
+		stats->tx_carrier_errors++;
+		dbg(DBG_ASS,
+		    "Tried to transmit but no carrier on card %d port %d\n",
+		    card->card_no, port->index);
+		return 0;
+	}
+
+	/* Drop it if it's too big! MTU failure ? */
+	if (skb->len > LEN_TX_BUFFER) {
+		dbg(DBG_ASS, "Packet too large %d vs %d\n", skb->len,
+		    LEN_TX_BUFFER);
+		dev_kfree_skb(skb);
+		stats->tx_errors++;
+		return 0;
+	}
 
+	/*
+	 * We are always going to queue the packet
+	 * so that the bottom half is the only place we tx from
+	 * Check there is room in the port txq
+	 */
+	spin_lock_irqsave(&card->card_lock, flags);
+	if ((txq_length = port->txqe - port->txqs) < 0) {
+		/*
+		 * This is the case where the next free has wrapped but the
+		 * last used hasn't
+		 */
+		txq_length = txq_length + FST_TXQ_DEPTH;
+	}
+	spin_unlock_irqrestore(&card->card_lock, flags);
+	if (txq_length > fst_txq_high) {
+		/*
+		 * We have got enough buffers in the pipeline.  Ask the network
+		 * layer to stop sending frames down
+		 */
+		netif_stop_queue(dev);
+		port->start = 1;	/* I'm using this to signal stop sent up */
+	}
+
+	if (txq_length == FST_TXQ_DEPTH - 1) {
+		/*
+		 * This shouldn't have happened but such is life
+		 */
+		dev_kfree_skb(skb);
+		stats->tx_errors++;
+		dbg(DBG_ASS, "Tx queue overflow card %d port %d\n",
+		    card->card_no, port->index);
+		return 0;
+	}
+
+	/*
+	 * queue the buffer
+	 */
+	spin_lock_irqsave(&card->card_lock, flags);
+	port->txq[port->txqe] = skb;
+	port->txqe++;
+	if (port->txqe == FST_TXQ_DEPTH)
+		port->txqe = 0;
+	spin_unlock_irqrestore(&card->card_lock, flags);
+
+	/* Scehdule the bottom half which now does transmit processing */
+	fst_q_work_item(&fst_work_txq, card->card_no);
+	tasklet_schedule(&fst_tx_task);
+
+	return 0;
+}
 
 /*
  *      Card setup having checked hardware resources.
@@ -1440,22 +2399,26 @@ fst_start_xmit ( struct sk_buff *skb, struct net_device *dev )
  *      disabled.
  */
 static char *type_strings[] __devinitdata = {
-        "no hardware",                  /* Should never be seen */
-        "FarSync T2P",
-        "FarSync T4P"
+	"no hardware",		/* Should never be seen */
+	"FarSync T2P",
+	"FarSync T4P",
+	"FarSync T1U",
+	"FarSync T2U",
+	"FarSync T4U",
+	"FarSync TE1"
 };
 
 static void __devinit
-fst_init_card ( struct fst_card_info *card )
+fst_init_card(struct fst_card_info *card)
 {
-        int i;
-        int err;
+	int i;
+	int err;
 
-        /* We're working on a number of ports based on the card ID. If the
-         * firmware detects something different later (should never happen)
-         * we'll have to revise it in some way then.
-         */
-        for ( i = 0 ; i < card->nports ; i++ ) {
+	/* We're working on a number of ports based on the card ID. If the
+	 * firmware detects something different later (should never happen)
+	 * we'll have to revise it in some way then.
+	 */
+	for (i = 0; i < card->nports; i++) {
                 err = register_hdlc_device(card->ports[i].dev);
                 if (err < 0) {
 			int j;
@@ -1468,62 +2431,120 @@ fst_init_card ( struct fst_card_info *card )
                         card->nports = i;
                         break;
                 }
-        }
+	}
 
-        printk ( KERN_INFO "%s-%s: %s IRQ%d, %d ports\n",
-                        port_to_dev(&card->ports[0])->name,
-                        port_to_dev(&card->ports[card->nports-1])->name,
-                        type_strings[card->type], card->irq, card->nports );
+	printk_info("%s-%s: %s IRQ%d, %d ports\n",
+	       port_to_dev(&card->ports[0])->name,
+	       port_to_dev(&card->ports[card->nports - 1])->name,
+	       type_strings[card->type], card->irq, card->nports);
 }
 
-
 /*
  *      Initialise card when detected.
  *      Returns 0 to indicate success, or errno otherwise.
  */
 static int __devinit
-fst_add_one ( struct pci_dev *pdev, const struct pci_device_id *ent )
+fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-        static int firsttime_done = 0;
-        struct fst_card_info *card;
-        int err = 0;
+	static int firsttime_done = 0;
+	static int no_of_cards_added = 0;
+	struct fst_card_info *card;
+	int err = 0;
 	int i;
 
-        if ( ! firsttime_done )
-        {
-                printk ( KERN_INFO "FarSync X21 driver " FST_USER_VERSION
-                                " (c) 2001 FarSite Communications Ltd.\n");
-                firsttime_done = 1;
-        }
-
-        /* Allocate driver private data */
-        card = kmalloc ( sizeof ( struct fst_card_info ),  GFP_KERNEL);
-        if (card == NULL)
-        {
-                printk_err ("FarSync card found but insufficient memory for"
-                                " driver storage\n");
-                return -ENOMEM;
-        }
-        memset ( card, 0, sizeof ( struct fst_card_info ));
-
-        /* Try to enable the device */
-        if (( err = pci_enable_device ( pdev )) != 0 )
-        {
-                printk_err ("Failed to enable card. Err %d\n", -err );
-                goto error_free_card;
-        }
-
-        /* Record info we need*/
-        card->irq         = pdev->irq;
-        card->pci_conf    = pci_resource_start ( pdev, 1 );
-        card->phys_mem    = pci_resource_start ( pdev, 2 );
-        card->phys_ctlmem = pci_resource_start ( pdev, 3 );
-
-        card->type        = ent->driver_data;
-        card->nports      = ( ent->driver_data == FST_TYPE_T2P ) ? 2 : 4;
-
-        card->state       = FST_UNINIT;
+	if (!firsttime_done) {
+		printk_info("FarSync WAN driver " FST_USER_VERSION
+		       " (c) 2001-2004 FarSite Communications Ltd.\n");
+		firsttime_done = 1;
+		dbg(DBG_ASS, "The value of debug mask is %x\n", fst_debug_mask);
+	}
+
+	/*
+	 * We are going to be clever and allow certain cards not to be
+	 * configured.  An exclude list can be provided in /etc/modules.conf
+	 */
+	if (fst_excluded_cards != 0) {
+		/*
+		 * There are cards to exclude
+		 *
+		 */
+		for (i = 0; i < fst_excluded_cards; i++) {
+			if ((pdev->devfn) >> 3 == fst_excluded_list[i]) {
+				printk_info("FarSync PCI device %d not assigned\n",
+				       (pdev->devfn) >> 3);
+				return -EBUSY;
+			}
+		}
+	}
+
+	/* Allocate driver private data */
+	card = kmalloc(sizeof (struct fst_card_info), GFP_KERNEL);
+	if (card == NULL) {
+		printk_err("FarSync card found but insufficient memory for"
+			   " driver storage\n");
+		return -ENOMEM;
+	}
+	memset(card, 0, sizeof (struct fst_card_info));
+
+	/* Try to enable the device */
+	if ((err = pci_enable_device(pdev)) != 0) {
+		printk_err("Failed to enable card. Err %d\n", -err);
+		kfree(card);
+		return err;
+	}
+
+	if ((err = pci_request_regions(pdev, "FarSync")) !=0) {
+	        printk_err("Failed to allocate regions. Err %d\n", -err);
+		pci_disable_device(pdev);
+		kfree(card);
+	        return err;
+	}
 
+	/* Get virtual addresses of memory regions */
+	card->pci_conf = pci_resource_start(pdev, 1);
+	card->phys_mem = pci_resource_start(pdev, 2);
+	card->phys_ctlmem = pci_resource_start(pdev, 3);
+	if ((card->mem = ioremap(card->phys_mem, FST_MEMSIZE)) == NULL) {
+		printk_err("Physical memory remap failed\n");
+		pci_release_regions(pdev);
+		pci_disable_device(pdev);
+		kfree(card);
+		return -ENODEV;
+	}
+	if ((card->ctlmem = ioremap(card->phys_ctlmem, 0x10)) == NULL) {
+		printk_err("Control memory remap failed\n");
+		pci_release_regions(pdev);
+		pci_disable_device(pdev);
+		kfree(card);
+		return -ENODEV;
+	}
+	dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem);
+
+	/* Register the interrupt handler */
+	if (request_irq(pdev->irq, fst_intr, SA_SHIRQ, FST_DEV_NAME, card)) {
+		printk_err("Unable to register interrupt %d\n", card->irq);
+		pci_release_regions(pdev);
+		pci_disable_device(pdev);
+		iounmap(card->ctlmem);
+		iounmap(card->mem);
+		kfree(card);
+		return -ENODEV;
+	}
+
+	/* Record info we need */
+	card->irq = pdev->irq;
+	card->type = ent->driver_data;
+	card->family = ((ent->driver_data == FST_TYPE_T2P) ||
+			(ent->driver_data == FST_TYPE_T4P))
+	    ? FST_FAMILY_TXP : FST_FAMILY_TXU;
+	if ((ent->driver_data == FST_TYPE_T1U) ||
+	    (ent->driver_data == FST_TYPE_TE1))
+		card->nports = 1;
+	else
+		card->nports = ((ent->driver_data == FST_TYPE_T2P) ||
+				(ent->driver_data == FST_TYPE_T2U)) ? 2 : 4;
+
+	card->state = FST_UNINIT;
         spin_lock_init ( &card->card_lock );
 
         for ( i = 0 ; i < card->nports ; i++ ) {
@@ -1533,7 +2554,13 @@ fst_add_one ( struct pci_dev *pdev, const struct pci_device_id *ent )
 			while (i--)
 				free_netdev(card->ports[i].dev);
 			printk_err ("FarSync: out of memory\n");
-			goto error_free_card;
+                        free_irq(card->irq, card);
+                        pci_release_regions(pdev);
+                        pci_disable_device(pdev);
+                        iounmap(card->ctlmem);
+                        iounmap(card->mem);
+                        kfree(card);
+                        return -ENODEV;
 		}
 		card->ports[i].dev    = dev;
                 card->ports[i].card   = card;
@@ -1564,128 +2591,95 @@ fst_add_one ( struct pci_dev *pdev, const struct pci_device_id *ent )
                 hdlc->xmit   = fst_start_xmit;
 	}
 
-        dbg ( DBG_PCI,"type %d nports %d irq %d\n", card->type,
-                        card->nports, card->irq );
-        dbg ( DBG_PCI,"conf %04x mem %08x ctlmem %08x\n",
-                        card->pci_conf, card->phys_mem, card->phys_ctlmem );
-
-        /* Check we can get access to the memory and I/O regions */
-        if ( ! request_region ( card->pci_conf, 0x80,"PLX config regs"))
-        {
-                printk_err ("Unable to get config I/O @ 0x%04X\n",
-                                                card->pci_conf );
-                err = -ENODEV;
-                goto error_free_ports;
-        }
-        if ( ! request_mem_region ( card->phys_mem, FST_MEMSIZE,"Shared RAM"))
-        {
-                printk_err ("Unable to get main memory @ 0x%08X\n",
-                                                card->phys_mem );
-                err = -ENODEV;
-                goto error_release_io;
-        }
-        if ( ! request_mem_region ( card->phys_ctlmem, 0x10,"Control memory"))
-        {
-                printk_err ("Unable to get control memory @ 0x%08X\n",
-                                                card->phys_ctlmem );
-                err = -ENODEV;
-                goto error_release_mem;
-        }
-
-
-        /* Get virtual addresses of memory regions */
-        if (( card->mem = ioremap ( card->phys_mem, FST_MEMSIZE )) == NULL )
-        {
-                printk_err ("Physical memory remap failed\n");
-                err = -ENODEV;
-                goto error_release_ctlmem;
-        }
-        if (( card->ctlmem = ioremap ( card->phys_ctlmem, 0x10 )) == NULL )
-        {
-                printk_err ("Control memory remap failed\n");
-                err = -ENODEV;
-                goto error_unmap_mem;
-        }
-        dbg ( DBG_PCI,"kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem);
-
-        /* Reset the card's processor */
-        fst_cpureset ( card );
-        card->state = FST_RESET;
-
-        /* Register the interrupt handler */
-        if ( request_irq ( card->irq, fst_intr, SA_SHIRQ, FST_DEV_NAME, card ))
-        {
-
-                printk_err ("Unable to register interrupt %d\n", card->irq );
-                err = -ENODEV;
-                goto error_unmap_ctlmem;
-        }
-
-        /* Record driver data for later use */
-        pci_set_drvdata(pdev, card);
-
-        /* Remainder of card setup */
-        fst_init_card ( card );
-
-        return 0;                       /* Success */
-
-
-                                        /* Failure. Release resources */
-error_unmap_ctlmem:
-        iounmap ( card->ctlmem );
-
-error_unmap_mem:
-        iounmap ( card->mem );
-
-error_release_ctlmem:
-        release_mem_region ( card->phys_ctlmem, 0x10 );
-
-error_release_mem:
-        release_mem_region ( card->phys_mem, FST_MEMSIZE );
-
-error_release_io:
-        release_region ( card->pci_conf, 0x80 );
-
-error_free_ports:
-	for (i = 0; i < card->nports; i++)
-		free_netdev(card->ports[i].dev);
-error_free_card:
-        kfree ( card );
-        return err;
-}
+	card->device = pdev;
 
+	dbg(DBG_PCI, "type %d nports %d irq %d\n", card->type,
+	    card->nports, card->irq);
+	dbg(DBG_PCI, "conf %04x mem %08x ctlmem %08x\n",
+	    card->pci_conf, card->phys_mem, card->phys_ctlmem);
+
+	/* Reset the card's processor */
+	fst_cpureset(card);
+	card->state = FST_RESET;
+
+	/* Initialise DMA (if required) */
+	fst_init_dma(card);
+
+	/* Record driver data for later use */
+	pci_set_drvdata(pdev, card);
+
+	/* Remainder of card setup */
+	fst_card_array[no_of_cards_added] = card;
+	card->card_no = no_of_cards_added++;	/* Record instance and bump it */
+	fst_init_card(card);
+	if (card->family == FST_FAMILY_TXU) {
+		/*
+		 * Allocate a dma buffer for transmit and receives
+		 */
+		card->rx_dma_handle_host =
+		    pci_alloc_consistent(card->device, FST_MAX_MTU,
+					 &card->rx_dma_handle_card);
+		if (card->rx_dma_handle_host == NULL) {
+			printk_err("Could not allocate rx dma buffer\n");
+			fst_disable_intr(card);
+			pci_release_regions(pdev);
+			pci_disable_device(pdev);
+			iounmap(card->ctlmem);
+			iounmap(card->mem);
+			kfree(card);
+			return -ENOMEM;
+		}
+		card->tx_dma_handle_host =
+		    pci_alloc_consistent(card->device, FST_MAX_MTU,
+					 &card->tx_dma_handle_card);
+		if (card->tx_dma_handle_host == NULL) {
+			printk_err("Could not allocate tx dma buffer\n");
+			fst_disable_intr(card);
+			pci_release_regions(pdev);
+			pci_disable_device(pdev);
+			iounmap(card->ctlmem);
+			iounmap(card->mem);
+			kfree(card);
+			return -ENOMEM;
+		}
+	}
+	return 0;		/* Success */
+}
 
 /*
  *      Cleanup and close down a card
  */
 static void __devexit
-fst_remove_one ( struct pci_dev *pdev )
+fst_remove_one(struct pci_dev *pdev)
 {
-        struct fst_card_info *card;
-        int i;
+	struct fst_card_info *card;
+	int i;
 
-        card = pci_get_drvdata(pdev);
+	card = pci_get_drvdata(pdev);
 
-        for ( i = 0 ; i < card->nports ; i++ )
-        {
+	for (i = 0; i < card->nports; i++) {
 		struct net_device *dev = port_to_dev(&card->ports[i]);
-                unregister_hdlc_device(dev);
-        }
-
-        fst_disable_intr ( card );
-        free_irq ( card->irq, card );
-
-        iounmap ( card->ctlmem );
-        iounmap ( card->mem );
-
-        release_mem_region ( card->phys_ctlmem, 0x10 );
-        release_mem_region ( card->phys_mem, FST_MEMSIZE );
-        release_region ( card->pci_conf, 0x80 );
+		unregister_hdlc_device(dev);
+	}
 
-	for (i = 0; i < card->nports; i++)
-		free_netdev(card->ports[i].dev);
+	fst_disable_intr(card);
+	free_irq(card->irq, card);
 
-        kfree ( card );
+	iounmap(card->ctlmem);
+	iounmap(card->mem);
+	pci_release_regions(pdev);
+	if (card->family == FST_FAMILY_TXU) {
+		/*
+		 * Free dma buffers
+		 */
+		pci_free_consistent(card->device, FST_MAX_MTU,
+				    card->rx_dma_handle_host,
+				    card->rx_dma_handle_card);
+		pci_free_consistent(card->device, FST_MAX_MTU,
+				    card->tx_dma_handle_host,
+				    card->tx_dma_handle_card);
+	}
+	fst_card_array[card->card_no] = NULL;
 }
 
 static struct pci_driver fst_driver = {
@@ -1700,15 +2694,20 @@ static struct pci_driver fst_driver = {
 static int __init
 fst_init(void)
 {
-        return pci_module_init ( &fst_driver );
+	int i;
+
+	for (i = 0; i < FST_MAX_CARDS; i++)
+		fst_card_array[i] = NULL;
+	spin_lock_init(&fst_work_q_lock);
+	return pci_module_init(&fst_driver);
 }
 
 static void __exit
 fst_cleanup_module(void)
 {
-        pci_unregister_driver ( &fst_driver );
+	printk_info("FarSync WAN driver unloading\n");
+	pci_unregister_driver(&fst_driver);
 }
 
-module_init ( fst_init );
-module_exit ( fst_cleanup_module );
-
+module_init(fst_init);
+module_exit(fst_cleanup_module);
diff --git a/drivers/net/wan/farsync.h b/drivers/net/wan/farsync.h
index f9e32e2f7..d871dafa8 100644
--- a/drivers/net/wan/farsync.h
+++ b/drivers/net/wan/farsync.h
@@ -32,8 +32,13 @@
  *      A short common prefix is useful for routines within the driver to avoid
  *      conflict with other similar drivers and I chosen to use "fst_" for this
  *      purpose (FarSite T-series).
+ *
+ *      Finally the device driver needs a short network interface name. Since
+ *      "hdlc" is already in use I've chosen the even less informative "sync"
+ *      for the present.
  */
 #define FST_NAME                "fst"           /* In debug/info etc */
+#define FST_NDEV_NAME           "sync"          /* For net interface */
 #define FST_DEV_NAME            "farsync"       /* For misc interfaces */
 
 
@@ -45,7 +50,7 @@
  *      have individual versions (or IDs) that move much faster than the
  *      the release version as individual updates are tracked.
  */
-#define FST_USER_VERSION        "0.09"
+#define FST_USER_VERSION        "1.04"
 
 
 /*      Ioctl call command values
@@ -100,6 +105,7 @@ struct fstioc_info {
         unsigned int   state;           /* State of card */
         unsigned int   index;           /* Index of port ioctl was issued on */
         unsigned int   smcFirmwareVersion;
+        unsigned long  kernelVersion;   /* What Kernel version we are working with */
         unsigned short lineInterface;   /* Physical interface type */
         unsigned char  proto;           /* Line protocol */
         unsigned char  internalClock;   /* 1 => internal clock, 0 => external */
@@ -110,6 +116,31 @@ struct fstioc_info {
         unsigned short cableStatus;     /* lsb: 0=> present, 1=> absent */
         unsigned short cardMode;        /* lsb: LED id mode */
         unsigned short debug;           /* Debug flags */
+        unsigned char  transparentMode; /* Not used always 0 */
+        unsigned char  invertClock;     /* Invert clock feature for syncing */
+        unsigned char  startingSlot;    /* Time slot to use for start of tx */
+        unsigned char  clockSource;     /* External or internal */
+        unsigned char  framing;         /* E1, T1 or J1 */
+        unsigned char  structure;       /* unframed, double, crc4, f4, f12, */
+                                        /* f24 f72 */
+        unsigned char  interface;       /* rj48c or bnc */
+        unsigned char  coding;          /* hdb3 b8zs */
+        unsigned char  lineBuildOut;    /* 0, -7.5, -15, -22 */
+        unsigned char  equalizer;       /* short or lon haul settings */
+        unsigned char  loopMode;        /* various loopbacks */
+        unsigned char  range;           /* cable lengths */
+        unsigned char  txBufferMode;    /* tx elastic buffer depth */
+        unsigned char  rxBufferMode;    /* rx elastic buffer depth */
+        unsigned char  losThreshold;    /* Attenuation on LOS signal */
+        unsigned char  idleCode;        /* Value to send as idle timeslot */
+        unsigned int   receiveBufferDelay; /* delay thro rx buffer timeslots */
+        unsigned int   framingErrorCount; /* framing errors */
+        unsigned int   codeViolationCount; /* code violations */
+        unsigned int   crcErrorCount;   /* CRC errors */
+        int            lineAttenuation; /* in dB*/
+        unsigned short lossOfSignal;
+        unsigned short receiveRemoteAlarm;
+        unsigned short alarmIndicationSignal;
 };
 
 /* "valid" bitmask */
@@ -131,13 +162,23 @@ struct fstioc_info {
                                          */
 #define FSTVAL_PROTO    0x00000200      /* proto */
 #define FSTVAL_MODE     0x00000400      /* cardMode */
+#define FSTVAL_PHASE    0x00000800      /* Clock phase */
+#define FSTVAL_TE1      0x00001000      /* T1E1 Configuration */
 #define FSTVAL_DEBUG    0x80000000      /* debug */
-#define FSTVAL_ALL      0x000007FF      /* Note: does not include DEBUG flag */
+#define FSTVAL_ALL      0x00001FFF      /* Note: does not include DEBUG flag */
 
 /* "type" */
 #define FST_TYPE_NONE   0               /* Probably should never happen */
 #define FST_TYPE_T2P    1               /* T2P X21 2 port card */
 #define FST_TYPE_T4P    2               /* T4P X21 4 port card */
+#define FST_TYPE_T1U    3               /* T1U X21 1 port card */
+#define FST_TYPE_T2U    4               /* T2U X21 2 port card */
+#define FST_TYPE_T4U    5               /* T4U X21 4 port card */
+#define FST_TYPE_TE1    6               /* T1E1 X21 1 port card */
+
+/* "family" */
+#define FST_FAMILY_TXP  0               /* T2P or T4P */
+#define FST_FAMILY_TXU  1               /* T1U or T2U or T4U */
 
 /* "state" */
 #define FST_UNINIT      0               /* Raw uninitialised state following
@@ -155,6 +196,10 @@ struct fstioc_info {
 #define V24             1
 #define X21             2
 #define V35             3
+#define X21D            4
+#define T1              5
+#define E1              6
+#define J1              7
 
 /* "proto" */
 #define FST_HDLC        1               /* Cisco compatible HDLC */
@@ -187,6 +232,97 @@ struct fstioc_info {
 /* "cardMode" bitmask */
 #define CARD_MODE_IDENTIFY      0x0001
 
+/* 
+ * Constants for T1/E1 configuration
+ */
+
+/*
+ * Clock source
+ */
+#define CLOCKING_SLAVE       0
+#define CLOCKING_MASTER      1
+
+/*
+ * Framing
+ */
+#define FRAMING_E1           0
+#define FRAMING_J1           1
+#define FRAMING_T1           2
+
+/*
+ * Structure
+ */
+#define STRUCTURE_UNFRAMED   0
+#define STRUCTURE_E1_DOUBLE  1
+#define STRUCTURE_E1_CRC4    2
+#define STRUCTURE_E1_CRC4M   3
+#define STRUCTURE_T1_4       4
+#define STRUCTURE_T1_12      5
+#define STRUCTURE_T1_24      6
+#define STRUCTURE_T1_72      7
+
+/*
+ * Interface
+ */
+#define INTERFACE_RJ48C      0
+#define INTERFACE_BNC        1
+
+/*
+ * Coding
+ */
+
+#define CODING_HDB3          0
+#define CODING_NRZ           1
+#define CODING_CMI           2
+#define CODING_CMI_HDB3      3
+#define CODING_CMI_B8ZS      4
+#define CODING_AMI           5
+#define CODING_AMI_ZCS       6
+#define CODING_B8ZS          7
+
+/*
+ * Line Build Out
+ */
+#define LBO_0dB              0
+#define LBO_7dB5             1
+#define LBO_15dB             2
+#define LBO_22dB5            3
+
+/*
+ * Range for long haul t1 > 655ft
+ */
+#define RANGE_0_133_FT       0
+#define RANGE_0_40_M         RANGE_0_133_FT
+#define RANGE_133_266_FT     1
+#define RANGE_40_81_M        RANGE_133_266_FT
+#define RANGE_266_399_FT     2
+#define RANGE_81_122_M       RANGE_266_399_FT
+#define RANGE_399_533_FT     3
+#define RANGE_122_162_M       RANGE_399_533_FT
+#define RANGE_533_655_FT     4
+#define RANGE_162_200_M      RANGE_533_655_FT
+/*
+ * Receive Equaliser
+ */
+#define EQUALIZER_SHORT      0
+#define EQUALIZER_LONG       1
+
+/*
+ * Loop modes
+ */
+#define LOOP_NONE            0
+#define LOOP_LOCAL           1
+#define LOOP_PAYLOAD_EXC_TS0 2
+#define LOOP_PAYLOAD_INC_TS0 3
+#define LOOP_REMOTE          4
+
+/*
+ * Buffer modes
+ */
+#define BUFFER_2_FRAME       0
+#define BUFFER_1_FRAME       1
+#define BUFFER_96_BIT        2
+#define BUFFER_NONE          3
 
 /*      Debug support
  *
diff --git a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c
index da93cca07..b7f6504a5 100644
--- a/drivers/net/wan/hd6457x.c
+++ b/drivers/net/wan/hd6457x.c
@@ -610,7 +610,6 @@ static void sca_close(struct net_device *dev)
 	card_t* card = port_to_card(port);
 
 	/* reset channel */
-	netif_stop_queue(dev);
 	sca_out(CMD_RESET, get_msci(port) + CMD, port_to_card(port));
 #ifdef __HD64570_H
 	/* disable MSCI interrupts */
@@ -624,6 +623,7 @@ static void sca_close(struct net_device *dev)
 	sca_outl(sca_inl(IER0, card) &
 		 (phy_node(port) ? 0x00FF00FF : 0xFF00FF00), IER0, card);
 #endif
+	netif_stop_queue(dev);
 }
 
 
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index 43e8bf3ce..31b379da2 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -180,7 +180,8 @@ static int cisco_rx(struct sk_buff *skb)
 
 		case CISCO_KEEPALIVE_REQ:
 			hdlc->state.cisco.rxseq = ntohl(cisco_data->par1);
-			if (ntohl(cisco_data->par2)==hdlc->state.cisco.txseq) {
+			if (hdlc->state.cisco.request_sent &&
+			    ntohl(cisco_data->par2)==hdlc->state.cisco.txseq) {
 				hdlc->state.cisco.last_poll = jiffies;
 				if (!hdlc->state.cisco.up) {
 					u32 sec, min, hrs, days;
@@ -192,8 +193,9 @@ static int cisco_rx(struct sk_buff *skb)
 					       "uptime %ud%uh%um%us)\n",
 					       dev->name, days, hrs,
 					       min, sec);
+					netif_carrier_on(dev);
+					hdlc->state.cisco.up = 1;
 				}
-				hdlc->state.cisco.up = 1;
 			}
 
 			dev_kfree_skb_any(skb);
@@ -219,17 +221,18 @@ static void cisco_timer(unsigned long arg)
 	struct net_device *dev = (struct net_device *)arg;
 	hdlc_device *hdlc = dev_to_hdlc(dev);
 
-	if (hdlc->state.cisco.up && jiffies - hdlc->state.cisco.last_poll >=
-	    hdlc->state.cisco.settings.timeout * HZ) {
+	if (hdlc->state.cisco.up &&
+	    time_after(jiffies, hdlc->state.cisco.last_poll +
+		       hdlc->state.cisco.settings.timeout * HZ)) {
 		hdlc->state.cisco.up = 0;
 		printk(KERN_INFO "%s: Link down\n", dev->name);
-		if (netif_carrier_ok(dev))
-			netif_carrier_off(dev);
+		netif_carrier_off(dev);
 	}
 
 	cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
 			     ++hdlc->state.cisco.txseq,
 			     hdlc->state.cisco.rxseq);
+	hdlc->state.cisco.request_sent = 1;
 	hdlc->state.cisco.timer.expires = jiffies +
 		hdlc->state.cisco.settings.interval * HZ;
 	hdlc->state.cisco.timer.function = cisco_timer;
@@ -242,8 +245,8 @@ static void cisco_timer(unsigned long arg)
 static void cisco_start(struct net_device *dev)
 {
 	hdlc_device *hdlc = dev_to_hdlc(dev);
-	hdlc->state.cisco.last_poll = 0;
 	hdlc->state.cisco.up = 0;
+	hdlc->state.cisco.request_sent = 0;
 	hdlc->state.cisco.txseq = hdlc->state.cisco.rxseq = 0;
 
 	init_timer(&hdlc->state.cisco.timer);
@@ -257,9 +260,12 @@ static void cisco_start(struct net_device *dev)
 
 static void cisco_stop(struct net_device *dev)
 {
-	del_timer_sync(&dev_to_hdlc(dev)->state.cisco.timer);
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	del_timer_sync(&hdlc->state.cisco.timer);
 	if (netif_carrier_ok(dev))
 		netif_carrier_off(dev);
+	hdlc->state.cisco.up = 0;
+	hdlc->state.cisco.request_sent = 0;
 }
 
 
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index e9c995ea1..8feed459c 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -584,8 +584,9 @@ static void fr_timer(unsigned long arg)
 	u32 list;
 
 	if (hdlc->state.fr.settings.dce)
-		reliable = (jiffies - hdlc->state.fr.last_poll <
-			    hdlc->state.fr.settings.t392 * HZ);
+		reliable = hdlc->state.fr.request &&
+			time_before(jiffies, hdlc->state.fr.last_poll +
+				    hdlc->state.fr.settings.t392 * HZ);
 	else {
 		hdlc->state.fr.last_errors <<= 1; /* Shift the list */
 		if (hdlc->state.fr.request) {
@@ -617,6 +618,7 @@ static void fr_timer(unsigned long arg)
 
 		fr_lmi_send(dev, hdlc->state.fr.n391cnt == 0);
 
+		hdlc->state.fr.last_poll = jiffies;
 		hdlc->state.fr.request = 1;
 		hdlc->state.fr.timer.expires = jiffies +
 			hdlc->state.fr.settings.t391 * HZ;
@@ -689,6 +691,7 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
 			       dev->name, reptype);
 			return 1;
 		}
+		hdlc->state.fr.last_poll = jiffies;
 	}
 
 	error = 0;
@@ -728,7 +731,12 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
 
 	/* DTE */
 
-	if (reptype != LMI_FULLREP || error)
+	hdlc->state.fr.request = 0; /* got response, no request pending */
+
+	if (error)
+		return 0;
+
+	if (reptype != LMI_FULLREP)
 		return 0;
 
 	stat_len = 3;
@@ -829,9 +837,6 @@ static int fr_rx(struct sk_buff *skb)
 			if (fr_lmi_recv(ndev, skb))
 				goto rx_error;
 			else {
-				/* No request pending */
-				hdlc->state.fr.request = 0;
-				hdlc->state.fr.last_poll = jiffies;
 				dev_kfree_skb_any(skb);
 				return NET_RX_SUCCESS;
 			}
@@ -946,9 +951,6 @@ static void fr_start(struct net_device *dev)
 	printk(KERN_DEBUG "fr_start\n");
 #endif
 	if (hdlc->state.fr.settings.lmi != LMI_NONE) {
-		if (netif_carrier_ok(dev))
-			netif_carrier_off(dev);
-		hdlc->state.fr.last_poll = 0;
 		hdlc->state.fr.reliable = 0;
 		hdlc->state.fr.dce_changed = 1;
 		hdlc->state.fr.request = 0;
diff --git a/drivers/net/wan/hdlc_generic.c b/drivers/net/wan/hdlc_generic.c
index 2aa4ae046..6ed064cb4 100644
--- a/drivers/net/wan/hdlc_generic.c
+++ b/drivers/net/wan/hdlc_generic.c
@@ -15,6 +15,11 @@
  *	* X.25
  *
  * Use sethdlc utility to set line parameters, protocol and PVCs
+ *
+ * How does it work:
+ * - proto.open(), close(), start(), stop() calls are serialized.
+ *   The order is: open, [ start, stop ... ] close ...
+ * - proto.start() and stop() are called with spin_lock_irq held.
  */
 
 #include <linux/config.h>
@@ -33,7 +38,7 @@
 #include <linux/hdlc.h>
 
 
-static const char* version = "HDLC support module revision 1.16";
+static const char* version = "HDLC support module revision 1.17";
 
 #undef DEBUG_LINK
 
@@ -69,51 +74,75 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
 
 
 
+static void __hdlc_set_carrier_on(struct net_device *dev)
+{
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	if (hdlc->proto.start)
+		return hdlc->proto.start(dev);
+#ifdef DEBUG_LINK
+	if (netif_carrier_ok(dev))
+		printk(KERN_ERR "hdlc_set_carrier_on(): already on\n");
+#endif
+	netif_carrier_on(dev);
+}
+
+
+
+static void __hdlc_set_carrier_off(struct net_device *dev)
+{
+	hdlc_device *hdlc = dev_to_hdlc(dev);
+	if (hdlc->proto.stop)
+		return hdlc->proto.stop(dev);
+
+#ifdef DEBUG_LINK
+	if (!netif_carrier_ok(dev))
+		printk(KERN_ERR "hdlc_set_carrier_off(): already off\n");
+#endif
+	netif_carrier_off(dev);
+}
+
+
+
 void hdlc_set_carrier(int on, struct net_device *dev)
 {
 	hdlc_device *hdlc = dev_to_hdlc(dev);
+	unsigned long flags;
 	on = on ? 1 : 0;
 
 #ifdef DEBUG_LINK
 	printk(KERN_DEBUG "hdlc_set_carrier %i\n", on);
 #endif
 
-	spin_lock_irq(&hdlc->state_lock);
+	spin_lock_irqsave(&hdlc->state_lock, flags);
 
 	if (hdlc->carrier == on)
 		goto carrier_exit; /* no change in DCD line level */
 
-	printk(KERN_INFO "%s: carrier %s\n", dev->name,
-	       on ? "ON" : "off");
+#ifdef DEBUG_LINK
+	printk(KERN_INFO "%s: carrier %s\n", dev->name, on ? "ON" : "off");
+#endif
 	hdlc->carrier = on;
 
 	if (!hdlc->open)
 		goto carrier_exit;
 
-	if (hdlc->carrier) {
-		if (hdlc->proto.start)
-			hdlc->proto.start(dev);
-		else if (!netif_carrier_ok(dev))
-			netif_carrier_on(dev);
-
-	} else { /* no carrier */
-		if (hdlc->proto.stop)
-			hdlc->proto.stop(dev);
-		else if (netif_carrier_ok(dev))
-			netif_carrier_off(dev);
-	}
+	if (hdlc->carrier)
+		__hdlc_set_carrier_on(dev);
+	else
+		__hdlc_set_carrier_off(dev);
 
- carrier_exit:
-	spin_unlock_irq(&hdlc->state_lock);
+carrier_exit:
+	spin_unlock_irqrestore(&hdlc->state_lock, flags);
 }
 
 
+
 /* Must be called by hardware driver when HDLC device is being opened */
 int hdlc_open(struct net_device *dev)
 {
 	hdlc_device *hdlc = dev_to_hdlc(dev);
 #ifdef DEBUG_LINK
-	printk(KERN_DEBUG "hdlc_open carrier %i open %i\n",
+	printk(KERN_DEBUG "hdlc_open() carrier %i open %i\n",
 	       hdlc->carrier, hdlc->open);
 #endif
 
@@ -128,14 +157,8 @@ int hdlc_open(struct net_device *dev)
 
 	spin_lock_irq(&hdlc->state_lock);
 
-	if (hdlc->carrier) {
-		if (hdlc->proto.start)
-			hdlc->proto.start(dev);
-		else if (!netif_carrier_ok(dev))
-			netif_carrier_on(dev);
-
-	} else if (netif_carrier_ok(dev))
-		netif_carrier_off(dev);
+	if (hdlc->carrier)
+		__hdlc_set_carrier_on(dev);
 
 	hdlc->open = 1;
 
@@ -150,15 +173,15 @@ void hdlc_close(struct net_device *dev)
 {
 	hdlc_device *hdlc = dev_to_hdlc(dev);
 #ifdef DEBUG_LINK
-	printk(KERN_DEBUG "hdlc_close carrier %i open %i\n",
+	printk(KERN_DEBUG "hdlc_close() carrier %i open %i\n",
 	       hdlc->carrier, hdlc->open);
 #endif
 
 	spin_lock_irq(&hdlc->state_lock);
 
 	hdlc->open = 0;
-	if (hdlc->carrier && hdlc->proto.stop)
-		hdlc->proto.stop(dev);
+	if (hdlc->carrier)
+		__hdlc_set_carrier_off(dev);
 
 	spin_unlock_irq(&hdlc->state_lock);
 
@@ -185,7 +208,7 @@ void hdlc_close(struct net_device *dev)
 #endif
 
 #ifndef CONFIG_HDLC_FR
-#define hdlc_fr_ioctl(dev, ifr)	-ENOSYS
+#define hdlc_fr_ioctl(dev, ifr)		-ENOSYS
 #endif
 
 #ifndef CONFIG_HDLC_X25
@@ -257,25 +280,7 @@ struct net_device *alloc_hdlcdev(void *priv)
 
 int register_hdlc_device(struct net_device *dev)
 {
-	int result;
-	hdlc_device *hdlc = dev_to_hdlc(dev);
-
-	dev->get_stats = hdlc_get_stats;
-	dev->change_mtu = hdlc_change_mtu;
-	dev->mtu = HDLC_MAX_MTU;
-
-	dev->type = ARPHRD_RAWHDLC;
-	dev->hard_header_len = 16;
-
-	dev->flags = IFF_POINTOPOINT | IFF_NOARP;
-
-	hdlc->proto.id = -1;
-	hdlc->proto.detach = NULL;
-	hdlc->carrier = 1;
-	hdlc->open = 0;
-	spin_lock_init(&hdlc->state_lock);
-
-	result = dev_alloc_name(dev, "hdlc%d");
+	int result = dev_alloc_name(dev, "hdlc%d");
 	if (result < 0)
 		return result;
 
@@ -283,6 +288,9 @@ int register_hdlc_device(struct net_device *dev)
 	if (result != 0)
 		return -EIO;
 
+	if (netif_carrier_ok(dev))
+		netif_carrier_off(dev); /* no carrier until DCD goes up */
+
 	return 0;
 }
 
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index 05aa310d3..29b82687b 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -2542,7 +2542,7 @@ int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	pc300conf_t conf_aux;
 	pc300chconf_t *conf = (pc300chconf_t *) & chan->conf;
 	int ch = chan->channel;
-	void *arg = (void *) ifr->ifr_data;
+	void __user *arg = ifr->ifr_data;
 	struct if_settings *settings = &ifr->ifr_settings;
 	uclong scabase = card->hw.scabase;
 
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index e61774aef..311ac346f 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -1342,7 +1342,7 @@ sbni_ioctl( struct net_device  *dev,  struct ifreq  *ifr,  int  cmd )
 			return  -EPERM;
 
 		spin_lock( &nl->lock );
-		flags = *(struct sbni_flags*) &ifr->ifr_data;
+		flags = *(struct sbni_flags*) &ifr->ifr_ifru;
 		if( flags.fixed_rxl )
 			nl->delta_rxl = 0,
 			nl->cur_rxl_index = flags.rxl;
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 0abba0f12..12598181a 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -1095,7 +1095,7 @@ static int sdla_open(struct net_device *dev)
 	return(0);
 }
 
-static int sdla_config(struct net_device *dev, struct frad_conf *conf, int get)
+static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get)
 {
 	struct frad_local *flp;
 	struct conf_data  data;
@@ -1193,7 +1193,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf *conf, int get)
 	return(0);
 }
 
-static int sdla_xfer(struct net_device *dev, struct sdla_mem *info, int read)
+static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read)
 {
 	struct sdla_mem mem;
 	char	*temp;
@@ -1271,7 +1271,7 @@ static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	{
 		case FRAD_GET_CONF:
 		case FRAD_SET_CONF:
-			return(sdla_config(dev, (struct frad_conf *)ifr->ifr_data, cmd == FRAD_GET_CONF));
+			return(sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF));
 
 		case SDLA_IDENTIFY:
 			ifr->ifr_flags = flp->type;
@@ -1306,7 +1306,7 @@ NOTE:  This is rather a useless action right now, as the
 
 		case SDLA_WRITEMEM:
 		case SDLA_READMEM:
-			return(sdla_xfer(dev, (struct sdla_mem *)ifr->ifr_data, cmd == SDLA_READMEM));
+			return(sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM));
 
 		case SDLA_START:
 			sdla_start(dev);
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index 2bd23f6a8..3f997bf96 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -20,6 +20,7 @@
 #include <linux/if_arp.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
+#include <linux/init.h>
 #include <net/arp.h>
 
 #include <asm/io.h>
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index 54d1da408..6370aa7c2 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -418,8 +418,10 @@ static int wanxl_open(struct net_device *dev)
 
 	timeout = jiffies + HZ;
 	do
-		if (get_status(port)->open)
+		if (get_status(port)->open) {
+			netif_start_queue(dev);
 			return 0;
+		}
 	while (time_after(timeout, jiffies));
 
 	printk(KERN_ERR "%s: unable to open port\n", dev->name);
@@ -450,6 +452,8 @@ static int wanxl_close(struct net_device *dev)
 	if (get_status(port)->open)
 		printk(KERN_ERR "%s: unable to close port\n", dev->name);
 
+	netif_stop_queue(dev);
+
 	for (i = 0; i < TX_BUFFERS; i++) {
 		desc_t *desc = &get_status(port)->tx_descs[i];
 
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 40231b6c4..57ef2ac72 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -861,7 +861,9 @@ typedef struct {
 #define AIROGMICRID		11
 #define AIROGMICSTATS		12
 #define AIROGFLAGS		13
+#define AIROGID			14
 #define AIRORRID		15
+#define AIRORSWVERSION		17
 
 /* Leave gap of 40 commands after AIROGSTATSD32 for future */
 
@@ -892,10 +894,13 @@ typedef struct {
 #define AUXMEMSIZE	(256 * 1024)
 
 typedef struct aironet_ioctl {
-	unsigned short command;	// What to do
+	unsigned short command;		// What to do
 	unsigned short len;		// Len of data
-	unsigned char *data;		// d-data
+	unsigned short ridnum;		// rid number
+	unsigned char __user *data;	// d-data
 } aironet_ioctl;
+
+static char *swversion = "2.1";
 #endif /* CISCO_EXT */
 
 #define NUM_MODULES       2
@@ -1097,6 +1102,7 @@ static int transmit_802_11_packet(struct airo_info*, int len, char *pPacket);
 static int mpi_send_packet (struct net_device *dev);
 static void mpi_unmap_card(struct pci_dev *pci);
 static void mpi_receive_802_3(struct airo_info *ai);
+static void mpi_receive_802_11(struct airo_info *ai);
 static int waitbusy (struct airo_info *ai);
 
 static irqreturn_t airo_interrupt( int irq, void* dev_id, struct pt_regs
@@ -2451,17 +2457,19 @@ static int mpi_init_descriptors (struct airo_info *ai)
 	cmd.parm0 = FID_TX;
 	cmd.parm1 = (ai->txfids[0].card_ram_off - ai->pciaux);
 	cmd.parm2 = MPI_MAX_FIDS;
-	rc=issuecommand(ai, &cmd, &rsp);
-	if (rc != SUCCESS) {
-		printk(KERN_ERR "airo:  Couldn't allocate TX FID\n");
-		return rc;
-	}
 
 	for (i=0; i<MPI_MAX_FIDS; i++) {
 		ai->txfids[i].tx_desc.valid = 1;
 		memcpy((char *)ai->txfids[i].card_ram_off,
 			&ai->txfids[i].tx_desc, sizeof(TxFid));
 	}
+	ai->txfids[i-1].tx_desc.eoc = 1; /* Last descriptor has EOC set */
+
+	rc=issuecommand(ai, &cmd, &rsp);
+	if (rc != SUCCESS) {
+		printk(KERN_ERR "airo:  Couldn't allocate TX FID\n");
+		return rc;
+	}
 
 	/* Alloc card Rid descriptor */
 	memset(&rsp,0,sizeof(rsp));
@@ -2653,7 +2661,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,
 	return dev;
 }
 
-int reset_mpi_card( struct net_device *dev , int lock) {
+int reset_card( struct net_device *dev , int lock) {
 	struct airo_info *ai = dev->priv;
 
 	if (lock && down_interruptible(&ai->sem))
@@ -2737,9 +2745,6 @@ struct net_device *_init_airo_card( unsigned short irq, int port,
 		SET_NETDEV_DEV(dev, &pci->dev);
 	}
 
-	if (test_bit(FLAG_MPI,&ai->flags))
-		reset_mpi_card (dev, 1);
-
 	rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev );
 	if (rc) {
 		printk(KERN_ERR "airo: register interrupt %d failed, rc %d\n", irq, rc );
@@ -2776,8 +2781,7 @@ struct net_device *_init_airo_card( unsigned short irq, int port,
 		printk(KERN_ERR "airo: Couldn't register_netdev\n");
 		goto err_out_map;
 	}
-	if (!test_bit(FLAG_MPI,&ai->flags))
-		ai->wifidev = init_wifidev(ai, dev);
+	ai->wifidev = init_wifidev(ai, dev);
 
 	set_bit(FLAG_REGISTERED,&ai->flags);
 	printk( KERN_INFO "airo: MAC enabled %s %x:%x:%x:%x:%x:%x\n",
@@ -2840,7 +2844,7 @@ int reset_airo_card( struct net_device *dev )
 	int i;
 	struct airo_info *ai = dev->priv;
 
-	if (reset_mpi_card (dev, 1))
+	if (reset_card (dev, 1))
 		return -1;
 
 	if ( setup_card(ai, dev->dev_addr, 1 ) != SUCCESS ) {
@@ -3101,7 +3105,10 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
 			u16 *buffer;
 
 			if (test_bit(FLAG_MPI,&apriv->flags)) {
-				mpi_receive_802_3(apriv);
+				if (test_bit(FLAG_802_11, &apriv->flags))
+					mpi_receive_802_11(apriv);
+				else
+					mpi_receive_802_3(apriv);
 				OUT4500(apriv, EVACK, EV_RX);
 				goto exitrx;
 			}
@@ -3483,6 +3490,112 @@ badrx:
 	}
 }
 
+void mpi_receive_802_11 (struct airo_info *ai)
+{
+	RxFid rxd;
+	struct sk_buff *skb = NULL;
+	u16 fc, len, hdrlen = 0;
+#pragma pack(1)
+	struct {
+		u16 status, len;
+		u8 rssi[2];
+		u8 rate;
+		u8 freq;
+		u16 tmp[4];
+	} hdr;
+#pragma pack()
+	u16 gap;
+	u16 *buffer;
+	char *ptr = ai->rxfids[0].virtual_host_addr+4;
+
+	memcpy ((char *)&rxd, ai->rxfids[0].card_ram_off, sizeof(rxd));
+	memcpy ((char *)&hdr, ptr, sizeof(hdr));
+	ptr += sizeof(hdr);
+	/* Bad CRC. Ignore packet */
+	if (le16_to_cpu(hdr.status) & 2)
+		hdr.len = 0;
+	if (ai->wifidev == NULL)
+		hdr.len = 0;
+	len = le16_to_cpu(hdr.len);
+	if (len > 2312) {
+		printk( KERN_ERR "airo: Bad size %d\n", len );
+		goto badrx;
+	}
+	if (len == 0)
+		goto badrx;
+
+	memcpy ((char *)&fc, ptr, sizeof(fc));
+	fc = le16_to_cpu(fc);
+	switch (fc & 0xc) {
+		case 4:
+			if ((fc & 0xe0) == 0xc0)
+				hdrlen = 10;
+			else
+				hdrlen = 16;
+			break;
+		case 8:
+			if ((fc&0x300)==0x300){
+				hdrlen = 30;
+				break;
+			}
+		default:
+			hdrlen = 24;
+	}
+
+	skb = dev_alloc_skb( len + hdrlen + 2 );
+	if ( !skb ) {
+		ai->stats.rx_dropped++;
+		goto badrx;
+	}
+	buffer = (u16*)skb_put (skb, len + hdrlen);
+	memcpy ((char *)buffer, ptr, hdrlen);
+	ptr += hdrlen;
+	if (hdrlen == 24)
+		ptr += 6;
+	memcpy ((char *)&gap, ptr, sizeof(gap));
+	ptr += sizeof(gap);
+	gap = le16_to_cpu(gap);
+	if (gap) {
+		if (gap <= 8)
+			ptr += gap;
+		else
+			printk(KERN_ERR
+			    "airo: gaplen too big. Problems will follow...\n");
+	}
+	memcpy ((char *)buffer + hdrlen, ptr, len);
+	ptr += len;
+#ifdef IW_WIRELESS_SPY	  /* defined in iw_handler.h */
+	if (ai->spy_data.spy_number > 0) {
+		char *sa;
+		struct iw_quality wstats;
+		/* Prepare spy data : addr + qual */
+		sa = (char*)buffer + 10;
+		wstats.qual = hdr.rssi[0];
+		if (ai->rssi)
+			wstats.level = 0x100 - ai->rssi[hdr.rssi[1]].rssidBm;
+		else
+			wstats.level = (hdr.rssi[1] + 321) / 2;
+		wstats.updated = 3;
+		/* Update spy records */
+		wireless_spy_update(ai->dev, sa, &wstats);
+	}
+#endif /* IW_WIRELESS_SPY */
+	skb->mac.raw = skb->data;
+	skb->pkt_type = PACKET_OTHERHOST;
+	skb->dev = ai->wifidev;
+	skb->protocol = htons(ETH_P_802_2);
+	skb->dev->last_rx = jiffies;
+	skb->ip_summed = CHECKSUM_NONE;
+	netif_rx( skb );
+badrx:
+	if (rxd.valid == 0) {
+		rxd.valid = 1;
+		rxd.rdy = 0;
+		rxd.len = PKTSIZE;
+		memcpy (ai->rxfids[0].card_ram_off, (char *)&rxd, sizeof(rxd));
+	}
+}
+
 static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
 {
 	Cmd cmd;
@@ -3550,10 +3663,16 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
 		status = readCapabilityRid(ai, &cap_rid, lock);
 		if ( status != SUCCESS ) return ERROR;
 
+		/*
+		 * This driver supports MPI350 firmwares up to, and
+		 * including 5.30.17
+		 */
 		if (test_bit(FLAG_MPI, &ai->flags) &&
-		    strcmp (cap_rid.prodVer, "5.00.01") &&
-		    strcmp (cap_rid.prodVer, "5.00.03") &&
-		    strcmp (cap_rid.prodVer, "5b00.08"))
+		    strncmp (cap_rid.prodVer, "5.00.", 5) &&
+		    strncmp (cap_rid.prodVer, "5b00.", 5) &&
+		    strncmp (cap_rid.prodVer, "5.02.", 5) &&
+		    strncmp (cap_rid.prodVer, "5.20.", 5) &&
+		    strncmp (cap_rid.prodVer, "5.30.", 5))
 			printk(KERN_ERR "airo: Firmware version %s is not supported. Use it at your own risk!\n", cap_rid.prodVer);
 
 		status = PC4500_readrid(ai,RID_RSSI,&rssi_rid,sizeof(rssi_rid),lock);
@@ -3934,7 +4053,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid,
 		memset(&rsp, 0, sizeof(rsp));
 
 		ai->config_desc.rid_desc.valid = 1;
-		ai->config_desc.rid_desc.len = RIDSIZE;
+		ai->config_desc.rid_desc.len = *((u16 *)pBuf);
 		ai->config_desc.rid_desc.rid = 0;
 
 		cmd.cmd = CMD_WRITERID;
@@ -4153,12 +4272,12 @@ static int transmit_802_11_packet(struct airo_info *ai, int len, char *pPacket)
  */
 
 static ssize_t proc_read( struct file *file,
-			  char *buffer,
+			  char __user *buffer,
 			  size_t len,
 			  loff_t *offset);
 
 static ssize_t proc_write( struct file *file,
-			   const char *buffer,
+			   const char __user *buffer,
 			   size_t len,
 			   loff_t *offset );
 static int proc_close( struct inode *inode, struct file *file );
@@ -4363,23 +4482,26 @@ static int takedown_proc_entry( struct net_device *dev,
  *  to supply the data.
  */
 static ssize_t proc_read( struct file *file,
-			  char *buffer,
+			  char __user *buffer,
 			  size_t len,
 			  loff_t *offset )
 {
-	int i;
-	int pos;
+	loff_t pos = *offset;
 	struct proc_data *priv = (struct proc_data*)file->private_data;
 
-	if( !priv->rbuffer ) return -EINVAL;
+	if (!priv->rbuffer)
+		return -EINVAL;
 
-	pos = *offset;
-	for( i = 0; i+pos < priv->readlen && i < len; i++ ) {
-		if (put_user( priv->rbuffer[i+pos], buffer+i ))
-			return -EFAULT;
-	}
-	*offset += i;
-	return i;
+	if (pos < 0)
+		return -EINVAL;
+	if (pos >= priv->readlen)
+		return 0;
+	if (len > priv->readlen - pos)
+		len = priv->readlen - pos;
+	if (copy_to_user(buffer, priv->rbuffer + pos, len))
+		return -EFAULT;
+	*offset = pos + len;
+	return len;
 }
 
 /*
@@ -4387,28 +4509,26 @@ static ssize_t proc_read( struct file *file,
  *  to supply the data.
  */
 static ssize_t proc_write( struct file *file,
-			   const char *buffer,
+			   const char __user *buffer,
 			   size_t len,
 			   loff_t *offset )
 {
-	int i;
-	int pos;
+	loff_t pos = *offset;
 	struct proc_data *priv = (struct proc_data*)file->private_data;
 
-	if ( !priv->wbuffer ) {
+	if (!priv->wbuffer)
 		return -EINVAL;
-	}
-
-	pos = *offset;
 
-	for( i = 0; i + pos <  priv->maxwritelen &&
-		     i < len; i++ ) {
-		if (get_user( priv->wbuffer[i+pos], buffer + i ))
-			return -EFAULT;
-	}
-	if ( i+pos > priv->writelen ) priv->writelen = i+file->f_pos;
-	*offset += i;
-	return i;
+	if (pos < 0)
+		return -EINVAL;
+	if (pos >= priv->maxwritelen)
+		return 0;
+	if (len > priv->maxwritelen - pos)
+		len = priv->maxwritelen - pos;
+	if (copy_from_user(priv->wbuffer + pos, buffer, len))
+		return -EFAULT;
+	*offset = pos + len;
+	return len;
 }
 
 static int proc_status_open( struct inode *inode, struct file *file ) {
@@ -5378,7 +5498,6 @@ static int airo_pci_resume(struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct airo_info *ai = dev->priv;
 	Resp rsp;
-	int err;
 
 	printk(KERN_DEBUG "%s: airo_mpi waking up\n", dev->name);
 
@@ -5386,13 +5505,6 @@ static int airo_pci_resume(struct pci_dev *pdev)
 		return 0;
 
 	if (ai->power > 1) {
-		err = reset_mpi_card(dev, 0);
-		if (err) {
-			printk(KERN_ERR "%s: Error %d resetting on %s()\n",
-			       dev->name, err, __FUNCTION__);
-			return err;
-		}
-		schedule_timeout (HZ/2);
 		mpi_init_descriptors(ai);
 		setup_card(ai, dev->dev_addr, 0);
 		clear_bit(FLAG_RADIO_OFF, &ai->flags);
@@ -6786,7 +6898,10 @@ static int airo_config_commit(struct net_device *dev,
 
 		readAPListRid(local, &APList_rid);
 		readSsidRid(local, &SSID_rid);
-		reset_airo_card(dev);
+		if (test_bit(FLAG_MPI,&local->flags))
+			setup_card(local, dev->dev_addr, 1 );
+		else
+			reset_airo_card(dev);
 		disable_MAC(local, 1);
 		writeSsidRid(local, &SSID_rid, 1);
 		writeAPListRid(local, &APList_rid, 1);
@@ -6946,9 +7061,15 @@ static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
 		/* Separate R/W functions bracket legality here
 		 */
-		if ( com.command <= AIRORRID )
+		if ( com.command == AIRORSWVERSION ) {
+			if (copy_to_user(com.data, swversion, sizeof(swversion)))
+				rc = -EFAULT;
+			else
+				rc = 0;
+		}
+		else if ( com.command <= AIRORRID)
 			rc = readrids(dev,&com);
-		else if ( com.command >= AIROPCAP && com.command <= AIROPLEAPUSR )
+		else if ( com.command >= AIROPCAP && com.command <= (AIROPLEAPUSR+2) )
 			rc = writerids(dev,&com);
 		else if ( com.command >= AIROFLSHRST && com.command <= AIRORESTART )
 			rc = flashcard(dev,&com);
@@ -7078,7 +7199,7 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) {
 			return -EFAULT;
 		return 0;
 #endif
-	case AIRORRID:      ridcode = comp->len;        break;
+	case AIRORRID:      ridcode = comp->ridnum;     break;
 	default:
 		return -EINVAL;
 		break;
@@ -7092,10 +7213,7 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) {
 	 * then return it to the user
 	 * 9/22/2000 Honor user given length
 	 */
-	if (comp->command == AIRORRID)
-		len = le16_to_cpu(*(unsigned short *)iobuf); /* Yuck! */
-	else
-		len = comp->len;
+	len = comp->len;
 
 	if (copy_to_user(comp->data, iobuf, min(len, (int)RIDSIZE))) {
 		kfree (iobuf);
@@ -7141,6 +7259,8 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) {
 	case AIROPLEAPPWD:  ridcode = RID_LEAPPASSWORD; break;
 	case AIROPWEPKEY:   ridcode = RID_WEP_TEMP; writer = PC4500_writerid;
 		break;
+	case AIROPLEAPUSR+1: ridcode = 0xFF2A;          break;
+	case AIROPLEAPUSR+2: ridcode = 0xFF2B;          break;
 
 		/* this is not really a rid but a command given to the card
 		 * same with MAC off
diff --git a/drivers/net/wireless/hermes.h b/drivers/net/wireless/hermes.h
index 58adf4004..126923ffd 100644
--- a/drivers/net/wireless/hermes.h
+++ b/drivers/net/wireless/hermes.h
@@ -384,7 +384,7 @@ static inline void hermes_read_words(struct hermes *hw, int off, void *buf, unsi
 
 static inline void hermes_write_words(struct hermes *hw, int off, const void *buf, unsigned count)
 {
-	off = off << hw->reg_spacing;;
+	off = off << hw->reg_spacing;
 
 	if (hw->io_space) {
 		outsw(hw->iobase + off, buf, count);
@@ -406,7 +406,7 @@ static inline void hermes_clear_words(struct hermes *hw, int off, unsigned count
 {
 	unsigned i;
 
-	off = off << hw->reg_spacing;;
+	off = off << hw->reg_spacing;
 
 	if (hw->io_space) {
 		for (i = 0; i < count; i++)
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
index 9cb849a70..fb1ebf409 100644
--- a/drivers/net/wireless/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco_pci.c
@@ -102,7 +102,6 @@
 #include <linux/wireless.h>
 #include <linux/list.h>
 #include <linux/pci.h>
-#include <linux/wireless.h>
 #include <linux/fcntl.h>
 
 #include <asm/uaccess.h>
diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c
index 40c90fc5f..0fcf84689 100644
--- a/drivers/net/wireless/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco_plx.c
@@ -125,7 +125,6 @@ not have time for a while..
 #include <linux/wireless.h>
 #include <linux/list.h>
 #include <linux/pci.h>
-#include <linux/wireless.h>
 #include <linux/fcntl.h>
 
 #include <pcmcia/cisreg.h>
diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c
index 3a3f83c43..6e5ca46e8 100644
--- a/drivers/net/wireless/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco_tmd.c
@@ -69,7 +69,6 @@
 #include <linux/wireless.h>
 #include <linux/list.h>
 #include <linux/pci.h>
-#include <linux/wireless.h>
 #include <linux/fcntl.h>
 
 #include <pcmcia/cisreg.h>
diff --git a/drivers/net/wireless/prism54/isl_38xx.c b/drivers/net/wireless/prism54/isl_38xx.c
index bbda5cde4..2e669a643 100644
--- a/drivers/net/wireless/prism54/isl_38xx.c
+++ b/drivers/net/wireless/prism54/isl_38xx.c
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.c,v 1.22 2004/02/28 03:06:07 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *  Copyright (C) 2003-2004 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>_
diff --git a/drivers/net/wireless/prism54/isl_38xx.h b/drivers/net/wireless/prism54/isl_38xx.h
index ea954f17f..5f644836f 100644
--- a/drivers/net/wireless/prism54/isl_38xx.h
+++ b/drivers/net/wireless/prism54/isl_38xx.h
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.h,v 1.22 2004/02/28 03:06:07 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index e1261e534..426fc2e3e 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -1,7 +1,7 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.c,v 1.140 2004/02/28 03:06:07 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
- *            (C) 2003 Aurelien Alleaume <slts@free.fr>
+ *            (C) 2003,2004 Aurelien Alleaume <slts@free.fr>
  *            (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
  *            (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
  *
@@ -87,9 +87,9 @@ prism54_mib_mode_helper(islpci_private *priv, u32 iw_mode)
 
 	/* For now, just catch early the Repeater and Secondary modes here */
 	if (iw_mode == IW_MODE_REPEAT || iw_mode == IW_MODE_SECOND) {
-		printk(KERN_DEBUG "%s(): Sorry, Repeater mode and Secondary mode "
-				"are not yet supported by this driver.\n",
-		       __FUNCTION__);
+		printk(KERN_DEBUG
+		       "%s(): Sorry, Repeater mode and Secondary mode "
+		       "are not yet supported by this driver.\n", __FUNCTION__);
 		return -EINVAL;
 	}
 
@@ -143,8 +143,8 @@ prism54_mib_init(islpci_private *priv)
 {
 	u32 t;
 	struct obj_buffer psm_buffer = {
-		.size = cpu_to_le32(PSM_BUFFER_SIZE),
-		.addr = cpu_to_le32(priv->device_psm_buffer)
+		.size = PSM_BUFFER_SIZE,
+		.addr = priv->device_psm_buffer
 	};
 
 	mgt_set(priv, DOT11_OID_CHANNEL, &init_channel);
@@ -285,7 +285,7 @@ prism54_commit(struct net_device *ndev, struct iw_request_info *info,
 	/* Commit in Monitor mode is not necessary, also setting essid
 	 * in Monitor mode does not make sense and isn't allowed for this
 	 * device's firmware */
-	if(priv->iw_mode != IW_MODE_MONITOR)
+	if (priv->iw_mode != IW_MODE_MONITOR)
 		return mgt_set_request(priv, DOT11_OID_SSID, 0, NULL);
 	return 0;
 }
@@ -327,34 +327,15 @@ prism54_set_freq(struct net_device *ndev, struct iw_request_info *info,
 {
 	islpci_private *priv = netdev_priv(ndev);
 	int rvalue;
-	u32 c = 0;
+	u32 c;
 
-	/* prepare the structure for the set object */
 	if (fwrq->m < 1000)
-		/* structure value contains a channel indication */
+		/* we have a channel number */
 		c = fwrq->m;
-	else {
-		/* structure contains a frequency indication and fwrq->e = 1 */
-		int f = fwrq->m / 100000;
-
-		if (fwrq->e != 1)
-			return -EINVAL;
-		if ((f >= 2412) && (f <= 2484)) {
-			while ((c < 14) && (f != frequency_list_bg[c]))
-				c++;
-			if (c >= 14)
-				return -EINVAL;
-		} else if ((f >= (int) 5170) && (f <= (int) 5320)) {
-			while ((c < 12) && (f != frequency_list_a[c]))
-				c++;
-			if (c >= 12)
-				return -EINVAL;
-		} else
-			return -EINVAL;
-		c++;
-	}
+	else
+		c = (fwrq->e == 1) ? channel_of_freq(fwrq->m / 100000) : 0;
 
-	rvalue = mgt_set_request(priv, DOT11_OID_CHANNEL, 0, &c);
+	rvalue = c ? mgt_set_request(priv, DOT11_OID_CHANNEL, 0, &c) : -EINVAL;
 
 	/* Call commit handler */
 	return (rvalue ? rvalue : -EINPROGRESS);
@@ -410,7 +391,7 @@ prism54_set_mode(struct net_device *ndev, struct iw_request_info *info,
 
 	mgt_commit(priv);
 	priv->ndev->type = (priv->iw_mode == IW_MODE_MONITOR)
-	    ? ARPHRD_IEEE80211 : ARPHRD_ETHER;
+	    ? priv->monitor_type : ARPHRD_ETHER;
 	up_write(&priv->mib_sem);
 
 	return 0;
@@ -531,20 +512,20 @@ prism54_get_range(struct net_device *ndev, struct iw_request_info *info,
 	    mgt_get_request(priv, DOT11_OID_SUPPORTEDFREQUENCIES, 0, NULL, &r);
 	freq = r.ptr;
 
-	range->num_channels = le16_to_cpu(freq->nr);
-	range->num_frequency = le16_to_cpu(freq->nr);
+	range->num_channels = freq->nr;
+	range->num_frequency = freq->nr;
 
 	/* Frequencies are not listed in the right order. The reordering is probably
 	 * firmware dependant and thus should work for everyone.
 	 */
-	m = min(IW_MAX_FREQUENCIES, (int) le16_to_cpu(freq->nr));
+	m = min(IW_MAX_FREQUENCIES, (int) freq->nr);
 	for (i = 0; i < m - 12; i++) {
-		range->freq[i].m = le16_to_cpu(freq->mhz[12 + i]);
+		range->freq[i].m = freq->mhz[12 + i];
 		range->freq[i].e = 6;
 		range->freq[i].i = i + 1;
 	}
 	for (i = m - 12; i < m; i++) {
-		range->freq[i].m = le16_to_cpu(freq->mhz[i - m + 12]);
+		range->freq[i].m = freq->mhz[i - m + 12];
 		range->freq[i].e = 6;
 		range->freq[i].i = i + 23;
 	}
@@ -655,7 +636,7 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev,
 #define CAP_CRYPT 0x10
 
 	/* Mode */
-	cap = le16_to_cpu(bss->capinfo);
+	cap = bss->capinfo;
 	iwe.u.mode = 0;
 	if (cap & CAP_ESS)
 		iwe.u.mode = IW_MODE_MASTER;
@@ -747,7 +728,7 @@ prism54_get_scan(struct net_device *ndev, struct iw_request_info *info,
 	bsslist = r.ptr;
 
 	/* ok now, scan the list and translate its info */
-	for (i = 0; i < min(IW_MAX_AP, (int) le32_to_cpu(bsslist->nr)); i++)
+	for (i = 0; i < min(IW_MAX_AP, (int) bsslist->nr); i++)
 		current_ev = prism54_translate_bss(ndev, current_ev,
 						   extra + IW_SCAN_MAX_DATA,
 						   &(bsslist->bsslist[i]),
@@ -869,25 +850,26 @@ prism54_set_rate(struct net_device *ndev,
 		return mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile);
 	}
 	
-	if((ret = mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r)))
+	if ((ret =
+	     mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r)))
 		return ret;
 		
 	rate = (u32) (vwrq->value / 500000);
 	data = r.ptr;
 	i = 0;
 	
-	while(data[i]) {
-		if(rate && (data[i] == rate)) {
+	while (data[i]) {
+		if (rate && (data[i] == rate)) {
 			break;
 		}
-		if(vwrq->value == i) {
+		if (vwrq->value == i) {
 			break;
 		}
 		data[i] |= 0x80;
 		i++;
 	}
 		
-	if(!data[i]) {
+	if (!data[i]) {
 		return -EINVAL;
 	}
 	
@@ -931,12 +913,12 @@ prism54_get_rate(struct net_device *ndev,
 	union oid_res_t r;
 
 	/* Get the current bit rate */
-	if((rvalue = mgt_get_request(priv, GEN_OID_LINKSTATE, 0, NULL, &r)))
+	if ((rvalue = mgt_get_request(priv, GEN_OID_LINKSTATE, 0, NULL, &r)))
 		return rvalue;
 	vwrq->value = r.u * 500000;
 
 	/* request the device for the enabled rates */
-	if((rvalue = mgt_get_request(priv, DOT11_OID_RATES, 0, NULL, &r)))
+	if ((rvalue = mgt_get_request(priv, DOT11_OID_RATES, 0, NULL, &r)))
 		return rvalue;
 	data = r.ptr;
 	vwrq->fixed = (data[0] != 0) && (data[1] == 0);
@@ -1225,7 +1207,7 @@ prism54_get_txpower(struct net_device *ndev, struct iw_request_info *info,
 
 	rvalue = mgt_get_request(priv, OID_INL_OUTPUTPOWER, 0, NULL, &r);
 	/* intersil firmware operates in 0.25 dBm (1/4 dBm) */
-	vwrq->value = (s32)r.u / 4;
+	vwrq->value = (s32) r.u / 4;
 	vwrq->fixed = 1;
 	/* radio is not turned of
 	 * btw: how is possible to turn off only the radio 
@@ -1271,28 +1253,41 @@ prism54_reset(struct net_device *ndev, struct iw_request_info *info,
 }
 
 static int
-prism54_set_beacon(struct net_device *ndev, struct iw_request_info *info,
-		   __u32 * uwrq, char *extra)
+prism54_get_oid(struct net_device *ndev, struct iw_request_info *info,
+		struct iw_point *dwrq, char *extra)
 {
-	int rvalue = mgt_set_request((islpci_private *) netdev_priv(ndev),
-				     DOT11_OID_BEACONPERIOD, 0, uwrq);
+	union oid_res_t r;
+	int rvalue;
+	enum oid_num_t n = dwrq->flags;
 
-	return (rvalue ? rvalue : -EINPROGRESS);
+	rvalue = mgt_get_request((islpci_private *) ndev->priv, n, 0, NULL, &r);
+	dwrq->length = mgt_response_to_str(n, &r, extra);
+	if ((isl_oid[n].flags & OID_FLAG_TYPE) != OID_TYPE_U32)
+		kfree(r.ptr);
+	return rvalue;
 }
 
 static int
-prism54_get_beacon(struct net_device *ndev, struct iw_request_info *info,
+prism54_set_u32(struct net_device *ndev, struct iw_request_info *info,
 		   __u32 * uwrq, char *extra)
 {
-	union oid_res_t r;
-	int rvalue;
+	/*
+	   u32 *i = (int *) extra;
+	   int param = *i;
+	   int u = *(i + 1);
+	 */
+	u32 oid = uwrq[0], u = uwrq[1];
 
-	rvalue =
-	    mgt_get_request((islpci_private *) netdev_priv(ndev),
-			    DOT11_OID_BEACONPERIOD, 0, NULL, &r);
-	*uwrq = r.u;
+	return mgt_set_request((islpci_private *) ndev->priv, oid, 0, &u);
+}
 
-	return rvalue;
+static int
+prism54_set_raw(struct net_device *ndev, struct iw_request_info *info,
+		struct iw_point *dwrq, char *extra)
+{
+	u32 oid = dwrq->flags;
+
+	return mgt_set_request((islpci_private *) ndev->priv, oid, 0, extra);
 }
 
 void
@@ -1511,8 +1506,9 @@ prism54_kick_all(struct net_device *ndev, struct iw_request_info *info,
 		return -ENOMEM;
 
 	/* Tell the card to kick every client */
-	mlme->id = cpu_to_le16(0);
-	rvalue = mgt_set_request(netdev_priv(ndev), DOT11_OID_DISASSOCIATE, 0, mlme);
+	mlme->id = 0;
+	rvalue =
+	    mgt_set_request(netdev_priv(ndev), DOT11_OID_DISASSOCIATE, 0, mlme);
 	kfree(mlme);
 
 	return rvalue;
@@ -1535,8 +1531,9 @@ prism54_kick_mac(struct net_device *ndev, struct iw_request_info *info,
 
 	/* Tell the card to only kick the corresponding bastard */
 	memcpy(mlme->address, addr->sa_data, ETH_ALEN);
-	mlme->id = cpu_to_le16(-1);
-	rvalue = mgt_set_request(netdev_priv(ndev), DOT11_OID_DISASSOCIATE, 0, mlme);
+	mlme->id = -1;
+	rvalue =
+	    mgt_set_request(netdev_priv(ndev), DOT11_OID_DISASSOCIATE, 0, mlme);
 
 	kfree(mlme);
 
@@ -1551,12 +1548,12 @@ format_event(islpci_private *priv, char *dest, const char *str,
 {
 	const u8 *a = mlme->address;
 	int n = snprintf(dest, IW_CUSTOM_MAX,
-			 "%s %s %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X %s",
+			 "%s %s %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X %s (%2.2X)",
 			 str,
-			 ((priv->iw_mode == IW_MODE_MASTER) ? "to" : "from"),
+			 ((priv->iw_mode == IW_MODE_MASTER) ? "from" : "to"),
 			 a[0], a[1], a[2], a[3], a[4], a[5],
 			 (error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ")
-			  : ""));
+			  : ""), mlme->code);
 	BUG_ON(n > IW_CUSTOM_MAX);
 	*length = n;
 }
@@ -1598,14 +1595,15 @@ link_changed(struct net_device *ndev, u32 bitrate)
 {
 	islpci_private *priv = netdev_priv(ndev);
 
-	if (le32_to_cpu(bitrate)) {
+	if (bitrate) {
 		if (priv->iw_mode == IW_MODE_INFRA) {
 			union iwreq_data uwrq;
 			prism54_get_wap(ndev, NULL, (struct sockaddr *) &uwrq,
 					NULL);
 			wireless_send_event(ndev, SIOCGIWAP, &uwrq, NULL);
 		} else
-			send_simple_event(netdev_priv(ndev), "Link established");
+			send_simple_event(netdev_priv(ndev),
+					  "Link established");
 	} else
 		send_simple_event(netdev_priv(ndev), "Link lost");
 }
@@ -1765,15 +1763,14 @@ prism54_process_bss_data(islpci_private *priv, u32 oid, u8 *addr,
 static void
 handle_request(islpci_private *priv, struct obj_mlme *mlme, enum oid_num_t oid)
 {
-	if (((le16_to_cpu(mlme->state) == DOT11_STATE_AUTHING) ||
-	     (le16_to_cpu(mlme->state) == DOT11_STATE_ASSOCING))
+	if (((mlme->state == DOT11_STATE_AUTHING) ||
+	     (mlme->state == DOT11_STATE_ASSOCING))
 	    && mgt_mlme_answer(priv)) {
 		/* Someone is requesting auth and we must respond. Just send back
 		 * the trap with error code set accordingly.
 		 */
-		mlme->code = cpu_to_le16(prism54_mac_accept(&priv->acl,
-							    mlme->
-							    address) ? 0 : 1);
+		mlme->code = prism54_mac_accept(&priv->acl,
+						mlme->address) ? 0 : 1;
 		mgt_set_request(priv, oid, 0, mlme);
 	}
 }
@@ -1797,6 +1794,13 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
 	 * suited. We use the more flexible custom event facility.
 	 */
 
+	/* I fear prism54_process_bss_data won't work with big endian data */
+	if ((oid == DOT11_OID_BEACON) || (oid == DOT11_OID_PROBE))
+		prism54_process_bss_data(priv, oid, mlme->address,
+					 payload, len);
+
+	mgt_le_to_cpu(isl_oid[oid].flags & OID_FLAG_TYPE, (void *) mlme);
+
 	switch (oid) {
 
 	case GEN_OID_LINKSTATE:
@@ -1831,8 +1835,6 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
 		break;
 
 	case DOT11_OID_BEACON:
-		prism54_process_bss_data(priv, oid, mlme->address,
-					 payload, len);
 		send_formatted_event(priv,
 				     "Received a beacon from an unkown AP",
 				     mlme, 0);
@@ -1840,8 +1842,6 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
 
 	case DOT11_OID_PROBE:
 		/* we received a probe from a client. */
-		prism54_process_bss_data(priv, oid, mlme->address,
-					 payload, len);
 		send_formatted_event(priv, "Received a probe from client", mlme,
 				     0);
 		break;
@@ -1914,13 +1914,6 @@ prism54_set_mac_address(struct net_device *ndev, void *addr)
 	return ret;
 }
 
-int
-prism54_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
-{
-	/* should we really support this old stuff ? */
-	return -EOPNOTSUPP;
-}
-
 int
 prism54_set_wpa(struct net_device *ndev, struct iw_request_info *info,
 		__u32 * uwrq, char *extra)
@@ -1950,9 +1943,31 @@ prism54_get_wpa(struct net_device *ndev, struct iw_request_info *info,
 	return 0;
 }
 
+int
+prism54_set_prismhdr(struct net_device *ndev, struct iw_request_info *info,
+		     __u32 * uwrq, char *extra)
+{
+	islpci_private *priv = netdev_priv(ndev);
+	priv->monitor_type =
+	    (*uwrq ? ARPHRD_IEEE80211_PRISM : ARPHRD_IEEE80211);
+	if (priv->iw_mode == IW_MODE_MONITOR)
+		priv->ndev->type = priv->monitor_type;
+
+	return 0;
+}
+
+int
+prism54_get_prismhdr(struct net_device *ndev, struct iw_request_info *info,
+		     __u32 * uwrq, char *extra)
+{
+	islpci_private *priv = netdev_priv(ndev);
+	*uwrq = (priv->monitor_type == ARPHRD_IEEE80211_PRISM);
+	return 0;
+}
+
 int
 prism54_set_maxframeburst(struct net_device *ndev, struct iw_request_info *info,
-		__u32 *uwrq, char *extra)
+			  __u32 * uwrq, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	u32 max_burst;
@@ -1965,7 +1980,7 @@ prism54_set_maxframeburst(struct net_device *ndev, struct iw_request_info *info,
 
 int
 prism54_get_maxframeburst(struct net_device *ndev, struct iw_request_info *info,
-		__u32 *uwrq, char *extra)
+			  __u32 * uwrq, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	union oid_res_t r;
@@ -1979,7 +1994,7 @@ prism54_get_maxframeburst(struct net_device *ndev, struct iw_request_info *info,
 
 int
 prism54_set_profile(struct net_device *ndev, struct iw_request_info *info,
-		__u32 *uwrq, char *extra)
+		    __u32 * uwrq, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	u32 profile;
@@ -1992,7 +2007,7 @@ prism54_set_profile(struct net_device *ndev, struct iw_request_info *info,
 
 int
 prism54_get_profile(struct net_device *ndev, struct iw_request_info *info,
-		__u32 *uwrq, char *extra)
+		    __u32 * uwrq, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	union oid_res_t r;
@@ -2005,8 +2020,8 @@ prism54_get_profile(struct net_device *ndev, struct iw_request_info *info,
 }
 
 int
-prism54_oid(struct net_device *ndev, struct iw_request_info *info,
-		__u32 *uwrq, char *extra)
+prism54_debug_oid(struct net_device *ndev, struct iw_request_info *info,
+		  __u32 * uwrq, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	
@@ -2017,7 +2032,7 @@ prism54_oid(struct net_device *ndev, struct iw_request_info *info,
 }
 
 int
-prism54_get_oid(struct net_device *ndev, struct iw_request_info *info,
+prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
 		struct iw_point *data, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
@@ -2028,11 +2043,15 @@ prism54_get_oid(struct net_device *ndev, struct iw_request_info *info,
 	data->length = 0;
 	
 	if (islpci_get_state(priv) >= PRV_STATE_INIT) {
-		ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET, priv->priv_oid, extra, 256, &response);
+		ret =
+		    islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
+					   priv->priv_oid, extra, 256,
+					   &response);
 		response_op = response->header->operation;
 		printk("%s: ret: %i\n", ndev->name, ret);
 		printk("%s: response_op: %i\n", ndev->name, response_op);
-		if (ret || !response || response->header->operation == PIMFOR_OP_ERROR) {
+		if (ret || !response
+		    || response->header->operation == PIMFOR_OP_ERROR) {
 			if (response) {
 				islpci_mgt_release(response);
 			}
@@ -2051,21 +2070,26 @@ prism54_get_oid(struct net_device *ndev, struct iw_request_info *info,
 }
 
 int
-prism54_set_oid(struct net_device *ndev, struct iw_request_info *info,
+prism54_debug_set_oid(struct net_device *ndev, struct iw_request_info *info,
 		struct iw_point *data, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	struct islpci_mgmtframe *response = NULL;
 	int ret = 0, response_op = PIMFOR_OP_ERROR;
 	
-	printk("%s: set_oid 0x%08X\tlen: %d\n", ndev->name, priv->priv_oid, data->length);
+	printk("%s: set_oid 0x%08X\tlen: %d\n", ndev->name, priv->priv_oid,
+	       data->length);
 	
 	if (islpci_get_state(priv) >= PRV_STATE_INIT) {
-		ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET, priv->priv_oid, extra, data->length, &response);
+		ret =
+		    islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET,
+					   priv->priv_oid, extra, data->length,
+					   &response);
 		printk("%s: ret: %i\n", ndev->name, ret);
 		if (!ret) {
 			response_op = response->header->operation;
-			printk("%s: response_op: %i\n", ndev->name, response_op);
+			printk("%s: response_op: %i\n", ndev->name,
+			       response_op);
 			islpci_mgt_release(response);
 		}
 		if (ret || response_op == PIMFOR_OP_ERROR) {
@@ -2077,6 +2101,31 @@ prism54_set_oid(struct net_device *ndev, struct iw_request_info *info,
 	return ret;
 }
 
+static int
+prism54_set_spy(struct net_device *ndev,
+		struct iw_request_info *info,
+		union iwreq_data *uwrq, char *extra)
+{
+	islpci_private *priv = netdev_priv(ndev);
+	u32 u, oid = OID_INL_CONFIG;
+
+	down_write(&priv->mib_sem);
+	mgt_get(priv, OID_INL_CONFIG, &u);
+
+	if ((uwrq->data.length == 0) && (priv->spy_data.spy_number > 0))
+		/* disable spy */
+		u &= ~INL_CONFIG_RXANNEX;
+	else if ((uwrq->data.length > 0) && (priv->spy_data.spy_number == 0))
+		/* enable spy */
+		u |= INL_CONFIG_RXANNEX;
+
+	mgt_set(priv, OID_INL_CONFIG, &u);
+	mgt_commit_list(priv, &oid, 1);
+	up_write(&priv->mib_sem);
+
+	return iw_handler_set_spy(ndev, info, uwrq, extra);
+}
+
 static const iw_handler prism54_handler[] = {
 	(iw_handler) prism54_commit,	/* SIOCSIWCOMMIT */
 	(iw_handler) prism54_get_name,	/* SIOCGIWNAME */
@@ -2094,7 +2143,7 @@ static const iw_handler prism54_handler[] = {
 	(iw_handler) NULL,	/* SIOCGIWPRIV */
 	(iw_handler) NULL,	/* SIOCSIWSTATS */
 	(iw_handler) NULL,	/* SIOCGIWSTATS */
-	iw_handler_set_spy,	/* SIOCSIWSPY */
+	prism54_set_spy,	/* SIOCSIWSPY */
 	iw_handler_get_spy,	/* SIOCGIWSPY */
 	iw_handler_set_thrspy,	/* SIOCSIWTHRSPY */
 	iw_handler_get_thrspy,	/* SIOCGIWTHRSPY */
@@ -2129,33 +2178,50 @@ static const iw_handler prism54_handler[] = {
 /* The low order bit identify a SET (0) or a GET (1) ioctl.  */
 
 #define PRISM54_RESET		SIOCIWFIRSTPRIV
-#define PRISM54_GET_BEACON	SIOCIWFIRSTPRIV+1
-#define PRISM54_SET_BEACON	SIOCIWFIRSTPRIV+2
-#define PRISM54_GET_POLICY SIOCIWFIRSTPRIV+3
-#define PRISM54_SET_POLICY SIOCIWFIRSTPRIV+4
-#define PRISM54_GET_MAC 	   SIOCIWFIRSTPRIV+5
-#define PRISM54_ADD_MAC 	   SIOCIWFIRSTPRIV+6
+#define PRISM54_GET_POLICY	SIOCIWFIRSTPRIV+1
+#define PRISM54_SET_POLICY	SIOCIWFIRSTPRIV+2
+#define PRISM54_GET_MAC		SIOCIWFIRSTPRIV+3
+#define PRISM54_ADD_MAC		SIOCIWFIRSTPRIV+4
+
+#define PRISM54_DEL_MAC		SIOCIWFIRSTPRIV+6
 
-#define PRISM54_DEL_MAC    SIOCIWFIRSTPRIV+8
+#define PRISM54_KICK_MAC	SIOCIWFIRSTPRIV+8
 
-#define PRISM54_KICK_MAC   SIOCIWFIRSTPRIV+10
+#define PRISM54_KICK_ALL	SIOCIWFIRSTPRIV+10
 
-#define PRISM54_KICK_ALL   SIOCIWFIRSTPRIV+12
+#define PRISM54_GET_WPA		SIOCIWFIRSTPRIV+11
+#define PRISM54_SET_WPA		SIOCIWFIRSTPRIV+12
 
-#define PRISM54_GET_WPA	   SIOCIWFIRSTPRIV+13
-#define PRISM54_SET_WPA	   SIOCIWFIRSTPRIV+14
+#define PRISM54_DBG_OID		SIOCIWFIRSTPRIV+14
+#define PRISM54_DBG_GET_OID	SIOCIWFIRSTPRIV+15
+#define PRISM54_DBG_SET_OID	SIOCIWFIRSTPRIV+16
 
-#define PRISM54_OID	   SIOCIWFIRSTPRIV+16
 #define PRISM54_GET_OID	   SIOCIWFIRSTPRIV+17
-#define PRISM54_SET_OID	   SIOCIWFIRSTPRIV+18
+#define PRISM54_SET_OID_U32	SIOCIWFIRSTPRIV+18
+#define	PRISM54_SET_OID_STR	SIOCIWFIRSTPRIV+20
+#define	PRISM54_SET_OID_ADDR	SIOCIWFIRSTPRIV+22
+
+#define PRISM54_GET_PRISMHDR	SIOCIWFIRSTPRIV+23
+#define PRISM54_SET_PRISMHDR	SIOCIWFIRSTPRIV+24
+
+#define IWPRIV_SET_U32(n,x)	{ n, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x }
+#define IWPRIV_SET_SSID(n,x)	{ n, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x }
+#define IWPRIV_SET_ADDR(n,x)	{ n, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x }
+#define IWPRIV_GET(n,x)	{ n, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, "get_"x }
+
+#define IWPRIV_U32(n,x)		IWPRIV_SET_U32(n,x), IWPRIV_GET(n,x)
+#define IWPRIV_SSID(n,x)	IWPRIV_SET_SSID(n,x), IWPRIV_GET(n,x)
+#define IWPRIV_ADDR(n,x)	IWPRIV_SET_ADDR(n,x), IWPRIV_GET(n,x)
+
+/* Note : limited to 128 private ioctls */
 
 static const struct iw_priv_args prism54_private_args[] = {
 /*{ cmd, set_args, get_args, name } */
 	{PRISM54_RESET, 0, 0, "reset"},
-	{PRISM54_GET_BEACON, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-	 "getBeaconPeriod"},
-	{PRISM54_SET_BEACON, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
-	 "setBeaconPeriod"},
+	{PRISM54_GET_PRISMHDR, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+	 "get_prismhdr"},
+	{PRISM54_SET_PRISMHDR, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
+	 "set_prismhdr"},
 	{PRISM54_GET_POLICY, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
 	 "getPolicy"},
 	{PRISM54_SET_POLICY, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
@@ -2172,15 +2238,77 @@ static const struct iw_priv_args prism54_private_args[] = {
 	 "get_wpa"},
 	{PRISM54_SET_WPA, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
 	 "set_wpa"},
-	{PRISM54_OID, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "oid"},
-	{PRISM54_GET_OID, 0, IW_PRIV_TYPE_BYTE | 256, "get_oid"},
-	{PRISM54_SET_OID, IW_PRIV_TYPE_BYTE | 256, 0, "set_oid"},
+	{PRISM54_DBG_OID, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
+	 "dbg_oid"},
+	{PRISM54_DBG_GET_OID, 0, IW_PRIV_TYPE_BYTE | 256, "dbg_get_oid"},
+	{PRISM54_DBG_SET_OID, IW_PRIV_TYPE_BYTE | 256, 0, "dbg_get_oid"},
+	/* --- sub-ioctls handlers --- */
+	{PRISM54_GET_OID,
+	 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, ""},
+	{PRISM54_SET_OID_U32,
+	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, ""},
+	{PRISM54_SET_OID_STR,
+	 IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 1, 0, ""},
+	{PRISM54_SET_OID_ADDR,
+	 IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, ""},
+	/* --- sub-ioctls definitions --- */
+	IWPRIV_ADDR(GEN_OID_MACADDRESS, "addr"),
+	IWPRIV_GET(GEN_OID_LINKSTATE, "linkstate"),
+	IWPRIV_U32(DOT11_OID_BSSTYPE, "bsstype"),
+	IWPRIV_ADDR(DOT11_OID_BSSID, "bssid"),
+	IWPRIV_U32(DOT11_OID_STATE, "state"),
+	IWPRIV_U32(DOT11_OID_AID, "aid"),
+
+	IWPRIV_SSID(DOT11_OID_SSIDOVERRIDE, "ssidoverride"),
+
+	IWPRIV_U32(DOT11_OID_MEDIUMLIMIT, "medlimit"),
+	IWPRIV_U32(DOT11_OID_BEACONPERIOD, "beacon"),
+	IWPRIV_U32(DOT11_OID_DTIMPERIOD, "dtimperiod"),
+
+	IWPRIV_U32(DOT11_OID_AUTHENABLE, "authenable"),
+	IWPRIV_U32(DOT11_OID_PRIVACYINVOKED, "privinvok"),
+	IWPRIV_U32(DOT11_OID_EXUNENCRYPTED, "exunencrypt"),
+	
+	IWPRIV_U32(DOT11_OID_REKEYTHRESHOLD, "rekeythresh"),
+
+	IWPRIV_U32(DOT11_OID_MAXTXLIFETIME, "maxtxlife"),
+	IWPRIV_U32(DOT11_OID_MAXRXLIFETIME, "maxrxlife"),
+	IWPRIV_U32(DOT11_OID_ALOFT_FIXEDRATE, "fixedrate"),
+	IWPRIV_U32(DOT11_OID_MAXFRAMEBURST, "frameburst"),
+	IWPRIV_U32(DOT11_OID_PSM, "psm"),
+
+	IWPRIV_U32(DOT11_OID_BRIDGELOCAL, "bridge"),
+	IWPRIV_U32(DOT11_OID_CLIENTS, "clients"),
+	IWPRIV_U32(DOT11_OID_CLIENTSASSOCIATED, "clientassoc"),
+	IWPRIV_U32(DOT11_OID_DOT1XENABLE, "dot1xenable"),
+	IWPRIV_U32(DOT11_OID_ANTENNARX, "rxant"),
+	IWPRIV_U32(DOT11_OID_ANTENNATX, "txant"),
+	IWPRIV_U32(DOT11_OID_ANTENNADIVERSITY, "antdivers"),
+	IWPRIV_U32(DOT11_OID_EDTHRESHOLD, "edthresh"),
+	IWPRIV_U32(DOT11_OID_PREAMBLESETTINGS, "preamble"),
+	IWPRIV_GET(DOT11_OID_RATES, "rates"),
+	IWPRIV_U32(DOT11_OID_OUTPUTPOWER, ".11outpower"),
+	IWPRIV_GET(DOT11_OID_SUPPORTEDRATES, "supprates"),
+	IWPRIV_GET(DOT11_OID_SUPPORTEDFREQUENCIES, "suppfreq"),
+
+	IWPRIV_U32(DOT11_OID_NOISEFLOOR, "noisefloor"),
+	IWPRIV_GET(DOT11_OID_FREQUENCYACTIVITY, "freqactivity"),
+	IWPRIV_U32(DOT11_OID_NONERPPROTECTION, "nonerpprotec"),
+	IWPRIV_U32(DOT11_OID_PROFILES, "profile"),
+	IWPRIV_GET(DOT11_OID_EXTENDEDRATES, "extrates"),
+	IWPRIV_U32(DOT11_OID_MLMEAUTOLEVEL, "mlmelevel"),
+
+	IWPRIV_GET(DOT11_OID_BSSS, "bsss"),
+	IWPRIV_GET(DOT11_OID_BSSLIST, "bsslist"),
+	IWPRIV_U32(OID_INL_MODE, "mode"),
+	IWPRIV_U32(OID_INL_CONFIG, "config"),
+	IWPRIV_U32(OID_INL_DOT11D_CONFORMANCE, ".11dconform"),
+	IWPRIV_GET(OID_INL_PHYCAPABILITIES, "phycapa"),
+	IWPRIV_U32(OID_INL_OUTPUTPOWER, "outpower"),
 };
 
 static const iw_handler prism54_private_handler[] = {
 	(iw_handler) prism54_reset,
-	(iw_handler) prism54_get_beacon,
-	(iw_handler) prism54_set_beacon,
 	(iw_handler) prism54_get_policy,
 	(iw_handler) prism54_set_policy,
 	(iw_handler) prism54_get_mac,
@@ -2194,9 +2322,17 @@ static const iw_handler prism54_private_handler[] = {
 	(iw_handler) prism54_get_wpa,
 	(iw_handler) prism54_set_wpa,
 	(iw_handler) NULL,
-	(iw_handler) prism54_oid,
+	(iw_handler) prism54_debug_oid,
+	(iw_handler) prism54_debug_get_oid,
+	(iw_handler) prism54_debug_set_oid,
 	(iw_handler) prism54_get_oid,
-	(iw_handler) prism54_set_oid,
+	(iw_handler) prism54_set_u32,
+	(iw_handler) NULL,
+	(iw_handler) prism54_set_raw,
+	(iw_handler) NULL,
+	(iw_handler) prism54_set_raw,
+	(iw_handler) prism54_get_prismhdr,
+	(iw_handler) prism54_set_prismhdr,
 };
 
 const struct iw_handler_def prism54_handler_def = {
@@ -2207,5 +2343,13 @@ const struct iw_handler_def prism54_handler_def = {
 	.standard = (iw_handler *) prism54_handler,
 	.private = (iw_handler *) prism54_private_handler,
 	.private_args = (struct iw_priv_args *) prism54_private_args,
+	.spy_offset = offsetof(islpci_private, spy_data),
 };
 
+/* For ioctls that don't work with the new API */
+
+int
+prism54_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
+{
+	return -EOPNOTSUPP;
+}
diff --git a/drivers/net/wireless/prism54/isl_ioctl.h b/drivers/net/wireless/prism54/isl_ioctl.h
index 0e43dea95..d5170c478 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.h
+++ b/drivers/net/wireless/prism54/isl_ioctl.h
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.h,v 1.30 2004/01/30 16:24:00 ajfa Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *            (C) 2003 Aurelien Alleaume <slts@free.fr>
diff --git a/drivers/net/wireless/prism54/isl_oid.h b/drivers/net/wireless/prism54/isl_oid.h
index 25732d28d..c4b27d24d 100644
--- a/drivers/net/wireless/prism54/isl_oid.h
+++ b/drivers/net/wireless/prism54/isl_oid.h
@@ -1,8 +1,9 @@
 /*
- *  $Id: isl_oid.h,v 1.3 2004/03/09 09:05:27 mcgrof Exp $
+ *
  *  
  *  Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
  *  Copyright (C) 2004 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
+ *  Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
  *
  *  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
@@ -457,16 +458,29 @@ enum oid_num_t {
 	OID_NUM_LAST
 };
 
-/* We  could add more flags. eg: in which mode are they allowed, ro, rw, ...*/
-#define OID_FLAG_CACHED	0x01
-#define OID_FLAG_U32	0x02
-#define OID_FLAG_MLMEEX	0x04	/* this type is special because of a variable
-				   size field when sending. Not yet implemented (not used in driver). */
+#define OID_FLAG_CACHED		0x80
+#define OID_FLAG_TYPE		0x7f
+
+#define OID_TYPE_U32		0x01
+#define OID_TYPE_SSID		0x02
+#define OID_TYPE_KEY		0x03
+#define OID_TYPE_BUFFER		0x04
+#define OID_TYPE_BSS		0x05
+#define OID_TYPE_BSSLIST	0x06
+#define OID_TYPE_FREQUENCIES	0x07
+#define OID_TYPE_MLME		0x08
+#define OID_TYPE_MLMEEX		0x09
+#define OID_TYPE_ADDR		0x0A
+#define OID_TYPE_RAW		0x0B
+
+/* OID_TYPE_MLMEEX is special because of a variable size field when sending.
+ * Not yet implemented (not used in driver anyway).
+ */
 
 struct oid_t {
 	enum oid_num_t oid;
 	short range;		/* to define a range of oid */
-	short size;		/* size of the associated data */
+	short size;		/* max size of the associated data */
 	char flags;
 };
 
@@ -478,6 +492,7 @@ union oid_res_t {
 #define	IWMAX_BITRATES	20
 #define	IWMAX_BSS	24
 #define IWMAX_FREQ	30
+#define PRIV_STR_SIZE	1024
 
 #endif				/* !defined(_ISL_OID_H) */
 /* EOF */
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index e1545f646..157193918 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.c,v 1.68 2004/02/28 03:06:07 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *  Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
@@ -715,9 +715,9 @@ islpci_setup(struct pci_dev *pdev)
 	priv = netdev_priv(ndev);
 	priv->ndev = ndev;
 	priv->pdev = pdev;
-
+	priv->monitor_type = ARPHRD_IEEE80211;
 	priv->ndev->type = (priv->iw_mode == IW_MODE_MONITOR) ?
-		ARPHRD_IEEE80211: ARPHRD_ETHER;
+		priv->monitor_type : ARPHRD_ETHER;
 
 	/* save the start and end address of the PCI memory area */
 	ndev->mem_start = (unsigned long) priv->device_base;
@@ -743,9 +743,11 @@ islpci_setup(struct pci_dev *pdev)
 	/* initialize workqueue's */
 	INIT_WORK(&priv->stats_work,
 		  (void (*)(void *)) prism54_update_stats, priv);
-
 	priv->stats_timestamp = 0;
 
+	INIT_WORK(&priv->reset_task, islpci_do_reset_and_wake, priv);
+	priv->reset_task_pending = 0;
+
 	/* allocate various memory areas */
 	if (islpci_alloc_memory(priv))
 		goto do_free_netdev;
diff --git a/drivers/net/wireless/prism54/islpci_dev.h b/drivers/net/wireless/prism54/islpci_dev.h
index 65f696c89..de92b4ea6 100644
--- a/drivers/net/wireless/prism54/islpci_dev.h
+++ b/drivers/net/wireless/prism54/islpci_dev.h
@@ -1,8 +1,9 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.h,v 1.53 2004/02/28 03:06:07 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc. 
  *  Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
  *  Copyright (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
+ *  Copyright (C) 2003 Aurelien Alleaume <slts@free.fr>
  *
  *  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
@@ -25,6 +26,7 @@
 #include <linux/version.h>
 #include <linux/netdevice.h>
 #include <linux/wireless.h>
+#include <net/iw_handler.h>
 #include <linux/list.h>
 
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
@@ -110,6 +112,10 @@ typedef struct {
 	struct iw_statistics local_iwstatistics;
 	struct iw_statistics iwstatistics;
 
+	struct iw_spy_data spy_data; /* iwspy support */
+
+	int monitor_type; /* ARPHRD_IEEE80211 or ARPHRD_IEEE80211_PRISM */
+
 	struct islpci_acl acl;
 
 	/* PCI bus allocation & configuration members */
@@ -187,6 +193,9 @@ typedef struct {
 	struct list_head bss_wpa_list;
 	int num_bss_wpa;
 	struct semaphore wpa_sem;
+
+	struct work_struct reset_task;
+	int reset_task_pending;
 } islpci_private;
 
 static inline islpci_state_t
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index 3bc6c5f0c..c18c42d0c 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -1,7 +1,7 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.c,v 1.27 2004/01/30 16:24:00 ajfa Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
- *
+ *  Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
  *  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
@@ -24,10 +24,12 @@
 #include <linux/delay.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/if_arp.h>
 
 #include "isl_38xx.h"
 #include "islpci_eth.h"
 #include "islpci_mgt.h"
+#include "oid_mgt.h"
 
 /******************************************************************************
     Network Interface functions
@@ -246,6 +248,69 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 	return err;
 }
 
+static inline int
+islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
+{
+	/* The card reports full 802.11 packets but with a 20 bytes
+	 * header and without the FCS. But there a is a bit that
+	 * indicates if the packet is corrupted :-) */
+	struct rfmon_header *hdr = (struct rfmon_header *) (*skb)->data;
+	if (hdr->flags & 0x01)
+		/* This one is bad. Drop it ! */
+		return -1;
+	if (priv->ndev->type == ARPHRD_IEEE80211_PRISM) {
+		struct avs_80211_1_header *avs;
+		/* extract the relevant data from the header */
+		u32 clock = hdr->clock;
+		u8 rate = hdr->rate;
+		u16 freq = be16_to_cpu(hdr->freq);
+		u8 rssi = hdr->rssi;
+
+		skb_pull(*skb, sizeof (struct rfmon_header));
+
+		if (skb_headroom(*skb) < sizeof (struct avs_80211_1_header)) {
+			struct sk_buff *newskb = skb_copy_expand(*skb,
+								 sizeof (struct
+									 avs_80211_1_header),
+								 0, GFP_ATOMIC);
+			if (newskb) {
+				kfree_skb(*skb);
+				*skb = newskb;
+			} else
+				return -1;
+			/* This behavior is not very subtile... */
+		}
+
+		/* make room for the new header and fill it. */
+		avs =
+		    (struct avs_80211_1_header *) skb_push(*skb,
+							   sizeof (struct
+								   avs_80211_1_header));
+
+		avs->version = htonl(P80211CAPTURE_VERSION);
+		avs->length = htonl(sizeof (struct avs_80211_1_header));
+		avs->mactime = __cpu_to_be64(clock);
+		avs->hosttime = __cpu_to_be64(jiffies);
+		avs->phytype = htonl(6);	/*OFDM: 6 for (g), 8 for (a) */
+		avs->channel = htonl(channel_of_freq(freq));
+		avs->datarate = htonl(rate * 5);
+		avs->antenna = htonl(0);	/*unknown */
+		avs->priority = htonl(0);	/*unknown */
+		avs->ssi_type = htonl(2);	/*2: dBm, 3: raw RSSI */
+		avs->ssi_signal = htonl(rssi);
+		avs->ssi_noise = htonl(priv->local_iwstatistics.qual.noise);	/*better than 'undefined', I assume */
+		avs->preamble = htonl(0);	/*unknown */
+		avs->encoding = htonl(0);	/*unknown */
+	} else
+		skb_pull(*skb, sizeof (struct rfmon_header));
+
+	(*skb)->protocol = htons(ETH_P_802_2);
+	(*skb)->mac.raw = (*skb)->data;
+	(*skb)->pkt_type = PACKET_OTHERHOST;
+
+	return 0;
+}
+
 int
 islpci_eth_receive(islpci_private *priv)
 {
@@ -266,7 +331,8 @@ islpci_eth_receive(islpci_private *priv)
 	index = priv->free_data_rx % ISL38XX_CB_RX_QSIZE;
 	size = le16_to_cpu(control_block->rx_data_low[index].size);
 	skb = priv->data_low_rx[index];
-	offset = ((unsigned long) le32_to_cpu(control_block->rx_data_low[index].address) -
+	offset = ((unsigned long)
+		  le32_to_cpu(control_block->rx_data_low[index].address) -
 		  (unsigned long) skb->data) & 3;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
@@ -314,29 +380,32 @@ islpci_eth_receive(islpci_private *priv)
 	/* do some additional sk_buff and network layer parameters */
 	skb->dev = ndev;
 
-	/* take care of monitor mode */
-	if (priv->iw_mode == IW_MODE_MONITOR) {
-		/* The card reports full 802.11 packets but with a 20 bytes
-		 * header and without the FCS. But there a is a bit that
-		 * indicates if the packet is corrupted :-) */
-		/* int i; */
-		if (skb->data[8] & 0x01){
-			/* This one is bad. Drop it !*/
-			discard = 1;
-			/* printk("BAD\n");*/
+	/* take care of monitor mode and spy monitoring. */
+	if (priv->iw_mode == IW_MODE_MONITOR)
+		discard = islpci_monitor_rx(priv, &skb);
+	else {
+		if (skb->data[2 * ETH_ALEN] == 0) {
+			/* The packet has a rx_annex. Read it for spy monitoring, Then
+			 * remove it, while keeping the 2 leading MAC addr.
+			 */
+			struct iw_quality wstats;
+			struct rx_annex_header *annex =
+			    (struct rx_annex_header *) skb->data;
+			wstats.level = annex->rfmon.rssi;
+			/* The noise value can be a bit outdated if nobody's 
+			 * reading wireless stats... */
+			wstats.noise = priv->local_iwstatistics.qual.noise;
+			wstats.qual = wstats.level - wstats.noise;
+			wstats.updated = 0x07;
+			/* Update spy records */
+			wireless_spy_update(ndev, annex->addr2, &wstats);
+
+			memcpy(skb->data + sizeof (struct rfmon_header),
+			       skb->data, 2 * ETH_ALEN);
+			skb_pull(skb, sizeof (struct rfmon_header));
 		}
-		/*
-		for(i=0;i<50;i++)
-			printk("%2.2X:",skb->data[i]);
-		printk("\n");
-		*/		
-		skb_pull(skb, 20);
-		skb->protocol = htons(ETH_P_802_2);
-		skb->mac.raw = skb->data;
-		skb->pkt_type = PACKET_OTHERHOST;
-	} else
 		skb->protocol = eth_type_trans(skb, ndev);
-
+	}
 	skb->ip_summed = CHECKSUM_NONE;
 	priv->statistics.rx_packets++;
 	priv->statistics.rx_bytes += size;
@@ -351,8 +420,7 @@ islpci_eth_receive(islpci_private *priv)
 	if (discard) {
 		dev_kfree_skb(skb);
 		skb = NULL;
-	}
-	else
+	} else
 		netif_rx(skb);
 
 	/* increment the read index for the rx data low queue */
@@ -403,7 +471,7 @@ islpci_eth_receive(islpci_private *priv)
 		wmb();
 
 		/* increment the driver read pointer */
-		add_le32p((u32 *) & control_block->
+		add_le32p((u32 *) &control_block->
 			  driver_curr_frag[ISL38XX_CB_RX_DATA_LQ], 1);
 	}
 
@@ -413,6 +481,15 @@ islpci_eth_receive(islpci_private *priv)
 	return 0;
 }
 
+void
+islpci_do_reset_and_wake(void *data)
+{
+       islpci_private *priv = (islpci_private *) data;
+       islpci_reset(priv, 1);
+       netif_wake_queue(priv->ndev);
+       priv->reset_task_pending = 0;
+}
+
 void
 islpci_eth_tx_timeout(struct net_device *ndev)
 {
@@ -422,13 +499,11 @@ islpci_eth_tx_timeout(struct net_device *ndev)
 	/* increment the transmit error counter */
 	statistics->tx_errors++;
 
-#if 0
-	/* don't do this here! we are not allowed to sleep since we are in interrupt context */
-	if (islpci_reset(priv))
-		printk(KERN_ERR "%s: error on TX timeout card reset!\n",
-		       ndev->name);
-#endif
+	if (!priv->reset_task_pending) {
+		priv->reset_task_pending = 1;
+		netif_stop_queue(ndev);
+		schedule_work(&priv->reset_task);
+	}
 
-	/* netif_wake_queue(ndev); */
 	return;
 }
diff --git a/drivers/net/wireless/prism54/islpci_eth.h b/drivers/net/wireless/prism54/islpci_eth.h
index 35845f247..bc9d7a60b 100644
--- a/drivers/net/wireless/prism54/islpci_eth.h
+++ b/drivers/net/wireless/prism54/islpci_eth.h
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.h,v 1.5 2004/01/12 22:16:32 jmaurer Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *
@@ -23,9 +23,51 @@
 #include "isl_38xx.h"
 #include "islpci_dev.h"
 
+struct rfmon_header {
+	u16 unk0;		/* = 0x0000 */
+	u16 length;		/* = 0x1400 */
+	u32 clock;		/* 1MHz clock */
+	u8 flags;
+	u8 unk1;
+	u8 rate;
+	u8 unk2;
+	u16 freq;
+	u16 unk3;
+	u8 rssi;
+	u8 padding[3];
+} __attribute__ ((packed));
+
+struct rx_annex_header {
+	u8 addr1[ETH_ALEN];
+	u8 addr2[ETH_ALEN];
+	struct rfmon_header rfmon;
+} __attribute__ ((packed));
+
+/* wlan-ng (and hopefully others) AVS header, version one.  Fields in
+ * network byte order. */
+#define P80211CAPTURE_VERSION 0x80211001
+
+struct avs_80211_1_header {
+	uint32_t version;
+	uint32_t length;
+	uint64_t mactime;
+	uint64_t hosttime;
+	uint32_t phytype;
+	uint32_t channel;
+	uint32_t datarate;
+	uint32_t antenna;
+	uint32_t priority;
+	uint32_t ssi_type;
+	int32_t ssi_signal;
+	int32_t ssi_noise;
+	uint32_t preamble;
+	uint32_t encoding;
+};
+
 void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *);
 int islpci_eth_transmit(struct sk_buff *, struct net_device *);
 int islpci_eth_receive(islpci_private *);
 void islpci_eth_tx_timeout(struct net_device *);
+void islpci_do_reset_and_wake(void *data);
 
 #endif				/* _ISL_GEN_H */
diff --git a/drivers/net/wireless/prism54/islpci_hotplug.c b/drivers/net/wireless/prism54/islpci_hotplug.c
index 5cd7da48d..34b3b59fe 100644
--- a/drivers/net/wireless/prism54/islpci_hotplug.c
+++ b/drivers/net/wireless/prism54/islpci_hotplug.c
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_hotplug.c,v 1.56 2004/02/26 23:33:02 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *  Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c
index 3dbe20813..bdf77d6c5 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.c
+++ b/drivers/net/wireless/prism54/islpci_mgt.c
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.c,v 1.40 2004/02/01 10:57:23 mcgrof Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *  Copyright 2004 Jens Maurer <Jens.Maurer@gmx.net>
diff --git a/drivers/net/wireless/prism54/islpci_mgt.h b/drivers/net/wireless/prism54/islpci_mgt.h
index cb2ea6fe5..80337f926 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.h
+++ b/drivers/net/wireless/prism54/islpci_mgt.h
@@ -1,4 +1,4 @@
-/*  $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.h,v 1.22 2004/01/30 16:24:00 ajfa Exp $
+/*
  *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *  Copyright (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
diff --git a/drivers/net/wireless/prism54/oid_mgt.c b/drivers/net/wireless/prism54/oid_mgt.c
index 29aa1361e..cfa541ca2 100644
--- a/drivers/net/wireless/prism54/oid_mgt.c
+++ b/drivers/net/wireless/prism54/oid_mgt.c
@@ -1,5 +1,5 @@
 /*   
- *  Copyright (C) 2003 Aurelien Alleaume <slts@free.fr>
+ *  Copyright (C) 2003,2004 Aurelien Alleaume <slts@free.fr>
  *
  *  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
@@ -31,182 +31,210 @@ const int frequency_list_a[] = { 5170, 5180, 5190, 5200, 5210, 5220, 5230,
 	5240, 5260, 5280, 5300, 5320
 };
 
-#define OID_U32(x) {x, 0, sizeof(u32), OID_FLAG_U32}
-#define OID_U32_C(x) {x, 0, sizeof(u32), OID_FLAG_U32 | OID_FLAG_CACHED}
-#define OID_STRUCT(x,s) {x, 0, sizeof(s), 0}
-#define OID_STRUCT_C(x,s) {x, 0, sizeof(s), OID_FLAG_CACHED}
-#define OID_STRUCT_MLME(x){x, 0, sizeof(struct obj_mlme), 0}
-#define OID_STRUCT_MLMEEX(x){x, 0, sizeof(struct obj_mlmeex), OID_FLAG_MLMEEX}
+int
+channel_of_freq(int f)
+{
+	int c = 0;
+
+	if ((f >= 2412) && (f <= 2484)) {
+		while ((c < 14) && (f != frequency_list_bg[c]))
+			c++;
+		if (c >= 14)
+			return 0;
+	} else if ((f >= (int) 5170) && (f <= (int) 5320)) {
+		while ((c < 12) && (f != frequency_list_a[c]))
+			c++;
+		if (c >= 12)
+			return 0;
+	} else
+		return 0;
+
+	return ++c;
+}
+
+#define OID_STRUCT(name,oid,s,t) [name] = {oid, 0, sizeof(s), t}
+#define OID_STRUCT_C(name,oid,s,t) OID_STRUCT(name,oid,s,t | OID_FLAG_CACHED)
+#define OID_U32(name,oid) OID_STRUCT(name,oid,u32,OID_TYPE_U32)
+#define OID_U32_C(name,oid) OID_STRUCT_C(name,oid,u32,OID_TYPE_U32)
+#define OID_STRUCT_MLME(name,oid) OID_STRUCT(name,oid,struct obj_mlme,OID_TYPE_MLME)
+#define OID_STRUCT_MLMEEX(name,oid) OID_STRUCT(name,oid,struct obj_mlmeex,OID_TYPE_MLMEEX)
 
-#define OID_UNKNOWN(x) {x, 0, 0, 0}
+#define OID_UNKNOWN(name,oid) OID_STRUCT(name,oid,0,0)
 
 struct oid_t isl_oid[] = {
-	[GEN_OID_MACADDRESS] = OID_STRUCT(0x00000000, u8[6]),
-	[GEN_OID_LINKSTATE] = OID_U32(0x00000001),
-	[GEN_OID_WATCHDOG] = OID_UNKNOWN(0x00000002),
-	[GEN_OID_MIBOP] = OID_UNKNOWN(0x00000003),
-	[GEN_OID_OPTIONS] = OID_UNKNOWN(0x00000004),
-	[GEN_OID_LEDCONFIG] = OID_UNKNOWN(0x00000005),
+	OID_STRUCT(GEN_OID_MACADDRESS, 0x00000000, u8[6], OID_TYPE_ADDR),
+	OID_U32(GEN_OID_LINKSTATE, 0x00000001),
+	OID_UNKNOWN(GEN_OID_WATCHDOG, 0x00000002),
+	OID_UNKNOWN(GEN_OID_MIBOP, 0x00000003),
+	OID_UNKNOWN(GEN_OID_OPTIONS, 0x00000004),
+	OID_UNKNOWN(GEN_OID_LEDCONFIG, 0x00000005),
 
 	/* 802.11 */
-	[DOT11_OID_BSSTYPE] = OID_U32_C(0x10000000),
-	[DOT11_OID_BSSID] = OID_STRUCT_C(0x10000001, u8[6]),
-	[DOT11_OID_SSID] = OID_STRUCT_C(0x10000002, struct obj_ssid),
-	[DOT11_OID_STATE] = OID_U32(0x10000003),
-	[DOT11_OID_AID] = OID_U32(0x10000004),
-	[DOT11_OID_COUNTRYSTRING] = OID_STRUCT(0x10000005, u8[4]),
-	[DOT11_OID_SSIDOVERRIDE] = OID_STRUCT_C(0x10000006, struct obj_ssid),
-
-	[DOT11_OID_MEDIUMLIMIT] = OID_U32(0x11000000),
-	[DOT11_OID_BEACONPERIOD] = OID_U32_C(0x11000001),
-	[DOT11_OID_DTIMPERIOD] = OID_U32(0x11000002),
-	[DOT11_OID_ATIMWINDOW] = OID_U32(0x11000003),
-	[DOT11_OID_LISTENINTERVAL] = OID_U32(0x11000004),
-	[DOT11_OID_CFPPERIOD] = OID_U32(0x11000005),
-	[DOT11_OID_CFPDURATION] = OID_U32(0x11000006),
-
-	[DOT11_OID_AUTHENABLE] = OID_U32_C(0x12000000),
-	[DOT11_OID_PRIVACYINVOKED] = OID_U32_C(0x12000001),
-	[DOT11_OID_EXUNENCRYPTED] = OID_U32_C(0x12000002),
-	[DOT11_OID_DEFKEYID] = OID_U32_C(0x12000003),
-	[DOT11_OID_DEFKEYX] = {0x12000004, 3, sizeof (struct obj_key), OID_FLAG_CACHED},	/* DOT11_OID_DEFKEY1,...DOT11_OID_DEFKEY4 */
-	[DOT11_OID_STAKEY] = OID_UNKNOWN(0x12000008),
-	[DOT11_OID_REKEYTHRESHOLD] = OID_U32(0x12000009),
-	[DOT11_OID_STASC] = OID_UNKNOWN(0x1200000a),
-
-	[DOT11_OID_PRIVTXREJECTED] = OID_U32(0x1a000000),
-	[DOT11_OID_PRIVRXPLAIN] = OID_U32(0x1a000001),
-	[DOT11_OID_PRIVRXFAILED] = OID_U32(0x1a000002),
-	[DOT11_OID_PRIVRXNOKEY] = OID_U32(0x1a000003),
-
-	[DOT11_OID_RTSTHRESH] = OID_U32_C(0x13000000),
-	[DOT11_OID_FRAGTHRESH] = OID_U32_C(0x13000001),
-	[DOT11_OID_SHORTRETRIES] = OID_U32_C(0x13000002),
-	[DOT11_OID_LONGRETRIES] = OID_U32_C(0x13000003),
-	[DOT11_OID_MAXTXLIFETIME] = OID_U32_C(0x13000004),
-	[DOT11_OID_MAXRXLIFETIME] = OID_U32(0x13000005),
-	[DOT11_OID_AUTHRESPTIMEOUT] = OID_U32(0x13000006),
-	[DOT11_OID_ASSOCRESPTIMEOUT] = OID_U32(0x13000007),
-
-	[DOT11_OID_ALOFT_TABLE] = OID_UNKNOWN(0x1d000000),
-	[DOT11_OID_ALOFT_CTRL_TABLE] = OID_UNKNOWN(0x1d000001),
-	[DOT11_OID_ALOFT_RETREAT] = OID_UNKNOWN(0x1d000002),
-	[DOT11_OID_ALOFT_PROGRESS] = OID_UNKNOWN(0x1d000003),
-	[DOT11_OID_ALOFT_FIXEDRATE] = OID_U32(0x1d000004),
-	[DOT11_OID_ALOFT_RSSIGRAPH] = OID_UNKNOWN(0x1d000005),
-	[DOT11_OID_ALOFT_CONFIG] = OID_UNKNOWN(0x1d000006),
+	OID_U32_C(DOT11_OID_BSSTYPE, 0x10000000),
+	OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_SSID),
+	OID_STRUCT_C(DOT11_OID_SSID, 0x10000002, struct obj_ssid,
+		     OID_TYPE_SSID),
+	OID_U32(DOT11_OID_STATE, 0x10000003),
+	OID_U32(DOT11_OID_AID, 0x10000004),
+	OID_STRUCT(DOT11_OID_COUNTRYSTRING, 0x10000005, u8[4], OID_TYPE_RAW),
+	OID_STRUCT_C(DOT11_OID_SSIDOVERRIDE, 0x10000006, struct obj_ssid,
+		     OID_TYPE_SSID),
+
+	OID_U32(DOT11_OID_MEDIUMLIMIT, 0x11000000),
+	OID_U32_C(DOT11_OID_BEACONPERIOD, 0x11000001),
+	OID_U32(DOT11_OID_DTIMPERIOD, 0x11000002),
+	OID_U32(DOT11_OID_ATIMWINDOW, 0x11000003),
+	OID_U32(DOT11_OID_LISTENINTERVAL, 0x11000004),
+	OID_U32(DOT11_OID_CFPPERIOD, 0x11000005),
+	OID_U32(DOT11_OID_CFPDURATION, 0x11000006),
+
+	OID_U32_C(DOT11_OID_AUTHENABLE, 0x12000000),
+	OID_U32_C(DOT11_OID_PRIVACYINVOKED, 0x12000001),
+	OID_U32_C(DOT11_OID_EXUNENCRYPTED, 0x12000002),
+	OID_U32_C(DOT11_OID_DEFKEYID, 0x12000003),
+	[DOT11_OID_DEFKEYX] = {0x12000004, 3, sizeof (struct obj_key),
+			       OID_FLAG_CACHED | OID_TYPE_KEY},	/* DOT11_OID_DEFKEY1,...DOT11_OID_DEFKEY4 */
+	OID_UNKNOWN(DOT11_OID_STAKEY, 0x12000008),
+	OID_U32(DOT11_OID_REKEYTHRESHOLD, 0x12000009),
+	OID_UNKNOWN(DOT11_OID_STASC, 0x1200000a),
+
+	OID_U32(DOT11_OID_PRIVTXREJECTED, 0x1a000000),
+	OID_U32(DOT11_OID_PRIVRXPLAIN, 0x1a000001),
+	OID_U32(DOT11_OID_PRIVRXFAILED, 0x1a000002),
+	OID_U32(DOT11_OID_PRIVRXNOKEY, 0x1a000003),
+
+	OID_U32_C(DOT11_OID_RTSTHRESH, 0x13000000),
+	OID_U32_C(DOT11_OID_FRAGTHRESH, 0x13000001),
+	OID_U32_C(DOT11_OID_SHORTRETRIES, 0x13000002),
+	OID_U32_C(DOT11_OID_LONGRETRIES, 0x13000003),
+	OID_U32_C(DOT11_OID_MAXTXLIFETIME, 0x13000004),
+	OID_U32(DOT11_OID_MAXRXLIFETIME, 0x13000005),
+	OID_U32(DOT11_OID_AUTHRESPTIMEOUT, 0x13000006),
+	OID_U32(DOT11_OID_ASSOCRESPTIMEOUT, 0x13000007),
+
+	OID_UNKNOWN(DOT11_OID_ALOFT_TABLE, 0x1d000000),
+	OID_UNKNOWN(DOT11_OID_ALOFT_CTRL_TABLE, 0x1d000001),
+	OID_UNKNOWN(DOT11_OID_ALOFT_RETREAT, 0x1d000002),
+	OID_UNKNOWN(DOT11_OID_ALOFT_PROGRESS, 0x1d000003),
+	OID_U32(DOT11_OID_ALOFT_FIXEDRATE, 0x1d000004),
+	OID_UNKNOWN(DOT11_OID_ALOFT_RSSIGRAPH, 0x1d000005),
+	OID_UNKNOWN(DOT11_OID_ALOFT_CONFIG, 0x1d000006),
 
 	[DOT11_OID_VDCFX] = {0x1b000000, 7, 0, 0},
-	[DOT11_OID_MAXFRAMEBURST] = OID_U32(0x1b000008), /* in microseconds */
+	OID_U32(DOT11_OID_MAXFRAMEBURST, 0x1b000008),
 
-	[DOT11_OID_PSM] = OID_U32(0x14000000),
-	[DOT11_OID_CAMTIMEOUT] = OID_U32(0x14000001),
-	[DOT11_OID_RECEIVEDTIMS] = OID_U32(0x14000002),
-	[DOT11_OID_ROAMPREFERENCE] = OID_U32(0x14000003),
+	OID_U32(DOT11_OID_PSM, 0x14000000),
+	OID_U32(DOT11_OID_CAMTIMEOUT, 0x14000001),
+	OID_U32(DOT11_OID_RECEIVEDTIMS, 0x14000002),
+	OID_U32(DOT11_OID_ROAMPREFERENCE, 0x14000003),
 
-	[DOT11_OID_BRIDGELOCAL] = OID_U32(0x15000000),
-	[DOT11_OID_CLIENTS] = OID_U32(0x15000001),
-	[DOT11_OID_CLIENTSASSOCIATED] = OID_U32(0x15000002),
+	OID_U32(DOT11_OID_BRIDGELOCAL, 0x15000000),
+	OID_U32(DOT11_OID_CLIENTS, 0x15000001),
+	OID_U32(DOT11_OID_CLIENTSASSOCIATED, 0x15000002),
 	[DOT11_OID_CLIENTX] = {0x15000003, 2006, 0, 0},	/* DOT11_OID_CLIENTX,...DOT11_OID_CLIENT2007 */
 
-	[DOT11_OID_CLIENTFIND] = OID_STRUCT(0x150007DB, u8[6]),
-	[DOT11_OID_WDSLINKADD] = OID_STRUCT(0x150007DC, u8[6]),
-	[DOT11_OID_WDSLINKREMOVE] = OID_STRUCT(0x150007DD, u8[6]),
-	[DOT11_OID_EAPAUTHSTA] = OID_STRUCT(0x150007DE, u8[6]),
-	[DOT11_OID_EAPUNAUTHSTA] = OID_STRUCT(0x150007DF, u8[6]),
-	[DOT11_OID_DOT1XENABLE] = OID_U32_C(0x150007E0),
-	[DOT11_OID_MICFAILURE] = OID_UNKNOWN(0x150007E1),
-	[DOT11_OID_REKEYINDICATE] = OID_UNKNOWN(0x150007E2),
-
-	[DOT11_OID_MPDUTXSUCCESSFUL] = OID_U32(0x16000000),
-	[DOT11_OID_MPDUTXONERETRY] = OID_U32(0x16000001),
-	[DOT11_OID_MPDUTXMULTIPLERETRIES] = OID_U32(0x16000002),
-	[DOT11_OID_MPDUTXFAILED] = OID_U32(0x16000003),
-	[DOT11_OID_MPDURXSUCCESSFUL] = OID_U32(0x16000004),
-	[DOT11_OID_MPDURXDUPS] = OID_U32(0x16000005),
-	[DOT11_OID_RTSSUCCESSFUL] = OID_U32(0x16000006),
-	[DOT11_OID_RTSFAILED] = OID_U32(0x16000007),
-	[DOT11_OID_ACKFAILED] = OID_U32(0x16000008),
-	[DOT11_OID_FRAMERECEIVES] = OID_U32(0x16000009),
-	[DOT11_OID_FRAMEERRORS] = OID_U32(0x1600000A),
-	[DOT11_OID_FRAMEABORTS] = OID_U32(0x1600000B),
-	[DOT11_OID_FRAMEABORTSPHY] = OID_U32(0x1600000C),
-
-	[DOT11_OID_SLOTTIME] = OID_U32(0x17000000),
-	[DOT11_OID_CWMIN] = OID_U32(0x17000001),
-	[DOT11_OID_CWMAX] = OID_U32(0x17000002),
-	[DOT11_OID_ACKWINDOW] = OID_U32(0x17000003),
-	[DOT11_OID_ANTENNARX] = OID_U32(0x17000004),
-	[DOT11_OID_ANTENNATX] = OID_U32(0x17000005),
-	[DOT11_OID_ANTENNADIVERSITY] = OID_U32(0x17000006),
-	[DOT11_OID_CHANNEL] = OID_U32_C(0x17000007),
-	[DOT11_OID_EDTHRESHOLD] = OID_U32_C(0x17000008),
-	[DOT11_OID_PREAMBLESETTINGS] = OID_U32(0x17000009),
-	[DOT11_OID_RATES] = OID_STRUCT(0x1700000A, u8[IWMAX_BITRATES + 1]),
-	[DOT11_OID_CCAMODESUPPORTED] = OID_U32(0x1700000B),
-	[DOT11_OID_CCAMODE] = OID_U32(0x1700000C),
-	[DOT11_OID_RSSIVECTOR] = OID_U32(0x1700000D),
-	[DOT11_OID_OUTPUTPOWERTABLE] = OID_U32(0x1700000E),
-	[DOT11_OID_OUTPUTPOWER] = OID_U32_C(0x1700000F),
-	[DOT11_OID_SUPPORTEDRATES] =
-	    OID_STRUCT(0x17000010, u8[IWMAX_BITRATES + 1]),
-	[DOT11_OID_FREQUENCY] = OID_U32_C(0x17000011),
-	[DOT11_OID_SUPPORTEDFREQUENCIES] = {0x17000012, 0, sizeof (struct
-								   obj_frequencies)
-					    + sizeof (u16) * IWMAX_FREQ, 0},
-
-	[DOT11_OID_NOISEFLOOR] = OID_U32(0x17000013),
-	[DOT11_OID_FREQUENCYACTIVITY] =
-	    OID_STRUCT(0x17000014, u8[IWMAX_FREQ + 1]),
-	[DOT11_OID_IQCALIBRATIONTABLE] = OID_UNKNOWN(0x17000015),
-	[DOT11_OID_NONERPPROTECTION] = OID_U32(0x17000016),
-	[DOT11_OID_SLOTSETTINGS] = OID_U32(0x17000017),
-	[DOT11_OID_NONERPTIMEOUT] = OID_U32(0x17000018),
-	[DOT11_OID_PROFILES] = OID_U32(0x17000019),
-	[DOT11_OID_EXTENDEDRATES] =
-	    OID_STRUCT(0x17000020, u8[IWMAX_BITRATES + 1]),
-
-	[DOT11_OID_DEAUTHENTICATE] = OID_STRUCT_MLME(0x18000000),
-	[DOT11_OID_AUTHENTICATE] = OID_STRUCT_MLME(0x18000001),
-	[DOT11_OID_DISASSOCIATE] = OID_STRUCT_MLME(0x18000002),
-	[DOT11_OID_ASSOCIATE] = OID_STRUCT_MLME(0x18000003),
-	[DOT11_OID_SCAN] = OID_UNKNOWN(0x18000004),
-	[DOT11_OID_BEACON] = OID_STRUCT_MLMEEX(0x18000005),
-	[DOT11_OID_PROBE] = OID_STRUCT_MLMEEX(0x18000006),
-	[DOT11_OID_DEAUTHENTICATEEX] = OID_STRUCT_MLMEEX(0x18000007),
-	[DOT11_OID_AUTHENTICATEEX] = OID_STRUCT_MLMEEX(0x18000008),
-	[DOT11_OID_DISASSOCIATEEX] = OID_STRUCT_MLMEEX(0x18000009),
-	[DOT11_OID_ASSOCIATEEX] = OID_STRUCT_MLMEEX(0x1800000A),
-	[DOT11_OID_REASSOCIATE] = OID_STRUCT_MLMEEX(0x1800000B),
-	[DOT11_OID_REASSOCIATEEX] = OID_STRUCT_MLMEEX(0x1800000C),
-
-	[DOT11_OID_NONERPSTATUS] = OID_U32(0x1E000000),
-
-	[DOT11_OID_STATIMEOUT] = OID_U32(0x19000000),
-	[DOT11_OID_MLMEAUTOLEVEL] = OID_U32_C(0x19000001),
-	[DOT11_OID_BSSTIMEOUT] = OID_U32(0x19000002),
-	[DOT11_OID_ATTACHMENT] = OID_UNKNOWN(0x19000003),
-	[DOT11_OID_PSMBUFFER] = OID_STRUCT_C(0x19000004, struct obj_buffer),
-
-	[DOT11_OID_BSSS] = OID_U32(0x1C000000),
-	[DOT11_OID_BSSX] = {0x1C000001, 63, sizeof (struct obj_bss), 0},	/*DOT11_OID_BSS1,...,DOT11_OID_BSS64 */
-	[DOT11_OID_BSSFIND] = OID_STRUCT(0x1C000042, struct obj_bss),
+	OID_STRUCT(DOT11_OID_CLIENTFIND, 0x150007DB, u8[6], OID_TYPE_ADDR),
+	OID_STRUCT(DOT11_OID_WDSLINKADD, 0x150007DC, u8[6], OID_TYPE_ADDR),
+	OID_STRUCT(DOT11_OID_WDSLINKREMOVE, 0x150007DD, u8[6], OID_TYPE_ADDR),
+	OID_STRUCT(DOT11_OID_EAPAUTHSTA, 0x150007DE, u8[6], OID_TYPE_ADDR),
+	OID_STRUCT(DOT11_OID_EAPUNAUTHSTA, 0x150007DF, u8[6], OID_TYPE_ADDR),
+	OID_U32_C(DOT11_OID_DOT1XENABLE, 0x150007E0),
+	OID_UNKNOWN(DOT11_OID_MICFAILURE, 0x150007E1),
+	OID_UNKNOWN(DOT11_OID_REKEYINDICATE, 0x150007E2),
+
+	OID_U32(DOT11_OID_MPDUTXSUCCESSFUL, 0x16000000),
+	OID_U32(DOT11_OID_MPDUTXONERETRY, 0x16000001),
+	OID_U32(DOT11_OID_MPDUTXMULTIPLERETRIES, 0x16000002),
+	OID_U32(DOT11_OID_MPDUTXFAILED, 0x16000003),
+	OID_U32(DOT11_OID_MPDURXSUCCESSFUL, 0x16000004),
+	OID_U32(DOT11_OID_MPDURXDUPS, 0x16000005),
+	OID_U32(DOT11_OID_RTSSUCCESSFUL, 0x16000006),
+	OID_U32(DOT11_OID_RTSFAILED, 0x16000007),
+	OID_U32(DOT11_OID_ACKFAILED, 0x16000008),
+	OID_U32(DOT11_OID_FRAMERECEIVES, 0x16000009),
+	OID_U32(DOT11_OID_FRAMEERRORS, 0x1600000A),
+	OID_U32(DOT11_OID_FRAMEABORTS, 0x1600000B),
+	OID_U32(DOT11_OID_FRAMEABORTSPHY, 0x1600000C),
+
+	OID_U32(DOT11_OID_SLOTTIME, 0x17000000),
+	OID_U32(DOT11_OID_CWMIN, 0x17000001),
+	OID_U32(DOT11_OID_CWMAX, 0x17000002),
+	OID_U32(DOT11_OID_ACKWINDOW, 0x17000003),
+	OID_U32(DOT11_OID_ANTENNARX, 0x17000004),
+	OID_U32(DOT11_OID_ANTENNATX, 0x17000005),
+	OID_U32(DOT11_OID_ANTENNADIVERSITY, 0x17000006),
+	OID_U32_C(DOT11_OID_CHANNEL, 0x17000007),
+	OID_U32_C(DOT11_OID_EDTHRESHOLD, 0x17000008),
+	OID_U32(DOT11_OID_PREAMBLESETTINGS, 0x17000009),
+	OID_STRUCT(DOT11_OID_RATES, 0x1700000A, u8[IWMAX_BITRATES + 1],
+		   OID_TYPE_RAW),
+	OID_U32(DOT11_OID_CCAMODESUPPORTED, 0x1700000B),
+	OID_U32(DOT11_OID_CCAMODE, 0x1700000C),
+	OID_UNKNOWN(DOT11_OID_RSSIVECTOR, 0x1700000D),
+	OID_UNKNOWN(DOT11_OID_OUTPUTPOWERTABLE, 0x1700000E),
+	OID_U32(DOT11_OID_OUTPUTPOWER, 0x1700000F),
+	OID_STRUCT(DOT11_OID_SUPPORTEDRATES, 0x17000010,
+		   u8[IWMAX_BITRATES + 1], OID_TYPE_RAW),
+	OID_U32_C(DOT11_OID_FREQUENCY, 0x17000011),
+	[DOT11_OID_SUPPORTEDFREQUENCIES] =
+	    {0x17000012, 0, sizeof (struct obj_frequencies)
+	     + sizeof (u16) * IWMAX_FREQ, OID_TYPE_FREQUENCIES},
+
+	OID_U32(DOT11_OID_NOISEFLOOR, 0x17000013),
+	OID_STRUCT(DOT11_OID_FREQUENCYACTIVITY, 0x17000014, u8[IWMAX_FREQ + 1],
+		   OID_TYPE_RAW),
+	OID_UNKNOWN(DOT11_OID_IQCALIBRATIONTABLE, 0x17000015),
+	OID_U32(DOT11_OID_NONERPPROTECTION, 0x17000016),
+	OID_U32(DOT11_OID_SLOTSETTINGS, 0x17000017),
+	OID_U32(DOT11_OID_NONERPTIMEOUT, 0x17000018),
+	OID_U32(DOT11_OID_PROFILES, 0x17000019),
+	OID_STRUCT(DOT11_OID_EXTENDEDRATES, 0x17000020,
+		   u8[IWMAX_BITRATES + 1], OID_TYPE_RAW),
+
+	OID_STRUCT_MLME(DOT11_OID_DEAUTHENTICATE, 0x18000000),
+	OID_STRUCT_MLME(DOT11_OID_AUTHENTICATE, 0x18000001),
+	OID_STRUCT_MLME(DOT11_OID_DISASSOCIATE, 0x18000002),
+	OID_STRUCT_MLME(DOT11_OID_ASSOCIATE, 0x18000003),
+	OID_UNKNOWN(DOT11_OID_SCAN, 0x18000004),
+	OID_STRUCT_MLMEEX(DOT11_OID_BEACON, 0x18000005),
+	OID_STRUCT_MLMEEX(DOT11_OID_PROBE, 0x18000006),
+	OID_STRUCT_MLMEEX(DOT11_OID_DEAUTHENTICATEEX, 0x18000007),
+	OID_STRUCT_MLMEEX(DOT11_OID_AUTHENTICATEEX, 0x18000008),
+	OID_STRUCT_MLMEEX(DOT11_OID_DISASSOCIATEEX, 0x18000009),
+	OID_STRUCT_MLMEEX(DOT11_OID_ASSOCIATEEX, 0x1800000A),
+	OID_STRUCT_MLMEEX(DOT11_OID_REASSOCIATE, 0x1800000B),
+	OID_STRUCT_MLMEEX(DOT11_OID_REASSOCIATEEX, 0x1800000C),
+
+	OID_U32(DOT11_OID_NONERPSTATUS, 0x1E000000),
+
+	OID_U32(DOT11_OID_STATIMEOUT, 0x19000000),
+	OID_U32_C(DOT11_OID_MLMEAUTOLEVEL, 0x19000001),
+	OID_U32(DOT11_OID_BSSTIMEOUT, 0x19000002),
+	OID_UNKNOWN(DOT11_OID_ATTACHMENT, 0x19000003),
+	OID_STRUCT_C(DOT11_OID_PSMBUFFER, 0x19000004, struct obj_buffer,
+		     OID_TYPE_BUFFER),
+
+	OID_U32(DOT11_OID_BSSS, 0x1C000000),
+	[DOT11_OID_BSSX] = {0x1C000001, 63, sizeof (struct obj_bss),
+			    OID_TYPE_BSS},	/*DOT11_OID_BSS1,...,DOT11_OID_BSS64 */
+	OID_STRUCT(DOT11_OID_BSSFIND, 0x1C000042, struct obj_bss, OID_TYPE_BSS),
 	[DOT11_OID_BSSLIST] = {0x1C000043, 0, sizeof (struct
 						      obj_bsslist) +
-			       sizeof (struct obj_bss[IWMAX_BSS]), 0},
-
-	[OID_INL_TUNNEL] = OID_UNKNOWN(0xFF020000),
-	[OID_INL_MEMADDR] = OID_UNKNOWN(0xFF020001),
-	[OID_INL_MEMORY] = OID_UNKNOWN(0xFF020002),
-	[OID_INL_MODE] = OID_U32_C(0xFF020003),
-	[OID_INL_COMPONENT_NR] = OID_UNKNOWN(0xFF020004),
-	[OID_INL_VERSION] = OID_UNKNOWN(0xFF020005),
-	[OID_INL_INTERFACE_ID] = OID_UNKNOWN(0xFF020006),
-	[OID_INL_COMPONENT_ID] = OID_UNKNOWN(0xFF020007),
-	[OID_INL_CONFIG] = OID_U32_C(0xFF020008),
-	[OID_INL_DOT11D_CONFORMANCE] = OID_U32_C(0xFF02000C),
-	[OID_INL_PHYCAPABILITIES] = OID_U32(0xFF02000D),
-	[OID_INL_OUTPUTPOWER] = OID_U32_C(0xFF02000F),
+			       sizeof (struct obj_bss[IWMAX_BSS]),
+			       OID_TYPE_BSSLIST},
+
+	OID_UNKNOWN(OID_INL_TUNNEL, 0xFF020000),
+	OID_UNKNOWN(OID_INL_MEMADDR, 0xFF020001),
+	OID_UNKNOWN(OID_INL_MEMORY, 0xFF020002),
+	OID_U32_C(OID_INL_MODE, 0xFF020003),
+	OID_UNKNOWN(OID_INL_COMPONENT_NR, 0xFF020004),
+	OID_UNKNOWN(OID_INL_VERSION, 0xFF020005),
+	OID_UNKNOWN(OID_INL_INTERFACE_ID, 0xFF020006),
+	OID_UNKNOWN(OID_INL_COMPONENT_ID, 0xFF020007),
+	OID_U32_C(OID_INL_CONFIG, 0xFF020008),
+	OID_U32_C(OID_INL_DOT11D_CONFORMANCE, 0xFF02000C),
+	OID_U32(OID_INL_PHYCAPABILITIES, 0xFF02000D),
+	OID_U32_C(OID_INL_OUTPUTPOWER, 0xFF02000F),
 
 };
 
@@ -257,6 +285,134 @@ mgt_clean(islpci_private *priv)
 	priv->mib = NULL;
 }
 
+void
+mgt_le_to_cpu(int type, void *data)
+{
+	switch (type) {
+	case OID_TYPE_U32:
+		*(u32 *) data = le32_to_cpu(*(u32 *) data);
+		break;
+	case OID_TYPE_BUFFER:{
+			struct obj_buffer *buff = data;
+			buff->size = le32_to_cpu(buff->size);
+			buff->addr = le32_to_cpu(buff->addr);
+			break;
+		}
+	case OID_TYPE_BSS:{
+			struct obj_bss *bss = data;
+			bss->age = le16_to_cpu(bss->age);
+			bss->channel = le16_to_cpu(bss->channel);
+			bss->capinfo = le16_to_cpu(bss->capinfo);
+			bss->rates = le16_to_cpu(bss->rates);
+			bss->basic_rates = le16_to_cpu(bss->basic_rates);
+			break;
+		}
+	case OID_TYPE_BSSLIST:{
+			struct obj_bsslist *list = data;
+			int i;
+			list->nr = le32_to_cpu(list->nr);
+			for (i = 0; i < list->nr; i++)
+				mgt_le_to_cpu(OID_TYPE_BSS, &list->bsslist[i]);
+			break;
+		}
+	case OID_TYPE_FREQUENCIES:{
+			struct obj_frequencies *freq = data;
+			int i;
+			freq->nr = le16_to_cpu(freq->nr);
+			for (i = 0; i < freq->nr; i++)
+				freq->mhz[i] = le16_to_cpu(freq->mhz[i]);
+			break;
+		}
+	case OID_TYPE_MLME:{
+			struct obj_mlme *mlme = data;
+			mlme->id = le16_to_cpu(mlme->id);
+			mlme->state = le16_to_cpu(mlme->state);
+			mlme->code = le16_to_cpu(mlme->code);
+			break;
+		}
+	case OID_TYPE_MLMEEX:{
+			struct obj_mlmeex *mlme = data;
+			mlme->id = le16_to_cpu(mlme->id);
+			mlme->state = le16_to_cpu(mlme->state);
+			mlme->code = le16_to_cpu(mlme->code);
+			mlme->size = le16_to_cpu(mlme->size);
+			break;
+		}
+	case OID_TYPE_SSID:
+	case OID_TYPE_KEY:
+	case OID_TYPE_ADDR:
+	case OID_TYPE_RAW:
+		break;
+	default:
+		BUG();
+	}
+}
+
+static void
+mgt_cpu_to_le(int type, void *data)
+{
+	switch (type) {
+	case OID_TYPE_U32:
+		*(u32 *) data = cpu_to_le32(*(u32 *) data);
+		break;
+	case OID_TYPE_BUFFER:{
+			struct obj_buffer *buff = data;
+			buff->size = cpu_to_le32(buff->size);
+			buff->addr = cpu_to_le32(buff->addr);
+			break;
+		}
+	case OID_TYPE_BSS:{
+			struct obj_bss *bss = data;
+			bss->age = cpu_to_le16(bss->age);
+			bss->channel = cpu_to_le16(bss->channel);
+			bss->capinfo = cpu_to_le16(bss->capinfo);
+			bss->rates = cpu_to_le16(bss->rates);
+			bss->basic_rates = cpu_to_le16(bss->basic_rates);
+			break;
+		}
+	case OID_TYPE_BSSLIST:{
+			struct obj_bsslist *list = data;
+			int i;
+			list->nr = cpu_to_le32(list->nr);
+			for (i = 0; i < list->nr; i++)
+				mgt_cpu_to_le(OID_TYPE_BSS, &list->bsslist[i]);
+			break;
+		}
+	case OID_TYPE_FREQUENCIES:{
+			struct obj_frequencies *freq = data;
+			int i;
+			freq->nr = cpu_to_le16(freq->nr);
+			for (i = 0; i < freq->nr; i++)
+				freq->mhz[i] = cpu_to_le16(freq->mhz[i]);
+			break;
+		}
+	case OID_TYPE_MLME:{
+			struct obj_mlme *mlme = data;
+			mlme->id = cpu_to_le16(mlme->id);
+			mlme->state = cpu_to_le16(mlme->state);
+			mlme->code = cpu_to_le16(mlme->code);
+			break;
+		}
+	case OID_TYPE_MLMEEX:{
+			struct obj_mlmeex *mlme = data;
+			mlme->id = cpu_to_le16(mlme->id);
+			mlme->state = cpu_to_le16(mlme->state);
+			mlme->code = cpu_to_le16(mlme->code);
+			mlme->size = cpu_to_le16(mlme->size);
+			break;
+		}
+	case OID_TYPE_SSID:
+	case OID_TYPE_KEY:
+	case OID_TYPE_ADDR:
+	case OID_TYPE_RAW:
+		break;
+	default:
+		BUG();
+	}
+}
+
+/* Note : data is modified during this function */
+
 int
 mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 {
@@ -265,7 +421,7 @@ mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 	int response_op = PIMFOR_OP_ERROR;
 	int dlen;
 	void *cache, *_data = data;
-	u32 oid, u;
+	u32 oid;
 
 	BUG_ON(OID_NUM_LAST <= n);
 	BUG_ON(extra > isl_oid[n].range);
@@ -279,13 +435,11 @@ mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 	cache += (cache ? extra * dlen : 0);
 	oid = isl_oid[n].oid + extra;
 
-	if (data == NULL)
+	if (_data == NULL)
 		/* we are requested to re-set a cached value */
 		_data = cache;
-	if ((isl_oid[n].flags & OID_FLAG_U32) && data) {
-		u = cpu_to_le32(*(u32 *) data);
-		_data = &u;
-	}
+	else
+		mgt_cpu_to_le(isl_oid[n].flags & OID_FLAG_TYPE, _data);
 	/* If we are going to write to the cache, we don't want anyone to read
 	 * it -> acquire write lock.
 	 * Else we could acquire a read lock to be sure we don't bother the
@@ -313,6 +467,10 @@ mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 		up_write(&priv->mib_sem);
 	}
 
+	/* re-set given data to what it was */
+	if (data)
+		mgt_le_to_cpu(isl_oid[n].flags & OID_FLAG_TYPE, data);
+
 	return ret;
 }
 
@@ -326,7 +484,7 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
 	struct islpci_mgmtframe *response = NULL;
 	
 	int dlen;
-	void *cache, *_res=NULL;
+	void *cache, *_res = NULL;
 	u32 oid;
 
 	BUG_ON(OID_NUM_LAST <= n);
@@ -362,20 +520,19 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
 		_res = cache;
 		ret = 0;
 	}
-	if (isl_oid[n].flags & OID_FLAG_U32) {
-		if (ret)
-			res->u = 0;
-		else
-			res->u = le32_to_cpu(*(u32 *) _res);
-	} else {
+	if ((isl_oid[n].flags & OID_FLAG_TYPE) == OID_TYPE_U32)
+		res->u = ret ? 0 : le32_to_cpu(*(u32 *) _res);
+	else {
 		res->ptr = kmalloc(reslen, GFP_KERNEL);
 		BUG_ON(res->ptr == NULL);
 		if (ret)
 			memset(res->ptr, 0, reslen);
-		else
+		else {
 			memcpy(res->ptr, _res, reslen);
+			mgt_le_to_cpu(isl_oid[n].flags & OID_FLAG_TYPE,
+				      res->ptr);
+		}
 	}
-
 	if (cache)
 		up_read(&priv->mib_sem);
 
@@ -404,7 +561,7 @@ mgt_commit_list(islpci_private *priv, enum oid_num_t *l, int n)
 		int j = 0;
 		u32 oid = t->oid;
 		BUG_ON(data == NULL);
-		while (j <= t->range){
+		while (j <= t->range) {
 			response = NULL;
 			ret |= islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET,
 			                              oid, data, t->size,
@@ -431,13 +588,21 @@ mgt_set(islpci_private *priv, enum oid_num_t n, void *data)
 	BUG_ON(priv->mib[n] == NULL);
 
 	memcpy(priv->mib[n], data, isl_oid[n].size);
-	if (isl_oid[n].flags & OID_FLAG_U32)
-		*(u32 *) priv->mib[n] = cpu_to_le32(*(u32 *) priv->mib[n]);
+	mgt_cpu_to_le(isl_oid[n].flags & OID_FLAG_TYPE, priv->mib[n]);
 }
 
-/* Commits the cache. If something goes wrong, it restarts the device. Lock
- * outside
- */
+void
+mgt_get(islpci_private *priv, enum oid_num_t n, void *res)
+{
+	BUG_ON(OID_NUM_LAST <= n);
+	BUG_ON(priv->mib[n] == NULL);
+	BUG_ON(res == NULL);
+
+	memcpy(res, priv->mib[n], isl_oid[n].size);
+	mgt_le_to_cpu(isl_oid[n].flags & OID_FLAG_TYPE, res);
+}
+
+/* Commits the cache. Lock outside. */
 
 static enum oid_num_t commit_part1[] = {
 	OID_INL_CONFIG,
@@ -530,3 +695,102 @@ mgt_oidtonum(u32 oid)
 
 	return 0;
 }
+
+int
+mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
+{
+	switch (isl_oid[n].flags & OID_FLAG_TYPE) {
+	case OID_TYPE_U32:
+		return snprintf(str, PRIV_STR_SIZE, "%u\n", r->u);
+		break;
+	case OID_TYPE_BUFFER:{
+			struct obj_buffer *buff = r->ptr;
+			return snprintf(str, PRIV_STR_SIZE,
+					"size=%u\naddr=0x%X\n", buff->size,
+					buff->addr);
+		}
+		break;
+	case OID_TYPE_BSS:{
+			struct obj_bss *bss = r->ptr;
+			return snprintf(str, PRIV_STR_SIZE,
+					"age=%u\nchannel=%u\n\
+				        capinfo=0x%X\nrates=0x%X\nbasic_rates=0x%X\n", bss->age, bss->channel, bss->capinfo, bss->rates, bss->basic_rates);
+		}
+		break;
+	case OID_TYPE_BSSLIST:{
+			struct obj_bsslist *list = r->ptr;
+			int i, k;
+			k = snprintf(str, PRIV_STR_SIZE, "nr=%u\n", list->nr);
+			for (i = 0; i < list->nr; i++)
+				k += snprintf(str + k, PRIV_STR_SIZE - k,
+					      "bss[%u] : \nage=%u\nchannel=%u\ncapinfo=0x%X\nrates=0x%X\nbasic_rates=0x%X\n",
+					      i, list->bsslist[i].age,
+					      list->bsslist[i].channel,
+					      list->bsslist[i].capinfo,
+					      list->bsslist[i].rates,
+					      list->bsslist[i].basic_rates);
+			return k;
+		}
+		break;
+	case OID_TYPE_FREQUENCIES:{
+			struct obj_frequencies *freq = r->ptr;
+			int i, t;
+			printk("nr : %u\n", freq->nr);
+			t = snprintf(str, PRIV_STR_SIZE, "nr=%u\n", freq->nr);
+			for (i = 0; i < freq->nr; i++)
+				t += snprintf(str + t, PRIV_STR_SIZE - t,
+					      "mhz[%u]=%u\n", i, freq->mhz[i]);
+			return t;
+		}
+		break;
+	case OID_TYPE_MLME:{
+			struct obj_mlme *mlme = r->ptr;
+			return snprintf(str, PRIV_STR_SIZE, "id=0x%X\nstate=0x%X\n\
+			         code=0x%X\n", mlme->id, mlme->state,
+					mlme->code);
+		}
+		break;
+	case OID_TYPE_MLMEEX:{
+			struct obj_mlmeex *mlme = r->ptr;
+			return snprintf(str, PRIV_STR_SIZE, "id=0x%X\nstate=0x%X\n\
+			         code=0x%X\nsize=0x%X\n", mlme->id, mlme->state,
+					mlme->code, mlme->size);
+		}
+		break;
+	case OID_TYPE_SSID:{
+			struct obj_ssid *ssid = r->ptr;
+			return snprintf(str, PRIV_STR_SIZE,
+					"length=%u\noctets=%s\n",
+					ssid->length, ssid->octets);
+		}
+		break;
+	case OID_TYPE_KEY:{
+			struct obj_key *key = r->ptr;
+			int t, i;
+			t = snprintf(str, PRIV_STR_SIZE,
+				     "type=0x%X\nlength=0x%X\nkey=0x",
+				     key->type, key->length);
+			for (i = 0; i < key->length; i++)
+				t += snprintf(str + t, PRIV_STR_SIZE - t,
+					      "%02X:", key->key[i]);
+			t += snprintf(str + t, PRIV_STR_SIZE - t, "\n");
+			return t;
+		}
+		break;
+	case OID_TYPE_RAW:
+	case OID_TYPE_ADDR:{
+			unsigned char *buff = r->ptr;
+			int t, i;
+			t = snprintf(str, PRIV_STR_SIZE, "hex data=");
+			for (i = 0; i < isl_oid[n].size; i++)
+				t += snprintf(str + t, PRIV_STR_SIZE - t,
+					      "%02X:", buff[i]);
+			t += snprintf(str + t, PRIV_STR_SIZE - t, "\n");
+			return t;
+		}
+		break;
+	default:
+		BUG();
+	}
+	return 0;
+}
diff --git a/drivers/net/wireless/prism54/oid_mgt.h b/drivers/net/wireless/prism54/oid_mgt.h
index d00af1892..cd8167e29 100644
--- a/drivers/net/wireless/prism54/oid_mgt.h
+++ b/drivers/net/wireless/prism54/oid_mgt.h
@@ -1,4 +1,4 @@
-/*   
+/*
  *  Copyright (C) 2003 Aurelien Alleaume <slts@free.fr>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -28,9 +28,12 @@ int mgt_init(islpci_private *);
 
 void mgt_clean(islpci_private *);
 
+/* I don't know where to put these 3 */
 extern const int frequency_list_bg[];
-
 extern const int frequency_list_a[];
+int channel_of_freq(int);
+
+void mgt_le_to_cpu(int, void *);
 
 int mgt_set_request(islpci_private *, enum oid_num_t, int, void *);
 
@@ -41,11 +44,15 @@ int mgt_commit_list(islpci_private *, enum oid_num_t *, int);
 
 void mgt_set(islpci_private *, enum oid_num_t, void *);
 
+void mgt_get(islpci_private *, enum oid_num_t, void *);
+
 void mgt_commit(islpci_private *);
 
 int mgt_mlme_answer(islpci_private *);
 
 enum oid_num_t mgt_oidtonum(u32 oid);
 
+int mgt_response_to_str(enum oid_num_t, union oid_res_t *, char *);
+
 #endif				/* !defined(_OID_MGT_H) */
 /* EOF */
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index ee328d5c2..5eb32a9ca 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -1841,7 +1841,7 @@ wl_his_gather(struct net_device *	dev,
 #endif	/* HISTOGRAM */
 
 static inline int
-wl_netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+wl_netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	u32 ethcmd;
 
@@ -2764,7 +2764,7 @@ wavelan_ioctl(struct net_device *	dev,	/* Device on wich the ioctl apply */
   switch(cmd)
     {
     case SIOCETHTOOL:
-      ret = wl_netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+      ret = wl_netdev_ethtool_ioctl(dev, rq->ifr_data);
       break;
 
       /* ------------------- OTHER IOCTL ------------------- */
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index ed4acc13a..4e62fa630 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1487,7 +1487,7 @@ struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev)
 	return wstats;
 }
 
-static inline int wl3501_ethtool_ioctl(struct net_device *dev, void *uaddr)
+static inline int wl3501_ethtool_ioctl(struct net_device *dev, void __user *uaddr)
 {
 	u32 ethcmd;
 	int rc = -EFAULT;
@@ -1532,7 +1532,7 @@ static int wl3501_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 	if (netif_device_present(dev)) {
 		rc = -EOPNOTSUPP;
 		if (cmd == SIOCETHTOOL)
-			rc = wl3501_ethtool_ioctl(dev, (void *)rq->ifr_data);
+			rc = wl3501_ethtool_ioctl(dev, rq->ifr_data);
 	}
 	return rc;
 }
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index 9994de2d9..81e97947c 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -1405,7 +1405,7 @@ static void set_rx_mode(struct net_device *dev)
 	outw(cfg_value | 0x1000, ioaddr + Cnfg);
 }
 
-static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
+static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
 	struct yellowfin_private *np = dev->priv;
 	u32 ethcmd;
@@ -1433,11 +1433,11 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct yellowfin_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
-	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
+	struct mii_ioctl_data *data = if_mii(rq);
 
 	switch(cmd) {
 	case SIOCETHTOOL:
-		return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
+		return netdev_ethtool_ioctl(dev, rq->ifr_data);
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
 		data->phy_id = np->phys[0] & 0x1f;
 		/* Fall Through */
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
index 3df72441f..d8b186924 100644
--- a/drivers/oprofile/event_buffer.c
+++ b/drivers/oprofile/event_buffer.c
@@ -142,7 +142,7 @@ int event_buffer_release(struct inode * inode, struct file * file)
 }
 
 
-ssize_t event_buffer_read(struct file * file, char * buf, size_t count, loff_t * offset)
+ssize_t event_buffer_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
 {
 	int retval = -EINVAL;
 	size_t const max = buffer_size * sizeof(unsigned long);
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c
index b7466377a..381abef6f 100644
--- a/drivers/oprofile/oprofile_files.c
+++ b/drivers/oprofile/oprofile_files.c
@@ -19,9 +19,9 @@ unsigned long fs_cpu_buffer_size = 8192;
 unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */
 
  
-static ssize_t pointer_size_read(struct file * file, char * buf, size_t count, loff_t * offset)
+static ssize_t pointer_size_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
 {
-	return oprofilefs_ulong_to_user((unsigned long)sizeof(void *), buf, count, offset);
+	return oprofilefs_ulong_to_user(sizeof(void *), buf, count, offset);
 }
 
 
@@ -30,7 +30,7 @@ static struct file_operations pointer_size_fops = {
 };
 
 
-static ssize_t cpu_type_read(struct file * file, char * buf, size_t count, loff_t * offset)
+static ssize_t cpu_type_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
 {
 	return oprofilefs_str_to_user(oprofile_ops->cpu_type, buf, count, offset);
 }
@@ -41,13 +41,13 @@ static struct file_operations cpu_type_fops = {
 };
  
  
-static ssize_t enable_read(struct file * file, char * buf, size_t count, loff_t * offset)
+static ssize_t enable_read(struct file * file, char __user * buf, size_t count, loff_t * offset)
 {
 	return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset);
 }
 
 
-static ssize_t enable_write(struct file *file, char const * buf, size_t count, loff_t * offset)
+static ssize_t enable_write(struct file *file, char const __user * buf, size_t count, loff_t * offset)
 {
 	unsigned long val;
 	int retval;
@@ -76,7 +76,7 @@ static struct file_operations enable_fops = {
 };
 
 
-static ssize_t dump_write(struct file *file, char const * buf, size_t count, loff_t * offset)
+static ssize_t dump_write(struct file *file, char const __user * buf, size_t count, loff_t * offset)
 {
 	wake_up_buffer_waiter();
 	return count;
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index ed1efe61f..2824c24c7 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -45,7 +45,7 @@ static struct super_operations s_ops = {
 };
 
 
-ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_t * offset)
+ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count, loff_t * offset)
 {
 	size_t len = strlen(str);
 
@@ -69,7 +69,7 @@ ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_
 
 #define TMPBUFSIZE 50
 
-ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset)
+ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t count, loff_t * offset)
 {
 	char tmpbuf[TMPBUFSIZE];
 	size_t maxlen;
@@ -98,7 +98,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, lo
 }
 
 
-int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t count)
+int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count)
 {
 	char tmpbuf[TMPBUFSIZE];
 
@@ -120,14 +120,14 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t cou
 }
 
 
-static ssize_t ulong_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
+static ssize_t ulong_read_file(struct file * file, char __user * buf, size_t count, loff_t * offset)
 {
 	unsigned long * val = file->private_data;
 	return oprofilefs_ulong_to_user(*val, buf, count, offset);
 }
 
 
-static ssize_t ulong_write_file(struct file * file, char const * buf, size_t count, loff_t * offset)
+static ssize_t ulong_write_file(struct file * file, char const __user * buf, size_t count, loff_t * offset)
 {
 	unsigned long * value = file->private_data;
 	int retval;
@@ -211,7 +211,7 @@ int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
 }
 
 
-static ssize_t atomic_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
+static ssize_t atomic_read_file(struct file * file, char __user * buf, size_t count, loff_t * offset)
 {
 	atomic_t * val = file->private_data;
 	return oprofilefs_ulong_to_user(atomic_read(val), buf, count, offset);
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 2cb736488..ad7811509 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -63,7 +63,6 @@
 #include <linux/ioport.h>
 #include <linux/serial.h>
 #include <linux/pci.h>
-#include <linux/ioport.h>
 #include <linux/parport.h>
 #include <linux/parport_pc.h>
 #include <linux/termios.h>
@@ -71,6 +70,7 @@
 #include <linux/serial_core.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
+
 #include <asm/io.h>
 #include <asm/hardware.h>
 #include <asm/irq.h>
diff --git a/drivers/parisc/wax.c b/drivers/parisc/wax.c
index e9044d225..41d1c191a 100644
--- a/drivers/parisc/wax.c
+++ b/drivers/parisc/wax.c
@@ -17,7 +17,6 @@
 #include <linux/ioport.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/slab.h>
 #include <linux/types.h>
 
 #include <asm/io.h>
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 831d67803..218eb4fd7 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2699,7 +2699,7 @@ static struct parport_pc_pci {
 	 * and 840 locks up if you write 1 to bit 2! */
 	/* oxsemi_954 */		{ 1, { { 0, -1 }, } },
 	/* oxsemi_840 */		{ 1, { { 0, -1 }, } },
-	/* aks_0100 */			{ 1, { { 0, 1 }, } },
+	/* aks_0100 */                  { 1, { { 0, -1 }, } },
 	/* mobility_pp */		{ 1, { { 0, 1 }, } },
 };
 
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index d08504abd..afa6ac45a 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -33,7 +33,7 @@
 #define PARPORT_MAX_SPINTIME_VALUE 1000
 
 static int do_active_device(ctl_table *table, int write, struct file *filp,
-		      void *result, size_t *lenp)
+		      void __user *result, size_t *lenp)
 {
 	struct parport *port = (struct parport *)table->extra1;
 	char buffer[256];
@@ -70,7 +70,7 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
 
 #ifdef CONFIG_PARPORT_1284
 static int do_autoprobe(ctl_table *table, int write, struct file *filp,
-			void *result, size_t *lenp)
+			void __user *result, size_t *lenp)
 {
 	struct parport_device_info *info = table->extra2;
 	const char *str;
@@ -112,7 +112,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
 #endif /* IEEE1284.3 support. */
 
 static int do_hardware_base_addr (ctl_table *table, int write,
-				  struct file *filp, void *result,
+				  struct file *filp, void __user *result,
 				  size_t *lenp)
 {
 	struct parport *port = (struct parport *)table->extra1;
@@ -140,7 +140,7 @@ static int do_hardware_base_addr (ctl_table *table, int write,
 }
 
 static int do_hardware_irq (ctl_table *table, int write,
-			    struct file *filp, void *result,
+			    struct file *filp, void __user *result,
 			    size_t *lenp)
 {
 	struct parport *port = (struct parport *)table->extra1;
@@ -168,7 +168,7 @@ static int do_hardware_irq (ctl_table *table, int write,
 }
 
 static int do_hardware_dma (ctl_table *table, int write,
-			    struct file *filp, void *result,
+			    struct file *filp, void __user *result,
 			    size_t *lenp)
 {
 	struct parport *port = (struct parport *)table->extra1;
@@ -196,7 +196,7 @@ static int do_hardware_dma (ctl_table *table, int write,
 }
 
 static int do_hardware_modes (ctl_table *table, int write,
-			      struct file *filp, void *result,
+			      struct file *filp, void __user *result,
 			      size_t *lenp)
 {
 	struct parport *port = (struct parport *)table->extra1;
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 94cb1932d..ea655dbdf 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -169,7 +169,7 @@ int parport_register_driver (struct parport_driver *drv)
 
 /**
  *	parport_unregister_driver - deregister a parallel port device driver
- *	@arg: structure describing the driver that was given to
+ *	@drv: structure describing the driver that was given to
  *	      parport_register_driver()
  *
  *	This should be called by a parallel port device driver that
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index cffa9f2ca..670c874fe 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -47,7 +47,6 @@
 #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
 
-#define SLOT_MAGIC	0x67267322
 /* name size which is used for entries in pcihpfs */
 #define SLOT_NAME_SIZE	KOBJ_NAME_LEN		/* {_SUN} */
 
@@ -59,7 +58,6 @@ struct pci_resource;
  * struct slot - slot information for each *physical* slot
  */
 struct slot {
-	u32 magic;
 	u8 number;
 	struct hotplug_slot	*hotplug_slot;
 	struct list_head	slot_list;
@@ -220,9 +218,7 @@ extern void acpiphp_glue_exit (void);
 extern int acpiphp_get_num_slots (void);
 extern struct acpiphp_slot *get_slot_from_id (int id);
 typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
-extern int acpiphp_for_each_slot (acpiphp_callback fn, void *data);
 
-extern int acpiphp_check_bridge (struct acpiphp_bridge *bridge);
 extern int acpiphp_enable_slot (struct acpiphp_slot *slot);
 extern int acpiphp_disable_slot (struct acpiphp_slot *slot);
 extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot);
@@ -241,7 +237,6 @@ extern int acpiphp_init_func_resource (struct acpiphp_func *func);
 
 /* acpiphp_res.c */
 extern struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 size);
-extern struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size);
 extern struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size);
 extern struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, u64 base, u32 size);
 extern int acpiphp_resource_sort_and_combine (struct pci_resource **head);
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 51860a03f..fb4155ad7 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -32,6 +32,7 @@
 
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -43,11 +44,7 @@
 
 static LIST_HEAD(slot_list);
 
-#if !defined(CONFIG_HOTPLUG_PCI_ACPI_MODULE)
-	#define MY_NAME	"acpiphp"
-#else
-	#define MY_NAME	THIS_MODULE->name
-#endif
+#define MY_NAME	"acpiphp"
 
 static int debug;
 int acpiphp_debug;
@@ -62,72 +59,28 @@ static int num_slots;
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
+module_param(debug, bool, 644);
 
 static int enable_slot		(struct hotplug_slot *slot);
 static int disable_slot		(struct hotplug_slot *slot);
 static int set_attention_status (struct hotplug_slot *slot, u8 value);
-static int hardware_test	(struct hotplug_slot *slot, u32 value);
 static int get_power_status	(struct hotplug_slot *slot, u8 *value);
-static int get_attention_status	(struct hotplug_slot *slot, u8 *value);
 static int get_address		(struct hotplug_slot *slot, u32 *value);
 static int get_latch_status	(struct hotplug_slot *slot, u8 *value);
 static int get_adapter_status	(struct hotplug_slot *slot, u8 *value);
-static int get_max_bus_speed	(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
-static int get_cur_bus_speed	(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
 
 static struct hotplug_slot_ops acpi_hotplug_slot_ops = {
 	.owner			= THIS_MODULE,
 	.enable_slot		= enable_slot,
 	.disable_slot		= disable_slot,
 	.set_attention_status	= set_attention_status,
-	.hardware_test		= hardware_test,
 	.get_power_status	= get_power_status,
-	.get_attention_status	= get_attention_status,
 	.get_latch_status	= get_latch_status,
 	.get_adapter_status	= get_adapter_status,
 	.get_address		= get_address,
-	.get_max_bus_speed	= get_max_bus_speed,
-	.get_cur_bus_speed	= get_cur_bus_speed,
 };
 
-
-/* Inline functions to check the sanity of a pointer that is passed to us */
-static inline int slot_paranoia_check (struct slot *slot, const char *function)
-{
-	if (!slot) {
-		dbg("%s - slot == NULL\n", function);
-		return -1;
-	}
-	if (slot->magic != SLOT_MAGIC) {
-		dbg("%s - bad magic number for slot\n", function);
-		return -1;
-	}
-	if (!slot->hotplug_slot) {
-		dbg("%s - slot->hotplug_slot == NULL!\n", function);
-		return -1;
-	}
-	return 0;
-}
-
-
-static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function)
-{
-	struct slot *slot;
-
-	if (!hotplug_slot) {
-		dbg("%s - hotplug_slot == NULL\n", function);
-		return NULL;
-	}
-
-	slot = (struct slot *)hotplug_slot->private;
-	if (slot_paranoia_check(slot, function))
-                return NULL;
-	return slot;
-}
-
-
 /**
  * enable_slot - power on and enable a slot
  * @hotplug_slot: slot to enable
@@ -135,20 +88,14 @@ static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const ch
  * Actual tasks are done in acpiphp_enable_slot()
  *
  */
-static int enable_slot (struct hotplug_slot *hotplug_slot)
+static int enable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/* enable the specified slot */
-	retval = acpiphp_enable_slot(slot->acpi_slot);
-
-	return retval;
+	return acpiphp_enable_slot(slot->acpi_slot);
 }
 
 
@@ -159,20 +106,14 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
  * Actual tasks are done in acpiphp_disable_slot()
  *
  */
-static int disable_slot (struct hotplug_slot *hotplug_slot)
+static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/* disable the specified slot */
-	retval = acpiphp_disable_slot(slot->acpi_slot);
-
-	return retval;
+	return acpiphp_disable_slot(slot->acpi_slot);
 }
 
 
@@ -184,10 +125,8 @@ static int disable_slot (struct hotplug_slot *hotplug_slot)
  * attention status LED.
  *
  */
-static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
+static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
 {
-	int retval = 0;
-
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	switch (status) {
@@ -203,33 +142,9 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 			break;
 	}
 
-	return retval;
-}
-
-
-/**
- * hardware_test - hardware test
- *
- * We have nothing to do for now...
- *
- */
-static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value)
-{
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
-
-	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
-
-	err("No hardware tests are defined for this driver\n");
-	retval = -ENODEV;
-
-	return retval;
+	return 0;
 }
 
-
 /**
  * get_power_status - get power status of a slot
  * @hotplug_slot: slot to get status
@@ -239,41 +154,17 @@ static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value)
  * In that case, the value returned may not be reliable.
  *
  */
-static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	*value = acpiphp_get_power_status(slot->acpi_slot);
 
-	return retval;
-}
-
-
-/**
- * get_attention_status - get attention LED status
- *
- * TBD:
- * ACPI doesn't provide any formal means to access attention LED status.
- *
- */
-static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
-{
-	int retval = 0;
-
-	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
-
-	*value = hotplug_slot->info->attention_status;
-
-	return retval;
+	return 0;
 }
 
-
 /**
  * get_latch_status - get latch status of a slot
  * @hotplug_slot: slot to get status
@@ -283,19 +174,15 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
  * Instead, we fake latch status from _STA
  *
  */
-static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	*value = acpiphp_get_latch_status(slot->acpi_slot);
 
-	return retval;
+	return 0;
 }
 
 
@@ -308,19 +195,15 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
  * Instead, we fake adapter status from _STA
  *
  */
-static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	*value = acpiphp_get_adapter_status(slot->acpi_slot);
 
-	return retval;
+	return 0;
 }
 
 
@@ -330,51 +213,18 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
  * @busdev: pointer to struct pci_busdev (seg, bus, dev)
  *
  */
-static int get_address (struct hotplug_slot *hotplug_slot, u32 *value)
+static int get_address(struct hotplug_slot *hotplug_slot, u32 *value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	*value = acpiphp_get_address(slot->acpi_slot);
 
-	return retval;
-}
-
-
-/* return dummy value because ACPI doesn't provide any method... */
-static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
-{
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
-
-	*value = PCI_SPEED_UNKNOWN;
-
-	return 0;
-}
-
-
-/* return dummy value because ACPI doesn't provide any method... */
-static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
-{
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
-
-	*value = PCI_SPEED_UNKNOWN;
-
 	return 0;
 }
 
-
-static int __init init_acpi (void)
+static int __init init_acpi(void)
 {
 	int retval;
 
@@ -397,7 +247,7 @@ static int __init init_acpi (void)
  * @slot: slot to name
  *
  */
-static void make_slot_name (struct slot *slot)
+static void make_slot_name(struct slot *slot)
 {
 	snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%u",
 		 slot->acpi_slot->sun);
@@ -409,10 +259,7 @@ static void make_slot_name (struct slot *slot)
  */
 static void release_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
@@ -426,42 +273,32 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
  * init_slots - initialize 'struct slot' structures for each slot
  *
  */
-static int __init init_slots (void)
+static int __init init_slots(void)
 {
 	struct slot *slot;
-	int retval = 0;
+	int retval = -ENOMEM;
 	int i;
 
 	for (i = 0; i < num_slots; ++i) {
 		slot = kmalloc(sizeof(struct slot), GFP_KERNEL);
 		if (!slot)
-			return -ENOMEM;
+			goto error;
 		memset(slot, 0, sizeof(struct slot));
 
 		slot->hotplug_slot = kmalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
-		if (!slot->hotplug_slot) {
-			kfree(slot);
-			return -ENOMEM;
-		}
+		if (!slot->hotplug_slot)
+			goto error_slot;
 		memset(slot->hotplug_slot, 0, sizeof(struct hotplug_slot));
 
 		slot->hotplug_slot->info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
-		if (!slot->hotplug_slot->info) {
-			kfree(slot->hotplug_slot);
-			kfree(slot);
-			return -ENOMEM;
-		}
+		if (!slot->hotplug_slot->info)
+			goto error_hpslot;
 		memset(slot->hotplug_slot->info, 0, sizeof(struct hotplug_slot_info));
 
 		slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);
-		if (!slot->hotplug_slot->name) {
-			kfree(slot->hotplug_slot->info);
-			kfree(slot->hotplug_slot);
-			kfree(slot);
-			return -ENOMEM;
-		}
+		if (!slot->hotplug_slot->name)
+			goto error_info;
 
-		slot->magic = SLOT_MAGIC;
 		slot->number = i;
 
 		slot->hotplug_slot->private = slot;
@@ -473,14 +310,15 @@ static int __init init_slots (void)
 		slot->hotplug_slot->info->attention_status = acpiphp_get_attention_status(slot->acpi_slot);
 		slot->hotplug_slot->info->latch_status = acpiphp_get_latch_status(slot->acpi_slot);
 		slot->hotplug_slot->info->adapter_status = acpiphp_get_adapter_status(slot->acpi_slot);
+		slot->hotplug_slot->info->max_bus_speed = PCI_SPEED_UNKNOWN;
+		slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
 
 		make_slot_name(slot);
 
 		retval = pci_hp_register(slot->hotplug_slot);
 		if (retval) {
 			err("pci_hp_register failed with error %d\n", retval);
-			release_slot(slot->hotplug_slot);
-			return retval;
+			goto error_name;
 		}
 
 		/* add slot to our internal list */
@@ -488,6 +326,16 @@ static int __init init_slots (void)
 		info("Slot [%s] registered\n", slot->hotplug_slot->name);
 	}
 
+	return 0;
+error_name:
+	kfree(slot->hotplug_slot->name);
+error_info:
+	kfree(slot->hotplug_slot->info);
+error_hpslot:
+	kfree(slot->hotplug_slot);
+error_slot:
+	kfree(slot);
+error:
 	return retval;
 }
 
@@ -503,8 +351,6 @@ static void __exit cleanup_slots (void)
 		list_del(&slot->slot_list);
 		pci_hp_deregister(slot->hotplug_slot);
 	}
-
-	return;
 }
 
 
@@ -521,11 +367,7 @@ static int __init acpiphp_init(void)
 	if (retval)
 		return retval;
 
-	retval = init_slots();
-	if (retval)
-		return retval;
-
-	return 0;
+	return init_slots();
 }
 
 
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 4f3594293..8fa346f6e 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -66,7 +66,7 @@ static void handle_hotplug_event_func (acpi_handle, u32, void *);
  *  4. ..
  *
  */
-static int is_ejectable (acpi_handle handle)
+static int is_ejectable(acpi_handle handle)
 {
 	acpi_status status;
 	acpi_handle tmp;
@@ -326,10 +326,10 @@ static void decode_hpp(struct acpiphp_bridge *bridge)
 	bridge->hpp.enable_PERR = package->package.elements[3].integer.value;
 
 	dbg("_HPP parameter = (%02x, %02x, %02x, %02x)\n",
-	    bridge->hpp.cache_line_size,
-	    bridge->hpp.latency_timer,
-	    bridge->hpp.enable_SERR,
-	    bridge->hpp.enable_PERR);
+		bridge->hpp.cache_line_size,
+		bridge->hpp.latency_timer,
+		bridge->hpp.enable_SERR,
+		bridge->hpp.enable_PERR);
 
 	bridge->flags |= BRIDGE_HAS_HPP;
 
@@ -919,6 +919,48 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
 	return (unsigned int)sta;
 }
 
+/**
+ * acpiphp_check_bridge - re-enumerate devices
+ *
+ * Iterate over all slots under this bridge and make sure that if a
+ * card is present they are enabled, and if not they are disabled.
+ */
+static int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
+{
+	struct acpiphp_slot *slot;
+	int retval = 0;
+	int enabled, disabled;
+
+	enabled = disabled = 0;
+
+	for (slot = bridge->slots; slot; slot = slot->next) {
+		unsigned int status = get_slot_status(slot);
+		if (slot->flags & SLOT_ENABLED) {
+			if (status == ACPI_STA_ALL)
+				continue;
+			retval = acpiphp_disable_slot(slot);
+			if (retval) {
+				err("Error occurred in disabling\n");
+				goto err_exit;
+			}
+			disabled++;
+		} else {
+			if (status != ACPI_STA_ALL)
+				continue;
+			retval = acpiphp_enable_slot(slot);
+			if (retval) {
+				err("Error occurred in enabling\n");
+				goto err_exit;
+			}
+			enabled++;
+		}
+	}
+
+	dbg("%s: %d enabled, %d disabled\n", __FUNCTION__, enabled, disabled);
+
+ err_exit:
+	return retval;
+}
 
 /*
  * ACPI event handlers
@@ -1113,6 +1155,8 @@ void __exit acpiphp_glue_exit(void)
 
 		kfree(bridge);
 	}
+
+	acpi_pci_unregister_driver(&acpi_pci_hp_driver);
 }
 
 
@@ -1138,13 +1182,14 @@ int __init acpiphp_get_num_slots(void)
 }
 
 
+#if 0
 /**
  * acpiphp_for_each_slot - call function for each slot
  * @fn: callback function
  * @data: context to be passed to callback function
  *
  */
-int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
+static int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
 {
 	struct list_head *node;
 	struct acpiphp_bridge *bridge;
@@ -1163,7 +1208,7 @@ int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
  err_exit:
 	return retval;
 }
-
+#endif
 
 /* search matching slot from id  */
 struct acpiphp_slot *get_slot_from_id(int id)
@@ -1180,7 +1225,8 @@ struct acpiphp_slot *get_slot_from_id(int id)
 	}
 
 	/* should never happen! */
-	err("%s: no object for id %d\n",__FUNCTION__, id);
+	err("%s: no object for id %d\n", __FUNCTION__, id);
+	WARN_ON(1);
 	return 0;
 }
 
@@ -1241,50 +1287,6 @@ int acpiphp_disable_slot(struct acpiphp_slot *slot)
 }
 
 
-/**
- * acpiphp_check_bridge - re-enumerate devices
- *
- * Iterate over all slots under this bridge and make sure that if a
- * card is present they are enabled, and if not they are disabled.
- */
-int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
-{
-	struct acpiphp_slot *slot;
-	int retval = 0;
-	int enabled, disabled;
-
-	enabled = disabled = 0;
-
-	for (slot = bridge->slots; slot; slot = slot->next) {
-		unsigned int status = get_slot_status(slot);
-		if (slot->flags & SLOT_ENABLED) {
-			if (status == ACPI_STA_ALL)
-				continue;
-			retval = acpiphp_disable_slot(slot);
-			if (retval) {
-				err("Error occurred in disabling\n");
-				goto err_exit;
-			}
-			disabled++;
-		} else {
-			if (status != ACPI_STA_ALL)
-				continue;
-			retval = acpiphp_enable_slot(slot);
-			if (retval) {
-				err("Error occurred in enabling\n");
-				goto err_exit;
-			}
-			enabled++;
-		}
-	}
-
-	dbg("%s: %d enabled, %d disabled\n", __FUNCTION__, enabled, disabled);
-
- err_exit:
-	return retval;
-}
-
-
 /*
  * slot enabled:  1
  * slot disabled: 0
diff --git a/drivers/pci/hotplug/acpiphp_res.c b/drivers/pci/hotplug/acpiphp_res.c
index 876c7bdd2..f54b1fa7b 100644
--- a/drivers/pci/hotplug/acpiphp_res.c
+++ b/drivers/pci/hotplug/acpiphp_res.c
@@ -105,7 +105,7 @@ static int sort_by_size(struct pci_resource **head)
 	return 0;
 }
 
-
+#if 0
 /*
  * sort_by_max_size - sort nodes by their length, largest first
  */
@@ -151,6 +151,7 @@ static int sort_by_max_size(struct pci_resource **head)
 
 	return 0;
 }
+#endif
 
 /**
  * get_io_resource - get resource for I/O ports
@@ -247,6 +248,7 @@ struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 si
 }
 
 
+#if 0
 /**
  * get_max_resource - get the largest resource
  *
@@ -254,7 +256,7 @@ struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 si
  * list pointed to by head.  It aligns the node on top and bottom
  * to "size" alignment before returning it.
  */
-struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size)
 {
 	struct pci_resource *max;
 	struct pci_resource *temp;
@@ -340,7 +342,7 @@ struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 s
 	/* If we get here, we couldn't find one */
 	return NULL;
 }
-
+#endif
 
 /**
  * get_resource - get resource (mem, pfmem)
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
index 7e060c6d9..3ddd75937 100644
--- a/drivers/pci/hotplug/cpci_hotplug.h
+++ b/drivers/pci/hotplug/cpci_hotplug.h
@@ -40,9 +40,7 @@
 #define HS_CSR_EIM	0x0002
 #define HS_CSR_DHA	0x0001
 
-#define SLOT_MAGIC	0x67267322
 struct slot {
-	u32 magic;
 	u8 number;
 	unsigned int devfn;
 	struct pci_bus *bus;
@@ -86,7 +84,6 @@ extern u8 cpci_get_attention_status(struct slot *slot);
 extern u8 cpci_get_latch_status(struct slot *slot);
 extern u8 cpci_get_adapter_status(struct slot *slot);
 extern u16 cpci_get_hs_csr(struct slot * slot);
-extern u16 cpci_set_hs_csr(struct slot * slot, u16 hs_csr);
 extern int cpci_set_attention_status(struct slot *slot, int status);
 extern int cpci_check_and_clear_ins(struct slot * slot);
 extern int cpci_check_ext(struct slot * slot);
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 4f9405b2c..5b33e965f 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -40,11 +40,7 @@
 #define DRIVER_AUTHOR	"Scott Murray <scottm@somanetworks.com>"
 #define DRIVER_DESC	"CompactPCI Hot Plug Core"
 
-#if !defined(CONFIG_HOTPLUG_CPCI_MODULE)
 #define MY_NAME	"cpci_hotplug"
-#else
-#define MY_NAME	THIS_MODULE->name
-#endif
 
 #define dbg(format, arg...)					\
 	do {							\
@@ -71,63 +67,21 @@ static int disable_slot(struct hotplug_slot *slot);
 static int set_attention_status(struct hotplug_slot *slot, u8 value);
 static int get_power_status(struct hotplug_slot *slot, u8 * value);
 static int get_attention_status(struct hotplug_slot *slot, u8 * value);
-static int get_latch_status(struct hotplug_slot *slot, u8 * value);
-static int get_adapter_status(struct hotplug_slot *slot, u8 * value);
 
 static struct hotplug_slot_ops cpci_hotplug_slot_ops = {
 	.owner = THIS_MODULE,
 	.enable_slot = enable_slot,
 	.disable_slot = disable_slot,
 	.set_attention_status = set_attention_status,
-	.hardware_test = NULL,
 	.get_power_status = get_power_status,
 	.get_attention_status = get_attention_status,
-	.get_latch_status = get_latch_status,
-	.get_adapter_status = get_adapter_status,
 };
 
-/* Inline functions to check the sanity of a pointer that is passed to us */
-static inline int
-slot_paranoia_check(struct slot *slot, const char *function)
-{
-	if(!slot) {
-		dbg("%s - slot == NULL", function);
-		return -1;
-	}
-	if(slot->magic != SLOT_MAGIC) {
-		dbg("%s - bad magic number for slot", function);
-		return -1;
-	}
-	if(!slot->hotplug_slot) {
-		dbg("%s - slot->hotplug_slot == NULL!", function);
-		return -1;
-	}
-	return 0;
-}
-
-static inline struct slot *
-get_slot(struct hotplug_slot *hotplug_slot, const char *function)
-{
-	struct slot *slot;
-
-	if(!hotplug_slot) {
-		dbg("%s - hotplug_slot == NULL", function);
-		return NULL;
-	}
-
-	slot = (struct slot *) hotplug_slot->private;
-	if(slot_paranoia_check(slot, function))
-		return NULL;
-	return slot;
-}
-
 static int
 update_latch_status(struct hotplug_slot *hotplug_slot, u8 value)
 {
 	struct hotplug_slot_info info;
 
-	if(!(hotplug_slot && hotplug_slot->info))
-		return -EINVAL;
 	memcpy(&info, hotplug_slot->info, sizeof(struct hotplug_slot_info));
 	info.latch_status = value;
 	return pci_hp_change_slot_info(hotplug_slot, &info);
@@ -138,8 +92,6 @@ update_adapter_status(struct hotplug_slot *hotplug_slot, u8 value)
 {
 	struct hotplug_slot_info info;
 
-	if(!(hotplug_slot && hotplug_slot->info))
-		return -EINVAL;
 	memcpy(&info, hotplug_slot->info, sizeof(struct hotplug_slot_info));
 	info.adapter_status = value;
 	return pci_hp_change_slot_info(hotplug_slot, &info);
@@ -148,12 +100,9 @@ update_adapter_status(struct hotplug_slot *hotplug_slot, u8 value)
 static int
 enable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
 
-	if(slot == NULL)
-		return -ENODEV;
-
 	dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
 
 	if(controller->ops->set_power) {
@@ -166,12 +115,9 @@ enable_slot(struct hotplug_slot *hotplug_slot)
 static int
 disable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
 
-	if(slot == NULL)
-		return -ENODEV;
-
 	dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
 
 	/* Unconfigure device */
@@ -220,10 +166,8 @@ cpci_get_power_status(struct slot *slot)
 static int
 get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 
-	if(slot == NULL)
-		return -ENODEV;
 	*value = cpci_get_power_status(slot);
 	return 0;
 }
@@ -231,10 +175,8 @@ get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
 static int
 get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 
-	if(slot == NULL)
-		return -ENODEV;
 	*value = cpci_get_attention_status(slot);
 	return 0;
 }
@@ -242,48 +184,12 @@ get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
 static int
 set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if(slot == NULL)
-		return -ENODEV;
-	switch (status) {
-	case 0:
-		cpci_set_attention_status(slot, 0);
-		break;
-
-	case 1:
-	default:
-		cpci_set_attention_status(slot, 1);
-		break;
-	}
-
-	return 0;
-}
-
-static int
-get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value)
-{
-	if(hotplug_slot == NULL || hotplug_slot->info == NULL)
-		return -ENODEV;
-	*value = hotplug_slot->info->latch_status;
-	return 0;
-}
-
-static int
-get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value)
-{
-	if(hotplug_slot == NULL || hotplug_slot->info == NULL)
-		return -ENODEV;
-	*value = hotplug_slot->info->adapter_status;
-	return 0;
+	return cpci_set_attention_status(hotplug_slot->private, status);
 }
 
 static void release_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if(slot == NULL)
-		return;
+	struct slot *slot = hotplug_slot->private;
 
 	kfree(slot->hotplug_slot->info);
 	kfree(slot->hotplug_slot->name);
@@ -306,15 +212,12 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
 	struct hotplug_slot *hotplug_slot;
 	struct hotplug_slot_info *info;
 	char *name;
-	int status = 0;
+	int status = -ENOMEM;
 	int i;
 
 	if(!(controller && bus)) {
 		return -ENODEV;
 	}
-	if(last < first) {
-		return -EINVAL;
-	}
 
 	/*
 	 * Create a structure for each slot, and register that slot
@@ -322,38 +225,28 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
 	 */
 	for (i = first; i <= last; ++i) {
 		slot = kmalloc(sizeof (struct slot), GFP_KERNEL);
-		if(!slot)
-			return -ENOMEM;
+		if (!slot)
+			goto error;
 		memset(slot, 0, sizeof (struct slot));
 
 		hotplug_slot =
 		    kmalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
-		if(!hotplug_slot) {
-			kfree(slot);
-			return -ENOMEM;
-		}
+		if (!hotplug_slot)
+			goto error_slot;
 		memset(hotplug_slot, 0, sizeof (struct hotplug_slot));
 		slot->hotplug_slot = hotplug_slot;
 
 		info = kmalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL);
-		if(!info) {
-			kfree(hotplug_slot);
-			kfree(slot);
-			return -ENOMEM;
-		}
+		if (!info)
+			goto error_hpslot;
 		memset(info, 0, sizeof (struct hotplug_slot_info));
 		hotplug_slot->info = info;
 
 		name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);
-		if(!name) {
-			kfree(info);
-			kfree(hotplug_slot);
-			kfree(slot);
-			return -ENOMEM;
-		}
+		if (!name)
+			goto error_info;
 		hotplug_slot->name = name;
 
-		slot->magic = SLOT_MAGIC;
 		slot->bus = bus;
 		slot->number = i;
 		slot->devfn = PCI_DEVFN(i, 0);
@@ -373,13 +266,9 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
 
 		dbg("registering slot %s", slot->hotplug_slot->name);
 		status = pci_hp_register(slot->hotplug_slot);
-		if(status) {
+		if (status) {
 			err("pci_hp_register failed with error %d", status);
-			kfree(info);
-			kfree(name);
-			kfree(hotplug_slot);
-			kfree(slot);
-			return status;
+			goto error_name;
 		}
 
 		/* Add slot to our internal list */
@@ -388,6 +277,16 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
 		slots++;
 		spin_unlock(&list_lock);
 	}
+	return 0;
+error_name:
+	kfree(name);
+error_info:
+	kfree(info);
+error_hpslot:
+	kfree(hotplug_slot);
+error_slot:
+	kfree(slot);
+error:
 	return status;
 }
 
@@ -399,10 +298,6 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
 	struct list_head *next;
 	int status;
 
-	if(!bus) {
-		return -ENODEV;
-	}
-
 	spin_lock(&list_lock);
 	if(!slots) {
 		spin_unlock(&list_lock);
@@ -428,7 +323,7 @@ cpci_hp_unregister_bus(struct pci_bus *bus)
 }
 
 /* This is the interrupt mode interrupt handler */
-irqreturn_t
+static irqreturn_t
 cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
 {
 	dbg("entered cpci_hp_intr");
@@ -891,7 +786,6 @@ cpci_hotplug_exit(void)
 	cleanup_slots();
 }
 
-
 EXPORT_SYMBOL_GPL(cpci_hp_register_controller);
 EXPORT_SYMBOL_GPL(cpci_hp_unregister_controller);
 EXPORT_SYMBOL_GPL(cpci_hp_register_bus);
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 3aead25d7..6942f7149 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -127,6 +127,7 @@ u16 cpci_get_hs_csr(struct slot* slot)
 	return hs_csr;
 }
 
+#if 0
 u16 cpci_set_hs_csr(struct slot* slot, u16 hs_csr)
 {
 	int hs_cap;
@@ -156,6 +157,7 @@ u16 cpci_set_hs_csr(struct slot* slot, u16 hs_csr)
 	}
 	return new_hs_csr;
 }
+#endif
 
 int cpci_check_and_clear_ins(struct slot* slot)
 {
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
index aaabd4127..141941ae3 100644
--- a/drivers/pci/hotplug/cpcihp_generic.c
+++ b/drivers/pci/hotplug/cpcihp_generic.c
@@ -76,73 +76,6 @@ static u8 enum_mask;
 static struct cpci_hp_controller_ops generic_hpc_ops;
 static struct cpci_hp_controller generic_hpc;
 
-/* The following allows configuring the driver when it's compiled into the kernel */
-#ifndef MODULE
-static int __init cpcihp_generic_setup(char* str)
-{
-	char* p;
-	unsigned long tmp;
-
-	if(!str)
-		return -EINVAL;
-	bridge = str;
-
-	p = strchr(str, ',');
-	str = p + 1;
-	if(!(p && *str && *p == ','))
-		goto setup_error;
-	tmp = simple_strtoul(str, &p, 0);
-	if(p == str || tmp > 0xff) {
-		err("hotplug bus first slot number out of range");
-		goto setup_error;
-	}
-	first_slot = (u8) tmp;
-
-	str = p + 1;		
-	if(!(*str && *p == ','))
-		return -EINVAL;
-	tmp = simple_strtoul(str, &p, 0);
-	if(p == str || tmp > 0xff) {
-		err("hotplug bus last slot number out of range");
-		goto setup_error;
-	}
-	last_slot = (u8) tmp;
-
-	str = p + 1;
-	if(!(*str && *p == ','))
-		goto setup_error;
-	tmp = simple_strtoul(str, &p, 0);
-	if(p == str || tmp > 0xffff) {
-		err("port number out of range");
-		goto setup_error;
-	}
-	port = (u16) tmp;
-
-	str = p + 1;
-	if(!(*str && *p == ','))
-		goto setup_error;
-	tmp = simple_strtoul(str, &p, 0);
-	if(p == str) {
-		err("invalid #ENUM bit number");
-		goto setup_error;
-	}
-	enum_bit = (u8) tmp;
-
-	str = p + 1;
-	if(*str && *p == ',') {
-		tmp = simple_strtoul(str, &p, 0);
-		if(p != str)
-			debug = (int) tmp;
-	}
-	return 0;
-setup_error:
-	bridge = NULL;
-	return -EINVAL;
-}
-
-__setup("cpcihp_generic=", cpcihp_generic_setup);
-#endif
-
 static int __init validate_parameters(void)
 {
 	char* str;
diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c
index 2d7a988ad..cb54fa8ab 100644
--- a/drivers/pci/hotplug/cpcihp_zt5550.c
+++ b/drivers/pci/hotplug/cpcihp_zt5550.c
@@ -32,6 +32,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
@@ -42,11 +43,7 @@
 #define DRIVER_AUTHOR	"Scott Murray <scottm@somanetworks.com>"
 #define DRIVER_DESC	"ZT5550 CompactPCI Hot Plug Driver"
 
-#if !defined(CONFIG_HOTPLUG_PCI_CPCI_ZT5550_MODULE)
 #define MY_NAME	"cpcihp_zt5550"
-#else
-#define MY_NAME	THIS_MODULE->name
-#endif
 
 #define dbg(format, arg...)					\
 	do {							\
@@ -175,7 +172,7 @@ static int zt5550_hc_enable_irq(void)
 	return 0;
 }
 
-int zt5550_hc_disable_irq(void)
+static int zt5550_hc_disable_irq(void)
 {
 	u8 reg;
 
@@ -301,7 +298,7 @@ module_exit(zt5550_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
+module_param(debug, bool, 644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
-MODULE_PARM(poll, "i");
+module_param(poll, bool, 644);
 MODULE_PARM_DESC(poll, "#ENUM polling mode enabled or not");
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h
index 444d21090..4da5bac0f 100644
--- a/drivers/pci/hotplug/cpqphp.h
+++ b/drivers/pci/hotplug/cpqphp.h
@@ -33,11 +33,7 @@
 #include <asm/io.h>		/* for read? and write? functions */
 #include <linux/delay.h>	/* for delays */
 
-#if !defined(CONFIG_HOTPLUG_PCI_COMPAQ_MODULE)
-	#define MY_NAME	"cpqphp.o"
-#else
-	#define MY_NAME	THIS_MODULE->name
-#endif
+#define MY_NAME	"cpqphp"
 
 #define dbg(fmt, arg...) do { if (cpqhp_debug) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
@@ -257,9 +253,7 @@ struct pci_func {
 	struct pci_dev* pci_dev;
 };
 
-#define SLOT_MAGIC	0x67267321
 struct slot {
-	u32 magic;
 	struct slot *next;
 	u8 bus;
 	u8 device;
@@ -377,11 +371,8 @@ struct resource_lists {
 #define PCISLOT_66_MHZ_SUPPORTED	0x00000100
 #define PCISLOT_64_BIT_SUPPORTED	0x00000200
 
-
-
 #define PCI_TO_PCI_BRIDGE_CLASS		0x00060400
 
-
 #define INTERLOCK_OPEN			0x00000002
 #define ADD_NOT_SUPPORTED		0x00000003
 #define CARD_FUNCTIONING		0x00000005
@@ -440,7 +431,6 @@ extern int	cpqhp_return_board_resources	(struct pci_func * func, struct resource
 extern void	cpqhp_destroy_resource_list	(struct resource_lists * resources);
 extern int	cpqhp_configure_device		(struct controller* ctrl, struct pci_func* func);
 extern int	cpqhp_unconfigure_device	(struct pci_func* func);
-extern struct slot *cpqhp_find_slot		(struct controller *ctrl, u8 device);
 
 /* Global variables */
 extern int cpqhp_debug;
@@ -453,50 +443,15 @@ extern u8 cpqhp_nic_irq;
 extern u8 cpqhp_disk_irq;
 
 
-
 /* inline functions */
 
-
-/* Inline functions to check the sanity of a pointer that is passed to us */
-static inline int slot_paranoia_check (struct slot *slot, const char *function)
-{
-	if (!slot) {
-		dbg("%s - slot == NULL", function);
-		return -1;
-	}
-	if (slot->magic != SLOT_MAGIC) {
-		dbg("%s - bad magic number for slot", function);
-		return -1;
-	}
-	if (!slot->hotplug_slot) {
-		dbg("%s - slot->hotplug_slot == NULL!", function);
-		return -1;
-	}
-	return 0;
-}
-
-static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function)
-{ 
-	struct slot *slot;
-
-	if (!hotplug_slot) {
-		dbg("%s - hotplug_slot == NULL\n", function);
-		return NULL;
-	}
-
-	slot = (struct slot *)hotplug_slot->private;
-	if (slot_paranoia_check (slot, function))
-                return NULL;
-	return slot;
-}               
-
 /*
  * return_resource
  *
  * Puts node back in the resource list pointed to by head
  *
  */
-static inline void return_resource (struct pci_resource **head, struct pci_resource *node)
+static inline void return_resource(struct pci_resource **head, struct pci_resource *node)
 {
 	if (!node || !head)
 		return;
@@ -504,7 +459,7 @@ static inline void return_resource (struct pci_resource **head, struct pci_resou
 	*head = node;
 }
 
-static inline void set_SOGO (struct controller *ctrl)
+static inline void set_SOGO(struct controller *ctrl)
 {
 	u16 misc;
 	
@@ -514,7 +469,7 @@ static inline void set_SOGO (struct controller *ctrl)
 }
 
 
-static inline void amber_LED_on (struct controller *ctrl, u8 slot)
+static inline void amber_LED_on(struct controller *ctrl, u8 slot)
 {
 	u32 led_control;
 	
@@ -524,7 +479,7 @@ static inline void amber_LED_on (struct controller *ctrl, u8 slot)
 }
 
 
-static inline void amber_LED_off (struct controller *ctrl, u8 slot)
+static inline void amber_LED_off(struct controller *ctrl, u8 slot)
 {
 	u32 led_control;
 	
@@ -534,7 +489,7 @@ static inline void amber_LED_off (struct controller *ctrl, u8 slot)
 }
 
 
-static inline int read_amber_LED (struct controller *ctrl, u8 slot)
+static inline int read_amber_LED(struct controller *ctrl, u8 slot)
 {
 	u32 led_control;
 
@@ -545,7 +500,7 @@ static inline int read_amber_LED (struct controller *ctrl, u8 slot)
 }
 
 
-static inline void green_LED_on (struct controller *ctrl, u8 slot)
+static inline void green_LED_on(struct controller *ctrl, u8 slot)
 {
 	u32 led_control;
 	
@@ -554,7 +509,7 @@ static inline void green_LED_on (struct controller *ctrl, u8 slot)
 	writel(led_control, ctrl->hpc_reg + LED_CONTROL);
 }
 
-static inline void green_LED_off (struct controller *ctrl, u8 slot)
+static inline void green_LED_off(struct controller *ctrl, u8 slot)
 {
 	u32 led_control;
 	
@@ -564,7 +519,7 @@ static inline void green_LED_off (struct controller *ctrl, u8 slot)
 }
 
 
-static inline void green_LED_blink (struct controller *ctrl, u8 slot)
+static inline void green_LED_blink(struct controller *ctrl, u8 slot)
 {
 	u32 led_control;
 	
@@ -575,7 +530,7 @@ static inline void green_LED_blink (struct controller *ctrl, u8 slot)
 }
 
 
-static inline void slot_disable (struct controller *ctrl, u8 slot)
+static inline void slot_disable(struct controller *ctrl, u8 slot)
 {
 	u8 slot_enable;
 
@@ -585,7 +540,7 @@ static inline void slot_disable (struct controller *ctrl, u8 slot)
 }
 
 
-static inline void slot_enable (struct controller *ctrl, u8 slot)
+static inline void slot_enable(struct controller *ctrl, u8 slot)
 {
 	u8 slot_enable;
 
@@ -595,7 +550,7 @@ static inline void slot_enable (struct controller *ctrl, u8 slot)
 }
 
 
-static inline u8 is_slot_enabled (struct controller *ctrl, u8 slot)
+static inline u8 is_slot_enabled(struct controller *ctrl, u8 slot)
 {
 	u8 slot_enable;
 
@@ -605,7 +560,7 @@ static inline u8 is_slot_enabled (struct controller *ctrl, u8 slot)
 }
 
 
-static inline u8 read_slot_enable (struct controller *ctrl)
+static inline u8 read_slot_enable(struct controller *ctrl)
 {
 	return readb(ctrl->hpc_reg + SLOT_ENABLE);
 }
@@ -619,7 +574,7 @@ static inline u8 read_slot_enable (struct controller *ctrl)
  * Returns controller speed.
  *
  */
-static inline u8 get_controller_speed (struct controller *ctrl)
+static inline u8 get_controller_speed(struct controller *ctrl)
 {
 	u8 curr_freq;
  	u16 misc;
@@ -652,7 +607,7 @@ static inline u8 get_controller_speed (struct controller *ctrl)
  * Returns adapter speed.
  *
  */
-static inline u8 get_adapter_speed (struct controller *ctrl, u8 hp_slot)
+static inline u8 get_adapter_speed(struct controller *ctrl, u8 hp_slot)
 {
 	u32 temp_dword = readl(ctrl->hpc_reg + NON_INT_INPUT);
 	dbg("slot: %d, PCIXCAP: %8x\n", hp_slot, temp_dword);
@@ -669,7 +624,7 @@ static inline u8 get_adapter_speed (struct controller *ctrl, u8 hp_slot)
 	return PCI_SPEED_33MHz;
 }
 
-static inline void enable_slot_power (struct controller *ctrl, u8 slot)
+static inline void enable_slot_power(struct controller *ctrl, u8 slot)
 {
 	u8 slot_power;
 
@@ -678,7 +633,7 @@ static inline void enable_slot_power (struct controller *ctrl, u8 slot)
 	writeb(slot_power, ctrl->hpc_reg + SLOT_POWER);
 }
 
-static inline void disable_slot_power (struct controller *ctrl, u8 slot)
+static inline void disable_slot_power(struct controller *ctrl, u8 slot)
 {
 	u8 slot_power;
 
@@ -688,40 +643,31 @@ static inline void disable_slot_power (struct controller *ctrl, u8 slot)
 }
 
 
-static inline int cpq_get_attention_status (struct controller *ctrl, struct slot *slot)
+static inline int cpq_get_attention_status(struct controller *ctrl, struct slot *slot)
 {
 	u8 hp_slot;
 
-	if (slot == NULL)
-		return 1;
-
 	hp_slot = slot->device - ctrl->slot_device_offset;
 
-	return read_amber_LED (ctrl, hp_slot);
+	return read_amber_LED(ctrl, hp_slot);
 }
 
 
-static inline int get_slot_enabled (struct controller *ctrl, struct slot *slot)
+static inline int get_slot_enabled(struct controller *ctrl, struct slot *slot)
 {
 	u8 hp_slot;
 
-	if (slot == NULL)
-		return 1;
-
 	hp_slot = slot->device - ctrl->slot_device_offset;
 
-	return is_slot_enabled (ctrl, hp_slot);
+	return is_slot_enabled(ctrl, hp_slot);
 }
 
 
-static inline int cpq_get_latch_status (struct controller *ctrl, struct slot *slot)
+static inline int cpq_get_latch_status(struct controller *ctrl, struct slot *slot)
 {
 	u32 status;
 	u8 hp_slot;
 
-	if (slot == NULL)
-		return 1;
-
 	hp_slot = slot->device - ctrl->slot_device_offset;
 	dbg("%s: slot->device = %d, ctrl->slot_device_offset = %d \n",
 	    __FUNCTION__, slot->device, ctrl->slot_device_offset);
@@ -732,15 +678,12 @@ static inline int cpq_get_latch_status (struct controller *ctrl, struct slot *sl
 }
 
 
-static inline int get_presence_status (struct controller *ctrl, struct slot *slot)
+static inline int get_presence_status(struct controller *ctrl, struct slot *slot)
 {
 	int presence_save = 0;
 	u8 hp_slot;
 	u32 tempdword;
 
-	if (slot == NULL)
-		return 0;
-
 	hp_slot = slot->device - ctrl->slot_device_offset;
 
 	tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR);
@@ -751,13 +694,13 @@ static inline int get_presence_status (struct controller *ctrl, struct slot *slo
 
 #define SLOT_NAME_SIZE 10
 
-static inline void make_slot_name (char *buffer, int buffer_size, struct slot *slot)
+static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot)
 {
-	snprintf (buffer, buffer_size, "%d", slot->number);
+	snprintf(buffer, buffer_size, "%d", slot->number);
 }
 
 
-static inline int wait_for_ctrl_irq (struct controller *ctrl)
+static inline int wait_for_ctrl_irq(struct controller *ctrl)
 {
         DECLARE_WAITQUEUE(wait, current);
 	int retval = 0;
@@ -775,138 +718,5 @@ static inline int wait_for_ctrl_irq (struct controller *ctrl)
 	return retval;
 }
 
-
-/**
- * set_controller_speed - set the frequency and/or mode of a specific
- * controller segment.
- *
- * @ctrl: controller to change frequency/mode for.
- * @adapter_speed: the speed of the adapter we want to match.
- * @hp_slot: the slot number where the adapter is installed.
- *
- * Returns 0 if we successfully change frequency and/or mode to match the
- * adapter speed.
- * 
- */
-static inline u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot)
-{
-	struct slot *slot;
-	u8 reg;
-	u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER);
-	u16 reg16;
-	u32 leds = readl(ctrl->hpc_reg + LED_CONTROL);
-	
-	if (ctrl->speed == adapter_speed)
-		return 0;
-	
-	/* We don't allow freq/mode changes if we find another adapter running
-	 * in another slot on this controller */
-	for(slot = ctrl->slot; slot; slot = slot->next) {
-		if (slot->device == (hp_slot + ctrl->slot_device_offset)) 
-			continue;
-		if (!slot->hotplug_slot && !slot->hotplug_slot->info) 
-			continue;
-		if (slot->hotplug_slot->info->adapter_status == 0) 
-			continue;
-		/* If another adapter is running on the same segment but at a
-		 * lower speed/mode, we allow the new adapter to function at
-		 * this rate if supported */
-		if (ctrl->speed < adapter_speed) 
-			return 0;
-
-		return 1;
-	}
-	
-	/* If the controller doesn't support freq/mode changes and the
-	 * controller is running at a higher mode, we bail */
-	if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability))
-		return 1;
-	
-	/* But we allow the adapter to run at a lower rate if possible */
-	if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability))
-		return 0;
-
-	/* We try to set the max speed supported by both the adapter and
-	 * controller */
-	if (ctrl->speed_capability < adapter_speed) {
-		if (ctrl->speed == ctrl->speed_capability)
-			return 0;
-		adapter_speed = ctrl->speed_capability;
-	}
-
-	writel(0x0L, ctrl->hpc_reg + LED_CONTROL);
-	writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE);
-	
-	set_SOGO(ctrl); 
-	wait_for_ctrl_irq(ctrl);
-	
-	if (adapter_speed != PCI_SPEED_133MHz_PCIX)
-		reg = 0xF5;
-	else
-		reg = 0xF4;	
-	pci_write_config_byte(ctrl->pci_dev, 0x41, reg);
-	
-	reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ);
-	reg16 &= ~0x000F;
-	switch(adapter_speed) {
-		case(PCI_SPEED_133MHz_PCIX): 
-			reg = 0x75;
-			reg16 |= 0xB; 
-			break;
-		case(PCI_SPEED_100MHz_PCIX):
-			reg = 0x74;
-			reg16 |= 0xA;
-			break;
-		case(PCI_SPEED_66MHz_PCIX):
-			reg = 0x73;
-			reg16 |= 0x9;
-			break;
-		case(PCI_SPEED_66MHz):
-			reg = 0x73;
-			reg16 |= 0x1;
-			break;
-		default: /* 33MHz PCI 2.2 */
-			reg = 0x71;
-			break;
-			
-	}
-	reg16 |= 0xB << 12;
-	writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ);
-	
-	mdelay(5); 
-	
-	/* Reenable interrupts */
-	writel(0, ctrl->hpc_reg + INT_MASK);
-
-	pci_write_config_byte(ctrl->pci_dev, 0x41, reg); 
-	
-	/* Restart state machine */
-	reg = ~0xF;
-	pci_read_config_byte(ctrl->pci_dev, 0x43, &reg);
-	pci_write_config_byte(ctrl->pci_dev, 0x43, reg);
-	
-	/* Only if mode change...*/
-	if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) ||
-		((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) 
-			set_SOGO(ctrl);
-	
-	wait_for_ctrl_irq(ctrl);
-	mdelay(1100);
-	
-	/* Restore LED/Slot state */
-	writel(leds, ctrl->hpc_reg + LED_CONTROL);
-	writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE);
-	
-	set_SOGO(ctrl);
-	wait_for_ctrl_irq(ctrl);
-
-	ctrl->speed = adapter_speed;
-	slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
-
-	info("Successfully changed frequency/mode for adapter in slot %d\n", 
-			slot->number);
-	return 0;
-}
-
 #endif
 
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 9f5656bf2..aa8a1a4d7 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -2,7 +2,7 @@
  * Compaq Hot Plug Controller Driver
  *
  * Copyright (C) 1995,2001 Compaq Computer Corporation
- * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com>
  * Copyright (C) 2001 IBM Corp.
  *
  * All rights reserved.
@@ -31,6 +31,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/proc_fs.h>
@@ -57,10 +58,10 @@ struct pci_func *cpqhp_slot_list[256];
 static void *smbios_table;
 static void *smbios_start;
 static void *cpqhp_rom_start;
-static u8 power_mode;
+static int power_mode;
 static int debug;
 
-#define DRIVER_VERSION	"0.9.7"
+#define DRIVER_VERSION	"0.9.8"
 #define DRIVER_AUTHOR	"Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>"
 #define DRIVER_DESC	"Compaq Hot Plug PCI Controller Driver"
 
@@ -68,16 +69,16 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(power_mode, "b");
+module_param(power_mode, bool, 644);
 MODULE_PARM_DESC(power_mode, "Power mode enabled or not");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, 644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 #define CPQHPC_MODULE_MINOR 208
 
-static int one_time_init (void);
-static int set_attention_status (struct hotplug_slot *slot, u8 value);
+static int one_time_init	(void);
+static int set_attention_status	(struct hotplug_slot *slot, u8 value);
 static int process_SI		(struct hotplug_slot *slot);
 static int process_SS		(struct hotplug_slot *slot);
 static int hardware_test	(struct hotplug_slot *slot, u32 value);
@@ -103,30 +104,18 @@ static struct hotplug_slot_ops cpqphp_hotplug_slot_ops = {
 };
 
 
-static inline int is_slot64bit (struct slot *slot)
+static inline int is_slot64bit(struct slot *slot)
 {
-	if (!slot || !slot->p_sm_slot)
-		return 0;
-
-	if (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06)
-		return 1;
-
-	return 0;
+	return (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06) ? 1 : 0;
 }
 
-static inline int is_slot66mhz (struct slot *slot)
+static inline int is_slot66mhz(struct slot *slot)
 {
-	if (!slot || !slot->p_sm_slot)
-		return 0;
-
-	if (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E)
-		return 1;
-
-	return 0;
+	return (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E) ? 1 : 0;
 }
 
 /**
- * detect_SMBIOS_pointer - find the system Management BIOS Table in the specified region of memory.
+ * detect_SMBIOS_pointer - find the System Management BIOS Table in mem region.
  *
  * @begin: begin pointer for region to be scanned.
  * @end: end pointer for region to be scanned.
@@ -210,7 +199,8 @@ static int pci_print_IRQ_route (void)
 		return -ENOMEM;
 	}
 
-	len = (routing_table->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info);
+	len = (routing_table->size - sizeof(struct irq_routing_table)) /
+			sizeof(struct irq_info);
 	// Make sure I got at least one entry
 	if (len == 0) {
 		kfree(routing_table);
@@ -231,8 +221,8 @@ static int pci_print_IRQ_route (void)
 }
 
 
-/*
- * get_subsequent_smbios_entry
+/**
+ * get_subsequent_smbios_entry: get the next entry from bios table.
  *
  * Gets the first entry if previous == NULL
  * Otherwise, returns the next entry
@@ -242,7 +232,8 @@ static int pci_print_IRQ_route (void)
  *
  * returns a pointer to an SMBIOS structure or NULL if none found
  */
-static void * get_subsequent_smbios_entry(void *smbios_start, void *smbios_table, void *curr)
+static void *get_subsequent_smbios_entry(void *smbios_start,
+			void *smbios_table, void *curr)
 {
 	u8 bail = 0;
 	u8 previous_byte = 1;
@@ -259,8 +250,9 @@ static void * get_subsequent_smbios_entry(void *smbios_start, void *smbios_table
 	p_temp += readb(curr + SMBIOS_GENERIC_LENGTH);
 
 	while ((p_temp < p_max) && !bail) {
-		// Look for the double NULL terminator
-		// The first condition is the previous byte and the second is the curr
+		/* Look for the double NULL terminator
+		 * The first condition is the previous byte
+		 * and the second is the curr */
 		if (!previous_byte && !(readb(p_temp))) {
 			bail = 1;
 		}
@@ -290,7 +282,8 @@ static void * get_subsequent_smbios_entry(void *smbios_start, void *smbios_table
  *
  * returns a pointer to an SMBIOS structure or %NULL if none found
  */
-static void *get_SMBIOS_entry (void *smbios_start, void *smbios_table, u8 type, void * previous)
+static void *get_SMBIOS_entry(void *smbios_start, void *smbios_table, u8 type,
+			void * previous)
 {
 	if (!smbios_table)
 		return NULL;
@@ -298,12 +291,14 @@ static void *get_SMBIOS_entry (void *smbios_start, void *smbios_table, u8 type,
 	if (!previous) {		  
 		previous = smbios_start;
 	} else {
-		previous = get_subsequent_smbios_entry(smbios_start, smbios_table, previous);
+		previous = get_subsequent_smbios_entry(smbios_start,
+					smbios_table, previous);
 	}
 
 	while (previous) {
 	       	if (readb(previous + SMBIOS_GENERIC_TYPE) != type) {
-			previous = get_subsequent_smbios_entry(smbios_start, smbios_table, previous);
+			previous = get_subsequent_smbios_entry(smbios_start,
+						smbios_table, previous);
 		} else {
 			break;
 		}
@@ -314,11 +309,8 @@ static void *get_SMBIOS_entry (void *smbios_start, void *smbios_table, u8 type,
 
 static void release_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	
-	if (slot == NULL)
-		return;
-	
+	struct slot *slot = hotplug_slot->private;
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	kfree(slot->hotplug_slot->info);
@@ -327,7 +319,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
 	kfree(slot);
 }
 
-static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *smbios_table)
+static int ctrl_slot_setup(struct controller * ctrl, void *smbios_start,
+			void *smbios_table)
 {
 	struct slot *new_slot;
 	u8 number_of_slots;
@@ -336,7 +329,7 @@ static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *
 	u8 ctrl_slot;
 	u32 tempdword;
 	void *slot_entry= NULL;
-	int result;
+	int result = -ENOMEM;
 
 	dbg("%s\n", __FUNCTION__);
 
@@ -347,44 +340,40 @@ static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *
 	slot_number = ctrl->first_slot;
 
 	while (number_of_slots) {
-		new_slot = (struct slot *) kmalloc(sizeof(struct slot), GFP_KERNEL);
+		new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL);
 		if (!new_slot)
-			return -ENOMEM;
+			goto error;
 
 		memset(new_slot, 0, sizeof(struct slot));
-		new_slot->hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL);
-		if (!new_slot->hotplug_slot) {
-			kfree (new_slot);
-			return -ENOMEM;
-		}
-		memset(new_slot->hotplug_slot, 0, sizeof (struct hotplug_slot));
-
-		new_slot->hotplug_slot->info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
-		if (!new_slot->hotplug_slot->info) {
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
-		memset(new_slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info));
-		new_slot->hotplug_slot->name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL);
-		if (!new_slot->hotplug_slot->name) {
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
+		new_slot->hotplug_slot = kmalloc(sizeof(*(new_slot->hotplug_slot)),
+						GFP_KERNEL);
+		if (!new_slot->hotplug_slot)
+			goto error_slot;
+		memset(new_slot->hotplug_slot, 0, sizeof(struct hotplug_slot));
+
+		new_slot->hotplug_slot->info =
+				kmalloc(sizeof(*(new_slot->hotplug_slot->info)),
+							GFP_KERNEL);
+		if (!new_slot->hotplug_slot->info)
+			goto error_hpslot;
+		memset(new_slot->hotplug_slot->info, 0,
+				sizeof(struct hotplug_slot_info));
+		new_slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);
+		if (!new_slot->hotplug_slot->name)
+			goto error_info;
 
-		new_slot->magic = SLOT_MAGIC;
 		new_slot->ctrl = ctrl;
 		new_slot->bus = ctrl->bus;
 		new_slot->device = slot_device;
 		new_slot->number = slot_number;
 		dbg("slot->number = %d\n",new_slot->number);
 
-		slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9, slot_entry);
+		slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9,
+					slot_entry);
 
 		while (slot_entry && (readw(slot_entry + SMBIOS_SLOT_NUMBER) != new_slot->number)) {
-			slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9, slot_entry);
+			slot_entry = get_SMBIOS_entry(smbios_start,
+						smbios_table, 9, slot_entry);
 		}
 
 		new_slot->p_sm_slot = slot_entry;
@@ -417,7 +406,7 @@ static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *
 		/* register this slot with the hotplug pci core */
 		new_slot->hotplug_slot->release = &release_slot;
 		new_slot->hotplug_slot->private = new_slot;
-		make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
+		make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
 		new_slot->hotplug_slot->ops = &cpqphp_hotplug_slot_ops;
 		
 		new_slot->hotplug_slot->info->power_status = get_slot_enabled(ctrl, new_slot);
@@ -425,13 +414,15 @@ static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *
 		new_slot->hotplug_slot->info->latch_status = cpq_get_latch_status(ctrl, new_slot);
 		new_slot->hotplug_slot->info->adapter_status = get_presence_status(ctrl, new_slot);
 		
-		dbg ("registering bus %d, dev %d, number %d, ctrl->slot_device_offset %d, slot %d\n", 
-		     new_slot->bus, new_slot->device, new_slot->number, ctrl->slot_device_offset, slot_number);
+		dbg ("registering bus %d, dev %d, number %d, "
+				"ctrl->slot_device_offset %d, slot %d\n",
+				new_slot->bus, new_slot->device,
+				new_slot->number, ctrl->slot_device_offset,
+				slot_number);
 		result = pci_hp_register (new_slot->hotplug_slot);
 		if (result) {
 			err ("pci_hp_register failed with error %d\n", result);
-			release_slot(new_slot->hotplug_slot);
-			return result;
+			goto error_name;
 		}
 		
 		new_slot->next = ctrl->slot;
@@ -443,6 +434,17 @@ static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *
 	}
 
 	return 0;
+
+error_name:
+	kfree(new_slot->hotplug_slot->name);
+error_info:
+	kfree(new_slot->hotplug_slot->info);
+error_hpslot:
+	kfree(new_slot->hotplug_slot);
+error_slot:
+	kfree(new_slot);
+error:
+	return result;
 }
 
 static int ctrl_slot_cleanup (struct controller * ctrl)
@@ -485,7 +487,8 @@ static int ctrl_slot_cleanup (struct controller * ctrl)
 //
 // Output:	SUCCESS or FAILURE
 //=============================================================================
-static int get_slot_mapping (struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot)
+static int
+get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot)
 {
 	struct irq_routing_table *PCIIRQRoutingInfoLength;
 	u32 work;
@@ -520,17 +523,22 @@ static int get_slot_mapping (struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *sl
 			kfree(PCIIRQRoutingInfoLength);
 			return 0;
 		} else {
-			// Didn't get a match on the target PCI device. Check if the
-			// current IRQ table entry is a PCI-to-PCI bridge device.  If so,
-			// and it's secondary bus matches the bus number for the target 
-			// device, I need to save the bridge's slot number.  If I can't 
-			// find an entry for the target device, I will have to assume it's 
-			// on the other side of the bridge, and assign it the bridge's slot.
+			/* Did not get a match on the target PCI device. Check
+			 * if the current IRQ table entry is a PCI-to-PCI bridge
+			 * device.  If so, and it's secondary bus matches the
+			 * bus number for the target device, I need to save the
+			 * bridge's slot number.  If I can not find an entry for
+			 * the target device, I will have to assume it's on the
+			 * other side of the bridge, and assign it the bridge's
+			 * slot. */
 			bus->number = tbus;
-			pci_bus_read_config_dword (bus, PCI_DEVFN(tdevice, 0), PCI_REVISION_ID, &work);
+			pci_bus_read_config_dword(bus, PCI_DEVFN(tdevice, 0),
+						PCI_REVISION_ID, &work);
 
 			if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) {
-				pci_bus_read_config_dword (bus, PCI_DEVFN(tdevice, 0), PCI_PRIMARY_BUS, &work);
+				pci_bus_read_config_dword(bus,
+							PCI_DEVFN(tdevice, 0),
+							PCI_PRIMARY_BUS, &work);
 				// See if bridge's secondary bus matches target bus.
 				if (((work >> 8) & 0x000000FF) == (long) bus_num) {
 					bridgeSlot = tslot;
@@ -559,7 +567,9 @@ static int get_slot_mapping (struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *sl
  * cpqhp_set_attention_status - Turns the Amber LED for a slot on or off
  *
  */
-static int cpqhp_set_attention_status (struct controller *ctrl, struct pci_func *func, u32 status)
+static int
+cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func,
+				u32 status)
 {
 	u8 hp_slot;
 
@@ -600,22 +610,15 @@ static int cpqhp_set_attention_status (struct controller *ctrl, struct pci_func
 static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 {
 	struct pci_func *slot_func;
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 	u8 bus;
 	u8 devfn;
 	u8 device;
 	u8 function;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
 		return -ENODEV;
 
@@ -624,33 +627,25 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 	dbg("bus, dev, fn = %d, %d, %d\n", bus, device, function);
 
 	slot_func = cpqhp_slot_find(bus, device, function);
-	if (!slot_func) {
+	if (!slot_func)
 		return -ENODEV;
-	}
 
 	return cpqhp_set_attention_status(ctrl, slot_func, status);
 }
 
 
-static int process_SI (struct hotplug_slot *hotplug_slot)
+static int process_SI(struct hotplug_slot *hotplug_slot)
 {
 	struct pci_func *slot_func;
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 	u8 bus;
 	u8 devfn;
 	u8 device;
 	u8 function;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
 		return -ENODEV;
 
@@ -659,9 +654,8 @@ static int process_SI (struct hotplug_slot *hotplug_slot)
 	dbg("bus, dev, fn = %d, %d, %d\n", bus, device, function);
 
 	slot_func = cpqhp_slot_find(bus, device, function);
-	if (!slot_func) {
+	if (!slot_func)
 		return -ENODEV;
-	}
 
 	slot_func->bus = bus;
 	slot_func->device = device;
@@ -672,25 +666,18 @@ static int process_SI (struct hotplug_slot *hotplug_slot)
 }
 
 
-static int process_SS (struct hotplug_slot *hotplug_slot)
+static int process_SS(struct hotplug_slot *hotplug_slot)
 {
 	struct pci_func *slot_func;
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 	u8 bus;
 	u8 devfn;
 	u8 device;
 	u8 function;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
 		return -ENODEV;
 
@@ -699,121 +686,78 @@ static int process_SS (struct hotplug_slot *hotplug_slot)
 	dbg("bus, dev, fn = %d, %d, %d\n", bus, device, function);
 
 	slot_func = cpqhp_slot_find(bus, device, function);
-	if (!slot_func) {
+	if (!slot_func)
 		return -ENODEV;
-	}
-	
-	dbg("In power_down_board, slot_func = %p, ctrl = %p\n", slot_func, ctrl);
+
+	dbg("In %s, slot_func = %p, ctrl = %p\n", __FUNCTION__, slot_func, ctrl);
 	return cpqhp_process_SS(ctrl, slot_func);
 }
 
 
-static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value)
+static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	if (slot == NULL)
-		return -ENODEV;
-
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-
-	return cpqhp_hardware_test (ctrl, value);	
+	return cpqhp_hardware_test(ctrl, value);	
 }
 
 
-static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	*value = get_slot_enabled(ctrl, slot);
 	return 0;
 }
 
-static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
-	
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 	
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	*value = cpq_get_attention_status(ctrl, slot);
 	return 0;
 }
 
-static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
-	*value = cpq_get_latch_status (ctrl, slot);
+	*value = cpq_get_latch_status(ctrl, slot);
 
 	return 0;
 }
 
-static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
-	
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
-	*value = get_presence_status (ctrl, slot);
+	*value = get_presence_status(ctrl, slot);
 
 	return 0;
 }
 
 static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
-	
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	*value = ctrl->speed_capability;
 
 	return 0;
@@ -821,18 +765,11 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
 
 static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	struct controller *ctrl;
-	
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
+	struct controller *ctrl = slot->ctrl;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	ctrl = slot->ctrl;
-	if (ctrl == NULL)
-		return -ENODEV;
-	
 	*value = ctrl->speed;
 
 	return 0;
@@ -908,11 +845,11 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			case PCI_VENDOR_ID_COMPAQ:
 				if (rev >= 0x13) { /* CIOBX */
 					ctrl->push_flag = 1;
-					ctrl->slot_switch_type = 1;		// Switch is present
-					ctrl->push_button = 1;			// Pushbutton is present
-					ctrl->pci_config_space = 1;		// Index/data access to working registers 0 = not supported, 1 = supported
-					ctrl->defeature_PHP = 1;		// PHP is supported
-					ctrl->pcix_support = 1;			// PCI-X supported
+					ctrl->slot_switch_type = 1;
+					ctrl->push_button = 1;
+					ctrl->pci_config_space = 1;
+					ctrl->defeature_PHP = 1;
+					ctrl->pcix_support = 1;
 					ctrl->pcix_speed_capability = 1;
 					pci_read_config_byte(pdev, 0x41, &bus_cap);
 					if (bus_cap & 0x80) {
@@ -942,55 +879,55 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 				switch (subsystem_deviceid) {
 					case PCI_SUB_HPC_ID:
 						/* Original 6500/7000 implementation */
-						ctrl->slot_switch_type = 1;		// Switch is present
+						ctrl->slot_switch_type = 1;
 						ctrl->speed_capability = PCI_SPEED_33MHz;
-						ctrl->push_button = 0;			// No pushbutton
-						ctrl->pci_config_space = 1;		// Index/data access to working registers 0 = not supported, 1 = supported
-						ctrl->defeature_PHP = 1;		// PHP is supported
-						ctrl->pcix_support = 0;			// PCI-X not supported
-						ctrl->pcix_speed_capability = 0;	// N/A since PCI-X not supported
+						ctrl->push_button = 0;
+						ctrl->pci_config_space = 1;
+						ctrl->defeature_PHP = 1;
+						ctrl->pcix_support = 0;
+						ctrl->pcix_speed_capability = 0;
 						break;
 					case PCI_SUB_HPC_ID2:
 						/* First Pushbutton implementation */
 						ctrl->push_flag = 1;
-						ctrl->slot_switch_type = 1;		// Switch is present
+						ctrl->slot_switch_type = 1;
 						ctrl->speed_capability = PCI_SPEED_33MHz;
-						ctrl->push_button = 1;			// Pushbutton is present
-						ctrl->pci_config_space = 1;		// Index/data access to working registers 0 = not supported, 1 = supported
-						ctrl->defeature_PHP = 1;		// PHP is supported
-						ctrl->pcix_support = 0;			// PCI-X not supported
-						ctrl->pcix_speed_capability = 0;	// N/A since PCI-X not supported
+						ctrl->push_button = 1;
+						ctrl->pci_config_space = 1;
+						ctrl->defeature_PHP = 1;
+						ctrl->pcix_support = 0;
+						ctrl->pcix_speed_capability = 0;
 						break;
 					case PCI_SUB_HPC_ID_INTC:
 						/* Third party (6500/7000) */
-						ctrl->slot_switch_type = 1;		// Switch is present
+						ctrl->slot_switch_type = 1;
 						ctrl->speed_capability = PCI_SPEED_33MHz;
-						ctrl->push_button = 0;			// No pushbutton
-						ctrl->pci_config_space = 1;		// Index/data access to working registers 0 = not supported, 1 = supported
-						ctrl->defeature_PHP = 1;			// PHP is supported
-						ctrl->pcix_support = 0;			// PCI-X not supported
-						ctrl->pcix_speed_capability = 0;		// N/A since PCI-X not supported
+						ctrl->push_button = 0;
+						ctrl->pci_config_space = 1;
+						ctrl->defeature_PHP = 1;
+						ctrl->pcix_support = 0;
+						ctrl->pcix_speed_capability = 0;
 						break;
 					case PCI_SUB_HPC_ID3:
 						/* First 66 Mhz implementation */
 						ctrl->push_flag = 1;
-						ctrl->slot_switch_type = 1;		// Switch is present
+						ctrl->slot_switch_type = 1;
 						ctrl->speed_capability = PCI_SPEED_66MHz;
-						ctrl->push_button = 1;			// Pushbutton is present
-						ctrl->pci_config_space = 1;		// Index/data access to working registers 0 = not supported, 1 = supported
-						ctrl->defeature_PHP = 1;		// PHP is supported
-						ctrl->pcix_support = 0;			// PCI-X not supported
-						ctrl->pcix_speed_capability = 0;	// N/A since PCI-X not supported
+						ctrl->push_button = 1;
+						ctrl->pci_config_space = 1;
+						ctrl->defeature_PHP = 1;
+						ctrl->pcix_support = 0;
+						ctrl->pcix_speed_capability = 0;
 						break;
 					case PCI_SUB_HPC_ID4:
 						/* First PCI-X implementation, 100MHz */
 						ctrl->push_flag = 1;
-						ctrl->slot_switch_type = 1;		// Switch is present
+						ctrl->slot_switch_type = 1;
 						ctrl->speed_capability = PCI_SPEED_100MHz_PCIX;
-						ctrl->push_button = 1;			// Pushbutton is present
-						ctrl->pci_config_space = 1;		// Index/data access to working registers 0 = not supported, 1 = supported
-						ctrl->defeature_PHP = 1;		// PHP is supported
-						ctrl->pcix_support = 1;			// PCI-X supported
+						ctrl->push_button = 1;
+						ctrl->pci_config_space = 1;
+						ctrl->defeature_PHP = 1;
+						ctrl->pcix_support = 1;
 						ctrl->pcix_speed_capability = 0;	
 						break;
 					default:
@@ -1079,33 +1016,41 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	// Tell the user that we found one.
-	info("Initializing the PCI hot plug controller residing on PCI bus %d\n", pdev->bus->number);
-
-	dbg ("Hotplug controller capabilities:\n");
-	dbg ("    speed_capability       %d\n", ctrl->speed_capability);
-	dbg ("    slot_switch_type       %s\n", ctrl->slot_switch_type == 0 ? "no switch" : "switch present");
-	dbg ("    defeature_PHP          %s\n", ctrl->defeature_PHP == 0 ? "PHP not supported" : "PHP supported");
-	dbg ("    alternate_base_address %s\n", ctrl->alternate_base_address == 0 ? "not supported" : "supported");
-	dbg ("    pci_config_space       %s\n", ctrl->pci_config_space == 0 ? "not supported" : "supported");
-	dbg ("    pcix_speed_capability  %s\n", ctrl->pcix_speed_capability == 0 ? "not supported" : "supported");
-	dbg ("    pcix_support           %s\n", ctrl->pcix_support == 0 ? "not supported" : "supported");
+	info("Initializing the PCI hot plug controller residing on PCI bus %d\n",
+					pdev->bus->number);
+
+	dbg("Hotplug controller capabilities:\n");
+	dbg("    speed_capability       %d\n", ctrl->speed_capability);
+	dbg("    slot_switch_type       %s\n", ctrl->slot_switch_type ?
+					"switch present" : "no switch");
+	dbg("    defeature_PHP          %s\n", ctrl->defeature_PHP ?
+					"PHP supported" : "PHP not supported");
+	dbg("    alternate_base_address %s\n", ctrl->alternate_base_address ?
+					"supported" : "not supported");
+	dbg("    pci_config_space       %s\n", ctrl->pci_config_space ?
+					"supported" : "not supported");
+	dbg("    pcix_speed_capability  %s\n", ctrl->pcix_speed_capability ?
+					"supported" : "not supported");
+	dbg("    pcix_support           %s\n", ctrl->pcix_support ?
+					"supported" : "not supported");
 
 	ctrl->pci_dev = pdev;
 	pci_set_drvdata(pdev, ctrl);
 
-	/* make our own copy of the pci bus structure, as we like tweaking it a lot */
-	ctrl->pci_bus = kmalloc (sizeof (*ctrl->pci_bus), GFP_KERNEL);
+	/* make our own copy of the pci bus structure,
+	 * as we like tweaking it a lot */
+	ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL);
 	if (!ctrl->pci_bus) {
 		err("out of memory\n");
 		rc = -ENOMEM;
 		goto err_free_ctrl;
 	}
-	memcpy (ctrl->pci_bus, pdev->bus, sizeof (*ctrl->pci_bus));
+	memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus));
 
 	ctrl->bus = pdev->bus->number;
 	ctrl->rev = rev;
 	dbg("bus device function rev: %d %d %d %d\n", ctrl->bus,
-	     PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev);
+		PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev);
 
 	init_MUTEX(&ctrl->crit_sect);
 	init_waitqueue_head(&ctrl->queue);
@@ -1127,9 +1072,12 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_free_bus;
 	}
 
-	ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+	ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0),
+					pci_resource_len(pdev, 0));
 	if (!ctrl->hpc_reg) {
-		err("cannot remap MMIO region %lx @ %lx\n", pci_resource_len(pdev, 0), pci_resource_start(pdev, 0));
+		err("cannot remap MMIO region %lx @ %lx\n",
+				pci_resource_len(pdev, 0),
+				pci_resource_start(pdev, 0));
 		rc = -ENODEV;
 		goto err_free_mem_region;
 	}
@@ -1138,21 +1086,25 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	ctrl->speed = get_controller_speed(ctrl);
 
 
-	//**************************************************
-	//
-	//              Save configuration headers for this and
-	//              subordinate PCI buses
-	//
-	//**************************************************
+	/********************************************************
+	 *
+	 *              Save configuration headers for this and
+	 *              subordinate PCI buses
+	 *
+	 ********************************************************/
 
 	// find the physical slot number of the first hot plug slot
 
-	// Get slot won't work for devices behind bridges, but
-	// in this case it will always be called for the "base"
-	// bus/dev/func of a slot.
-	// CS: this is leveraging the PCIIRQ routing code from the kernel (pci-pc.c: get_irq_routing_table)
-	rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number, (readb(ctrl->hpc_reg + SLOT_MASK) >> 4), &(ctrl->first_slot));
-	dbg("get_slot_mapping: first_slot = %d, returned = %d\n", ctrl->first_slot, rc);
+	/* Get slot won't work for devices behind bridges, but
+	 * in this case it will always be called for the "base"
+	 * bus/dev/func of a slot.
+	 * CS: this is leveraging the PCIIRQ routing code from the kernel
+	 * (pci-pc.c: get_irq_routing_table) */
+	rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number,
+				(readb(ctrl->hpc_reg + SLOT_MASK) >> 4),
+				&(ctrl->first_slot));
+	dbg("get_slot_mapping: first_slot = %d, returned = %d\n",
+				ctrl->first_slot, rc);
 	if (rc) {
 		err(msg_initialization_err, rc);
 		goto err_iounmap;
@@ -1161,7 +1113,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	// Store PCI Config Space for all devices on this bus
 	rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK));
 	if (rc) {
-		err("%s: unable to save PCI configuration data, error %d\n", __FUNCTION__, rc);
+		err("%s: unable to save PCI configuration data, error %d\n",
+				__FUNCTION__, rc);
 		goto err_iounmap;
 	}
 
@@ -1198,7 +1151,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	rc = ctrl_slot_setup(ctrl, smbios_start, smbios_table);
 	if (rc) {
 		err(msg_initialization_err, 6);
-		err("%s: unable to save PCI configuration data, error %d\n", __FUNCTION__, rc);
+		err("%s: unable to save PCI configuration data, error %d\n",
+			__FUNCTION__, rc);
 		goto err_iounmap;
 	}
 	
@@ -1209,7 +1163,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dbg("HPC interrupt = %d \n", ctrl->interrupt);
 	if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
 			SA_SHIRQ, MY_NAME, ctrl)) {
-		err("Can't get irq %d for the hotplug pci controller\n", ctrl->interrupt);
+		err("Can't get irq %d for the hotplug pci controller\n",
+			ctrl->interrupt);
 		rc = -ENODEV;
 		goto err_iounmap;
 	}
@@ -1265,8 +1220,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 		if (!power_mode) {
 			if (!func->is_a_board) {
-				green_LED_off (ctrl, hp_slot);
-				slot_disable (ctrl, hp_slot);
+				green_LED_off(ctrl, hp_slot);
+				slot_disable(ctrl, hp_slot);
 			}
 		}
 
@@ -1277,7 +1232,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (!power_mode) {
 		set_SOGO(ctrl);
 		// Wait for SOBS to be unset
-		wait_for_ctrl_irq (ctrl);
+		wait_for_ctrl_irq(ctrl);
 	}
 
 	rc = init_SERR(ctrl);
@@ -1290,7 +1245,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	// Done with exclusive hardware access
 	up(&ctrl->crit_sect);
 
-	cpqhp_create_ctrl_files (ctrl);
+	cpqhp_create_ctrl_files(ctrl);
 
 	return 0;
 
@@ -1350,35 +1305,36 @@ static int one_time_init(void)
 	compaq_nvram_init(cpqhp_rom_start);
 	
 	/* Map smbios table entry point structure */
-	smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start, cpqhp_rom_start + ROM_PHY_LEN);
+	smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start,
+					cpqhp_rom_start + ROM_PHY_LEN);
 	if (!smbios_table) {
 		err ("Could not find the SMBIOS pointer in memory\n");
 		retval = -EIO;
-		goto error;
+		goto error_rom_start;
 	}
 
-	smbios_start = ioremap(readl(smbios_table + ST_ADDRESS), readw(smbios_table + ST_LENGTH));
+	smbios_start = ioremap(readl(smbios_table + ST_ADDRESS),
+					readw(smbios_table + ST_LENGTH));
 	if (!smbios_start) {
 		err ("Could not ioremap memory region taken from SMBIOS values\n");
 		retval = -EIO;
-		goto error;
+		goto error_smbios_start;
 	}
 
 	initialized = 1;
 
 	return retval;
 
+error_smbios_start:
+	iounmap(smbios_start);
+error_rom_start:
+	iounmap(cpqhp_rom_start);
 error:
-	if (cpqhp_rom_start)
-		iounmap(cpqhp_rom_start);
-	if (smbios_start)
-		iounmap(smbios_start);
-	
 	return retval;
 }
 
 
-static void unload_cpqphpd(void)
+static void __exit unload_cpqphpd(void)
 {
 	struct pci_func *next;
 	struct pci_func *TempSlot;
@@ -1512,7 +1468,7 @@ MODULE_DEVICE_TABLE(pci, hpcd_pci_tbl);
 
 
 static struct pci_driver cpqhpc_driver = {
-	.name =		"pci_hotplug",
+	.name =		"compaq_pci_hotplug",
 	.id_table =	hpcd_pci_tbl,
 	.probe =	cpqhpc_probe,
 	/* remove:	cpqhpc_remove_one, */
@@ -1526,12 +1482,10 @@ static int __init cpqhpc_init(void)
 
 	cpqhp_debug = debug;
 
+	info (DRIVER_DESC " version: " DRIVER_VERSION "\n");
 	result = pci_module_init(&cpqhpc_driver);
 	dbg("pci_module_init = %d\n", result);
-	if (result)
-		return result;
-	info (DRIVER_DESC " version: " DRIVER_VERSION "\n");
-	return 0;
+	return result;
 }
 
 
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index f43c964cc..a7913f7e9 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -39,8 +39,10 @@
 #include <linux/pci.h>
 #include "cpqphp.h"
 
-static u32 configure_new_device(struct controller* ctrl, struct pci_func *func,u8 behind_bridge, struct resource_lists *resources);
-static int configure_new_function(struct controller* ctrl, struct pci_func *func,u8 behind_bridge, struct resource_lists *resources);
+static u32 configure_new_device(struct controller* ctrl, struct pci_func *func,
+			u8 behind_bridge, struct resource_lists *resources);
+static int configure_new_function(struct controller* ctrl, struct pci_func *func,
+			u8 behind_bridge, struct resource_lists *resources);
 static void interrupt_event_handler(struct controller *ctrl);
 
 static struct semaphore event_semaphore;	/* mutex for process loop (up if something to process) */
@@ -53,7 +55,7 @@ static struct semaphore		delay_sem;
 static wait_queue_head_t	delay_wait;
 
 /* delay is in jiffies to wait for */
-static void long_delay (int delay)
+static void long_delay(int delay)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	
@@ -64,7 +66,7 @@ static void long_delay (int delay)
 	 */
 	down (&delay_sem);
 
-	init_waitqueue_head (&delay_wait);
+	init_waitqueue_head(&delay_wait);
 
 	add_wait_queue(&delay_wait, &wait);
 	set_current_state(TASK_INTERRUPTIBLE);
@@ -72,11 +74,11 @@ static void long_delay (int delay)
 	remove_wait_queue(&delay_wait, &wait);
 	set_current_state(TASK_RUNNING);
 	
-	up (&delay_sem);
+	up(&delay_sem);
 }
 
 
-//FIXME: The following line needs to be somewhere else...
+/* FIXME: The following line needs to be somewhere else... */
 #define WRONG_BUS_FREQUENCY 0x07
 static u8 handle_switch_change(u8 change, struct controller * ctrl)
 {
@@ -89,18 +91,19 @@ static u8 handle_switch_change(u8 change, struct controller * ctrl)
 	if (!change)
 		return 0;
 
-	// Switch Change
+	/* Switch Change */
 	dbg("cpqsbd:  Switch interrupt received.\n");
 
 	for (hp_slot = 0; hp_slot < 6; hp_slot++) {
 		if (change & (0x1L << hp_slot)) {
-			//*********************************
-			// this one changed.
-			//*********************************
-			func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0);
-
-			//this is the structure that tells the worker thread
-			//what to do
+			/**********************************
+			 * this one changed.
+			 **********************************/
+			func = cpqhp_slot_find(ctrl->bus,
+				(hp_slot + ctrl->slot_device_offset), 0);
+
+			/* this is the structure that tells the worker thread
+			 *what to do */
 			taskInfo = &(ctrl->event_queue[ctrl->next_event]);
 			ctrl->next_event = (ctrl->next_event + 1) % 10;
 			taskInfo->hp_slot = hp_slot;
@@ -112,17 +115,17 @@ static u8 handle_switch_change(u8 change, struct controller * ctrl)
 			func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02;
 
 			if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) {
-				//*********************************
-				// Switch opened
-				//*********************************
+				/**********************************
+				 * Switch opened
+				 **********************************/
 
 				func->switch_save = 0;
 
 				taskInfo->event_type = INT_SWITCH_OPEN;
 			} else {
-				//*********************************
-				// Switch closed
-				//*********************************
+				/**********************************
+				 * Switch closed
+				 **********************************/
 
 				func->switch_save = 0x10;
 
@@ -134,18 +137,14 @@ static u8 handle_switch_change(u8 change, struct controller * ctrl)
 	return rc;
 }
 
-
-/*
- * cpqhp_find_slot
+/**
+ * cpqhp_find_slot: find the struct slot of given device
+ * @ctrl: scan lots of this controller
+ * @device: the device id to find
  */
-struct slot *cpqhp_find_slot (struct controller * ctrl, u8 device)
+static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device)
 {
-	struct slot *slot;
-
-	if (!ctrl)
-		return NULL;
-
-	slot = ctrl->slot;
+	struct slot *slot = ctrl->slot;
 
 	while (slot && (slot->device != device)) {
 		slot = slot->next;
@@ -168,18 +167,19 @@ static u8 handle_presence_change(u16 change, struct controller * ctrl)
 	if (!change)
 		return 0;
 
-	//*********************************
-	// Presence Change
-	//*********************************
+	/**********************************
+	 * Presence Change
+	 **********************************/
 	dbg("cpqsbd:  Presence/Notify input change.\n");
 	dbg("         Changed bits are 0x%4.4x\n", change );
 
 	for (hp_slot = 0; hp_slot < 6; hp_slot++) {
 		if (change & (0x0101 << hp_slot)) {
-			//*********************************
-			// this one changed.
-			//*********************************
-			func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0);
+			/**********************************
+			 * this one changed.
+			 **********************************/
+			func = cpqhp_slot_find(ctrl->bus,
+				(hp_slot + ctrl->slot_device_offset), 0);
 
 			taskInfo = &(ctrl->event_queue[ctrl->next_event]);
 			ctrl->next_event = (ctrl->next_event + 1) % 10;
@@ -191,55 +191,51 @@ static u8 handle_presence_change(u16 change, struct controller * ctrl)
 			if (!p_slot)
 				return 0;
 
-			// If the switch closed, must be a button
-			// If not in button mode, nevermind
+			/* If the switch closed, must be a button
+			 * If not in button mode, nevermind */
 			if (func->switch_save && (ctrl->push_button == 1)) {
 				temp_word = ctrl->ctrl_int_comp >> 16;
 				temp_byte = (temp_word >> hp_slot) & 0x01;
 				temp_byte |= (temp_word >> (hp_slot + 7)) & 0x02;
 
 				if (temp_byte != func->presence_save) {
-					//*********************************
-					// button Pressed (doesn't do anything)
-					//*********************************
+					/**************************************
+					 * button Pressed (doesn't do anything)
+					 **************************************/
 					dbg("hp_slot %d button pressed\n", hp_slot);
 					taskInfo->event_type = INT_BUTTON_PRESS;
 				} else {
-					//*********************************
-					// button Released - TAKE ACTION!!!!
-					//*********************************
+					/**********************************
+					 * button Released - TAKE ACTION!!!!
+					 **********************************/
 					dbg("hp_slot %d button released\n", hp_slot);
 					taskInfo->event_type = INT_BUTTON_RELEASE;
 
-					// Cancel if we are still blinking
+					/* Cancel if we are still blinking */
 					if ((p_slot->state == BLINKINGON_STATE)
 					    || (p_slot->state == BLINKINGOFF_STATE)) {
 						taskInfo->event_type = INT_BUTTON_CANCEL;
 						dbg("hp_slot %d button cancel\n", hp_slot);
 					} else if ((p_slot->state == POWERON_STATE)
 						   || (p_slot->state == POWEROFF_STATE)) {
-						//info(msg_button_ignore, p_slot->number);
+						/* info(msg_button_ignore, p_slot->number); */
 						taskInfo->event_type = INT_BUTTON_IGNORE;
 						dbg("hp_slot %d button ignore\n", hp_slot);
 					}
 				}
 			} else {
-				// Switch is open, assume a presence change
-				// Save the presence state
+				/* Switch is open, assume a presence change
+				 * Save the presence state */
 				temp_word = ctrl->ctrl_int_comp >> 16;
 				func->presence_save = (temp_word >> hp_slot) & 0x01;
 				func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02;
 
 				if ((!(ctrl->ctrl_int_comp & (0x010000 << hp_slot))) ||
 				    (!(ctrl->ctrl_int_comp & (0x01000000 << hp_slot)))) {
-					//*********************************
-					// Present
-					//*********************************
+					/* Present */
 					taskInfo->event_type = INT_PRESENCE_ON;
 				} else {
-					//*********************************
-					// Not Present
-					//*********************************
+					/* Not Present */
 					taskInfo->event_type = INT_PRESENCE_OFF;
 				}
 			}
@@ -260,18 +256,19 @@ static u8 handle_power_fault(u8 change, struct controller * ctrl)
 	if (!change)
 		return 0;
 
-	//*********************************
-	// power fault
-	//*********************************
+	/**********************************
+	 * power fault
+	 **********************************/
 
 	info("power fault interrupt\n");
 
 	for (hp_slot = 0; hp_slot < 6; hp_slot++) {
 		if (change & (0x01 << hp_slot)) {
-			//*********************************
-			// this one changed.
-			//*********************************
-			func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0);
+			/**********************************
+			 * this one changed.
+			 **********************************/
+			func = cpqhp_slot_find(ctrl->bus,
+				(hp_slot + ctrl->slot_device_offset), 0);
 
 			taskInfo = &(ctrl->event_queue[ctrl->next_event]);
 			ctrl->next_event = (ctrl->next_event + 1) % 10;
@@ -280,16 +277,16 @@ static u8 handle_power_fault(u8 change, struct controller * ctrl)
 			rc++;
 
 			if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) {
-				//*********************************
-				// power fault Cleared
-				//*********************************
+				/**********************************
+				 * power fault Cleared
+				 **********************************/
 				func->status = 0x00;
 
 				taskInfo->event_type = INT_POWER_FAULT_CLEAR;
 			} else {
-				//*********************************
-				// power fault
-				//*********************************
+				/**********************************
+				 * power fault
+				 **********************************/
 				taskInfo->event_type = INT_POWER_FAULT;
 
 				if (ctrl->rev < 4) {
@@ -297,18 +294,20 @@ static u8 handle_power_fault(u8 change, struct controller * ctrl)
 					green_LED_off (ctrl, hp_slot);
 					set_SOGO (ctrl);
 
-					// this is a fatal condition, we want to crash the
-					// machine to protect from data corruption
-					// simulated_NMI shouldn't ever return
-					//FIXME
-					//simulated_NMI(hp_slot, ctrl);
-
-					//The following code causes a software crash just in
-					//case simulated_NMI did return
-					//FIXME
-					//panic(msg_power_fault);
+					/* this is a fatal condition, we want
+					 * to crash the machine to protect from
+					 * data corruption. simulated_NMI
+					 * shouldn't ever return */
+					/* FIXME
+					simulated_NMI(hp_slot, ctrl); */
+
+					/* The following code causes a software
+					 * crash just in case simulated_NMI did
+					 * return */
+					/*FIXME
+					panic(msg_power_fault); */
 				} else {
-					// set power fault status for this board
+					/* set power fault status for this board */
 					func->status = 0xFF;
 					info("power fault bit %x set\n", hp_slot);
 				}
@@ -320,11 +319,9 @@ static u8 handle_power_fault(u8 change, struct controller * ctrl)
 }
 
 
-/*
- * sort_by_size
- *
- * Sorts nodes on the list by their length.
- * Smallest first.
+/**
+ * sort_by_size: sort nodes on the list by their length, smallest first.
+ * @head: list to sort
  *
  */
 static int sort_by_size(struct pci_resource **head)
@@ -334,15 +331,15 @@ static int sort_by_size(struct pci_resource **head)
 	int out_of_order = 1;
 
 	if (!(*head))
-		return(1);
+		return 1;
 
 	if (!((*head)->next))
-		return(0);
+		return 0;
 
 	while (out_of_order) {
 		out_of_order = 0;
 
-		// Special case for swapping list head
+		/* Special case for swapping list head */
 		if (((*head)->next) &&
 		    ((*head)->length > (*head)->next->length)) {
 			out_of_order++;
@@ -365,17 +362,15 @@ static int sort_by_size(struct pci_resource **head)
 			} else
 				current_res = current_res->next;
 		}
-	}  // End of out_of_order loop
+	}  /* End of out_of_order loop */
 
-	return(0);
+	return 0;
 }
 
 
-/*
- * sort_by_max_size
- *
- * Sorts nodes on the list by their length.
- * Largest first.
+/**
+ * sort_by_max_size: sort nodes on the list by their length, largest first.
+ * @head: list to sort
  *
  */
 static int sort_by_max_size(struct pci_resource **head)
@@ -385,15 +380,15 @@ static int sort_by_max_size(struct pci_resource **head)
 	int out_of_order = 1;
 
 	if (!(*head))
-		return(1);
+		return 1;
 
 	if (!((*head)->next))
-		return(0);
+		return 0;
 
 	while (out_of_order) {
 		out_of_order = 0;
 
-		// Special case for swapping list head
+		/* Special case for swapping list head */
 		if (((*head)->next) &&
 		    ((*head)->length < (*head)->next->length)) {
 			out_of_order++;
@@ -416,19 +411,18 @@ static int sort_by_max_size(struct pci_resource **head)
 			} else
 				current_res = current_res->next;
 		}
-	}  // End of out_of_order loop
+	}  /* End of out_of_order loop */
 
-	return(0);
+	return 0;
 }
 
 
-/*
- * do_pre_bridge_resource_split
- *
- *	Returns zero or one node of resources that aren't in use
+/**
+ * do_pre_bridge_resource_split: find node of resources that are unused
  *
  */
-static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **head, struct pci_resource **orig_head, u32 alignment)
+static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **head,
+				struct pci_resource **orig_head, u32 alignment)
 {
 	struct pci_resource *prevnode = NULL;
 	struct pci_resource *node;
@@ -438,32 +432,32 @@ static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **
 	dbg("do_pre_bridge_resource_split\n");
 
 	if (!(*head) || !(*orig_head))
-		return(NULL);
+		return NULL;
 
 	rc = cpqhp_resource_sort_and_combine(head);
 
 	if (rc)
-		return(NULL);
+		return NULL;
 
 	if ((*head)->base != (*orig_head)->base)
-		return(NULL);
+		return NULL;
 
 	if ((*head)->length == (*orig_head)->length)
-		return(NULL);
+		return NULL;
 
 
-	// If we got here, there the bridge requires some of the resource, but
-	// we may be able to split some off of the front
+	/* If we got here, there the bridge requires some of the resource, but
+	 * we may be able to split some off of the front */
 
 	node = *head;
 
 	if (node->length & (alignment -1)) {
-		// this one isn't an aligned length, so we'll make a new entry
-		// and split it up.
-		split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+		/* this one isn't an aligned length, so we'll make a new entry
+		 * and split it up. */
+		split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 		if (!split_node)
-			return(NULL);
+			return NULL;
 
 		temp_dword = (node->length | (alignment-1)) + 1 - alignment;
 
@@ -473,52 +467,45 @@ static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **
 		node->length -= temp_dword;
 		node->base += split_node->length;
 
-		// Put it in the list
+		/* Put it in the list */
 		*head = split_node;
 		split_node->next = node;
 	}
 
-	if (node->length < alignment) {
-		return(NULL);
-	}
+	if (node->length < alignment)
+		return NULL;
 
-	// Now unlink it
+	/* Now unlink it */
 	if (*head == node) {
 		*head = node->next;
-		node->next = NULL;
 	} else {
 		prevnode = *head;
 		while (prevnode->next != node)
 			prevnode = prevnode->next;
 
 		prevnode->next = node->next;
-		node->next = NULL;
 	}
+	node->next = NULL;
 
-	return(node);
+	return node;
 }
 
 
-/*
- * do_bridge_resource_split
- *
- *	Returns zero or one node of resources that aren't in use
+/**
+ * do_bridge_resource_split: find one node of resources that aren't in use
  *
  */
-static struct pci_resource *do_bridge_resource_split (struct pci_resource **head, u32 alignment)
+static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, u32 alignment)
 {
 	struct pci_resource *prevnode = NULL;
 	struct pci_resource *node;
 	u32 rc;
 	u32 temp_dword;
 
-	if (!(*head))
-		return(NULL);
-
 	rc = cpqhp_resource_sort_and_combine(head);
 
 	if (rc)
-		return(NULL);
+		return NULL;
 
 	node = *head;
 
@@ -528,44 +515,41 @@ static struct pci_resource *do_bridge_resource_split (struct pci_resource **head
 		kfree(prevnode);
 	}
 
-	if (node->length < alignment) {
-		kfree(node);
-		return(NULL);
-	}
+	if (node->length < alignment)
+		goto error;
 
 	if (node->base & (alignment - 1)) {
-		// Short circuit if adjusted size is too small
+		/* Short circuit if adjusted size is too small */
 		temp_dword = (node->base | (alignment-1)) + 1;
-		if ((node->length - (temp_dword - node->base)) < alignment) {
-			kfree(node);
-			return(NULL);
-		}
+		if ((node->length - (temp_dword - node->base)) < alignment)
+			goto error;
 
 		node->length -= (temp_dword - node->base);
 		node->base = temp_dword;
 	}
 
-	if (node->length & (alignment - 1)) {
-		// There's stuff in use after this node
-		kfree(node);
-		return(NULL);
-	}
+	if (node->length & (alignment - 1))
+		/* There's stuff in use after this node */
+		goto error;
 
-	return(node);
+	return node;
+error:
+	kfree(node);
+	return NULL;
 }
 
 
-/*
- * get_io_resource
+/**
+ * get_io_resource: find first node of given size not in ISA aliasing window.
+ * @head: list to search
+ * @size: size of node to find, must be a power of two.
  *
- * this function sorts the resource list by size and then
- * returns the first node of "size" length that is not in the
- * ISA aliasing window.  If it finds a node larger than "size"
- * it will split it up.
+ * Description: this function sorts the resource list by size and then returns
+ * returns the first node of "size" length that is not in the ISA aliasing
+ * window.  If it finds a node larger than "size" it will split it up.
  *
- * size must be a power of two.
  */
-static struct pci_resource *get_io_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size)
 {
 	struct pci_resource *prevnode;
 	struct pci_resource *node;
@@ -573,66 +557,66 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 	u32 temp_dword;
 
 	if (!(*head))
-		return(NULL);
+		return NULL;
 
 	if ( cpqhp_resource_sort_and_combine(head) )
-		return(NULL);
+		return NULL;
 
 	if ( sort_by_size(head) )
-		return(NULL);
+		return NULL;
 
 	for (node = *head; node; node = node->next) {
 		if (node->length < size)
 			continue;
 
 		if (node->base & (size - 1)) {
-			// this one isn't base aligned properly
-			// so we'll make a new entry and split it up
+			/* this one isn't base aligned properly
+			 * so we'll make a new entry and split it up */
 			temp_dword = (node->base | (size-1)) + 1;
 
-			// Short circuit if adjusted size is too small
+			/* Short circuit if adjusted size is too small */
 			if ((node->length - (temp_dword - node->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base;
 			split_node->length = temp_dword - node->base;
 			node->base = temp_dword;
 			node->length -= split_node->length;
 
-			// Put it in the list
+			/* Put it in the list */
 			split_node->next = node->next;
 			node->next = split_node;
-		} // End of non-aligned base
+		} /* End of non-aligned base */
 
-		// Don't need to check if too small since we already did
+		/* Don't need to check if too small since we already did */
 		if (node->length > size) {
-			// this one is longer than we need
-			// so we'll make a new entry and split it up
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			/* this one is longer than we need
+			 * so we'll make a new entry and split it up */
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base + size;
 			split_node->length = node->length - size;
 			node->length = size;
 
-			// Put it in the list
+			/* Put it in the list */
 			split_node->next = node->next;
 			node->next = split_node;
-		}  // End of too big on top end
+		}  /* End of too big on top end */
 
-		// For IO make sure it's not in the ISA aliasing space
+		/* For IO make sure it's not in the ISA aliasing space */
 		if (node->base & 0x300L)
 			continue;
 
-		// If we got here, then it is the right size
-		// Now take it out of the list
+		/* If we got here, then it is the right size
+		 * Now take it out of the list and break */
 		if (*head == node) {
 			*head = node->next;
 		} else {
@@ -643,92 +627,87 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 			prevnode->next = node->next;
 		}
 		node->next = NULL;
-		// Stop looping
 		break;
 	}
 
-	return(node);
+	return node;
 }
 
 
-/*
- * get_max_resource
+/**
+ * get_max_resource: get largest node which has at least the given size.
+ * @head: the list to search the node in
+ * @size: the minimum size of the node to find
  *
- * Gets the largest node that is at least "size" big from the
+ * Description: Gets the largest node that is at least "size" big from the
  * list pointed to by head.  It aligns the node on top and bottom
  * to "size" alignment before returning it.
  */
-static struct pci_resource *get_max_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *get_max_resource(struct pci_resource **head, u32 size)
 {
 	struct pci_resource *max;
 	struct pci_resource *temp;
 	struct pci_resource *split_node;
 	u32 temp_dword;
 
-	if (!(*head))
-		return(NULL);
-
 	if (cpqhp_resource_sort_and_combine(head))
-		return(NULL);
+		return NULL;
 
 	if (sort_by_max_size(head))
-		return(NULL);
-
-	for (max = *head;max; max = max->next) {
+		return NULL;
 
-		// If not big enough we could probably just bail, 
-		// instead we'll continue to the next.
+	for (max = *head; max; max = max->next) {
+		/* If not big enough we could probably just bail, 
+		 * instead we'll continue to the next. */
 		if (max->length < size)
 			continue;
 
 		if (max->base & (size - 1)) {
-			// this one isn't base aligned properly
-			// so we'll make a new entry and split it up
+			/* this one isn't base aligned properly
+			 * so we'll make a new entry and split it up */
 			temp_dword = (max->base | (size-1)) + 1;
 
-			// Short circuit if adjusted size is too small
+			/* Short circuit if adjusted size is too small */
 			if ((max->length - (temp_dword - max->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = max->base;
 			split_node->length = temp_dword - max->base;
 			max->base = temp_dword;
 			max->length -= split_node->length;
 
-			// Put it next in the list
 			split_node->next = max->next;
 			max->next = split_node;
 		}
 
 		if ((max->base + max->length) & (size - 1)) {
-			// this one isn't end aligned properly at the top
-			// so we'll make a new entry and split it up
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			/* this one isn't end aligned properly at the top
+			 * so we'll make a new entry and split it up */
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 			temp_dword = ((max->base + max->length) & ~(size - 1));
 			split_node->base = temp_dword;
 			split_node->length = max->length + max->base
 					     - split_node->base;
 			max->length -= split_node->length;
 
-			// Put it in the list
 			split_node->next = max->next;
 			max->next = split_node;
 		}
 
-		// Make sure it didn't shrink too much when we aligned it
+		/* Make sure it didn't shrink too much when we aligned it */
 		if (max->length < size)
 			continue;
 
-		// Now take it out of the list
-		temp = (struct pci_resource*) *head;
+		/* Now take it out of the list */
+		temp = *head;
 		if (temp == max) {
 			*head = max->next;
 		} else {
@@ -740,38 +719,36 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 		}
 
 		max->next = NULL;
-		return(max);
+		break;
 	}
 
-	// If we get here, we couldn't find one
-	return(NULL);
+	return max;
 }
 
 
-/*
- * get_resource
+/**
+ * get_resource: find resource of given size and split up larger ones.
+ * @head: the list to search for resources
+ * @size: the size limit to use
  *
- * this function sorts the resource list by size and then
+ * Description: This function sorts the resource list by size and then
  * returns the first node of "size" length.  If it finds a node
  * larger than "size" it will split it up.
  *
  * size must be a power of two.
  */
-static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *get_resource(struct pci_resource **head, u32 size)
 {
 	struct pci_resource *prevnode;
 	struct pci_resource *node;
 	struct pci_resource *split_node;
 	u32 temp_dword;
 
-	if (!(*head))
-		return(NULL);
-
-	if ( cpqhp_resource_sort_and_combine(head) )
-		return(NULL);
+	if (cpqhp_resource_sort_and_combine(head))
+		return NULL;
 
-	if ( sort_by_size(head) )
-		return(NULL);
+	if (sort_by_size(head))
+		return NULL;
 
 	for (node = *head; node; node = node->next) {
 		dbg("%s: req_size =%x node=%p, base=%x, length=%x\n",
@@ -781,51 +758,50 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 
 		if (node->base & (size - 1)) {
 			dbg("%s: not aligned\n", __FUNCTION__);
-			// this one isn't base aligned properly
-			// so we'll make a new entry and split it up
+			/* this one isn't base aligned properly
+			 * so we'll make a new entry and split it up */
 			temp_dword = (node->base | (size-1)) + 1;
 
-			// Short circuit if adjusted size is too small
+			/* Short circuit if adjusted size is too small */
 			if ((node->length - (temp_dword - node->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base;
 			split_node->length = temp_dword - node->base;
 			node->base = temp_dword;
 			node->length -= split_node->length;
 
-			// Put it in the list
 			split_node->next = node->next;
 			node->next = split_node;
-		} // End of non-aligned base
+		} /* End of non-aligned base */
 
-		// Don't need to check if too small since we already did
+		/* Don't need to check if too small since we already did */
 		if (node->length > size) {
 			dbg("%s: too big\n", __FUNCTION__);
-			// this one is longer than we need
-			// so we'll make a new entry and split it up
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			/* this one is longer than we need
+			 * so we'll make a new entry and split it up */
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base + size;
 			split_node->length = node->length - size;
 			node->length = size;
 
-			// Put it in the list
+			/* Put it in the list */
 			split_node->next = node->next;
 			node->next = split_node;
-		}  // End of too big on top end
+		}  /* End of too big on top end */
 
 		dbg("%s: got one!!!\n", __FUNCTION__);
-		// If we got here, then it is the right size
-		// Now take it out of the list
+		/* If we got here, then it is the right size
+		 * Now take it out of the list */
 		if (*head == node) {
 			*head = node->next;
 		} else {
@@ -836,17 +812,17 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 			prevnode->next = node->next;
 		}
 		node->next = NULL;
-		// Stop looping
 		break;
 	}
-	return(node);
+	return node;
 }
 
 
-/*
- * cpqhp_resource_sort_and_combine
+/**
+ * cpqhp_resource_sort_and_combine: sort nodes by base addresses and clean up.
+ * @head: the list to sort and clean up
  *
- * Sorts all of the nodes in the list in ascending order by
+ * Description: Sorts all of the nodes in the list in ascending order by
  * their base addresses.  Also does garbage collection by
  * combining adjacent nodes.
  *
@@ -861,19 +837,19 @@ int cpqhp_resource_sort_and_combine(struct pci_resource **head)
 	dbg("%s: head = %p, *head = %p\n", __FUNCTION__, head, *head);
 
 	if (!(*head))
-		return(1);
+		return 1;
 
 	dbg("*head->next = %p\n",(*head)->next);
 
 	if (!(*head)->next)
-		return(0);	/* only one item on the list, already sorted! */
+		return 0;	/* only one item on the list, already sorted! */
 
 	dbg("*head->base = 0x%x\n",(*head)->base);
 	dbg("*head->next->base = 0x%x\n",(*head)->next->base);
 	while (out_of_order) {
 		out_of_order = 0;
 
-		// Special case for swapping list head
+		/* Special case for swapping list head */
 		if (((*head)->next) &&
 		    ((*head)->base > (*head)->next->base)) {
 			node1 = *head;
@@ -896,13 +872,13 @@ int cpqhp_resource_sort_and_combine(struct pci_resource **head)
 			} else
 				node1 = node1->next;
 		}
-	}  // End of out_of_order loop
+	}  /* End of out_of_order loop */
 
 	node1 = *head;
 
 	while (node1 && node1->next) {
 		if ((node1->base + node1->length) == node1->next->base) {
-			// Combine
+			/* Combine */
 			dbg("8..\n");
 			node1->length += node1->next->length;
 			node2 = node1->next;
@@ -912,7 +888,7 @@ int cpqhp_resource_sort_and_combine(struct pci_resource **head)
 			node1 = node1->next;
 	}
 
-	return(0);
+	return 0;
 }
 
 
@@ -927,23 +903,23 @@ irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data, struct pt_regs *regs)
 
 	
 	misc = readw(ctrl->hpc_reg + MISC);
-	//*********************************
-	// Check to see if it was our interrupt
-	//*********************************
+	/***************************************
+	 * Check to see if it was our interrupt
+	 ***************************************/
 	if (!(misc & 0x000C)) {
 		return IRQ_NONE;
 	}
 
 	if (misc & 0x0004) {
-		//*********************************
-		// Serial Output interrupt Pending
-		//*********************************
+		/**********************************
+		 * Serial Output interrupt Pending
+		 **********************************/
 
-		// Clear the interrupt
+		/* Clear the interrupt */
 		misc |= 0x0004;
 		writew(misc, ctrl->hpc_reg + MISC);
 
-		// Read to clear posted writes
+		/* Read to clear posted writes */
 		misc = readw(ctrl->hpc_reg + MISC);
 
 		dbg ("%s - waking up\n", __FUNCTION__);
@@ -951,21 +927,20 @@ irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data, struct pt_regs *regs)
 	}
 
 	if (misc & 0x0008) {
-		// General-interrupt-input interrupt Pending
+		/* General-interrupt-input interrupt Pending */
 		Diff = readl(ctrl->hpc_reg + INT_INPUT_CLEAR) ^ ctrl->ctrl_int_comp;
 
 		ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR);
 
-		// Clear the interrupt
+		/* Clear the interrupt */
 		writel(Diff, ctrl->hpc_reg + INT_INPUT_CLEAR);
 
-		// Read it back to clear any posted writes
+		/* Read it back to clear any posted writes */
 		temp_dword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR);
 
-		if (!Diff) {
-			// Clear all interrupts
+		if (!Diff)
+			/* Clear all interrupts */
 			writel(0xFFFFFFFF, ctrl->hpc_reg + INT_INPUT_CLEAR);
-		}
 
 		schedule_flag += handle_switch_change((u8)(Diff & 0xFFL), ctrl);
 		schedule_flag += handle_presence_change((u16)((Diff & 0xFFFF0000L) >> 16), ctrl);
@@ -1000,12 +975,12 @@ struct pci_func *cpqhp_slot_create(u8 busnumber)
 	struct pci_func *new_slot;
 	struct pci_func *next;
 
-	new_slot = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL);
+	new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL);
 
 	if (new_slot == NULL) {
-		// I'm not dead yet!
-		// You will be.
-		return(new_slot);
+		/* I'm not dead yet!
+		 * You will be. */
+		return new_slot;
 	}
 
 	memset(new_slot, 0, sizeof(struct pci_func));
@@ -1021,11 +996,11 @@ struct pci_func *cpqhp_slot_create(u8 busnumber)
 			next = next->next;
 		next->next = new_slot;
 	}
-	return(new_slot);
+	return new_slot;
 }
 
 
-/*
+/**
  * slot_remove - Removes a node from the linked list of slots.
  * @old_slot: slot to remove
  *
@@ -1036,19 +1011,19 @@ static int slot_remove(struct pci_func * old_slot)
 	struct pci_func *next;
 
 	if (old_slot == NULL)
-		return(1);
+		return 1;
 
 	next = cpqhp_slot_list[old_slot->bus];
 
 	if (next == NULL) {
-		return(1);
+		return 1;
 	}
 
 	if (next == old_slot) {
 		cpqhp_slot_list[old_slot->bus] = old_slot->next;
 		cpqhp_destroy_board_resources(old_slot);
 		kfree(old_slot);
-		return(0);
+		return 0;
 	}
 
 	while ((next->next != old_slot) && (next->next != NULL)) {
@@ -1059,9 +1034,9 @@ static int slot_remove(struct pci_func * old_slot)
 		next->next = old_slot->next;
 		cpqhp_destroy_board_resources(old_slot);
 		kfree(old_slot);
-		return(0);
+		return 0;
 	} else
-		return(2);
+		return 2;
 }
 
 
@@ -1077,9 +1052,6 @@ static int bridge_slot_remove(struct pci_func *bridge)
 	u8 tempBus;
 	struct pci_func *next;
 
-	if (bridge == NULL)
-		return(1);
-
 	secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF;
 	subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF;
 
@@ -1093,26 +1065,23 @@ static int bridge_slot_remove(struct pci_func *bridge)
 
 	next = cpqhp_slot_list[bridge->bus];
 
-	if (next == NULL) {
-		return(1);
-	}
+	if (next == NULL)
+		return 1;
 
 	if (next == bridge) {
 		cpqhp_slot_list[bridge->bus] = bridge->next;
-		kfree(bridge);
-		return(0);
+		goto out;
 	}
 
-	while ((next->next != bridge) && (next->next != NULL)) {
+	while ((next->next != bridge) && (next->next != NULL))
 		next = next->next;
-	}
 
-	if (next->next == bridge) {
-		next->next = bridge->next;
-		kfree(bridge);
-		return(0);
-	} else
-		return(2);
+	if (next->next != bridge)
+		return 2;
+	next->next = bridge->next;
+out:
+	kfree(bridge);
+	return 0;
 }
 
 
@@ -1132,7 +1101,7 @@ struct pci_func *cpqhp_slot_find(u8 bus, u8 device, u8 index)
 	func = cpqhp_slot_list[bus];
 
 	if ((func == NULL) || ((func->device == device) && (index == 0)))
-		return(func);
+		return func;
 
 	if (func->device == device)
 		found++;
@@ -1144,18 +1113,18 @@ struct pci_func *cpqhp_slot_find(u8 bus, u8 device, u8 index)
 			found++;
 
 		if (found == index)
-			return(func);
+			return func;
 	}
 
-	return(NULL);
+	return NULL;
 }
 
 
-// DJZ: I don't think is_bridge will work as is.
-//FIXME
+/* DJZ: I don't think is_bridge will work as is.
+ * FIXME */
 static int is_bridge(struct pci_func * func)
 {
-	// Check the header type
+	/* Check the header type */
 	if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01)
 		return 1;
 	else
@@ -1163,6 +1132,138 @@ static int is_bridge(struct pci_func * func)
 }
 
 
+/**
+ * set_controller_speed - set the frequency and/or mode of a specific
+ * controller segment.
+ *
+ * @ctrl: controller to change frequency/mode for.
+ * @adapter_speed: the speed of the adapter we want to match.
+ * @hp_slot: the slot number where the adapter is installed.
+ *
+ * Returns 0 if we successfully change frequency and/or mode to match the
+ * adapter speed.
+ * 
+ */
+static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot)
+{
+	struct slot *slot;
+	u8 reg;
+	u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER);
+	u16 reg16;
+	u32 leds = readl(ctrl->hpc_reg + LED_CONTROL);
+	
+	if (ctrl->speed == adapter_speed)
+		return 0;
+	
+	/* We don't allow freq/mode changes if we find another adapter running
+	 * in another slot on this controller */
+	for(slot = ctrl->slot; slot; slot = slot->next) {
+		if (slot->device == (hp_slot + ctrl->slot_device_offset)) 
+			continue;
+		if (!slot->hotplug_slot && !slot->hotplug_slot->info) 
+			continue;
+		if (slot->hotplug_slot->info->adapter_status == 0) 
+			continue;
+		/* If another adapter is running on the same segment but at a
+		 * lower speed/mode, we allow the new adapter to function at
+		 * this rate if supported */
+		if (ctrl->speed < adapter_speed) 
+			return 0;
+
+		return 1;
+	}
+	
+	/* If the controller doesn't support freq/mode changes and the
+	 * controller is running at a higher mode, we bail */
+	if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability))
+		return 1;
+	
+	/* But we allow the adapter to run at a lower rate if possible */
+	if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability))
+		return 0;
+
+	/* We try to set the max speed supported by both the adapter and
+	 * controller */
+	if (ctrl->speed_capability < adapter_speed) {
+		if (ctrl->speed == ctrl->speed_capability)
+			return 0;
+		adapter_speed = ctrl->speed_capability;
+	}
+
+	writel(0x0L, ctrl->hpc_reg + LED_CONTROL);
+	writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE);
+	
+	set_SOGO(ctrl); 
+	wait_for_ctrl_irq(ctrl);
+	
+	if (adapter_speed != PCI_SPEED_133MHz_PCIX)
+		reg = 0xF5;
+	else
+		reg = 0xF4;	
+	pci_write_config_byte(ctrl->pci_dev, 0x41, reg);
+	
+	reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ);
+	reg16 &= ~0x000F;
+	switch(adapter_speed) {
+		case(PCI_SPEED_133MHz_PCIX): 
+			reg = 0x75;
+			reg16 |= 0xB; 
+			break;
+		case(PCI_SPEED_100MHz_PCIX):
+			reg = 0x74;
+			reg16 |= 0xA;
+			break;
+		case(PCI_SPEED_66MHz_PCIX):
+			reg = 0x73;
+			reg16 |= 0x9;
+			break;
+		case(PCI_SPEED_66MHz):
+			reg = 0x73;
+			reg16 |= 0x1;
+			break;
+		default: /* 33MHz PCI 2.2 */
+			reg = 0x71;
+			break;
+			
+	}
+	reg16 |= 0xB << 12;
+	writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ);
+	
+	mdelay(5); 
+	
+	/* Reenable interrupts */
+	writel(0, ctrl->hpc_reg + INT_MASK);
+
+	pci_write_config_byte(ctrl->pci_dev, 0x41, reg); 
+	
+	/* Restart state machine */
+	reg = ~0xF;
+	pci_read_config_byte(ctrl->pci_dev, 0x43, &reg);
+	pci_write_config_byte(ctrl->pci_dev, 0x43, reg);
+	
+	/* Only if mode change...*/
+	if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) ||
+		((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) 
+			set_SOGO(ctrl);
+	
+	wait_for_ctrl_irq(ctrl);
+	mdelay(1100);
+	
+	/* Restore LED/Slot state */
+	writel(leds, ctrl->hpc_reg + LED_CONTROL);
+	writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE);
+	
+	set_SOGO(ctrl);
+	wait_for_ctrl_irq(ctrl);
+
+	ctrl->speed = adapter_speed;
+	slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
+
+	info("Successfully changed frequency/mode for adapter in slot %d\n", 
+			slot->number);
+	return 0;
+}
+
 /* the following routines constitute the bulk of the 
    hotplug controller logic
  */
@@ -1178,7 +1279,7 @@ static int is_bridge(struct pci_func * func)
  * If board isn't same, turns it back off.
  *
  */
-static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
+static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
 {
 	u8 hp_slot;
 	u8 temp_byte;
@@ -1190,36 +1291,35 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 	hp_slot = func->device - ctrl->slot_device_offset;
 
 	if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) {
-		//*********************************
-		// The switch is open.
-		//*********************************
+		/**********************************
+		 * The switch is open.
+		 **********************************/
 		rc = INTERLOCK_OPEN;
 	} else if (is_slot_enabled (ctrl, hp_slot)) {
-		//*********************************
-		// The board is already on
-		//*********************************
+		/**********************************
+		 * The board is already on
+		 **********************************/
 		rc = CARD_FUNCTIONING;
 	} else {
-		// Wait for exclusive access to hardware
 		down(&ctrl->crit_sect);
 
-		// turn on board without attaching to the bus
+		/* turn on board without attaching to the bus */
 		enable_slot_power (ctrl, hp_slot);
 
 		set_SOGO(ctrl);
 
-		// Wait for SOBS to be unset
+		/* Wait for SOBS to be unset */
 		wait_for_ctrl_irq (ctrl);
 
-		// Change bits in slot power register to force another shift out
-		// NOTE: this is to work around the timer bug
+		/* Change bits in slot power register to force another shift out
+		 * NOTE: this is to work around the timer bug */
 		temp_byte = readb(ctrl->hpc_reg + SLOT_POWER);
 		writeb(0x00, ctrl->hpc_reg + SLOT_POWER);
 		writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER);
 
 		set_SOGO(ctrl);
 
-		// Wait for SOBS to be unset
+		/* Wait for SOBS to be unset */
 		wait_for_ctrl_irq (ctrl);
 		
 		adapter_speed = get_adapter_speed(ctrl, hp_slot);
@@ -1227,21 +1327,19 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 			if (set_controller_speed(ctrl, adapter_speed, hp_slot))
 				rc = WRONG_BUS_FREQUENCY;
 
-		// turn off board without attaching to the bus
+		/* turn off board without attaching to the bus */
 		disable_slot_power (ctrl, hp_slot);
 
 		set_SOGO(ctrl);
 
-		// Wait for SOBS to be unset
+		/* Wait for SOBS to be unset */
 		wait_for_ctrl_irq (ctrl);
 
-		// Done with exclusive hardware access
 		up(&ctrl->crit_sect);
 
 		if (rc)
-			return(rc);
+			return rc;
 
-		// Wait for exclusive access to hardware
 		down(&ctrl->crit_sect);
 
 		slot_enable (ctrl, hp_slot);
@@ -1251,35 +1349,34 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 
 		set_SOGO(ctrl);
 
-		// Wait for SOBS to be unset
+		/* Wait for SOBS to be unset */
 		wait_for_ctrl_irq (ctrl);
 
-		// Done with exclusive hardware access
 		up(&ctrl->crit_sect);
 
-		// Wait for ~1 second because of hot plug spec
+		/* Wait for ~1 second because of hot plug spec */
 		long_delay(1*HZ);
 
-		// Check for a power fault
+		/* Check for a power fault */
 		if (func->status == 0xFF) {
-			// power fault occurred, but it was benign
+			/* power fault occurred, but it was benign */
 			rc = POWER_FAILURE;
 			func->status = 0;
 		} else
 			rc = cpqhp_valid_replace(ctrl, func);
 
 		if (!rc) {
-			// It must be the same board
+			/* It must be the same board */
 
 			rc = cpqhp_configure_board(ctrl, func);
 
 			if (rc || src) {
-				// If configuration fails, turn it off
-				// Get slot won't work for devices behind bridges, but
-				// in this case it will always be called for the "base"
-				// bus/dev/func of an adapter.
+				/* If configuration fails, turn it off
+				 * Get slot won't work for devices behind
+				 * bridges, but in this case it will always be
+				 * called for the "base" bus/dev/func of an
+				 * adapter. */
 
-				// Wait for exclusive access to hardware
 				down(&ctrl->crit_sect);
 
 				amber_LED_on (ctrl, hp_slot);
@@ -1288,16 +1385,15 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 
 				set_SOGO(ctrl);
 
-				// Wait for SOBS to be unset
+				/* Wait for SOBS to be unset */
 				wait_for_ctrl_irq (ctrl);
 
-				// Done with exclusive hardware access
 				up(&ctrl->crit_sect);
 
 				if (rc)
-					return(rc);
+					return rc;
 				else
-					return(1);
+					return 1;
 			}
 
 			func->status = 0;
@@ -1310,12 +1406,12 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 			}
 
 			if (rc) {
-				// If configuration fails, turn it off
-				// Get slot won't work for devices behind bridges, but
-				// in this case it will always be called for the "base"
-				// bus/dev/func of an adapter.
+				/* If configuration fails, turn it off
+				 * Get slot won't work for devices behind
+				 * bridges, but in this case it will always be
+				 * called for the "base" bus/dev/func of an
+				 * adapter. */
 
-				// Wait for exclusive access to hardware
 				down(&ctrl->crit_sect);
 
 				amber_LED_on (ctrl, hp_slot);
@@ -1324,37 +1420,33 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 
 				set_SOGO(ctrl);
 
-				// Wait for SOBS to be unset
+				/* Wait for SOBS to be unset */
 				wait_for_ctrl_irq (ctrl);
 
-				// Done with exclusive hardware access
 				up(&ctrl->crit_sect);
 
-				return(rc);
+				return rc;
 			}
-			// Done configuring so turn LED on full time
+			/* Done configuring so turn LED on full time */
 
-			// Wait for exclusive access to hardware
 			down(&ctrl->crit_sect);
 
 			green_LED_on (ctrl, hp_slot);
 
 			set_SOGO(ctrl);
 
-			// Wait for SOBS to be unset
+			/* Wait for SOBS to be unset */
 			wait_for_ctrl_irq (ctrl);
 
-			// Done with exclusive hardware access
 			up(&ctrl->crit_sect);
 			rc = 0;
 		} else {
-			// Something is wrong
+			/* Something is wrong
 
-			// Get slot won't work for devices behind bridges, but
-			// in this case it will always be called for the "base"
-			// bus/dev/func of an adapter.
+			 * Get slot won't work for devices behind bridges, but
+			 * in this case it will always be called for the "base"
+			 * bus/dev/func of an adapter. */
 
-			// Wait for exclusive access to hardware
 			down(&ctrl->crit_sect);
 
 			amber_LED_on (ctrl, hp_slot);
@@ -1363,15 +1455,14 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
 
 			set_SOGO(ctrl);
 
-			// Wait for SOBS to be unset
+			/* Wait for SOBS to be unset */
 			wait_for_ctrl_irq (ctrl);
 
-			// Done with exclusive hardware access
 			up(&ctrl->crit_sect);
 		}
 
 	}
-	return(rc);
+	return rc;
 
 }
 
@@ -1383,7 +1474,7 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
  * Configures board
  *
  */
-static u32 board_added(struct pci_func * func, struct controller * ctrl)
+static u32 board_added(struct pci_func *func, struct controller *ctrl)
 {
 	u8 hp_slot;
 	u8 temp_byte;
@@ -1399,26 +1490,25 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 	dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n",
 	    __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot);
 
-	// Wait for exclusive access to hardware
 	down(&ctrl->crit_sect);
 
-	// turn on board without attaching to the bus
-	enable_slot_power (ctrl, hp_slot);
+	/* turn on board without attaching to the bus */
+	enable_slot_power(ctrl, hp_slot);
 
 	set_SOGO(ctrl);
 
-	// Wait for SOBS to be unset
+	/* Wait for SOBS to be unset */
 	wait_for_ctrl_irq (ctrl);
 
-	// Change bits in slot power register to force another shift out
-	// NOTE: this is to work around the timer bug
+	/* Change bits in slot power register to force another shift out
+	 * NOTE: this is to work around the timer bug */
 	temp_byte = readb(ctrl->hpc_reg + SLOT_POWER);
 	writeb(0x00, ctrl->hpc_reg + SLOT_POWER);
 	writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER);
 
 	set_SOGO(ctrl);
 
-	// Wait for SOBS to be unset
+	/* Wait for SOBS to be unset */
 	wait_for_ctrl_irq (ctrl);
 	
 	adapter_speed = get_adapter_speed(ctrl, hp_slot);
@@ -1426,25 +1516,23 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		if (set_controller_speed(ctrl, adapter_speed, hp_slot))
 			rc = WRONG_BUS_FREQUENCY;
 	
-	// turn off board without attaching to the bus
+	/* turn off board without attaching to the bus */
 	disable_slot_power (ctrl, hp_slot);
 
 	set_SOGO(ctrl);
 
-	// Wait for SOBS to be unset
-	wait_for_ctrl_irq (ctrl);
+	/* Wait for SOBS to be unset */
+	wait_for_ctrl_irq(ctrl);
 
-	// Done with exclusive hardware access
 	up(&ctrl->crit_sect);
 
 	if (rc)
-		return(rc);
+		return rc;
 	
 	p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
 
-	// turn on board and blink green LED
+	/* turn on board and blink green LED */
 
-	// Wait for exclusive access to hardware
 	dbg("%s: before down\n", __FUNCTION__);
 	down(&ctrl->crit_sect);
 	dbg("%s: after down\n", __FUNCTION__);
@@ -1461,47 +1549,46 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 	dbg("%s: before set_SOGO\n", __FUNCTION__);
 	set_SOGO(ctrl);
 
-	// Wait for SOBS to be unset
+	/* Wait for SOBS to be unset */
 	dbg("%s: before wait_for_ctrl_irq\n", __FUNCTION__);
 	wait_for_ctrl_irq (ctrl);
 	dbg("%s: after wait_for_ctrl_irq\n", __FUNCTION__);
 
-	// Done with exclusive hardware access
 	dbg("%s: before up\n", __FUNCTION__);
 	up(&ctrl->crit_sect);
 	dbg("%s: after up\n", __FUNCTION__);
 
-	// Wait for ~1 second because of hot plug spec
+	/* Wait for ~1 second because of hot plug spec */
 	dbg("%s: before long_delay\n", __FUNCTION__);
 	long_delay(1*HZ);
 	dbg("%s: after long_delay\n", __FUNCTION__);
 
 	dbg("%s: func status = %x\n", __FUNCTION__, func->status);
-	// Check for a power fault
+	/* Check for a power fault */
 	if (func->status == 0xFF) {
-		// power fault occurred, but it was benign
+		/* power fault occurred, but it was benign */
 		temp_register = 0xFFFFFFFF;
 		dbg("%s: temp register set to %x by power fault\n", __FUNCTION__, temp_register);
 		rc = POWER_FAILURE;
 		func->status = 0;
 	} else {
-		// Get vendor/device ID u32
+		/* Get vendor/device ID u32 */
 		ctrl->pci_bus->number = func->bus;
 		rc = pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(func->device, func->function), PCI_VENDOR_ID, &temp_register);
 		dbg("%s: pci_read_config_dword returns %d\n", __FUNCTION__, rc);
 		dbg("%s: temp_register is %x\n", __FUNCTION__, temp_register);
 
 		if (rc != 0) {
-			// Something's wrong here
+			/* Something's wrong here */
 			temp_register = 0xFFFFFFFF;
 			dbg("%s: temp register set to %x by error\n", __FUNCTION__, temp_register);
 		}
-		// Preset return code.  It will be changed later if things go okay.
+		/* Preset return code.  It will be changed later if things go okay. */
 		rc = NO_ADAPTER_PRESENT;
 	}
 
-	// All F's is an empty slot or an invalid board
-	if (temp_register != 0xFFFFFFFF) {	  // Check for a board in the slot
+	/* All F's is an empty slot or an invalid board */
+	if (temp_register != 0xFFFFFFFF) {	  /* Check for a board in the slot */
 		res_lists.io_head = ctrl->io_head;
 		res_lists.mem_head = ctrl->mem_head;
 		res_lists.p_mem_head = ctrl->p_mem_head;
@@ -1522,7 +1609,6 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		cpqhp_resource_sort_and_combine(&(ctrl->bus_head));
 
 		if (rc) {
-			// Wait for exclusive access to hardware
 			down(&ctrl->crit_sect);
 
 			amber_LED_on (ctrl, hp_slot);
@@ -1531,12 +1617,11 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 
 			set_SOGO(ctrl);
 
-			// Wait for SOBS to be unset
+			/* Wait for SOBS to be unset */
 			wait_for_ctrl_irq (ctrl);
 
-			// Done with exclusive hardware access
 			up(&ctrl->crit_sect);
-			return(rc);
+			return rc;
 		} else {
 			cpqhp_save_slot_config(ctrl, func);
 		}
@@ -1546,7 +1631,8 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		func->switch_save = 0x10;
 		func->is_a_board = 0x01;
 
-		//next, we will instantiate the linux pci_dev structures (with appropriate driver notification, if already present)
+		/* next, we will instantiate the linux pci_dev structures (with
+		 * appropriate driver notification, if already present) */
 		dbg("%s: configure linux pci_dev structure\n", __FUNCTION__);
 		index = 0;
 		do {
@@ -1556,20 +1642,17 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 			}
 		} while (new_slot);
 
-		// Wait for exclusive access to hardware
 		down(&ctrl->crit_sect);
 
 		green_LED_on (ctrl, hp_slot);
 
 		set_SOGO(ctrl);
 
-		// Wait for SOBS to be unset
+		/* Wait for SOBS to be unset */
 		wait_for_ctrl_irq (ctrl);
 
-		// Done with exclusive hardware access
 		up(&ctrl->crit_sect);
 	} else {
-		// Wait for exclusive access to hardware
 		down(&ctrl->crit_sect);
 
 		amber_LED_on (ctrl, hp_slot);
@@ -1578,13 +1661,12 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 
 		set_SOGO(ctrl);
 
-		// Wait for SOBS to be unset
+		/* Wait for SOBS to be unset */
 		wait_for_ctrl_irq (ctrl);
 
-		// Done with exclusive hardware access
 		up(&ctrl->crit_sect);
 
-		return(rc);
+		return rc;
 	}
 	return 0;
 }
@@ -1605,26 +1687,23 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
 	struct resource_lists res_lists;
 	struct pci_func *temp_func;
 
-	if (func == NULL)
-		return(1);
-
 	if (cpqhp_unconfigure_device(func))
-		return(1);
+		return 1;
 
 	device = func->device;
 
 	hp_slot = func->device - ctrl->slot_device_offset;
 	dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);
 
-	// When we get here, it is safe to change base Address Registers.
-	// We will attempt to save the base Address Register Lengths
+	/* When we get here, it is safe to change base address registers.
+	 * We will attempt to save the base address register lengths */
 	if (replace_flag || !ctrl->add_support)
 		rc = cpqhp_save_base_addr_length(ctrl, func);
 	else if (!func->bus_head && !func->mem_head &&
 		 !func->p_mem_head && !func->io_head) {
-		// Here we check to see if we've saved any of the board's
-		// resources already.  If so, we'll skip the attempt to
-		// determine what's being used.
+		/* Here we check to see if we've saved any of the board's
+		 * resources already.  If so, we'll skip the attempt to
+		 * determine what's being used. */
 		index = 0;
 		temp_func = cpqhp_slot_find(func->bus, func->device, index++);
 		while (temp_func) {
@@ -1639,12 +1718,11 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
 		if (!skip)
 			rc = cpqhp_save_used_resources(ctrl, func);
 	}
-	// Change status to shutdown
+	/* Change status to shutdown */
 	if (func->is_a_board)
 		func->status = 0x01;
 	func->configured = 0;
 
-	// Wait for exclusive access to hardware
 	down(&ctrl->crit_sect);
 
 	green_LED_off (ctrl, hp_slot);
@@ -1652,15 +1730,14 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
 
 	set_SOGO(ctrl);
 
-	// turn off SERR for slot
+	/* turn off SERR for slot */
 	temp_byte = readb(ctrl->hpc_reg + SLOT_SERR);
 	temp_byte &= ~(0x01 << hp_slot);
 	writeb(temp_byte, ctrl->hpc_reg + SLOT_SERR);
 
-	// Wait for SOBS to be unset
+	/* Wait for SOBS to be unset */
 	wait_for_ctrl_irq (ctrl);
 
-	// Done with exclusive hardware access
 	up(&ctrl->crit_sect);
 
 	if (!replace_flag && ctrl->add_support) {
@@ -1690,13 +1767,11 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
 			func = cpqhp_slot_find(ctrl->bus, device, 0);
 		}
 
-		// Setup slot structure with entry for empty slot
+		/* Setup slot structure with entry for empty slot */
 		func = cpqhp_slot_create(ctrl->bus);
 
-		if (func == NULL) {
-			// Out of memory
-			return(1);
-		}
+		if (func == NULL)
+			return 1;
 
 		func->bus = ctrl->bus;
 		func->device = device;
@@ -1710,15 +1785,14 @@ static u32 remove_board(struct pci_func * func, u32 replace_flag, struct control
 	return 0;
 }
 
-
-static void pushbutton_helper_thread (unsigned long data)
+static void pushbutton_helper_thread(unsigned long data)
 {
 	pushbutton_pending = data;
 	up(&event_semaphore);
 }
 
 
-// this is the main worker thread
+/* this is the main worker thread */
 static int event_thread(void* data)
 {
 	struct controller *ctrl;
@@ -1745,7 +1819,7 @@ static int event_thread(void* data)
 }
 
 
-int cpqhp_event_start_thread (void)
+int cpqhp_event_start_thread(void)
 {
 	int pid;
 
@@ -1765,7 +1839,7 @@ int cpqhp_event_start_thread (void)
 }
 
 
-void cpqhp_event_stop_thread (void)
+void cpqhp_event_stop_thread(void)
 {
 	event_finished = 1;
 	dbg("event_thread finish command given\n");
@@ -1775,12 +1849,12 @@ void cpqhp_event_stop_thread (void)
 }
 
 
-static int update_slot_info (struct controller *ctrl, struct slot *slot)
+static int update_slot_info(struct controller *ctrl, struct slot *slot)
 {
 	struct hotplug_slot_info *info;
 	int result;
 
-	info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
+	info = kmalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 
@@ -1805,7 +1879,7 @@ static void interrupt_event_handler(struct controller *ctrl)
 		change = 0;
 
 		for (loop = 0; loop < 10; loop++) {
-			//dbg("loop %d\n", loop);
+			/* dbg("loop %d\n", loop); */
 			if (ctrl->event_queue[loop].event_type != 0) {
 				hp_slot = ctrl->event_queue[loop].hp_slot;
 
@@ -1827,17 +1901,14 @@ static void interrupt_event_handler(struct controller *ctrl)
 					dbg("button cancel\n");
 					del_timer(&p_slot->task_event);
 
-					// Wait for exclusive access to hardware
 					down(&ctrl->crit_sect);
 
 					if (p_slot->state == BLINKINGOFF_STATE) {
-						// slot is on
-						// turn on green LED
+						/* slot is on */
 						dbg("turn on green LED\n");
 						green_LED_on (ctrl, hp_slot);
 					} else if (p_slot->state == BLINKINGON_STATE) {
-						// slot is off
-						// turn off green LED
+						/* slot is off */
 						dbg("turn off green LED\n");
 						green_LED_off (ctrl, hp_slot);
 					}
@@ -1850,28 +1921,24 @@ static void interrupt_event_handler(struct controller *ctrl)
 
 					set_SOGO(ctrl);
 
-					// Wait for SOBS to be unset
+					/* Wait for SOBS to be unset */
 					wait_for_ctrl_irq (ctrl);
 
-					// Done with exclusive hardware access
 					up(&ctrl->crit_sect);
 				}
-				// ***********button Released (No action on press...)
+				/*** button Released (No action on press...) */
 				else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) {
 					dbg("button release\n");
 
 					if (is_slot_enabled (ctrl, hp_slot)) {
-						// slot is on
 						dbg("slot is on\n");
 						p_slot->state = BLINKINGOFF_STATE;
 						info(msg_button_off, p_slot->number);
 					} else {
-						// slot is off
 						dbg("slot is off\n");
 						p_slot->state = BLINKINGON_STATE;
 						info(msg_button_on, p_slot->number);
 					}
-					// Wait for exclusive access to hardware
 					down(&ctrl->crit_sect);
 					
 					dbg("blink green LED and turn off amber\n");
@@ -1881,23 +1948,22 @@ static void interrupt_event_handler(struct controller *ctrl)
 					
 					set_SOGO(ctrl);
 
-					// Wait for SOBS to be unset
+					/* Wait for SOBS to be unset */
 					wait_for_ctrl_irq (ctrl);
 
-					// Done with exclusive hardware access
 					up(&ctrl->crit_sect);
 					init_timer(&p_slot->task_event);
 					p_slot->hp_slot = hp_slot;
 					p_slot->ctrl = ctrl;
-//					p_slot->physical_slot = physical_slot;
-					p_slot->task_event.expires = jiffies + 5 * HZ;   // 5 second delay
+/*					p_slot->physical_slot = physical_slot; */
+					p_slot->task_event.expires = jiffies + 5 * HZ;   /* 5 second delay */
 					p_slot->task_event.function = pushbutton_helper_thread;
 					p_slot->task_event.data = (u32) p_slot;
 
 					dbg("add_timer p_slot = %p\n", p_slot);
 					add_timer(&p_slot->task_event);
 				}
-				// ***********POWER FAULT
+				/***********POWER FAULT */
 				else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) {
 					dbg("power fault\n");
 				} else {
@@ -1910,7 +1976,7 @@ static void interrupt_event_handler(struct controller *ctrl)
 
 				change = 1;
 			}
-		}		// End of FOR loop
+		}		/* End of FOR loop */
 	}
 
 	return;
@@ -1924,7 +1990,7 @@ static void interrupt_event_handler(struct controller *ctrl)
  * Handles all pending events and exits.
  *
  */
-void cpqhp_pushbutton_thread (unsigned long slot)
+void cpqhp_pushbutton_thread(unsigned long slot)
 {
 	u8 hp_slot;
 	u8 device;
@@ -1937,9 +2003,9 @@ void cpqhp_pushbutton_thread (unsigned long slot)
 
 	device = p_slot->device;
 
-	if (is_slot_enabled (ctrl, hp_slot)) {
+	if (is_slot_enabled(ctrl, hp_slot)) {
 		p_slot->state = POWEROFF_STATE;
-		// power Down board
+		/* power Down board */
 		func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0);
 		dbg("In power_down_board, func = %p, ctrl = %p\n", func, ctrl);
 		if (!func) {
@@ -1954,7 +2020,7 @@ void cpqhp_pushbutton_thread (unsigned long slot)
 				
 				set_SOGO(ctrl);
 
-				// Wait for SOBS to be unset
+				/* Wait for SOBS to be unset */
 				wait_for_ctrl_irq (ctrl);
 			}
 		}
@@ -1962,7 +2028,7 @@ void cpqhp_pushbutton_thread (unsigned long slot)
 		p_slot->state = STATIC_STATE;
 	} else {
 		p_slot->state = POWERON_STATE;
-		// slot is off
+		/* slot is off */
 
 		func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0);
 		dbg("In add_board, func = %p, ctrl = %p\n", func, ctrl);
@@ -1973,12 +2039,12 @@ void cpqhp_pushbutton_thread (unsigned long slot)
 
 		if (func != NULL && ctrl != NULL) {
 			if (cpqhp_process_SI(ctrl, func) != 0) {
-				amber_LED_on (ctrl, hp_slot);
-				green_LED_off (ctrl, hp_slot);
+				amber_LED_on(ctrl, hp_slot);
+				green_LED_off(ctrl, hp_slot);
 				
 				set_SOGO(ctrl);
 
-				// Wait for SOBS to be unset
+				/* Wait for SOBS to be unset */
 				wait_for_ctrl_irq (ctrl);
 			}
 		}
@@ -1990,7 +2056,7 @@ void cpqhp_pushbutton_thread (unsigned long slot)
 }
 
 
-int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func)
+int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func)
 {
 	u8 device, hp_slot;
 	u16 temp_word;
@@ -1999,35 +2065,30 @@ int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func)
 	struct slot* p_slot;
 	int physical_slot = 0;
 
-	if (!ctrl)
-		return(1);
-
 	tempdword = 0;
 
 	device = func->device;
 	hp_slot = device - ctrl->slot_device_offset;
 	p_slot = cpqhp_find_slot(ctrl, device);
-	if (p_slot) {
+	if (p_slot)
 		physical_slot = p_slot->number;
-	}
 
-	// Check to see if the interlock is closed
+	/* Check to see if the interlock is closed */
 	tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR);
 
 	if (tempdword & (0x01 << hp_slot)) {
-		return(1);
+		return 1;
 	}
 
 	if (func->is_a_board) {
 		rc = board_replaced(func, ctrl);
 	} else {
-		// add board
+		/* add board */
 		slot_remove(func);
 
 		func = cpqhp_slot_create(ctrl->bus);
-		if (func == NULL) {
-			return(1);
-		}
+		if (func == NULL)
+			return 1;
 
 		func->bus = ctrl->bus;
 		func->device = device;
@@ -2035,7 +2096,7 @@ int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func)
 		func->configured = 0;
 		func->is_a_board = 1;
 
-		// We have to save the presence info for these slots
+		/* We have to save the presence info for these slots */
 		temp_word = ctrl->ctrl_int_comp >> 16;
 		func->presence_save = (temp_word >> hp_slot) & 0x01;
 		func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02;
@@ -2053,13 +2114,11 @@ int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func)
 			} else
 				slot_remove(func);
 
-			// Setup slot structure with entry for empty slot
+			/* Setup slot structure with entry for empty slot */
 			func = cpqhp_slot_create(ctrl->bus);
 
-			if (func == NULL) {
-				// Out of memory
-				return(1);
-			}
+			if (func == NULL)
+				return 1;
 
 			func->bus = ctrl->bus;
 			func->device = device;
@@ -2067,7 +2126,7 @@ int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func)
 			func->configured = 0;
 			func->is_a_board = 0;
 
-			// We have to save the presence info for these slots
+			/* We have to save the presence info for these slots */
 			temp_word = ctrl->ctrl_int_comp >> 16;
 			func->presence_save = (temp_word >> hp_slot) & 0x01;
 			func->presence_save |=
@@ -2092,7 +2151,7 @@ int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func)
 }
 
 
-int cpqhp_process_SS (struct controller *ctrl, struct pci_func *func)
+int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func)
 {
 	u8 device, class_code, header_type, BCR;
 	u8 index = 0;
@@ -2110,12 +2169,12 @@ int cpqhp_process_SS (struct controller *ctrl, struct pci_func *func)
 		physical_slot = p_slot->number;
 	}
 
-	// Make sure there are no video controllers here
+	/* Make sure there are no video controllers here */
 	while (func && !rc) {
 		pci_bus->number = func->bus;
 		devfn = PCI_DEVFN(func->device, func->function);
 
-		// Check the Class Code
+		/* Check the Class Code */
 		rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);
 		if (rc)
 			return rc;
@@ -2124,18 +2183,19 @@ int cpqhp_process_SS (struct controller *ctrl, struct pci_func *func)
 			/* Display/Video adapter (not supported) */
 			rc = REMOVE_NOT_SUPPORTED;
 		} else {
-			// See if it's a bridge
+			/* See if it's a bridge */
 			rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
 			if (rc)
 				return rc;
 
-			// If it's a bridge, check the VGA Enable bit
+			/* If it's a bridge, check the VGA Enable bit */
 			if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
 				rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_BRIDGE_CONTROL, &BCR);
 				if (rc)
 					return rc;
 
-				// If the VGA Enable bit is set, remove isn't supported
+				/* If the VGA Enable bit is set, remove isn't
+				 * supported */
 				if (BCR & PCI_BRIDGE_CTL_VGA) {
 					rc = REMOVE_NOT_SUPPORTED;
 				}
@@ -2147,7 +2207,7 @@ int cpqhp_process_SS (struct controller *ctrl, struct pci_func *func)
 
 	func = cpqhp_slot_find(ctrl->bus, device, 0);
 	if ((func != NULL) && !rc) {
-		//FIXME: Replace flag should be passed into process_SS
+		/* FIXME: Replace flag should be passed into process_SS */
 		replace_flag = !(ctrl->add_support);
 		rc = remove_board(func, replace_flag, ctrl);
 	} else if (!rc) {
@@ -2157,16 +2217,42 @@ int cpqhp_process_SS (struct controller *ctrl, struct pci_func *func)
 	if (p_slot)
 		update_slot_info(ctrl, p_slot);
 
-	return(rc);
+	return rc;
 }
 
+/**
+ * switch_leds: switch the leds, go from one site to the other.
+ * @ctrl: controller to use
+ * @num_of_slots: number of slots to use
+ * @direction: 1 to start from the left side, 0 to start right.
+ */
+static void switch_leds(struct controller *ctrl, const int num_of_slots,
+			u32 *work_LED, const int direction)
+{
+	int loop;
+
+	for (loop = 0; loop < num_of_slots; loop++) {
+		if (direction)
+			*work_LED = *work_LED >> 1;
+		else
+			*work_LED = *work_LED << 1;
+		writel(*work_LED, ctrl->hpc_reg + LED_CONTROL);
+
+		set_SOGO(ctrl);
+
+		/* Wait for SOGO interrupt */
+		wait_for_ctrl_irq(ctrl);
 
+		/* Get ready for next iteration */
+		long_delay((2*HZ)/10);
+	}
+}
 
 /**
  * hardware_test - runs hardware tests
  *
  * For hot plug ctrl folks to play with.
- * test_num is the number entered in the GUI
+ * test_num is the number written to the "test" file in sysfs
  *
  */
 int cpqhp_hardware_test(struct controller *ctrl, int test_num)
@@ -2180,132 +2266,45 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num)
 
 	switch (test_num) {
 		case 1:
-			// Do stuff here!
+			/* Do stuff here! */
 
-			// Do that funky LED thing
-			save_LED = readl(ctrl->hpc_reg + LED_CONTROL);	// so we can restore them later
+			/* Do that funky LED thing */
+			/* so we can restore them later */
+			save_LED = readl(ctrl->hpc_reg + LED_CONTROL);
 			work_LED = 0x01010101;
-			writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-			for (loop = 0; loop < num_of_slots; loop++) {
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				work_LED = work_LED << 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				long_delay((2*HZ)/10);
-			}
-			for (loop = 0; loop < num_of_slots; loop++) {
-				work_LED = work_LED >> 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				long_delay((2*HZ)/10);
-			}
-			for (loop = 0; loop < num_of_slots; loop++) {
-				work_LED = work_LED << 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				long_delay((2*HZ)/10);
-			}
-			for (loop = 0; loop < num_of_slots; loop++) {
-				work_LED = work_LED >> 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				long_delay((2*HZ)/10);
-			}
+			switch_leds(ctrl, num_of_slots, &work_LED, 0);
+			switch_leds(ctrl, num_of_slots, &work_LED, 1);
+			switch_leds(ctrl, num_of_slots, &work_LED, 0);
+			switch_leds(ctrl, num_of_slots, &work_LED, 1);
 
 			work_LED = 0x01010000;
 			writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-			for (loop = 0; loop < num_of_slots; loop++) {
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				work_LED = work_LED << 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				long_delay((2*HZ)/10);
-			}
-			for (loop = 0; loop < num_of_slots; loop++) {
-				work_LED = work_LED >> 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				long_delay((2*HZ)/10);
-			}
+			switch_leds(ctrl, num_of_slots, &work_LED, 0);
+			switch_leds(ctrl, num_of_slots, &work_LED, 1);
 			work_LED = 0x00000101;
 			writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-			for (loop = 0; loop < num_of_slots; loop++) {
-				work_LED = work_LED << 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				long_delay((2*HZ)/10);
-			}
-			for (loop = 0; loop < num_of_slots; loop++) {
-				work_LED = work_LED >> 1;
-				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
-				
-				set_SOGO(ctrl);
-
-				// Wait for SOGO interrupt
-				wait_for_ctrl_irq (ctrl);
-
-				// Get ready for next iteration
-				long_delay((2*HZ)/10);
-			}
-
+			switch_leds(ctrl, num_of_slots, &work_LED, 0);
+			switch_leds(ctrl, num_of_slots, &work_LED, 1);
 
 			work_LED = 0x01010000;
 			writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
 			for (loop = 0; loop < num_of_slots; loop++) {
 				set_SOGO(ctrl);
 
-				// Wait for SOGO interrupt
+				/* Wait for SOGO interrupt */
 				wait_for_ctrl_irq (ctrl);
 
-				// Get ready for next iteration
+				/* Get ready for next iteration */
 				long_delay((3*HZ)/10);
 				work_LED = work_LED >> 16;
 				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
 				
 				set_SOGO(ctrl);
 
-				// Wait for SOGO interrupt
+				/* Wait for SOGO interrupt */
 				wait_for_ctrl_irq (ctrl);
 
-				// Get ready for next iteration
+				/* Get ready for next iteration */
 				long_delay((3*HZ)/10);
 				work_LED = work_LED << 16;
 				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
@@ -2313,18 +2312,19 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num)
 				writel(work_LED, ctrl->hpc_reg + LED_CONTROL);
 			}
 
-			writel (save_LED, ctrl->hpc_reg + LED_CONTROL);	// put it back the way it was
+			/* put it back the way it was */
+			writel(save_LED, ctrl->hpc_reg + LED_CONTROL);
 
 			set_SOGO(ctrl);
 
-			// Wait for SOBS to be unset
+			/* Wait for SOBS to be unset */
 			wait_for_ctrl_irq (ctrl);
 			break;
 		case 2:
-			// Do other stuff here!
+			/* Do other stuff here! */
 			break;
 		case 3:
-			// and more...
+			/* and more... */
 			break;
 	}
 	return 0;
@@ -2342,7 +2342,7 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num)
  * Returns 0 if success
  *
  */
-static u32 configure_new_device (struct controller * ctrl, struct pci_func * func,
+static u32 configure_new_device(struct controller * ctrl, struct pci_func * func,
 				 u8 behind_bridge, struct resource_lists * resources)
 {
 	u8 temp_byte, function, max_functions, stop_it;
@@ -2354,7 +2354,7 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
 	new_slot = func;
 
 	dbg("%s\n", __FUNCTION__);
-	// Check for Multi-function device
+	/* Check for Multi-function device */
 	ctrl->pci_bus->number = func->bus;
 	rc = pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp_byte);
 	if (rc) {
@@ -2362,7 +2362,7 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
 		return rc;
 	}
 
-	if (temp_byte & 0x80)	// Multi-function device
+	if (temp_byte & 0x80)	/* Multi-function device */
 		max_functions = 8;
 	else
 		max_functions = 1;
@@ -2383,29 +2383,27 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
 					cpqhp_return_board_resources(new_slot, resources);
 			}
 
-			return(rc);
+			return rc;
 		}
 
 		function++;
 
 		stop_it = 0;
 
-		//  The following loop skips to the next present function
-		//  and creates a board structure
+		/* The following loop skips to the next present function
+		 * and creates a board structure */
 
 		while ((function < max_functions) && (!stop_it)) {
 			pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID);
 
-			if (ID == 0xFFFFFFFF) {	  // There's nothing there. 
+			if (ID == 0xFFFFFFFF) {	  /* There's nothing there. */
 				function++;
-			} else {  // There's something there
-				// Setup slot structure.
+			} else {  /* There's something there */
+				/* Setup slot structure. */
 				new_slot = cpqhp_slot_create(func->bus);
 
-				if (new_slot == NULL) {
-					// Out of memory
-					return(1);
-				}
+				if (new_slot == NULL)
+					return 1;
 
 				new_slot->bus = func->bus;
 				new_slot->device = func->device;
@@ -2442,8 +2440,9 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
  * Returns 0 if success
  *
  */
-static int configure_new_function (struct controller * ctrl, struct pci_func * func,
-				   u8 behind_bridge, struct resource_lists * resources)
+static int configure_new_function(struct controller *ctrl, struct pci_func *func,
+				   u8 behind_bridge,
+				   struct resource_lists *resources)
 {
 	int cloop;
 	u8 IRQ = 0;
@@ -2475,57 +2474,56 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 	pci_bus->number = func->bus;
 	devfn = PCI_DEVFN(func->device, func->function);
 
-	// Check for Bridge
-	rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte);
+	/* Check for Bridge */
+	rc = pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte);
 	if (rc)
 		return rc;
 
-	if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge
-		// set Primary bus
+	if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */
+		/* set Primary bus */
 		dbg("set Primary bus = %d\n", func->bus);
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_PRIMARY_BUS, func->bus);
+		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus);
 		if (rc)
 			return rc;
 
-		// find range of busses to use
+		/* find range of busses to use */
 		dbg("find ranges of buses to use\n");
-		bus_node = get_max_resource(&resources->bus_head, 1);
+		bus_node = get_max_resource(&(resources->bus_head), 1);
 
-		// If we don't have any busses to allocate, we can't continue
+		/* If we don't have any busses to allocate, we can't continue */
 		if (!bus_node)
 			return -ENOMEM;
 
-		// set Secondary bus
+		/* set Secondary bus */
 		temp_byte = bus_node->base;
 		dbg("set Secondary bus = %d\n", bus_node->base);
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte);
 		if (rc)
 			return rc;
 
-		// set subordinate bus
+		/* set subordinate bus */
 		temp_byte = bus_node->base + bus_node->length - 1;
 		dbg("set subordinate bus = %d\n", bus_node->base + bus_node->length - 1);
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
 		if (rc)
 			return rc;
 
-		// set subordinate Latency Timer and base Latency Timer
+		/* set subordinate Latency Timer and base Latency Timer */
 		temp_byte = 0x40;
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SEC_LATENCY_TIMER, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SEC_LATENCY_TIMER, temp_byte);
 		if (rc)
 			return rc;
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_LATENCY_TIMER, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_LATENCY_TIMER, temp_byte);
 		if (rc)
 			return rc;
 
-		// set Cache Line size
+		/* set Cache Line size */
 		temp_byte = 0x08;
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_CACHE_LINE_SIZE, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_CACHE_LINE_SIZE, temp_byte);
 		if (rc)
 			return rc;
 
-		// Setup the IO, memory, and prefetchable windows
-
+		/* Setup the IO, memory, and prefetchable windows */
 		io_node = get_max_resource(&(resources->io_head), 0x1000);
 		if (!io_node)
 			return -ENOMEM;
@@ -2537,13 +2535,16 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			return -ENOMEM;
 		dbg("Setup the IO, memory, and prefetchable windows\n");
 		dbg("io_node\n");
-		dbg("(base, len, next) (%x, %x, %p)\n", io_node->base, io_node->length, io_node->next);
+		dbg("(base, len, next) (%x, %x, %p)\n", io_node->base,
+					io_node->length, io_node->next);
 		dbg("mem_node\n");
-		dbg("(base, len, next) (%x, %x, %p)\n", mem_node->base, mem_node->length, mem_node->next);
+		dbg("(base, len, next) (%x, %x, %p)\n", mem_node->base,
+					mem_node->length, mem_node->next);
 		dbg("p_mem_node\n");
-		dbg("(base, len, next) (%x, %x, %p)\n", p_mem_node->base, p_mem_node->length, p_mem_node->next);
+		dbg("(base, len, next) (%x, %x, %p)\n", p_mem_node->base,
+					p_mem_node->length, p_mem_node->next);
 
-		// set up the IRQ info
+		/* set up the IRQ info */
 		if (!resources->irqs) {
 			irqs.barber_pole = 0;
 			irqs.interrupt[0] = 0;
@@ -2560,32 +2561,28 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			irqs.valid_INT = resources->irqs->valid_INT;
 		}
 
-		// set up resource lists that are now aligned on top and bottom
-		// for anything behind the bridge.
+		/* set up resource lists that are now aligned on top and bottom
+		 * for anything behind the bridge. */
 		temp_resources.bus_head = bus_node;
 		temp_resources.io_head = io_node;
 		temp_resources.mem_head = mem_node;
 		temp_resources.p_mem_head = p_mem_node;
 		temp_resources.irqs = &irqs;
 
-		// Make copies of the nodes we are going to pass down so that
-		// if there is a problem,we can just use these to free resources
-		hold_bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_IO_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+		/* Make copies of the nodes we are going to pass down so that
+		 * if there is a problem,we can just use these to free resources */
+		hold_bus_node = kmalloc(sizeof(*hold_bus_node), GFP_KERNEL);
+		hold_IO_node = kmalloc(sizeof(*hold_IO_node), GFP_KERNEL);
+		hold_mem_node = kmalloc(sizeof(*hold_mem_node), GFP_KERNEL);
+		hold_p_mem_node = kmalloc(sizeof(*hold_p_mem_node), GFP_KERNEL);
 
 		if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) {
-			if (hold_bus_node)
-				kfree(hold_bus_node);
-			if (hold_IO_node)
-				kfree(hold_IO_node);
-			if (hold_mem_node)
-				kfree(hold_mem_node);
-			if (hold_p_mem_node)
-				kfree(hold_p_mem_node);
-
-			return(1);
+			kfree(hold_bus_node);
+			kfree(hold_IO_node);
+			kfree(hold_mem_node);
+			kfree(hold_p_mem_node);
+
+			return 1;
 		}
 
 		memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource));
@@ -2594,55 +2591,55 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 		bus_node->length -= 1;
 		bus_node->next = NULL;
 
-		// If we have IO resources copy them and fill in the bridge's
-		// IO range registers
+		/* If we have IO resources copy them and fill in the bridge's
+		 * IO range registers */
 		if (io_node) {
 			memcpy(hold_IO_node, io_node, sizeof(struct pci_resource));
 			io_node->next = NULL;
 
-			// set IO base and Limit registers
+			/* set IO base and Limit registers */
 			temp_byte = io_node->base >> 8;
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte);
+			rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_BASE, temp_byte);
 
 			temp_byte = (io_node->base + io_node->length - 1) >> 8;
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
+			rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
 		} else {
 			kfree(hold_IO_node);
 			hold_IO_node = NULL;
 		}
 
-		// If we have memory resources copy them and fill in the bridge's
-		// memory range registers.  Otherwise, fill in the range
-		// registers with values that disable them.
+		/* If we have memory resources copy them and fill in the
+		 * bridge's memory range registers.  Otherwise, fill in the
+		 * range registers with values that disable them. */
 		if (mem_node) {
 			memcpy(hold_mem_node, mem_node, sizeof(struct pci_resource));
 			mem_node->next = NULL;
 
-			// set Mem base and Limit registers
+			/* set Mem base and Limit registers */
 			temp_word = mem_node->base >> 16;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
 
 			temp_word = (mem_node->base + mem_node->length - 1) >> 16;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 		} else {
 			temp_word = 0xFFFF;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
 
 			temp_word = 0x0000;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 
 			kfree(hold_mem_node);
 			hold_mem_node = NULL;
 		}
 
-		// If we have prefetchable memory resources copy them and 
-		// fill in the bridge's memory range registers.  Otherwise,
-		// fill in the range registers with values that disable them.
+		/* If we have prefetchable memory resources copy them and 
+		 * fill in the bridge's memory range registers.  Otherwise,
+		 * fill in the range registers with values that disable them. */
 		if (p_mem_node) {
 			memcpy(hold_p_mem_node, p_mem_node, sizeof(struct pci_resource));
 			p_mem_node->next = NULL;
 
-			// set Pre Mem base and Limit registers
+			/* set Pre Mem base and Limit registers */
 			temp_word = p_mem_node->base >> 16;
 			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
 
@@ -2659,12 +2656,12 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			hold_p_mem_node = NULL;
 		}
 
-		// Adjust this to compensate for extra adjustment in first loop
+		/* Adjust this to compensate for extra adjustment in first loop */
 		irqs.barber_pole--;
 
 		rc = 0;
 
-		// Here we actually find the devices and configure them
+		/* Here we actually find the devices and configure them */
 		for (device = 0; (device <= 0x1F) && !rc; device++) {
 			irqs.barber_pole = (irqs.barber_pole + 1) & 0x03;
 
@@ -2673,12 +2670,11 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), 0x00, &ID);
 			pci_bus->number = func->bus;
 
-			if (ID != 0xFFFFFFFF) {	  //  device Present
-				// Setup slot structure.
+			if (ID != 0xFFFFFFFF) {	  /*  device present */
+				/* Setup slot structure. */
 				new_slot = cpqhp_slot_create(hold_bus_node->base);
 
 				if (new_slot == NULL) {
-					// Out of memory
 					rc = -ENOMEM;
 					continue;
 				}
@@ -2691,19 +2687,12 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 				rc = configure_new_device(ctrl, new_slot, 1, &temp_resources);
 				dbg("configure_new_device rc=0x%x\n",rc);
-			}	// End of IF (device in slot?)
-		}		// End of FOR loop
-
-		if (rc) {
-			cpqhp_destroy_resource_list(&temp_resources);
+			}	/* End of IF (device in slot?) */
+		}		/* End of FOR loop */
 
-			return_resource(&(resources->bus_head), hold_bus_node);
-			return_resource(&(resources->io_head), hold_IO_node);
-			return_resource(&(resources->mem_head), hold_mem_node);
-			return_resource(&(resources->p_mem_head), hold_p_mem_node);
-			return(rc);
-		}
-		// save the interrupt routing information
+		if (rc)
+			goto free_and_out;
+		/* save the interrupt routing information */
 		if (resources->irqs) {
 			resources->irqs->interrupt[0] = irqs.interrupt[0];
 			resources->irqs->interrupt[1] = irqs.interrupt[1];
@@ -2711,25 +2700,19 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			resources->irqs->interrupt[3] = irqs.interrupt[3];
 			resources->irqs->valid_INT = irqs.valid_INT;
 		} else if (!behind_bridge) {
-			// We need to hook up the interrupts here
+			/* We need to hook up the interrupts here */
 			for (cloop = 0; cloop < 4; cloop++) {
 				if (irqs.valid_INT & (0x01 << cloop)) {
 					rc = cpqhp_set_irq(func->bus, func->device,
 							   0x0A + cloop, irqs.interrupt[cloop]);
-					if (rc) {
-						cpqhp_destroy_resource_list (&temp_resources);
-
-						return_resource(&(resources-> bus_head), hold_bus_node);
-						return_resource(&(resources-> io_head), hold_IO_node);
-						return_resource(&(resources-> mem_head), hold_mem_node);
-						return_resource(&(resources-> p_mem_head), hold_p_mem_node);
-						return rc;
-					}
+					if (rc)
+						goto free_and_out;
 				}
-			}	// end of for loop
+			}	/* end of for loop */
 		}
-		// Return unused bus resources
-		// First use the temporary node to store information for the board
+		/* Return unused bus resources
+		 * First use the temporary node to store information for
+		 * the board */
 		if (hold_bus_node && bus_node && temp_resources.bus_head) {
 			hold_bus_node->length = bus_node->base - hold_bus_node->base;
 
@@ -2738,7 +2721,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 			temp_byte = temp_resources.bus_head->base - 1;
 
-			// set subordinate bus
+			/* set subordinate bus */
 			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
 
 			if (temp_resources.bus_head->length == 0) {
@@ -2749,13 +2732,13 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			}
 		}
 
-		// If we have IO space available and there is some left,
-		// return the unused portion
+		/* If we have IO space available and there is some left,
+		 * return the unused portion */
 		if (hold_IO_node && temp_resources.io_head) {
 			io_node = do_pre_bridge_resource_split(&(temp_resources.io_head),
 							       &hold_IO_node, 0x1000);
 
-			// Check if we were able to split something off
+			/* Check if we were able to split something off */
 			if (io_node) {
 				hold_IO_node->base = io_node->base + io_node->length;
 
@@ -2767,12 +2750,13 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 			io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000);
 
-			// Check if we were able to split something off
+			/* Check if we were able to split something off */
 			if (io_node) {
-				// First use the temporary node to store information for the board
+				/* First use the temporary node to store
+				 * information for the board */
 				hold_IO_node->length = io_node->base - hold_IO_node->base;
 
-				// If we used any, add it to the board's list
+				/* If we used any, add it to the board's list */
 				if (hold_IO_node->length) {
 					hold_IO_node->next = func->io_head;
 					func->io_head = hold_IO_node;
@@ -2782,7 +2766,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 					return_resource(&(resources->io_head), io_node);
 				} else {
-					// it doesn't need any IO
+					/* it doesn't need any IO */
 					temp_word = 0x0000;
 					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_IO_LIMIT, temp_word);
 
@@ -2790,22 +2774,22 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					kfree(hold_IO_node);
 				}
 			} else {
-				// it used most of the range
+				/* it used most of the range */
 				hold_IO_node->next = func->io_head;
 				func->io_head = hold_IO_node;
 			}
 		} else if (hold_IO_node) {
-			// it used the whole range
+			/* it used the whole range */
 			hold_IO_node->next = func->io_head;
 			func->io_head = hold_IO_node;
 		}
-		// If we have memory space available and there is some left,
-		// return the unused portion
+		/* If we have memory space available and there is some left,
+		 * return the unused portion */
 		if (hold_mem_node && temp_resources.mem_head) {
 			mem_node = do_pre_bridge_resource_split(&(temp_resources.  mem_head),
 								&hold_mem_node, 0x100000);
 
-			// Check if we were able to split something off
+			/* Check if we were able to split something off */
 			if (mem_node) {
 				hold_mem_node->base = mem_node->base + mem_node->length;
 
@@ -2817,23 +2801,24 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 			mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000);
 
-			// Check if we were able to split something off
+			/* Check if we were able to split something off */
 			if (mem_node) {
-				// First use the temporary node to store information for the board
+				/* First use the temporary node to store
+				 * information for the board */
 				hold_mem_node->length = mem_node->base - hold_mem_node->base;
 
 				if (hold_mem_node->length) {
 					hold_mem_node->next = func->mem_head;
 					func->mem_head = hold_mem_node;
 
-					// configure end address
+					/* configure end address */
 					temp_word = (mem_node->base - 1) >> 16;
 					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 
-					// Return unused resources to the pool
+					/* Return unused resources to the pool */
 					return_resource(&(resources->mem_head), mem_node);
 				} else {
-					// it doesn't need any Mem
+					/* it doesn't need any Mem */
 					temp_word = 0x0000;
 					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 
@@ -2841,22 +2826,22 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					kfree(hold_mem_node);
 				}
 			} else {
-				// it used most of the range
+				/* it used most of the range */
 				hold_mem_node->next = func->mem_head;
 				func->mem_head = hold_mem_node;
 			}
 		} else if (hold_mem_node) {
-			// it used the whole range
+			/* it used the whole range */
 			hold_mem_node->next = func->mem_head;
 			func->mem_head = hold_mem_node;
 		}
-		// If we have prefetchable memory space available and there is some 
-		// left at the end, return the unused portion
+		/* If we have prefetchable memory space available and there
+		 * is some left at the end, return the unused portion */
 		if (hold_p_mem_node && temp_resources.p_mem_head) {
 			p_mem_node = do_pre_bridge_resource_split(&(temp_resources.p_mem_head),
 								  &hold_p_mem_node, 0x100000);
 
-			// Check if we were able to split something off
+			/* Check if we were able to split something off */
 			if (p_mem_node) {
 				hold_p_mem_node->base = p_mem_node->base + p_mem_node->length;
 
@@ -2868,12 +2853,13 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 			p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000);
 
-			// Check if we were able to split something off
+			/* Check if we were able to split something off */
 			if (p_mem_node) {
-				// First use the temporary node to store information for the board
+				/* First use the temporary node to store
+				 * information for the board */
 				hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base;
 
-				// If we used any, add it to the board's list
+				/* If we used any, add it to the board's list */
 				if (hold_p_mem_node->length) {
 					hold_p_mem_node->next = func->p_mem_head;
 					func->p_mem_head = hold_p_mem_node;
@@ -2883,7 +2869,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 					return_resource(&(resources->p_mem_head), p_mem_node);
 				} else {
-					// it doesn't need any PMem
+					/* it doesn't need any PMem */
 					temp_word = 0x0000;
 					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
 
@@ -2891,35 +2877,42 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					kfree(hold_p_mem_node);
 				}
 			} else {
-				// it used the most of the range
+				/* it used the most of the range */
 				hold_p_mem_node->next = func->p_mem_head;
 				func->p_mem_head = hold_p_mem_node;
 			}
 		} else if (hold_p_mem_node) {
-			// it used the whole range
+			/* it used the whole range */
 			hold_p_mem_node->next = func->p_mem_head;
 			func->p_mem_head = hold_p_mem_node;
 		}
-		// We should be configuring an IRQ and the bridge's base address
-		// registers if it needs them.  Although we have never seen such
-		// a device
-
-		// enable card
-		command = 0x0157;	// = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |  PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR
+		/* We should be configuring an IRQ and the bridge's base address
+		 * registers if it needs them.  Although we have never seen such
+		 * a device */
+
+		/* enable card */
+		command = 0x0157;	/* = PCI_COMMAND_IO |
+					 *   PCI_COMMAND_MEMORY |
+					 *   PCI_COMMAND_MASTER |
+					 *   PCI_COMMAND_INVALIDATE |
+					 *   PCI_COMMAND_PARITY |
+					 *   PCI_COMMAND_SERR */
 		rc = pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, command);
 
-		// set Bridge Control Register
-		command = 0x07;		// = PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR | PCI_BRIDGE_CTL_NO_ISA
+		/* set Bridge Control Register */
+		command = 0x07;		/* = PCI_BRIDGE_CTL_PARITY |
+					 *   PCI_BRIDGE_CTL_SERR |
+					 *   PCI_BRIDGE_CTL_NO_ISA */
 		rc = pci_bus_write_config_word (pci_bus, devfn, PCI_BRIDGE_CONTROL, command);
 	} else if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_NORMAL) {
-		// Standard device
+		/* Standard device */
 		rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);
 
 		if (class_code == PCI_BASE_CLASS_DISPLAY) {
-			// Display (video) adapter (not supported)
-			return(DEVICE_TYPE_NOT_SUPPORTED);
+			/* Display (video) adapter (not supported) */
+			return DEVICE_TYPE_NOT_SUPPORTED;
 		}
-		// Figure out IO and memory needs
+		/* Figure out IO and memory needs */
 		for (cloop = 0x10; cloop <= 0x24; cloop += 4) {
 			temp_register = 0xFFFFFFFF;
 
@@ -2929,11 +2922,11 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			rc = pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp_register);
 			dbg("CND: base = 0x%x\n", temp_register);
 
-			if (temp_register) {	  // If this register is implemented
+			if (temp_register) {	  /* If this register is implemented */
 				if ((temp_register & 0x03L) == 0x01) {
-					// Map IO
+					/* Map IO */
 
-					// set base = amount of IO space
+					/* set base = amount of IO space */
 					base = temp_register & 0xFFFFFFFC;
 					base = ~base + 1;
 
@@ -2943,7 +2936,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					    io_node->base, io_node->length, io_node->next);
 					dbg("func (%p) io_head (%p)\n", func, func->io_head);
 
-					// allocate the resource to the board
+					/* allocate the resource to the board */
 					if (io_node) {
 						base = io_node->base;
 
@@ -2952,14 +2945,14 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					} else
 						return -ENOMEM;
 				} else if ((temp_register & 0x0BL) == 0x08) {
-					// Map prefetchable memory
+					/* Map prefetchable memory */
 					base = temp_register & 0xFFFFFFF0;
 					base = ~base + 1;
 
 					dbg("CND:      length = 0x%x\n", base);
 					p_mem_node = get_resource(&(resources->p_mem_head), base);
 
-					// allocate the resource to the board
+					/* allocate the resource to the board */
 					if (p_mem_node) {
 						base = p_mem_node->base;
 
@@ -2968,14 +2961,14 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					} else
 						return -ENOMEM;
 				} else if ((temp_register & 0x0BL) == 0x00) {
-					// Map memory
+					/* Map memory */
 					base = temp_register & 0xFFFFFFF0;
 					base = ~base + 1;
 
 					dbg("CND:      length = 0x%x\n", base);
 					mem_node = get_resource(&(resources->mem_head), base);
 
-					// allocate the resource to the board
+					/* allocate the resource to the board */
 					if (mem_node) {
 						base = mem_node->base;
 
@@ -2984,14 +2977,14 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					} else
 						return -ENOMEM;
 				} else if ((temp_register & 0x0BL) == 0x04) {
-					// Map memory
+					/* Map memory */
 					base = temp_register & 0xFFFFFFF0;
 					base = ~base + 1;
 
 					dbg("CND:      length = 0x%x\n", base);
 					mem_node = get_resource(&(resources->mem_head), base);
 
-					// allocate the resource to the board
+					/* allocate the resource to the board */
 					if (mem_node) {
 						base = mem_node->base;
 
@@ -3000,42 +2993,44 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					} else
 						return -ENOMEM;
 				} else if ((temp_register & 0x0BL) == 0x06) {
-					// Those bits are reserved, we can't handle this
-					return(1);
+					/* Those bits are reserved, we can't handle this */
+					return 1;
 				} else {
-					// Requesting space below 1M
-					return(NOT_ENOUGH_RESOURCES);
+					/* Requesting space below 1M */
+					return NOT_ENOUGH_RESOURCES;
 				}
 
-				rc = pci_bus_write_config_dword (pci_bus, devfn, cloop, base);
+				rc = pci_bus_write_config_dword(pci_bus, devfn, cloop, base);
 
-				// Check for 64-bit base
+				/* Check for 64-bit base */
 				if ((temp_register & 0x07L) == 0x04) {
 					cloop += 4;
 
-					// Upper 32 bits of address always zero on today's systems
-					// FIXME this is probably not true on Alpha and ia64???
+					/* Upper 32 bits of address always zero
+					 * on today's systems */
+					/* FIXME this is probably not true on
+					 * Alpha and ia64??? */
 					base = 0;
-					rc = pci_bus_write_config_dword (pci_bus, devfn, cloop, base);
+					rc = pci_bus_write_config_dword(pci_bus, devfn, cloop, base);
 				}
 			}
-		}		// End of base register loop
+		}		/* End of base register loop */
 		if (cpqhp_legacy_mode) {
-			// Figure out which interrupt pin this function uses
+			/* Figure out which interrupt pin this function uses */
 			rc = pci_bus_read_config_byte (pci_bus, devfn, 
 				PCI_INTERRUPT_PIN, &temp_byte);
 
-			// If this function needs an interrupt and we are behind a bridge
-			// and the pin is tied to something that's alread mapped,
-			// set this one the same
+			/* If this function needs an interrupt and we are behind
+			 * a bridge and the pin is tied to something that's
+			 * alread mapped, set this one the same */
 			if (temp_byte && resources->irqs && 
 			    (resources->irqs->valid_INT & 
 			     (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) {
-				// We have to share with something already set up
+				/* We have to share with something already set up */
 				IRQ = resources->irqs->interrupt[(temp_byte + 
 					resources->irqs->barber_pole - 1) & 0x03];
 			} else {
-				// Program IRQ based on card type
+				/* Program IRQ based on card type */
 				rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);
 
 				if (class_code == PCI_BASE_CLASS_STORAGE) {
@@ -3045,43 +3040,59 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 				}
 			}
 
-			// IRQ Line
+			/* IRQ Line */
 			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ);
 		}
 
 		if (!behind_bridge) {
 			rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ);
 			if (rc)
-				return(1);
+				return 1;
 		} else {
-			//TBD - this code may also belong in the other clause of this If statement
+			/* TBD - this code may also belong in the other clause
+			 * of this If statement */
 			resources->irqs->interrupt[(temp_byte + resources->irqs->barber_pole - 1) & 0x03] = IRQ;
 			resources->irqs->valid_INT |= 0x01 << (temp_byte + resources->irqs->barber_pole - 1) & 0x03;
 		}
 
-		// Latency Timer
+		/* Latency Timer */
 		temp_byte = 0x40;
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_LATENCY_TIMER, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn,
+					PCI_LATENCY_TIMER, temp_byte);
 
-		// Cache Line size
+		/* Cache Line size */
 		temp_byte = 0x08;
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_CACHE_LINE_SIZE, temp_byte);
+		rc = pci_bus_write_config_byte(pci_bus, devfn,
+					PCI_CACHE_LINE_SIZE, temp_byte);
 
-		// disable ROM base Address
+		/* disable ROM base Address */
 		temp_dword = 0x00L;
-		rc = pci_bus_write_config_word (pci_bus, devfn, PCI_ROM_ADDRESS, temp_dword);
-
-		// enable card
-		temp_word = 0x0157;	// = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |  PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR
-		rc = pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, temp_word);
-	}			// End of Not-A-Bridge else
-	else {
-		// It's some strange type of PCI adapter (Cardbus?)
-		return(DEVICE_TYPE_NOT_SUPPORTED);
+		rc = pci_bus_write_config_word(pci_bus, devfn,
+					PCI_ROM_ADDRESS, temp_dword);
+
+		/* enable card */
+		temp_word = 0x0157;	/* = PCI_COMMAND_IO |
+					 *   PCI_COMMAND_MEMORY |
+					 *   PCI_COMMAND_MASTER |
+					 *   PCI_COMMAND_INVALIDATE |
+					 *   PCI_COMMAND_PARITY |
+					 *   PCI_COMMAND_SERR */
+		rc = pci_bus_write_config_word (pci_bus, devfn,
+					PCI_COMMAND, temp_word);
+	} else {		/* End of Not-A-Bridge else */
+		/* It's some strange type of PCI adapter (Cardbus?) */
+		return DEVICE_TYPE_NOT_SUPPORTED;
 	}
 
 	func->configured = 1;
 
 	return 0;
-}
+free_and_out:
+	cpqhp_destroy_resource_list (&temp_resources);
 
+	return_resource(&(resources-> bus_head), hold_bus_node);
+	return_resource(&(resources-> io_head), hold_IO_node);
+	return_resource(&(resources-> mem_head), hold_mem_node);
+	return_resource(&(resources-> p_mem_head), hold_p_mem_node);
+	return rc;
+}
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index 72bb256aa..bde394f72 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -722,23 +722,23 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 		devfn = PCI_DEVFN(func->device, func->function);
 
 		// Save the command register
-		pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command);
+		pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command);
 
 		// disable card
 		command = 0x00;
-		pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, command);
+		pci_bus_write_config_word(pci_bus, devfn, PCI_COMMAND, command);
 
 		// Check for Bridge
-		pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
+		pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
 
 		if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {	  // PCI-PCI Bridge
 			// Clear Bridge Control Register
 			command = 0x00;
-			pci_bus_write_config_word (pci_bus, devfn, PCI_BRIDGE_CONTROL, command);
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
+			pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
 
-			bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL);
 			if (!bus_node)
 				return -ENOMEM;
 
@@ -749,11 +749,11 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 			func->bus_head = bus_node;
 
 			// Save IO base and Limit registers
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &b_base);
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &b_length);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &b_base);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &b_length);
 
 			if ((b_base <= b_length) && (save_command & 0x01)) {
-				io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				io_node = kmalloc(sizeof(*io_node), GFP_KERNEL);
 				if (!io_node)
 					return -ENOMEM;
 
@@ -765,11 +765,11 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 			}
 
 			// Save memory base and Limit registers
-			pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
-			pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
 
 			if ((w_base <= w_length) && (save_command & 0x02)) {
-				mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL);
 				if (!mem_node)
 					return -ENOMEM;
 
@@ -781,11 +781,11 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 			}
 
 			// Save prefetchable memory base and Limit registers
-			pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
-			pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
 
 			if ((w_base <= w_length) && (save_command & 0x02)) {
-				p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL);
 				if (!p_mem_node)
 					return -ENOMEM;
 
@@ -800,8 +800,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 				pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base);
 
 				temp_register = 0xFFFFFFFF;
-				pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &base);
+				pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
 
 				temp_register = base;
 
@@ -813,7 +813,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 						temp_register = base & 0xFFFFFFFE;
 						temp_register = (~temp_register) + 1;
 
-						io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+						io_node = kmalloc(sizeof(*io_node),
+								GFP_KERNEL);
 						if (!io_node)
 							return -ENOMEM;
 
@@ -830,7 +831,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 						temp_register = base & 0xFFFFFFF0;
 						temp_register = (~temp_register) + 1;
 
-						p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+						p_mem_node = kmalloc(sizeof(*p_mem_node),
+								GFP_KERNEL);
 						if (!p_mem_node)
 							return -ENOMEM;
 
@@ -846,7 +848,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 						temp_register = base & 0xFFFFFFF0;
 						temp_register = (~temp_register) + 1;
 
-						mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+						mem_node = kmalloc(sizeof(*mem_node),
+								GFP_KERNEL);
 						if (!mem_node)
 							return -ENOMEM;
 
@@ -862,11 +865,11 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 		} else if ((header_type & 0x7F) == 0x00) {	  // Standard header
 			// Figure out IO and memory base lengths
 			for (cloop = 0x10; cloop <= 0x24; cloop += 4) {
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base);
 
 				temp_register = 0xFFFFFFFF;
-				pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &base);
+				pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &base);
 
 				temp_register = base;
 
@@ -878,7 +881,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 						temp_register = base & 0xFFFFFFFE;
 						temp_register = (~temp_register) + 1;
 
-						io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+						io_node = kmalloc(sizeof(*io_node),
+								GFP_KERNEL);
 						if (!io_node)
 							return -ENOMEM;
 
@@ -894,7 +898,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 						temp_register = base & 0xFFFFFFF0;
 						temp_register = (~temp_register) + 1;
 
-						p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+						p_mem_node = kmalloc(sizeof(*p_mem_node),
+								GFP_KERNEL);
 						if (!p_mem_node)
 							return -ENOMEM;
 
@@ -910,7 +915,8 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
 						temp_register = base & 0xFFFFFFF0;
 						temp_register = (~temp_register) + 1;
 
-						mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+						mem_node = kmalloc(sizeof(*mem_node),
+								GFP_KERNEL);
 						if (!mem_node)
 							return -ENOMEM;
 
@@ -1293,14 +1299,15 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
 		temp_dword = io_base + io_length;
 
 		if ((io_base) && (temp_dword < 0x10000)) {
-			io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			io_node = kmalloc(sizeof(*io_node), GFP_KERNEL);
 			if (!io_node)
 				return -ENOMEM;
 
 			io_node->base = io_base;
 			io_node->length = io_length;
 
-			dbg("found io_node(base, length) = %x, %x\n", io_node->base, io_node->length);
+			dbg("found io_node(base, length) = %x, %x\n",
+					io_node->base, io_node->length);
 			dbg("populated slot =%d \n", populated_slot);
 			if (!populated_slot) {
 				io_node->next = ctrl->io_head;
@@ -1314,7 +1321,7 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
 		// If we've got a valid memory base, use it
 		temp_dword = mem_base + mem_length;
 		if ((mem_base) && (temp_dword < 0x10000)) {
-			mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL);
 			if (!mem_node)
 				return -ENOMEM;
 
@@ -1322,7 +1329,8 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
 
 			mem_node->length = mem_length << 16;
 
-			dbg("found mem_node(base, length) = %x, %x\n", mem_node->base, mem_node->length);
+			dbg("found mem_node(base, length) = %x, %x\n",
+					mem_node->base, mem_node->length);
 			dbg("populated slot =%d \n", populated_slot);
 			if (!populated_slot) {
 				mem_node->next = ctrl->mem_head;
@@ -1337,14 +1345,15 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
 		// the base + length isn't greater than 0xFFFF
 		temp_dword = pre_mem_base + pre_mem_length;
 		if ((pre_mem_base) && (temp_dword < 0x10000)) {
-			p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL);
 			if (!p_mem_node)
 				return -ENOMEM;
 
 			p_mem_node->base = pre_mem_base << 16;
 
 			p_mem_node->length = pre_mem_length << 16;
-			dbg("found p_mem_node(base, length) = %x, %x\n", p_mem_node->base, p_mem_node->length);
+			dbg("found p_mem_node(base, length) = %x, %x\n",
+					p_mem_node->base, p_mem_node->length);
 			dbg("populated slot =%d \n", populated_slot);
 
 			if (!populated_slot) {
@@ -1360,13 +1369,14 @@ int cpqhp_find_available_resources (struct controller *ctrl, void *rom_start)
 		// The second condition is to ignore bus numbers on
 		// populated slots that don't have PCI-PCI bridges
 		if (secondary_bus && (secondary_bus != primary_bus)) {
-			bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL);
 			if (!bus_node)
 				return -ENOMEM;
 
 			bus_node->base = secondary_bus;
 			bus_node->length = max_bus - secondary_bus + 1;
-			dbg("found bus_node(base, length) = %x, %x\n", bus_node->base, bus_node->length);
+			dbg("found bus_node(base, length) = %x, %x\n",
+					bus_node->base, bus_node->length);
 			dbg("populated slot =%d \n", populated_slot);
 			if (!populated_slot) {
 				bus_node->next = ctrl->bus_head;
diff --git a/drivers/pci/hotplug/ibmphp.h b/drivers/pci/hotplug/ibmphp.h
index f67af8a64..b24b8cd45 100644
--- a/drivers/pci/hotplug/ibmphp.h
+++ b/drivers/pci/hotplug/ibmphp.h
@@ -271,7 +271,6 @@ struct bus_info {
 ***********************************************************/
 extern struct list_head ibmphp_ebda_pci_rsrc_head;
 extern struct list_head ibmphp_slot_head;
-extern struct list_head ibmphp_res_head;
 /***********************************************************
 * FUNCTION PROTOTYPES                                      *
 ***********************************************************/
@@ -754,7 +753,6 @@ struct controller {
 /* Functions */
 
 extern int ibmphp_init_devno (struct slot **);	/* This function is called from EBDA, so we need it not be static */
-extern int ibmphp_disable_slot (struct hotplug_slot *);	/* This function is called from HPC, so we need it to not be static */
 extern int ibmphp_do_disable_slot (struct slot *slot_cur);
 extern int ibmphp_update_slot_info (struct slot *);	/* This function is called from HPC, so we need it to not be be static */
 extern int ibmphp_configure_card (struct pci_func *, u8);
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 742cf544d..89354eb0a 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -1146,7 +1146,7 @@ error_power:
 * OUTPUT: SUCCESS 0 ; FAILURE: UNCONFIGURE , VALIDATE         *
           DISABLE POWER ,                                    *
 **************************************************************/
-int ibmphp_disable_slot (struct hotplug_slot *hotplug_slot)
+static int ibmphp_disable_slot (struct hotplug_slot *hotplug_slot)
 {
 	struct slot *slot = hotplug_slot->private;
 	int rc;
diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c
index 08d5a41e8..9c224c94d 100644
--- a/drivers/pci/hotplug/ibmphp_res.c
+++ b/drivers/pci/hotplug/ibmphp_res.c
@@ -45,7 +45,6 @@ static void fix_resources (struct bus_node *);
 static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8);
 
 static LIST_HEAD(gbuses);
-LIST_HEAD(ibmphp_res_head);
 
 static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag)
 {
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 0c12fa7e9..039213c29 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -29,6 +29,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/list.h>
@@ -45,11 +46,7 @@
 #include "pci_hotplug.h"
 
 
-#if !defined(CONFIG_HOTPLUG_PCI_MODULE)
-	#define MY_NAME	"pci_hotplug"
-#else
-	#define MY_NAME	THIS_MODULE->name
-#endif
+#define MY_NAME	"pci_hotplug"
 
 #define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
@@ -704,7 +701,7 @@ module_exit(pci_hotplug_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
+module_param(debug, bool, 644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 EXPORT_SYMBOL_GPL(pci_hotplug_slots_subsys);
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index 9f94aefce..b1504c7c1 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -35,11 +35,7 @@
 #include <asm/io.h>		
 #include "pci_hotplug.h"
 
-#if !defined(CONFIG_HOTPLUG_PCI_PCIE_MODULE)
-	#define MY_NAME	"pciehp"
-#else
-	#define MY_NAME	THIS_MODULE->name
-#endif
+#define MY_NAME	"pciehp"
 
 extern int pciehp_poll_mode;
 extern int pciehp_poll_time;
@@ -72,9 +68,7 @@ struct pci_func {
 	struct pci_dev* pci_dev;
 };
 
-#define SLOT_MAGIC	0x67267321
 struct slot {
-	u32 magic;
 	struct slot *next;
 	u8 bus;
 	u8 device;
@@ -108,9 +102,9 @@ struct event_info {
 struct controller {
 	struct controller *next;
 	struct semaphore crit_sect;	/* critical section semaphore */
-	void * hpc_ctlr_handle;		/* HPC controller handle */
+	void *hpc_ctlr_handle;		/* HPC controller handle */
 	int num_slots;			/* Number of slots on ctlr */
-	int slot_num_inc;			/* 1 or -1 */
+	int slot_num_inc;		/* 1 or -1 */
 	struct pci_resource *mem_head;
 	struct pci_resource *p_mem_head;
 	struct pci_resource *io_head;
@@ -191,7 +185,7 @@ struct resource_lists {
 #define msg_initialization_err	"Initialization failure, error=%d\n"
 #define msg_HPC_rev_error	"Unsupported revision of the PCI hot plug controller found.\n"
 #define msg_HPC_non_pcie	"The PCI hot plug controller is not supported by this driver.\n"
-#define msg_HPC_not_supported	"This system is not supported by this version of pciephd mdoule. Upgrade to a newer version of pciehpd\n"
+#define msg_HPC_not_supported	"This system is not supported by this version of pciephd module. Upgrade to a newer version of pciehpd\n"
 #define msg_unable_to_save	"Unable to store PCI hot plug add resource information. This system must be rebooted before adding any PCI devices.\n"
 #define msg_button_on		"PCI slot #%d - powering on due to button press.\n"
 #define msg_button_off		"PCI slot #%d - powering off due to button press.\n"
@@ -202,7 +196,6 @@ struct resource_lists {
 extern void pciehp_create_ctrl_files	(struct controller *ctrl);
 
 /* controller functions */
-extern void	pciehp_pushbutton_thread		(unsigned long event_pointer);
 extern int	pciehprm_find_available_resources	(struct controller *ctrl);
 extern int	pciehp_event_start_thread	(void);
 extern void	pciehp_event_stop_thread	(void);
@@ -239,47 +232,10 @@ extern struct pci_func *pciehp_slot_list[256];
 
 /* Inline functions */
 
-
-/* Inline functions to check the sanity of a pointer that is passed to us */
-static inline int slot_paranoia_check (struct slot *slot, const char *function)
-{
-	if (!slot) {
-		dbg("%s - slot == NULL", function);
-		return -1;
-	}
-	if (slot->magic != SLOT_MAGIC) {
-		dbg("%s - bad magic number for slot", function);
-		return -1;
-	}
-	if (!slot->hotplug_slot) {
-		dbg("%s - slot->hotplug_slot == NULL!", function);
-		return -1;
-	}
-	return 0;
-}
-
-static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function)
-{ 
-	struct slot *slot;
-
-	if (!hotplug_slot) {
-		dbg("%s - hotplug_slot == NULL\n", function);
-		return NULL;
-	}
-
-	slot = (struct slot *)hotplug_slot->private;
-	if (slot_paranoia_check (slot, function))
-                return NULL;
-	return slot;
-}
-
-static inline struct slot *pciehp_find_slot (struct controller *ctrl, u8 device)
+static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
 {
 	struct slot *p_slot, *tmp_slot = NULL;
 
-	if (!ctrl)
-		return NULL;
-
 	p_slot = ctrl->slot;
 
 	dbg("p_slot = %p\n", p_slot);
@@ -294,10 +250,10 @@ static inline struct slot *pciehp_find_slot (struct controller *ctrl, u8 device)
 		p_slot = tmp_slot;
 	}
 
-	return (p_slot);
+	return p_slot;
 }
 
-static inline int wait_for_ctrl_irq (struct controller *ctrl)
+static inline int wait_for_ctrl_irq(struct controller *ctrl)
 {
 	int retval = 0;
 
@@ -345,7 +301,7 @@ enum php_ctlr_type {
 
 typedef u8(*php_intr_callback_t) (unsigned int change_id, void *instance_id);
 
-int pcie_init( struct controller *ctrl, struct pci_dev *pdev,
+int pcie_init(struct controller *ctrl, struct pci_dev *pdev,
 		php_intr_callback_t attention_button_callback,
 		php_intr_callback_t switch_change_callback,
 		php_intr_callback_t presence_change_callback,
@@ -353,7 +309,7 @@ int pcie_init( struct controller *ctrl, struct pci_dev *pdev,
 
 
 /* This has no meaning for PCI Express, as there is only 1 slot per port */
-int pcie_get_ctlr_slot_config( struct controller *ctrl,
+int pcie_get_ctlr_slot_config(struct controller *ctrl,
 		int *num_ctlr_slots,
 		int *first_device_num,
 		int *physical_slot_num,
@@ -361,12 +317,12 @@ int pcie_get_ctlr_slot_config( struct controller *ctrl,
 		int *flags);
 
 struct hpc_ops {
-	int	(*power_on_slot )		(struct slot *slot);
-	int	(*power_off_slot )		(struct slot *slot);
-	int	(*get_power_status)		(struct slot *slot, u8 *status);
+	int	(*power_on_slot)	(struct slot *slot);
+	int	(*power_off_slot)	(struct slot *slot);
+	int	(*get_power_status)	(struct slot *slot, u8 *status);
 	int	(*get_attention_status)	(struct slot *slot, u8 *status);
 	int	(*set_attention_status)	(struct slot *slot, u8 status);
-	int	(*get_latch_status)		(struct slot *slot, u8 *status);
+	int	(*get_latch_status)	(struct slot *slot, u8 *status);
 	int	(*get_adapter_status)	(struct slot *slot, u8 *status);
 
 	int	(*get_max_bus_speed)	(struct slot *slot, enum pci_bus_speed *speed);
@@ -380,7 +336,7 @@ struct hpc_ops {
 	void	(*green_led_off)	(struct slot *slot);
 	void	(*green_led_blink)	(struct slot *slot);
 	void	(*release_ctlr)		(struct controller *ctrl);
-	int (*check_lnk_status)		(struct controller *ctrl);
+	int	(*check_lnk_status)	(struct controller *ctrl);
 };
 
 #endif				/* _PCIEHP_H */
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 1f9b7e155..b31ccbcea 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -29,6 +29,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/proc_fs.h>
@@ -45,7 +46,7 @@
 int pciehp_debug;
 int pciehp_poll_mode;
 int pciehp_poll_time;
-struct controller *pciehp_ctrl_list;	/* = NULL */
+struct controller *pciehp_ctrl_list;
 struct pci_func *pciehp_slot_list[256];
 
 #define DRIVER_VERSION	"0.4"
@@ -56,9 +57,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(pciehp_debug, "i");
-MODULE_PARM(pciehp_poll_mode, "i");
-MODULE_PARM(pciehp_poll_time, "i");
+module_param(pciehp_debug, bool, 644);
+module_param(pciehp_poll_mode, bool, 644);
+module_param(pciehp_poll_time, int, 644);
 MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not");
 MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not");
 MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");
@@ -69,7 +70,6 @@ static int pcie_start_thread (void);
 static int set_attention_status (struct hotplug_slot *slot, u8 value);
 static int enable_slot		(struct hotplug_slot *slot);
 static int disable_slot		(struct hotplug_slot *slot);
-static int hardware_test	(struct hotplug_slot *slot, u32 value);
 static int get_power_status	(struct hotplug_slot *slot, u8 *value);
 static int get_attention_status	(struct hotplug_slot *slot, u8 *value);
 static int get_latch_status	(struct hotplug_slot *slot, u8 *value);
@@ -82,7 +82,6 @@ static struct hotplug_slot_ops pciehp_hotplug_slot_ops = {
 	.set_attention_status =	set_attention_status,
 	.enable_slot =		enable_slot,
 	.disable_slot =		disable_slot,
-	.hardware_test =	hardware_test,
 	.get_power_status =	get_power_status,
 	.get_attention_status =	get_attention_status,
 	.get_latch_status =	get_latch_status,
@@ -97,7 +96,7 @@ static int init_slots(struct controller *ctrl)
 	u8 number_of_slots;
 	u8 slot_device;
 	u32 slot_number;
-	int result;
+	int result = -ENOMEM;
 
 	dbg("%s\n",__FUNCTION__);
 
@@ -106,34 +105,30 @@ static int init_slots(struct controller *ctrl)
 	slot_number = ctrl->first_slot;
 
 	while (number_of_slots) {
-		new_slot = (struct slot *) kmalloc(sizeof(struct slot), GFP_KERNEL);
+		new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL);
 		if (!new_slot)
-			return -ENOMEM;
+			goto error;
 
 		memset(new_slot, 0, sizeof(struct slot));
-		new_slot->hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL);
-		if (!new_slot->hotplug_slot) {
-			kfree (new_slot);
-			return -ENOMEM;
-		}
-		memset(new_slot->hotplug_slot, 0, sizeof (struct hotplug_slot));
-
-		new_slot->hotplug_slot->info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
-		if (!new_slot->hotplug_slot->info) {
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
-		memset(new_slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info));
-		new_slot->hotplug_slot->name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL);
-		if (!new_slot->hotplug_slot->name) {
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
+		new_slot->hotplug_slot =
+				kmalloc(sizeof(*(new_slot->hotplug_slot)),
+						GFP_KERNEL);
+		if (!new_slot->hotplug_slot)
+			goto error_slot;
+		memset(new_slot->hotplug_slot, 0, sizeof(struct hotplug_slot));
+
+		new_slot->hotplug_slot->info =
+			kmalloc(sizeof(*(new_slot->hotplug_slot->info)),
+						GFP_KERNEL);
+		if (!new_slot->hotplug_slot->info)
+			goto error_hpslot;
+		memset(new_slot->hotplug_slot->info, 0,
+					sizeof(struct hotplug_slot_info));
+		new_slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE,
+						GFP_KERNEL);
+		if (!new_slot->hotplug_slot->name)
+			goto error_info;
 
-		new_slot->magic = SLOT_MAGIC;
 		new_slot->ctrl = ctrl;
 		new_slot->bus = ctrl->slot_bus;
 		new_slot->device = slot_device;
@@ -157,11 +152,7 @@ static int init_slots(struct controller *ctrl)
 		result = pci_hp_register (new_slot->hotplug_slot);
 		if (result) {
 			err ("pci_hp_register failed with error %d\n", result);
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot->name);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return result;
+			goto error_name;
 		}
 
 		new_slot->next = ctrl->slot;
@@ -172,7 +163,18 @@ static int init_slots(struct controller *ctrl)
 		slot_number += ctrl->slot_num_inc;
 	}
 
-	return(0);
+	return 0;
+
+error_name:
+	kfree(new_slot->hotplug_slot->name);
+error_info:
+	kfree(new_slot->hotplug_slot->info);
+error_hpslot:
+	kfree(new_slot->hotplug_slot);
+error_slot:
+	kfree(new_slot);
+error:
+	return result;
 }
 
 
@@ -228,13 +230,10 @@ static int get_ctlr_slot_config(struct controller *ctrl)
 /*
  * set_attention_status - Turns the Amber LED for a slot on, off or blink
  */
-static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
+static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 
-	if (slot == NULL)
-		return -ENODEV;
-	
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	hotplug_slot->info->attention_status = status;
@@ -244,12 +243,9 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 }
 
 
-static int enable_slot (struct hotplug_slot *hotplug_slot)
+static int enable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
@@ -257,33 +253,20 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
 }
 
 
-static int disable_slot (struct hotplug_slot *hotplug_slot)
+static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	return pciehp_disable_slot(slot);
 }
 
-
-static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value)
+static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	return 0;
-}
-
-
-static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
-{
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_power_status(slot, value);
@@ -293,14 +276,11 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return 0;
 }
 
-static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_attention_status(slot, value);
@@ -310,14 +290,11 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return 0;
 }
 
-static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_latch_status(slot, value);
@@ -327,31 +304,24 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return 0;
 }
 
-static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_adapter_status(slot, value);
-
 	if (retval < 0)
 		*value = hotplug_slot->info->adapter_status;
 
 	return 0;
 }
 
-static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
+static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 	
@@ -362,13 +332,10 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
 	return 0;
 }
 
-static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
+static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 	
@@ -388,7 +355,7 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int num_ctlr_slots;		/* number of slots supported by this HPC */
 	u8 value;
 
-	ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL);
+	ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL);
 	if (!ctrl) {
 		err("%s : out of memory\n", __FUNCTION__);
 		goto err_out_none;
@@ -411,7 +378,7 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_set_drvdata(pdev, ctrl);
 
-	ctrl->pci_bus = kmalloc (sizeof (*ctrl->pci_bus), GFP_KERNEL);
+	ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL);
 	if (!ctrl->pci_bus) {
 		err("%s: out of memory\n", __FUNCTION__);
 		rc = -ENOMEM;
@@ -535,49 +502,35 @@ static int pcie_start_thread(void)
 	return retval;
 }
 
+static inline void __exit
+free_pciehp_res(struct pci_resource *res)
+{
+	struct pci_resource *tres;
+
+	while (res) {
+		tres = res;
+		res = res->next;
+		kfree(tres);
+	}
+}
 
-static void unload_pciehpd(void)
+static void __exit unload_pciehpd(void)
 {
 	struct pci_func *next;
 	struct pci_func *TempSlot;
 	int loop;
 	struct controller *ctrl;
 	struct controller *tctrl;
-	struct pci_resource *res;
-	struct pci_resource *tres;
 
 	ctrl = pciehp_ctrl_list;
 
 	while (ctrl) {
 		cleanup_slots(ctrl);
 
-		res = ctrl->io_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
-
-		res = ctrl->mem_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
-
-		res = ctrl->p_mem_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
-
-		res = ctrl->bus_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
+		free_pciehp_res(ctrl->io_head);
+		free_pciehp_res(ctrl->mem_head);
+		free_pciehp_res(ctrl->p_mem_head);
+		free_pciehp_res(ctrl->bus_head);
 
 		kfree (ctrl->pci_bus);
 
@@ -592,33 +545,10 @@ static void unload_pciehpd(void)
 	for (loop = 0; loop < 256; loop++) {
 		next = pciehp_slot_list[loop];
 		while (next != NULL) {
-			res = next->io_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
-
-			res = next->mem_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
-
-			res = next->p_mem_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
-
-			res = next->bus_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
+			free_pciehp_res(next->io_head);
+			free_pciehp_res(next->mem_head);
+			free_pciehp_res(next->p_mem_head);
+			free_pciehp_res(next->bus_head);
 
 			TempSlot = next;
 			next = next->next;
@@ -700,8 +630,5 @@ static void __exit pcied_cleanup(void)
 	info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
 }
 
-
 module_init(pcied_init);
 module_exit(pcied_cleanup);
-
-
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index cf2777e7e..4c5bb2f81 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -251,12 +251,10 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id)
 }
 
 
-/*
- * sort_by_size
- *
- * Sorts nodes on the list by their length.
- * Smallest first.
+/**
+ * sort_by_size: sort nodes by their length, smallest first.
  *
+ * @head: list to sort
  */
 static int sort_by_size(struct pci_resource **head)
 {
@@ -265,10 +263,10 @@ static int sort_by_size(struct pci_resource **head)
 	int out_of_order = 1;
 
 	if (!(*head))
-		return(1);
+		return 1;
 
 	if (!((*head)->next))
-		return(0);
+		return 0;
 
 	while (out_of_order) {
 		out_of_order = 0;
@@ -298,7 +296,7 @@ static int sort_by_size(struct pci_resource **head)
 		}
 	}  /* End of out_of_order loop */
 
-	return(0);
+	return 0;
 }
 
 
@@ -316,10 +314,10 @@ static int sort_by_max_size(struct pci_resource **head)
 	int out_of_order = 1;
 
 	if (!(*head))
-		return(1);
+		return 1;
 
 	if (!((*head)->next))
-		return(0);
+		return 0;
 
 	while (out_of_order) {
 		out_of_order = 0;
@@ -349,17 +347,18 @@ static int sort_by_max_size(struct pci_resource **head)
 		}
 	}  /* End of out_of_order loop */
 
-	return(0);
+	return 0;
 }
 
 
-/*
- * do_pre_bridge_resource_split
- *
- *	Returns zero or one node of resources that aren't in use
+/**
+ * do_pre_bridge_resource_split: return one unused resource node
+ * @head: list to scan
  *
  */
-static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **head, struct pci_resource **orig_head, u32 alignment)
+static struct pci_resource *
+do_pre_bridge_resource_split(struct pci_resource **head,
+				struct pci_resource **orig_head, u32 alignment)
 {
 	struct pci_resource *prevnode = NULL;
 	struct pci_resource *node;
@@ -369,18 +368,18 @@ static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **
 	dbg("do_pre_bridge_resource_split\n");
 
 	if (!(*head) || !(*orig_head))
-		return(NULL);
+		return NULL;
 
 	rc = pciehp_resource_sort_and_combine(head);
 
 	if (rc)
-		return(NULL);
+		return NULL;
 
 	if ((*head)->base != (*orig_head)->base)
-		return(NULL);
+		return NULL;
 
 	if ((*head)->length == (*orig_head)->length)
-		return(NULL);
+		return NULL;
 
 
 	/* If we got here, there the bridge requires some of the resource, but
@@ -392,10 +391,10 @@ static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **
 		/* this one isn't an aligned length, so we'll make a new entry
 		 * and split it up.
 		 */
-		split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+		split_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
 
 		if (!split_node)
-			return(NULL);
+			return NULL;
 
 		temp_dword = (node->length | (alignment-1)) + 1 - alignment;
 
@@ -410,34 +409,32 @@ static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **
 		split_node->next = node;
 	}
 
-	if (node->length < alignment) {
-		return(NULL);
-	}
+	if (node->length < alignment)
+		return NULL;
 
 	/* Now unlink it */
 	if (*head == node) {
 		*head = node->next;
-		node->next = NULL;
 	} else {
 		prevnode = *head;
 		while (prevnode->next != node)
 			prevnode = prevnode->next;
 
 		prevnode->next = node->next;
-		node->next = NULL;
 	}
+	node->next = NULL;
 
-	return(node);
+	return node;
 }
 
 
-/*
- * do_bridge_resource_split
- *
- *	Returns zero or one node of resources that aren't in use
+/**
+ * do_bridge_resource_split: return one unused resource node
+ * @head: list to scan
  *
  */
-static struct pci_resource *do_bridge_resource_split (struct pci_resource **head, u32 alignment)
+static struct pci_resource *
+do_bridge_resource_split(struct pci_resource **head, u32 alignment)
 {
 	struct pci_resource *prevnode = NULL;
 	struct pci_resource *node;
@@ -445,12 +442,12 @@ static struct pci_resource *do_bridge_resource_split (struct pci_resource **head
 	u32 temp_dword;
 
 	if (!(*head))
-		return(NULL);
+		return NULL;
 
 	rc = pciehp_resource_sort_and_combine(head);
 
 	if (rc)
-		return(NULL);
+		return NULL;
 
 	node = *head;
 
@@ -462,7 +459,7 @@ static struct pci_resource *do_bridge_resource_split (struct pci_resource **head
 
 	if (node->length < alignment) {
 		kfree(node);
-		return(NULL);
+		return NULL;
 	}
 
 	if (node->base & (alignment - 1)) {
@@ -470,7 +467,7 @@ static struct pci_resource *do_bridge_resource_split (struct pci_resource **head
 		temp_dword = (node->base | (alignment-1)) + 1;
 		if ((node->length - (temp_dword - node->base)) < alignment) {
 			kfree(node);
-			return(NULL);
+			return NULL;
 		}
 
 		node->length -= (temp_dword - node->base);
@@ -480,10 +477,10 @@ static struct pci_resource *do_bridge_resource_split (struct pci_resource **head
 	if (node->length & (alignment - 1)) {
 		/* There's stuff in use after this node */
 		kfree(node);
-		return(NULL);
+		return NULL;
 	}
 
-	return(node);
+	return node;
 }
 
 
@@ -497,7 +494,7 @@ static struct pci_resource *do_bridge_resource_split (struct pci_resource **head
  *
  * size must be a power of two.
  */
-static struct pci_resource *get_io_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size)
 {
 	struct pci_resource *prevnode;
 	struct pci_resource *node;
@@ -505,13 +502,13 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 	u32 temp_dword;
 
 	if (!(*head))
-		return(NULL);
+		return NULL;
 
 	if ( pciehp_resource_sort_and_combine(head) )
-		return(NULL);
+		return NULL;
 
 	if ( sort_by_size(head) )
-		return(NULL);
+		return NULL;
 
 	for (node = *head; node; node = node->next) {
 		if (node->length < size)
@@ -526,10 +523,11 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 			if ((node->length - (temp_dword - node->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base;
 			split_node->length = temp_dword - node->base;
@@ -545,10 +543,11 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 		if (node->length > size) {
 			/* this one is longer than we need
 			   so we'll make a new entry and split it up */
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base + size;
 			split_node->length = node->length - size;
@@ -579,7 +578,7 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 		break;
 	}
 
-	return(node);
+	return node;
 }
 
 
@@ -592,7 +591,7 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
  * J.I. modified to put max size limits of; 64M->32M->16M->8M->4M->1M
  *  This is needed to avoid allocating entire ACPI _CRS res to one child bridge/slot.
  */
-static struct pci_resource *get_max_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *get_max_resource(struct pci_resource **head, u32 size)
 {
 	struct pci_resource *max;
 	struct pci_resource *temp;
@@ -602,13 +601,13 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 	int i;
 
 	if (!(*head))
-		return(NULL);
+		return NULL;
 
 	if (pciehp_resource_sort_and_combine(head))
-		return(NULL);
+		return NULL;
 
 	if (sort_by_max_size(head))
-		return(NULL);
+		return NULL;
 
 	for (max = *head;max; max = max->next) {
 
@@ -626,10 +625,11 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 			if ((max->length - (temp_dword - max->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = max->base;
 			split_node->length = temp_dword - max->base;
@@ -644,10 +644,11 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 		if ((max->base + max->length) & (size - 1)) {
 			/* this one isn't end aligned properly at the top
 			   so we'll make a new entry and split it up */
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 			temp_dword = ((max->base + max->length) & ~(size - 1));
 			split_node->base = temp_dword;
 			split_node->length = max->length + max->base
@@ -665,9 +666,10 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 
 		for ( i = 0; max_size[i] > size; i++) {
 			if (max->length > max_size[i]) {
-				split_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				split_node = kmalloc(sizeof(struct pci_resource),
+							GFP_KERNEL);
 				if (!split_node)
-					break;	/* return (NULL); */
+					break;	/* return NULL; */
 				split_node->base = max->base + max_size[i];
 				split_node->length = max->length - max_size[i];
 				max->length = max_size[i];
@@ -691,11 +693,11 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 		}
 
 		max->next = NULL;
-		return(max);
+		return max;
 	}
 
 	/* If we get here, we couldn't find one */
-	return(NULL);
+	return NULL;
 }
 
 
@@ -708,7 +710,7 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
  *
  * size must be a power of two.
  */
-static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
+static struct pci_resource *get_resource(struct pci_resource **head, u32 size)
 {
 	struct pci_resource *prevnode;
 	struct pci_resource *node;
@@ -716,13 +718,13 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 	u32 temp_dword;
 
 	if (!(*head))
-		return(NULL);
+		return NULL;
 
 	if ( pciehp_resource_sort_and_combine(head) )
-		return(NULL);
+		return NULL;
 
 	if ( sort_by_size(head) )
-		return(NULL);
+		return NULL;
 
 	for (node = *head; node; node = node->next) {
 		dbg("%s: req_size =0x%x node=%p, base=0x%x, length=0x%x\n",
@@ -740,10 +742,11 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 			if ((node->length - (temp_dword - node->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base;
 			split_node->length = temp_dword - node->base;
@@ -760,10 +763,11 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 			dbg("%s: too big\n", __FUNCTION__);
 			/* this one is longer than we need
 			   so we'll make a new entry and split it up */
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 
 			if (!split_node)
-				return(NULL);
+				return NULL;
 
 			split_node->base = node->base + size;
 			split_node->length = node->length - size;
@@ -790,7 +794,7 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 		/* Stop looping */
 		break;
 	}
-	return(node);
+	return node;
 }
 
 
@@ -812,12 +816,12 @@ int pciehp_resource_sort_and_combine(struct pci_resource **head)
 	dbg("%s: head = %p, *head = %p\n", __FUNCTION__, head, *head);
 
 	if (!(*head))
-		return(1);
+		return 1;
 
 	dbg("*head->next = %p\n",(*head)->next);
 
 	if (!(*head)->next)
-		return(0);	/* only one item on the list, already sorted! */
+		return 0;	/* only one item on the list, already sorted! */
 
 	dbg("*head->base = 0x%x\n",(*head)->base);
 	dbg("*head->next->base = 0x%x\n",(*head)->next->base);
@@ -863,7 +867,7 @@ int pciehp_resource_sort_and_combine(struct pci_resource **head)
 			node1 = node1->next;
 	}
 
-	return(0);
+	return 0;
 }
 
 
@@ -878,11 +882,10 @@ struct pci_func *pciehp_slot_create(u8 busnumber)
 	struct pci_func *new_slot;
 	struct pci_func *next;
 	dbg("%s: busnumber %x\n", __FUNCTION__, busnumber);
-	new_slot = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL);
+	new_slot = kmalloc(sizeof(struct pci_func), GFP_KERNEL);
 
-	if (new_slot == NULL) {
-		return(new_slot);
-	}
+	if (new_slot == NULL)
+		return new_slot;
 
 	memset(new_slot, 0, sizeof(struct pci_func));
 
@@ -897,11 +900,11 @@ struct pci_func *pciehp_slot_create(u8 busnumber)
 			next = next->next;
 		next->next = new_slot;
 	}
-	return(new_slot);
+	return new_slot;
 }
 
 
-/*
+/**
  * slot_remove - Removes a node from the linked list of slots.
  * @old_slot: slot to remove
  *
@@ -912,19 +915,18 @@ static int slot_remove(struct pci_func * old_slot)
 	struct pci_func *next;
 
 	if (old_slot == NULL)
-		return(1);
+		return 1;
 
 	next = pciehp_slot_list[old_slot->bus];
 
-	if (next == NULL) {
-		return(1);
-	}
+	if (next == NULL)
+		return 1;
 
 	if (next == old_slot) {
 		pciehp_slot_list[old_slot->bus] = old_slot->next;
 		pciehp_destroy_board_resources(old_slot);
 		kfree(old_slot);
-		return(0);
+		return 0;
 	}
 
 	while ((next->next != old_slot) && (next->next != NULL)) {
@@ -935,9 +937,9 @@ static int slot_remove(struct pci_func * old_slot)
 		next->next = old_slot->next;
 		pciehp_destroy_board_resources(old_slot);
 		kfree(old_slot);
-		return(0);
+		return 0;
 	} else
-		return(2);
+		return 2;
 }
 
 
@@ -954,7 +956,7 @@ static int bridge_slot_remove(struct pci_func *bridge)
 	struct pci_func *next;
 
 	if (bridge == NULL)
-		return(1);
+		return 1;
 
 	secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF;
 	subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF;
@@ -970,13 +972,13 @@ static int bridge_slot_remove(struct pci_func *bridge)
 	next = pciehp_slot_list[bridge->bus];
 
 	if (next == NULL) {
-		return(1);
+		return 1;
 	}
 
 	if (next == bridge) {
 		pciehp_slot_list[bridge->bus] = bridge->next;
 		kfree(bridge);
-		return(0);
+		return 0;
 	}
 
 	while ((next->next != bridge) && (next->next != NULL)) {
@@ -986,9 +988,9 @@ static int bridge_slot_remove(struct pci_func *bridge)
 	if (next->next == bridge) {
 		next->next = bridge->next;
 		kfree(bridge);
-		return(0);
+		return 0;
 	} else
-		return(2);
+		return 2;
 }
 
 
@@ -1016,7 +1018,7 @@ struct pci_func *pciehp_slot_find(u8 bus, u8 device, u8 index)
 		dbg("%s: func == NULL\n", __FUNCTION__);
 
 	if ((func == NULL) || ((func->device == device) && (index == 0)))
-		return(func);
+		return func;
 
 	if (func->device == device)
 		found++;
@@ -1035,11 +1037,11 @@ struct pci_func *pciehp_slot_find(u8 bus, u8 device, u8 index)
 		if ((found == index) || (func->function == index)) {
 			dbg("%s: Found bus %x dev %x func %x\n", __FUNCTION__,
 					func->bus, func->device, func->function);
-			return(func);
+			return func;
 		}
 	}
 
-	return(NULL);
+	return NULL;
 }
 
 static int is_bridge(struct pci_func * func)
@@ -1187,7 +1189,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 			/* Done with exclusive hardware access */
 			up(&ctrl->crit_sect);
 
-			return(rc);
+			return rc;
 		}
 		pciehp_save_slot_config(ctrl, func);
 
@@ -1251,7 +1253,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		/* Done with exclusive hardware access */
 		up(&ctrl->crit_sect);
 
-		return(rc);
+		return rc;
 	}
 	return 0;
 }
@@ -1273,10 +1275,10 @@ static u32 remove_board(struct pci_func *func, struct controller *ctrl)
 	struct slot *p_slot;
 
 	if (func == NULL)
-		return(1);
+		return 1;
 
 	if (pciehp_unconfigure_device(func))
-		return(1);
+		return 1;
 
 	device = func->device;
 
@@ -1370,7 +1372,7 @@ static u32 remove_board(struct pci_func *func, struct controller *ctrl)
 		func = pciehp_slot_create(ctrl->slot_bus);
 
 		if (func == NULL) {
-			return(1);
+			return 1;
 		}
 
 		func->bus = ctrl->slot_bus;
@@ -1385,7 +1387,7 @@ static u32 remove_board(struct pci_func *func, struct controller *ctrl)
 }
 
 
-static void pushbutton_helper_thread (unsigned long data)
+static void pushbutton_helper_thread(unsigned long data)
 {
 	pushbutton_pending = data;
 
@@ -1393,6 +1395,81 @@ static void pushbutton_helper_thread (unsigned long data)
 }
 
 
+/**
+ * pciehp_pushbutton_thread
+ *
+ * Scheduled procedure to handle blocking stuff for the pushbuttons
+ * Handles all pending events and exits.
+ *
+ */
+static void pciehp_pushbutton_thread(unsigned long slot)
+{
+	struct slot *p_slot = (struct slot *) slot;
+	u8 getstatus;
+	int rc;
+	
+	pushbutton_pending = 0;
+
+	if (!p_slot) {
+		dbg("%s: Error! slot NULL\n", __FUNCTION__);
+		return;
+	}
+
+	p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
+	if (getstatus) {
+		p_slot->state = POWEROFF_STATE;
+		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
+
+		if (pciehp_disable_slot(p_slot)) {
+			/* Wait for exclusive access to hardware */
+			down(&p_slot->ctrl->crit_sect);
+
+			/* Turn on the Attention LED */
+			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
+			if (rc) {
+				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
+				return;
+			}
+	
+			/* Wait for the command to complete */
+			wait_for_ctrl_irq (p_slot->ctrl);
+
+			/* Done with exclusive hardware access */
+			up(&p_slot->ctrl->crit_sect);
+		}
+		p_slot->state = STATIC_STATE;
+	} else {
+		p_slot->state = POWERON_STATE;
+		dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
+
+		if (pciehp_enable_slot(p_slot)) {
+			/* Wait for exclusive access to hardware */
+			down(&p_slot->ctrl->crit_sect);
+
+			/* Turn off the green LED */
+			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
+			if (rc) {
+				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
+				return;
+			}
+			/* Wait for the command to complete */
+			wait_for_ctrl_irq (p_slot->ctrl);
+			
+			p_slot->hpc_ops->green_led_off(p_slot);
+
+			/* Wait for the command to complete */
+			wait_for_ctrl_irq (p_slot->ctrl);
+
+			/* Done with exclusive hardware access */
+			up(&p_slot->ctrl->crit_sect);
+		}
+		p_slot->state = STATIC_STATE;
+	}
+
+	return;
+}
+
+
 /* this is the main worker thread */
 static int event_thread(void* data)
 {
@@ -1420,7 +1497,7 @@ static int event_thread(void* data)
 	return 0;
 }
 
-int pciehp_event_start_thread (void)
+int pciehp_event_start_thread(void)
 {
 	int pid;
 
@@ -1440,7 +1517,7 @@ int pciehp_event_start_thread (void)
 }
 
 
-void pciehp_event_stop_thread (void)
+void pciehp_event_stop_thread(void)
 {
 	event_finished = 1;
 	dbg("event_thread finish command given\n");
@@ -1450,13 +1527,13 @@ void pciehp_event_stop_thread (void)
 }
 
 
-static int update_slot_info (struct slot *slot)
+static int update_slot_info(struct slot *slot)
 {
 	struct hotplug_slot_info *info;
 	/* char buffer[SLOT_NAME_SIZE]; */
 	int result;
 
-	info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
+	info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 
@@ -1603,87 +1680,10 @@ static void interrupt_event_handler(struct controller *ctrl)
 			}
 		}		/* End of FOR loop */
 	}
-
-	return;
 }
 
 
-/**
- * pciehp_pushbutton_thread
- *
- * Scheduled procedure to handle blocking stuff for the pushbuttons
- * Handles all pending events and exits.
- *
- */
-void pciehp_pushbutton_thread (unsigned long slot)
-{
-	struct slot *p_slot = (struct slot *) slot;
-	u8 getstatus;
-	int rc;
-	
-	pushbutton_pending = 0;
-
-	if (!p_slot) {
-		dbg("%s: Error! slot NULL\n", __FUNCTION__);
-		return;
-	}
-
-	p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
-	if (getstatus) {
-		p_slot->state = POWEROFF_STATE;
-		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
-
-		if (pciehp_disable_slot(p_slot)) {
-			/* Wait for exclusive access to hardware */
-			down(&p_slot->ctrl->crit_sect);
-
-			/* Turn on the Attention LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-	
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&p_slot->ctrl->crit_sect);
-		}
-		p_slot->state = STATIC_STATE;
-	} else {
-		p_slot->state = POWERON_STATE;
-		dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
-
-		if (pciehp_enable_slot(p_slot)) {
-			/* Wait for exclusive access to hardware */
-			down(&p_slot->ctrl->crit_sect);
-
-			/* Turn off the green LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-			
-			p_slot->hpc_ops->green_led_off(p_slot);
-
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&p_slot->ctrl->crit_sect);
-		}
-		p_slot->state = STATIC_STATE;
-	}
-
-	return;
-}
-
-
-int pciehp_enable_slot (struct slot *p_slot)
+int pciehp_enable_slot(struct slot *p_slot)
 {
 	u8 getstatus = 0;
 	int rc;
@@ -1692,7 +1692,7 @@ int pciehp_enable_slot (struct slot *p_slot)
 	func = pciehp_slot_find(p_slot->bus, p_slot->device, 0);
 	if (!func) {
 		dbg("%s: Error! slot NULL\n", __FUNCTION__);
-		return (1);
+		return 1;
 	}
 
 	/* Check to see if (latch closed, card present, power off) */
@@ -1701,21 +1701,21 @@ int pciehp_enable_slot (struct slot *p_slot)
 	if (rc || !getstatus) {
 		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 0;
 	}
 	
 	rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	if (rc || getstatus) {
 		info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 0;
 	}
 	
 	rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
 	if (rc || getstatus) {
 		info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 0;
 	}
 	up(&p_slot->ctrl->crit_sect);
 
@@ -1723,7 +1723,7 @@ int pciehp_enable_slot (struct slot *p_slot)
 
 	func = pciehp_slot_create(p_slot->bus);
 	if (func == NULL)
-		return (1);
+		return 1;
 
 	func->bus = p_slot->bus;
 	func->device = p_slot->device;
@@ -1746,7 +1746,7 @@ int pciehp_enable_slot (struct slot *p_slot)
 		/* Setup slot structure with entry for empty slot */
 		func = pciehp_slot_create(p_slot->bus);
 		if (func == NULL)
-			return (1);	/* Out of memory */
+			return 1;	/* Out of memory */
 
 		func->bus = p_slot->bus;
 		func->device = p_slot->device;
@@ -1767,7 +1767,7 @@ int pciehp_enable_slot (struct slot *p_slot)
 }
 
 
-int pciehp_disable_slot (struct slot *p_slot)
+int pciehp_disable_slot(struct slot *p_slot)
 {
 	u8 class_code, header_type, BCR;
 	u8 index = 0;
@@ -1779,7 +1779,7 @@ int pciehp_disable_slot (struct slot *p_slot)
 	struct pci_func *func;
 
 	if (!p_slot->ctrl)
-		return (1);
+		return 1;
 
 	/* Check to see if (latch closed, card present, power on) */
 	down(&p_slot->ctrl->crit_sect);
@@ -1788,21 +1788,21 @@ int pciehp_disable_slot (struct slot *p_slot)
 	if (ret || !getstatus) {
 		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 0;
 	}
 
 	ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	if (ret || getstatus) {
 		info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 0;
 	}
 
 	ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
 	if (ret || !getstatus) {
 		info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 0;
 	}
 	up(&p_slot->ctrl->crit_sect);
 
@@ -1854,7 +1854,7 @@ int pciehp_disable_slot (struct slot *p_slot)
 	if (p_slot)
 		update_slot_info(p_slot);
 
-	return(rc);
+	return rc;
 }
 
 
@@ -1869,7 +1869,7 @@ int pciehp_disable_slot (struct slot *p_slot)
  * Returns 0 if success
  *
  */
-static u32 configure_new_device (struct controller * ctrl, struct pci_func * func,
+static u32 configure_new_device(struct controller * ctrl, struct pci_func * func,
 	u8 behind_bridge, struct resource_lists * resources, u8 bridge_bus, u8 bridge_dev)
 {
 	u8 temp_byte, function, max_functions, stop_it;
@@ -1901,20 +1901,23 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
 	function = 0;
 
 	do {
-		rc = configure_new_function(ctrl, new_slot, behind_bridge, resources, bridge_bus, bridge_dev);
+		rc = configure_new_function(ctrl, new_slot, behind_bridge,
+					resources, bridge_bus, bridge_dev);
 
 		if (rc) {
-			dbg("configure_new_function failed %d\n",rc);
+			dbg("configure_new_function failed: %d\n", rc);
 			index = 0;
 
 			while (new_slot) {
-				new_slot = pciehp_slot_find(new_slot->bus, new_slot->device, index++);
+				new_slot = pciehp_slot_find(new_slot->bus,
+						new_slot->device, index++);
 
 				if (new_slot)
-					pciehp_return_board_resources(new_slot, resources);
+					pciehp_return_board_resources(new_slot,
+						resources);
 			}
 
-			return(rc);
+			return rc;
 		}
 
 		function++;
@@ -1936,7 +1939,7 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
 
 				if (new_slot == NULL) {
 					/* Out of memory */
-					return(1);
+					return 1;
 				}
 
 				new_slot->bus = func->bus;
@@ -1950,41 +1953,63 @@ static u32 configure_new_device (struct controller * ctrl, struct pci_func * fun
 		}
 
 	} while (function < max_functions);
-	dbg("returning from configure_new_device\n");
+	dbg("returning from %s\n", __FUNCTION__);
 
 	return 0;
 }
 
-
 /*
  * Configuration logic that involves the hotplug data structures and 
  * their bookkeeping
  */
 
-
 /**
- * configure_new_function - Configures the PCI header information of one device
- *
- * @ctrl: pointer to controller structure
- * @func: pointer to function structure
- * @behind_bridge: 1 if this is a recursive call, 0 if not
- * @resources: pointer to set of resource lists
- *
- * Calls itself recursively for bridged devices.
- * Returns 0 if success
- *
+ * configure_bridge: fill bridge's registers, either configure or disable it.
  */
-static int configure_new_function (struct controller * ctrl, struct pci_func * func,
-	u8 behind_bridge, struct resource_lists *resources, u8 bridge_bus, u8 bridge_dev)
+static int
+configure_bridge(struct pci_bus *pci_bus, unsigned int devfn,
+			struct pci_resource *mem_node,
+			struct pci_resource **hold_mem_node,
+			int base_addr, int limit_addr)
+{
+	u16 temp_word;
+	u32 rc;
+
+	if (mem_node) {
+		memcpy(*hold_mem_node, mem_node, sizeof(struct pci_resource));
+		mem_node->next = NULL;
+
+		/* set Mem base and Limit registers */
+		RES_CHECK(mem_node->base, 16);
+		temp_word = (u16)(mem_node->base >> 16);
+		rc = pci_bus_write_config_word(pci_bus, devfn, base_addr, temp_word);
+
+		RES_CHECK(mem_node->base + mem_node->length - 1, 16);
+		temp_word = (u16)((mem_node->base + mem_node->length - 1) >> 16);
+		rc = pci_bus_write_config_word(pci_bus, devfn, limit_addr, temp_word);
+	} else {
+		temp_word = 0xFFFF;
+		rc = pci_bus_write_config_word(pci_bus, devfn, base_addr, temp_word);
+
+		temp_word = 0x0000;
+		rc = pci_bus_write_config_word(pci_bus, devfn, limit_addr, temp_word);
+
+		kfree(*hold_mem_node);
+		*hold_mem_node = NULL;
+	}
+	return rc;
+}
+
+static int
+configure_new_bridge(struct controller *ctrl, struct pci_func *func,
+		u8 behind_bridge, struct resource_lists *resources,
+		struct pci_bus *pci_bus)
 {
 	int cloop;
 	u8 temp_byte;
 	u8 device;
-	u8 class_code;
 	u16 temp_word;
 	u32 rc;
-	u32 temp_register;
-	u32 base;
 	u32 ID;
 	unsigned int devfn;
 	struct pci_resource *mem_node;
@@ -1997,486 +2022,483 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 	struct pci_resource *hold_bus_node;
 	struct irq_mapping irqs;
 	struct pci_func *new_slot;
-	struct pci_bus lpci_bus, *pci_bus;
 	struct resource_lists temp_resources;
 
-	memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus));
-	pci_bus = &lpci_bus;
-	pci_bus->number = func->bus;
 	devfn = PCI_DEVFN(func->device, func->function);
 
-	/* Check for Bridge */
-	rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte);
+	/* set Primary bus */
+	dbg("set Primary bus = 0x%x\n", func->bus);
+	rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus);
 	if (rc)
 		return rc;
-	dbg("%s: bus %x dev %x func %x temp_byte = %x\n", __FUNCTION__,
-		func->bus, func->device, func->function, temp_byte);
 
-	if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */
-		/* set Primary bus */
-		dbg("set Primary bus = 0x%x\n", func->bus);
-		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus);
-		if (rc)
-			return rc;
-
-		/* find range of busses to use */
-		bus_node = get_max_resource(&resources->bus_head, 1L);
-
-		/* If we don't have any busses to allocate, we can't continue */
-		if (!bus_node) {
-			err("Got NO bus resource to use\n");
-			return -ENOMEM;
-		}
-		dbg("Got ranges of buses to use: base:len=0x%x:%x\n", bus_node->base, bus_node->length);
+	/* find range of busses to use */
+	bus_node = get_max_resource(&resources->bus_head, 1L);
 
-		/* set Secondary bus */
-		dbg("set Secondary bus = 0x%x\n", temp_byte);
-		dbg("func->bus %x\n", func->bus);
-
-		temp_byte = (u8)bus_node->base;
-		dbg("set Secondary bus = 0x%x\n", temp_byte);
-		rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte);
-		if (rc)
-			return rc;
-
-		/* set subordinate bus */
-		temp_byte = (u8)(bus_node->base + bus_node->length - 1);
-		dbg("set subordinate bus = 0x%x\n", temp_byte);
-		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
-		if (rc)
-			return rc;
+	/* If we don't have any busses to allocate, we can't continue */
+	if (!bus_node) {
+		err("Got NO bus resource to use\n");
+		return -ENOMEM;
+	}
+	dbg("Got ranges of buses to use: base:len=0x%x:%x\n", bus_node->base, bus_node->length);
 
-		/* Set HP parameters (Cache Line Size, Latency Timer) */
-		rc = pciehprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_BRIDGE);
-		if (rc)
-			return rc;
+	/* set Secondary bus */
+	temp_byte = (u8)bus_node->base;
+	dbg("set Secondary bus = 0x%x\n", temp_byte);
+	rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte);
+	if (rc)
+		return rc;
 
-		/* Setup the IO, memory, and prefetchable windows */
+	/* set subordinate bus */
+	temp_byte = (u8)(bus_node->base + bus_node->length - 1);
+	dbg("set subordinate bus = 0x%x\n", temp_byte);
+	rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
+	if (rc)
+		return rc;
 
-		io_node = get_max_resource(&(resources->io_head), 0x1000L);
-		if (io_node) {
-			dbg("io_node(base, len, next) (%x, %x, %p)\n", io_node->base, io_node->length, io_node->next);
-		}
+	/* Set HP parameters (Cache Line Size, Latency Timer) */
+	rc = pciehprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_BRIDGE);
+	if (rc)
+		return rc;
 
-		mem_node = get_max_resource(&(resources->mem_head), 0x100000L);
-		if (mem_node) {
-			dbg("mem_node(base, len, next) (%x, %x, %p)\n", mem_node->base, mem_node->length, mem_node->next);
-		}
+	/* Setup the IO, memory, and prefetchable windows */
 
-		if (resources->p_mem_head)
-			p_mem_node = get_max_resource(&(resources->p_mem_head), 0x100000L);
-		else {
-			/*
-			 * In some platform implementation, MEM and PMEM are not
-			 *  distinguished, and hence ACPI _CRS has only MEM entries
-			 *  for both MEM and PMEM.
-			 */
-			dbg("using MEM for PMEM\n");
-			p_mem_node = get_max_resource(&(resources->mem_head), 0x100000L);
-		}
-		if (p_mem_node) {
-			dbg("p_mem_node(base, len, next) (%x, %x, %p)\n", p_mem_node->base, p_mem_node->length, p_mem_node->next);
-		}
+	io_node = get_max_resource(&(resources->io_head), 0x1000L);
+	if (io_node) {
+		dbg("io_node(base, len, next) (%x, %x, %p)\n", io_node->base,
+				io_node->length, io_node->next);
+	}
 
-		/* set up the IRQ info */
-		if (!resources->irqs) {
-			irqs.barber_pole = 0;
-			irqs.interrupt[0] = 0;
-			irqs.interrupt[1] = 0;
-			irqs.interrupt[2] = 0;
-			irqs.interrupt[3] = 0;
-			irqs.valid_INT = 0;
-		} else {
-			irqs.barber_pole = resources->irqs->barber_pole;
-			irqs.interrupt[0] = resources->irqs->interrupt[0];
-			irqs.interrupt[1] = resources->irqs->interrupt[1];
-			irqs.interrupt[2] = resources->irqs->interrupt[2];
-			irqs.interrupt[3] = resources->irqs->interrupt[3];
-			irqs.valid_INT = resources->irqs->valid_INT;
-		}
+	mem_node = get_max_resource(&(resources->mem_head), 0x100000L);
+	if (mem_node) {
+		dbg("mem_node(base, len, next) (%x, %x, %p)\n", mem_node->base,
+				mem_node->length, mem_node->next);
+	}
 
-		/* set up resource lists that are now aligned on top and bottom
-		 * for anything behind the bridge.
-		 */
-		temp_resources.bus_head = bus_node;
-		temp_resources.io_head = io_node;
-		temp_resources.mem_head = mem_node;
-		temp_resources.p_mem_head = p_mem_node;
-		temp_resources.irqs = &irqs;
-
-		/* Make copies of the nodes we are going to pass down so that
-		 * if there is a problem,we can just use these to free resources
+	if (resources->p_mem_head)
+		p_mem_node = get_max_resource(&(resources->p_mem_head), 0x100000L);
+	else {
+		/*
+		 * In some platform implementation, MEM and PMEM are not
+		 *  distinguished, and hence ACPI _CRS has only MEM entries
+		 *  for both MEM and PMEM.
 		 */
-		hold_bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_IO_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-
-		if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) {
-			if (hold_bus_node)
-				kfree(hold_bus_node);
-			if (hold_IO_node)
-				kfree(hold_IO_node);
-			if (hold_mem_node)
-				kfree(hold_mem_node);
-			if (hold_p_mem_node)
-				kfree(hold_p_mem_node);
-
-			return(1);
-		}
-
-		memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource));
+		dbg("using MEM for PMEM\n");
+		p_mem_node = get_max_resource(&(resources->mem_head), 0x100000L);
+	}
+	if (p_mem_node) {
+		dbg("p_mem_node(base, len, next) (%x, %x, %p)\n", p_mem_node->base,
+				p_mem_node->length, p_mem_node->next);
+	}
 
-		bus_node->base += 1;
-		bus_node->length -= 1;
-		bus_node->next = NULL;
+	/* set up the IRQ info */
+	if (!resources->irqs) {
+		irqs.barber_pole = 0;
+		irqs.interrupt[0] = 0;
+		irqs.interrupt[1] = 0;
+		irqs.interrupt[2] = 0;
+		irqs.interrupt[3] = 0;
+		irqs.valid_INT = 0;
+	} else {
+		irqs.barber_pole = resources->irqs->barber_pole;
+		irqs.interrupt[0] = resources->irqs->interrupt[0];
+		irqs.interrupt[1] = resources->irqs->interrupt[1];
+		irqs.interrupt[2] = resources->irqs->interrupt[2];
+		irqs.interrupt[3] = resources->irqs->interrupt[3];
+		irqs.valid_INT = resources->irqs->valid_INT;
+	}
 
-		/* If we have IO resources copy them and fill in the bridge's
-		 * IO range registers
-		 */
-		if (io_node) {
-			memcpy(hold_IO_node, io_node, sizeof(struct pci_resource));
-			io_node->next = NULL;
+	/* set up resource lists that are now aligned on top and bottom
+	 * for anything behind the bridge.
+	 */
+	temp_resources.bus_head = bus_node;
+	temp_resources.io_head = io_node;
+	temp_resources.mem_head = mem_node;
+	temp_resources.p_mem_head = p_mem_node;
+	temp_resources.irqs = &irqs;
+
+	/* Make copies of the nodes we are going to pass down so that
+	 * if there is a problem,we can just use these to free resources
+	 */
+	hold_bus_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+	hold_IO_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+	hold_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+	hold_p_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
 
-			/* set IO base and Limit registers */
-			RES_CHECK(io_node->base, 8);
-			temp_byte = (u8)(io_node->base >> 8);
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte);
+	if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) {
+		kfree(hold_bus_node);
+		kfree(hold_IO_node);
+		kfree(hold_mem_node);
+		kfree(hold_p_mem_node);
 
-			RES_CHECK(io_node->base + io_node->length - 1, 8);
-			temp_byte = (u8)((io_node->base + io_node->length - 1) >> 8);
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
-		} else {
-			kfree(hold_IO_node);
-			hold_IO_node = NULL;
-		}
+		return 1;
+	}
 
-		/* If we have memory resources copy them and fill in the bridge's
-		 * memory range registers.  Otherwise, fill in the range
-		 * registers with values that disable them.
-		 */
-		if (mem_node) {
-			memcpy(hold_mem_node, mem_node, sizeof(struct pci_resource));
-			mem_node->next = NULL;
+	memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource));
 
-			/* set Mem base and Limit registers */
-			RES_CHECK(mem_node->base, 16);
-			temp_word = (u32)(mem_node->base >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+	bus_node->base += 1;
+	bus_node->length -= 1;
+	bus_node->next = NULL;
 
-			RES_CHECK(mem_node->base + mem_node->length - 1, 16);
-			temp_word = (u32)((mem_node->base + mem_node->length - 1) >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
-		} else {
-			temp_word = 0xFFFF;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+	/* If we have IO resources copy them and fill in the bridge's
+	 * IO range registers
+	 */
+	if (io_node) {
+		memcpy(hold_IO_node, io_node, sizeof(struct pci_resource));
+		io_node->next = NULL;
+
+		/* set IO base and Limit registers */
+		RES_CHECK(io_node->base, 8);
+		temp_byte = (u8)(io_node->base >> 8);
+		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte);
+
+		RES_CHECK(io_node->base + io_node->length - 1, 8);
+		temp_byte = (u8)((io_node->base + io_node->length - 1) >> 8);
+		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
+	} else {
+		kfree(hold_IO_node);
+		hold_IO_node = NULL;
+	}
 
-			temp_word = 0x0000;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+	/* If we have memory resources copy them and fill in the bridge's
+	 * memory range registers.  Otherwise, fill in the range
+	 * registers with values that disable them.
+	 */
+	rc = configure_bridge(pci_bus, devfn, mem_node, &hold_mem_node,
+				PCI_MEMORY_BASE, PCI_MEMORY_LIMIT);
 
-			kfree(hold_mem_node);
-			hold_mem_node = NULL;
-		}
+	/* If we have prefetchable memory resources copy them and 
+	 * fill in the bridge's memory range registers.  Otherwise,
+	 * fill in the range registers with values that disable them.
+	 */
+	rc = configure_bridge(pci_bus, devfn, p_mem_node, &hold_p_mem_node,
+				PCI_PREF_MEMORY_BASE, PCI_PREF_MEMORY_LIMIT);
 
-		/* If we have prefetchable memory resources copy them and 
-		 * fill in the bridge's memory range registers.  Otherwise,
-		 * fill in the range registers with values that disable them.
-		 */
-		if (p_mem_node) {
-			memcpy(hold_p_mem_node, p_mem_node, sizeof(struct pci_resource));
-			p_mem_node->next = NULL;
+	/* Adjust this to compensate for extra adjustment in first loop */
+	irqs.barber_pole--;
 
-			/* set Pre Mem base and Limit registers */
-			RES_CHECK(p_mem_node->base, 16);
-			temp_word = (u32)(p_mem_node->base >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
+	rc = 0;
 
-			RES_CHECK(p_mem_node->base + p_mem_node->length - 1, 16);
-			temp_word = (u32)((p_mem_node->base + p_mem_node->length - 1) >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
-		} else {
-			temp_word = 0xFFFF;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
+	/* Here we actually find the devices and configure them */
+	for (device = 0; (device <= 0x1F) && !rc; device++) {
+		irqs.barber_pole = (irqs.barber_pole + 1) & 0x03;
 
-			temp_word = 0x0000;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
+		ID = 0xFFFFFFFF;
+		pci_bus->number = hold_bus_node->base;
+		pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID);
+		pci_bus->number = func->bus;
 
-			kfree(hold_p_mem_node);
-			hold_p_mem_node = NULL;
-		}
+		if (ID != 0xFFFFFFFF) {	  /*  device Present */
+			/* Setup slot structure. */
+			new_slot = pciehp_slot_create(hold_bus_node->base);
 
-		/* Adjust this to compensate for extra adjustment in first loop */
-		irqs.barber_pole--;
+			if (new_slot == NULL) {
+				/* Out of memory */
+				rc = -ENOMEM;
+				continue;
+			}
 
-		rc = 0;
+			new_slot->bus = hold_bus_node->base;
+			new_slot->device = device;
+			new_slot->function = 0;
+			new_slot->is_a_board = 1;
+			new_slot->status = 0;
 
-		/* Here we actually find the devices and configure them */
-		for (device = 0; (device <= 0x1F) && !rc; device++) {
-			irqs.barber_pole = (irqs.barber_pole + 1) & 0x03;
+			rc = configure_new_device(ctrl, new_slot, 1,
+					&temp_resources, func->bus,
+					func->device);
+			dbg("configure_new_device rc=0x%x\n",rc);
+		}	/* End of IF (device in slot?) */
+	}		/* End of FOR loop */
 
-			ID = 0xFFFFFFFF;
-			pci_bus->number = hold_bus_node->base;
-			pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID);
-			pci_bus->number = func->bus;
+	if (rc) {
+		pciehp_destroy_resource_list(&temp_resources);
 
-			if (ID != 0xFFFFFFFF) {	  /*  device Present */
-				/* Setup slot structure. */
-				new_slot = pciehp_slot_create(hold_bus_node->base);
+		return_resource(&(resources->bus_head), hold_bus_node);
+		return_resource(&(resources->io_head), hold_IO_node);
+		return_resource(&(resources->mem_head), hold_mem_node);
+		return_resource(&(resources->p_mem_head), hold_p_mem_node);
+		return(rc);
+	}
 
-				if (new_slot == NULL) {
-					/* Out of memory */
-					rc = -ENOMEM;
-					continue;
+	/* save the interrupt routing information */
+	if (resources->irqs) {
+		resources->irqs->interrupt[0] = irqs.interrupt[0];
+		resources->irqs->interrupt[1] = irqs.interrupt[1];
+		resources->irqs->interrupt[2] = irqs.interrupt[2];
+		resources->irqs->interrupt[3] = irqs.interrupt[3];
+		resources->irqs->valid_INT = irqs.valid_INT;
+	} else if (!behind_bridge) {
+		/* We need to hook up the interrupts here */
+		for (cloop = 0; cloop < 4; cloop++) {
+			if (irqs.valid_INT & (0x01 << cloop)) {
+				rc = pciehp_set_irq(func->bus, func->device,
+							0x0A + cloop, irqs.interrupt[cloop]);
+				if (rc) {
+					pciehp_destroy_resource_list (&temp_resources);
+					return_resource(&(resources->bus_head), hold_bus_node);
+					return_resource(&(resources->io_head), hold_IO_node);
+					return_resource(&(resources->mem_head), hold_mem_node);
+					return_resource(&(resources->p_mem_head), hold_p_mem_node);
+					return rc;
 				}
+			}
+		}	/* end of for loop */
+	}
 
-				new_slot->bus = hold_bus_node->base;
-				new_slot->device = device;
-				new_slot->function = 0;
-				new_slot->is_a_board = 1;
-				new_slot->status = 0;
+	/* Return unused bus resources
+	 * First use the temporary node to store information for the board
+	 */
+	if (hold_bus_node && bus_node && temp_resources.bus_head) {
+		hold_bus_node->length = bus_node->base - hold_bus_node->base;
 
-				rc = configure_new_device(ctrl, new_slot, 1, &temp_resources, func->bus, func->device);
-				dbg("configure_new_device rc=0x%x\n",rc);
-			}	/* End of IF (device in slot?) */
-		}		/* End of FOR loop */
+		hold_bus_node->next = func->bus_head;
+		func->bus_head = hold_bus_node;
 
-		if (rc) {
-			pciehp_destroy_resource_list(&temp_resources);
+		temp_byte = (u8)(temp_resources.bus_head->base - 1);
 
-			return_resource(&(resources->bus_head), hold_bus_node);
-			return_resource(&(resources->io_head), hold_IO_node);
-			return_resource(&(resources->mem_head), hold_mem_node);
-			return_resource(&(resources->p_mem_head), hold_p_mem_node);
-			return(rc);
-		}
+		/* set subordinate bus */
+		dbg("re-set subordinate bus = 0x%x\n", temp_byte);
+		rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
 
-		/* save the interrupt routing information */
-		if (resources->irqs) {
-			resources->irqs->interrupt[0] = irqs.interrupt[0];
-			resources->irqs->interrupt[1] = irqs.interrupt[1];
-			resources->irqs->interrupt[2] = irqs.interrupt[2];
-			resources->irqs->interrupt[3] = irqs.interrupt[3];
-			resources->irqs->valid_INT = irqs.valid_INT;
-		} else if (!behind_bridge) {
-			/* We need to hook up the interrupts here */
-			for (cloop = 0; cloop < 4; cloop++) {
-				if (irqs.valid_INT & (0x01 << cloop)) {
-					rc = pciehp_set_irq(func->bus, func->device,
-							   0x0A + cloop, irqs.interrupt[cloop]);
-					if (rc) {
-						pciehp_destroy_resource_list (&temp_resources);
-						return_resource(&(resources->bus_head), hold_bus_node);
-						return_resource(&(resources->io_head), hold_IO_node);
-						return_resource(&(resources->mem_head), hold_mem_node);
-						return_resource(&(resources->p_mem_head), hold_p_mem_node);
-						return rc;
-					}
-				}
-			}	/* end of for loop */
+		if (temp_resources.bus_head->length == 0) {
+			kfree(temp_resources.bus_head);
+			temp_resources.bus_head = NULL;
+		} else {
+			dbg("return bus res of b:d(0x%x:%x) base:len(0x%x:%x)\n",
+				func->bus, func->device, temp_resources.bus_head->base, temp_resources.bus_head->length);
+			return_resource(&(resources->bus_head), temp_resources.bus_head);
 		}
+	}
 
-		/* Return unused bus resources
-		 * First use the temporary node to store information for the board
-		 */
-		if (hold_bus_node && bus_node && temp_resources.bus_head) {
-			hold_bus_node->length = bus_node->base - hold_bus_node->base;
-
-			hold_bus_node->next = func->bus_head;
-			func->bus_head = hold_bus_node;
+	/* If we have IO space available and there is some left,
+	 * return the unused portion
+	 */
+	if (hold_IO_node && temp_resources.io_head) {
+		io_node = do_pre_bridge_resource_split(&(temp_resources.io_head),
+							&hold_IO_node, 0x1000);
 
-			temp_byte = (u8)(temp_resources.bus_head->base - 1);
+		/* Check if we were able to split something off */
+		if (io_node) {
+			hold_IO_node->base = io_node->base + io_node->length;
 
-			/* set subordinate bus */
-			dbg("re-set subordinate bus = 0x%x\n", temp_byte);
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte);
+			RES_CHECK(hold_IO_node->base, 8);
+			temp_byte = (u8)((hold_IO_node->base) >> 8);
+			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte);
 
-			if (temp_resources.bus_head->length == 0) {
-				kfree(temp_resources.bus_head);
-				temp_resources.bus_head = NULL;
-			} else {
-				dbg("return bus res of b:d(0x%x:%x) base:len(0x%x:%x)\n",
-					func->bus, func->device, temp_resources.bus_head->base, temp_resources.bus_head->length);
-				return_resource(&(resources->bus_head), temp_resources.bus_head);
-			}
+			return_resource(&(resources->io_head), io_node);
 		}
 
-		/* If we have IO space available and there is some left,
-		 * return the unused portion
-		 */
-		if (hold_IO_node && temp_resources.io_head) {
-			io_node = do_pre_bridge_resource_split(&(temp_resources.io_head),
-							       &hold_IO_node, 0x1000);
-
-			/* Check if we were able to split something off */
-			if (io_node) {
-				hold_IO_node->base = io_node->base + io_node->length;
-
-				RES_CHECK(hold_IO_node->base, 8);
-				temp_byte = (u8)((hold_IO_node->base) >> 8);
-				rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte);
-
-				return_resource(&(resources->io_head), io_node);
-			}
-
-			io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000);
+		io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000);
 
-			/*  Check if we were able to split something off */
-			if (io_node) {
-				/* First use the temporary node to store information for the board */
-				hold_IO_node->length = io_node->base - hold_IO_node->base;
+		/*  Check if we were able to split something off */
+		if (io_node) {
+			/* First use the temporary node to store information for the board */
+			hold_IO_node->length = io_node->base - hold_IO_node->base;
 
-				/* If we used any, add it to the board's list */
-				if (hold_IO_node->length) {
-					hold_IO_node->next = func->io_head;
-					func->io_head = hold_IO_node;
+			/* If we used any, add it to the board's list */
+			if (hold_IO_node->length) {
+				hold_IO_node->next = func->io_head;
+				func->io_head = hold_IO_node;
 
-					RES_CHECK(io_node->base - 1, 8);
-					temp_byte = (u8)((io_node->base - 1) >> 8);
-					rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
+				RES_CHECK(io_node->base - 1, 8);
+				temp_byte = (u8)((io_node->base - 1) >> 8);
+				rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
 
-					return_resource(&(resources->io_head), io_node);
-				} else {
-					/* it doesn't need any IO */
-					temp_byte = 0x00;
-					rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
-
-					return_resource(&(resources->io_head), io_node);
-					kfree(hold_IO_node);
-				}
+				return_resource(&(resources->io_head), io_node);
 			} else {
-				/* it used most of the range */
-				hold_IO_node->next = func->io_head;
-				func->io_head = hold_IO_node;
+				/* it doesn't need any IO */
+				temp_byte = 0x00;
+				rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
+
+				return_resource(&(resources->io_head), io_node);
+				kfree(hold_IO_node);
 			}
-		} else if (hold_IO_node) {
-			/* it used the whole range */
+		} else {
+			/* it used most of the range */
 			hold_IO_node->next = func->io_head;
 			func->io_head = hold_IO_node;
 		}
+	} else if (hold_IO_node) {
+		/* it used the whole range */
+		hold_IO_node->next = func->io_head;
+		func->io_head = hold_IO_node;
+	}
 
-		/* If we have memory space available and there is some left,
-		 * return the unused portion
-		 */
-		if (hold_mem_node && temp_resources.mem_head) {
-			mem_node = do_pre_bridge_resource_split(&(temp_resources.mem_head), &hold_mem_node, 0x100000L);
-
-			/* Check if we were able to split something off */
-			if (mem_node) {
-				hold_mem_node->base = mem_node->base + mem_node->length;
+	/* If we have memory space available and there is some left,
+	 * return the unused portion
+	 */
+	if (hold_mem_node && temp_resources.mem_head) {
+		mem_node = do_pre_bridge_resource_split(&(temp_resources.mem_head), &hold_mem_node, 0x100000L);
 
-				RES_CHECK(hold_mem_node->base, 16);
-				temp_word = (u32)((hold_mem_node->base) >> 16);
-				rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+		/* Check if we were able to split something off */
+		if (mem_node) {
+			hold_mem_node->base = mem_node->base + mem_node->length;
 
-				return_resource(&(resources->mem_head), mem_node);
-			}
+			RES_CHECK(hold_mem_node->base, 16);
+			temp_word = (u16)((hold_mem_node->base) >> 16);
+			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
 
-			mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000L);
+			return_resource(&(resources->mem_head), mem_node);
+		}
 
-			/* Check if we were able to split something off */
-			if (mem_node) {
-				/* First use the temporary node to store information for the board */
-				hold_mem_node->length = mem_node->base - hold_mem_node->base;
+		mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000L);
 
-				if (hold_mem_node->length) {
-					hold_mem_node->next = func->mem_head;
-					func->mem_head = hold_mem_node;
+		/* Check if we were able to split something off */
+		if (mem_node) {
+			/* First use the temporary node to store information for the board */
+			hold_mem_node->length = mem_node->base - hold_mem_node->base;
 
-					/* configure end address */
-					RES_CHECK(mem_node->base - 1, 16);
-					temp_word = (u32)((mem_node->base - 1) >> 16);
-					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+			if (hold_mem_node->length) {
+				hold_mem_node->next = func->mem_head;
+				func->mem_head = hold_mem_node;
 
-					/* Return unused resources to the pool */
-					return_resource(&(resources->mem_head), mem_node);
-				} else {
-					/* it doesn't need any Mem */
-					temp_word = 0x0000;
-					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+				/* configure end address */
+				RES_CHECK(mem_node->base - 1, 16);
+				temp_word = (u16)((mem_node->base - 1) >> 16);
+				rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 
-					return_resource(&(resources->mem_head), mem_node);
-					kfree(hold_mem_node);
-				}
+				/* Return unused resources to the pool */
+				return_resource(&(resources->mem_head), mem_node);
 			} else {
-				/* it used most of the range */
-				hold_mem_node->next = func->mem_head;
-				func->mem_head = hold_mem_node;
+				/* it doesn't need any Mem */
+				temp_word = 0x0000;
+				rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+
+				return_resource(&(resources->mem_head), mem_node);
+				kfree(hold_mem_node);
 			}
-		} else if (hold_mem_node) {
-			/* it used the whole range */
+		} else {
+			/* it used most of the range */
 			hold_mem_node->next = func->mem_head;
 			func->mem_head = hold_mem_node;
 		}
+	} else if (hold_mem_node) {
+		/* it used the whole range */
+		hold_mem_node->next = func->mem_head;
+		func->mem_head = hold_mem_node;
+	}
 
-		/* If we have prefetchable memory space available and there is some 
-		 * left at the end, return the unused portion
-		 */
-		if (hold_p_mem_node && temp_resources.p_mem_head) {
-			p_mem_node = do_pre_bridge_resource_split(&(temp_resources.p_mem_head),
-								  &hold_p_mem_node, 0x100000L);
-
-			/* Check if we were able to split something off */
-			if (p_mem_node) {
-				hold_p_mem_node->base = p_mem_node->base + p_mem_node->length;
+	/* If we have prefetchable memory space available and there is some 
+	 * left at the end, return the unused portion
+	 */
+	if (hold_p_mem_node && temp_resources.p_mem_head) {
+		p_mem_node = do_pre_bridge_resource_split(&(temp_resources.p_mem_head),
+								&hold_p_mem_node, 0x100000L);
 
-				RES_CHECK(hold_p_mem_node->base, 16);
-				temp_word = (u32)((hold_p_mem_node->base) >> 16);
-				rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
+		/* Check if we were able to split something off */
+		if (p_mem_node) {
+			hold_p_mem_node->base = p_mem_node->base + p_mem_node->length;
 
-				return_resource(&(resources->p_mem_head), p_mem_node);
-			}
+			RES_CHECK(hold_p_mem_node->base, 16);
+			temp_word = (u16)((hold_p_mem_node->base) >> 16);
+			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
 
-			p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000L);
+			return_resource(&(resources->p_mem_head), p_mem_node);
+		}
 
-			/* Check if we were able to split something off */
-			if (p_mem_node) {
-				/* First use the temporary node to store information for the board */
-				hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base;
+		p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000L);
 
-				/* If we used any, add it to the board's list */
-				if (hold_p_mem_node->length) {
-					hold_p_mem_node->next = func->p_mem_head;
-					func->p_mem_head = hold_p_mem_node;
+		/* Check if we were able to split something off */
+		if (p_mem_node) {
+			/* First use the temporary node to store information for the board */
+			hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base;
 
-					RES_CHECK(p_mem_node->base - 1, 16);
-					temp_word = (u32)((p_mem_node->base - 1) >> 16);
-					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
+			/* If we used any, add it to the board's list */
+			if (hold_p_mem_node->length) {
+				hold_p_mem_node->next = func->p_mem_head;
+				func->p_mem_head = hold_p_mem_node;
 
-					return_resource(&(resources->p_mem_head), p_mem_node);
-				} else {
-					/* it doesn't need any PMem */
-					temp_word = 0x0000;
-					rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
+				RES_CHECK(p_mem_node->base - 1, 16);
+				temp_word = (u16)((p_mem_node->base - 1) >> 16);
+				rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
 
-					return_resource(&(resources->p_mem_head), p_mem_node);
-					kfree(hold_p_mem_node);
-				}
+				return_resource(&(resources->p_mem_head), p_mem_node);
 			} else {
-				/* it used the most of the range */
-				hold_p_mem_node->next = func->p_mem_head;
-				func->p_mem_head = hold_p_mem_node;
+				/* it doesn't need any PMem */
+				temp_word = 0x0000;
+				rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
+
+				return_resource(&(resources->p_mem_head), p_mem_node);
+				kfree(hold_p_mem_node);
 			}
-		} else if (hold_p_mem_node) {
-			/* it used the whole range */
+		} else {
+			/* it used the most of the range */
 			hold_p_mem_node->next = func->p_mem_head;
 			func->p_mem_head = hold_p_mem_node;
 		}
+	} else if (hold_p_mem_node) {
+		/* it used the whole range */
+		hold_p_mem_node->next = func->p_mem_head;
+		func->p_mem_head = hold_p_mem_node;
+	}
 
-		/* We should be configuring an IRQ and the bridge's base address
-		 * registers if it needs them.  Although we have never seen such
-		 * a device
-		 */
+	/* We should be configuring an IRQ and the bridge's base address
+	 * registers if it needs them.  Although we have never seen such
+	 * a device
+	 */
+
+	pciehprm_enable_card(ctrl, func, PCI_HEADER_TYPE_BRIDGE);
+
+	dbg("PCI Bridge Hot-Added s:b:d:f(%02x:%02x:%02x:%02x)\n", ctrl->seg, func->bus, func->device, func->function);
+
+	return rc;
+}
+
+/**
+ * configure_new_function - Configures the PCI header information of one device
+ *
+ * @ctrl: pointer to controller structure
+ * @func: pointer to function structure
+ * @behind_bridge: 1 if this is a recursive call, 0 if not
+ * @resources: pointer to set of resource lists
+ *
+ * Calls itself recursively for bridged devices.
+ * Returns 0 if success
+ *
+ */
+static int
+configure_new_function(struct controller *ctrl, struct pci_func *func,
+		u8 behind_bridge, struct resource_lists *resources,
+		u8 bridge_bus, u8 bridge_dev)
+{
+	int cloop;
+	u8 temp_byte;
+	u8 class_code;
+	u16 temp_word;
+	u32 rc;
+	u32 temp_register;
+	u32 base;
+	unsigned int devfn;
+	struct pci_resource *mem_node;
+	struct pci_resource *io_node;
+	struct pci_bus lpci_bus, *pci_bus;
+
+	memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus));
+	pci_bus = &lpci_bus;
+	pci_bus->number = func->bus;
+	devfn = PCI_DEVFN(func->device, func->function);
+
+	/* Check for Bridge */
+	rc = pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte);
+	if (rc)
+		return rc;
+	dbg("%s: bus %x dev %x func %x temp_byte = %x\n", __FUNCTION__,
+		func->bus, func->device, func->function, temp_byte);
 
-		pciehprm_enable_card(ctrl, func, PCI_HEADER_TYPE_BRIDGE);
+	if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */
+		rc = configure_new_bridge(ctrl, func, behind_bridge, resources,
+						pci_bus);
 
-		dbg("PCI Bridge Hot-Added s:b:d:f(%02x:%02x:%02x:%02x)\n", ctrl->seg, func->bus, func->device, func->function);
+		if (rc)
+			return rc;
 	} else if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_NORMAL) {
 		/* Standard device */
 		u64	base64;
-		rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);
+		rc = pci_bus_read_config_byte(pci_bus, devfn, 0x0B, &class_code);
 
 		if (class_code == PCI_BASE_CLASS_DISPLAY)
-			return (DEVICE_TYPE_NOT_SUPPORTED);
+			return DEVICE_TYPE_NOT_SUPPORTED;
 
 		/* Figure out IO and memory needs */
 		for (cloop = PCI_BASE_ADDRESS_0; cloop <= PCI_BASE_ADDRESS_5; cloop += 4) {
@@ -2535,7 +2557,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 					else {
 						if (prefetchable)
 							dbg("using MEM for PMEM\n");
-						mem_node=get_resource(&(resources->mem_head), (ulong)base);
+						mem_node = get_resource(&(resources->mem_head), (ulong)base);
 					}
 
 					/* allocate the resource to the board */
@@ -2614,11 +2636,10 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 	}  /* End of Not-A-Bridge else */
 	else {
 		/* It's some strange type of PCI adapter (Cardbus?) */
-		return(DEVICE_TYPE_NOT_SUPPORTED);
+		return DEVICE_TYPE_NOT_SUPPORTED;
 	}
 
 	func->configured = 1;
 
 	return 0;
 }
-
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 1774a5ef3..2a68ace53 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -291,14 +291,14 @@ static void start_int_poll_timer(struct php_ctlr_state_s *php_ctlr, int seconds)
 
 static int pcie_write_cmd(struct slot *slot, u16 cmd)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	int retval = 0;
 	u16 slot_status;
 
 	DBG_ENTER_ROUTINE 
 	
 	dbg("%s : Enter\n", __FUNCTION__);
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -331,13 +331,13 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd)
 
 static int hpc_check_lnk_status(struct controller *ctrl)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = ctrl->hpc_ctlr_handle;
 	u16 lnk_status;
 	int retval = 0;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -362,14 +362,14 @@ static int hpc_check_lnk_status(struct controller *ctrl)
 
 static int hpc_get_attention_status(struct slot *slot, u8 *status)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_ctrl;
 	u8 atten_led_state;
 	int retval = 0;
 	
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -409,14 +409,14 @@ static int hpc_get_attention_status(struct slot *slot, u8 *status)
 
 static int hpc_get_power_status(struct slot * slot, u8 *status)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_ctrl;
 	u8 pwr_state;
 	int	retval = 0;
 	
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -450,13 +450,13 @@ static int hpc_get_power_status(struct slot * slot, u8 *status)
 
 static int hpc_get_latch_status(struct slot *slot, u8 *status)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_status;
 	int retval = 0;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -476,14 +476,14 @@ static int hpc_get_latch_status(struct slot *slot, u8 *status)
 
 static int hpc_get_adapter_status(struct slot *slot, u8 *status)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_status;
 	u8 card_state;
 	int retval = 0;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -503,7 +503,7 @@ static int hpc_get_adapter_status(struct slot *slot, u8 *status)
 
 static int hpc_query_power_fault(struct slot * slot)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_status;
 	u8 pwr_fault;
 	int retval = 0;
@@ -511,7 +511,7 @@ static int hpc_query_power_fault(struct slot * slot)
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -532,13 +532,13 @@ static int hpc_query_power_fault(struct slot * slot)
 
 static int hpc_set_attention_status(struct slot *slot, u8 value)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd = 0;
 	u16 slot_ctrl;
 	int rc = 0;
 
 	dbg("%s: \n", __FUNCTION__);
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -580,13 +580,13 @@ static int hpc_set_attention_status(struct slot *slot, u8 value)
 
 static void hpc_set_green_led_on(struct slot *slot)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd;
 	u16 slot_ctrl;
 	int rc = 0;
        	
 	dbg("%s: \n", __FUNCTION__);	
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return ;
 	}
@@ -615,13 +615,13 @@ static void hpc_set_green_led_on(struct slot *slot)
 
 static void hpc_set_green_led_off(struct slot *slot)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd;
 	u16 slot_ctrl;
 	int rc = 0;
 
 	dbg("%s: \n", __FUNCTION__);	
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return ;
 	}
@@ -651,13 +651,13 @@ static void hpc_set_green_led_off(struct slot *slot)
 
 static void hpc_set_green_led_blink(struct slot *slot)
 {
-	struct php_ctlr_state_s *php_ctlr =(struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd;
 	u16 slot_ctrl;
 	int rc = 0; 
 	
 	dbg("%s: \n", __FUNCTION__);	
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return ;
 	}
@@ -692,13 +692,13 @@ int pcie_get_ctlr_slot_config(struct controller *ctrl,
 	int *updown,		/* physical_slot_num increament: 1 or -1	*/
 	int *flags)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = ctrl->hpc_ctlr_handle;
 	u32 slot_cap;
 	int rc = 0;
 	
 	DBG_ENTER_ROUTINE 
 
-	if (!ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -723,12 +723,12 @@ int pcie_get_ctlr_slot_config(struct controller *ctrl,
 
 static void hpc_release_ctlr(struct controller *ctrl)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = ctrl->hpc_ctlr_handle;
 	struct php_ctlr_state_s *p, *p_prev;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return ;
 	}
@@ -769,7 +769,7 @@ static void hpc_release_ctlr(struct controller *ctrl)
 
 static int hpc_power_on_slot(struct slot * slot)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd;
 	u16 slot_ctrl;
 
@@ -778,7 +778,7 @@ static int hpc_power_on_slot(struct slot * slot)
 	DBG_ENTER_ROUTINE 
 	dbg("%s: \n", __FUNCTION__);	
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -818,7 +818,7 @@ static int hpc_power_on_slot(struct slot * slot)
 
 static int hpc_power_off_slot(struct slot * slot)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	u16 slot_cmd;
 	u16 slot_ctrl;
 
@@ -827,7 +827,7 @@ static int hpc_power_off_slot(struct slot * slot)
 	DBG_ENTER_ROUTINE 
 	dbg("%s: \n", __FUNCTION__);	
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -879,10 +879,10 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
 		return IRQ_NONE;
 
 	if (!pciehp_poll_mode) { 
-		ctrl = (struct controller *)dev_id;
+		ctrl = dev_id;
 		php_ctlr = ctrl->hpc_ctlr_handle;
 	} else {
-		php_ctlr = (struct php_ctlr_state_s *) dev_id;
+		php_ctlr = dev_id;
 		ctrl = (struct controller *)php_ctlr->callback_instance_id;
 	}
 
@@ -1017,14 +1017,14 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
 
 static int hpc_get_max_lnk_speed (struct slot *slot, enum pcie_link_speed *value)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	enum pcie_link_speed lnk_speed;
 	u32	lnk_cap;
 	int retval = 0;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -1058,14 +1058,14 @@ static int hpc_get_max_lnk_speed (struct slot *slot, enum pcie_link_speed *value
 
 static int hpc_get_max_lnk_width (struct slot *slot, enum pcie_link_width *value)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	enum pcie_link_width lnk_wdth;
 	u32	lnk_cap;
 	int retval = 0;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -1120,14 +1120,14 @@ static int hpc_get_max_lnk_width (struct slot *slot, enum pcie_link_width *value
 
 static int hpc_get_cur_lnk_speed (struct slot *slot, enum pcie_link_speed *value)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	enum pcie_link_speed lnk_speed = PCI_SPEED_UNKNOWN;
 	int retval = 0;
 	u16 lnk_status;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -1161,14 +1161,14 @@ static int hpc_get_cur_lnk_speed (struct slot *slot, enum pcie_link_speed *value
 
 static int hpc_get_cur_lnk_width (struct slot *slot, enum pcie_link_width *value)
 {
-	struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle;
+	struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
 	enum pcie_link_width lnk_wdth = PCIE_LNK_WIDTH_UNKNOWN;
 	int retval = 0;
 	u16 lnk_status;
 
 	DBG_ENTER_ROUTINE 
 
-	if (!slot->ctrl->hpc_ctlr_handle) {
+	if (!php_ctlr) {
 		err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
 		return -1;
 	}
@@ -1245,7 +1245,7 @@ static struct hpc_ops pciehp_hpc_ops = {
 };
 
 int pcie_init(struct controller * ctrl,
-	struct pci_dev * pdev,
+	struct pci_dev *pdev,
 	php_intr_callback_t attention_button_callback,
 	php_intr_callback_t switch_change_callback,
 	php_intr_callback_t presence_change_callback,
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 200449ab0..8aa17540f 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -69,7 +69,7 @@ int pciehp_configure_device (struct controller* ctrl, struct pci_func* func)
 
 	if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
 		pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus);
-		child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus);
+		child = pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus);
 		pci_do_scan_bus(child);
 
 	}
@@ -83,10 +83,12 @@ int pciehp_unconfigure_device(struct pci_func* func)
 	int rc = 0;
 	int j;
 
-	dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function);
+	dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus,
+				func->device, func->function);
 
 	for (j=0; j<8 ; j++) {
-		struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j);
+		struct pci_dev* temp = pci_find_slot(func->bus,
+				(func->device << 3) | j);
 		if (temp) {
 			pci_remove_bus_device(temp);
 		}
@@ -169,7 +171,8 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 	memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus));
 	pci_bus = &lpci_bus;
 
-	dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, num_ctlr_slots, first_device_num);
+	dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__,
+				num_ctlr_slots, first_device_num);
 
 	/*   Decide which slots are supported */
 	if (is_hot_plug) {
@@ -183,7 +186,8 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 		LastSupported = 0x1F;
 	}
 
-	dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported, LastSupported);
+	dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported,
+					LastSupported);
 
 	/*   Save PCI configuration space for all devices in supported slots */
 	dbg("%s: pci_bus->number = %x\n", __FUNCTION__, pci_bus->number);
@@ -191,15 +195,18 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 	dbg("%s: bus = %x, dev = %x\n", __FUNCTION__, busnumber, device);
 	for (device = FirstSupported; device <= LastSupported; device++) {
 		ID = 0xFFFFFFFF;
-		rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID);
+		rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0),
+					PCI_VENDOR_ID, &ID);
 
 		if (ID != 0xFFFFFFFF) {	  /*  device in slot */
 			dbg("%s: ID = %x\n", __FUNCTION__, ID);
-			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), 0x0B, &class_code);
+			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0),
+					0x0B, &class_code);
 			if (rc)
 				return rc;
 
-			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), PCI_HEADER_TYPE, &header_type);
+			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0),
+					PCI_HEADER_TYPE, &header_type);
 			if (rc)
 				return rc;
 
@@ -221,7 +228,8 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 					/* Recurse the subordinate bus
 					 * get the subordinate bus number
 					 */
-					rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), 
+					rc = pci_bus_read_config_byte(pci_bus,
+						PCI_DEVFN(device, function), 
 						PCI_SECONDARY_BUS, &secondary_bus);
 					if (rc) {
 						return rc;
@@ -263,13 +271,17 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 				new_slot->switch_save = 0x10;
 				/* In case of unsupported board */
 				new_slot->status = DevError;
-				new_slot->pci_dev = pci_find_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function);
+				new_slot->pci_dev = pci_find_slot(new_slot->bus,
+					(new_slot->device << 3) | new_slot->function);
 				dbg("new_slot->pci_dev = %p\n", new_slot->pci_dev);
 
 				for (cloop = 0; cloop < 0x20; cloop++) {
-					rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), cloop << 2, 
-						(u32 *) & (new_slot->config_space [cloop]));
-					/* dbg("new_slot->config_space[%x] = %x\n", cloop, new_slot->config_space[cloop]); */
+					rc = pci_bus_read_config_dword(pci_bus,
+						PCI_DEVFN(device, function),
+						cloop << 2, 
+						(u32 *) &(new_slot->config_space [cloop]));
+					/* dbg("new_slot->config_space[%x] = %x\n",
+						cloop, new_slot->config_space[cloop]); */
 					if (rc)
 						return rc;
 				}
@@ -284,19 +296,23 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 
 				while ((function < max_functions)&&(!stop_it)) {
 					dbg("%s: In while loop \n", __FUNCTION__);
-					rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), PCI_VENDOR_ID, &ID);
+					rc = pci_bus_read_config_dword(pci_bus,
+							PCI_DEVFN(device, function),
+							PCI_VENDOR_ID, &ID);
 
 					if (ID == 0xFFFFFFFF) {  /* nothing there. */
 						function++;
 						dbg("Nothing there\n");
 					} else {  /* Something there */
-						rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), 0x0B, 
-							&class_code);
+						rc = pci_bus_read_config_byte(pci_bus,
+							PCI_DEVFN(device, function),
+							0x0B, &class_code);
 						if (rc)
 							return rc;
 
-						rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), PCI_HEADER_TYPE, 
-							&header_type);
+						rc = pci_bus_read_config_byte(pci_bus,
+							PCI_DEVFN(device, function),
+							PCI_HEADER_TYPE, &header_type);
 						if (rc)
 							return rc;
 
@@ -306,8 +322,8 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 				}
 
 			} while (function < max_functions);
-		}		/* End of IF (device in slot?) */
-		else if (is_hot_plug) {
+			/* End of IF (device in slot?) */
+		} else if (is_hot_plug) {
 			/* Setup slot structure with entry for empty slot */
 			new_slot = pciehp_slot_create(busnumber);
 
@@ -339,7 +355,7 @@ int pciehp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
  *
  * returns 0 if success
  */
-int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot)
+int pciehp_save_slot_config(struct controller *ctrl, struct pci_func * new_slot)
 {
 	int rc;
 	u8 class_code;
@@ -358,12 +374,15 @@ int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 
 	ID = 0xFFFFFFFF;
 
-	pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID);
+	pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0),
+					PCI_VENDOR_ID, &ID);
 
 	if (ID != 0xFFFFFFFF) {	  /*  device in slot */
-		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code);
+		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0),
+					0x0B, &class_code);
 
-		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type);
+		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0),
+					PCI_HEADER_TYPE, &header_type);
 
 		if (header_type & 0x80)	/* Multi-function device */
 			max_functions = 8;
@@ -375,7 +394,8 @@ int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 		do {
 			if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {	  /* PCI-PCI Bridge */
 				/*  Recurse the subordinate bus */
-				pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), 
+				pci_bus_read_config_byte(pci_bus,
+					PCI_DEVFN(new_slot->device, function), 
 					PCI_SECONDARY_BUS, &secondary_bus);
 
 				sub_bus = (int) secondary_bus;
@@ -384,15 +404,17 @@ int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 				rc = pciehp_save_config(ctrl, sub_bus, 0, 0);
 
 				if (rc)
-					return(rc);
+					return rc;
 
 			}	/* End of IF */
 
 			new_slot->status = 0;
 
 			for (cloop = 0; cloop < 0x20; cloop++) {
-				pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), 
-					cloop << 2, (u32 *) & (new_slot->config_space [cloop]));
+				pci_bus_read_config_dword(pci_bus,
+					PCI_DEVFN(new_slot->device, function), 
+					cloop << 2,
+					(u32 *) &(new_slot->config_space [cloop]));
 			}
 
 			function++;
@@ -404,15 +426,20 @@ int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 			 */
 
 			while ((function < max_functions) && (!stop_it)) {
-				pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID);
+				pci_bus_read_config_dword(pci_bus,
+					PCI_DEVFN(new_slot->device, function),
+					PCI_VENDOR_ID, &ID);
 
 				if (ID == 0xFFFFFFFF) {	 /* nothing there. */
 					function++;
 				} else {  /* Something there */
-					pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code);
+					pci_bus_read_config_byte(pci_bus,
+						PCI_DEVFN(new_slot->device, function),
+						0x0B, &class_code);
 
-					pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, 
-						&header_type);
+					pci_bus_read_config_byte(pci_bus,
+						PCI_DEVFN(new_slot->device, function),
+						PCI_HEADER_TYPE, &header_type);
 
 					stop_it++;
 				}
@@ -421,10 +448,10 @@ int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 		} while (function < max_functions);
 	}			/* End of IF (device in slot?) */
 	else {
-		return(2);
+		return 2;
 	}
 
-	return(0);
+	return 0;
 }
 
 
@@ -440,7 +467,7 @@ int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
  *  it loops for all functions of the slot and disables them.
  * else, it just get resources of the function and return.
  */
-int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func, int disable)
+int pciehp_save_used_resources(struct controller *ctrl, struct pci_func *func, int disable)
 {
 	u8 cloop;
 	u8 header_type;
@@ -472,7 +499,7 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 		devfn = PCI_DEVFN(func->device, func->function);
 
 		/* Save the command register */
-		pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command);
+		pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command);
 
 		if (disable) {
 			/* disable card */
@@ -481,20 +508,22 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 		}
 
 		/* Check for Bridge */
-		pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
+		pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
 
 		if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {     /* PCI-PCI Bridge */
-			dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command);
+			dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n",
+					func->bus, func->device, save_command);
 			if (disable) {
 				/* Clear Bridge Control Register */
 				command = 0x00;
 				pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command);
 			}
 
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
 
-			bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			bus_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 			if (!bus_node)
 				return -ENOMEM;
 
@@ -505,13 +534,14 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 			func->bus_head = bus_node;
 
 			/* Save IO base and Limit registers */
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &temp_byte);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &temp_byte);
 			base = temp_byte;
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &temp_byte);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &temp_byte);
 			length = temp_byte;
 
 			if ((base <= length) && (!disable || (save_command & PCI_COMMAND_IO))) {
-				io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				io_node = kmalloc(sizeof(struct pci_resource),
+							GFP_KERNEL);
 				if (!io_node)
 					return -ENOMEM;
 
@@ -523,11 +553,12 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 			}
 
 			/* Save memory base and Limit registers */
-			pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
-			pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
 
 			if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) {
-				mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				mem_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 				if (!mem_node)
 					return -ENOMEM;
 
@@ -538,11 +569,12 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 				func->mem_head = mem_node;
 			}
 			/* Save prefetchable memory base and Limit registers */
-			pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
-			pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
 
 			if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) {
-				p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				p_mem_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 				if (!p_mem_node)
 					return -ENOMEM;
 
@@ -553,38 +585,41 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 				func->p_mem_head = p_mem_node;
 			}
 		} else if ((header_type & 0x7F) == PCI_HEADER_TYPE_NORMAL) {
-			dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command);
+			dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n",
+					func->bus, func->device, save_command);
 
 			/* Figure out IO and memory base lengths */
 			for (cloop = PCI_BASE_ADDRESS_0; cloop <= PCI_BASE_ADDRESS_5; cloop += 4) {
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base);
 
 				temp_register = 0xFFFFFFFF;
-				pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp_register);
+				pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &temp_register);
 
-				if (!disable) {
-					pci_bus_write_config_dword (pci_bus, devfn, cloop, save_base);
-				}
+				if (!disable)
+					pci_bus_write_config_dword(pci_bus, devfn, cloop, save_base);
 
 				if (!temp_register)
 					continue;
 
 				base = temp_register;
 
-				if ((base & PCI_BASE_ADDRESS_SPACE_IO) && (!disable || (save_command & PCI_COMMAND_IO))) {
+				if ((base & PCI_BASE_ADDRESS_SPACE_IO) &&
+						(!disable || (save_command & PCI_COMMAND_IO))) {
 					/* IO base */
 					/* set temp_register = amount of IO space requested */
 					base = base & 0xFFFFFFFCL;
 					base = (~base) + 1;
 
-					io_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL);
+					io_node = kmalloc(sizeof (struct pci_resource),
+								GFP_KERNEL);
 					if (!io_node)
 						return -ENOMEM;
 
 					io_node->base = (ulong)save_base & PCI_BASE_ADDRESS_IO_MASK;
 					io_node->length = (ulong)base;
-					dbg("sur adapter: IO bar=0x%x(length=0x%x)\n", io_node->base, io_node->length);
+					dbg("sur adapter: IO bar=0x%x(length=0x%x)\n",
+						io_node->base, io_node->length);
 
 					io_node->next = func->io_head;
 					func->io_head = io_node;
@@ -594,11 +629,13 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 					char *res_type_str = "PMEM";
 					u32 temp_register2;
 
-					t_mem_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL);
+					t_mem_node = kmalloc(sizeof (struct pci_resource),
+								GFP_KERNEL);
 					if (!t_mem_node)
 						return -ENOMEM;
 
-					if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) && (!disable || (save_command & PCI_COMMAND_MEMORY))) {
+					if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) &&
+							(!disable || (save_command & PCI_COMMAND_MEMORY))) {
 						prefetchable = 0;
 						mem_node = t_mem_node;
 						res_type_str++;
@@ -613,16 +650,20 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 						if (prefetchable) {
 							p_mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK;
 							p_mem_node->length = (ulong)base;
-							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, 
-								p_mem_node->base, p_mem_node->length);
+							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n",
+								res_type_str, 
+								p_mem_node->base,
+								p_mem_node->length);
 
 							p_mem_node->next = func->p_mem_head;
 							func->p_mem_head = p_mem_node;
 						} else {
 							mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK;
 							mem_node->length = (ulong)base;
-							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, 
-								mem_node->base, mem_node->length);
+							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n",
+								res_type_str, 
+								mem_node->base,
+								mem_node->length);
 
 							mem_node->next = func->mem_head;
 							func->mem_head = mem_node;
@@ -642,16 +683,20 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 						if (prefetchable) {
 							p_mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK;
 							p_mem_node->length = base;
-							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, 
-								p_mem_node->base, p_mem_node->length);
+							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n",
+								res_type_str, 
+								p_mem_node->base,
+								p_mem_node->length);
 
 							p_mem_node->next = func->p_mem_head;
 							func->p_mem_head = p_mem_node;
 						} else {
 							mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK;
 							mem_node->length = base;
-							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, 
-								mem_node->base, mem_node->length);
+							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n",
+								res_type_str, 
+								mem_node->base,
+								mem_node->length);
 
 							mem_node->next = func->mem_head;
 							func->mem_head = mem_node;
@@ -659,13 +704,15 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 						cloop += 4;
 						break;
 					default:
-						dbg("asur: reserved BAR type=0x%x\n", temp_register);
+						dbg("asur: reserved BAR type=0x%x\n",
+							temp_register);
 						break;
 					}
 				} 
 			}	/* End of base register loop */
 		} else {	/* Some other unknown header type */
-			dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n", func->bus, func->device);
+			dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n",
+					func->bus, func->device);
 		}
 
 		/* find the next device in this slot */
@@ -674,10 +721,29 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 		func = pciehp_slot_find(func->bus, func->device, index++);
 	}
 
-	return(0);
+	return 0;
 }
 
 
+/**
+ * kfree_resource_list: release memory of all list members
+ * @res: resource list to free
+ */
+static inline void
+return_resource_list(struct pci_resource **func, struct pci_resource **res)
+{
+	struct pci_resource *node;
+	struct pci_resource *t_node;
+
+	node = *func;
+	*func = NULL;
+	while (node) {
+		t_node = node->next;
+		return_resource(res, node);
+		node = t_node;
+	}
+}
+
 /*
  * pciehp_return_board_resources
  *
@@ -686,95 +752,40 @@ int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func,
  *
  * returns 0 if success
  */
-int pciehp_return_board_resources(struct pci_func * func, struct resource_lists * resources)
+int pciehp_return_board_resources(struct pci_func * func,
+				struct resource_lists * resources)
 {
-	int rc = 0;
-	struct pci_resource *node;
-	struct pci_resource *t_node;
+	int rc;
+
 	dbg("%s\n", __FUNCTION__);
 
 	if (!func)
-		return(1);
-
-	node = func->io_head;
-	func->io_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->io_head), node);
-		node = t_node;
-	}
+		return 1;
 
-	node = func->mem_head;
-	func->mem_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->mem_head), node);
-		node = t_node;
-	}
+	return_resource_list(&(func->io_head),&(resources->io_head));
+	return_resource_list(&(func->mem_head),&(resources->mem_head));
+	return_resource_list(&(func->p_mem_head),&(resources->p_mem_head));
+	return_resource_list(&(func->bus_head),&(resources->bus_head));
 
-	node = func->p_mem_head;
-	func->p_mem_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->p_mem_head), node);
-		node = t_node;
-	}
-
-	node = func->bus_head;
-	func->bus_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->bus_head), node);
-		node = t_node;
-	}
-
-	rc |= pciehp_resource_sort_and_combine(&(resources->mem_head));
+	rc = pciehp_resource_sort_and_combine(&(resources->mem_head));
 	rc |= pciehp_resource_sort_and_combine(&(resources->p_mem_head));
 	rc |= pciehp_resource_sort_and_combine(&(resources->io_head));
 	rc |= pciehp_resource_sort_and_combine(&(resources->bus_head));
 
-	return(rc);
+	return rc;
 }
 
-
-/*
- * pciehp_destroy_resource_list
- *
- * Puts node back in the resource list pointed to by head
+/**
+ * kfree_resource_list: release memory of all list members
+ * @res: resource list to free
  */
-void pciehp_destroy_resource_list (struct resource_lists * resources)
+static inline void
+kfree_resource_list(struct pci_resource **r)
 {
 	struct pci_resource *res, *tres;
 
-	res = resources->io_head;
-	resources->io_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = resources->mem_head;
-	resources->mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = resources->p_mem_head;
-	resources->p_mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = resources->bus_head;
-	resources->bus_head = NULL;
+	res = *r;
+	*r = NULL;
 
 	while (res) {
 		tres = res;
@@ -783,50 +794,26 @@ void pciehp_destroy_resource_list (struct resource_lists * resources)
 	}
 }
 
-
-/*
- * pciehp_destroy_board_resources
- *
- * Puts node back in the resource list pointed to by head
+/**
+ * pciehp_destroy_resource_list: put node back in the resource list
+ * @resources: list to put nodes back
  */
-void pciehp_destroy_board_resources (struct pci_func * func)
+void pciehp_destroy_resource_list(struct resource_lists * resources)
 {
-	struct pci_resource *res, *tres;
-
-	res = func->io_head;
-	func->io_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = func->mem_head;
-	func->mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = func->p_mem_head;
-	func->p_mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = func->bus_head;
-	func->bus_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
+	kfree_resource_list(&(resources->io_head));
+	kfree_resource_list(&(resources->mem_head));
+	kfree_resource_list(&(resources->p_mem_head));
+	kfree_resource_list(&(resources->bus_head));
 }
 
+/**
+ * pciehp_destroy_board_resources: put node back in the resource list
+ * @resources: list to put nodes back
+ */
+void pciehp_destroy_board_resources(struct pci_func * func)
+{
+	kfree_resource_list(&(func->io_head));
+	kfree_resource_list(&(func->mem_head));
+	kfree_resource_list(&(func->p_mem_head));
+	kfree_resource_list(&(func->bus_head));
+}
diff --git a/drivers/pci/hotplug/pciehprm.h b/drivers/pci/hotplug/pciehprm.h
index cf0d84858..966775ffb 100644
--- a/drivers/pci/hotplug/pciehprm.h
+++ b/drivers/pci/hotplug/pciehprm.h
@@ -37,7 +37,6 @@
 int pciehprm_init(enum php_ctlr_type ct);
 void pciehprm_cleanup(void);
 int pciehprm_print_pirt(void);
-void *pciehprm_get_slot(struct slot *slot);
 int pciehprm_find_available_resources(struct controller *ctrl);
 int pciehprm_set_hpp(struct controller *ctrl, struct pci_func *func, u8 card_type);
 void pciehprm_enable_card(struct controller *ctrl, struct pci_func *func, u8 card_type);
diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c
index 1b53edd59..ff19a806f 100644
--- a/drivers/pci/hotplug/pciehprm_acpi.c
+++ b/drivers/pci/hotplug/pciehprm_acpi.c
@@ -1301,6 +1301,7 @@ static struct acpi_php_slot * get_acpi_slot (
 
 }
 
+#if 0
 void * pciehprm_get_slot(struct slot *slot)
 {
 	struct acpi_bridge	*ab = acpi_bridges_head;
@@ -1312,6 +1313,7 @@ void * pciehprm_get_slot(struct slot *slot)
 
 	return (void *)aps;
 }
+#endif
 
 static void pciehprm_dump_func_res( struct pci_func *fun)
 {
diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.c b/drivers/pci/hotplug/pciehprm_nonacpi.c
index 737fce361..3ace44220 100644
--- a/drivers/pci/hotplug/pciehprm_nonacpi.c
+++ b/drivers/pci/hotplug/pciehprm_nonacpi.c
@@ -52,11 +52,6 @@ int pciehprm_print_pirt(void)
 	return 0;
 }
 
-void * pciehprm_get_slot(struct slot *slot)
-{
-	return NULL;
-}
-
 int pciehprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum)
 {
 
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c
index 35a0538f8..f413495a2 100644
--- a/drivers/pci/hotplug/pcihp_skeleton.c
+++ b/drivers/pci/hotplug/pcihp_skeleton.c
@@ -30,16 +30,14 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include "pci_hotplug.h"
 
-
-#define SLOT_MAGIC	0x67267322
 struct slot {
-	u32 magic;
 	u8 number;
 	struct hotplug_slot *hotplug_slot;
 	struct list_head slot_list;
@@ -47,11 +45,7 @@ struct slot {
 
 static LIST_HEAD(slot_list);
 
-#if !defined(CONFIG_HOTPLUG_PCI_SKELETON_MODULE)
-	#define MY_NAME	"pcihp_skeleton"
-#else
-	#define MY_NAME	THIS_MODULE->name
-#endif
+#define MY_NAME	"pcihp_skeleton"
 
 #define dbg(format, arg...)					\
 	do {							\
@@ -69,14 +63,14 @@ static LIST_HEAD(slot_list);
 static int debug;
 static int num_slots;
 
-#define DRIVER_VERSION	"0.2"
+#define DRIVER_VERSION	"0.3"
 #define DRIVER_AUTHOR	"Greg Kroah-Hartman <greg@kroah.com>"
 #define DRIVER_DESC	"Hot Plug PCI Controller Skeleton Driver"
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
+module_param(debug, bool, 644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
 
 static int enable_slot		(struct hotplug_slot *slot);
@@ -100,50 +94,12 @@ static struct hotplug_slot_ops skel_hotplug_slot_ops = {
 	.get_adapter_status =	get_adapter_status,
 };
 
-
-/* Inline functions to check the sanity of a pointer that is passed to us */
-static inline int slot_paranoia_check (struct slot *slot, const char *function)
+static int enable_slot(struct hotplug_slot *hotplug_slot)
 {
-	if (!slot) {
-		dbg("%s - slot == NULL", function);
-		return -1;
-	}
-	if (slot->magic != SLOT_MAGIC) {
-		dbg("%s - bad magic number for slot", function);
-		return -1;
-	}
-	if (!slot->hotplug_slot) {
-		dbg("%s - slot->hotplug_slot == NULL!", function);
-		return -1;
-	}
-	return 0;
-}
-
-static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function)
-{ 
-	struct slot *slot;
-
-	if (!hotplug_slot) {
-		dbg("%s - hotplug_slot == NULL\n", function);
-		return NULL;
-	}
-
-	slot = (struct slot *)hotplug_slot->private;
-	if (slot_paranoia_check (slot, function))
-                return NULL;
-	return slot;
-}               
-
-
-static int enable_slot (struct hotplug_slot *hotplug_slot)
-{
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
-	dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/*
 	 * Fill in code here to enable the specified slot
@@ -153,15 +109,12 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
 }
 
 
-static int disable_slot (struct hotplug_slot *hotplug_slot)
+static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
-	dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/*
 	 * Fill in code here to disable the specified slot
@@ -170,15 +123,12 @@ static int disable_slot (struct hotplug_slot *hotplug_slot)
 	return retval;
 }
 
-static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
+static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
-	dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	switch (status) {
 		case 0:
@@ -198,32 +148,30 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 	return retval;
 }
 
-static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value)
+static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
-	dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
-	err ("No hardware tests are defined for this driver");
-	retval = -ENODEV;
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	switch (value) {
+		case 0:
+			/* Specify a test here */
+			break;
+		case 1:
+			/* Specify another test here */
+			break;
+	}
 
-	/* Or you can specify a test if you want to */
-	
 	return retval;
 }
 
-static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/*
@@ -234,14 +182,11 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return retval;
 }
 
-static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/*
@@ -252,14 +197,11 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return retval;
 }
 
-static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/*
@@ -270,14 +212,11 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return retval;
 }
 
-static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
+static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
 {
-	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
+	struct slot *slot = hotplug_slot->private;
 	int retval = 0;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	/*
@@ -288,13 +227,9 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
 	return retval;
 }
 
-static void release_slots(struct hotplug_slot *hotplug_slot)
+static void release_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-	int retval = 0;
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = hotplug_slot->private;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 	kfree(slot->hotplug_slot->info);
@@ -304,22 +239,26 @@ static void release_slots(struct hotplug_slot *hotplug_slot)
 }
 
 #define SLOT_NAME_SIZE	10
-static void make_slot_name (struct slot *slot)
+static void make_slot_name(struct slot *slot)
 {
 	/*
 	 * Stupid way to make a filename out of the slot name.
 	 * replace this if your hardware provides a better way to name slots.
 	 */
-	snprintf (slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d", slot->number);
+	snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d", slot->number);
 }
 
-static int init_slots (void)
+/**
+ * init_slots - initialize 'struct slot' structures for each slot
+ *
+ */
+static int __init init_slots(void)
 {
 	struct slot *slot;
 	struct hotplug_slot *hotplug_slot;
 	struct hotplug_slot_info *info;
 	char *name;
-	int retval = 0;
+	int retval = -ENOMEM;
 	int i;
 
 	/*
@@ -327,43 +266,34 @@ static int init_slots (void)
 	 * with the pci_hotplug subsystem.
 	 */
 	for (i = 0; i < num_slots; ++i) {
-		slot = kmalloc (sizeof (struct slot), GFP_KERNEL);
+		slot = kmalloc(sizeof(struct slot), GFP_KERNEL);
 		if (!slot)
-			return -ENOMEM;
+			goto error;
 		memset(slot, 0, sizeof(struct slot));
 
-		hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL);
-		if (!hotplug_slot) {
-			kfree (slot);
-			return -ENOMEM;
-		}
+		hotplug_slot = kmalloc(sizeof(struct hotplug_slot),
+					GFP_KERNEL);
+		if (!hotplug_slot)
+			goto error_slot;
 		memset(hotplug_slot, 0, sizeof (struct hotplug_slot));
 		slot->hotplug_slot = hotplug_slot;
 
-		info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
-		if (!info) {
-			kfree (hotplug_slot);
-			kfree (slot);
-			return -ENOMEM;
-		}
+		info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
+		if (!info)
+			goto error_hpslot;
 		memset(info, 0, sizeof (struct hotplug_slot_info));
 		hotplug_slot->info = info;
 
-		name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL);
-		if (!name) {
-			kfree (info);
-			kfree (hotplug_slot);
-			kfree (slot);
-			return -ENOMEM;
-		}
+		name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL);
+		if (!name)
+			goto error_info;
 		hotplug_slot->name = name;
 
-		slot->magic = SLOT_MAGIC;
 		slot->number = i;
 
 		hotplug_slot->private = slot;
 		hotplug_slot->release = &release_slot;
-		make_slot_name (slot);
+		make_slot_name(slot);
 		hotplug_slot->ops = &skel_hotplug_slot_ops;
 		
 		/*
@@ -375,25 +305,31 @@ static int init_slots (void)
 		info->latch_status = get_latch_status(slot);
 		info->adapter_status = get_adapter_status(slot);
 		
-		dbg ("registering slot %d\n", i);
-		retval = pci_hp_register (slot->hotplug_slot);
+		dbg("registering slot %d\n", i);
+		retval = pci_hp_register(slot->hotplug_slot);
 		if (retval) {
-			err ("pci_hp_register failed with error %d\n", retval);
-			kfree (info);
-			kfree (name);
-			kfree (hotplug_slot);
-			kfree (slot);
-			return retval;
+			err("pci_hp_register failed with error %d\n", retval);
+			goto error_name;
 		}
 
 		/* add slot to our internal list */
-		list_add (&slot->slot_list, &slot_list);
+		list_add(&slot->slot_list, &slot_list);
 	}
 
+	return 0;
+error_name:
+	kfree(name);
+error_info:
+	kfree(info);
+error_hpslot:
+	kfree(hotplug_slot);
+error_slot:
+	kfree(slot);
+error:
 	return retval;
 }
 
-static void cleanup_slots(void)
+static void __exit cleanup_slots(void)
 {
 	struct list_head *tmp;
 	struct list_head *next;
@@ -404,10 +340,10 @@ static void cleanup_slots(void)
 	 * Memory will be freed in release_slot() callback after slot's
 	 * lifespan is finished.
 	 */
-	list_for_each_safe (tmp, next, &slot_list) {
-		slot = list_entry (tmp, struct slot, slot_list);
-		list_del (&slot->slot_list);
-		pci_hp_deregister (slot->hotplug_slot);
+	list_for_each_safe(tmp, next, &slot_list) {
+		slot = list_entry(tmp, struct slot, slot_list);
+		list_del(&slot->slot_list);
+		pci_hp_deregister(slot->hotplug_slot);
 	}
 }
 		
@@ -415,20 +351,16 @@ static int __init pcihp_skel_init(void)
 {
 	int retval;
 
+	info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
 	/*
 	 * Do specific initialization stuff for your driver here
-	 * Like initilizing your controller hardware (if any) and
+	 * Like initializing your controller hardware (if any) and
 	 * determining the number of slots you have in the system
 	 * right now.
 	 */
 	num_slots = 5;
 
-	retval = init_slots();
-	if (retval)
-		return retval;
-
-	info (DRIVER_DESC " version: " DRIVER_VERSION "\n");
-	return 0;
+	return init_slots();
 }
 
 static void __exit pcihp_skel_exit(void)
@@ -441,4 +373,3 @@ static void __exit pcihp_skel_exit(void)
 
 module_init(pcihp_skel_init);
 module_exit(pcihp_skel_exit);
-
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 7758c57e6..b321b47cf 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -47,15 +47,13 @@ static struct device_node *find_php_slot_vio_node(char *drc_name)
 {
 	struct device_node *child;
 	struct device_node *parent = of_find_node_by_name(NULL, "vdevice");
+	char *loc_code;
 
 	if (!parent)
 		return NULL;
 
-	for (child = of_get_next_child(parent, NULL);	
+	for (child = of_get_next_child(parent, NULL);
 	     child; child = of_get_next_child(parent, child)) {
-	
-		char *loc_code;
-	
 		loc_code = get_property(child, "ibm,loc-code", NULL);
 		if (loc_code && !strcmp(loc_code, drc_name))
 			return child;
@@ -309,12 +307,8 @@ int dlpar_remove_vio_slot(struct slot *slot, char *drc_name)
  */
 int dlpar_remove_pci_slot(struct slot *slot, char *drc_name)
 {
-	struct device_node *dn = find_php_slot_pci_node(drc_name);
 	struct pci_dev *bridge_dev;
 
-	if (!dn)
-		return -ENODEV;
-
 	bridge_dev = slot->bridge;
 	if (!bridge_dev) {
 		printk(KERN_ERR "%s: unexpected null bridge device\n",
@@ -358,13 +352,19 @@ int dlpar_remove_slot(char *drc_name)
 
 	if (down_interruptible(&rpadlpar_sem))
 		return -ERESTARTSYS;
-	
+
+	if (!find_php_slot_vio_node(drc_name) &&
+	    !find_php_slot_pci_node(drc_name)) {
+		rc = -ENODEV;
+		goto exit;
+	}
+
 	slot = find_slot(drc_name);
 	if (!slot) {
 		rc = -EINVAL;
 		goto exit;
 	}
-	
+
 	switch (slot->dev_type) {
 		case PCI_DEV:
 			rc = dlpar_remove_pci_slot(slot, drc_name);
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 66ff46e1b..3c860e156 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -62,8 +62,6 @@ extern int debug;
 #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
 
-#define SLOT_MAGIC	0x67267322
-
 /* slot types */
 #define VIO_DEV	1
 #define PCI_DEV	2
@@ -79,7 +77,6 @@ extern int debug;
  * struct slot - slot information for each *physical* slot
  */
 struct slot {
-	u32 magic;
 	int state;
 	u32 index;
 	u32 type;
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 2fe394ace..157205428 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -54,7 +54,7 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-module_param(debug, int, 0644);
+module_param(debug, bool, 0644);
 
 static int enable_slot(struct hotplug_slot *slot);
 static int disable_slot(struct hotplug_slot *slot);
@@ -63,7 +63,6 @@ static int get_power_status(struct hotplug_slot *slot, u8 * value);
 static int get_attention_status(struct hotplug_slot *slot, u8 * value);
 static int get_adapter_status(struct hotplug_slot *slot, u8 * value);
 static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
-static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
 
 struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
 	.owner = THIS_MODULE,
@@ -74,18 +73,8 @@ struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
 	.get_attention_status = get_attention_status,
 	.get_adapter_status = get_adapter_status,
 	.get_max_bus_speed = get_max_bus_speed,
-	.get_cur_bus_speed = get_cur_bus_speed,
 };
 
-static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function)
-{
-	if (!hotplug_slot) {
-		dbg("%s - hotplug_slot == NULL\n", function);
-		return NULL;
-	}
-	return (struct slot *)hotplug_slot->private;
-}
-
 static int rpaphp_get_attention_status(struct slot *slot)
 {
 	return slot->hotplug_slot->info->attention_status;
@@ -100,11 +89,8 @@ static int rpaphp_get_attention_status(struct slot *slot)
  */
 static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
 {
-	int retval = 0;
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
+	int retval;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	down(&rpaphp_sem);
 	switch (value) {
@@ -136,10 +122,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
 static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
 {
 	int retval;
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	down(&rpaphp_sem);
 	retval = rpaphp_get_power_status(slot, value);
@@ -155,10 +138,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
 static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
 {
 	int retval = 0;
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	down(&rpaphp_sem);
 	*value = rpaphp_get_attention_status(slot);
@@ -168,11 +148,9 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
 
 static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 	int retval = 0;
 
-	if (slot == NULL)
-		return -ENODEV;
 	down(&rpaphp_sem);
 	/*  have to go through this */
 	switch (slot->dev_type) {
@@ -191,10 +169,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value)
 
 static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	down(&rpaphp_sem);
 	switch (slot->type) {
@@ -231,18 +206,6 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
 	return 0;
 }
 
-/* return dummy value because not sure if PRA provides any method... */
-static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
-{
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
-
-	*value = PCI_SPEED_UNKNOWN;
-	return 0;
-}
-
 int rpaphp_remove_slot(struct slot *slot)
 {
 	int retval = 0;
@@ -268,24 +231,24 @@ static int is_php_dn(struct device_node *dn, int **indexes, int **names, int **t
 {
 	*indexes = (int *) get_property(dn, "ibm,drc-indexes", NULL);
 	if (!*indexes)
-		return (0);
+		return 0;
 	/* &names[1] contains NULL terminated slot names */
 	*names = (int *) get_property(dn, "ibm,drc-names", NULL);
 	if (!*names)
-		return (0);
+		return 0;
 	/* &types[1] contains NULL terminated slot types */
 	*types = (int *) get_property(dn, "ibm,drc-types", NULL);
 	if (!*types)
-		return (0);
+		return 0;
 	/* power_domains[1...n] are the slot power domains */
 	*power_domains = (int *) get_property(dn,
 					      "ibm,drc-power-domains", NULL);
 	if (!*power_domains)
-		return (0);
+		return 0;
 	if (strcmp(dn->name, "pci") == 0 &&
-	    !get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL))
-		return (0);
-	return (1);
+			!get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL))
+		return 0;
+	return 1;
 }
 
 static inline int is_vdevice_root(struct device_node *dn)
@@ -293,10 +256,10 @@ static inline int is_vdevice_root(struct device_node *dn)
 	return !strcmp(dn->name, "vdevice");
 }
 
-/*************************************
- * Add  Hot Plug slot(s) to sysfs
+/**
+ * rpaphp_add_slot: Add  Hot Plug slot(s) to sysfs
  *
- ************************************/
+ */
 int rpaphp_add_slot(struct device_node *dn)
 {
 	struct slot *slot;
@@ -320,8 +283,9 @@ int rpaphp_add_slot(struct device_node *dn)
 		name = (char *) &names[1];
 		type = (char *) &types[1];
 		for (i = 0; i < indexes[0];
-		     i++,
-		     name += (strlen(name) + 1), type += (strlen(type) + 1)) {
+					i++,
+					name += (strlen(name) + 1),
+					type += (strlen(type) + 1)) {
 			if (!(slot = alloc_slot_struct(dn, indexes[i + 1], name,
 						       power_domains[i + 1]))) {
 				retval = -ENOMEM;
@@ -334,38 +298,28 @@ int rpaphp_add_slot(struct device_node *dn)
 
 		}		/* for indexes */
 	}			/* end of PCI device_node */
-      exit:
+exit:
 	dbg("%s - Exit: num_slots=%d rc[%d]\n",
 	    __FUNCTION__, num_slots, retval);
 	return retval;
 }
 
-/*
- * init_slots - initialize 'struct slot' structures for each slot
- *
- */
-static void init_slots(void)
+static int __init init_rpa(void)
 {
 	struct device_node *dn;
 
-	for (dn = find_all_nodes(); dn; dn = dn->next)
-		rpaphp_add_slot(dn);
-}
-
-static int init_rpa(void)
-{
-
 	init_MUTEX(&rpaphp_sem);
 
 	/* initialize internal data structure etc. */
-	init_slots();
+	for (dn = find_all_nodes(); dn; dn = dn->next)
+		rpaphp_add_slot(dn);
 	if (!num_slots)
 		return -ENODEV;
 
 	return 0;
 }
 
-static void cleanup_slots(void)
+static void __exit cleanup_slots(void)
 {
 	struct list_head *tmp, *n;
 	struct slot *slot;
@@ -400,10 +354,7 @@ static void __exit rpaphp_exit(void)
 static int enable_slot(struct hotplug_slot *hotplug_slot)
 {
 	int retval = 0;
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	if (slot->state == CONFIGURED) {
 		dbg("%s: %s is already enabled\n", __FUNCTION__, slot->name);
@@ -431,10 +382,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
 static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
 	int retval;
-	struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
-
-	if (slot == NULL)
-		return -ENODEV;
+	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	dbg("%s - Entry: slot[%s]\n", __FUNCTION__, slot->name);
 
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 6b8455864..6f5b61b7c 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -30,7 +30,7 @@
 
 struct pci_dev *rpaphp_find_pci_dev(struct device_node *dn)
 {
-	struct pci_dev *retval_dev = NULL, *dev = NULL;
+	struct pci_dev *retval_dev = NULL, *dev;
 	char bus_id[BUS_ID_SIZE];
 
 	sprintf(bus_id, "%04x:%02x:%02x.%d",dn->phb->global_number,
@@ -57,9 +57,8 @@ int rpaphp_claim_resource(struct pci_dev *dev, int resource)
 	struct resource *res = &dev->resource[resource];
 	struct resource *root = pci_find_parent_resource(dev, res);
 	char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
-	int err;
+	int err = -EINVAL;
 
-	err = -EINVAL;
 	if (root != NULL) {
 		err = request_resource(root, res);
 	}
@@ -117,8 +116,8 @@ static int rpaphp_get_sensor_state(struct slot *slot, int *state)
 	return rc;
 }
 
-/*
- * get_pci_adapter_status - get  the status of a slot
+/**
+ * get_pci_adapter_status - get the status of a slot
  * 
  * 0-- slot is empty
  * 1-- adapter is configured
@@ -136,7 +135,7 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
 	if (state == PRESENT) {
 		if (!is_init)
 			/* at run-time slot->state can be changed by */
-			/* config/unconfig adapter                        */
+			/* config/unconfig adapter */
 			*value = slot->state;
 		else {
 			if (!slot->dn->child)
@@ -154,7 +153,7 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
 		*value = state;
 	}
 
-      exit:
+exit:
 	return rc;
 }
 
@@ -175,6 +174,7 @@ static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
 			pci_read_irq_line(dev);
 			for (i = 0; i < PCI_NUM_RESOURCES; i++) {
 				struct resource *r = &dev->resource[i];
+
 				if (r->parent || !r->start || !r->flags)
 					continue;
 				rpaphp_claim_resource(dev, i);
@@ -183,7 +183,8 @@ static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
 	}
 }
 
-static void rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node *dn)
+static void
+rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node *dn)
 {
 	int num;
 
@@ -192,7 +193,6 @@ static void rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node
 		rpaphp_fixup_new_pci_devices(pci_bus);
 		pci_bus_add_devices(pci_bus);
 	}
-	return;
 }
 
 static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn);
@@ -201,7 +201,8 @@ static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn)
  rpaphp_pci_config_dn() will recursively configure all devices under the 
  given slot->dn and return the dn's pci_dev.
  *****************************************************************************/
-static struct pci_dev *rpaphp_pci_config_dn(struct device_node *dn, struct pci_bus *bus)
+static struct pci_dev *
+rpaphp_pci_config_dn(struct device_node *dn, struct pci_bus *bus)
 {
 	struct device_node *local;
 	struct pci_dev *dev;
@@ -256,16 +257,16 @@ static struct pci_dev *rpaphp_config_pci_adapter(struct slot *slot)
 			goto exit;
 		}
 
+		eeh_add_device_early(slot->dn->child);
 		dev = rpaphp_pci_config_dn(slot->dn, pci_bus);
-		eeh_add_device(dev);
+		eeh_add_device_late(dev);
 	} else {
 		/* slot is not enabled */
 		err("slot doesn't have pci_dev structure\n");
 		dev = NULL;
-		goto exit;
 	}
 
-      exit:
+exit:
 	dbg("Exit %s: pci_dev %s\n", __FUNCTION__, dev ? "found" : "not found");
 	return dev;
 }
@@ -304,9 +305,9 @@ static int setup_pci_hotplug_slot_info(struct slot *slot)
 	if (slot->hotplug_slot->info->adapter_status == NOT_VALID) {
 		dbg("%s: NOT_VALID: skip dn->full_name=%s\n",
 		    __FUNCTION__, slot->dn->full_name);
-		return (-1);
+		return -1;
 	}
-	return (0);
+	return 0;
 }
 
 static int setup_pci_slot(struct slot *slot)
@@ -317,7 +318,8 @@ static int setup_pci_slot(struct slot *slot)
 		dealloc_slot_struct(slot);
 		return 1;
 	}
-
+	
+	strcpy(slot->name, pci_name(slot->bridge));
 	/* find slot's pci_dev if it's not empty */
 	if (slot->hotplug_slot->info->adapter_status == EMPTY) {
 		slot->state = EMPTY;	/* slot is empty */
@@ -353,7 +355,7 @@ int register_pci_slot(struct slot *slot)
 	if (setup_pci_slot(slot))
 		goto exit_rc;
 	rc = register_slot(slot);
-      exit_rc:
+exit_rc:
 	if (rc)
 		dealloc_slot_struct(slot);
 	return rc;
@@ -389,7 +391,7 @@ int rpaphp_enable_pci_slot(struct slot *slot)
 		slot->state = NOT_VALID;
 		retval = -EINVAL;
 	}
-      exit:
+exit:
 	if (slot->state != NOT_VALID)
 		rpaphp_set_attention_status(slot, LED_ON);
 	else
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 9615b3cce..0e952c86f 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -58,13 +58,10 @@ void rpaphp_sysfs_remove_attr_location (struct hotplug_slot *slot)
 	sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_location.attr);
 }
 
-/* free up the memory user by a slot */
+/* free up the memory used by a slot */
 static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot)
 {
-	struct slot *slot = hotplug_slot? (struct slot *) hotplug_slot->private:NULL;
-
-	if (slot == NULL)
-		return;
+	struct slot *slot = (struct slot *) hotplug_slot->private;
 
 	dealloc_slot_struct(slot);
 }
@@ -83,54 +80,47 @@ struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_
 {
 	struct slot *slot;
 	
-	dbg("Enter alloc_slot_struct(): dn->full_name=%s drc_index=0x%x drc_name=%s\n",
-		dn->full_name, drc_index, drc_name);
-
 	slot = kmalloc(sizeof (struct slot), GFP_KERNEL);
 	if (!slot)
-		return (NULL);
+		goto error_nomem;
 	memset(slot, 0, sizeof (struct slot));
 	slot->hotplug_slot = kmalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
-	if (!slot->hotplug_slot) {
-		kfree(slot);
-		return (NULL);
-	}
+	if (!slot->hotplug_slot)
+		goto error_slot;
 	memset(slot->hotplug_slot, 0, sizeof (struct hotplug_slot));
 	slot->hotplug_slot->info = kmalloc(sizeof (struct hotplug_slot_info),
 					   GFP_KERNEL);
-	if (!slot->hotplug_slot->info) {
-		kfree(slot->hotplug_slot);
-		kfree(slot);
-		return (NULL);
-	}
+	if (!slot->hotplug_slot->info)
+		goto error_hpslot;
 	memset(slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info));
 	slot->hotplug_slot->name = kmalloc(BUS_ID_SIZE + 1, GFP_KERNEL);
-	if (!slot->hotplug_slot->name) {
-		kfree(slot->hotplug_slot->info);
-		kfree(slot->hotplug_slot);
-		kfree(slot);
-		return (NULL);
-	}
+	if (!slot->hotplug_slot->name)
+		goto error_info;
 	slot->location = kmalloc(strlen(drc_name) + 1, GFP_KERNEL);
-	if (!slot->location) {
-		kfree(slot->hotplug_slot->info);
-		kfree(slot->hotplug_slot->name);
-		kfree(slot->hotplug_slot);
-		kfree(slot);
-		return (NULL);
-	}
+	if (!slot->location)
+		goto error_name;
 	slot->name = slot->hotplug_slot->name;
 	slot->dn = dn;
 	slot->index = drc_index;
 	strcpy(slot->location, drc_name);
 	slot->power_domain = power_domain;
-	slot->magic = SLOT_MAGIC;
 	slot->hotplug_slot->private = slot;
 	slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops;
 	slot->hotplug_slot->release = &rpaphp_release_slot;
-	dbg("Exit alloc_slot_struct(): slot->dn->full_name=%s drc_index=0x%x drc_name=%s\n",
-		slot->dn->full_name, slot->index, slot->name);
-	return (slot);
+	slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
+
+	return slot;
+
+error_name:
+	kfree(slot->hotplug_slot->name);
+error_info:
+	kfree(slot->hotplug_slot->info);
+error_hpslot:
+	kfree(slot->hotplug_slot);
+error_slot:
+	kfree(slot);
+error_nomem:
+	return NULL;
 }
 
 int register_slot(struct slot *slot)
@@ -138,13 +128,15 @@ int register_slot(struct slot *slot)
 	int retval;
 	char *vio_uni_addr = NULL;
 
-	dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", __FUNCTION__, slot->dn->full_name, slot->index, slot->name, slot->power_domain, slot->type);
+	dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n",
+		__FUNCTION__, slot->dn->full_name, slot->index, slot->name,
+		slot->power_domain, slot->type);
 
 	retval = pci_hp_register(slot->hotplug_slot);
 	if (retval) {
 		err("pci_hp_register failed with error %d\n", retval);
 		rpaphp_release_slot(slot->hotplug_slot);
-		return (retval);
+		return retval;
 	}
 	
 	/* create "phy_locatoin" file */
@@ -163,7 +155,7 @@ int register_slot(struct slot *slot)
 		info("Slot [%s](bus_id=%s) registered\n",
 		     slot->name, pci_name(slot->bridge));
 	num_slots++;
-	return (0);
+	return 0;
 }
 
 int rpaphp_get_power_status(struct slot *slot, u8 * value)
diff --git a/drivers/pci/hotplug/rpaphp_vio.c b/drivers/pci/hotplug/rpaphp_vio.c
index d06f6433c..29d7ca6ba 100644
--- a/drivers/pci/hotplug/rpaphp_vio.c
+++ b/drivers/pci/hotplug/rpaphp_vio.c
@@ -94,6 +94,7 @@ int register_vio_slot(struct device_node *dn)
 		slot->state = NOT_CONFIGURED;
 	if (setup_vio_hotplug_slot_info(slot))
 		goto exit_rc;
+	strcpy(slot->name, slot->dev.vio_dev->dev.bus_id);
 	info("%s: registered VIO device[name=%s vio_dev=%p]\n",
 		__FUNCTION__, slot->name, slot->dev.vio_dev); 
 	rc = register_slot(slot);
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index ddda51ce2..bc890dec0 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -205,7 +205,6 @@ struct resource_lists {
 extern void shpchp_create_ctrl_files	(struct controller *ctrl);
 
 /* controller functions */
-extern void	shpchp_pushbutton_thread(unsigned long event_pointer);
 extern int	shpchprm_find_available_resources(struct controller *ctrl);
 extern int	shpchp_event_start_thread(void);
 extern void	shpchp_event_stop_thread(void);
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index 86c7ffe7f..7f34ec941 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -29,6 +29,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/proc_fs.h>
@@ -56,9 +57,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(shpchp_debug, "i");
-MODULE_PARM(shpchp_poll_mode, "i");
-MODULE_PARM(shpchp_poll_time, "i");
+module_param(shpchp_debug, bool, 644);
+module_param(shpchp_poll_mode, bool, 644);
+module_param(shpchp_poll_time, int, 644);
 MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
 MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
 MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
@@ -69,7 +70,6 @@ static int shpc_start_thread (void);
 static int set_attention_status (struct hotplug_slot *slot, u8 value);
 static int enable_slot		(struct hotplug_slot *slot);
 static int disable_slot		(struct hotplug_slot *slot);
-static int hardware_test	(struct hotplug_slot *slot, u32 value);
 static int get_power_status	(struct hotplug_slot *slot, u8 *value);
 static int get_attention_status	(struct hotplug_slot *slot, u8 *value);
 static int get_latch_status	(struct hotplug_slot *slot, u8 *value);
@@ -82,22 +82,37 @@ static struct hotplug_slot_ops shpchp_hotplug_slot_ops = {
 	.set_attention_status =	set_attention_status,
 	.enable_slot =		enable_slot,
 	.disable_slot =		disable_slot,
-	.hardware_test =	hardware_test,
 	.get_power_status =	get_power_status,
 	.get_attention_status =	get_attention_status,
-	.get_latch_status =		get_latch_status,
+	.get_latch_status =	get_latch_status,
 	.get_adapter_status =	get_adapter_status,
-  	.get_max_bus_speed =	get_max_bus_speed,
-  	.get_cur_bus_speed =	get_cur_bus_speed,
+	.get_max_bus_speed =	get_max_bus_speed,
+	.get_cur_bus_speed =	get_cur_bus_speed,
 };
 
+/**
+ * release_slot - free up the memory used by a slot
+ * @hotplug_slot: slot to free
+ */
+static void release_slot(struct hotplug_slot *hotplug_slot)
+{
+	struct slot *slot = (struct slot *)hotplug_slot->private;
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+	kfree(slot->hotplug_slot->info);
+	kfree(slot->hotplug_slot->name);
+	kfree(slot->hotplug_slot);
+	kfree(slot);
+}
+
 static int init_slots(struct controller *ctrl)
 {
 	struct slot *new_slot;
 	u8 number_of_slots;
 	u8 slot_device;
 	u32 slot_number, sun;
-	int result;
+	int result = -ENOMEM;
 
 	dbg("%s\n",__FUNCTION__);
 
@@ -108,30 +123,21 @@ static int init_slots(struct controller *ctrl)
 	while (number_of_slots) {
 		new_slot = (struct slot *) kmalloc(sizeof(struct slot), GFP_KERNEL);
 		if (!new_slot)
-			return -ENOMEM;
+			goto error;
 
 		memset(new_slot, 0, sizeof(struct slot));
 		new_slot->hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL);
-		if (!new_slot->hotplug_slot) {
-			kfree (new_slot);
-			return -ENOMEM;
-		}
+		if (!new_slot->hotplug_slot)
+			goto error_slot;
 		memset(new_slot->hotplug_slot, 0, sizeof (struct hotplug_slot));
 
 		new_slot->hotplug_slot->info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
-		if (!new_slot->hotplug_slot->info) {
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
+		if (!new_slot->hotplug_slot->info)
+			goto error_hpslot;
 		memset(new_slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info));
 		new_slot->hotplug_slot->name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL);
-		if (!new_slot->hotplug_slot->name) {
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
+		if (!new_slot->hotplug_slot->name)
+			goto error_info;
 
 		new_slot->magic = SLOT_MAGIC;
 		new_slot->ctrl = ctrl;
@@ -139,19 +145,17 @@ static int init_slots(struct controller *ctrl)
 		new_slot->device = slot_device;
 		new_slot->hpc_ops = ctrl->hpc_ops;
 
-		if (shpchprm_get_physical_slot_number(ctrl, &sun, new_slot->bus, new_slot->device)) {
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return -ENOMEM;
-		}
+		if (shpchprm_get_physical_slot_number(ctrl, &sun,
+					new_slot->bus, new_slot->device))
+			goto error_name;
 
 		new_slot->number = sun;
 		new_slot->hp_slot = slot_device - ctrl->slot_device_offset;
 
 		/* register this slot with the hotplug pci core */
 		new_slot->hotplug_slot->private = new_slot;
-		make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
+		new_slot->hotplug_slot->release = &release_slot;
+		make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
 		new_slot->hotplug_slot->ops = &shpchp_hotplug_slot_ops;
 
 		new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status));
@@ -164,11 +168,7 @@ static int init_slots(struct controller *ctrl)
 		result = pci_hp_register (new_slot->hotplug_slot);
 		if (result) {
 			err ("pci_hp_register failed with error %d\n", result);
-			kfree (new_slot->hotplug_slot->info);
-			kfree (new_slot->hotplug_slot->name);
-			kfree (new_slot->hotplug_slot);
-			kfree (new_slot);
-			return result;
+			goto error_name;
 		}
 
 		new_slot->next = ctrl->slot;
@@ -179,11 +179,21 @@ static int init_slots(struct controller *ctrl)
 		slot_number += ctrl->slot_num_inc;
 	}
 
-	return(0);
-}
+	return 0;
 
+error_name:
+	kfree(new_slot->hotplug_slot->name);
+error_info:
+	kfree(new_slot->hotplug_slot->info);
+error_hpslot:
+	kfree(new_slot->hotplug_slot);
+error_slot:
+	kfree(new_slot);
+error:
+	return result;
+}
 
-static int cleanup_slots (struct controller * ctrl)
+static void cleanup_slots(struct controller *ctrl)
 {
 	struct slot *old_slot, *next_slot;
 
@@ -192,16 +202,9 @@ static int cleanup_slots (struct controller * ctrl)
 
 	while (old_slot) {
 		next_slot = old_slot->next;
-		pci_hp_deregister (old_slot->hotplug_slot);
-		kfree(old_slot->hotplug_slot->info);
-		kfree(old_slot->hotplug_slot->name);
-		kfree(old_slot->hotplug_slot);
-		kfree(old_slot);
+		pci_hp_deregister(old_slot->hotplug_slot);
 		old_slot = next_slot;
 	}
-
-
-	return(0);
 }
 
 static int get_ctlr_slot_config(struct controller *ctrl)
@@ -216,7 +219,7 @@ static int get_ctlr_slot_config(struct controller *ctrl)
 	rc = shpc_get_ctlr_slot_config(ctrl, &num_ctlr_slots, &first_device_num, &physical_slot_num, &updown, &flags);
 	if (rc) {
 		err("%s: get_ctlr_slot_config fail for b:d (%x:%x)\n", __FUNCTION__, ctrl->bus, ctrl->device);
-		return (-1);
+		return -1;
 	}
 
 	ctrl->num_slots = num_ctlr_slots;
@@ -227,7 +230,7 @@ static int get_ctlr_slot_config(struct controller *ctrl)
 	dbg("%s: num_slot(0x%x) 1st_dev(0x%x) psn(0x%x) updown(%d) for b:d (%x:%x)\n",
 		__FUNCTION__, num_ctlr_slots, first_device_num, physical_slot_num, updown, ctrl->bus, ctrl->device);
 
-	return (0);
+	return 0;
 }
 
 
@@ -238,15 +241,11 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 
-	if (slot == NULL)
-		return -ENODEV;
-	
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	hotplug_slot->info->attention_status = status;
 	slot->hpc_ops->set_attention_status(slot, status);
 
-
 	return 0;
 }
 
@@ -254,9 +253,6 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 static int enable_slot (struct hotplug_slot *hotplug_slot)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
@@ -267,30 +263,17 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
 static int disable_slot (struct hotplug_slot *hotplug_slot)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	return shpchp_disable_slot(slot);
 }
 
-
-static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value)
-{
-	return 0;
-}
-
-
 static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_power_status(slot, value);
@@ -304,10 +287,7 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_attention_status(slot, value);
@@ -321,10 +301,7 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
-	
+
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_latch_status(slot, value);
@@ -338,14 +315,10 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
 	retval = slot->hpc_ops->get_adapter_status(slot, value);
-
 	if (retval < 0)
 		*value = hotplug_slot->info->adapter_status;
 
@@ -356,9 +329,6 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 	
@@ -373,9 +343,6 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
 {
 	struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
 	int retval;
-	
-	if (slot == NULL)
-		return -ENODEV;
 
 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 	
@@ -531,49 +498,35 @@ static int shpc_start_thread(void)
 	return retval;
 }
 
+static inline void __exit
+free_shpchp_res(struct pci_resource *res)
+{
+	struct pci_resource *tres;
+
+	while (res) {
+		tres = res;
+		res = res->next;
+		kfree(tres);
+	}
+}
 
-static void unload_shpchpd(void)
+static void __exit unload_shpchpd(void)
 {
 	struct pci_func *next;
 	struct pci_func *TempSlot;
 	int loop;
 	struct controller *ctrl;
 	struct controller *tctrl;
-	struct pci_resource *res;
-	struct pci_resource *tres;
 
 	ctrl = shpchp_ctrl_list;
 
 	while (ctrl) {
 		cleanup_slots(ctrl);
 
-		res = ctrl->io_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
-
-		res = ctrl->mem_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
-
-		res = ctrl->p_mem_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
-
-		res = ctrl->bus_head;
-		while (res) {
-			tres = res;
-			res = res->next;
-			kfree(tres);
-		}
+		free_shpchp_res(ctrl->io_head);
+		free_shpchp_res(ctrl->mem_head);
+		free_shpchp_res(ctrl->p_mem_head);
+		free_shpchp_res(ctrl->bus_head);
 
 		kfree (ctrl->pci_bus);
 
@@ -589,33 +542,10 @@ static void unload_shpchpd(void)
 	for (loop = 0; loop < 256; loop++) {
 		next = shpchp_slot_list[loop];
 		while (next != NULL) {
-			res = next->io_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
-
-			res = next->mem_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
-
-			res = next->p_mem_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
-
-			res = next->bus_head;
-			while (res) {
-				tres = res;
-				res = res->next;
-				kfree(tres);
-			}
+			free_shpchp_res(next->io_head);
+			free_shpchp_res(next->mem_head);
+			free_shpchp_res(next->p_mem_head);
+			free_shpchp_res(next->bus_head);
 
 			TempSlot = next;
 			next = next->next;
@@ -697,8 +627,5 @@ static void __exit shpcd_cleanup(void)
 	info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
 }
 
-
 module_init(shpcd_init);
 module_exit(shpcd_cleanup);
-
-
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 09d2d1b15..e92c1e067 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -396,7 +396,7 @@ static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **
 		/* This one isn't an aligned length, so we'll make a new entry
 		 * and split it up.
 		 */
-		split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+		split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 		if (!split_node)
 			return(NULL);
@@ -530,7 +530,7 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 			if ((node->length - (temp_dword - node->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
 				return(NULL);
@@ -549,7 +549,7 @@ static struct pci_resource *get_io_resource (struct pci_resource **head, u32 siz
 		if (node->length > size) {
 			/* This one is longer than we need
 			   so we'll make a new entry and split it up */
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
 				return(NULL);
@@ -630,7 +630,7 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 			if ((max->length - (temp_dword - max->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
 				return(NULL);
@@ -648,7 +648,7 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 		if ((max->base + max->length) & (size - 1)) {
 			/* This one isn't end aligned properly at the top
 			   so we'll make a new entry and split it up */
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
 				return(NULL);
@@ -669,7 +669,8 @@ static struct pci_resource *get_max_resource (struct pci_resource **head, u32 si
 
 		for ( i = 0; max_size[i] > size; i++) {
 			if (max->length > max_size[i]) {
-				split_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				split_node = kmalloc(sizeof(*split_node),
+							GFP_KERNEL);
 				if (!split_node)
 					break;	/* return (NULL); */
 				split_node->base = max->base + max_size[i];
@@ -744,7 +745,7 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 			if ((node->length - (temp_dword - node->base)) < size)
 				continue;
 
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
 				return(NULL);
@@ -764,7 +765,7 @@ static struct pci_resource *get_resource (struct pci_resource **head, u32 size)
 			dbg("%s: too big\n", __FUNCTION__);
 			/* this one is longer than we need
 			   so we'll make a new entry and split it up */
-			split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			split_node = kmalloc(sizeof(*split_node), GFP_KERNEL);
 
 			if (!split_node)
 				return(NULL);
@@ -882,7 +883,7 @@ struct pci_func *shpchp_slot_create(u8 busnumber)
 	struct pci_func *new_slot;
 	struct pci_func *next;
 
-	new_slot = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL);
+	new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL);
 
 	if (new_slot == NULL) {
 		return(new_slot);
@@ -1572,7 +1573,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 
 			retval = p_slot->hpc_ops->check_cmd_status(ctrl);
 			if (retval) {
-				err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc);
+				err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, retval);
 				/* Done with exclusive hardware access */
 				up(&ctrl->crit_sect);
 				return retval;  
@@ -1795,6 +1796,81 @@ static void pushbutton_helper_thread (unsigned long data)
 }
 
 
+/**
+ * shpchp_pushbutton_thread
+ *
+ * Scheduled procedure to handle blocking stuff for the pushbuttons
+ * Handles all pending events and exits.
+ *
+ */
+static void shpchp_pushbutton_thread (unsigned long slot)
+{
+	struct slot *p_slot = (struct slot *) slot;
+	u8 getstatus;
+	int rc;
+	
+	pushbutton_pending = 0;
+
+	if (!p_slot) {
+		dbg("%s: Error! slot NULL\n", __FUNCTION__);
+		return;
+	}
+
+	p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
+	if (getstatus) {
+		p_slot->state = POWEROFF_STATE;
+		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
+
+		if (shpchp_disable_slot(p_slot)) {
+			/* Wait for exclusive access to hardware */
+			down(&p_slot->ctrl->crit_sect);
+
+			/* Turn on the Attention LED */
+			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
+			if (rc) {
+				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
+				return;
+			}
+	
+			/* Wait for the command to complete */
+			wait_for_ctrl_irq (p_slot->ctrl);
+
+			/* Done with exclusive hardware access */
+			up(&p_slot->ctrl->crit_sect);
+		}
+		p_slot->state = STATIC_STATE;
+	} else {
+		p_slot->state = POWERON_STATE;
+		dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
+
+		if (shpchp_enable_slot(p_slot)) {
+			/* Wait for exclusive access to hardware */
+			down(&p_slot->ctrl->crit_sect);
+
+			/* Turn off the green LED */
+			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
+			if (rc) {
+				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
+				return;
+			}
+			/* Wait for the command to complete */
+			wait_for_ctrl_irq (p_slot->ctrl);
+			
+			p_slot->hpc_ops->green_led_off(p_slot);
+
+			/* Wait for the command to complete */
+			wait_for_ctrl_irq (p_slot->ctrl);
+
+			/* Done with exclusive hardware access */
+			up(&p_slot->ctrl->crit_sect);
+		}
+		p_slot->state = STATIC_STATE;
+	}
+
+	return;
+}
+
+
 /* this is the main worker thread */
 static int event_thread(void* data)
 {
@@ -1856,7 +1932,7 @@ static int update_slot_info (struct slot *slot)
 	struct hotplug_slot_info *info;
 	int result;
 
-	info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
+	info = kmalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 
@@ -2011,81 +2087,6 @@ static void interrupt_event_handler(struct controller *ctrl)
 }
 
 
-/**
- * shpchp_pushbutton_thread
- *
- * Scheduled procedure to handle blocking stuff for the pushbuttons
- * Handles all pending events and exits.
- *
- */
-void shpchp_pushbutton_thread (unsigned long slot)
-{
-	struct slot *p_slot = (struct slot *) slot;
-	u8 getstatus;
-	int rc;
-	
-	pushbutton_pending = 0;
-
-	if (!p_slot) {
-		dbg("%s: Error! slot NULL\n", __FUNCTION__);
-		return;
-	}
-
-	p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
-	if (getstatus) {
-		p_slot->state = POWEROFF_STATE;
-		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
-
-		if (shpchp_disable_slot(p_slot)) {
-			/* Wait for exclusive access to hardware */
-			down(&p_slot->ctrl->crit_sect);
-
-			/* Turn on the Attention LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-	
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&p_slot->ctrl->crit_sect);
-		}
-		p_slot->state = STATIC_STATE;
-	} else {
-		p_slot->state = POWERON_STATE;
-		dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
-
-		if (shpchp_enable_slot(p_slot)) {
-			/* Wait for exclusive access to hardware */
-			down(&p_slot->ctrl->crit_sect);
-
-			/* Turn off the green LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-			
-			p_slot->hpc_ops->green_led_off(p_slot);
-
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&p_slot->ctrl->crit_sect);
-		}
-		p_slot->state = STATIC_STATE;
-	}
-
-	return;
-}
-
-
 int shpchp_enable_slot (struct slot *p_slot)
 {
 	u8 getstatus = 0;
@@ -2504,22 +2505,18 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 		/* Make copies of the nodes we are going to pass down so that
 		 * if there is a problem,we can just use these to free resources
 		 */
-		hold_bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_IO_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
-		hold_p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+		hold_bus_node = kmalloc(sizeof(*hold_bus_node), GFP_KERNEL);
+		hold_IO_node = kmalloc(sizeof(*hold_IO_node), GFP_KERNEL);
+		hold_mem_node = kmalloc(sizeof(*hold_mem_node), GFP_KERNEL);
+		hold_p_mem_node = kmalloc(sizeof(*hold_p_mem_node), GFP_KERNEL);
 
 		if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) {
-			if (hold_bus_node)
-				kfree(hold_bus_node);
-			if (hold_IO_node)
-				kfree(hold_IO_node);
-			if (hold_mem_node)
-				kfree(hold_mem_node);
-			if (hold_p_mem_node)
-				kfree(hold_p_mem_node);
+			kfree(hold_bus_node);
+			kfree(hold_IO_node);
+			kfree(hold_mem_node);
+			kfree(hold_p_mem_node);
 
-			return(1);
+			return 1;
 		}
 
 		memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource));
@@ -2538,11 +2535,11 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			/* set IO base and Limit registers */
 			RES_CHECK(io_node->base, 8);
 			temp_byte = (u8)(io_node->base >> 8);
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte);
+			rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_BASE, temp_byte);
 
 			RES_CHECK(io_node->base + io_node->length - 1, 8);
 			temp_byte = (u8)((io_node->base + io_node->length - 1) >> 8);
-			rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
+			rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte);
 		} else {
 			kfree(hold_IO_node);
 			hold_IO_node = NULL;
@@ -2559,17 +2556,17 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			/* set Mem base and Limit registers */
 			RES_CHECK(mem_node->base, 16);
 			temp_word = (u32)(mem_node->base >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
 
 			RES_CHECK(mem_node->base + mem_node->length - 1, 16);
 			temp_word = (u32)((mem_node->base + mem_node->length - 1) >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 		} else {
 			temp_word = 0xFFFF;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word);
 
 			temp_word = 0x0000;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word);
 
 			kfree(hold_mem_node);
 			hold_mem_node = NULL;
@@ -2586,17 +2583,17 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 			/* set Pre Mem base and Limit registers */
 			RES_CHECK(p_mem_node->base, 16);
 			temp_word = (u32)(p_mem_node->base >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
 
 			RES_CHECK(p_mem_node->base + p_mem_node->length - 1, 16);
 			temp_word = (u32)((p_mem_node->base + p_mem_node->length - 1) >> 16);
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
 		} else {
 			temp_word = 0xFFFF;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word);
 
 			temp_word = 0x0000;
-			rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
+			rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word);
 
 			kfree(hold_p_mem_node);
 			hold_p_mem_node = NULL;
@@ -2613,7 +2610,8 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f
 
 			ID = 0xFFFFFFFF;
 			pci_bus->number = hold_bus_node->base;
-			pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID);
+			pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0),
+					PCI_VENDOR_ID, &ID);
 			pci_bus->number = func->bus;
 
 			if (ID != 0xFFFFFFFF) {	  /*  device Present */
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 42e7c3662..2c9b23f46 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -53,10 +53,11 @@ int shpchp_configure_device (struct controller* ctrl, struct pci_func* func)
 	/* Still NULL ? Well then scan for it ! */
 	if (func->pci_dev == NULL) {
 		num = pci_scan_slot(ctrl->pci_dev->subordinate, PCI_DEVFN(func->device, func->function));
-		if (num)
+		if (num) {
 			dbg("%s: subordiante %p number %x\n", __FUNCTION__, ctrl->pci_dev->subordinate,
 				ctrl->pci_dev->subordinate->number);
-			pci_bus_add_devices(ctrl->pci_dev->subordinate);		
+			pci_bus_add_devices(ctrl->pci_dev->subordinate);
+		}
 		
 		func->pci_dev = pci_find_slot(func->bus, PCI_DEVFN(func->device, func->function));
 		if (func->pci_dev == NULL) {
@@ -67,7 +68,7 @@ int shpchp_configure_device (struct controller* ctrl, struct pci_func* func)
 
 	if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
 		pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus);
-		child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus);
+		child = pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus);
 		pci_do_scan_bus(child);
 
 	}
@@ -81,10 +82,12 @@ int shpchp_unconfigure_device(struct pci_func* func)
 	int rc = 0;
 	int j;
 	
-	dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function);
+	dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus,
+				func->device, func->function);
 
 	for (j=0; j<8 ; j++) {
-		struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j);
+		struct pci_dev* temp = pci_find_slot(func->bus,
+				(func->device << 3) | j);
 		if (temp) {
 			pci_remove_bus_device(temp);
 		}
@@ -163,12 +166,14 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 	int is_hot_plug = num_ctlr_slots || first_device_num;
 	struct pci_bus lpci_bus, *pci_bus;
 
-	dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, num_ctlr_slots, first_device_num);
+	dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__,
+				num_ctlr_slots, first_device_num);
 
 	memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus));
 	pci_bus = &lpci_bus;
 
-	dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, num_ctlr_slots, first_device_num);
+	dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__,
+				num_ctlr_slots, first_device_num);
 
 	/*   Decide which slots are supported */
 	if (is_hot_plug) {
@@ -182,20 +187,24 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 		LastSupported = 0x1F;
 	}
 
-	dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported, LastSupported);
+	dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported,
+					LastSupported);
 
 	/*   Save PCI configuration space for all devices in supported slots */
 	pci_bus->number = busnumber;
 	for (device = FirstSupported; device <= LastSupported; device++) {
 		ID = 0xFFFFFFFF;
-		rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID);
+		rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0),
+					PCI_VENDOR_ID, &ID);
 
 		if (ID != 0xFFFFFFFF) {	  /*  device in slot */
-			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), 0x0B, &class_code);
+			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0),
+					0x0B, &class_code);
 			if (rc)
 				return rc;
 
-			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), PCI_HEADER_TYPE, &header_type);
+			rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0),
+					PCI_HEADER_TYPE, &header_type);
 			if (rc)
 				return rc;
 
@@ -216,7 +225,8 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 					/* Recurse the subordinate bus
 					 * get the subordinate bus number
 					 */
-					rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), 
+					rc = pci_bus_read_config_byte(pci_bus,
+						PCI_DEVFN(device, function), 
 						PCI_SECONDARY_BUS, &secondary_bus);
 					if (rc) {
 						return rc;
@@ -255,13 +265,17 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 				new_slot->switch_save = 0x10;
 				/* In case of unsupported board */
 				new_slot->status = DevError;
-				new_slot->pci_dev = pci_find_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function);
+				new_slot->pci_dev = pci_find_slot(new_slot->bus,
+					(new_slot->device << 3) | new_slot->function);
 				dbg("new_slot->pci_dev = %p\n", new_slot->pci_dev);
 
 				for (cloop = 0; cloop < 0x20; cloop++) {
-					rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), 
-						cloop << 2, (u32 *) & (new_slot->config_space [cloop]));
-					/* dbg("new_slot->config_space[%x] = %x\n", cloop, new_slot->config_space[cloop]); */
+					rc = pci_bus_read_config_dword(pci_bus,
+						PCI_DEVFN(device, function), 
+						cloop << 2,
+						(u32 *) &(new_slot->config_space [cloop]));
+					/* dbg("new_slot->config_space[%x] = %x\n",
+						cloop, new_slot->config_space[cloop]); */
 					if (rc)
 						return rc;
 				}
@@ -275,23 +289,28 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 				 */
 
 				while ((function < max_functions)&&(!stop_it)) {
-					rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), PCI_VENDOR_ID, &ID);
+					rc = pci_bus_read_config_dword(pci_bus,
+						PCI_DEVFN(device, function),
+						PCI_VENDOR_ID, &ID);
 
 					if (ID == 0xFFFFFFFF) {  /* nothing there. */
 						function++;
 						dbg("Nothing there\n");
 					} else {  /* Something there */
-						rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), 
+						rc = pci_bus_read_config_byte(pci_bus,
+							PCI_DEVFN(device, function), 
 							0x0B, &class_code);
 						if (rc)
 							return rc;
 
-						rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), 
+						rc = pci_bus_read_config_byte(pci_bus,
+							PCI_DEVFN(device, function), 
 							PCI_HEADER_TYPE, &header_type);
 						if (rc)
 							return rc;
 
-						dbg("class_code = %x, header_type = %x\n", class_code, header_type);
+						dbg("class_code = %x, header_type = %x\n",
+							class_code, header_type);
 						stop_it++;
 					}
 				}
@@ -328,7 +347,7 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
  *
  * returns 0 if success
  */
-int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot)
+int shpchp_save_slot_config(struct controller *ctrl, struct pci_func * new_slot)
 {
 	int rc;
 	u8 class_code;
@@ -347,12 +366,15 @@ int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 
 	ID = 0xFFFFFFFF;
 
-	pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID);
+	pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0),
+					PCI_VENDOR_ID, &ID);
 
 	if (ID != 0xFFFFFFFF) {	  /*  device in slot */
-		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code);
+		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0),
+					0x0B, &class_code);
 
-		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type);
+		pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0),
+					PCI_HEADER_TYPE, &header_type);
 
 		if (header_type & 0x80)	/* Multi-function device */
 			max_functions = 8;
@@ -364,7 +386,8 @@ int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 		do {
 			if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {	  /* PCI-PCI Bridge */
 				/*  Recurse the subordinate bus */
-				pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), 
+				pci_bus_read_config_byte(pci_bus,
+					PCI_DEVFN(new_slot->device, function), 
 					PCI_SECONDARY_BUS, &secondary_bus);
 
 				sub_bus = (int) secondary_bus;
@@ -373,15 +396,17 @@ int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 				rc = shpchp_save_config(ctrl, sub_bus, 0, 0);
 
 				if (rc)
-					return(rc);
+					return rc;
 
 			}	/* End of IF */
 
 			new_slot->status = 0;
 
 			for (cloop = 0; cloop < 0x20; cloop++) {
-				pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), 
-					cloop << 2, (u32 *) & (new_slot->config_space [cloop]));
+				pci_bus_read_config_dword(pci_bus,
+					PCI_DEVFN(new_slot->device, function), 
+					cloop << 2,
+					(u32 *) &(new_slot->config_space [cloop]));
 			}
 
 			function++;
@@ -393,15 +418,20 @@ int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 			 */
 
 			while ((function < max_functions) && (!stop_it)) {
-				pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID);
+				pci_bus_read_config_dword(pci_bus,
+					PCI_DEVFN(new_slot->device, function),
+					PCI_VENDOR_ID, &ID);
 
 				if (ID == 0xFFFFFFFF) {	 /* nothing there. */
 					function++;
 				} else {  /* Something there */
-					pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code);
+					pci_bus_read_config_byte(pci_bus,
+						PCI_DEVFN(new_slot->device, function),
+						0x0B, &class_code);
 
-					pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, 
-						&header_type);
+					pci_bus_read_config_byte(pci_bus,
+						PCI_DEVFN(new_slot->device, function),
+						PCI_HEADER_TYPE, &header_type);
 
 					stop_it++;
 				}
@@ -410,10 +440,10 @@ int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
 		} while (function < max_functions);
 	}			/* End of IF (device in slot?) */
 	else {
-		return(2);
+		return 2;
 	}
 
-	return(0);
+	return 0;
 }
 
 
@@ -429,7 +459,7 @@ int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot
  *  it loops for all functions of the slot and disables them.
  * else, it just get resources of the function and return.
  */
-int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func, int disable)
+int shpchp_save_used_resources(struct controller *ctrl, struct pci_func *func, int disable)
 {
 	u8 cloop;
 	u8 header_type;
@@ -461,7 +491,7 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 		devfn = PCI_DEVFN(func->device, func->function);
 
 		/* Save the command register */
-		pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command);
+		pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command);
 
 		if (disable) {
 			/* disable card */
@@ -470,20 +500,22 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 		}
 
 		/* Check for Bridge */
-		pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
+		pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type);
 
 		if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {     /* PCI-PCI Bridge */
-			dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command);
+			dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n",
+					func->bus, func->device, save_command);
 			if (disable) {
 				/* Clear Bridge Control Register */
 				command = 0x00;
 				pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command);
 			}
 
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte);
 
-			bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+			bus_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 			if (!bus_node)
 				return -ENOMEM;
 
@@ -494,13 +526,14 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 			func->bus_head = bus_node;
 
 			/* Save IO base and Limit registers */
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &temp_byte);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &temp_byte);
 			base = temp_byte;
-			pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &temp_byte);
+			pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &temp_byte);
 			length = temp_byte;
 
 			if ((base <= length) && (!disable || (save_command & PCI_COMMAND_IO))) {
-				io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				io_node = kmalloc(sizeof(struct pci_resource),
+							GFP_KERNEL);
 				if (!io_node)
 					return -ENOMEM;
 
@@ -512,11 +545,12 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 			}
 
 			/* Save memory base and Limit registers */
-			pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
-			pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length);
 
 			if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) {
-				mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				mem_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 				if (!mem_node)
 					return -ENOMEM;
 
@@ -527,11 +561,12 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 				func->mem_head = mem_node;
 			}
 			/* Save prefetchable memory base and Limit registers */
-			pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
-			pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base);
+			pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length);
 
 			if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) {
-				p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+				p_mem_node = kmalloc(sizeof(struct pci_resource),
+						GFP_KERNEL);
 				if (!p_mem_node)
 					return -ENOMEM;
 
@@ -542,38 +577,41 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 				func->p_mem_head = p_mem_node;
 			}
 		} else if ((header_type & 0x7F) == PCI_HEADER_TYPE_NORMAL) {
-			dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command);
+			dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n",
+					func->bus, func->device, save_command);
 
 			/* Figure out IO and memory base lengths */
 			for (cloop = PCI_BASE_ADDRESS_0; cloop <= PCI_BASE_ADDRESS_5; cloop += 4) {
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base);
 
 				temp_register = 0xFFFFFFFF;
-				pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register);
-				pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp_register);
+				pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register);
+				pci_bus_read_config_dword(pci_bus, devfn, cloop, &temp_register);
 
-				if (!disable) {
-					pci_bus_write_config_dword (pci_bus, devfn, cloop, save_base);
-				}
+				if (!disable)
+					pci_bus_write_config_dword(pci_bus, devfn, cloop, save_base);
 
 				if (!temp_register)
 					continue;
 
 				base = temp_register;
 
-				if ((base & PCI_BASE_ADDRESS_SPACE_IO) && (!disable || (save_command & PCI_COMMAND_IO))) {
+				if ((base & PCI_BASE_ADDRESS_SPACE_IO) &&
+						(!disable || (save_command & PCI_COMMAND_IO))) {
 					/* IO base */
 					/* set temp_register = amount of IO space requested */
 					base = base & 0xFFFFFFFCL;
 					base = (~base) + 1;
 
-					io_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL);
+					io_node =  kmalloc(sizeof (struct pci_resource),
+								GFP_KERNEL);
 					if (!io_node)
 						return -ENOMEM;
 
 					io_node->base = (ulong)save_base & PCI_BASE_ADDRESS_IO_MASK;
 					io_node->length = (ulong)base;
-					dbg("sur adapter: IO bar=0x%x(length=0x%x)\n", io_node->base, io_node->length);
+					dbg("sur adapter: IO bar=0x%x(length=0x%x)\n",
+						io_node->base, io_node->length);
 
 					io_node->next = func->io_head;
 					func->io_head = io_node;
@@ -583,11 +621,13 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 					char *res_type_str = "PMEM";
 					u32 temp_register2;
 
-					t_mem_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL);
+					t_mem_node = kmalloc(sizeof (struct pci_resource),
+								GFP_KERNEL);
 					if (!t_mem_node)
 						return -ENOMEM;
 
-					if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) && (!disable || (save_command & PCI_COMMAND_MEMORY))) {
+					if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) &&
+							(!disable || (save_command & PCI_COMMAND_MEMORY))) {
 						prefetchable = 0;
 						mem_node = t_mem_node;
 						res_type_str++;
@@ -602,16 +642,20 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 						if (prefetchable) {
 							p_mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK;
 							p_mem_node->length = (ulong)base;
-							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, 
-								p_mem_node->base, p_mem_node->length);
+							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n",
+								res_type_str, 
+								p_mem_node->base,
+								p_mem_node->length);
 
 							p_mem_node->next = func->p_mem_head;
 							func->p_mem_head = p_mem_node;
 						} else {
 							mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK;
 							mem_node->length = (ulong)base;
-							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, 
-								mem_node->base, mem_node->length);
+							dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n",
+								res_type_str, 
+								mem_node->base,
+								mem_node->length);
 
 							mem_node->next = func->mem_head;
 							func->mem_head = mem_node;
@@ -631,16 +675,20 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 						if (prefetchable) {
 							p_mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK;
 							p_mem_node->length = base;
-							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, 
-								p_mem_node->base, p_mem_node->length);
+							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n",
+								res_type_str, 
+								p_mem_node->base,
+								p_mem_node->length);
 
 							p_mem_node->next = func->p_mem_head;
 							func->p_mem_head = p_mem_node;
 						} else {
 							mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK;
 							mem_node->length = base;
-							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, 
-								mem_node->base, mem_node->length);
+							dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n",
+								res_type_str, 
+								mem_node->base,
+								mem_node->length);
 
 							mem_node->next = func->mem_head;
 							func->mem_head = mem_node;
@@ -648,13 +696,15 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 						cloop += 4;
 						break;
 					default:
-						dbg("asur: reserved BAR type=0x%x\n", temp_register);
+						dbg("asur: reserved BAR type=0x%x\n",
+							temp_register);
 						break;
 					}
 				} 
 			}	/* End of base register loop */
 		} else {	/* Some other unknown header type */
-			dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n", func->bus, func->device);
+			dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n",
+					func->bus, func->device);
 		}
 
 		/* find the next device in this slot */
@@ -663,9 +713,27 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
 		func = shpchp_slot_find(func->bus, func->device, index++);
 	}
 
-	return(0);
+	return 0;
 }
 
+/**
+ * kfree_resource_list: release memory of all list members
+ * @res: resource list to free
+ */
+static inline void
+return_resource_list(struct pci_resource **func, struct pci_resource **res)
+{
+	struct pci_resource *node;
+	struct pci_resource *t_node;
+
+	node = *func;
+	*func = NULL;
+	while (node) {
+		t_node = node->next;
+		return_resource(res, node);
+		node = t_node;
+	}
+}
 
 /*
  * shpchp_return_board_resources
@@ -675,95 +743,39 @@ int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func,
  *
  * returns 0 if success
  */
-int shpchp_return_board_resources(struct pci_func * func, struct resource_lists * resources)
+int shpchp_return_board_resources(struct pci_func * func,
+					struct resource_lists * resources)
 {
-	int rc = 0;
-	struct pci_resource *node;
-	struct pci_resource *t_node;
+	int rc;
 	dbg("%s\n", __FUNCTION__);
 
 	if (!func)
-		return(1);
-
-	node = func->io_head;
-	func->io_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->io_head), node);
-		node = t_node;
-	}
+		return 1;
 
-	node = func->mem_head;
-	func->mem_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->mem_head), node);
-		node = t_node;
-	}
+	return_resource_list(&(func->io_head),&(resources->io_head));
+	return_resource_list(&(func->mem_head),&(resources->mem_head));
+	return_resource_list(&(func->p_mem_head),&(resources->p_mem_head));
+	return_resource_list(&(func->bus_head),&(resources->bus_head));
 
-	node = func->p_mem_head;
-	func->p_mem_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->p_mem_head), node);
-		node = t_node;
-	}
-
-	node = func->bus_head;
-	func->bus_head = NULL;
-	while (node) {
-		t_node = node->next;
-		return_resource(&(resources->bus_head), node);
-		node = t_node;
-	}
-
-	rc |= shpchp_resource_sort_and_combine(&(resources->mem_head));
+	rc = shpchp_resource_sort_and_combine(&(resources->mem_head));
 	rc |= shpchp_resource_sort_and_combine(&(resources->p_mem_head));
 	rc |= shpchp_resource_sort_and_combine(&(resources->io_head));
 	rc |= shpchp_resource_sort_and_combine(&(resources->bus_head));
 
-	return(rc);
+	return rc;
 }
 
-
-/*
- * shpchp_destroy_resource_list
- *
- * Puts node back in the resource list pointed to by head
+/**
+ * kfree_resource_list: release memory of all list members
+ * @res: resource list to free
  */
-void shpchp_destroy_resource_list (struct resource_lists * resources)
+static inline void
+kfree_resource_list(struct pci_resource **r)
 {
 	struct pci_resource *res, *tres;
 
-	res = resources->io_head;
-	resources->io_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = resources->mem_head;
-	resources->mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = resources->p_mem_head;
-	resources->p_mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = resources->bus_head;
-	resources->bus_head = NULL;
+	res = *r;
+	*r = NULL;
 
 	while (res) {
 		tres = res;
@@ -772,50 +784,26 @@ void shpchp_destroy_resource_list (struct resource_lists * resources)
 	}
 }
 
-
-/*
- * shpchp_destroy_board_resources
- *
- * Puts node back in the resource list pointed to by head
+/**
+ * shpchp_destroy_resource_list: put node back in the resource list
+ * @resources: list to put nodes back
  */
-void shpchp_destroy_board_resources (struct pci_func * func)
+void shpchp_destroy_resource_list(struct resource_lists *resources)
 {
-	struct pci_resource *res, *tres;
-
-	res = func->io_head;
-	func->io_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = func->mem_head;
-	func->mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = func->p_mem_head;
-	func->p_mem_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
-
-	res = func->bus_head;
-	func->bus_head = NULL;
-
-	while (res) {
-		tres = res;
-		res = res->next;
-		kfree(tres);
-	}
+	kfree_resource_list(&(resources->io_head));
+	kfree_resource_list(&(resources->mem_head));
+	kfree_resource_list(&(resources->p_mem_head));
+	kfree_resource_list(&(resources->bus_head));
 }
 
+/**
+ * shpchp_destroy_board_resources: put node back in the resource list
+ * @resources: list to put nodes back
+ */
+void shpchp_destroy_board_resources(struct pci_func * func)
+{
+	kfree_resource_list(&(func->io_head));
+	kfree_resource_list(&(func->mem_head));
+	kfree_resource_list(&(func->p_mem_head));
+	kfree_resource_list(&(func->bus_head));
+}
diff --git a/drivers/pci/hotplug/shpchprm.h b/drivers/pci/hotplug/shpchprm.h
index eb123e9d6..88aeb978c 100644
--- a/drivers/pci/hotplug/shpchprm.h
+++ b/drivers/pci/hotplug/shpchprm.h
@@ -39,7 +39,6 @@
 int shpchprm_init(enum php_ctlr_type ct);
 void shpchprm_cleanup(void);
 int shpchprm_print_pirt(void);
-void *shpchprm_get_slot(struct slot *slot);
 int shpchprm_find_available_resources(struct controller *ctrl);
 int shpchprm_set_hpp(struct controller *ctrl, struct pci_func *func, u8 card_type);
 void shpchprm_enable_card(struct controller *ctrl, struct pci_func *func, u8 card_type);
diff --git a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c
index 77b962845..8b70c0ccf 100644
--- a/drivers/pci/hotplug/shpchprm_acpi.c
+++ b/drivers/pci/hotplug/shpchprm_acpi.c
@@ -1299,7 +1299,8 @@ static struct acpi_php_slot * get_acpi_slot (
 
 }
 
-void * shpchprm_get_slot(struct slot *slot)
+#if 0
+static void * shpchprm_get_slot(struct slot *slot)
 {
 	struct acpi_bridge	*ab = acpi_bridges_head;
 	struct acpi_php_slot	*aps = get_acpi_slot (ab, slot->number);
@@ -1310,6 +1311,7 @@ void * shpchprm_get_slot(struct slot *slot)
 
 	return (void *)aps;
 }
+#endif
 
 static void shpchprm_dump_func_res( struct pci_func *fun)
 {
diff --git a/drivers/pci/hotplug/shpchprm_legacy.c b/drivers/pci/hotplug/shpchprm_legacy.c
index 8beaf6e5f..66c5981cb 100644
--- a/drivers/pci/hotplug/shpchprm_legacy.c
+++ b/drivers/pci/hotplug/shpchprm_legacy.c
@@ -55,11 +55,6 @@ int shpchprm_print_pirt()
 	return 0;
 }
 
-void * shpchprm_get_slot(struct slot *slot)
-{
-	return NULL;
-}
-
 int shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum)
 {
 	int	offset = devnum - ctrl->slot_device_offset;
diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.c b/drivers/pci/hotplug/shpchprm_nonacpi.c
index b3a151d5c..673719e06 100644
--- a/drivers/pci/hotplug/shpchprm_nonacpi.c
+++ b/drivers/pci/hotplug/shpchprm_nonacpi.c
@@ -51,11 +51,6 @@ int shpchprm_print_pirt(void)
 	return 0;
 }
 
-void * shpchprm_get_slot(struct slot *slot)
-{
-	return NULL;
-}
-
 int shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum)
 {
 	int	offset = devnum - ctrl->slot_device_offset;
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 4c7e1695d..0dea6b1dd 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -299,10 +299,30 @@ static int pci_device_suspend(struct device * dev, u32 state)
 {
 	struct pci_dev * pci_dev = to_pci_dev(dev);
 	struct pci_driver * drv = pci_dev->driver;
+	int i = 0;
 
 	if (drv && drv->suspend)
-		return drv->suspend(pci_dev,state);
-	return 0;
+		i = drv->suspend(pci_dev,state);
+		
+	pci_save_state(pci_dev, pci_dev->saved_config_space);
+	return i;
+}
+
+
+/* 
+ * Default resume method for devices that have no driver provided resume,
+ * or not even a driver at all.
+ */
+static void pci_default_resume(struct pci_dev *pci_dev)
+{
+	/* restore the PCI config space */
+	pci_restore_state(pci_dev, pci_dev->saved_config_space);
+	/* if the device was enabled before suspend, reenable */
+	if (pci_dev->is_enabled)
+		pci_enable_device(pci_dev);
+	/* if the device was busmaster before the suspend, make it busmaster again */
+	if (pci_dev->is_busmaster)
+		pci_set_master(pci_dev);
 }
 
 static int pci_device_resume(struct device * dev)
@@ -312,6 +332,8 @@ static int pci_device_resume(struct device * dev)
 
 	if (drv && drv->resume)
 		drv->resume(pci_dev);
+	else
+		pci_default_resume(pci_dev);
 	return 0;
 }
 
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index fe8a537d9..e3c97d940 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -385,6 +385,7 @@ pci_enable_device_bars(struct pci_dev *dev, int bars)
 int
 pci_enable_device(struct pci_dev *dev)
 {
+	dev->is_enabled = 1;
 	return pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1);
 }
 
@@ -399,6 +400,9 @@ void
 pci_disable_device(struct pci_dev *dev)
 {
 	u16 pci_command;
+	
+	dev->is_enabled = 0;
+	dev->is_busmaster = 0;
 
 	pci_read_config_word(dev, PCI_COMMAND, &pci_command);
 	if (pci_command & PCI_COMMAND_MASTER) {
@@ -601,6 +605,7 @@ pci_set_master(struct pci_dev *dev)
 		cmd |= PCI_COMMAND_MASTER;
 		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
+	dev->is_busmaster = 1;
 	pcibios_set_master(dev);
 }
 
@@ -640,7 +645,7 @@ pci_generic_prep_mwi(struct pci_dev *dev)
 	if (cacheline_size == pci_cache_line_size)
 		return 0;
 
-	printk(KERN_WARNING "PCI: cache line size of %d is not supported "
+	printk(KERN_DEBUG "PCI: cache line size of %d is not supported "
 	       "by device %s\n", pci_cache_line_size << 2, pci_name(dev));
 
 	return -EINVAL;
diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids
index a805bacaa..6e4965e66 100644
--- a/drivers/pci/pci.ids
+++ b/drivers/pci/pci.ids
@@ -7,7 +7,7 @@
 #	so if you have anything to contribute, please visit the home page or
 #	send a diff -u against the most recent pci.ids to pci-ids@ucw.cz.
 #
-#	Daily snapshot on Wed 2004-01-14 11:00:17
+#	Daily snapshot on Thu 2004-04-15 10:00:04
 #
 
 # Vendors, devices and subsystems. Please keep sorted.
@@ -24,7 +24,23 @@
 # Real TJN ID is e159, but they got it wrong several times --mj
 0059  Tiger Jet Network Inc. (Wrong ID)
 0070  Hauppauge computer works Inc.
+	4000  WinTV PVR-350
+	4001  WinTV PVR-250 (v1)
+	4009  WinTV PVR-250
+	4801  WinTV PVR-250 MCE
 0100  Ncipher Corp Ltd
+# 018a is not LevelOne but there is a board misprogrammed
+018a  LevelOne
+	0106  FPC-0106TX misprogrammed [RTL81xx]
+# 021b is not Compaq but there is a board misprogrammed
+021b  Compaq Computer Corporation
+	8139  HNE-300 (RealTek RTL8139c) [iPaq Networking]
+# http://www.davicom.com.tw/
+0291  Davicom Semiconductor, Inc.
+	8212  DM9102A(DM9102AE, SM9102AF) Ethernet 100/10 MBit(Rev 40)
+# SpeedStream is Efficient Networks, Inc, a Siemens Company
+02ac  SpeedStream
+	1012  1012 PCMCIA 10/100 Ethernet Card [RTL81xx]
 0675  Dynalink
 	1700  IS64PH ISDN Adapter
 	1702  IS64PH ISDN Adapter
@@ -36,8 +52,23 @@
 0e11  Compaq Computer Corporation
 	0001  PCI to EISA Bridge
 	0002  PCI to ISA Bridge
+	0046  Smart Array 64xx
+		0e11 409a  Smart Array 641
+		0e11 409b  Smart Array 642
+		0e11 409c  Smart Array 6400
+		0e11 409d  Smart Array 6400 EM
 	0049  NC7132 Gigabit Upgrade Module
 	004a  NC6136 Gigabit Server Adapter
+	007c  NC7770 1000BaseTX
+	007d  NC6770 1000BaseTX
+	0085  NC7780 1000BaseTX
+	00bb  NC7760
+	00ca  NC7771
+	00cb  NC7781
+	00cf  NC7772
+	00d0  NC7782
+	00d1  NC7783
+	00e3  NC7761
 	0508  Netelligent 4/16 Token Ring
 	1000  Triflex/Pentium Bridge, Model 1000
 	2000  Triflex/Pentium Bridge, Model 2000
@@ -45,6 +76,25 @@
 	3033  QVision 1280/p
 	3034  QVision 1280/p
 	4000  4000 [Triflex]
+	4030  SMART-2/P
+	4031  SMART-2SL
+	4032  Smart Array 3200
+	4033  Smart Array 3100ES
+	4034  Smart Array 221
+	4040  Integrated Array
+	4048  Compaq Raid LC2
+	4050  Smart Array 4200
+	4051  Smart Array 4250ES
+	4058  Smart Array 431
+	4070  Smart Array 5300
+	4080  Smart Array 5i
+	4082  Smart Array 532
+	4083  Smart Array 5312
+	4091  Smart Array 6i
+	409a  Smart Array 641
+	409b  Smart Array 642
+	409c  Smart Array 6400
+	409d  Smart Array 6400 EM
 	6010  HotPlug PCI Bridge 6010
 	7020  USB Controller
 	a0ec  Fibre Channel Host Controller
@@ -54,7 +104,7 @@
 		8086 002a  PCI Hotplug Controller A
 		8086 002b  PCI Hotplug Controller B
 	a0f8  ZFMicro Chipset USB
-	a0fc  Fibre Channel Host Controller
+	a0fc  FibreChannel HBA Tachyon
 	ae10  Smart-2/P RAID Controller
 		0e11 4030  Smart-2/P Array Controller
 		0e11 4031  Smart-2SL Array Controller
@@ -64,21 +114,21 @@
 	ae2a  MPC
 	ae2b  MIS-E
 	ae31  System Management Controller
-	ae32  Netelligent 10/100
+	ae32  Netelligent 10/100 TX PCI UTP
 	ae33  Triflex Dual EIDE Controller
-	ae34  Netelligent 10
+	ae34  Netelligent 10 T PCI UTP
 	ae35  Integrated NetFlex-3/P
-	ae40  Netelligent 10/100 Dual
-	ae43  ProLiant Integrated Netelligent 10/100
+	ae40  Netelligent Dual 10/100 TX PCI UTP
+	ae43  Netelligent Integrated 10/100 TX UTP
 	ae69  CETUS-L
 	ae6c  Northstar
 	ae6d  NorthStar CPU to PCI Bridge
-	b011  Integrated Netelligent 10/100
-	b012  Netelligent 10 T/2
+	b011  Netelligent 10/100 TX Embedded UTP
+	b012  Netelligent 10 T/2 PCI UTP/Coax
 	b01e  NC3120 Fast Ethernet NIC
 	b01f  NC3122 Fast Ethernet NIC
 	b02f  NC1120 Ethernet NIC
-	b030  Netelligent WS 5100
+	b030  Netelligent 10/100 TX UTP
 	b04a  10/100 TX PCI Intel WOL UTP Controller
 	b060  Smart Array 5300 Controller
 	b0c6  NC3161 Fast Ethernet NIC
@@ -96,6 +146,9 @@
 	b163  NC3134 Fast Ethernet NIC
 	b164  NC3165 Fast Ethernet Upgrade Module
 	b178  Smart Array 5i/532
+		0e11 4080  Smart Array 5i
+		0e11 4082  Smart Array 532
+		0e11 4083  Smart Array 5312
 	b1a4  NC7131 Gigabit Server Adapter
 	f130  NetFlex-3/P ThunderLAN 1.0
 	f150  NetFlex-3/P ThunderLAN 2.3
@@ -128,32 +181,59 @@
 	0020  53c1010 Ultra3 SCSI Adapter
 		1de1 1020  DC-390U3W
 	0021  53c1010 66MHz  Ultra3 SCSI Adapter
+		124b 1070  PMC-USCSI3
 		4c53 1080  CT8 mainboard
 		4c53 1300  P017 mezzanine (32-bit PMC)
 		4c53 1310  P017 mezzanine (64-bit PMC)
 	0030  53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
+		1028 0123  PowerEdge 2600
+		1028 014a  PowerEdge 1750
 		1028 1010  LSI U320 SCSI Controller
-	0040  53c1035
+	0031  53c1030ZC PCI-X Fusion-MPT Dual Ultra320 SCSI
+	0032  53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI
+	0033  1030ZC_53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI
+	0040  53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI
+		1000 0033  MegaRAID SCSI 320-2XR
+		1000 0066  MegaRAID SCSI 320-2XRWS
+	0041  53C1035ZC PCI-X Fusion-MPT Dual Ultra320 SCSI
 	008f  53c875J
 		1092 8000  FirePort 40 SCSI Controller
 		1092 8760  FirePort 40 Dual SCSI Host Adapter
-	0621  FC909
-	0622  FC929
+	0407  MegaRAID
+		1000 0530  MegaRAID 530 SCSI 320-0X RAID Controller
+		1000 0531  MegaRAID 531 SCSI 320-4X RAID Controller
+		1000 0532  MegaRAID 532 SCSI 320-2X RAID Controller
+		1028 0533  PowerEgde Expandable RAID Controller 4/QC
+		8086 0532  Storage RAID Controller SRCU42X
+	0621  FC909 Fibre Channel Adapter
+	0622  FC929 Fibre Channel Adapter
+		1000 1020  44929 O Dual Fibre Channel card
 	0623  FC929 LAN
-	0624  FC919
+	0624  FC919 Fibre Channel Adapter
 	0625  FC919 LAN
-	0626  FC929X
+	0626  FC929X Fibre Channel Adapter
+		1000 1010  7202-XP-LC Dual Fibre Channel card
 	0627  FC929X LAN
-	0628  FC919X
+	0628  FC919X Fibre Channel Adapter
 	0629  FC919X LAN
 	0701  83C885 NT50 DigitalScape Fast Ethernet
 	0702  Yellowfin G-NIC gigabit ethernet
 		1318 0000  PEI100X
+	0804  SA2010
+	0805  SA2010ZC
+	0806  SA2020
+	0807  SA2020ZC
 	0901  61C102
 	1000  63C815
-	1960  PowerEdge Expandable RAID Controller 4
-		1028 0518  PowerEdge Expandable RAID Controller 4/DC
-		1028 0520  PowerEdge Expandable RAID Controller 4/SC
+	1960  MegaRAID
+		1000 0518  MegaRAID 518 SCSI 320-2 Controller
+		1000 0520  MegaRAID 520 SCSI 320-1 Controller
+		1000 0522  MegaRAID 522 i4133 RAID Controller
+		1000 0523  MegaRAID SATA 150-6 RAID Controller
+		1000 4523  MegaRAID SATA 150-4 RAID Controller
+		1000 a520  MegaRAID ZCR SCSI 320-0 Controller
+		1028 0518  MegaRAID 518 DELL PERC 4/DC RAID Controller
+		1028 0520  MegaRAID 520 DELL PERC 4/SC RAID Controller
 		1028 0531  PowerEdge Expandable RAID Controller 4/QC
 1001  Kolter Electronic
 	0010  PCI 1616 Measurement card with 32 digital I/O lines
@@ -167,16 +247,57 @@
 	9100  INI-9100/9100W SCSI Host
 1002  ATI Technologies Inc
 	4136  Radeon IGP 320 M
-	4144  Radeon R300 AD [Radeon 9500 Pro]
-	4145  Radeon R300 AE [Radeon 9500 Pro]
-	4146  Radeon R300 AF [Radeon 9500 Pro]
-	4147  Radeon R300 AG [FireGL Z1/X1]
+	4144  R300 AD [Radeon 9500 Pro]
+# New PCI ID provided by ATI developer relations (correction to above)
+	4145  R300 AE [Radeon 9700 Pro]
+# New PCI ID provided by ATI developer relations (oops, correction to above)
+	4146  R300 AF [Radeon 9700 Pro]
+	4147  R300 AG [FireGL Z1/X1]
+	4148  R350 AH [Radeon 9800]
+	4149  R350 AI [Radeon 9800]
+	414b  R350 AK [Fire GL ??]
+# New PCI ID provided by ATI developer relations
+	4150  RV350 AP [Radeon 9600]
+		1458 4024  Giga-Byte GV-R96128D Primary
+		148c 2064  PowerColor R96A-C3N
+		148c 2066  PowerColor R96A-C3N
+		174b 7c19  Sapphire Atlantis Radeon 9600 Pro
+		174b 7c29  GC-R9600PRO Primary [Sapphire]
+		18bc 0101  GC-R9600PRO Primary
+# New PCI ID provided by ATI developer relations
+	4151  RV350 AQ [Radeon 9600]
+# New PCI ID provided by ATI developer relations
+	4152  RV350 AR [Radeon 9600]
+	4154  RV350 AT [Fire GL T2]
+	4155  RV350 AU [Fire GL T2]
+	4156  RV350 AV [Fire GL T2]
+	4157  RV350 AW [Fire GL T2]
 	4158  68800AX [Mach32]
-	4164  Radeon R300 Secondary (DVI) output
-	4242  Radeon R200 BB [Radeon All in Wonder 8500DV]
+# The PCI ID is unrelated to any DVI output.
+	4164  R300 AD [Radeon 9500 Pro] (Secondary)
+# New PCI ID info provided by ATI developer relations
+	4165  R300 AE [Radeon 9700 Pro] (Secondary)
+# New PCI ID info provided by ATI developer relations
+	4166  R300 AF [Radeon 9700 Pro] (Secondary)
+# New PCI ID provided by ATI developer relations
+	4168  Radeon R350 [Radeon 9800] (Secondary)
+# New PCI ID provided by ATI developer relations (correction to above)
+	4170  RV350 AP [Radeon 9600] (Secondary)
+		1458 4025  Giga-Byte GV-R96128D Secondary
+		148c 2067  PowerColor R96A-C3N (Secondary)
+		174b 7c28  GC-R9600PRO Secondary [Sapphire]
+		18bc 0100  GC-R9600PRO Secondary
+# New PCI ID provided by ATI developer relations (correction to above)
+	4171  RV350 AQ [Radeon 9600] (Secondary)
+# New PCI ID provided by ATI developer relations (correction to above)
+	4172  RV350 AR [Radeon 9600] (Secondary)
+	4242  R200 BB [Radeon All in Wonder 8500DV]
 		1002 02aa  Radeon 8500 AIW DV Edition
 	4336  Radeon Mobility U1
 	4337  Radeon IGP 340M
+	4341  IXP150 AC'97 Audio Controller
+# Radeon 9100 IGP integrated
+	4353  ATI SMBus
 	4354  215CT [Mach64 CT]
 	4358  210888CX [Mach64 CX]
 	4554  210888ET [Mach64 ET]
@@ -246,21 +367,22 @@
 	475a  3D Rage IIC AGP
 		1002 0087  Rage 3D IIC
 		1002 475a  Rage IIC AGP
-	4964  Radeon R250 Id [Radeon 9000]
-	4965  Radeon R250 Ie [Radeon 9000]
-	4966  Radeon R250 If [Radeon 9000]
-		10f1 0002  R250 If [Tachyon G9000 PRO]
-		148c 2039  R250 If [Radeon 9000 Pro "Evil Commando"]
-		1509 9a00  R250 If [Radeon 9000 "AT009"]
-# New subdevice - 3D Prophet 9000 PCI by Hercules.  AGP version probably would have same ID, so not specified.
-		1681 0040  R250 If [3D prophet 9000]
-		174b 7176  R250 If [Sapphire Radeon 9000 Pro]
-		174b 7192  R250 If [Radeon 9000 "Atlantis"]
-		17af 2005  R250 If [Excalibur Radeon 9000 Pro]
-		17af 2006  R250 If [Excalibur Radeon 9000]
-	4967  Radeon R250 Ig [Radeon 9000]
-	496e  Radeon R250 [Radeon 9000] (Secondary)
+	4964  Radeon RV250 Id [Radeon 9000]
+	4965  Radeon RV250 Ie [Radeon 9000]
+	4966  Radeon RV250 If [Radeon 9000]
+		10f1 0002  RV250 If [Tachyon G9000 PRO]
+		148c 2039  RV250 If [Radeon 9000 Pro "Evil Commando"]
+		1509 9a00  RV250 If [Radeon 9000 "AT009"]
+# New subdevice - 3D Prophet 9000 PCI by Hercules. AGP version probably would have same ID, so not specified.
+		1681 0040  RV250 If [3D prophet 9000]
+		174b 7176  RV250 If [Sapphire Radeon 9000 Pro]
+		174b 7192  RV250 If [Radeon 9000 "Atlantis"]
+		17af 2005  RV250 If [Excalibur Radeon 9000 Pro]
+		17af 2006  RV250 If [Excalibur Radeon 9000]
+	4967  Radeon RV250 Ig [Radeon 9000]
+	496e  Radeon RV250 [Radeon 9000] (Secondary)
 	4c42  3D Rage LT Pro AGP-133
+		0e11 b0e7  Rage LT Pro (Compaq Presario 5240)
 		0e11 b0e8  Rage 3D LT Pro
 		0e11 b10e  3D Rage LT Pro (Compaq Armada 1750)
 		1002 0040  Rage LT Pro AGP 2X
@@ -294,10 +416,11 @@
 	4c57  Radeon Mobility M7 LW [Radeon Mobility 7500]
 		1014 0517  ThinkPad T30
 		1028 00e6  Radeon Mobility M7 LW (Dell Inspiron 8100)
+		1028 012a  Latitude C640
 		144d c006  Radeon Mobility M7 LW in vpr Matrix 170B4
 	4c58  Radeon RV200 LX [Mobility FireGL 7800 M7]
 	4c59  Radeon Mobility M6 LY
-		1014 0235  ThinkPad A30p (2653-64G)
+		1014 0235  ThinkPad A30/A30p (2652/2653)
 		1014 0239  ThinkPad X22/X23/X24
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 	4c5a  Radeon Mobility M6 LZ
@@ -312,15 +435,29 @@
 	4e44  Radeon R300 ND [Radeon 9700 Pro]
 	4e45  Radeon R300 NE [Radeon 9500 Pro]
 		1002 0002  Radeon R300 NE [Radeon 9500 Pro]
-	4e46  Radeon R300 NF [Radeon 9700]
+# New PCI ID provided by ATI developer relations (correction to above)
+	4e46  RV350 NF [Radeon 9600]
 	4e47  Radeon R300 NG [FireGL X1]
 	4e48  Radeon R350 [Radeon 9800]
+# New PCI ID provided by ATI developer relations
+	4e49  Radeon R350 [Radeon 9800]
+	4e4a  RV350 NJ [Radeon 9800 XT]
+	4e4b  R350 NK [Fire GL X2]
+# New PCI ID provided by ATI developer relations
+	4e50  RV350 [Mobility Radeon 9600 M10]
+# New PCI ID provided by ATI developer relations
+	4e52  RV350 [Mobility Radeon 9600 M10]
+	4e54  M10 NT [FireGL Mobility T2]
 	4e64  Radeon R300 [Radeon 9700 Pro] (Secondary)
 	4e65  Radeon R300 [Radeon 9500 Pro] (Secondary)
 		1002 0003  Radeon R300 NE [Radeon 9500 Pro]
-	4e66  Radeon R300 [Radeon 9700] (Secondary)
+# New PCI ID provided by ATI developer relations (correction to above)
+	4e66  RV350 NF [Radeon 9600] (Secondary)
 	4e67  Radeon R300 [FireGL X1] (Secondary)
 	4e68  Radeon R350 [Radeon 9800] (Secondary)
+# New PCI ID provided by ATI developer relations
+	4e69  Radeon R350 [Radeon 9800] (Secondary)
+	4e6a  RV350 NJ [Radeon 9800 XT] (Secondary)
 	5041  Rage 128 PA/PRO
 	5042  Rage 128 PB/PRO AGP 2x
 	5043  Rage 128 PC/PRO AGP 4x
@@ -390,6 +527,8 @@
 	514d  Radeon R200 QM [Radeon 9100]
 	514e  Radeon R200 QN [Radeon 8500LE]
 	514f  Radeon R200 QO [Radeon 8500LE]
+	5154  R200 QT [Radeon 8500]
+	5155  R200 QU [Radeon 9100]
 	5157  Radeon RV200 QW [Radeon 7500]
 		1002 013a  Radeon 7500
 		1458 4000  RV200 QW [RADEON 7500 PRO MAYA AR]
@@ -469,7 +608,20 @@
 		1002 5654  Mach64VT Reference
 	5655  264VT3 [Mach64 VT3]
 	5656  264VT4 [Mach64 VT4]
-	5961  Radeon RV280 [Radeon 9200]
+	5941  RV280 [Radeon 9200] (Secondary)
+# http://www.hightech.com.hk/html/9200.htm
+		17af 200d  Excalibur Radeon 9200
+		18bc 0050  GeXcube GC-R9200-C3 (Secondary)
+	5960  RV280 [Radeon 9200 PRO]
+	5961  RV280 [Radeon 9200]
+# http://www.hightech.com.hk/html/9200.htm
+		17af 200c  Excalibur Radeon 9200
+		18bc 0051  GeXcube GC-R9200-C3
+	5964  RV280 [Radeon 9200 SE]
+		148c 2073  CN-AG92E
+	5c61  RV250 5c61 [Radeon Mobility 9200 M9+]
+	5c63  RV250 5c63 [Radeon Mobility 9200 M9+]
+	5d44  RV280 [Radeon 9200 SE] (Secondary)
 	700f  PCI Bridge [IGP 320M]
 	7010  PCI Bridge [IGP 340M]
 	cab0  AGP Bridge [IGP 320M]
@@ -610,6 +762,7 @@
 		1186 1100  DFE-500TX Fast Ethernet
 		1186 1101  DFE-500TX Fast Ethernet
 		1186 1102  DFE-500TX Fast Ethernet
+		1186 1112  DFE-570TX Quad Fast Ethernet
 		1259 2800  AT-2800Tx Fast Ethernet
 		1266 0004  Eagle Fast EtherMAX
 		12af 0019  NetFlyer Cardbus Fast Ethernet
@@ -621,7 +774,7 @@
 		1395 0001  10/100 Ethernet CardBus PC Card
 		13d1 ab01  EtherFast 10/100 Cardbus (PCMPC200)
 		8086 0001  EtherExpress PRO/100 Mobile CardBus 32
-	001a  Farallon PN9000SX
+	001a  Farallon PN9000SX Gigabit Ethernet
 	0021  DECchip 21052
 	0022  DECchip 21150
 	0023  DECchip 21150
@@ -639,7 +792,8 @@
 		12d9 000a  IP Telephony card
 		4c53 1050  CT7 mainboard
 		4c53 1051  CE7 mainboard
-		9005 0365  Adaptec 5400S
+		9005 0364  5400S (Mustang)
+		9005 0365  5400S (Mustang)
 		9005 1364  Dell PowerEdge RAID Controller 2
 		9005 1365  Dell PowerEdge RAID Controller 2
 		e4bf 1000  CC8-1-BLUES
@@ -818,8 +972,13 @@
 101e  American Megatrends Inc.
 	1960  MegaRAID
 		101e 0471  MegaRAID 471 Enterprise 1600 RAID Controller
-		101e 0475  MegaRAID 475 Express 500 RAID Controller
+		101e 0475  MegaRAID 475 Express 500/500LC RAID Controller
+		101e 0477  MegaRAID 477 Elite 3100 RAID Controller
 		101e 0493  MegaRAID 493 Elite 1600 RAID Controller
+		101e 0494  MegaRAID 494 Elite 1650 RAID Controller
+		101e 0503  MegaRAID 503 Enterprise 1650 RAID Controller
+		101e 0511  MegaRAID 511 i4 IDE RAID Controller
+		101e 0522  MegaRAID 522 i4133 RAID Controller
 		1028 0471  PowerEdge RAID Controller 3/QC
 		1028 0475  PowerEdge RAID Controller 3/SC
 		1028 0493  PowerEdge RAID Controller 3/DC
@@ -843,6 +1002,7 @@
 	1103  K8 NorthBridge
 	2000  79c970 [PCnet32 LANCE]
 		1014 2000  NetFinity 10/100 Fast Ethernet
+		1022 2000  PCnet - Fast 79C971
 		103c 104c  Ethernet with LAN remote power Adapter
 		103c 1064  Ethernet with LAN remote power Adapter
 		103c 1065  Ethernet with LAN remote power Adapter
@@ -913,6 +1073,7 @@
 	0194  82C194
 	2000  4DWave DX
 	2001  4DWave NX
+	2100  CyberBlade XP4m32
 	8400  CyberBlade/i7
 		1023 8400  CyberBlade i7 AGP
 	8420  CyberBlade/i7d
@@ -1029,7 +1190,6 @@
 		1028 0003  PowerEdge Expandable RAID Controller 3/Si
 	0004  PowerEdge Expandable RAID Controller 3/Si
 		1028 00d0  PowerEdge Expandable RAID Controller 3/Si
-	0005  PowerEdge Expandable RAID Controller 3/Di
 	0006  PowerEdge Expandable RAID Controller 3/Di
 	0007  Remote Access Controller:DRAC III
 	0008  Remote Access Controller
@@ -1040,12 +1200,26 @@
 		1028 0121  PowerEdge Expandable RAID Controller 3/Di
 	000c  Remote Access Controller:ERA or ERA/O
 	000d  BMC/SMIC device
-	000e  PowerEdge Expandable RAID Controller
-	000f  PowerEdge Expandable RAID Controller 4/Di
+	000e  PowerEdge Expandable RAID controller 4
+		1028 0123  PowerEdge Expandable RAID Controller 4/Di
+	000f  PowerEdge Expandable RAID controller 4
+		1028 013b  MegaRAID DELL PERC 4/Di RAID On Motherboard
+		1028 014a  PowerEdge Expandable RAID Controller 4/Di
+		1028 014c  MegaRAID DELL PERC 4/Di RAID On Motherboard
+		1028 014d  MegaRAID DELL PERC 4/Di RAID On Motherboard
 1029  Siemens Nixdorf IS
 102a  LSI Logic
 	0000  HYDRA
 	0010  ASPEN
+	001f  AHA-2940U2/U2W /7890/7891 SCSI Controllers
+		9005 000f  2940U2W SCSI Controller
+		9005 0106  2940U2W SCSI Controller
+		9005 a180  2940U2W SCSI Controller
+	00c5  AIC-7899 U160/m SCSI Controller
+		1028 00c5  PowerEdge 2550/2650/4600
+	00cf  AIC-7899P U160/m
+		1028 0106  PowerEdge 4600
+		1028 0121  PowerEdge 2650
 102b  Matrox Graphics, Inc.
 # DJ: I've a suspicion that 0010 is a duplicate of 0d10.
 	0010  MGA-I [Impression?]
@@ -1171,6 +1345,7 @@
 		102b 0f83  Millennium G550
 		102b 0f84  Millennium G550 Dual Head DDR 32Mb
 		102b 1e41  Millennium G550
+	2537  MGA G650 AGP
 	4536  VIA Framegrabber
 	6573  Shark 10/100 Multiport SwitchNIC
 102c  Chips and Technologies
@@ -1206,6 +1381,11 @@
 	0009  r4x00
 	0020  ATM Meteor 155
 		102f 00f8  ATM Meteor 155
+	0105  TC86C001 [goku-s] IDE
+	0106  TC86C001 [goku-s] USB 1.1 Host
+	0107  TC86C001 [goku-s] USB Device Controller
+	0108  TC86C001 [goku-s] I2C/SIO/GPIO Controller
+	0180  TX4927
 1030  TMC Research
 1031  Miro Computer Products AG
 	5601  DC20 ASIC
@@ -1235,6 +1415,7 @@
 		1179 0001  USB
 		12ee 7000  Root Hub
 		1799 0001  Root Hub
+		807d 0035  PCI-USB2 (OHCI subsystem)
 	003b  PCI to C-bus Bridge
 	003e  NAPCCARD Cardbus Controller
 	0046  PowerVR PCX2 [midas]
@@ -1252,14 +1433,21 @@
 	0074  56k Voice Modem
 		1033 8014  RCV56ACF 56k Voice Modem
 	009b  Vrc5476
+	00a5  VRC4173
 	00a6  VRC5477 AC97
 	00cd  IEEE 1394 [OrangeLink] Host Controller
 		12ee 8011  Root hub
+	00ce  IEEE 1394 Host Controller
 	00df  Vr4131
 	00e0  USB 2.0
+		0ee4 3383  Sitecom IEEE 1394 / USB2.0 Combo Card
 		12ee 7001  Root hub
 		1799 0002  Root Hub
+		807d 1043  PCI-USB2 (EHCI subsystem)
+	00e7  IEEE 1394 Host Controller
+	00f2  uPD72874 IEEE1394 OHCI 1.1 3-port PHY-Link Ctrlr
 	00f3  uPD6113x Multimedia Decoder/Processor [EMMA2]
+	010c  VR7701
 1034  Framatome Connectors USA Inc.
 1035  Comp. & Comm. Research Lab
 1036  Future Domain Corp.
@@ -1267,27 +1455,27 @@
 1037  Hitachi Micro Systems
 1038  AMP, Inc
 1039  Silicon Integrated Systems [SiS]
-# This is what all my tests report. I don't know if this is equivalent to "5591/5592 AGP".
-	0001  SiS 530 Virtual PCI-to-PCI bridge (AGP)
+	0001  Virtual PCI-to-PCI bridge (AGP)
 	0002  SG86C202
 	0006  85C501/2/3
-	0008  85C503/5513
+	0008  SiS85C503/5513 (LPC Bridge)
 	0009  ACPI
 	0018  SiS85C503/5513 (LPC Bridge)
 	0200  5597/5598/6326 VGA
 		1039 0000  SiS5597 SVGA (Shared RAM)
 	0204  82C204
 	0205  SG86C205
-	0300  SiS300/305 PCI/AGP VGA Display Adapter
+	0300  300/305 PCI/AGP VGA Display Adapter
 		107d 2720  Leadtek WinFast VR300
-	0310  SiS315H PCI/AGP VGA Display Adapter
-	0315  SiS315 PCI/AGP VGA Display Adapter
-	0325  SiS315PRO PCI/AGP VGA Display Adapter
-	0330  SiS330 [Xabre] PCI/AGP VGA Display Adapter
+	0310  315H PCI/AGP VGA Display Adapter
+	0315  315 PCI/AGP VGA Display Adapter
+	0325  315PRO PCI/AGP VGA Display Adapter
+	0330  330 [Xabre] PCI/AGP VGA Display Adapter
 	0406  85C501/2
 	0496  85C496
 	0530  530 Host
 	0540  540 Host
+	0550  550 Host
 	0597  5513C
 	0601  85C601
 	0620  620 Host
@@ -1297,24 +1485,32 @@
 	0645  SiS645 Host & Memory & AGP Controller
 	0646  SiS645DX Host & Memory & AGP Controller
 	0648  SiS 645xx
-	0650  650 Host
-	0651  SiS651 Host
+	0650  650/M650 Host
+	0651  651 Host
+	0655  655 Host
+	0660  660 Host
+	0661  661FX/M661FX/M661MX Host
 	0730  730 Host
 	0733  733 Host
 	0735  735 Host
 	0740  740 Host
+	0741  741/741GX/M741 Host
 	0745  745 Host
 	0746  746 Host
-	0755  SiS 755 Host Bridge
-	0900  SiS900 10/100 Ethernet
+	0755  755 Host
+	0760  760/M760 Host
+	0900  SiS900 PCI Fast Ethernet
 		1039 0900  SiS900 10/100 Ethernet Adapter
 		1043 8035  CUSI-FX motherboard
 	0961  SiS961 [MuTIOL Media IO]
 	0962  SiS962 [MuTIOL Media IO]
+	0963  SiS963 [MuTIOL Media IO]
+	0964  SiS964 [MuTIOL Media IO]
+	0965  SiS965 [MuTIOL Media IO]
 	3602  83C602
 	5107  5107
 	5300  SiS540 PCI Display Adapter
-	5315  SiS550 AGP/VGA VGA Display Adapter
+	5315  550 PCI/AGP VGA Display Adapter
 	5401  486 PCI Chipset
 	5511  5511/5512
 	5513  5513 [IDE]
@@ -1332,12 +1528,12 @@
 	6204  Video decoder & MPEG interface
 	6205  VGA Controller
 	6236  6236 3D-AGP
-	6300  SiS630 GUI Accelerator+3D
+	6300  630/730 PCI/AGP VGA Display Adapter
 		1019 0970  P6STP-FL motherboard
 		1043 8035  CUSI-FX motherboard
-	6306  SiS530 3D PCI/AGP
+	6306  530/620 PCI/AGP VGA Display Adapter
 		1039 6306  SiS530,620 GUI Accelerator+3D
-	6325  SiS650/651/M650/740 PCI/AGP VGA Display Adapter
+	6325  65x/M650/740 PCI/AGP VGA Display Adapter
 	6326  86C326 5598/6326
 		1039 6326  SiS6326 GUI Accelerator
 		1092 0a50  SpeedStar A50
@@ -1345,14 +1541,16 @@
 		1092 4910  SpeedStar A70
 		1092 4920  SpeedStar A70
 		1569 6326  SiS6326 GUI Accelerator
+	6330  661FX/M661FX/M661MX/741/M741/760/M760 PCI/AGP
 	7001  USB 1.0 Controller
 		1039 7000  Onboard USB Controller
 	7002  USB 2.0 Controller
 		1509 7002  Onboard USB Controller
 	7007  FireWire Controller
 	7012  Sound Controller
-	7013  Intel 537 [56k Winmodem]
-	7016  10/100 Ethernet Adapter
+# There are may be different modem codecs here (Intel537 compatible and incompatible)
+	7013  AC'97 Modem Controller
+	7016  SiS7016 PCI Fast Ethernet Adapter
 		1039 7016  SiS7016 10/100 Ethernet Adapter
 	7018  SiS PCI Audio Accelerator
 		1014 01b6  SiS PCI Audio Accelerator
@@ -1410,6 +1608,7 @@
 		103c 1226  Keystone SP2
 		103c 1227  Powerbar SP2
 		103c 1282  Everest SP2
+	1054  PCI Local Bus Adapter
 	1064  79C970 PCnet Ethernet Controller
 	108b  Visualize FXe
 	10c1  NetServer Smart IRQ Router
@@ -1422,6 +1621,7 @@
 	1229  zx1 System Bus Adapter
 	122a  zx1 I/O Controller
 	122e  zx1 Local Bus Adapter
+	127c  sx1000 I/O Controller
 	1290  Auxiliary Diva Serial Port
 	2910  E2910A PCIBus Exerciser
 	2925  E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer
@@ -1437,8 +1637,11 @@
 	3020  Samurai_IDE
 1043  Asustek Computer, Inc.
 	0675  ISDNLink P-IN100-ST-D
+	4015  v7100 SDRAM [GeForce2 MX]
 	4021  v7100 Combo Deluxe [GeForce2 MX + TV tuner]
 	4057  v8200 GeForce 3
+	8043  v8240 PAL 128M [P4T] Motherboard
+	807b  v9280/TD [Geforce4 TI4200 8X With TV-Out and DVI]
 1044  Distributed Processing Technology
 	1012  Domino RAID Engine
 	a400  SmartCache/Raid I-IV Controller
@@ -1523,9 +1726,9 @@
 	021b  STPC Consumer IIA Southbridge
 	0500  ST70137 [Unicorn] ADSL DMT Transceiver
 	0564  STPC Client Northbridge
-	0981  DEC-Tulip compatible 10/100 Ethernet
+	0981  21x4x DEC-Tulip compatible 10/100 Ethernet
 	1746  STG 1764X
-	2774  DEC-Tulip compatible 10/100 Ethernet
+	2774  21x4x DEC-Tulip compatible 10/100 Ethernet
 	3520  MPEG-II decoder card
 	55cc  STPC Client Southbridge
 104b  BusLogic
@@ -1577,24 +1780,33 @@
 	8022  TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link)
 	8023  TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)
 	8024  TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
+	8025  TSB82AA2 IEEE-1394b Link Layer Controller
 	8026  TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)
 	8027  PCI4451 IEEE-1394 Controller
 		1028 00e6  PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)
 	8029  PCI4510 IEEE-1394 Controller
+		1071 8160  MIM2900
 	8400  ACX 100 22Mbps Wireless Interface
+		00fc 16ec  U.S. Robotics 22 Mbps Wireless PC Card (model 2210)
+		00fd 16ec  U.S. Robotics 22Mbps Wireless PCI Adapter (model 2216)
+		1186 3b01  DWL-520+ 22Mbps PCI Wireless Adapter
 	8401  ACX 100 22Mbps Wireless Interface
 # OK, this info is almost useless as is, but at least it's known that it's a wireless card. More info requested from reporter (whi
 	9000  Wireless Interface (of unknown type)
+	9066  ACX 111 54Mbps Wireless Interface
 	a001  TDC1570
 	a100  TDC1561
 	a102  TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f
-	a106  TMS320C6205
+	a106  TMS320C6205 Fixed Point DSP
+		175c 5000  ASI50xx Audio Adapter
+		175c 8700  ASI87xx Radio Tuner card
 	ac10  PCI1050
 	ac11  PCI1053
 	ac12  PCI1130
 	ac13  PCI1031
 	ac15  PCI1131
 	ac16  PCI1250
+		1014 0092  ThinkPad 600
 	ac17  PCI1220
 	ac18  PCI1260
 	ac19  PCI1221
@@ -1603,6 +1815,7 @@
 		0e11 b113  Armada M700
 	ac1c  PCI1225
 		0e11 b121  Armada E500
+		1028 0088  Dell  Computer Corporation  Latitude CPi A400XT
 	ac1d  PCI1251A
 	ac1e  PCI1211
 	ac1f  PCI1251B
@@ -1617,18 +1830,27 @@
 	ac42  PCI4451 PC card Cardbus Controller
 		1028 00e6  PCI4451 PC card CardBus Controller (Dell Inspiron 8100)
 	ac44  PCI4510 PC card Cardbus Controller
+		1071 8160  MIM2000
+	ac46  PCI4520 PC card Cardbus Controller
 	ac50  PCI1410 PC card Cardbus Controller
 	ac51  PCI1420
 		1014 023b  ThinkPad T23 (2647-4MG)
 		1028 00b1  Latitude C600
+		1028 012a  Latitude C640
 		10cf 1095  Lifebook C6155
 		e4bf 1000  CP2-2-HIPHOP
 	ac52  PCI1451 PC card Cardbus Controller
 	ac53  PCI1421 PC card Cardbus Controller
-	ac55  PCI1250 PC card Cardbus Controller
-		1014 0512  ThinkPad T30
+	ac55  PCI1520 PC card Cardbus Controller
+		1014 0512  ThinkPad T30/T40
 	ac56  PCI1510 PC card Cardbus Controller
 	ac60  PCI2040 PCI to DSP Bridge Controller
+		175c 5100  ASI51xx Audio Adapter
+		175c 6100  ASI61xx Audio Adapter
+		175c 6200  ASI62xx Audio Adapter
+	ac8d  PCI 7620
+	ac8e  PCI7420 CardBus Controller
+	ac8f  PCI7420 Flash Media Controller
 	fe00  FireWire Host Controller
 	fe03  12C01A FireWire Host Controller
 104d  Sony Corporation
@@ -1674,7 +1896,20 @@
 	0006  MPC8245 [Unity]
 	0100  MC145575 [HFC-PCI]
 	0431  KTI829c 100VG
-	1801  Audio I/O Controller (MIDI)
+	1801  DSP56301 Digital Signal Processor
+		14fb 0101  Transas Radar Imitator Board [RIM]
+		14fb 0102  Transas Radar Imitator Board [RIM-2]
+		14fb 0202  Transas Radar Integrator Board [RIB-2]
+		14fb 0611  1 channel CAN bus Controller [CanPci-1]
+		14fb 0612  2 channels CAN bus Controller [CanPci-2]
+		14fb 0613  3 channels CAN bus Controller [CanPci-3]
+		14fb 0614  4 channels CAN bus Controller [CanPci-4]
+		14fb 0621  1 channel CAN bus Controller [CanPci2-1]
+		14fb 0622  2 channels CAN bus Controller [CanPci2-2]
+		14fb 0810  Transas VTS Radar Integrator Board [RIB-4]
+		175c 4200  ASI4215 Audio Adapter
+		175c 4300  ASI43xx Audio Adapter
+		175c 4400  ASI4401 Audio Adapter
 		ecc0 0030  Layla
 	18c0  MPC8265A/MPC8266
 	4801  Raven
@@ -1710,6 +1945,10 @@
 		105a 4d39  Fasttrak66
 	1275  20275
 	3318  PDC20318 (SATA150 TX4)
+	3319  PDC20319 (SATA150 TX4)
+	3373  PDC20378 (SATA150 TX)
+		1462 702e  K8T NEO FIS2R motherboard
+	3375  PDC20375 (SATA150 TX2plus)
 	3376  PDC20376
 		1043 809e  A7V8X motherboard
 	4d30  20267
@@ -1727,11 +1966,15 @@
 		105a 4d68  Ultra133TX2
 	5275  PDC20276 IDE
 		105a 0275  SuperTrak SX6000 IDE
+		105a 1275  MBFastTrak133 Lite (tm) Controller (RAID mode)
+		1458 b001  MBUltra 133
 	5300  DC5300
 	6268  20268R
 	6269  PDC20271
 		105a 6269  FastTrak TX2/TX2000
 	6621  PDC20621 [SX4000] 4 Channel IDE RAID Controller
+	6622  PDC20621 [SATA150 SX4] 4 Channel IDE RAID Controller
+	6626  PDC20618 Ultra 618
 	6629  PDC20619 FastTrak TX4000 RAID
 	7275  PDC20277
 105b  Foxconn International, Inc.
@@ -1812,14 +2055,21 @@
 	0005  National PC87550 System Controller
 	8002  PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave
 1067  Mitsubishi Electric
+	0301  AccelGraphics AccelECLIPSE
+	0304  AccelGALAXY A2100 [OEM Evans & Sutherland]
+	0308  Tornado 3000 [OEM Evans & Sutherland]
 	1002  VG500 [VolumePro Volume Rendering Accelerator]
 1068  Diversified Technology
 1069  Mylex Corporation
 	0001  DAC960P
 	0002  DAC960PD
-	0010  DAC960PX
+	0010  DAC960PG
+	0020  DAC960LA
 	0050  AcceleRAID 352/170/160 support Device
 	b166  Gemstone chipset SCSI controller
+		1014 0242  iSeries 2872 DASD IOA
+		1014 0266  Dual Channel PCI-X U320 SCSI Adapter
+		1014 0278  Dual Channel PCI-X U320 SCSI RAID Adapter
 	ba55  eXtremeRAID 1100 support Device
 	ba56  eXtremeRAID 2000/3000 support Device
 106a  Aten Research Inc
@@ -1853,6 +2103,22 @@
 	0032  UniNorth 2 GMAC (Sun GEM)
 	0033  UniNorth 2 ATA/100
 	0034  UniNorth 2 AGP
+	0035  UniNorth 2 PCI
+	0036  UniNorth 2 Internal PCI
+	003b  UniNorth/Intrepid ATA/100
+	003e  KeyLargo/Intrepid Mac I/O
+	003f  KeyLargo/Intrepid USB
+	0040  K2 KeyLargo USB
+	0041  K2 KeyLargo Mac/IO
+	0042  K2 FireWire
+	0043  K2 ATA/100
+	0045  K2 HT-PCI Bridge
+	0046  K2 HT-PCI Bridge
+	0047  K2 HT-PCI Bridge
+	0048  K2 HT-PCI Bridge
+	0049  K2 HT-PCI Bridge
+	004b  U3 AGP
+	004c  K2 GMAC (Sun GEM)
 	1645  Tigon3 Gigabit Ethernet NIC (BCM5701)
 106c  Hyundai Electronics America
 	8801  Dual Pentium ISA/PCI Motherboard
@@ -1865,6 +2131,7 @@
 106f  City Gate Development Ltd
 1070  Daewoo Telecom Ltd
 1071  Mitac
+	8160  Mitac 8060B Mobile Platform
 1072  GIT Co Ltd
 1073  Yamaha Corporation
 	0001  3D GUI Accelerator
@@ -1905,13 +2172,13 @@
 		101e 8471  QLA12160 on AMI MegaRAID
 		101e 8493  QLA12160 on AMI MegaRAID
 	1240  ISP1240 SCSI Host Adapter
-	1280  ISP1280
+	1280  ISP1280 SCSI Host Adapter
 	2020  ISP2020A Fast!SCSI Basic Adapter
 	2100  QLA2100 64-bit Fibre Channel Adapter
 		1077 0001  QLA2100 64-bit Fibre Channel Adapter
-	2200  QLA2200
+	2200  QLA2200 64-bit Fibre Channel Adapter
 		1077 0002  QLA2200
-	2300  QLA2300 64-bit FC-AL Adapter
+	2300  QLA2300 64-bit Fibre Channel Adapter
 	2312  QLA2312 Fibre Channel Adapter
 1078  Cyrix Corporation
 	0000  5510 [Grappa]
@@ -2008,6 +2275,7 @@
 	8001  Schizo PCI Bus Module
 	a000  Ultra IIi
 	a001  Ultra IIe
+	a801  Tomatillo PCI Bus Module
 108f  Systemsoft
 1090  Encore Computer Corporation
 1091  Intergraph Corporation
@@ -2063,8 +2331,8 @@
 	c801  PCI-GPIB
 	c831  PCI-GPIB bridge
 1094  First International Computers [FIC]
-1095  CMD Technology Inc
-	0240  Adaptec AAR-1210SA SATA HostRAID Controller
+1095  Silicon Image, Inc. (formerly CMD Technology Inc)
+	0240  Adaptec AAR-1210SA SATA HostRAID
 	0640  PCI0640
 	0643  PCI0643
 	0646  PCI0646
@@ -2078,8 +2346,12 @@
 	0670  USB0670
 		1095 0670  USB0670
 	0673  USB0673
-	0680  PCI0680
-	3112  Silicon Image SiI 3112 SATARaid Controller
+	0680  PCI0680 Ultra ATA-133 Host Controller
+		1095 3680  Winic W-680 (Silicon Image 680 based)
+	3112  Silicon Image Serial ATARaid Controller [ CMD/Sil 3112/3112A ]
+		1095 6112  Asus A7N8X
+	3114  Silicon Image SiI 3114 SATARaid
+	3512  Silicon Image Serial ATARaid Controller [ CMD/Sil 3512 ]
 1096  Alacron
 1097  Appian Technology
 1098  Quantum Designs (H.K.) Ltd
@@ -2109,11 +2381,13 @@
 		127a 0003  Bt878a Mediastream Controller PAL BG
 		127a 0048  Bt878/832 Mediastream Controller
 		144f 3000  MagicTView CPH060 - Video
+		1461 0002  TV98 Series (TV/No FM/Remote)
 		1461 0004  AVerTV WDM Video Capture
 		14f1 0001  Bt878 Mediastream Controller NTSC
 		14f1 0002  Bt878 Mediastream Controller PAL BG
 		14f1 0003  Bt878a Mediastream Controller PAL BG
 		14f1 0048  Bt878/832 Mediastream Controller
+		1822 0001  VisionPlus DVB card
 		1851 1850  FlyVideo'98 - Video
 		1851 1851  FlyVideo II
 		1852 1852  FlyVideo'98 - Video (with FM Tuner)
@@ -2170,6 +2444,7 @@
 		14f1 0002  Bt878 Video Capture (Audio Section)
 		14f1 0003  Bt878 Video Capture (Audio Section)
 		14f1 0048  Bt878 Video Capture (Audio Section)
+		1822 0001  VisionPlus DVB Card
 		bd11 1200  PCTV pro (TV + FM stereo receiver, audio section)
 	0879  Bt879 Audio Capture
 		127a 0044  Bt879 Video Capture (Audio Section)
@@ -2228,8 +2503,8 @@
 	0006  HPCEX
 	0007  RPCEX
 	0008  DiVO VIP
-	0009  Alteon Gigabit Ethernet
-		10a9 8002  Acenic Gigabit Ethernet
+	0009  AceNIC Gigabit Ethernet
+		10a9 8002  AceNIC Gigabit Ethernet
 	0010  AMP Video I/O
 	0011  GRIP
 	0012  SGH PSHAC GSN
@@ -2278,12 +2553,18 @@
 	1147  VScom 020 2 port parallel adaptor
 	2724  Thales PCSM Security Card
 	9030  PCI <-> IOBus Bridge Hot Swap
+		10b5 2862  Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board
+		10b5 2906  Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board
+		10b5 2940  Alpermann+Velte PCL PCI D (3V/5V): Timecode Reader Board
 		15ed 1002  MCCS 8-port Serial Hot Swap
 		15ed 1003  MCCS 16-port Serial Hot Swap
 	9036  9036
 	9050  PCI <-> IOBus Bridge
 		10b5 2036  SatPak GPS
+		10b5 2221  Alpermann+Velte PCL PCI LV: Timecode Reader Board
 		10b5 2273  SH-ARC SoHard ARCnet card
+		10b5 2431  Alpermann+Velte PCL PCI D: Timecode Reader Board
+		10b5 2905  Alpermann+Velte PCI TS: Time Synchronisation Board
 		10b5 9050  MP9050
 		1522 0001  RockForce 4 Port V.90 Data/Fax/Voice Modem
 		1522 0002  RockForce 2 Port V.90 Data/Fax/Voice Modem
@@ -2295,6 +2576,10 @@
 		15ed 1001  Macrolink MCCS 16-port Serial
 		15ed 1002  Macrolink MCCS 8-port Serial Hot Swap
 		15ed 1003  Macrolink MCCS 16-port Serial Hot Swap
+# Sorry, there was a typo
+		5654 2036  OpenSwitch 6 Telephony card
+# Sorry, there was a typo
+		5654 3132  OpenSwitch 12 Telephony card
 		5654 5634  OpenLine4 Telephony Card
 		d531 c002  PCIntelliCAN 2xSJA1000 CAN bus
 		d84d 4006  EX-4006 1P
@@ -2317,7 +2602,17 @@
 	9054  PCI <-> IOBus Bridge
 		10b5 2455  Wessex Techology PHIL-PCI
 		10b5 2696  Innes Corp AM Radcap card
+		10b5 2717  Innes Corp Auricon card
+		10b5 2844  Innes Corp TVS Encoder card
 		12d9 0002  PCI Prosody Card rev 1.5
+		16df 0011  PIKA PrimeNet MM PCI
+		16df 0012  PIKA PrimeNet MM cPCI 8
+		16df 0013  PIKA PrimeNet MM cPCI 8 (without CAS Signaling Option)
+		16df 0014  PIKA PrimeNet MM cPCI 4
+		16df 0015  PIKA Daytona MM
+		16df 0016  PIKA InLine MM
+	9056  Francois
+		10b5 2979  CellinkBlade 11 - CPCI board VoATM AAL1
 	9060  9060
 	906d  9060SD
 		125c 0640  Aries 16000P
@@ -2326,6 +2621,7 @@
 		10b5 9080  9080 [real subsystem ID not set]
 		129d 0002  Aculab PCI Prosidy card
 		12d9 0002  PCI Prosody Card
+		12df 4422  4422PCI ["Do-All" Telemetry Data Aquisition System]
 	bb04  B&B 3PCIOSD1A Isolated PCI Serial
 10b6  Madge Networks
 	0001  Smart 16/4 PCI Ringnode
@@ -2358,17 +2654,22 @@
 	1006  MINI PCI type 3B Data Fax Modem
 	1007  Mini PCI 56k Winmodem
 		10b7 615c  Mini PCI 56K Modem
-	1700  3c940 1000Base?
+	1201  3c982-TXM 10/100baseTX Dual Port A [Hydra]
+	1202  3c982-TXM 10/100baseTX Dual Port B [Hydra]
+	1700  3c940 10/100/1000Base-T [Marvell]
+		1043 80eb  P4P800 Mainboard
+		10b7 0010  3C940 Gigabit LOM Ethernet Adapter
+		10b7 0020  3C941 Gigabit LOM Ethernet Adapter
 	3390  3c339 TokenLink Velocity
 	3590  3c359 TokenLink Velocity XL
 		10b7 3590  TokenLink Velocity XL Adapter (3C359/359B)
-	4500  3c450 Cyclone/unknown
+	4500  3c450 HomePNA [Tornado]
 	5055  3c555 Laptop Hurricane
-	5057  3c575 [Megahertz] 10/100 LAN CardBus
+	5057  3c575 Megahertz 10/100 LAN CardBus [Boomerang]
 		10b7 5a57  3C575 Megahertz 10/100 LAN Cardbus PC Card
-	5157  3c575 [Megahertz] 10/100 LAN CardBus
+	5157  3cCFE575BT Megahertz 10/100 LAN CardBus [Cyclone]
 		10b7 5b57  3C575 Megahertz 10/100 LAN Cardbus PC Card
-	5257  3CCFE575CT Cyclone CardBus
+	5257  3cCFE575CT CardBus [Cyclone]
 		10b7 5c57  FE575C-3Com 10/100 LAN CardBus-Fast Ethernet
 	5900  3c590 10BaseT [Vortex]
 	5920  3c592 EISA 10mbps Demon/Vortex
@@ -2376,20 +2677,22 @@
 	5951  3c595 100BaseT4 [Vortex]
 	5952  3c595 100Base-MII [Vortex]
 	5970  3c597 EISA Fast Demon/Vortex
-	5b57  3c595 [Megahertz] 10/100 LAN CardBus
+	5b57  3c595 Megahertz 10/100 LAN CardBus [Boomerang]
 		10b7 5b57  3C575 Megahertz 10/100 LAN Cardbus PC Card
-	6055  3c556 Hurricane CardBus
-	6056  3c556B Hurricane CardBus
+	6000  3CRSHPW796 [OfficeConnect Wireless CardBus]
+	6001  3com 3CRWE154G72 [Office Connect Wireless LAN Adapter]
+	6055  3c556 Hurricane CardBus [Cyclone]
+	6056  3c556B CardBus [Tornado]
 		10b7 6556  10/100 Mini PCI Ethernet Adapter
-	6560  3CCFE656 Cyclone CardBus
+	6560  3cCFE656 CardBus [Cyclone]
 		10b7 656a  3CCFEM656 10/100 LAN+56K Modem CardBus
-	6561  3CCFEM656 10/100 LAN+56K Modem CardBus
+	6561  3cCFEM656 10/100 LAN+56K Modem CardBus
 		10b7 656b  3CCFEM656 10/100 LAN+56K Modem CardBus
-	6562  3CCFEM656 [id 6562] Cyclone CardBus
+	6562  3cCFEM656B 10/100 LAN+Winmodem CardBus [Cyclone]
 		10b7 656b  3CCFEM656B 10/100 LAN+56K Modem CardBus
-	6563  3CCFEM656B 10/100 LAN+56K Modem CardBus
+	6563  3cCFEM656B 10/100 LAN+56K Modem CardBus
 		10b7 656b  3CCFEM656 10/100 LAN+56K Modem CardBus
-	6564  3CCFEM656 [id 6564] Cyclone CardBus
+	6564  3cXFEM656C 10/100 LAN+Winmodem CardBus [Tornado]
 	7646  3cSOHO100-TX Hurricane
 	7770  3CRWE777 PCI(PLX) Wireless Adaptor [Airconnect]
 	7940  3c803 FDDILink UTP Controller
@@ -2397,13 +2700,13 @@
 	7990  3c805 FDDILink DAS Controller
 	8811  Token ring
 	9000  3c900 10BaseT [Boomerang]
-	9001  3c900 Combo [Boomerang]
-	9004  3c900B-TPO [Etherlink XL TPO]
+	9001  3c900 10Mbps Combo [Boomerang]
+	9004  3c900B-TPO Etherlink XL [Cyclone]
 		10b7 9004  3C900B-TPO Etherlink XL TPO 10Mb
-	9005  3c900B-Combo [Etherlink XL Combo]
+	9005  3c900B-Combo Etherlink XL [Cyclone]
 		10b7 9005  3C900B-Combo Etherlink XL Combo
-	9006  3c900B-TPC [Etherlink XL TPC]
-	900a  3c900B-FL [Etherlink XL FL]
+	9006  3c900B-TPC Etherlink XL [Cyclone]
+	900a  3c900B-FL 10base-FL [Cyclone]
 	9050  3c905 100BaseTX [Boomerang]
 	9051  3c905 100BaseT4 [Boomerang]
 	9055  3c905B 100BaseTX [Cyclone]
@@ -2428,21 +2731,23 @@
 		1028 0098  3C905B Fast Etherlink XL 10/100
 		1028 0099  3C905B Fast Etherlink XL 10/100
 		10b7 9055  3C905B Fast Etherlink XL 10/100
-	9056  3c905B-T4 [Fast EtherLink XL 10/100]
-	9058  3c905B-Combo [Deluxe Etherlink XL 10/100]
-	905a  3c905B-FX [Fast Etherlink XL FX 10/100]
+	9056  3c905B-T4 Fast EtherLink XL [Cyclone]
+	9058  3c905B Deluxe Etherlink 10/100/BNC [Cyclone]
+	905a  3c905B-FX Fast Etherlink XL FX 100baseFx [Cyclone]
 	9200  3c905C-TX/TX-M [Tornado]
 		1028 0095  3C920 Integrated Fast Ethernet Controller
 		1028 0097  3C920 Integrated Fast Ethernet Controller
+		1028 012a  3C920 Integrated Fast Ethernet Controller [Latitude C640]
 		10b7 1000  3C905C-TX Fast Etherlink for PC Management NIC
 		10b7 7000  10/100 Mini PCI Ethernet Adapter
-	9201  3C920B-EMB Integrated Fast Ethernet Controller
-	9300  3CSOHO100B-TX  [910-A01]
-	9800  3c980-TX [Fast Etherlink XL Server Adapter]
+		10f1 2466  Tiger MPX S2466 (3C920 Integrated Fast Ethernet Controller)
+	9201  3C920B-EMB Integrated Fast Ethernet Controller [Tornado]
+	9202  3Com 3C920B-EMB-WNM Integrated Fast Ethernet Controller
+	9210  3C920B-EMB-WNM Integrated Fast Ethernet Controller
+	9300  3CSOHO100B-TX 910-A01 [tulip]
+	9800  3c980-TX Fast Etherlink XL Server Adapter [Cyclone]
 		10b7 9800  3c980-TX Fast Etherlink XL Server Adapter
-	9805  3c980-TX 10/100baseTX NIC [Python-T]
-		10b7 1201  3c982-TXM 10/100baseTX Dual Port A [Hydra]
-		10b7 1202  3c982-TXM 10/100baseTX Dual Port B [Hydra]
+	9805  3c980-C 10/100baseTX NIC [Python-T]
 		10b7 9805  3c980 10/100baseTX NIC [Python-T]
 		10f1 2462  Thunder K7 S2462
 	9900  3C990-TX [Typhoon]
@@ -2458,9 +2763,10 @@
 		10b7 2102  3CR990-FX-97 Server [Typhoon Fiber 168-bit]
 	9908  3CR990SVR95 [Typhoon Server 56-bit]
 	9909  3CR990SVR97 [Typhoon Server 168-bit]
+	990a  3C990SVR [Typhoon Server]
 	990b  3C990SVR [Typhoon Server]
 10b8  Standard Microsystems Corp [SMC]
-	0005  83C170QF
+	0005  83c170 EPIC/100 Fast Ethernet Adapter
 		1055 e000  LANEPIC 10/100 [EVB171Q-PCI]
 		1055 e002  LANEPIC 10/100 [EVB171G-PCI]
 		10b8 a011  EtherPower II 10/100
@@ -2468,7 +2774,7 @@
 		10b8 a015  EtherPower II 10/100
 		10b8 a016  EtherPower II 10/100
 		10b8 a017  EtherPower II 10/100
-	0006  LANEPIC
+	0006  83c175 EPIC/100 Fast Ethernet Adapter
 		1055 e100  LANEPIC Cardbus Fast Ethernet Adapter
 		1055 e102  LANEPIC Cardbus Fast Ethernet Adapter
 		1055 e300  LANEPIC Cardbus Fast Ethernet Adapter
@@ -2478,6 +2784,8 @@
 		13a2 8006  LANEPIC Cardbus Fast Ethernet Adapter
 	1000  FDC 37c665
 	1001  FDC 37C922
+# 802.11g card
+	2802  SMC2802W [EZ Connect g]
 	a011  83C170QF
 	b106  SMC34C90
 10b9  ALi Corporation
@@ -2522,6 +2830,7 @@
 	3151  M3151
 	3307  M3307
 	3309  M3309
+	3323  M3325 Video/Audio Decoder
 	5212  M4803
 	5215  MS4803
 	5217  M5217H
@@ -2543,7 +2852,7 @@
 		1014 0506  ThinkPad R30
 	5453  M5453 PCI AC-Link Controller Modem Device
 	5455  M5455 PCI AC-Link Controller Audio Device
-	5457  Intel 537 [M5457 AC-Link Modem]
+	5457  M5457 AC'97 Modem Controller
 # Same but more usefull for driver's lookup
 	5459  SmartLink SmartPCI561 56K Modem
 # SmartLink PCI SoftModem
@@ -2554,6 +2863,9 @@
 		10b9 7101  ALI M7101 Power Management Controller
 10ba  Mitsubishi Electric Corp.
 	0301  AccelGraphics AccelECLIPSE
+	0304  AccelGALAXY A2100 [OEM Evans & Sutherland]
+	0308  Tornado 3000 [OEM Evans & Sutherland]
+	1002  VG500 [VolumePro Volume Rendering Accelerator]
 10bb  Dapha Electronics Corporation
 10bc  Advanced Logic Research
 10bd  Surecom Technology
@@ -2594,6 +2906,7 @@
 		10f7 8312  MagicGraph 128XD
 	0005  NM2200 [MagicGraph 256AV]
 		1014 00dd  ThinkPad 570
+		1028 0088  Latitude CPi A400XT
 	0006  NM2360 [MagicMedia 256ZX]
 	0016  NM2380 [MagicMedia 256XL+]
 		10c8 0016  MagicMedia 256XL+
@@ -2725,7 +3038,7 @@
 		1102 1024  CT6932 RIVA TNT2 Value 32Mb
 		1102 102c  CT6931 RIVA TNT2 Value [Jumper]
 		1462 8808  MSI-8808
-		1554 1041  PixelView RIVA TNT2 M64 32MB
+		1554 1041  Pixelview RIVA TNT2 M64
 	002e  NV6 [Vanta]
 	002f  NV6 [Vanta]
 	0060  nForce2 ISA Bridge
@@ -2781,9 +3094,11 @@
 	0150  NV15 [GeForce2 GTS/Pro]
 		1043 4016  V7700 AGP Video Card
 		107d 2840  WinFast GeForce2 GTS with TV output
+		107d 2842  WinFast GeForce 2 Pro
 		1462 8831  Creative GeForce2 Pro
 	0151  NV15DDR [GeForce2 Ti]
 		1043 405f  V7700Ti
+		1462 5506  Creative 3D Blaster Geforce2 Titanium
 	0152  NV15BR [GeForce2 Ultra, Bladerunner]
 		1048 0c56  GLADIAC Ultra
 	0153  NV15GL [Quadro2 Pro]
@@ -2798,16 +3113,23 @@
 	0174  NV17 [GeForce4 440 Go]
 	0175  NV17 [GeForce4 420 Go]
 	0176  NV17 [GeForce4 420 Go 32M]
+		4c53 1090  Cx9 / Vx9 mainboard
+	0177  NV17 [GeForce4 460 Go]
 	0178  NV17GL [Quadro4 550 XGL]
 	0179  NV17 [GeForce4 440 Go 64M]
+		10de 0179  GeForce4 MX (Mac)
 	017a  NV17GL [Quadro4 200/400 NVS]
 	017b  NV17GL [Quadro4 550 XGL]
 	017c  NV17GL [Quadro4 550 GoGL]
 	0181  NV18 [GeForce4 MX 440 AGP 8x]
 		1043 806f  V9180 Magic
 		1462 8880  MS-StarForce GeForce4 MX 440 with AGP8X
+		1462 8900  MS-8890 GeForce 4 MX440 AGP8X
+		1462 9350  MSI Geforce4 MX T8X with AGP8X
+		147b 8f0d  Siluro GF4 MX-8X
 	0182  NV18 [GeForce4 MX 440SE AGP 8x]
 	0183  NV18 [GeForce4 MX 420 AGP 8x]
+	0185  NV18 [GeForce4 MX 4000 AGP 8x]
 	0188  NV18GL [Quadro4 580 XGL]
 	018a  NV18GL [Quadro4 NVS AGP 8x]
 	018b  NV18GL [Quadro4 380 XGL]
@@ -2822,7 +3144,7 @@
 	01b7  nForce AGP to PCI Bridge
 	01b8  nForce PCI-to-PCI bridge
 	01bc  nForce IDE
-	01c1  Intel 537 [nForce MC97 Modem]
+	01c1  nForce AC'97 Modem Controller
 	01c2  nForce USB Controller
 	01c3  nForce Ethernet Controller
 	01e0  nForce2 AGP (different version?)
@@ -2863,21 +3185,42 @@
 	0309  NV30GL [Quadro FX 1000]
 	0311  NV31 [GeForce FX 5600 Ultra]
 	0312  NV31 [GeForce FX 5600]
+	0314  NV31 [GeForce FX 5600XT]
+	031a  NV31M [GeForce FX Go 5600]
+	031c  NVIDIA Quadro FX 700 Go
 	0321  NV34 [GeForce FX 5200 Ultra]
 	0322  NV34 [GeForce FX 5200]
+		1462 9171  MS-8917 (FX5200-T128)
+	0324  NV34M [GeForce FX Go 5200]
+		1071 8160  MIM2000
+	0328  NV34M [GeForce FX Go 5200]
+	0329  NV34M [GeForce FX Go5200]
 	032b  NV34GL [Quadro FX 500]
+	032c  NV34GLM [GeForce FX Go 5300]
 	0330  NV35 [GeForce FX 5900 Ultra]
 	0331  NV35 [GeForce FX 5900]
+	0332  NV35 [GeForce FX 5900XT]
+	0333  NV38 [GeForce FX 5950 Ultra]
 	0338  NV35GL [Quadro FX 3000]
+	0341  NV 36 [GeForce 5700 Ultra]
+	0342  NV 36 [GeForce 5700]
 10df  Emulex Corporation
 	1ae5  LP6000 Fibre Channel Host Adapter
+	1ae6  LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)
+	1ae7  LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:2-3)
 	f085  LP850 Fibre Channel Adapter
 	f095  LP952 Fibre Channel Adapter
 	f098  LP982 Fibre Channel Adapter
 	f700  LP7000 Fibre Channel Host Adapter
+	f701  LP 7000EFibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)
 	f800  LP8000 Fibre Channel Host Adapter
+	f801  LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)
 	f900  LP9000 Fibre Channel Host Adapter
+	f901  LP 9000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)
 	f980  LP9802 Fibre Channel Adapter
+	f981  LP 9802 Fibre Channel Host Adapter Alternate ID
+	f982  LP 9802 Fibre Channel Host Adapter Alternate ID
+	fa00  LP10000 Fibre Channel Host Adapter
 10e0  Integrated Micro Solutions Inc.
 	5026  IMS5026/27/28
 	5027  IMS5027
@@ -2900,6 +3243,7 @@
 10e6  Gainbery Computer Products Inc.
 10e7  Vadem
 10e8  Applied Micro Circuits Corp.
+	1072  INES GPIB-PCI (AMCC5920 based)
 	2011  Q-Motion Video Capture/Edit board
 	4750  S5930 [Matchmaker]
 	5920  S5920
@@ -2926,6 +3270,8 @@
 	5000  CyberPro 5000
 	5050  CyberPro 5050
 	5202  CyberPro 5202
+# CyberPro5202 Audio Function
+	5252  CyberPro5252
 10eb  Artists Graphics
 	0101  3GA
 	8111  Twist3 Frame Grabber
@@ -2943,6 +3289,7 @@
 	8139  RTL-8139/8139C/8139C+
 		1025 8920  ALN-325
 		1025 8921  ALN-325
+		1071 8160  MIM2000
 		10bd 0320  EP-320X-R
 		10ec 8139  RT8139
 		1186 1300  DFE-538TX
@@ -2954,17 +3301,20 @@
 		1429 d010  ND010
 		1432 9130  EN-9130TX
 		1436 8139  RT8139
+		1458 e000  GA-7VM400M Motherboard
 		146c 1439  FE-1439TX
 		1489 6001  GF100TXRII
 		1489 6002  GF100TXRA
 		149c 139a  LFE-8139ATX
 		149c 8139  LFE-8139TX
+		1799 5000  F5D5000 PCI Card/Desktop Network PCI Card
 		2646 0001  EtheRx
 		8e2e 7000  KF-230TX
 		8e2e 7100  KF-230TX/2
 		a0a0 0007  ALN-325C
-	8169  RTL-8169
+	8169  RTL-8169 Gigabit Ethernet
 		1371 434e  ProG-2000L
+	8180  RTL8180L 802.11b MAC
 	8197  SmartLAN56 56K Modem
 10ed  Ascii Corporation
 	7310  V7310
@@ -2975,6 +3325,7 @@
 	3fc3  RME Digi96/8 Pad
 	3fc4  RME Digi9652 (Hammerfall)
 	3fc5  RME Hammerfall DSP
+	3fc6  RME Hammerfall DSP MADI
 	8381  Ellips Santos Frame Grabber
 10ef  Racore Computer Products, Inc.
 	8154  M815x Token Ring Adapter
@@ -2991,7 +3342,7 @@
 10f9  PC Direct
 10fa  Truevision
 	000c  TARGA 1000
-10fb  Thesys Gesellschaft für Mikroelektronik mbH
+10fb  Thesys Gesellschaft für Mikroelektronik mbH
 	186f  TH 6255
 10fc  I-O Data Device, Inc.
 # What's in the cardbus end of a Sony ACR-A01 card, comes with newer Vaio CD-RW drives
@@ -3029,7 +3380,10 @@
 	0004  SB Audigy
 		1102 0051  SB0090 Audigy Player
 		1102 0053  SB0090 Audigy Player/OEM
+		1102 0058  SB0090 Audigy Player/OEM
+		1102 2002  SB Audigy 2 ZS (SB0350)
 	0006  [SB Live! Value] EMU10k1X
+	0007  SB Audigy LS
 	4001  SB Audigy FireWire Port
 		1102 0010  SB Audigy FireWire Port
 	7002  SB Live! MIDI/Game Port
@@ -3037,6 +3391,7 @@
 	7003  SB Audigy MIDI/Game port
 		1102 0040  SB Audigy MIDI/Game Port
 	7004  [SB Live! Value] Input device controller
+	7005  SB Audigy LS MIDI/Game port
 	8064  SB0100 [SBLive! 5.1 OEM]
 	8938  Ectiva EV1938
 1103  Triones Technologies, Inc.
@@ -3055,6 +3410,13 @@
 	1105  REALmagic Xcard MPEG 1/2/3/4 DVD Decoder
 	8300  REALmagic Hollywood Plus DVD Decoder
 	8400  EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder
+	8401  EM8401 REALmagic DVD/MPEG-2 A/V Decoder
+	8470  EM8470 REALmagic DVD/MPEG-4 A/V Decoder
+	8471  EM8471 REALmagic DVD/MPEG-4 A/V Decoder
+	8475  EM8475 REALmagic DVD/MPEG-4 A/V Decoder
+	8476  EM8476 REALmagic DVD/MPEG-4 A/V Decoder
+	8485  EM8485 REALmagic DVD/MPEG-4 A/V Decoder
+	8486  EM8486 REALmagic DVD/MPEG-4 A/V Decoder
 1106  VIA Technologies, Inc.
 	0102  Embedded VIA Ethernet Controller
 	0130  VT6305 1394.A Controller
@@ -3068,10 +3430,13 @@
 	0505  VT82C505
 # Shares chip with :0576. The VT82C576M has :1571 instead of :0561.
 	0561  VT82C576MV
-	0571  VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
+	0571  VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE
 		1019 0985  P6VXA Motherboard
+		1019 0a81  L7VTA v1.0 Motherboard (KT400-8235)
 		1043 8052  VT8233A Bus Master ATA100/66/33 IDE
 		1043 808c  A7V8X motherboard
+		1043 80a1  A7V8X-X motherboard rev. 1.01
+		1043 80ed  A7V600 motherboard
 		1106 0571  VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
 		1179 0001  Magnia Z310
 		1297 f641  FX41 motherboard
@@ -3112,10 +3477,14 @@
 	1106  VT82C570MV
 	1571  VT82C576M/VT82C586
 	1595  VT82C595/97 [Apollo VP2/97]
-	3038  USB
+# This is *not* USB 2.0 as the existing entry suggests
+	3038  VT82xxxxx UHCI USB 1.1 Controller
 		0925 1234  USB Controller
 		1019 0985  P6VXA Motherboard
-		1043 808c  A7V8X motherboard
+		1019 0a81  L7VTA v1.0 Motherboard (KT400-8235)
+		1043 808c  VT6202 USB2.0 4 port controller
+		1043 80a1  A7V8X-X motherboard
+		1043 80ed  A7V600 motherboard
 		1179 0001  Magnia Z310
 		1458 5004  GA-7VAX Mainboard
 	3040  VT82C586B ACPI
@@ -3126,6 +3495,7 @@
 	3044  IEEE 1394 Host Controller
 	3050  VT82C596 Power Management
 	3051  VT82C596 Power Management
+	3053  VT6105M [Rhine-III]
 	3057  VT82C686 [Apollo Super ACPI]
 		1019 0985  P6VXA Motherboard
 		1043 8033  A7V Mainboard
@@ -3134,17 +3504,23 @@
 		1043 8042  A7V133/A7V133-C Mainboard
 		1179 0001  Magnia Z310
 	3058  VT82C686 AC97 Audio Controller
+		0e11 0097  SoundMax Digital Integrated Audio
 		0e11 b194  Soundmax integrated digital audio
 		1019 0985  P6VXA Motherboard
 		1106 4511  Onboard Audio on EP7KXA
 		1458 7600  Onboard Audio
 		1462 3091  MS-6309 Onboard Audio
 		15dd 7609  Onboard Audio
-	3059  VT8233/A/8235 AC97 Audio Controller
+	3059  VT8233/A/8235/8237 AC97 Audio Controller
+		1019 0a81  L7VTA v1.0 Motherboard (KT400-8235)
 		1043 8095  A7V8X Motherboard (Realtek ALC650 codec)
+		1043 80b0  A7V600 motherboard (ADI AD1980 codec [SoundMAX])
+		1106 3059  L7VMM2 Motherboard
 		1297 c160  FX41 motherboard (Realtek ALC650 codec)
 		1458 a002  GA-7VAX Onboard Audio (Realtek ALC650)
+		1462 3800  KT266 onboard audio
 	3065  VT6102 [Rhine-II]
+		1043 80a1  A7V8X-X Motherboard
 		1106 0102  VT6102 [Rhine II] Embeded Ethernet Controller on VT8235
 		1186 1400  DFE-530TX rev A
 		1186 1401  DFE-530TX rev B
@@ -3160,10 +3536,14 @@
 	3102  VT8662 Host Bridge
 	3103  VT8615 Host Bridge
 	3104  USB 2.0
+		1019 0a81  L7VTA v1.0 Motherboard (KT400-8235)
 		1043 808c  A7V8X motherboard
+		1043 80a1  A7V8X-X motherboard rev 1.01
+		1043 80ed  A7V600 motherboard
 		1297 f641  FX41 motherboard
 		1458 5004  GA-7VAX Mainboard
 	3106  VT6105 [Rhine-III]
+		1186 1403  DFE-530TX rev C
 	3109  VT8233C PCI to ISA Bridge
 	3112  VT8361 [KLE133] Host Bridge
 	3116  VT8375 [KM266/KL266] Host Bridge
@@ -3176,17 +3556,33 @@
 	3133  VT3133 Host Bridge
 	3147  VT8233A ISA Bridge
 	3148  P4M266 Host Bridge
+	3149  VIA VT6420 SATA RAID Controller
+		1043 80ed  A7V600 motherboard
+		1462 7020  MSI Neo K8T FIS2R mainboard
 	3156  P/KN266 Host Bridge
+# on ASUS P4P800
+	3164  VT6410 ATA133 RAID controller
 	3168  VT8374 P4X400 Host Controller/AGP Bridge
 	3177  VT8235 ISA Bridge
+		1019 0a81  L7VTA v1.0 Motherboard (KT400-8235)
 		1043 808c  A7V8X motherboard
+		1043 80a1  A7V8X-X motherboard
 		1297 f641  FX41 motherboard
 		1458 5001  GA-7VAX Mainboard
-	3189  VT8377 [KT400 AGP] Host Bridge
+	3188  VT8385 [K8T800 AGP] Host Bridge
+	3189  VT8377 [KT400/KT600 AGP] Host Bridge
 		1043 807f  A7V8X motherboard
 		1458 5000  GA-7VAX Mainboard
+# Updated the entry to the proper "chip [name] desc" format
+	3205  VT8378 [KM400] Chipset Host Bridge
+		1458 5000  GA-7VM400M Motherboard
+	3227  VT8237 ISA bridge [K8T800 South]
+		1043 80ed  A7V600 motherboard
 	5030  VT82C596 ACPI [Apollo PRO]
 	6100  VT85C100A [Rhine II]
+# S3 Graphics UniChrome™ 2D/3D Graphics with motion compensation
+	7205  VT8378 [S3 UniChrome] Integrated Video
+		1458 d000  GA-7VM400M Motherboard
 	8231  VT8231 [PCI-to-ISA Bridge]
 	8235  VT8235 ACPI
 	8305  VT8363/8365 [KT133/KM133 AGP]
@@ -3207,7 +3603,10 @@
 	b103  VT8615 AGP Bridge
 	b112  VT8361 [KLE133] AGP Bridge
 	b168  VT8235 PCI Bridge
+	b188  VT8237 PCI bridge [K8T800 South]
 	b198  VT8237 PCI Bridge
+# 32-Bit PCI bus master Ethernet MAC with standard MII interface
+	d104  VT8237 Integrated Fast Ethernet Controller
 1107  Stratus Computers
 	0576  VIA VT82C570MV [Apollo] (Wrong vendor ID!)
 1108  Proteon, Inc.
@@ -3231,6 +3630,7 @@
 	007c  FSC Remote Service Controller, shared memory device
 	007d  FSC Remote Service Controller, SMIC device
 	2102  DSCC4 WAN adapter
+	2104  Eicon Diva 2.02 compatible passive ISDN card
 	4021  SIMATIC NET CP 5512 (Profibus and MPI Cardbus Adapter)
 	4942  FPGA I-Bus Tracer for MBD
 	6120  SZB6120
@@ -3256,13 +3656,15 @@
 		103c 1207  EN-1207D Fast Ethernet Adapter
 		1113 1211  EN-1207D Fast Ethernet Adapter
 	1216  EN-1216 Ethernet Adapter
+		1113 2242  EN2242 10/100 Ethernet Mini-PCI Card
 		111a 1020  SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?]
 	1217  EN-1217 Ethernet Adapter
 	5105  10Mbps Network card
 	9211  EN-1207D Fast Ethernet Adapter
 		1113 9211  EN-1207D Fast Ethernet Adapter
-	9511  Fast Ethernet Adapter
+	9511  21x4x DEC-Tulip compatible Fast Ethernet
 1114  Atmel Corporation
+	0506  802.11b Wireless Network Adaptor (at76c506)
 1115  3D Labs
 1116  Data Translation
 	0022  DT3001
@@ -3283,14 +3685,18 @@
 	0003  GDT 6120/6520
 	0004  GDT 6530
 	0005  GDT 6550
-	0006  GDT 6x17
-	0007  GDT 6x27
+	0006  GDT 6117/6517
+	0007  GDT 6127/6527
 	0008  GDT 6537
-	0009  GDT 6557
+	0009  GDT 6557/6557-ECC
 	000a  GDT 6115/6515
 	000b  GDT 6125/6525
 	000c  GDT 6535
 	000d  GDT 6555
+	0010  GDT 6115/6515
+	0011  GDT 6125/6525
+	0012  GDT 6535
+	0013  GDT 6555/6555-ECC
 	0100  GDT 6117RP/6517RP
 	0101  GDT 6127RP/6527RP
 	0102  GDT 6537RP
@@ -3345,7 +3751,8 @@
 	0211  GDT 6529RD/6629RD
 	0260  GDT 7519RN/7619RN
 	0261  GDT 7529RN/7629RN
-	0300  GDT Raid Controller
+	02ff  GDT MAXRP
+	0300  GDT NEWRX
 111a  Efficient Networks, Inc
 	0000  155P-MF1 (FPGA)
 	0002  155P-MF1 (ASIC)
@@ -3361,6 +3768,7 @@
 		111a 0a09  ENI-3060 ADSL (VPI=<0..15>)
 	0007  SpeedStream ADSL
 		111a 1001  ENI-3061 ADSL [ASIC]
+	1203  SpeedStream 1023 Wireless PCI Adapter
 111b  Teledyne Electronic Systems
 111c  Tricord Systems Inc.
 	0001  Powerbis Bridge
@@ -3409,11 +3817,32 @@
 	7135  SAA7135 Audio+video broadcast decoder
 	7145  SAA7145
 	7146  SAA7146
+		110a 0000  Fujitsu/Siemens DVB-C card rev1.5
+		110a ffff  Fujitsu/Siemens DVB-C card rev1.5
+		1131 4f56  KNC1 DVB-S Budget
+		1131 4f61  Fujitsu-Siemens Activy DVB-S Budget
 		114b 2003  DVRaptor Video Edit/Capture Card
 		11bd 0006  DV500 Overlay
 		11bd 000a  DV500 Overlay
+		13c2 0000  Siemens/Technotrend/Hauppauge DVB card rev1.3
+		13c2 0001  Technotrend/Hauppauge DVB card rev1.3 or rev1.6
+		13c2 0002  Technotrend/Hauppauge DVB card rev2.1
+		13c2 0003  Technotrend/Hauppauge DVB card rev2.1
+		13c2 0004  Technotrend/Hauppauge DVB card rev2.1
+		13c2 0006  Technotrend/Hauppauge DVB card rev1.3 or rev1.6
+		13c2 0008  Technotrend/Hauppauge DVB-T
+		13c2 000a  Octal/Technotrend DVB-C for iTV
+		13c2 1003  Technotrend-Budget / Hauppauge WinTV-NOVA-S DVB card
+		13c2 1004  Technotrend-Budget / Hauppauge WinTV-NOVA-C DVB card
+		13c2 1005  Technotrend-Budget / Hauppauge WinTV-NOVA-T DVB card
+		13c2 100c  Technotrend-Budget / Hauppauge WinTV-NOVA-CI DVB card
+		13c2 100f  Technotrend-Budget / Hauppauge WinTV-NOVA-CI DVB card
+		13c2 1011  Technotrend-Budget / Hauppauge WinTV-NOVA-T DVB card
+		13c2 1013  SATELCO Multimedia DVB
+		13c2 1102  Technotrend/Hauppauge DVB card rev2.1
 1132  Mitel Corp.
-1133  Eicon Technology Corporation
+# This is the new official company name. See disclaimer on www.eicon.com for details!
+1133  Eicon Networks Corporation
 	7901  EiconCard S90
 	7902  EiconCard S90
 	7911  EiconCard S91
@@ -3478,6 +3907,8 @@
 		1133 1c0c  Diva Server V-PRI/E1-30 Cornet NQ 3
 	e01e  Diva Server 2PRI
 	e020  Diva Server 4PRI
+	e024  Diva Server Analog-4P
+	e028  Diva Server Analog-8P
 1134  Mercury Computer Systems
 	0001  Raceway Bridge
 1135  Fuji Xerox Co Ltd
@@ -3545,24 +3976,37 @@
 		1148 5843  FDDI SK-5843 (SK-NET FDDI-LP64)
 		1148 5844  FDDI SK-5844 (SK-NET FDDI-LP64 DAS)
 	4200  Token Ring adapter
-	4300  Gigabit Ethernet
-		1148 9821  SK-9821 (1000Base-T single link)
-		1148 9822  SK-9822 (1000Base-T dual link)
-		1148 9841  SK-9841 (1000Base-LX single link)
-		1148 9842  SK-9842 (1000Base-LX dual link)
-		1148 9843  SK-9843 (1000Base-SX single link)
-		1148 9844  SK-9844 (1000Base-SX dual link)
-		1148 9861  SK-9861 (1000Base-SX VF45 single link)
-		1148 9862  SK-9862 (1000Base-SX VF45 dual link)
-# Information got from SysKonnekt
-		1148 9871  SK-9871 (1000Base-ZX single link)
-# Information got from SysKonnekt
-		1148 9872  SK-9872 (1000Base-ZX dual link)
-		1259 2970  AT-2970SX [Allied Telesyn]
-		1259 2972  AT-2970T [Allied Telesyn]
-		1259 2975  AT-2970SX [Allied Telesyn]
-		1259 2977  AT-2970T [Allied Telesyn]
-	4320  SK-98xx Gigabit Ethernet Server Adapter
+	4300  SK-98xx Gigabit Ethernet Server Adapter
+		1148 9821  SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)
+		1148 9822  SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
+		1148 9841  SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)
+		1148 9842  SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)
+		1148 9843  SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)
+		1148 9844  SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)
+		1148 9861  SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)
+		1148 9862  SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)
+		1148 9871  SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)
+		1148 9872  SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
+		1259 2970  AT-2970SX Gigabit Ethernet Adapter
+		1259 2971  AT-2970LX Gigabit Ethernet Adapter
+		1259 2972  AT-2970TX Gigabit Ethernet Adapter
+		1259 2973  AT-2971SX Gigabit Ethernet Adapter
+		1259 2974  AT-2971T Gigabit Ethernet Adapter
+		1259 2975  AT-2970SX/2SC Gigabit Ethernet Adapter
+		1259 2976  AT-2970LX/2SC Gigabit Ethernet Adapter
+		1259 2977  AT-2970TX/2TX Gigabit Ethernet Adapter
+	4320  SK-98xx V2.0 Gigabit Ethernet Adapter
+		1148 0121  Marvell RDK-8001 Adapter
+		1148 0221  Marvell RDK-8002 Adapter
+		1148 0321  Marvell RDK-8003 Adapter
+		1148 0421  Marvell RDK-8004 Adapter
+		1148 0621  Marvell RDK-8006 Adapter
+		1148 0721  Marvell RDK-8007 Adapter
+		1148 0821  Marvell RDK-8008 Adapter
+		1148 0921  Marvell RDK-8009 Adapter
+		1148 1121  Marvell RDK-8011 Adapter
+		1148 1221  Marvell RDK-8012 Adapter
+		1148 3221  SK-9521 V2.0 10/100/1000Base-T Adapter
 		1148 5021  SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
 		1148 5041  SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
 		1148 5043  SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
@@ -3570,7 +4014,8 @@
 		1148 5061  SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
 		1148 5071  SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
 		1148 9521  SK-9521 10/100/1000Base-T Adapter
-	4400  Gigabit Ethernet
+	4400  SK-9Dxx Gigabit Ethernet Adapter
+	4500  SK-9Mxx Gigabit Ethernet Adapter
 1149  Win System Corporation
 114a  VMIC
 	5579  VMIPCI-5579 (Reflective Memory Card)
@@ -3611,14 +4056,28 @@
 		114f 0031  DataFire RAS BRI S/T Adapter
 	0026  AccelePort 4r 920
 	0027  AccelePort Xr 920
+	0028  ClassicBoard 4
+	0029  ClassicBoard 8
 	0034  AccelePort 2r 920
 	0035  DataFire DSP T1/E1/PRI cPCI
 	0040  AccelePort Xp
-	0042  AccelePort 2p PCI
+	0042  AccelePort 2p
+	0043  AccelePort 4p
+	0044  AccelePort 8p
+	0045  AccelePort 16p
+	004e  AccelePort 32p
 	0070  Datafire Micro V IOM2 (Europe)
 	0071  Datafire Micro V (Europe)
 	0072  Datafire Micro V IOM2 (North America)
 	0073  Datafire Micro V (North America)
+	00b0  Digi Neo 4
+	00b1  Digi Neo 8
+	00c8  Digi Neo 2 DB9
+	00c9  Digi Neo 2 DB9 PRI
+	00ca  Digi Neo 2 RJ45
+	00cb  Digi Neo 2 RJ45 PRI
+	00d0  ClassicBoard 4 422
+	00d1  ClassicBoard 8 422
 	6001  Avanstar
 1150  Thinking Machines Corp
 1151  JAE Electronics Inc.
@@ -3665,6 +4124,7 @@
 	000f  Cardbus Ethernet 10/100
 		1014 0183  10/100 EtherJet Cardbus Adapter
 		115d 0183  Cardbus Ethernet 10/100
+	00d4  Mini-PCI K56Flex Modem
 	0101  Cardbus 56k modem
 		115d 1081  Cardbus 56k Modem
 	0103  Cardbus Ethernet + 56k Modem
@@ -3698,6 +4158,8 @@
 	0015  CMIC-GC Host Bridge
 	0016  CMIC-GC Host Bridge
 	0017  GCNB-LE Host Bridge
+	0101  CIOB-X2
+	0110  CIOB-E I/O Bridge with Gigabit Ethernet
 	0200  OSB4 South Bridge
 	0201  CSB5 South Bridge
 		4c53 1080  CT8 mainboard
@@ -3709,10 +4171,11 @@
 	0220  OSB4/CSB5 OHCI USB Controller
 		4c53 1080  CT8 mainboard
 	0221  CSB6 OHCI USB Controller
-	0225  GCLE Host Bridge
+	0225  CSB5 LPC bridge
 # cancelled
 		4c53 1080  CT8 mainboard
 	0227  GCLE-2 Host Bridge
+	0230  CSB5 LPC bridge
 		4c53 1080  CT8 mainboard
 1167  Mutoh Industries Inc
 1168  Thine Electronics Inc
@@ -3769,6 +4232,7 @@
 		1014 0185  ThinkPad A/T/X Series
 		104d 80df  Vaio PCG-FX403
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+		14ef 0220  PCD-RP-220S
 	0477  RL5c477
 	0478  RL5c478
 		1014 0184  ThinkPad A30p (2653-64G)
@@ -3792,7 +4256,11 @@
 		1186 1301  DFE-530TX+ 10/100 Ethernet Adapter
 	1340  DFE-690TXD CardBus PC Card
 	1561  DRP-32TXD Cardbus PC Card
-	4000  DL2K Ethernet
+	3300  DWL-510 2.4GHz Wireless PCI Adapter
+	3b05  DWL-G650+ CardBus PC Card
+	4000  DL2000-based Gigabit Ethernet
+	4c00  Gigabit Ethernet Adapter
+	8400  D-Link DWL-650+ CardBus PC Card
 1187  Advanced Technology Laboratories, Inc.
 1188  Shima Seiki Manufacturing Ltd.
 1189  Matsushita Electronics Co Ltd
@@ -3845,6 +4313,7 @@
 1195  Ratoc System Inc
 1196  Hytec Electronics Ltd
 1197  Gage Applied Sciences, Inc.
+	010c  CompuScope 82G 8bit 2GS/s Analog Input Card
 1198  Lambda Systems Inc
 1199  Attachmate Corporation
 119a  Mind Share, Inc.
@@ -3868,11 +4337,20 @@
 11a9  InnoSys Inc.
 	4240  AMCC S933Q Intelligent Serial Card
 11aa  Actel
-11ab  Galileo Technology Ltd.
+# (formerly Galileo technologies)
+11ab  Marvell
 	0146  GT-64010/64010A System Controller
+	4320  Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
 	4611  GT-64115 System Controller
 	4620  GT-64120/64120A/64121A System Controller
 	4801  GT-48001
+	5040  MV88SX5040 4-port SATA I PCI-X Controller
+	5041  MV88SX5041 4-port SATA I PCI-X Controller
+	5080  MV88SX5080 8-port SATA I PCI-X Controller
+	5081  MV88SX5081 8-port SATA I PCI-X Controller
+	6041  MV88SX6041 4-port SATA II PCI-X Controller
+	6081  MV88SX6081 8-port SATA II PCI-X Controller
+	6460  MV64360/64361/64362 System Controller
 	f003  GT-64010 Primary Image Piranha Image Generator
 11ac  Canon Information Systems Research Aust.
 11ad  Lite-On Communications Inc
@@ -3886,6 +4364,7 @@
 		11ad c001  LNE100TX [ver 2.0]
 11ae  Aztech System Ltd
 11af  Avid Technology Inc.
+	0001  [Cinema]
 11b0  V3 Semiconductor Inc.
 	0002  V300PSC
 	0292  V292PBC [Am29030/40 Bridge]
@@ -3966,6 +4445,7 @@
 	0444  LT WinModem
 	0445  LT WinModem
 		8086 2203  PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)
+		8086 2204  PRO/100+ MiniPCI on Armada E500
 	0446  LT WinModem
 	0447  LT WinModem
 	0448  WinModem 56k
@@ -4011,6 +4491,7 @@
 	0461  V90 WildWire Modem
 	0462  V90 WildWire Modem
 	0480  Venus Modem (V90, 56KFlex)
+	048c  V.92 56K WinModem
 	5801  USB
 	5802  USS-312 USB Controller
 # 4 port PCI USB Controller made by Agere (formely Lucent)
@@ -4047,6 +4528,7 @@
 11d2  Intercom Inc.
 11d3  Trancell Systems Inc
 11d4  Analog Devices
+	1535  Blackfin BF535 processor
 	1805  SM56 PCI modem
 	1889  AD1889 sound chip
 11d5  Ikon Corporation
@@ -4107,7 +4589,7 @@
 		11f6 2011  RL100-ATX
 	2201  ReadyLink 100TX (Winbond W89C840)
 		11f6 2011  ReadyLink 100TX
-	9881  RL100TX
+	9881  RL100TX Fast Ethernet
 11f7  Scientific Atlanta
 11f8  PMC-Sierra Inc.
 	7375  PM7375 [LASAR-155 ATM SAR]
@@ -4117,18 +4599,28 @@
 11fc  Silicon Magic
 11fd  High Street Consultants
 11fe  Comtrol Corporation
-	0001  RocketPort 8 Oct
-	0002  RocketPort 8 Intf
-	0003  RocketPort 16 Intf
-	0004  RocketPort 32 Intf
-	0005  RocketPort Octacable
-	0006  RocketPort 8J
-	0007  RocketPort 4-port
-	0008  RocketPort 8-port
-	0009  RocketPort 16-port
-	000a  RocketPort Plus Quadcable
-	000b  RocketPort Plus Octacable
-	000c  RocketPort 8-port Modem
+	0001  RocketPort 32 port w/external I/F
+	0002  RocketPort 8 port w/external I/F
+	0003  RocketPort 16 port w/external I/F
+	0004  RocketPort 4 port w/quad cable
+	0005  RocketPort 8 port w/octa cable
+	0006  RocketPort 8 port w/RJ11 connectors
+	0007  RocketPort 4 port w/RJ11 connectors
+	0008  RocketPort 8 port w/ DB78 SNI (Siemens) connector
+	0009  RocketPort 16 port w/ DB78 SNI (Siemens) connector
+	000a  RocketPort Plus 4 port
+	000b  RocketPort Plus 8 port
+	000c  RocketModem 6 port
+	000d  RocketModem 4-port
+	000e  RocketPort Plus 2 port RS232
+	000f  RocketPort Plus 2 port RS422
+	0801  RocketPort UPCI 32 port w/external I/F
+	0802  RocketPort UPCI 8 port w/external I/F
+	0803  RocketPort UPCI 16 port w/external I/F
+	0805  RocketPort UPCI 8 port w/octa cable
+	080c  RocketModem III 8 port
+	080d  RocketModem III 4 port
+	0903  RocketPort Compact PCI 16 port w/external I/F
 	8015  RocketPort 4-port UART 16954
 11ff  Scion Corporation
 1200  CSS Corporation
@@ -4186,6 +4678,14 @@
 		1025 1016  Travelmate 612 TX
 	6972  OZ6912 Cardbus Controller
 		1179 0001  Magnia Z310
+	7110  OZ711Mx MultiMediaBay Accelerator
+	7112  OZ711EC1/M1 SmartCardBus MultiMediaBay Controller
+	7113  OZ711EC1 SmartCardBus Controller
+	7114  OZ711M1 SmartCardBus MultiMediaBay Controller
+	71e2  OZ711E2 SmartCardBus Controller
+	7212  OZ711M2 SmartCardBus MultiMediaBay Controller
+	7213  OZ6933E CardBus Controller
+	7223  OZ711M3 SmartCardBus MultiMediaBay Controller
 1218  Hybricon Corp.
 1219  First Virtual Corporation
 121a  3Dfx Interactive, Inc.
@@ -4228,6 +4728,7 @@
 		121a 0061  Voodoo3 3500 TV (PAL)
 		121a 0062  Voodoo3 3500 TV (SECAM)
 	0009  Voodoo 4 / Voodoo 5
+		121a 0003  Voodoo5 PCI 5500
 		121a 0009  Voodoo5 AGP 5500/6000
 	0057  Voodoo 3/3000 [Avenger]
 121b  Advanced Telecommunications Modules
@@ -4253,6 +4754,7 @@
 1224  Interactive Images
 1225  Power I/O, Inc.
 1227  Tech-Source
+	0006  Raptor GFX 8P
 1228  Norsk Elektro Optikk A/S
 1229  Data Kinesis Inc.
 122a  Integrated Telecom
@@ -4314,6 +4816,7 @@
 	0e00  Fritz!PCI v2.0 ISDN
 	1100  C2 ISDN
 	1200  T1 ISDN
+	2700  Fritz!Card DSL SL
 1245  A.P.D., S.A.
 1246  Dipix Technologies, Inc.
 1247  Xylon Research, Inc.
@@ -4350,10 +4853,13 @@
 1258  Gilbarco, Inc.
 1259  Allied Telesyn International
 	2560  AT-2560 Fast Ethernet Adapter (i82557B)
+	a117  RTL81xx Fast Ethernet
+	a120  21x4x DEC-Tulip compatible 10/100 Ethernet
 125a  ABB Power Systems
 125b  Asix Electronics Corporation
-	1400  ALFA GFC2204
+	1400  ALFA GFC2204 Fast Ethernet
 125c  Aurora Technologies, Inc.
+	0101  Saturn 4520P
 	0640  Aries 16000P
 125d  ESS Technology
 	0000  ES336H Fax Modem (Early Model)
@@ -4395,13 +4901,16 @@
 		14fe 0429  ES56-PI Data Fax Modem
 125e  Specialvideo Engineering SRL
 125f  Concurrent Technologies, Inc.
-1260  Harris Semiconductor
+1260  Intersil Corporation
 	3873  Prism 2.5 Wavelan chipset
 		1186 3501  DWL-520 Wireless PCI Adapter
+		1186 3700  DWL-520 Wireless PCI Adapter, Rev E1
 		1668 0414  HWP01170-01 802.11b PCI Wireless Adapter
+		16a5 1601  AIR.mate PC-400 PCI Wireless LAN Adapter
 		1737 3874  WMP11 Wireless 802.11b PCI Adapter
 		8086 2513  Wireless 802.11b MiniPCI Adapter
-	3890  D-Links DWL-g650 A1
+	3890  Intersil ISL3890 [Prism GT/Prism Duette]
+		17cf 0014  Ovislink WL-5400PCM, Prism GT
 	8130  HMP8130 NTSC/PAL Video Decoder
 	8131  HMP8131 NTSC/PAL Video Decoder
 1261  Matsushita-Kotobuki Electronics Industries, Ltd.
@@ -4421,9 +4930,12 @@
 126a  Lexmark International, Inc.
 126b  Adax, Inc.
 126c  Northern Telecom
+	1211  10/100BaseTX [RTL81xx]
+	126c  802.11b Wireless Ethernet Adapter
 126d  Splash Technology, Inc.
 126e  Sumitomo Metal Industries, Ltd.
 126f  Silicon Motion, Inc.
+	0501  SM501 VoyagerGX
 	0710  SM710 LynxEM
 	0712  SM712 LynxEM+
 	0720  SM720 Lynx3DM
@@ -4498,6 +5010,7 @@
 		1274 2000  Creative Sound Blaster AudioPCI128
 		1274 2003  Creative SoundBlaster AudioPCI 128
 		1274 5880  Creative Sound Blaster AudioPCI128
+		1274 8001  Sound Blaster 16PCI 4.1ch
 		1458 a000  5880 AudioPCI On Motherboard 6OXET
 		1462 6880  5880 AudioPCI On Motherboard MS-6188 1.00
 		270f 2001  5880 AudioPCI On Motherboard 6CTR
@@ -4637,12 +5150,14 @@
 1281  Yokogawa Electric Corporation
 1282  Davicom Semiconductor, Inc.
 	9009  Ethernet 100/10 MBit
-	9100  Ethernet 100/10 MBit
-	9102  Ethernet 100/10 MBit
+	9100  21x4x DEC-Tulip compatible 10/100 Ethernet
+	9102  21x4x DEC-Tulip compatible 10/100 Ethernet
 	9132  Ethernet 100/10 MBit
 1283  Integrated Technology Express, Inc.
 	673a  IT8330G
+	8212  IT/ITE8212 Dual channel ATA RAID
 	8330  IT8330G
+	8872  IT8874F PCI Dual Serial Port Controller
 	8888  IT8888F PCI to ISA Bridge with SMB
 	8889  IT8889F PCI to ISA Bridge
 	e886  IT8330G
@@ -4688,6 +5203,7 @@
 12a1  Simpact Associates, Inc.
 12a2  Newgen Systems Corporation
 12a3  Lucent Technologies
+	8105  T8105 H100 Digital Switch
 12a4  NTT Electronics Technology Company
 12a5  Vision Dynamics Ltd.
 12a6  Scalable Networks, Inc.
@@ -4706,6 +5222,7 @@
 	0002  AceNIC Gigabit Ethernet (Copper)
 		10a9 8002  Acenic Gigabit Ethernet
 		12ae 0002  Gigabit Ethernet-T (3C986-T)
+	00fa  Farallon PN9100-T Gigabit Ethernet
 12af  TDK USA Corp
 12b0  Jorge Scientific Corp
 12b1  GammaLink
@@ -4807,6 +5324,7 @@
 12d9  Aculab PLC
 	0002  PCI Prosody
 	0004  cPCI Prosody
+	0005  Aculab E1/T1 PCI card
 12da  True Time Inc.
 12db  Annapolis Micro Systems, Inc
 12dc  Symicron Computer Communication Ltd.
@@ -4889,7 +5407,8 @@
 1304  Juniper Networks
 1305  Netphone, Inc
 1306  Duet Technologies
-1307  Computer Boards
+# Formerly ComputerBoards
+1307  Measurement Computing
 	0001  PCI-DAS1602/16
 	000b  PCI-DIO48H
 	000c  PCI-PDISO8
@@ -4926,6 +5445,7 @@
 	0037  PCI-DAS64/M3/16
 	004c  PCI-DAS1000
 	004d  PCI-QUAD04
+	0052  PCI-DAS4020/12
 1308  Jato Technologies Inc.
 	0001  NetCelerator Adapter
 		1308 0001  NetCelerator Adapter
@@ -4942,11 +5462,15 @@
 1313  Yaskawa Electric Co.
 1316  Teradyne Inc
 1317  Linksys
-	0981  Fast Ethernet 10/100
-	0985  Network Everywhere Fast Ethernet 10/100 model NC100
-	1985  Fast Ethernet 10/100
+	0981  21x4x DEC-Tulip compatible 10/100 Ethernet
+	0985  NC100 Network Everywhere Fast Ethernet 10/100
+	1985  21x4x DEC-Tulip compatible 10/100 Ethernet
+	2850  HSP MicroModem 56
+	8201  [ADMtek] SP906B_V2 Wireless LAN adapter
+		1317 8201  SMC2635W 802.11b (11mbps) wireless lan pcmcia (cardbus) card
+	9511  21x4x DEC-Tulip compatible 10/100 Ethernet
 1318  Packet Engines Inc.
-	0911  PCI Ethernet Adapter
+	0911  GNIC-II PCI Gigabit Ethernet [Hamachi]
 1319  Fortemedia, Inc
 	0801  Xwave QS3000A [FM801]
 	0802  Xwave QS3000A [FM801 game port]
@@ -5083,6 +5607,7 @@
 	01c0  SSCLP-200/300
 135d  ABB Network Partner AB
 135e  Sealevel Systems Inc
+	5101  Route 56.PCI - Multi-Protocol Serial Interface (Zilog Z16C32)
 	7101  Single Port RS-232/422/485/530
 	7201  Dual Port RS-232/422/485 Interface
 	7202  Dual Port RS-232 Interface
@@ -5109,6 +5634,7 @@
 136f  Applied Magic Inc
 1370  ATL Products
 1371  CNet Technology Inc
+	434e  GigaCard Network Adapter
 1373  Silicon Vision Inc
 1374  Silicom Ltd
 1375  Argosystems Inc
@@ -5117,6 +5643,7 @@
 1378  Telemann Co. Ltd
 1379  Asahi Kasei Microsystems Co Ltd
 137a  Mark of the Unicorn Inc
+	0001  PCI-324 Audiowire Interface
 137b  PPT Vision
 137c  Iwatsu Electric Co Ltd
 137d  Dynachip Corporation
@@ -5125,15 +5652,15 @@
 1380  Sanritz Automation Co Ltd
 1381  Brains Co. Ltd
 1382  Marian - Electronic & Software
+	2088  Marc-8 MIDI 8 channel audio card
 1383  Controlnet Inc
 1384  Reality Simulation Systems Inc
 1385  Netgear
 	4100  802.11b Wireless Adapter (MA301)
 	4105  MA311 802.11b wireless adapter
-	620a  GA620
+	620a  GA620 Gigabit Ethernet
 	622a  GA622
-	630a  GA630
-	f311  FA311
+	630a  GA630 Gigabit Ethernet
 1386  Video Domain Technologies
 1387  Systran Corp
 1388  Hitachi Information Technology Co Ltd
@@ -5150,6 +5677,7 @@
 1392  Medialight Inc
 1393  Moxa Technologies Co Ltd
 	1040  Smartio C104H/PCI
+	1141  Industrio CP-114
 	1680  Smartio C168H/PCI
 	2040  Intellio CP-204J
 	2180  Intellio C218 Turbo PCI
@@ -5229,6 +5757,9 @@
 13c4  Phase Metrics
 13c5  Alphi Technology Corp
 13c6  Condor Engineering Inc
+	0520  CEI-520 A429 Card
+	0620  CEI-620 A429 Card
+	0820  CEI-820 A429 Card
 13c7  Blue Chip Technology Ltd
 13c8  Apptech Inc
 13c9  Eaton Corporation
@@ -5239,11 +5770,13 @@
 13ce  Cocom A/S
 13cf  Studio Audio & Video Ltd
 13d0  Techsan Electronics Co Ltd
-# http://www.b2c2inc.com/products/pc-specs.html
-	2103  B2C2 Sky2PC PCI [SkyStar2]
+	2103  B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card
+	2200  B2C2 FlexCopIII DVB chip / Technisat SkyStar2 DVB card
 13d1  Abocom Systems Inc
 	ab02  ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter
+	ab03  21x4x DEC-Tulip compatible 10/100 Ethernet
 	ab06  RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter
+	ab08  21x4x DEC-Tulip compatible 10/100 Ethernet
 13d2  Shark Multimedia Inc
 13d3  IMC Networks
 13d4  Graphics Microsystems Inc
@@ -5285,6 +5818,7 @@
 	1401  Zentai Fibre Channel Adapter
 13f5  Kansai Electric Co. Ltd
 13f6  C-Media Electronics Inc
+	0011  CMI8738
 	0100  CM8338A
 		13f6 ffff  CMI8338/C3DX PCI Audio Device
 	0101  CM8338B
@@ -5305,6 +5839,9 @@
 13fc  Computer Peripherals International
 13fd  Micro Science Inc
 13fe  Advantech Co. Ltd
+	1600  PCI-1612 4-port RS-232/422/485 PCI Communication Card
+	1752  PCI-1752
+	1754  PCI-1754
 	1756  PCI-1756
 13ff  Silicon Spice Inc
 1400  Artx Inc
@@ -5319,9 +5856,15 @@
 	0100  Lava Dual Serial
 	0101  Lava Quatro A
 	0102  Lava Quatro B
+	0120  Quattro-PCI A
+	0121  Quattro-PCI B
+	0180  Lava Octo A
+	0181  Lava Octo B
 	0200  Lava Port Plus
 	0201  Lava Quad A
 	0202  Lava Quad B
+	0220  Lava Quattro PCI Ports A/B
+	0221  Lava Quattro PCI Ports C/D
 	0500  Lava Single Serial
 	0600  Lava Port 650
 	8000  Lava Parallel
@@ -5342,6 +5885,7 @@
 1411  Ikos Systems Inc
 1412  IC Ensemble Inc
 	1712  ICE1712 [Envy24]
+		1412 d638  M-Audio Delta 410
 	1724  ICE1724 [Envy24HT]
 1413  Addonics
 1414  Microsoft Corporation
@@ -5382,10 +5926,12 @@
 142c  Minton Optic Industry Co Ltd
 142d  Pix stream Inc
 142e  Vitec Multimedia
+	4020  VM2-2 [Video Maker 2] MPEG1/2 Encoder
 142f  Radicom Research Inc
 1430  ITT Aerospace/Communications Division
 1431  Gilat Satellite Networks
 1432  Edimax Computer Co.
+	9130  RTL81xx Fast Ethernet
 1433  Eltec Elektronik GmbH
 1435  Real Time Devices US Inc.
 1436  CIS Technology Inc
@@ -5443,6 +5989,10 @@
 1460  DYNARC INC
 1461  Avermedia Technologies Inc
 1462  Micro-Star International Co., Ltd.
+	8725  NVIDIA NV25 [GeForce4 Ti 4600] VGA Adapter
+# MSI G4Ti4800, 128MB DDR SDRAM, TV-Out, DVI-I
+	9000  NVIDIA NV28 [GeForce4 Ti 4800] VGA Adapter
+	9119  NVIDIA NV31 [GeForce FX 5600XT] VGA Adapter
 1463  Fast Corporation
 1464  Interactive Circuits & Systems Ltd
 1465  GN NETTEST Telecom DIV.
@@ -5533,7 +6083,7 @@
 14b5  Creamware GmBH
 	0200  Scope
 	0300  Pulsar
-	0400  Pulsar2
+	0400  PulsarSRB
 	0600  Pulsar2
 	0800  DSP-Board
 	0900  DSP-Board
@@ -5548,8 +6098,9 @@
 	0340  PC4800
 	0350  PC4800
 	4500  PC4500
-	4800  PC4800
+	4800  Cisco Aironet 340 802.11b WLAN Adapter/Aironet PC4800
 	a504  Cisco Aironet Wireless 802.11b
+	a505  Cisco Aironet CB20a 802.11a Wireless LAN Adapter
 14ba  INTERNIX Inc.
 14bb  SEMTECH Corporation
 14bc  Globespan Semiconductor Inc.
@@ -5558,6 +6109,7 @@
 14bf  SPIDER Communications Inc.
 14c0  COMPAL Electronics Inc
 14c1  MYRICOM Inc.
+	8043  Myrinet 2000 Scalable Cluster Interconnect
 14c2  DTK Computer
 14c3  MEDIATEK Corp.
 14c4  IWASAKI Information Systems Co Ltd
@@ -5598,11 +6150,10 @@
 14d7  Hirakawa Hewtech Corp
 14d8  HOPF Elektronik GmBH
 14d9  Alpha Processor Inc
+	0010  AP1011 HyperTransport-PCI Bridge [Sturgeon]
 14da  National Aerospace Laboratories
 14db  AFAVLAB Technology Inc
 	2120  TK9902
-	2180  P028
-	2182  P030
 14dc  Amplicon Liveline Ltd
 	0000  PCI230
 	0001  PCI242
@@ -5649,6 +6200,10 @@
 		0e11 009a  NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
 		0e11 00c1  NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)
 		1028 0121  Broadcom BCM5701 1000Base-T
+		103c 128a  HP 1000Base-T (PCI) [A7061A]
+		103c 128b  HP 1000Base-SX (PCI) [A7073A]
+		103c 12a4  HP Core Lan 1000Base-T
+		103c 12c1  HP IOX Core Lan 1000Base-T [A7109AX]
 		10a9 8010  SGI IO9 Gigabit Ethernet (Copper)
 		10a9 8011  SGI Gigabit Ethernet (Copper)
 		10a9 8012  SGI Gigabit Ethernet (Fiber)
@@ -5684,16 +6239,28 @@
 		1166 1648  NetXtreme CIOB-E 1000Base-T
 	164d  NetXtreme BCM5702FE Gigabit Ethernet
 	1653  NetXtreme BCM5705 Gigabit Ethernet
+	1654  NetXtreme BCM5705_2 Gigabit Ethernet
+	1658  NetXtreme BCM5720 Gigabit Ethernet
+	1659  NetXtreme BCM5721 Gigabit Ethernet
 	165d  NetXtreme BCM5705M Gigabit Ethernet
+	165e  NetXtreme BCM5705M_2 Gigabit Ethernet
+	166e  NetXtreme BCM5705F Gigabit Ethernet
+	1676  NetXtreme BCM5750 Gigabit Ethernet
+	1677  NetXtreme BCM5751 Gigabit Ethernet
+	167c  NetXtreme BCM5750M Gigabit Ethernet
+	167d  NetXtreme BCM5751M Gigabit Ethernet
+	167e  NetXtreme BCM5751F Gigabit Ethernet
 	1696  NetXtreme BCM5782 Gigabit Ethernet
+		103c 12bc  HP d530 CMT (DG746A)
 		14e4 000d  NetXtreme BCM5782 1000Base-T
 	169c  NetXtreme BCM5788 Gigabit Ethernet
-	16a6  NetXtreme BCM5702 Gigabit Ethernet
+	169d  NetXtreme BCM5789 Gigabit Ethernet
+	16a6  NetXtreme BCM5702X Gigabit Ethernet
 		0e11 00bb  NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
 		1028 0126  BCM5702 1000Base-T
 		14e4 000c  BCM5702 1000Base-T
 		14e4 8009  BCM5702 1000Base-T
-	16a7  NetXtreme BCM5703 Gigabit Ethernet
+	16a7  NetXtreme BCM5703X Gigabit Ethernet
 		0e11 00ca  NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
 		0e11 00cb  NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
 		14e4 0009  NetXtreme BCM5703 1000Base-T
@@ -5702,25 +6269,33 @@
 		14e4 800a  NetXtreme BCM5703 1000Base-T
 	16a8  NetXtreme BCM5704S Gigabit Ethernet
 		10b7 2001  3C998-SX Dual Port 1000-SX PCI-X
-	16c6  NetXtreme BCM5702 Gigabit Ethernet
+	16c6  NetXtreme BCM5702A3 Gigabit Ethernet
 		10b7 1100  3C1000B-T 10/100/1000 PCI
 		14e4 000c  BCM5702 1000Base-T
 		14e4 8009  BCM5702 1000Base-T
 	16c7  NetXtreme BCM5703 Gigabit Ethernet
+		103c 12c3  HP Combo FC/GigE-SX [A9782A]
+		103c 12ca  HP Combo FC/GigE-T [A9784A]
 		14e4 0009  NetXtreme BCM5703 1000Base-T
 		14e4 000a  NetXtreme BCM5703 1000Base-SX
+	170d  NetXtreme BCM5901 Gigabit Ethernet
+	170e  NetXtreme BCM5901_2 Gigabit Ethernet
 	4210  BCM4210 iLine10 HomePNA 2.0
 	4211  BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem
 	4212  BCM4212 v.90 56k modem
 	4301  BCM4301 802.11b
 	4320  BCM94306 802.11g
+		1028 0001  TrueMobile 1300 WLAN Mini-PCI Card
 		1737 4320  WPC54G
+	4324  BCM4309 802.11a/b/g
+		1028 0001  Truemobile 1400
 	4401  BCM4401 100Base-T
 		1043 80a8  A7V8X motherboard
 	4402  BCM4402 Integrated 10/100BaseT
 	4410  BCM4413 iLine32 HomePNA 2.0
 	4411  BCM4413 V.90 56k modem
 	4412  BCM4413 10/100BaseT
+	5690  BCM5690 12-port Multi-Layer Gigabit Ethernet Switch
 	5820  BCM5820 Crypto Accelerator
 	5821  BCM5821 Crypto Accelerator
 14e5  Pixelfusion Ltd
@@ -5730,6 +6305,7 @@
 14e9  GARNETS System CO Ltd
 14ea  Planex Communications, Inc
 	ab06  FNW-3603-TX CardBus Fast Ethernet
+	ab07  RTL81xx RealTek Ethernet
 14eb  SEIKO EPSON Corp
 14ec  ACQIRIS
 14ed  DATAKINETICS Ltd
@@ -5872,6 +6448,7 @@
 		13e0 8d85  Compaq Stinger
 		14f1 2004  Dynalink 56PMi
 	8234  RS8234 ATM SAR Controller [ServiceSAR Plus]
+	8800  Winfast TV2000 XP
 14f2  MOBILITY Electronics
 	0120  EV1000 bridge
 	0121  EV1000 Parallel port
@@ -5894,6 +6471,7 @@
 14fe  ARCHTEK TELECOM Corp
 14ff  TWINHEAD INTERNATIONAL Corp
 1500  DELTA Electronics, Inc
+	1360  RTL81xx RealTek Ethernet
 1501  BANKSOFT CANADA Ltd
 1502  MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd
 1503  KAWASAKI LSI USA Inc
@@ -5926,8 +6504,10 @@
 1514  TFL LAN Inc
 1515  Advent design
 1516  MYSON Technology Inc
+	0800  MTD-8xx 100/10M Ethernet PCI Adapter
 	0803  SURECOM EP-320X-S 100/10M Ethernet PCI Adapter
 		1320 10bd  SURECOM EP-320X-S 100/10M Ethernet PCI Adapter
+	0891  MTD-8xx 100/10M Ethernet PCI Adapter
 1517  ECHOTEK Corp
 1518  PEP MODULAR Computers GmbH
 1519  TELEFON AKTIEBOLAGET LM Ericsson
@@ -5952,12 +6532,19 @@
 		1522 0600  RockForce+ 2 Port V.90 Data/Fax/Voice Modem
 		1522 0700  RockForce+ 4 Port V.90 Data/Fax/Voice Modem
 		1522 0800  RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem
+		1522 0c00  RockForceDUO+ 2 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem
+		1522 0d00  RockForceQUATRO+ 4 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem
+# this is a correction to a recent entry. 1522:0E00 should be 1522:1D00
+		1522 1d00  RockForceOCTO+ 8 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem
 1523  MUSIC Semiconductors
 1524  ENE Technology Inc
+	0510  CB710 Memory Card Reader Controller
 	1211  CB1211 Cardbus Controller
 	1225  CB1225 Cardbus Controller
 	1410  CB1410 Cardbus Controller
+	1411  CB710 Cardbus Controller
 	1420  CB1420 Cardbus Controller
+	1421  CB720 Cardbus Controller
 1525  IMPACT Technologies
 1526  ISS, Inc
 1527  SOLECTRON
@@ -5977,9 +6564,11 @@
 1535  EVERGREEN Technologies Inc
 1537  DATALEX COMMUNCATIONS
 1538  ARALION Inc
+	0303  ARS106S Ultra ATA 133/100/66 Host Controller
 1539  ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A.
 153a  ONO SOKKI
 153b  TERRATEC Electronic GmbH
+	1144  Aureon 5.1
 153c  ANTAL Electronic
 153d  FILANET Corp
 153e  TECHWELL Inc
@@ -6123,6 +6712,7 @@
 15ab  Bluesteel Networks Inc
 15ac  North Atlantic Instruments
 15ad  VMWare Inc
+	0405  [VMWare SVGA II] PCI Display Adapter
 	0710  Virtual SVGA
 15ae  Amersham Pharmacia Biotech
 15b0  Zoltrix International Ltd
@@ -6130,6 +6720,9 @@
 15b2  Mosaid Technologies Inc
 15b3  Mellanox Technology
 	5274  MT21108 InfiniBridge
+	5a44  MT23108 InfiniHost
+	5a45  MT23108 InfiniHost (Tavor)
+	5a46  MT23108 PCI Bridge
 15b4  CCI/TRIAD
 15b5  Cimetrics Inc
 15b6  Texas Memory Systems Inc
@@ -6139,7 +6732,9 @@
 15ba  Impacct Technology Corp
 15bb  Portwell Inc
 15bc  Agilent Technologies
-	2929  E2929A PCI/PCI-X Bus Analyzer
+	2922  64 Bit, 133MHz PCI-X Exerciser & Protocol Checker
+	2928  64 Bit, 66MHz PCI Exerciser & Analyzer
+	2929  64 Bit, 133MHz PCI-X Analyzer & Exerciser
 15bd  DFI Inc
 15be  Sola Electronics
 15bf  High Tech Computer Corp (HTC)
@@ -6149,6 +6744,7 @@
 15c3  Taiwan Mycomp Co Ltd
 15c4  EVSX Inc
 15c5  Procomp Informatics Ltd
+	8010  1394b - 1394 Firewire 3-Port Host Adapter Card
 15c6  Technical University of Budapest
 15c7  Tateyama System Laboratory Co Ltd
 	0349  Tateyama C-PCI PLC/NC card Rev.01A
@@ -6187,9 +6783,12 @@
 15e8  National Datacomm Corp
 	0130  Wireless PCI Card
 15e9  Pacific Digital Corp
+	1841  ADMA-100 DiscStaQ ATA Controller
 15ea  Tokyo Denshi Sekei K.K.
 15eb  Drsearch GmbH
 15ec  Beckhoff GmbH
+	3101  FC3101 Profibus DP 1 Channel PCI
+	5102  FC5102
 15ed  Macrolink Inc
 15ee  In Win Development Inc
 15ef  Intelligent Paradigm Inc
@@ -6223,11 +6822,13 @@
 1619  FarSite Communications Ltd
 	0400  FarSync T2P (2 port X.21/V.35/V.24)
 	0440  FarSync T4P (4 port X.21/V.35/V.24)
+1626  TDK Semiconductor Corp.
+	8410  RTL81xx Fast Ethernet
 1629  Kongsberg Spacetec AS
 	1003  Format synchronizer v3.0
 	2002  Fast Universal Data Output
 1638  Standard Microsystems Corp [SMC]
-	1100  SMC2602W EZConnect / Addtron AWA-100
+	1100  SMC2602W EZConnect/Addtron AWA-100/Eumitcom WL11000
 163c  Smart Link Ltd.
 	3052  SmartLink SmartPCI562 56K Modem
 	5449  SmartPCI561 Modem
@@ -6239,27 +6840,69 @@
 165d  Hsing Tech. Enterprise Co., Ltd.
 1661  Worldspace Corp.
 1668  Actiontec Electronics Inc
+	0100  Mini-PCI bridge
+# Formerly SiByte, Inc.
+166d  Broadcom Corporation
+	0001  SiByte BCM1125/1125H/1250 System-on-a-Chip PCI
+	0002  SiByte BCM1125H/1250 System-on-a-Chip HyperTransport
 1681  Hercules
+# More specs, more accurate desc.
+	0010  Hercules 3d Prophet II Ultra 64MB [ 350 MHz NV15BR core, 128-bit DDR @ 460 MHz, 1.5v AGP4x  ]
+1688  CastleNet Technology Inc.
+	1170  WLAN 802.11b card
+168c  Atheros Communications, Inc.
+	0007  AR5000 802.11a Wireless Adapter
+	0011  AR5210 802.11a NIC
+	0012  AR5211 802.11ab NIC
+	0013  AR5212 802.11abg NIC
+		1186 3202  D-link DWL-G650 B3 Wireless cardbus adapter
+		1186 3203  DWL-G520 Wireless PCI Adapter
+		1186 3a94  C54C Wireless 801.11g cardbus
+		168c 0013  WG511T Wireless CardBus Adapter
+		168c 1025  DWL-G650B2 Wireless CardBus Adapter
+	1014  AR5212 802.11abg NIC
 16ab  Global Sun Technology Inc
+	1100  GL24110P
+	1101  PLX9052 PCMCIA-to-PCI Wireless LAN
 	1102  PCMCIA-to-PCI Wireless Network Bridge
+16ae  Safenet Inc
+	1141  SafeXcel-1141
 16be  Creatix Polymedia GmbH
 16ca  CENATEK Inc
 	0001  Rocket Drive DL
+16cd  Densitron Technologies
+# www.pikatechnologies.com
+16df  PIKA Technologies Inc.
 16ec  U.S. Robotics
+	00ff  USR997900 10/100 Mbps PCI Network Card
 	3685  Wireless Access PCI Adapter Model 022415
 16f6  VideoTele.com, Inc.
+# www.internetmachines.com
+1702  Internet Machines Corporation (IMC)
 1705  Digital First, Inc.
-170b  NetOctave Inc
+170b  NetOctave
+	0100  NSP2000-SSL crypto accelerator
 170c  YottaYotta Inc.
 172a  Accelerated Encryption
 1737  Linksys
+	1032  Gigabit Network Adapter
+		1737 0015  EG1032 v2 Instant Gigabit Network Adapter
+	1064  Gigabit Network Adapter
+		1737 0016  EG1064 v2 Instant Gigabit Network Adapter
+	ab08  21x4x DEC-Tulip compatible 10/100 Ethernet
+	ab09  21x4x DEC-Tulip compatible 10/100 Ethernet
 173b  Altima (nee Broadcom)
 	03e8  AC1000 Gigabit Ethernet
+	03e9  AC1001 Gigabit Ethernet
 	03ea  AC9100 Gigabit Ethernet
 		173b 0001  AC1002
+	03eb  AC1003 Gigabit Ethernet
 1743  Peppercon AG
 	8139  ROL/F-100 Fast Ethernet Adapter with ROL
+1749  RLX Technologies
 174b  PC Partner Limited
+174d  WellX Telecom SA
+175c  AudioScience Inc
 175e  Sanera Systems, Inc.
 1787  Hightech Information System Ltd.
 # also used by Struck Innovative Systeme for joint developments
@@ -6271,21 +6914,48 @@
 	0005  PROFIBUS
 	0006  AMCC HOTlink
 1799  Belkin
+	6001  Wireless PCI Card - F5D6001
+	6020  Wireless PCMCIA Card - F5D6020
+	6060  Wireless PDA Card - F5D6060
 17af  Hightech Information System Ltd.
+17b3  Hawking Technologies
+	ab08  PN672TX 10/100 Ethernet
+17b4  Indra Networks, Inc.
+	0011  WebEnhance 100 GZIP Compression Card
+17c0  Wistron Corp.
+17c2  Newisys, Inc.
 17cc  NetChip Technology, Inc
 	2280  USB 2.0
+# S2io ships 10Gb PCI-X Ethernet adapters www.s2io.com
+17d5  S2io Inc.
 1813  Ambient Technologies Inc
 	4000  HaM controllerless modem
 		16be 0001  V9x HAM Data Fax Modem
 	4100  HaM plus Data Fax Modem
 		16be 0002  V9x HAM 1394
+1814  RaLink
+	0101  Wireless PCI Adpator RT2400 / RT2460
+	0201  Ralink RT2500 802.11 Cardbus Reference Card
+1830  Credence Systems Corporation
 1851  Microtune, Inc.
 1852  Anritsu Corp.
+1867  Topspin Communications
+	5a44  MT23108 PCI-X HCA
+	5a45  MT23108 PCI-X HCA flash recovery
+	5a46  MT23108 PCI-X HCA bridge
 1888  Varisys Ltd
 	0301  VMFX1 FPGA PMC module
 	0601  VSM2 dual PMC carrier
 	0710  VS14x series PowerPC PCI board
 	0720  VS24x series PowerPC PCI board
+# found e.g. on KNC DVB-S card
+1894  KNC One
+18a1  Astute Networks Inc.
+18ca  XGI - Xabre Graphics Inc
+	0040  Volari V8
+18e6  MPL AG
+	0001  OSCI [Octal Serial Communication Interface]
+18fb  Resilience Corporation
 1a08  Sierra semiconductor
 	0000  SC15064
 1b13  Jaton Corp
@@ -6321,7 +6991,10 @@
 	0021  HB6 Universal PCI-PCI bridge (non-transparent mode)
 		4c53 1050  CT7 mainboard
 		4c53 1080  CT8 mainboard
+		4c53 10a0  CA3/CR3 mainboard
 		4c53 3010  PPCI mezzanine (32-bit PMC)
+		4c53 3011  PPCI mezzanine (64-bit PMC)
+	0026  HB2 PCI-PCI Bridge
 	101a  E.Band [AudioTrak Inca88]
 	101b  E.Band [AudioTrak Inca88]
 	8011  VXPro II Chipset
@@ -6356,7 +7029,17 @@
 		3d3d 0121  Oxygen VX1
 	000c  GLINT R3 [Oxygen VX1]
 		3d3d 0144  Oxygen VX1-4X AGP [Permedia 4]
+	000d  GLint R4 rev A
+	0011  GLint R4 rev B
+	0012  GLint R5 rev A
+	0013  GLint R5 rev B
+	0020  VP10 visual processor
+# P10 generic II
+	0022  VP10 visual processor
+	0024  VP9 visual processor
 	0100  Permedia II 2D+3D
+	07a1  Wildcat III 6210
+	07a3  Wildcat IV 7210
 	1004  Permedia
 	3d04  Permedia
 	ffff  Glint VGA
@@ -6379,11 +7062,16 @@
 4033  Addtron Technology Co, Inc.
 	1360  RTL8139 Ethernet
 4143  Digital Equipment Corp
+4144  Alpha Data
 416c  Aladdin Knowledge Systems
 	0100  AladdinCARD
 	0200  CPC
 4444  Internext Compression Inc
+	0016  iTVC16 (CX23416) MPEG-2 Encoder
+		0070 4009  WinTV PVR 250
 	0803  iTVC15 MPEG-2 Encoder
+		0070 4000  WinTV PVR-350
+		0070 4001  WinTV PVR-250
 4468  Bridgeport machines
 4594  Cogetec Informatique Inc
 45fb  Baldor Electric Company
@@ -6399,6 +7087,11 @@
 4b10  Buslogic Inc.
 4c48  LUNG HWA Electronics
 4c53  SBS Technologies
+	0000  PLUSTEST device
+		4c53 3000  PLUSTEST card (PC104+)
+		4c53 3001  PLUSTEST card (PMC)
+	0001  PLUSTEST-MM device
+		4c53 3002  PLUSTEST-MM card (PMC)
 4ca1  Seanix Technology Inc
 4d51  MediaQ Inc.
 	0200  MQ-200
@@ -6576,8 +7269,9 @@
 	0003  TURBOstor HFP-832 [HiPPI NIC]
 5654  VoiceTronix Pty Ltd
 5700  Netpower
+5851  Exacq Technologies
 6356  UltraStor
-6374  c't Magazin für Computertechnik
+6374  c't Magazin für Computertechnik
 	6773  GPPCI
 6409  Logitec Corp.
 6666  Decision Computer International Co.
@@ -6589,11 +7283,37 @@
 8008  Quancom Electronic GmbH
 	0010  WDOG1 [PCI-Watchdog 1]
 	0011  PWDOG2 [PCI-Watchdog 2]
+# Wrong ID used in subsystem ID of AsusTek PCI-USB2 PCI card.
+807d  Asustek Computer, Inc.
 8086  Intel Corp.
 	0007  82379AB
 	0008  Extended Express System Support Controller
-	0039  21145
+		0008 1000  WorldMark 4300 INCA ASIC
+	0039  21145 Fast Ethernet
 	0122  82437FX
+	0326  PCI Bridge Hub I/OxAPIC Interrupt Controller A
+	0327  PCI Bridge Hub I/OxAPIC Interrupt Controller B
+	0329  PCI Bridge Hub A
+	032a  PCI Bridge Hub B
+	032c  PCI Bridge Hub
+# A-segment bridge
+	0330  80332 [Dobson] I/O processor
+# A-segment IOAPIC
+	0331  80332 [Dobson] I/O processor
+# B-segment bridge
+	0332  80332 [Dobson] I/O processor
+# B-segment IOAPIC
+	0333  80332 [Dobson] I/O processor
+# Address Translation Unit (ATU)
+	0334  80332 [Dobson] I/O processor
+# PCI-X bridge
+	0335  80331 [Lindsay] I/O processor
+# Address Translation Unit (ATU)
+	0336  80331 [Lindsay] I/O processor
+# A-segment bridge
+	0340  41210 [Lanai] Serial to Parallel PCI Bridge
+# B-segment bridge
+	0341  41210 [Lanai] Serial to Parallel PCI Bridge
 	0482  82375EB
 	0483  82424ZX [Saturn]
 	0484  82378IB [SIO ISA Bridge]
@@ -6625,28 +7345,84 @@
 		8086 1004  PRO/1000 T Server Adapter
 		8086 2004  PRO/1000 T Server Adapter
 	1008  82544EI Gigabit Ethernet Controller (Copper)
+		1014 0269  iSeries 1000/100/10 Ethernet Adapter
+		1028 011c  PRO/1000 XT Network Connection
 		8086 1107  PRO/1000 XT Server Adapter
 		8086 2107  PRO/1000 XT Server Adapter
 		8086 2110  PRO/1000 XT Server Adapter
+		8086 3108  PRO/1000 XT Network Connection
 	1009  82544EI Gigabit Ethernet Controller (Fiber)
+		1014 0268  iSeries Gigabit Ethernet Adapter
 		8086 1109  PRO/1000 XF Server Adapter
 		8086 2109  PRO/1000 XF Server Adapter
 	100c  82544GC Gigabit Ethernet Controller (Copper)
 		8086 1112  PRO/1000 T Desktop Adapter
 		8086 2112  PRO/1000 T Desktop Adapter
 	100d  82544GC Gigabit Ethernet Controller (LOM)
+		1028 0123  PRO/1000 XT Network Connection
+		1079 891f  82544GC Based Network Connection
+		4c53 1080  CT8 mainboard
+		8086 110d  82544GC Based Network Connection
 	100e  82540EM Gigabit Ethernet Controller
+		1014 0265  PRO/1000 MT Network Connection
+		1014 0267  PRO/1000 MT Network Connection
+		1014 026a  PRO/1000 MT Network Connection
+		107b 8920  PRO/1000 MT Desktop Adapter
 		8086 001e  PRO/1000 MT Desktop Adapter
 		8086 002e  PRO/1000 MT Desktop Adapter
 	100f  82545EM Gigabit Ethernet Controller (Copper)
+		1014 0269  iSeries 1000/100/10 Ethernet Adapter
+		1014 028e  PRO/1000 MT Network Connection
+		8086 1000  PRO/1000 MT Network Connection
 		8086 1001  PRO/1000 MT Server Adapter
 	1010  82546EB Gigabit Ethernet Controller (Copper)
+		1014 027c  PRO/1000 MT Dual Port Network Adapter
+		18fb 7872  RESlink-X
+		4c53 1080  CT8 mainboard
+		4c53 10a0  CA3/CR3 mainboard
 		8086 1011  PRO/1000 MT Dual Port Server Adapter
+		8086 101a  PRO/1000 MT Dual Port Network Adapter
 	1011  82545EM Gigabit Ethernet Controller (Fiber)
+		1014 0268  iSeries Gigabit Ethernet Adapter
 		8086 1002  PRO/1000 MF Server Adapter
+		8086 1003  PRO/1000 MF Server Adapter (LX)
 	1012  82546EB Gigabit Ethernet Controller (Fiber)
 		8086 1012  PRO/1000 MF Dual Port Server Adapter
+	1013  82541EI Gigabit Ethernet Controller (Copper)
+		8086 0013  PRO/1000 MT Network Connection
+		8086 1113  PRO/1000 MT Desktop Adapter
+	1014  82541ER Gigabit Ethernet Controller
 	1015  82540EM Gigabit Ethernet Controller (LOM)
+	1016  82540EP Gigabit Ethernet Controller (LOM)
+		1014 052c  PRO/1000 MT Mobile Connection
+		1179 0001  PRO/1000 MT Mobile Connection
+		8086 1016  PRO/1000 MT Mobile Connection
+	1017  82540EP Gigabit Ethernet Controller (LOM)
+		8086 1017  PR0/1000 MT Desktop Connection
+# Update controller name from 82541EP to 82541EI
+	1018  82541EI Gigabit Ethernet Controller
+		8086 1018  PRO/1000 MT Desktop Adapter
+	1019  82547EI Gigabit Ethernet Controller (LOM)
+		1458 1019  GA-8IPE1000 Pro2 motherboard (865PE)
+		8086 1019  PRO/1000 CT Desktop Connection
+	101d  82546EB Gigabit Ethernet Controller
+		8086 1000  PRO/1000 MT Quad Port Server Adapter
+	101e  82540EP Gigabit Ethernet Controller (Mobile)
+		1014 0549  PRO/1000 MT Mobile Connection
+		1179 0001  PRO/1000 MT Mobile Connection
+		8086 101e  PRO/1000 MT Mobile Connection
+	1026  82545GM Gigabit Ethernet Controller
+		8086 1000  PRO/1000 MT Server Connection
+		8086 1001  PRO/1000 MT Server Adapter
+		8086 1002  PRO/1000 MT Server Adapter
+		8086 1026  PRO/1000 MT Server Connection
+	1027  82545GM Gigabit Ethernet Controller
+		8086 1001  PRO/1000 MF Server Adapter(LX)
+		8086 1002  PRO/1000 MF Server Adapter(LX)
+		8086 1003  PRO/1000 MF Server Adapter(LX)
+		8086 1027  PRO/1000 MF Server Adapter
+	1028  82545GM Gigabit Ethernet Controller
+		8086 1028  PRO/1000 MB Server Adapter
 	1029  82559 Ethernet Controller
 	1030  82559 InBusiness 10/100
 	1031  82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller
@@ -6666,6 +7442,7 @@
 	1037  82801CAM (ICH3) Chipset Ethernet Controller
 	1038  82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller
 	1039  82801BD PRO/100 VE (LOM) Ethernet Controller
+		1014 0267  NetVista A30p
 	103a  82801BD PRO/100 VE (CNR) Ethernet Controller
 	103b  82801BD PRO/100 VM (LOM) Ethernet Controller
 	103c  82801BD PRO/100 VM (CNR) Ethernet Controller
@@ -6674,10 +7451,49 @@
 	1040  536EP Data Fax Modem
 		16be 1040  V.9X DSP Data Fax Modem
 	1043  PRO/Wireless LAN 2100 3B Mini PCI Adapter
-	1048  82597EX 10GbE Ethernet Controller
+		8086 2527  MIM2000/Centrino
+	1048  Intel(R) PRO/10GbE LR Server Adapter
 		8086 a01f  PRO/10GbE LR Server Adapter
 		8086 a11f  PRO/10GbE LR Server Adapter
+	1050  82562EZ 10/100 Ethernet Controller
+		1462 728c  865PE Neo2 (MS-6728)
+	1051  82801EB/ER (ICH5/ICH5R) integrated LAN Controller
 	1059  82551QM Ethernet Controller
+# Updated controller name from 82547EI to 82547GI
+	1075  82547GI Gigabit Ethernet Controller
+		8086 0075  PRO/1000 CT Network Connection
+		8086 1075  PRO/1000 CT Network Connection
+# Added PI to part name.  Previous part name was 82541GI
+	1076  82541GI/PI Gigabit Ethernet Controller
+		8086 0076  PRO/1000 MT Network Connection
+		8086 1076  PRO/1000 MT Network Connection
+		8086 1176  PRO/1000 MT Desktop Adapter
+		8086 1276  PRO/1000 MT Desktop Adapter
+# Update controller name from 82541EI to 82541GI
+	1077  82541GI Gigabit Ethernet Controller
+		1179 0001  PRO/1000 MT Mobile Connection
+		8086 0077  PRO/1000 MT Mobile Connection
+		8086 1077  PRO/1000 MT Mobile Connection
+	1078  82541EI Gigabit Ethernet Controller
+		8086 1078  PRO/1000 MT Network Connection
+# Update from mistaken ID of 82546EB
+	1079  82546GB Gigabit Ethernet Controller
+		103c 12a6  HP Dual Port 1000Base-T [A9900A]
+		103c 12cf  HP Core Dual Port 1000Base-T [AB352A]
+		4c53 1090  Cx9 / Vx9 mainboard
+		8086 0079  PRO/1000 MT Dual Port Network Connection
+		8086 1079  PRO/1000 MT Dual Port Network Connection
+		8086 1179  PRO/1000 MT Dual Port Network Connection
+		8086 117a  PRO/1000 MT Dual Port Server Adapter
+# Update from mistaken ID of 82546EB
+	107a  82546GB Gigabit Ethernet Controller
+		103c 12a8  HP Dual Port 1000base-SX [A9899A]
+		8086 107a  PRO/1000 MF Dual Port Server Adapter
+		8086 127a  PRO/1000 MF Dual Port Server Adapter
+# Update from mistaken ID of 82546EB
+	107b  82546GB Gigabit Ethernet Controller
+		8086 007b  PRO/1000 MB Dual Port Server Connection
+		8086 107b  PRO/1000 MB Dual Port Server Connection
 	1130  82815 815 Chipset Host Bridge and Memory Controller Hub
 		1025 1016  Travelmate 612 TX
 		1043 8027  TUSL2-C Mainboard
@@ -6696,6 +7512,9 @@
 	1200  Intel IXP1200 Network Processor
 		172a 0000  AEP SSL Accelerator
 	1209  82559ER
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
+		4c53 1070  PC6 mainboard
 	1221  82092AA_0
 	1222  82092AA_1
 	1223  SAA7116
@@ -6744,6 +7563,7 @@
 		1014 705c  10/100 Netfinity 10/100 Ethernet Security Adapter
 		1014 805c  10/100 Netfinity 10/100 Ethernet Security Adapter
 		1028 009b  PowerEdge 2550
+		1028 00ce  PowerEdge 1400
 		1033 8000  PC-9821X-B06
 		1033 8016  PK-UG-X006
 		1033 801f  PK-UG-X006
@@ -6769,6 +7589,7 @@
 		144d 2501  SEM-2000 MiniPCI LAN Adapter
 		144d 2502  SEM-2100IL MiniPCI LAN Adapter
 		1668 1100  EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem)
+		4c53 1080  CT8 mainboard
 		8086 0001  EtherExpress PRO/100B (TX)
 		8086 0002  EtherExpress PRO/100B (T4)
 		8086 0003  EtherExpress PRO/10+
@@ -6875,6 +7696,7 @@
 	1460  82870P2 P64H2 Hub PCI Bridge
 	1461  82870P2 P64H2 I/OxAPIC
 		15d9 3480  P4DP6
+		4c53 1090  Cx9 / Vx9 mainboard
 	1462  82870P2 P64H2 Hot Plug Controller
 	1960  80960RP [i960RP Microprocessor]
 		101e 0431  MegaRAID 431 RAID Controller
@@ -6897,6 +7719,10 @@
 		1111 1111  MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC
 		1111 1112  PowerEdge Expandable RAID Controller 2/SC
 		113c 03a2  MegaRAID
+		e4bf 1010  CG1-RADIO
+		e4bf 1020  CU2-QUARTET
+		e4bf 1040  CU1-CHORUS
+		e4bf 3100  CX1-BAND
 	1962  80960RM [i960RM Microprocessor]
 		105a 0000  SuperTrak SX6000 I2O CPU
 	1a21  82840 840 (Carmel) Chipset Host Bridge (Hub A)
@@ -6997,7 +7823,8 @@
 		8086 4532  D815EEA2 mainboard
 		8086 4557  D815EGEW Mainboard
 	244c  82801BAM ISA Bridge (LPC)
-	244e  82801BA/CA/DB/EB PCI Bridge
+	244e  82801BA/CA/DB/EB/ER Hub interface to PCI Bridge
+		1014 0267  NetVista A30p
 	2450  82801E ISA Bridge (LPC)
 	2452  82801E USB
 	2453  82801E SMBus
@@ -7011,6 +7838,7 @@
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 		15d9 3480  P4DP6
 		8086 1958  vpr Matrix 170B4
+		8086 4541  Latitude C640
 	2483  82801CA/CAM SMBus Controller
 		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
@@ -7022,7 +7850,7 @@
 		15d9 3480  P4DP6
 		8086 1958  vpr Matrix 170B4
 	2485  82801CA/CAM AC'97 Audio Controller
-		1014 0222  ThinkPad T23 (2647-4MG) or A30p (2653-64G)
+		1014 0222  ThinkPad T23 (2647-4MG) or A30/A30p (2652/2653)
 		1014 0508  ThinkPad T30
 		1014 051c  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
@@ -7031,6 +7859,7 @@
 		1014 0223  ThinkPad A/T/X Series
 		1014 0503  ThinkPad R31 2656BBG
 		1014 051a  ThinkPad A/T/X Series
+		101f 1025  Acer 620 Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 		1179 0001  Toshiba Satellite 1110 Z15 internal Modem
 		134d 4c21  Dell Inspiron 2100 internal modem
@@ -7045,40 +7874,98 @@
 		1014 0220  ThinkPad A/T/X Series
 		104d 80e7  VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
 		8086 1958  vpr Matrix 170B4
+		8086 4541  Latitude C640
 	248b  82801CA Ultra ATA Storage Controller
 		15d9 3480  P4DP6
 	248c  82801CAM ISA Bridge (LPC)
-	24c0  82801DB LPC Interface Controller
+	24c0  82801DB (ICH4) LPC Bridge
+		1014 0267  NetVista A30p
 		1462 5800  845PE Max (MS-6580)
-	24c2  82801DB USB (Hub #1)
+	24c2  82801DB (ICH4) USB UHCI #1
+		1014 0267  NetVista A30p
+		1071 8160  MIM2000
 		1462 5800  845PE Max (MS-6580)
-	24c3  82801DB/DBM SMBus Controller
+	24c3  82801DB/DBM (ICH4) SMBus Controller
+		1014 0267  NetVista A30p
+		1071 8160  MIM2000
+		1458 24c2  GA-8PE667 Ultra
 		1462 5800  845PE Max (MS-6580)
-	24c4  82801DB USB (Hub #2)
+		4c53 1090  Cx9 / Vx9 mainboard
+	24c4  82801DB (ICH4) USB UHCI #2
+		1014 0267  NetVista A30p
+		1071 8160  MIM2000
 		1462 5800  845PE Max (MS-6580)
-	24c5  82801DB AC'97 Audio Controller
+		4c53 1090  Cx9 / Vx9 mainboard
+	24c5  82801DB (ICH4) AC'97 Audio Controller
+		0e11 00b8  Analog Devices Inc. codec [SoundMAX]
+		1014 0267  NetVista A30p
+		1071 8160  MIM2000
+		1458 a002  GA-8PE667 Ultra
 		1462 5800  845PE Max (MS-6580)
-	24c6  82801DB AC'97 Modem Controller
-	24c7  82801DB USB (Hub #3)
+	24c6  82801DB (ICH4) AC'97 Modem Controller
+		1071 8160  MIM2000
+	24c7  82801DB (ICH4) USB UHCI #3
+		1014 0267  NetVista A30p
+		1071 8160  MIM2000
 		1462 5800  845PE Max (MS-6580)
-	24ca  82801DBM Ultra ATA Storage Controller
-	24cb  82801DB Ultra ATA Storage Controller
+	24ca  82801DBM (ICH4) Ultra ATA Storage Controller
+		1071 8160  MIM2000
+	24cb  82801DB (ICH4) Ultra ATA 100 Storage Controller
+		1014 0267  NetVista A30p
+		1458 24c2  GA-8PE667 Ultra
 		1462 5800  845PE Max (MS-6580)
+		4c53 1090  Cx9 / Vx9 mainboard
 	24cc  82801DBM LPC Interface Controller
-	24cd  82801DB USB2
-		1462 3981  845PE Max (MS-6580) Onboard USB EHCI Controller
-	24d0  82801EB LPC Interface Controller
-	24d1  82801EB Ultra ATA Storage Controller
-	24d2  82801EB USB
-	24d3  82801EB SMBus Controller
-	24d4  82801EB USB
-	24d5  82801EB AC'97 Audio Controller
-	24d6  82801EB AC'97 Modem Controller
-	24d7  82801EB USB
-	24db  82801EB Ultra ATA Storage Controller
+	24cd  82801DB (ICH4) USB2 EHCI Controller
+		1014 0267  NetVista A30p
+		1071 8160  MIM2000
+		1462 3981  845PE Max (MS-6580)
+		4c53 1090  Cx9 / Vx9 mainboard
+	24d0  82801EB/ER (ICH5/ICH5R) LPC Bridge
+	24d1  82801EB (ICH5) Serial ATA 150 Storage Controller
+		103c 12bc  d530 CMT (DG746A)
+		1458 24d1  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+	24d2  82801EB/ER (ICH5/ICH5R) USB UHCI #1
+		103c 12bc  d530 CMT (DG746A)
+		1043 80a6  P4P800 Mainboard
+		1462 7280  865PE Neo2 (MS-6728)
+	24d3  82801EB/ER (ICH5/ICH5R) SMBus Controller
+		1043 80a6  P4P800 Mainboard
+		1458 24d2  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+	24d4  82801EB/ER (ICH5/ICH5R) USB UHCI #2
+		103c 12bc  d530 CMT (DG746A)
+		1043 80a6  P4P800 Mainboard
+		1458 24d2  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+	24d5  82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller
+		103c 12bc  Analog Devices codec [SoundMAX Integrated Digital Audio]
+		1043 80f3  P4P800 Mainboard
+		1462 7280  865PE Neo2 (MS-6728)
+	24d6  82801EB/ER (ICH5/ICH5R) AC'97 Modem Controller
+	24d7  82801EB/ER (ICH5/ICH5R) USB UHCI #3
+		103c 12bc  d530 CMT (DG746A)
+		1043 80a6  P4P800 Mainboard
+		1458 24d2  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+	24db  82801EB/ER (ICH5/ICH5R) Ultra ATA 100 Storage Controller
+		103c 12bc  d530 CMT (DG746A)
+		1043 80a6  P4P800 Mainboard
+		1458 24d2  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+		1462 7580  MSI 875P
 	24dc  82801EB LPC Interface Controller
-	24dd  82801EB USB2
-	24de  82801EB USB
+	24dd  82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller
+		103c 12bc  d530 CMT (DG746A)
+		1043 80a6  P4P800 Mainboard
+		1458 5006  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+	24de  82801EB/ER (ICH5/ICH5R) USB UHCI #4
+		1043 80a6  P4P800 Mainboard
+		1458 24d2  GA-8IPE1000 Pro2 motherboard (865PE)
+		1462 7280  865PE Neo2 (MS-6728)
+	24df  82801EB (ICH5R) SATA (cc=RAID)
 	2500  82820 820 (Camino) Chipset Host Bridge (MCH)
 		1028 0095  Precision Workstation 220 Chipset
 		1043 801c  P3C-2000 system chipset
@@ -7098,33 +7985,85 @@
 		15d9 3480  P4DP6
 	2541  E7000 Series Host RASUM Controller
 		15d9 3480  P4DP6
+		4c53 1090  Cx9 / Vx9 mainboard
 	2543  E7000 Series Hub Interface B PCI-to-PCI Bridge
 	2544  E7000 Series Hub Interface B RASUM Controller
+		4c53 1090  Cx9 / Vx9 mainboard
 	2545  E7000 Series Hub Interface C PCI-to-PCI Bridge
 	2546  E7000 Series Hub Interface C RASUM Controller
 	2547  E7000 Series Hub Interface D PCI-to-PCI Bridge
 	2548  E7000 Series Hub Interface D RASUM Controller
 	254c  E7501 Memory Controller Hub
+		4c53 1090  Cx9 / Vx9 mainboard
 	2550  E7505 Memory Controller Hub
 	2551  E7000 Series RAS Controller
 	2552  E7000 Series Processor to AGP Controller
 	2553  E7000 Series Hub Interface B PCI-to-PCI Bridge
 	2554  E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller
 	255d  E7205 Memory Controller Hub
-	2560  82845G/GL [Brookdale-G] Chipset Host Bridge
+	2560  82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface
+		1458 2560  GA-8PE667 Ultra
 		1462 5800  845PE Max (MS-6580)
-	2561  82845G/GL [Brookdale-G] Chipset AGP Bridge
-	2562  82845G/GL [Brookdale-G] Chipset Integrated Graphics Device
-	2570  82865G/PE/P Processor to I/O Controller
-	2571  82865G/PE/P Processor to AGP Controller
+	2561  82845G/GL[Brookdale-G]/GE/PE Host-to-AGP Bridge
+	2562  82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device
+		1014 0267  NetVista A30p
+	2570  82865G/PE/P DRAM Controller/Host-Hub Interface
+		1043 80f2  P4P800 Mainboard
+		1458 2570  GA-8IPE1000 Pro2 motherboard (865PE)
+	2571  82865G/PE/P PCI to AGP Controller
 	2572  82865G Integrated Graphics Device
-	2573  82865G/PE/P Processor to PCI to CSA Bridge
-	2576  82864G/PE/P Processor to I/O Memory Interface
+	2573  82865G/PE/P PCI to CSA Bridge
+	2576  82865G/PE/P Processor to I/O Memory Interface
 	2578  82875P Memory Controller Hub
+		1462 7580  MS-6758 (875P Neo)
+# Motherboard P4SCE
+		15d9 4580  Super Micro Computer Inc. P4SCE
 	2579  82875P Processor to AGP Controller
 	257b  82875P Processor to PCI to CSA Bridge
 	257e  82875P Processor to I/O Memory Interface
+	2580  Memory Controller Hub
+	2581  Memory Controller Hub PCI Express Port
+	2582  Graphics Controller
+	2584  Workstation Memory Controller Hub
+	2585  Workstation Memory Controller Hub PCI Express Port
+	2588  Server Memory Controller Hub
+	2589  Server Memory Controller Hub PCI Express Port
+	258a  Graphics Controller
+	25a1  6300ESB LPC Interface Controller
+	25a2  6300ESB PATA Storage Controller
+	25a3  6300ESB SATA Storage Controller
+	25a4  6300ESB SMBus Controller
+	25a6  6300ESB AC'97 Audio Controller
+	25a7  6300ESB AC'97 Modem Controller
+	25a9  6300ESB USB Universal Host Controller
+	25aa  6300ESB USB Universal Host Controller
+	25ab  6300ESB Watchdog Timer
+	25ac  6300ESB I/O Advanced Programmable Interrupt Controller
+	25ad  6300ESB USB2 Enhanced Host Controller
+	25ae  6300ESB 64-bit PCI-X Bridge
+	25b0  6300ESB SATA RAID Controller
+	2640  I/O Controller Hub LPC
+	2641  I/O Controller Hub LPC
+	2642  I/O Controller Hub LPC
+	2651  I/O Controller Hub SATA cc=ide
+	2652  I/O Controller Hub SATA cc=raid
+	2658  I/O Controller Hub USB
+	2659  I/O Controller Hub USB
+	265a  I/O Controller Hub USB
+	265b  I/O Controller Hub USB
+	265c  I/O Controller Hub USB2
+	2660  I/O Controller Hub PCI Express Port 0
+	2662  I/O Controller Hub PCI Express Port 1
+	2664  I/O Controller Hub PCI Express Port 2
+	2666  I/O Controller Hub PCI Express Port 3
+	2668  I/O Controller Hub Audio
+	266a  I/O Controller Hub SMBus
+	266d  I/O Controller Hub Modem
+	266e  I/O Controller Hub Audio
+	266f  I/O Controller Hub PATA
+	2782  Graphics Controller
 	3092  Integrated RAID
+	3200  GD31244 PCI-X SATA HBA
 	3340  82855PM Processor to I/O Controller
 	3341  82855PM Processor to AGP Controller
 	3575  82830 830 Chipset Host Bridge
@@ -7135,7 +8074,24 @@
 		1014 0513  ThinkPad A/T/X Series
 	3578  82830 830 Chipset Host Bridge
 	3580  82852/855GM Host Bridge
+	3581  855GME GMCH Host-to-AGP Bridge (Virtual PCI-to-PCI)
 	3582  82852/855GM Integrated Graphics Device
+	3584  855GM/GME GMCH Memory I/O Control Registers
+	3585  855GM/GME GMCH Configuration Process Registers
+	3590  Server Memory Controller Hub
+	3591  Memory Controller Hub Error Reporting Register
+	3592  Server Memory Controller Hub
+	3593  Memory Controller Hub Error Reporting Register
+	3594  Memory Controller Hub DMA Controller
+	3595  Memory Controller Hub PCI Express Port A0
+	3596  Memory Controller Hub PCI Express Port A1
+	3597  Memory Controller Hub PCI Express Port B0
+	3598  Memory Controller Hub PCI Express Port B1
+	3599  Memory Controller Hub PCI Express Port C0
+	359a  Memory Controller Hub PCI Express Port C1
+	359b  Memory Controller Hub Extended Configuration Registers
+	359e  Workstation Memory Controller Hub
+	4220  Intel(R) PRO/Wireless 2200BG
 	5200  EtherExpress PRO/100 Intelligent Server
 	5201  EtherExpress PRO/100 Intelligent Server
 		8086 0001  EtherExpress PRO/100 Server Ethernet Adapter
@@ -7144,13 +8100,18 @@
 	7010  82371SB PIIX3 IDE [Natoma/Triton II]
 	7020  82371SB PIIX3 USB [Natoma/Triton II]
 	7030  430VX - 82437VX TVX [Triton VX]
+	7050  Intel Intercast Video Capture Card
 	7100  430TX - 82439TX MTXC
 	7110  82371AB/EB/MB PIIX4 ISA
 	7111  82371AB/EB/MB PIIX4 IDE
 	7112  82371AB/EB/MB PIIX4 USB
 	7113  82371AB/EB/MB PIIX4 ACPI
 	7120  82810 GMCH [Graphics Memory Controller Hub]
+		4c53 1040  CL7 mainboard
+		4c53 1060  PC7 mainboard
 	7121  82810 CGC [Chipset Graphics Controller]
+		4c53 1040  CL7 mainboard
+		4c53 1060  PC7 mainboard
 		8086 4341  Cayman (CA810) Mainboard
 	7122  82810 DC-100 GMCH [Graphics Memory Controller Hub]
 	7123  82810 DC-100 CGC [Chipset Graphics Controller]
@@ -7163,12 +8124,17 @@
 	7181  440LX/EX - 82443LX/EX AGP bridge
 	7190  440BX/ZX/DX - 82443BX/ZX/DX Host bridge
 		0e11 0500  Armada 1750 Laptop System Chipset
-		0e11 b110  Armada M700
+		0e11 b110  Armada M700/E500
 		1179 0001  Toshiba Tecra 8100 Laptop System Chipset
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
 	7191  440BX/ZX/DX - 82443BX/ZX/DX AGP bridge
 	7192  440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)
 		0e11 0460  Armada 1700 Laptop System Chipset
+		4c53 1000  CC7/CR7/CP7/VC7/VP7/VR7 mainboard
 	7194  82440MX Host Bridge
+		1033 0000  Versa Note Vxi
+		4c53 10a0  CA3/CR3 mainboard
 	7195  82440MX AC'97 Audio Controller
 		10cf 1099  QSound_SigmaTel Stac97 PCI Audio
 		11d4 0040  SoundMAX Integrated Digital Audio
@@ -7179,8 +8145,11 @@
 	719a  82440MX USB Universal Host Controller
 	719b  82440MX Power Management Controller
 	71a0  440GX - 82443GX Host bridge
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
 	71a1  440GX - 82443GX AGP bridge
 	71a2  440GX - 82443GX Host bridge (AGP disabled)
+		4c53 1000  CC7/CR7/CP7/VC7/VP7/VR7 mainboard
 	7600  82372FB PIIX5 ISA
 	7601  82372FB PIIX5 IDE
 	7602  82372FB PIIX5 USB
@@ -7204,6 +8173,8 @@
 	84e4  460GX - 84460GX Memory Data Controller (MDC)
 	84e6  460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB)
 	84ea  460GX - 84460GX AGP Bridge (GXB function 1)
+	8500  IXP4xx Family  Network Processor (IXP420, 421, 422, 425 and IXC1100)
+	9000  Intel IXP2000 Familly Network Processor
 	9621  Integrated RAID
 	9622  Integrated RAID
 	9641  Integrated RAID
@@ -7212,16 +8183,22 @@
 # observed, and documented in Intel revision note; new mask of 1011:0026
 	b154  21154 PCI-to-PCI Bridge
 	b555  21555 Non transparent PCI-to-PCI Bridge
+		4c53 1050  CT7 mainboard
+		4c53 1051  CE7 mainboard
 		e4bf 1000  CC8-1-BLUES
 	ffff  450NX/GX [Orion] - 82453KX/GX Memory controller [BUG]
 8800  Trigem Computer Inc.
 	2008  Video assistent component
 8866  T-Square Design Inc.
 8888  Silicon Magic
+# 8c4a is not Winbond but there is a board misprogrammed
+8c4a  Winbond
+	1980  W89C940 misprogrammed [ne2k]
 8e0e  Computone Corporation
 8e2e  KTI
 	3000  ET32P2
 9004  Adaptec
+	0078  AHA-2940U_CN
 	1078  AIC-7810
 	1160  AIC-1160 [Family Fibre Channel Adapter]
 	2178  AIC-7821
@@ -7240,6 +8217,9 @@
 	5478  AIC-7850
 	5575  AVA-2930
 	5578  AIC-7855
+	5647  ANA-7711 TCP Offload Engine
+		9004 7710  ANA-7711F TCP Offload Engine - Optical
+		9004 7711  ANA-7711LP TCP Offload Engine - Copper
 	5675  AIC-755x
 	5678  AIC-7856
 	5775  AIC-755x
@@ -7331,11 +8311,13 @@
 	0010  AHA-2940U2/U2W
 		9005 2180  AHA-2940U2 SCSI Controller
 		9005 8100  AHA-2940U2B SCSI Controller
+		9005 a100  AHA-2940U2B SCSI Controller
 		9005 a180  AHA-2940U2W SCSI Controller
 		9005 e100  AHA-2950U2B SCSI Controller
 	0011  AHA-2930U2
 	0013  78902
 		9005 0003  AAA-131U2 Array1000 1 Channel RAID Controller
+		9005 000f  AIC7890_ARO
 	001f  AHA-2940U2/U2W / 7890/7891
 		9005 000f  2940U2W SCSI Controller
 		9005 a180  2940U2W SCSI Controller
@@ -7345,6 +8327,7 @@
 	003f  AIC-7890
 	0050  AHA-3940U2x/395U2x
 		9005 f500  AHA-3950U2B
+		9005 ffff  AHA-3950U2B
 	0051  AHA-3950U2D
 		9005 b500  AHA-3950U2D
 	0053  AIC-7896 SCSI Controller
@@ -7352,6 +8335,7 @@
 	005f  AIC-7896U2/7897U2
 	0080  AIC-7892A U160/m
 		0e11 e2a0  Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter
+		9005 6220  AHA-29160C
 		9005 62a0  29160N Ultra160 SCSI Controller
 		9005 e220  29160LP Low Profile Ultra160 SCSI Controller
 		9005 e2a0  29160 Ultra160 SCSI Controller
@@ -7369,23 +8353,50 @@
 	00c5  RAID subsystem HBA
 		1028 00c5  PowerEdge 2550
 	00cf  AIC-7899P U160/m
+		1028 00ce  PowerEdge 1400
 		1028 00d1  PowerEdge 2550
 		10f1 2462  Thunder K7 S2462
 		15d9 9005  Onboard SCSI Host Adapter
 	0250  ServeRAID Controller
 		1014 0279  ServeRAID-xx
 		1014 028c  ServeRAID-xx
+	0283  AAC-RAID
+		9005 0283  Catapult
+	0284  AAC-RAID
+		9005 0284  Tomcat
 	0285  AAC-RAID
+		0e11 0295  SATA 6Ch (Bearcat)
 		1028 0287  PowerEdge Expandable RAID Controller 320/DC
+		1028 0291  CERC SATA RAID 2 PCI SATA 6ch (DellCorsair)
+		17aa 0286  Legend S220 (Legend Crusader)
+		17aa 0287  Legend S230 (Legend Vulcan)
+		9005 0285  2200S (Vulcan)
+		9005 0286  2120S (Crusader)
+		9005 0287  2200S (Vulcan-2m)
+		9005 0288  3230S (Harrier)
+		9005 0289  3240S (Tornado)
+		9005 028a  ASR-2020S PCI-X ZCR (Skyhawk)
+		9005 028b  ASR-2020S SO-DIMM PCI-X ZCR (Terminator)
+		9005 0290  AAR-2410SA PCI SATA 4ch (Jaguar II)
+		9005 0292  AAR-2810SA PCI SATA 8ch (Corsair-8)
+		9005 0293  AAR-21610SA PCI SATA 16ch (Corsair-16)
+		9005 0294  ESD SO-DIMM PCI-X SATA ZCR (Prowler)
+	0286  AAC-RAID (Rocket)
+		9005 028c  ASR-2230S + ASR-2230SLP PCI-X (Lancer)
 	8000  ASC-29320A U320
 	800f  AIC-7901 U320
 	8010  ASC-39320 U320
 	8011  ASC-32320D U320
-		0e11 00ac  U320
+		0e11 00ac  ASC-39320D U320
 		9005 0041  ASC-39320D U320
 	8012  ASC-29320 U320
 	8013  ASC-29320B U320
 	8014  ASC-29320LP U320
+	8015  ASC-39320B U320
+	8016  ASC-39320A U320
+	8017  ASC-29320ALP U320
+	801c  ASC-39320D U320
+	801d  AIC-7902B U320
 	801e  AIC-7901A U320
 	801f  AIC-7902 U320
 	8080  ASC-29320A U320 w/HostRAID
@@ -7410,8 +8421,19 @@
 9699  Omni Media Technology Inc
 	6565  6565
 9710  NetMos Technology
-	9815  VScom 021H-EP2 2 port parallel adaptor
-	9835  222N-2 I/O Card (2S+1P)
+	9815  PCI 9815 Multi-I/O Controller
+		1000 0020  2P0S (2 port parallel adaptor)
+	9835  PCI 9835 Multi-I/O Controller
+		1000 0002  2S (16C550 UART)
+		1000 0012  1P2S
+	9845  PCI 9845 Multi-I/O Controller
+		1000 0006  0P6S (6 port 16550a serial card)
+	9855  PCI 9855 Multi-I/O Controller 4 Serial 1 Parallel
+		1000 0014  1P4S
+9902  Stargen Inc.
+	0001  SG2010 PCI over Starfabric Bridge
+	0002  SG2010 PCI to Starfabric Gateway
+	0003  SG1010 Starfabric Switch and PCI Bridge
 a0a0  AOPEN Inc.
 a0f1  UNISYS Corporation
 a200  NEC Corporation
@@ -7441,12 +8463,15 @@ d84d  Exsys
 dead  Indigita Corporation
 e000  Winbond
 	e000  W89C940
-e159  Tiger Jet Network Inc.
+# see : http://www.schoenfeld.de/inside/Inside_CWMK3.txt
+e159  Individual Computers - Jens Schoenfeld
 	0001  Intel 537
 		0059 0001  128k ISDN-S/T Adapter
 		0059 0003  128k ISDN-U Adapter
 	0002  Tiger100APC ISDN chipset
 e4bf  EKF Elektronik GmbH
+# Innovative and scalable network IC vendor
+e55e  Essence Technology, Inc.
 ea01  Eagle Technology
 # The main chip of all these devices is by Xilinx -> It could also be a Xilinx ID.
 ea60  RME
@@ -7486,12 +8511,17 @@ f1d0  AJA Video
 	cafe  KONA SD SMPTE 259M I/O
 	efac  KONA SD SMPTE 259M I/O
 	facd  KONA HD SMPTE 292M I/O
-fa57  Fast Search & Transfer ASA
+fa57  Interagon AS
+	0001  PMC [Pattern Matching Chip]
 febd  Ultraview Corp.
 feda  Broadcom Inc (nee Epigram)
 	a0fa  BCM4210 iLine10 HomePNA 2.0
 	a10e  BCM4230 iLine10 HomePNA 2.0
+# IT & Telecom company, develops PCI Trunk cards <www.fedetec.es>
+fede  Fedetec Inc.
+	0003  TABIC PCI v3
 fffe  VMWare Inc
+	0405  Virtual SVGA 4.0
 	0710  Virtual SVGA
 ffff  Illegal Vendor ID
 
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3a25b3c18..736a56f7f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -193,7 +193,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
 		return;
 
 	if (dev->transparent) {
-		printk("Transparent bridge - %s\n", pci_name(dev));
+		printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev));
 		for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++)
 			child->resource[i] = child->parent->resource[i];
 		return;
@@ -366,6 +366,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
 			return max;
 		busnr = (buses >> 8) & 0xFF;
 		child = pci_alloc_child_bus(bus, dev, busnr);
+		if (!child)
+			return max;
 		child->primary = buses & 0xFF;
 		child->subordinate = (buses >> 16) & 0xFF;
 		child->bridge_ctl = bctl;
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index fd3c6082e..81fd72ef1 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -89,7 +89,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
 	if ((pos & 3) && cnt > 2) {
 		unsigned short val;
 		pci_read_config_word(dev, pos, &val);
-		__put_user(cpu_to_le16(val), (unsigned short *) buf);
+		__put_user(cpu_to_le16(val), (unsigned short __user *) buf);
 		buf += 2;
 		pos += 2;
 		cnt -= 2;
@@ -98,7 +98,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
 	while (cnt >= 4) {
 		unsigned int val;
 		pci_read_config_dword(dev, pos, &val);
-		__put_user(cpu_to_le32(val), (unsigned int *) buf);
+		__put_user(cpu_to_le32(val), (unsigned int __user *) buf);
 		buf += 4;
 		pos += 4;
 		cnt -= 4;
@@ -107,7 +107,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
 	if (cnt >= 2) {
 		unsigned short val;
 		pci_read_config_word(dev, pos, &val);
-		__put_user(cpu_to_le16(val), (unsigned short *) buf);
+		__put_user(cpu_to_le16(val), (unsigned short __user *) buf);
 		buf += 2;
 		pos += 2;
 		cnt -= 2;
@@ -158,7 +158,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
 
 	if ((pos & 3) && cnt > 2) {
 		unsigned short val;
-		__get_user(val, (unsigned short *) buf);
+		__get_user(val, (unsigned short __user *) buf);
 		pci_write_config_word(dev, pos, le16_to_cpu(val));
 		buf += 2;
 		pos += 2;
@@ -167,7 +167,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
 
 	while (cnt >= 4) {
 		unsigned int val;
-		__get_user(val, (unsigned int *) buf);
+		__get_user(val, (unsigned int __user *) buf);
 		pci_write_config_dword(dev, pos, le32_to_cpu(val));
 		buf += 4;
 		pos += 4;
@@ -176,7 +176,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
 
 	if (cnt >= 2) {
 		unsigned short val;
-		__get_user(val, (unsigned short *) buf);
+		__get_user(val, (unsigned short __user *) buf);
 		pci_write_config_word(dev, pos, le16_to_cpu(val));
 		buf += 2;
 		pos += 2;
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 306cf2305..e9654640d 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -57,13 +57,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
 
 	switch (len) {
 	case 1:
-		err = put_user(byte, (unsigned char *)buf);
+		err = put_user(byte, (unsigned char __user *)buf);
 		break;
 	case 2:
-		err = put_user(word, (unsigned short *)buf);
+		err = put_user(word, (unsigned short __user *)buf);
 		break;
 	case 4:
-		err = put_user(dword, (unsigned int *)buf);
+		err = put_user(dword, (unsigned int __user *)buf);
 		break;
 	};
 	return err;
@@ -74,13 +74,13 @@ error:
 	   they get instead of a machine check on x86.  */
 	switch (len) {
 	case 1:
-		put_user(-1, (unsigned char *)buf);
+		put_user(-1, (unsigned char __user *)buf);
 		break;
 	case 2:
-		put_user(-1, (unsigned short *)buf);
+		put_user(-1, (unsigned short __user *)buf);
 		break;
 	case 4:
-		put_user(-1, (unsigned int *)buf);
+		put_user(-1, (unsigned int __user *)buf);
 		break;
 	};
 	return err;
@@ -106,7 +106,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
 	lock_kernel();
 	switch(len) {
 	case 1:
-		err = get_user(byte, (u8 *)buf);
+		err = get_user(byte, (u8 __user *)buf);
 		if (err)
 			break;
 		err = pci_write_config_byte(dev, off, byte);
@@ -115,7 +115,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
 		break;
 
 	case 2:
-		err = get_user(word, (u16 *)buf);
+		err = get_user(word, (u16 __user *)buf);
 		if (err)
 			break;
 		err = pci_write_config_word(dev, off, word);
@@ -124,7 +124,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
 		break;
 
 	case 4:
-		err = get_user(dword, (u32 *)buf);
+		err = get_user(dword, (u32 __user *)buf);
 		if (err)
 			break;
 		err = pci_write_config_dword(dev, off, dword);
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 71b6ac4d7..32ed7a0ce 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -120,6 +120,13 @@ config PCMCIA_SA1111
 
 	  This driver is also available as a module called sa1111_cs.
 
+config PCMCIA_PXA2XX
+	tristate "PXA2xx support"
+	depends on ARM && ARCH_PXA && PCMCIA
+	help
+	  Say Y here to include support for the PXA2xx PCMCIA controller
+
+
 config PCMCIA_PROBE
 	bool
 	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 82aeec31c..160f73eef 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -15,10 +15,14 @@ obj-$(CONFIG_TCIC)				+= tcic.o
 obj-$(CONFIG_HD64465_PCMCIA)			+= hd64465_ss.o
 obj-$(CONFIG_PCMCIA_SA1100)			+= sa11xx_core.o sa1100_cs.o
 obj-$(CONFIG_PCMCIA_SA1111)			+= sa11xx_core.o sa1111_cs.o
+obj-$(CONFIG_PCMCIA_PXA2XX)                     += pxa2xx_core.o pxa2xx_cs.o
 
 pcmcia_core-y					+= cistpl.o rsrc_mgr.o bulkmem.o cs.o
 pcmcia_core-$(CONFIG_CARDBUS)			+= cardbus.o
 
+sa11xx_core-y					+= soc_common.o sa11xx_base.o
+pxa2xx_core-y					+= soc_common.o pxa2xx_base.o
+
 sa1111_cs-y					+= sa1111_generic.o
 sa1111_cs-$(CONFIG_SA1100_ADSBITSY)		+= sa1100_adsbitsy.o
 sa1111_cs-$(CONFIG_ASSABET_NEPONSET)		+= sa1100_neponset.o
@@ -42,3 +46,7 @@ sa1100_cs-$(CONFIG_SA1100_SIMPAD)		+= sa1100_simpad.o
 sa1100_cs-$(CONFIG_SA1100_STORK)		+= sa1100_stork.o
 sa1100_cs-$(CONFIG_SA1100_TRIZEPS) 		+= sa1100_trizeps.o
 sa1100_cs-$(CONFIG_SA1100_YOPY)			+= sa1100_yopy.o
+
+pxa2xx_cs-$(CONFIG_ARCH_LUBBOCK)		+= pxa2xx_lubbock.o sa1111_generic.o
+pxa2xx_cs-$(CONFIG_MACH_MAINSTONE)		+= pxa2xx_mainstone.o
+
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 3763e1dbb..06462389a 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -789,9 +789,10 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
 	    return 1;
     for (i = 0; i < MAX_IO_WIN; i++) {
 	if (s->io[i].NumPorts == 0) {
-	    if (find_io_region(base, num, align, name, s) == 0) {
+	    s->io[i].res = find_io_region(*base, num, align, name, s);
+	    if (s->io[i].res) {
 		s->io[i].Attributes = attr;
-		s->io[i].BasePort = *base;
+		s->io[i].BasePort = *base = s->io[i].res->start;
 		s->io[i].NumPorts = s->io[i].InUse = num;
 		break;
 	    } else
@@ -801,7 +802,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
 	/* Try to extend top of window */
 	try = s->io[i].BasePort + s->io[i].NumPorts;
 	if ((*base == 0) || (*base == try))
-	    if (find_io_region(&try, num, 0, name, s) == 0) {
+	    if (adjust_io_region(s->io[i].res, s->io[i].res->start,
+				 s->io[i].res->end + num, s) == 0) {
 		*base = try;
 		s->io[i].NumPorts += num;
 		s->io[i].InUse += num;
@@ -810,7 +812,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base,
 	/* Try to extend bottom of window */
 	try = s->io[i].BasePort - num;
 	if ((*base == 0) || (*base == try))
-	    if (find_io_region(&try, num, 0, name, s) == 0) {
+	    if (adjust_io_region(s->io[i].res, s->io[i].res->start - num,
+				 s->io[i].res->end, s) == 0) {
 		s->io[i].BasePort = *base = try;
 		s->io[i].NumPorts += num;
 		s->io[i].InUse += num;
@@ -824,15 +827,18 @@ static void release_io_space(struct pcmcia_socket *s, ioaddr_t base,
 			     ioaddr_t num)
 {
     int i;
-    if(!(s->features & SS_CAP_STATIC_MAP))
-	release_region(base, num);
+
     for (i = 0; i < MAX_IO_WIN; i++) {
 	if ((s->io[i].BasePort <= base) &&
 	    (s->io[i].BasePort+s->io[i].NumPorts >= base+num)) {
 	    s->io[i].InUse -= num;
 	    /* Free the window if no one else is using it */
-	    if (s->io[i].InUse == 0)
+	    if (s->io[i].InUse == 0) {
 		s->io[i].NumPorts = 0;
+		release_resource(s->io[i].res);
+		kfree(s->io[i].res);
+		s->io[i].res = NULL;
+	    }
 	}
     }
 }
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 3bc76aeef..41b94af07 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -181,8 +181,10 @@ int copy_memory(memory_handle_t handle, copy_op_t *req);
 
 /* In rsrc_mgr */
 void validate_mem(struct pcmcia_socket *s);
-int find_io_region(ioaddr_t *base, ioaddr_t num, unsigned long align,
+struct resource *find_io_region(unsigned long base, int num, unsigned long align,
 		   char *name, struct pcmcia_socket *s);
+int adjust_io_region(struct resource *res, unsigned long r_start,
+		     unsigned long r_end, struct pcmcia_socket *s);
 int find_mem_region(u_long *base, u_long num, u_long align,
 		    int low, char *name, struct pcmcia_socket *s);
 int try_irq(u_int Attributes, int irq, int specific);
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 7e93bfccb..d5d487e79 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -797,7 +797,7 @@ out:
 
 /*====================================================================*/
 
-static ssize_t ds_read(struct file *file, char *buf,
+static ssize_t ds_read(struct file *file, char __user *buf,
 		       size_t count, loff_t *ppos)
 {
     struct pcmcia_bus_socket *s;
@@ -819,14 +819,14 @@ static ssize_t ds_read(struct file *file, char *buf,
 
     ret = wait_event_interruptible(s->queue, !queue_empty(user));
     if (ret == 0)
-	ret = put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
+	ret = put_user(get_queued_event(user), (int __user *)buf) ? -EFAULT : 4;
 
     return ret;
 } /* ds_read */
 
 /*====================================================================*/
 
-static ssize_t ds_write(struct file *file, const char *buf,
+static ssize_t ds_write(struct file *file, const char __user *buf,
 			size_t count, loff_t *ppos)
 {
     struct pcmcia_bus_socket *s;
@@ -849,7 +849,7 @@ static ssize_t ds_write(struct file *file, const char *buf,
 
     if (s->req_pending) {
 	s->req_pending--;
-	get_user(s->req_result, (int *)buf);
+	get_user(s->req_result, (int __user *)buf);
 	if ((s->req_result != 0) || (s->req_pending == 0))
 	    wake_up_interruptible(&s->request);
     } else
@@ -888,6 +888,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 		    u_int cmd, u_long arg)
 {
     struct pcmcia_bus_socket *s;
+    void __user *uarg = (char __user *)arg;
     u_int size;
     int ret, err;
     ds_ioctl_arg_t buf;
@@ -911,14 +912,14 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 	return -EPERM;
 	
     if (cmd & IOC_IN) {
-	err = verify_area(VERIFY_READ, (char *)arg, size);
+	err = verify_area(VERIFY_READ, uarg, size);
 	if (err) {
 	    ds_dbg(3, "ds_ioctl(): verify_read = %d\n", err);
 	    return err;
 	}
     }
     if (cmd & IOC_OUT) {
-	err = verify_area(VERIFY_WRITE, (char *)arg, size);
+	err = verify_area(VERIFY_WRITE, uarg, size);
 	if (err) {
 	    ds_dbg(3, "ds_ioctl(): verify_write = %d\n", err);
 	    return err;
@@ -927,7 +928,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
     
     err = ret = 0;
     
-    if (cmd & IOC_IN) __copy_from_user((char *)&buf, (char *)arg, size);
+    if (cmd & IOC_IN) __copy_from_user((char *)&buf, uarg, size);
     
     switch (cmd) {
     case DS_ADJUST_RESOURCE_INFO:
@@ -1042,7 +1043,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 	}
     }
 
-    if (cmd & IOC_OUT) __copy_to_user((char *)arg, (char *)&buf, size);
+    if (cmd & IOC_OUT) __copy_to_user(uarg, (char *)&buf, size);
 
     return err;
 } /* ds_ioctl */
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index ec5ff85cd..e98adb10c 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -68,7 +68,7 @@
 #include "o2micro.h"
 
 #ifdef DEBUG
-static const char *version =
+static const char version[] =
 "i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)";
 
 static int pc_debug;
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index d595ba757..491d11bc8 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -22,7 +22,6 @@
 #include <linux/cpufreq.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/notifier.h>
 #include <linux/spinlock.h>
 
 #include <asm/hardware.h>
@@ -113,26 +112,59 @@ static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock )
 	return 0;
 }
 
-static int pxa2xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int lclk)
+static int pxa2xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int clk)
 {
 	struct soc_pcmcia_timing timing;
 	int sock = skt->nr;
 
 	soc_common_pcmcia_get_timing(skt, &timing);
 
-	pxa2xx_pcmcia_set_mcmem(sock, timing.mem, lclk);
-	pxa2xx_pcmcia_set_mcatt(sock, timing.attr, lclk);
-	pxa2xx_pcmcia_set_mcio(sock, timing.io, lclk);
+	pxa2xx_pcmcia_set_mcmem(sock, timing.mem, clk);
+	pxa2xx_pcmcia_set_mcatt(sock, timing.attr, clk);
+	pxa2xx_pcmcia_set_mcio(sock, timing.io, clk);
 
 	return 0;
 }
 
 static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
 {
-	unsigned int lclk = get_lclk_frequency_10khz();
-	return pxa2xx_pcmcia_set_mcxx(skt, lclk);
+	unsigned int clk = get_memclk_frequency_10khz();
+	return pxa2xx_pcmcia_set_mcxx(skt, clk);
 }
 
+#ifdef CONFIG_CPU_FREQ
+
+static int
+pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
+			       unsigned long val,
+			       struct cpufreq_freqs *freqs)
+{
+#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
+	switch (val) {
+	case CPUFREQ_PRECHANGE:
+		if (freqs->new > freqs->old) {
+			debug(skt, 2, "new frequency %u.%uMHz > %u.%uMHz, "
+			       "pre-updating\n",
+			       freqs->new / 1000, (freqs->new / 100) % 10,
+			       freqs->old / 1000, (freqs->old / 100) % 10);
+			pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+		}
+		break;
+
+	case CPUFREQ_POSTCHANGE:
+		if (freqs->new < freqs->old) {
+			debug(skt, 2, "new frequency %u.%uMHz < %u.%uMHz, "
+			       "post-updating\n",
+			       freqs->new / 1000, (freqs->new / 100) % 10,
+			       freqs->old / 1000, (freqs->old / 100) % 10);
+			pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+		}
+		break;
+	}
+	return 0;
+}
+#endif
+
 int pxa2xx_drv_pcmcia_probe(struct device *dev)
 {
 	int ret;
@@ -181,6 +213,9 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev)
 
 	/* Provide our PXA2xx specific timing routines. */
 	ops->set_timing  = pxa2xx_pcmcia_set_timing;
+#ifdef CONFIG_CPU_FREQ
+	ops->frequency_change = pxa2xx_pcmcia_frequency_change;
+#endif
 
 	ret = soc_common_drv_pcmcia_probe(dev, ops, first, nr);
 
@@ -227,101 +262,13 @@ static struct device_driver pxa2xx_pcmcia_driver = {
 	.bus		= &platform_bus_type,
 };
 
-#ifdef CONFIG_CPU_FREQ
-
-/*
- * When pxa2xx_pcmcia_notifier() decides that a MC{IO,MEM,ATT} adjustment (due
- * to a core clock frequency change) is needed, this routine establishes
- * new values consistent with the clock speed `clock'.
- */
-static void pxa2xx_pcmcia_update_mcxx(unsigned int clock)
-{
-	struct soc_pcmcia_socket *skt;
-
-	down(&soc_sockets_lock);
-	list_for_each_entry(skt, &soc_sockets, node) {
-		pxa2xx_pcmcia_set_mcxx(skt, clock);
-	}
-	up(&soc_sockets_lock);
-}
-
-/*
- * When changing the processor L clock frequency, it is necessary
- * to adjust the MCXX timings accordingly. We've recorded the timings
- * requested by Card Services, so this is just a matter of finding
- * out what our current speed is, and then recomputing the new MCXX
- * values.
- *
- * Returns: 0 on success, -1 on error
- */
-static int
-pxa2xx_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
-{
-	struct cpufreq_freqs *freqs = data;
-
-#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
-	switch (val) {
-		case CPUFREQ_PRECHANGE:
-			if (freqs->new > freqs->old) {
-				debug( 2, "new frequency %u.%uMHz > %u.%uMHz, "
-						"pre-updating\n",
-						freqs->new / 1000, (freqs->new / 100) % 10,
-						freqs->old / 1000, (freqs->old / 100) % 10);
-				pxa2xx_pcmcia_update_mcxx(freqs->new);
-			}
-			break;
-
-		case CPUFREQ_POSTCHANGE:
-			if (freqs->new < freqs->old) {
-				debug( 2, "new frequency %u.%uMHz < %u.%uMHz, "
-						"post-updating\n",
-						freqs->new / 1000, (freqs->new / 100) % 10,
-						freqs->old / 1000, (freqs->old / 100) % 10);
-				pxa2xx_pcmcia_update_mcxx(freqs->new);
-			}
-			break;
-	}
-
-	return 0;
-}
-
-static struct notifier_block pxa2xx_pcmcia_notifier_block = {
-	.notifier_call	= pxa2xx_pcmcia_notifier
-};
-
-static int __init pxa2xx_pcmcia_cpufreq_init(void)
-{
-	int ret;
-
-	ret = cpufreq_register_notifier(&pxa2xx_pcmcia_notifier_block,
-					CPUFREQ_TRANSITION_NOTIFIER);
-	if (ret < 0)
-		printk(KERN_ERR "Unable to register CPU frequency change "
-				"notifier for PCMCIA (%d)\n", ret);
-	return ret;
-}
-
-static void __exit pxa2xx_pcmcia_cpufreq_exit(void)
-{
-	cpufreq_unregister_notifier(&pxa2xx_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
-}
-
-#else
-#define pxa2xx_pcmcia_cpufreq_init()
-#define pxa2xx_pcmcia_cpufreq_exit()
-#endif
-
 static int __init pxa2xx_pcmcia_init(void)
 {
-	int ret = driver_register(&pxa2xx_pcmcia_driver);
-	if (ret == 0)
-		pxa2xx_pcmcia_cpufreq_init();
-	return ret;
+	return driver_register(&pxa2xx_pcmcia_driver);
 }
 
 static void __exit pxa2xx_pcmcia_exit(void)
 {
-	pxa2xx_pcmcia_cpufreq_exit();
 	driver_unregister(&pxa2xx_pcmcia_driver);
 }
 
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c
index c18f28605..e22a57a4a 100644
--- a/drivers/pcmcia/pxa2xx_lubbock.c
+++ b/drivers/pcmcia/pxa2xx_lubbock.c
@@ -25,6 +25,7 @@
 #include <asm/hardware.h>
 #include <asm/hardware/sa1111.h>
 #include <asm/mach-types.h>
+#include <asm/arch/lubbock.h>
 
 #include "sa1111_generic.h"
 
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
index af85842ee..fe62a597d 100644
--- a/drivers/pcmcia/pxa2xx_mainstone.c
+++ b/drivers/pcmcia/pxa2xx_mainstone.c
@@ -24,6 +24,8 @@
 #include <asm/hardware.h>
 #include <asm/irq.h>
 
+#include <asm/arch/mainstone.h>
+
 #include "soc_common.h"
 
 
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 8aeb21af0..2e606be98 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -550,7 +550,7 @@ pcmcia_align(void *align_data, struct resource *res,
 
 	for (m = data->map->next; m != data->map; m = m->next) {
 		unsigned long start = m->base;
-		unsigned long end = m->base + m->num;
+		unsigned long end = m->base + m->num - 1;
 
 		/*
 		 * If the lower resources are not available, try aligning
@@ -569,7 +569,7 @@ pcmcia_align(void *align_data, struct resource *res,
 		if (res->start >= res->end)
 			break;
 
-		if ((res->start + size) <= end)
+		if ((res->start + size - 1) <= end)
 			break;
 	}
 
@@ -580,6 +580,32 @@ pcmcia_align(void *align_data, struct resource *res,
 		res->start = res->end;
 }
 
+/*
+ * Adjust an existing IO region allocation, but making sure that we don't
+ * encroach outside the resources which the user supplied.
+ */
+int adjust_io_region(struct resource *res, unsigned long r_start,
+		     unsigned long r_end, struct pcmcia_socket *s)
+{
+	resource_map_t *m;
+	int ret = -ENOMEM;
+
+	down(&rsrc_sem);
+	for (m = io_db.next; m != &io_db; m = m->next) {
+		unsigned long start = m->base;
+		unsigned long end = m->base + m->num - 1;
+
+		if (start > r_start || r_end > end)
+			continue;
+
+		ret = adjust_resource(res, r_start, r_end - r_start + 1);
+		break;
+	}
+	up(&rsrc_sem);
+
+	return ret;
+}
+
 /*======================================================================
 
     These find ranges of I/O ports or memory addresses that are not
@@ -593,40 +619,37 @@ pcmcia_align(void *align_data, struct resource *res,
     
 ======================================================================*/
 
-int find_io_region(ioaddr_t *base, ioaddr_t num, unsigned long align,
-		   char *name, struct pcmcia_socket *s)
+struct resource *find_io_region(unsigned long base, int num,
+		   unsigned long align, char *name, struct pcmcia_socket *s)
 {
 	struct resource *res = make_resource(0, num, IORESOURCE_IO, name);
 	struct pcmcia_align_data data;
-	unsigned long min = *base;
+	unsigned long min = base;
 	int ret;
 
 	if (align == 0)
 		align = 0x10000;
 
 	data.mask = align - 1;
-	data.offset = *base & data.mask;
+	data.offset = base & data.mask;
 	data.map = &io_db;
 
+	down(&rsrc_sem);
 #ifdef CONFIG_PCI
 	if (s->cb_dev) {
 		ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,
 					     min, 0, pcmcia_align, &data);
 	} else
 #endif
-	{
-		down(&rsrc_sem);
 		ret = allocate_resource(&ioport_resource, res, num, min, ~0UL, 0,
 					pcmcia_align, &data);
-		up(&rsrc_sem);
-	}
+	up(&rsrc_sem);
 
 	if (ret != 0) {
 		kfree(res);
-	} else {
-		*base = res->start;
+		res = NULL;
 	}
-	return ret;
+	return res;
 }
 
 int find_mem_region(u_long *base, u_long num, u_long align,
@@ -652,6 +675,7 @@ int find_mem_region(u_long *base, u_long num, u_long align,
 			min = 0x100000UL + *base;
 		}
 
+		down(&rsrc_sem);
 #ifdef CONFIG_PCI
 		if (s->cb_dev) {
 			ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num,
@@ -659,12 +683,9 @@ int find_mem_region(u_long *base, u_long num, u_long align,
 						     pcmcia_align, &data);
 		} else
 #endif
-		{
-			down(&rsrc_sem);
 			ret = allocate_resource(&iomem_resource, res, num, min,
 						max, 0, pcmcia_align, &data);
-			up(&rsrc_sem);
-		}
+		up(&rsrc_sem);
 		if (ret == 0 || low)
 			break;
 		low = 1;
diff --git a/drivers/pcmcia/sa1100_adsbitsy.c b/drivers/pcmcia/sa1100_adsbitsy.c
index c60c66b0e..1bed35370 100644
--- a/drivers/pcmcia/sa1100_adsbitsy.c
+++ b/drivers/pcmcia/sa1100_adsbitsy.c
@@ -20,7 +20,7 @@
 
 #include "sa1111_generic.h"
 
-static int adsbitsy_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int adsbitsy_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	/* Set GPIO_A<3:0> to be outputs for PCMCIA/CF power controller: */
 	PA_DDR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
@@ -35,7 +35,7 @@ static int adsbitsy_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 }
 
 static int
-adsbitsy_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+adsbitsy_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
 	unsigned int pa_dwr_mask, pa_dwr_set;
 	int ret;
diff --git a/drivers/pcmcia/sa1100_assabet.c b/drivers/pcmcia/sa1100_assabet.c
index 884a655ef..7c57fdd3c 100644
--- a/drivers/pcmcia/sa1100_assabet.c
+++ b/drivers/pcmcia/sa1100_assabet.c
@@ -25,23 +25,23 @@ static struct pcmcia_irqs irqs[] = {
 	{ 1, ASSABET_IRQ_GPIO_CF_BVD1, "CF BVD1" },
 };
 
-static int assabet_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int assabet_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = ASSABET_IRQ_GPIO_CF_IRQ;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 /*
  * Release all resources.
  */
-static void assabet_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void assabet_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static void
-assabet_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+assabet_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR;
 
@@ -55,7 +55,7 @@ assabet_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_stat
 }
 
 static int
-assabet_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+assabet_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
 	unsigned int mask;
 
@@ -93,22 +93,22 @@ assabet_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_s
  * be called at initialisation, power management event, or
  * pcmcia event.
  */
-static void assabet_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void assabet_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
 	/*
 	 * Enable CF bus
 	 */
 	ASSABET_BCR_clear(ASSABET_BCR_CF_BUS_OFF);
 
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 /*
  * Disable card status IRQs on suspend.
  */
-static void assabet_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void assabet_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 	/*
 	 * Tristate the CF bus signals.  Also assert CF
diff --git a/drivers/pcmcia/sa1100_badge4.c b/drivers/pcmcia/sa1100_badge4.c
index 6a70fb609..c6b262b65 100644
--- a/drivers/pcmcia/sa1100_badge4.c
+++ b/drivers/pcmcia/sa1100_badge4.c
@@ -75,7 +75,7 @@ static void complain_about_jumpering(const char *whom,
 }
 
 static int
-badge4_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+badge4_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
 	int ret;
 
diff --git a/drivers/pcmcia/sa1100_cerf.c b/drivers/pcmcia/sa1100_cerf.c
index cd671b6ed..2b3c2895b 100644
--- a/drivers/pcmcia/sa1100_cerf.c
+++ b/drivers/pcmcia/sa1100_cerf.c
@@ -27,20 +27,20 @@ static struct pcmcia_irqs irqs[] = {
 	{ CERF_SOCKET, CERF_IRQ_GPIO_CF_BVD1, "CF_BVD1" }
 };
 
-static int cerf_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int cerf_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = CERF_IRQ_GPIO_CF_IRQ;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void cerf_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void cerf_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static void
-cerf_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+cerf_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR;
 
@@ -54,7 +54,7 @@ cerf_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *
 }
 
 static int
-cerf_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+cerf_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 			     const socket_state_t *state)
 {
 	switch (state->Vcc) {
@@ -78,14 +78,14 @@ cerf_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void cerf_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void cerf_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void cerf_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void cerf_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static struct pcmcia_low_level cerf_pcmcia_ops = { 
diff --git a/drivers/pcmcia/sa1100_flexanet.c b/drivers/pcmcia/sa1100_flexanet.c
index 538f84c36..e48ef9997 100644
--- a/drivers/pcmcia/sa1100_flexanet.c
+++ b/drivers/pcmcia/sa1100_flexanet.c
@@ -28,20 +28,20 @@ static struct pcmcia_irqs irqs[] = {
  *
  * Called by sa1100_pcmcia_driver_init on startup.
  */
-static int flexanet_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int flexanet_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = skt->nr ? IRQ_GPIO_CF2_IRQ : IRQ_GPIO_CF1_IRQ;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 
 /*
  * Socket shutdown
  */
-static void flexanet_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void flexanet_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 
@@ -52,7 +52,7 @@ static void flexanet_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
  *
  */
 static void
-flexanet_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+flexanet_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			     struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR; /* Sense the GPIOs, asynchronously */
@@ -85,7 +85,7 @@ flexanet_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
  *
  */
 static int
-flexanet_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+flexanet_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				 const socket_state_t *state)
 {
 	unsigned long value, flags, mask;
@@ -133,14 +133,14 @@ flexanet_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void flexanet_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void flexanet_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void flexanet_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void flexanet_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 /*
diff --git a/drivers/pcmcia/sa1100_freebird.c b/drivers/pcmcia/sa1100_freebird.c
index 57c77d935..8dd00f04d 100644
--- a/drivers/pcmcia/sa1100_freebird.c
+++ b/drivers/pcmcia/sa1100_freebird.c
@@ -20,7 +20,7 @@ static struct pcmcia_irqs irqs[] = {
 	{ 0, IRQ_GPIO_FREEBIRD_CF_BVD, "CF_BVD1" },
 };
 
-static int freebird_pcmcia_init(struct sa1100_pcmcia_socket *skt)
+static int freebird_pcmcia_init(struct soc_pcmcia_socket *skt)
 {
 	/* Enable Linkup CF card */
 	LINKUP_PRC = 0xc0;
@@ -35,12 +35,12 @@ static int freebird_pcmcia_init(struct sa1100_pcmcia_socket *skt)
 
 	skt->irq = IRQ_GPIO_FREEBIRD_CF_IRQ;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void freebird_pcmcia_shutdown(struct sa1100_pcmcia_socket *skt)
+static void freebird_pcmcia_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs);
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs);
 
 	/* Disable CF card */
 	LINKUP_PRC = 0x40;  /* SSP=1   SOE=0 */
@@ -48,7 +48,7 @@ static void freebird_pcmcia_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-freebird_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+freebird_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	unsigned long levels = LINKUP_PRS;
 //	printk("LINKUP_PRS=%x\n",levels);
@@ -63,7 +63,7 @@ freebird_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_sta
 }
 
 static int
-freebird_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+freebird_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				 socket_state_t *state)
 {
 	unsigned long value, flags;
@@ -103,14 +103,14 @@ freebird_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void freebird_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void freebird_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void freebird_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void freebird_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static struct pcmcia_low_level freebird_pcmcia_ops = {
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 8f345309d..ceeed4fb4 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -43,7 +43,7 @@
 #include <pcmcia/cs.h>
 #include <pcmcia/ss.h>
 
-#include "sa1100.h"
+#include "sa1100_generic.h"
 
 static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
 #ifdef CONFIG_SA1100_ASSABET
@@ -118,7 +118,7 @@ static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level)
 
 static struct device_driver sa11x0_pcmcia_driver = {
 	.probe		= sa11x0_drv_pcmcia_probe,
-	.remove		= sa11xx_drv_pcmcia_remove,
+	.remove		= soc_common_drv_pcmcia_remove,
 	.name		= "sa11x0-pcmcia",
 	.bus		= &platform_bus_type,
 	.suspend 	= sa11x0_drv_pcmcia_suspend,
diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h
index d00458fcb..794f96a35 100644
--- a/drivers/pcmcia/sa1100_generic.h
+++ b/drivers/pcmcia/sa1100_generic.h
@@ -1,4 +1,5 @@
-#include "sa11xx_core.h"
+#include "soc_common.h"
+#include "sa11xx_base.h"
 
 /*
  * Declaration for all machine specific init/exit functions.
diff --git a/drivers/pcmcia/sa1100_graphicsclient.c b/drivers/pcmcia/sa1100_graphicsclient.c
index 0960b4812..08b5a9dff 100644
--- a/drivers/pcmcia/sa1100_graphicsclient.c
+++ b/drivers/pcmcia/sa1100_graphicsclient.c
@@ -38,7 +38,7 @@ static struct pcmcia_irqs irqs[] = {
 	{ 0, S0_CD_IRQ, "PCMCIA 0 CD" },
 };
 
-static int gcplus_pcmcia_init(struct sa1100_pcmcia_socket *skt)
+static int gcplus_pcmcia_init(struct soc_pcmcia_socket *skt)
 {
 	// Reset PCMCIA
 	// Reset Timing for CPLD(U2) version 8001E or later
@@ -54,10 +54,10 @@ static int gcplus_pcmcia_init(struct sa1100_pcmcia_socket *skt)
 	skt->irq = S0_STS_IRQ;
 
 	/* Register interrupts */
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void gcplus_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void gcplus_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
 	/* disable IRQs */
 	free_irq(S0_CD_IRQ, skt);
@@ -68,7 +68,7 @@ static void gcplus_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-gcplus_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+gcplus_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	unsigned long levels = *PCMCIA_Status;
 
@@ -82,7 +82,7 @@ gcplus_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state
 }
 
 static int
-gcplus_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+gcplus_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 			       const socket_state_t *state)
 {
 	unsigned long flags;
@@ -125,11 +125,11 @@ gcplus_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void gcplus_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void gcplus_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
 }
 
-static void gcplus_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void gcplus_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
 }
 
diff --git a/drivers/pcmcia/sa1100_graphicsmaster.c b/drivers/pcmcia/sa1100_graphicsmaster.c
index 79ed49ab2..01b5c41a4 100644
--- a/drivers/pcmcia/sa1100_graphicsmaster.c
+++ b/drivers/pcmcia/sa1100_graphicsmaster.c
@@ -19,7 +19,7 @@
 
 #include "sa1111_generic.h"
 
-static int graphicsmaster_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int graphicsmaster_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
   int return_val=0;
 
@@ -36,7 +36,7 @@ static int graphicsmaster_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 }
 
 static int
-graphicsmaster_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+graphicsmaster_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				       const socket_state_t *state)
 {
 	unsigned int pa_dwr_mask, pa_dwr_set;
diff --git a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c
index 76c78ad37..e442953b3 100644
--- a/drivers/pcmcia/sa1100_h3600.c
+++ b/drivers/pcmcia/sa1100_h3600.c
@@ -23,18 +23,18 @@ static struct pcmcia_irqs irqs[] = {
 	{ 1, IRQ_GPIO_H3600_PCMCIA_CD1, "PCMCIA CD1" }
 };
 
-static int h3600_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = skt->nr ? IRQ_GPIO_H3600_PCMCIA_IRQ1
 			   : IRQ_GPIO_H3600_PCMCIA_IRQ0;
 
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void h3600_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void h3600_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
   
 	/* Disable CF bus: */
 	clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON);
@@ -43,7 +43,7 @@ static void h3600_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-h3600_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+h3600_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR;
 
@@ -71,7 +71,7 @@ h3600_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state
 }
 
 static int
-h3600_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
 	if (state->Vcc != 0 && state->Vcc != 33 && state->Vcc != 50) {
 		printk(KERN_ERR "h3600_pcmcia: unrecognized Vcc %u.%uV\n",
@@ -89,7 +89,7 @@ h3600_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_sta
 	return 0;
 }
 
-static void h3600_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
 	/* Enable CF bus: */
 	set_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON);
@@ -99,12 +99,12 @@ static void h3600_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(10*HZ / 1000);
 
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void h3600_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void h3600_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 	/*
 	 * FIXME:  This doesn't fit well.  We don't have the mechanism in
diff --git a/drivers/pcmcia/sa1100_jornada720.c b/drivers/pcmcia/sa1100_jornada720.c
index 84156d182..0a387106a 100644
--- a/drivers/pcmcia/sa1100_jornada720.c
+++ b/drivers/pcmcia/sa1100_jornada720.c
@@ -23,7 +23,7 @@
 #warning *** Does SOCKET1_3V actually do anything?
 #define SOCKET1_3V	GPIO_GPIO3
 
-static int jornada720_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
   /*
    * What is all this crap for?
@@ -49,7 +49,7 @@ static int jornada720_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 }
 
 static int
-jornada720_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
   unsigned int pa_dwr_mask, pa_dwr_set;
   int ret;
diff --git a/drivers/pcmcia/sa1100_neponset.c b/drivers/pcmcia/sa1100_neponset.c
index ccc86961a..5e34b3e8e 100644
--- a/drivers/pcmcia/sa1100_neponset.c
+++ b/drivers/pcmcia/sa1100_neponset.c
@@ -42,7 +42,7 @@
  */
 
 static int
-neponset_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
 	unsigned int ncr_mask, ncr_set, pa_dwr_mask, pa_dwr_set;
 	int ret;
@@ -106,7 +106,7 @@ neponset_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_
 	return 0;
 }
 
-static void neponset_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void neponset_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
 	if (skt->nr == 0)
 		NCR_0 &= ~(NCR_A0VPP | NCR_A1VPP);
diff --git a/drivers/pcmcia/sa1100_pangolin.c b/drivers/pcmcia/sa1100_pangolin.c
index c32504b5b..44d19f2dc 100644
--- a/drivers/pcmcia/sa1100_pangolin.c
+++ b/drivers/pcmcia/sa1100_pangolin.c
@@ -26,7 +26,7 @@ static struct pcmcia_irqs irqs[] = {
 	{ PANGOLIN_SOCK, IRQ_PCMCIA_CD, "PCMCIA CD" },
 };
 
-static int pangolin_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int pangolin_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	int res;
 
@@ -37,12 +37,12 @@ static int pangolin_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 
 	skt->irq = IRQ_PCMCIA_IRQ;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void pangolin_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void pangolin_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 #ifndef CONFIG_SA1100_PANGOLIN_PCMCIA_IDE
 	/* Disable PCMCIA bus: */
@@ -51,7 +51,7 @@ static void pangolin_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-pangolin_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+pangolin_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			     struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR;
@@ -66,7 +66,7 @@ pangolin_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
 }
 
 static int
-pangolin_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+pangolin_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				 const socket_state_t *state)
 {
 	unsigned long value, flags;
@@ -115,14 +115,14 @@ pangolin_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void pangolin_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void pangolin_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void pangolin_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void pangolin_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static struct pcmcia_low_level pangolin_pcmcia_ops = { 
diff --git a/drivers/pcmcia/sa1100_pfs168.c b/drivers/pcmcia/sa1100_pfs168.c
index dc7b995be..6dab93a49 100644
--- a/drivers/pcmcia/sa1100_pfs168.c
+++ b/drivers/pcmcia/sa1100_pfs168.c
@@ -18,7 +18,7 @@
 
 #include "sa1111_generic.h"
 
-static int pfs168_pcmcia_init(struct sa1100_pcmcia_socket *skt)
+static int pfs168_pcmcia_init(struct soc_pcmcia_socket *skt)
 {
   /* TPS2211 to standby mode: */
   PA_DWR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
@@ -30,7 +30,7 @@ static int pfs168_pcmcia_init(struct sa1100_pcmcia_socket *skt)
 }
 
 static int
-pfs168_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+pfs168_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 			       const socket_state_t *state)
 {
   unsigned int pa_dwr_mask = 0, pa_dwr_set = 0;
diff --git a/drivers/pcmcia/sa1100_shannon.c b/drivers/pcmcia/sa1100_shannon.c
index 959d7e998..7bc9e59c7 100644
--- a/drivers/pcmcia/sa1100_shannon.c
+++ b/drivers/pcmcia/sa1100_shannon.c
@@ -21,7 +21,7 @@ static struct pcmcia_irqs irqs[] = {
 	{ 1, SHANNON_IRQ_GPIO_EJECT_1, "PCMCIA_CD_1" },
 };
 
-static int shannon_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	/* All those are inputs */
 	GPDR &= ~(SHANNON_GPIO_EJECT_0 | SHANNON_GPIO_EJECT_1 | 
@@ -31,16 +31,16 @@ static int shannon_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 
 	skt->irq = skt->nr ? SHANNON_IRQ_GPIO_RDY_1 : SHANNON_IRQ_GPIO_RDY_0;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void shannon_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void shannon_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static void
-shannon_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+shannon_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			    struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR;
@@ -69,7 +69,7 @@ shannon_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
 }
 
 static int
-shannon_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+shannon_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				const socket_state_t *state)
 {
 	switch (state->Vcc) {
@@ -93,14 +93,14 @@ shannon_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void shannon_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void shannon_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void shannon_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void shannon_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static struct pcmcia_low_level shannon_pcmcia_ops = {
diff --git a/drivers/pcmcia/sa1100_simpad.c b/drivers/pcmcia/sa1100_simpad.c
index c443a1b68..3f083e8fa 100644
--- a/drivers/pcmcia/sa1100_simpad.c
+++ b/drivers/pcmcia/sa1100_simpad.c
@@ -24,19 +24,19 @@ static struct pcmcia_irqs irqs[] = {
 	{ 1, IRQ_GPIO_CF_CD, "CF_CD" },
 };
 
-static int simpad_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 
 	clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
 
 	skt->irq = IRQ_GPIO_CF_IRQ;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void simpad_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 	/* Disable CF bus: */
 	//set_cs3_bit(PCMCIA_BUFF_DIS);
@@ -44,7 +44,7 @@ static void simpad_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-simpad_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			   struct pcmcia_state *state)
 {
 	unsigned long levels = GPLR;
@@ -66,7 +66,7 @@ simpad_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
 }
 
 static int
-simpad_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 			       const socket_state_t *state)
 {
 	unsigned long flags;
@@ -103,14 +103,14 @@ simpad_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void simpad_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void simpad_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void simpad_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void simpad_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 	set_cs3_bit(PCMCIA_RESET);
 }
 
diff --git a/drivers/pcmcia/sa1100_stork.c b/drivers/pcmcia/sa1100_stork.c
index 5436f2467..1110e63ab 100644
--- a/drivers/pcmcia/sa1100_stork.c
+++ b/drivers/pcmcia/sa1100_stork.c
@@ -36,24 +36,24 @@ static struct pcmcia_irqs irqs[] = {
 	{ 1, IRQ_GPIO_STORK_PCMCIA_B_CARD_DETECT, "PCMCIA_CD1" },
 };
 
-static int stork_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int stork_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	printk("in stork_pcmcia_init\n");
 
 	skt->irq = skt->nr ? IRQ_GPIO_STORK_PCMCIA_B_RDY
 			   : IRQ_GPIO_STORK_PCMCIA_A_RDY;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void stork_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void stork_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
 	int i;
 
         printk("%s\n", __FUNCTION__);
 
         /* disable IRQs */
-        sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+        soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
   
         /* Disable CF bus: */
         storkClearLatchA(STORK_PCMCIA_PULL_UPS_POWER_ON);
@@ -62,7 +62,7 @@ static void stork_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-stork_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+stork_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			  struct pcmcia_state *state)
 {
         unsigned long levels = GPLR;
@@ -95,7 +95,7 @@ stork_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
 }
 
 static int
-stork_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+stork_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 			      const socket_state_t *state)
 {
 	unsigned long flags;
@@ -156,16 +156,16 @@ stork_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
         return 0;
 }
 
-static void stork_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void stork_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
         storkSetLatchA(STORK_PCMCIA_PULL_UPS_POWER_ON);
 
-        sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+        soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void stork_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void stork_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 	/*
 	 * Hack!
diff --git a/drivers/pcmcia/sa1100_system3.c b/drivers/pcmcia/sa1100_system3.c
index 28ac8ec5f..c0d19fcf3 100644
--- a/drivers/pcmcia/sa1100_system3.c
+++ b/drivers/pcmcia/sa1100_system3.c
@@ -47,7 +47,7 @@
 #	define DPRINTK( x, args... )	/* nix */
 #endif
 
-static int system3_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int system3_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = skt->nr ? IRQ_S1_READY_NINT : IRQ_S0_READY_NINT;
 
@@ -55,12 +55,12 @@ static int system3_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 	return 0;
 }
 
-void system3_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+void system3_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
 }
 
 static void
-system3_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+system3_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	unsigned long status = PCSR;
 
diff --git a/drivers/pcmcia/sa1100_trizeps.c b/drivers/pcmcia/sa1100_trizeps.c
index 752bba3b6..ef94f9ddc 100644
--- a/drivers/pcmcia/sa1100_trizeps.c
+++ b/drivers/pcmcia/sa1100_trizeps.c
@@ -32,7 +32,7 @@ static struct pcmcia_irqs irqs[] = {
  *
  *
  ******************************************************/
-static int trizeps_pcmcia_init(struct sa1100_pcmcia_socket *skt)
+static int trizeps_pcmcia_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = TRIZEPS_IRQ_PCMCIA_IRQ0;
 
@@ -43,18 +43,18 @@ static int trizeps_pcmcia_init(struct sa1100_pcmcia_socket *skt)
 	GPDR &= ~((GPIO_GPIO(TRIZEPS_GPIO_PCMCIA_CD0))
 		    | (GPIO_GPIO(TRIZEPS_GPIO_PCMCIA_IRQ0)));
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 /**
  *
  *
  ******************************************************/
-static void trizeps_pcmcia_shutdown(struct sa1100_pcmcia_socket *skt)
+static void trizeps_pcmcia_shutdown(struct soc_pcmcia_socket *skt)
 {
 	printk(">>>>>PCMCIA TRIZEPS shutdown\n");
 
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 	/* Disable CF bus: */
 	TRIZEPS_BCR_set(TRIZEPS_BCR1, TRIZEPS_nPCM_ENA_REG);
@@ -64,7 +64,7 @@ static void trizeps_pcmcia_shutdown(struct sa1100_pcmcia_socket *skt)
  *
  ******************************************************/
 static void
-trizeps_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+trizeps_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			    struct pcmcia_state *state_array)
 {
 	unsigned long levels = GPLR;
@@ -83,7 +83,7 @@ trizeps_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
  *
  ******************************************************/
 static int
-trizeps_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+trizeps_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				const socket_state_t *state)
 {
 	unsigned long flags;
@@ -129,14 +129,14 @@ trizeps_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void trizeps_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void trizeps_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void trizeps_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void trizeps_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 /**
diff --git a/drivers/pcmcia/sa1100_xp860.c b/drivers/pcmcia/sa1100_xp860.c
index ea0629107..eae34b70d 100644
--- a/drivers/pcmcia/sa1100_xp860.c
+++ b/drivers/pcmcia/sa1100_xp860.c
@@ -19,7 +19,7 @@
 #define NCR_A0VPP	(1<<16)
 #define NCR_A1VPP	(1<<17)
 
-static int xp860_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int xp860_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
   /* Set GPIO_A<3:0> to be outputs for PCMCIA/CF power controller: */
   PA_DDR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
@@ -42,7 +42,7 @@ static int xp860_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
 }
 
 static int
-xp860_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+xp860_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
   unsigned int gpio_mask, pa_dwr_mask;
   unsigned int gpio_set, pa_dwr_set;
diff --git a/drivers/pcmcia/sa1100_yopy.c b/drivers/pcmcia/sa1100_yopy.c
index b58fd193d..be2b49463 100644
--- a/drivers/pcmcia/sa1100_yopy.c
+++ b/drivers/pcmcia/sa1100_yopy.c
@@ -33,19 +33,19 @@ static struct pcmcia_irqs irqs[] = {
 	{ 0, IRQ_CF_BVD1, "CF_BVD1" },
 };
 
-static int yopy_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+static int yopy_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	skt->irq = IRQ_CF_IREQ;
 
 	pcmcia_power(0);
 	pcmcia_reset(1);
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void yopy_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+static void yopy_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 
 	/* Disable CF */
 	pcmcia_reset(1);
@@ -53,7 +53,7 @@ static void yopy_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
 }
 
 static void
-yopy_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
+yopy_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 			 struct pcmcia_state_array *state)
 {
 	unsigned long levels = GPLR;
@@ -68,7 +68,7 @@ yopy_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt,
 }
 
 static int
-yopy_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
+yopy_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 			     const socket_state_t *state)
 {
 	switch (state->Vcc) {
@@ -93,14 +93,14 @@ yopy_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt,
 	return 0;
 }
 
-static void yopy_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+static void yopy_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-static void yopy_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+static void yopy_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static struct pcmcia_low_level yopy_pcmcia_ops = {
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 16428f474..c8e0551cd 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -29,20 +29,20 @@ static struct pcmcia_irqs irqs[] = {
 	{ 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1"            },
 };
 
-int sa1111_pcmcia_hw_init(struct sa1100_pcmcia_socket *skt)
+int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	if (skt->irq == NO_IRQ)
 		skt->irq = skt->nr ? IRQ_S1_READY_NINT : IRQ_S0_READY_NINT;
 
-	return sa11xx_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-void sa1111_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *skt)
+void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-void sa1111_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_state *state)
+void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
 {
 	struct sa1111_dev *sadev = SA1111_DEV(skt->dev);
 	unsigned long status = sa1111_readl(sadev->mapbase + SA1111_PCSR);
@@ -70,7 +70,7 @@ void sa1111_pcmcia_socket_state(struct sa1100_pcmcia_socket *skt, struct pcmcia_
 	}
 }
 
-int sa1111_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socket_state_t *state)
+int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
 {
 	struct sa1111_dev *sadev = SA1111_DEV(skt->dev);
 	unsigned int pccr_skt_mask, pccr_set_mask, val;
@@ -110,14 +110,14 @@ int sa1111_pcmcia_configure_socket(struct sa1100_pcmcia_socket *skt, const socke
 	return 0;
 }
 
-void sa1111_pcmcia_socket_init(struct sa1100_pcmcia_socket *skt)
+void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
-void sa1111_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *skt)
+void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-	sa11xx_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
+	soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
 static int pcmcia_probe(struct sa1111_dev *dev)
@@ -148,6 +148,9 @@ static int pcmcia_probe(struct sa1111_dev *dev)
 #ifdef CONFIG_SA1100_JORNADA720
 	pcmcia_jornada720_init(&dev->dev);
 #endif
+#ifdef CONFIG_ARCH_LUBBOCK
+	pcmcia_lubbock_init(dev);
+#endif
 #ifdef CONFIG_ASSABET_NEPONSET
 	pcmcia_neponset_init(dev);
 #endif
@@ -165,7 +168,7 @@ static int pcmcia_probe(struct sa1111_dev *dev)
 
 static int __devexit pcmcia_remove(struct sa1111_dev *dev)
 {
-	sa11xx_drv_pcmcia_remove(&dev->dev);
+	soc_common_drv_pcmcia_remove(&dev->dev);
 	release_mem_region(dev->res.start, 512);
 	return 0;
 }
diff --git a/drivers/pcmcia/sa1111_generic.h b/drivers/pcmcia/sa1111_generic.h
index 37504298e..10ced4a21 100644
--- a/drivers/pcmcia/sa1111_generic.h
+++ b/drivers/pcmcia/sa1111_generic.h
@@ -1,13 +1,15 @@
-#include "sa11xx_core.h"
+#include "soc_common.h"
+#include "sa11xx_base.h"
 
-extern int sa1111_pcmcia_hw_init(struct sa1100_pcmcia_socket *);
-extern void sa1111_pcmcia_hw_shutdown(struct sa1100_pcmcia_socket *);
-extern void sa1111_pcmcia_socket_state(struct sa1100_pcmcia_socket *, struct pcmcia_state *);
-extern int sa1111_pcmcia_configure_socket(struct sa1100_pcmcia_socket *, const socket_state_t *);
-extern void sa1111_pcmcia_socket_init(struct sa1100_pcmcia_socket *);
-extern void sa1111_pcmcia_socket_suspend(struct sa1100_pcmcia_socket *);
+extern int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *);
+extern void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *);
+extern void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *);
+extern int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *);
+extern void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *);
+extern void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *);
 
 extern int pcmcia_badge4_init(struct device *);
 extern int pcmcia_jornada720_init(struct device *);
+extern int pcmcia_lubbock_init(struct sa1111_dev *);
 extern int pcmcia_neponset_init(struct sa1111_dev *);
 
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index fb634ab5d..db04ffb6f 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -36,7 +36,6 @@
 #include <linux/cpufreq.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/notifier.h>
 #include <linux/spinlock.h>
 
 #include <asm/hardware.h>
@@ -111,6 +110,32 @@ sa1100_pcmcia_set_mecr(struct soc_pcmcia_socket *skt, unsigned int cpu_clock)
 	return 0;
 }
 
+#ifdef CONFIG_CPU_FREQ
+static int
+sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
+			       unsigned long val,
+			       struct cpufreq_freqs *freqs)
+{
+	switch (val) {
+	case CPUFREQ_PRECHANGE:
+		if (freqs->new > freqs->old)
+			sa1100_pcmcia_set_mecr(skt, freqs->new);
+		break;
+
+	case CPUFREQ_POSTCHANGE:
+		if (freqs->new < freqs->old)
+			sa1100_pcmcia_set_mecr(skt, freqs->new);
+		break;
+	case CPUFREQ_RESUMECHANGE:
+		sa1100_pcmcia_set_mecr(skt, freqs->new);
+		break;
+	}
+
+	return 0;
+}
+
+#endif
+
 static int
 sa1100_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
 {
@@ -152,90 +177,23 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
 	/* Provide our SA11x0 specific timing routines. */
 	ops->set_timing  = sa1100_pcmcia_set_timing;
 	ops->show_timing = sa1100_pcmcia_show_timing;
+#ifdef CONFIG_CPU_FREQ
+	ops->frequency_change = sa1100_pcmcia_frequency_change;
+#endif
 
 	return soc_common_drv_pcmcia_probe(dev, ops, first, nr);
 }
 EXPORT_SYMBOL(sa11xx_drv_pcmcia_probe);
 
-#ifdef CONFIG_CPU_FREQ
-
-/* sa1100_pcmcia_update_mecr()
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- * When sa1100_pcmcia_notifier() decides that a MECR adjustment (due
- * to a core clock frequency change) is needed, this routine establishes
- * new BS_xx values consistent with the clock speed `clock'.
- */
-static void sa1100_pcmcia_update_mecr(unsigned int clock)
-{
-	struct soc_pcmcia_socket *skt;
-
-	down(&soc_pcmcia_sockets_lock);
-	list_for_each_entry(skt, &soc_pcmcia_sockets, node)
-		sa1100_pcmcia_set_mecr(skt, clock);
-	up(&soc_pcmcia_sockets_lock);
-}
-
-/* sa1100_pcmcia_notifier()
- * ^^^^^^^^^^^^^^^^^^^^^^^^
- * When changing the processor core clock frequency, it is necessary
- * to adjust the MECR timings accordingly. We've recorded the timings
- * requested by Card Services, so this is just a matter of finding
- * out what our current speed is, and then recomputing the new MECR
- * values.
- *
- * Returns: 0 on success, -1 on error
- */
-static int
-sa1100_pcmcia_notifier(struct notifier_block *nb, unsigned long val,
-		       void *data)
-{
-	struct cpufreq_freqs *freqs = data;
-
-	switch (val) {
-	case CPUFREQ_PRECHANGE:
-		if (freqs->new > freqs->old)
-			sa1100_pcmcia_update_mecr(freqs->new);
-		break;
-
-	case CPUFREQ_POSTCHANGE:
-		if (freqs->new < freqs->old)
-			sa1100_pcmcia_update_mecr(freqs->new);
-		break;
-	case CPUFREQ_RESUMECHANGE:
-		sa1100_pcmcia_update_mecr(freqs->new);
-		break;
-	}
-
-	return 0;
-}
-
-static struct notifier_block sa1100_pcmcia_notifier_block = {
-	.notifier_call	= sa1100_pcmcia_notifier
-};
-
 static int __init sa11xx_pcmcia_init(void)
 {
-	int ret;
-
-	printk(KERN_INFO "SA11xx PCMCIA\n");
-
-	ret = cpufreq_register_notifier(&sa1100_pcmcia_notifier_block,
-					CPUFREQ_TRANSITION_NOTIFIER);
-	if (ret < 0)
-		printk(KERN_ERR "Unable to register CPU frequency change "
-			"notifier (%d)\n", ret);
-
-	return ret;
+	return 0;
 }
 module_init(sa11xx_pcmcia_init);
 
-static void __exit sa11xx_pcmcia_exit(void)
-{
-	cpufreq_unregister_notifier(&sa1100_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
-}
+static void __exit sa11xx_pcmcia_exit(void) {}
 
 module_exit(sa11xx_pcmcia_exit);
-#endif
 
 MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
 MODULE_DESCRIPTION("Linux PCMCIA Card Services: SA-11xx core socket driver");
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index ff8b52124..6d393e739 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -31,6 +31,7 @@
 ======================================================================*/
 
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -39,6 +40,7 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
+#include <linux/cpufreq.h>
 
 #include <asm/hardware.h>
 #include <asm/io.h>
@@ -614,6 +616,49 @@ struct skt_dev_info {
 #define SKT_DEV_INFO_SIZE(n) \
 	(sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
 
+#ifdef CONFIG_CPU_FREQ
+static int
+soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
+{
+	struct soc_pcmcia_socket *skt;
+	struct cpufreq_freqs *freqs = data;
+	int ret = 0;
+
+	down(&soc_pcmcia_sockets_lock);
+	list_for_each_entry(skt, &soc_pcmcia_sockets, node)
+		if ( skt->ops->frequency_change )
+			ret += skt->ops->frequency_change(skt, val, freqs);
+	up(&soc_pcmcia_sockets_lock);
+
+	return ret;
+}
+
+static struct notifier_block soc_pcmcia_notifier_block = {
+	.notifier_call	= soc_pcmcia_notifier
+};
+
+static int soc_pcmcia_cpufreq_register(void)
+{
+	int ret;
+
+	ret = cpufreq_register_notifier(&soc_pcmcia_notifier_block,
+					CPUFREQ_TRANSITION_NOTIFIER);
+	if (ret < 0)
+		printk(KERN_ERR "Unable to register CPU frequency change "
+				"notifier for PCMCIA (%d)\n", ret);
+	return ret;
+}
+
+static void soc_pcmcia_cpufreq_unregister(void)
+{
+	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+}
+
+#else
+#define soc_pcmcia_cpufreq_register()
+#define soc_pcmcia_cpufreq_unregister()
+#endif
+
 int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
 {
 	struct skt_dev_info *sinfo;
@@ -692,6 +737,9 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
 			goto out_err_5;
 		}
 
+		if ( list_empty(&soc_pcmcia_sockets) )
+			soc_pcmcia_cpufreq_register();
+
 		list_add(&skt->node, &soc_pcmcia_sockets);
 
 		/*
@@ -789,6 +837,9 @@ int soc_common_drv_pcmcia_remove(struct device *dev)
 		release_resource(&skt->res_io);
 		release_resource(&skt->res_skt);
 	}
+	if ( list_empty(&soc_pcmcia_sockets) )
+		soc_pcmcia_cpufreq_unregister();
+
 	up(&soc_pcmcia_sockets_lock);
 
 	kfree(sinfo);
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index 60e30197b..f77923ced 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -10,6 +10,7 @@
 #define _ASM_ARCH_PCMCIA
 
 /* include the world */
+#include <linux/cpufreq.h>
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
@@ -103,6 +104,13 @@ struct pcmcia_low_level {
 	unsigned int (*get_timing)(struct soc_pcmcia_socket *, unsigned int, unsigned int);
 	int (*set_timing)(struct soc_pcmcia_socket *);
 	int (*show_timing)(struct soc_pcmcia_socket *, char *);
+
+#ifdef CONFIG_CPU_FREQ
+	/*
+	 * CPUFREQ support.
+	 */
+	int (*frequency_change)(struct soc_pcmcia_socket *, unsigned long, struct cpufreq_freqs *);
+#endif
 };
 
 
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 5f9b4be82..367222170 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -60,7 +60,7 @@
 static int pc_debug;
 
 module_param(pc_debug, int, 0644);
-static const char *version =
+static const char version[] =
 "tcic.c 1.111 2000/02/15 04:13:12 (David Hinds)";
 
 #define debug(lvl, fmt, arg...) do {				\
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index b0d716ef0..767b2c1a2 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1078,6 +1078,7 @@ static struct pci_device_id yenta_table [] = {
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1451A, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1510, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520, TI12XX),
+	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1620, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4410, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4450, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4451, TI12XX),
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 0a94ee9db..cf54b0a36 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -55,7 +55,7 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
 	return (file->f_pos = new);
 }
 
-static ssize_t isapnp_proc_bus_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
+static ssize_t isapnp_proc_bus_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
 {
 	struct inode *ino = file->f_dentry->d_inode;
 	struct proc_dir_entry *dp = PDE(ino);
diff --git a/drivers/pnp/pnpbios/Kconfig b/drivers/pnp/pnpbios/Kconfig
index 58eb94971..ff17c7e96 100644
--- a/drivers/pnp/pnpbios/Kconfig
+++ b/drivers/pnp/pnpbios/Kconfig
@@ -3,7 +3,7 @@
 #
 config PNPBIOS
 	bool "Plug and Play BIOS support (EXPERIMENTAL)"
-	depends on PNP && EXPERIMENTAL
+	depends on PNP && X86 && EXPERIMENTAL
 	---help---
 	  Linux uses the PNPBIOS as defined in "Plug and Play BIOS
 	  Specification Version 1.0A May 5, 1994" to autodetect built-in
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index bd17b0953..2ac20b58b 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -11,15 +11,15 @@
 #include <linux/pnpbios.h>
 #include <linux/device.h>
 #include <linux/pnp.h>
-#include <asm/page.h>
-#include <asm/system.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <asm/desc.h>
 #include <linux/slab.h>
 #include <linux/kmod.h>
 #include <linux/completion.h>
 #include <linux/spinlock.h>
+
+#include <asm/page.h>
+#include <asm/desc.h>
 #include <asm/system.h>
 #include <asm/byteorder.h>
 
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 967ecb240..dd1bbb89c 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -53,15 +53,15 @@
 #include <linux/pnpbios.h>
 #include <linux/device.h>
 #include <linux/pnp.h>
-#include <asm/page.h>
-#include <asm/system.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <asm/desc.h>
 #include <linux/slab.h>
 #include <linux/kmod.h>
 #include <linux/completion.h>
 #include <linux/spinlock.h>
+
+#include <asm/page.h>
+#include <asm/desc.h>
 #include <asm/system.h>
 #include <asm/byteorder.h>
 
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c
index 063ae5ecf..88fcd1668 100644
--- a/drivers/pnp/pnpbios/proc.c
+++ b/drivers/pnp/pnpbios/proc.c
@@ -176,7 +176,7 @@ static int proc_read_node(char *buf, char **start, off_t pos,
 	return len;
 }
 
-static int proc_write_node(struct file *file, const char *buf,
+static int proc_write_node(struct file *file, const char __user *buf,
                            unsigned long count, void *data)
 {
 	struct pnp_bios_node *node;
diff --git a/drivers/s390/Kconfig b/drivers/s390/Kconfig
index 4ae29d32d..e190f21ed 100644
--- a/drivers/s390/Kconfig
+++ b/drivers/s390/Kconfig
@@ -54,17 +54,28 @@ config UNIX98_PTY_COUNT
 comment "S/390 character device drivers"
 
 config TN3270
-	tristate "Support for locally attached 3270 tubes"
+	tristate "Support for locally attached 3270 terminals"
 	help
-	  Include support for IBM 3270 line-mode terminals.
+	  Include support for IBM 3270 terminals.
+
+config TN3270_TTY
+	tristate "Support for tty input/output on 3270 terminals"
+	depends on TN3270
+	help
+	  Include support for using an IBM 3270 terminal as a Linux tty.
+
+config TN3270_FS
+	tristate "Support for fullscreen applications on 3270 terminals"
+	depends on TN3270
+	help
+	  Include support for fullscreen applications on an IBM 3270 terminal.
 
 config TN3270_CONSOLE
-	bool "Support for console on 3270 line mode terminal"
-	depends on TN3270=y
+	bool "Support for console on 3270 terminal"
+	depends on TN3270=y && TN3270_TTY=y
 	help
-	  Include support for using an IBM 3270 line-mode terminal as a Linux
-	  system console.  Available only if 3270 support is compiled in
-	  statically.
+	  Include support for using an IBM 3270 terminal as a Linux system
+	  console.  Available only if 3270 support is compiled in statically.
 
 config TN3215
 	bool "Support for 3215 line mode terminal"
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index ab9f28443..6997d61dc 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.139 $
+ * $Revision: 1.142 $
  */
 
 #include <linux/config.h>
@@ -37,6 +37,7 @@
  * SECTION: exported variables of dasd.c
  */
 debug_info_t *dasd_debug_area;
+struct dasd_discipline *dasd_diag_discipline_pointer;
 
 MODULE_AUTHOR("Holger Smolinski <Holger.Smolinski@de.ibm.com>");
 MODULE_DESCRIPTION("Linux on S/390 DASD device driver,"
@@ -751,16 +752,16 @@ dasd_start_IO(struct dasd_ccw_req * cqr)
 		break;
 	case -EBUSY:
 		DBF_DEV_EVENT(DBF_ERR, device, "%s",
-			      "device busy, retry later");
+			      "start_IO: device busy, retry later");
 		break;
 	case -ETIMEDOUT:
 		DBF_DEV_EVENT(DBF_ERR, device, "%s",
-			      "request timeout - terminated");
+			      "start_IO: request timeout, retry later");
+		break;
 	case -ENODEV:
 	case -EIO:
-		cqr->status = DASD_CQR_FAILED;
-		cqr->stopclk = cqr->startclk;
-		dasd_schedule_bh(device);
+		DBF_DEV_EVENT(DBF_ERR, device, "%s",
+			      "start_IO: device gone, retry");
 		break;
 	default:
 		DEV_MESSAGE(KERN_ERR, device,
@@ -1008,8 +1009,9 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 				if (device->discipline->start_IO(next) == 0)
 					expires = next->expires;
 				else
-					MESSAGE(KERN_WARNING, "%s",
-						"Interrupt fastpath failed!");
+					DEV_MESSAGE(KERN_DEBUG, device, "%s",
+						    "Interrupt fastpath "
+						    "failed!");
 			}
 		}
 	} else {		/* error */
@@ -1018,8 +1020,8 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 		if (cqr->dstat)
 			memcpy(cqr->dstat, irb, sizeof (struct irb));
 		else
-			MESSAGE(KERN_ERR, "%s",
-				"no memory for dstat...ignoring");
+			DEV_MESSAGE(KERN_ERR, device, "%s",
+				    "no memory for dstat...ignoring");
 #ifdef ERP_DEBUG
 		/* dump sense data */
 		dasd_log_sense(cqr, irb);
@@ -1989,6 +1991,8 @@ dasd_init(void)
 
 	DBF_EVENT(DBF_EMERG, "%s", "debug area created");
 
+	dasd_diag_discipline_pointer = NULL;
+
 	rc = devfs_mk_dir("dasd");
 	if (rc)
 		goto failed;
@@ -2021,6 +2025,7 @@ module_init(dasd_init);
 module_exit(dasd_exit);
 
 EXPORT_SYMBOL(dasd_debug_area);
+EXPORT_SYMBOL(dasd_diag_discipline_pointer);
 
 EXPORT_SYMBOL(dasd_add_request_head);
 EXPORT_SYMBOL(dasd_add_request_tail);
diff --git a/drivers/s390/block/dasd_cmb.c b/drivers/s390/block/dasd_cmb.c
index 8139ffddc..ed1ab474c 100644
--- a/drivers/s390/block/dasd_cmb.c
+++ b/drivers/s390/block/dasd_cmb.c
@@ -58,7 +58,7 @@ static int
 dasd_ioctl_readall_cmb(struct block_device *bdev, int no, long args)
 {
 	struct dasd_device *device;
-	struct cmbdata * __user udata;
+	struct cmbdata __user *udata;
 	struct cmbdata data;
 	size_t size;
 	int ret;
@@ -66,7 +66,7 @@ dasd_ioctl_readall_cmb(struct block_device *bdev, int no, long args)
 	device = bdev->bd_disk->private_data;
 	if (!device)
 		return -EINVAL;
-	udata = (void *) args;
+	udata = (void __user *) args;
 	size = _IOC_SIZE(no);
 
 	if (!access_ok(VERIFY_WRITE, udata, size))
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 0fad4d5ce..5ea567ee2 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -11,7 +11,7 @@
  * functions may not be called from interrupt context. In particular
  * dasd_get_device is a no-no from interrupt context.
  *
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
  */
 
 #include <linux/config.h>
@@ -526,6 +526,9 @@ dasd_delete_device(struct dasd_device *device)
 	cdev = device->cdev;
 	device->cdev = NULL;
 
+	/* Disconnect dasd_devmap structure from ccw_device structure. */
+	cdev->dev.driver_data = NULL;
+
 	/* Put ccw_device structure. */
 	put_device(&cdev->dev);
 
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 67a896cd4..888aeb399 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -6,7 +6,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.34 $
+ * $Revision: 1.36 $
  */
 
 #include <linux/config.h>
@@ -35,6 +35,8 @@
 
 MODULE_LICENSE("GPL");
 
+struct dasd_discipline dasd_diag_discipline;
+
 struct dasd_diag_private {
 	struct dasd_diag_characteristics rdc_data;
 	struct dasd_diag_rw_io iob;
@@ -292,7 +294,7 @@ dasd_diag_check_device(struct dasd_device *device)
 		mdsk_term_io(device);
 	}
 	if (bsize <= PAGE_SIZE && label[3] == bsize &&
-	    label[0] == 0xc3d4e2f1 && label[13] != 0) {
+	    label[0] == 0xc3d4e2f1) {
 		device->blocks = label[7];
 		device->bp_block = bsize;
 		device->s2b_shift = 0;	/* bits to shift 512 to get a block */
@@ -489,6 +491,7 @@ dasd_diag_init(void)
 
 	ctl_set_bit(0, 9);
 	register_external_interrupt(0x2603, dasd_ext_handler);
+	dasd_diag_discipline_pointer = &dasd_diag_discipline;
 	return 0;
 }
 
@@ -503,6 +506,7 @@ dasd_diag_cleanup(void)
 	}
 	unregister_external_interrupt(0x2603, dasd_ext_handler);
 	ctl_clear_bit(0, 9);
+	dasd_diag_discipline_pointer = NULL;
 }
 
 module_init(dasd_diag_init);
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index e7afb426b..9b667cd5a 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.54 $
+ * $Revision: 1.55 $
  */
 
 #include <linux/config.h>
@@ -1070,7 +1070,7 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
 	cqr->device = device;
 	cqr->expires = 5 * 60 * HZ;	/* 5 minutes */
 	cqr->lpm = LPM_ANYPATH;
-	cqr->retries = 2;
+	cqr->retries = 256;
 	cqr->buildclk = get_clock();
 	cqr->status = DASD_CQR_FILLED;
 	return cqr;
@@ -1289,7 +1289,7 @@ dasd_eckd_performance(struct block_device *bdev, int no, long args)
 		/* Prepare for Read Subsystem Data */
 		prssdp = (struct dasd_psf_prssd_data *) cqr->data;
 		stats = (struct dasd_rssd_perf_stats_t *) (prssdp + 1);
-		rc = copy_to_user((long *) args, (long *) stats,
+		rc = copy_to_user((long __user *) args, (long *) stats,
 				  sizeof(struct dasd_rssd_perf_stats_t));
 	}
 	dasd_sfree_request(cqr, cqr->device);
@@ -1319,10 +1319,10 @@ dasd_eckd_get_attrib (struct block_device *bdev, int no, long args)
 
         private = (struct dasd_eckd_private *) device->private;
         attrib = private->attrib;
-	
-        rc = copy_to_user((long *) args, (long *) &attrib,
+
+        rc = copy_to_user((long __user *) args, (long *) &attrib,
 			  sizeof (struct attrib_data_t));
-	
+
 	return rc;
 }
 
@@ -1346,7 +1346,7 @@ dasd_eckd_set_attrib(struct block_device *bdev, int no, long args)
 	if (device == NULL)
 		return -ENODEV;
 
-	if (copy_from_user(&attrib, (void *) args,
+	if (copy_from_user(&attrib, (void __user *) args,
 			   sizeof (struct attrib_data_t))) {
 		return -EFAULT;
 	}
diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c
index 37fa4214f..9c91710b7 100644
--- a/drivers/s390/block/dasd_erp.c
+++ b/drivers/s390/block/dasd_erp.c
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
  */
 
 #include <linux/config.h>
@@ -67,7 +67,8 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize,
 	}
 	strncpy((char *) &cqr->magic, magic, 4);
 	ASCEBC((char *) &cqr->magic, 4);
-	atomic_inc(&device->ref_count);
+	set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
+	dasd_get_device(device);
 	return cqr;
 }
 
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 9967c082c..b222f9503 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -6,7 +6,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.57 $
+ * $Revision: 1.58 $
  */
 
 #ifndef DASD_INT_H
@@ -260,12 +260,7 @@ struct dasd_discipline {
 	int (*fill_info) (struct dasd_device *, struct dasd_information2_t *);
 };
 
-extern struct dasd_discipline dasd_diag_discipline;
-#ifdef CONFIG_DASD_DIAG
-#define dasd_diag_discipline_pointer (&dasd_diag_discipline)
-#else
-#define dasd_diag_discipline_pointer (0)
-#endif
+extern struct dasd_discipline *dasd_diag_discipline_pointer;
 
 struct dasd_device {
 	/* Block device stuff. */
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 3efdcad25..8cbddce1f 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -120,7 +120,7 @@ static int
 dasd_ioctl_api_version(struct block_device *bdev, int no, long args)
 {
 	int ver = DASD_API_VERSION;
-	return put_user(ver, (int *) args);
+	return put_user(ver, (int __user *) args);
 }
 
 /*
@@ -305,7 +305,7 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args)
 		return -ENODEV;
 	if (test_bit(DASD_FLAG_RO, &device->flags))
 		return -EROFS;
-	if (copy_from_user(&fdata, (void *) args,
+	if (copy_from_user(&fdata, (void __user *) args,
 			   sizeof (struct format_data_t)))
 		return -EFAULT;
 	if (bdev != bdev->bd_contains) {
@@ -348,7 +348,7 @@ dasd_ioctl_read_profile(struct block_device *bdev, int no, long args)
 	if (device == NULL)
 		return -ENODEV;
 
-	if (copy_to_user((long *) args, (long *) &device->profile,
+	if (copy_to_user((long __user *) args, (long *) &device->profile,
 			 sizeof (struct dasd_profile_info_t)))
 		return -EFAULT;
 	return 0;
@@ -441,9 +441,9 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args)
 		spin_unlock_irqrestore(get_ccwdev_lock(device->cdev),
 				       flags);
 	}
-	
+
 	rc = 0;
-	if (copy_to_user((long *) args, (long *) dasd_info,
+	if (copy_to_user((long __user *) args, (long *) dasd_info,
 			 ((no == (unsigned int) BIODASDINFO2) ?
 			  sizeof (struct dasd_information2_t) :
 			  sizeof (struct dasd_information_t))))
@@ -466,7 +466,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, int no, long args)
 	if (bdev != bdev->bd_contains)
 		// ro setting is not allowed for partitions
 		return -EINVAL;
-	if (get_user(intval, (int *) args))
+	if (get_user(intval, (int __user *) args))
 		return -EFAULT;
 	device =  bdev->bd_disk->private_data;
 	if (device == NULL)
@@ -499,7 +499,7 @@ dasd_ioctl_getgeo(struct block_device *bdev, int no, long args)
 	geo = (struct hd_geometry) {};
 	device->discipline->fill_geometry(device, &geo);
 	geo.start = get_start_sect(bdev) >> device->s2b_shift;
-	if (copy_to_user((struct hd_geometry *) args, &geo,
+	if (copy_to_user((struct hd_geometry __user *) args, &geo,
 			 sizeof (struct hd_geometry)))
 		return -EFAULT;
 
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 70d6136d7..7cbc854cf 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -30,7 +30,7 @@ static struct proc_dir_entry *dasd_devices_entry = NULL;
 static struct proc_dir_entry *dasd_statistics_entry = NULL;
 
 static inline char *
-dasd_get_user_string(const char *user_buf, size_t user_len)
+dasd_get_user_string(const char __user *user_buf, size_t user_len)
 {
 	char *buffer;
 
@@ -239,7 +239,7 @@ dasd_statistics_read(char *page, char **start, off_t off,
 }
 
 static int
-dasd_statistics_write(struct file *file, const char *user_buf,
+dasd_statistics_write(struct file *file, const char __user *user_buf,
 		      unsigned long user_len, void *data)
 {
 #ifdef CONFIG_DASD_PROFILE
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 8a30b5250..ca83f9b0a 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -76,8 +76,7 @@ struct dcssblk_dev_info {
 };
 
 static struct list_head dcssblk_devices = LIST_HEAD_INIT(dcssblk_devices);
-static rwlock_t dcssblk_devices_lock = RW_LOCK_UNLOCKED;
-
+static struct rw_semaphore dcssblk_devices_sem;
 
 /*
  * release function for segment device.
@@ -92,8 +91,8 @@ dcssblk_release_segment(struct device *dev)
 
 /*
  * get a minor number. needs to be called with
- * write_lock(&dcssblk_devices_lock) and the
- * device needs to be enqueued before the lock is
+ * down_write(&dcssblk_devices_sem) and the
+ * device needs to be enqueued before the semaphore is
  * freed.
  */
 static inline int
@@ -121,7 +120,7 @@ dcssblk_assign_free_minor(struct dcssblk_dev_info *dev_info)
 /*
  * get the struct dcssblk_dev_info from dcssblk_devices
  * for the given name.
- * read_lock(&dcssblk_devices_lock) must be held.
+ * down_read(&dcssblk_devices_sem) must be held.
  */
 static struct dcssblk_dev_info *
 dcssblk_get_device_by_name(char *name)
@@ -136,31 +135,6 @@ dcssblk_get_device_by_name(char *name)
 	return NULL;
 }
 
-/*
- * register the device that represents a segment in sysfs,
- * also add the attributes for the device
- */
-static inline int
-dcssblk_register_segment_device(struct device *dev)
-{
-	int rc;
-
-	rc = device_register(dev);
-	if (rc)
-		return rc;
-	rc = device_create_file(dev, &dev_attr_shared);
-	if (rc)
-		goto unregister_dev;
-	rc = device_create_file(dev, &dev_attr_save);
-	if (rc)
-		goto unregister_dev;
-	return rc;
-
-unregister_dev:
-	device_unregister(dev);
-	return rc;
-}
-
 /*
  * device attribute for switching shared/nonshared (exclusive)
  * operation (show + store)
@@ -184,24 +158,24 @@ dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count)
 		PRINT_WARN("Invalid value, must be 0 or 1\n");
 		return -EINVAL;
 	}
-	write_lock(&dcssblk_devices_lock);
+	down_write(&dcssblk_devices_sem);
 	dev_info = container_of(dev, struct dcssblk_dev_info, dev);
 	if (atomic_read(&dev_info->use_count)) {
 		PRINT_ERR("share: segment %s is busy!\n",
 			  dev_info->segment_name);
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		return -EBUSY;
 	}
 	if ((inbuf[0] == '1') && (dev_info->is_shared == 1)) {
 		PRINT_WARN("Segment %s already loaded in shared mode!\n",
 			   dev_info->segment_name);
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		return count;
 	}
 	if ((inbuf[0] == '0') && (dev_info->is_shared == 0)) {
 		PRINT_WARN("Segment %s already loaded in exclusive mode!\n",
 			   dev_info->segment_name);
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		return count;
 	}
 	if (inbuf[0] == '1') {
@@ -231,7 +205,7 @@ dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count)
 		PRINT_INFO("Segment %s reloaded, exclusive (read-write) mode.\n",
 			   dev_info->segment_name);
 	} else {
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		PRINT_WARN("Invalid value, must be 0 or 1\n");
 		return -EINVAL;
 	}
@@ -262,14 +236,13 @@ dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count)
 				dev_info->segment_name);
 		rc = -EPERM;
 	}
-	write_unlock(&dcssblk_devices_lock);
+	up_write(&dcssblk_devices_sem);
 	goto out;
 
 removeseg:
 	PRINT_ERR("Could not reload segment %s, removing it now!\n",
 			dev_info->segment_name);
 	list_del(&dev_info->lh);
-	write_unlock(&dcssblk_devices_lock);
 
 	del_gendisk(dev_info->gd);
 	blk_put_queue(dev_info->dcssblk_queue);
@@ -277,6 +250,7 @@ removeseg:
 	put_disk(dev_info->gd);
 	device_unregister(dev);
 	put_device(dev);
+	up_write(&dcssblk_devices_sem);
 out:
 	return rc;
 }
@@ -308,7 +282,7 @@ dcssblk_save_store(struct device *dev, const char *inbuf, size_t count)
 	}
 	dev_info = container_of(dev, struct dcssblk_dev_info, dev);
 
-	write_lock(&dcssblk_devices_lock);
+	down_write(&dcssblk_devices_sem);
 	if (inbuf[0] == '1') {
 		if (atomic_read(&dev_info->use_count) == 0) {
 			// device is idle => we save immediately
@@ -332,11 +306,11 @@ dcssblk_save_store(struct device *dev, const char *inbuf, size_t count)
 					dev_info->segment_name);
 		}
 	} else {
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		PRINT_WARN("Invalid value, must be 0 or 1\n");
 		return -EINVAL;
 	}
-	write_unlock(&dcssblk_devices_lock);
+	up_write(&dcssblk_devices_sem);
 	return count;
 }
 
@@ -375,9 +349,9 @@ dcssblk_add_store(struct device *dev, const char *buf, size_t count)
 	/*
 	 * already loaded?
 	 */
-	read_lock(&dcssblk_devices_lock);
+	down_read(&dcssblk_devices_sem);
 	dev_info = dcssblk_get_device_by_name(local_buf);
-	read_unlock(&dcssblk_devices_lock);
+	up_read(&dcssblk_devices_sem);
 	if (dev_info != NULL) {
 		PRINT_WARN("Segment %s already loaded!\n", local_buf);
 		rc = -EEXIST;
@@ -433,10 +407,10 @@ dcssblk_add_store(struct device *dev, const char *buf, size_t count)
 	/*
 	 * get minor, add to list
 	 */
-	write_lock(&dcssblk_devices_lock);
+	down_write(&dcssblk_devices_sem);
 	rc = dcssblk_assign_free_minor(dev_info);
 	if (rc) {
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		PRINT_ERR("No free minor number available! "
 			  "Unloading segment...\n");
 		goto unload_seg;
@@ -444,22 +418,29 @@ dcssblk_add_store(struct device *dev, const char *buf, size_t count)
 	sprintf(dev_info->gd->disk_name, "dcssblk%d",
 		dev_info->gd->first_minor);
 	list_add_tail(&dev_info->lh, &dcssblk_devices);
+
+	if (!try_module_get(THIS_MODULE)) {
+		rc = -ENODEV;
+		goto list_del;
+	}
 	/*
 	 * register the device
 	 */
-	rc = dcssblk_register_segment_device(&dev_info->dev);
+	rc = device_register(&dev_info->dev);
 	if (rc) {
 		PRINT_ERR("Segment %s could not be registered RC=%d\n",
 				local_buf, rc);
+		module_put(THIS_MODULE);
 		goto list_del;
 	}
-
-	if (!try_module_get(THIS_MODULE)) {
-		rc = -ENODEV;
-		goto list_del;
-	}
-
 	get_device(&dev_info->dev);
+	rc = device_create_file(&dev_info->dev, &dev_attr_shared);
+	if (rc)
+		goto unregister_dev;
+	rc = device_create_file(&dev_info->dev, &dev_attr_save);
+	if (rc)
+		goto unregister_dev;
+
 	add_disk(dev_info->gd);
 
 	blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request);
@@ -476,13 +457,24 @@ dcssblk_add_store(struct device *dev, const char *buf, size_t count)
 			break;
 	}
 	PRINT_DEBUG("Segment %s loaded successfully\n", local_buf);
-	write_unlock(&dcssblk_devices_lock);
+	up_write(&dcssblk_devices_sem);
 	rc = count;
 	goto out;
 
+unregister_dev:
+	PRINT_ERR("device_create_file() failed!\n");
+	list_del(&dev_info->lh);
+	blk_put_queue(dev_info->dcssblk_queue);
+	dev_info->gd->queue = NULL;
+	put_disk(dev_info->gd);
+	device_unregister(&dev_info->dev);
+	segment_unload(dev_info->segment_name);
+	put_device(&dev_info->dev);
+	up_write(&dcssblk_devices_sem);
+	goto out;
 list_del:
 	list_del(&dev_info->lh);
-	write_unlock(&dcssblk_devices_lock);
+	up_write(&dcssblk_devices_sem);
 unload_seg:
 	segment_unload(local_buf);
 dealloc_gendisk:
@@ -526,22 +518,21 @@ dcssblk_remove_store(struct device *dev, const char *buf, size_t count)
 		goto out_buf;
 	}
 
-	write_lock(&dcssblk_devices_lock);
+	down_write(&dcssblk_devices_sem);
 	dev_info = dcssblk_get_device_by_name(local_buf);
 	if (dev_info == NULL) {
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		PRINT_WARN("Segment %s is not loaded!\n", local_buf);
 		rc = -ENODEV;
 		goto out_buf;
 	}
 	if (atomic_read(&dev_info->use_count) != 0) {
-		write_unlock(&dcssblk_devices_lock);
+		up_write(&dcssblk_devices_sem);
 		PRINT_WARN("Segment %s is in use!\n", local_buf);
 		rc = -EBUSY;
 		goto out_buf;
 	}
 	list_del(&dev_info->lh);
-	write_unlock(&dcssblk_devices_lock);
 
 	del_gendisk(dev_info->gd);
 	blk_put_queue(dev_info->dcssblk_queue);
@@ -552,6 +543,8 @@ dcssblk_remove_store(struct device *dev, const char *buf, size_t count)
 	PRINT_DEBUG("Segment %s unloaded successfully\n",
 			dev_info->segment_name);
 	put_device(&dev_info->dev);
+	up_write(&dcssblk_devices_sem);
+
 	rc = count;
 out_buf:
 	kfree(local_buf);
@@ -587,7 +580,7 @@ dcssblk_release(struct inode *inode, struct file *filp)
 		rc = -ENODEV;
 		goto out;
 	}
-	write_lock(&dcssblk_devices_lock);
+	down_write(&dcssblk_devices_sem);
 	if (atomic_dec_and_test(&dev_info->use_count)
 	    && (dev_info->save_pending)) {
 		PRINT_INFO("Segment %s became idle and is being saved now\n",
@@ -595,7 +588,7 @@ dcssblk_release(struct inode *inode, struct file *filp)
 		segment_replace(dev_info->segment_name);
 		dev_info->save_pending = 0;
 	}
-	write_unlock(&dcssblk_devices_lock);
+	up_write(&dcssblk_devices_sem);
 	rc = 0;
 out:
 	return rc;
@@ -616,7 +609,7 @@ dcssblk_make_request(request_queue_t *q, struct bio *bio)
 	dev_info = bio->bi_bdev->bd_disk->private_data;
 	if (dev_info == NULL)
 		goto fail;
-	if ((bio->bi_sector & 3) != 0 || (bio->bi_size & 4095) != 0)
+	if ((bio->bi_sector & 7) != 0 || (bio->bi_size & 4095) != 0)
 		/* Request is not page-aligned. */
 		goto fail;
 	if (((bio->bi_size >> 9) + bio->bi_sector)
@@ -695,6 +688,7 @@ dcssblk_init(void)
 		return rc;
 	}
 	dcssblk_major = rc;
+	init_rwsem(&dcssblk_devices_sem);
 	PRINT_DEBUG("...finished!\n");
 	return 0;
 }
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 00885b09f..312057e93 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -155,7 +155,7 @@ static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index)
 {
 	int cc;
 
-	__asm__ __volatile(
+	__asm__ __volatile__ (
 		"   lhi   %0,2\n"  /* return unused cc 2 if pgin traps */
 		"   .insn rre,0xb22e0000,%1,%2\n"  /* pgin %1,%2 */
                 "0: ipm   %0\n"
@@ -203,7 +203,7 @@ static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index)
 {
 	int cc;
 
-	__asm__ __volatile(
+	__asm__ __volatile__ (
 		"   lhi   %0,2\n"  /* return unused cc 2 if pgout traps */
 		"   .insn rre,0xb22f0000,%1,%2\n"  /* pgout %1,%2 */
                 "0: ipm   %0\n"
@@ -290,7 +290,7 @@ static int xpram_make_request(request_queue_t *q, struct bio *bio)
 	unsigned long bytes;
 	int i;
 
-	if ((bio->bi_sector & 3) != 0 || (bio->bi_size & 4095) != 0)
+	if ((bio->bi_sector & 7) != 0 || (bio->bi_size & 4095) != 0)
 		/* Request is not page-aligned. */
 		goto fail;
 	if ((bio->bi_size >> 12) > xdev->size)
@@ -332,16 +332,16 @@ fail:
 static int xpram_ioctl (struct inode *inode, struct file *filp,
 		 unsigned int cmd, unsigned long arg)
 {
-	struct hd_geometry *geo;
+	struct hd_geometry __user *geo;
 	unsigned long size;
- 	if (cmd != HDIO_GETGEO)
+	if (cmd != HDIO_GETGEO)
 		return -EINVAL;
 	/*
 	 * get geometry: we have to fake one...  trim the size to a
 	 * multiple of 64 (32k): tell we have 16 sectors, 4 heads,
 	 * whatever cylinders. Tell also that data starts at sector. 4.
 	 */
-	geo = (struct hd_geometry *) arg;
+	geo = (struct hd_geometry __user *) arg;
 	size = (xpram_pages * 8) & ~0x3f;
 	put_user(size >> 6, &geo->cylinders);
 	put_user(4, &geo->heads);
@@ -423,7 +423,7 @@ static int __init xpram_setup_sizes(unsigned long pages)
 	return 0;
 }
 
-static struct request_queue xpram_queue;
+static struct request_queue *xpram_queue;
 
 static int __init xpram_setup_blkdev(void)
 {
@@ -450,8 +450,13 @@ static int __init xpram_setup_blkdev(void)
 	 * Assign the other needed values: make request function, sizes and
 	 * hardsect size. All the minor devices feature the same value.
 	 */
-	blk_queue_make_request(&xpram_queue, xpram_make_request);
-	blk_queue_hardsect_size(&xpram_queue, 4096);
+	xpram_queue = blk_alloc_queue(GFP_KERNEL);
+	if (!xpram_queue) {
+		rc = -ENOMEM;
+		goto out_unreg;
+	}
+	blk_queue_make_request(xpram_queue, xpram_make_request);
+	blk_queue_hardsect_size(xpram_queue, 4096);
 
 	/*
 	 * Setup device structures.
@@ -467,7 +472,7 @@ static int __init xpram_setup_blkdev(void)
 		disk->first_minor = i;
 		disk->fops = &xpram_devops;
 		disk->private_data = &xpram_devices[i];
-		disk->queue = &xpram_queue;
+		disk->queue = xpram_queue;
 		sprintf(disk->disk_name, "slram%d", i);
 		sprintf(disk->devfs_name, "slram/%d", i);
 		set_capacity(disk, xpram_sizes[i] << 1);
@@ -475,6 +480,9 @@ static int __init xpram_setup_blkdev(void)
 	}
 
 	return 0;
+out_unreg:
+	devfs_remove("slram");
+	unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
 out:
 	while (i--)
 		put_disk(xpram_disks[i]);
@@ -493,6 +501,7 @@ static void __exit xpram_exit(void)
 	}
 	unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
 	devfs_remove("slram");
+	blk_cleanup_queue(xpram_queue);
 	sysdev_unregister(&xpram_sys_device);
 	sysdev_class_unregister(&xpram_sysclass);
 }
diff --git a/drivers/s390/char/Makefile b/drivers/s390/char/Makefile
index 6aa04e76f..bd989f25c 100644
--- a/drivers/s390/char/Makefile
+++ b/drivers/s390/char/Makefile
@@ -4,9 +4,10 @@
 
 obj-y += ctrlchar.o keyboard.o defkeymap.o
 
-tub3270-objs := raw3270.o tty3270.o fs3270.o
-obj-$(CONFIG_TN3270) += tub3270.o
+obj-$(CONFIG_TN3270) += raw3270.o
 obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
+obj-$(CONFIG_TN3270_TTY) += tty3270.o
+obj-$(CONFIG_TN3270_FS) += fs3270.o
 
 obj-$(CONFIG_TN3215) += con3215.o
 
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 0e724c813..e92bb9473 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -1002,7 +1002,8 @@ tty3215_write(struct tty_struct * tty, int from_user,
 	ret = 0;
 	while (count > 0) {
 		length = count < 80 ? count : 80;
-		length -= copy_from_user(raw->ubuffer, buf, length);
+		length -= copy_from_user(raw->ubuffer,
+				(const unsigned char __user *)buf, length);
 		if (length == 0) {
 			if (!ret)
 				ret = -EFAULT;
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index b124ebb7f..5e35728db 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -338,7 +338,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
  * Ioctl stuff.
  */
 static int
-do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry *user_kbe,
+do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe,
 	      int cmd, int perm)
 {
 	struct kbentry tmp;
@@ -410,7 +410,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry *user_kbe,
 }
 
 static int
-do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry *u_kbs,
+do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry __user *u_kbs,
 	       int cmd, int perm)
 {
 	unsigned char kb_func;
@@ -464,9 +464,12 @@ int
 kbd_ioctl(struct kbd_data *kbd, struct file *file,
 	  unsigned int cmd, unsigned long arg)
 {
-	struct kbdiacrs *a;
+	struct kbdiacrs __user *a;
+	void __user *argp;
 	int ct, perm;
 
+	argp = (void __user *)arg;
+
 	/*
 	 * To have permissions to do most of the vt ioctls, we either have
 	 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
@@ -474,15 +477,15 @@ kbd_ioctl(struct kbd_data *kbd, struct file *file,
 	perm = current->signal->tty == kbd->tty || capable(CAP_SYS_TTY_CONFIG);
 	switch (cmd) {
 	case KDGKBTYPE:
-		return put_user(KB_101, (char*) arg);
+		return put_user(KB_101, (char __user *)argp);
 	case KDGKBENT:
 	case KDSKBENT:
-		return do_kdsk_ioctl(kbd, (struct kbentry *)arg, cmd, perm);
+		return do_kdsk_ioctl(kbd, argp, cmd, perm);
 	case KDGKBSENT:
 	case KDSKBSENT:
-		return do_kdgkb_ioctl(kbd, (struct kbsentry *)arg, cmd, perm);
+		return do_kdgkb_ioctl(kbd, argp, cmd, perm);
 	case KDGKBDIACR:
-		a = (struct kbdiacrs *) arg;
+		a = argp;
 
 		if (put_user(kbd->accent_table_size, &a->kb_cnt))
 			return -EFAULT;
@@ -492,7 +495,7 @@ kbd_ioctl(struct kbd_data *kbd, struct file *file,
 			return -EFAULT;
 		return 0;
 	case KDSKBDIACR:
-		a = (struct kbdiacrs *) arg;
+		a = argp;
 		if (!perm)
 			return -EPERM;
 		if (get_user(ct, &a->kb_cnt))
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 2b422d36d..4a57ba6b1 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -47,11 +47,11 @@ struct raw3270 {
 #define RAW3270_FLAGS_14BITADDR	0	/* 14-bit buffer addresses */
 #define RAW3270_FLAGS_BUSY	1	/* Device busy, leave it alone */
 #define RAW3270_FLAGS_ATTN	2	/* Device sent an ATTN interrupt */
-#define RAW3270_FLAGS_SHUTDOWN	4	/* Device is in offline processing */
+#define RAW3270_FLAGS_READY	4	/* Device is useable by views */
 #define RAW3270_FLAGS_CONSOLE	8	/* Device is the console. */
 
-/* Lock to protect global data of raw3270 (devices, views, etc). */
-static spinlock_t raw3270_lock = SPIN_LOCK_UNLOCKED;
+/* Semaphore to protect global data of raw3270 (devices, views, etc). */
+static DECLARE_MUTEX(raw3270_sem);
 
 /* List of 3270 devices. */
 static struct list_head raw3270_devices = LIST_HEAD_INIT(raw3270_devices);
@@ -308,7 +308,7 @@ raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
 	rp = view->dev;
 	if (!rp || rp->view != view)
 		rc = -EACCES;
-	else if (test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags))
+	else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
 		rc = -ENODEV;
 	else
 		rc =  __raw3270_start(rp, view, rq);
@@ -603,7 +603,6 @@ __raw3270_size_device(struct raw3270 *rp)
 {
 	static const unsigned char wbuf[] =
 		{ 0x00, 0x07, 0x01, 0xff, 0x03, 0x00, 0x81 };
-	unsigned long flags;
 	struct raw3270_ua *uap;
 	unsigned short count;
 	int rc;
@@ -638,6 +637,8 @@ __raw3270_size_device(struct raw3270 *rp)
 	/* Wait for attention interrupt. */
 #ifdef CONFIG_TN3270_CONSOLE
 	if (raw3270_registered == 0) {
+		unsigned long flags;
+
 		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
 		while (!test_and_clear_bit(RAW3270_FLAGS_ATTN, &rp->flags))
 			wait_cons_dev();
@@ -764,7 +765,7 @@ raw3270_setup_device(struct ccw_device *cdev, struct raw3270 *rp, char *ascebc)
 	 * Add device to list and find the smallest unused minor
 	 * number for it.
 	 */
-	spin_lock(&raw3270_lock);
+	down(&raw3270_sem);
 	/* Keep the list sorted. */
 	minor = 0;
 	rp->minor = -1;
@@ -781,7 +782,7 @@ raw3270_setup_device(struct ccw_device *cdev, struct raw3270 *rp, char *ascebc)
 		rp->minor = minor;
 		list_add_tail(&rp->list, &raw3270_devices);
 	}
-	spin_unlock(&raw3270_lock);
+	up(&raw3270_sem);
 	/* No free minor number? Then give up. */
 	if (rp->minor == -1)
 		return -EUSERS;
@@ -811,6 +812,7 @@ raw3270_setup_console(struct ccw_device *cdev)
 	raw3270_reset_device(rp);
 	raw3270_size_device(rp);
 	raw3270_reset_device(rp);
+	set_bit(RAW3270_FLAGS_READY, &rp->flags);
 	return rp;
 }
 
@@ -872,7 +874,7 @@ raw3270_activate_view(struct raw3270_view *view)
 	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
 	if (rp->view == view)
 		rc = 0;
-	else if (test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags))
+	else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
 		rc = -ENODEV;
 	else {
 		oldview = 0;
@@ -921,7 +923,7 @@ raw3270_deactivate_view(struct raw3270_view *view)
 		list_del_init(&view->list);
 		list_add_tail(&view->list, &rp->view_list);
 		/* Try to activate another view. */
-		if (!test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+		if (test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
 			list_for_each_entry(view, &rp->view_list, list)
 				if (view->fn->activate(view) == 0) {
 					rp->view = view;
@@ -942,13 +944,13 @@ raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor)
 	struct raw3270 *rp;
 	int rc;
 
-	spin_lock(&raw3270_lock);
+	down(&raw3270_sem);
 	rc = -ENODEV;
 	list_for_each_entry(rp, &raw3270_devices, list) {
 		if (rp->minor != minor)
 			continue;
 		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
-		if (!test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+		if (test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
 			atomic_set(&view->ref_count, 2);
 			view->dev = rp;
 			view->fn = fn;
@@ -963,7 +965,7 @@ raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor)
 		spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
 		break;
 	}
-	spin_unlock(&raw3270_lock);
+	up(&raw3270_sem);
 	return rc;
 }
 
@@ -977,25 +979,26 @@ raw3270_find_view(struct raw3270_fn *fn, int minor)
 	struct raw3270_view *view, *tmp;
 	unsigned long flags;
 
-	spin_lock(&raw3270_lock);
+	down(&raw3270_sem);
 	view = ERR_PTR(-ENODEV);
 	list_for_each_entry(rp, &raw3270_devices, list) {
 		if (rp->minor != minor)
 			continue;
 		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
-		if (!test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+		if (test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
+			view = ERR_PTR(-ENOENT);
 			list_for_each_entry(tmp, &rp->view_list, list) {
 				if (tmp->fn == fn) {
 					raw3270_get_view(tmp);
 					view = tmp;
+					break;
 				}
 			}
-		} else
-			view = ERR_PTR(-ENOENT);
+		}
 		spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
 		break;
 	}
-	spin_unlock(&raw3270_lock);
+	up(&raw3270_sem);
 	return view;
 }
 
@@ -1007,6 +1010,7 @@ raw3270_del_view(struct raw3270_view *view)
 {
 	unsigned long flags;
 	struct raw3270 *rp;
+	struct raw3270_view *nv;
 
 	rp = view->dev;
 	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
@@ -1015,17 +1019,18 @@ raw3270_del_view(struct raw3270_view *view)
 		rp->view = 0;
 	}
 	list_del_init(&view->list);
-	if (!rp->view && !test_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags)) {
+	if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
 		/* Try to activate another view. */
-		list_for_each_entry(view, &rp->view_list, list)
-			if (view->fn->activate(view) == 0) {
-				rp->view = view;
+		list_for_each_entry(nv, &rp->view_list, list) {
+			if (nv->fn->activate(view) == 0) {
+				rp->view = nv;
 				break;
 			}
+		}
 	}
 	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
 	/* Wait for reference counter to drop to zero. */
-	atomic_dec(&view->ref_count);
+	atomic_sub(2, &view->ref_count);
 	wait_event(raw3270_wait_queue, atomic_read(&view->ref_count) == 0);
 	if (view->fn->free)
 		view->fn->free(view);
@@ -1040,9 +1045,9 @@ raw3270_delete_device(struct raw3270 *rp)
 	struct ccw_device *cdev;
 
 	/* Remove from device chain. */
-	spin_lock(&raw3270_lock);
+	down(&raw3270_sem);
 	list_del_init(&rp->list);
-	spin_unlock(&raw3270_lock);
+	up(&raw3270_sem);
 
 	/* Disconnect from ccw_device. */
 	cdev = rp->cdev;
@@ -1109,8 +1114,48 @@ raw3270_create_attributes(struct raw3270 *rp)
 	sysfs_create_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
 }
 
-/* Hackish. A notifier chain would be cleaner. */
-extern void tty3270_notifier(int index, int active);
+/*
+ * Notifier for device addition/removal
+ */
+struct raw3270_notifier {
+	struct list_head list;
+	void (*notifier)(int, int);
+};
+
+static struct list_head raw3270_notifier = LIST_HEAD_INIT(raw3270_notifier);
+
+int raw3270_register_notifier(void (*notifier)(int, int))
+{
+	struct raw3270_notifier *np;
+	struct raw3270 *rp;
+
+	np = kmalloc(sizeof(struct raw3270_notifier), GFP_KERNEL);
+	if (!np)
+		return -ENOMEM;
+	np->notifier = notifier;
+	down(&raw3270_sem);
+	list_add_tail(&np->list, &raw3270_notifier);
+	list_for_each_entry(rp, &raw3270_devices, list) {
+		get_device(&rp->cdev->dev);
+		notifier(rp->minor, 1);
+	}
+	up(&raw3270_sem);
+	return 0;
+}
+
+void raw3270_unregister_notifier(void (*notifier)(int, int))
+{
+	struct raw3270_notifier *np;
+
+	down(&raw3270_sem);
+	list_for_each_entry(np, &raw3270_notifier, list)
+		if (np->notifier == notifier) {
+			list_del(&np->list);
+			kfree(np);
+			break;
+		}
+	up(&raw3270_sem);
+}
 
 /*
  * Set 3270 device online.
@@ -1119,6 +1164,7 @@ static int
 raw3270_set_online (struct ccw_device *cdev)
 {
 	struct raw3270 *rp;
+	struct raw3270_notifier *np;
 
 	rp = raw3270_create_device(cdev);
 	if (IS_ERR(rp))
@@ -1127,7 +1173,11 @@ raw3270_set_online (struct ccw_device *cdev)
 	raw3270_size_device(rp);
 	raw3270_reset_device(rp);
 	raw3270_create_attributes(rp);
-	tty3270_notifier(rp->minor, 1);
+	set_bit(RAW3270_FLAGS_READY, &rp->flags);
+	down(&raw3270_sem);
+	list_for_each_entry(np, &raw3270_notifier, list)
+		np->notifier(rp->minor, 1);
+	up(&raw3270_sem);
 	return 0;
 }
 
@@ -1140,9 +1190,10 @@ raw3270_remove (struct ccw_device *cdev)
 	unsigned long flags;
 	struct raw3270 *rp;
 	struct raw3270_view *v;
+	struct raw3270_notifier *np;
 
 	rp = cdev->dev.driver_data;
-	set_bit(RAW3270_FLAGS_SHUTDOWN, &rp->flags);
+	clear_bit(RAW3270_FLAGS_READY, &rp->flags);
 
 	sysfs_remove_group(&cdev->dev.kobj, &raw3270_attr_group);
 
@@ -1162,7 +1213,10 @@ raw3270_remove (struct ccw_device *cdev)
 	}
 	spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
 
-	tty3270_notifier(rp->minor, 0);
+	down(&raw3270_sem);
+	list_for_each_entry(np, &raw3270_notifier, list)
+		np->notifier(rp->minor, 0);
+	up(&raw3270_sem);
 
 	/* Reset 3270 device. */
 	raw3270_reset_device(rp);
@@ -1210,7 +1264,7 @@ static struct ccw_driver raw3270_ccw_driver = {
 	.set_offline	= &raw3270_set_offline,
 };
 
-int
+static int
 raw3270_init(void)
 {
 	struct raw3270 *rp;
@@ -1222,18 +1276,17 @@ raw3270_init(void)
 	rc = ccw_driver_register(&raw3270_ccw_driver);
 	if (rc == 0) {
 		/* Create attributes for early (= console) device. */
-		spin_lock(&raw3270_lock);
+		down(&raw3270_sem);
 		list_for_each_entry(rp, &raw3270_devices, list) {
 			get_device(&rp->cdev->dev);
 			raw3270_create_attributes(rp);
-			tty3270_notifier(rp->minor, 1);
 		}
-		spin_unlock(&raw3270_lock);
+		up(&raw3270_sem);
 	}
 	return rc;
 }
 
-void
+static void
 raw3270_exit(void)
 {
 	ccw_driver_unregister(&raw3270_ccw_driver);
@@ -1241,8 +1294,9 @@ raw3270_exit(void)
 
 MODULE_LICENSE("GPL");
 
-EXPORT_SYMBOL(raw3270_init);
-EXPORT_SYMBOL(raw3270_exit);
+module_init(raw3270_init);
+module_exit(raw3270_exit);
+
 EXPORT_SYMBOL(raw3270_request_alloc);
 EXPORT_SYMBOL(raw3270_request_free);
 EXPORT_SYMBOL(raw3270_request_reset);
@@ -1258,3 +1312,6 @@ EXPORT_SYMBOL(raw3270_activate_view);
 EXPORT_SYMBOL(raw3270_deactivate_view);
 EXPORT_SYMBOL(raw3270_start);
 EXPORT_SYMBOL(raw3270_start_irq);
+EXPORT_SYMBOL(raw3270_register_notifier);
+EXPORT_SYMBOL(raw3270_unregister_notifier);
+EXPORT_SYMBOL(raw3270_wait_queue);
diff --git a/drivers/s390/char/raw3270.h b/drivers/s390/char/raw3270.h
index 8ce5fa56a..ed5d4eb9f 100644
--- a/drivers/s390/char/raw3270.h
+++ b/drivers/s390/char/raw3270.h
@@ -78,9 +78,6 @@
 
 #define RAW3270_MAXDEVS	256
 
-int raw3270_init(void);
-void raw3270_exit(void);
-
 /* For TUBGETMOD and TUBSETMOD. Should include. */
 struct raw3270_iocb {
 	short model;
@@ -190,6 +187,10 @@ raw3270_put_view(struct raw3270_view *view)
 struct raw3270 *raw3270_setup_console(struct ccw_device *cdev);
 void raw3270_wait_cons_dev(struct raw3270 *);
 
+/* Notifier for device addition/removal */
+int raw3270_register_notifier(void (*notifier)(int, int));
+void raw3270_unregister_notifier(void (*notifier)(int, int));
+
 /*
  * Little memory allocator for string objects. 
  */
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 1035707f8..a1ad37580 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -112,46 +112,46 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
 	switch (cmd) {
 	case TIOCSCLPSHTAB:
 		/* set width of horizontal tab	*/
-		if (get_user(sclp_ioctls.htab, (unsigned short *) arg))
+		if (get_user(sclp_ioctls.htab, (unsigned short __user *) arg))
 			rc = -EFAULT;
 		else
 			check = 1;
 		break;
 	case TIOCSCLPGHTAB:
 		/* get width of horizontal tab	*/
-		if (put_user(sclp_ioctls.htab, (unsigned short *) arg))
+		if (put_user(sclp_ioctls.htab, (unsigned short __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSECHO:
 		/* enable/disable echo of input */
-		if (get_user(sclp_ioctls.echo, (unsigned char *) arg))
+		if (get_user(sclp_ioctls.echo, (unsigned char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPGECHO:
 		/* Is echo of input enabled ?  */
-		if (put_user(sclp_ioctls.echo, (unsigned char *) arg))
+		if (put_user(sclp_ioctls.echo, (unsigned char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSCOLS:
 		/* set number of columns for output  */
-		if (get_user(sclp_ioctls.columns, (unsigned short *) arg))
+		if (get_user(sclp_ioctls.columns, (unsigned short __user *) arg))
 			rc = -EFAULT;
 		else
 			check = 1;
 		break;
 	case TIOCSCLPGCOLS:
 		/* get number of columns for output  */
-		if (put_user(sclp_ioctls.columns, (unsigned short *) arg))
+		if (put_user(sclp_ioctls.columns, (unsigned short __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSNL:
 		/* enable/disable writing without final new line character  */
-		if (get_user(sclp_ioctls.final_nl, (signed char *) arg))
+		if (get_user(sclp_ioctls.final_nl, (signed char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPGNL:
 		/* Is writing without final new line character enabled ?  */
-		if (put_user(sclp_ioctls.final_nl, (signed char *) arg))
+		if (put_user(sclp_ioctls.final_nl, (signed char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSOBUF:
@@ -160,7 +160,7 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
 		 * up to next 4kB boundary and stored as number of SCCBs
 		 * (4kB Buffers) limitation: 256 x 4kB
 		 */
-		if (get_user(obuf, (unsigned int *) arg) == 0) {
+		if (get_user(obuf, (unsigned int __user *) arg) == 0) {
 			if (obuf & 0xFFF)
 				sclp_ioctls.max_sccb = (obuf >> 12) + 1;
 			else
@@ -171,22 +171,22 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
 	case TIOCSCLPGOBUF:
 		/* get the maximum buffers size for output  */
 		obuf = sclp_ioctls.max_sccb << 12;
-		if (put_user(obuf, (unsigned int *) arg))
+		if (put_user(obuf, (unsigned int __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPGKBUF:
 		/* get the number of buffers got from kernel at startup */
-		if (put_user(sclp_ioctls.kmem_sccb, (unsigned short *) arg))
+		if (put_user(sclp_ioctls.kmem_sccb, (unsigned short __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSCASE:
 		/* enable/disable conversion from upper to lower case */
-		if (get_user(sclp_ioctls.tolower, (unsigned char *) arg))
+		if (get_user(sclp_ioctls.tolower, (unsigned char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPGCASE:
 		/* Is conversion from upper to lower case of input enabled? */
-		if (put_user(sclp_ioctls.tolower, (unsigned char *) arg))
+		if (put_user(sclp_ioctls.tolower, (unsigned char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSDELIM:
@@ -194,7 +194,7 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
 		 * set special character used for separating upper and
 		 * lower case, 0x00 disables this feature
 		 */
-		if (get_user(sclp_ioctls.delim, (unsigned char *) arg))
+		if (get_user(sclp_ioctls.delim, (unsigned char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPGDELIM:
@@ -202,7 +202,7 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
 		 * get special character used for separating upper and
 		 * lower case, 0x00 disables this feature
 		 */
-		if (put_user(sclp_ioctls.delim, (unsigned char *) arg))
+		if (put_user(sclp_ioctls.delim, (unsigned char __user *) arg))
 			rc = -EFAULT;
 		break;
 	case TIOCSCLPSINIT:
@@ -415,7 +415,8 @@ sclp_tty_write(struct tty_struct *tty, int from_user,
 	while (count > 0) {
 		length = count < SCLP_TTY_BUF_SIZE ?
 			count : SCLP_TTY_BUF_SIZE;
-		length -= copy_from_user(sclp_tty_chars, buf, length);
+		length -= copy_from_user(sclp_tty_chars,
+				(const unsigned char __user *)buf, length);
 		if (length == 0) {
 			if (!ret)
 				ret = -EFAULT;
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 32d439726..22760a120 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -490,7 +490,8 @@ sclp_vt220_write(struct tty_struct *tty, int from_user,
 	while (count > 0) {
 		length = count < SCLP_VT220_BUF_SIZE ?
 			 count : SCLP_VT220_BUF_SIZE;
-		length -= copy_from_user(tty->driver_data, buf, length);
+		length -= copy_from_user(tty->driver_data,
+				(const unsigned char __user *)buf, length);
 		if (length == 0) {
 			if (!ret)
 				return -EFAULT;
diff --git a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h
index 272bd1c75..d04e6c2c3 100644
--- a/drivers/s390/char/tape.h
+++ b/drivers/s390/char/tape.h
@@ -32,7 +32,7 @@ struct gendisk;
 #ifdef  DBF_LIKE_HELL
 #define DBF_LH(level, str, ...) \
 do { \
-	debug_sprintf_event(tape_dbf_area, level, str, ## __VA_ARGS__); \
+	debug_sprintf_event(TAPE_DBF_AREA, level, str, ## __VA_ARGS__); \
 } while (0)
 #else
 #define DBF_LH(level, str, ...) do {} while(0)
@@ -43,12 +43,12 @@ do { \
  */
 #define DBF_EVENT(d_level, d_str...) \
 do { \
-	debug_sprintf_event(tape_dbf_area, d_level, d_str); \
+	debug_sprintf_event(TAPE_DBF_AREA, d_level, d_str); \
 } while (0)
 
 #define DBF_EXCEPTION(d_level, d_str...) \
 do { \
-	debug_sprintf_exception(tape_dbf_area, d_level, d_str); \
+	debug_sprintf_exception(TAPE_DBF_AREA, d_level, d_str); \
 } while (0)
 
 #define TAPE_VERSION_MAJOR 2
@@ -313,7 +313,7 @@ extern void tape_dump_sense_dbf(struct tape_device *, struct tape_request *,
 extern void tape_med_state_set(struct tape_device *, enum tape_medium_state);
 
 /* The debug area */
-extern debug_info_t *tape_dbf_area;
+extern debug_info_t *TAPE_DBF_AREA;
 
 /* functions for building ccws */
 static inline struct ccw1 *
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c
index e738c4d37..480ec8797 100644
--- a/drivers/s390/char/tape_34xx.c
+++ b/drivers/s390/char/tape_34xx.c
@@ -15,11 +15,19 @@
 #include <linux/bio.h>
 #include <linux/workqueue.h>
 
+#define TAPE_DBF_AREA	tape_34xx_dbf
+
 #include "tape.h"
 #include "tape_std.h"
 
 #define PRINTK_HEADER "TAPE_34XX: "
 
+/*
+ * Pointer to debug area.
+ */
+debug_info_t *TAPE_DBF_AREA = NULL;
+EXPORT_SYMBOL(TAPE_DBF_AREA);
+
 enum tape_34xx_type {
 	tape_3480,
 	tape_3490,
@@ -885,7 +893,7 @@ tape_34xx_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg)
 	if (cmd == TAPE390_DISPLAY) {
 		struct display_struct disp;
 
-		if (copy_from_user(&disp, (char *) arg, sizeof(disp)) != 0)
+		if (copy_from_user(&disp, (char __user *) arg, sizeof(disp)) != 0)
 			return -EFAULT;
 
 		return tape_std_display(device, &disp);
@@ -1343,7 +1351,13 @@ tape_34xx_init (void)
 {
 	int rc;
 
-	DBF_EVENT(3, "34xx init: $Revision: 1.20 $\n");
+	TAPE_DBF_AREA = debug_register ( "tape_34xx", 1, 2, 4*sizeof(long));
+	debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view);
+#ifdef DBF_LIKE_HELL
+	debug_set_level(TAPE_DBF_AREA, 6);
+#endif
+
+	DBF_EVENT(3, "34xx init: $Revision: 1.21 $\n");
 	/* Register driver for 3480/3490 tapes. */
 	rc = ccw_driver_register(&tape_34xx_driver);
 	if (rc)
@@ -1357,12 +1371,14 @@ static void
 tape_34xx_exit(void)
 {
 	ccw_driver_unregister(&tape_34xx_driver);
+
+	debug_unregister(TAPE_DBF_AREA);
 }
 
 MODULE_DEVICE_TABLE(ccw, tape_34xx_ids);
 MODULE_AUTHOR("(C) 2001-2002 IBM Deutschland Entwicklung GmbH");
 MODULE_DESCRIPTION("Linux on zSeries channel attached 3480 tape "
-		   "device driver ($Revision: 1.20 $)");
+		   "device driver ($Revision: 1.21 $)");
 MODULE_LICENSE("GPL");
 
 module_init(tape_34xx_init);
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
index 7f4ab64c1..b7f4e7b8b 100644
--- a/drivers/s390/char/tape_block.c
+++ b/drivers/s390/char/tape_block.c
@@ -19,6 +19,8 @@
 
 #include <asm/debug.h>
 
+#define TAPE_DBF_AREA	tape_core_dbf
+
 #include "tape.h"
 
 #define PRINTK_HEADER "TAPE_BLOCK: "
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index ccbe214d7..0d0343b87 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -18,6 +18,8 @@
 
 #include <asm/uaccess.h>
 
+#define TAPE_DBF_AREA	tape_core_dbf
+
 #include "tape.h"
 #include "tape_std.h"
 #include "tape_class.h"
@@ -29,8 +31,8 @@
 /*
  * file operation structure for tape character frontend
  */
-static ssize_t tapechar_read(struct file *, char *, size_t, loff_t *);
-static ssize_t tapechar_write(struct file *, const char *, size_t, loff_t *);
+static ssize_t tapechar_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t tapechar_write(struct file *, const char __user *, size_t, loff_t *);
 static int tapechar_open(struct inode *,struct file *);
 static int tapechar_release(struct inode *,struct file *);
 static int tapechar_ioctl(struct inode *, struct file *, unsigned int,
@@ -134,7 +136,7 @@ tapechar_check_idalbuffer(struct tape_device *device, size_t block_size)
  * Tape device read function
  */
 ssize_t
-tapechar_read (struct file *filp, char *data, size_t count, loff_t *ppos)
+tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos)
 {
 	struct tape_device *device;
 	struct tape_request *request;
@@ -208,7 +210,7 @@ tapechar_read (struct file *filp, char *data, size_t count, loff_t *ppos)
  * Tape device write function
  */
 ssize_t
-tapechar_write(struct file *filp, const char *data, size_t count, loff_t *ppos)
+tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t *ppos)
 {
 	struct tape_device *device;
 	struct tape_request *request;
@@ -389,7 +391,7 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
 	if (no == MTIOCTOP) {
 		struct mtop op;
 
-		if (copy_from_user(&op, (char *) data, sizeof(op)) != 0)
+		if (copy_from_user(&op, (char __user *) data, sizeof(op)) != 0)
 			return -EFAULT;
 		if (op.mt_count < 0)
 			return -EINVAL;
@@ -436,7 +438,7 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
 		if (rc < 0)
 			return rc;
 		pos.mt_blkno = rc;
-		if (copy_to_user((char *) data, &pos, sizeof(pos)) != 0)
+		if (copy_to_user((char __user *) data, &pos, sizeof(pos)) != 0)
 			return -EFAULT;
 		return 0;
 	}
@@ -466,7 +468,7 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
 			get.mt_blkno = rc;
 		}
 
-		if (copy_to_user((char *) data, &get, sizeof(get)) != 0)
+		if (copy_to_user((char __user *) data, &get, sizeof(get)) != 0)
 			return -EFAULT;
 
 		return 0;
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 6d7c5c0f2..668fe3f11 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -20,6 +20,8 @@
 
 #include <asm/types.h>	     // for variable types
 
+#define TAPE_DBF_AREA	tape_core_dbf
+
 #include "tape.h"
 #include "tape_std.h"
 
@@ -39,7 +41,8 @@ static rwlock_t tape_device_lock = RW_LOCK_UNLOCKED;
 /*
  * Pointer to debug area.
  */
-debug_info_t *tape_dbf_area = NULL;
+debug_info_t *TAPE_DBF_AREA = NULL;
+EXPORT_SYMBOL(TAPE_DBF_AREA);
 
 /*
  * Printable strings for tape enumerations.
@@ -1176,12 +1179,12 @@ tape_mtop(struct tape_device *device, int mt_op, int mt_count)
 static int
 tape_init (void)
 {
-	tape_dbf_area = debug_register ( "tape", 1, 2, 4*sizeof(long));
-	debug_register_view(tape_dbf_area, &debug_sprintf_view);
+	TAPE_DBF_AREA = debug_register ( "tape", 1, 2, 4*sizeof(long));
+	debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view);
 #ifdef DBF_LIKE_HELL
-	debug_set_level(tape_dbf_area, 6);
+	debug_set_level(TAPE_DBF_AREA, 6);
 #endif
-	DBF_EVENT(3, "tape init: ($Revision: 1.49 $)\n");
+	DBF_EVENT(3, "tape init: ($Revision: 1.50 $)\n");
 	tape_proc_init();
 	tapechar_init ();
 	tapeblock_init ();
@@ -1200,19 +1203,18 @@ tape_exit(void)
 	tapechar_exit();
 	tapeblock_exit();
 	tape_proc_cleanup();
-	debug_unregister (tape_dbf_area);
+	debug_unregister (TAPE_DBF_AREA);
 }
 
 MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte and "
 	      "Michael Holzheu (cotte@de.ibm.com,holzheu@de.ibm.com)");
 MODULE_DESCRIPTION("Linux on zSeries channel attached "
-		   "tape device driver ($Revision: 1.49 $)");
+		   "tape device driver ($Revision: 1.50 $)");
 MODULE_LICENSE("GPL");
 
 module_init(tape_init);
 module_exit(tape_exit);
 
-EXPORT_SYMBOL(tape_dbf_area);
 EXPORT_SYMBOL(tape_generic_remove);
 EXPORT_SYMBOL(tape_generic_probe);
 EXPORT_SYMBOL(tape_generic_online);
diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c
index 11d56de8d..801d17cca 100644
--- a/drivers/s390/char/tape_proc.c
+++ b/drivers/s390/char/tape_proc.c
@@ -16,6 +16,8 @@
 #include <linux/vmalloc.h>
 #include <linux/seq_file.h>
 
+#define TAPE_DBF_AREA	tape_core_dbf
+
 #include "tape.h"
 
 #define PRINTK_HEADER "TAPE_PROC: "
diff --git a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c
index afa014fe8..2f9fe3098 100644
--- a/drivers/s390/char/tape_std.c
+++ b/drivers/s390/char/tape_std.c
@@ -22,6 +22,8 @@
 #include <asm/ebcdic.h>
 #include <asm/tape390.h>
 
+#define TAPE_DBF_AREA	tape_core_dbf
+
 #include "tape.h"
 #include "tape_std.h"
 
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index 9c816f008..debc2b02c 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -35,6 +35,7 @@
 #define TTY3270_STRING_PAGES 5
 
 struct tty_driver *tty3270_driver;
+static int tty3270_max_index;
 
 struct raw3270_fn tty3270_fn;
 
@@ -836,6 +837,22 @@ tty3270_free(struct raw3270_view *view)
 	tty3270_free_view((struct tty3270 *) view);
 }
 
+/*
+ * Delayed freeing of tty3270 views.
+ */
+static void
+tty3270_del_views(void)
+{
+	struct tty3270 *tp;
+	int i;
+
+	for (i = 0; i < tty3270_max_index; i++) {
+		tp = (struct tty3270 *) raw3270_find_view(&tty3270_fn, i);
+		if (!IS_ERR(tp))
+			raw3270_del_view(&tp->view);
+	}
+}
+
 struct raw3270_fn tty3270_fn = {
 	.activate = tty3270_activate,
 	.deactivate = tty3270_deactivate,
@@ -867,6 +884,12 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
 		tp->inattr = TF_INPUT;
 		return 0;
 	}
+	if (tty3270_max_index < tty->index + 1)
+		tty3270_max_index = tty->index + 1;
+
+	/* Quick exit if there is no device for tty->index. */
+	if (PTR_ERR(tp) == -ENODEV)
+		return -ENODEV;
 
 	/* Allocate tty3270 structure on first open. */
 	tp = tty3270_alloc_view();
@@ -1778,9 +1801,6 @@ tty3270_init(void)
 	struct tty_driver *driver;
 	int ret;
 
-	ret = raw3270_init();
-	if (ret)
-		return ret;
 	driver = alloc_tty_driver(256);
 	if (!driver)
 		return -ENOMEM;
@@ -1807,6 +1827,14 @@ tty3270_init(void)
 		return ret;
 	}
 	tty3270_driver = driver;
+	ret = raw3270_register_notifier(tty3270_notifier);
+	if (ret) {
+		printk(KERN_ERR "tty3270 notifier registration failed "
+		       "with %d\n", ret);
+		put_tty_driver(driver);
+		return ret;
+
+	}
 	return 0;
 }
 
@@ -1815,10 +1843,11 @@ tty3270_exit(void)
 {
 	struct tty_driver *driver;
 
+	raw3270_unregister_notifier(tty3270_notifier);
 	driver = tty3270_driver;
 	tty3270_driver = 0;
 	tty_unregister_driver(driver);
-	raw3270_exit();
+	tty3270_del_views();
 }
 
 MODULE_LICENSE("GPL");
diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c
index 71c03c87e..3720e77b4 100644
--- a/drivers/s390/cio/airq.c
+++ b/drivers/s390/cio/airq.c
@@ -2,7 +2,7 @@
  *  drivers/s390/cio/airq.c
  *   S/390 common I/O routines -- support for adapter interruptions
  *
- *   $Revision: 1.11 $
+ *   $Revision: 1.12 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -14,11 +14,11 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/rcupdate.h>
 
 #include "cio_debug.h"
 #include "airq.h"
 
-static spinlock_t adapter_lock = SPIN_LOCK_UNLOCKED;
 static adapter_int_handler_t adapter_handler;
 
 /*
@@ -40,23 +40,17 @@ s390_register_adapter_interrupt (adapter_int_handler_t handler)
 
 	CIO_TRACE_EVENT (4, "rgaint");
 
-	spin_lock (&adapter_lock);
-
 	if (handler == NULL)
 		ret = -EINVAL;
-	else if (adapter_handler)
-		ret = -EBUSY;
-	else {
-		adapter_handler = handler;
-		ret = 0;
-	}
-
-	spin_unlock (&adapter_lock);
+	else
+		ret = (cmpxchg(&adapter_handler, NULL, handler) ? -EBUSY : 0);
+	if (!ret)
+		synchronize_kernel();
 
 	sprintf (dbf_txt, "ret:%d", ret);
 	CIO_TRACE_EVENT (4, dbf_txt);
 
-	return (ret);
+	return ret;
 }
 
 int
@@ -67,38 +61,26 @@ s390_unregister_adapter_interrupt (adapter_int_handler_t handler)
 
 	CIO_TRACE_EVENT (4, "urgaint");
 
-	spin_lock (&adapter_lock);
-
 	if (handler == NULL)
 		ret = -EINVAL;
-	else if (handler != adapter_handler)
-		ret = -EINVAL;
 	else {
 		adapter_handler = NULL;
+		synchronize_kernel();
 		ret = 0;
 	}
-
-	spin_unlock (&adapter_lock);
-
 	sprintf (dbf_txt, "ret:%d", ret);
 	CIO_TRACE_EVENT (4, dbf_txt);
 
-	return (ret);
+	return ret;
 }
 
 void
 do_adapter_IO (void)
 {
-	CIO_TRACE_EVENT (4, "doaio");
-
-	spin_lock (&adapter_lock);
+	CIO_TRACE_EVENT (6, "doaio");
 
 	if (adapter_handler)
 		(*adapter_handler) ();
-
-	spin_unlock (&adapter_lock);
-
-	return;
 }
 
 EXPORT_SYMBOL (s390_register_adapter_interrupt);
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index 0589933b9..29000d5e7 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -308,7 +308,7 @@ static int cio_ignore_read (char *page, char **start, off_t off,
 	return len;
 }
 
-static int cio_ignore_write (struct file *file, const char *user_buf,
+static int cio_ignore_write(struct file *file, const char __user *user_buf,
 			     unsigned long user_len, void *data)
 {
 	char *buf;
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 6d0179f6a..9b86522fb 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/ccwgroup.c
  *  bus driver for ccwgroup
- *   $Revision: 1.27 $
+ *   $Revision: 1.28 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *                       IBM Corporation
@@ -179,12 +179,12 @@ ccwgroup_create(struct device *root,
 		    || gdev->cdev[i]->id.driver_info !=
 		    gdev->cdev[0]->id.driver_info) {
 			rc = -EINVAL;
-			goto error;
+			goto free_dev;
 		}
 		/* Don't allow a device to belong to more than one group. */
 		if (gdev->cdev[i]->dev.driver_data) {
 			rc = -EINVAL;
-			goto error;
+			goto free_dev;
 		}
 	}
 	for (i = 0; i < argc; i++)
@@ -207,8 +207,8 @@ ccwgroup_create(struct device *root,
 	rc = device_register(&gdev->dev);
 	
 	if (rc)
-		goto error;
-
+		goto free_dev;
+	get_device(&gdev->dev);
 	rc = device_create_file(&gdev->dev, &dev_attr_ungroup);
 
 	if (rc) {
@@ -217,12 +217,21 @@ ccwgroup_create(struct device *root,
 	}
 
 	rc = __ccwgroup_create_symlinks(gdev);
-	if (!rc)
+	if (!rc) {
+		put_device(&gdev->dev);
 		return 0;
-
+	}
 	device_remove_file(&gdev->dev, &dev_attr_ungroup);
 	device_unregister(&gdev->dev);
 error:
+	for (i = 0; i < argc; i++)
+		if (gdev->cdev[i]) {
+			put_device(&gdev->cdev[i]->dev);
+			gdev->cdev[i]->dev.driver_data = NULL;
+		}
+	put_device(&gdev->dev);
+	return rc;
+free_dev:
 	for (i = 0; i < argc; i++)
 		if (gdev->cdev[i]) {
 			put_device(&gdev->cdev[i]->dev);
@@ -230,7 +239,6 @@ error:
 				gdev->cdev[i]->dev.driver_data = NULL;
 		}
 	kfree(gdev);
-
 	return rc;
 }
 
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 4a26cf1b1..4c8d6df06 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/chsc.c
  *   S/390 common I/O routines -- channel subsystem call
- *   $Revision: 1.110 $
+ *   $Revision: 1.112 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -24,7 +24,6 @@
 #include "ioasm.h"
 #include "chsc.h"
 
-#define CHPID_LONGS (256 / (8 * sizeof(long))) /* 256 chpids */
 static struct channel_path *chps[NR_CHPIDS];
 
 static void *sei_page;
@@ -62,11 +61,11 @@ chpid_is_actually_online(int chp)
 	int state;
 
 	state = get_chp_status(chp);
-	if (state < 0)
-		new_channel_path(chp);
-	else
+	if (state < 0) {
+		need_rescan = 1;
+		queue_work(slow_path_wq, &slow_path_work);
+	} else
 		WARN_ON(!state);
-	/* FIXME: should notify other subchannels here */
 }
 
 /* FIXME: this is _always_ called for every subchannel. shouldn't we
@@ -285,8 +284,10 @@ out_unlock:
 out_unreg:
 	spin_unlock(&sch->lock);
 	sch->lpm = 0;
-	/* We can't block here. */
-	device_call_nopath_notify(sch);
+	if (css_enqueue_subchannel_slow(sch->irq)) {
+		css_clear_subchannel_slow_list();
+		need_rescan = 1;
+	}
 	return 0;
 }
 
@@ -303,6 +304,9 @@ s390_set_chpid_offline( __u8 chpid)
 
 	bus_for_each_dev(&css_bus_type, NULL, &chpid,
 			 s390_subchannel_remove_chpid);
+
+	if (need_rescan || css_slow_subchannels_exist())
+		queue_work(slow_path_wq, &slow_path_work);
 }
 
 static int
@@ -737,10 +741,12 @@ __s390_subchannel_vary_chpid(struct subchannel *sch, __u8 chpid, int on)
 			 * can successfully terminate, even using the
 			 * just varied off path. Then kill it.
 			 */
-			if (!__check_for_io_and_kill(sch, chp) && !sch->lpm)
-				/* Get over with it now. */
-				device_call_nopath_notify(sch);
-			else if (sch->driver && sch->driver->verify)
+			if (!__check_for_io_and_kill(sch, chp) && !sch->lpm) {
+				if (css_enqueue_subchannel_slow(sch->irq)) {
+					css_clear_subchannel_slow_list();
+					need_rescan = 1;
+				}
+			} else if (sch->driver && sch->driver->verify)
 				sch->driver->verify(&sch->dev);
 		}
 		break;
@@ -773,11 +779,6 @@ s390_subchannel_vary_chpid_on(struct device *dev, void *data)
 	return 0;
 }
 
-extern void css_trigger_slow_path(void);
-typedef void (*workfunc)(void *);
-static DECLARE_WORK(varyonoff_work, (workfunc)css_trigger_slow_path,
-		    NULL);
-
 /*
  * Function: s390_vary_chpid
  * Varies the specified chpid online or offline
@@ -813,7 +814,7 @@ s390_vary_chpid( __u8 chpid, int on)
 			 s390_subchannel_vary_chpid_on :
 			 s390_subchannel_vary_chpid_off);
 	if (!on)
-		return 0;
+		goto out;
 	/* Scan for new devices on varied on path. */
 	for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) {
 		struct schib schib;
@@ -835,8 +836,9 @@ s390_vary_chpid( __u8 chpid, int on)
 			need_rescan = 1;
 		}
 	}
+out:
 	if (need_rescan || css_slow_subchannels_exist())
-		schedule_work(&varyonoff_work);
+		queue_work(slow_path_wq, &slow_path_work);
 	return 0;
 }
 
diff --git a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h
index 6f02ac0c9..90f5a9e73 100644
--- a/drivers/s390/cio/chsc.h
+++ b/drivers/s390/cio/chsc.h
@@ -23,5 +23,4 @@ extern struct channel_path *chps[];
 extern void s390_process_css( void );
 extern void chsc_validate_chpids(struct subchannel *);
 extern void chpid_is_actually_online(int);
-extern int is_chpid_online(int);
 #endif
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 3c786706b..a16f061fd 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/cio.c
  *   S/390 common I/O routines -- low level i/o calls
- *   $Revision: 1.121 $
+ *   $Revision: 1.123 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -67,17 +67,17 @@ cio_debug_init (void)
 	if (!cio_debug_msg_id)
 		goto out_unregister;
 	debug_register_view (cio_debug_msg_id, &debug_sprintf_view);
-	debug_set_level (cio_debug_msg_id, 6);
+	debug_set_level (cio_debug_msg_id, 2);
 	cio_debug_trace_id = debug_register ("cio_trace", 4, 4, 8);
 	if (!cio_debug_trace_id)
 		goto out_unregister;
 	debug_register_view (cio_debug_trace_id, &debug_hex_ascii_view);
-	debug_set_level (cio_debug_trace_id, 6);
+	debug_set_level (cio_debug_trace_id, 2);
 	cio_debug_crw_id = debug_register ("cio_crw", 2, 4, 16*sizeof (long));
 	if (!cio_debug_crw_id)
 		goto out_unregister;
 	debug_register_view (cio_debug_crw_id, &debug_sprintf_view);
-	debug_set_level (cio_debug_crw_id, 6);
+	debug_set_level (cio_debug_crw_id, 2);
 	pr_debug("debugging initialized\n");
 	return 0;
 
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index ffad52007..f99652855 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/css.c
  *  driver for channel subsystem
- *   $Revision: 1.73 $
+ *   $Revision: 1.77 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *			 IBM Corporation
@@ -166,10 +166,12 @@ css_get_subchannel_status(struct subchannel *sch, int schid)
 	if (sch && sch->schib.pmcw.dnv &&
 	    (schib.pmcw.dev != sch->schib.pmcw.dev))
 		return CIO_REVALIDATE;
+	if (sch && !sch->lpm)
+		return CIO_NO_PATH;
 	return CIO_OPER;
 }
 	
-static inline int
+static int
 css_evaluate_subchannel(int irq, int slow)
 {
 	int event, ret, disc;
@@ -188,7 +190,11 @@ css_evaluate_subchannel(int irq, int slow)
 		return -EAGAIN; /* Will be done on the slow path. */
 	}
 	event = css_get_subchannel_status(sch, irq);
+	CIO_MSG_EVENT(4, "Evaluating schid %04x, event %d, %s, %s path.\n",
+		      irq, event, sch?(disc?"disconnected":"normal"):"unknown",
+		      slow?"slow":"fast");
 	switch (event) {
+	case CIO_NO_PATH:
 	case CIO_GONE:
 		if (!sch) {
 			/* Never used this subchannel. Ignore. */
@@ -196,7 +202,8 @@ css_evaluate_subchannel(int irq, int slow)
 			break;
 		}
 		if (sch->driver && sch->driver->notify &&
-		    sch->driver->notify(&sch->dev, CIO_GONE)) {
+		    sch->driver->notify(&sch->dev, event)) {
+			cio_disable_subchannel(sch);
 			device_set_disconnected(sch);
 			ret = 0;
 			break;
@@ -205,6 +212,7 @@ css_evaluate_subchannel(int irq, int slow)
 		 * Unregister subchannel.
 		 * The device will be killed automatically.
 		 */
+		cio_disable_subchannel(sch);
 		device_unregister(&sch->dev);
 		/* Reset intparm to zeroes. */
 		sch->schib.pmcw.intparm = 0;
@@ -218,12 +226,21 @@ css_evaluate_subchannel(int irq, int slow)
 		 * We don't notify the driver since we have to throw the device
 		 * away in any case.
 		 */
-		device_unregister(&sch->dev);
-		/* Reset intparm to zeroes. */
-		sch->schib.pmcw.intparm = 0;
-		cio_modify(sch);
-		put_device(&sch->dev);
-		ret = css_probe_device(irq);
+		if (!disc) {
+			device_unregister(&sch->dev);
+			/* Reset intparm to zeroes. */
+			sch->schib.pmcw.intparm = 0;
+			cio_modify(sch);
+			put_device(&sch->dev);
+			ret = css_probe_device(irq);
+		} else {
+			/*
+			 * We can't immediately deregister the disconnected
+			 * device since it might block.
+			 */
+			device_trigger_reprobe(sch);
+			ret = 0;
+		}
 		break;
 	case CIO_OPER:
 		if (disc)
@@ -257,23 +274,44 @@ css_rescan_devices(void)
 	}
 }
 
-static void
-css_evaluate_slow_subchannel(unsigned long schid)
-{
-	css_evaluate_subchannel(schid, 1);
-}
+struct slow_subchannel {
+	struct list_head slow_list;
+	unsigned long schid;
+};
 
-void
+static LIST_HEAD(slow_subchannels_head);
+static spinlock_t slow_subchannel_lock = SPIN_LOCK_UNLOCKED;
+
+static void
 css_trigger_slow_path(void)
 {
+	CIO_TRACE_EVENT(4, "slowpath");
+
 	if (need_rescan) {
 		need_rescan = 0;
 		css_rescan_devices();
 		return;
 	}
-	css_walk_subchannel_slow_list(css_evaluate_slow_subchannel);
+
+	spin_lock_irq(&slow_subchannel_lock);
+	while (!list_empty(&slow_subchannels_head)) {
+		struct slow_subchannel *slow_sch =
+			list_entry(slow_subchannels_head.next,
+				   struct slow_subchannel, slow_list);
+
+		list_del_init(slow_subchannels_head.next);
+		spin_unlock_irq(&slow_subchannel_lock);
+		css_evaluate_subchannel(slow_sch->schid, 1);
+		spin_lock_irq(&slow_subchannel_lock);
+		kfree(slow_sch);
+	}
+	spin_unlock_irq(&slow_subchannel_lock);
 }
 
+typedef void (*workfunc)(void *);
+DECLARE_WORK(slow_path_work, (workfunc)css_trigger_slow_path, NULL);
+struct workqueue_struct *slow_path_wq;
+
 /*
  * Rescan for new devices. FIXME: This is slow.
  * This function is called when we have lost CRWs due to overflows and we have
@@ -434,14 +472,6 @@ s390_root_dev_unregister(struct device *dev)
 		device_unregister(dev);
 }
 
-struct slow_subchannel {
-	struct list_head slow_list;
-	unsigned long schid;
-};
-
-static LIST_HEAD(slow_subchannels_head);
-static spinlock_t slow_subchannel_lock = SPIN_LOCK_UNLOCKED;
-
 int
 css_enqueue_subchannel_slow(unsigned long schid)
 {
@@ -475,25 +505,7 @@ css_clear_subchannel_slow_list(void)
 	spin_unlock_irqrestore(&slow_subchannel_lock, flags);
 }
 
-void
-css_walk_subchannel_slow_list(void (*fn)(unsigned long))
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&slow_subchannel_lock, flags);
-	while (!list_empty(&slow_subchannels_head)) {
-		struct slow_subchannel *slow_sch =
-			list_entry(slow_subchannels_head.next,
-				   struct slow_subchannel, slow_list);
 
-		list_del_init(slow_subchannels_head.next);
-		spin_unlock_irqrestore(&slow_subchannel_lock, flags);
-		fn(slow_sch->schid);
-		spin_lock_irqsave(&slow_subchannel_lock, flags);
-		kfree(slow_sch);
-	}
-	spin_unlock_irqrestore(&slow_subchannel_lock, flags);
-}
 
 int
 css_slow_subchannels_exist(void)
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 54beb1340..b834e6a72 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -136,7 +136,6 @@ void device_trigger_reprobe(struct subchannel *);
 
 /* Helper functions for vary on/off. */
 void device_set_waiting(struct subchannel *);
-void device_call_nopath_notify(struct subchannel *);
 
 /* Helper functions to build lists for the slow path. */
 int css_enqueue_subchannel_slow(unsigned long schid);
@@ -144,4 +143,7 @@ void css_walk_subchannel_slow_list(void (*fn)(unsigned long));
 void css_clear_subchannel_slow_list(void);
 int css_slow_subchannels_exist(void);
 extern int need_rescan;
+
+extern struct workqueue_struct *slow_path_wq;
+extern struct work_struct slow_path_work;
 #endif
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 31d561bea..a921b1fea 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/device.c
  *  bus driver for ccw devices
- *   $Revision: 1.115 $
+ *   $Revision: 1.120 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *			 IBM Corporation
@@ -26,6 +26,7 @@
 #include "cio.h"
 #include "css.h"
 #include "device.h"
+#include "ioasm.h"
 
 /******************* bus type handling ***********************/
 
@@ -158,6 +159,11 @@ init_ccw_bus_type (void)
 		ret = -ENOMEM; /* FIXME: better errno ? */
 		goto out_err;
 	}
+	slow_path_wq = create_singlethread_workqueue("kslowcrw");
+	if (!slow_path_wq) {
+		ret = -ENOMEM; /* FIXME: better errno ? */
+		goto out_err;
+	}
 	if ((ret = bus_register (&ccw_bus_type)))
 		goto out_err;
 
@@ -173,6 +179,8 @@ out_err:
 		destroy_workqueue(ccw_device_work);
 	if (ccw_device_notify_work)
 		destroy_workqueue(ccw_device_notify_work);
+	if (slow_path_wq)
+		destroy_workqueue(slow_path_wq);
 	return ret;
 }
 
@@ -499,20 +507,94 @@ ccw_device_register(struct ccw_device *cdev)
 	return ret;
 }
 
-void
-ccw_device_do_unreg_rereg(void *data)
+static struct ccw_device *
+get_disc_ccwdev_by_devno(unsigned int devno, struct ccw_device *sibling)
 {
+	struct ccw_device *cdev;
+	struct list_head *entry;
 	struct device *dev;
 
-	dev = (struct device *)data;
-	device_remove_files(dev);
-	device_del(dev);
-	if (device_add(dev)) {
+	if (!get_bus(&ccw_bus_type))
+		return NULL;
+	down_read(&ccw_bus_type.subsys.rwsem);
+	cdev = NULL;
+	list_for_each(entry, &ccw_bus_type.devices.list) {
+		dev = get_device(container_of(entry,
+					      struct device, bus_list));
+		if (!dev)
+			continue;
+		cdev = to_ccwdev(dev);
+		if ((cdev->private->state == DEV_STATE_DISCONNECTED) &&
+		    (cdev->private->devno == devno) &&
+		    (!strncmp(cdev->dev.bus_id, sibling->dev.bus_id,
+			      BUS_ID_SIZE))) {
+			cdev->private->state = DEV_STATE_NOT_OPER;
+			break;
+		}
 		put_device(dev);
+		cdev = NULL;
+	}
+	up_read(&ccw_bus_type.subsys.rwsem);
+	put_bus(&ccw_bus_type);
+
+	return cdev;
+}
+
+void
+ccw_device_do_unreg_rereg(void *data)
+{
+	struct ccw_device *cdev;
+	struct subchannel *sch;
+	int need_rename;
+
+	cdev = (struct ccw_device *)data;
+	sch = to_subchannel(cdev->dev.parent);
+	if (cdev->private->devno != sch->schib.pmcw.dev) {
+		/*
+		 * The device number has changed. This is usually only when
+		 * a device has been detached under VM and then re-appeared
+		 * on another subchannel because of a different attachment
+		 * order than before. Ideally, we should should just switch
+		 * subchannels, but unfortunately, this is not possible with
+		 * the current implementation.
+		 * Instead, we search for the old subchannel for this device
+		 * number and deregister so there are no collisions with the
+		 * newly registered ccw_device.
+		 * FIXME: Find another solution so the block layer doesn't
+		 *        get possibly sick...
+		 */
+		struct ccw_device *other_cdev;
+
+		need_rename = 1;
+		other_cdev = get_disc_ccwdev_by_devno(sch->schib.pmcw.dev,
+						      cdev);
+		if (other_cdev) {
+			struct subchannel *other_sch;
+
+			other_sch = to_subchannel(other_cdev->dev.parent);
+			if (get_device(&other_sch->dev)) {
+				stsch(other_sch->irq, &other_sch->schib);
+				if (other_sch->schib.pmcw.dnv) {
+					other_sch->schib.pmcw.intparm = 0;
+					cio_modify(other_sch);
+				}
+				device_unregister(&other_sch->dev);
+			}
+		}
+		cdev->private->devno = sch->schib.pmcw.dev;
+	} else
+		need_rename = 0;
+	device_remove_files(&cdev->dev);
+	device_del(&cdev->dev);
+	if (need_rename)
+		snprintf (cdev->dev.bus_id, BUS_ID_SIZE, "0.0.%04x",
+			  sch->schib.pmcw.dev);
+	if (device_add(&cdev->dev)) {
+		put_device(&cdev->dev);
 		return;
 	}
-	if (device_add_files(dev))
-		device_unregister(dev);
+	if (device_add_files(&cdev->dev))
+		device_unregister(&cdev->dev);
 }
 
 static void
@@ -572,9 +654,7 @@ ccw_device_call_sch_unregister(void *data)
 	struct subchannel *sch;
 
 	sch = to_subchannel(cdev->dev.parent);
-	/* Check if device is registered. */
-	if (!list_empty(&sch->dev.node))
-		device_unregister(&sch->dev);
+	device_unregister(&sch->dev);
 	/* Reset intparm to zeroes. */
 	sch->schib.pmcw.intparm = 0;
 	cio_modify(sch);
@@ -603,7 +683,7 @@ io_subchannel_recog_done(struct ccw_device *cdev)
 		sch = to_subchannel(cdev->dev.parent);
 		INIT_WORK(&cdev->private->kick_work,
 			  ccw_device_call_sch_unregister, (void *) cdev);
-		queue_work(ccw_device_work, &cdev->private->kick_work);
+		queue_work(slow_path_wq, &cdev->private->kick_work);
 		break;
 	case DEV_STATE_BOXED:
 		/* Device did not respond in time. */
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 3d5c0a58b..508f1a7fb 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -152,14 +152,15 @@ ccw_device_handle_oper(struct ccw_device *cdev)
 	/*
 	 * Check if cu type and device type still match. If
 	 * not, it is certainly another device and we have to
-	 * de- and re-register.
+	 * de- and re-register. Also check here for non-matching devno.
 	 */
 	if (cdev->id.cu_type != cdev->private->senseid.cu_type ||
 	    cdev->id.cu_model != cdev->private->senseid.cu_model ||
 	    cdev->id.dev_type != cdev->private->senseid.dev_type ||
-	    cdev->id.dev_model != cdev->private->senseid.dev_model) {
+	    cdev->id.dev_model != cdev->private->senseid.dev_model ||
+	    cdev->private->devno != sch->schib.pmcw.dev) {
 		PREPARE_WORK(&cdev->private->kick_work,
-			     ccw_device_do_unreg_rereg, (void *)&cdev->dev);
+			     ccw_device_do_unreg_rereg, (void *)cdev);
 		queue_work(ccw_device_work, &cdev->private->kick_work);
 		return;
 	}
@@ -295,7 +296,7 @@ ccw_device_oper_notify(void *data)
 		sch->driver->notify(&sch->dev, CIO_OPER) : 0;
 	if (!ret)
 		/* Driver doesn't want device back. */
-		ccw_device_do_unreg_rereg((void *)&cdev->dev);
+		ccw_device_do_unreg_rereg((void *)cdev);
 	else
 		wake_up(&cdev->private->wait_q);
 }
@@ -457,25 +458,13 @@ ccw_device_nopath_notify(void *data)
 	}
 }
 
-void
-device_call_nopath_notify(struct subchannel *sch)
-{
-	struct ccw_device *cdev;
-
-	if (!sch->dev.driver_data)
-		return;
-	cdev = sch->dev.driver_data;
-	PREPARE_WORK(&cdev->private->kick_work,
-		     ccw_device_nopath_notify, (void *)cdev);
-	queue_work(ccw_device_notify_work, &cdev->private->kick_work);
-}
-
-
 void
 ccw_device_verify_done(struct ccw_device *cdev, int err)
 {
 	cdev->private->flags.doverify = 0;
 	switch (err) {
+	case -EOPNOTSUPP: /* path grouping not supported, just set online. */
+		cdev->private->options.pgroup = 0;
 	case 0:
 		ccw_device_done(cdev, DEV_STATE_ONLINE);
 		break;
@@ -1082,103 +1071,103 @@ ccw_device_bug(struct ccw_device *cdev, enum dev_event dev_event)
  * device statemachine
  */
 fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
-	[DEV_STATE_NOT_OPER] {
-		[DEV_EVENT_NOTOPER]	ccw_device_nop,
-		[DEV_EVENT_INTERRUPT]	ccw_device_bug,
-		[DEV_EVENT_TIMEOUT]	ccw_device_nop,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_NOT_OPER] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_nop,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_bug,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_nop,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_SENSE_PGID] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_sense_pgid_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_onoff_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_SENSE_PGID] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_sense_pgid_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_onoff_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_SENSE_ID] {
-		[DEV_EVENT_NOTOPER]	ccw_device_recog_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_sense_id_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_recog_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_SENSE_ID] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_recog_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_sense_id_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_recog_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_OFFLINE] {
-		[DEV_EVENT_NOTOPER]	ccw_device_offline_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_offline_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_nop,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_OFFLINE] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_offline_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_offline_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_nop,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_VERIFY] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_verify_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_onoff_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_VERIFY] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_verify_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_onoff_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_ONLINE] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_online_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_online_verify,
+	[DEV_STATE_ONLINE] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_online_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_online_verify,
 	},
-	[DEV_STATE_W4SENSE] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_w4sense,
-		[DEV_EVENT_TIMEOUT]	ccw_device_nop,
-		[DEV_EVENT_VERIFY]	ccw_device_online_verify,
+	[DEV_STATE_W4SENSE] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_w4sense,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_nop,
+		[DEV_EVENT_VERIFY]	= ccw_device_online_verify,
 	},
-	[DEV_STATE_DISBAND_PGID] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_disband_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_onoff_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_DISBAND_PGID] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_disband_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_onoff_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_BOXED] {
-		[DEV_EVENT_NOTOPER]	ccw_device_offline_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_stlck_done,
-		[DEV_EVENT_TIMEOUT]	ccw_device_stlck_done,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_BOXED] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_offline_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_stlck_done,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_stlck_done,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
 	/* states to wait for i/o completion before doing something */
-	[DEV_STATE_CLEAR_VERIFY] {
-		[DEV_EVENT_NOTOPER]     ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]   ccw_device_clear_verify,
-		[DEV_EVENT_TIMEOUT]	ccw_device_nop,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_CLEAR_VERIFY] = {
+		[DEV_EVENT_NOTOPER]     = ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]   = ccw_device_clear_verify,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_nop,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_TIMEOUT_KILL] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_killing_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_killing_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop, //FIXME
+	[DEV_STATE_TIMEOUT_KILL] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_killing_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_killing_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop, //FIXME
 	},
-	[DEV_STATE_WAIT4IO] {
-		[DEV_EVENT_NOTOPER]	ccw_device_online_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_wait4io_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_wait4io_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_wait4io_verify,
+	[DEV_STATE_WAIT4IO] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_online_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_wait4io_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_wait4io_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_wait4io_verify,
 	},
-	[DEV_STATE_QUIESCE] {
-		[DEV_EVENT_NOTOPER]	ccw_device_quiesce_done,
-		[DEV_EVENT_INTERRUPT]	ccw_device_quiesce_done,
-		[DEV_EVENT_TIMEOUT]	ccw_device_quiesce_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_QUIESCE] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_quiesce_done,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_quiesce_done,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_quiesce_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
 	/* special states for devices gone not operational */
-	[DEV_STATE_DISCONNECTED] {
-		[DEV_EVENT_NOTOPER]	ccw_device_nop,
-		[DEV_EVENT_INTERRUPT]	ccw_device_start_id,
-		[DEV_EVENT_TIMEOUT]	ccw_device_bug,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_DISCONNECTED] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_nop,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_start_id,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_bug,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_DISCONNECTED_SENSE_ID] {
-		[DEV_EVENT_NOTOPER]	ccw_device_recog_notoper,
-		[DEV_EVENT_INTERRUPT]	ccw_device_sense_id_irq,
-		[DEV_EVENT_TIMEOUT]	ccw_device_recog_timeout,
-		[DEV_EVENT_VERIFY]	ccw_device_nop,
+	[DEV_STATE_DISCONNECTED_SENSE_ID] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_recog_notoper,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_sense_id_irq,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_recog_timeout,
+		[DEV_EVENT_VERIFY]	= ccw_device_nop,
 	},
-	[DEV_STATE_CMFCHANGE] {
-		[DEV_EVENT_NOTOPER]	ccw_device_change_cmfstate,
-		[DEV_EVENT_INTERRUPT]	ccw_device_change_cmfstate,
-		[DEV_EVENT_TIMEOUT]	ccw_device_change_cmfstate,
-		[DEV_EVENT_VERIFY]	ccw_device_change_cmfstate,
+	[DEV_STATE_CMFCHANGE] = {
+		[DEV_EVENT_NOTOPER]	= ccw_device_change_cmfstate,
+		[DEV_EVENT_INTERRUPT]	= ccw_device_change_cmfstate,
+		[DEV_EVENT_TIMEOUT]	= ccw_device_change_cmfstate,
+		[DEV_EVENT_VERIFY]	= ccw_device_change_cmfstate,
 	},
 };
 
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
index b7f3e63cb..35ceeac21 100644
--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -338,6 +338,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
 		 * One of those strange devices which claim to be able
 		 * to do multipathing but not for Set Path Group ID.
 		 */
+		if (cdev->private->flags.pgid_single) {
+			ccw_device_verify_done(cdev, -EOPNOTSUPP);
+			break;
+		}
 		cdev->private->flags.pgid_single = 1;
 		/* fall through. */
 	case -EAGAIN:		/* Try again. */
diff --git a/drivers/s390/cio/requestirq.c b/drivers/s390/cio/requestirq.c
index acc5217be..0ce71a219 100644
--- a/drivers/s390/cio/requestirq.c
+++ b/drivers/s390/cio/requestirq.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/requestirq.c
  *   S/390 common I/O routines -- enabling and disabling of devices
- *   $Revision: 1.45 $
+ *   $Revision: 1.46 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -18,21 +18,6 @@
 
 #include "css.h"
 
-/* for compatiblity only... */
-int
-request_irq (unsigned int irq,
-	     void (*handler) (int, void *, struct pt_regs *),
-	     unsigned long irqflags, const char *devname, void *dev_id)
-{
-	return -EINVAL;
-}
-
-/* for compatiblity only... */
-void
-free_irq (unsigned int irq, void *dev_id)
-{
-}
-
 struct pgid global_pgid;
 EXPORT_SYMBOL_GPL(global_pgid);
 
diff --git a/drivers/s390/crypto/z90crypt.h b/drivers/s390/crypto/z90crypt.h
index 4ec1eaadf..dbc5dd0a5 100644
--- a/drivers/s390/crypto/z90crypt.h
+++ b/drivers/s390/crypto/z90crypt.h
@@ -46,12 +46,12 @@
  * - length(n_modulus) = inputdatalength
  */
 struct ica_rsa_modexpo {
-	char *		inputdata;
+	char __user *	inputdata;
 	unsigned int	inputdatalength;
-	char *		outputdata;
+	char __user *	outputdata;
 	unsigned int	outputdatalength;
-	char *		b_key;
-	char *		n_modulus;
+	char __user *	b_key;
+	char __user *	n_modulus;
 };
 
 /**
@@ -69,15 +69,15 @@ struct ica_rsa_modexpo {
  * - length(u_mult_inv) = inputdatalength/2 + 8
  */
 struct ica_rsa_modexpo_crt {
-	char *		inputdata;
+	char __user *	inputdata;
 	unsigned int	inputdatalength;
-	char *		outputdata;
+	char __user *	outputdata;
 	unsigned int	outputdatalength;
-	char *		bp_key;
-	char *		bq_key;
-	char *		np_prime;
-	char *		nq_prime;
-	char *		u_mult_inv;
+	char __user *	bp_key;
+	char __user *	bq_key;
+	char __user *	np_prime;
+	char __user *	nq_prime;
+	char __user *	u_mult_inv;
 };
 
 #define Z90_IOCTL_MAGIC 'z'  // NOTE:  Need to allocate from linux folks
diff --git a/drivers/s390/crypto/z90main.c b/drivers/s390/crypto/z90main.c
index 0190e2756..8ac1e9b75 100644
--- a/drivers/s390/crypto/z90main.c
+++ b/drivers/s390/crypto/z90main.c
@@ -361,7 +361,7 @@ struct work_element {
 	int		  buff_size;	  // size of the buffer for the request
 	char		  resp_buff[RESPBUFFSIZE];
 	int		  resp_buff_size;
-	char *		  resp_addr;	  // address of response in user space
+	char __user *	  resp_addr;	  // address of response in user space
 	unsigned int	  funccode;	  // function code of request
 	wait_queue_head_t waitq;
 	unsigned long	  requestsent;	  // time at which the request was sent
@@ -378,8 +378,9 @@ struct work_element {
  */
 static int z90crypt_open(struct inode *, struct file *);
 static int z90crypt_release(struct inode *, struct file *);
-static ssize_t z90crypt_read(struct file *, char *, size_t, loff_t *);
-static ssize_t z90crypt_write(struct file *, const char *, size_t, loff_t *);
+static ssize_t z90crypt_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t z90crypt_write(struct file *, const char __user *,
+							size_t, loff_t *);
 static int z90crypt_ioctl(struct inode *, struct file *,
 			  unsigned int, unsigned long);
 
@@ -389,7 +390,7 @@ static void z90crypt_config_task(unsigned long);
 static void z90crypt_cleanup_task(unsigned long);
 
 static int z90crypt_status(char *, char **, off_t, int, int *, void *);
-static int z90crypt_status_write(struct file *, const char *,
+static int z90crypt_status_write(struct file *, const char __user *,
 				 unsigned long, void *);
 
 /**
@@ -473,9 +474,9 @@ static int
 trans_modexpo32(unsigned int fd, unsigned int cmd, unsigned long arg,
 		struct file *file)
 {
-	struct ica_rsa_modexpo_32 *mex32u = compat_ptr(arg);
+	struct ica_rsa_modexpo_32 __user *mex32u = compat_ptr(arg);
 	struct ica_rsa_modexpo_32  mex32k;
-	struct ica_rsa_modexpo    *mex64;
+	struct ica_rsa_modexpo __user *mex64;
 	int ret = 0;
 	unsigned int i;
 
@@ -517,9 +518,9 @@ static int
 trans_modexpo_crt32(unsigned int fd, unsigned int cmd, unsigned long arg,
 		    struct file *file)
 {
-	struct ica_rsa_modexpo_crt_32 *crt32u = compat_ptr(arg);
+	struct ica_rsa_modexpo_crt_32 __user *crt32u = compat_ptr(arg);
 	struct ica_rsa_modexpo_crt_32  crt32k;
-	struct ica_rsa_modexpo_crt    *crt64;
+	struct ica_rsa_modexpo_crt __user *crt64;
 	int ret = 0;
 	unsigned int i;
 
@@ -841,7 +842,7 @@ z90crypt_release(struct inode *inode, struct file *filp)
  * z90crypt_read will not be supported beyond z90crypt 1.3.1
  */
 static ssize_t
-z90crypt_read(struct file *filp, char *buf, size_t count, loff_t *f_pos)
+z90crypt_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 {
 	PDEBUG("filp %p (PID %d)\n", filp, PID());
 	return -EPERM;
@@ -854,7 +855,7 @@ z90crypt_read(struct file *filp, char *buf, size_t count, loff_t *f_pos)
  */
 #include <linux/random.h>
 static ssize_t
-z90crypt_read(struct file *filp, char *buf, size_t count, loff_t *f_pos)
+z90crypt_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 {
 	unsigned char *temp_buff;
 
@@ -892,7 +893,7 @@ z90crypt_read(struct file *filp, char *buf, size_t count, loff_t *f_pos)
  * Write is is not allowed
  */
 static ssize_t
-z90crypt_write(struct file *filp, const char *buf, size_t count, loff_t *f_pos)
+z90crypt_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos)
 {
 	PDEBUG("filp %p (PID %d)\n", filp, PID());
 	return -EPERM;
@@ -1258,7 +1259,7 @@ z90crypt_send(struct work_element *we_p, const char *buf)
  * process_results copies the user's work from kernel space.
  */
 static inline int
-z90crypt_process_results(struct work_element *we_p, char *buf)
+z90crypt_process_results(struct work_element *we_p, char __user *buf)
 {
 	int rv;
 
@@ -1556,7 +1557,7 @@ get_crypto_request_buffer(struct work_element *we_p)
 
 static inline int
 z90crypt_prepare(struct work_element *we_p, unsigned int funccode,
-		 const char *buffer)
+		 const char __user *buffer)
 {
 	int rv;
 
@@ -1641,7 +1642,7 @@ z90crypt_rsa(struct priv_data *private_data_p, pid_t pid,
 		PDEBUG("PID %d: allocate_work_element returned ENOMEM\n", pid);
 		return rv;
 	}
-	if ((rv = z90crypt_prepare(we_p, cmd, (const char *)arg)))
+	if ((rv = z90crypt_prepare(we_p, cmd, (const char __user *)arg)))
 		PDEBUG("PID %d: rv = %d from z90crypt_prepare\n", pid, rv);
 	if (!rv)
 		if ((rv = z90crypt_send(we_p, (const char *)arg)))
@@ -1653,7 +1654,7 @@ z90crypt_rsa(struct priv_data *private_data_p, pid_t pid,
 		rv = we_p->retcode;
 	}
 	if (!rv)
-		rv = z90crypt_process_results(we_p, (char *)arg);
+		rv = z90crypt_process_results(we_p, (char __user *)arg);
 
 	if ((we_p->status[0] & STAT_FAILED)) {
 		switch (rv) {
@@ -1748,49 +1749,49 @@ z90crypt_ioctl(struct inode *inode, struct file *filp,
 
 	case Z90STAT_TOTALCOUNT:
 		tempstat = get_status_totalcount();
-		if (copy_to_user((int *)arg, &tempstat,sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat,sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_PCICACOUNT:
 		tempstat = get_status_PCICAcount();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_PCICCCOUNT:
 		tempstat = get_status_PCICCcount();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_PCIXCCCOUNT:
 		tempstat = get_status_PCIXCCcount();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_REQUESTQ_COUNT:
 		tempstat = get_status_requestq_count();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_PENDINGQ_COUNT:
 		tempstat = get_status_pendingq_count();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_TOTALOPEN_COUNT:
 		tempstat = get_status_totalopen_count();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
 	case Z90STAT_DOMAIN_INDEX:
 		tempstat = get_status_domain_index();
-		if (copy_to_user((int *)arg, &tempstat, sizeof(int)) != 0)
+		if (copy_to_user((int __user *)arg, &tempstat, sizeof(int)) != 0)
 			ret = -EFAULT;
 		break;
 
@@ -1802,7 +1803,8 @@ z90crypt_ioctl(struct inode *inode, struct file *filp,
 			break;
 		}
 		get_status_status_mask(status);
-		if (copy_to_user((char *) arg, status, Z90CRYPT_NUM_APS) != 0)
+		if (copy_to_user((char __user *) arg, status, Z90CRYPT_NUM_APS)
+									!= 0)
 			ret = -EFAULT;
 		kfree(status);
 		break;
@@ -1815,7 +1817,7 @@ z90crypt_ioctl(struct inode *inode, struct file *filp,
 			break;
 		}
 		get_status_qdepth_mask(qdepth);
-		if (copy_to_user((char *) arg, qdepth, Z90CRYPT_NUM_APS) != 0)
+		if (copy_to_user((char __user *) arg, qdepth, Z90CRYPT_NUM_APS) != 0)
 			ret = -EFAULT;
 		kfree(qdepth);
 		break;
@@ -1828,7 +1830,7 @@ z90crypt_ioctl(struct inode *inode, struct file *filp,
 			break;
 		}
 		get_status_perdevice_reqcnt(reqcnt);
-		if (copy_to_user((char *) arg, reqcnt,
+		if (copy_to_user((char __user *) arg, reqcnt,
 				 Z90CRYPT_NUM_APS * sizeof(int)) != 0)
 			ret = -EFAULT;
 		kfree(reqcnt);
@@ -1861,7 +1863,7 @@ z90crypt_ioctl(struct inode *inode, struct file *filp,
 		get_status_status_mask(pstat->status);
 		get_status_qdepth_mask(pstat->qdepth);
 
-		if (copy_to_user((struct ica_z90_status *) arg, pstat,
+		if (copy_to_user((struct ica_z90_status __user *) arg, pstat,
 				 sizeof(struct ica_z90_status)) != 0)
 			ret = -EFAULT;
 		kfree(pstat);
@@ -2104,7 +2106,7 @@ scan_string(unsigned char *bf, unsigned int len,
 }
 
 static int
-z90crypt_status_write(struct file *file, const char *buffer,
+z90crypt_status_write(struct file *file, const char __user *buffer,
 		      unsigned long count, void *data)
 {
 	int i, j, len, offs, found, eof;
@@ -2209,7 +2211,7 @@ z90crypt_status_write(struct file *file, const char *buffer,
  */
 static inline int
 receive_from_crypto_device(int index, unsigned char *psmid, int *buff_len_p,
-			   unsigned char *buff, unsigned char **dest_p_p)
+			   unsigned char *buff, unsigned char __user **dest_p_p)
 {
 	int dv, rv;
 	struct device *dev_ptr;
@@ -2397,7 +2399,7 @@ helper_send_work(int index)
 static inline void
 helper_handle_work_element(int index, unsigned char psmid[8], int rc,
 			   int buff_len, unsigned char *buff,
-			   unsigned char *resp_addr)
+			   unsigned char __user *resp_addr)
 {
 	struct work_element *pq_p;
 	struct list_head *lptr, *tptr;
@@ -2502,7 +2504,8 @@ static void
 z90crypt_reader_task(unsigned long ptr)
 {
 	int workavail, remaining, index, rc, buff_len;
-	unsigned char	psmid[8], *resp_addr;
+	unsigned char	psmid[8];
+	unsigned char __user *resp_addr;
 	static unsigned char buff[1024];
 
 	PDEBUG("jiffies %ld\n", jiffies);
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index 1120f79cb..3755f9947 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -515,7 +515,8 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
 		}
 		skb_reserve(skb, skb_res);
 		if (from_user)
-			copy_from_user(skb_put(skb, c), buf, c);
+			copy_from_user(skb_put(skb, c),
+					(const u_char __user *)buf, c);
 		else
 			memcpy(skb_put(skb, c), buf, c);
 		skb_queue_tail(&info->tx_queue, skb);
@@ -640,7 +641,7 @@ ctc_tty_unthrottle(struct tty_struct *tty)
  *          allows RS485 driver to be written in user space.
  */
 static int
-ctc_tty_get_lsr_info(ctc_tty_info * info, uint * value)
+ctc_tty_get_lsr_info(ctc_tty_info * info, uint __user *value)
 {
 	u_char status;
 	uint result;
@@ -650,7 +651,7 @@ ctc_tty_get_lsr_info(ctc_tty_info * info, uint * value)
 	status = info->lsr;
 	spin_unlock_irqrestore(&ctc_tty_lock, flags);
 	result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
-	put_user(result, (uint *) value);
+	put_user(result, value);
 	return 0;
 }
 
@@ -743,14 +744,14 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file,
 			printk(KERN_DEBUG "%s%d ioctl TIOCGSOFTCAR\n", CTC_TTY_NAME,
 			       info->line);
 #endif
-			error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
+			error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong __user *) arg);
 			return error;
 		case TIOCSSOFTCAR:
 #ifdef CTC_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "%s%d ioctl TIOCSSOFTCAR\n", CTC_TTY_NAME,
 			       info->line);
 #endif
-			error = get_user(arg, (ulong *) arg);
+			error = get_user(arg, (ulong __user *) arg);
 			if (error)
 				return error;
 			tty->termios->c_cflag =
@@ -762,11 +763,11 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file,
 			printk(KERN_DEBUG "%s%d ioctl TIOCSERGETLSR\n", CTC_TTY_NAME,
 			       info->line);
 #endif
-			error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint));
+			error = verify_area(VERIFY_WRITE, (void __user *) arg, sizeof(uint));
 			if (error)
 				return error;
 			else
-				return ctc_tty_get_lsr_info(info, (uint *) arg);
+				return ctc_tty_get_lsr_info(info, (uint __user *) arg);
 		default:
 #ifdef CTC_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "UNKNOWN ioctl 0x%08x on %s%d\n", cmd,
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 5771fb363..36790af32 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -1,5 +1,5 @@
 /* 
- * $Id: iucv.c,v 1.28 2004/04/15 06:34:58 braunu Exp $
+ * $Id: iucv.c,v 1.33 2004/05/24 10:19:18 braunu Exp $
  *
  * IUCV network driver
  *
@@ -29,7 +29,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.28 $
+ * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.33 $
  *
  */
 
@@ -98,7 +98,7 @@ typedef struct {
 	__u8  res3[24];
 } iucv_GeneralInterrupt;
 
-static iucv_GeneralInterrupt *iucv_external_int_buffer;
+static iucv_GeneralInterrupt *iucv_external_int_buffer = NULL;
 
 /* Spin Lock declaration */
 
@@ -285,6 +285,7 @@ typedef struct {
 		iparml_set_mask p_set_mask;
 	} param;
 	atomic_t in_use;
+	__u32    res;
 }  __attribute__ ((aligned(8))) iucv_param;
 #define PARAM_POOL_SIZE (PAGE_SIZE / sizeof(iucv_param))
 
@@ -351,7 +352,7 @@ do { \
 static void
 iucv_banner(void)
 {
-	char vbuf[] = "$Revision: 1.28 $";
+	char vbuf[] = "$Revision: 1.33 $";
 	char *version = vbuf;
 
 	if ((version = strchr(version, ':'))) {
@@ -403,6 +404,7 @@ iucv_init(void)
 		       "%s: Could not allocate external interrupt buffer\n",
 		       __FUNCTION__);
 		s390_root_dev_unregister(iucv_root);
+		bus_unregister(&iucv_bus);
 		return -ENOMEM;
 	}
 	memset(iucv_external_int_buffer, 0, sizeof(iucv_GeneralInterrupt));
@@ -416,6 +418,7 @@ iucv_init(void)
 		kfree(iucv_external_int_buffer);
 		iucv_external_int_buffer = NULL;
 		s390_root_dev_unregister(iucv_root);
+		bus_unregister(&iucv_bus);
 		return -ENOMEM;
 	}
 	memset(iucv_param_pool, 0, sizeof(iucv_param) * PARAM_POOL_SIZE);
@@ -441,10 +444,14 @@ static void
 iucv_exit(void)
 {
 	iucv_retrieve_buffer();
-      	if (iucv_external_int_buffer)
+      	if (iucv_external_int_buffer) {
 		kfree(iucv_external_int_buffer);
-	if (iucv_param_pool)
+		iucv_external_int_buffer = NULL;
+	}
+	if (iucv_param_pool) {
 		kfree(iucv_param_pool);
+		iucv_param_pool = NULL;
+	}
 	s390_root_dev_unregister(iucv_root);
 	bus_unregister(&iucv_bus);
 	printk(KERN_INFO "IUCV lowlevel driver unloaded\n");
@@ -463,17 +470,19 @@ iucv_exit(void)
 static __inline__ iucv_param *
 grab_param(void)
 {
-	iucv_param *ret;
-	static int i = 0;
-
-	while (atomic_compare_and_swap(0, 1, &iucv_param_pool[i].in_use)) {
-		i++;
-		if (i >= PARAM_POOL_SIZE)
-			i = 0;
-	}
-	ret = &iucv_param_pool[i];
-	memset(&ret->param, 0, sizeof(ret->param));
-	return ret;
+	iucv_param *ptr;
+        static int hint = 0;
+
+	ptr = iucv_param_pool + hint;
+	do {
+		ptr++;
+		if (ptr >= iucv_param_pool + PARAM_POOL_SIZE)
+			ptr = iucv_param_pool;
+	} while (atomic_compare_and_swap(0, 1, &ptr->in_use));
+	hint = ptr - iucv_param_pool;
+
+	memset(&ptr->param, 0, sizeof(ptr->param));
+	return ptr;
 }
 
 /**
@@ -2359,7 +2368,8 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
 					iucv_debug(2,
 						   "found a matching handler");
 					break;
-				}
+				} else
+					h = NULL;
 			}
 			spin_unlock_irqrestore (&iucv_lock, flags);
 			if (h) {
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 26514acd5..cd581306d 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -11,7 +11,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Martin Schwidefsky <schwidefsky@de.ibm.com>
  *
- *    $Revision: 1.74 $	 $Date: 2004/04/05 00:01:04 $
+ *    $Revision: 1.81 $	 $Date: 2004/05/14 13:54:33 $
  *
  * 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
@@ -58,7 +58,7 @@
 /**
  * initialization string for output
  */
-#define VERSION_LCS_C  "$Revision: 1.74 $"
+#define VERSION_LCS_C  "$Revision: 1.81 $"
 
 static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
 static char debug_buffer[255];
@@ -99,9 +99,9 @@ lcs_register_debug_facility(void)
 		return -ENOMEM;
 	}
 	debug_register_view(lcs_dbf_setup, &debug_hex_ascii_view);
-	debug_set_level(lcs_dbf_setup, 5);
+	debug_set_level(lcs_dbf_setup, 2);
 	debug_register_view(lcs_dbf_trace, &debug_hex_ascii_view);
-	debug_set_level(lcs_dbf_trace, 5);
+	debug_set_level(lcs_dbf_trace, 2);
 	return 0;
 }
 
@@ -338,6 +338,7 @@ lcs_setup_card(struct lcs_card *card)
 		  (void *)lcs_start_kernel_thread,card);
 	card->thread_mask = 0;
 	spin_lock_init(&card->lock);
+	spin_lock_init(&card->ipm_lock);
 #ifdef CONFIG_IP_MULTICAST
 	INIT_LIST_HEAD(&card->ipm_list);
 #endif
@@ -935,18 +936,14 @@ lcs_check_multicast_support(struct lcs_card *card)
 /**
  * set or del multicast address on LCS card
  */
-static int
-lcs_fix_multicast_list(void *data)
+static void
+lcs_fix_multicast_list(struct lcs_card *card)
 {
 	struct list_head *l, *n;
 	struct lcs_ipm_list *ipm;
-	struct lcs_card *card;
 
-	card = (struct lcs_card *) data;
-
-	daemonize("fixipm");
 	LCS_DBF_TEXT(4,trace, "fixipm");
-	spin_lock(&card->lock);
+	spin_lock(&card->ipm_lock);
 	list_for_each_safe(l, n, &card->ipm_list) {
 		ipm = list_entry(l, struct lcs_ipm_list, list);
 		switch (ipm->ipm_state) {
@@ -968,8 +965,7 @@ lcs_fix_multicast_list(void *data)
 	}
 	if (card->state == DEV_STATE_UP)
 		netif_wake_queue(card->dev);
-	spin_unlock(&card->lock);
-	return 0;
+	spin_unlock(&card->ipm_lock);
 }
 
 /**
@@ -988,28 +984,30 @@ lcs_get_mac_for_ipm(__u32 ipm, char *mac, struct net_device *dev)
 /**
  * function called by net device to handle multicast address relevant things
  */
-static void
-lcs_set_multicast_list(struct net_device *dev)
+static int
+lcs_register_mc_addresses(void *data)
 {
+	struct lcs_card *card;
 	char buf[MAX_ADDR_LEN];
 	struct list_head *l;
 	struct ip_mc_list *im4;
 	struct in_device *in4_dev;
 	struct lcs_ipm_list *ipm, *tmp;
-	struct lcs_card *card;
 
-	LCS_DBF_TEXT(4, trace, "setmulti");
-	in4_dev = in_dev_get(dev);
+	daemonize("regipm");
+	LCS_DBF_TEXT(4, trace, "regmulti");
+
+	card = (struct lcs_card *) data;
+	in4_dev = in_dev_get(card->dev);
 	if (in4_dev == NULL)
-		return;
+		return 0;
 	read_lock(&in4_dev->lock);
-	card = (struct lcs_card *) dev->priv;
-	spin_lock(&card->lock);
+	spin_lock(&card->ipm_lock);
 	/* Check for multicast addresses to be removed. */
 	list_for_each(l, &card->ipm_list) {
 		ipm = list_entry(l, struct lcs_ipm_list, list);
 		for (im4 = in4_dev->mc_list; im4 != NULL; im4 = im4->next) {
-			lcs_get_mac_for_ipm(im4->multiaddr, buf, dev);
+			lcs_get_mac_for_ipm(im4->multiaddr, buf, card->dev);
 			if (memcmp(buf, &ipm->ipm.mac_addr,
 				   LCS_MAC_LENGTH) == 0 &&
 			    ipm->ipm.ip_addr == im4->multiaddr)
@@ -1020,7 +1018,7 @@ lcs_set_multicast_list(struct net_device *dev)
 	}
 	/* Check for multicast addresses to be added. */
 	for (im4 = in4_dev->mc_list; im4; im4 = im4->next) {
-		lcs_get_mac_for_ipm(im4->multiaddr, buf, dev);
+		lcs_get_mac_for_ipm(im4->multiaddr, buf, card->dev);
 		ipm = NULL;
 		list_for_each(l, &card->ipm_list) {
 			tmp = list_entry(l, struct lcs_ipm_list, list);
@@ -1046,14 +1044,56 @@ lcs_set_multicast_list(struct net_device *dev)
 		ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED;
 		list_add(&ipm->list, &card->ipm_list);
 	}
-	spin_unlock(&card->lock);
+	spin_unlock(&card->ipm_lock);
 	read_unlock(&in4_dev->lock);
-	set_bit(3, &card->thread_mask);
-	schedule_work(&card->kernel_thread_starter);
+	lcs_fix_multicast_list(card);
+	in_dev_put(in4_dev);
+	return 0;
+}
+/**
+ * function called by net device to
+ * handle multicast address relevant things
+ */
+static void
+lcs_set_multicast_list(struct net_device *dev)
+{
+        struct lcs_card *card;
+
+        LCS_DBF_TEXT(4, trace, "setmulti");
+        card = (struct lcs_card *) dev->priv;
+        set_bit(3, &card->thread_mask);
+        schedule_work(&card->kernel_thread_starter);
 }
 
 #endif /* CONFIG_IP_MULTICAST */
 
+static long
+lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb)
+{
+	if (!IS_ERR(irb))
+		return 0;
+
+	switch (PTR_ERR(irb)) {
+	case -EIO:
+		PRINT_WARN("i/o-error on device %s\n", cdev->dev.bus_id);
+		LCS_DBF_TEXT(2, trace, "ckirberr");
+		LCS_DBF_TEXT_(2, trace, "  rc%d", -EIO);
+		break;
+	case -ETIMEDOUT:
+		PRINT_WARN("timeout on device %s\n", cdev->dev.bus_id);
+		LCS_DBF_TEXT(2, trace, "ckirberr");
+		LCS_DBF_TEXT_(2, trace, "  rc%d", -ETIMEDOUT);
+		break;
+	default:
+		PRINT_WARN("unknown error %ld on device %s\n", PTR_ERR(irb),
+			   cdev->dev.bus_id);
+		LCS_DBF_TEXT(2, trace, "ckirberr");
+		LCS_DBF_TEXT(2, trace, "  rc???");
+	}
+	return PTR_ERR(irb);
+}
+
+
 /**
  * IRQ Handler for LCS channels
  */
@@ -1064,6 +1104,9 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 	struct lcs_channel *channel;
 	int index;
 
+	if (lcs_check_irb_error(cdev, irb))
+		return;
+
 	card = CARD_FROM_DEV(cdev);
 	if (card->read.ccwdev == cdev)
 		channel = &card->read;
@@ -1513,7 +1556,7 @@ lcs_start_kernel_thread(struct lcs_card *card)
 		kernel_thread(lcs_lgw_stoplan_thread, (void *) card, SIGCHLD);
 #ifdef CONFIG_IP_MULTICAST
 	if (test_and_clear_bit(3, &card->thread_mask))
-		kernel_thread(lcs_fix_multicast_list, (void *) card, SIGCHLD);
+		kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD);
 #endif
 }
 
@@ -1855,8 +1898,10 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
 	lcs_setup_card(card);
 	rc = lcs_detect(card);
 	if (rc) {
+		LCS_DBF_TEXT(2, setup, "dtctfail");
+		PRINT_WARN("Detection of LCS card failed with return code "
+			   "%d (0x%x)\n", rc, rc);
 		lcs_stopcard(card);
-		lcs_cleanup_card(card);
 		goto out;
 	}
 	if (card->dev) {
@@ -1903,7 +1948,7 @@ netdev_out:
 		goto out;
 	memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH);
 #ifdef CONFIG_IP_MULTICAST
-	if (lcs_check_multicast_support(card))
+	if (!lcs_check_multicast_support(card))
 		card->dev->set_multicast_list = lcs_set_multicast_list;
 #endif
 	netif_stop_queue(card->dev);
@@ -1919,7 +1964,6 @@ out:
 
 	ccw_device_set_offline(card->read.ccwdev);
 	ccw_device_set_offline(card->write.ccwdev);
-	lcs_cleanup_card(card);
 	return -ENODEV;
 }
 
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 67c76dbaa..36d9ebd92 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -6,7 +6,7 @@
 #include <linux/workqueue.h>
 #include <asm/ccwdev.h>
 
-#define VERSION_LCS_H "$Revision: 1.15 $"
+#define VERSION_LCS_H "$Revision: 1.16 $"
 
 #define LCS_DBF_TEXT(level, name, text) \
 	do { \
@@ -273,6 +273,7 @@ struct lcs_channel {
  */
 struct lcs_card {
 	spinlock_t lock;
+	spinlock_t ipm_lock;
 	enum lcs_dev_states state;
 	struct net_device *dev;
 	struct net_device_stats stats;
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 13354dfee..570a93b67 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1,5 +1,5 @@
 /*
- * $Id: netiucv.c,v 1.51 2004/04/23 08:11:21 mschwide Exp $
+ * $Id: netiucv.c,v 1.54 2004/05/28 08:04:14 braunu Exp $
  *
  * IUCV network driver
  *
@@ -30,7 +30,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: IUCV network driver $Revision: 1.51 $
+ * RELEASE-TAG: IUCV network driver $Revision: 1.54 $
  *
  */
 
@@ -113,9 +113,6 @@ struct iucv_connection {
  */
 static struct iucv_connection *connections;
 
-/* Keep track of interfaces. */
-static int ifno;
-
 /**
  * Representation of event-data for the
  * connection state machine.
@@ -169,10 +166,10 @@ static __inline__ int netiucv_test_and_set_busy(struct net_device *dev)
 }
 
 static __u8 iucv_host[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-//static __u8 iucvMagic[16] = {
-//	0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
-//	0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
-//};
+static __u8 iucvMagic[16] = {
+	0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
+	0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
+};
 
 /**
  * This mask means the 16-byte IUCV "magic" and the origin userid must
@@ -549,7 +546,7 @@ conn_action_rx(fsm_instance *fi, int event, void *arg)
 	iucv_MessagePending *eib = (iucv_MessagePending *)ev->data;
 	struct netiucv_priv *privptr = (struct netiucv_priv *)conn->netdev->priv;
 
-	__u16 msglen = eib->ln1msg2.ipbfln1f;
+	__u32 msglen = eib->ln1msg2.ipbfln1f;
 	int rc;
 
 	pr_debug("%s() called\n", __FUNCTION__);
@@ -571,6 +568,7 @@ conn_action_rx(fsm_instance *fi, int event, void *arg)
 			  conn->rx_buff->data, msglen, NULL, NULL, NULL);
 	if (rc != 0 || msglen < 5) {
 		privptr->stats.rx_errors++;
+		printk(KERN_INFO "iucv_receive returned %08x\n", rc);
 		return;
 	}
 	netiucv_unpack_skb(conn, conn->rx_buff);
@@ -647,7 +645,7 @@ conn_action_txdone(fsm_instance *fi, int event, void *arg)
 			fsm_newstate(fi, CONN_STATE_IDLE);
 			if (privptr)
 				privptr->stats.tx_errors += txpackets;
-			printk(KERN_DEBUG "iucv_send returned %08x\n",
+			printk(KERN_INFO "iucv_send returned %08x\n",
 				rc);
 		} else {
 			if (privptr) {
@@ -771,14 +769,9 @@ conn_action_start(fsm_instance *fi, int event, void *arg)
 	struct iucv_connection *conn = ev->conn;
 	__u16 msglimit;
 	int rc;
-	__u8 iucvMagic[16] = {
-	0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
-        0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40
-	};
 
 	pr_debug("%s() called\n", __FUNCTION__);
 
-	memcpy(iucvMagic, conn->netdev->name, IFNAMSIZ);
 	if (conn->handle == 0) {
 		conn->handle =
 			iucv_register_program(iucvMagic, conn->userid, mask,
@@ -992,6 +985,7 @@ static void
 dev_action_connup(fsm_instance *fi, int event, void *arg)
 {
 	struct net_device   *dev = (struct net_device *)arg;
+	struct netiucv_priv *privptr = dev->priv;
 
 	pr_debug("%s() called\n", __FUNCTION__);
 
@@ -999,8 +993,8 @@ dev_action_connup(fsm_instance *fi, int event, void *arg)
 		case DEV_STATE_STARTWAIT:
 			fsm_newstate(fi, DEV_STATE_RUNNING);
 			printk(KERN_INFO
-			       "%s: connected with remote side\n",
-			       dev->name);
+			       "%s: connected with remote side %s\n",
+			       dev->name, privptr->conn->userid);
 			break;
 		case DEV_STATE_STOPWAIT:
 			printk(KERN_INFO
@@ -1140,7 +1134,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
 				skb_pull(skb, NETIUCV_HDRLEN);
 				skb_trim(skb, skb->len - NETIUCV_HDRLEN);
 			}
-			printk(KERN_DEBUG "iucv_send returned %08x\n",
+			printk(KERN_INFO "iucv_send returned %08x\n",
 				rc);
 		} else {
 			if (copied)
@@ -1612,7 +1606,7 @@ netiucv_remove_files(struct device *dev)
 }
 
 static int
-netiucv_register_device(struct net_device *ndev, int ifno)
+netiucv_register_device(struct net_device *ndev)
 {
 	struct netiucv_priv *priv = ndev->priv;
 	struct device *dev = kmalloc(sizeof(struct device), GFP_KERNEL);
@@ -1623,7 +1617,7 @@ netiucv_register_device(struct net_device *ndev, int ifno)
 
 	if (dev) {
 		memset(dev, 0, sizeof(struct device));
-		snprintf(dev->bus_id, BUS_ID_SIZE, "netiucv%x", ifno);
+		snprintf(dev->bus_id, BUS_ID_SIZE, "net%s", ndev->name);
 		dev->bus = &iucv_bus;
 		dev->parent = iucv_root;
 		/*
@@ -1801,16 +1795,15 @@ netiucv_setup_netdevice(struct net_device *dev)
  * Allocate and initialize everything of a net device.
  */
 static struct net_device *
-netiucv_init_netdevice(int ifno, char *username)
+netiucv_init_netdevice(char *username)
 {
 	struct netiucv_priv *privptr;
 	struct net_device *dev;
 
-	dev = alloc_netdev(sizeof(struct netiucv_priv), "",
+	dev = alloc_netdev(sizeof(struct netiucv_priv), "iucv%d",
 			   netiucv_setup_netdevice);
 	if (!dev)
 		return NULL;
-	sprintf(dev->name, "iucv%d", ifno);
 
         privptr = (struct netiucv_priv *)dev->priv;
 	privptr->fsm = init_fsm("netiucvdev", dev_state_names,
@@ -1861,7 +1854,7 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
 	while (i<9)
 		username[i++] = ' ';
 	username[9] = '\0';
-	dev = netiucv_init_netdevice(ifno, username);
+	dev = netiucv_init_netdevice(username);
 	if (!dev) {
 		printk(KERN_WARNING
 		       "netiucv: Could not allocate network device structure "
@@ -1869,16 +1862,18 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
 		return -ENODEV;
 	}
 	
-	if ((ret = netiucv_register_device(dev, ifno)))
-		goto out_free_ndev;
-	/* sysfs magic */
-	SET_NETDEV_DEV(dev, (struct device*)((struct netiucv_priv*)dev->priv)->dev);
 	if ((ret = register_netdev(dev))) {
-		netiucv_unregister_device((struct device*)((struct netiucv_priv*)dev->priv)->dev);
 		goto out_free_ndev;
 	}
+
+	if ((ret = netiucv_register_device(dev))) {
+		unregister_netdev(dev);
+		goto out_free_ndev;
+	}
+
+	/* sysfs magic */
+	SET_NETDEV_DEV(dev, (struct device*)((struct netiucv_priv*)dev->priv)->dev);
 	printk(KERN_INFO "%s: '%s'\n", dev->name, netiucv_printname(username));
-	ifno++;
 	
 	return count;
 
@@ -1891,6 +1886,61 @@ out_free_ndev:
 
 DRIVER_ATTR(connection, 0200, NULL, conn_write);
 
+static ssize_t
+remove_write (struct device_driver *drv, const char *buf, size_t count)
+{
+	struct iucv_connection **clist = &connections;
+        struct net_device *ndev;
+        struct netiucv_priv *priv;
+        struct device *dev;
+        char name[IFNAMSIZ];
+        char *p;
+        int i;
+
+        pr_debug("%s() called\n", __FUNCTION__);
+
+        if (count >= IFNAMSIZ)
+                count = IFNAMSIZ-1;
+
+        for (i=0, p=(char *)buf; i<count && *p; i++, p++) {
+                if ((*p == '\n') | (*p == ' ')) {
+                        /* trailing lf, grr */
+                        break;
+                } else {
+                        name[i]=*p;
+                }
+        }
+        name[i] = '\0';
+
+        while (*clist) {
+                ndev = (*clist)->netdev;
+                priv = (struct netiucv_priv*)ndev->priv;
+                dev = priv->dev;
+
+                if (strncmp(name, ndev->name, count)) {
+                        clist = &((*clist)->next);
+                        continue;
+                }
+                if (ndev->flags & (IFF_UP | IFF_RUNNING)) {
+                        printk(KERN_WARNING
+                                "netiucv: net device %s active with peer %s\n",
+                                ndev->name, priv->conn->userid);
+                        printk(KERN_WARNING
+                                "netiucv: %s cannot be removed\n",
+                                ndev->name);
+                        return -EBUSY;
+                }
+                unregister_netdev(ndev);
+                netiucv_unregister_device(dev);
+                return count;
+        }
+        printk(KERN_WARNING
+                "netiucv: net device %s unknown\n", name);
+        return -EINVAL;
+}
+
+DRIVER_ATTR(remove, 0200, NULL, remove_write);
+
 static struct device_driver netiucv_driver = {
 	.name = "netiucv",
 	.bus  = &iucv_bus,
@@ -1899,7 +1949,7 @@ static struct device_driver netiucv_driver = {
 static void
 netiucv_banner(void)
 {
-	char vbuf[] = "$Revision: 1.51 $";
+	char vbuf[] = "$Revision: 1.54 $";
 	char *version = vbuf;
 
 	if ((version = strchr(version, ':'))) {
@@ -1924,6 +1974,7 @@ netiucv_exit(void)
 	}
 
 	driver_remove_file(&netiucv_driver, &driver_attr_connection);
+	driver_remove_file(&netiucv_driver, &driver_attr_remove);
 	driver_unregister(&netiucv_driver);
 
 	printk(KERN_INFO "NETIUCV driver unloaded\n");
@@ -1943,10 +1994,10 @@ netiucv_init(void)
 
 	/* Add entry for specifying connections. */
 	ret = driver_create_file(&netiucv_driver, &driver_attr_connection);
-
-	if (ret == 0)
+	if (ret == 0) {
+		ret = driver_create_file(&netiucv_driver, &driver_attr_remove);
 		netiucv_banner();
-	else {
+	} else {
 		printk(KERN_ERR "NETIUCV: failed to add driver attribute.\n");
 		driver_unregister(&netiucv_driver);
 	}
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 1ec0d3fd9..96c4243a2 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -23,7 +23,7 @@
 
 #include "qeth_mpc.h"
 
-#define VERSION_QETH_H 		"$Revision: 1.102 $"
+#define VERSION_QETH_H 		"$Revision: 1.110 $"
 
 #ifdef CONFIG_QETH_IPV6
 #define QETH_VERSION_IPV6 	":IPv6"
@@ -91,10 +91,14 @@
 		debug_event(qeth_dbf_##name,level,(void*)(addr),len); \
 	} while (0)
 
-#define QETH_DBF_TEXT_(name,level,text...)				  \
-	do {								  \
-		sprintf(qeth_dbf_text_buf, text);			  \
-		debug_text_event(qeth_dbf_##name,level,qeth_dbf_text_buf);\
+extern DEFINE_PER_CPU(char[256], qeth_dbf_txt_buf);
+
+#define QETH_DBF_TEXT_(name,level,text...)				\
+	do {								\
+		char* dbf_txt_buf = get_cpu_var(qeth_dbf_txt_buf);	\
+		sprintf(dbf_txt_buf, text);			  	\
+		debug_text_event(qeth_dbf_##name,level,dbf_txt_buf);	\
+		put_cpu_var(qeth_dbf_txt_buf);				\
 	} while (0)
 
 #define QETH_DBF_SPRINTF(name,level,text...) \
@@ -179,13 +183,26 @@ struct qeth_perf_stats {
 
 	unsigned int sc_dp_p;
 	unsigned int sc_p_dp;
-
+	/* qdio_input_handler: number of times called, time spent in */
 	__u64 inbound_start_time;
 	unsigned int inbound_cnt;
 	unsigned int inbound_time;
+	/* qeth_send_packet: number of times called, time spent in */
 	__u64 outbound_start_time;
 	unsigned int outbound_cnt;
 	unsigned int outbound_time;
+	/* qdio_output_handler: number of times called, time spent in */
+	__u64 outbound_handler_start_time;
+	unsigned int outbound_handler_cnt;
+	unsigned int outbound_handler_time;
+	/* number of calls to and time spent in do_QDIO for inbound queue */
+	__u64 inbound_do_qdio_start_time;
+	unsigned int inbound_do_qdio_cnt;
+	unsigned int inbound_do_qdio_time;
+	/* number of calls to and time spent in do_QDIO for outbound queues */
+	__u64 outbound_do_qdio_start_time;
+	unsigned int outbound_do_qdio_cnt;
+	unsigned int outbound_do_qdio_time;
 };
 #endif /* CONFIG_QETH_PERF_STATS */
 
@@ -279,7 +296,7 @@ qeth_is_ipa_enabled(struct qeth_ipa_info *ipa, enum qeth_ipa_funcs func)
 #define QETH_IN_BUF_COUNT_MAX 128
 #define QETH_MAX_BUFFER_ELEMENTS(card) ((card)->qdio.in_buf_size >> 12)
 #define QETH_IN_BUF_REQUEUE_THRESHOLD(card) \
-		((card)->qdio.in_buf_pool.buf_count / 4)
+		((card)->qdio.in_buf_pool.buf_count / 2)
 
 /* buffers we have to be behind before we get a PCI */
 #define QETH_PCI_THRESHOLD_A(card) ((card)->qdio.in_buf_pool.buf_count+1)
@@ -363,11 +380,6 @@ enum qeth_qdio_buffer_states {
 	 * outbound: filled by driver; owned by hardware in order to be sent
 	 */
 	QETH_QDIO_BUF_PRIMED,
-	/*
-	 * inbound only: an error condition has been detected for a buffer
-	 *     the buffer will be discarded (not read out)
-	 */
-	QETH_QDIO_BUF_ERROR,
 };
 
 enum qeth_qdio_info_states {
@@ -406,7 +418,7 @@ struct qeth_qdio_q {
 
 struct qeth_qdio_out_buffer {
 	struct qdio_buffer *buffer;
-	volatile enum qeth_qdio_buffer_states state;
+	atomic_t state;
 	volatile int next_element_to_fill;
 	struct sk_buff_head skb_list;
 };
@@ -606,6 +618,7 @@ struct qeth_reply {
 	wait_queue_head_t wait_q;
 	int (*callback)(struct qeth_card *,struct qeth_reply *,unsigned long);
  	int seqno;
+	unsigned long offset;
 	int received;
 	int rc;
 	void *param;
@@ -613,8 +626,10 @@ struct qeth_reply {
 	atomic_t refcnt;
 };
 
-struct qeth_card_info {
+#define QETH_BROADCAST_WITH_ECHO    1
+#define QETH_BROADCAST_WITHOUT_ECHO 2
 
+struct qeth_card_info {
 	char if_name[IF_NAME_LEN];
 	unsigned short unit_addr2;
 	unsigned short cula;
@@ -646,7 +661,6 @@ struct qeth_card_options {
 	enum qeth_checksum_types checksum_type;
 	int broadcast_mode;
 	int macaddr_mode;
-	int enable_takeover;
 	int fake_broadcast;
 	int add_hhlen;
 	int fake_ll;
@@ -710,6 +724,15 @@ struct qeth_card_list_struct {
 
 extern struct qeth_card_list_struct qeth_card_list;
 
+/*notifier list */
+struct qeth_notify_list_struct {
+	struct list_head list;
+	struct task_struct *task;
+	int signum;
+};
+extern spinlock_t qeth_notify_lock;
+extern struct list_head qeth_notify_list;
+
 /*some helper functions*/
 
 inline static __u8
@@ -993,6 +1016,12 @@ qeth_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
 extern void
 qeth_del_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
 
+extern int
+qeth_notifier_register(struct task_struct *, int );
+
+extern int
+qeth_notifier_unregister(struct task_struct * );
+
 extern void
 qeth_schedule_recovery(struct qeth_card *);
 
diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h
index 030aa6a13..9e45195b3 100644
--- a/drivers/s390/net/qeth_fs.h
+++ b/drivers/s390/net/qeth_fs.h
@@ -12,6 +12,11 @@
 #ifndef __QETH_FS_H__
 #define __QETH_FS_H__
 
+#define VERSION_QETH_FS_H "$Revision: 1.8 $"
+
+extern const char *VERSION_QETH_PROC_C;
+extern const char *VERSION_QETH_SYS_C;
+
 #ifdef CONFIG_PROC_FS
 extern int
 qeth_create_procfs_entries(void);
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index ba6ed9bee..8aefa28c2 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.89 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.121 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.89 $	 $Date: 2004/04/27 16:27:26 $
+ *    $Revision: 1.121 $	 $Date: 2004/06/11 16:32:15 $
  *
  * 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
@@ -78,10 +78,9 @@ qeth_eyecatcher(void)
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-#define VERSION_QETH_C "$Revision: 1.89 $"
-static const char *version = "qeth S/390 OSA-Express driver ("
-	VERSION_QETH_C "/" VERSION_QETH_H "/" VERSION_QETH_MPC_H
-	QETH_VERSION_IPV6 QETH_VERSION_VLAN ")";
+#define VERSION_QETH_C "$Revision: 1.121 $"
+static const char *version = "qeth S/390 OSA-Express driver";
+
 /**
  * Debug Facility Stuff
  */
@@ -92,7 +91,8 @@ static debug_info_t *qeth_dbf_control = NULL;
 static debug_info_t *qeth_dbf_trace = NULL;
 static debug_info_t *qeth_dbf_sense = NULL;
 static debug_info_t *qeth_dbf_qerr = NULL;
-static char qeth_dbf_text_buf[255];
+
+DEFINE_PER_CPU(char[256], qeth_dbf_txt_buf);
 
 /**
  * some more definitions and declarations
@@ -101,12 +101,13 @@ static unsigned int known_devices[][10] = QETH_MODELLIST_ARRAY;
 
 /* list of our cards */
 struct qeth_card_list_struct qeth_card_list;
+/*process list want to be notified*/
+spinlock_t qeth_notify_lock;
+struct list_head qeth_notify_list;
 
 static void qeth_send_control_data_cb(struct qeth_channel *,
 				      struct qeth_cmd_buffer *);
 
-static atomic_t qeth_hsi_count;
-
 /**
  * here we go with function implementation
  */
@@ -154,6 +155,72 @@ qeth_irq_tasklet(unsigned long);
 
 static int
 qeth_set_online(struct ccwgroup_device *);
+
+static struct qeth_ipaddr *
+qeth_get_addr_buffer(enum qeth_prot_versions);
+
+static void
+qeth_notify_processes(void)
+{
+	/*notify all  registered processes */
+	struct qeth_notify_list_struct *n_entry;
+
+	QETH_DBF_TEXT(trace,3,"procnoti");
+	spin_lock(&qeth_notify_lock);
+	list_for_each_entry(n_entry, &qeth_notify_list, list) {
+		send_sig(n_entry->signum, n_entry->task, 1);
+	}
+	spin_unlock(&qeth_notify_lock);
+
+}
+int
+qeth_notifier_unregister(struct task_struct *p)
+{
+	struct qeth_notify_list_struct *n_entry, *tmp;
+
+	QETH_DBF_TEXT(trace, 2, "notunreg");
+	spin_lock(&qeth_notify_lock);
+	list_for_each_entry_safe(n_entry, tmp, &qeth_notify_list, list) {
+		if (n_entry->task == p) {
+			list_del(&n_entry->list);
+			kfree(n_entry);
+			goto out;
+		}
+	}
+out:
+	spin_unlock(&qeth_notify_lock);
+	return 0;
+}
+int
+qeth_notifier_register(struct task_struct *p, int signum)
+{
+	struct qeth_notify_list_struct *n_entry;
+
+	QETH_DBF_TEXT(trace, 2, "notreg");
+	/*check first if entry already exists*/
+	spin_lock(&qeth_notify_lock);
+	list_for_each_entry(n_entry, &qeth_notify_list, list) {
+		if (n_entry->task == p) {
+			n_entry->signum = signum;
+			spin_unlock(&qeth_notify_lock);
+			return 0;
+		}
+	}
+	spin_unlock(&qeth_notify_lock);
+
+	n_entry = (struct qeth_notify_list_struct *)
+		kmalloc(sizeof(struct qeth_notify_list_struct),GFP_KERNEL);
+	if (!n_entry)
+		return -ENOMEM;
+	n_entry->task = p;
+	n_entry->signum = signum;
+	spin_lock(&qeth_notify_lock);
+	list_add(&n_entry->list,&qeth_notify_list);
+	spin_unlock(&qeth_notify_lock);
+	return 0;
+}
+
+
 /**
  * free channel command buffers
  */
@@ -459,6 +526,7 @@ qeth_set_offline(struct ccwgroup_device *cgdev)
 	ccw_device_set_offline(CARD_RDEV(card));
 	if (recover_flag == CARD_STATE_UP)
 		card->state = CARD_STATE_RECOVER;
+	qeth_notify_processes();
 	return 0;
 }
 
@@ -478,8 +546,6 @@ qeth_remove_device(struct ccwgroup_device *cgdev)
 		card->use_hard_stop = 1;
 		qeth_set_offline(cgdev);
 	}
-	if (card->info.type == QETH_CARD_TYPE_IQD)
-		atomic_dec(&qeth_hsi_count);
 	/* remove form our internal list */
 	write_lock_irqsave(&qeth_card_list.rwlock, flags);
 	list_del(&card->list);
@@ -700,7 +766,7 @@ static void
 qeth_set_ip_addr_list(struct qeth_card *card)
 {
 	struct list_head failed_todos;
-	struct qeth_ipaddr *todo, *addr, *tmp;
+	struct qeth_ipaddr *todo, *addr;
 	unsigned long flags;
 	int rc;
 
@@ -709,9 +775,10 @@ qeth_set_ip_addr_list(struct qeth_card *card)
 
 	INIT_LIST_HEAD(&failed_todos);
 
-process_todos:
 	spin_lock_irqsave(&card->ip_lock, flags);
-	list_for_each_entry_safe(todo, tmp, &card->ip_tbd_list, entry) {
+	while (!list_empty(&card->ip_tbd_list)) {
+		todo = list_entry(card->ip_tbd_list.next,
+				  struct qeth_ipaddr, entry);
 		list_del_init(&todo->entry);
 		rc = __qeth_ref_ip_on_card(card, todo, &addr);
 		if (rc == 0) {
@@ -721,28 +788,24 @@ process_todos:
 			/* new entry to be added to on-card list */
 			spin_unlock_irqrestore(&card->ip_lock, flags);
 			rc = qeth_register_addr_entry(card, todo);
-			if (!rc){
-				spin_lock_irqsave(&card->ip_lock, flags);
+			spin_lock_irqsave(&card->ip_lock, flags);
+			if (!rc)
 				list_add_tail(&todo->entry, &card->ip_list);
-				spin_unlock_irqrestore(&card->ip_lock, flags);
-			} else
+			else
 				list_add_tail(&todo->entry, &failed_todos);
-			goto process_todos;
 		} else if (rc == -1) {
 			/* on-card entry to be removed */
 			list_del_init(&addr->entry);
 			spin_unlock_irqrestore(&card->ip_lock, flags);
 			rc = qeth_deregister_addr_entry(card, addr);
+			spin_lock_irqsave(&card->ip_lock, flags);
 			if (!rc) {
 				kfree(addr);
 				kfree(todo);
 			} else {
-				spin_lock_irqsave(&card->ip_lock, flags);
 				list_add_tail(&addr->entry, &card->ip_list);
 				list_add_tail(&todo->entry, &failed_todos);
-				spin_unlock_irqrestore(&card->ip_lock, flags);
 			}
-			goto process_todos;
 		}
 	}
 	spin_unlock_irqrestore(&card->ip_lock, flags);
@@ -937,7 +1000,6 @@ qeth_set_intial_options(struct qeth_card *card)
 	card->options.checksum_type = QETH_CHECKSUM_DEFAULT;
 	card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
 	card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL;
-	card->options.enable_takeover = 1;
 	card->options.fake_broadcast = 0;
 	card->options.add_hhlen = DEFAULT_ADD_HHLEN;
 	card->options.fake_ll = 0;
@@ -998,10 +1060,6 @@ qeth_determine_card_type(struct qeth_card *card)
 		if ((CARD_RDEV(card)->id.dev_type == known_devices[i][2]) &&
 		    (CARD_RDEV(card)->id.dev_model == known_devices[i][3])) {
 			card->info.type = known_devices[i][4];
-			if (card->options.enable_takeover)
-				card->info.func_level = known_devices[i][6];
-			else
-				card->info.func_level = known_devices[i][7];
 			card->qdio.no_out_queues = known_devices[i][8];
 			card->info.is_multicast_different = known_devices[i][9];
 			return 0;
@@ -1456,7 +1514,7 @@ qeth_alloc_reply(struct qeth_card *card)
 {
 	struct qeth_reply *reply;
 
-	reply = kmalloc(sizeof(struct qeth_reply), GFP_KERNEL|GFP_ATOMIC);
+	reply = kmalloc(sizeof(struct qeth_reply), GFP_ATOMIC);
 	if (reply){
 		memset(reply, 0, sizeof(struct qeth_reply));
 		atomic_set(&reply->refcnt, 1);
@@ -1627,17 +1685,20 @@ qeth_send_control_data_cb(struct qeth_channel *channel,
 			spin_unlock_irqrestore(&card->lock, flags);
 			keep_reply = 0;
 			if (reply->callback != NULL) {
-				if (cmd)
+				if (cmd) {
+					reply->offset = (__u16)((char*)cmd -
+								(char *)iob->data);
 					keep_reply = reply->callback(card,
 							reply,
 							(unsigned long)cmd);
+				}
 				else
 					keep_reply = reply->callback(card,
 							reply,
 							(unsigned long)iob);
 			}
 			if (cmd)
-				reply->rc = cmd->hdr.return_code;
+				reply->rc = (s16) cmd->hdr.return_code;
 			else if (iob->rc)
 				reply->rc = iob->rc;
 			if (keep_reply) {
@@ -1703,7 +1764,10 @@ qeth_send_control_data(struct qeth_card *card, int len,
 	init_timer(&timer);
 	timer.function = qeth_cmd_timeout;
 	timer.data = (unsigned long) reply;
-	timer.expires = jiffies + QETH_TIMEOUT;
+	if (IS_IPA(iob->data))
+		timer.expires = jiffies + QETH_IPA_TIMEOUT;
+	else
+		timer.expires = jiffies + QETH_TIMEOUT;
 	init_waitqueue_head(&reply->wait_q);
 	spin_lock_irqsave(&card->lock, flags);
 	list_add_tail(&reply->list, &card->cmd_waiter_list);
@@ -1743,12 +1807,10 @@ qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
 		  (struct qeth_card *,struct qeth_reply*, unsigned long),
 		  void *reply_param)
 {
-	struct qeth_ipa_cmd *cmd;
 	int rc;
 
 	QETH_DBF_TEXT(trace,4,"sendipa");
 
-	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
 	memcpy(iob->data, IPA_PDU_HEADER, IPA_PDU_HEADER_SIZE);
 	memcpy(QETH_IPA_CMD_DEST_ADDR(iob->data),
 	       &card->token.ulp_connection_r, QETH_MPC_TOKEN_LENGTH);
@@ -2227,12 +2289,11 @@ qeth_process_inbound_buffer(struct qeth_card *card,
 	while((skb = qeth_get_next_skb(card, buf->buffer, &element,
 				       &offset, &hdr))){
 		qeth_rebuild_skb(card, skb, hdr);
-
-#ifdef CONFIG_QETH_PERF_STATS
-		card->perf_stats.inbound_time += qeth_get_micros() -
-			card->perf_stats.inbound_start_time;
-		card->perf_stats.inbound_cnt++;
-#endif
+		/* is device UP ? */
+		if (!(card->dev->flags & IFF_UP)){
+			dev_kfree_skb_irq(skb);
+			continue;
+		}
 		skb->dev = card->dev;
 		rxrc = netif_rx(skb);
 		card->dev->last_rx = jiffies;
@@ -2284,13 +2345,17 @@ qeth_init_input_buffer(struct qeth_card *card, struct qeth_qdio_buffer *buf)
 }
 
 static inline void
-qeth_clear_output_buffer(struct qeth_card *card,
+qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
 			 struct qeth_qdio_out_buffer *buf)
 {
 	int i;
 	struct sk_buff *skb;
 
-	for(i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i){
+	/* is PCI flag set on buffer? */
+	if (buf->buffer->element[0].flags & 0x40)
+		atomic_dec(&queue->set_pci_flags_count);
+
+	for(i = 0; i < QETH_MAX_BUFFER_ELEMENTS(queue->card); ++i){
 		buf->buffer->element[i].length = 0;
 		buf->buffer->element[i].addr = NULL;
 		buf->buffer->element[i].flags = 0;
@@ -2300,7 +2365,7 @@ qeth_clear_output_buffer(struct qeth_card *card,
 		}
 	}
 	buf->next_element_to_fill = 0;
-	buf->state = QETH_QDIO_BUF_EMPTY;
+	atomic_set(&buf->state, QETH_QDIO_BUF_EMPTY);
 }
 
 static inline void
@@ -2330,9 +2395,17 @@ qeth_queue_input_buffer(struct qeth_card *card, int index)
 		 * 'index') un-requeued -> this buffer is the first buffer that
 		 * will be requeued the next time
 		 */
+#ifdef CONFIG_QETH_PERF_STATS
+		card->perf_stats.inbound_do_qdio_cnt++;
+		card->perf_stats.inbound_do_qdio_start_time = qeth_get_micros();
+#endif
 		rc = do_QDIO(CARD_DDEV(card),
-			     QDIO_FLAG_SYNC_INPUT,
+			     QDIO_FLAG_SYNC_INPUT | QDIO_FLAG_UNDER_INTERRUPT,
 			     0, queue->next_buf_to_init, count, NULL);
+#ifdef CONFIG_QETH_PERF_STATS
+		card->perf_stats.inbound_do_qdio_time += qeth_get_micros() -
+			card->perf_stats.inbound_do_qdio_start_time;
+#endif
 		if (rc){
 			PRINT_WARN("qeth_queue_input_buffer's do_QDIO "
 				   "return %i (device %s).\n",
@@ -2369,6 +2442,7 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status,
 	card = (struct qeth_card *) card_ptr;
 	net_dev = card->dev;
 #ifdef CONFIG_QETH_PERF_STATS
+	card->perf_stats.inbound_cnt++;
 	card->perf_stats.inbound_start_time = qeth_get_micros();
 #endif
 	if (status & QDIO_STATUS_LOOK_FOR_ERROR) {
@@ -2391,6 +2465,10 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status,
 		qeth_put_buffer_pool_entry(card, buffer->pool_entry);
 		qeth_queue_input_buffer(card, index);
 	}
+#ifdef CONFIG_QETH_PERF_STATS
+	card->perf_stats.inbound_time += qeth_get_micros() -
+		card->perf_stats.inbound_start_time;
+#endif
 }
 
 static inline int
@@ -2449,6 +2527,9 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
 		buf->buffer->element[buf->next_element_to_fill - 1].flags |=
 				SBAL_FLAGS_LAST_ENTRY;
 
+		if (queue->card->info.type == QETH_CARD_TYPE_IQD)
+			continue;
+
 		if (!queue->do_pack){
 			if ((atomic_read(&queue->used_buffers) >=
 		    		(QETH_HIGH_WATERMARK_PACK -
@@ -2479,6 +2560,10 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
 	}
 
 	queue->card->dev->trans_start = jiffies;
+#ifdef CONFIG_QETH_PERF_STATS
+	queue->card->perf_stats.outbound_do_qdio_cnt++;
+	queue->card->perf_stats.outbound_do_qdio_start_time = qeth_get_micros();
+#endif
 	if (under_int)
 		rc = do_QDIO(CARD_DDEV(queue->card),
 			     QDIO_FLAG_SYNC_OUTPUT | QDIO_FLAG_UNDER_INTERRUPT,
@@ -2486,6 +2571,10 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
 	else
 		rc = do_QDIO(CARD_DDEV(queue->card), QDIO_FLAG_SYNC_OUTPUT,
 			     queue->queue_no, index, count, NULL);
+#ifdef CONFIG_QETH_PERF_STATS
+	queue->card->perf_stats.outbound_do_qdio_time += qeth_get_micros() -
+		queue->card->perf_stats.outbound_do_qdio_start_time;
+#endif
 	if (rc){
 		QETH_DBF_SPRINTF(trace, 0, "qeth_flush_buffers: do_QDIO "
 				 "returned error (%i) on device %s.",
@@ -2493,11 +2582,19 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
 		QETH_DBF_TEXT(trace, 2, "flushbuf");
 		QETH_DBF_TEXT_(trace, 2, " err%d", rc);
 		queue->card->stats.tx_errors += count;
+		/* ok, since do_QDIO went wrong the buffers have not been given
+		 * to the hardware. they still belong to us, so we can clear
+		 * them and reuse then, i.e. set back next_buf_to_fill*/
+		for (i = index; i < index + count; ++i) {
+			buf = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q];
+			qeth_clear_output_buffer(queue, buf);
+		}
+		queue->next_buf_to_fill = index;
 		return;
 	}
+	atomic_add(count, &queue->used_buffers);
 #ifdef CONFIG_QETH_PERF_STATS
 	queue->card->perf_stats.bufs_sent += count;
-	queue->card->perf_stats.outbound_cnt++;
 #endif
 }
 
@@ -2533,11 +2630,11 @@ qeth_switch_packing_state(struct qeth_qdio_out_q *queue)
 			queue->do_pack = 0;
 			/* flush packing buffers */
 			buffer = &queue->bufs[queue->next_buf_to_fill];
-			BUG_ON(buffer->state == QETH_QDIO_BUF_PRIMED);
-			if (buffer->next_element_to_fill > 0) {
-				buffer->state = QETH_QDIO_BUF_PRIMED;
+			if ((atomic_read(&buffer->state) ==
+						QETH_QDIO_BUF_EMPTY) &&
+			    (buffer->next_element_to_fill > 0)) {
+				atomic_set(&buffer->state,QETH_QDIO_BUF_PRIMED);
 				flush_count++;
-				atomic_inc(&queue->used_buffers);
 				queue->next_buf_to_fill =
 					(queue->next_buf_to_fill + 1) %
 					QDIO_MAX_BUFFERS_PER_Q;
@@ -2551,17 +2648,17 @@ static inline void
 qeth_flush_buffers_on_no_pci(struct qeth_qdio_out_q *queue, int under_int)
 {
 	struct qeth_qdio_out_buffer *buffer;
+	int index;
 
-	buffer = &queue->bufs[queue->next_buf_to_fill];
-	BUG_ON(buffer->state == QETH_QDIO_BUF_PRIMED);
-	if (buffer->next_element_to_fill > 0){
+	index = queue->next_buf_to_fill;
+	buffer = &queue->bufs[index];
+	if((atomic_read(&buffer->state) == QETH_QDIO_BUF_EMPTY) &&
+	   (buffer->next_element_to_fill > 0)){
 		/* it's a packing buffer */
-		buffer->state = QETH_QDIO_BUF_PRIMED;
-		atomic_inc(&queue->used_buffers);
-		qeth_flush_buffers(queue, under_int, queue->next_buf_to_fill,
-				   1);
+		atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
 		queue->next_buf_to_fill =
 			(queue->next_buf_to_fill + 1) % QDIO_MAX_BUFFERS_PER_Q;
+		qeth_flush_buffers(queue, under_int, index, 1);
 	}
 }
 
@@ -2591,6 +2688,10 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status,
 		}
 	}
 
+#ifdef CONFIG_QETH_PERF_STATS
+	card->perf_stats.outbound_handler_cnt++;
+	card->perf_stats.outbound_handler_start_time = qeth_get_micros();
+#endif
 	for(i = first_element; i < (first_element + count); ++i){
 		buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q];
 		/*we only handle the KICK_IT error by doing a recovery */
@@ -2600,15 +2701,15 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status,
 			qeth_schedule_recovery(card);
 			return;
 		}
-		/* is PCI flag set on buffer? */
-		if (buffer->buffer->element[0].flags & 0x40)
-			atomic_dec(&queue->set_pci_flags_count);
-
-		qeth_clear_output_buffer(card, buffer);
-		atomic_dec(&queue->used_buffers);
+		qeth_clear_output_buffer(queue, buffer);
 	}
+	atomic_sub(count, &queue->used_buffers);
 
 	netif_wake_queue(card->dev);
+#ifdef CONFIG_QETH_PERF_STATS
+	card->perf_stats.outbound_handler_time += qeth_get_micros() -
+		card->perf_stats.outbound_handler_start_time;
+#endif
 }
 
 static char*
@@ -2795,8 +2896,8 @@ qeth_free_qdio_buffers(struct qeth_card *card)
 	/* free outbound qdio_qs */
 	for (i = 0; i < card->qdio.no_out_queues; ++i){
 		for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
-			qeth_clear_output_buffer(card, &card->qdio.
-						out_qs[i]->bufs[j]);
+			qeth_clear_output_buffer(card->qdio.out_qs[i],
+					&card->qdio.out_qs[i]->bufs[j]);
 		kfree(card->qdio.out_qs[i]);
 	}
 	kfree(card->qdio.out_qs);
@@ -2813,8 +2914,8 @@ qeth_clear_qdio_buffers(struct qeth_card *card)
 	for (i = 0; i < card->qdio.no_out_queues; ++i)
 		if (card->qdio.out_qs[i]){
 			for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
-				qeth_clear_output_buffer(card, &card->qdio.
-						out_qs[i]->bufs[j]);
+				qeth_clear_output_buffer(card->qdio.out_qs[i],
+						&card->qdio.out_qs[i]->bufs[j]);
 		}
 }
 
@@ -2866,8 +2967,8 @@ qeth_init_qdio_queues(struct qeth_card *card)
 		memset(card->qdio.out_qs[i]->qdio_bufs, 0,
 		       QDIO_MAX_BUFFERS_PER_Q * sizeof(struct qdio_buffer));
 		for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j){
-			qeth_clear_output_buffer(card, &card->qdio.
-						 out_qs[i]->bufs[j]);
+			qeth_clear_output_buffer(card->qdio.out_qs[i],
+					&card->qdio.out_qs[i]->bufs[j]);
 		}
 		card->qdio.out_qs[i]->card = card;
 		card->qdio.out_qs[i]->next_buf_to_fill = 0;
@@ -3134,20 +3235,6 @@ out_qdio:
 	return rc;
 }
 
-static void
-qeth_set_device_name(struct qeth_card *card)
-{
-	char buf[IF_NAME_LEN];
-
-	memset(buf, 0, IF_NAME_LEN);
-	if (card->info.type == QETH_CARD_TYPE_IQD) {
-		sprintf(buf,"hsi%d", atomic_read(&qeth_hsi_count));
-		atomic_inc(&qeth_hsi_count);
-		memcpy(card->dev->name,buf,IF_NAME_LEN);
-	}
-
-}
-
 static struct net_device *
 qeth_get_netdevice(enum qeth_card_types type, enum qeth_link_types linktype)
 {
@@ -3167,6 +3254,8 @@ qeth_get_netdevice(enum qeth_card_types type, enum qeth_link_types linktype)
 		}
 		break;
 	case QETH_CARD_TYPE_IQD:
+		dev = alloc_netdev(0, "hsi%d", ether_setup);
+		break;
 	default:
 		dev = alloc_etherdev(0);
 	}
@@ -3195,11 +3284,8 @@ qeth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		card->stats.tx_carrier_errors++;
 		return -EIO;
 	}
-	if (netif_queue_stopped(dev) ) {
-		card->stats.tx_dropped++;
-		return -EBUSY;
-	}
 #ifdef CONFIG_QETH_PERF_STATS
+	card->perf_stats.outbound_cnt++;
 	card->perf_stats.outbound_start_time = qeth_get_micros();
 #endif
 	/*
@@ -3210,6 +3296,10 @@ qeth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (!(rc = qeth_send_packet(card, skb)))
 		netif_wake_queue(dev);
 
+#ifdef CONFIG_QETH_PERF_STATS
+	card->perf_stats.outbound_time += qeth_get_micros() -
+		card->perf_stats.outbound_start_time;
+#endif
 	return rc;
 }
 
@@ -3556,7 +3646,6 @@ qeth_fill_buffer(struct qeth_qdio_out_q *queue, struct qeth_qdio_out_buffer *buf
 	int first_lap = 1;
 
 	QETH_DBF_TEXT(trace, 6, "qdfillbf");
-
 	buffer = buf->buffer;
 	atomic_inc(&skb->users);
 	skb_queue_tail(&buf->skb_list, skb);
@@ -3591,7 +3680,7 @@ qeth_fill_buffer(struct qeth_qdio_out_q *queue, struct qeth_qdio_out_buffer *buf
 	if (!queue->do_pack) {
 		QETH_DBF_TEXT(trace, 6, "fillbfnp");
 		/* set state to PRIMED -> will be flushed */
-		buf->state = QETH_QDIO_BUF_PRIMED;
+		atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);
 	} else {
 		QETH_DBF_TEXT(trace, 6, "fillbfpa");
 #ifdef CONFIG_QETH_PERF_STATS
@@ -3603,73 +3692,97 @@ qeth_fill_buffer(struct qeth_qdio_out_q *queue, struct qeth_qdio_out_buffer *buf
 			 * packed buffer if full -> set state PRIMED
 			 * -> will be flushed
 			 */
-			buf->state = QETH_QDIO_BUF_PRIMED;
+			atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);
 		}
 	}
 	return 0;
 }
 
 static inline int
-qeth_do_send_packet(struct qeth_card *card, struct sk_buff *skb,
-		    struct qeth_qdio_out_q *queue, int ipv,
-		    int cast_type)
+qeth_do_send_packet_fast(struct qeth_card *card, struct qeth_qdio_out_q *queue,
+			 struct sk_buff *skb, struct qeth_hdr *hdr,
+			 int elements_needed)
+{
+	struct qeth_qdio_out_buffer *buffer;
+	int index;
+
+	QETH_DBF_TEXT(trace, 6, "dosndpfa");
+
+	spin_lock(&queue->lock);
+	index = queue->next_buf_to_fill;
+	buffer = &queue->bufs[queue->next_buf_to_fill];
+	/*
+	 * check if buffer is empty to make sure that we do not 'overtake'
+	 * ourselves and try to fill a buffer that is already primed
+	 */
+	if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY) {
+		card->stats.tx_dropped++;
+		spin_unlock(&queue->lock);
+		return -EBUSY;
+	}
+	queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
+				  QDIO_MAX_BUFFERS_PER_Q;
+	qeth_fill_buffer(queue, buffer, (char *)hdr, skb);
+	qeth_flush_buffers(queue, 0, index, 1);
+	spin_unlock(&queue->lock);
+	return 0;
+}
+
+static inline int
+qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
+		    struct sk_buff *skb, struct qeth_hdr *hdr,
+		    int elements_needed)
 {
-	struct qeth_hdr *hdr;
 	struct qeth_qdio_out_buffer *buffer;
-	int elements_needed;
 	int start_index;
 	int flush_count = 0;
-	int rc;
+	int rc = 0;
 
 	QETH_DBF_TEXT(trace, 6, "dosndpkt");
 
-	if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))){
-		QETH_DBF_TEXT_(trace, 4, "1err%d", rc);
-		return rc;
-	}
-	qeth_fill_header(card, hdr, skb, ipv, cast_type);
-	elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) + skb->len)
-				>> PAGE_SHIFT);
-	if (elements_needed > QETH_MAX_BUFFER_ELEMENTS(card)){
-		PRINT_ERR("qeth_do_send_packet: invalid size of "
-				 "IP packet. Discarded.");
-		return -EINVAL;
-	}
-
 	spin_lock(&queue->lock);
 	start_index = queue->next_buf_to_fill;
 	buffer = &queue->bufs[queue->next_buf_to_fill];
-	BUG_ON(buffer->state == QETH_QDIO_BUF_PRIMED);
+	/*
+	 * check if buffer is empty to make sure that we do not 'overtake'
+	 * ourselves and try to fill a buffer that is already primed
+	 */
+	if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY){
+		card->stats.tx_dropped++;
+		spin_unlock(&queue->lock);
+		return -EBUSY;
+	}
 	if (queue->do_pack){
 		/* does packet fit in current buffer? */
-		if((QETH_MAX_BUFFER_ELEMENTS(card) - buffer->next_element_to_fill)
-				< elements_needed){
+		if((QETH_MAX_BUFFER_ELEMENTS(card) -
+		    buffer->next_element_to_fill) < elements_needed){
 			/* ... no -> set state PRIMED */
-			buffer->state = QETH_QDIO_BUF_PRIMED;
+			atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
 			flush_count++;
-			atomic_inc(&queue->used_buffers);
 			queue->next_buf_to_fill =
 				(queue->next_buf_to_fill + 1) %
 				QDIO_MAX_BUFFERS_PER_Q;
 			buffer = &queue->bufs[queue->next_buf_to_fill];
+			/* we did a step forward, so check buffer state again */
+			if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY){
+				card->stats.tx_dropped++;
+				qeth_flush_buffers(queue, 0, start_index, 1);
+				spin_unlock(&queue->lock);
+				/* return EBUSY because we sent old packet, not
+				 * the current one */
+				return -EBUSY;
+			}
 		}
 	}
-
-	rc = qeth_fill_buffer(queue, buffer, (char *)hdr, skb);
-	if (rc) {
-		PRINT_WARN("qeth_do_send_packet: error during "
-			      "qeth_fill_buffer.");
-		card->stats.tx_dropped++;
-	} else if (buffer->state == QETH_QDIO_BUF_PRIMED){
+	qeth_fill_buffer(queue, buffer, (char *)hdr, skb);
+	if (atomic_read(&buffer->state) == QETH_QDIO_BUF_PRIMED){
 		/* next time fill the next buffer */
 		flush_count++;
-		atomic_inc(&queue->used_buffers);
 		queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
 			QDIO_MAX_BUFFERS_PER_Q;
 	}
 	/* check if we need to switch packing state of this queue */
-	if (card->info.type != QETH_CARD_TYPE_IQD)
-		flush_count += qeth_switch_packing_state(queue);
+	flush_count += qeth_switch_packing_state(queue);
 
 	if (flush_count)
 		qeth_flush_buffers(queue, 0, start_index, flush_count);
@@ -3678,7 +3791,6 @@ qeth_do_send_packet(struct qeth_card *card, struct sk_buff *skb,
 		qeth_flush_buffers_on_no_pci(queue, 0);
 
 	spin_unlock(&queue->lock);
-
 	return rc;
 }
 
@@ -3688,6 +3800,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
 	int ipv;
 	int cast_type;
 	struct qeth_qdio_out_q *queue;
+	struct qeth_hdr *hdr;
+	int elements_needed;
 	int rc;
 
 	QETH_DBF_TEXT(trace, 6, "sendpkt");
@@ -3696,24 +3810,30 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
 	cast_type = qeth_get_cast_type(card, skb);
 	queue = card->qdio.out_qs
 		[qeth_get_priority_queue(card, skb, ipv, cast_type)];
-	/* do we have empty buffers? */
-	rc = (atomic_read(&queue->used_buffers) >=
-	      QDIO_MAX_BUFFERS_PER_Q - 1) ? -EBUSY : 0;
-	if (rc) {
-		card->stats.tx_dropped++;
+
+	if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))){
 		QETH_DBF_TEXT_(trace, 4, "1err%d", rc);
 		return rc;
 	}
+	qeth_fill_header(card, hdr, skb, ipv, cast_type);
+	elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) + skb->len)
+				>> PAGE_SHIFT);
+	if (elements_needed > QETH_MAX_BUFFER_ELEMENTS(card)){
+		PRINT_ERR("qeth_do_send_packet: invalid size of "
+				 "IP packet. Discarded.");
+		return -EINVAL;
+	}
 
-	rc = qeth_do_send_packet(card, skb, queue, ipv, cast_type);
+	if (card->info.type != QETH_CARD_TYPE_IQD)
+		rc = qeth_do_send_packet(card, queue, skb, hdr,
+					 elements_needed);
+	else
+		rc = qeth_do_send_packet_fast(card, queue, skb, hdr,
+					      elements_needed);
 
 	if (!rc){
 		card->stats.tx_packets++;
 		card->stats.tx_bytes += skb->len;
-#ifdef CONFIG_QETH_PERF_STATS
-		card->perf_stats.outbound_time += qeth_get_micros() -
-			card->perf_stats.outbound_start_time;
-#endif
 	}
 	return rc;
 }
@@ -3859,69 +3979,107 @@ qeth_arp_set_no_entries(struct qeth_card *card, int no_entries)
 	if (rc) {
 		tmp = rc;
 		PRINT_WARN("Could not set number of ARP entries on %s: "
-			   "%s (0x%x)\n",
+			   "%s (0x%x/%d)\n",
 			   card->info.if_name, qeth_arp_get_error_cause(&rc),
-			   tmp);
+			   tmp, tmp);
 	}
 	return rc;
 }
 
+static inline void
+qeth_copy_arp_entries_stripped(struct qeth_arp_query_info *qinfo,
+		               struct qeth_arp_query_data *qdata,
+			       int entry_size, int uentry_size)
+{
+	char *entry_ptr;
+	char *uentry_ptr;
+	int i;
+
+	entry_ptr = (char *)&qdata->data;
+	uentry_ptr = (char *)(qinfo->udata + qinfo->udata_offset);
+	for (i = 0; i < qdata->no_entries; ++i){
+		/* strip off 32 bytes "media specific information" */
+		memcpy(uentry_ptr, (entry_ptr + 32), entry_size - 32);
+		entry_ptr += entry_size;
+		uentry_ptr += uentry_size;
+	}
+}
+
 static int
 qeth_arp_query_cb(struct qeth_card *card, struct qeth_reply *reply,
 		  unsigned long data)
 {
-	struct qeth_ipa_arp_cmd *cmd;
+	struct qeth_ipa_cmd *cmd;
 	struct qeth_arp_query_data *qdata;
 	struct qeth_arp_query_info *qinfo;
 	int entry_size;
+	int uentry_size;
 	int i;
 
 	QETH_DBF_TEXT(trace,4,"arpquecb");
 
 	qinfo = (struct qeth_arp_query_info *) reply->param;
-	cmd = (struct qeth_ipa_arp_cmd *) data;
-	if (cmd->ihdr.return_code) {
-		QETH_DBF_TEXT_(trace,4,"qaer1%i", cmd->ihdr.return_code);
+	cmd = (struct qeth_ipa_cmd *) data;
+	if (cmd->hdr.return_code) {
+		QETH_DBF_TEXT_(trace,4,"qaer1%i", cmd->hdr.return_code);
 		return 0;
 	}
-	if (cmd->shdr.return_code) {
-		cmd->ihdr.return_code = cmd->shdr.return_code;
-		QETH_DBF_TEXT_(trace,4,"qaer2%i", cmd->ihdr.return_code);
+	if (cmd->data.setassparms.hdr.return_code) {
+		cmd->hdr.return_code = cmd->data.setassparms.hdr.return_code;
+		QETH_DBF_TEXT_(trace,4,"qaer2%i", cmd->hdr.return_code);
 		return 0;
 	}
-	qdata = &cmd->data.query_arp;
+	qdata = &cmd->data.setassparms.data.query_arp;
 	switch(qdata->reply_bits){
 	case 5:
-		entry_size = sizeof(struct qeth_arp_qi_entry5);
+		uentry_size = entry_size = sizeof(struct qeth_arp_qi_entry5);
+		if (qinfo->mask_bits & QETH_QARP_STRIP_ENTRIES)
+			uentry_size = sizeof(struct qeth_arp_qi_entry5_short);
 		break;
 	case 7:
-		entry_size = sizeof(struct qeth_arp_qi_entry7);
-		break;
+		/* fall through to default */
 	default:
 		/* tr is the same as eth -> entry7 */
-		entry_size = sizeof(struct qeth_arp_qi_entry7);
+		uentry_size = entry_size = sizeof(struct qeth_arp_qi_entry7);
+		if (qinfo->mask_bits & QETH_QARP_STRIP_ENTRIES)
+			uentry_size = sizeof(struct qeth_arp_qi_entry7_short);
 		break;
 	}
 	/* check if there is enough room in userspace */
 	if ((qinfo->udata_len - qinfo->udata_offset) <
-			qdata->no_entries * entry_size){
+			qdata->no_entries * uentry_size){
 		QETH_DBF_TEXT_(trace, 4, "qaer3%i", -ENOMEM);
-		cmd->ihdr.return_code = -ENOMEM;
+		cmd->hdr.return_code = -ENOMEM;
+		PRINT_WARN("query ARP user space buffer is too small for "
+			   "the returned number of ARP entries. "
+			   "Aborting query!\n");
 		goto out_error;
 	}
-	QETH_DBF_TEXT_(trace, 4, "anore%i", cmd->shdr.number_of_replies);
-	QETH_DBF_TEXT_(trace, 4, "aseqn%i", cmd->shdr.seq_no);
+	QETH_DBF_TEXT_(trace, 4, "anore%i",
+		       cmd->data.setassparms.hdr.number_of_replies);
+	QETH_DBF_TEXT_(trace, 4, "aseqn%i", cmd->data.setassparms.hdr.seq_no);
 	QETH_DBF_TEXT_(trace, 4, "anoen%i", qdata->no_entries);
-	for (i = 0; i < qdata->no_entries; ++i){
+
+	if (qinfo->mask_bits & QETH_QARP_STRIP_ENTRIES) {
+		/* strip off "media specific information" */
+		qeth_copy_arp_entries_stripped(qinfo, qdata, entry_size,
+					       uentry_size);
+	} else
+		/*copy entries to user buffer*/
 		memcpy(qinfo->udata + qinfo->udata_offset,
-		       qdata->data + i*entry_size, entry_size);
-		qinfo->no_entries++;
-		qinfo->udata_offset += entry_size;
-	}
+		       (char *)&qdata->data, qdata->no_entries*uentry_size);
+
+	qinfo->no_entries += qdata->no_entries;
+	qinfo->udata_offset += (qdata->no_entries*uentry_size);
 	/* check if all replies received ... */
-	if (cmd->shdr.seq_no < cmd->shdr.number_of_replies)
+	if (cmd->data.setassparms.hdr.seq_no <
+	    cmd->data.setassparms.hdr.number_of_replies)
 		return 1;
 	memcpy(qinfo->udata, &qinfo->no_entries, 4);
+	/* keep STRIP_ENTRIES flag so the user program can distinguish
+	 * stripped entries from normal ones */
+	if (qinfo->mask_bits & QETH_QARP_STRIP_ENTRIES)
+		qdata->reply_bits |= QETH_QARP_STRIP_ENTRIES;
 	memcpy(qinfo->udata + QETH_QARP_MASK_OFFSET,&qdata->reply_bits,2);
 	return 0;
 out_error:
@@ -3930,70 +4088,54 @@ out_error:
 	return 0;
 }
 
-static struct qeth_cmd_buffer *
-qeth_get_ipacmd_buffer(struct qeth_card *, enum qeth_ipa_cmds,
-		       enum qeth_prot_versions);
-
-struct qeth_cmd_buffer *
-qeth_get_ipa_arp_cmd_buffer(struct qeth_card *card, u16 cmd_code,
-			    u32 data_len, enum qeth_prot_versions proto)
+static int
+qeth_send_ipa_arp_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
+		      int len, int (*reply_cb)(struct qeth_card *,
+					       struct qeth_reply *,
+					       unsigned long),
+		      void *reply_param)
 {
-	struct qeth_cmd_buffer *iob;
-	struct qeth_ipa_arp_cmd *cmd;
-	u16 s1, s2;
-
-	QETH_DBF_TEXT(trace,4,"getarpcm");
-	iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETASSPARMS, proto);
+	QETH_DBF_TEXT(trace,4,"sendarp");
 
 	memcpy(iob->data, IPA_PDU_HEADER, IPA_PDU_HEADER_SIZE);
-
-	if ((IPA_PDU_HEADER_SIZE + QETH_ARP_CMD_BASE_LEN + data_len) > 256) {
-		/* adjust sizes in IPA_PDU_HEADER */
-		s1 = (u32) IPA_PDU_HEADER_SIZE + QETH_ARP_CMD_BASE_LEN +
-			   data_len;
-		s2 = (u32) QETH_ARP_CMD_BASE_LEN + data_len;
-		memcpy(QETH_IPA_PDU_LEN_TOTAL(iob->data), &s1, 2);
-		memcpy(QETH_IPA_PDU_LEN_PDU1(iob->data), &s2, 2);
-		memcpy(QETH_IPA_PDU_LEN_PDU2(iob->data), &s2, 2);
-		memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2);
-	}
-
-	cmd = (struct qeth_ipa_arp_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
-	cmd->shdr.assist_no = IPA_ARP_PROCESSING;
-	cmd->shdr.length = 8 + data_len;
-	cmd->shdr.command_code = cmd_code;
-	cmd->shdr.return_code = 0;
-	cmd->shdr.seq_no = 0;
-
-	return iob;
+	memcpy(QETH_IPA_CMD_DEST_ADDR(iob->data),
+	       &card->token.ulp_connection_r, QETH_MPC_TOKEN_LENGTH);
+	return qeth_send_control_data(card, IPA_PDU_HEADER_SIZE + len, iob,
+				      reply_cb, reply_param);
 }
 
 static int
-qeth_send_ipa_arp_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
-		      char *data, int data_len,
-		      int (*reply_cb)
-		      (struct qeth_card *,struct qeth_reply*, unsigned long),
+qeth_send_ipa_snmp_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
+		      int len, int (*reply_cb)(struct qeth_card *,
+					       struct qeth_reply *,
+					       unsigned long),
 		      void *reply_param)
 {
-	int rc;
+	u16 s1, s2;
 
-	QETH_DBF_TEXT(trace,4,"sendarp");
+	QETH_DBF_TEXT(trace,4,"sendsnmp");
 
-	memcpy(QETH_IPA_ARP_DATA_POS(iob->data), data, data_len);
+	memcpy(iob->data, IPA_PDU_HEADER, IPA_PDU_HEADER_SIZE);
 	memcpy(QETH_IPA_CMD_DEST_ADDR(iob->data),
 	       &card->token.ulp_connection_r, QETH_MPC_TOKEN_LENGTH);
-
-	rc = qeth_send_control_data(card, IPA_PDU_HEADER_SIZE +
-				    QETH_ARP_CMD_BASE_LEN + data_len, iob,
-				    reply_cb, reply_param);
-	return rc;
+	/* adjust PDU length fields in IPA_PDU_HEADER */
+	s1 = (u32) IPA_PDU_HEADER_SIZE + len;
+	s2 = (u32) len;
+	memcpy(QETH_IPA_PDU_LEN_TOTAL(iob->data), &s1, 2);
+	memcpy(QETH_IPA_PDU_LEN_PDU1(iob->data), &s2, 2);
+	memcpy(QETH_IPA_PDU_LEN_PDU2(iob->data), &s2, 2);
+	memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2);
+	return qeth_send_control_data(card, IPA_PDU_HEADER_SIZE + len, iob,
+				      reply_cb, reply_param);
 }
 
+static struct qeth_cmd_buffer *
+qeth_get_setassparms_cmd(struct qeth_card *, enum qeth_ipa_funcs,
+			 __u16, __u16, enum qeth_prot_versions);
 static int
 qeth_arp_query(struct qeth_card *card, char *udata)
 {
 	struct qeth_cmd_buffer *iob;
-	struct qeth_arp_query_data *qdata;
 	struct qeth_arp_query_info qinfo = {0, };
 	int tmp;
 	int rc;
@@ -4008,40 +4150,32 @@ qeth_arp_query(struct qeth_card *card, char *udata)
 	 */
 	if (card->info.guestlan)
 		return -EOPNOTSUPP;
-	if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) {
+	if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/
+			       IPA_ARP_PROCESSING)) {
 		PRINT_WARN("ARP processing not supported "
 			   "on %s!\n", card->info.if_name);
 		return -EOPNOTSUPP;
 	}
-	/* get size of userspace mem area */
-	if (copy_from_user(&qinfo.udata_len, udata, 4))
+	/* get size of userspace buffer and mask_bits -> 6 bytes */
+	if (copy_from_user(&qinfo, udata, 6))
 		return -EFAULT;
 	if (!(qinfo.udata = kmalloc(qinfo.udata_len, GFP_KERNEL)))
 		return -ENOMEM;
 	memset(qinfo.udata, 0, qinfo.udata_len);
 	qinfo.udata_offset = QETH_QARP_ENTRIES_OFFSET;
-	/* alloc mem area for the actual query */
-	if (!(qdata = kmalloc(sizeof(struct qeth_arp_query_data),
-			      GFP_KERNEL))){
-		kfree(qinfo.udata);
-		return -ENOMEM;
-	}
-	memset(qdata, 0, sizeof(struct qeth_arp_query_data));
-	/* do not give sizeof(struct qeth_arp_query_data) to next command;
-	 * this would cause the IPA PDU size to be set to a value of > 256
-	 * and this is to much for HiperSockets */
-	iob = qeth_get_ipa_arp_cmd_buffer(card, IPA_CMD_ASS_ARP_QUERY_INFO,
-					  0, QETH_PROT_IPV4);
+	iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING,
+				       IPA_CMD_ASS_ARP_QUERY_INFO,
+				       sizeof(int),QETH_PROT_IPV4);
+
 	rc = qeth_send_ipa_arp_cmd(card, iob,
-				   (char *) qdata,
-				   sizeof(struct qeth_arp_query_data),
-				   qeth_arp_query_cb,
-				   (void *)&qinfo);
+				   QETH_SETASS_BASE_LEN+QETH_ARP_CMD_LEN,
+				   qeth_arp_query_cb, (void *)&qinfo);
 	if (rc) {
 		tmp = rc;
-		PRINT_WARN("Error while querying ARP cache on %s: %s (0x%x)\n",
+		PRINT_WARN("Error while querying ARP cache on %s: %s "
+			   "(0x%x/%d)\n",
 			   card->info.if_name, qeth_arp_get_error_cause(&rc),
-			   tmp);
+			   tmp, tmp);
 		copy_to_user(udata, qinfo.udata, 4);
 	} else {
 		copy_to_user(udata, qinfo.udata, qinfo.udata_len);
@@ -4050,13 +4184,155 @@ qeth_arp_query(struct qeth_card *card, char *udata)
 	return rc;
 }
 
+/**
+ * SNMP command callback
+ */
 static int
-qeth_default_setassparms_cb(struct qeth_card *, struct qeth_reply *,
-			    unsigned long);
+qeth_snmp_command_cb(struct qeth_card *card, struct qeth_reply *reply,
+		     unsigned long sdata)
+{
+	struct qeth_ipa_cmd *cmd;
+	struct qeth_arp_query_info *qinfo;
+	struct qeth_snmp_cmd *snmp;
+	unsigned char *data;
+	__u16 data_len;
+
+	QETH_DBF_TEXT(trace,3,"snpcmdcb");
+
+	cmd = (struct qeth_ipa_cmd *) sdata;
+	data = (unsigned char *)((char *)cmd - reply->offset);
+	qinfo = (struct qeth_arp_query_info *) reply->param;
+	snmp = &cmd->data.setadapterparms.data.snmp;
+
+	if (cmd->hdr.return_code) {
+		QETH_DBF_TEXT_(trace,4,"scer1%i", cmd->hdr.return_code);
+		return 0;
+	}
+	if (cmd->data.setadapterparms.hdr.return_code) {
+		cmd->hdr.return_code = cmd->data.setadapterparms.hdr.return_code;
+		QETH_DBF_TEXT_(trace,4,"scer2%i", cmd->hdr.return_code);
+		return 0;
+	}
+	data_len = *((__u16*)QETH_IPA_PDU_LEN_PDU1(data));
+	if (cmd->data.setadapterparms.hdr.seq_no == 1)
+		data_len -= (__u16)((char *)&snmp->data - (char *)cmd);
+	else
+		data_len -= (__u16)((char*)&snmp->request - (char *)cmd);
+
+	/* check if there is enough room in userspace */
+	if ((qinfo->udata_len - qinfo->udata_offset) < data_len) {
+		QETH_DBF_TEXT_(trace, 4, "scer3%i", -ENOMEM);
+		cmd->hdr.return_code = -ENOMEM;
+		return 0;
+	}
+	QETH_DBF_TEXT_(trace, 4, "snore%i",
+		       cmd->data.setadapterparms.hdr.used_total);
+	QETH_DBF_TEXT_(trace, 4, "sseqn%i", cmd->data.setadapterparms.hdr.seq_no);
+	/*copy entries to user buffer*/
+	if (cmd->data.setadapterparms.hdr.seq_no == 1) {
+		memcpy(qinfo->udata + qinfo->udata_offset,
+		       (char *)snmp,
+		       data_len + offsetof(struct qeth_snmp_cmd,data));
+		qinfo->udata_offset += offsetof(struct qeth_snmp_cmd, data);
+	} else {
+		memcpy(qinfo->udata + qinfo->udata_offset,
+		       (char *)&snmp->request, data_len);
+	}
+	qinfo->udata_offset += data_len;
+	/* check if all replies received ... */
+		QETH_DBF_TEXT_(trace, 4, "srtot%i",
+			       cmd->data.setadapterparms.hdr.used_total);
+		QETH_DBF_TEXT_(trace, 4, "srseq%i",
+			       cmd->data.setadapterparms.hdr.seq_no);
+	if (cmd->data.setadapterparms.hdr.seq_no <
+	    cmd->data.setadapterparms.hdr.used_total)
+		return 1;
+	return 0;
+}
 
 static struct qeth_cmd_buffer *
-qeth_get_setassparms_cmd(struct qeth_card *, enum qeth_ipa_funcs,
-			 __u16, __u16, enum qeth_prot_versions);
+qeth_get_ipacmd_buffer(struct qeth_card *, enum qeth_ipa_cmds,
+		       enum qeth_prot_versions );
+
+static struct qeth_cmd_buffer *
+qeth_get_adapter_cmd(struct qeth_card *card, __u32 command, __u32 cmdlen)
+{
+	struct qeth_cmd_buffer *iob;
+	struct qeth_ipa_cmd *cmd;
+
+	iob = qeth_get_ipacmd_buffer(card,IPA_CMD_SETADAPTERPARMS,
+				     QETH_PROT_IPV4);
+	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
+	cmd->data.setadapterparms.hdr.cmdlength = cmdlen;
+	cmd->data.setadapterparms.hdr.command_code = command;
+	cmd->data.setadapterparms.hdr.used_total = 1;
+	cmd->data.setadapterparms.hdr.seq_no = 1;
+
+	return iob;
+}
+
+/**
+ * function to send SNMP commands to OSA-E card
+ */
+static int
+qeth_snmp_command(struct qeth_card *card, char *udata)
+{
+	struct qeth_cmd_buffer *iob;
+	struct qeth_ipa_cmd *cmd;
+	struct qeth_snmp_ureq *ureq;
+	int req_len;
+	struct qeth_arp_query_info qinfo = {0, };
+	int rc = 0;
+
+	QETH_DBF_TEXT(trace,3,"snmpcmd");
+
+	if (card->info.guestlan)
+		return -EOPNOTSUPP;
+	if (!qeth_adp_supported(card,IPA_SETADP_SET_SNMP_CONTROL)) {
+		PRINT_WARN("SNMP Query MIBS not supported "
+			   "on %s!\n", card->info.if_name);
+		return -EOPNOTSUPP;
+	}
+	/* skip 4 bytes (data_len struct member) to get req_len */
+	if (copy_from_user(&req_len, udata + sizeof(int), sizeof(int)))
+		return -EFAULT;
+	ureq = kmalloc(req_len, GFP_KERNEL);
+	if (!ureq) {
+		QETH_DBF_TEXT(trace, 2, "snmpnome");
+		return -ENOMEM;
+	}
+	if (copy_from_user(ureq, udata, req_len)){
+		kfree(ureq);
+		return -EFAULT;
+	}
+	qinfo.udata_len = ureq->hdr.data_len;
+	if (!(qinfo.udata = kmalloc(qinfo.udata_len, GFP_KERNEL))){
+		kfree(ureq);
+		return -ENOMEM;
+	}
+	memset(qinfo.udata, 0, qinfo.udata_len);
+	qinfo.udata_offset = sizeof(struct qeth_snmp_ureq_hdr);
+
+	iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_SNMP_CONTROL,
+				   QETH_SNMP_SETADP_CMDLENGTH + req_len);
+	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
+	memcpy(&cmd->data.setadapterparms.data.snmp, &ureq->cmd, req_len);
+	rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len,
+				    qeth_snmp_command_cb, (void *)&qinfo);
+	if (rc)
+		PRINT_WARN("SNMP command failed on %s: (0x%x)\n",
+			   card->info.if_name, rc);
+	 else
+		copy_to_user(udata, qinfo.udata, qinfo.udata_len);
+
+	kfree(ureq);
+	kfree(qinfo.udata);
+	return rc;
+}
+
+static int
+qeth_default_setassparms_cb(struct qeth_card *, struct qeth_reply *,
+			    unsigned long);
 
 static int
 qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *,
@@ -4101,9 +4377,9 @@ qeth_arp_add_entry(struct qeth_card *card, struct qeth_arp_cache_entry *entry)
 		tmp = rc;
 		qeth_ipaddr4_to_string((u8 *)entry->ipaddr, buf);
 		PRINT_WARN("Could not add ARP entry for address %s on %s: "
-			   "%s (0x%x)\n",
+			   "%s (0x%x/%d)\n",
 			   buf, card->info.if_name,
-			   qeth_arp_get_error_cause(&rc), tmp);
+			   qeth_arp_get_error_cause(&rc), tmp, tmp);
 	}
 	return rc;
 }
@@ -4144,9 +4420,9 @@ qeth_arp_remove_entry(struct qeth_card *card, struct qeth_arp_cache_entry *entry
 		memset(buf, 0, 16);
 		qeth_ipaddr4_to_string((u8 *)entry->ipaddr, buf);
 		PRINT_WARN("Could not delete ARP entry for address %s on %s: "
-			   "%s (0x%x)\n",
+			   "%s (0x%x/%d)\n",
 			   buf, card->info.if_name,
-			   qeth_arp_get_error_cause(&rc), tmp);
+			   qeth_arp_get_error_cause(&rc), tmp, tmp);
 	}
 	return rc;
 }
@@ -4165,7 +4441,7 @@ qeth_arp_flush_cache(struct qeth_card *card)
 	 * funcs flags); since all zeros is no valueable information,
 	 * we say EOPNOTSUPP for all ARP functions
 	 */
-	if (card->info.guestlan)
+	if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD))
 		return -EOPNOTSUPP;
 	if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) {
 		PRINT_WARN("ARP processing not supported "
@@ -4176,9 +4452,9 @@ qeth_arp_flush_cache(struct qeth_card *card)
 					  IPA_CMD_ASS_ARP_FLUSH_CACHE, 0);
 	if (rc){
 		tmp = rc;
-		PRINT_WARN("Could not flush ARP cache on %s: %s (0x%x)\n",
+		PRINT_WARN("Could not flush ARP cache on %s: %s (0x%x/%d)\n",
 			   card->info.if_name, qeth_arp_get_error_cause(&rc),
-			   tmp);
+			   tmp, tmp);
 	}
 	return rc;
 }
@@ -4198,7 +4474,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		return -ENODEV;
 
 	switch (cmd){
-	case SIOCDEVPRIVATE:
 	case SIOC_QETH_ARP_SET_NO_ENTRIES:
 		if (!capable(CAP_NET_ADMIN)){
 			rc = -EPERM;
@@ -4206,7 +4481,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		}
 		rc = qeth_arp_set_no_entries(card, rq->ifr_ifru.ifru_ivalue);
 		break;
-	case SIOCDEVPRIVATE+1:
 	case SIOC_QETH_ARP_QUERY_INFO:
 		if (!capable(CAP_NET_ADMIN)){
 			rc = -EPERM;
@@ -4214,7 +4488,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		}
 		rc = qeth_arp_query(card, rq->ifr_ifru.ifru_data);
 		break;
-	case SIOCDEVPRIVATE+2:
 	case SIOC_QETH_ARP_ADD_ENTRY:
 		if (!capable(CAP_NET_ADMIN)){
 			rc = -EPERM;
@@ -4226,7 +4499,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		else
 			rc = qeth_arp_add_entry(card, &arp_entry);
 		break;
-	case SIOCDEVPRIVATE+3:
 	case SIOC_QETH_ARP_REMOVE_ENTRY:
 		if (!capable(CAP_NET_ADMIN)){
 			rc = -EPERM;
@@ -4238,7 +4510,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		else
 			rc = qeth_arp_remove_entry(card, &arp_entry);
 		break;
-	case SIOCDEVPRIVATE+4:
 	case SIOC_QETH_ARP_FLUSH_CACHE:
 		if (!capable(CAP_NET_ADMIN)){
 			rc = -EPERM;
@@ -4246,18 +4517,21 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		}
 		rc = qeth_arp_flush_cache(card);
 		break;
-	case SIOCDEVPRIVATE+5:
 	case SIOC_QETH_ADP_SET_SNMP_CONTROL:
+		rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data);
 		break;
-	case SIOCDEVPRIVATE+6:
 	case SIOC_QETH_GET_CARD_TYPE:
+		if ((card->info.type == QETH_CARD_TYPE_OSAE) &&
+		    !card->info.guestlan)
+			return 1;
+		return 0;
 		break;
 	case SIOCGMIIPHY:
-		mii_data = (struct mii_ioctl_data *) &rq->ifr_ifru.ifru_data;
+		mii_data = if_mii(rq);
 		mii_data->phy_id = 0;
 		break;
 	case SIOCGMIIREG:
-		mii_data = (struct mii_ioctl_data *) &rq->ifr_ifru.ifru_data;
+		mii_data = if_mii(rq);
 		if (mii_data->phy_id != 0)
 			rc = -EINVAL;
 		else
@@ -4272,7 +4546,7 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 			rc = -EPERM;
 			break;
 		}
-		mii_data = (struct mii_ioctl_data *) &rq->ifr_ifru.ifru_data;
+		mii_data = if_mii(rq);
 		if (mii_data->phy_id != 0)
 			rc = -EINVAL;
 		else
@@ -4282,6 +4556,8 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 	default:
 		rc = -EOPNOTSUPP;
 	}
+	if (rc)
+		QETH_DBF_TEXT_(trace, 2, "ioce%d", rc);
 	return rc;
 }
 
@@ -4325,27 +4601,124 @@ static void
 qeth_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 {
 	struct qeth_card *card;
+	unsigned long flags;
 
 	QETH_DBF_TEXT(trace,4,"vlanreg");
 
 	card = (struct qeth_card *) dev->priv;
-	spin_lock_irq(&card->vlanlock);
+	spin_lock_irqsave(&card->vlanlock, flags);
 	card->vlangrp = grp;
-	spin_unlock_irq(&card->vlanlock);
+	spin_unlock_irqrestore(&card->vlanlock, flags);
+}
+
+static inline void
+qeth_free_vlan_buffer(struct qeth_card *card, struct qeth_qdio_out_buffer *buf,
+		      unsigned short vid)
+{
+	int i;
+	struct sk_buff *skb;
+	struct sk_buff_head tmp_list;
+
+	skb_queue_head_init(&tmp_list);
+	for(i = 0; i < QETH_MAX_BUFFER_ELEMENTS(card); ++i){
+		while ((skb = skb_dequeue(&buf->skb_list))){
+			if (vlan_tx_tag_present(skb) &&
+			    (vlan_tx_tag_get(skb) == vid)) {
+				atomic_dec(&skb->users);
+				dev_kfree_skb(skb);
+			} else
+				skb_queue_tail(&tmp_list, skb);
+		}
+	}
+	while ((skb = skb_dequeue(&tmp_list)))
+		skb_queue_tail(&buf->skb_list, skb);
+}
+
+static void
+qeth_free_vlan_skbs(struct qeth_card *card, unsigned short vid)
+{
+	int i, j;
+
+	QETH_DBF_TEXT(trace, 4, "frvlskbs");
+	for (i = 0; i < card->qdio.no_out_queues; ++i){
+		for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
+			qeth_free_vlan_buffer(card, &card->qdio.
+					      out_qs[i]->bufs[j], vid);
+	}
+}
+
+static void
+qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid)
+{
+	struct in_device *in_dev;
+	struct in_ifaddr *ifa;
+	struct qeth_ipaddr *addr;
+
+	QETH_DBF_TEXT(trace, 4, "frvaddr4");
+	if (!card->vlangrp)
+		return;
+	in_dev = in_dev_get(card->vlangrp->vlan_devices[vid]);
+	if (!in_dev)
+		return;
+	for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next){
+		addr = qeth_get_addr_buffer(QETH_PROT_IPV4);
+		if (addr){
+			addr->u.a4.addr = ifa->ifa_address;
+			addr->u.a4.mask = ifa->ifa_mask;
+			addr->type = QETH_IP_TYPE_NORMAL;
+			if (!qeth_delete_ip(card, addr))
+				kfree(addr);
+		}
+	}
+	in_dev_put(in_dev);
+}
+
+static void
+qeth_free_vlan_addresses6(struct qeth_card *card, unsigned short vid)
+{
+	struct inet6_dev *in6_dev;
+	struct inet6_ifaddr *ifa;
+	struct qeth_ipaddr *addr;
+
+	QETH_DBF_TEXT(trace, 4, "frvaddr6");
+	if (!card->vlangrp)
+		return;
+	in6_dev = in6_dev_get(card->vlangrp->vlan_devices[vid]);
+	if (!in6_dev)
+		return;
+	for (ifa = in6_dev->addr_list; ifa; ifa = ifa->lst_next){
+		addr = qeth_get_addr_buffer(QETH_PROT_IPV6);
+		if (addr){
+			memcpy(&addr->u.a6.addr, &ifa->addr,
+			       sizeof(struct in6_addr));
+			addr->u.a6.pfxlen = ifa->prefix_len;
+			addr->type = QETH_IP_TYPE_NORMAL;
+			if (!qeth_delete_ip(card, addr))
+				kfree(addr);
+		}
+	}
+	in6_dev_put(in6_dev);
 }
 
 static void
 qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 {
 	struct qeth_card *card;
+	unsigned long flags;
 
 	QETH_DBF_TEXT(trace,4,"vlkilvid");
 
 	card = (struct qeth_card *) dev->priv;
-	spin_lock_irq(&card->vlanlock);
+	/* free all skbs for the vlan device */
+	qeth_free_vlan_skbs(card, vid);
+	spin_lock_irqsave(&card->vlanlock, flags);
+	/* unregister IP addresses of vlan device */
+	qeth_free_vlan_addresses4(card, vid);
+	qeth_free_vlan_addresses6(card, vid);
 	if (card->vlangrp)
 		card->vlangrp->vlan_devices[vid] = NULL;
-	spin_unlock_irq(&card->vlanlock);
+	spin_unlock_irqrestore(&card->vlanlock, flags);
+	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
 	/* delete mc addresses for this vlan dev */
 	qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD);
 	schedule_work(&card->kernel_thread_starter);
@@ -4401,10 +4774,6 @@ qeth_get_addr_buffer(enum qeth_prot_versions prot)
 	memset(addr,0,sizeof(struct qeth_ipaddr));
 	addr->type = QETH_IP_TYPE_NORMAL;
 	addr->proto = prot;
-	addr->is_multicast = 0;
-	addr->users = 0;
-	addr->set_flags = 0;
-	addr->del_flags = 0;
 	return addr;
 }
 
@@ -4811,6 +5180,26 @@ qeth_netdev_init(struct net_device *dev)
 	return 0;
 }
 
+static void
+qeth_init_func_level(struct qeth_card *card)
+{
+	if (card->ipato.enabled) {
+		if (card->info.type == QETH_CARD_TYPE_IQD)
+				card->info.func_level =
+					QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT;
+		else
+				card->info.func_level =
+					QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT;
+	} else {
+		if (card->info.type == QETH_CARD_TYPE_IQD)
+			card->info.func_level =
+				QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT;
+		else
+			card->info.func_level =
+				QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT;
+	}
+}
+
 /**
  * hardsetup card, initialize MPC and QDIO stuff
  */
@@ -4848,6 +5237,7 @@ retry:
 		return rc;
 	}
 	qeth_init_tokens(card);
+	qeth_init_func_level(card);
 	rc = qeth_idx_activate_channel(&card->read, qeth_idx_read_cb);
 	if (rc == -ERESTARTSYS) {
 		QETH_DBF_TEXT(setup, 2, "break2");
@@ -4885,7 +5275,6 @@ retry:
 			QETH_DBF_TEXT_(setup, 2, "6err%d", rc);
 			goto out;
 		}
-		qeth_set_device_name(card);
 		card->dev->priv = card;
 		card->dev->type = qeth_get_arphdr_type(card->info.type,
 						       card->info.link_type);
@@ -4897,24 +5286,6 @@ out:
 	return rc;
 }
 
-static struct qeth_cmd_buffer *
-qeth_get_adapter_cmd(struct qeth_card *card, __u32 command)
-{
-	struct qeth_cmd_buffer *iob;
-	struct qeth_ipa_cmd *cmd;
-
-	iob = qeth_get_ipacmd_buffer(card,IPA_CMD_SETADAPTERPARMS,
-				     QETH_PROT_IPV4);
-	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
-	cmd->data.setadapterparms.cmdlength =
-				sizeof(struct qeth_ipacmd_setadpparms);
-	cmd->data.setadapterparms.command_code = command;
-	cmd->data.setadapterparms.frames_used_total = 1;
-	cmd->data.setadapterparms.frame_seq_no = 1;
-
-	return iob;
-}
-
 static int
 qeth_default_setassparms_cb(struct qeth_card *card, struct qeth_reply *reply,
 			    unsigned long data)
@@ -4952,7 +5323,7 @@ qeth_default_setadapterparms_cb(struct qeth_card *card,
 
 	cmd = (struct qeth_ipa_cmd *) data;
 	if (cmd->hdr.return_code == 0)
-		cmd->hdr.return_code = cmd->data.setadapterparms.return_code;
+		cmd->hdr.return_code = cmd->data.setadapterparms.hdr.return_code;
 	return 0;
 }
 
@@ -4980,7 +5351,8 @@ qeth_query_setadapterparms(struct qeth_card *card)
 	struct qeth_cmd_buffer *iob;
 
 	QETH_DBF_TEXT(trace,3,"queryadp");
-	iob = qeth_get_adapter_cmd(card,IPA_SETADP_QUERY_COMMANDS_SUPPORTED);
+	iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_COMMANDS_SUPPORTED,
+				   sizeof(struct qeth_ipacmd_setadpparms));
 	rc = qeth_send_ipa_cmd(card, iob, qeth_query_setadapterparms_cb, NULL);
 	return rc;
 }
@@ -5010,7 +5382,8 @@ qeth_setadpparms_change_macaddr(struct qeth_card *card)
 
 	QETH_DBF_TEXT(trace,4,"chgmac");
 
-	iob = qeth_get_adapter_cmd(card,IPA_SETADP_ALTER_MAC_ADDRESS);
+	iob = qeth_get_adapter_cmd(card,IPA_SETADP_ALTER_MAC_ADDRESS,
+				   sizeof(struct qeth_ipacmd_setadpparms));
 	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
 	cmd->data.setadapterparms.data.change_addr.cmd = CHANGE_ADDR_READ_MAC;
 	cmd->data.setadapterparms.data.change_addr.addr_size = OSA_ADDR_LEN;
@@ -5030,7 +5403,8 @@ qeth_send_setadp_mode(struct qeth_card *card, __u32 command, __u32 mode)
 
 	QETH_DBF_TEXT(trace,4,"adpmode");
 
-	iob = qeth_get_adapter_cmd(card, command);
+	iob = qeth_get_adapter_cmd(card, command,
+				   sizeof(struct qeth_ipacmd_setadpparms));
 	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
 	cmd->data.setadapterparms.data.mode = mode;
 	rc = qeth_send_ipa_cmd(card, iob, qeth_default_setadapterparms_cb,
@@ -5459,18 +5833,20 @@ qeth_start_ipa_broadcast(struct qeth_card *card)
 	int rc;
 
 	QETH_DBF_TEXT(trace,3,"stbrdcst");
+	card->info.broadcast_capable = 0;
 	if (!qeth_is_supported(card, IPA_FILTERING)) {
 		PRINT_WARN("Broadcast not supported on %s\n",
 			   card->info.if_name);
-		return -EOPNOTSUPP;
+		rc = -EOPNOTSUPP;
+		goto out;
 	}
 	rc = qeth_send_simple_setassparms(card, IPA_FILTERING,
 					  IPA_CMD_ASS_START, 0);
 	if (rc) {
-		PRINT_WARN("Could not enable broadcasting "
+		PRINT_WARN("Could not enable broadcasting filtering "
 			   "on %s: 0x%x\n",
 			   card->info.if_name, rc);
-		return rc;
+		goto out;
 	}
 
 	rc = qeth_send_simple_setassparms(card, IPA_FILTERING,
@@ -5478,12 +5854,24 @@ qeth_start_ipa_broadcast(struct qeth_card *card)
 	if (rc) {
 		PRINT_WARN("Could not set up broadcast filtering on %s: 0x%x\n",
 			   card->info.if_name, rc);
-		return rc;
+		goto out;
 	}
+	card->info.broadcast_capable = QETH_BROADCAST_WITH_ECHO;
 	PRINT_INFO("Broadcast enabled \n");
-	card->dev->flags |= IFF_BROADCAST;
-	card->info.broadcast_capable = 1;
-	return 0;
+	rc = qeth_send_simple_setassparms(card, IPA_FILTERING,
+					  IPA_CMD_ASS_ENABLE, 1);
+	if (rc) {
+		PRINT_WARN("Could not set up broadcast echo filtering on "
+			   "%s: 0x%x\n", card->info.if_name, rc);
+		goto out;
+	}
+	card->info.broadcast_capable = QETH_BROADCAST_WITHOUT_ECHO;
+out:
+	if (card->info.broadcast_capable)
+		card->dev->flags |= IFF_BROADCAST;
+	else
+		card->dev->flags &= ~IFF_BROADCAST;
+	return rc;
 }
 
 static int
@@ -5781,7 +6169,6 @@ static void
 qeth_clear_ip_list(struct qeth_card *card, int clean, int recover)
 {
 	struct qeth_ipaddr *addr, *tmp;
-	int first_run = 1;
 	unsigned long flags;
 
 	QETH_DBF_TEXT(trace,4,"clearip");
@@ -5791,29 +6178,21 @@ qeth_clear_ip_list(struct qeth_card *card, int clean, int recover)
 		list_del(&addr->entry);
 		kfree(addr);
 	}
-again:
-	if (first_run)
-		first_run = 0;
-	else
-		spin_lock_irqsave(&card->ip_lock, flags);
 
-	list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
+	while (!list_empty(&card->ip_list)) {
+		addr = list_entry(card->ip_list.next,
+				  struct qeth_ipaddr, entry);
 		list_del_init(&addr->entry);
-		if (clean){
+		if (clean) {
 			spin_unlock_irqrestore(&card->ip_lock, flags);
 			qeth_deregister_addr_entry(card, addr);
+			spin_lock_irqsave(&card->ip_lock, flags);
 		}
-		if (!recover || addr->is_multicast)
+		if (!recover || addr->is_multicast) {
 			kfree(addr);
-		else {
-			if (clean)
-				spin_lock_irqsave(&card->ip_lock, flags);
-			list_add_tail(&addr->entry, &card->ip_tbd_list);
-			if (clean) {
-				spin_unlock_irqrestore(&card->ip_lock, flags);
-				goto again;
-			}
+			continue;
 		}
+		list_add_tail(&addr->entry, &card->ip_tbd_list);
 	}
 	spin_unlock_irqrestore(&card->ip_lock, flags);
 }
@@ -6109,7 +6488,7 @@ qeth_set_online(struct ccwgroup_device *gdev)
 	qeth_set_allowed_threads(card, 0xffffffff, 0);
 	if (recover_flag == CARD_STATE_RECOVER)
 		qeth_start_again(card);
-
+	qeth_notify_processes();
 	return 0;
 out_remove:
 	card->use_hard_stop = 1;
@@ -6775,12 +7154,18 @@ qeth_init(void)
 	int rc=0;
 
 	qeth_eyecatcher();
-	printk(KERN_INFO "qeth: loading %s\n",version);
+	PRINT_INFO("loading %s (%s/%s/%s/%s/%s/%s/%s %s %s)\n",
+		   version, VERSION_QETH_C, VERSION_QETH_H,
+		   VERSION_QETH_MPC_H, VERSION_QETH_MPC_C,
+		   VERSION_QETH_FS_H, VERSION_QETH_PROC_C,
+		   VERSION_QETH_SYS_C, QETH_VERSION_IPV6,
+		   QETH_VERSION_VLAN);
 
 	INIT_LIST_HEAD(&qeth_card_list.list);
+	INIT_LIST_HEAD(&qeth_notify_list);
+	spin_lock_init(&qeth_notify_lock);
 	rwlock_init(&qeth_card_list.rwlock);
 
-	atomic_set(&qeth_hsi_count, 0);
 	if (qeth_register_dbf_views())
 		goto out_err;
 	if (qeth_sysfs_register())
diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c
index bef90ca15..f685ecc7d 100644
--- a/drivers/s390/net/qeth_mpc.c
+++ b/drivers/s390/net/qeth_mpc.c
@@ -11,6 +11,8 @@
 #include <asm/cio.h>
 #include "qeth_mpc.h"
 
+const char *VERSION_QETH_MPC_C = "$Revision: 1.11 $";
+
 unsigned char IDX_ACTIVATE_READ[]={
 	0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,
 	0x19,0x01,0x01,0x80, 0x00,0x00,0x00,0x00,
@@ -129,8 +131,7 @@ unsigned char IPA_PDU_HEADER[]={
 	0x00,0x00,0x00,0x14, 0x00,0x00,
 		(IPA_PDU_HEADER_SIZE+sizeof(struct qeth_ipa_cmd))/256,
 		(IPA_PDU_HEADER_SIZE+sizeof(struct qeth_ipa_cmd))%256,
-	0x10,0x00,0x00,0x01,
-	0x00,0x00,0x00,0x00,
+	0x10,0x00,0x00,0x01, 0x00,0x00,0x00,0x00,
 	0xc1,0x03,0x00,0x01, 0x00,0x00,0x00,0x00,
 	0x00,0x00,0x00,0x00, 0x00,0x24,
 		sizeof(struct qeth_ipa_cmd)/256,
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index b1cfca838..b4d0d7b10 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -14,7 +14,9 @@
 
 #include <asm/qeth.h>
 
-#define VERSION_QETH_MPC_H "$Revision: 1.27 $"
+#define VERSION_QETH_MPC_H "$Revision: 1.35 $"
+
+extern const char *VERSION_QETH_MPC_C;
 
 #define IPA_PDU_HEADER_SIZE	0x40
 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e)
@@ -33,6 +35,7 @@ extern unsigned char IPA_PDU_HEADER[];
 #define OSA_ADDR_LEN		6
 
 #define QETH_TIMEOUT 		(10 * HZ)
+#define QETH_IPA_TIMEOUT 	(45 * HZ)
 #define QETH_IDX_COMMAND_SEQNO 	-1
 #define SR_INFO_LEN		16
 
@@ -245,12 +248,29 @@ struct qeth_ipacmd_setassparms_hdr {
 	__u8 seq_no;
 } __attribute__((packed));
 
+struct qeth_arp_query_data {
+	__u16 request_bits;
+	__u16 reply_bits;
+	__u32 no_entries;
+	char data;
+} __attribute__((packed));
+
+/* used as parameter for arp_query reply */
+struct qeth_arp_query_info {
+	__u32 udata_len;
+	__u16 mask_bits;
+	__u32 udata_offset;
+	__u32 no_entries;
+	char *udata;
+};
+
 /* SETASSPARMS IPA Command: */
 struct qeth_ipacmd_setassparms {
 	struct qeth_ipacmd_setassparms_hdr hdr;
 	union {
 		__u32 flags_32bit;
 		struct qeth_arp_cache_entry add_arp_entry;
+		struct qeth_arp_query_data query_arp;
 		__u8 ip[16];
 	} data;
 } __attribute__ ((packed));
@@ -277,19 +297,47 @@ struct qeth_change_addr {
 	__u8 addr[OSA_ADDR_LEN];
 } __attribute__ ((packed));
 
-struct qeth_ipacmd_setadpparms {
+
+struct qeth_snmp_cmd {
+	__u8  token[16];
+	__u32 request;
+	__u32 interface;
+	__u32 returncode;
+	__u32 firmwarelevel;
+	__u32 seqno;
+	__u8  data;
+} __attribute__ ((packed));
+
+struct qeth_snmp_ureq_hdr {
+	__u32   data_len;
+	__u32   req_len;
+	__u32   reserved1;
+	__u32   reserved2;
+} __attribute__ ((packed));
+
+struct qeth_snmp_ureq {
+	struct qeth_snmp_ureq_hdr hdr;
+	struct qeth_snmp_cmd cmd;
+} __attribute__((packed));
+
+struct qeth_ipacmd_setadpparms_hdr {
 	__u32 supp_hw_cmds;
 	__u32 reserved1;
 	__u16 cmdlength;
 	__u16 reserved2;
 	__u32 command_code;
 	__u16 return_code;
-	__u8 frames_used_total;
-	__u8 frame_seq_no;
+	__u8  used_total;
+	__u8  seq_no;
 	__u32 reserved3;
+} __attribute__ ((packed));
+
+struct qeth_ipacmd_setadpparms {
+	struct qeth_ipacmd_setadpparms_hdr hdr;
 	union {
 		struct qeth_query_cmds_supp query_cmds_supp;
 		struct qeth_change_addr change_addr;
+		struct qeth_snmp_cmd snmp;
 		__u32 mode;
 	} data;
 } __attribute__ ((packed));
@@ -357,36 +405,16 @@ enum qeth_ipa_arp_return_codes {
 	QETH_IPA_ARP_RC_Q_NO_DATA    = 0x0008,
 };
 
-#define QETH_QARP_DATA_SIZE 3968
-struct qeth_arp_query_data {
-	__u16 request_bits;
-	__u16 reply_bits;
-	__u32 no_entries;
-	char data[QETH_QARP_DATA_SIZE];
-} __attribute__((packed));
-
-/* used as parameter for arp_query reply */
-struct qeth_arp_query_info {
-	__u32 udata_len;
-	__u32 udata_offset;
-	__u32 no_entries;
-	char *udata;
-};
-
-#define IPA_ARP_CMD_LEN (IPA_PDU_HEADER_SIZE+sizeof(struct qeth_ipa_arp_cmd))
-#define QETH_ARP_CMD_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \
+#define QETH_SETASS_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \
 			       sizeof(struct qeth_ipacmd_setassparms_hdr))
 #define QETH_IPA_ARP_DATA_POS(buffer) (buffer + IPA_PDU_HEADER_SIZE + \
-				       QETH_ARP_CMD_BASE_LEN)
-struct qeth_ipa_arp_cmd {
-	struct qeth_ipacmd_hdr ihdr;
-	struct qeth_ipacmd_setassparms_hdr shdr;
-	union {
-		struct qeth_arp_query_data query_arp;
-	} data;
-} __attribute__((packed));
-
+				       QETH_SETASS_BASE_LEN)
+#define QETH_SETADP_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \
+			      sizeof(struct qeth_ipacmd_setadpparms_hdr))
+#define QETH_SNMP_SETADP_CMDLENGTH 16
 
+#define QETH_ARP_DATA_SIZE 3968
+#define QETH_ARP_CMD_LEN (QETH_ARP_DATA_SIZE + 8)
 /* Helper functions */
 #define IS_IPA_REPLY(cmd) (cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST)
 
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c
index a031e0e7f..c152777f3 100644
--- a/drivers/s390/net/qeth_proc.c
+++ b/drivers/s390/net/qeth_proc.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.5 $)
+ * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.10 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to procfs.
@@ -21,6 +21,8 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
+const char *VERSION_QETH_PROC_C = "$Revision: 1.10 $";
+
 /***** /proc/qeth *****/
 #define QETH_PROCFILE_NAME "qeth"
 static struct proc_dir_entry *qeth_procfile;
@@ -91,13 +93,19 @@ qeth_get_router_str(struct qeth_card *card, int ipv)
 		return "pri";
 	else if (routing_type == SECONDARY_ROUTER)
 		return "sec";
-	else if (routing_type == MULTICAST_ROUTER)
+	else if (routing_type == MULTICAST_ROUTER) {
+		if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
+			return "mc+";
 		return "mc";
-	else if (routing_type == PRIMARY_CONNECTOR)
+	} else if (routing_type == PRIMARY_CONNECTOR) {
+		if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
+			return "p+c";
 		return "p.c";
-	else if (routing_type == SECONDARY_CONNECTOR)
+	} else if (routing_type == SECONDARY_CONNECTOR) {
+		if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
+			return "s+c";
 		return "s.c";
-	else if (routing_type == NO_ROUTER)
+	} else if (routing_type == NO_ROUTER)
 		return "no";
 	else
 		return "unk";
@@ -229,9 +237,11 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
 		   card->perf_stats.bufs_sent_pack
 		  );
 	seq_printf(s, "  Packing state changes no pkg.->packing : %i/%i\n"
+		      "  Watermarks L/H                         : %i/%i\n"
 		      "  Current buffer usage (outbound q's)    : "
 		      "%i/%i/%i/%i\n\n",
 		        card->perf_stats.sc_dp_p, card->perf_stats.sc_p_dp,
+			QETH_LOW_WATERMARK_PACK, QETH_HIGH_WATERMARK_PACK,
 			atomic_read(&card->qdio.out_qs[0]->used_buffers),
 			(card->qdio.no_out_queues > 1)?
 				atomic_read(&card->qdio.out_qs[1]->used_buffers)
@@ -243,16 +253,26 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
 				atomic_read(&card->qdio.out_qs[3]->used_buffers)
 				: 0
 		  );
-	seq_printf(s, "  Inbound time (in us)                   : %i\n"
-		      "  Inbound cnt                            : %i\n"
+	seq_printf(s, "  Inbound handler time (in us)           : %i\n"
+		      "  Inbound handler count                  : %i\n"
+		      "  Inbound do_QDIO time (in us)           : %i\n"
+		      "  Inbound do_QDIO count                  : %i\n\n"
+		      "  Outbound handler time (in us)          : %i\n"
+		      "  Outbound handler count                 : %i\n\n"
 		      "  Outbound time (in us, incl QDIO)       : %i\n"
-		      "  Outbound cnt                           : %i\n"
-		      "  Watermarks L/H                         : %i/%i\n\n",
+		      "  Outbound count                         : %i\n"
+		      "  Outbound do_QDIO time (in us)          : %i\n"
+		      "  Outbound do_QDIO count                 : %i\n",
 		        card->perf_stats.inbound_time,
 			card->perf_stats.inbound_cnt,
+		        card->perf_stats.inbound_do_qdio_time,
+			card->perf_stats.inbound_do_qdio_cnt,
+			card->perf_stats.outbound_handler_time,
+			card->perf_stats.outbound_handler_cnt,
 			card->perf_stats.outbound_time,
 			card->perf_stats.outbound_cnt,
-			QETH_LOW_WATERMARK_PACK, QETH_HIGH_WATERMARK_PACK
+		        card->perf_stats.outbound_do_qdio_time,
+			card->perf_stats.outbound_do_qdio_cnt
 		  );
 
 	return 0;
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 5a3c788cc..910c5f566 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.24 $)
+ * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.32 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to sysfs.
@@ -20,6 +20,8 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
+const char *VERSION_QETH_SYS_C = "$Revision: 1.32 $";
+
 /*****************************************************************************/
 /*                                                                           */
 /*          /sys-fs stuff UNDER DEVELOPMENT !!!                              */
@@ -320,7 +322,8 @@ static DEVICE_ATTR(buffer_count, 0644, qeth_dev_bufcnt_show,
 		qeth_dev_bufcnt_store);
 
 static inline ssize_t
-qeth_dev_route_show(struct qeth_routing_info *route, char *buf)
+qeth_dev_route_show(struct qeth_card *card, struct qeth_routing_info *route,
+		    char *buf)
 {
 	switch (route->type) {
 	case PRIMARY_ROUTER:
@@ -328,11 +331,20 @@ qeth_dev_route_show(struct qeth_routing_info *route, char *buf)
 	case SECONDARY_ROUTER:
 		return sprintf(buf, "%s\n", "secondary router");
 	case MULTICAST_ROUTER:
-		return sprintf(buf, "%s\n", "multicast router");
+		if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
+			return sprintf(buf, "%s\n", "multicast router+");
+		else
+			return sprintf(buf, "%s\n", "multicast router");
 	case PRIMARY_CONNECTOR:
-		return sprintf(buf, "%s\n", "primary connector");
+		if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
+			return sprintf(buf, "%s\n", "primary connector+");
+		else
+			return sprintf(buf, "%s\n", "primary connector");
 	case SECONDARY_CONNECTOR:
-		return sprintf(buf, "%s\n", "secondary connector");
+		if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
+			return sprintf(buf, "%s\n", "secondary connector+");
+		else
+			return sprintf(buf, "%s\n", "secondary connector");
 	default:
 		return sprintf(buf, "%s\n", "no");
 	}
@@ -346,7 +358,7 @@ qeth_dev_route4_show(struct device *dev, char *buf)
 	if (!card)
 		return -EINVAL;
 
-	return qeth_dev_route_show(&card->options.route4, buf);
+	return qeth_dev_route_show(card, &card->options.route4, buf);
 }
 
 static inline ssize_t
@@ -414,7 +426,7 @@ qeth_dev_route6_show(struct device *dev, char *buf)
 	if (!qeth_is_supported(card, IPA_IPV6))
 		return sprintf(buf, "%s\n", "n/a");
 
-	return qeth_dev_route_show(&card->options.route6, buf);
+	return qeth_dev_route_show(card, &card->options.route6, buf);
 }
 
 static ssize_t
@@ -737,6 +749,10 @@ qeth_dev_ipato_enable_store(struct device *dev, const char *buf, size_t count)
 	if (!card)
 		return -EINVAL;
 
+	if ((card->state != CARD_STATE_DOWN) &&
+	    (card->state != CARD_STATE_RECOVER))
+		return -EPERM;
+
 	tmp = strsep((char **) &buf, "\n");
 	if (!strcmp(tmp, "toggle")){
 		card->ipato.enabled = (card->ipato.enabled)? 0 : 1;
@@ -1426,22 +1442,33 @@ qeth_driver_group_store(struct device_driver *ddrv, const char *buf,
 static DRIVER_ATTR(group, 0200, 0, qeth_driver_group_store);
 
 static ssize_t
-qeth_driver_snmp_register_show(struct device_driver *ddrv, char *buf)
-{
-	/* TODO */
-	return 0;
-}
-
-static ssize_t
-qeth_driver_snmp_register_store(struct device_driver *ddrv, const char *buf,
+qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
 				size_t count)
 {
-	/* TODO */
+	int rc;
+	int signum;
+	char *tmp, *tmp2;
+
+	tmp = strsep((char **) &buf, "\n");
+	if (!strncmp(tmp, "unregister", 10)){
+		if ((rc = qeth_notifier_unregister(current)))
+			return rc;
+		return count;
+	}
+
+	signum = simple_strtoul(tmp, &tmp2, 10);
+	if ((signum < 0) || (signum > 32)){
+		PRINT_WARN("Signal number %d is out of range\n", signum);
+		return -EINVAL;
+	}
+	if ((rc = qeth_notifier_register(current, signum)))
+		return rc;
+
 	return count;
 }
 
-static DRIVER_ATTR(snmp_register, 0644, qeth_driver_snmp_register_show,
-		   qeth_driver_snmp_register_store);
+static DRIVER_ATTR(notifier_register, 0200, 0,
+		   qeth_driver_notifier_register_store);
 
 int
 qeth_create_driver_attributes(void)
@@ -1452,7 +1479,7 @@ qeth_create_driver_attributes(void)
 				     &driver_attr_group)))
 		return rc;
 	return driver_create_file(&qeth_ccwgroup_driver.driver,
-				  &driver_attr_snmp_register);
+				  &driver_attr_notifier_register);
 }
 
 void
@@ -1461,5 +1488,5 @@ qeth_remove_driver_attributes(void)
 	driver_remove_file(&qeth_ccwgroup_driver.driver,
 			&driver_attr_group);
 	driver_remove_file(&qeth_ccwgroup_driver.driver,
-			&driver_attr_snmp_register);
+			&driver_attr_notifier_register);
 }
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
index 2138af884..ffa996c8a 100644
--- a/drivers/s390/s390mach.c
+++ b/drivers/s390/s390mach.c
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
+#include <linux/workqueue.h>
 
 #include <asm/lowcore.h>
 
@@ -21,13 +22,14 @@
 // #define DBG(args,...) do {} while (0);
 
 static struct semaphore m_sem;
-static struct semaphore s_sem;
 
 extern int css_process_crw(int);
 extern int chsc_process_crw(void);
 extern int chp_process_crw(int, int);
 extern void css_reiterate_subchannels(void);
-extern void css_trigger_slow_path(void);
+
+extern struct workqueue_struct *slow_path_wq;
+extern struct work_struct slow_path_work;
 
 static void
 s390_handle_damage(char *msg)
@@ -39,21 +41,6 @@ s390_handle_damage(char *msg)
 	disabled_wait((unsigned long) __builtin_return_address(0));
 }
 
-static int
-s390_mchk_slow_path(void *param)
-{
-	struct semaphore *sem;
-
-	sem = (struct semaphore *)param;
-	/* Set a nice name. */
-	daemonize("kslowcrw");
-repeat:
-	down_interruptible(sem);
-	css_trigger_slow_path();
-	goto repeat;
-	return 0;
-}
-
 /*
  * Retrieve CRWs and call function to handle event.
  *
@@ -130,7 +117,7 @@ repeat:
 		}
 	}
 	if (slow)
-		up(&s_sem);
+		queue_work(slow_path_wq, &slow_path_work);
 	goto repeat;
 	return 0;
 }
@@ -202,7 +189,6 @@ static int
 machine_check_init(void)
 {
 	init_MUTEX_LOCKED(&m_sem);
-	init_MUTEX_LOCKED( &s_sem );
 	ctl_clear_bit(14, 25);	/* disable damage MCH */
 	ctl_set_bit(14, 26);	/* enable degradation MCH */
 	ctl_set_bit(14, 27);	/* enable system recovery MCH */
@@ -226,7 +212,6 @@ static int __init
 machine_check_crw_init (void)
 {
 	kernel_thread(s390_collect_crw_info, &m_sem, CLONE_FS|CLONE_FILES);
-	kernel_thread(s390_mchk_slow_path, &s_sem, CLONE_FS|CLONE_FILES);
 	ctl_set_bit(14, 28);	/* enable channel report MCH */
 	return 0;
 }
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index a6f115644..4f4fd5a8e 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -29,7 +29,7 @@
  */
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_AUX_REVISION "$Revision: 1.107 $"
+#define ZFCP_AUX_REVISION "$Revision: 1.108 $"
 
 #include "zfcp_ext.h"
 
@@ -47,12 +47,6 @@ int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *);
 static void zfcp_ns_gid_pn_handler(unsigned long);
 
 /* miscellaneous */
-#ifdef ZFCP_STAT_REQSIZES
-static int zfcp_statistics_init_all(void);
-static int zfcp_statistics_clear_all(void);
-static int zfcp_statistics_clear(struct list_head *);
-static int zfcp_statistics_new(struct list_head *, u32);
-#endif
 
 static inline int zfcp_sg_list_alloc(struct zfcp_sg_list *, size_t);
 static inline int zfcp_sg_list_free(struct zfcp_sg_list *);
@@ -136,96 +130,6 @@ _zfcp_hex_dump(char *addr, int count)
 
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_OTHER
 
-#ifdef ZFCP_STAT_REQSIZES
-
-static int
-zfcp_statistics_clear(struct list_head *head)
-{
-	int retval = 0;
-	unsigned long flags;
-	struct zfcp_statistics *stat, *tmp;
-
-	write_lock_irqsave(&zfcp_data.stat_lock, flags);
-	list_for_each_entry_safe(stat, tmp, head, list) {
-		list_del(&stat->list);
-		kfree(stat);
-	}
-	write_unlock_irqrestore(&zfcp_data.stat_lock, flags);
-
-	return retval;
-}
-
-/* Add new statistics entry */
-static int
-zfcp_statistics_new(struct list_head *head, u32 num)
-{
-	int retval = 0;
-	struct zfcp_statistics *stat;
-
-	stat = kmalloc(sizeof (struct zfcp_statistics), GFP_ATOMIC);
-	if (stat) {
-		memset(stat, 0, sizeof (struct zfcp_statistics));
-		stat->num = num;
-		stat->occurrence = 1;
-		list_add_tail(&stat->list, head);
-	} else
-		zfcp_data.stat_errors++;
-
-	return retval;
-}
-
-int
-zfcp_statistics_inc(struct list_head *head, u32 num)
-{
-	int retval = 0;
-	unsigned long flags;
-	struct zfcp_statistics *stat;
-
-	write_lock_irqsave(&zfcp_data.stat_lock, flags);
-	list_for_each_entry(stat, head, list) {
-		if (stat->num == num) {
-			stat->occurrence++;
-			goto unlock;
-		}
-	}
-	/* occurrence must be initialized to 1 */
-	zfcp_statistics_new(head, num);
- unlock:
-	write_unlock_irqrestore(&zfcp_data.stat_lock, flags);
-	return retval;
-}
-
-static int
-zfcp_statistics_init_all(void)
-{
-	int retval = 0;
-
-	rwlock_init(&zfcp_data.stat_lock);
-	INIT_LIST_HEAD(&zfcp_data.read_req_head);
-	INIT_LIST_HEAD(&zfcp_data.write_req_head);
-	INIT_LIST_HEAD(&zfcp_data.read_sg_head);
-	INIT_LIST_HEAD(&zfcp_data.write_sg_head);
-	INIT_LIST_HEAD(&zfcp_data.read_sguse_head);
-	INIT_LIST_HEAD(&zfcp_data.write_sguse_head);
-	return retval;
-}
-
-static int
-zfcp_statistics_clear_all(void)
-{
-	int retval = 0;
-
-	zfcp_statistics_clear(&zfcp_data.read_req_head);
-	zfcp_statistics_clear(&zfcp_data.write_req_head);
-	zfcp_statistics_clear(&zfcp_data.read_sg_head);
-	zfcp_statistics_clear(&zfcp_data.write_sg_head);
-	zfcp_statistics_clear(&zfcp_data.read_sguse_head);
-	zfcp_statistics_clear(&zfcp_data.write_sguse_head);
-	return retval;
-}
-
-#endif /* ZFCP_STAT_REQSIZES */
-
 static inline int
 zfcp_fsf_req_is_scsi_cmnd(struct zfcp_fsf_req *fsf_req)
 {
@@ -406,10 +310,6 @@ zfcp_module_init(void)
 	/* initialize adapters to be removed list head */
 	INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh);
 
-#ifdef ZFCP_STAT_REQSIZES
-	zfcp_statistics_init_all();
-#endif
-
 #ifdef CONFIG_S390_SUPPORT
 	retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd,
 					     zfcp_ioctl_trans.handler);
@@ -460,9 +360,6 @@ zfcp_module_init(void)
 	unregister_ioctl32_conversion(zfcp_ioctl_trans.cmd);
  out_ioctl32:
 #endif
-#ifdef ZFCP_STAT_REQSIZES
-	zfcp_statistics_clear_all();
-#endif
 
  out:
 	return retval;
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index c509c1346..84a5e37e7 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -26,13 +26,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_CCW_C_REVISION "$Revision: 1.52 $"
+#define ZFCP_CCW_C_REVISION "$Revision: 1.55 $"
 
-#include <linux/init.h>
-#include <linux/module.h>
-#include <asm/ccwdev.h>
 #include "zfcp_ext.h"
-#include "zfcp_def.h"
 
 #define ZFCP_LOG_AREA                   ZFCP_LOG_AREA_CONFIG
 
@@ -232,14 +228,19 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
 	case CIO_GONE:
 		ZFCP_LOG_NORMAL("adapter %s: device gone\n",
 				zfcp_get_busid_by_adapter(adapter));
+		debug_text_event(adapter->erp_dbf,1,"dev_gone");
+		zfcp_erp_adapter_shutdown(adapter, 0);
 		break;
 	case CIO_NO_PATH:
 		ZFCP_LOG_NORMAL("adapter %s: no path\n",
 				zfcp_get_busid_by_adapter(adapter));
+		debug_text_event(adapter->erp_dbf,1,"no_path");
+		zfcp_erp_adapter_shutdown(adapter, 0);
 		break;
 	case CIO_OPER:
 		ZFCP_LOG_NORMAL("adapter %s: operational again\n",
 				zfcp_get_busid_by_adapter(adapter));
+		debug_text_event(adapter->erp_dbf,1,"dev_oper");
 		zfcp_erp_modify_adapter_status(adapter,
 					       ZFCP_STATUS_COMMON_RUNNING,
 					       ZFCP_SET);
@@ -247,6 +248,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
 					ZFCP_STATUS_COMMON_ERP_FAILED);
 		break;
 	}
+	zfcp_erp_wait(adapter);
 	up(&zfcp_data.config_sema);
 	return 1;
 }
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index e4bc663ce..65c89d335 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -33,7 +33,7 @@
 #define ZFCP_DEF_H
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_DEF_REVISION "$Revision: 1.72 $"
+#define ZFCP_DEF_REVISION "$Revision: 1.73 $"
 
 /*************************** INCLUDES *****************************************/
 
@@ -64,8 +64,6 @@
 /************************ DEBUG FLAGS *****************************************/
 
 #define	ZFCP_PRINT_FLAGS
-#define	ZFCP_STAT_REQSIZES
-#define	ZFCP_STAT_QUEUES
 
 /********************* GENERAL DEFINES *********************************/
 
@@ -1080,31 +1078,8 @@ struct zfcp_data {
 	char                    init_busid[BUS_ID_SIZE];
 	wwn_t                   init_wwpn;
 	fcp_lun_t               init_fcp_lun;
-#ifdef ZFCP_STAT_REQSIZES                            /* Statistical accounting
-							of processed data */
-	struct list_head	read_req_head;
-	struct list_head	write_req_head;
-	struct list_head	read_sg_head;
-	struct list_head	write_sg_head;
-	struct list_head	read_sguse_head;
-	struct list_head	write_sguse_head;
-	unsigned long		stat_errors;
-	rwlock_t		stat_lock;
-#endif
-#ifdef ZFCP_STAT_QUEUES
-        atomic_t                outbound_queue_full;
-	atomic_t		outbound_total;
-#endif
 };
 
-#ifdef ZFCP_STAT_REQSIZES
-struct zfcp_statistics {
-        struct list_head list;
-        u32 num;
-        u32 occurrence;
-};
-#endif
-
 struct zfcp_sg_list {
 	struct scatterlist *sg;
 	unsigned int count;
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 045d04ba8..505e16ff5 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -31,7 +31,7 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_ERP
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_ERP_REVISION "$Revision: 1.51 $"
+#define ZFCP_ERP_REVISION "$Revision: 1.54 $"
 
 #include "zfcp_ext.h"
 
@@ -126,37 +126,6 @@ static void zfcp_erp_memwait_handler(unsigned long);
 static void zfcp_erp_timeout_handler(unsigned long);
 static inline void zfcp_erp_timeout_init(struct zfcp_erp_action *);
 
-/*
- * function:	zfcp_erp_adapter_shutdown_all
- *
- * purpose:	recursively calls zfcp_erp_adapter_shutdown to stop all
- *              IO on each adapter, return all outstanding packets and 
- *              relinquish all IRQs
- *              Note: This function waits for completion of all shutdowns
- *
- * returns:     0 in all cases
- */
-int
-zfcp_erp_adapter_shutdown_all(void)
-{
-	int retval = 0;
-	unsigned long flags;
-	struct zfcp_adapter *adapter;
-
-	read_lock_irqsave(&zfcp_data.config_lock, flags);
-	list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list)
-	    zfcp_erp_adapter_shutdown(adapter, 0);
-	read_unlock_irqrestore(&zfcp_data.config_lock, flags);
-
-	/*
-	 * FIXME : need to take config_lock but cannot, since we schedule here.
-	 */
-	/* start all shutdowns first before any waiting to allow for concurreny */
-	list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list)
-	    zfcp_erp_wait(adapter);
-
-	return retval;
-}
 
 /*
  * function:	zfcp_fsf_scsi_er_timeout_handler
@@ -2328,7 +2297,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
 
 	if (qdio_establish(&adapter->qdio_init_data) != 0) {
 		ZFCP_LOG_INFO("error: establishment of QDIO queues failed "
-			      "on adapter %s\n.",
+			      "on adapter %s\n",
 			      zfcp_get_busid_by_adapter(adapter));
 		goto failed_qdio_establish;
 	}
@@ -2540,6 +2509,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
 		atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
 				  &adapter->status);
 		ZFCP_LOG_DEBUG("Doing exchange config data\n");
+		zfcp_erp_action_to_running(erp_action);
 		zfcp_erp_timeout_init(erp_action);
 		if (zfcp_fsf_exchange_config_data(erp_action)) {
 			retval = ZFCP_ERP_FAILED;
@@ -2566,7 +2536,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
 		 * _must_ be the one belonging to the 'exchange config
 		 * data' request.
 		 */
-		down_interruptible(&adapter->erp_ready_sem);
+		down(&adapter->erp_ready_sem);
 		if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
 			ZFCP_LOG_INFO("error: exchange of configuration data "
 				      "for adapter %s timed out\n",
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 500ab47c8..2db169554 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -31,7 +31,7 @@
 #ifndef ZFCP_EXT_H
 #define ZFCP_EXT_H
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_EXT_REVISION "$Revision: 1.49 $"
+#define ZFCP_EXT_REVISION "$Revision: 1.50 $"
 
 #include "zfcp_def.h"
 
@@ -141,7 +141,6 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *unit,
 extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int);
 extern int  zfcp_erp_adapter_reopen(struct zfcp_adapter *, int);
 extern int  zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int);
-extern int  zfcp_erp_adapter_shutdown_all(void);
 extern void zfcp_erp_adapter_failed(struct zfcp_adapter *);
 
 extern void zfcp_erp_modify_port_status(struct zfcp_port *, u32, int);
@@ -169,7 +168,4 @@ extern void zfcp_cmd_dbf_event_fsf(const char *, struct zfcp_fsf_req *,
 extern void zfcp_cmd_dbf_event_scsi(const char *, struct scsi_cmnd *);
 extern void zfcp_in_els_dbf_event(struct zfcp_adapter *, const char *,
 				  struct fsf_status_read_buffer *, int);
-#ifdef ZFCP_STAT_REQSIZES
-extern int  zfcp_statistics_inc(struct list_head *, u32);
-#endif
 #endif	/* ZFCP_EXT_H */
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 79bb0bab4..85120ce9f 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -29,7 +29,7 @@
  */
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_FSF_C_REVISION "$Revision: 1.45 $"
+#define ZFCP_FSF_C_REVISION "$Revision: 1.47 $"
 
 #include "zfcp_ext.h"
 
@@ -412,7 +412,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
 		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
 		atomic_set_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
 				&(adapter->status));
-		debug_text_event(adapter->erp_dbf, 4, "prot_con_init");
+		debug_text_event(adapter->erp_dbf, 3, "prot_con_init");
 		break;
 
 	case FSF_PROT_DUPLICATE_REQUEST_ID:
@@ -4809,9 +4809,6 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags,
 	goto success;
 
  failed_sbals:
-#ifdef ZFCP_STAT_QUEUES
-	atomic_inc(&zfcp_data.outbound_queue_full);
-#endif
 /* dequeue new FSF request previously enqueued */
 	zfcp_fsf_req_free(fsf_req);
 	fsf_req = NULL;
@@ -4948,9 +4945,6 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
 		}
 		/* count FSF requests pending */
 		atomic_inc(&adapter->fsf_reqs_active);
-#ifdef ZFCP_STAT_QUEUES
-		atomic_inc(&zfcp_data.outbound_total);
-#endif
 	}
 	return retval;
 }
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index ca238c054..1939f1fe6 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -28,7 +28,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_QDIO_C_REVISION "$Revision: 1.18 $"
+#define ZFCP_QDIO_C_REVISION "$Revision: 1.19 $"
 
 #include "zfcp_ext.h"
 
@@ -682,12 +682,6 @@ zfcp_qdio_sbale_fill(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
 	sbale = zfcp_qdio_sbale_curr(fsf_req);
 	sbale->addr = addr;
 	sbale->length = length;
-
-#ifdef ZFCP_STAT_REQSIZES
-        if (sbtype == SBAL_FLAGS0_TYPE_READ)
-                zfcp_statistics_inc(&zfcp_data.read_sg_head, length);
-        else    zfcp_statistics_inc(&zfcp_data.write_sg_head, length);
-#endif
 }
 
 /**
@@ -770,18 +764,7 @@ zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
 	/* assume that no other SBALEs are to follow in the same SBAL */
 	sbale = zfcp_qdio_sbale_curr(fsf_req);
 	sbale->flags |= SBAL_FLAGS_LAST_ENTRY;
-
 out:
-#ifdef ZFCP_STAT_REQSIZES
-	if (sbtype == SBAL_FLAGS0_TYPE_READ) {
-		zfcp_statistics_inc(&zfcp_data.read_sguse_head, sg_count);
-		zfcp_statistics_inc(&zfcp_data.read_req_head, bytes);
-	} else	{
-		zfcp_statistics_inc(&zfcp_data.write_sguse_head, sg_count);
-        	zfcp_statistics_inc(&zfcp_data.write_req_head, bytes);
-	}
-#endif
-
 	return bytes;
 }
 
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index cd31a019e..34a73f2f0 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -31,9 +31,7 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_SCSI
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_SCSI_REVISION "$Revision: 1.61 $"
-
-#include <linux/blkdev.h>
+#define ZFCP_SCSI_REVISION "$Revision: 1.62 $"
 
 #include "zfcp_ext.h"
 
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c
index 389043836..d7536a11a 100644
--- a/drivers/s390/scsi/zfcp_sysfs_adapter.c
+++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c
@@ -26,11 +26,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.32 $"
+#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.33 $"
 
-#include <asm/ccwdev.h>
 #include "zfcp_ext.h"
-#include "zfcp_def.h"
 
 #define ZFCP_LOG_AREA                   ZFCP_LOG_AREA_CONFIG
 
diff --git a/drivers/s390/scsi/zfcp_sysfs_driver.c b/drivers/s390/scsi/zfcp_sysfs_driver.c
index 988dceab5..e0d6eecfe 100644
--- a/drivers/s390/scsi/zfcp_sysfs_driver.c
+++ b/drivers/s390/scsi/zfcp_sysfs_driver.c
@@ -26,11 +26,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_DRIVER_C_REVISION "$Revision: 1.12 $"
+#define ZFCP_SYSFS_DRIVER_C_REVISION "$Revision: 1.14 $"
 
-#include <asm/ccwdev.h>
 #include "zfcp_ext.h"
-#include "zfcp_def.h"
 
 #define ZFCP_LOG_AREA                   ZFCP_LOG_AREA_CONFIG
 
diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c
index f42592912..e0ace9349 100644
--- a/drivers/s390/scsi/zfcp_sysfs_port.c
+++ b/drivers/s390/scsi/zfcp_sysfs_port.c
@@ -26,13 +26,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.39 $"
+#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.40 $"
 
-#include <linux/init.h>
-#include <linux/module.h>
-#include <asm/ccwdev.h>
 #include "zfcp_ext.h"
-#include "zfcp_def.h"
 
 #define ZFCP_LOG_AREA                   ZFCP_LOG_AREA_CONFIG
 
diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c
index bd249730c..904c8aead 100644
--- a/drivers/s390/scsi/zfcp_sysfs_unit.c
+++ b/drivers/s390/scsi/zfcp_sysfs_unit.c
@@ -26,13 +26,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.24 $"
+#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.25 $"
 
-#include <linux/init.h>
-#include <linux/module.h>
-#include <asm/ccwdev.h>
 #include "zfcp_ext.h"
-#include "zfcp_def.h"
 
 #define ZFCP_LOG_AREA                   ZFCP_LOG_AREA_CONFIG
 
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 598745538..e7a540d6e 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -1,12 +1,12 @@
 /* 
    3w-xxxx.c -- 3ware Storage Controller device driver for Linux.
 
-   Written By: Adam Radford <linux@3ware.com>
+   Written By: Adam Radford <linuxraid@amcc.com>
    Modifications By: Joel Jacobson <linux@3ware.com>
    		     Arnaldo Carvalho de Melo <acme@conectiva.com.br>
                      Brad Strand <linux@3ware.com>
 
-   Copyright (C) 1999-2003 3ware Inc.
+   Copyright (C) 1999-2004 3ware Inc.
 
    Kernel compatiblity By: 	Andre Hedrick <andre@suse.com>
    Non-Copyright (C) 2000	Andre Hedrick <andre@suse.com>
@@ -47,10 +47,10 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 
    Bugs/Comments/Suggestions should be mailed to:                            
-   linux@3ware.com
+   linuxraid@amcc.com
 
    For more information, goto:
-   http://www.3ware.com
+   http://www.amcc.com
 
    History
    -------
@@ -179,6 +179,11 @@
    1.02.00.036 - Increase character ioctl timeout to 60 seconds.
    1.02.00.037 - Fix tw_ioctl() to handle all non-data ATA passthru cmds
                  for 'smartmontools' support.
+   1.26.00.038 - Roll driver minor version to 26 to denote kernel 2.6.
+                 Add support for cmds_per_lun module parameter.
+   1.26.00.039 - Fix bug in tw_chrdev_ioctl() polling code.
+                 Fix data_buffer_length usage in tw_chrdev_ioctl().
+                 Update contact information.
 */
 
 #include <linux/module.h>
@@ -205,6 +210,7 @@ MODULE_LICENSE("GPL");
 #include <linux/reboot.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/moduleparam.h>
 
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -242,10 +248,15 @@ static struct file_operations tw_fops = {
 };
 
 /* Globals */
-char *tw_driver_version="1.02.00.037";
+char *tw_driver_version="1.26.00.039";
 TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT];
 int tw_device_extension_count = 0;
 static int twe_major = -1;
+static int cmds_per_lun;
+
+/* Module parameters */
+module_param(cmds_per_lun, int, 0);
+MODULE_PARM_DESC(cmds_per_lun, "Maximum commands per LUN");
 
 /* Functions */
 
@@ -683,7 +694,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 			break;
 		case TW_OP_AEN_LISTEN:
 			dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl(): caught TW_AEN_LISTEN.\n");
-			memset(tw_ioctl->data_buffer, 0, tw_ioctl->data_buffer_length);
+			memset(tw_ioctl->data_buffer, 0, data_buffer_length);
 
 			spin_lock_irqsave(tw_dev->host->host_lock, flags);
 			if (tw_dev->aen_head == tw_dev->aen_tail) {
@@ -738,7 +749,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 			timeout = TW_IOCTL_CHRDEV_TIMEOUT*HZ;
 
 			/* Now wait for the command to complete */
-			wait_event_interruptible_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout);
+			timeout = wait_event_interruptible_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout);
 
 			/* Check if we timed out, got a signal, or didn't get
 			   an interrupt */
@@ -777,7 +788,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	}
 
 	/* Now copy the response to userspace */
-	error = copy_to_user((void *)arg, tw_ioctl, sizeof(TW_New_Ioctl) + tw_ioctl->data_buffer_length - 1);
+	error = copy_to_user((void *)arg, tw_ioctl, sizeof(TW_New_Ioctl) + data_buffer_length - 1);
 	if (error == 0)
 		retval = 0;
 out2:
@@ -1141,14 +1152,6 @@ int tw_findcards(Scsi_Host_Template *tw_host)
 			/* Set card status as online */
 			tw_dev->online = 1;
 
-#ifdef CONFIG_3W_XXXX_CMD_PER_LUN
-			tw_host->cmd_per_lun = CONFIG_3W_XXXX_CMD_PER_LUN;
-			if (tw_host->cmd_per_lun > TW_MAX_CMDS_PER_LUN)
-				tw_host->cmd_per_lun = TW_MAX_CMDS_PER_LUN;
-#else
-			/* Use SHT cmd_per_lun here */
-			tw_host->cmd_per_lun = TW_MAX_CMDS_PER_LUN;
-#endif
 			tw_dev->free_head = TW_Q_START;
 			tw_dev->free_tail = TW_Q_START;
 			tw_dev->free_wrap = TW_Q_LENGTH - 1;
@@ -3386,13 +3389,13 @@ int tw_slave_configure(Scsi_Device *SDptr)
 
 	dprintk(KERN_WARNING "3w-xxxx: tw_slave_configure()\n");
 
-#ifdef CONFIG_3W_XXXX_CMD_PER_LUN
-	max_cmds = CONFIG_3W_XXXX_CMD_PER_LUN;
-	if (max_cmds > TW_MAX_CMDS_PER_LUN)
+	if (cmds_per_lun) {
+		max_cmds = cmds_per_lun;
+		if (max_cmds > TW_MAX_CMDS_PER_LUN)
+			max_cmds = TW_MAX_CMDS_PER_LUN;
+	} else {
 		max_cmds = TW_MAX_CMDS_PER_LUN;
-#else
-	max_cmds = TW_MAX_CMDS_PER_LUN;
-#endif
+	}
 	scsi_adjust_queue_depth(SDptr, MSG_ORDERED_TAG, max_cmds);
 
 	return 0;
@@ -3488,6 +3491,7 @@ static Scsi_Host_Template driver_template = {
 	.eh_abort_handler	= tw_scsi_eh_abort,
 	.eh_host_reset_handler	= tw_scsi_eh_reset,
 	.bios_param		= tw_scsi_biosparam,
+	.slave_configure	= tw_slave_configure,
 	.can_queue		= TW_Q_LENGTH-2,
 	.this_id		= -1,
 	.sg_tablesize		= TW_MAX_SGL_LENGTH,
diff --git a/drivers/scsi/3w-xxxx.h b/drivers/scsi/3w-xxxx.h
index fd0f4c72f..7b9bb938b 100644
--- a/drivers/scsi/3w-xxxx.h
+++ b/drivers/scsi/3w-xxxx.h
@@ -1,12 +1,12 @@
 /* 
    3w-xxxx.h -- 3ware Storage Controller device driver for Linux.
    
-   Written By: Adam Radford <linux@3ware.com>
+   Written By: Adam Radford <linuxraid@amcc.com>
    Modifications By: Joel Jacobson <linux@3ware.com>
    		     Arnaldo Carvalho de Melo <acme@conectiva.com.br>
                      Brad Strand <linux@3ware.com>
 
-   Copyright (C) 1999-2003 3ware Inc.
+   Copyright (C) 1999-2004 3ware Inc.
 
    Kernel compatiblity By:	Andre Hedrick <andre@suse.com>
    Non-Copyright (C) 2000	Andre Hedrick <andre@suse.com>
@@ -45,10 +45,10 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 
    Bugs/Comments/Suggestions should be mailed to:                            
-   linux@3ware.com
+   linuxraid@amcc.com
    
    For more information, goto:
-   http://www.3ware.com
+   http://www.amcc.com
 */
 
 #ifndef _3W_XXXX_H
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 21368b1f4..4390af7a1 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -149,19 +149,8 @@ config SCSI_MULTI_LUN
 	  can say Y here to force the SCSI driver to probe for multiple LUNs.
 	  A SCSI device with multiple LUNs acts logically like multiple SCSI
 	  devices. The vast majority of SCSI devices have only one LUN, and
-	  so most people can say N here and should in fact do so, because it
-	  is safer.
-
-config SCSI_REPORT_LUNS
-	bool "Build with SCSI REPORT LUNS support"
-	depends on SCSI
-	default y
-	help
-	  If you want support for SCSI REPORT LUNS, say Y here.
-	  The REPORT LUNS command is useful for devices (such as disk arrays)
-	  with large numbers of LUNs where the LUN values are not contiguous
-	  (sparse LUN).  REPORT LUNS scanning is done only for SCSI-3 devices.
-	  Most users can safely answer N here.
+	  so most people can say N here. The max_luns boot/module parameter 
+	  allows to override this setting.
 
 config SCSI_CONSTANTS
 	bool "Verbose SCSI error reporting (kernel size +=12K)"
@@ -363,7 +352,7 @@ source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
 # All the I2O code and drivers do not seem to be 64bit safe.
 config SCSI_DPT_I2O
 	tristate "Adaptec I2O RAID support "
-	depends on !64BIT && SCSI && BROKEN
+	depends on !64BIT && SCSI && PCI
 	help
 	  This driver supports all of Adaptec's I2O based RAID controllers as 
 	  well as the DPT SmartRaid V cards.  This is an Adaptec maintained
@@ -434,10 +423,18 @@ config SCSI_ATA_PIIX
 	  If unsure, say N.
 
 config SCSI_SATA_PROMISE
-	tristate "Promise SATA support"
+	tristate "Promise SATA TX2/TX4 support"
+	depends on SCSI_SATA && PCI
+	help
+	  This option enables support for Promise Serial ATA TX2/TX4.
+
+	  If unsure, say N.
+
+config SCSI_SATA_SX4
+	tristate "Promise SATA SX4 support"
 	depends on SCSI_SATA && PCI && EXPERIMENTAL
 	help
-	  This option enables support for Promise Serial ATA.
+	  This option enables support for Promise Serial ATA SX4.
 
 	  If unsure, say N.
 
@@ -497,9 +494,15 @@ config SCSI_OMIT_FLASHPOINT
 	  substantial, so users of MultiMaster Host Adapters may wish to omit
 	  it.
 
+#
+# This is marked broken because it uses over 4kB of stack in
+# just two routines:
+#     2076  CpqTsProcessIMQEntry
+#     2052  PeekIMQEntry
+#
 config SCSI_CPQFCTS
 	tristate "Compaq Fibre Channel 64-bit/66Mhz HBA support"
-	depends on PCI && SCSI
+	depends on PCI && SCSI && BROKEN
 	help
 	  Say Y here to compile in support for the Compaq StorageWorks Fibre
 	  Channel 64-bit/66Mhz Host Bus Adapter.
@@ -979,6 +982,31 @@ config SCSI_SYM53C8XX_IOMAPPED
 	  the card.  This is significantly slower then using memory
 	  mapped IO.  Most people should answer N.
 
+config SCSI_IPR
+	tristate "IBM Power Linux RAID adapter support"
+	depends on PCI && SCSI
+	select FW_LOADER
+	---help---
+	  This driver supports the IBM Power Linux family RAID adapters.
+	  This includes IBM pSeries 5712, 5703, 5709, and 570A, as well
+	  as IBM iSeries 5702, 5703, 5709, and 570A.
+
+config SCSI_IPR_TRACE
+	bool "enable driver internal trace"
+	depends on SCSI_IPR
+	help
+	  If you say Y here, the driver will trace all commands issued
+	  to the adapter. Performance impact is minimal. Trace can be
+	  dumped using /sys/bus/class/scsi_host/hostXX/trace.
+
+config SCSI_IPR_DUMP
+	bool "enable adapter dump support"
+	depends on SCSI_IPR
+	help
+	  If you say Y here, the driver will support adapter crash dump.
+	  If you enable this support, the iprdump daemon can be used
+	  to capture adapter failure analysis information.
+
 config SCSI_ZALON
 	tristate "Zalon SCSI support"
 	depends on GSC && SCSI
@@ -1100,7 +1128,7 @@ config SCSI_NCR53C8XX_NO_DISCONNECT
 
 config SCSI_MCA_53C9X
 	tristate "NCR MCA 53C9x SCSI support"
-	depends on MCA && SCSI && BROKEN_ON_SMP
+	depends on MCA_LEGACY && SCSI && BROKEN_ON_SMP
 	help
 	  Some MicroChannel machines, notably the NCR 35xx line, use a SCSI
 	  controller based on the NCR 53C94.  This driver will allow use of
@@ -1703,8 +1731,17 @@ config WD33C93_PIO
 #      bool 'Cyberstorm Mk III SCSI support (EXPERIMENTAL)' CONFIG_CYBERSTORMIII_SCSI
 
 config ZFCP
-	tristate "IBM z900 OpenFCP/SCSI support"
+	tristate "FCP host bus adapter driver for IBM eServer zSeries"
 	depends on ARCH_S390 && SCSI
+	help
+          If you want to access SCSI devices attached to your IBM eServer
+          zSeries by means of Fibre Channel interfaces say Y.
+          For details please refer to the documentation provided by IBM at
+          <http://oss.software.ibm.com/developerworks/opensource/linux390>
+
+          This driver is also available as a module. This module will be
+          called zfcp. If you want to compile it as a module, say M here
+          and read Documentation/modules.txt.
 
 endmenu
 
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 19451e955..73e462e5d 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -75,7 +75,8 @@ obj-$(CONFIG_SCSI_NCR53C406A)	+= NCR53c406a.o
 obj-$(CONFIG_SCSI_NCR_D700)	+= 53c700.o NCR_D700.o
 obj-$(CONFIG_SCSI_NCR_Q720)	+= NCR_Q720_mod.o
 obj-$(CONFIG_SCSI_SYM53C416)	+= sym53c416.o
-obj-$(CONFIG_SCSI_QLOGIC_FAS)	+= qlogicfas.o
+obj-$(CONFIG_SCSI_QLOGIC_FAS)	+= qlogicfas408.o	qlogicfas.o
+obj-$(CONFIG_PCMCIA_QLOGIC)	+= qlogicfas408.o
 obj-$(CONFIG_SCSI_QLOGIC_ISP)	+= qlogicisp.o 
 obj-$(CONFIG_SCSI_QLOGIC_FC)	+= qlogicfc.o 
 obj-$(CONFIG_SCSI_QLOGIC_1280)	+= qla1280.o 
@@ -117,6 +118,7 @@ obj-$(CONFIG_SCSI_FCAL)		+= fcal.o
 obj-$(CONFIG_SCSI_CPQFCTS)	+= cpqfc.o
 obj-$(CONFIG_SCSI_LASI700)	+= 53c700.o lasi700.o
 obj-$(CONFIG_SCSI_NSP32)	+= nsp32.o
+obj-$(CONFIG_SCSI_IPR)		+= ipr.o
 obj-$(CONFIG_SCSI_SATA_SVW)	+= libata.o sata_svw.o
 obj-$(CONFIG_SCSI_ATA_PIIX)	+= libata.o ata_piix.o
 obj-$(CONFIG_SCSI_SATA_PROMISE)	+= libata.o sata_promise.o
@@ -124,6 +126,7 @@ obj-$(CONFIG_SCSI_SATA_SIL)	+= libata.o sata_sil.o
 obj-$(CONFIG_SCSI_SATA_VIA)	+= libata.o sata_via.o
 obj-$(CONFIG_SCSI_SATA_VITESSE)	+= libata.o sata_vsc.o
 obj-$(CONFIG_SCSI_SATA_SIS)	+= libata.o sata_sis.o
+obj-$(CONFIG_SCSI_SATA_SX4)	+= libata.o sata_sx4.o
 
 obj-$(CONFIG_ARM)		+= arm/
 
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index be58e5a9e..2abc6e478 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -170,7 +170,6 @@ enum Phase {
 /* Static function prototypes */
 static void NCR53c406a_intr(int, void *, struct pt_regs *);
 static irqreturn_t do_NCR53c406a_intr(int, void *, struct pt_regs *);
-static void wait_intr(void);
 static void chip_init(void);
 static void calc_port_addr(void);
 #ifndef IRQ_LEV
@@ -665,6 +664,7 @@ static const char *NCR53c406a_info(struct Scsi_Host *SChost)
 	return (info_msg);
 }
 
+#if 0
 static void wait_intr(void)
 {
 	unsigned long i = jiffies + WATCHDOG;
@@ -684,6 +684,7 @@ static void wait_intr(void)
 
 	NCR53c406a_intr(0, NULL, NULL);
 }
+#endif
 
 static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 {
diff --git a/drivers/scsi/aacraid/README b/drivers/scsi/aacraid/README
index c5cdb677f..4624917b3 100644
--- a/drivers/scsi/aacraid/README
+++ b/drivers/scsi/aacraid/README
@@ -38,15 +38,19 @@ Deanna Bonds <deanna_bonds@adaptec.com> (non-DASD support, PAE fibs and 64 bit,
 					(fixed 64bit and 64G memory model, changed confusing naming convention
 					 where fibs that go to the hardware are consistently called hw_fibs and
 					 not just fibs like the name of the driver tracking structure)
+Mark Salyzyn <Mark_Salyzyn@adaptec.com> Fixed panic issues and added some new product ids for upcoming hbas.
+
 Original Driver
 -------------------------
 Adaptec Unix OEM Product Group
 
 Mailing List
 -------------------------
-None currently. Also note this is very different to Brian's original driver
+linux-aacraid-devel@dell.com (Interested parties troll here)
+http://mbserver.adaptec.com/ (Currently more Community Support than Devel Support)
+Also note this is very different to Brian's original driver
 so don't expect him to support it.
-Adaptec does support this driver.  Contact either tech support or deanna bonds.
+Adaptec does support this driver.  Contact either tech support or Mark Salyzyn.
 
 Original by Brian Boerner February 2001
 Rewritten by Alan Cox, November 2001
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 8736443ca..e4164c308 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1,18 +1,20 @@
-//#define dprintk(x) printk x
-#define dprintk(x)
+#if (!defined(dprintk))
+# define dprintk(x)
+#endif
 
 /*------------------------------------------------------------------------------
  *              D E F I N E S
  *----------------------------------------------------------------------------*/
+
 #define MAXIMUM_NUM_CONTAINERS	31
 #define MAXIMUM_NUM_ADAPTERS	8
 
-#define AAC_NUM_FIB	578
+#define AAC_NUM_FIB		578
 //#define AAC_NUM_IO_FIB	512
-#define AAC_NUM_IO_FIB	100
+#define AAC_NUM_IO_FIB		100
 
-#define AAC_MAX_TARGET (MAXIMUM_NUM_CONTAINERS+1)
-#define AAC_MAX_LUN	(8)
+#define AAC_MAX_TARGET 		(MAXIMUM_NUM_CONTAINERS+1)
+#define AAC_MAX_LUN		(8)
 
 #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
 
@@ -240,92 +242,6 @@ enum aac_queue_types {
         AdapHighRespQueue	/* Host to adapter high priority response traffic */
 };
 
-/*
- * Implement our own version of these so we have 64 bit compatability
- * The adapter uses these and can only handle 32 bit addresses
- */
-
-struct aac_list_head {
-	u32 next;
-	u32 prev;
-};
-
-#define AAC_INIT_LIST_HEAD(ptr) do { \
-	(ptr)->next = (u32)(ulong)(ptr); \
-	(ptr)->prev = (u32)(ulong)(ptr); \
-} while (0)
-/**
- * aac_list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static __inline__ int aac_list_empty(struct aac_list_head *head)
-{
-	return head->next == ((u32)(ulong)head);
-}
-
-/*
- * Insert a new entry between two known consecutive entries. 
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static __inline__ void aac_list_add(struct aac_list_head * n,
-	struct aac_list_head * prev,
-	struct aac_list_head * next)
-{
-	next->prev = (u32)(ulong)n;
-	n->next = (u32)(ulong)next;
-	n->prev = (u32)(ulong)prev;
-	prev->next = (u32)(ulong)n;
-}
-
-/**
- * list_add_tail - add a new entry
- * @new: new entry to be added
- * @head: list head to add it before
- *
- * Insert a new entry before the specified head.
- * This is useful for implementing queues.
- */
-static __inline__ void aac_list_add_tail(struct aac_list_head *n, struct aac_list_head *head)
-{
-	aac_list_add(n, (struct aac_list_head*)(ulong)(head->prev), head);
-}
-
-/*
- * Delete a list entry by making the prev/next entries
- * point to each other.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static __inline__ void __aac_list_del(struct aac_list_head * p,
-				  struct aac_list_head * n)
-{
-	n->prev = (u32)(ulong)p;
-	p->next = (u32)(ulong)n;
-}
-
-/**
- * aac_list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
- */
-static __inline__ void aac_list_del(struct aac_list_head *entry)
-{
-	__aac_list_del((struct aac_list_head*)(ulong)entry->prev,(struct aac_list_head*)(ulong) entry->next);
-	entry->next = entry->prev = 0;
-}
-
-/**
- * aac_list_entry - get the struct for this entry
- * @ptr:	the &struct list_head pointer.
- * @type:	the type of the struct this is embedded in.
- * @member:	the name of the list_struct within the struct.
- */
-#define aac_list_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(ulong)(&((type *)0)->member)))
-
 /*
  *	Assign type values to the FSA communication data structures
  */
@@ -339,11 +255,11 @@ static __inline__ void aac_list_del(struct aac_list_head *entry)
 #define		FsaNormal	1
 #define		FsaHigh		2
 
-
 /*
  * Define the FIB. The FIB is the where all the requested data and
  * command information are put to the application on the FSA adapter.
  */
+
 struct aac_fibhdr {
 	u32 XferState;			// Current transfer state for this CCB
 	u16 Command;			// Routing information for the destination
@@ -359,13 +275,9 @@ struct aac_fibhdr {
 		    u32 _ReceiverTimeStart; 	// Timestamp for receipt of fib
 		    u32 _ReceiverTimeDone;	// Timestamp for completion of fib
 		} _s;
-		struct aac_list_head _FibLinks;	// Used to link Adapter Initiated Fibs on the host
-//		struct list_head _FibLinks;	// Used to link Adapter Initiated Fibs on the host
 	} _u;
 };
 
-#define FibLinks			_u._FibLinks
-
 #define FIB_DATA_SIZE_IN_BYTES (512 - sizeof(struct aac_fibhdr))
 
 
@@ -558,12 +470,11 @@ struct aac_queue {
 	spinlock_t		lockdata;	/* Actual lock (used only on one side of the lock) */
 	unsigned long		SavedIrql;     	/* Previous IRQL when the spin lock is taken */
 	u32			padding;	/* Padding - FIXME - can remove I believe */
-	struct aac_list_head 	cmdq;	   	/* A queue of FIBs which need to be prcessed by the FS thread. This is */
-//	struct list_head 	cmdq;	   	/* A queue of FIBs which need to be prcessed by the FS thread. This is */
-                                		        /* only valid for command queues which receive entries from the adapter. */
-	struct list_head	pendingq;		/* A queue of outstanding fib's to the adapter. */
-	u32			numpending;		/* Number of entries on outstanding queue. */
-	struct aac_dev *	dev;			/* Back pointer to adapter structure */
+	struct list_head 	cmdq;	   	/* A queue of FIBs which need to be prcessed by the FS thread. This is */
+                                		/* only valid for command queues which receive entries from the adapter. */
+	struct list_head	pendingq;	/* A queue of outstanding fib's to the adapter. */
+	u32			numpending;	/* Number of entries on outstanding queue. */
+	struct aac_dev *	dev;		/* Back pointer to adapter structure */
 };
 
 /*
@@ -744,7 +655,7 @@ struct aac_fib_context {
 	struct semaphore 	wait_sem;	// this is used to wait for the next fib to arrive.
 	int			wait;		// Set to true when thread is in WaitForSingleObject
 	unsigned long		count;		// total number of FIBs on FibList
-	struct aac_list_head	hw_fib_list;	// this holds hw_fibs which should be 32 bit addresses
+	struct list_head	fib_list;	// this holds fibs and their attachd hw_fibs
 };
 
 struct fsa_scsi_hba {
@@ -781,7 +692,11 @@ struct fib {
 	 *	Outstanding I/O queue.
 	 */
 	struct list_head	queue;
-
+	/*
+	 *	And for the internal issue/reply queues (we may be able
+	 *	to merge these two)
+	 */
+	struct list_head	fiblink;
 	void 			*data;
 	struct hw_fib		*hw_fib;		/* Actual shared object */
 	dma_addr_t		hw_fib_pa;		/* physical address of hw_fib*/
@@ -836,19 +751,19 @@ struct aac_adapter_info
 /*
  * Supported Options
  */
-#define AAC_OPT_SNAPSHOT	cpu_to_le32(1)
-#define AAC_OPT_CLUSTERS	cpu_to_le32(1<<1)
-#define AAC_OPT_WRITE_CACHE	cpu_to_le32(1<<2)
-#define AAC_OPT_64BIT_DATA	cpu_to_le32(1<<3)
-#define AAC_OPT_HOST_TIME_FIB	cpu_to_le32(1<<4)
-#define AAC_OPT_RAID50		cpu_to_le32(1<<5)
-#define AAC_OPT_4GB_WINDOW	cpu_to_le32(1<<6)
-#define AAC_OPT_SCSI_UPGRADEABLE cpu_to_le32(1<<7)
-#define AAC_OPT_SOFT_ERR_REPORT	cpu_to_le32(1<<8)
-#define AAC_OPT_SUPPORTED_RECONDITION cpu_to_le32(1<<9)
-#define AAC_OPT_SGMAP_HOST64	cpu_to_le32(1<<10)
-#define AAC_OPT_ALARM		cpu_to_le32(1<<11)
-#define AAC_OPT_NONDASD		cpu_to_le32(1<<12)
+#define AAC_OPT_SNAPSHOT		cpu_to_le32(1)
+#define AAC_OPT_CLUSTERS		cpu_to_le32(1<<1)
+#define AAC_OPT_WRITE_CACHE		cpu_to_le32(1<<2)
+#define AAC_OPT_64BIT_DATA		cpu_to_le32(1<<3)
+#define AAC_OPT_HOST_TIME_FIB		cpu_to_le32(1<<4)
+#define AAC_OPT_RAID50			cpu_to_le32(1<<5)
+#define AAC_OPT_4GB_WINDOW		cpu_to_le32(1<<6)
+#define AAC_OPT_SCSI_UPGRADEABLE 	cpu_to_le32(1<<7)
+#define AAC_OPT_SOFT_ERR_REPORT		cpu_to_le32(1<<8)
+#define AAC_OPT_SUPPORTED_RECONDITION 	cpu_to_le32(1<<9)
+#define AAC_OPT_SGMAP_HOST64		cpu_to_le32(1<<10)
+#define AAC_OPT_ALARM			cpu_to_le32(1<<11)
+#define AAC_OPT_NONDASD			cpu_to_le32(1<<12)
 
 struct aac_dev
 {
@@ -862,11 +777,10 @@ struct aac_dev
 	 */	
 	dma_addr_t		hw_fib_pa;
 	struct hw_fib		*hw_fib_va;
-	ulong			fib_base_va;
+	struct hw_fib		*aif_base_va;
 	/*
 	 *	Fib Headers
 	 */
-// dmb	struct fib              fibs[AAC_NUM_FIB]; /* Doing it here takes up too much from the scsi pool*/
 	struct fib              *fibs;
 
 	struct fib		*free_fib;
@@ -887,7 +801,6 @@ struct aac_dev
 	unsigned long		fsrev;		/* Main driver's revision number */
 	
 	struct aac_init		*init;		/* Holds initialization info to communicate with adapter */
-//	void *			init_pa; 	/* Holds physical address of the init struct */
 	dma_addr_t		init_pa; 	/* Holds physical address of the init struct */
 	
 	struct pci_dev		*pdev;		/* Our PCI interface */
@@ -898,7 +811,7 @@ struct aac_dev
 
 	struct Scsi_Host	*scsi_host_ptr;
 	struct fsa_scsi_hba	fsa_dev;
-	int			thread_pid;
+	pid_t			thread_pid;
 	int			cardtype;
 	
 	/*
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 8ee29ca51..6af1ec0ea 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -148,7 +148,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void *arg)
 		 *	the list to 0.
 		 */
 		fibctx->count = 0;
-		AAC_INIT_LIST_HEAD(&fibctx->hw_fib_list);
+		INIT_LIST_HEAD(&fibctx->fib_list);
 		fibctx->jiffies = jiffies/HZ;
 		/*
 		 *	Now add this context onto the adapter's 
@@ -179,7 +179,7 @@ static int next_getadapter_fib(struct aac_dev * dev, void *arg)
 {
 	struct fib_ioctl f;
 	struct aac_fib_context *fibctx, *aifcp;
-	struct hw_fib * hw_fib;
+	struct fib *fib;
 	int status;
 	struct list_head * entry;
 	int found;
@@ -222,25 +222,27 @@ static int next_getadapter_fib(struct aac_dev * dev, void *arg)
 	 *	-EAGAIN
 	 */
 return_fib:
-	if (!aac_list_empty(&fibctx->hw_fib_list)) {
-		struct aac_list_head * entry;
+	if (!list_empty(&fibctx->fib_list)) {
+		struct list_head * entry;
 		/*
 		 *	Pull the next fib from the fibs
 		 */
-		entry = (struct aac_list_head*)(ulong)fibctx->hw_fib_list.next;
-		aac_list_del(entry);
+		entry = fibctx->fib_list.next;
+		list_del(entry);
 		
-		hw_fib = aac_list_entry(entry, struct hw_fib, header.FibLinks);
+		fib = list_entry(entry, struct fib, fiblink);
 		fibctx->count--;
 		spin_unlock_irqrestore(&dev->fib_lock, flags);
-		if (copy_to_user(f.fib, hw_fib, sizeof(struct hw_fib))) {
-			kfree(hw_fib);
+		if (copy_to_user(f.fib, fib->hw_fib, sizeof(struct hw_fib))) {
+			kfree(fib->hw_fib);
+			kfree(fib);
 			return -EFAULT;
 		}	
 		/*
 		 *	Free the space occupied by this copy of the fib.
 		 */
-		kfree(hw_fib);
+		kfree(fib->hw_fib);
+		kfree(fib);
 		status = 0;
 		fibctx->jiffies = jiffies/HZ;
 	} else {
@@ -262,24 +264,25 @@ return_fib:
 
 int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context * fibctx)
 {
-	struct hw_fib *hw_fib;
+	struct fib *fib;
 
 	/*
 	 *	First free any FIBs that have not been consumed.
 	 */
-	while (!aac_list_empty(&fibctx->hw_fib_list)) {
-		struct aac_list_head * entry;
+	while (!list_empty(&fibctx->fib_list)) {
+		struct list_head * entry;
 		/*
 		 *	Pull the next fib from the fibs
 		 */
-		entry = (struct aac_list_head*)(ulong)(fibctx->hw_fib_list.next);
-		aac_list_del(entry);
-		hw_fib = aac_list_entry(entry, struct hw_fib, header.FibLinks);
+		entry = fibctx->fib_list.next;
+		list_del(entry);
+		fib = list_entry(entry, struct fib, fiblink);
 		fibctx->count--;
 		/*
 		 *	Free the space occupied by this copy of the fib.
 		 */
-		kfree(hw_fib);
+		kfree(fib->hw_fib);
+		kfree(fib);
 	}
 	/*
 	 *	Remove the Context from the AdapterFibContext List
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 32849f2db..beb561fa0 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -81,9 +81,9 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
 	 *	Adapter Fibs are the first thing allocated so that they
 	 *	start page aligned
 	 */
-	dev->fib_base_va = (ulong)base;
+	dev->aif_base_va = (struct hw_fib *)base;
 	
-	init->AdapterFibsVirtualAddress = cpu_to_le32((u32)(ulong)phys);
+	init->AdapterFibsVirtualAddress = cpu_to_le32(0);
 	init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys);
 	init->AdapterFibsSize = cpu_to_le32(fibsize);
 	init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib));
@@ -94,6 +94,9 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
 	 * mapping system, but older Firmware did, and had *troubles* dealing
 	 * with the math overloading past 32 bits, thus we must limit this
 	 * field.
+	 *
+	 * FIXME: this assumes the memory is mapped zero->n, which isnt
+	 * always true on real computers.
 	 */
 	if ((num_physpages << (PAGE_SHIFT - 12)) <= AAC_MAX_HOSTPHYSMEMPAGES) {
 		init->HostPhysMemPages = 
@@ -140,7 +143,7 @@ static void aac_queue_init(struct aac_dev * dev, struct aac_queue * q, u32 *mem,
 	q->dev = dev;
 	INIT_LIST_HEAD(&q->pendingq);
 	init_waitqueue_head(&q->cmdready);
-	AAC_INIT_LIST_HEAD(&q->cmdq);
+	INIT_LIST_HEAD(&q->cmdq);
 	init_waitqueue_head(&q->qfull);
 	spin_lock_init(&q->lockdata);
 	q->lock = &q->lockdata;
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 0465af27f..b5ac3c270 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -133,13 +133,10 @@ struct fib * fib_alloc(struct aac_dev *dev)
 	unsigned long flags;
 	spin_lock_irqsave(&dev->fib_lock, flags);
 	fibptr = dev->free_fib;	
-	while(!fibptr){
-		spin_unlock_irqrestore(&dev->fib_lock, flags);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
-		spin_lock_irqsave(&dev->fib_lock, flags);
-		fibptr = dev->free_fib;	
-	}
+	/* Cannot sleep here or you get hangs. Instead we did the
+	   maths at compile time. */
+	if(!fibptr)
+		BUG();
 	dev->free_fib = fibptr->next;
 	spin_unlock_irqrestore(&dev->fib_lock, flags);
 	/*
@@ -290,7 +287,7 @@ static int aac_get_entry (struct aac_dev * dev, u32 qid, struct aac_entry **entr
 	}
 }   
 
-/*Command thread: *
+/**
  *	aac_queue_get		-	get the next free QE
  *	@dev: Adapter
  *	@index: Returned index
@@ -450,8 +447,7 @@ int fib_send(u16 command, struct fib * fibptr, unsigned long size,  int priority
 	 *	Map the fib into 32bits by using the fib number
 	 */
 
-//	hw_fib->header.SenderFibAddress = ((u32)(fibptr-dev->fibs)) << 1;
-	hw_fib->header.SenderFibAddress = cpu_to_le32((u32)(ulong)fibptr->hw_fib_pa);
+	hw_fib->header.SenderFibAddress = cpu_to_le32(((u32)(fibptr-dev->fibs)) << 1);
 	hw_fib->header.SenderData = (u32)(fibptr - dev->fibs);
 	/*
 	 *	Set FIB state to indicate where it came from and if we want a
@@ -492,7 +488,7 @@ int fib_send(u16 command, struct fib * fibptr, unsigned long size,  int priority
 	dprintk((KERN_DEBUG "  Command =               %d.\n", hw_fib->header.Command));
 	dprintk((KERN_DEBUG "  XferState  =            %x.\n", hw_fib->header.XferState));
 	dprintk((KERN_DEBUG "  hw_fib va being sent=%p\n",fibptr->hw_fib));
-	dprintk((KERN_DEBUG "  hw_fib pa being sent=%xl\n",(ulong)fibptr->hw_fib_pa));
+	dprintk((KERN_DEBUG "  hw_fib pa being sent=%lx\n",(ulong)fibptr->hw_fib_pa));
 	dprintk((KERN_DEBUG "  fib being sent=%p\n",fibptr));
 	/*
 	 *	Fill in the Callback and CallbackContext if we are not
@@ -806,8 +802,8 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
  
 int aac_command_thread(struct aac_dev * dev)
 {
-	struct hw_fib *hw_fib, *newfib;
-	struct fib fibptr; /* for error logging */
+	struct hw_fib *hw_fib, *hw_newfib;
+	struct fib *fib, *newfib;
 	struct aac_queue_block *queues = dev->queues;
 	struct aac_fib_context *fibctx;
 	unsigned long flags;
@@ -828,42 +824,44 @@ int aac_command_thread(struct aac_dev * dev)
 	 *	Let the DPC know it has a place to send the AIF's to.
 	 */
 	dev->aif_thread = 1;
-	memset(&fibptr, 0, sizeof(struct fib));
 	add_wait_queue(&queues->queue[HostNormCmdQueue].cmdready, &wait);
 	set_current_state(TASK_INTERRUPTIBLE);
 	while(1) 
 	{
 		spin_lock_irqsave(queues->queue[HostNormCmdQueue].lock, flags);
-		while(!aac_list_empty(&(queues->queue[HostNormCmdQueue].cmdq))) {
-			struct aac_list_head *entry;
+		while(!list_empty(&(queues->queue[HostNormCmdQueue].cmdq))) {
+			struct list_head *entry;
 			struct aac_aifcmd * aifcmd;
 
 			set_current_state(TASK_RUNNING);
 		
-			entry = (struct aac_list_head*)(ulong)(queues->queue[HostNormCmdQueue].cmdq.next);
-			dprintk(("aacraid: Command thread: removing fib from cmdq (%p)\n",entry));
-			aac_list_del(entry);
+			entry = queues->queue[HostNormCmdQueue].cmdq.next;
+			list_del(entry);
 			
 			spin_unlock_irqrestore(queues->queue[HostNormCmdQueue].lock, flags);
-			hw_fib = aac_list_entry(entry, struct hw_fib, header.FibLinks);
+			fib = list_entry(entry, struct fib, fiblink);
 			/*
 			 *	We will process the FIB here or pass it to a 
 			 *	worker thread that is TBD. We Really can't 
 			 *	do anything at this point since we don't have
 			 *	anything defined for this thread to do.
 			 */
-			memset(&fibptr, 0, sizeof(struct fib));
-			fibptr.type = FSAFS_NTC_FIB_CONTEXT;
-			fibptr.size = sizeof( struct fib );
-			fibptr.hw_fib = hw_fib;
-			fibptr.data = hw_fib->data;
-			fibptr.dev = dev;
+			hw_fib = fib->hw_fib;
+			memset(fib, 0, sizeof(struct fib));
+			fib->type = FSAFS_NTC_FIB_CONTEXT;
+			fib->size = sizeof( struct fib );
+			fib->hw_fib = hw_fib;
+			fib->data = hw_fib->data;
+			fib->dev = dev;
 			/*
 			 *	We only handle AifRequest fibs from the adapter.
 			 */
 			aifcmd = (struct aac_aifcmd *) hw_fib->data;
-			if (aifcmd->command == le16_to_cpu(AifCmdDriverNotify)) {
-				aac_handle_aif(dev, &fibptr);
+			if (aifcmd->command == cpu_to_le32(AifCmdDriverNotify)) {
+				/* Handle Driver Notify Events */
+				aac_handle_aif(dev, fib);
+				*(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
+				fib_adapter_complete(fib, sizeof(u32));
 			} else {
 				struct list_head *entry;
 				/* The u32 here is important and intended. We are using
@@ -872,6 +870,10 @@ int aac_command_thread(struct aac_dev * dev)
 				u32 time_now, time_last;
 				unsigned long flagv;
 				
+				/* Sniff events */
+				if (aifcmd->command == cpu_to_le32(AifCmdEventNotify))
+					aac_handle_aif(dev, fib);
+				
 				time_now = jiffies/HZ;
 
 				spin_lock_irqsave(&dev->fib_lock, flagv);
@@ -893,6 +895,11 @@ int aac_command_thread(struct aac_dev * dev)
 					 */
 					if (fibctx->count > 20)
 					{
+						/*
+						 * It's *not* jiffies folks,
+						 * but jiffies / HZ so do not
+						 * panic ...
+						 */
 						time_last = fibctx->jiffies;
 						/*
 						 * Has it been > 2 minutes 
@@ -909,17 +916,20 @@ int aac_command_thread(struct aac_dev * dev)
 					 * Warning: no sleep allowed while
 					 * holding spinlock
 					 */
-					newfib = kmalloc(sizeof(struct hw_fib), GFP_ATOMIC);
-					if (newfib) {
+					hw_newfib = kmalloc(sizeof(struct hw_fib), GFP_ATOMIC);
+					newfib = kmalloc(sizeof(struct fib), GFP_ATOMIC);
+					if (newfib && hw_newfib) {
 						/*
 						 * Make the copy of the FIB
 						 */
-						memcpy(newfib, hw_fib, sizeof(struct hw_fib));
+						memcpy(hw_newfib, hw_fib, sizeof(struct hw_fib));
+						memcpy(newfib, fib, sizeof(struct fib));
+						newfib->hw_fib = hw_newfib;
 						/*
 						 * Put the FIB onto the
 						 * fibctx's fibs
 						 */
-						aac_list_add_tail(&newfib->header.FibLinks, &fibctx->hw_fib_list);
+						list_add_tail(&newfib->fiblink, &fibctx->fib_list);
 						fibctx->count++;
 						/* 
 						 * Set the event to wake up the
@@ -928,6 +938,10 @@ int aac_command_thread(struct aac_dev * dev)
 						up(&fibctx->wait_sem);
 					} else {
 						printk(KERN_WARNING "aifd: didn't allocate NewFib.\n");
+						if(newfib)
+							kfree(newfib);
+						if(hw_newfib)
+							kfree(hw_newfib);
 					}
 					entry = entry->next;
 				}
@@ -935,10 +949,11 @@ int aac_command_thread(struct aac_dev * dev)
 				 *	Set the status of this FIB
 				 */
 				*(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
-				fib_adapter_complete(&fibptr, sizeof(u32));
+				fib_adapter_complete(fib, sizeof(u32));
 				spin_unlock_irqrestore(&dev->fib_lock, flagv);
 			}
 			spin_lock_irqsave(queues->queue[HostNormCmdQueue].lock, flags);
+			kfree(fib);
 		}
 		/*
 		 *	There are no more AIF's
diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c
index 3517d28cf..8480b427a 100644
--- a/drivers/scsi/aacraid/dpcsup.c
+++ b/drivers/scsi/aacraid/dpcsup.c
@@ -70,12 +70,12 @@ unsigned int aac_response_normal(struct aac_queue * q)
 	 */
 	while(aac_consumer_get(dev, q, &entry))
 	{
-		u32 fast ;
-		fast = (entry->addr & cpu_to_le32(0x01));
-		hwfib = (struct hw_fib *)((char *)dev->hw_fib_va + 
-				((entry->addr & ~0x01) - dev->hw_fib_pa));
-		fib = &dev->fibs[hwfib->header.SenderData];
-
+		int fast;
+		u32 index = le32_to_cpu(entry->addr);
+		fast = index & 0x01;
+		fib = &dev->fibs[index >> 1];
+		hwfib = fib->hw_fib;
+		
 		aac_consumer_free(dev, q, HostNormRespQueue);
 		/*
 		 *	Remove this fib from the Outstanding I/O queue.
@@ -169,29 +169,44 @@ unsigned int aac_command_normal(struct aac_queue *q)
 	 */
 	while(aac_consumer_get(dev, q, &entry))
 	{
+		struct fib fibctx;
 		struct hw_fib * hw_fib;
-		hw_fib = (struct hw_fib *)((char *)dev->hw_fib_va + 
-				((entry->addr & ~0x01) - dev->hw_fib_pa));
-
-		if (dev->aif_thread) {
-		        aac_list_add_tail(&hw_fib->header.FibLinks, &q->cmdq);
+		u32 index;
+		struct fib *fib = &fibctx;
+		
+		index = le32_to_cpu(entry->addr) / sizeof(struct hw_fib);
+		hw_fib = &dev->aif_base_va[index];
+		
+		/*
+		 *	Allocate a FIB at all costs. For non queued stuff
+		 *	we can just use the stack so we are happy. We need
+		 *	a fib object in order to manage the linked lists
+		 */
+		if (dev->aif_thread)
+			if((fib = kmalloc(sizeof(struct fib), GFP_ATOMIC)) == NULL)
+				fib = &fibctx;
+		
+		memset(fib, 0, sizeof(struct fib));
+		INIT_LIST_HEAD(&fib->fiblink);
+		fib->type = FSAFS_NTC_FIB_CONTEXT;
+		fib->size = sizeof(struct fib);
+		fib->hw_fib = hw_fib;
+		fib->data = hw_fib->data;
+		fib->dev = dev;
+		
+				
+		if (dev->aif_thread && fib != &fibctx) {
+		        list_add_tail(&fib->fiblink, &q->cmdq);
 	 	        aac_consumer_free(dev, q, HostNormCmdQueue);
 		        wake_up_interruptible(&q->cmdready);
 		} else {
-			struct fib fibctx;
 	 	        aac_consumer_free(dev, q, HostNormCmdQueue);
 			spin_unlock_irqrestore(q->lock, flags);
-			memset(&fibctx, 0, sizeof(struct fib));
-			fibctx.type = FSAFS_NTC_FIB_CONTEXT;
-			fibctx.size = sizeof(struct fib);
-			fibctx.hw_fib = hw_fib;
-			fibctx.data = hw_fib->data;
-			fibctx.dev = dev;
 			/*
 			 *	Set the status of this FIB
 			 */
 			*(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
-			fib_adapter_complete(&fibctx, sizeof(u32));
+			fib_adapter_complete(fib, sizeof(u32));
 			spin_lock_irqsave(q->lock, flags);
 		}		
 	}
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index c6ba9a821..8c4ceaeae 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -381,13 +381,15 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
 				}
 			}
 			spin_unlock_irqrestore(&dev->list_lock, flags);
+			if (active)
+				break;
 
-			/*
-			 * We can exit If all the commands are complete
-			 */
-			if (active == 0)
-				return SUCCESS;
 		}
+		/*
+		 * We can exit If all the commands are complete
+		 */
+		if (active == 0)
+			return SUCCESS;
 		spin_unlock_irq(host->host_lock);
 		scsi_sleep(HZ);
 		spin_lock_irq(host->host_lock);
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index c89f6d5e9..494d1fde2 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -419,6 +419,11 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 	 *	Start any kernel threads needed
 	 */
 	dev->thread_pid = kernel_thread((int (*)(void *))aac_command_thread, dev, 0);
+	if (dev->thread_pid < 0) {
+		printk(KERN_ERR "aacraid: Unable to create command thread.\n");
+		return -1;
+	}
+
 	/*
 	 *	Tell the adapter that all is configure, and it can start 
 	 *	accepting requests
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index dee898d6e..6a5291b65 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -240,8 +240,6 @@
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <linux/blkdev.h>
-#include "scsi.h"
-#include "hosts.h"
 #include <asm/system.h>
 #include <linux/errno.h>
 #include <linux/string.h>
@@ -259,6 +257,7 @@
 #include <scsi/scsicam.h>
 
 #include "scsi.h"
+#include "hosts.h"
 #include "aha152x.h"
 
 
@@ -578,11 +577,11 @@ struct aha152x_scdata {
 #define MSGO(i)			(HOSTDATA(shpnt)->msgo[i])
 #define MSGO_I			(HOSTDATA(shpnt)->msgo_i)
 #define MSGOLEN			(HOSTDATA(shpnt)->msgo_len)
-#define ADDMSGO(x)		(MSGOLEN<256 ? MSGO(MSGOLEN++)=x : aha152x_error(shpnt,"MSGO overflow"))
+#define ADDMSGO(x)		(MSGOLEN<256 ? (void)(MSGO(MSGOLEN++)=x) : aha152x_error(shpnt,"MSGO overflow"))
 
 #define MSGI(i)			(HOSTDATA(shpnt)->msgi[i])
 #define MSGILEN			(HOSTDATA(shpnt)->msgi_len)
-#define ADDMSGI(x)		(MSGILEN<256 ? MSGI(MSGILEN++)=x : aha152x_error(shpnt,"MSGI overflow"))
+#define ADDMSGI(x)		(MSGILEN<256 ? (void)(MSGI(MSGILEN++)=x) : aha152x_error(shpnt,"MSGI overflow"))
 
 #define DATA_LEN		(HOSTDATA(shpnt)->data_len)
 
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c
index 2eeed5ffe..54a09155e 100644
--- a/drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/drivers/scsi/aic7xxx/aic7770_osm.c
@@ -73,7 +73,7 @@ typedef void *aic7770_dev_t;
 static int aic7770_linux_config(struct aic7770_identity *entry,
 				aic7770_dev_t dev, u_int eisaBase);
 
-void
+int
 ahc_linux_eisa_init(void)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
@@ -82,7 +82,7 @@ ahc_linux_eisa_init(void)
 	int i;
 
 	if (aic7xxx_probe_eisa_vl == 0)
-		return;
+		return -ENODEV;
 
 	/*
 	 * Linux requires the EISA IDs to be specified in
@@ -93,7 +93,7 @@ ahc_linux_eisa_init(void)
 					 (ahc_num_aic7770_devs + 1),
 					 M_DEVBUF, M_NOWAIT);
 	if (aic7770_driver.id_table == NULL)
-		return;
+		return -ENOMEM;
 
 	for (eid = (struct eisa_device_id *)aic7770_driver.id_table,
 	     id = aic7770_ident_table, i = 0;
@@ -109,15 +109,16 @@ ahc_linux_eisa_init(void)
 	}
 	eid->sig[0] = 0;
 
-	eisa_driver_register(&aic7770_driver);
+	return eisa_driver_register(&aic7770_driver);
 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
 	struct aic7770_identity *entry;
 	u_int  slot;
 	u_int  eisaBase;
 	u_int  i;
+	int ret = -ENODEV;
 
 	if (aic7xxx_probe_eisa_vl == 0)
-		return;
+		return ret;
 
 	eisaBase = 0x1000 + AHC_EISA_SLOT_OFFSET;
 	for (slot = 1; slot < NUMSLOTS; eisaBase+=0x1000, slot++) {
@@ -146,24 +147,22 @@ ahc_linux_eisa_init(void)
 			continue;  /* no EISA card in slot */
 
 		entry = aic7770_find_device(eisa_id);
-		if (entry != NULL)
+		if (entry != NULL) {
 			aic7770_linux_config(entry, NULL, eisaBase);
+			ret = 0;
+		}
 	}
+	return ret;
 #endif
 }
 
 void
 ahc_linux_eisa_exit(void)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-	if (aic7xxx_probe_eisa_vl == 0)
-		return;
-
-	if (aic7770_driver.id_table != NULL) {
+	if(aic7xxx_probe_eisa_vl != 0 && aic7770_driver.id_table != NULL) {
 		eisa_driver_unregister(&aic7770_driver);
 		free(aic7770_driver.id_table, M_DEVBUF);
 	}
-#endif
 }
 
 static int
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 61790f769..68b4539a4 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2591,6 +2591,7 @@ ahd_linux_dv_thread(void *data)
 	sprintf(current->comm, "ahd_dv_%d", ahd->unit);
 #else
 	daemonize("ahd_dv_%d", ahd->unit);
+	current->flags |= PF_FREEZE;
 #endif
 	unlock_kernel();
 
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index a3e0d140c..0eb01bd3b 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -843,7 +843,8 @@ static int
 ahc_linux_detect(Scsi_Host_Template *template)
 {
 	struct	ahc_softc *ahc;
-	int     found;
+	int     found = 0;
+	int	eisa_err, pci_err;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	/*
@@ -891,28 +892,29 @@ ahc_linux_detect(Scsi_Host_Template *template)
 	 */
 	ahc_list_lockinit();
 
-#ifdef CONFIG_PCI
-	ahc_linux_pci_init();
-#endif
+	pci_err = ahc_linux_pci_init();
+	eisa_err = ahc_linux_eisa_init();
+
+	if(pci_err && eisa_err)
+		goto out;
 
-#ifdef CONFIG_EISA
-	ahc_linux_eisa_init();
-#endif
 
 	/*
 	 * Register with the SCSI layer all
 	 * controllers we've found.
 	 */
-	found = 0;
 	TAILQ_FOREACH(ahc, &ahc_tailq, links) {
 
 		if (ahc_linux_register_host(ahc, template) == 0)
 			found++;
 	}
+out:
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	spin_lock_irq(&io_request_lock);
 #endif
 	aic7xxx_detect_complete++;
+
 	return (found);
 }
 
@@ -1534,6 +1536,7 @@ ahc_softc_comp(struct ahc_softc *lahc, struct ahc_softc *rahc)
 
 	/* Still equal.  Sort by BIOS address, ioport, or bus/slot/func. */
 	switch (rvalue) {
+#ifdef CONFIG_PCI
 	case AHC_PCI:
 	{
 		char primary_channel;
@@ -1566,6 +1569,7 @@ ahc_softc_comp(struct ahc_softc *lahc, struct ahc_softc *rahc)
 			value = 1;
 		break;
 	}
+#endif
 	case AHC_EISA:
 		if ((rahc->flags & AHC_BIOS_ENABLED) != 0) {
 			value = rahc->platform_data->bios_address
@@ -2296,6 +2300,7 @@ ahc_linux_dv_thread(void *data)
 	sprintf(current->comm, "ahc_dv_%d", ahc->unit);
 #else
 	daemonize("ahc_dv_%d", ahc->unit);
+	current->flags |= PF_FREEZE;
 #endif
 	unlock_kernel();
 
@@ -3969,11 +3974,10 @@ ahc_linux_alloc_device(struct ahc_softc *ahc,
 }
 
 static void
-ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
+__ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
 {
 	struct ahc_linux_target *targ;
 
-	del_timer_sync(&dev->timer);
 	targ = dev->target;
 	targ->devices[dev->lun] = NULL;
 	free(dev, M_DEVBUF);
@@ -3983,6 +3987,13 @@ ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
 		ahc_linux_free_target(ahc, targ);
 }
 
+static void
+ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
+{
+	del_timer_sync(&dev->timer);
+	__ahc_linux_free_device(ahc, dev);
+}
+
 void
 ahc_send_async(struct ahc_softc *ahc, char channel,
 	       u_int target, u_int lun, ac_code code, void *arg)
@@ -4693,7 +4704,7 @@ ahc_linux_dev_timed_unfreeze(u_long arg)
 		ahc_linux_run_device_queue(ahc, dev);
 	if (TAILQ_EMPTY(&dev->busyq)
 	 && dev->active == 0)
-		ahc_linux_free_device(ahc, dev);
+		__ahc_linux_free_device(ahc, dev);
 	ahc_unlock(ahc, &s);
 }
 
@@ -5067,11 +5078,17 @@ ahc_platform_dump_card_state(struct ahc_softc *ahc)
 	}
 }
 
+static void ahc_linux_exit(void);
+
 static int __init
 ahc_linux_init(void)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-	return (ahc_linux_detect(&aic7xxx_driver_template) ? 0 : -ENODEV);
+	int rc = ahc_linux_detect(&aic7xxx_driver_template);
+	if (rc)
+		return rc;
+	ahc_linux_exit();
+	return -ENODEV;
 #else
 	scsi_register_module(MODULE_SCSI_HA, &aic7xxx_driver_template);
 	if (aic7xxx_driver_template.present == 0) {
@@ -5084,7 +5101,7 @@ ahc_linux_init(void)
 #endif
 }
 
-static void __exit
+static void
 ahc_linux_exit(void)
 {
 	struct ahc_softc *ahc;
@@ -5111,12 +5128,8 @@ ahc_linux_exit(void)
 	 */
 	scsi_unregister_module(MODULE_SCSI_HA, &aic7xxx_driver_template);
 #endif
-#ifdef CONFIG_PCI
 	ahc_linux_pci_exit();
-#endif
-#ifdef CONFIG_EISA
 	ahc_linux_eisa_exit();
-#endif
 }
 
 module_init(ahc_linux_init);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 12f040d03..4315120ce 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -840,11 +840,17 @@ typedef enum
 
 #ifdef CONFIG_EISA
 extern uint32_t aic7xxx_probe_eisa_vl;
-void			 ahc_linux_eisa_init(void);
+int			 ahc_linux_eisa_init(void);
 void			 ahc_linux_eisa_exit(void);
 int			 aic7770_map_registers(struct ahc_softc *ahc,
 					       u_int port);
 int			 aic7770_map_int(struct ahc_softc *ahc, u_int irq);
+#else
+static inline int	ahc_linux_eisa_init(void) {
+	return -ENODEV;
+}
+static inline void	ahc_linux_eisa_exit(void) {
+}
 #endif
 
 /******************************* PCI Routines *********************************/
@@ -932,6 +938,12 @@ ahc_get_pci_bus(ahc_dev_softc_t pci)
 {
 	return (pci->bus->number);
 }
+#else
+static inline int ahc_linux_pci_init(void) {
+	return -ENODEV;
+}
+static inline void ahc_linux_pci_exit(void) {
+}
 #endif
 
 static __inline void ahc_flush_device_writes(struct ahc_softc *);
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 993e2d690..66069115e 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -254,9 +254,6 @@
 
 #define AIC7XXX_C_VERSION  "5.2.6"
 
-#define NUMBER(arr)     (sizeof(arr) / sizeof(arr[0]))
-#define MIN(a,b)        (((a) < (b)) ? (a) : (b))
-#define MAX(a,b)        (((a) > (b)) ? (a) : (b))
 #define ALL_TARGETS -1
 #define ALL_CHANNELS -1
 #define ALL_LUNS -1
@@ -1376,7 +1373,7 @@ aic7xxx_setup(char *s)
 
   while ((p = strsep(&s, ",.")) != NULL)
   {
-    for (i = 0; i < NUMBER(options); i++)
+    for (i = 0; i < ARRAY_SIZE(options); i++)
     {
       n = strlen(options[i].name);
       if (!strncmp(options[i].name, p, n))
@@ -1423,7 +1420,7 @@ aic7xxx_setup(char *s)
                   else if (instance >= 0)
                     instance++;
                   if ( (device >= MAX_TARGETS) || 
-                       (instance >= NUMBER(aic7xxx_tag_info)) )
+                       (instance >= ARRAY_SIZE(aic7xxx_tag_info)) )
                     done = TRUE;
                   tok++;
                   if (!done)
@@ -1447,7 +1444,7 @@ aic7xxx_setup(char *s)
                     }
                   }
                   if ( (instance >= 0) && (device >= 0) &&
-                       (instance < NUMBER(aic7xxx_tag_info)) &&
+                       (instance < ARRAY_SIZE(aic7xxx_tag_info)) &&
                        (device < MAX_TARGETS) )
                     aic7xxx_tag_info[instance].tag_commands[device] =
                       simple_strtoul(tok, NULL, 0) & 0xff;
@@ -1658,7 +1655,7 @@ aic7xxx_download_instr(struct aic7xxx_host *p, int instrptr,
         {
           int end_addr;
 
-          end_addr = MIN(address, skip_addr);
+          end_addr = min_t(int, address, skip_addr);
           address_offset += end_addr - i;
           i = skip_addr;
         }
@@ -1884,7 +1881,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned int *period,
       if(!(p->features & AHC_ULTRA3))
       {
         *options = 0;
-        maxsync = MAX(maxsync, AHC_SYNCRATE_ULTRA2);
+        maxsync = max_t(unsigned int, maxsync, AHC_SYNCRATE_ULTRA2);
       }
       break;
     case MSG_EXT_PPR_OPTION_DT_CRC_QUICK:
@@ -1892,7 +1889,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned int *period,
       if(!(p->features & AHC_ULTRA3))
       {
         *options = 0;
-        maxsync = MAX(maxsync, AHC_SYNCRATE_ULTRA2);
+        maxsync = max_t(unsigned int, maxsync, AHC_SYNCRATE_ULTRA2);
       }
       else
       {
@@ -1916,7 +1913,7 @@ aic7xxx_find_syncrate(struct aic7xxx_host *p, unsigned int *period,
       break;
     default:
       *options = 0;
-      maxsync = MAX(maxsync, AHC_SYNCRATE_ULTRA2);
+      maxsync = max_t(unsigned int, maxsync, AHC_SYNCRATE_ULTRA2);
       break;
   }
   syncrate = &aic7xxx_syncrates[maxsync];
@@ -2057,7 +2054,7 @@ aic7xxx_validate_offset(struct aic7xxx_host *p,
     else
       maxoffset = MAX_OFFSET_8BIT;
   }
-  *offset = MIN(*offset, maxoffset);
+  *offset = min(*offset, maxoffset);
 }
 
 /*+F*************************************************************************
@@ -2570,7 +2567,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
         break;
       }
     }
-    scb_count = MIN( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs);
+    scb_count = min( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs);
     scb_ap = (struct aic7xxx_scb *)kmalloc(sizeof (struct aic7xxx_scb) * scb_count
 					   + sizeof(struct aic7xxx_scb_dma), GFP_ATOMIC);
     if (scb_ap == NULL)
@@ -5042,7 +5039,7 @@ aic7xxx_parse_msg(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
             if(p->user[tindex].offset)
             {
               aic_dev->needsdtr_copy = 1;
-              aic_dev->goal.period = MAX(10,p->user[tindex].period);
+              aic_dev->goal.period = max_t(unsigned char, 10,p->user[tindex].period);
               if(p->features & AHC_ULTRA2)
               {
                 aic_dev->goal.offset = MAX_OFFSET_ULTRA2;
@@ -5086,8 +5083,8 @@ aic7xxx_parse_msg(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
            * the device isn't allowed to send values greater than the ones
            * we first sent to it.
            */
-          new_period = MAX(period, aic_dev->goal.period);
-          new_offset = MIN(offset, aic_dev->goal.offset);
+          new_period = max_t(unsigned int, period, aic_dev->goal.period);
+          new_offset = min_t(unsigned int, offset, aic_dev->goal.offset);
         }
  
         /*
@@ -5208,7 +5205,7 @@ aic7xxx_parse_msg(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
             if(p->user[tindex].offset)
             {
               aic_dev->needsdtr_copy = 1;
-              aic_dev->goal.period = MAX(10,p->user[tindex].period);
+              aic_dev->goal.period = max_t(unsigned char, 10, p->user[tindex].period);
               if(p->features & AHC_ULTRA2)
               {
                 aic_dev->goal.offset = MAX_OFFSET_ULTRA2;
@@ -6413,7 +6410,7 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
     unsigned char errno = aic_inb(p, ERROR);
 
     printk(KERN_ERR "(scsi%d) BRKADRINT error(0x%x):\n", p->host_no, errno);
-    for (i = 0; i < NUMBER(hard_error); i++)
+    for (i = 0; i < ARRAY_SIZE(hard_error); i++)
     {
       if (errno & hard_error[i].errno)
       {
@@ -6562,7 +6559,7 @@ aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev)
       else
       {
         aic_dev->needsdtr = aic_dev->needsdtr_copy = 1;
-        aic_dev->goal.period = MAX(10, aic_dev->goal.period);
+        aic_dev->goal.period = max_t(unsigned char, 10, aic_dev->goal.period);
         aic_dev->goal.options = 0;
       }
     }
@@ -6673,7 +6670,7 @@ aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device)
     }
     else
     {
-      if (p->instance >= NUMBER(aic7xxx_tag_info))
+      if (p->instance >= ARRAY_SIZE(aic7xxx_tag_info))
       {
         static int print_warning = TRUE;
         if(print_warning)
@@ -6850,7 +6847,7 @@ aic7xxx_probe(int slot, int base, ahc_flag_type *flags)
     buf[i] = inb(base + i);
   }
 
-  for (i = 0; i < NUMBER(AIC7xxx); i++)
+  for (i = 0; i < ARRAY_SIZE(AIC7xxx); i++)
   {
     /*
      * Signature match on enabled card?
@@ -9199,7 +9196,7 @@ aic7xxx_detect(Scsi_Host_Template *template)
     unsigned int  devconfig, i, oldverbose;
     struct pci_dev *pdev = NULL;
 
-    for (i = 0; i < NUMBER(aic_pdevs); i++)
+    for (i = 0; i < ARRAY_SIZE(aic_pdevs); i++)
     {
       pdev = NULL;
       while ((pdev = pci_find_device(aic_pdevs[i].vendor_id,
@@ -9678,7 +9675,9 @@ aic7xxx_detect(Scsi_Host_Template *template)
           found++;
 	  continue;
 skip_pci_controller:
+#ifdef CONFIG_PCI
 	  pci_release_regions(temp_p->pdev);
+#endif
 	  kfree(temp_p);
         }  /* Found an Adaptec PCI device. */
         else /* Well, we found one, but we couldn't get any memory */
@@ -9698,7 +9697,7 @@ skip_pci_controller:
    * EISA/VL-bus card signature probe.
    */
   slot = MINSLOT;
-  while ( (slot <= MAXSLOT) && 
+  while ( (slot <= MAXSLOT) &&
          !(aic7xxx_no_probe) )
   {
     base = SLOTBASE(slot) + MINREG;
@@ -10097,7 +10096,7 @@ skip_pci_controller:
       int i;
       
       left = found;
-      for (i=0; i<NUMBER(sort_list); i++)
+      for (i=0; i<ARRAY_SIZE(sort_list); i++)
       {
         temp_p = sort_list[i];
         while(temp_p != NULL)
@@ -10970,8 +10969,10 @@ aic7xxx_release(struct Scsi_Host *host)
 #endif /* MMAPIO */
   if(!p->pdev)
     release_region(p->base, MAXREG - MINREG);
+#ifdef CONFIG_PCI
   else
     pci_release_regions(p->pdev);
+#endif
   prev = NULL;
   next = first_aic7xxx;
   while(next != NULL)
diff --git a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
index 0ef48071b..78d16aa73 100644
--- a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
+++ b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
@@ -319,13 +319,13 @@ aic7xxx_proc_info ( struct Scsi_Host *HBAptr, char *buffer, char **start, off_t
         aic_dev->r_total+aic_dev->w_total, aic_dev->r_total, aic_dev->w_total);
     size += sprintf(BLS, "%s\n", HDRB);
     size += sprintf(BLS, "   Reads:");
-    for (i = 0; i < NUMBER(aic_dev->r_bins); i++)
+    for (i = 0; i < ARRAY_SIZE(aic_dev->r_bins); i++)
     {
       size += sprintf(BLS, " %10ld", aic_dev->r_bins[i]);
     }
     size += sprintf(BLS, "\n");
     size += sprintf(BLS, "  Writes:");
-    for (i = 0; i < NUMBER(aic_dev->w_bins); i++)
+    for (i = 0; i < ARRAY_SIZE(aic_dev->w_bins); i++)
     {
       size += sprintf(BLS, " %10ld", aic_dev->w_bins[i]);
     }
@@ -347,7 +347,7 @@ aic7xxx_proc_info ( struct Scsi_Host *HBAptr, char *buffer, char **start, off_t
   else
   {
     *start = buffer;
-    length = MIN(length, size - offset);
+    length = min_t(int, length, size - offset);
     memcpy(buffer, &aic7xxx_buffer[offset], length);
   }
 
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index d26ee0322..a6588b0f8 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -2,6 +2,10 @@
 
     ata_piix.c - Intel PATA/SATA controllers
 
+    Maintained by:  Jeff Garzik <jgarzik@pobox.com>
+    		    Please ALWAYS copy linux-ide@vger.kernel.org
+		    on emails.
+
 
 	Copyright 2003-2004 Red Hat Inc
 	Copyright 2003-2004 Jeff Garzik
@@ -24,7 +28,7 @@
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #define DRV_NAME	"ata_piix"
@@ -132,6 +136,7 @@ static struct ata_port_operations piix_pata_ops = {
 
 	.phy_reset		= piix_pata_phy_reset,
 
+	.bmdma_setup		= ata_bmdma_setup_pio,
 	.bmdma_start		= ata_bmdma_start_pio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
@@ -154,6 +159,7 @@ static struct ata_port_operations piix_sata_ops = {
 
 	.phy_reset		= piix_sata_phy_reset,
 
+	.bmdma_setup		= ata_bmdma_setup_pio,
 	.bmdma_start		= ata_bmdma_start_pio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
@@ -266,7 +272,7 @@ static void piix_pata_phy_reset(struct ata_port *ap)
 
 /**
  *	piix_sata_probe - Probe PCI device for present SATA devices
- *	@pdev: PCI device to probe
+ *	@ap: Port associated with the PCI device we wish to probe
  *
  *	Reads SATA PCI device's PCI config register Port Configuration
  *	and Status (PCS) to determine port and device availability.
@@ -418,16 +424,15 @@ static void piix_set_udmamode (struct ata_port *ap, struct ata_device *adev,
 	int w_flag		= 0x10 << drive_dn;
 	int u_speed		= 0;
 	int			sitre;
-	u16			reg4042, reg44, reg48, reg4a, reg54;
-	u8			reg55;
+	u16			reg4042, reg4a;
+	u8			reg48, reg54, reg55;
 
 	pci_read_config_word(dev, maslave, &reg4042);
 	DPRINTK("reg4042 = 0x%04x\n", reg4042);
 	sitre = (reg4042 & 0x4000) ? 1 : 0;
-	pci_read_config_word(dev, 0x44, &reg44);
-	pci_read_config_word(dev, 0x48, &reg48);
+	pci_read_config_byte(dev, 0x48, &reg48);
 	pci_read_config_word(dev, 0x4a, &reg4a);
-	pci_read_config_word(dev, 0x54, &reg54);
+	pci_read_config_byte(dev, 0x54, &reg54);
 	pci_read_config_byte(dev, 0x55, &reg55);
 
 	switch(speed) {
@@ -444,23 +449,19 @@ static void piix_set_udmamode (struct ata_port *ap, struct ata_device *adev,
 	}
 
 	if (!(reg48 & u_flag))
-		pci_write_config_word(dev, 0x48, reg48|u_flag);
+		pci_write_config_byte(dev, 0x48, reg48 | u_flag);
 	if (speed == XFER_UDMA_5) {
 		pci_write_config_byte(dev, 0x55, (u8) reg55|w_flag);
 	} else {
 		pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
 	}
-	if (!(reg4a & u_speed)) {
-		pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
-		pci_write_config_word(dev, 0x4a, reg4a|u_speed);
-	}
+	if ((reg4a & a_speed) != u_speed)
+		pci_write_config_word(dev, 0x4a, (reg4a & ~a_speed) | u_speed);
 	if (speed > XFER_UDMA_2) {
-		if (!(reg54 & v_flag)) {
-			pci_write_config_word(dev, 0x54, reg54|v_flag);
-		}
-	} else {
-		pci_write_config_word(dev, 0x54, reg54 & ~v_flag);
-	}
+		if (!(reg54 & v_flag))
+			pci_write_config_byte(dev, 0x54, reg54 | v_flag);
+	} else
+		pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
 }
 
 /* move to PCI layer, integrate w/ MSI stuff */
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 5737a9d1f..bd7315824 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -4,6 +4,7 @@
  *  Copyright (C) 1997	Wu Ching Chen
  *  2.1.x update (C) 1998  Krzysztof G. Baranowski
  *  2.5.x update (C) 2002  Red Hat <alan@redhat.com>
+ *  2.6.x update (C) 2004  Red Hat <alan@redhat.com>
  *
  * Marcelo Tosatti <marcelo@conectiva.com.br> : SMP fixes
  *
@@ -126,9 +127,11 @@ stop_dma:
 			/*
 			 *      Issue more commands
 			 */
+			spin_lock_irqsave(dev->host->host_lock, flags);
 			if (((dev->quhdu != dev->quendu) || (dev->last_cmd != 0xff)) && (dev->in_snd == 0)) {
 				send_s870(host);
 			}
+			spin_unlock_irqrestore(dev->host->host_lock, flags);
 			/*
 			 *      Done
 			 */
@@ -371,9 +374,11 @@ go_42:
 			/*
 			 *      If there is stuff to send and nothing going then send it
 			 */
+			spin_lock_irqsave(dev->host->host_lock, flags);
 			if (((dev->last_cmd != 0xff) || (dev->quhdu != dev->quendu)) && (dev->in_snd == 0)) {
 				send_s870(host);
 			}
+			spin_unlock_irqrestore(dev->host->host_lock, flags);
 			dev->in_int = 0;
 			goto out;
 		}
@@ -443,9 +448,16 @@ out:
 	return IRQ_HANDLED;
 }
 
+/**
+ *	atp870u_queuecommand	-	Queue SCSI command
+ *	@req_p: request block
+ *	@done: completion function
+ *
+ *	Queue a command to the ATP queue. Called with the host lock held.
+ */
+ 
 static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *))
 {
-	unsigned long flags;
 	unsigned short int m;
 	unsigned int tmport;
 	struct Scsi_Host *host;
@@ -484,7 +496,6 @@ static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *))
 	 *      Count new command
 	 */
 
-	spin_lock_irqsave(host->host_lock, flags);
 	dev->quendu++;
 	if (dev->quendu >= qcnt) {
 		dev->quendu = 0;
@@ -498,24 +509,31 @@ static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *))
 		}
 		dev->quendu--;
 		req_p->result = 0x00020000;
-		spin_unlock_irqrestore(host->host_lock, flags);
 		done(req_p);
 		return 0;
 	}
 	dev->querequ[dev->quendu] = req_p;
 	tmport = dev->ioport + 0x1c;
-	spin_unlock_irqrestore(host->host_lock, flags);
 	if ((inb(tmport) == 0) && (dev->in_int == 0) && (dev->in_snd == 0)) {
 		send_s870(host);
 	}
 	return 0;
 }
 
+/**
+ *	send_s870	-	send a command to the controller
+ *	@host: host
+ *
+ *	On entry there is work queued to be done. We move some of that work to the
+ *	controller itself. 
+ *
+ *	Caller holds the host lock.
+ */
+ 
 static void send_s870(struct Scsi_Host *host)
 {
 	unsigned int tmport;
 	Scsi_Cmnd *workrequ;
-	unsigned long flags;
 	unsigned int i;
 	unsigned char j, target_id;
 	unsigned char *prd;
@@ -527,10 +545,7 @@ static void send_s870(struct Scsi_Host *host)
 	struct atp_unit *dev = (struct atp_unit *)&host->hostdata;
 	int sg_count;
 
-	spin_lock_irqsave(host->host_lock, flags);
-	
 	if (dev->in_snd != 0) {
-		spin_unlock_irqrestore(host->host_lock, flags);
 		return;
 	}
 	dev->in_snd = 1;
@@ -543,13 +558,11 @@ static void send_s870(struct Scsi_Host *host)
 		dev->last_cmd = 0xff;
 		if (dev->quhdu == dev->quendu) {
 			dev->in_snd = 0;
-			spin_unlock_irqrestore(dev->host->host_lock, flags);
 			return;
 		}
 	}
 	if ((dev->last_cmd != 0xff) && (dev->working != 0)) {
 		dev->in_snd = 0;
-		spin_unlock_irqrestore(dev->host->host_lock, flags);
 		return;
 	}
 	dev->working++;
@@ -567,7 +580,6 @@ static void send_s870(struct Scsi_Host *host)
 	dev->quhdu = j;
 	dev->working--;
 	dev->in_snd = 0;
-	spin_unlock_irqrestore(host->host_lock, flags);
 	return;
 cmd_subp:
 	workportu = dev->ioport;
@@ -582,7 +594,6 @@ cmd_subp:
 abortsnd:
 	dev->last_cmd |= 0x40;
 	dev->in_snd = 0;
-	spin_unlock_irqrestore(dev->host->host_lock, flags);
 	return;
 oktosend:
 	memcpy(&dev->ata_cdbu[0], &workrequ->cmnd[0], workrequ->cmd_len);
@@ -684,7 +695,6 @@ oktosend:
 			dev->last_cmd |= 0x40;
 		}
 		dev->in_snd = 0;
-		spin_unlock_irqrestore(host->host_lock, flags);
 		return;
 	}
 	tmpcip = dev->pciport;
@@ -770,7 +780,6 @@ oktosend:
 			dev->last_cmd |= 0x40;
 		}
 		dev->in_snd = 0;
-		spin_unlock_irqrestore(host->host_lock, flags);
 		return;
 	}
 	if (inb(tmport) == 0) {
@@ -781,9 +790,6 @@ oktosend:
 		dev->last_cmd |= 0x40;
 	}
 	dev->in_snd = 0;
-	spin_unlock_irqrestore(host->host_lock, flags);
-	return;
-
 }
 
 static unsigned char fun_scam(struct atp_unit *dev, unsigned short int *val)
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index b0179426f..e777bb078 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -31,6 +31,8 @@ static const char unknown[] = "UNKNOWN";
 #endif
 #define CONSTANTS (CONST_COMMAND | CONST_STATUS | CONST_SENSE | CONST_XSENSE \
 		   | CONST_CMND | CONST_MSG | CONST_HOST | CONST_DRIVER)
+#else
+#define CONSTANTS 0
 #endif
 
 #if (CONSTANTS & CONST_COMMAND)
diff --git a/drivers/scsi/cpqfcTScontrol.c b/drivers/scsi/cpqfcTScontrol.c
index 2c195eee6..9855a8587 100644
--- a/drivers/scsi/cpqfcTScontrol.c
+++ b/drivers/scsi/cpqfcTScontrol.c
@@ -607,6 +607,7 @@ static int PeekIMQEntry( PTACHYON fcChip, ULONG type)
         if( (fcChip->IMQ->QEntry[CI].type & 0x1FF) == 0x104 )
         { 
           TachFCHDR_GCMND* fchs;
+#error This is too much stack
           ULONG ulFibreFrame[2048/4];  // max DWORDS in incoming FC Frame
 	  USHORT SFQpi = (USHORT)(fcChip->IMQ->QEntry[CI].word[0] & 0x0fffL);
 
@@ -718,6 +719,7 @@ int CpqTsProcessIMQEntry(void *host)
   ULONG x_ID;
   ULONG ulBuff, dwStatus;
   TachFCHDR_GCMND* fchs;
+#error This is too much stack
   ULONG ulFibreFrame[2048/4];  // max number of DWORDS in incoming Fibre Frame
   UCHAR ucInboundMessageType;  // Inbound CM, dword 3 "type" field
 
diff --git a/drivers/scsi/dc390.h b/drivers/scsi/dc390.h
index 44c9a7625..76fd8b12a 100644
--- a/drivers/scsi/dc390.h
+++ b/drivers/scsi/dc390.h
@@ -19,7 +19,7 @@
 #endif
 
 #define DC390_BANNER "Tekram DC390/AM53C974"
-#define DC390_VERSION "2.0f 2000-12-20"
+#define DC390_VERSION "2.1b 2004-04-13"
 
 /* We don't have eh_abort_handler, eh_device_reset_handler, 
  * eh_bus_reset_handler, eh_host_reset_handler yet! 
@@ -33,11 +33,11 @@
 # define USE_NEW_EH
 #endif
 
-extern int DC390_detect(Scsi_Host_Template *psht);
-extern int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
-extern int DC390_abort(Scsi_Cmnd *cmd);
-extern int DC390_reset(Scsi_Cmnd *cmd);
-extern int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev,
+static int DC390_detect(Scsi_Host_Template *psht);
+static int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
+static int DC390_abort(Scsi_Cmnd *cmd);
+static int DC390_reset(Scsi_Cmnd *cmd);
+static int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev,
 		sector_t capacity, int geom[]);
 
 static int DC390_release(struct Scsi_Host *);
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 66a41f52a..261836da2 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -20,17 +20,21 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
+/***************************************************************************
+ * Sat Dec 20 2003 Go Taniguchi <go@turbolinux.co.jp>
+ - Support 2.6 kernel and DMA-mapping
+ - ioctl fix for raid tools
+ - use schedule_timeout in long long loop
+ **************************************************************************/
 
-//#define DEBUG 1
-//#define UARTDELAY 1
+/*#define DEBUG 1 */
+/*#define UARTDELAY 1 */
 
-// On the real kernel ADDR32 should always be zero for 2.4. GFP_HIGH allocates
-// high pages. Keep the macro around because of the broken unmerged ia64 tree
+/* On the real kernel ADDR32 should always be zero for 2.4. GFP_HIGH allocates
+   high pages. Keep the macro around because of the broken unmerged ia64 tree */
 
 #define ADDR32 (0)
 
-#error Please convert me to Documentation/DMA-mapping.txt
-
 #include <linux/version.h>
 #include <linux/module.h>
 
@@ -53,12 +57,12 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
 #include <linux/kernel.h>	/* for printk */
 #include <linux/sched.h>
 #include <linux/reboot.h>
+#include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 
 #include <linux/timer.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
-#include <linux/stat.h>
 
 #include <asm/processor.h>	/* for boot_cpu_data */
 #include <asm/pgtable.h>
@@ -86,7 +90,7 @@ static dpt_sig_S DPTI_sig = {
 #elif defined(__alpha__)
 	PROC_ALPHA ,
 #else
-	(-1),(-1)
+	(-1),(-1),
 #endif
 	 FT_HBADRVR, 0, OEM_DPT, OS_LINUX, CAP_OVERLAP, DEV_ALL,
 	ADF_ALL_SC5, 0, 0, DPT_VERSION, DPT_REVISION, DPT_SUBREVISION,
@@ -227,7 +231,7 @@ rebuild_sys_tab:
 	/* Active IOPs now in OPERATIONAL state */
 	PDEBUG("HBA's in OPERATIONAL state\n");
 
-	printk(KERN_INFO"dpti: If you have a lot of devices this could take a few minutes.\n");
+	printk("dpti: If you have a lot of devices this could take a few minutes.\n");
 	for (pHba = hba_chain; pHba; pHba = pHba->next) {
 		printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name);
 		if (adpt_i2o_lct_get(pHba) < 0){
@@ -270,6 +274,7 @@ static int adpt_release(struct Scsi_Host *host)
 	adpt_hba* pHba = (adpt_hba*) host->hostdata[0];
 //	adpt_i2o_quiesce_hba(pHba);
 	adpt_i2o_delete_hba(pHba);
+	scsi_unregister(host);
 	return 0;
 }
 
@@ -340,6 +345,8 @@ static void adpt_inquiry(adpt_hba* pHba)
 	if (rcode != 0) {
 		sprintf(pHba->detail, "Adaptec I2O RAID");
 		printk(KERN_INFO "%s: Inquiry Error (%d)\n",pHba->name,rcode);
+		if (rcode != -ETIME && rcode != -EINTR)
+			kfree(buf);
 	} else {
 		memset(pHba->detail, 0, sizeof(pHba->detail));
 		memcpy(&(pHba->detail), "Vendor: Adaptec ", 16);
@@ -348,8 +355,8 @@ static void adpt_inquiry(adpt_hba* pHba)
 		memcpy(&(pHba->detail[40]), " FW: ", 4);
 		memcpy(&(pHba->detail[44]), (u8*) &buf[32], 4);
 		pHba->detail[48] = '\0';	/* precautionary */
+		kfree(buf);
 	}
-	kfree(buf);
 	adpt_i2o_status_get(pHba);
 	return ;
 }
@@ -431,7 +438,7 @@ static int adpt_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
 			cmd->scsi_done(cmd);
 			return 0;
 		}
-		(struct adpt_device*)(cmd->device->hostdata) = pDev;
+		cmd->device->hostdata = pDev;
 	}
 	pDev->pScsi_dev = cmd->device;
 
@@ -479,7 +486,7 @@ static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev,
 		heads = 255;
 		sectors = 63;
 	}
-	cylinders = capacity / (heads * sectors);
+	cylinders = sector_div(capacity, heads * sectors);
 
 	// Special case if CDROM
 	if(sdev->type == 5) {  // CDROM
@@ -872,6 +879,9 @@ static int adpt_install_hba(Scsi_Host_Template* sht, struct pci_dev* pDev)
 		return -EINVAL;
 	}
 	pci_set_master(pDev);
+	if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) &&
+	    pci_set_dma_mask(pDev, 0xffffffffULL))
+		return -EINVAL;
 
 	base_addr0_phys = pci_resource_start(pDev,0);
 	hba_map0_area_size = pci_resource_len(pDev,0);
@@ -964,6 +974,7 @@ static int adpt_install_hba(Scsi_Host_Template* sht, struct pci_dev* pDev)
 
 	// Initializing the spinlocks
 	spin_lock_init(&pHba->state_lock);
+	spin_lock_init(&adpt_post_wait_lock);
 
 	if(raptorFlag == 0){
 		printk(KERN_INFO"Adaptec I2O RAID controller %d at %lx size=%x irq=%d\n", 
@@ -1065,7 +1076,7 @@ static int adpt_init(void)
 {
 	int i;
 
-	printk(KERN_INFO"Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
+	printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
 	for (i = 0; i < DPTI_MAX_HBA; i++) {
 		hbas[i] = NULL;
 	}
@@ -1153,12 +1164,22 @@ static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout)
 	timeout *= HZ;
 	if((status = adpt_i2o_post_this(pHba, msg, len)) == 0){
 		set_current_state(TASK_INTERRUPTIBLE);
-		spin_unlock_irq(pHba->host->host_lock);
+		if(pHba->host)
+			spin_unlock_irq(pHba->host->host_lock);
 		if (!timeout)
 			schedule();
-		else
+		else{
+			timeout = schedule_timeout(timeout);
+			if (timeout == 0) {
+				// I/O issued, but cannot get result in
+				// specified time. Freeing resorces is
+				// dangerous.
+				status = -ETIME;
+			}
 			schedule_timeout(timeout*HZ);
-		spin_lock_irq(pHba->host->host_lock);
+		}
+		if(pHba->host)
+			spin_lock_irq(pHba->host->host_lock);
 	}
 	spin_lock_irq(&adpt_wq_i2o_post.lock);
 	__remove_wait_queue(&adpt_wq_i2o_post, &wait);
@@ -1210,6 +1231,8 @@ static s32 adpt_i2o_post_this(adpt_hba* pHba, u32* data, int len)
 			printk(KERN_WARNING"dpti%d: Timeout waiting for message frame!\n", pHba->unit);
 			return -ETIMEDOUT;
 		}
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	} while(m == EMPTY_QUEUE);
 		
 	msg = (u32*) (pHba->msg_addr_virt + m);
@@ -1284,6 +1307,8 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
 			printk(KERN_WARNING"Timeout waiting for message!\n");
 			return -ETIMEDOUT;
 		}
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	} while (m == EMPTY_QUEUE);
 
 	status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32);
@@ -1315,6 +1340,8 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
 			return -ETIMEDOUT;
 		}
 		rmb();
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	}
 
 	if(*status == 0x01 /*I2O_EXEC_IOP_RESET_IN_PROGRESS*/) {
@@ -1331,6 +1358,8 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
 				printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name);
 				return -ETIMEDOUT;
 			}
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			schedule_timeout(1);
 		} while (m == EMPTY_QUEUE);
 		// Flush the offset
 		adpt_send_nop(pHba, m);
@@ -1696,15 +1725,20 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 	}
 
 	do {
-		spin_lock_irqsave(pHba->host->host_lock, flags);
+		if(pHba->host)
+			spin_lock_irqsave(pHba->host->host_lock, flags);
 		// This state stops any new commands from enterring the
 		// controller while processing the ioctl
 //		pHba->state |= DPTI_STATE_IOCTL;
 //		We can't set this now - The scsi subsystem sets host_blocked and
 //		the queue empties and stops.  We need a way to restart the queue
 		rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER);
+		if (rcode != 0)
+			printk("adpt_i2o_passthru: post wait failed %d %p\n",
+					rcode, reply);
 //		pHba->state &= ~DPTI_STATE_IOCTL;
-		spin_unlock_irqrestore(pHba->host->host_lock, flags);
+		if(pHba->host)
+			spin_unlock_irqrestore(pHba->host->host_lock, flags);
 	} while(rcode == -ETIMEDOUT);  
 
 	if(rcode){
@@ -1765,10 +1799,12 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 
 
 cleanup:
-	kfree (reply);
+	if (rcode != -ETIME && rcode != -EINTR)
+		kfree (reply);
 	while(sg_index) {
 		if(sg_list[--sg_index]) {
-			kfree((void*)(sg_list[sg_index]));
+			if (rcode != -ETIME && rcode != -EINTR)
+				kfree((void*)(sg_list[sg_index]));
 		}
 	}
 	return rcode;
@@ -1876,7 +1912,7 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 	int minor;
 	int error = 0;
 	adpt_hba* pHba;
-	ulong flags;
+	ulong flags = 0;
 
 	minor = iminor(inode);
 	if (minor >= DPTI_MAX_HBA){
@@ -1942,9 +1978,11 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 		break;
 		}
 	case I2ORESETCMD:
-		spin_lock_irqsave(pHba->host->host_lock, flags);
+		if(pHba->host)
+			spin_lock_irqsave(pHba->host->host_lock, flags);
 		adpt_hba_reset(pHba);
-		spin_unlock_irqrestore(pHba->host->host_lock, flags);
+		if(pHba->host)
+			spin_unlock_irqrestore(pHba->host->host_lock, flags);
 		break;
 	case I2ORESCANCMD:
 		adpt_rescan(pHba);
@@ -1957,7 +1995,7 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 }
 
 
-static void adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	Scsi_Cmnd* cmd;
 	adpt_hba* pHba = dev_id;
@@ -1966,12 +2004,15 @@ static void adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
 	u32 status=0;
 	u32 context;
 	ulong flags = 0;
+	int handled = 0;
 
-	if (pHba == NULL ){
+	if (pHba == NULL){
 		printk(KERN_WARNING"adpt_isr: NULL dev_id\n");
-		return;
+		return IRQ_NONE;
 	}
-	spin_lock_irqsave(pHba->host->host_lock, flags);
+	if(pHba->host)
+		spin_lock_irqsave(pHba->host->host_lock, flags);
+
 	while( readl(pHba->irq_mask) & I2O_INTERRUPT_PENDING_B) {
 		m = readl(pHba->reply_port);
 		if(m == EMPTY_QUEUE){
@@ -2036,7 +2077,10 @@ static void adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
 		wmb();
 		rmb();
 	}
-out:	spin_unlock_irqrestore(pHba->host->host_lock, flags);
+	handled = 1;
+out:	if(pHba->host)
+		spin_unlock_irqrestore(pHba->host->host_lock, flags);
+	return IRQ_RETVAL(handled);
 }
 
 static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device* d)
@@ -2111,15 +2155,19 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device*
 	/* Now fill in the SGList and command */
 	if(cmd->use_sg) {
 		struct scatterlist *sg = (struct scatterlist *)cmd->request_buffer;
+		int sg_count = pci_map_sg(pHba->pDev, sg, cmd->use_sg,
+                        scsi_to_pci_dma_dir(cmd->sc_data_direction));
+
+
 		len = 0;
-		for(i = 0 ; i < cmd->use_sg; i++) {
-			*mptr++ = direction|0x10000000|sg->length;
-			len+=sg->length;
-			*mptr++ = virt_to_bus(sg->address);
+		for(i = 0 ; i < sg_count; i++) {
+			*mptr++ = direction|0x10000000|sg_dma_len(sg);
+			len+=sg_dma_len(sg);
+			*mptr++ = sg_dma_address(sg);
 			sg++;
 		}
 		/* Make this an end of list */
-		mptr[-2] = direction|0xD0000000|(sg-1)->length;
+		mptr[-2] = direction|0xD0000000|sg_dma_len(sg-1);
 		reqlen = mptr - msg;
 		*lenptr = len;
 		
@@ -2133,7 +2181,10 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device*
 			reqlen = 12;
 		} else {
 			*mptr++ = 0xD0000000|direction|cmd->request_bufflen;
-			*mptr++ = virt_to_bus(cmd->request_buffer);
+			*mptr++ = pci_map_single(pHba->pDev,
+				cmd->request_buffer,
+				cmd->request_bufflen,
+				scsi_to_pci_dma_dir(cmd->sc_data_direction));
 		}
 	}
 	
@@ -2158,7 +2209,7 @@ static s32 adpt_scsi_register(adpt_hba* pHba,Scsi_Host_Template * sht)
 		printk ("%s: scsi_register returned NULL\n",pHba->name);
 		return -1;
 	}
-	(adpt_hba*)(host->hostdata[0]) = pHba;
+	host->hostdata[0] = (unsigned long)pHba;
 	pHba->host = host;
 
 	host->irq = pHba->pDev->irq;
@@ -2306,15 +2357,17 @@ static s32 adpt_i2o_to_scsi(ulong reply, Scsi_Cmnd* cmd)
 static s32 adpt_rescan(adpt_hba* pHba)
 {
 	s32 rcode;
-	ulong flags;
+	ulong flags = 0;
 
-	spin_lock_irqsave(pHba->host->host_lock, flags);
+	if(pHba->host)
+		spin_lock_irqsave(pHba->host->host_lock, flags);
 	if ((rcode=adpt_i2o_lct_get(pHba)) < 0)
 		goto out;
 	if ((rcode=adpt_i2o_reparse_lct(pHba)) < 0)
 		goto out;
 	rcode = 0;
-out:	spin_unlock_irqrestore(pHba->host->host_lock, flags);
+out:	if(pHba->host)
+		spin_unlock_irqrestore(pHba->host->host_lock, flags);
 	return rcode;
 }
 
@@ -2596,6 +2649,8 @@ static s32 adpt_send_nop(adpt_hba*pHba,u32 m)
 			printk(KERN_ERR "%s: Timeout waiting for message frame!\n",pHba->name);
 			return 2;
 		}
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	}
 	msg = (u32*)(pHba->msg_addr_virt + m);
 	writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]);
@@ -2629,6 +2684,8 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
 			printk(KERN_WARNING"%s: Timeout waiting for message frame\n",pHba->name);
 			return -ETIMEDOUT;
 		}
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	} while(m == EMPTY_QUEUE);
 
 	msg=(u32 *)(pHba->msg_addr_virt+m);
@@ -2664,9 +2721,10 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
 		rmb();
 		if(time_after(jiffies,timeout)){
 			printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);
-			kfree((void*)status);
 			return -ETIMEDOUT;
 		}
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	} while (1);
 
 	// If the command was successful, fill the fifo with our reply
@@ -2744,6 +2802,8 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
 					pHba->name);
 			return -ETIMEDOUT;
 		}
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	} while(m==EMPTY_QUEUE);
 
 	
@@ -2770,6 +2830,8 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
 			return -ETIMEDOUT;
 		}
 		rmb();
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
 	}
 
 	// Set up our number of outbound and inbound messages
@@ -3095,17 +3157,33 @@ static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid,
 			int group, int field, void *buf, int buflen)
 {
 	u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field };
-	u8  resblk[8+buflen]; /* 8 bytes for header */
+	u8 *resblk;
+
 	int size;
 
+	/* 8 bytes for header */
+	resblk = kmalloc(sizeof(u8) * (8+buflen), GFP_KERNEL|ADDR32);
+	if (resblk == NULL) {
+		printk(KERN_CRIT "%s: query scalar failed; Out of memory.\n", pHba->name);
+		return -ENOMEM;
+	}
+
 	if (field == -1)  		/* whole group */
 			opblk[4] = -1;
 
 	size = adpt_i2o_issue_params(I2O_CMD_UTIL_PARAMS_GET, pHba, tid, 
-		opblk, sizeof(opblk), resblk, sizeof(resblk));
+		opblk, sizeof(opblk), resblk, sizeof(u8)*(8+buflen));
+	if (size == -ETIME) {
+		printk(KERN_WARNING "%s: issue params failed; Timed out.\n", pHba->name);
+		return -ETIME;
+	} else if (size == -EINTR) {
+		printk(KERN_WARNING "%s: issue params failed; Interrupted.\n", pHba->name);
+		return -EINTR;
+	}
 			
 	memcpy(buf, resblk+8, buflen);  /* cut off header */
 
+	kfree(resblk);
 	if (size < 0)
 		return size;	
 
@@ -3139,6 +3217,7 @@ static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid,
 	msg[8] = virt_to_bus(resblk);
 
 	if ((wait_status = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 20))) {
+		printk("adpt_i2o_issue_params: post_wait failed (%p)\n", resblk);
    		return wait_status; 	/* -DetailedStatus */
 	}
 
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index 942bccebb..7f3c028a9 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -65,7 +65,7 @@ static int adpt_device_reset(Scsi_Cmnd* cmd);
 #include "dpt/dpti_i2o.h"
 #include "dpt/dpti_ioctl.h"
 
-#define DPT_I2O_VERSION "2.4 Build 5"
+#define DPT_I2O_VERSION "2.4 Build 5go"
 #define DPT_VERSION     2
 #define DPT_REVISION    '4'
 #define DPT_SUBREVISION '5'
@@ -272,7 +272,7 @@ struct sg_simple_element {
 static void adpt_i2o_sys_shutdown(void);
 static int adpt_init(void);
 static int adpt_i2o_build_sys_table(void);
-static void adpt_isr(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs);
 #ifdef REBOOT_NOTIFIER
 static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p);
 #endif
diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c
index 3bbfba072..782c31bec 100644
--- a/drivers/scsi/esp.c
+++ b/drivers/scsi/esp.c
@@ -25,9 +25,8 @@
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
 
-#include "scsi.h"
-#include "hosts.h"
 #include "esp.h"
 
 #include <asm/sbus.h>
@@ -38,13 +37,17 @@
 #include <asm/oplib.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-
 #ifndef __sparc_v9__
 #include <asm/machines.h>
 #include <asm/idprom.h>
 #endif
 
-#include <linux/module.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
 
 #define DEBUG_ESP
 /* #define DEBUG_ESP_HME */
@@ -366,7 +369,7 @@ static char *phase_string(int phase)
 }
 
 #ifdef DEBUG_STATE_MACHINE
-static inline void esp_advance_phase(Scsi_Cmnd *s, int newphase)
+static inline void esp_advance_phase(struct scsi_cmnd *s, int newphase)
 {
 	ESPLOG(("<%s>", phase_string(newphase)));
 	s->SCp.sent_command = s->SCp.phase;
@@ -419,48 +422,48 @@ static inline void esp_cmd(struct esp *esp, u8 cmd)
  * Note that these are per-ESP queues, not global queues like
  * the aha152x driver uses.
  */
-static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
+static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
 {
-	Scsi_Cmnd *end;
+	struct scsi_cmnd *end;
 
 	new_SC->host_scribble = (unsigned char *) NULL;
 	if (!*SC)
 		*SC = new_SC;
 	else {
-		for (end=*SC;end->host_scribble;end=(Scsi_Cmnd *)end->host_scribble)
+		for (end=*SC;end->host_scribble;end=(struct scsi_cmnd *)end->host_scribble)
 			;
 		end->host_scribble = (unsigned char *) new_SC;
 	}
 }
 
-static inline void prepend_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
+static inline void prepend_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
 {
 	new_SC->host_scribble = (unsigned char *) *SC;
 	*SC = new_SC;
 }
 
-static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd **SC)
+static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd **SC)
 {
-	Scsi_Cmnd *ptr;
+	struct scsi_cmnd *ptr;
 	ptr = *SC;
 	if (ptr)
-		*SC = (Scsi_Cmnd *) (*SC)->host_scribble;
+		*SC = (struct scsi_cmnd *) (*SC)->host_scribble;
 	return ptr;
 }
 
-static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
+static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC, int target, int lun)
 {
-	Scsi_Cmnd *ptr, *prev;
+	struct scsi_cmnd *ptr, *prev;
 
 	for (ptr = *SC, prev = NULL;
 	     ptr && ((ptr->device->id != target) || (ptr->device->lun != lun));
-	     prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble)
+	     prev = ptr, ptr = (struct scsi_cmnd *) ptr->host_scribble)
 		;
 	if (ptr) {
 		if (prev)
 			prev->host_scribble=ptr->host_scribble;
 		else
-			*SC=(Scsi_Cmnd *)ptr->host_scribble;
+			*SC=(struct scsi_cmnd *)ptr->host_scribble;
 	}
 	return ptr;
 }
@@ -1062,7 +1065,7 @@ static void __init esp_init_swstate(struct esp *esp)
 	esp->prev_hme_dmacsr = 0xffffffff;
 }
 
-static int __init detect_one_esp(Scsi_Host_Template *tpnt, struct sbus_dev *esp_dev,
+static int __init detect_one_esp(struct scsi_host_template *tpnt, struct sbus_dev *esp_dev,
 				 struct sbus_dev *espdma, struct sbus_bus *sbus,
 				 int id, int hme)
 {
@@ -1137,7 +1140,7 @@ fail_unlink:
 
 #include <asm/sun4paddr.h>
 
-static int __init esp_detect(Scsi_Host_Template *tpnt)
+static int __init esp_detect(struct scsi_host_template *tpnt)
 {
 	static struct sbus_dev esp_dev;
 	int esps_in_use = 0;
@@ -1162,7 +1165,7 @@ static int __init esp_detect(Scsi_Host_Template *tpnt)
 
 #else /* !CONFIG_SUN4 */
 
-static int __init esp_detect(Scsi_Host_Template *tpnt)
+static int __init esp_detect(struct scsi_host_template *tpnt)
 {
 	struct sbus_bus *sbus;
 	struct sbus_dev *esp_dev, *sbdev_iter;
@@ -1428,7 +1431,7 @@ static int esp_proc_info(struct Scsi_Host *host, char *buffer, char **start, off
 	return esp_host_info(esp, buffer, offset, length);
 }
 
-static void esp_get_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
+static void esp_get_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
 {
 	if (sp->use_sg == 0) {
 		sp->SCp.this_residual = sp->request_bufflen;
@@ -1437,7 +1440,7 @@ static void esp_get_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
 		if (sp->request_bufflen) {
 			sp->SCp.have_data_in = sbus_map_single(esp->sdev, sp->SCp.buffer,
 							       sp->SCp.this_residual,
-							       scsi_to_sbus_dma_dir(sp->sc_data_direction));
+							       sp->sc_data_direction);
 			sp->SCp.ptr = (char *) ((unsigned long)sp->SCp.have_data_in);
 		} else {
 			sp->SCp.ptr = NULL;
@@ -1447,26 +1450,26 @@ static void esp_get_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
 		sp->SCp.buffers_residual = sbus_map_sg(esp->sdev,
 						       sp->SCp.buffer,
 						       sp->use_sg,
-						       scsi_to_sbus_dma_dir(sp->sc_data_direction));
+						       sp->sc_data_direction);
 		sp->SCp.this_residual = sg_dma_len(sp->SCp.buffer);
 		sp->SCp.ptr = (char *) ((unsigned long)sg_dma_address(sp->SCp.buffer));
 	}
 }
 
-static void esp_release_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
+static void esp_release_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
 {
 	if (sp->use_sg) {
 		sbus_unmap_sg(esp->sdev, sp->buffer, sp->use_sg,
-			      scsi_to_sbus_dma_dir(sp->sc_data_direction));
+			      sp->sc_data_direction);
 	} else if (sp->request_bufflen) {
 		sbus_unmap_single(esp->sdev,
 				  sp->SCp.have_data_in,
 				  sp->request_bufflen,
-				  scsi_to_sbus_dma_dir(sp->sc_data_direction));
+				  sp->sc_data_direction);
 	}
 }
 
-static void esp_restore_pointers(struct esp *esp, Scsi_Cmnd *sp)
+static void esp_restore_pointers(struct esp *esp, struct scsi_cmnd *sp)
 {
 	struct esp_pointers *ep = &esp->data_pointers[sp->device->id];
 
@@ -1476,7 +1479,7 @@ static void esp_restore_pointers(struct esp *esp, Scsi_Cmnd *sp)
 	sp->SCp.buffers_residual = ep->saved_buffers_residual;
 }
 
-static void esp_save_pointers(struct esp *esp, Scsi_Cmnd *sp)
+static void esp_save_pointers(struct esp *esp, struct scsi_cmnd *sp)
 {
 	struct esp_pointers *ep = &esp->data_pointers[sp->device->id];
 
@@ -1506,7 +1509,7 @@ static void esp_save_pointers(struct esp *esp, Scsi_Cmnd *sp)
  * case where we could see an interrupt is where we have disconnected
  * commands active and they are trying to reselect us.
  */
-static inline void esp_check_cmd(struct esp *esp, Scsi_Cmnd *sp)
+static inline void esp_check_cmd(struct esp *esp, struct scsi_cmnd *sp)
 {
 	switch (sp->cmd_len) {
 	case 6:
@@ -1557,8 +1560,8 @@ static inline void build_wide_nego_msg(struct esp *esp, int size)
 
 static void esp_exec_cmd(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr;
-	Scsi_Device *SDptr;
+	struct scsi_cmnd *SCptr;
+	struct scsi_device *SDptr;
 	struct esp_device *esp_dev;
 	volatile u8 *cmdp = esp->esp_command;
 	u8 the_esp_command;
@@ -1834,7 +1837,7 @@ after_nego_msg_built:
 }
 
 /* Queue a SCSI command delivered from the mid-level Linux SCSI code. */
-static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
+static int esp_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
 {
 	struct esp *esp;
 
@@ -1871,7 +1874,7 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 }
 
 /* Dump driver state. */
-static void esp_dump_cmd(Scsi_Cmnd *SCptr)
+static void esp_dump_cmd(struct scsi_cmnd *SCptr)
 {
 	ESPLOG(("[tgt<%02x> lun<%02x> "
 		"pphase<%s> cphase<%s>]",
@@ -1882,7 +1885,7 @@ static void esp_dump_cmd(Scsi_Cmnd *SCptr)
 
 static void esp_dump_state(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 #ifdef DEBUG_ESP_CMDS
 	int i;
 #endif
@@ -1921,13 +1924,13 @@ static void esp_dump_state(struct esp *esp)
 	ESPLOG(("esp%d: disconnected ", esp->esp_id));
 	while (SCptr) {
 		esp_dump_cmd(SCptr);
-		SCptr = (Scsi_Cmnd *) SCptr->host_scribble;
+		SCptr = (struct scsi_cmnd *) SCptr->host_scribble;
 	}
 	ESPLOG(("\n"));
 }
 
 /* Abort a command.  The host_lock is acquired by caller. */
-static int esp_abort(Scsi_Cmnd *SCptr)
+static int esp_abort(struct scsi_cmnd *SCptr)
 {
 	struct esp *esp = (struct esp *) SCptr->device->host->hostdata;
 	int don;
@@ -1957,14 +1960,14 @@ static int esp_abort(Scsi_Cmnd *SCptr)
 		ESP_INTSOFF(esp->dregs);
 	}
 	if (esp->issue_SC) {
-		Scsi_Cmnd **prev, *this;
+		struct scsi_cmnd **prev, *this;
 		for (prev = (&esp->issue_SC), this = esp->issue_SC;
 		     this != NULL;
-		     prev = (Scsi_Cmnd **) &(this->host_scribble),
-			     this = (Scsi_Cmnd *) this->host_scribble) {
+		     prev = (struct scsi_cmnd **) &(this->host_scribble),
+			     this = (struct scsi_cmnd *) this->host_scribble) {
 
 			if (this == SCptr) {
-				*prev = (Scsi_Cmnd *) this->host_scribble;
+				*prev = (struct scsi_cmnd *) this->host_scribble;
 				this->host_scribble = NULL;
 
 				esp_release_dmabufs(esp, this);
@@ -2010,7 +2013,7 @@ static int esp_abort(Scsi_Cmnd *SCptr)
  */
 static int esp_finish_reset(struct esp *esp)
 {
-	Scsi_Cmnd *sp = esp->current_SC;
+	struct scsi_cmnd *sp = esp->current_SC;
 
 	/* Clean up currently executing command, if any. */
 	if (sp != NULL) {
@@ -2059,7 +2062,7 @@ static int esp_do_resetbus(struct esp *esp)
  *
  * The host_lock is acquired by caller.
  */
-static int esp_reset(Scsi_Cmnd *SCptr)
+static int esp_reset(struct scsi_cmnd *SCptr)
 {
 	struct esp *esp = (struct esp *) SCptr->device->host->hostdata;
 
@@ -2077,7 +2080,7 @@ static int esp_reset(Scsi_Cmnd *SCptr)
 /* Internal ESP done function. */
 static void esp_done(struct esp *esp, int error)
 {
-	Scsi_Cmnd *done_SC = esp->current_SC;
+	struct scsi_cmnd *done_SC = esp->current_SC;
 
 	esp->current_SC = NULL;
 
@@ -2168,7 +2171,7 @@ static inline void hme_fifo_push(struct esp *esp, u8 *bytes, u8 count)
 /* We try to avoid some interrupts by jumping ahead and see if the ESP
  * has gotten far enough yet.  Hence the following.
  */
-static inline int skipahead1(struct esp *esp, Scsi_Cmnd *scp,
+static inline int skipahead1(struct esp *esp, struct scsi_cmnd *scp,
 			     int prev_phase, int new_phase)
 {
 	if (scp->SCp.sent_command != prev_phase)
@@ -2202,7 +2205,7 @@ static inline int skipahead1(struct esp *esp, Scsi_Cmnd *scp,
 	return do_intr_end;
 }
 
-static inline int skipahead2(struct esp *esp, Scsi_Cmnd *scp,
+static inline int skipahead2(struct esp *esp, struct scsi_cmnd *scp,
 			     int prev_phase1, int prev_phase2, int new_phase)
 {
 	if (scp->SCp.sent_command != prev_phase1 &&
@@ -2318,7 +2321,7 @@ static inline void dma_flashclear(struct esp *esp)
 	dma_invalidate(esp);
 }
 
-static int dma_can_transfer(struct esp *esp, Scsi_Cmnd *sp)
+static int dma_can_transfer(struct esp *esp, struct scsi_cmnd *sp)
 {
 	__u32 base, end, sz;
 
@@ -2379,7 +2382,7 @@ static int dma_can_transfer(struct esp *esp, Scsi_Cmnd *sp)
  * tell the ESP to eat the extraneous byte so that we can proceed
  * to the next phase.
  */
-static int esp100_sync_hwbug(struct esp *esp, Scsi_Cmnd *sp, int fifocnt)
+static int esp100_sync_hwbug(struct esp *esp, struct scsi_cmnd *sp, int fifocnt)
 {
 	/* Do not touch this piece of code. */
 	if ((!(esp->erev == esp100)) ||
@@ -2479,7 +2482,7 @@ static inline int reconnect_lun(struct esp *esp)
 /* This puts the driver in a state where it can revitalize a command that
  * is being continued due to reselection.
  */
-static inline void esp_connect(struct esp *esp, Scsi_Cmnd *sp)
+static inline void esp_connect(struct esp *esp, struct scsi_cmnd *sp)
 {
 	struct esp_device *esp_dev = sp->device->hostdata;
 
@@ -2502,7 +2505,7 @@ static inline void esp_connect(struct esp *esp, Scsi_Cmnd *sp)
 /* This will place the current working command back into the issue queue
  * if we are to receive a reselection amidst a selection attempt.
  */
-static inline void esp_reconnect(struct esp *esp, Scsi_Cmnd *sp)
+static inline void esp_reconnect(struct esp *esp, struct scsi_cmnd *sp)
 {
 	if (!esp->disconnected_SC)
 		ESPLOG(("esp%d: Weird, being reselected but disconnected "
@@ -2540,7 +2543,7 @@ static inline int esp_bytes_sent(struct esp *esp, int fifo_count)
 	return rval - fifo_count;
 }
 
-static inline void advance_sg(Scsi_Cmnd *sp)
+static inline void advance_sg(struct scsi_cmnd *sp)
 {
 	++sp->SCp.buffer;
 	--sp->SCp.buffers_residual;
@@ -2568,7 +2571,7 @@ static inline void advance_sg(Scsi_Cmnd *sp)
  */
 static int esp_do_data(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	int thisphase, hmuch;
 
 	ESPDATA(("esp_do_data: "));
@@ -2619,7 +2622,7 @@ static int esp_do_data(struct esp *esp)
 /* See how successful the data transfer was. */
 static int esp_do_data_finale(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	struct esp_device *esp_dev = SCptr->device->hostdata;
 	int bogus_data = 0, bytes_sent = 0, fifocnt, ecount = 0;
 
@@ -2800,7 +2803,7 @@ static int esp_do_data_finale(struct esp *esp)
  * a tape, we don't want to go into a loop re-negotiating
  * synchronous capabilities over and over.
  */
-static int esp_should_clear_sync(Scsi_Cmnd *sp)
+static int esp_should_clear_sync(struct scsi_cmnd *sp)
 {
 	u8 cmd1 = sp->cmnd[0];
 	u8 cmd2 = sp->data_cmnd[0];
@@ -2834,7 +2837,7 @@ static int esp_should_clear_sync(Scsi_Cmnd *sp)
  */
 static int esp_do_freebus(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	struct esp_device *esp_dev = SCptr->device->hostdata;
 	int rval;
 
@@ -2905,7 +2908,7 @@ static int esp_do_freebus(struct esp *esp)
  */
 static int esp_bad_reconnect(struct esp *esp)
 {
-	Scsi_Cmnd *sp;
+	struct scsi_cmnd *sp;
 
 	ESPLOG(("esp%d: Eieeee, reconnecting unknown command!\n",
 		esp->esp_id));
@@ -2914,7 +2917,7 @@ static int esp_bad_reconnect(struct esp *esp)
 	ESPLOG(("esp%d: issue_SC[", esp->esp_id));
 	while (sp) {
 		ESPLOG(("<%02x,%02x>", sp->device->id, sp->device->lun));
-		sp = (Scsi_Cmnd *) sp->host_scribble;
+		sp = (struct scsi_cmnd *) sp->host_scribble;
 	}
 	ESPLOG(("]\n"));
 	sp = esp->current_SC;
@@ -2928,7 +2931,7 @@ static int esp_bad_reconnect(struct esp *esp)
 	ESPLOG(("esp%d: disconnected_SC[", esp->esp_id));
 	while (sp) {
 		ESPLOG(("<%02x,%02x>", sp->device->id, sp->device->lun));
-		sp = (Scsi_Cmnd *) sp->host_scribble;
+		sp = (struct scsi_cmnd *) sp->host_scribble;
 	}
 	ESPLOG(("]\n"));
 	return do_reset_bus;
@@ -2938,7 +2941,7 @@ static int esp_bad_reconnect(struct esp *esp)
 static int esp_do_reconnect(struct esp *esp)
 {
 	int lun, target;
-	Scsi_Cmnd *SCptr;
+	struct scsi_cmnd *SCptr;
 
 	/* Check for all bogus conditions first. */
 	target = reconnect_target(esp);
@@ -2988,7 +2991,7 @@ static int esp_do_reconnect(struct esp *esp)
  */
 static int esp_do_status(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	int intr, rval;
 
 	rval = skipahead1(esp, SCptr, in_the_dark, in_status);
@@ -3133,7 +3136,7 @@ static int esp_enter_status(struct esp *esp)
 
 static int esp_disconnect_amidst_phases(struct esp *esp)
 {
-	Scsi_Cmnd *sp = esp->current_SC;
+	struct scsi_cmnd *sp = esp->current_SC;
 	struct esp_device *esp_dev = sp->device->hostdata;
 
 	/* This means real problems if we see this
@@ -3226,7 +3229,7 @@ static int esp_do_phase_determine(struct esp *esp)
 /* First interrupt after exec'ing a cmd comes here. */
 static int esp_select_complete(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	struct esp_device *esp_dev = SCptr->device->hostdata;
 	int cmd_bytes_sent, fcnt;
 
@@ -3582,7 +3585,7 @@ static int check_singlebyte_msg(struct esp *esp)
  * this because so many initiators cannot cope with this occurring.
  */
 static int target_with_ants_in_pants(struct esp *esp,
-				     Scsi_Cmnd *SCptr,
+				     struct scsi_cmnd *SCptr,
 				     struct esp_device *esp_dev)
 {
 	if (esp_dev->sync || SCptr->device->borken) {
@@ -3641,7 +3644,7 @@ static void sync_report(struct esp *esp)
 
 static int check_multibyte_msg(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	struct esp_device *esp_dev = SCptr->device->hostdata;
 	u8 regval = 0;
 	int message_out = 0;
@@ -3822,7 +3825,7 @@ finish:
 
 static int esp_do_msgindone(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	int message_out = 0, it = 0, rval;
 
 	rval = skipahead1(esp, SCptr, in_msgin, in_msgindone);
@@ -3904,7 +3907,7 @@ static int esp_do_msgindone(struct esp *esp)
 
 static int esp_do_cmdbegin(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 
 	esp_advance_phase(SCptr, in_cmdend);
 	if (esp->erev == fashme) {
@@ -4125,7 +4128,7 @@ static espfunc_t bus_vector[] = {
 /* This is the second tier in our dual-level SCSI state machine. */
 static int esp_work_bus(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr = esp->current_SC;
+	struct scsi_cmnd *SCptr = esp->current_SC;
 	unsigned int phase;
 
 	ESPBUS(("esp_work_bus: "));
@@ -4153,7 +4156,7 @@ static espfunc_t isvc_vector[] = {
 /* Main interrupt handler for an esp adapter. */
 static void esp_handle(struct esp *esp)
 {
-	Scsi_Cmnd *SCptr;
+	struct scsi_cmnd *SCptr;
 	int what_next = do_intr_end;
 
 	SCptr = esp->current_SC;
@@ -4353,7 +4356,7 @@ static irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
 	return IRQ_HANDLED;
 }
 
-static int esp_slave_alloc(Scsi_Device *SDptr)
+static int esp_slave_alloc(struct scsi_device *SDptr)
 {
 	struct esp_device *esp_dev =
 		kmalloc(sizeof(struct esp_device), GFP_ATOMIC);
@@ -4365,7 +4368,7 @@ static int esp_slave_alloc(Scsi_Device *SDptr)
 	return 0;
 }
 
-static void esp_slave_destroy(Scsi_Device *SDptr)
+static void esp_slave_destroy(struct scsi_device *SDptr)
 {
 	struct esp *esp = (struct esp *) SDptr->host->hostdata;
 
@@ -4374,7 +4377,7 @@ static void esp_slave_destroy(Scsi_Device *SDptr)
 	SDptr->hostdata = NULL;
 }
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
 	.proc_name		= "esp",
 	.proc_info		= esp_proc_info,
 	.name			= "Sun ESP 100/100a/200",
diff --git a/drivers/scsi/esp.h b/drivers/scsi/esp.h
index df6d41a09..85beb4750 100644
--- a/drivers/scsi/esp.h
+++ b/drivers/scsi/esp.h
@@ -8,8 +8,6 @@
 #ifndef _SPARC_ESP_H
 #define _SPARC_ESP_H
 
-#include <linux/config.h>
-
 /* For dvma controller register definitions. */
 #include <asm/dma.h>
 
@@ -75,6 +73,8 @@ struct esp_device {
   unsigned disconnect:1;
 };
 
+struct scsi_cmnd;
+
 /* We get one of these for each ESP probed. */
 struct esp {
 	unsigned long		eregs;		/* ESP controller registers */
@@ -181,9 +181,9 @@ struct esp {
 	int			bursts;		/* Burst sizes our DVMA supports */
 
 	/* Our command queues, only one cmd lives in the current_SC queue. */
-	Scsi_Cmnd		*issue_SC;	/* Commands to be issued */
-	Scsi_Cmnd		*current_SC;	/* Who is currently working the bus */
-	Scsi_Cmnd		*disconnected_SC;/* Commands disconnected from the bus */
+	struct scsi_cmnd	*issue_SC;	/* Commands to be issued */
+	struct scsi_cmnd	*current_SC;	/* Who is currently working the bus */
+	struct scsi_cmnd	*disconnected_SC;/* Commands disconnected from the bus */
 
 	/* Message goo */
 	u8			cur_msgout[16];
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 71e66844c..78b3a5120 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -4,9 +4,9 @@
  * Intel Corporation:  Storage RAID Controllers                         *
  *                                                                      *
  * gdth.c                                                               *
- * Copyright (C) 1995-03 ICP vortex GmbH, Achim Leubner                 *
- * Copyright (C) 2002-03 Intel Corporation                              *
- * Copyright (C) 2003    Adaptec Inc.                                   *
+ * Copyright (C) 1995-04 ICP vortex GmbH, Achim Leubner                 *
+ * Copyright (C) 2002-04 Intel Corporation                              *
+ * Copyright (C) 2003-04 Adaptec Inc.                                   *
  * <achim_leubner@adaptec.com>                                          *
  *                                                                      *
  * Additions/Fixes:                                                     *
@@ -27,9 +27,42 @@
  * along with this kernel; if not, write to the Free Software           *
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            *
  *                                                                      *
- * Tested with Linux 1.2.13, ..., 2.2.20, ..., 2.4.22                   *
+ * Linux kernel 2.2.x, 2.4.x, 2.6.x supported                           *
  *                                                                      *
  * $Log: gdth.c,v $
+ * Revision 1.73  2004/03/31 13:33:03  achim
+ * Special command 0xfd implemented to detect 64-bit DMA support
+ *
+ * Revision 1.72  2004/03/17 08:56:04  achim
+ * 64-bit DMA only enabled if FW >= x.43
+ *
+ * Revision 1.71  2004/03/05 15:51:29  achim
+ * Screen service: separate message buffer, bugfixes
+ *
+ * Revision 1.70  2004/02/27 12:19:07  achim
+ * Bugfix: Reset bit in config (0xfe) call removed
+ *
+ * Revision 1.69  2004/02/20 09:50:24  achim
+ * Compatibility changes for kernels < 2.4.20
+ * Bugfix screen service command size
+ * pci_set_dma_mask() error handling added
+ *
+ * Revision 1.68  2004/02/19 15:46:54  achim
+ * 64-bit DMA bugfixes
+ * Drive size bugfix for drives > 1TB
+ *
+ * Revision 1.67  2004/01/14 13:11:57  achim
+ * Tool access over /proc no longer supported
+ * Bugfixes IOCTLs
+ *
+ * Revision 1.66  2003/12/19 15:04:06  achim
+ * Bugfixes support for drives > 2TB
+ *
+ * Revision 1.65  2003/12/15 11:21:56  achim
+ * 64-bit DMA support added
+ * Support for drives > 2 TB implemented
+ * Kernels 2.2.x, 2.4.x, 2.6.x supported
+ *
  * Revision 1.64  2003/09/17 08:30:26  achim
  * EISA/ISA controller scan disabled
  * Command line switch probe_eisa_isa added
@@ -299,10 +332,12 @@
  * shared_access:N              enable driver reserve/release protocol
  * probe_eisa_isa:Y             scan for EISA/ISA controllers
  * probe_eisa_isa:N             do not scan for EISA/ISA controllers
+ * force_dma32:Y                use only 32 bit DMA mode
+ * force_dma32:N                use 64 bit DMA mode, if supported
  *
  * The default values are: "gdth=disable:N,reserve_mode:1,reverse_scan:N,
  *                          max_ids:127,rescan:N,virt_ctr:N,hdr_channel:0,
- *                          shared_access:Y,probe_eisa_isa:N".
+ *                          shared_access:Y,probe_eisa_isa:N,force_dma32:N".
  * Here is another example: "gdth=reserve_list:0,1,2,0,0,1,3,0,rescan:Y".
  * 
  * When loading the gdth driver as a module, the same options are available. 
@@ -313,7 +348,7 @@
  * 
  * Default: "modprobe gdth disable=0 reserve_mode=1 reverse_scan=0
  *           max_ids=127 rescan=0 virt_ctr=0 hdr_channel=0 shared_access=0 
- *           probe_eisa_isa=0"
+ *           probe_eisa_isa=0 force_dma32=0"
  * The other example: "modprobe gdth reserve_list=0,1,2,0,0,1,3,0 rescan=1".
  */
 
@@ -330,9 +365,12 @@
  * phase:                   Service/parameter/return code special command
  */
 
-/* default: activate /proc and character device IOCTL interface */
-#define GDTH_IOCTL_PROC
-#define GDTH_IOCTL_CHRDEV
+
+/* interrupt coalescing */
+/* #define INT_COAL */
+
+/* statistics */
+#define GDTH_STATISTICS
 
 #include <linux/module.h>
 
@@ -353,35 +391,35 @@
 #ifdef GDTH_RTC
 #include <linux/mc146818rtc.h>
 #endif
-#if LINUX_VERSION_CODE >= 0x020100
 #include <linux/reboot.h>
-#else
-#include <linux/bios32.h>
-#endif
 
 #include <asm/dma.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#if LINUX_VERSION_CODE >= 0x020322
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 #include <linux/spinlock.h>
-#elif LINUX_VERSION_CODE >= 0x02015F
+#else
 #include <asm/spinlock.h>
 #endif
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 #include <linux/blkdev.h>
-
-#include "scsi.h"
-#include "hosts.h"
-#if LINUX_VERSION_CODE < 0x020503
+#else
+#include <linux/blk.h>
 #include "sd.h"
 #endif
 
+#include "scsi.h"
+#include "hosts.h"
 #include "gdth.h"
 
 static void gdth_delay(int milliseconds);
-static void gdth_eval_mapping(ulong32 size, int *cyls, int *heads, int *secs);
+static void gdth_eval_mapping(ulong32 size, ulong32 *cyls, int *heads, int *secs);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static irqreturn_t gdth_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+#else
+static void gdth_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+#endif
 static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp);
 static int gdth_async_event(int hanum);
 static void gdth_log_event(gdth_evt_data *dvr, char *buffer);
@@ -419,31 +457,19 @@ static int gdth_get_cmd_index(int hanum);
 static void gdth_release_event(int hanum);
 static int gdth_wait(int hanum,int index,ulong32 time);
 static int gdth_internal_cmd(int hanum,unchar service,ushort opcode,ulong32 p1,
-                             ulong32 p2,ulong32 p3);
+                             ulong64 p2,ulong64 p3);
 static int gdth_search_drives(int hanum);
 static int gdth_analyse_hdrive(int hanum, ushort hdrive);
 
-static void *gdth_mmap(ulong paddr, ulong size);
-static void gdth_munmap(void *addr);
-
 static const char *gdth_ctr_name(int hanum);
 
-#ifdef GDTH_IOCTL_CHRDEV
 static int gdth_open(struct inode *inode, struct file *filep);
 static int gdth_close(struct inode *inode, struct file *filep);
 static int gdth_ioctl(struct inode *inode, struct file *filep,
                       unsigned int cmd, unsigned long arg);
-#endif
 
-#if LINUX_VERSION_CODE >= 0x010300
 static void gdth_flush(int hanum);
-#if LINUX_VERSION_CODE >= 0x020100
 static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
-#else
-static int halt_called = FALSE;
-void gdth_halt(void);
-#endif
-#endif
 
 #ifdef DEBUG_GDTH
 static unchar   DebugState = DEBUG_GDTH;
@@ -528,6 +554,9 @@ static int ser_printk(const char *fmt, ...)
 
 #ifdef GDTH_STATISTICS
 static ulong32 max_rq=0, max_index=0, max_sg=0;
+#ifdef INT_COAL
+static ulong32 max_int_coal=0;
+#endif
 static ulong32 act_ints=0, act_ios=0, act_stats=0, act_rq=0;
 static struct timer_list gdth_timer;
 #endif
@@ -542,80 +571,12 @@ static struct timer_list gdth_timer;
 
 #define BUS_L2P(a,b)    ((b)>(a)->virt_bus ? (b-1):(b))
 
-#if LINUX_VERSION_CODE < 0x010300
-static void *gdth_mmap(ulong paddr, ulong size) 
-{
-    if (paddr >= high_memory)
-        return NULL; 
-    else
-        return (void *)paddr;
-}
-static void gdth_munmap(void *addr) 
-{
-}
-inline ulong32 virt_to_phys(volatile void *addr)
-{
-    return (ulong32)addr;
-}
-inline void *phys_to_virt(ulong32 addr)
-{
-    return (void *)addr;
-}
-#define virt_to_bus             virt_to_phys
-#define bus_to_virt             phys_to_virt
-#define gdth_readb(addr)        (*(volatile unchar *)(addr))
-#define gdth_readw(addr)        (*(volatile ushort *)(addr))
-#define gdth_readl(addr)        (*(volatile ulong32 *)(addr))
-#define gdth_writeb(b,addr)     (*(volatile unchar *)(addr) = (b))
-#define gdth_writew(b,addr)     (*(volatile ushort *)(addr) = (b))
-#define gdth_writel(b,addr)     (*(volatile ulong32 *)(addr) = (b))
-#define memset_io(a,b,c)        memset((void *)(a),(b),(c))
-#define memcpy_fromio(a,b,c)    memcpy((a),(void *)(b),(c))
-#define memcpy_toio(a,b,c)      memcpy((void *)(a),(b),(c))
-
-#define PCI_SLOT(devfn)         ((devfn >> 3) & 0x1f)
-
-#elif LINUX_VERSION_CODE < 0x020100
-static int remapped = FALSE;
-static void *gdth_mmap(ulong paddr, ulong size) 
-{
-    if ( paddr >= high_memory) {
-        remapped = TRUE;
-        return vremap(paddr, size);
-    } else {
-        return (void *)paddr; 
-    }
-}
-static void gdth_munmap(void *addr) 
-{
-    if (remapped)
-        vfree(addr);
-    remapped = FALSE;
-}
-#define gdth_readb(addr)        readb((ulong)(addr))
-#define gdth_readw(addr)        readw((ulong)(addr))
-#define gdth_readl(addr)        (ulong32)readl((ulong)(addr))
-#define gdth_writeb(b,addr)     writeb((b),(ulong)(addr))
-#define gdth_writew(b,addr)     writew((b),(ulong)(addr))
-#define gdth_writel(b,addr)     writel((ulong32)(b),(ulong)(addr))
-
-#else
-static void *gdth_mmap(ulong paddr, ulong size) 
-{ 
-    return ioremap(paddr, size); 
-}
-static void gdth_munmap(void *addr) 
-{
-    return iounmap(addr);
-}
 #define gdth_readb(addr)        readb((ulong)(addr))
 #define gdth_readw(addr)        readw((ulong)(addr))
 #define gdth_readl(addr)        (ulong32)readl((ulong)(addr))
 #define gdth_writeb(b,addr)     writeb((b),(ulong)(addr))
 #define gdth_writew(b,addr)     writew((b),(ulong)(addr))
 #define gdth_writel(b,addr)     writel((ulong32)(b),(ulong)(addr))
-#endif
-
 
 static unchar   gdth_drq_tab[4] = {5,6,7,7};            /* DRQ table */
 static unchar   gdth_irq_tab[6] = {0,10,11,12,14,0};    /* IRQ table */
@@ -631,9 +592,7 @@ static unchar   gdth_write_through = FALSE;             /* write through */
 static gdth_evt_str ebuffer[MAX_EVENTS];                /* event buffer */
 static int elastidx;
 static int eoldidx;
-#ifdef GDTH_IOCTL_CHRDEV
 static int major;
-#endif
 
 #define DIN     1                               /* IN data direction */
 #define DOU     2                               /* OUT data direction */
@@ -648,8 +607,8 @@ static unchar gdth_direction_tab[0x100] = {
     DUN,DUN,DUN,DUN,DUN,DOU,DUN,DUN,DUN,DUN,DIN,DUN,DUN,DUN,DUN,DUN,
     DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
     DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
-    DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
-    DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
+    DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DIN,DUN,DOU,DUN,DUN,DUN,DUN,DUN,
+    DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DIN,DUN,
     DUN,DUN,DUN,DUN,DUN,DNO,DNO,DUN,DIN,DNO,DOU,DUN,DNO,DUN,DOU,DOU,
     DOU,DOU,DOU,DNO,DUN,DIN,DOU,DIN,DIN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
     DUN,DUN,DOU,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
@@ -659,47 +618,32 @@ static unchar gdth_direction_tab[0x100] = {
 };
 
 /* __initfunc, __initdata macros */
-#if LINUX_VERSION_CODE >= 0x020322
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#define __devinitdata
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 #define GDTH_INITFUNC(type, func)       type __init func 
 #include <linux/init.h>
-#elif LINUX_VERSION_CODE >= 0x020126
+#else
 #define GDTH_INITFUNC(type, func)       __initfunc(type func)
 #include <linux/init.h>
-#else
-#define GDTH_INITFUNC(type, func)       type func
-#define __initdata
-#define __init
 #endif
 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 #define GDTH_INIT_LOCK_HA(ha)           spin_lock_init(&(ha)->smp_lock)
 #define GDTH_LOCK_HA(ha,flags)          spin_lock_irqsave(&(ha)->smp_lock,flags)
 #define GDTH_UNLOCK_HA(ha,flags)        spin_unlock_irqrestore(&(ha)->smp_lock,flags)
 
 #define GDTH_LOCK_SCSI_DONE(dev, flags) spin_lock_irqsave(dev->host_lock,flags)
 #define GDTH_UNLOCK_SCSI_DONE(dev, flags) spin_unlock_irqrestore(dev->host_lock,flags)
-#define GDTH_LOCK_SCSI_DOCMD(dev)       spin_lock_irq(dev->host_lock)
-#define GDTH_UNLOCK_SCSI_DOCMD(dev)     spin_unlock_irq(dev->host_lock)
 
-#elif LINUX_VERSION_CODE >= 0x02015F
+#else
 #define GDTH_INIT_LOCK_HA(ha)           spin_lock_init(&(ha)->smp_lock)
 #define GDTH_LOCK_HA(ha,flags)          spin_lock_irqsave(&(ha)->smp_lock,flags)
 #define GDTH_UNLOCK_HA(ha,flags)        spin_unlock_irqrestore(&(ha)->smp_lock,flags)
 
 #define GDTH_LOCK_SCSI_DONE(flags)      spin_lock_irqsave(&io_request_lock,flags)
 #define GDTH_UNLOCK_SCSI_DONE(flags)    spin_unlock_irqrestore(&io_request_lock,flags)
-#define GDTH_LOCK_SCSI_DOCMD()          spin_lock_irq(&io_request_lock)
-#define GDTH_UNLOCK_SCSI_DOCMD()        spin_unlock_irq(&io_request_lock)
-
-#else
-#define GDTH_INIT_LOCK_HA(ha)           do {} while (0)
-#define GDTH_LOCK_HA(ha,flags)          do {save_flags(flags); cli();} while (0)
-#define GDTH_UNLOCK_HA(ha,flags)        do {restore_flags(flags);} while (0)
-
-#define GDTH_LOCK_SCSI_DONE(flags)      do {} while (0)
-#define GDTH_UNLOCK_SCSI_DONE(flags)    do {} while (0)
-#define GDTH_LOCK_SCSI_DOCMD()          do {} while (0)
-#define GDTH_UNLOCK_SCSI_DOCMD()        do {} while (0)
 #endif
 
 /* LILO and modprobe/insmod parameters */
@@ -730,9 +674,10 @@ static int virt_ctr = 0;
 static int shared_access = 1;
 /* enable support for EISA and ISA controllers */
 static int probe_eisa_isa = 0;
+/* 64 bit DMA mode, support for drives > 2 TB, if force_dma32 = 0 */
+static int force_dma32 = 0;
 
 #ifdef MODULE
-#if LINUX_VERSION_CODE >= 0x02011A
 /* parameters for modprobe/insmod */
 MODULE_PARM(irq, "i");
 MODULE_PARM(disable, "i");
@@ -745,41 +690,42 @@ MODULE_PARM(rescan, "i");
 MODULE_PARM(virt_ctr, "i");
 MODULE_PARM(shared_access, "i");
 MODULE_PARM(probe_eisa_isa, "i");
+MODULE_PARM(force_dma32, "i");
 MODULE_AUTHOR("Achim Leubner");
-#endif
-#if LINUX_VERSION_CODE >= 0x02040B
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,11)
 MODULE_LICENSE("GPL");
 #endif
 #endif
 
-#ifdef GDTH_IOCTL_CHRDEV
 /* ioctl interface */
 static struct file_operations gdth_fops = {
-	.ioctl		= gdth_ioctl,
-	.open		= gdth_open,
-	.release	= gdth_close,
-};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    .ioctl   = gdth_ioctl,
+    .open    = gdth_open,
+    .release = gdth_close,
+#else
+    ioctl:gdth_ioctl,
+    open:gdth_open,
+    release:gdth_close,
 #endif
+};
 
 /* /proc support */
-#if LINUX_VERSION_CODE >= 0x010300
 #include <linux/stat.h> 
-#if LINUX_VERSION_CODE < 0x020322
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
 struct proc_dir_entry proc_scsi_gdth = {
     PROC_SCSI_GDTH, 4, "gdth",
     S_IFDIR | S_IRUGO | S_IXUGO, 2
 };
 #endif
+
 #include "gdth_proc.h"
 #include "gdth_proc.c"
-#endif
 
-#if LINUX_VERSION_CODE >= 0x020100
 /* notifier block to get a notify on system shutdown/halt/reboot */
 static struct notifier_block gdth_notifier = {
     gdth_halt, NULL, 0
 };
-#endif
 
 
 static void gdth_delay(int milliseconds)
@@ -787,17 +733,11 @@ static void gdth_delay(int milliseconds)
     if (milliseconds == 0) {
         udelay(1);
     } else {
-#if LINUX_VERSION_CODE >= 0x020168
         mdelay(milliseconds);
-#else
-        int i;
-        for (i = 0; i < milliseconds; ++i) 
-            udelay(1000);
-#endif
     }
 }
 
-static void gdth_eval_mapping(ulong32 size, int *cyls, int *heads, int *secs)
+static void gdth_eval_mapping(ulong32 size, ulong32 *cyls, int *heads, int *secs)
 {
     *cyls = size /HEADS/SECS;
     if (*cyls <= MAXCYLS) {
@@ -842,9 +782,9 @@ GDTH_INITFUNC(static int, gdth_search_isa(ulong32 bios_adr))
     ulong32 id;
 
     TRACE(("gdth_search_isa() bios adr. %x\n",bios_adr));
-    if ((addr = gdth_mmap(bios_adr+BIOS_ID_OFFS, sizeof(ulong32))) != NULL) {
+    if ((addr = ioremap(bios_adr+BIOS_ID_OFFS, sizeof(ulong32))) != NULL) {
         id = gdth_readl(addr);
-        gdth_munmap(addr);
+        iounmap(addr);
         if (id == GDT2_ID)                          /* GDT2000 */
             return 1;
     }
@@ -866,6 +806,8 @@ GDTH_INITFUNC(static int, gdth_search_pci(gdth_pci_str *pcistr))
         gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_VORTEX, device);
     gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_VORTEX, 
                     PCI_DEVICE_ID_VORTEX_GDTNEWRX);
+    gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_VORTEX, 
+                    PCI_DEVICE_ID_VORTEX_GDTNEWRX2);
     gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_INTEL,
                     PCI_DEVICE_ID_INTEL_SRC);
     gdth_search_dev(pcistr, &cnt, PCI_VENDOR_ID_INTEL,
@@ -873,11 +815,11 @@ GDTH_INITFUNC(static int, gdth_search_pci(gdth_pci_str *pcistr))
     return cnt;
 }
 
-#if LINUX_VERSION_CODE >= 0x20363
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 /* Vortex only makes RAID controllers.
  * We do not really want to specify all 550 ids here, so wildcard match.
  */
-static struct pci_device_id gdthtable[] = {
+static struct pci_device_id gdthtable[] __devinitdata = {
     {PCI_VENDOR_ID_VORTEX,PCI_ANY_ID,PCI_ANY_ID, PCI_ANY_ID},
     {PCI_VENDOR_ID_INTEL,PCI_DEVICE_ID_INTEL_SRC,PCI_ANY_ID,PCI_ANY_ID}, 
     {PCI_VENDOR_ID_INTEL,PCI_DEVICE_ID_INTEL_SRC_XSCALE,PCI_ANY_ID,PCI_ANY_ID}, 
@@ -890,17 +832,12 @@ GDTH_INITFUNC(static void, gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
                                            ushort vendor, ushort device))
 {
     ulong base0, base1, base2;
-#if LINUX_VERSION_CODE >= 0x2015C
     struct pci_dev *pdev;
-#else
-    int error;
-    ushort idx;
-#endif
     
     TRACE(("gdth_search_dev() cnt %d vendor %x device %x\n",
           *cnt, vendor, device));
 
-#if LINUX_VERSION_CODE >= 0x20363
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     pdev = NULL;
     while ((pdev = pci_find_device(vendor, device, pdev)) 
            != NULL) {
@@ -938,7 +875,7 @@ GDTH_INITFUNC(static void, gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
                 pcistr[*cnt].irq, pcistr[*cnt].dpmem));
         (*cnt)++;
     }       
-#elif LINUX_VERSION_CODE >= 0x2015C
+#else
     pdev = NULL;
     while ((pdev = pci_find_device(vendor, device, pdev)) 
            != NULL) {
@@ -979,66 +916,6 @@ GDTH_INITFUNC(static void, gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
                 pcistr[*cnt].irq, pcistr[*cnt].dpmem));
         (*cnt)++;
     }       
-#else   
-    idx = 0;
-    while (!pcibios_find_device(vendor, device, idx++,
-                                &pcistr[*cnt].bus,&pcistr[*cnt].device_fn)) {
-        if (*cnt >= MAXHA)
-            return;
-        /* GDT PCI ctr. found, now read resources from config space */
-#if LINUX_VERSION_CODE >= 0x010300
-#define GDTH_BASEP      (int *)
-#else
-#define GDTH_BASEP
-#endif
-        if ((error = pcibios_read_config_dword(pcistr[*cnt].bus,
-                                               pcistr[*cnt].device_fn,
-                                               PCI_BASE_ADDRESS_0,
-                                               GDTH_BASEP&base0)) ||
-            (error = pcibios_read_config_dword(pcistr[*cnt].bus,
-                                               pcistr[*cnt].device_fn,
-                                               PCI_BASE_ADDRESS_1,
-                                               GDTH_BASEP&base1)) ||
-            (error = pcibios_read_config_dword(pcistr[*cnt].bus,
-                                               pcistr[*cnt].device_fn,
-                                               PCI_BASE_ADDRESS_2,
-                                               GDTH_BASEP&base2)) ||
-            (error = pcibios_read_config_word(pcistr[*cnt].bus,
-                                              pcistr[*cnt].device_fn,
-                                              PCI_SUBSYSTEM_ID,
-                                              &pcistr[*cnt].subdevice_id)) ||
-            (error = pcibios_read_config_byte(pcistr[*cnt].bus,
-                                              pcistr[*cnt].device_fn,
-                                              PCI_INTERRUPT_LINE,
-                                              &pcistr[*cnt].irq))) {
-            printk("GDT-PCI: error %d reading configuration space", error);
-            continue;
-        }
-        pcistr[*cnt].vendor_id = vendor;
-        pcistr[*cnt].device_id = device;
-        if (device <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
-            device >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
-            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY)
-                continue;
-            pcistr[*cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-        } else {                                    /* GDT6110, GDT6120, .. */
-            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                (base2 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                (base1 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_IO)
-                continue;
-            pcistr[*cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
-            pcistr[*cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-            pcistr[*cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
-        }
-        TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
-                pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 
-                pcistr[*cnt].irq, pcistr[*cnt].dpmem));
-        (*cnt)++;
-    }
 #endif
 }   
 
@@ -1168,6 +1045,8 @@ GDTH_INITFUNC(static int, gdth_init_eisa(ushort eisa_adr,gdth_ha_str *ha))
         ha->type = GDT_EISA;
         ha->stype = id;
     }
+
+    ha->dma64_support = 0;
     return 1;
 }
 
@@ -1181,7 +1060,7 @@ GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha))
 
     TRACE(("gdth_init_isa() bios adr. %x\n",bios_adr));
 
-    ha->brd = gdth_mmap(bios_adr, sizeof(gdt2_dpram_str));
+    ha->brd = ioremap(bios_adr, sizeof(gdt2_dpram_str));
     if (ha->brd == NULL) {
         printk("GDT-ISA: Initialization error (DPMEM remap error)\n");
         return 0;
@@ -1191,8 +1070,8 @@ GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha))
     /* reset interface area */
     memset_io((char *)&dp2_ptr->u,0,sizeof(dp2_ptr->u));
     if (gdth_readl(&dp2_ptr->u) != 0) {
-        printk("GDT-PCI: Initialization error (DPMEM write error)\n");
-        gdth_munmap(ha->brd);
+        printk("GDT-ISA: Initialization error (DPMEM write error)\n");
+        iounmap(ha->brd);
         return 0;
     }
 
@@ -1227,7 +1106,7 @@ GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha))
     while (gdth_readb(&dp2_ptr->u.ic.S_Status) != 0xff) {
         if (--retries == 0) {
             printk("GDT-ISA: Initialization error (DEINIT failed)\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
         gdth_delay(1);
@@ -1237,7 +1116,7 @@ GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha))
     gdth_writeb(0xff, &dp2_ptr->io.irqdel);
     if (prot_ver != PROTOCOL_VERSION) {
         printk("GDT-ISA: Illegal protocol version\n");
-        gdth_munmap(ha->brd);
+        iounmap(ha->brd);
         return 0;
     }
 
@@ -1259,13 +1138,15 @@ GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha))
     while (gdth_readb(&dp2_ptr->u.ic.S_Status) != 0xfe) {
         if (--retries == 0) {
             printk("GDT-ISA: Initialization error\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
         gdth_delay(1);
     }
     gdth_writeb(0, &dp2_ptr->u.ic.Status);
     gdth_writeb(0xff, &dp2_ptr->io.irqdel);
+
+    ha->dma64_support = 0;
     return 1;
 }
 
@@ -1279,9 +1160,6 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
     unchar prot_ver;
     ushort command;
     int i, found = FALSE;
-#if LINUX_VERSION_CODE < 0x2015C
-    int rom_addr;
-#endif
 
     TRACE(("gdth_init_pci()\n"));
 
@@ -1293,13 +1171,13 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
     ha->stype = (ulong32)pcistr->device_id;
     ha->subdevice_id = pcistr->subdevice_id;
     ha->irq = pcistr->irq;
-#if LINUX_VERSION_CODE >= 0x20400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     ha->pdev = pcistr->pdev;
 #endif
     
     if (ha->stype <= PCI_DEVICE_ID_VORTEX_GDT6000B) {  /* GDT6000/B */
         TRACE2(("init_pci() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq));
-        ha->brd = gdth_mmap(pcistr->dpmem, sizeof(gdt6_dpram_str));
+        ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6_dpram_str));
         if (ha->brd == NULL) {
             printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
             return 0;
@@ -1312,8 +1190,8 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
                    pcistr->dpmem);
             found = FALSE;
             for (i = 0xC8000; i < 0xE8000; i += 0x4000) {
-                gdth_munmap(ha->brd);
-                ha->brd = gdth_mmap(i, sizeof(ushort)); 
+                iounmap(ha->brd);
+                ha->brd = ioremap(i, sizeof(ushort)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
                     return 0;
@@ -1322,15 +1200,10 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
                     TRACE2(("init_pci_old() address 0x%x busy\n", i));
                     continue;
                 }
-                gdth_munmap(ha->brd);
-#if LINUX_VERSION_CODE >= 0x2015C
+                iounmap(ha->brd);
                 pci_write_config_dword(pcistr->pdev, 
                                        PCI_BASE_ADDRESS_0, i);
-#else
-                pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                           PCI_BASE_ADDRESS_0, i);
-#endif
-                ha->brd = gdth_mmap(i, sizeof(gdt6_dpram_str)); 
+                ha->brd = ioremap(i, sizeof(gdt6_dpram_str)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
                     return 0;
@@ -1345,14 +1218,14 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
             }   
             if (!found) {
                 printk("GDT-PCI: No free address found!\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
         }
         memset_io((char *)&dp6_ptr->u,0,sizeof(dp6_ptr->u));
         if (gdth_readl(&dp6_ptr->u) != 0) {
             printk("GDT-PCI: Initialization error (DPMEM write error)\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
         
@@ -1370,7 +1243,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         while (gdth_readb(&dp6_ptr->u.ic.S_Status) != 0xff) {
             if (--retries == 0) {
                 printk("GDT-PCI: Initialization error (DEINIT failed)\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
             gdth_delay(1);
@@ -1380,7 +1253,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         gdth_writeb(0xff, &dp6_ptr->io.irqdel);
         if (prot_ver != PROTOCOL_VERSION) {
             printk("GDT-PCI: Illegal protocol version\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
 
@@ -1390,7 +1263,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         /* special command to controller BIOS */
         gdth_writel(0x00, &dp6_ptr->u.ic.S_Info[0]);
         gdth_writel(0x00, &dp6_ptr->u.ic.S_Info[1]);
-        gdth_writel(0x01, &dp6_ptr->u.ic.S_Info[2]);
+        gdth_writel(0x00, &dp6_ptr->u.ic.S_Info[2]);
         gdth_writel(0x00, &dp6_ptr->u.ic.S_Info[3]);
         gdth_writeb(0xfe, &dp6_ptr->u.ic.S_Cmd_Indx);
         gdth_writeb(0, &dp6_ptr->io.event);
@@ -1399,7 +1272,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         while (gdth_readb(&dp6_ptr->u.ic.S_Status) != 0xfe) {
             if (--retries == 0) {
                 printk("GDT-PCI: Initialization error\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
             gdth_delay(1);
@@ -1407,14 +1280,16 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         gdth_writeb(0, &dp6_ptr->u.ic.S_Status);
         gdth_writeb(0xff, &dp6_ptr->io.irqdel);
 
+        ha->dma64_support = 0;
+
     } else if (ha->stype <= PCI_DEVICE_ID_VORTEX_GDT6555) { /* GDT6110, ... */
         ha->plx = (gdt6c_plx_regs *)pcistr->io;
         TRACE2(("init_pci_new() dpmem %lx irq %d\n",
             pcistr->dpmem,ha->irq));
-        ha->brd = gdth_mmap(pcistr->dpmem, sizeof(gdt6c_dpram_str));
+        ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6c_dpram_str));
         if (ha->brd == NULL) {
             printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
         /* check and reset interface area */
@@ -1425,8 +1300,8 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
                    pcistr->dpmem);
             found = FALSE;
             for (i = 0xC8000; i < 0xE8000; i += 0x4000) {
-                gdth_munmap(ha->brd);
-                ha->brd = gdth_mmap(i, sizeof(ushort)); 
+                iounmap(ha->brd);
+                ha->brd = ioremap(i, sizeof(ushort)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
                     return 0;
@@ -1435,15 +1310,10 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
                     TRACE2(("init_pci_plx() address 0x%x busy\n", i));
                     continue;
                 }
-                gdth_munmap(ha->brd);
-#if LINUX_VERSION_CODE >= 0x2015C
+                iounmap(ha->brd);
                 pci_write_config_dword(pcistr->pdev, 
                                        PCI_BASE_ADDRESS_2, i);
-#else
-                pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                           PCI_BASE_ADDRESS_2, i);
-#endif
-                ha->brd = gdth_mmap(i, sizeof(gdt6c_dpram_str)); 
+                ha->brd = ioremap(i, sizeof(gdt6c_dpram_str)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
                     return 0;
@@ -1458,14 +1328,14 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
             }   
             if (!found) {
                 printk("GDT-PCI: No free address found!\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
         }
         memset_io((char *)&dp6c_ptr->u,0,sizeof(dp6c_ptr->u));
         if (gdth_readl(&dp6c_ptr->u) != 0) {
             printk("GDT-PCI: Initialization error (DPMEM write error)\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
         
@@ -1486,7 +1356,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         while (gdth_readb(&dp6c_ptr->u.ic.S_Status) != 0xff) {
             if (--retries == 0) {
                 printk("GDT-PCI: Initialization error (DEINIT failed)\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
             gdth_delay(1);
@@ -1495,7 +1365,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         gdth_writeb(0, &dp6c_ptr->u.ic.Status);
         if (prot_ver != PROTOCOL_VERSION) {
             printk("GDT-PCI: Illegal protocol version\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
 
@@ -1505,7 +1375,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         /* special command to controller BIOS */
         gdth_writel(0x00, &dp6c_ptr->u.ic.S_Info[0]);
         gdth_writel(0x00, &dp6c_ptr->u.ic.S_Info[1]);
-        gdth_writel(0x01, &dp6c_ptr->u.ic.S_Info[2]);
+        gdth_writel(0x00, &dp6c_ptr->u.ic.S_Info[2]);
         gdth_writel(0x00, &dp6c_ptr->u.ic.S_Info[3]);
         gdth_writeb(0xfe, &dp6c_ptr->u.ic.S_Cmd_Indx);
         
@@ -1516,23 +1386,25 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         while (gdth_readb(&dp6c_ptr->u.ic.S_Status) != 0xfe) {
             if (--retries == 0) {
                 printk("GDT-PCI: Initialization error\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
             gdth_delay(1);
         }
         gdth_writeb(0, &dp6c_ptr->u.ic.S_Status);
 
+        ha->dma64_support = 0;
+
     } else {                                            /* MPR */
         TRACE2(("init_pci_mpr() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq));
-        ha->brd = gdth_mmap(pcistr->dpmem, sizeof(gdt6m_dpram_str));
+        ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6m_dpram_str));
         if (ha->brd == NULL) {
             printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
             return 0;
         }
 
         /* manipulate config. space to enable DPMEM, start RP controller */
-#if LINUX_VERSION_CODE >= 0x20363
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
         pci_read_config_word(pcistr->pdev, PCI_COMMAND, &command);
         command |= 6;
         pci_write_config_word(pcistr->pdev, PCI_COMMAND, command);
@@ -1543,7 +1415,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         gdth_delay(1);
         pci_write_config_dword(pcistr->pdev, PCI_ROM_ADDRESS,
                                pci_resource_start(pcistr->pdev, 8));
-#elif LINUX_VERSION_CODE >= 0x2015C
+#else
         pci_read_config_word(pcistr->pdev, PCI_COMMAND, &command);
         command |= 6;
         pci_write_config_word(pcistr->pdev, PCI_COMMAND, command);
@@ -1554,22 +1426,6 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         gdth_delay(1);
         pci_write_config_dword(pcistr->pdev, PCI_ROM_ADDRESS,
                                pcistr->pdev->rom_address);
-#else
-        pcibios_read_config_word(pcistr->bus, pcistr->device_fn,
-                                 PCI_COMMAND, &command);
-        command |= 6;
-        pcibios_write_config_word(pcistr->bus, pcistr->device_fn, 
-                                  PCI_COMMAND, command);
-        pcibios_read_config_dword(pcistr->bus, pcistr->device_fn,
-                                  PCI_ROM_ADDRESS, &rom_addr);
-        if (rom_addr == 1UL)
-            rom_addr = 0UL;
-        i = 0xFEFF0001UL;
-        pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                   PCI_ROM_ADDRESS, i);
-        gdth_delay(1);
-        pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                   PCI_ROM_ADDRESS, rom_addr);
 #endif
         
         /* Ensure that it is safe to access the non HW portions of DPMEM.
@@ -1585,8 +1441,8 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
                    pcistr->dpmem);
             found = FALSE;
             for (i = 0xC8000; i < 0xE8000; i += 0x4000) {
-                gdth_munmap(ha->brd);
-                ha->brd = gdth_mmap(i, sizeof(ushort)); 
+                iounmap(ha->brd);
+                ha->brd = ioremap(i, sizeof(ushort)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
                     return 0;
@@ -1595,15 +1451,10 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
                     TRACE2(("init_pci_mpr() address 0x%x busy\n", i));
                     continue;
                 }
-                gdth_munmap(ha->brd);
-#if LINUX_VERSION_CODE >= 0x2015C
+                iounmap(ha->brd);
                 pci_write_config_dword(pcistr->pdev, 
                                        PCI_BASE_ADDRESS_0, i);
-#else
-                pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                           PCI_BASE_ADDRESS_0, i);
-#endif
-                ha->brd = gdth_mmap(i, sizeof(gdt6m_dpram_str)); 
+                ha->brd = ioremap(i, sizeof(gdt6m_dpram_str)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
                     return 0;
@@ -1618,7 +1469,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
             }   
             if (!found) {
                 printk("GDT-PCI: No free address found!\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
         }
@@ -1639,7 +1490,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         while (gdth_readb(&dp6m_ptr->u.ic.S_Status) != 0xff) {
             if (--retries == 0) {
                 printk("GDT-PCI: Initialization error (DEINIT failed)\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
                 return 0;
             }
             gdth_delay(1);
@@ -1648,7 +1499,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         gdth_writeb(0, &dp6m_ptr->u.ic.S_Status);
         if (prot_ver != PROTOCOL_VERSION) {
             printk("GDT-PCI: Illegal protocol version\n");
-            gdth_munmap(ha->brd);
+            iounmap(ha->brd);
             return 0;
         }
 
@@ -1658,7 +1509,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         /* special command to controller BIOS */
         gdth_writel(0x00, &dp6m_ptr->u.ic.S_Info[0]);
         gdth_writel(0x00, &dp6m_ptr->u.ic.S_Info[1]);
-        gdth_writel(0x01, &dp6m_ptr->u.ic.S_Info[2]);
+        gdth_writel(0x00, &dp6m_ptr->u.ic.S_Info[2]);
         gdth_writel(0x00, &dp6m_ptr->u.ic.S_Info[3]);
         gdth_writeb(0xfe, &dp6m_ptr->u.ic.S_Cmd_Indx);
         gdth_writeb(1, &dp6m_ptr->i960r.ldoor_reg);
@@ -1667,12 +1518,32 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
         while (gdth_readb(&dp6m_ptr->u.ic.S_Status) != 0xfe) {
             if (--retries == 0) {
                 printk("GDT-PCI: Initialization error\n");
-                gdth_munmap(ha->brd);
+                iounmap(ha->brd);
+                return 0;
+            }
+            gdth_delay(1);
+        }
+        gdth_writeb(0, &dp6m_ptr->u.ic.S_Status);
+
+        /* read FW version to detect 64-bit DMA support */
+        gdth_writeb(0xfd, &dp6m_ptr->u.ic.S_Cmd_Indx);
+        gdth_writeb(1, &dp6m_ptr->i960r.ldoor_reg);
+        retries = INIT_RETRIES;
+        gdth_delay(20);
+        while (gdth_readb(&dp6m_ptr->u.ic.S_Status) != 0xfd) {
+            if (--retries == 0) {
+                printk("GDT-PCI: Initialization error (DEINIT failed)\n");
+                iounmap(ha->brd);
                 return 0;
             }
             gdth_delay(1);
         }
+        prot_ver = (unchar)(gdth_readl(&dp6m_ptr->u.ic.S_Info[0]) >> 16);
         gdth_writeb(0, &dp6m_ptr->u.ic.S_Status);
+        if (prot_ver < 0x2b)      /* FW < x.43: no 64-bit DMA support */
+            ha->dma64_support = 0;
+        else 
+            ha->dma64_support = 1;
     }
 
     return 1;
@@ -1950,7 +1821,7 @@ static int gdth_wait(int hanum,int index,ulong32 time)
 
 
 static int gdth_internal_cmd(int hanum,unchar service,ushort opcode,ulong32 p1,
-                             ulong32 p2,ulong32 p3)
+                             ulong64 p2,ulong64 p3)
 {
     register gdth_ha_str *ha;
     register gdth_cmd_str *cmd_ptr;
@@ -1976,23 +1847,35 @@ static int gdth_internal_cmd(int hanum,unchar service,ushort opcode,ulong32 p1,
         if (service == CACHESERVICE) {
             if (opcode == GDT_IOCTL) {
                 cmd_ptr->u.ioctl.subfunc = p1;
-                cmd_ptr->u.ioctl.channel = p2;
+                cmd_ptr->u.ioctl.channel = (ulong32)p2;
                 cmd_ptr->u.ioctl.param_size = (ushort)p3;
                 cmd_ptr->u.ioctl.p_param = ha->scratch_phys;
             } else {
-                cmd_ptr->u.cache.DeviceNo = (ushort)p1;
-                cmd_ptr->u.cache.BlockNo  = p2;
+                if (ha->cache_feat & GDT_64BIT) {
+                    cmd_ptr->u.cache64.DeviceNo = (ushort)p1;
+                    cmd_ptr->u.cache64.BlockNo  = p2;
+                } else {
+                    cmd_ptr->u.cache.DeviceNo = (ushort)p1;
+                    cmd_ptr->u.cache.BlockNo  = (ulong32)p2;
+                }
             }
         } else if (service == SCSIRAWSERVICE) {
-            cmd_ptr->u.raw.direction  = p1;
-            cmd_ptr->u.raw.bus        = (unchar)p2;
-            cmd_ptr->u.raw.target     = (unchar)p3;
-            cmd_ptr->u.raw.lun        = (unchar)(p3 >> 8);
+            if (ha->raw_feat & GDT_64BIT) {
+                cmd_ptr->u.raw64.direction  = p1;
+                cmd_ptr->u.raw64.bus        = (unchar)p2;
+                cmd_ptr->u.raw64.target     = (unchar)p3;
+                cmd_ptr->u.raw64.lun        = (unchar)(p3 >> 8);
+            } else {
+                cmd_ptr->u.raw.direction  = p1;
+                cmd_ptr->u.raw.bus        = (unchar)p2;
+                cmd_ptr->u.raw.target     = (unchar)p3;
+                cmd_ptr->u.raw.lun        = (unchar)(p3 >> 8);
+            }
         } else if (service == SCREENSERVICE) {
             if (opcode == GDT_REALTIME) {
                 *(ulong32 *)&cmd_ptr->u.screen.su.data[0] = p1;
-                *(ulong32 *)&cmd_ptr->u.screen.su.data[4] = p2;
-                *(ulong32 *)&cmd_ptr->u.screen.su.data[8] = p3;
+                *(ulong32 *)&cmd_ptr->u.screen.su.data[4] = (ulong32)p2;
+                *(ulong32 *)&cmd_ptr->u.screen.su.data[8] = (ulong32)p3;
             }
         }
         ha->cmd_len          = sizeof(gdth_cmd_str);
@@ -2020,6 +1903,7 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
 {
     register gdth_ha_str *ha;
     ushort cdev_cnt, i;
+    int ok;
     ulong32 bus_no, drv_cnt, drv_no, j;
     gdth_getch_str *chn;
     gdth_drlist_str *drl;
@@ -2028,6 +1912,9 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
     gdth_arcdl_str *alst;
     gdth_alist_str *alst2;
     gdth_oem_str_ioctl *oemstr;
+#ifdef INT_COAL
+    gdth_perf_modes *pmod;
+#endif
 
 #ifdef GDTH_RTC
     unchar rtc[12];
@@ -2036,11 +1923,20 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
    
     TRACE(("gdth_search_drives() hanum %d\n",hanum));
     ha = HADATA(gdth_ctr_tab[hanum]);
+    ok = 0;
 
     /* initialize controller services, at first: screen service */
-    if (!gdth_internal_cmd(hanum,SCREENSERVICE,GDT_INIT,0,0,0)) {
-        printk("GDT: Initialization error screen service (code %d)\n",
-               ha->status);
+    ha->screen_feat = 0;
+    if (!force_dma32) {
+        ok = gdth_internal_cmd(hanum,SCREENSERVICE,GDT_X_INIT_SCR,0,0,0);
+        if (ok)
+            ha->screen_feat = GDT_64BIT;
+    }
+    if (force_dma32 || (!ok && ha->status == (ushort)S_NOFUNC))
+        ok = gdth_internal_cmd(hanum,SCREENSERVICE,GDT_INIT,0,0,0);
+    if (!ok) {
+        printk("GDT-HA %d: Initialization error screen service (code %d)\n",
+               hanum, ha->status);
         return 0;
     }
     TRACE2(("gdth_search_drives(): SCREENSERVICE initialized\n"));
@@ -2060,7 +1956,7 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
         for (j = 0; j < 12; ++j) 
             rtc[j] = CMOS_READ(j);
     } while (rtc[0] != CMOS_READ(0));
-    spin_unlock_irqrestore(&rtc_lock, flags);
+    spin_lock_irqrestore(&rtc_lock, flags);
     TRACE2(("gdth_search_drives(): RTC: %x/%x/%x\n",*(ulong32 *)&rtc[0],
             *(ulong32 *)&rtc[4], *(ulong32 *)&rtc[8]));
     /* 3. send to controller firmware */
@@ -2072,15 +1968,52 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
     gdth_internal_cmd(hanum,CACHESERVICE,GDT_UNFREEZE_IO,0,0,0);
  
     /* initialize cache service */
-    if (!gdth_internal_cmd(hanum,CACHESERVICE,GDT_INIT,LINUX_OS,0,0)) {
-        printk("GDT: Initialization error cache service (code %d)\n",
-               ha->status);
+    ha->cache_feat = 0;
+    if (!force_dma32) {
+        ok = gdth_internal_cmd(hanum,CACHESERVICE,GDT_X_INIT_HOST,LINUX_OS,0,0);
+        if (ok)
+            ha->cache_feat = GDT_64BIT;
+    }
+    if (force_dma32 || (!ok && ha->status == (ushort)S_NOFUNC))
+        ok = gdth_internal_cmd(hanum,CACHESERVICE,GDT_INIT,LINUX_OS,0,0);
+    if (!ok) {
+        printk("GDT-HA %d: Initialization error cache service (code %d)\n",
+               hanum, ha->status);
         return 0;
     }
     TRACE2(("gdth_search_drives(): CACHESERVICE initialized\n"));
     cdev_cnt = (ushort)ha->info;
     ha->fw_vers = ha->service;
 
+#ifdef INT_COAL
+    if (ha->type == GDT_PCIMPR) {
+        /* set perf. modes */
+        pmod = (gdth_perf_modes *)ha->pscratch;
+        pmod->version          = 1;
+        pmod->st_mode          = 1;    /* enable one status buffer */
+        *((ulong64 *)&pmod->st_buff_addr1) = ha->coal_stat_phys;
+        pmod->st_buff_indx1    = COALINDEX;
+        pmod->st_buff_addr2    = 0;
+        pmod->st_buff_u_addr2  = 0;
+        pmod->st_buff_indx2    = 0;
+        pmod->st_buff_size     = sizeof(gdth_coal_status) * MAXOFFSETS;
+        pmod->cmd_mode         = 0;    // disable all cmd buffers
+        pmod->cmd_buff_addr1   = 0;
+        pmod->cmd_buff_u_addr1 = 0;
+        pmod->cmd_buff_indx1   = 0;
+        pmod->cmd_buff_addr2   = 0;
+        pmod->cmd_buff_u_addr2 = 0;
+        pmod->cmd_buff_indx2   = 0;
+        pmod->cmd_buff_size    = 0;
+        pmod->reserved1        = 0;            
+        pmod->reserved2        = 0;            
+        if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,SET_PERF_MODES,
+                              INVALID_CHANNEL,sizeof(gdth_perf_modes))) {
+            printk("GDT-HA %d: Interrupt coalescing activated\n", hanum);
+        }
+    }
+#endif
+
     /* detect number of buses - try new IOCTL */
     iocr = (gdth_raw_iochan_str *)ha->pscratch;
     iocr->hdr.version        = 0xffffffff;
@@ -2108,8 +2041,8 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
                                    IO_CHANNEL | INVALID_CHANNEL,
                                    sizeof(gdth_getch_str))) {
                 if (bus_no == 0) {
-                    printk("GDT: Error detecting channel count (0x%x)\n",
-                           ha->status);
+                    printk("GDT-HA %d: Error detecting channel count (0x%x)\n",
+                           hanum, ha->status);
                     return 0;
                 }
                 break;
@@ -2126,8 +2059,8 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
     /* read cache configuration */
     if (!gdth_internal_cmd(hanum,CACHESERVICE,GDT_IOCTL,CACHE_INFO,
                            INVALID_CHANNEL,sizeof(gdth_cinfo_str))) {
-        printk("GDT: Initialization error cache service (code %d)\n",
-               ha->status);
+        printk("GDT-HA %d: Initialization error cache service (code %d)\n",
+               hanum, ha->status);
         return 0;
     }
     ha->cpar = ((gdth_cinfo_str *)ha->pscratch)->cpar;
@@ -2246,9 +2179,17 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
     }       
                                   
     /* initialize raw service */
-    if (!gdth_internal_cmd(hanum,SCSIRAWSERVICE,GDT_INIT,0,0,0)) {
-        printk("GDT: Initialization error raw service (code %d)\n",
-               ha->status);
+    ha->raw_feat = 0;
+    if (!force_dma32) {
+        ok = gdth_internal_cmd(hanum,SCSIRAWSERVICE,GDT_X_INIT_RAW,0,0,0);
+        if (ok)
+            ha->raw_feat = GDT_64BIT;
+    }
+    if (force_dma32 || (!ok && ha->status == (ushort)S_NOFUNC))
+        ok = gdth_internal_cmd(hanum,SCSIRAWSERVICE,GDT_INIT,0,0,0);
+    if (!ok) {
+        printk("GDT-HA %d: Initialization error raw service (code %d)\n",
+               hanum, ha->status);
         return 0;
     }
     TRACE2(("gdth_search_drives(): RAWSERVICE initialized\n"));
@@ -2260,7 +2201,7 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
         if (gdth_internal_cmd(hanum,SCSIRAWSERVICE,GDT_GET_FEAT,0,0,0)) {
             TRACE2(("gdth_search_dr(): get feat RAWSERVICE %d\n",
                     ha->info));
-            ha->raw_feat = (ushort)ha->info;
+            ha->raw_feat |= (ushort)ha->info;
         }
     } 
 
@@ -2271,7 +2212,7 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
         if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_GET_FEAT,0,0,0)) {
             TRACE2(("gdth_search_dr(): get feat CACHESERV. %d\n",
                     ha->info));
-            ha->cache_feat = (ushort)ha->info;
+            ha->cache_feat |= (ushort)ha->info;
         }
     }
 
@@ -2291,8 +2232,8 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
             if (!gdth_internal_cmd(hanum,SCSIRAWSERVICE,GDT_RESERVE,0,
                                    reserve_list[i+1], reserve_list[i+2] | 
                                    (reserve_list[i+3] << 8))) {
-                printk("GDT: Error raw service (RESERVE, code %d)\n",
-                       ha->status);
+                printk("GDT-HA %d: Error raw service (RESERVE, code %d)\n",
+                       hanum, ha->status);
              }
         }
     }
@@ -2305,17 +2246,32 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
                           CACHE_READ_OEM_STRING_RECORD,INVALID_CHANNEL,
                           sizeof(gdth_oem_str_ioctl))) {
         TRACE2(("gdth_search_drives(): CACHE_READ_OEM_STRING_RECORD OK\n"));
-        printk("GDT CTR%d Vendor: %s\n",hanum,oemstr->text.oem_company_name);
+        printk("GDT-HA %d: Vendor: %s Name: %s\n",
+               hanum,oemstr->text.oem_company_name,ha->binfo.type_string);
         /* Save the Host Drive inquiry data */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         strlcpy(ha->oem_name,oemstr->text.scsi_host_drive_inquiry_vendor_id,
-		sizeof(ha->oem_name));
+                sizeof(ha->oem_name));
+#else
+        strncpy(ha->oem_name,oemstr->text.scsi_host_drive_inquiry_vendor_id,7);
+        ha->oem_name[7] = '\0';
+#endif
     } else {
         /* Old method, based on PCI ID */
         TRACE2(("gdth_search_drives(): CACHE_READ_OEM_STRING_RECORD failed\n"));
+        printk("GDT-HA %d: Name: %s\n",
+               hanum,ha->binfo.type_string);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         if (ha->oem_id == OEM_ID_INTEL)
             strlcpy(ha->oem_name,"Intel  ", sizeof(ha->oem_name));
         else
             strlcpy(ha->oem_name,"ICP    ", sizeof(ha->oem_name));
+#else 
+        if (ha->oem_id == OEM_ID_INTEL)
+            strcpy(ha->oem_name,"Intel  ");
+        else
+            strcpy(ha->oem_name,"ICP    ");
+#endif
     }
 
     /* scanning for host drives */
@@ -2329,7 +2285,8 @@ GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
 static int gdth_analyse_hdrive(int hanum,ushort hdrive)
 {
     register gdth_ha_str *ha;
-    int drv_cyls, drv_hds, drv_secs;
+    ulong32 drv_cyls;
+    int drv_hds, drv_secs;
 
     TRACE(("gdth_analyse_hdrive() hanum %d drive %d\n",hanum,hdrive));
     if (hdrive >= MAX_HDRIVES)
@@ -2340,7 +2297,7 @@ static int gdth_analyse_hdrive(int hanum,ushort hdrive)
         return 0;
     ha->hdr[hdrive].present = TRUE;
     ha->hdr[hdrive].size = ha->info;
-
+   
     /* evaluate mapping (sectors per head, heads per cylinder) */
     ha->hdr[hdrive].size &= ~SECS32;
     if (ha->info2 == 0) {
@@ -2348,15 +2305,22 @@ static int gdth_analyse_hdrive(int hanum,ushort hdrive)
     } else {
         drv_hds = ha->info2 & 0xff;
         drv_secs = (ha->info2 >> 8) & 0xff;
-        drv_cyls = ha->hdr[hdrive].size /drv_hds/drv_secs;
+        drv_cyls = (ulong32)ha->hdr[hdrive].size / drv_hds / drv_secs;
     }
     ha->hdr[hdrive].heads = (unchar)drv_hds;
     ha->hdr[hdrive].secs  = (unchar)drv_secs;
     /* round size */
     ha->hdr[hdrive].size  = drv_cyls * drv_hds * drv_secs;
+    
+    if (ha->cache_feat & GDT_64BIT) {
+        if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_X_INFO,hdrive,0,0)
+            && ha->info2 != 0) {
+            ha->hdr[hdrive].size = ((ulong64)ha->info2 << 32) | ha->info;
+        }
+    }
     TRACE2(("gdth_search_dr() cdr. %d size %d hds %d scs %d\n",
             hdrive,ha->hdr[hdrive].size,drv_hds,drv_secs));
-            
+
     /* get informations about device */
     if (gdth_internal_cmd(hanum,CACHESERVICE,GDT_DEVTYPE,hdrive,0,0)) {
         TRACE2(("gdth_search_dr() cache drive %d devtype %d\n",
@@ -2398,14 +2362,13 @@ static void gdth_putq(int hanum,Scsi_Cmnd *scp,unchar priority)
     GDTH_LOCK_HA(ha, flags);
 
     scp->SCp.this_residual = (int)priority;
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
     t = scp->device->id;
 #else
     b = virt_ctr ? NUMDATA(scp->host)->busnum : scp->channel;
     t = scp->target;
 #endif
-#if LINUX_VERSION_CODE >= 0x010300
     if (priority >= DEFAULT_PRI) {
         if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) ||
             (b == ha->virt_bus && t < MAX_HDRIVES && ha->hdr[t].lock)) {
@@ -2413,7 +2376,6 @@ static void gdth_putq(int hanum,Scsi_Cmnd *scp,unchar priority)
             scp->SCp.buffers_residual = gdth_update_timeout(hanum, scp, 0);
         }
     }
-#endif
 
     if (ha->req_first==NULL) {
         ha->req_first = scp;                    /* queue was empty */
@@ -2465,7 +2427,7 @@ static void gdth_next(int hanum)
     for (nscp = pscp = ha->req_first; nscp; nscp = (Scsi_Cmnd *)nscp->SCp.ptr) {
         if (nscp != pscp && nscp != (Scsi_Cmnd *)pscp->SCp.ptr)
             pscp = (Scsi_Cmnd *)pscp->SCp.ptr;
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         b = virt_ctr ? NUMDATA(nscp->device->host)->busnum : nscp->device->channel;
         t = nscp->device->id;
         l = nscp->device->lun;
@@ -2493,10 +2455,7 @@ static void gdth_next(int hanum)
             firsttime = FALSE;
         }
 
-#if LINUX_VERSION_CODE >= 0x010300
-        if (nscp->done != gdth_scsi_done || nscp->cmnd[0] != 0xff) 
-#endif
-        {
+        if (nscp->done != gdth_scsi_done || nscp->cmnd[0] != 0xff) {        
         if (nscp->SCp.phase == -1) {
             nscp->SCp.phase = CACHESERVICE;           /* default: cache svc. */ 
             if (nscp->cmnd[0] == TEST_UNIT_READY) {
@@ -2565,16 +2524,11 @@ static void gdth_next(int hanum)
                         GDTH_LOCK_HA(ha,flags);
                 }
             }
-        } else
-
-#if LINUX_VERSION_CODE >= 0x010300
-        if (nscp->done == gdth_scsi_done && nscp->cmnd[0] == 0xff) {
+        } else if (nscp->done == gdth_scsi_done && nscp->cmnd[0] == 0xff) {
             if (!(cmd_index=gdth_special_cmd(hanum,nscp)))
                 this_cmd = FALSE;
             next_cmd = FALSE;
-        } else
-#endif
-        if (b != ha->virt_bus) {
+        } else if (b != ha->virt_bus) {
             if (ha->raw[BUS_L2P(ha,b)].io_cnt[t] >= GDTH_MAX_RAW ||
                 !(cmd_index=gdth_fill_raw_cmd(hanum,nscp,BUS_L2P(ha,b)))) 
                 this_cmd = FALSE;
@@ -2603,6 +2557,9 @@ static void gdth_next(int hanum)
               case VERIFY:
               case START_STOP:
               case MODE_SENSE:
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+              case SERVICE_ACTION_IN:
+#endif
                 TRACE(("cache cmd %x/%x/%x/%x/%x/%x\n",nscp->cmnd[0],
                        nscp->cmnd[1],nscp->cmnd[2],nscp->cmnd[3],
                        nscp->cmnd[4],nscp->cmnd[5]));
@@ -2674,6 +2631,10 @@ static void gdth_next(int hanum)
               case WRITE_6:
               case READ_10:
               case WRITE_10:
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+              case READ_16:
+              case WRITE_16:
+#endif
                 if (ha->hdr[t].media_changed) {
                     /* return UNIT_ATTENTION */
                     TRACE2(("cmd 0x%x target %d: UNIT_ATTENTION\n",
@@ -2701,8 +2662,8 @@ static void gdth_next(int hanum)
                 TRACE2(("cache cmd %x/%x/%x/%x/%x/%x unknown\n",nscp->cmnd[0],
                         nscp->cmnd[1],nscp->cmnd[2],nscp->cmnd[3],
                         nscp->cmnd[4],nscp->cmnd[5]));
-                printk("GDT: Unknown SCSI command 0x%x to cache service !\n",
-                       nscp->cmnd[0]);
+                printk("GDT-HA %d: Unknown SCSI command 0x%x to cache service !\n",
+                       hanum, nscp->cmnd[0]);
                 nscp->result = DID_ABORT << 16;
                 if (!nscp->SCp.have_data_in)
                     nscp->SCp.have_data_in++;
@@ -2737,11 +2698,11 @@ static void gdth_next(int hanum)
 
     if (gdth_polling && ha->cmd_cnt > 0) {
         if (!gdth_wait(hanum,cmd_index,POLL_TIMEOUT))
-            printk("GDT: Controller %d: Command %d timed out !\n",
+            printk("GDT-HA %d: Command %d timed out !\n",
                    hanum,cmd_index);
     }
 }
-    
+   
 static void gdth_copy_internal_data(int hanum,Scsi_Cmnd *scp,
                                     char *buffer,ushort count)
 {
@@ -2757,7 +2718,7 @@ static void gdth_copy_internal_data(int hanum,Scsi_Cmnd *scp,
 
     if (scp->use_sg) {
         sl = (struct scatterlist *)scp->request_buffer;
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
         sgcnt = pci_map_sg(ha->pdev,sl,scp->use_sg,PCI_DMA_FROMDEVICE);
         for (i=0,cpsum=0; i<sgcnt; ++i,++sl) {
             cpnow = (ushort)sg_dma_len(sl);
@@ -2766,7 +2727,12 @@ static void gdth_copy_internal_data(int hanum,Scsi_Cmnd *scp,
             if (cpsum+cpnow > cpcount) 
                 cpnow = cpcount - cpsum;
             cpsum += cpnow;
-            address = (char *)phys_to_virt(sg_dma_address(sl));
+            if (!sl->page) {
+                printk("GDT-HA %d: invalid sc/gt element in gdth_copy_internal_data()\n",
+                       hanum);
+                return;
+            }
+            address = (char *)(page_address(sl->page) + sl->offset);
             memcpy(address,buffer,cpnow);
             if (cpsum == cpcount)
                 break;
@@ -2806,7 +2772,7 @@ static int gdth_internal_cache_cmd(int hanum,Scsi_Cmnd *scp)
     gdth_modep_data mpd;
 
     ha = HADATA(gdth_ctr_tab[hanum]);
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     t  = scp->device->id;
 #else
     t  = scp->target;
@@ -2814,6 +2780,9 @@ static int gdth_internal_cache_cmd(int hanum,Scsi_Cmnd *scp)
     TRACE(("gdth_internal_cache_cmd() cmd 0x%x hdrive %d\n",
            scp->cmnd[0],t));
 
+    scp->result = DID_OK << 16;
+    scp->sense_buffer[0] = 0;
+
     switch (scp->cmnd[0]) {
       case TEST_UNIT_READY:
       case VERIFY:
@@ -2864,19 +2833,35 @@ static int gdth_internal_cache_cmd(int hanum,Scsi_Cmnd *scp)
 
       case READ_CAPACITY:
         TRACE2(("Read capacity hdrive %d\n",t));
-        rdc.last_block_no = ntohl(ha->hdr[t].size-1);
-        rdc.block_length  = ntohl(SECTOR_SIZE);
+        if (ha->hdr[t].size > (ulong64)0xffffffff)
+            rdc.last_block_no = 0xffffffff;
+        else
+            rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
+        rdc.block_length  = cpu_to_be32(SECTOR_SIZE);
         gdth_copy_internal_data(hanum,scp,(char*)&rdc,sizeof(gdth_rdcap_data));
         break;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+      case SERVICE_ACTION_IN:
+        if ((scp->cmnd[1] & 0x1f) == SAI_READ_CAPACITY_16 &&
+            (ha->cache_feat & GDT_64BIT)) {
+            gdth_rdcap16_data rdc16;
+
+            TRACE2(("Read capacity (16) hdrive %d\n",t));
+            rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
+            rdc16.block_length  = cpu_to_be32(SECTOR_SIZE);
+            gdth_copy_internal_data(hanum,scp,(char*)&rdc16,sizeof(gdth_rdcap16_data));
+        } else { 
+            scp->result = DID_ABORT << 16;
+        }
+        break;
+#endif
+
       default:
         TRACE2(("Internal cache cmd 0x%x unknown\n",scp->cmnd[0]));
         break;
     }
 
-    scp->result = DID_OK << 16;
-    scp->sense_buffer[0] = 0;
-
     if (!scp->SCp.have_data_in)
         scp->SCp.have_data_in++;
     else 
@@ -2890,9 +2875,14 @@ static int gdth_fill_cache_cmd(int hanum,Scsi_Cmnd *scp,ushort hdrive)
     register gdth_ha_str *ha;
     register gdth_cmd_str *cmdp;
     struct scatterlist *sl;
-    ushort i, cnt;
-    ulong32 no, phys_addr;
-    int cmd_index, read_write, sgcnt;
+    ulong32 cnt, blockcnt;
+    ulong64 no, blockno;
+    dma_addr_t phys_addr;
+    int i, cmd_index, read_write, sgcnt, mode64;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
+    struct page *page;
+    ulong offset;
+#endif
 
     ha = HADATA(gdth_ctr_tab[hanum]);
     cmdp = ha->pccb;
@@ -2902,6 +2892,11 @@ static int gdth_fill_cache_cmd(int hanum,Scsi_Cmnd *scp,ushort hdrive)
     if (ha->type==GDT_EISA && ha->cmd_cnt>0) 
         return 0;
 
+    mode64 = (ha->cache_feat & GDT_64BIT) ? TRUE : FALSE;
+    /* test for READ_16, WRITE_16 if !mode64 ? ---
+       not required, should not occur due to error return on 
+       READ_CAPACITY_16 */
+
     cmdp->Service = CACHESERVICE;
     cmdp->RequestBuffer = scp;
     /* search free command index */
@@ -2929,7 +2924,11 @@ static int gdth_fill_cache_cmd(int hanum,Scsi_Cmnd *scp,ushort hdrive)
         else
             cmdp->OpCode = GDT_FLUSH;
     } else if (scp->cmnd[0] == WRITE_6 || scp->cmnd[0] == WRITE_10 ||
-               scp->cmnd[0] == WRITE_12) {
+               scp->cmnd[0] == WRITE_12 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+               || scp->cmnd[0] == WRITE_16
+#endif
+    ) {
         read_write = 1;
         if (gdth_write_through || ((ha->hdr[hdrive].rw_attribs & 1) && 
                                    (ha->cache_feat & GDT_WR_THROUGH)))
@@ -2940,86 +2939,157 @@ static int gdth_fill_cache_cmd(int hanum,Scsi_Cmnd *scp,ushort hdrive)
         read_write = 2;
         cmdp->OpCode = GDT_READ;
     }
-    
-    cmdp->BoardNode        = LOCALBOARD;
-    cmdp->u.cache.DeviceNo = hdrive;
-    cmdp->u.cache.BlockNo  = 1;
-    cmdp->u.cache.sg_canz  = 0;
+
+    cmdp->BoardNode = LOCALBOARD;
+    if (mode64) {
+        cmdp->u.cache64.DeviceNo = hdrive;
+        cmdp->u.cache64.BlockNo  = 1;
+        cmdp->u.cache64.sg_canz  = 0;
+    } else {
+        cmdp->u.cache.DeviceNo = hdrive;
+        cmdp->u.cache.BlockNo  = 1;
+        cmdp->u.cache.sg_canz  = 0;
+    }
 
     if (read_write) {
-        if (scp->cmd_len != 6) {
+        if (scp->cmd_len == 16) {
+            memcpy(&no, &scp->cmnd[2], sizeof(ulong64));
+            blockno = be64_to_cpu(no);
+            memcpy(&cnt, &scp->cmnd[10], sizeof(ulong32));
+            blockcnt = be32_to_cpu(cnt);
+        } else if (scp->cmd_len == 10) {
             memcpy(&no, &scp->cmnd[2], sizeof(ulong32));
-            cmdp->u.cache.BlockNo = ntohl(no);
+            blockno = be32_to_cpu(no);
             memcpy(&cnt, &scp->cmnd[7], sizeof(ushort));
-            cmdp->u.cache.BlockCnt = (ulong32)ntohs(cnt);
+            blockcnt = be16_to_cpu(cnt);
         } else {
             memcpy(&no, &scp->cmnd[0], sizeof(ulong32));
-            cmdp->u.cache.BlockNo = ntohl(no) & 0x001fffffUL;
-            cmdp->u.cache.BlockCnt= scp->cmnd[4]==0 ? 0x100 : scp->cmnd[4];
+            blockno = be32_to_cpu(no) & 0x001fffffUL;
+            blockcnt= scp->cmnd[4]==0 ? 0x100 : scp->cmnd[4];
+        }
+        if (mode64) {
+            cmdp->u.cache64.BlockNo = blockno;
+            cmdp->u.cache64.BlockCnt = blockcnt;
+        } else {
+            cmdp->u.cache.BlockNo = (ulong32)blockno;
+            cmdp->u.cache.BlockCnt = blockcnt;
         }
 
         if (scp->use_sg) {
-            cmdp->u.cache.DestAddr= 0xffffffff;
             sl = (struct scatterlist *)scp->request_buffer;
             sgcnt = scp->use_sg;
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
             scp->SCp.Status = GDTH_MAP_SG;
             scp->SCp.Message = (read_write == 1 ? 
                 PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);   
             sgcnt = pci_map_sg(ha->pdev,sl,scp->use_sg,scp->SCp.Message);
-            for (i=0; i<sgcnt; ++i,++sl) {
-                cmdp->u.cache.sg_lst[i].sg_ptr = sg_dma_address(sl);
-                cmdp->u.cache.sg_lst[i].sg_len = sg_dma_len(sl);
+            if (mode64) {
+                cmdp->u.cache64.DestAddr= (ulong64)-1;
+                cmdp->u.cache64.sg_canz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.cache64.sg_lst[i].sg_ptr = sg_dma_address(sl);
+#ifdef GDTH_DMA_STATISTICS
+                    if (cmdp->u.cache64.sg_lst[i].sg_ptr > (ulong64)0xffffffff)
+                        ha->dma64_cnt++;
+                    else
+                        ha->dma32_cnt++;
+#endif
+                    cmdp->u.cache64.sg_lst[i].sg_len = sg_dma_len(sl);
+                }
+            } else {
+                cmdp->u.cache.DestAddr= 0xffffffff;
+                cmdp->u.cache.sg_canz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.cache.sg_lst[i].sg_ptr = sg_dma_address(sl);
+#ifdef GDTH_DMA_STATISTICS
+                    ha->dma32_cnt++;
+#endif
+                    cmdp->u.cache.sg_lst[i].sg_len = sg_dma_len(sl);
+                }
             }
 #else
-            for (i=0; i<sgcnt; ++i,++sl) {
-                cmdp->u.cache.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
-                cmdp->u.cache.sg_lst[i].sg_len = (ulong32)sl->length;
+            if (mode64) {
+                cmdp->u.cache64.DestAddr= (ulong64)-1;
+                cmdp->u.cache64.sg_canz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.cache64.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
+                    cmdp->u.cache64.sg_lst[i].sg_len = (ulong32)sl->length;
+                }
+            } else {
+                cmdp->u.cache.DestAddr= 0xffffffff;
+                cmdp->u.cache.sg_canz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.cache.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
+                    cmdp->u.cache.sg_lst[i].sg_len = (ulong32)sl->length;
+                }
             }
 #endif
-            cmdp->u.cache.sg_canz = (ulong32)i;
 
 #ifdef GDTH_STATISTICS
-            if (max_sg < (ulong32)i) {
-                max_sg = (ulong32)i;
-                TRACE3(("GDT: max_sg = %d\n",i));
+            if (max_sg < (ulong32)sgcnt) {
+                max_sg = (ulong32)sgcnt;
+                TRACE3(("GDT: max_sg = %d\n",max_sg));
             }
 #endif
-            if (i<GDTH_MAXSG)
-                cmdp->u.cache.sg_lst[i].sg_len = 0;
+
         } else {
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
             scp->SCp.Status = GDTH_MAP_SINGLE;
             scp->SCp.Message = (read_write == 1 ? 
-                PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);   
-            phys_addr = pci_map_single(ha->pdev,scp->request_buffer,
-                                       scp->request_bufflen,scp->SCp.Message);
+                PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);
+            page = virt_to_page(scp->request_buffer);
+            offset = (ulong)scp->request_buffer & ~PAGE_MASK;
+            phys_addr = pci_map_page(ha->pdev,page,offset,
+                                     scp->request_bufflen,scp->SCp.Message);
             scp->SCp.dma_handle = phys_addr;
 #else
             phys_addr = virt_to_bus(scp->request_buffer);
 #endif
-            if (ha->cache_feat & SCATTER_GATHER) {
-                cmdp->u.cache.DestAddr = 0xffffffff;
-                cmdp->u.cache.sg_canz = 1;
-                cmdp->u.cache.sg_lst[0].sg_ptr = phys_addr;
-                cmdp->u.cache.sg_lst[0].sg_len = scp->request_bufflen;
-                cmdp->u.cache.sg_lst[1].sg_len = 0;
+            if (mode64) {
+                if (ha->cache_feat & SCATTER_GATHER) {
+                    cmdp->u.cache64.DestAddr = (ulong64)-1;
+                    cmdp->u.cache64.sg_canz = 1;
+                    cmdp->u.cache64.sg_lst[0].sg_ptr = phys_addr;
+                    cmdp->u.cache64.sg_lst[0].sg_len = scp->request_bufflen;
+                    cmdp->u.cache64.sg_lst[1].sg_len = 0;
+                } else {
+                    cmdp->u.cache64.DestAddr  = phys_addr;
+                    cmdp->u.cache64.sg_canz= 0;
+                }
             } else {
-                cmdp->u.cache.DestAddr  = phys_addr;
-                cmdp->u.cache.sg_canz= 0;
+                if (ha->cache_feat & SCATTER_GATHER) {
+                    cmdp->u.cache.DestAddr = 0xffffffff;
+                    cmdp->u.cache.sg_canz = 1;
+                    cmdp->u.cache.sg_lst[0].sg_ptr = phys_addr;
+                    cmdp->u.cache.sg_lst[0].sg_len = scp->request_bufflen;
+                    cmdp->u.cache.sg_lst[1].sg_len = 0;
+                } else {
+                    cmdp->u.cache.DestAddr  = phys_addr;
+                    cmdp->u.cache.sg_canz= 0;
+                }
             }
         }
     }
-    TRACE(("cache cmd: addr. %x sganz %x sgptr0 %x sglen0 %x\n",
-           cmdp->u.cache.DestAddr,cmdp->u.cache.sg_canz,
-           cmdp->u.cache.sg_lst[0].sg_ptr,
-           cmdp->u.cache.sg_lst[0].sg_len));
-    TRACE(("cache cmd: cmd %d blockno. %d, blockcnt %d\n",
-           cmdp->OpCode,cmdp->u.cache.BlockNo,cmdp->u.cache.BlockCnt));
-
     /* evaluate command size, check space */
-    ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.cache.sg_lst) +
-        (ushort)cmdp->u.cache.sg_canz * sizeof(gdth_sg_str);
+    if (mode64) {
+        TRACE(("cache cmd: addr. %x sganz %x sgptr0 %x sglen0 %x\n",
+               cmdp->u.cache64.DestAddr,cmdp->u.cache64.sg_canz,
+               cmdp->u.cache64.sg_lst[0].sg_ptr,
+               cmdp->u.cache64.sg_lst[0].sg_len));
+        TRACE(("cache cmd: cmd %d blockno. %d, blockcnt %d\n",
+               cmdp->OpCode,cmdp->u.cache64.BlockNo,cmdp->u.cache64.BlockCnt));
+        ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.cache64.sg_lst) +
+            (ushort)cmdp->u.cache64.sg_canz * sizeof(gdth_sg64_str);
+    } else {
+        TRACE(("cache cmd: addr. %x sganz %x sgptr0 %x sglen0 %x\n",
+               cmdp->u.cache.DestAddr,cmdp->u.cache.sg_canz,
+               cmdp->u.cache.sg_lst[0].sg_ptr,
+               cmdp->u.cache.sg_lst[0].sg_len));
+        TRACE(("cache cmd: cmd %d blockno. %d, blockcnt %d\n",
+               cmdp->OpCode,cmdp->u.cache.BlockNo,cmdp->u.cache.BlockCnt));
+        ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.cache.sg_lst) +
+            (ushort)cmdp->u.cache.sg_canz * sizeof(gdth_sg_str);
+    }
     if (ha->cmd_len & 3)
         ha->cmd_len += (4 - (ha->cmd_len & 3));
 
@@ -3043,12 +3113,16 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b)
     register gdth_cmd_str *cmdp;
     struct scatterlist *sl;
     ushort i;
-    ulong32 phys_addr, sense_paddr;
-    int cmd_index, sgcnt;
+    dma_addr_t phys_addr, sense_paddr;
+    int cmd_index, sgcnt, mode64;
     unchar t,l;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
+    struct page *page;
+    ulong offset;
+#endif
 
     ha = HADATA(gdth_ctr_tab[hanum]);
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     t = scp->device->id;
     l = scp->device->lun;
 #else
@@ -3062,6 +3136,8 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b)
     if (ha->type==GDT_EISA && ha->cmd_cnt>0) 
         return 0;
 
+    mode64 = (ha->raw_feat & GDT_64BIT) ? TRUE : FALSE;
+
     cmdp->Service = SCSIRAWSERVICE;
     cmdp->RequestBuffer = scp;
     /* search free command index */
@@ -3077,95 +3153,176 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b)
     if (scp->SCp.sent_command != -1) {
         cmdp->OpCode           = scp->SCp.sent_command; /* special raw cmd. */
         cmdp->BoardNode        = LOCALBOARD;
-        cmdp->u.raw.direction  = (scp->SCp.phase >> 8);
-        TRACE2(("special raw cmd 0x%x param 0x%x\n", 
-                cmdp->OpCode, cmdp->u.raw.direction));
+        if (mode64) {
+            cmdp->u.raw64.direction = (scp->SCp.phase >> 8);
+            TRACE2(("special raw cmd 0x%x param 0x%x\n", 
+                    cmdp->OpCode, cmdp->u.raw64.direction));
+            /* evaluate command size */
+            ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw64.sg_lst);
+        } else {
+            cmdp->u.raw.direction  = (scp->SCp.phase >> 8);
+            TRACE2(("special raw cmd 0x%x param 0x%x\n", 
+                    cmdp->OpCode, cmdp->u.raw.direction));
+            /* evaluate command size */
+            ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst);
+        }
 
-        /* evaluate command size */
-        ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst);
     } else {
-#if LINUX_VERSION_CODE >= 0x020400
-        sense_paddr = pci_map_single(ha->pdev,scp->sense_buffer,
-                                     16,PCI_DMA_FROMDEVICE);
-        scp->SCp.buffer = (struct scatterlist *)sense_paddr;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
+        page = virt_to_page(scp->sense_buffer);
+        offset = (ulong)scp->sense_buffer & ~PAGE_MASK;
+        sense_paddr = pci_map_page(ha->pdev,page,offset,
+                                   16,PCI_DMA_FROMDEVICE);
+        scp->SCp.buffer = (struct scatterlist *)((ulong32)sense_paddr);
+        /* high part, if 64bit */
+        scp->host_scribble = (char *)(ulong32)((ulong64)sense_paddr >> 32);
 #else
         sense_paddr = virt_to_bus(scp->sense_buffer);
 #endif
         cmdp->OpCode           = GDT_WRITE;             /* always */
         cmdp->BoardNode        = LOCALBOARD;
-        cmdp->u.raw.reserved   = 0;
-        cmdp->u.raw.mdisc_time = 0;
-        cmdp->u.raw.mcon_time  = 0;
-        cmdp->u.raw.clen       = scp->cmd_len;
-        cmdp->u.raw.target     = t;
-        cmdp->u.raw.lun        = l;
-        cmdp->u.raw.bus        = b;
-        cmdp->u.raw.priority   = 0;
-        cmdp->u.raw.link_p     = 0;
-        cmdp->u.raw.sdlen      = scp->request_bufflen;
-        cmdp->u.raw.sense_len  = 16;
-        cmdp->u.raw.sense_data = sense_paddr;
-        cmdp->u.raw.direction  = 
-            gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN;
-        memcpy(cmdp->u.raw.cmd,scp->cmnd,12);
+        if (mode64) { 
+            cmdp->u.raw64.reserved   = 0;
+            cmdp->u.raw64.mdisc_time = 0;
+            cmdp->u.raw64.mcon_time  = 0;
+            cmdp->u.raw64.clen       = scp->cmd_len;
+            cmdp->u.raw64.target     = t;
+            cmdp->u.raw64.lun        = l;
+            cmdp->u.raw64.bus        = b;
+            cmdp->u.raw64.priority   = 0;
+            cmdp->u.raw64.sdlen      = scp->request_bufflen;
+            cmdp->u.raw64.sense_len  = 16;
+            cmdp->u.raw64.sense_data = sense_paddr;
+            cmdp->u.raw64.direction  = 
+                gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN;
+            memcpy(cmdp->u.raw64.cmd,scp->cmnd,16);
+        } else {
+            cmdp->u.raw.reserved   = 0;
+            cmdp->u.raw.mdisc_time = 0;
+            cmdp->u.raw.mcon_time  = 0;
+            cmdp->u.raw.clen       = scp->cmd_len;
+            cmdp->u.raw.target     = t;
+            cmdp->u.raw.lun        = l;
+            cmdp->u.raw.bus        = b;
+            cmdp->u.raw.priority   = 0;
+            cmdp->u.raw.link_p     = 0;
+            cmdp->u.raw.sdlen      = scp->request_bufflen;
+            cmdp->u.raw.sense_len  = 16;
+            cmdp->u.raw.sense_data = sense_paddr;
+            cmdp->u.raw.direction  = 
+                gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN;
+            memcpy(cmdp->u.raw.cmd,scp->cmnd,12);
+        }
 
         if (scp->use_sg) {
-            cmdp->u.raw.sdata  = 0xffffffff;
             sl = (struct scatterlist *)scp->request_buffer;
             sgcnt = scp->use_sg;
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
             scp->SCp.Status = GDTH_MAP_SG;
             scp->SCp.Message = PCI_DMA_BIDIRECTIONAL; 
             sgcnt = pci_map_sg(ha->pdev,sl,scp->use_sg,scp->SCp.Message);
-            for (i=0; i<sgcnt; ++i,++sl) {
-                cmdp->u.raw.sg_lst[i].sg_ptr = sg_dma_address(sl);
-                cmdp->u.raw.sg_lst[i].sg_len = sg_dma_len(sl);
+            if (mode64) {
+                cmdp->u.raw64.sdata = (ulong64)-1;
+                cmdp->u.raw64.sg_ranz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.raw64.sg_lst[i].sg_ptr = sg_dma_address(sl);
+#ifdef GDTH_DMA_STATISTICS
+                    if (cmdp->u.raw64.sg_lst[i].sg_ptr > (ulong64)0xffffffff)
+                        ha->dma64_cnt++;
+                    else
+                        ha->dma32_cnt++;
+#endif
+                    cmdp->u.raw64.sg_lst[i].sg_len = sg_dma_len(sl);
+                }
+            } else {
+                cmdp->u.raw.sdata = 0xffffffff;
+                cmdp->u.raw.sg_ranz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.raw.sg_lst[i].sg_ptr = sg_dma_address(sl);
+#ifdef GDTH_DMA_STATISTICS
+                    ha->dma32_cnt++;
+#endif
+                    cmdp->u.raw.sg_lst[i].sg_len = sg_dma_len(sl);
+                }
             }
 #else
-            for (i=0; i<sgcnt; ++i,++sl) {
-                cmdp->u.raw.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
-                cmdp->u.raw.sg_lst[i].sg_len = (ulong32)sl->length;
+            if (mode64) {
+                cmdp->u.raw64.sdata = (ulong64)-1;
+                cmdp->u.raw64.sg_ranz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.raw64.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
+                    cmdp->u.raw64.sg_lst[i].sg_len = (ulong32)sl->length;
+                }
+            } else {
+                cmdp->u.raw.sdata = 0xffffffff;
+                cmdp->u.raw.sg_ranz = sgcnt;
+                for (i=0; i<sgcnt; ++i,++sl) {
+                    cmdp->u.raw.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
+                    cmdp->u.raw.sg_lst[i].sg_len = (ulong32)sl->length;
+                }
             }
 #endif
-            cmdp->u.raw.sg_ranz = (ulong32)i;
 
 #ifdef GDTH_STATISTICS
-            if (max_sg < (ulong32)i) {
-                max_sg = (ulong32)i;
-                TRACE3(("GDT: max_sg = %d\n",i));
+            if (max_sg < sgcnt) {
+                max_sg = sgcnt;
+                TRACE3(("GDT: max_sg = %d\n",sgcnt));
             }
 #endif
-            if (i<GDTH_MAXSG)
-                cmdp->u.raw.sg_lst[i].sg_len = 0;
+
         } else {
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
             scp->SCp.Status = GDTH_MAP_SINGLE;
             scp->SCp.Message = PCI_DMA_BIDIRECTIONAL; 
-            phys_addr = pci_map_single(ha->pdev,scp->request_buffer,
-                                       scp->request_bufflen,scp->SCp.Message);
+            page = virt_to_page(scp->request_buffer);
+            offset = (ulong)scp->request_buffer & ~PAGE_MASK;
+            phys_addr = pci_map_page(ha->pdev,page,offset,
+                                     scp->request_bufflen,scp->SCp.Message);
             scp->SCp.dma_handle = phys_addr;
 #else
             phys_addr = virt_to_bus(scp->request_buffer);
 #endif
-            if (ha->raw_feat & SCATTER_GATHER) {
-                cmdp->u.raw.sdata  = 0xffffffff;
-                cmdp->u.raw.sg_ranz= 1;
-                cmdp->u.raw.sg_lst[0].sg_ptr = phys_addr;
-                cmdp->u.raw.sg_lst[0].sg_len = scp->request_bufflen;
-                cmdp->u.raw.sg_lst[1].sg_len = 0;
+            if (mode64) {
+                if (ha->raw_feat & SCATTER_GATHER) {
+                    cmdp->u.raw64.sdata  = (ulong64)-1;
+                    cmdp->u.raw64.sg_ranz= 1;
+                    cmdp->u.raw64.sg_lst[0].sg_ptr = phys_addr;
+                    cmdp->u.raw64.sg_lst[0].sg_len = scp->request_bufflen;
+                    cmdp->u.raw64.sg_lst[1].sg_len = 0;
+                } else {
+                    cmdp->u.raw64.sdata  = phys_addr;
+                    cmdp->u.raw64.sg_ranz= 0;
+                }
             } else {
-                cmdp->u.raw.sdata  = phys_addr;
-                cmdp->u.raw.sg_ranz= 0;
+                if (ha->raw_feat & SCATTER_GATHER) {
+                    cmdp->u.raw.sdata  = 0xffffffff;
+                    cmdp->u.raw.sg_ranz= 1;
+                    cmdp->u.raw.sg_lst[0].sg_ptr = phys_addr;
+                    cmdp->u.raw.sg_lst[0].sg_len = scp->request_bufflen;
+                    cmdp->u.raw.sg_lst[1].sg_len = 0;
+                } else {
+                    cmdp->u.raw.sdata  = phys_addr;
+                    cmdp->u.raw.sg_ranz= 0;
+                }
             }
         }
-        TRACE(("raw cmd: addr. %x sganz %x sgptr0 %x sglen0 %x\n",
-               cmdp->u.raw.sdata,cmdp->u.raw.sg_ranz,
-               cmdp->u.raw.sg_lst[0].sg_ptr,
-               cmdp->u.raw.sg_lst[0].sg_len));
-
-        /* evaluate command size */
-        ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst) +
-            (ushort)cmdp->u.raw.sg_ranz * sizeof(gdth_sg_str);
+        if (mode64) {
+            TRACE(("raw cmd: addr. %x sganz %x sgptr0 %x sglen0 %x\n",
+                   cmdp->u.raw64.sdata,cmdp->u.raw64.sg_ranz,
+                   cmdp->u.raw64.sg_lst[0].sg_ptr,
+                   cmdp->u.raw64.sg_lst[0].sg_len));
+            /* evaluate command size */
+            ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw64.sg_lst) +
+                (ushort)cmdp->u.raw64.sg_ranz * sizeof(gdth_sg64_str);
+        } else {
+            TRACE(("raw cmd: addr. %x sganz %x sgptr0 %x sglen0 %x\n",
+                   cmdp->u.raw.sdata,cmdp->u.raw.sg_ranz,
+                   cmdp->u.raw.sg_lst[0].sg_ptr,
+                   cmdp->u.raw.sg_lst[0].sg_len));
+            /* evaluate command size */
+            ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst) +
+                (ushort)cmdp->u.raw.sg_ranz * sizeof(gdth_sg_str);
+        }
     }
     /* check space */
     if (ha->cmd_len & 3)
@@ -3215,15 +3372,23 @@ static int gdth_special_cmd(int hanum,Scsi_Cmnd *scp)
     if (cmdp->OpCode == GDT_IOCTL) {
         TRACE2(("IOCTL\n"));
         ha->cmd_len = 
-            GDTOFFSOF(gdth_cmd_str,u.ioctl.p_param) + sizeof(ulong32);
+            GDTOFFSOF(gdth_cmd_str,u.ioctl.p_param) + sizeof(ulong64);
     } else if (cmdp->Service == CACHESERVICE) {
         TRACE2(("cache command %d\n",cmdp->OpCode));
-        ha->cmd_len = 
-            GDTOFFSOF(gdth_cmd_str,u.cache.sg_lst) + sizeof(gdth_sg_str);
+        if (ha->cache_feat & GDT_64BIT)
+            ha->cmd_len = 
+                GDTOFFSOF(gdth_cmd_str,u.cache64.sg_lst) + sizeof(gdth_sg64_str);
+        else
+            ha->cmd_len = 
+                GDTOFFSOF(gdth_cmd_str,u.cache.sg_lst) + sizeof(gdth_sg_str);
     } else if (cmdp->Service == SCSIRAWSERVICE) {
-        TRACE2(("raw command %d/%d\n",cmdp->OpCode,cmdp->u.raw.cmd[0]));
-        ha->cmd_len = 
-            GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst) + sizeof(gdth_sg_str);
+        TRACE2(("raw command %d\n",cmdp->OpCode));
+        if (ha->raw_feat & GDT_64BIT)
+            ha->cmd_len = 
+                GDTOFFSOF(gdth_cmd_str,u.raw64.sg_lst) + sizeof(gdth_sg64_str);
+        else
+            ha->cmd_len = 
+                GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst) + sizeof(gdth_sg_str);
     }
 
     if (ha->cmd_len & 3)
@@ -3355,7 +3520,7 @@ static void gdth_readapp_event(gdth_ha_str *ha,
     GDTH_UNLOCK_HA(ha, flags);
 }
 
-static void gdth_clear_events()
+static void gdth_clear_events(void)
 {
     TRACE(("gdth_clear_events()"));
 
@@ -3366,10 +3531,14 @@ static void gdth_clear_events()
 
 /* SCSI interface functions */
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static irqreturn_t gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs)
+#else
+static void gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs)
+#endif
 {
     register gdth_ha_str *ha;
-    gdt6m_dpram_str *dp6m_ptr;
+    gdt6m_dpram_str *dp6m_ptr = NULL;
     gdt6_dpram_str *dp6_ptr;
     gdt2_dpram_str *dp2_ptr;
     Scsi_Cmnd *scp;
@@ -3377,13 +3546,23 @@ static irqreturn_t gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs)
     unchar IStatus;
     ushort Service;
     ulong flags = 0;
+#ifdef INT_COAL
+    int coalesced = FALSE;
+    int next = FALSE;
+    gdth_coal_status *pcs = NULL;
+    int act_int_coal = 0;       
+#endif
 
     TRACE(("gdth_interrupt() IRQ %d\n",irq));
 
     /* if polling and not from gdth_wait() -> return */
     if (gdth_polling) {
         if (!gdth_from_wait) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
             return IRQ_HANDLED;
+#else
+            return;             
+#endif
         }
     }
 
@@ -3396,174 +3575,261 @@ static irqreturn_t gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs)
         /* spurious interrupt */
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return IRQ_HANDLED;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            return IRQ_HANDLED;
+#else
+            return;             
+#endif
     }
+    ha = HADATA(gdth_ctr_tab[hanum]);
 
 #ifdef GDTH_STATISTICS
     ++act_ints;
 #endif
+
+#ifdef INT_COAL
+    /* See if the fw is returning coalesced status */
+    if (IStatus == COALINDEX) {
+        /* Coalesced status.  Setup the initial status 
+           buffer pointer and flags */
+        pcs = ha->coal_stat;
+        coalesced = TRUE;        
+        next = TRUE;
+    }
+
+    do {
+        if (coalesced) {
+            /* For coalesced requests all status
+               information is found in the status buffer */
+            IStatus = (unchar)(pcs->status & 0xff);
+        }
+#endif
     
-    ha = HADATA(gdth_ctr_tab[hanum]);
-    if (ha->type == GDT_EISA) {
-        if (IStatus & 0x80) {                       /* error flag */
-            IStatus &= ~0x80;
-            ha->status = inw(ha->bmic + MAILBOXREG+8);
-            TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
-        } else                                      /* no error */
-            ha->status = S_OK;
-        ha->info = inl(ha->bmic + MAILBOXREG+12);
-        ha->service = inw(ha->bmic + MAILBOXREG+10);
-        ha->info2 = inl(ha->bmic + MAILBOXREG+4);
-
-        outb(0xff, ha->bmic + EDOORREG);            /* acknowledge interrupt */
-        outb(0x00, ha->bmic + SEMA1REG);            /* reset status semaphore */
-    } else if (ha->type == GDT_ISA) {
-        dp2_ptr = (gdt2_dpram_str *)ha->brd;
-        if (IStatus & 0x80) {                       /* error flag */
-            IStatus &= ~0x80;
-            ha->status = gdth_readw(&dp2_ptr->u.ic.Status);
-            TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
-        } else                                      /* no error */
-            ha->status = S_OK;
-        ha->info = gdth_readl(&dp2_ptr->u.ic.Info[0]);
-        ha->service = gdth_readw(&dp2_ptr->u.ic.Service);
-        ha->info2 = gdth_readl(&dp2_ptr->u.ic.Info[1]);
-
-        gdth_writeb(0xff, &dp2_ptr->io.irqdel);     /* acknowledge interrupt */
-        gdth_writeb(0, &dp2_ptr->u.ic.Cmd_Index);   /* reset command index */
-        gdth_writeb(0, &dp2_ptr->io.Sema1);         /* reset status semaphore */
-    } else if (ha->type == GDT_PCI) {
-        dp6_ptr = (gdt6_dpram_str *)ha->brd;
-        if (IStatus & 0x80) {                       /* error flag */
-            IStatus &= ~0x80;
-            ha->status = gdth_readw(&dp6_ptr->u.ic.Status);
-            TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
-        } else                                      /* no error */
-            ha->status = S_OK;
-        ha->info = gdth_readl(&dp6_ptr->u.ic.Info[0]);
-        ha->service = gdth_readw(&dp6_ptr->u.ic.Service);
-        ha->info2 = gdth_readl(&dp6_ptr->u.ic.Info[1]);
-
-        gdth_writeb(0xff, &dp6_ptr->io.irqdel);     /* acknowledge interrupt */
-        gdth_writeb(0, &dp6_ptr->u.ic.Cmd_Index);   /* reset command index */
-        gdth_writeb(0, &dp6_ptr->io.Sema1);         /* reset status semaphore */
-    } else if (ha->type == GDT_PCINEW) {
-        if (IStatus & 0x80) {                       /* error flag */
-            IStatus &= ~0x80;
-            ha->status = inw(PTR2USHORT(&ha->plx->status));
-            TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
-        } else
-            ha->status = S_OK;
-        ha->info = inl(PTR2USHORT(&ha->plx->info[0]));
-        ha->service = inw(PTR2USHORT(&ha->plx->service));
-        ha->info2 = inl(PTR2USHORT(&ha->plx->info[1]));
-
-        outb(0xff, PTR2USHORT(&ha->plx->edoor_reg)); 
-        outb(0x00, PTR2USHORT(&ha->plx->sema1_reg)); 
-    } else if (ha->type == GDT_PCIMPR) {
-        dp6m_ptr = (gdt6m_dpram_str *)ha->brd;
-        if (IStatus & 0x80) {                       /* error flag */
-            IStatus &= ~0x80;
-            ha->status = gdth_readw(&dp6m_ptr->i960r.status);
-            TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
-        } else                                      /* no error */
-            ha->status = S_OK;
-        ha->info = gdth_readl(&dp6m_ptr->i960r.info[0]);
-        ha->service = gdth_readw(&dp6m_ptr->i960r.service);
-        ha->info2 = gdth_readl(&dp6m_ptr->i960r.info[1]);
-
-        /* event string */
-        if (IStatus == ASYNCINDEX) {
-            if (ha->service != SCREENSERVICE &&
-                (ha->fw_vers & 0xff) >= 0x1a) {
-                ha->dvr.severity =   
-                    gdth_readb(&((gdt6m_dpram_str *)ha->brd)->i960r.severity);
-                for (i = 0; i < 256; ++i) {
-                    ha->dvr.event_string[i] = gdth_readb
-                        (&((gdt6m_dpram_str *)ha->brd)->i960r.evt_str[i]);
-                    if (ha->dvr.event_string[i] == 0)
-                        break;
+        if (ha->type == GDT_EISA) {
+            if (IStatus & 0x80) {                       /* error flag */
+                IStatus &= ~0x80;
+                ha->status = inw(ha->bmic + MAILBOXREG+8);
+                TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
+            } else                                      /* no error */
+                ha->status = S_OK;
+            ha->info = inl(ha->bmic + MAILBOXREG+12);
+            ha->service = inw(ha->bmic + MAILBOXREG+10);
+            ha->info2 = inl(ha->bmic + MAILBOXREG+4);
+
+            outb(0xff, ha->bmic + EDOORREG);    /* acknowledge interrupt */
+            outb(0x00, ha->bmic + SEMA1REG);    /* reset status semaphore */
+        } else if (ha->type == GDT_ISA) {
+            dp2_ptr = (gdt2_dpram_str *)ha->brd;
+            if (IStatus & 0x80) {                       /* error flag */
+                IStatus &= ~0x80;
+                ha->status = gdth_readw(&dp2_ptr->u.ic.Status);
+                TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
+            } else                                      /* no error */
+                ha->status = S_OK;
+            ha->info = gdth_readl(&dp2_ptr->u.ic.Info[0]);
+            ha->service = gdth_readw(&dp2_ptr->u.ic.Service);
+            ha->info2 = gdth_readl(&dp2_ptr->u.ic.Info[1]);
+
+            gdth_writeb(0xff, &dp2_ptr->io.irqdel); /* acknowledge interrupt */
+            gdth_writeb(0, &dp2_ptr->u.ic.Cmd_Index);/* reset command index */
+            gdth_writeb(0, &dp2_ptr->io.Sema1);     /* reset status semaphore */
+        } else if (ha->type == GDT_PCI) {
+            dp6_ptr = (gdt6_dpram_str *)ha->brd;
+            if (IStatus & 0x80) {                       /* error flag */
+                IStatus &= ~0x80;
+                ha->status = gdth_readw(&dp6_ptr->u.ic.Status);
+                TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
+            } else                                      /* no error */
+                ha->status = S_OK;
+            ha->info = gdth_readl(&dp6_ptr->u.ic.Info[0]);
+            ha->service = gdth_readw(&dp6_ptr->u.ic.Service);
+            ha->info2 = gdth_readl(&dp6_ptr->u.ic.Info[1]);
+
+            gdth_writeb(0xff, &dp6_ptr->io.irqdel); /* acknowledge interrupt */
+            gdth_writeb(0, &dp6_ptr->u.ic.Cmd_Index);/* reset command index */
+            gdth_writeb(0, &dp6_ptr->io.Sema1);     /* reset status semaphore */
+        } else if (ha->type == GDT_PCINEW) {
+            if (IStatus & 0x80) {                       /* error flag */
+                IStatus &= ~0x80;
+                ha->status = inw(PTR2USHORT(&ha->plx->status));
+                TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
+            } else
+                ha->status = S_OK;
+            ha->info = inl(PTR2USHORT(&ha->plx->info[0]));
+            ha->service = inw(PTR2USHORT(&ha->plx->service));
+            ha->info2 = inl(PTR2USHORT(&ha->plx->info[1]));
+
+            outb(0xff, PTR2USHORT(&ha->plx->edoor_reg)); 
+            outb(0x00, PTR2USHORT(&ha->plx->sema1_reg)); 
+        } else if (ha->type == GDT_PCIMPR) {
+            dp6m_ptr = (gdt6m_dpram_str *)ha->brd;
+            if (IStatus & 0x80) {                       /* error flag */
+                IStatus &= ~0x80;
+#ifdef INT_COAL
+                if (coalesced)
+                    ha->status = pcs->ext_status && 0xffff;
+                else 
+#endif
+                    ha->status = gdth_readw(&dp6m_ptr->i960r.status);
+                TRACE2(("gdth_interrupt() error %d/%d\n",IStatus,ha->status));
+            } else                                      /* no error */
+                ha->status = S_OK;
+#ifdef INT_COAL
+            /* get information */
+            if (coalesced) {    
+                ha->info = pcs->info0;
+                ha->info2 = pcs->info1;
+                ha->service = (pcs->ext_status >> 16) && 0xffff;
+            } else
+#endif
+            {
+                ha->info = gdth_readl(&dp6m_ptr->i960r.info[0]);
+                ha->service = gdth_readw(&dp6m_ptr->i960r.service);
+                ha->info2 = gdth_readl(&dp6m_ptr->i960r.info[1]);
+            }
+            /* event string */
+            if (IStatus == ASYNCINDEX) {
+                if (ha->service != SCREENSERVICE &&
+                    (ha->fw_vers & 0xff) >= 0x1a) {
+                    ha->dvr.severity = gdth_readb
+                        (&((gdt6m_dpram_str *)ha->brd)->i960r.severity);
+                    for (i = 0; i < 256; ++i) {
+                        ha->dvr.event_string[i] = gdth_readb
+                            (&((gdt6m_dpram_str *)ha->brd)->i960r.evt_str[i]);
+                        if (ha->dvr.event_string[i] == 0)
+                            break;
+                    }
                 }
             }
+#ifdef INT_COAL
+            /* Make sure that non coalesced interrupts get cleared
+               before being handled by gdth_async_event/gdth_sync_event */
+            if (!coalesced)
+#endif                          
+            {
+                gdth_writeb(0xff, &dp6m_ptr->i960r.edoor_reg);
+                gdth_writeb(0, &dp6m_ptr->i960r.sema1_reg);
+            }
+        } else {
+            TRACE2(("gdth_interrupt() unknown controller type\n"));
+            if (!gdth_polling)
+                GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            return IRQ_HANDLED;
+#else
+            return;             
+#endif
         }
-        gdth_writeb(0xff, &dp6m_ptr->i960r.edoor_reg);
-        gdth_writeb(0, &dp6m_ptr->i960r.sema1_reg);
-    } else {
-        TRACE2(("gdth_interrupt() unknown controller type\n"));
-        if (!gdth_polling)
-            GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return IRQ_HANDLED;
-    }
 
-    TRACE(("gdth_interrupt() index %d stat %d info %d\n",
-           IStatus,ha->status,ha->info));
+        TRACE(("gdth_interrupt() index %d stat %d info %d\n",
+               IStatus,ha->status,ha->info));
 
-    if (gdth_from_wait) {
-        wait_hanum = hanum;
-        wait_index = (int)IStatus;
-    }
+        if (gdth_from_wait) {
+            wait_hanum = hanum;
+            wait_index = (int)IStatus;
+        }
 
-    if (IStatus == ASYNCINDEX) {
-        TRACE2(("gdth_interrupt() async. event\n"));
-        gdth_async_event(hanum);
-        if (!gdth_polling)
-            GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        gdth_next(hanum);
-        return IRQ_HANDLED;
-    } 
+        if (IStatus == ASYNCINDEX) {
+            TRACE2(("gdth_interrupt() async. event\n"));
+            gdth_async_event(hanum);
+            if (!gdth_polling)
+                GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
+            gdth_next(hanum);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            return IRQ_HANDLED;
+#else
+            return;             
+#endif
+        } 
 
-    if (IStatus == SPEZINDEX) {
-        TRACE2(("Service unknown or not initialized !\n"));
-        ha->dvr.size = sizeof(ha->dvr.eu.driver);
-        ha->dvr.eu.driver.ionode = hanum;
-        gdth_store_event(ha, ES_DRIVER, 4, &ha->dvr);
-        if (!gdth_polling)
-            GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return IRQ_HANDLED;
-    }
-    scp     = ha->cmd_tab[IStatus-2].cmnd;
-    Service = ha->cmd_tab[IStatus-2].service;
-    ha->cmd_tab[IStatus-2].cmnd = UNUSED_CMND;
-    if (scp == UNUSED_CMND) {
-        TRACE2(("gdth_interrupt() index to unused command (%d)\n",IStatus));
-        ha->dvr.size = sizeof(ha->dvr.eu.driver);
-        ha->dvr.eu.driver.ionode = hanum;
-        ha->dvr.eu.driver.index = IStatus;
-        gdth_store_event(ha, ES_DRIVER, 1, &ha->dvr);
-        if (!gdth_polling)
-            GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return IRQ_HANDLED;
-    }
-    if (scp == INTERNAL_CMND) {
-        TRACE(("gdth_interrupt() answer to internal command\n"));
+        if (IStatus == SPEZINDEX) {
+            TRACE2(("Service unknown or not initialized !\n"));
+            ha->dvr.size = sizeof(ha->dvr.eu.driver);
+            ha->dvr.eu.driver.ionode = hanum;
+            gdth_store_event(ha, ES_DRIVER, 4, &ha->dvr);
+            if (!gdth_polling)
+                GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            return IRQ_HANDLED;
+#else
+            return;             
+#endif
+        }
+        scp     = ha->cmd_tab[IStatus-2].cmnd;
+        Service = ha->cmd_tab[IStatus-2].service;
+        ha->cmd_tab[IStatus-2].cmnd = UNUSED_CMND;
+        if (scp == UNUSED_CMND) {
+            TRACE2(("gdth_interrupt() index to unused command (%d)\n",IStatus));
+            ha->dvr.size = sizeof(ha->dvr.eu.driver);
+            ha->dvr.eu.driver.ionode = hanum;
+            ha->dvr.eu.driver.index = IStatus;
+            gdth_store_event(ha, ES_DRIVER, 1, &ha->dvr);
+            if (!gdth_polling)
+                GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            return IRQ_HANDLED;
+#else
+            return;             
+#endif
+        }
+        if (scp == INTERNAL_CMND) {
+            TRACE(("gdth_interrupt() answer to internal command\n"));
+            if (!gdth_polling)
+                GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            return IRQ_HANDLED;
+#else
+            return;             
+#endif
+        }
+
+        TRACE(("gdth_interrupt() sync. status\n"));
+        rval = gdth_sync_event(hanum,Service,IStatus,scp);
         if (!gdth_polling)
             GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-        return IRQ_HANDLED;
-    }
-
-    TRACE(("gdth_interrupt() sync. status\n"));
-    rval = gdth_sync_event(hanum,Service,IStatus,scp);
-    if (!gdth_polling)
-        GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags);
-    if (rval == 2) {
-        gdth_putq(hanum,scp,scp->SCp.this_residual);
-    } else if (rval == 1) {
-#if LINUX_VERSION_CODE >= 0x02053C
-        GDTH_LOCK_SCSI_DONE(scp->device->host, flags);
-        scp->scsi_done(scp);
-        GDTH_UNLOCK_SCSI_DONE(scp->device->host, flags);
-#elif LINUX_VERSION_CODE >= 0x020503
-        GDTH_LOCK_SCSI_DONE(scp->host, flags);
-        scp->scsi_done(scp);
-        GDTH_UNLOCK_SCSI_DONE(scp->host, flags);
+        if (rval == 2) {
+            gdth_putq(hanum,scp,scp->SCp.this_residual);
+        } else if (rval == 1) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            GDTH_LOCK_SCSI_DONE(scp->device->host, flags);
+            scp->scsi_done(scp);
+            GDTH_UNLOCK_SCSI_DONE(scp->device->host, flags);
 #else
-        GDTH_LOCK_SCSI_DONE(flags);
-        scp->scsi_done(scp);
-        GDTH_UNLOCK_SCSI_DONE(flags);
+            GDTH_LOCK_SCSI_DONE(flags);
+            scp->scsi_done(scp);
+            GDTH_UNLOCK_SCSI_DONE(flags);
 #endif
+        }
+
+#ifdef INT_COAL
+        if (coalesced) {
+            /* go to the next status in the status buffer */
+            ++pcs;
+#ifdef GDTH_STATISTICS
+            ++act_int_coal;
+            if (act_int_coal > max_int_coal) {
+                max_int_coal = act_int_coal;
+                printk("GDT: max_int_coal = %d\n",(ushort)max_int_coal);
+            }
+#endif      
+            /* see if there is another status */
+            if (pcs->status == 0)    
+                /* Stop the coalesce loop */
+                next = FALSE;
+        }
+    } while (next);
+
+    /* coalescing only for new GDT_PCIMPR controllers available */      
+    if (ha->type == GDT_PCIMPR && coalesced) {
+        gdth_writeb(0xff, &dp6m_ptr->i960r.edoor_reg);
+        gdth_writeb(0, &dp6m_ptr->i960r.sema1_reg);
     }
+#endif
+
     gdth_next(hanum);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     return IRQ_HANDLED;
+#endif
 }
 
 static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
@@ -3579,10 +3845,11 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
            service,ha->status));
 
     if (service == SCREENSERVICE) {
-        msg  = (gdth_msg_str *)ha->pscratch;
-        ha->scratch_busy = FALSE;
+        msg  = ha->pmsg;
         TRACE(("len: %d, answer: %d, ext: %d, alen: %d\n",
                msg->msg_len,msg->msg_answer,msg->msg_ext,msg->msg_alen));
+        if (msg->msg_len > MSGLEN+1)
+            msg->msg_len = MSGLEN+1;
         if (msg->msg_len)
             if (!(msg->msg_answer && msg->msg_ext)) {
                 msg->msg_text[msg->msg_len] = '\0';
@@ -3600,11 +3867,10 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
             cmdp->BoardNode     = LOCALBOARD;
             cmdp->u.screen.reserved  = 0;
             cmdp->u.screen.su.msg.msg_handle= msg->msg_handle;
-            cmdp->u.screen.su.msg.msg_addr  = ha->scratch_phys;
-            ha->scratch_busy = TRUE;
+            cmdp->u.screen.su.msg.msg_addr  = ha->msg_phys;
             ha->cmd_offs_dpmem = 0;
             ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.screen.su.msg.msg_addr) 
-                + sizeof(ulong32);
+                + sizeof(ulong64);
             ha->cmd_cnt = 0;
             gdth_copy_command(hanum);
             gdth_release_event(hanum);
@@ -3635,11 +3901,10 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
             cmdp->BoardNode     = LOCALBOARD;
             cmdp->u.screen.reserved  = 0;
             cmdp->u.screen.su.msg.msg_handle= msg->msg_handle;
-            cmdp->u.screen.su.msg.msg_addr  = ha->scratch_phys;
-            ha->scratch_busy = TRUE;
+            cmdp->u.screen.su.msg.msg_addr  = ha->msg_phys;
             ha->cmd_offs_dpmem = 0;
             ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.screen.su.msg.msg_addr) 
-                + sizeof(ulong32);
+                + sizeof(ulong64);
             ha->cmd_cnt = 0;
             gdth_copy_command(hanum);
             gdth_release_event(hanum);
@@ -3648,7 +3913,7 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
         printk("\n");
 
     } else {
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
         t = scp->device->id;
 #else
@@ -3666,16 +3931,20 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
             /* retry */
             return 2;
         }
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,13)
         if (scp->SCp.Status == GDTH_MAP_SG) 
             pci_unmap_sg(ha->pdev,scp->request_buffer,
                          scp->use_sg,scp->SCp.Message);
         else if (scp->SCp.Status == GDTH_MAP_SINGLE) 
-            pci_unmap_single(ha->pdev,scp->SCp.dma_handle,
-                         scp->request_bufflen,scp->SCp.Message);
-        if (scp->SCp.buffer) 
-            pci_unmap_single(ha->pdev,(dma_addr_t)scp->SCp.buffer,
-						16,PCI_DMA_FROMDEVICE);
+            pci_unmap_page(ha->pdev,scp->SCp.dma_handle,
+                           scp->request_bufflen,scp->SCp.Message);
+        if (scp->SCp.buffer) {
+            dma_addr_t addr;
+            addr = (dma_addr_t)(ulong32)scp->SCp.buffer;
+            if (scp->host_scribble)
+                addr += (dma_addr_t)((ulong64)(ulong32)scp->host_scribble << 32);               
+            pci_unmap_page(ha->pdev,addr,16,PCI_DMA_FROMDEVICE);
+        }
 #endif
         if (ha->status == S_OK) {
             scp->SCp.Status = S_OK;
@@ -3754,10 +4023,7 @@ static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp)
                     scp->sense_buffer[2] = NOT_READY;
                     scp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
                 }
-#if LINUX_VERSION_CODE >= 0x010300
-                if (scp->done != gdth_scsi_done)
-#endif  
-                {
+                if (scp->done != gdth_scsi_done) {
                     ha->dvr.size = sizeof(ha->dvr.eu.sync);
                     ha->dvr.eu.sync.ionode  = hanum;
                     ha->dvr.eu.sync.service = service;
@@ -3946,13 +4212,11 @@ static char *async_cache_tab[] = {
 static int gdth_async_event(int hanum)
 {
     gdth_ha_str *ha;
-    gdth_msg_str *msg;
     gdth_cmd_str *cmdp;
     int cmd_index;
 
     ha  = HADATA(gdth_ctr_tab[hanum]);
     cmdp= ha->pccb;
-    msg = (gdth_msg_str *)ha->pscratch;
     TRACE2(("gdth_async_event() ha %d serv %d\n",
             hanum,ha->service));
 
@@ -3968,11 +4232,10 @@ static int gdth_async_event(int hanum)
             cmdp->BoardNode     = LOCALBOARD;
             cmdp->u.screen.reserved  = 0;
             cmdp->u.screen.su.msg.msg_handle= MSG_INV_HANDLE;
-            cmdp->u.screen.su.msg.msg_addr  = ha->scratch_phys;
-            ha->scratch_busy = TRUE;
+            cmdp->u.screen.su.msg.msg_addr  = ha->msg_phys;
             ha->cmd_offs_dpmem = 0;
             ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.screen.su.msg.msg_addr) 
-                + sizeof(ulong32);
+                + sizeof(ulong64);
             ha->cmd_cnt = 0;
             gdth_copy_command(hanum);
             if (ha->type == GDT_EISA)
@@ -4192,10 +4455,11 @@ GDTH_INITFUNC(int, option_setup(char *str))
 GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
 {
     struct Scsi_Host *shp;
+    gdth_pci_str pcistr[MAXHA];
     gdth_ha_str *ha;
     ulong32 isa_bios;
     ushort eisa_slot;
-    int i,hanum,cnt,ctr;
+    int i,hanum,cnt,ctr,err;
     unchar b;
     
  
@@ -4218,11 +4482,11 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
     TRACE(("gdth_detect()\n"));
 
     if (disable) {
-        printk("GDT: Controller driver disabled from command line !\n");
+        printk("GDT-HA: Controller driver disabled from command line !\n");
         return 0;
     }
 
-    printk("GDT: Storage RAID Controller Driver. Version: %s \n",GDTH_VERSION_STR);
+    printk("GDT-HA: Storage RAID Controller Driver. Version: %s \n",GDTH_VERSION_STR);
     /* initializations */
     gdth_polling = TRUE; b = 0;
     gdth_clear_events();
@@ -4232,6 +4496,7 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
         /* scanning for controllers, at first: ISA controller */
         for (isa_bios=0xc8000UL; isa_bios<=0xd8000UL; isa_bios+=0x8000UL) {
             dma_addr_t scratch_dma_handle;
+            scratch_dma_handle = 0;
 
             if (gdth_ctr_count >= MAXHA) 
                 break;
@@ -4252,23 +4517,14 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                 printk("Configuring GDT-ISA HA at BIOS 0x%05X IRQ %u DRQ %u\n",
                        isa_bios,ha->irq,ha->drq);
 
-#if LINUX_VERSION_CODE >= 0x010346 
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha))
-#else
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth")) 
-#endif
-                {
+                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha)) {
                     printk("GDT-ISA: Unable to allocate IRQ\n");
                     scsi_unregister(shp);
                     continue;
                 }
                 if (request_dma(ha->drq,"gdth")) {
                     printk("GDT-ISA: Unable to allocate DMA channel\n");
-#if LINUX_VERSION_CODE >= 0x010346 
                     free_irq(ha->irq,ha);
-#else
-                    free_irq(ha->irq);
-#endif
                     scsi_unregister(shp);
                     continue;
                 }
@@ -4286,15 +4542,34 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
 
                 ha->pccb = CMDDATA(shp);
                 ha->ccb_phys = 0L;
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                 ha->pdev = NULL;
                 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
                                                     &scratch_dma_handle);
-                ha->scratch_phys = (ulong32)scratch_dma_handle;
+                ha->scratch_phys = scratch_dma_handle;
+                ha->pmsg = pci_alloc_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                                &scratch_dma_handle);
+                ha->msg_phys = scratch_dma_handle;
+#ifdef INT_COAL
+                ha->coal_stat = (gdth_coal_status *)
+                    pci_alloc_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                        MAXOFFSETS, &scratch_dma_handle);
+                ha->coal_stat_phys = scratch_dma_handle;
+#endif
 #else
                 ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
                 if (ha->pscratch)
                     ha->scratch_phys = virt_to_bus(ha->pscratch);
+                ha->pmsg = scsi_init_malloc(sizeof(gdth_msg_str), GFP_ATOMIC | GFP_DMA);
+                if (ha->pmsg)
+                    ha->msg_phys = virt_to_bus(ha->pmsg);
+#ifdef INT_COAL
+                ha->coal_stat = 
+                    scsi_init_malloc(sizeof(gdth_coal_status) * MAXOFFSETS, 
+                                     GFP_ATOMIC | GFP_DMA);
+                if (ha->coal_stat)
+                    ha->coal_stat_phys = virt_to_bus(ha->coal_stat);
+#endif
 #endif
                 ha->scratch_busy = FALSE;
                 ha->req_first = NULL;
@@ -4305,23 +4580,36 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                     ha->cmd_tab[i].cmnd = UNUSED_CMND;
                 ha->scan_mode = rescan ? 0x10 : 0;
 
-                if (ha->pscratch == NULL || !gdth_search_drives(hanum)) {
+                if (ha->pscratch == NULL || ha->pmsg == NULL || 
+                    !gdth_search_drives(hanum)) {
                     printk("GDT-ISA: Error during device scan\n");
                     --gdth_ctr_count;
                     --gdth_ctr_vcount;
-                    if (ha->pscratch != NULL) {
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef INT_COAL
+                    if (ha->coal_stat)
+                        pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                                            MAXOFFSETS, ha->coal_stat,
+                                            ha->coal_stat_phys);
+#endif
+                    if (ha->pscratch)
                         pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
                                             ha->pscratch, ha->scratch_phys);
+                    if (ha->pmsg)
+                        pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                            ha->pmsg, ha->msg_phys);
 #else
+#ifdef INT_COAL
+                    if (ha->coal_stat)
+                        scsi_init_free((void *)ha->coal_stat, 
+                                       sizeof(gdth_coal_status) * MAXOFFSETS);
+#endif
+                    if (ha->pscratch)
                         scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
+                    if (ha->pmsg)
+                        scsi_init_free((void *)ha->pmsg, sizeof(gdth_msg_str));
 #endif
-                    }
-#if LINUX_VERSION_CODE >= 0x010346 
                     free_irq(ha->irq,ha);
-#else
-                    free_irq(ha->irq);
-#endif
                     scsi_unregister(shp);
                     continue;
                 }
@@ -4329,13 +4617,18 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                     hdr_channel = ha->bus_cnt;
                 ha->virt_bus = hdr_channel;
 
-#if LINUX_VERSION_CODE >= 0x020000
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) && \
+    LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+                shp->highmem_io  = 0;
+#endif
+                if (ha->cache_feat & ha->raw_feat & ha->screen_feat & GDT_64BIT) 
+                    shp->max_cmd_len = 16;
+#endif
                 shp->max_id      = ha->tid_cnt;
                 shp->max_lun     = MAXLUN;
                 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
-                if (virt_ctr)  
-#endif
-                {
+                if (virt_ctr) {
                     virt_ctr = 1;
                     /* register addit. SCSI channels as virtual controllers */
                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
@@ -4358,6 +4651,7 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
         /* scanning for EISA controllers */
         for (eisa_slot=0x1000; eisa_slot<=0x8000; eisa_slot+=0x1000) {
             dma_addr_t scratch_dma_handle;
+            scratch_dma_handle = 0;
 
             if (gdth_ctr_count >= MAXHA) 
                 break;
@@ -4373,14 +4667,9 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                 }
                 /* controller found and initialized */
                 printk("Configuring GDT-EISA HA at Slot %d IRQ %u\n",
-                        eisa_slot>>12,ha->irq);
+                       eisa_slot>>12,ha->irq);
 
-#if LINUX_VERSION_CODE >= 0x010346 
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha))
-#else
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth")) 
-#endif
-                {
+                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha)) {
                     printk("GDT-EISA: Unable to allocate IRQ\n");
                     scsi_unregister(shp);
                     continue;
@@ -4399,11 +4688,20 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
 
                 ha->pccb = CMDDATA(shp);
                 ha->ccb_phys = 0L; 
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                 ha->pdev = NULL;
                 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
                                                     &scratch_dma_handle);
-                ha->scratch_phys = (ulong32) scratch_dma_handle;
+                ha->scratch_phys = scratch_dma_handle;
+                ha->pmsg = pci_alloc_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                                &scratch_dma_handle);
+                ha->msg_phys = scratch_dma_handle;
+#ifdef INT_COAL
+                ha->coal_stat = (gdth_coal_status *)
+                    pci_alloc_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                                         MAXOFFSETS, &scratch_dma_handle);
+                ha->coal_stat_phys = scratch_dma_handle;
+#endif
                 ha->ccb_phys = 
                     pci_map_single(ha->pdev,ha->pccb,
                                    sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
@@ -4411,6 +4709,16 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                 ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
                 if (ha->pscratch)
                     ha->scratch_phys = virt_to_bus(ha->pscratch);
+                ha->pmsg = scsi_init_malloc(sizeof(gdth_msg_str), GFP_ATOMIC | GFP_DMA);
+                if (ha->pmsg)
+                    ha->msg_phys = virt_to_bus(ha->pmsg);
+#ifdef INT_COAL
+                ha->coal_stat = 
+                    scsi_init_malloc(sizeof(gdth_coal_status) * MAXOFFSETS, 
+                                     GFP_ATOMIC | GFP_DMA);
+                if (ha->coal_stat)
+                    ha->coal_stat_phys = virt_to_bus(ha->coal_stat);
+#endif
                 ha->ccb_phys = virt_to_bus(ha->pccb);
 #endif
                 ha->scratch_busy = FALSE;
@@ -4419,28 +4727,42 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                 if (max_ids > 0 && max_ids < ha->tid_cnt)
                     ha->tid_cnt = max_ids;
                 for (i=0; i<GDTH_MAXCMDS; ++i)
-                     ha->cmd_tab[i].cmnd = UNUSED_CMND;
+                    ha->cmd_tab[i].cmnd = UNUSED_CMND;
                 ha->scan_mode = rescan ? 0x10 : 0;
 
-                if (ha->pscratch == NULL || !gdth_search_drives(hanum)) {
+                if (ha->pscratch == NULL || ha->pmsg == NULL || 
+                    !gdth_search_drives(hanum)) {
                     printk("GDT-EISA: Error during device scan\n");
                     --gdth_ctr_count;
                     --gdth_ctr_vcount;
-                    if (ha->pscratch != NULL) {
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef INT_COAL
+                    if (ha->coal_stat)
+                        pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                                            MAXOFFSETS, ha->coal_stat,
+                                            ha->coal_stat_phys);
+#endif
+                    if (ha->pscratch)
                         pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
                                             ha->pscratch, ha->scratch_phys);
+                    if (ha->pmsg)
+                        pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                            ha->pmsg, ha->msg_phys);
+                    if (ha->ccb_phys)
                         pci_unmap_single(ha->pdev,ha->ccb_phys,
-                                         sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
+                                        sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
 #else
+#ifdef INT_COAL
+                    if (ha->coal_stat)
+                        scsi_init_free((void *)ha->coal_stat, 
+                                       sizeof(gdth_coal_status) * MAXOFFSETS);
+#endif
+                    if (ha->pscratch)
                         scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
+                    if (ha->pmsg)
+                        scsi_init_free((void *)ha->pmsg, sizeof(gdth_msg_str));
 #endif
-                    }
-#if LINUX_VERSION_CODE >= 0x010346 
                     free_irq(ha->irq,ha);
-#else
-                    free_irq(ha->irq);
-#endif
                     scsi_unregister(shp);
                     continue;
                 }
@@ -4448,13 +4770,18 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
                     hdr_channel = ha->bus_cnt;
                 ha->virt_bus = hdr_channel;
 
-#if LINUX_VERSION_CODE >= 0x020000
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) && \
+    LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+                shp->highmem_io  = 0;
+#endif
+                if (ha->cache_feat & ha->raw_feat & ha->screen_feat & GDT_64BIT) 
+                    shp->max_cmd_len = 16;
+#endif
                 shp->max_id      = ha->tid_cnt;
                 shp->max_lun     = MAXLUN;
                 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
-                if (virt_ctr)  
-#endif
-                {
+                if (virt_ctr) {
                     virt_ctr = 1;
                     /* register addit. SCSI channels as virtual controllers */
                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
@@ -4475,124 +4802,173 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
     }
 
     /* scanning for PCI controllers */
-#if LINUX_VERSION_CODE < 0x2015C
-    if (pcibios_present())
-#endif
-    {
-        gdth_pci_str pcistr[MAXHA];
-
-        cnt = gdth_search_pci(pcistr);
-        printk("GDT: Found %d PCI Storage RAID Controllers\n",cnt);
-        gdth_sort_pci(pcistr,cnt);
-        for (ctr = 0; ctr < cnt; ++ctr) {
-            dma_addr_t scratch_dma_handle;
-
-            if (gdth_ctr_count >= MAXHA)
-                break;
-            shp = scsi_register(shtp,sizeof(gdth_ext_str));
-            if (shp == NULL)
-                continue;  
+    cnt = gdth_search_pci(pcistr);
+    printk("GDT-HA: Found %d PCI Storage RAID Controllers\n",cnt);
+    gdth_sort_pci(pcistr,cnt);
+    for (ctr = 0; ctr < cnt; ++ctr) {
+        dma_addr_t scratch_dma_handle;
+        scratch_dma_handle = 0;
+
+        if (gdth_ctr_count >= MAXHA)
+            break;
+        shp = scsi_register(shtp,sizeof(gdth_ext_str));
+        if (shp == NULL)
+            continue;  
 
-            ha = HADATA(shp);
-            if (!gdth_init_pci(&pcistr[ctr],ha)) {
-                scsi_unregister(shp);
-                continue;
-            }
-            /* controller found and initialized */
-            printk("GDT CTR%d: Configuring GDT-PCI HA at %d/%d IRQ %u\n",
-                   ctr,pcistr[ctr].bus,PCI_SLOT(pcistr[ctr].device_fn),ha->irq);
+        ha = HADATA(shp);
+        if (!gdth_init_pci(&pcistr[ctr],ha)) {
+            scsi_unregister(shp);
+            continue;
+        }
+        /* controller found and initialized */
+        printk("Configuring GDT-PCI HA at %d/%d IRQ %u\n",
+               pcistr[ctr].bus,PCI_SLOT(pcistr[ctr].device_fn),ha->irq);
 
-#if LINUX_VERSION_CODE >= 0x010346 
-            if (request_irq(ha->irq, gdth_interrupt,
-                            SA_INTERRUPT|SA_SHIRQ, "gdth", ha))
-#else
-            if (request_irq(ha->irq, gdth_interrupt,
-                            SA_INTERRUPT|SA_SHIRQ, "gdth")) 
+        if (request_irq(ha->irq, gdth_interrupt,
+                        SA_INTERRUPT|SA_SHIRQ, "gdth", ha))
+        {
+            printk("GDT-PCI: Unable to allocate IRQ\n");
+            scsi_unregister(shp);
+            continue;
+        }
+        shp->unchecked_isa_dma = 0;
+        shp->irq = ha->irq;
+        shp->dma_channel = 0xff;
+        hanum = gdth_ctr_count;
+        gdth_ctr_tab[gdth_ctr_count++] = shp;
+        gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
+
+        NUMDATA(shp)->hanum = (ushort)hanum;
+        NUMDATA(shp)->busnum= 0;
+
+        ha->pccb = CMDDATA(shp);
+        ha->ccb_phys = 0L;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
+                                            &scratch_dma_handle);
+        ha->scratch_phys = scratch_dma_handle;
+        ha->pmsg = pci_alloc_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                        &scratch_dma_handle);
+        ha->msg_phys = scratch_dma_handle;
+#ifdef INT_COAL
+        ha->coal_stat = (gdth_coal_status *)
+            pci_alloc_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                                 MAXOFFSETS, &scratch_dma_handle);
+        ha->coal_stat_phys = scratch_dma_handle;
 #endif
-            {
-                printk("GDT-PCI: Unable to allocate IRQ\n");
-                scsi_unregister(shp);
-                continue;
-            }
-            shp->unchecked_isa_dma = 0;
-            shp->irq = ha->irq;
-            shp->dma_channel = 0xff;
-            hanum = gdth_ctr_count;
-            gdth_ctr_tab[gdth_ctr_count++] = shp;
-            gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
-
-            NUMDATA(shp)->hanum = (ushort)hanum;
-            NUMDATA(shp)->busnum= 0;
-
-            ha->pccb = CMDDATA(shp);
-            ha->ccb_phys = 0L;
-#if LINUX_VERSION_CODE >= 0x020400
-            ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
-                                                &scratch_dma_handle);
-            ha->scratch_phys = (ulong32)scratch_dma_handle;
-#else
-            ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
-            if (ha->pscratch)
-                ha->scratch_phys = virt_to_bus(ha->pscratch);
-#endif
-            ha->scratch_busy = FALSE;
-            ha->req_first = NULL;
-            ha->tid_cnt = pcistr[ctr].device_id >= 0x200 ? MAXID : MAX_HDRIVES;
-            if (max_ids > 0 && max_ids < ha->tid_cnt)
-                ha->tid_cnt = max_ids;
-            for (i=0; i<GDTH_MAXCMDS; ++i)
-                ha->cmd_tab[i].cmnd = UNUSED_CMND;
-            ha->scan_mode = rescan ? 0x10 : 0;
-
-            if (ha->pscratch == NULL || !gdth_search_drives(hanum)) {
-                printk("GDT-PCI: Error during device scan\n");
-                --gdth_ctr_count;
-                --gdth_ctr_vcount;
-                if (ha->pscratch != NULL) {
-#if LINUX_VERSION_CODE >= 0x020400
-                    pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
-                                        ha->pscratch, ha->scratch_phys);
 #else
-                    scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
+        ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
+        if (ha->pscratch)
+            ha->scratch_phys = virt_to_bus(ha->pscratch);
+        ha->pmsg = scsi_init_malloc(sizeof(gdth_msg_str), GFP_ATOMIC | GFP_DMA);
+        if (ha->pmsg)
+            ha->msg_phys = virt_to_bus(ha->pmsg);
+#ifdef INT_COAL
+        ha->coal_stat = 
+            scsi_init_malloc(sizeof(gdth_coal_status) * MAXOFFSETS, 
+                             GFP_ATOMIC | GFP_DMA);
+        if (ha->coal_stat)
+            ha->coal_stat_phys = virt_to_bus(ha->coal_stat);
 #endif
-                }
-#if LINUX_VERSION_CODE >= 0x010346 
-                free_irq(ha->irq,ha);
-#else
-                free_irq(ha->irq);
 #endif
-                scsi_unregister(shp);
-                continue;
-            }
+        ha->scratch_busy = FALSE;
+        ha->req_first = NULL;
+        ha->tid_cnt = pcistr[ctr].device_id >= 0x200 ? MAXID : MAX_HDRIVES;
+        if (max_ids > 0 && max_ids < ha->tid_cnt)
+            ha->tid_cnt = max_ids;
+        for (i=0; i<GDTH_MAXCMDS; ++i)
+            ha->cmd_tab[i].cmnd = UNUSED_CMND;
+        ha->scan_mode = rescan ? 0x10 : 0;
+
+        err = FALSE;
+        if (ha->pscratch == NULL || ha->pmsg == NULL || 
+            !gdth_search_drives(hanum)) {
+            err = TRUE;
+        } else {
             if (hdr_channel < 0 || hdr_channel > ha->bus_cnt)
                 hdr_channel = ha->bus_cnt;
             ha->virt_bus = hdr_channel;
 
-#if LINUX_VERSION_CODE >= 0x020000
-            shp->max_id      = ha->tid_cnt;
-            shp->max_lun     = MAXLUN;
-            shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
-            if (virt_ctr)  
-#endif
-            {
-                virt_ctr = 1;
-                /* register addit. SCSI channels as virtual controllers */
-                for (b = 1; b < ha->bus_cnt + 1; ++b) {
-                    shp = scsi_register(shtp,sizeof(gdth_num_str));
-                    shp->unchecked_isa_dma = 0;
-                    shp->irq = ha->irq;
-                    shp->dma_channel = 0xff;
-                    gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
-                    NUMDATA(shp)->hanum = (ushort)hanum;
-                    NUMDATA(shp)->busnum = b;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            scsi_set_device(shp, &pcistr[ctr].pdev->dev);
+#else
+            scsi_set_pci_device(shp, pcistr[ctr].pdev);
+#endif
+            if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)||
+                /* 64-bit DMA only supported from FW >= x.43 */
+                (!ha->dma64_support)) {
+                if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) {
+                    printk(KERN_WARNING "GDT-PCI %d: Unable to set 32-bit DMA\n", hanum);
+                    err = TRUE;
+                }
+            } else {
+                shp->max_cmd_len = 16;
+                if (!pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffffffffffffULL)) {
+                    printk("GDT-PCI %d: 64-bit DMA enabled\n", hanum);
+                } else if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) {
+                    printk(KERN_WARNING "GDT-PCI %d: Unable to set 64/32-bit DMA\n", hanum);
+                    err = TRUE;
                 }
-            }  
+            }
+#endif
+        }
 
-            GDTH_INIT_LOCK_HA(ha);
-            gdth_enable_int(hanum);
+        if (err) {
+            printk("GDT-PCI %d: Error during device scan\n", hanum);
+            --gdth_ctr_count;
+            --gdth_ctr_vcount;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef INT_COAL
+            if (ha->coal_stat)
+                pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                                    MAXOFFSETS, ha->coal_stat,
+                                    ha->coal_stat_phys);
+#endif
+            if (ha->pscratch)
+                pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
+                                    ha->pscratch, ha->scratch_phys);
+            if (ha->pmsg)
+                pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                    ha->pmsg, ha->msg_phys);
+#else
+#ifdef INT_COAL
+            if (ha->coal_stat)
+                scsi_init_free((void *)ha->coal_stat, 
+                               sizeof(gdth_coal_status) * MAXOFFSETS);
+#endif
+            if (ha->pscratch)
+                scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
+            if (ha->pmsg)
+                scsi_init_free((void *)ha->pmsg, sizeof(gdth_msg_str));
+#endif
+            free_irq(ha->irq,ha);
+            scsi_unregister(shp);
+            continue;
         }
-    }
 
+        shp->max_id      = ha->tid_cnt;
+        shp->max_lun     = MAXLUN;
+        shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
+        if (virt_ctr) {
+            virt_ctr = 1;
+            /* register addit. SCSI channels as virtual controllers */
+            for (b = 1; b < ha->bus_cnt + 1; ++b) {
+                shp = scsi_register(shtp,sizeof(gdth_num_str));
+                shp->unchecked_isa_dma = 0;
+                shp->irq = ha->irq;
+                shp->dma_channel = 0xff;
+                gdth_ctr_vtab[gdth_ctr_vcount++] = shp;
+                NUMDATA(shp)->hanum = (ushort)hanum;
+                NUMDATA(shp)->busnum = b;
+            }
+        }  
+
+
+        GDTH_INIT_LOCK_HA(ha);
+        gdth_enable_int(hanum);
+    }
+    
     TRACE2(("gdth_detect() %d controller detected\n",gdth_ctr_count));
     if (gdth_ctr_count > 0) {
 #ifdef GDTH_STATISTICS
@@ -4603,12 +4979,8 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
         gdth_timer.function = gdth_timeout;
         add_timer(&gdth_timer);
 #endif
-#ifdef GDTH_IOCTL_CHRDEV
         major = register_chrdev(0,"gdth",&gdth_fops);
-#endif
-#if LINUX_VERSION_CODE >= 0x020100
         register_reboot_notifier(&gdth_notifier);
-#endif
     }
     gdth_polling = FALSE;
     return gdth_ctr_vcount;
@@ -4624,30 +4996,47 @@ int gdth_release(struct Scsi_Host *shp)
     if (NUMDATA(shp)->busnum == 0) {
         hanum = NUMDATA(shp)->hanum;
         ha    = HADATA(gdth_ctr_tab[hanum]);
-#if LINUX_VERSION_CODE >= 0x010300
-        gdth_flush(hanum);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        if (ha->sdev) {
+            scsi_free_host_dev(ha->sdev);
+            ha->sdev = NULL;
+        }
 #endif
+        gdth_flush(hanum);
 
         if (shp->irq) {
-#if LINUX_VERSION_CODE >= 0x010346
             free_irq(shp->irq,ha);
-#else
-            free_irq(shp->irq);
-#endif
         }
 #ifndef __ia64__
         if (shp->dma_channel != 0xff) {
             free_dma(shp->dma_channel);
         }
 #endif
-#if LINUX_VERSION_CODE >= 0x020400
-        pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
-            ha->pscratch, ha->scratch_phys);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef INT_COAL
+        if (ha->coal_stat)
+            pci_free_consistent(ha->pdev, sizeof(gdth_coal_status) *
+                                MAXOFFSETS, ha->coal_stat, ha->coal_stat_phys);
+#endif
+        if (ha->pscratch)
+            pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
+                                ha->pscratch, ha->scratch_phys);
+        if (ha->pmsg)
+            pci_free_consistent(ha->pdev, sizeof(gdth_msg_str), 
+                                ha->pmsg, ha->msg_phys);
         if (ha->ccb_phys)
             pci_unmap_single(ha->pdev,ha->ccb_phys,
                              sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
 #else
-        scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
+#ifdef INT_COAL
+        if (ha->coal_stat)
+            scsi_init_free((void *)ha->coal_stat, 
+                           sizeof(gdth_coal_status) * MAXOFFSETS);
+#endif
+        if (ha->pscratch)
+            scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
+        if (ha->pmsg)
+            scsi_init_free((void *)ha->pmsg, sizeof(gdth_msg_str));
 #endif
         gdth_ctr_released++;
         TRACE2(("gdth_release(): HA %d of %d\n", 
@@ -4657,12 +5046,8 @@ int gdth_release(struct Scsi_Host *shp)
 #ifdef GDTH_STATISTICS
             del_timer(&gdth_timer);
 #endif
-#ifdef GDTH_IOCTL_CHRDEV
             unregister_chrdev(major,"gdth");
-#endif
-#if LINUX_VERSION_CODE >= 0x020100
             unregister_reboot_notifier(&gdth_notifier);
-#endif
         }
     }
 
@@ -4715,6 +5100,7 @@ const char *gdth_info(struct Scsi_Host *shp)
     return ((const char *)ha->binfo.type_string);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
 /* old error handling */
 int gdth_abort(Scsi_Cmnd *scp)
 {
@@ -4722,17 +5108,13 @@ int gdth_abort(Scsi_Cmnd *scp)
     return SCSI_ABORT_SNOOZE;
 }
 
-#if LINUX_VERSION_CODE >= 0x010346
 int gdth_reset(Scsi_Cmnd *scp, unsigned int reset_flags)
-#else
-int gdth_reset(Scsi_Cmnd *scp)
-#endif
 {
     TRACE2(("gdth_reset()\n"));
     return SCSI_RESET_PUNT;
 }
+#endif
 
-#if LINUX_VERSION_CODE >= 0x02015F
 /* new error handling */
 int gdth_eh_abort(Scsi_Cmnd *scp)
 {
@@ -4755,7 +5137,7 @@ int gdth_eh_bus_reset(Scsi_Cmnd *scp)
     unchar b;
 
     TRACE2(("gdth_eh_bus_reset()\n"));
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     hanum = NUMDATA(scp->device->host)->hanum;
     b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
 #else
@@ -4768,7 +5150,7 @@ int gdth_eh_bus_reset(Scsi_Cmnd *scp)
     GDTH_LOCK_HA(ha, flags);
     for (i = 0; i < GDTH_MAXCMDS; ++i) {
         cmnd = ha->cmd_tab[i].cmnd;
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         if (!SPECIAL_SCP(cmnd) && cmnd->device->channel == b)
 #else
         if (!SPECIAL_SCP(cmnd) && cmnd->channel == b)
@@ -4813,15 +5195,12 @@ int gdth_eh_host_reset(Scsi_Cmnd *scp)
     TRACE2(("gdth_eh_host_reset()\n"));
     return FAILED;
 }
-#endif
 
 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip)
-#elif LINUX_VERSION_CODE >= 0x010300
-int gdth_bios_param(Disk *disk,kdev_t dev,int *ip)
 #else
-int gdth_bios_param(Disk *disk,int dev,int *ip)
+int gdth_bios_param(Disk *disk,kdev_t dev,int *ip)
 #endif
 {
     unchar b, t;
@@ -4830,7 +5209,7 @@ int gdth_bios_param(Disk *disk,int dev,int *ip)
     struct scsi_device *sd;
     unsigned capacity;
 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     sd = sdev;
     capacity = cap;
 #else
@@ -4872,7 +5251,7 @@ int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *))
     scp->SCp.sent_command = -1;
     scp->SCp.Status = GDTH_MAP_NONE;
     scp->SCp.buffer = (struct scatterlist *)NULL;
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     hanum = NUMDATA(scp->device->host)->hanum;
 #else
     hanum = NUMDATA(scp->host)->hanum;
@@ -4882,19 +5261,28 @@ int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *))
 #endif
 
     priority = DEFAULT_PRI;
-#if LINUX_VERSION_CODE >= 0x010300
     if (scp->done == gdth_scsi_done)
         priority = scp->SCp.this_residual;
-#endif
     gdth_update_timeout(hanum, scp, scp->timeout_per_command * 6);
     gdth_putq( hanum, scp, priority );
     gdth_next( hanum );
     return 0;
 }
 
-#ifdef GDTH_IOCTL_CHRDEV
+
 static int gdth_open(struct inode *inode, struct file *filep)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    gdth_ha_str *ha;
+    int i;
+
+    for (i = 0; i < gdth_ctr_count; i++) {
+        ha = HADATA(gdth_ctr_tab[i]);
+        if (!ha->sdev)
+            ha->sdev = scsi_get_host_dev(gdth_ctr_tab[i]);
+    }
+#endif
+
     TRACE(("gdth_open()\n"));
     return 0;
 }
@@ -4905,542 +5293,584 @@ static int gdth_close(struct inode *inode, struct file *filep)
     return 0;
 }
 
-static int ioc_event(unsigned long arg)
+static int ioc_event(void __user *arg)
 {
-        gdth_ioctl_event evt;
-        gdth_ha_str *ha;
-        ulong flags;
+    gdth_ioctl_event evt;
+    gdth_ha_str *ha;
+    ulong flags;
 
-        if (copy_from_user(&evt, (char *)arg, sizeof(gdth_ioctl_event)) ||
-            evt.ionode >= gdth_ctr_count)
-            return -EFAULT;
-        ha = HADATA(gdth_ctr_tab[evt.ionode]);
-
-        if (evt.erase == 0xff) {
-            if (evt.event.event_source == ES_TEST)
-                evt.event.event_data.size=sizeof(evt.event.event_data.eu.test); 
-            else if (evt.event.event_source == ES_DRIVER)
-                evt.event.event_data.size=sizeof(evt.event.event_data.eu.driver); 
-            else if (evt.event.event_source == ES_SYNC)
-                evt.event.event_data.size=sizeof(evt.event.event_data.eu.sync); 
-            else
-                evt.event.event_data.size=sizeof(evt.event.event_data.eu.async);
+    if (copy_from_user(&evt, arg, sizeof(gdth_ioctl_event)) ||
+        evt.ionode >= gdth_ctr_count)
+        return -EFAULT;
+    ha = HADATA(gdth_ctr_tab[evt.ionode]);
+
+    if (evt.erase == 0xff) {
+        if (evt.event.event_source == ES_TEST)
+            evt.event.event_data.size=sizeof(evt.event.event_data.eu.test); 
+        else if (evt.event.event_source == ES_DRIVER)
+            evt.event.event_data.size=sizeof(evt.event.event_data.eu.driver); 
+        else if (evt.event.event_source == ES_SYNC)
+            evt.event.event_data.size=sizeof(evt.event.event_data.eu.sync); 
+        else
+            evt.event.event_data.size=sizeof(evt.event.event_data.eu.async);
+        GDTH_LOCK_HA(ha, flags);
+        gdth_store_event(ha, evt.event.event_source, evt.event.event_idx,
+                         &evt.event.event_data);
+        GDTH_UNLOCK_HA(ha, flags);
+    } else if (evt.erase == 0xfe) {
+        gdth_clear_events();
+    } else if (evt.erase == 0) {
+        evt.handle = gdth_read_event(ha, evt.handle, &evt.event);
+    } else {
+        gdth_readapp_event(ha, evt.erase, &evt.event);
+    }     
+    if (copy_to_user(arg, &evt, sizeof(gdth_ioctl_event)))
+        return -EFAULT;
+    return 0;
+}
+
+static int ioc_lockdrv(void __user *arg)
+{
+    gdth_ioctl_lockdrv ldrv;
+    unchar i, j;
+    ulong flags;
+    gdth_ha_str *ha;
+
+    if (copy_from_user(&ldrv, arg, sizeof(gdth_ioctl_lockdrv)) ||
+        ldrv.ionode >= gdth_ctr_count)
+        return -EFAULT;
+    ha = HADATA(gdth_ctr_tab[ldrv.ionode]);
+ 
+    for (i = 0; i < ldrv.drive_cnt && i < MAX_HDRIVES; ++i) {
+        j = ldrv.drives[i];
+        if (j >= MAX_HDRIVES || !ha->hdr[j].present)
+            continue;
+        if (ldrv.lock) {
             GDTH_LOCK_HA(ha, flags);
-            gdth_store_event(ha, evt.event.event_source, evt.event.event_idx,
-                             &evt.event.event_data);
+            ha->hdr[j].lock = 1;
             GDTH_UNLOCK_HA(ha, flags);
-        } else if (evt.erase == 0xfe) {
-            gdth_clear_events();
-        } else if (evt.erase == 0) {
-            evt.handle = gdth_read_event(ha, evt.handle, &evt.event);
+            gdth_wait_completion(ldrv.ionode, ha->bus_cnt, j); 
+            gdth_stop_timeout(ldrv.ionode, ha->bus_cnt, j); 
         } else {
-            gdth_readapp_event(ha, evt.erase, &evt.event);
-        }     
-        if (copy_to_user((char *)arg, &evt, sizeof(gdth_ioctl_event)))
-            return -EFAULT;
-        return 0;
+            GDTH_LOCK_HA(ha, flags);
+            ha->hdr[j].lock = 0;
+            GDTH_UNLOCK_HA(ha, flags);
+            gdth_start_timeout(ldrv.ionode, ha->bus_cnt, j); 
+            gdth_next(ldrv.ionode); 
+        }
+    } 
+    return 0;
 }
 
-static int ioc_lockdrv(unsigned long arg)
+static int ioc_resetdrv(void __user *arg, char *cmnd)
 {
-        gdth_ioctl_lockdrv ldrv;
-        unchar i, j;
-        ulong flags;
-        gdth_ha_str *ha;
+    gdth_ioctl_reset res;
+    gdth_cmd_str cmd;
+    int hanum;
+    gdth_ha_str *ha;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        Scsi_Request *srp;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        Scsi_Cmnd *scp;
+#else
+        Scsi_Cmnd scp;
+#endif
 
-        if (copy_from_user(&ldrv, (char *)arg, sizeof(gdth_ioctl_lockdrv)) ||
-            ldrv.ionode >= gdth_ctr_count)
-            return -EFAULT;
-        ha = HADATA(gdth_ctr_tab[ldrv.ionode]);
+    if (copy_from_user(&res, arg, sizeof(gdth_ioctl_reset)) ||
+        res.ionode >= gdth_ctr_count || res.number >= MAX_HDRIVES)
+        return -EFAULT;
+    hanum = res.ionode;
+    ha = HADATA(gdth_ctr_tab[hanum]);
  
-        for (i = 0; i < ldrv.drive_cnt && i < MAX_HDRIVES; ++i) {
-            j = ldrv.drives[i];
-            if (j >= MAX_HDRIVES || !ha->hdr[j].present)
-                continue;
-            if (ldrv.lock) {
-                GDTH_LOCK_HA(ha, flags);
-                ha->hdr[j].lock = 1;
-                GDTH_UNLOCK_HA(ha, flags);
-                gdth_wait_completion(ldrv.ionode, ha->bus_cnt, j); 
-                gdth_stop_timeout(ldrv.ionode, ha->bus_cnt, j); 
-            } else {
-                GDTH_LOCK_HA(ha, flags);
-                ha->hdr[j].lock = 0;
-                GDTH_UNLOCK_HA(ha, flags);
-                gdth_start_timeout(ldrv.ionode, ha->bus_cnt, j); 
-                gdth_next(ldrv.ionode); 
-            }
-        } 
+    if (!ha->hdr[res.number].present)
         return 0;
+    memset(&cmd, 0, sizeof(gdth_cmd_str));
+    cmd.Service = CACHESERVICE;
+    cmd.OpCode = GDT_CLUST_RESET;
+    if (ha->cache_feat & GDT_64BIT)
+        cmd.u.cache64.DeviceNo = res.number;
+    else
+        cmd.u.cache.DeviceNo = res.number;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    srp  = scsi_allocate_request(ha->sdev, GFP_KERNEL);
+    if (!srp)
+        return -ENOMEM;
+    srp->sr_cmd_len = 12;
+    srp->sr_use_sg = 0;
+    gdth_do_req(srp, &cmd, cmnd, 30);
+    res.status = (ushort)srp->sr_command->SCp.Status;
+    scsi_release_request(srp);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    scp  = scsi_allocate_device(ha->sdev, 1, FALSE);
+    if (!scp)
+        return -ENOMEM;
+    scp->cmd_len = 12;
+    scp->use_sg = 0;
+    gdth_do_cmd(scp, &cmd, cmnd, 30);
+    res.status = (ushort)scp->SCp.Status;
+    scsi_release_command(scp);
+#else
+    memset(&ha->sdev,0,sizeof(Scsi_Device));
+    memset(&scp, 0,sizeof(Scsi_Cmnd));
+    ha->sdev.host = scp.host = gdth_ctr_tab[hanum];
+    ha->sdev.id = scp.target = ha->sdev.host->this_id;
+    scp.device = &ha->sdev;
+    gdth_do_cmd(&scp, &cmd, cmnd, 30);
+    res.status = (ushort)scp.SCp.Status;
+#endif
+    if (copy_to_user(arg, &res, sizeof(gdth_ioctl_reset)))
+        return -EFAULT;
+    return 0;
 }
 
-static int ioc_resetdrv(unsigned long arg, char *cmnd)
+static int ioc_general(void __user *arg, char *cmnd)
 {
-        gdth_ioctl_reset res;
-        gdth_cmd_str cmd;
-        int hanum;
-        gdth_ha_str *ha;
-#if LINUX_VERSION_CODE >= 0x020503
-	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
+    gdth_ioctl_general gen;
+    char *buf = NULL;
+    ulong64 paddr; 
+    int hanum;
+        gdth_ha_str *ha; 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        Scsi_Request *srp;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        Scsi_Cmnd *scp;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+        Scsi_Cmnd scp;
 #endif
-
-        if (copy_from_user(&res, (char *)arg, sizeof(gdth_ioctl_reset)) ||
-            res.ionode >= gdth_ctr_count || res.number >= MAX_HDRIVES)
+        
+    if (copy_from_user(&gen, arg, sizeof(gdth_ioctl_general)) ||
+        gen.ionode >= gdth_ctr_count)
+        return -EFAULT;
+    hanum = gen.ionode; 
+    ha = HADATA(gdth_ctr_tab[hanum]);
+    if (gen.data_len + gen.sense_len != 0) {
+        if (!(buf = gdth_ioctl_alloc(hanum, gen.data_len + gen.sense_len, 
+                                     FALSE, &paddr)))
             return -EFAULT;
-        hanum = res.ionode;
-        ha = HADATA(gdth_ctr_tab[hanum]);
- 
-        if (!ha->hdr[res.number].present)
-            return 0;
-        cmd.Service = CACHESERVICE;
-        cmd.OpCode = GDT_CLUST_RESET;
-        cmd.u.cache.DeviceNo = res.number;
-#if LINUX_VERSION_CODE >= 0x020503
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        srp  = scsi_allocate_request(sdev, GFP_KERNEL);
-        if (!srp)
-            return -ENOMEM;
-        srp->sr_cmd_len = 12;
-        srp->sr_use_sg = 0;
-        gdth_do_req(srp, &cmd, cmnd, 30);
-        res.status = (ushort)srp->sr_command->SCp.Status;
-        scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        scp  = scsi_allocate_device(sdev, 1, FALSE);
-        if (!scp)
-            return -ENOMEM;
-        scp->cmd_len = 12;
-        scp->use_sg = 0;
-        gdth_do_cmd(scp, &cmd, cmnd, 30);
-        res.status = (ushort)scp->SCp.Status;
-        scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
-#else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
-        gdth_do_cmd(&scp, &cmd, cmnd, 30);
-        res.status = (ushort)scp.SCp.Status;
-#endif
-        if (copy_to_user((char *)arg, &res, sizeof(gdth_ioctl_reset)))
-            return -EFAULT;
-        return 0;
-}
-
-static int ioc_general(unsigned long arg, char *cmnd)
-{
-        gdth_ioctl_general gen;
-        char *buf = NULL;
-        ulong32 paddr; 
-        int hanum;
-	gdth_ha_str *ha; 
-#if LINUX_VERSION_CODE >= 0x020503
-	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
-#else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
-#endif
-        
-        if (copy_from_user(&gen, (char *)arg, sizeof(gdth_ioctl_general)) ||
-            gen.ionode >= gdth_ctr_count)
+        if (copy_from_user(buf, arg + sizeof(gdth_ioctl_general),  
+                           gen.data_len + gen.sense_len)) {
+            gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
             return -EFAULT;
-        hanum = gen.ionode; 
-        ha = HADATA(gdth_ctr_tab[hanum]);
-        if (gen.data_len + gen.sense_len != 0) {
-            if (!(buf = gdth_ioctl_alloc(hanum, gen.data_len + gen.sense_len, 
-                                         FALSE, &paddr)))
-                return -EFAULT;
-            if (copy_from_user(buf, (char *)arg + sizeof(gdth_ioctl_general),  
-                               gen.data_len + gen.sense_len)) {
-                gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
-                return -EFAULT;
-            }
+        }
 
-            if (gen.command.OpCode == GDT_IOCTL) {
-                gen.command.u.ioctl.p_param = paddr;
-            } else if (gen.command.Service == CACHESERVICE) {
+        if (gen.command.OpCode == GDT_IOCTL) {
+            gen.command.u.ioctl.p_param = paddr;
+        } else if (gen.command.Service == CACHESERVICE) {
+            if (ha->cache_feat & GDT_64BIT) {
+                /* copy elements from 32-bit IOCTL structure */
+                gen.command.u.cache64.BlockCnt = gen.command.u.cache.BlockCnt;
+                gen.command.u.cache64.BlockNo = gen.command.u.cache.BlockNo;
+                gen.command.u.cache64.DeviceNo = gen.command.u.cache.DeviceNo;
+                /* addresses */
+                if (ha->cache_feat & SCATTER_GATHER) {
+                    gen.command.u.cache64.DestAddr = (ulong64)-1;
+                    gen.command.u.cache64.sg_canz = 1;
+                    gen.command.u.cache64.sg_lst[0].sg_ptr = paddr;
+                    gen.command.u.cache64.sg_lst[0].sg_len = gen.data_len;
+                    gen.command.u.cache64.sg_lst[1].sg_len = 0;
+                } else {
+                    gen.command.u.cache64.DestAddr = paddr;
+                    gen.command.u.cache64.sg_canz = 0;
+                }
+            } else {
                 if (ha->cache_feat & SCATTER_GATHER) {
                     gen.command.u.cache.DestAddr = 0xffffffff;
                     gen.command.u.cache.sg_canz = 1;
-                    gen.command.u.cache.sg_lst[0].sg_ptr = paddr;
+                    gen.command.u.cache.sg_lst[0].sg_ptr = (ulong32)paddr;
                     gen.command.u.cache.sg_lst[0].sg_len = gen.data_len;
                     gen.command.u.cache.sg_lst[1].sg_len = 0;
                 } else {
                     gen.command.u.cache.DestAddr = paddr;
                     gen.command.u.cache.sg_canz = 0;
                 }
-            } else if (gen.command.Service == SCSIRAWSERVICE) {
+            }
+        } else if (gen.command.Service == SCSIRAWSERVICE) {
+            if (ha->raw_feat & GDT_64BIT) {
+                /* copy elements from 32-bit IOCTL structure */
+                char cmd[16];
+                gen.command.u.raw64.sense_len = gen.command.u.raw.sense_len;
+                gen.command.u.raw64.bus = gen.command.u.raw.bus;
+                gen.command.u.raw64.lun = gen.command.u.raw.lun;
+                gen.command.u.raw64.target = gen.command.u.raw.target;
+                memcpy(cmd, gen.command.u.raw.cmd, 16);
+                memcpy(gen.command.u.raw64.cmd, cmd, 16);
+                gen.command.u.raw64.clen = gen.command.u.raw.clen;
+                gen.command.u.raw64.sdlen = gen.command.u.raw.sdlen;
+                gen.command.u.raw64.direction = gen.command.u.raw.direction;
+                /* addresses */
+                if (ha->raw_feat & SCATTER_GATHER) {
+                    gen.command.u.raw64.sdata = (ulong64)-1;
+                    gen.command.u.raw64.sg_ranz = 1;
+                    gen.command.u.raw64.sg_lst[0].sg_ptr = paddr;
+                    gen.command.u.raw64.sg_lst[0].sg_len = gen.data_len;
+                    gen.command.u.raw64.sg_lst[1].sg_len = 0;
+                } else {
+                    gen.command.u.raw64.sdata = paddr;
+                    gen.command.u.raw64.sg_ranz = 0;
+                }
+                gen.command.u.raw64.sense_data = paddr + gen.data_len;
+            } else {
                 if (ha->raw_feat & SCATTER_GATHER) {
                     gen.command.u.raw.sdata = 0xffffffff;
                     gen.command.u.raw.sg_ranz = 1;
-                    gen.command.u.raw.sg_lst[0].sg_ptr = paddr;
+                    gen.command.u.raw.sg_lst[0].sg_ptr = (ulong32)paddr;
                     gen.command.u.raw.sg_lst[0].sg_len = gen.data_len;
                     gen.command.u.raw.sg_lst[1].sg_len = 0;
                 } else {
                     gen.command.u.raw.sdata = paddr;
                     gen.command.u.raw.sg_ranz = 0;
                 }
-                gen.command.u.raw.sense_data = paddr + gen.data_len;
-
-            } else {
-                gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
-                return -EFAULT;
+                gen.command.u.raw.sense_data = (ulong32)paddr + gen.data_len;
             }
+        } else {
+            gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
+            return -EFAULT;
         }
+    }
 
-#if LINUX_VERSION_CODE >= 0x020503
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        srp  = scsi_allocate_request(sdev, GFP_KERNEL);
-        if (!srp)
-            return -ENOMEM;
-        srp->sr_cmd_len = 12;
-        srp->sr_use_sg = 0;
-        gdth_do_req(srp, &gen.command, cmnd, gen.timeout);
-        gen.status = srp->sr_command->SCp.Status;
-        gen.info = srp->sr_command->SCp.Message;
-        scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        scp  = scsi_allocate_device(sdev, 1, FALSE);
-        if (!scp)
-            return -ENOMEM;
-        scp->cmd_len = 12;
-        scp->use_sg = 0;
-        gdth_do_cmd(scp, &gen.command, cmnd, gen.timeout);
-        gen.status = scp->SCp.Status;
-        gen.info = scp->SCp.Message;
-        scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    srp  = scsi_allocate_request(ha->sdev, GFP_KERNEL);
+    if (!srp)
+        return -ENOMEM;
+    srp->sr_cmd_len = 12;
+    srp->sr_use_sg = 0;
+    gdth_do_req(srp, &gen.command, cmnd, gen.timeout);
+    gen.status = srp->sr_command->SCp.Status;
+    gen.info = srp->sr_command->SCp.Message;
+    scsi_release_request(srp);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    scp  = scsi_allocate_device(ha->sdev, 1, FALSE);
+    if (!scp)
+        return -ENOMEM;
+    scp->cmd_len = 12;
+    scp->use_sg = 0;
+    gdth_do_cmd(scp, &gen.command, cmnd, gen.timeout);
+    gen.status = scp->SCp.Status;
+    gen.info = scp->SCp.Message;
+    scsi_release_command(scp);
 #else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
-        gdth_do_cmd(&scp, &gen.command, cmnd, gen.timeout);
-        gen.status = scp.SCp.Status;
-        gen.info = scp.SCp.Message;
+    memset(&ha->sdev,0,sizeof(Scsi_Device));
+    memset(&scp, 0,sizeof(Scsi_Cmnd));
+    ha->sdev.host = scp.host = gdth_ctr_tab[hanum];
+    ha->sdev.id = scp.target = ha->sdev.host->this_id;
+    scp.device = &ha->sdev;
+    gdth_do_cmd(&scp, &gen.command, cmnd, gen.timeout);
+    gen.status = scp.SCp.Status;
+    gen.info = scp.SCp.Message;
 #endif
 
-        if (copy_to_user((char *)arg + sizeof(gdth_ioctl_general), buf, 
-                         gen.data_len + gen.sense_len)) {
-            gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
-            return -EFAULT; 
-        } 
-        if (copy_to_user((char *)arg, &gen, 
-            sizeof(gdth_ioctl_general) - sizeof(gdth_cmd_str))) {
-            gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
-            return -EFAULT;
-        }
+    if (copy_to_user(arg + sizeof(gdth_ioctl_general), buf, 
+                     gen.data_len + gen.sense_len)) {
         gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
-        return 0;
+        return -EFAULT; 
+    } 
+    if (copy_to_user(arg, &gen, 
+        sizeof(gdth_ioctl_general) - sizeof(gdth_cmd_str))) {
+        gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
+        return -EFAULT;
+    }
+    gdth_ioctl_free(hanum, gen.data_len+gen.sense_len, buf, paddr);
+    return 0;
 }
  
-static int ioc_hdrlist(unsigned long arg, char *cmnd)
+static int ioc_hdrlist(void __user *arg, char *cmnd)
 {
-        gdth_ioctl_rescan rsc;
-        gdth_cmd_str cmd;
-        gdth_ha_str *ha;
-        unchar i;
-        int hanum;
-#if LINUX_VERSION_CODE >= 0x020503
-	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
+    gdth_ioctl_rescan rsc;
+    gdth_cmd_str cmd;
+    gdth_ha_str *ha;
+    unchar i;
+    int hanum;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    Scsi_Request *srp;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    Scsi_Cmnd *scp;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+    Scsi_Cmnd scp;
 #endif
         
-        if (copy_from_user(&rsc, (char *)arg, sizeof(gdth_ioctl_rescan)) ||
-            rsc.ionode >= gdth_ctr_count)
-            return -EFAULT;
-        hanum = rsc.ionode;
-        ha = HADATA(gdth_ctr_tab[hanum]);
+    if (copy_from_user(&rsc, arg, sizeof(gdth_ioctl_rescan)) ||
+        rsc.ionode >= gdth_ctr_count)
+        return -EFAULT;
+    hanum = rsc.ionode;
+    ha = HADATA(gdth_ctr_tab[hanum]);
+    memset(&cmd, 0, sizeof(gdth_cmd_str));
    
-#if LINUX_VERSION_CODE >= 0x020503
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        srp  = scsi_allocate_request(sdev, GFP_KERNEL);
-        if (!srp)
-            return -ENOMEM;
-        srp->sr_cmd_len = 12;
-        srp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        scp  = scsi_allocate_device(sdev, 1, FALSE);
-        if (!scp)
-            return -ENOMEM;
-        scp->cmd_len = 12;
-        scp->use_sg = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    srp  = scsi_allocate_request(ha->sdev, GFP_KERNEL);
+    if (!srp)
+        return -ENOMEM;
+    srp->sr_cmd_len = 12;
+    srp->sr_use_sg = 0;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    scp  = scsi_allocate_device(ha->sdev, 1, FALSE);
+    if (!scp)
+        return -ENOMEM;
+    scp->cmd_len = 12;
+    scp->use_sg = 0;
 #else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
+    memset(&ha->sdev,0,sizeof(Scsi_Device));
+    memset(&scp, 0,sizeof(Scsi_Cmnd));
+    ha->sdev.host = scp.host = gdth_ctr_tab[hanum];
+    ha->sdev.id = scp.target = ha->sdev.host->this_id;
+    scp.device = &ha->sdev;
 #endif
 
-        for (i = 0; i < MAX_HDRIVES; ++i) { 
-            if (!ha->hdr[i].present) {
-                rsc.hdr_list[i].bus = 0xff; 
-                continue;
-            } 
-            rsc.hdr_list[i].bus = ha->virt_bus;
-            rsc.hdr_list[i].target = i;
-            rsc.hdr_list[i].lun = 0;
-            rsc.hdr_list[i].cluster_type = ha->hdr[i].cluster_type;
-            if (ha->hdr[i].cluster_type & CLUSTER_DRIVE) { 
-                cmd.Service = CACHESERVICE;
-                cmd.OpCode = GDT_CLUST_INFO;
+    for (i = 0; i < MAX_HDRIVES; ++i) { 
+        if (!ha->hdr[i].present) {
+            rsc.hdr_list[i].bus = 0xff; 
+            continue;
+        } 
+        rsc.hdr_list[i].bus = ha->virt_bus;
+        rsc.hdr_list[i].target = i;
+        rsc.hdr_list[i].lun = 0;
+        rsc.hdr_list[i].cluster_type = ha->hdr[i].cluster_type;
+        if (ha->hdr[i].cluster_type & CLUSTER_DRIVE) { 
+            cmd.Service = CACHESERVICE;
+            cmd.OpCode = GDT_CLUST_INFO;
+            if (ha->cache_feat & GDT_64BIT)
+                cmd.u.cache64.DeviceNo = i;
+            else
                 cmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-                gdth_do_req(srp, &cmd, cmnd, 30);
-                if (srp->sr_command->SCp.Status == S_OK)
-                    rsc.hdr_list[i].cluster_type = srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-                gdth_do_cmd(scp, &cmd, cmnd, 30);
-                if (scp->SCp.Status == S_OK)
-                    rsc.hdr_list[i].cluster_type = scp->SCp.Message;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            gdth_do_req(srp, &cmd, cmnd, 30);
+            if (srp->sr_command->SCp.Status == S_OK)
+                rsc.hdr_list[i].cluster_type = srp->sr_command->SCp.Message;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+            gdth_do_cmd(scp, &cmd, cmnd, 30);
+            if (scp->SCp.Status == S_OK)
+                rsc.hdr_list[i].cluster_type = scp->SCp.Message;
 #else
-                gdth_do_cmd(&scp, &cmd, cmnd, 30);
-                if (scp.SCp.Status == S_OK)
-                    rsc.hdr_list[i].cluster_type = scp.SCp.Message;
+            gdth_do_cmd(&scp, &cmd, cmnd, 30);
+            if (scp.SCp.Status == S_OK)
+                rsc.hdr_list[i].cluster_type = scp.SCp.Message;
 #endif
-            }
-        } 
-#if LINUX_VERSION_CODE >= 0x020503
-        scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
+        }
+    } 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    scsi_release_request(srp);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    scsi_release_command(scp);
 #endif       
  
-        if (copy_to_user((char *)arg, &rsc, sizeof(gdth_ioctl_rescan)))
-            return -EFAULT;
-        return 0;
+    if (copy_to_user(arg, &rsc, sizeof(gdth_ioctl_rescan)))
+        return -EFAULT;
+    return 0;
 }
 
-static int ioc_rescan(unsigned long arg, char *cmnd)
+static int ioc_rescan(void __user *arg, char *cmnd)
 {
-        gdth_ioctl_rescan rsc;
-        gdth_cmd_str cmd;
-        ushort i, status, hdr_cnt;
-        ulong32 info;
-        int hanum, cyls, hds, secs;
-	ulong flags;
-	gdth_ha_str *ha; 
-#if LINUX_VERSION_CODE >= 0x020503
-	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
+    gdth_ioctl_rescan rsc;
+    gdth_cmd_str cmd;
+    ushort i, status, hdr_cnt;
+    ulong32 info;
+    int hanum, cyls, hds, secs;
+    ulong flags;
+    gdth_ha_str *ha; 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    Scsi_Request *srp;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    Scsi_Cmnd *scp;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+    Scsi_Cmnd scp;
 #endif
         
-        if (copy_from_user(&rsc, (char *)arg, sizeof(gdth_ioctl_rescan)) ||
-            rsc.ionode >= gdth_ctr_count)
-            return -EFAULT;
-        hanum = rsc.ionode;
-        ha = HADATA(gdth_ctr_tab[hanum]);
+    if (copy_from_user(&rsc, arg, sizeof(gdth_ioctl_rescan)) ||
+        rsc.ionode >= gdth_ctr_count)
+        return -EFAULT;
+    hanum = rsc.ionode;
+    ha = HADATA(gdth_ctr_tab[hanum]);
+    memset(&cmd, 0, sizeof(gdth_cmd_str));
 
-#if LINUX_VERSION_CODE >= 0x020503
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        srp  = scsi_allocate_request(sdev, GFP_KERNEL);
-        if (!srp)
-            return -ENOMEM;
-        srp->sr_cmd_len = 12;
-        srp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        scp  = scsi_allocate_device(sdev, 1, FALSE);
-        if (!scp)
-            return -ENOMEM;
-        scp->cmd_len = 12;
-        scp->use_sg = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    srp  = scsi_allocate_request(ha->sdev, GFP_KERNEL);
+    if (!srp)
+        return -ENOMEM;
+    srp->sr_cmd_len = 12;
+    srp->sr_use_sg = 0;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    scp  = scsi_allocate_device(ha->sdev, 1, FALSE);
+    if (!scp)
+        return -ENOMEM;
+    scp->cmd_len = 12;
+    scp->use_sg = 0;
 #else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
+    memset(&ha->sdev,0,sizeof(Scsi_Device));
+    memset(&scp, 0,sizeof(Scsi_Cmnd));
+    ha->sdev.host = scp.host = gdth_ctr_tab[hanum];
+    ha->sdev.id = scp.target = ha->sdev.host->this_id;
+    scp.device = &ha->sdev;
 #endif
      
-        if (rsc.flag == 0) {
-            /* old method: re-init. cache service */
-            cmd.Service = CACHESERVICE;
+    if (rsc.flag == 0) {
+        /* old method: re-init. cache service */
+        cmd.Service = CACHESERVICE;
+        if (ha->cache_feat & GDT_64BIT) {
+            cmd.OpCode = GDT_X_INIT_HOST;
+            cmd.u.cache64.DeviceNo = LINUX_OS;
+        } else {
             cmd.OpCode = GDT_INIT;
             cmd.u.cache.DeviceNo = LINUX_OS;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(srp, &cmd, cmnd, 30);
-            status = (ushort)srp->sr_command->SCp.Status;
-            info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &cmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status;
-            info = (ulong32)scp->SCp.Message;
+        }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        gdth_do_req(srp, &cmd, cmnd, 30);
+        status = (ushort)srp->sr_command->SCp.Status;
+        info = (ulong32)srp->sr_command->SCp.Message;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        gdth_do_cmd(scp, &cmd, cmnd, 30);
+        status = (ushort)scp->SCp.Status;
+        info = (ulong32)scp->SCp.Message;
 #else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
+        gdth_do_cmd(&scp, &cmd, cmnd, 30);
+        status = (ushort)scp.SCp.Status;
+        info = (ulong32)scp.SCp.Message;
 #endif
-            i = 0;
-            hdr_cnt = (status == S_OK ? (ushort)info : 0);
-        } else {
-            i = rsc.hdr_no;
-            hdr_cnt = i + 1;
-        }
-        for (; i < hdr_cnt && i < MAX_HDRIVES; ++i) {
-            cmd.Service = CACHESERVICE;
-            cmd.OpCode = GDT_INFO;
+        i = 0;
+        hdr_cnt = (status == S_OK ? (ushort)info : 0);
+    } else {
+        i = rsc.hdr_no;
+        hdr_cnt = i + 1;
+    }
+    for (; i < hdr_cnt && i < MAX_HDRIVES; ++i) {
+        cmd.Service = CACHESERVICE;
+        cmd.OpCode = GDT_INFO;
+        if (ha->cache_feat & GDT_64BIT) 
+            cmd.u.cache64.DeviceNo = i;
+        else 
             cmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(srp, &cmd, cmnd, 30);
-            status = (ushort)srp->sr_command->SCp.Status;
-            info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &cmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status;
-            info = (ulong32)scp->SCp.Message;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        gdth_do_req(srp, &cmd, cmnd, 30);
+        status = (ushort)srp->sr_command->SCp.Status;
+        info = (ulong32)srp->sr_command->SCp.Message;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        gdth_do_cmd(scp, &cmd, cmnd, 30);
+        status = (ushort)scp->SCp.Status;
+        info = (ulong32)scp->SCp.Message;
 #else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
+        gdth_do_cmd(&scp, &cmd, cmnd, 30);
+        status = (ushort)scp.SCp.Status;
+        info = (ulong32)scp.SCp.Message;
 #endif
-            GDTH_LOCK_HA(ha, flags);
-            rsc.hdr_list[i].bus = ha->virt_bus;
-            rsc.hdr_list[i].target = i;
-            rsc.hdr_list[i].lun = 0;
-            if (status != S_OK) {
-                ha->hdr[i].present = FALSE;
-            } else {
-                ha->hdr[i].present = TRUE;
-                ha->hdr[i].size = info;
-                /* evaluate mapping */
-                ha->hdr[i].size &= ~SECS32;
-                gdth_eval_mapping(ha->hdr[i].size,&cyls,&hds,&secs); 
-                ha->hdr[i].heads = hds;
-                ha->hdr[i].secs = secs;
-                /* round size */
-                ha->hdr[i].size = cyls * hds * secs;
-            }
-            GDTH_UNLOCK_HA(ha, flags);
-            if (status != S_OK)
-                continue; 
+        GDTH_LOCK_HA(ha, flags);
+        rsc.hdr_list[i].bus = ha->virt_bus;
+        rsc.hdr_list[i].target = i;
+        rsc.hdr_list[i].lun = 0;
+        if (status != S_OK) {
+            ha->hdr[i].present = FALSE;
+        } else {
+            ha->hdr[i].present = TRUE;
+            ha->hdr[i].size = info;
+            /* evaluate mapping */
+            ha->hdr[i].size &= ~SECS32;
+            gdth_eval_mapping(ha->hdr[i].size,&cyls,&hds,&secs); 
+            ha->hdr[i].heads = hds;
+            ha->hdr[i].secs = secs;
+            /* round size */
+            ha->hdr[i].size = cyls * hds * secs;
+        }
+        GDTH_UNLOCK_HA(ha, flags);
+        if (status != S_OK)
+            continue; 
+        
+        /* extended info, if GDT_64BIT, for drives > 2 TB */
+        /* but we need ha->info2, not yet stored in scp->SCp */
 
-            /* devtype, cluster info, R/W attribs */
-            cmd.Service = CACHESERVICE;
-            cmd.OpCode = GDT_DEVTYPE;
+        /* devtype, cluster info, R/W attribs */
+        cmd.Service = CACHESERVICE;
+        cmd.OpCode = GDT_DEVTYPE;
+        if (ha->cache_feat & GDT_64BIT) 
+            cmd.u.cache64.DeviceNo = i;
+        else
             cmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(srp, &cmd, cmnd, 30);
-            status = (ushort)srp->sr_command->SCp.Status;
-            info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &cmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status;
-            info = (ulong32)scp->SCp.Message;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        gdth_do_req(srp, &cmd, cmnd, 30);
+        status = (ushort)srp->sr_command->SCp.Status;
+        info = (ulong32)srp->sr_command->SCp.Message;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        gdth_do_cmd(scp, &cmd, cmnd, 30);
+        status = (ushort)scp->SCp.Status;
+        info = (ulong32)scp->SCp.Message;
 #else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
+        gdth_do_cmd(&scp, &cmd, cmnd, 30);
+        status = (ushort)scp.SCp.Status;
+        info = (ulong32)scp.SCp.Message;
 #endif
-            GDTH_LOCK_HA(ha, flags);
-            ha->hdr[i].devtype = (status == S_OK ? (ushort)info : 0);
-            GDTH_UNLOCK_HA(ha, flags);
+        GDTH_LOCK_HA(ha, flags);
+        ha->hdr[i].devtype = (status == S_OK ? (ushort)info : 0);
+        GDTH_UNLOCK_HA(ha, flags);
 
-            cmd.Service = CACHESERVICE;
-            cmd.OpCode = GDT_CLUST_INFO;
+        cmd.Service = CACHESERVICE;
+        cmd.OpCode = GDT_CLUST_INFO;
+        if (ha->cache_feat & GDT_64BIT) 
+            cmd.u.cache64.DeviceNo = i;
+        else
             cmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(srp, &cmd, cmnd, 30);
-            status = (ushort)srp->sr_command->SCp.Status;
-            info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &cmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status;
-            info = (ulong32)scp->SCp.Message;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        gdth_do_req(srp, &cmd, cmnd, 30);
+        status = (ushort)srp->sr_command->SCp.Status;
+        info = (ulong32)srp->sr_command->SCp.Message;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        gdth_do_cmd(scp, &cmd, cmnd, 30);
+        status = (ushort)scp->SCp.Status;
+        info = (ulong32)scp->SCp.Message;
 #else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
+        gdth_do_cmd(&scp, &cmd, cmnd, 30);
+        status = (ushort)scp.SCp.Status;
+        info = (ulong32)scp.SCp.Message;
 #endif
-            GDTH_LOCK_HA(ha, flags);
-            ha->hdr[i].cluster_type = 
-                ((status == S_OK && !shared_access) ? (ushort)info : 0);
-            GDTH_UNLOCK_HA(ha, flags);
-            rsc.hdr_list[i].cluster_type = ha->hdr[i].cluster_type;
+        GDTH_LOCK_HA(ha, flags);
+        ha->hdr[i].cluster_type = 
+            ((status == S_OK && !shared_access) ? (ushort)info : 0);
+        GDTH_UNLOCK_HA(ha, flags);
+        rsc.hdr_list[i].cluster_type = ha->hdr[i].cluster_type;
 
-            cmd.Service = CACHESERVICE;
-            cmd.OpCode = GDT_RW_ATTRIBS;
+        cmd.Service = CACHESERVICE;
+        cmd.OpCode = GDT_RW_ATTRIBS;
+        if (ha->cache_feat & GDT_64BIT) 
+            cmd.u.cache64.DeviceNo = i;
+        else
             cmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(srp, &cmd, cmnd, 30);
-            status = (ushort)srp->sr_command->SCp.Status;
-            info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &cmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status;
-            info = (ulong32)scp->SCp.Message;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        gdth_do_req(srp, &cmd, cmnd, 30);
+        status = (ushort)srp->sr_command->SCp.Status;
+        info = (ulong32)srp->sr_command->SCp.Message;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        gdth_do_cmd(scp, &cmd, cmnd, 30);
+        status = (ushort)scp->SCp.Status;
+        info = (ulong32)scp->SCp.Message;
 #else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
+        gdth_do_cmd(&scp, &cmd, cmnd, 30);
+        status = (ushort)scp.SCp.Status;
+        info = (ulong32)scp.SCp.Message;
 #endif
-            GDTH_LOCK_HA(ha, flags);
-            ha->hdr[i].rw_attribs = (status == S_OK ? (ushort)info : 0);
-            GDTH_UNLOCK_HA(ha, flags);
-        }
-#if LINUX_VERSION_CODE >= 0x020503
-        scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
+        GDTH_LOCK_HA(ha, flags);
+        ha->hdr[i].rw_attribs = (status == S_OK ? (ushort)info : 0);
+        GDTH_UNLOCK_HA(ha, flags);
+    }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    scsi_release_request(srp);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    scsi_release_command(scp);
 #endif       
  
-        if (copy_to_user((char *)arg, &rsc, sizeof(gdth_ioctl_rescan)))
-            return -EFAULT;
-        return 0;
+    if (copy_to_user(arg, &rsc, sizeof(gdth_ioctl_rescan)))
+        return -EFAULT;
+    return 0;
 }
   
 static int gdth_ioctl(struct inode *inode, struct file *filep,
                       unsigned int cmd, unsigned long arg)
 {
     gdth_ha_str *ha; 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     Scsi_Cmnd *scp;
-    Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     Scsi_Cmnd *scp;
-    Scsi_Device *sdev;
 #else
     Scsi_Cmnd scp;
-    Scsi_Device sdev;
 #endif
     ulong flags;
     char cmnd[MAX_COMMAND_SIZE];   
+    void __user *argp = (void __user *)arg;
 
     memset(cmnd, 0xff, 12);
     
@@ -5450,16 +5880,16 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
       case GDTIOCTL_CTRCNT:
       { 
         int cnt = gdth_ctr_count;
-        if (put_user(cnt, (int *)arg))
-		return -EFAULT;
+        if (put_user(cnt, (int __user *)argp))
+                return -EFAULT;
         break;
       }
 
       case GDTIOCTL_DRVERS:
       { 
         int ver = (GDTH_VERSION<<8) | GDTH_SUBVERSION;
-        if (put_user(ver, (int *)arg))
-		return -EFAULT;
+        if (put_user(ver, (int __user *)argp))
+                return -EFAULT;
         break;
       }
       
@@ -5470,8 +5900,8 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
         osv.version = (unchar)(LINUX_VERSION_CODE >> 16);
         osv.subversion = (unchar)(LINUX_VERSION_CODE >> 8);
         osv.revision = (ushort)(LINUX_VERSION_CODE & 0xff);
-        if (copy_to_user((char *)arg, &osv, sizeof(gdth_ioctl_osvers)))
-		return -EFAULT;
+        if (copy_to_user(argp, &osv, sizeof(gdth_ioctl_osvers)))
+                return -EFAULT;
         break;
       }
 
@@ -5479,7 +5909,7 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
       { 
         gdth_ioctl_ctrtype ctrt;
         
-        if (copy_from_user(&ctrt, (char *)arg, sizeof(gdth_ioctl_ctrtype)) ||
+        if (copy_from_user(&ctrt, argp, sizeof(gdth_ioctl_ctrtype)) ||
             ctrt.ionode >= gdth_ctr_count)
             return -EFAULT;
         ha = HADATA(gdth_ctr_tab[ctrt.ionode]);
@@ -5501,26 +5931,26 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
         }
         ctrt.info = ha->brd_phys;
         ctrt.oem_id = ha->oem_id;
-        if (copy_to_user((char *)arg, &ctrt, sizeof(gdth_ioctl_ctrtype)))
+        if (copy_to_user(argp, &ctrt, sizeof(gdth_ioctl_ctrtype)))
             return -EFAULT;
         break;
       }
         
       case GDTIOCTL_GENERAL:
-	return ioc_general(arg, cmnd);
+        return ioc_general(argp, cmnd);
 
       case GDTIOCTL_EVENT:
-	return ioc_event(arg);
+        return ioc_event(argp);
 
       case GDTIOCTL_LOCKDRV:
-	return ioc_lockdrv(arg);
+        return ioc_lockdrv(argp);
 
       case GDTIOCTL_LOCKCHN:
       {
         gdth_ioctl_lockchn lchn;
         unchar i, j;
 
-        if (copy_from_user(&lchn, (char *)arg, sizeof(gdth_ioctl_lockchn)) ||
+        if (copy_from_user(&lchn, argp, sizeof(gdth_ioctl_lockchn)) ||
             lchn.ionode >= gdth_ctr_count)
             return -EFAULT;
         ha = HADATA(gdth_ctr_tab[lchn.ionode]);
@@ -5549,25 +5979,25 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
       }
 
       case GDTIOCTL_RESCAN:
-	return ioc_rescan(arg, cmnd);
+        return ioc_rescan(argp, cmnd);
 
       case GDTIOCTL_HDRLIST:
-	return ioc_hdrlist(arg, cmnd);
+        return ioc_hdrlist(argp, cmnd);
 
       case GDTIOCTL_RESET_BUS:
       {
         gdth_ioctl_reset res;
         int hanum, rval;
 
-        if (copy_from_user(&res, (char *)arg, sizeof(gdth_ioctl_reset)) ||
+        if (copy_from_user(&res, argp, sizeof(gdth_ioctl_reset)) ||
             res.ionode >= gdth_ctr_count)
             return -EFAULT;
         hanum = res.ionode; 
+        ha = HADATA(gdth_ctr_tab[hanum]);
 
-        /* Because we need a Scsi_Cmnd struct., we make a scsi_allocate device also for kernels >=2.5.x */        
-#if LINUX_VERSION_CODE >= 0x02053C
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-        scp  = scsi_get_command(sdev, GFP_KERNEL);
+        /* Because we need a Scsi_Cmnd struct., we make a scsi_allocate device also for kernels >=2.6.x */        
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+        scp  = scsi_get_command(ha->sdev, GFP_KERNEL);
         if (!scp)
             return -ENOMEM;
         scp->cmd_len = 12;
@@ -5576,14 +6006,8 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
         rval = gdth_eh_bus_reset(scp);
         res.status = (rval == SUCCESS ? S_OK : S_GENERR);
         scsi_put_command(scp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-#if LINUX_VERSION_CODE >= 0x020503
-        scp  = scsi_allocate_device(sdev, 1);
-#else
-        scp  = scsi_allocate_device(sdev, 1, FALSE);
-#endif
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        scp  = scsi_allocate_device(ha->sdev, 1, FALSE);
         if (!scp)
             return -ENOMEM;
         scp->cmd_len = 12;
@@ -5592,45 +6016,41 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
         rval = gdth_eh_bus_reset(scp);
         res.status = (rval == SUCCESS ? S_OK : S_GENERR);
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x02015F
-        memset(&sdev,0,sizeof(Scsi_Device));
+#else 
+        memset(&ha->sdev,0,sizeof(Scsi_Device));
         memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
+        ha->sdev.host = scp.host = gdth_ctr_tab[hanum];
+        ha->sdev.id = scp.target = ha->sdev.host->this_id;
+        scp.device = &ha->sdev;
         scp.channel = virt_ctr ? 0 : res.number;
         rval = gdth_eh_bus_reset(&scp);
         res.status = (rval == SUCCESS ? S_OK : S_GENERR);
-#else
-        res.status = S_OK;
 #endif
-        if (copy_to_user((char *)arg, &res, sizeof(gdth_ioctl_reset)))
+        if (copy_to_user(argp, &res, sizeof(gdth_ioctl_reset)))
             return -EFAULT;
         break;
       }
 
       case GDTIOCTL_RESET_DRV:
-	return ioc_resetdrv(arg, cmnd);
+        return ioc_resetdrv(argp, cmnd);
 
       default:
         break; 
     }
     return 0;
 }
-#endif
 
-#if LINUX_VERSION_CODE >= 0x010300
+
 /* flush routine */
 static void gdth_flush(int hanum)
 {
     int             i;
     gdth_ha_str     *ha;
     gdth_cmd_str    gdtcmd;
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     Scsi_Request    *srp;
     Scsi_Device     *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     Scsi_Cmnd       *scp;
     Scsi_Device     *sdev;
 #else
@@ -5643,14 +6063,14 @@ static void gdth_flush(int hanum)
     TRACE2(("gdth_flush() hanum %d\n",hanum));
     ha = HADATA(gdth_ctr_tab[hanum]);
 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
     srp  = scsi_allocate_request(sdev, GFP_KERNEL);
     if (!srp)
         return;
     srp->sr_cmd_len = 12;
     srp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
     scp  = scsi_allocate_device(sdev, 1, FALSE);
     if (!scp)
@@ -5670,42 +6090,44 @@ static void gdth_flush(int hanum)
             gdtcmd.BoardNode = LOCALBOARD;
             gdtcmd.Service = CACHESERVICE;
             gdtcmd.OpCode = GDT_FLUSH;
-            gdtcmd.u.cache.DeviceNo = i;
-            gdtcmd.u.cache.BlockNo = 1;
-            gdtcmd.u.cache.sg_canz = 0;
+            if (ha->cache_feat & GDT_64BIT) { 
+                gdtcmd.u.cache64.DeviceNo = i;
+                gdtcmd.u.cache64.BlockNo = 1;
+                gdtcmd.u.cache64.sg_canz = 0;
+            } else {
+                gdtcmd.u.cache.DeviceNo = i;
+                gdtcmd.u.cache.BlockNo = 1;
+                gdtcmd.u.cache.sg_canz = 0;
+            }
             TRACE2(("gdth_flush(): flush ha %d drive %d\n", hanum, i));
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
             gdth_do_req(srp, &gdtcmd, cmnd, 30);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
             gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
 #else
             gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
 #endif
         }
     }
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     scsi_release_request(srp);
     scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     scsi_release_command(scp);
     scsi_free_host_dev(sdev);
 #endif
 }
 
 /* shutdown routine */
-#if LINUX_VERSION_CODE >= 0x020100
 static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
-#else
-void gdth_halt(void)
-#endif
 {
     int             hanum;
 #ifndef __alpha__
     gdth_cmd_str    gdtcmd;
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     Scsi_Request    *srp;
     Scsi_Device     *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     Scsi_Cmnd       *scp;
     Scsi_Device     *sdev;
 #else
@@ -5715,20 +6137,11 @@ void gdth_halt(void)
     char            cmnd[MAX_COMMAND_SIZE];   
 #endif
 
-#if LINUX_VERSION_CODE >= 0x020100
     TRACE2(("gdth_halt() event %d\n",(int)event));
     if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
         return NOTIFY_DONE;
-#else
-    TRACE2(("gdth_halt()\n"));
-    if (halt_called) {
-        TRACE2(("already called\n"));
-        return;
-    }
-    halt_called = TRUE;
-#endif
 
-    printk("GDT: Flushing all host drives .. ");
+    printk("GDT-HA: Flushing all host drives .. ");
     for (hanum = 0; hanum < gdth_ctr_count; ++hanum) {
         gdth_flush(hanum);
 
@@ -5739,32 +6152,24 @@ void gdth_halt(void)
         gdtcmd.Service = CACHESERVICE;
         gdtcmd.OpCode = GDT_RESET;
         TRACE2(("gdth_halt(): reset controller %d\n", hanum));
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
         srp  = scsi_allocate_request(sdev, GFP_KERNEL);
         if (!srp) {
-#if LINUX_VERSION_CODE >= 0x020100
             unregister_reboot_notifier(&gdth_notifier);
             return NOTIFY_OK;
-#else
-            return;
-#endif
         }
         srp->sr_cmd_len = 12;
         srp->sr_use_sg = 0;
         gdth_do_req(srp, &gdtcmd, cmnd, 10);
         scsi_release_request(srp);
         scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
         scp  = scsi_allocate_device(sdev, 1, FALSE);
         if (!scp) {
-#if LINUX_VERSION_CODE >= 0x020100
             unregister_reboot_notifier(&gdth_notifier);
             return NOTIFY_OK;
-#else
-            return;
-#endif
         }
         scp->cmd_len = 12;
         scp->use_sg = 0;
@@ -5786,15 +6191,12 @@ void gdth_halt(void)
 #ifdef GDTH_STATISTICS
     del_timer(&gdth_timer);
 #endif
-#if LINUX_VERSION_CODE >= 0x020100
     unregister_reboot_notifier(&gdth_notifier);
     return NOTIFY_OK;
-#endif
 }
-#endif
 
 
-#if LINUX_VERSION_CODE < 0x020400 && !defined(MODULE)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) && !defined(MODULE)
 
 GDTH_INITFUNC(void, gdth_setup(char *str,int *ints)) 
 {    
@@ -5805,33 +6207,36 @@ GDTH_INITFUNC(void, gdth_setup(char *str,int *ints))
 
 #else
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 static Scsi_Host_Template driver_template = {
-#if LINUX_VERSION_CODE >= 0x02015F
-	.proc_name		= "gdth", 
-#else
-	.proc_dir		= &proc_scsi_gdth,
-#endif
-	.proc_info		= gdth_proc_info,
-	.name			= "GDT SCSI Disk Array Controller",
-	.detect			= gdth_detect, 
-	.release		= gdth_release,
-	.info			= gdth_info, 
-	.queuecommand		= gdth_queuecommand,
-	.eh_abort_handler	= gdth_eh_abort, 
-	.eh_device_reset_handler = gdth_eh_device_reset,
-	.eh_bus_reset_handler	= gdth_eh_bus_reset,
-	.eh_host_reset_handler	= gdth_eh_host_reset,
-	.bios_param		= gdth_bios_param,
-	.can_queue		= GDTH_MAXCMDS,
-	.this_id		= -1,
-	.sg_tablesize		= GDTH_MAXSG,
-	.cmd_per_lun		= GDTH_MAXC_P_L,
-	.unchecked_isa_dma	= 1,
-	.use_clustering		= ENABLE_CLUSTERING,
-#if LINUX_VERSION_CODE < 0x020501
-	.use_new_eh_code	= 1,
+        .proc_name              = "gdth", 
+        .proc_info              = gdth_proc_info,
+        .name                   = "GDT SCSI Disk Array Controller",
+        .detect                 = gdth_detect, 
+        .release                = gdth_release,
+        .info                   = gdth_info, 
+        .queuecommand           = gdth_queuecommand,
+        .eh_abort_handler       = gdth_eh_abort, 
+        .eh_device_reset_handler = gdth_eh_device_reset,
+        .eh_bus_reset_handler   = gdth_eh_bus_reset,
+        .eh_host_reset_handler  = gdth_eh_host_reset,
+        .bios_param             = gdth_bios_param,
+        .can_queue              = GDTH_MAXCMDS,
+        .this_id                = -1,
+        .sg_tablesize           = GDTH_MAXSG,
+        .cmd_per_lun            = GDTH_MAXC_P_L,
+        .unchecked_isa_dma      = 1,
+        .use_clustering         = ENABLE_CLUSTERING,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+        .use_new_eh_code        = 1,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20)
+        .highmem_io             = 1,
+#endif
 #endif
 };
+#else
+static Scsi_Host_Template driver_template = GDTH;
+#endif
 
 #include "scsi_module.c"
 #ifndef MODULE
diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
index dfb5ffb67..78a93cbac 100644
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -10,7 +10,7 @@
  *
  * <achim_leubner@adaptec.com>
  *
- * $Id: gdth.h,v 1.50 2003/09/17 08:29:58 achim Exp $
+ * $Id: gdth.h,v 1.57 2004/03/31 11:52:09 achim Exp $
  */
 
 #include <linux/version.h>
@@ -26,9 +26,9 @@
 /* defines, macros */
 
 /* driver version */
-#define GDTH_VERSION_STR        "2.08"
-#define GDTH_VERSION            2
-#define GDTH_SUBVERSION         8
+#define GDTH_VERSION_STR        "3.04"
+#define GDTH_VERSION            3
+#define GDTH_SUBVERSION         4
 
 /* protocol version */
 #define PROTOCOL_VERSION        1
@@ -133,7 +133,12 @@
 /* new GDT Rx Controller */
 #define PCI_DEVICE_ID_VORTEX_GDTNEWRX   0x300
 #endif
-        
+
+#ifndef PCI_DEVICE_ID_VORTEX_GDTNEWRX2
+/* new(2) GDT Rx Controller */
+#define PCI_DEVICE_ID_VORTEX_GDTNEWRX2  0x301
+#endif        
+
 #ifndef PCI_DEVICE_ID_INTEL_SRC
 /* Intel Storage RAID Controller */
 #define PCI_DEVICE_ID_INTEL_SRC         0x600
@@ -146,8 +151,7 @@
 
 /* limits */
 #define GDTH_SCRATCH    PAGE_SIZE               /* 4KB scratch buffer */
-#define GDTH_SCRATCH_ORD 0                      /* order 0 means 1 page */
-#define GDTH_MAXCMDS    124
+#define GDTH_MAXCMDS    120
 #define GDTH_MAXC_P_L   16                      /* max. cmds per lun */
 #define GDTH_MAX_RAW    2                       /* max. cmds per raw device */
 #define MAXOFFSETS      128
@@ -221,6 +225,8 @@
 #define GDT_CLUST_RESET 24                      /* releases the cluster drives*/
 #define GDT_FREEZE_IO   25                      /* freezes all IOs */
 #define GDT_UNFREEZE_IO 26                      /* unfreezes all IOs */
+#define GDT_X_INIT_HOST 29                      /* ext. init: 64 bit support */
+#define GDT_X_INFO      30                      /* ext. info for drives>2TB */
 
 /* raw service commands */
 #define GDT_RESERVE     14                      /* reserve dev. to raw serv. */
@@ -230,9 +236,11 @@
 #define GDT_RESET_BUS   18                      /* reset bus */
 #define GDT_SCAN_START  19                      /* start device scan */
 #define GDT_SCAN_END    20                      /* stop device scan */  
+#define GDT_X_INIT_RAW  21                      /* ext. init: 64 bit support */
 
 /* screen service commands */
 #define GDT_REALTIME    3                       /* realtime clock to screens. */
+#define GDT_X_INIT_SCR  4                       /* ext. init: 64 bit support */
 
 /* IOCTL command defines */
 #define SCSI_DR_INFO    0x00                    /* SCSI drive info */                   
@@ -254,6 +262,8 @@
 #define CACHE_DRV_INFO  0x07                    /* cache drive info */
 #define BOARD_FEATURES  0x15                    /* controller features */
 #define BOARD_INFO      0x28                    /* controller info */
+#define SET_PERF_MODES  0x82                    /* set mode (coalescing,..) */
+#define GET_PERF_MODES  0x83                    /* get mode */
 #define CACHE_READ_OEM_STRING_RECORD 0x84       /* read OEM string record */ 
 #define HOST_GET        0x10001L                /* get host drive list */
 #define IO_CHANNEL      0x00020000L             /* default IO channel */
@@ -266,6 +276,7 @@
 #define S_CACHE_UNKNOWN 12                      /* cache serv.: drive unknown */
 #define S_RAW_SCSI      12                      /* raw serv.: target error */
 #define S_RAW_ILL       0xff                    /* raw serv.: illegal */
+#define S_NOFUNC        -2                      /* unknown function */
 #define S_CACHE_RESERV  -24                     /* cache: reserv. conflict */   
 
 /* timeout values */
@@ -307,7 +318,12 @@
 #define LOCALBOARD      0                       /* board node always 0 */
 #define ASYNCINDEX      0                       /* cmd index async. event */
 #define SPEZINDEX       1                       /* cmd index unknown service */
+#define COALINDEX       (GDTH_MAXCMDS + 2)
+
+/* features */
+#define SCATTER_GATHER  1                       /* s/g feature */
 #define GDT_WR_THROUGH  0x100                   /* WRITE_THROUGH supported */
+#define GDT_64BIT       0x200                   /* 64bit / drv>2TB support */
 
 #include "gdth_ioctl.h"
 
@@ -322,7 +338,40 @@ typedef struct {
     char        msg_text[MSGLEN+2];             /* the message text */
 } PACKED gdth_msg_str;
 
+
 /* IOCTL data structures */
+
+/* Status coalescing buffer for returning multiple requests per interrupt */
+typedef struct {
+    ulong32     status;
+    ulong32     ext_status;
+    ulong32     info0;
+    ulong32     info1;
+} PACKED gdth_coal_status;
+
+/* performance mode data structure */
+typedef struct {
+    ulong32     version;            /* The version of this IOCTL structure. */
+    ulong32     st_mode;            /* 0=dis., 1=st_buf_addr1 valid, 2=both  */
+    ulong32     st_buff_addr1;      /* physical address of status buffer 1 */
+    ulong32     st_buff_u_addr1;    /* reserved for 64 bit addressing */
+    ulong32     st_buff_indx1;      /* reserved command idx. for this buffer */
+    ulong32     st_buff_addr2;      /* physical address of status buffer 1 */
+    ulong32     st_buff_u_addr2;    /* reserved for 64 bit addressing */
+    ulong32     st_buff_indx2;      /* reserved command idx. for this buffer */
+    ulong32     st_buff_size;       /* size of each buffer in bytes */
+    ulong32     cmd_mode;           /* 0 = mode disabled, 1 = cmd_buff_addr1 */ 
+    ulong32     cmd_buff_addr1;     /* physical address of cmd buffer 1 */   
+    ulong32     cmd_buff_u_addr1;   /* reserved for 64 bit addressing */
+    ulong32     cmd_buff_indx1;     /* cmd buf addr1 unique identifier */
+    ulong32     cmd_buff_addr2;     /* physical address of cmd buffer 1 */   
+    ulong32     cmd_buff_u_addr2;   /* reserved for 64 bit addressing */
+    ulong32     cmd_buff_indx2;     /* cmd buf addr1 unique identifier */
+    ulong32     cmd_buff_size;      /* size of each cmd bufer in bytes */
+    ulong32     reserved1;
+    ulong32     reserved2;
+} PACKED gdth_perf_modes;
+
 /* SCSI drive info */
 typedef struct {
     unchar      vendor[8];                      /* vendor string */
@@ -795,9 +844,7 @@ typedef struct {
 
 /* PCI resources */
 typedef struct {
-#if LINUX_VERSION_CODE >= 0x02015C
     struct pci_dev      *pdev;
-#endif
     ushort              vendor_id;              /* vendor (ICP, Intel, ..) */
     ushort              device_id;              /* device ID (0,..,9) */
     ushort              subdevice_id;           /* sub device ID */
@@ -814,20 +861,28 @@ typedef struct {
 typedef struct {
     ushort              oem_id;                 /* OEM */
     ushort              type;                   /* controller class */
-    ushort              raw_feat;               /* feat. raw service (s/g,..) */
     ulong32             stype;                  /* subtype (PCI: device ID) */
     ushort              subdevice_id;           /* sub device ID (PCI) */
     ushort              fw_vers;                /* firmware version */
-    ushort              cache_feat;             /* feat. cache serv. (s/g,..) */
+    ushort              cache_feat;             /* feat. cache serv. (s/g,..)*/
+    ushort              raw_feat;               /* feat. raw service (s/g,..)*/
+    ushort              screen_feat;            /* feat. raw service (s/g,..)*/
     ushort              bmic;                   /* BMIC address (EISA) */
     void                *brd;                   /* DPRAM address */
     ulong32             brd_phys;               /* slot number/BIOS address */
     gdt6c_plx_regs      *plx;                   /* PLX regs (new PCI contr.) */
     gdth_cmd_str        *pccb;                  /* address command structure */
     ulong32             ccb_phys;               /* phys. address */
+#ifdef INT_COAL
+    gdth_coal_status    *coal_stat;             /* buffer for coalescing int.*/
+    ulong64             coal_stat_phys;         /* phys. address */
+#endif
     char                *pscratch;              /* scratch (DMA) buffer */
-    ulong32             scratch_phys;           /* phys. address */
+    ulong64             scratch_phys;           /* phys. address */
     unchar              scratch_busy;           /* in use? */
+    unchar              dma64_support;          /* 64-bit DMA supported? */
+    gdth_msg_str        *pmsg;                  /* message buffer */
+    ulong64             msg_phys;               /* phys. address */
     unchar              scan_mode;              /* current scan mode */
     unchar              irq;                    /* IRQ */
     unchar              drq;                    /* DRQ (ISA controllers) */
@@ -848,11 +903,11 @@ typedef struct {
         unchar          heads;                  /* mapping */
         unchar          secs;
         ushort          devtype;                /* further information */
-        ulong32         size;                   /* capacity */
+        ulong64         size;                   /* capacity */
         unchar          ldr_no;                 /* log. drive no. */
         unchar          rw_attribs;             /* r/w attributes */
         unchar          cluster_type;           /* cluster properties */
-        unchar          media_changed;          /* Flag:MOUNT/UNMOUNT occurred*/
+        unchar          media_changed;          /* Flag:MOUNT/UNMOUNT occured */
         ulong32         start_sec;              /* start sector */
     } hdr[MAX_LDRIVES];                         /* host drives */
     struct {
@@ -880,13 +935,19 @@ typedef struct {
     gdth_bfeat_str      bfeat;                  /* controller features */
     gdth_binfo_str      binfo;                  /* controller info */
     gdth_evt_data       dvr;                    /* event structure */
-#if LINUX_VERSION_CODE >= 0x02015F
     spinlock_t          smp_lock;
-#endif
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     struct pci_dev      *pdev;
 #endif
     char                oem_name[8];
+#ifdef GDTH_DMA_STATISTICS
+    ulong               dma32_cnt, dma64_cnt;   /* statistics: DMA buffer */
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    Scsi_Device         *sdev;
+#else
+    Scsi_Device         sdev;
+#endif
 } gdth_ha_str;
 
 /* structure for scsi_register(), SCSI bus != 0 */
@@ -924,6 +985,12 @@ typedef struct {
     ulong32     block_length;
 } PACKED gdth_rdcap_data;
 
+/* READ_CAPACITY (16) data format */
+typedef struct {
+    ulong64     last_block_no;
+    ulong32     block_length;
+} PACKED gdth_rdcap16_data;
+
 /* REQUEST_SENSE data format */
 typedef struct {
     unchar      errorcode;
@@ -965,42 +1032,48 @@ typedef struct {
 int gdth_detect(Scsi_Host_Template *);
 int gdth_release(struct Scsi_Host *);
 int gdth_queuecommand(Scsi_Cmnd *,void (*done)(Scsi_Cmnd *));
-int gdth_abort(Scsi_Cmnd *);
-#if LINUX_VERSION_CODE >= 0x010346
-int gdth_reset(Scsi_Cmnd *, unsigned int reset_flags);
-#else
-int gdth_reset(Scsi_Cmnd *);
-#endif
 const char *gdth_info(struct Scsi_Host *);
 
-#if LINUX_VERSION_CODE >= 0x020501
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 int gdth_bios_param(struct scsi_device *,struct block_device *,sector_t,int *);
 int gdth_proc_info(struct Scsi_Host *, char *,char **,off_t,int,int);
-int gdth_eh_abort(Scsi_Cmnd *scp);
-int gdth_eh_device_reset(Scsi_Cmnd *scp);
-int gdth_eh_bus_reset(Scsi_Cmnd *scp);
-int gdth_eh_host_reset(Scsi_Cmnd *scp);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 int gdth_bios_param(Disk *,kdev_t,int *);
 int gdth_proc_info(char *,char **,off_t,int,int,int);
-int gdth_eh_abort(Scsi_Cmnd *scp);
-int gdth_eh_device_reset(Scsi_Cmnd *scp);
-int gdth_eh_bus_reset(Scsi_Cmnd *scp);
-int gdth_eh_host_reset(Scsi_Cmnd *scp);
-#elif LINUX_VERSION_CODE >= 0x02015F
+#else
 int gdth_bios_param(Disk *,kdev_t,int *);
 extern struct proc_dir_entry proc_scsi_gdth;
 int gdth_proc_info(char *,char **,off_t,int,int,int);
+int gdth_abort(Scsi_Cmnd *);
+int gdth_reset(Scsi_Cmnd *,unsigned int); 
+#define GDTH { proc_dir:        &proc_scsi_gdth,                 \
+               proc_info:       gdth_proc_info,                  \
+               name:            "GDT SCSI Disk Array Controller",\
+               detect:          gdth_detect,                     \
+               release:         gdth_release,                    \
+               info:            gdth_info,                       \
+               command:         NULL,                            \
+               queuecommand:    gdth_queuecommand,               \
+               eh_abort_handler: gdth_eh_abort,                  \
+               eh_device_reset_handler: gdth_eh_device_reset,    \
+               eh_bus_reset_handler: gdth_eh_bus_reset,          \
+               eh_host_reset_handler: gdth_eh_host_reset,        \
+               abort:           gdth_abort,                      \
+               reset:           gdth_reset,                      \
+               bios_param:      gdth_bios_param,                 \
+               can_queue:       GDTH_MAXCMDS,                    \
+               this_id:         -1,                              \
+               sg_tablesize:    GDTH_MAXSG,                      \
+               cmd_per_lun:     GDTH_MAXC_P_L,                   \
+               present:         0,                               \
+               unchecked_isa_dma: 1,                             \
+               use_clustering:  ENABLE_CLUSTERING,               \
+               use_new_eh_code: 1       /* use new error code */ }    
+#endif
+
 int gdth_eh_abort(Scsi_Cmnd *scp);
 int gdth_eh_device_reset(Scsi_Cmnd *scp);
 int gdth_eh_bus_reset(Scsi_Cmnd *scp);
 int gdth_eh_host_reset(Scsi_Cmnd *scp);
-#elif LINUX_VERSION_CODE >= 0x010300
-int gdth_bios_param(Disk *,kdev_t,int *);
-extern struct proc_dir_entry proc_scsi_gdth;
-int gdth_proc_info(char *,char **,off_t,int,int,int);
-#else
-int gdth_bios_param(Disk *,int,int *);
-#endif
-#endif
 
+#endif
diff --git a/drivers/scsi/gdth_ioctl.h b/drivers/scsi/gdth_ioctl.h
index 57d4dc726..783fae737 100644
--- a/drivers/scsi/gdth_ioctl.h
+++ b/drivers/scsi/gdth_ioctl.h
@@ -2,7 +2,7 @@
 #define _GDTH_IOCTL_H
 
 /* gdth_ioctl.h
- * $Id: gdth_ioctl.h,v 1.11 2003/02/27 14:59:03 achim Exp $
+ * $Id: gdth_ioctl.h,v 1.14 2004/02/19 15:43:15 achim Exp $
  */
 
 /* IOCTLs */
@@ -21,8 +21,8 @@
 #define GDTIOCTL_RESCAN     (GDTIOCTL_MASK |11) /* rescan host drives */
 #define GDTIOCTL_RESET_DRV  (GDTIOCTL_MASK |12) /* reset (remote) drv. res. */
 
-#define GDTIOCTL_MAGIC      0xaffe0004
-#define EVENT_SIZE          294 
+#define GDTIOCTL_MAGIC  0xaffe0004
+#define EVENT_SIZE      294 
 #define GDTH_MAXSG      32                      /* max. s/g elements */
 
 #define MAX_LDRIVES     255                     /* max. log. drive count */
@@ -35,7 +35,9 @@
 /* typedefs */
 #ifdef __KERNEL__
 typedef u32     ulong32;
+typedef u64     ulong64;
 #endif
+
 #define PACKED  __attribute__((packed))
 
 /* scatter/gather element */
@@ -44,6 +46,12 @@ typedef struct {
     ulong32     sg_len;                         /* length */
 } PACKED gdth_sg_str;
 
+/* scatter/gather element - 64bit addresses */
+typedef struct {
+    ulong64     sg_ptr;                         /* address */
+    ulong32     sg_len;                         /* length */
+} PACKED gdth_sg64_str;
+
 /* command structure */
 typedef struct {
     ulong32     BoardNode;                      /* board node (always 0) */
@@ -58,18 +66,26 @@ typedef struct {
             ulong32     sg_canz;                /* s/g element count */
             gdth_sg_str sg_lst[GDTH_MAXSG];     /* s/g list */
         } PACKED cache;                         /* cache service cmd. str. */
+        struct {
+            ushort      DeviceNo;               /* number of cache drive */
+            ulong64     BlockNo;                /* block number */
+            ulong32     BlockCnt;               /* block count */
+            ulong64     DestAddr;               /* dest. addr. (if s/g: -1) */
+            ulong32     sg_canz;                /* s/g element count */
+            gdth_sg64_str sg_lst[GDTH_MAXSG];   /* s/g list */
+        } PACKED cache64;                       /* cache service cmd. str. */
         struct {
             ushort      param_size;             /* size of p_param buffer */
             ulong32     subfunc;                /* IOCTL function */
             ulong32     channel;                /* device */
-            ulong32     p_param;                /* buffer */
+            ulong64     p_param;                /* buffer */
         } PACKED ioctl;                         /* IOCTL command structure */
         struct {
             ushort      reserved;
             union {
                 struct {
                     ulong32  msg_handle;        /* message handle */
-                    ulong32  msg_addr;          /* message buffer address */
+                    ulong64  msg_addr;          /* message buffer address */
                 } PACKED msg;
                 unchar       data[12];          /* buffer for rtc data, ... */
             } su;
@@ -93,6 +109,24 @@ typedef struct {
             ulong32     sg_ranz;                /* s/g element count */
             gdth_sg_str sg_lst[GDTH_MAXSG];     /* s/g list */
         } PACKED raw;                           /* raw service cmd. struct. */
+        struct {
+            ushort      reserved;
+            ulong32     direction;              /* data direction */
+            ulong32     mdisc_time;             /* disc. time (0: no timeout)*/
+            ulong32     mcon_time;              /* connect time(0: no to.) */
+            ulong64     sdata;                  /* dest. addr. (if s/g: -1) */
+            ulong32     sdlen;                  /* data length (bytes) */
+            ulong32     clen;                   /* SCSI cmd. length(6,..,16) */
+            unchar      cmd[16];                /* SCSI command */
+            unchar      target;                 /* target ID */
+            unchar      lun;                    /* LUN */
+            unchar      bus;                    /* SCSI bus number */
+            unchar      priority;               /* only 0 used */
+            ulong32     sense_len;              /* sense data length */
+            ulong64     sense_data;             /* sense data addr. */
+            ulong32     sg_ranz;                /* s/g element count */
+            gdth_sg64_str sg_lst[GDTH_MAXSG];   /* s/g list */
+        } PACKED raw64;                         /* raw service cmd. struct. */
     } u;
     /* additional variables */
     unchar      Service;                        /* controller service */
@@ -236,7 +270,6 @@ typedef struct {
 } gdth_iord_str;
 #endif
 
-#ifdef GDTH_IOCTL_CHRDEV
 /* GDTIOCTL_GENERAL */
 typedef struct {
     ushort ionode;                              /* controller number */
@@ -244,8 +277,8 @@ typedef struct {
     ulong32 info;                               /* error info */ 
     ushort status;                              /* status */
     ulong data_len;                             /* data buffer size */
-    ulong sense_len;	                        /* sense buffer size */
-    gdth_cmd_str command;                       /* command */			
+    ulong sense_len;                            /* sense buffer size */
+    gdth_cmd_str command;                       /* command */                   
 } gdth_ioctl_general;
 
 /* GDTIOCTL_LOCKDRV */
@@ -310,6 +343,5 @@ typedef struct {
     ushort number;                              /* bus/host drive number */
     ushort status;                              /* status */
 } gdth_ioctl_reset;
-#endif
 
 #endif
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index 151b01cd2..e37faaaeb 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -1,56 +1,80 @@
 /* gdth_proc.c 
- * $Id: gdth_proc.c,v 1.37 2003/09/17 08:31:53 achim Exp $
+ * $Id: gdth_proc.c,v 1.42 2004/03/05 15:50:20 achim Exp $
  */
 
-#if LINUX_VERSION_CODE >= 0x020407
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
 #include <linux/completion.h>
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length,   
                    int inout)
 {
     int hanum,busnum;
 
-    TRACE2(("gdth_proc_info() length %d ha %d offs %d inout %d\n",
-            length,hostno,(int)offset,inout));
+    TRACE2(("gdth_proc_info() length %d offs %d inout %d\n",
+            length,(int)offset,inout));
 
     hanum = NUMDATA(host)->hanum;
     busnum= NUMDATA(host)->busnum;
 
     if (inout)
-        return(gdth_set_info(buffer,length,hanum,busnum));
+        return(gdth_set_info(buffer,length,host,hanum,busnum));
     else
-        return(gdth_get_info(buffer,start,offset,length,hanum,busnum));
+        return(gdth_get_info(buffer,start,offset,length,host,hanum,busnum));
 }
+#else
+int gdth_proc_info(char *buffer,char **start,off_t offset,int length,int hostno,   
+                   int inout)
+{
+    int hanum,busnum,i;
+
+    TRACE2(("gdth_proc_info() length %d offs %d inout %d\n",
+            length,(int)offset,inout));
+
+    for (i = 0; i < gdth_ctr_vcount; ++i) {
+        if (gdth_ctr_vtab[i]->host_no == hostno)
+            break;
+    }
+    if (i == gdth_ctr_vcount)
+        return(-EINVAL);
+
+    hanum = NUMDATA(gdth_ctr_vtab[i])->hanum;
+    busnum= NUMDATA(gdth_ctr_vtab[i])->busnum;
+
+    if (inout)
+        return(gdth_set_info(buffer,length,gdth_ctr_vtab[i],hanum,busnum));
+    else
+        return(gdth_get_info(buffer,start,offset,length,
+                             gdth_ctr_vtab[i],hanum,busnum));
+}
+#endif
 
-static int gdth_set_info(char *buffer,int length,int hanum,int busnum)
+static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host,
+                         int hanum,int busnum)
 {
     int             ret_val = -EINVAL;
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     Scsi_Request    *scp;
     Scsi_Device     *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     Scsi_Cmnd       *scp;
     Scsi_Device     *sdev;
 #else
     Scsi_Cmnd       scp;
     Scsi_Device     sdev;
-#endif
-#ifdef GDTH_IOCTL_PROC
-    gdth_iowr_str   *piowr;
-    piowr = (gdth_iowr_str *)buffer;
 #endif
     TRACE2(("gdth_set_info() ha %d bus %d\n",hanum,busnum));
 
-#if LINUX_VERSION_CODE >= 0x020503
-    sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    sdev = scsi_get_host_dev(host);
     scp  = scsi_allocate_request(sdev, GFP_KERNEL);
     if (!scp)
         return -ENOMEM;
     scp->sr_cmd_len = 12;
     scp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-    sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    sdev = scsi_get_host_dev(host);
     scp  = scsi_allocate_device(sdev, 1, FALSE);
     if (!scp)
         return -ENOMEM;
@@ -59,7 +83,7 @@ static int gdth_set_info(char *buffer,int length,int hanum,int busnum)
 #else
     memset(&sdev,0,sizeof(Scsi_Device));
     memset(&scp, 0,sizeof(Scsi_Cmnd));
-    sdev.host = scp.host = gdth_ctr_tab[hanum];
+    sdev.host = scp.host = host;
     sdev.id = scp.target = sdev.host->this_id;
     scp.device = &sdev;
 #endif
@@ -69,32 +93,21 @@ static int gdth_set_info(char *buffer,int length,int hanum,int busnum)
             buffer += 5;
             length -= 5;
             ret_val = gdth_set_asc_info( buffer, length, hanum, scp );
-#ifdef GDTH_IOCTL_PROC
-        } else if (piowr->magic == GDTIOCTL_MAGIC) {
-            ret_val = gdth_set_bin_info( buffer, length, hanum, scp );
-        } else {
-            printk("GDT: Wrong signature %x (%x required)!\n",
-                   piowr->magic, GDTIOCTL_MAGIC);
-            if (piowr->magic > GDTIOCTL_MAGIC)
-                printk("GDT: Please update your driver.\n");
-            else
-                printk("GDT: Please update your tool.\n");
-#endif
         }
     }
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     scsi_release_request(scp);
     scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     scsi_release_command(scp);
     scsi_free_host_dev(sdev);
 #endif
     return ret_val;
 }
          
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Request *scp)
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd *scp)
 #else
 static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp)
@@ -105,7 +118,7 @@ static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp)
     gdth_ha_str     *ha;
     gdth_cmd_str    gdtcmd;
     gdth_cpar_str   *pcpar;
-    ulong32         paddr;
+    ulong64         paddr;
 
     char            cmnd[MAX_COMMAND_SIZE];
     memset(cmnd, 0xff, 12);
@@ -139,11 +152,16 @@ static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp)
                 found = TRUE;
                 gdtcmd.Service = CACHESERVICE;
                 gdtcmd.OpCode = GDT_FLUSH;
-                gdtcmd.u.cache.DeviceNo = i;
-                gdtcmd.u.cache.BlockNo = 1;
-#if LINUX_VERSION_CODE >= 0x020503
+                if (ha->cache_feat & GDT_64BIT) {
+                    gdtcmd.u.cache64.DeviceNo = i;
+                    gdtcmd.u.cache64.BlockNo = 1;
+                } else {
+                    gdtcmd.u.cache.DeviceNo = i;
+                    gdtcmd.u.cache.BlockNo = 1;
+                }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
                 gdth_do_req(scp, &gdtcmd, cmnd, 30);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                 gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
 #else
                 gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
@@ -199,9 +217,9 @@ static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp)
         gdtcmd.u.ioctl.subfunc = CACHE_CONFIG;
         gdtcmd.u.ioctl.channel = INVALID_CHANNEL;
         pcpar->write_back = wb_mode==1 ? 0:1;
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         gdth_do_req(scp, &gdtcmd, cmnd, 30);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
         gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
 #else
         gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
@@ -215,562 +233,23 @@ static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp)
     return(-EINVAL);
 }
 
-#ifdef GDTH_IOCTL_PROC
-#if LINUX_VERSION_CODE >= 0x020503
-static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Request *scp)
-#elif LINUX_VERSION_CODE >= 0x020322
-static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd *scp)
-#else
-static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd scp)
-#endif
-{
-    unchar          i, j;
-    ushort          k, hdr_cnt, status;
-    gdth_ha_str     *ha;
-    gdth_iowr_str   *piowr;
-    gdth_iord_str   *piord;
-    gdth_cmd_str    *pcmd;
-    gdth_evt_str    *pevt;
-    ulong32         *ppadd, add_size, *ppadd2, add_size2, info, paddr;
-    ulong           flags;
-    gdth_cmd_str    gdtcmd;
-    int             drv_cyls, drv_hds, drv_secs;
- 
-    char            cmnd[MAX_COMMAND_SIZE];   
-    memset(cmnd, 0xff, 12);
-    memset(&gdtcmd, 0, sizeof(gdth_cmd_str));
-
-    TRACE2(("gdth_set_bin_info() ha %d\n",hanum));
-    ha = HADATA(gdth_ctr_tab[hanum]);
-    piowr = (gdth_iowr_str *)buffer;
-    piord = NULL;
-    pcmd = NULL;
-    ppadd = ppadd2 = NULL;
-    add_size = add_size2 = 0;
-
-    if (length < GDTOFFSOF(gdth_iowr_str,iu))
-        return(-EINVAL);
-
-    switch (piowr->ioctl) {
-      case GDTIOCTL_GENERAL:
-        if (length < GDTOFFSOF(gdth_iowr_str,iu.general.data[0]))
-            return(-EINVAL);
-        pcmd = (gdth_cmd_str *)piowr->iu.general.command;
-        pcmd->Service = piowr->service;
-        if (pcmd->OpCode == GDT_IOCTL) {
-            ppadd = &pcmd->u.ioctl.p_param;
-            add_size = pcmd->u.ioctl.param_size;
-        } else if (piowr->service == CACHESERVICE) {
-            add_size = pcmd->u.cache.BlockCnt * SECTOR_SIZE;
-            if (ha->cache_feat & SCATTER_GATHER) {
-                ppadd = &pcmd->u.cache.sg_lst[0].sg_ptr;
-                pcmd->u.cache.DestAddr = 0xffffffff;
-                pcmd->u.cache.sg_lst[0].sg_len = add_size;
-                pcmd->u.cache.sg_canz = 1;
-            } else {
-                ppadd = &pcmd->u.cache.DestAddr;
-                pcmd->u.cache.sg_canz = 0;
-            }
-        } else if (piowr->service == SCSIRAWSERVICE) {
-            add_size = pcmd->u.raw.sdlen;
-            add_size2 = pcmd->u.raw.sense_len;
-            if (ha->raw_feat & SCATTER_GATHER) {
-                ppadd = &pcmd->u.raw.sg_lst[0].sg_ptr;
-                pcmd->u.raw.sdata = 0xffffffff;
-                pcmd->u.raw.sg_lst[0].sg_len = add_size;
-                pcmd->u.raw.sg_ranz = 1;
-            } else {
-                ppadd = &pcmd->u.raw.sdata;
-                pcmd->u.raw.sg_ranz = 0;
-            }
-            ppadd2 = &pcmd->u.raw.sense_data;
-        } else {
-            return(-EINVAL);
-        }
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str)+add_size+add_size2,
-                               TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str) + add_size + add_size2;
-        if (add_size > 0) {
-            memcpy(piord->iu.general.data, piowr->iu.general.data, add_size);
-            *ppadd = paddr + GDTOFFSOF(gdth_iord_str, iu.general.data[0]);
-        }
-        if (add_size2 > 0) {
-            memcpy(piord->iu.general.data+add_size, piowr->iu.general.data, add_size2);
-            *ppadd2 = paddr + GDTOFFSOF(gdth_iord_str, iu.general.data[0]) + add_size2;
-        }
-        
-        /* do IOCTL */
-#if LINUX_VERSION_CODE >= 0x020503
-        gdth_do_req(scp, pcmd, cmnd, piowr->timeout);
-        piord->status = (scp->sr_command->SCp.Message << 16) |
-            scp->sr_command->SCp.Status;
-#elif LINUX_VERSION_CODE >= 0x020322
-        gdth_do_cmd(scp, pcmd, cmnd, piowr->timeout);
-        piord->status = (scp->SCp.Message<<16)|scp->SCp.Status;
-#else
-        gdth_do_cmd(&scp, pcmd, cmnd, piowr->timeout);
-        piord->status = (scp.SCp.Message<<16)|scp.SCp.Status;
-#endif
-        break;
-
-      case GDTIOCTL_DRVERS:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        piord->iu.drvers.version = (GDTH_VERSION<<8) | GDTH_SUBVERSION;
-        break;
-
-      case GDTIOCTL_CTRTYPE:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        if (ha->type == GDT_ISA || ha->type == GDT_EISA) {
-            piord->iu.ctrtype.type = (unchar)((ha->stype>>20) - 0x10);
-        } else {
-            if (ha->type != GDT_PCIMPR) {
-                piord->iu.ctrtype.type = (unchar)((ha->stype<<4) + 6);
-            } else {
-                piord->iu.ctrtype.type = 
-                    (ha->oem_id == OEM_ID_INTEL ? 0xfd : 0xfe);
-                if (ha->stype >= 0x300)
-                    piord->iu.ctrtype.ext_type = 0x6000 | ha->subdevice_id;
-                else 
-                    piord->iu.ctrtype.ext_type = 0x6000 | ha->stype;
-            }
-            piord->iu.ctrtype.device_id = ha->stype;
-            piord->iu.ctrtype.sub_device_id = ha->subdevice_id;
-        }
-        piord->iu.ctrtype.info = ha->brd_phys;
-        piord->iu.ctrtype.oem_id = ha->oem_id;
-        break;
-
-      case GDTIOCTL_CTRCNT:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        piord->iu.ctrcnt.count = (ushort)gdth_ctr_count;
-        break;
-
-      case GDTIOCTL_OSVERS:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        piord->iu.osvers.version = (unchar)(LINUX_VERSION_CODE >> 16);
-        piord->iu.osvers.subversion = (unchar)(LINUX_VERSION_CODE >> 8);
-        piord->iu.osvers.revision = (ushort)(LINUX_VERSION_CODE & 0xff);
-        break;
-
-      case GDTIOCTL_LOCKDRV:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        for (i = 0; i < piowr->iu.lockdrv.drive_cnt; ++i) {
-            j = piowr->iu.lockdrv.drives[i];
-            if (j >= MAX_HDRIVES || !ha->hdr[j].present) 
-                continue;
-            if (piowr->iu.lockdrv.lock) {
-                GDTH_LOCK_HA(ha, flags);
-                ha->hdr[j].lock = 1;
-                GDTH_UNLOCK_HA(ha, flags);
-                gdth_wait_completion( hanum, ha->bus_cnt, j );
-                gdth_stop_timeout( hanum, ha->bus_cnt, j );
-            } else {
-                GDTH_LOCK_HA(ha, flags);
-                ha->hdr[j].lock = 0;
-                GDTH_UNLOCK_HA(ha, flags);
-                gdth_start_timeout( hanum, ha->bus_cnt, j );
-                gdth_next( hanum );
-            }
-        }
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        break;
-
-      case GDTIOCTL_LOCKCHN:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        i = piowr->iu.lockchn.channel;
-        if (i < ha->bus_cnt) {
-            if (piowr->iu.lockchn.lock) {
-                GDTH_LOCK_HA(ha, flags);
-                ha->raw[i].lock = 1;
-                GDTH_UNLOCK_HA(ha, flags);
-                for (j = 0; j < ha->tid_cnt; ++j) {
-                    gdth_wait_completion( hanum, i, j );
-                    gdth_stop_timeout( hanum, i, j );
-                }
-            } else {
-                GDTH_LOCK_HA(ha, flags);
-                ha->raw[i].lock = 0;
-                GDTH_UNLOCK_HA(ha, flags);
-                for (j = 0; j < ha->tid_cnt; ++j) {
-                    gdth_start_timeout( hanum, i, j );
-                    gdth_next( hanum );
-                }
-            }
-        }
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        break;
-
-      case GDTIOCTL_EVENT:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        if (piowr->iu.event.erase == 0xff) {
-            pevt = (gdth_evt_str *)piowr->iu.event.evt;
-            if (pevt->event_source == ES_TEST) 
-                pevt->event_data.size = sizeof(pevt->event_data.eu.test);
-            else if (pevt->event_source == ES_DRIVER) 
-                pevt->event_data.size = sizeof(pevt->event_data.eu.driver);
-            else if (pevt->event_source == ES_SYNC) 
-                pevt->event_data.size = sizeof(pevt->event_data.eu.sync);
-            else {
-                pevt->event_data.size = sizeof(pevt->event_data.eu.async);
-                gdth_log_event(&pevt->event_data, NULL);
-            }
-            GDTH_LOCK_HA(ha, flags);
-            gdth_store_event(ha, pevt->event_source, pevt->event_idx,
-                             &pevt->event_data);
-            GDTH_UNLOCK_HA(ha, flags);
-        } else if (piowr->iu.event.erase == 0xfe) {
-            gdth_clear_events();
-        } else if (piowr->iu.event.erase == 0) {
-            piord->iu.event.handle = 
-                gdth_read_event(ha,piowr->iu.event.handle,
-                                (gdth_evt_str *)piord->iu.event.evt);
-        } else {
-            piord->iu.event.handle = piowr->iu.event.handle;
-            gdth_readapp_event(ha, (unchar)piowr->iu.event.erase,
-                               (gdth_evt_str *)piord->iu.event.evt);
-        }
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        break;
-      
-      case GDTIOCTL_SCSI:
-#if LINUX_VERSION_CODE >= 0x020503
-        return(-EINVAL);
-#else
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        memcpy(cmnd, piowr->iu.scsi.cmd, 12);
-#if LINUX_VERSION_CODE >= 0x020322
-        scp->target = piowr->iu.scsi.target;
-        scp->channel = virt_ctr ? 0 : piowr->iu.scsi.bus;
-        scp->cmd_len = piowr->iu.scsi.cmd_len;
-        gdth_do_cmd(scp, pcmd, cmnd, piowr->timeout);
-        piord->status = (scp->SCp.Message<<16)|scp->SCp.Status;
-#else
-        scp.target = piowr->iu.scsi.target;
-        scp.channel = virt_ctr ? 0 : piowr->iu.scsi.bus;
-        scp.cmd_len = piowr->iu.scsi.cmd_len;
-        gdth_do_cmd(&scp, pcmd, cmnd, piowr->timeout);
-        piord->status = (scp.SCp.Message<<16)|scp.SCp.Status;
-#endif
-#endif
-        break;
-
-      case GDTIOCTL_RESET_BUS:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-#if LINUX_VERSION_CODE >= 0x02053C
-        {
-            Scsi_Device     *sdev;
-            Scsi_Cmnd       *scmnd;
-
-            sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
-            scmnd= scsi_get_command(sdev, GFP_KERNEL);
-            if (!scmnd)
-                return(-ENOMEM);
-            scmnd->device->host = scp->sr_host; 
-            scmnd->device->channel = virt_ctr ? 0 : piowr->iu.scsi.bus;
-            piord->status = (ulong32)gdth_eh_bus_reset( scmnd );
-            if (piord->status == SUCCESS)
-                piord->status = S_OK;
-            else
-                piord->status = S_GENERR;
-            scsi_put_command(scmnd);
-            scsi_free_host_dev(sdev);
-        }
-#elif LINUX_VERSION_CODE >= 0x020503
-        {
-            Scsi_Cmnd scmnd;
-             
-            scmnd.host = scp->sr_host; 
-            scmnd.channel = virt_ctr ? 0 : piowr->iu.scsi.bus;
-            piord->status = (ulong32)gdth_eh_bus_reset( &scmnd );
-            if (piord->status == SUCCESS)
-                piord->status = S_OK;
-            else
-                piord->status = S_GENERR;
-        }
-#elif LINUX_VERSION_CODE >= 0x020322
-        scp->channel = virt_ctr ? 0 : piowr->iu.scsi.bus;
-        piord->status = (ulong32)gdth_eh_bus_reset( scp );
-        if (piord->status == SUCCESS)
-            piord->status = S_OK;
-        else
-            piord->status = S_GENERR;
-#elif LINUX_VERSION_CODE >= 0x02015F
-        scp.channel = virt_ctr ? 0 : piowr->iu.scsi.bus;
-        piord->status = (ulong32)gdth_eh_bus_reset( &scp );
-        if (piord->status == SUCCESS)
-            piord->status = S_OK;
-        else
-            piord->status = S_GENERR;
-#else
-        piord->status = S_OK;
-#endif
-        break;
-
-      case GDTIOCTL_HDRLIST:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        for (i = 0; i < MAX_HDRIVES; ++i) {
-            if (ha->hdr[i].present) {
-                piord->iu.hdr_list[i].bus = ha->virt_bus;
-                piord->iu.hdr_list[i].target = i;
-                piord->iu.hdr_list[i].lun = 0;
-                piord->iu.hdr_list[i].cluster_type = ha->hdr[i].cluster_type;
-                if (ha->hdr[i].cluster_type & CLUSTER_DRIVE) {  
-                    gdtcmd.Service = CACHESERVICE;
-                    gdtcmd.OpCode = GDT_CLUST_INFO;
-                    gdtcmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-                    gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                    if (scp->sr_command->SCp.Status == S_OK)
-                        piord->iu.hdr_list[i].cluster_type = 
-                            (unchar)scp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-                    gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                    if (scp->SCp.Status == S_OK)
-                        piord->iu.hdr_list[i].cluster_type = 
-                            (unchar)scp->SCp.Message;
-#else
-                    gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                    if (scp.SCp.Status == S_OK)
-                        piord->iu.hdr_list[i].cluster_type = 
-                            (unchar)scp.SCp.Message;
-#endif
-                }
-            } else {
-                piord->iu.hdr_list[i].bus = 0xff;
-            }
-        }
-        break;
-
-      case GDTIOCTL_RESCAN:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        if (piowr->iu.rescan.flag == 0) {
-            /* old method: scan all host drives 
-               re-initialize cache service to get host drive count
-            */
-            gdtcmd.Service = CACHESERVICE;
-            gdtcmd.OpCode = GDT_INIT;
-            gdtcmd.u.cache.DeviceNo = LINUX_OS;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->sr_command->SCp.Status; 
-            info = (ulong32)scp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status; 
-            info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
-#endif
-            if (status != S_OK)
-                break;
-            k = 0;
-            hdr_cnt = (ushort)info;
-        } else {
-            k = piowr->iu.rescan.hdr_no;
-            hdr_cnt = k + 1;
-        }
-        if (hdr_cnt > MAX_HDRIVES)
-            hdr_cnt = MAX_HDRIVES;
-        /* scanning for host drives */
-        for (; k < hdr_cnt; ++k) {
-            /* info about host drive */
-            gdtcmd.Service = CACHESERVICE;
-            gdtcmd.OpCode = GDT_INFO;
-            gdtcmd.u.cache.DeviceNo = k;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->sr_command->SCp.Status; 
-            info = (ulong32)scp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status; 
-            info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
-#endif
-            GDTH_LOCK_HA(ha, flags);
-            piord->iu.hdr_list[k].bus = ha->virt_bus;
-            piord->iu.hdr_list[k].target = k;
-            piord->iu.hdr_list[k].lun = 0;
-            if (status != S_OK) {
-                ha->hdr[k].present = FALSE;
-            } else {
-                ha->hdr[k].present = TRUE;
-                ha->hdr[k].size = info;
-                /* evaluate mapping (sectors per head, heads per cylinder) */
-                ha->hdr[k].size &= ~SECS32;
-                gdth_eval_mapping(ha->hdr[k].size,&drv_cyls,&drv_hds,&drv_secs);
-                ha->hdr[k].heads = (unchar)drv_hds;
-                ha->hdr[k].secs = (unchar)drv_secs;
-                /* round size */
-                ha->hdr[k].size = drv_cyls * drv_hds * drv_secs;
-            }
-            GDTH_UNLOCK_HA(ha, flags);
-            if (status != S_OK)
-                continue;       /* next host drive */
-
-            /* devtype, cluster info, R/W attributes */
-            gdtcmd.Service = CACHESERVICE;
-            gdtcmd.OpCode = GDT_DEVTYPE;
-            gdtcmd.u.cache.DeviceNo = k;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->sr_command->SCp.Status; 
-            info = (ulong32)scp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status; 
-            info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
-#endif
-            GDTH_LOCK_HA(ha, flags);
-            ha->hdr[k].devtype = 0;
-            if (status == S_OK)
-                ha->hdr[k].devtype = (ushort)info;
-            GDTH_UNLOCK_HA(ha, flags);
-
-            gdtcmd.Service = CACHESERVICE;
-            gdtcmd.OpCode = GDT_CLUST_INFO;
-            gdtcmd.u.cache.DeviceNo = k;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->sr_command->SCp.Status; 
-            info = (ulong32)scp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status; 
-            info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
-#endif
-            GDTH_LOCK_HA(ha, flags);
-            ha->hdr[k].cluster_type = 0;
-            if (status == S_OK && !shared_access)
-                ha->hdr[k].cluster_type = (ushort)info;
-            GDTH_UNLOCK_HA(ha, flags);
-            piord->iu.hdr_list[k].cluster_type = ha->hdr[k].cluster_type;
-
-            gdtcmd.Service = CACHESERVICE;
-            gdtcmd.OpCode = GDT_RW_ATTRIBS;
-            gdtcmd.u.cache.DeviceNo = k;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->sr_command->SCp.Status; 
-            info = (ulong32)scp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp->SCp.Status; 
-            info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
-#endif
-            GDTH_LOCK_HA(ha, flags);
-            ha->hdr[k].rw_attribs = 0;
-            if (status == S_OK)
-                ha->hdr[k].rw_attribs = (ushort)info;
-            GDTH_UNLOCK_HA(ha, flags);
-        }
-        break;
-
-      case GDTIOCTL_RESET_DRV:
-        if (!gdth_ioctl_alloc( hanum, sizeof(gdth_iord_str), TRUE, &paddr ))
-            return(-EBUSY);
-        piord = (gdth_iord_str *)ha->pscratch;
-        piord->size = sizeof(gdth_iord_str);
-        piord->status = S_OK;
-        i = piowr->iu.scsi.target;
-        if (ha->hdr[i].present) {
-            gdtcmd.Service = CACHESERVICE;
-            gdtcmd.OpCode = GDT_CLUST_RESET;
-            gdtcmd.u.cache.DeviceNo = i;
-#if LINUX_VERSION_CODE >= 0x020503
-            gdth_do_req(scp, &gdtcmd, cmnd, 30);
-            piord->status = (ushort)scp->sr_command->SCp.Status; 
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-            piord->status = (scp->SCp.Message<<16)|scp->SCp.Status;
-#else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-            piord->status = (scp.SCp.Message<<16)|scp.SCp.Status;
-#endif
-        }
-        break;
-
-      default:
-        return(-EINVAL);
-    }
-    return length;
-}
-#endif
-
-static int gdth_get_info(char *buffer,char **start,off_t offset,
-                         int length,int hanum,int busnum)
+static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
+                         struct Scsi_Host *host,int hanum,int busnum)
 {
     int size = 0,len = 0;
     off_t begin = 0,pos = 0;
     gdth_ha_str *ha;
     int id, i, j, k, sec, flag;
     int no_mdrv = 0, drv_no, is_mirr;
-    ulong32 cnt, paddr;
+    ulong32 cnt;
+    ulong64 paddr;
 
     gdth_cmd_str gdtcmd;
     gdth_evt_str estr;
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     Scsi_Request *scp;
     Scsi_Device *sdev; 
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     Scsi_Cmnd *scp;
     Scsi_Device *sdev;
 #else
@@ -795,15 +274,15 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,
     TRACE2(("gdth_get_info() ha %d bus %d\n",hanum,busnum));
     ha = HADATA(gdth_ctr_tab[hanum]);
 
-#if LINUX_VERSION_CODE >= 0x020503
-    sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+    sdev = scsi_get_host_dev(host);
     scp  = scsi_allocate_request(sdev, GFP_KERNEL);
     if (!scp)
         return -ENOMEM;
     scp->sr_cmd_len = 12;
     scp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-    sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    sdev = scsi_get_host_dev(host);
     scp  = scsi_allocate_device(sdev, 1, FALSE);
     if (!scp)
         return -ENOMEM;
@@ -812,485 +291,415 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,
 #else
     memset(&sdev,0,sizeof(Scsi_Device));
     memset(&scp, 0,sizeof(Scsi_Cmnd));
-    sdev.host = scp.host = gdth_ctr_tab[hanum];
+    sdev.host = scp.host = host;
     sdev.id = scp.target = sdev.host->this_id;
     scp.device = &sdev;
 #endif
-
-#ifdef GDTH_IOCTL_PROC
-    /* ioctl from tool? */
-    if (!gdth_ioctl_check_bin(hanum, (ushort)length)) {
-#endif
-        /* request is i.e. "cat /proc/scsi/gdth/0" */ 
-        /* format: %-15s\t%-10s\t%-15s\t%s */
-        /* driver parameters */
-        size = sprintf(buffer+len,"Driver Parameters:\n");
-        len += size;  pos = begin + len;
-        if (reserve_list[0] == 0xff)
-            strcpy(hrec, "--");
-        else {
-            sprintf(hrec, "%d", reserve_list[0]);
-            for (i = 1;  i < MAX_RES_ARGS; i++) {
-                if (reserve_list[i] == 0xff) 
-                    break;
-                sprintf(hrec,"%s,%d", hrec, reserve_list[i]);
-            }
+    
+    
+    /* request is i.e. "cat /proc/scsi/gdth/0" */ 
+    /* format: %-15s\t%-10s\t%-15s\t%s */
+    /* driver parameters */
+    size = sprintf(buffer+len,"Driver Parameters:\n");
+    len += size;  pos = begin + len;
+    if (reserve_list[0] == 0xff)
+        strcpy(hrec, "--");
+    else {
+        sprintf(hrec, "%d", reserve_list[0]);
+        for (i = 1;  i < MAX_RES_ARGS; i++) {
+            if (reserve_list[i] == 0xff) 
+                break;
+            sprintf(hrec,"%s,%d", hrec, reserve_list[i]);
         }
-        size = sprintf(buffer+len,
-                       " reserve_mode: \t%d         \treserve_list:  \t%s\n",
-                       reserve_mode, hrec);
-        len += size;  pos = begin + len;
-        size = sprintf(buffer+len,
-                       " max_ids:      \t%-3d       \thdr_channel:   \t%d\n",
-                       max_ids, hdr_channel);
-        len += size;  pos = begin + len;
+    }
+    size = sprintf(buffer+len,
+                   " reserve_mode: \t%d         \treserve_list:  \t%s\n",
+                   reserve_mode, hrec);
+    len += size;  pos = begin + len;
+    size = sprintf(buffer+len,
+                   " max_ids:      \t%-3d       \thdr_channel:   \t%d\n",
+                   max_ids, hdr_channel);
+    len += size;  pos = begin + len;
+
+    /* controller information */
+    size = sprintf(buffer+len,"\nDisk Array Controller Information:\n");
+    len += size;  pos = begin + len;
+    if (virt_ctr)
+        sprintf(hrec, "%s (Bus %d)", ha->binfo.type_string, busnum);
+    else
+        strcpy(hrec, ha->binfo.type_string);
+    size = sprintf(buffer+len,
+                   " Number:       \t%d         \tName:          \t%s\n",
+                   hanum, hrec);
+    len += size;  pos = begin + len;
+
+    if (ha->more_proc)
+        sprintf(hrec, "%d.%02d.%02d-%c%03X", 
+                (unchar)(ha->binfo.upd_fw_ver>>24),
+                (unchar)(ha->binfo.upd_fw_ver>>16),
+                (unchar)(ha->binfo.upd_fw_ver),
+                ha->bfeat.raid ? 'R':'N',
+                ha->binfo.upd_revision);
+    else
+        sprintf(hrec, "%d.%02d", (unchar)(ha->cpar.version>>8),
+                (unchar)(ha->cpar.version));
 
-        /* controller information */
-        size = sprintf(buffer+len,"\nDisk Array Controller Information:\n");
-        len += size;  pos = begin + len;
-        if (virt_ctr)
-            sprintf(hrec, "%s (Bus %d)", ha->binfo.type_string, busnum);
-        else
-            strcpy(hrec, ha->binfo.type_string);
+    size = sprintf(buffer+len,
+                   " Driver Ver.:  \t%-10s\tFirmware Ver.: \t%s\n",
+                   GDTH_VERSION_STR, hrec);
+    len += size;  pos = begin + len;
+ 
+    if (ha->more_proc) {
+        /* more information: 1. about controller */
         size = sprintf(buffer+len,
-                       " Number:       \t%d         \tName:          \t%s\n",
-                       hanum, hrec);
+                       " Serial No.:   \t0x%8X\tCache RAM size:\t%d KB\n",
+                       ha->binfo.ser_no, ha->binfo.memsize / 1024);
         len += size;  pos = begin + len;
+    }
 
-        if (ha->more_proc)
-            sprintf(hrec, "%d.%02d.%02d-%c%03X", 
-                    (unchar)(ha->binfo.upd_fw_ver>>24),
-                    (unchar)(ha->binfo.upd_fw_ver>>16),
-                    (unchar)(ha->binfo.upd_fw_ver),
-                    ha->bfeat.raid ? 'R':'N',
-                    ha->binfo.upd_revision);
-        else
-            sprintf(hrec, "%d.%02d", (unchar)(ha->cpar.version>>8),
-                    (unchar)(ha->cpar.version));
+#ifdef GDTH_DMA_STATISTICS
+    /* controller statistics */
+    size = sprintf(buffer+len,"\nController Statistics:\n");
+    len += size;  pos = begin + len;
+    size = sprintf(buffer+len,
+                   " 32-bit DMA buffer:\t%lu\t64-bit DMA buffer:\t%lu\n",
+                   ha->dma32_cnt, ha->dma64_cnt);
+    len += size;  pos = begin + len;
+#endif
 
-        size = sprintf(buffer+len,
-                       " Driver Ver.:  \t%-10s\tFirmware Ver.: \t%s\n",
-                       GDTH_VERSION_STR, hrec);
+    if (pos < offset) {
+        len = 0;
+        begin = pos;
+    }
+    if (pos > offset + length)
+        goto stop_output;
+
+    if (ha->more_proc) {
+        /* more information: 2. about physical devices */
+        size = sprintf(buffer+len,"\nPhysical Devices:");
         len += size;  pos = begin + len;
- 
-        if (pos < offset) {
-            len = 0;
-            begin = pos;
-        }
-        if (pos > offset + length)
+        flag = FALSE;
+            
+        buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE, &paddr);
+        if (!buf) 
             goto stop_output;
+        for (i = 0; i < ha->bus_cnt; ++i) {
+            /* 2.a statistics (and retries/reassigns) */
+            TRACE2(("pdr_statistics() chn %d\n",i));                
+            pds = (gdth_dskstat_str *)(buf + GDTH_SCRATCH/4);
+            gdtcmd.Service = CACHESERVICE;
+            gdtcmd.OpCode = GDT_IOCTL;
+            gdtcmd.u.ioctl.p_param = paddr + GDTH_SCRATCH/4;
+            gdtcmd.u.ioctl.param_size = 3*GDTH_SCRATCH/4;
+            gdtcmd.u.ioctl.subfunc = DSK_STATISTICS | L_CTRL_PATTERN;
+            gdtcmd.u.ioctl.channel = ha->raw[i].address | INVALID_CHANNEL;
+            pds->bid = ha->raw[i].local_no;
+            pds->first = 0;
+            pds->entries = ha->raw[i].pdev_cnt;
+            cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(ulong32)) /
+                sizeof(pds->list[0]);
+            if (pds->entries > cnt)
+                pds->entries = cnt;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            gdth_do_req(scp, &gdtcmd, cmnd, 30);
+            if (scp->sr_command->SCp.Status != S_OK) 
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
+            if (scp->SCp.Status != S_OK) 
+#else
+            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
+            if (scp.SCp.Status != S_OK) 
+#endif
+            { 
+                pds->count = 0;
+            }
 
-        if (ha->more_proc) {
-            /* more information: 1. about controller */
-            size = sprintf(buffer+len,
-                           " Serial No.:   \t0x%8X\tCache RAM size:\t%d KB\n",
-                           ha->binfo.ser_no, ha->binfo.memsize / 1024);
-            len += size;  pos = begin + len;
-
-            /* 2. about physical devices */
-            size = sprintf(buffer+len,"\nPhysical Devices:");
-            len += size;  pos = begin + len;
-            flag = FALSE;
-            
-            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE, &paddr);
-            if (!buf) 
-                goto stop_output;
-            for (i = 0; i < ha->bus_cnt; ++i) {
-                /* 2.a statistics (and retries/reassigns) */
-                TRACE2(("pdr_statistics() chn %d\n",i));                
-                pds = (gdth_dskstat_str *)(buf + GDTH_SCRATCH/4);
+            /* other IOCTLs must fit into area GDTH_SCRATCH/4 */
+            for (j = 0; j < ha->raw[i].pdev_cnt; ++j) {
+                /* 2.b drive info */
+                TRACE2(("scsi_drv_info() chn %d dev %d\n",
+                    i, ha->raw[i].id_list[j]));             
+                pdi = (gdth_diskinfo_str *)buf;
                 gdtcmd.Service = CACHESERVICE;
                 gdtcmd.OpCode = GDT_IOCTL;
-                gdtcmd.u.ioctl.p_param = paddr + GDTH_SCRATCH/4;
-                gdtcmd.u.ioctl.param_size = 3*GDTH_SCRATCH/4;
-                gdtcmd.u.ioctl.subfunc = DSK_STATISTICS | L_CTRL_PATTERN;
-                gdtcmd.u.ioctl.channel = ha->raw[i].address | INVALID_CHANNEL;
-                pds->bid = ha->raw[i].local_no;
-                pds->first = 0;
-                pds->entries = ha->raw[i].pdev_cnt;
-                cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(ulong32)) /
-                    sizeof(pds->list[0]);
-                if (pds->entries > cnt)
-                    pds->entries = cnt;
-#if LINUX_VERSION_CODE >= 0x020503
+                gdtcmd.u.ioctl.p_param = paddr;
+                gdtcmd.u.ioctl.param_size = sizeof(gdth_diskinfo_str);
+                gdtcmd.u.ioctl.subfunc = SCSI_DR_INFO | L_CTRL_PATTERN;
+                gdtcmd.u.ioctl.channel = 
+                    ha->raw[i].address | ha->raw[i].id_list[j];
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
                 gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                if (scp->sr_command->SCp.Status != S_OK) 
-#elif LINUX_VERSION_CODE >= 0x020322
+                if (scp->sr_command->SCp.Status == S_OK) 
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                 gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                if (scp->SCp.Status != S_OK) 
+                if (scp->SCp.Status == S_OK) 
 #else
                 gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                if (scp.SCp.Status != S_OK) 
+                if (scp.SCp.Status == S_OK) 
 #endif
-                { 
-                    pds->count = 0;
+                {
+                    strncpy(hrec,pdi->vendor,8);
+                    strncpy(hrec+8,pdi->product,16);
+                    strncpy(hrec+24,pdi->revision,4);
+                    hrec[28] = 0;
+                    size = sprintf(buffer+len,
+                                   "\n Chn/ID/LUN:   \t%c/%02d/%d    \tName:          \t%s\n",
+                                   'A'+i,pdi->target_id,pdi->lun,hrec);
+                    len += size;  pos = begin + len;
+                    flag = TRUE;
+                    pdi->no_ldrive &= 0xffff;
+                    if (pdi->no_ldrive == 0xffff)
+                        strcpy(hrec,"--");
+                    else
+                        sprintf(hrec,"%d",pdi->no_ldrive);
+                    size = sprintf(buffer+len,
+                                   " Capacity [MB]:\t%-6d    \tTo Log. Drive: \t%s\n",
+                                   pdi->blkcnt/(1024*1024/pdi->blksize),
+                                   hrec);
+                    len += size;  pos = begin + len;
+                } else {
+                    pdi->devtype = 0xff;
                 }
-
-                /* other IOCTLs must fit into area GDTH_SCRATCH/4 */
-                for (j = 0; j < ha->raw[i].pdev_cnt; ++j) {
-                    /* 2.b drive info */
-                    TRACE2(("scsi_drv_info() chn %d dev %d\n",
-                        i, ha->raw[i].id_list[j]));             
-                    pdi = (gdth_diskinfo_str *)buf;
-                    gdtcmd.Service = CACHESERVICE;
-                    gdtcmd.OpCode = GDT_IOCTL;
-                    gdtcmd.u.ioctl.p_param = paddr;
-                    gdtcmd.u.ioctl.param_size = sizeof(gdth_diskinfo_str);
-                    gdtcmd.u.ioctl.subfunc = SCSI_DR_INFO | L_CTRL_PATTERN;
-                    gdtcmd.u.ioctl.channel = 
-                        ha->raw[i].address | ha->raw[i].id_list[j];
-#if LINUX_VERSION_CODE >= 0x020503
-                    gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                    if (scp->sr_command->SCp.Status == S_OK) 
-#elif LINUX_VERSION_CODE >= 0x020322
-                    gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                    if (scp->SCp.Status == S_OK) 
-#else
-                    gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                    if (scp.SCp.Status == S_OK) 
-#endif
-                    {
-                        strncpy(hrec,pdi->vendor,8);
-                        strncpy(hrec+8,pdi->product,16);
-                        strncpy(hrec+24,pdi->revision,4);
-                        hrec[28] = 0;
-                        size = sprintf(buffer+len,
-                                       "\n Chn/ID/LUN:   \t%c/%02d/%d    \tName:          \t%s\n",
-                                       'A'+i,pdi->target_id,pdi->lun,hrec);
-                        len += size;  pos = begin + len;
-                        flag = TRUE;
-                        pdi->no_ldrive &= 0xffff;
-                        if (pdi->no_ldrive == 0xffff)
-                            strcpy(hrec,"--");
-                        else
-                            sprintf(hrec,"%d",pdi->no_ldrive);
-                        size = sprintf(buffer+len,
-                                       " Capacity [MB]:\t%-6d    \tTo Log. Drive: \t%s\n",
-                                       pdi->blkcnt/(1024*1024/pdi->blksize),
-                                       hrec);
-                        len += size;  pos = begin + len;
-                    } else {
-                        pdi->devtype = 0xff;
-                    }
                     
-                    if (pdi->devtype == 0) {
-                        /* search retries/reassigns */
-                        for (k = 0; k < pds->count; ++k) {
-                            if (pds->list[k].tid == pdi->target_id &&
-                                pds->list[k].lun == pdi->lun) {
-                                size = sprintf(buffer+len,
-                                               " Retries:      \t%-6d    \tReassigns:     \t%d\n",
-                                               pds->list[k].retries,
-                                               pds->list[k].reassigns);
-                                len += size;  pos = begin + len;
-                                break;
-                            }
-                        }
-                        /* 2.c grown defects */
-                        TRACE2(("scsi_drv_defcnt() chn %d dev %d\n",
-                                i, ha->raw[i].id_list[j]));             
-                        pdef = (gdth_defcnt_str *)buf;
-                        gdtcmd.Service = CACHESERVICE;
-                        gdtcmd.OpCode = GDT_IOCTL;
-                        gdtcmd.u.ioctl.p_param = paddr;
-                        gdtcmd.u.ioctl.param_size = sizeof(gdth_defcnt_str);
-                        gdtcmd.u.ioctl.subfunc = SCSI_DEF_CNT | L_CTRL_PATTERN;
-                        gdtcmd.u.ioctl.channel = 
-                            ha->raw[i].address | ha->raw[i].id_list[j];
-                        pdef->sddc_type = 0x08;
-#if LINUX_VERSION_CODE >= 0x020503
-                        gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                        if (scp->sr_command->SCp.Status == S_OK) 
-#elif LINUX_VERSION_CODE >= 0x020322
-                        gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                        if (scp->SCp.Status == S_OK) 
-#else
-                        gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                        if (scp.SCp.Status == S_OK) 
-#endif
-                        {
+                if (pdi->devtype == 0) {
+                    /* search retries/reassigns */
+                    for (k = 0; k < pds->count; ++k) {
+                        if (pds->list[k].tid == pdi->target_id &&
+                            pds->list[k].lun == pdi->lun) {
                             size = sprintf(buffer+len,
-                                           " Grown Defects:\t%d\n",
-                                           pdef->sddc_cnt);
+                                           " Retries:      \t%-6d    \tReassigns:     \t%d\n",
+                                           pds->list[k].retries,
+                                           pds->list[k].reassigns);
                             len += size;  pos = begin + len;
+                            break;
                         }
                     }
-                    if (pos < offset) {
-                        len = 0;
-                        begin = pos;
-                    }
-                    if (pos > offset + length)
-                        goto stop_output;
-                }
-            }
-            gdth_ioctl_free(hanum, GDTH_SCRATCH, buf, paddr);
-
-            if (!flag) {
-                size = sprintf(buffer+len, "\n --\n");
-                len += size;  pos = begin + len;
-            }
-
-            /* 3. about logical drives */
-            size = sprintf(buffer+len,"\nLogical Drives:");
-            len += size;  pos = begin + len;
-            flag = FALSE;
-
-            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE, &paddr);
-            if (!buf) 
-                goto stop_output;
-            for (i = 0; i < MAX_LDRIVES; ++i) {
-                if (!ha->hdr[i].is_logdrv)
-                    continue;
-                drv_no = i;
-                j = k = 0;
-                is_mirr = FALSE;
-                do {
-                    /* 3.a log. drive info */
-                    TRACE2(("cache_drv_info() drive no %d\n",drv_no));
-                    pcdi = (gdth_cdrinfo_str *)buf;
+                    /* 2.c grown defects */
+                    TRACE2(("scsi_drv_defcnt() chn %d dev %d\n",
+                            i, ha->raw[i].id_list[j]));             
+                    pdef = (gdth_defcnt_str *)buf;
                     gdtcmd.Service = CACHESERVICE;
                     gdtcmd.OpCode = GDT_IOCTL;
                     gdtcmd.u.ioctl.p_param = paddr;
-                    gdtcmd.u.ioctl.param_size = sizeof(gdth_cdrinfo_str);
-                    gdtcmd.u.ioctl.subfunc = CACHE_DRV_INFO;
-                    gdtcmd.u.ioctl.channel = drv_no;
-#if LINUX_VERSION_CODE >= 0x020503
+                    gdtcmd.u.ioctl.param_size = sizeof(gdth_defcnt_str);
+                    gdtcmd.u.ioctl.subfunc = SCSI_DEF_CNT | L_CTRL_PATTERN;
+                    gdtcmd.u.ioctl.channel = 
+                        ha->raw[i].address | ha->raw[i].id_list[j];
+                    pdef->sddc_type = 0x08;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
                     gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                    if (scp->sr_command->SCp.Status != S_OK) 
-#elif LINUX_VERSION_CODE >= 0x020322
+                    if (scp->sr_command->SCp.Status == S_OK) 
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                     gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                    if (scp->SCp.Status != S_OK)
+                    if (scp->SCp.Status == S_OK) 
 #else
                     gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                    if (scp.SCp.Status != S_OK)
+                    if (scp.SCp.Status == S_OK) 
 #endif
                     {
-                        break;
-                    }
-                    pcdi->ld_dtype >>= 16;
-                    j++;
-                    if (pcdi->ld_dtype > 2) {
-                        strcpy(hrec, "missing");
-                    } else if (pcdi->ld_error & 1) {
-                        strcpy(hrec, "fault");
-                    } else if (pcdi->ld_error & 2) {
-                        strcpy(hrec, "invalid");
-                        k++; j--;
-                    } else {
-                        strcpy(hrec, "ok");
-                    }
-                    
-                    if (drv_no == i) {
-                        size = sprintf(buffer+len,
-                                       "\n Number:       \t%-2d        \tStatus:        \t%s\n",
-                                       drv_no, hrec);
-                        len += size;  pos = begin + len;
-                        flag = TRUE;
-                        no_mdrv = pcdi->cd_ldcnt;
-                        if (no_mdrv > 1 || pcdi->ld_slave != -1) {
-                            is_mirr = TRUE;
-                            strcpy(hrec, "RAID-1");
-                        } else if (pcdi->ld_dtype == 0) {
-                            strcpy(hrec, "Disk");
-                        } else if (pcdi->ld_dtype == 1) {
-                            strcpy(hrec, "RAID-0");
-                        } else if (pcdi->ld_dtype == 2) {
-                            strcpy(hrec, "Chain");
-                        } else {
-                            strcpy(hrec, "???");
-                        }
-                        size = sprintf(buffer+len,
-                                       " Capacity [MB]:\t%-6d    \tType:          \t%s\n",
-                                       pcdi->ld_blkcnt/(1024*1024/pcdi->ld_blksize),
-                                       hrec);
-                        len += size;  pos = begin + len;
-                    } else {
                         size = sprintf(buffer+len,
-                                       " Slave Number: \t%-2d        \tStatus:        \t%s\n",
-                                       drv_no & 0x7fff, hrec);
+                                       " Grown Defects:\t%d\n",
+                                       pdef->sddc_cnt);
                         len += size;  pos = begin + len;
                     }
-                    drv_no = pcdi->ld_slave;
-                    if (pos < offset) {
-                        len = 0;
-                        begin = pos;
-                    }
-                    if (pos > offset + length)
-                        goto stop_output;
-                } while (drv_no != -1);
-                
-                if (is_mirr) {
-                    size = sprintf(buffer+len,
-                                   " Missing Drv.: \t%-2d        \tInvalid Drv.:  \t%d\n",
-                                   no_mdrv - j - k, k);
-                    len += size;  pos = begin + len;
                 }
-                
-                if (!ha->hdr[i].is_arraydrv)
-                    strcpy(hrec, "--");
-                else
-                    sprintf(hrec, "%d", ha->hdr[i].master_no);
-                size = sprintf(buffer+len,
-                               " To Array Drv.:\t%s\n", hrec);
-                len += size;  pos = begin + len;
                 if (pos < offset) {
                     len = 0;
                     begin = pos;
                 }
                 if (pos > offset + length)
                     goto stop_output;
-            }       
-            gdth_ioctl_free(hanum, GDTH_SCRATCH, buf, paddr);
-        
-            if (!flag) {
-                size = sprintf(buffer+len, "\n --\n");
-                len += size;  pos = begin + len;
-            }   
+            }
+        }
+        gdth_ioctl_free(hanum, GDTH_SCRATCH, buf, paddr);
 
-            /* 4. about array drives */
-            size = sprintf(buffer+len,"\nArray Drives:");
+        if (!flag) {
+            size = sprintf(buffer+len, "\n --\n");
             len += size;  pos = begin + len;
-            flag = FALSE;
+        }
 
-            buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE, &paddr);
-            if (!buf) 
-                goto stop_output;
-            for (i = 0; i < MAX_LDRIVES; ++i) {
-                if (!(ha->hdr[i].is_arraydrv && ha->hdr[i].is_master))
-                    continue;
-                /* 4.a array drive info */
-                TRACE2(("array_info() drive no %d\n",i));
-                pai = (gdth_arrayinf_str *)buf;
+        /* 3. about logical drives */
+        size = sprintf(buffer+len,"\nLogical Drives:");
+        len += size;  pos = begin + len;
+        flag = FALSE;
+
+        buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE, &paddr);
+        if (!buf) 
+            goto stop_output;
+        for (i = 0; i < MAX_LDRIVES; ++i) {
+            if (!ha->hdr[i].is_logdrv)
+                continue;
+            drv_no = i;
+            j = k = 0;
+            is_mirr = FALSE;
+            do {
+                /* 3.a log. drive info */
+                TRACE2(("cache_drv_info() drive no %d\n",drv_no));
+                pcdi = (gdth_cdrinfo_str *)buf;
                 gdtcmd.Service = CACHESERVICE;
                 gdtcmd.OpCode = GDT_IOCTL;
                 gdtcmd.u.ioctl.p_param = paddr;
-                gdtcmd.u.ioctl.param_size = sizeof(gdth_arrayinf_str);
-                gdtcmd.u.ioctl.subfunc = ARRAY_INFO | LA_CTRL_PATTERN;
-                gdtcmd.u.ioctl.channel = i;
-#if LINUX_VERSION_CODE >= 0x020503
+                gdtcmd.u.ioctl.param_size = sizeof(gdth_cdrinfo_str);
+                gdtcmd.u.ioctl.subfunc = CACHE_DRV_INFO;
+                gdtcmd.u.ioctl.channel = drv_no;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
                 gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                if (scp->sr_command->SCp.Status == S_OK) 
-#elif LINUX_VERSION_CODE >= 0x020322
+                if (scp->sr_command->SCp.Status != S_OK) 
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                 gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                if (scp->SCp.Status == S_OK) 
+                if (scp->SCp.Status != S_OK)
 #else
                 gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                if (scp.SCp.Status == S_OK) 
+                if (scp.SCp.Status != S_OK)
 #endif
                 {
-                    if (pai->ai_state == 0)
-                        strcpy(hrec, "idle");
-                    else if (pai->ai_state == 2)
-                        strcpy(hrec, "build");
-                    else if (pai->ai_state == 4)
-                        strcpy(hrec, "ready");
-                    else if (pai->ai_state == 6)
-                        strcpy(hrec, "fail");
-                    else if (pai->ai_state == 8 || pai->ai_state == 10)
-                        strcpy(hrec, "rebuild");
-                    else
-                        strcpy(hrec, "error");
-                    if (pai->ai_ext_state & 0x10)
-                        strcat(hrec, "/expand");
-                    else if (pai->ai_ext_state & 0x1)
-                        strcat(hrec, "/patch");
+                    break;
+                }
+                pcdi->ld_dtype >>= 16;
+                j++;
+                if (pcdi->ld_dtype > 2) {
+                    strcpy(hrec, "missing");
+                } else if (pcdi->ld_error & 1) {
+                    strcpy(hrec, "fault");
+                } else if (pcdi->ld_error & 2) {
+                    strcpy(hrec, "invalid");
+                    k++; j--;
+                } else {
+                    strcpy(hrec, "ok");
+                }
+                    
+                if (drv_no == i) {
                     size = sprintf(buffer+len,
                                    "\n Number:       \t%-2d        \tStatus:        \t%s\n",
-                                   i,hrec);
+                                   drv_no, hrec);
                     len += size;  pos = begin + len;
                     flag = TRUE;
-
-                    if (pai->ai_type == 0)
+                    no_mdrv = pcdi->cd_ldcnt;
+                    if (no_mdrv > 1 || pcdi->ld_slave != -1) {
+                        is_mirr = TRUE;
+                        strcpy(hrec, "RAID-1");
+                    } else if (pcdi->ld_dtype == 0) {
+                        strcpy(hrec, "Disk");
+                    } else if (pcdi->ld_dtype == 1) {
                         strcpy(hrec, "RAID-0");
-                    else if (pai->ai_type == 4)
-                        strcpy(hrec, "RAID-4");
-                    else if (pai->ai_type == 5)
-                        strcpy(hrec, "RAID-5");
-                    else 
-                        strcpy(hrec, "RAID-10");
+                    } else if (pcdi->ld_dtype == 2) {
+                        strcpy(hrec, "Chain");
+                    } else {
+                        strcpy(hrec, "???");
+                    }
                     size = sprintf(buffer+len,
                                    " Capacity [MB]:\t%-6d    \tType:          \t%s\n",
-                                   pai->ai_size/(1024*1024/pai->ai_secsize),
+                                   pcdi->ld_blkcnt/(1024*1024/pcdi->ld_blksize),
                                    hrec);
                     len += size;  pos = begin + len;
-                    if (pos < offset) {
-                        len = 0;
-                        begin = pos;
-                    }
-                    if (pos > offset + length)
-                        goto stop_output;
+                } else {
+                    size = sprintf(buffer+len,
+                                   " Slave Number: \t%-2d        \tStatus:        \t%s\n",
+                                   drv_no & 0x7fff, hrec);
+                    len += size;  pos = begin + len;
                 }
-            }
-            gdth_ioctl_free(hanum, GDTH_SCRATCH, buf, paddr);
-        
-            if (!flag) {
-                size = sprintf(buffer+len, "\n --\n");
+                drv_no = pcdi->ld_slave;
+                if (pos < offset) {
+                    len = 0;
+                    begin = pos;
+                }
+                if (pos > offset + length)
+                    goto stop_output;
+            } while (drv_no != -1);
+             
+            if (is_mirr) {
+                size = sprintf(buffer+len,
+                               " Missing Drv.: \t%-2d        \tInvalid Drv.:  \t%d\n",
+                               no_mdrv - j - k, k);
                 len += size;  pos = begin + len;
             }
-
-            /* 5. about host drives */
-            size = sprintf(buffer+len,"\nHost Drives:");
+              
+            if (!ha->hdr[i].is_arraydrv)
+                strcpy(hrec, "--");
+            else
+                sprintf(hrec, "%d", ha->hdr[i].master_no);
+            size = sprintf(buffer+len,
+                           " To Array Drv.:\t%s\n", hrec);
             len += size;  pos = begin + len;
-            flag = FALSE;
-
-            buf = gdth_ioctl_alloc(hanum, sizeof(gdth_hget_str), FALSE, &paddr);
-            if (!buf) 
+            if (pos < offset) {
+                len = 0;
+                begin = pos;
+            }
+            if (pos > offset + length)
                 goto stop_output;
-            for (i = 0; i < MAX_LDRIVES; ++i) {
-                if (!ha->hdr[i].is_logdrv || 
-                    (ha->hdr[i].is_arraydrv && !ha->hdr[i].is_master))
-                    continue;
-                /* 5.a get host drive list */
-                TRACE2(("host_get() drv_no %d\n",i));           
-                phg = (gdth_hget_str *)buf;
-                gdtcmd.Service = CACHESERVICE;
-                gdtcmd.OpCode = GDT_IOCTL;
-                gdtcmd.u.ioctl.p_param = paddr;
-                gdtcmd.u.ioctl.param_size = sizeof(gdth_hget_str);
-                gdtcmd.u.ioctl.subfunc = HOST_GET | LA_CTRL_PATTERN;
-                gdtcmd.u.ioctl.channel = i;
-                phg->entries = MAX_HDRIVES;
-                phg->offset = GDTOFFSOF(gdth_hget_str, entry[0]); 
-#if LINUX_VERSION_CODE >= 0x020503
-                gdth_do_req(scp, &gdtcmd, cmnd, 30);
-                if (scp->sr_command->SCp.Status != S_OK) 
-#elif LINUX_VERSION_CODE >= 0x020322
-                gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
-                if (scp->SCp.Status != S_OK) 
+        }       
+        gdth_ioctl_free(hanum, GDTH_SCRATCH, buf, paddr);
+        
+        if (!flag) {
+            size = sprintf(buffer+len, "\n --\n");
+            len += size;  pos = begin + len;
+        }   
+
+        /* 4. about array drives */
+        size = sprintf(buffer+len,"\nArray Drives:");
+        len += size;  pos = begin + len;
+        flag = FALSE;
+
+        buf = gdth_ioctl_alloc(hanum, GDTH_SCRATCH, FALSE, &paddr);
+        if (!buf) 
+            goto stop_output;
+        for (i = 0; i < MAX_LDRIVES; ++i) {
+            if (!(ha->hdr[i].is_arraydrv && ha->hdr[i].is_master))
+                continue;
+            /* 4.a array drive info */
+            TRACE2(("array_info() drive no %d\n",i));
+            pai = (gdth_arrayinf_str *)buf;
+            gdtcmd.Service = CACHESERVICE;
+            gdtcmd.OpCode = GDT_IOCTL;
+            gdtcmd.u.ioctl.p_param = paddr;
+            gdtcmd.u.ioctl.param_size = sizeof(gdth_arrayinf_str);
+            gdtcmd.u.ioctl.subfunc = ARRAY_INFO | LA_CTRL_PATTERN;
+            gdtcmd.u.ioctl.channel = i;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            gdth_do_req(scp, &gdtcmd, cmnd, 30);
+            if (scp->sr_command->SCp.Status == S_OK) 
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
+            if (scp->SCp.Status == S_OK) 
 #else
-                gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
-                if (scp.SCp.Status != S_OK) 
+            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
+            if (scp.SCp.Status == S_OK) 
 #endif
-                {
-                    ha->hdr[i].ldr_no = i;
-                    ha->hdr[i].rw_attribs = 0;
-                    ha->hdr[i].start_sec = 0;
-                } else {
-                    for (j = 0; j < phg->entries; ++j) {
-                        k = phg->entry[j].host_drive;
-                        if (k >= MAX_LDRIVES)
-                            continue;
-                        ha->hdr[k].ldr_no = phg->entry[j].log_drive;
-                        ha->hdr[k].rw_attribs = phg->entry[j].rw_attribs;
-                        ha->hdr[k].start_sec = phg->entry[j].start_sec;
-                    }
-                }
-            }
-            gdth_ioctl_free(hanum, sizeof(gdth_hget_str), buf, paddr);
-
-            for (i = 0; i < MAX_HDRIVES; ++i) {
-                if (!(ha->hdr[i].present))
-                    continue;
-                
+            {
+                if (pai->ai_state == 0)
+                    strcpy(hrec, "idle");
+                else if (pai->ai_state == 2)
+                    strcpy(hrec, "build");
+                else if (pai->ai_state == 4)
+                    strcpy(hrec, "ready");
+                else if (pai->ai_state == 6)
+                    strcpy(hrec, "fail");
+                else if (pai->ai_state == 8 || pai->ai_state == 10)
+                    strcpy(hrec, "rebuild");
+                else
+                    strcpy(hrec, "error");
+                if (pai->ai_ext_state & 0x10)
+                    strcat(hrec, "/expand");
+                else if (pai->ai_ext_state & 0x1)
+                    strcat(hrec, "/patch");
                 size = sprintf(buffer+len,
-                               "\n Number:       \t%-2d        \tArr/Log. Drive:\t%d\n",
-                               i, ha->hdr[i].ldr_no);
+                               "\n Number:       \t%-2d        \tStatus:        \t%s\n",
+                               i,hrec);
                 len += size;  pos = begin + len;
                 flag = TRUE;
 
+                if (pai->ai_type == 0)
+                    strcpy(hrec, "RAID-0");
+                else if (pai->ai_type == 4)
+                    strcpy(hrec, "RAID-4");
+                else if (pai->ai_type == 5)
+                    strcpy(hrec, "RAID-5");
+                else 
+                    strcpy(hrec, "RAID-10");
                 size = sprintf(buffer+len,
-                               " Capacity [MB]:\t%-6d    \tStart Sector:  \t%d\n",
-                               ha->hdr[i].size/2048, ha->hdr[i].start_sec);
+                               " Capacity [MB]:\t%-6d    \tType:          \t%s\n",
+                               pai->ai_size/(1024*1024/pai->ai_secsize),
+                               hrec);
                 len += size;  pos = begin + len;
                 if (pos < offset) {
                     len = 0;
@@ -1299,60 +708,125 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,
                 if (pos > offset + length)
                     goto stop_output;
             }
+        }
+        gdth_ioctl_free(hanum, GDTH_SCRATCH, buf, paddr);
         
-            if (!flag) {
-                size = sprintf(buffer+len, "\n --\n");
-                len += size;  pos = begin + len;
-            }
+        if (!flag) {
+            size = sprintf(buffer+len, "\n --\n");
+            len += size;  pos = begin + len;
         }
 
-        /* controller events */
-        size = sprintf(buffer+len,"\nController Events:\n");
+        /* 5. about host drives */
+        size = sprintf(buffer+len,"\nHost Drives:");
         len += size;  pos = begin + len;
+        flag = FALSE;
 
-        for (id = -1;;) {
-            id = gdth_read_event(ha, id, &estr);
-            if (estr.event_source == 0)
-                break;
-            if (estr.event_data.eu.driver.ionode == hanum &&
-                estr.event_source == ES_ASYNC) { 
-                gdth_log_event(&estr.event_data, hrec);
-                do_gettimeofday(&tv);
-                sec = (int)(tv.tv_sec - estr.first_stamp);
-                if (sec < 0) sec = 0;
-                size = sprintf(buffer+len," date- %02d:%02d:%02d\t%s\n",
-                               sec/3600, sec%3600/60, sec%60, hrec);
-                len += size;  pos = begin + len;
-                if (pos < offset) {
-                    len = 0;
-                    begin = pos;
+        buf = gdth_ioctl_alloc(hanum, sizeof(gdth_hget_str), FALSE, &paddr);
+        if (!buf) 
+            goto stop_output;
+        for (i = 0; i < MAX_LDRIVES; ++i) {
+            if (!ha->hdr[i].is_logdrv || 
+                (ha->hdr[i].is_arraydrv && !ha->hdr[i].is_master))
+                continue;
+            /* 5.a get host drive list */
+            TRACE2(("host_get() drv_no %d\n",i));           
+            phg = (gdth_hget_str *)buf;
+            gdtcmd.Service = CACHESERVICE;
+            gdtcmd.OpCode = GDT_IOCTL;
+            gdtcmd.u.ioctl.p_param = paddr;
+            gdtcmd.u.ioctl.param_size = sizeof(gdth_hget_str);
+            gdtcmd.u.ioctl.subfunc = HOST_GET | LA_CTRL_PATTERN;
+            gdtcmd.u.ioctl.channel = i;
+            phg->entries = MAX_HDRIVES;
+            phg->offset = GDTOFFSOF(gdth_hget_str, entry[0]); 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+            gdth_do_req(scp, &gdtcmd, cmnd, 30);
+            if (scp->sr_command->SCp.Status != S_OK) 
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
+            if (scp->SCp.Status != S_OK) 
+#else
+            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
+            if (scp.SCp.Status != S_OK) 
+#endif
+            {
+                ha->hdr[i].ldr_no = i;
+                ha->hdr[i].rw_attribs = 0;
+                ha->hdr[i].start_sec = 0;
+            } else {
+                for (j = 0; j < phg->entries; ++j) {
+                    k = phg->entry[j].host_drive;
+                    if (k >= MAX_LDRIVES)
+                        continue;
+                    ha->hdr[k].ldr_no = phg->entry[j].log_drive;
+                    ha->hdr[k].rw_attribs = phg->entry[j].rw_attribs;
+                    ha->hdr[k].start_sec = phg->entry[j].start_sec;
                 }
-                if (pos > offset + length)
-                    goto stop_output;
             }
-            if (id == -1)
-                break;
         }
-#ifdef GDTH_IOCTL_PROC
-    } else {
-        gdth_iord_str *piord;
+        gdth_ioctl_free(hanum, sizeof(gdth_hget_str), buf, paddr);
 
-        /* request from tool (GDTMON,..) */
-        piord = (gdth_iord_str *)ha->pscratch;
-        if (piord == NULL)
-            goto stop_output;
-        length = piord->size;
-        memcpy(buffer+len, (char *)piord, length);
-        gdth_ioctl_free(hanum, GDTH_SCRATCH, ha->pscratch, paddr);
-        len = length; 
+        for (i = 0; i < MAX_HDRIVES; ++i) {
+            if (!(ha->hdr[i].present))
+                continue;
+              
+            size = sprintf(buffer+len,
+                           "\n Number:       \t%-2d        \tArr/Log. Drive:\t%d\n",
+                           i, ha->hdr[i].ldr_no);
+            len += size;  pos = begin + len;
+            flag = TRUE;
+
+            size = sprintf(buffer+len,
+                           " Capacity [MB]:\t%-6d    \tStart Sector:  \t%d\n",
+                           (ulong32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec);
+            len += size;  pos = begin + len;
+            if (pos < offset) {
+                len = 0;
+                begin = pos;
+            }
+            if (pos > offset + length)
+                goto stop_output;
+        }
+        
+        if (!flag) {
+            size = sprintf(buffer+len, "\n --\n");
+            len += size;  pos = begin + len;
+        }
+    }
+
+    /* controller events */
+    size = sprintf(buffer+len,"\nController Events:\n");
+    len += size;  pos = begin + len;
+
+    for (id = -1;;) {
+        id = gdth_read_event(ha, id, &estr);
+        if (estr.event_source == 0)
+            break;
+        if (estr.event_data.eu.driver.ionode == hanum &&
+            estr.event_source == ES_ASYNC) { 
+            gdth_log_event(&estr.event_data, hrec);
+            do_gettimeofday(&tv);
+            sec = (int)(tv.tv_sec - estr.first_stamp);
+            if (sec < 0) sec = 0;
+            size = sprintf(buffer+len," date- %02d:%02d:%02d\t%s\n",
+                           sec/3600, sec%3600/60, sec%60, hrec);
+            len += size;  pos = begin + len;
+            if (pos < offset) {
+                len = 0;
+                begin = pos;
+            }
+            if (pos > offset + length)
+                goto stop_output;
+        }
+        if (id == -1)
+            break;
     }
-#endif
 
 stop_output:
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     scsi_release_request(scp);
     scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     scsi_release_command(scp);
     scsi_free_host_dev(sdev);
 #endif
@@ -1365,7 +839,8 @@ stop_output:
     return(len);
 }
 
-#if LINUX_VERSION_CODE >= 0x020503
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static void gdth_do_req(Scsi_Request *scp, gdth_cmd_str *gdtcmd, 
                         char *cmnd, int timeout)
 {
@@ -1389,9 +864,9 @@ static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *gdtcmd,
                         char *cmnd, int timeout)
 {
     unsigned bufflen;
-#if LINUX_VERSION_CODE >= 0x020407
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
     DECLARE_COMPLETION(wait);
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     DECLARE_MUTEX_LOCKED(sem);
 #else
     struct semaphore sem = MUTEX_LOCKED;
@@ -1405,19 +880,19 @@ static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *gdtcmd,
         scp->SCp.this_residual = DEFAULT_PRI;
         bufflen = 0;
     }
-#if LINUX_VERSION_CODE >= 0x020407
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
     scp->request.rq_status = RQ_SCSI_BUSY;
     scp->request.waiting = &wait;
     scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
     wait_for_completion(&wait);
 #else
     scp->request.sem = &sem;
-#if LINUX_VERSION_CODE >= 0x020322
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
 #else
-    GDTH_LOCK_SCSI_DOCMD();
+    spin_lock_irq(&io_request_lock);
     scsi_do_cmd(scp, cmnd, gdtcmd, bufflen, gdth_scsi_done, timeout*HZ, 1);
-    GDTH_UNLOCK_SCSI_DOCMD();
+    spin_unlock_irq(&io_request_lock);
 #endif
     down(&sem);
 #endif
@@ -1428,11 +903,11 @@ void gdth_scsi_done(Scsi_Cmnd *scp)
 {
     TRACE2(("gdth_scsi_done()\n"));
 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     scp->request->rq_status = RQ_SCSI_DONE;
     if (scp->request->waiting != NULL)
         complete(scp->request->waiting);
-#elif LINUX_VERSION_CODE >= 0x020407
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
     scp->request.rq_status = RQ_SCSI_DONE;
     if (scp->request.waiting != NULL)
         complete(scp->request.waiting);
@@ -1444,7 +919,7 @@ void gdth_scsi_done(Scsi_Cmnd *scp)
 }
 
 static char *gdth_ioctl_alloc(int hanum, int size, int scratch, 
-                              ulong32 *paddr)
+                              ulong64 *paddr)
 {
     gdth_ha_str *ha;
     ulong flags;
@@ -1463,11 +938,11 @@ static char *gdth_ioctl_alloc(int hanum, int size, int scratch,
     } else if (scratch) {
         ret_val = NULL;
     } else {
-#if LINUX_VERSION_CODE >= 0x020400
-	dma_addr_t dma_addr;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+        dma_addr_t dma_addr;
 
         ret_val = pci_alloc_consistent(ha->pdev, size, &dma_addr);
-	*paddr = (ulong32)dma_addr;
+        *paddr = dma_addr;
 #else
         ret_val = scsi_init_malloc(size, GFP_ATOMIC | GFP_DMA);
         if (ret_val)
@@ -1479,7 +954,7 @@ static char *gdth_ioctl_alloc(int hanum, int size, int scratch,
     return ret_val;
 }
 
-static void gdth_ioctl_free(int hanum, int size, char *buf, ulong32 paddr)
+static void gdth_ioctl_free(int hanum, int size, char *buf, ulong64 paddr)
 {
     gdth_ha_str *ha;
     ulong flags;
@@ -1490,7 +965,7 @@ static void gdth_ioctl_free(int hanum, int size, char *buf, ulong32 paddr)
     if (buf == ha->pscratch) {
         ha->scratch_busy = FALSE;
     } else {
-#if LINUX_VERSION_CODE >= 0x020400
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
         pci_free_consistent(ha->pdev, size, buf, paddr);
 #else
         scsi_init_free((void *)buf, size);
@@ -1533,7 +1008,7 @@ static void gdth_wait_completion(int hanum, int busnum, int id)
 
     for (i = 0; i < GDTH_MAXCMDS; ++i) {
         scp = ha->cmd_tab[i].cmnd;
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
         t = scp->device->id;
 #else
@@ -1546,14 +1021,10 @@ static void gdth_wait_completion(int hanum, int busnum, int id)
             GDTH_UNLOCK_HA(ha, flags);
             while (!scp->SCp.have_data_in)
                 barrier();
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
             GDTH_LOCK_SCSI_DONE(scp->device->host, flags);
             scp->scsi_done(scp);
             GDTH_UNLOCK_SCSI_DONE(scp->device->host, flags);
-#elif LINUX_VERSION_CODE >= 0x020503
-            GDTH_LOCK_SCSI_DONE(scp->host, flags);
-            scp->scsi_done(scp);
-            GDTH_UNLOCK_SCSI_DONE(scp->host, flags);
 #else
             GDTH_LOCK_SCSI_DONE(flags);
             scp->scsi_done(scp);
@@ -1576,7 +1047,7 @@ static void gdth_stop_timeout(int hanum, int busnum, int id)
     GDTH_LOCK_HA(ha, flags);
 
     for (scp = ha->req_first; scp; scp = (Scsi_Cmnd *)scp->SCp.ptr) {
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
         t = scp->device->id;
 #else
@@ -1602,7 +1073,7 @@ static void gdth_start_timeout(int hanum, int busnum, int id)
     GDTH_LOCK_HA(ha, flags);
 
     for (scp = ha->req_first; scp; scp = (Scsi_Cmnd *)scp->SCp.ptr) {
-#if LINUX_VERSION_CODE >= 0x02053C
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
         b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
         t = scp->device->id;
 #else
@@ -1624,7 +1095,6 @@ static int gdth_update_timeout(int hanum, Scsi_Cmnd *scp, int timeout)
     oldto = scp->timeout_per_command;
     scp->timeout_per_command = timeout;
 
-#if LINUX_VERSION_CODE >= 0x02014B
     if (timeout == 0) {
         del_timer(&scp->eh_timeout);
         scp->eh_timeout.data = (unsigned long) NULL;
@@ -1636,17 +1106,6 @@ static int gdth_update_timeout(int hanum, Scsi_Cmnd *scp, int timeout)
         scp->eh_timeout.expires = jiffies + timeout;
         add_timer(&scp->eh_timeout);
     }
-#else
-    if (timeout > 0) {
-        if (timer_table[SCSI_TIMER].expires == 0) {
-            timer_table[SCSI_TIMER].expires = jiffies + timeout;
-            timer_active |= 1 << SCSI_TIMER;
-        } else {
-            if (jiffies + timeout < timer_table[SCSI_TIMER].expires)
-                timer_table[SCSI_TIMER].expires = jiffies + timeout;
-        }
-    }
-#endif
 
     return oldto;
 }
diff --git a/drivers/scsi/gdth_proc.h b/drivers/scsi/gdth_proc.h
index 661bdada4..5fb191625 100644
--- a/drivers/scsi/gdth_proc.h
+++ b/drivers/scsi/gdth_proc.h
@@ -2,42 +2,31 @@
 #define _GDTH_PROC_H
 
 /* gdth_proc.h 
- * $Id: gdth_proc.h,v 1.14 2003/08/27 11:37:35 achim Exp $
+ * $Id: gdth_proc.h,v 1.16 2004/01/14 13:09:01 achim Exp $
  */
 
-static int gdth_set_info(char *buffer,int length,int hanum,int busnum);
-static int gdth_get_info(char *buffer,char **start,off_t offset,
-                         int length,int hanum,int busnum);
+static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host,
+                         int hanum,int busnum);
+static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
+                         struct Scsi_Host *host,int hanum,int busnum);
 
-#if LINUX_VERSION_CODE >= 0x020503
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static void gdth_do_req(Scsi_Request *srp, gdth_cmd_str *cmd, 
                         char *cmnd, int timeout);
 static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Request *scp);
-#ifdef GDTH_IOCTL_PROC
-static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Request *scp);
-#endif
-#elif LINUX_VERSION_CODE >= 0x020322
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *cmd, 
                         char *cmnd, int timeout);
 static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd *scp);
-#ifdef GDTH_IOCTL_PROC
-static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd *scp);
-#endif
 #else 
 static void gdth_do_cmd(Scsi_Cmnd *scp, gdth_cmd_str *cmd, 
                         char *cmnd, int timeout);
 static int gdth_set_asc_info(char *buffer,int length,int hanum,Scsi_Cmnd scp);
-#ifdef GDTH_IOCTL_PROC
-static int gdth_set_bin_info(char *buffer,int length,int hanum,Scsi_Cmnd scp);
-#endif
 #endif
 
 static char *gdth_ioctl_alloc(int hanum, int size, int scratch,
-                              ulong32 *paddr);  
-static void gdth_ioctl_free(int hanum, int size, char *buf, ulong32 paddr);
-#ifdef GDTH_IOCTL_PROC
-static int gdth_ioctl_check_bin(int hanum, ushort size);
-#endif
+                              ulong64 *paddr);  
+static void gdth_ioctl_free(int hanum, int size, char *buf, ulong64 paddr);
 static void gdth_wait_completion(int hanum, int busnum, int id);
 static void gdth_stop_timeout(int hanum, int busnum, int id);
 static void gdth_start_timeout(int hanum, int busnum, int id);
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 84d34b718..b59a4b051 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -345,7 +345,7 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
 }
 
 /**
- * *scsi_host_get - inc a Scsi_Host ref count
+ * scsi_host_get - inc a Scsi_Host ref count
  * @shost:	Pointer to Scsi_Host to inc.
  **/
 struct Scsi_Host *scsi_host_get(struct Scsi_Host *shost)
@@ -357,7 +357,7 @@ struct Scsi_Host *scsi_host_get(struct Scsi_Host *shost)
 }
 
 /**
- * *scsi_host_put - dec a Scsi_Host ref count
+ * scsi_host_put - dec a Scsi_Host ref count
  * @shost:	Pointer to Scsi_Host to dec.
  **/
 void scsi_host_put(struct Scsi_Host *shost)
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 00a4d60cc..9b110a8e2 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -318,6 +318,13 @@ ide_startstop_t idescsi_atapi_error (ide_drive_t *drive, const char *msg, byte s
 	if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
 		return ide_stopped;
 
+	/* retry only "normal" I/O: */
+	if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) {
+		rq->errors = 1;
+		ide_end_drive_cmd(drive, stat, err);
+		return ide_stopped;
+	}
+
 	if (HWIF(drive)->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
 		/* force an abort */
 		HWIF(drive)->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG);
@@ -334,6 +341,13 @@ ide_startstop_t idescsi_atapi_abort (ide_drive_t *drive, const char *msg)
 	if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
 	       return ide_stopped;
 
+	/* retry only "normal" I/O: */
+	if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) {
+		rq->errors = 1;
+		ide_end_drive_cmd(drive, BUSY_STAT, 0);
+		return ide_stopped;
+	}
+
 #if IDESCSI_DEBUG_LOG
 	printk(KERN_WARNING "idescsi_atapi_abort called for %lu\n",
 			((idescsi_pc_t *) rq->special)->scsi_cmd->serial_number);
@@ -745,7 +759,7 @@ static const char *idescsi_info (struct Scsi_Host *host)
 	return "SCSI host adapter emulation for IDE ATAPI devices";
 }
 
-static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
+static int idescsi_ioctl (Scsi_Device *dev, int cmd, void __user *arg)
 {
 	idescsi_scsi_t *scsi = scsihost_to_idescsi(dev->host);
 
@@ -756,7 +770,7 @@ static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
 			clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
 		return 0;
 	} else if (cmd == SG_GET_TRANSFORM)
-		return put_user(test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform), (int *) arg);
+		return put_user(test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform), (int __user *) arg);
 	return -EINVAL;
 }
 
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 0a3f553f3..a4e953bed 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -12,6 +12,18 @@
  */
 
 #include <linux/config.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/blkdev.h>
+#include <linux/parport.h>
+#include <linux/workqueue.h>
+#include <asm/io.h>
+
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 
 /* The following #define is to avoid a clash with hosts.c */
 #define IMM_PROBE_SPP   0x0001
@@ -20,22 +32,13 @@
 #define IMM_PROBE_EPP17 0x0100
 #define IMM_PROBE_EPP19 0x0200
 
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/blkdev.h>
-#include <asm/io.h>
-#include <linux/parport.h>
-#include <linux/workqueue.h>
-#include "scsi.h"
-#include "hosts.h"
 
 typedef struct {
 	struct pardevice *dev;	/* Parport device entry         */
 	int base;		/* Actual port address          */
 	int base_hi;		/* Hi Base address for ECP-ISA chipset */
 	int mode;		/* Transfer mode                */
-	Scsi_Cmnd *cur_cmd;	/* Current queued command       */
+	struct scsi_cmnd *cur_cmd;	/* Current queued command       */
 	struct work_struct imm_tq;	/* Polling interrupt stuff       */
 	unsigned long jstart;	/* Jiffies at start             */
 	unsigned failed:1;	/* Failure flag                 */
@@ -613,7 +616,7 @@ static int imm_init(imm_struct *dev)
 	return device_check(dev);
 }
 
-static inline int imm_send_command(Scsi_Cmnd *cmd)
+static inline int imm_send_command(struct scsi_cmnd *cmd)
 {
 	imm_struct *dev = imm_dev(cmd->device->host);
 	int k;
@@ -633,7 +636,7 @@ static inline int imm_send_command(Scsi_Cmnd *cmd)
  * The driver appears to remain stable if we speed up the parallel port
  * i/o in this function, but not elsewhere.
  */
-static int imm_completion(Scsi_Cmnd *cmd)
+static int imm_completion(struct scsi_cmnd *cmd)
 {
 	/* Return codes:
 	 * -1     Error
@@ -736,7 +739,7 @@ static int imm_completion(Scsi_Cmnd *cmd)
 static void imm_interrupt(void *data)
 {
 	imm_struct *dev = (imm_struct *) data;
-	Scsi_Cmnd *cmd = dev->cur_cmd;
+	struct scsi_cmnd *cmd = dev->cur_cmd;
 	struct Scsi_Host *host = cmd->device->host;
 	unsigned long flags;
 
@@ -796,7 +799,7 @@ static void imm_interrupt(void *data)
 	return;
 }
 
-static int imm_engine(imm_struct *dev, Scsi_Cmnd *cmd)
+static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
 {
 	unsigned short ppb = dev->base;
 	unsigned char l = 0, h = 0;
@@ -937,7 +940,8 @@ static int imm_engine(imm_struct *dev, Scsi_Cmnd *cmd)
 	return 0;
 }
 
-static int imm_queuecommand(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+static int imm_queuecommand(struct scsi_cmnd *cmd,
+		void (*done)(struct scsi_cmnd *))
 {
 	imm_struct *dev = imm_dev(cmd->device->host);
 
@@ -980,7 +984,7 @@ static int imm_biosparam(struct scsi_device *sdev, struct block_device *dev,
 	return 0;
 }
 
-static int imm_abort(Scsi_Cmnd *cmd)
+static int imm_abort(struct scsi_cmnd *cmd)
 {
 	imm_struct *dev = imm_dev(cmd->device->host);
 	/*
@@ -1012,7 +1016,7 @@ static void imm_reset_pulse(unsigned int base)
 	w_ctr(base, 0x04);
 }
 
-static int imm_reset(Scsi_Cmnd *cmd)
+static int imm_reset(struct scsi_cmnd *cmd)
 {
 	imm_struct *dev = imm_dev(cmd->device->host);
 
@@ -1114,7 +1118,7 @@ static int device_check(imm_struct *dev)
 	return -ENODEV;
 }
 
-static Scsi_Host_Template imm_template = {
+static struct scsi_host_template imm_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "imm",
 	.proc_info		= imm_proc_info,
diff --git a/drivers/scsi/imm.h b/drivers/scsi/imm.h
index 434a57e5c..4ce6d7675 100644
--- a/drivers/scsi/imm.h
+++ b/drivers/scsi/imm.h
@@ -139,6 +139,6 @@ static char *IMM_MODE_STRING[] =
 #define w_ctr(x,y)      outb(y, (x)+2)
 #endif
 
-static int imm_engine(imm_struct *, Scsi_Cmnd *);
+static int imm_engine(imm_struct *, struct scsi_cmnd *);
 
 #endif				/* _IMM_H */
diff --git a/drivers/scsi/ini9100u.c b/drivers/scsi/ini9100u.c
index 5cbba72cf..e634b66e8 100644
--- a/drivers/scsi/ini9100u.c
+++ b/drivers/scsi/ini9100u.c
@@ -106,6 +106,8 @@
  *		- Changed the assumption that HZ = 100
  * 10/17/03 mc	- v1.04
  *		- added new DMA API support
+ * 06/01/04 jmd	- v1.04a
+ *		- Re-add reset_bus support
  **************************************************************************/
 
 #define CVT_LINUX_VERSION(V,P,S)        (V * 65536 + P * 256 + S)
@@ -149,6 +151,7 @@ static Scsi_Host_Template driver_template = {
 	.queuecommand	= i91u_queue,
 //	.abort		= i91u_abort,
 //	.reset		= i91u_reset,
+	.eh_bus_reset_handler = i91u_bus_reset,
 	.bios_param	= i91u_biosparam,
 	.can_queue	= 1,
 	.this_id	= 1,
@@ -161,7 +164,7 @@ static Scsi_Host_Template driver_template = {
 char *i91uCopyright = "Copyright (C) 1996-98";
 char *i91uInitioName = "by Initio Corporation";
 char *i91uProductName = "INI-9X00U/UW";
-char *i91uVersion = "v1.04";
+char *i91uVersion = "v1.04a";
 
 #define TULSZ(sz)     (sizeof(sz) / sizeof(sz[0]))
 #define TUL_RDWORD(x,y)         (short)(inl((int)((ULONG)((ULONG)x+(UCHAR)y)) ))
@@ -550,6 +553,15 @@ int i91u_reset(Scsi_Cmnd * SCpnt, unsigned int reset_flags)
 		return tul_device_reset(pHCB, (ULONG) SCpnt, SCpnt->device->id, reset_flags);
 }
 
+int i91u_bus_reset(Scsi_Cmnd * SCpnt)
+{
+	HCS *pHCB;
+
+	pHCB = (HCS *) SCpnt->device->host->base;
+	tul_reset_scsi(pHCB, 0);
+	return SUCCESS;
+}
+
 /*
  * Return the "logical geometry"
  */
diff --git a/drivers/scsi/ini9100u.h b/drivers/scsi/ini9100u.h
index 436d65db9..2ed7404c3 100644
--- a/drivers/scsi/ini9100u.h
+++ b/drivers/scsi/ini9100u.h
@@ -82,10 +82,11 @@ extern int i91u_command(Scsi_Cmnd *);
 extern int i91u_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
 extern int i91u_abort(Scsi_Cmnd *);
 extern int i91u_reset(Scsi_Cmnd *, unsigned int);
+extern int i91u_bus_reset(Scsi_Cmnd *);
 extern int i91u_biosparam(struct scsi_device *, struct block_device *,
 		sector_t, int *);
 
-#define i91u_REVID "Initio INI-9X00U/UW SCSI device driver; Revision: 1.03g"
+#define i91u_REVID "Initio INI-9X00U/UW SCSI device driver; Revision: 1.04a"
 
 #define VIRT_TO_BUS(i)  (unsigned int) virt_to_bus((void *)(i))
 #define ULONG   unsigned long
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 1f439965a..29dee2c25 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -34,33 +34,32 @@
 #include <linux/delay.h>
 #include <linux/timer.h>
 #include <linux/interrupt.h>
+#include <linux/completion.h>
 #include <linux/suspend.h>
+#include <linux/workqueue.h>
 #include <scsi/scsi.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 #include <asm/io.h>
 #include <asm/semaphore.h>
 
 #include "libata.h"
 
-static void atapi_cdb_send(struct ata_port *ap);
 static unsigned int ata_busy_sleep (struct ata_port *ap,
 				    unsigned long tmout_pat,
 			    	    unsigned long tmout);
 static void __ata_dev_select (struct ata_port *ap, unsigned int device);
-#if 0 /* to be used eventually */
-static void ata_qc_push (struct ata_queued_cmd *qc, unsigned int append);
-#endif
-static void ata_dma_complete(struct ata_port *ap, u8 host_stat,
-			     unsigned int done_late);
+static void ata_dma_complete(struct ata_queued_cmd *qc, u8 host_stat);
 static void ata_host_set_pio(struct ata_port *ap);
 static void ata_host_set_udma(struct ata_port *ap);
 static void ata_dev_set_pio(struct ata_port *ap, unsigned int device);
 static void ata_dev_set_udma(struct ata_port *ap, unsigned int device);
 static void ata_set_mode(struct ata_port *ap);
+static int ata_qc_issue_prot(struct ata_queued_cmd *qc);
 
 static unsigned int ata_unique_id = 1;
+static struct workqueue_struct *ata_wq;
 
 MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
@@ -74,13 +73,6 @@ static const char * thr_state_name[] = {
 	"THR_IDLE",
 	"THR_PROBE_SUCCESS",
 	"THR_PROBE_START",
-	"THR_PIO_POLL",
-	"THR_PIO_TMOUT",
-	"THR_PIO",
-	"THR_PIO_LAST",
-	"THR_PIO_LAST_POLL",
-	"THR_PIO_ERR",
-	"THR_PACKET",
 };
 
 /**
@@ -104,26 +96,9 @@ static const char *ata_thr_state_name(unsigned int thr_state)
 	return "<invalid THR_xxx state>";
 }
 
-/**
- *	msleep - sleep for a number of milliseconds
- *	@msecs: number of milliseconds to sleep
- *
- *	Issues schedule_timeout call for the specified number
- *	of milliseconds.
- *
- *	LOCKING:
- *	None.
- */
-
-static void msleep(unsigned long msecs)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(msecs_to_jiffies(msecs) + 1);
-}
-
 /**
  *	ata_tf_load_pio - send taskfile registers to host controller
- *	@ioaddr: set of IO ports to which output is sent
+ *	@ap: Port to which output is sent
  *	@tf: ATA taskfile register set
  *
  *	Outputs ATA taskfile to standard ATA host controller using PIO.
@@ -181,7 +156,7 @@ void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf)
 
 /**
  *	ata_tf_load_mmio - send taskfile registers to host controller
- *	@ioaddr: set of IO ports to which output is sent
+ *	@ap: Port to which output is sent
  *	@tf: ATA taskfile register set
  *
  *	Outputs ATA taskfile to standard ATA host controller using MMIO.
@@ -315,8 +290,6 @@ static inline void ata_exec(struct ata_port *ap, struct ata_taskfile *tf)
 
 static void ata_tf_to_host(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	init_MUTEX_LOCKED(&ap->sem);
-
 	ap->ops->tf_load(ap, tf);
 
 	ata_exec(ap, tf);
@@ -337,15 +310,13 @@ static void ata_tf_to_host(struct ata_port *ap, struct ata_taskfile *tf)
 
 void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	init_MUTEX_LOCKED(&ap->sem);
-
 	ap->ops->tf_load(ap, tf);
 	ap->ops->exec_command(ap, tf);
 }
 
 /**
  *	ata_tf_read_pio - input device's ATA taskfile shadow registers
- *	@ioaddr: set of IO ports from which input is read
+ *	@ap: Port from which input is read
  *	@tf: ATA taskfile register set for storing input
  *
  *	Reads ATA taskfile registers for currently-selected device
@@ -377,7 +348,7 @@ void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf)
 
 /**
  *	ata_tf_read_mmio - input device's ATA taskfile shadow registers
- *	@ioaddr: set of IO ports from which input is read
+ *	@ap: Port from which input is read
  *	@tf: ATA taskfile register set for storing input
  *
  *	Reads ATA taskfile registers for currently-selected device
@@ -439,6 +410,78 @@ u8 ata_check_status_mmio(struct ata_port *ap)
        	return readb((void *) ap->ioaddr.status_addr);
 }
 
+/**
+ *	ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
+ *	@tf: Taskfile to convert
+ *	@fis: Buffer into which data will output
+ *	@pmp: Port multiplier port
+ *
+ *	Converts a standard ATA taskfile to a Serial ATA
+ *	FIS structure (Register - Host to Device).
+ *
+ *	LOCKING:
+ *	Inherited from caller.
+ */
+
+void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp)
+{
+	fis[0] = 0x27;	/* Register - Host to Device FIS */
+	fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number,
+					    bit 7 indicates Command FIS */
+	fis[2] = tf->command;
+	fis[3] = tf->feature;
+
+	fis[4] = tf->lbal;
+	fis[5] = tf->lbam;
+	fis[6] = tf->lbah;
+	fis[7] = tf->device;
+
+	fis[8] = tf->hob_lbal;
+	fis[9] = tf->hob_lbam;
+	fis[10] = tf->hob_lbah;
+	fis[11] = tf->hob_feature;
+
+	fis[12] = tf->nsect;
+	fis[13] = tf->hob_nsect;
+	fis[14] = 0;
+	fis[15] = tf->ctl;
+
+	fis[16] = 0;
+	fis[17] = 0;
+	fis[18] = 0;
+	fis[19] = 0;
+}
+
+/**
+ *	ata_tf_from_fis - Convert SATA FIS to ATA taskfile
+ *	@fis: Buffer from which data will be input
+ *	@tf: Taskfile to output
+ *
+ *	Converts a standard ATA taskfile to a Serial ATA
+ *	FIS structure (Register - Host to Device).
+ *
+ *	LOCKING:
+ *	Inherited from caller.
+ */
+
+void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf)
+{
+	tf->command	= fis[2];	/* status */
+	tf->feature	= fis[3];	/* error */
+
+	tf->lbal	= fis[4];
+	tf->lbam	= fis[5];
+	tf->lbah	= fis[6];
+	tf->device	= fis[7];
+
+	tf->hob_lbal	= fis[8];
+	tf->hob_lbam	= fis[9];
+	tf->hob_lbah	= fis[10];
+
+	tf->nsect	= fis[12];
+	tf->hob_nsect	= fis[13];
+}
+
 /**
  *	ata_prot_to_cmd - determine which read/write opcodes to use
  *	@protocol: ATA_PROT_xxx taskfile protocol
@@ -759,7 +802,7 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device)
  *	@dev: Device whose IDENTIFY DEVICE results we will examine
  *	@s: string into which data is output
  *	@ofs: offset into identify device page
- *	@len: length of string to return
+ *	@len: length of string to return. must be an even number.
  *
  *	The strings in the IDENTIFY DEVICE page are broken up into
  *	16-bit chunks.  Run through the string, and output each
@@ -788,29 +831,6 @@ void ata_dev_id_string(struct ata_device *dev, unsigned char *s,
 	}
 }
 
-/**
- *	ata_dev_parse_strings - Store useful IDENTIFY DEVICE page strings
- *	@dev: Device whose IDENTIFY DEVICE page info we use
- *
- *	We store 'vendor' and 'product' strings read from the device,
- *	for later use in the SCSI simulator's INQUIRY data.
- *
- *	Set these strings here, in the case of 'product', using
- *	data read from the ATA IDENTIFY DEVICE page.
- *
- *	LOCKING:
- *	caller.
- */
-
-static void ata_dev_parse_strings(struct ata_device *dev)
-{
-	assert (dev->class == ATA_DEV_ATA);
-	memcpy(dev->vendor, "ATA     ", 8);
-
-	ata_dev_id_string(dev, dev->product, ATA_ID_PROD_OFS,
-			  sizeof(dev->product));
-}
-
 /**
  *	__ata_dev_select - Select device 0/1 on ATA bus
  *	@ap: ATA channel to manipulate
@@ -1068,8 +1088,6 @@ retry:
 
 	ata_dump_id(dev);
 
-	ata_dev_parse_strings(dev);
-
 	/* ATA-specific feature tests */
 	if (dev->class == ATA_DEV_ATA) {
 		if (!ata_id_is_ata(dev))	/* sanity check */
@@ -1096,11 +1114,11 @@ retry:
 		ap->host->max_cmd_len = 16;
 
 		/* print device info to dmesg */
-		printk(KERN_INFO "ata%u: dev %u ATA, max %s, %Lu sectors%s\n",
+		printk(KERN_INFO "ata%u: dev %u ATA, max %s, %Lu sectors:%s\n",
 		       ap->id, device,
 		       ata_udma_string(udma_modes),
 		       (unsigned long long)dev->n_sectors,
-		       dev->flags & ATA_DFLAG_LBA48 ? " (lba48)" : "");
+		       dev->flags & ATA_DFLAG_LBA48 ? " lba48" : "");
 	}
 
 	/* ATAPI-specific feature tests */
@@ -1663,9 +1681,9 @@ err_out:
 }
 
 /**
- *	ata_dev_set_xfermode -
- *	@ap:
- *	@dev:
+ *	ata_dev_set_xfermode - Issue SET FEATURES - XFER MODE command
+ *	@ap: Port associated with device @dev
+ *	@dev: Device to which command will be sent
  *
  *	LOCKING:
  */
@@ -1704,9 +1722,9 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
 }
 
 /**
- *	ata_dev_set_udma -
- *	@ap:
- *	@device:
+ *	ata_dev_set_udma - Set ATA device's transfer mode to Ultra DMA
+ *	@ap: Port associated with device @dev
+ *	@device: Device whose mode will be set
  *
  *	LOCKING:
  */
@@ -1728,9 +1746,9 @@ static void ata_dev_set_udma(struct ata_port *ap, unsigned int device)
 }
 
 /**
- *	ata_dev_set_pio -
- *	@ap:
- *	@device:
+ *	ata_dev_set_pio - Set ATA device's transfer mode to PIO
+ *	@ap: Port associated with device @dev
+ *	@device: Device whose mode will be set
  *
  *	LOCKING:
  */
@@ -1928,20 +1946,20 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
 static unsigned long ata_pio_poll(struct ata_port *ap)
 {
 	u8 status;
-	unsigned int poll_state = THR_UNKNOWN;
-	unsigned int reg_state = THR_UNKNOWN;
-	const unsigned int tmout_state = THR_PIO_TMOUT;
-
-	switch (ap->thr_state) {
-	case THR_PIO:
-	case THR_PIO_POLL:
-		poll_state = THR_PIO_POLL;
-		reg_state = THR_PIO;
+	unsigned int poll_state = PIO_ST_UNKNOWN;
+	unsigned int reg_state = PIO_ST_UNKNOWN;
+	const unsigned int tmout_state = PIO_ST_TMOUT;
+
+	switch (ap->pio_task_state) {
+	case PIO_ST:
+	case PIO_ST_POLL:
+		poll_state = PIO_ST_POLL;
+		reg_state = PIO_ST;
 		break;
-	case THR_PIO_LAST:
-	case THR_PIO_LAST_POLL:
-		poll_state = THR_PIO_LAST_POLL;
-		reg_state = THR_PIO_LAST;
+	case PIO_ST_LAST:
+	case PIO_ST_LAST_POLL:
+		poll_state = PIO_ST_LAST_POLL;
+		reg_state = PIO_ST_LAST;
 		break;
 	default:
 		BUG();
@@ -1950,38 +1968,18 @@ static unsigned long ata_pio_poll(struct ata_port *ap)
 
 	status = ata_chk_status(ap);
 	if (status & ATA_BUSY) {
-		if (time_after(jiffies, ap->thr_timeout)) {
-			ap->thr_state = tmout_state;
+		if (time_after(jiffies, ap->pio_task_timeout)) {
+			ap->pio_task_state = tmout_state;
 			return 0;
 		}
-		ap->thr_state = poll_state;
+		ap->pio_task_state = poll_state;
 		return ATA_SHORT_PAUSE;
 	}
 
-	ap->thr_state = reg_state;
+	ap->pio_task_state = reg_state;
 	return 0;
 }
 
-/**
- *	ata_pio_start -
- *	@qc:
- *
- *	LOCKING:
- *	spin_lock_irqsave(host_set lock)
- */
-
-static void ata_pio_start (struct ata_queued_cmd *qc)
-{
-	struct ata_port *ap = qc->ap;
-
-	assert(qc->tf.protocol == ATA_PROT_PIO);
-
-	qc->flags |= ATA_QCFLAG_POLL;
-	qc->tf.ctl |= ATA_NIEN;	/* disable interrupts */
-	ata_tf_to_host_nolock(ap, &qc->tf);
-	ata_thread_wake(ap, THR_PIO);
-}
-
 /**
  *	ata_pio_complete -
  *	@ap:
@@ -1992,7 +1990,6 @@ static void ata_pio_start (struct ata_queued_cmd *qc)
 static void ata_pio_complete (struct ata_port *ap)
 {
 	struct ata_queued_cmd *qc;
-	unsigned long flags;
 	u8 drv_stat;
 
 	/*
@@ -2001,35 +1998,33 @@ static void ata_pio_complete (struct ata_port *ap)
 	 * a chk-status or two.  If not, the drive is probably seeking
 	 * or something.  Snooze for a couple msecs, then
 	 * chk-status again.  If still busy, fall back to
-	 * THR_PIO_POLL state.
+	 * PIO_ST_POLL state.
 	 */
 	drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 10);
 	if (drv_stat & (ATA_BUSY | ATA_DRQ)) {
 		msleep(2);
 		drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 10);
 		if (drv_stat & (ATA_BUSY | ATA_DRQ)) {
-			ap->thr_state = THR_PIO_LAST_POLL;
-			ap->thr_timeout = jiffies + ATA_TMOUT_PIO;
+			ap->pio_task_state = PIO_ST_LAST_POLL;
+			ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO;
 			return;
 		}
 	}
 
 	drv_stat = ata_wait_idle(ap);
 	if (drv_stat & (ATA_BUSY | ATA_DRQ)) {
-		ap->thr_state = THR_PIO_ERR;
+		ap->pio_task_state = PIO_ST_ERR;
 		return;
 	}
 
 	qc = ata_qc_from_tag(ap, ap->active_tag);
 	assert(qc != NULL);
 
-	spin_lock_irqsave(&ap->host_set->lock, flags);
-	ap->thr_state = THR_IDLE;
-	spin_unlock_irqrestore(&ap->host_set->lock, flags);
+	ap->pio_task_state = PIO_ST_IDLE;
 
 	ata_irq_on(ap);
 
-	ata_qc_complete(qc, drv_stat, 0);
+	ata_qc_complete(qc, drv_stat);
 }
 
 /**
@@ -2053,22 +2048,22 @@ static void ata_pio_sector(struct ata_port *ap)
 	 * a chk-status or two.  If not, the drive is probably seeking
 	 * or something.  Snooze for a couple msecs, then
 	 * chk-status again.  If still busy, fall back to
-	 * THR_PIO_POLL state.
+	 * PIO_ST_POLL state.
 	 */
 	status = ata_busy_wait(ap, ATA_BUSY, 5);
 	if (status & ATA_BUSY) {
 		msleep(2);
 		status = ata_busy_wait(ap, ATA_BUSY, 10);
 		if (status & ATA_BUSY) {
-			ap->thr_state = THR_PIO_POLL;
-			ap->thr_timeout = jiffies + ATA_TMOUT_PIO;
+			ap->pio_task_state = PIO_ST_POLL;
+			ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO;
 			return;
 		}
 	}
 
 	/* handle BSY=0, DRQ=0 as error */
 	if ((status & ATA_DRQ) == 0) {
-		ap->thr_state = THR_PIO_ERR;
+		ap->pio_task_state = PIO_ST_ERR;
 		return;
 	}
 
@@ -2079,7 +2074,7 @@ static void ata_pio_sector(struct ata_port *ap)
 	sg = qc->sg;
 
 	if (qc->cursect == (qc->nsect - 1))
-		ap->thr_state = THR_PIO_LAST;
+		ap->pio_task_state = PIO_ST_LAST;
 
 	buf = kmap(sg[qc->cursg].page) +
 	      sg[qc->cursg].offset + (qc->cursg_ofs * ATA_SECT_SIZE);
@@ -2107,20 +2102,48 @@ static void ata_pio_sector(struct ata_port *ap)
 	kunmap(sg[qc->cursg].page);
 }
 
-#if 0 /* to be used eventually */
-/**
- *	ata_eng_schedule - run an iteration of the pio/dma/whatever engine
- *	@ap: port on which activity will occur
- *	@eng: instance of engine
- *
- *	LOCKING:
- *	spin_lock_irqsave(host_set lock)
- */
-static void ata_eng_schedule (struct ata_port *ap, struct ata_engine *eng)
+static void ata_pio_task(void *_data)
 {
-	/* FIXME */
+	struct ata_port *ap = _data;
+	unsigned long timeout = 0;
+
+	switch (ap->pio_task_state) {
+	case PIO_ST:
+		ata_pio_sector(ap);
+		break;
+
+	case PIO_ST_LAST:
+		ata_pio_complete(ap);
+		break;
+
+	case PIO_ST_POLL:
+	case PIO_ST_LAST_POLL:
+		timeout = ata_pio_poll(ap);
+		break;
+
+	case PIO_ST_TMOUT:
+		printk(KERN_ERR "ata%d: FIXME: PIO_ST_TMOUT\n", /* FIXME */
+		       ap->id);
+		timeout = 11 * HZ;
+		break;
+
+	case PIO_ST_ERR:
+		printk(KERN_ERR "ata%d: FIXME: PIO_ST_ERR\n", /* FIXME */
+		       ap->id);
+		timeout = 11 * HZ;
+		break;
+	}
+
+	if ((ap->pio_task_state != PIO_ST_IDLE) &&
+	    (ap->pio_task_state != PIO_ST_TMOUT) &&
+	    (ap->pio_task_state != PIO_ST_ERR)) {
+		if (timeout)
+			queue_delayed_work(ata_wq, &ap->pio_task,
+					   timeout);
+		else
+			queue_work(ata_wq, &ap->pio_task);
+	}
 }
-#endif
 
 /**
  *	ata_eng_timeout - Handle timeout of queued command
@@ -2174,7 +2197,7 @@ void ata_eng_timeout(struct ata_port *ap)
 		printk(KERN_ERR "ata%u: DMA timeout, stat 0x%x\n",
 		       ap->id, host_stat);
 
-		ata_dma_complete(ap, host_stat, 1);
+		ata_dma_complete(qc, host_stat);
 		break;
 
 	case ATA_PROT_NODATA:
@@ -2183,7 +2206,7 @@ void ata_eng_timeout(struct ata_port *ap)
 		printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x\n",
 		       ap->id, qc->tf.command, drv_stat);
 
-		ata_qc_complete(qc, drv_stat, 1);
+		ata_qc_complete(qc, drv_stat);
 		break;
 
 	default:
@@ -2192,7 +2215,7 @@ void ata_eng_timeout(struct ata_port *ap)
 		printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
 		       ap->id, qc->tf.command, drv_stat);
 
-		ata_qc_complete(qc, drv_stat, 1);
+		ata_qc_complete(qc, drv_stat);
 		break;
 	}
 
@@ -2201,9 +2224,9 @@ out:
 }
 
 /**
- *	ata_qc_new -
- *	@ap:
- *	@dev:
+ *	ata_qc_new - Request an available ATA command, for queueing
+ *	@ap: Port associated with device @dev
+ *	@dev: Device from whom we request an available command structure
  *
  *	LOCKING:
  */
@@ -2226,9 +2249,9 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
 }
 
 /**
- *	ata_qc_new_init -
- *	@ap:
- *	@dev:
+ *	ata_qc_new_init - Request an available ATA command, and initialize it
+ *	@ap: Port associated with device @dev
+ *	@dev: Device from whom we request an available command structure
  *
  *	LOCKING:
  */
@@ -2246,8 +2269,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
 		qc->ap = ap;
 		qc->dev = dev;
 		qc->cursect = qc->cursg = qc->cursg_ofs = 0;
-		INIT_LIST_HEAD(&qc->node);
-		init_MUTEX_LOCKED(&qc->sem);
+		qc->nsect = 0;
 
 		ata_tf_init(ap, &qc->tf, dev->devno);
 
@@ -2261,16 +2283,15 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
 }
 
 /**
- *	ata_qc_complete -
- *	@qc:
- *	@drv_stat:
- *	@done_late:
+ *	ata_qc_complete - Complete an active ATA command
+ *	@qc: Command to complete
+ *	@drv_stat: ATA status register contents
  *
  *	LOCKING:
  *
  */
 
-void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_late)
+void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
 {
 	struct ata_port *ap = qc->ap;
 	struct scsi_cmnd *cmd = qc->scsicmd;
@@ -2284,7 +2305,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_l
 
 	if (cmd) {
 		if (unlikely(drv_stat & (ATA_ERR | ATA_BUSY | ATA_DRQ))) {
-			if (qc->flags & ATA_QCFLAG_ATAPI)
+			if (is_atapi_taskfile(&qc->tf))
 				cmd->result = SAM_STAT_CHECK_CONDITION;
 			else
 				ata_to_sense_error(qc);
@@ -2304,89 +2325,124 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_l
 		do_clear = 1;
 	}
 
-	up(&qc->sem);
+	if (qc->waiting)
+		complete(qc->waiting);
 
 	if (likely(do_clear))
 		clear_bit(tag, &ap->qactive);
 }
 
-#if 0 /* to be used eventually */
 /**
- *	ata_qc_push -
- *	@qc:
- *	@append:
+ *	ata_qc_issue - issue taskfile to device
+ *	@qc: command to issue to device
+ *
+ *	Prepare an ATA command to submission to device.
+ *	This includes mapping the data into a DMA-able
+ *	area, filling in the S/G table, and finally
+ *	writing the taskfile to hardware, starting the command.
  *
  *	LOCKING:
  *	spin_lock_irqsave(host_set lock)
+ *
+ *	RETURNS:
+ *	Zero on success, negative on error.
  */
-static void ata_qc_push (struct ata_queued_cmd *qc, unsigned int append)
+
+int ata_qc_issue(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	struct ata_engine *eng = &ap->eng;
+	struct scsi_cmnd *cmd = qc->scsicmd;
 
-	if (likely(append))
-		list_add_tail(&qc->node, &eng->q);
-	else
-		list_add(&qc->node, &eng->q);
+	if (qc->flags & ATA_QCFLAG_SG) {
+		/* set up SG table */
+		if (cmd->use_sg) {
+			if (ata_sg_setup(qc))
+				goto err_out;
+		} else {
+			if (ata_sg_setup_one(qc))
+				goto err_out;
+		}
 
-	if (!test_and_set_bit(ATA_EFLG_ACTIVE, &eng->flags))
-		ata_eng_schedule(ap, eng);
+		ap->ops->fill_sg(qc);
+	}
+
+	qc->ap->active_tag = qc->tag;
+	qc->flags |= ATA_QCFLAG_ACTIVE;
+
+	return ata_qc_issue_prot(qc);
+
+err_out:
+	return -1;
 }
-#endif
 
 /**
- *	ata_qc_issue -
- *	@qc:
+ *	ata_qc_issue_prot - issue taskfile to device in proto-dependent manner
+ *	@qc: command to issue to device
+ *
+ *	Using various libata functions and hooks, this function
+ *	starts an ATA command.  ATA commands are grouped into
+ *	classes called "protocols", and issuing each type of protocol
+ *	is slightly different.
  *
  *	LOCKING:
+ *	spin_lock_irqsave(host_set lock)
  *
  *	RETURNS:
- *
+ *	Zero on success, negative on error.
  */
-int ata_qc_issue(struct ata_queued_cmd *qc)
+
+static int ata_qc_issue_prot(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	struct scsi_cmnd *cmd = qc->scsicmd;
-	unsigned int dma = qc->flags & ATA_QCFLAG_DMA;
 
 	ata_dev_select(ap, qc->dev->devno, 1, 0);
 
-	/* set up SG table */
-	if (cmd->use_sg) {
-		if (ata_sg_setup(qc))
-			goto err_out;
-	} else {
-		if (ata_sg_setup_one(qc))
-			goto err_out;
-	}
+	switch (qc->tf.protocol) {
+	case ATA_PROT_NODATA:
+		ata_tf_to_host_nolock(ap, &qc->tf);
+		break;
 
-	ap->ops->fill_sg(qc);
+	case ATA_PROT_DMA:
+		ap->ops->tf_load(ap, &qc->tf);	 /* load tf registers */
+		ap->ops->bmdma_setup(qc);	    /* set up bmdma */
+		ap->ops->bmdma_start(qc);	    /* initiate bmdma */
+		break;
 
-	qc->ap->active_tag = qc->tag;
-	qc->flags |= ATA_QCFLAG_ACTIVE;
+	case ATA_PROT_PIO: /* load tf registers, initiate polling pio */
+		ata_qc_set_polling(qc);
+		ata_tf_to_host_nolock(ap, &qc->tf);
+		ap->pio_task_state = PIO_ST;
+		queue_work(ata_wq, &ap->pio_task);
+		break;
 
-	if (likely(dma)) {
-		ap->ops->tf_load(ap, &qc->tf);	/* load tf registers */
-		ap->ops->bmdma_start(qc);	/* initiate bmdma */
-	} else
-		/* load tf registers, initiate polling pio */
-		ata_pio_start(qc);
+	case ATA_PROT_ATAPI:
+		ata_tf_to_host_nolock(ap, &qc->tf);
+		queue_work(ata_wq, &ap->packet_task);
+		break;
 
-	return 0;
+	case ATA_PROT_ATAPI_DMA:
+		ap->ops->tf_load(ap, &qc->tf);	 /* load tf registers */
+		ap->ops->bmdma_setup(qc);	    /* set up bmdma */
+		queue_work(ata_wq, &ap->packet_task);
+		break;
 
-err_out:
-	return -1;
+	default:
+		WARN_ON(1);
+		return -1;
+	}
+
+	return 0;
 }
 
 /**
- *	ata_bmdma_start_mmio -
- *	@qc:
+ *	ata_bmdma_setup_mmio - Set up PCI IDE BMDMA transaction (MMIO)
+ *	@qc: Info associated with this ATA transaction.
  *
  *	LOCKING:
  *	spin_lock_irqsave(host_set lock)
  */
 
-void ata_bmdma_start_mmio (struct ata_queued_cmd *qc)
+void ata_bmdma_setup_mmio (struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 	unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
@@ -2410,8 +2466,24 @@ void ata_bmdma_start_mmio (struct ata_queued_cmd *qc)
 
 	/* issue r/w command */
 	ap->ops->exec_command(ap, &qc->tf);
+}
+
+/**
+ *	ata_bmdma_start_mmio - Start a PCI IDE BMDMA transaction (MMIO)
+ *	@qc: Info associated with this ATA transaction.
+ *
+ *	LOCKING:
+ *	spin_lock_irqsave(host_set lock)
+ */
+
+void ata_bmdma_start_mmio (struct ata_queued_cmd *qc)
+{
+	struct ata_port *ap = qc->ap;
+	void *mmio = (void *) ap->ioaddr.bmdma_addr;
+	u8 dmactl;
 
 	/* start host DMA transaction */
+	dmactl = readb(mmio + ATA_DMA_CMD);
 	writeb(dmactl | ATA_DMA_START, mmio + ATA_DMA_CMD);
 
 	/* Strictly, one may wish to issue a readb() here, to
@@ -2428,14 +2500,14 @@ void ata_bmdma_start_mmio (struct ata_queued_cmd *qc)
 }
 
 /**
- *	ata_bmdma_start_pio -
- *	@qc:
+ *	ata_bmdma_setup_pio - Set up PCI IDE BMDMA transaction (PIO)
+ *	@qc: Info associated with this ATA transaction.
  *
  *	LOCKING:
  *	spin_lock_irqsave(host_set lock)
  */
 
-void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
+void ata_bmdma_setup_pio (struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 	unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
@@ -2458,24 +2530,38 @@ void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
 
 	/* issue r/w command */
 	ap->ops->exec_command(ap, &qc->tf);
+}
+
+/**
+ *	ata_bmdma_start_pio - Start a PCI IDE BMDMA transaction (PIO)
+ *	@qc: Info associated with this ATA transaction.
+ *
+ *	LOCKING:
+ *	spin_lock_irqsave(host_set lock)
+ */
+
+void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
+{
+	struct ata_port *ap = qc->ap;
+	u8 dmactl;
 
 	/* start host DMA transaction */
+	dmactl = inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
 	outb(dmactl | ATA_DMA_START,
 	     ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
 }
 
 /**
- *	ata_dma_complete -
- *	@ap:
- *	@host_stat:
- *	@done_late:
+ *	ata_dma_complete - Complete an active ATA BMDMA command
+ *	@qc: Command to complete
+ *	@host_stat: BMDMA status register contents
  *
  *	LOCKING:
  */
 
-static void ata_dma_complete(struct ata_port *ap, u8 host_stat,
-			     unsigned int done_late)
+static void ata_dma_complete(struct ata_queued_cmd *qc, u8 host_stat)
 {
+	struct ata_port *ap = qc->ap;
 	VPRINTK("ENTER\n");
 
 	if (ap->flags & ATA_FLAG_MMIO) {
@@ -2506,8 +2592,7 @@ static void ata_dma_complete(struct ata_port *ap, u8 host_stat,
 		ap->id, (u32) host_stat, (u32) ata_chk_status(ap));
 
 	/* get drive status; clear intr; complete txn */
-	ata_qc_complete(ata_qc_from_tag(ap, ap->active_tag),
-			ata_wait_idle(ap), done_late);
+	ata_qc_complete(qc, ata_wait_idle(ap));
 }
 
 /**
@@ -2533,7 +2618,10 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
 	unsigned int handled = 0;
 
 	switch (qc->tf.protocol) {
+
+	/* BMDMA completion */
 	case ATA_PROT_DMA:
+	case ATA_PROT_ATAPI_DMA:
 		if (ap->flags & ATA_FLAG_MMIO) {
 			void *mmio = (void *) ap->ioaddr.bmdma_addr;
 			host_stat = readb(mmio + ATA_DMA_STATUS);
@@ -2546,14 +2634,23 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
 			break;
 		}
 
-		ata_dma_complete(ap, host_stat, 0);
+		ata_dma_complete(qc, host_stat);
 		handled = 1;
 		break;
 
-	case ATA_PROT_NODATA:	/* command completion, but no data xfer */
+	/* command completion, but no data xfer */
+	/* FIXME: a shared interrupt _will_ cause a non-data command
+	 * to be completed prematurely, with an error.
+	 *
+	 * This doesn't matter right now, since we aren't sending
+	 * non-data commands down this pipe except in development
+	 * situations.
+	 */
+	case ATA_PROT_ATAPI:
+	case ATA_PROT_NODATA:
 		status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
 		DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status);
-		ata_qc_complete(qc, status, 0);
+		ata_qc_complete(qc, status);
 		handled = 1;
 		break;
 
@@ -2574,10 +2671,10 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
 }
 
 /**
- *	ata_interrupt -
- *	@irq:
- *	@dev_instance:
- *	@regs:
+ *	ata_interrupt - Default ATA host interrupt handler
+ *	@irq: irq line
+ *	@dev_instance: pointer to our host information structure
+ *	@regs: unused
  *
  *	LOCKING:
  *
@@ -2603,7 +2700,7 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 			struct ata_queued_cmd *qc;
 
 			qc = ata_qc_from_tag(ap, ap->active_tag);
-			if (qc && ((qc->flags & ATA_QCFLAG_POLL) == 0))
+			if (qc && (!(qc->tf.ctl & ATA_NIEN)))
 				handled += ata_host_intr(ap, qc);
 		}
 	}
@@ -2613,36 +2710,6 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 	return IRQ_RETVAL(handled);
 }
 
-/**
- *	ata_thread_wake -
- *	@ap:
- *	@thr_state:
- *
- *	LOCKING:
- *	spin_lock_irqsave(host_set lock)
- */
-
-void ata_thread_wake(struct ata_port *ap, unsigned int thr_state)
-{
-	assert(ap->thr_state == THR_IDLE);
-	ap->thr_state = thr_state;
-	up(&ap->thr_sem);
-}
-
-/**
- *	ata_thread_timer -
- *	@opaque:
- *
- *	LOCKING:
- */
-
-static void ata_thread_timer(unsigned long opaque)
-{
-	struct ata_port *ap = (struct ata_port *) opaque;
-
-	up(&ap->thr_sem);
-}
-
 /**
  *	ata_thread_iter -
  *	@ap:
@@ -2666,7 +2733,6 @@ static unsigned long ata_thread_iter(struct ata_port *ap)
 		break;
 
 	case THR_PROBE_START:
-		down(&ap->sem);
 		ap->thr_state = THR_PORT_RESET;
 		break;
 
@@ -2685,40 +2751,8 @@ static unsigned long ata_thread_iter(struct ata_port *ap)
 		break;
 
 	case THR_AWAIT_DEATH:
-		timeout = -1;
-		break;
-
 	case THR_IDLE:
-		timeout = 30 * HZ;
-		break;
-
-	case THR_PIO:
-		ata_pio_sector(ap);
-		break;
-
-	case THR_PIO_LAST:
-		ata_pio_complete(ap);
-		break;
-
-	case THR_PIO_POLL:
-	case THR_PIO_LAST_POLL:
-		timeout = ata_pio_poll(ap);
-		break;
-
-	case THR_PIO_TMOUT:
-		printk(KERN_ERR "ata%d: FIXME: THR_PIO_TMOUT\n", /* FIXME */
-		       ap->id);
-		timeout = 11 * HZ;
-		break;
-
-	case THR_PIO_ERR:
-		printk(KERN_ERR "ata%d: FIXME: THR_PIO_ERR\n", /* FIXME */
-		       ap->id);
-		timeout = 11 * HZ;
-		break;
-
-	case THR_PACKET:
-		atapi_cdb_send(ap);
+		timeout = -1;
 		break;
 
 	default:
@@ -2733,86 +2767,8 @@ static unsigned long ata_thread_iter(struct ata_port *ap)
 }
 
 /**
- *	ata_thread -
- *	@data:
- *
- *	LOCKING:
- *
- *	RETURNS:
- *
- */
-
-static int ata_thread (void *data)
-{
-        struct ata_port *ap = data;
-	long timeout;
-
-	daemonize ("katad-%u", ap->id);
-	allow_signal(SIGTERM);
-
-        while (1) {
-		cond_resched();
-
-		timeout = ata_thread_iter(ap);
-
-                if (signal_pending (current))
-                        flush_signals(current);
-                        
-                if (current->flags & PF_FREEZE)
-			refrigerator(PF_FREEZE);
-                                                        
-
-                if ((timeout < 0) || (ap->time_to_die))
-                        break;
-
- 		/* note sleeping for full timeout not guaranteed (that's ok) */
-		if (timeout) {
-			mod_timer(&ap->thr_timer, jiffies + timeout);
-			down_interruptible(&ap->thr_sem);
-
-                	if (signal_pending (current))
-                        	flush_signals(current);
-
-                	if (ap->time_to_die)
-                        	break;
-		}
-        }
-
-	printk(KERN_DEBUG "ata%u: thread exiting\n", ap->id);
-	ap->thr_pid = -1;
-	del_timer_sync(&ap->thr_timer);
-	complete_and_exit (&ap->thr_exited, 0);
-}
-
-/**
- *	ata_thread_kill - kill per-port kernel thread
- *	@ap: port those thread is to be killed
- *
- *	LOCKING:
- *
- */
-
-static int ata_thread_kill(struct ata_port *ap)
-{
-	int ret = 0;
-
-	if (ap->thr_pid >= 0) {
-		ap->time_to_die = 1;
-		wmb();
-		ret = kill_proc(ap->thr_pid, SIGTERM, 1);
-		if (ret)
-			printk(KERN_ERR "ata%d: unable to kill kernel thread\n",
-			       ap->id);
-		else
-			wait_for_completion(&ap->thr_exited);
-	}
-
-	return ret;
-}
-
-/**
- *	atapi_cdb_send - Write CDB bytes to hardware
- *	@ap: Port to which ATAPI device is attached.
+ *	atapi_packet_task - Write CDB bytes to hardware
+ *	@_data: Port to which ATAPI device is attached.
  *
  *	When device has indicated its readiness to accept
  *	a CDB, this function is called.  Send the CDB.
@@ -2824,8 +2780,9 @@ static int ata_thread_kill(struct ata_port *ap)
  *	Kernel thread context (may sleep)
  */
 
-static void atapi_cdb_send(struct ata_port *ap)
+static void atapi_packet_task(void *_data)
 {
+	struct ata_port *ap = _data;
 	struct ata_queued_cmd *qc;
 	u8 status;
 
@@ -2850,30 +2807,24 @@ static void atapi_cdb_send(struct ata_port *ap)
 	      qc->scsicmd->cmnd, ap->host->max_cmd_len / 4);
 
 	/* if we are DMA'ing, irq handler takes over from here */
-	if (qc->tf.feature == ATAPI_PKT_DMA)
-		goto out;
-
-	/* sleep-wait for BSY to clear */
-	DPRINTK("busy wait 2\n");
-	if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB))
-		goto err_out;
+	if (qc->tf.protocol == ATA_PROT_ATAPI_DMA)
+		ap->ops->bmdma_start(qc);	    /* initiate bmdma */
 
-	/* wait for BSY,DRQ to clear */
-	status = ata_wait_idle(ap);
-	if (status & (ATA_BUSY | ATA_DRQ))
-		goto err_out;
+	/* non-data commands are also handled via irq */
+	else if (qc->scsicmd->sc_data_direction == SCSI_DATA_NONE) {
+		/* do nothing */
+	}
 
-	/* transaction completed, indicate such to scsi stack */
-	ata_qc_complete(qc, status, 0);
-	ata_irq_on(ap);
+	/* PIO commands are handled by polling */
+	else {
+		ap->pio_task_state = PIO_ST;
+		queue_work(ata_wq, &ap->pio_task);
+	}
 
-out:
-	ap->thr_state = THR_IDLE;
 	return;
 
 err_out:
-	ata_qc_complete(qc, ATA_ERR, 0);
-	goto out;
+	ata_qc_complete(qc, ATA_ERR);
 }
 
 int ata_port_start (struct ata_port *ap)
@@ -2883,7 +2834,7 @@ int ata_port_start (struct ata_port *ap)
 	ap->prd = pci_alloc_consistent(pdev, ATA_PRD_TBL_SZ, &ap->prd_dma);
 	if (!ap->prd)
 		return -ENOMEM;
-	
+
 	DPRINTK("prd alloc, virt %p, dma %llx\n", ap->prd, (unsigned long long) ap->prd_dma);
 
 	return 0;
@@ -2896,10 +2847,25 @@ void ata_port_stop (struct ata_port *ap)
 	pci_free_consistent(pdev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);
 }
 
+static void ata_probe_task(void *_data)
+{
+	struct ata_port *ap = _data;
+	long timeout;
+
+	timeout = ata_thread_iter(ap);
+	if (timeout < 0)
+		return;
+
+	if (timeout > 0)
+		queue_delayed_work(ata_wq, &ap->probe_task, timeout);
+	else
+		queue_work(ata_wq, &ap->probe_task);
+}
+
 /**
- *	ata_host_remove -
- *	@ap:
- *	@do_unregister:
+ *	ata_host_remove - Unregister SCSI host structure with upper layers
+ *	@ap: Port to unregister
+ *	@do_unregister: 1 if we fully unregister, 0 to just stop the port
  *
  *	LOCKING:
  */
@@ -2913,16 +2879,16 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
 	if (do_unregister)
 		scsi_remove_host(sh);
 
-	ata_thread_kill(ap);	/* FIXME: check return val */
-
 	ap->ops->port_stop(ap);
 }
 
 /**
- *	ata_host_init -
- *	@host:
- *	@ent:
- *	@port_no:
+ *	ata_host_init - Initialize an ata_port structure
+ *	@ap: Structure to initialize
+ *	@host: associated SCSI mid-layer structure
+ *	@host_set: Collection of hosts to which @ap belongs
+ *	@ent: Probe information provided by low-level driver
+ *	@port_no: Port number associated with this ata_port
  *
  *	LOCKING:
  *
@@ -2958,21 +2924,14 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
 	ap->active_tag = ATA_TAG_POISON;
 	ap->last_ctl = 0xFF;
 
-	/* ata_engine init */
-	ap->eng.flags = 0;
-	INIT_LIST_HEAD(&ap->eng.q);
+	INIT_WORK(&ap->packet_task, atapi_packet_task, ap);
+	INIT_WORK(&ap->pio_task, ata_pio_task, ap);
+	INIT_WORK(&ap->probe_task, ata_probe_task, ap);
 
 	for (i = 0; i < ATA_MAX_DEVICES; i++)
 		ap->device[i].devno = i;
 
-	init_completion(&ap->thr_exited);
 	init_MUTEX_LOCKED(&ap->probe_sem);
-	init_MUTEX_LOCKED(&ap->sem);
-	init_MUTEX_LOCKED(&ap->thr_sem);
-
-	init_timer(&ap->thr_timer);
-	ap->thr_timer.function = ata_thread_timer;
-	ap->thr_timer.data = (unsigned long) ap;
 
 #ifdef ATA_IRQ_TRAP
 	ap->stats.unhandled_irq = 1;
@@ -2983,10 +2942,10 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
 }
 
 /**
- *	ata_host_add -
- *	@ent:
- *	@host_set:
- *	@port_no:
+ *	ata_host_add - Attach low-level ATA driver to system
+ *	@ent: Information provided by low-level driver
+ *	@host_set: Collections of ports to which we add
+ *	@port_no: Port number associated with this host
  *
  *	LOCKING:
  *
@@ -3015,18 +2974,8 @@ static struct ata_port * ata_host_add(struct ata_probe_ent *ent,
 	if (rc)
 		goto err_out;
 
-	ap->thr_pid = kernel_thread(ata_thread, ap, CLONE_FS | CLONE_FILES);
-	if (ap->thr_pid < 0) {
-		printk(KERN_ERR "ata%d: unable to start kernel thread\n",
-		       ap->id);
-		goto err_out_free;
-	}
-
 	return ap;
 
-err_out_free:
-	ap->ops->port_stop(ap);
-
 err_out:
 	scsi_host_put(host);
 	return NULL;
@@ -3106,7 +3055,7 @@ int ata_device_add(struct ata_probe_ent *ent)
 		ap = host_set->ports[i];
 
 		DPRINTK("ata%u: probe begin\n", ap->id);
-		up(&ap->sem);		/* start probe */
+		queue_work(ata_wq, &ap->probe_task);	/* start probe */
 
 		DPRINTK("ata%u: probe-wait begin\n", ap->id);
 		down(&ap->probe_sem);	/* wait for end */
@@ -3152,7 +3101,7 @@ err_out:
  *	ata_scsi_release - SCSI layer callback hook for host unload
  *	@host: libata host to be unloaded
  *
- *	Performs all duties necessary to shut down a libata port:
+ *	Performs all duties necessary to shut down a libata port...
  *	Kill port kthread, disable port, and release resources.
  *
  *	LOCKING:
@@ -3177,7 +3126,7 @@ int ata_scsi_release(struct Scsi_Host *host)
 
 /**
  *	ata_std_ports - initialize ioaddr with standard port offsets.
- *	@ioaddr:
+ *	@ioaddr: IO address structure to be initialized
  */
 void ata_std_ports(struct ata_ioports *ioaddr)
 {
@@ -3194,10 +3143,10 @@ void ata_std_ports(struct ata_ioports *ioaddr)
 }
 
 /**
- *	ata_pci_init_one -
- *	@pdev:
- *	@port_info:
- *	@n_ports:
+ *	ata_pci_init_one - Initialize/register PCI IDE host controller
+ *	@pdev: Controller to be initialized
+ *	@port_info: Information from low-level host driver
+ *	@n_ports: Number of ports attached to host controller
  *
  *	LOCKING:
  *	Inherited from PCI layer (may sleep).
@@ -3489,11 +3438,21 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
 
 static int __init ata_init(void)
 {
+	ata_wq = create_workqueue("ata");
+	if (!ata_wq)
+		return -ENOMEM;
+
 	printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
 	return 0;
 }
 
+static void __exit ata_exit(void)
+{
+	destroy_workqueue(ata_wq);
+}
+
 module_init(ata_init);
+module_exit(ata_exit);
 
 /*
  * libata is essentially a library of internal helper functions for
@@ -3512,6 +3471,8 @@ EXPORT_SYMBOL_GPL(ata_tf_load_pio);
 EXPORT_SYMBOL_GPL(ata_tf_load_mmio);
 EXPORT_SYMBOL_GPL(ata_tf_read_pio);
 EXPORT_SYMBOL_GPL(ata_tf_read_mmio);
+EXPORT_SYMBOL_GPL(ata_tf_to_fis);
+EXPORT_SYMBOL_GPL(ata_tf_from_fis);
 EXPORT_SYMBOL_GPL(ata_check_status_pio);
 EXPORT_SYMBOL_GPL(ata_check_status_mmio);
 EXPORT_SYMBOL_GPL(ata_exec_command_pio);
@@ -3520,7 +3481,9 @@ EXPORT_SYMBOL_GPL(ata_port_start);
 EXPORT_SYMBOL_GPL(ata_port_stop);
 EXPORT_SYMBOL_GPL(ata_interrupt);
 EXPORT_SYMBOL_GPL(ata_fill_sg);
+EXPORT_SYMBOL_GPL(ata_bmdma_setup_pio);
 EXPORT_SYMBOL_GPL(ata_bmdma_start_pio);
+EXPORT_SYMBOL_GPL(ata_bmdma_setup_mmio);
 EXPORT_SYMBOL_GPL(ata_bmdma_start_mmio);
 EXPORT_SYMBOL_GPL(ata_port_probe);
 EXPORT_SYMBOL_GPL(sata_phy_reset);
@@ -3533,3 +3496,4 @@ EXPORT_SYMBOL_GPL(ata_scsi_error);
 EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
 EXPORT_SYMBOL_GPL(ata_scsi_release);
 EXPORT_SYMBOL_GPL(ata_host_intr);
+EXPORT_SYMBOL_GPL(ata_dev_id_string);
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 7b5a97898..fed311e81 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -27,7 +27,7 @@
 #include <linux/spinlock.h>
 #include <scsi/scsi.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #include "libata.h"
@@ -46,8 +46,8 @@ static void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
  *	@geom: location to which geometry will be output
  *
  *	Generic bios head/sector/cylinder calculator
- *	used by sd. Most BIOSes nowadays expect a XXX/255/16  (CHS) 
- *	mapping. Some situations may arise where the disk is not 
+ *	used by sd. Most BIOSes nowadays expect a XXX/255/16  (CHS)
+ *	mapping. Some situations may arise where the disk is not
  *	bootable if this is not used.
  *
  *	LOCKING:
@@ -57,7 +57,7 @@ static void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
  *	Zero.
  */
 int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
-		       sector_t capacity, int geom[]) 
+		       sector_t capacity, int geom[])
 {
 	geom[0] = 255;
 	geom[1] = 63;
@@ -167,8 +167,27 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
 {
 	sdev->use_10_for_rw = 1;
 	sdev->use_10_for_ms = 1;
+
 	blk_queue_max_phys_segments(sdev->request_queue, LIBATA_MAX_PRD);
 
+	if (sdev->id < ATA_MAX_DEVICES) {
+		struct ata_port *ap;
+		struct ata_device *dev;
+
+		ap = (struct ata_port *) &sdev->host->hostdata[0];
+		dev = &ap->device[sdev->id];
+
+		/* TODO: 1024 is an arbitrary number, not the
+		 * hardware maximum.  This should be increased to
+		 * 65534 when Jens Axboe's patch for dynamically
+		 * determining max_sectors is merged.
+		 */
+		if (dev->flags & ATA_DFLAG_LBA48) {
+			sdev->host->max_sectors = 2048;
+			blk_queue_max_sectors(sdev->request_queue, 2048);
+		}
+	}
+
 	return 0;	/* scsi layer doesn't check return value, sigh */
 }
 
@@ -321,6 +340,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
  *	@dev: ATA device to which the command is addressed
  *	@cmd: SCSI command to execute
  *	@done: SCSI command completion function
+ *	@xlat_func: Actor which translates @cmd to an ATA taskfile
  *
  *	Our ->queuecommand() function has decided that the SCSI
  *	command issued can be directly translated into an ATA
@@ -343,19 +363,20 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
 
 	VPRINTK("ENTER\n");
 
-	if (unlikely(cmd->request_bufflen < 1)) {
-		printk(KERN_WARNING "ata%u(%u): empty request buffer\n",
-		       ap->id, dev->devno);
-		goto err_out;
-	}
-
 	qc = ata_scsi_qc_new(ap, dev, cmd, done);
 	if (!qc)
 		return;
 
 	if (cmd->sc_data_direction == SCSI_DATA_READ ||
-	    cmd->sc_data_direction == SCSI_DATA_WRITE)
+	    cmd->sc_data_direction == SCSI_DATA_WRITE) {
+		if (unlikely(cmd->request_bufflen < 1)) {
+			printk(KERN_WARNING "ata%u(%u): WARNING: zero len r/w req\n",
+			       ap->id, dev->devno);
+			goto err_out;
+		}
+
 		qc->flags |= ATA_QCFLAG_SG; /* data is present; dma-map it */
+	}
 
 	if (xlat_func(qc, scsicmd))
 		goto err_out;
@@ -478,7 +499,9 @@ void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
 unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
 			       unsigned int buflen)
 {
-	const u8 hdr[] = {
+	struct ata_device *dev = args->dev;
+
+	u8 hdr[] = {
 		TYPE_DISK,
 		0,
 		0x5,	/* claim SPC-3 version compatibility */
@@ -486,14 +509,20 @@ unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
 		96 - 4
 	};
 
+	/* set scsi removeable (RMB) bit per ata bit */
+	if (ata_id_removeable(dev))
+		hdr[1] |= (1 << 7);
+
 	VPRINTK("ENTER\n");
 
 	memcpy(rbuf, hdr, sizeof(hdr));
 
 	if (buflen > 36) {
-		memcpy(&rbuf[8], args->dev->vendor, 8);
-		memcpy(&rbuf[16], args->dev->product, 16);
-		memcpy(&rbuf[32], DRV_VERSION, 4);
+		memcpy(&rbuf[8], "ATA     ", 8);
+		ata_dev_id_string(dev, &rbuf[16], ATA_ID_PROD_OFS, 16);
+		ata_dev_id_string(dev, &rbuf[32], ATA_ID_FW_REV_OFS, 4);
+		if (rbuf[32] == 0 || rbuf[32] == ' ')
+			memcpy(&rbuf[32], "n/a ", 4);
 	}
 
 	if (buflen > 63) {
@@ -667,9 +696,17 @@ static void ata_msense_push(u8 **ptr_io, const u8 *last,
 static unsigned int ata_msense_caching(struct ata_device *dev, u8 **ptr_io,
 				       const u8 *last)
 {
-	u8 page[7] = { 0xf, 0, 0x10, 0, 0x8, 0xa, 0 };
-	if (dev->flags & ATA_DFLAG_WCACHE)
-		page[6] = 0x4;
+	u8 page[] = {
+		0x8,				/* page code */
+		0x12,				/* page length */
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0,	/* 10 zeroes */
+		0, 0, 0, 0, 0, 0, 0, 0		/* 8 zeroes */
+	};
+
+	if (ata_id_wcache_enabled(dev))
+		page[2] |= (1 << 2);	/* write cache enable */
+	if (!ata_id_rahead_enabled(dev))
+		page[12] |= (1 << 5);	/* disable read ahead */
 
 	ata_msense_push(ptr_io, last, page, sizeof(page));
 	return sizeof(page);
@@ -695,6 +732,31 @@ static unsigned int ata_msense_ctl_mode(u8 **ptr_io, const u8 *last)
 	return sizeof(page);
 }
 
+/**
+ *	ata_msense_rw_recovery - Simulate MODE SENSE r/w error recovery page
+ *	@dev: Device associated with this MODE SENSE command
+ *	@ptr_io: (input/output) Location to store more output data
+ *	@last: End of output data buffer
+ *
+ *	Generate a generic MODE SENSE r/w error recovery page.
+ *
+ *	LOCKING:
+ *	None.
+ */
+
+static unsigned int ata_msense_rw_recovery(u8 **ptr_io, const u8 *last)
+{
+	const u8 page[] = {
+		0x1,			  /* page code */
+		0xa,			  /* page length */
+		(1 << 7) | (1 << 6),	  /* note auto r/w reallocation */
+		0, 0, 0, 0, 0, 0, 0, 0, 0 /* 9 zeroes */
+	};
+
+	ata_msense_push(ptr_io, last, page, sizeof(page));
+	return sizeof(page);
+}
+
 /**
  *	ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands
  *	@args: Port / device / SCSI command of interest.
@@ -734,6 +796,10 @@ unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf,
 	last = rbuf + buflen - 1;
 
 	switch(scsicmd[2] & 0x3f) {
+	case 0x01:		/* r/w error recovery */
+		output_len += ata_msense_rw_recovery(&p, last);
+		break;
+
 	case 0x08:		/* caching */
 		output_len += ata_msense_caching(dev, &p, last);
 		break;
@@ -744,6 +810,7 @@ unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf,
 		}
 
 	case 0x3f:		/* all pages */
+		output_len += ata_msense_rw_recovery(&p, last);
 		output_len += ata_msense_caching(dev, &p, last);
 		output_len += ata_msense_ctl_mode(&p, last);
 		break;
@@ -784,20 +851,23 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
 
 	VPRINTK("ENTER\n");
 
-	n_sectors--;		/* one off */
+	n_sectors--;		/* ATA TotalUserSectors - 1 */
 
 	tmp = n_sectors;	/* note: truncates, if lba48 */
 	if (args->cmd->cmnd[0] == READ_CAPACITY) {
+		/* sector count, 32-bit */
 		rbuf[0] = tmp >> (8 * 3);
 		rbuf[1] = tmp >> (8 * 2);
 		rbuf[2] = tmp >> (8 * 1);
 		rbuf[3] = tmp;
 
+		/* sector size */
 		tmp = ATA_SECT_SIZE;
 		rbuf[6] = tmp >> 8;
 		rbuf[7] = tmp;
 
 	} else {
+		/* sector count, 64-bit */
 		rbuf[2] = n_sectors >> (8 * 7);
 		rbuf[3] = n_sectors >> (8 * 6);
 		rbuf[4] = n_sectors >> (8 * 5);
@@ -807,6 +877,7 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
 		rbuf[8] = tmp >> (8 * 1);
 		rbuf[9] = tmp;
 
+		/* sector size */
 		tmp = ATA_SECT_SIZE;
 		rbuf[12] = tmp >> 8;
 		rbuf[13] = tmp;
@@ -866,56 +937,20 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8
 }
 
 /**
- *	atapi_scsi_queuecmd - Send CDB to ATAPI device
- *	@ap: Port to which ATAPI device is attached.
- *	@dev: Target device for CDB.
- *	@cmd: SCSI command being sent to device.
- *	@done: SCSI command completion function.
- *
- *	Sends CDB to ATAPI device.  If the Linux SCSI layer sends a
- *	non-data command, then this function handles the command
- *	directly, via polling.  Otherwise, the bmdma engine is started.
+ *	atapi_xlat - Initialize PACKET taskfile
+ *	@qc: command structure to be initialized
+ *	@scsicmd: SCSI CDB associated with this PACKET command
  *
  *	LOCKING:
  *	spin_lock_irqsave(host_set lock)
+ *
+ *	RETURNS:
+ *	Zero on success, non-zero on failure.
  */
 
-static void atapi_scsi_queuecmd(struct ata_port *ap, struct ata_device *dev,
-			       struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
+static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
 {
-	struct ata_queued_cmd *qc;
-	u8 *scsicmd = cmd->cmnd, status;
-	unsigned int doing_dma = 0;
-
-	VPRINTK("ENTER, drv_stat = 0x%x\n", ata_chk_status(ap));
-
-	if (cmd->sc_data_direction == SCSI_DATA_UNKNOWN) {
-		DPRINTK("unknown data, scsicmd 0x%x\n", scsicmd[0]);
-		ata_bad_cdb(cmd, done);
-		return;
-	}
-
-	switch(scsicmd[0]) {
-	case READ_6:
-	case WRITE_6:
-	case MODE_SELECT:
-	case MODE_SENSE:
-		DPRINTK("read6/write6/modesel/modesense trap\n");
-		ata_bad_scsiop(cmd, done);
-		return;
-
-	default:
-		/* do nothing */
-		break;
-	}
-
-	qc = ata_scsi_qc_new(ap, dev, cmd, done);
-	if (!qc) {
-		printk(KERN_ERR "ata%u: command queue empty\n", ap->id);
-		return;
-	}
-
-	qc->flags |= ATA_QCFLAG_ATAPI;
+	struct scsi_cmnd *cmd = qc->scsicmd;
 
 	qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
 	if (cmd->sc_data_direction == SCSI_DATA_WRITE) {
@@ -925,52 +960,30 @@ static void atapi_scsi_queuecmd(struct ata_port *ap, struct ata_device *dev,
 
 	qc->tf.command = ATA_CMD_PACKET;
 
-	/* set up SG table */
-	if (cmd->sc_data_direction == SCSI_DATA_NONE) {
-		ap->active_tag = qc->tag;
-		qc->flags |= ATA_QCFLAG_ACTIVE | ATA_QCFLAG_POLL;
+	/* no data - interrupt-driven */
+	if (cmd->sc_data_direction == SCSI_DATA_NONE)
 		qc->tf.protocol = ATA_PROT_ATAPI;
 
-		ata_dev_select(ap, dev->devno, 1, 0);
+	/* PIO data xfer - polling */
+	else if ((qc->flags & ATA_QCFLAG_DMA) == 0) {
+		ata_qc_set_polling(qc);
+		qc->tf.protocol = ATA_PROT_ATAPI;
+		qc->tf.lbam = (8 * 1024) & 0xff;
+		qc->tf.lbah = (8 * 1024) >> 8;
 
-		DPRINTK("direction: none\n");
-		qc->tf.ctl |= ATA_NIEN;	/* disable interrupts */
-		ata_tf_to_host_nolock(ap, &qc->tf);
+	/* DMA data xfer - interrupt-driven */
 	} else {
-		qc->flags |= ATA_QCFLAG_SG; /* data is present; dma-map it */
-		qc->tf.feature = ATAPI_PKT_DMA;
 		qc->tf.protocol = ATA_PROT_ATAPI_DMA;
+		qc->tf.feature |= ATAPI_PKT_DMA;
 
-		doing_dma = 1;
-
-		/* select device, send command to hardware */
-		if (ata_qc_issue(qc))
-			goto err_out;
-	}
-
-	status = ata_busy_wait(ap, ATA_BUSY, 1000);
-	if (status & ATA_BUSY) {
-		ata_thread_wake(ap, THR_PACKET);
-		return;
+#ifdef ATAPI_ENABLE_DMADIR
+		/* some SATA bridges need us to indicate data xfer direction */
+		if (cmd->sc_data_direction != SCSI_DATA_WRITE)
+			qc->tf.feature |= ATAPI_DMADIR;
+#endif
 	}
-	if ((status & ATA_DRQ) == 0)
-		goto err_out;
 
-	/* FIXME: mmio-ize */
-	DPRINTK("writing cdb\n");
-	outsl(ap->ioaddr.data_addr, scsicmd, ap->host->max_cmd_len / 4);
-
-	if (!doing_dma)
-		ata_thread_wake(ap, THR_PACKET);
-
-	VPRINTK("EXIT\n");
-	return;
-
-err_out:
-	if (!doing_dma)
-		ata_irq_on(ap);	/* re-enable interrupts */
-	ata_bad_cdb(cmd, done);
-	DPRINTK("EXIT - badcmd\n");
+	return 0;
 }
 
 /**
@@ -1109,7 +1122,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 		else
 			ata_scsi_simulate(ap, dev, cmd, done);
 	} else
-		atapi_scsi_queuecmd(ap, dev, cmd, done);
+		ata_scsi_translate(ap, dev, cmd, done, atapi_xlat);
 
 out_unlock:
 	return 0;
@@ -1142,7 +1155,12 @@ static void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
 	args.done = done;
 
 	switch(scsicmd[0]) {
-		case TEST_UNIT_READY:		/* FIXME: correct? */
+		/* no-op's, complete with success */
+		case SYNCHRONIZE_CACHE:		/* FIXME: temporary */
+		case REZERO_UNIT:
+		case SEEK_6:
+		case SEEK_10:
+		case TEST_UNIT_READY:
 		case FORMAT_UNIT:		/* FIXME: correct? */
 		case SEND_DIAGNOSTIC:		/* FIXME: correct? */
 			ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index 38191bdbf..460c72c1b 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -35,17 +35,13 @@ struct ata_scsi_args {
 	void			(*done)(struct scsi_cmnd *);
 };
 
-
 /* libata-core.c */
-extern void ata_dev_id_string(struct ata_device *dev, unsigned char *s,
-			      unsigned int ofs, unsigned int len);
 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
 				      struct ata_device *dev);
 extern int ata_qc_issue(struct ata_queued_cmd *qc);
 extern void ata_dev_select(struct ata_port *ap, unsigned int device,
                            unsigned int wait, unsigned int can_sleep);
 extern void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf);
-extern void ata_thread_wake(struct ata_port *ap, unsigned int thr_state);
 
 
 /* libata-scsi.c */
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index caf78b6be..7df9fc663 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -4606,6 +4606,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	if (pci_enable_device(pdev))
 		goto out;
+	pci_set_master(pdev);
 
 	pci_bus = pdev->bus->number;
 	pci_dev_func = pdev->devfn;
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index ce2e1ac79..bc51dc60d 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -307,7 +307,7 @@ typedef u32 tagmap_t;
 **    The maximum number of segments a transfer is split into.
 **    We support up to 127 segments for both read and write.
 **    The data scripts are broken into 2 sub-scripts.
-**    80 (MAX_SCATTERL) segments are moved from a sub-script 
+**    80 (MAX_SCATTERL) segments are moved from a sub-script
 **    in on-chip RAM. This makes data transfers shorter than 
 **    80k (assuming 1k fs) as fast as possible.
 */
@@ -4542,7 +4542,7 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 	/*
 	**	command
 	*/
-	memcpy(cp->cdb_buf, cmd->cmnd, MIN(cmd->cmd_len, sizeof(cp->cdb_buf)));
+	memcpy(cp->cdb_buf, cmd->cmnd, min_t(int, cmd->cmd_len, sizeof(cp->cdb_buf)));
 	cp->phys.cmd.addr		= cpu_to_scr(CCB_PHYS (cp, cdb_buf[0]));
 	cp->phys.cmd.size		= cpu_to_scr(cmd->cmd_len);
 
@@ -5172,7 +5172,7 @@ void ncr_complete (ncb_p np, ccb_p cp)
 		**	Copy back sense data to caller's buffer.
 		*/
 		memcpy(cmd->sense_buffer, cp->sense_buf,
-		       MIN(sizeof(cmd->sense_buffer), sizeof(cp->sense_buf)));
+		       min(sizeof(cmd->sense_buffer), sizeof(cp->sense_buf)));
 
 		if (DEBUG_FLAGS & (DEBUG_RESULT|DEBUG_TINY)) {
 			u_char * p = (u_char*) & cmd->sense_buffer;
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index b6d630a59..13d5875a2 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -38,7 +38,6 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/ctype.h>
-#include <linux/interrupt.h>
 
 #include <asm/dma.h>
 #include <asm/system.h>
@@ -859,7 +858,7 @@ static int nsp32_reselection(Scsi_Cmnd *SCpnt, unsigned char newlun)
 	 * or current nexus is not existed, unexpected
 	 * reselection is occurred. Send reject message.
 	 */
-	if (newid >= NUMBER(data->lunt) || newlun >= NUMBER(data->lunt[0])) {
+	if (newid >= ARRAY_SIZE(data->lunt) || newlun >= ARRAY_SIZE(data->lunt[0])) {
 		nsp32_msg(KERN_WARNING, "unknown id/lun");
 		return FALSE;
 	} else if(data->lunt[newid][newlun].SCpnt == NULL) {
@@ -1568,7 +1567,7 @@ static int nsp32_proc_info(
 
 
 	SPRINTF("SDTR status\n");
-	for(id = 0; id < NUMBER(data->target); id++) {
+	for (id = 0; id < ARRAY_SIZE(data->target); id++) {
 
                 SPRINTF("id %d: ", id);
 
@@ -1610,7 +1609,7 @@ static int nsp32_proc_info(
         }
 
 
-	thislength = MIN(thislength, length);
+	thislength = min(thislength, length);
 	*start = buffer + offset;
 
 	return thislength;
@@ -2753,17 +2752,17 @@ static int nsp32_detect(Scsi_Host_Template *sht)
 	case CLOCK_4:
 		/* If data->clock is CLOCK_4, then select 40M sync table. */
 		data->synct   = nsp32_sync_table_40M;
-		data->syncnum = NUMBER(nsp32_sync_table_40M);
+		data->syncnum = ARRAY_SIZE(nsp32_sync_table_40M);
 		break;
 	case CLOCK_2:
 		/* If data->clock is CLOCK_2, then select 20M sync table. */
 		data->synct   = nsp32_sync_table_20M;
-		data->syncnum = NUMBER(nsp32_sync_table_20M);
+		data->syncnum = ARRAY_SIZE(nsp32_sync_table_20M);
 		break;
 	case PCICLK:
 		/* If data->clock is PCICLK, then select pci sync table. */
 		data->synct   = nsp32_sync_table_pci;
-		data->syncnum = NUMBER(nsp32_sync_table_pci);
+		data->syncnum = ARRAY_SIZE(nsp32_sync_table_pci);
 		break;
 	default:
 		nsp32_msg(KERN_WARNING,
@@ -2771,7 +2770,7 @@ static int nsp32_detect(Scsi_Host_Template *sht)
 		/* Use default value CLOCK_4 */
 		data->clock   = CLOCK_4;
 		data->synct   = nsp32_sync_table_40M;
-		data->syncnum = NUMBER(nsp32_sync_table_40M);
+		data->syncnum = ARRAY_SIZE(nsp32_sync_table_40M);
 	}
 
 	/*
@@ -2805,9 +2804,9 @@ static int nsp32_detect(Scsi_Host_Template *sht)
 		goto free_autoparam;
 	}
 
-	for (i = 0; i < NUMBER(data->lunt); i++) {
-		for (j = 0; j < NUMBER(data->lunt[0]); j++) {
-			int offset = i * NUMBER(data->lunt[0]) + j;
+	for (i = 0; i < ARRAY_SIZE(data->lunt); i++) {
+		for (j = 0; j < ARRAY_SIZE(data->lunt[0]); j++) {
+			int offset = i * ARRAY_SIZE(data->lunt[0]) + j;
 			nsp32_lunt tmp = {
 				.SCpnt       = NULL,
 				.save_datp   = 0,
@@ -2825,7 +2824,7 @@ static int nsp32_detect(Scsi_Host_Template *sht)
 	/*
 	 * setup target
 	 */
-	for (i = 0; i < NUMBER(data->target); i++) {
+	for (i = 0; i < ARRAY_SIZE(data->target); i++) {
 		nsp32_target *target = &(data->target[i]);
 
 		target->limit_entry  = 0;
@@ -3021,7 +3020,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data)
 	 * fall back to asynchronous transfer mode
 	 * initialize SDTR negotiation flag
 	 */
-	for (i = 0; i < NUMBER(data->target); i++) {
+	for (i = 0; i < ARRAY_SIZE(data->target); i++) {
 		nsp32_target *target = &data->target[i];
 
 		target->sync_flag = 0;
diff --git a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h
index 47c00a626..eddb950c5 100644
--- a/drivers/scsi/nsp32.h
+++ b/drivers/scsi/nsp32.h
@@ -70,11 +70,7 @@ typedef u16 u16_le;
 /*
  * MACRO
  */
-#define NUMBER(arr) ((int) (sizeof(arr) / sizeof(arr[0])))
 #define BIT(x)      (1UL << (x))
-#ifndef MIN
-# define MIN(a,b)   ((a) > (b) ? (b) : (a))
-#endif
 
 /*
  * BASIC Definitions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index a46519746..b26d95ead 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -154,8 +154,8 @@ static int modes_defined = FALSE;
 static OSST_buffer *new_tape_buffer(int, int, int);
 static int enlarge_buffer(OSST_buffer *, int);
 static void normalize_buffer(OSST_buffer *);
-static int append_to_buffer(const char *, OSST_buffer *, int);
-static int from_buffer(OSST_buffer *, char *, int);
+static int append_to_buffer(const char __user *, OSST_buffer *, int);
+static int from_buffer(OSST_buffer *, char __user *, int);
 static int osst_zero_buffer_tail(OSST_buffer *);
 static int osst_copy_to_buffer(OSST_buffer *, unsigned char *);
 static int osst_copy_from_buffer(OSST_buffer *, unsigned char *);
@@ -3157,13 +3157,13 @@ static void reset_state(OS_Scsi_Tape *STp)
 /* Entry points to osst */
 
 /* Write command */
-static ssize_t osst_write(struct file * filp, const char * buf, size_t count, loff_t *ppos)
+static ssize_t osst_write(struct file * filp, const char __user * buf, size_t count, loff_t *ppos)
 {
 	ssize_t        total, retval = 0;
 	ssize_t        i, do_count, blks, transfer;
 	int            write_threshold;
 	int            doing_write = 0;
-	const char   * b_point;
+	const char   __user * b_point;
 	Scsi_Request * SRpnt = NULL;
 	ST_mode      * STm;
 	ST_partstat  * STps;
@@ -3486,7 +3486,7 @@ out:
 
 
 /* Read command */
-static ssize_t osst_read(struct file * filp, char * buf, size_t count, loff_t *ppos)
+static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, loff_t *ppos)
 {
 	ssize_t        total, retval = 0;
 	ssize_t        i, transfer;
@@ -4725,6 +4725,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
 	Scsi_Request * SRpnt = NULL;
 	OS_Scsi_Tape * STp   = file->private_data;
 	char         * name  = tape_name(STp);
+	void __user *p = (void __user *)arg;
 
 	if (down_interruptible(&STp->lock))
 		return -ERESTARTSYS;
@@ -4765,7 +4766,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
 			goto out;
 		}
 
-		i = copy_from_user((char *) &mtc, (char *)arg, sizeof(struct mtop));
+		i = copy_from_user((char *) &mtc, p, sizeof(struct mtop));
 		if (i) {
 			retval = (-EFAULT);
 			goto out;
@@ -5003,8 +5004,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
 		    STp->drv_buffer != 0)
 			mt_status.mt_gstat |= GMT_IM_REP_EN(0xffffffff);
 
-		i = copy_to_user((char *)arg, (char *)&mt_status,
-		      sizeof(struct mtget));
+		i = copy_to_user(p, &mt_status, sizeof(struct mtget));
 		if (i) {
 			retval = (-EFAULT);
 			goto out;
@@ -5031,7 +5031,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
 			goto out;
 		}
 		mt_pos.mt_blkno = blk;
-		i = copy_to_user((char *)arg, (char *) (&mt_pos), sizeof(struct mtpos));
+		i = copy_to_user(p, &mt_pos, sizeof(struct mtpos));
 		if (i)
 			retval = -EFAULT;
 		goto out;
@@ -5040,7 +5040,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
 
 	up(&STp->lock);
 
-	return scsi_ioctl(STp->device, cmd_in, (void *) arg);
+	return scsi_ioctl(STp->device, cmd_in, p);
 
 out:
 	if (SRpnt) scsi_release_request(SRpnt);
@@ -5189,7 +5189,7 @@ static void normalize_buffer(OSST_buffer *STbuffer)
 
 /* Move data from the user buffer to the tape buffer. Returns zero (success) or
    negative error code. */
-static int append_to_buffer(const char *ubp, OSST_buffer *st_bp, int do_count)
+static int append_to_buffer(const char __user *ubp, OSST_buffer *st_bp, int do_count)
 {
 	int i, cnt, res, offset;
 
@@ -5222,7 +5222,7 @@ static int append_to_buffer(const char *ubp, OSST_buffer *st_bp, int do_count)
 
 /* Move data from the tape buffer to the user buffer. Returns zero (success) or
    negative error code. */
-static int from_buffer(OSST_buffer *st_bp, char *ubp, int do_count)
+static int from_buffer(OSST_buffer *st_bp, char __user *ubp, int do_count)
 {
 	int i, cnt, res, offset;
 
diff --git a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c
index 575944aaf..14006bc3d 100644
--- a/drivers/scsi/pci2000.c
+++ b/drivers/scsi/pci2000.c
@@ -353,7 +353,7 @@ irqProceed:;
 		if ( WaitReady (padapter) )
 			{
 			OpDone (SCpnt, DID_TIME_OUT << 16);
-			goto irq_return;;
+			goto irq_return;
 			}
 
 		outb_p (tag0, padapter->mb0);										// get real error code
@@ -361,7 +361,7 @@ irqProceed:;
 		if ( WaitReady (padapter) )											// wait for controller to suck up the op
 			{
 			OpDone (SCpnt, DID_TIME_OUT << 16);
-			goto irq_return;;
+			goto irq_return;
 			}
 
 		error = inl (padapter->mb0);										// get error data
@@ -374,16 +374,16 @@ irqProceed:;
 			if ( bus )														// are we doint SCSI commands?
 				{
 				OpDone (SCpnt, (DID_OK << 16) | 2);
-				goto irq_return;;
+				goto irq_return;
 				}
 			if ( *SCpnt->cmnd == SCSIOP_TEST_UNIT_READY )
 				OpDone (SCpnt, (DRIVER_SENSE << 24) | (DID_OK << 16) | 2);	// test caller we have sense data too
 			else
 				OpDone (SCpnt, DID_ERROR << 16);
-			goto irq_return;;
+			goto irq_return;
 			}
 		OpDone (SCpnt, DID_ERROR << 16);
-		goto irq_return;;
+		goto irq_return;
 		}
 
 	outb_p (0xFF, padapter->tag);											// clear the op interrupt
diff --git a/drivers/scsi/pcmcia/Kconfig b/drivers/scsi/pcmcia/Kconfig
index 74c1c098e..df52190f4 100644
--- a/drivers/scsi/pcmcia/Kconfig
+++ b/drivers/scsi/pcmcia/Kconfig
@@ -69,4 +69,14 @@ config PCMCIA_QLOGIC
 	  To compile this driver as a module, choose M here: the
 	  module will be called qlogic_cs.
 
+config PCMCIA_SYM53C500
+	tristate "Symbios 53c500 PCMCIA support"
+	depends on m
+	help
+	  Say Y here if you have a New Media Bus Toaster or other PCMCIA
+	  SCSI adapter based on the Symbios 53c500 controller.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called sym53c500_cs.
+
 endmenu
diff --git a/drivers/scsi/pcmcia/Makefile b/drivers/scsi/pcmcia/Makefile
index 301a6bddd..eca379059 100644
--- a/drivers/scsi/pcmcia/Makefile
+++ b/drivers/scsi/pcmcia/Makefile
@@ -6,7 +6,8 @@ obj-$(CONFIG_PCMCIA_QLOGIC)	+= qlogic_cs.o
 obj-$(CONFIG_PCMCIA_FDOMAIN)	+= fdomain_cs.o
 obj-$(CONFIG_PCMCIA_AHA152X)	+= aha152x_cs.o
 obj-$(CONFIG_PCMCIA_NINJA_SCSI)	+= nsp_cs.o
+obj-$(CONFIG_PCMCIA_SYM53C500)	+= sym53c500_cs.o
 
 aha152x_cs-objs	:= aha152x_stub.o aha152x_core.o
 fdomain_cs-objs	:= fdomain_stub.o fdomain_core.o
-qlogic_cs-objs	:= qlogic_stub.o qlogic_core.o
+qlogic_cs-objs	:= qlogic_stub.o
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 52c8ed234..f38faabf9 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -38,7 +38,6 @@
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <linux/module.h>
 #include <linux/major.h>
 #include <linux/blkdev.h>
 #include <linux/stat.h>
@@ -315,7 +314,7 @@ static void nsphw_init_sync(nsp_hw_data *data)
 	int i;
 
 	/* setup sync data */
-	for ( i = 0; i < NUMBER(data->Sync); i++ ) {
+	for ( i = 0; i < ARRAY_SIZE(data->Sync); i++ ) {
 		data->Sync[i] = tmp_sync;
 	}
 }
@@ -600,7 +599,7 @@ static int nsp_xfer(Scsi_Cmnd *SCpnt, int phase)
 	unsigned int  base = SCpnt->device->host->io_port;
 	nsp_hw_data  *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
 	char	     *buf  = data->MsgBuffer;
-	int	      len  = MIN(MSGBUF_SIZE, data->MsgLen);
+	int	      len  = min(MSGBUF_SIZE, data->MsgLen);
 	int	      ptr;
 	int	      ret;
 
@@ -774,7 +773,7 @@ static void nsp_pio_read(Scsi_Cmnd *SCpnt)
 			continue;
 		}
 
-		res = MIN(res, SCpnt->SCp.this_residual);
+		res = min(res, SCpnt->SCp.this_residual);
 
 		switch (data->TransferMode) {
 		case MODE_IO32:
@@ -868,7 +867,7 @@ static void nsp_pio_write(Scsi_Cmnd *SCpnt)
 			continue;
 		}
 
-		res = MIN(SCpnt->SCp.this_residual, WFIFO_CRIT);
+		res = min(SCpnt->SCp.this_residual, WFIFO_CRIT);
 
 		//nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x res=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, res);
 		switch (data->TransferMode) {
@@ -1490,7 +1489,7 @@ nsp_proc_info(
 	spin_unlock_irqrestore(&(data->Lock), flags);
 
 	SPRINTF("SDTR status\n");
-	for(id = 0; id < NUMBER(data->Sync); id++) {
+	for(id = 0; id < ARRAY_SIZE(data->Sync); id++) {
 
 		SPRINTF("id %d: ", id);
 
@@ -1534,7 +1533,7 @@ nsp_proc_info(
         }
 
 
-	thislength = MIN(thislength, length);
+	thislength = min(thislength, length);
 	*start = buffer + offset;
 
 	return thislength;
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 38cec7efd..c201b52e0 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -26,9 +26,7 @@
 /************************************
  * Some useful macros...
  */
-#define NUMBER(arr) ((int) (sizeof(arr) / sizeof(arr[0]))) /* from XtNumber() in /usr/X11R6/include/X11/Intrinsic.h */
 #define BIT(x)      (1L << (x))
-#define MIN(a,b)    ((a) > (b) ? (b) : (a))
 
 /* SCSI initiator must be ID 7 */
 #define NSP_INITIATOR_ID  7
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 180c4cf81..2063882b7 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -47,7 +47,7 @@
 
 #include "scsi.h"
 #include "hosts.h"
-#include "../qlogicfas.h"
+#include "../qlogicfas408.h"
 
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
@@ -56,13 +56,13 @@
 #include <pcmcia/ds.h>
 #include <pcmcia/ciscode.h>
 
+/* Set the following to 2 to use normal interrupt (active high/totempole-
+ * tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
+ * drain
+ */
+#define INT_TYPE	0
 
-extern Scsi_Host_Template qlogicfas_driver_template;
-extern void qlogicfas_preset(int port, int irq);
-extern int qlogicfas_bus_reset(Scsi_Cmnd *);
-extern irqreturn_t do_ql_ihandl(int irq, void *dev_id, struct pt_regs *regs);
-
-static char *qlogic_name = "qlogic_cs";
+static char qlogic_name[] = "qlogic_cs";
 
 #ifdef PCMCIA_DEBUG
 static int pc_debug = PCMCIA_DEBUG;
@@ -73,6 +73,24 @@ static char *version = "qlogic_cs.c 1.79-ac 2002/10/26 (David Hinds)";
 #define DEBUG(n, args...)
 #endif
 
+static Scsi_Host_Template qlogicfas_driver_template = {
+	.module			= THIS_MODULE,
+	.name			= qlogic_name,
+	.proc_name		= qlogic_name,
+	.info			= qlogicfas408_info,
+	.queuecommand		= qlogicfas408_queuecommand,
+	.eh_abort_handler	= qlogicfas408_abort,
+	.eh_bus_reset_handler	= qlogicfas408_bus_reset,
+	.eh_device_reset_handler= qlogicfas408_device_reset,
+	.eh_host_reset_handler	= qlogicfas408_host_reset,
+	.bios_param		= qlogicfas408_biosparam,
+	.can_queue		= 1,
+	.this_id		= -1,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
+
 /*====================================================================*/
 
 /* Parameters that can be set with 'insmod' */
@@ -110,29 +128,17 @@ static struct Scsi_Host *qlogic_detect(Scsi_Host_Template *host,
 	int qltyp;		/* type of chip */
 	int qinitid;
 	struct Scsi_Host *shost;	/* registered host structure */
-	qlogicfas_priv_t priv;
+	struct qlogicfas408_priv *priv;
 
-	qltyp = inb(qbase + 0xe) & 0xf8;
+	qltyp = qlogicfas408_get_chip_type(qbase, INT_TYPE);
 	qinitid = host->this_id;
 	if (qinitid < 0)
 		qinitid = 7;	/* if no ID, use 7 */
-	outb(1, qbase + 8);	/* set for PIO pseudo DMA */
-	REG0;
-	outb(0x40 | qlcfg8 | qinitid, qbase + 8);	/* (ini) bus id, disable scsi rst */
-	outb(qlcfg5, qbase + 5);	/* select timer */
-	outb(qlcfg9, qbase + 9);	/* prescaler */
-
-#if QL_RESET_AT_START
-	outb(3, qbase + 3);
-	REG1;
-	/* FIXME: timeout */
-	while (inb(qbase + 0xf) & 4)
-		cpu_relax();
-	REG0;
-#endif
+
+	qlogicfas408_setup(qbase, qinitid, INT_TYPE);
 
 	host->name = qlogic_name;
-	shost = scsi_host_alloc(host, sizeof(struct qlogicfas_priv));
+	shost = scsi_host_alloc(host, sizeof(struct qlogicfas408_priv));
 	if (!shost)
 		goto err;
 	shost->io_port = qbase;
@@ -141,12 +147,14 @@ static struct Scsi_Host *qlogic_detect(Scsi_Host_Template *host,
 	if (qlirq != -1)
 		shost->irq = qlirq;
 
-	priv = (qlogicfas_priv_t)&(shost->hostdata[0]);
+	priv = get_priv_by_host(shost);
 	priv->qlirq = qlirq;
 	priv->qbase = qbase;
 	priv->qinitid = qinitid;
+	priv->shost = shost;
+	priv->int_type = INT_TYPE;					
 
-	if (request_irq(qlirq, do_ql_ihandl, 0, qlogic_name, shost))
+	if (request_irq(qlirq, qlogicfas408_ihandl, 0, qlogic_name, shost))
 		goto free_scsi_host;
 
 	sprintf(priv->qinfo,
@@ -307,9 +315,6 @@ static void qlogic_config(dev_link_t * link)
 		outb(0x04, link->io.BasePort1 + 0xd);
 	}
 
-	qlogicfas_driver_template.name = qlogic_name;
-	qlogicfas_driver_template.proc_name = qlogic_name;
-
 	/* The KXL-810AN has a bigger IO port window */
 	if (link->io.NumPorts1 == 32)
 		host = qlogic_detect(&qlogicfas_driver_template, link,
@@ -402,7 +407,7 @@ static int qlogic_event(event_t event, int priority, event_callback_args_t * arg
 				outb(0x04, link->io.BasePort1 + 0xd);
 			}
 			/* Ugggglllyyyy!!! */
-			qlogicfas_bus_reset(NULL);
+			qlogicfas408_bus_reset(NULL);
 		}
 		break;
 	}
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index b3b976e04..390bbbd39 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -15,18 +15,23 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
-#include <asm/io.h>
 #include <linux/parport.h>
 #include <linux/workqueue.h>
-#include "scsi.h"
-#include "hosts.h"
+#include <asm/io.h>
+
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+
+
 static void ppa_reset_pulse(unsigned int base);
 
 typedef struct {
 	struct pardevice *dev;	/* Parport device entry         */
 	int base;		/* Actual port address          */
 	int mode;		/* Transfer mode                */
-	Scsi_Cmnd *cur_cmd;	/* Current queued command       */
+	struct scsi_cmnd *cur_cmd;	/* Current queued command       */
 	struct work_struct ppa_tq;	/* Polling interrupt stuff       */
 	unsigned long jstart;	/* Jiffies at start             */
 	unsigned long recon_tmo;	/* How many usecs to wait for reconnection (6th bit) */
@@ -501,7 +506,7 @@ static int ppa_init(ppa_struct *dev)
 	return device_check(dev);
 }
 
-static inline int ppa_send_command(Scsi_Cmnd *cmd)
+static inline int ppa_send_command(struct scsi_cmnd *cmd)
 {
 	ppa_struct *dev = ppa_dev(cmd->device->host);
 	int k;
@@ -522,7 +527,7 @@ static inline int ppa_send_command(Scsi_Cmnd *cmd)
  * The driver appears to remain stable if we speed up the parallel port
  * i/o in this function, but not elsewhere.
  */
-static int ppa_completion(Scsi_Cmnd *cmd)
+static int ppa_completion(struct scsi_cmnd *cmd)
 {
 	/* Return codes:
 	 * -1     Error
@@ -626,7 +631,7 @@ static int ppa_completion(Scsi_Cmnd *cmd)
 static void ppa_interrupt(void *data)
 {
 	ppa_struct *dev = (ppa_struct *) data;
-	Scsi_Cmnd *cmd = dev->cur_cmd;
+	struct scsi_cmnd *cmd = dev->cur_cmd;
 
 	if (!cmd) {
 		printk("PPA: bug in ppa_interrupt\n");
@@ -682,7 +687,7 @@ static void ppa_interrupt(void *data)
 	cmd->scsi_done(cmd);
 }
 
-static int ppa_engine(ppa_struct *dev, Scsi_Cmnd *cmd)
+static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
 {
 	unsigned short ppb = dev->base;
 	unsigned char l = 0, h = 0;
@@ -802,7 +807,8 @@ static int ppa_engine(ppa_struct *dev, Scsi_Cmnd *cmd)
 	return 0;
 }
 
-static int ppa_queuecommand(Scsi_Cmnd *cmd, void (*done) (Scsi_Cmnd *))
+static int ppa_queuecommand(struct scsi_cmnd *cmd,
+		void (*done) (struct scsi_cmnd *))
 {
 	ppa_struct *dev = ppa_dev(cmd->device->host);
 
@@ -847,7 +853,7 @@ static int ppa_biosparam(struct scsi_device *sdev, struct block_device *dev,
 	return 0;
 }
 
-static int ppa_abort(Scsi_Cmnd *cmd)
+static int ppa_abort(struct scsi_cmnd *cmd)
 {
 	ppa_struct *dev = ppa_dev(cmd->device->host);
 	/*
@@ -875,7 +881,7 @@ static void ppa_reset_pulse(unsigned int base)
 	w_ctr(base, 0xc);
 }
 
-static int ppa_reset(Scsi_Cmnd *cmd)
+static int ppa_reset(struct scsi_cmnd *cmd)
 {
 	ppa_struct *dev = ppa_dev(cmd->device->host);
 
@@ -974,7 +980,7 @@ static int device_check(ppa_struct *dev)
 	return -ENODEV;
 }
 
-static Scsi_Host_Template ppa_template = {
+static struct scsi_host_template ppa_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "ppa",
 	.proc_info		= ppa_proc_info,
diff --git a/drivers/scsi/ppa.h b/drivers/scsi/ppa.h
index 7bb277611..afb614fa8 100644
--- a/drivers/scsi/ppa.h
+++ b/drivers/scsi/ppa.h
@@ -146,6 +146,6 @@ static char *PPA_MODE_STRING[] =
 #define w_ctr(x,y)      outb(y, (x)+2)
 #endif
 
-static int ppa_engine(ppa_struct *, Scsi_Cmnd *);
+static int ppa_engine(ppa_struct *, struct scsi_cmnd *);
 
 #endif				/* _PPA_H */
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 6dfc187fd..dd482a9e6 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -3371,6 +3371,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 	sp->flags |= SRB_SENT;
 	ha->actthreads++;
 	WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index);
+	(void) RD_REG_WORD(&reg->mailbox4); /* PCI posted write flush */
 
  out:
 	if (status)
@@ -3639,6 +3640,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 	sp->flags |= SRB_SENT;
 	ha->actthreads++;
 	WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index);
+	(void) RD_REG_WORD(&reg->mailbox4); /* PCI posted write flush */
 
 out:
 	if (status)
@@ -3750,6 +3752,7 @@ qla1280_isp_cmd(struct scsi_qla_host *ha)
 
 	/* Set chip new ring index. */
 	WRT_REG_WORD(&reg->mailbox4, ha->req_ring_index);
+	(void) RD_REG_WORD(&reg->mailbox4); /* PCI posted write flush */
 
 	LEAVE("qla1280_isp_cmd");
 }
@@ -3788,7 +3791,7 @@ qla1280_isr(struct scsi_qla_host *ha, struct list_head *done_q)
 
 	/* Check for mailbox interrupt. */
 
-	mailbox[0] = RD_REG_WORD(&reg->semaphore);
+	mailbox[0] = RD_REG_WORD_dmasync(&reg->semaphore);
 
 	if (mailbox[0] & BIT_0) {
 		/* Get mailbox data. */
diff --git a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h
index dc7f7a727..0027485bf 100644
--- a/drivers/scsi/qla1280.h
+++ b/drivers/scsi/qla1280.h
@@ -57,7 +57,8 @@
 #define BIT_31	0x80000000
 
 #if MEMORY_MAPPED_IO
-#define RD_REG_WORD(addr)		readw(addr)
+#define RD_REG_WORD(addr)		readw_relaxed(addr)
+#define RD_REG_WORD_dmasync(addr)	readw(addr)
 #define WRT_REG_WORD(addr, data)	writew(data, addr)
 #else				/* MEMORY_MAPPED_IO */
 #define RD_REG_WORD(addr)		inw((unsigned long)addr)
diff --git a/drivers/scsi/qla2xxx/ql2300_fw.c b/drivers/scsi/qla2xxx/ql2300_fw.c
index 0a9936400..1b6fe1871 100644
--- a/drivers/scsi/qla2xxx/ql2300_fw.c
+++ b/drivers/scsi/qla2xxx/ql2300_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.26 (08:42 Mar 11, 2004)
+ *	Firmware Version 3.02.28 (13:56 Apr 03, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2300ipx_version_str[] = {3, 2,26};
+unsigned char fw2300ipx_version_str[] = {3, 2,28};
 #else
-unsigned char firmware_version[] = {3, 2,26};
+unsigned char firmware_version[] = {3, 2,28};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2300ipx_VERSION_STRING "3.02.26"
+#define fw2300ipx_VERSION_STRING "3.02.28"
 #else
-#define FW_VERSION_STRING "3.02.26"
+#define FW_VERSION_STRING "3.02.28"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2300ipx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xe9a6, 0x0000, 0x0003, 0x0002, 0x001a,
+	0x0470, 0x0000, 0x0000, 0xe9c7, 0x0000, 0x0003, 0x0002, 0x001c,
 	0x0137, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3620, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -78,98 +78,98 @@ unsigned short risc_code01[] = {
 	0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f,
 	0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e,
 	0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f17, 0x080c,
-	0x6029, 0x080c, 0xaddd, 0x080c, 0x10ce, 0x080c, 0x12ed, 0x080c,
-	0x1ba4, 0x080c, 0x0d69, 0x080c, 0x1053, 0x080c, 0x341e, 0x080c,
-	0x76ac, 0x080c, 0x698e, 0x080c, 0x86cd, 0x080c, 0x8401, 0x080c,
-	0x2478, 0x080c, 0x8f6f, 0x080c, 0x7d76, 0x080c, 0x22b1, 0x080c,
+	0x6028, 0x080c, 0xadf7, 0x080c, 0x10ce, 0x080c, 0x12ed, 0x080c,
+	0x1ba4, 0x080c, 0x0d69, 0x080c, 0x1053, 0x080c, 0x3425, 0x080c,
+	0x76b8, 0x080c, 0x6996, 0x080c, 0x86f6, 0x080c, 0x842a, 0x080c,
+	0x2478, 0x080c, 0x8f98, 0x080c, 0x7d82, 0x080c, 0x22b1, 0x080c,
 	0x23e5, 0x080c, 0x246d, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004,
 	0x091f, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837,
 	0x4000, 0x7833, 0x0010, 0x0e04, 0x0913, 0x2091, 0x5000, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2071,
 	0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003,
-	0x1178, 0x080c, 0x4bca, 0x080c, 0x3445, 0x080c, 0x771d, 0x080c,
-	0x6ecf, 0x080c, 0x87ab, 0x080c, 0x842a, 0x080c, 0x2c93, 0x0c58,
+	0x1178, 0x080c, 0x4bc9, 0x080c, 0x344c, 0x080c, 0x7729, 0x080c,
+	0x6ed7, 0x080c, 0x87d4, 0x080c, 0x8453, 0x080c, 0x2c93, 0x0c58,
 	0x000b, 0x0c78, 0x0944, 0x0945, 0x0ae7, 0x0942, 0x0bae, 0x0d68,
 	0x0d68, 0x0d68, 0x080c, 0x0dd5, 0x0005, 0x0126, 0x00f6, 0x2091,
-	0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aba, 0x080c, 0x56df,
+	0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aba, 0x080c, 0x56de,
 	0x1130, 0x0026, 0x2011, 0x0080, 0x080c, 0x0edf, 0x002e, 0x080c,
-	0x73b0, 0x0150, 0x080c, 0x73d3, 0x15a0, 0x2079, 0x0100, 0x7828,
-	0x9085, 0x1800, 0x782a, 0x0468, 0x080c, 0x72e2, 0x7000, 0x9086,
+	0x73bc, 0x0150, 0x080c, 0x73df, 0x15a0, 0x2079, 0x0100, 0x7828,
+	0x9085, 0x1800, 0x782a, 0x0468, 0x080c, 0x72ee, 0x7000, 0x9086,
 	0x0001, 0x1904, 0x0aba, 0x7098, 0x9086, 0x0028, 0x1904, 0x0aba,
-	0x080c, 0x83f9, 0x080c, 0x83eb, 0x2001, 0x0161, 0x2003, 0x0001,
+	0x080c, 0x8422, 0x080c, 0x8414, 0x2001, 0x0161, 0x2003, 0x0001,
 	0x2079, 0x0100, 0x7827, 0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a,
-	0x2011, 0x7246, 0x080c, 0x84ca, 0x2011, 0x7239, 0x080c, 0x85a4,
-	0x2011, 0x5e84, 0x080c, 0x84ca, 0x2011, 0x8030, 0x901e, 0x7396,
-	0x04d0, 0x080c, 0x5731, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904,
-	0x0aba, 0x2011, 0x5e84, 0x080c, 0x84ca, 0x2011, 0x7246, 0x080c,
-	0x84ca, 0x2011, 0x7239, 0x080c, 0x85a4, 0x2001, 0x0265, 0x2001,
+	0x2011, 0x7252, 0x080c, 0x84f3, 0x2011, 0x7245, 0x080c, 0x85cd,
+	0x2011, 0x5e83, 0x080c, 0x84f3, 0x2011, 0x8030, 0x901e, 0x7396,
+	0x04d0, 0x080c, 0x5730, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904,
+	0x0aba, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x2011, 0x7252, 0x080c,
+	0x84f3, 0x2011, 0x7245, 0x080c, 0x85cd, 0x2001, 0x0265, 0x2001,
 	0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2001,
 	0x19a6, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c,
-	0x5fd1, 0x00ce, 0x0804, 0x0aba, 0x780f, 0x006b, 0x7a28, 0x080c,
-	0x73b8, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a,
+	0x5fd0, 0x00ce, 0x0804, 0x0aba, 0x780f, 0x006b, 0x7a28, 0x080c,
+	0x73c4, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a,
 	0x2011, 0x8010, 0x73d8, 0x2001, 0x19a7, 0x2003, 0x0001, 0x080c,
-	0x2b59, 0x080c, 0x4b05, 0x7248, 0xc284, 0x724a, 0x2001, 0x180c,
-	0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0xa503, 0x2011, 0x0004,
-	0x080c, 0xcb2b, 0x080c, 0x6823, 0x080c, 0x73b0, 0x1120, 0x080c,
-	0x2b9d, 0x02e0, 0x0400, 0x080c, 0x5fd8, 0x0140, 0x7097, 0x0001,
-	0x70d3, 0x0000, 0x080c, 0x58fe, 0x0804, 0x0aba, 0x080c, 0x56d0,
+	0x2b59, 0x080c, 0x4b04, 0x7248, 0xc284, 0x724a, 0x2001, 0x180c,
+	0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0xa51d, 0x2011, 0x0004,
+	0x080c, 0xcb45, 0x080c, 0x6822, 0x080c, 0x73bc, 0x1120, 0x080c,
+	0x2b9d, 0x02e0, 0x0400, 0x080c, 0x5fd7, 0x0140, 0x7097, 0x0001,
+	0x70d3, 0x0000, 0x080c, 0x58fd, 0x0804, 0x0aba, 0x080c, 0x56cf,
 	0xd094, 0x0188, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c,
-	0x56d4, 0xd0d4, 0x1118, 0x080c, 0x2b9d, 0x1270, 0x2011, 0x180c,
-	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56d4, 0xd0d4, 0x1db8, 0x2011,
+	0x56d3, 0xd0d4, 0x1118, 0x080c, 0x2b9d, 0x1270, 0x2011, 0x180c,
+	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56d3, 0xd0d4, 0x1db8, 0x2011,
 	0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x2012, 0x080c, 0x6962, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
-	0x2012, 0x080c, 0x6928, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
-	0x707f, 0x0000, 0x080c, 0x73b0, 0x1130, 0x70b0, 0x9005, 0x1168,
-	0x080c, 0xcf67, 0x0050, 0x080c, 0xcf67, 0x70dc, 0xd09c, 0x1128,
-	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fae, 0x70e7, 0x0000, 0x70e3,
+	0x2012, 0x080c, 0x696a, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
+	0x2012, 0x080c, 0x6930, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
+	0x707f, 0x0000, 0x080c, 0x73bc, 0x1130, 0x70b0, 0x9005, 0x1168,
+	0x080c, 0xcf81, 0x0050, 0x080c, 0xcf81, 0x70dc, 0xd09c, 0x1128,
+	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fad, 0x70e7, 0x0000, 0x70e3,
 	0x0000, 0x70a7, 0x0000, 0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x73b0, 0x1178, 0x9016,
+	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x73bc, 0x1178, 0x9016,
 	0x0016, 0x080c, 0x2956, 0x2019, 0x196d, 0x211a, 0x001e, 0x705f,
 	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196d,
 	0x201b, 0x0000, 0x2079, 0x1847, 0x7804, 0xd0ac, 0x0108, 0xc295,
-	0x72de, 0x080c, 0x73b0, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011,
-	0x0001, 0x080c, 0xcb2b, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
+	0x72de, 0x080c, 0x73bc, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011,
+	0x0001, 0x080c, 0xcb45, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
 	0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003,
-	0x782a, 0x00fe, 0x080c, 0x2f96, 0x2011, 0x0005, 0x080c, 0xa639,
-	0x080c, 0x9664, 0x080c, 0x73b0, 0x0148, 0x00c6, 0x2061, 0x0100,
+	0x782a, 0x00fe, 0x080c, 0x2f96, 0x2011, 0x0005, 0x080c, 0xa653,
+	0x080c, 0x968d, 0x080c, 0x73bc, 0x0148, 0x00c6, 0x2061, 0x0100,
 	0x0016, 0x080c, 0x2956, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420,
 	0x70ab, 0x0000, 0x70af, 0xffff, 0x7003, 0x0002, 0x00f6, 0x2079,
 	0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe,
-	0x2011, 0x0005, 0x080c, 0xa639, 0x080c, 0x9664, 0x080c, 0x73b0,
+	0x2011, 0x0005, 0x080c, 0xa653, 0x080c, 0x968d, 0x080c, 0x73bc,
 	0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2956, 0x61e2,
 	0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c,
-	0x73b0, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
-	0x73b0, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138,
+	0x73bc, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
+	0x73bc, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138,
 	0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c,
-	0x32b4, 0x8108, 0x1f04, 0x0ace, 0x707f, 0x0000, 0x7080, 0x9084,
+	0x32bb, 0x8108, 0x1f04, 0x0ace, 0x707f, 0x0000, 0x7080, 0x9084,
 	0x00ff, 0x7082, 0x70b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x00b6,
 	0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904, 0x0bab,
-	0x70ac, 0x9086, 0xffff, 0x0130, 0x080c, 0x2f96, 0x080c, 0x9664,
+	0x70ac, 0x9086, 0xffff, 0x0130, 0x080c, 0x2f96, 0x080c, 0x968d,
 	0x0804, 0x0bab, 0x70dc, 0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084,
 	0x0548, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c,
-	0x0508, 0x080c, 0x3317, 0x11d0, 0x70e0, 0x9086, 0xffff, 0x01b0,
-	0x080c, 0x3128, 0x080c, 0x9664, 0x70dc, 0xd094, 0x1904, 0x0bab,
-	0x2011, 0x0001, 0x080c, 0xd216, 0x0110, 0x2011, 0x0003, 0x901e,
-	0x080c, 0x3162, 0x080c, 0x9664, 0x0804, 0x0bab, 0x70e4, 0x9005,
+	0x0508, 0x080c, 0x331e, 0x11d0, 0x70e0, 0x9086, 0xffff, 0x01b0,
+	0x080c, 0x312b, 0x080c, 0x968d, 0x70dc, 0xd094, 0x1904, 0x0bab,
+	0x2011, 0x0001, 0x080c, 0xd230, 0x0110, 0x2011, 0x0003, 0x901e,
+	0x080c, 0x3165, 0x080c, 0x968d, 0x0804, 0x0bab, 0x70e4, 0x9005,
 	0x1904, 0x0bab, 0x70a8, 0x9005, 0x1904, 0x0bab, 0x70dc, 0xd0a4,
-	0x0118, 0xd0b4, 0x0904, 0x0bab, 0x080c, 0x6928, 0x1904, 0x0bab,
-	0x080c, 0x697b, 0x1904, 0x0bab, 0x080c, 0x6962, 0x01c0, 0x0156,
-	0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6600, 0x1118,
+	0x0118, 0xd0b4, 0x0904, 0x0bab, 0x080c, 0x6930, 0x1904, 0x0bab,
+	0x080c, 0x6983, 0x1904, 0x0bab, 0x080c, 0x696a, 0x01c0, 0x0156,
+	0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x65ff, 0x1118,
 	0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, 0x0b44, 0x00ce,
 	0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, 0x0bab, 0x0006,
 	0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0x2011, 0x19b3, 0x080c,
 	0x0f87, 0x2011, 0x19cd, 0x080c, 0x0f87, 0x7030, 0xc08c, 0x7032,
-	0x7003, 0x0003, 0x70af, 0xffff, 0x080c, 0x56df, 0x1130, 0x0026,
+	0x7003, 0x0003, 0x70af, 0xffff, 0x080c, 0x56de, 0x1130, 0x0026,
 	0x2011, 0x0040, 0x080c, 0x0edf, 0x002e, 0x9006, 0x080c, 0x27ea,
-	0x080c, 0x3317, 0x0118, 0x080c, 0x4ca2, 0x0050, 0x0036, 0x0046,
-	0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4cbc, 0x004e, 0x003e,
-	0x00f6, 0x2079, 0x0100, 0x080c, 0x73d3, 0x0150, 0x080c, 0x73b0,
+	0x080c, 0x331e, 0x0118, 0x080c, 0x4ca1, 0x0050, 0x0036, 0x0046,
+	0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4cbb, 0x004e, 0x003e,
+	0x00f6, 0x2079, 0x0100, 0x080c, 0x73df, 0x0150, 0x080c, 0x73bc,
 	0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a,
 	0x00fe, 0x2001, 0x19e8, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011,
-	0x0000, 0x080c, 0xa639, 0x2011, 0x0000, 0x080c, 0xa643, 0x080c,
-	0x9664, 0x080c, 0x9790, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046,
+	0x0000, 0x080c, 0xa653, 0x2011, 0x0000, 0x080c, 0xa65d, 0x080c,
+	0x968d, 0x080c, 0x97b9, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046,
 	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c,
-	0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5f97, 0x7940, 0x918c,
+	0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5f96, 0x7940, 0x918c,
 	0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c,
 	0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac,
 	0x1904, 0x0c3b, 0x2001, 0x19a7, 0x2004, 0x9005, 0x1518, 0x080c,
@@ -177,13 +177,13 @@ unsigned short risc_code01[] = {
 	0x080c, 0x2b6b, 0x00b8, 0x080c, 0x2c28, 0x1138, 0x9006, 0x080c,
 	0x2b88, 0x9006, 0x080c, 0x2b6b, 0x0068, 0x080c, 0x2c30, 0x1d50,
 	0x2001, 0x1998, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2982,
-	0x0804, 0x0d1a, 0x080c, 0x73c1, 0x0148, 0x080c, 0x73d3, 0x1118,
-	0x080c, 0x76a7, 0x0050, 0x080c, 0x73b8, 0x0dd0, 0x080c, 0x76a2,
-	0x080c, 0x7698, 0x080c, 0x72e2, 0x0058, 0x080c, 0x73b0, 0x0140,
-	0x2009, 0x00f8, 0x080c, 0x5f97, 0x7843, 0x0090, 0x7843, 0x0010,
-	0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x73b0, 0x0138,
+	0x0804, 0x0d1a, 0x080c, 0x73cd, 0x0148, 0x080c, 0x73df, 0x1118,
+	0x080c, 0x76b3, 0x0050, 0x080c, 0x73c4, 0x0dd0, 0x080c, 0x76ae,
+	0x080c, 0x76a4, 0x080c, 0x72ee, 0x0058, 0x080c, 0x73bc, 0x0140,
+	0x2009, 0x00f8, 0x080c, 0x5f96, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x73bc, 0x0138,
 	0x7824, 0xd0ac, 0x1904, 0x0d1f, 0x1f04, 0x0c1a, 0x0070, 0x7824,
-	0x080c, 0x73ca, 0x0118, 0xd0ac, 0x1904, 0x0d1f, 0x9084, 0x1800,
+	0x080c, 0x73d6, 0x0118, 0xd0ac, 0x1904, 0x0d1f, 0x9084, 0x1800,
 	0x0d98, 0x7003, 0x0001, 0x0804, 0x0d1f, 0x2001, 0x0001, 0x080c,
 	0x27ea, 0x0804, 0x0d32, 0x2001, 0x19a7, 0x2004, 0x9005, 0x1518,
 	0x080c, 0x2c20, 0x1148, 0x2001, 0x0001, 0x080c, 0x2b88, 0x2001,
@@ -192,47 +192,47 @@ unsigned short risc_code01[] = {
 	0x1d50, 0x2001, 0x1998, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
 	0x2982, 0x0804, 0x0d1a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938,
 	0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2c38, 0x9085, 0x2000,
-	0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c74, 0x080c, 0x8584,
+	0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c74, 0x080c, 0x85ad,
 	0x1f04, 0x0c74, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852,
-	0x793a, 0x080c, 0x73c1, 0x0148, 0x080c, 0x73d3, 0x1118, 0x080c,
-	0x76a7, 0x0050, 0x080c, 0x73b8, 0x0dd0, 0x080c, 0x76a2, 0x080c,
-	0x7698, 0x080c, 0x72e2, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5f97,
+	0x793a, 0x080c, 0x73cd, 0x0148, 0x080c, 0x73df, 0x1118, 0x080c,
+	0x76b3, 0x0050, 0x080c, 0x73c4, 0x0dd0, 0x080c, 0x76ae, 0x080c,
+	0x76a4, 0x080c, 0x72ee, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5f96,
 	0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c9a, 0x7850, 0x9085, 0x1400,
-	0x7852, 0x080c, 0x73b0, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010,
-	0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x8584, 0x7820, 0xd09c,
-	0x1580, 0x080c, 0x73b0, 0x0904, 0x0cff, 0x7824, 0xd0ac, 0x1904,
-	0x0d1f, 0x080c, 0x73d3, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421,
+	0x7852, 0x080c, 0x73bc, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x85ad, 0x7820, 0xd09c,
+	0x1580, 0x080c, 0x73bc, 0x0904, 0x0cff, 0x7824, 0xd0ac, 0x1904,
+	0x0d1f, 0x080c, 0x73df, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421,
 	0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2c38, 0x7824, 0x9084,
 	0x1800, 0x1160, 0x9484, 0x0fff, 0x1138, 0x2001, 0x1810, 0x2004,
 	0xd0fc, 0x0110, 0x080c, 0x0d45, 0x8421, 0x1158, 0x1d04, 0x0cda,
-	0x080c, 0x8584, 0x080c, 0x76a2, 0x080c, 0x7698, 0x7003, 0x0001,
-	0x04f0, 0x8319, 0x1948, 0x1d04, 0x0ce7, 0x080c, 0x8584, 0x2009,
+	0x080c, 0x85ad, 0x080c, 0x76ae, 0x080c, 0x76a4, 0x7003, 0x0001,
+	0x04f0, 0x8319, 0x1948, 0x1d04, 0x0ce7, 0x080c, 0x85ad, 0x2009,
 	0x199b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b,
 	0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2c19, 0x7924,
 	0x080c, 0x2c38, 0xd19c, 0x0110, 0x080c, 0x2b59, 0x00d8, 0x080c,
-	0x73c1, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x7388, 0x7003,
+	0x73cd, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x7394, 0x7003,
 	0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2c38, 0x7824, 0x080c,
-	0x73ca, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003,
+	0x73d6, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003,
 	0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x27ea, 0x0078, 0x2009,
 	0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906,
 	0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, 0x9085,
 	0x0400, 0x7852, 0x2001, 0x19a7, 0x2003, 0x0000, 0x9006, 0x78f2,
-	0x015e, 0x003e, 0x000e, 0x080c, 0x56df, 0x1110, 0x080c, 0x0e62,
+	0x015e, 0x003e, 0x000e, 0x080c, 0x56de, 0x1110, 0x080c, 0x0e62,
 	0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0036,
 	0x0046, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069,
-	0x0d0c, 0x8584, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x0d0c, 0x85ad, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
 	0x004e, 0x003e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189e,
-	0x7004, 0x9086, 0x0001, 0x1110, 0x080c, 0x3445, 0x00ee, 0x0005,
+	0x7004, 0x9086, 0x0001, 0x1110, 0x080c, 0x344c, 0x00ee, 0x0005,
 	0x0005, 0x2a70, 0x2061, 0x19ab, 0x2063, 0x0003, 0x6007, 0x0002,
-	0x600b, 0x001a, 0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102,
+	0x600b, 0x001c, 0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102,
 	0x7196, 0x2001, 0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705f,
 	0xffff, 0x0008, 0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c,
-	0xcf67, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
+	0xcf81, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
 	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x001f, 0x611a, 0x601f,
 	0x07d0, 0x2061, 0x1974, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
 	0x1989, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
-	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x6600,
+	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x65ff,
 	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
 	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
 	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
@@ -251,7 +251,7 @@ unsigned short risc_code01[] = {
 	0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
 	0xd084, 0x0180, 0x2001, 0x1a19, 0x2004, 0x9005, 0x0128, 0x2001,
 	0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002,
-	0x2003, 0x1001, 0x080c, 0x56df, 0x1110, 0x080c, 0x0e99, 0x0cd0,
+	0x2003, 0x1001, 0x080c, 0x56de, 0x1110, 0x080c, 0x0e99, 0x0cd0,
 	0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600,
 	0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f,
 	0x2102, 0x0005, 0x00f6, 0x0006, 0x2079, 0x1827, 0x2f04, 0x8000,
@@ -315,7 +315,7 @@ unsigned short risc_code01[] = {
 	0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x0016, 0x890e, 0x810e,
 	0x810f, 0x9184, 0x003f, 0xa862, 0x9184, 0xffc0, 0xa85e, 0x001e,
 	0x0020, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83eb,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414,
 	0x012e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9026, 0x2009, 0x0000,
 	0x2049, 0x0400, 0x2900, 0x702e, 0x8940, 0x2800, 0xa802, 0xa95e,
 	0xa863, 0x0001, 0x8420, 0x9886, 0x0440, 0x0120, 0x2848, 0x9188,
@@ -380,15 +380,15 @@ unsigned short risc_code01[] = {
 	0x080c, 0x1108, 0x0005, 0x00de, 0x009e, 0x080c, 0x1108, 0x0005,
 	0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0dd5,
 	0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000,
-	0xa897, 0x4002, 0x080c, 0x6c6d, 0xa09f, 0x0000, 0xa0a3, 0x0000,
+	0xa897, 0x4002, 0x080c, 0x6c75, 0xa09f, 0x0000, 0xa0a3, 0x0000,
 	0x2848, 0x080c, 0x1031, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d,
 	0x090c, 0x0dd5, 0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b, 0x0001,
 	0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198,
 	0xa80e, 0x2050, 0x8006, 0x8006, 0x8007, 0x908c, 0x003f, 0x9084,
 	0xffc0, 0x9080, 0x0002, 0xa076, 0xa172, 0xb000, 0xa07a, 0x2810,
 	0x080c, 0x10e9, 0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c,
-	0x6c6d, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6,
-	0x2060, 0x080c, 0xae47, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000,
+	0x6c75, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6,
+	0x2060, 0x080c, 0xae61, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000,
 	0xa8a3, 0x0000, 0x080c, 0x1031, 0x7007, 0x0000, 0x080c, 0x1108,
 	0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007,
 	0x0005, 0x7000, 0xc094, 0x7002, 0x012e, 0x0005, 0x0096, 0x2001,
@@ -397,12 +397,12 @@ unsigned short risc_code01[] = {
 	0x8000, 0x782b, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002,
 	0x2900, 0x700a, 0x012e, 0x009e, 0x0005, 0x20e1, 0x0000, 0x2099,
 	0x0088, 0x782b, 0x0040, 0x0096, 0x2001, 0x192e, 0x204c, 0xaa7c,
-	0x009e, 0x080c, 0x89e3, 0x2009, 0x188c, 0x2104, 0x9084, 0xfffc,
-	0x200a, 0x080c, 0x8856, 0x7007, 0x0000, 0x080c, 0x1119, 0x0005,
+	0x009e, 0x080c, 0x8a0c, 0x2009, 0x188c, 0x2104, 0x9084, 0xfffc,
+	0x200a, 0x080c, 0x887f, 0x7007, 0x0000, 0x080c, 0x1119, 0x0005,
 	0x7007, 0x0000, 0x080c, 0x1119, 0x0005, 0x0126, 0x2091, 0x2200,
 	0x2079, 0x0300, 0x2071, 0x1a62, 0x7003, 0x0000, 0x78bf, 0x00f6,
 	0x781b, 0x4800, 0x00c1, 0x7803, 0x0003, 0x780f, 0x0000, 0x20a9,
-	0x03d0, 0x2061, 0xe9f7, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002,
+	0x03d0, 0x2061, 0xea18, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002,
 	0x7916, 0x1f04, 0x1303, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803,
 	0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x7808, 0xd09c,
 	0x0120, 0x7820, 0x080c, 0x1362, 0x0cc8, 0x2001, 0x1a63, 0x2003,
@@ -411,13 +411,13 @@ unsigned short risc_code01[] = {
 	0x782b, 0x1a82, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200,
 	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a82, 0x602f,
 	0x1cd0, 0x2001, 0x181a, 0x2004, 0x9082, 0x1cd0, 0x6032, 0x603b,
-	0x2090, 0x604f, 0x193c, 0x2001, 0x331e, 0xd0fc, 0x190c, 0x0dd5,
-	0x2001, 0x0003, 0x2004, 0xd0d4, 0x1118, 0x783f, 0x331e, 0x0020,
-	0x9084, 0xc000, 0x783f, 0xb31e, 0x2001, 0x1927, 0x2004, 0x6042,
+	0x2090, 0x2001, 0x3325, 0xd0fc, 0x190c, 0x0dd5, 0x2001, 0x0003,
+	0x2004, 0xd0d4, 0x1118, 0x783f, 0x3325, 0x0020, 0x9084, 0xc000,
+	0x783f, 0xb325, 0x604f, 0x193c, 0x2001, 0x1927, 0x2004, 0x6042,
 	0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0, 0x7808, 0xd09c, 0x01b8,
-	0x7820, 0x0026, 0x2010, 0x080c, 0xcb09, 0x0180, 0x2260, 0x6000,
+	0x7820, 0x0026, 0x2010, 0x080c, 0xcb23, 0x0180, 0x2260, 0x6000,
 	0x9086, 0x0004, 0x1158, 0x0016, 0x6120, 0x9186, 0x0009, 0x0108,
-	0x0020, 0x2009, 0x004c, 0x080c, 0xaec2, 0x001e, 0x002e, 0x0005,
+	0x0020, 0x2009, 0x004c, 0x080c, 0xaedc, 0x001e, 0x002e, 0x0005,
 	0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0070, 0x190c, 0x0dce,
 	0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, 0x15e8, 0x908a, 0x0024,
 	0x1a0c, 0x0dd5, 0x0023, 0x012e, 0x0005, 0x012e, 0x0005, 0x13bb,
@@ -426,18 +426,18 @@ unsigned short risc_code01[] = {
 	0x155b, 0x1566, 0x156d, 0x13bb, 0x13bb, 0x13bb, 0x13bb, 0x13bb,
 	0x13bb, 0x13bb, 0x13e2, 0x13bb, 0x13bb, 0x13bb, 0x13bb, 0x13bb,
 	0x13bb, 0x13bf, 0x13bd, 0x080c, 0x0dd5, 0x080c, 0x0dce, 0x080c,
-	0x1578, 0x2009, 0x1a7b, 0x2104, 0x8000, 0x200a, 0x080c, 0x7e4a,
-	0x080c, 0x1aa9, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0xaec2,
+	0x1578, 0x2009, 0x1a7b, 0x2104, 0x8000, 0x200a, 0x080c, 0x7e56,
+	0x080c, 0x1aa9, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0xaedc,
 	0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004,
 	0xc085, 0x7006, 0x0005, 0x080c, 0x1578, 0x080c, 0x16bb, 0x0005,
 	0x080c, 0x0dd5, 0x080c, 0x1578, 0x2060, 0x6014, 0x0096, 0x2048,
-	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xaec2, 0x2001,
+	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xaedc, 0x2001,
 	0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001,
 	0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec,
 	0x1110, 0x080c, 0x157d, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005,
 	0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x1578, 0x2060, 0x6014,
 	0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c,
-	0xaec2, 0x0005, 0x080c, 0x1578, 0x080c, 0x0dd5, 0x080c, 0x1578,
+	0xaedc, 0x0005, 0x080c, 0x1578, 0x080c, 0x0dd5, 0x080c, 0x1578,
 	0x080c, 0x14d4, 0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0904, 0x1487,
 	0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, 0x0140, 0x2001,
 	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0804, 0x148d, 0x7004,
@@ -452,14 +452,14 @@ unsigned short risc_code01[] = {
 	0x0810, 0x7004, 0xc09d, 0x7006, 0x78ab, 0x0004, 0x7803, 0x0001,
 	0x080c, 0x14ed, 0x2001, 0x020d, 0x2003, 0x0020, 0x0005, 0x7828,
 	0x782b, 0x0000, 0x9065, 0x090c, 0x0dd5, 0x6014, 0x2048, 0x78ab,
-	0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7e4a, 0x080c, 0x1aa9,
-	0x080c, 0xcb1b, 0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f,
+	0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7e56, 0x080c, 0x1aa9,
+	0x080c, 0xcb35, 0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f,
 	0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882, 0x0005, 0x6020,
-	0x9086, 0x0009, 0x1128, 0x2009, 0x004c, 0x080c, 0xaec2, 0x0048,
+	0x9086, 0x0009, 0x1128, 0x2009, 0x004c, 0x080c, 0xaedc, 0x0048,
 	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c,
-	0xcf00, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004,
-	0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe9a0, 0xd5a4, 0x1118, 0x080c,
-	0x157d, 0x0005, 0x080c, 0x7e4a, 0x080c, 0x1aa9, 0x0005, 0x781f,
+	0xcf1a, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe9c1, 0xd5a4, 0x1118, 0x080c,
+	0x157d, 0x0005, 0x080c, 0x7e56, 0x080c, 0x1aa9, 0x0005, 0x781f,
 	0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6,
 	0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120,
 	0x2001, 0x0016, 0x080c, 0x15ee, 0x00fe, 0x007e, 0x006e, 0x001e,
@@ -476,10 +476,10 @@ unsigned short risc_code01[] = {
 	0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c, 0x157d, 0x0040, 0x2001,
 	0x020d, 0x2003, 0x0020, 0x080c, 0x1313, 0x7803, 0x0001, 0x00ee,
 	0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
-	0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009, 0x0053, 0x080c, 0xaec2,
+	0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009, 0x0053, 0x080c, 0xaedc,
 	0x0005, 0x0005, 0x0005, 0x00e1, 0x2008, 0x00d1, 0x0006, 0x7004,
-	0xc09d, 0x7006, 0x000e, 0x080c, 0x8d40, 0x0005, 0x0089, 0x9005,
-	0x0118, 0x080c, 0x8943, 0x0cd0, 0x0005, 0x2001, 0x0036, 0x2009,
+	0xc09d, 0x7006, 0x000e, 0x080c, 0x8d69, 0x0005, 0x0089, 0x9005,
+	0x0118, 0x080c, 0x896c, 0x0cd0, 0x0005, 0x2001, 0x0036, 0x2009,
 	0x1820, 0x210c, 0x2011, 0x181f, 0x2214, 0x080c, 0x15ee, 0x0005,
 	0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x14d4, 0x00d6,
 	0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005,
@@ -488,7 +488,7 @@ unsigned short risc_code01[] = {
 	0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x15e0,
 	0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1,
 	0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005,
-	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7e4a, 0x080c,
+	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7e56, 0x080c,
 	0x1aa9, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018,
 	0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307,
 	0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084,
@@ -505,7 +505,7 @@ unsigned short risc_code01[] = {
 	0x0048, 0x9086, 0x0008, 0x1904, 0x1667, 0x2001, 0x0109, 0x2004,
 	0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
 	0x0126, 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016, 0x2009, 0x1a7d,
-	0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x9079, 0x001e, 0x002e,
+	0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x90a2, 0x001e, 0x002e,
 	0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x000e,
 	0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006, 0x0126, 0x01c6,
 	0x01d6, 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016, 0x2009, 0x1a7e,
@@ -515,7 +515,7 @@ unsigned short risc_code01[] = {
 	0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284, 0x0048, 0x9086,
 	0x0008, 0x11e0, 0x2001, 0x19f6, 0x2004, 0x9005, 0x01b8, 0x2001,
 	0x1a66, 0x2004, 0x9086, 0x0000, 0x0188, 0x2009, 0x1a7c, 0x2104,
-	0x8000, 0x0208, 0x200a, 0x080c, 0xa2dd, 0x2009, 0x180c, 0x2104,
+	0x8000, 0x0208, 0x200a, 0x080c, 0xa2f7, 0x2009, 0x180c, 0x2104,
 	0xc0f5, 0x200a, 0x2009, 0xff00, 0x0804, 0x1617, 0x9085, 0x0001,
 	0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x080c, 0x1610,
 	0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd5,
@@ -526,8 +526,8 @@ unsigned short risc_code01[] = {
 	0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904, 0x171a, 0x2001,
 	0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce, 0x918e, 0x0039,
 	0x1904, 0x171a, 0x9c06, 0x15f0, 0x0126, 0x2091, 0x2600, 0x080c,
-	0x7d91, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598, 0x2b48,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c, 0xcedb,
+	0x7d9d, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598, 0x2b48,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c, 0xcef5,
 	0xab42, 0xac3e, 0x2001, 0x1869, 0x2004, 0xd0b4, 0x1170, 0x601c,
 	0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
 	0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x20b0, 0x1190,
@@ -543,7 +543,7 @@ unsigned short risc_code01[] = {
 	0x9085, 0x0001, 0x0804, 0x18a1, 0xa87c, 0xd0ac, 0x0dc8, 0x0804,
 	0x17c5, 0xa87c, 0xd0ac, 0x0da0, 0x0804, 0x1830, 0xa898, 0x901d,
 	0x1108, 0xab9c, 0x9016, 0xaab2, 0xaa3e, 0xaa42, 0x3e00, 0x9080,
-	0x0008, 0x2004, 0x9080, 0x8f07, 0x2005, 0x9005, 0x090c, 0x0dd5,
+	0x0008, 0x2004, 0x9080, 0x8f30, 0x2005, 0x9005, 0x090c, 0x0dd5,
 	0x2004, 0xa8ae, 0x0804, 0x1889, 0xa87c, 0xd0bc, 0x09c8, 0xa890,
 	0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x17c5, 0xa87c, 0xd0bc,
 	0x0978, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1830,
@@ -637,7 +637,7 @@ unsigned short risc_code01[] = {
 	0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008, 0xa986,
 	0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934, 0xa88c,
 	0x9106, 0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c, 0xc084,
-	0x601e, 0x2009, 0x0048, 0x0804, 0xaec2, 0x0005, 0x0126, 0x00c6,
+	0x601e, 0x2009, 0x0048, 0x0804, 0xaedc, 0x0005, 0x0126, 0x00c6,
 	0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000,
 	0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006,
 	0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120,
@@ -648,17 +648,17 @@ unsigned short risc_code01[] = {
 	0x1d40, 0x080c, 0x1b45, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c,
 	0x1b32, 0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000,
 	0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004,
-	0x00fe, 0x080c, 0x73b0, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000,
+	0x00fe, 0x080c, 0x73bc, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000,
 	0x2001, 0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001,
-	0x8211, 0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x7460,
+	0x8211, 0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x746c,
 	0x006e, 0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001,
 	0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2c44,
 	0x2009, 0x003c, 0x080c, 0x23d2, 0x2001, 0x015d, 0x2003, 0x0000,
-	0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x83eb, 0x70a0, 0x70a2,
+	0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x8414, 0x70a0, 0x70a2,
 	0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020,
 	0x00f6, 0x2079, 0x0300, 0x080c, 0x1313, 0x7803, 0x0001, 0x00fe,
 	0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001,
-	0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x73b0, 0x1108, 0x0005,
+	0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x73bc, 0x1108, 0x0005,
 	0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001,
 	0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c,
 	0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000,
@@ -770,13 +770,13 @@ unsigned short risc_code01[] = {
 	0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c,
 	0x0dd5, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004,
 	0x7003, 0x0000, 0x7004, 0x0016, 0x080c, 0x1cbe, 0x001e, 0x2060,
-	0x6014, 0x2048, 0x080c, 0xcb1b, 0x0118, 0xa880, 0xc0bd, 0xa882,
+	0x6014, 0x2048, 0x080c, 0xcb35, 0x0118, 0xa880, 0xc0bd, 0xa882,
 	0x6020, 0x9086, 0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001,
 	0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a,
-	0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c, 0xc74e, 0x00ce,
+	0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c, 0xc768, 0x00ce,
 	0x2001, 0x19f6, 0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c,
-	0x23d2, 0x080c, 0xa7b2, 0x2011, 0x0000, 0x080c, 0xa643, 0x080c,
-	0x9790, 0x002e, 0x0804, 0x1ff8, 0x0126, 0x2091, 0x2400, 0xa858,
+	0x23d2, 0x080c, 0xa7cc, 0x2011, 0x0000, 0x080c, 0xa65d, 0x080c,
+	0x97b9, 0x002e, 0x0804, 0x1ff8, 0x0126, 0x2091, 0x2400, 0xa858,
 	0x2040, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1e71,
 	0x7000, 0x0002, 0x1ff8, 0x1ec6, 0x1f46, 0x1ff6, 0x8001, 0x7002,
 	0x7027, 0x0000, 0xd19c, 0x1158, 0x8aff, 0x0904, 0x1f13, 0x080c,
@@ -820,7 +820,7 @@ unsigned short risc_code01[] = {
 	0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a66, 0x7000, 0x9086,
 	0x0000, 0x0904, 0x2043, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c,
 	0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188,
-	0x080c, 0xe9e9, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0dd5,
+	0x080c, 0xea0a, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0dd5,
 	0x0016, 0x2009, 0x0040, 0x080c, 0x23d2, 0x001e, 0x2001, 0x020c,
 	0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
 	0x1120, 0x2009, 0x0040, 0x080c, 0x23d2, 0x782c, 0xd0fc, 0x09a8,
@@ -910,16 +910,16 @@ unsigned short risc_code01[] = {
 	0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005,
 	0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x23cf, 0x7900, 0xd1dc,
 	0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x22f7,
-	0x22ef, 0x7d91, 0x22ef, 0x22f1, 0x22f1, 0x22f1, 0x22f1, 0x7d77,
+	0x22ef, 0x7d9d, 0x22ef, 0x22f1, 0x22f1, 0x22f1, 0x22f1, 0x7d83,
 	0x22ef, 0x22f3, 0x22ef, 0x22f1, 0x22ef, 0x22f1, 0x22ef, 0x080c,
-	0x0dd5, 0x0031, 0x0020, 0x080c, 0x7d77, 0x080c, 0x7d91, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x080c, 0xe9e9, 0x7930, 0x9184, 0x0003,
+	0x0dd5, 0x0031, 0x0020, 0x080c, 0x7d83, 0x080c, 0x7d9d, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x080c, 0xea0a, 0x7930, 0x9184, 0x0003,
 	0x01c0, 0x2001, 0x19f6, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133,
 	0x2004, 0x9005, 0x090c, 0x0dd5, 0x00c6, 0x2001, 0x19f6, 0x2064,
-	0x080c, 0xc74e, 0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x23d2,
+	0x080c, 0xc768, 0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x23d2,
 	0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160,
-	0x080c, 0x73b0, 0x1138, 0x080c, 0x7698, 0x080c, 0x601b, 0x080c,
-	0x72e2, 0x0010, 0x080c, 0x5eda, 0x080c, 0x7e40, 0x0041, 0x0018,
+	0x080c, 0x73bc, 0x1138, 0x080c, 0x76a4, 0x080c, 0x601a, 0x080c,
+	0x72ee, 0x0010, 0x080c, 0x5ed9, 0x080c, 0x7e4c, 0x0041, 0x0018,
 	0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6,
 	0x0036, 0x0046, 0x0056, 0x2071, 0x1a62, 0x080c, 0x1aa9, 0x005e,
 	0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071,
@@ -969,99 +969,99 @@ unsigned short risc_code01[] = {
 	0x0007, 0x0082, 0x0016, 0x2001, 0x188b, 0x200c, 0xd184, 0x001e,
 	0x0d70, 0x0c98, 0x0016, 0x2001, 0x188b, 0x200c, 0xd194, 0x001e,
 	0x0d30, 0x0c58, 0x24d4, 0x24ba, 0x24bd, 0x24c0, 0x24c5, 0x24c7,
-	0x24cb, 0x24cf, 0x080c, 0x8fac, 0x00b8, 0x080c, 0x9079, 0x00a0,
-	0x080c, 0x9079, 0x080c, 0x8fac, 0x0078, 0x0099, 0x0068, 0x080c,
-	0x8fac, 0x0079, 0x0048, 0x080c, 0x9079, 0x0059, 0x0028, 0x080c,
-	0x9079, 0x080c, 0x8fac, 0x0029, 0x002e, 0x001e, 0x000e, 0x012e,
+	0x24cb, 0x24cf, 0x080c, 0x8fd5, 0x00b8, 0x080c, 0x90a2, 0x00a0,
+	0x080c, 0x90a2, 0x080c, 0x8fd5, 0x0078, 0x0099, 0x0068, 0x080c,
+	0x8fd5, 0x0079, 0x0048, 0x080c, 0x90a2, 0x0059, 0x0028, 0x080c,
+	0x90a2, 0x080c, 0x8fd5, 0x0029, 0x002e, 0x001e, 0x000e, 0x012e,
 	0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118, 0xd19c, 0x1904,
-	0x273c, 0xd1f4, 0x190c, 0x0dce, 0x080c, 0x73b0, 0x0904, 0x252f,
-	0x080c, 0xd216, 0x1120, 0x7000, 0x9086, 0x0003, 0x0570, 0x6024,
-	0x9084, 0x1800, 0x0550, 0x080c, 0x73d3, 0x0118, 0x080c, 0x73c1,
-	0x1520, 0x6027, 0x0020, 0x6043, 0x0000, 0x080c, 0xd216, 0x0168,
-	0x080c, 0x73d3, 0x1150, 0x2001, 0x19a7, 0x2003, 0x0001, 0x6027,
-	0x1800, 0x080c, 0x7246, 0x0804, 0x273f, 0x70a4, 0x9005, 0x1150,
-	0x70a7, 0x0001, 0x00d6, 0x2069, 0x0140, 0x080c, 0x7407, 0x00de,
-	0x1904, 0x273f, 0x080c, 0x76a2, 0x0428, 0x080c, 0x73d3, 0x1590,
-	0x6024, 0x9084, 0x1800, 0x1108, 0x0468, 0x080c, 0x76a2, 0x080c,
-	0x7698, 0x080c, 0x601b, 0x080c, 0x72e2, 0x0804, 0x273c, 0xd1ac,
+	0x273c, 0xd1f4, 0x190c, 0x0dce, 0x080c, 0x73bc, 0x0904, 0x252f,
+	0x080c, 0xd230, 0x1120, 0x7000, 0x9086, 0x0003, 0x0570, 0x6024,
+	0x9084, 0x1800, 0x0550, 0x080c, 0x73df, 0x0118, 0x080c, 0x73cd,
+	0x1520, 0x6027, 0x0020, 0x6043, 0x0000, 0x080c, 0xd230, 0x0168,
+	0x080c, 0x73df, 0x1150, 0x2001, 0x19a7, 0x2003, 0x0001, 0x6027,
+	0x1800, 0x080c, 0x7252, 0x0804, 0x273f, 0x70a4, 0x9005, 0x1150,
+	0x70a7, 0x0001, 0x00d6, 0x2069, 0x0140, 0x080c, 0x7413, 0x00de,
+	0x1904, 0x273f, 0x080c, 0x76ae, 0x0428, 0x080c, 0x73df, 0x1590,
+	0x6024, 0x9084, 0x1800, 0x1108, 0x0468, 0x080c, 0x76ae, 0x080c,
+	0x76a4, 0x080c, 0x601a, 0x080c, 0x72ee, 0x0804, 0x273c, 0xd1ac,
 	0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190,
-	0xd0cc, 0x0130, 0x7098, 0x9086, 0x0028, 0x1110, 0x080c, 0x7585,
-	0x0804, 0x273c, 0x080c, 0x769d, 0x0048, 0x2001, 0x197d, 0x2003,
-	0x0002, 0x0020, 0x080c, 0x74ea, 0x0804, 0x273c, 0x080c, 0x7620,
+	0xd0cc, 0x0130, 0x7098, 0x9086, 0x0028, 0x1110, 0x080c, 0x7591,
+	0x0804, 0x273c, 0x080c, 0x76a9, 0x0048, 0x2001, 0x197d, 0x2003,
+	0x0002, 0x0020, 0x080c, 0x74f6, 0x0804, 0x273c, 0x080c, 0x762c,
 	0x0804, 0x273c, 0x6220, 0xd1bc, 0x0138, 0xd2bc, 0x1904, 0x27af,
 	0xd2b4, 0x1904, 0x27c2, 0x0000, 0xd1ac, 0x0904, 0x2651, 0x0036,
-	0x6328, 0xc3bc, 0x632a, 0x003e, 0x080c, 0x73b0, 0x11c0, 0x6027,
-	0x0020, 0x0006, 0x0026, 0x0036, 0x080c, 0x73ca, 0x1158, 0x080c,
-	0x7698, 0x080c, 0x601b, 0x080c, 0x72e2, 0x003e, 0x002e, 0x000e,
-	0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x7388, 0x0016,
+	0x6328, 0xc3bc, 0x632a, 0x003e, 0x080c, 0x73bc, 0x11c0, 0x6027,
+	0x0020, 0x0006, 0x0026, 0x0036, 0x080c, 0x73d6, 0x1158, 0x080c,
+	0x76a4, 0x080c, 0x601a, 0x080c, 0x72ee, 0x003e, 0x002e, 0x000e,
+	0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x7394, 0x0016,
 	0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100,
 	0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74da, 0x948c, 0xff00,
 	0x7038, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160, 0x7048, 0xd084,
 	0x1148, 0xc085, 0x704a, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c,
-	0x4b05, 0x003e, 0x080c, 0xd20f, 0x1904, 0x262e, 0x9196, 0xff00,
+	0x4b04, 0x003e, 0x080c, 0xd229, 0x1904, 0x262e, 0x9196, 0xff00,
 	0x05a8, 0x7060, 0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116,
-	0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x3312, 0x0128, 0xc18d,
-	0x7132, 0x080c, 0x6962, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130,
+	0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x3319, 0x0128, 0xc18d,
+	0x7132, 0x080c, 0x696a, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130,
 	0x6248, 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c,
 	0x0904, 0x262e, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c,
 	0xd1ac, 0x1904, 0x262e, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011,
-	0x8013, 0x080c, 0x4b05, 0x003e, 0x0804, 0x262e, 0x7038, 0xd08c,
+	0x8013, 0x080c, 0x4b04, 0x003e, 0x0804, 0x262e, 0x7038, 0xd08c,
 	0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x262e, 0xc1ad,
-	0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c, 0x4b05, 0x003e,
+	0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c, 0x4b04, 0x003e,
 	0x7130, 0xc185, 0x7132, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x01f0,
-	0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x86b4, 0x2019,
-	0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xe501, 0x00ce, 0x9484,
-	0x00ff, 0x9080, 0x331e, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120,
-	0x9006, 0x2009, 0x000e, 0x080c, 0xe58d, 0x001e, 0x0016, 0x2009,
-	0x0002, 0x2019, 0x0004, 0x080c, 0x3187, 0x001e, 0x0078, 0x0156,
-	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6600, 0x1110, 0x080c,
-	0x6035, 0x8108, 0x1f04, 0x2624, 0x00be, 0x015e, 0x00ce, 0x004e,
-	0x080c, 0xadb8, 0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014,
+	0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x86dd, 0x2019,
+	0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xe522, 0x00ce, 0x9484,
+	0x00ff, 0x9080, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120,
+	0x9006, 0x2009, 0x000e, 0x080c, 0xe5ae, 0x001e, 0x0016, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x318a, 0x001e, 0x0078, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x65ff, 0x1110, 0x080c,
+	0x6034, 0x8108, 0x1f04, 0x2624, 0x00be, 0x015e, 0x00ce, 0x004e,
+	0x080c, 0xadd2, 0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014,
 	0x9296, 0x0004, 0x1170, 0xd19c, 0x11a0, 0x2011, 0x180c, 0x2214,
 	0xd29c, 0x1120, 0x6204, 0x9295, 0x0002, 0x6206, 0x6228, 0xc29d,
 	0x622a, 0x2003, 0x0001, 0x2001, 0x1826, 0x2003, 0x0000, 0x6027,
 	0x0020, 0xd194, 0x0904, 0x273c, 0x0016, 0x6220, 0xd2b4, 0x0904,
-	0x26d9, 0x080c, 0x8550, 0x080c, 0xa259, 0x6027, 0x0004, 0x00f6,
+	0x26d9, 0x080c, 0x8579, 0x080c, 0xa273, 0x6027, 0x0004, 0x00f6,
 	0x2019, 0x19f0, 0x2304, 0x907d, 0x0904, 0x26a8, 0x7804, 0x9086,
 	0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140,
 	0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001, 0x0003,
 	0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0,
 	0x080c, 0x2cff, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009,
 	0x080c, 0x2c19, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100,
-	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x080c, 0x955f, 0x080c,
-	0x9664, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0xae47,
+	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x080c, 0x9588, 0x080c,
+	0x968d, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0xae61,
 	0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005,
 	0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110,
 	0x080c, 0x2cff, 0x00de, 0x00c6, 0x2061, 0x19e7, 0x6028, 0x080c,
-	0xd216, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
-	0x1238, 0x8000, 0x602a, 0x00ce, 0x080c, 0xa235, 0x0804, 0x273b,
-	0x2061, 0x0100, 0x62c0, 0x080c, 0xac43, 0x2019, 0x19f0, 0x2304,
-	0x9065, 0x0120, 0x2009, 0x0027, 0x080c, 0xaec2, 0x00ce, 0x0804,
-	0x273b, 0xd2bc, 0x0904, 0x2722, 0x080c, 0x855d, 0x6014, 0x9084,
+	0xd230, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
+	0x1238, 0x8000, 0x602a, 0x00ce, 0x080c, 0xa24f, 0x0804, 0x273b,
+	0x2061, 0x0100, 0x62c0, 0x080c, 0xac5d, 0x2019, 0x19f0, 0x2304,
+	0x9065, 0x0120, 0x2009, 0x0027, 0x080c, 0xaedc, 0x00ce, 0x0804,
+	0x273b, 0xd2bc, 0x0904, 0x2722, 0x080c, 0x8586, 0x6014, 0x9084,
 	0x1984, 0x9085, 0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069,
 	0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2cff, 0x00de,
-	0x00c6, 0x2061, 0x19e7, 0x6044, 0x080c, 0xd216, 0x0120, 0x909a,
+	0x00c6, 0x2061, 0x19e7, 0x6044, 0x080c, 0xd230, 0x0120, 0x909a,
 	0x0003, 0x1658, 0x0018, 0x909a, 0x00c8, 0x1638, 0x8000, 0x6046,
-	0x603c, 0x00ce, 0x9005, 0x05b8, 0x2009, 0x07d0, 0x080c, 0x8555,
+	0x603c, 0x00ce, 0x9005, 0x05b8, 0x2009, 0x07d0, 0x080c, 0x857e,
 	0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x6114, 0x918c,
 	0x1984, 0x918d, 0x0012, 0x6116, 0x0430, 0x9080, 0x0008, 0x2004,
 	0x9086, 0x0009, 0x0d98, 0x6114, 0x918c, 0x1984, 0x918d, 0x0016,
 	0x6116, 0x00c8, 0x6027, 0x0004, 0x00b0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa59c, 0x003e, 0x2019, 0x19f6, 0x2304, 0x9065, 0x0150,
+	0x080c, 0xa5b6, 0x003e, 0x2019, 0x19f6, 0x2304, 0x9065, 0x0150,
 	0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110, 0x2009, 0x004f,
-	0x080c, 0xaec2, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x27aa, 0x7038,
+	0x080c, 0xaedc, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x27aa, 0x7038,
 	0xd0ac, 0x1904, 0x2783, 0x0016, 0x0156, 0x6027, 0x0008, 0x6050,
 	0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf, 0x6052, 0x080c,
 	0x2c38, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012, 0x1d04, 0x2756,
-	0x080c, 0x8584, 0x1f04, 0x2756, 0x6050, 0x9085, 0x0400, 0x9084,
+	0x080c, 0x85ad, 0x1f04, 0x2756, 0x6050, 0x9085, 0x0400, 0x9084,
 	0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x2764, 0x6150,
 	0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04, 0x276d, 0x080c,
-	0x8584, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e, 0x6027,
+	0x85ad, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e, 0x6027,
 	0x0008, 0x0480, 0x080c, 0x2c00, 0x1f04, 0x276d, 0x015e, 0x6152,
 	0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c,
-	0xadb8, 0x60e3, 0x0000, 0x080c, 0xe9c8, 0x080c, 0xe9e3, 0x080c,
-	0x56d4, 0xd0fc, 0x1138, 0x080c, 0xd20f, 0x1120, 0x9085, 0x0001,
-	0x080c, 0x73f7, 0x9006, 0x080c, 0x2cef, 0x2009, 0x0002, 0x080c,
+	0xadd2, 0x60e3, 0x0000, 0x080c, 0xe9e9, 0x080c, 0xea04, 0x080c,
+	0x56d3, 0xd0fc, 0x1138, 0x080c, 0xd229, 0x1120, 0x9085, 0x0001,
+	0x080c, 0x7403, 0x9006, 0x080c, 0x2cef, 0x2009, 0x0002, 0x080c,
 	0x2c3e, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027, 0x0008, 0x080c,
 	0x0bae, 0x001e, 0x918c, 0xffd0, 0x6126, 0x00ae, 0x0005, 0x0016,
 	0x2001, 0x188b, 0x200c, 0xd184, 0x001e, 0x0904, 0x255c, 0x0016,
@@ -1075,33 +1075,33 @@ unsigned short risc_code01[] = {
 	0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71d0, 0x70d2, 0x9116,
 	0x05e8, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x2c3e, 0x2011,
 	0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019,
-	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x4b05, 0x0438, 0x2001,
+	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x4b04, 0x0438, 0x2001,
 	0x19a8, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4,
 	0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c,
-	0x4b05, 0x080c, 0x56d4, 0xd0fc, 0x1188, 0x080c, 0xd20f, 0x1170,
-	0x00c6, 0x080c, 0x28d2, 0x080c, 0xa503, 0x2061, 0x0100, 0x2019,
-	0x0028, 0x2009, 0x0002, 0x080c, 0x3187, 0x00ce, 0x012e, 0x00fe,
+	0x4b04, 0x080c, 0x56d3, 0xd0fc, 0x1188, 0x080c, 0xd229, 0x1170,
+	0x00c6, 0x080c, 0x28d2, 0x080c, 0xa51d, 0x2061, 0x0100, 0x2019,
+	0x0028, 0x2009, 0x0002, 0x080c, 0x318a, 0x00ce, 0x012e, 0x00fe,
 	0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c,
 	0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1837, 0x2214,
 	0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181f, 0x2204, 0x9106,
 	0x1190, 0x2011, 0x1820, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00,
 	0x9206, 0x1148, 0x2011, 0x1820, 0x2214, 0x9294, 0x00ff, 0x9584,
-	0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x8095, 0x0048, 0x9584,
-	0x00ff, 0x9080, 0x331e, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006,
-	0x0005, 0x9080, 0x331e, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6,
+	0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x80be, 0x0048, 0x9584,
+	0x00ff, 0x9080, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006,
+	0x0005, 0x9080, 0x3325, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6,
 	0x2069, 0x0140, 0x2001, 0x1818, 0x2003, 0x00ef, 0x20a9, 0x0010,
 	0x9006, 0x6852, 0x6856, 0x1f04, 0x2882, 0x00de, 0x0005, 0x0006,
 	0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1818, 0x2102, 0x8114,
 	0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006,
-	0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xf195, 0x2005, 0x6856,
+	0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xf1b6, 0x2005, 0x6856,
 	0x8211, 0x1f04, 0x2897, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6,
 	0x2061, 0x1800, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032,
 	0x00ce, 0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069,
 	0x0140, 0x6980, 0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210,
 	0x22a8, 0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e,
 	0x1f04, 0x28c7, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de,
-	0x015e, 0x0005, 0x080c, 0x56d0, 0xd0c4, 0x0150, 0xd0a4, 0x0140,
-	0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xe58d, 0x004e,
+	0x015e, 0x0005, 0x080c, 0x56cf, 0xd0c4, 0x0150, 0xd0a4, 0x0140,
+	0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xe5ae, 0x004e,
 	0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc,
 	0x0904, 0x293e, 0x080c, 0x2b9d, 0x0660, 0x9084, 0x0700, 0x908e,
 	0x0600, 0x1120, 0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500,
@@ -1110,9 +1110,9 @@ unsigned short risc_code01[] = {
 	0x2009, 0x0002, 0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009,
 	0x0004, 0x0078, 0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008,
 	0x0040, 0x9084, 0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030,
-	0x0058, 0x2300, 0x9080, 0x0020, 0x2018, 0x080c, 0x8f3f, 0x928c,
+	0x0058, 0x2300, 0x9080, 0x0020, 0x2018, 0x080c, 0x8f68, 0x928c,
 	0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c,
-	0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x73b0, 0x1118, 0x2009,
+	0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x73bc, 0x1118, 0x2009,
 	0x196d, 0x220a, 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000,
 	0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001,
 	0x0170, 0x200c, 0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c,
@@ -1129,16 +1129,16 @@ unsigned short risc_code01[] = {
 	0x080c, 0x2bfb, 0x2001, 0x1992, 0x2003, 0x0000, 0x7828, 0x9084,
 	0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x2bb9, 0x2001,
 	0x1990, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2a0e, 0x080c,
-	0x8562, 0x0005, 0x2009, 0x1995, 0x200b, 0x0000, 0x2001, 0x199a,
+	0x858b, 0x0005, 0x2009, 0x1995, 0x200b, 0x0000, 0x2001, 0x199a,
 	0x2003, 0x0036, 0x2001, 0x1999, 0x2003, 0x002a, 0x2001, 0x1992,
 	0x2003, 0x0001, 0x9006, 0x080c, 0x2b6b, 0x2001, 0xffff, 0x20a9,
 	0x0009, 0x080c, 0x2bb9, 0x2001, 0x1990, 0x2003, 0x0006, 0x2009,
-	0x001e, 0x2011, 0x2a0e, 0x080c, 0x8562, 0x0005, 0x080c, 0x0dd5,
+	0x001e, 0x2011, 0x2a0e, 0x080c, 0x858b, 0x0005, 0x080c, 0x0dd5,
 	0x2001, 0x199a, 0x2003, 0x0036, 0x2001, 0x1992, 0x2003, 0x0003,
 	0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010,
 	0x2001, 0x0001, 0x080c, 0x2b6b, 0x2001, 0x1996, 0x2003, 0x0000,
 	0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2bb9, 0x2001, 0x1990,
-	0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2a0e, 0x080c, 0x8562,
+	0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2a0e, 0x080c, 0x858b,
 	0x0005, 0x080c, 0x0dd5, 0x080c, 0x0dd5, 0x0005, 0x0006, 0x0016,
 	0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079,
 	0x0100, 0x2001, 0x1992, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0dd5,
@@ -1199,13 +1199,13 @@ unsigned short risc_code01[] = {
 	0x783b, 0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006,
 	0x0060, 0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186,
 	0x0003, 0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x2be6,
-	0x080c, 0x8584, 0x1f04, 0x2be6, 0x7850, 0x9085, 0x0400, 0x9084,
+	0x080c, 0x85ad, 0x1f04, 0x2be6, 0x7850, 0x9085, 0x0400, 0x9084,
 	0xdfbf, 0x7852, 0x080c, 0x2c38, 0x9085, 0x1000, 0x7852, 0x000e,
 	0x001e, 0x012e, 0x0005, 0x7850, 0x9084, 0xffcf, 0x7852, 0x0005,
 	0x0006, 0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854,
 	0xd0ac, 0x1130, 0x7820, 0xd0e4, 0x1140, 0x1f04, 0x2c0a, 0x0028,
 	0x7854, 0xd08c, 0x1110, 0x1f04, 0x2c10, 0x00fe, 0x015e, 0x000e,
-	0x0005, 0x1d04, 0x2c19, 0x080c, 0x8584, 0x1f04, 0x2c19, 0x0005,
+	0x0005, 0x1d04, 0x2c19, 0x080c, 0x85ad, 0x1f04, 0x2c19, 0x0005,
 	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005,
 	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005,
 	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005,
@@ -1232,13 +1232,13 @@ unsigned short risc_code01[] = {
 	0x001e, 0x919c, 0xffe4, 0x9184, 0x0001, 0x0118, 0x9385, 0x0009,
 	0x6016, 0x9184, 0x0002, 0x0118, 0x9385, 0x0012, 0x6016, 0x003e,
 	0x2001, 0x180c, 0x200c, 0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016,
-	0x0026, 0x080c, 0x73ca, 0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114,
+	0x0026, 0x080c, 0x73d6, 0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114,
 	0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016,
 	0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9285, 0x1000,
 	0x200a, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009,
 	0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e,
 	0x0005, 0x0006, 0x0016, 0x2009, 0x0140, 0x2104, 0x1128, 0x080c,
-	0x73ca, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e,
+	0x73d6, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e,
 	0x0005, 0x2f95, 0x2f95, 0x2db9, 0x2db9, 0x2dc5, 0x2dc5, 0x2dd1,
 	0x2dd1, 0x2ddf, 0x2ddf, 0x2deb, 0x2deb, 0x2df9, 0x2df9, 0x2e07,
 	0x2e07, 0x2e19, 0x2e19, 0x2e25, 0x2e25, 0x2e33, 0x2e33, 0x2e51,
@@ -1317,1840 +1317,1841 @@ unsigned short risc_code01[] = {
 	0x0146, 0x0156, 0x080c, 0x2941, 0x080c, 0x2295, 0x080c, 0x2481,
 	0x080c, 0x1380, 0x080c, 0x22d0, 0x0000, 0x015e, 0x014e, 0x013e,
 	0x01de, 0x01ce, 0x012e, 0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6,
-	0x0026, 0x0046, 0x9026, 0x080c, 0x6928, 0x1904, 0x30a3, 0x72dc,
+	0x0026, 0x0046, 0x9026, 0x080c, 0x6930, 0x1904, 0x30a6, 0x72dc,
 	0x2001, 0x197c, 0x2004, 0x9005, 0x1110, 0xd29c, 0x0148, 0xd284,
-	0x1138, 0xd2bc, 0x1904, 0x30a3, 0x080c, 0x30a8, 0x0804, 0x30a3,
-	0xd2cc, 0x1904, 0x30a3, 0x080c, 0x73b0, 0x1120, 0x70af, 0xffff,
-	0x0804, 0x30a3, 0xd294, 0x0120, 0x70af, 0xffff, 0x0804, 0x30a3,
-	0x080c, 0x330d, 0x0160, 0x080c, 0xd216, 0x0128, 0x2001, 0x1818,
-	0x203c, 0x0804, 0x3030, 0x70af, 0xffff, 0x0804, 0x30a3, 0x2001,
-	0x1818, 0x203c, 0x7294, 0xd284, 0x0904, 0x3030, 0xd28c, 0x1904,
-	0x3030, 0x0036, 0x73ac, 0x938e, 0xffff, 0x1110, 0x2019, 0x0001,
+	0x1138, 0xd2bc, 0x1904, 0x30a6, 0x080c, 0x30ab, 0x0804, 0x30a6,
+	0xd2cc, 0x1904, 0x30a6, 0x080c, 0x73bc, 0x1120, 0x70af, 0xffff,
+	0x0804, 0x30a6, 0xd294, 0x0120, 0x70af, 0xffff, 0x0804, 0x30a6,
+	0x080c, 0x3314, 0x0160, 0x080c, 0xd230, 0x0128, 0x2001, 0x1818,
+	0x203c, 0x0804, 0x3033, 0x70af, 0xffff, 0x0804, 0x30a6, 0x2001,
+	0x1818, 0x203c, 0x7294, 0xd284, 0x0904, 0x3033, 0xd28c, 0x1904,
+	0x3033, 0x0036, 0x73ac, 0x938e, 0xffff, 0x1110, 0x2019, 0x0001,
 	0x8314, 0x92e0, 0x1c80, 0x2c04, 0x938c, 0x0001, 0x0120, 0x9084,
-	0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e, 0x05b8, 0x908e,
-	0x0000, 0x05a0, 0x908e, 0x00ff, 0x1150, 0x7230, 0xd284, 0x1598,
-	0x7294, 0xc28d, 0x7296, 0x70af, 0xffff, 0x003e, 0x0488, 0x900e,
-	0x080c, 0x283e, 0x080c, 0x659f, 0x1520, 0x9006, 0xb8bb, 0x0520,
-	0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c, 0x8958, 0x00ce,
-	0x090c, 0x8cfc, 0xb8af, 0x0000, 0x080c, 0x696a, 0x1150, 0x7030,
-	0xd08c, 0x0118, 0xb800, 0xd0bc, 0x0120, 0x080c, 0x30c1, 0x0148,
-	0x0028, 0x080c, 0x31fd, 0x080c, 0x30ed, 0x0118, 0x8318, 0x0804,
-	0x2fe0, 0x73ae, 0x0010, 0x70af, 0xffff, 0x003e, 0x0804, 0x30a3,
-	0x9780, 0x331e, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e,
-	0x70ac, 0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812,
-	0x0220, 0x2008, 0x9802, 0x20a8, 0x0020, 0x70af, 0xffff, 0x0804,
-	0x30a3, 0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x3098, 0xc484,
-	0x080c, 0x6600, 0x0148, 0x080c, 0xd216, 0x1904, 0x3098, 0x080c,
-	0x659f, 0x1904, 0x30a0, 0x0008, 0xc485, 0xb8bb, 0x0520, 0xb8ac,
-	0x9005, 0x0148, 0x00c6, 0x2060, 0x080c, 0x8958, 0x00ce, 0x090c,
-	0x8cfc, 0xb8af, 0x0000, 0x080c, 0x696a, 0x1130, 0x7030, 0xd08c,
-	0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7294, 0xd28c, 0x0180, 0x080c,
-	0x696a, 0x9082, 0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x65c4,
-	0x0028, 0x080c, 0x3289, 0x01a0, 0x080c, 0x32b4, 0x0088, 0x080c,
-	0x31fd, 0x080c, 0xd216, 0x1160, 0x080c, 0x30ed, 0x0188, 0x0040,
-	0x080c, 0xd216, 0x1118, 0x080c, 0x3289, 0x0110, 0x0451, 0x0140,
-	0x001e, 0x8108, 0x015e, 0x1f04, 0x3049, 0x70af, 0xffff, 0x0018,
-	0x001e, 0x015e, 0x71ae, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005,
-	0x00c6, 0x0016, 0x70af, 0x0001, 0x2009, 0x007e, 0x080c, 0x659f,
-	0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe, 0x080c, 0x31fd, 0x04a9,
-	0x0128, 0x70dc, 0xc0bd, 0x70de, 0x080c, 0xcf67, 0x001e, 0x00ce,
-	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004,
-	0x9084, 0x00ff, 0xb842, 0x080c, 0xae95, 0x01d0, 0x2b00, 0x6012,
-	0x080c, 0xcf90, 0x6023, 0x0001, 0x9006, 0x080c, 0x653c, 0x2001,
-	0x0000, 0x080c, 0x6550, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000,
-	0x70aa, 0x012e, 0x2009, 0x0004, 0x080c, 0xaec2, 0x9085, 0x0001,
-	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6,
-	0x00c6, 0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c,
-	0xae95, 0x0548, 0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0,
-	0x9086, 0x007e, 0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
-	0x1110, 0x080c, 0x31bc, 0x080c, 0xcf90, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x653c, 0x2001, 0x0002, 0x080c, 0x6550, 0x0126, 0x2091,
-	0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0002, 0x080c,
-	0xaec2, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
-	0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080, 0x080c, 0x659f, 0x1140,
-	0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039, 0x0110, 0x70e3, 0xffff,
-	0x002e, 0x00ce, 0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
-	0x080c, 0xadf1, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xcf90, 0x6023,
-	0x0001, 0x9006, 0x080c, 0x653c, 0x2001, 0x0002, 0x080c, 0x6550,
-	0x0126, 0x2091, 0x8000, 0x70e4, 0x8000, 0x70e6, 0x012e, 0x2009,
-	0x0002, 0x080c, 0xaec2, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e,
-	0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009,
-	0x007f, 0x080c, 0x659f, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd,
-	0xb8cf, 0x0004, 0x080c, 0xadf1, 0x0170, 0x2b00, 0x6012, 0x6316,
-	0x6023, 0x0001, 0x620a, 0x080c, 0xcf90, 0x2009, 0x0022, 0x080c,
-	0xaec2, 0x9085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6,
-	0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6, 0x21f0, 0x080c, 0x926d,
-	0x080c, 0x91f2, 0x080c, 0xac8a, 0x080c, 0xbd5d, 0x3e08, 0x2130,
-	0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f,
-	0x900e, 0x0016, 0x080c, 0x6600, 0x1140, 0x9686, 0x0002, 0x1118,
-	0xb800, 0xd0bc, 0x1110, 0x080c, 0x6035, 0x001e, 0x8108, 0x1f04,
-	0x31a1, 0x9686, 0x0001, 0x190c, 0x32e1, 0x00be, 0x002e, 0x003e,
-	0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026,
-	0x0016, 0x00b6, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029,
-	0x080c, 0x9262, 0x0076, 0x2039, 0x0000, 0x080c, 0x913f, 0x2c08,
-	0x080c, 0xe2ca, 0x007e, 0x001e, 0xba10, 0xbb14, 0x080c, 0x6035,
-	0xba12, 0xbb16, 0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
-	0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058, 0xb8a0, 0x00be,
-	0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a8, 0x9005, 0x0110,
-	0x8001, 0x70aa, 0x000e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x70e4,
-	0x9005, 0x0dc0, 0x8001, 0x70e6, 0x0ca8, 0xb800, 0xc08c, 0xb802,
-	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0036, 0x0026, 0x0016,
-	0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0088, 0x080c,
-	0x56d0, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
-	0x2009, 0x002d, 0x080c, 0xe58d, 0x004e, 0x20a9, 0x0800, 0x9016,
-	0x0026, 0x928e, 0x007e, 0x0904, 0x3269, 0x928e, 0x007f, 0x0904,
-	0x3269, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000, 0x210c, 0x81ff,
-	0x05c0, 0x8fff, 0x1148, 0x2001, 0x198e, 0x0006, 0x2003, 0x0001,
-	0x04e9, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
-	0x0001, 0x080c, 0x6934, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
-	0x9262, 0x0076, 0x2039, 0x0000, 0x080c, 0x913f, 0x00b6, 0x00c6,
-	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
-	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
-	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xe2ca, 0x001e,
-	0x007e, 0x002e, 0x8210, 0x1f04, 0x3220, 0x015e, 0x001e, 0x002e,
-	0x003e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026,
-	0x0016, 0x080c, 0x56d0, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006,
-	0x2220, 0x2009, 0x0029, 0x080c, 0xe58d, 0x001e, 0x002e, 0x004e,
-	0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff, 0x01e8,
-	0x080c, 0x6962, 0x11d0, 0x2100, 0x080c, 0x2871, 0x81ff, 0x01b8,
-	0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0xd384, 0x0120,
-	0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138,
-	0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x0036, 0x2019, 0x0029, 0x00a9, 0x003e, 0x9180, 0x1000,
-	0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1ab0, 0x001e,
-	0x6112, 0x080c, 0x31bc, 0x001e, 0x080c, 0x65c4, 0x012e, 0x00ce,
-	0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0xa7ee, 0x080c,
-	0xe8f6, 0x002e, 0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc,
-	0x0005, 0x00c6, 0x00b6, 0x080c, 0x73b0, 0x1118, 0x20a9, 0x0800,
-	0x0010, 0x20a9, 0x0782, 0x080c, 0x73b0, 0x1110, 0x900e, 0x0010,
-	0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff,
-	0x0110, 0xb800, 0xd0bc, 0x090c, 0x65c4, 0x8108, 0x1f04, 0x32f2,
-	0x2061, 0x1800, 0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082,
-	0x60b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004,
-	0xd0bc, 0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026,
-	0x2011, 0x1867, 0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef, 0x7de8,
-	0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6,
-	0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc,
-	0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc,
-	0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1,
-	0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6,
-	0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797,
-	0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c,
-	0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071,
-	0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66,
-	0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454,
-	0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a,
-	0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039,
-	0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d,
-	0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123,
-	0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f,
-	0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700,
-	0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000,
-	0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000,
-	0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700,
-	0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100,
-	0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00,
-	0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400,
-	0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00,
-	0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800,
-	0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400,
-	0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000,
+	0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e, 0x05d0, 0x908e,
+	0x0000, 0x05b8, 0x908e, 0x00ff, 0x1150, 0x7230, 0xd284, 0x15b0,
+	0x7294, 0xc28d, 0x7296, 0x70af, 0xffff, 0x003e, 0x04a0, 0x900e,
+	0x080c, 0x283e, 0x080c, 0x659e, 0x1538, 0x9006, 0xb8bb, 0x0520,
+	0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c, 0x8981, 0x00ce,
+	0x090c, 0x8d25, 0xb8af, 0x0000, 0x080c, 0x6972, 0x1168, 0x7030,
+	0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c, 0x681f, 0x0120,
+	0x080c, 0x30c4, 0x0148, 0x0028, 0x080c, 0x3204, 0x080c, 0x30f0,
+	0x0118, 0x8318, 0x0804, 0x2fe0, 0x73ae, 0x0010, 0x70af, 0xffff,
+	0x003e, 0x0804, 0x30a6, 0x9780, 0x3325, 0x203d, 0x97bc, 0xff00,
+	0x873f, 0x2041, 0x007e, 0x70ac, 0x9096, 0xffff, 0x1118, 0x900e,
+	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
+	0x70af, 0xffff, 0x0804, 0x30a6, 0x2700, 0x0156, 0x0016, 0x9106,
+	0x0904, 0x309b, 0xc484, 0x080c, 0x65ff, 0x0148, 0x080c, 0xd230,
+	0x1904, 0x309b, 0x080c, 0x659e, 0x1904, 0x30a3, 0x0008, 0xc485,
+	0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c,
+	0x8981, 0x00ce, 0x090c, 0x8d25, 0xb8af, 0x0000, 0x080c, 0x6972,
+	0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7294,
+	0xd28c, 0x0180, 0x080c, 0x6972, 0x9082, 0x0006, 0x02e0, 0xd484,
+	0x1118, 0x080c, 0x65c3, 0x0028, 0x080c, 0x3290, 0x01a0, 0x080c,
+	0x32bb, 0x0088, 0x080c, 0x3204, 0x080c, 0xd230, 0x1160, 0x080c,
+	0x30f0, 0x0188, 0x0040, 0x080c, 0xd230, 0x1118, 0x080c, 0x3290,
+	0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x304c,
+	0x70af, 0xffff, 0x0018, 0x001e, 0x015e, 0x71ae, 0x004e, 0x002e,
+	0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70af, 0x0001, 0x2009,
+	0x007e, 0x080c, 0x659e, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe,
+	0x080c, 0x3204, 0x04a9, 0x0128, 0x70dc, 0xc0bd, 0x70de, 0x080c,
+	0xcf81, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
+	0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xaeaf,
+	0x01d0, 0x2b00, 0x6012, 0x080c, 0xcfaa, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x653b, 0x2001, 0x0000, 0x080c, 0x654f, 0x0126, 0x2091,
+	0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0004, 0x080c,
+	0xaedc, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
+	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084,
+	0x00ff, 0xb842, 0x080c, 0xaeaf, 0x0548, 0x2b00, 0x6012, 0xb800,
+	0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x31bf, 0x080c, 0xcfaa,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x653b, 0x2001, 0x0002, 0x080c,
+	0x654f, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e,
+	0x2009, 0x0002, 0x080c, 0xaedc, 0x9085, 0x0001, 0x00ce, 0x00de,
+	0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080,
+	0x080c, 0x659e, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039,
+	0x0110, 0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016,
+	0x0076, 0x00d6, 0x00c6, 0x080c, 0xae0b, 0x01d0, 0x2b00, 0x6012,
+	0x080c, 0xcfaa, 0x6023, 0x0001, 0x9006, 0x080c, 0x653b, 0x2001,
+	0x0002, 0x080c, 0x654f, 0x0126, 0x2091, 0x8000, 0x70e4, 0x8000,
+	0x70e6, 0x012e, 0x2009, 0x0002, 0x080c, 0xaedc, 0x9085, 0x0001,
+	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x659e, 0x11b8, 0xb813,
+	0x00ff, 0xb817, 0xfffd, 0xb8cf, 0x0004, 0x080c, 0xae0b, 0x0170,
+	0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xcfaa,
+	0x2009, 0x0022, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e, 0x00de,
+	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6,
+	0x21f0, 0x080c, 0x9296, 0x080c, 0x921b, 0x080c, 0xaca4, 0x080c,
+	0xbd77, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
+	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x65ff, 0x1140,
+	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x6034,
+	0x001e, 0x8108, 0x1f04, 0x31a4, 0x9686, 0x0001, 0x190c, 0x32e8,
+	0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
+	0x00c6, 0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x928b, 0x0076, 0x2039,
+	0x0000, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb, 0x007e, 0x001e,
+	0xba10, 0xbb14, 0xbcc0, 0x080c, 0x6034, 0xba12, 0xbb16, 0xbcc2,
+	0x00be, 0x001e, 0x002e, 0x003e, 0x004e, 0x00ce, 0x00ee, 0x0005,
+	0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086,
+	0x0080, 0x0150, 0x2071, 0x1800, 0x70a8, 0x9005, 0x0110, 0x8001,
+	0x70aa, 0x000e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x70e4, 0x9005,
+	0x0dc0, 0x8001, 0x70e6, 0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x0036, 0x0026, 0x0016,
+	0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0078, 0x080c,
+	0x56cf, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2020, 0x2009,
+	0x002d, 0x080c, 0xe5ae, 0x20a9, 0x0800, 0x9016, 0x0026, 0x928e,
+	0x007e, 0x0904, 0x326f, 0x928e, 0x007f, 0x0904, 0x326f, 0x928e,
+	0x0080, 0x05e8, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c0, 0x8fff,
+	0x1148, 0x2001, 0x198e, 0x0006, 0x2003, 0x0001, 0x04f1, 0x000e,
+	0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001, 0x0001, 0x080c,
+	0x693c, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c, 0x928b, 0x0076,
+	0x2039, 0x0000, 0x080c, 0x9168, 0x00b6, 0x00c6, 0x0026, 0x2158,
+	0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118, 0xb807, 0x0404,
+	0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06, 0x002e, 0x00ce,
+	0x00be, 0x0016, 0x2c08, 0x080c, 0xe2eb, 0x001e, 0x007e, 0x002e,
+	0x8210, 0x1f04, 0x3226, 0x015e, 0x001e, 0x002e, 0x003e, 0x004e,
+	0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016,
+	0x080c, 0x56cf, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220,
+	0x2009, 0x0029, 0x080c, 0xe5ae, 0x001e, 0x002e, 0x004e, 0x0005,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff, 0x01e8, 0x080c,
+	0x696a, 0x11d0, 0x2100, 0x080c, 0x2871, 0x81ff, 0x01b8, 0x2019,
+	0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0xd384, 0x0120, 0x9084,
+	0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138, 0x9096,
+	0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x0036, 0x2019, 0x0029, 0x00a9, 0x003e, 0x9180, 0x1000, 0x2004,
+	0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1ab0, 0x001e, 0x6112,
+	0x080c, 0x31bf, 0x001e, 0x080c, 0x65c3, 0x012e, 0x00ce, 0x001e,
+	0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0xa808, 0x080c, 0xe917,
+	0x002e, 0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x0005,
+	0x00c6, 0x00b6, 0x080c, 0x73bc, 0x1118, 0x20a9, 0x0800, 0x0010,
+	0x20a9, 0x0782, 0x080c, 0x73bc, 0x1110, 0x900e, 0x0010, 0x2009,
+	0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110,
+	0xb800, 0xd0bc, 0x090c, 0x65c3, 0x8108, 0x1f04, 0x32f9, 0x2061,
+	0x1800, 0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082, 0x60b3,
+	0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004, 0xd0bc,
+	0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011,
+	0x1867, 0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef, 0x7de8, 0x7ce4,
+	0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5,
+	0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb,
+	0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba,
+	0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae,
+	0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5,
+	0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690,
+	0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a,
+	0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e,
+	0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965,
+	0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353,
+	0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49,
+	0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036,
+	0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c,
+	0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f,
+	0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08,
+	0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600,
+	0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000,
+	0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000,
+	0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600,
+	0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000,
+	0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00,
+	0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300,
+	0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00,
+	0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700,
+	0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300,
+	0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x189e,
-	0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e,
-	0x7042, 0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001,
-	0x080c, 0x1018, 0x090c, 0x0dd5, 0x2900, 0x706a, 0xa867, 0x0002,
-	0xa8ab, 0xdcb0, 0x080c, 0x1018, 0x090c, 0x0dd5, 0x2900, 0x706e,
-	0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004,
-	0x0002, 0x344d, 0x344e, 0x3461, 0x3475, 0x0005, 0x1004, 0x345e,
-	0x0e04, 0x345e, 0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c,
-	0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e,
-	0x0ce8, 0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e,
-	0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x3549, 0x0005, 0x7018,
-	0x2048, 0x2061, 0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864,
-	0x9094, 0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128,
-	0x0005, 0x9086, 0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061,
-	0x1800, 0x701c, 0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040,
-	0x1210, 0x61d0, 0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x3546,
-	0x61d0, 0x0804, 0x34db, 0x351d, 0x3555, 0x355f, 0x3563, 0x356d,
-	0x3573, 0x3577, 0x3587, 0x358a, 0x3594, 0x3599, 0x359e, 0x35a9,
-	0x35b4, 0x35c3, 0x35d2, 0x35e0, 0x35f7, 0x3612, 0x3546, 0x36bb,
-	0x36f9, 0x379f, 0x37b0, 0x37d3, 0x3546, 0x3546, 0x3546, 0x380b,
-	0x3827, 0x3830, 0x385f, 0x3865, 0x3546, 0x38ab, 0x3546, 0x3546,
-	0x3546, 0x3546, 0x3546, 0x38b6, 0x38bf, 0x38c7, 0x38c9, 0x3546,
-	0x3546, 0x3546, 0x3546, 0x3546, 0x3546, 0x38f5, 0x3546, 0x3546,
-	0x3546, 0x3546, 0x3546, 0x3912, 0x3973, 0x3546, 0x3546, 0x3546,
-	0x3546, 0x3546, 0x3546, 0x0002, 0x399d, 0x39a0, 0x39ff, 0x3a18,
-	0x3a48, 0x3ce6, 0x3546, 0x52a9, 0x3546, 0x3546, 0x3546, 0x3546,
-	0x3546, 0x3546, 0x3546, 0x3546, 0x3594, 0x3599, 0x4207, 0x56f4,
-	0x4225, 0x5338, 0x5389, 0x548c, 0x3546, 0x54ee, 0x552a, 0x555b,
-	0x565f, 0x5588, 0x55df, 0x3546, 0x4229, 0x43f2, 0x4408, 0x442d,
-	0x4492, 0x4506, 0x4526, 0x459d, 0x45f9, 0x4655, 0x4658, 0x467d,
-	0x471a, 0x4780, 0x4788, 0x48ba, 0x4a2f, 0x4a63, 0x4cc7, 0x3546,
-	0x4ce5, 0x4d91, 0x4e73, 0x4ecd, 0x3546, 0x4f82, 0x3546, 0x4fe8,
-	0x5003, 0x4788, 0x5249, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c,
-	0x4ae1, 0x0126, 0x2091, 0x8000, 0x0e04, 0x3527, 0x0010, 0x012e,
-	0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010,
-	0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007, 0x0001,
-	0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001,
-	0x08b0, 0x2021, 0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021,
-	0x4005, 0x0868, 0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e,
-	0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x4aee, 0x7883,
-	0x0004, 0x7884, 0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88,
-	0x7a8c, 0x7884, 0x7990, 0x0804, 0x4af1, 0x7984, 0x7888, 0x2114,
-	0x200a, 0x0804, 0x351d, 0x7984, 0x2114, 0x0804, 0x351d, 0x20e1,
-	0x0000, 0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9,
-	0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804, 0x351d, 0x7884,
-	0x2060, 0x04d8, 0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001a,
-	0x789b, 0x0137, 0x0804, 0x351d, 0x2039, 0x0001, 0x7d98, 0x7c9c,
-	0x0800, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182,
-	0x0040, 0x0210, 0x0804, 0x3552, 0x2138, 0x7d98, 0x7c9c, 0x0804,
-	0x3559, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3552, 0x2138,
-	0x7d98, 0x7c9c, 0x0804, 0x3567, 0x79a0, 0x9182, 0x0040, 0x0210,
-	0x0804, 0x3552, 0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0,
-	0x4004, 0x0804, 0x351d, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15,
-	0x9200, 0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x351d,
-	0x0804, 0x354c, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3552,
-	0x21e0, 0x20a9, 0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x351d,
-	0x2069, 0x1847, 0x7884, 0x7990, 0x911a, 0x1a04, 0x3552, 0x8019,
-	0x0904, 0x3552, 0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856,
-	0x9006, 0x685a, 0x685e, 0x080c, 0x76c9, 0x0804, 0x351d, 0x2069,
-	0x1847, 0x7884, 0x7994, 0x911a, 0x1a04, 0x3552, 0x8019, 0x0904,
-	0x3552, 0x684e, 0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006,
-	0x686a, 0x686e, 0x0126, 0x2091, 0x8000, 0x080c, 0x69d4, 0x012e,
-	0x0804, 0x351d, 0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x354f, 0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9,
-	0x0001, 0x20a1, 0x18a6, 0x4101, 0x080c, 0x4aa5, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x354f, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019,
-	0xaf60, 0x080c, 0x4aee, 0x701f, 0x3636, 0x0005, 0xa864, 0x2008,
-	0x9084, 0x00ff, 0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150,
-	0x9096, 0x0015, 0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029,
-	0x1904, 0x354f, 0x810f, 0x918c, 0x00ff, 0x0904, 0x354f, 0x7112,
-	0x7010, 0x8001, 0x0560, 0x7012, 0x080c, 0x4aa5, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x354f, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c,
-	0xa390, 0xa494, 0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1,
-	0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
-	0x4aee, 0x701f, 0x3674, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096,
-	0x0002, 0x0120, 0x9096, 0x000a, 0x1904, 0x354f, 0x0888, 0x7014,
-	0x2048, 0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096,
-	0x0029, 0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x618c, 0x0150, 0x0126,
-	0x2091, 0x8000, 0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x64b5,
-	0x1128, 0x7007, 0x0003, 0x701f, 0x36a0, 0x0005, 0x080c, 0x6eb8,
-	0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099,
-	0x18a6, 0x400a, 0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000,
-	0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e,
-	0xaf60, 0x0804, 0x4af1, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833,
-	0x0010, 0x7883, 0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f,
-	0x2020, 0x2009, 0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061,
-	0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a,
-	0x2009, 0x04fd, 0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x0180, 0x2001, 0x1a19, 0x2004,
-	0x9005, 0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001,
-	0x008a, 0x2003, 0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804,
-	0x0427, 0x81ff, 0x1904, 0x354f, 0x7984, 0x080c, 0x6600, 0x1904,
-	0x3552, 0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x3552,
-	0x7c88, 0x7d8c, 0x080c, 0x6763, 0x080c, 0x6732, 0x0000, 0x1518,
-	0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000,
-	0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870,
-	0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004,
-	0x9c02, 0x1a04, 0x354f, 0x0c30, 0x080c, 0xc74e, 0x012e, 0x0904,
-	0x354f, 0x0804, 0x351d, 0x900e, 0x2001, 0x0005, 0x080c, 0x6eb8,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xce10, 0x080c, 0x6c79, 0x012e,
-	0x0804, 0x351d, 0x00a6, 0x2950, 0xb198, 0x080c, 0x6600, 0x1904,
-	0x378c, 0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c,
-	0xb5a0, 0x080c, 0x6763, 0x080c, 0x6732, 0x1520, 0x2061, 0x1cd0,
-	0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014,
-	0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0158,
-	0x012e, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x2009,
-	0x000d, 0x12b0, 0x0c28, 0x080c, 0xc74e, 0x012e, 0x2009, 0x0003,
-	0x0178, 0x00e0, 0x900e, 0x2001, 0x0005, 0x080c, 0x6eb8, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xce10, 0x080c, 0x6c6d, 0x012e, 0x0070,
-	0xb097, 0x4005, 0xb19a, 0x0010, 0xb097, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000,
-	0x9006, 0x918d, 0x0001, 0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff,
-	0x1904, 0x354f, 0x080c, 0x4abc, 0x0904, 0x3552, 0x080c, 0x66c7,
-	0x0904, 0x354f, 0x080c, 0x6769, 0x0904, 0x354f, 0x0804, 0x451d,
-	0x81ff, 0x1904, 0x354f, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x080c,
-	0x67f7, 0x0904, 0x354f, 0x2019, 0x0005, 0x79a8, 0x080c, 0x6784,
-	0x0904, 0x354f, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3552, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x080c, 0x84d8, 0x7984, 0xd184, 0x1904,
-	0x351d, 0x0804, 0x451d, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0118,
-	0x2009, 0x0001, 0x0450, 0x2029, 0x07ff, 0x645c, 0x2400, 0x9506,
-	0x01f8, 0x2508, 0x080c, 0x6600, 0x11d8, 0x080c, 0x67f7, 0x1128,
-	0x2009, 0x0002, 0x62c0, 0x2518, 0x00c0, 0x2019, 0x0004, 0x900e,
-	0x080c, 0x6784, 0x1118, 0x2009, 0x0006, 0x0078, 0x7884, 0x908a,
-	0x1000, 0x1270, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x84d8,
-	0x8529, 0x1ae0, 0x012e, 0x0804, 0x351d, 0x012e, 0x0804, 0x354f,
-	0x012e, 0x0804, 0x3552, 0x080c, 0x4abc, 0x0904, 0x3552, 0x080c,
-	0x66c7, 0x0904, 0x354f, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066,
-	0x080c, 0x9262, 0x0076, 0x903e, 0x080c, 0x913f, 0x900e, 0x080c,
-	0xe2ca, 0x007e, 0x00ce, 0x080c, 0x6763, 0x0804, 0x351d, 0x080c,
-	0x4abc, 0x0904, 0x3552, 0x080c, 0x6763, 0x2208, 0x0804, 0x351d,
-	0x0156, 0x00d6, 0x00e6, 0x2069, 0x1910, 0x6810, 0x6914, 0x910a,
-	0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x20a9, 0x007e, 0x2069,
-	0x1000, 0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059, 0x9210, 0x8d68,
-	0x1f04, 0x3841, 0x2300, 0x9218, 0x00ee, 0x00de, 0x015e, 0x0804,
-	0x351d, 0x00f6, 0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c,
-	0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069,
-	0x1910, 0x6910, 0x62bc, 0x0804, 0x351d, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x354f, 0x0126, 0x2091, 0x8000, 0x080c, 0x56e4,
-	0x0128, 0x2009, 0x0007, 0x012e, 0x0804, 0x354f, 0x012e, 0x615c,
-	0x9190, 0x331e, 0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108,
-	0x6280, 0x67dc, 0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031,
-	0x0001, 0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031,
-	0x0003, 0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031,
-	0x0002, 0x0068, 0x080c, 0x73b0, 0x1118, 0x2031, 0x0004, 0x0038,
-	0xd79c, 0x0120, 0x2009, 0x0005, 0x0804, 0x354f, 0x9036, 0x7e9a,
-	0x7f9e, 0x0804, 0x351d, 0x614c, 0x6250, 0x2019, 0x1986, 0x231c,
-	0x2001, 0x1987, 0x2004, 0x789a, 0x0804, 0x351d, 0x0126, 0x2091,
-	0x8000, 0x6138, 0x623c, 0x6340, 0x012e, 0x0804, 0x351d, 0x080c,
-	0x4ad8, 0x0904, 0x3552, 0xba44, 0xbb38, 0x0804, 0x351d, 0x080c,
-	0x0dd5, 0x080c, 0x4ad8, 0x2110, 0x0904, 0x3552, 0xb804, 0x908c,
-	0x00ff, 0x918e, 0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600,
-	0x2009, 0x0009, 0x1904, 0x354f, 0x0126, 0x2091, 0x8000, 0x2019,
-	0x0005, 0x00c6, 0x9066, 0x080c, 0xa7ee, 0x080c, 0x9262, 0x0076,
-	0x903e, 0x080c, 0x913f, 0x900e, 0x080c, 0xe2ca, 0x007e, 0x00ce,
-	0xb807, 0x0407, 0x012e, 0x0804, 0x351d, 0x614c, 0x6250, 0x7884,
-	0x604e, 0x7b88, 0x6352, 0x2069, 0x1847, 0x831f, 0x9305, 0x6816,
-	0x788c, 0x2069, 0x1986, 0x2d1c, 0x206a, 0x7e98, 0x9682, 0x0014,
-	0x1210, 0x2031, 0x07d0, 0x2069, 0x1987, 0x2d04, 0x266a, 0x789a,
-	0x0804, 0x351d, 0x0126, 0x2091, 0x8000, 0x7884, 0x603a, 0xd0c4,
-	0x01a8, 0x00d6, 0x78a8, 0x2009, 0x199d, 0x200a, 0x78ac, 0x2011,
-	0x199e, 0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118,
-	0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7884, 0xd0b4,
-	0x0120, 0x3b00, 0x9084, 0xff3f, 0x20d8, 0x7888, 0x603e, 0x2011,
-	0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080, 0x0010,
-	0x918c, 0xff7f, 0x2112, 0x788c, 0x6042, 0x9084, 0x0020, 0x0130,
-	0x78b4, 0x6046, 0x9084, 0x0001, 0x090c, 0x4207, 0x6040, 0xd0cc,
-	0x0120, 0x78b0, 0x2011, 0x0114, 0x2012, 0x012e, 0x0804, 0x351d,
-	0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215,
-	0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214, 0x7838, 0x9084, 0x0140,
-	0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0000, 0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8, 0x7888, 0x9025,
-	0x0904, 0x3552, 0x788c, 0x902d, 0x0904, 0x3552, 0x900e, 0x080c,
-	0x6600, 0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff,
-	0x0190, 0x8108, 0x0ca0, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x7888,
-	0x900d, 0x0904, 0x3552, 0x788c, 0x9005, 0x0904, 0x3552, 0xba44,
-	0xb946, 0xbb38, 0xb83a, 0x0804, 0x351d, 0x2011, 0xbc09, 0x0010,
-	0x2011, 0xbc05, 0x080c, 0x56e4, 0x1904, 0x354f, 0x00c6, 0x2061,
-	0x0100, 0x7984, 0x9186, 0x00ff, 0x1130, 0x2001, 0x1818, 0x2004,
-	0x9085, 0xff00, 0x0088, 0x9182, 0x007f, 0x16e0, 0x9188, 0x331e,
-	0x210d, 0x918c, 0x00ff, 0x2001, 0x1818, 0x2004, 0x0026, 0x9116,
-	0x002e, 0x0580, 0x810f, 0x9105, 0x0126, 0x2091, 0x8000, 0x0006,
-	0x080c, 0xadf1, 0x000e, 0x0510, 0x602e, 0x620a, 0x7984, 0x00b6,
-	0x080c, 0x65a5, 0x2b08, 0x00be, 0x1500, 0x6112, 0x6023, 0x0001,
-	0x080c, 0x4aa5, 0x01d0, 0x9006, 0xa866, 0x7007, 0x0003, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x701f, 0x39f8, 0x2900, 0x6016, 0x2009,
-	0x0032, 0x080c, 0xaec2, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce,
-	0x0804, 0x354f, 0x00ce, 0x0804, 0x3552, 0x080c, 0xae47, 0x0cb0,
-	0xa830, 0x9086, 0x0100, 0x0904, 0x354f, 0x0804, 0x351d, 0x2061,
-	0x1a71, 0x0126, 0x2091, 0x8000, 0x6000, 0xd084, 0x0170, 0x6104,
-	0x6208, 0x2061, 0x1800, 0x6354, 0x6074, 0x789a, 0x60c0, 0x789e,
-	0x60bc, 0x78aa, 0x012e, 0x0804, 0x351d, 0x900e, 0x2110, 0x0c88,
-	0x81ff, 0x1904, 0x354f, 0x080c, 0x73b0, 0x0904, 0x354f, 0x0126,
-	0x2091, 0x8000, 0x6254, 0x6074, 0x9202, 0x0248, 0x9085, 0x0001,
-	0x080c, 0x28a7, 0x080c, 0x58fe, 0x012e, 0x0804, 0x351d, 0x012e,
-	0x0804, 0x3552, 0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a9,
-	0x2070, 0x2061, 0x1847, 0x6008, 0x2072, 0x900e, 0x2011, 0x1400,
-	0x080c, 0x8f3f, 0x7206, 0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b,
-	0x0804, 0x351f, 0x7884, 0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004,
-	0x9082, 0x00e1, 0x0288, 0x012e, 0x0804, 0x3552, 0x2001, 0x002a,
-	0x2004, 0x2069, 0x1847, 0x6908, 0x9102, 0x1230, 0x012e, 0x0804,
-	0x3552, 0x012e, 0x0804, 0x354f, 0x080c, 0xadb1, 0x0dd0, 0x7884,
-	0xd0fc, 0x0904, 0x3ac3, 0x00c6, 0x080c, 0x4aa5, 0x00ce, 0x0d88,
-	0xa867, 0x0000, 0x7884, 0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812,
-	0x2001, 0x002e, 0x2004, 0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e,
-	0x2001, 0x0030, 0x2004, 0xa822, 0x2001, 0x0031, 0x2004, 0xa826,
-	0x2001, 0x0034, 0x2004, 0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e,
-	0x2001, 0x002a, 0x2004, 0x9080, 0x0003, 0x9084, 0x00fc, 0x8004,
-	0xa816, 0x080c, 0x3c49, 0x0928, 0x7014, 0x2048, 0xad2c, 0xac28,
-	0xab1c, 0xaa18, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000,
-	0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x001b, 0x080c, 0x4aee, 0x701f, 0x3b86, 0x7023,
-	0x0001, 0x012e, 0x0005, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a32, 0x2001, 0x199f,
-	0x2003, 0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016,
-	0x60bb, 0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3cb8,
-	0x080c, 0x3c77, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a66,
-	0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140,
-	0x2001, 0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a,
-	0x00de, 0x2011, 0x0001, 0x080c, 0x404b, 0x008e, 0x00ee, 0x00fe,
-	0x080c, 0x3f78, 0x080c, 0x3e7d, 0x05b8, 0x2001, 0x020b, 0x2004,
-	0x9084, 0x0140, 0x1db8, 0x080c, 0x40bf, 0x00f6, 0x2079, 0x0300,
-	0x78bc, 0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037,
-	0x0000, 0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037,
-	0x0001, 0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037,
-	0x0000, 0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001,
-	0x1820, 0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024,
-	0x9084, 0x1e00, 0x00ce, 0x0138, 0x080c, 0x3e87, 0x080c, 0x3c72,
-	0x0058, 0x080c, 0x3c72, 0x080c, 0x3fe3, 0x080c, 0x3f6e, 0x2001,
-	0x020b, 0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004,
-	0x2061, 0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d,
-	0x2013, 0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012,
-	0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x12ed,
-	0x2009, 0x0028, 0x080c, 0x23d2, 0x2001, 0x0227, 0x200c, 0x2102,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
-	0x004e, 0x2001, 0x199f, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804,
-	0x351d, 0x012e, 0x2021, 0x400c, 0x0804, 0x351f, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156,
-	0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005,
-	0x0904, 0x3be2, 0x2048, 0x1f04, 0x3b96, 0x7068, 0x2040, 0xa28c,
-	0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029,
-	0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e,
-	0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x4aee, 0x701f, 0x3b86,
-	0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006,
-	0x080c, 0x0f7c, 0x000e, 0x080c, 0x4af1, 0x701f, 0x3b86, 0x015e,
-	0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118,
-	0x701f, 0x3c47, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
-	0x2009, 0x007f, 0x080c, 0x659f, 0x0110, 0x9006, 0x0030, 0xb813,
-	0x00ff, 0xb817, 0xfffd, 0x080c, 0xcfdf, 0x015e, 0x00de, 0x009e,
-	0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904,
-	0x354f, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086,
-	0x0096, 0x00d6, 0x0156, 0x701f, 0x3c19, 0x7007, 0x0003, 0x0804,
-	0x3bd7, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x351f,
-	0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4,
-	0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0,
-	0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f7c, 0x000e, 0x080c,
-	0x4af1, 0x007e, 0x701f, 0x3b86, 0x7023, 0x0001, 0x0005, 0x0804,
-	0x351d, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833,
-	0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c,
-	0x4aa5, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100,
-	0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005,
-	0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe,
-	0x000e, 0x0005, 0x2001, 0x199f, 0x2003, 0x0001, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19aa, 0x2004, 0x601a,
-	0x2061, 0x0100, 0x2001, 0x19a9, 0x2004, 0x60ce, 0x6104, 0xc1ac,
-	0x6106, 0x080c, 0x4aa5, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900,
-	0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004,
-	0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004,
-	0x6036, 0x2009, 0x0040, 0x080c, 0x23d2, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000,
-	0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x00e6, 0x080c, 0x4aa5, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
-	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031,
-	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
-	0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300,
-	0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004,
-	0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x81ff, 0x0148, 0x080c, 0x2c30, 0x1130, 0x9006, 0x080c,
-	0x2b88, 0x9006, 0x080c, 0x2b6b, 0x7884, 0x9084, 0x0007, 0x0002,
-	0x3d03, 0x3d0c, 0x3d15, 0x3d00, 0x3d00, 0x3d00, 0x3d00, 0x3d00,
-	0x012e, 0x0804, 0x3552, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800,
-	0x200a, 0x080c, 0x3ed1, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085,
-	0x4000, 0x200a, 0x080c, 0x3ed1, 0x0078, 0x080c, 0x73b0, 0x1128,
-	0x012e, 0x2009, 0x0016, 0x0804, 0x354f, 0x81ff, 0x0128, 0x012e,
-	0x2021, 0x400b, 0x0804, 0x351f, 0x0086, 0x0096, 0x00a6, 0x00b6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a32, 0x2009, 0x0101,
-	0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058,
-	0x080c, 0x419a, 0x080c, 0x40ea, 0x903e, 0x2720, 0x00f6, 0x00e6,
-	0x0086, 0x2940, 0x2071, 0x1a66, 0x2079, 0x0090, 0x00d6, 0x2069,
-	0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a,
-	0x00de, 0x2011, 0x0001, 0x080c, 0x404b, 0x080c, 0x2c38, 0x080c,
-	0x2c38, 0x080c, 0x2c38, 0x080c, 0x2c38, 0x080c, 0x404b, 0x008e,
-	0x00ee, 0x00fe, 0x080c, 0x3f78, 0x2009, 0x9c40, 0x8109, 0x11b0,
-	0x080c, 0x3e87, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102,
-	0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
-	0x008e, 0x2009, 0x0017, 0x080c, 0x354f, 0x0cf8, 0x2001, 0x020b,
-	0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884,
-	0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0150,
-	0x080c, 0x3f56, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c, 0x3e87,
-	0x0804, 0x3e34, 0x080c, 0x40bf, 0x080c, 0x3fe3, 0x080c, 0x3f39,
-	0x080c, 0x3f6e, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130,
-	0x8b58, 0x080c, 0x3e87, 0x00fe, 0x0804, 0x3e34, 0x00fe, 0x080c,
-	0x3e7d, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001, 0x0033,
-	0x2502, 0x080c, 0x3e87, 0x0080, 0x87ff, 0x0138, 0x2001, 0x0201,
-	0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a62, 0x2004,
-	0x9086, 0x0000, 0x1904, 0x3d84, 0x2001, 0x032f, 0x2003, 0x00f6,
-	0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3e34, 0x7884,
-	0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3e34, 0xa013,
-	0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148,
-	0x2001, 0x1a62, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009,
-	0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016, 0x2800,
-	0xa05a, 0x2009, 0x0040, 0x080c, 0x23d2, 0x2900, 0xa85a, 0xa813,
-	0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9,
-	0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203, 0x2004,
-	0x1f04, 0x3e0b, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0, 0x9005,
-	0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0090,
-	0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a,
-	0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca,
-	0x00ce, 0x00fe, 0x0804, 0x3d3e, 0x001e, 0x00c6, 0x2001, 0x032a,
-	0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106, 0x2011,
-	0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd,
-	0x2102, 0x080c, 0x12ed, 0x7884, 0x9084, 0x0003, 0x9086, 0x0002,
-	0x01a0, 0x2009, 0x0028, 0x080c, 0x23d2, 0x2001, 0x0227, 0x200c,
-	0x2102, 0x6050, 0x9084, 0xb7ef, 0x6052, 0x602f, 0x0000, 0x604b,
-	0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010, 0x00ce, 0x2d08, 0x2c10,
-	0x2b18, 0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x351d,
-	0x012e, 0x2021, 0x400c, 0x0804, 0x351f, 0x9085, 0x0001, 0x1d04,
-	0x3e86, 0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001,
-	0x1a62, 0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x23d2,
-	0x2001, 0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000,
-	0x9026, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a66, 0x7000, 0x9086,
-	0x0000, 0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009,
-	0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x23d2,
-	0x782c, 0xd0fc, 0x0d88, 0x080c, 0x40bf, 0x7000, 0x9086, 0x0000,
-	0x1d58, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040,
-	0x080c, 0x23d2, 0x782b, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe,
-	0x0005, 0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932,
-	0x7936, 0x080c, 0x2887, 0x7850, 0x9084, 0xfbff, 0x9085, 0x0030,
-	0x7852, 0x2019, 0x01f4, 0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085,
-	0x2000, 0x7852, 0x20a9, 0x0046, 0x1d04, 0x3eec, 0x2091, 0x6000,
-	0x1f04, 0x3eec, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfff, 0x7852,
-	0x2001, 0x0021, 0x2004, 0x9084, 0x0003, 0x9086, 0x0001, 0x1120,
-	0x7850, 0x9084, 0xdfff, 0x7852, 0x784b, 0xf7f7, 0x7843, 0x0090,
-	0x7843, 0x0010, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x3f0c, 0x7850,
-	0x9085, 0x1400, 0x7852, 0x2019, 0x61a8, 0x7854, 0xa001, 0xa001,
-	0xd08c, 0x1110, 0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850, 0x9085,
-	0x0400, 0x7852, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001,
-	0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2cef, 0x7827, 0x0020,
-	0x7843, 0x0000, 0x9006, 0x080c, 0x2cef, 0x7827, 0x0048, 0x00fe,
-	0x0005, 0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a62,
-	0x2079, 0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000,
-	0x9086, 0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003,
-	0x0003, 0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079,
-	0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032,
-	0x260a, 0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac,
-	0x0108, 0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079,
-	0x0200, 0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005,
-	0x00e6, 0x2071, 0x0100, 0x2001, 0x19aa, 0x2004, 0x70e2, 0x080c,
-	0x3c68, 0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c,
-	0x918c, 0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162,
-	0x7073, 0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009,
-	0x1818, 0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b,
-	0x0000, 0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100,
-	0x707a, 0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a,
-	0x708e, 0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014,
-	0x9084, 0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x40bf, 0x00f6,
-	0x2071, 0x1a62, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884,
-	0xd0b4, 0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009,
-	0x03e8, 0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004,
-	0x2011, 0x0011, 0x080c, 0x404b, 0x2011, 0x0001, 0x080c, 0x404b,
-	0x00fe, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a62, 0x2079,
-	0x0320, 0x792c, 0xd1fc, 0x0904, 0x4048, 0x782b, 0x0002, 0x9026,
-	0xd19c, 0x1904, 0x4044, 0x7000, 0x0002, 0x4048, 0x3ff9, 0x4029,
-	0x4044, 0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011,
-	0x0001, 0x080c, 0x404b, 0x0904, 0x4048, 0x080c, 0x404b, 0x0804,
-	0x4048, 0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810,
-	0x7914, 0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c,
-	0x81ff, 0x0de8, 0x080c, 0x3f56, 0x2009, 0x0001, 0x00f6, 0x2079,
-	0x0300, 0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a,
-	0x00f8, 0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc,
-	0x1904, 0x3fed, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092,
-	0x0004, 0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031,
-	0xa212, 0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000,
-	0x00ee, 0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036,
-	0x0096, 0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a,
-	0x831c, 0x831c, 0x938a, 0x0007, 0x1a0c, 0x0dd5, 0x9398, 0x4079,
-	0x231d, 0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102,
-	0x009e, 0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048,
-	0xa804, 0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001,
-	0x0005, 0x40b6, 0x40ad, 0x40a4, 0x409b, 0x4092, 0x4089, 0x4080,
-	0xa964, 0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916,
-	0x0005, 0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980,
-	0x7916, 0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912,
-	0xa990, 0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c,
-	0x7912, 0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906,
-	0xa9ac, 0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8,
-	0x7906, 0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902,
-	0xa9c8, 0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6,
-	0x00e6, 0x0086, 0x2071, 0x1a66, 0x2079, 0x0090, 0x792c, 0xd1fc,
-	0x01e8, 0x782b, 0x0002, 0x2940, 0x9026, 0x7000, 0x0002, 0x40e6,
-	0x40d2, 0x40dd, 0x8001, 0x7002, 0xd19c, 0x1180, 0x2011, 0x0001,
-	0x080c, 0x404b, 0x190c, 0x404b, 0x0048, 0x8001, 0x7002, 0x782c,
-	0xd0fc, 0x1d38, 0x2011, 0x0001, 0x080c, 0x404b, 0x008e, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200,
-	0x2001, 0x19aa, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9,
-	0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004,
-	0x9005, 0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f,
-	0x201c, 0x080c, 0x4aa5, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a,
-	0x978a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708,
-	0x903e, 0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e,
-	0x080c, 0x4162, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa5,
-	0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e,
-	0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x189e, 0x7003,
+	0x0002, 0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042,
+	0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001, 0x080c,
+	0x1018, 0x090c, 0x0dd5, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab,
+	0xdcb0, 0x080c, 0x1018, 0x090c, 0x0dd5, 0x2900, 0x706e, 0xa867,
+	0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004, 0x0002,
+	0x3454, 0x3455, 0x3468, 0x347c, 0x0005, 0x1004, 0x3465, 0x0e04,
+	0x3465, 0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005,
+	0x1128, 0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8,
+	0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e, 0x0100,
+	0x0128, 0x9086, 0x0200, 0x0904, 0x3550, 0x0005, 0x7018, 0x2048,
+	0x2061, 0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094,
+	0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005,
+	0x9086, 0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800,
+	0x701c, 0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210,
+	0x61d0, 0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x354d, 0x61d0,
+	0x0804, 0x34e2, 0x3524, 0x355c, 0x3566, 0x356a, 0x3574, 0x357a,
+	0x357e, 0x358e, 0x3591, 0x359b, 0x35a0, 0x35a5, 0x35b0, 0x35bb,
+	0x35ca, 0x35d9, 0x35e7, 0x35fe, 0x3619, 0x354d, 0x36c2, 0x3700,
+	0x37a6, 0x37b7, 0x37da, 0x354d, 0x354d, 0x354d, 0x3812, 0x382e,
+	0x3837, 0x3866, 0x386c, 0x354d, 0x38b2, 0x354d, 0x354d, 0x354d,
+	0x354d, 0x354d, 0x38bd, 0x38c6, 0x38ce, 0x38d0, 0x354d, 0x354d,
+	0x354d, 0x354d, 0x354d, 0x354d, 0x38fc, 0x354d, 0x354d, 0x354d,
+	0x354d, 0x354d, 0x3919, 0x397a, 0x354d, 0x354d, 0x354d, 0x354d,
+	0x354d, 0x354d, 0x0002, 0x39a4, 0x39a7, 0x3a06, 0x3a1f, 0x3a4f,
+	0x3ced, 0x354d, 0x52a8, 0x354d, 0x354d, 0x354d, 0x354d, 0x354d,
+	0x354d, 0x354d, 0x354d, 0x359b, 0x35a0, 0x420e, 0x56f3, 0x422c,
+	0x5337, 0x5388, 0x548b, 0x354d, 0x54ed, 0x5529, 0x555a, 0x565e,
+	0x5587, 0x55de, 0x354d, 0x4230, 0x43f1, 0x4407, 0x442c, 0x4491,
+	0x4505, 0x4525, 0x459c, 0x45f8, 0x4654, 0x4657, 0x467c, 0x4719,
+	0x477f, 0x4787, 0x48b9, 0x4a2e, 0x4a62, 0x4cc6, 0x354d, 0x4ce4,
+	0x4d90, 0x4e72, 0x4ecc, 0x354d, 0x4f81, 0x354d, 0x4fe7, 0x5002,
+	0x4787, 0x5248, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x4ae0,
+	0x0126, 0x2091, 0x8000, 0x0e04, 0x352e, 0x0010, 0x012e, 0x0cc0,
+	0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833,
+	0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007, 0x0001, 0x2091,
+	0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0,
+	0x2021, 0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005,
+	0x0868, 0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520,
+	0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x4aed, 0x7883, 0x0004,
+	0x7884, 0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c,
+	0x7884, 0x7990, 0x0804, 0x4af0, 0x7984, 0x7888, 0x2114, 0x200a,
+	0x0804, 0x3524, 0x7984, 0x2114, 0x0804, 0x3524, 0x20e1, 0x0000,
+	0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f,
+	0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3524, 0x7884, 0x2060,
+	0x04d8, 0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001c, 0x789b,
+	0x0137, 0x0804, 0x3524, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800,
+	0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x3559, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3560,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3559, 0x2138, 0x7d98,
+	0x7c9c, 0x0804, 0x356e, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
+	0x3559, 0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004,
+	0x0804, 0x3524, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200,
+	0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3524, 0x0804,
+	0x3553, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3559, 0x21e0,
+	0x20a9, 0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3524, 0x2069,
+	0x1847, 0x7884, 0x7990, 0x911a, 0x1a04, 0x3559, 0x8019, 0x0904,
+	0x3559, 0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006,
+	0x685a, 0x685e, 0x080c, 0x76d5, 0x0804, 0x3524, 0x2069, 0x1847,
+	0x7884, 0x7994, 0x911a, 0x1a04, 0x3559, 0x8019, 0x0904, 0x3559,
+	0x684e, 0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a,
+	0x686e, 0x0126, 0x2091, 0x8000, 0x080c, 0x69dc, 0x012e, 0x0804,
+	0x3524, 0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3556, 0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001,
+	0x20a1, 0x18a6, 0x4101, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3556, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60,
+	0x080c, 0x4aed, 0x701f, 0x363d, 0x0005, 0xa864, 0x2008, 0x9084,
+	0x00ff, 0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096,
+	0x0015, 0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904,
+	0x3556, 0x810f, 0x918c, 0x00ff, 0x0904, 0x3556, 0x7112, 0x7010,
+	0x8001, 0x0560, 0x7012, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3556, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000,
+	0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4aed,
+	0x701f, 0x367b, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002,
+	0x0120, 0x9096, 0x000a, 0x1904, 0x3556, 0x0888, 0x7014, 0x2048,
+	0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029,
+	0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x618b, 0x0150, 0x0126, 0x2091,
+	0x8000, 0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x64b4, 0x1128,
+	0x7007, 0x0003, 0x701f, 0x36a7, 0x0005, 0x080c, 0x6ec0, 0x0126,
+	0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6,
+	0x400a, 0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
+	0x0000, 0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60,
+	0x0804, 0x4af0, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010,
+	0x7883, 0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020,
+	0x2009, 0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100,
+	0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009,
+	0x04fd, 0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x0180, 0x2001, 0x1a19, 0x2004, 0x9005,
+	0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a,
+	0x2003, 0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427,
+	0x81ff, 0x1904, 0x3556, 0x7984, 0x080c, 0x65ff, 0x1904, 0x3559,
+	0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x3559, 0x7c88,
+	0x7d8c, 0x080c, 0x6762, 0x080c, 0x6731, 0x0000, 0x1518, 0x2061,
+	0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148,
+	0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
+	0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1a04, 0x3556, 0x0c30, 0x080c, 0xc768, 0x012e, 0x0904, 0x3556,
+	0x0804, 0x3524, 0x900e, 0x2001, 0x0005, 0x080c, 0x6ec0, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xce2a, 0x080c, 0x6c81, 0x012e, 0x0804,
+	0x3524, 0x00a6, 0x2950, 0xb198, 0x080c, 0x65ff, 0x1904, 0x3793,
+	0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0,
+	0x080c, 0x6762, 0x080c, 0x6731, 0x1520, 0x2061, 0x1cd0, 0x0126,
+	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
+	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e,
+	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x2009, 0x000d,
+	0x12b0, 0x0c28, 0x080c, 0xc768, 0x012e, 0x2009, 0x0003, 0x0178,
+	0x00e0, 0x900e, 0x2001, 0x0005, 0x080c, 0x6ec0, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xce2a, 0x080c, 0x6c75, 0x012e, 0x0070, 0xb097,
+	0x4005, 0xb19a, 0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006,
+	0x918d, 0x0001, 0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904,
+	0x3556, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x66c6, 0x0904,
+	0x3556, 0x080c, 0x6768, 0x0904, 0x3556, 0x0804, 0x451c, 0x81ff,
+	0x1904, 0x3556, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x080c, 0x67f6,
+	0x0904, 0x3556, 0x2019, 0x0005, 0x79a8, 0x080c, 0x6783, 0x0904,
+	0x3556, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3559, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x080c, 0x8501, 0x7984, 0xd184, 0x1904, 0x3524,
+	0x0804, 0x451c, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009,
+	0x0001, 0x0450, 0x2029, 0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8,
+	0x2508, 0x080c, 0x65ff, 0x11d8, 0x080c, 0x67f6, 0x1128, 0x2009,
+	0x0002, 0x62c0, 0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c,
+	0x6783, 0x1118, 0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000,
+	0x1270, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8501, 0x8529,
+	0x1ae0, 0x012e, 0x0804, 0x3524, 0x012e, 0x0804, 0x3556, 0x012e,
+	0x0804, 0x3559, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x66c6,
+	0x0904, 0x3556, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x900e, 0x080c, 0xe2eb,
+	0x007e, 0x00ce, 0x080c, 0x6762, 0x0804, 0x3524, 0x080c, 0x4abb,
+	0x0904, 0x3559, 0x080c, 0x6762, 0x2208, 0x0804, 0x3524, 0x0156,
+	0x00d6, 0x00e6, 0x2069, 0x1910, 0x6810, 0x6914, 0x910a, 0x1208,
+	0x900e, 0x6816, 0x9016, 0x901e, 0x20a9, 0x007e, 0x2069, 0x1000,
+	0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059, 0x9210, 0x8d68, 0x1f04,
+	0x3848, 0x2300, 0x9218, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3524,
+	0x00f6, 0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff,
+	0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910,
+	0x6910, 0x62bc, 0x0804, 0x3524, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3556, 0x0126, 0x2091, 0x8000, 0x080c, 0x56e3, 0x0128,
+	0x2009, 0x0007, 0x012e, 0x0804, 0x3556, 0x012e, 0x615c, 0x9190,
+	0x3325, 0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280,
+	0x67dc, 0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001,
+	0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003,
+	0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002,
+	0x0068, 0x080c, 0x73bc, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c,
+	0x0120, 0x2009, 0x0005, 0x0804, 0x3556, 0x9036, 0x7e9a, 0x7f9e,
+	0x0804, 0x3524, 0x614c, 0x6250, 0x2019, 0x1986, 0x231c, 0x2001,
+	0x1987, 0x2004, 0x789a, 0x0804, 0x3524, 0x0126, 0x2091, 0x8000,
+	0x6138, 0x623c, 0x6340, 0x012e, 0x0804, 0x3524, 0x080c, 0x4ad7,
+	0x0904, 0x3559, 0xba44, 0xbb38, 0x0804, 0x3524, 0x080c, 0x0dd5,
+	0x080c, 0x4ad7, 0x2110, 0x0904, 0x3559, 0xb804, 0x908c, 0x00ff,
+	0x918e, 0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009,
+	0x0009, 0x1904, 0x3556, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005,
+	0x00c6, 0x9066, 0x080c, 0xa808, 0x080c, 0x928b, 0x0076, 0x903e,
+	0x080c, 0x9168, 0x900e, 0x080c, 0xe2eb, 0x007e, 0x00ce, 0xb807,
+	0x0407, 0x012e, 0x0804, 0x3524, 0x614c, 0x6250, 0x7884, 0x604e,
+	0x7b88, 0x6352, 0x2069, 0x1847, 0x831f, 0x9305, 0x6816, 0x788c,
+	0x2069, 0x1986, 0x2d1c, 0x206a, 0x7e98, 0x9682, 0x0014, 0x1210,
+	0x2031, 0x07d0, 0x2069, 0x1987, 0x2d04, 0x266a, 0x789a, 0x0804,
+	0x3524, 0x0126, 0x2091, 0x8000, 0x7884, 0x603a, 0xd0c4, 0x01a8,
+	0x00d6, 0x78a8, 0x2009, 0x199d, 0x200a, 0x78ac, 0x2011, 0x199e,
+	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
+	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7884, 0xd0b4, 0x0120,
+	0x3b00, 0x9084, 0xff3f, 0x20d8, 0x7888, 0x603e, 0x2011, 0x0114,
+	0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080, 0x0010, 0x918c,
+	0xff7f, 0x2112, 0x788c, 0x6042, 0x9084, 0x0020, 0x0130, 0x78b4,
+	0x6046, 0x9084, 0x0001, 0x090c, 0x420e, 0x6040, 0xd0cc, 0x0120,
+	0x78b0, 0x2011, 0x0114, 0x2012, 0x012e, 0x0804, 0x3524, 0x00f6,
+	0x2079, 0x1800, 0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c,
+	0x9084, 0xfebf, 0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215,
+	0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904,
+	0x3559, 0x788c, 0x902d, 0x0904, 0x3559, 0x900e, 0x080c, 0x65ff,
+	0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190,
+	0x8108, 0x0ca0, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x7888, 0x900d,
+	0x0904, 0x3559, 0x788c, 0x9005, 0x0904, 0x3559, 0xba44, 0xb946,
+	0xbb38, 0xb83a, 0x0804, 0x3524, 0x2011, 0xbc09, 0x0010, 0x2011,
+	0xbc05, 0x080c, 0x56e3, 0x1904, 0x3556, 0x00c6, 0x2061, 0x0100,
+	0x7984, 0x9186, 0x00ff, 0x1130, 0x2001, 0x1818, 0x2004, 0x9085,
+	0xff00, 0x0088, 0x9182, 0x007f, 0x16e0, 0x9188, 0x3325, 0x210d,
+	0x918c, 0x00ff, 0x2001, 0x1818, 0x2004, 0x0026, 0x9116, 0x002e,
+	0x0580, 0x810f, 0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c,
+	0xae0b, 0x000e, 0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c,
+	0x65a4, 0x2b08, 0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c,
+	0x4aa4, 0x01d0, 0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868,
+	0xc0fd, 0xa86a, 0x701f, 0x39ff, 0x2900, 0x6016, 0x2009, 0x0032,
+	0x080c, 0xaedc, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804,
+	0x3556, 0x00ce, 0x0804, 0x3559, 0x080c, 0xae61, 0x0cb0, 0xa830,
+	0x9086, 0x0100, 0x0904, 0x3556, 0x0804, 0x3524, 0x2061, 0x1a71,
+	0x0126, 0x2091, 0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208,
+	0x2061, 0x1800, 0x6354, 0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc,
+	0x78aa, 0x012e, 0x0804, 0x3524, 0x900e, 0x2110, 0x0c88, 0x81ff,
+	0x1904, 0x3556, 0x080c, 0x73bc, 0x0904, 0x3556, 0x0126, 0x2091,
+	0x8000, 0x6254, 0x6074, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c,
+	0x28a7, 0x080c, 0x58fd, 0x012e, 0x0804, 0x3524, 0x012e, 0x0804,
+	0x3559, 0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a9, 0x2070,
+	0x2061, 0x1847, 0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c,
+	0x8f68, 0x7206, 0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804,
+	0x3526, 0x7884, 0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082,
+	0x00e1, 0x0288, 0x012e, 0x0804, 0x3559, 0x2001, 0x002a, 0x2004,
+	0x2069, 0x1847, 0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x3559,
+	0x012e, 0x0804, 0x3556, 0x080c, 0xadcb, 0x0dd0, 0x7884, 0xd0fc,
+	0x0904, 0x3aca, 0x00c6, 0x080c, 0x4aa4, 0x00ce, 0x0d88, 0xa867,
+	0x0000, 0x7884, 0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001,
+	0x002e, 0x2004, 0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001,
+	0x0030, 0x2004, 0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001,
+	0x0034, 0x2004, 0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001,
+	0x002a, 0x2004, 0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816,
+	0x080c, 0x3c50, 0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c,
+	0xaa18, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
+	0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x001b, 0x080c, 0x4aed, 0x701f, 0x3b8d, 0x7023, 0x0001,
+	0x012e, 0x0005, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a39, 0x2001, 0x199f, 0x2003,
+	0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb,
+	0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3cbf, 0x080c,
+	0x3c7e, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a66, 0x2079,
+	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001,
+	0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de,
+	0x2011, 0x0001, 0x080c, 0x4052, 0x008e, 0x00ee, 0x00fe, 0x080c,
+	0x3f7f, 0x080c, 0x3e84, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084,
+	0x0140, 0x1db8, 0x080c, 0x40c6, 0x00f6, 0x2079, 0x0300, 0x78bc,
+	0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000,
+	0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001,
+	0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000,
+	0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x1820,
+	0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084,
+	0x1e00, 0x00ce, 0x0138, 0x080c, 0x3e8e, 0x080c, 0x3c79, 0x0058,
+	0x080c, 0x3c79, 0x080c, 0x3fea, 0x080c, 0x3f75, 0x2001, 0x020b,
+	0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061,
+	0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013,
+	0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001,
+	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x12ed, 0x2009,
+	0x0028, 0x080c, 0x23d2, 0x2001, 0x0227, 0x200c, 0x2102, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e,
+	0x2001, 0x199f, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x3524,
+	0x012e, 0x2021, 0x400c, 0x0804, 0x3526, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014,
+	0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904,
+	0x3be9, 0x2048, 0x1f04, 0x3b9d, 0x7068, 0x2040, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000,
+	0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086,
+	0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x080c, 0x4aed, 0x701f, 0x3b8d, 0x00b0,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c,
+	0x0f7c, 0x000e, 0x080c, 0x4af0, 0x701f, 0x3b8d, 0x015e, 0x00de,
+	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f,
+	0x3c4e, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009,
+	0x007f, 0x080c, 0x659e, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff,
+	0xb817, 0xfffd, 0x080c, 0xcff9, 0x015e, 0x00de, 0x009e, 0x008e,
+	0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x3556,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096,
+	0x00d6, 0x0156, 0x701f, 0x3c20, 0x7007, 0x0003, 0x0804, 0x3bde,
+	0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3526, 0x0076,
+	0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120,
+	0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098,
+	0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f7c, 0x000e, 0x080c, 0x4af0,
+	0x007e, 0x701f, 0x3b8d, 0x7023, 0x0001, 0x0005, 0x0804, 0x3524,
+	0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e,
+	0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4aa4,
+	0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006,
+	0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e,
+	0x0005, 0x2001, 0x199f, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x2061, 0x0200, 0x2001, 0x19aa, 0x2004, 0x601a, 0x2061,
+	0x0100, 0x2001, 0x19a9, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106,
+	0x080c, 0x4aa4, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a,
+	0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a,
 	0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036,
 	0x2009, 0x0040, 0x080c, 0x23d2, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6,
-	0x000e, 0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee,
-	0x00fe, 0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0,
-	0x20e1, 0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306,
-	0x9006, 0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112,
-	0x702b, 0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b,
-	0x0040, 0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096,
-	0x2940, 0x0086, 0x080c, 0x4aa5, 0x008e, 0xa058, 0x00a6, 0x2050,
-	0x2900, 0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001,
-	0x00ee, 0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528,
-	0x2038, 0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c,
-	0x4aa5, 0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
+	0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca,
+	0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
+	0x080c, 0x4aa4, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800,
+	0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004,
+	0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873,
+	0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003,
+	0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c,
+	0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x81ff, 0x0148, 0x080c, 0x2c30, 0x1130, 0x9006, 0x080c, 0x2b88,
+	0x9006, 0x080c, 0x2b6b, 0x7884, 0x9084, 0x0007, 0x0002, 0x3d0a,
+	0x3d13, 0x3d1c, 0x3d07, 0x3d07, 0x3d07, 0x3d07, 0x3d07, 0x012e,
+	0x0804, 0x3559, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a,
+	0x080c, 0x3ed8, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000,
+	0x200a, 0x080c, 0x3ed8, 0x0078, 0x080c, 0x73bc, 0x1128, 0x012e,
+	0x2009, 0x0016, 0x0804, 0x3556, 0x81ff, 0x0128, 0x012e, 0x2021,
+	0x400b, 0x0804, 0x3526, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a39, 0x2009, 0x0101, 0x210c,
+	0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058, 0x080c,
+	0x41a1, 0x080c, 0x40f1, 0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086,
+	0x2940, 0x2071, 0x1a66, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000,
+	0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de,
+	0x2011, 0x0001, 0x080c, 0x4052, 0x080c, 0x2c38, 0x080c, 0x2c38,
+	0x080c, 0x2c38, 0x080c, 0x2c38, 0x080c, 0x4052, 0x008e, 0x00ee,
+	0x00fe, 0x080c, 0x3f7f, 0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c,
+	0x3e8e, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x001e,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
+	0x2009, 0x0017, 0x080c, 0x3556, 0x0cf8, 0x2001, 0x020b, 0x2004,
+	0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe,
+	0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0150, 0x080c,
+	0x3f5d, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c, 0x3e8e, 0x0804,
+	0x3e3b, 0x080c, 0x40c6, 0x080c, 0x3fea, 0x080c, 0x3f40, 0x080c,
+	0x3f75, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58,
+	0x080c, 0x3e8e, 0x00fe, 0x0804, 0x3e3b, 0x00fe, 0x080c, 0x3e84,
+	0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001, 0x0033, 0x2502,
+	0x080c, 0x3e8e, 0x0080, 0x87ff, 0x0138, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a62, 0x2004, 0x9086,
+	0x0000, 0x1904, 0x3d8b, 0x2001, 0x032f, 0x2003, 0x00f6, 0x8631,
+	0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3e3b, 0x7884, 0xd0bc,
+	0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3e3b, 0xa013, 0x0019,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001,
+	0x1a62, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x0030,
+	0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016, 0x2800, 0xa05a,
+	0x2009, 0x0040, 0x080c, 0x23d2, 0x2900, 0xa85a, 0xa813, 0x0019,
+	0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004,
+	0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04,
+	0x3e12, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0, 0x9005, 0x0108,
+	0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0090, 0x7827,
+	0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006,
+	0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce,
+	0x00fe, 0x0804, 0x3d45, 0x001e, 0x00c6, 0x2001, 0x032a, 0x2003,
+	0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106, 0x2011, 0x020d,
+	0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102,
+	0x080c, 0x12ed, 0x7884, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0,
+	0x2009, 0x0028, 0x080c, 0x23d2, 0x2001, 0x0227, 0x200c, 0x2102,
+	0x6050, 0x9084, 0xb7ef, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18,
+	0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3524, 0x012e,
+	0x2021, 0x400c, 0x0804, 0x3526, 0x9085, 0x0001, 0x1d04, 0x3e8d,
+	0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105,
+	0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a62,
+	0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x23d2, 0x2001,
+	0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026,
+	0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a66, 0x7000, 0x9086, 0x0000,
+	0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x23d2, 0x782c,
+	0xd0fc, 0x0d88, 0x080c, 0x40c6, 0x7000, 0x9086, 0x0000, 0x1d58,
+	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
+	0x23d2, 0x782b, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932, 0x7936,
+	0x080c, 0x2887, 0x7850, 0x9084, 0xfbff, 0x9085, 0x0030, 0x7852,
+	0x2019, 0x01f4, 0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000,
+	0x7852, 0x20a9, 0x0046, 0x1d04, 0x3ef3, 0x2091, 0x6000, 0x1f04,
+	0x3ef3, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfff, 0x7852, 0x2001,
+	0x0021, 0x2004, 0x9084, 0x0003, 0x9086, 0x0001, 0x1120, 0x7850,
+	0x9084, 0xdfff, 0x7852, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x3f13, 0x7850, 0x9085,
+	0x1400, 0x7852, 0x2019, 0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c,
+	0x1110, 0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850, 0x9085, 0x0400,
+	0x7852, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001, 0x8319,
+	0x1de0, 0x2001, 0x0100, 0x080c, 0x2cef, 0x7827, 0x0020, 0x7843,
+	0x0000, 0x9006, 0x080c, 0x2cef, 0x7827, 0x0048, 0x00fe, 0x0005,
+	0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a62, 0x2079,
+	0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086,
+	0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003,
+	0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300,
+	0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a,
+	0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108,
+	0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6,
+	0x2071, 0x0100, 0x2001, 0x19aa, 0x2004, 0x70e2, 0x080c, 0x3c6f,
+	0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c, 0x918c,
+	0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073,
+	0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1818,
+	0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000,
+	0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a,
+	0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e,
+	0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084,
+	0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x40c6, 0x00f6, 0x2071,
+	0x1a62, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
+	0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8,
+	0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011,
+	0x0011, 0x080c, 0x4052, 0x2011, 0x0001, 0x080c, 0x4052, 0x00fe,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a62, 0x2079, 0x0320,
+	0x792c, 0xd1fc, 0x0904, 0x404f, 0x782b, 0x0002, 0x9026, 0xd19c,
+	0x1904, 0x404b, 0x7000, 0x0002, 0x404f, 0x4000, 0x4030, 0x404b,
+	0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001,
+	0x080c, 0x4052, 0x0904, 0x404f, 0x080c, 0x4052, 0x0804, 0x404f,
+	0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914,
+	0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff,
+	0x0de8, 0x080c, 0x3f5d, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300,
+	0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8,
+	0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904,
+	0x3ff4, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004,
+	0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212,
+	0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee,
+	0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096,
+	0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c,
+	0x831c, 0x938a, 0x0007, 0x1a0c, 0x0dd5, 0x9398, 0x4080, 0x231d,
+	0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e,
+	0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804,
+	0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005,
+	0x40bd, 0x40b4, 0x40ab, 0x40a2, 0x4099, 0x4090, 0x4087, 0xa964,
+	0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005,
+	0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916,
+	0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990,
+	0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912,
+	0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac,
+	0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906,
+	0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8,
+	0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6,
+	0x0086, 0x2071, 0x1a66, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8,
+	0x782b, 0x0002, 0x2940, 0x9026, 0x7000, 0x0002, 0x40ed, 0x40d9,
+	0x40e4, 0x8001, 0x7002, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c,
+	0x4052, 0x190c, 0x4052, 0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc,
+	0x1d38, 0x2011, 0x0001, 0x080c, 0x4052, 0x008e, 0x00ee, 0x00fe,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001,
+	0x19aa, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004,
+	0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005,
+	0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c,
+	0x080c, 0x4aa4, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
 	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e,
 	0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c,
-	0x4162, 0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa5, 0x2940,
-	0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030,
-	0x2004, 0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001,
-	0x0101, 0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001,
-	0x1a62, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001,
-	0x0300, 0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001,
-	0x0004, 0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001,
-	0x9006, 0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000,
-	0x9006, 0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086,
-	0x0052, 0x0108, 0x0005, 0x0804, 0x351d, 0x7d98, 0x7c9c, 0x0804,
-	0x3614, 0x080c, 0x56df, 0x1128, 0x3a00, 0x9084, 0x0010, 0x0904,
-	0x3552, 0x080c, 0x73b0, 0x190c, 0x5fe0, 0x6040, 0x9084, 0x0020,
-	0x0971, 0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x4aee, 0x701f, 0x4249,
-	0x0005, 0x080c, 0x56df, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095,
-	0x20d8, 0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x3552,
-	0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x3552, 0xd094, 0x00c6,
-	0x2061, 0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218,
-	0x918c, 0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c,
-	0x00c6, 0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010,
-	0x918c, 0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a,
-	0x007f, 0x1a04, 0x3552, 0x9288, 0x331e, 0x210d, 0x918c, 0x00ff,
-	0x6166, 0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x3552,
-	0x605e, 0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004,
-	0x0006, 0x2009, 0x19b1, 0x9080, 0x297a, 0x2005, 0x200a, 0x000e,
-	0x2009, 0x19b2, 0x9080, 0x297e, 0x2005, 0x200a, 0x6808, 0x908a,
-	0x0100, 0x0a04, 0x3552, 0x908a, 0x0841, 0x1a04, 0x3552, 0x9084,
-	0x0007, 0x1904, 0x3552, 0x680c, 0x9005, 0x0904, 0x3552, 0x6810,
-	0x9005, 0x0904, 0x3552, 0x6848, 0x6940, 0x910a, 0x1a04, 0x3552,
-	0x8001, 0x0904, 0x3552, 0x684c, 0x6944, 0x910a, 0x1a04, 0x3552,
-	0x8001, 0x0904, 0x3552, 0x2009, 0x1981, 0x200b, 0x0000, 0x2001,
-	0x1869, 0x2004, 0xd0c4, 0x0140, 0x7884, 0x200a, 0x2009, 0x017f,
-	0x200a, 0x3b00, 0xc085, 0x20d8, 0x6814, 0x908c, 0x00ff, 0x614e,
-	0x8007, 0x9084, 0x00ff, 0x6052, 0x080c, 0x76c9, 0x080c, 0x69a0,
-	0x080c, 0x69d4, 0x6808, 0x602a, 0x080c, 0x2344, 0x2009, 0x0170,
-	0x200b, 0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08,
-	0x080c, 0x28e1, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x43e0,
-	0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f,
-	0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830,
-	0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010,
-	0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f,
-	0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b3, 0x20e9, 0x0001,
-	0x4001, 0x20a9, 0x0004, 0x20a1, 0x19cd, 0x20e9, 0x0001, 0x4001,
-	0x080c, 0x85c6, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384,
-	0x0510, 0x0068, 0x2009, 0x0100, 0x210c, 0x918e, 0x0008, 0x1110,
-	0x839d, 0x0010, 0x83f5, 0x3e18, 0x12b0, 0x3508, 0x8109, 0x080c,
-	0x7c7f, 0x6878, 0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007,
-	0x600a, 0x9184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003,
-	0x0010, 0x6003, 0x0001, 0x1f04, 0x433a, 0x00ce, 0x00c6, 0x2061,
-	0x199c, 0x6a88, 0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158,
-	0x2063, 0x0000, 0x2001, 0x0001, 0x080c, 0x2b88, 0x2001, 0x0001,
-	0x080c, 0x2b6b, 0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001,
-	0x9006, 0x080c, 0x2b88, 0x9006, 0x080c, 0x2b6b, 0x0028, 0x9286,
-	0x8000, 0x1d30, 0x2063, 0x0002, 0x00ce, 0x6888, 0xd0ec, 0x0130,
-	0x2011, 0x0114, 0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284,
-	0x0030, 0x9086, 0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020,
-	0x6a82, 0x2001, 0x197c, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000,
-	0x0170, 0x928e, 0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003,
-	0xaaaa, 0x080c, 0x2956, 0x2001, 0x196d, 0x2102, 0x0008, 0x2102,
-	0x00c6, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce,
-	0x080c, 0x73b0, 0x0128, 0x080c, 0x4fdc, 0x0110, 0x080c, 0x28a7,
-	0x60d4, 0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x43c8, 0x00e0,
-	0x080c, 0x73b0, 0x1168, 0x2011, 0x7246, 0x080c, 0x84ca, 0x2011,
-	0x7239, 0x080c, 0x85a4, 0x080c, 0x769d, 0x080c, 0x72e2, 0x0040,
-	0x080c, 0x5eda, 0x0028, 0x6003, 0x0004, 0x2009, 0x43e0, 0x0020,
-	0x080c, 0x68d5, 0x0804, 0x351d, 0x2001, 0x0170, 0x2004, 0x9084,
-	0x00ff, 0x9086, 0x004c, 0x1118, 0x2091, 0x30bd, 0x0817, 0x2091,
-	0x303d, 0x0817, 0x6000, 0x9086, 0x0000, 0x0904, 0x354f, 0x2069,
-	0x1847, 0x7890, 0x6842, 0x7894, 0x6846, 0x2d00, 0x2009, 0x0030,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x4af1,
-	0x9006, 0x080c, 0x28a7, 0x81ff, 0x1904, 0x354f, 0x080c, 0x73b0,
-	0x11b0, 0x080c, 0x7698, 0x080c, 0x601b, 0x080c, 0x3312, 0x0118,
-	0x6130, 0xc18d, 0x6132, 0x080c, 0xd216, 0x0130, 0x080c, 0x73d3,
-	0x1118, 0x080c, 0x7388, 0x0038, 0x080c, 0x72e2, 0x0020, 0x080c,
-	0x5fe0, 0x080c, 0x5eda, 0x0804, 0x351d, 0x81ff, 0x1904, 0x354f,
-	0x080c, 0x73b0, 0x1110, 0x0804, 0x354f, 0x6194, 0x81ff, 0x01a8,
-	0x704f, 0x0000, 0x2001, 0x1c80, 0x2009, 0x0040, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000, 0x2039, 0x0001, 0x080c,
-	0x4af1, 0x701f, 0x351b, 0x012e, 0x0005, 0x704f, 0x0001, 0x00d6,
-	0x2069, 0x1c80, 0x20a9, 0x0040, 0x20e9, 0x0001, 0x20a1, 0x1c80,
-	0x2019, 0xffff, 0x4304, 0x655c, 0x9588, 0x331e, 0x210d, 0x918c,
-	0x00ff, 0x216a, 0x900e, 0x2011, 0x0002, 0x2100, 0x9506, 0x01a8,
-	0x080c, 0x6600, 0x1190, 0xb814, 0x821c, 0x0238, 0x9398, 0x1c80,
-	0x9085, 0xff00, 0x8007, 0x201a, 0x0038, 0x9398, 0x1c80, 0x2324,
-	0x94a4, 0xff00, 0x9405, 0x201a, 0x8210, 0x8108, 0x9182, 0x0080,
-	0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de,
-	0x20a9, 0x0040, 0x20a1, 0x1c80, 0x2099, 0x1c80, 0x080c, 0x5f6b,
-	0x0804, 0x443a, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x080c, 0x4aa5,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x354f, 0x080c, 0x56d0, 0xd0b4,
-	0x0558, 0x7884, 0x908e, 0x007e, 0x0538, 0x908e, 0x007f, 0x0520,
-	0x908e, 0x0080, 0x0508, 0x080c, 0x330d, 0x1148, 0xb800, 0xd08c,
-	0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcce4, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x354f, 0x7007, 0x0003, 0x701f, 0x44c8, 0x0005,
-	0x080c, 0x4ad8, 0x0904, 0x3552, 0x20a9, 0x002b, 0xb8c4, 0x20e0,
-	0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
-	0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xb8c4, 0x20e0,
-	0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c, 0x0070, 0x20a9,
-	0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8,
-	0x9080, 0x000a, 0x2098, 0x080c, 0x0f7c, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af1, 0x81ff, 0x1904,
-	0x354f, 0x080c, 0x4abc, 0x0904, 0x3552, 0x080c, 0x6772, 0x0904,
-	0x354f, 0x0058, 0xa878, 0x9005, 0x0120, 0x2009, 0x0004, 0x0804,
-	0x354f, 0xa974, 0xaa94, 0x0804, 0x351d, 0x080c, 0x56d8, 0x0904,
-	0x351d, 0x701f, 0x4512, 0x7007, 0x0003, 0x0005, 0x81ff, 0x1904,
-	0x354f, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3552, 0x080c, 0x4ad8,
-	0x0904, 0x3552, 0x080c, 0x696a, 0x0120, 0x080c, 0x6972, 0x1904,
-	0x3552, 0x080c, 0x67f7, 0x0904, 0x354f, 0x2019, 0x0004, 0x900e,
-	0x080c, 0x6784, 0x0904, 0x354f, 0x7984, 0x7a88, 0x04c9, 0x08a8,
-	0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c, 0x4ad6, 0x01e0, 0x080c,
-	0x696a, 0x0118, 0x080c, 0x6972, 0x11b0, 0x080c, 0x67f7, 0x2009,
-	0x0002, 0x0168, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x6784,
-	0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x080c, 0x56d8, 0x0110,
+	0x4169, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa4, 0xa813,
+	0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004,
+	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061,
+	0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036, 0x2009,
+	0x0040, 0x080c, 0x23d2, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
+	0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1,
+	0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006,
+	0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b,
+	0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040,
+	0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940,
+	0x0086, 0x080c, 0x4aa4, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900,
+	0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee,
+	0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038,
+	0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4aa4,
+	0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
+	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
+	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x4169,
+	0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa4, 0x2940, 0xa013,
+	0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004,
+	0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101,
+	0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a62,
+	0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300,
+	0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004,
+	0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006,
+	0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006,
+	0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052,
+	0x0108, 0x0005, 0x0804, 0x3524, 0x7d98, 0x7c9c, 0x0804, 0x361b,
+	0x080c, 0x73bc, 0x190c, 0x5fdf, 0x6040, 0x9084, 0x0020, 0x09b1,
+	0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0001, 0x080c, 0x4aed, 0x701f, 0x4248, 0x0005,
+	0x080c, 0x56de, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8,
+	0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x3559, 0x6804,
+	0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x3559, 0xd094, 0x00c6, 0x2061,
+	0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c,
+	0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6,
+	0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c,
+	0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f,
+	0x1a04, 0x3559, 0x9288, 0x3325, 0x210d, 0x918c, 0x00ff, 0x6166,
+	0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x3559, 0x605e,
+	0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006,
+	0x2009, 0x19b1, 0x9080, 0x297a, 0x2005, 0x200a, 0x000e, 0x2009,
+	0x19b2, 0x9080, 0x297e, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100,
+	0x0a04, 0x3559, 0x908a, 0x0841, 0x1a04, 0x3559, 0x9084, 0x0007,
+	0x1904, 0x3559, 0x680c, 0x9005, 0x0904, 0x3559, 0x6810, 0x9005,
+	0x0904, 0x3559, 0x6848, 0x6940, 0x910a, 0x1a04, 0x3559, 0x8001,
+	0x0904, 0x3559, 0x684c, 0x6944, 0x910a, 0x1a04, 0x3559, 0x8001,
+	0x0904, 0x3559, 0x2009, 0x1981, 0x200b, 0x0000, 0x2001, 0x1869,
+	0x2004, 0xd0c4, 0x0140, 0x7884, 0x200a, 0x2009, 0x017f, 0x200a,
+	0x3b00, 0xc085, 0x20d8, 0x6814, 0x908c, 0x00ff, 0x614e, 0x8007,
+	0x9084, 0x00ff, 0x6052, 0x080c, 0x76d5, 0x080c, 0x69a8, 0x080c,
+	0x69dc, 0x6808, 0x602a, 0x080c, 0x2344, 0x2009, 0x0170, 0x200b,
+	0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c,
+	0x28e1, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x43df, 0x6818,
+	0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016,
+	0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934,
+	0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084,
+	0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217,
+	0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b3, 0x20e9, 0x0001, 0x4001,
+	0x20a9, 0x0004, 0x20a1, 0x19cd, 0x20e9, 0x0001, 0x4001, 0x080c,
+	0x85ef, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x0510,
+	0x0068, 0x2009, 0x0100, 0x210c, 0x918e, 0x0008, 0x1110, 0x839d,
+	0x0010, 0x83f5, 0x3e18, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7c8b,
+	0x6878, 0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a,
+	0x9184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010,
+	0x6003, 0x0001, 0x1f04, 0x4339, 0x00ce, 0x00c6, 0x2061, 0x199c,
+	0x6a88, 0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063,
+	0x0000, 0x2001, 0x0001, 0x080c, 0x2b88, 0x2001, 0x0001, 0x080c,
+	0x2b6b, 0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006,
+	0x080c, 0x2b88, 0x9006, 0x080c, 0x2b6b, 0x0028, 0x9286, 0x8000,
+	0x1d30, 0x2063, 0x0002, 0x00ce, 0x6888, 0xd0ec, 0x0130, 0x2011,
+	0x0114, 0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284, 0x0030,
+	0x9086, 0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82,
+	0x2001, 0x197c, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170,
+	0x928e, 0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa,
+	0x080c, 0x2956, 0x2001, 0x196d, 0x2102, 0x0008, 0x2102, 0x00c6,
+	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
+	0x73bc, 0x0128, 0x080c, 0x4fdb, 0x0110, 0x080c, 0x28a7, 0x60d4,
+	0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x43c7, 0x00e0, 0x080c,
+	0x73bc, 0x1168, 0x2011, 0x7252, 0x080c, 0x84f3, 0x2011, 0x7245,
+	0x080c, 0x85cd, 0x080c, 0x76a9, 0x080c, 0x72ee, 0x0040, 0x080c,
+	0x5ed9, 0x0028, 0x6003, 0x0004, 0x2009, 0x43df, 0x0020, 0x080c,
+	0x68d4, 0x0804, 0x3524, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff,
+	0x9086, 0x004c, 0x1118, 0x2091, 0x30bd, 0x0817, 0x2091, 0x303d,
+	0x0817, 0x6000, 0x9086, 0x0000, 0x0904, 0x3556, 0x2069, 0x1847,
+	0x7890, 0x6842, 0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x4af0, 0x9006,
+	0x080c, 0x28a7, 0x81ff, 0x1904, 0x3556, 0x080c, 0x73bc, 0x11b0,
+	0x080c, 0x76a4, 0x080c, 0x601a, 0x080c, 0x3319, 0x0118, 0x6130,
+	0xc18d, 0x6132, 0x080c, 0xd230, 0x0130, 0x080c, 0x73df, 0x1118,
+	0x080c, 0x7394, 0x0038, 0x080c, 0x72ee, 0x0020, 0x080c, 0x5fdf,
+	0x080c, 0x5ed9, 0x0804, 0x3524, 0x81ff, 0x1904, 0x3556, 0x080c,
+	0x73bc, 0x1110, 0x0804, 0x3556, 0x6194, 0x81ff, 0x01a8, 0x704f,
+	0x0000, 0x2001, 0x1c80, 0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x0126, 0x2091, 0x8000, 0x2039, 0x0001, 0x080c, 0x4af0,
+	0x701f, 0x3522, 0x012e, 0x0005, 0x704f, 0x0001, 0x00d6, 0x2069,
+	0x1c80, 0x20a9, 0x0040, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019,
+	0xffff, 0x4304, 0x655c, 0x9588, 0x3325, 0x210d, 0x918c, 0x00ff,
+	0x216a, 0x900e, 0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, 0x080c,
+	0x65ff, 0x1190, 0xb814, 0x821c, 0x0238, 0x9398, 0x1c80, 0x9085,
+	0xff00, 0x8007, 0x201a, 0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4,
+	0xff00, 0x9405, 0x201a, 0x8210, 0x8108, 0x9182, 0x0080, 0x1208,
+	0x0c18, 0x8201, 0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9,
+	0x0040, 0x20a1, 0x1c80, 0x2099, 0x1c80, 0x080c, 0x5f6a, 0x0804,
+	0x4439, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x080c, 0x4aa4, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3556, 0x080c, 0x56cf, 0xd0b4, 0x0558,
+	0x7884, 0x908e, 0x007e, 0x0538, 0x908e, 0x007f, 0x0520, 0x908e,
+	0x0080, 0x0508, 0x080c, 0x3314, 0x1148, 0xb800, 0xd08c, 0x11d8,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xccfe, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x44c7, 0x0005, 0x080c,
+	0x4ad7, 0x0904, 0x3559, 0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8,
+	0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
+	0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8,
+	0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c, 0x0070, 0x20a9, 0x0004,
+	0xa85c, 0x9080, 0x000a, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080,
+	0x000a, 0x2098, 0x080c, 0x0f7c, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af0, 0x81ff, 0x1904, 0x3556,
+	0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x6771, 0x0904, 0x3556,
+	0x0058, 0xa878, 0x9005, 0x0120, 0x2009, 0x0004, 0x0804, 0x3556,
+	0xa974, 0xaa94, 0x0804, 0x3524, 0x080c, 0x56d7, 0x0904, 0x3524,
+	0x701f, 0x4511, 0x7007, 0x0003, 0x0005, 0x81ff, 0x1904, 0x3556,
+	0x7888, 0x908a, 0x1000, 0x1a04, 0x3559, 0x080c, 0x4ad7, 0x0904,
+	0x3559, 0x080c, 0x6972, 0x0120, 0x080c, 0x697a, 0x1904, 0x3559,
+	0x080c, 0x67f6, 0x0904, 0x3556, 0x2019, 0x0004, 0x900e, 0x080c,
+	0x6783, 0x0904, 0x3556, 0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c,
+	0x908a, 0x1000, 0x12f8, 0x080c, 0x4ad5, 0x01e0, 0x080c, 0x6972,
+	0x0118, 0x080c, 0x697a, 0x11b0, 0x080c, 0x67f6, 0x2009, 0x0002,
+	0x0168, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x6783, 0x2009,
+	0x0003, 0x0120, 0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005,
+	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0030, 0x0005, 0xa897, 0x4000, 0x080c, 0x56d7, 0x0110, 0x9006,
+	0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x9186,
+	0x00ff, 0x0110, 0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1800,
+	0x645c, 0x2400, 0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8,
+	0x0005, 0x080c, 0x65ff, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x080c, 0x8501, 0x0005, 0x81ff, 0x1904, 0x3556, 0x798c,
+	0x2001, 0x1980, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abb, 0x0904,
+	0x3559, 0x080c, 0x6972, 0x0120, 0x080c, 0x697a, 0x1904, 0x3559,
+	0x080c, 0x66c6, 0x0904, 0x3556, 0x080c, 0x677a, 0x0904, 0x3556,
+	0x2001, 0x1980, 0x2004, 0xd0fc, 0x1904, 0x3524, 0x0804, 0x451c,
+	0xa9a0, 0x2001, 0x1980, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
+	0x4ac8, 0x01a0, 0x080c, 0x6972, 0x0118, 0x080c, 0x697a, 0x1170,
+	0x080c, 0x66c6, 0x2009, 0x0002, 0x0128, 0x080c, 0x677a, 0x1170,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x2001, 0x1980, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56d7, 0x0110,
 	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
-	0x9186, 0x00ff, 0x0110, 0x0071, 0x0060, 0x2029, 0x007e, 0x2061,
-	0x1800, 0x645c, 0x2400, 0x9506, 0x0110, 0x2508, 0x0019, 0x8529,
-	0x1ec8, 0x0005, 0x080c, 0x6600, 0x1138, 0x2200, 0x8003, 0x800b,
-	0x810b, 0x9108, 0x080c, 0x84d8, 0x0005, 0x81ff, 0x1904, 0x354f,
-	0x798c, 0x2001, 0x1980, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abc,
-	0x0904, 0x3552, 0x080c, 0x696a, 0x0120, 0x080c, 0x6972, 0x1904,
-	0x3552, 0x080c, 0x66c7, 0x0904, 0x354f, 0x080c, 0x677b, 0x0904,
-	0x354f, 0x2001, 0x1980, 0x2004, 0xd0fc, 0x1904, 0x351d, 0x0804,
-	0x451d, 0xa9a0, 0x2001, 0x1980, 0x918c, 0x8000, 0xc18d, 0x2102,
-	0x080c, 0x4ac9, 0x01a0, 0x080c, 0x696a, 0x0118, 0x080c, 0x6972,
-	0x1170, 0x080c, 0x66c7, 0x2009, 0x0002, 0x0128, 0x080c, 0x677b,
-	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x2001, 0x1980, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56d8,
-	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
-	0x0005, 0x81ff, 0x1904, 0x354f, 0x798c, 0x2001, 0x197f, 0x918c,
-	0x8000, 0x2102, 0x080c, 0x4abc, 0x0904, 0x3552, 0x080c, 0x696a,
-	0x0120, 0x080c, 0x6972, 0x1904, 0x3552, 0x080c, 0x66c7, 0x0904,
-	0x354f, 0x080c, 0x6769, 0x0904, 0x354f, 0x2001, 0x197f, 0x2004,
-	0xd0fc, 0x1904, 0x351d, 0x0804, 0x451d, 0xa9a0, 0x2001, 0x197f,
-	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4ac9, 0x01a0, 0x080c,
-	0x696a, 0x0118, 0x080c, 0x6972, 0x1170, 0x080c, 0x66c7, 0x2009,
-	0x0002, 0x0128, 0x080c, 0x6769, 0x1170, 0x2009, 0x0003, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x197f, 0x2004,
-	0xd0fc, 0x1128, 0x080c, 0x56d8, 0x0110, 0x9006, 0x0018, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x6100, 0x0804, 0x351d,
-	0x080c, 0x4ad8, 0x0904, 0x3552, 0x080c, 0x56e4, 0x1904, 0x354f,
-	0x79a8, 0xd184, 0x1158, 0xb834, 0x8007, 0x789e, 0xb830, 0x8007,
-	0x789a, 0xbb2c, 0x831f, 0xba28, 0x8217, 0x0050, 0xb824, 0x8007,
-	0x789e, 0xb820, 0x8007, 0x789a, 0xbb1c, 0x831f, 0xba18, 0x8217,
-	0xb900, 0x918c, 0x0200, 0x0804, 0x351d, 0x78a8, 0x909c, 0x0003,
-	0xd0b4, 0x1148, 0x939a, 0x0003, 0x1a04, 0x354f, 0x625c, 0x7884,
-	0x9206, 0x1904, 0x46ca, 0x080c, 0x85b0, 0x2001, 0xfff4, 0x2009,
-	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0000, 0x0006,
-	0x78a8, 0x9084, 0x0080, 0x11c8, 0x0006, 0x0036, 0x2001, 0x1a7f,
-	0x201c, 0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a80, 0x201c, 0x7b9e,
-	0x2003, 0x0000, 0x2001, 0x1a81, 0x201c, 0x7ba2, 0x2003, 0x0000,
-	0x003e, 0x000e, 0x000e, 0x0804, 0x4af1, 0x000e, 0x2031, 0x0000,
-	0x2061, 0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
-	0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f,
-	0x46ea, 0x0005, 0x81ff, 0x1904, 0x354f, 0x080c, 0x4ad8, 0x0904,
-	0x3552, 0x080c, 0x696a, 0x1904, 0x354f, 0x00c6, 0x080c, 0x4aa5,
-	0x00ce, 0x0904, 0x354f, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x7ea8, 0x080c, 0xcc8a, 0x0904, 0x354f, 0x7007, 0x0003, 0x701f,
-	0x4704, 0x0005, 0x080c, 0x4207, 0x0006, 0x0036, 0x2001, 0x1a7f,
-	0x201c, 0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a80, 0x201c, 0x7b9e,
-	0x2003, 0x0000, 0x2001, 0x1a81, 0x201c, 0x7ba2, 0x2003, 0x0000,
-	0x003e, 0x000e, 0x0804, 0x351d, 0xa830, 0x9086, 0x0100, 0x0904,
-	0x354f, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x0804, 0x4af1, 0x9006, 0x080c, 0x28a7, 0x78a8, 0x9084, 0x00ff,
-	0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x354f, 0x080c, 0x73b0,
-	0x0110, 0x080c, 0x5fe0, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3552,
-	0x7984, 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x3552,
-	0x2100, 0x080c, 0x2871, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x2061, 0x19fa, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000,
-	0x6077, 0x0000, 0x080c, 0x73b0, 0x1158, 0x080c, 0x7698, 0x080c,
-	0x601b, 0x9085, 0x0001, 0x080c, 0x73f7, 0x080c, 0x72e2, 0x00d0,
-	0x080c, 0xadb8, 0x2061, 0x0100, 0x2001, 0x1818, 0x2004, 0x9084,
-	0x00ff, 0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x2009, 0x1999, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f06,
-	0x080c, 0x8562, 0x7984, 0x080c, 0x73b0, 0x1110, 0x2009, 0x00ff,
-	0x7a88, 0x080c, 0x4580, 0x012e, 0x00ce, 0x002e, 0x0804, 0x351d,
-	0x7984, 0x080c, 0x659f, 0x2b08, 0x1904, 0x3552, 0x0804, 0x351d,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x354f, 0x60dc, 0xd0ac,
-	0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x354f, 0x080c,
-	0x4aa5, 0x1120, 0x2009, 0x0002, 0x0804, 0x354f, 0x7984, 0x9192,
-	0x0021, 0x1a04, 0x3552, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c,
-	0x9080, 0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x4aee, 0x701f,
-	0x47b8, 0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x518e, 0x0005,
-	0x2009, 0x0080, 0x080c, 0x6600, 0x1118, 0x080c, 0x696a, 0x0120,
-	0x2021, 0x400a, 0x0804, 0x351f, 0x00d6, 0x0096, 0xa964, 0xaa6c,
-	0xab70, 0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904,
-	0x4851, 0x90be, 0x0112, 0x0904, 0x4851, 0x90be, 0x0113, 0x0904,
-	0x4851, 0x90be, 0x0114, 0x0904, 0x4851, 0x90be, 0x0117, 0x0904,
-	0x4851, 0x90be, 0x011a, 0x0904, 0x4851, 0x90be, 0x011c, 0x0904,
-	0x4851, 0x90be, 0x0121, 0x0904, 0x4838, 0x90be, 0x0131, 0x0904,
-	0x4838, 0x90be, 0x0171, 0x0904, 0x4851, 0x90be, 0x0173, 0x0904,
-	0x4851, 0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804,
-	0x485c, 0x90be, 0x0212, 0x0904, 0x4845, 0x90be, 0x0213, 0x05e8,
-	0x90be, 0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a,
-	0x1120, 0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8,
-	0x90be, 0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x3552, 0x7028,
-	0x9080, 0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0007, 0x080c, 0x489a, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0,
-	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x489a, 0x00c8,
-	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
-	0x20a9, 0x0001, 0x080c, 0x48a7, 0x00b8, 0x7028, 0x9080, 0x000e,
-	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c,
-	0x48a7, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0,
-	0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4aa5, 0x0550,
-	0xa868, 0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f,
-	0x0020, 0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba,
-	0xacbe, 0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866,
-	0xa822, 0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xcca5,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x354f, 0x7007, 0x0003, 0x701f,
-	0x4891, 0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804,
-	0x354f, 0xa820, 0x9086, 0x8001, 0x1904, 0x351d, 0x2009, 0x0004,
-	0x0804, 0x354f, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002,
-	0x4104, 0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016,
-	0x0026, 0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304,
-	0x4204, 0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x354f,
-	0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804,
-	0x354f, 0x7984, 0x78a8, 0x2040, 0x080c, 0xadb1, 0x1120, 0x9182,
-	0x007f, 0x0a04, 0x3552, 0x9186, 0x00ff, 0x0904, 0x3552, 0x9182,
-	0x0800, 0x1a04, 0x3552, 0x7a8c, 0x7b88, 0x607c, 0x9306, 0x1140,
-	0x6080, 0x924e, 0x0904, 0x3552, 0x99cc, 0xff00, 0x0904, 0x3552,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x49b8, 0x0904, 0x4938, 0x0086,
-	0x90c6, 0x4000, 0x008e, 0x1538, 0x00c6, 0x0006, 0x0036, 0xb818,
-	0xbb1c, 0x9305, 0xbb20, 0x9305, 0xbb24, 0x9305, 0xbb28, 0x9305,
-	0xbb2c, 0x9305, 0xbb30, 0x9305, 0xbb34, 0x9305, 0x003e, 0x0570,
-	0xd88c, 0x1128, 0x080c, 0x696a, 0x0110, 0xc89d, 0x0438, 0x900e,
-	0x080c, 0x6820, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090,
-	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009,
-	0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005,
-	0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x351f, 0x000e, 0x00ce,
-	0x2b00, 0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c,
-	0xae95, 0x0904, 0x498d, 0x2b00, 0x6012, 0x080c, 0xcf90, 0x2e58,
-	0x00ee, 0x00e6, 0x00c6, 0x080c, 0x4aa5, 0x00ce, 0x2b70, 0x1158,
-	0x080c, 0xae47, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009,
-	0x0002, 0x0804, 0x354f, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016,
-	0xa932, 0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0xd89c,
-	0x1110, 0x080c, 0x31bc, 0x6023, 0x0001, 0x9006, 0x080c, 0x653c,
-	0xd89c, 0x0138, 0x2001, 0x0004, 0x080c, 0x6550, 0x2009, 0x0003,
-	0x0030, 0x2001, 0x0002, 0x080c, 0x6550, 0x2009, 0x0002, 0x080c,
-	0xaec2, 0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024, 0x00e6, 0x2058,
-	0xb8cc, 0xc08d, 0xb8ce, 0x9085, 0x0001, 0x00ee, 0x00ce, 0x00be,
-	0x001e, 0x012e, 0x1120, 0x2009, 0x0003, 0x0804, 0x354f, 0x7007,
-	0x0003, 0x701f, 0x499c, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024,
-	0x2058, 0x1138, 0x2009, 0x0004, 0xba04, 0x9294, 0x00ff, 0x0804,
-	0x562d, 0x900e, 0xa868, 0xd0f4, 0x1904, 0x351d, 0x080c, 0x6820,
-	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x351d,
-	0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904, 0x4a07, 0x902e, 0x080c,
-	0xadb1, 0x0130, 0x9026, 0x20a9, 0x0800, 0x2071, 0x1000, 0x0030,
-	0x2021, 0x007f, 0x20a9, 0x0781, 0x2071, 0x107f, 0x2e04, 0x9005,
-	0x11b8, 0x2100, 0x9406, 0x1904, 0x4a18, 0x2428, 0x94ce, 0x007f,
-	0x1120, 0x92ce, 0xfffd, 0x1558, 0x0030, 0x94ce, 0x0080, 0x1130,
-	0x92ce, 0xfffc, 0x1520, 0x93ce, 0x00ff, 0x1508, 0xc5fd, 0x0480,
-	0x2058, 0xbf10, 0x2700, 0x9306, 0x11e8, 0xbe14, 0x2600, 0x9206,
-	0x11c8, 0x2400, 0x9106, 0x1180, 0xd884, 0x0598, 0xd894, 0x1588,
-	0x080c, 0x690a, 0x1570, 0x2001, 0x4000, 0x0460, 0x080c, 0x696a,
-	0x1540, 0x2001, 0x4000, 0x0430, 0x2001, 0x4007, 0x0418, 0x2001,
-	0x4006, 0x0400, 0x2400, 0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128,
-	0x86ff, 0x0918, 0x080c, 0xadb1, 0x1900, 0x2001, 0x4008, 0x0090,
-	0x8420, 0x8e70, 0x1f04, 0x49ce, 0x85ff, 0x1130, 0x2001, 0x4009,
-	0x0048, 0x2001, 0x0001, 0x0030, 0x080c, 0x659f, 0x1dd0, 0xbb12,
-	0xba16, 0x9006, 0x9005, 0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x354f, 0x080c, 0x4aa5, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x354f, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x7884, 0x9005, 0x0904, 0x3552, 0x9096, 0x00ff, 0x0120,
-	0x9092, 0x0004, 0x1a04, 0x3552, 0x2010, 0x2918, 0x080c, 0x3162,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x354f, 0x7007, 0x0003, 0x701f,
-	0x4a5a, 0x0005, 0xa830, 0x9086, 0x0100, 0x1904, 0x351d, 0x2009,
-	0x0004, 0x0804, 0x354f, 0x7984, 0x080c, 0xadb1, 0x1120, 0x9182,
-	0x007f, 0x0a04, 0x3552, 0x9186, 0x00ff, 0x0904, 0x3552, 0x9182,
-	0x0800, 0x1a04, 0x3552, 0x2001, 0x9000, 0x080c, 0x5688, 0x1904,
-	0x354f, 0x0804, 0x351d, 0xa998, 0x080c, 0xadb1, 0x1118, 0x9182,
-	0x007f, 0x0280, 0x9186, 0x00ff, 0x0168, 0x9182, 0x0800, 0x1250,
-	0x2001, 0x9000, 0x080c, 0x5688, 0x11a8, 0x0060, 0xa897, 0x4005,
+	0x81ff, 0x1904, 0x3556, 0x798c, 0x2001, 0x197f, 0x918c, 0x8000,
+	0x2102, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x6972, 0x0120,
+	0x080c, 0x697a, 0x1904, 0x3559, 0x080c, 0x66c6, 0x0904, 0x3556,
+	0x080c, 0x6768, 0x0904, 0x3556, 0x2001, 0x197f, 0x2004, 0xd0fc,
+	0x1904, 0x3524, 0x0804, 0x451c, 0xa9a0, 0x2001, 0x197f, 0x918c,
+	0x8000, 0xc18d, 0x2102, 0x080c, 0x4ac8, 0x01a0, 0x080c, 0x6972,
+	0x0118, 0x080c, 0x697a, 0x1170, 0x080c, 0x66c6, 0x2009, 0x0002,
+	0x0128, 0x080c, 0x6768, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005,
 	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x0005, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0000, 0x0005, 0x2009, 0x000a, 0x0c48, 0x080c, 0x0fff, 0x0198,
-	0x9006, 0xa802, 0x7014, 0x9005, 0x1120, 0x2900, 0x7016, 0x701a,
-	0x0040, 0x7018, 0xa802, 0x0086, 0x2040, 0x2900, 0xa006, 0x701a,
-	0x008e, 0x9085, 0x0001, 0x0005, 0x7984, 0x080c, 0x6600, 0x1130,
-	0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff,
-	0x0005, 0xa998, 0x080c, 0x6600, 0x1130, 0xae9c, 0x9684, 0x3fff,
-	0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xae98, 0x0008,
-	0x7e84, 0x2608, 0x080c, 0x6600, 0x1108, 0x0008, 0x905e, 0x8bff,
-	0x0005, 0x0016, 0x7114, 0x81ff, 0x0128, 0x2148, 0xa904, 0x080c,
-	0x1031, 0x0cc8, 0x7116, 0x711a, 0x001e, 0x0005, 0x2031, 0x0001,
-	0x0010, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a, 0xa17a,
-	0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9,
-	0x7007, 0x0002, 0x701f, 0x351d, 0x0005, 0x00f6, 0x0126, 0x2091,
-	0x8000, 0x2079, 0x0000, 0x2001, 0x18b0, 0x2004, 0x9005, 0x1190,
-	0x0e04, 0x4b22, 0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b,
-	0x0804, 0x4b88, 0x0016, 0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071,
-	0x189e, 0x7044, 0x9005, 0x1540, 0x7148, 0x9182, 0x0010, 0x0288,
-	0x7038, 0x2060, 0x080c, 0x0fff, 0x0904, 0x4b80, 0xa84b, 0x0000,
-	0x2900, 0x7046, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa846,
-	0x0098, 0x7038, 0x90e0, 0x0004, 0x2001, 0x18ba, 0x9c82, 0x18fa,
-	0x0210, 0x2061, 0x18ba, 0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108,
-	0x703e, 0x8108, 0x714a, 0x0460, 0x7148, 0x8108, 0x714a, 0x7044,
-	0x2040, 0xa144, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0dd5,
-	0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa146, 0x1520, 0x080c,
-	0x0fff, 0x1130, 0x8109, 0xa946, 0x7148, 0x8109, 0x714a, 0x00d8,
-	0x9006, 0xa806, 0xa84a, 0xa046, 0x2800, 0xa802, 0x2900, 0xa006,
-	0x7046, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa846, 0x0058,
-	0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e,
-	0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4baa,
-	0x4baa, 0x4bac, 0x4baa, 0x4baa, 0x4baa, 0x4bb0, 0x4baa, 0x4baa,
-	0x4baa, 0x4bb4, 0x4baa, 0x4baa, 0x4baa, 0x4bb8, 0x4baa, 0x4baa,
-	0x4baa, 0x4bbc, 0x4baa, 0x4baa, 0x4baa, 0x4bc0, 0x4baa, 0x4baa,
-	0x4baa, 0x4bc5, 0x080c, 0x0dd5, 0xa276, 0xa37a, 0xa47e, 0x0898,
-	0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858,
-	0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818,
-	0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4b83, 0xa2d6, 0xa3da, 0xa4de,
-	0x0804, 0x4b83, 0x00e6, 0x2071, 0x189e, 0x7048, 0x9005, 0x0904,
-	0x4c5c, 0x0126, 0x2091, 0x8000, 0x0e04, 0x4c5b, 0x00f6, 0x2079,
-	0x0000, 0x00c6, 0x0096, 0x0086, 0x0076, 0x9006, 0x2038, 0x7040,
-	0x2048, 0x9005, 0x0500, 0xa948, 0x2105, 0x0016, 0x908a, 0x0036,
-	0x1a0c, 0x0dd5, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa94a,
-	0x1904, 0x4c5e, 0xa804, 0x9005, 0x090c, 0x0dd5, 0x7042, 0x2938,
-	0x2040, 0xa003, 0x0000, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005,
-	0xa04a, 0x0804, 0x4c5e, 0x703c, 0x2060, 0x2c14, 0x6304, 0x6408,
-	0x650c, 0x2200, 0x7836, 0x7833, 0x0012, 0x7882, 0x2300, 0x7886,
-	0x2400, 0x788a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x119b, 0x87ff, 0x0118, 0x2748, 0x080c, 0x1031, 0x7048,
-	0x8001, 0x704a, 0x9005, 0x1170, 0x7040, 0x2048, 0x9005, 0x0128,
-	0x080c, 0x1031, 0x9006, 0x7042, 0x7046, 0x703b, 0x18ba, 0x703f,
-	0x18ba, 0x0420, 0x7040, 0x9005, 0x1508, 0x7238, 0x2c00, 0x9206,
-	0x0148, 0x9c80, 0x0004, 0x90fa, 0x18fa, 0x0210, 0x2001, 0x18ba,
-	0x703e, 0x00a0, 0x9006, 0x703e, 0x703a, 0x7044, 0x9005, 0x090c,
-	0x0dd5, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x7042, 0x2001,
-	0x0002, 0x9080, 0x2090, 0x2005, 0xa84a, 0x0000, 0x007e, 0x008e,
-	0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082,
-	0x001b, 0x0002, 0x4c7d, 0x4c7d, 0x4c7f, 0x4c7d, 0x4c7d, 0x4c7d,
-	0x4c84, 0x4c7d, 0x4c7d, 0x4c7d, 0x4c89, 0x4c7d, 0x4c7d, 0x4c7d,
-	0x4c8e, 0x4c7d, 0x4c7d, 0x4c7d, 0x4c93, 0x4c7d, 0x4c7d, 0x4c7d,
-	0x4c98, 0x4c7d, 0x4c7d, 0x4c7d, 0x4c9d, 0x080c, 0x0dd5, 0xaa74,
-	0xab78, 0xac7c, 0x0804, 0x4c09, 0xaa84, 0xab88, 0xac8c, 0x0804,
-	0x4c09, 0xaa94, 0xab98, 0xac9c, 0x0804, 0x4c09, 0xaaa4, 0xaba8,
-	0xacac, 0x0804, 0x4c09, 0xaab4, 0xabb8, 0xacbc, 0x0804, 0x4c09,
-	0xaac4, 0xabc8, 0xaccc, 0x0804, 0x4c09, 0xaad4, 0xabd8, 0xacdc,
-	0x0804, 0x4c09, 0x0016, 0x0026, 0x0036, 0x00b6, 0x00c6, 0x2009,
-	0x007e, 0x080c, 0x6600, 0x2019, 0x0001, 0xb85c, 0xd0ac, 0x0110,
-	0x2019, 0x0000, 0x2011, 0x801b, 0x080c, 0x4b05, 0x00ce, 0x00be,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x080c, 0x56d0, 0xd0c4,
-	0x0120, 0x2011, 0x8014, 0x080c, 0x4b05, 0x002e, 0x0005, 0x81ff,
-	0x1904, 0x354f, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085,
-	0xc0ac, 0x6032, 0x080c, 0x73b0, 0x1158, 0x080c, 0x7698, 0x080c,
-	0x601b, 0x9085, 0x0001, 0x080c, 0x73f7, 0x080c, 0x72e2, 0x0010,
-	0x080c, 0x5eda, 0x012e, 0x0804, 0x351d, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x354f, 0x080c, 0x56e4, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x354f, 0x080c, 0x6962, 0x0120, 0x2009, 0x0008, 0x0804,
-	0x354f, 0x080c, 0x330d, 0x0128, 0x7984, 0x080c, 0x659f, 0x1904,
-	0x3552, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x2b00, 0x7026, 0x080c,
-	0x696a, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c,
-	0x6820, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
-	0x351d, 0x080c, 0x4aa5, 0x0904, 0x354f, 0x9006, 0xa866, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd3e, 0x0904, 0x354f, 0x7888,
-	0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x7007, 0x0003, 0x701f,
-	0x4d7e, 0x0005, 0x2061, 0x1800, 0x080c, 0x56e4, 0x2009, 0x0007,
-	0x1578, 0x080c, 0x6962, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c,
-	0x330d, 0x0120, 0xa998, 0x080c, 0x659f, 0x1530, 0x080c, 0x4ad6,
-	0x0518, 0x080c, 0x696a, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150,
-	0x900e, 0x080c, 0x6820, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xcd3e, 0x11e0,
-	0xa89c, 0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x2009, 0x0003,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a, 0x9006,
-	0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x562d, 0x900e, 0x080c,
-	0x6820, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
-	0x351d, 0x080c, 0x56e4, 0x0120, 0x2009, 0x0007, 0x0804, 0x354f,
-	0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4aa5, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x354f, 0x900e, 0x2130, 0x7126, 0x7132,
-	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0,
-	0x080c, 0x6600, 0x1904, 0x4e20, 0x080c, 0x696a, 0x0138, 0x080c,
-	0x6972, 0x0120, 0x080c, 0x690a, 0x1904, 0x4e20, 0xd794, 0x1110,
-	0xd784, 0x01a8, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
-	0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0,
-	0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x48a7, 0x0048, 0x20a9,
-	0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x48a7,
-	0x9186, 0x007e, 0x0170, 0x9186, 0x0080, 0x0158, 0x080c, 0x696a,
-	0x90c2, 0x0006, 0x1210, 0xc1fd, 0x0020, 0x080c, 0x6820, 0x1108,
-	0xc1fd, 0x4104, 0xc1fc, 0xd794, 0x0528, 0xb8c4, 0x20e0, 0xb8c8,
-	0x2060, 0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80,
-	0x0003, 0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098,
-	0x3400, 0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
-	0x080c, 0x489a, 0x9c80, 0x0026, 0x2098, 0xb8c4, 0x20e0, 0x20a9,
-	0x0002, 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005,
-	0x8108, 0x080c, 0xadb1, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c,
-	0x0120, 0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150,
-	0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150,
-	0x0804, 0x4db0, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x351d,
-	0x7033, 0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061,
-	0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028,
+	0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x197f, 0x2004, 0xd0fc,
+	0x1128, 0x080c, 0x56d7, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x6100, 0x0804, 0x3524, 0x080c,
+	0x4ad7, 0x0904, 0x3559, 0x080c, 0x56e3, 0x1904, 0x3556, 0x79a8,
+	0xd184, 0x1158, 0xb834, 0x8007, 0x789e, 0xb830, 0x8007, 0x789a,
+	0xbb2c, 0x831f, 0xba28, 0x8217, 0x0050, 0xb824, 0x8007, 0x789e,
+	0xb820, 0x8007, 0x789a, 0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900,
+	0x918c, 0x0200, 0x0804, 0x3524, 0x78a8, 0x909c, 0x0003, 0xd0b4,
+	0x1148, 0x939a, 0x0003, 0x1a04, 0x3556, 0x625c, 0x7884, 0x9206,
+	0x1904, 0x46c9, 0x080c, 0x85d9, 0x2001, 0xfff4, 0x2009, 0x000c,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0000, 0x0006, 0x78a8,
+	0x9084, 0x0080, 0x11c8, 0x0006, 0x0036, 0x2001, 0x1a7f, 0x201c,
+	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a80, 0x201c, 0x7b9e, 0x2003,
+	0x0000, 0x2001, 0x1a81, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
+	0x000e, 0x000e, 0x0804, 0x4af0, 0x000e, 0x2031, 0x0000, 0x2061,
+	0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f, 0x46e9,
+	0x0005, 0x81ff, 0x1904, 0x3556, 0x080c, 0x4ad7, 0x0904, 0x3559,
+	0x080c, 0x6972, 0x1904, 0x3556, 0x00c6, 0x080c, 0x4aa4, 0x00ce,
+	0x0904, 0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8,
+	0x080c, 0xcca4, 0x0904, 0x3556, 0x7007, 0x0003, 0x701f, 0x4703,
+	0x0005, 0x080c, 0x420e, 0x0006, 0x0036, 0x2001, 0x1a7f, 0x201c,
+	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a80, 0x201c, 0x7b9e, 0x2003,
+	0x0000, 0x2001, 0x1a81, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
+	0x000e, 0x0804, 0x3524, 0xa830, 0x9086, 0x0100, 0x0904, 0x3556,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x4af0, 0x9006, 0x080c, 0x28a7, 0x78a8, 0x9084, 0x00ff, 0x9086,
+	0x00ff, 0x0118, 0x81ff, 0x1904, 0x3556, 0x080c, 0x73bc, 0x0110,
+	0x080c, 0x5fdf, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3559, 0x7984,
+	0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x3559, 0x2100,
+	0x080c, 0x2871, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061,
+	0x19fa, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077,
+	0x0000, 0x080c, 0x73bc, 0x1158, 0x080c, 0x76a4, 0x080c, 0x601a,
+	0x9085, 0x0001, 0x080c, 0x7403, 0x080c, 0x72ee, 0x00d0, 0x080c,
+	0xadd2, 0x2061, 0x0100, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
+	0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
+	0x1999, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f05, 0x080c,
+	0x858b, 0x7984, 0x080c, 0x73bc, 0x1110, 0x2009, 0x00ff, 0x7a88,
+	0x080c, 0x457f, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3524, 0x7984,
+	0x080c, 0x659e, 0x2b08, 0x1904, 0x3559, 0x0804, 0x3524, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x3556, 0x60dc, 0xd0ac, 0x1130,
+	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3556, 0x080c, 0x4aa4,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3556, 0x7984, 0x9192, 0x0021,
+	0x1a04, 0x3559, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
+	0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x4aed, 0x701f, 0x47b7,
+	0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x518d, 0x0005, 0x2009,
+	0x0080, 0x080c, 0x65ff, 0x1118, 0x080c, 0x6972, 0x0120, 0x2021,
+	0x400a, 0x0804, 0x3526, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70,
+	0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4850,
+	0x90be, 0x0112, 0x0904, 0x4850, 0x90be, 0x0113, 0x0904, 0x4850,
+	0x90be, 0x0114, 0x0904, 0x4850, 0x90be, 0x0117, 0x0904, 0x4850,
+	0x90be, 0x011a, 0x0904, 0x4850, 0x90be, 0x011c, 0x0904, 0x4850,
+	0x90be, 0x0121, 0x0904, 0x4837, 0x90be, 0x0131, 0x0904, 0x4837,
+	0x90be, 0x0171, 0x0904, 0x4850, 0x90be, 0x0173, 0x0904, 0x4850,
+	0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x485b,
+	0x90be, 0x0212, 0x0904, 0x4844, 0x90be, 0x0213, 0x05e8, 0x90be,
+	0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120,
+	0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be,
+	0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x3559, 0x7028, 0x9080,
+	0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007,
+	0x080c, 0x4899, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4899, 0x00c8, 0x7028,
+	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x080c, 0x48a6, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x48a6,
+	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
+	0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4aa4, 0x0550, 0xa868,
+	0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020,
+	0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe,
+	0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822,
+	0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xccbf, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x4890,
+	0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x3556,
+	0xa820, 0x9086, 0x8001, 0x1904, 0x3524, 0x2009, 0x0004, 0x0804,
+	0x3556, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104,
+	0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204,
+	0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3556, 0x60dc,
+	0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3556,
+	0x7984, 0x78a8, 0x2040, 0x080c, 0xadcb, 0x1120, 0x9182, 0x007f,
+	0x0a04, 0x3559, 0x9186, 0x00ff, 0x0904, 0x3559, 0x9182, 0x0800,
+	0x1a04, 0x3559, 0x7a8c, 0x7b88, 0x607c, 0x9306, 0x1140, 0x6080,
+	0x924e, 0x0904, 0x3559, 0x99cc, 0xff00, 0x0904, 0x3559, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x49b7, 0x0904, 0x4937, 0x0086, 0x90c6,
+	0x4000, 0x008e, 0x1538, 0x00c6, 0x0006, 0x0036, 0xb818, 0xbb1c,
+	0x9305, 0xbb20, 0x9305, 0xbb24, 0x9305, 0xbb28, 0x9305, 0xbb2c,
+	0x9305, 0xbb30, 0x9305, 0xbb34, 0x9305, 0x003e, 0x0570, 0xd88c,
+	0x1128, 0x080c, 0x6972, 0x0110, 0xc89d, 0x0438, 0x900e, 0x080c,
+	0x681f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x000e,
+	0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090, 0x90c6,
+	0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009, 0x1108,
+	0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005, 0x2009,
+	0x000a, 0x2020, 0x012e, 0x0804, 0x3526, 0x000e, 0x00ce, 0x2b00,
+	0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0xaeaf,
+	0x0904, 0x498c, 0x2b00, 0x6012, 0x080c, 0xcfaa, 0x2e58, 0x00ee,
+	0x00e6, 0x00c6, 0x080c, 0x4aa4, 0x00ce, 0x2b70, 0x1158, 0x080c,
+	0xae61, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002,
+	0x0804, 0x3556, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932,
+	0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0xd89c, 0x1110,
+	0x080c, 0x31bf, 0x6023, 0x0001, 0x9006, 0x080c, 0x653b, 0xd89c,
+	0x0138, 0x2001, 0x0004, 0x080c, 0x654f, 0x2009, 0x0003, 0x0030,
+	0x2001, 0x0002, 0x080c, 0x654f, 0x2009, 0x0002, 0x080c, 0xaedc,
+	0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8cc,
+	0xc08d, 0xb8ce, 0x9085, 0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e,
+	0x012e, 0x1120, 0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003,
+	0x701f, 0x499b, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058,
+	0x1138, 0x2009, 0x0004, 0xba04, 0x9294, 0x00ff, 0x0804, 0x562c,
+	0x900e, 0xa868, 0xd0f4, 0x1904, 0x3524, 0x080c, 0x681f, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3524, 0x00e6,
+	0x00d6, 0x0096, 0x83ff, 0x0904, 0x4a06, 0x902e, 0x080c, 0xadcb,
+	0x0130, 0x9026, 0x20a9, 0x0800, 0x2071, 0x1000, 0x0030, 0x2021,
+	0x007f, 0x20a9, 0x0781, 0x2071, 0x107f, 0x2e04, 0x9005, 0x11b8,
+	0x2100, 0x9406, 0x1904, 0x4a17, 0x2428, 0x94ce, 0x007f, 0x1120,
+	0x92ce, 0xfffd, 0x1558, 0x0030, 0x94ce, 0x0080, 0x1130, 0x92ce,
+	0xfffc, 0x1520, 0x93ce, 0x00ff, 0x1508, 0xc5fd, 0x0480, 0x2058,
+	0xbf10, 0x2700, 0x9306, 0x11e8, 0xbe14, 0x2600, 0x9206, 0x11c8,
+	0x2400, 0x9106, 0x1180, 0xd884, 0x0598, 0xd894, 0x1588, 0x080c,
+	0x6912, 0x1570, 0x2001, 0x4000, 0x0460, 0x080c, 0x6972, 0x1540,
+	0x2001, 0x4000, 0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006,
+	0x0400, 0x2400, 0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff,
+	0x0918, 0x080c, 0xadcb, 0x1900, 0x2001, 0x4008, 0x0090, 0x8420,
+	0x8e70, 0x1f04, 0x49cd, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048,
+	0x2001, 0x0001, 0x0030, 0x080c, 0x659e, 0x1dd0, 0xbb12, 0xba16,
+	0x9006, 0x9005, 0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3556, 0x080c, 0x4aa4, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x7884, 0x9005, 0x0904, 0x3559, 0x9096, 0x00ff, 0x0120, 0x9092,
+	0x0004, 0x1a04, 0x3559, 0x2010, 0x2918, 0x080c, 0x3165, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x4a59,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x1904, 0x3524, 0x2009, 0x0004,
+	0x0804, 0x3556, 0x7984, 0x080c, 0xadcb, 0x1120, 0x9182, 0x007f,
+	0x0a04, 0x3559, 0x9186, 0x00ff, 0x0904, 0x3559, 0x9182, 0x0800,
+	0x1a04, 0x3559, 0x2001, 0x9000, 0x080c, 0x5687, 0x1904, 0x3556,
+	0x0804, 0x3524, 0xa998, 0x080c, 0xadcb, 0x1118, 0x9182, 0x007f,
+	0x0280, 0x9186, 0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001,
+	0x9000, 0x080c, 0x5687, 0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a,
+	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x0005, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x0005, 0x2009, 0x000a, 0x0c48, 0x080c, 0x0fff, 0x0198, 0x9006,
+	0xa802, 0x7014, 0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040,
+	0x7018, 0xa802, 0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e,
+	0x9085, 0x0001, 0x0005, 0x7984, 0x080c, 0x65ff, 0x1130, 0x7e88,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005,
+	0xa998, 0x080c, 0x65ff, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84,
+	0x2608, 0x080c, 0x65ff, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005,
+	0x0016, 0x7114, 0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x1031,
+	0x0cc8, 0x7116, 0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010,
+	0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772,
 	0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007,
-	0x0002, 0x701f, 0x4e5c, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120,
-	0x7028, 0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18b8,
-	0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x4db0, 0x7124,
-	0x810b, 0x0804, 0x351d, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c,
-	0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3552,
-	0x9502, 0x0a04, 0x3552, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04,
-	0x3552, 0x9502, 0x0a04, 0x3552, 0x9284, 0xff00, 0x8007, 0x90e2,
-	0x0020, 0x0a04, 0x3552, 0x9502, 0x0a04, 0x3552, 0x9284, 0x00ff,
-	0x90e2, 0x0020, 0x0a04, 0x3552, 0x9502, 0x0a04, 0x3552, 0x9384,
-	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3552, 0x9502, 0x0a04,
-	0x3552, 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3552, 0x9502,
-	0x0a04, 0x3552, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
-	0x3552, 0x9502, 0x0a04, 0x3552, 0x9484, 0x00ff, 0x90e2, 0x0020,
-	0x0a04, 0x3552, 0x9502, 0x0a04, 0x3552, 0x2061, 0x1989, 0x6102,
-	0x6206, 0x630a, 0x640e, 0x0804, 0x351d, 0x080c, 0x4aa5, 0x0904,
-	0x354f, 0x2009, 0x0016, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c,
-	0x9080, 0x0019, 0xaf60, 0x080c, 0x4aee, 0x701f, 0x4ee0, 0x0005,
-	0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c,
-	0xd0a4, 0x1de8, 0x00ee, 0x20a9, 0x0016, 0x896e, 0x8d6e, 0x8d6f,
-	0x9d84, 0xffc0, 0x9080, 0x0019, 0x2098, 0x9d84, 0x003f, 0x20e0,
-	0x2069, 0x1877, 0x20e9, 0x0001, 0x2da0, 0x4003, 0x6800, 0x9005,
-	0x0904, 0x4f61, 0x6804, 0x2008, 0x918c, 0xfff8, 0x1904, 0x4f61,
-	0x680c, 0x9005, 0x0904, 0x4f61, 0x9082, 0xff01, 0x1a04, 0x4f61,
-	0x6810, 0x9082, 0x005c, 0x0a04, 0x4f61, 0x6824, 0x2008, 0x9082,
-	0x0008, 0x0a04, 0x4f61, 0x9182, 0x0400, 0x1a04, 0x4f61, 0x0056,
-	0x2029, 0x0000, 0x080c, 0x8ad2, 0x005e, 0x6944, 0x6820, 0x9102,
-	0x06c0, 0x6820, 0x9082, 0x0019, 0x16a0, 0x6828, 0x6944, 0x810c,
-	0x9102, 0x0678, 0x6840, 0x9082, 0x000f, 0x1658, 0x080c, 0x1018,
-	0x2900, 0x0904, 0x4f7b, 0x684e, 0x00e6, 0x2071, 0x1930, 0x00b6,
-	0x2059, 0x0000, 0x080c, 0x898e, 0x00be, 0x00ee, 0x0558, 0x080c,
-	0x86e8, 0x080c, 0x872e, 0x11e0, 0x6857, 0x0000, 0x00c6, 0x2061,
-	0x0100, 0x6104, 0x918d, 0x2000, 0x6106, 0x6b10, 0x2061, 0x1a62,
-	0x630a, 0x00ce, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804,
-	0x351d, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804, 0x3552,
-	0x00e6, 0x2071, 0x1930, 0x080c, 0x8b63, 0x080c, 0x8b72, 0x080c,
-	0x897d, 0x00ee, 0x2001, 0x188a, 0x204c, 0x080c, 0x1031, 0x2001,
-	0x188a, 0x2003, 0x0000, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102,
-	0x0804, 0x354f, 0x2001, 0x1924, 0x200c, 0x918e, 0x0000, 0x0904,
-	0x4fda, 0x080c, 0x8978, 0x0904, 0x4fda, 0x2001, 0x0101, 0x200c,
-	0x918c, 0xdfff, 0x2102, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6,
-	0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x080c, 0x897d,
-	0x2001, 0x0035, 0x080c, 0x15ee, 0x00c6, 0x2061, 0x193c, 0x6004,
-	0x6100, 0x9106, 0x1de0, 0x00ce, 0x080c, 0x2956, 0x2001, 0x0138,
-	0x2102, 0x00e6, 0x00f6, 0x2071, 0x1923, 0x080c, 0x88b9, 0x0120,
-	0x2f00, 0x080c, 0x8943, 0x0cc8, 0x00fe, 0x00ee, 0x0126, 0x2091,
-	0x8000, 0x2001, 0x188a, 0x200c, 0x81ff, 0x0138, 0x2148, 0x080c,
-	0x1031, 0x2001, 0x188a, 0x2003, 0x0000, 0x2001, 0x183c, 0x2003,
-	0x0020, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8b63, 0x080c, 0x8b72,
-	0x00ee, 0x012e, 0x0804, 0x351d, 0x0006, 0x080c, 0x56d0, 0xd0cc,
-	0x000e, 0x0005, 0x0006, 0x080c, 0x56d4, 0xd0bc, 0x000e, 0x0005,
-	0x6174, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x351d,
-	0x83ff, 0x1904, 0x3552, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x3552,
-	0x2019, 0xffff, 0x6078, 0x9302, 0x9200, 0x0a04, 0x3552, 0x7986,
-	0x6276, 0x0804, 0x351d, 0x080c, 0x56e4, 0x1904, 0x354f, 0x7c88,
-	0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4aa5, 0x0904, 0x354f, 0x900e,
-	0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080,
-	0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178,
-	0x080c, 0x696a, 0x0118, 0x080c, 0x6972, 0x1148, 0x20a9, 0x0001,
-	0xb814, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108,
-	0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff,
-	0x1148, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x8f3f, 0x2208,
-	0x0804, 0x351d, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026,
-	0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076,
-	0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10e9,
-	0x7007, 0x0002, 0x701f, 0x505d, 0x0005, 0x7030, 0x9005, 0x1178,
-	0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18b8,
-	0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x501b, 0x7224,
-	0x900e, 0x2001, 0x0003, 0x080c, 0x8f3f, 0x2208, 0x0804, 0x351d,
-	0x00f6, 0x00e6, 0x080c, 0x56e4, 0x2009, 0x0007, 0x1904, 0x50f0,
-	0x2071, 0x189e, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x50f0,
-	0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x1018, 0x2009,
-	0x0002, 0x0904, 0x50f0, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356,
-	0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0,
-	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x696a, 0x0118,
-	0x080c, 0x6972, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810,
-	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
-	0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e,
-	0x2001, 0x0003, 0x080c, 0x8f3f, 0x2208, 0x009e, 0xa897, 0x4000,
-	0xa99a, 0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1031,
-	0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001,
-	0x7152, 0x7054, 0x9300, 0x7056, 0x2061, 0x18b9, 0x2c44, 0xa37a,
-	0x7058, 0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
-	0xa09f, 0x50fc, 0x000e, 0xa0a2, 0x080c, 0x10e9, 0x9006, 0x0048,
-	0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c,
-	0x0dd5, 0x00e6, 0x2071, 0x189e, 0xa06c, 0x908e, 0x0100, 0x0138,
-	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060,
-	0x9005, 0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8,
-	0xa48c, 0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883,
-	0x0000, 0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c,
-	0x8f3f, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c,
-	0x1031, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6c79, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee,
-	0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
-	0x696a, 0x0118, 0x080c, 0x6972, 0x1148, 0xb814, 0x20a9, 0x0001,
+	0x0002, 0x701f, 0x3524, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000,
+	0x2079, 0x0000, 0x2001, 0x18b0, 0x2004, 0x9005, 0x1190, 0x0e04,
+	0x4b21, 0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x0804,
+	0x4b87, 0x0016, 0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x189e,
+	0x7044, 0x9005, 0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038,
+	0x2060, 0x080c, 0x0fff, 0x0904, 0x4b7f, 0xa84b, 0x0000, 0x2900,
+	0x7046, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa846, 0x0098,
+	0x7038, 0x90e0, 0x0004, 0x2001, 0x18ba, 0x9c82, 0x18fa, 0x0210,
+	0x2061, 0x18ba, 0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108, 0x703e,
+	0x8108, 0x714a, 0x0460, 0x7148, 0x8108, 0x714a, 0x7044, 0x2040,
+	0xa144, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x2060,
+	0x001e, 0x8108, 0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x0fff,
+	0x1130, 0x8109, 0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006,
+	0xa806, 0xa84a, 0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046,
+	0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa846, 0x0058, 0x2262,
+	0x6306, 0x640a, 0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e,
+	0x00fe, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4ba9, 0x4ba9,
+	0x4bab, 0x4ba9, 0x4ba9, 0x4ba9, 0x4baf, 0x4ba9, 0x4ba9, 0x4ba9,
+	0x4bb3, 0x4ba9, 0x4ba9, 0x4ba9, 0x4bb7, 0x4ba9, 0x4ba9, 0x4ba9,
+	0x4bbb, 0x4ba9, 0x4ba9, 0x4ba9, 0x4bbf, 0x4ba9, 0x4ba9, 0x4ba9,
+	0x4bc4, 0x080c, 0x0dd5, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286,
+	0xa38a, 0xa48e, 0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6,
+	0xa3aa, 0xa4ae, 0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6,
+	0xa3ca, 0xa4ce, 0x0804, 0x4b82, 0xa2d6, 0xa3da, 0xa4de, 0x0804,
+	0x4b82, 0x00e6, 0x2071, 0x189e, 0x7048, 0x9005, 0x0904, 0x4c5b,
+	0x0126, 0x2091, 0x8000, 0x0e04, 0x4c5a, 0x00f6, 0x2079, 0x0000,
+	0x00c6, 0x0096, 0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048,
+	0x9005, 0x0500, 0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c,
+	0x0dd5, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904,
+	0x4c5d, 0xa804, 0x9005, 0x090c, 0x0dd5, 0x7042, 0x2938, 0x2040,
+	0xa003, 0x0000, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa04a,
+	0x0804, 0x4c5d, 0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c,
+	0x2200, 0x7836, 0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400,
+	0x788a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x119b, 0x87ff, 0x0118, 0x2748, 0x080c, 0x1031, 0x7048, 0x8001,
+	0x704a, 0x9005, 0x1170, 0x7040, 0x2048, 0x9005, 0x0128, 0x080c,
+	0x1031, 0x9006, 0x7042, 0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba,
+	0x0420, 0x7040, 0x9005, 0x1508, 0x7238, 0x2c00, 0x9206, 0x0148,
+	0x9c80, 0x0004, 0x90fa, 0x18fa, 0x0210, 0x2001, 0x18ba, 0x703e,
+	0x00a0, 0x9006, 0x703e, 0x703a, 0x7044, 0x9005, 0x090c, 0x0dd5,
+	0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002,
+	0x9080, 0x2090, 0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e,
+	0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b,
+	0x0002, 0x4c7c, 0x4c7c, 0x4c7e, 0x4c7c, 0x4c7c, 0x4c7c, 0x4c83,
+	0x4c7c, 0x4c7c, 0x4c7c, 0x4c88, 0x4c7c, 0x4c7c, 0x4c7c, 0x4c8d,
+	0x4c7c, 0x4c7c, 0x4c7c, 0x4c92, 0x4c7c, 0x4c7c, 0x4c7c, 0x4c97,
+	0x4c7c, 0x4c7c, 0x4c7c, 0x4c9c, 0x080c, 0x0dd5, 0xaa74, 0xab78,
+	0xac7c, 0x0804, 0x4c08, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x4c08,
+	0xaa94, 0xab98, 0xac9c, 0x0804, 0x4c08, 0xaaa4, 0xaba8, 0xacac,
+	0x0804, 0x4c08, 0xaab4, 0xabb8, 0xacbc, 0x0804, 0x4c08, 0xaac4,
+	0xabc8, 0xaccc, 0x0804, 0x4c08, 0xaad4, 0xabd8, 0xacdc, 0x0804,
+	0x4c08, 0x0016, 0x0026, 0x0036, 0x00b6, 0x00c6, 0x2009, 0x007e,
+	0x080c, 0x65ff, 0x2019, 0x0001, 0xb85c, 0xd0ac, 0x0110, 0x2019,
+	0x0000, 0x2011, 0x801b, 0x080c, 0x4b04, 0x00ce, 0x00be, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x0026, 0x080c, 0x56cf, 0xd0c4, 0x0120,
+	0x2011, 0x8014, 0x080c, 0x4b04, 0x002e, 0x0005, 0x81ff, 0x1904,
+	0x3556, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac,
+	0x6032, 0x080c, 0x73bc, 0x1158, 0x080c, 0x76a4, 0x080c, 0x601a,
+	0x9085, 0x0001, 0x080c, 0x7403, 0x080c, 0x72ee, 0x0010, 0x080c,
+	0x5ed9, 0x012e, 0x0804, 0x3524, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3556, 0x080c, 0x56e3, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3556, 0x080c, 0x696a, 0x0120, 0x2009, 0x0008, 0x0804, 0x3556,
+	0x080c, 0x3314, 0x0128, 0x7984, 0x080c, 0x659e, 0x1904, 0x3559,
+	0x080c, 0x4ad7, 0x0904, 0x3559, 0x2b00, 0x7026, 0x080c, 0x6972,
+	0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x681f,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3524,
+	0x080c, 0x4aa4, 0x0904, 0x3556, 0x9006, 0xa866, 0xa832, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xcd58, 0x0904, 0x3556, 0x7888, 0xd094,
+	0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x7007, 0x0003, 0x701f, 0x4d7d,
+	0x0005, 0x2061, 0x1800, 0x080c, 0x56e3, 0x2009, 0x0007, 0x1578,
+	0x080c, 0x696a, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x3314,
+	0x0120, 0xa998, 0x080c, 0x659e, 0x1530, 0x080c, 0x4ad5, 0x0518,
+	0x080c, 0x6972, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e,
+	0x080c, 0x681f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xcd58, 0x11e0, 0xa89c,
+	0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x2009, 0x0003, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a, 0x9006, 0x918d,
+	0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x7024, 0x2058, 0x1110, 0x0804, 0x562c, 0x900e, 0x080c, 0x681f,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3524,
+	0x080c, 0x56e3, 0x0120, 0x2009, 0x0007, 0x0804, 0x3556, 0x7f84,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4aa4, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x3556, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860,
+	0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c,
+	0x65ff, 0x1904, 0x4e1f, 0x080c, 0x6972, 0x0138, 0x080c, 0x697a,
+	0x0120, 0x080c, 0x6912, 0x1904, 0x4e1f, 0xd794, 0x1110, 0xd784,
+	0x01a8, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x3400,
+	0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00,
+	0x20e0, 0x20a9, 0x0002, 0x080c, 0x48a6, 0x0048, 0x20a9, 0x0004,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x48a6, 0x9186,
+	0x007e, 0x0170, 0x9186, 0x0080, 0x0158, 0x080c, 0x6972, 0x90c2,
+	0x0006, 0x1210, 0xc1fd, 0x0020, 0x080c, 0x681f, 0x1108, 0xc1fd,
+	0x4104, 0xc1fc, 0xd794, 0x0528, 0xb8c4, 0x20e0, 0xb8c8, 0x2060,
+	0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003,
+	0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400,
+	0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c,
+	0x4899, 0x9c80, 0x0026, 0x2098, 0xb8c4, 0x20e0, 0x20a9, 0x0002,
+	0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108,
+	0x080c, 0xadcb, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120,
+	0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794,
+	0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804,
+	0x4daf, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x3524, 0x7033,
+	0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18b8,
+	0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002,
+	0x701f, 0x4e5b, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028,
+	0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44,
+	0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x4daf, 0x7124, 0x810b,
+	0x0804, 0x3524, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98,
+	0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3559, 0x9502,
+	0x0a04, 0x3559, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3559,
+	0x9502, 0x0a04, 0x3559, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020,
+	0x0a04, 0x3559, 0x9502, 0x0a04, 0x3559, 0x9284, 0x00ff, 0x90e2,
+	0x0020, 0x0a04, 0x3559, 0x9502, 0x0a04, 0x3559, 0x9384, 0xff00,
+	0x8007, 0x90e2, 0x0020, 0x0a04, 0x3559, 0x9502, 0x0a04, 0x3559,
+	0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3559, 0x9502, 0x0a04,
+	0x3559, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3559,
+	0x9502, 0x0a04, 0x3559, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04,
+	0x3559, 0x9502, 0x0a04, 0x3559, 0x2061, 0x1989, 0x6102, 0x6206,
+	0x630a, 0x640e, 0x0804, 0x3524, 0x080c, 0x4aa4, 0x0904, 0x3556,
+	0x2009, 0x0016, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
+	0x0019, 0xaf60, 0x080c, 0x4aed, 0x701f, 0x4edf, 0x0005, 0x2001,
+	0x0138, 0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4,
+	0x1de8, 0x00ee, 0x20a9, 0x0016, 0x896e, 0x8d6e, 0x8d6f, 0x9d84,
+	0xffc0, 0x9080, 0x0019, 0x2098, 0x9d84, 0x003f, 0x20e0, 0x2069,
+	0x1877, 0x20e9, 0x0001, 0x2da0, 0x4003, 0x6800, 0x9005, 0x0904,
+	0x4f60, 0x6804, 0x2008, 0x918c, 0xfff8, 0x1904, 0x4f60, 0x680c,
+	0x9005, 0x0904, 0x4f60, 0x9082, 0xff01, 0x1a04, 0x4f60, 0x6810,
+	0x9082, 0x005c, 0x0a04, 0x4f60, 0x6824, 0x2008, 0x9082, 0x0008,
+	0x0a04, 0x4f60, 0x9182, 0x0400, 0x1a04, 0x4f60, 0x0056, 0x2029,
+	0x0000, 0x080c, 0x8afb, 0x005e, 0x6944, 0x6820, 0x9102, 0x06c0,
+	0x6820, 0x9082, 0x0019, 0x16a0, 0x6828, 0x6944, 0x810c, 0x9102,
+	0x0678, 0x6840, 0x9082, 0x000f, 0x1658, 0x080c, 0x1018, 0x2900,
+	0x0904, 0x4f7a, 0x684e, 0x00e6, 0x2071, 0x1930, 0x00b6, 0x2059,
+	0x0000, 0x080c, 0x89b7, 0x00be, 0x00ee, 0x0558, 0x080c, 0x8711,
+	0x080c, 0x8757, 0x11e0, 0x6857, 0x0000, 0x00c6, 0x2061, 0x0100,
+	0x6104, 0x918d, 0x2000, 0x6106, 0x6b10, 0x2061, 0x1a62, 0x630a,
+	0x00ce, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804, 0x3524,
+	0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804, 0x3559, 0x00e6,
+	0x2071, 0x1930, 0x080c, 0x8b8c, 0x080c, 0x8b9b, 0x080c, 0x89a6,
+	0x00ee, 0x2001, 0x188a, 0x204c, 0x080c, 0x1031, 0x2001, 0x188a,
+	0x2003, 0x0000, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804,
+	0x3556, 0x2001, 0x1924, 0x200c, 0x918e, 0x0000, 0x0904, 0x4fd9,
+	0x080c, 0x89a1, 0x0904, 0x4fd9, 0x2001, 0x0101, 0x200c, 0x918c,
+	0xdfff, 0x2102, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071,
+	0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x080c, 0x89a6, 0x2001,
+	0x0035, 0x080c, 0x15ee, 0x00c6, 0x2061, 0x193c, 0x6004, 0x6100,
+	0x9106, 0x1de0, 0x00ce, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102,
+	0x00e6, 0x00f6, 0x2071, 0x1923, 0x080c, 0x88e2, 0x0120, 0x2f00,
+	0x080c, 0x896c, 0x0cc8, 0x00fe, 0x00ee, 0x0126, 0x2091, 0x8000,
+	0x2001, 0x188a, 0x200c, 0x81ff, 0x0138, 0x2148, 0x080c, 0x1031,
+	0x2001, 0x188a, 0x2003, 0x0000, 0x2001, 0x183c, 0x2003, 0x0020,
+	0x00e6, 0x2071, 0x1930, 0x080c, 0x8b8c, 0x080c, 0x8b9b, 0x00ee,
+	0x012e, 0x0804, 0x3524, 0x0006, 0x080c, 0x56cf, 0xd0cc, 0x000e,
+	0x0005, 0x0006, 0x080c, 0x56d3, 0xd0bc, 0x000e, 0x0005, 0x6174,
+	0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3524, 0x83ff,
+	0x1904, 0x3559, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x3559, 0x2019,
+	0xffff, 0x6078, 0x9302, 0x9200, 0x0a04, 0x3559, 0x7986, 0x6276,
+	0x0804, 0x3524, 0x080c, 0x56e3, 0x1904, 0x3556, 0x7c88, 0x7d84,
+	0x7e98, 0x7f8c, 0x080c, 0x4aa4, 0x0904, 0x3556, 0x900e, 0x901e,
+	0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003,
+	0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x6972, 0x0118, 0x080c, 0x697a, 0x1148, 0x20a9, 0x0001, 0xb814,
 	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
-	0x0800, 0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0,
-	0x7154, 0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c,
-	0x0dd5, 0x2148, 0x080c, 0x1031, 0x9006, 0x705e, 0x918d, 0x0001,
-	0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79,
-	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001,
-	0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696,
-	0xa79a, 0x080c, 0x10e9, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c,
-	0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200,
-	0x0118, 0x009e, 0x0804, 0x3552, 0xa884, 0xa988, 0x080c, 0x283e,
-	0x1518, 0x080c, 0x659f, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c,
-	0x080c, 0x4aa5, 0x01c8, 0x080c, 0x4aa5, 0x01b0, 0x009e, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048,
-	0x080c, 0xccc5, 0x1120, 0x2009, 0x0003, 0x0804, 0x354f, 0x7007,
-	0x0003, 0x701f, 0x51c9, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804,
-	0x354f, 0x7124, 0x080c, 0x32b4, 0xa820, 0x9086, 0x8001, 0x1120,
-	0x2009, 0x0004, 0x0804, 0x354f, 0x2900, 0x7022, 0xa804, 0x0096,
-	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0,
-	0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f7c, 0xaa6c, 0xab70, 0xac74,
-	0xad78, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c,
-	0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004,
-	0x0600, 0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x4af1, 0x97c6,
-	0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061,
-	0x18b8, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f, 0x5225,
-	0x0005, 0x000e, 0x007e, 0x0804, 0x3552, 0x7020, 0x2048, 0xa804,
-	0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8,
-	0x20a9, 0x002a, 0x080c, 0x0f7c, 0x2100, 0x2238, 0x2061, 0x18b8,
-	0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804,
-	0x4af1, 0x81ff, 0x1904, 0x354f, 0x798c, 0x2001, 0x197e, 0x918c,
-	0x8000, 0x2102, 0x080c, 0x4abc, 0x0904, 0x3552, 0x080c, 0x696a,
-	0x0120, 0x080c, 0x6972, 0x1904, 0x3552, 0x080c, 0x66c7, 0x0904,
-	0x354f, 0x0126, 0x2091, 0x8000, 0x080c, 0x678d, 0x012e, 0x0904,
-	0x354f, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1904, 0x351d, 0x0804,
-	0x451d, 0xa9a0, 0x2001, 0x197e, 0x918c, 0x8000, 0xc18d, 0x2102,
-	0x080c, 0x4ac9, 0x01a0, 0x080c, 0x696a, 0x0118, 0x080c, 0x6972,
-	0x1170, 0x080c, 0x66c7, 0x2009, 0x0002, 0x0128, 0x080c, 0x678d,
-	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56d8,
-	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
-	0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x4492, 0x080c,
-	0x4ad8, 0x0904, 0x3552, 0x080c, 0x4aa5, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x354f, 0x080c, 0x696a, 0x0130, 0x908e, 0x0004, 0x0118,
-	0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c,
-	0xb802, 0x0028, 0x080c, 0x56d0, 0xd0b4, 0x0904, 0x44cc, 0x7884,
-	0x908e, 0x007e, 0x0904, 0x44cc, 0x908e, 0x007f, 0x0904, 0x44cc,
-	0x908e, 0x0080, 0x0904, 0x44cc, 0xb800, 0xd08c, 0x1904, 0x44cc,
-	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcce4, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x354f, 0x7007, 0x0003, 0x701f, 0x52f1,
-	0x0005, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x0804, 0x44cc, 0x080c,
-	0x330d, 0x0108, 0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x354f, 0x080c, 0x56e4, 0x0120, 0x2009,
-	0x0007, 0x0804, 0x354f, 0x080c, 0x6962, 0x0120, 0x2009, 0x0008,
-	0x0804, 0x354f, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x44cc,
-	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd3e,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x354f, 0x7007, 0x0003, 0x701f,
-	0x532a, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004,
-	0x0804, 0x562d, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x0804, 0x52c3,
-	0x81ff, 0x2009, 0x0001, 0x1904, 0x354f, 0x080c, 0x56e4, 0x2009,
-	0x0007, 0x1904, 0x354f, 0x080c, 0x6962, 0x0120, 0x2009, 0x0008,
-	0x0804, 0x354f, 0x080c, 0x4ad8, 0x0904, 0x3552, 0x080c, 0x696a,
-	0x2009, 0x0009, 0x1904, 0x354f, 0x080c, 0x4aa5, 0x2009, 0x0002,
-	0x0904, 0x354f, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
-	0x7988, 0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128,
-	0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904,
-	0x3552, 0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xcf91, 0x2009,
-	0x0003, 0x0904, 0x354f, 0x7007, 0x0003, 0x701f, 0x5380, 0x0005,
-	0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x354f, 0x0804,
-	0x351d, 0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c,
-	0x56e4, 0x1188, 0x2009, 0x0014, 0x0804, 0x354f, 0xd2dc, 0x1568,
-	0x81ff, 0x2009, 0x0001, 0x1904, 0x354f, 0x080c, 0x56e4, 0x2009,
-	0x0007, 0x1904, 0x354f, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c,
-	0x56ab, 0x0804, 0x351d, 0xd2fc, 0x0158, 0x080c, 0x4ad8, 0x0904,
-	0x3552, 0x7984, 0x9284, 0x9000, 0x080c, 0x5688, 0x0804, 0x351d,
-	0x080c, 0x4ad8, 0x0904, 0x3552, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x2009, 0x0009, 0x1904, 0x5469, 0x080c, 0x4aa5, 0x2009,
-	0x0002, 0x0904, 0x5469, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009,
-	0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4aee, 0x701f,
-	0x53da, 0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005,
-	0x1120, 0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x3552, 0xa866,
-	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0x4ad8, 0x1110, 0x0804,
-	0x3552, 0x2009, 0x0043, 0x080c, 0xcff9, 0x2009, 0x0003, 0x0904,
-	0x5469, 0x7007, 0x0003, 0x701f, 0x53fe, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x2009, 0x0004, 0x0904, 0x5469, 0x7984, 0x7aa8, 0x9284,
-	0x1000, 0x080c, 0x5688, 0x0804, 0x351d, 0x00c6, 0xaab0, 0x9284,
-	0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c, 0x56e4, 0x1150, 0x2009,
-	0x0014, 0x04f0, 0x2061, 0x1800, 0x080c, 0x56e4, 0x2009, 0x0007,
-	0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x56ab, 0x0050,
-	0xd2fc, 0x0178, 0x080c, 0x4ad6, 0x0588, 0xa998, 0x9284, 0x9000,
-	0x080c, 0x5688, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0x0438, 0x080c, 0x4ad6, 0x0510, 0x080c, 0x696a, 0x2009, 0x0009,
-	0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0,
-	0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c, 0x4ad6, 0x1108, 0x0070,
-	0x2009, 0x004b, 0x080c, 0xcff9, 0x2009, 0x0003, 0x0108, 0x0078,
-	0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006,
-	0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x354f, 0x0016, 0x7984, 0x9284,
-	0x1000, 0xc0fd, 0x080c, 0x5688, 0x001e, 0x1904, 0x354f, 0x0804,
-	0x351d, 0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc,
-	0x0150, 0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5688,
-	0x001e, 0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x354f, 0x080c, 0x56e4, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x354f, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6600, 0x1904,
-	0x3552, 0x9186, 0x007f, 0x0138, 0x080c, 0x696a, 0x0120, 0x2009,
-	0x0009, 0x0804, 0x354f, 0x080c, 0x4aa5, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x354f, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001,
-	0x0100, 0x8007, 0xa80a, 0x080c, 0xccfe, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x354f, 0x7007, 0x0003, 0x701f, 0x54c7, 0x0005, 0xa808,
-	0x8007, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x354f,
-	0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814,
-	0x8007, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af1, 0x080c, 0x4aa5,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x354f, 0x7984, 0x9194, 0xff00,
-	0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x19b3, 0x0040,
-	0x92c6, 0x0001, 0x1118, 0x7023, 0x19cd, 0x0010, 0x0804, 0x3552,
-	0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
-	0x0019, 0xaf60, 0x080c, 0x4aee, 0x701f, 0x5517, 0x0005, 0x2001,
-	0x182e, 0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860,
-	0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003,
-	0x0804, 0x351d, 0x080c, 0x4aa5, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x354f, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff,
-	0x1118, 0x2099, 0x19b3, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099,
-	0x19cd, 0x0010, 0x0804, 0x3552, 0xa85c, 0x9080, 0x0019, 0x20a0,
-	0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009,
+	0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148,
+	0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x8f68, 0x2208, 0x0804,
+	0x3524, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061,
+	0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034,
+	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10e9, 0x7007,
+	0x0002, 0x701f, 0x505c, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120,
+	0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44,
+	0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x501a, 0x7224, 0x900e,
+	0x2001, 0x0003, 0x080c, 0x8f68, 0x2208, 0x0804, 0x3524, 0x00f6,
+	0x00e6, 0x080c, 0x56e3, 0x2009, 0x0007, 0x1904, 0x50ef, 0x2071,
+	0x189e, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x50ef, 0xac9c,
+	0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x1018, 0x2009, 0x0002,
+	0x0904, 0x50ef, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362,
+	0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8,
+	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6972, 0x0118, 0x080c,
+	0x697a, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
+	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
+	0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001,
+	0x0003, 0x080c, 0x8f68, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a,
+	0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1031, 0x9006,
+	0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152,
+	0x7054, 0x9300, 0x7056, 0x2061, 0x18b9, 0x2c44, 0xa37a, 0x7058,
+	0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f,
+	0x50fb, 0x000e, 0xa0a2, 0x080c, 0x10e9, 0x9006, 0x0048, 0x009e,
+	0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0dd5,
+	0x00e6, 0x2071, 0x189e, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005,
+	0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c,
+	0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8f68,
+	0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1031,
+	0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6c81, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe,
+	0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6972,
+	0x0118, 0x080c, 0x697a, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004,
+	0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800,
+	0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154,
+	0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0dd5,
+	0x2148, 0x080c, 0x1031, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008,
+	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81, 0x012e,
+	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152,
+	0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0x080c, 0x10e9, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be,
+	0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118,
+	0x009e, 0x0804, 0x3559, 0xa884, 0xa988, 0x080c, 0x283e, 0x1518,
+	0x080c, 0x659e, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c,
+	0x4aa4, 0x01c8, 0x080c, 0x4aa4, 0x01b0, 0x009e, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c,
+	0xccdf, 0x1120, 0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003,
+	0x701f, 0x51c8, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3556,
+	0x7124, 0x080c, 0x32bb, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x3556, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e,
+	0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8,
+	0x20a9, 0x002a, 0x080c, 0x0f7c, 0xaa6c, 0xab70, 0xac74, 0xad78,
+	0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6,
+	0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600,
+	0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x4af0, 0x97c6, 0x7200,
+	0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18b8,
+	0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496,
+	0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f, 0x5224, 0x0005,
+	0x000e, 0x007e, 0x0804, 0x3559, 0x7020, 0x2048, 0xa804, 0x2048,
+	0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
+	0x002a, 0x080c, 0x0f7c, 0x2100, 0x2238, 0x2061, 0x18b8, 0x2c44,
+	0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x4af0,
+	0x81ff, 0x1904, 0x3556, 0x798c, 0x2001, 0x197e, 0x918c, 0x8000,
+	0x2102, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x6972, 0x0120,
+	0x080c, 0x697a, 0x1904, 0x3559, 0x080c, 0x66c6, 0x0904, 0x3556,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x678c, 0x012e, 0x0904, 0x3556,
+	0x2001, 0x197e, 0x2004, 0xd0fc, 0x1904, 0x3524, 0x0804, 0x451c,
+	0xa9a0, 0x2001, 0x197e, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
+	0x4ac8, 0x01a0, 0x080c, 0x6972, 0x0118, 0x080c, 0x697a, 0x1170,
+	0x080c, 0x66c6, 0x2009, 0x0002, 0x0128, 0x080c, 0x678c, 0x1170,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x2001, 0x197e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56d7, 0x0110,
+	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
+	0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x4491, 0x080c, 0x4ad7,
+	0x0904, 0x3559, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3556, 0x080c, 0x6972, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e,
+	0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802,
+	0x0028, 0x080c, 0x56cf, 0xd0b4, 0x0904, 0x44cb, 0x7884, 0x908e,
+	0x007e, 0x0904, 0x44cb, 0x908e, 0x007f, 0x0904, 0x44cb, 0x908e,
+	0x0080, 0x0904, 0x44cb, 0xb800, 0xd08c, 0x1904, 0x44cb, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xccfe, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x52f0, 0x0005,
+	0x080c, 0x4ad7, 0x0904, 0x3559, 0x0804, 0x44cb, 0x080c, 0x3314,
+	0x0108, 0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x3556, 0x080c, 0x56e3, 0x0120, 0x2009, 0x0007,
+	0x0804, 0x3556, 0x080c, 0x696a, 0x0120, 0x2009, 0x0008, 0x0804,
+	0x3556, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x44cb, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd58, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x5329,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
+	0x562c, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x0804, 0x52c2, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x3556, 0x080c, 0x56e3, 0x2009, 0x0007,
+	0x1904, 0x3556, 0x080c, 0x696a, 0x0120, 0x2009, 0x0008, 0x0804,
+	0x3556, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x080c, 0x6972, 0x2009,
+	0x0009, 0x1904, 0x3556, 0x080c, 0x4aa4, 0x2009, 0x0002, 0x0904,
+	0x3556, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988,
+	0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed,
+	0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x3559,
+	0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xcfab, 0x2009, 0x0003,
+	0x0904, 0x3556, 0x7007, 0x0003, 0x701f, 0x537f, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x3556, 0x0804, 0x3524,
+	0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x56e3,
+	0x1188, 0x2009, 0x0014, 0x0804, 0x3556, 0xd2dc, 0x1568, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x3556, 0x080c, 0x56e3, 0x2009, 0x0007,
+	0x1904, 0x3556, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x56aa,
+	0x0804, 0x3524, 0xd2fc, 0x0158, 0x080c, 0x4ad7, 0x0904, 0x3559,
+	0x7984, 0x9284, 0x9000, 0x080c, 0x5687, 0x0804, 0x3524, 0x080c,
+	0x4ad7, 0x0904, 0x3559, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x2009, 0x0009, 0x1904, 0x5468, 0x080c, 0x4aa4, 0x2009, 0x0002,
+	0x0904, 0x5468, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4aed, 0x701f, 0x53d9,
+	0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120,
+	0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x3559, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0x4ad7, 0x1110, 0x0804, 0x3559,
+	0x2009, 0x0043, 0x080c, 0xd013, 0x2009, 0x0003, 0x0904, 0x5468,
+	0x7007, 0x0003, 0x701f, 0x53fd, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x2009, 0x0004, 0x0904, 0x5468, 0x7984, 0x7aa8, 0x9284, 0x1000,
+	0x080c, 0x5687, 0x0804, 0x3524, 0x00c6, 0xaab0, 0x9284, 0xc000,
+	0x0140, 0xd2ec, 0x0168, 0x080c, 0x56e3, 0x1150, 0x2009, 0x0014,
+	0x04f0, 0x2061, 0x1800, 0x080c, 0x56e3, 0x2009, 0x0007, 0x15b8,
+	0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x56aa, 0x0050, 0xd2fc,
+	0x0178, 0x080c, 0x4ad5, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c,
+	0x5687, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438,
+	0x080c, 0x4ad5, 0x0510, 0x080c, 0x6972, 0x2009, 0x0009, 0x11b8,
+	0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc,
+	0x9084, 0xff00, 0x1190, 0x080c, 0x4ad5, 0x1108, 0x0070, 0x2009,
+	0x004b, 0x080c, 0xd013, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429,
+	0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0,
+	0x7aa8, 0xd2dc, 0x0904, 0x3556, 0x0016, 0x7984, 0x9284, 0x1000,
+	0xc0fd, 0x080c, 0x5687, 0x001e, 0x1904, 0x3556, 0x0804, 0x3524,
+	0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150,
+	0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5687, 0x001e,
+	0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3556, 0x080c, 0x56e3, 0x0120, 0x2009, 0x0007, 0x0804, 0x3556,
+	0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x65ff, 0x1904, 0x3559,
+	0x9186, 0x007f, 0x0138, 0x080c, 0x6972, 0x0120, 0x2009, 0x0009,
+	0x0804, 0x3556, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100,
+	0x8007, 0xa80a, 0x080c, 0xcd18, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3556, 0x7007, 0x0003, 0x701f, 0x54c6, 0x0005, 0xa808, 0x8007,
+	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3556, 0xa8e0,
+	0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007,
+	0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af0, 0x080c, 0x4aa4, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3556, 0x7984, 0x9194, 0xff00, 0x918c,
+	0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x19b3, 0x0040, 0x92c6,
+	0x0001, 0x1118, 0x7023, 0x19cd, 0x0010, 0x0804, 0x3559, 0x2009,
 	0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
-	0xaf60, 0x0804, 0x4af1, 0x7884, 0x908a, 0x1000, 0x1a04, 0x3552,
-	0x0126, 0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6,
-	0x2061, 0x19fa, 0x6142, 0x00ce, 0x012e, 0x0804, 0x351d, 0x00c6,
-	0x080c, 0x73b0, 0x1160, 0x080c, 0x7698, 0x080c, 0x601b, 0x9085,
-	0x0001, 0x080c, 0x73f7, 0x080c, 0x72e2, 0x080c, 0x0dd5, 0x2061,
-	0x1800, 0x6030, 0xc09d, 0x6032, 0x080c, 0x5eda, 0x00ce, 0x0005,
-	0x00c6, 0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x354f,
-	0x7884, 0x9005, 0x0188, 0x7888, 0x2061, 0x199c, 0x2c0c, 0x2062,
-	0x080c, 0x2c20, 0x01a0, 0x080c, 0x2c28, 0x0188, 0x080c, 0x2c30,
-	0x0170, 0x2162, 0x0804, 0x3552, 0x2061, 0x0100, 0x6038, 0x9086,
-	0x0007, 0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884,
-	0x9086, 0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a,
-	0x0026, 0x2011, 0x0003, 0x080c, 0xa639, 0x2011, 0x0002, 0x080c,
-	0xa643, 0x002e, 0x080c, 0xa526, 0x0036, 0x901e, 0x080c, 0xa59c,
-	0x003e, 0x60e3, 0x0000, 0x080c, 0xe9c8, 0x080c, 0xe9e3, 0x9085,
-	0x0001, 0x080c, 0x73f7, 0x9006, 0x080c, 0x2cef, 0x2001, 0x1800,
-	0x2003, 0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x351d, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x354f, 0x080c, 0x56e4, 0x0120,
-	0x2009, 0x0007, 0x0804, 0x354f, 0x7984, 0x7ea8, 0x96b4, 0x00ff,
-	0x080c, 0x6600, 0x1904, 0x3552, 0x9186, 0x007f, 0x0138, 0x080c,
-	0x696a, 0x0120, 0x2009, 0x0009, 0x0804, 0x354f, 0x080c, 0x4aa5,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x354f, 0xa867, 0x0000, 0xa868,
-	0xc0fd, 0xa86a, 0x080c, 0xcd01, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x354f, 0x7007, 0x0003, 0x701f, 0x5616, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x354f, 0xa8e0, 0xa866,
-	0xa834, 0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x4af1, 0xa898, 0x9086, 0x000d,
-	0x1904, 0x354f, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04,
-	0x563a, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118,
-	0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998,
-	0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x4ae1, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007,
-	0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x00c6, 0x2061, 0x19fa, 0x7984, 0x6152, 0x614e,
-	0x6057, 0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066,
-	0x7888, 0x6062, 0x788c, 0x605e, 0x2001, 0x1a08, 0x2044, 0x2001,
-	0x1a0f, 0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002,
-	0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x351d,
-	0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128,
-	0x0006, 0x080c, 0xcb68, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180,
-	0x1000, 0x2004, 0x905d, 0x0160, 0x080c, 0x6035, 0x080c, 0xadb1,
-	0x0110, 0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005,
-	0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010,
-	0x900e, 0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005,
-	0x0180, 0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186,
-	0x0080, 0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801,
-	0x002e, 0x001e, 0x8108, 0x1f04, 0x56b3, 0x015e, 0x012e, 0x0005,
-	0x2001, 0x1848, 0x2004, 0x0005, 0x2001, 0x1867, 0x2004, 0x0005,
-	0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001,
-	0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0003, 0x0005, 0x0016, 0x00e6, 0x2071, 0x189e, 0x7108, 0x910d,
-	0x710a, 0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04,
-	0x3552, 0x810c, 0x0016, 0x080c, 0x4aa5, 0x080c, 0x0f07, 0x2100,
-	0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x4aee,
-	0x701f, 0x570b, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8,
-	0x7aac, 0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44, 0xa770, 0xa074,
-	0x2071, 0x189e, 0x080c, 0x4af1, 0x701f, 0x571f, 0x0005, 0x2061,
-	0x18b8, 0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0f0f,
-	0x002e, 0x001e, 0x080c, 0x0fbc, 0x9006, 0xa802, 0xa806, 0x0804,
-	0x351d, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071,
-	0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x58da,
-	0x0068, 0xd08c, 0x0118, 0x080c, 0x57e3, 0x0040, 0xd094, 0x0118,
-	0x080c, 0x57b3, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e,
-	0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e,
-	0x0c68, 0x0006, 0x7098, 0x9005, 0x000e, 0x0120, 0x709b, 0x0000,
-	0x7093, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086,
-	0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490,
-	0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160,
-	0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009,
-	0x00f7, 0x080c, 0x5f97, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085,
-	0x0140, 0x6042, 0x6043, 0x0000, 0x7087, 0x0000, 0x70a3, 0x0001,
-	0x70c7, 0x0000, 0x70df, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000,
-	0x7097, 0x0000, 0x708b, 0x000f, 0x2009, 0x000f, 0x2011, 0x5e7d,
-	0x080c, 0x8562, 0x0005, 0x2001, 0x1869, 0x2004, 0xd08c, 0x0110,
-	0x705f, 0xffff, 0x7088, 0x9005, 0x1528, 0x2011, 0x5e7d, 0x080c,
-	0x84ca, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9,
-	0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x57c9, 0x6242, 0x709b,
-	0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242,
-	0x0048, 0x6242, 0x709b, 0x0000, 0x708f, 0x0000, 0x9006, 0x080c,
-	0x6020, 0x0000, 0x0005, 0x708c, 0x908a, 0x0003, 0x1a0c, 0x0dd5,
-	0x000b, 0x0005, 0x57ed, 0x583e, 0x58d9, 0x00f6, 0x0016, 0x6900,
-	0x918c, 0x0800, 0x708f, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000,
-	0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120,
-	0x1f04, 0x57fc, 0x080c, 0x0dd5, 0x68a0, 0x68a2, 0x689c, 0x689e,
-	0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837,
-	0x0020, 0x080c, 0x5ffc, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837,
-	0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1,
-	0x1c0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0xab07, 0x20e1, 0x0001,
+	0xaf60, 0x080c, 0x4aed, 0x701f, 0x5516, 0x0005, 0x2001, 0x182e,
+	0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0,
+	0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804,
+	0x3524, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002, 0x0804, 0x3556,
+	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
+	0x2099, 0x19b3, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x19cd,
+	0x0010, 0x0804, 0x3559, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860,
+	0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
+	0x0804, 0x4af0, 0x7884, 0x908a, 0x1000, 0x1a04, 0x3559, 0x0126,
+	0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061,
+	0x19fa, 0x6142, 0x00ce, 0x012e, 0x0804, 0x3524, 0x00c6, 0x080c,
+	0x73bc, 0x1160, 0x080c, 0x76a4, 0x080c, 0x601a, 0x9085, 0x0001,
+	0x080c, 0x7403, 0x080c, 0x72ee, 0x080c, 0x0dd5, 0x2061, 0x1800,
+	0x6030, 0xc09d, 0x6032, 0x080c, 0x5ed9, 0x00ce, 0x0005, 0x00c6,
+	0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3556, 0x7884,
+	0x9005, 0x0188, 0x7888, 0x2061, 0x199c, 0x2c0c, 0x2062, 0x080c,
+	0x2c20, 0x01a0, 0x080c, 0x2c28, 0x0188, 0x080c, 0x2c30, 0x0170,
+	0x2162, 0x0804, 0x3559, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007,
+	0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086,
+	0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026,
+	0x2011, 0x0003, 0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d,
+	0x002e, 0x080c, 0xa540, 0x0036, 0x901e, 0x080c, 0xa5b6, 0x003e,
+	0x60e3, 0x0000, 0x080c, 0xe9e9, 0x080c, 0xea04, 0x9085, 0x0001,
+	0x080c, 0x7403, 0x9006, 0x080c, 0x2cef, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x3524, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3556, 0x080c, 0x56e3, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x3556, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
+	0x65ff, 0x1904, 0x3559, 0x9186, 0x007f, 0x0138, 0x080c, 0x6972,
+	0x0120, 0x2009, 0x0009, 0x0804, 0x3556, 0x080c, 0x4aa4, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xcd1b, 0x1120, 0x2009, 0x0003, 0x0804, 0x3556,
+	0x7007, 0x0003, 0x701f, 0x5615, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x3556, 0xa8e0, 0xa866, 0xa834,
+	0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xaf60, 0x0804, 0x4af0, 0xa898, 0x9086, 0x000d, 0x1904,
+	0x3556, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5639,
+	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
+	0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986,
+	0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x4ae0, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007, 0x0001,
+	0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x00c6, 0x2061, 0x19fa, 0x7984, 0x6152, 0x614e, 0x6057,
+	0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888,
+	0x6062, 0x788c, 0x605e, 0x2001, 0x1a08, 0x2044, 0x2001, 0x1a0f,
+	0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b,
+	0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3524, 0x0126,
+	0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006,
+	0x080c, 0xcb82, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000,
+	0x2004, 0x905d, 0x0160, 0x080c, 0x6034, 0x080c, 0xadcb, 0x0110,
+	0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085,
+	0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e,
+	0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180,
+	0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080,
+	0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e,
+	0x001e, 0x8108, 0x1f04, 0x56b2, 0x015e, 0x012e, 0x0005, 0x2001,
+	0x1848, 0x2004, 0x0005, 0x2001, 0x1867, 0x2004, 0x0005, 0x0006,
+	0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e,
+	0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
+	0x0005, 0x0016, 0x00e6, 0x2071, 0x189e, 0x7108, 0x910d, 0x710a,
+	0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x3559,
+	0x810c, 0x0016, 0x080c, 0x4aa4, 0x080c, 0x0f07, 0x2100, 0x2238,
+	0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x4aed, 0x701f,
+	0x570a, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac,
+	0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44, 0xa770, 0xa074, 0x2071,
+	0x189e, 0x080c, 0x4af0, 0x701f, 0x571e, 0x0005, 0x2061, 0x18b8,
+	0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0f0f, 0x002e,
+	0x001e, 0x080c, 0x0fbc, 0x9006, 0xa802, 0xa806, 0x0804, 0x3524,
+	0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800,
+	0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x58d9, 0x0068,
+	0xd08c, 0x0118, 0x080c, 0x57e2, 0x0040, 0xd094, 0x0118, 0x080c,
+	0x57b2, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005,
+	0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68,
+	0x0006, 0x7098, 0x9005, 0x000e, 0x0120, 0x709b, 0x0000, 0x7093,
+	0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0,
+	0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294,
+	0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240,
+	0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7,
+	0x080c, 0x5f96, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140,
+	0x6042, 0x6043, 0x0000, 0x7087, 0x0000, 0x70a3, 0x0001, 0x70c7,
+	0x0000, 0x70df, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7097,
+	0x0000, 0x708b, 0x000f, 0x2009, 0x000f, 0x2011, 0x5e7c, 0x080c,
+	0x858b, 0x0005, 0x2001, 0x1869, 0x2004, 0xd08c, 0x0110, 0x705f,
+	0xffff, 0x7088, 0x9005, 0x1528, 0x2011, 0x5e7c, 0x080c, 0x84f3,
+	0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8,
+	0x6044, 0xd08c, 0x1168, 0x1f04, 0x57c8, 0x6242, 0x709b, 0x0000,
+	0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048,
+	0x6242, 0x709b, 0x0000, 0x708f, 0x0000, 0x9006, 0x080c, 0x601f,
+	0x0000, 0x0005, 0x708c, 0x908a, 0x0003, 0x1a0c, 0x0dd5, 0x000b,
+	0x0005, 0x57ec, 0x583d, 0x58d8, 0x00f6, 0x0016, 0x6900, 0x918c,
+	0x0800, 0x708f, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803,
+	0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04,
+	0x57fb, 0x080c, 0x0dd5, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898,
+	0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020,
+	0x080c, 0x5ffb, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e,
+	0x20a9, 0x0004, 0x4003, 0x080c, 0xab21, 0x20e1, 0x0001, 0x2099,
+	0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003,
+	0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5ead, 0x00fe, 0x9006,
+	0x7092, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x7090, 0x7093,
+	0x0000, 0x9025, 0x0904, 0x58b5, 0x6020, 0xd0b4, 0x1904, 0x58b3,
+	0x71a0, 0x81ff, 0x0904, 0x58a1, 0x9486, 0x000c, 0x1904, 0x58ae,
+	0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5ff4, 0x2011, 0x0260,
+	0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318,
+	0x1f04, 0x585a, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94,
+	0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708f, 0x0002,
+	0x709b, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5e83, 0x080c, 0x858b,
+	0x080c, 0x5ffb, 0x04c0, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7930,
+	0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c,
+	0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5ff4, 0x2011,
+	0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102,
+	0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x5895, 0x0078, 0x70a3,
+	0x0000, 0x080c, 0x5ff4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
+	0x0001, 0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008,
+	0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100,
+	0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0xab21, 0x20e1, 0x0001,
 	0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014,
-	0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5eae, 0x00fe,
-	0x9006, 0x7092, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x7090,
-	0x7093, 0x0000, 0x9025, 0x0904, 0x58b6, 0x6020, 0xd0b4, 0x1904,
-	0x58b4, 0x71a0, 0x81ff, 0x0904, 0x58a2, 0x9486, 0x000c, 0x1904,
-	0x58af, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5ff5, 0x2011,
-	0x0260, 0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210,
-	0x8318, 0x1f04, 0x585b, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b,
-	0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708f,
-	0x0002, 0x709b, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5e84, 0x080c,
-	0x8562, 0x080c, 0x5ffc, 0x04c0, 0x080c, 0x5ff5, 0x2079, 0x0260,
-	0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900,
-	0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5ff5,
-	0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304,
-	0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x5896, 0x0078,
-	0x70a3, 0x0000, 0x080c, 0x5ff5, 0x20e1, 0x0000, 0x2099, 0x0260,
-	0x20e9, 0x0001, 0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043,
-	0x0008, 0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085,
-	0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0xab07, 0x20e1,
-	0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
-	0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19f1, 0x2013, 0x0000,
-	0x7093, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa250,
-	0x08d8, 0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c, 0x0dd5, 0x000b,
-	0x0005, 0x590b, 0x591e, 0x5947, 0x5967, 0x598d, 0x59bc, 0x59e2,
-	0x5a1a, 0x5a40, 0x5a6e, 0x5aa9, 0x5ae1, 0x5aff, 0x5b2a, 0x5b4c,
-	0x5b67, 0x5b71, 0x5ba5, 0x5bcb, 0x5bfa, 0x5c20, 0x5c58, 0x5c9c,
-	0x5cd9, 0x5cfa, 0x5d53, 0x5d75, 0x5da3, 0x5da3, 0x00c6, 0x2061,
-	0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9,
-	0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
-	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x709b, 0x0001, 0x2009,
-	0x07d0, 0x2011, 0x5e84, 0x080c, 0x8562, 0x0005, 0x00f6, 0x7090,
-	0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c,
-	0x5ff5, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834,
-	0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
-	0x70c7, 0x0001, 0x2011, 0x5e84, 0x080c, 0x84ca, 0x709b, 0x0010,
-	0x080c, 0x5b71, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6,
-	0x709b, 0x0003, 0x6043, 0x0004, 0x2011, 0x5e84, 0x080c, 0x84ca,
-	0x080c, 0x5f79, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000,
-	0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04,
-	0x595c, 0x60c3, 0x0014, 0x080c, 0x5eae, 0x00fe, 0x0005, 0x00f6,
-	0x7090, 0x9005, 0x0500, 0x2011, 0x5e84, 0x080c, 0x84ca, 0x9086,
-	0x0014, 0x11b8, 0x080c, 0x5ff5, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0004, 0x0029,
-	0x0010, 0x080c, 0x5fd1, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0005,
-	0x080c, 0x5f79, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000,
-	0x080c, 0x5ff5, 0x080c, 0x5fd8, 0x1170, 0x7084, 0x9005, 0x1158,
-	0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e31,
-	0x0168, 0x080c, 0x5fae, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
-	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
-	0x080c, 0x5eae, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
-	0x2011, 0x5e84, 0x080c, 0x84ca, 0x9086, 0x0014, 0x11b8, 0x080c,
-	0x5ff5, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
-	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
-	0x70c7, 0x0001, 0x709b, 0x0006, 0x0029, 0x0010, 0x080c, 0x5fd1,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0007, 0x080c, 0x5f79, 0x2079,
-	0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5ff5, 0x080c,
-	0x5fd8, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff,
-	0x0180, 0x9180, 0x331e, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011,
-	0x0008, 0x080c, 0x5e31, 0x0180, 0x080c, 0x4fe2, 0x0110, 0x080c,
-	0x28a7, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eae,
-	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e84,
-	0x080c, 0x84ca, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff5, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160,
-	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x709b, 0x0008, 0x0029, 0x0010, 0x080c, 0x5fd1, 0x00fe, 0x0005,
-	0x00f6, 0x709b, 0x0009, 0x080c, 0x5f79, 0x2079, 0x0240, 0x7833,
-	0x1105, 0x7837, 0x0100, 0x080c, 0x5fd8, 0x1150, 0x7084, 0x9005,
-	0x1138, 0x080c, 0x5da4, 0x1188, 0x9085, 0x0001, 0x080c, 0x28a7,
-	0x20a9, 0x0008, 0x080c, 0x5ff5, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x4003, 0x60c3, 0x000c, 0x2011, 0x19f1, 0x2013, 0x0000, 0x7093,
+	0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa26a, 0x08d8,
+	0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c, 0x0dd5, 0x000b, 0x0005,
+	0x590a, 0x591d, 0x5946, 0x5966, 0x598c, 0x59bb, 0x59e1, 0x5a19,
+	0x5a3f, 0x5a6d, 0x5aa8, 0x5ae0, 0x5afe, 0x5b29, 0x5b4b, 0x5b66,
+	0x5b70, 0x5ba4, 0x5bca, 0x5bf9, 0x5c1f, 0x5c57, 0x5c9b, 0x5cd8,
+	0x5cf9, 0x5d52, 0x5d74, 0x5da2, 0x5da2, 0x00c6, 0x2061, 0x1800,
+	0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006,
+	0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
+	0x2061, 0x0100, 0x6043, 0x0002, 0x709b, 0x0001, 0x2009, 0x07d0,
+	0x2011, 0x5e83, 0x080c, 0x858b, 0x0005, 0x00f6, 0x7090, 0x9086,
+	0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5ff4,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005,
+	0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
+	0x0001, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x709b, 0x0010, 0x080c,
+	0x5b70, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b,
+	0x0003, 0x6043, 0x0004, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x080c,
+	0x5f78, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9,
+	0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x595b,
+	0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x0500, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014,
+	0x11b8, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
+	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
+	0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0004, 0x0029, 0x0010,
+	0x080c, 0x5fd0, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0005, 0x080c,
+	0x5f78, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c,
+	0x5ff4, 0x080c, 0x5fd7, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c,
+	0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e30, 0x0168,
+	0x080c, 0x5fad, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
 	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
-	0x5eae, 0x0010, 0x080c, 0x58fe, 0x00fe, 0x0005, 0x00f6, 0x7090,
-	0x9005, 0x05a8, 0x2011, 0x5e84, 0x080c, 0x84ca, 0x9086, 0x0014,
-	0x1560, 0x080c, 0x5ff5, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
-	0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160,
+	0x5ead, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011,
+	0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff4,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005,
+	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
+	0x0001, 0x709b, 0x0006, 0x0029, 0x0010, 0x080c, 0x5fd0, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x0007, 0x080c, 0x5f78, 0x2079, 0x0240,
+	0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5ff4, 0x080c, 0x5fd7,
+	0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180,
+	0x9180, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008,
+	0x080c, 0x5e30, 0x0180, 0x080c, 0x4fe1, 0x0110, 0x080c, 0x28a7,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e83, 0x080c,
+	0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff4, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x0008, 0x0029, 0x0010, 0x080c, 0x5fd0, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0009, 0x080c, 0x5f78, 0x2079, 0x0240, 0x7833, 0x1105,
+	0x7837, 0x0100, 0x080c, 0x5fd7, 0x1150, 0x7084, 0x9005, 0x1138,
+	0x080c, 0x5da3, 0x1188, 0x9085, 0x0001, 0x080c, 0x28a7, 0x20a9,
+	0x0008, 0x080c, 0x5ff4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead,
+	0x0010, 0x080c, 0x58fd, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
+	0x05a8, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014, 0x1560,
+	0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520,
+	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x7097, 0x0000, 0x709b,
+	0x000e, 0x080c, 0x5b4b, 0x0010, 0x080c, 0x5fd0, 0x00fe, 0x0005,
+	0x00f6, 0x709b, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0,
+	0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5f78, 0x2079,
+	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5fd7, 0x0118,
+	0x2013, 0x0000, 0x0020, 0x7060, 0x9085, 0x0100, 0x2012, 0x20a9,
+	0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108,
+	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
+	0x1f04, 0x5acd, 0x60c3, 0x0084, 0x080c, 0x5ead, 0x00fe, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011, 0x5e83, 0x080c, 0x84f3,
+	0x9086, 0x0084, 0x1178, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x709b, 0x000c,
+	0x0029, 0x0010, 0x080c, 0x5fd0, 0x00fe, 0x0005, 0x00f6, 0x709b,
+	0x000d, 0x080c, 0x5f78, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837,
+	0x0000, 0x080c, 0x5ff4, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009,
+	0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
+	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
+	0x0260, 0x1f04, 0x5b11, 0x60c3, 0x0084, 0x080c, 0x5ead, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e83, 0x080c,
+	0x84f3, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ff4, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7097,
+	0x0001, 0x080c, 0x5f4a, 0x709b, 0x000e, 0x0029, 0x0010, 0x080c,
+	0x5fd0, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x601f, 0x709b,
+	0x000f, 0x7093, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f,
+	0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009,
+	0x07d0, 0x2011, 0x5e83, 0x080c, 0x84e7, 0x0005, 0x7090, 0x9005,
+	0x0130, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x709b, 0x0000, 0x0005,
+	0x709b, 0x0011, 0x080c, 0xab21, 0x080c, 0x5ff4, 0x20e1, 0x0000,
+	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x7490, 0x9480,
+	0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003,
+	0x080c, 0x5fd7, 0x11a0, 0x717c, 0x81ff, 0x0188, 0x900e, 0x7080,
+	0x9084, 0x00ff, 0x0160, 0x080c, 0x283e, 0x9186, 0x007e, 0x0138,
+	0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5e30, 0x60c3,
+	0x0014, 0x080c, 0x5ead, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x0012, 0x0029, 0x0010, 0x7093, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013, 0x080c, 0x5f86, 0x2079,
+	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5ff4, 0x080c,
+	0x5fd7, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff,
+	0x0138, 0x2011, 0x0008, 0x080c, 0x5e30, 0x0168, 0x080c, 0x5fad,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e83, 0x080c,
+	0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff4, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x0014, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0015, 0x080c, 0x5f86, 0x2079, 0x0240, 0x7833, 0x1104,
+	0x7837, 0x0000, 0x080c, 0x5ff4, 0x080c, 0x5fd7, 0x11b8, 0x7084,
+	0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x3325,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5e30,
+	0x0180, 0x080c, 0x4fe1, 0x0110, 0x080c, 0x28a7, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x05f0, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086,
+	0x0014, 0x15a8, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e,
+	0x1168, 0x9085, 0x0001, 0x080c, 0x601f, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x0080, 0x9005, 0x11b8,
 	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x709b, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc,
-	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x7097, 0x0000,
-	0x709b, 0x000e, 0x080c, 0x5b4c, 0x0010, 0x080c, 0x5fd1, 0x00fe,
-	0x0005, 0x00f6, 0x709b, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001,
-	0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5f79,
-	0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5fd8,
-	0x0118, 0x2013, 0x0000, 0x0020, 0x7060, 0x9085, 0x0100, 0x2012,
-	0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210,
-	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
-	0x0240, 0x1f04, 0x5ace, 0x60c3, 0x0084, 0x080c, 0x5eae, 0x00fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011, 0x5e84, 0x080c,
-	0x84ca, 0x9086, 0x0084, 0x1178, 0x080c, 0x5ff5, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x709b,
-	0x000c, 0x0029, 0x0010, 0x080c, 0x5fd1, 0x00fe, 0x0005, 0x00f6,
-	0x709b, 0x000d, 0x080c, 0x5f79, 0x2079, 0x0240, 0x7833, 0x1107,
-	0x7837, 0x0000, 0x080c, 0x5ff5, 0x20a9, 0x0040, 0x2011, 0x026e,
-	0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
-	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
-	0x2011, 0x0260, 0x1f04, 0x5b12, 0x60c3, 0x0084, 0x080c, 0x5eae,
-	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e84,
-	0x080c, 0x84ca, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ff5, 0x2079,
+	0x9085, 0x0001, 0x080c, 0x601f, 0x7097, 0x0000, 0x7a38, 0xd2f4,
+	0x0110, 0x70df, 0x0008, 0x709b, 0x0016, 0x0029, 0x0010, 0x7093,
+	0x0000, 0x00fe, 0x0005, 0x080c, 0xab21, 0x080c, 0x5ff4, 0x20e1,
+	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011,
+	0x024d, 0x2012, 0x2011, 0x026e, 0x709b, 0x0017, 0x080c, 0x5fd7,
+	0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5da3, 0x1188, 0x9085,
+	0x0001, 0x080c, 0x28a7, 0x20a9, 0x0008, 0x080c, 0x5ff4, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
+	0x60c3, 0x0014, 0x080c, 0x5ead, 0x0010, 0x080c, 0x58fd, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011, 0x5e83, 0x080c, 0x84f3,
+	0x9086, 0x0084, 0x1190, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c,
+	0x601f, 0x709b, 0x0018, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x0019, 0x080c, 0x5f86, 0x2079, 0x0240,
+	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5ff4, 0x2009, 0x026e,
+	0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186,
+	0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04,
+	0x5d0c, 0x2039, 0x1c0e, 0x080c, 0x5fd7, 0x11e8, 0x2728, 0x2514,
+	0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007,
+	0x9205, 0x202a, 0x7060, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414,
+	0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff,
+	0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e,
+	0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812,
+	0x2009, 0x0240, 0x1f04, 0x5d3f, 0x60c3, 0x0084, 0x080c, 0x5ead,
+	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e83,
+	0x080c, 0x84f3, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ff4, 0x2079,
 	0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140,
-	0x7097, 0x0001, 0x080c, 0x5f4b, 0x709b, 0x000e, 0x0029, 0x0010,
-	0x080c, 0x5fd1, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x6020,
-	0x709b, 0x000f, 0x7093, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85,
-	0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004,
-	0x2009, 0x07d0, 0x2011, 0x5e84, 0x080c, 0x84be, 0x0005, 0x7090,
-	0x9005, 0x0130, 0x2011, 0x5e84, 0x080c, 0x84ca, 0x709b, 0x0000,
-	0x0005, 0x709b, 0x0011, 0x080c, 0xab07, 0x080c, 0x5ff5, 0x20e1,
-	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x7490,
-	0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8,
-	0x4003, 0x080c, 0x5fd8, 0x11a0, 0x717c, 0x81ff, 0x0188, 0x900e,
-	0x7080, 0x9084, 0x00ff, 0x0160, 0x080c, 0x283e, 0x9186, 0x007e,
-	0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5e31,
-	0x60c3, 0x0014, 0x080c, 0x5eae, 0x0005, 0x00f6, 0x7090, 0x9005,
-	0x0500, 0x2011, 0x5e84, 0x080c, 0x84ca, 0x9086, 0x0014, 0x11b8,
-	0x080c, 0x5ff5, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178,
-	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
-	0x1110, 0x70c7, 0x0001, 0x709b, 0x0012, 0x0029, 0x0010, 0x7093,
-	0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013, 0x080c, 0x5f87,
-	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5ff5,
-	0x080c, 0x5fd8, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c, 0x9186,
-	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e31, 0x0168, 0x080c,
-	0x5fae, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eae,
-	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e84,
-	0x080c, 0x84ca, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff5, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160,
-	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x709b, 0x0014, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005,
-	0x00f6, 0x709b, 0x0015, 0x080c, 0x5f87, 0x2079, 0x0240, 0x7833,
-	0x1104, 0x7837, 0x0000, 0x080c, 0x5ff5, 0x080c, 0x5fd8, 0x11b8,
-	0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180, 0x9180,
-	0x331e, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
-	0x5e31, 0x0180, 0x080c, 0x4fe2, 0x0110, 0x080c, 0x28a7, 0x20a9,
-	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eae, 0x00fe, 0x0005,
-	0x00f6, 0x7090, 0x9005, 0x05f0, 0x2011, 0x5e84, 0x080c, 0x84ca,
-	0x9086, 0x0014, 0x15a8, 0x080c, 0x5ff5, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100,
-	0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x6020, 0x7a38, 0xd2fc,
-	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x0080, 0x9005,
-	0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
-	0x0001, 0x9085, 0x0001, 0x080c, 0x6020, 0x7097, 0x0000, 0x7a38,
-	0xd2f4, 0x0110, 0x70df, 0x0008, 0x709b, 0x0016, 0x0029, 0x0010,
-	0x7093, 0x0000, 0x00fe, 0x0005, 0x080c, 0xab07, 0x080c, 0x5ff5,
-	0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240,
-	0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100,
-	0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x709b, 0x0017, 0x080c,
-	0x5fd8, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5da4, 0x1188,
-	0x9085, 0x0001, 0x080c, 0x28a7, 0x20a9, 0x0008, 0x080c, 0x5ff5,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x4003, 0x60c3, 0x0014, 0x080c, 0x5eae, 0x0010, 0x080c, 0x58fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011, 0x5e84, 0x080c,
-	0x84ca, 0x9086, 0x0084, 0x1190, 0x080c, 0x5ff5, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006,
-	0x080c, 0x6020, 0x709b, 0x0018, 0x0029, 0x0010, 0x7093, 0x0000,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0019, 0x080c, 0x5f87, 0x2079,
-	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5ff5, 0x2009,
-	0x026e, 0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108,
-	0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260,
-	0x1f04, 0x5d0d, 0x2039, 0x1c0e, 0x080c, 0x5fd8, 0x11e8, 0x2728,
-	0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff,
-	0x8007, 0x9205, 0x202a, 0x7060, 0x2310, 0x8214, 0x92a0, 0x1c0e,
-	0x2414, 0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294,
-	0x00ff, 0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e,
-	0x270e, 0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000,
-	0x6812, 0x2009, 0x0240, 0x1f04, 0x5d40, 0x60c3, 0x0084, 0x080c,
-	0x5eae, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011,
-	0x5e84, 0x080c, 0x84ca, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ff5,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005,
-	0x1140, 0x7097, 0x0001, 0x080c, 0x5f4b, 0x709b, 0x001a, 0x0029,
-	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c,
-	0x6020, 0x709b, 0x001b, 0x080c, 0xab07, 0x080c, 0x5ff5, 0x2011,
-	0x0260, 0x2009, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007,
-	0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186,
-	0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814,
-	0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5d8c, 0x60c3, 0x0084,
-	0x080c, 0x5eae, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1848,
-	0x252c, 0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0,
-	0x080c, 0x5ff5, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9,
-	0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200,
-	0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008,
-	0x8211, 0x1f04, 0x5dbe, 0x0804, 0x5e2d, 0x82ff, 0x1160, 0xd5d4,
-	0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904,
-	0x5e2d, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4,
-	0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008,
-	0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04,
-	0x5de4, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04,
-	0x5df6, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039,
-	0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04,
-	0x5e05, 0x755e, 0x95c8, 0x331e, 0x292d, 0x95ac, 0x00ff, 0x7582,
-	0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2887, 0x001e, 0x60e7,
-	0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7087, 0x0001,
-	0x20e9, 0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9,
-	0x0008, 0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e,
-	0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1,
-	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0,
-	0x4003, 0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026,
-	0x2001, 0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0,
-	0x2118, 0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021,
-	0x0001, 0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029,
-	0x026e, 0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715e,
-	0x91a0, 0x331e, 0x242d, 0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536,
-	0x0016, 0x2508, 0x080c, 0x2887, 0x001e, 0x60e7, 0x0000, 0x65ea,
-	0x7087, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800,
-	0x708b, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100,
-	0x2071, 0x0140, 0x080c, 0x5f3a, 0x080c, 0xa259, 0x7004, 0x9084,
-	0x4000, 0x0110, 0x080c, 0x2cff, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x1826, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7,
-	0x080c, 0x5f97, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842,
-	0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5,
-	0x2012, 0x2011, 0x19f1, 0x2013, 0x0000, 0x7093, 0x0000, 0x012e,
-	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa250, 0x6144, 0xd184,
-	0x0120, 0x7198, 0x918d, 0x2000, 0x0018, 0x718c, 0x918d, 0x1000,
-	0x2011, 0x1999, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5e84, 0x080c,
-	0x8562, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xadb8, 0x2009, 0x00f7, 0x080c, 0x5f97, 0x2061, 0x19fa,
-	0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003,
-	0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
-	0x1999, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f06, 0x080c,
-	0x84be, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0xa259,
-	0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2cff,
-	0x080c, 0x73b8, 0x0188, 0x080c, 0x73d3, 0x1170, 0x080c, 0x76a2,
-	0x0016, 0x080c, 0x2956, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c,
-	0x769d, 0x080c, 0x72e2, 0x0050, 0x2009, 0x0001, 0x080c, 0x2c3e,
-	0x2001, 0x0001, 0x080c, 0x27ea, 0x080c, 0x5eda, 0x012e, 0x000e,
-	0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026,
-	0x0036, 0x2011, 0x8017, 0x2001, 0x1999, 0x201c, 0x080c, 0x4b05,
-	0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1,
-	0x1c80, 0x080c, 0x5ff5, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099,
-	0x20a9, 0x0020, 0x080c, 0x5fef, 0x2099, 0x0260, 0x20a1, 0x1c92,
-	0x0051, 0x20a9, 0x000e, 0x080c, 0x5ff2, 0x2099, 0x0260, 0x20a1,
-	0x1cb2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104,
-	0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x5f6f, 0x002e, 0x001e,
-	0x0005, 0x080c, 0xab07, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9,
-	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c,
-	0xab07, 0x080c, 0x5ff5, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
-	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6,
-	0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005,
-	0x1138, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010,
-	0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046,
-	0x080c, 0x6966, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c,
-	0xe58d, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
-	0x900e, 0x080c, 0x3187, 0x080c, 0xd216, 0x0140, 0x0036, 0x2019,
-	0xffff, 0x2021, 0x0007, 0x080c, 0x4cbc, 0x003e, 0x004e, 0x001e,
-	0x0005, 0x080c, 0x5eda, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005,
-	0x0006, 0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005,
-	0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c,
-	0x918d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009,
-	0x0001, 0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084,
-	0xffc0, 0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6,
-	0x9006, 0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004,
-	0x2079, 0x1c00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef,
-	0x7813, 0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e,
-	0x015e, 0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005,
-	0x2001, 0x19a6, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000,
-	0x0005, 0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a,
-	0x8108, 0x1f04, 0x602f, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156,
-	0x0136, 0x0146, 0x2069, 0x1847, 0x9006, 0xb802, 0xb8ce, 0xb807,
-	0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x331e, 0x231d, 0x939c,
-	0x00ff, 0xbb16, 0x0016, 0x0026, 0xb8c2, 0x080c, 0xadb1, 0x1120,
-	0x9192, 0x007e, 0x1208, 0xbbc2, 0x20a9, 0x0004, 0xb8c4, 0x20e8,
-	0xb9c8, 0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004,
-	0x9198, 0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842,
-	0xb84e, 0xb852, 0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a,
-	0xb86f, 0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893,
-	0x0008, 0xb896, 0xb89a, 0xb89e, 0xb8be, 0xb9a2, 0x0096, 0xb8a4,
-	0x904d, 0x0110, 0x080c, 0x1031, 0xb8a7, 0x0000, 0x009e, 0x9006,
-	0xb84a, 0x6810, 0xb83a, 0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac,
-	0x9005, 0x0198, 0x00c6, 0x2060, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5,
-	0x2001, 0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0dd5, 0x080c, 0x8958,
-	0x00ce, 0x090c, 0x8cfc, 0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff,
-	0xb842, 0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126,
-	0x2091, 0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000,
-	0x1a04, 0x611d, 0x9182, 0x0800, 0x1a04, 0x6121, 0x2001, 0x180c,
-	0x2004, 0x9084, 0x0003, 0x1904, 0x6127, 0x9188, 0x1000, 0x2104,
-	0x905d, 0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508,
-	0xb8a4, 0x900d, 0x1904, 0x6139, 0xb850, 0x900d, 0x1148, 0xa802,
-	0x2900, 0xb852, 0xb84e, 0x080c, 0x90e4, 0x9006, 0x012e, 0x0005,
-	0x00a6, 0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852,
-	0x0c90, 0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e,
-	0x0498, 0x9082, 0x0006, 0x1290, 0x080c, 0xadb1, 0x1160, 0xb8a0,
-	0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029,
-	0x2009, 0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c,
-	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118,
-	0x2001, 0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118,
-	0x2009, 0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e,
-	0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001,
-	0x180c, 0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d,
-	0x09a8, 0x080c, 0x696a, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804,
-	0x60d0, 0x080c, 0x679c, 0x0904, 0x60e9, 0x0804, 0x60d4, 0x00b6,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0xa874, 0x908e, 0x00ff, 0x1120,
-	0x2001, 0x196b, 0x205c, 0x0060, 0xa974, 0x9182, 0x0800, 0x1690,
-	0x9188, 0x1000, 0x2104, 0x905d, 0x01d0, 0x080c, 0x690a, 0x11d0,
-	0x080c, 0xadf1, 0x0570, 0x2b00, 0x6012, 0x2900, 0x6016, 0x6023,
-	0x0009, 0x600b, 0x0000, 0xa874, 0x908e, 0x00ff, 0x1110, 0x600b,
-	0x8000, 0x2009, 0x0043, 0x080c, 0xaec2, 0x9006, 0x00b0, 0x2001,
-	0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
-	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
-	0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be,
-	0x0005, 0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x6207, 0x9188, 0x1000,
-	0x2104, 0x905d, 0x0904, 0x61df, 0xb8a0, 0x9086, 0x007f, 0x0178,
-	0x080c, 0x6972, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004,
-	0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x696a, 0x1598, 0xa87c,
-	0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010,
-	0x080c, 0xcb09, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x6209,
-	0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x6209,
-	0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0xadf1,
-	0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023,
-	0x000a, 0x2009, 0x0003, 0x080c, 0xaec2, 0x9006, 0x0458, 0x2001,
-	0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0xadb1, 0x1160,
-	0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001,
-	0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009,
-	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184,
-	0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001,
-	0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c,
-	0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005,
-	0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518,
-	0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800, 0x9182,
-	0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98, 0xab94,
-	0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001,
-	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
-	0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
-	0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be, 0x00fe,
-	0x0005, 0x629e, 0x6259, 0x6270, 0x629e, 0x629e, 0x629e, 0x629e,
-	0x629e, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x659f, 0x0148,
-	0x9046, 0xb810, 0x9306, 0x1904, 0x62a6, 0xb814, 0x9206, 0x15f0,
-	0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x49b8, 0x0150, 0x04b0,
-	0x080c, 0x6600, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206,
-	0x1568, 0x080c, 0xadf1, 0x0530, 0x2b00, 0x6012, 0x080c, 0xcf90,
-	0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086,
-	0x0001, 0x1170, 0x080c, 0x31bc, 0x9006, 0x080c, 0x653c, 0x2001,
-	0x0002, 0x080c, 0x6550, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002,
-	0x2009, 0x0003, 0x080c, 0xaec2, 0x9006, 0x0068, 0x2001, 0x0001,
-	0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0028,
-	0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6,
-	0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6, 0x0015,
-	0x0904, 0x648d, 0x90c6, 0x0056, 0x0904, 0x6491, 0x90c6, 0x0066,
-	0x0904, 0x6495, 0x90c6, 0x0067, 0x0904, 0x6499, 0x90c6, 0x0068,
-	0x0904, 0x649d, 0x90c6, 0x0071, 0x0904, 0x64a1, 0x90c6, 0x0074,
-	0x0904, 0x64a5, 0x90c6, 0x007c, 0x0904, 0x64a9, 0x90c6, 0x007e,
-	0x0904, 0x64ad, 0x90c6, 0x0037, 0x0904, 0x64b1, 0x9016, 0x2079,
-	0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x6488, 0x9182, 0x0800,
-	0x1a04, 0x6488, 0x080c, 0x6600, 0x1198, 0xb804, 0x9084, 0x00ff,
-	0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c,
-	0xadb1, 0x1904, 0x6471, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x6471,
-	0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x63d1,
-	0x90c6, 0x0064, 0x0904, 0x63fa, 0x2008, 0x0804, 0x6393, 0xa998,
-	0xa8b0, 0x2040, 0x080c, 0xadb1, 0x1120, 0x9182, 0x007f, 0x0a04,
-	0x6393, 0x9186, 0x00ff, 0x0904, 0x6393, 0x9182, 0x0800, 0x1a04,
-	0x6393, 0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188, 0x7880, 0x0096,
-	0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x6393, 0x99cc,
-	0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x6393, 0x080c,
-	0x49b8, 0x0904, 0x639d, 0x900e, 0x9016, 0x90c6, 0x4000, 0x15e0,
-	0x0006, 0x080c, 0x6820, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
-	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c,
-	0x0f7c, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035,
-	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c,
-	0x0f7c, 0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305, 0xabd0, 0x9305,
-	0xabd4, 0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305, 0xabe0, 0x9305,
-	0x9005, 0x0510, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408,
-	0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6,
-	0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005,
-	0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e,
-	0x2001, 0x0030, 0x900e, 0x0478, 0x000e, 0x080c, 0xadf1, 0x1130,
-	0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c78, 0x2b00, 0x6012,
-	0x080c, 0xcf90, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c,
-	0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x31bc,
-	0x012e, 0x9006, 0x080c, 0x653c, 0x2001, 0x0002, 0x080c, 0x6550,
-	0x2009, 0x0002, 0x080c, 0xaec2, 0xa8b0, 0xd094, 0x0118, 0xb8cc,
-	0xc08d, 0xb8ce, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be,
-	0x0005, 0x080c, 0x56e4, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998,
-	0xaeb0, 0x080c, 0x6600, 0x1904, 0x638e, 0x9186, 0x007f, 0x0130,
-	0x080c, 0x696a, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c,
-	0x0fff, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e,
-	0xa806, 0x080c, 0xcd01, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005,
-	0x0804, 0x6395, 0xa998, 0xaeb0, 0x080c, 0x6600, 0x1904, 0x638e,
-	0x0096, 0x080c, 0x0fff, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804,
-	0x644e, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b,
-	0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0,
-	0xbbc8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0f7c, 0x009e, 0xa87b,
-	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c,
-	0x56d0, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c,
-	0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x696a, 0x0118, 0xa89b,
-	0x0009, 0x0080, 0x080c, 0x56e4, 0x0118, 0xa89b, 0x0007, 0x0050,
-	0x080c, 0xcce4, 0x1904, 0x63ca, 0x2009, 0x0003, 0x2001, 0x4005,
-	0x0804, 0x6395, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
-	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
-	0x2041, 0x1243, 0x080c, 0xb360, 0x1904, 0x63ca, 0x2009, 0x0002,
-	0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x63cb, 0x2009, 0x180c,
-	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118,
-	0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x63cb,
-	0x2001, 0x0029, 0x900e, 0x0804, 0x63cb, 0x080c, 0x3742, 0x0804,
-	0x63cc, 0x080c, 0x540d, 0x0804, 0x63cc, 0x080c, 0x4548, 0x0804,
-	0x63cc, 0x080c, 0x45c1, 0x0804, 0x63cc, 0x080c, 0x461d, 0x0804,
-	0x63cc, 0x080c, 0x4a7b, 0x0804, 0x63cc, 0x080c, 0x4d32, 0x0804,
-	0x63cc, 0x080c, 0x5078, 0x0804, 0x63cc, 0x080c, 0x5271, 0x0804,
-	0x63cc, 0x080c, 0x3958, 0x0804, 0x63cc, 0x00b6, 0xa974, 0xae78,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268,
-	0x9188, 0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x696a, 0x1148,
-	0x00e9, 0x080c, 0x672b, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
-	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001,
-	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802,
-	0x009e, 0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852,
-	0xb84e, 0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c,
-	0x9005, 0x0170, 0x00e6, 0x2071, 0x19e7, 0x7004, 0x9086, 0x0002,
-	0x0168, 0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005,
-	0x2900, 0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06,
-	0x1d80, 0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002,
-	0x00ae, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c,
-	0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905,
-	0x012e, 0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108,
-	0xb852, 0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026,
-	0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285,
-	0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005,
-	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04,
-	0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c,
-	0x6966, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110,
-	0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006,
-	0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0dd5, 0x000e,
-	0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091,
-	0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168,
-	0xb89c, 0xd0a4, 0x0150, 0x080c, 0x6962, 0x1138, 0x9284, 0x00ff,
-	0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff,
-	0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182,
-	0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190,
-	0x1000, 0x2204, 0x905d, 0x1188, 0x0096, 0x080c, 0x0fff, 0x2958,
-	0x009e, 0x0168, 0x2b00, 0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6,
-	0x9006, 0xb8a6, 0xb8ae, 0x080c, 0x6035, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091,
-	0x8000, 0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458,
-	0x00d6, 0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000,
-	0xb8a4, 0x904d, 0x0110, 0x080c, 0x1031, 0x00d6, 0x00c6, 0xb8bc,
-	0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c,
-	0xcb1b, 0x0110, 0x080c, 0x0fb1, 0x080c, 0xae47, 0x00ce, 0x0c88,
-	0x00ce, 0x00de, 0x2b48, 0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c,
-	0x1041, 0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005,
-	0x0016, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6,
-	0x0156, 0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c,
-	0xb802, 0x080c, 0x73b0, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120,
-	0x080c, 0xadb1, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6,
-	0x2061, 0x1982, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a,
-	0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110,
-	0x2001, 0x0001, 0x6886, 0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e,
-	0x7048, 0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276,
-	0xb8c4, 0x20e8, 0xb8c8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004,
-	0x4003, 0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004,
-	0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144,
-	0xb96e, 0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817,
-	0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182,
-	0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218,
-	0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006,
-	0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182,
-	0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218,
-	0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e,
-	0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260,
-	0x7034, 0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbcc,
-	0xc384, 0xba00, 0x2009, 0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec,
-	0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138,
-	0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc,
-	0xba02, 0xbbce, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff,
-	0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6,
-	0x01d6, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084,
-	0xffc0, 0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001,
-	0x4002, 0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0dd5,
-	0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06,
-	0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0fff, 0x0170,
-	0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x67bc, 0xa807, 0x0001,
-	0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
-	0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800,
-	0x9005, 0x1150, 0x080c, 0x67cb, 0x1158, 0xa804, 0x908a, 0x0002,
-	0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x1031, 0xb8a7, 0x0000,
-	0x009e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x90e4,
-	0x012e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126,
-	0x2091, 0x8000, 0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff,
-	0x0500, 0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c,
-	0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048,
-	0x0c70, 0x080c, 0xa678, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e,
-	0x0020, 0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952,
-	0x89ff, 0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001,
-	0x0005, 0x080c, 0x6820, 0x0128, 0x080c, 0xcbd8, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x6820, 0x0128, 0x080c, 0xcb7d, 0x0010,
-	0x9085, 0x0001, 0x0005, 0x080c, 0x6820, 0x0128, 0x080c, 0xcbd5,
-	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6820, 0x0128, 0x080c,
-	0xcb9c, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6820, 0x0128,
-	0x080c, 0xcc19, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d,
-	0x1118, 0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005,
-	0x11b8, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184,
-	0xffc0, 0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010,
-	0x4002, 0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008,
-	0x9006, 0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff,
-	0x4104, 0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
+	0x7097, 0x0001, 0x080c, 0x5f4a, 0x709b, 0x001a, 0x0029, 0x0010,
+	0x7093, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x601f,
+	0x709b, 0x001b, 0x080c, 0xab21, 0x080c, 0x5ff4, 0x2011, 0x0260,
+	0x2009, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084,
+	0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
+	0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000,
+	0x6816, 0x2011, 0x0260, 0x1f04, 0x5d8b, 0x60c3, 0x0084, 0x080c,
+	0x5ead, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1848, 0x252c,
+	0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c,
+	0x5ff4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008,
+	0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c,
+	0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211,
+	0x1f04, 0x5dbd, 0x0804, 0x5e2c, 0x82ff, 0x1160, 0xd5d4, 0x0120,
+	0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5e2c,
+	0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110,
+	0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424,
+	0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5de3,
+	0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5df5,
+	0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007,
+	0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5e04,
+	0x755e, 0x95c8, 0x3325, 0x292d, 0x95ac, 0x00ff, 0x7582, 0x6532,
+	0x6536, 0x0016, 0x2508, 0x080c, 0x2887, 0x001e, 0x60e7, 0x0000,
+	0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7087, 0x0001, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008,
+	0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005,
+	0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003,
+	0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001,
+	0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118,
+	0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001,
+	0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e,
+	0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715e, 0x91a0,
+	0x3325, 0x242d, 0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016,
+	0x2508, 0x080c, 0x2887, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7087,
+	0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708b,
+	0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071,
+	0x0140, 0x080c, 0x5f39, 0x080c, 0xa273, 0x7004, 0x9084, 0x4000,
+	0x0110, 0x080c, 0x2cff, 0x0126, 0x2091, 0x8000, 0x2071, 0x1826,
+	0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c,
+	0x5f96, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42,
+	0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
+	0x2011, 0x19f1, 0x2013, 0x0000, 0x7093, 0x0000, 0x012e, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x080c, 0xa26a, 0x6144, 0xd184, 0x0120,
+	0x7198, 0x918d, 0x2000, 0x0018, 0x718c, 0x918d, 0x1000, 0x2011,
+	0x1999, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5e83, 0x080c, 0x858b,
+	0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xadd2, 0x2009, 0x00f7, 0x080c, 0x5f96, 0x2061, 0x19fa, 0x900e,
+	0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001,
+	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1999,
+	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f05, 0x080c, 0x84e7,
+	0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0xa273, 0x2071,
+	0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2cff, 0x080c,
+	0x73c4, 0x0188, 0x080c, 0x73df, 0x1170, 0x080c, 0x76ae, 0x0016,
+	0x080c, 0x2956, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x76a9,
+	0x080c, 0x72ee, 0x0050, 0x2009, 0x0001, 0x080c, 0x2c3e, 0x2001,
+	0x0001, 0x080c, 0x27ea, 0x080c, 0x5ed9, 0x012e, 0x000e, 0x00ee,
+	0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036,
+	0x2011, 0x8017, 0x2001, 0x1999, 0x201c, 0x080c, 0x4b04, 0x003e,
+	0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80,
+	0x080c, 0x5ff4, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9,
+	0x0020, 0x080c, 0x5fee, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051,
+	0x20a9, 0x000e, 0x080c, 0x5ff1, 0x2099, 0x0260, 0x20a1, 0x1cb2,
+	0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007,
+	0x2012, 0x8108, 0x8210, 0x1f04, 0x5f6e, 0x002e, 0x001e, 0x0005,
+	0x080c, 0xab21, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xab21,
+	0x080c, 0x5ff4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006,
+	0x2061, 0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138,
+	0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185,
+	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c,
+	0x696e, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe5ae,
+	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e,
+	0x080c, 0x318a, 0x080c, 0xd230, 0x0140, 0x0036, 0x2019, 0xffff,
+	0x2021, 0x0007, 0x080c, 0x4cbb, 0x003e, 0x004e, 0x001e, 0x0005,
+	0x080c, 0x5ed9, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005, 0x0006,
+	0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006,
+	0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d,
+	0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001,
+	0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0,
+	0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006,
+	0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079,
+	0x1c00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813,
+	0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e,
+	0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001,
+	0x19a6, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005,
+	0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108,
+	0x1f04, 0x602e, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136,
+	0x0146, 0x2069, 0x1847, 0x9006, 0xb802, 0xb8ce, 0xb807, 0x0707,
+	0xb80a, 0xb80e, 0xb812, 0x9198, 0x3325, 0x231d, 0x939c, 0x00ff,
+	0xbb16, 0x0016, 0x0026, 0xb8c2, 0x080c, 0xadcb, 0x1120, 0x9192,
+	0x007e, 0x1208, 0xbbc2, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8,
+	0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198,
+	0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e,
+	0xb852, 0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
+	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
+	0xb896, 0xb89a, 0xb89e, 0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
+	0x0110, 0x080c, 0x1031, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
+	0x6810, 0xb83a, 0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005,
+	0x0198, 0x00c6, 0x2060, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0dd5, 0x080c, 0x8981, 0x00ce,
+	0x090c, 0x8d25, 0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff, 0xb842,
+	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
+	0x611c, 0x9182, 0x0800, 0x1a04, 0x6120, 0x2001, 0x180c, 0x2004,
+	0x9084, 0x0003, 0x1904, 0x6126, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4,
+	0x900d, 0x1904, 0x6138, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900,
+	0xb852, 0xb84e, 0x080c, 0x910d, 0x9006, 0x012e, 0x0005, 0x00a6,
+	0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90,
+	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
+	0x9082, 0x0006, 0x1290, 0x080c, 0xadcb, 0x1160, 0xb8a0, 0x9084,
+	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009,
+	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
+	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
+	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8,
+	0x080c, 0x6972, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x60cf,
+	0x080c, 0x679b, 0x0904, 0x60e8, 0x0804, 0x60d3, 0x00b6, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0xa874, 0x908e, 0x00ff, 0x1120, 0x2001,
+	0x196b, 0x205c, 0x0060, 0xa974, 0x9182, 0x0800, 0x1690, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x01d0, 0x080c, 0x6912, 0x11d0, 0x080c,
+	0xae0b, 0x0570, 0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0009,
+	0x600b, 0x0000, 0xa874, 0x908e, 0x00ff, 0x1110, 0x600b, 0x8000,
+	0x2009, 0x0043, 0x080c, 0xaedc, 0x9006, 0x00b0, 0x2001, 0x0028,
+	0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
+	0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029,
+	0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0xa974, 0x9182, 0x0800, 0x1a04, 0x6206, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x0904, 0x61de, 0xb8a0, 0x9086, 0x007f, 0x0178, 0x080c,
+	0x697a, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004, 0x0130,
+	0x908e, 0x0005, 0x0118, 0x080c, 0x6972, 0x1598, 0xa87c, 0xd0fc,
+	0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010, 0x080c,
+	0xcb23, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x6208, 0x6020,
+	0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x6208, 0x601a,
+	0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0xae0b, 0x05e8,
+	0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
+	0x2009, 0x0003, 0x080c, 0xaedc, 0x9006, 0x0458, 0x2001, 0x0028,
+	0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0xadcb, 0x1160, 0xb8a0,
+	0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001, 0x0029,
+	0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c,
+	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184, 0x0118,
+	0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029,
+	0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0,
+	0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005, 0x1550,
+	0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518, 0xa8c4,
+	0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800, 0x9182, 0x0800,
+	0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98, 0xab94, 0xa878,
+	0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001, 0x0004,
+	0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029,
+	0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0029,
+	0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be, 0x00fe, 0x0005,
+	0x629d, 0x6258, 0x626f, 0x629d, 0x629d, 0x629d, 0x629d, 0x629d,
+	0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x659e, 0x0148, 0x9046,
+	0xb810, 0x9306, 0x1904, 0x62a5, 0xb814, 0x9206, 0x15f0, 0x0028,
+	0xbb12, 0xba16, 0x0010, 0x080c, 0x49b7, 0x0150, 0x04b0, 0x080c,
+	0x65ff, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206, 0x1568,
+	0x080c, 0xae0b, 0x0530, 0x2b00, 0x6012, 0x080c, 0xcfaa, 0x2900,
+	0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086, 0x0001,
+	0x1170, 0x080c, 0x31bf, 0x9006, 0x080c, 0x653b, 0x2001, 0x0002,
+	0x080c, 0x654f, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002, 0x2009,
+	0x0003, 0x080c, 0xaedc, 0x9006, 0x0068, 0x2001, 0x0001, 0x900e,
+	0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0028, 0x900e,
+	0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6, 0x00f6,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6, 0x0015, 0x0904,
+	0x648c, 0x90c6, 0x0056, 0x0904, 0x6490, 0x90c6, 0x0066, 0x0904,
+	0x6494, 0x90c6, 0x0067, 0x0904, 0x6498, 0x90c6, 0x0068, 0x0904,
+	0x649c, 0x90c6, 0x0071, 0x0904, 0x64a0, 0x90c6, 0x0074, 0x0904,
+	0x64a4, 0x90c6, 0x007c, 0x0904, 0x64a8, 0x90c6, 0x007e, 0x0904,
+	0x64ac, 0x90c6, 0x0037, 0x0904, 0x64b0, 0x9016, 0x2079, 0x1800,
+	0xa974, 0x9186, 0x00ff, 0x0904, 0x6487, 0x9182, 0x0800, 0x1a04,
+	0x6487, 0x080c, 0x65ff, 0x1198, 0xb804, 0x9084, 0x00ff, 0x9082,
+	0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c, 0xadcb,
+	0x1904, 0x6470, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x6470, 0xa894,
+	0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x63d0, 0x90c6,
+	0x0064, 0x0904, 0x63f9, 0x2008, 0x0804, 0x6392, 0xa998, 0xa8b0,
+	0x2040, 0x080c, 0xadcb, 0x1120, 0x9182, 0x007f, 0x0a04, 0x6392,
+	0x9186, 0x00ff, 0x0904, 0x6392, 0x9182, 0x0800, 0x1a04, 0x6392,
+	0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188, 0x7880, 0x0096, 0x924e,
+	0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x6392, 0x99cc, 0xff00,
+	0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x6392, 0x080c, 0x49b7,
+	0x0904, 0x639c, 0x900e, 0x9016, 0x90c6, 0x4000, 0x15e0, 0x0006,
+	0x080c, 0x681f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c,
+	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f7c,
+	0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305, 0xabd0, 0x9305, 0xabd4,
+	0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305, 0xabe0, 0x9305, 0x9005,
+	0x0510, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x00a0,
+	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6, 0x4009,
+	0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005, 0x2009,
+	0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e, 0x2001,
+	0x0030, 0x900e, 0x0478, 0x000e, 0x080c, 0xae0b, 0x1130, 0x2001,
+	0x4005, 0x2009, 0x0003, 0x9016, 0x0c78, 0x2b00, 0x6012, 0x080c,
+	0xcfaa, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108,
+	0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x31bf, 0x012e,
+	0x9006, 0x080c, 0x653b, 0x2001, 0x0002, 0x080c, 0x654f, 0x2009,
+	0x0002, 0x080c, 0xaedc, 0xa8b0, 0xd094, 0x0118, 0xb8cc, 0xc08d,
+	0xb8ce, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005,
+	0x080c, 0x56e3, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0,
+	0x080c, 0x65ff, 0x1904, 0x638d, 0x9186, 0x007f, 0x0130, 0x080c,
+	0x6972, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x0fff,
+	0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806,
+	0x080c, 0xcd1b, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
+	0x6394, 0xa998, 0xaeb0, 0x080c, 0x65ff, 0x1904, 0x638d, 0x0096,
+	0x080c, 0x0fff, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x644d,
+	0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8c4,
+	0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbc8,
+	0x9398, 0x0006, 0x2398, 0x080c, 0x0f7c, 0x009e, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x56cf,
+	0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118,
+	0xa89b, 0x000c, 0x00b0, 0x080c, 0x6972, 0x0118, 0xa89b, 0x0009,
+	0x0080, 0x080c, 0x56e3, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c,
+	0xccfe, 0x1904, 0x63c9, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
+	0x6394, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
+	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x1243, 0x080c, 0xb37a, 0x1904, 0x63c9, 0x2009, 0x0002, 0x08e8,
+	0x2001, 0x0028, 0x900e, 0x0804, 0x63ca, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x63ca, 0x2001,
+	0x0029, 0x900e, 0x0804, 0x63ca, 0x080c, 0x3749, 0x0804, 0x63cb,
+	0x080c, 0x540c, 0x0804, 0x63cb, 0x080c, 0x4547, 0x0804, 0x63cb,
+	0x080c, 0x45c0, 0x0804, 0x63cb, 0x080c, 0x461c, 0x0804, 0x63cb,
+	0x080c, 0x4a7a, 0x0804, 0x63cb, 0x080c, 0x4d31, 0x0804, 0x63cb,
+	0x080c, 0x5077, 0x0804, 0x63cb, 0x080c, 0x5270, 0x0804, 0x63cb,
+	0x080c, 0x395f, 0x0804, 0x63cb, 0x00b6, 0xa974, 0xae78, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x6972, 0x1148, 0x00e9,
+	0x080c, 0x672a, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090,
+	0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001, 0x0029,
+	0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802, 0x009e,
+	0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852, 0xb84e,
+	0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c, 0x9005,
+	0x0170, 0x00e6, 0x2071, 0x19e7, 0x7004, 0x9086, 0x0002, 0x0168,
+	0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005, 0x2900,
+	0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06, 0x1d80,
+	0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002, 0x00ae,
+	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c, 0x904d,
+	0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905, 0x012e,
+	0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852,
+	0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008,
+	0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6,
+	0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006,
+	0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x696e,
+	0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011,
+	0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086,
+	0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0dd5, 0x000e, 0x00ce,
+	0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
+	0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c,
+	0xd0a4, 0x0150, 0x080c, 0x696a, 0x1138, 0x9284, 0x00ff, 0x9086,
+	0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007,
+	0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800,
+	0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000,
+	0x2204, 0x905d, 0x1188, 0x0096, 0x080c, 0x0fff, 0x2958, 0x009e,
+	0x0168, 0x2b00, 0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006,
+	0xb8a6, 0xb8ae, 0x080c, 0x6034, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000,
+	0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6,
+	0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4,
+	0x904d, 0x0110, 0x080c, 0x1031, 0x00d6, 0x00c6, 0xb8bc, 0x2060,
+	0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xcb35,
+	0x0110, 0x080c, 0x0fb1, 0x080c, 0xae61, 0x00ce, 0x0c88, 0x00ce,
+	0x00de, 0x2b48, 0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x1041,
+	0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016,
+	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000,
+	0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156,
+	0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802,
+	0x080c, 0x73bc, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c,
+	0xadcb, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061,
+	0x1982, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054,
+	0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001,
+	0x0001, 0x6886, 0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048,
+	0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4,
+	0x20e8, 0xb8c8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003,
+	0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003,
+	0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e,
+	0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000,
+	0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211,
+	0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009,
+	0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0,
+	0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421,
+	0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009,
+	0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e,
+	0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbcc, 0xc384,
+	0xba00, 0x2009, 0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110,
+	0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd,
+	0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02,
+	0xbbce, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0,
+	0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6,
+	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
+	0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002,
+	0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0dd5, 0x3c00,
+	0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0fff, 0x0170, 0x2900,
+	0xb8a6, 0xa803, 0x0000, 0x080c, 0x67bb, 0xa807, 0x0001, 0xae12,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126,
+	0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005,
+	0x1150, 0x080c, 0x67ca, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218,
+	0x8001, 0xa806, 0x0020, 0x080c, 0x1031, 0xb8a7, 0x0000, 0x009e,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x910d, 0x012e,
+	0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091,
+	0x8000, 0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500,
+	0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70,
+	0x080c, 0xa692, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020,
+	0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff,
+	0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005,
+	0x080c, 0x681f, 0x0128, 0x080c, 0xcbf2, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x681f, 0x0128, 0x080c, 0xcb97, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x681f, 0x0128, 0x080c, 0xcbef, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x681f, 0x0128, 0x080c, 0xcbb6,
+	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x681f, 0x0128, 0x080c,
+	0xcc33, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118,
+	0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
 	0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
 	0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002,
-	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146,
-	0x01d6, 0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff,
-	0x4004, 0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0fff,
-	0x0168, 0x2900, 0xb8a6, 0x080c, 0x67bc, 0xa803, 0x0001, 0xa807,
-	0x0000, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
-	0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7,
-	0x0000, 0x080c, 0x1031, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005,
-	0xb89c, 0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x73b0, 0x01b0,
-	0x71c4, 0x81ff, 0x1198, 0x71dc, 0xd19c, 0x0180, 0x2001, 0x007e,
-	0x9080, 0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1847,
-	0x7804, 0xd0a4, 0x01d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016,
-	0x080c, 0x6600, 0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096,
-	0x0004, 0x0118, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802,
-	0x001e, 0x8108, 0x1f04, 0x6847, 0x015e, 0x080c, 0x6928, 0x0120,
-	0x2001, 0x1985, 0x200c, 0x0038, 0x2079, 0x1847, 0x7804, 0xd0a4,
-	0x0130, 0x2009, 0x07d0, 0x2011, 0x6872, 0x080c, 0x8562, 0x00fe,
-	0x00be, 0x0005, 0x00b6, 0x2011, 0x6872, 0x080c, 0x84ca, 0x080c,
-	0x6928, 0x01d8, 0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec,
-	0xb902, 0x080c, 0x6966, 0x0130, 0x2009, 0x07d0, 0x2011, 0x6872,
-	0x080c, 0x8562, 0x00e6, 0x2071, 0x1800, 0x9006, 0x707e, 0x7060,
-	0x7082, 0x080c, 0x2f96, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9,
-	0x007f, 0x900e, 0x0016, 0x080c, 0x6600, 0x1538, 0xb800, 0xd0ec,
-	0x0520, 0x0046, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c,
-	0xe58d, 0xb800, 0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x6962, 0x2001,
-	0x0707, 0x1128, 0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806,
-	0x2019, 0x0029, 0x080c, 0x9262, 0x0076, 0x903e, 0x080c, 0x913f,
-	0x900e, 0x080c, 0xe2ca, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04,
-	0x689a, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058,
-	0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096,
-	0x080c, 0x1018, 0x090c, 0x0dd5, 0x2958, 0x009e, 0x2001, 0x196b,
-	0x2b02, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x6035, 0xb807,
+	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104,
+	0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
+	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
+	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
+	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6,
+	0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004,
+	0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0fff, 0x0168,
+	0x2900, 0xb8a6, 0x080c, 0x67bb, 0xa803, 0x0001, 0xa807, 0x0000,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000,
+	0x080c, 0x1031, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c,
+	0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x73bc, 0x01b0, 0x71c4,
+	0x81ff, 0x1198, 0x71dc, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080,
+	0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804,
+	0xd0a4, 0x01d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x65ff, 0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004,
+	0x0118, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e,
+	0x8108, 0x1f04, 0x6846, 0x015e, 0x080c, 0x6930, 0x0120, 0x2001,
+	0x1985, 0x200c, 0x0038, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130,
+	0x2009, 0x07d0, 0x2011, 0x6871, 0x080c, 0x858b, 0x00fe, 0x00be,
+	0x0005, 0x00b6, 0x2011, 0x6871, 0x080c, 0x84f3, 0x080c, 0x6930,
+	0x01d8, 0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902,
+	0x080c, 0x696e, 0x0130, 0x2009, 0x07d0, 0x2011, 0x6871, 0x080c,
+	0x858b, 0x00e6, 0x2071, 0x1800, 0x9006, 0x707e, 0x7060, 0x7082,
+	0x080c, 0x2f96, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f,
+	0x900e, 0x0016, 0x080c, 0x65ff, 0x1538, 0xb800, 0xd0ec, 0x0520,
+	0x0046, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xe5ae,
+	0xb800, 0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x696a, 0x2001, 0x0707,
+	0x1128, 0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019,
+	0x0029, 0x080c, 0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x900e,
+	0x080c, 0xe2eb, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x6899,
+	0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800,
+	0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096, 0x080c,
+	0x1018, 0x090c, 0x0dd5, 0x2958, 0x009e, 0x2001, 0x196b, 0x2b02,
+	0x8b07, 0x8006, 0x8006, 0x908c, 0x003f, 0xb9c6, 0x908c, 0xffc0,
+	0xb9ca, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x6034, 0xb807,
 	0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200, 0xb86c,
 	0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af, 0x0000,
 	0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be,
@@ -3164,84 +3165,84 @@ unsigned short risc_code01[] = {
 	0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0dd5,
 	0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02,
 	0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc, 0x0138,
-	0x2001, 0x1983, 0x200c, 0x2011, 0x6958, 0x080c, 0x8562, 0x0005,
-	0x2011, 0x6958, 0x080c, 0x84ca, 0x2011, 0x1837, 0x2204, 0xc0cc,
-	0x2012, 0x0005, 0x080c, 0x56d0, 0xd0ac, 0x0005, 0x080c, 0x56d0,
+	0x2001, 0x1983, 0x200c, 0x2011, 0x6960, 0x080c, 0x858b, 0x0005,
+	0x2011, 0x6960, 0x080c, 0x84f3, 0x2011, 0x1837, 0x2204, 0xc0cc,
+	0x2012, 0x0005, 0x080c, 0x56cf, 0xd0ac, 0x0005, 0x080c, 0x56cf,
 	0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006,
 	0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e,
-	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xd216, 0x0158,
+	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xd230, 0x0158,
 	0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d,
 	0x0110, 0xb8cc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071, 0x1910,
 	0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a,
 	0x701e, 0x700a, 0x7046, 0x2001, 0x1947, 0x2003, 0x0000, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0x1948, 0x900e, 0x710a, 0x080c, 0x56d0,
-	0xd0fc, 0x1140, 0x080c, 0x56d0, 0x900e, 0xd09c, 0x0108, 0x8108,
+	0x0016, 0x00e6, 0x2071, 0x1948, 0x900e, 0x710a, 0x080c, 0x56cf,
+	0xd0fc, 0x1140, 0x080c, 0x56cf, 0x900e, 0xd09c, 0x0108, 0x8108,
 	0x7102, 0x00f8, 0x2001, 0x1867, 0x200c, 0x9184, 0x0007, 0x0002,
-	0x69aa, 0x69aa, 0x69aa, 0x69aa, 0x69aa, 0x69c0, 0x69ce, 0x69aa,
+	0x69b2, 0x69b2, 0x69b2, 0x69b2, 0x69b2, 0x69c8, 0x69d6, 0x69b2,
 	0x7003, 0x0003, 0x2009, 0x1868, 0x210c, 0x9184, 0xff00, 0x8007,
 	0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005,
 	0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c,
 	0x9005, 0x1150, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc085, 0x702a,
 	0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c,
-	0x770a, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006,
+	0x7716, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006,
 	0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868, 0x700a,
 	0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016, 0x684c,
 	0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b,
 	0x0001, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc084, 0x702a, 0x7007,
 	0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0x00e6,
-	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c7e, 0x9286,
-	0x0003, 0x0904, 0x6b14, 0x9286, 0x0005, 0x0904, 0x6b14, 0x2071,
-	0x1877, 0xa87c, 0x9005, 0x0904, 0x6a75, 0x7140, 0xa868, 0x9102,
-	0x0a04, 0x6c7e, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019, 0x2001,
-	0x8023, 0xa84e, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6e20,
-	0x0e04, 0x6e8e, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c, 0x7082,
+	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c86, 0x9286,
+	0x0003, 0x0904, 0x6b1c, 0x9286, 0x0005, 0x0904, 0x6b1c, 0x2071,
+	0x1877, 0xa87c, 0x9005, 0x0904, 0x6a7d, 0x7140, 0xa868, 0x9102,
+	0x0a04, 0x6c86, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019, 0x2001,
+	0x8023, 0xa84e, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6e28,
+	0x0e04, 0x6e96, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c, 0x7082,
 	0xa870, 0x7086, 0xa86c, 0x708a, 0xa880, 0x708e, 0x7036, 0x0146,
 	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
 	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
 	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x0804, 0x6af7,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x0804, 0x6aff,
 	0xa853, 0x001b, 0x2001, 0x8027, 0x0820, 0x7004, 0xd08c, 0x1904,
-	0x6c7e, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6a39, 0x00e6,
-	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c7e, 0x9286,
-	0x0003, 0x0904, 0x6b14, 0x9286, 0x0005, 0x0904, 0x6b14, 0xa84f,
-	0x8022, 0xa853, 0x0018, 0x0804, 0x6adc, 0xa868, 0xd0fc, 0x11d8,
-	0x00e6, 0x0026, 0x2001, 0x1948, 0x2004, 0x9005, 0x0904, 0x6c7e,
-	0xa87c, 0xd0bc, 0x1904, 0x6c7e, 0xa978, 0xa874, 0x9105, 0x1904,
-	0x6c7e, 0x2001, 0x1948, 0x2004, 0x0002, 0x6c7e, 0x6ad8, 0x6b14,
-	0x6b14, 0x6c7e, 0x6b14, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
-	0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6c7e, 0xa87c,
-	0xd0cc, 0x0904, 0x6c7e, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
-	0x1904, 0x6c7e, 0x9186, 0x0003, 0x0904, 0x6b14, 0x9186, 0x0005,
-	0x0904, 0x6b14, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
+	0x6c86, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6a41, 0x00e6,
+	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c86, 0x9286,
+	0x0003, 0x0904, 0x6b1c, 0x9286, 0x0005, 0x0904, 0x6b1c, 0xa84f,
+	0x8022, 0xa853, 0x0018, 0x0804, 0x6ae4, 0xa868, 0xd0fc, 0x11d8,
+	0x00e6, 0x0026, 0x2001, 0x1948, 0x2004, 0x9005, 0x0904, 0x6c86,
+	0xa87c, 0xd0bc, 0x1904, 0x6c86, 0xa978, 0xa874, 0x9105, 0x1904,
+	0x6c86, 0x2001, 0x1948, 0x2004, 0x0002, 0x6c86, 0x6ae0, 0x6b1c,
+	0x6b1c, 0x6c86, 0x6b1c, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
+	0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6c86, 0xa87c,
+	0xd0cc, 0x0904, 0x6c86, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x6c86, 0x9186, 0x0003, 0x0904, 0x6b1c, 0x9186, 0x0005,
+	0x0904, 0x6b1c, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
 	0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1910, 0x701c, 0x9005,
-	0x1904, 0x6e20, 0x0e04, 0x6e8e, 0x2071, 0x0000, 0xa84c, 0x7082,
+	0x1904, 0x6e28, 0x0e04, 0x6e96, 0x2071, 0x0000, 0xa84c, 0x7082,
 	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2071,
 	0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802,
-	0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x002e,
+	0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x002e,
 	0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
 	0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079,
 	0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
-	0x6c03, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fda, 0x8004, 0x8004,
-	0x8004, 0x9084, 0x0003, 0x0002, 0x6b32, 0x6c03, 0x6b57, 0x6b9e,
+	0x6c0b, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fe2, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x6b3a, 0x6c0b, 0x6b5f, 0x6ba6,
 	0x080c, 0x0dd5, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
 	0x1170, 0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
 	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x0c10, 0x2071,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0c10, 0x2071,
 	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1580, 0x7824, 0x00e6,
 	0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x1830, 0x210c,
 	0x918a, 0x0020, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048,
 	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
-	0x83eb, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd0a4, 0x19f0,
+	0x8414, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x19f0,
 	0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004,
 	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
 	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x0800, 0x0096, 0x00e6,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0800, 0x0096, 0x00e6,
 	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70c0, 0x8000, 0x70c2, 0x080c, 0x83eb, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6fda, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6fda, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804,
+	0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6fe2, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6fe2, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804,
 	0x900d, 0x1560, 0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001,
 	0x1949, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
@@ -3249,85 +3250,85 @@ unsigned short risc_code01[] = {
 	0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004,
 	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x00fe,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x00fe,
 	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
 	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
-	0x900d, 0x1904, 0x6c58, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fda,
+	0x900d, 0x1904, 0x6c60, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2,
 	0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012,
 	0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6fda, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6fda, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x0780, 0x190c, 0x6fe2, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6fe2, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071,
 	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2,
-	0x080c, 0x83eb, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd0a4,
+	0x080c, 0x8414, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4,
 	0x1d60, 0x00ee, 0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001,
 	0x1949, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
 	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
-	0x080c, 0x83eb, 0x00ee, 0x0804, 0x6c13, 0xa868, 0xd0fc, 0x1560,
+	0x080c, 0x8414, 0x00ee, 0x0804, 0x6c1b, 0xa868, 0xd0fc, 0x1560,
 	0x0096, 0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0fb1, 0x009e,
 	0x0018, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000,
 	0x00f6, 0x2079, 0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010,
-	0x9005, 0x1904, 0x6d9a, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fda,
-	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6c9d, 0x6d9a,
-	0x6cb8, 0x6d29, 0x080c, 0x0dd5, 0x0005, 0x2071, 0x1800, 0x2900,
+	0x9005, 0x1904, 0x6da2, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fe2,
+	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6ca5, 0x6da2,
+	0x6cc0, 0x6d31, 0x080c, 0x0dd5, 0x0005, 0x2071, 0x1800, 0x2900,
 	0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x0c60,
-	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6d18,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0c60,
+	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6d20,
 	0x7830, 0x8007, 0x9084, 0x001f, 0x9082, 0x0005, 0x1220, 0x00fe,
 	0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c,
 	0xd19c, 0x1148, 0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0218,
 	0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83eb, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6fda, 0xd0a4, 0x19f0, 0x0e04, 0x6d0f, 0x7838,
+	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x19f0, 0x0e04, 0x6d17, 0x7838,
 	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
 	0x0013, 0x00de, 0x2001, 0x1921, 0x200c, 0xc184, 0x2102, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2009,
 	0x1947, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001,
 	0x1921, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x0804,
-	0x6ccb, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83eb,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd0a4, 0x1d60, 0x00ee,
-	0x0e04, 0x6d6d, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0804,
+	0x6cd3, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x1d60, 0x00ee,
+	0x0e04, 0x6d75, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
 	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046,
 	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b,
 	0x2009, 0x1947, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6fda, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x6fe2, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
 	0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
 	0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
 	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x00fe, 0x002e,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x00fe, 0x002e,
 	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1904, 0x6e0b, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd09c,
+	0x1904, 0x6e13, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd09c,
 	0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010,
 	0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd09c, 0x0d50, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6fda, 0xd0a4, 0x05c8, 0x00e6, 0x7824,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd09c, 0x0d50, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x05c8, 0x00e6, 0x7824,
 	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x83eb, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6fda, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6e04, 0x7838, 0x7938,
+	0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6fe2, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6e0c, 0x7838, 0x7938,
 	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
 	0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089,
 	0x2004, 0xd084, 0x190c, 0x119b, 0x2009, 0x1947, 0x200b, 0x0000,
 	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe,
 	0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c,
 	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x00ee, 0x0804, 0x6daa,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x00ee, 0x0804, 0x6db2,
 	0x2071, 0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012,
 	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
-	0xa804, 0x900d, 0x1128, 0x1e04, 0x6e4b, 0x002e, 0x00ee, 0x0005,
+	0xa804, 0x900d, 0x1128, 0x1e04, 0x6e53, 0x002e, 0x00ee, 0x0005,
 	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
-	0x83eb, 0x0e04, 0x6e35, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c,
+	0x8414, 0x0e04, 0x6e3d, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c,
 	0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
 	0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278,
 	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b,
-	0x2071, 0x1910, 0x080c, 0x6fc6, 0x002e, 0x00ee, 0x0005, 0xa850,
+	0x2071, 0x1910, 0x080c, 0x6fce, 0x002e, 0x00ee, 0x0005, 0xa850,
 	0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6,
 	0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868,
 	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003,
@@ -3336,23 +3337,23 @@ unsigned short risc_code01[] = {
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
 	0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
 	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x83eb, 0x002e, 0x00ee, 0x0005,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x002e, 0x00ee, 0x0005,
 	0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860,
 	0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e,
 	0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071,
-	0x1910, 0x7004, 0x0002, 0x6ed9, 0x6eda, 0x6fc5, 0x6eda, 0x0dd5,
-	0x6fc5, 0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6ee4, 0x6ee4,
-	0x6f5e, 0x6f5f, 0x6ee4, 0x6f5f, 0x0126, 0x2091, 0x8000, 0x1e0c,
-	0x6fe5, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x6f2f,
-	0x0e04, 0x6f0d, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
+	0x1910, 0x7004, 0x0002, 0x6ee1, 0x6ee2, 0x6fcd, 0x6ee2, 0x0dd5,
+	0x6fcd, 0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6eec, 0x6eec,
+	0x6f66, 0x6f67, 0x6eec, 0x6f67, 0x0126, 0x2091, 0x8000, 0x1e0c,
+	0x6fed, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x6f37,
+	0x0e04, 0x6f15, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
 	0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019,
 	0x1278, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x119b, 0x2071, 0x1910, 0x080c, 0x6fc6, 0x012e, 0x0804, 0x6f5d,
+	0x119b, 0x2071, 0x1910, 0x080c, 0x6fce, 0x012e, 0x0804, 0x6f65,
 	0xa850, 0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146,
 	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
 	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
 	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2001,
-	0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd09c, 0x2071,
+	0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd09c, 0x2071,
 	0x1910, 0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184,
 	0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101,
 	0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de,
@@ -3361,10 +3362,10 @@ unsigned short risc_code01[] = {
 	0x2008, 0x2069, 0x19fa, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186,
 	0x0003, 0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1ac8, 0x210c,
 	0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c,
-	0x6838, 0x9106, 0x0190, 0x0e04, 0x6f91, 0x2069, 0x0000, 0x6837,
+	0x6838, 0x9106, 0x0190, 0x0e04, 0x6f99, 0x2069, 0x0000, 0x6837,
 	0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001,
 	0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2069, 0x19fa, 0x683f,
-	0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x7056,
+	0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x705e,
 	0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780,
 	0x15c9, 0xd09c, 0x1500, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964,
 	0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff,
@@ -3373,7 +3374,7 @@ unsigned short risc_code01[] = {
 	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091,
 	0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800,
 	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x1031, 0x0005,
-	0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6fdc, 0x0006, 0x0016,
+	0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6fe4, 0x0006, 0x0016,
 	0x2001, 0x8004, 0x0006, 0x0804, 0x0dde, 0x0096, 0x00f6, 0x2079,
 	0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938,
 	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
@@ -3384,4153 +3385,4156 @@ unsigned short risc_code01[] = {
 	0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148,
 	0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0218, 0x7022, 0x00ee,
 	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x83eb, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6fda, 0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6fe2, 0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
 	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080,
 	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2009, 0x1947,
 	0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x00f6, 0x2079,
 	0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046, 0x7838, 0x7938,
 	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
 	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x119b, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fda,
+	0x119b, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2,
 	0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x2048, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83eb,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6fda, 0xd0a4, 0x1d70, 0x00d6,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x1d70, 0x00d6,
 	0x2069, 0x0050, 0x693c, 0x2069, 0x1948, 0x6808, 0x690a, 0x2069,
 	0x19fa, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328, 0x2001, 0x1949,
 	0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x7098,
 	0x908a, 0x0029, 0x1a0c, 0x0dd5, 0x9082, 0x001d, 0x001b, 0x6027,
-	0x1e00, 0x0005, 0x717a, 0x7104, 0x7120, 0x7148, 0x7169, 0x71a9,
-	0x71bb, 0x7120, 0x7191, 0x70bf, 0x70ed, 0x70be, 0x0005, 0x00d6,
+	0x1e00, 0x0005, 0x7186, 0x710c, 0x7128, 0x7152, 0x7175, 0x71b5,
+	0x71c7, 0x7128, 0x719d, 0x70c7, 0x70f5, 0x70c6, 0x0005, 0x00d6,
 	0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518,
-	0x709b, 0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x74ea,
+	0x709b, 0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x74f6,
 	0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028, 0x2069,
 	0x198f, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6,
 	0x0036, 0x0046, 0x0056, 0x2071, 0x1a62, 0x080c, 0x1aa9, 0x005e,
 	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
 	0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b, 0x0028,
-	0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x7585, 0x6028, 0x9085,
+	0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x7591, 0x6028, 0x9085,
 	0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
-	0x2cef, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x7228, 0xd1d4,
+	0x2cef, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x7234, 0xd1d4,
 	0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020, 0x080c,
-	0x7228, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
-	0x2001, 0x0088, 0x080c, 0x2cef, 0x6124, 0xd1cc, 0x11d8, 0xd1dc,
-	0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8, 0x60e3, 0x0001,
-	0x600c, 0xc0b4, 0x600e, 0x080c, 0x73dc, 0x2001, 0x0080, 0x080c,
-	0x2cef, 0x709b, 0x0028, 0x0058, 0x709b, 0x001e, 0x0040, 0x709b,
-	0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b, 0x001f, 0x0005,
-	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x73dc, 0x2001,
-	0x0080, 0x080c, 0x2cef, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158,
-	0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x709b, 0x0028, 0x0040,
-	0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f,
-	0x0005, 0x2001, 0x00a0, 0x080c, 0x2cef, 0x6124, 0xd1dc, 0x1138,
-	0xd1e4, 0x0138, 0x080c, 0x1ad3, 0x709b, 0x001e, 0x0010, 0x709b,
-	0x001d, 0x0005, 0x080c, 0x72ab, 0x6124, 0xd1dc, 0x1188, 0x080c,
-	0x7228, 0x0016, 0x080c, 0x1ad3, 0x001e, 0xd1d4, 0x1128, 0xd1e4,
-	0x0138, 0x709b, 0x001e, 0x0020, 0x709b, 0x001f, 0x080c, 0x7228,
-	0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x2cef, 0x000e, 0x6124,
-	0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140,
-	0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x0021,
-	0x0005, 0x080c, 0x72ab, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128,
-	0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010,
-	0x709b, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2cef,
-	0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128,
-	0xd1e4, 0x0158, 0x709b, 0x001e, 0x0040, 0x709b, 0x001d, 0x0028,
-	0x709b, 0x0020, 0x0010, 0x709b, 0x001f, 0x0005, 0x0016, 0x00c6,
-	0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x2091, 0x8000, 0x080c, 0x73b0, 0x11d8, 0x2001, 0x180c,
-	0x200c, 0xd1b4, 0x01b0, 0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c,
-	0x2c38, 0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x2cef,
-	0x080c, 0x7698, 0x080c, 0x601b, 0x0428, 0x6028, 0xc0cd, 0x602a,
-	0x0408, 0x080c, 0x73ca, 0x0150, 0x080c, 0x73c1, 0x1138, 0x2001,
-	0x0001, 0x080c, 0x27ea, 0x080c, 0x7388, 0x00a0, 0x080c, 0x72a8,
-	0x0178, 0x2001, 0x0001, 0x080c, 0x27ea, 0x7098, 0x9086, 0x001e,
-	0x0120, 0x7098, 0x9086, 0x0022, 0x1118, 0x709b, 0x0025, 0x0010,
-	0x709b, 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005,
-	0x0026, 0x2011, 0x7239, 0x080c, 0x85a4, 0x002e, 0x0016, 0x0026,
-	0x2009, 0x0064, 0x2011, 0x7239, 0x080c, 0x859b, 0x002e, 0x001e,
-	0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, 0xa259, 0x2071, 0x1800,
-	0x080c, 0x71d6, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0xa259,
-	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
-	0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x080c, 0xa639, 0x2011,
-	0x0002, 0x080c, 0xa643, 0x080c, 0xa526, 0x080c, 0x8550, 0x0036,
-	0x901e, 0x080c, 0xa59c, 0x003e, 0x60e3, 0x0000, 0x080c, 0xe9c8,
-	0x080c, 0xe9e3, 0x2009, 0x0004, 0x080c, 0x2c3e, 0x080c, 0x2b59,
-	0x2001, 0x1800, 0x2003, 0x0004, 0x6027, 0x0008, 0x2011, 0x7239,
-	0x080c, 0x85a4, 0x080c, 0x73ca, 0x0118, 0x9006, 0x080c, 0x2cef,
-	0x080c, 0x0bae, 0x2001, 0x0001, 0x080c, 0x27ea, 0x012e, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026,
-	0x00e6, 0x2011, 0x7246, 0x2071, 0x19fa, 0x701c, 0x9206, 0x1118,
-	0x7018, 0x9005, 0x0110, 0x9085, 0x0001, 0x00ee, 0x002e, 0x0005,
-	0x6020, 0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0,
-	0x0170, 0x2001, 0x00c0, 0x080c, 0x2cef, 0x0156, 0x20a9, 0x002d,
-	0x1d04, 0x72b8, 0x2091, 0x6000, 0x1f04, 0x72b8, 0x015e, 0x0005,
-	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x080c, 0x76a7, 0x2001, 0x196d, 0x2003, 0x0000, 0x9006,
+	0x7234, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x2001, 0x0088, 0x080c, 0x2cef, 0x6124, 0xd1cc, 0x11e8, 0xd1dc,
+	0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c, 0x1ad3,
+	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x73e8, 0x2001,
+	0x0080, 0x080c, 0x2cef, 0x709b, 0x0028, 0x0058, 0x709b, 0x001e,
+	0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b,
+	0x001f, 0x0005, 0x080c, 0x1ad3, 0x60e3, 0x0001, 0x600c, 0xc0b4,
+	0x600e, 0x080c, 0x73e8, 0x2001, 0x0080, 0x080c, 0x2cef, 0x6124,
+	0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00,
+	0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028, 0x709b,
+	0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c,
+	0x2cef, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1ad3,
+	0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c, 0x72b7,
+	0x6124, 0xd1dc, 0x1188, 0x080c, 0x7234, 0x0016, 0x080c, 0x1ad3,
+	0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e, 0x0020,
+	0x709b, 0x001f, 0x080c, 0x7234, 0x0005, 0x0006, 0x2001, 0x00a0,
+	0x080c, 0x2cef, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150,
+	0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028, 0x709b,
+	0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x72b7, 0x6124,
+	0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e,
+	0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x0006,
+	0x2001, 0x0090, 0x080c, 0x2cef, 0x000e, 0x6124, 0xd1d4, 0x1178,
+	0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b, 0x001e,
+	0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b,
+	0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c,
+	0x73bc, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0, 0xc1b4,
+	0x2102, 0x6027, 0x0200, 0x080c, 0x2c38, 0x6024, 0xd0cc, 0x0148,
+	0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c, 0x76a4, 0x080c, 0x601a,
+	0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x73d6, 0x0150,
+	0x080c, 0x73cd, 0x1138, 0x2001, 0x0001, 0x080c, 0x27ea, 0x080c,
+	0x7394, 0x00a0, 0x080c, 0x72b4, 0x0178, 0x2001, 0x0001, 0x080c,
+	0x27ea, 0x7098, 0x9086, 0x001e, 0x0120, 0x7098, 0x9086, 0x0022,
+	0x1118, 0x709b, 0x0025, 0x0010, 0x709b, 0x0021, 0x012e, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x7245, 0x080c,
+	0x85cd, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x7245,
+	0x080c, 0x85c4, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016,
+	0x080c, 0xa273, 0x2071, 0x1800, 0x080c, 0x71e2, 0x001e, 0x00fe,
+	0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x0126, 0x080c, 0xa273, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x2011,
+	0x0003, 0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d, 0x080c,
+	0xa540, 0x080c, 0x8579, 0x0036, 0x901e, 0x080c, 0xa5b6, 0x003e,
+	0x60e3, 0x0000, 0x080c, 0xe9e9, 0x080c, 0xea04, 0x2009, 0x0004,
+	0x080c, 0x2c3e, 0x080c, 0x2b59, 0x2001, 0x1800, 0x2003, 0x0004,
+	0x6027, 0x0008, 0x2011, 0x7245, 0x080c, 0x85cd, 0x080c, 0x73d6,
+	0x0118, 0x9006, 0x080c, 0x2cef, 0x080c, 0x0bae, 0x2001, 0x0001,
+	0x080c, 0x27ea, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x7252, 0x2071,
+	0x19fa, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085,
+	0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800,
+	0x9084, 0xfffe, 0x9086, 0x00c0, 0x0170, 0x2001, 0x00c0, 0x080c,
+	0x2cef, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x72c4, 0x2091, 0x6000,
+	0x1f04, 0x72c4, 0x015e, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x76b3, 0x2001,
+	0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c,
+	0x28b2, 0x9006, 0x080c, 0x2cef, 0x080c, 0x5ed9, 0x6027, 0xffff,
+	0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001,
+	0x197d, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158,
+	0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x7384,
+	0x709b, 0x0022, 0x0040, 0x709b, 0x0021, 0x0028, 0x709b, 0x0023,
+	0x0010, 0x709b, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001,
+	0x0001, 0x080c, 0x28b2, 0x0026, 0x080c, 0xadd2, 0x002e, 0x7000,
+	0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020,
+	0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac,
+	0x0150, 0x012e, 0x015e, 0x080c, 0xd230, 0x0118, 0x9006, 0x080c,
+	0x2d19, 0x0804, 0x7390, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802,
+	0x080c, 0x2c38, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c,
+	0x2cef, 0x1f04, 0x732e, 0x080c, 0x7413, 0x012e, 0x015e, 0x080c,
+	0x73cd, 0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085,
+	0x0020, 0x6052, 0x080c, 0x7413, 0x9006, 0x8001, 0x1df0, 0x000e,
+	0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x7413, 0x080c,
+	0xd230, 0x0118, 0x9006, 0x080c, 0x2d19, 0x0016, 0x0026, 0x7000,
+	0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x7252, 0x080c,
+	0x858b, 0x002e, 0x001e, 0x080c, 0x840b, 0x7034, 0xc085, 0x7036,
+	0x2001, 0x197d, 0x2003, 0x0004, 0x080c, 0x70af, 0x080c, 0x73cd,
+	0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x76a9,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8422, 0x080c,
+	0x8414, 0x080c, 0x76b3, 0x2001, 0x196d, 0x2003, 0x0000, 0x9006,
 	0x709a, 0x60e2, 0x6886, 0x080c, 0x28b2, 0x9006, 0x080c, 0x2cef,
-	0x080c, 0x5eda, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee, 0x00de,
-	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x2001, 0x197d, 0x200c, 0x9186, 0x0000,
-	0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186,
-	0x0003, 0x0158, 0x0804, 0x7378, 0x709b, 0x0022, 0x0040, 0x709b,
-	0x0021, 0x0028, 0x709b, 0x0023, 0x0010, 0x709b, 0x0024, 0x60e3,
-	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x28b2, 0x0026,
-	0x080c, 0xadb8, 0x002e, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b,
-	0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000,
-	0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c,
-	0xd216, 0x0118, 0x9006, 0x080c, 0x2d19, 0x0804, 0x7384, 0x6800,
-	0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2c38, 0x6904, 0xd1d4,
-	0x1140, 0x2001, 0x0100, 0x080c, 0x2cef, 0x1f04, 0x7322, 0x080c,
-	0x7407, 0x012e, 0x015e, 0x080c, 0x73c1, 0x01a8, 0x6044, 0x9005,
-	0x0168, 0x6050, 0x0006, 0x9085, 0x0020, 0x6052, 0x080c, 0x7407,
-	0x9006, 0x8001, 0x1df0, 0x000e, 0x6052, 0x0028, 0x6804, 0xd0d4,
-	0x1110, 0x080c, 0x7407, 0x080c, 0xd216, 0x0118, 0x9006, 0x080c,
-	0x2d19, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130, 0x2009,
-	0x00c8, 0x2011, 0x7246, 0x080c, 0x8562, 0x002e, 0x001e, 0x080c,
-	0x83e2, 0x7034, 0xc085, 0x7036, 0x2001, 0x197d, 0x2003, 0x0004,
-	0x080c, 0x70a7, 0x080c, 0x73c1, 0x0138, 0x6804, 0xd0d4, 0x1120,
-	0xd0dc, 0x1100, 0x080c, 0x769d, 0x00ee, 0x00de, 0x00ce, 0x0005,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x197c, 0x2004,
+	0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d3, 0x9084,
+	0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d3,
+	0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x56d3, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x56d3, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005,
+	0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180,
+	0x0020, 0x080c, 0x28d2, 0x900e, 0x0028, 0x080c, 0x696a, 0x1dc8,
+	0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x318a, 0x9006, 0x0019,
+	0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130,
+	0x080c, 0xd229, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef,
+	0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c,
+	0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x0016, 0x6138, 0x6050,
+	0x9084, 0xfbff, 0x9085, 0x2000, 0x6052, 0x613a, 0x20a9, 0x0012,
+	0x1d04, 0x7428, 0x2091, 0x6000, 0x1f04, 0x7428, 0x602f, 0x0100,
+	0x602f, 0x0000, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052,
+	0x613a, 0x001e, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a,
+	0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000,
+	0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x28b2, 0x2001, 0x00a0,
+	0x0006, 0x080c, 0xd230, 0x000e, 0x0130, 0x080c, 0x2d0d, 0x9006,
+	0x080c, 0x2d19, 0x0010, 0x080c, 0x2cef, 0x000e, 0x6052, 0x6050,
+	0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2bad,
+	0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
 	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x080c, 0x83f9, 0x080c, 0x83eb, 0x080c, 0x76a7, 0x2001,
-	0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c,
-	0x28b2, 0x9006, 0x080c, 0x2cef, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x6027, 0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005,
-	0x0006, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005,
-	0x0006, 0x080c, 0x56d4, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e,
-	0x0005, 0x0006, 0x080c, 0x56d4, 0x9084, 0x0030, 0x9086, 0x0030,
-	0x000e, 0x0005, 0x0006, 0x080c, 0x56d4, 0x9084, 0x0030, 0x9086,
-	0x0010, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d4, 0x9084, 0x0030,
-	0x9086, 0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001, 0x180c,
-	0x2004, 0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x28d2, 0x900e,
-	0x0028, 0x080c, 0x6962, 0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028,
-	0x080c, 0x3187, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005, 0x00e6,
-	0x2071, 0x180c, 0x2e04, 0x0130, 0x080c, 0xd20f, 0x1128, 0x9085,
-	0x0010, 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050,
-	0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028,
-	0x0006, 0x0016, 0x6138, 0x6050, 0x9084, 0xfbff, 0x9085, 0x2000,
-	0x6052, 0x613a, 0x20a9, 0x0012, 0x1d04, 0x741c, 0x2091, 0x6000,
-	0x1f04, 0x741c, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085,
-	0x0400, 0x9084, 0xdfff, 0x6052, 0x613a, 0x001e, 0x602f, 0x0040,
-	0x602f, 0x0000, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e,
-	0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
-	0x080c, 0x28b2, 0x2001, 0x00a0, 0x0006, 0x080c, 0xd216, 0x000e,
-	0x0130, 0x080c, 0x2d0d, 0x9006, 0x080c, 0x2d19, 0x0010, 0x080c,
-	0x2cef, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6,
-	0x2079, 0x0100, 0x080c, 0x2bad, 0x00fe, 0x000e, 0x6052, 0x0005,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x6020, 0x9084, 0x0080,
-	0x0138, 0x2001, 0x180c, 0x200c, 0xc1c5, 0x2102, 0x0804, 0x74dc,
-	0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff,
-	0x602a, 0x6027, 0x0200, 0x2001, 0x0090, 0x080c, 0x2cef, 0x20a9,
-	0x0366, 0x6024, 0xd0cc, 0x1518, 0x1d04, 0x7489, 0x2091, 0x6000,
-	0x1f04, 0x7489, 0x2011, 0x0003, 0x080c, 0xa639, 0x2011, 0x0002,
-	0x080c, 0xa643, 0x080c, 0xa526, 0x901e, 0x080c, 0xa59c, 0x2001,
-	0x00a0, 0x080c, 0x2cef, 0x080c, 0x7698, 0x080c, 0x601b, 0x080c,
-	0xd216, 0x0110, 0x080c, 0x0d45, 0x9085, 0x0001, 0x0498, 0x86ff,
-	0x1110, 0x080c, 0x1ad3, 0x60e3, 0x0000, 0x2001, 0x196d, 0x2004,
-	0x080c, 0x28b2, 0x60e2, 0x2001, 0x0080, 0x080c, 0x2cef, 0x20a9,
-	0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2c38, 0x6024,
-	0x910c, 0x0138, 0x1d04, 0x74c1, 0x2091, 0x6000, 0x1f04, 0x74c1,
-	0x0808, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b4, 0x9005, 0x1118,
-	0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xd216, 0x0110, 0x080c,
-	0x0d45, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000, 0x9086, 0x0003,
-	0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540, 0x9086, 0x5540,
-	0x1128, 0x2069, 0x1a79, 0x2d04, 0x8000, 0x206a, 0x2069, 0x0140,
-	0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005, 0x1904, 0x754f,
-	0x2001, 0x0088, 0x080c, 0x2cef, 0x9006, 0x60e2, 0x6886, 0x080c,
-	0x28b2, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005,
-	0x01c0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x6027, 0x0400, 0x2069,
-	0x198f, 0x7000, 0x206a, 0x709b, 0x0026, 0x7003, 0x0001, 0x20a9,
-	0x0002, 0x1d04, 0x7531, 0x2091, 0x6000, 0x1f04, 0x7531, 0x0804,
-	0x757d, 0x2069, 0x0140, 0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009,
-	0x1e00, 0x080c, 0x2c38, 0x6024, 0x910c, 0x0508, 0x9084, 0x1a00,
-	0x11f0, 0x1d04, 0x753d, 0x2091, 0x6000, 0x1f04, 0x753d, 0x2011,
-	0x0003, 0x080c, 0xa639, 0x2011, 0x0002, 0x080c, 0xa643, 0x080c,
-	0xa526, 0x901e, 0x080c, 0xa59c, 0x2001, 0x00a0, 0x080c, 0x2cef,
-	0x080c, 0x7698, 0x080c, 0x601b, 0x9085, 0x0001, 0x00b0, 0x2001,
-	0x0080, 0x080c, 0x2cef, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4,
-	0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x196d,
-	0x2004, 0x080c, 0x28b2, 0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
-	0x6020, 0x9084, 0x00c0, 0x01c8, 0x2011, 0x0003, 0x080c, 0xa639,
-	0x2011, 0x0002, 0x080c, 0xa643, 0x080c, 0xa526, 0x901e, 0x080c,
-	0xa59c, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c,
-	0x7698, 0x080c, 0x601b, 0x0804, 0x7618, 0x2001, 0x180c, 0x200c,
-	0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x722e, 0x2069, 0x0140,
-	0x2001, 0x0080, 0x080c, 0x2cef, 0x60e3, 0x0000, 0x2069, 0x0200,
-	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0180, 0x6028, 0x9084,
-	0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0x198f, 0x7000, 0x206a,
-	0x709b, 0x0027, 0x7003, 0x0001, 0x0804, 0x7618, 0x6027, 0x1e00,
-	0x2009, 0x1e00, 0x080c, 0x2c38, 0x6024, 0x910c, 0x01c8, 0x9084,
-	0x1c00, 0x11b0, 0x1d04, 0x75d6, 0x0006, 0x0016, 0x00c6, 0x00d6,
-	0x00e6, 0x080c, 0x842a, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e,
-	0x00e6, 0x2071, 0x19fa, 0x7018, 0x00ee, 0x9005, 0x19f8, 0x0500,
-	0x0026, 0x2011, 0x7246, 0x080c, 0x84ca, 0x2011, 0x7239, 0x080c,
-	0x85a4, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005,
-	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x196d, 0x2004,
-	0x080c, 0x28b2, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102,
-	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061,
-	0x0100, 0x2071, 0x1800, 0x080c, 0xd20f, 0x1904, 0x7686, 0x7130,
-	0xd184, 0x1170, 0x080c, 0x3312, 0x0138, 0xc18d, 0x7132, 0x2011,
-	0x1848, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904, 0x7686,
-	0x2011, 0x1848, 0x220c, 0xd1a4, 0x0538, 0x0016, 0x2019, 0x000e,
-	0x080c, 0xe501, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186,
-	0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6600, 0x1170,
-	0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xe58d, 0x2009,
-	0x0001, 0x2011, 0x0100, 0x080c, 0x86b4, 0x001e, 0x8108, 0x1f04,
-	0x764f, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
-	0x0002, 0x2019, 0x0004, 0x080c, 0x3187, 0x001e, 0x0078, 0x0156,
-	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6600, 0x1110, 0x080c,
-	0x6035, 0x8108, 0x1f04, 0x767c, 0x00be, 0x015e, 0x080c, 0x1ad3,
-	0x080c, 0xadb8, 0x60e3, 0x0000, 0x080c, 0x601b, 0x080c, 0x72e2,
-	0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
-	0x2001, 0x197d, 0x2003, 0x0001, 0x0005, 0x2001, 0x197d, 0x2003,
-	0x0000, 0x0005, 0x2001, 0x197c, 0x2003, 0xaaaa, 0x0005, 0x2001,
-	0x197c, 0x2003, 0x0000, 0x0005, 0x2071, 0x18fa, 0x7003, 0x0000,
-	0x7007, 0x0000, 0x080c, 0x1018, 0x090c, 0x0dd5, 0xa8ab, 0xdcb0,
-	0x2900, 0x704e, 0x080c, 0x1018, 0x090c, 0x0dd5, 0xa8ab, 0xdcb0,
-	0x2900, 0x7052, 0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000,
-	0x0005, 0x00e6, 0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085,
-	0x0001, 0x04b0, 0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200,
-	0x7002, 0x6854, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850,
-	0x7002, 0x6854, 0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840,
-	0x9005, 0x1110, 0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085,
-	0x0040, 0x701e, 0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001,
-	0x0004, 0x200c, 0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6,
-	0x2069, 0x18fa, 0x6807, 0x0001, 0x00de, 0x080c, 0x7c84, 0x9006,
-	0x00ee, 0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x2011,
-	0x0100, 0x2214, 0x9296, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5,
-	0x3e08, 0x1f04, 0x770e, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071,
-	0x18fa, 0x7004, 0x0002, 0x772d, 0x772e, 0x7765, 0x77c0, 0x78d0,
-	0x772b, 0x772b, 0x78fa, 0x080c, 0x0dd5, 0x0005, 0x2079, 0x0040,
-	0x782c, 0x908c, 0x0780, 0x190c, 0x7d66, 0xd0a4, 0x01f0, 0x7824,
+	0x1800, 0x6020, 0x9084, 0x0080, 0x0138, 0x2001, 0x180c, 0x200c,
+	0xc1c5, 0x2102, 0x0804, 0x74e8, 0x2001, 0x180c, 0x200c, 0xc1c4,
+	0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001,
+	0x0090, 0x080c, 0x2cef, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518,
+	0x1d04, 0x7495, 0x2091, 0x6000, 0x1f04, 0x7495, 0x2011, 0x0003,
+	0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d, 0x080c, 0xa540,
+	0x901e, 0x080c, 0xa5b6, 0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c,
+	0x76a4, 0x080c, 0x601a, 0x080c, 0xd230, 0x0110, 0x080c, 0x0d45,
+	0x9085, 0x0001, 0x0498, 0x86ff, 0x1110, 0x080c, 0x1ad3, 0x60e3,
+	0x0000, 0x2001, 0x196d, 0x2004, 0x080c, 0x28b2, 0x60e2, 0x2001,
+	0x0080, 0x080c, 0x2cef, 0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009,
+	0x1e00, 0x080c, 0x2c38, 0x6024, 0x910c, 0x0138, 0x1d04, 0x74cd,
+	0x2091, 0x6000, 0x1f04, 0x74cd, 0x0808, 0x6028, 0x9085, 0x1e00,
+	0x602a, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
+	0x080c, 0xd230, 0x0110, 0x080c, 0x0d45, 0x9006, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
+	0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004,
+	0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a79, 0x2d04,
+	0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120,
+	0x6884, 0x9005, 0x1904, 0x755b, 0x2001, 0x0088, 0x080c, 0x2cef,
+	0x9006, 0x60e2, 0x6886, 0x080c, 0x28b2, 0x2069, 0x0200, 0x6804,
+	0x9005, 0x1118, 0x6808, 0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff,
+	0x602a, 0x6027, 0x0400, 0x2069, 0x198f, 0x7000, 0x206a, 0x709b,
+	0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x753d, 0x2091,
+	0x6000, 0x1f04, 0x753d, 0x0804, 0x7589, 0x2069, 0x0140, 0x20a9,
+	0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2c38, 0x6024,
+	0x910c, 0x0508, 0x9084, 0x1a00, 0x11f0, 0x1d04, 0x7549, 0x2091,
+	0x6000, 0x1f04, 0x7549, 0x2011, 0x0003, 0x080c, 0xa653, 0x2011,
+	0x0002, 0x080c, 0xa65d, 0x080c, 0xa540, 0x901e, 0x080c, 0xa5b6,
+	0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c, 0x76a4, 0x080c, 0x601a,
+	0x9085, 0x0001, 0x00b0, 0x2001, 0x0080, 0x080c, 0x2cef, 0x2069,
+	0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001,
+	0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x28b2, 0x60e2,
+	0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01c8,
+	0x2011, 0x0003, 0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d,
+	0x080c, 0xa540, 0x901e, 0x080c, 0xa5b6, 0x2069, 0x0140, 0x2001,
+	0x00a0, 0x080c, 0x2cef, 0x080c, 0x76a4, 0x080c, 0x601a, 0x0804,
+	0x7624, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102,
+	0x080c, 0x723a, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c, 0x2cef,
+	0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
+	0x9005, 0x0180, 0x6028, 0x9084, 0xfdff, 0x602a, 0x6027, 0x0200,
+	0x2069, 0x198f, 0x7000, 0x206a, 0x709b, 0x0027, 0x7003, 0x0001,
+	0x0804, 0x7624, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2c38,
+	0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x75e2,
+	0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x8453, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19fa, 0x7018,
+	0x00ee, 0x9005, 0x19f8, 0x0500, 0x0026, 0x2011, 0x7252, 0x080c,
+	0x84f3, 0x2011, 0x7245, 0x080c, 0x85cd, 0x002e, 0x2069, 0x0140,
+	0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x28b2, 0x60e2, 0x2001,
+	0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c,
+	0xd229, 0x1904, 0x7692, 0x7130, 0xd184, 0x1170, 0x080c, 0x3319,
+	0x0138, 0xc18d, 0x7132, 0x2011, 0x1848, 0x2214, 0xd2ac, 0x1120,
+	0x7030, 0xd08c, 0x0904, 0x7692, 0x2011, 0x1848, 0x220c, 0xd1a4,
+	0x0538, 0x0016, 0x2019, 0x000e, 0x080c, 0xe522, 0x0156, 0x00b6,
+	0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080,
+	0x0188, 0x080c, 0x65ff, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009,
+	0x000e, 0x080c, 0xe5ae, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
+	0x86dd, 0x001e, 0x8108, 0x1f04, 0x765b, 0x00be, 0x015e, 0x001e,
+	0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c,
+	0x318a, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e,
+	0x080c, 0x65ff, 0x1110, 0x080c, 0x6034, 0x8108, 0x1f04, 0x7688,
+	0x00be, 0x015e, 0x080c, 0x1ad3, 0x080c, 0xadd2, 0x60e3, 0x0000,
+	0x080c, 0x601a, 0x080c, 0x72ee, 0x00ee, 0x00ce, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197d, 0x2003, 0x0001,
+	0x0005, 0x2001, 0x197d, 0x2003, 0x0000, 0x0005, 0x2001, 0x197c,
+	0x2003, 0xaaaa, 0x0005, 0x2001, 0x197c, 0x2003, 0x0000, 0x0005,
+	0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c, 0x1018,
+	0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x1018,
+	0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000,
+	0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040,
+	0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840, 0x9005,
+	0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006,
+	0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858,
+	0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012, 0x7016,
+	0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001, 0x0019,
+	0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c, 0xfff7,
+	0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18fa, 0x6807, 0x0001,
+	0x00de, 0x080c, 0x7c90, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156,
+	0x20a9, 0x0006, 0x8003, 0x2011, 0x0100, 0x2214, 0x9296, 0x0008,
+	0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04, 0x771a, 0x015e,
+	0x0005, 0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002, 0x7739,
+	0x773a, 0x7771, 0x77cc, 0x78dc, 0x7737, 0x7737, 0x7906, 0x080c,
+	0x0dd5, 0x0005, 0x2079, 0x0040, 0x782c, 0x908c, 0x0780, 0x190c,
+	0x7d72, 0xd0a4, 0x01f0, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
+	0xa864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001,
+	0x1800, 0x200c, 0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004,
+	0x0140, 0x9186, 0x0007, 0x0128, 0x9186, 0x0003, 0x19e8, 0x080c,
+	0x77cc, 0x782c, 0xd09c, 0x090c, 0x7c90, 0x0005, 0x9082, 0x005a,
+	0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x7802, 0x0c90, 0x00e3,
+	0x08f0, 0x0005, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802,
+	0x7802, 0x7802, 0x7824, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802,
+	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802,
+	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x780e, 0x7802,
+	0x79f7, 0x7802, 0x7802, 0x7802, 0x7824, 0x7802, 0x780e, 0x7a38,
+	0x7a79, 0x7ac0, 0x7ad4, 0x7802, 0x7802, 0x7824, 0x780e, 0x7838,
+	0x7802, 0x78b0, 0x7b7f, 0x7b9a, 0x7802, 0x7824, 0x7802, 0x7838,
+	0x7802, 0x7802, 0x78a6, 0x7b9a, 0x7802, 0x7802, 0x7802, 0x7802,
+	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x784c, 0x7802, 0x7802,
+	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7d16,
+	0x7802, 0x7cc0, 0x7802, 0x7cc0, 0x7802, 0x7861, 0x7802, 0x7802,
+	0x7802, 0x7802, 0x7802, 0x7802, 0x2079, 0x0040, 0x7004, 0x9086,
+	0x0003, 0x1198, 0x782c, 0x080c, 0x7cb9, 0xd0a4, 0x0170, 0x7824,
 	0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a,
-	0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003,
-	0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128,
-	0x9186, 0x0003, 0x19e8, 0x080c, 0x77c0, 0x782c, 0xd09c, 0x090c,
-	0x7c84, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18,
-	0x080c, 0x77f6, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x77f6, 0x77f6,
-	0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x7818, 0x77f6,
-	0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6,
-	0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6,
-	0x77f6, 0x77f6, 0x7802, 0x77f6, 0x79eb, 0x77f6, 0x77f6, 0x77f6,
-	0x7818, 0x77f6, 0x7802, 0x7a2c, 0x7a6d, 0x7ab4, 0x7ac8, 0x77f6,
-	0x77f6, 0x7818, 0x7802, 0x782c, 0x77f6, 0x78a4, 0x7b73, 0x7b8e,
-	0x77f6, 0x7818, 0x77f6, 0x782c, 0x77f6, 0x77f6, 0x789a, 0x7b8e,
-	0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6,
-	0x77f6, 0x7840, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6,
-	0x77f6, 0x77f6, 0x77f6, 0x7d0a, 0x77f6, 0x7cb4, 0x77f6, 0x7cb4,
-	0x77f6, 0x7855, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6, 0x77f6,
-	0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c,
-	0x7cad, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
-	0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50,
-	0x00e9, 0x080c, 0x7c84, 0x0005, 0x77f6, 0x7802, 0x79d7, 0x77f6,
-	0x7802, 0x77f6, 0x7802, 0x7802, 0x77f6, 0x7802, 0x79d7, 0x7802,
-	0x7802, 0x7802, 0x7802, 0x7802, 0x77f6, 0x7802, 0x79d7, 0x77f6,
-	0x77f6, 0x7802, 0x77f6, 0x77f6, 0x77f6, 0x7802, 0x00e6, 0x2071,
-	0x18fa, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000,
-	0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800,
-	0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105,
-	0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e, 0x0005,
-	0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007,
-	0x0001, 0x0804, 0x7979, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
-	0x701a, 0x704b, 0x7979, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
-	0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7994, 0x7007,
-	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7994, 0x0005,
-	0xa864, 0x8007, 0x9084, 0x00ff, 0x0904, 0x77fe, 0x8001, 0x1120,
-	0x7007, 0x0001, 0x0804, 0x79b0, 0x7007, 0x0003, 0x7012, 0x2900,
-	0x7016, 0x701a, 0x704b, 0x79b0, 0x0005, 0xa864, 0x8007, 0x9084,
-	0x00ff, 0x9086, 0x0001, 0x1904, 0x77fe, 0x7007, 0x0001, 0x2009,
-	0x1834, 0x210c, 0x81ff, 0x11a8, 0xa868, 0x9084, 0x00ff, 0xa86a,
-	0xa883, 0x0000, 0x080c, 0x62af, 0x1108, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x6c79, 0x012e,
-	0x0ca0, 0xa994, 0x9186, 0x0071, 0x0d38, 0x9186, 0x0064, 0x0d20,
-	0x9186, 0x007c, 0x0d08, 0x9186, 0x0028, 0x09f0, 0x9186, 0x0038,
-	0x09d8, 0x9186, 0x0078, 0x09c0, 0x9186, 0x005f, 0x09a8, 0x9186,
-	0x0056, 0x0990, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030,
-	0x900e, 0x08a0, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120,
-	0x7007, 0x0001, 0x0804, 0x7ba5, 0x2900, 0x7016, 0x701a, 0x20a9,
-	0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050,
-	0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003,
-	0xa888, 0x7012, 0x9082, 0x0401, 0x1a04, 0x7806, 0xaab4, 0x928a,
-	0x0002, 0x1a04, 0x7806, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105,
-	0x0118, 0x2001, 0x7937, 0x0018, 0x9280, 0x792d, 0x2005, 0x7056,
-	0x7010, 0x9015, 0x0904, 0x7918, 0x080c, 0x1018, 0x1118, 0x7007,
-	0x0004, 0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866,
-	0x7050, 0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072,
-	0xe008, 0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003,
-	0x800b, 0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e,
-	0x080c, 0x10e9, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200,
-	0x0118, 0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x1031,
-	0x7014, 0x2048, 0x0804, 0x7806, 0x7020, 0x2048, 0x7018, 0xa802,
-	0xa807, 0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x78d0,
-	0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8,
-	0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x001e, 0x0904, 0x7ba5, 0x0804, 0x7979, 0x792f, 0x7933, 0x0002,
-	0x001d, 0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a,
-	0x001d, 0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804,
-	0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4,
-	0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8,
-	0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c,
-	0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090,
-	0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692,
-	0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074,
-	0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e,
-	0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x1178, 0x080c, 0x60af,
-	0x1108, 0x0005, 0x080c, 0x6eb8, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xce0a, 0x080c, 0x6c79, 0x012e, 0x0ca0, 0x080c, 0xd20f, 0x1d70,
-	0x2001, 0x0028, 0x900e, 0x0c70, 0x2009, 0x1834, 0x210c, 0x81ff,
-	0x1188, 0xa888, 0x9005, 0x0188, 0xa883, 0x0000, 0x080c, 0x613f,
-	0x1108, 0x0005, 0xa87a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79,
-	0x012e, 0x0cb8, 0x2001, 0x0028, 0x0ca8, 0x2001, 0x0000, 0x0c90,
-	0x2009, 0x1834, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0,
-	0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x6211, 0x1138,
-	0x0005, 0x9006, 0xa87a, 0x080c, 0x618c, 0x1108, 0x0005, 0x0126,
-	0x2091, 0x8000, 0xa87a, 0xa982, 0x080c, 0x6c79, 0x012e, 0x0cb0,
-	0x2001, 0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018,
-	0xa802, 0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012,
-	0x0118, 0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001,
-	0x7048, 0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878,
-	0x9084, 0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096,
-	0x0001, 0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160,
-	0x9005, 0x11d8, 0xa974, 0x080c, 0x6600, 0x11b8, 0x0066, 0xae80,
-	0x080c, 0x6710, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224,
-	0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x6600, 0x1110, 0x080c,
-	0x6810, 0x8108, 0x1f04, 0x7a14, 0x00ce, 0xa87c, 0xd084, 0x1120,
-	0x080c, 0x1031, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6c79, 0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x080c, 0x6966, 0x0580, 0x2061, 0x1a71, 0x6100, 0xd184,
-	0x0178, 0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520,
-	0x6004, 0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8,
-	0x2011, 0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000,
-	0x6016, 0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007,
-	0x9084, 0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d,
-	0x6202, 0x012e, 0x0804, 0x7c6e, 0x012e, 0x0804, 0x7c68, 0x012e,
-	0x0804, 0x7c62, 0x012e, 0x0804, 0x7c65, 0x0126, 0x2091, 0x8000,
-	0x7007, 0x0001, 0x080c, 0x6966, 0x05e0, 0x2061, 0x1a71, 0x6000,
-	0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484,
-	0x0003, 0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100,
-	0x9210, 0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0,
-	0x9484, 0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082,
-	0x0004, 0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004,
-	0x1168, 0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000,
-	0x6016, 0x6206, 0x630a, 0x012e, 0x0804, 0x7c6e, 0x012e, 0x0804,
-	0x7c6b, 0x012e, 0x0804, 0x7c68, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x2061, 0x1a71, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318,
-	0x0220, 0x630a, 0x012e, 0x0804, 0x7c7c, 0x012e, 0x0804, 0x7c6b,
-	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c,
-	0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a71, 0x6000, 0x9084, 0xfcff,
-	0x6002, 0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065,
-	0x0598, 0x2001, 0x1834, 0x2004, 0x9005, 0x0118, 0x080c, 0xae78,
-	0x0068, 0x6017, 0xf400, 0x605b, 0x0000, 0xa97c, 0xd1a4, 0x0110,
-	0xa980, 0x615a, 0x2009, 0x0041, 0x080c, 0xaec2, 0xa988, 0x918c,
-	0xff00, 0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff,
-	0x080c, 0x86b4, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a71,
-	0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce,
-	0x012e, 0x00be, 0x0804, 0x7c6e, 0x00ce, 0x012e, 0x00be, 0x0804,
-	0x7c68, 0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18,
-	0x9186, 0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c,
-	0x200c, 0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186,
-	0x0029, 0x1d10, 0xa974, 0x080c, 0x6600, 0x1968, 0xb800, 0xc0e4,
-	0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001,
-	0x1986, 0x2004, 0x601a, 0x0804, 0x7b03, 0xa88c, 0x9065, 0x0960,
-	0x00e6, 0xa890, 0x9075, 0x2001, 0x1834, 0x2004, 0x9005, 0x0150,
-	0x080c, 0xae78, 0x8eff, 0x0118, 0x2e60, 0x080c, 0xae78, 0x00ee,
-	0x0804, 0x7b03, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007,
-	0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e,
-	0xa8a8, 0x6016, 0x6003, 0x0001, 0x080c, 0x90c7, 0x080c, 0x9664,
-	0x00ee, 0x0804, 0x7b03, 0x2061, 0x1a71, 0x6000, 0xd084, 0x0190,
-	0xd08c, 0x1904, 0x7c7c, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210,
-	0x0220, 0x6206, 0x012e, 0x0804, 0x7c7c, 0x012e, 0xa883, 0x0016,
-	0x0804, 0x7c75, 0xa883, 0x0007, 0x0804, 0x7c75, 0xa864, 0x8007,
-	0x9084, 0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069,
-	0x0005, 0x080c, 0x77fe, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900,
-	0x7016, 0x701a, 0x704b, 0x7ba5, 0x0005, 0x00b6, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x903e, 0x2061, 0x1800, 0x61d0, 0x81ff, 0x1904,
-	0x7c27, 0x6130, 0xd194, 0x1904, 0x7c51, 0xa878, 0x2070, 0x9e82,
-	0x1cd0, 0x0a04, 0x7c1b, 0x6068, 0x9e02, 0x1a04, 0x7c1b, 0x7120,
-	0x9186, 0x0006, 0x1904, 0x7c0d, 0x7010, 0x905d, 0x0904, 0x7c27,
-	0xb800, 0xd0e4, 0x1904, 0x7c4b, 0x2061, 0x1a71, 0x6100, 0x9184,
-	0x0301, 0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7c54,
-	0xa883, 0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198,
-	0x7116, 0xa87c, 0xd0f4, 0x1904, 0x7c57, 0x080c, 0x56d0, 0xd09c,
-	0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x85d4, 0x012e,
-	0x00ee, 0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902,
-	0x2148, 0xa87c, 0xd0f4, 0x1904, 0x7c57, 0x012e, 0x00ee, 0x00be,
-	0x0005, 0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x7c75,
-	0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6600,
-	0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118,
-	0xa883, 0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e,
-	0x0460, 0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c,
-	0x56d4, 0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x02c0,
-	0x6068, 0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010,
-	0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000,
-	0x9086, 0x0007, 0x1904, 0x7bb1, 0x7003, 0x0002, 0x0804, 0x7bb1,
-	0xa883, 0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be,
-	0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60,
-	0x2019, 0x0002, 0x601b, 0x0014, 0x080c, 0xe115, 0x012e, 0x00ee,
-	0x00be, 0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040,
-	0x2009, 0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001,
-	0xa884, 0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6c79, 0x012e, 0x0005, 0x080c, 0x1031, 0x0005, 0x00d6,
-	0x080c, 0x85cb, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780,
-	0x190c, 0x7d66, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70c0, 0x90ea,
-	0x0020, 0x0278, 0x8001, 0x70c2, 0x702c, 0x2048, 0xa800, 0x702e,
-	0x9006, 0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c,
-	0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780,
-	0x190c, 0x7d66, 0x000e, 0x0005, 0xa898, 0x9084, 0x0003, 0x05a8,
-	0x080c, 0xadf1, 0x05d8, 0x2900, 0x6016, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0035, 0x1138, 0x6008, 0xc0fd, 0x600a, 0x2001, 0x196b,
-	0x2004, 0x0098, 0xa8a0, 0x9084, 0x00ff, 0xa99c, 0x918c, 0xff00,
-	0x9105, 0xa99c, 0x918c, 0x00ff, 0x080c, 0x283e, 0x1540, 0x00b6,
-	0x080c, 0x6600, 0x2b00, 0x00be, 0x1510, 0x6012, 0x6023, 0x0001,
-	0x2009, 0x0040, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x0110,
-	0x2009, 0x0041, 0x080c, 0xaec2, 0x0005, 0xa87b, 0x0101, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6c79, 0x012e, 0x0005, 0xa87b, 0x002c,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e, 0x0005, 0xa87b,
-	0x0028, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e, 0x080c,
-	0xae47, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6,
-	0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7d57, 0xa97c,
-	0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8,
-	0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10,
-	0x080c, 0xadf1, 0x1118, 0x080c, 0xae95, 0x05a8, 0x6212, 0xa874,
-	0x0002, 0x7d35, 0x7d3a, 0x7d3d, 0x7d43, 0x2019, 0x0002, 0x080c,
-	0xe501, 0x0060, 0x080c, 0xe49d, 0x0048, 0x2019, 0x0002, 0xa980,
-	0x080c, 0xe4b8, 0x0018, 0xa980, 0x080c, 0xe49d, 0x080c, 0xae47,
-	0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e,
-	0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887,
-	0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50,
-	0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000,
-	0x0e04, 0x7d68, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804,
-	0x0dde, 0x2001, 0x1834, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6,
-	0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102,
-	0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x157d, 0x00fe,
-	0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe,
-	0x0005, 0x781c, 0xd08c, 0x0904, 0x7de8, 0x68c0, 0x90aa, 0x0005,
-	0x0a04, 0x83e2, 0x7d44, 0x7c40, 0x9584, 0x00f6, 0x1510, 0x9484,
-	0x7000, 0x0140, 0x908a, 0x2000, 0x1260, 0x9584, 0x0700, 0x8007,
-	0x0804, 0x7def, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x0da8,
-	0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086,
-	0x8100, 0x11c0, 0x080c, 0xe9a0, 0x080c, 0x82d7, 0x7817, 0x0140,
-	0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x8335, 0x19c0, 0xd5a4,
-	0x0148, 0x0046, 0x0056, 0x080c, 0x7e4a, 0x080c, 0x2337, 0x005e,
-	0x004e, 0x0020, 0x080c, 0xe9a0, 0x7817, 0x0140, 0x080c, 0x73b0,
-	0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140, 0x6893, 0x0000,
-	0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000, 0x080c, 0x7e2b,
-	0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x9664, 0x0005, 0x0002,
-	0x7e01, 0x80f9, 0x7df8, 0x7df8, 0x7df8, 0x7df8, 0x7df8, 0x7df8,
-	0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x9664,
-	0x0005, 0x7000, 0x908c, 0xff00, 0x9194, 0xf000, 0x810f, 0x9484,
-	0x0fff, 0x6892, 0x9286, 0x2000, 0x1150, 0x6800, 0x9086, 0x0001,
-	0x1118, 0x080c, 0x5731, 0x0070, 0x080c, 0x7e6a, 0x0058, 0x9286,
-	0x3000, 0x1118, 0x080c, 0x8034, 0x0028, 0x9286, 0x8000, 0x1110,
-	0x080c, 0x8207, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005,
-	0x090c, 0x9664, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036,
-	0x2011, 0x8048, 0x2518, 0x080c, 0x4b05, 0x003e, 0x002e, 0x0005,
-	0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe,
-	0x7c30, 0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200,
-	0x7d44, 0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c,
-	0x0160, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026,
-	0x2011, 0x8048, 0x080c, 0x4b05, 0x002e, 0x00fe, 0x005e, 0x004e,
-	0x003e, 0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007,
-	0x9096, 0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x8005, 0x9186,
-	0x0023, 0x15c0, 0x080c, 0x829c, 0x0904, 0x8005, 0x6120, 0x9186,
-	0x0001, 0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120,
-	0x9186, 0x000a, 0x1904, 0x8005, 0x7124, 0x610a, 0x7030, 0x908e,
-	0x0200, 0x1130, 0x2009, 0x0015, 0x080c, 0xaec2, 0x0804, 0x8005,
-	0x908e, 0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015,
-	0x080c, 0xaec2, 0x0804, 0x8005, 0x908e, 0x0100, 0x1904, 0x8005,
-	0x7034, 0x9005, 0x1904, 0x8005, 0x2009, 0x0016, 0x080c, 0xaec2,
-	0x0804, 0x8005, 0x9186, 0x0022, 0x1904, 0x8005, 0x7030, 0x908e,
-	0x0300, 0x1580, 0x68dc, 0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100,
-	0x918c, 0x00ff, 0x697e, 0x7004, 0x6882, 0x00f6, 0x2079, 0x0100,
-	0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c,
-	0x2887, 0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x283e,
-	0x695e, 0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800,
-	0x70b6, 0x00ee, 0x7034, 0x9005, 0x1904, 0x8005, 0x2009, 0x0017,
-	0x0804, 0x7fd2, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904,
-	0x8005, 0x080c, 0x73b0, 0x0120, 0x2009, 0x001d, 0x0804, 0x7fd2,
-	0x68dc, 0xc0a5, 0x68de, 0x2009, 0x0030, 0x0804, 0x7fd2, 0x908e,
-	0x0500, 0x1140, 0x7034, 0x9005, 0x1904, 0x8005, 0x2009, 0x0018,
-	0x0804, 0x7fd2, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804,
-	0x7fd2, 0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x7fd2,
-	0x908e, 0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x8005, 0x2009,
-	0x001b, 0x0804, 0x7fd2, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005,
-	0x1904, 0x8005, 0x2009, 0x001c, 0x0804, 0x7fd2, 0x908e, 0x1300,
-	0x1120, 0x2009, 0x0034, 0x0804, 0x7fd2, 0x908e, 0x1200, 0x1140,
-	0x7034, 0x9005, 0x1904, 0x8005, 0x2009, 0x0024, 0x0804, 0x7fd2,
-	0x908c, 0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001,
-	0x1810, 0x2004, 0xd09c, 0x0904, 0x7fd2, 0x080c, 0xd8ea, 0x1904,
-	0x8005, 0x0804, 0x7fd0, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120,
-	0x2009, 0x002a, 0x0804, 0x7fd2, 0x908e, 0x0f00, 0x1120, 0x2009,
-	0x0020, 0x0804, 0x7fd2, 0x908e, 0x6104, 0x1530, 0x2029, 0x0205,
-	0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004,
-	0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c,
-	0x4b05, 0x004e, 0x8108, 0x0f04, 0x7f86, 0x9186, 0x0280, 0x1d88,
-	0x2504, 0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000,
-	0x2009, 0x0023, 0x0804, 0x7fd2, 0x908e, 0x6000, 0x1120, 0x2009,
-	0x003f, 0x0804, 0x7fd2, 0x908e, 0x5400, 0x1138, 0x080c, 0x8392,
-	0x1904, 0x8005, 0x2009, 0x0046, 0x04a8, 0x908e, 0x5500, 0x1148,
-	0x080c, 0x83ba, 0x1118, 0x2009, 0x0041, 0x0460, 0x2009, 0x0042,
-	0x0448, 0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e,
-	0x1000, 0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118,
-	0x2009, 0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118,
-	0x2009, 0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118,
-	0x2009, 0x0050, 0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110,
-	0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
-	0x080c, 0x283e, 0x1568, 0x080c, 0x659f, 0x1550, 0xbe12, 0xbd16,
-	0x001e, 0x0016, 0xb8c0, 0x9005, 0x1168, 0x9186, 0x0046, 0x1150,
-	0x687c, 0x9606, 0x1138, 0x6880, 0x9506, 0x9084, 0xff00, 0x1110,
-	0x001e, 0x0098, 0x080c, 0xadf1, 0x01a8, 0x2b08, 0x6112, 0x6023,
-	0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110, 0x6023,
-	0x000a, 0x0016, 0x001e, 0x080c, 0xaec2, 0x00ce, 0x00be, 0x0005,
-	0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011,
-	0x8049, 0x080c, 0x4b05, 0x080c, 0xae95, 0x0d90, 0x2b08, 0x6112,
-	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016, 0x9186, 0x0017,
-	0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009, 0x6017, 0x2900,
-	0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f, 0x0009, 0x6003,
-	0x0001, 0x080c, 0x910f, 0x08a0, 0x080c, 0x32dc, 0x1140, 0x7010,
-	0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009, 0x0005,
-	0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f, 0x9186,
-	0x0033, 0x11e8, 0x080c, 0x829c, 0x0904, 0x8091, 0x7124, 0x610a,
-	0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15d0, 0x2009,
-	0x0015, 0x080c, 0xaec2, 0x04a8, 0x908e, 0x0100, 0x1590, 0x7034,
-	0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0xaec2, 0x0450, 0x9186,
-	0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518, 0x2009, 0x0038,
-	0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e,
-	0x11b8, 0x080c, 0x659f, 0x11a0, 0xbe12, 0xbd16, 0x080c, 0xadf1,
-	0x0178, 0x2b08, 0x6112, 0x080c, 0xcf90, 0x6023, 0x0004, 0x7120,
-	0x610a, 0x001e, 0x080c, 0xaec2, 0x080c, 0x9664, 0x0010, 0x00ce,
-	0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x0046, 0x00e6,
-	0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8, 0x9592, 0xfffc,
-	0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804, 0x80f3,
-	0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x80f3, 0x9596,
-	0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000, 0x2019,
-	0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9, 0x0800, 0x2071,
-	0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f, 0x2071, 0x1081,
-	0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0, 0x9496, 0x00ff,
-	0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600, 0x9706, 0xb814,
-	0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745, 0x1148, 0x94c6,
-	0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6, 0x0080, 0x1d20,
-	0x8420, 0x8e70, 0x1f04, 0x80c8, 0x82ff, 0x1118, 0x9085, 0x0001,
-	0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e, 0x00be,
-	0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f, 0x0002,
-	0x8110, 0x8110, 0x8110, 0x82ae, 0x8110, 0x8119, 0x8144, 0x81d2,
-	0x8110, 0x8110, 0x8110, 0x8110, 0x8110, 0x8110, 0x8110, 0x8110,
-	0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x9664,
-	0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160, 0x9c8c,
-	0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6868, 0x9c02, 0x1290,
-	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1150,
-	0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009, 0x0046,
-	0x080c, 0xaec2, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005,
-	0x090c, 0x9664, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff,
-	0x0904, 0x81a8, 0x7110, 0xd1bc, 0x1904, 0x81a8, 0x7108, 0x700c,
-	0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15b0, 0x81ff,
-	0x15a0, 0x9080, 0x331e, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001,
-	0x0080, 0x9106, 0x0904, 0x81a8, 0x080c, 0x659f, 0x1904, 0x81a8,
-	0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04, 0x9294, 0xff00,
-	0x9286, 0x0600, 0x11a0, 0x080c, 0xadf1, 0x05e8, 0x2b08, 0x7028,
-	0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a,
-	0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xdb44, 0x0408, 0x080c,
-	0x696a, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c, 0x8095, 0x11c0,
-	0x0898, 0x080c, 0xadf1, 0x2b08, 0x0198, 0x6112, 0x6023, 0x0004,
-	0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005, 0x0010,
-	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664,
-	0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x9664,
-	0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
-	0x2011, 0x8049, 0x080c, 0x4b05, 0x080c, 0xae95, 0x0d48, 0x2b08,
-	0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x6156, 0x6017,
-	0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90c7, 0x080c,
-	0x9664, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7020, 0x2060,
-	0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8, 0x6868, 0x9c02,
+	0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x7c90, 0x0005,
+	0x7802, 0x780e, 0x79e3, 0x7802, 0x780e, 0x7802, 0x780e, 0x780e,
+	0x7802, 0x780e, 0x79e3, 0x780e, 0x780e, 0x780e, 0x780e, 0x780e,
+	0x7802, 0x780e, 0x79e3, 0x7802, 0x7802, 0x780e, 0x7802, 0x7802,
+	0x7802, 0x780e, 0x00e6, 0x2071, 0x18fa, 0x2009, 0x0400, 0x0071,
+	0x00ee, 0x0005, 0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000,
+	0x0029, 0x0005, 0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001,
+	0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c81, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
+	0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7985, 0x7007,
+	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7985, 0x0005,
+	0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007,
+	0x0001, 0x0804, 0x79a0, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x79a0, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
+	0x0904, 0x780a, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x79bc,
+	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x79bc,
+	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
+	0x780a, 0x7007, 0x0001, 0x2009, 0x1834, 0x210c, 0x81ff, 0x11a8,
+	0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x62ae,
+	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a,
+	0xa982, 0x080c, 0x6c81, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071,
+	0x0d38, 0x9186, 0x0064, 0x0d20, 0x9186, 0x007c, 0x0d08, 0x9186,
+	0x0028, 0x09f0, 0x9186, 0x0038, 0x09d8, 0x9186, 0x0078, 0x09c0,
+	0x9186, 0x005f, 0x09a8, 0x9186, 0x0056, 0x0990, 0xa897, 0x4005,
+	0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x08a0, 0xa87c, 0x9084,
+	0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x7bb1,
+	0x2900, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c,
+	0x9080, 0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401,
+	0x1a04, 0x7812, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7812, 0x82ff,
+	0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7943, 0x0018,
+	0x9280, 0x7939, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7924,
+	0x080c, 0x1018, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022,
+	0x7054, 0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004,
+	0x9100, 0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e,
+	0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108,
+	0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x10e9, 0xa06c, 0x908e,
+	0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005,
+	0x7020, 0x2048, 0x080c, 0x1031, 0x7014, 0x2048, 0x0804, 0x7812,
+	0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048,
+	0xa906, 0x711a, 0x0804, 0x78dc, 0x7014, 0x2048, 0x7007, 0x0001,
+	0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7bb1, 0x0804,
+	0x7985, 0x793b, 0x793f, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a,
+	0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076,
+	0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc,
+	0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0,
+	0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2,
+	0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094,
+	0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088,
+	0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c,
+	0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004,
+	0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1834, 0x210c,
+	0x81ff, 0x1178, 0x080c, 0x60ae, 0x1108, 0x0005, 0x080c, 0x6ec0,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xce24, 0x080c, 0x6c81, 0x012e,
+	0x0ca0, 0x080c, 0xd229, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70,
+	0x2009, 0x1834, 0x210c, 0x81ff, 0x1188, 0xa888, 0x9005, 0x0188,
+	0xa883, 0x0000, 0x080c, 0x613e, 0x1108, 0x0005, 0xa87a, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x0cb8, 0x2001, 0x0028,
+	0x0ca8, 0x2001, 0x0000, 0x0c90, 0x2009, 0x1834, 0x210c, 0x81ff,
+	0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4,
+	0x0120, 0x080c, 0x6210, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c,
+	0x618b, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
+	0x080c, 0x6c81, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98,
+	0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906,
+	0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030,
+	0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6,
+	0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004,
+	0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9,
+	0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c,
+	0x65ff, 0x11b8, 0x0066, 0xae80, 0x080c, 0x670f, 0x006e, 0x0088,
+	0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6,
+	0x080c, 0x65ff, 0x1110, 0x080c, 0x680f, 0x8108, 0x1f04, 0x7a20,
+	0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x1031, 0x00be, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x00be, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x696e, 0x0580,
+	0x2061, 0x1a71, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff,
+	0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003,
+	0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005,
+	0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff,
+	0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a,
+	0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x7c7a,
+	0x012e, 0x0804, 0x7c74, 0x012e, 0x0804, 0x7c6e, 0x012e, 0x0804,
+	0x7c71, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x696e,
+	0x05e0, 0x2061, 0x1a71, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308,
+	0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c,
+	0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001,
+	0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988,
+	0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318,
+	0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250,
+	0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e,
+	0x0804, 0x7c7a, 0x012e, 0x0804, 0x7c77, 0x012e, 0x0804, 0x7c74,
+	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a71, 0x6300,
+	0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804,
+	0x7c88, 0x012e, 0x0804, 0x7c77, 0x00b6, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061,
+	0x1a71, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888,
+	0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1834, 0x2004,
+	0x9005, 0x0118, 0x080c, 0xae92, 0x0068, 0x6017, 0xf400, 0x605b,
+	0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009, 0x0041,
+	0x080c, 0xaedc, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138,
+	0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x86dd, 0x002e, 0xa87c,
+	0xd0c4, 0x0148, 0x2061, 0x1a71, 0x6000, 0xd08c, 0x1120, 0x6008,
+	0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7c7a,
+	0x00ce, 0x012e, 0x00be, 0x0804, 0x7c74, 0xa984, 0x9186, 0x002e,
+	0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186,
+	0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8,
+	0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c,
+	0x65ff, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065,
+	0x09b8, 0x6007, 0x0024, 0x2001, 0x1986, 0x2004, 0x601a, 0x0804,
+	0x7b0f, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001,
+	0x1834, 0x2004, 0x9005, 0x0150, 0x080c, 0xae92, 0x8eff, 0x0118,
+	0x2e60, 0x080c, 0xae92, 0x00ee, 0x0804, 0x7b0f, 0x6024, 0xc0dc,
+	0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130,
+	0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001,
+	0x080c, 0x90f0, 0x080c, 0x968d, 0x00ee, 0x0804, 0x7b0f, 0x2061,
+	0x1a71, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7c88, 0x0126,
+	0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804,
+	0x7c88, 0x012e, 0xa883, 0x0016, 0x0804, 0x7c81, 0xa883, 0x0007,
+	0x0804, 0x7c81, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001,
+	0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x780a, 0x0040,
+	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7bb1,
+	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061,
+	0x1800, 0x61d0, 0x81ff, 0x1904, 0x7c33, 0x6130, 0xd194, 0x1904,
+	0x7c5d, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x7c27, 0x6068,
+	0x9e02, 0x1a04, 0x7c27, 0x7120, 0x9186, 0x0006, 0x1904, 0x7c19,
+	0x7010, 0x905d, 0x0904, 0x7c33, 0xb800, 0xd0e4, 0x1904, 0x7c57,
+	0x2061, 0x1a71, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0,
+	0x7024, 0xd0dc, 0x1904, 0x7c60, 0xa883, 0x0000, 0xa803, 0x0000,
+	0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904,
+	0x7c63, 0x080c, 0x56cf, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e,
+	0x2e60, 0x080c, 0x85fd, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048,
+	0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904,
+	0x7c63, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883,
+	0x0006, 0x00be, 0x0804, 0x7c81, 0xd184, 0x0db8, 0xd1c4, 0x1190,
+	0x00a0, 0xa974, 0x080c, 0x65ff, 0x15d0, 0xb800, 0xd0e4, 0x15b8,
+	0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883,
+	0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448,
+	0xa883, 0x0035, 0x0430, 0x080c, 0x56d3, 0xd0fc, 0x01e8, 0xa878,
+	0x2070, 0x9e82, 0x1cd0, 0x02c0, 0x6068, 0x9e02, 0x12a8, 0x7120,
+	0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc,
+	0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x7bbd,
+	0x7003, 0x0002, 0x0804, 0x7bbd, 0xa883, 0x0028, 0x0010, 0xa883,
+	0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8,
+	0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014,
+	0x080c, 0xe134, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e,
+	0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009,
+	0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105,
+	0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x0005,
+	0x080c, 0x1031, 0x0005, 0x00d6, 0x080c, 0x85f4, 0x00de, 0x0005,
+	0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c,
+	0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7d72, 0xd09c, 0x11a8,
+	0x2071, 0x1800, 0x70c0, 0x90ea, 0x0020, 0x0278, 0x8001, 0x70c2,
+	0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071,
+	0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de,
+	0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7d72, 0x000e, 0x0005,
+	0xa898, 0x9084, 0x0003, 0x05a8, 0x080c, 0xae0b, 0x05d8, 0x2900,
+	0x6016, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x1138, 0x6008,
+	0xc0fd, 0x600a, 0x2001, 0x196b, 0x2004, 0x0098, 0xa8a0, 0x9084,
+	0x00ff, 0xa99c, 0x918c, 0xff00, 0x9105, 0xa99c, 0x918c, 0x00ff,
+	0x080c, 0x283e, 0x1540, 0x00b6, 0x080c, 0x65ff, 0x2b00, 0x00be,
+	0x1510, 0x6012, 0x6023, 0x0001, 0x2009, 0x0040, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0035, 0x0110, 0x2009, 0x0041, 0x080c, 0xaedc,
+	0x0005, 0xa87b, 0x0101, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81,
+	0x012e, 0x0005, 0xa87b, 0x002c, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6c81, 0x012e, 0x0005, 0xa87b, 0x0028, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c81, 0x012e, 0x080c, 0xae61, 0x0005, 0x00d6, 0x00c6,
+	0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282,
+	0x0004, 0x1a04, 0x7d63, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d,
+	0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084,
+	0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0xae0b, 0x1118, 0x080c,
+	0xaeaf, 0x05a8, 0x6212, 0xa874, 0x0002, 0x7d41, 0x7d46, 0x7d49,
+	0x7d4f, 0x2019, 0x0002, 0x080c, 0xe522, 0x0060, 0x080c, 0xe4be,
+	0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xe4d9, 0x0018, 0xa980,
+	0x080c, 0xe4be, 0x080c, 0xae61, 0xa887, 0x0000, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6c81, 0x012e, 0x00be, 0x001e, 0x002e, 0x003e,
+	0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887, 0x0002,
+	0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887,
+	0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7d74, 0x0006, 0x0016,
+	0x2001, 0x8003, 0x0006, 0x0804, 0x0dde, 0x2001, 0x1834, 0x2004,
+	0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001, 0x0200,
+	0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec,
+	0x1120, 0x080c, 0x157d, 0x00fe, 0x0005, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904,
+	0x7df4, 0x68c0, 0x90aa, 0x0005, 0x0a04, 0x840b, 0x7d44, 0x7c40,
+	0x9584, 0x00f6, 0x1510, 0x9484, 0x7000, 0x0140, 0x908a, 0x2000,
+	0x1260, 0x9584, 0x0700, 0x8007, 0x0804, 0x7dfb, 0x7000, 0x9084,
+	0xff00, 0x9086, 0x8100, 0x0da8, 0x00b0, 0x9484, 0x0fff, 0x1130,
+	0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xe9c1,
+	0x080c, 0x8300, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118,
+	0x080c, 0x835e, 0x19c0, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c,
+	0x7e56, 0x080c, 0x2337, 0x005e, 0x004e, 0x0020, 0x080c, 0xe9c1,
+	0x7817, 0x0140, 0x080c, 0x73bc, 0x0168, 0x2001, 0x0111, 0x2004,
+	0xd08c, 0x0140, 0x6893, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008,
+	0x2003, 0x0000, 0x080c, 0x7e37, 0x2001, 0x19f0, 0x2004, 0x9005,
+	0x090c, 0x968d, 0x0005, 0x0002, 0x7e0d, 0x8122, 0x7e04, 0x7e04,
+	0x7e04, 0x7e04, 0x7e04, 0x7e04, 0x7817, 0x0140, 0x2001, 0x19f0,
+	0x2004, 0x9005, 0x090c, 0x968d, 0x0005, 0x7000, 0x908c, 0xff00,
+	0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286, 0x2000,
+	0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x5730, 0x0070,
+	0x080c, 0x7e76, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x805d,
+	0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x8230, 0x7817, 0x0140,
+	0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x968d, 0x0005, 0x2001,
+	0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518, 0x080c,
+	0x4b04, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056, 0x00f6,
+	0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036, 0x0046,
+	0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019, 0xffff,
+	0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c, 0x4b04,
+	0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6, 0x00c6,
+	0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120, 0x9096,
+	0x0023, 0x1904, 0x802e, 0x9186, 0x0023, 0x15c0, 0x080c, 0x82c5,
+	0x0904, 0x802e, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186, 0x0004,
+	0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904, 0x802e,
+	0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015,
+	0x080c, 0xaedc, 0x0804, 0x802e, 0x908e, 0x0214, 0x0118, 0x908e,
+	0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0xaedc, 0x0804, 0x802e,
+	0x908e, 0x0100, 0x1904, 0x802e, 0x7034, 0x9005, 0x1904, 0x802e,
+	0x2009, 0x0016, 0x080c, 0xaedc, 0x0804, 0x802e, 0x9186, 0x0022,
+	0x1904, 0x802e, 0x7030, 0x908e, 0x0300, 0x1580, 0x68dc, 0xd0a4,
+	0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c, 0x00ff, 0x697e, 0x7004,
+	0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084,
+	0x00ff, 0x0016, 0x2008, 0x080c, 0x2887, 0x7932, 0x7936, 0x001e,
+	0x000e, 0x00fe, 0x080c, 0x283e, 0x695e, 0x703c, 0x00e6, 0x2071,
+	0x0140, 0x7086, 0x2071, 0x1800, 0x70b6, 0x00ee, 0x7034, 0x9005,
+	0x1904, 0x802e, 0x2009, 0x0017, 0x0804, 0x7fde, 0x908e, 0x0400,
+	0x1190, 0x7034, 0x9005, 0x1904, 0x802e, 0x080c, 0x73bc, 0x0120,
+	0x2009, 0x001d, 0x0804, 0x7fde, 0x68dc, 0xc0a5, 0x68de, 0x2009,
+	0x0030, 0x0804, 0x7fde, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005,
+	0x1904, 0x802e, 0x2009, 0x0018, 0x0804, 0x7fde, 0x908e, 0x2010,
+	0x1120, 0x2009, 0x0019, 0x0804, 0x7fde, 0x908e, 0x2110, 0x1120,
+	0x2009, 0x001a, 0x0804, 0x7fde, 0x908e, 0x5200, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x802e, 0x2009, 0x001b, 0x0804, 0x7fde, 0x908e,
+	0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x802e, 0x2009, 0x001c,
+	0x0804, 0x7fde, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804,
+	0x7fde, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x802e,
+	0x2009, 0x0024, 0x0804, 0x7fde, 0x908c, 0xff00, 0x918e, 0x2400,
+	0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c, 0x0904,
+	0x7fde, 0x080c, 0xd905, 0x1904, 0x802e, 0x0804, 0x7fdc, 0x908c,
+	0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804, 0x7fde,
+	0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7fde, 0x908e,
+	0x6104, 0x1530, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208, 0x2204,
+	0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015, 0x211c,
+	0x8108, 0x0046, 0x2124, 0x080c, 0x4b04, 0x004e, 0x8108, 0x0f04,
+	0x7f92, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a, 0x2009,
+	0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0804, 0x7fde,
+	0x908e, 0x6000, 0x1120, 0x2009, 0x003f, 0x0804, 0x7fde, 0x908e,
+	0x5400, 0x1138, 0x080c, 0x83bb, 0x1904, 0x802e, 0x2009, 0x0046,
+	0x04a8, 0x908e, 0x5500, 0x1148, 0x080c, 0x83e3, 0x1118, 0x2009,
+	0x0041, 0x0460, 0x2009, 0x0042, 0x0448, 0x908e, 0x7800, 0x1118,
+	0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009, 0x004e,
+	0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8, 0x908c,
+	0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078, 0x908c,
+	0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038, 0x2009,
+	0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e, 0x1904, 0x8031,
+	0x080c, 0x659e, 0x1904, 0x8031, 0xbe12, 0xbd16, 0x001e, 0x0016,
+	0x080c, 0x73bc, 0x01c0, 0x68dc, 0xd08c, 0x1148, 0x7000, 0x9084,
+	0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168, 0x0040, 0x687c,
+	0x9606, 0x1148, 0x6880, 0x9506, 0x9084, 0xff00, 0x1120, 0x9584,
+	0x00ff, 0xb8c2, 0x0080, 0xb8c0, 0x9005, 0x1168, 0x9186, 0x0046,
+	0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506, 0x9084, 0xff00,
+	0x1110, 0x001e, 0x0098, 0x080c, 0xae0b, 0x01a8, 0x2b08, 0x6112,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110,
+	0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xaedc, 0x00ce, 0x00be,
+	0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
+	0x2011, 0x8049, 0x080c, 0x4b04, 0x080c, 0xaeaf, 0x0d90, 0x2b08,
+	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016, 0x9186,
+	0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009, 0x6017,
+	0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f, 0x0009,
+	0x6003, 0x0001, 0x080c, 0x9138, 0x08a0, 0x080c, 0x32e3, 0x1140,
+	0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009,
+	0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0033, 0x11e8, 0x080c, 0x82c5, 0x0904, 0x80ba, 0x7124,
+	0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15d0,
+	0x2009, 0x0015, 0x080c, 0xaedc, 0x04a8, 0x908e, 0x0100, 0x1590,
+	0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0xaedc, 0x0450,
+	0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518, 0x2009,
+	0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x283e, 0x11b8, 0x080c, 0x659e, 0x11a0, 0xbe12, 0xbd16, 0x080c,
+	0xae0b, 0x0178, 0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x001e, 0x080c, 0xaedc, 0x080c, 0x968d, 0x0010,
+	0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x0046,
+	0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8, 0x9592,
+	0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804,
+	0x811c, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x811c,
+	0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000,
+	0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9, 0x0800,
+	0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f, 0x2071,
+	0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0, 0x9496,
+	0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600, 0x9706,
+	0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745, 0x1148,
+	0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6, 0x0080,
+	0x1d20, 0x8420, 0x8e70, 0x1f04, 0x80f1, 0x82ff, 0x1118, 0x9085,
+	0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e,
+	0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f,
+	0x0002, 0x8139, 0x8139, 0x8139, 0x82d7, 0x8139, 0x8142, 0x816d,
+	0x81fb, 0x8139, 0x8139, 0x8139, 0x8139, 0x8139, 0x8139, 0x8139,
+	0x8139, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c,
+	0x968d, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160,
+	0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6868, 0x9c02,
 	0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106,
 	0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009,
-	0x0045, 0x080c, 0xaec2, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004,
-	0x9005, 0x090c, 0x9664, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002,
-	0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c,
-	0x32dc, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000,
-	0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005,
-	0x821e, 0x821f, 0x821e, 0x821e, 0x827e, 0x828d, 0x0005, 0x00b6,
-	0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x827c, 0x700c,
-	0x7108, 0x080c, 0x283e, 0x1904, 0x827c, 0x080c, 0x659f, 0x1904,
-	0x827c, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x696a,
-	0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x829c, 0x00ce,
-	0x05d8, 0x080c, 0xadf1, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xcf90,
-	0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xaec2,
-	0x0458, 0x080c, 0x696a, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c,
-	0x6972, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xadf1, 0x2b08,
-	0x01d8, 0x6112, 0x080c, 0xcf90, 0x6023, 0x0005, 0x7120, 0x610a,
-	0x2009, 0x0088, 0x080c, 0xaec2, 0x0078, 0x080c, 0xadf1, 0x2b08,
-	0x0158, 0x6112, 0x080c, 0xcf90, 0x6023, 0x0004, 0x7120, 0x610a,
-	0x2009, 0x0001, 0x080c, 0xaec2, 0x00be, 0x0005, 0x7110, 0xd1bc,
-	0x0158, 0x00d1, 0x0148, 0x080c, 0x81fd, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x0089, 0x080c, 0xaec2, 0x0005, 0x7110, 0xd1bc, 0x0158,
-	0x0059, 0x0148, 0x080c, 0x81fd, 0x1130, 0x7124, 0x610a, 0x2009,
-	0x008a, 0x080c, 0xaec2, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0007,
-	0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x181a, 0x2004, 0x9c02,
-	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110,
-	0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007, 0x11b0, 0x9c82,
-	0x1cd0, 0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff,
-	0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106,
-	0x1120, 0x2009, 0x0051, 0x080c, 0xaec2, 0x7817, 0x0140, 0x2001,
-	0x19f0, 0x2004, 0x9005, 0x090c, 0x9664, 0x00be, 0x0005, 0x2031,
-	0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005, 0x2031,
-	0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005, 0x00c6,
-	0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086, 0xc000, 0x05d0,
-	0x080c, 0xadf1, 0x05b8, 0x0066, 0x00c6, 0x0046, 0x2011, 0x0263,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x283e, 0x15a0, 0x080c, 0x659f,
-	0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012, 0x080c,
-	0xcf90, 0x080c, 0x0fff, 0x0510, 0x2900, 0x605a, 0x9006, 0xa802,
-	0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9, 0x000e, 0xa860,
-	0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003, 0x006e, 0x6616,
-	0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001, 0x080c, 0x910f,
-	0x080c, 0x9664, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0xae47,
-	0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c,
-	0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x838c,
-	0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904,
-	0x838e, 0x7030, 0x908e, 0x0400, 0x0904, 0x838e, 0x908e, 0x6000,
-	0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009,
-	0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x6928,
-	0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106,
-	0x1518, 0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104, 0x9106,
-	0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8, 0x908e,
-	0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000, 0x09b8,
-	0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x829c, 0x0128, 0x6004,
-	0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001,
-	0x00ce, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020,
-	0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x027a, 0x080c, 0xbdef, 0x1178, 0xd48c, 0x0148,
-	0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c, 0xbdef,
-	0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e,
-	0x015e, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020,
-	0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0272, 0x080c, 0xbdef, 0x1178, 0xd48c, 0x0148,
-	0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c, 0xbdef,
-	0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e,
-	0x015e, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc,
-	0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084,
-	0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe,
-	0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee,
-	0x0005, 0x2071, 0x19fa, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006,
-	0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x7026,
-	0x702b, 0xa26f, 0x7032, 0x7037, 0xa2dd, 0x703f, 0xffff, 0x7042,
-	0x7047, 0x556f, 0x704a, 0x705b, 0x856b, 0x080c, 0x1018, 0x090c,
-	0x0dd5, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab,
-	0xdcb0, 0x0005, 0x2071, 0x19fa, 0x1d04, 0x84b9, 0x2091, 0x6000,
-	0x700c, 0x8001, 0x700e, 0x1530, 0x2001, 0x013c, 0x2004, 0x9005,
-	0x190c, 0x85b0, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158, 0x3a00,
-	0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000,
-	0x080c, 0x0dd5, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091,
-	0x8000, 0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044,
-	0x080f, 0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188,
-	0x7020, 0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126,
-	0x9186, 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028,
-	0x080f, 0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160,
-	0x702f, 0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c,
-	0xa3fe, 0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310,
-	0x8001, 0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a,
-	0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e,
-	0x7058, 0x080f, 0x7018, 0x900d, 0x01d8, 0x0016, 0x7070, 0x900d,
-	0x0158, 0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109,
-	0x7172, 0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a,
-	0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f,
-	0x012e, 0x7004, 0x0002, 0x84e1, 0x84e2, 0x84fe, 0x00e6, 0x2071,
-	0x19fa, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009,
-	0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19fa, 0x701c, 0x9206,
-	0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
-	0x00e6, 0x2071, 0x19fa, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee,
-	0x0005, 0x0005, 0x00b6, 0x7110, 0x080c, 0x6600, 0x1168, 0xb888,
-	0x8001, 0x0250, 0xb88a, 0x1140, 0x0126, 0x2091, 0x8000, 0x0016,
-	0x080c, 0x9664, 0x001e, 0x012e, 0x8108, 0x9182, 0x0800, 0x0218,
-	0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x7014, 0x2060,
-	0x0126, 0x2091, 0x8000, 0x6040, 0x9005, 0x0128, 0x8001, 0x6042,
-	0x1110, 0x080c, 0xce21, 0x6018, 0x9005, 0x0558, 0x8001, 0x601a,
-	0x1540, 0x6120, 0x9186, 0x0003, 0x0148, 0x9186, 0x0006, 0x0130,
-	0x9186, 0x0009, 0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c, 0xcb1b,
-	0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082,
-	0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110, 0x080c,
-	0xc819, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x181a, 0x2004,
-	0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005, 0x00e6,
-	0x2071, 0x19fa, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
-	0x2001, 0x1a03, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19fa,
-	0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x1a06, 0x2013,
-	0x0000, 0x0005, 0x00e6, 0x2071, 0x19fa, 0x711a, 0x721e, 0x700b,
-	0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056,
-	0x2001, 0x1a08, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068,
-	0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c,
-	0x10e9, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x842a,
-	0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
-	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19fa, 0x7172, 0x7276,
-	0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19fa,
-	0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
-	0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061, 0x0100, 0x60f0,
-	0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f, 0x1220, 0x8108,
-	0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x2061,
-	0x1a71, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003, 0x8003, 0x8003,
-	0x9080, 0x1a71, 0x2060, 0x0005, 0xa884, 0x908a, 0x199a, 0x1638,
-	0x9005, 0x1150, 0x00c6, 0x2061, 0x1a71, 0x6014, 0x00ce, 0x9005,
-	0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff, 0x01b0, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c, 0x00c0, 0x918e,
-	0x00c0, 0x0904, 0x865e, 0xd0b4, 0x1168, 0xd0bc, 0x1904, 0x8637,
-	0x2009, 0x0006, 0x080c, 0x868b, 0x0005, 0x900e, 0x0c60, 0x2001,
-	0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e,
-	0x0003, 0x1904, 0x8685, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8,
-	0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084, 0x1138,
-	0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xaec2, 0x0005, 0x87ff,
-	0x1de8, 0x2009, 0x0042, 0x0804, 0xaec2, 0x6110, 0x00b6, 0x2158,
-	0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026, 0x0c00,
-	0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0, 0xd0fc,
-	0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x8685,
-	0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78,
-	0x080c, 0x1725, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042,
-	0x080c, 0xaec2, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
-	0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc, 0x0188,
-	0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003, 0x908e,
-	0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0xaec2,
-	0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c,
-	0xaec2, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
-	0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019,
-	0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xcb1b, 0x0518, 0x6014,
-	0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c,
-	0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a71,
-	0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce,
-	0x080c, 0x6ab4, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c,
-	0x85d4, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a71,
-	0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce,
-	0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120,
-	0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923, 0x7003,
-	0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001, 0x080c,
-	0x1018, 0x090c, 0x0dd5, 0xa867, 0x0006, 0xa86b, 0x0001, 0xa8ab,
-	0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000, 0x0005,
-	0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c, 0x721e,
-	0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a, 0xa89a,
-	0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a, 0x9005,
-	0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100, 0x9210,
-	0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178, 0xc084,
-	0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d, 0x2104,
-	0x9082, 0x0007, 0x2009, 0x1ac8, 0x200a, 0x000e, 0xc095, 0x7012,
-	0x2008, 0x2001, 0x003b, 0x080c, 0x15ee, 0x9006, 0x2071, 0x193c,
-	0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6, 0x0126,
-	0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001, 0x0008,
-	0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080, 0x0008,
-	0x1f04, 0x873e, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877, 0x20a9,
-	0x0007, 0x00c6, 0x080c, 0xadf1, 0x6023, 0x0009, 0x6003, 0x0004,
-	0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c, 0x88c4,
-	0x012e, 0x1f04, 0x874a, 0x9006, 0x00ce, 0x015e, 0x012e, 0x00ee,
-	0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096, 0x0086,
-	0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004, 0xd084,
-	0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021, 0x002c,
-	0x2029, 0x000a, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900, 0x6016,
-	0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a, 0xa8aa,
-	0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010, 0xa89e,
-	0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160, 0x080c,
-	0x0fff, 0x090c, 0x0dd5, 0xad66, 0x2b00, 0xa802, 0x2900, 0xb806,
-	0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e, 0x009e,
-	0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923, 0x7004,
-	0x004b, 0x700c, 0x0002, 0x87b6, 0x87af, 0x87af, 0x0005, 0x87c0,
-	0x8821, 0x8821, 0x8821, 0x8822, 0x8833, 0x8833, 0x700c, 0x0cba,
-	0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128, 0x78a0,
-	0x79a0, 0x9106, 0x1904, 0x8814, 0x2001, 0x0005, 0x2004, 0xd0bc,
-	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
-	0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c, 0x8862,
-	0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210, 0x2009,
-	0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004, 0x9100,
-	0x9202, 0x0e48, 0x080c, 0x89ae, 0x2200, 0x9102, 0x0208, 0x2208,
-	0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c, 0x8ab7,
-	0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091, 0x8000,
-	0x2009, 0x1a18, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002, 0x012e,
-	0x080c, 0x1108, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc,
-	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
-	0x0005, 0x0005, 0x700c, 0x0002, 0x8827, 0x882a, 0x8829, 0x080c,
-	0x87be, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048, 0xa974,
-	0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048, 0x7018,
-	0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020, 0xa892,
-	0x9006, 0x0068, 0x0006, 0x080c, 0x8ab7, 0x2100, 0xaa8c, 0x9210,
-	0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e, 0x009e,
-	0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6, 0x2071,
-	0x1923, 0x700c, 0x0002, 0x8860, 0x8860, 0x885e, 0x700f, 0x0001,
-	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005, 0x0508,
-	0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000, 0x080c,
-	0x88cd, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c, 0x8914,
-	0x00ee, 0x0178, 0x0096, 0x080c, 0x1018, 0x2900, 0x009e, 0x0148,
-	0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000, 0x012e,
-	0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6, 0x2940,
-	0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f, 0x2068,
-	0x9d88, 0x2090, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c, 0x8a3c,
-	0x080c, 0x2048, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f, 0x2004,
-	0xa88a, 0x080c, 0x1725, 0x781f, 0x0101, 0x7813, 0x0000, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8923, 0x012e, 0x008e, 0x00ce, 0x00de,
-	0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032, 0x2001,
-	0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923, 0x7030,
-	0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6, 0x0026,
-	0x9b80, 0x8b96, 0x2005, 0x906d, 0x090c, 0x0dd5, 0x9b80, 0x8b8e,
-	0x2005, 0x9065, 0x090c, 0x0dd5, 0x6114, 0x2600, 0x9102, 0x0248,
-	0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce, 0x00de,
-	0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178, 0xc085,
-	0x6856, 0x2011, 0x8026, 0x080c, 0x4b05, 0x684c, 0x0096, 0x904d,
-	0x090c, 0x0dd5, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006, 0x2030,
-	0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011, 0x8025,
-	0x080c, 0x4b05, 0x684c, 0x0096, 0x904d, 0x090c, 0x0dd5, 0xa800,
-	0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008, 0x8319,
-	0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210, 0x9302,
-	0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c, 0x0dd5,
-	0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0dd5, 0x2069,
-	0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904, 0x8108,
-	0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e, 0x2003,
-	0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014, 0x2048,
-	0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x1031, 0x009e, 0xa8ab,
-	0x0000, 0x080c, 0x0fb1, 0x080c, 0xae47, 0x00ce, 0x009e, 0x0005,
-	0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110, 0x9006,
-	0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000, 0x0178,
-	0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8cc9, 0x00be,
-	0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861, 0x0005,
-	0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071, 0x1923,
-	0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000, 0x7112,
-	0x2001, 0x003b, 0x080c, 0x15ee, 0x00ee, 0x0005, 0x0096, 0x00d6,
-	0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016, 0x702a,
-	0x7026, 0x702f, 0x0000, 0x080c, 0x8b16, 0x0170, 0x080c, 0x8b4b,
-	0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001, 0x701f,
-	0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6, 0x0096,
-	0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100, 0x9202,
-	0x1618, 0x080c, 0x8b4b, 0x090c, 0x0dd5, 0x7018, 0x9005, 0x1160,
-	0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e, 0xa806,
-	0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900, 0xa002,
-	0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c, 0x9080,
-	0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de, 0x008e,
-	0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f, 0x831e,
-	0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398, 0x0003,
-	0x7104, 0x080c, 0x8ab7, 0x810c, 0x2100, 0x9318, 0x8003, 0x2228,
-	0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500, 0x8004,
-	0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c, 0x8ac0,
-	0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102, 0x701e,
-	0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000, 0x2048,
-	0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c, 0x89ae,
-	0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000, 0x0008,
-	0x7106, 0x2500, 0x9212, 0x1904, 0x89ed, 0x012e, 0x00ee, 0x014e,
-	0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x9580, 0x8b8e, 0x2005, 0x9075, 0x090c, 0x0dd5,
-	0x080c, 0x8a92, 0x012e, 0x9580, 0x8b8a, 0x2005, 0x9075, 0x090c,
-	0x0dd5, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f, 0x831e,
-	0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100, 0x2098,
-	0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9, 0x0002,
-	0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8a7c, 0x8a7c, 0x8a7e, 0x8a7c,
-	0x8a7e, 0x8a7c, 0x8a7c, 0x8a7c, 0x8a7c, 0x8a7c, 0x8a84, 0x8a7c,
-	0x8a84, 0x8a7c, 0x8a7c, 0x8a7c, 0x080c, 0x0dd5, 0x4104, 0x20a9,
-	0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003, 0x4104,
-	0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee, 0x002e,
-	0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c, 0x2110,
-	0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282, 0x000a,
-	0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006, 0x080c,
-	0x8b5a, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010, 0x8001,
-	0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005, 0x0006,
-	0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e, 0x0005,
-	0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c, 0x0240,
-	0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e, 0x0005,
-	0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810, 0x2019,
-	0x0001, 0x2031, 0x8b00, 0x9112, 0x0220, 0x0118, 0x8318, 0x2208,
-	0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804, 0xd084,
-	0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967, 0x0a67,
-	0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082, 0x0002,
-	0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67, 0x0cd0,
-	0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800, 0x7128,
-	0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318, 0x0cd8,
-	0x2031, 0x8b13, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096, 0x0046,
-	0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8b92, 0x2005, 0x9005,
-	0x090c, 0x0dd5, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1018, 0x01d0,
-	0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c, 0x1018,
-	0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026, 0x94a2,
-	0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e, 0x004e,
-	0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00, 0x080c,
-	0x1031, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024, 0x2048,
-	0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
-	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802, 0x2900,
-	0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004, 0x9005,
-	0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x1031, 0x000e, 0x0cb8,
-	0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048, 0xa800,
-	0x0006, 0x080c, 0x1031, 0x000e, 0x0cb8, 0x9006, 0x7002, 0x700a,
-	0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026, 0x702e,
-	0x009e, 0x0005, 0x1a64, 0x0000, 0x0000, 0x0000, 0x1930, 0x0000,
-	0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877, 0x0000,
-	0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8, 0x2040,
-	0x2071, 0x1877, 0x080c, 0x8cb4, 0xa067, 0x0023, 0x6010, 0x905d,
-	0x0904, 0x8c89, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0, 0xa176,
-	0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000, 0xa898,
-	0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031, 0x0018,
-	0xa068, 0x908a, 0x0019, 0x1a0c, 0x0dd5, 0x2020, 0x2050, 0x2940,
-	0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x2090, 0x2c65,
-	0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c, 0x0dd5,
-	0x9082, 0x001b, 0x0002, 0x8bf6, 0x8bf6, 0x8bf8, 0x8bf6, 0x8bf6,
-	0x8bf6, 0x8bfa, 0x8bf6, 0x8bf6, 0x8bf6, 0x8bfc, 0x8bf6, 0x8bf6,
-	0x8bf6, 0x8bfe, 0x8bf6, 0x8bf6, 0x8bf6, 0x8c00, 0x8bf6, 0x8bf6,
-	0x8bf6, 0x8c02, 0x8bf6, 0x8bf6, 0x8bf6, 0x8c04, 0x080c, 0x0dd5,
-	0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0, 0x0488,
-	0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a, 0x0034,
-	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c28, 0x8c26, 0x8c26,
-	0x8c26, 0x8c26, 0x8c26, 0x8c2a, 0x8c26, 0x8c26, 0x8c26, 0x8c26,
-	0x8c26, 0x8c2c, 0x8c26, 0x8c26, 0x8c26, 0x8c26, 0x8c26, 0x8c2e,
-	0x8c26, 0x8c26, 0x8c26, 0x8c26, 0x8c26, 0x8c30, 0x080c, 0x0dd5,
-	0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8, 0x0008,
-	0xa1e0, 0x2600, 0x0002, 0x8c4c, 0x8c4e, 0x8c50, 0x8c52, 0x8c54,
-	0x8c56, 0x8c58, 0x8c5a, 0x8c5c, 0x8c5e, 0x8c60, 0x8c62, 0x8c64,
-	0x8c66, 0x8c68, 0x8c6a, 0x8c6c, 0x8c6e, 0x8c70, 0x8c72, 0x8c74,
-	0x8c76, 0x8c78, 0x8c7a, 0x8c7c, 0x080c, 0x0dd5, 0xb9e2, 0x0468,
-	0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2, 0x0428,
-	0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2, 0x00e8,
-	0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2, 0x00a8,
-	0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2, 0x0068,
-	0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992, 0x0028,
-	0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421, 0x0120,
-	0x080c, 0x2048, 0x0804, 0x8bd0, 0x00ae, 0x00be, 0x00ce, 0x00ee,
-	0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff, 0x9006,
-	0x0804, 0x8bb2, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058, 0xb810,
-	0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0xbba0,
-	0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b05, 0x004e, 0x003e,
-	0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834, 0x910a,
-	0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238, 0x0130,
-	0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a, 0xa26a,
-	0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b, 0x0200,
-	0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001, 0x7818,
-	0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079, 0x0000,
-	0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106, 0x0140,
-	0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0dd5, 0x2068, 0x0cb0,
-	0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b, 0x0200,
-	0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x00c6,
-	0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff, 0x2071,
-	0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04, 0x8d09,
-	0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90, 0xb8ac,
-	0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004, 0x601b,
-	0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048, 0xa88b,
-	0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0dd5, 0x080c,
-	0x1031, 0x080c, 0x88c4, 0x0c18, 0x2071, 0x0300, 0x701b, 0x0200,
-	0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x0005,
-	0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x283e, 0x015e,
-	0x11b0, 0x080c, 0x659f, 0x190c, 0x0dd5, 0x000e, 0x001e, 0xb912,
-	0xb816, 0x080c, 0xadf1, 0x0140, 0x2b00, 0x6012, 0x6023, 0x0001,
-	0x2009, 0x0001, 0x080c, 0xaec2, 0x00be, 0x00ce, 0x0005, 0x000e,
-	0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5,
-	0x0013, 0x006e, 0x0005, 0x8d7b, 0x8d7b, 0x8d7b, 0x8d7d, 0x8dce,
-	0x8d7b, 0x8d7b, 0x8d7b, 0x8e31, 0x8d7b, 0x8e6e, 0x8d7b, 0x8d7b,
-	0x8d7b, 0x8d7b, 0x8d7b, 0x080c, 0x0dd5, 0x9182, 0x0040, 0x0002,
-	0x8d90, 0x8d90, 0x8d90, 0x8d90, 0x8d90, 0x8d90, 0x8d90, 0x8d90,
-	0x8d90, 0x8d92, 0x8da7, 0x8d90, 0x8d90, 0x8d90, 0x8d90, 0x8dba,
-	0x080c, 0x0dd5, 0x0096, 0x080c, 0x9614, 0x080c, 0x9790, 0x6114,
-	0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500,
-	0x00be, 0x080c, 0x6a7f, 0x080c, 0xae47, 0x009e, 0x0005, 0x080c,
-	0x9614, 0x00d6, 0x6114, 0x080c, 0xcb1b, 0x0130, 0x0096, 0x6114,
-	0x2148, 0x080c, 0x6c79, 0x009e, 0x00de, 0x080c, 0xae47, 0x080c,
-	0x9790, 0x0005, 0x080c, 0x9614, 0x080c, 0x31bc, 0x6114, 0x0096,
-	0x2148, 0x080c, 0xcb1b, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6c79,
-	0x009e, 0x080c, 0xae47, 0x080c, 0x9790, 0x0005, 0x601b, 0x0000,
-	0x9182, 0x0040, 0x0096, 0x0002, 0x8de9, 0x8de9, 0x8de9, 0x8de9,
-	0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8deb, 0x8de9, 0x8de9, 0x8de9,
-	0x8e2d, 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8de9, 0x8df1,
-	0x8de9, 0x080c, 0x0dd5, 0x6114, 0x2148, 0xa938, 0x918e, 0xffff,
-	0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8b9a, 0x0096, 0xa8a8,
-	0x2048, 0x080c, 0x6a17, 0x009e, 0xa8ab, 0x0000, 0x6010, 0x9005,
-	0x0128, 0x00b6, 0x2058, 0x080c, 0x8cc9, 0x00be, 0xae88, 0x00b6,
-	0x2059, 0x0000, 0x080c, 0x88cd, 0x00be, 0x01e0, 0x2071, 0x193c,
-	0x080c, 0x8914, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001, 0x1946,
-	0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x0fff, 0x2900, 0x009e,
-	0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x888b, 0x00fe, 0x00ee,
-	0x009e, 0x0005, 0x080c, 0x88c4, 0x0cd0, 0x080c, 0x8edb, 0x009e,
-	0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x8e45, 0x8e45, 0x8e45,
-	0x8e47, 0x8e45, 0x8e45, 0x8e45, 0x8e6c, 0x8e45, 0x8e45, 0x8e45,
-	0x8e45, 0x8e45, 0x8e45, 0x8e45, 0x8e45, 0x080c, 0x0dd5, 0x6003,
-	0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa846, 0xa8b0, 0xa84a,
-	0xa837, 0x0000, 0xa83b, 0x0000, 0xa884, 0x9092, 0x199a, 0x0210,
-	0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x2c10,
-	0x080c, 0x1bad, 0x080c, 0x912c, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x9790, 0x012e, 0x009e, 0x0005, 0x080c, 0x0dd5, 0x080c, 0x9614,
-	0x080c, 0x9790, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6,
-	0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6c79, 0x080c, 0xae47,
-	0x009e, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096,
-	0x0013, 0x009e, 0x0005, 0x8e9b, 0x8e9b, 0x8e9b, 0x8e9d, 0x8eae,
-	0x8e9b, 0x8e9b, 0x8e9b, 0x8e9b, 0x8e9b, 0x8e9b, 0x8e9b, 0x8e9b,
-	0x8e9b, 0x8e9b, 0x8e9b, 0x080c, 0x0dd5, 0x080c, 0xa7b2, 0x6114,
-	0x2148, 0xa87b, 0x0006, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500,
-	0x00be, 0x080c, 0x6c79, 0x080c, 0xae47, 0x0005, 0x0461, 0x0005,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x0013, 0x009e,
-	0x0005, 0x8ec9, 0x8ec9, 0x8ec9, 0x8ecb, 0x8edb, 0x8ec9, 0x8ec9,
-	0x8ec9, 0x8ec9, 0x8ec9, 0x8ec9, 0x8ec9, 0x8ec9, 0x8ec9, 0x8ec9,
-	0x8ec9, 0x080c, 0x0dd5, 0x0036, 0x00e6, 0x2071, 0x19e7, 0x703c,
-	0x9c06, 0x1120, 0x2019, 0x0000, 0x080c, 0xa59c, 0x080c, 0xa7b2,
-	0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b, 0x0000, 0x6014,
-	0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8cc9,
-	0x00be, 0x2071, 0x193c, 0x080c, 0x8914, 0x0160, 0x2001, 0x187f,
-	0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c, 0x888b, 0x00ee,
-	0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8, 0x2048, 0x080c,
-	0x1031, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x88c4, 0x0c80, 0x0000,
+	0x0046, 0x080c, 0xaedc, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004,
+	0x9005, 0x090c, 0x968d, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484,
+	0x0fff, 0x0904, 0x81d1, 0x7110, 0xd1bc, 0x1904, 0x81d1, 0x7108,
+	0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15b0,
+	0x81ff, 0x15a0, 0x9080, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f,
+	0x2001, 0x0080, 0x9106, 0x0904, 0x81d1, 0x080c, 0x659e, 0x1904,
+	0x81d1, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04, 0x9294,
+	0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0xae0b, 0x05e8, 0x2b08,
+	0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006, 0x7120,
+	0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xdb63, 0x0408,
+	0x080c, 0x6972, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c, 0x80be,
+	0x11c0, 0x0898, 0x080c, 0xae0b, 0x2b08, 0x0198, 0x6112, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005,
+	0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c,
+	0x968d, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c,
+	0x968d, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x4b04, 0x080c, 0xaeaf, 0x0d48,
+	0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x6156,
+	0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7020,
+	0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8, 0x6868,
+	0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
+	0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x0045, 0x080c, 0xaedc, 0x7817, 0x0140, 0x2001, 0x19f0,
+	0x2004, 0x9005, 0x090c, 0x968d, 0x00be, 0x0005, 0x6120, 0x9186,
+	0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x32e3, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086,
+	0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b,
+	0x0005, 0x8247, 0x8248, 0x8247, 0x8247, 0x82a7, 0x82b6, 0x0005,
+	0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x82a5,
+	0x700c, 0x7108, 0x080c, 0x283e, 0x1904, 0x82a5, 0x080c, 0x659e,
+	0x1904, 0x82a5, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c,
+	0x6972, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x82c5,
+	0x00ce, 0x05d8, 0x080c, 0xae0b, 0x2b08, 0x05b8, 0x6112, 0x080c,
+	0xcfaa, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
+	0xaedc, 0x0458, 0x080c, 0x6972, 0x0148, 0x9086, 0x0004, 0x0130,
+	0x080c, 0x697a, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xae0b,
+	0x2b08, 0x01d8, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0005, 0x7120,
+	0x610a, 0x2009, 0x0088, 0x080c, 0xaedc, 0x0078, 0x080c, 0xae0b,
+	0x2b08, 0x0158, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0004, 0x7120,
+	0x610a, 0x2009, 0x0001, 0x080c, 0xaedc, 0x00be, 0x0005, 0x7110,
+	0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x8226, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x0089, 0x080c, 0xaedc, 0x0005, 0x7110, 0xd1bc,
+	0x0158, 0x0059, 0x0148, 0x080c, 0x8226, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x008a, 0x080c, 0xaedc, 0x0005, 0x7020, 0x2060, 0x9c84,
+	0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6,
+	0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007, 0x11b0,
+	0x9c82, 0x1cd0, 0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084,
+	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914,
+	0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0xaedc, 0x7817, 0x0140,
+	0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x968d, 0x00be, 0x0005,
+	0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005,
+	0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005,
+	0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086, 0xc000,
+	0x05d0, 0x080c, 0xae0b, 0x05b8, 0x0066, 0x00c6, 0x0046, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e, 0x15a0, 0x080c,
+	0x659e, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012,
+	0x080c, 0xcfaa, 0x080c, 0x0fff, 0x0510, 0x2900, 0x605a, 0x9006,
+	0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9, 0x000e,
+	0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003, 0x006e,
+	0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c,
+	0xae61, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000,
+	0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904,
+	0x83b5, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005,
+	0x1904, 0x83b7, 0x7030, 0x908e, 0x0400, 0x0904, 0x83b7, 0x908e,
+	0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8,
+	0x2009, 0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c,
+	0x6930, 0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff,
+	0x9106, 0x1518, 0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104,
+	0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8,
+	0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000,
+	0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x82c5, 0x0128,
+	0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038,
+	0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x027a, 0x080c, 0xbe09, 0x1178, 0xd48c,
+	0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c,
+	0xbe09, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e,
+	0x004e, 0x015e, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038,
+	0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x0272, 0x080c, 0xbe09, 0x1178, 0xd48c,
+	0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c,
+	0xbe09, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e,
+	0x004e, 0x015e, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5,
+	0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834,
+	0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802,
+	0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036,
+	0x00ee, 0x0005, 0x2071, 0x19fa, 0x7003, 0x0003, 0x700f, 0x0361,
+	0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007, 0x0000,
+	0x7026, 0x702b, 0xa289, 0x7032, 0x7037, 0xa2f7, 0x703f, 0xffff,
+	0x7042, 0x7047, 0x556e, 0x704a, 0x705b, 0x8594, 0x080c, 0x1018,
+	0x090c, 0x0dd5, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100,
+	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19fa, 0x1d04, 0x84e2, 0x2091,
+	0x6000, 0x700c, 0x8001, 0x700e, 0x1530, 0x2001, 0x013c, 0x2004,
+	0x9005, 0x190c, 0x85d9, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158,
+	0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1,
+	0x0000, 0x080c, 0x0dd5, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126,
+	0x2091, 0x8000, 0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130,
+	0x7044, 0x080f, 0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d,
+	0x0188, 0x7020, 0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109,
+	0x7126, 0x9186, 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110,
+	0x7028, 0x080f, 0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e,
+	0x1160, 0x702f, 0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f,
+	0x090c, 0xa418, 0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118,
+	0x0310, 0x8001, 0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001,
+	0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150,
+	0x714e, 0x7058, 0x080f, 0x7018, 0x900d, 0x01d8, 0x0016, 0x7070,
+	0x900d, 0x0158, 0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009,
+	0x8109, 0x7172, 0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001,
+	0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c,
+	0x080f, 0x012e, 0x7004, 0x0002, 0x850a, 0x850b, 0x8527, 0x00e6,
+	0x2071, 0x19fa, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b,
+	0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19fa, 0x701c,
+	0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee,
+	0x0005, 0x00e6, 0x2071, 0x19fa, 0xb888, 0x9102, 0x0208, 0xb98a,
+	0x00ee, 0x0005, 0x0005, 0x00b6, 0x7110, 0x080c, 0x65ff, 0x1168,
+	0xb888, 0x8001, 0x0250, 0xb88a, 0x1140, 0x0126, 0x2091, 0x8000,
+	0x0016, 0x080c, 0x968d, 0x001e, 0x012e, 0x8108, 0x9182, 0x0800,
+	0x0218, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x7014,
+	0x2060, 0x0126, 0x2091, 0x8000, 0x6040, 0x9005, 0x0128, 0x8001,
+	0x6042, 0x1110, 0x080c, 0xce3b, 0x6018, 0x9005, 0x0558, 0x8001,
+	0x601a, 0x1540, 0x6120, 0x9186, 0x0003, 0x0148, 0x9186, 0x0006,
+	0x0130, 0x9186, 0x0009, 0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c,
+	0xcb35, 0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280,
+	0x9082, 0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110,
+	0x080c, 0xc833, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x181a,
+	0x2004, 0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005,
+	0x00e6, 0x2071, 0x19fa, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee,
+	0x0005, 0x2001, 0x1a03, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071,
+	0x19fa, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x1a06,
+	0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19fa, 0x711a, 0x721e,
+	0x700b, 0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000,
+	0x7056, 0x2001, 0x1a08, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150,
+	0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e,
+	0x080c, 0x10e9, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096,
+	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c,
+	0x8453, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19fa, 0x7172,
+	0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
+	0x19fa, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee,
+	0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061, 0x0100,
+	0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f, 0x1220,
+	0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005, 0x00c6,
+	0x2061, 0x1a71, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003, 0x8003,
+	0x8003, 0x9080, 0x1a71, 0x2060, 0x0005, 0xa884, 0x908a, 0x199a,
+	0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a71, 0x6014, 0x00ce,
+	0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff, 0x01b0,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c, 0x00c0,
+	0x918e, 0x00c0, 0x0904, 0x8687, 0xd0b4, 0x1168, 0xd0bc, 0x1904,
+	0x8660, 0x2009, 0x0006, 0x080c, 0x86b4, 0x0005, 0x900e, 0x0c60,
+	0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120,
+	0x918e, 0x0003, 0x1904, 0x86ae, 0x908c, 0x2020, 0x918e, 0x2020,
+	0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084,
+	0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xaedc, 0x0005,
+	0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0xaedc, 0x6110, 0x00b6,
+	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026,
+	0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0,
+	0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904,
+	0x86ae, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6,
+	0x2c78, 0x080c, 0x1725, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009,
+	0x0042, 0x080c, 0xaedc, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc,
+	0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003,
+	0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c,
+	0xaedc, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043,
+	0x080c, 0xaedc, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
+	0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004,
+	0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xcb35, 0x0518,
+	0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188,
+	0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061,
+	0x1a71, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206,
+	0x00ce, 0x080c, 0x6abc, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000,
+	0x190c, 0x85fd, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061,
+	0x1a71, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002,
+	0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005,
+	0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923,
+	0x7003, 0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001,
+	0x080c, 0x1018, 0x090c, 0x0dd5, 0xa867, 0x0006, 0xa86b, 0x0001,
+	0xa8ab, 0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000,
+	0x0005, 0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c,
+	0x721e, 0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a,
+	0xa89a, 0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a,
+	0x9005, 0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100,
+	0x9210, 0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178,
+	0xc084, 0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d,
+	0x2104, 0x9082, 0x0007, 0x2009, 0x1ac8, 0x200a, 0x000e, 0xc095,
+	0x7012, 0x2008, 0x2001, 0x003b, 0x080c, 0x15ee, 0x9006, 0x2071,
+	0x193c, 0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6,
+	0x0126, 0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001,
+	0x0008, 0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080,
+	0x0008, 0x1f04, 0x8767, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877,
+	0x20a9, 0x0007, 0x00c6, 0x080c, 0xae0b, 0x6023, 0x0009, 0x6003,
+	0x0004, 0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x88ed, 0x012e, 0x1f04, 0x8773, 0x9006, 0x00ce, 0x015e, 0x012e,
+	0x00ee, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096,
+	0x0086, 0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004,
+	0xd084, 0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021,
+	0x002c, 0x2029, 0x000a, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900,
+	0x6016, 0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a,
+	0xa8aa, 0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010,
+	0xa89e, 0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160,
+	0x080c, 0x0fff, 0x090c, 0x0dd5, 0xad66, 0x2b00, 0xa802, 0x2900,
+	0xb806, 0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e,
+	0x009e, 0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923,
+	0x7004, 0x004b, 0x700c, 0x0002, 0x87df, 0x87d8, 0x87d8, 0x0005,
+	0x87e9, 0x884a, 0x884a, 0x884a, 0x884b, 0x885c, 0x885c, 0x700c,
+	0x0cba, 0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128,
+	0x78a0, 0x79a0, 0x9106, 0x1904, 0x883d, 0x2001, 0x0005, 0x2004,
+	0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8,
+	0x012e, 0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c,
+	0x888b, 0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210,
+	0x2009, 0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004,
+	0x9100, 0x9202, 0x0e48, 0x080c, 0x89d7, 0x2200, 0x9102, 0x0208,
+	0x2208, 0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c,
+	0x8ae0, 0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091,
+	0x8000, 0x2009, 0x1a18, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002,
+	0x012e, 0x080c, 0x1108, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004,
+	0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8,
+	0x012e, 0x0005, 0x0005, 0x700c, 0x0002, 0x8850, 0x8853, 0x8852,
+	0x080c, 0x87e7, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048,
+	0xa974, 0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048,
+	0x7018, 0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020,
+	0xa892, 0x9006, 0x0068, 0x0006, 0x080c, 0x8ae0, 0x2100, 0xaa8c,
+	0x9210, 0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e,
+	0x009e, 0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6,
+	0x2071, 0x1923, 0x700c, 0x0002, 0x8889, 0x8889, 0x8887, 0x700f,
+	0x0001, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005,
+	0x0508, 0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000,
+	0x080c, 0x88f6, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c,
+	0x893d, 0x00ee, 0x0178, 0x0096, 0x080c, 0x1018, 0x2900, 0x009e,
+	0x0148, 0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000,
+	0x012e, 0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6,
+	0x2940, 0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f,
+	0x2068, 0x9d88, 0x2090, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c,
+	0x8a65, 0x080c, 0x2048, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f,
+	0x2004, 0xa88a, 0x080c, 0x1725, 0x781f, 0x0101, 0x7813, 0x0000,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x894c, 0x012e, 0x008e, 0x00ce,
+	0x00de, 0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032,
+	0x2001, 0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923,
+	0x7030, 0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6,
+	0x0026, 0x9b80, 0x8bbf, 0x2005, 0x906d, 0x090c, 0x0dd5, 0x9b80,
+	0x8bb7, 0x2005, 0x9065, 0x090c, 0x0dd5, 0x6114, 0x2600, 0x9102,
+	0x0248, 0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce,
+	0x00de, 0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178,
+	0xc085, 0x6856, 0x2011, 0x8026, 0x080c, 0x4b04, 0x684c, 0x0096,
+	0x904d, 0x090c, 0x0dd5, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006,
+	0x2030, 0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011,
+	0x8025, 0x080c, 0x4b04, 0x684c, 0x0096, 0x904d, 0x090c, 0x0dd5,
+	0xa800, 0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008,
+	0x8319, 0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210,
+	0x9302, 0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c,
+	0x0dd5, 0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0dd5,
+	0x2069, 0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904,
+	0x8108, 0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e,
+	0x2003, 0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014,
+	0x2048, 0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x1031, 0x009e,
+	0xa8ab, 0x0000, 0x080c, 0x0fb1, 0x080c, 0xae61, 0x00ce, 0x009e,
+	0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110,
+	0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000,
+	0x0178, 0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8cf2,
+	0x00be, 0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861,
+	0x0005, 0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071,
+	0x1923, 0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000,
+	0x7112, 0x2001, 0x003b, 0x080c, 0x15ee, 0x00ee, 0x0005, 0x0096,
+	0x00d6, 0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016,
+	0x702a, 0x7026, 0x702f, 0x0000, 0x080c, 0x8b3f, 0x0170, 0x080c,
+	0x8b74, 0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001,
+	0x701f, 0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6,
+	0x0096, 0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100,
+	0x9202, 0x1618, 0x080c, 0x8b74, 0x090c, 0x0dd5, 0x7018, 0x9005,
+	0x1160, 0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e,
+	0xa806, 0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900,
+	0xa002, 0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c,
+	0x9080, 0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de,
+	0x008e, 0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f,
+	0x831e, 0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398,
+	0x0003, 0x7104, 0x080c, 0x8ae0, 0x810c, 0x2100, 0x9318, 0x8003,
+	0x2228, 0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500,
+	0x8004, 0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c,
+	0x8ae9, 0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102,
+	0x701e, 0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000,
+	0x2048, 0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c,
+	0x89d7, 0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000,
+	0x0008, 0x7106, 0x2500, 0x9212, 0x1904, 0x8a16, 0x012e, 0x00ee,
+	0x014e, 0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x9580, 0x8bb7, 0x2005, 0x9075, 0x090c,
+	0x0dd5, 0x080c, 0x8abb, 0x012e, 0x9580, 0x8bb3, 0x2005, 0x9075,
+	0x090c, 0x0dd5, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f,
+	0x831e, 0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100,
+	0x2098, 0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9,
+	0x0002, 0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8aa5, 0x8aa5, 0x8aa7,
+	0x8aa5, 0x8aa7, 0x8aa5, 0x8aa5, 0x8aa5, 0x8aa5, 0x8aa5, 0x8aad,
+	0x8aa5, 0x8aad, 0x8aa5, 0x8aa5, 0x8aa5, 0x080c, 0x0dd5, 0x4104,
+	0x20a9, 0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003,
+	0x4104, 0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee,
+	0x002e, 0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c,
+	0x2110, 0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282,
+	0x000a, 0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006,
+	0x080c, 0x8b83, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010,
+	0x8001, 0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005,
+	0x0006, 0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e,
+	0x0005, 0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c,
+	0x0240, 0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e,
+	0x0005, 0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810,
+	0x2019, 0x0001, 0x2031, 0x8b29, 0x9112, 0x0220, 0x0118, 0x8318,
+	0x2208, 0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804,
+	0xd084, 0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967,
+	0x0a67, 0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082,
+	0x0002, 0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67,
+	0x0cd0, 0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800,
+	0x7128, 0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318,
+	0x0cd8, 0x2031, 0x8b3c, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096,
+	0x0046, 0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8bbb, 0x2005,
+	0x9005, 0x090c, 0x0dd5, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1018,
+	0x01d0, 0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c,
+	0x1018, 0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026,
+	0x94a2, 0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e,
+	0x004e, 0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00,
+	0x080c, 0x1031, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024,
+	0x2048, 0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807,
+	0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802,
+	0x2900, 0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004,
+	0x9005, 0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x1031, 0x000e,
+	0x0cb8, 0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048,
+	0xa800, 0x0006, 0x080c, 0x1031, 0x000e, 0x0cb8, 0x9006, 0x7002,
+	0x700a, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026,
+	0x702e, 0x009e, 0x0005, 0x1a64, 0x0000, 0x0000, 0x0000, 0x1930,
+	0x0000, 0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877,
+	0x0000, 0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8,
+	0x2040, 0x2071, 0x1877, 0x080c, 0x8cdd, 0xa067, 0x0023, 0x6010,
+	0x905d, 0x0904, 0x8cb2, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0,
+	0xa176, 0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000,
+	0xa898, 0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031,
+	0x0018, 0xa068, 0x908a, 0x0019, 0x1a0c, 0x0dd5, 0x2020, 0x2050,
+	0x2940, 0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x2090,
+	0x2c65, 0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c,
+	0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c1f, 0x8c1f, 0x8c21, 0x8c1f,
+	0x8c1f, 0x8c1f, 0x8c23, 0x8c1f, 0x8c1f, 0x8c1f, 0x8c25, 0x8c1f,
+	0x8c1f, 0x8c1f, 0x8c27, 0x8c1f, 0x8c1f, 0x8c1f, 0x8c29, 0x8c1f,
+	0x8c1f, 0x8c1f, 0x8c2b, 0x8c1f, 0x8c1f, 0x8c1f, 0x8c2d, 0x080c,
+	0x0dd5, 0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0,
+	0x0488, 0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a,
+	0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c51, 0x8c4f,
+	0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c53, 0x8c4f, 0x8c4f, 0x8c4f,
+	0x8c4f, 0x8c4f, 0x8c55, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f,
+	0x8c57, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c59, 0x080c,
+	0x0dd5, 0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8,
+	0x0008, 0xa1e0, 0x2600, 0x0002, 0x8c75, 0x8c77, 0x8c79, 0x8c7b,
+	0x8c7d, 0x8c7f, 0x8c81, 0x8c83, 0x8c85, 0x8c87, 0x8c89, 0x8c8b,
+	0x8c8d, 0x8c8f, 0x8c91, 0x8c93, 0x8c95, 0x8c97, 0x8c99, 0x8c9b,
+	0x8c9d, 0x8c9f, 0x8ca1, 0x8ca3, 0x8ca5, 0x080c, 0x0dd5, 0xb9e2,
+	0x0468, 0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2,
+	0x0428, 0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2,
+	0x00e8, 0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2,
+	0x00a8, 0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2,
+	0x0068, 0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992,
+	0x0028, 0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421,
+	0x0120, 0x080c, 0x2048, 0x0804, 0x8bf9, 0x00ae, 0x00be, 0x00ce,
+	0x00ee, 0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff,
+	0x9006, 0x0804, 0x8bdb, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058,
+	0xb810, 0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046,
+	0xbba0, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b04, 0x004e,
+	0x003e, 0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834,
+	0x910a, 0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238,
+	0x0130, 0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a,
+	0xa26a, 0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b,
+	0x0200, 0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001,
+	0x7818, 0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079,
+	0x0000, 0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106,
+	0x0140, 0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0dd5, 0x2068,
+	0x0cb0, 0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b,
+	0x0200, 0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096,
+	0x00c6, 0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff,
+	0x2071, 0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04,
+	0x8d32, 0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90,
+	0xb8ac, 0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004,
+	0x601b, 0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048,
+	0xa88b, 0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0dd5,
+	0x080c, 0x1031, 0x080c, 0x88ed, 0x0c18, 0x2071, 0x0300, 0x701b,
+	0x0200, 0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee,
+	0x0005, 0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x283e,
+	0x015e, 0x11b0, 0x080c, 0x659e, 0x190c, 0x0dd5, 0x000e, 0x001e,
+	0xb912, 0xb816, 0x080c, 0xae0b, 0x0140, 0x2b00, 0x6012, 0x6023,
+	0x0001, 0x2009, 0x0001, 0x080c, 0xaedc, 0x00be, 0x00ce, 0x0005,
+	0x000e, 0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0dd5, 0x0013, 0x006e, 0x0005, 0x8da4, 0x8da4, 0x8da4, 0x8da6,
+	0x8df7, 0x8da4, 0x8da4, 0x8da4, 0x8e5a, 0x8da4, 0x8e97, 0x8da4,
+	0x8da4, 0x8da4, 0x8da4, 0x8da4, 0x080c, 0x0dd5, 0x9182, 0x0040,
+	0x0002, 0x8db9, 0x8db9, 0x8db9, 0x8db9, 0x8db9, 0x8db9, 0x8db9,
+	0x8db9, 0x8db9, 0x8dbb, 0x8dd0, 0x8db9, 0x8db9, 0x8db9, 0x8db9,
+	0x8de3, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x963d, 0x080c, 0x97b9,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb,
+	0x0500, 0x00be, 0x080c, 0x6a87, 0x080c, 0xae61, 0x009e, 0x0005,
+	0x080c, 0x963d, 0x00d6, 0x6114, 0x080c, 0xcb35, 0x0130, 0x0096,
+	0x6114, 0x2148, 0x080c, 0x6c81, 0x009e, 0x00de, 0x080c, 0xae61,
+	0x080c, 0x97b9, 0x0005, 0x080c, 0x963d, 0x080c, 0x31bf, 0x6114,
+	0x0096, 0x2148, 0x080c, 0xcb35, 0x0120, 0xa87b, 0x0029, 0x080c,
+	0x6c81, 0x009e, 0x080c, 0xae61, 0x080c, 0x97b9, 0x0005, 0x601b,
+	0x0000, 0x9182, 0x0040, 0x0096, 0x0002, 0x8e12, 0x8e12, 0x8e12,
+	0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e14, 0x8e12, 0x8e12,
+	0x8e12, 0x8e56, 0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e12,
+	0x8e1a, 0x8e12, 0x080c, 0x0dd5, 0x6114, 0x2148, 0xa938, 0x918e,
+	0xffff, 0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8bc3, 0x0096,
+	0xa8a8, 0x2048, 0x080c, 0x6a1f, 0x009e, 0xa8ab, 0x0000, 0x6010,
+	0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8cf2, 0x00be, 0xae88,
+	0x00b6, 0x2059, 0x0000, 0x080c, 0x88f6, 0x00be, 0x01e0, 0x2071,
+	0x193c, 0x080c, 0x893d, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001,
+	0x1946, 0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x0fff, 0x2900,
+	0x009e, 0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x88b4, 0x00fe,
+	0x00ee, 0x009e, 0x0005, 0x080c, 0x88ed, 0x0cd0, 0x080c, 0x8f04,
+	0x009e, 0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x8e6e, 0x8e6e,
+	0x8e6e, 0x8e70, 0x8e6e, 0x8e6e, 0x8e6e, 0x8e95, 0x8e6e, 0x8e6e,
+	0x8e6e, 0x8e6e, 0x8e6e, 0x8e6e, 0x8e6e, 0x8e6e, 0x080c, 0x0dd5,
+	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa846, 0xa8b0,
+	0xa84a, 0xa837, 0x0000, 0xa83b, 0x0000, 0xa884, 0x9092, 0x199a,
+	0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a,
+	0x2c10, 0x080c, 0x1bad, 0x080c, 0x9155, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x97b9, 0x012e, 0x009e, 0x0005, 0x080c, 0x0dd5, 0x080c,
+	0x963d, 0x080c, 0x97b9, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010,
+	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6c81, 0x080c,
+	0xae61, 0x009e, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5,
+	0x0096, 0x0013, 0x009e, 0x0005, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec6,
+	0x8ed7, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4,
+	0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x080c, 0x0dd5, 0x080c, 0xa7cc,
+	0x6114, 0x2148, 0xa87b, 0x0006, 0x6010, 0x00b6, 0x2058, 0xb8bb,
+	0x0500, 0x00be, 0x080c, 0x6c81, 0x080c, 0xae61, 0x0005, 0x0461,
+	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x0013,
+	0x009e, 0x0005, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef4, 0x8f04, 0x8ef2,
+	0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2,
+	0x8ef2, 0x8ef2, 0x080c, 0x0dd5, 0x0036, 0x00e6, 0x2071, 0x19e7,
+	0x703c, 0x9c06, 0x1120, 0x2019, 0x0000, 0x080c, 0xa5b6, 0x080c,
+	0xa7cc, 0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b, 0x0000,
+	0x6014, 0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c,
+	0x8cf2, 0x00be, 0x2071, 0x193c, 0x080c, 0x893d, 0x0160, 0x2001,
+	0x187f, 0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c, 0x88b4,
+	0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8, 0x2048,
+	0x080c, 0x1031, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x88ed, 0x0c80,
 	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0126,
-	0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006, 0x8004,
-	0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e,
-	0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200, 0x1f04,
-	0x8f20, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020, 0x80f6,
-	0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005, 0x0510,
-	0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c, 0x97be, 0x0008,
-	0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228, 0x911a, 0x1220,
-	0x1f04, 0x8f4a, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x8f4a,
-	0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e,
-	0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126,
-	0x2091, 0x2800, 0x2079, 0x19e7, 0x012e, 0x00d6, 0x2069, 0x19e7,
-	0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069,
-	0x0200, 0x080c, 0xab07, 0x0401, 0x080c, 0xaaf2, 0x00e9, 0x080c,
-	0xaaf5, 0x00d1, 0x080c, 0xaaf8, 0x00b9, 0x080c, 0xaafb, 0x00a1,
-	0x080c, 0xaafe, 0x0089, 0x080c, 0xab01, 0x0071, 0x080c, 0xab04,
-	0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04, 0x9085,
-	0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1, 0x0240,
-	0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027, 0x0001, 0x7804,
-	0x9084, 0x0007, 0x0002, 0x8fbd, 0x8fe1, 0x9020, 0x8fc3, 0x8fe1,
-	0x8fbd, 0x8fbb, 0x8fbb, 0x080c, 0x0dd5, 0x080c, 0x8550, 0x080c,
-	0x9664, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce, 0x0005,
-	0x2011, 0x5e84, 0x080c, 0x84ca, 0x7828, 0x9092, 0x00c8, 0x1228,
-	0x8000, 0x782a, 0x080c, 0x5ec4, 0x0c88, 0x62c0, 0x080c, 0xac43,
-	0x080c, 0x5e84, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b, 0x0000,
-	0x0c28, 0x080c, 0x8550, 0x6220, 0xd2a4, 0x0160, 0x782b, 0x0000,
-	0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013, 0x080c, 0xaec2,
-	0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x7828,
-	0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c, 0x2ba5,
-	0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c, 0x0dd5,
-	0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x9664, 0x0c00,
-	0x080c, 0xa235, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c, 0xac43,
-	0x080c, 0xe9dd, 0x2009, 0x0014, 0x080c, 0xaec2, 0x00ce, 0x0880,
-	0x2001, 0x1a03, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160, 0x782b,
+	0x0000, 0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006,
+	0x8004, 0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118, 0x8086,
+	0x818e, 0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200,
+	0x1f04, 0x8f49, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020,
+	0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005,
+	0x0510, 0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c, 0x97be,
+	0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228, 0x911a,
+	0x1220, 0x1f04, 0x8f73, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
+	0x8f73, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
+	0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8,
+	0x0126, 0x2091, 0x2800, 0x2079, 0x19e7, 0x012e, 0x00d6, 0x2069,
+	0x19e7, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000,
+	0x2069, 0x0200, 0x080c, 0xab21, 0x0401, 0x080c, 0xab0c, 0x00e9,
+	0x080c, 0xab0f, 0x00d1, 0x080c, 0xab12, 0x00b9, 0x080c, 0xab15,
+	0x00a1, 0x080c, 0xab18, 0x0089, 0x080c, 0xab1b, 0x0071, 0x080c,
+	0xab1e, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04,
+	0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1,
+	0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027, 0x0001,
+	0x7804, 0x9084, 0x0007, 0x0002, 0x8fe6, 0x900a, 0x9049, 0x8fec,
+	0x900a, 0x8fe6, 0x8fe4, 0x8fe4, 0x080c, 0x0dd5, 0x080c, 0x8579,
+	0x080c, 0x968d, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce,
+	0x0005, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x7828, 0x9092, 0x00c8,
+	0x1228, 0x8000, 0x782a, 0x080c, 0x5ec3, 0x0c88, 0x62c0, 0x080c,
+	0xac5d, 0x080c, 0x5e83, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
+	0x0000, 0x0c28, 0x080c, 0x8579, 0x6220, 0xd2a4, 0x0160, 0x782b,
 	0x0000, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013, 0x080c,
-	0xaf14, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824, 0x9005,
-	0x090c, 0x0dd5, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000, 0x782a,
-	0x00de, 0x00ce, 0x00be, 0x080c, 0x2ba5, 0x02f0, 0x00b6, 0x00c6,
-	0x00d6, 0x781c, 0x905d, 0x090c, 0x0dd5, 0xb800, 0xc0dc, 0xb802,
-	0x7924, 0x2160, 0x080c, 0xae47, 0xb93c, 0x81ff, 0x090c, 0x0dd5,
-	0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de, 0x00ce,
-	0x00be, 0x080c, 0x9664, 0x0868, 0x080c, 0xa235, 0x0850, 0x2011,
-	0x0130, 0x2214, 0x080c, 0xac43, 0x080c, 0xe9dd, 0x7824, 0x9065,
-	0x2009, 0x0014, 0x080c, 0xaec2, 0x00de, 0x00ce, 0x00be, 0x0804,
-	0x9031, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c, 0x1eb4,
-	0x6024, 0x6027, 0x0002, 0xd0f4, 0x15b8, 0x62c8, 0x60c4, 0x9205,
-	0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c, 0xaec2,
-	0x00ce, 0x0005, 0x2011, 0x1a06, 0x2013, 0x0000, 0x0cc8, 0x793c,
-	0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x1628, 0x8108, 0x7946,
-	0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138, 0x6014,
-	0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x793c, 0x9188,
-	0x0008, 0x210c, 0x918e, 0x0009, 0x0d90, 0x6014, 0x9084, 0x1984,
-	0x9085, 0x0016, 0x6016, 0x08a0, 0x793c, 0x2160, 0x2009, 0x004a,
-	0x080c, 0xaec2, 0x0868, 0x7848, 0xc085, 0x784a, 0x0848, 0x0006,
-	0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
-	0x2061, 0x19e7, 0x6020, 0x8000, 0x6022, 0x6010, 0x9005, 0x0148,
-	0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e, 0x000e,
-	0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0x19e7, 0xb800,
-	0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086, 0x0001, 0x1110,
-	0x2b00, 0x681e, 0x00de, 0x0804, 0x9664, 0x00de, 0x0005, 0xc0d5,
-	0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b, 0x0000, 0x0086,
-	0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e, 0x2069, 0x19e7,
-	0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e, 0x08d8, 0x0006,
-	0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000, 0x2c08,
-	0x2061, 0x19e7, 0x6020, 0x8000, 0x6022, 0x6008, 0x9005, 0x0148,
-	0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e, 0x000e,
-	0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000, 0x2c08,
-	0x2061, 0x19e7, 0x6034, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102,
-	0x6136, 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce, 0x0005, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066, 0x0056,
-	0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071, 0x19e7,
-	0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x91b6,
-	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x91b1, 0x87ff, 0x0120,
-	0x6054, 0x9106, 0x1904, 0x91b1, 0x703c, 0x9c06, 0x1178, 0x0036,
-	0x2019, 0x0001, 0x080c, 0xa59c, 0x7033, 0x0000, 0x9006, 0x703e,
-	0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001, 0x7038, 0x9c36,
-	0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066,
-	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
-	0x080c, 0xcb1b, 0x01c8, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003,
-	0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
-	0x0076, 0x080c, 0xce0a, 0x080c, 0xe8e7, 0x080c, 0x6c79, 0x007e,
-	0x003e, 0x001e, 0x080c, 0xcd04, 0x080c, 0xae78, 0x00ce, 0x0804,
-	0x9155, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9155, 0x85ff, 0x0120,
-	0x0036, 0x080c, 0x9790, 0x003e, 0x012e, 0x000e, 0x001e, 0x002e,
-	0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de,
-	0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016,
-	0x0036, 0x0076, 0x080c, 0xe8e7, 0x080c, 0xe530, 0x007e, 0x003e,
-	0x001e, 0x0890, 0x6020, 0x9086, 0x0009, 0x1168, 0xa87b, 0x0006,
-	0x0016, 0x0036, 0x0076, 0x080c, 0x6c79, 0x080c, 0xae47, 0x007e,
-	0x003e, 0x001e, 0x0818, 0x6020, 0x9086, 0x000a, 0x0904, 0x919b,
-	0x0804, 0x9199, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6,
-	0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19e7, 0x7838, 0x9065,
-	0x0904, 0x9242, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c, 0x9c06,
-	0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa59c, 0x7833, 0x0000,
-	0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c, 0xcb1b,
-	0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568, 0x3e08,
-	0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x1180, 0x2001,
-	0x1988, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6c6d, 0x080c, 0xcd04, 0x080c, 0xae78, 0x000e,
-	0x0804, 0x91ff, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de, 0x00ce,
-	0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
-	0x080c, 0xe530, 0x0c50, 0x6020, 0x9086, 0x0009, 0x1130, 0xab7a,
-	0x080c, 0x6c79, 0x080c, 0xae47, 0x0c10, 0x6020, 0x9086, 0x000a,
-	0x09a8, 0x0890, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099, 0x080c,
-	0x934b, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079,
-	0x19e7, 0x2091, 0x8000, 0x080c, 0x93e2, 0x080c, 0x9470, 0x012e,
-	0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
-	0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9310, 0x6010, 0x2058,
-	0xb8a0, 0x9206, 0x1904, 0x930b, 0x88ff, 0x0120, 0x6054, 0x9106,
-	0x1904, 0x930b, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100, 0x6820,
-	0xd0a4, 0x1508, 0x080c, 0x8550, 0x080c, 0xa259, 0x68c3, 0x0000,
-	0x080c, 0xa7a2, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0xaedc, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0dd5,
+	0x7828, 0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c,
+	0x2ba5, 0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c,
+	0x0dd5, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x968d,
+	0x0c00, 0x080c, 0xa24f, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c,
+	0xac5d, 0x080c, 0xe9fe, 0x2009, 0x0014, 0x080c, 0xaedc, 0x00ce,
+	0x0880, 0x2001, 0x1a03, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160,
+	0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013,
+	0x080c, 0xaf2e, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824,
+	0x9005, 0x090c, 0x0dd5, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000,
+	0x782a, 0x00de, 0x00ce, 0x00be, 0x080c, 0x2ba5, 0x02f0, 0x00b6,
+	0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c, 0x0dd5, 0xb800, 0xc0dc,
+	0xb802, 0x7924, 0x2160, 0x080c, 0xae61, 0xb93c, 0x81ff, 0x090c,
+	0x0dd5, 0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de,
+	0x00ce, 0x00be, 0x080c, 0x968d, 0x0868, 0x080c, 0xa24f, 0x0850,
+	0x2011, 0x0130, 0x2214, 0x080c, 0xac5d, 0x080c, 0xe9fe, 0x7824,
+	0x9065, 0x2009, 0x0014, 0x080c, 0xaedc, 0x00de, 0x00ce, 0x00be,
+	0x0804, 0x905a, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c,
+	0x1eb4, 0x6024, 0x6027, 0x0002, 0xd0f4, 0x15b8, 0x62c8, 0x60c4,
+	0x9205, 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c,
+	0xaedc, 0x00ce, 0x0005, 0x2011, 0x1a06, 0x2013, 0x0000, 0x0cc8,
+	0x793c, 0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x1628, 0x8108,
+	0x7946, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138,
+	0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x793c,
+	0x9188, 0x0008, 0x210c, 0x918e, 0x0009, 0x0d90, 0x6014, 0x9084,
+	0x1984, 0x9085, 0x0016, 0x6016, 0x08a0, 0x793c, 0x2160, 0x2009,
+	0x004a, 0x080c, 0xaedc, 0x0868, 0x7848, 0xc085, 0x784a, 0x0848,
+	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19e7, 0x6020, 0x8000, 0x6022, 0x6010, 0x9005,
+	0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0x19e7,
+	0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086, 0x0001,
+	0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x968d, 0x00de, 0x0005,
+	0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b, 0x0000,
+	0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e, 0x2069,
+	0x19e7, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e, 0x08d8,
+	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19e7, 0x6020, 0x8000, 0x6022, 0x6008, 0x9005,
+	0x0148, 0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19e7, 0x6034, 0x9005, 0x0130, 0x9080, 0x0003,
+	0x2102, 0x6136, 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce, 0x0005,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066,
+	0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071,
+	0x19e7, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904,
+	0x91df, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x91da, 0x87ff,
+	0x0120, 0x6054, 0x9106, 0x1904, 0x91da, 0x703c, 0x9c06, 0x1178,
+	0x0036, 0x2019, 0x0001, 0x080c, 0xa5b6, 0x7033, 0x0000, 0x9006,
+	0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001, 0x7038,
+	0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x080c, 0xcb35, 0x01c8, 0x6014, 0x2048, 0x6020, 0x9086,
+	0x0003, 0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
+	0x0036, 0x0076, 0x080c, 0xce24, 0x080c, 0xe908, 0x080c, 0x6c81,
+	0x007e, 0x003e, 0x001e, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x00ce,
+	0x0804, 0x917e, 0x2c78, 0x600c, 0x2060, 0x0804, 0x917e, 0x85ff,
+	0x0120, 0x0036, 0x080c, 0x97b9, 0x003e, 0x012e, 0x000e, 0x001e,
+	0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
+	0x0016, 0x0036, 0x0076, 0x080c, 0xe908, 0x080c, 0xe551, 0x007e,
+	0x003e, 0x001e, 0x0890, 0x6020, 0x9086, 0x0009, 0x1168, 0xa87b,
+	0x0006, 0x0016, 0x0036, 0x0076, 0x080c, 0x6c81, 0x080c, 0xae61,
+	0x007e, 0x003e, 0x001e, 0x0818, 0x6020, 0x9086, 0x000a, 0x0904,
+	0x91c4, 0x0804, 0x91c2, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6,
+	0x00f6, 0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19e7, 0x7838,
+	0x9065, 0x0904, 0x926b, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c,
+	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa5b6, 0x7833,
+	0x0000, 0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c,
+	0xcb35, 0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568,
+	0x3e08, 0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x1180,
+	0x2001, 0x1988, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x6c75, 0x080c, 0xcd1e, 0x080c, 0xae92,
+	0x000e, 0x0804, 0x9228, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de,
+	0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1118, 0x080c, 0xe551, 0x0c50, 0x6020, 0x9086, 0x0009, 0x1130,
+	0xab7a, 0x080c, 0x6c81, 0x080c, 0xae61, 0x0c10, 0x6020, 0x9086,
+	0x000a, 0x09a8, 0x0890, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099,
+	0x080c, 0x9374, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126,
+	0x2079, 0x19e7, 0x2091, 0x8000, 0x080c, 0x940b, 0x080c, 0x9499,
+	0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19e7, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9339, 0x6010,
+	0x2058, 0xb8a0, 0x9206, 0x1904, 0x9334, 0x88ff, 0x0120, 0x6054,
+	0x9106, 0x1904, 0x9334, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100,
+	0x6820, 0xd0a4, 0x1508, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3,
+	0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef,
+	0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804,
+	0x9334, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36,
+	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013,
+	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
+	0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xcb35, 0x01e8,
+	0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xcd3b, 0x1118, 0x080c,
+	0xb813, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
+	0x0036, 0x0086, 0x080c, 0xce24, 0x080c, 0xe908, 0x080c, 0x6c81,
+	0x008e, 0x003e, 0x001e, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x080c,
+	0xa692, 0x00ce, 0x0804, 0x92b4, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x92b4, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
+	0x0016, 0x0036, 0x0086, 0x080c, 0xe908, 0x080c, 0xe551, 0x008e,
+	0x003e, 0x001e, 0x08d0, 0x080c, 0xb813, 0x6020, 0x9086, 0x0002,
+	0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x931a,
+	0x9086, 0x008b, 0x0904, 0x931a, 0x0840, 0x6020, 0x9086, 0x0005,
+	0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086,
+	0x008b, 0x09b0, 0x0804, 0x932d, 0x00b6, 0x00a6, 0x0096, 0x00c6,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d,
+	0x0904, 0x9404, 0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0x19e7,
+	0xbe54, 0x7018, 0x9b06, 0x1108, 0x761a, 0x701c, 0x9b06, 0x1130,
+	0x86ff, 0x1118, 0x7018, 0x701e, 0x0008, 0x761e, 0xb858, 0x904d,
+	0x0108, 0xae56, 0x96d5, 0x0000, 0x0110, 0x2900, 0xb05a, 0xb857,
+	0x0000, 0xb85b, 0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c,
+	0x6531, 0x0904, 0x9400, 0x7624, 0x86ff, 0x0904, 0x93ef, 0x9680,
+	0x0005, 0x2004, 0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0,
+	0x9005, 0x0560, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3, 0x0000,
+	0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
 	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006,
 	0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804, 0x930b,
-	0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000,
-	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xcb1b, 0x01e8, 0x6020,
-	0x9086, 0x0003, 0x1580, 0x080c, 0xcd21, 0x1118, 0x080c, 0xb7f9,
-	0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
-	0x0086, 0x080c, 0xce0a, 0x080c, 0xe8e7, 0x080c, 0x6c79, 0x008e,
-	0x003e, 0x001e, 0x080c, 0xcd04, 0x080c, 0xae78, 0x080c, 0xa678,
-	0x00ce, 0x0804, 0x928b, 0x2c78, 0x600c, 0x2060, 0x0804, 0x928b,
-	0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016,
-	0x0036, 0x0086, 0x080c, 0xe8e7, 0x080c, 0xe530, 0x008e, 0x003e,
-	0x001e, 0x08d0, 0x080c, 0xb7f9, 0x6020, 0x9086, 0x0002, 0x1160,
-	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x92f1, 0x9086,
-	0x008b, 0x0904, 0x92f1, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920,
-	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086, 0x008b,
-	0x09b0, 0x0804, 0x9304, 0x00b6, 0x00a6, 0x0096, 0x00c6, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x0904,
-	0x93db, 0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0x19e7, 0xbe54,
-	0x7018, 0x9b06, 0x1108, 0x761a, 0x701c, 0x9b06, 0x1130, 0x86ff,
-	0x1118, 0x7018, 0x701e, 0x0008, 0x761e, 0xb858, 0x904d, 0x0108,
-	0xae56, 0x96d5, 0x0000, 0x0110, 0x2900, 0xb05a, 0xb857, 0x0000,
-	0xb85b, 0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x6532,
-	0x0904, 0x93d7, 0x7624, 0x86ff, 0x0904, 0x93c6, 0x9680, 0x0005,
-	0x2004, 0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x0560, 0x080c, 0x8550, 0x080c, 0xa259, 0x68c3, 0x0000, 0x080c,
-	0xa7a2, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x0001, 0x003e, 0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001,
+	0xb83e, 0x2660, 0x080c, 0xae92, 0x00ce, 0x0048, 0x00de, 0x00c6,
+	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x93a7, 0x89ff,
+	0x0158, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xce24,
+	0x080c, 0xe908, 0x080c, 0x6c81, 0x080c, 0xa692, 0x0804, 0x93a7,
+	0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e,
+	0x00ae, 0x00be, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6,
+	0x9036, 0x7814, 0x9065, 0x0904, 0x946c, 0x600c, 0x0006, 0x600f,
+	0x0000, 0x7824, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4,
+	0x1508, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3, 0x0000, 0x080c,
+	0xa7bc, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c,
+	0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
+	0x003e, 0x0040, 0x080c, 0x690a, 0x1520, 0x6003, 0x0009, 0x630a,
+	0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xcb33, 0x01b0, 0x6020,
+	0x9086, 0x0003, 0x1508, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813,
+	0x0060, 0x080c, 0x690a, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x080c,
+	0xa692, 0x000e, 0x0804, 0x9412, 0x7e16, 0x7e12, 0x00de, 0x00ce,
+	0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
+	0x080c, 0xe551, 0x0c50, 0x080c, 0xb813, 0x6020, 0x9086, 0x0002,
+	0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086,
+	0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004,
+	0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00,
+	0x0860, 0x0006, 0x0066, 0x0096, 0x00b6, 0x00c6, 0x00d6, 0x7818,
+	0x905d, 0x0904, 0x9519, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a,
+	0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x6531, 0x0904, 0x9516,
+	0x7e24, 0x86ff, 0x0904, 0x9509, 0x9680, 0x0005, 0x2004, 0x9906,
+	0x1904, 0x9509, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
+	0x9500, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3, 0x0000, 0x080c,
+	0xa7bc, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
 	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c,
 	0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e,
-	0x2660, 0x080c, 0xae78, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660,
-	0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x937e, 0x89ff, 0x0158,
-	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xce0a, 0x080c,
-	0xe8e7, 0x080c, 0x6c79, 0x080c, 0xa678, 0x0804, 0x937e, 0x006e,
-	0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e, 0x00ae,
-	0x00be, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036,
-	0x7814, 0x9065, 0x0904, 0x9443, 0x600c, 0x0006, 0x600f, 0x0000,
-	0x7824, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508,
-	0x080c, 0x8550, 0x080c, 0xa259, 0x68c3, 0x0000, 0x080c, 0xa7a2,
-	0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x0040, 0x080c, 0x6902, 0x1520, 0x6003, 0x0009, 0x630a, 0x2c30,
-	0x00f8, 0x6014, 0x2048, 0x080c, 0xcb19, 0x01b0, 0x6020, 0x9086,
-	0x0003, 0x1508, 0x080c, 0xcd21, 0x1118, 0x080c, 0xb7f9, 0x0060,
-	0x080c, 0x6902, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0x6c79, 0x080c, 0xcd04, 0x080c, 0xae78, 0x080c, 0xa678,
-	0x000e, 0x0804, 0x93e9, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e,
-	0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c,
-	0xe530, 0x0c50, 0x080c, 0xb7f9, 0x6020, 0x9086, 0x0002, 0x1150,
-	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086, 0x008b,
-	0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004, 0x0006,
-	0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00, 0x0860,
-	0x0006, 0x0066, 0x0096, 0x00b6, 0x00c6, 0x00d6, 0x7818, 0x905d,
-	0x0904, 0x94f0, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a, 0xb800,
-	0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x6532, 0x0904, 0x94ed, 0x7e24,
-	0x86ff, 0x0904, 0x94e0, 0x9680, 0x0005, 0x2004, 0x9906, 0x1904,
-	0x94e0, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x94d7,
-	0x080c, 0x8550, 0x080c, 0xa259, 0x68c3, 0x0000, 0x080c, 0xa7a2,
-	0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x00de, 0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168, 0xb800, 0xd0bc,
-	0x0150, 0x9680, 0x0010, 0x200c, 0x81ff, 0x1518, 0x2009, 0x1988,
-	0x210c, 0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e,
-	0x2660, 0x600f, 0x0000, 0x080c, 0xae78, 0x00ce, 0x0048, 0x00de,
-	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x9483,
-	0x89ff, 0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x6c79, 0x080c, 0xa678, 0x0804, 0x9483, 0x000e, 0x0804, 0x9477,
-	0x781e, 0x781a, 0x00de, 0x00ce, 0x00be, 0x009e, 0x006e, 0x000e,
-	0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc, 0x01a0,
-	0xb84c, 0x904d, 0x0188, 0xa878, 0x9606, 0x1170, 0x2071, 0x19e7,
-	0x7024, 0x9035, 0x0148, 0x9080, 0x0005, 0x2004, 0x9906, 0x1120,
-	0xb800, 0xc0dc, 0xb802, 0x0029, 0x006e, 0x009e, 0x00de, 0x00ee,
-	0x0005, 0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005, 0x1138, 0x00c6,
-	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c, 0xa259,
-	0x78c3, 0x0000, 0x080c, 0xa7a2, 0x7027, 0x0000, 0x0036, 0x2079,
-	0x0140, 0x7b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2cef, 0x9006, 0x080c, 0x2cef, 0x2079, 0x0100, 0x7824, 0xd084,
-	0x0110, 0x7827, 0x0001, 0x080c, 0xa7a2, 0x003e, 0x080c, 0x6532,
-	0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c,
-	0xae47, 0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0xce0a, 0x080c, 0x6c79, 0x080c, 0xa678, 0x00fe, 0x0005, 0x00b6,
-	0x00e6, 0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x2001,
-	0x180c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x19e7, 0x7004, 0x9084,
-	0x0007, 0x0002, 0x957c, 0x9580, 0x9597, 0x95c0, 0x95fe, 0x957c,
-	0x9597, 0x957a, 0x080c, 0x0dd5, 0x00ce, 0x00ee, 0x00be, 0x0005,
-	0x7024, 0x9065, 0x0148, 0x7020, 0x8001, 0x7022, 0x600c, 0x9015,
-	0x0158, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000,
-	0x00ce, 0x00ee, 0x00be, 0x0005, 0x7216, 0x7212, 0x0ca8, 0x6010,
-	0x2058, 0x080c, 0x6532, 0xb800, 0xc0dc, 0xb802, 0x7007, 0x0000,
-	0x7027, 0x0000, 0x7020, 0x8001, 0x7022, 0x1148, 0x2001, 0x180c,
-	0x2014, 0xd2ec, 0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005, 0xb854,
-	0x9015, 0x0120, 0x721e, 0x080c, 0x9664, 0x0ca8, 0x7218, 0x721e,
-	0x080c, 0x9664, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x9790, 0x0c58,
-	0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c, 0xa678,
-	0x600c, 0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448, 0x720e,
-	0x720a, 0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0xa678, 0x600c,
-	0x9015, 0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216, 0x7212,
-	0x00b8, 0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058, 0x080c,
-	0x6532, 0xb800, 0xc0dc, 0xb802, 0x080c, 0xa678, 0x701c, 0x9065,
-	0x0138, 0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218, 0x721e,
-	0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065,
-	0x0140, 0x080c, 0xa678, 0x600c, 0x9015, 0x0158, 0x720e, 0x600f,
-	0x0000, 0x080c, 0xa7a2, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be,
-	0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19e7, 0x6830,
-	0x9084, 0x0003, 0x0002, 0x9621, 0x9623, 0x9647, 0x961f, 0x080c,
-	0x0dd5, 0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001, 0x01b8,
-	0x683c, 0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a, 0x600f,
-	0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x1a06, 0x2013,
-	0x0000, 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90, 0x6843,
-	0x0000, 0x6838, 0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50, 0x00c6,
-	0x9006, 0x6842, 0x6846, 0x684a, 0x683c, 0x9065, 0x0160, 0x600c,
-	0x9015, 0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0018,
-	0x683e, 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c,
-	0x200c, 0xc1e5, 0x2102, 0x0005, 0x2001, 0x180c, 0x200c, 0xd1ec,
-	0x0120, 0xc1ec, 0x2102, 0x080c, 0x9790, 0x2001, 0x19f3, 0x2004,
-	0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069, 0x19e7, 0x6804, 0x9084,
-	0x0007, 0x0006, 0x9005, 0x11c8, 0x2001, 0x1837, 0x2004, 0x9084,
-	0x0028, 0x1198, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x0168,
-	0x2001, 0x188b, 0x2004, 0xd08c, 0x1118, 0xd084, 0x1118, 0x0028,
-	0x080c, 0x9790, 0x000e, 0x00de, 0x0005, 0x000e, 0x0002, 0x96a1,
-	0x975e, 0x975e, 0x975e, 0x975e, 0x9760, 0x975e, 0x969f, 0x080c,
-	0x0dd5, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005, 0x00c6, 0x680c,
-	0x9065, 0x0520, 0x6114, 0x0096, 0x2148, 0xa964, 0x009e, 0x918c,
-	0x00ff, 0x918e, 0x0035, 0x1180, 0x2009, 0x1837, 0x210c, 0x918c,
-	0x0028, 0x1150, 0x080c, 0x73b0, 0x0138, 0x0006, 0x2009, 0x188b,
-	0x2104, 0xc095, 0x200a, 0x000e, 0x6807, 0x0004, 0x6826, 0x682b,
-	0x0000, 0x080c, 0x9838, 0x00ce, 0x00de, 0x0005, 0x6814, 0x9065,
-	0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x9838,
-	0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd, 0x0000,
-	0x0904, 0x974a, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005, 0x01a0,
-	0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x974a, 0x0028, 0x6818,
-	0x920e, 0x0904, 0x974a, 0x2058, 0xb84c, 0x900d, 0x0d88, 0xb888,
-	0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302, 0x1e40,
-	0x080c, 0xae1e, 0x0904, 0x974a, 0x8318, 0xbb3e, 0x6116, 0x2b10,
-	0x6212, 0x0096, 0x2148, 0xa880, 0x9084, 0x00ff, 0x605e, 0xa883,
-	0x0000, 0xa884, 0x009e, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
-	0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x6114, 0x0096, 0x2148,
-	0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0538, 0x00f6,
-	0x2c78, 0x2061, 0x0100, 0xbac0, 0x629a, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x080c, 0x9d85, 0x2069, 0x19e7, 0xbb00, 0xc3dd, 0xbb02,
-	0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x7823, 0x0003,
-	0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00be, 0x00ce,
-	0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0, 0xbb00, 0xc3dd,
-	0xbb02, 0x6807, 0x0006, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x080c,
-	0xac63, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de, 0x0005,
-	0x00c6, 0x680c, 0x9065, 0x0508, 0x6114, 0x0096, 0x2148, 0xa964,
-	0x009e, 0x918c, 0x00ff, 0x918e, 0x0035, 0x1180, 0x2009, 0x1837,
-	0x210c, 0x918c, 0x0028, 0x1150, 0x080c, 0x73b0, 0x0138, 0x0006,
-	0x2009, 0x188b, 0x2104, 0xc095, 0x200a, 0x000e, 0x6807, 0x0004,
-	0x6826, 0x682b, 0x0000, 0x080c, 0x9838, 0x00ce, 0x00de, 0x0005,
-	0x2001, 0x180c, 0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005,
-	0x00f6, 0x00d6, 0x2069, 0x19e7, 0x6830, 0x9086, 0x0000, 0x1570,
-	0x2001, 0x180c, 0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c,
-	0x9673, 0x2069, 0x19e7, 0x2001, 0x180c, 0x200c, 0xd1c4, 0x1508,
-	0x6838, 0x907d, 0x01d8, 0x6a04, 0x9296, 0x0000, 0x1904, 0x9831,
-	0x7920, 0x918e, 0x0009, 0x0588, 0x6833, 0x0001, 0x683e, 0x6847,
+	0x003e, 0x00de, 0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168, 0xb800,
+	0xd0bc, 0x0150, 0x9680, 0x0010, 0x200c, 0x81ff, 0x1518, 0x2009,
+	0x1988, 0x210c, 0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001,
+	0xb83e, 0x2660, 0x600f, 0x0000, 0x080c, 0xae92, 0x00ce, 0x0048,
+	0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804,
+	0x94ac, 0x89ff, 0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6c81, 0x080c, 0xa692, 0x0804, 0x94ac, 0x000e, 0x0804,
+	0x94a0, 0x781e, 0x781a, 0x00de, 0x00ce, 0x00be, 0x009e, 0x006e,
+	0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc,
+	0x01a0, 0xb84c, 0x904d, 0x0188, 0xa878, 0x9606, 0x1170, 0x2071,
+	0x19e7, 0x7024, 0x9035, 0x0148, 0x9080, 0x0005, 0x2004, 0x9906,
+	0x1120, 0xb800, 0xc0dc, 0xb802, 0x0029, 0x006e, 0x009e, 0x00de,
+	0x00ee, 0x0005, 0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005, 0x1138,
+	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c,
+	0xa273, 0x78c3, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036,
+	0x2079, 0x0140, 0x7b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x2079, 0x0100, 0x7824,
+	0xd084, 0x0110, 0x7827, 0x0001, 0x080c, 0xa7bc, 0x003e, 0x080c,
+	0x6531, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660,
+	0x080c, 0xae61, 0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0xce24, 0x080c, 0x6c81, 0x080c, 0xa692, 0x00fe, 0x0005,
+	0x00b6, 0x00e6, 0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012,
+	0x2001, 0x180c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x19e7, 0x7004,
+	0x9084, 0x0007, 0x0002, 0x95a5, 0x95a9, 0x95c0, 0x95e9, 0x9627,
+	0x95a5, 0x95c0, 0x95a3, 0x080c, 0x0dd5, 0x00ce, 0x00ee, 0x00be,
+	0x0005, 0x7024, 0x9065, 0x0148, 0x7020, 0x8001, 0x7022, 0x600c,
+	0x9015, 0x0158, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027,
+	0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7216, 0x7212, 0x0ca8,
+	0x6010, 0x2058, 0x080c, 0x6531, 0xb800, 0xc0dc, 0xb802, 0x7007,
+	0x0000, 0x7027, 0x0000, 0x7020, 0x8001, 0x7022, 0x1148, 0x2001,
+	0x180c, 0x2014, 0xd2ec, 0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0xb854, 0x9015, 0x0120, 0x721e, 0x080c, 0x968d, 0x0ca8, 0x7218,
+	0x721e, 0x080c, 0x968d, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x97b9,
+	0x0c58, 0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c,
+	0xa692, 0x600c, 0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448,
+	0x720e, 0x720a, 0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0xa692,
+	0x600c, 0x9015, 0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216,
+	0x7212, 0x00b8, 0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058,
+	0x080c, 0x6531, 0xb800, 0xc0dc, 0xb802, 0x080c, 0xa692, 0x701c,
+	0x9065, 0x0138, 0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218,
+	0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024,
+	0x9065, 0x0140, 0x080c, 0xa692, 0x600c, 0x9015, 0x0158, 0x720e,
+	0x600f, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x00ce, 0x00ee,
+	0x00be, 0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19e7,
+	0x6830, 0x9084, 0x0003, 0x0002, 0x964a, 0x964c, 0x9670, 0x9648,
+	0x080c, 0x0dd5, 0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001,
+	0x01b8, 0x683c, 0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a,
+	0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x1a06,
+	0x2013, 0x0000, 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90,
+	0x6843, 0x0000, 0x6838, 0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50,
+	0x00c6, 0x9006, 0x6842, 0x6846, 0x684a, 0x683c, 0x9065, 0x0160,
+	0x600c, 0x9015, 0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000,
+	0x0018, 0x683e, 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x2001,
+	0x180c, 0x200c, 0xc1e5, 0x2102, 0x0005, 0x2001, 0x180c, 0x200c,
+	0xd1ec, 0x0120, 0xc1ec, 0x2102, 0x080c, 0x97b9, 0x2001, 0x19f3,
+	0x2004, 0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069, 0x19e7, 0x6804,
+	0x9084, 0x0007, 0x0006, 0x9005, 0x11c8, 0x2001, 0x1837, 0x2004,
+	0x9084, 0x0028, 0x1198, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa,
+	0x0168, 0x2001, 0x188b, 0x2004, 0xd08c, 0x1118, 0xd084, 0x1118,
+	0x0028, 0x080c, 0x97b9, 0x000e, 0x00de, 0x0005, 0x000e, 0x0002,
+	0x96ca, 0x9787, 0x9787, 0x9787, 0x9787, 0x9789, 0x9787, 0x96c8,
+	0x080c, 0x0dd5, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005, 0x00c6,
+	0x680c, 0x9065, 0x0520, 0x6114, 0x0096, 0x2148, 0xa964, 0x009e,
+	0x918c, 0x00ff, 0x918e, 0x0035, 0x1180, 0x2009, 0x1837, 0x210c,
+	0x918c, 0x0028, 0x1150, 0x080c, 0x73bc, 0x0138, 0x0006, 0x2009,
+	0x188b, 0x2104, 0xc095, 0x200a, 0x000e, 0x6807, 0x0004, 0x6826,
+	0x682b, 0x0000, 0x080c, 0x9861, 0x00ce, 0x00de, 0x0005, 0x6814,
+	0x9065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c,
+	0x9861, 0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd,
+	0x0000, 0x0904, 0x9773, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005,
+	0x01a0, 0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x9773, 0x0028,
+	0x6818, 0x920e, 0x0904, 0x9773, 0x2058, 0xb84c, 0x900d, 0x0d88,
+	0xb888, 0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302,
+	0x1e40, 0x080c, 0xae38, 0x0904, 0x9773, 0x8318, 0xbb3e, 0x6116,
+	0x2b10, 0x6212, 0x0096, 0x2148, 0xa880, 0x9084, 0x00ff, 0x605e,
+	0xa883, 0x0000, 0xa884, 0x009e, 0x908a, 0x199a, 0x0210, 0x2001,
+	0x1999, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x6114, 0x0096,
+	0x2148, 0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0538,
+	0x00f6, 0x2c78, 0x2061, 0x0100, 0xbac0, 0x629a, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x080c, 0x9dae, 0x2069, 0x19e7, 0xbb00, 0xc3dd,
+	0xbb02, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x7823,
+	0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00be,
+	0x00ce, 0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0, 0xbb00,
+	0xc3dd, 0xbb02, 0x6807, 0x0006, 0x2f18, 0x6b26, 0x682b, 0x0000,
+	0x080c, 0xac7d, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de,
+	0x0005, 0x00c6, 0x680c, 0x9065, 0x0508, 0x6114, 0x0096, 0x2148,
+	0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0035, 0x1180, 0x2009,
+	0x1837, 0x210c, 0x918c, 0x0028, 0x1150, 0x080c, 0x73bc, 0x0138,
+	0x0006, 0x2009, 0x188b, 0x2104, 0xc095, 0x200a, 0x000e, 0x6807,
+	0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x9861, 0x00ce, 0x00de,
+	0x0005, 0x2001, 0x180c, 0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe,
+	0x0005, 0x00f6, 0x00d6, 0x2069, 0x19e7, 0x6830, 0x9086, 0x0000,
+	0x1570, 0x2001, 0x180c, 0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202,
+	0x080c, 0x969c, 0x2069, 0x19e7, 0x2001, 0x180c, 0x200c, 0xd1c4,
+	0x1508, 0x6838, 0x907d, 0x01d8, 0x6a04, 0x9296, 0x0000, 0x1904,
+	0x985a, 0x7920, 0x918e, 0x0009, 0x0588, 0x6833, 0x0001, 0x683e,
+	0x6847, 0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400,
+	0x002e, 0x080c, 0x1c46, 0x1178, 0x012e, 0x080c, 0xa0d0, 0x00de,
+	0x00fe, 0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c,
+	0x746c, 0x006e, 0x08b0, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002,
+	0x780c, 0x9015, 0x0140, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000,
+	0x683f, 0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x7908, 0xd1fc,
+	0x1198, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000,
+	0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1c46, 0x19d8,
+	0x012e, 0x080c, 0xa051, 0x0858, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0028, 0x1188, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x0158,
+	0x2001, 0x19e8, 0x2004, 0x9005, 0x11f0, 0x2001, 0x188b, 0x200c,
+	0xc185, 0xc18c, 0x2102, 0x2f00, 0x6833, 0x0001, 0x683e, 0x6847,
 	0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e,
-	0x080c, 0x1c46, 0x1178, 0x012e, 0x080c, 0xa0a7, 0x00de, 0x00fe,
-	0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c, 0x7460,
-	0x006e, 0x08b0, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002, 0x780c,
-	0x9015, 0x0140, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000, 0x683f,
-	0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x7908, 0xd1fc, 0x1198,
-	0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000, 0x0126,
-	0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1c46, 0x19d8, 0x012e,
-	0x080c, 0xa028, 0x0858, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028,
-	0x1188, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x0158, 0x2001,
-	0x19e8, 0x2004, 0x9005, 0x11f0, 0x2001, 0x188b, 0x200c, 0xc185,
-	0xc18c, 0x2102, 0x2f00, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000,
-	0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c,
-	0x1c46, 0x1904, 0x97d2, 0x012e, 0x6a3c, 0x2278, 0x080c, 0x9fb2,
-	0x0804, 0x97c6, 0x2011, 0x188b, 0x2204, 0xc08d, 0x2012, 0x0804,
-	0x97c6, 0x6a04, 0x9296, 0x0006, 0x0904, 0x97b0, 0x0804, 0x9788,
-	0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x984c, 0x9851, 0x9cbf,
-	0x9d4e, 0x9851, 0x9cbf, 0x9d4e, 0x984c, 0x9851, 0x984c, 0x984c,
-	0x984c, 0x984c, 0x984c, 0x984c, 0x080c, 0x955f, 0x080c, 0x9664,
-	0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004,
-	0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78,
-	0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x98bd, 0x005b,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
-	0x015e, 0x00be, 0x0005, 0x9a42, 0x9a7d, 0x9aa6, 0x9b4e, 0x9b70,
-	0x9b76, 0x9b83, 0x9b8b, 0x9b97, 0x9b9d, 0x9bae, 0x9b9d, 0x9c06,
-	0x9b8b, 0x9c12, 0x9c18, 0x9b97, 0x9c18, 0x9c24, 0x98bb, 0x98bb,
-	0x98bb, 0x98bb, 0x98bb, 0x98bb, 0x98bb, 0x98bb, 0x98bb, 0x98bb,
-	0x98bb, 0xa453, 0xa476, 0xa487, 0xa4a7, 0xa4d9, 0x9b83, 0x98bb,
-	0x9b83, 0x9b9d, 0x98bb, 0x9aa6, 0x9b4e, 0x98bb, 0xa88f, 0x9b9d,
-	0x98bb, 0xa8ab, 0x9b9d, 0x98bb, 0x9b97, 0x9a3c, 0x98de, 0x98bb,
-	0xa8c7, 0xa934, 0xaa0b, 0x98bb, 0xaa18, 0x9b80, 0xaa43, 0x98bb,
-	0xa4e3, 0xaa70, 0x98bb, 0x080c, 0x0dd5, 0x2100, 0x005b, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
-	0x00be, 0x0005, 0xab0b, 0xabbd, 0x98dc, 0x9905, 0x99b1, 0x99bc,
-	0x98dc, 0x9b83, 0x98dc, 0x9a03, 0x9a0f, 0x9920, 0x98dc, 0x993b,
-	0x996f, 0xad25, 0xad6a, 0x9b9d, 0x080c, 0x0dd5, 0x00d6, 0x0096,
-	0x080c, 0x9c37, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800,
-	0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026,
-	0x60c3, 0x0018, 0x080c, 0xa22d, 0x009e, 0x00de, 0x0005, 0x7810,
-	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xadb1, 0x1118, 0x9084,
-	0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c,
-	0x9c37, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878,
-	0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888,
-	0x701e, 0x60c3, 0x0010, 0x080c, 0xa22d, 0x009e, 0x00de, 0x0005,
-	0x00d6, 0x0096, 0x080c, 0x9c37, 0x7003, 0x0500, 0x7814, 0x2048,
-	0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016,
-	0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0xa22d,
-	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9c37, 0x20e9, 0x0000, 0x2001, 0x19a3, 0x2003, 0x0000,
-	0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016,
-	0x200c, 0x2001, 0x0001, 0x080c, 0x23b7, 0x080c, 0xd84c, 0x9006,
-	0x080c, 0x23b7, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28,
-	0x04d9, 0x080c, 0xa22d, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6,
-	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c82, 0x20e9, 0x0000,
-	0x2001, 0x19a3, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200,
-	0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016,
-	0x200c, 0x080c, 0xd84c, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048,
-	0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fb1, 0x080c, 0xa22d,
-	0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003,
-	0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0,
-	0x0005, 0x080c, 0x9c37, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a,
-	0x60c3, 0x0008, 0x0804, 0xa22d, 0x00d6, 0x00e6, 0x080c, 0x9c82,
-	0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095,
-	0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805,
-	0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x99d2, 0x2069,
-	0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x99db,
-	0x2069, 0x19b3, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cd, 0x20a9,
-	0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010,
-	0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072,
-	0x8d68, 0x8e70, 0x1f04, 0x99e9, 0x60c3, 0x004c, 0x080c, 0xa22d,
-	0x00ee, 0x00de, 0x0005, 0x080c, 0x9c37, 0x7003, 0x6300, 0x7007,
-	0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa22d, 0x00d6,
-	0x0026, 0x0016, 0x080c, 0x9c82, 0x7003, 0x0200, 0x7814, 0x700e,
-	0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2069,
-	0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70, 0x2073,
-	0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800, 0x8e70,
-	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0xa22d,
-	0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004, 0x609a,
-	0x0804, 0xa22d, 0x080c, 0x9c37, 0x7003, 0x5200, 0x2069, 0x1847,
-	0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2871, 0x710e,
-	0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
-	0x20a1, 0x0254, 0x4003, 0x080c, 0xadb1, 0x1120, 0xb8a0, 0x9082,
-	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001, 0x1820,
-	0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
-	0x7036, 0x60c3, 0x001c, 0x0804, 0xa22d, 0x080c, 0x9c37, 0x7003,
-	0x0500, 0x080c, 0xadb1, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
-	0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004, 0x700e,
-	0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9,
-	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
-	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0xa22d, 0x080c, 0x9c37,
-	0x9006, 0x080c, 0x6934, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003,
-	0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d,
-	0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300,
-	0xb8a0, 0x9086, 0x007e, 0x1904, 0x9b15, 0x00d6, 0x2069, 0x196c,
-	0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a, 0x6808,
-	0x9084, 0x2000, 0x7012, 0x080c, 0xadc8, 0x680c, 0x7016, 0x701f,
-	0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800, 0x700a,
-	0x6804, 0x700e, 0x6808, 0x080c, 0x73b0, 0x1118, 0x9084, 0x37ff,
-	0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xadc8, 0x680c, 0x7016,
-	0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
-	0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xaaf2, 0x2069, 0x1974,
-	0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x56d4, 0xd0e4,
-	0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837, 0x2004,
-	0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0, 0x9106,
-	0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x28b2, 0x61e2, 0x001e,
-	0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1,
-	0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a,
-	0x4003, 0x080c, 0xaaf2, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099,
-	0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0xa22d, 0x080c, 0x9c37,
-	0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000,
-	0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac, 0x1110,
-	0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085, 0x0002,
-	0x00d6, 0x0804, 0x9be7, 0x7026, 0x60c3, 0x0014, 0x0804, 0xa22d,
-	0x080c, 0x9c37, 0x7003, 0x5000, 0x0804, 0x9ac0, 0x080c, 0x9c37,
-	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0xa22d,
-	0x080c, 0x9c79, 0x0010, 0x080c, 0x9c82, 0x7003, 0x0200, 0x60c3,
-	0x0004, 0x0804, 0xa22d, 0x080c, 0x9c82, 0x7003, 0x0100, 0x700b,
-	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0xa22d, 0x080c,
-	0x9c82, 0x7003, 0x0200, 0x0804, 0x9ac0, 0x080c, 0x9c82, 0x7003,
-	0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003,
-	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa22d, 0x00d6, 0x080c,
-	0x9c82, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894,
-	0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998,
-	0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058,
-	0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700,
-	0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe,
-	0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010,
-	0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026,
-	0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbacc, 0xd28c,
-	0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec,
-	0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e,
-	0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0xa22d, 0x080c, 0x9c82,
-	0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014,
-	0x0804, 0xa22d, 0x080c, 0x9c82, 0x7003, 0x0200, 0x0804, 0x9a46,
-	0x080c, 0x9c82, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00,
-	0x60c3, 0x0008, 0x0804, 0xa22d, 0x080c, 0x9c82, 0x7003, 0x0100,
-	0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0xa22d, 0x0026, 0x00d6,
-	0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026,
-	0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c,
-	0xab07, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e,
-	0x003e, 0x00de, 0x080c, 0xa21b, 0x721a, 0x9f95, 0x0000, 0x7222,
-	0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c,
-	0xab07, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800,
-	0x687c, 0x700a, 0x6880, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10,
-	0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000,
-	0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021,
-	0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300,
-	0x2021, 0x0100, 0x080c, 0xab07, 0xb810, 0x9305, 0x7002, 0xb814,
-	0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005,
-	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c, 0x700a,
-	0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e,
-	0x00de, 0x080c, 0xa21b, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
-	0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0xa21b, 0x721a, 0x7a08,
-	0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6,
+	0x080c, 0x1c46, 0x1904, 0x97fb, 0x012e, 0x6a3c, 0x2278, 0x080c,
+	0x9fdb, 0x0804, 0x97ef, 0x2011, 0x188b, 0x2204, 0xc08d, 0x2012,
+	0x0804, 0x97ef, 0x6a04, 0x9296, 0x0006, 0x0904, 0x97d9, 0x0804,
+	0x97b1, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x9875, 0x987a,
+	0x9ce8, 0x9d77, 0x987a, 0x9ce8, 0x9d77, 0x9875, 0x987a, 0x9875,
+	0x9875, 0x9875, 0x9875, 0x9875, 0x9875, 0x080c, 0x9588, 0x080c,
+	0x968d, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6,
 	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240,
-	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092, 0x1a0c,
-	0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78, 0x2061, 0x0100, 0x619a,
-	0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x0005, 0x9cf0, 0x9cff, 0x9d0a, 0x9cee, 0x9cee, 0x9cee, 0x9cf0,
-	0x9cee, 0x9cee, 0x9cee, 0x9cee, 0x9cee, 0x9cee, 0x080c, 0x0dd5,
-	0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2ba5, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0xa22d, 0x0431,
-	0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c,
-	0x0804, 0xa22d, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3,
-	0x0004, 0x0804, 0xa22d, 0x0026, 0x080c, 0xab07, 0xb810, 0x9085,
-	0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
-	0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9c52, 0x0026, 0x080c,
-	0xab07, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012,
-	0x0804, 0x9cb4, 0x0026, 0x080c, 0xab07, 0xb810, 0x9085, 0x8500,
+	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0,
+	0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x98e6,
+	0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e,
+	0x013e, 0x015e, 0x00be, 0x0005, 0x9a6b, 0x9aa6, 0x9acf, 0x9b77,
+	0x9b99, 0x9b9f, 0x9bac, 0x9bb4, 0x9bc0, 0x9bc6, 0x9bd7, 0x9bc6,
+	0x9c2f, 0x9bb4, 0x9c3b, 0x9c41, 0x9bc0, 0x9c41, 0x9c4d, 0x98e4,
+	0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4,
+	0x98e4, 0x98e4, 0xa46d, 0xa490, 0xa4a1, 0xa4c1, 0xa4f3, 0x9bac,
+	0x98e4, 0x9bac, 0x9bc6, 0x98e4, 0x9acf, 0x9b77, 0x98e4, 0xa8a9,
+	0x9bc6, 0x98e4, 0xa8c5, 0x9bc6, 0x98e4, 0x9bc0, 0x9a65, 0x9907,
+	0x98e4, 0xa8e1, 0xa94e, 0xaa25, 0x98e4, 0xaa32, 0x9ba9, 0xaa5d,
+	0x98e4, 0xa4fd, 0xaa8a, 0x98e4, 0x080c, 0x0dd5, 0x2100, 0x005b,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
+	0x015e, 0x00be, 0x0005, 0xab25, 0xabd7, 0x9905, 0x992e, 0x99da,
+	0x99e5, 0x9905, 0x9bac, 0x9905, 0x9a2c, 0x9a38, 0x9949, 0x9905,
+	0x9964, 0x9998, 0xad3f, 0xad84, 0x9bc6, 0x080c, 0x0dd5, 0x00d6,
+	0x0096, 0x080c, 0x9c60, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b,
+	0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854,
+	0x7026, 0x60c3, 0x0018, 0x080c, 0xa247, 0x009e, 0x00de, 0x0005,
+	0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xadcb, 0x1118,
+	0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096,
+	0x080c, 0x9c60, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a,
+	0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a,
+	0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0xa247, 0x009e, 0x00de,
+	0x0005, 0x00d6, 0x0096, 0x080c, 0x9c60, 0x7003, 0x0500, 0x7814,
+	0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8,
+	0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c,
+	0xa247, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9c60, 0x20e9, 0x0000, 0x2001, 0x19a3, 0x2003,
+	0x0000, 0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3,
+	0x0016, 0x200c, 0x2001, 0x0001, 0x080c, 0x23b7, 0x080c, 0xd867,
+	0x9006, 0x080c, 0x23b7, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048,
+	0x0c28, 0x04d9, 0x080c, 0xa247, 0x012e, 0x009e, 0x00de, 0x0005,
+	0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9cab, 0x20e9,
+	0x0000, 0x2001, 0x19a3, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f,
+	0x0200, 0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3,
+	0x0016, 0x200c, 0x080c, 0xd867, 0x001e, 0xa804, 0x9005, 0x0110,
+	0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fb1, 0x080c,
+	0xa247, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084,
+	0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000,
+	0x1de0, 0x0005, 0x080c, 0x9c60, 0x7003, 0x7800, 0x7808, 0x8007,
+	0x700a, 0x60c3, 0x0008, 0x0804, 0xa247, 0x00d6, 0x00e6, 0x080c,
+	0x9cab, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70,
+	0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069,
+	0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x99fb,
+	0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04,
+	0x9a04, 0x2069, 0x19b3, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cd,
+	0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200,
+	0x6010, 0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007,
+	0x2072, 0x8d68, 0x8e70, 0x1f04, 0x9a12, 0x60c3, 0x004c, 0x080c,
+	0xa247, 0x00ee, 0x00de, 0x0005, 0x080c, 0x9c60, 0x7003, 0x6300,
+	0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa247,
+	0x00d6, 0x0026, 0x0016, 0x080c, 0x9cab, 0x7003, 0x0200, 0x7814,
+	0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c,
+	0x2069, 0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70,
+	0x2073, 0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800,
+	0x8e70, 0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c,
+	0xa247, 0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004,
+	0x609a, 0x0804, 0xa247, 0x080c, 0x9c60, 0x7003, 0x5200, 0x2069,
+	0x1847, 0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2871,
+	0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1801, 0x20a1, 0x0254, 0x4003, 0x080c, 0xadcb, 0x1120, 0xb8a0,
+	0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001,
+	0x1820, 0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084,
+	0x00ff, 0x7036, 0x60c3, 0x001c, 0x0804, 0xa247, 0x080c, 0x9c60,
+	0x7003, 0x0500, 0x080c, 0xadcb, 0x1120, 0xb8a0, 0x9082, 0x007f,
+	0x0248, 0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004,
+	0x700e, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e,
+	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
+	0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0xa247, 0x080c,
+	0x9c60, 0x9006, 0x080c, 0x693c, 0xb8a0, 0x9086, 0x007e, 0x1130,
+	0x7003, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096,
+	0x904d, 0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003,
+	0x0300, 0xb8a0, 0x9086, 0x007e, 0x1904, 0x9b3e, 0x00d6, 0x2069,
+	0x196c, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a,
+	0x6808, 0x9084, 0x2000, 0x7012, 0x080c, 0xade2, 0x680c, 0x7016,
+	0x701f, 0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800,
+	0x700a, 0x6804, 0x700e, 0x6808, 0x080c, 0x73bc, 0x1118, 0x9084,
+	0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xade2, 0x680c,
+	0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xab0c, 0x2069,
+	0x1974, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x56d3,
+	0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837,
+	0x2004, 0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0,
+	0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x28b2, 0x61e2,
+	0x001e, 0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805,
+	0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
+	0x025a, 0x4003, 0x080c, 0xab0c, 0x20a1, 0x024e, 0x20a9, 0x0008,
+	0x2099, 0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0xa247, 0x080c,
+	0x9c60, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f,
+	0x2000, 0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac,
+	0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085,
+	0x0002, 0x00d6, 0x0804, 0x9c10, 0x7026, 0x60c3, 0x0014, 0x0804,
+	0xa247, 0x080c, 0x9c60, 0x7003, 0x5000, 0x0804, 0x9ae9, 0x080c,
+	0x9c60, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804,
+	0xa247, 0x080c, 0x9ca2, 0x0010, 0x080c, 0x9cab, 0x7003, 0x0200,
+	0x60c3, 0x0004, 0x0804, 0xa247, 0x080c, 0x9cab, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0xa247,
+	0x080c, 0x9cab, 0x7003, 0x0200, 0x0804, 0x9ae9, 0x080c, 0x9cab,
+	0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b,
+	0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa247, 0x00d6,
+	0x080c, 0x9cab, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800,
+	0xb894, 0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190,
+	0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100,
+	0x0058, 0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f,
+	0x0700, 0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1847, 0x7904,
+	0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085,
+	0x0010, 0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002,
+	0x0026, 0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbacc,
+	0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140,
+	0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd,
+	0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0xa247, 0x080c,
+	0x9cab, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3,
+	0x0014, 0x0804, 0xa247, 0x080c, 0x9cab, 0x7003, 0x0200, 0x0804,
+	0x9a6f, 0x080c, 0x9cab, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f,
+	0x2a00, 0x60c3, 0x0008, 0x0804, 0xa247, 0x080c, 0x9cab, 0x7003,
+	0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0xa247, 0x0026,
+	0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040,
+	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100,
+	0x080c, 0xab21, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012,
+	0x004e, 0x003e, 0x00de, 0x080c, 0xa235, 0x721a, 0x9f95, 0x0000,
+	0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026,
+	0x080c, 0xab21, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069,
+	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x00de, 0x7013, 0x2029,
+	0x0c10, 0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f,
+	0x0000, 0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300,
+	0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
+	0x2300, 0x2021, 0x0100, 0x080c, 0xab21, 0xb810, 0x9305, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814,
+	0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c,
+	0x700a, 0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e,
+	0x003e, 0x00de, 0x080c, 0xa235, 0x721a, 0x7a08, 0x7222, 0x2f10,
+	0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0xa235, 0x721a,
+	0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071,
+	0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092,
+	0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78, 0x2061, 0x0100,
+	0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x0005, 0x9d19, 0x9d28, 0x9d33, 0x9d17, 0x9d17, 0x9d17,
+	0x9d19, 0x9d17, 0x9d17, 0x9d17, 0x9d17, 0x9d17, 0x9d17, 0x080c,
+	0x0dd5, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2ba5, 0x0228,
+	0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0xa247,
+	0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3,
+	0x000c, 0x0804, 0xa247, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300,
+	0x60c3, 0x0004, 0x0804, 0xa247, 0x0026, 0x080c, 0xab21, 0xb810,
+	0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c,
+	0x700a, 0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9c7b, 0x0026,
+	0x080c, 0xab21, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099,
+	0x7012, 0x0804, 0x9cdd, 0x0026, 0x080c, 0xab21, 0xb810, 0x9085,
+	0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
+	0x6880, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9cdd, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071,
+	0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0dd5, 0x908a, 0x0054,
+	0x1a0c, 0x0dd5, 0x7910, 0x2158, 0xb9c0, 0x2061, 0x0100, 0x619a,
+	0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x0005, 0x9dae, 0x9e6a, 0x9e3d, 0x9f8c, 0x9dac, 0x9dac, 0x9dac,
+	0x9dac, 0x9dac, 0x9dac, 0x9dac, 0xa66f, 0xa677, 0xa67f, 0xa687,
+	0x9dac, 0xaa69, 0x9dac, 0xa667, 0x080c, 0x0dd5, 0x0096, 0x780b,
+	0xffff, 0x080c, 0x9e19, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64,
+	0x96b4, 0x00ff, 0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032, 0xa8b8,
+	0x7036, 0xa8bc, 0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132, 0xa97c,
+	0x9184, 0x000f, 0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118,
+	0x2001, 0x0004, 0x0018, 0x9084, 0x0006, 0x8004, 0x2010, 0x785c,
+	0x9084, 0x00ff, 0x8007, 0x9205, 0x7042, 0xd1ac, 0x0158, 0x7047,
+	0x0002, 0x9686, 0x0008, 0x1118, 0x080c, 0x18ac, 0x0010, 0x080c,
+	0x1725, 0x0050, 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047,
+	0x0000, 0x9016, 0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a, 0x766e,
+	0x20a9, 0x0008, 0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c, 0x9080,
+	0x0023, 0x2098, 0x20a1, 0x0252, 0x2069, 0x0200, 0x6813, 0x0018,
+	0x4003, 0x6813, 0x0008, 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001,
+	0x1a03, 0x2003, 0x07d0, 0x2001, 0x1a02, 0x2003, 0x0009, 0x009e,
+	0x0005, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8cc, 0xd084, 0x0128,
+	0x7a46, 0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e,
+	0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206,
+	0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0829,
+	0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081,
+	0x7814, 0x2048, 0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a,
+	0xa8ac, 0x700e, 0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0xa247,
+	0x6813, 0x0008, 0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0889,
+	0x080c, 0xa235, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
+	0x024c, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9f6a, 0x7814, 0x2048,
+	0x080c, 0xcb33, 0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033,
+	0x0010, 0x9006, 0x001b, 0x009e, 0x00de, 0x0005, 0x9e88, 0x9ef1,
+	0x9f01, 0x9f27, 0x9f33, 0x9f44, 0x9f4c, 0x9e86, 0x080c, 0x0dd5,
+	0x0016, 0x0036, 0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003,
+	0x1198, 0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a,
+	0xa894, 0x701e, 0x003e, 0x001e, 0x2001, 0x19b1, 0x2004, 0x60c2,
+	0x0804, 0xa247, 0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0dd5,
+	0xaba8, 0x7824, 0xd0cc, 0x1904, 0x9eee, 0x7316, 0xa898, 0x701a,
+	0xa894, 0x701e, 0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018,
+	0x9384, 0x0300, 0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc,
+	0x0110, 0xa8a4, 0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011,
+	0x0258, 0x20e9, 0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000,
+	0x6812, 0x2011, 0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810,
+	0xc084, 0x6812, 0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245,
+	0x201a, 0x61c2, 0x003e, 0x001e, 0x0804, 0xa247, 0xc3e5, 0x0804,
+	0x9ead, 0x2011, 0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4, 0x0110,
+	0x2011, 0x0028, 0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8,
+	0xc2e5, 0x2011, 0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e,
+	0x9105, 0x0108, 0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
+	0x7216, 0x7027, 0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047,
+	0x0500, 0x704f, 0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071,
+	0x0240, 0x700b, 0x2500, 0x60c3, 0x0032, 0x0804, 0xa247, 0x2011,
+	0x0028, 0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804,
+	0xa247, 0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108,
+	0xc2e5, 0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036,
+	0x60c3, 0x0020, 0x0804, 0xa247, 0x2011, 0x0008, 0x7824, 0xd0cc,
+	0x0108, 0xc2e5, 0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00,
+	0x7816, 0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108,
+	0xc2e5, 0x7216, 0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006,
+	0x7824, 0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e,
+	0x003e, 0x0818, 0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700,
 	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880,
-	0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9cb4, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240,
-	0x7804, 0x908a, 0x0040, 0x0a0c, 0x0dd5, 0x908a, 0x0054, 0x1a0c,
-	0x0dd5, 0x7910, 0x2158, 0xb9c0, 0x2061, 0x0100, 0x619a, 0x9082,
-	0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
-	0x9d85, 0x9e41, 0x9e14, 0x9f63, 0x9d83, 0x9d83, 0x9d83, 0x9d83,
-	0x9d83, 0x9d83, 0x9d83, 0xa655, 0xa65d, 0xa665, 0xa66d, 0x9d83,
-	0xaa4f, 0x9d83, 0xa64d, 0x080c, 0x0dd5, 0x0096, 0x780b, 0xffff,
-	0x080c, 0x9df0, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64, 0x96b4,
-	0x00ff, 0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032, 0xa8b8, 0x7036,
-	0xa8bc, 0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132, 0xa97c, 0x9184,
-	0x000f, 0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0018, 0x9084, 0x0006, 0x8004, 0x2010, 0x785c, 0x9084,
-	0x00ff, 0x8007, 0x9205, 0x7042, 0xd1ac, 0x0158, 0x7047, 0x0002,
-	0x9686, 0x0008, 0x1118, 0x080c, 0x18ac, 0x0010, 0x080c, 0x1725,
-	0x0050, 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047, 0x0000,
-	0x9016, 0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a, 0x766e, 0x20a9,
-	0x0008, 0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023,
-	0x2098, 0x20a1, 0x0252, 0x2069, 0x0200, 0x6813, 0x0018, 0x4003,
-	0x6813, 0x0008, 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001, 0x1a03,
-	0x2003, 0x07d0, 0x2001, 0x1a02, 0x2003, 0x0009, 0x009e, 0x0005,
-	0x6813, 0x0008, 0xba8c, 0x8210, 0xb8cc, 0xd084, 0x0128, 0x7a46,
-	0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217,
-	0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x2069,
-	0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0829, 0x2f10,
-	0x7222, 0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081, 0x7814,
-	0x2048, 0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a, 0xa8ac,
-	0x700e, 0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0xa22d, 0x6813,
-	0x0008, 0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0889, 0x080c,
-	0xa21b, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c,
-	0x0005, 0x00d6, 0x0096, 0x080c, 0x9f41, 0x7814, 0x2048, 0x080c,
-	0xcb19, 0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033, 0x0010,
-	0x9006, 0x001b, 0x009e, 0x00de, 0x0005, 0x9e5f, 0x9ec8, 0x9ed8,
-	0x9efe, 0x9f0a, 0x9f1b, 0x9f23, 0x9e5d, 0x080c, 0x0dd5, 0x0016,
-	0x0036, 0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003, 0x1198,
-	0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a, 0xa894,
-	0x701e, 0x003e, 0x001e, 0x2001, 0x19b1, 0x2004, 0x60c2, 0x0804,
-	0xa22d, 0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0dd5, 0xaba8,
-	0x7824, 0xd0cc, 0x1904, 0x9ec5, 0x7316, 0xa898, 0x701a, 0xa894,
-	0x701e, 0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018, 0x9384,
-	0x0300, 0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc, 0x0110,
-	0xa8a4, 0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011, 0x0258,
-	0x20e9, 0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000, 0x6812,
-	0x2011, 0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810, 0xc084,
-	0x6812, 0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245, 0x201a,
-	0x61c2, 0x003e, 0x001e, 0x0804, 0xa22d, 0xc3e5, 0x0804, 0x9e84,
-	0x2011, 0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4, 0x0110, 0x2011,
-	0x0028, 0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8, 0xc2e5,
-	0x2011, 0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e, 0x9105,
-	0x0108, 0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
-	0x7027, 0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047, 0x0500,
-	0x704f, 0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071, 0x0240,
-	0x700b, 0x2500, 0x60c3, 0x0032, 0x0804, 0xa22d, 0x2011, 0x0028,
-	0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804, 0xa22d,
-	0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
-	0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036, 0x60c3,
-	0x0020, 0x0804, 0xa22d, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0108,
-	0xc2e5, 0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00, 0x7816,
-	0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
-	0x7216, 0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006, 0x7824,
-	0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e, 0x003e,
-	0x0818, 0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700, 0x7002,
-	0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e,
-	0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0xa21b, 0x721a,
-	0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005,
-	0x7013, 0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007,
-	0x0013, 0x001e, 0x0005, 0x9f73, 0x9f73, 0x9f75, 0x9f73, 0x9f73,
-	0x9f73, 0x9f8f, 0x9f73, 0x080c, 0x0dd5, 0x7914, 0x918c, 0x08ff,
-	0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1847,
-	0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032,
-	0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0xa22d, 0x2009,
-	0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0xab07,
-	0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0888, 0x918d,
-	0x0008, 0x7116, 0x080c, 0xa21b, 0x721a, 0x7a08, 0x7222, 0x2f10,
-	0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056,
-	0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810,
-	0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110, 0x737c, 0x7480, 0x2500,
-	0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001, 0x04ff, 0x6062, 0x6067,
-	0xffff, 0x636a, 0x646e, 0x0050, 0x2001, 0x00ff, 0x9085, 0x0400,
-	0x6062, 0x6067, 0xffff, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6073,
-	0x0530, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000, 0x2b00, 0x6082,
-	0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa838, 0x608a, 0xa834,
-	0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0x009e, 0xb86c, 0x60ce,
-	0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x2001, 0x1837,
-	0x2004, 0x9084, 0x0028, 0x0128, 0x609f, 0x0000, 0x2001, 0x0092,
-	0x0048, 0x6028, 0xc0bd, 0x602a, 0x609f, 0x00ff, 0x6027, 0xffff,
-	0x2001, 0x00b2, 0x6016, 0x2009, 0x07d0, 0x080c, 0x8555, 0x003e,
-	0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005,
-	0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0036,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058, 0xb8a0,
-	0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582, 0x007e, 0x1250, 0x2500,
-	0x9094, 0xff80, 0x1130, 0x9080, 0x331e, 0x2015, 0x9294, 0x00ff,
-	0x0020, 0xb910, 0xba14, 0x737c, 0x7480, 0x70dc, 0xd0ac, 0x1130,
-	0x9582, 0x007e, 0x1218, 0x9584, 0xff80, 0x0138, 0x9185, 0x0400,
-	0x6062, 0x6266, 0x636a, 0x646e, 0x0030, 0x6063, 0x0400, 0x6266,
-	0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072, 0x6077, 0x0000, 0xb864,
-	0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff,
+	0x700e, 0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0xa235,
+	0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de,
+	0x0005, 0x7013, 0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700,
+	0x8007, 0x0013, 0x001e, 0x0005, 0x9f9c, 0x9f9c, 0x9f9e, 0x9f9c,
+	0x9f9c, 0x9f9c, 0x9fb8, 0x9f9c, 0x080c, 0x0dd5, 0x7914, 0x918c,
+	0x08ff, 0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069,
+	0x1847, 0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007,
+	0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0xa247,
+	0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c,
+	0xab21, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0888,
+	0x918d, 0x0008, 0x7116, 0x080c, 0xa235, 0x721a, 0x7a08, 0x7222,
+	0x2f10, 0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160,
+	0x7810, 0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110, 0x737c, 0x7480,
+	0x2500, 0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001, 0x04ff, 0x6062,
+	0x6067, 0xffff, 0x636a, 0x646e, 0x0050, 0x2001, 0x00ff, 0x9085,
+	0x0400, 0x6062, 0x6067, 0xffff, 0x606b, 0x0000, 0x616e, 0xb8b8,
+	0x6073, 0x0530, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff,
 	0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000, 0x2b00,
 	0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa838, 0x608a,
 	0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0x009e, 0xb86c,
-	0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xbac0,
-	0x629e, 0x00f6, 0x2079, 0x0140, 0x7803, 0x0000, 0x00fe, 0x2009,
-	0x0092, 0x6116, 0x2009, 0x07d0, 0x080c, 0x8555, 0x003e, 0x004e,
-	0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x00b6,
-	0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036, 0x2061,
-	0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910,
-	0xba14, 0x737c, 0x7480, 0x7820, 0x90be, 0x0006, 0x0904, 0xa18a,
-	0x90be, 0x000a, 0x1904, 0xa146, 0x609f, 0x0000, 0x7814, 0x2048,
-	0xa87c, 0xd0fc, 0x05d0, 0xaf90, 0x9784, 0xff00, 0x9105, 0x6062,
-	0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878, 0xc0fc,
-	0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0510, 0x2039, 0x0098,
-	0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086, 0x0038, 0x9185,
-	0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000, 0x609f, 0x0000,
-	0x2001, 0x1837, 0x2004, 0xd0ac, 0x11a8, 0xd09c, 0x0130, 0x7814,
-	0x2048, 0xa874, 0x9082, 0x0080, 0x1268, 0xb814, 0x609e, 0x0050,
-	0x2039, 0x0029, 0x9705, 0x6072, 0x0c48, 0x9185, 0x0200, 0x6062,
-	0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94, 0x87ff, 0x1120,
-	0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a, 0x646e, 0x6077,
-	0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a,
-	0x607f, 0x0000, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
+	0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x2001,
+	0x1837, 0x2004, 0x9084, 0x0028, 0x0128, 0x609f, 0x0000, 0x2001,
+	0x0092, 0x0048, 0x6028, 0xc0bd, 0x602a, 0x609f, 0x00ff, 0x6027,
+	0xffff, 0x2001, 0x00b2, 0x6016, 0x2009, 0x07d0, 0x080c, 0x857e,
+	0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be,
+	0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046,
+	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058,
+	0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582, 0x007e, 0x1250,
+	0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x3325, 0x2015, 0x9294,
+	0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480, 0x70dc, 0xd0ac,
+	0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80, 0x0138, 0x9185,
+	0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030, 0x6063, 0x0400,
+	0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072, 0x6077, 0x0000,
+	0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000,
+	0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa838,
+	0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0x009e,
+	0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
+	0xbac0, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803, 0x0000, 0x00fe,
+	0x2009, 0x0092, 0x6116, 0x2009, 0x07d0, 0x080c, 0x857e, 0x003e,
+	0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005,
+	0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028,
+	0xb910, 0xba14, 0x737c, 0x7480, 0x7820, 0x90be, 0x0006, 0x0904,
+	0xa1a4, 0x90be, 0x000a, 0x1904, 0xa160, 0xb8c0, 0x609e, 0x7814,
+	0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00, 0x9105,
+	0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878,
+	0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198, 0x2039,
+	0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086, 0x0038,
+	0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000, 0xb8c0,
+	0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0, 0x9185,
+	0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94,
+	0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a,
+	0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834, 0x608e,
+	0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0x080c, 0xab06, 0x2009, 0x07d0, 0x60c4, 0x9084,
+	0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x857e, 0x003e,
+	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005,
+	0x7804, 0x9086, 0x0040, 0x0904, 0xa1e0, 0x9185, 0x0100, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008, 0x60af,
+	0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086,
+	0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
+	0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbac0, 0x629e, 0x080c, 0xab06,
+	0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009,
+	0x1b58, 0x080c, 0x857e, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de,
+	0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c, 0x9084,
+	0x0003, 0x9086, 0x0002, 0x0904, 0xa1fc, 0x9185, 0x0100, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0xb88c,
+	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838, 0x607e,
+	0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c, 0x608e,
+	0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108, 0x7932,
+	0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0xbac0, 0x629e, 0x080c, 0xaae3, 0x0804, 0xa190,
+	0xb8cc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c, 0x7846,
+	0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062, 0x6266,
+	0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af, 0x9575,
+	0x60d7, 0x0000, 0x0804, 0xa173, 0x9185, 0x0700, 0x6062, 0x6266,
+	0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073, 0x0889,
+	0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086,
+	0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
 	0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
-	0x080c, 0xaaec, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005,
-	0x0110, 0x2009, 0x1b58, 0x080c, 0x8555, 0x003e, 0x004e, 0x005e,
-	0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7804, 0x9086,
-	0x0040, 0x0904, 0xa1c6, 0x9185, 0x0100, 0x6062, 0x6266, 0x636a,
-	0x646e, 0x6073, 0x0809, 0x6077, 0x0008, 0x60af, 0x95d5, 0x60d7,
-	0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a,
-	0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086, 0x7814, 0x2048,
-	0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca,
-	0xb86c, 0x60ce, 0xbac0, 0x629e, 0x080c, 0xaaec, 0x2009, 0x07d0,
-	0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c,
-	0x8555, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e,
-	0x00be, 0x0005, 0x7814, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086,
-	0x0002, 0x0904, 0xa1e2, 0x9185, 0x0100, 0x6062, 0x6266, 0x636a,
-	0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084,
-	0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838, 0x607e, 0x2f00, 0x6086,
-	0x7808, 0x6082, 0xa890, 0x608a, 0xa88c, 0x608e, 0xa8b0, 0x60c6,
-	0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108, 0x7932, 0xa8b0, 0x792c,
-	0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
-	0xbac0, 0x629e, 0x080c, 0xaac9, 0x0804, 0xa176, 0xb8cc, 0xd084,
-	0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c, 0x7846, 0xa836, 0x2900,
-	0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062, 0x6266, 0x636a, 0x646e,
-	0x6073, 0x0829, 0x6077, 0x0000, 0x60af, 0x9575, 0x60d7, 0x0000,
-	0x0804, 0xa159, 0x9185, 0x0700, 0x6062, 0x6266, 0x636a, 0x646e,
-	0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073, 0x0889, 0x0010, 0x6073,
-	0x0898, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086, 0x7808, 0x6082,
-	0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca,
-	0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xbac0, 0x629e,
-	0x7824, 0xd0cc, 0x0120, 0x080c, 0xaaec, 0x0804, 0xa176, 0x080c,
-	0xaac9, 0x0804, 0xa176, 0x7a10, 0x00b6, 0x2258, 0xba8c, 0x8210,
-	0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217, 0x0005, 0x00d6, 0x2069,
-	0x19e7, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7,
-	0x9575, 0x00f1, 0x080c, 0x8547, 0x0005, 0x0016, 0x2001, 0x180c,
-	0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089, 0x080c,
-	0x8547, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c, 0x2102, 0x2001,
-	0x19e8, 0x2003, 0x0000, 0x2001, 0x19f0, 0x2003, 0x0000, 0x0c88,
-	0x0006, 0x6014, 0x9084, 0x1804, 0x9085, 0x0009, 0x6016, 0x000e,
-	0x0005, 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100, 0x61a4, 0x60a7,
-	0x95f5, 0x6014, 0x9084, 0x1804, 0x9085, 0x0008, 0x6016, 0x000e,
-	0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e, 0x0005, 0x00c6,
-	0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c,
-	0x73b0, 0x11e8, 0x2001, 0x1a03, 0x2004, 0x9005, 0x1904, 0xa2bf,
-	0x0066, 0x2031, 0x0001, 0x080c, 0x7460, 0x006e, 0x1160, 0x2061,
-	0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0dd5,
-	0x080c, 0x8547, 0x0460, 0x00c6, 0x2061, 0x19e7, 0x00d0, 0x6904,
-	0x9194, 0x4000, 0x0548, 0x080c, 0xa259, 0x080c, 0x2cff, 0x00c6,
-	0x2061, 0x19e7, 0x6128, 0x9192, 0x0008, 0x1258, 0x8108, 0x612a,
-	0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x8547, 0x080c, 0xa250,
-	0x0070, 0x6124, 0x91e5, 0x0000, 0x0140, 0x080c, 0xe9dd, 0x080c,
-	0x8550, 0x2009, 0x0014, 0x080c, 0xaec2, 0x00ce, 0x0000, 0x002e,
-	0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x1a03, 0x2004, 0x9005,
-	0x1db0, 0x00c6, 0x2061, 0x19e7, 0x6128, 0x9192, 0x0003, 0x1e08,
-	0x8108, 0x612a, 0x00ce, 0x080c, 0x8547, 0x080c, 0x5eda, 0x2009,
-	0x1846, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6, 0x00d6,
-	0x00e6, 0x0016, 0x0026, 0x080c, 0x855d, 0x2071, 0x19e7, 0x713c,
-	0x81ff, 0x0904, 0xa363, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c,
-	0x73b0, 0x1500, 0x0036, 0x2019, 0x0002, 0x080c, 0xa59c, 0x003e,
-	0x713c, 0x2160, 0x080c, 0xe9dd, 0x2009, 0x004a, 0x6220, 0x9296,
-	0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009, 0x004a,
-	0x080c, 0xaec2, 0x0066, 0x2031, 0x0001, 0x080c, 0x7460, 0x006e,
-	0x0804, 0xa363, 0x080c, 0xa36f, 0x0904, 0xa363, 0x6904, 0xd1f4,
-	0x0904, 0xa36a, 0x080c, 0x2cff, 0x00c6, 0x703c, 0x9065, 0x090c,
-	0x0dd5, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528, 0x61c8, 0x60c4,
-	0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01e0, 0x6214,
-	0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1560, 0x0030,
-	0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2c52, 0x6014, 0x9084,
-	0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060, 0x2009, 0x0049,
-	0x080c, 0xaec2, 0x00c0, 0x0036, 0x2019, 0x0001, 0x080c, 0xa59c,
-	0x003e, 0x713c, 0x2160, 0x080c, 0xe9dd, 0x2009, 0x004a, 0x6220,
-	0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009,
-	0x004a, 0x080c, 0xaec2, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce,
-	0x009e, 0x0005, 0xd1ec, 0x1904, 0xa31a, 0x0804, 0xa31c, 0x00d6,
-	0x00c6, 0x0096, 0x703c, 0x9065, 0x090c, 0x0dd5, 0x2001, 0x1837,
-	0x2004, 0xd09c, 0x1904, 0xa3fb, 0x2001, 0x0306, 0x200c, 0x9184,
-	0x0030, 0x0904, 0xa3fb, 0x9184, 0x0048, 0x9086, 0x0008, 0x1904,
-	0xa3fb, 0x2001, 0x020b, 0x2004, 0xd0fc, 0x0904, 0xa3fb, 0xd08c,
-	0x0904, 0xa3fb, 0x2009, 0x1a80, 0x2104, 0x8000, 0x0208, 0x200a,
-	0x2069, 0x0100, 0x6914, 0x918c, 0x0184, 0x918d, 0x0010, 0x6916,
-	0x69c8, 0x2011, 0x0020, 0x68c8, 0x9106, 0x1570, 0x8211, 0x1dd8,
-	0x2001, 0x0306, 0x2003, 0x4800, 0x2001, 0x009a, 0x2003, 0x0004,
-	0x2001, 0x1a66, 0x2003, 0x0000, 0x2001, 0x1a6f, 0x2003, 0x0000,
-	0x6a88, 0x698c, 0x2200, 0x9105, 0x1120, 0x2c10, 0x080c, 0x1bad,
-	0x0040, 0x6014, 0x2048, 0xaa3a, 0xa936, 0x6ac4, 0x69c8, 0xa946,
-	0xaa4a, 0x0126, 0x00c6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1c46,
-	0x190c, 0x0dd5, 0x012e, 0x0090, 0x2009, 0x1a81, 0x2104, 0x8000,
-	0x0208, 0x200a, 0x69c8, 0x2011, 0x0020, 0x8211, 0x1df0, 0x68c8,
-	0x9106, 0x1dc0, 0x69c4, 0x68c8, 0x9105, 0x0160, 0x6824, 0xd08c,
-	0x0110, 0x6827, 0x0002, 0x7048, 0xc085, 0x704a, 0x0079, 0x7048,
-	0xc084, 0x704a, 0x2009, 0x07d0, 0x080c, 0x8555, 0x9006, 0x009e,
-	0x00ce, 0x00de, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0026, 0x00e6,
-	0x2071, 0x19e7, 0x7048, 0xd084, 0x01d8, 0x713c, 0x81ff, 0x01c0,
-	0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138,
-	0x7014, 0x9084, 0x1984, 0x9085, 0x0012, 0x7016, 0x0048, 0x928e,
-	0x0009, 0x0db0, 0x7014, 0x9084, 0x1984, 0x9085, 0x0016, 0x7016,
-	0x00ee, 0x002e, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
-	0x0056, 0x0046, 0x0006, 0x0126, 0x2091, 0x8000, 0x6010, 0x2058,
-	0xbca0, 0x2071, 0x19e7, 0x7018, 0x2058, 0x8bff, 0x0190, 0xb8a0,
-	0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0, 0x6014, 0x0096, 0x2048,
-	0xac6c, 0xad70, 0xae78, 0x009e, 0x080c, 0x6732, 0x0110, 0x9085,
-	0x0001, 0x012e, 0x000e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00be, 0x0005, 0x080c, 0x9c37, 0x7003, 0x1200, 0x7838,
-	0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148,
-	0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be,
-	0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084, 0x00ff, 0x700a,
-	0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0xa22d, 0x080c, 0x9c37,
-	0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff,
-	0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa22d, 0x0156,
-	0x080c, 0x9c82, 0x7003, 0x0200, 0x080c, 0x85b0, 0x20a9, 0x0006,
-	0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002, 0x2305, 0x2072,
-	0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
-	0x1f04, 0xa496, 0x60c3, 0x001c, 0x015e, 0x0804, 0xa22d, 0x0016,
-	0x0026, 0x080c, 0x9c5e, 0x080c, 0x9c70, 0x9e80, 0x0004, 0x20e9,
-	0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e, 0x7808, 0x9088,
-	0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003, 0x9080, 0x0004,
-	0x8003, 0x60c2, 0x080c, 0xa22d, 0x002e, 0x001e, 0x0005, 0x20a9,
-	0x0010, 0x4003, 0x080c, 0xaaf2, 0x20a1, 0x0240, 0x22a8, 0x4003,
-	0x0c68, 0x080c, 0x9c37, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0xa22d, 0x0016, 0x0026, 0x080c, 0x9c37, 0x20e9,
-	0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048,
-	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808,
-	0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0xa22d,
-	0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19e7, 0x700c, 0x2060, 0x8cff, 0x0178, 0x080c,
-	0xcd21, 0x1110, 0x080c, 0xb7f9, 0x600c, 0x0006, 0x080c, 0xcf88,
-	0x080c, 0xae47, 0x080c, 0xa678, 0x00ce, 0x0c78, 0x2c00, 0x700e,
-	0x700a, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156,
+	0xbac0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0xab06, 0x0804,
+	0xa190, 0x080c, 0xaae3, 0x0804, 0xa190, 0x7a10, 0x00b6, 0x2258,
+	0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217, 0x0005,
+	0x00d6, 0x2069, 0x19e7, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8570, 0x0005, 0x0016,
+	0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128,
+	0x0089, 0x080c, 0x8570, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c,
+	0x2102, 0x2001, 0x19e8, 0x2003, 0x0000, 0x2001, 0x19f0, 0x2003,
+	0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085, 0x0009,
+	0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100,
+	0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085, 0x0008,
+	0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e,
+	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x73bc, 0x11e8, 0x2001, 0x1a03, 0x2004, 0x9005,
+	0x1904, 0xa2d9, 0x0066, 0x2031, 0x0001, 0x080c, 0x746c, 0x006e,
+	0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084,
+	0x090c, 0x0dd5, 0x080c, 0x8570, 0x0460, 0x00c6, 0x2061, 0x19e7,
+	0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0xa273, 0x080c,
+	0x2cff, 0x00c6, 0x2061, 0x19e7, 0x6128, 0x9192, 0x0008, 0x1258,
+	0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x8570,
+	0x080c, 0xa26a, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140, 0x080c,
+	0xe9fe, 0x080c, 0x8579, 0x2009, 0x0014, 0x080c, 0xaedc, 0x00ce,
+	0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x1a03,
+	0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e7, 0x6128, 0x9192,
+	0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x8570, 0x080c,
+	0x5ed9, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096,
+	0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x8586, 0x2071,
+	0x19e7, 0x713c, 0x81ff, 0x0904, 0xa37d, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x73bc, 0x1500, 0x0036, 0x2019, 0x0002, 0x080c,
+	0xa5b6, 0x003e, 0x713c, 0x2160, 0x080c, 0xe9fe, 0x2009, 0x004a,
+	0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006,
+	0x2009, 0x004a, 0x080c, 0xaedc, 0x0066, 0x2031, 0x0001, 0x080c,
+	0x746c, 0x006e, 0x0804, 0xa37d, 0x080c, 0xa389, 0x0904, 0xa37d,
+	0x6904, 0xd1f4, 0x0904, 0xa384, 0x080c, 0x2cff, 0x00c6, 0x703c,
+	0x9065, 0x090c, 0x0dd5, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528,
+	0x61c8, 0x60c4, 0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4,
+	0x01e0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002,
+	0x1560, 0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2c52,
+	0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060,
+	0x2009, 0x0049, 0x080c, 0xaedc, 0x00c0, 0x0036, 0x2019, 0x0001,
+	0x080c, 0xa5b6, 0x003e, 0x713c, 0x2160, 0x080c, 0xe9fe, 0x2009,
+	0x004a, 0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b,
+	0x0006, 0x2009, 0x004a, 0x080c, 0xaedc, 0x002e, 0x001e, 0x00ee,
+	0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0xa334, 0x0804,
+	0xa336, 0x00d6, 0x00c6, 0x0096, 0x703c, 0x9065, 0x090c, 0x0dd5,
+	0x2001, 0x1837, 0x2004, 0xd09c, 0x1904, 0xa415, 0x2001, 0x0306,
+	0x200c, 0x9184, 0x0030, 0x0904, 0xa415, 0x9184, 0x0048, 0x9086,
+	0x0008, 0x1904, 0xa415, 0x2001, 0x020b, 0x2004, 0xd0fc, 0x0904,
+	0xa415, 0xd08c, 0x0904, 0xa415, 0x2009, 0x1a80, 0x2104, 0x8000,
+	0x0208, 0x200a, 0x2069, 0x0100, 0x6914, 0x918c, 0x0184, 0x918d,
+	0x0010, 0x6916, 0x69c8, 0x2011, 0x0020, 0x68c8, 0x9106, 0x1570,
+	0x8211, 0x1dd8, 0x2001, 0x0306, 0x2003, 0x4800, 0x2001, 0x009a,
+	0x2003, 0x0004, 0x2001, 0x1a66, 0x2003, 0x0000, 0x2001, 0x1a6f,
+	0x2003, 0x0000, 0x6a88, 0x698c, 0x2200, 0x9105, 0x1120, 0x2c10,
+	0x080c, 0x1bad, 0x0040, 0x6014, 0x2048, 0xaa3a, 0xa936, 0x6ac4,
+	0x69c8, 0xa946, 0xaa4a, 0x0126, 0x00c6, 0x2091, 0x2400, 0x002e,
+	0x080c, 0x1c46, 0x190c, 0x0dd5, 0x012e, 0x0090, 0x2009, 0x1a81,
+	0x2104, 0x8000, 0x0208, 0x200a, 0x69c8, 0x2011, 0x0020, 0x8211,
+	0x1df0, 0x68c8, 0x9106, 0x1dc0, 0x69c4, 0x68c8, 0x9105, 0x0160,
+	0x6824, 0xd08c, 0x0110, 0x6827, 0x0002, 0x7048, 0xc085, 0x704a,
+	0x0079, 0x7048, 0xc084, 0x704a, 0x2009, 0x07d0, 0x080c, 0x857e,
+	0x9006, 0x009e, 0x00ce, 0x00de, 0x0005, 0x9085, 0x0001, 0x0cc8,
+	0x0026, 0x00e6, 0x2071, 0x19e7, 0x7048, 0xd084, 0x01d8, 0x713c,
+	0x81ff, 0x01c0, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e,
+	0x0006, 0x1138, 0x7014, 0x9084, 0x1984, 0x9085, 0x0012, 0x7016,
+	0x0048, 0x928e, 0x0009, 0x0db0, 0x7014, 0x9084, 0x1984, 0x9085,
+	0x0016, 0x7016, 0x00ee, 0x002e, 0x0005, 0x00b6, 0x00e6, 0x00d6,
+	0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x6010, 0x2058, 0xbca0, 0x2071, 0x19e7, 0x7018, 0x2058, 0x8bff,
+	0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0, 0x6014,
+	0x0096, 0x2048, 0xac6c, 0xad70, 0xae78, 0x009e, 0x080c, 0x6731,
+	0x0110, 0x9085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x080c, 0x9c60, 0x7003,
+	0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086,
+	0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810,
+	0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084,
+	0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0xa247,
+	0x080c, 0x9c60, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810,
+	0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0xa247, 0x0156, 0x080c, 0x9cab, 0x7003, 0x0200, 0x080c, 0x85d9,
+	0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002,
+	0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002,
+	0x9290, 0x0002, 0x1f04, 0xa4b0, 0x60c3, 0x001c, 0x015e, 0x0804,
+	0xa247, 0x0016, 0x0026, 0x080c, 0x9c87, 0x080c, 0x9c99, 0x9e80,
+	0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800,
+	0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e,
+	0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003,
+	0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0xa247, 0x002e, 0x001e,
+	0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0xab0c, 0x20a1, 0x0240,
+	0x22a8, 0x4003, 0x0c68, 0x080c, 0x9c60, 0x7003, 0x6200, 0x7808,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0xa247, 0x0016, 0x0026, 0x080c,
+	0x9c60, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048,
+	0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098,
+	0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2,
+	0x080c, 0xa247, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x700c, 0x2060, 0x8cff,
+	0x0178, 0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813, 0x600c, 0x0006,
+	0x080c, 0xcfa2, 0x080c, 0xae61, 0x080c, 0xa692, 0x00ce, 0x0c78,
+	0x2c00, 0x700e, 0x700a, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005,
+	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
+	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
+	0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7,
+	0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c, 0xa273, 0x6ac0, 0x68c3,
+	0x0000, 0x080c, 0x8579, 0x00c6, 0x2061, 0x0100, 0x080c, 0xac5d,
+	0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009, 0x0013, 0x080c, 0xaedc,
+	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001,
+	0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x8579, 0x6814, 0x9084,
+	0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
+	0x2011, 0x5e83, 0x080c, 0x84f3, 0x20a9, 0x01f4, 0x0009, 0x08c0,
+	0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000,
+	0x190c, 0x2cff, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010,
+	0x1f04, 0xa598, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x0005, 0x0126, 0x0156,
 	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
-	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102,
-	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7, 0x7024, 0x2060,
-	0x8cff, 0x01f8, 0x080c, 0xa259, 0x6ac0, 0x68c3, 0x0000, 0x080c,
-	0x8550, 0x00c6, 0x2061, 0x0100, 0x080c, 0xac43, 0x00ce, 0x20a9,
-	0x01f4, 0x0461, 0x2009, 0x0013, 0x080c, 0xaec2, 0x000e, 0x001e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
-	0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001, 0x0d78, 0x9096,
-	0x0004, 0x0d60, 0x080c, 0x8550, 0x6814, 0x9084, 0x0001, 0x0110,
-	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x5e84,
-	0x080c, 0x84ca, 0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094,
+	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102,
+	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7, 0x703c, 0x2060,
+	0x8cff, 0x0904, 0xa648, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084,
+	0x0002, 0x0904, 0xa648, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009,
+	0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8586,
+	0x080c, 0x1ffa, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e51, 0x2021,
+	0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af,
+	0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090,
+	0x2071, 0x1a66, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816,
+	0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002,
+	0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x2001, 0x1981,
+	0x200c, 0x080c, 0x0e51, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094,
 	0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2cff,
-	0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0xa57e,
+	0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0xa61e,
 	0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef,
-	0x9006, 0x080c, 0x2cef, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6,
-	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000,
-	0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102, 0x2069, 0x0100,
-	0x2079, 0x0140, 0x2071, 0x19e7, 0x703c, 0x2060, 0x8cff, 0x0904,
-	0xa62e, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904,
-	0xa62e, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109,
-	0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x855d, 0x080c, 0x1ffa,
-	0x0046, 0x2009, 0x00a5, 0x080c, 0x0e51, 0x2021, 0x0169, 0x2404,
-	0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6,
-	0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x1a66,
-	0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816, 0x782b, 0x0008,
-	0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002, 0x1128, 0x7884,
-	0x9005, 0x1110, 0x7887, 0x0001, 0x2001, 0x1981, 0x200c, 0x080c,
-	0x0e51, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827,
-	0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2cff, 0x0090, 0xd08c,
-	0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0xa604, 0x7804, 0x9084,
-	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c,
-	0x2cef, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1140, 0x2009, 0x0049,
-	0x6020, 0x9086, 0x0009, 0x0110, 0x080c, 0xaec2, 0x000e, 0x001e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
-	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19e7, 0x6a06,
-	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
-	0x19e7, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c, 0x9df0, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x9df0, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x9df0, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x9df0, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x9df0, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0xa22d,
-	0x00e6, 0x2071, 0x19e7, 0x7020, 0x9005, 0x0110, 0x8001, 0x7022,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x7614, 0x2660,
-	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0xa71d, 0x8cff, 0x0904,
-	0xa71d, 0x6020, 0x9086, 0x0006, 0x1904, 0xa718, 0x88ff, 0x0138,
-	0x2800, 0x9c06, 0x1904, 0xa718, 0x2039, 0x0000, 0x0050, 0x6010,
-	0x9b06, 0x1904, 0xa718, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904,
-	0xa718, 0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x8550,
-	0x080c, 0xa7a2, 0x7027, 0x0000, 0x0428, 0x080c, 0x8550, 0x6820,
-	0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
-	0x080c, 0xa7a2, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9006, 0x080c, 0x2cef, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1140,
+	0x2009, 0x0049, 0x6020, 0x9086, 0x0009, 0x0110, 0x080c, 0xaedc,
+	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
+	0x19e7, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091,
+	0x8000, 0x2069, 0x19e7, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c,
+	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c,
+	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c,
+	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c,
+	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c,
+	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020,
+	0x0804, 0xa247, 0x00e6, 0x2071, 0x19e7, 0x7020, 0x9005, 0x0110,
+	0x8001, 0x7022, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
+	0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0xa737,
+	0x8cff, 0x0904, 0xa737, 0x6020, 0x9086, 0x0006, 0x1904, 0xa732,
+	0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904, 0xa732, 0x2039, 0x0000,
+	0x0050, 0x6010, 0x9b06, 0x1904, 0xa732, 0x85ff, 0x0120, 0x6054,
+	0x9106, 0x1904, 0xa732, 0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001,
+	0x080c, 0x8579, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0428, 0x080c,
+	0x8579, 0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
+	0x68c3, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2cef, 0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x7014, 0x9c36, 0x1110, 0x660c,
+	0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000,
+	0x6014, 0x0096, 0x2048, 0x080c, 0xcb33, 0x0110, 0x080c, 0xe551,
+	0x009e, 0x080c, 0xae92, 0x080c, 0xa692, 0x88ff, 0x1190, 0x00ce,
+	0x0804, 0xa6ad, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa6ad, 0x9006,
+	0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6,
+	0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19e7, 0x7638, 0x2660, 0x2678, 0x8cff,
+	0x0904, 0xa7ab, 0x6020, 0x9086, 0x0006, 0x1904, 0xa7a6, 0x87ff,
+	0x0128, 0x2700, 0x9c06, 0x1904, 0xa7a6, 0x0040, 0x6010, 0x9b06,
+	0x15e8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06,
+	0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa5b6, 0x7033, 0x0000,
+	0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x7038, 0x9c36,
+	0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x6014, 0x2048, 0x080c, 0xcb33, 0x0110, 0x080c, 0xe551, 0x080c,
+	0xae92, 0x87ff, 0x1198, 0x00ce, 0x0804, 0xa757, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0xa757, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e,
+	0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000,
+	0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e7, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010,
+	0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x2c10,
+	0x7638, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0,
+	0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000,
+	0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8,
+	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x760c, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0xa898, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be,
+	0x9206, 0x1904, 0xa893, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x0904, 0xa86f, 0x080c, 0xa273, 0x68c3, 0x0000,
+	0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
 	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006,
 	0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010,
-	0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
-	0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096,
-	0x2048, 0x080c, 0xcb19, 0x0110, 0x080c, 0xe530, 0x009e, 0x080c,
-	0xae78, 0x080c, 0xa678, 0x88ff, 0x1190, 0x00ce, 0x0804, 0xa693,
-	0x2c78, 0x600c, 0x2060, 0x0804, 0xa693, 0x9006, 0x012e, 0x000e,
-	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
-	0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6,
-	0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x19e7, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa791,
-	0x6020, 0x9086, 0x0006, 0x1904, 0xa78c, 0x87ff, 0x0128, 0x2700,
-	0x9c06, 0x1904, 0xa78c, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff,
-	0x0118, 0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168, 0x0036,
-	0x2019, 0x0001, 0x080c, 0xa59c, 0x7033, 0x0000, 0x9006, 0x703e,
-	0x7042, 0x7046, 0x704a, 0x003e, 0x7038, 0x9c36, 0x1110, 0x660c,
-	0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
-	0x080c, 0xcb19, 0x0110, 0x080c, 0xe530, 0x080c, 0xae78, 0x87ff,
-	0x1198, 0x00ce, 0x0804, 0xa73d, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0xa73d, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd,
-	0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e7, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x2c10, 0x7638, 0x2660,
-	0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7038, 0x9c36,
-	0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x2c00,
-	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085,
-	0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e,
-	0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19e7, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904,
-	0xa87e, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904,
-	0xa879, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x0904, 0xa855, 0x080c, 0xa259, 0x68c3, 0x0000, 0x080c, 0xa7a2,
-	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000,
-	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x080c, 0xcd10, 0x1158, 0x080c, 0x31e1, 0x080c,
-	0xcd21, 0x11f0, 0x080c, 0xb7f9, 0x00d8, 0x080c, 0xa7a2, 0x08c0,
-	0x080c, 0xcd21, 0x1118, 0x080c, 0xb7f9, 0x0090, 0x6014, 0x2048,
-	0x080c, 0xcb19, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c6d, 0x080c, 0xcd04,
-	0x080c, 0xcf88, 0x080c, 0xae78, 0x080c, 0xa678, 0x00ce, 0x0804,
-	0xa7fe, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa7fe, 0x012e, 0x000e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005,
-	0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xe530, 0x0c08, 0x00d6,
-	0x080c, 0x9c82, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014,
-	0x20e1, 0x0001, 0x2099, 0x1989, 0x20e9, 0x0000, 0x20a1, 0x0250,
-	0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c,
-	0xa22d, 0x00de, 0x0005, 0x080c, 0x9c82, 0x700b, 0x0800, 0x7814,
-	0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c,
-	0x7026, 0x7858, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7858,
-	0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0xa22d, 0x00b6,
-	0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xd18e,
-	0x00de, 0x1904, 0xa92c, 0x080c, 0x9c37, 0x7003, 0x1300, 0x782c,
-	0x080c, 0xaa2e, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810,
-	0x2058, 0xbaa0, 0x080c, 0xadb1, 0x11d8, 0x9286, 0x007e, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180,
-	0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400,
-	0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0,
-	0x6098, 0x700e, 0x00a8, 0x080c, 0xadb1, 0x1130, 0x7810, 0x2058,
-	0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181f, 0x2d04,
-	0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e,
-	0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de,
-	0x080c, 0xa22d, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006,
-	0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c,
-	0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0xa9a6, 0x9186,
-	0x0005, 0x0904, 0xa98f, 0x9186, 0x0004, 0x05d8, 0x9186, 0x0008,
-	0x0904, 0xa997, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700,
-	0x080c, 0xaa0b, 0x0005, 0x080c, 0xa9cc, 0x00d6, 0x0026, 0x792c,
-	0x2168, 0x2009, 0x4000, 0x6800, 0x0002, 0xa970, 0xa97b, 0xa972,
-	0xa97b, 0xa977, 0xa970, 0xa970, 0xa97b, 0xa97b, 0xa97b, 0xa97b,
-	0xa970, 0xa970, 0xa970, 0xa970, 0xa970, 0xa97b, 0xa970, 0xa97b,
-	0x080c, 0x0dd5, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e,
-	0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804,
-	0xa9c5, 0x080c, 0xa9cc, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
-	0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04b0, 0x04e1,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0470, 0x04a1,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
-	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x00f8, 0x0429, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
-	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
-	0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004,
-	0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018,
-	0x002e, 0x00de, 0x0804, 0xa22d, 0x00b6, 0x0036, 0x0046, 0x0056,
-	0x0066, 0x080c, 0x9c82, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a,
-	0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0xadb1, 0x1118,
-	0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181f, 0x2d2c, 0x8d68,
-	0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028,
-	0x901e, 0x6498, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008,
-	0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e,
-	0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e,
-	0x003e, 0x00be, 0x0005, 0x080c, 0x9c82, 0x7003, 0x0100, 0x782c,
-	0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa22d,
-	0x080c, 0x9c2e, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c,
-	0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff,
-	0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0xa22d, 0x00e6, 0x2071,
-	0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8cc,
-	0xd084, 0x0120, 0x7848, 0x702a, 0x7844, 0x702e, 0x00be, 0x00fe,
-	0x000e, 0x00ee, 0x0005, 0x080c, 0x9c79, 0x7003, 0x0100, 0x782c,
-	0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa22d, 0x0021,
-	0x60c3, 0x0000, 0x0804, 0xa22d, 0x00d6, 0x080c, 0xab07, 0xb810,
-	0x9085, 0x0300, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c,
-	0x700a, 0x6880, 0x700e, 0x7013, 0x0819, 0x080c, 0xa21b, 0x721a,
-	0x2f10, 0x7222, 0x7a08, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005,
-	0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026,
-	0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
-	0x002e, 0x080c, 0xa250, 0x080c, 0x8547, 0x0005, 0x0036, 0x0096,
-	0x00d6, 0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294,
-	0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194,
-	0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384,
-	0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6,
-	0x2069, 0x0200, 0x080c, 0xab07, 0x00de, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
-	0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286,
-	0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e,
-	0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0,
-	0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180,
-	0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140,
-	0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x19b2, 0x210c,
-	0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036,
-	0x6116, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088,
-	0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d,
-	0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009,
-	0x0008, 0x6912, 0x0005, 0x080c, 0x9c37, 0x0016, 0x0026, 0x0096,
-	0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x2001, 0x1837, 0x2004,
-	0x9084, 0x0028, 0x1138, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa,
-	0x1904, 0xabac, 0x7003, 0x5400, 0x00c6, 0x2061, 0x1800, 0x607c,
-	0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105, 0x700a,
-	0x6080, 0x700e, 0xa998, 0x918c, 0xff00, 0x7112, 0x20a9, 0x0004,
-	0x2009, 0x1805, 0x2e10, 0x9290, 0x0006, 0x2104, 0x2012, 0x8108,
-	0x8210, 0x1f04, 0xab3d, 0x20a9, 0x0004, 0x2009, 0x1801, 0x2104,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0xab47, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x0029, 0x2098, 0x2009, 0x0006, 0x20a9, 0x0001, 0x4002,
-	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00d6, 0x2069, 0x0200,
-	0x080c, 0xaaf2, 0x00de, 0x2071, 0x0240, 0x2011, 0x0240, 0x2009,
-	0x0002, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
-	0x1dc0, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
-	0x8210, 0x8109, 0x1dc0, 0xa85c, 0x9080, 0x0031, 0x2098, 0x2009,
-	0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
-	0x1dc0, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575,
-	0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1168, 0x080c, 0x73b0,
-	0x0150, 0x6028, 0xc0bd, 0x602a, 0x6014, 0x9084, 0x1804, 0x9085,
-	0x0029, 0x6016, 0x0010, 0x080c, 0xa22d, 0x080c, 0x8547, 0x00de,
-	0x009e, 0x002e, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0240, 0x2001,
-	0x2200, 0x9085, 0x00ff, 0x7002, 0x7007, 0xffff, 0x2071, 0x0100,
-	0x709b, 0x00ff, 0x00ee, 0x0804, 0xab22, 0x080c, 0x9c37, 0x0016,
-	0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x7003,
-	0x5500, 0x00c6, 0xa89c, 0x9084, 0x00ff, 0xa998, 0x810f, 0x918c,
-	0xff00, 0x9105, 0x700a, 0xa99c, 0x918c, 0xff00, 0xa8a0, 0x9084,
-	0x00ff, 0x9105, 0x700e, 0xa998, 0x918c, 0xff00, 0x2061, 0x1800,
-	0x607c, 0x9084, 0x00ff, 0x910d, 0x7112, 0x6180, 0x7116, 0x2009,
-	0x0008, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098, 0x2e10,
-	0x9290, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
-	0x8109, 0x1dc0, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2104, 0x2012,
-	0x8108, 0x8210, 0x1f04, 0xabfe, 0x20a9, 0x0002, 0x2009, 0x1801,
-	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac08, 0x00d6, 0x0016,
-	0x2069, 0x0200, 0x080c, 0xaaf2, 0x001e, 0x00de, 0x2071, 0x0240,
-	0x20a9, 0x0002, 0x2009, 0x1803, 0x2011, 0x0240, 0x2104, 0x2012,
-	0x8108, 0x8210, 0x1f04, 0xac1e, 0x2009, 0x0008, 0x4002, 0x8007,
-	0x2012, 0x8210, 0x8109, 0x1dd0, 0x9006, 0x20a9, 0x0008, 0x2012,
-	0x8210, 0x1f04, 0xac2f, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056,
-	0x60a7, 0x9575, 0x080c, 0xa22d, 0x080c, 0x8547, 0x00de, 0x009e,
-	0x002e, 0x001e, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9,
-	0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0,
-	0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1,
-	0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812,
-	0x0c60, 0x00de, 0x0005, 0x00d6, 0x0096, 0x6014, 0x2048, 0xa878,
-	0x6056, 0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946, 0xa84a, 0x6023,
-	0x0003, 0x6007, 0x0040, 0x6003, 0x0003, 0x600b, 0xffff, 0xa817,
-	0x0001, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813, 0x208e, 0x080c,
-	0x912c, 0x0126, 0x2091, 0x8000, 0x080c, 0x9790, 0x012e, 0x009e,
-	0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096,
-	0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x760c, 0x2660,
-	0x2678, 0x8cff, 0x0904, 0xad11, 0x7024, 0x9c06, 0x1520, 0x2069,
-	0x0100, 0x68c0, 0x9005, 0x0904, 0xace8, 0x080c, 0xa259, 0x68c3,
-	0x0000, 0x080c, 0xa7a2, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
-	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef,
-	0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
-	0x6827, 0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e,
-	0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a,
-	0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xcd10, 0x1158,
-	0x080c, 0x31e1, 0x080c, 0xcd21, 0x11f0, 0x080c, 0xb7f9, 0x00d8,
-	0x080c, 0xa7a2, 0x08c0, 0x080c, 0xcd21, 0x1118, 0x080c, 0xb7f9,
-	0x0090, 0x6014, 0x2048, 0x080c, 0xcb19, 0x0168, 0x6020, 0x9086,
-	0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x6c79, 0x080c, 0xcd04, 0x080c, 0xcf88, 0x080c, 0xae78, 0x080c,
-	0xa678, 0x00ce, 0x0804, 0xac99, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0xac99, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e,
-	0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1d08, 0x080c, 0xe530, 0x08f0, 0x00d6, 0x0156, 0x080c,
-	0x9c82, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003,
-	0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069,
-	0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060,
-	0x080c, 0x73b0, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6adc, 0xd29c,
-	0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x080c, 0x85b0, 0x20a9,
-	0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071, 0x0250, 0x2305,
-	0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290,
-	0x0002, 0x1f04, 0xad57, 0x60c3, 0x0020, 0x080c, 0xa22d, 0x015e,
-	0x00de, 0x0005, 0x0156, 0x080c, 0x9c82, 0x7a14, 0x82ff, 0x0168,
-	0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100,
-	0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007,
-	0x001c, 0x700f, 0x0001, 0x2011, 0x19bd, 0x2204, 0x8007, 0x701a,
-	0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082,
-	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7022, 0x2001, 0x1820,
-	0x2004, 0x7026, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
-	0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804,
-	0xa22d, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x000e, 0x0005,
-	0x2011, 0x0003, 0x080c, 0xa639, 0x2011, 0x0002, 0x080c, 0xa643,
-	0x080c, 0xa526, 0x0036, 0x901e, 0x080c, 0xa59c, 0x003e, 0x0005,
-	0x080c, 0x3317, 0x0188, 0x0016, 0x00b6, 0x00c6, 0x7010, 0x9085,
-	0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x6600, 0xb85c, 0xc0ac,
-	0xb85e, 0x00ce, 0x00be, 0x001e, 0x0005, 0x2071, 0x188d, 0x7000,
-	0x9005, 0x0140, 0x2001, 0x0976, 0x2071, 0x1800, 0x7076, 0x707a,
-	0x706b, 0xffe0, 0x2071, 0x1800, 0x7074, 0x7056, 0x705b, 0x1cd0,
-	0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554,
-	0x9582, 0x0010, 0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000,
-	0x0148, 0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061,
-	0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x0018,
-	0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee,
-	0x0005, 0x705b, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071,
-	0x1800, 0x7554, 0x9582, 0x0010, 0x0600, 0x7058, 0x2060, 0x6000,
+	0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010,
+	0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xcd2a, 0x1158, 0x080c,
+	0x31e8, 0x080c, 0xcd3b, 0x11f0, 0x080c, 0xb813, 0x00d8, 0x080c,
+	0xa7bc, 0x08c0, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813, 0x0090,
+	0x6014, 0x2048, 0x080c, 0xcb33, 0x0168, 0x6020, 0x9086, 0x0003,
+	0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c75,
+	0x080c, 0xcd1e, 0x080c, 0xcfa2, 0x080c, 0xae92, 0x080c, 0xa692,
+	0x00ce, 0x0804, 0xa818, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa818,
+	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xe551,
+	0x0c08, 0x00d6, 0x080c, 0x9cab, 0x7003, 0x0200, 0x7007, 0x0014,
+	0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1989, 0x20e9, 0x0000,
+	0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027,
+	0x7878, 0x080c, 0xa247, 0x00de, 0x0005, 0x080c, 0x9cab, 0x700b,
+	0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff,
+	0x7022, 0x782c, 0x7026, 0x7858, 0x9084, 0x00ff, 0x9085, 0x0200,
+	0x7002, 0x7858, 0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804,
+	0xa247, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035,
+	0x080c, 0xd1a8, 0x00de, 0x1904, 0xa946, 0x080c, 0x9c60, 0x7003,
+	0x1300, 0x782c, 0x080c, 0xaa48, 0x2068, 0x6820, 0x9086, 0x0003,
+	0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0xadcb, 0x11d8, 0x9286,
+	0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286,
+	0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284,
+	0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f,
+	0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814,
+	0x700e, 0x00c0, 0x6098, 0x700e, 0x00a8, 0x080c, 0xadcb, 0x1130,
+	0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069,
+	0x181f, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010,
+	0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c,
+	0x001e, 0x00de, 0x080c, 0xa247, 0x00be, 0x0005, 0x781b, 0x0001,
+	0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180,
+	0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904,
+	0xa9c0, 0x9186, 0x0005, 0x0904, 0xa9a9, 0x9186, 0x0004, 0x05d8,
+	0x9186, 0x0008, 0x0904, 0xa9b1, 0x7807, 0x0037, 0x782f, 0x0003,
+	0x7817, 0x1700, 0x080c, 0xaa25, 0x0005, 0x080c, 0xa9e6, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800, 0x0002, 0xa98a,
+	0xa995, 0xa98c, 0xa995, 0xa991, 0xa98a, 0xa98a, 0xa995, 0xa995,
+	0xa995, 0xa995, 0xa98a, 0xa98a, 0xa98a, 0xa98a, 0xa98a, 0xa995,
+	0xa98a, 0xa995, 0x080c, 0x0dd5, 0x6824, 0xd0e4, 0x0110, 0xd0cc,
+	0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830,
+	0x7026, 0x0804, 0xa9df, 0x080c, 0xa9e6, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e,
+	0x04b0, 0x04e1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x0470, 0x04a1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x00f8,
+	0x0429, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048,
+	0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022,
+	0x7226, 0x792c, 0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130,
+	0x908e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a,
+	0x60c3, 0x0018, 0x002e, 0x00de, 0x0804, 0xa247, 0x00b6, 0x0036,
+	0x0046, 0x0056, 0x0066, 0x080c, 0x9cab, 0x9006, 0x7003, 0x0200,
+	0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c,
+	0xadcb, 0x1118, 0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181f,
+	0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14,
+	0x00de, 0x0028, 0x901e, 0x6498, 0x2029, 0x0000, 0x6634, 0x782c,
+	0x9080, 0x0008, 0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616,
+	0x731a, 0x741e, 0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e,
+	0x005e, 0x004e, 0x003e, 0x00be, 0x0005, 0x080c, 0x9cab, 0x7003,
+	0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0xa247, 0x080c, 0x9c57, 0x7003, 0x1400, 0x7838, 0x700a,
+	0x0079, 0x783c, 0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834,
+	0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0xa247,
+	0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6,
+	0x2058, 0xb8cc, 0xd084, 0x0120, 0x7848, 0x702a, 0x7844, 0x702e,
+	0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c, 0x9ca2, 0x7003,
+	0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0xa247, 0x0021, 0x60c3, 0x0000, 0x0804, 0xa247, 0x00d6, 0x080c,
+	0xab21, 0xb810, 0x9085, 0x0300, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0819, 0x080c,
+	0xa235, 0x721a, 0x2f10, 0x7222, 0x7a08, 0x7226, 0x2071, 0x024c,
+	0x00de, 0x0005, 0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7,
+	0x9575, 0x0026, 0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101, 0x2204,
+	0xc0c5, 0x2012, 0x002e, 0x080c, 0xa26a, 0x080c, 0x8570, 0x0005,
+	0x0036, 0x0096, 0x00d6, 0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296,
+	0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82,
+	0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200,
+	0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a,
+	0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0xab21, 0x00de, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294,
+	0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de,
+	0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c,
+	0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004,
+	0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8,
+	0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009,
+	0x19b2, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096,
+	0x60ab, 0x0036, 0x6116, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009,
+	0x000a, 0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058,
+	0x2009, 0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f,
+	0x0010, 0x2009, 0x0008, 0x6912, 0x0005, 0x080c, 0x9c60, 0x0016,
+	0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x2001,
+	0x1837, 0x2004, 0x9084, 0x0028, 0x1138, 0x2001, 0x197c, 0x2004,
+	0x9086, 0xaaaa, 0x1904, 0xabc6, 0x7003, 0x5400, 0x00c6, 0x2061,
+	0x1800, 0x607c, 0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00,
+	0x9105, 0x700a, 0x6080, 0x700e, 0xa998, 0x918c, 0xff00, 0x7112,
+	0x20a9, 0x0004, 0x2009, 0x1805, 0x2e10, 0x9290, 0x0006, 0x2104,
+	0x2012, 0x8108, 0x8210, 0x1f04, 0xab57, 0x20a9, 0x0004, 0x2009,
+	0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xab61, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098, 0x2009, 0x0006, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00d6,
+	0x2069, 0x0200, 0x080c, 0xab0c, 0x00de, 0x2071, 0x0240, 0x2011,
+	0x0240, 0x2009, 0x0002, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
+	0x8210, 0x8109, 0x1dc0, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002,
+	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0xa85c, 0x9080, 0x0031,
+	0x2098, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
+	0x8210, 0x8109, 0x1dc0, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056,
+	0x60a7, 0x9575, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1168,
+	0x080c, 0x73bc, 0x0150, 0x6028, 0xc0bd, 0x602a, 0x6014, 0x9084,
+	0x1804, 0x9085, 0x0029, 0x6016, 0x0010, 0x080c, 0xa247, 0x080c,
+	0x8570, 0x00de, 0x009e, 0x002e, 0x001e, 0x0005, 0x00e6, 0x2071,
+	0x0240, 0x2001, 0x2200, 0x9085, 0x00ff, 0x7002, 0x7007, 0xffff,
+	0x2071, 0x0100, 0x709b, 0x00ff, 0x00ee, 0x0804, 0xab3c, 0x080c,
+	0x9c60, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013,
+	0x0138, 0x7003, 0x5500, 0x00c6, 0xa89c, 0x9084, 0x00ff, 0xa998,
+	0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0xa99c, 0x918c, 0xff00,
+	0xa8a0, 0x9084, 0x00ff, 0x9105, 0x700e, 0xa998, 0x918c, 0xff00,
+	0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0x910d, 0x7112, 0x6180,
+	0x7116, 0x2009, 0x0008, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029,
+	0x2098, 0x2e10, 0x9290, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007,
+	0x2012, 0x8210, 0x8109, 0x1dc0, 0x20a9, 0x0004, 0x2009, 0x1805,
+	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac18, 0x20a9, 0x0002,
+	0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac22,
+	0x00d6, 0x0016, 0x2069, 0x0200, 0x080c, 0xab0c, 0x001e, 0x00de,
+	0x2071, 0x0240, 0x20a9, 0x0002, 0x2009, 0x1803, 0x2011, 0x0240,
+	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac38, 0x2009, 0x0008,
+	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dd0, 0x9006, 0x20a9,
+	0x0008, 0x2012, 0x8210, 0x1f04, 0xac49, 0x00ce, 0x60c3, 0x004c,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa247, 0x080c, 0x8570,
+	0x00de, 0x009e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x9290, 0x0018,
+	0x8214, 0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8,
+	0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008,
+	0x9016, 0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810,
+	0x8000, 0x6812, 0x0c60, 0x00de, 0x0005, 0x00d6, 0x0096, 0x6014,
+	0x2048, 0xa878, 0x6056, 0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946,
+	0xa84a, 0x6023, 0x0003, 0x6007, 0x0040, 0x6003, 0x0003, 0x600b,
+	0xffff, 0xa817, 0x0001, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813,
+	0x208e, 0x080c, 0x9155, 0x0126, 0x2091, 0x8000, 0x080c, 0x97b9,
+	0x012e, 0x009e, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
+	0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0xad2b, 0x7024, 0x9c06,
+	0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xad02, 0x080c,
+	0xa273, 0x68c3, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c, 0x9c36, 0x1110,
+	0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
+	0xcd2a, 0x1158, 0x080c, 0x31e8, 0x080c, 0xcd3b, 0x11f0, 0x080c,
+	0xb813, 0x00d8, 0x080c, 0xa7bc, 0x08c0, 0x080c, 0xcd3b, 0x1118,
+	0x080c, 0xb813, 0x0090, 0x6014, 0x2048, 0x080c, 0xcb33, 0x0168,
+	0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x080c, 0xcfa2, 0x080c,
+	0xae92, 0x080c, 0xa692, 0x00ce, 0x0804, 0xacb3, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0xacb3, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e,
+	0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe551, 0x08f0, 0x00d6,
+	0x0156, 0x080c, 0x9cab, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007,
+	0x0000, 0x2069, 0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110,
+	0xc38d, 0x0060, 0x080c, 0x73bc, 0x1110, 0xc3ad, 0x0008, 0xc3a5,
+	0x6adc, 0xd29c, 0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x080c,
+	0x85d9, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071,
+	0x0250, 0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398,
+	0x0002, 0x9290, 0x0002, 0x1f04, 0xad71, 0x60c3, 0x0020, 0x080c,
+	0xa247, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x9cab, 0x7a14,
+	0x82ff, 0x0168, 0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238,
+	0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003,
+	0x0200, 0x7007, 0x001c, 0x700f, 0x0001, 0x2011, 0x19bd, 0x2204,
+	0x8007, 0x701a, 0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120,
+	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7022,
+	0x2001, 0x1820, 0x2004, 0x7026, 0x0030, 0x2001, 0x1818, 0x2004,
+	0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
+	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c,
+	0x015e, 0x0804, 0xa247, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac,
+	0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0xa653, 0x2011, 0x0002,
+	0x080c, 0xa65d, 0x080c, 0xa540, 0x0036, 0x901e, 0x080c, 0xa5b6,
+	0x003e, 0x0005, 0x080c, 0x331e, 0x0188, 0x0016, 0x00b6, 0x00c6,
+	0x7010, 0x9085, 0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x65ff,
+	0xb85c, 0xc0ac, 0xb85e, 0x00ce, 0x00be, 0x001e, 0x0005, 0x2071,
+	0x188d, 0x7000, 0x9005, 0x0140, 0x2001, 0x0976, 0x2071, 0x1800,
+	0x7076, 0x707a, 0x706b, 0xffe0, 0x2071, 0x1800, 0x7074, 0x7056,
+	0x705b, 0x1cd0, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091,
+	0x8000, 0x7554, 0x9582, 0x0010, 0x0608, 0x7058, 0x2060, 0x6000,
 	0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1208,
 	0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556,
-	0x9ca8, 0x0018, 0x7068, 0x9502, 0x1228, 0x755a, 0x9085, 0x0001,
-	0x00ee, 0x0005, 0x705b, 0x1cd0, 0x0cc8, 0x9006, 0x0cc8, 0x9c82,
-	0x1cd0, 0x0a0c, 0x0dd5, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a0c,
-	0x0dd5, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012,
-	0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x6056, 0x605a, 0x6026,
-	0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x6042, 0x602a,
-	0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x9086, 0x0001, 0x0108,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x9664, 0x012e, 0x0cc0,
-	0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c, 0xd084, 0x190c,
-	0x1a5e, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001, 0x1986, 0x2004,
-	0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c,
-	0xe7ea, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6, 0x0126, 0x2071,
-	0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0001, 0x0608, 0x7058,
+	0x9ca8, 0x0018, 0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001,
+	0x012e, 0x00ee, 0x0005, 0x705b, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0,
+	0x00e6, 0x2071, 0x1800, 0x7554, 0x9582, 0x0010, 0x0600, 0x7058,
 	0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7068,
 	0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008,
-	0x8529, 0x7556, 0x9ca8, 0x0018, 0x7068, 0x9502, 0x1230, 0x755a,
-	0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b, 0x1cd0, 0x0cc0,
-	0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002, 0xaed5, 0xaede,
-	0xaef9, 0xaf14, 0xd23c, 0xd259, 0xd274, 0xaed5, 0xaede, 0x8d62,
-	0xaf30, 0xaed5, 0xaed5, 0xaed5, 0xaed5, 0x9186, 0x0013, 0x1128,
-	0x080c, 0x955f, 0x080c, 0x9664, 0x0005, 0x0005, 0x0066, 0x6000,
-	0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x0013, 0x006e, 0x0005, 0xaef7,
-	0xb665, 0xb840, 0xaef7, 0xb8d6, 0xb213, 0xaef7, 0xaef7, 0xb5e7,
-	0xbe3b, 0xaef7, 0xaef7, 0xaef7, 0xaef7, 0xaef7, 0xaef7, 0x080c,
-	0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x0013,
-	0x006e, 0x0005, 0xaf12, 0xc50f, 0xaf12, 0xaf12, 0xaf12, 0xaf12,
-	0xaf12, 0xaf12, 0xc4b4, 0xc691, 0xaf12, 0xc550, 0xc5cf, 0xc550,
-	0xc5cf, 0xaf12, 0x080c, 0x0dd5, 0x6000, 0x9082, 0x0016, 0x1a0c,
-	0x0dd5, 0x6000, 0x0002, 0xaf2e, 0xbe82, 0xbf67, 0xc097, 0xc242,
-	0xaf2e, 0xaf2e, 0xaf2e, 0xbe56, 0xc440, 0xc443, 0xaf2e, 0xaf2e,
-	0xaf2e, 0xaf2e, 0xc472, 0xaf2e, 0xaf2e, 0xaf2e, 0x080c, 0x0dd5,
+	0x8529, 0x7556, 0x9ca8, 0x0018, 0x7068, 0x9502, 0x1228, 0x755a,
+	0x9085, 0x0001, 0x00ee, 0x0005, 0x705b, 0x1cd0, 0x0cc8, 0x9006,
+	0x0cc8, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1a0c, 0x0dd5, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016,
+	0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x6056,
+	0x605a, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e,
+	0x6042, 0x602a, 0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x9086,
+	0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d,
+	0x012e, 0x0cc0, 0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c,
+	0xd084, 0x190c, 0x1a5e, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001,
+	0x1986, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
+	0x601a, 0x080c, 0xe80b, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6,
+	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0001,
+	0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
+	0x0018, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x0018, 0x7068, 0x9502,
+	0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b,
+	0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002,
+	0xaeef, 0xaef8, 0xaf13, 0xaf2e, 0xd256, 0xd273, 0xd28e, 0xaeef,
+	0xaef8, 0x8d8b, 0xaf4a, 0xaeef, 0xaeef, 0xaeef, 0xaeef, 0x9186,
+	0x0013, 0x1128, 0x080c, 0x9588, 0x080c, 0x968d, 0x0005, 0x0005,
 	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x0013, 0x006e,
-	0x0005, 0xaf49, 0xaf49, 0xaf8c, 0xb02b, 0xb0c0, 0xaf49, 0xaf49,
-	0xaf49, 0xaf4b, 0xaf49, 0xaf49, 0xaf49, 0xaf49, 0xaf49, 0xaf49,
-	0xaf49, 0x080c, 0x0dd5, 0x9186, 0x004c, 0x0588, 0x9186, 0x0003,
-	0x190c, 0x0dd5, 0x0096, 0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003,
-	0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e,
-	0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0x9006, 0xa836, 0xa83a, 0xa884,
-	0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213,
-	0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1bad, 0x080c, 0x912c,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9790, 0x012e, 0x0005, 0x6010,
-	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0xb0e2, 0x080c,
-	0xd22e, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079,
-	0x1800, 0x7a90, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290,
-	0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc,
-	0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010, 0x0028, 0xa87b,
-	0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883, 0x0000, 0xaa02,
-	0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400,
-	0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118, 0x2001,
-	0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001, 0x0001,
-	0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0xaff3, 0xaff3,
-	0xafee, 0xaff1, 0xaff3, 0xafeb, 0xafde, 0xafde, 0xafde, 0xafde,
-	0xafde, 0xafde, 0xafde, 0xafde, 0xafde, 0xafde, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e,
-	0x00de, 0x080c, 0x0dd5, 0x080c, 0xba93, 0x0028, 0x080c, 0xbb78,
-	0x0010, 0x080c, 0xbc6e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e,
-	0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xb1a0, 0x0530, 0xa804,
-	0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0,
-	0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x125d, 0x080c, 0xb360,
-	0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005,
-	0x00fe, 0x009e, 0x00de, 0x0804, 0xae47, 0x2001, 0x002c, 0x900e,
-	0x080c, 0xb206, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016,
-	0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0dd5, 0x91b2, 0x0050, 0x1a0c,
-	0x0dd5, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109, 0x2004, 0xd08c,
-	0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c,
-	0x9079, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000, 0x9086,
-	0x0002, 0x1110, 0x0804, 0xaf8c, 0x0005, 0xb05e, 0xb05e, 0xb060,
-	0xb096, 0xb05e, 0xb05e, 0xb05e, 0xb05e, 0xb0a9, 0x080c, 0x0dd5,
-	0x00d6, 0x0016, 0x0096, 0x080c, 0x9614, 0x080c, 0x9790, 0x6003,
-	0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0, 0xa878, 0xc0fc,
-	0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001, 0x0000, 0x900e,
-	0x080c, 0xb206, 0x080c, 0xae47, 0x00a8, 0x6003, 0x0002, 0xa8a4,
-	0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78, 0xa87f, 0x0020,
-	0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2, 0xa8c7, 0x0000,
-	0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005, 0x080c, 0x9614,
-	0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb1b, 0x0120, 0xa87b,
-	0x0006, 0x080c, 0x6c79, 0x009e, 0x00de, 0x080c, 0xae47, 0x0804,
-	0x9790, 0x080c, 0x9614, 0x080c, 0x31bc, 0x080c, 0xd22b, 0x00d6,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xcb1b, 0x0120, 0xa87b, 0x0029,
-	0x080c, 0x6c79, 0x009e, 0x00de, 0x080c, 0xae47, 0x0804, 0x9790,
-	0x9182, 0x0047, 0x0002, 0xb0d0, 0xb0d2, 0xb0d0, 0xb0d0, 0xb0d0,
-	0xb0d0, 0xb0d0, 0xb0d0, 0xb0d0, 0xb0d0, 0xb0d0, 0xb0d0, 0xb0d2,
-	0x080c, 0x0dd5, 0x00d6, 0x0096, 0x601f, 0x0000, 0x6114, 0x2148,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6c79, 0x009e, 0x00de,
-	0x0804, 0xae47, 0x0026, 0x0036, 0x0056, 0x0066, 0x0096, 0x00a6,
-	0x00f6, 0x0006, 0x080c, 0x0fff, 0x000e, 0x090c, 0x0dd5, 0xa960,
-	0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020,
-	0x4104, 0xa87a, 0x2079, 0x1800, 0x7990, 0x9188, 0x0018, 0x918c,
-	0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034, 0x1228, 0x2011,
-	0x001f, 0x080c, 0xc716, 0x04c0, 0x2130, 0x2009, 0x0034, 0x2011,
-	0x001f, 0x080c, 0xc716, 0x96b2, 0x0034, 0xb004, 0x904d, 0x0110,
-	0x080c, 0x0fb1, 0x080c, 0x0fff, 0x01d0, 0x8528, 0xa867, 0x0110,
-	0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1230, 0x2608,
-	0x2011, 0x001b, 0x080c, 0xc716, 0x00b8, 0x96b2, 0x003c, 0x2009,
-	0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc716, 0x0c18, 0x2001,
-	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566,
-	0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000,
-	0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48, 0xa804, 0xa807,
-	0x0000, 0x0006, 0x080c, 0x6c79, 0x000e, 0x2048, 0x9005, 0x1db0,
-	0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e, 0x002e, 0x0005,
-	0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0fff, 0x000e, 0x090c,
-	0x0dd5, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
-	0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079, 0x1800, 0x7990,
-	0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210, 0x2009, 0x001a,
-	0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c, 0x9080, 0x001f,
-	0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x4003,
-	0x2003, 0x0000, 0x080c, 0x6c79, 0x009e, 0x00fe, 0x00de, 0x0005,
-	0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001, 0x0205, 0x200c,
-	0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200, 0x2e98, 0xa87c,
-	0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021, 0x003e, 0x901e,
-	0x9282, 0x0020, 0x0218, 0x2011, 0x0020, 0x2018, 0x9486, 0x003e,
-	0x1170, 0x0096, 0x080c, 0x0fff, 0x2900, 0x009e, 0x05c0, 0xa806,
-	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x3300,
-	0x908e, 0x0260, 0x0140, 0x2009, 0x0280, 0x9102, 0x920a, 0x0218,
-	0x2010, 0x2100, 0x9318, 0x2200, 0x9402, 0x1228, 0x2400, 0x9202,
-	0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800, 0x9200, 0xa802,
-	0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300, 0x9086, 0x0280,
-	0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x2e98, 0x2310,
-	0x84ff, 0x0904, 0xb1b5, 0x0804, 0xb1b7, 0x9085, 0x0001, 0x7817,
-	0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005, 0x00d6, 0x0036,
-	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c, 0x6c6d, 0x009e,
-	0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118, 0x080c, 0xae47,
-	0x0030, 0x91b6, 0x0016, 0x190c, 0x0dd5, 0x080c, 0xae47, 0x0005,
-	0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014, 0x0096, 0x2048,
-	0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003, 0x0136, 0x9080,
-	0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418, 0x8318, 0x23a0,
-	0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8, 0x2011, 0x0006,
-	0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003, 0x3418, 0x8318,
-	0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xcb1b, 0x0130, 0x6014,
-	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e, 0x0804, 0xae47,
-	0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200, 0x11a8, 0x6010,
-	0x00b6, 0x2058, 0xb8cf, 0x0000, 0x00be, 0x6014, 0x9005, 0x0130,
-	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32, 0x080c, 0xae47,
-	0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48, 0x0cc8, 0x0006,
-	0x0016, 0x080c, 0xd216, 0x0188, 0x6014, 0x9005, 0x1170, 0x600b,
-	0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009, 0x0022, 0x080c,
-	0xb63d, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085, 0x0001, 0x0cd0,
-	0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c, 0x20e1, 0x0000,
-	0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
-	0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001, 0x2099, 0x0260,
-	0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804, 0x2048, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205,
-	0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020, 0x4003, 0x2003,
-	0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x080c,
-	0xae47, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016, 0x900e, 0x7030,
-	0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff, 0x800c, 0x703c,
-	0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108, 0x810b, 0x2011,
-	0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c, 0xc716, 0x080c,
-	0xcb1b, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000, 0xa864, 0xa8e2,
-	0xa867, 0x0103, 0x080c, 0xae47, 0x001e, 0x009e, 0x0005, 0x0016,
-	0x2009, 0x0000, 0x7030, 0x9086, 0x0200, 0x0110, 0x2009, 0x0001,
-	0x0096, 0x6014, 0x904d, 0x090c, 0x0dd5, 0xa97a, 0x080c, 0x6c79,
-	0x009e, 0x080c, 0xae47, 0x001e, 0x0005, 0x0016, 0x0096, 0x7030,
-	0x9086, 0x0100, 0x1118, 0x2009, 0x0004, 0x0010, 0x7034, 0x800c,
-	0x810b, 0x2011, 0x000c, 0x2019, 0x000c, 0x6014, 0x2048, 0xa804,
-	0x0096, 0x9005, 0x0108, 0x2048, 0x080c, 0xc716, 0x009e, 0x080c,
-	0xcb1b, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807, 0x0000, 0xa864,
-	0xa8e2, 0xa867, 0x0103, 0x080c, 0xae47, 0x009e, 0x001e, 0x0005,
-	0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100, 0x1118, 0x080c,
-	0xb7f9, 0x00e0, 0xa034, 0x8007, 0x800c, 0x8806, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
-	0x2031, 0x0000, 0x2041, 0x1243, 0x0019, 0x0d08, 0x008e, 0x0898,
-	0x0096, 0x0006, 0x080c, 0x0fff, 0x000e, 0x01b0, 0xa8ab, 0x0dcb,
-	0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a,
-	0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086, 0x2940, 0x080c,
-	0x10e9, 0x008e, 0x9085, 0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6,
-	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
-	0x00be, 0x9206, 0x1520, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14,
-	0x00be, 0x9206, 0x11e0, 0x6043, 0x0000, 0x2c68, 0x0016, 0x2009,
-	0x0035, 0x080c, 0xd18e, 0x001e, 0x1158, 0x622c, 0x2268, 0x2071,
-	0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386, 0x0006, 0x0128,
-	0x080c, 0xae47, 0x0020, 0x0039, 0x0010, 0x080c, 0xb472, 0x002e,
-	0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048, 0x9186, 0x0015,
-	0x0904, 0xb45a, 0x918e, 0x0016, 0x1904, 0xb470, 0x700c, 0x908c,
-	0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300, 0x1904, 0xb434,
-	0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904, 0xb417, 0x0804,
-	0xb46e, 0x6808, 0x9086, 0xffff, 0x1904, 0xb45c, 0xa87c, 0x9084,
-	0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940, 0x9105, 0x1904,
-	0xb45c, 0x6824, 0xd0b4, 0x1904, 0xb45c, 0x080c, 0xcd04, 0x685c,
-	0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e,
-	0x6a18, 0x2001, 0x000a, 0x080c, 0x8f3f, 0xa884, 0x920a, 0x0208,
-	0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c,
-	0xc840, 0x00ce, 0x0804, 0xb46e, 0x00c6, 0xa868, 0xd0fc, 0x1118,
-	0x080c, 0x60af, 0x0010, 0x080c, 0x64b5, 0x00ce, 0x1904, 0xb45c,
-	0x00c6, 0x2d60, 0x080c, 0xae47, 0x00ce, 0x0804, 0xb46e, 0x00c6,
-	0x080c, 0xae95, 0x0198, 0x6017, 0x0000, 0x6810, 0x6012, 0x080c,
-	0xcf90, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60, 0x080c, 0xae47,
-	0x00ce, 0x080c, 0xaec2, 0x00ce, 0x0804, 0xb46e, 0x2001, 0x1988,
-	0x2004, 0x6842, 0x00ce, 0x04d0, 0x7008, 0x9086, 0x000b, 0x11c8,
-	0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6,
-	0x2d60, 0xa87b, 0x0003, 0x080c, 0xd1d0, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x6023, 0x0002, 0x080c, 0x90c7, 0x080c, 0x9664, 0x00ce,
-	0x00e8, 0x700c, 0x9086, 0x2a00, 0x1138, 0x2001, 0x1988, 0x2004,
-	0x6842, 0x00a0, 0x0479, 0x00a0, 0x89ff, 0x090c, 0x0dd5, 0x00c6,
-	0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x6a95,
-	0x080c, 0xcd04, 0x080c, 0xae78, 0x00de, 0x00ce, 0x080c, 0xae47,
-	0x009e, 0x0005, 0x9186, 0x0015, 0x1128, 0x2001, 0x1988, 0x2004,
-	0x6842, 0x0068, 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060,
-	0x080c, 0xe7ea, 0x080c, 0x8689, 0x080c, 0xae47, 0x00ce, 0x080c,
-	0xae47, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0xacb0, 0xabac,
-	0xd2f4, 0x0130, 0x2001, 0x1988, 0x2004, 0x6842, 0x0804, 0xb4ec,
-	0x00c6, 0x2d60, 0x080c, 0xc741, 0x00ce, 0x6804, 0x9086, 0x0050,
-	0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050,
-	0x080c, 0x90c7, 0x080c, 0x9664, 0x00ce, 0x04f0, 0x6800, 0x9086,
-	0x000f, 0x01a8, 0x89ff, 0x090c, 0x0dd5, 0x6800, 0x9086, 0x0004,
-	0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff,
-	0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400, 0x2001,
-	0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8,
-	0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20,
-	0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d38,
-	0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c,
-	0xce87, 0x080c, 0x9664, 0x0010, 0x080c, 0xae47, 0x004e, 0x003e,
-	0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff,
-	0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904, 0xb557,
-	0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x1904,
-	0xb557, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286,
-	0x0007, 0x0904, 0xb557, 0x9286, 0x0002, 0x0904, 0xb557, 0x9286,
-	0x0000, 0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8, 0x2071, 0x026c,
-	0x9186, 0x0015, 0x0570, 0x918e, 0x0016, 0x1100, 0x00c6, 0x6038,
-	0x2060, 0x6104, 0x9186, 0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8,
-	0x9186, 0x004d, 0x0190, 0x9186, 0x004e, 0x0178, 0x9186, 0x0052,
-	0x0160, 0x6014, 0x0096, 0x2048, 0x080c, 0xcb1b, 0x090c, 0x0dd5,
-	0xa87b, 0x0003, 0x009e, 0x080c, 0xd1d0, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x6023, 0x0002, 0x080c, 0x90c7, 0x080c, 0x9664, 0x00ce,
-	0x0030, 0x6038, 0x2070, 0x2001, 0x1988, 0x2004, 0x7042, 0x080c,
-	0xae47, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6,
-	0x6014, 0x2048, 0x6010, 0x2058, 0x91b6, 0x0015, 0x0130, 0xba08,
-	0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096, 0x0156, 0x0036,
-	0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a, 0x20a9, 0x0004,
-	0x080c, 0xbe03, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904, 0xb5c6,
-	0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019,
-	0x0006, 0x20a9, 0x0004, 0x080c, 0xbe03, 0x002e, 0x003e, 0x015e,
-	0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d,
-	0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be, 0x0804,
-	0xb24b, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006,
+	0x0005, 0xaf11, 0xb67f, 0xb85a, 0xaf11, 0xb8f0, 0xb22d, 0xaf11,
+	0xaf11, 0xb601, 0xbe55, 0xaf11, 0xaf11, 0xaf11, 0xaf11, 0xaf11,
+	0xaf11, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0dd5, 0x0013, 0x006e, 0x0005, 0xaf2c, 0xc529, 0xaf2c, 0xaf2c,
+	0xaf2c, 0xaf2c, 0xaf2c, 0xaf2c, 0xc4ce, 0xc6ab, 0xaf2c, 0xc56a,
+	0xc5e9, 0xc56a, 0xc5e9, 0xaf2c, 0x080c, 0x0dd5, 0x6000, 0x9082,
+	0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x0002, 0xaf48, 0xbe9c, 0xbf81,
+	0xc0b1, 0xc25c, 0xaf48, 0xaf48, 0xaf48, 0xbe70, 0xc45a, 0xc45d,
+	0xaf48, 0xaf48, 0xaf48, 0xaf48, 0xc48c, 0xaf48, 0xaf48, 0xaf48,
+	0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5,
+	0x0013, 0x006e, 0x0005, 0xaf63, 0xaf63, 0xafa6, 0xb045, 0xb0da,
+	0xaf63, 0xaf63, 0xaf63, 0xaf65, 0xaf63, 0xaf63, 0xaf63, 0xaf63,
+	0xaf63, 0xaf63, 0xaf63, 0x080c, 0x0dd5, 0x9186, 0x004c, 0x0588,
+	0x9186, 0x0003, 0x190c, 0x0dd5, 0x0096, 0x601c, 0xc0ed, 0x601e,
+	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000,
+	0xc0b5, 0xa87e, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0x9006, 0xa836,
+	0xa83a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
+	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1bad,
+	0x080c, 0x9155, 0x0126, 0x2091, 0x8000, 0x080c, 0x97b9, 0x012e,
+	0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c,
+	0xb0fc, 0x080c, 0xd248, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
+	0x00f6, 0x2079, 0x1800, 0x7a90, 0x6014, 0x2048, 0xa87c, 0xd0ec,
+	0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005,
+	0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010,
+	0x0028, 0xa87b, 0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883,
+	0x0000, 0xaa02, 0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015,
+	0x1118, 0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118,
+	0x2001, 0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002,
+	0xb00d, 0xb00d, 0xb008, 0xb00b, 0xb00d, 0xb005, 0xaff8, 0xaff8,
+	0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e,
+	0x00fe, 0x009e, 0x00de, 0x080c, 0x0dd5, 0x080c, 0xbaad, 0x0028,
+	0x080c, 0xbb92, 0x0010, 0x080c, 0xbc88, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xb1ba,
+	0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006,
 	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
-	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
-	0x2041, 0x1243, 0x080c, 0xb360, 0x0130, 0x00fe, 0x009e, 0x080c,
-	0xae47, 0x00be, 0x0005, 0x080c, 0xb7f9, 0x0cb8, 0x2b78, 0x00f6,
-	0x080c, 0x31bc, 0x080c, 0xd22b, 0x00fe, 0x00c6, 0x080c, 0xadf1,
-	0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
-	0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x6550, 0x080c, 0x657c,
-	0x080c, 0x910f, 0x080c, 0x9664, 0x00ce, 0x0804, 0xb599, 0x2100,
-	0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b2, 0x0040, 0x1a04, 0xb64f,
-	0x0002, 0xb63d, 0xb63d, 0xb633, 0xb63d, 0xb63d, 0xb63d, 0xb631,
-	0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631,
-	0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631,
-	0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631,
-	0xb63d, 0xb631, 0xb63d, 0xb63d, 0xb631, 0xb631, 0xb631, 0xb631,
-	0xb631, 0xb633, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631,
-	0xb631, 0xb631, 0xb631, 0xb63d, 0xb63d, 0xb631, 0xb631, 0xb631,
-	0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb631, 0xb63d, 0xb631,
-	0xb631, 0x080c, 0x0dd5, 0x0066, 0x00b6, 0x6610, 0x2658, 0xb8cc,
-	0xc08c, 0xb8ce, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001, 0x6106,
-	0x9186, 0x0032, 0x0118, 0x080c, 0x910f, 0x0010, 0x080c, 0x90c7,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9664, 0x012e, 0x0005, 0x2600,
-	0x0002, 0xb63d, 0xb63d, 0xb663, 0xb63d, 0xb63d, 0xb663, 0xb663,
-	0xb663, 0xb663, 0xb63d, 0xb663, 0xb63d, 0xb663, 0xb63d, 0xb663,
-	0xb663, 0xb663, 0xb663, 0x080c, 0x0dd5, 0x6004, 0x90b2, 0x0053,
-	0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x0904, 0xb727, 0x91b6, 0x0027,
-	0x1904, 0xb6e2, 0x080c, 0x955f, 0x6004, 0x080c, 0xcd10, 0x01b0,
-	0x080c, 0xcd21, 0x01a8, 0x908e, 0x0021, 0x0904, 0xb6df, 0x908e,
-	0x0022, 0x1130, 0x080c, 0xb277, 0x0904, 0xb6db, 0x0804, 0xb6dc,
-	0x908e, 0x003d, 0x0904, 0xb6df, 0x0804, 0xb6d5, 0x080c, 0x31e1,
-	0x2001, 0x0007, 0x080c, 0x6550, 0x6010, 0x00b6, 0x2058, 0xb9a0,
-	0x00be, 0x080c, 0xb7f9, 0x9186, 0x007e, 0x1148, 0x2001, 0x1837,
-	0x2014, 0xc285, 0x080c, 0x73b0, 0x1108, 0xc2ad, 0x2202, 0x0036,
-	0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xe8f6, 0x002e, 0x003e,
-	0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x9262,
-	0x0076, 0x903e, 0x080c, 0x913f, 0x6010, 0x00b6, 0x905d, 0x0100,
-	0x00be, 0x2c08, 0x080c, 0xe2ca, 0x007e, 0x003e, 0x002e, 0x001e,
-	0x080c, 0xd22b, 0x0016, 0x080c, 0xcf88, 0x080c, 0xae47, 0x001e,
-	0x080c, 0x32b4, 0x080c, 0x9664, 0x0030, 0x080c, 0xcf88, 0x080c,
-	0xae47, 0x080c, 0x9664, 0x0005, 0x080c, 0xb7f9, 0x0cb0, 0x080c,
-	0xb835, 0x0c98, 0x9186, 0x0014, 0x1db0, 0x080c, 0x955f, 0x6004,
-	0x908e, 0x0022, 0x1118, 0x080c, 0xb277, 0x0d68, 0x080c, 0x31bc,
-	0x080c, 0xd22b, 0x080c, 0xcd10, 0x1190, 0x080c, 0x31e1, 0x6010,
-	0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb7f9, 0x9186, 0x007e,
-	0x1128, 0x2001, 0x1837, 0x200c, 0xc185, 0x2102, 0x0870, 0x080c,
-	0xcd21, 0x1118, 0x080c, 0xb7f9, 0x0840, 0x6004, 0x908e, 0x0032,
-	0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c,
-	0x354f, 0x00fe, 0x00ee, 0x0804, 0xb6d5, 0x6004, 0x908e, 0x0021,
-	0x0d48, 0x908e, 0x0022, 0x090c, 0xb7f9, 0x0804, 0xb6d5, 0x90b2,
-	0x0040, 0x1a04, 0xb7d5, 0x2008, 0x0002, 0xb76f, 0xb770, 0xb773,
-	0xb776, 0xb779, 0xb77c, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d,
-	0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d,
-	0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d,
-	0xb76d, 0xb76d, 0xb76d, 0xb77f, 0xb78a, 0xb76d, 0xb78c, 0xb78a,
-	0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb78a, 0xb78a, 0xb76d,
-	0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb76d, 0xb7bc,
-	0xb78a, 0xb76d, 0xb786, 0xb76d, 0xb76d, 0xb76d, 0xb787, 0xb76d,
-	0xb76d, 0xb76d, 0xb78a, 0xb7b3, 0xb76d, 0x080c, 0x0dd5, 0x00d0,
-	0x2001, 0x000b, 0x0410, 0x2001, 0x0003, 0x00f8, 0x2001, 0x0005,
-	0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001, 0x0009, 0x00b0, 0x080c,
-	0x955f, 0x6003, 0x0005, 0x080c, 0x9664, 0x0070, 0x0018, 0x0010,
-	0x080c, 0x6550, 0x0804, 0xb7cd, 0x080c, 0x955f, 0x080c, 0xd22e,
-	0x6003, 0x0004, 0x080c, 0x9664, 0x0005, 0x080c, 0x6550, 0x080c,
-	0x955f, 0x6003, 0x0002, 0x0036, 0x2019, 0x1852, 0x2304, 0x9084,
-	0xff00, 0x1120, 0x2001, 0x1986, 0x201c, 0x0040, 0x8007, 0x909a,
-	0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x003e,
-	0x080c, 0x9664, 0x0c08, 0x080c, 0x955f, 0x080c, 0xcf88, 0x080c,
-	0xae47, 0x080c, 0x9664, 0x08c0, 0x00e6, 0x00f6, 0x2071, 0x189e,
-	0x2079, 0x0000, 0x080c, 0x354f, 0x00fe, 0x00ee, 0x080c, 0x955f,
-	0x080c, 0xae47, 0x080c, 0x9664, 0x0838, 0x080c, 0x955f, 0x6003,
-	0x0002, 0x080c, 0xd22e, 0x0804, 0x9664, 0x2600, 0x2008, 0x0002,
-	0xb7ec, 0xb7cd, 0xb7ea, 0xb7cd, 0xb7cd, 0xb7ea, 0xb7ea, 0xb7ea,
-	0xb7ea, 0xb7cd, 0xb7ea, 0xb7cd, 0xb7ea, 0xb7cd, 0xb7ea, 0xb7ea,
-	0xb7ea, 0xb7ea, 0x080c, 0x0dd5, 0x080c, 0x955f, 0x0096, 0x6014,
-	0x2048, 0x080c, 0x6c79, 0x009e, 0x080c, 0xae47, 0x080c, 0x9664,
-	0x0005, 0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xcb1b, 0x0568,
-	0x6014, 0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086,
-	0x0056, 0x1148, 0x080c, 0x5479, 0x0130, 0x2001, 0x0000, 0x900e,
-	0x2011, 0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005,
-	0x080c, 0xd0f5, 0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000,
-	0x0016, 0x6004, 0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150,
-	0x001e, 0xa867, 0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e,
-	0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048,
-	0xa800, 0x2048, 0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005,
-	0x00b6, 0x6610, 0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c,
-	0x1a0c, 0x0dd5, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xd014,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xd05d,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xd089,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xcfaa,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xcd5a,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xcd9b,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x001f, 0x1120, 0x080c, 0xb220,
-	0x0804, 0xb8c5, 0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xb55d,
-	0x04e0, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c, 0xb258, 0x04a8,
-	0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0xb37e, 0x0470, 0x6604,
-	0x96b6, 0x0039, 0x1118, 0x080c, 0xb4f2, 0x0438, 0x6604, 0x96b6,
-	0x003d, 0x1118, 0x080c, 0xb290, 0x0400, 0x6604, 0x96b6, 0x0044,
-	0x1118, 0x080c, 0xb2cc, 0x00c8, 0x6604, 0x96b6, 0x0049, 0x1118,
-	0x080c, 0xb30d, 0x0090, 0x6604, 0x96b6, 0x0041, 0x1118, 0x080c,
-	0xb2f7, 0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6,
-	0x0016, 0x1128, 0x00be, 0x0804, 0xbb1f, 0x00be, 0x0005, 0x080c,
-	0xaedd, 0x0cd8, 0xb8e2, 0xb8e5, 0xb8e2, 0xb92c, 0xb8e2, 0xba93,
-	0xbb2c, 0xb8e2, 0xb8e2, 0xbaf5, 0xb8e2, 0xbb0b, 0x0096, 0x601f,
-	0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e,
-	0x0804, 0xae47, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800,
-	0x7090, 0x9086, 0x0074, 0x1540, 0x080c, 0xe29b, 0x11b0, 0x6010,
-	0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110,
-	0xc0c5, 0xb802, 0x00f9, 0x00be, 0x2001, 0x0006, 0x080c, 0x6550,
-	0x080c, 0x31e1, 0x080c, 0xae47, 0x0098, 0x2001, 0x000a, 0x080c,
-	0x6550, 0x080c, 0x31e1, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
-	0x910f, 0x080c, 0x9664, 0x0020, 0x2001, 0x0001, 0x080c, 0xba63,
-	0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0160, 0x9006, 0x080c,
-	0x653c, 0x2069, 0x1847, 0x6804, 0xd0a4, 0x0120, 0x2001, 0x0006,
-	0x080c, 0x657c, 0x00de, 0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011,
-	0x1824, 0x2204, 0x9086, 0x0074, 0x1904, 0xba3a, 0x6010, 0x2058,
-	0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xbc79, 0x0804, 0xb99e,
-	0x080c, 0xbc6e, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510,
-	0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
-	0xd0f5, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
-	0x2001, 0x0006, 0x080c, 0x6550, 0x080c, 0x31e1, 0x080c, 0xae47,
-	0x0804, 0xba3d, 0x080c, 0xba4b, 0x6014, 0x9005, 0x0190, 0x2048,
-	0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xd0f5,
-	0x08f8, 0x080c, 0xba41, 0x0160, 0x9006, 0x080c, 0x653c, 0x2001,
-	0x0004, 0x080c, 0x657c, 0x2001, 0x0007, 0x080c, 0x6550, 0x08a0,
-	0x2001, 0x0004, 0x080c, 0x6550, 0x6003, 0x0001, 0x6007, 0x0003,
-	0x080c, 0x910f, 0x080c, 0x9664, 0x0804, 0xba3d, 0xb85c, 0xd0e4,
-	0x01d8, 0x080c, 0xcf2a, 0x080c, 0x73b0, 0x0118, 0xd0dc, 0x1904,
-	0xb960, 0x2011, 0x1837, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x196d,
-	0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x28b2,
-	0x78e2, 0x00fe, 0x0804, 0xb960, 0x080c, 0xcf67, 0x2011, 0x1837,
-	0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xe420, 0x000e, 0x1904,
-	0xb960, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x6550, 0x9006,
-	0x080c, 0x653c, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520,
-	0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084,
-	0x00ff, 0x78e6, 0x707e, 0x7010, 0x78ea, 0x7082, 0x908c, 0x00ff,
-	0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2887, 0x00f6,
-	0x2100, 0x900e, 0x080c, 0x283e, 0x795e, 0x00fe, 0x9186, 0x0081,
-	0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079,
-	0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe,
-	0x080c, 0x2887, 0x00f6, 0x2079, 0x1800, 0x7982, 0x2100, 0x900e,
-	0x080c, 0x283e, 0x795e, 0x00fe, 0x8108, 0x080c, 0x659f, 0x2b00,
-	0x00ce, 0x1904, 0xb960, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c,
-	0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009,
-	0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x6550, 0x6023,
-	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x910f, 0x080c,
-	0x9664, 0x0018, 0x2001, 0x0001, 0x0431, 0x00de, 0x009e, 0x00be,
-	0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1848,
-	0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xe94f, 0x0190, 0x2071,
-	0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00,
-	0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912,
-	0xba16, 0x00ee, 0x0005, 0x2030, 0x9005, 0x0158, 0x2001, 0x0007,
-	0x080c, 0x6550, 0x080c, 0x56e4, 0x1120, 0x2001, 0x0007, 0x080c,
-	0x657c, 0x2600, 0x9005, 0x11b0, 0x6014, 0x0096, 0x2048, 0xa868,
-	0x009e, 0xd0fc, 0x1178, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058,
-	0xbba0, 0x00be, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b05,
-	0x004e, 0x003e, 0x080c, 0x31e1, 0x6020, 0x9086, 0x000a, 0x1108,
-	0x0005, 0x0804, 0xae47, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071,
-	0x1800, 0x7090, 0x9086, 0x0014, 0x1904, 0xbaeb, 0x080c, 0x56e4,
-	0x1170, 0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
-	0xbba0, 0x2021, 0x0006, 0x080c, 0x4cbc, 0x004e, 0x003e, 0x00d6,
-	0x6010, 0x2058, 0x080c, 0x669b, 0x080c, 0xb91a, 0x00de, 0x080c,
-	0xbd3f, 0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001,
-	0x0006, 0x080c, 0x6550, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e,
-	0x2011, 0x4000, 0x080c, 0xd0f5, 0x0060, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0x0200, 0x009e, 0x080c, 0x31e1, 0x6020, 0x9086, 0x000a, 0x0140,
-	0x080c, 0xae47, 0x0028, 0x080c, 0xb7f9, 0x9006, 0x080c, 0xba63,
-	0x001e, 0x002e, 0x00ee, 0x00be, 0x0005, 0x2011, 0x1824, 0x2204,
-	0x9086, 0x0014, 0x1160, 0x2001, 0x0002, 0x080c, 0x6550, 0x6003,
-	0x0001, 0x6007, 0x0001, 0x080c, 0x910f, 0x0804, 0x9664, 0x2001,
-	0x0001, 0x0804, 0xba63, 0x2030, 0x2011, 0x1824, 0x2204, 0x9086,
-	0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007, 0x080c,
-	0x6550, 0x0804, 0xae47, 0x2001, 0x0001, 0x0804, 0xba63, 0x0002,
-	0xb8e2, 0xbb37, 0xb8e2, 0xbb78, 0xb8e2, 0xbc25, 0xbb2c, 0xb8e2,
-	0xb8e2, 0xbc39, 0xb8e2, 0xbc4b, 0x6604, 0x9686, 0x0003, 0x0904,
-	0xba93, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae47, 0x0005, 0x00b6,
-	0x00d6, 0x00c6, 0x080c, 0xbc5d, 0x11a0, 0x9006, 0x080c, 0x653c,
-	0x080c, 0x31bc, 0x080c, 0xd22b, 0x2001, 0x0002, 0x080c, 0x6550,
-	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x910f, 0x080c, 0x9664,
-	0x0418, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010,
-	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842,
-	0x601b, 0x000a, 0x0088, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00,
-	0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x31bc, 0x080c, 0xd22b,
-	0x2001, 0x0001, 0x080c, 0xba63, 0x00ce, 0x00de, 0x00be, 0x0005,
-	0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xbc6b, 0x00d6, 0x2069,
-	0x197c, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086,
-	0x007e, 0x1138, 0x2069, 0x1820, 0x2d04, 0x8000, 0x206a, 0x00de,
-	0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x653c, 0x2001, 0x0002,
-	0x080c, 0x6550, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x910f,
-	0x080c, 0x9664, 0x0804, 0xbbf5, 0x080c, 0xcb1b, 0x01b0, 0x6014,
-	0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016,
-	0x2001, 0x0002, 0x080c, 0xd14f, 0x00b0, 0x6014, 0x2048, 0xa864,
-	0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004,
-	0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x1110, 0x9006, 0x0c38, 0x080c, 0xb7f9, 0x2009, 0x026e, 0x2134,
-	0x96b4, 0x00ff, 0x9686, 0x0005, 0x0520, 0x9686, 0x000b, 0x01c8,
-	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009,
-	0x01c0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0190, 0x2001,
-	0x0004, 0x080c, 0x6550, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052,
-	0x0020, 0x2001, 0x0001, 0x080c, 0xba63, 0x002e, 0x00be, 0x009e,
-	0x0005, 0x9286, 0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xcb1b,
-	0x0140, 0xa864, 0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108,
-	0x0c40, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138,
-	0x8001, 0xb842, 0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0,
-	0x9086, 0x007e, 0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5fae,
-	0x00ee, 0x0010, 0x080c, 0x31bc, 0x0860, 0x080c, 0xbc6b, 0x1160,
-	0x2001, 0x0004, 0x080c, 0x6550, 0x6003, 0x0001, 0x6007, 0x0003,
-	0x080c, 0x910f, 0x0804, 0x9664, 0x080c, 0xb7f9, 0x9006, 0x0804,
-	0xba63, 0x0489, 0x1160, 0x2001, 0x0008, 0x080c, 0x6550, 0x6003,
-	0x0001, 0x6007, 0x0005, 0x080c, 0x910f, 0x0804, 0x9664, 0x2001,
-	0x0001, 0x0804, 0xba63, 0x00f9, 0x1160, 0x2001, 0x000a, 0x080c,
-	0x6550, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x910f, 0x0804,
-	0x9664, 0x2001, 0x0001, 0x0804, 0xba63, 0x2009, 0x026e, 0x2104,
-	0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00,
-	0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6,
-	0x0016, 0x6110, 0x2158, 0x080c, 0x660f, 0x001e, 0x00ce, 0x00be,
-	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010,
-	0x2058, 0x2009, 0x1837, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c,
-	0xbd11, 0x0560, 0x2009, 0x1837, 0x2104, 0xc0cd, 0x200a, 0x080c,
-	0x6966, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe58d,
-	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009,
-	0x0001, 0x080c, 0x3187, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2f96,
-	0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c,
-	0x32b4, 0x8108, 0x1f04, 0xbcaf, 0x015e, 0x00ce, 0x080c, 0xbc6e,
-	0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1837,
-	0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038,
-	0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1837, 0x2102,
-	0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181f, 0x206a,
-	0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x1820, 0x206a, 0x78ea,
-	0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009,
-	0x182c, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x2887,
-	0x080c, 0x73b0, 0x0170, 0x2071, 0x0260, 0x2069, 0x1982, 0x7048,
-	0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c,
-	0xcf2a, 0x0040, 0x2001, 0x0006, 0x080c, 0x6550, 0x080c, 0x31e1,
-	0x080c, 0xae47, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be,
-	0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182c,
-	0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff,
-	0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276,
-	0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe03, 0x1148,
-	0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xbe03,
-	0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e, 0x0005, 0x00e6,
-	0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038, 0x9086,
-	0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086,
-	0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6,
-	0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2029, 0x19f0, 0x252c, 0x2021, 0x19f6, 0x2424, 0x2061, 0x1cd0,
-	0x2071, 0x1800, 0x7254, 0x7074, 0x9202, 0x1a04, 0xbdcf, 0x080c,
-	0x8958, 0x0904, 0xbdc8, 0x080c, 0xe5be, 0x0904, 0xbdc8, 0x6720,
-	0x9786, 0x0007, 0x0904, 0xbdc8, 0x2500, 0x9c06, 0x0904, 0xbdc8,
-	0x2400, 0x9c06, 0x05e8, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010,
-	0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1580,
-	0x00c6, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x1a5e, 0x9786,
-	0x000a, 0x0148, 0x080c, 0xcd21, 0x1130, 0x00ce, 0x080c, 0xb7f9,
-	0x080c, 0xae78, 0x00e8, 0x6014, 0x2048, 0x080c, 0xcb1b, 0x01a8,
-	0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6c6d, 0x080c, 0xcd04, 0x080c, 0xae78, 0x00ce,
-	0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1210, 0x0804, 0xbd72, 0x012e,
-	0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee,
-	0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xe530, 0x0c30, 0x9786,
-	0x0009, 0x1148, 0x6000, 0x9086, 0x0004, 0x0d08, 0x2009, 0x004c,
-	0x080c, 0xaec2, 0x08e0, 0x9786, 0x000a, 0x0938, 0x0820, 0x220c,
-	0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbdef, 0x9006,
-	0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001, 0x0008, 0x9006,
-	0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x8906, 0x8006,
-	0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9300, 0x2098,
-	0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e, 0x1140, 0x8210,
-	0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c,
-	0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0x918d,
-	0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x810f, 0x2304,
-	0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbe2d, 0x9006, 0x0005,
-	0x918d, 0x0001, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5,
-	0x080c, 0xcd10, 0x0120, 0x080c, 0xcd21, 0x0168, 0x0028, 0x080c,
-	0x31e1, 0x080c, 0xcd21, 0x0138, 0x080c, 0x955f, 0x080c, 0xae47,
-	0x080c, 0x9664, 0x0005, 0x080c, 0xb7f9, 0x0cb0, 0x9182, 0x0054,
-	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbe72, 0xbe72,
-	0xbe72, 0xbe72, 0xbe72, 0xbe72, 0xbe72, 0xbe72, 0xbe72, 0xbe72,
-	0xbe72, 0xbe74, 0xbe74, 0xbe74, 0xbe74, 0xbe72, 0xbe72, 0xbe72,
-	0xbe74, 0xbe72, 0x080c, 0x0dd5, 0x600b, 0xffff, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x90c7, 0x0126, 0x2091, 0x8000, 0x080c, 0x9664,
-	0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0040,
-	0x0804, 0xbf29, 0x9186, 0x0027, 0x1520, 0x080c, 0x955f, 0x080c,
-	0x31bc, 0x080c, 0xd22b, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb1b,
-	0x0198, 0x080c, 0xcd21, 0x1118, 0x080c, 0xb7f9, 0x0068, 0xa867,
-	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e,
-	0x080c, 0x6c79, 0x080c, 0xcd04, 0x009e, 0x080c, 0xae47, 0x0804,
-	0x9664, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082, 0x0040, 0x04a0,
-	0x9186, 0x0046, 0x0150, 0x9186, 0x0045, 0x0138, 0x9186, 0x0053,
-	0x0120, 0x9186, 0x0048, 0x190c, 0x0dd5, 0x2001, 0x0109, 0x2004,
-	0xd084, 0x0508, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x00f6, 0x00e6, 0x00c6, 0x2079, 0x19e7, 0x2071, 0x1800,
-	0x2061, 0x0100, 0x080c, 0x8fac, 0x00ce, 0x00ee, 0x00fe, 0x003e,
-	0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000, 0x9086, 0x0002,
-	0x1110, 0x0804, 0xbf67, 0x0005, 0x0002, 0xbf03, 0xbf01, 0xbf01,
-	0xbf01, 0xbf01, 0xbf01, 0xbf01, 0xbf01, 0xbf01, 0xbf01, 0xbf01,
-	0xbf1e, 0xbf1e, 0xbf1e, 0xbf1e, 0xbf01, 0xbf1e, 0xbf01, 0xbf1e,
-	0xbf01, 0x080c, 0x0dd5, 0x080c, 0x955f, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xcb1b, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877,
-	0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x6c79, 0x080c, 0xcd04,
-	0x009e, 0x080c, 0xae47, 0x080c, 0x9664, 0x0005, 0x080c, 0x955f,
-	0x080c, 0xcd21, 0x090c, 0xb7f9, 0x080c, 0xae47, 0x080c, 0x9664,
-	0x0005, 0x0002, 0xbf40, 0xbf3e, 0xbf3e, 0xbf3e, 0xbf3e, 0xbf3e,
-	0xbf3e, 0xbf3e, 0xbf3e, 0xbf3e, 0xbf3e, 0xbf57, 0xbf57, 0xbf57,
-	0xbf57, 0xbf3e, 0xbf61, 0xbf3e, 0xbf57, 0xbf3e, 0x080c, 0x0dd5,
-	0x0096, 0x080c, 0x955f, 0x6014, 0x2048, 0x2001, 0x1988, 0x2004,
-	0x6042, 0xa97c, 0xd1ac, 0x0140, 0x6003, 0x0004, 0xa87c, 0x9085,
-	0x0400, 0xa87e, 0x009e, 0x0005, 0x6003, 0x0002, 0x0cb8, 0x080c,
-	0x955f, 0x080c, 0xd22e, 0x080c, 0xd233, 0x6003, 0x000f, 0x0804,
-	0x9664, 0x080c, 0x955f, 0x080c, 0xae47, 0x0804, 0x9664, 0x9182,
-	0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbf83,
-	0xbf83, 0xbf83, 0xbf83, 0xbf83, 0xbf85, 0xc062, 0xbf83, 0xc096,
-	0xbf83, 0xbf83, 0xbf83, 0xbf83, 0xbf83, 0xbf83, 0xbf83, 0xbf83,
-	0xbf83, 0xbf83, 0xc096, 0x080c, 0x0dd5, 0x00b6, 0x0096, 0x6114,
-	0x2148, 0x7644, 0x96b4, 0x0fff, 0x86ff, 0x1528, 0x6010, 0x2058,
-	0xb800, 0xd0bc, 0x1904, 0xc051, 0xa87b, 0x0000, 0xa867, 0x0103,
-	0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
-	0xc22b, 0x080c, 0x6a95, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110,
-	0x8211, 0xba3e, 0x7044, 0xd0e4, 0x1904, 0xc035, 0x080c, 0xae47,
-	0x009e, 0x00be, 0x0005, 0x968c, 0x0c00, 0x0150, 0x6010, 0x2058,
-	0xb800, 0xd0bc, 0x1904, 0xc039, 0x7348, 0xab92, 0x734c, 0xab8e,
-	0x968c, 0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, 0x0028, 0x1118,
-	0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c,
-	0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0148, 0x7048,
-	0x9106, 0x1118, 0x704c, 0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc,
-	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
-	0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100,
-	0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, 0xbf8c, 0x735c,
+	0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x125d,
+	0x080c, 0xb37a, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
+	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0xae61, 0x2001,
+	0x002c, 0x900e, 0x080c, 0xb220, 0x0c70, 0x91b6, 0x0015, 0x0170,
+	0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0dd5, 0x91b2,
+	0x0050, 0x1a0c, 0x0dd5, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109,
+	0x2004, 0xd08c, 0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x080c, 0x90a2, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
+	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xafa6, 0x0005, 0xb078,
+	0xb078, 0xb07a, 0xb0b0, 0xb078, 0xb078, 0xb078, 0xb078, 0xb0c3,
+	0x080c, 0x0dd5, 0x00d6, 0x0016, 0x0096, 0x080c, 0x963d, 0x080c,
+	0x97b9, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
+	0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001,
+	0x0000, 0x900e, 0x080c, 0xb220, 0x080c, 0xae61, 0x00a8, 0x6003,
+	0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78,
+	0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2,
+	0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005,
+	0x080c, 0x963d, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb35,
+	0x0120, 0xa87b, 0x0006, 0x080c, 0x6c81, 0x009e, 0x00de, 0x080c,
+	0xae61, 0x0804, 0x97b9, 0x080c, 0x963d, 0x080c, 0x31bf, 0x080c,
+	0xd245, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb35, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6c81, 0x009e, 0x00de, 0x080c, 0xae61,
+	0x0804, 0x97b9, 0x9182, 0x0047, 0x0002, 0xb0ea, 0xb0ec, 0xb0ea,
+	0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea,
+	0xb0ea, 0xb0ec, 0x080c, 0x0dd5, 0x00d6, 0x0096, 0x601f, 0x0000,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6c81,
+	0x009e, 0x00de, 0x0804, 0xae61, 0x0026, 0x0036, 0x0056, 0x0066,
+	0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x0fff, 0x000e, 0x090c,
+	0x0dd5, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
+	0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x7990, 0x9188,
+	0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034,
+	0x1228, 0x2011, 0x001f, 0x080c, 0xc730, 0x04c0, 0x2130, 0x2009,
+	0x0034, 0x2011, 0x001f, 0x080c, 0xc730, 0x96b2, 0x0034, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0fb1, 0x080c, 0x0fff, 0x01d0, 0x8528,
+	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
+	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc730, 0x00b8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc730,
+	0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
+	0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205,
+	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6c81, 0x000e, 0x2048,
+	0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e,
+	0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0fff,
+	0x000e, 0x090c, 0x0dd5, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
+	0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079,
+	0x1800, 0x7990, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210,
+	0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c,
+	0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
+	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6c81, 0x009e, 0x00fe,
+	0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001,
+	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200,
+	0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021,
+	0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011, 0x0020, 0x2018,
+	0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x0fff, 0x2900, 0x009e,
+	0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009, 0x0280, 0x9102,
+	0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200, 0x9402, 0x1228,
+	0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800,
+	0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300,
+	0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
+	0x2e98, 0x2310, 0x84ff, 0x0904, 0xb1cf, 0x0804, 0xb1d1, 0x9085,
+	0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005,
+	0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c,
+	0x6c75, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
+	0x080c, 0xae61, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0dd5, 0x080c,
+	0xae61, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
+	0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003,
+	0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418,
+	0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8,
+	0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003,
+	0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xcb35,
+	0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e,
+	0x0804, 0xae61, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200,
+	0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8cf, 0x0000, 0x00be, 0x6014,
+	0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32,
+	0x080c, 0xae61, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48,
+	0x0cc8, 0x0006, 0x0016, 0x080c, 0xd230, 0x0188, 0x6014, 0x9005,
+	0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009,
+	0x0022, 0x080c, 0xb657, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085,
+	0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c,
+	0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001,
+	0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804,
+	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
+	0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020,
+	0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
+	0x0103, 0x080c, 0xae61, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016,
+	0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff,
+	0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108,
+	0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c,
+	0xc730, 0x080c, 0xcb35, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xae61, 0x001e, 0x009e,
+	0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086, 0x0200, 0x0110,
+	0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c, 0x0dd5, 0xa97a,
+	0x080c, 0x6c81, 0x009e, 0x080c, 0xae61, 0x001e, 0x0005, 0x0016,
+	0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004, 0x0010,
+	0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c, 0x6014,
+	0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c, 0xc730,
+	0x009e, 0x080c, 0xcb35, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xae61, 0x009e,
+	0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100,
+	0x1118, 0x080c, 0xb813, 0x00e0, 0xa034, 0x8007, 0x800c, 0x8806,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x000c,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c,
+	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1243, 0x0019, 0x0d08,
+	0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0fff, 0x000e, 0x01b0,
+	0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800,
+	0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086,
+	0x2940, 0x080c, 0x10e9, 0x008e, 0x9085, 0x0001, 0x009e, 0x0005,
+	0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6,
+	0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210, 0x00b6,
+	0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x6043, 0x0000, 0x2c68,
+	0x0016, 0x2009, 0x0035, 0x080c, 0xd1a8, 0x001e, 0x1158, 0x622c,
+	0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386,
+	0x0006, 0x0128, 0x080c, 0xae61, 0x0020, 0x0039, 0x0010, 0x080c,
+	0xb48c, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048,
+	0x9186, 0x0015, 0x0904, 0xb474, 0x918e, 0x0016, 0x1904, 0xb48a,
+	0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300,
+	0x1904, 0xb44e, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904,
+	0xb431, 0x0804, 0xb488, 0x6808, 0x9086, 0xffff, 0x1904, 0xb476,
+	0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940,
+	0x9105, 0x1904, 0xb476, 0x6824, 0xd0b4, 0x1904, 0xb476, 0x080c,
+	0xcd1e, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e,
+	0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x8f68, 0xa884,
+	0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6,
+	0x2d60, 0x080c, 0xc85a, 0x00ce, 0x0804, 0xb488, 0x00c6, 0xa868,
+	0xd0fc, 0x1118, 0x080c, 0x60ae, 0x0010, 0x080c, 0x64b4, 0x00ce,
+	0x1904, 0xb476, 0x00c6, 0x2d60, 0x080c, 0xae61, 0x00ce, 0x0804,
+	0xb488, 0x00c6, 0x080c, 0xaeaf, 0x0198, 0x6017, 0x0000, 0x6810,
+	0x6012, 0x080c, 0xcfaa, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60,
+	0x080c, 0xae61, 0x00ce, 0x080c, 0xaedc, 0x00ce, 0x0804, 0xb488,
+	0x2001, 0x1988, 0x2004, 0x6842, 0x00ce, 0x04d0, 0x7008, 0x9086,
+	0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc, 0xb902,
+	0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xd1ea, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90f0, 0x080c,
+	0x968d, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00, 0x1138, 0x2001,
+	0x1988, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0, 0x89ff, 0x090c,
+	0x0dd5, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b, 0x0003,
+	0x080c, 0x6a9d, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x00de, 0x00ce,
+	0x080c, 0xae61, 0x009e, 0x0005, 0x9186, 0x0015, 0x1128, 0x2001,
+	0x1988, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016, 0x1160, 0x00c6,
+	0x2d00, 0x2060, 0x080c, 0xe80b, 0x080c, 0x86b2, 0x080c, 0xae61,
+	0x00ce, 0x080c, 0xae61, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228,
+	0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1988, 0x2004, 0x6842,
+	0x0804, 0xb506, 0x00c6, 0x2d60, 0x080c, 0xc75b, 0x00ce, 0x6804,
+	0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001,
+	0x6007, 0x0050, 0x080c, 0x90f0, 0x080c, 0x968d, 0x00ce, 0x04f0,
+	0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c, 0x0dd5, 0x6800,
+	0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff,
+	0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832,
+	0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150,
+	0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105,
+	0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020,
+	0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005,
+	0x6832, 0x080c, 0xcea1, 0x080c, 0x968d, 0x0010, 0x080c, 0xae61,
+	0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008,
+	0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206,
+	0x1904, 0xb571, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be,
+	0x9206, 0x1904, 0xb571, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826,
+	0x6a20, 0x9286, 0x0007, 0x0904, 0xb571, 0x9286, 0x0002, 0x0904,
+	0xb571, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8,
+	0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e, 0x0016, 0x1100,
+	0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b, 0x01c0, 0x9186,
+	0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186, 0x004e, 0x0178,
+	0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048, 0x080c, 0xcb35,
+	0x090c, 0x0dd5, 0xa87b, 0x0003, 0x009e, 0x080c, 0xd1ea, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90f0, 0x080c,
+	0x968d, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x1988, 0x2004,
+	0x7042, 0x080c, 0xae61, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6,
+	0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058, 0x91b6, 0x0015,
+	0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096,
+	0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a,
+	0x20a9, 0x0004, 0x080c, 0xbe1d, 0x002e, 0x003e, 0x015e, 0x009e,
+	0x1904, 0xb5e0, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90,
+	0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c, 0xbe1d, 0x002e,
+	0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e,
+	0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e,
+	0x00be, 0x0804, 0xb265, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a,
+	0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
+	0x2031, 0x0000, 0x2041, 0x1243, 0x080c, 0xb37a, 0x0130, 0x00fe,
+	0x009e, 0x080c, 0xae61, 0x00be, 0x0005, 0x080c, 0xb813, 0x0cb8,
+	0x2b78, 0x00f6, 0x080c, 0x31bf, 0x080c, 0xd245, 0x00fe, 0x00c6,
+	0x080c, 0xae0b, 0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x654f,
+	0x080c, 0x657b, 0x080c, 0x9138, 0x080c, 0x968d, 0x00ce, 0x0804,
+	0xb5b3, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b2, 0x0040,
+	0x1a04, 0xb669, 0x0002, 0xb657, 0xb657, 0xb64d, 0xb657, 0xb657,
+	0xb657, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
+	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
+	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
+	0xb64b, 0xb64b, 0xb657, 0xb64b, 0xb657, 0xb657, 0xb64b, 0xb64b,
+	0xb64b, 0xb64b, 0xb64b, 0xb64d, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
+	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb657, 0xb657, 0xb64b,
+	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
+	0xb657, 0xb64b, 0xb64b, 0x080c, 0x0dd5, 0x0066, 0x00b6, 0x6610,
+	0x2658, 0xb8cc, 0xc08c, 0xb8ce, 0x00be, 0x006e, 0x0000, 0x6003,
+	0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c, 0x9138, 0x0010,
+	0x080c, 0x90f0, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d, 0x012e,
+	0x0005, 0x2600, 0x0002, 0xb657, 0xb657, 0xb67d, 0xb657, 0xb657,
+	0xb67d, 0xb67d, 0xb67d, 0xb67d, 0xb657, 0xb67d, 0xb657, 0xb67d,
+	0xb657, 0xb67d, 0xb67d, 0xb67d, 0xb67d, 0x080c, 0x0dd5, 0x6004,
+	0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x0904, 0xb741,
+	0x91b6, 0x0027, 0x1904, 0xb6fc, 0x080c, 0x9588, 0x6004, 0x080c,
+	0xcd2a, 0x01b0, 0x080c, 0xcd3b, 0x01a8, 0x908e, 0x0021, 0x0904,
+	0xb6f9, 0x908e, 0x0022, 0x1130, 0x080c, 0xb291, 0x0904, 0xb6f5,
+	0x0804, 0xb6f6, 0x908e, 0x003d, 0x0904, 0xb6f9, 0x0804, 0xb6ef,
+	0x080c, 0x31e8, 0x2001, 0x0007, 0x080c, 0x654f, 0x6010, 0x00b6,
+	0x2058, 0xb9a0, 0x00be, 0x080c, 0xb813, 0x9186, 0x007e, 0x1148,
+	0x2001, 0x1837, 0x2014, 0xc285, 0x080c, 0x73bc, 0x1108, 0xc2ad,
+	0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xe917,
+	0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028,
+	0x080c, 0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x6010, 0x00b6,
+	0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xe2eb, 0x007e, 0x003e,
+	0x002e, 0x001e, 0x080c, 0xd245, 0x0016, 0x080c, 0xcfa2, 0x080c,
+	0xae61, 0x001e, 0x080c, 0x32bb, 0x080c, 0x968d, 0x0030, 0x080c,
+	0xcfa2, 0x080c, 0xae61, 0x080c, 0x968d, 0x0005, 0x080c, 0xb813,
+	0x0cb0, 0x080c, 0xb84f, 0x0c98, 0x9186, 0x0014, 0x1db0, 0x080c,
+	0x9588, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xb291, 0x0d68,
+	0x080c, 0x31bf, 0x080c, 0xd245, 0x080c, 0xcd2a, 0x1190, 0x080c,
+	0x31e8, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb813,
+	0x9186, 0x007e, 0x1128, 0x2001, 0x1837, 0x200c, 0xc185, 0x2102,
+	0x0870, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813, 0x0840, 0x6004,
+	0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079,
+	0x0000, 0x080c, 0x3556, 0x00fe, 0x00ee, 0x0804, 0xb6ef, 0x6004,
+	0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c, 0xb813, 0x0804,
+	0xb6ef, 0x90b2, 0x0040, 0x1a04, 0xb7ef, 0x2008, 0x0002, 0xb789,
+	0xb78a, 0xb78d, 0xb790, 0xb793, 0xb796, 0xb787, 0xb787, 0xb787,
+	0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787,
+	0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787,
+	0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb799, 0xb7a4, 0xb787,
+	0xb7a6, 0xb7a4, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb7a4,
+	0xb7a4, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787,
+	0xb787, 0xb7d6, 0xb7a4, 0xb787, 0xb7a0, 0xb787, 0xb787, 0xb787,
+	0xb7a1, 0xb787, 0xb787, 0xb787, 0xb7a4, 0xb7cd, 0xb787, 0x080c,
+	0x0dd5, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001, 0x0003, 0x00f8,
+	0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001, 0x0009,
+	0x00b0, 0x080c, 0x9588, 0x6003, 0x0005, 0x080c, 0x968d, 0x0070,
+	0x0018, 0x0010, 0x080c, 0x654f, 0x0804, 0xb7e7, 0x080c, 0x9588,
+	0x080c, 0xd248, 0x6003, 0x0004, 0x080c, 0x968d, 0x0005, 0x080c,
+	0x654f, 0x080c, 0x9588, 0x6003, 0x0002, 0x0036, 0x2019, 0x1852,
+	0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1986, 0x201c, 0x0040,
+	0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318,
+	0x631a, 0x003e, 0x080c, 0x968d, 0x0c08, 0x080c, 0x9588, 0x080c,
+	0xcfa2, 0x080c, 0xae61, 0x080c, 0x968d, 0x08c0, 0x00e6, 0x00f6,
+	0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x3556, 0x00fe, 0x00ee,
+	0x080c, 0x9588, 0x080c, 0xae61, 0x080c, 0x968d, 0x0838, 0x080c,
+	0x9588, 0x6003, 0x0002, 0x080c, 0xd248, 0x0804, 0x968d, 0x2600,
+	0x2008, 0x0002, 0xb806, 0xb7e7, 0xb804, 0xb7e7, 0xb7e7, 0xb804,
+	0xb804, 0xb804, 0xb804, 0xb7e7, 0xb804, 0xb7e7, 0xb804, 0xb7e7,
+	0xb804, 0xb804, 0xb804, 0xb804, 0x080c, 0x0dd5, 0x080c, 0x9588,
+	0x0096, 0x6014, 0x2048, 0x080c, 0x6c81, 0x009e, 0x080c, 0xae61,
+	0x080c, 0x968d, 0x0005, 0x00e6, 0x0096, 0x0026, 0x0016, 0x080c,
+	0xcb35, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086, 0x0139, 0x11a8,
+	0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x5478, 0x0130, 0x2001,
+	0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001, 0x0030, 0x900e,
+	0x2011, 0x4005, 0x080c, 0xd10f, 0x0090, 0xa868, 0xd0fc, 0x0178,
+	0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021, 0x0168, 0x908e,
+	0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833, 0x0100, 0x001e,
+	0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096,
+	0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0xa823, 0x8001,
+	0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804, 0x9084, 0x00ff,
+	0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x6604, 0x96b6, 0x004d, 0x1120,
+	0x080c, 0xd02e, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0043, 0x1120,
+	0x080c, 0xd077, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x004b, 0x1120,
+	0x080c, 0xd0a3, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0033, 0x1120,
+	0x080c, 0xcfc4, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0028, 0x1120,
+	0x080c, 0xcd74, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0029, 0x1120,
+	0x080c, 0xcdb5, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x001f, 0x1120,
+	0x080c, 0xb23a, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0000, 0x1118,
+	0x080c, 0xb577, 0x04e0, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c,
+	0xb272, 0x04a8, 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0xb398,
+	0x0470, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c, 0xb50c, 0x0438,
+	0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xb2aa, 0x0400, 0x6604,
+	0x96b6, 0x0044, 0x1118, 0x080c, 0xb2e6, 0x00c8, 0x6604, 0x96b6,
+	0x0049, 0x1118, 0x080c, 0xb327, 0x0090, 0x6604, 0x96b6, 0x0041,
+	0x1118, 0x080c, 0xb311, 0x0058, 0x91b6, 0x0015, 0x1110, 0x0063,
+	0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804, 0xbb39, 0x00be,
+	0x0005, 0x080c, 0xaef7, 0x0cd8, 0xb8fc, 0xb8ff, 0xb8fc, 0xb946,
+	0xb8fc, 0xbaad, 0xbb46, 0xb8fc, 0xb8fc, 0xbb0f, 0xb8fc, 0xbb25,
+	0x0096, 0x601f, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
+	0x0103, 0x009e, 0x0804, 0xae61, 0xa001, 0xa001, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x7090, 0x9086, 0x0074, 0x1540, 0x080c, 0xe2bc,
+	0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128, 0xb800,
+	0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9, 0x00be, 0x2001, 0x0006,
+	0x080c, 0x654f, 0x080c, 0x31e8, 0x080c, 0xae61, 0x0098, 0x2001,
+	0x000a, 0x080c, 0x654f, 0x080c, 0x31e8, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x9138, 0x080c, 0x968d, 0x0020, 0x2001, 0x0001,
+	0x080c, 0xba7d, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0160,
+	0x9006, 0x080c, 0x653b, 0x2069, 0x1847, 0x6804, 0xd0a4, 0x0120,
+	0x2001, 0x0006, 0x080c, 0x657b, 0x00de, 0x0005, 0x00b6, 0x0096,
+	0x00d6, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1904, 0xba54,
+	0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xbc93,
+	0x0804, 0xb9b8, 0x080c, 0xbc88, 0x6010, 0x2058, 0xbaa0, 0x9286,
+	0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xd10f, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x654f, 0x080c, 0x31e8,
+	0x080c, 0xae61, 0x0804, 0xba57, 0x080c, 0xba65, 0x6014, 0x9005,
+	0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x080c, 0xd10f, 0x08f8, 0x080c, 0xba5b, 0x0160, 0x9006, 0x080c,
+	0x653b, 0x2001, 0x0004, 0x080c, 0x657b, 0x2001, 0x0007, 0x080c,
+	0x654f, 0x08a0, 0x2001, 0x0004, 0x080c, 0x654f, 0x6003, 0x0001,
+	0x6007, 0x0003, 0x080c, 0x9138, 0x080c, 0x968d, 0x0804, 0xba57,
+	0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcf44, 0x080c, 0x73bc, 0x0118,
+	0xd0dc, 0x1904, 0xb97a, 0x2011, 0x1837, 0x2204, 0xc0ad, 0x2012,
+	0x2001, 0x196d, 0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000,
+	0x080c, 0x28b2, 0x78e2, 0x00fe, 0x0804, 0xb97a, 0x080c, 0xcf81,
+	0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xe441,
+	0x000e, 0x1904, 0xb97a, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c,
+	0x654f, 0x9006, 0x080c, 0x653b, 0x00c6, 0x2001, 0x180f, 0x2004,
+	0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800,
+	0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e, 0x7010, 0x78ea, 0x7082,
+	0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c,
+	0x2887, 0x00f6, 0x2100, 0x900e, 0x080c, 0x283e, 0x795e, 0x00fe,
+	0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef,
+	0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5,
+	0x780e, 0x00fe, 0x080c, 0x2887, 0x00f6, 0x2079, 0x1800, 0x7982,
+	0x2100, 0x900e, 0x080c, 0x283e, 0x795e, 0x00fe, 0x8108, 0x080c,
+	0x659e, 0x2b00, 0x00ce, 0x1904, 0xb97a, 0x6012, 0x2009, 0x180f,
+	0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff,
+	0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c,
+	0x654f, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x0018, 0x2001, 0x0001, 0x0431, 0x00de,
+	0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120,
+	0x2001, 0x1848, 0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xe970,
+	0x0190, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118,
+	0x9284, 0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80,
+	0x1110, 0xb912, 0xba16, 0x00ee, 0x0005, 0x2030, 0x9005, 0x0158,
+	0x2001, 0x0007, 0x080c, 0x654f, 0x080c, 0x56e3, 0x1120, 0x2001,
+	0x0007, 0x080c, 0x657b, 0x2600, 0x9005, 0x11b0, 0x6014, 0x0096,
+	0x2048, 0xa868, 0x009e, 0xd0fc, 0x1178, 0x0036, 0x0046, 0x6010,
+	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004, 0x2011, 0x8014,
+	0x080c, 0x4b04, 0x004e, 0x003e, 0x080c, 0x31e8, 0x6020, 0x9086,
+	0x000a, 0x1108, 0x0005, 0x0804, 0xae61, 0x00b6, 0x00e6, 0x0026,
+	0x0016, 0x2071, 0x1800, 0x7090, 0x9086, 0x0014, 0x1904, 0xbb05,
+	0x080c, 0x56e3, 0x1170, 0x6014, 0x9005, 0x1158, 0x0036, 0x0046,
+	0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4cbb, 0x004e,
+	0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x669a, 0x080c, 0xb934,
+	0x00de, 0x080c, 0xbd59, 0x1588, 0x6010, 0x2058, 0xb890, 0x9005,
+	0x0560, 0x2001, 0x0006, 0x080c, 0x654f, 0x0096, 0x6014, 0x904d,
+	0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
+	0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xd10f, 0x0060, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x31e8, 0x6020, 0x9086,
+	0x000a, 0x0140, 0x080c, 0xae61, 0x0028, 0x080c, 0xb813, 0x9006,
+	0x080c, 0xba7d, 0x001e, 0x002e, 0x00ee, 0x00be, 0x0005, 0x2011,
+	0x1824, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001, 0x0002, 0x080c,
+	0x654f, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x9138, 0x0804,
+	0x968d, 0x2001, 0x0001, 0x0804, 0xba7d, 0x2030, 0x2011, 0x1824,
+	0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001,
+	0x0007, 0x080c, 0x654f, 0x0804, 0xae61, 0x2001, 0x0001, 0x0804,
+	0xba7d, 0x0002, 0xb8fc, 0xbb51, 0xb8fc, 0xbb92, 0xb8fc, 0xbc3f,
+	0xbb46, 0xb8fc, 0xb8fc, 0xbc53, 0xb8fc, 0xbc65, 0x6604, 0x9686,
+	0x0003, 0x0904, 0xbaad, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae61,
+	0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xbc77, 0x11a0, 0x9006,
+	0x080c, 0x653b, 0x080c, 0x31bf, 0x080c, 0xd245, 0x2001, 0x0002,
+	0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9138,
+	0x080c, 0x968d, 0x0418, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009,
+	0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170,
+	0x8001, 0xb842, 0x601b, 0x000a, 0x0088, 0x2009, 0x026f, 0x2104,
+	0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x31bf,
+	0x080c, 0xd245, 0x2001, 0x0001, 0x080c, 0xba7d, 0x00ce, 0x00de,
+	0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xbc85,
+	0x00d6, 0x2069, 0x197c, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058,
+	0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x1820, 0x2d04, 0x8000,
+	0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x653b,
+	0x2001, 0x0002, 0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x9138, 0x080c, 0x968d, 0x0804, 0xbc0f, 0x080c, 0xcb35,
+	0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138,
+	0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xd169, 0x00b0, 0x6014,
+	0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001,
+	0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084,
+	0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c, 0xb813, 0x2009,
+	0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005, 0x0520, 0x9686,
+	0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118,
+	0x9686, 0x0009, 0x01c0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009,
+	0x0190, 0x2001, 0x0004, 0x080c, 0x654f, 0x2001, 0x0028, 0x601a,
+	0x6007, 0x0052, 0x0020, 0x2001, 0x0001, 0x080c, 0xba7d, 0x002e,
+	0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160, 0x6014, 0x2048,
+	0x080c, 0xcb35, 0x0140, 0xa864, 0x9086, 0x0139, 0x0118, 0xa868,
+	0xd0fc, 0x0108, 0x0c40, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a, 0x6007, 0x0016,
+	0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x5fad, 0x00ee, 0x0010, 0x080c, 0x31bf, 0x0860, 0x080c,
+	0xbc85, 0x1160, 0x2001, 0x0004, 0x080c, 0x654f, 0x6003, 0x0001,
+	0x6007, 0x0003, 0x080c, 0x9138, 0x0804, 0x968d, 0x080c, 0xb813,
+	0x9006, 0x0804, 0xba7d, 0x0489, 0x1160, 0x2001, 0x0008, 0x080c,
+	0x654f, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x9138, 0x0804,
+	0x968d, 0x2001, 0x0001, 0x0804, 0xba7d, 0x00f9, 0x1160, 0x2001,
+	0x000a, 0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x9138, 0x0804, 0x968d, 0x2001, 0x0001, 0x0804, 0xba7d, 0x2009,
+	0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104,
+	0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x660e, 0x001e,
+	0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036,
+	0x0016, 0x6010, 0x2058, 0x2009, 0x1837, 0x2104, 0x9085, 0x0003,
+	0x200a, 0x080c, 0xbd2b, 0x0560, 0x2009, 0x1837, 0x2104, 0xc0cd,
+	0x200a, 0x080c, 0x696e, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
+	0x080c, 0xe5ae, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
+	0x002a, 0x2009, 0x0001, 0x080c, 0x318a, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x2f96, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009,
+	0x007f, 0x080c, 0x32bb, 0x8108, 0x1f04, 0xbcc9, 0x015e, 0x00ce,
+	0x080c, 0xbc88, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001,
+	0x2001, 0x1837, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc,
+	0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001,
+	0x1837, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069,
+	0x181f, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x1820,
+	0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e,
+	0x9105, 0x2009, 0x182c, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008,
+	0x080c, 0x2887, 0x080c, 0x73bc, 0x0170, 0x2071, 0x0260, 0x2069,
+	0x1982, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054,
+	0x680e, 0x080c, 0xcf44, 0x0040, 0x2001, 0x0006, 0x080c, 0x654f,
+	0x080c, 0x31e8, 0x080c, 0xae61, 0x001e, 0x003e, 0x00de, 0x00ee,
+	0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156,
+	0x2019, 0x182c, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200,
+	0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198,
+	0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c,
+	0xbe1d, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006,
+	0x080c, 0xbe1d, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e,
+	0x0005, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8,
+	0x7038, 0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084,
+	0x0f00, 0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac,
+	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
+	0x0096, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2029, 0x19f0, 0x252c, 0x2021, 0x19f6, 0x2424,
+	0x2061, 0x1cd0, 0x2071, 0x1800, 0x7254, 0x7074, 0x9202, 0x1a04,
+	0xbde9, 0x080c, 0x8981, 0x0904, 0xbde2, 0x080c, 0xe5df, 0x0904,
+	0xbde2, 0x6720, 0x9786, 0x0007, 0x0904, 0xbde2, 0x2500, 0x9c06,
+	0x0904, 0xbde2, 0x2400, 0x9c06, 0x05e8, 0x3e08, 0x9186, 0x0002,
+	0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1580, 0x00c6, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c,
+	0x1a5e, 0x9786, 0x000a, 0x0148, 0x080c, 0xcd3b, 0x1130, 0x00ce,
+	0x080c, 0xb813, 0x080c, 0xae92, 0x00e8, 0x6014, 0x2048, 0x080c,
+	0xcb35, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c,
+	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6c75, 0x080c, 0xcd1e, 0x080c,
+	0xae92, 0x00ce, 0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1210, 0x0804,
+	0xbd8c, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce,
+	0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xe551,
+	0x0c30, 0x9786, 0x0009, 0x1148, 0x6000, 0x9086, 0x0004, 0x0d08,
+	0x2009, 0x004c, 0x080c, 0xaedc, 0x08e0, 0x9786, 0x000a, 0x0938,
+	0x0820, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
+	0xbe09, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001,
+	0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016,
+	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
+	0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e,
+	0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e,
+	0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001,
+	0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c,
+	0x810f, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbe47,
+	0x9006, 0x0005, 0x918d, 0x0001, 0x0005, 0x6004, 0x908a, 0x0053,
+	0x1a0c, 0x0dd5, 0x080c, 0xcd2a, 0x0120, 0x080c, 0xcd3b, 0x0168,
+	0x0028, 0x080c, 0x31e8, 0x080c, 0xcd3b, 0x0138, 0x080c, 0x9588,
+	0x080c, 0xae61, 0x080c, 0x968d, 0x0005, 0x080c, 0xb813, 0x0cb0,
+	0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005,
+	0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c,
+	0xbe8c, 0xbe8c, 0xbe8c, 0xbe8e, 0xbe8e, 0xbe8e, 0xbe8e, 0xbe8c,
+	0xbe8c, 0xbe8c, 0xbe8e, 0xbe8c, 0x080c, 0x0dd5, 0x600b, 0xffff,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x968d, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
+	0x9082, 0x0040, 0x0804, 0xbf43, 0x9186, 0x0027, 0x1520, 0x080c,
+	0x9588, 0x080c, 0x31bf, 0x080c, 0xd245, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xcb35, 0x0198, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813,
+	0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c,
+	0xc1c5, 0xa97e, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x009e, 0x080c,
+	0xae61, 0x0804, 0x968d, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082,
+	0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186, 0x0045, 0x0138,
+	0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c, 0x0dd5, 0x2001,
+	0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091, 0x2800, 0x0006,
+	0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6, 0x2079, 0x19e7,
+	0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x8fd5, 0x00ce, 0x00ee,
+	0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000,
+	0x9086, 0x0002, 0x1110, 0x0804, 0xbf81, 0x0005, 0x0002, 0xbf1d,
+	0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b,
+	0xbf1b, 0xbf1b, 0xbf38, 0xbf38, 0xbf38, 0xbf38, 0xbf1b, 0xbf38,
+	0xbf1b, 0xbf38, 0xbf1b, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xcb35, 0x0168, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x6c81,
+	0x080c, 0xcd1e, 0x009e, 0x080c, 0xae61, 0x080c, 0x968d, 0x0005,
+	0x080c, 0x9588, 0x080c, 0xcd3b, 0x090c, 0xb813, 0x080c, 0xae61,
+	0x080c, 0x968d, 0x0005, 0x0002, 0xbf5a, 0xbf58, 0xbf58, 0xbf58,
+	0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf71,
+	0xbf71, 0xbf71, 0xbf71, 0xbf58, 0xbf7b, 0xbf58, 0xbf71, 0xbf58,
+	0x080c, 0x0dd5, 0x0096, 0x080c, 0x9588, 0x6014, 0x2048, 0x2001,
+	0x1988, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140, 0x6003, 0x0004,
+	0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005, 0x6003, 0x0002,
+	0x0cb8, 0x080c, 0x9588, 0x080c, 0xd248, 0x080c, 0xd24d, 0x6003,
+	0x000f, 0x0804, 0x968d, 0x080c, 0x9588, 0x080c, 0xae61, 0x0804,
+	0x968d, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9f, 0xc07c,
+	0xbf9d, 0xc0b0, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d,
+	0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xc0b0, 0x080c, 0x0dd5, 0x00b6,
+	0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff, 0x86ff, 0x1528,
+	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xc06b, 0xa87b, 0x0000,
+	0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xc245, 0x080c, 0x6a9d, 0x6210, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4, 0x1904, 0xc04f,
+	0x080c, 0xae61, 0x009e, 0x00be, 0x0005, 0x968c, 0x0c00, 0x0150,
+	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xc053, 0x7348, 0xab92,
+	0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0508, 0x9186,
+	0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b,
+	0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100, 0x9205,
+	0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206, 0x0118, 0xa992,
+	0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010,
+	0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8,
+	0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804,
+	0xbfa6, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
+	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
+	0x080c, 0xc730, 0x003e, 0xd6cc, 0x0904, 0xbfbb, 0x7154, 0xa98a,
+	0x81ff, 0x0904, 0xbfbb, 0x9192, 0x0021, 0x1278, 0x8304, 0x9098,
+	0x0018, 0x2011, 0x0029, 0x080c, 0xc730, 0x2011, 0x0205, 0x2013,
+	0x0000, 0x080c, 0xd1d5, 0x0804, 0xbfbb, 0xa868, 0xd0fc, 0x0120,
+	0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c, 0xc6cf,
+	0x00ae, 0x080c, 0xd1d5, 0x080c, 0xc720, 0x0804, 0xbfbd, 0x080c,
+	0xce2e, 0x0804, 0xbfca, 0xa87c, 0xd0ac, 0x0904, 0xbfd6, 0xa880,
+	0xd0bc, 0x1904, 0xbfd6, 0x7348, 0xa838, 0x9306, 0x11c8, 0x734c,
+	0xa834, 0x931e, 0x0904, 0xbfd6, 0xd6d4, 0x0190, 0xab38, 0x9305,
+	0x0904, 0xbfd6, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbfae, 0xa838,
+	0xa934, 0x9105, 0x0904, 0xbfae, 0xa880, 0xd0bc, 0x1904, 0xbfae,
+	0x080c, 0xce68, 0x0804, 0xbfca, 0x0096, 0x00f6, 0x6003, 0x0003,
+	0x6007, 0x0043, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
+	0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140, 0x6003, 0x0002, 0x00fe,
+	0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a,
+	0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203, 0x0e90,
+	0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe, 0x6043, 0x0000, 0x2c10,
+	0x080c, 0x1bad, 0x080c, 0x9155, 0x080c, 0x97b9, 0x009e, 0x0005,
+	0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cf, 0xc165,
+	0xc0cd, 0xc0cd, 0xc17c, 0xc208, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd,
+	0xc21d, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd, 0x080c, 0x0dd5, 0x0076,
+	0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x7644,
+	0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff,
+	0x0904, 0xc160, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048,
+	0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xc160, 0x080c,
+	0x0fff, 0x090c, 0x0dd5, 0x2900, 0xb07a, 0xb77c, 0xc7cd, 0xb77e,
+	0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872,
+	0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e,
+	0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118,
+	0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038,
+	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e,
+	0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c,
 	0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008,
-	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc716,
-	0x003e, 0xd6cc, 0x0904, 0xbfa1, 0x7154, 0xa98a, 0x81ff, 0x0904,
-	0xbfa1, 0x9192, 0x0021, 0x1278, 0x8304, 0x9098, 0x0018, 0x2011,
-	0x0029, 0x080c, 0xc716, 0x2011, 0x0205, 0x2013, 0x0000, 0x080c,
-	0xd1bb, 0x0804, 0xbfa1, 0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020,
-	0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c, 0xc6b5, 0x00ae, 0x080c,
-	0xd1bb, 0x080c, 0xc706, 0x0804, 0xbfa3, 0x080c, 0xce14, 0x0804,
-	0xbfb0, 0xa87c, 0xd0ac, 0x0904, 0xbfbc, 0xa880, 0xd0bc, 0x1904,
-	0xbfbc, 0x7348, 0xa838, 0x9306, 0x11c8, 0x734c, 0xa834, 0x931e,
-	0x0904, 0xbfbc, 0xd6d4, 0x0190, 0xab38, 0x9305, 0x0904, 0xbfbc,
-	0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbf94, 0xa838, 0xa934, 0x9105,
-	0x0904, 0xbf94, 0xa880, 0xd0bc, 0x1904, 0xbf94, 0x080c, 0xce4e,
-	0x0804, 0xbfb0, 0x0096, 0x00f6, 0x6003, 0x0003, 0x6007, 0x0043,
-	0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2048,
-	0xa87c, 0xd0ac, 0x0140, 0x6003, 0x0002, 0x00fe, 0x009e, 0x0005,
-	0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0,
-	0x9213, 0x2600, 0x9102, 0x2500, 0x9203, 0x0e90, 0xac36, 0xab3a,
-	0xae46, 0xad4a, 0x00fe, 0x6043, 0x0000, 0x2c10, 0x080c, 0x1bad,
-	0x080c, 0x912c, 0x080c, 0x9790, 0x009e, 0x0005, 0x0005, 0x9182,
-	0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xc0b3,
-	0xc0b3, 0xc0b3, 0xc0b3, 0xc0b3, 0xc0b5, 0xc14b, 0xc0b3, 0xc0b3,
-	0xc162, 0xc1ee, 0xc0b3, 0xc0b3, 0xc0b3, 0xc0b3, 0xc203, 0xc0b3,
-	0xc0b3, 0xc0b3, 0xc0b3, 0x080c, 0x0dd5, 0x0076, 0x00a6, 0x00e6,
-	0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x7644, 0xb676, 0x96b4,
-	0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c,
-	0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xc146,
-	0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c,
-	0xb08e, 0x9284, 0x0300, 0x0904, 0xc146, 0x080c, 0x0fff, 0x090c,
-	0x0dd5, 0x2900, 0xb07a, 0xb77c, 0xc7cd, 0xb77e, 0xa867, 0x0103,
-	0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0xae76, 0x968c,
-	0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff,
-	0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c,
-	0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118,
-	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882,
-	0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff,
-	0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308,
-	0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc716, 0x003e, 0xd6cc,
-	0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260,
-	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc716, 0x2011,
-	0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009,
-	0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xc6b5, 0x009e, 0x00ee,
-	0x00ae, 0x007e, 0x0005, 0x00f6, 0x00a6, 0x6003, 0x0003, 0x2079,
-	0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2050, 0xb436,
-	0xb33a, 0xb646, 0xb54a, 0x00ae, 0x00fe, 0x2c10, 0x080c, 0x1bad,
-	0x0804, 0xa226, 0x6003, 0x0002, 0x6004, 0x9086, 0x0040, 0x11c8,
-	0x0096, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0160, 0x601c, 0xd084,
-	0x1130, 0x00f6, 0x2c00, 0x2078, 0x080c, 0x1725, 0x00fe, 0x6003,
-	0x0004, 0x0010, 0x6003, 0x0002, 0x009e, 0x080c, 0x955f, 0x080c,
-	0x9664, 0x0096, 0x2001, 0x1988, 0x2004, 0x6042, 0x080c, 0x9614,
-	0x080c, 0x9790, 0x6114, 0x2148, 0xa97c, 0xd1e4, 0x0904, 0xc1e9,
-	0xd1cc, 0x05a8, 0xa978, 0xa868, 0xd0fc, 0x0538, 0x0016, 0xa87c,
-	0x0006, 0xa880, 0x0006, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019,
-	0x20a0, 0x810e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184,
-	0xffc0, 0x9080, 0x0019, 0x2098, 0x0156, 0x20a9, 0x0020, 0x4003,
-	0x015e, 0x000e, 0xa882, 0x000e, 0xa87e, 0x001e, 0xa874, 0x0006,
-	0x2148, 0x080c, 0x0fb1, 0x001e, 0x0440, 0x0016, 0x080c, 0x0fb1,
-	0x009e, 0xa974, 0x0016, 0x080c, 0xc706, 0x001e, 0x00f0, 0xa867,
-	0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0180, 0x9086,
-	0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd1dc, 0x0118, 0xa87b,
-	0x0015, 0x0038, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b,
-	0x0000, 0x0016, 0x080c, 0x6a95, 0x001e, 0xd1e4, 0x1120, 0x080c,
-	0xae47, 0x009e, 0x0005, 0x080c, 0xce14, 0x0cd8, 0x6004, 0x9086,
-	0x0040, 0x1120, 0x080c, 0x955f, 0x080c, 0x9664, 0x2019, 0x0001,
-	0x080c, 0xa59c, 0x6003, 0x0002, 0x080c, 0xd233, 0x080c, 0x9614,
-	0x080c, 0x9790, 0x0005, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c,
-	0x955f, 0x080c, 0x9664, 0x2019, 0x0001, 0x080c, 0xa59c, 0x080c,
-	0x9614, 0x080c, 0x31bc, 0x080c, 0xd22b, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xcb1b, 0x0150, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
-	0x0000, 0x080c, 0x6c79, 0x080c, 0xcd04, 0x009e, 0x080c, 0xae47,
-	0x080c, 0x9790, 0x0005, 0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b,
-	0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x0006, 0x0016,
-	0x2009, 0x1a7a, 0x2104, 0x8000, 0x200a, 0x001e, 0x000e, 0xa992,
-	0xa88e, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xc25e, 0xc25e, 0xc25e, 0xc25e, 0xc25e, 0xc260,
-	0xc25e, 0xc25e, 0xc306, 0xc25e, 0xc25e, 0xc25e, 0xc25e, 0xc25e,
-	0xc25e, 0xc25e, 0xc25e, 0xc25e, 0xc25e, 0xc437, 0x080c, 0x0dd5,
-	0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150,
-	0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210,
-	0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be,
-	0x86ff, 0x0904, 0xc2ff, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120,
-	0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xc2ff,
-	0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676,
-	0x0c38, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900, 0xb07a, 0xb77c,
-	0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c,
-	0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000, 0x9635, 0xae76,
-	0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c,
-	0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0xa87b,
-	0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4,
-	0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080,
-	0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86,
-	0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036,
-	0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc716, 0x003e,
-	0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021,
-	0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc716,
-	0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120,
-	0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xc6b5, 0x080c,
-	0x1a3c, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001, 0x1988,
-	0x2004, 0x6042, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105,
-	0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002, 0xa97c, 0xd1e4,
-	0x0904, 0xc432, 0x6043, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xc401, 0xa978, 0xa868,
-	0xd0fc, 0x0904, 0xc3c2, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006,
-	0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904,
-	0xc390, 0x9086, 0x0028, 0x1904, 0xc37c, 0xa87b, 0x001c, 0xb07b,
-	0x001c, 0x0804, 0xc398, 0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34,
-	0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34,
-	0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102,
-	0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026,
-	0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e, 0x00be, 0x9006,
-	0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140,
-	0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e,
-	0x080c, 0xce4e, 0x0804, 0xc432, 0xd1dc, 0x0158, 0xa87b, 0x0015,
-	0xb07b, 0x0015, 0x080c, 0xd0de, 0x0118, 0xb174, 0xc1dc, 0xb176,
-	0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040,
-	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xc22b,
-	0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006,
-	0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019,
-	0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e, 0xa87e, 0x080c,
-	0xd1bb, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fb1, 0x001e,
-	0x0804, 0xc42e, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff,
-	0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b, 0x001c,
-	0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b,
-	0x0015, 0x080c, 0xd0de, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078,
-	0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c,
-	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xc22b, 0xa890,
-	0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fb1,
-	0x009e, 0x080c, 0xd1bb, 0xa974, 0x0016, 0x080c, 0xc706, 0x001e,
-	0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002,
-	0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc,
-	0x0148, 0xa87b, 0x0015, 0x080c, 0xd0de, 0x0118, 0xa974, 0xc1dc,
-	0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b,
-	0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
-	0xc22b, 0xa974, 0x0016, 0x080c, 0x6a95, 0x001e, 0xd1e4, 0x1120,
-	0x080c, 0xae47, 0x009e, 0x0005, 0x080c, 0xce14, 0x0cd8, 0x6114,
-	0x0096, 0x2148, 0xa97c, 0xd1e4, 0x190c, 0x1a4a, 0x009e, 0x0005,
-	0x080c, 0x955f, 0x0010, 0x080c, 0x9614, 0x080c, 0xcb1b, 0x01f0,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xcd21, 0x1118, 0x080c, 0xb7f9,
-	0x00a0, 0xa867, 0x0103, 0x2009, 0x180c, 0x210c, 0xd18c, 0x11b8,
-	0xd184, 0x1190, 0x6108, 0xa97a, 0x918e, 0x0029, 0x1110, 0x080c,
-	0xe8e7, 0xa877, 0x0000, 0x080c, 0x6c79, 0x009e, 0x080c, 0xae47,
-	0x080c, 0x9664, 0x0804, 0x9790, 0xa87b, 0x0004, 0x0c90, 0xa87b,
-	0x0004, 0x0c78, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc490,
-	0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e,
-	0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0xc48e, 0x080c, 0x0dd5,
-	0x080c, 0x56d8, 0x01f8, 0x6014, 0x7144, 0x918c, 0x0fff, 0x9016,
-	0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff, 0x0096, 0x904d, 0x0188,
-	0xa87b, 0x0000, 0xa864, 0x9086, 0x0139, 0x0128, 0xa867, 0x0103,
-	0xa976, 0xaa96, 0x0030, 0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c,
-	0x6c79, 0x009e, 0x0804, 0xae47, 0x9182, 0x0085, 0x0002, 0xc4c6,
-	0xc4c4, 0xc4c4, 0xc4d2, 0xc4c4, 0xc4c4, 0xc4c4, 0xc4c4, 0xc4c4,
-	0xc4c4, 0xc4c4, 0xc4c4, 0xc4c4, 0x080c, 0x0dd5, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x90c7, 0x0126, 0x2091, 0x8000, 0x080c, 0x9664,
-	0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260,
-	0x7224, 0x6216, 0x7220, 0x080c, 0xcb09, 0x01a0, 0x2268, 0x6800,
-	0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6,
-	0x2d60, 0x080c, 0xc741, 0x00ce, 0x0128, 0x6803, 0x0002, 0x6007,
-	0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001, 0x080c, 0x90c7,
-	0x080c, 0x9664, 0x9280, 0x0004, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c,
-	0xce4e, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e, 0x0005, 0x9186,
-	0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a,
-	0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00e2, 0x9186, 0x0027,
-	0x0120, 0x9186, 0x0014, 0x190c, 0x0dd5, 0x080c, 0x955f, 0x0096,
-	0x6014, 0x2048, 0x080c, 0xcb1b, 0x0140, 0xa867, 0x0103, 0xa877,
-	0x0000, 0xa87b, 0x0029, 0x080c, 0x6c79, 0x009e, 0x080c, 0xae78,
-	0x0804, 0x9664, 0xc547, 0xc549, 0xc549, 0xc547, 0xc547, 0xc547,
-	0xc547, 0xc547, 0xc547, 0xc547, 0xc547, 0xc547, 0xc547, 0x080c,
-	0x0dd5, 0x080c, 0x955f, 0x080c, 0xae78, 0x080c, 0x9664, 0x0005,
-	0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x04b8,
-	0x9186, 0x0027, 0x11f8, 0x080c, 0x955f, 0x080c, 0x31bc, 0x080c,
-	0xd22b, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb1b, 0x0150, 0xa867,
-	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6c79, 0x080c,
-	0xcd04, 0x009e, 0x080c, 0xae47, 0x080c, 0x9664, 0x0005, 0x080c,
-	0xaedd, 0x0ce0, 0x9186, 0x0014, 0x1dd0, 0x080c, 0x955f, 0x0096,
-	0x6014, 0x2048, 0x080c, 0xcb1b, 0x0d60, 0xa867, 0x0103, 0xa877,
-	0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882, 0x08f0, 0x0002,
-	0xc59f, 0xc59d, 0xc59d, 0xc59d, 0xc59d, 0xc59d, 0xc5b7, 0xc59d,
-	0xc59d, 0xc59d, 0xc59d, 0xc59d, 0xc59d, 0x080c, 0x0dd5, 0x080c,
-	0x955f, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
-	0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010, 0x2001, 0x1987,
-	0x2004, 0x601a, 0x6003, 0x000c, 0x080c, 0x9664, 0x0005, 0x080c,
-	0x955f, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
-	0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010, 0x2001, 0x1987,
-	0x2004, 0x601a, 0x6003, 0x000e, 0x080c, 0x9664, 0x0005, 0x9182,
-	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x0012, 0x0804, 0xaedd,
-	0xc5e5, 0xc5e5, 0xc5e5, 0xc5e5, 0xc5e7, 0xc634, 0xc5e5, 0xc5e5,
-	0xc5e5, 0xc5e5, 0xc5e5, 0xc5e5, 0xc5e5, 0x080c, 0x0dd5, 0x0096,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034,
+	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc730,
+	0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192,
+	0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c,
+	0xc730, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc,
+	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xc6cf,
+	0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6, 0x00a6, 0x6003,
+	0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014,
+	0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a, 0x00ae, 0x00fe, 0x2c10,
+	0x080c, 0x1bad, 0x0804, 0xa240, 0x6003, 0x0002, 0x6004, 0x9086,
+	0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0160,
+	0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078, 0x080c, 0x1725,
+	0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002, 0x009e, 0x080c,
+	0x9588, 0x080c, 0x968d, 0x0096, 0x2001, 0x1988, 0x2004, 0x6042,
+	0x080c, 0x963d, 0x080c, 0x97b9, 0x6114, 0x2148, 0xa97c, 0xd1e4,
+	0x0904, 0xc203, 0xd1cc, 0x05a8, 0xa978, 0xa868, 0xd0fc, 0x0538,
+	0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0019, 0x20a0, 0x810e, 0x810e, 0x810f, 0x9184, 0x003f,
+	0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019, 0x2098, 0x0156, 0x20a9,
+	0x0020, 0x4003, 0x015e, 0x000e, 0xa882, 0x000e, 0xa87e, 0x001e,
+	0xa874, 0x0006, 0x2148, 0x080c, 0x0fb1, 0x001e, 0x0440, 0x0016,
+	0x080c, 0x0fb1, 0x009e, 0xa974, 0x0016, 0x080c, 0xc720, 0x001e,
+	0x00f0, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002,
+	0x0180, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd1dc,
+	0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4, 0x0118, 0xa87b, 0x0007,
+	0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x6a9d, 0x001e, 0xd1e4,
+	0x1120, 0x080c, 0xae61, 0x009e, 0x0005, 0x080c, 0xce2e, 0x0cd8,
+	0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x9588, 0x080c, 0x968d,
+	0x2019, 0x0001, 0x080c, 0xa5b6, 0x6003, 0x0002, 0x080c, 0xd24d,
+	0x080c, 0x963d, 0x080c, 0x97b9, 0x0005, 0x6004, 0x9086, 0x0040,
+	0x1120, 0x080c, 0x9588, 0x080c, 0x968d, 0x2019, 0x0001, 0x080c,
+	0xa5b6, 0x080c, 0x963d, 0x080c, 0x31bf, 0x080c, 0xd245, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xcb35, 0x0150, 0xa867, 0x0103, 0xa87b,
+	0x0029, 0xa877, 0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x009e,
+	0x080c, 0xae61, 0x080c, 0x97b9, 0x0005, 0xa87b, 0x0015, 0xd1fc,
+	0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000,
+	0x0006, 0x0016, 0x2009, 0x1a7a, 0x2104, 0x8000, 0x200a, 0x001e,
+	0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182,
+	0x0040, 0x0208, 0x000a, 0x0005, 0xc278, 0xc278, 0xc278, 0xc278,
+	0xc278, 0xc27a, 0xc278, 0xc278, 0xc320, 0xc278, 0xc278, 0xc278,
+	0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc451,
+	0x080c, 0x0dd5, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260,
+	0x6114, 0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5,
+	0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
+	0xba3e, 0x00be, 0x86ff, 0x0904, 0xc319, 0x9694, 0xff00, 0x9284,
+	0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300,
+	0x0904, 0xc319, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
+	0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900,
+	0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068,
+	0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000,
+	0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c,
+	0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028,
+	0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015,
+	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
+	0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190,
+	0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019,
+	0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c,
+	0xc730, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8,
+	0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
+	0x080c, 0xc730, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068,
+	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c,
+	0xc6cf, 0x080c, 0x1a3c, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005,
+	0x2001, 0x1988, 0x2004, 0x6042, 0x0096, 0x6114, 0x2148, 0xa83c,
+	0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002,
+	0xa97c, 0xd1e4, 0x0904, 0xc44c, 0x6043, 0x0000, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xc41b,
+	0xa978, 0xa868, 0xd0fc, 0x0904, 0xc3dc, 0x0016, 0xa87c, 0x0006,
+	0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6,
+	0x0002, 0x0904, 0xc3aa, 0x9086, 0x0028, 0x1904, 0xc396, 0xa87b,
+	0x001c, 0xb07b, 0x001c, 0x0804, 0xc3b2, 0x6024, 0xd0f4, 0x11d0,
+	0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120,
+	0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac,
+	0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024,
+	0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e,
+	0x00be, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e,
+	0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c,
+	0x0fb1, 0x009e, 0x080c, 0xce68, 0x0804, 0xc44c, 0xd1dc, 0x0158,
+	0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xd0f8, 0x0118, 0xb174,
+	0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b,
+	0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xc245, 0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020,
+	0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0,
+	0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e,
+	0xa87e, 0x080c, 0xd1d5, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c,
+	0x0fb1, 0x001e, 0x0804, 0xc448, 0x0016, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128,
+	0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b,
+	0x0015, 0xb07b, 0x0015, 0x080c, 0xd0f8, 0x0118, 0xb174, 0xc1dc,
+	0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007,
+	0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xc245, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae,
+	0x080c, 0x0fb1, 0x009e, 0x080c, 0xd1d5, 0xa974, 0x0016, 0x080c,
+	0xc720, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
+	0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xd0f8, 0x0118,
+	0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007,
+	0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xc245, 0xa974, 0x0016, 0x080c, 0x6a9d, 0x001e,
+	0xd1e4, 0x1120, 0x080c, 0xae61, 0x009e, 0x0005, 0x080c, 0xce2e,
+	0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4, 0x190c, 0x1a4a,
+	0x009e, 0x0005, 0x080c, 0x9588, 0x0010, 0x080c, 0x963d, 0x080c,
+	0xcb35, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c, 0xcd3b, 0x1118,
+	0x080c, 0xb813, 0x00a0, 0xa867, 0x0103, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a, 0x918e, 0x0029,
+	0x1110, 0x080c, 0xe908, 0xa877, 0x0000, 0x080c, 0x6c81, 0x009e,
+	0x080c, 0xae61, 0x080c, 0x968d, 0x0804, 0x97b9, 0xa87b, 0x0004,
+	0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054, 0x1220, 0x9182,
+	0x0040, 0x0208, 0x000a, 0x0005, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8,
+	0xc4a8, 0xc4aa, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8,
+	0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8,
+	0x080c, 0x0dd5, 0x080c, 0x56d7, 0x01f8, 0x6014, 0x7144, 0x918c,
+	0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff, 0x0096,
+	0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086, 0x0139, 0x0128,
+	0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897, 0x4000, 0xa99a,
+	0xaa9e, 0x080c, 0x6c81, 0x009e, 0x0804, 0xae61, 0x9182, 0x0085,
+	0x0002, 0xc4e0, 0xc4de, 0xc4de, 0xc4ec, 0xc4de, 0xc4de, 0xc4de,
+	0xc4de, 0xc4de, 0xc4de, 0xc4de, 0xc4de, 0xc4de, 0x080c, 0x0dd5,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x968d, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6,
+	0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xcb23, 0x01a0,
+	0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e,
+	0x1158, 0x00c6, 0x2d60, 0x080c, 0xc75b, 0x00ce, 0x0128, 0x6803,
+	0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001,
+	0x080c, 0x90f0, 0x080c, 0x968d, 0x9280, 0x0004, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6,
+	0x2260, 0x080c, 0xce68, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e,
+	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
+	0x0dd5, 0x908a, 0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00e2,
+	0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0dd5, 0x080c,
+	0x9588, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0140, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6c81, 0x009e,
+	0x080c, 0xae92, 0x0804, 0x968d, 0xc561, 0xc563, 0xc563, 0xc561,
+	0xc561, 0xc561, 0xc561, 0xc561, 0xc561, 0xc561, 0xc561, 0xc561,
+	0xc561, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c,
+	0x968d, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085,
+	0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c, 0x9588, 0x080c,
+	0x31bf, 0x080c, 0xd245, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35,
+	0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
+	0x6c81, 0x080c, 0xcd1e, 0x009e, 0x080c, 0xae61, 0x080c, 0x968d,
+	0x0005, 0x080c, 0xaef7, 0x0ce0, 0x9186, 0x0014, 0x1dd0, 0x080c,
+	0x9588, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0d60, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882,
+	0x08f0, 0x0002, 0xc5b9, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7,
+	0xc5d1, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0x080c,
+	0x0dd5, 0x080c, 0x9588, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010,
+	0x2001, 0x1987, 0x2004, 0x601a, 0x6003, 0x000c, 0x080c, 0x968d,
+	0x0005, 0x080c, 0x9588, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010,
+	0x2001, 0x1987, 0x2004, 0x601a, 0x6003, 0x000e, 0x080c, 0x968d,
+	0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x0012,
+	0x0804, 0xaef7, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc601, 0xc64e,
+	0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0x080c,
+	0x0dd5, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xc662, 0x080c, 0xcb35,
+	0x1118, 0x080c, 0xcd1e, 0x0068, 0x6014, 0x2048, 0xa87c, 0xd0e4,
+	0x1110, 0x080c, 0xcd1e, 0xa867, 0x0103, 0x080c, 0xd210, 0x080c,
+	0x6c81, 0x00d6, 0x2c68, 0x080c, 0xae0b, 0x01d0, 0x6003, 0x0001,
+	0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c, 0x613a,
+	0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c, 0xcfaa,
+	0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x90f0, 0x080c, 0x968d,
+	0x2d60, 0x00de, 0x080c, 0xae61, 0x009e, 0x0005, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, 0x0118, 0x9186,
+	0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xd1a8, 0x11f0, 0x080c,
+	0xae0b, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001, 0x6910,
+	0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c, 0x00ff,
+	0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954, 0x6156, 0x080c,
+	0xcfaa, 0x080c, 0x90f0, 0x080c, 0x968d, 0x2d60, 0x00de, 0x0804,
+	0xae61, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35, 0x01c8, 0xa867,
+	0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006,
+	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
+	0x080c, 0xce2a, 0xa877, 0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e,
+	0x009e, 0x0804, 0xae61, 0x0016, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xcb35, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877, 0x0000,
+	0x080c, 0x6c81, 0x009e, 0x001e, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaef7, 0x0030,
+	0x080c, 0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005, 0x0056,
+	0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208,
+	0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009,
+	0x0020, 0x2011, 0x0029, 0x080c, 0xc730, 0x96b2, 0x0020, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0fb1, 0x080c, 0x0fff, 0x0520, 0x8528,
+	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
+	0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c,
+	0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566,
+	0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
+	0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005,
+	0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000,
+	0x080c, 0x6c81, 0x2a48, 0x0cb8, 0x080c, 0x6c81, 0x00ae, 0x0005,
+	0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184,
+	0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c,
+	0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003,
+	0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098,
+	0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817,
+	0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031,
+	0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084,
+	0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xc796, 0xc796, 0xc791,
+	0xc7b8, 0xc784, 0xc791, 0xc7b8, 0xc791, 0xc784, 0x8ed9, 0xc791,
+	0xc791, 0xc791, 0xc784, 0xc784, 0x080c, 0x0dd5, 0x0036, 0x2019,
+	0x0010, 0x080c, 0xe134, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e,
+	0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff,
+	0x11d8, 0x6014, 0x2048, 0x080c, 0xcb35, 0x01c0, 0xa864, 0x9086,
+	0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6ec0, 0x080c, 0xce2a, 0x080c, 0x6c75,
+	0x080c, 0xae92, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xc7ce, 0xc7fc,
+	0xc7d0, 0xc81d, 0xc7f7, 0xc7ce, 0xc791, 0xc796, 0xc796, 0xc791,
+	0xc791, 0xc791, 0xc791, 0xc791, 0xc791, 0xc791, 0x080c, 0x0dd5,
+	0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xcb35, 0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0x080c, 0xce2a, 0x009e,
+	0x080c, 0xd1ea, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x90f0, 0x080c, 0x968d, 0x9085, 0x0001, 0x0005, 0x0066,
+	0x080c, 0x1a5e, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19e7, 0x7024,
+	0x9c06, 0x1120, 0x080c, 0xa540, 0x00ee, 0x0850, 0x6020, 0x9084,
+	0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001,
+	0x2c40, 0x080c, 0xa69c, 0x009e, 0x008e, 0x0010, 0x080c, 0xa43d,
+	0x00ee, 0x1904, 0xc7d0, 0x0804, 0xc791, 0x0036, 0x00e6, 0x2071,
+	0x19e7, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c, 0xa5b6, 0x00ee,
+	0x003e, 0x0804, 0xc7d0, 0x080c, 0xa7cc, 0x00ee, 0x003e, 0x1904,
+	0xc7d0, 0x0804, 0xc791, 0x00c6, 0x6020, 0x9084, 0x000f, 0x0013,
+	0x00ce, 0x0005, 0xc850, 0xc919, 0xca80, 0xc85a, 0xae92, 0xc850,
+	0xe126, 0xd252, 0xc919, 0x8eab, 0xcaff, 0xc849, 0xc849, 0xc849,
+	0xc849, 0x080c, 0x0dd5, 0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813,
+	0x0005, 0x080c, 0x9588, 0x080c, 0x968d, 0x0804, 0xae61, 0x601b,
+	0x0001, 0x0005, 0x080c, 0xcb35, 0x0130, 0x6014, 0x0096, 0x2048,
+	0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5,
+	0x0002, 0xc879, 0xc87b, 0xc89f, 0xc8b3, 0xc8d7, 0xc879, 0xc850,
+	0xc850, 0xc850, 0xc8b3, 0xc8b3, 0xc879, 0xc879, 0xc879, 0xc879,
+	0xc8bd, 0x080c, 0x0dd5, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x2071, 0x19e7, 0x7024, 0x9c06, 0x01a0,
+	0x080c, 0xa43d, 0x080c, 0xd1ea, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2001, 0x1987, 0x2004, 0x601a, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xd1ea,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x0005, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048,
+	0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x56d7, 0x01a8,
+	0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0x080c, 0x6c81, 0x009e, 0x0804, 0xae61, 0x6014,
+	0x0096, 0x904d, 0x05c8, 0xa97c, 0xd1e4, 0x05b0, 0x2001, 0x180f,
+	0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0030, 0x2c08, 0x080c,
+	0x15ee, 0x2001, 0x030c, 0x2004, 0x9086, 0x0041, 0x11a0, 0x6014,
+	0x0096, 0x904d, 0x090c, 0x0dd5, 0xa880, 0xd0f4, 0x1130, 0xc0f5,
+	0xa882, 0x009e, 0x601b, 0x0002, 0x0070, 0x009e, 0x2001, 0x0037,
+	0x2c08, 0x080c, 0x15ee, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009,
+	0x0048, 0x080c, 0xaedc, 0x0005, 0x009e, 0x080c, 0x1a5e, 0x0804,
+	0xc89f, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x000b, 0x0005,
+	0xc930, 0xc857, 0xc932, 0xc930, 0xc932, 0xc932, 0xc851, 0xc930,
+	0xc84b, 0xc84b, 0xc930, 0xc930, 0xc930, 0xc930, 0xc930, 0xc930,
+	0x080c, 0x0dd5, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff,
+	0x00be, 0x908a, 0x000c, 0x1a0c, 0x0dd5, 0x00b6, 0x0013, 0x00be,
+	0x0005, 0xc94d, 0xca1a, 0xc94f, 0xc98f, 0xc94f, 0xc98f, 0xc94f,
+	0xc95d, 0xc94d, 0xc98f, 0xc94d, 0xc97e, 0x080c, 0x0dd5, 0x6004,
+	0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002,
+	0x0590, 0x908e, 0x0052, 0x0904, 0xca16, 0x6004, 0x080c, 0xcd3b,
+	0x0904, 0xca33, 0x908e, 0x0004, 0x1110, 0x080c, 0x31e8, 0x908e,
+	0x0021, 0x0904, 0xca37, 0x908e, 0x0022, 0x0904, 0xca7b, 0x908e,
+	0x003d, 0x0904, 0xca37, 0x908e, 0x0039, 0x0904, 0xca3b, 0x908e,
+	0x0035, 0x0904, 0xca3b, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001,
+	0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x0110, 0x080c, 0x31bf, 0x080c, 0xb813, 0x0804, 0xae92, 0x00c6,
+	0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xca07, 0x9186, 0x0002,
+	0x1904, 0xc9dc, 0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c,
+	0x73bc, 0x11b0, 0x080c, 0xd230, 0x0138, 0x080c, 0x73df, 0x1120,
+	0x080c, 0x72cc, 0x0804, 0xca64, 0x2001, 0x197d, 0x2003, 0x0001,
+	0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x72ee, 0x0804, 0xca64,
+	0x6010, 0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904, 0xca64,
+	0xb8a0, 0x9084, 0xff80, 0x1904, 0xca64, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007,
+	0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0xae0b, 0x0128, 0x2b00,
+	0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e,
+	0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170,
+	0x2009, 0x1837, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x5fad, 0x00ee, 0x080c, 0xb813, 0x0030, 0x080c, 0xb813,
+	0x080c, 0x31bf, 0x080c, 0xd245, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x31e8, 0x012e, 0x00ee, 0x080c, 0xae92, 0x0005, 0x2001,
+	0x0002, 0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x31e8,
+	0x0804, 0xc98b, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38,
+	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xc9dc,
+	0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c, 0x968d,
+	0x00de, 0x00ce, 0x0898, 0x080c, 0xb813, 0x0804, 0xc98d, 0x080c,
+	0xb84f, 0x0804, 0xc98d, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xd1a8,
+	0x00de, 0x0118, 0x080c, 0xae61, 0x00f0, 0x6004, 0x8007, 0x6134,
+	0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1987, 0x2004, 0x601a,
+	0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c,
+	0x90f0, 0x080c, 0x968d, 0x0005, 0x00de, 0x00ce, 0x080c, 0xb813,
+	0x080c, 0x31bf, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x31e8,
+	0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000,
+	0x012e, 0x00ee, 0x0005, 0x080c, 0xb291, 0x1904, 0xca33, 0x0005,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x00d6, 0x001b,
+	0x00de, 0x009e, 0x0005, 0xca9b, 0xca9b, 0xca9b, 0xca9b, 0xca9b,
+	0xca9b, 0xca9b, 0xca9b, 0xca9b, 0xc850, 0xca9b, 0xc857, 0xca9d,
+	0xc857, 0xcaaa, 0xca9b, 0x080c, 0x0dd5, 0x6004, 0x9086, 0x008b,
+	0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x080c, 0x90f0, 0x080c,
+	0x968d, 0x0005, 0x080c, 0xd224, 0x0118, 0x080c, 0xd237, 0x0010,
+	0x080c, 0xd245, 0x080c, 0xcd1e, 0x080c, 0xcb35, 0x0570, 0x080c,
+	0x31bf, 0x080c, 0xcb35, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103,
+	0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c,
+	0x6c81, 0x2c68, 0x080c, 0xae0b, 0x0150, 0x6810, 0x6012, 0x080c,
+	0xcfaa, 0x00c6, 0x2d60, 0x080c, 0xae92, 0x00ce, 0x0008, 0x2d60,
+	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x9138, 0x080c, 0x968d, 0x00c8, 0x080c, 0xd224, 0x0138,
+	0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x31bf, 0x08d0, 0x6034,
 	0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035,
-	0x1118, 0x009e, 0x0804, 0xc648, 0x080c, 0xcb1b, 0x1118, 0x080c,
-	0xcd04, 0x0068, 0x6014, 0x2048, 0xa87c, 0xd0e4, 0x1110, 0x080c,
-	0xcd04, 0xa867, 0x0103, 0x080c, 0xd1f6, 0x080c, 0x6c79, 0x00d6,
-	0x2c68, 0x080c, 0xadf1, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e,
-	0x600b, 0xffff, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f,
-	0x210c, 0x613e, 0x6910, 0x6112, 0x080c, 0xcf90, 0x6954, 0x6156,
-	0x6023, 0x0001, 0x080c, 0x90c7, 0x080c, 0x9664, 0x2d60, 0x00de,
-	0x080c, 0xae47, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
-	0x0035, 0x0130, 0x9186, 0x001e, 0x0118, 0x9186, 0x0039, 0x1538,
-	0x00d6, 0x2c68, 0x080c, 0xd18e, 0x11f0, 0x080c, 0xadf1, 0x01d8,
-	0x6106, 0x6003, 0x0001, 0x6023, 0x0001, 0x6910, 0x6112, 0x692c,
-	0x612e, 0x6930, 0x6132, 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938,
-	0x613a, 0x693c, 0x613e, 0x6954, 0x6156, 0x080c, 0xcf90, 0x080c,
-	0x90c7, 0x080c, 0x9664, 0x2d60, 0x00de, 0x0804, 0xae47, 0x0096,
-	0x6014, 0x2048, 0x080c, 0xcb1b, 0x01c8, 0xa867, 0x0103, 0xa880,
-	0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc,
-	0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xce10,
-	0xa877, 0x0000, 0x080c, 0x6c79, 0x080c, 0xcd04, 0x009e, 0x0804,
-	0xae47, 0x0016, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb1b, 0x0140,
-	0xa867, 0x0103, 0xa87b, 0x0028, 0xa877, 0x0000, 0x080c, 0x6c79,
-	0x009e, 0x001e, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014, 0x0130,
-	0x9186, 0x0027, 0x0118, 0x080c, 0xaedd, 0x0030, 0x080c, 0x955f,
-	0x080c, 0xae78, 0x080c, 0x9664, 0x0005, 0x0056, 0x0066, 0x0096,
-	0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208, 0x0010, 0x2009,
-	0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009, 0x0020, 0x2011,
-	0x0029, 0x080c, 0xc716, 0x96b2, 0x0020, 0xb004, 0x904d, 0x0110,
-	0x080c, 0x0fb1, 0x080c, 0x0fff, 0x0520, 0x8528, 0xa867, 0x0110,
-	0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1228, 0x2608,
-	0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c, 0x2009, 0x003c,
-	0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x95ac, 0x0000,
-	0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
-	0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005, 0x00a6, 0x89ff,
-	0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000, 0x080c, 0x6c79,
-	0x2a48, 0x0cb8, 0x080c, 0x6c79, 0x00ae, 0x0005, 0x00f6, 0x2079,
-	0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184, 0x0108, 0x8108,
-	0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c, 0x9200, 0x20a0,
-	0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003, 0x8318, 0x9386,
-	0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098, 0x7814, 0x8000,
-	0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817, 0x0000, 0x00fe,
-	0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031, 0x0001, 0x6020,
-	0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084, 0x000f, 0x001b,
-	0x006e, 0x012e, 0x0005, 0xc77c, 0xc77c, 0xc777, 0xc79e, 0xc76a,
-	0xc777, 0xc79e, 0xc777, 0xc76a, 0x8eb0, 0xc777, 0xc777, 0xc777,
-	0xc76a, 0xc76a, 0x080c, 0x0dd5, 0x0036, 0x2019, 0x0010, 0x080c,
-	0xe115, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x9006,
-	0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11d8, 0x6014,
-	0x2048, 0x080c, 0xcb1b, 0x01c0, 0xa864, 0x9086, 0x0139, 0x1128,
-	0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e, 0x2001, 0x0005,
-	0x080c, 0x6eb8, 0x080c, 0xce10, 0x080c, 0x6c6d, 0x080c, 0xae78,
-	0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0, 0x6000, 0x908a,
-	0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xc7b4, 0xc7e2, 0xc7b6, 0xc803,
-	0xc7dd, 0xc7b4, 0xc777, 0xc77c, 0xc77c, 0xc777, 0xc777, 0xc777,
-	0xc777, 0xc777, 0xc777, 0xc777, 0x080c, 0x0dd5, 0x86ff, 0x1510,
-	0x6020, 0x9086, 0x0006, 0x01f0, 0x0096, 0x6014, 0x2048, 0x080c,
-	0xcb1b, 0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
-	0x080c, 0x0fb1, 0x009e, 0x080c, 0xce10, 0x009e, 0x080c, 0xd1d0,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90c7,
-	0x080c, 0x9664, 0x9085, 0x0001, 0x0005, 0x0066, 0x080c, 0x1a5e,
-	0x006e, 0x08a0, 0x00e6, 0x2071, 0x19e7, 0x7024, 0x9c06, 0x1120,
-	0x080c, 0xa526, 0x00ee, 0x0850, 0x6020, 0x9084, 0x000f, 0x9086,
-	0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c,
-	0xa682, 0x009e, 0x008e, 0x0010, 0x080c, 0xa423, 0x00ee, 0x1904,
-	0xc7b6, 0x0804, 0xc777, 0x0036, 0x00e6, 0x2071, 0x19e7, 0x703c,
-	0x9c06, 0x1138, 0x901e, 0x080c, 0xa59c, 0x00ee, 0x003e, 0x0804,
-	0xc7b6, 0x080c, 0xa7b2, 0x00ee, 0x003e, 0x1904, 0xc7b6, 0x0804,
-	0xc777, 0x00c6, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce, 0x0005,
-	0xc836, 0xc8ff, 0xca66, 0xc840, 0xae78, 0xc836, 0xe107, 0xd238,
-	0xc8ff, 0x8e82, 0xcae5, 0xc82f, 0xc82f, 0xc82f, 0xc82f, 0x080c,
-	0x0dd5, 0x080c, 0xcd21, 0x1110, 0x080c, 0xb7f9, 0x0005, 0x080c,
-	0x955f, 0x080c, 0x9664, 0x0804, 0xae47, 0x601b, 0x0001, 0x0005,
-	0x080c, 0xcb1b, 0x0130, 0x6014, 0x0096, 0x2048, 0x2c00, 0xa896,
-	0x009e, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xc85f,
-	0xc861, 0xc885, 0xc899, 0xc8bd, 0xc85f, 0xc836, 0xc836, 0xc836,
-	0xc899, 0xc899, 0xc85f, 0xc85f, 0xc85f, 0xc85f, 0xc8a3, 0x080c,
-	0x0dd5, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5, 0xa882,
-	0x009e, 0x2071, 0x19e7, 0x7024, 0x9c06, 0x01a0, 0x080c, 0xa423,
-	0x080c, 0xd1d0, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
-	0x2001, 0x1987, 0x2004, 0x601a, 0x080c, 0x90c7, 0x080c, 0x9664,
-	0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048,
-	0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xd1d0, 0x6007, 0x0085,
-	0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90c7, 0x080c, 0x9664,
-	0x0005, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5,
-	0xa882, 0x009e, 0x0005, 0x080c, 0x56d8, 0x01a8, 0x6014, 0x0096,
-	0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086,
-	0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005, 0xa89b, 0x0004,
-	0x080c, 0x6c79, 0x009e, 0x0804, 0xae47, 0x6014, 0x0096, 0x904d,
-	0x05c8, 0xa97c, 0xd1e4, 0x05b0, 0x2001, 0x180f, 0x2004, 0xd0c4,
-	0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003, 0x800b, 0x810b,
-	0x9108, 0x611a, 0x2001, 0x0030, 0x2c08, 0x080c, 0x15ee, 0x2001,
-	0x030c, 0x2004, 0x9086, 0x0041, 0x11a0, 0x6014, 0x0096, 0x904d,
-	0x090c, 0x0dd5, 0xa880, 0xd0f4, 0x1130, 0xc0f5, 0xa882, 0x009e,
-	0x601b, 0x0002, 0x0070, 0x009e, 0x2001, 0x0037, 0x2c08, 0x080c,
-	0x15ee, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c,
-	0xaec2, 0x0005, 0x009e, 0x080c, 0x1a5e, 0x0804, 0xc885, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x000b, 0x0005, 0xc916, 0xc83d,
-	0xc918, 0xc916, 0xc918, 0xc918, 0xc837, 0xc916, 0xc831, 0xc831,
-	0xc916, 0xc916, 0xc916, 0xc916, 0xc916, 0xc916, 0x080c, 0x0dd5,
-	0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a,
-	0x000c, 0x1a0c, 0x0dd5, 0x00b6, 0x0013, 0x00be, 0x0005, 0xc933,
-	0xca00, 0xc935, 0xc975, 0xc935, 0xc975, 0xc935, 0xc943, 0xc933,
-	0xc975, 0xc933, 0xc964, 0x080c, 0x0dd5, 0x6004, 0x908e, 0x0016,
-	0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e,
-	0x0052, 0x0904, 0xc9fc, 0x6004, 0x080c, 0xcd21, 0x0904, 0xca19,
-	0x908e, 0x0004, 0x1110, 0x080c, 0x31e1, 0x908e, 0x0021, 0x0904,
-	0xca1d, 0x908e, 0x0022, 0x0904, 0xca61, 0x908e, 0x003d, 0x0904,
-	0xca1d, 0x908e, 0x0039, 0x0904, 0xca21, 0x908e, 0x0035, 0x0904,
-	0xca21, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010,
-	0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c,
-	0x31bc, 0x080c, 0xb7f9, 0x0804, 0xae78, 0x00c6, 0x00d6, 0x6104,
-	0x9186, 0x0016, 0x0904, 0xc9ed, 0x9186, 0x0002, 0x1904, 0xc9c2,
-	0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x73b0, 0x11b0,
-	0x080c, 0xd216, 0x0138, 0x080c, 0x73d3, 0x1120, 0x080c, 0x72c0,
-	0x0804, 0xca4a, 0x2001, 0x197d, 0x2003, 0x0001, 0x2001, 0x1800,
-	0x2003, 0x0001, 0x080c, 0x72e2, 0x0804, 0xca4a, 0x6010, 0x2058,
-	0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904, 0xca4a, 0xb8a0, 0x9084,
-	0xff80, 0x1904, 0xca4a, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190,
-	0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
-	0x6043, 0x0000, 0x080c, 0xadf1, 0x0128, 0x2b00, 0x6012, 0x6023,
-	0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0,
-	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1837,
-	0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5fae,
-	0x00ee, 0x080c, 0xb7f9, 0x0030, 0x080c, 0xb7f9, 0x080c, 0x31bc,
-	0x080c, 0xd22b, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x31e1,
-	0x012e, 0x00ee, 0x080c, 0xae78, 0x0005, 0x2001, 0x0002, 0x080c,
-	0x6550, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x910f, 0x080c,
-	0x9664, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x31e1, 0x0804, 0xc971,
-	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058,
-	0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xc9c2, 0x8001, 0xb842,
-	0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664, 0x00de, 0x00ce,
-	0x0898, 0x080c, 0xb7f9, 0x0804, 0xc973, 0x080c, 0xb835, 0x0804,
-	0xc973, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xd18e, 0x00de, 0x0118,
-	0x080c, 0xae47, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c, 0x00ff,
-	0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
-	0x603c, 0x600a, 0x2001, 0x1987, 0x2004, 0x601a, 0x602c, 0x2c08,
-	0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c, 0x90c7, 0x080c,
-	0x9664, 0x0005, 0x00de, 0x00ce, 0x080c, 0xb7f9, 0x080c, 0x31bc,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x31e1, 0x6017, 0x0000,
-	0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x012e, 0x00ee,
-	0x0005, 0x080c, 0xb277, 0x1904, 0xca19, 0x0005, 0x6000, 0x908a,
-	0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e,
-	0x0005, 0xca81, 0xca81, 0xca81, 0xca81, 0xca81, 0xca81, 0xca81,
-	0xca81, 0xca81, 0xc836, 0xca81, 0xc83d, 0xca83, 0xc83d, 0xca90,
-	0xca81, 0x080c, 0x0dd5, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007,
-	0x008b, 0x6003, 0x000d, 0x080c, 0x90c7, 0x080c, 0x9664, 0x0005,
-	0x080c, 0xd20a, 0x0118, 0x080c, 0xd21d, 0x0010, 0x080c, 0xd22b,
-	0x080c, 0xcd04, 0x080c, 0xcb1b, 0x0570, 0x080c, 0x31bc, 0x080c,
-	0xcb1b, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006,
-	0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6c79, 0x2c68,
-	0x080c, 0xadf1, 0x0150, 0x6810, 0x6012, 0x080c, 0xcf90, 0x00c6,
-	0x2d60, 0x080c, 0xae78, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000,
-	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x910f,
-	0x080c, 0x9664, 0x00c8, 0x080c, 0xd20a, 0x0138, 0x6034, 0x9086,
-	0x4000, 0x1118, 0x080c, 0x31bc, 0x08d0, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c,
-	0x31bc, 0x0868, 0x080c, 0xae78, 0x0005, 0x6000, 0x908a, 0x0016,
-	0x1a0c, 0x0dd5, 0x0002, 0xcafb, 0xcafb, 0xcafd, 0xcafd, 0xcafd,
-	0xcafb, 0xcafb, 0xae78, 0xcafb, 0xcafb, 0xcafb, 0xcafb, 0xcafb,
-	0xcafb, 0xcafb, 0xcafb, 0x080c, 0x0dd5, 0x080c, 0xa7b2, 0x6114,
-	0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6c79, 0x009e, 0x0804,
-	0xae47, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0, 0x0240, 0x2001,
-	0x181a, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
-	0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e,
-	0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x10aa,
-	0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7354, 0x7074,
-	0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xd216, 0x0180,
-	0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c,
-	0x31bc, 0x080c, 0xd22b, 0x00c6, 0x080c, 0xae78, 0x00ce, 0x0060,
-	0x080c, 0xcf0a, 0x0148, 0x080c, 0xcd21, 0x1110, 0x080c, 0xb7f9,
-	0x00c6, 0x080c, 0xae47, 0x00ce, 0x9ce0, 0x0018, 0x7068, 0x9c02,
-	0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005,
-	0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128,
-	0x2061, 0x1ab0, 0x6112, 0x080c, 0x31bc, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0xadf1, 0x01b0, 0x6656, 0x2b00, 0x6012, 0x080c,
-	0x56d8, 0x0118, 0x080c, 0xcc48, 0x0168, 0x080c, 0xcf90, 0x6023,
-	0x0003, 0x2009, 0x004b, 0x080c, 0xaec2, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0xbaa0, 0x080c, 0xae95, 0x0560, 0x6057, 0x0000, 0x2b00, 0x6012,
-	0x080c, 0xcf90, 0x6023, 0x0003, 0x0016, 0x080c, 0x9262, 0x0076,
-	0x903e, 0x080c, 0x913f, 0x2c08, 0x080c, 0xe2ca, 0x007e, 0x001e,
-	0xd184, 0x0128, 0x080c, 0xae47, 0x9085, 0x0001, 0x0070, 0x080c,
-	0x56d8, 0x0128, 0xd18c, 0x1170, 0x080c, 0xcc48, 0x0148, 0x2009,
-	0x004c, 0x080c, 0xaec2, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d, 0x0010,
-	0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c, 0xadf1,
-	0x2c78, 0x0590, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021,
-	0x0005, 0x080c, 0xcc5a, 0x9186, 0x004d, 0x0118, 0x9186, 0x004e,
-	0x0148, 0x2001, 0x1980, 0x200c, 0xd1fc, 0x0168, 0x2f60, 0x080c,
-	0xae47, 0x00d0, 0x2001, 0x197f, 0x200c, 0xd1fc, 0x0120, 0x2f60,
-	0x080c, 0xae47, 0x0088, 0x2f60, 0x080c, 0x56d8, 0x0138, 0xd18c,
-	0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e, 0x0016,
-	0x080c, 0xaec2, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe,
-	0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0xadf1, 0x2c78, 0x0508,
-	0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021, 0x0004,
-	0x0489, 0x009e, 0x2001, 0x197e, 0x200c, 0xd1fc, 0x0120, 0x2f60,
-	0x080c, 0xae47, 0x0060, 0x2f60, 0x080c, 0x56d8, 0x0120, 0xd18c,
-	0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0xaec2, 0x9085,
-	0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98,
-	0x00c6, 0x080c, 0x4aa5, 0x00ce, 0x1120, 0x080c, 0xae47, 0x9006,
-	0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016, 0x9085,
-	0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6734, 0x0158, 0x2001, 0xcc5f, 0x0006, 0x900e, 0x2400, 0x080c,
-	0x6eb8, 0x080c, 0x6c79, 0x000e, 0x0807, 0x2418, 0x080c, 0x94f9,
-	0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x080c,
-	0x927a, 0x008e, 0x080c, 0x913f, 0x2f08, 0x2648, 0x080c, 0xe2ca,
-	0xb93c, 0x81ff, 0x090c, 0x934b, 0x080c, 0x9664, 0x012e, 0x007e,
-	0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xadf1,
-	0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcf90, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0xaec2, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0xae95, 0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c,
-	0xcf90, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c,
-	0x1725, 0x00fe, 0x2009, 0x0021, 0x080c, 0xaec2, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6,
-	0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0xadf1, 0x0198, 0x660a,
-	0x2b08, 0x6112, 0x080c, 0xcf90, 0x6023, 0x0001, 0x2900, 0x6016,
-	0x001e, 0x0016, 0x080c, 0xaec2, 0x9085, 0x0001, 0x001e, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xae95, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcf90, 0x6023,
-	0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0xaec2, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044,
-	0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210, 0x2258,
-	0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x002e, 0x0005,
-	0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140, 0x908e, 0x0003,
-	0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e,
-	0x0005, 0x0006, 0x0096, 0x6020, 0x9086, 0x0004, 0x0190, 0x6014,
-	0x904d, 0x080c, 0xcb1b, 0x0168, 0xa864, 0x9086, 0x0139, 0x0158,
-	0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xae95, 0x0198, 0x2b08, 0x6112, 0x080c,
-	0xcf90, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c, 0x31bc, 0x2009,
-	0x0028, 0x080c, 0xaec2, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011, 0x1824, 0x2204,
-	0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xba4b, 0x00be, 0x080c,
-	0xbc6e, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x910f, 0x080c,
-	0x9664, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc,
-	0x0148, 0x2001, 0x0001, 0x080c, 0xd14f, 0x080c, 0xb7f9, 0x080c,
-	0xae47, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c, 0x0dd5, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
-	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e, 0x009e,
-	0x080c, 0xae47, 0x0c30, 0x0096, 0x9186, 0x0016, 0x1128, 0x2001,
-	0x0004, 0x080c, 0x6550, 0x00e8, 0x9186, 0x0015, 0x1510, 0x2011,
-	0x1824, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6, 0x2058,
-	0x080c, 0x669b, 0x00be, 0x080c, 0xbd3f, 0x1198, 0x6010, 0x00b6,
-	0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001, 0x0006, 0x080c,
-	0x6550, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c, 0xb24b,
-	0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c, 0xb7f9,
-	0x080c, 0xae47, 0x009e, 0x0005, 0x6014, 0x6310, 0x2358, 0x904d,
-	0x090c, 0x0dd5, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0x900e, 0x080c, 0x6820, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e,
-	0x080c, 0xae47, 0x08f8, 0x6014, 0x904d, 0x090c, 0x0dd5, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
-	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c79, 0x012e, 0x080c,
-	0xae47, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108, 0x0009, 0x0005,
-	0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043, 0x0000, 0x6017, 0x0000,
-	0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x90c7, 0x080c, 0x9664,
-	0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0120, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce, 0x0005, 0xc836,
-	0xce40, 0xce40, 0xce43, 0xe5dc, 0xe5f7, 0xe5fa, 0xc836, 0xc836,
-	0xc836, 0xc836, 0xc836, 0xc836, 0xc836, 0xc836, 0x080c, 0x0dd5,
-	0xa001, 0xa001, 0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c,
-	0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001, 0x1834, 0x2004,
-	0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c, 0xadf1, 0x0508, 0x7810,
-	0x6012, 0x080c, 0xcf90, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808,
-	0x603a, 0x2f00, 0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a,
-	0x602e, 0x6023, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x7954,
-	0x6156, 0x080c, 0x90c7, 0x080c, 0x9664, 0x2f60, 0x00fe, 0x0005,
-	0x2f60, 0x00fe, 0x2001, 0x1988, 0x2004, 0x6042, 0x0005, 0x0016,
-	0x0096, 0x6814, 0x2048, 0xa87c, 0xd0e4, 0x0180, 0xc0e4, 0xa87e,
-	0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000, 0xd0cc, 0x0130,
-	0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x6830, 0x6036,
-	0x908e, 0x0001, 0x0148, 0x6803, 0x0002, 0x9086, 0x0005, 0x0170,
-	0x9006, 0x602e, 0x6032, 0x00d0, 0x681c, 0xc085, 0x681e, 0x6803,
-	0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00, 0x6826, 0x6814, 0x2048,
-	0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c, 0x9103, 0x1e48, 0x683c,
-	0x602e, 0x6838, 0x9084, 0xfffc, 0x683a, 0x6032, 0x2d00, 0x603a,
-	0x6808, 0x603e, 0x6910, 0x6112, 0x6954, 0x6156, 0x6023, 0x0001,
-	0x6007, 0x0039, 0x6003, 0x0001, 0x080c, 0x90c7, 0x080c, 0x9664,
-	0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4, 0x0510, 0xd0f4, 0x11f8,
-	0x6038, 0x940a, 0x603c, 0x9303, 0x0230, 0x9105, 0x0120, 0x6024,
-	0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e, 0xac3e, 0xab42, 0x0046,
-	0x0036, 0x2400, 0xacac, 0x9402, 0xa836, 0x2300, 0xabb0, 0x9303,
-	0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4, 0x0000, 0x6026, 0x0005,
-	0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840, 0x603e, 0x6024, 0xc0f5,
-	0x6026, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0034, 0x01b8,
-	0x908e, 0x0035, 0x01a0, 0x908e, 0x0036, 0x0188, 0x908e, 0x0037,
-	0x0170, 0x908e, 0x0038, 0x0158, 0x908e, 0x0039, 0x0140, 0x908e,
-	0x003a, 0x0128, 0x908e, 0x003b, 0x0110, 0x9085, 0x0001, 0x001e,
-	0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x2001,
-	0x1982, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x8f3f,
-	0x2001, 0x1986, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
-	0x1984, 0x200c, 0x8000, 0x2014, 0x2071, 0x196c, 0x711a, 0x721e,
-	0x2001, 0x0064, 0x080c, 0x8f3f, 0x2001, 0x1987, 0x82ff, 0x1110,
-	0x2011, 0x0014, 0x2202, 0x2001, 0x1988, 0x9288, 0x000a, 0x2102,
-	0x2001, 0x1a91, 0x2102, 0x2001, 0x0032, 0x080c, 0x15ee, 0x080c,
-	0x694b, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x00e6, 0x2001, 0x1986, 0x2003, 0x0028, 0x2001, 0x1987,
-	0x2003, 0x0014, 0x2071, 0x196c, 0x701b, 0x0000, 0x701f, 0x07d0,
-	0x2001, 0x1988, 0x2009, 0x001e, 0x2102, 0x2001, 0x1a91, 0x2102,
-	0x2001, 0x0032, 0x080c, 0x15ee, 0x00ee, 0x001e, 0x000e, 0x0005,
-	0x0096, 0x6058, 0x904d, 0x0110, 0x080c, 0x1031, 0x009e, 0x0005,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xadf1, 0x0180,
-	0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
-	0x0033, 0x080c, 0xaec2, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
-	0x0015, 0x1500, 0x7090, 0x9086, 0x0018, 0x11e0, 0x6014, 0x2048,
-	0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x98f7, 0x01d8, 0x707c,
-	0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54, 0x9206, 0x1140, 0x6210,
-	0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c, 0x3201, 0x080c,
-	0xb24b, 0x0020, 0x080c, 0xb7f9, 0x080c, 0xae47, 0x00fe, 0x00ee,
-	0x009e, 0x0005, 0x7060, 0xaa54, 0x9206, 0x0d48, 0x0c80, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xadf1, 0x0188, 0x2b08, 0x6112,
-	0x080c, 0xcf90, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x004d,
-	0x080c, 0xaec2, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0xadf1,
-	0x0180, 0x2b08, 0x6112, 0x080c, 0xcf90, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x001e, 0x080c, 0xaec2, 0x9085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036, 0x0046,
-	0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
-	0x0015, 0x1568, 0x7190, 0x6014, 0x2048, 0xa814, 0x8003, 0x9106,
-	0x1530, 0x20e1, 0x0000, 0x2001, 0x19a0, 0x2003, 0x0000, 0x6014,
-	0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007, 0x9094, 0x003f,
-	0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0, 0x2001, 0x19a0,
-	0x0016, 0x200c, 0x080c, 0xd800, 0x001e, 0xa804, 0x9005, 0x0110,
-	0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103, 0x0010, 0x080c,
-	0xb7f9, 0x080c, 0xae47, 0x00fe, 0x00ee, 0x009e, 0x006e, 0x005e,
-	0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x7090, 0x9086, 0x0004,
-	0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x98f7, 0x01a8, 0x707c,
-	0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78, 0x9206, 0x1110, 0x080c,
-	0x31bc, 0x080c, 0xb24b, 0x0020, 0x080c, 0xb7f9, 0x080c, 0xae47,
-	0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa78, 0x9206, 0x0d78,
-	0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
-	0x1550, 0x7090, 0x9086, 0x0004, 0x1530, 0x6014, 0x2048, 0x2c78,
-	0x080c, 0x98f7, 0x05f0, 0x707c, 0xaacc, 0x9206, 0x1180, 0x7080,
-	0xaad0, 0x9206, 0x1160, 0x080c, 0x31bc, 0x0016, 0xa998, 0xaab0,
-	0x9284, 0x1000, 0xc0fd, 0x080c, 0x5688, 0x001e, 0x0010, 0x080c,
-	0x5479, 0x080c, 0xcb1b, 0x0508, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x0080, 0x080c, 0xcb1b, 0x01b8, 0x6014, 0x2048,
-	0x080c, 0x5479, 0x1d70, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
-	0x080c, 0x6c79, 0x012e, 0x080c, 0xae47, 0x00fe, 0x00ee, 0x009e,
-	0x0005, 0x7060, 0xaad0, 0x9206, 0x0930, 0x0888, 0x0016, 0x0026,
-	0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0150,
-	0xa890, 0x9106, 0x1118, 0xa88c, 0x9206, 0x0120, 0xa992, 0xaa8e,
-	0x9085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00b6, 0x00d6, 0x0036,
-	0x080c, 0xcb1b, 0x0904, 0xd14b, 0x0096, 0x6314, 0x2348, 0xa87a,
-	0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009,
-	0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x6820, 0x1108, 0xc185,
-	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0,
-	0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c, 0x20a9, 0x0004,
-	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0f7c, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007,
-	0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2,
-	0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x6c6d,
-	0x6017, 0x0000, 0x009e, 0x003e, 0x00de, 0x00be, 0x0005, 0x0026,
-	0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6, 0x6214, 0x2248, 0x6210,
-	0x2258, 0x2079, 0x0260, 0x9096, 0x0000, 0x11a0, 0xb814, 0x9084,
-	0x00ff, 0x900e, 0x080c, 0x283e, 0x2118, 0x831f, 0x939c, 0xff00,
-	0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c,
-	0x4b05, 0x00a8, 0x9096, 0x0001, 0x1148, 0x89ff, 0x0180, 0xa89b,
-	0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x0048, 0x9096, 0x0002,
-	0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x00fe,
-	0x009e, 0x00be, 0x004e, 0x003e, 0x002e, 0x0005, 0x00c6, 0x0026,
-	0x0016, 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008, 0x6a2c, 0x080c,
-	0xcb09, 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186,
-	0x0006, 0x1190, 0x6838, 0x9206, 0x0140, 0x683c, 0x9206, 0x1160,
-	0x6108, 0x6838, 0x9106, 0x1140, 0x0020, 0x6008, 0x693c, 0x9106,
-	0x1118, 0x6010, 0x6910, 0x9106, 0x001e, 0x002e, 0x00ce, 0x0005,
-	0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc, 0x0188, 0x918c, 0x00ff,
-	0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c, 0x0f00, 0x810f, 0x918e,
-	0x0001, 0x1128, 0xa834, 0xa938, 0x9115, 0x190c, 0xc22b, 0x0005,
-	0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0499, 0x01e0,
-	0x080c, 0xcb1b, 0x01c8, 0x080c, 0xcd04, 0x6037, 0x4000, 0x6014,
-	0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c, 0xcd21, 0x1118,
-	0x080c, 0xb7f9, 0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff,
-	0x1129, 0x080c, 0x6c79, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4,
-	0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118,
-	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xce10, 0xa877,
-	0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005, 0x0006,
-	0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001,
-	0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010,
-	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4cbc,
-	0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1986,
-	0x2004, 0x601a, 0x0005, 0x2001, 0x1988, 0x2004, 0x6042, 0x0005,
-	0x080c, 0xae47, 0x0804, 0x9664, 0x00b6, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0dd5, 0x001b, 0x006e, 0x00be, 0x0005, 0xd257,
-	0xd95d, 0xdaba, 0xd257, 0xd257, 0xd257, 0xd257, 0xd257, 0xd28e,
-	0xdb38, 0xd257, 0xd257, 0xd257, 0xd257, 0xd257, 0xd257, 0x080c,
-	0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x0013,
-	0x006e, 0x0005, 0xd272, 0xe0a0, 0xd272, 0xd272, 0xd272, 0xd272,
-	0xd272, 0xd272, 0xe04d, 0xe0f4, 0xd272, 0xe717, 0xe74d, 0xe717,
-	0xe74d, 0xd272, 0x080c, 0x0dd5, 0x6000, 0x9082, 0x0016, 0x1a0c,
-	0x0dd5, 0x6000, 0x000a, 0x0005, 0xd28c, 0xdd15, 0xde05, 0xde27,
-	0xdee6, 0xd28c, 0xdfc4, 0xdf6e, 0xdb44, 0xe023, 0xe038, 0xd28c,
-	0xd28c, 0xd28c, 0xd28c, 0xd28c, 0x080c, 0x0dd5, 0x91b2, 0x0053,
-	0x1a0c, 0x0dd5, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xd6d1, 0x0002,
-	0xd2d8, 0xd4c2, 0xd2d8, 0xd2d8, 0xd2d8, 0xd4cb, 0xd2d8, 0xd2d8,
-	0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8,
-	0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2da,
-	0xd33d, 0xd34c, 0xd3b0, 0xd3db, 0xd454, 0xd4ad, 0xd2d8, 0xd2d8,
-	0xd4ce, 0xd2d8, 0xd2d8, 0xd4e3, 0xd4f0, 0xd2d8, 0xd2d8, 0xd2d8,
-	0xd2d8, 0xd2d8, 0xd573, 0xd2d8, 0xd2d8, 0xd587, 0xd2d8, 0xd2d8,
-	0xd542, 0xd2d8, 0xd2d8, 0xd2d8, 0xd59f, 0xd2d8, 0xd2d8, 0xd2d8,
-	0xd61c, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd2d8, 0xd699,
-	0x080c, 0x0dd5, 0x080c, 0x6928, 0x1150, 0x2001, 0x1837, 0x2004,
-	0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007,
-	0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xd4bb, 0x080c,
-	0x68cd, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258,
-	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x9262, 0x0076, 0x903e,
-	0x080c, 0x913f, 0x2c08, 0x080c, 0xe2ca, 0x007e, 0x001e, 0x001e,
-	0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x660f,
-	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1268, 0x0016, 0x0026,
-	0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x2c08, 0x080c, 0xe976,
-	0x002e, 0x001e, 0x1178, 0x080c, 0xe1fc, 0x1904, 0xd3a8, 0x080c,
-	0xe198, 0x1120, 0x6007, 0x0008, 0x0804, 0xd4bb, 0x6007, 0x0009,
-	0x0804, 0xd4bb, 0x080c, 0xe420, 0x0128, 0x080c, 0xe1fc, 0x0d78,
-	0x0804, 0xd3a8, 0x6017, 0x1900, 0x0c88, 0x080c, 0x32dc, 0x1904,
-	0xd6ce, 0x6106, 0x080c, 0xe14f, 0x6007, 0x0006, 0x0804, 0xd4bb,
-	0x6007, 0x0007, 0x0804, 0xd4bb, 0x080c, 0xe789, 0x1904, 0xd6ce,
-	0x080c, 0x32dc, 0x1904, 0xd6ce, 0x00d6, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001, 0x0001, 0x080c,
-	0x653c, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0188, 0x9686,
-	0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0140,
-	0x9686, 0x0004, 0x0128, 0x9686, 0x0005, 0x0110, 0x00de, 0x0480,
-	0x00e6, 0x2071, 0x0260, 0x7034, 0x9084, 0x0003, 0x1140, 0x7034,
-	0x9082, 0x0014, 0x0220, 0x7030, 0x9084, 0x0003, 0x0130, 0x00ee,
-	0x6017, 0x0000, 0x602f, 0x0007, 0x00b0, 0x00ee, 0x080c, 0xe260,
-	0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210, 0x2258, 0xbaa0,
-	0x900e, 0x080c, 0x3201, 0x002e, 0x080c, 0x669b, 0x6007, 0x000a,
-	0x00de, 0x0804, 0xd4bb, 0x6007, 0x000b, 0x00de, 0x0804, 0xd4bb,
-	0x080c, 0x31bc, 0x080c, 0xd22b, 0x6007, 0x0001, 0x0804, 0xd4bb,
-	0x080c, 0xe789, 0x1904, 0xd6ce, 0x080c, 0x32dc, 0x1904, 0xd6ce,
-	0x2071, 0x0260, 0x7034, 0x90b4, 0x0003, 0x1948, 0x90b2, 0x0014,
-	0x0a30, 0x7030, 0x9084, 0x0003, 0x1910, 0x6610, 0x2658, 0xbe04,
-	0x9686, 0x0707, 0x09e8, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e,
-	0x080c, 0x3201, 0x002e, 0x6007, 0x000c, 0x2001, 0x0001, 0x080c,
-	0xe956, 0x0804, 0xd4bb, 0x080c, 0x6928, 0x1140, 0x2001, 0x1837,
-	0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xd2e7,
-	0x080c, 0x68cd, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082,
-	0x0006, 0x06c8, 0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x657c,
-	0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120,
-	0x9686, 0x0006, 0x1904, 0xd3a8, 0x080c, 0xe26d, 0x1120, 0x6007,
-	0x000e, 0x0804, 0xd4bb, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046,
-	0x080c, 0x31bc, 0x080c, 0xd22b, 0x004e, 0x0016, 0x9006, 0x2009,
-	0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe58d,
-	0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007,
-	0x0001, 0x0804, 0xd4bb, 0x2001, 0x0001, 0x080c, 0x653c, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
-	0x0270, 0x080c, 0xbdef, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005,
-	0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004, 0x0a04, 0xd3a8,
-	0x9682, 0x0007, 0x0a04, 0xd404, 0x0804, 0xd3a8, 0x6017, 0x1900,
-	0x6007, 0x0009, 0x0804, 0xd4bb, 0x080c, 0x6928, 0x1140, 0x2001,
-	0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804,
-	0xd2e7, 0x080c, 0x68cd, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff,
-	0x9082, 0x0006, 0x0690, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004,
-	0x0120, 0x9686, 0x0006, 0x1904, 0xd3a8, 0x080c, 0xe29b, 0x1130,
-	0x080c, 0xe198, 0x1118, 0x6007, 0x0010, 0x04e8, 0x0046, 0x6410,
-	0x2458, 0xbca0, 0x0046, 0x080c, 0x31bc, 0x080c, 0xd22b, 0x004e,
-	0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009,
-	0x0029, 0x080c, 0xe58d, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
-	0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xe420, 0x0140,
-	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0978, 0x0804, 0xd3a8,
-	0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x32dc, 0x1904,
-	0xd6ce, 0x080c, 0xe789, 0x1904, 0xd6ce, 0x080c, 0xd89b, 0x1904,
-	0xd3a8, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c,
-	0x9664, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x910f,
-	0x080c, 0x9664, 0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c, 0xe789,
-	0x1904, 0xd6ce, 0x080c, 0x32dc, 0x1904, 0xd6ce, 0x080c, 0xd89b,
-	0x1904, 0xd3a8, 0x6007, 0x0020, 0x6003, 0x0001, 0x080c, 0x910f,
-	0x080c, 0x9664, 0x0005, 0x080c, 0x32dc, 0x1904, 0xd6ce, 0x6007,
-	0x0023, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664, 0x0005,
-	0x080c, 0xe789, 0x1904, 0xd6ce, 0x080c, 0x32dc, 0x1904, 0xd6ce,
-	0x080c, 0xd89b, 0x1904, 0xd3a8, 0x0016, 0x0026, 0x00e6, 0x2071,
-	0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08, 0x080c, 0xcb09,
-	0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188, 0x6010, 0x9190,
-	0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006,
-	0x080c, 0xe557, 0x1180, 0x7244, 0x9286, 0xffff, 0x01b0, 0x2160,
-	0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296, 0xffff, 0x1180,
-	0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007, 0x1d80, 0x6004,
-	0x9086, 0x0024, 0x1110, 0x080c, 0xae47, 0x2160, 0x6007, 0x0025,
-	0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664, 0x00ee, 0x002e,
-	0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x653c, 0x0156, 0x0016,
-	0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276,
-	0x080c, 0xbdef, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120, 0x6007,
-	0x0031, 0x0804, 0xd4bb, 0x080c, 0xba63, 0x080c, 0x73b0, 0x1190,
-	0x0006, 0x0026, 0x0036, 0x080c, 0x73ca, 0x1138, 0x080c, 0x7698,
-	0x080c, 0x601b, 0x080c, 0x72e2, 0x0010, 0x080c, 0x7388, 0x003e,
-	0x002e, 0x000e, 0x0005, 0x080c, 0x32dc, 0x1904, 0xd6ce, 0x080c,
-	0xd89b, 0x1904, 0xd3a8, 0x6106, 0x080c, 0xd8b7, 0x1120, 0x6007,
-	0x002b, 0x0804, 0xd4bb, 0x6007, 0x002c, 0x0804, 0xd4bb, 0x080c,
-	0xe789, 0x1904, 0xd6ce, 0x080c, 0x32dc, 0x1904, 0xd6ce, 0x080c,
-	0xd89b, 0x1904, 0xd3a8, 0x6106, 0x080c, 0xd8bc, 0x1120, 0x6007,
-	0x002e, 0x0804, 0xd4bb, 0x6007, 0x002f, 0x0804, 0xd4bb, 0x080c,
-	0x32dc, 0x1904, 0xd6ce, 0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058,
-	0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184, 0xff00,
-	0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804,
-	0xd4c2, 0x080c, 0x56d4, 0xd0e4, 0x0904, 0xd619, 0x2071, 0x026c,
-	0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x080c, 0x6966,
-	0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118, 0xb814, 0x9206,
-	0x0510, 0x080c, 0x6962, 0x15b8, 0x2069, 0x1800, 0x6880, 0x9206,
-	0x1590, 0x687c, 0x9106, 0x1578, 0x7210, 0x080c, 0xcb09, 0x0590,
-	0x080c, 0xd786, 0x0578, 0x080c, 0xe609, 0x0560, 0x622e, 0x6007,
-	0x0036, 0x6003, 0x0001, 0x080c, 0x90c7, 0x080c, 0x9664, 0x00ce,
-	0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150, 0x080c,
-	0xcb09, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106, 0x1190,
-	0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe557, 0x2c10,
-	0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f, 0x0009, 0x6017,
-	0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003, 0x6017, 0x1700,
-	0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x32dc, 0x1904, 0xd6ce,
-	0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007, 0x9086, 0x0006,
-	0x1904, 0xd4c2, 0x00e6, 0x00d6, 0x00c6, 0x080c, 0x56d4, 0xd0e4,
-	0x0904, 0xd691, 0x2069, 0x1800, 0x2071, 0x026c, 0x7008, 0x603a,
-	0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08,
-	0x9085, 0x0001, 0x080c, 0xe557, 0x2c10, 0x00ce, 0x05e8, 0x080c,
-	0xcb09, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004, 0x9106, 0x15a0,
-	0x00c6, 0x0026, 0x2260, 0x080c, 0xc741, 0x002e, 0x00ce, 0x7118,
-	0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178, 0x9186, 0x0005,
-	0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005, 0x2004, 0x9005,
-	0x0170, 0x080c, 0xd786, 0x0904, 0xd612, 0x0056, 0x7510, 0x7614,
-	0x080c, 0xe622, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007,
-	0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x080c,
-	0x90c7, 0x080c, 0x9664, 0x0c78, 0x6007, 0x003b, 0x602f, 0x0003,
-	0x6017, 0x0300, 0x6003, 0x0001, 0x080c, 0x90c7, 0x080c, 0x9664,
-	0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017, 0x0000, 0x0804,
-	0xd5e9, 0x00e6, 0x0026, 0x080c, 0x6928, 0x0550, 0x080c, 0x68cd,
-	0x080c, 0xe7fb, 0x1518, 0x2071, 0x1800, 0x70dc, 0x9085, 0x0003,
-	0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0, 0x9284, 0x00ff, 0x707e,
-	0x78e6, 0x9284, 0xff00, 0x7280, 0x9205, 0x7082, 0x78ea, 0x00fe,
-	0x70e7, 0x0000, 0x080c, 0x6966, 0x0120, 0x2011, 0x1a00, 0x2013,
-	0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2f96, 0x0010, 0x080c, 0xe82d,
-	0x002e, 0x00ee, 0x080c, 0xae47, 0x0804, 0xd4c1, 0x080c, 0xae47,
-	0x0005, 0x2600, 0x0002, 0xd6e5, 0xd716, 0xd727, 0xd6e5, 0xd6e5,
-	0xd6e7, 0xd738, 0xd6e5, 0xd6e5, 0xd6e5, 0xd704, 0xd6e5, 0xd6e5,
-	0xd6e5, 0xd743, 0xd750, 0xd781, 0xd6e5, 0x080c, 0x0dd5, 0x080c,
-	0xe789, 0x1d20, 0x080c, 0x32dc, 0x1d08, 0x080c, 0xd89b, 0x1148,
-	0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001, 0x080c, 0x910f,
-	0x0005, 0x080c, 0x31bc, 0x080c, 0xd22b, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x910f, 0x0005, 0x080c, 0xe789, 0x1938, 0x080c,
-	0x32dc, 0x1920, 0x080c, 0xd89b, 0x1d60, 0x703c, 0x6016, 0x6007,
-	0x004a, 0x6003, 0x0001, 0x080c, 0x910f, 0x0005, 0x080c, 0x32dc,
-	0x1904, 0xd6ce, 0x2009, 0x0041, 0x080c, 0xe836, 0x6007, 0x0047,
-	0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664, 0x0005, 0x080c,
-	0x32dc, 0x1904, 0xd6ce, 0x2009, 0x0042, 0x080c, 0xe836, 0x6007,
-	0x0047, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664, 0x0005,
-	0x080c, 0x32dc, 0x1904, 0xd6ce, 0x2009, 0x0046, 0x080c, 0xe836,
-	0x080c, 0xae47, 0x0005, 0x080c, 0xd7a3, 0x0904, 0xd6ce, 0x6007,
-	0x004e, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664, 0x0005,
-	0x6007, 0x004f, 0x6017, 0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff,
-	0x0508, 0x9186, 0x0001, 0x1160, 0x7140, 0x2001, 0x19bd, 0x2004,
-	0x9106, 0x11b0, 0x7144, 0x2001, 0x19be, 0x2004, 0x9106, 0x0190,
-	0x9186, 0x0002, 0x1168, 0x2011, 0x0276, 0x20a9, 0x0004, 0x6010,
-	0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xbe03, 0x009e, 0x0110,
-	0x6017, 0x0001, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c, 0x9664,
-	0x0005, 0x6007, 0x0050, 0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6,
-	0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260, 0x6010, 0x2058, 0xb8cc,
-	0xd084, 0x0150, 0x7128, 0x6048, 0x9106, 0x1120, 0x712c, 0x6044,
-	0x9106, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x00be,
-	0x00ee, 0x001e, 0x0005, 0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6,
-	0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x7090, 0x908a,
-	0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x19a0, 0x2003, 0x0000,
-	0x080c, 0x1018, 0x05a0, 0x2900, 0x6016, 0x7090, 0x8004, 0xa816,
-	0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9, 0x001e, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016,
-	0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x1018, 0x01c0, 0x2900,
-	0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016,
-	0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001, 0x0048, 0x2071,
-	0x1800, 0x7093, 0x0000, 0x6014, 0x2048, 0x080c, 0x0fb1, 0x9006,
-	0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e, 0x001e, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8,
-	0x080c, 0x23ab, 0x2099, 0x026c, 0x2001, 0x0014, 0x3518, 0x9312,
-	0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108,
-	0x080c, 0x23ab, 0x2099, 0x0260, 0x0ca8, 0x080c, 0x23ab, 0x2061,
-	0x19a0, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
-	0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x23ab,
-	0x2099, 0x0260, 0x0ca8, 0x2061, 0x19a0, 0x2019, 0x0280, 0x3300,
-	0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0260, 0x6006, 0x8108,
-	0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
-	0x00c6, 0x81ff, 0x11b8, 0x080c, 0x23c3, 0x20a1, 0x024c, 0x2001,
-	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8,
-	0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c, 0x23c3, 0x20a1,
-	0x0240, 0x0c98, 0x080c, 0x23c3, 0x2061, 0x19a3, 0x6004, 0x20a0,
-	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8,
-	0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c, 0x23c3, 0x20a1,
-	0x0240, 0x0c98, 0x2061, 0x19a3, 0x2019, 0x0260, 0x3400, 0x931e,
-	0x0110, 0x6006, 0x0020, 0x2001, 0x0240, 0x6006, 0x8108, 0x2162,
-	0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04,
-	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0170, 0x9686, 0x0004,
-	0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0128, 0x9686,
-	0x0004, 0x0110, 0x9085, 0x0001, 0x006e, 0x00be, 0x0005, 0x00d6,
-	0x080c, 0xd933, 0x00de, 0x0005, 0x00d6, 0x080c, 0xd940, 0x1520,
-	0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff, 0x9115, 0x6216,
-	0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c, 0xe956, 0x2009,
-	0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c, 0x00ff, 0x6824,
-	0x080c, 0x283e, 0x1148, 0x2001, 0x0001, 0x080c, 0xe956, 0x2110,
-	0x900e, 0x080c, 0x3201, 0x0018, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0xae95, 0x05a8, 0x0016,
-	0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x283e, 0x1578, 0x080c, 0x659f, 0x1560, 0xbe12, 0xbd16, 0x00ce,
-	0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xe789, 0x11d8, 0x080c,
-	0x32dc, 0x11c0, 0x080c, 0xd89b, 0x0510, 0x2001, 0x0007, 0x080c,
-	0x6550, 0x2001, 0x0007, 0x080c, 0x657c, 0x6017, 0x0000, 0x6023,
-	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x910f, 0x080c,
-	0x9664, 0x0010, 0x080c, 0xae47, 0x9085, 0x0001, 0x00ce, 0x00be,
-	0x0005, 0x080c, 0xae47, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c,
-	0xae47, 0x9006, 0x0c98, 0x2069, 0x026d, 0x6800, 0x9082, 0x0010,
-	0x1228, 0x6017, 0x0000, 0x9085, 0x0001, 0x0008, 0x9006, 0x0005,
-	0x6017, 0x0000, 0x2069, 0x026c, 0x6808, 0x9084, 0xff00, 0x9086,
-	0x0800, 0x1190, 0x6904, 0x9186, 0x0018, 0x0118, 0x9186, 0x0014,
-	0x1158, 0x810f, 0x6800, 0x9084, 0x00ff, 0x910d, 0x615a, 0x908e,
-	0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053,
-	0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040,
-	0x1a04, 0xda8a, 0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014,
-	0x190c, 0x0dd5, 0x2001, 0x0007, 0x080c, 0x657c, 0x080c, 0x955f,
-	0x080c, 0xae78, 0x080c, 0x9664, 0x0005, 0xd9bd, 0xd9bf, 0xd9bd,
-	0xd9bd, 0xd9bd, 0xd9bf, 0xd9ce, 0xda83, 0xda20, 0xda83, 0xda34,
-	0xda83, 0xd9ce, 0xda83, 0xda7b, 0xda83, 0xda7b, 0xda83, 0xda83,
-	0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd,
-	0xd9bd, 0xd9bd, 0xd9bd, 0xd9bf, 0xd9bd, 0xda83, 0xd9bd, 0xd9bd,
-	0xda83, 0xd9bd, 0xda80, 0xda83, 0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd,
-	0xda83, 0xda83, 0xd9bd, 0xda83, 0xda83, 0xd9bd, 0xd9c9, 0xd9bd,
-	0xd9bd, 0xd9bd, 0xd9bd, 0xda7f, 0xda83, 0xd9bd, 0xd9bd, 0xda83,
-	0xda83, 0xd9bd, 0xd9bd, 0xd9bd, 0xd9bd, 0x080c, 0x0dd5, 0x080c,
-	0x955f, 0x080c, 0xd22e, 0x6003, 0x0002, 0x080c, 0x9664, 0x0804,
-	0xda89, 0x9006, 0x080c, 0x653c, 0x0804, 0xda83, 0x080c, 0x6962,
-	0x1904, 0xda83, 0x9006, 0x080c, 0x653c, 0x6010, 0x2058, 0xb810,
-	0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000,
-	0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb8c0, 0x9005, 0x1178,
-	0x080c, 0xd216, 0x1904, 0xda83, 0x0036, 0x0046, 0xbba0, 0x2021,
-	0x0007, 0x080c, 0x4cbc, 0x004e, 0x003e, 0x0804, 0xda83, 0x080c,
-	0x330d, 0x1904, 0xda83, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002,
-	0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe,
-	0x2001, 0x0002, 0x080c, 0x6550, 0x080c, 0x955f, 0x6023, 0x0001,
-	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x910f, 0x080c, 0x9664,
-	0x6110, 0x2158, 0x2009, 0x0001, 0x080c, 0x84d8, 0x0804, 0xda89,
+	0x1118, 0x080c, 0x31bf, 0x0868, 0x080c, 0xae92, 0x0005, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xcb15, 0xcb15, 0xcb17,
+	0xcb17, 0xcb17, 0xcb15, 0xcb15, 0xae92, 0xcb15, 0xcb15, 0xcb15,
+	0xcb15, 0xcb15, 0xcb15, 0xcb15, 0xcb15, 0x080c, 0x0dd5, 0x080c,
+	0xa7cc, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6c81,
+	0x009e, 0x0804, 0xae61, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0,
+	0x0240, 0x2001, 0x181a, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001,
+	0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014,
+	0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110,
+	0x080c, 0x10aa, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800,
+	0x7354, 0x7074, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c,
+	0xd230, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004,
+	0x1148, 0x080c, 0x31bf, 0x080c, 0xd245, 0x00c6, 0x080c, 0xae92,
+	0x00ce, 0x0060, 0x080c, 0xcf24, 0x0148, 0x080c, 0xcd3b, 0x1110,
+	0x080c, 0xb813, 0x00c6, 0x080c, 0xae61, 0x00ce, 0x9ce0, 0x0018,
+	0x7068, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c,
+	0x81ff, 0x0128, 0x2061, 0x1ab0, 0x6112, 0x080c, 0x31bf, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xae0b, 0x01b0, 0x6656, 0x2b00,
+	0x6012, 0x080c, 0x56d7, 0x0118, 0x080c, 0xcc62, 0x0168, 0x080c,
+	0xcfaa, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c, 0xaedc, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0xbaa0, 0x080c, 0xaeaf, 0x0560, 0x6057, 0x0000,
+	0x2b00, 0x6012, 0x080c, 0xcfaa, 0x6023, 0x0003, 0x0016, 0x080c,
+	0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb,
+	0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0xae61, 0x9085, 0x0001,
+	0x0070, 0x080c, 0x56d7, 0x0128, 0xd18c, 0x1170, 0x080c, 0xcc62,
+	0x0148, 0x2009, 0x004c, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009,
+	0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016,
+	0x080c, 0xae0b, 0x2c78, 0x0590, 0x7e56, 0x2b00, 0x7812, 0x7823,
+	0x0003, 0x2021, 0x0005, 0x080c, 0xcc74, 0x9186, 0x004d, 0x0118,
+	0x9186, 0x004e, 0x0148, 0x2001, 0x1980, 0x200c, 0xd1fc, 0x0168,
+	0x2f60, 0x080c, 0xae61, 0x00d0, 0x2001, 0x197f, 0x200c, 0xd1fc,
+	0x0120, 0x2f60, 0x080c, 0xae61, 0x0088, 0x2f60, 0x080c, 0x56d7,
+	0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816,
+	0x001e, 0x0016, 0x080c, 0xaedc, 0x9085, 0x0001, 0x001e, 0x004e,
+	0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0xae0b,
+	0x2c78, 0x0508, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096,
+	0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x197e, 0x200c, 0xd1fc,
+	0x0120, 0x2f60, 0x080c, 0xae61, 0x0060, 0x2f60, 0x080c, 0x56d7,
+	0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c,
+	0xaedc, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900,
+	0x7816, 0x0c98, 0x00c6, 0x080c, 0x4aa4, 0x00ce, 0x1120, 0x080c,
+	0xae61, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900,
+	0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6733, 0x0158, 0x2001, 0xcc79, 0x0006, 0x900e,
+	0x2400, 0x080c, 0x6ec0, 0x080c, 0x6c81, 0x000e, 0x0807, 0x2418,
+	0x080c, 0x9522, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001,
+	0x2608, 0x080c, 0x92a3, 0x008e, 0x080c, 0x9168, 0x2f08, 0x2648,
+	0x080c, 0xe2eb, 0xb93c, 0x81ff, 0x090c, 0x9374, 0x080c, 0x968d,
+	0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xae0b, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcfaa,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0xaedc,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xaeaf, 0x01b8, 0x660a, 0x2b08,
+	0x6112, 0x080c, 0xcfaa, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6,
+	0x2c78, 0x080c, 0x1725, 0x00fe, 0x2009, 0x0021, 0x080c, 0xaedc,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
+	0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0xae0b,
+	0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0xaedc, 0x9085, 0x0001,
+	0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xaeaf, 0x0188, 0x2b08, 0x6112, 0x080c,
+	0xcfaa, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c,
+	0xaedc, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6,
+	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be,
+	0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140,
+	0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001,
+	0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020, 0x9086, 0x0004,
+	0x0190, 0x6014, 0x904d, 0x080c, 0xcb35, 0x0168, 0xa864, 0x9086,
+	0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc,
+	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xaeaf, 0x0198, 0x2b08,
+	0x6112, 0x080c, 0xcfaa, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c,
+	0x31bf, 0x2009, 0x0028, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011,
+	0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xba65,
+	0x00be, 0x080c, 0xbc88, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868,
+	0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xd169, 0x080c,
+	0xb813, 0x080c, 0xae61, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c,
+	0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81,
+	0x012e, 0x009e, 0x080c, 0xae61, 0x0c30, 0x0096, 0x9186, 0x0016,
+	0x1128, 0x2001, 0x0004, 0x080c, 0x654f, 0x00e8, 0x9186, 0x0015,
+	0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010,
+	0x00b6, 0x2058, 0x080c, 0x669a, 0x00be, 0x080c, 0xbd59, 0x1198,
+	0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001,
+	0x0006, 0x080c, 0x654f, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170,
+	0x080c, 0xb265, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528,
+	0x080c, 0xb813, 0x080c, 0xae61, 0x009e, 0x0005, 0x6014, 0x6310,
+	0x2358, 0x904d, 0x090c, 0x0dd5, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0x900e, 0x080c, 0x681f, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6c81, 0x012e, 0x080c, 0xae61, 0x08f8, 0x6014, 0x904d, 0x090c,
+	0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81,
+	0x012e, 0x080c, 0xae61, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108,
+	0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043, 0x0000,
+	0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce,
+	0x0005, 0xc850, 0xce5a, 0xce5a, 0xce5d, 0xe5fd, 0xe618, 0xe61b,
+	0xc850, 0xc850, 0xc850, 0xc850, 0xc850, 0xc850, 0xc850, 0xc850,
+	0x080c, 0x0dd5, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014, 0x904d,
+	0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e, 0x0005,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001,
+	0x1834, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c, 0xae0b,
+	0x0508, 0x7810, 0x6012, 0x080c, 0xcfaa, 0x7820, 0x9086, 0x0003,
+	0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808, 0x603e,
+	0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035, 0x6003,
+	0x0001, 0x7954, 0x6156, 0x080c, 0x90f0, 0x080c, 0x968d, 0x2f60,
+	0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1988, 0x2004, 0x6042,
+	0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0xa87c, 0xd0e4, 0x0180,
+	0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000,
+	0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fb1,
+	0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803, 0x0002, 0x9086,
+	0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0, 0x681c, 0xc085,
+	0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00, 0x6826,
+	0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c, 0x9103,
+	0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a, 0x6032,
+	0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x6954, 0x6156,
+	0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4, 0x0510,
+	0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230, 0x9105,
+	0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e, 0xac3e,
+	0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836, 0x2300,
+	0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4, 0x0000,
+	0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840, 0x603e,
+	0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e,
+	0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, 0x0036, 0x0188,
+	0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e, 0x0039,
+	0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110, 0x9085,
+	0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00e6, 0x2001, 0x1982, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032,
+	0x080c, 0x8f68, 0x2001, 0x1986, 0x82ff, 0x1110, 0x2011, 0x0014,
+	0x2202, 0x2001, 0x1984, 0x200c, 0x8000, 0x2014, 0x2071, 0x196c,
+	0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8f68, 0x2001, 0x1987,
+	0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1988, 0x9288,
+	0x000a, 0x2102, 0x2001, 0x1a91, 0x2102, 0x2001, 0x0032, 0x080c,
+	0x15ee, 0x080c, 0x6953, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1986, 0x2003, 0x0028,
+	0x2001, 0x1987, 0x2003, 0x0014, 0x2071, 0x196c, 0x701b, 0x0000,
+	0x701f, 0x07d0, 0x2001, 0x1988, 0x2009, 0x001e, 0x2102, 0x2001,
+	0x1a91, 0x2102, 0x2001, 0x0032, 0x080c, 0x15ee, 0x00ee, 0x001e,
+	0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110, 0x080c, 0x1031,
+	0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xae0b, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x0033, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086, 0x0018, 0x11e0,
+	0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x9920,
+	0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54, 0x9206,
+	0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c,
+	0x3208, 0x080c, 0xb265, 0x0020, 0x080c, 0xb813, 0x080c, 0xae61,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54, 0x9206, 0x0d48,
+	0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xae0b, 0x0188,
+	0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x2009, 0x004d, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016,
+	0x080c, 0xae0b, 0x0180, 0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xaedc, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014, 0x2048, 0xa814,
+	0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x19a0, 0x2003,
+	0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007,
+	0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x19a0, 0x0016, 0x200c, 0x080c, 0xd81b, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103,
+	0x0010, 0x080c, 0xb813, 0x080c, 0xae61, 0x00fe, 0x00ee, 0x009e,
+	0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096,
+	0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x7090,
+	0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x9920,
+	0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78, 0x9206,
+	0x1110, 0x080c, 0x31bf, 0x080c, 0xb265, 0x0020, 0x080c, 0xb813,
+	0x080c, 0xae61, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa78,
+	0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004, 0x1530, 0x6014,
+	0x2048, 0x2c78, 0x080c, 0x9920, 0x05f0, 0x707c, 0xaacc, 0x9206,
+	0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c, 0x31bf, 0x0016,
+	0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5687, 0x001e,
+	0x0010, 0x080c, 0x5478, 0x080c, 0xcb35, 0x0508, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xcb35, 0x01b8,
+	0x6014, 0x2048, 0x080c, 0x5478, 0x1d70, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000,
+	0xa867, 0x0139, 0x080c, 0x6c81, 0x012e, 0x080c, 0xae61, 0x00fe,
+	0x00ee, 0x009e, 0x0005, 0x7060, 0xaad0, 0x9206, 0x0930, 0x0888,
+	0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34, 0x2100,
+	0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c, 0x9206, 0x0120,
+	0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00b6,
+	0x00d6, 0x0036, 0x080c, 0xcb35, 0x0904, 0xd165, 0x0096, 0x6314,
+	0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6,
+	0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x681f,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a,
+	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c,
+	0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c8, 0x9080,
+	0x000a, 0x2098, 0x080c, 0x0f7c, 0x00ce, 0x0090, 0xaa96, 0x3918,
+	0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b,
+	0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e,
+	0x080c, 0x6c75, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de, 0x00be,
+	0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6, 0x6214,
+	0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096, 0x0000, 0x11a0,
+	0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x283e, 0x2118, 0x831f,
+	0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011,
+	0x8018, 0x080c, 0x4b04, 0x00a8, 0x9096, 0x0001, 0x1148, 0x89ff,
+	0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x0048,
+	0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
+	0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e, 0x002e, 0x0005,
+	0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008,
+	0x6a2c, 0x080c, 0xcb23, 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003,
+	0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206, 0x0140, 0x683c,
+	0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140, 0x0020, 0x6008,
+	0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106, 0x001e, 0x002e,
+	0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc, 0x0188,
+	0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c, 0x0f00,
+	0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xc245, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e,
+	0x0499, 0x01e0, 0x080c, 0xcb35, 0x01c8, 0x080c, 0xcd1e, 0x6037,
+	0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c,
+	0xcd3b, 0x1118, 0x080c, 0xb813, 0x0040, 0xa867, 0x0103, 0xa877,
+	0x0000, 0x83ff, 0x1129, 0x080c, 0x6c81, 0x009e, 0x003e, 0x0005,
+	0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048,
+	0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c,
+	0xce2a, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec,
+	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036,
+	0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007,
+	0x080c, 0x4cbb, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005,
+	0x2001, 0x1986, 0x2004, 0x601a, 0x0005, 0x2001, 0x1988, 0x2004,
+	0x6042, 0x0005, 0x080c, 0xae61, 0x0804, 0x968d, 0x00b6, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x001b, 0x006e, 0x00be,
+	0x0005, 0xd271, 0xd978, 0xdad5, 0xd271, 0xd271, 0xd271, 0xd271,
+	0xd271, 0xd2a8, 0xdb57, 0xd271, 0xd271, 0xd271, 0xd271, 0xd271,
+	0xd271, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0dd5, 0x0013, 0x006e, 0x0005, 0xd28c, 0xe0bf, 0xd28c, 0xd28c,
+	0xd28c, 0xd28c, 0xd28c, 0xd28c, 0xe06c, 0xe113, 0xd28c, 0xe738,
+	0xe76e, 0xe738, 0xe76e, 0xd28c, 0x080c, 0x0dd5, 0x6000, 0x9082,
+	0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x000a, 0x0005, 0xd2a6, 0xdd34,
+	0xde24, 0xde46, 0xdf05, 0xd2a6, 0xdfe3, 0xdf8d, 0xdb63, 0xe042,
+	0xe057, 0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0x080c, 0x0dd5,
+	0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x2100, 0x91b2, 0x0040, 0x1a04,
+	0xd6ec, 0x0002, 0xd2f2, 0xd4dd, 0xd2f2, 0xd2f2, 0xd2f2, 0xd4e6,
+	0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2,
+	0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2,
+	0xd2f2, 0xd2f4, 0xd357, 0xd366, 0xd3ca, 0xd3f5, 0xd46e, 0xd4c8,
+	0xd2f2, 0xd2f2, 0xd4e9, 0xd2f2, 0xd2f2, 0xd4fe, 0xd50b, 0xd2f2,
+	0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd58e, 0xd2f2, 0xd2f2, 0xd5a2,
+	0xd2f2, 0xd2f2, 0xd55d, 0xd2f2, 0xd2f2, 0xd2f2, 0xd5ba, 0xd2f2,
+	0xd2f2, 0xd2f2, 0xd637, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2,
+	0xd2f2, 0xd6b4, 0x080c, 0x0dd5, 0x080c, 0x6930, 0x1150, 0x2001,
+	0x1837, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804,
+	0xd4d6, 0x080c, 0x68cc, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016,
+	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x928b,
+	0x0076, 0x903e, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb, 0x007e,
+	0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658,
+	0x080c, 0x660e, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1268,
+	0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x2c08,
+	0x080c, 0xe997, 0x002e, 0x001e, 0x1178, 0x080c, 0xe21d, 0x1904,
+	0xd3c2, 0x080c, 0xe1b9, 0x1120, 0x6007, 0x0008, 0x0804, 0xd4d6,
+	0x6007, 0x0009, 0x0804, 0xd4d6, 0x080c, 0xe441, 0x0128, 0x080c,
+	0xe21d, 0x0d78, 0x0804, 0xd3c2, 0x6017, 0x1900, 0x0c88, 0x080c,
+	0x32e3, 0x1904, 0xd6e9, 0x6106, 0x080c, 0xe16e, 0x6007, 0x0006,
+	0x0804, 0xd4d6, 0x6007, 0x0007, 0x0804, 0xd4d6, 0x080c, 0xe7aa,
+	0x1904, 0xd6e9, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x00d6, 0x6610,
+	0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001,
+	0x0001, 0x080c, 0x653b, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
+	0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686, 0x0005, 0x0110,
+	0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9084, 0x0003,
+	0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030, 0x9084, 0x0003,
+	0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007, 0x00b0, 0x00ee,
+	0x080c, 0xe281, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210,
+	0x2258, 0xbaa0, 0x900e, 0x080c, 0x3208, 0x002e, 0x080c, 0x669a,
+	0x6007, 0x000a, 0x00de, 0x0804, 0xd4d6, 0x6007, 0x000b, 0x00de,
+	0x0804, 0xd4d6, 0x080c, 0x31bf, 0x080c, 0xd245, 0x6007, 0x0001,
+	0x0804, 0xd4d6, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c, 0x32e3,
+	0x1904, 0xd6e9, 0x2071, 0x0260, 0x7034, 0x90b4, 0x0003, 0x1948,
+	0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003, 0x1910, 0x6610,
+	0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026, 0x6210, 0x2258,
+	0xbaa0, 0x900e, 0x080c, 0x3208, 0x002e, 0x6007, 0x000c, 0x2001,
+	0x0001, 0x080c, 0xe977, 0x0804, 0xd4d6, 0x080c, 0x6930, 0x1140,
+	0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110,
+	0x0804, 0xd301, 0x080c, 0x68cc, 0x6610, 0x2658, 0xbe04, 0x9684,
+	0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138, 0x0026, 0x2001, 0x0006,
+	0x080c, 0x657b, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686,
+	0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd3c2, 0x080c, 0xe28e,
+	0x1120, 0x6007, 0x000e, 0x0804, 0xd4d6, 0x0046, 0x6410, 0x2458,
+	0xbca0, 0x0046, 0x080c, 0x31bf, 0x080c, 0xd245, 0x004e, 0x0016,
+	0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029,
+	0x080c, 0xe5ae, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
+	0x004e, 0x6007, 0x0001, 0x0804, 0xd4d6, 0x2001, 0x0001, 0x080c,
+	0x653b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0270, 0x080c, 0xbe09, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
+	0x0a04, 0xd3c2, 0x9682, 0x0007, 0x0a04, 0xd41e, 0x0804, 0xd3c2,
+	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd4d6, 0x080c, 0x6930,
+	0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1110, 0x0804, 0xd301, 0x080c, 0x68cc, 0x6610, 0x2658, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x0698, 0x0150, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd3c2,
+	0x080c, 0xe2bc, 0x1130, 0x080c, 0xe1b9, 0x1118, 0x6007, 0x0010,
+	0x04e8, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31bf,
+	0x080c, 0xd245, 0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c,
+	0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe5ae, 0x6010, 0x2058,
+	0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0,
+	0x080c, 0xe441, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
+	0x0978, 0x0804, 0xd3c2, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070,
+	0x080c, 0x32e3, 0x1904, 0xd6e9, 0x080c, 0xe7aa, 0x1904, 0xd6e9,
+	0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6007, 0x0012, 0x6003, 0x0001,
+	0x080c, 0x9138, 0x080c, 0x968d, 0x0005, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x9138, 0x080c, 0x968d, 0x0cb0, 0x6007, 0x0005,
+	0x0c68, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c, 0x32e3, 0x1904,
+	0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6007, 0x0020, 0x6003,
+	0x0001, 0x080c, 0x9138, 0x080c, 0x968d, 0x0005, 0x080c, 0x32e3,
+	0x1904, 0xd6e9, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x9138,
+	0x080c, 0x968d, 0x0005, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c,
+	0x32e3, 0x1904, 0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x0016,
+	0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180,
+	0x2c08, 0x080c, 0xcb23, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206,
+	0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050,
+	0x7240, 0x2c08, 0x9006, 0x080c, 0xe578, 0x1180, 0x7244, 0x9286,
+	0xffff, 0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214,
+	0x9296, 0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086,
+	0x0007, 0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0xae61,
+	0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c,
+	0x968d, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c,
+	0x653b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0276, 0x080c, 0xbe09, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xd4d6, 0x080c, 0xba7d,
+	0x080c, 0x73bc, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x73d6,
+	0x1138, 0x080c, 0x76a4, 0x080c, 0x601a, 0x080c, 0x72ee, 0x0010,
+	0x080c, 0x7394, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x32e3,
+	0x1904, 0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6106, 0x080c,
+	0xd8d2, 0x1120, 0x6007, 0x002b, 0x0804, 0xd4d6, 0x6007, 0x002c,
+	0x0804, 0xd4d6, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c, 0x32e3,
+	0x1904, 0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6106, 0x080c,
+	0xd8d7, 0x1120, 0x6007, 0x002e, 0x0804, 0xd4d6, 0x6007, 0x002f,
+	0x0804, 0xd4d6, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x00e6, 0x00d6,
+	0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006,
+	0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce,
+	0x00de, 0x00ee, 0x0804, 0xd4dd, 0x080c, 0x56d3, 0xd0e4, 0x0904,
+	0xd634, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108,
+	0x720c, 0x080c, 0x696e, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106,
+	0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x696a, 0x15b8, 0x2069,
+	0x1800, 0x6880, 0x9206, 0x1590, 0x687c, 0x9106, 0x1578, 0x7210,
+	0x080c, 0xcb23, 0x0590, 0x080c, 0xd7a1, 0x0578, 0x080c, 0xe62a,
+	0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286,
+	0xffff, 0x0150, 0x080c, 0xcb23, 0x01c0, 0x9280, 0x0002, 0x2004,
+	0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001,
+	0x080c, 0xe578, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037,
+	0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f,
+	0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c,
+	0x32e3, 0x1904, 0xd6e9, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00,
+	0x8007, 0x9086, 0x0006, 0x1904, 0xd4dd, 0x00e6, 0x00d6, 0x00c6,
+	0x080c, 0x56d3, 0xd0e4, 0x0904, 0xd6ac, 0x2069, 0x1800, 0x2071,
+	0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150,
+	0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe578, 0x2c10,
+	0x00ce, 0x05e8, 0x080c, 0xcb23, 0x05d0, 0x7108, 0x9280, 0x0002,
+	0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xc75b,
+	0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001,
+	0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280,
+	0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xd7a1, 0x0904, 0xd62d,
+	0x0056, 0x7510, 0x7614, 0x080c, 0xe643, 0x005e, 0x00ce, 0x00de,
+	0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
+	0x6003, 0x0001, 0x080c, 0x90f0, 0x080c, 0x968d, 0x0c78, 0x6007,
+	0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c,
+	0x90f0, 0x080c, 0x968d, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b,
+	0x6017, 0x0000, 0x0804, 0xd604, 0x00e6, 0x0026, 0x080c, 0x6930,
+	0x0550, 0x080c, 0x68cc, 0x080c, 0xe81c, 0x1518, 0x2071, 0x1800,
+	0x70dc, 0x9085, 0x0003, 0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0,
+	0x9284, 0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00, 0x7280, 0x9205,
+	0x7082, 0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c, 0x696e, 0x0120,
+	0x2011, 0x1a00, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2f96,
+	0x0010, 0x080c, 0xe84e, 0x002e, 0x00ee, 0x080c, 0xae61, 0x0804,
+	0xd4dc, 0x080c, 0xae61, 0x0005, 0x2600, 0x0002, 0xd700, 0xd731,
+	0xd742, 0xd700, 0xd700, 0xd702, 0xd753, 0xd700, 0xd700, 0xd700,
+	0xd71f, 0xd700, 0xd700, 0xd700, 0xd75e, 0xd76b, 0xd79c, 0xd700,
+	0x080c, 0x0dd5, 0x080c, 0xe7aa, 0x1d20, 0x080c, 0x32e3, 0x1d08,
+	0x080c, 0xd8b6, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003,
+	0x0001, 0x080c, 0x9138, 0x0005, 0x080c, 0x31bf, 0x080c, 0xd245,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9138, 0x0005, 0x080c,
+	0xe7aa, 0x1938, 0x080c, 0x32e3, 0x1920, 0x080c, 0xd8b6, 0x1d60,
+	0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x9138,
+	0x0005, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x2009, 0x0041, 0x080c,
+	0xe857, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c,
+	0x968d, 0x0005, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x2009, 0x0042,
+	0x080c, 0xe857, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9138,
+	0x080c, 0x968d, 0x0005, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x2009,
+	0x0046, 0x080c, 0xe857, 0x080c, 0xae61, 0x0005, 0x080c, 0xd7be,
+	0x0904, 0xd6e9, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x9138,
+	0x080c, 0x968d, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134,
+	0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140,
+	0x2001, 0x19bd, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x19be,
+	0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c,
+	0xbe1d, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016,
+	0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260,
+	0x6010, 0x2058, 0xb8cc, 0xd084, 0x0150, 0x7128, 0x6048, 0x9106,
+	0x1120, 0x712c, 0x6044, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005, 0x0016, 0x0096,
+	0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x1800, 0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001,
+	0x19a0, 0x2003, 0x0000, 0x080c, 0x1018, 0x05a0, 0x2900, 0x6016,
+	0x7090, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e,
+	0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x19a0, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c,
+	0x1018, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18,
+	0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x19a0, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085,
+	0x0001, 0x0048, 0x2071, 0x1800, 0x7093, 0x0000, 0x6014, 0x2048,
+	0x080c, 0x0fb1, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e,
+	0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x918c, 0xffff, 0x11a8, 0x080c, 0x23ab, 0x2099, 0x026c, 0x2001,
+	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x23ab, 0x2099, 0x0260, 0x0ca8,
+	0x080c, 0x23ab, 0x2061, 0x19a0, 0x6004, 0x2098, 0x6008, 0x3518,
+	0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8,
+	0x8108, 0x080c, 0x23ab, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x19a0,
+	0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001,
+	0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff,
+	0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x23c3,
+	0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108,
+	0x080c, 0x23c3, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x23c3, 0x2061,
+	0x19a3, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108,
+	0x080c, 0x23c3, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x19a3, 0x2019,
+	0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240,
+	0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066,
 	0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
-	0x0904, 0xda83, 0x9686, 0x0004, 0x0904, 0xda83, 0x080c, 0x8c92,
-	0x2001, 0x0004, 0x0804, 0xda81, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021,
-	0x0006, 0x080c, 0x4cbc, 0x004e, 0x003e, 0x2001, 0x0006, 0x080c,
-	0xdaa7, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006, 0x080c, 0x657c,
-	0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001, 0x0006, 0x080c,
-	0x6550, 0x080c, 0x6962, 0x11f8, 0x2001, 0x1837, 0x2004, 0xd0a4,
-	0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6,
-	0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0804, 0xda08,
-	0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0449, 0x0020, 0x0018,
-	0x0010, 0x080c, 0x657c, 0x080c, 0x955f, 0x080c, 0xae47, 0x080c,
-	0x9664, 0x0005, 0x2600, 0x0002, 0xda9e, 0xda9e, 0xda9e, 0xda9e,
-	0xda9e, 0xdaa0, 0xda9e, 0xdaa0, 0xda9e, 0xda9e, 0xdaa0, 0xda9e,
-	0xda9e, 0xda9e, 0xdaa0, 0xdaa0, 0xdaa0, 0xdaa0, 0x080c, 0x0dd5,
-	0x080c, 0x955f, 0x080c, 0xae47, 0x080c, 0x9664, 0x0005, 0x0016,
-	0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184, 0x0138, 0x080c,
-	0x6550, 0x9006, 0x080c, 0x653c, 0x080c, 0x31e1, 0x00de, 0x00be,
-	0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084, 0xff00, 0x8007,
-	0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x91b6, 0x0015, 0x1110, 0x003b,
-	0x0028, 0x91b6, 0x0016, 0x190c, 0x0dd5, 0x006b, 0x0005, 0xb8e2,
-	0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0xdb22, 0xdae7, 0xb8e2,
-	0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2,
-	0xb8e2, 0xdb22, 0xdb29, 0xb8e2, 0xb8e2, 0xb8e2, 0xb8e2, 0x00f6,
-	0x080c, 0x6962, 0x11d8, 0x080c, 0xd216, 0x11c0, 0x6010, 0x905d,
-	0x01a8, 0xb8c0, 0x9005, 0x0190, 0x9006, 0x080c, 0x653c, 0x2001,
-	0x0002, 0x080c, 0x6550, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
-	0x0002, 0x080c, 0x910f, 0x080c, 0x9664, 0x00d0, 0x2011, 0x0263,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x283e, 0x1190, 0x080c, 0x6600,
-	0x0118, 0x080c, 0xae47, 0x0060, 0xb810, 0x0006, 0xb814, 0x0006,
-	0x080c, 0x6035, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0xae47,
-	0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae47,
-	0x0005, 0x080c, 0xbc6b, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001,
-	0x080c, 0x910f, 0x080c, 0x9664, 0x0010, 0x080c, 0xae47, 0x0005,
-	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x080c, 0x955f, 0x080c,
-	0xae78, 0x080c, 0x9664, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb5a,
-	0xdb5a, 0xdb5a, 0xdb5a, 0xdb5c, 0xdb5a, 0xdb5a, 0xdb5a, 0xdb5a,
-	0xdb5a, 0xdb5a, 0xdb5a, 0xdb5a, 0xdb5a, 0xdb5a, 0xdb5a, 0xdb5a,
-	0xdb5a, 0xdb5a, 0x080c, 0x0dd5, 0x0096, 0x00b6, 0x00d6, 0x00e6,
-	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11a8,
-	0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xdbc2,
-	0x080c, 0xe94a, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
-	0x2011, 0x0200, 0x080c, 0x86b4, 0x0020, 0x9026, 0x080c, 0xe7ce,
-	0x0c38, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x6003, 0x0007, 0xa867,
-	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
-	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
-	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6c79,
-	0x001e, 0x080c, 0xe94a, 0x1904, 0xdc22, 0x9486, 0x2000, 0x1130,
-	0x2019, 0x0017, 0x080c, 0xe501, 0x0804, 0xdc22, 0x9486, 0x0200,
-	0x1120, 0x080c, 0xe49d, 0x0804, 0xdc22, 0x9486, 0x0400, 0x0120,
-	0x9486, 0x1000, 0x1904, 0xdc22, 0x2019, 0x0002, 0x080c, 0xe4b8,
-	0x0804, 0xdc22, 0x2069, 0x1a71, 0x6a00, 0xd284, 0x0904, 0xdc8c,
-	0x9284, 0x0300, 0x1904, 0xdc85, 0x6804, 0x9005, 0x0904, 0xdc6d,
-	0x2d78, 0x6003, 0x0007, 0x080c, 0x1018, 0x0904, 0xdc2e, 0x7800,
-	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
-	0x180f, 0x2004, 0xd084, 0x1904, 0xdc90, 0x9006, 0xa802, 0xa867,
-	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
-	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
-	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
-	0x0003, 0x9080, 0xdc2a, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
-	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
-	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
-	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
-	0x080c, 0x6c79, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
-	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
-	0x2004, 0xd084, 0x0120, 0x080c, 0x0fff, 0x1904, 0xdbd7, 0x6017,
-	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90c7, 0x080c,
-	0x9664, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
-	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
-	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
-	0x080c, 0x90c7, 0x080c, 0x9664, 0x0828, 0x6868, 0x602e, 0x686c,
-	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x90c7, 0x080c, 0x9664, 0x0804, 0xdc22, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b05, 0x6017, 0xf300,
-	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x90c7, 0x080c, 0x9664, 0x0804, 0xdc22, 0x6017, 0xf500, 0x0c98,
-	0x6017, 0xf600, 0x0804, 0xdc42, 0x6017, 0xf200, 0x0804, 0xdc42,
-	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
-	0x7044, 0x9084, 0x0003, 0x9080, 0xdc2a, 0x2005, 0xa87e, 0x2928,
-	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
-	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
-	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
-	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0dd5,
-	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0029, 0x20a0, 0x2011, 0xdd0c, 0x2041, 0x0001, 0x223d,
-	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
-	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
-	0x2098, 0x0c68, 0x2950, 0x080c, 0x1018, 0x0170, 0x2900, 0xb002,
-	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
-	0x080c, 0x1031, 0x0cc8, 0x080c, 0x1031, 0x0804, 0xdc2e, 0x2548,
-	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
-	0x080c, 0xe530, 0x0804, 0xdc22, 0x8010, 0x0004, 0x801a, 0x0006,
-	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
-	0x6004, 0x908a, 0x0054, 0x1a0c, 0x0dd5, 0x9082, 0x0040, 0x0a0c,
-	0x0dd5, 0x2008, 0x0804, 0xddbd, 0x9186, 0x0051, 0x0108, 0x00c0,
-	0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xdd6e, 0x0126, 0x2091,
-	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x8fac, 0x002e, 0x001e,
-	0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xde05,
-	0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
-	0x0500, 0x190c, 0x0dd5, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
-	0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006,
-	0x0016, 0x0026, 0x080c, 0x8fac, 0x002e, 0x001e, 0x000e, 0x00ce,
-	0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0dd5, 0x0804,
-	0xdee6, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0xaedd,
-	0x0005, 0xdd84, 0xdd86, 0xdd86, 0xddad, 0xdd84, 0xdd84, 0xdd84,
-	0xdd84, 0xdd84, 0xdd84, 0xdd84, 0xdd84, 0xdd84, 0xdd84, 0xdd84,
-	0xdd84, 0xdd84, 0xdd84, 0xdd84, 0x080c, 0x0dd5, 0x080c, 0x955f,
-	0x080c, 0x9664, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c,
-	0xcb1b, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xe530, 0x6017,
-	0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1987, 0x2004, 0x601a,
-	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x955f,
-	0x080c, 0x9664, 0x080c, 0xcb1b, 0x0120, 0x6014, 0x2048, 0x080c,
-	0x1031, 0x080c, 0xae78, 0x009e, 0x0005, 0x0002, 0xddd1, 0xdde8,
-	0xddd3, 0xddff, 0xddd1, 0xddd1, 0xddd1, 0xddd1, 0xddd1, 0xddd1,
-	0xddd1, 0xddd1, 0xddd1, 0xddd1, 0xddd1, 0xddd1, 0xddd1, 0xddd1,
-	0xddd1, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x955f, 0x6014, 0x2048,
-	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
-	0xaec2, 0x0010, 0x6003, 0x0004, 0x080c, 0x9664, 0x009e, 0x0005,
-	0x080c, 0x955f, 0x080c, 0xcb1b, 0x0138, 0x6114, 0x0096, 0x2148,
-	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x8689, 0x080c, 0xae47,
-	0x080c, 0x9664, 0x0005, 0x080c, 0xe792, 0x0db0, 0x0cc8, 0x080c,
-	0x955f, 0x2009, 0x0041, 0x0804, 0xdf6e, 0x9182, 0x0040, 0x0002,
-	0xde1b, 0xde1d, 0xde1b, 0xde1b, 0xde1b, 0xde1b, 0xde1b, 0xde1b,
-	0xde1b, 0xde1b, 0xde1b, 0xde1b, 0xde1b, 0xde1b, 0xde1b, 0xde1b,
-	0xde1b, 0xde1e, 0xde1b, 0x080c, 0x0dd5, 0x0005, 0x00d6, 0x080c,
-	0x8689, 0x00de, 0x080c, 0xe7ea, 0x080c, 0xae47, 0x0005, 0x9182,
-	0x0040, 0x0002, 0xde3d, 0xde3d, 0xde3d, 0xde3d, 0xde3d, 0xde3d,
-	0xde3d, 0xde3d, 0xde3d, 0xde3f, 0xdeae, 0xde3d, 0xde3d, 0xde3d,
-	0xde3d, 0xdeae, 0xde3d, 0xde3d, 0xde3d, 0x080c, 0x0dd5, 0x2001,
-	0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c,
-	0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xdeae, 0x2009, 0x180c,
-	0x2104, 0xd0d4, 0x0904, 0xdeae, 0xc0d4, 0x200a, 0x2009, 0x0105,
-	0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1867,
-	0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x9614, 0x6014,
-	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e,
-	0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c,
-	0x9790, 0x2009, 0x0041, 0x009e, 0x0804, 0xdf6e, 0x080c, 0x9790,
-	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x8689, 0x009e, 0x0005,
-	0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f,
-	0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
-	0xd1cc, 0x0110, 0x080c, 0x2c52, 0x080c, 0x9790, 0x6014, 0x2048,
-	0xa97c, 0xd1ec, 0x1130, 0x080c, 0x8689, 0x080c, 0xae47, 0x009e,
-	0x0005, 0x080c, 0xe792, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c,
-	0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x9614, 0x080c, 0x9790,
-	0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140,
-	0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e,
-	0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xe530, 0x6018,
-	0x9005, 0x1128, 0x2001, 0x1987, 0x2004, 0x8003, 0x601a, 0x6017,
-	0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040,
-	0x0002, 0xdefd, 0xdefd, 0xdefd, 0xdefd, 0xdefd, 0xdefd, 0xdefd,
-	0xdefd, 0xdeff, 0xdefd, 0xdefd, 0xdefd, 0xdefd, 0xdefd, 0xdefd,
-	0xdefd, 0xdefd, 0xdefd, 0xdefd, 0xdf4a, 0x080c, 0x0dd5, 0x6014,
-	0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900,
-	0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128,
-	0x2009, 0x0041, 0x009e, 0x0804, 0xdf6e, 0x6003, 0x0007, 0x601b,
-	0x0000, 0x080c, 0x8689, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58,
-	0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030,
-	0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8,
-	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009,
-	0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003,
-	0x0006, 0x00e9, 0x080c, 0x868b, 0x009e, 0x0005, 0x6003, 0x0002,
-	0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x15e5, 0x1904,
-	0xdeff, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e,
-	0x9105, 0x1120, 0x080c, 0x15e5, 0x1904, 0xdeff, 0x0005, 0xd2fc,
-	0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009,
-	0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040,
-	0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c,
-	0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005, 0xdf91, 0xdf9d,
-	0xdfa9, 0xdfb5, 0xdf91, 0xdf91, 0xdf91, 0xdf91, 0xdf98, 0xdf93,
-	0xdf93, 0xdf91, 0xdf91, 0xdf91, 0xdf91, 0xdf93, 0xdf91, 0xdf93,
-	0xdf91, 0x080c, 0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005,
-	0x6014, 0x9005, 0x190c, 0x0dd5, 0x0005, 0x6003, 0x0001, 0x6106,
-	0x080c, 0x90c7, 0x0126, 0x2091, 0x8000, 0x080c, 0x9664, 0x012e,
-	0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x90c7, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x9664, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106,
-	0x2c10, 0x080c, 0x1bad, 0x0126, 0x2091, 0x8000, 0x080c, 0x912c,
-	0x080c, 0x9790, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
-	0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005,
-	0xdfe0, 0xdfe2, 0xdff4, 0xe00e, 0xdfe0, 0xdfe0, 0xdfe0, 0xdfe0,
-	0xdfe0, 0xdfe0, 0xdfe0, 0xdfe0, 0xdfe0, 0xdfe0, 0xdfe0, 0xdfe0,
-	0x080c, 0x0dd5, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c,
-	0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c,
-	0x90c7, 0x080c, 0x9664, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc,
-	0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x90c7, 0x080c, 0x9664, 0x00e0, 0x901e, 0x6316,
-	0x631a, 0x2019, 0x0004, 0x080c, 0xe530, 0x00a0, 0x6014, 0x2048,
-	0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70,
-	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1bad, 0x080c, 0x912c,
-	0x080c, 0x9790, 0x0005, 0x080c, 0x955f, 0x6114, 0x81ff, 0x0158,
-	0x0096, 0x2148, 0x080c, 0xe8e7, 0x0036, 0x2019, 0x0029, 0x080c,
-	0xe530, 0x003e, 0x009e, 0x080c, 0xae78, 0x080c, 0x9664, 0x0005,
-	0x080c, 0x9614, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
-	0xe8e7, 0x0036, 0x2019, 0x0029, 0x080c, 0xe530, 0x003e, 0x009e,
-	0x080c, 0xae78, 0x080c, 0x9790, 0x0005, 0x9182, 0x0085, 0x0002,
-	0xe05f, 0xe05d, 0xe05d, 0xe06b, 0xe05d, 0xe05d, 0xe05d, 0xe05d,
-	0xe05d, 0xe05d, 0xe05d, 0xe05d, 0xe05d, 0x080c, 0x0dd5, 0x6003,
-	0x000b, 0x6106, 0x080c, 0x90c7, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x9664, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xe789, 0x0118,
-	0x080c, 0xae47, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001,
-	0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0,
-	0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0xb168, 0x7220, 0x080c,
-	0xe3d6, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224,
-	0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c,
-	0x90c7, 0x080c, 0x9664, 0x080c, 0x9790, 0x00ee, 0x002e, 0x0005,
-	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5,
-	0x908a, 0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00a2, 0x9186,
-	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0xaedd, 0x0050,
-	0x2001, 0x0007, 0x080c, 0x657c, 0x080c, 0x955f, 0x080c, 0xae78,
-	0x080c, 0x9664, 0x0005, 0xe0d0, 0xe0d2, 0xe0d2, 0xe0d0, 0xe0d0,
-	0xe0d0, 0xe0d0, 0xe0d0, 0xe0d0, 0xe0d0, 0xe0d0, 0xe0d0, 0xe0d0,
-	0x080c, 0x0dd5, 0x080c, 0x955f, 0x080c, 0xae78, 0x080c, 0x9664,
-	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0dd5, 0x9182, 0x0092, 0x1a0c,
-	0x0dd5, 0x9182, 0x0085, 0x0002, 0xe0f1, 0xe0f1, 0xe0f1, 0xe0f3,
-	0xe0f1, 0xe0f1, 0xe0f1, 0xe0f1, 0xe0f1, 0xe0f1, 0xe0f1, 0xe0f1,
-	0xe0f1, 0x080c, 0x0dd5, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
-	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaedd, 0x0030,
-	0x080c, 0x955f, 0x080c, 0xae78, 0x080c, 0x9664, 0x0005, 0x0036,
-	0x080c, 0xe7ea, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
-	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
-	0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa682, 0x009e,
-	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0xa72d, 0x007e, 0x1520,
-	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
-	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe7ea, 0x080c, 0xd22e,
-	0x080c, 0x1a5e, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb1b,
-	0x0110, 0x080c, 0xe530, 0x009e, 0x6017, 0x0000, 0x080c, 0xe7ea,
-	0x6023, 0x0007, 0x080c, 0xd22e, 0x003e, 0x012e, 0x0005, 0x00f6,
-	0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c,
-	0x080c, 0x283e, 0x15b8, 0x0016, 0x00c6, 0x080c, 0x6600, 0x1580,
-	0x001e, 0x00c6, 0x2160, 0x080c, 0xd22b, 0x00ce, 0x002e, 0x0026,
-	0x0016, 0x2019, 0x0029, 0x080c, 0xa7ee, 0x080c, 0x9262, 0x0076,
-	0x903e, 0x080c, 0x913f, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
-	0xe2ca, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286,
-	0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x3276,
-	0x002e, 0x001e, 0x080c, 0x6035, 0xbe12, 0xbd16, 0x9006, 0x0010,
-	0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005,
-	0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1824, 0x2104, 0x9086,
-	0x0074, 0x1904, 0xe1f1, 0x2069, 0x0260, 0x6944, 0x9182, 0x0100,
-	0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xe1ee, 0x2001, 0x197c,
-	0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8c0, 0x9005, 0x0118,
-	0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001, 0x0648, 0x080c,
-	0xe94f, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009, 0x0205, 0x200b,
-	0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182, 0x0100, 0x02a8,
-	0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001, 0x0288, 0x6950,
-	0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100, 0x00a0, 0x6017,
-	0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017, 0x0700, 0x0058,
-	0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028, 0x6017, 0x0f00,
-	0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008, 0x9006, 0x001e,
-	0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6, 0x0026, 0x0036,
-	0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff, 0x9286, 0x0006,
-	0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00, 0x8217, 0x9286,
-	0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c, 0x660f, 0x0804,
-	0xe259, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x000a, 0x080c, 0xbe03, 0x009e, 0x15a8, 0x2011, 0x027a, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xbe03, 0x009e,
-	0x1548, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x1848,
-	0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xe58d, 0xb800,
-	0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x9262, 0x0076, 0x2039,
-	0x0000, 0x080c, 0x913f, 0x2c08, 0x080c, 0xe2ca, 0x007e, 0x2001,
-	0x0007, 0x080c, 0x657c, 0x2001, 0x0007, 0x080c, 0x6550, 0x001e,
-	0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce, 0x0005,
-	0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118, 0x6017,
-	0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6, 0x0016,
-	0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834, 0x080c,
-	0x283e, 0x11d0, 0x080c, 0x6600, 0x11b8, 0x2011, 0x0270, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe03, 0x009e,
-	0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x0006, 0x080c, 0xbe03, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
-	0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036,
-	0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e,
-	0x11d0, 0x080c, 0x6600, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004,
-	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe03, 0x009e, 0x1158,
-	0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
-	0x080c, 0xbe03, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e,
-	0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056,
-	0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029, 0x19f0,
-	0x252c, 0x2021, 0x19f6, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800,
-	0x7654, 0x7074, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1ab0, 0x000e,
-	0x0128, 0x8001, 0x9602, 0x1a04, 0xe367, 0x0018, 0x9606, 0x0904,
-	0xe367, 0x080c, 0x8958, 0x0904, 0xe35e, 0x2100, 0x9c06, 0x0904,
-	0xe35e, 0x080c, 0xe5ce, 0x1904, 0xe35e, 0x080c, 0xe96c, 0x0904,
-	0xe35e, 0x080c, 0xe5be, 0x0904, 0xe35e, 0x6720, 0x9786, 0x0001,
-	0x1148, 0x080c, 0x330d, 0x0904, 0xe3a6, 0x6004, 0x9086, 0x0000,
-	0x1904, 0xe3a6, 0x9786, 0x0004, 0x0904, 0xe3a6, 0x9786, 0x0007,
-	0x0904, 0xe35e, 0x2500, 0x9c06, 0x0904, 0xe35e, 0x2400, 0x9c06,
-	0x05e8, 0x88ff, 0x0118, 0x6054, 0x9906, 0x15c0, 0x0096, 0x6000,
-	0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a5e, 0x001e, 0x9786,
-	0x000a, 0x0148, 0x080c, 0xcd21, 0x1130, 0x080c, 0xb7f9, 0x009e,
-	0x080c, 0xae78, 0x0418, 0x6014, 0x2048, 0x080c, 0xcb1b, 0x01d8,
-	0x9786, 0x0003, 0x1570, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0xe8e7, 0x0016, 0x080c, 0xce0a, 0x080c, 0x6c6d,
-	0x001e, 0x080c, 0xcd04, 0x009e, 0x080c, 0xae78, 0x9ce0, 0x0018,
-	0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe2de, 0x012e,
-	0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee,
-	0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005, 0x0128, 0x080c,
-	0xe8e7, 0x080c, 0xe530, 0x08f8, 0x009e, 0x0c00, 0x9786, 0x0009,
-	0x11f8, 0x6000, 0x9086, 0x0004, 0x01c0, 0x6000, 0x9086, 0x0003,
-	0x11a0, 0x080c, 0x9614, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb1b,
-	0x0118, 0x6010, 0x080c, 0x6c79, 0x009e, 0x00c6, 0x080c, 0xae47,
-	0x00ce, 0x0036, 0x080c, 0x9790, 0x003e, 0x009e, 0x0804, 0xe35e,
-	0x9786, 0x000a, 0x0904, 0xe345, 0x0804, 0xe343, 0x81ff, 0x0904,
-	0xe35e, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0138, 0x9180,
-	0x0001, 0x2004, 0x9086, 0x002d, 0x1904, 0xe35e, 0x6000, 0x9086,
-	0x0002, 0x1904, 0xe35e, 0x080c, 0xcd10, 0x0138, 0x080c, 0xcd21,
-	0x1904, 0xe35e, 0x080c, 0xb7f9, 0x0038, 0x080c, 0x31e1, 0x080c,
-	0xcd21, 0x1110, 0x080c, 0xb7f9, 0x080c, 0xae78, 0x0804, 0xe35e,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6,
-	0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xe557, 0x001e, 0x0120,
-	0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xe3f5,
-	0xe3f5, 0xe3f5, 0xe3f5, 0xe3f5, 0xe3f5, 0xe3f7, 0xe3f5, 0xe3f5,
-	0xe3f5, 0xe3f5, 0xae78, 0xae78, 0xe3f5, 0x9006, 0x0005, 0x0036,
-	0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00,
-	0x2009, 0x0020, 0x080c, 0xe58d, 0x001e, 0x004e, 0x2019, 0x0002,
-	0x080c, 0xe115, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096, 0x080c,
-	0xcb1b, 0x0140, 0x6014, 0x904d, 0x080c, 0xc74e, 0x687b, 0x0005,
-	0x080c, 0x6c79, 0x009e, 0x080c, 0xae78, 0x9085, 0x0001, 0x0005,
-	0x2001, 0x0001, 0x080c, 0x653c, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xbdef,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6,
-	0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091, 0x8000,
-	0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001, 0x8fff, 0x0904, 0xe490,
-	0x2071, 0x1800, 0x7654, 0x7074, 0x8001, 0x9602, 0x1a04, 0xe490,
-	0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c, 0xe5be,
-	0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006, 0x1538,
-	0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8,
-	0x85ff, 0x0118, 0x6054, 0x9106, 0x11d0, 0x0096, 0x601c, 0xd084,
-	0x0140, 0x080c, 0xe7ea, 0x080c, 0xd22e, 0x080c, 0x1a5e, 0x6023,
-	0x0007, 0x6014, 0x2048, 0x080c, 0xcb1b, 0x0120, 0x0046, 0x080c,
-	0xe530, 0x004e, 0x009e, 0x080c, 0xae78, 0x88ff, 0x1198, 0x9ce0,
-	0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe445,
-	0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee,
-	0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x00b6, 0x0076, 0x0056,
-	0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210,
-	0x2258, 0x0096, 0x904e, 0x080c, 0xa682, 0x009e, 0x008e, 0x903e,
-	0x080c, 0xa72d, 0x080c, 0xe436, 0x005e, 0x007e, 0x00be, 0x0005,
-	0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128,
-	0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c, 0x6600, 0x1190,
-	0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001, 0x0096, 0x904e,
-	0x080c, 0xa682, 0x009e, 0x008e, 0x903e, 0x080c, 0xa72d, 0x080c,
-	0xe436, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xe4c3, 0x015e,
-	0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x00b6, 0x0076,
-	0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019,
-	0x0048, 0x0096, 0x904e, 0x080c, 0xa682, 0x009e, 0x008e, 0x903e,
-	0x080c, 0xa72d, 0x2c20, 0x080c, 0xe436, 0x005e, 0x007e, 0x00be,
+	0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e,
+	0x00be, 0x0005, 0x00d6, 0x080c, 0xd94e, 0x00de, 0x0005, 0x00d6,
+	0x080c, 0xd95b, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084,
+	0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006,
+	0x080c, 0xe977, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920,
+	0x918c, 0x00ff, 0x6824, 0x080c, 0x283e, 0x1148, 0x2001, 0x0001,
+	0x080c, 0xe977, 0x2110, 0x900e, 0x080c, 0x3208, 0x0018, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c,
+	0xaeaf, 0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x283e, 0x1578, 0x080c, 0x659e, 0x1560,
+	0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c,
+	0xe7aa, 0x11d8, 0x080c, 0x32e3, 0x11c0, 0x080c, 0xd8b6, 0x0510,
+	0x2001, 0x0007, 0x080c, 0x654f, 0x2001, 0x0007, 0x080c, 0x657b,
+	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x9138, 0x080c, 0x968d, 0x0010, 0x080c, 0xae61, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0xae61, 0x00ce, 0x002e,
+	0x001e, 0x0ca8, 0x080c, 0xae61, 0x9006, 0x0c98, 0x2069, 0x026d,
+	0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808,
+	0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018,
+	0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff,
+	0x910d, 0x615a, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005,
+	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x1130,
+	0x2008, 0x91b2, 0x0040, 0x1a04, 0xdaa5, 0x0092, 0x91b6, 0x0027,
+	0x0120, 0x91b6, 0x0014, 0x190c, 0x0dd5, 0x2001, 0x0007, 0x080c,
+	0x657b, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005,
+	0xd9d8, 0xd9da, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9da, 0xd9e9, 0xda9e,
+	0xda3b, 0xda9e, 0xda4f, 0xda9e, 0xd9e9, 0xda9e, 0xda96, 0xda9e,
+	0xda96, 0xda9e, 0xda9e, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8,
+	0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9da, 0xd9d8,
+	0xda9e, 0xd9d8, 0xd9d8, 0xda9e, 0xd9d8, 0xda9b, 0xda9e, 0xd9d8,
+	0xd9d8, 0xd9d8, 0xd9d8, 0xda9e, 0xda9e, 0xd9d8, 0xda9e, 0xda9e,
+	0xd9d8, 0xd9e4, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xda9a, 0xda9e,
+	0xd9d8, 0xd9d8, 0xda9e, 0xda9e, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8,
+	0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xd248, 0x6003, 0x0002,
+	0x080c, 0x968d, 0x0804, 0xdaa4, 0x9006, 0x080c, 0x653b, 0x0804,
+	0xda9e, 0x080c, 0x696a, 0x1904, 0xda9e, 0x9006, 0x080c, 0x653b,
+	0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079,
+	0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058,
+	0xb8c0, 0x9005, 0x1178, 0x080c, 0xd230, 0x1904, 0xda9e, 0x0036,
+	0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4cbb, 0x004e, 0x003e,
+	0x0804, 0xda9e, 0x080c, 0x3314, 0x1904, 0xda9e, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8,
+	0x8000, 0x78aa, 0x00fe, 0x2001, 0x0002, 0x080c, 0x654f, 0x080c,
+	0x9588, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c,
+	0x8501, 0x0804, 0xdaa4, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0006, 0x0904, 0xda9e, 0x9686, 0x0004, 0x0904,
+	0xda9e, 0x080c, 0x8cbb, 0x2001, 0x0004, 0x0804, 0xda9c, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010,
+	0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4cbb, 0x004e, 0x003e,
+	0x2001, 0x0006, 0x080c, 0xdac2, 0x6610, 0x2658, 0xbe04, 0x0066,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001,
+	0x0006, 0x080c, 0x657b, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120,
+	0x2001, 0x0006, 0x080c, 0x654f, 0x080c, 0x696a, 0x11f8, 0x2001,
+	0x1837, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa,
+	0x00fe, 0x0804, 0xda23, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006,
+	0x0449, 0x0020, 0x0018, 0x0010, 0x080c, 0x657b, 0x080c, 0x9588,
+	0x080c, 0xae61, 0x080c, 0x968d, 0x0005, 0x2600, 0x0002, 0xdab9,
+	0xdab9, 0xdab9, 0xdab9, 0xdab9, 0xdabb, 0xdab9, 0xdabb, 0xdab9,
+	0xdab9, 0xdabb, 0xdab9, 0xdab9, 0xdab9, 0xdabb, 0xdabb, 0xdabb,
+	0xdabb, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xae61, 0x080c,
+	0x968d, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900,
+	0xd184, 0x0138, 0x080c, 0x654f, 0x9006, 0x080c, 0x653b, 0x080c,
+	0x31e8, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x91b6,
+	0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0dd5,
+	0x006b, 0x0005, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc,
+	0xdb41, 0xdb02, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc,
+	0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xdb41, 0xdb48, 0xb8fc, 0xb8fc,
+	0xb8fc, 0xb8fc, 0x00f6, 0x080c, 0x696a, 0x11d8, 0x080c, 0xd230,
+	0x11c0, 0x6010, 0x905d, 0x01a8, 0xb8c0, 0x9005, 0x0190, 0x9006,
+	0x080c, 0x653b, 0x2001, 0x0002, 0x080c, 0x654f, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9138, 0x080c, 0x968d,
+	0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e,
+	0x11b0, 0x080c, 0x65ff, 0x0118, 0x080c, 0xae61, 0x0080, 0xb810,
+	0x0006, 0xb814, 0x0006, 0xb8c0, 0x0006, 0x080c, 0x6034, 0x000e,
+	0xb8c2, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0xae61, 0x00fe,
+	0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae61, 0x0005,
+	0x080c, 0xbc85, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x9138, 0x080c, 0x968d, 0x0010, 0x080c, 0xae61, 0x0005, 0x6004,
+	0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xae92,
+	0x080c, 0x968d, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb79, 0xdb79,
+	0xdb79, 0xdb79, 0xdb7b, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79,
+	0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79,
+	0xdb79, 0x080c, 0x0dd5, 0x0096, 0x00b6, 0x00d6, 0x00e6, 0x00f6,
+	0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11a8, 0x6106,
+	0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xdbe1, 0x080c,
+	0xe96b, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001, 0x2011,
+	0x0200, 0x080c, 0x86dd, 0x0020, 0x9026, 0x080c, 0xe7ef, 0x0c38,
+	0x080c, 0x0fff, 0x090c, 0x0dd5, 0x6003, 0x0007, 0xa867, 0x010d,
+	0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008, 0xa8e2,
+	0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876, 0xa87f,
+	0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6c81, 0x001e,
+	0x080c, 0xe96b, 0x1904, 0xdc41, 0x9486, 0x2000, 0x1130, 0x2019,
+	0x0017, 0x080c, 0xe522, 0x0804, 0xdc41, 0x9486, 0x0200, 0x1120,
+	0x080c, 0xe4be, 0x0804, 0xdc41, 0x9486, 0x0400, 0x0120, 0x9486,
+	0x1000, 0x1904, 0xdc41, 0x2019, 0x0002, 0x080c, 0xe4d9, 0x0804,
+	0xdc41, 0x2069, 0x1a71, 0x6a00, 0xd284, 0x0904, 0xdcab, 0x9284,
+	0x0300, 0x1904, 0xdca4, 0x6804, 0x9005, 0x0904, 0xdc8c, 0x2d78,
+	0x6003, 0x0007, 0x080c, 0x1018, 0x0904, 0xdc4d, 0x7800, 0xd08c,
+	0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001, 0x180f,
+	0x2004, 0xd084, 0x1904, 0xdcaf, 0x9006, 0xa802, 0xa867, 0x0116,
+	0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058, 0xb8a0,
+	0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be, 0xb930,
+	0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084, 0x0003,
+	0x9080, 0xdc49, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001, 0x0270,
+	0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080, 0x20e1,
+	0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b, 0x0000,
+	0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae, 0x080c,
+	0x6c81, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be, 0x009e,
+	0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810, 0x2004,
+	0xd084, 0x0120, 0x080c, 0x0fff, 0x1904, 0xdbf6, 0x6017, 0xf100,
+	0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0, 0x080c, 0x968d,
+	0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086, 0x1200,
+	0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c, 0xf700,
+	0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043, 0x080c,
+	0x90f0, 0x080c, 0x968d, 0x0828, 0x6868, 0x602e, 0x686c, 0x6032,
+	0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x0804, 0xdc41, 0x2001, 0x180e, 0x2004, 0xd0ec,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x4b04, 0x6017, 0xf300, 0x0010,
+	0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x0804, 0xdc41, 0x6017, 0xf500, 0x0c98, 0x6017,
+	0xf600, 0x0804, 0xdc61, 0x6017, 0xf200, 0x0804, 0xdc61, 0xa867,
+	0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a, 0x7044,
+	0x9084, 0x0003, 0x9080, 0xdc49, 0x2005, 0xa87e, 0x2928, 0x6010,
+	0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e, 0xb830,
+	0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205, 0x2104,
+	0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210, 0x2214,
+	0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0dd5, 0x8210,
+	0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0029, 0x20a0, 0x2011, 0xdd2b, 0x2041, 0x0001, 0x223d, 0x9784,
+	0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a, 0x0530,
+	0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260, 0x2098,
+	0x0c68, 0x2950, 0x080c, 0x1018, 0x0170, 0x2900, 0xb002, 0xa867,
+	0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b,
+	0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118, 0x080c,
+	0x1031, 0x0cc8, 0x080c, 0x1031, 0x0804, 0xdc4d, 0x2548, 0x8847,
+	0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000, 0x080c,
+	0xe551, 0x0804, 0xdc41, 0x8010, 0x0004, 0x801a, 0x0006, 0x8018,
+	0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160, 0x6004,
+	0x908a, 0x0054, 0x1a0c, 0x0dd5, 0x9082, 0x0040, 0x0a0c, 0x0dd5,
+	0x2008, 0x0804, 0xdddc, 0x9186, 0x0051, 0x0108, 0x00c0, 0x2001,
+	0x0109, 0x2004, 0xd084, 0x0904, 0xdd8d, 0x0126, 0x2091, 0x2800,
+	0x0006, 0x0016, 0x0026, 0x080c, 0x8fd5, 0x002e, 0x001e, 0x000e,
+	0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xde24, 0x9186,
+	0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014, 0x0500,
+	0x190c, 0x0dd5, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0, 0x00c6,
+	0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006, 0x0016,
+	0x0026, 0x080c, 0x8fd5, 0x002e, 0x001e, 0x000e, 0x00ce, 0x012e,
+	0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0dd5, 0x0804, 0xdf05,
+	0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0xaef7, 0x0005,
+	0xdda3, 0xdda5, 0xdda5, 0xddcc, 0xdda3, 0xdda3, 0xdda3, 0xdda3,
+	0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3,
+	0xdda3, 0xdda3, 0xdda3, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c,
+	0x968d, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c, 0xcb35,
+	0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xe551, 0x6017, 0x0000,
+	0x6018, 0x9005, 0x1120, 0x2001, 0x1987, 0x2004, 0x601a, 0x6003,
+	0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x9588, 0x080c,
+	0x968d, 0x080c, 0xcb35, 0x0120, 0x6014, 0x2048, 0x080c, 0x1031,
+	0x080c, 0xae92, 0x009e, 0x0005, 0x0002, 0xddf0, 0xde07, 0xddf2,
+	0xde1e, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0,
+	0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0,
+	0x080c, 0x0dd5, 0x0096, 0x080c, 0x9588, 0x6014, 0x2048, 0xa87c,
+	0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c, 0xaedc,
+	0x0010, 0x6003, 0x0004, 0x080c, 0x968d, 0x009e, 0x0005, 0x080c,
+	0x9588, 0x080c, 0xcb35, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c,
+	0x009e, 0xd1ec, 0x1138, 0x080c, 0x86b2, 0x080c, 0xae61, 0x080c,
+	0x968d, 0x0005, 0x080c, 0xe7b3, 0x0db0, 0x0cc8, 0x080c, 0x9588,
+	0x2009, 0x0041, 0x0804, 0xdf8d, 0x9182, 0x0040, 0x0002, 0xde3a,
+	0xde3c, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a,
+	0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a,
+	0xde3d, 0xde3a, 0x080c, 0x0dd5, 0x0005, 0x00d6, 0x080c, 0x86b2,
+	0x00de, 0x080c, 0xe80b, 0x080c, 0xae61, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xde5c, 0xde5c, 0xde5c, 0xde5c, 0xde5c, 0xde5c, 0xde5c,
+	0xde5c, 0xde5c, 0xde5e, 0xdecd, 0xde5c, 0xde5c, 0xde5c, 0xde5c,
+	0xdecd, 0xde5c, 0xde5c, 0xde5c, 0x080c, 0x0dd5, 0x2001, 0x0105,
+	0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c, 0x2001,
+	0x0131, 0x2004, 0x9105, 0x1904, 0xdecd, 0x2009, 0x180c, 0x2104,
+	0xd0d4, 0x0904, 0xdecd, 0xc0d4, 0x200a, 0x2009, 0x0105, 0x2104,
+	0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1867, 0x2004,
+	0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x963d, 0x6014, 0x0096,
+	0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e, 0x0002,
+	0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c, 0x97b9,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xdf8d, 0x080c, 0x97b9, 0x6003,
+	0x0007, 0x601b, 0x0000, 0x080c, 0x86b2, 0x009e, 0x0005, 0x2001,
+	0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f, 0x2004,
+	0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102, 0xd1cc,
+	0x0110, 0x080c, 0x2c52, 0x080c, 0x97b9, 0x6014, 0x2048, 0xa97c,
+	0xd1ec, 0x1130, 0x080c, 0x86b2, 0x080c, 0xae61, 0x009e, 0x0005,
+	0x080c, 0xe7b3, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c,
+	0xc1d4, 0x2102, 0x0036, 0x080c, 0x963d, 0x080c, 0x97b9, 0x6014,
+	0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac,
+	0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003,
+	0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xe551, 0x6018, 0x9005,
+	0x1128, 0x2001, 0x1987, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002,
+	0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c,
+	0xdf1e, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c,
+	0xdf1c, 0xdf1c, 0xdf1c, 0xdf69, 0x080c, 0x0dd5, 0x6014, 0x0096,
+	0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
+	0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009,
+	0x0041, 0x009e, 0x0804, 0xdf8d, 0x6003, 0x0007, 0x601b, 0x0000,
+	0x080c, 0x86b2, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006,
+	0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420,
+	0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110,
+	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e,
+	0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006,
+	0x00e9, 0x080c, 0x86b4, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e,
+	0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x15e5, 0x1904, 0xdf1e,
+	0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105,
+	0x1120, 0x080c, 0x15e5, 0x1904, 0xdf1e, 0x0005, 0xd2fc, 0x0140,
+	0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010,
+	0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208,
+	0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0dd5,
+	0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005, 0xdfb0, 0xdfbc, 0xdfc8,
+	0xdfd4, 0xdfb0, 0xdfb0, 0xdfb0, 0xdfb0, 0xdfb7, 0xdfb2, 0xdfb2,
+	0xdfb0, 0xdfb0, 0xdfb0, 0xdfb0, 0xdfb2, 0xdfb0, 0xdfb2, 0xdfb0,
+	0x080c, 0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005, 0x6014,
+	0x9005, 0x190c, 0x0dd5, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x90f0, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d, 0x012e, 0x0005,
+	0x6003, 0x0001, 0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x968d, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x2c10,
+	0x080c, 0x1bad, 0x0126, 0x2091, 0x8000, 0x080c, 0x9155, 0x080c,
+	0x97b9, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036, 0x0096,
+	0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005, 0xdfff,
+	0xe001, 0xe013, 0xe02d, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff,
+	0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0x080c,
+	0x0dd5, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c, 0x0003,
+	0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168,
+	0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x90f0, 0x080c, 0x968d, 0x00e0, 0x901e, 0x6316, 0x631a,
+	0x2019, 0x0004, 0x080c, 0xe551, 0x00a0, 0x6014, 0x2048, 0xa87c,
+	0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70, 0x6003,
+	0x0003, 0x6106, 0x2c10, 0x080c, 0x1bad, 0x080c, 0x9155, 0x080c,
+	0x97b9, 0x0005, 0x080c, 0x9588, 0x6114, 0x81ff, 0x0158, 0x0096,
+	0x2148, 0x080c, 0xe908, 0x0036, 0x2019, 0x0029, 0x080c, 0xe551,
+	0x003e, 0x009e, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005, 0x080c,
+	0x963d, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe908,
+	0x0036, 0x2019, 0x0029, 0x080c, 0xe551, 0x003e, 0x009e, 0x080c,
+	0xae92, 0x080c, 0x97b9, 0x0005, 0x9182, 0x0085, 0x0002, 0xe07e,
+	0xe07c, 0xe07c, 0xe08a, 0xe07c, 0xe07c, 0xe07c, 0xe07c, 0xe07c,
+	0xe07c, 0xe07c, 0xe07c, 0xe07c, 0x080c, 0x0dd5, 0x6003, 0x000b,
+	0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d,
+	0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xe7aa, 0x0118, 0x080c,
+	0xae61, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001, 0x180e,
+	0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be,
+	0x2c00, 0x2011, 0x014e, 0x080c, 0xb182, 0x7220, 0x080c, 0xe3f7,
+	0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0x9296,
+	0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x080c, 0x97b9, 0x00ee, 0x002e, 0x0005, 0x9186,
+	0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a,
+	0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00a2, 0x9186, 0x0027,
+	0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0xaef7, 0x0050, 0x2001,
+	0x0007, 0x080c, 0x657b, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c,
+	0x968d, 0x0005, 0xe0ef, 0xe0f1, 0xe0f1, 0xe0ef, 0xe0ef, 0xe0ef,
+	0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0x080c,
+	0x0dd5, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005,
+	0x9182, 0x0085, 0x0a0c, 0x0dd5, 0x9182, 0x0092, 0x1a0c, 0x0dd5,
+	0x9182, 0x0085, 0x0002, 0xe110, 0xe110, 0xe110, 0xe112, 0xe110,
+	0xe110, 0xe110, 0xe110, 0xe110, 0xe110, 0xe110, 0xe110, 0xe110,
+	0x080c, 0x0dd5, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014,
+	0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaef7, 0x0030, 0x080c,
+	0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005, 0x0036, 0x080c,
+	0xe80b, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006,
+	0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000,
+	0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
+	0x1550, 0x0076, 0x2c38, 0x080c, 0xa747, 0x007e, 0x1520, 0x6000,
+	0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0, 0x0096,
+	0x601c, 0xd084, 0x0140, 0x080c, 0xe80b, 0x080c, 0xd248, 0x080c,
+	0x1a5e, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0110,
+	0x080c, 0xe551, 0x009e, 0x6017, 0x0000, 0x080c, 0xe80b, 0x6023,
+	0x0007, 0x080c, 0xd248, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6,
+	0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c,
+	0x283e, 0x15c8, 0x0016, 0x00c6, 0x080c, 0x65ff, 0x1590, 0x001e,
+	0x00c6, 0x2160, 0x080c, 0xd245, 0x00ce, 0x002e, 0x0026, 0x0016,
+	0x2019, 0x0029, 0x080c, 0xa808, 0x080c, 0x928b, 0x0076, 0x903e,
+	0x080c, 0x9168, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c, 0xe2eb,
+	0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286, 0x0006,
+	0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x327d, 0x002e,
+	0xbcc0, 0x001e, 0x080c, 0x6034, 0xbe12, 0xbd16, 0xbcc2, 0x9006,
+	0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe,
+	0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1824, 0x2104,
+	0x9086, 0x0074, 0x1904, 0xe212, 0x2069, 0x0260, 0x6944, 0x9182,
+	0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xe20f, 0x2001,
+	0x197c, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8c0, 0x9005,
+	0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001, 0x0648,
+	0x080c, 0xe970, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009, 0x0205,
+	0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182, 0x0100,
+	0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001, 0x0288,
+	0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100, 0x00a0,
+	0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017, 0x0700,
+	0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028, 0x6017,
+	0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6, 0x0026,
+	0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff, 0x9286,
+	0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00, 0x8217,
+	0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c, 0x660e,
+	0x0804, 0xe27a, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x000a, 0x080c, 0xbe1d, 0x009e, 0x15a8, 0x2011, 0x027a,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xbe1d,
+	0x009e, 0x1548, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009,
+	0x1848, 0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xe5ae,
+	0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x928b, 0x0076,
+	0x2039, 0x0000, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb, 0x007e,
+	0x2001, 0x0007, 0x080c, 0x657b, 0x2001, 0x0007, 0x080c, 0x654f,
+	0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce,
+	0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118,
+	0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6,
+	0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834,
+	0x080c, 0x283e, 0x11d0, 0x080c, 0x65ff, 0x11b8, 0x2011, 0x0270,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe1d,
+	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xbe1d, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x283e, 0x11d0, 0x080c, 0x65ff, 0x11b8, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe1d, 0x009e,
+	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x0006, 0x080c, 0xbe1d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
+	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029,
+	0x19f0, 0x252c, 0x2021, 0x19f6, 0x2424, 0x2061, 0x1cd0, 0x2071,
+	0x1800, 0x7654, 0x7074, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1ab0,
+	0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xe388, 0x0018, 0x9606,
+	0x0904, 0xe388, 0x080c, 0x8981, 0x0904, 0xe37f, 0x2100, 0x9c06,
+	0x0904, 0xe37f, 0x080c, 0xe5ef, 0x1904, 0xe37f, 0x080c, 0xe98d,
+	0x0904, 0xe37f, 0x080c, 0xe5df, 0x0904, 0xe37f, 0x6720, 0x9786,
+	0x0001, 0x1148, 0x080c, 0x3314, 0x0904, 0xe3c7, 0x6004, 0x9086,
+	0x0000, 0x1904, 0xe3c7, 0x9786, 0x0004, 0x0904, 0xe3c7, 0x9786,
+	0x0007, 0x0904, 0xe37f, 0x2500, 0x9c06, 0x0904, 0xe37f, 0x2400,
+	0x9c06, 0x05e8, 0x88ff, 0x0118, 0x6054, 0x9906, 0x15c0, 0x0096,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a5e, 0x001e,
+	0x9786, 0x000a, 0x0148, 0x080c, 0xcd3b, 0x1130, 0x080c, 0xb813,
+	0x009e, 0x080c, 0xae92, 0x0418, 0x6014, 0x2048, 0x080c, 0xcb35,
+	0x01d8, 0x9786, 0x0003, 0x1570, 0xa867, 0x0103, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0xe908, 0x0016, 0x080c, 0xce24, 0x080c,
+	0x6c75, 0x001e, 0x080c, 0xcd1e, 0x009e, 0x080c, 0xae92, 0x9ce0,
+	0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe2ff,
+	0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce,
+	0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005, 0x0128,
+	0x080c, 0xe908, 0x080c, 0xe551, 0x08f8, 0x009e, 0x0c00, 0x9786,
+	0x0009, 0x11f8, 0x6000, 0x9086, 0x0004, 0x01c0, 0x6000, 0x9086,
+	0x0003, 0x11a0, 0x080c, 0x963d, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xcb35, 0x0118, 0x6010, 0x080c, 0x6c81, 0x009e, 0x00c6, 0x080c,
+	0xae61, 0x00ce, 0x0036, 0x080c, 0x97b9, 0x003e, 0x009e, 0x0804,
+	0xe37f, 0x9786, 0x000a, 0x0904, 0xe366, 0x0804, 0xe364, 0x81ff,
+	0x0904, 0xe37f, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0138,
+	0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1904, 0xe37f, 0x6000,
+	0x9086, 0x0002, 0x1904, 0xe37f, 0x080c, 0xcd2a, 0x0138, 0x080c,
+	0xcd3b, 0x1904, 0xe37f, 0x080c, 0xb813, 0x0038, 0x080c, 0x31e8,
+	0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813, 0x080c, 0xae92, 0x0804,
+	0xe37f, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6,
+	0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xe578, 0x001e,
+	0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005,
+	0xe416, 0xe416, 0xe416, 0xe416, 0xe416, 0xe416, 0xe418, 0xe416,
+	0xe416, 0xe416, 0xe416, 0xae92, 0xae92, 0xe416, 0x9006, 0x0005,
+	0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be,
+	0x2c00, 0x2009, 0x0020, 0x080c, 0xe5ae, 0x001e, 0x004e, 0x2019,
+	0x0002, 0x080c, 0xe134, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096,
+	0x080c, 0xcb35, 0x0140, 0x6014, 0x904d, 0x080c, 0xc768, 0x687b,
+	0x0005, 0x080c, 0x6c81, 0x009e, 0x080c, 0xae92, 0x9085, 0x0001,
+	0x0005, 0x2001, 0x0001, 0x080c, 0x653b, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c,
+	0xbe09, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6,
+	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091,
+	0x8000, 0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001, 0x8fff, 0x0904,
+	0xe4b1, 0x2071, 0x1800, 0x7654, 0x7074, 0x8001, 0x9602, 0x1a04,
+	0xe4b1, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c,
+	0xe5df, 0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006,
+	0x1538, 0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06,
+	0x11f8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x11d0, 0x0096, 0x601c,
+	0xd084, 0x0140, 0x080c, 0xe80b, 0x080c, 0xd248, 0x080c, 0x1a5e,
+	0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0120, 0x0046,
+	0x080c, 0xe551, 0x004e, 0x009e, 0x080c, 0xae92, 0x88ff, 0x1198,
+	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804,
+	0xe466, 0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce,
+	0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x00b6, 0x0076,
+	0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002,
+	0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
+	0x903e, 0x080c, 0xa747, 0x080c, 0xe457, 0x005e, 0x007e, 0x00be,
 	0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20,
-	0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c, 0x6600, 0x11a0,
-	0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c, 0xe7ce,
-	0x004e, 0x0096, 0x904e, 0x080c, 0xa682, 0x009e, 0x008e, 0x903e,
-	0x080c, 0xa72d, 0x080c, 0xe436, 0x003e, 0x001e, 0x8108, 0x1f04,
-	0xe50b, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005,
-	0x0016, 0x00f6, 0x080c, 0xcb19, 0x0198, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803, 0x0000,
-	0xab82, 0x080c, 0x6c79, 0x2f48, 0x0cb0, 0xab82, 0x080c, 0x6c79,
-	0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803, 0x0000,
-	0x080c, 0x6c79, 0x2f48, 0x0cb8, 0x080c, 0x6c79, 0x0c88, 0x00e6,
-	0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005, 0x1138, 0x2071, 0x1800,
-	0x7454, 0x7074, 0x8001, 0x9402, 0x12f8, 0x2100, 0x9c06, 0x0188,
-	0x6000, 0x9086, 0x0000, 0x0168, 0x6008, 0x9206, 0x1150, 0x6320,
-	0x9386, 0x0009, 0x01b0, 0x6010, 0x91a0, 0x0004, 0x2424, 0x9406,
-	0x0140, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1220,
-	0x0c20, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e, 0x00ee,
-	0x0005, 0x631c, 0xd3c4, 0x1d68, 0x0c30, 0x0096, 0x0006, 0x080c,
-	0x0fff, 0x000e, 0x090c, 0x0dd5, 0xaae2, 0xa867, 0x010d, 0xa88e,
-	0x0026, 0x2010, 0x080c, 0xcb09, 0x2001, 0x0000, 0x0120, 0x2200,
-	0x9080, 0x0015, 0x2004, 0x002e, 0xa87a, 0x9186, 0x0020, 0x0110,
-	0xa8e3, 0xffff, 0xa986, 0xac76, 0xa87f, 0x0000, 0x2001, 0x198e,
-	0x2004, 0xa882, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6c79, 0x012e, 0x009e, 0x0005, 0x6700, 0x9786,
-	0x0000, 0x0158, 0x9786, 0x0001, 0x0140, 0x9786, 0x000a, 0x0128,
-	0x9786, 0x0009, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x6010,
-	0x9075, 0x0138, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee,
-	0x0005, 0x9085, 0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e,
-	0x11a0, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0005, 0x2001, 0x1987, 0x2004,
-	0x601a, 0x080c, 0x90c7, 0x080c, 0x9664, 0x001e, 0x0005, 0xa001,
-	0xa001, 0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c,
-	0xce4e, 0x0030, 0x080c, 0xe7ea, 0x080c, 0x8689, 0x080c, 0xae47,
-	0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xe61d,
-	0xe61d, 0xe61d, 0xe61f, 0xe61d, 0xe61f, 0xe61f, 0xe61d, 0xe61f,
-	0xe61d, 0xe61d, 0xe61d, 0xe61d, 0xe61d, 0x9006, 0x0005, 0x9085,
-	0x0001, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002,
-	0xe636, 0xe636, 0xe636, 0xe636, 0xe636, 0xe636, 0xe643, 0xe636,
-	0xe636, 0xe636, 0xe636, 0xe636, 0xe636, 0xe636, 0x6007, 0x003b,
-	0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x080c, 0x90c7,
-	0x080c, 0x9664, 0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xe7ea,
-	0x6043, 0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000,
-	0x00ce, 0x00d6, 0x2268, 0x9186, 0x0007, 0x1904, 0xe69c, 0x6814,
-	0x9005, 0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e,
-	0x08a8, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x90c7, 0x080c,
-	0x9664, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xe713,
-	0x6014, 0x9005, 0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0dd5,
-	0x0804, 0xe713, 0x2048, 0x080c, 0xcb1b, 0x1130, 0x0028, 0x2048,
-	0xa800, 0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003,
-	0x9086, 0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880,
-	0xc0fc, 0xa882, 0x2009, 0x0043, 0x080c, 0xdf6e, 0x0804, 0xe713,
-	0x2009, 0x0041, 0x0804, 0xe70d, 0x9186, 0x0005, 0x15a0, 0x6814,
-	0x2048, 0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xe636,
-	0xd0b4, 0x0128, 0xd0fc, 0x090c, 0x0dd5, 0x0804, 0xe657, 0x6007,
-	0x003a, 0x6003, 0x0001, 0x080c, 0x90c7, 0x080c, 0x9664, 0x00c6,
-	0x2d60, 0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904,
-	0xe713, 0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980,
-	0xc1fc, 0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c, 0x1725, 0x00fe,
-	0x2009, 0x0042, 0x04d0, 0x0036, 0x080c, 0x0fff, 0x090c, 0x0dd5,
-	0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e,
-	0xa887, 0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024,
-	0xc0dd, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004,
-	0x6354, 0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96,
-	0xa89f, 0x0001, 0x080c, 0x6c79, 0x2019, 0x0045, 0x6008, 0x2068,
-	0x080c, 0xe115, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007,
-	0x901e, 0x631a, 0x6342, 0x003e, 0x0038, 0x6043, 0x0000, 0x6003,
-	0x0007, 0x080c, 0xdf6e, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186,
-	0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186,
-	0x0027, 0x1178, 0x080c, 0x955f, 0x0036, 0x0096, 0x6014, 0x2048,
-	0x2019, 0x0004, 0x080c, 0xe530, 0x009e, 0x003e, 0x080c, 0x9664,
-	0x0005, 0x9186, 0x0014, 0x0d70, 0x080c, 0xaedd, 0x0005, 0xe746,
-	0xe744, 0xe744, 0xe744, 0xe744, 0xe744, 0xe746, 0xe744, 0xe744,
-	0xe744, 0xe744, 0xe744, 0xe744, 0x080c, 0x0dd5, 0x080c, 0x955f,
-	0x6003, 0x000c, 0x080c, 0x9664, 0x0005, 0x9182, 0x0092, 0x1220,
-	0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xaedd, 0x0005, 0xe764,
-	0xe764, 0xe764, 0xe764, 0xe766, 0xe786, 0xe764, 0xe764, 0xe764,
-	0xe764, 0xe764, 0xe764, 0xe764, 0x080c, 0x0dd5, 0x00d6, 0x2c68,
-	0x080c, 0xadf1, 0x01b0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009,
-	0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x600b,
-	0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x080c, 0x90c7, 0x080c,
-	0x9664, 0x2d60, 0x080c, 0xae47, 0x00de, 0x0005, 0x080c, 0xae47,
-	0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec,
-	0x00ee, 0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec, 0x05b0, 0x6003,
-	0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001, 0x1988,
-	0x2004, 0x6042, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x1520, 0x00a0,
-	0x2009, 0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026,
-	0x9006, 0x00d8, 0x2001, 0x1988, 0x200c, 0x2001, 0x1986, 0x2004,
-	0x9100, 0x9080, 0x000a, 0x6042, 0x6010, 0x00b6, 0x2058, 0xb8bc,
-	0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0,
-	0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005, 0x0016, 0x00c6,
-	0x00e6, 0x6154, 0xb8bc, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118,
-	0x6054, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c, 0x8689, 0x080c,
-	0xae47, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce,
-	0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8bc, 0x2068,
-	0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e,
-	0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x182c,
-	0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334, 0x9636, 0x1508,
-	0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636, 0x11d0, 0x2011,
-	0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a,
-	0x080c, 0xbe03, 0x009e, 0x1168, 0x2011, 0x0274, 0x20a9, 0x0004,
-	0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c, 0xbe03, 0x009e,
-	0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0x1800,
-	0x080c, 0x5fae, 0x080c, 0x2f96, 0x00ee, 0x0005, 0x0096, 0x0026,
-	0x080c, 0x0fff, 0x090c, 0x0dd5, 0xa85c, 0x9080, 0x001a, 0x20a0,
-	0x20a9, 0x000c, 0xa860, 0x20e8, 0x9006, 0x4004, 0x9186, 0x0046,
-	0x1118, 0xa867, 0x0136, 0x0038, 0xa867, 0x0138, 0x9186, 0x0041,
-	0x0110, 0xa87b, 0x0001, 0x7038, 0x9084, 0xff00, 0x7240, 0x9294,
-	0xff00, 0x8007, 0x9215, 0xaa9a, 0x9186, 0x0046, 0x1168, 0x7038,
-	0x9084, 0x00ff, 0x723c, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x723c,
-	0x9294, 0x00ff, 0xaaa2, 0x0060, 0x7040, 0x9084, 0x00ff, 0x7244,
-	0x9294, 0xff00, 0x9215, 0xaa9e, 0x7244, 0x9294, 0x00ff, 0xaaa2,
-	0x9186, 0x0046, 0x1118, 0x9e90, 0x0012, 0x0010, 0x9e90, 0x001a,
-	0x2204, 0x8007, 0xa8a6, 0x8210, 0x2204, 0x8007, 0xa8aa, 0x8210,
-	0x2204, 0x8007, 0xa8ae, 0x8210, 0x2204, 0x8007, 0xa8b2, 0x8210,
-	0x9186, 0x0046, 0x11b8, 0x9e90, 0x0016, 0x2204, 0x8007, 0xa8b6,
-	0x8210, 0x2204, 0x8007, 0xa8ba, 0x8210, 0x2204, 0x8007, 0xa8be,
-	0x8210, 0x2204, 0x8007, 0xa8c2, 0x8210, 0x2011, 0x0205, 0x2013,
-	0x0001, 0x00b0, 0x9e90, 0x001e, 0x2204, 0x8007, 0xa8b6, 0x8210,
-	0x2204, 0x8007, 0xa8ba, 0x2011, 0x0205, 0x2013, 0x0001, 0x2011,
-	0x0260, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2,
-	0x9186, 0x0046, 0x1118, 0x2011, 0x0262, 0x0010, 0x2011, 0x026a,
-	0x0146, 0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019, 0x0008, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204, 0x8007, 0x4004,
-	0x8210, 0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e, 0x2011, 0x0205,
-	0x2013, 0x0000, 0x002e, 0x080c, 0x6c79, 0x009e, 0x0005, 0x00e6,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc, 0x0108, 0x0011,
-	0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005, 0x00e6, 0x00d6,
-	0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0016, 0x0126,
-	0x2091, 0x8000, 0x2029, 0x19f0, 0x252c, 0x2021, 0x19f6, 0x2424,
-	0x2061, 0x1cd0, 0x2071, 0x1800, 0x7654, 0x7074, 0x9606, 0x0578,
-	0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008, 0x1500, 0x2500,
-	0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c, 0xe5be, 0x01b8,
-	0x080c, 0xe5ce, 0x11a0, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016,
-	0x080c, 0x1a5e, 0x001e, 0x080c, 0xcd10, 0x1110, 0x080c, 0x31e1,
-	0x080c, 0xcd21, 0x1110, 0x080c, 0xb7f9, 0x080c, 0xae78, 0x9ce0,
-	0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208, 0x0858, 0x012e,
-	0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce, 0x00de,
-	0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005, 0x0006,
-	0x2001, 0x1837, 0x2004, 0xd09c, 0x000e, 0x0005, 0x0006, 0x0036,
-	0x0046, 0x080c, 0xd216, 0x0168, 0x2019, 0xffff, 0x9005, 0x0128,
-	0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004, 0x080c,
-	0x4cbc, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086, 0x0001, 0x1128,
-	0x080c, 0xa7ee, 0x080c, 0xae78, 0x9006, 0x0005, 0x00e6, 0x00c6,
-	0x00b6, 0x0046, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7454, 0x7074,
-	0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148, 0x6000, 0x9086,
-	0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x0140, 0x9ce0,
-	0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1220, 0x0c60, 0x9085,
-	0x0001, 0x0008, 0x9006, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x0005,
-	0x0126, 0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071, 0x1840,
-	0xd5a4, 0x0118, 0x7004, 0x8000, 0x7006, 0xd5b4, 0x0118, 0x7000,
-	0x8000, 0x7002, 0xd5ac, 0x0178, 0x2500, 0x9084, 0x0007, 0x908e,
-	0x0003, 0x0148, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118,
-	0x2071, 0xfffe, 0x0089, 0x001e, 0x00ee, 0x000e, 0x012e, 0x0005,
-	0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xfff6, 0x0021,
-	0x00ee, 0x000e, 0x012e, 0x0005, 0x2e05, 0x8000, 0x2077, 0x1220,
-	0x8e70, 0x2e05, 0x8000, 0x2077, 0x0005, 0x00e6, 0x2071, 0xfff4,
-	0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xfff8, 0x0c69, 0x00ee,
-	0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0x1840,
-	0x7014, 0x8000, 0x7016, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0003,
-	0x000b, 0x079e, 0x0000, 0xc000, 0x0001, 0x8064, 0x0008, 0x0010,
-	0x0000, 0x8066, 0x0000, 0x0101, 0x0008, 0x4407, 0x0003, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x580d, 0x000b, 0x79a8, 0x000b, 0x50ee,
-	0x000b, 0x4c0a, 0x0003, 0xbac0, 0x0009, 0x008a, 0x0000, 0x0c0a,
-	0x000b, 0x15fe, 0x0008, 0x340a, 0x0003, 0xc4c0, 0x0009, 0x7000,
-	0x0000, 0xffa0, 0x0001, 0x2000, 0x0000, 0x1668, 0x000b, 0x808c,
-	0x0008, 0x0001, 0x0000, 0x0000, 0x0007, 0x4028, 0x0000, 0x4047,
-	0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0822, 0x0003, 0x4022,
-	0x0000, 0x0028, 0x000b, 0x4122, 0x0008, 0x94c0, 0x0009, 0xff00,
-	0x0008, 0xffe0, 0x0009, 0x0500, 0x0008, 0x0a93, 0x000b, 0x4447,
-	0x0002, 0x0e90, 0x0003, 0x0bfe, 0x0008, 0x11a0, 0x0001, 0x126e,
-	0x0003, 0x0ca0, 0x0001, 0x126e, 0x0003, 0x9180, 0x0001, 0x0004,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x0009, 0x0008, 0x4436, 0x000b, 0x808c, 0x0008, 0x0000,
-	0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x0004, 0x0000, 0x8066,
-	0x0000, 0x0411, 0x0000, 0x443e, 0x0003, 0x03fe, 0x0000, 0x43e0,
-	0x0001, 0x0e6b, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x02e0,
-	0x0001, 0x0e6b, 0x000b, 0x9180, 0x0001, 0x0005, 0x0008, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0019,
-	0x0000, 0x444d, 0x000b, 0x0240, 0x0002, 0x0a68, 0x0003, 0x00fe,
-	0x0000, 0x326b, 0x000b, 0x0248, 0x000a, 0x085c, 0x0003, 0x9180,
-	0x0001, 0x0006, 0x0008, 0x7f62, 0x0008, 0x8002, 0x0008, 0x0003,
-	0x0008, 0x8066, 0x0000, 0x020a, 0x0000, 0x445b, 0x0003, 0x112a,
-	0x0000, 0x002e, 0x0008, 0x022c, 0x0008, 0x3a44, 0x0002, 0x0c0a,
-	0x000b, 0x808c, 0x0008, 0x0002, 0x0000, 0x1760, 0x0008, 0x8062,
-	0x0008, 0x000f, 0x0008, 0x8066, 0x0000, 0x0011, 0x0008, 0x4468,
-	0x0003, 0x01fe, 0x0008, 0x42e0, 0x0009, 0x0e5c, 0x0003, 0x00fe,
-	0x0000, 0x43e0, 0x0001, 0x0e5c, 0x0003, 0x1734, 0x0000, 0x1530,
-	0x0000, 0x1632, 0x0008, 0x0d2a, 0x0008, 0x9880, 0x0001, 0x0010,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x1e0a, 0x0008, 0x447a, 0x0003, 0x808a, 0x0008, 0x0003,
-	0x0008, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000, 0x5880,
-	0x000b, 0x8066, 0x0000, 0x3679, 0x0000, 0x4483, 0x0003, 0x5884,
-	0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x088a, 0x000b, 0x0d00,
-	0x0000, 0x0092, 0x000c, 0x8054, 0x0008, 0x0011, 0x0008, 0x8074,
-	0x0000, 0x1010, 0x0008, 0x1efe, 0x0000, 0x300a, 0x000b, 0x00c8,
-	0x000c, 0x000a, 0x000b, 0x00fe, 0x0000, 0x349a, 0x0003, 0x1a60,
-	0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000, 0x0231,
-	0x0008, 0x4499, 0x000b, 0x03fe, 0x0000, 0x04d0, 0x0001, 0x0cc0,
-	0x000b, 0x82c0, 0x0001, 0x1f00, 0x0000, 0xffa0, 0x0001, 0x0400,
-	0x0000, 0x08af, 0x0003, 0x14c0, 0x000b, 0x01fe, 0x0008, 0x0580,
-	0x0009, 0x7f06, 0x0000, 0x02fe, 0x0008, 0xffc0, 0x0001, 0x00ff,
-	0x0008, 0x0690, 0x0001, 0x10af, 0x0003, 0x7f08, 0x0008, 0x84c0,
-	0x0001, 0xff00, 0x0008, 0x08c0, 0x0003, 0x00fe, 0x0000, 0x34b6,
-	0x000b, 0x8072, 0x0000, 0x1010, 0x0008, 0x3944, 0x0002, 0x08b1,
-	0x0003, 0x00ba, 0x0003, 0x8072, 0x0000, 0x2020, 0x0008, 0x3945,
-	0x000a, 0x08b6, 0x000b, 0x3946, 0x000a, 0x0cc7, 0x0003, 0x0000,
-	0x0007, 0x3943, 0x000a, 0x08c7, 0x000b, 0x00ba, 0x0003, 0x00fe,
-	0x0000, 0x34c5, 0x0003, 0x8072, 0x0000, 0x1000, 0x0000, 0x00c7,
-	0x0003, 0x8072, 0x0000, 0x2000, 0x0000, 0x4000, 0x000f, 0x1c60,
-	0x0000, 0x1b62, 0x0000, 0x8066, 0x0000, 0x0231, 0x0008, 0x44cc,
-	0x000b, 0x58cd, 0x000b, 0x0140, 0x0008, 0x0242, 0x0000, 0x1f43,
-	0x0002, 0x0cdb, 0x000b, 0x0d44, 0x0000, 0x0d46, 0x0008, 0x0348,
-	0x0008, 0x044a, 0x0008, 0x030a, 0x0008, 0x040c, 0x0000, 0x0d06,
-	0x0000, 0x0d08, 0x0008, 0x00df, 0x0003, 0x0344, 0x0008, 0x0446,
-	0x0008, 0x0548, 0x0008, 0x064a, 0x0000, 0x1948, 0x000a, 0x08e2,
-	0x0003, 0x0d4a, 0x0008, 0x58e2, 0x0003, 0x3efe, 0x0008, 0x7f4f,
-	0x0002, 0x08e9, 0x000b, 0x8000, 0x0000, 0x0001, 0x0000, 0x0092,
-	0x000c, 0x8054, 0x0008, 0x0001, 0x0000, 0x8074, 0x0000, 0x2020,
-	0x0008, 0x4000, 0x000f, 0x3a40, 0x000a, 0x0c0d, 0x0003, 0x2b24,
-	0x0008, 0x2b24, 0x0008, 0x58f2, 0x000b, 0x8054, 0x0008, 0x0002,
-	0x0000, 0x1242, 0x0002, 0x0940, 0x0003, 0x3a45, 0x000a, 0x092f,
-	0x0003, 0x8072, 0x0000, 0x1000, 0x0000, 0x3945, 0x000a, 0x08ff,
-	0x0003, 0x8072, 0x0000, 0x3010, 0x0000, 0x1e10, 0x000a, 0x7f3c,
-	0x0000, 0x092a, 0x0003, 0x1d00, 0x0002, 0x7f3a, 0x0000, 0x0d60,
-	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4508,
-	0x000b, 0x00fe, 0x0000, 0x3527, 0x000b, 0x1c60, 0x0000, 0x8062,
-	0x0008, 0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x4510,
-	0x000b, 0x00fe, 0x0000, 0x3243, 0x000b, 0x0038, 0x0000, 0x0060,
-	0x0008, 0x8062, 0x0008, 0x0019, 0x0000, 0x8066, 0x0000, 0x0009,
-	0x0008, 0x4519, 0x000b, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f3e,
-	0x0008, 0x0d60, 0x0000, 0x0efe, 0x0008, 0x1f80, 0x0001, 0x7f62,
-	0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4523, 0x000b, 0x003a,
-	0x0008, 0x1dfe, 0x0000, 0x0104, 0x000b, 0x0036, 0x0008, 0x00c8,
-	0x000c, 0x0140, 0x000b, 0x8074, 0x0000, 0x2000, 0x0000, 0x8072,
-	0x0000, 0x2000, 0x0000, 0x0140, 0x000b, 0x3a44, 0x0002, 0x0a71,
-	0x000b, 0x8074, 0x0000, 0x1000, 0x0000, 0x8072, 0x0000, 0x1000,
-	0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x0000, 0x3640, 0x0003, 0x26fe,
-	0x0008, 0x26fe, 0x0008, 0x2700, 0x0008, 0x2700, 0x0008, 0x00d0,
-	0x0009, 0x0d52, 0x000b, 0x8074, 0x0000, 0x4040, 0x0008, 0x5940,
-	0x0003, 0x50ee, 0x000b, 0x3a46, 0x000a, 0x0d52, 0x000b, 0x3a47,
-	0x0002, 0x094d, 0x000b, 0x8054, 0x0008, 0x0004, 0x0000, 0x8074,
-	0x0000, 0x8000, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x019c,
-	0x0003, 0x92c0, 0x0009, 0x0fc8, 0x0000, 0x080a, 0x0003, 0x1246,
-	0x000a, 0x0e3a, 0x0003, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002,
-	0x0000, 0x8066, 0x0000, 0x362a, 0x0000, 0x4557, 0x000b, 0x2000,
-	0x0000, 0x2000, 0x0000, 0x2102, 0x0000, 0x2102, 0x0000, 0x2204,
-	0x0000, 0x2204, 0x0000, 0x2306, 0x0000, 0x2306, 0x0000, 0x2408,
-	0x0000, 0x2408, 0x0000, 0x250a, 0x0000, 0x250a, 0x0000, 0x260c,
-	0x0000, 0x260c, 0x0000, 0x270e, 0x0000, 0x270e, 0x0000, 0x2810,
-	0x0000, 0x2810, 0x0000, 0x2912, 0x0000, 0x2912, 0x0000, 0x1a60,
-	0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000, 0x0052,
-	0x0000, 0x4571, 0x0003, 0x92c0, 0x0009, 0x0780, 0x0008, 0x0e56,
-	0x0003, 0x124b, 0x0002, 0x097a, 0x0003, 0x2e4d, 0x0002, 0x2e4d,
-	0x0002, 0x0a40, 0x0003, 0x3a46, 0x000a, 0x0d8a, 0x000b, 0x597c,
-	0x0003, 0x8054, 0x0008, 0x0004, 0x0000, 0x1243, 0x000a, 0x0998,
-	0x0003, 0x8010, 0x0008, 0x000d, 0x0000, 0x021b, 0x000c, 0x1948,
-	0x000a, 0x0987, 0x000b, 0x0210, 0x0004, 0x1810, 0x0000, 0x021b,
-	0x000c, 0x0198, 0x000b, 0x1948, 0x000a, 0x098e, 0x000b, 0x1243,
-	0x000a, 0x0a43, 0x0003, 0x194d, 0x000a, 0x0992, 0x0003, 0x1243,
-	0x000a, 0x0a4a, 0x0003, 0x5992, 0x0003, 0x8054, 0x0008, 0x0004,
-	0x0000, 0x0210, 0x0004, 0x1810, 0x0000, 0x021b, 0x000c, 0x8074,
-	0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30,
-	0x0000, 0x3a42, 0x0002, 0x0da2, 0x000b, 0x15fe, 0x0008, 0x3461,
-	0x000b, 0x000a, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000, 0x8010,
-	0x0008, 0x000c, 0x0008, 0x021b, 0x000c, 0x000a, 0x000b, 0xbbe0,
-	0x0009, 0x0030, 0x0008, 0x0db8, 0x0003, 0x18fe, 0x0000, 0x3ce0,
-	0x0009, 0x09b5, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x09b5,
-	0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x0208,
-	0x000b, 0x8076, 0x0008, 0x0041, 0x0008, 0x0208, 0x000b, 0xbbe0,
-	0x0009, 0x0032, 0x0000, 0x0dbd, 0x0003, 0x3c1e, 0x0008, 0x0208,
-	0x000b, 0xbbe0, 0x0009, 0x003b, 0x0000, 0x0dc2, 0x000b, 0x3c20,
-	0x0000, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x0035, 0x0008, 0x0dc8,
-	0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x0384, 0x000b, 0xbbe0,
-	0x0009, 0x0036, 0x0008, 0x0aa5, 0x000b, 0xbbe0, 0x0009, 0x0037,
-	0x0000, 0x0de9, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x0db5,
-	0x000b, 0x8076, 0x0008, 0x0040, 0x0000, 0x1a60, 0x0000, 0x8062,
-	0x0008, 0x000d, 0x0000, 0x2604, 0x0008, 0x2604, 0x0008, 0x2706,
-	0x0008, 0x2706, 0x0008, 0x2808, 0x0000, 0x2808, 0x0000, 0x290a,
-	0x0000, 0x290a, 0x0000, 0x8066, 0x0000, 0x0422, 0x0000, 0x45e0,
-	0x000b, 0x0210, 0x0004, 0x8054, 0x0008, 0x0004, 0x0000, 0x8074,
-	0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0xb000, 0x0000, 0x019c,
-	0x0003, 0xbbe0, 0x0009, 0x0038, 0x0000, 0x0dfb, 0x000b, 0x18fe,
-	0x0000, 0x3ce0, 0x0009, 0x09f8, 0x0003, 0x15fe, 0x0008, 0x3ce0,
-	0x0009, 0x0db1, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040,
-	0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x0268, 0x000b, 0x8076,
-	0x0008, 0x0042, 0x0008, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x0016,
-	0x0000, 0x0e08, 0x000b, 0x8074, 0x0000, 0x0808, 0x0008, 0x3a44,
-	0x0002, 0x0c0c, 0x000b, 0x8074, 0x0000, 0x0800, 0x0000, 0x8072,
-	0x0000, 0x8000, 0x0000, 0x8000, 0x000f, 0x000a, 0x000b, 0x8072,
-	0x0000, 0x8000, 0x0000, 0x000a, 0x000b, 0x3d30, 0x000a, 0x7f00,
-	0x0000, 0xbc80, 0x0001, 0x0007, 0x0000, 0x0214, 0x0003, 0x1930,
-	0x000a, 0x7f00, 0x0000, 0x9880, 0x0001, 0x0007, 0x0000, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x000a,
-	0x0008, 0x4619, 0x000b, 0x4000, 0x000f, 0x221e, 0x000b, 0x0870,
-	0x0008, 0x4000, 0x000f, 0x7e1b, 0x000b, 0xbbe0, 0x0009, 0x0030,
-	0x0008, 0x0e1b, 0x0003, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x0a2c,
-	0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0a2c, 0x0003, 0x020b,
-	0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x022e, 0x0003, 0x8076,
-	0x0008, 0x0041, 0x0008, 0x8072, 0x0000, 0x8000, 0x0000, 0x021b,
-	0x0003, 0xbac0, 0x0009, 0x0090, 0x0008, 0x0a37, 0x0003, 0x8074,
-	0x0000, 0x0706, 0x0000, 0x0239, 0x0003, 0x8074, 0x0000, 0x0703,
-	0x0000, 0x4000, 0x000f, 0x8010, 0x0008, 0x0023, 0x0000, 0x0276,
-	0x000b, 0x8010, 0x0008, 0x0008, 0x0000, 0x0276, 0x000b, 0x8010,
-	0x0008, 0x0022, 0x0008, 0x0276, 0x000b, 0x0210, 0x0004, 0x8010,
-	0x0008, 0x0007, 0x0000, 0x021b, 0x000c, 0x1810, 0x0000, 0x021b,
-	0x000c, 0x0282, 0x0003, 0x0210, 0x0004, 0x8010, 0x0008, 0x001b,
-	0x0008, 0x021b, 0x000c, 0x1810, 0x0000, 0x021b, 0x000c, 0x8074,
-	0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30,
-	0x0000, 0x000a, 0x000b, 0x8010, 0x0008, 0x0009, 0x0008, 0x0276,
-	0x000b, 0x8010, 0x0008, 0x0005, 0x0008, 0x0276, 0x000b, 0x1648,
-	0x000a, 0x0c6f, 0x000b, 0x808c, 0x0008, 0x0001, 0x0000, 0x8010,
-	0x0008, 0x0004, 0x0000, 0x4143, 0x000a, 0x086f, 0x0003, 0x3a44,
-	0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008, 0x0276, 0x000b, 0x8010,
-	0x0008, 0x0003, 0x0008, 0x027a, 0x000b, 0x8010, 0x0008, 0x000b,
-	0x0000, 0x027a, 0x000b, 0x8010, 0x0008, 0x0002, 0x0000, 0x027a,
-	0x000b, 0x3a47, 0x0002, 0x0d40, 0x000b, 0x8010, 0x0008, 0x0006,
-	0x0008, 0x027a, 0x000b, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072,
-	0x0000, 0x3000, 0x0008, 0x021b, 0x000c, 0x0231, 0x0004, 0x3a40,
-	0x000a, 0x080a, 0x0003, 0x8010, 0x0008, 0x000c, 0x0008, 0x021b,
-	0x000c, 0x000a, 0x000b, 0x8074, 0x0000, 0xf080, 0x0000, 0x8072,
-	0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x2e4d, 0x0002, 0x2e4d,
-	0x0002, 0x0a8d, 0x000b, 0x8054, 0x0008, 0x0019, 0x0000, 0x000a,
-	0x000b, 0x8054, 0x0008, 0x0009, 0x0008, 0x000a, 0x000b, 0x3a44,
-	0x0002, 0x0c0a, 0x000b, 0x026b, 0x000b, 0x808c, 0x0008, 0x0000,
-	0x0008, 0x4447, 0x0002, 0x0ab9, 0x0003, 0xc0c0, 0x0001, 0x00ff,
-	0x0008, 0xffe0, 0x0009, 0x00ff, 0x0008, 0x0e90, 0x0003, 0xc1e0,
-	0x0001, 0xffff, 0x0008, 0x0e90, 0x0003, 0x8010, 0x0008, 0x0013,
-	0x0000, 0x021b, 0x000c, 0x8074, 0x0000, 0x0202, 0x0008, 0x000a,
-	0x000b, 0x3a40, 0x000a, 0x0eb6, 0x000b, 0x8074, 0x0000, 0x0200,
-	0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x0000, 0x43e0, 0x0001, 0x0eb4, 0x0003, 0x42fe, 0x0000, 0xffc0,
-	0x0001, 0x00ff, 0x0008, 0x00e0, 0x0009, 0x0a90, 0x000b, 0x0d08,
-	0x0008, 0x0309, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x000a,
-	0x000b, 0x038d, 0x0004, 0x808c, 0x0008, 0x0001, 0x0000, 0x04fe,
-	0x0008, 0x3370, 0x0003, 0x0460, 0x0000, 0x8062, 0x0008, 0x0001,
-	0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x46c3, 0x0003, 0x0004,
-	0x0000, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f00, 0x0000, 0x80e0,
-	0x0001, 0x0004, 0x0000, 0x0add, 0x000b, 0x80e0, 0x0001, 0x0005,
-	0x0008, 0x0add, 0x000b, 0x80e0, 0x0001, 0x0006, 0x0008, 0x0add,
-	0x000b, 0x82c0, 0x0001, 0xff00, 0x0008, 0x7f04, 0x0008, 0x82e0,
-	0x0009, 0x0600, 0x0008, 0x0add, 0x000b, 0x82e0, 0x0009, 0x0500,
-	0x0008, 0x0add, 0x000b, 0x82e0, 0x0009, 0x0400, 0x0000, 0x0f70,
-	0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffe0, 0x0009, 0x1000,
-	0x0000, 0x0b09, 0x0003, 0x037e, 0x0004, 0x3941, 0x0002, 0x0ae8,
-	0x000b, 0x8072, 0x0000, 0x0400, 0x0000, 0x000a, 0x000b, 0x0460,
-	0x0000, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x2209, 0x0008, 0x46ee, 0x0003, 0x11fe, 0x0000, 0x3304,
-	0x0003, 0x9180, 0x0001, 0x0002, 0x0000, 0x8060, 0x0000, 0x0400,
-	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0609, 0x0008, 0x46f8,
-	0x000b, 0x42fe, 0x0000, 0xffc0, 0x0001, 0xff00, 0x0008, 0x03e0,
-	0x0009, 0x0f01, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000, 0x0046,
-	0x0003, 0x9180, 0x0001, 0x0003, 0x0008, 0x02eb, 0x0003, 0x8072,
-	0x0000, 0x0400, 0x0000, 0x8010, 0x0008, 0x0010, 0x0000, 0x0361,
-	0x0003, 0x037e, 0x0004, 0x3941, 0x0002, 0x0b0f, 0x0003, 0x8072,
-	0x0000, 0x0400, 0x0000, 0x000a, 0x000b, 0x0346, 0x000c, 0x11fe,
-	0x0000, 0x0f17, 0x000b, 0x8072, 0x0000, 0x0400, 0x0000, 0x8010,
-	0x0008, 0x000e, 0x0000, 0x0361, 0x0003, 0x8060, 0x0000, 0x0400,
-	0x0000, 0x04fe, 0x0008, 0x0f2c, 0x0003, 0x808c, 0x0008, 0x0000,
-	0x0008, 0x9180, 0x0001, 0x0005, 0x0008, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x0009, 0x0008, 0x4722, 0x000b, 0x0060, 0x0008, 0x8062,
-	0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206, 0x0008, 0x8066,
-	0x0000, 0x0412, 0x0000, 0x472a, 0x0003, 0x0343, 0x0003, 0x808c,
-	0x0008, 0x0001, 0x0000, 0x0460, 0x0000, 0x8062, 0x0008, 0x002b,
-	0x0008, 0x8066, 0x0000, 0x0609, 0x0008, 0x4733, 0x000b, 0x8066,
-	0x0000, 0x220a, 0x0008, 0x4736, 0x000b, 0x42fe, 0x0000, 0xffc0,
-	0x0001, 0xff00, 0x0008, 0x7f04, 0x0008, 0x8060, 0x0000, 0x0400,
-	0x0000, 0x9180, 0x0001, 0x0002, 0x0000, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x041a, 0x0008, 0x4742, 0x000b, 0x8072, 0x0000, 0x0400,
-	0x0000, 0x0046, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x1362,
-	0x0008, 0x8066, 0x0000, 0x0411, 0x0000, 0x474b, 0x000b, 0x02fe,
-	0x0008, 0x03e0, 0x0009, 0x0f51, 0x0003, 0x0d22, 0x0000, 0x4000,
-	0x000f, 0x8280, 0x0009, 0x0002, 0x0000, 0x1380, 0x0001, 0x7f62,
-	0x0008, 0x8066, 0x0000, 0x2209, 0x0008, 0x4757, 0x0003, 0x0200,
-	0x000a, 0xffc0, 0x0001, 0x0007, 0x0000, 0x7f06, 0x0000, 0x1362,
-	0x0008, 0x8066, 0x0000, 0x060a, 0x0008, 0x475f, 0x000b, 0x4000,
-	0x000f, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x2f44, 0x000a, 0x2f44,
-	0x000a, 0x0e6b, 0x000b, 0x808a, 0x0008, 0x0003, 0x0008, 0x8074,
-	0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x5b6c,
-	0x0003, 0x8054, 0x0008, 0x0019, 0x0000, 0x000a, 0x000b, 0x3a44,
-	0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0000, 0x0008, 0x8010,
-	0x0008, 0x0011, 0x0008, 0x021b, 0x000c, 0x42fe, 0x0000, 0xffc0,
-	0x0001, 0x00ff, 0x0008, 0x7f10, 0x0008, 0x021b, 0x000c, 0x4310,
-	0x0008, 0x027a, 0x000b, 0x3941, 0x0002, 0x0b81, 0x0003, 0x4000,
-	0x000f, 0x8072, 0x0000, 0x0404, 0x0008, 0x4000, 0x000f, 0x8010,
-	0x0008, 0x0012, 0x0008, 0x021b, 0x000c, 0x0346, 0x000c, 0x1110,
-	0x0000, 0x021b, 0x000c, 0x11fe, 0x0000, 0x0f87, 0x000b, 0x000a,
-	0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x7f00, 0x0000, 0xc3c0,
-	0x0001, 0xff00, 0x0008, 0x00d0, 0x0009, 0x0bb2, 0x0003, 0x0d0a,
-	0x0000, 0x8580, 0x0001, 0x1000, 0x0000, 0x7f62, 0x0008, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x8066, 0x0000, 0x0809, 0x0000, 0x479c,
-	0x000b, 0x04fe, 0x0008, 0x33ab, 0x0003, 0x0460, 0x0000, 0x8062,
-	0x0008, 0x0004, 0x0000, 0x8066, 0x0000, 0x0211, 0x0000, 0x47a4,
-	0x0003, 0x01fe, 0x0008, 0x00e0, 0x0009, 0x0fab, 0x0003, 0x02fe,
-	0x0008, 0x43e0, 0x0001, 0x0bb1, 0x0003, 0x0500, 0x0002, 0x7f0a,
-	0x0000, 0xffe0, 0x0009, 0x0800, 0x0000, 0x0f95, 0x000b, 0x0d08,
-	0x0008, 0x4000, 0x000f, 0x43fe, 0x0008, 0x3e80, 0x0001, 0xffc0,
-	0x0001, 0x7fff, 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x0809, 0x0000, 0x47ba, 0x0003, 0x8060, 0x0000, 0x0400,
-	0x0000, 0x84c0, 0x0001, 0xff00, 0x0008, 0x7f60, 0x000a, 0x7f60,
-	0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60,
-	0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0xff80, 0x0009, 0x1000,
-	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0809, 0x0000, 0x47cc,
-	0x000b, 0x4000, 0x000f, 0xd7f4, 0xebe5, 0x0001, 0x0002, 0x0004,
-	0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400,
-	0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x45cc
+	0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c, 0x65ff,
+	0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001, 0x0096,
+	0x904e, 0x080c, 0xa69c, 0x009e, 0x008e, 0x903e, 0x080c, 0xa747,
+	0x080c, 0xe457, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xe4e4,
+	0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x00b6,
+	0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001,
+	0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
+	0x903e, 0x080c, 0xa747, 0x2c20, 0x080c, 0xe457, 0x005e, 0x007e,
+	0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
+	0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c, 0x65ff,
+	0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c,
+	0xe7ef, 0x004e, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
+	0x903e, 0x080c, 0xa747, 0x080c, 0xe457, 0x003e, 0x001e, 0x8108,
+	0x1f04, 0xe52c, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be,
+	0x0005, 0x0016, 0x00f6, 0x080c, 0xcb33, 0x0198, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803,
+	0x0000, 0xab82, 0x080c, 0x6c81, 0x2f48, 0x0cb0, 0xab82, 0x080c,
+	0x6c81, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803,
+	0x0000, 0x080c, 0x6c81, 0x2f48, 0x0cb8, 0x080c, 0x6c81, 0x0c88,
+	0x00e6, 0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005, 0x1138, 0x2071,
+	0x1800, 0x7454, 0x7074, 0x8001, 0x9402, 0x12f8, 0x2100, 0x9c06,
+	0x0188, 0x6000, 0x9086, 0x0000, 0x0168, 0x6008, 0x9206, 0x1150,
+	0x6320, 0x9386, 0x0009, 0x01b0, 0x6010, 0x91a0, 0x0004, 0x2424,
+	0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1220, 0x0c20, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e,
+	0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68, 0x0c30, 0x0096, 0x0006,
+	0x080c, 0x0fff, 0x000e, 0x090c, 0x0dd5, 0xaae2, 0xa867, 0x010d,
+	0xa88e, 0x0026, 0x2010, 0x080c, 0xcb23, 0x2001, 0x0000, 0x0120,
+	0x2200, 0x9080, 0x0015, 0x2004, 0x002e, 0xa87a, 0x9186, 0x0020,
+	0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76, 0xa87f, 0x0000, 0x2001,
+	0x198e, 0x2004, 0xa882, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x009e, 0x0005, 0x6700,
+	0x9786, 0x0000, 0x0158, 0x9786, 0x0001, 0x0140, 0x9786, 0x000a,
+	0x0128, 0x9786, 0x0009, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6,
+	0x6010, 0x9075, 0x0138, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206,
+	0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e,
+	0x001e, 0x11a0, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0005, 0x2001, 0x1987,
+	0x2004, 0x601a, 0x080c, 0x90f0, 0x080c, 0x968d, 0x001e, 0x0005,
+	0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118,
+	0x080c, 0xce68, 0x0030, 0x080c, 0xe80b, 0x080c, 0x86b2, 0x080c,
+	0xae61, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002,
+	0xe63e, 0xe63e, 0xe63e, 0xe640, 0xe63e, 0xe640, 0xe640, 0xe63e,
+	0xe640, 0xe63e, 0xe63e, 0xe63e, 0xe63e, 0xe63e, 0x9006, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f,
+	0x0002, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe664,
+	0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0x6007,
+	0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x080c,
+	0x90f0, 0x080c, 0x968d, 0x0005, 0x0096, 0x00c6, 0x2260, 0x080c,
+	0xe80b, 0x6043, 0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b,
+	0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186, 0x0007, 0x1904, 0xe6bd,
+	0x6814, 0x9005, 0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de,
+	0x009e, 0x08a8, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x1904,
+	0xe734, 0x6014, 0x9005, 0x1138, 0x6000, 0x9086, 0x0007, 0x190c,
+	0x0dd5, 0x0804, 0xe734, 0x2048, 0x080c, 0xcb35, 0x1130, 0x0028,
+	0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084,
+	0x0003, 0x9086, 0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e,
+	0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043, 0x080c, 0xdf8d, 0x0804,
+	0xe734, 0x2009, 0x0041, 0x0804, 0xe72e, 0x9186, 0x0005, 0x15a0,
+	0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804,
+	0xe657, 0xd0b4, 0x0128, 0xd0fc, 0x090c, 0x0dd5, 0x0804, 0xe678,
+	0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x90f0, 0x080c, 0x968d,
+	0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004,
+	0x1904, 0xe734, 0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e,
+	0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c, 0x1725,
+	0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036, 0x080c, 0x0fff, 0x090c,
+	0x0dd5, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18,
+	0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360,
+	0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be,
+	0x2004, 0x6354, 0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a,
+	0xae96, 0xa89f, 0x0001, 0x080c, 0x6c81, 0x2019, 0x0045, 0x6008,
+	0x2068, 0x080c, 0xe134, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003,
+	0x0007, 0x901e, 0x631a, 0x6342, 0x003e, 0x0038, 0x6043, 0x0000,
+	0x6003, 0x0007, 0x080c, 0xdf8d, 0x00ce, 0x00de, 0x009e, 0x0005,
+	0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x00c2,
+	0x9186, 0x0027, 0x1178, 0x080c, 0x9588, 0x0036, 0x0096, 0x6014,
+	0x2048, 0x2019, 0x0004, 0x080c, 0xe551, 0x009e, 0x003e, 0x080c,
+	0x968d, 0x0005, 0x9186, 0x0014, 0x0d70, 0x080c, 0xaef7, 0x0005,
+	0xe767, 0xe765, 0xe765, 0xe765, 0xe765, 0xe765, 0xe767, 0xe765,
+	0xe765, 0xe765, 0xe765, 0xe765, 0xe765, 0x080c, 0x0dd5, 0x080c,
+	0x9588, 0x6003, 0x000c, 0x080c, 0x968d, 0x0005, 0x9182, 0x0092,
+	0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xaef7, 0x0005,
+	0xe785, 0xe785, 0xe785, 0xe785, 0xe787, 0xe7a7, 0xe785, 0xe785,
+	0xe785, 0xe785, 0xe785, 0xe785, 0xe785, 0x080c, 0x0dd5, 0x00d6,
+	0x2c68, 0x080c, 0xae0b, 0x01b0, 0x6003, 0x0001, 0x6007, 0x001e,
+	0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e,
+	0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x080c, 0x90f0,
+	0x080c, 0x968d, 0x2d60, 0x080c, 0xae61, 0x00de, 0x0005, 0x080c,
+	0xae61, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec, 0x05b0,
+	0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001,
+	0x1988, 0x2004, 0x6042, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x1520,
+	0x00a0, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4,
+	0x6026, 0x9006, 0x00d8, 0x2001, 0x1988, 0x200c, 0x2001, 0x1986,
+	0x2004, 0x9100, 0x9080, 0x000a, 0x6042, 0x6010, 0x00b6, 0x2058,
+	0xb8bc, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088, 0x0003,
+	0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005, 0x0016,
+	0x00c6, 0x00e6, 0x6154, 0xb8bc, 0x2060, 0x8cff, 0x0180, 0x84ff,
+	0x1118, 0x6054, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c, 0x86b2,
+	0x080c, 0xae61, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee,
+	0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8bc,
+	0x2068, 0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c,
+	0x680e, 0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156, 0x2011,
+	0x182c, 0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334, 0x9636,
+	0x1508, 0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636, 0x11d0,
+	0x2011, 0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
+	0x000a, 0x080c, 0xbe1d, 0x009e, 0x1168, 0x2011, 0x0274, 0x20a9,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c, 0xbe1d,
+	0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071,
+	0x1800, 0x080c, 0x5fad, 0x080c, 0x2f96, 0x00ee, 0x0005, 0x0096,
+	0x0026, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0xa85c, 0x9080, 0x001a,
+	0x20a0, 0x20a9, 0x000c, 0xa860, 0x20e8, 0x9006, 0x4004, 0x9186,
+	0x0046, 0x1118, 0xa867, 0x0136, 0x0038, 0xa867, 0x0138, 0x9186,
+	0x0041, 0x0110, 0xa87b, 0x0001, 0x7038, 0x9084, 0xff00, 0x7240,
+	0x9294, 0xff00, 0x8007, 0x9215, 0xaa9a, 0x9186, 0x0046, 0x1168,
+	0x7038, 0x9084, 0x00ff, 0x723c, 0x9294, 0xff00, 0x9215, 0xaa9e,
+	0x723c, 0x9294, 0x00ff, 0xaaa2, 0x0060, 0x7040, 0x9084, 0x00ff,
+	0x7244, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x7244, 0x9294, 0x00ff,
+	0xaaa2, 0x9186, 0x0046, 0x1118, 0x9e90, 0x0012, 0x0010, 0x9e90,
+	0x001a, 0x2204, 0x8007, 0xa8a6, 0x8210, 0x2204, 0x8007, 0xa8aa,
+	0x8210, 0x2204, 0x8007, 0xa8ae, 0x8210, 0x2204, 0x8007, 0xa8b2,
+	0x8210, 0x9186, 0x0046, 0x11b8, 0x9e90, 0x0016, 0x2204, 0x8007,
+	0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba, 0x8210, 0x2204, 0x8007,
+	0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x8210, 0x2011, 0x0205,
+	0x2013, 0x0001, 0x00b0, 0x9e90, 0x001e, 0x2204, 0x8007, 0xa8b6,
+	0x8210, 0x2204, 0x8007, 0xa8ba, 0x2011, 0x0205, 0x2013, 0x0001,
+	0x2011, 0x0260, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204, 0x8007,
+	0xa8c2, 0x9186, 0x0046, 0x1118, 0x2011, 0x0262, 0x0010, 0x2011,
+	0x026a, 0x0146, 0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019, 0x0008,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204, 0x8007,
+	0x4004, 0x8210, 0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e, 0x2011,
+	0x0205, 0x2013, 0x0000, 0x002e, 0x080c, 0x6c81, 0x009e, 0x0005,
+	0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc, 0x0108,
+	0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005, 0x00e6,
+	0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0016,
+	0x0126, 0x2091, 0x8000, 0x2029, 0x19f0, 0x252c, 0x2021, 0x19f6,
+	0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7654, 0x7074, 0x9606,
+	0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008, 0x1500,
+	0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c, 0xe5df,
+	0x01b8, 0x080c, 0xe5ef, 0x11a0, 0x6000, 0x9086, 0x0004, 0x1120,
+	0x0016, 0x080c, 0x1a5e, 0x001e, 0x080c, 0xcd2a, 0x1110, 0x080c,
+	0x31e8, 0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813, 0x080c, 0xae92,
+	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208, 0x0858,
+	0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce,
+	0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005,
+	0x0006, 0x2001, 0x1837, 0x2004, 0xd09c, 0x000e, 0x0005, 0x0006,
+	0x0036, 0x0046, 0x080c, 0xd230, 0x0168, 0x2019, 0xffff, 0x9005,
+	0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
+	0x080c, 0x4cbb, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086, 0x0001,
+	0x1128, 0x080c, 0xa808, 0x080c, 0xae92, 0x9006, 0x0005, 0x00e6,
+	0x00c6, 0x00b6, 0x0046, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7454,
+	0x7074, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148, 0x6000,
+	0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x0140,
+	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1220, 0x0c60,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be, 0x00ce, 0x00ee,
+	0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071,
+	0x1840, 0xd5a4, 0x0118, 0x7004, 0x8000, 0x7006, 0xd5b4, 0x0118,
+	0x7000, 0x8000, 0x7002, 0xd5ac, 0x0178, 0x2500, 0x9084, 0x0007,
+	0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005,
+	0x0118, 0x2071, 0xfffe, 0x0089, 0x001e, 0x00ee, 0x000e, 0x012e,
+	0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xfff6,
+	0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e05, 0x8000, 0x2077,
+	0x1220, 0x8e70, 0x2e05, 0x8000, 0x2077, 0x0005, 0x00e6, 0x2071,
+	0xfff4, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xfff8, 0x0c69,
+	0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071,
+	0x1840, 0x7014, 0x8000, 0x7016, 0x00ee, 0x000e, 0x012e, 0x0005,
+	0x0003, 0x000b, 0x079e, 0x0000, 0xc000, 0x0001, 0x8064, 0x0008,
+	0x0010, 0x0000, 0x8066, 0x0000, 0x0101, 0x0008, 0x4407, 0x0003,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x580d, 0x000b, 0x79a8, 0x000b,
+	0x50ee, 0x000b, 0x4c0a, 0x0003, 0xbac0, 0x0009, 0x008a, 0x0000,
+	0x0c0a, 0x000b, 0x15fe, 0x0008, 0x340a, 0x0003, 0xc4c0, 0x0009,
+	0x7000, 0x0000, 0xffa0, 0x0001, 0x2000, 0x0000, 0x1668, 0x000b,
+	0x808c, 0x0008, 0x0001, 0x0000, 0x0000, 0x0007, 0x4028, 0x0000,
+	0x4047, 0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0822, 0x0003,
+	0x4022, 0x0000, 0x0028, 0x000b, 0x4122, 0x0008, 0x94c0, 0x0009,
+	0xff00, 0x0008, 0xffe0, 0x0009, 0x0500, 0x0008, 0x0a93, 0x000b,
+	0x4447, 0x0002, 0x0e90, 0x0003, 0x0bfe, 0x0008, 0x11a0, 0x0001,
+	0x126e, 0x0003, 0x0ca0, 0x0001, 0x126e, 0x0003, 0x9180, 0x0001,
+	0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x4436, 0x000b, 0x808c, 0x0008,
+	0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x0004, 0x0000,
+	0x8066, 0x0000, 0x0411, 0x0000, 0x443e, 0x0003, 0x03fe, 0x0000,
+	0x43e0, 0x0001, 0x0e6b, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008,
+	0x02e0, 0x0001, 0x0e6b, 0x000b, 0x9180, 0x0001, 0x0005, 0x0008,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x0019, 0x0000, 0x444d, 0x000b, 0x0240, 0x0002, 0x0a68, 0x0003,
+	0x00fe, 0x0000, 0x326b, 0x000b, 0x0248, 0x000a, 0x085c, 0x0003,
+	0x9180, 0x0001, 0x0006, 0x0008, 0x7f62, 0x0008, 0x8002, 0x0008,
+	0x0003, 0x0008, 0x8066, 0x0000, 0x020a, 0x0000, 0x445b, 0x0003,
+	0x112a, 0x0000, 0x002e, 0x0008, 0x022c, 0x0008, 0x3a44, 0x0002,
+	0x0c0a, 0x000b, 0x808c, 0x0008, 0x0002, 0x0000, 0x1760, 0x0008,
+	0x8062, 0x0008, 0x000f, 0x0008, 0x8066, 0x0000, 0x0011, 0x0008,
+	0x4468, 0x0003, 0x01fe, 0x0008, 0x42e0, 0x0009, 0x0e5c, 0x0003,
+	0x00fe, 0x0000, 0x43e0, 0x0001, 0x0e5c, 0x0003, 0x1734, 0x0000,
+	0x1530, 0x0000, 0x1632, 0x0008, 0x0d2a, 0x0008, 0x9880, 0x0001,
+	0x0010, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x1e0a, 0x0008, 0x447a, 0x0003, 0x808a, 0x0008,
+	0x0003, 0x0008, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000,
+	0x5880, 0x000b, 0x8066, 0x0000, 0x3679, 0x0000, 0x4483, 0x0003,
+	0x5884, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x088a, 0x000b,
+	0x0d00, 0x0000, 0x0092, 0x000c, 0x8054, 0x0008, 0x0011, 0x0008,
+	0x8074, 0x0000, 0x1010, 0x0008, 0x1efe, 0x0000, 0x300a, 0x000b,
+	0x00c8, 0x000c, 0x000a, 0x000b, 0x00fe, 0x0000, 0x349a, 0x0003,
+	0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000,
+	0x0231, 0x0008, 0x4499, 0x000b, 0x03fe, 0x0000, 0x04d0, 0x0001,
+	0x0cc0, 0x000b, 0x82c0, 0x0001, 0x1f00, 0x0000, 0xffa0, 0x0001,
+	0x0400, 0x0000, 0x08af, 0x0003, 0x14c0, 0x000b, 0x01fe, 0x0008,
+	0x0580, 0x0009, 0x7f06, 0x0000, 0x02fe, 0x0008, 0xffc0, 0x0001,
+	0x00ff, 0x0008, 0x0690, 0x0001, 0x10af, 0x0003, 0x7f08, 0x0008,
+	0x84c0, 0x0001, 0xff00, 0x0008, 0x08c0, 0x0003, 0x00fe, 0x0000,
+	0x34b6, 0x000b, 0x8072, 0x0000, 0x1010, 0x0008, 0x3944, 0x0002,
+	0x08b1, 0x0003, 0x00ba, 0x0003, 0x8072, 0x0000, 0x2020, 0x0008,
+	0x3945, 0x000a, 0x08b6, 0x000b, 0x3946, 0x000a, 0x0cc7, 0x0003,
+	0x0000, 0x0007, 0x3943, 0x000a, 0x08c7, 0x000b, 0x00ba, 0x0003,
+	0x00fe, 0x0000, 0x34c5, 0x0003, 0x8072, 0x0000, 0x1000, 0x0000,
+	0x00c7, 0x0003, 0x8072, 0x0000, 0x2000, 0x0000, 0x4000, 0x000f,
+	0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066, 0x0000, 0x0231, 0x0008,
+	0x44cc, 0x000b, 0x58cd, 0x000b, 0x0140, 0x0008, 0x0242, 0x0000,
+	0x1f43, 0x0002, 0x0cdb, 0x000b, 0x0d44, 0x0000, 0x0d46, 0x0008,
+	0x0348, 0x0008, 0x044a, 0x0008, 0x030a, 0x0008, 0x040c, 0x0000,
+	0x0d06, 0x0000, 0x0d08, 0x0008, 0x00df, 0x0003, 0x0344, 0x0008,
+	0x0446, 0x0008, 0x0548, 0x0008, 0x064a, 0x0000, 0x1948, 0x000a,
+	0x08e2, 0x0003, 0x0d4a, 0x0008, 0x58e2, 0x0003, 0x3efe, 0x0008,
+	0x7f4f, 0x0002, 0x08e9, 0x000b, 0x8000, 0x0000, 0x0001, 0x0000,
+	0x0092, 0x000c, 0x8054, 0x0008, 0x0001, 0x0000, 0x8074, 0x0000,
+	0x2020, 0x0008, 0x4000, 0x000f, 0x3a40, 0x000a, 0x0c0d, 0x0003,
+	0x2b24, 0x0008, 0x2b24, 0x0008, 0x58f2, 0x000b, 0x8054, 0x0008,
+	0x0002, 0x0000, 0x1242, 0x0002, 0x0940, 0x0003, 0x3a45, 0x000a,
+	0x092f, 0x0003, 0x8072, 0x0000, 0x1000, 0x0000, 0x3945, 0x000a,
+	0x08ff, 0x0003, 0x8072, 0x0000, 0x3010, 0x0000, 0x1e10, 0x000a,
+	0x7f3c, 0x0000, 0x092a, 0x0003, 0x1d00, 0x0002, 0x7f3a, 0x0000,
+	0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008,
+	0x4508, 0x000b, 0x00fe, 0x0000, 0x3527, 0x000b, 0x1c60, 0x0000,
+	0x8062, 0x0008, 0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008,
+	0x4510, 0x000b, 0x00fe, 0x0000, 0x3243, 0x000b, 0x0038, 0x0000,
+	0x0060, 0x0008, 0x8062, 0x0008, 0x0019, 0x0000, 0x8066, 0x0000,
+	0x0009, 0x0008, 0x4519, 0x000b, 0x80c0, 0x0009, 0x00ff, 0x0008,
+	0x7f3e, 0x0008, 0x0d60, 0x0000, 0x0efe, 0x0008, 0x1f80, 0x0001,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4523, 0x000b,
+	0x003a, 0x0008, 0x1dfe, 0x0000, 0x0104, 0x000b, 0x0036, 0x0008,
+	0x00c8, 0x000c, 0x0140, 0x000b, 0x8074, 0x0000, 0x2000, 0x0000,
+	0x8072, 0x0000, 0x2000, 0x0000, 0x0140, 0x000b, 0x3a44, 0x0002,
+	0x0a71, 0x000b, 0x8074, 0x0000, 0x1000, 0x0000, 0x8072, 0x0000,
+	0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x0000, 0x3640, 0x0003,
+	0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700, 0x0008, 0x2700, 0x0008,
+	0x00d0, 0x0009, 0x0d52, 0x000b, 0x8074, 0x0000, 0x4040, 0x0008,
+	0x5940, 0x0003, 0x50ee, 0x000b, 0x3a46, 0x000a, 0x0d52, 0x000b,
+	0x3a47, 0x0002, 0x094d, 0x000b, 0x8054, 0x0008, 0x0004, 0x0000,
+	0x8074, 0x0000, 0x8000, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008,
+	0x019c, 0x0003, 0x92c0, 0x0009, 0x0fc8, 0x0000, 0x080a, 0x0003,
+	0x1246, 0x000a, 0x0e3a, 0x0003, 0x1a60, 0x0000, 0x8062, 0x0008,
+	0x0002, 0x0000, 0x8066, 0x0000, 0x362a, 0x0000, 0x4557, 0x000b,
+	0x2000, 0x0000, 0x2000, 0x0000, 0x2102, 0x0000, 0x2102, 0x0000,
+	0x2204, 0x0000, 0x2204, 0x0000, 0x2306, 0x0000, 0x2306, 0x0000,
+	0x2408, 0x0000, 0x2408, 0x0000, 0x250a, 0x0000, 0x250a, 0x0000,
+	0x260c, 0x0000, 0x260c, 0x0000, 0x270e, 0x0000, 0x270e, 0x0000,
+	0x2810, 0x0000, 0x2810, 0x0000, 0x2912, 0x0000, 0x2912, 0x0000,
+	0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000,
+	0x0052, 0x0000, 0x4571, 0x0003, 0x92c0, 0x0009, 0x0780, 0x0008,
+	0x0e56, 0x0003, 0x124b, 0x0002, 0x097a, 0x0003, 0x2e4d, 0x0002,
+	0x2e4d, 0x0002, 0x0a40, 0x0003, 0x3a46, 0x000a, 0x0d8a, 0x000b,
+	0x597c, 0x0003, 0x8054, 0x0008, 0x0004, 0x0000, 0x1243, 0x000a,
+	0x0998, 0x0003, 0x8010, 0x0008, 0x000d, 0x0000, 0x021b, 0x000c,
+	0x1948, 0x000a, 0x0987, 0x000b, 0x0210, 0x0004, 0x1810, 0x0000,
+	0x021b, 0x000c, 0x0198, 0x000b, 0x1948, 0x000a, 0x098e, 0x000b,
+	0x1243, 0x000a, 0x0a43, 0x0003, 0x194d, 0x000a, 0x0992, 0x0003,
+	0x1243, 0x000a, 0x0a4a, 0x0003, 0x5992, 0x0003, 0x8054, 0x0008,
+	0x0004, 0x0000, 0x0210, 0x0004, 0x1810, 0x0000, 0x021b, 0x000c,
+	0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008,
+	0x0d30, 0x0000, 0x3a42, 0x0002, 0x0da2, 0x000b, 0x15fe, 0x0008,
+	0x3461, 0x000b, 0x000a, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000,
+	0x8010, 0x0008, 0x000c, 0x0008, 0x021b, 0x000c, 0x000a, 0x000b,
+	0xbbe0, 0x0009, 0x0030, 0x0008, 0x0db8, 0x0003, 0x18fe, 0x0000,
+	0x3ce0, 0x0009, 0x09b5, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009,
+	0x09b5, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000,
+	0x0208, 0x000b, 0x8076, 0x0008, 0x0041, 0x0008, 0x0208, 0x000b,
+	0xbbe0, 0x0009, 0x0032, 0x0000, 0x0dbd, 0x0003, 0x3c1e, 0x0008,
+	0x0208, 0x000b, 0xbbe0, 0x0009, 0x003b, 0x0000, 0x0dc2, 0x000b,
+	0x3c20, 0x0000, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x0035, 0x0008,
+	0x0dc8, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x0384, 0x000b,
+	0xbbe0, 0x0009, 0x0036, 0x0008, 0x0aa5, 0x000b, 0xbbe0, 0x0009,
+	0x0037, 0x0000, 0x0de9, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009,
+	0x0db5, 0x000b, 0x8076, 0x0008, 0x0040, 0x0000, 0x1a60, 0x0000,
+	0x8062, 0x0008, 0x000d, 0x0000, 0x2604, 0x0008, 0x2604, 0x0008,
+	0x2706, 0x0008, 0x2706, 0x0008, 0x2808, 0x0000, 0x2808, 0x0000,
+	0x290a, 0x0000, 0x290a, 0x0000, 0x8066, 0x0000, 0x0422, 0x0000,
+	0x45e0, 0x000b, 0x0210, 0x0004, 0x8054, 0x0008, 0x0004, 0x0000,
+	0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0xb000, 0x0000,
+	0x019c, 0x0003, 0xbbe0, 0x0009, 0x0038, 0x0000, 0x0dfb, 0x000b,
+	0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09f8, 0x0003, 0x15fe, 0x0008,
+	0x3ce0, 0x0009, 0x0db1, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008,
+	0x0040, 0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x0268, 0x000b,
+	0x8076, 0x0008, 0x0042, 0x0008, 0x0208, 0x000b, 0xbbe0, 0x0009,
+	0x0016, 0x0000, 0x0e08, 0x000b, 0x8074, 0x0000, 0x0808, 0x0008,
+	0x3a44, 0x0002, 0x0c0c, 0x000b, 0x8074, 0x0000, 0x0800, 0x0000,
+	0x8072, 0x0000, 0x8000, 0x0000, 0x8000, 0x000f, 0x000a, 0x000b,
+	0x8072, 0x0000, 0x8000, 0x0000, 0x000a, 0x000b, 0x3d30, 0x000a,
+	0x7f00, 0x0000, 0xbc80, 0x0001, 0x0007, 0x0000, 0x0214, 0x0003,
+	0x1930, 0x000a, 0x7f00, 0x0000, 0x9880, 0x0001, 0x0007, 0x0000,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x000a, 0x0008, 0x4619, 0x000b, 0x4000, 0x000f, 0x221e, 0x000b,
+	0x0870, 0x0008, 0x4000, 0x000f, 0x7e1b, 0x000b, 0xbbe0, 0x0009,
+	0x0030, 0x0008, 0x0e1b, 0x0003, 0x18fe, 0x0000, 0x3ce0, 0x0009,
+	0x0a2c, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0a2c, 0x0003,
+	0x020b, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x022e, 0x0003,
+	0x8076, 0x0008, 0x0041, 0x0008, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x021b, 0x0003, 0xbac0, 0x0009, 0x0090, 0x0008, 0x0a37, 0x0003,
+	0x8074, 0x0000, 0x0706, 0x0000, 0x0239, 0x0003, 0x8074, 0x0000,
+	0x0703, 0x0000, 0x4000, 0x000f, 0x8010, 0x0008, 0x0023, 0x0000,
+	0x0276, 0x000b, 0x8010, 0x0008, 0x0008, 0x0000, 0x0276, 0x000b,
+	0x8010, 0x0008, 0x0022, 0x0008, 0x0276, 0x000b, 0x0210, 0x0004,
+	0x8010, 0x0008, 0x0007, 0x0000, 0x021b, 0x000c, 0x1810, 0x0000,
+	0x021b, 0x000c, 0x0282, 0x0003, 0x0210, 0x0004, 0x8010, 0x0008,
+	0x001b, 0x0008, 0x021b, 0x000c, 0x1810, 0x0000, 0x021b, 0x000c,
+	0x8074, 0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008,
+	0x0d30, 0x0000, 0x000a, 0x000b, 0x8010, 0x0008, 0x0009, 0x0008,
+	0x0276, 0x000b, 0x8010, 0x0008, 0x0005, 0x0008, 0x0276, 0x000b,
+	0x1648, 0x000a, 0x0c6f, 0x000b, 0x808c, 0x0008, 0x0001, 0x0000,
+	0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a, 0x086f, 0x0003,
+	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008, 0x0276, 0x000b,
+	0x8010, 0x0008, 0x0003, 0x0008, 0x027a, 0x000b, 0x8010, 0x0008,
+	0x000b, 0x0000, 0x027a, 0x000b, 0x8010, 0x0008, 0x0002, 0x0000,
+	0x027a, 0x000b, 0x3a47, 0x0002, 0x0d40, 0x000b, 0x8010, 0x0008,
+	0x0006, 0x0008, 0x027a, 0x000b, 0x8074, 0x0000, 0xf000, 0x0008,
+	0x8072, 0x0000, 0x3000, 0x0008, 0x021b, 0x000c, 0x0231, 0x0004,
+	0x3a40, 0x000a, 0x080a, 0x0003, 0x8010, 0x0008, 0x000c, 0x0008,
+	0x021b, 0x000c, 0x000a, 0x000b, 0x8074, 0x0000, 0xf080, 0x0000,
+	0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x2e4d, 0x0002,
+	0x2e4d, 0x0002, 0x0a8d, 0x000b, 0x8054, 0x0008, 0x0019, 0x0000,
+	0x000a, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008, 0x000a, 0x000b,
+	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x026b, 0x000b, 0x808c, 0x0008,
+	0x0000, 0x0008, 0x4447, 0x0002, 0x0ab9, 0x0003, 0xc0c0, 0x0001,
+	0x00ff, 0x0008, 0xffe0, 0x0009, 0x00ff, 0x0008, 0x0e90, 0x0003,
+	0xc1e0, 0x0001, 0xffff, 0x0008, 0x0e90, 0x0003, 0x8010, 0x0008,
+	0x0013, 0x0000, 0x021b, 0x000c, 0x8074, 0x0000, 0x0202, 0x0008,
+	0x000a, 0x000b, 0x3a40, 0x000a, 0x0eb6, 0x000b, 0x8074, 0x0000,
+	0x0200, 0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072, 0x0000,
+	0x8000, 0x0000, 0x43e0, 0x0001, 0x0eb4, 0x0003, 0x42fe, 0x0000,
+	0xffc0, 0x0001, 0x00ff, 0x0008, 0x00e0, 0x0009, 0x0a90, 0x000b,
+	0x0d08, 0x0008, 0x0309, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x000a, 0x000b, 0x038d, 0x0004, 0x808c, 0x0008, 0x0001, 0x0000,
+	0x04fe, 0x0008, 0x3370, 0x0003, 0x0460, 0x0000, 0x8062, 0x0008,
+	0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x46c3, 0x0003,
+	0x0004, 0x0000, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f00, 0x0000,
+	0x80e0, 0x0001, 0x0004, 0x0000, 0x0add, 0x000b, 0x80e0, 0x0001,
+	0x0005, 0x0008, 0x0add, 0x000b, 0x80e0, 0x0001, 0x0006, 0x0008,
+	0x0add, 0x000b, 0x82c0, 0x0001, 0xff00, 0x0008, 0x7f04, 0x0008,
+	0x82e0, 0x0009, 0x0600, 0x0008, 0x0add, 0x000b, 0x82e0, 0x0009,
+	0x0500, 0x0008, 0x0add, 0x000b, 0x82e0, 0x0009, 0x0400, 0x0000,
+	0x0f70, 0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffe0, 0x0009,
+	0x1000, 0x0000, 0x0b09, 0x0003, 0x037e, 0x0004, 0x3941, 0x0002,
+	0x0ae8, 0x000b, 0x8072, 0x0000, 0x0400, 0x0000, 0x000a, 0x000b,
+	0x0460, 0x0000, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x2209, 0x0008, 0x46ee, 0x0003, 0x11fe, 0x0000,
+	0x3304, 0x0003, 0x9180, 0x0001, 0x0002, 0x0000, 0x8060, 0x0000,
+	0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0609, 0x0008,
+	0x46f8, 0x000b, 0x42fe, 0x0000, 0xffc0, 0x0001, 0xff00, 0x0008,
+	0x03e0, 0x0009, 0x0f01, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000,
+	0x0046, 0x0003, 0x9180, 0x0001, 0x0003, 0x0008, 0x02eb, 0x0003,
+	0x8072, 0x0000, 0x0400, 0x0000, 0x8010, 0x0008, 0x0010, 0x0000,
+	0x0361, 0x0003, 0x037e, 0x0004, 0x3941, 0x0002, 0x0b0f, 0x0003,
+	0x8072, 0x0000, 0x0400, 0x0000, 0x000a, 0x000b, 0x0346, 0x000c,
+	0x11fe, 0x0000, 0x3717, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000,
+	0x8010, 0x0008, 0x000e, 0x0000, 0x0361, 0x0003, 0x8060, 0x0000,
+	0x0400, 0x0000, 0x04fe, 0x0008, 0x372c, 0x000b, 0x808c, 0x0008,
+	0x0000, 0x0008, 0x9180, 0x0001, 0x0005, 0x0008, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x4722, 0x000b, 0x0060, 0x0008,
+	0x8062, 0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206, 0x0008,
+	0x8066, 0x0000, 0x0412, 0x0000, 0x472a, 0x0003, 0x0343, 0x0003,
+	0x808c, 0x0008, 0x0001, 0x0000, 0x0460, 0x0000, 0x8062, 0x0008,
+	0x002b, 0x0008, 0x8066, 0x0000, 0x0609, 0x0008, 0x4733, 0x000b,
+	0x8066, 0x0000, 0x220a, 0x0008, 0x4736, 0x000b, 0x42fe, 0x0000,
+	0xffc0, 0x0001, 0xff00, 0x0008, 0x7f04, 0x0008, 0x8060, 0x0000,
+	0x0400, 0x0000, 0x9180, 0x0001, 0x0002, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x041a, 0x0008, 0x4742, 0x000b, 0x8072, 0x0000,
+	0x0400, 0x0000, 0x0046, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000,
+	0x1362, 0x0008, 0x8066, 0x0000, 0x0411, 0x0000, 0x474b, 0x000b,
+	0x02fe, 0x0008, 0x03e0, 0x0009, 0x0f51, 0x0003, 0x0d22, 0x0000,
+	0x4000, 0x000f, 0x8280, 0x0009, 0x0002, 0x0000, 0x1380, 0x0001,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x2209, 0x0008, 0x4757, 0x0003,
+	0x0200, 0x000a, 0xffc0, 0x0001, 0x0007, 0x0000, 0x7f06, 0x0000,
+	0x1362, 0x0008, 0x8066, 0x0000, 0x060a, 0x0008, 0x475f, 0x000b,
+	0x4000, 0x000f, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x2f44, 0x000a,
+	0x2f44, 0x000a, 0x0e6b, 0x000b, 0x808a, 0x0008, 0x0003, 0x0008,
+	0x8074, 0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008,
+	0x5b6c, 0x0003, 0x8054, 0x0008, 0x0019, 0x0000, 0x000a, 0x000b,
+	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0000, 0x0008,
+	0x8010, 0x0008, 0x0011, 0x0008, 0x021b, 0x000c, 0x42fe, 0x0000,
+	0xffc0, 0x0001, 0x00ff, 0x0008, 0x7f10, 0x0008, 0x021b, 0x000c,
+	0x4310, 0x0008, 0x027a, 0x000b, 0x3941, 0x0002, 0x0b81, 0x0003,
+	0x4000, 0x000f, 0x8072, 0x0000, 0x0404, 0x0008, 0x4000, 0x000f,
+	0x8010, 0x0008, 0x0012, 0x0008, 0x021b, 0x000c, 0x0346, 0x000c,
+	0x1110, 0x0000, 0x021b, 0x000c, 0x11fe, 0x0000, 0x3787, 0x0003,
+	0x000a, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x7f00, 0x0000,
+	0xc3c0, 0x0001, 0xff00, 0x0008, 0x00d0, 0x0009, 0x0bb2, 0x0003,
+	0x0d0a, 0x0000, 0x8580, 0x0001, 0x1000, 0x0000, 0x7f62, 0x0008,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x8066, 0x0000, 0x0809, 0x0000,
+	0x479c, 0x000b, 0x04fe, 0x0008, 0x33ab, 0x0003, 0x0460, 0x0000,
+	0x8062, 0x0008, 0x0004, 0x0000, 0x8066, 0x0000, 0x0211, 0x0000,
+	0x47a4, 0x0003, 0x01fe, 0x0008, 0x00e0, 0x0009, 0x0fab, 0x0003,
+	0x02fe, 0x0008, 0x43e0, 0x0001, 0x0bb1, 0x0003, 0x0500, 0x0002,
+	0x7f0a, 0x0000, 0xffe0, 0x0009, 0x0800, 0x0000, 0x0f95, 0x000b,
+	0x0d08, 0x0008, 0x4000, 0x000f, 0x43fe, 0x0008, 0x3e80, 0x0001,
+	0xffc0, 0x0001, 0x7fff, 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0809, 0x0000, 0x47ba, 0x0003, 0x8060, 0x0000,
+	0x0400, 0x0000, 0x84c0, 0x0001, 0xff00, 0x0008, 0x7f60, 0x000a,
+	0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a,
+	0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0xff80, 0x0009,
+	0x1000, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0809, 0x0000,
+	0x47cc, 0x000b, 0x4000, 0x000f, 0x5ff4, 0xebed, 0x0001, 0x0002,
+	0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
+	0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x2c40
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300ipx_length01 = 0xe9a6;
+unsigned short fw2300ipx_length01 = 0xe9c7;
 #else
-unsigned short risc_code_length01 = 0xe9a6;
+unsigned short risc_code_length01 = 0xe9c7;
 #endif
 
diff --git a/drivers/scsi/qla2xxx/ql2322_fw.c b/drivers/scsi/qla2xxx/ql2322_fw.c
index 4b3966772..f75b3c971 100644
--- a/drivers/scsi/qla2xxx/ql2322_fw.c
+++ b/drivers/scsi/qla2xxx/ql2322_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.26 (08:08 Mar 11, 2004)
+ *	Firmware Version 3.02.28 (14:05 Apr 03, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2322ipx_version_str[] = {3, 2,26};
+unsigned char fw2322ipx_version_str[] = {3, 2,28};
 #else
-unsigned char firmware_version[] = {3, 2,26};
+unsigned char firmware_version[] = {3, 2,28};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2322ipx_VERSION_STRING "3.02.26"
+#define fw2322ipx_VERSION_STRING "3.02.28"
 #else
-#define FW_VERSION_STRING "3.02.26"
+#define FW_VERSION_STRING "3.02.28"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2322ipx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xdf17, 0x0000, 0x0003, 0x0002, 0x001a,
+	0x0470, 0x0000, 0x0000, 0xdf42, 0x0000, 0x0003, 0x0002, 0x001c,
 	0x0137, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3620, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -82,97 +82,97 @@ unsigned short risc_code01[] = {
 	0x20a8, 0x900e, 0x4104, 0x2009, 0x1800, 0x810d, 0x810d, 0x810d,
 	0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9,
 	0x0001, 0x20a1, 0x0800, 0x900e, 0x20a9, 0x0800, 0x4104, 0x8211,
-	0x1dd8, 0x080c, 0x0f52, 0x080c, 0x6030, 0x080c, 0xab5f, 0x080c,
-	0x1109, 0x080c, 0x1328, 0x080c, 0x1bb0, 0x080c, 0x915c, 0x080c,
-	0x0d0f, 0x080c, 0x108e, 0x080c, 0x346d, 0x080c, 0x77ed, 0x080c,
-	0x6a7f, 0x080c, 0x88d4, 0x080c, 0x8538, 0x080c, 0x223f, 0x080c,
-	0x7ec2, 0x080c, 0x2089, 0x080c, 0x21c3, 0x080c, 0x2234, 0x2091,
+	0x1dd8, 0x080c, 0x0f52, 0x080c, 0x6037, 0x080c, 0xab83, 0x080c,
+	0x1109, 0x080c, 0x1328, 0x080c, 0x1bb0, 0x080c, 0x918d, 0x080c,
+	0x0d0f, 0x080c, 0x108e, 0x080c, 0x3474, 0x080c, 0x7801, 0x080c,
+	0x6a8f, 0x080c, 0x8905, 0x080c, 0x8569, 0x080c, 0x223f, 0x080c,
+	0x7ed6, 0x080c, 0x2089, 0x080c, 0x21c3, 0x080c, 0x2234, 0x2091,
 	0x3009, 0x7883, 0x0000, 0x1004, 0x0943, 0x7880, 0x9086, 0x0002,
 	0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04,
 	0x0937, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
 	0xd084, 0x190c, 0x11d6, 0x2071, 0x1800, 0x7003, 0x0000, 0x780c,
 	0x9084, 0x0030, 0x9086, 0x0000, 0x190c, 0x0d7d, 0x2071, 0x1800,
-	0x7000, 0x908e, 0x0003, 0x1168, 0x080c, 0x4bc5, 0x080c, 0x3494,
-	0x080c, 0x7855, 0x080c, 0x6fc7, 0x080c, 0x89b2, 0x080c, 0x8561,
+	0x7000, 0x908e, 0x0003, 0x1168, 0x080c, 0x4bcc, 0x080c, 0x349b,
+	0x080c, 0x7869, 0x080c, 0x6fd7, 0x080c, 0x89e3, 0x080c, 0x8592,
 	0x0c68, 0x000b, 0x0c88, 0x096d, 0x096e, 0x0b09, 0x096b, 0x0bc3,
 	0x0d0e, 0x0d0e, 0x0d0e, 0x080c, 0x0d7d, 0x0005, 0x0126, 0x00f6,
 	0x2091, 0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0adc, 0x080c,
-	0x0ea5, 0x080c, 0x74d5, 0x0150, 0x080c, 0x74f8, 0x15b0, 0x2079,
-	0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0478, 0x080c, 0x7406,
+	0x0ea5, 0x080c, 0x74e9, 0x0150, 0x080c, 0x750c, 0x15b0, 0x2079,
+	0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0478, 0x080c, 0x741a,
 	0x7000, 0x9086, 0x0001, 0x1904, 0x0adc, 0x7098, 0x9086, 0x0028,
-	0x1904, 0x0adc, 0x080c, 0x8530, 0x080c, 0x8522, 0x2001, 0x0161,
+	0x1904, 0x0adc, 0x080c, 0x8561, 0x080c, 0x8553, 0x2001, 0x0161,
 	0x2003, 0x0001, 0x2079, 0x0100, 0x2011, 0xffff, 0x080c, 0x2a44,
-	0x7a28, 0x9295, 0x5e2c, 0x7a2a, 0x2011, 0x734b, 0x080c, 0x860d,
-	0x2011, 0x733e, 0x080c, 0x8719, 0x2011, 0x5e87, 0x080c, 0x860d,
-	0x2011, 0x8030, 0x901e, 0x7396, 0x04d0, 0x080c, 0x5734, 0x2079,
-	0x0100, 0x7844, 0x9005, 0x1904, 0x0adc, 0x2011, 0x5e87, 0x080c,
-	0x860d, 0x2011, 0x734b, 0x080c, 0x860d, 0x2011, 0x733e, 0x080c,
-	0x8719, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840,
+	0x7a28, 0x9295, 0x5e2c, 0x7a2a, 0x2011, 0x735f, 0x080c, 0x863e,
+	0x2011, 0x7352, 0x080c, 0x874a, 0x2011, 0x5e8e, 0x080c, 0x863e,
+	0x2011, 0x8030, 0x901e, 0x7396, 0x04d0, 0x080c, 0x573b, 0x2079,
+	0x0100, 0x7844, 0x9005, 0x1904, 0x0adc, 0x2011, 0x5e8e, 0x080c,
+	0x863e, 0x2011, 0x735f, 0x080c, 0x863e, 0x2011, 0x7352, 0x080c,
+	0x874a, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840,
 	0x9084, 0xfffb, 0x7842, 0x2001, 0x19a6, 0x2004, 0x9005, 0x1140,
-	0x00c6, 0x2061, 0x0100, 0x080c, 0x5fd8, 0x00ce, 0x0804, 0x0adc,
-	0x780f, 0x006b, 0x7a28, 0x080c, 0x74dd, 0x0118, 0x9295, 0x5e2c,
+	0x00c6, 0x2061, 0x0100, 0x080c, 0x5fdf, 0x00ce, 0x0804, 0x0adc,
+	0x780f, 0x006b, 0x7a28, 0x080c, 0x74f1, 0x0118, 0x9295, 0x5e2c,
 	0x0010, 0x9295, 0x402c, 0x7a2a, 0x2011, 0x8010, 0x73d8, 0x2001,
-	0x19a7, 0x2003, 0x0001, 0x080c, 0x2916, 0x080c, 0x4b00, 0x7248,
+	0x19a7, 0x2003, 0x0001, 0x080c, 0x2916, 0x080c, 0x4b07, 0x7248,
 	0xc284, 0x724a, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102,
-	0x2001, 0x0390, 0x2003, 0x0400, 0x080c, 0xa872, 0x080c, 0xa04f,
-	0x2011, 0x0004, 0x080c, 0xc824, 0x080c, 0xa88e, 0x080c, 0x6910,
-	0x080c, 0x74d5, 0x1120, 0x080c, 0x2971, 0x0600, 0x0420, 0x080c,
-	0x5fdf, 0x0140, 0x7097, 0x0001, 0x70d3, 0x0000, 0x080c, 0x5901,
-	0x0804, 0x0adc, 0x080c, 0x56d3, 0xd094, 0x01a8, 0x2001, 0x0390,
+	0x2001, 0x0390, 0x2003, 0x0400, 0x080c, 0xa896, 0x080c, 0xa073,
+	0x2011, 0x0004, 0x080c, 0xc848, 0x080c, 0xa8b2, 0x080c, 0x6917,
+	0x080c, 0x74e9, 0x1120, 0x080c, 0x2971, 0x0600, 0x0420, 0x080c,
+	0x5fe6, 0x0140, 0x7097, 0x0001, 0x70d3, 0x0000, 0x080c, 0x5908,
+	0x0804, 0x0adc, 0x080c, 0x56da, 0xd094, 0x01a8, 0x2001, 0x0390,
 	0x2003, 0x0404, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c,
-	0x56d7, 0xd0d4, 0x1118, 0x080c, 0x2971, 0x1270, 0x2011, 0x180c,
-	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56d7, 0xd0d4, 0x1db8, 0x2011,
+	0x56de, 0xd0d4, 0x1118, 0x080c, 0x2971, 0x1270, 0x2011, 0x180c,
+	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56de, 0xd0d4, 0x1db8, 0x2011,
 	0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x2012, 0x080c, 0x6a53, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
-	0x2012, 0x080c, 0x6a19, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
-	0x707f, 0x0000, 0x080c, 0x74d5, 0x1130, 0x70b0, 0x9005, 0x1168,
-	0x080c, 0xcc7b, 0x0050, 0x080c, 0xcc7b, 0x70dc, 0xd09c, 0x1128,
-	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fb5, 0x70e7, 0x0000, 0x70e3,
+	0x2012, 0x080c, 0x6a63, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
+	0x2012, 0x080c, 0x6a29, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
+	0x707f, 0x0000, 0x080c, 0x74e9, 0x1130, 0x70b0, 0x9005, 0x1168,
+	0x080c, 0xcc9f, 0x0050, 0x080c, 0xcc9f, 0x70dc, 0xd09c, 0x1128,
+	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fbc, 0x70e7, 0x0000, 0x70e3,
 	0x0000, 0x70a7, 0x0000, 0x080c, 0x2979, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x74d5, 0x1178, 0x9016,
+	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x74e9, 0x1178, 0x9016,
 	0x0016, 0x080c, 0x2713, 0x2019, 0x196d, 0x211a, 0x001e, 0x705f,
 	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196d,
 	0x201b, 0x0000, 0x2079, 0x1847, 0x7804, 0xd0ac, 0x0108, 0xc295,
-	0x72de, 0x080c, 0x74d5, 0x0118, 0x9296, 0x0004, 0x0518, 0x2011,
-	0x0001, 0x080c, 0xc824, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
-	0x0002, 0x00fe, 0x080c, 0x2fb2, 0x080c, 0xa872, 0x2011, 0x0005,
-	0x080c, 0xa1ab, 0x080c, 0xa88e, 0x080c, 0x74d5, 0x0148, 0x00c6,
+	0x72de, 0x080c, 0x74e9, 0x0118, 0x9296, 0x0004, 0x0518, 0x2011,
+	0x0001, 0x080c, 0xc848, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
+	0x0002, 0x00fe, 0x080c, 0x2fb2, 0x080c, 0xa896, 0x2011, 0x0005,
+	0x080c, 0xa1cf, 0x080c, 0xa8b2, 0x080c, 0x74e9, 0x0148, 0x00c6,
 	0x2061, 0x0100, 0x0016, 0x080c, 0x2713, 0x61e2, 0x001e, 0x00ce,
 	0x012e, 0x00e0, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003, 0x0002,
-	0x080c, 0xa872, 0x2011, 0x0005, 0x080c, 0xa1ab, 0x080c, 0xa88e,
-	0x080c, 0x74d5, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c,
+	0x080c, 0xa896, 0x2011, 0x0005, 0x080c, 0xa1cf, 0x080c, 0xa8b2,
+	0x080c, 0x74e9, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c,
 	0x2713, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6,
-	0x00b6, 0x080c, 0x74d5, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
-	0x0782, 0x080c, 0x74d5, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
+	0x00b6, 0x080c, 0x74e9, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
+	0x0782, 0x080c, 0x74e9, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
 	0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800,
-	0xd0bc, 0x090c, 0x32f5, 0x8108, 0x1f04, 0x0af0, 0x707f, 0x0000,
+	0xd0bc, 0x090c, 0x32fc, 0x8108, 0x1f04, 0x0af0, 0x707f, 0x0000,
 	0x7080, 0x9084, 0x00ff, 0x7082, 0x70b3, 0x0000, 0x00be, 0x00ce,
 	0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002,
 	0x1904, 0x0bc0, 0x70ac, 0x9086, 0xffff, 0x0120, 0x080c, 0x2fb2,
 	0x0804, 0x0bc0, 0x70dc, 0xd0ac, 0x1110, 0xd09c, 0x0538, 0xd084,
 	0x0528, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c,
-	0x01e8, 0x080c, 0x3366, 0x11b0, 0x70e0, 0x9086, 0xffff, 0x0190,
-	0x080c, 0x3144, 0x70dc, 0xd094, 0x1904, 0x0bc0, 0x2011, 0x0001,
-	0x080c, 0xcf2e, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x317e,
+	0x01e8, 0x080c, 0x336d, 0x11b0, 0x70e0, 0x9086, 0xffff, 0x0190,
+	0x080c, 0x3147, 0x70dc, 0xd094, 0x1904, 0x0bc0, 0x2011, 0x0001,
+	0x080c, 0xcf52, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x3181,
 	0x0804, 0x0bc0, 0x70e4, 0x9005, 0x1904, 0x0bc0, 0x70a8, 0x9005,
 	0x1904, 0x0bc0, 0x70dc, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0bc0,
-	0x080c, 0x6a19, 0x1904, 0x0bc0, 0x080c, 0x6a6c, 0x1904, 0x0bc0,
-	0x080c, 0x6a53, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
-	0x0016, 0x080c, 0x661e, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e,
+	0x080c, 0x6a29, 0x1904, 0x0bc0, 0x080c, 0x6a7c, 0x1904, 0x0bc0,
+	0x080c, 0x6a63, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
+	0x0016, 0x080c, 0x6625, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e,
 	0x8108, 0x1f04, 0x0b60, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce,
 	0x015e, 0x0804, 0x0bc0, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b,
 	0x000e, 0x2011, 0x19b3, 0x080c, 0x0fc2, 0x2011, 0x19cd, 0x080c,
 	0x0fc2, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70af, 0xffff,
-	0x080c, 0x0e79, 0x9006, 0x080c, 0x25a0, 0x080c, 0x3366, 0x0118,
-	0x080c, 0x4c9d, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
-	0x0006, 0x080c, 0x4cb7, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
-	0x080c, 0x74f8, 0x0150, 0x080c, 0x74d5, 0x7828, 0x0118, 0x9084,
-	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0xa872,
+	0x080c, 0x0e79, 0x9006, 0x080c, 0x25a0, 0x080c, 0x336d, 0x0118,
+	0x080c, 0x4ca4, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
+	0x0006, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
+	0x080c, 0x750c, 0x0150, 0x080c, 0x74e9, 0x7828, 0x0118, 0x9084,
+	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0xa896,
 	0x2001, 0x19e8, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
-	0x080c, 0xa1ab, 0x2011, 0x0000, 0x080c, 0xa1b5, 0x080c, 0xa88e,
+	0x080c, 0xa1cf, 0x2011, 0x0000, 0x080c, 0xa1d9, 0x080c, 0xa8b2,
 	0x012e, 0x00be, 0x0005, 0x0016, 0x0026, 0x0046, 0x00f6, 0x0126,
 	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
-	0x2009, 0x00f7, 0x080c, 0x5f9e, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x2009, 0x00f7, 0x080c, 0x5fa5, 0x7940, 0x918c, 0x0010, 0x7942,
 	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x2a44, 0xd19c,
 	0x0120, 0x2011, 0x0008, 0x080c, 0x2a44, 0x0006, 0x0036, 0x0156,
 	0x0000, 0x2001, 0x19a7, 0x2004, 0x9005, 0x1518, 0x080c, 0x29d8,
@@ -181,26 +181,26 @@ unsigned short risc_code01[] = {
 	0x9006, 0x080c, 0x2928, 0x0068, 0x080c, 0x29e8, 0x1d50, 0x2001,
 	0x1998, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x273f, 0x0804,
 	0x0cc1, 0x080c, 0x2a67, 0x080c, 0x2aab, 0x20a9, 0x003a, 0x1d04,
-	0x0c17, 0x080c, 0x86f9, 0x1f04, 0x0c17, 0x080c, 0x74e6, 0x0148,
-	0x080c, 0x74f8, 0x1118, 0x080c, 0x77e8, 0x0050, 0x080c, 0x74dd,
-	0x0dd0, 0x080c, 0x77e3, 0x080c, 0x77d9, 0x080c, 0x7406, 0x0020,
-	0x2009, 0x00f8, 0x080c, 0x5f9e, 0x7850, 0xc0e5, 0x7852, 0x080c,
-	0x74d5, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
-	0x2019, 0xea60, 0x0d0c, 0x86f9, 0x7820, 0xd09c, 0x15a0, 0x080c,
-	0x74d5, 0x0904, 0x0ca3, 0x7824, 0xd0ac, 0x1904, 0x0cc6, 0x080c,
-	0x74f8, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x0c17, 0x080c, 0x872a, 0x1f04, 0x0c17, 0x080c, 0x74fa, 0x0148,
+	0x080c, 0x750c, 0x1118, 0x080c, 0x77fc, 0x0050, 0x080c, 0x74f1,
+	0x0dd0, 0x080c, 0x77f7, 0x080c, 0x77ed, 0x080c, 0x741a, 0x0020,
+	0x2009, 0x00f8, 0x080c, 0x5fa5, 0x7850, 0xc0e5, 0x7852, 0x080c,
+	0x74e9, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x872a, 0x7820, 0xd09c, 0x15a0, 0x080c,
+	0x74e9, 0x0904, 0x0ca3, 0x7824, 0xd0ac, 0x1904, 0x0cc6, 0x080c,
+	0x750c, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
 	0x2011, 0x1800, 0x080c, 0x2a44, 0x080c, 0x29f0, 0x7824, 0x9084,
 	0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0ce9, 0x8421, 0x1160, 0x1d04,
-	0x0c73, 0x080c, 0x86f9, 0x080c, 0x77e3, 0x080c, 0x77d9, 0x7003,
+	0x0c73, 0x080c, 0x872a, 0x080c, 0x77f7, 0x080c, 0x77ed, 0x7003,
 	0x0001, 0x0804, 0x0cc6, 0x8319, 0x1928, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0ce9, 0x1d04, 0x0c89, 0x080c,
-	0x86f9, 0x2009, 0x199b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x872a, 0x2009, 0x199b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
 	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x2a44, 0x20a9,
 	0x0002, 0x080c, 0x29d1, 0x7924, 0x080c, 0x29f0, 0xd19c, 0x0110,
-	0x080c, 0x2916, 0x00f0, 0x080c, 0x74e6, 0x1140, 0x94a2, 0x03e8,
-	0x1128, 0x080c, 0x74a9, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
-	0x080c, 0x2a44, 0x080c, 0x29f0, 0x7824, 0x080c, 0x74ef, 0x0110,
+	0x080c, 0x2916, 0x00f0, 0x080c, 0x74fa, 0x1140, 0x94a2, 0x03e8,
+	0x1128, 0x080c, 0x74bd, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
+	0x080c, 0x2a44, 0x080c, 0x29f0, 0x7824, 0x080c, 0x7503, 0x0110,
 	0xd0ac, 0x1160, 0x9084, 0x1800, 0x0904, 0x0c7b, 0x7003, 0x0001,
 	0x0028, 0x2001, 0x0001, 0x080c, 0x25a0, 0x00a0, 0x7850, 0xc0e4,
 	0x7852, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
@@ -208,20 +208,20 @@ unsigned short risc_code01[] = {
 	0x0028, 0x782a, 0x2001, 0x19a7, 0x2003, 0x0000, 0x9006, 0x78f2,
 	0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x002e, 0x001e,
 	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x86f9, 0x015e,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x872a, 0x015e,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x002e,
 	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189e, 0x7004, 0x9086,
-	0x0001, 0x1110, 0x080c, 0x3494, 0x00ee, 0x0005, 0x0005, 0x2a70,
-	0x2061, 0x19ab, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001a,
+	0x0001, 0x1110, 0x080c, 0x349b, 0x00ee, 0x0005, 0x0005, 0x2a70,
+	0x2061, 0x19ab, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001c,
 	0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102, 0x7196, 0x2001,
 	0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705f, 0xffff, 0x0008,
-	0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c, 0xcc7b, 0x70ef,
+	0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c, 0xcc9f, 0x70ef,
 	0x00c0, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
 	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x001f, 0x611a, 0x601f,
 	0x07d0, 0x2061, 0x1974, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
 	0x1989, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
-	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x661e,
+	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x6625,
 	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
 	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
 	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
@@ -240,11 +240,11 @@ unsigned short risc_code01[] = {
 	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
 	0x2004, 0xd084, 0x0180, 0x2001, 0x1a22, 0x2004, 0x9005, 0x0128,
 	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
-	0x0002, 0x2003, 0x1001, 0x080c, 0x56e2, 0x1170, 0x080c, 0x0f13,
-	0x0110, 0x080c, 0x0e66, 0x080c, 0x56e2, 0x1130, 0x2071, 0x1800,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x56e9, 0x1170, 0x080c, 0x0f13,
+	0x0110, 0x080c, 0x0e66, 0x080c, 0x56e9, 0x1130, 0x2071, 0x1800,
 	0x2011, 0x8000, 0x080c, 0x0f27, 0x0c70, 0x0005, 0x2001, 0x0382,
 	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1120, 0x2001, 0x0015,
-	0x080c, 0xa863, 0x2079, 0x0380, 0x2069, 0x1b04, 0x7818, 0x6802,
+	0x080c, 0xa887, 0x2079, 0x0380, 0x2069, 0x1b04, 0x7818, 0x6802,
 	0x781c, 0x6806, 0x7840, 0x680a, 0x7844, 0x680e, 0x782c, 0x6812,
 	0x2019, 0x1b0f, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
 	0x8210, 0x8318, 0x8210, 0x9282, 0x0011, 0x0ea8, 0x2011, 0xdead,
@@ -323,7 +323,7 @@ unsigned short risc_code01[] = {
 	0x0016, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862, 0x9184,
 	0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091, 0x8000,
 	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000,
-	0x70c2, 0x080c, 0x8522, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x70c2, 0x080c, 0x8553, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9026, 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e, 0x8940,
 	0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0440,
 	0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188d, 0x7000,
@@ -387,15 +387,15 @@ unsigned short risc_code01[] = {
 	0x008e, 0x00de, 0x009e, 0x080c, 0x1143, 0x0005, 0x00de, 0x009e,
 	0x080c, 0x1143, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0,
 	0x904d, 0x090c, 0x0d7d, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6d64, 0xa09f,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6d74, 0xa09f,
 	0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x106c, 0x009e, 0x0005,
 	0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0d7d, 0xa06c, 0x908e, 0x0100,
 	0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050,
 	0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007,
 	0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xa076, 0xa172,
 	0xb000, 0xa07a, 0x2810, 0x080c, 0x1124, 0x00e8, 0xa97c, 0xa894,
-	0x0016, 0x0006, 0x080c, 0x6d64, 0x000e, 0x001e, 0xd1fc, 0x1138,
-	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0xabc9, 0x00ce, 0x7008,
+	0x0016, 0x0006, 0x080c, 0x6d74, 0x000e, 0x001e, 0xd1fc, 0x1138,
+	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0xabed, 0x00ce, 0x7008,
 	0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x106c, 0x7007,
 	0x0000, 0x080c, 0x1143, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000,
 	0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e,
@@ -404,8 +404,8 @@ unsigned short risc_code01[] = {
 	0x0020, 0x0126, 0x2091, 0x8000, 0x782b, 0x0041, 0x7007, 0x0003,
 	0x7000, 0xc084, 0x7002, 0x2900, 0x700a, 0x012e, 0x009e, 0x0005,
 	0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x0096, 0x2001,
-	0x192e, 0x204c, 0xaa7c, 0x009e, 0x080c, 0x8bea, 0x2009, 0x188c,
-	0x2104, 0x9084, 0xfffc, 0x200a, 0x080c, 0x8a5d, 0x7007, 0x0000,
+	0x192e, 0x204c, 0xaa7c, 0x009e, 0x080c, 0x8c1b, 0x2009, 0x188c,
+	0x2104, 0x9084, 0xfffc, 0x200a, 0x080c, 0x8a8e, 0x7007, 0x0000,
 	0x080c, 0x1154, 0x0005, 0x7007, 0x0000, 0x080c, 0x1154, 0x0005,
 	0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a6b, 0x7003,
 	0x0000, 0x78bf, 0x00f6, 0x0041, 0x7807, 0x0007, 0x7803, 0x0000,
@@ -418,17 +418,17 @@ unsigned short risc_code01[] = {
 	0x0303, 0x2061, 0x1a7a, 0x602f, 0x1ddc, 0x2001, 0x181a, 0x2004,
 	0x9082, 0x1ddc, 0x6032, 0x603b, 0x1e55, 0x602b, 0x1aba, 0x6007,
 	0x1a9a, 0x2061, 0x1a9a, 0x60af, 0x193c, 0x2001, 0x1927, 0x2004,
-	0x60ba, 0x783f, 0x336d, 0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0,
-	0x7808, 0xd09c, 0x01b8, 0x7820, 0x0026, 0x2010, 0x080c, 0xc802,
+	0x60ba, 0x783f, 0x3374, 0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0,
+	0x7808, 0xd09c, 0x01b8, 0x7820, 0x0026, 0x2010, 0x080c, 0xc826,
 	0x0180, 0x2260, 0x6000, 0x9086, 0x0004, 0x1158, 0x0016, 0x6120,
-	0x9186, 0x0009, 0x0108, 0x0020, 0x2009, 0x004c, 0x080c, 0xac68,
+	0x9186, 0x0009, 0x0108, 0x0020, 0x2009, 0x004c, 0x080c, 0xac8c,
 	0x001e, 0x002e, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184,
 	0x0070, 0x190c, 0x0d76, 0xd19c, 0x05a0, 0x7820, 0x908c, 0xf000,
 	0x0540, 0x2060, 0x6020, 0x9086, 0x0003, 0x1550, 0x6000, 0x9086,
 	0x0004, 0x1530, 0x6114, 0x2148, 0xa876, 0xa87a, 0xa867, 0x0103,
-	0x080c, 0x6b86, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208,
-	0xba3e, 0xb8d0, 0x9005, 0x190c, 0x6749, 0x00be, 0x6044, 0xd0fc,
-	0x190c, 0xa89b, 0x080c, 0xabf2, 0x7808, 0xd09c, 0x19b0, 0x012e,
+	0x080c, 0x6b96, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208,
+	0xba3e, 0xb8d0, 0x9005, 0x190c, 0x6750, 0x00be, 0x6044, 0xd0fc,
+	0x190c, 0xa8bf, 0x080c, 0xac16, 0x7808, 0xd09c, 0x19b0, 0x012e,
 	0x0005, 0x908a, 0x0024, 0x1a0c, 0x0d7d, 0x002b, 0x012e, 0x0005,
 	0x04b0, 0x012e, 0x0005, 0x1407, 0x142d, 0x145d, 0x1462, 0x1466,
 	0x146b, 0x1493, 0x1497, 0x14a5, 0x14a9, 0x1407, 0x1574, 0x1578,
@@ -436,25 +436,25 @@ unsigned short risc_code01[] = {
 	0x1407, 0x1407, 0x1407, 0x1407, 0x1407, 0x1407, 0x146d, 0x1407,
 	0x1435, 0x145a, 0x1421, 0x1407, 0x1441, 0x140b, 0x1409, 0x080c,
 	0x0d7d, 0x080c, 0x0d76, 0x080c, 0x1603, 0x2009, 0x1a79, 0x2104,
-	0x8000, 0x200a, 0x080c, 0x7f85, 0x080c, 0x1ab5, 0x0005, 0x6044,
-	0xd0fc, 0x190c, 0xa89b, 0x2009, 0x0055, 0x080c, 0xac68, 0x012e,
-	0x0005, 0x080c, 0x1603, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa89b,
-	0x2009, 0x0055, 0x080c, 0xac68, 0x0005, 0x2009, 0x0048, 0x080c,
-	0x1603, 0x2060, 0x080c, 0xac68, 0x0005, 0x2009, 0x0054, 0x080c,
-	0x1603, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa89b, 0x080c, 0xac68,
+	0x8000, 0x200a, 0x080c, 0x7f99, 0x080c, 0x1ab5, 0x0005, 0x6044,
+	0xd0fc, 0x190c, 0xa8bf, 0x2009, 0x0055, 0x080c, 0xac8c, 0x012e,
+	0x0005, 0x080c, 0x1603, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa8bf,
+	0x2009, 0x0055, 0x080c, 0xac8c, 0x0005, 0x2009, 0x0048, 0x080c,
+	0x1603, 0x2060, 0x080c, 0xac8c, 0x0005, 0x2009, 0x0054, 0x080c,
+	0x1603, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa8bf, 0x080c, 0xac8c,
 	0x0005, 0x080c, 0x1603, 0x2060, 0x0056, 0x0066, 0x080c, 0x1603,
 	0x2028, 0x080c, 0x1603, 0x2030, 0x0036, 0x0046, 0x2021, 0x0000,
-	0x2418, 0x2009, 0x0056, 0x080c, 0xac68, 0x004e, 0x003e, 0x006e,
+	0x2418, 0x2009, 0x0056, 0x080c, 0xac8c, 0x004e, 0x003e, 0x006e,
 	0x005e, 0x0005, 0x080c, 0x1603, 0x0005, 0x7004, 0xc085, 0xc0b5,
 	0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x1603,
 	0x080c, 0x16c7, 0x0005, 0x080c, 0x0d7d, 0x080c, 0x1603, 0x2060,
 	0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048,
-	0x080c, 0xac68, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8,
+	0x080c, 0xac8c, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8,
 	0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001,
 	0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x1608, 0x2001, 0x0307,
 	0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c,
 	0x1603, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e,
-	0x2009, 0x0048, 0x080c, 0xac68, 0x0005, 0x080c, 0x1603, 0x080c,
+	0x2009, 0x0048, 0x080c, 0xac8c, 0x0005, 0x080c, 0x1603, 0x080c,
 	0x0d7d, 0x080c, 0x1603, 0x080c, 0x155f, 0x7827, 0x0018, 0x79ac,
 	0xd1dc, 0x0904, 0x1512, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000,
 	0x9065, 0x0140, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
@@ -470,13 +470,13 @@ unsigned short risc_code01[] = {
 	0x0004, 0x7803, 0x0001, 0x080c, 0x1578, 0x2001, 0x020d, 0x2003,
 	0x0020, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0d7d,
 	0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c,
-	0x7f85, 0x080c, 0x1ab5, 0x080c, 0xc814, 0x0158, 0xa9ac, 0xa936,
+	0x7f99, 0x080c, 0x1ab5, 0x080c, 0xc838, 0x0158, 0xa9ac, 0xa936,
 	0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd,
 	0xa882, 0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x2009, 0x004c,
-	0x080c, 0xac68, 0x0048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x6024, 0x190c, 0xcc10, 0x2029, 0x00c8, 0x8529, 0x0128,
-	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe6af,
-	0xd5a4, 0x1118, 0x080c, 0x1608, 0x0005, 0x080c, 0x7f85, 0x080c,
+	0x080c, 0xac8c, 0x0048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x6024, 0x190c, 0xcc34, 0x2029, 0x00c8, 0x8529, 0x0128,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe6da,
+	0xd5a4, 0x1118, 0x080c, 0x1608, 0x0005, 0x080c, 0x7f99, 0x080c,
 	0x1ab5, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016,
 	0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007,
 	0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1679, 0x00fe,
@@ -494,9 +494,9 @@ unsigned short risc_code01[] = {
 	0x1608, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x133c,
 	0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003,
 	0x0050, 0x2003, 0x0020, 0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009,
-	0x0053, 0x080c, 0xac68, 0x0005, 0x0005, 0x0005, 0x00e1, 0x2008,
-	0x00d1, 0x0006, 0x7004, 0xc09d, 0x7006, 0x000e, 0x080c, 0x8f47,
-	0x0005, 0x0089, 0x9005, 0x0118, 0x080c, 0x8b4a, 0x0cd0, 0x0005,
+	0x0053, 0x080c, 0xac8c, 0x0005, 0x0005, 0x0005, 0x00e1, 0x2008,
+	0x00d1, 0x0006, 0x7004, 0xc09d, 0x7006, 0x000e, 0x080c, 0x8f78,
+	0x0005, 0x0089, 0x9005, 0x0118, 0x080c, 0x8b7b, 0x0cd0, 0x0005,
 	0x2001, 0x0036, 0x2009, 0x1820, 0x210c, 0x2011, 0x181f, 0x2214,
 	0x080c, 0x1679, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005,
 	0x080c, 0x155f, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109,
@@ -506,7 +506,7 @@ unsigned short risc_code01[] = {
 	0x810c, 0x080c, 0x166b, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9,
 	0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4,
 	0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0,
-	0x080c, 0x7f85, 0x080c, 0x1ab5, 0x0090, 0x7827, 0x0015, 0x782b,
+	0x080c, 0x7f99, 0x080c, 0x1ab5, 0x0090, 0x7827, 0x0015, 0x782b,
 	0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003,
 	0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de,
 	0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, 0x7827,
@@ -527,9 +527,9 @@ unsigned short risc_code01[] = {
 	0xd08c, 0x0904, 0x1726, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004,
 	0xd0bc, 0x0904, 0x1726, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104,
 	0x6038, 0x00ce, 0x918e, 0x0039, 0x1904, 0x1726, 0x9c06, 0x15f0,
-	0x0126, 0x2091, 0x2600, 0x080c, 0x7edd, 0x012e, 0x7358, 0x745c,
+	0x0126, 0x2091, 0x2600, 0x080c, 0x7ef1, 0x012e, 0x7358, 0x745c,
 	0x6014, 0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x190c, 0xcbeb, 0xab42, 0xac3e, 0x2001, 0x1869,
+	0x00be, 0xd0bc, 0x190c, 0xcc0f, 0xab42, 0xac3e, 0x2001, 0x1869,
 	0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6,
 	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837,
 	0xffff, 0x080c, 0x1e75, 0x1190, 0x080c, 0x1913, 0x2a00, 0xa816,
@@ -544,7 +544,7 @@ unsigned short risc_code01[] = {
 	0x918e, 0x0048, 0x0904, 0x17c1, 0x9085, 0x0001, 0x0804, 0x18ad,
 	0xa87c, 0xd0ac, 0x0dc8, 0x0804, 0x17d1, 0xa87c, 0xd0ac, 0x0da0,
 	0x0804, 0x183c, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0xaab2,
-	0xaa3e, 0xaa42, 0x3e00, 0x9080, 0x0008, 0x2004, 0x9080, 0x9110,
+	0xaa3e, 0xaa42, 0x3e00, 0x9080, 0x0008, 0x2004, 0x9080, 0x9141,
 	0x2005, 0x9005, 0x090c, 0x0d7d, 0x2004, 0xa8ae, 0x0804, 0x1895,
 	0xa87c, 0xd0bc, 0x09c8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888,
 	0x0804, 0x17d1, 0xa87c, 0xd0bc, 0x0978, 0xa890, 0xa842, 0xa88c,
@@ -639,7 +639,7 @@ unsigned short risc_code01[] = {
 	0xa887, 0x0001, 0x0008, 0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc,
 	0x1108, 0x0005, 0xa934, 0xa88c, 0x9106, 0x1158, 0xa938, 0xa890,
 	0x9106, 0x1138, 0x601c, 0xc084, 0x601e, 0x2009, 0x0048, 0x0804,
-	0xac68, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908,
+	0xac8c, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908,
 	0x918c, 0x0007, 0x9186, 0x0000, 0x05b0, 0x9186, 0x0003, 0x0598,
 	0x6020, 0x6023, 0x0000, 0x0006, 0x2031, 0x0008, 0x00c6, 0x781f,
 	0x0808, 0x7808, 0xd09c, 0x0120, 0x080c, 0x13a3, 0x8631, 0x1db8,
@@ -649,18 +649,18 @@ unsigned short risc_code01[] = {
 	0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, 0x1b51, 0x000e,
 	0x6022, 0x012e, 0x0005, 0x080c, 0x1b3e, 0x7827, 0x0015, 0x7828,
 	0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300,
-	0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c, 0x74d5, 0x11b0,
+	0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c, 0x74e9, 0x11b0,
 	0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, 0x2003, 0x0000,
 	0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, 0x0081, 0x2001,
-	0x0386, 0x2003, 0x2020, 0x080c, 0x7576, 0x0005, 0x0479, 0x0039,
+	0x0386, 0x2003, 0x2020, 0x080c, 0x758a, 0x0005, 0x0479, 0x0039,
 	0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0005, 0x00e6,
 	0x2071, 0x0200, 0x080c, 0x29fc, 0x2009, 0x003c, 0x080c, 0x21b0,
 	0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084, 0x003c, 0x1de0,
-	0x080c, 0x8522, 0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c, 0x709e,
+	0x080c, 0x8553, 0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c, 0x709e,
 	0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079, 0x0300, 0x080c,
 	0x133c, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138,
 	0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000,
-	0x080c, 0x74d5, 0x1108, 0x0005, 0x2021, 0x0260, 0x2001, 0x0141,
+	0x080c, 0x74e9, 0x1108, 0x0005, 0x2021, 0x0260, 0x2001, 0x0141,
 	0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c, 0x939c, 0x0048,
 	0x1160, 0x2001, 0x0111, 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70,
 	0x2001, 0x015d, 0x2003, 0x0000, 0x0005, 0x0046, 0x2021, 0x0019,
@@ -736,13 +736,13 @@ unsigned short risc_code01[] = {
 	0x3e60, 0x6044, 0x9105, 0x6046, 0x0804, 0x1d0e, 0x080c, 0x0d7d,
 	0x00f6, 0x00e6, 0x0096, 0x00c6, 0x0026, 0x704c, 0x9c06, 0x190c,
 	0x0d7d, 0x2079, 0x0090, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b,
-	0x0004, 0x7057, 0x0000, 0x6014, 0x2048, 0x080c, 0xc814, 0x0118,
+	0x0004, 0x7057, 0x0000, 0x6014, 0x2048, 0x080c, 0xc838, 0x0118,
 	0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006, 0x1170, 0x2061,
 	0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206,
 	0x1dc0, 0x60c4, 0xa89a, 0x60c8, 0xa896, 0x704c, 0x2060, 0x00c6,
-	0x080c, 0xc41f, 0x080c, 0xa872, 0x00ce, 0x704c, 0x9c06, 0x1150,
-	0x2009, 0x0040, 0x080c, 0x21b0, 0x080c, 0xa32a, 0x2011, 0x0000,
-	0x080c, 0xa1b5, 0x002e, 0x00ce, 0x009e, 0x00ee, 0x00fe, 0x0005,
+	0x080c, 0xc443, 0x080c, 0xa896, 0x00ce, 0x704c, 0x9c06, 0x1150,
+	0x2009, 0x0040, 0x080c, 0x21b0, 0x080c, 0xa34e, 0x2011, 0x0000,
+	0x080c, 0xa1d9, 0x002e, 0x00ce, 0x009e, 0x00ee, 0x00fe, 0x0005,
 	0x00f6, 0x2079, 0x0090, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079,
 	0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x2019,
 	0x1000, 0x8319, 0x090c, 0x0d7d, 0x7820, 0xd0bc, 0x1dd0, 0x79c8,
@@ -751,12 +751,12 @@ unsigned short risc_code01[] = {
 	0x2079, 0x0090, 0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x0005,
 	0x00f6, 0x00e6, 0x2071, 0x19e7, 0x7054, 0x9086, 0x0000, 0x0904,
 	0x1e26, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c, 0xd194, 0x01b8,
-	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xe6f8,
+	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xe723,
 	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d7d, 0x0016, 0x2009,
 	0x0040, 0x080c, 0x21b0, 0x001e, 0x2001, 0x020c, 0x2102, 0x2009,
 	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009,
-	0x0040, 0x080c, 0x21b0, 0x782c, 0xd0fc, 0x09a8, 0x080c, 0xa88e,
-	0x782c, 0xd0fc, 0x1de8, 0x080c, 0xa872, 0x7054, 0x9086, 0x0000,
+	0x0040, 0x080c, 0x21b0, 0x782c, 0xd0fc, 0x09a8, 0x080c, 0xa8b2,
+	0x782c, 0xd0fc, 0x1de8, 0x080c, 0xa896, 0x7054, 0x9086, 0x0000,
 	0x1950, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040,
 	0x080c, 0x21b0, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe,
 	0x0005, 0x080c, 0x0d7d, 0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51,
@@ -841,17 +841,17 @@ unsigned short risc_code01[] = {
 	0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005,
 	0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x21ad, 0x7900, 0xd1dc,
 	0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x20cf,
-	0x20c7, 0x7edd, 0x20c7, 0x20c9, 0x20c9, 0x20c9, 0x20c9, 0x7ec3,
+	0x20c7, 0x7ef1, 0x20c7, 0x20c9, 0x20c9, 0x20c9, 0x20c9, 0x7ed7,
 	0x20c7, 0x20cb, 0x20c7, 0x20c9, 0x20c7, 0x20c9, 0x20c7, 0x080c,
-	0x0d7d, 0x0031, 0x0020, 0x080c, 0x7ec3, 0x080c, 0x7edd, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x080c, 0xe6f8, 0x7930, 0x9184, 0x0003,
-	0x01f0, 0x080c, 0xa872, 0x2001, 0x19fa, 0x2004, 0x9005, 0x0180,
+	0x0d7d, 0x0031, 0x0020, 0x080c, 0x7ed7, 0x080c, 0x7ef1, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x080c, 0xe723, 0x7930, 0x9184, 0x0003,
+	0x01f0, 0x080c, 0xa896, 0x2001, 0x19fa, 0x2004, 0x9005, 0x0180,
 	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d7d, 0x00c6, 0x2001,
-	0x19fa, 0x2064, 0x080c, 0xa88e, 0x080c, 0xc41f, 0x00ce, 0x0408,
-	0x2009, 0x0040, 0x080c, 0x21b0, 0x080c, 0xa88e, 0x00d0, 0x9184,
-	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x74d5,
-	0x1138, 0x080c, 0x77d9, 0x080c, 0x6022, 0x080c, 0x7406, 0x0010,
-	0x080c, 0x5edd, 0x080c, 0x7f7b, 0x0041, 0x0018, 0x9184, 0x9540,
+	0x19fa, 0x2064, 0x080c, 0xa8b2, 0x080c, 0xc443, 0x00ce, 0x0408,
+	0x2009, 0x0040, 0x080c, 0x21b0, 0x080c, 0xa8b2, 0x00d0, 0x9184,
+	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x74e9,
+	0x1138, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c, 0x741a, 0x0010,
+	0x080c, 0x5ee4, 0x080c, 0x7f8f, 0x0041, 0x0018, 0x9184, 0x9540,
 	0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036, 0x0046,
 	0x0056, 0x2071, 0x1a6b, 0x080c, 0x1ab5, 0x005e, 0x004e, 0x003e,
 	0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071, 0x1800, 0x7128,
@@ -900,93 +900,93 @@ unsigned short risc_code01[] = {
 	0x001e, 0x0d30, 0x0c58, 0x2286, 0x2283, 0x2283, 0x2283, 0x2285,
 	0x2283, 0x2283, 0x2283, 0x080c, 0x0d7d, 0x0029, 0x002e, 0x001e,
 	0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118,
-	0xd19c, 0x1904, 0x2500, 0xd1f4, 0x190c, 0x0d76, 0x080c, 0x74d5,
-	0x0904, 0x22e3, 0x080c, 0xcf2e, 0x1120, 0x7000, 0x9086, 0x0003,
-	0x0580, 0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x74f8, 0x0118,
-	0x080c, 0x74e6, 0x1530, 0x2011, 0x0020, 0x080c, 0x2a44, 0x6043,
-	0x0000, 0x080c, 0xcf2e, 0x0168, 0x080c, 0x74f8, 0x1150, 0x2001,
-	0x19a7, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x734b, 0x0804,
+	0xd19c, 0x1904, 0x2500, 0xd1f4, 0x190c, 0x0d76, 0x080c, 0x74e9,
+	0x0904, 0x22e3, 0x080c, 0xcf52, 0x1120, 0x7000, 0x9086, 0x0003,
+	0x0580, 0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x750c, 0x0118,
+	0x080c, 0x74fa, 0x1530, 0x2011, 0x0020, 0x080c, 0x2a44, 0x6043,
+	0x0000, 0x080c, 0xcf52, 0x0168, 0x080c, 0x750c, 0x1150, 0x2001,
+	0x19a7, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x735f, 0x0804,
 	0x2503, 0x70a4, 0x9005, 0x1150, 0x70a7, 0x0001, 0x00d6, 0x2069,
-	0x0140, 0x080c, 0x752c, 0x00de, 0x1904, 0x2503, 0x080c, 0x77e3,
-	0x0428, 0x080c, 0x74f8, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108,
-	0x0468, 0x080c, 0x77e3, 0x080c, 0x77d9, 0x080c, 0x6022, 0x080c,
-	0x7406, 0x0804, 0x2500, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170,
+	0x0140, 0x080c, 0x7540, 0x00de, 0x1904, 0x2503, 0x080c, 0x77f7,
+	0x0428, 0x080c, 0x750c, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108,
+	0x0468, 0x080c, 0x77f7, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c,
+	0x741a, 0x0804, 0x2500, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170,
 	0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7098, 0x9086,
-	0x0028, 0x1110, 0x080c, 0x76ba, 0x0804, 0x2500, 0x080c, 0x77de,
-	0x0048, 0x2001, 0x197d, 0x2003, 0x0002, 0x0020, 0x080c, 0x7617,
-	0x0804, 0x2500, 0x080c, 0x775d, 0x0804, 0x2500, 0x6220, 0xd1bc,
+	0x0028, 0x1110, 0x080c, 0x76ce, 0x0804, 0x2500, 0x080c, 0x77f2,
+	0x0048, 0x2001, 0x197d, 0x2003, 0x0002, 0x0020, 0x080c, 0x762b,
+	0x0804, 0x2500, 0x080c, 0x7771, 0x0804, 0x2500, 0x6220, 0xd1bc,
 	0x0138, 0xd2bc, 0x1904, 0x2565, 0xd2b4, 0x1904, 0x2577, 0x0000,
 	0xd1ac, 0x0904, 0x240d, 0x0036, 0x6328, 0xc3bc, 0x632a, 0x003e,
-	0x080c, 0x74d5, 0x11d0, 0x2011, 0x0020, 0x080c, 0x2a44, 0x0006,
-	0x0026, 0x0036, 0x080c, 0x74ef, 0x1158, 0x080c, 0x77d9, 0x080c,
-	0x6022, 0x080c, 0x7406, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
-	0x003e, 0x002e, 0x000e, 0x080c, 0x74a9, 0x0016, 0x0046, 0x00c6,
+	0x080c, 0x74e9, 0x11d0, 0x2011, 0x0020, 0x080c, 0x2a44, 0x0006,
+	0x0026, 0x0036, 0x080c, 0x7503, 0x1158, 0x080c, 0x77ed, 0x080c,
+	0x6029, 0x080c, 0x741a, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
+	0x003e, 0x002e, 0x000e, 0x080c, 0x74bd, 0x0016, 0x0046, 0x00c6,
 	0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043,
 	0x0090, 0x6043, 0x0010, 0x74da, 0x948c, 0xff00, 0x7038, 0xd084,
 	0x0178, 0x9186, 0xf800, 0x1160, 0x7048, 0xd084, 0x1148, 0xc085,
-	0x704a, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x4b00, 0x003e,
-	0x080c, 0xcf27, 0x1904, 0x23e4, 0x9196, 0xff00, 0x05a8, 0x7060,
+	0x704a, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x4b07, 0x003e,
+	0x080c, 0xcf4b, 0x1904, 0x23e4, 0x9196, 0xff00, 0x05a8, 0x7060,
 	0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130,
-	0xd184, 0x1550, 0x080c, 0x3361, 0x0128, 0xc18d, 0x7132, 0x080c,
-	0x6a53, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
+	0xd184, 0x1550, 0x080c, 0x3368, 0x0128, 0xc18d, 0x7132, 0x080c,
+	0x6a63, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
 	0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x23e4,
 	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
 	0x23e4, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c,
-	0x4b00, 0x003e, 0x0804, 0x23e4, 0x7038, 0xd08c, 0x1140, 0x2001,
+	0x4b07, 0x003e, 0x0804, 0x23e4, 0x7038, 0xd08c, 0x1140, 0x2001,
 	0x180c, 0x200c, 0xd1ac, 0x1904, 0x23e4, 0xc1ad, 0x2102, 0x0036,
-	0x73d8, 0x2011, 0x8013, 0x080c, 0x4b00, 0x003e, 0x7130, 0xc185,
+	0x73d8, 0x2011, 0x8013, 0x080c, 0x4b07, 0x003e, 0x7130, 0xc185,
 	0x7132, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x01f0, 0x0016, 0x2009,
-	0x0001, 0x2011, 0x0100, 0x080c, 0x88bb, 0x2019, 0x000e, 0x00c6,
-	0x2061, 0x0000, 0x080c, 0xe20e, 0x00ce, 0x9484, 0x00ff, 0x9080,
-	0x336d, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009,
-	0x000e, 0x080c, 0xe29e, 0x001e, 0x0016, 0x2009, 0x0002, 0x2019,
-	0x0004, 0x080c, 0x31a3, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9,
-	0x007f, 0x900e, 0x080c, 0x661e, 0x1110, 0x080c, 0x603c, 0x8108,
-	0x1f04, 0x23da, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0xa872,
-	0x080c, 0xab3a, 0x080c, 0xa88e, 0x60e3, 0x0000, 0x001e, 0x2001,
+	0x0001, 0x2011, 0x0100, 0x080c, 0x88ec, 0x2019, 0x000e, 0x00c6,
+	0x2061, 0x0000, 0x080c, 0xe239, 0x00ce, 0x9484, 0x00ff, 0x9080,
+	0x3374, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009,
+	0x000e, 0x080c, 0xe2c9, 0x001e, 0x0016, 0x2009, 0x0002, 0x2019,
+	0x0004, 0x080c, 0x31a6, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9,
+	0x007f, 0x900e, 0x080c, 0x6625, 0x1110, 0x080c, 0x6043, 0x8108,
+	0x1f04, 0x23da, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0xa896,
+	0x080c, 0xab5e, 0x080c, 0xa8b2, 0x60e3, 0x0000, 0x001e, 0x2001,
 	0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c, 0x11b0, 0x2011,
 	0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295, 0x0002, 0x6206,
 	0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x1826, 0x2003,
 	0x0000, 0x2011, 0x0020, 0x080c, 0x2a44, 0xd194, 0x0904, 0x2500,
-	0x0016, 0x080c, 0xa872, 0x6220, 0xd2b4, 0x0904, 0x249b, 0x080c,
-	0x86c5, 0x080c, 0x9e0e, 0x2011, 0x0004, 0x080c, 0x2a44, 0x00f6,
+	0x0016, 0x080c, 0xa896, 0x6220, 0xd2b4, 0x0904, 0x249b, 0x080c,
+	0x86f6, 0x080c, 0x9e32, 0x2011, 0x0004, 0x080c, 0x2a44, 0x00f6,
 	0x2019, 0x19f3, 0x2304, 0x907d, 0x0904, 0x2468, 0x7804, 0x9086,
 	0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140,
 	0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001, 0x0003,
 	0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0,
 	0x080c, 0x2a1a, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009,
 	0x080c, 0x29d1, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100,
-	0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x080c, 0x95ad, 0x080c,
-	0xa88e, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0xabc9,
+	0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x080c, 0x95de, 0x080c,
+	0xa8b2, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0xabed,
 	0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005,
 	0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110,
 	0x080c, 0x2a1a, 0x00de, 0x00c6, 0x2061, 0x19e7, 0x6034, 0x080c,
-	0xcf2e, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
-	0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x9de6, 0x0804, 0x24fd,
-	0x2061, 0x0100, 0x62c0, 0x080c, 0xa7a8, 0x2019, 0x19f3, 0x2304,
-	0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027, 0x080c, 0xac68,
-	0x00ce, 0x0804, 0x24fd, 0xd2bc, 0x0904, 0x24e0, 0x080c, 0x86d2,
+	0xcf52, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
+	0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x9e0a, 0x0804, 0x24fd,
+	0x2061, 0x0100, 0x62c0, 0x080c, 0xa7cc, 0x2019, 0x19f3, 0x2304,
+	0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027, 0x080c, 0xac8c,
+	0x00ce, 0x0804, 0x24fd, 0xd2bc, 0x0904, 0x24e0, 0x080c, 0x8703,
 	0x2011, 0x0004, 0x080c, 0x2a44, 0x00d6, 0x2069, 0x0140, 0x6804,
 	0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x00de, 0x00c6, 0x2061,
-	0x19e7, 0x6050, 0x080c, 0xcf2e, 0x0120, 0x909a, 0x0003, 0x1668,
+	0x19e7, 0x6050, 0x080c, 0xcf52, 0x0120, 0x909a, 0x0003, 0x1668,
 	0x0018, 0x909a, 0x00c8, 0x1648, 0x8000, 0x6052, 0x604c, 0x00ce,
-	0x9005, 0x05d8, 0x2009, 0x07d0, 0x080c, 0x86ca, 0x9080, 0x0008,
+	0x9005, 0x05d8, 0x2009, 0x07d0, 0x080c, 0x86fb, 0x9080, 0x0008,
 	0x2004, 0x9086, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012,
 	0x080c, 0x2a53, 0x0450, 0x9080, 0x0008, 0x2004, 0x9086, 0x0009,
 	0x0d98, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c, 0x2a53, 0x00e8,
 	0x2011, 0x0004, 0x080c, 0x2a44, 0x00c0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa0f4, 0x003e, 0x2019, 0x19fa, 0x2304, 0x9065, 0x0160,
+	0x080c, 0xa118, 0x003e, 0x2019, 0x19fa, 0x2304, 0x9065, 0x0160,
 	0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110, 0x2009, 0x004f,
-	0x6003, 0x0003, 0x080c, 0xac68, 0x00ce, 0x080c, 0xa88e, 0x001e,
+	0x6003, 0x0003, 0x080c, 0xac8c, 0x00ce, 0x080c, 0xa8b2, 0x001e,
 	0xd19c, 0x0904, 0x255e, 0x7038, 0xd0ac, 0x1538, 0x0016, 0x0156,
 	0x2011, 0x0008, 0x080c, 0x2a44, 0x6050, 0xc0e5, 0x6052, 0x20a9,
-	0x0367, 0x1f04, 0x252b, 0x1d04, 0x2513, 0x080c, 0x86f9, 0x6020,
+	0x0367, 0x1f04, 0x252b, 0x1d04, 0x2513, 0x080c, 0x872a, 0x6020,
 	0xd09c, 0x1db8, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2981, 0x00fe,
 	0x1d80, 0x6050, 0xc0e4, 0x6052, 0x2011, 0x0008, 0x080c, 0x2a44,
 	0x015e, 0x001e, 0x0498, 0x015e, 0x001e, 0x0016, 0x6028, 0xc09c,
-	0x602a, 0x080c, 0xa872, 0x080c, 0xab3a, 0x080c, 0xa88e, 0x60e3,
-	0x0000, 0x080c, 0xe6d7, 0x080c, 0xe6f2, 0x080c, 0x56d7, 0xd0fc,
-	0x1138, 0x080c, 0xcf27, 0x1120, 0x9085, 0x0001, 0x080c, 0x751c,
+	0x602a, 0x080c, 0xa896, 0x080c, 0xab5e, 0x080c, 0xa8b2, 0x60e3,
+	0x0000, 0x080c, 0xe702, 0x080c, 0xe71d, 0x080c, 0x56de, 0xd0fc,
+	0x1138, 0x080c, 0xcf4b, 0x1120, 0x9085, 0x0001, 0x080c, 0x7530,
 	0x9006, 0x080c, 0x2a0a, 0x2009, 0x0002, 0x080c, 0x29f6, 0x00e6,
 	0x2071, 0x1800, 0x7003, 0x0004, 0x080c, 0x0eb4, 0x00ee, 0x2011,
 	0x0008, 0x080c, 0x2a44, 0x080c, 0x0bc3, 0x001e, 0x918c, 0xffd0,
@@ -1002,34 +1002,34 @@ unsigned short risc_code01[] = {
 	0x8000, 0x2071, 0x1800, 0x71d0, 0x70d2, 0x9116, 0x0904, 0x25f3,
 	0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x29f6, 0x2011, 0x8011,
 	0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019, 0x0001,
-	0x0010, 0x2019, 0x0000, 0x080c, 0x4b00, 0x0468, 0x2001, 0x19a8,
+	0x0010, 0x2019, 0x0000, 0x080c, 0x4b07, 0x0468, 0x2001, 0x19a8,
 	0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4, 0x0118,
-	0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c, 0x4b00,
-	0x080c, 0x0eb4, 0x080c, 0x56d7, 0xd0fc, 0x11a8, 0x080c, 0xcf27,
-	0x1190, 0x00c6, 0x080c, 0x268f, 0x080c, 0xa872, 0x080c, 0xa04f,
-	0x080c, 0xa88e, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
-	0x080c, 0x31a3, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
+	0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c, 0x4b07,
+	0x080c, 0x0eb4, 0x080c, 0x56de, 0xd0fc, 0x11a8, 0x080c, 0xcf4b,
+	0x1190, 0x00c6, 0x080c, 0x268f, 0x080c, 0xa896, 0x080c, 0xa073,
+	0x080c, 0xa8b2, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
+	0x080c, 0x31a6, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
 	0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
 	0xff00, 0x11f0, 0x2011, 0x1837, 0x2214, 0xd2ac, 0x11c8, 0x81ff,
 	0x01e8, 0x2011, 0x181f, 0x2204, 0x9106, 0x1190, 0x2011, 0x1820,
 	0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148, 0x2011,
 	0x1820, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120,
-	0x2500, 0x080c, 0x81ce, 0x0048, 0x9584, 0x00ff, 0x9080, 0x336d,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x336d,
+	0x2500, 0x080c, 0x81ff, 0x0048, 0x9584, 0x00ff, 0x9080, 0x3374,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x3374,
 	0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140, 0x2001,
 	0x1818, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852, 0x6856,
 	0x1f04, 0x263f, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026, 0x2069,
 	0x0140, 0x2001, 0x1818, 0x2102, 0x8114, 0x8214, 0x8214, 0x8214,
 	0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128, 0x9184,
-	0x000f, 0x9080, 0xe706, 0x2005, 0x6856, 0x8211, 0x1f04, 0x2654,
+	0x000f, 0x9080, 0xe731, 0x2005, 0x6856, 0x8211, 0x1f04, 0x2654,
 	0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800, 0x6030,
 	0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005, 0x0156,
 	0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980, 0x9116,
 	0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001, 0x0402,
 	0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x2684, 0x680f,
 	0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005, 0x080c,
-	0x56d3, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
-	0x2009, 0x002e, 0x080c, 0xe29e, 0x004e, 0x0005, 0x00f6, 0x0016,
+	0x56da, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
+	0x2009, 0x002e, 0x080c, 0xe2c9, 0x004e, 0x0005, 0x00f6, 0x0016,
 	0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x26fb, 0x080c,
 	0x2971, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120, 0x2011,
 	0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011, 0x8000,
@@ -1038,9 +1038,9 @@ unsigned short risc_code01[] = {
 	0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078, 0x908e,
 	0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084, 0x0700,
 	0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300, 0x9080,
-	0x0020, 0x2018, 0x080c, 0x9135, 0x928c, 0xff00, 0x0110, 0x2011,
+	0x0020, 0x2018, 0x080c, 0x9166, 0x928c, 0xff00, 0x0110, 0x2011,
 	0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009, 0x0138,
-	0x220a, 0x080c, 0x74d5, 0x1118, 0x2009, 0x196d, 0x220a, 0x002e,
+	0x220a, 0x080c, 0x74e9, 0x1118, 0x2009, 0x196d, 0x220a, 0x002e,
 	0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091,
 	0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, 0x8000,
 	0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0d76, 0x002e, 0x001e,
@@ -1056,17 +1056,17 @@ unsigned short risc_code01[] = {
 	0x27ca, 0x2001, 0x0001, 0x080c, 0x25a0, 0x080c, 0x29bb, 0x2001,
 	0x1992, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006,
 	0x20a9, 0x0009, 0x080c, 0x298d, 0x2001, 0x1990, 0x2003, 0x0006,
-	0x2009, 0x001e, 0x2011, 0x27cb, 0x080c, 0x86d7, 0x0005, 0x2009,
+	0x2009, 0x001e, 0x2011, 0x27cb, 0x080c, 0x8708, 0x0005, 0x2009,
 	0x1995, 0x200b, 0x0000, 0x2001, 0x199a, 0x2003, 0x0036, 0x2001,
 	0x1999, 0x2003, 0x002a, 0x2001, 0x1992, 0x2003, 0x0001, 0x9006,
 	0x080c, 0x2928, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x298d,
 	0x2001, 0x1990, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x27cb,
-	0x080c, 0x86d7, 0x0005, 0x080c, 0x0d7d, 0x2001, 0x199a, 0x2003,
+	0x080c, 0x8708, 0x0005, 0x080c, 0x0d7d, 0x2001, 0x199a, 0x2003,
 	0x0036, 0x2001, 0x1992, 0x2003, 0x0003, 0x7a38, 0x9294, 0x0005,
 	0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
 	0x2928, 0x2001, 0x1996, 0x2003, 0x0000, 0x2001, 0xffff, 0x20a9,
 	0x0009, 0x080c, 0x298d, 0x2001, 0x1990, 0x2003, 0x0006, 0x2009,
-	0x001e, 0x2011, 0x27cb, 0x080c, 0x86d7, 0x0005, 0x080c, 0x0d7d,
+	0x001e, 0x2011, 0x27cb, 0x080c, 0x8708, 0x0005, 0x080c, 0x0d7d,
 	0x080c, 0x0d7d, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6,
 	0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001, 0x1992,
 	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d7d, 0x0043, 0x012e, 0x015e,
@@ -1128,24 +1128,24 @@ unsigned short risc_code01[] = {
 	0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060,
 	0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003,
 	0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x29ad, 0x080c,
-	0x86f9, 0x1f04, 0x29ad, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e,
+	0x872a, 0x1f04, 0x29ad, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e,
 	0x001e, 0x012e, 0x0005, 0x080c, 0x2aab, 0x0005, 0x0006, 0x0156,
 	0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1100,
 	0x7854, 0xd08c, 0x1110, 0x1f04, 0x29c8, 0x00fe, 0x015e, 0x000e,
-	0x0005, 0x1d04, 0x29d1, 0x080c, 0x86f9, 0x1f04, 0x29d1, 0x0005,
+	0x0005, 0x1d04, 0x29d1, 0x080c, 0x872a, 0x1f04, 0x29d1, 0x0005,
 	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005,
 	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005,
 	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005,
 	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001,
 	0x19a8, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc,
 	0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001,
-	0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x74ef, 0x0108, 0xc0bc,
+	0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x7503, 0x0108, 0xc0bc,
 	0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e,
 	0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294,
 	0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e, 0x0005,
 	0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215,
 	0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009, 0x0140,
-	0x2104, 0x1128, 0x080c, 0x74ef, 0x0110, 0xc0bc, 0x0008, 0xc0bd,
+	0x2104, 0x1128, 0x080c, 0x7503, 0x0110, 0xc0bc, 0x0008, 0xc0bd,
 	0x200a, 0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843,
 	0x0101, 0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202, 0x7843,
 	0x0100, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0202,
@@ -1252,1935 +1252,1937 @@ unsigned short risc_code01[] = {
 	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
 	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0x2248, 0x080c,
 	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x0804,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x0804,
 	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0xa8d8, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106,
+	0x0156, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x207e, 0x080c, 0xa8d8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
+	0x207e, 0x080c, 0xa8fc, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c,
-	0xa8d8, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x080c,
+	0xa8fc, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
 	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x080c, 0x2248, 0x080c,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c,
 	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
 	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
 	0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x080c,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
 	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x080c, 0x2248, 0x080c,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c,
 	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
 	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
 	0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x080c,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
 	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8d8, 0x080c,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
 	0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x207e, 0x080c, 0xa8d8, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804,
+	0x207e, 0x080c, 0xa8fc, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804,
 	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c, 0x2248, 0x080c,
+	0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c,
 	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8d8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0xa8d8, 0x080c,
+	0xa8fc, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0xa8fc, 0x080c,
 	0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
 	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0xa8d8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0xa8fc, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
 	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0xa8d8, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
+	0xa8fc, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8d8, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
+	0xa8fc, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8d8, 0x080c, 0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106,
+	0xa8fc, 0x080c, 0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x26fe, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c, 0x20a8, 0x0804,
+	0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c, 0x20a8, 0x0804,
 	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c,
+	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
 	0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8d8, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
+	0xa8fc, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8d8, 0x080c, 0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106,
+	0xa8fc, 0x080c, 0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x26fe, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c, 0x13a3, 0x0804,
+	0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c, 0x13a3, 0x0804,
 	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0xa8d8, 0x080c,
+	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
 	0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8d8, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x04d8, 0x0106, 0x0006,
+	0xa8fc, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x04d8, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe,
-	0x080c, 0xa8d8, 0x080c, 0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8,
+	0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8,
 	0x0440, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
 	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0x13a3, 0x080c,
-	0xa8d8, 0x080c, 0x20a8, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0xa8fc, 0x080c, 0x20a8, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6,
 	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e,
-	0x080c, 0xa8d8, 0x080c, 0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8,
+	0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8,
 	0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e,
 	0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c,
-	0x6a19, 0x1904, 0x30bf, 0x72dc, 0x2001, 0x197c, 0x2004, 0x9005,
-	0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x30bf,
-	0x080c, 0x30c4, 0x0804, 0x30bf, 0xd2cc, 0x1904, 0x30bf, 0x080c,
-	0x74d5, 0x1120, 0x70af, 0xffff, 0x0804, 0x30bf, 0xd294, 0x0120,
-	0x70af, 0xffff, 0x0804, 0x30bf, 0x080c, 0x335c, 0x0160, 0x080c,
-	0xcf2e, 0x0128, 0x2001, 0x1818, 0x203c, 0x0804, 0x304c, 0x70af,
-	0xffff, 0x0804, 0x30bf, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284,
-	0x0904, 0x304c, 0xd28c, 0x1904, 0x304c, 0x0036, 0x73ac, 0x938e,
+	0x6a29, 0x1904, 0x30c2, 0x72dc, 0x2001, 0x197c, 0x2004, 0x9005,
+	0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x30c2,
+	0x080c, 0x30c7, 0x0804, 0x30c2, 0xd2cc, 0x1904, 0x30c2, 0x080c,
+	0x74e9, 0x1120, 0x70af, 0xffff, 0x0804, 0x30c2, 0xd294, 0x0120,
+	0x70af, 0xffff, 0x0804, 0x30c2, 0x080c, 0x3363, 0x0160, 0x080c,
+	0xcf52, 0x0128, 0x2001, 0x1818, 0x203c, 0x0804, 0x304f, 0x70af,
+	0xffff, 0x0804, 0x30c2, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284,
+	0x0904, 0x304f, 0xd28c, 0x1904, 0x304f, 0x0036, 0x73ac, 0x938e,
 	0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04,
 	0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084,
-	0x00ff, 0x970e, 0x05b8, 0x908e, 0x0000, 0x05a0, 0x908e, 0x00ff,
-	0x1150, 0x7230, 0xd284, 0x1598, 0x7294, 0xc28d, 0x7296, 0x70af,
-	0xffff, 0x003e, 0x0488, 0x900e, 0x080c, 0x25fb, 0x080c, 0x65bd,
-	0x1520, 0x9006, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6,
-	0x2060, 0x080c, 0x8b5f, 0x00ce, 0x090c, 0x8f03, 0xb8af, 0x0000,
-	0x080c, 0x6a5b, 0x1150, 0x7030, 0xd08c, 0x0118, 0xb800, 0xd0bc,
-	0x0120, 0x080c, 0x30dd, 0x0148, 0x0028, 0x080c, 0x3231, 0x080c,
-	0x3109, 0x0118, 0x8318, 0x0804, 0x2ffc, 0x73ae, 0x0010, 0x70af,
-	0xffff, 0x003e, 0x0804, 0x30bf, 0x9780, 0x336d, 0x203d, 0x97bc,
-	0xff00, 0x873f, 0x2041, 0x007e, 0x70ac, 0x9096, 0xffff, 0x1118,
-	0x900e, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8,
-	0x0020, 0x70af, 0xffff, 0x0804, 0x30bf, 0x2700, 0x0156, 0x0016,
-	0x9106, 0x0904, 0x30b4, 0xc484, 0x080c, 0x661e, 0x0148, 0x080c,
-	0xcf2e, 0x1904, 0x30b4, 0x080c, 0x65bd, 0x1904, 0x30bc, 0x0008,
-	0xc485, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060,
-	0x080c, 0x8b5f, 0x00ce, 0x090c, 0x8f03, 0xb8af, 0x0000, 0x080c,
-	0x6a5b, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0,
-	0x7294, 0xd28c, 0x0180, 0x080c, 0x6a5b, 0x9082, 0x0006, 0x02e0,
-	0xd484, 0x1118, 0x080c, 0x65e2, 0x0028, 0x080c, 0x32ca, 0x01a0,
-	0x080c, 0x32f5, 0x0088, 0x080c, 0x3231, 0x080c, 0xcf2e, 0x1160,
-	0x080c, 0x3109, 0x0188, 0x0040, 0x080c, 0xcf2e, 0x1118, 0x080c,
-	0x32ca, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04,
-	0x3065, 0x70af, 0xffff, 0x0018, 0x001e, 0x015e, 0x71ae, 0x004e,
-	0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70af, 0x0001,
-	0x2009, 0x007e, 0x080c, 0x65bd, 0x1168, 0xb813, 0x00ff, 0xb817,
-	0xfffe, 0x080c, 0x3231, 0x04a9, 0x0128, 0x70dc, 0xc0bd, 0x70de,
-	0x080c, 0xcc7b, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6,
-	0x00c6, 0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c,
-	0xac3b, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xcca8, 0x6023, 0x0001,
-	0x9006, 0x080c, 0x655a, 0x2001, 0x0000, 0x080c, 0x656e, 0x0126,
-	0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0004,
-	0x080c, 0xac68, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
-	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004,
-	0x9084, 0x00ff, 0xb842, 0x080c, 0xac3b, 0x0548, 0x2b00, 0x6012,
-	0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804,
-	0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x31e4, 0x080c,
-	0xcca8, 0x6023, 0x0001, 0x9006, 0x080c, 0x655a, 0x2001, 0x0002,
-	0x080c, 0x656e, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa,
-	0x012e, 0x2009, 0x0002, 0x080c, 0xac68, 0x9085, 0x0001, 0x00ce,
-	0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009,
-	0x0080, 0x080c, 0x65bd, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc,
-	0x0039, 0x0110, 0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005,
-	0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0xab73, 0x01d0, 0x2b00,
-	0x6012, 0x080c, 0xcca8, 0x6023, 0x0001, 0x9006, 0x080c, 0x655a,
-	0x2001, 0x0002, 0x080c, 0x656e, 0x0126, 0x2091, 0x8000, 0x70e4,
-	0x8000, 0x70e6, 0x012e, 0x2009, 0x0002, 0x080c, 0xac68, 0x9085,
-	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6,
-	0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x65bd, 0x11b8,
-	0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8d7, 0x0004, 0x080c, 0xab73,
-	0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c,
-	0xcca8, 0x2009, 0x0022, 0x080c, 0xac68, 0x9085, 0x0001, 0x012e,
-	0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026,
-	0x00b6, 0x21f0, 0x9036, 0x080c, 0xa872, 0x1110, 0x2031, 0x0001,
-	0x0066, 0x080c, 0x937f, 0x080c, 0x92f5, 0x080c, 0xa7c8, 0x080c,
-	0xbaf5, 0x006e, 0x86ff, 0x0110, 0x080c, 0xa88e, 0x3e08, 0x2130,
-	0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f,
-	0x900e, 0x0016, 0x080c, 0x661e, 0x1140, 0x9686, 0x0002, 0x1118,
-	0xb800, 0xd0bc, 0x1110, 0x080c, 0x603c, 0x001e, 0x8108, 0x1f04,
-	0x31c9, 0x9686, 0x0001, 0x190c, 0x3330, 0x00be, 0x002e, 0x003e,
-	0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026,
-	0x0016, 0x00b6, 0x9016, 0x080c, 0xa872, 0x1110, 0x2011, 0x0001,
-	0x0026, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c,
-	0x9374, 0x0076, 0x2039, 0x0000, 0x080c, 0x9246, 0x2c08, 0x080c,
-	0xdfc0, 0x007e, 0x001e, 0x002e, 0x82ff, 0x0110, 0x080c, 0xa88e,
-	0xba10, 0xbb14, 0x080c, 0x603c, 0xba12, 0xbb16, 0x00be, 0x001e,
-	0x002e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6,
-	0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071,
-	0x1800, 0x70a8, 0x9005, 0x0110, 0x8001, 0x70aa, 0x000e, 0x00ee,
-	0x0005, 0x2071, 0x1800, 0x70e4, 0x9005, 0x0dc0, 0x8001, 0x70e6,
-	0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6,
-	0x00b6, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c,
-	0xa872, 0x1110, 0x2011, 0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9,
-	0x0001, 0x0088, 0x080c, 0x56d3, 0xd0c4, 0x0150, 0xd0a4, 0x0140,
-	0x9006, 0x0046, 0x2020, 0x2009, 0x002d, 0x080c, 0xe29e, 0x004e,
-	0x20a9, 0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x32a5,
-	0x928e, 0x007f, 0x0904, 0x32a5, 0x928e, 0x0080, 0x05f0, 0x9288,
-	0x1000, 0x210c, 0x81ff, 0x05c8, 0x8fff, 0x1150, 0x2001, 0x198e,
-	0x0006, 0x2003, 0x0001, 0x080c, 0x32b7, 0x000e, 0x2003, 0x0000,
-	0x00b6, 0x00c6, 0x2158, 0x2001, 0x0001, 0x080c, 0x6a25, 0x00ce,
-	0x00be, 0x2019, 0x0029, 0x080c, 0x9374, 0x0076, 0x2039, 0x0000,
-	0x080c, 0x9246, 0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294,
-	0x00ff, 0x9286, 0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001,
-	0x0004, 0x8007, 0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016,
-	0x2c08, 0x080c, 0xdfc0, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04,
-	0x325b, 0x002e, 0x82ff, 0x0110, 0x080c, 0xa88e, 0x015e, 0x001e,
-	0x002e, 0x003e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046,
-	0x0026, 0x0016, 0x080c, 0x56d3, 0xd0c4, 0x0140, 0xd0a4, 0x0130,
-	0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xe29e, 0x001e, 0x002e,
-	0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff,
-	0x01e8, 0x080c, 0x6a53, 0x11d0, 0x2100, 0x080c, 0x262e, 0x81ff,
-	0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0xd384,
-	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116,
-	0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001,
-	0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x0066, 0x9036, 0x080c, 0xa872, 0x1110, 0x2031,
-	0x0001, 0x0066, 0x0036, 0x2019, 0x0029, 0x00d9, 0x003e, 0x006e,
-	0x86ff, 0x0110, 0x080c, 0xa88e, 0x006e, 0x9180, 0x1000, 0x2004,
-	0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1b32, 0x001e, 0x6112,
-	0x080c, 0x31e4, 0x001e, 0x080c, 0x65e2, 0x012e, 0x00ce, 0x001e,
-	0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0xa366, 0x080c, 0xe605,
-	0x002e, 0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x0005,
-	0x00c6, 0x00b6, 0x080c, 0x74d5, 0x1118, 0x20a9, 0x0800, 0x0010,
-	0x20a9, 0x0782, 0x080c, 0x74d5, 0x1110, 0x900e, 0x0010, 0x2009,
-	0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110,
-	0xb800, 0xd0bc, 0x090c, 0x65e2, 0x8108, 0x1f04, 0x3341, 0x2061,
-	0x1800, 0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082, 0x60b3,
-	0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004, 0xd0bc,
-	0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011,
-	0x1867, 0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef, 0x7de8, 0x7ce4,
-	0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5,
-	0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb,
-	0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba,
-	0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae,
-	0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5,
-	0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690,
-	0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a,
-	0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e,
-	0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965,
-	0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353,
-	0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49,
-	0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036,
-	0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c,
-	0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f,
-	0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08,
-	0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600,
-	0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000,
-	0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000,
-	0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600,
-	0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000,
-	0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00,
-	0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300,
-	0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00,
-	0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700,
-	0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300,
-	0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000,
+	0x00ff, 0x970e, 0x05d0, 0x908e, 0x0000, 0x05b8, 0x908e, 0x00ff,
+	0x1150, 0x7230, 0xd284, 0x15b0, 0x7294, 0xc28d, 0x7296, 0x70af,
+	0xffff, 0x003e, 0x04a0, 0x900e, 0x080c, 0x25fb, 0x080c, 0x65c4,
+	0x1538, 0x9006, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6,
+	0x2060, 0x080c, 0x8b90, 0x00ce, 0x090c, 0x8f34, 0xb8af, 0x0000,
+	0x080c, 0x6a6b, 0x1168, 0x7030, 0xd08c, 0x0130, 0xb800, 0xd0bc,
+	0x0138, 0x080c, 0x6914, 0x0120, 0x080c, 0x30e0, 0x0148, 0x0028,
+	0x080c, 0x3238, 0x080c, 0x310c, 0x0118, 0x8318, 0x0804, 0x2ffc,
+	0x73ae, 0x0010, 0x70af, 0xffff, 0x003e, 0x0804, 0x30c2, 0x9780,
+	0x3374, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70ac,
+	0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220,
+	0x2008, 0x9802, 0x20a8, 0x0020, 0x70af, 0xffff, 0x0804, 0x30c2,
+	0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x30b7, 0xc484, 0x080c,
+	0x6625, 0x0148, 0x080c, 0xcf52, 0x1904, 0x30b7, 0x080c, 0x65c4,
+	0x1904, 0x30bf, 0x0008, 0xc485, 0xb8bb, 0x0520, 0xb8ac, 0x9005,
+	0x0148, 0x00c6, 0x2060, 0x080c, 0x8b90, 0x00ce, 0x090c, 0x8f34,
+	0xb8af, 0x0000, 0x080c, 0x6a6b, 0x1130, 0x7030, 0xd08c, 0x01f8,
+	0xb800, 0xd0bc, 0x11e0, 0x7294, 0xd28c, 0x0180, 0x080c, 0x6a6b,
+	0x9082, 0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x65e9, 0x0028,
+	0x080c, 0x32d1, 0x01a0, 0x080c, 0x32fc, 0x0088, 0x080c, 0x3238,
+	0x080c, 0xcf52, 0x1160, 0x080c, 0x310c, 0x0188, 0x0040, 0x080c,
+	0xcf52, 0x1118, 0x080c, 0x32d1, 0x0110, 0x0451, 0x0140, 0x001e,
+	0x8108, 0x015e, 0x1f04, 0x3068, 0x70af, 0xffff, 0x0018, 0x001e,
+	0x015e, 0x71ae, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6,
+	0x0016, 0x70af, 0x0001, 0x2009, 0x007e, 0x080c, 0x65c4, 0x1168,
+	0xb813, 0x00ff, 0xb817, 0xfffe, 0x080c, 0x3238, 0x04a9, 0x0128,
+	0x70dc, 0xc0bd, 0x70de, 0x080c, 0xcc9f, 0x001e, 0x00ce, 0x0005,
+	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084,
+	0x00ff, 0xb842, 0x080c, 0xac5f, 0x01d0, 0x2b00, 0x6012, 0x080c,
+	0xcccc, 0x6023, 0x0001, 0x9006, 0x080c, 0x6561, 0x2001, 0x0000,
+	0x080c, 0x6575, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa,
+	0x012e, 0x2009, 0x0004, 0x080c, 0xac8c, 0x9085, 0x0001, 0x00ce,
+	0x00de, 0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
+	0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xac5f,
+	0x0548, 0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086,
+	0x007e, 0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110,
+	0x080c, 0x31e7, 0x080c, 0xcccc, 0x6023, 0x0001, 0x9006, 0x080c,
+	0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x0126, 0x2091, 0x8000,
+	0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0002, 0x080c, 0xac8c,
+	0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6,
+	0x00c6, 0x0026, 0x2009, 0x0080, 0x080c, 0x65c4, 0x1140, 0xb813,
+	0x00ff, 0xb817, 0xfffc, 0x0039, 0x0110, 0x70e3, 0xffff, 0x002e,
+	0x00ce, 0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c,
+	0xab97, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xcccc, 0x6023, 0x0001,
+	0x9006, 0x080c, 0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x0126,
+	0x2091, 0x8000, 0x70e4, 0x8000, 0x70e6, 0x012e, 0x2009, 0x0002,
+	0x080c, 0xac8c, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
+	0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f,
+	0x080c, 0x65c4, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8d7,
+	0x0004, 0x080c, 0xab97, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023,
+	0x0001, 0x620a, 0x080c, 0xcccc, 0x2009, 0x0022, 0x080c, 0xac8c,
+	0x9085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6,
+	0x0066, 0x0036, 0x0026, 0x00b6, 0x21f0, 0x9036, 0x080c, 0xa896,
+	0x1110, 0x2031, 0x0001, 0x0066, 0x080c, 0x93b0, 0x080c, 0x9326,
+	0x080c, 0xa7ec, 0x080c, 0xbb19, 0x006e, 0x86ff, 0x0110, 0x080c,
+	0xa8b2, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
+	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6625, 0x1140,
+	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x6043,
+	0x001e, 0x8108, 0x1f04, 0x31cc, 0x9686, 0x0001, 0x190c, 0x3337,
+	0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
+	0x00c6, 0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x9016, 0x080c,
+	0xa896, 0x1110, 0x2011, 0x0001, 0x0026, 0x6210, 0x2258, 0xbaa0,
+	0x0026, 0x2019, 0x0029, 0x080c, 0x93a5, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e, 0x001e, 0x002e,
+	0x82ff, 0x0110, 0x080c, 0xa8b2, 0xba10, 0xbb14, 0xbc84, 0x080c,
+	0x6043, 0xba12, 0xbb16, 0xbc86, 0x00be, 0x001e, 0x002e, 0x003e,
+	0x004e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010,
+	0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800,
+	0x70a8, 0x9005, 0x0110, 0x8001, 0x70aa, 0x000e, 0x00ee, 0x0005,
+	0x2071, 0x1800, 0x70e4, 0x9005, 0x0dc0, 0x8001, 0x70e6, 0x0ca8,
+	0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6,
+	0x0046, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c,
+	0xa896, 0x1110, 0x2011, 0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9,
+	0x0001, 0x0078, 0x080c, 0x56da, 0xd0c4, 0x0140, 0xd0a4, 0x0130,
+	0x9006, 0x2020, 0x2009, 0x002d, 0x080c, 0xe2c9, 0x20a9, 0x0800,
+	0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x32ab, 0x928e, 0x007f,
+	0x0904, 0x32ab, 0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c,
+	0x81ff, 0x05c8, 0x8fff, 0x1150, 0x2001, 0x198e, 0x0006, 0x2003,
+	0x0001, 0x080c, 0x32be, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6,
+	0x2158, 0x2001, 0x0001, 0x080c, 0x6a35, 0x00ce, 0x00be, 0x2019,
+	0x0029, 0x080c, 0x93a5, 0x0076, 0x2039, 0x0000, 0x080c, 0x9277,
+	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
+	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
+	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
+	0xdfeb, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x3261, 0x002e,
+	0x82ff, 0x0110, 0x080c, 0xa8b2, 0x015e, 0x001e, 0x002e, 0x003e,
+	0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026,
+	0x0016, 0x080c, 0x56da, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006,
+	0x2220, 0x2009, 0x0029, 0x080c, 0xe2c9, 0x001e, 0x002e, 0x004e,
+	0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff, 0x01e8,
+	0x080c, 0x6a63, 0x11d0, 0x2100, 0x080c, 0x262e, 0x81ff, 0x01b8,
+	0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0xd384, 0x0120,
+	0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138,
+	0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x0066, 0x9036, 0x080c, 0xa896, 0x1110, 0x2031, 0x0001,
+	0x0066, 0x0036, 0x2019, 0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff,
+	0x0110, 0x080c, 0xa8b2, 0x006e, 0x9180, 0x1000, 0x2004, 0x9065,
+	0x0158, 0x0016, 0x00c6, 0x2061, 0x1b32, 0x001e, 0x6112, 0x080c,
+	0x31e7, 0x001e, 0x080c, 0x65e9, 0x012e, 0x00ce, 0x001e, 0x0005,
+	0x0016, 0x0026, 0x2110, 0x080c, 0xa38a, 0x080c, 0xe630, 0x002e,
+	0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x0005, 0x00c6,
+	0x00b6, 0x080c, 0x74e9, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
+	0x0782, 0x080c, 0x74e9, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
+	0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800,
+	0xd0bc, 0x090c, 0x65e9, 0x8108, 0x1f04, 0x3348, 0x2061, 0x1800,
+	0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082, 0x60b3, 0x0000,
+	0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004, 0xd0bc, 0x0005,
+	0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011, 0x1867,
+	0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2,
+	0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4,
+	0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca,
+	0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9,
+	0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad,
+	0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3,
+	0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f,
+	0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079,
+	0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d,
+	0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863,
+	0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252,
+	0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047,
+	0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35,
+	0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b,
+	0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e,
+	0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004,
+	0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000,
+	0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00,
+	0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00,
+	0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500,
+	0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00,
+	0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000,
+	0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800,
+	0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200,
+	0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00,
+	0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000,
+	0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000,
+	0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x189e, 0x7003,
-	0x0002, 0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042,
-	0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001, 0x080c,
-	0x1053, 0x090c, 0x0d7d, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab,
-	0xdcb0, 0x080c, 0x1053, 0x090c, 0x0d7d, 0x2900, 0x706e, 0xa867,
-	0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004, 0x0002,
-	0x349c, 0x349d, 0x34b0, 0x34c4, 0x0005, 0x1004, 0x34ad, 0x0e04,
-	0x34ad, 0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005,
-	0x1128, 0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8,
-	0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e, 0x0100,
-	0x0128, 0x9086, 0x0200, 0x0904, 0x3598, 0x0005, 0x7018, 0x2048,
-	0x2061, 0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094,
-	0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005,
-	0x9086, 0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800,
-	0x701c, 0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210,
-	0x61d0, 0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x3595, 0x61d0,
-	0x0804, 0x352a, 0x356c, 0x35a4, 0x35ae, 0x35b2, 0x35bc, 0x35c2,
-	0x35c6, 0x35d6, 0x35d9, 0x35e3, 0x35e8, 0x35ed, 0x35f8, 0x3603,
-	0x3612, 0x3621, 0x362f, 0x3646, 0x3661, 0x3595, 0x370a, 0x3748,
-	0x37ed, 0x37fe, 0x3821, 0x3595, 0x3595, 0x3595, 0x3859, 0x3879,
-	0x3882, 0x38ae, 0x38b4, 0x3595, 0x38fa, 0x3595, 0x3595, 0x3595,
-	0x3595, 0x3595, 0x3905, 0x390e, 0x3916, 0x3918, 0x3595, 0x3595,
-	0x3595, 0x3595, 0x3595, 0x3595, 0x3948, 0x3595, 0x3595, 0x3595,
-	0x3595, 0x3595, 0x3965, 0x39c9, 0x3595, 0x3595, 0x3595, 0x3595,
-	0x3595, 0x3595, 0x0002, 0x39f3, 0x39f6, 0x3a55, 0x3a6e, 0x3a9e,
-	0x3d40, 0x3595, 0x52a4, 0x3595, 0x3595, 0x3595, 0x3595, 0x3595,
-	0x3595, 0x3595, 0x3595, 0x35e3, 0x35e8, 0x423f, 0x56f7, 0x425d,
-	0x5333, 0x5384, 0x5487, 0x3595, 0x54e9, 0x5525, 0x5556, 0x5662,
-	0x5583, 0x55e2, 0x3595, 0x4261, 0x4416, 0x442c, 0x4451, 0x44b6,
-	0x452a, 0x454a, 0x45c1, 0x461d, 0x4679, 0x467c, 0x46a1, 0x4711,
-	0x477b, 0x4783, 0x48b5, 0x4a2a, 0x4a5e, 0x4cc2, 0x3595, 0x4ce0,
-	0x4d8c, 0x4e6e, 0x4ec8, 0x3595, 0x4f7d, 0x3595, 0x4fe3, 0x4ffe,
-	0x4783, 0x5244, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x4adc,
-	0x0126, 0x2091, 0x8000, 0x0e04, 0x3576, 0x0010, 0x012e, 0x0cc0,
-	0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833,
-	0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x7007, 0x0001, 0x2091,
-	0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0,
-	0x2021, 0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005,
-	0x0868, 0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520,
-	0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x4ae9, 0x7883, 0x0004,
-	0x7884, 0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c,
-	0x7884, 0x7990, 0x0804, 0x4aec, 0x7984, 0x7888, 0x2114, 0x200a,
-	0x0804, 0x356c, 0x7984, 0x2114, 0x0804, 0x356c, 0x20e1, 0x0000,
-	0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f,
-	0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804, 0x356c, 0x7884, 0x2060,
-	0x04d8, 0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001a, 0x789b,
-	0x0137, 0x0804, 0x356c, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800,
-	0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040,
-	0x0210, 0x0804, 0x35a1, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x35a8,
-	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x35a1, 0x2138, 0x7d98,
-	0x7c9c, 0x0804, 0x35b6, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
-	0x35a1, 0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004,
-	0x0804, 0x356c, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200,
-	0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x356c, 0x0804,
-	0x359b, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x35a1, 0x21e0,
-	0x20a9, 0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x356c, 0x2069,
-	0x1847, 0x7884, 0x7990, 0x911a, 0x1a04, 0x35a1, 0x8019, 0x0904,
-	0x35a1, 0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006,
-	0x685a, 0x685e, 0x080c, 0x780a, 0x0804, 0x356c, 0x2069, 0x1847,
-	0x7884, 0x7994, 0x911a, 0x1a04, 0x35a1, 0x8019, 0x0904, 0x35a1,
-	0x684e, 0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a,
-	0x686e, 0x0126, 0x2091, 0x8000, 0x080c, 0x6ac5, 0x012e, 0x0804,
-	0x356c, 0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x359e, 0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001,
-	0x20a1, 0x18a6, 0x4101, 0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x359e, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60,
-	0x080c, 0x4ae9, 0x701f, 0x3685, 0x0005, 0xa864, 0x2008, 0x9084,
-	0x00ff, 0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096,
-	0x0015, 0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904,
-	0x359e, 0x810f, 0x918c, 0x00ff, 0x0904, 0x359e, 0x7112, 0x7010,
-	0x8001, 0x0560, 0x7012, 0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x359e, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000,
-	0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4ae9,
-	0x701f, 0x36c3, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002,
-	0x0120, 0x9096, 0x000a, 0x1904, 0x359e, 0x0888, 0x7014, 0x2048,
-	0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029,
-	0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x618f, 0x0150, 0x0126, 0x2091,
-	0x8000, 0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x64b8, 0x1128,
-	0x7007, 0x0003, 0x701f, 0x36ef, 0x0005, 0x080c, 0x6fb0, 0x0126,
-	0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6,
-	0x400a, 0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
-	0x0000, 0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60,
-	0x0804, 0x4aec, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010,
-	0x7883, 0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020,
-	0x2009, 0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100,
-	0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009,
-	0x04fd, 0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x0180, 0x2001, 0x1a22, 0x2004, 0x9005,
-	0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a,
-	0x2003, 0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427,
-	0x81ff, 0x1904, 0x359e, 0x7984, 0x080c, 0x661e, 0x1904, 0x35a1,
-	0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x35a1, 0x7c88,
-	0x7d8c, 0x080c, 0x6850, 0x080c, 0x67e1, 0x1518, 0x2061, 0x1ddc,
-	0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014,
-	0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150,
-	0x012e, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a04,
-	0x359e, 0x0c30, 0x080c, 0xc41f, 0x012e, 0x0904, 0x359e, 0x0804,
-	0x356c, 0x900e, 0x2001, 0x0005, 0x080c, 0x6fb0, 0x0126, 0x2091,
-	0x8000, 0x080c, 0xcb18, 0x080c, 0x6d70, 0x012e, 0x0804, 0x356c,
-	0x00a6, 0x2950, 0xb198, 0x080c, 0x661e, 0x1904, 0x37da, 0xb6a4,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c,
-	0x6850, 0x080c, 0x67fb, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091,
-	0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130,
-	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0,
-	0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0,
-	0x0c28, 0x080c, 0xc41f, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0,
-	0x900e, 0x2001, 0x0005, 0x080c, 0x6fb0, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xcb18, 0x080c, 0x6d64, 0x012e, 0x0070, 0xb097, 0x4005,
-	0xb19a, 0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d,
-	0x0001, 0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x359e,
-	0x080c, 0x4ab7, 0x0904, 0x35a1, 0x080c, 0x66e5, 0x0904, 0x359e,
-	0x080c, 0x6856, 0x0904, 0x359e, 0x0804, 0x4541, 0x81ff, 0x1904,
-	0x359e, 0x080c, 0x4ad3, 0x0904, 0x35a1, 0x080c, 0x68e4, 0x0904,
-	0x359e, 0x2019, 0x0005, 0x79a8, 0x080c, 0x6871, 0x0904, 0x359e,
-	0x7888, 0x908a, 0x1000, 0x1a04, 0x35a1, 0x8003, 0x800b, 0x810b,
-	0x9108, 0x080c, 0x861b, 0x7984, 0xd184, 0x1904, 0x356c, 0x0804,
-	0x4541, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001,
-	0x0450, 0x2029, 0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8, 0x2508,
-	0x080c, 0x661e, 0x11d8, 0x080c, 0x68e4, 0x1128, 0x2009, 0x0002,
-	0x62c0, 0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x6871,
-	0x1118, 0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270,
-	0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x861b, 0x8529, 0x1ae0,
-	0x012e, 0x0804, 0x356c, 0x012e, 0x0804, 0x359e, 0x012e, 0x0804,
-	0x35a1, 0x080c, 0x4ab7, 0x0904, 0x35a1, 0x080c, 0x66e5, 0x0904,
-	0x359e, 0x080c, 0xa872, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066,
-	0x080c, 0x9374, 0x0076, 0x903e, 0x080c, 0x9246, 0x900e, 0x080c,
-	0xdfc0, 0x007e, 0x00ce, 0x080c, 0xa88e, 0x080c, 0x6850, 0x0804,
-	0x356c, 0x080c, 0x4ab7, 0x0904, 0x35a1, 0x080c, 0x6850, 0x2208,
-	0x0804, 0x356c, 0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1910,
-	0x6810, 0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e,
-	0x2071, 0x19e7, 0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8,
-	0x2300, 0x9218, 0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x356c,
-	0x00f6, 0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff,
-	0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910,
-	0x6910, 0x62bc, 0x0804, 0x356c, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x359e, 0x0126, 0x2091, 0x8000, 0x080c, 0x56e7, 0x0128,
-	0x2009, 0x0007, 0x012e, 0x0804, 0x359e, 0x012e, 0x615c, 0x9190,
-	0x336d, 0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280,
-	0x67dc, 0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001,
-	0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003,
-	0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002,
-	0x0068, 0x080c, 0x74d5, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c,
-	0x0120, 0x2009, 0x0005, 0x0804, 0x359e, 0x9036, 0x7e9a, 0x7f9e,
-	0x0804, 0x356c, 0x614c, 0x6250, 0x2019, 0x1986, 0x231c, 0x2001,
-	0x1987, 0x2004, 0x789a, 0x0804, 0x356c, 0x0126, 0x2091, 0x8000,
-	0x6138, 0x623c, 0x6340, 0x012e, 0x0804, 0x356c, 0x080c, 0x4ad3,
-	0x0904, 0x35a1, 0xba44, 0xbb38, 0x0804, 0x356c, 0x080c, 0x0d7d,
-	0x080c, 0x4ad3, 0x2110, 0x0904, 0x35a1, 0xb804, 0x908c, 0x00ff,
-	0x918e, 0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009,
-	0x0009, 0x1904, 0x359e, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005,
-	0x00c6, 0x9066, 0x080c, 0xa872, 0x080c, 0xa366, 0x080c, 0x9374,
-	0x0076, 0x903e, 0x080c, 0x9246, 0x900e, 0x080c, 0xdfc0, 0x007e,
-	0x00ce, 0x080c, 0xa88e, 0xb807, 0x0407, 0x012e, 0x0804, 0x356c,
-	0x614c, 0x6250, 0x7884, 0x604e, 0x7b88, 0x6352, 0x2069, 0x1847,
-	0x831f, 0x9305, 0x6816, 0x788c, 0x2069, 0x1986, 0x2d1c, 0x206a,
-	0x7e98, 0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1987,
-	0x2d04, 0x266a, 0x789a, 0x0804, 0x356c, 0x0126, 0x2091, 0x8000,
-	0x6138, 0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0ecc, 0xd0c4,
-	0x01a8, 0x00d6, 0x78a8, 0x2009, 0x199d, 0x200a, 0x78ac, 0x2011,
-	0x199e, 0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118,
-	0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e,
-	0x2011, 0x0116, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040,
-	0x0010, 0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e,
-	0xd1e4, 0x190c, 0x0ee7, 0x9084, 0x0020, 0x0130, 0x78b4, 0x6046,
-	0x9084, 0x0001, 0x090c, 0x423f, 0x6040, 0xd0cc, 0x0120, 0x78b0,
-	0x2011, 0x0114, 0x2012, 0x012e, 0x0804, 0x356c, 0x00f6, 0x2079,
-	0x1800, 0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084,
-	0xfebf, 0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a,
-	0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe,
-	0x0005, 0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x35a1,
-	0x788c, 0x902d, 0x0904, 0x35a1, 0x900e, 0x080c, 0x661e, 0x1120,
-	0xba44, 0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108,
-	0x0ca0, 0x080c, 0x4ad3, 0x0904, 0x35a1, 0x7888, 0x900d, 0x0904,
-	0x35a1, 0x788c, 0x9005, 0x0904, 0x35a1, 0xba44, 0xb946, 0xbb38,
-	0xb83a, 0x0804, 0x356c, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05,
-	0x080c, 0x56e7, 0x1904, 0x359e, 0x00c6, 0x2061, 0x0100, 0x7984,
-	0x9186, 0x00ff, 0x1130, 0x2001, 0x1818, 0x2004, 0x9085, 0xff00,
-	0x0088, 0x9182, 0x007f, 0x16e0, 0x9188, 0x336d, 0x210d, 0x918c,
-	0x00ff, 0x2001, 0x1818, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580,
-	0x810f, 0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0xab73,
-	0x000e, 0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x65c3,
-	0x2b08, 0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4aa0,
-	0x01d0, 0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd,
-	0xa86a, 0x701f, 0x3a4e, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c,
-	0xac68, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x359e,
-	0x00ce, 0x0804, 0x35a1, 0x080c, 0xabc9, 0x0cb0, 0xa830, 0x9086,
-	0x0100, 0x0904, 0x359e, 0x0804, 0x356c, 0x2061, 0x1a6f, 0x0126,
-	0x2091, 0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061,
-	0x1800, 0x6354, 0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc, 0x78aa,
-	0x012e, 0x0804, 0x356c, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904,
-	0x359e, 0x080c, 0x74d5, 0x0904, 0x359e, 0x0126, 0x2091, 0x8000,
-	0x6254, 0x6074, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x2664,
-	0x080c, 0x5901, 0x012e, 0x0804, 0x356c, 0x012e, 0x0804, 0x35a1,
-	0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a9, 0x2070, 0x2061,
-	0x1847, 0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x9135,
-	0x7206, 0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x356e,
-	0x7884, 0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1,
-	0x0288, 0x012e, 0x0804, 0x35a1, 0x2001, 0x002a, 0x2004, 0x2069,
-	0x1847, 0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x35a1, 0x012e,
-	0x0804, 0x359e, 0x080c, 0xab33, 0x0dd0, 0x7884, 0xd0fc, 0x0904,
-	0x3b19, 0x00c6, 0x080c, 0x4aa0, 0x00ce, 0x0d88, 0xa867, 0x0000,
-	0x7884, 0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e,
-	0x2004, 0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030,
-	0x2004, 0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034,
-	0x2004, 0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a,
-	0x2004, 0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c,
-	0x3ca3, 0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18,
-	0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x080c, 0x4ae9, 0x701f, 0x3be0, 0x7023, 0x0001, 0x012e,
-	0x0005, 0x080c, 0xa872, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a88, 0x2001, 0x199f,
-	0x2003, 0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016,
-	0x60bb, 0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3d12,
-	0x080c, 0x3cd1, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e7,
-	0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140,
-	0x2001, 0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a,
-	0x00de, 0x2011, 0x0001, 0x080c, 0x4083, 0x008e, 0x00ee, 0x00fe,
-	0x080c, 0x3fb0, 0x080c, 0x3edd, 0x05b8, 0x2001, 0x020b, 0x2004,
-	0x9084, 0x0140, 0x1db8, 0x080c, 0x40f7, 0x00f6, 0x2079, 0x0300,
-	0x78bc, 0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037,
-	0x0000, 0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037,
-	0x0001, 0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037,
-	0x0000, 0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001,
-	0x1820, 0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024,
-	0x9084, 0x1e00, 0x00ce, 0x0138, 0x080c, 0x3ee7, 0x080c, 0x3ccc,
-	0x0058, 0x080c, 0x3ccc, 0x080c, 0x401b, 0x080c, 0x3fa6, 0x2001,
-	0x020b, 0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004,
-	0x2061, 0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d,
-	0x2013, 0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012,
-	0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1328,
-	0x2009, 0x0028, 0x080c, 0x21b0, 0x2001, 0x0227, 0x200c, 0x2102,
-	0x080c, 0xa88e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
-	0x009e, 0x008e, 0x004e, 0x2001, 0x199f, 0x2004, 0x9005, 0x1118,
-	0x012e, 0x0804, 0x356c, 0x012e, 0x2021, 0x400c, 0x0804, 0x356e,
-	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096,
-	0x00d6, 0x0156, 0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022,
-	0xa804, 0x9005, 0x0904, 0x3c3c, 0x2048, 0x1f04, 0x3bf0, 0x7068,
-	0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4,
-	0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048,
-	0xa864, 0x009e, 0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x4ae9,
-	0x701f, 0x3be0, 0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8,
-	0x20a0, 0x0006, 0x080c, 0x0fb7, 0x000e, 0x080c, 0x4aec, 0x701f,
-	0x3be0, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086,
-	0x0103, 0x1118, 0x701f, 0x3ca1, 0x0450, 0x7014, 0x2048, 0xa868,
-	0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c, 0x65bd, 0x0110, 0x9006,
-	0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c, 0xccf7, 0x015e,
-	0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e,
-	0x001e, 0x0904, 0x359e, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056,
-	0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x701f, 0x3c73, 0x7007,
-	0x0003, 0x0804, 0x3c31, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c,
-	0x0904, 0x356e, 0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x189e, 0x7003, 0x0002,
+	0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046,
+	0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001, 0x080c, 0x1053,
+	0x090c, 0x0d7d, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
+	0x080c, 0x1053, 0x090c, 0x0d7d, 0x2900, 0x706e, 0xa867, 0x0002,
+	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004, 0x0002, 0x34a3,
+	0x34a4, 0x34b7, 0x34cb, 0x0005, 0x1004, 0x34b4, 0x0e04, 0x34b4,
+	0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128,
+	0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079,
+	0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128,
+	0x9086, 0x0200, 0x0904, 0x359f, 0x0005, 0x7018, 0x2048, 0x2061,
+	0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff,
+	0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086,
+	0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c,
+	0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61d0,
+	0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x359c, 0x61d0, 0x0804,
+	0x3531, 0x3573, 0x35ab, 0x35b5, 0x35b9, 0x35c3, 0x35c9, 0x35cd,
+	0x35dd, 0x35e0, 0x35ea, 0x35ef, 0x35f4, 0x35ff, 0x360a, 0x3619,
+	0x3628, 0x3636, 0x364d, 0x3668, 0x359c, 0x3711, 0x374f, 0x37f4,
+	0x3805, 0x3828, 0x359c, 0x359c, 0x359c, 0x3860, 0x3880, 0x3889,
+	0x38b5, 0x38bb, 0x359c, 0x3901, 0x359c, 0x359c, 0x359c, 0x359c,
+	0x359c, 0x390c, 0x3915, 0x391d, 0x391f, 0x359c, 0x359c, 0x359c,
+	0x359c, 0x359c, 0x359c, 0x394f, 0x359c, 0x359c, 0x359c, 0x359c,
+	0x359c, 0x396c, 0x39d0, 0x359c, 0x359c, 0x359c, 0x359c, 0x359c,
+	0x359c, 0x0002, 0x39fa, 0x39fd, 0x3a5c, 0x3a75, 0x3aa5, 0x3d47,
+	0x359c, 0x52ab, 0x359c, 0x359c, 0x359c, 0x359c, 0x359c, 0x359c,
+	0x359c, 0x359c, 0x35ea, 0x35ef, 0x4246, 0x56fe, 0x4264, 0x533a,
+	0x538b, 0x548e, 0x359c, 0x54f0, 0x552c, 0x555d, 0x5669, 0x558a,
+	0x55e9, 0x359c, 0x4268, 0x441d, 0x4433, 0x4458, 0x44bd, 0x4531,
+	0x4551, 0x45c8, 0x4624, 0x4680, 0x4683, 0x46a8, 0x4718, 0x4782,
+	0x478a, 0x48bc, 0x4a31, 0x4a65, 0x4cc9, 0x359c, 0x4ce7, 0x4d93,
+	0x4e75, 0x4ecf, 0x359c, 0x4f84, 0x359c, 0x4fea, 0x5005, 0x478a,
+	0x524b, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x4ae3, 0x0126,
+	0x2091, 0x8000, 0x0e04, 0x357d, 0x0010, 0x012e, 0x0cc0, 0x7c36,
+	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
+	0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11d6, 0x7007, 0x0001, 0x2091, 0x5000,
+	0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021,
+	0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868,
+	0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88,
+	0x7a8c, 0x7884, 0x7990, 0x0804, 0x4af0, 0x7883, 0x0004, 0x7884,
+	0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
+	0x7990, 0x0804, 0x4af3, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804,
+	0x3573, 0x7984, 0x2114, 0x0804, 0x3573, 0x20e1, 0x0000, 0x2099,
+	0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003,
+	0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3573, 0x7884, 0x2060, 0x04d8,
+	0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001c, 0x789b, 0x0137,
+	0x0804, 0x3573, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039,
+	0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210,
+	0x0804, 0x35a8, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x35af, 0x79a0,
+	0x9182, 0x0040, 0x0210, 0x0804, 0x35a8, 0x2138, 0x7d98, 0x7c9c,
+	0x0804, 0x35bd, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x35a8,
+	0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804,
+	0x3573, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60,
+	0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3573, 0x0804, 0x35a2,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x35a8, 0x21e0, 0x20a9,
+	0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3573, 0x2069, 0x1847,
+	0x7884, 0x7990, 0x911a, 0x1a04, 0x35a8, 0x8019, 0x0904, 0x35a8,
+	0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a,
+	0x685e, 0x080c, 0x781e, 0x0804, 0x3573, 0x2069, 0x1847, 0x7884,
+	0x7994, 0x911a, 0x1a04, 0x35a8, 0x8019, 0x0904, 0x35a8, 0x684e,
+	0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6ad5, 0x012e, 0x0804, 0x3573,
+	0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5,
+	0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1,
+	0x18a6, 0x4101, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x35a5, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
+	0x4af0, 0x701f, 0x368c, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff,
+	0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015,
+	0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x35a5,
+	0x810f, 0x918c, 0x00ff, 0x0904, 0x35a5, 0x7112, 0x7010, 0x8001,
+	0x0560, 0x7012, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x35a5, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494,
+	0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
+	0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af0, 0x701f,
+	0x36ca, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120,
+	0x9096, 0x000a, 0x1904, 0x35a5, 0x0888, 0x7014, 0x2048, 0xa868,
+	0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160,
+	0xc2fd, 0xaa7a, 0x080c, 0x6196, 0x0150, 0x0126, 0x2091, 0x8000,
+	0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x64bf, 0x1128, 0x7007,
+	0x0003, 0x701f, 0x36f6, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091,
+	0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6, 0x400a,
+	0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
+	0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804,
+	0x4af3, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883,
+	0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009,
+	0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200,
+	0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd,
+	0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x0180, 0x2001, 0x1a22, 0x2004, 0x9005, 0x0128,
+	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
+	0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff,
+	0x1904, 0x35a5, 0x7984, 0x080c, 0x6625, 0x1904, 0x35a8, 0x7e98,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x35a8, 0x7c88, 0x7d8c,
+	0x080c, 0x6857, 0x080c, 0x67e8, 0x1518, 0x2061, 0x1ddc, 0x0126,
+	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
+	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e,
+	0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a04, 0x35a5,
+	0x0c30, 0x080c, 0xc443, 0x012e, 0x0904, 0x35a5, 0x0804, 0x3573,
+	0x900e, 0x2001, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xcb3c, 0x080c, 0x6d80, 0x012e, 0x0804, 0x3573, 0x00a6,
+	0x2950, 0xb198, 0x080c, 0x6625, 0x1904, 0x37e1, 0xb6a4, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x6857,
+	0x080c, 0x6802, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c,
+	0x2001, 0x181a, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28,
+	0x080c, 0xc443, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xcb3c, 0x080c, 0x6d74, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a,
+	0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001,
+	0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x35a5, 0x080c,
+	0x4abe, 0x0904, 0x35a8, 0x080c, 0x66ec, 0x0904, 0x35a5, 0x080c,
+	0x685d, 0x0904, 0x35a5, 0x0804, 0x4548, 0x81ff, 0x1904, 0x35a5,
+	0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x68eb, 0x0904, 0x35a5,
+	0x2019, 0x0005, 0x79a8, 0x080c, 0x6878, 0x0904, 0x35a5, 0x7888,
+	0x908a, 0x1000, 0x1a04, 0x35a8, 0x8003, 0x800b, 0x810b, 0x9108,
+	0x080c, 0x864c, 0x7984, 0xd184, 0x1904, 0x3573, 0x0804, 0x4548,
+	0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450,
+	0x2029, 0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c,
+	0x6625, 0x11d8, 0x080c, 0x68eb, 0x1128, 0x2009, 0x0002, 0x62c0,
+	0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x6878, 0x1118,
+	0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x080c, 0x864c, 0x8529, 0x1ae0, 0x012e,
+	0x0804, 0x3573, 0x012e, 0x0804, 0x35a5, 0x012e, 0x0804, 0x35a8,
+	0x080c, 0x4abe, 0x0904, 0x35a8, 0x080c, 0x66ec, 0x0904, 0x35a5,
+	0x080c, 0xa896, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x93a5, 0x0076, 0x903e, 0x080c, 0x9277, 0x900e, 0x080c, 0xdfeb,
+	0x007e, 0x00ce, 0x080c, 0xa8b2, 0x080c, 0x6857, 0x0804, 0x3573,
+	0x080c, 0x4abe, 0x0904, 0x35a8, 0x080c, 0x6857, 0x2208, 0x0804,
+	0x3573, 0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1910, 0x6810,
+	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071,
+	0x19e7, 0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300,
+	0x9218, 0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3573, 0x00f6,
+	0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110,
+	0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910, 0x6910,
+	0x62bc, 0x0804, 0x3573, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x35a5, 0x0126, 0x2091, 0x8000, 0x080c, 0x56ee, 0x0128, 0x2009,
+	0x0007, 0x012e, 0x0804, 0x35a5, 0x012e, 0x615c, 0x9190, 0x3374,
+	0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280, 0x67dc,
+	0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8,
+	0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8,
+	0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068,
+	0x080c, 0x74e9, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120,
+	0x2009, 0x0005, 0x0804, 0x35a5, 0x9036, 0x7e9a, 0x7f9e, 0x0804,
+	0x3573, 0x614c, 0x6250, 0x2019, 0x1986, 0x231c, 0x2001, 0x1987,
+	0x2004, 0x789a, 0x0804, 0x3573, 0x0126, 0x2091, 0x8000, 0x6138,
+	0x623c, 0x6340, 0x012e, 0x0804, 0x3573, 0x080c, 0x4ada, 0x0904,
+	0x35a8, 0xba44, 0xbb38, 0x0804, 0x3573, 0x080c, 0x0d7d, 0x080c,
+	0x4ada, 0x2110, 0x0904, 0x35a8, 0xb804, 0x908c, 0x00ff, 0x918e,
+	0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009,
+	0x1904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6,
+	0x9066, 0x080c, 0xa896, 0x080c, 0xa38a, 0x080c, 0x93a5, 0x0076,
+	0x903e, 0x080c, 0x9277, 0x900e, 0x080c, 0xdfeb, 0x007e, 0x00ce,
+	0x080c, 0xa8b2, 0xb807, 0x0407, 0x012e, 0x0804, 0x3573, 0x614c,
+	0x6250, 0x7884, 0x604e, 0x7b88, 0x6352, 0x2069, 0x1847, 0x831f,
+	0x9305, 0x6816, 0x788c, 0x2069, 0x1986, 0x2d1c, 0x206a, 0x7e98,
+	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1987, 0x2d04,
+	0x266a, 0x789a, 0x0804, 0x3573, 0x0126, 0x2091, 0x8000, 0x6138,
+	0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0ecc, 0xd0c4, 0x01a8,
+	0x00d6, 0x78a8, 0x2009, 0x199d, 0x200a, 0x78ac, 0x2011, 0x199e,
+	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
+	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011,
+	0x0116, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010,
+	0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4,
+	0x190c, 0x0ee7, 0x9084, 0x0020, 0x0130, 0x78b4, 0x6046, 0x9084,
+	0x0001, 0x090c, 0x4246, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011,
+	0x0114, 0x2012, 0x012e, 0x0804, 0x3573, 0x00f6, 0x2079, 0x1800,
+	0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf,
+	0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897,
+	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005,
+	0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x35a8, 0x788c,
+	0x902d, 0x0904, 0x35a8, 0x900e, 0x080c, 0x6625, 0x1120, 0xba44,
+	0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0,
+	0x080c, 0x4ada, 0x0904, 0x35a8, 0x7888, 0x900d, 0x0904, 0x35a8,
+	0x788c, 0x9005, 0x0904, 0x35a8, 0xba44, 0xb946, 0xbb38, 0xb83a,
+	0x0804, 0x3573, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c,
+	0x56ee, 0x1904, 0x35a5, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186,
+	0x00ff, 0x1130, 0x2001, 0x1818, 0x2004, 0x9085, 0xff00, 0x0088,
+	0x9182, 0x007f, 0x16e0, 0x9188, 0x3374, 0x210d, 0x918c, 0x00ff,
+	0x2001, 0x1818, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f,
+	0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0xab97, 0x000e,
+	0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x65ca, 0x2b08,
+	0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4aa7, 0x01d0,
+	0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x701f, 0x3a55, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0xac8c,
+	0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x35a5, 0x00ce,
+	0x0804, 0x35a8, 0x080c, 0xabed, 0x0cb0, 0xa830, 0x9086, 0x0100,
+	0x0904, 0x35a5, 0x0804, 0x3573, 0x2061, 0x1a6f, 0x0126, 0x2091,
+	0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800,
+	0x6354, 0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc, 0x78aa, 0x012e,
+	0x0804, 0x3573, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x35a5,
+	0x080c, 0x74e9, 0x0904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x6254,
+	0x6074, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x2664, 0x080c,
+	0x5908, 0x012e, 0x0804, 0x3573, 0x012e, 0x0804, 0x35a8, 0x0006,
+	0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a9, 0x2070, 0x2061, 0x1847,
+	0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x9166, 0x7206,
+	0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3575, 0x7884,
+	0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288,
+	0x012e, 0x0804, 0x35a8, 0x2001, 0x002a, 0x2004, 0x2069, 0x1847,
+	0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x35a8, 0x012e, 0x0804,
+	0x35a5, 0x080c, 0xab57, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3b20,
+	0x00c6, 0x080c, 0x4aa7, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884,
+	0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004,
+	0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004,
+	0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004,
+	0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004,
+	0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3caa,
+	0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930,
 	0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906,
 	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0fb7,
-	0x000e, 0x080c, 0x4aec, 0x007e, 0x701f, 0x3be0, 0x7023, 0x0001,
-	0x0005, 0x0804, 0x356c, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e,
-	0x0218, 0xa833, 0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168,
-	0x0016, 0x080c, 0x4aa0, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008,
-	0xa80a, 0x2100, 0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce,
-	0x015e, 0x0005, 0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086,
-	0x0044, 0x00fe, 0x000e, 0x0005, 0x2001, 0x199f, 0x2003, 0x0001,
-	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19aa,
-	0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004, 0x60ce,
-	0x6104, 0xc1ac, 0x6106, 0x080c, 0x4aa0, 0xa813, 0x0019, 0xa817,
-	0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001,
-	0x002f, 0x2004, 0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001,
-	0x19a9, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x21b0, 0x2001,
-	0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000,
-	0x601f, 0x0000, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee,
-	0x00fe, 0x0005, 0x00e6, 0x080c, 0x4aa0, 0x2940, 0xa013, 0x0019,
-	0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866,
-	0x2001, 0x0031, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0xa86e, 0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004,
-	0x2001, 0x0300, 0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000,
-	0x2001, 0x0004, 0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x81ff, 0x0148, 0x080c, 0x29e8, 0x1130,
-	0x9006, 0x080c, 0x2945, 0x9006, 0x080c, 0x2928, 0x7884, 0x9084,
-	0x0007, 0x0002, 0x3d5d, 0x3d66, 0x3d6f, 0x3d5a, 0x3d5a, 0x3d5a,
-	0x3d5a, 0x3d5a, 0x012e, 0x0804, 0x35a1, 0x2009, 0x0114, 0x2104,
-	0x9085, 0x0800, 0x200a, 0x080c, 0x3f31, 0x00c0, 0x2009, 0x0114,
-	0x2104, 0x9085, 0x4000, 0x200a, 0x080c, 0x3f31, 0x0078, 0x080c,
-	0x74d5, 0x1128, 0x012e, 0x2009, 0x0016, 0x0804, 0x359e, 0x81ff,
-	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x356e, 0x080c, 0xa872,
-	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x080c, 0x3a88, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc,
-	0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x41d2, 0x080c, 0x4122,
-	0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e7,
-	0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
-	0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
-	0x4083, 0x080c, 0x29f0, 0x080c, 0x29f0, 0x080c, 0x29f0, 0x080c,
-	0x29f0, 0x080c, 0x4083, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3fb0,
-	0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c, 0x3ee7, 0x2001, 0x0004,
-	0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c,
-	0x359e, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10,
-	0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001,
-	0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3f8e, 0x2d00, 0x9c05,
-	0x9b05, 0x0120, 0x080c, 0x3ee7, 0x0804, 0x3e90, 0x080c, 0x40f7,
-	0x080c, 0x401b, 0x080c, 0x3f71, 0x080c, 0x3fa6, 0x00f6, 0x2079,
-	0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3ee7, 0x00fe,
-	0x0804, 0x3e90, 0x00fe, 0x080c, 0x3edd, 0x1150, 0x8d68, 0x2001,
-	0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3ee7, 0x0080,
-	0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739,
-	0x0038, 0x2001, 0x1a6b, 0x2004, 0x9086, 0x0000, 0x1904, 0x3de0,
-	0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500,
-	0x9605, 0x0904, 0x3e90, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05,
-	0x9b05, 0x1904, 0x3e90, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003,
-	0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a6b, 0x2003, 0x0003,
-	0x2001, 0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4,
-	0x9005, 0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c,
-	0x21b0, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180,
-	0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b,
-	0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3e67, 0x00ce, 0x0030,
-	0xa817, 0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6,
-	0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004,
-	0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3d9a,
-	0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
-	0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001,
-	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1328, 0x7884,
-	0x9084, 0x0003, 0x9086, 0x0002, 0x01b0, 0x2009, 0x0028, 0x080c,
-	0x21b0, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff,
-	0x080c, 0x2aab, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043,
-	0x0090, 0x6043, 0x0010, 0x080c, 0xa88e, 0x00ce, 0x2d08, 0x2c10,
-	0x2b18, 0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x356c,
-	0x012e, 0x2021, 0x400c, 0x0804, 0x356e, 0x9085, 0x0001, 0x1d04,
-	0x3ee6, 0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001,
-	0x0105, 0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001,
-	0x1a6b, 0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x21b0,
-	0x2001, 0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000,
-	0x9026, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x19e7, 0x7054, 0x9086,
-	0x0000, 0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009,
-	0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x21b0,
-	0x782c, 0xd0fc, 0x0d88, 0x080c, 0x40f7, 0x7054, 0x9086, 0x0000,
-	0x1d58, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040,
-	0x080c, 0x21b0, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe,
-	0x0005, 0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932,
-	0x7936, 0x080c, 0x2644, 0x080c, 0x2a67, 0x080c, 0x2aab, 0x784b,
-	0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852,
-	0x2019, 0x61a8, 0x7820, 0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850,
-	0xc0e4, 0x7852, 0x2011, 0x0048, 0x080c, 0x2a44, 0x7843, 0x0040,
-	0x2019, 0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100,
-	0x080c, 0x2a0a, 0x2011, 0x0020, 0x080c, 0x2a44, 0x7843, 0x0000,
-	0x9006, 0x080c, 0x2a0a, 0x2011, 0x0048, 0x080c, 0x2a44, 0x00fe,
-	0x0005, 0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a6b,
-	0x2079, 0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000,
-	0x9086, 0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003,
-	0x0003, 0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079,
-	0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032,
-	0x260a, 0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac,
-	0x0108, 0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079,
-	0x0200, 0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005,
-	0x00e6, 0x2071, 0x0100, 0x2001, 0x19aa, 0x2004, 0x70e2, 0x080c,
-	0x3cc2, 0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c,
-	0x918c, 0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162,
-	0x7073, 0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009,
-	0x1818, 0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b,
-	0x0000, 0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100,
-	0x707a, 0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a,
-	0x708e, 0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014,
-	0x9084, 0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x40f7, 0x00f6,
-	0x2071, 0x1a6b, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884,
-	0xd0b4, 0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009,
-	0x03e8, 0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004,
-	0x2011, 0x0011, 0x080c, 0x4083, 0x2011, 0x0001, 0x080c, 0x4083,
-	0x00fe, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a6b, 0x2079,
-	0x0320, 0x792c, 0xd1fc, 0x0904, 0x4080, 0x782b, 0x0002, 0x9026,
-	0xd19c, 0x1904, 0x407c, 0x7000, 0x0002, 0x4080, 0x4031, 0x4061,
-	0x407c, 0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011,
-	0x0001, 0x080c, 0x4083, 0x0904, 0x4080, 0x080c, 0x4083, 0x0804,
-	0x4080, 0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810,
-	0x7914, 0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c,
-	0x81ff, 0x0de8, 0x080c, 0x3f8e, 0x2009, 0x0001, 0x00f6, 0x2079,
-	0x0300, 0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a,
-	0x00f8, 0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc,
-	0x1904, 0x4025, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092,
-	0x0004, 0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031,
-	0xa212, 0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000,
-	0x00ee, 0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036,
-	0x0096, 0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a,
-	0x831c, 0x831c, 0x938a, 0x0007, 0x1a0c, 0x0d7d, 0x9398, 0x40b1,
-	0x231d, 0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102,
-	0x009e, 0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048,
-	0xa804, 0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001,
-	0x0005, 0x40ee, 0x40e5, 0x40dc, 0x40d3, 0x40ca, 0x40c1, 0x40b8,
-	0xa964, 0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916,
-	0x0005, 0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980,
-	0x7916, 0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912,
-	0xa990, 0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c,
-	0x7912, 0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906,
-	0xa9ac, 0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8,
-	0x7906, 0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902,
-	0xa9c8, 0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6,
-	0x00e6, 0x0086, 0x2071, 0x19e7, 0x2079, 0x0090, 0x792c, 0xd1fc,
-	0x01e8, 0x782b, 0x0002, 0x2940, 0x9026, 0x7054, 0x0002, 0x411e,
-	0x410a, 0x4115, 0x8001, 0x7056, 0xd19c, 0x1180, 0x2011, 0x0001,
-	0x080c, 0x4083, 0x190c, 0x4083, 0x0048, 0x8001, 0x7056, 0x782c,
-	0xd0fc, 0x1d38, 0x2011, 0x0001, 0x080c, 0x4083, 0x008e, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200,
-	0x2001, 0x19aa, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9,
-	0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004,
-	0x9005, 0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f,
-	0x201c, 0x080c, 0x4aa0, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a,
-	0x978a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708,
-	0x903e, 0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e,
-	0x080c, 0x419a, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa0,
-	0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e,
-	0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872,
-	0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036,
-	0x2009, 0x0040, 0x080c, 0x21b0, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6,
-	0x000e, 0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee,
-	0x00fe, 0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0,
-	0x20e1, 0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306,
-	0x9006, 0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112,
-	0x702b, 0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b,
-	0x0040, 0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096,
-	0x2940, 0x0086, 0x080c, 0x4aa0, 0x008e, 0xa058, 0x00a6, 0x2050,
-	0x2900, 0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001,
-	0x00ee, 0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528,
-	0x2038, 0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c,
-	0x4aa0, 0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
-	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e,
-	0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c,
-	0x419a, 0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa0, 0x2940,
-	0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030,
-	0x2004, 0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001,
-	0x0101, 0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001,
-	0x1a6b, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001,
+	0x080c, 0x4af0, 0x701f, 0x3be7, 0x7023, 0x0001, 0x012e, 0x0005,
+	0x080c, 0xa896, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a8f, 0x2001, 0x199f, 0x2003,
+	0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb,
+	0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3d19, 0x080c,
+	0x3cd8, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e7, 0x2079,
+	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001,
+	0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de,
+	0x2011, 0x0001, 0x080c, 0x408a, 0x008e, 0x00ee, 0x00fe, 0x080c,
+	0x3fb7, 0x080c, 0x3ee4, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084,
+	0x0140, 0x1db8, 0x080c, 0x40fe, 0x00f6, 0x2079, 0x0300, 0x78bc,
+	0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000,
+	0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001,
+	0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000,
+	0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x1820,
+	0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084,
+	0x1e00, 0x00ce, 0x0138, 0x080c, 0x3eee, 0x080c, 0x3cd3, 0x0058,
+	0x080c, 0x3cd3, 0x080c, 0x4022, 0x080c, 0x3fad, 0x2001, 0x020b,
+	0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061,
+	0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013,
+	0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001,
+	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1328, 0x2009,
+	0x0028, 0x080c, 0x21b0, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c,
+	0xa8b2, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x008e, 0x004e, 0x2001, 0x199f, 0x2004, 0x9005, 0x1118, 0x012e,
+	0x0804, 0x3573, 0x012e, 0x2021, 0x400c, 0x0804, 0x3575, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
+	0x0156, 0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804,
+	0x9005, 0x0904, 0x3c43, 0x2048, 0x1f04, 0x3bf7, 0x7068, 0x2040,
+	0xa28c, 0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120,
+	0x2029, 0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864,
+	0x009e, 0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x4af0, 0x701f,
+	0x3be7, 0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0,
+	0x0006, 0x080c, 0x0fb7, 0x000e, 0x080c, 0x4af3, 0x701f, 0x3be7,
+	0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103,
+	0x1118, 0x701f, 0x3ca8, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd,
+	0xa86a, 0x2009, 0x007f, 0x080c, 0x65c4, 0x0110, 0x9006, 0x0030,
+	0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c, 0xcd1b, 0x015e, 0x00de,
+	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0904, 0x35a5, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
+	0x0086, 0x0096, 0x00d6, 0x0156, 0x701f, 0x3c7a, 0x7007, 0x0003,
+	0x0804, 0x3c38, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904,
+	0x3575, 0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808,
+	0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8,
+	0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0fb7, 0x000e,
+	0x080c, 0x4af3, 0x007e, 0x701f, 0x3be7, 0x7023, 0x0001, 0x0005,
+	0x0804, 0x3573, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218,
+	0xa833, 0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016,
+	0x080c, 0x4aa7, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a,
+	0x2100, 0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e,
+	0x0005, 0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044,
+	0x00fe, 0x000e, 0x0005, 0x2001, 0x199f, 0x2003, 0x0001, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19aa, 0x2004,
+	0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004, 0x60ce, 0x6104,
+	0xc1ac, 0x6106, 0x080c, 0x4aa7, 0xa813, 0x0019, 0xa817, 0x0001,
+	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
+	0x2004, 0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a9,
+	0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x21b0, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f,
+	0x0000, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x00e6, 0x080c, 0x4aa7, 0x2940, 0xa013, 0x0019, 0xa017,
+	0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001,
+	0x0031, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa86e, 0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001,
 	0x0300, 0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001,
 	0x0004, 0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001,
-	0x9006, 0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000,
-	0x9006, 0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086,
-	0x0052, 0x0108, 0x0005, 0x0804, 0x356c, 0x7d98, 0x7c9c, 0x0804,
-	0x3663, 0x080c, 0x74d5, 0x190c, 0x5fe7, 0x6040, 0x9084, 0x0020,
-	0x09b1, 0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x4ae9, 0x701f, 0x4279,
-	0x0005, 0x080c, 0x56e2, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095,
-	0x20d8, 0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x35a1,
-	0x6804, 0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x35a1, 0xd094, 0x00c6,
-	0x2061, 0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218,
-	0x918c, 0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c,
-	0x00c6, 0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010,
-	0x918c, 0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a,
-	0x007f, 0x1a04, 0x35a1, 0x9288, 0x336d, 0x210d, 0x918c, 0x00ff,
-	0x6166, 0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x35a1,
-	0x605e, 0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004,
-	0x0006, 0x2009, 0x19b1, 0x9080, 0x2737, 0x2005, 0x200a, 0x2008,
-	0x2001, 0x0018, 0x080c, 0xa863, 0x2009, 0x0390, 0x200b, 0x0400,
-	0x000e, 0x2009, 0x19b2, 0x9080, 0x273b, 0x2005, 0x200a, 0x6808,
-	0x908a, 0x0100, 0x0a04, 0x35a1, 0x908a, 0x0841, 0x1a04, 0x35a1,
-	0x9084, 0x0007, 0x1904, 0x35a1, 0x680c, 0x9005, 0x0904, 0x35a1,
-	0x6810, 0x9005, 0x0904, 0x35a1, 0x6848, 0x6940, 0x910a, 0x1a04,
-	0x35a1, 0x8001, 0x0904, 0x35a1, 0x684c, 0x6944, 0x910a, 0x1a04,
-	0x35a1, 0x8001, 0x0904, 0x35a1, 0x6814, 0x908c, 0x00ff, 0x614e,
-	0x8007, 0x9084, 0x00ff, 0x6052, 0x080c, 0x780a, 0x080c, 0x6a91,
-	0x080c, 0x6ac5, 0x6808, 0x602a, 0x080c, 0x2122, 0x2009, 0x0170,
-	0x200b, 0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08,
-	0x080c, 0x269e, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x4404,
-	0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f,
-	0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830,
-	0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010,
-	0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f,
-	0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b3, 0x20e9, 0x0001,
-	0x4001, 0x20a9, 0x0004, 0x20a1, 0x19cd, 0x20e9, 0x0001, 0x4001,
-	0x080c, 0x87a0, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384,
-	0x01c8, 0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7dcb,
-	0x6878, 0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a,
-	0x9184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010,
-	0x6003, 0x0001, 0x1f04, 0x4362, 0x00ce, 0x00c6, 0x2061, 0x199c,
-	0x6a88, 0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063,
-	0x0000, 0x2001, 0x0001, 0x080c, 0x2945, 0x2001, 0x0001, 0x080c,
-	0x2928, 0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006,
-	0x080c, 0x2945, 0x9006, 0x080c, 0x2928, 0x0028, 0x9286, 0x8000,
-	0x1d30, 0x2063, 0x0002, 0x00ce, 0x00e6, 0x2c70, 0x080c, 0x0eb4,
-	0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085,
-	0x0180, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128,
-	0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x197c, 0x6a80,
-	0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118,
-	0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x2713, 0x2001,
-	0x196d, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f,
-	0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x74d5, 0x0128, 0x080c,
-	0x4fd7, 0x0110, 0x080c, 0x2664, 0x60d4, 0x9005, 0x01c0, 0x6003,
-	0x0001, 0x2009, 0x43ec, 0x00e0, 0x080c, 0x74d5, 0x1168, 0x2011,
-	0x734b, 0x080c, 0x860d, 0x2011, 0x733e, 0x080c, 0x8719, 0x080c,
-	0x77de, 0x080c, 0x7406, 0x0040, 0x080c, 0x5edd, 0x0028, 0x6003,
-	0x0004, 0x2009, 0x4404, 0x0020, 0x080c, 0x69c6, 0x0804, 0x356c,
-	0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118,
-	0x2091, 0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086,
-	0x0000, 0x0904, 0x359e, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894,
-	0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x2039, 0x0001, 0x0804, 0x4aec, 0x9006, 0x080c, 0x2664, 0x81ff,
-	0x1904, 0x359e, 0x080c, 0x74d5, 0x11b0, 0x080c, 0x77d9, 0x080c,
-	0x6022, 0x080c, 0x3361, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c,
-	0xcf2e, 0x0130, 0x080c, 0x74f8, 0x1118, 0x080c, 0x74a9, 0x0038,
-	0x080c, 0x7406, 0x0020, 0x080c, 0x5fe7, 0x080c, 0x5edd, 0x0804,
-	0x356c, 0x81ff, 0x1904, 0x359e, 0x080c, 0x74d5, 0x1110, 0x0804,
-	0x359e, 0x6194, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80,
-	0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091,
-	0x8000, 0x2039, 0x0001, 0x080c, 0x4aec, 0x701f, 0x356a, 0x012e,
-	0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040,
-	0x20e9, 0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x655c,
-	0x9588, 0x336d, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011,
-	0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x661e, 0x1190, 0xb814,
-	0x821c, 0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a,
-	0x0038, 0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a,
-	0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
-	0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80,
-	0x2099, 0x1d80, 0x080c, 0x5f72, 0x0804, 0x445e, 0x080c, 0x4ad3,
-	0x0904, 0x35a1, 0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x359e, 0x080c, 0x56d3, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e,
-	0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c,
-	0x335c, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xc9e3, 0x1120, 0x2009, 0x0003, 0x0804, 0x359e, 0x7007,
-	0x0003, 0x701f, 0x44ec, 0x0005, 0x080c, 0x4ad3, 0x0904, 0x35a1,
-	0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
-	0x0006, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0fb7, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a,
-	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c,
-	0x0fb7, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x0804, 0x4aec, 0x81ff, 0x1904, 0x359e, 0x080c, 0x4ab7, 0x0904,
-	0x35a1, 0x080c, 0x685f, 0x0904, 0x359e, 0x0058, 0xa878, 0x9005,
-	0x0120, 0x2009, 0x0004, 0x0804, 0x359e, 0xa974, 0xaa94, 0x0804,
-	0x356c, 0x080c, 0x56db, 0x0904, 0x356c, 0x701f, 0x4536, 0x7007,
-	0x0003, 0x0005, 0x81ff, 0x1904, 0x359e, 0x7888, 0x908a, 0x1000,
-	0x1a04, 0x35a1, 0x080c, 0x4ad3, 0x0904, 0x35a1, 0x080c, 0x6a5b,
-	0x0120, 0x080c, 0x6a63, 0x1904, 0x35a1, 0x080c, 0x68e4, 0x0904,
-	0x359e, 0x2019, 0x0004, 0x900e, 0x080c, 0x6871, 0x0904, 0x359e,
-	0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8,
-	0x080c, 0x4ad1, 0x01e0, 0x080c, 0x6a5b, 0x0118, 0x080c, 0x6a63,
-	0x11b0, 0x080c, 0x68e4, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002,
-	0x2019, 0x0004, 0x080c, 0x6871, 0x2009, 0x0003, 0x0120, 0xa998,
-	0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x080c, 0x56db, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071,
-	0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506,
-	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x661e,
-	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x861b,
-	0x0005, 0x81ff, 0x1904, 0x359e, 0x798c, 0x2001, 0x1980, 0x918c,
-	0x8000, 0x2102, 0x080c, 0x4ab7, 0x0904, 0x35a1, 0x080c, 0x6a5b,
-	0x0120, 0x080c, 0x6a63, 0x1904, 0x35a1, 0x080c, 0x66e5, 0x0904,
-	0x359e, 0x080c, 0x6868, 0x0904, 0x359e, 0x2001, 0x1980, 0x2004,
-	0xd0fc, 0x1904, 0x356c, 0x0804, 0x4541, 0xa9a0, 0x2001, 0x1980,
-	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4ac4, 0x01a0, 0x080c,
-	0x6a5b, 0x0118, 0x080c, 0x6a63, 0x1170, 0x080c, 0x66e5, 0x2009,
-	0x0002, 0x0128, 0x080c, 0x6868, 0x1170, 0x2009, 0x0003, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1980, 0x2004,
-	0xd0fc, 0x1128, 0x080c, 0x56db, 0x0110, 0x9006, 0x0018, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x359e,
-	0x798c, 0x2001, 0x197f, 0x918c, 0x8000, 0x2102, 0x080c, 0x4ab7,
-	0x0904, 0x35a1, 0x080c, 0x6a5b, 0x0120, 0x080c, 0x6a63, 0x1904,
-	0x35a1, 0x080c, 0x66e5, 0x0904, 0x359e, 0x080c, 0x6856, 0x0904,
-	0x359e, 0x2001, 0x197f, 0x2004, 0xd0fc, 0x1904, 0x356c, 0x0804,
-	0x4541, 0xa9a0, 0x2001, 0x197f, 0x918c, 0x8000, 0xc18d, 0x2102,
-	0x080c, 0x4ac4, 0x01a0, 0x080c, 0x6a5b, 0x0118, 0x080c, 0x6a63,
-	0x1170, 0x080c, 0x66e5, 0x2009, 0x0002, 0x0128, 0x080c, 0x6856,
-	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x2001, 0x197f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56db,
-	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
-	0x0005, 0x6100, 0x0804, 0x356c, 0x080c, 0x4ad3, 0x0904, 0x35a1,
-	0x080c, 0x56e7, 0x1904, 0x359e, 0x79a8, 0xd184, 0x1158, 0xb834,
-	0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28,
-	0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a,
-	0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804,
-	0x356c, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003,
-	0x1a04, 0x359e, 0x625c, 0x7884, 0x9206, 0x1548, 0x080c, 0x878a,
-	0x2001, 0xfff4, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x2039, 0x0000, 0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e,
-	0x0804, 0x4aec, 0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44,
-	0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
-	0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x46f7, 0x0005, 0x81ff,
-	0x1904, 0x359e, 0x080c, 0x4ad3, 0x0904, 0x35a1, 0x080c, 0x6a5b,
-	0x1904, 0x359e, 0x00c6, 0x080c, 0x4aa0, 0x00ce, 0x0904, 0x359e,
-	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xc989,
-	0x0904, 0x359e, 0x7007, 0x0003, 0x701f, 0x46fb, 0x0005, 0x080c,
-	0x423f, 0x0804, 0x356c, 0xa830, 0x9086, 0x0100, 0x0904, 0x359e,
+	0x2091, 0x8000, 0x81ff, 0x0148, 0x080c, 0x29e8, 0x1130, 0x9006,
+	0x080c, 0x2945, 0x9006, 0x080c, 0x2928, 0x7884, 0x9084, 0x0007,
+	0x0002, 0x3d64, 0x3d6d, 0x3d76, 0x3d61, 0x3d61, 0x3d61, 0x3d61,
+	0x3d61, 0x012e, 0x0804, 0x35a8, 0x2009, 0x0114, 0x2104, 0x9085,
+	0x0800, 0x200a, 0x080c, 0x3f38, 0x00c0, 0x2009, 0x0114, 0x2104,
+	0x9085, 0x4000, 0x200a, 0x080c, 0x3f38, 0x0078, 0x080c, 0x74e9,
+	0x1128, 0x012e, 0x2009, 0x0016, 0x0804, 0x35a5, 0x81ff, 0x0128,
+	0x012e, 0x2021, 0x400b, 0x0804, 0x3575, 0x080c, 0xa896, 0x0086,
+	0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c,
+	0x3a8f, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006,
+	0x2068, 0x2060, 0x2058, 0x080c, 0x41d9, 0x080c, 0x4129, 0x903e,
+	0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e7, 0x2079,
+	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4,
+	0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x408a,
+	0x080c, 0x29f0, 0x080c, 0x29f0, 0x080c, 0x29f0, 0x080c, 0x29f0,
+	0x080c, 0x408a, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3fb7, 0x2009,
+	0x9c40, 0x8109, 0x11b0, 0x080c, 0x3eee, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x35a5,
+	0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6,
+	0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201,
+	0x200c, 0x81ff, 0x0150, 0x080c, 0x3f95, 0x2d00, 0x9c05, 0x9b05,
+	0x0120, 0x080c, 0x3eee, 0x0804, 0x3e97, 0x080c, 0x40fe, 0x080c,
+	0x4022, 0x080c, 0x3f78, 0x080c, 0x3fad, 0x00f6, 0x2079, 0x0100,
+	0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3eee, 0x00fe, 0x0804,
+	0x3e97, 0x00fe, 0x080c, 0x3ee4, 0x1150, 0x8d68, 0x2001, 0x0032,
+	0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3eee, 0x0080, 0x87ff,
+	0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038,
+	0x2001, 0x1a6b, 0x2004, 0x9086, 0x0000, 0x1904, 0x3de7, 0x2001,
+	0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605,
+	0x0904, 0x3e97, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05,
+	0x1904, 0x3e97, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a6b, 0x2003, 0x0003, 0x2001,
+	0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005,
+	0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x21b0,
+	0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817,
+	0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008,
+	0x2001, 0x0203, 0x2004, 0x1f04, 0x3e6e, 0x00ce, 0x0030, 0xa817,
+	0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079,
+	0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e,
+	0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3da1, 0x001e,
+	0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027,
+	0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1328, 0x7884, 0x9084,
+	0x0003, 0x9086, 0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x21b0,
+	0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c,
+	0x2aab, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090,
+	0x6043, 0x0010, 0x080c, 0xa8b2, 0x00ce, 0x2d08, 0x2c10, 0x2b18,
+	0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3573, 0x012e,
+	0x2021, 0x400c, 0x0804, 0x3575, 0x9085, 0x0001, 0x1d04, 0x3eed,
+	0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105,
+	0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a6b,
+	0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x21b0, 0x2001,
+	0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026,
+	0x0005, 0x00f6, 0x00e6, 0x2071, 0x19e7, 0x7054, 0x9086, 0x0000,
+	0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x21b0, 0x782c,
+	0xd0fc, 0x0d88, 0x080c, 0x40fe, 0x7054, 0x9086, 0x0000, 0x1d58,
+	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
+	0x21b0, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932, 0x7936,
+	0x080c, 0x2644, 0x080c, 0x2a67, 0x080c, 0x2aab, 0x784b, 0xf7f7,
+	0x7843, 0x0090, 0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019,
+	0x61a8, 0x7820, 0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4,
+	0x7852, 0x2011, 0x0048, 0x080c, 0x2a44, 0x7843, 0x0040, 0x2019,
+	0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c,
+	0x2a0a, 0x2011, 0x0020, 0x080c, 0x2a44, 0x7843, 0x0000, 0x9006,
+	0x080c, 0x2a0a, 0x2011, 0x0048, 0x080c, 0x2a44, 0x00fe, 0x0005,
+	0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a6b, 0x2079,
+	0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086,
+	0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003,
+	0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300,
+	0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a,
+	0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108,
+	0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6,
+	0x2071, 0x0100, 0x2001, 0x19aa, 0x2004, 0x70e2, 0x080c, 0x3cc9,
+	0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c, 0x918c,
+	0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073,
+	0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1818,
+	0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000,
+	0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a,
+	0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e,
+	0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084,
+	0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x40fe, 0x00f6, 0x2071,
+	0x1a6b, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
+	0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8,
+	0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011,
+	0x0011, 0x080c, 0x408a, 0x2011, 0x0001, 0x080c, 0x408a, 0x00fe,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a6b, 0x2079, 0x0320,
+	0x792c, 0xd1fc, 0x0904, 0x4087, 0x782b, 0x0002, 0x9026, 0xd19c,
+	0x1904, 0x4083, 0x7000, 0x0002, 0x4087, 0x4038, 0x4068, 0x4083,
+	0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001,
+	0x080c, 0x408a, 0x0904, 0x4087, 0x080c, 0x408a, 0x0804, 0x4087,
+	0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914,
+	0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff,
+	0x0de8, 0x080c, 0x3f95, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300,
+	0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8,
+	0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904,
+	0x402c, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004,
+	0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212,
+	0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee,
+	0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096,
+	0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c,
+	0x831c, 0x938a, 0x0007, 0x1a0c, 0x0d7d, 0x9398, 0x40b8, 0x231d,
+	0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e,
+	0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804,
+	0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005,
+	0x40f5, 0x40ec, 0x40e3, 0x40da, 0x40d1, 0x40c8, 0x40bf, 0xa964,
+	0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005,
+	0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916,
+	0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990,
+	0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912,
+	0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac,
+	0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906,
+	0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8,
+	0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6,
+	0x0086, 0x2071, 0x19e7, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8,
+	0x782b, 0x0002, 0x2940, 0x9026, 0x7054, 0x0002, 0x4125, 0x4111,
+	0x411c, 0x8001, 0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c,
+	0x408a, 0x190c, 0x408a, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc,
+	0x1d38, 0x2011, 0x0001, 0x080c, 0x408a, 0x008e, 0x00ee, 0x00fe,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001,
+	0x19aa, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004,
+	0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005,
+	0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c,
+	0x080c, 0x4aa7, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
+	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e,
+	0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c,
+	0x41a1, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa7, 0xa813,
+	0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004,
+	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061,
+	0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036, 0x2009,
+	0x0040, 0x080c, 0x21b0, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
+	0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1,
+	0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006,
+	0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b,
+	0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040,
+	0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940,
+	0x0086, 0x080c, 0x4aa7, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900,
+	0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee,
+	0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038,
+	0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4aa7,
+	0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
+	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
+	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x41a1,
+	0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa7, 0x2940, 0xa013,
+	0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004,
+	0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101,
+	0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a6b,
+	0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300,
+	0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004,
+	0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006,
+	0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006,
+	0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052,
+	0x0108, 0x0005, 0x0804, 0x3573, 0x7d98, 0x7c9c, 0x0804, 0x366a,
+	0x080c, 0x74e9, 0x190c, 0x5fee, 0x6040, 0x9084, 0x0020, 0x09b1,
+	0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0001, 0x080c, 0x4af0, 0x701f, 0x4280, 0x0005,
+	0x080c, 0x56e9, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8,
+	0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x35a8, 0x6804,
+	0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x35a8, 0xd094, 0x00c6, 0x2061,
+	0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c,
+	0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6,
+	0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c,
+	0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f,
+	0x1a04, 0x35a8, 0x9288, 0x3374, 0x210d, 0x918c, 0x00ff, 0x6166,
+	0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x35a8, 0x605e,
+	0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006,
+	0x2009, 0x19b1, 0x9080, 0x2737, 0x2005, 0x200a, 0x2008, 0x2001,
+	0x0018, 0x080c, 0xa887, 0x2009, 0x0390, 0x200b, 0x0400, 0x000e,
+	0x2009, 0x19b2, 0x9080, 0x273b, 0x2005, 0x200a, 0x6808, 0x908a,
+	0x0100, 0x0a04, 0x35a8, 0x908a, 0x0841, 0x1a04, 0x35a8, 0x9084,
+	0x0007, 0x1904, 0x35a8, 0x680c, 0x9005, 0x0904, 0x35a8, 0x6810,
+	0x9005, 0x0904, 0x35a8, 0x6848, 0x6940, 0x910a, 0x1a04, 0x35a8,
+	0x8001, 0x0904, 0x35a8, 0x684c, 0x6944, 0x910a, 0x1a04, 0x35a8,
+	0x8001, 0x0904, 0x35a8, 0x6814, 0x908c, 0x00ff, 0x614e, 0x8007,
+	0x9084, 0x00ff, 0x6052, 0x080c, 0x781e, 0x080c, 0x6aa1, 0x080c,
+	0x6ad5, 0x6808, 0x602a, 0x080c, 0x2122, 0x2009, 0x0170, 0x200b,
+	0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c,
+	0x269e, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x440b, 0x6818,
+	0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016,
+	0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934,
+	0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084,
+	0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217,
+	0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b3, 0x20e9, 0x0001, 0x4001,
+	0x20a9, 0x0004, 0x20a1, 0x19cd, 0x20e9, 0x0001, 0x4001, 0x080c,
+	0x87d1, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8,
+	0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7ddf, 0x6878,
+	0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184,
+	0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003,
+	0x0001, 0x1f04, 0x4369, 0x00ce, 0x00c6, 0x2061, 0x199c, 0x6a88,
+	0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063, 0x0000,
+	0x2001, 0x0001, 0x080c, 0x2945, 0x2001, 0x0001, 0x080c, 0x2928,
+	0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006, 0x080c,
+	0x2945, 0x9006, 0x080c, 0x2928, 0x0028, 0x9286, 0x8000, 0x1d30,
+	0x2063, 0x0002, 0x00ce, 0x00e6, 0x2c70, 0x080c, 0x0eb4, 0x00ee,
+	0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0180,
+	0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294,
+	0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x197c, 0x6a80, 0x9294,
+	0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e,
+	0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x2713, 0x2001, 0x196d,
+	0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040,
+	0x602f, 0x0000, 0x00ce, 0x080c, 0x74e9, 0x0128, 0x080c, 0x4fde,
+	0x0110, 0x080c, 0x2664, 0x60d4, 0x9005, 0x01c0, 0x6003, 0x0001,
+	0x2009, 0x43f3, 0x00e0, 0x080c, 0x74e9, 0x1168, 0x2011, 0x735f,
+	0x080c, 0x863e, 0x2011, 0x7352, 0x080c, 0x874a, 0x080c, 0x77f2,
+	0x080c, 0x741a, 0x0040, 0x080c, 0x5ee4, 0x0028, 0x6003, 0x0004,
+	0x2009, 0x440b, 0x0020, 0x080c, 0x69cd, 0x0804, 0x3573, 0x2001,
+	0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091,
+	0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086, 0x0000,
+	0x0904, 0x35a5, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894, 0x6846,
+	0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0001, 0x0804, 0x4af3, 0x9006, 0x080c, 0x2664, 0x81ff, 0x1904,
+	0x35a5, 0x080c, 0x74e9, 0x11b0, 0x080c, 0x77ed, 0x080c, 0x6029,
+	0x080c, 0x3368, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xcf52,
+	0x0130, 0x080c, 0x750c, 0x1118, 0x080c, 0x74bd, 0x0038, 0x080c,
+	0x741a, 0x0020, 0x080c, 0x5fee, 0x080c, 0x5ee4, 0x0804, 0x3573,
+	0x81ff, 0x1904, 0x35a5, 0x080c, 0x74e9, 0x1110, 0x0804, 0x35a5,
+	0x6194, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80, 0x2009,
+	0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000,
+	0x2039, 0x0001, 0x080c, 0x4af3, 0x701f, 0x3571, 0x012e, 0x0005,
+	0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040, 0x20e9,
+	0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x655c, 0x9588,
+	0x3374, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002,
+	0x2100, 0x9506, 0x01a8, 0x080c, 0x6625, 0x1190, 0xb814, 0x821c,
+	0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038,
+	0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210,
+	0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c,
+	0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80, 0x2099,
+	0x1d80, 0x080c, 0x5f79, 0x0804, 0x4465, 0x080c, 0x4ada, 0x0904,
+	0x35a8, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5,
+	0x080c, 0x56da, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538,
+	0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3363,
+	0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xca07, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007, 0x0003,
+	0x701f, 0x44f3, 0x0005, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x20a9,
+	0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006,
+	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0fb7, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7,
 	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
-	0x4aec, 0x9006, 0x080c, 0x2664, 0x78a8, 0x9084, 0x00ff, 0x9086,
-	0x00ff, 0x0118, 0x81ff, 0x1904, 0x359e, 0x080c, 0x74d5, 0x0110,
-	0x080c, 0x5fe7, 0x7888, 0x908a, 0x1000, 0x1a04, 0x35a1, 0x7984,
-	0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x35a1, 0x2100,
-	0x080c, 0x262e, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061,
-	0x1a03, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077,
-	0x0000, 0x080c, 0x74d5, 0x1158, 0x080c, 0x77d9, 0x080c, 0x6022,
-	0x9085, 0x0001, 0x080c, 0x751c, 0x080c, 0x7406, 0x00f0, 0x080c,
-	0xa872, 0x080c, 0xab3a, 0x080c, 0xa88e, 0x2061, 0x0100, 0x2001,
-	0x1818, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a, 0x6043,
-	0x0090, 0x6043, 0x0010, 0x2009, 0x1999, 0x200b, 0x0000, 0x2009,
-	0x002d, 0x2011, 0x5f0d, 0x080c, 0x86d7, 0x7984, 0x080c, 0x74d5,
-	0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x45a4, 0x012e, 0x00ce,
-	0x002e, 0x0804, 0x356c, 0x7984, 0x080c, 0x65bd, 0x2b08, 0x1904,
-	0x35a1, 0x0804, 0x356c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x359e, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005,
-	0x0804, 0x359e, 0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x359e, 0x7984, 0x9192, 0x0021, 0x1a04, 0x35a1, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60, 0x7736,
-	0x080c, 0x4ae9, 0x701f, 0x47b3, 0x7880, 0x9086, 0x006e, 0x0110,
-	0x701f, 0x5189, 0x0005, 0x2009, 0x0080, 0x080c, 0x661e, 0x1118,
-	0x080c, 0x6a5b, 0x0120, 0x2021, 0x400a, 0x0804, 0x356e, 0x00d6,
-	0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c, 0xa884,
-	0x90be, 0x0100, 0x0904, 0x484c, 0x90be, 0x0112, 0x0904, 0x484c,
-	0x90be, 0x0113, 0x0904, 0x484c, 0x90be, 0x0114, 0x0904, 0x484c,
-	0x90be, 0x0117, 0x0904, 0x484c, 0x90be, 0x011a, 0x0904, 0x484c,
-	0x90be, 0x011c, 0x0904, 0x484c, 0x90be, 0x0121, 0x0904, 0x4833,
-	0x90be, 0x0131, 0x0904, 0x4833, 0x90be, 0x0171, 0x0904, 0x484c,
-	0x90be, 0x0173, 0x0904, 0x484c, 0x90be, 0x01a1, 0x1128, 0xa894,
-	0x8007, 0xa896, 0x0804, 0x4857, 0x90be, 0x0212, 0x0904, 0x4840,
-	0x90be, 0x0213, 0x05e8, 0x90be, 0x0214, 0x0500, 0x90be, 0x0217,
-	0x0188, 0x90be, 0x021a, 0x1120, 0xa89c, 0x8007, 0xa89e, 0x04e0,
-	0x90be, 0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0, 0x009e, 0x00de,
-	0x0804, 0x35a1, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0, 0x7034,
-	0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x4895, 0x7028, 0x9080,
-	0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
-	0x080c, 0x4895, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0,
-	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x48a2, 0x00b8,
-	0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
-	0x20a9, 0x0001, 0x080c, 0x48a2, 0x7028, 0x9080, 0x000c, 0x2098,
-	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6,
-	0x080c, 0x4aa0, 0x0550, 0xa868, 0xc0fd, 0xa86a, 0xa867, 0x0119,
-	0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001, 0x810b, 0xa9ae,
-	0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6, 0xa8ca, 0x00ce,
-	0x009e, 0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd, 0xa86a, 0xa804,
-	0x2048, 0x080c, 0xc9a4, 0x1120, 0x2009, 0x0003, 0x0804, 0x359e,
-	0x7007, 0x0003, 0x701f, 0x488c, 0x0005, 0x00ce, 0x009e, 0x00de,
-	0x2009, 0x0002, 0x0804, 0x359e, 0xa820, 0x9086, 0x8001, 0x1904,
-	0x356c, 0x2009, 0x0004, 0x0804, 0x359e, 0x0016, 0x0026, 0x3510,
-	0x20a9, 0x0002, 0x4002, 0x4104, 0x4004, 0x8211, 0x1dc8, 0x002e,
-	0x001e, 0x0005, 0x0016, 0x0026, 0x0036, 0x0046, 0x3520, 0x20a9,
-	0x0004, 0x4002, 0x4304, 0x4204, 0x4104, 0x4004, 0x8421, 0x1db8,
-	0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x359e, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120,
-	0x2009, 0x0005, 0x0804, 0x359e, 0x7984, 0x78a8, 0x2040, 0x080c,
-	0xab33, 0x1120, 0x9182, 0x007f, 0x0a04, 0x35a1, 0x9186, 0x00ff,
-	0x0904, 0x35a1, 0x9182, 0x0800, 0x1a04, 0x35a1, 0x7a8c, 0x7b88,
-	0x607c, 0x9306, 0x1140, 0x6080, 0x924e, 0x0904, 0x35a1, 0x99cc,
-	0xff00, 0x0904, 0x35a1, 0x0126, 0x2091, 0x8000, 0x080c, 0x49b3,
-	0x0904, 0x4933, 0x0086, 0x90c6, 0x4000, 0x008e, 0x1538, 0x00c6,
-	0x0006, 0x0036, 0xb818, 0xbb1c, 0x9305, 0xbb20, 0x9305, 0xbb24,
-	0x9305, 0xbb28, 0x9305, 0xbb2c, 0x9305, 0xbb30, 0x9305, 0xbb34,
-	0x9305, 0x003e, 0x0570, 0xd88c, 0x1128, 0x080c, 0x6a5b, 0x0110,
-	0xc89d, 0x0438, 0x900e, 0x080c, 0x690d, 0x1108, 0xc185, 0xb800,
-	0xd0bc, 0x0108, 0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007,
-	0x1110, 0x2408, 0x0090, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610,
-	0x0060, 0x90c6, 0x4009, 0x1108, 0x0040, 0x90c6, 0x4006, 0x1108,
-	0x0020, 0x2001, 0x4005, 0x2009, 0x000a, 0x2020, 0x012e, 0x0804,
-	0x356e, 0x000e, 0x00ce, 0x2b00, 0x7026, 0x0016, 0x00b6, 0x00c6,
-	0x00e6, 0x2c70, 0x080c, 0xac3b, 0x0904, 0x4988, 0x2b00, 0x6012,
-	0x080c, 0xcca8, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x4aa0,
-	0x00ce, 0x2b70, 0x1158, 0x080c, 0xabc9, 0x00ee, 0x00ce, 0x00be,
-	0x001e, 0x012e, 0x2009, 0x0002, 0x0804, 0x359e, 0x900e, 0xa966,
-	0xa96a, 0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd, 0xd88c, 0x0108,
-	0xc0f5, 0xa86a, 0xd89c, 0x1110, 0x080c, 0x31e4, 0x6023, 0x0001,
-	0x9006, 0x080c, 0x655a, 0xd89c, 0x0138, 0x2001, 0x0004, 0x080c,
-	0x656e, 0x2009, 0x0003, 0x0030, 0x2001, 0x0002, 0x080c, 0x656e,
-	0x2009, 0x0002, 0x080c, 0xac68, 0x78a8, 0xd094, 0x0138, 0x00ee,
-	0x7024, 0x00e6, 0x2058, 0xb8d4, 0xc08d, 0xb8d6, 0x9085, 0x0001,
-	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x359e, 0x7007, 0x0003, 0x701f, 0x4997, 0x0005, 0xa830,
-	0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04,
-	0x9294, 0x00ff, 0x0804, 0x5630, 0x900e, 0xa868, 0xd0f4, 0x1904,
-	0x356c, 0x080c, 0x690d, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x356c, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
-	0x4a02, 0x902e, 0x080c, 0xab33, 0x0130, 0x9026, 0x20a9, 0x0800,
-	0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071,
-	0x107f, 0x2e04, 0x9005, 0x11b8, 0x2100, 0x9406, 0x1904, 0x4a13,
-	0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1558, 0x0030,
-	0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc, 0x1520, 0x93ce, 0x00ff,
-	0x1508, 0xc5fd, 0x0480, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11e8,
-	0xbe14, 0x2600, 0x9206, 0x11c8, 0x2400, 0x9106, 0x1180, 0xd884,
-	0x0598, 0xd894, 0x1588, 0x080c, 0x69fb, 0x1570, 0x2001, 0x4000,
-	0x0460, 0x080c, 0x6a5b, 0x1540, 0x2001, 0x4000, 0x0430, 0x2001,
-	0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106, 0x1158,
-	0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0918, 0x080c, 0xab33, 0x1900,
-	0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x49c9, 0x85ff,
-	0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, 0x080c,
-	0x65bd, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e, 0x00de,
-	0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x359e,
-	0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002, 0x0804, 0x359e, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904, 0x35a1,
-	0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x35a1, 0x2010,
-	0x2918, 0x080c, 0x317e, 0x1120, 0x2009, 0x0003, 0x0804, 0x359e,
-	0x7007, 0x0003, 0x701f, 0x4a55, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x1904, 0x356c, 0x2009, 0x0004, 0x0804, 0x359e, 0x7984, 0x080c,
-	0xab33, 0x1120, 0x9182, 0x007f, 0x0a04, 0x35a1, 0x9186, 0x00ff,
-	0x0904, 0x35a1, 0x9182, 0x0800, 0x1a04, 0x35a1, 0x2001, 0x9000,
-	0x080c, 0x568b, 0x1904, 0x359e, 0x0804, 0x356c, 0xa998, 0x080c,
-	0xab33, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff, 0x0168,
-	0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x568b, 0x11a8,
-	0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a, 0x0c48,
-	0x080c, 0x103a, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005, 0x1120,
-	0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086, 0x2040,
-	0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005, 0x7984,
-	0x080c, 0x661e, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000,
-	0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x661e, 0x1130,
-	0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff,
-	0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x661e, 0x1108,
-	0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff, 0x0128,
-	0x2148, 0xa904, 0x080c, 0x106c, 0x0cc8, 0x7116, 0x711a, 0x001e,
-	0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061, 0x18b8,
-	0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496,
-	0xa59a, 0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x356c, 0x0005,
-	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x18b0,
-	0x2004, 0x9005, 0x1190, 0x0e04, 0x4b1d, 0x7a36, 0x7833, 0x0012,
-	0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11d6, 0x0804, 0x4b83, 0x0016, 0x0086, 0x0096,
-	0x00c6, 0x00e6, 0x2071, 0x189e, 0x7044, 0x9005, 0x1540, 0x7148,
-	0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x103a, 0x0904,
-	0x4b7b, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002, 0x9080,
-	0x1e55, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004, 0x2001,
-	0x18ba, 0x9c82, 0x18fa, 0x0210, 0x2061, 0x18ba, 0x2c00, 0x703a,
-	0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460, 0x7148,
-	0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016, 0x908a,
-	0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005,
-	0xa146, 0x1520, 0x080c, 0x103a, 0x1130, 0x8109, 0xa946, 0x7148,
-	0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046, 0x2800,
-	0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080, 0x1e55,
-	0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce,
-	0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082,
-	0x001b, 0x0002, 0x4ba5, 0x4ba5, 0x4ba7, 0x4ba5, 0x4ba5, 0x4ba5,
-	0x4bab, 0x4ba5, 0x4ba5, 0x4ba5, 0x4baf, 0x4ba5, 0x4ba5, 0x4ba5,
-	0x4bb3, 0x4ba5, 0x4ba5, 0x4ba5, 0x4bb7, 0x4ba5, 0x4ba5, 0x4ba5,
-	0x4bbb, 0x4ba5, 0x4ba5, 0x4ba5, 0x4bc0, 0x080c, 0x0d7d, 0xa276,
-	0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296,
-	0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6,
-	0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4b7e,
-	0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4b7e, 0x00e6, 0x2071, 0x189e,
-	0x7048, 0x9005, 0x0904, 0x4c57, 0x0126, 0x2091, 0x8000, 0x0e04,
-	0x4c56, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086, 0x0076,
-	0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948, 0x2105,
-	0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108,
-	0x2105, 0x9005, 0xa94a, 0x1904, 0x4c59, 0xa804, 0x9005, 0x090c,
-	0x0d7d, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001, 0x0002,
-	0x9080, 0x1e55, 0x2005, 0xa04a, 0x0804, 0x4c59, 0x703c, 0x2060,
-	0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833, 0x0012,
-	0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x87ff, 0x0118, 0x2748,
-	0x080c, 0x106c, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170, 0x7040,
-	0x2048, 0x9005, 0x0128, 0x080c, 0x106c, 0x9006, 0x7042, 0x7046,
-	0x703b, 0x18ba, 0x703f, 0x18ba, 0x0420, 0x7040, 0x9005, 0x1508,
-	0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa, 0x18fa,
-	0x0210, 0x2001, 0x18ba, 0x703e, 0x00a0, 0x9006, 0x703e, 0x703a,
-	0x7044, 0x9005, 0x090c, 0x0d7d, 0x2048, 0xa800, 0x9005, 0x1de0,
-	0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1e55, 0x2005, 0xa84a,
-	0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee,
-	0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4c78, 0x4c78, 0x4c7a,
-	0x4c78, 0x4c78, 0x4c78, 0x4c7f, 0x4c78, 0x4c78, 0x4c78, 0x4c84,
-	0x4c78, 0x4c78, 0x4c78, 0x4c89, 0x4c78, 0x4c78, 0x4c78, 0x4c8e,
-	0x4c78, 0x4c78, 0x4c78, 0x4c93, 0x4c78, 0x4c78, 0x4c78, 0x4c98,
-	0x080c, 0x0d7d, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x4c04, 0xaa84,
-	0xab88, 0xac8c, 0x0804, 0x4c04, 0xaa94, 0xab98, 0xac9c, 0x0804,
-	0x4c04, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x4c04, 0xaab4, 0xabb8,
-	0xacbc, 0x0804, 0x4c04, 0xaac4, 0xabc8, 0xaccc, 0x0804, 0x4c04,
-	0xaad4, 0xabd8, 0xacdc, 0x0804, 0x4c04, 0x0016, 0x0026, 0x0036,
-	0x00b6, 0x00c6, 0x2009, 0x007e, 0x080c, 0x661e, 0x2019, 0x0001,
-	0xb85c, 0xd0ac, 0x0110, 0x2019, 0x0000, 0x2011, 0x801b, 0x080c,
-	0x4b00, 0x00ce, 0x00be, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026,
-	0x080c, 0x56d3, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x4b00,
-	0x002e, 0x0005, 0x81ff, 0x1904, 0x359e, 0x0126, 0x2091, 0x8000,
-	0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x74d5, 0x1158,
-	0x080c, 0x77d9, 0x080c, 0x6022, 0x9085, 0x0001, 0x080c, 0x751c,
-	0x080c, 0x7406, 0x0010, 0x080c, 0x5edd, 0x012e, 0x0804, 0x356c,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x359e, 0x080c, 0x56e7,
-	0x0120, 0x2009, 0x0007, 0x0804, 0x359e, 0x080c, 0x6a53, 0x0120,
-	0x2009, 0x0008, 0x0804, 0x359e, 0x080c, 0x335c, 0x0128, 0x7984,
-	0x080c, 0x65bd, 0x1904, 0x35a1, 0x080c, 0x4ad3, 0x0904, 0x35a1,
-	0x2b00, 0x7026, 0x080c, 0x6a5b, 0x7888, 0x1170, 0x9084, 0x0005,
-	0x1158, 0x900e, 0x080c, 0x690d, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x0804, 0x356c, 0x080c, 0x4aa0, 0x0904, 0x359e,
-	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca46,
-	0x0904, 0x359e, 0x7888, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6,
-	0x7007, 0x0003, 0x701f, 0x4d79, 0x0005, 0x2061, 0x1800, 0x080c,
-	0x56e7, 0x2009, 0x0007, 0x1578, 0x080c, 0x6a53, 0x0118, 0x2009,
-	0x0008, 0x0448, 0x080c, 0x335c, 0x0120, 0xa998, 0x080c, 0x65bd,
-	0x1530, 0x080c, 0x4ad1, 0x0518, 0x080c, 0x6a5b, 0xa89c, 0x1168,
-	0x9084, 0x0005, 0x1150, 0x900e, 0x080c, 0x690d, 0x1108, 0xc185,
-	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a,
-	0x080c, 0xca46, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8d4, 0xc08d,
-	0xb8d6, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0xa99a, 0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006,
-	0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804,
-	0x5630, 0x900e, 0x080c, 0x690d, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x0804, 0x356c, 0x080c, 0x56e7, 0x0120, 0x2009,
-	0x0007, 0x0804, 0x359e, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002, 0x0804, 0x359e, 0x900e,
-	0x2130, 0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080,
-	0x0005, 0x702a, 0x20a0, 0x080c, 0x661e, 0x1904, 0x4e1b, 0x080c,
-	0x6a5b, 0x0138, 0x080c, 0x6a63, 0x0120, 0x080c, 0x69fb, 0x1904,
-	0x4e1b, 0xd794, 0x1110, 0xd784, 0x01a8, 0xb8c4, 0x20e0, 0xb8c8,
-	0x9080, 0x0006, 0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008,
-	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c,
-	0x48a2, 0x0048, 0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00,
-	0x20e0, 0x080c, 0x48a2, 0x9186, 0x007e, 0x0170, 0x9186, 0x0080,
-	0x0158, 0x080c, 0x6a5b, 0x90c2, 0x0006, 0x1210, 0xc1fd, 0x0020,
-	0x080c, 0x690d, 0x1108, 0xc1fd, 0x4104, 0xc1fc, 0xd794, 0x0528,
-	0xb8c4, 0x20e0, 0xb8c8, 0x2060, 0x9c80, 0x0000, 0x2098, 0x20a9,
-	0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9, 0x0001, 0x4005,
-	0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x4003, 0x2098,
-	0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4895, 0x9c80, 0x0026, 0x2098,
-	0xb8c4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0,
-	0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0xab33, 0x0118, 0x9186,
-	0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018,
-	0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010,
-	0x9686, 0x0028, 0x0150, 0x0804, 0x4dab, 0x86ff, 0x1120, 0x7124,
-	0x810b, 0x0804, 0x356c, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600,
-	0x7026, 0x772e, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa67a,
-	0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
-	0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x4e57, 0x0005, 0x7030,
-	0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034,
-	0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598,
-	0x0804, 0x4dab, 0x7124, 0x810b, 0x0804, 0x356c, 0x2029, 0x007e,
-	0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2,
-	0x0020, 0x0a04, 0x35a1, 0x9502, 0x0a04, 0x35a1, 0x9184, 0x00ff,
-	0x90e2, 0x0020, 0x0a04, 0x35a1, 0x9502, 0x0a04, 0x35a1, 0x9284,
-	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x35a1, 0x9502, 0x0a04,
-	0x35a1, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x35a1, 0x9502,
-	0x0a04, 0x35a1, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
-	0x35a1, 0x9502, 0x0a04, 0x35a1, 0x9384, 0x00ff, 0x90e2, 0x0020,
-	0x0a04, 0x35a1, 0x9502, 0x0a04, 0x35a1, 0x9484, 0xff00, 0x8007,
-	0x90e2, 0x0020, 0x0a04, 0x35a1, 0x9502, 0x0a04, 0x35a1, 0x9484,
-	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x35a1, 0x9502, 0x0a04, 0x35a1,
-	0x2061, 0x1989, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x356c,
-	0x080c, 0x4aa0, 0x0904, 0x359e, 0x2009, 0x0016, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4ae9,
-	0x701f, 0x4edb, 0x0005, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6,
-	0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x20a9, 0x0016,
-	0x896e, 0x8d6e, 0x8d6f, 0x9d84, 0xffc0, 0x9080, 0x0019, 0x2098,
-	0x9d84, 0x003f, 0x20e0, 0x2069, 0x1877, 0x20e9, 0x0001, 0x2da0,
-	0x4003, 0x6800, 0x9005, 0x0904, 0x4f5c, 0x6804, 0x2008, 0x918c,
-	0xfff8, 0x1904, 0x4f5c, 0x680c, 0x9005, 0x0904, 0x4f5c, 0x9082,
-	0xff01, 0x1a04, 0x4f5c, 0x6810, 0x9082, 0x005c, 0x0a04, 0x4f5c,
-	0x6824, 0x2008, 0x9082, 0x0008, 0x0a04, 0x4f5c, 0x9182, 0x0400,
-	0x1a04, 0x4f5c, 0x0056, 0x2029, 0x0000, 0x080c, 0x8cd9, 0x005e,
-	0x6944, 0x6820, 0x9102, 0x06c0, 0x6820, 0x9082, 0x0019, 0x16a0,
-	0x6828, 0x6944, 0x810c, 0x9102, 0x0678, 0x6840, 0x9082, 0x000f,
-	0x1658, 0x080c, 0x1053, 0x2900, 0x0904, 0x4f76, 0x684e, 0x00e6,
-	0x2071, 0x1930, 0x00b6, 0x2059, 0x0000, 0x080c, 0x8b95, 0x00be,
-	0x00ee, 0x0558, 0x080c, 0x88ef, 0x080c, 0x8935, 0x11e0, 0x6857,
-	0x0000, 0x00c6, 0x2061, 0x0100, 0x6104, 0x918d, 0x2000, 0x6106,
-	0x6b10, 0x2061, 0x1a6b, 0x630a, 0x00ce, 0x080c, 0x2713, 0x2001,
-	0x0138, 0x2102, 0x0804, 0x356c, 0x080c, 0x2713, 0x2001, 0x0138,
-	0x2102, 0x0804, 0x35a1, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8d6a,
-	0x080c, 0x8d79, 0x080c, 0x8b84, 0x00ee, 0x2001, 0x188a, 0x204c,
-	0x080c, 0x106c, 0x2001, 0x188a, 0x2003, 0x0000, 0x080c, 0x2713,
-	0x2001, 0x0138, 0x2102, 0x0804, 0x359e, 0x2001, 0x1924, 0x200c,
-	0x918e, 0x0000, 0x0904, 0x4fd5, 0x080c, 0x8b7f, 0x0904, 0x4fd5,
-	0x2001, 0x0101, 0x200c, 0x918c, 0xdfff, 0x2102, 0x2001, 0x0138,
-	0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8,
-	0x00ee, 0x080c, 0x8b84, 0x2001, 0x0035, 0x080c, 0x1679, 0x00c6,
-	0x2061, 0x193c, 0x6004, 0x6100, 0x9106, 0x1de0, 0x00ce, 0x080c,
-	0x2713, 0x2001, 0x0138, 0x2102, 0x00e6, 0x00f6, 0x2071, 0x1923,
-	0x080c, 0x8ac0, 0x0120, 0x2f00, 0x080c, 0x8b4a, 0x0cc8, 0x00fe,
-	0x00ee, 0x0126, 0x2091, 0x8000, 0x2001, 0x188a, 0x200c, 0x81ff,
-	0x0138, 0x2148, 0x080c, 0x106c, 0x2001, 0x188a, 0x2003, 0x0000,
-	0x2001, 0x183d, 0x2003, 0x0020, 0x00e6, 0x2071, 0x1930, 0x080c,
-	0x8d6a, 0x080c, 0x8d79, 0x00ee, 0x012e, 0x0804, 0x356c, 0x0006,
-	0x080c, 0x56d3, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d7,
-	0xd0bc, 0x000e, 0x0005, 0x6174, 0x7a84, 0x6300, 0x82ff, 0x1118,
-	0x7986, 0x0804, 0x356c, 0x83ff, 0x1904, 0x35a1, 0x2001, 0xfff0,
-	0x9200, 0x1a04, 0x35a1, 0x2019, 0xffff, 0x6078, 0x9302, 0x9200,
-	0x0a04, 0x35a1, 0x7986, 0x6276, 0x0804, 0x356c, 0x080c, 0x56e7,
-	0x1904, 0x359e, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4aa0,
-	0x0904, 0x359e, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860, 0x20e8,
-	0x7036, 0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000,
-	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6a5b, 0x0118, 0x080c, 0x6a63,
-	0x1148, 0x20a9, 0x0001, 0xb814, 0x4004, 0xb810, 0x4004, 0x4104,
-	0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c,
-	0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e, 0x2001, 0x0003,
-	0x080c, 0x9135, 0x2208, 0x0804, 0x356c, 0x7033, 0x0001, 0x7122,
-	0x7024, 0x9300, 0x7026, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000,
-	0xa37a, 0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592, 0xa696,
-	0xa79a, 0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x5058, 0x0005,
-	0x7030, 0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e, 0x7034,
-	0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798,
-	0x0804, 0x5016, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x9135,
-	0x2208, 0x0804, 0x356c, 0x00f6, 0x00e6, 0x080c, 0x56e7, 0x2009,
-	0x0007, 0x1904, 0x50eb, 0x2071, 0x189e, 0x745c, 0x84ff, 0x2009,
-	0x000e, 0x1904, 0x50eb, 0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096,
-	0x080c, 0x1053, 0x2009, 0x0002, 0x0904, 0x50eb, 0x2900, 0x705e,
-	0x900e, 0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c, 0x9080,
-	0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178,
-	0x080c, 0x6a5b, 0x0118, 0x080c, 0x6a63, 0x1148, 0xb814, 0x20a9,
-	0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108,
-	0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff,
-	0x11c0, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x9135, 0x2208,
-	0x009e, 0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c, 0x0d7d,
-	0x2148, 0x080c, 0x106c, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008,
-	0x0418, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0x2061,
-	0x18b9, 0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064, 0xa072, 0xa48e,
-	0xa592, 0xa696, 0xa79a, 0xa09f, 0x50f7, 0x000e, 0xa0a2, 0x080c,
-	0x1124, 0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6,
-	0xa0a0, 0x904d, 0x090c, 0x0d7d, 0x00e6, 0x2071, 0x189e, 0xa06c,
-	0x908e, 0x0100, 0x0138, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4002, 0x00d8, 0x7060, 0x9005, 0x1158, 0x7150, 0x7058, 0x20a0,
-	0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0428,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x7254, 0x900e,
-	0x2001, 0x0003, 0x080c, 0x9135, 0xaa9a, 0x715c, 0x81ff, 0x090c,
-	0x0d7d, 0x2148, 0x080c, 0x106c, 0x705f, 0x0000, 0xa0a0, 0x2048,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0xa09f, 0x0000,
-	0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c,
-	0x8bff, 0x0178, 0x080c, 0x6a5b, 0x0118, 0x080c, 0x6a63, 0x1148,
-	0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
-	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0518,
-	0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a, 0xa897, 0x4000,
-	0x715c, 0x81ff, 0x090c, 0x0d7d, 0x2148, 0x080c, 0x106c, 0x9006,
-	0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6d70, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000,
-	0x0070, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0xa37a,
-	0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x1124, 0x9006, 0x00ee,
-	0x0005, 0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100,
-	0x0130, 0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x35a1, 0xa884,
-	0xa988, 0x080c, 0x25fb, 0x1518, 0x080c, 0x65bd, 0x1500, 0x7126,
-	0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4aa0, 0x01c8, 0x080c, 0x4aa0,
-	0x01b0, 0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823,
-	0x0000, 0xa804, 0x2048, 0x080c, 0xc9c4, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x359e, 0x7007, 0x0003, 0x701f, 0x51c4, 0x0005, 0x009e,
-	0x2009, 0x0002, 0x0804, 0x359e, 0x7124, 0x080c, 0x32f5, 0xa820,
-	0x9086, 0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x359e, 0x2900,
-	0x7022, 0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076, 0x0006,
-	0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb7,
-	0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061, 0x18b8, 0x2c44, 0xa06b,
-	0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100,
-	0x1148, 0x96c2, 0x0004, 0x0600, 0x2009, 0x0004, 0x000e, 0x007e,
-	0x0804, 0x4aec, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0,
-	0x000e, 0x007e, 0x2061, 0x18b8, 0x2c44, 0xa076, 0xa772, 0xa07b,
-	0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x1124, 0x7007,
-	0x0002, 0x701f, 0x5220, 0x0005, 0x000e, 0x007e, 0x0804, 0x35a1,
-	0x7020, 0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2098,
-	0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb7, 0x2100,
-	0x2238, 0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598,
-	0x2009, 0x002a, 0x0804, 0x4aec, 0x81ff, 0x1904, 0x359e, 0x798c,
-	0x2001, 0x197e, 0x918c, 0x8000, 0x2102, 0x080c, 0x4ab7, 0x0904,
-	0x35a1, 0x080c, 0x6a5b, 0x0120, 0x080c, 0x6a63, 0x1904, 0x35a1,
-	0x080c, 0x66e5, 0x0904, 0x359e, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x687a, 0x012e, 0x0904, 0x359e, 0x2001, 0x197e, 0x2004, 0xd0fc,
-	0x1904, 0x356c, 0x0804, 0x4541, 0xa9a0, 0x2001, 0x197e, 0x918c,
-	0x8000, 0xc18d, 0x2102, 0x080c, 0x4ac4, 0x01a0, 0x080c, 0x6a5b,
-	0x0118, 0x080c, 0x6a63, 0x1170, 0x080c, 0x66e5, 0x2009, 0x0002,
-	0x0128, 0x080c, 0x687a, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005,
+	0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x4af3, 0x81ff, 0x1904, 0x35a5, 0x080c, 0x4abe, 0x0904, 0x35a8,
+	0x080c, 0x6866, 0x0904, 0x35a5, 0x0058, 0xa878, 0x9005, 0x0120,
+	0x2009, 0x0004, 0x0804, 0x35a5, 0xa974, 0xaa94, 0x0804, 0x3573,
+	0x080c, 0x56e2, 0x0904, 0x3573, 0x701f, 0x453d, 0x7007, 0x0003,
+	0x0005, 0x81ff, 0x1904, 0x35a5, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x35a8, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x6a6b, 0x0120,
+	0x080c, 0x6a73, 0x1904, 0x35a8, 0x080c, 0x68eb, 0x0904, 0x35a5,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x6878, 0x0904, 0x35a5, 0x7984,
+	0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c,
+	0x4ad8, 0x01e0, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x11b0,
+	0x080c, 0x68eb, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019,
+	0x0004, 0x080c, 0x6878, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c,
+	0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x080c, 0x56e2, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060,
+	0x2029, 0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506, 0x0110,
+	0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6625, 0x1138,
+	0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x864c, 0x0005,
+	0x81ff, 0x1904, 0x35a5, 0x798c, 0x2001, 0x1980, 0x918c, 0x8000,
+	0x2102, 0x080c, 0x4abe, 0x0904, 0x35a8, 0x080c, 0x6a6b, 0x0120,
+	0x080c, 0x6a73, 0x1904, 0x35a8, 0x080c, 0x66ec, 0x0904, 0x35a5,
+	0x080c, 0x686f, 0x0904, 0x35a5, 0x2001, 0x1980, 0x2004, 0xd0fc,
+	0x1904, 0x3573, 0x0804, 0x4548, 0xa9a0, 0x2001, 0x1980, 0x918c,
+	0x8000, 0xc18d, 0x2102, 0x080c, 0x4acb, 0x01a0, 0x080c, 0x6a6b,
+	0x0118, 0x080c, 0x6a73, 0x1170, 0x080c, 0x66ec, 0x2009, 0x0002,
+	0x0128, 0x080c, 0x686f, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005,
 	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x197e, 0x2004, 0xd0fc,
-	0x1128, 0x080c, 0x56db, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084,
-	0x0904, 0x44b6, 0x080c, 0x4ad3, 0x0904, 0x35a1, 0x080c, 0x4aa0,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x359e, 0x080c, 0x6a5b, 0x0130,
-	0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c,
-	0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c, 0x56d3, 0xd0b4,
-	0x0904, 0x44f0, 0x7884, 0x908e, 0x007e, 0x0904, 0x44f0, 0x908e,
-	0x007f, 0x0904, 0x44f0, 0x908e, 0x0080, 0x0904, 0x44f0, 0xb800,
-	0xd08c, 0x1904, 0x44f0, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xc9e3, 0x1120, 0x2009, 0x0003, 0x0804, 0x359e, 0x7007,
-	0x0003, 0x701f, 0x52ec, 0x0005, 0x080c, 0x4ad3, 0x0904, 0x35a1,
-	0x0804, 0x44f0, 0x080c, 0x335c, 0x0108, 0x0005, 0x2009, 0x1834,
-	0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x359e, 0x080c,
-	0x56e7, 0x0120, 0x2009, 0x0007, 0x0804, 0x359e, 0x080c, 0x6a53,
-	0x0120, 0x2009, 0x0008, 0x0804, 0x359e, 0xb89c, 0xd0a4, 0x1118,
-	0xd0ac, 0x1904, 0x44f0, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd,
-	0xa86a, 0x080c, 0xca46, 0x1120, 0x2009, 0x0003, 0x0804, 0x359e,
-	0x7007, 0x0003, 0x701f, 0x5325, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x1120, 0x2009, 0x0004, 0x0804, 0x5630, 0x080c, 0x4ad3, 0x0904,
-	0x35a1, 0x0804, 0x52be, 0x81ff, 0x2009, 0x0001, 0x1904, 0x359e,
-	0x080c, 0x56e7, 0x2009, 0x0007, 0x1904, 0x359e, 0x080c, 0x6a53,
-	0x0120, 0x2009, 0x0008, 0x0804, 0x359e, 0x080c, 0x4ad3, 0x0904,
-	0x35a1, 0x080c, 0x6a5b, 0x2009, 0x0009, 0x1904, 0x359e, 0x080c,
-	0x4aa0, 0x2009, 0x0002, 0x0904, 0x359e, 0x9006, 0xa866, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00, 0x918c, 0x00ff,
-	0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038,
-	0x928e, 0x0100, 0x1904, 0x35a1, 0xc0e5, 0xa952, 0xa956, 0xa83e,
-	0x080c, 0xcca9, 0x2009, 0x0003, 0x0904, 0x359e, 0x7007, 0x0003,
-	0x701f, 0x537b, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
-	0x0904, 0x359e, 0x0804, 0x356c, 0x7aa8, 0x9284, 0xc000, 0x0148,
-	0xd2ec, 0x01a0, 0x080c, 0x56e7, 0x1188, 0x2009, 0x0014, 0x0804,
-	0x359e, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001, 0x1904, 0x359e,
-	0x080c, 0x56e7, 0x2009, 0x0007, 0x1904, 0x359e, 0xd2f4, 0x0130,
-	0x9284, 0x5000, 0x080c, 0x56ae, 0x0804, 0x356c, 0xd2fc, 0x0158,
-	0x080c, 0x4ad3, 0x0904, 0x35a1, 0x7984, 0x9284, 0x9000, 0x080c,
-	0x568b, 0x0804, 0x356c, 0x080c, 0x4ad3, 0x0904, 0x35a1, 0xb804,
-	0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904, 0x5464,
-	0x080c, 0x4aa0, 0x2009, 0x0002, 0x0904, 0x5464, 0xa85c, 0x9080,
-	0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x080c, 0x4ae9, 0x701f, 0x53d5, 0x0005, 0xa86c, 0x9086, 0x0500,
-	0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084, 0xff00, 0x0110,
-	0x1904, 0x35a1, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c,
-	0x4ad3, 0x1110, 0x0804, 0x35a1, 0x2009, 0x0043, 0x080c, 0xcd11,
-	0x2009, 0x0003, 0x0904, 0x5464, 0x7007, 0x0003, 0x701f, 0x53f9,
-	0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x5464,
-	0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x568b, 0x0804, 0x356c,
-	0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c,
-	0x56e7, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061, 0x1800, 0x080c,
-	0x56e7, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000,
-	0x080c, 0x56ae, 0x0050, 0xd2fc, 0x0178, 0x080c, 0x4ad1, 0x0588,
-	0xa998, 0x9284, 0x9000, 0x080c, 0x568b, 0xa87b, 0x0000, 0xa883,
-	0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x4ad1, 0x0510, 0x080c,
-	0x6a5b, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8,
-	0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c,
-	0x4ad1, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c, 0xcd11, 0x2009,
-	0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a,
+	0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1980, 0x2004, 0xd0fc,
+	0x1128, 0x080c, 0x56e2, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x35a5, 0x798c,
+	0x2001, 0x197f, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abe, 0x0904,
+	0x35a8, 0x080c, 0x6a6b, 0x0120, 0x080c, 0x6a73, 0x1904, 0x35a8,
+	0x080c, 0x66ec, 0x0904, 0x35a5, 0x080c, 0x685d, 0x0904, 0x35a5,
+	0x2001, 0x197f, 0x2004, 0xd0fc, 0x1904, 0x3573, 0x0804, 0x4548,
+	0xa9a0, 0x2001, 0x197f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
+	0x4acb, 0x01a0, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1170,
+	0x080c, 0x66ec, 0x2009, 0x0002, 0x0128, 0x080c, 0x685d, 0x1170,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x2001, 0x197f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56e2, 0x0110,
+	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
+	0x6100, 0x0804, 0x3573, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c,
+	0x56ee, 0x1904, 0x35a5, 0x79a8, 0xd184, 0x1158, 0xb834, 0x8007,
+	0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28, 0x8217,
+	0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a, 0xbb1c,
+	0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804, 0x3573,
+	0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003, 0x1a04,
+	0x35a5, 0x625c, 0x7884, 0x9206, 0x1548, 0x080c, 0x87bb, 0x2001,
+	0xfff4, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0000, 0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e, 0x0804,
+	0x4af3, 0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a,
+	0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x1124, 0x7007, 0x0002, 0x701f, 0x46fe, 0x0005, 0x81ff, 0x1904,
+	0x35a5, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x6a6b, 0x1904,
+	0x35a5, 0x00c6, 0x080c, 0x4aa7, 0x00ce, 0x0904, 0x35a5, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xc9ad, 0x0904,
+	0x35a5, 0x7007, 0x0003, 0x701f, 0x4702, 0x0005, 0x080c, 0x4246,
+	0x0804, 0x3573, 0xa830, 0x9086, 0x0100, 0x0904, 0x35a5, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af3,
+	0x9006, 0x080c, 0x2664, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff,
+	0x0118, 0x81ff, 0x1904, 0x35a5, 0x080c, 0x74e9, 0x0110, 0x080c,
+	0x5fee, 0x7888, 0x908a, 0x1000, 0x1a04, 0x35a8, 0x7984, 0x9186,
+	0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x35a8, 0x2100, 0x080c,
+	0x262e, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x1a03,
+	0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000,
+	0x080c, 0x74e9, 0x1158, 0x080c, 0x77ed, 0x080c, 0x6029, 0x9085,
+	0x0001, 0x080c, 0x7530, 0x080c, 0x741a, 0x00f0, 0x080c, 0xa896,
+	0x080c, 0xab5e, 0x080c, 0xa8b2, 0x2061, 0x0100, 0x2001, 0x1818,
+	0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a, 0x6043, 0x0090,
+	0x6043, 0x0010, 0x2009, 0x1999, 0x200b, 0x0000, 0x2009, 0x002d,
+	0x2011, 0x5f14, 0x080c, 0x8708, 0x7984, 0x080c, 0x74e9, 0x1110,
+	0x2009, 0x00ff, 0x7a88, 0x080c, 0x45ab, 0x012e, 0x00ce, 0x002e,
+	0x0804, 0x3573, 0x7984, 0x080c, 0x65c4, 0x2b08, 0x1904, 0x35a8,
+	0x0804, 0x3573, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5,
+	0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804,
+	0x35a5, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5,
+	0x7984, 0x9192, 0x0021, 0x1a04, 0x35a8, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60, 0x7736, 0x080c,
+	0x4af0, 0x701f, 0x47ba, 0x7880, 0x9086, 0x006e, 0x0110, 0x701f,
+	0x5190, 0x0005, 0x2009, 0x0080, 0x080c, 0x6625, 0x1118, 0x080c,
+	0x6a6b, 0x0120, 0x2021, 0x400a, 0x0804, 0x3575, 0x00d6, 0x0096,
+	0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c, 0xa884, 0x90be,
+	0x0100, 0x0904, 0x4853, 0x90be, 0x0112, 0x0904, 0x4853, 0x90be,
+	0x0113, 0x0904, 0x4853, 0x90be, 0x0114, 0x0904, 0x4853, 0x90be,
+	0x0117, 0x0904, 0x4853, 0x90be, 0x011a, 0x0904, 0x4853, 0x90be,
+	0x011c, 0x0904, 0x4853, 0x90be, 0x0121, 0x0904, 0x483a, 0x90be,
+	0x0131, 0x0904, 0x483a, 0x90be, 0x0171, 0x0904, 0x4853, 0x90be,
+	0x0173, 0x0904, 0x4853, 0x90be, 0x01a1, 0x1128, 0xa894, 0x8007,
+	0xa896, 0x0804, 0x485e, 0x90be, 0x0212, 0x0904, 0x4847, 0x90be,
+	0x0213, 0x05e8, 0x90be, 0x0214, 0x0500, 0x90be, 0x0217, 0x0188,
+	0x90be, 0x021a, 0x1120, 0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be,
+	0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0, 0x009e, 0x00de, 0x0804,
+	0x35a8, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0007, 0x080c, 0x489c, 0x7028, 0x9080, 0x000e,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c,
+	0x489c, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x48a9, 0x00b8, 0x7028,
+	0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x080c, 0x48a9, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c,
+	0x4aa7, 0x0550, 0xa868, 0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006,
+	0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2,
+	0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e,
+	0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048,
+	0x080c, 0xc9c8, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007,
+	0x0003, 0x701f, 0x4893, 0x0005, 0x00ce, 0x009e, 0x00de, 0x2009,
+	0x0002, 0x0804, 0x35a5, 0xa820, 0x9086, 0x8001, 0x1904, 0x3573,
+	0x2009, 0x0004, 0x0804, 0x35a5, 0x0016, 0x0026, 0x3510, 0x20a9,
+	0x0002, 0x4002, 0x4104, 0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e,
+	0x0005, 0x0016, 0x0026, 0x0036, 0x0046, 0x3520, 0x20a9, 0x0004,
+	0x4002, 0x4304, 0x4204, 0x4104, 0x4004, 0x8421, 0x1db8, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x35a5, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x35a5, 0x7984, 0x78a8, 0x2040, 0x080c, 0xab57,
+	0x1120, 0x9182, 0x007f, 0x0a04, 0x35a8, 0x9186, 0x00ff, 0x0904,
+	0x35a8, 0x9182, 0x0800, 0x1a04, 0x35a8, 0x7a8c, 0x7b88, 0x607c,
+	0x9306, 0x1140, 0x6080, 0x924e, 0x0904, 0x35a8, 0x99cc, 0xff00,
+	0x0904, 0x35a8, 0x0126, 0x2091, 0x8000, 0x080c, 0x49ba, 0x0904,
+	0x493a, 0x0086, 0x90c6, 0x4000, 0x008e, 0x1538, 0x00c6, 0x0006,
+	0x0036, 0xb818, 0xbb1c, 0x9305, 0xbb20, 0x9305, 0xbb24, 0x9305,
+	0xbb28, 0x9305, 0xbb2c, 0x9305, 0xbb30, 0x9305, 0xbb34, 0x9305,
+	0x003e, 0x0570, 0xd88c, 0x1128, 0x080c, 0x6a6b, 0x0110, 0xc89d,
+	0x0438, 0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110,
+	0x2408, 0x0090, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060,
+	0x90c6, 0x4009, 0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020,
+	0x2001, 0x4005, 0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3575,
+	0x000e, 0x00ce, 0x2b00, 0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6,
+	0x2c70, 0x080c, 0xac5f, 0x0904, 0x498f, 0x2b00, 0x6012, 0x080c,
+	0xcccc, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x4aa7, 0x00ce,
+	0x2b70, 0x1158, 0x080c, 0xabed, 0x00ee, 0x00ce, 0x00be, 0x001e,
+	0x012e, 0x2009, 0x0002, 0x0804, 0x35a5, 0x900e, 0xa966, 0xa96a,
+	0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5,
+	0xa86a, 0xd89c, 0x1110, 0x080c, 0x31e7, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x6561, 0xd89c, 0x0138, 0x2001, 0x0004, 0x080c, 0x6575,
+	0x2009, 0x0003, 0x0030, 0x2001, 0x0002, 0x080c, 0x6575, 0x2009,
+	0x0002, 0x080c, 0xac8c, 0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024,
+	0x00e6, 0x2058, 0xb8d4, 0xc08d, 0xb8d6, 0x9085, 0x0001, 0x00ee,
+	0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x35a5, 0x7007, 0x0003, 0x701f, 0x499e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04, 0x9294,
+	0x00ff, 0x0804, 0x5637, 0x900e, 0xa868, 0xd0f4, 0x1904, 0x3573,
+	0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x0804, 0x3573, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904, 0x4a09,
+	0x902e, 0x080c, 0xab57, 0x0130, 0x9026, 0x20a9, 0x0800, 0x2071,
+	0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071, 0x107f,
+	0x2e04, 0x9005, 0x11b8, 0x2100, 0x9406, 0x1904, 0x4a1a, 0x2428,
+	0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1558, 0x0030, 0x94ce,
+	0x0080, 0x1130, 0x92ce, 0xfffc, 0x1520, 0x93ce, 0x00ff, 0x1508,
+	0xc5fd, 0x0480, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11e8, 0xbe14,
+	0x2600, 0x9206, 0x11c8, 0x2400, 0x9106, 0x1180, 0xd884, 0x0598,
+	0xd894, 0x1588, 0x080c, 0x6a0b, 0x1570, 0x2001, 0x4000, 0x0460,
+	0x080c, 0x6a6b, 0x1540, 0x2001, 0x4000, 0x0430, 0x2001, 0x4007,
+	0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106, 0x1158, 0xbe14,
+	0x87ff, 0x1128, 0x86ff, 0x0918, 0x080c, 0xab57, 0x1900, 0x2001,
+	0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x49d0, 0x85ff, 0x1130,
+	0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, 0x080c, 0x65c4,
+	0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e, 0x00de, 0x00ee,
+	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c,
+	0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904, 0x35a8, 0x9096,
+	0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x35a8, 0x2010, 0x2918,
+	0x080c, 0x3181, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007,
+	0x0003, 0x701f, 0x4a5c, 0x0005, 0xa830, 0x9086, 0x0100, 0x1904,
+	0x3573, 0x2009, 0x0004, 0x0804, 0x35a5, 0x7984, 0x080c, 0xab57,
+	0x1120, 0x9182, 0x007f, 0x0a04, 0x35a8, 0x9186, 0x00ff, 0x0904,
+	0x35a8, 0x9182, 0x0800, 0x1a04, 0x35a8, 0x2001, 0x9000, 0x080c,
+	0x5692, 0x1904, 0x35a5, 0x0804, 0x3573, 0xa998, 0x080c, 0xab57,
+	0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff, 0x0168, 0x9182,
+	0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x5692, 0x11a8, 0x0060,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a, 0x0c48, 0x080c,
+	0x103a, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005, 0x1120, 0x2900,
+	0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086, 0x2040, 0x2900,
+	0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005, 0x7984, 0x080c,
+	0x6625, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208,
+	0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6625, 0x1130, 0xae9c,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005,
+	0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6625, 0x1108, 0x0008,
+	0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff, 0x0128, 0x2148,
+	0xa904, 0x080c, 0x106c, 0x0cc8, 0x7116, 0x711a, 0x001e, 0x0005,
+	0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44,
+	0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
+	0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x3573, 0x0005, 0x00f6,
+	0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x18b0, 0x2004,
+	0x9005, 0x1190, 0x0e04, 0x4b24, 0x7a36, 0x7833, 0x0012, 0x7a82,
+	0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11d6, 0x0804, 0x4b8a, 0x0016, 0x0086, 0x0096, 0x00c6,
+	0x00e6, 0x2071, 0x189e, 0x7044, 0x9005, 0x1540, 0x7148, 0x9182,
+	0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x103a, 0x0904, 0x4b82,
+	0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002, 0x9080, 0x1e55,
+	0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004, 0x2001, 0x18ba,
+	0x9c82, 0x18fa, 0x0210, 0x2061, 0x18ba, 0x2c00, 0x703a, 0x7148,
+	0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460, 0x7148, 0x8108,
+	0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016, 0x908a, 0x0036,
+	0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa146,
+	0x1520, 0x080c, 0x103a, 0x1130, 0x8109, 0xa946, 0x7148, 0x8109,
+	0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046, 0x2800, 0xa802,
+	0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080, 0x1e55, 0x2005,
+	0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce, 0x009e,
+	0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082, 0x001b,
+	0x0002, 0x4bac, 0x4bac, 0x4bae, 0x4bac, 0x4bac, 0x4bac, 0x4bb2,
+	0x4bac, 0x4bac, 0x4bac, 0x4bb6, 0x4bac, 0x4bac, 0x4bac, 0x4bba,
+	0x4bac, 0x4bac, 0x4bac, 0x4bbe, 0x4bac, 0x4bac, 0x4bac, 0x4bc2,
+	0x4bac, 0x4bac, 0x4bac, 0x4bc7, 0x080c, 0x0d7d, 0xa276, 0xa37a,
+	0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296, 0xa39a,
+	0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6, 0xa3ba,
+	0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4b85, 0xa2d6,
+	0xa3da, 0xa4de, 0x0804, 0x4b85, 0x00e6, 0x2071, 0x189e, 0x7048,
+	0x9005, 0x0904, 0x4c5e, 0x0126, 0x2091, 0x8000, 0x0e04, 0x4c5d,
+	0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086, 0x0076, 0x9006,
+	0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948, 0x2105, 0x0016,
+	0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108, 0x2105,
+	0x9005, 0xa94a, 0x1904, 0x4c60, 0xa804, 0x9005, 0x090c, 0x0d7d,
+	0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001, 0x0002, 0x9080,
+	0x1e55, 0x2005, 0xa04a, 0x0804, 0x4c60, 0x703c, 0x2060, 0x2c14,
+	0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833, 0x0012, 0x7882,
+	0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11d6, 0x87ff, 0x0118, 0x2748, 0x080c,
+	0x106c, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170, 0x7040, 0x2048,
+	0x9005, 0x0128, 0x080c, 0x106c, 0x9006, 0x7042, 0x7046, 0x703b,
+	0x18ba, 0x703f, 0x18ba, 0x0420, 0x7040, 0x9005, 0x1508, 0x7238,
+	0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa, 0x18fa, 0x0210,
+	0x2001, 0x18ba, 0x703e, 0x00a0, 0x9006, 0x703e, 0x703a, 0x7044,
+	0x9005, 0x090c, 0x0d7d, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
+	0x7042, 0x2001, 0x0002, 0x9080, 0x1e55, 0x2005, 0xa84a, 0x0000,
+	0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005,
+	0x2c00, 0x9082, 0x001b, 0x0002, 0x4c7f, 0x4c7f, 0x4c81, 0x4c7f,
+	0x4c7f, 0x4c7f, 0x4c86, 0x4c7f, 0x4c7f, 0x4c7f, 0x4c8b, 0x4c7f,
+	0x4c7f, 0x4c7f, 0x4c90, 0x4c7f, 0x4c7f, 0x4c7f, 0x4c95, 0x4c7f,
+	0x4c7f, 0x4c7f, 0x4c9a, 0x4c7f, 0x4c7f, 0x4c7f, 0x4c9f, 0x080c,
+	0x0d7d, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x4c0b, 0xaa84, 0xab88,
+	0xac8c, 0x0804, 0x4c0b, 0xaa94, 0xab98, 0xac9c, 0x0804, 0x4c0b,
+	0xaaa4, 0xaba8, 0xacac, 0x0804, 0x4c0b, 0xaab4, 0xabb8, 0xacbc,
+	0x0804, 0x4c0b, 0xaac4, 0xabc8, 0xaccc, 0x0804, 0x4c0b, 0xaad4,
+	0xabd8, 0xacdc, 0x0804, 0x4c0b, 0x0016, 0x0026, 0x0036, 0x00b6,
+	0x00c6, 0x2009, 0x007e, 0x080c, 0x6625, 0x2019, 0x0001, 0xb85c,
+	0xd0ac, 0x0110, 0x2019, 0x0000, 0x2011, 0x801b, 0x080c, 0x4b07,
+	0x00ce, 0x00be, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x080c,
+	0x56da, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x4b07, 0x002e,
+	0x0005, 0x81ff, 0x1904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x6030,
+	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x74e9, 0x1158, 0x080c,
+	0x77ed, 0x080c, 0x6029, 0x9085, 0x0001, 0x080c, 0x7530, 0x080c,
+	0x741a, 0x0010, 0x080c, 0x5ee4, 0x012e, 0x0804, 0x3573, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c, 0x56ee, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x35a5, 0x080c, 0x6a63, 0x0120, 0x2009,
+	0x0008, 0x0804, 0x35a5, 0x080c, 0x3363, 0x0128, 0x7984, 0x080c,
+	0x65c4, 0x1904, 0x35a8, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x2b00,
+	0x7026, 0x080c, 0x6a6b, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158,
+	0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3573, 0x080c, 0x4aa7, 0x0904, 0x35a5, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca6a, 0x0904,
+	0x35a5, 0x7888, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x7007,
+	0x0003, 0x701f, 0x4d80, 0x0005, 0x2061, 0x1800, 0x080c, 0x56ee,
+	0x2009, 0x0007, 0x1578, 0x080c, 0x6a63, 0x0118, 0x2009, 0x0008,
+	0x0448, 0x080c, 0x3363, 0x0120, 0xa998, 0x080c, 0x65c4, 0x1530,
+	0x080c, 0x4ad8, 0x0518, 0x080c, 0x6a6b, 0xa89c, 0x1168, 0x9084,
+	0x0005, 0x1150, 0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c,
+	0xca6a, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0xa99a, 0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x5637,
+	0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3573, 0x080c, 0x56ee, 0x0120, 0x2009, 0x0007,
+	0x0804, 0x35a5, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c,
+	0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0x900e, 0x2130,
+	0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005,
+	0x702a, 0x20a0, 0x080c, 0x6625, 0x1904, 0x4e22, 0x080c, 0x6a6b,
+	0x0138, 0x080c, 0x6a73, 0x0120, 0x080c, 0x6a0b, 0x1904, 0x4e22,
+	0xd794, 0x1110, 0xd784, 0x01a8, 0xb8c4, 0x20e0, 0xb8c8, 0x9080,
+	0x0006, 0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003,
+	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x48a9,
+	0x0048, 0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
+	0x080c, 0x48a9, 0x9186, 0x007e, 0x0170, 0x9186, 0x0080, 0x0158,
+	0x080c, 0x6a6b, 0x90c2, 0x0006, 0x1210, 0xc1fd, 0x0020, 0x080c,
+	0x6914, 0x1108, 0xc1fd, 0x4104, 0xc1fc, 0xd794, 0x0528, 0xb8c4,
+	0x20e0, 0xb8c8, 0x2060, 0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002,
+	0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80,
+	0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0,
+	0x3d00, 0x20e0, 0x080c, 0x489c, 0x9c80, 0x0026, 0x2098, 0xb8c4,
+	0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b,
+	0x96b0, 0x0005, 0x8108, 0x080c, 0xab57, 0x0118, 0x9186, 0x0800,
+	0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018, 0x9186,
+	0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686,
+	0x0028, 0x0150, 0x0804, 0x4db2, 0x86ff, 0x1120, 0x7124, 0x810b,
+	0x0804, 0x3573, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600, 0x7026,
+	0x772e, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034,
+	0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x1124, 0x7007, 0x0002, 0x701f, 0x4e5e, 0x0005, 0x7030, 0x9005,
+	0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8,
+	0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x0804,
+	0x4db2, 0x7124, 0x810b, 0x0804, 0x3573, 0x2029, 0x007e, 0x7984,
+	0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020,
+	0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9184, 0x00ff, 0x90e2,
+	0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9284, 0xff00,
+	0x8007, 0x90e2, 0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8,
+	0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04,
+	0x35a8, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x35a8,
+	0x9502, 0x0a04, 0x35a8, 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04,
+	0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9484, 0xff00, 0x8007, 0x90e2,
+	0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9484, 0x00ff,
+	0x90e2, 0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x2061,
+	0x1989, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x3573, 0x080c,
+	0x4aa7, 0x0904, 0x35a5, 0x2009, 0x0016, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af0, 0x701f,
+	0x4ee2, 0x0005, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071,
+	0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x20a9, 0x0016, 0x896e,
+	0x8d6e, 0x8d6f, 0x9d84, 0xffc0, 0x9080, 0x0019, 0x2098, 0x9d84,
+	0x003f, 0x20e0, 0x2069, 0x1877, 0x20e9, 0x0001, 0x2da0, 0x4003,
+	0x6800, 0x9005, 0x0904, 0x4f63, 0x6804, 0x2008, 0x918c, 0xfff8,
+	0x1904, 0x4f63, 0x680c, 0x9005, 0x0904, 0x4f63, 0x9082, 0xff01,
+	0x1a04, 0x4f63, 0x6810, 0x9082, 0x005c, 0x0a04, 0x4f63, 0x6824,
+	0x2008, 0x9082, 0x0008, 0x0a04, 0x4f63, 0x9182, 0x0400, 0x1a04,
+	0x4f63, 0x0056, 0x2029, 0x0000, 0x080c, 0x8d0a, 0x005e, 0x6944,
+	0x6820, 0x9102, 0x06c0, 0x6820, 0x9082, 0x0019, 0x16a0, 0x6828,
+	0x6944, 0x810c, 0x9102, 0x0678, 0x6840, 0x9082, 0x000f, 0x1658,
+	0x080c, 0x1053, 0x2900, 0x0904, 0x4f7d, 0x684e, 0x00e6, 0x2071,
+	0x1930, 0x00b6, 0x2059, 0x0000, 0x080c, 0x8bc6, 0x00be, 0x00ee,
+	0x0558, 0x080c, 0x8920, 0x080c, 0x8966, 0x11e0, 0x6857, 0x0000,
+	0x00c6, 0x2061, 0x0100, 0x6104, 0x918d, 0x2000, 0x6106, 0x6b10,
+	0x2061, 0x1a6b, 0x630a, 0x00ce, 0x080c, 0x2713, 0x2001, 0x0138,
+	0x2102, 0x0804, 0x3573, 0x080c, 0x2713, 0x2001, 0x0138, 0x2102,
+	0x0804, 0x35a8, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8d9b, 0x080c,
+	0x8daa, 0x080c, 0x8bb5, 0x00ee, 0x2001, 0x188a, 0x204c, 0x080c,
+	0x106c, 0x2001, 0x188a, 0x2003, 0x0000, 0x080c, 0x2713, 0x2001,
+	0x0138, 0x2102, 0x0804, 0x35a5, 0x2001, 0x1924, 0x200c, 0x918e,
+	0x0000, 0x0904, 0x4fdc, 0x080c, 0x8bb0, 0x0904, 0x4fdc, 0x2001,
+	0x0101, 0x200c, 0x918c, 0xdfff, 0x2102, 0x2001, 0x0138, 0x2003,
+	0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee,
+	0x080c, 0x8bb5, 0x2001, 0x0035, 0x080c, 0x1679, 0x00c6, 0x2061,
+	0x193c, 0x6004, 0x6100, 0x9106, 0x1de0, 0x00ce, 0x080c, 0x2713,
+	0x2001, 0x0138, 0x2102, 0x00e6, 0x00f6, 0x2071, 0x1923, 0x080c,
+	0x8af1, 0x0120, 0x2f00, 0x080c, 0x8b7b, 0x0cc8, 0x00fe, 0x00ee,
+	0x0126, 0x2091, 0x8000, 0x2001, 0x188a, 0x200c, 0x81ff, 0x0138,
+	0x2148, 0x080c, 0x106c, 0x2001, 0x188a, 0x2003, 0x0000, 0x2001,
+	0x183d, 0x2003, 0x0020, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8d9b,
+	0x080c, 0x8daa, 0x00ee, 0x012e, 0x0804, 0x3573, 0x0006, 0x080c,
+	0x56da, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0xd0bc,
+	0x000e, 0x0005, 0x6174, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986,
+	0x0804, 0x3573, 0x83ff, 0x1904, 0x35a8, 0x2001, 0xfff0, 0x9200,
+	0x1a04, 0x35a8, 0x2019, 0xffff, 0x6078, 0x9302, 0x9200, 0x0a04,
+	0x35a8, 0x7986, 0x6276, 0x0804, 0x3573, 0x080c, 0x56ee, 0x1904,
+	0x35a5, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4aa7, 0x0904,
+	0x35a5, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036,
+	0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
+	0x8bff, 0x0178, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1148,
+	0x20a9, 0x0001, 0xb814, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
+	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0170,
+	0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x9166, 0x2208, 0x0804, 0x3573, 0x7033, 0x0001, 0x7122, 0x7024,
+	0x9300, 0x7026, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa37a,
+	0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x505f, 0x0005, 0x7030,
+	0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8,
+	0x2061, 0x18b8, 0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804,
+	0x501d, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x9166, 0x2208,
+	0x0804, 0x3573, 0x00f6, 0x00e6, 0x080c, 0x56ee, 0x2009, 0x0007,
+	0x1904, 0x50f2, 0x2071, 0x189e, 0x745c, 0x84ff, 0x2009, 0x000e,
+	0x1904, 0x50f2, 0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c,
+	0x1053, 0x2009, 0x0002, 0x0904, 0x50f2, 0x2900, 0x705e, 0x900e,
+	0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003,
+	0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1148, 0xb814, 0x20a9, 0x0001,
+	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
+	0x0800, 0x0120, 0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0,
+	0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x9166, 0x2208, 0x009e,
+	0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c, 0x0d7d, 0x2148,
+	0x080c, 0x106c, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0x0418,
+	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0x2061, 0x18b9,
+	0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064, 0xa072, 0xa48e, 0xa592,
+	0xa696, 0xa79a, 0xa09f, 0x50fe, 0x000e, 0xa0a2, 0x080c, 0x1124,
+	0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0,
+	0x904d, 0x090c, 0x0d7d, 0x00e6, 0x2071, 0x189e, 0xa06c, 0x908e,
+	0x0100, 0x0138, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002,
+	0x00d8, 0x7060, 0x9005, 0x1158, 0x7150, 0x7058, 0x20a0, 0x901e,
+	0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0428, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x7254, 0x900e, 0x2001,
+	0x0003, 0x080c, 0x9166, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0d7d,
+	0x2148, 0x080c, 0x106c, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0xa09f, 0x0000, 0xa0a3,
+	0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff,
+	0x0178, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1148, 0xb814,
+	0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003,
+	0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0518, 0x0c20,
+	0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a, 0xa897, 0x4000, 0x715c,
+	0x81ff, 0x090c, 0x0d7d, 0x2148, 0x080c, 0x106c, 0x9006, 0x705e,
+	0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6d80, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070,
+	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e,
+	0xa592, 0xa696, 0xa79a, 0x080c, 0x1124, 0x9006, 0x00ee, 0x0005,
+	0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130,
+	0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x35a8, 0xa884, 0xa988,
+	0x080c, 0x25fb, 0x1518, 0x080c, 0x65c4, 0x1500, 0x7126, 0xbe12,
+	0xbd16, 0xae7c, 0x080c, 0x4aa7, 0x01c8, 0x080c, 0x4aa7, 0x01b0,
+	0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000,
+	0xa804, 0x2048, 0x080c, 0xc9e8, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x35a5, 0x7007, 0x0003, 0x701f, 0x51cb, 0x0005, 0x009e, 0x2009,
+	0x0002, 0x0804, 0x35a5, 0x7124, 0x080c, 0x32fc, 0xa820, 0x9086,
+	0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x35a5, 0x2900, 0x7022,
+	0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098,
+	0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb7, 0xaa6c,
+	0xab70, 0xac74, 0xad78, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000,
+	0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100, 0x1148,
+	0x96c2, 0x0004, 0x0600, 0x2009, 0x0004, 0x000e, 0x007e, 0x0804,
+	0x4af3, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e,
+	0x007e, 0x2061, 0x18b8, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x1124, 0x7007, 0x0002,
+	0x701f, 0x5227, 0x0005, 0x000e, 0x007e, 0x0804, 0x35a8, 0x7020,
+	0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0,
+	0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb7, 0x2100, 0x2238,
+	0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009,
+	0x002a, 0x0804, 0x4af3, 0x81ff, 0x1904, 0x35a5, 0x798c, 0x2001,
+	0x197e, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abe, 0x0904, 0x35a8,
+	0x080c, 0x6a6b, 0x0120, 0x080c, 0x6a73, 0x1904, 0x35a8, 0x080c,
+	0x66ec, 0x0904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x080c, 0x6881,
+	0x012e, 0x0904, 0x35a5, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1904,
+	0x3573, 0x0804, 0x4548, 0xa9a0, 0x2001, 0x197e, 0x918c, 0x8000,
+	0xc18d, 0x2102, 0x080c, 0x4acb, 0x01a0, 0x080c, 0x6a6b, 0x0118,
+	0x080c, 0x6a73, 0x1170, 0x080c, 0x66ec, 0x2009, 0x0002, 0x0128,
+	0x080c, 0x6881, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a,
 	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
-	0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x359e,
-	0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x568b, 0x001e,
-	0x1904, 0x359e, 0x0804, 0x356c, 0x00f6, 0x2d78, 0x0011, 0x00fe,
-	0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998, 0x9284, 0x1000,
-	0xc0fd, 0x080c, 0x568b, 0x001e, 0x9085, 0x0001, 0x0005, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x359e, 0x080c, 0x56e7, 0x0120,
-	0x2009, 0x0007, 0x0804, 0x359e, 0x7984, 0x7ea8, 0x96b4, 0x00ff,
-	0x080c, 0x661e, 0x1904, 0x35a1, 0x9186, 0x007f, 0x0138, 0x080c,
-	0x6a5b, 0x0120, 0x2009, 0x0009, 0x0804, 0x359e, 0x080c, 0x4aa0,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x359e, 0xa867, 0x0000, 0xa868,
-	0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a, 0x080c, 0xc9fd,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x359e, 0x7007, 0x0003, 0x701f,
-	0x54c2, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100, 0x1120, 0x2009,
-	0x0004, 0x0804, 0x359e, 0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084,
-	0x00ff, 0x800c, 0xa814, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9080,
-	0x0002, 0x9108, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
-	0x4aec, 0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002, 0x0804, 0x359e,
-	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
-	0x7023, 0x19b3, 0x0040, 0x92c6, 0x0001, 0x1118, 0x7023, 0x19cd,
-	0x0010, 0x0804, 0x35a1, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4ae9, 0x701f,
-	0x5512, 0x0005, 0x2001, 0x182e, 0x2003, 0x0001, 0xa85c, 0x9080,
-	0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0,
-	0x20e9, 0x0001, 0x4003, 0x0804, 0x356c, 0x080c, 0x4aa0, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x359e, 0x7984, 0x9194, 0xff00, 0x918c,
-	0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x19b3, 0x0040, 0x92c6,
-	0x0001, 0x1118, 0x2099, 0x19cd, 0x0010, 0x0804, 0x35a1, 0xa85c,
-	0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1,
-	0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x4aec, 0x7884, 0x908a,
-	0x1000, 0x1a04, 0x35a1, 0x0126, 0x2091, 0x8000, 0x8003, 0x800b,
-	0x810b, 0x9108, 0x00c6, 0x2061, 0x1a03, 0x6142, 0x00ce, 0x012e,
-	0x0804, 0x356c, 0x00c6, 0x080c, 0x74d5, 0x1160, 0x080c, 0x77d9,
-	0x080c, 0x6022, 0x9085, 0x0001, 0x080c, 0x751c, 0x080c, 0x7406,
-	0x080c, 0x0d7d, 0x2061, 0x1800, 0x6030, 0xc09d, 0x6032, 0x080c,
-	0x5edd, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800, 0x2004, 0x908e,
-	0x0000, 0x0904, 0x359e, 0x7884, 0x9005, 0x0188, 0x7888, 0x2061,
-	0x199c, 0x2c0c, 0x2062, 0x080c, 0x29d8, 0x01a0, 0x080c, 0x29e0,
-	0x0188, 0x080c, 0x29e8, 0x0170, 0x2162, 0x0804, 0x35a1, 0x2061,
-	0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009, 0x0001, 0x0010,
-	0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1588, 0x2061, 0x0100,
-	0x6028, 0xc09c, 0x602a, 0x080c, 0xa872, 0x0026, 0x2011, 0x0003,
-	0x080c, 0xa1ab, 0x2011, 0x0002, 0x080c, 0xa1b5, 0x002e, 0x080c,
-	0xa074, 0x0036, 0x901e, 0x080c, 0xa0f4, 0x003e, 0x080c, 0xa88e,
-	0x60e3, 0x0000, 0x080c, 0xe6d7, 0x080c, 0xe6f2, 0x9085, 0x0001,
-	0x080c, 0x751c, 0x9006, 0x080c, 0x2a0a, 0x2001, 0x1800, 0x2003,
-	0x0004, 0x0026, 0x2011, 0x0008, 0x080c, 0x2a44, 0x002e, 0x00ce,
-	0x0804, 0x356c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x359e,
-	0x080c, 0x56e7, 0x0120, 0x2009, 0x0007, 0x0804, 0x359e, 0x7984,
-	0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x661e, 0x1904, 0x35a1, 0x9186,
-	0x007f, 0x0138, 0x080c, 0x6a5b, 0x0120, 0x2009, 0x0009, 0x0804,
-	0x359e, 0x080c, 0x4aa0, 0x1120, 0x2009, 0x0002, 0x0804, 0x359e,
-	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca00, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x359e, 0x7007, 0x0003, 0x701f, 0x5619,
-	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
-	0x359e, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c, 0xa85c, 0x9080,
-	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x4aec,
-	0xa898, 0x9086, 0x000d, 0x1904, 0x359e, 0x2021, 0x4005, 0x0126,
-	0x2091, 0x8000, 0x0e04, 0x563d, 0x0010, 0x012e, 0x0cc0, 0x7c36,
-	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
-	0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e,
-	0x080c, 0x4adc, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x11d6, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000,
-	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061, 0x1a03,
-	0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009, 0x7898,
-	0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c, 0x605e, 0x2001,
-	0x1a11, 0x2044, 0x2001, 0x1a18, 0xa076, 0xa060, 0xa072, 0xa07b,
-	0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce,
-	0x012e, 0x0804, 0x356c, 0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6,
-	0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xc861, 0x000e, 0x1198,
-	0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d, 0x0160, 0x080c,
-	0x603c, 0x080c, 0xab33, 0x0110, 0xb817, 0x0000, 0x9006, 0x00ce,
-	0x00be, 0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091,
-	0x8000, 0x0156, 0x2010, 0x900e, 0x20a9, 0x0800, 0x0016, 0x9180,
-	0x1000, 0x2004, 0x9005, 0x0180, 0x9186, 0x007e, 0x0168, 0x9186,
-	0x007f, 0x0150, 0x9186, 0x0080, 0x0138, 0x9186, 0x00ff, 0x0120,
-	0x0026, 0x2200, 0x0801, 0x002e, 0x001e, 0x8108, 0x1f04, 0x56b6,
-	0x015e, 0x012e, 0x0005, 0x2001, 0x1848, 0x2004, 0x0005, 0x2001,
-	0x1867, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4,
-	0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016, 0x00e6, 0x2071,
-	0x189e, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e, 0x0005, 0x79a4,
-	0x9182, 0x0081, 0x1a04, 0x35a1, 0x810c, 0x0016, 0x080c, 0x4aa0,
-	0x080c, 0x0f42, 0x2100, 0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90,
-	0x001e, 0x080c, 0x4ae9, 0x701f, 0x570e, 0x0005, 0x2079, 0x0000,
-	0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c, 0x2061, 0x18b8,
-	0x2c44, 0xa770, 0xa074, 0x2071, 0x189e, 0x080c, 0x4aec, 0x701f,
-	0x5722, 0x0005, 0x2061, 0x18b8, 0x2c44, 0x0016, 0x0026, 0xa270,
-	0xa174, 0x080c, 0x0f4a, 0x002e, 0x001e, 0x080c, 0x0ff7, 0x9006,
-	0xa802, 0xa806, 0x0804, 0x356c, 0x0126, 0x0156, 0x0136, 0x0146,
-	0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100,
-	0x2069, 0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084,
-	0x0118, 0x080c, 0x58dd, 0x0068, 0xd08c, 0x0118, 0x080c, 0x57e6,
-	0x0040, 0xd094, 0x0118, 0x080c, 0x57b6, 0x0018, 0xd09c, 0x0108,
-	0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e,
-	0x013e, 0x015e, 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110,
-	0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006, 0x7098, 0x9005, 0x000e,
-	0x0120, 0x709b, 0x0000, 0x7093, 0x0000, 0x624c, 0x9286, 0xf0f0,
-	0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090,
-	0x6043, 0x0010, 0x0490, 0x9294, 0xff00, 0x9296, 0xf700, 0x0178,
-	0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100, 0x6242, 0x9294,
-	0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x5f9e, 0x00f0, 0x6040,
-	0x9084, 0x0010, 0x9085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7087,
-	0x0000, 0x70a3, 0x0001, 0x70c7, 0x0000, 0x70df, 0x0000, 0x2009,
-	0x1d80, 0x200b, 0x0000, 0x7097, 0x0000, 0x708b, 0x000f, 0x2009,
-	0x000f, 0x2011, 0x5e80, 0x080c, 0x86d7, 0x0005, 0x2001, 0x1869,
-	0x2004, 0xd08c, 0x0110, 0x705f, 0xffff, 0x7088, 0x9005, 0x1528,
-	0x2011, 0x5e80, 0x080c, 0x860d, 0x6040, 0x9094, 0x0010, 0x9285,
-	0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04,
-	0x57cc, 0x6242, 0x709b, 0x0000, 0x6040, 0x9094, 0x0010, 0x9285,
-	0x0080, 0x6042, 0x6242, 0x0048, 0x6242, 0x709b, 0x0000, 0x708f,
-	0x0000, 0x9006, 0x080c, 0x6027, 0x0000, 0x0005, 0x708c, 0x908a,
-	0x0003, 0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x57f0, 0x5841, 0x58dc,
-	0x00f6, 0x0016, 0x6900, 0x918c, 0x0800, 0x708f, 0x0001, 0x2001,
-	0x015d, 0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800,
-	0x9084, 0x00fc, 0x0120, 0x1f04, 0x57ff, 0x080c, 0x0d7d, 0x68a0,
-	0x68a2, 0x689c, 0x689e, 0x6898, 0x689a, 0xa001, 0x918d, 0x1600,
-	0x6902, 0x001e, 0x6837, 0x0020, 0x080c, 0x6003, 0x2079, 0x1d00,
-	0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001, 0x2099, 0x1805,
-	0x20e9, 0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004, 0x4003, 0x080c,
-	0xa66c, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x600f, 0x0000,
-	0x080c, 0x5eb1, 0x00fe, 0x9006, 0x7092, 0x6043, 0x0008, 0x6042,
-	0x0005, 0x00f6, 0x7090, 0x7093, 0x0000, 0x9025, 0x0904, 0x58b9,
-	0x6020, 0xd0b4, 0x1904, 0x58b7, 0x71a0, 0x81ff, 0x0904, 0x58a5,
-	0x9486, 0x000c, 0x1904, 0x58b2, 0x9480, 0x0018, 0x8004, 0x20a8,
-	0x080c, 0x5ffc, 0x2011, 0x0260, 0x2019, 0x1d00, 0x220c, 0x2304,
-	0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, 0x585e, 0x6043, 0x0004,
-	0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100,
-	0x6043, 0x0006, 0x708f, 0x0002, 0x709b, 0x0002, 0x2009, 0x07d0,
-	0x2011, 0x5e87, 0x080c, 0x86d7, 0x080c, 0x6003, 0x04c0, 0x080c,
-	0x5ffc, 0x2079, 0x0260, 0x7930, 0x918e, 0x1101, 0x1558, 0x7834,
-	0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, 0x1118, 0x7804, 0x9005,
-	0x0190, 0x080c, 0x5ffc, 0x2011, 0x026e, 0x2019, 0x1805, 0x20a9,
-	0x0004, 0x220c, 0x2304, 0x9102, 0x0230, 0x11a0, 0x8210, 0x8318,
-	0x1f04, 0x5899, 0x0078, 0x70a3, 0x0000, 0x080c, 0x5ffc, 0x20e1,
-	0x0000, 0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x20a9,
-	0x0014, 0x4003, 0x6043, 0x0008, 0x6043, 0x0000, 0x0010, 0x00fe,
-	0x0005, 0x6040, 0x9085, 0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8,
-	0x080c, 0xa66c, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x2011,
-	0x19f4, 0x2013, 0x0000, 0x7093, 0x0000, 0x60a3, 0x0056, 0x60a7,
-	0x9575, 0x080c, 0x9e01, 0x08d8, 0x0005, 0x7098, 0x908a, 0x001d,
-	0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x590e, 0x5921, 0x594a, 0x596a,
-	0x5990, 0x59bf, 0x59e5, 0x5a1d, 0x5a43, 0x5a71, 0x5aac, 0x5ae4,
-	0x5b02, 0x5b2d, 0x5b4f, 0x5b6a, 0x5b74, 0x5ba8, 0x5bce, 0x5bfd,
-	0x5c23, 0x5c5b, 0x5c9f, 0x5cdc, 0x5cfd, 0x5d56, 0x5d78, 0x5da6,
-	0x5da6, 0x00c6, 0x2061, 0x1800, 0x6003, 0x0007, 0x2061, 0x0100,
-	0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140,
-	0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002,
-	0x709b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x5e87, 0x080c, 0x86d7,
-	0x0005, 0x00f6, 0x7090, 0x9086, 0x0014, 0x1510, 0x6042, 0x6020,
-	0xd0b4, 0x11f0, 0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1102, 0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128,
-	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x2011, 0x5e87, 0x080c,
-	0x860d, 0x709b, 0x0010, 0x080c, 0x5b74, 0x0010, 0x7093, 0x0000,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0003, 0x6043, 0x0004, 0x2011,
-	0x5e87, 0x080c, 0x860d, 0x080c, 0x5f80, 0x2079, 0x0240, 0x7833,
-	0x1102, 0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b,
-	0x0000, 0x8108, 0x1f04, 0x595f, 0x60c3, 0x0014, 0x080c, 0x5eb1,
-	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e87,
-	0x080c, 0x860d, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ffc, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160,
-	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x709b, 0x0004, 0x0029, 0x0010, 0x080c, 0x5fd8, 0x00fe, 0x0005,
-	0x00f6, 0x709b, 0x0005, 0x080c, 0x5f80, 0x2079, 0x0240, 0x7833,
-	0x1103, 0x7837, 0x0000, 0x080c, 0x5ffc, 0x080c, 0x5fdf, 0x1170,
-	0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011,
-	0x0008, 0x080c, 0x5e34, 0x0168, 0x080c, 0x5fb5, 0x20a9, 0x0008,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb1, 0x00fe, 0x0005, 0x00f6,
-	0x7090, 0x9005, 0x0500, 0x2011, 0x5e87, 0x080c, 0x860d, 0x9086,
-	0x0014, 0x11b8, 0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0006, 0x0029,
-	0x0010, 0x080c, 0x5fd8, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0007,
-	0x080c, 0x5f80, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000,
-	0x080c, 0x5ffc, 0x080c, 0x5fdf, 0x11b8, 0x7084, 0x9005, 0x11a0,
-	0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x336d, 0x200d, 0x918c,
-	0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5e34, 0x0180, 0x080c,
-	0x4fdd, 0x0110, 0x080c, 0x2664, 0x20a9, 0x0008, 0x20e1, 0x0000,
-	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
-	0x0014, 0x080c, 0x5eb1, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
-	0x0500, 0x2011, 0x5e87, 0x080c, 0x860d, 0x9086, 0x0014, 0x11b8,
-	0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178,
-	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
-	0x1110, 0x70c7, 0x0001, 0x709b, 0x0008, 0x0029, 0x0010, 0x080c,
-	0x5fd8, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0009, 0x080c, 0x5f80,
-	0x2079, 0x0240, 0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x5fdf,
-	0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5da7, 0x1188, 0x9085,
-	0x0001, 0x080c, 0x2664, 0x20a9, 0x0008, 0x080c, 0x5ffc, 0x20e1,
+	0x0005, 0xa897, 0x4000, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1128,
+	0x080c, 0x56e2, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904,
+	0x44bd, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x4aa7, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x35a5, 0x080c, 0x6a6b, 0x0130, 0x908e,
+	0x0004, 0x0118, 0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120,
+	0xb800, 0xc08c, 0xb802, 0x0028, 0x080c, 0x56da, 0xd0b4, 0x0904,
+	0x44f7, 0x7884, 0x908e, 0x007e, 0x0904, 0x44f7, 0x908e, 0x007f,
+	0x0904, 0x44f7, 0x908e, 0x0080, 0x0904, 0x44f7, 0xb800, 0xd08c,
+	0x1904, 0x44f7, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xca07, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007, 0x0003,
+	0x701f, 0x52f3, 0x0005, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x0804,
+	0x44f7, 0x080c, 0x3363, 0x0108, 0x0005, 0x2009, 0x1834, 0x210c,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c, 0x56ee,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x35a5, 0x080c, 0x6a63, 0x0120,
+	0x2009, 0x0008, 0x0804, 0x35a5, 0xb89c, 0xd0a4, 0x1118, 0xd0ac,
+	0x1904, 0x44f7, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xca6a, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007,
+	0x0003, 0x701f, 0x532c, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120,
+	0x2009, 0x0004, 0x0804, 0x5637, 0x080c, 0x4ada, 0x0904, 0x35a8,
+	0x0804, 0x52c5, 0x81ff, 0x2009, 0x0001, 0x1904, 0x35a5, 0x080c,
+	0x56ee, 0x2009, 0x0007, 0x1904, 0x35a5, 0x080c, 0x6a63, 0x0120,
+	0x2009, 0x0008, 0x0804, 0x35a5, 0x080c, 0x4ada, 0x0904, 0x35a8,
+	0x080c, 0x6a6b, 0x2009, 0x0009, 0x1904, 0x35a5, 0x080c, 0x4aa7,
+	0x2009, 0x0002, 0x0904, 0x35a5, 0x9006, 0xa866, 0xa832, 0xa868,
+	0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00, 0x918c, 0x00ff, 0x9006,
+	0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038, 0x928e,
+	0x0100, 0x1904, 0x35a8, 0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c,
+	0xcccd, 0x2009, 0x0003, 0x0904, 0x35a5, 0x7007, 0x0003, 0x701f,
+	0x5382, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904,
+	0x35a5, 0x0804, 0x3573, 0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec,
+	0x01a0, 0x080c, 0x56ee, 0x1188, 0x2009, 0x0014, 0x0804, 0x35a5,
+	0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001, 0x1904, 0x35a5, 0x080c,
+	0x56ee, 0x2009, 0x0007, 0x1904, 0x35a5, 0xd2f4, 0x0130, 0x9284,
+	0x5000, 0x080c, 0x56b5, 0x0804, 0x3573, 0xd2fc, 0x0158, 0x080c,
+	0x4ada, 0x0904, 0x35a8, 0x7984, 0x9284, 0x9000, 0x080c, 0x5692,
+	0x0804, 0x3573, 0x080c, 0x4ada, 0x0904, 0x35a8, 0xb804, 0x9084,
+	0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904, 0x546b, 0x080c,
+	0x4aa7, 0x2009, 0x0002, 0x0904, 0x546b, 0xa85c, 0x9080, 0x001b,
+	0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c,
+	0x4af0, 0x701f, 0x53dc, 0x0005, 0xa86c, 0x9086, 0x0500, 0x1138,
+	0xa870, 0x9005, 0x1120, 0xa874, 0x9084, 0xff00, 0x0110, 0x1904,
+	0x35a8, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0x4ada,
+	0x1110, 0x0804, 0x35a8, 0x2009, 0x0043, 0x080c, 0xcd35, 0x2009,
+	0x0003, 0x0904, 0x546b, 0x7007, 0x0003, 0x701f, 0x5400, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x546b, 0x7984,
+	0x7aa8, 0x9284, 0x1000, 0x080c, 0x5692, 0x0804, 0x3573, 0x00c6,
+	0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c, 0x56ee,
+	0x1150, 0x2009, 0x0014, 0x04f0, 0x2061, 0x1800, 0x080c, 0x56ee,
+	0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c,
+	0x56b5, 0x0050, 0xd2fc, 0x0178, 0x080c, 0x4ad8, 0x0588, 0xa998,
+	0x9284, 0x9000, 0x080c, 0x5692, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0x0438, 0x080c, 0x4ad8, 0x0510, 0x080c, 0x6a6b,
+	0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8,
+	0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c, 0x4ad8,
+	0x1108, 0x0070, 0x2009, 0x004b, 0x080c, 0xcd35, 0x2009, 0x0003,
+	0x0108, 0x0078, 0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010,
+	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ce,
+	0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x35a5, 0x0016,
+	0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5692, 0x001e, 0x1904,
+	0x35a5, 0x0804, 0x3573, 0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005,
+	0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd,
+	0x080c, 0x5692, 0x001e, 0x9085, 0x0001, 0x0005, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x35a5, 0x080c, 0x56ee, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x35a5, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
+	0x6625, 0x1904, 0x35a8, 0x9186, 0x007f, 0x0138, 0x080c, 0x6a6b,
+	0x0120, 0x2009, 0x0009, 0x0804, 0x35a5, 0x080c, 0x4aa7, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x35a5, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a, 0x080c, 0xca21, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x35a5, 0x7007, 0x0003, 0x701f, 0x54c9,
+	0x0005, 0xa808, 0x8007, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004,
+	0x0804, 0x35a5, 0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084, 0x00ff,
+	0x800c, 0xa814, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0002,
+	0x9108, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af3,
+	0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0x7984,
+	0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023,
+	0x19b3, 0x0040, 0x92c6, 0x0001, 0x1118, 0x7023, 0x19cd, 0x0010,
+	0x0804, 0x35a8, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af0, 0x701f, 0x5519,
+	0x0005, 0x2001, 0x182e, 0x2003, 0x0001, 0xa85c, 0x9080, 0x0019,
+	0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9,
+	0x0001, 0x4003, 0x0804, 0x3573, 0x080c, 0x4aa7, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x35a5, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff,
+	0x8217, 0x82ff, 0x1118, 0x2099, 0x19b3, 0x0040, 0x92c6, 0x0001,
+	0x1118, 0x2099, 0x19cd, 0x0010, 0x0804, 0x35a8, 0xa85c, 0x9080,
+	0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001,
+	0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x0804, 0x4af3, 0x7884, 0x908a, 0x1000,
+	0x1a04, 0x35a8, 0x0126, 0x2091, 0x8000, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x00c6, 0x2061, 0x1a03, 0x6142, 0x00ce, 0x012e, 0x0804,
+	0x3573, 0x00c6, 0x080c, 0x74e9, 0x1160, 0x080c, 0x77ed, 0x080c,
+	0x6029, 0x9085, 0x0001, 0x080c, 0x7530, 0x080c, 0x741a, 0x080c,
+	0x0d7d, 0x2061, 0x1800, 0x6030, 0xc09d, 0x6032, 0x080c, 0x5ee4,
+	0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800, 0x2004, 0x908e, 0x0000,
+	0x0904, 0x35a5, 0x7884, 0x9005, 0x0188, 0x7888, 0x2061, 0x199c,
+	0x2c0c, 0x2062, 0x080c, 0x29d8, 0x01a0, 0x080c, 0x29e0, 0x0188,
+	0x080c, 0x29e8, 0x0170, 0x2162, 0x0804, 0x35a8, 0x2061, 0x0100,
+	0x6038, 0x9086, 0x0007, 0x1118, 0x2009, 0x0001, 0x0010, 0x2009,
+	0x0000, 0x7884, 0x9086, 0x0002, 0x1588, 0x2061, 0x0100, 0x6028,
+	0xc09c, 0x602a, 0x080c, 0xa896, 0x0026, 0x2011, 0x0003, 0x080c,
+	0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x002e, 0x080c, 0xa098,
+	0x0036, 0x901e, 0x080c, 0xa118, 0x003e, 0x080c, 0xa8b2, 0x60e3,
+	0x0000, 0x080c, 0xe702, 0x080c, 0xe71d, 0x9085, 0x0001, 0x080c,
+	0x7530, 0x9006, 0x080c, 0x2a0a, 0x2001, 0x1800, 0x2003, 0x0004,
+	0x0026, 0x2011, 0x0008, 0x080c, 0x2a44, 0x002e, 0x00ce, 0x0804,
+	0x3573, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c,
+	0x56ee, 0x0120, 0x2009, 0x0007, 0x0804, 0x35a5, 0x7984, 0x7ea8,
+	0x96b4, 0x00ff, 0x080c, 0x6625, 0x1904, 0x35a8, 0x9186, 0x007f,
+	0x0138, 0x080c, 0x6a6b, 0x0120, 0x2009, 0x0009, 0x0804, 0x35a5,
+	0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca24, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x35a5, 0x7007, 0x0003, 0x701f, 0x5620, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x35a5,
+	0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c, 0xa85c, 0x9080, 0x000c,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x4af3, 0xa898,
+	0x9086, 0x000d, 0x1904, 0x35a5, 0x2021, 0x4005, 0x0126, 0x2091,
+	0x8000, 0x0e04, 0x5644, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486,
+	0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7883,
+	0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c,
+	0x4ae3, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x11d6, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061, 0x1a03, 0x7984,
+	0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009, 0x7898, 0x606a,
+	0x789c, 0x6066, 0x7888, 0x6062, 0x788c, 0x605e, 0x2001, 0x1a11,
+	0x2044, 0x2001, 0x1a18, 0xa076, 0xa060, 0xa072, 0xa07b, 0x0001,
+	0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e,
+	0x0804, 0x3573, 0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4,
+	0xc000, 0x0128, 0x0006, 0x080c, 0xc885, 0x000e, 0x1198, 0xd0e4,
+	0x0160, 0x9180, 0x1000, 0x2004, 0x905d, 0x0160, 0x080c, 0x6043,
+	0x080c, 0xab57, 0x0110, 0xb817, 0x0000, 0x9006, 0x00ce, 0x00be,
+	0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000,
+	0x0156, 0x2010, 0x900e, 0x20a9, 0x0800, 0x0016, 0x9180, 0x1000,
+	0x2004, 0x9005, 0x0180, 0x9186, 0x007e, 0x0168, 0x9186, 0x007f,
+	0x0150, 0x9186, 0x0080, 0x0138, 0x9186, 0x00ff, 0x0120, 0x0026,
+	0x2200, 0x0801, 0x002e, 0x001e, 0x8108, 0x1f04, 0x56bd, 0x015e,
+	0x012e, 0x0005, 0x2001, 0x1848, 0x2004, 0x0005, 0x2001, 0x1867,
+	0x2004, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e,
+	0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x0005, 0x0016, 0x00e6, 0x2071, 0x189e,
+	0x7108, 0x910d, 0x710a, 0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182,
+	0x0081, 0x1a04, 0x35a8, 0x810c, 0x0016, 0x080c, 0x4aa7, 0x080c,
+	0x0f42, 0x2100, 0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e,
+	0x080c, 0x4af0, 0x701f, 0x5715, 0x0005, 0x2079, 0x0000, 0x7d94,
+	0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44,
+	0xa770, 0xa074, 0x2071, 0x189e, 0x080c, 0x4af3, 0x701f, 0x5729,
+	0x0005, 0x2061, 0x18b8, 0x2c44, 0x0016, 0x0026, 0xa270, 0xa174,
+	0x080c, 0x0f4a, 0x002e, 0x001e, 0x080c, 0x0ff7, 0x9006, 0xa802,
+	0xa806, 0x0804, 0x3573, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069,
+	0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118,
+	0x080c, 0x58e4, 0x0068, 0xd08c, 0x0118, 0x080c, 0x57ed, 0x0040,
+	0xd094, 0x0118, 0x080c, 0x57bd, 0x0018, 0xd09c, 0x0108, 0x0099,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
+	0x015e, 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d,
+	0x612a, 0x001e, 0x0c68, 0x0006, 0x7098, 0x9005, 0x000e, 0x0120,
+	0x709b, 0x0000, 0x7093, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150,
+	0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x0490, 0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138,
+	0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010,
+	0x0128, 0x2009, 0x00f7, 0x080c, 0x5fa5, 0x00f0, 0x6040, 0x9084,
+	0x0010, 0x9085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7087, 0x0000,
+	0x70a3, 0x0001, 0x70c7, 0x0000, 0x70df, 0x0000, 0x2009, 0x1d80,
+	0x200b, 0x0000, 0x7097, 0x0000, 0x708b, 0x000f, 0x2009, 0x000f,
+	0x2011, 0x5e87, 0x080c, 0x8708, 0x0005, 0x2001, 0x1869, 0x2004,
+	0xd08c, 0x0110, 0x705f, 0xffff, 0x7088, 0x9005, 0x1528, 0x2011,
+	0x5e87, 0x080c, 0x863e, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020,
+	0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x57d3,
+	0x6242, 0x709b, 0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080,
+	0x6042, 0x6242, 0x0048, 0x6242, 0x709b, 0x0000, 0x708f, 0x0000,
+	0x9006, 0x080c, 0x602e, 0x0000, 0x0005, 0x708c, 0x908a, 0x0003,
+	0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x57f7, 0x5848, 0x58e3, 0x00f6,
+	0x0016, 0x6900, 0x918c, 0x0800, 0x708f, 0x0001, 0x2001, 0x015d,
+	0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084,
+	0x00fc, 0x0120, 0x1f04, 0x5806, 0x080c, 0x0d7d, 0x68a0, 0x68a2,
+	0x689c, 0x689e, 0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902,
+	0x001e, 0x6837, 0x0020, 0x080c, 0x600a, 0x2079, 0x1d00, 0x7833,
+	0x1101, 0x7837, 0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0xa690,
+	0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c,
+	0x5eb8, 0x00fe, 0x9006, 0x7092, 0x6043, 0x0008, 0x6042, 0x0005,
+	0x00f6, 0x7090, 0x7093, 0x0000, 0x9025, 0x0904, 0x58c0, 0x6020,
+	0xd0b4, 0x1904, 0x58be, 0x71a0, 0x81ff, 0x0904, 0x58ac, 0x9486,
+	0x000c, 0x1904, 0x58b9, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c,
+	0x6003, 0x2011, 0x0260, 0x2019, 0x1d00, 0x220c, 0x2304, 0x9106,
+	0x11e8, 0x8210, 0x8318, 0x1f04, 0x5865, 0x6043, 0x0004, 0x2061,
+	0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043,
+	0x0006, 0x708f, 0x0002, 0x709b, 0x0002, 0x2009, 0x07d0, 0x2011,
+	0x5e8e, 0x080c, 0x8708, 0x080c, 0x600a, 0x04c0, 0x080c, 0x6003,
+	0x2079, 0x0260, 0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005,
+	0x1540, 0x7900, 0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190,
+	0x080c, 0x6003, 0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004,
+	0x220c, 0x2304, 0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04,
+	0x58a0, 0x0078, 0x70a3, 0x0000, 0x080c, 0x6003, 0x20e1, 0x0000,
+	0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x20a9, 0x0014,
+	0x4003, 0x6043, 0x0008, 0x6043, 0x0000, 0x0010, 0x00fe, 0x0005,
+	0x6040, 0x9085, 0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c,
+	0xa690, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19f4,
+	0x2013, 0x0000, 0x7093, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575,
+	0x080c, 0x9e25, 0x08d8, 0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c,
+	0x0d7d, 0x000b, 0x0005, 0x5915, 0x5928, 0x5951, 0x5971, 0x5997,
+	0x59c6, 0x59ec, 0x5a24, 0x5a4a, 0x5a78, 0x5ab3, 0x5aeb, 0x5b09,
+	0x5b34, 0x5b56, 0x5b71, 0x5b7b, 0x5baf, 0x5bd5, 0x5c04, 0x5c2a,
+	0x5c62, 0x5ca6, 0x5ce3, 0x5d04, 0x5d5d, 0x5d7f, 0x5dad, 0x5dad,
+	0x00c6, 0x2061, 0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004,
+	0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b,
+	0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x709b,
+	0x0001, 0x2009, 0x07d0, 0x2011, 0x5e8e, 0x080c, 0x8708, 0x0005,
+	0x00f6, 0x7090, 0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4,
+	0x11f0, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
+	0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
+	0x9005, 0x1110, 0x70c7, 0x0001, 0x2011, 0x5e8e, 0x080c, 0x863e,
+	0x709b, 0x0010, 0x080c, 0x5b7b, 0x0010, 0x7093, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x0003, 0x6043, 0x0004, 0x2011, 0x5e8e,
+	0x080c, 0x863e, 0x080c, 0x5f87, 0x2079, 0x0240, 0x7833, 0x1102,
+	0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000,
+	0x8108, 0x1f04, 0x5966, 0x60c3, 0x0014, 0x080c, 0x5eb8, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e8e, 0x080c,
+	0x863e, 0x9086, 0x0014, 0x11b8, 0x080c, 0x6003, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x0004, 0x0029, 0x0010, 0x080c, 0x5fdf, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0005, 0x080c, 0x5f87, 0x2079, 0x0240, 0x7833, 0x1103,
+	0x7837, 0x0000, 0x080c, 0x6003, 0x080c, 0x5fe6, 0x1170, 0x7084,
+	0x9005, 0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008,
+	0x080c, 0x5e3b, 0x0168, 0x080c, 0x5fbc, 0x20a9, 0x0008, 0x20e1,
 	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
-	0x60c3, 0x0014, 0x080c, 0x5eb1, 0x0010, 0x080c, 0x5901, 0x00fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x05a8, 0x2011, 0x5e87, 0x080c,
-	0x860d, 0x9086, 0x0014, 0x1560, 0x080c, 0x5ffc, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1105, 0x1520, 0x7834, 0x9084, 0x0100, 0x2011,
-	0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
-	0x1110, 0x70c7, 0x0001, 0x709b, 0x000a, 0x00b1, 0x0098, 0x9005,
-	0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
-	0x0001, 0x7097, 0x0000, 0x709b, 0x000e, 0x080c, 0x5b4f, 0x0010,
-	0x080c, 0x5fd8, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x000b, 0x2011,
-	0x1d0e, 0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff,
-	0x4304, 0x080c, 0x5f80, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837,
-	0x0000, 0x080c, 0x5fdf, 0x0118, 0x2013, 0x0000, 0x0020, 0x7060,
-	0x9085, 0x0100, 0x2012, 0x20a9, 0x0040, 0x2009, 0x024e, 0x2011,
-	0x1d0e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810,
-	0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x5ad1, 0x60c3, 0x0084,
-	0x080c, 0x5eb1, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01c0,
-	0x2011, 0x5e87, 0x080c, 0x860d, 0x9086, 0x0084, 0x1178, 0x080c,
-	0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834,
-	0x9005, 0x1120, 0x709b, 0x000c, 0x0029, 0x0010, 0x080c, 0x5fd8,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x000d, 0x080c, 0x5f80, 0x2079,
-	0x0240, 0x7833, 0x1107, 0x7837, 0x0000, 0x080c, 0x5ffc, 0x20a9,
-	0x0040, 0x2011, 0x026e, 0x2009, 0x024e, 0x220e, 0x8210, 0x8108,
-	0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
-	0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5b15, 0x60c3,
-	0x0084, 0x080c, 0x5eb1, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
-	0x01e0, 0x2011, 0x5e87, 0x080c, 0x860d, 0x9086, 0x0084, 0x1198,
-	0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158,
-	0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5f52, 0x709b,
-	0x000e, 0x0029, 0x0010, 0x080c, 0x5fd8, 0x00fe, 0x0005, 0x918d,
-	0x0001, 0x080c, 0x6027, 0x709b, 0x000f, 0x7093, 0x0000, 0x2061,
-	0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043,
-	0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x5e87, 0x080c,
-	0x8601, 0x0005, 0x7090, 0x9005, 0x0130, 0x2011, 0x5e87, 0x080c,
-	0x860d, 0x709b, 0x0000, 0x0005, 0x709b, 0x0011, 0x080c, 0xa66c,
-	0x080c, 0x5ffc, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084,
-	0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c, 0x5fdf, 0x11a0, 0x717c,
-	0x81ff, 0x0188, 0x900e, 0x7080, 0x9084, 0x00ff, 0x0160, 0x080c,
-	0x25fb, 0x9186, 0x007e, 0x0138, 0x9186, 0x0080, 0x0120, 0x2011,
-	0x0008, 0x080c, 0x5e34, 0x60c3, 0x0014, 0x080c, 0x5eb1, 0x0005,
-	0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e87, 0x080c, 0x860d,
-	0x9086, 0x0014, 0x11b8, 0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0012,
-	0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b,
-	0x0013, 0x080c, 0x5f8e, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837,
-	0x0000, 0x080c, 0x5ffc, 0x080c, 0x5fdf, 0x1170, 0x7084, 0x9005,
-	0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c,
-	0x5e34, 0x0168, 0x080c, 0x5fb5, 0x20a9, 0x0008, 0x20e1, 0x0000,
+	0x60c3, 0x0014, 0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x0500, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0014,
+	0x11b8, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103,
+	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
+	0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0006, 0x0029, 0x0010,
+	0x080c, 0x5fdf, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0007, 0x080c,
+	0x5f87, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c,
+	0x6003, 0x080c, 0x5fe6, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164,
+	0x9186, 0xffff, 0x0180, 0x9180, 0x3374, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2011, 0x0008, 0x080c, 0x5e3b, 0x0180, 0x080c, 0x4fe4,
+	0x0110, 0x080c, 0x2664, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x0008, 0x0029, 0x0010, 0x080c, 0x5fdf,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0009, 0x080c, 0x5f87, 0x2079,
+	0x0240, 0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x5fe6, 0x1150,
+	0x7084, 0x9005, 0x1138, 0x080c, 0x5dae, 0x1188, 0x9085, 0x0001,
+	0x080c, 0x2664, 0x20a9, 0x0008, 0x080c, 0x6003, 0x20e1, 0x0000,
 	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
-	0x0014, 0x080c, 0x5eb1, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
-	0x0500, 0x2011, 0x5e87, 0x080c, 0x860d, 0x9086, 0x0014, 0x11b8,
-	0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178,
-	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
-	0x1110, 0x70c7, 0x0001, 0x709b, 0x0014, 0x0029, 0x0010, 0x7093,
-	0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0015, 0x080c, 0x5f8e,
-	0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5ffc,
-	0x080c, 0x5fdf, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186,
-	0xffff, 0x0180, 0x9180, 0x336d, 0x200d, 0x918c, 0xff00, 0x810f,
-	0x2011, 0x0008, 0x080c, 0x5e34, 0x0180, 0x080c, 0x4fdd, 0x0110,
-	0x080c, 0x2664, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
-	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
-	0x5eb1, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x05f0, 0x2011,
-	0x5e87, 0x080c, 0x860d, 0x9086, 0x0014, 0x15a8, 0x080c, 0x5ffc,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1568, 0x7834, 0x9084,
-	0x0100, 0x2011, 0x0100, 0x921e, 0x1168, 0x9085, 0x0001, 0x080c,
-	0x6027, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
-	0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
-	0x9005, 0x1110, 0x70c7, 0x0001, 0x9085, 0x0001, 0x080c, 0x6027,
-	0x7097, 0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70df, 0x0008, 0x709b,
-	0x0016, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x080c,
-	0xa66c, 0x080c, 0x5ffc, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
-	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026d,
-	0x2204, 0x9084, 0x0100, 0x2011, 0x024d, 0x2012, 0x2011, 0x026e,
-	0x709b, 0x0017, 0x080c, 0x5fdf, 0x1150, 0x7084, 0x9005, 0x1138,
-	0x080c, 0x5da7, 0x1188, 0x9085, 0x0001, 0x080c, 0x2664, 0x20a9,
-	0x0008, 0x080c, 0x5ffc, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb1,
-	0x0010, 0x080c, 0x5901, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01d8,
-	0x2011, 0x5e87, 0x080c, 0x860d, 0x9086, 0x0084, 0x1190, 0x080c,
-	0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1150, 0x7834,
-	0x9005, 0x1138, 0x9006, 0x080c, 0x6027, 0x709b, 0x0018, 0x0029,
-	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0019,
-	0x080c, 0x5f8e, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000,
-	0x080c, 0x5ffc, 0x2009, 0x026e, 0x2039, 0x1d0e, 0x20a9, 0x0040,
-	0x213e, 0x8738, 0x8108, 0x9186, 0x0280, 0x1128, 0x6814, 0x8000,
-	0x6816, 0x2009, 0x0260, 0x1f04, 0x5d10, 0x2039, 0x1d0e, 0x080c,
-	0x5fdf, 0x11e8, 0x2728, 0x2514, 0x8207, 0x9084, 0x00ff, 0x8000,
-	0x2018, 0x9294, 0x00ff, 0x8007, 0x9205, 0x202a, 0x7060, 0x2310,
-	0x8214, 0x92a0, 0x1d0e, 0x2414, 0x938c, 0x0001, 0x0118, 0x9294,
-	0xff00, 0x0018, 0x9294, 0x00ff, 0x8007, 0x9215, 0x2222, 0x20a9,
-	0x0040, 0x2009, 0x024e, 0x270e, 0x8738, 0x8108, 0x9186, 0x0260,
-	0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x5d43,
-	0x60c3, 0x0084, 0x080c, 0x5eb1, 0x00fe, 0x0005, 0x00f6, 0x7090,
-	0x9005, 0x01e0, 0x2011, 0x5e87, 0x080c, 0x860d, 0x9086, 0x0084,
-	0x1198, 0x080c, 0x5ffc, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107,
-	0x1158, 0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5f52,
-	0x709b, 0x001a, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005,
-	0x9085, 0x0001, 0x080c, 0x6027, 0x709b, 0x001b, 0x080c, 0xa66c,
-	0x080c, 0x5ffc, 0x2011, 0x0260, 0x2009, 0x0240, 0x7490, 0x9480,
-	0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e,
-	0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812,
-	0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04,
-	0x5d8f, 0x60c3, 0x0084, 0x080c, 0x5eb1, 0x0005, 0x0005, 0x0086,
-	0x0096, 0x2029, 0x1848, 0x252c, 0x20a9, 0x0008, 0x2041, 0x1d0e,
-	0x20e9, 0x0001, 0x28a0, 0x080c, 0x5ffc, 0x20e1, 0x0000, 0x2099,
-	0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108,
-	0x9016, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4,
-	0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x5dc1, 0x0804, 0x5e30,
-	0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020,
-	0x91a6, 0x3fff, 0x0904, 0x5e30, 0x918d, 0xc000, 0x20a9, 0x0010,
-	0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4,
-	0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319,
-	0x0008, 0x8318, 0x1f04, 0x5de7, 0x04d8, 0x23a8, 0x2021, 0x0001,
-	0x8426, 0x8425, 0x1f04, 0x5df9, 0x2328, 0x8529, 0x92be, 0x0007,
-	0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a, 0x000e, 0x27a8,
-	0x95a8, 0x0010, 0x1f04, 0x5e08, 0x755e, 0x95c8, 0x336d, 0x292d,
-	0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
-	0x2644, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0x9405,
-	0x201a, 0x7087, 0x0001, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x20e1,
-	0x0001, 0x2898, 0x20a9, 0x0008, 0x4003, 0x9085, 0x0001, 0x0008,
-	0x9006, 0x009e, 0x008e, 0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x2011, 0x024e, 0x22a0, 0x4003, 0x014e, 0x013e, 0x01de, 0x01ce,
-	0x015e, 0x2118, 0x9026, 0x2001, 0x0007, 0x939a, 0x0010, 0x0218,
-	0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120, 0x939a, 0x0010,
-	0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118, 0x8423, 0x8319,
-	0x1de8, 0x9238, 0x2029, 0x026e, 0x9528, 0x2504, 0x942c, 0x11b8,
-	0x9405, 0x203a, 0x715e, 0x91a0, 0x336d, 0x242d, 0x95ac, 0x00ff,
-	0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2644, 0x001e,
-	0x60e7, 0x0000, 0x65ea, 0x7087, 0x0001, 0x9084, 0x0000, 0x0005,
-	0x00e6, 0x2071, 0x1800, 0x708b, 0x0000, 0x00ee, 0x0005, 0x00e6,
-	0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x5f41, 0x080c,
-	0x9e0e, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x1826, 0x2073, 0x0000, 0x7840, 0x0026,
-	0x0016, 0x2009, 0x00f7, 0x080c, 0x5f9e, 0x001e, 0x9094, 0x0010,
-	0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x2979, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011, 0x19f4, 0x2013, 0x0000,
-	0x7093, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c,
-	0x9e01, 0x6144, 0xd184, 0x0120, 0x7198, 0x918d, 0x2000, 0x0018,
-	0x718c, 0x918d, 0x1000, 0x2011, 0x1999, 0x2112, 0x2009, 0x07d0,
-	0x2011, 0x5e87, 0x080c, 0x86d7, 0x0005, 0x0016, 0x0026, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xa872, 0x080c, 0xab3a, 0x080c,
-	0xa88e, 0x2009, 0x00f7, 0x080c, 0x5f9e, 0x2061, 0x1a03, 0x900e,
-	0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001,
-	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1999,
-	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f0d, 0x080c, 0x8601,
-	0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x9e0e, 0x2071,
-	0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x080c,
-	0x74dd, 0x0188, 0x080c, 0x74f8, 0x1170, 0x080c, 0x77e3, 0x0016,
-	0x080c, 0x2713, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x77de,
-	0x080c, 0x7406, 0x0050, 0x2009, 0x0001, 0x080c, 0x29f6, 0x2001,
-	0x0001, 0x080c, 0x25a0, 0x080c, 0x5edd, 0x012e, 0x000e, 0x00ee,
-	0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036,
-	0x2011, 0x8017, 0x2001, 0x1999, 0x201c, 0x080c, 0x4b00, 0x003e,
-	0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1d80,
-	0x080c, 0x5ffc, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9,
-	0x0020, 0x080c, 0x5ff6, 0x2099, 0x0260, 0x20a1, 0x1d92, 0x0051,
-	0x20a9, 0x000e, 0x080c, 0x5ff9, 0x2099, 0x0260, 0x20a1, 0x1db2,
-	0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0x5f76, 0x002e, 0x001e, 0x0005,
-	0x080c, 0xa66c, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xa66c,
-	0x080c, 0x5ffc, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006,
-	0x2061, 0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138,
-	0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185,
-	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c,
-	0x6a57, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe29e,
-	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e,
-	0x080c, 0x31a3, 0x080c, 0xcf2e, 0x0140, 0x0036, 0x2019, 0xffff,
-	0x2021, 0x0007, 0x080c, 0x4cb7, 0x003e, 0x004e, 0x001e, 0x0005,
-	0x080c, 0x5edd, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005, 0x0006,
-	0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d,
-	0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001,
-	0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0,
-	0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006,
-	0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x4004, 0x2079,
-	0x1d00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813,
-	0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e,
-	0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001,
-	0x19a6, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005,
-	0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108,
-	0x1f04, 0x6036, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136,
-	0x0146, 0x2069, 0x1847, 0x9006, 0xb802, 0xb8d6, 0xb807, 0x0707,
-	0xb80a, 0xb80e, 0xb812, 0x9198, 0x336d, 0x231d, 0x939c, 0x00ff,
-	0xbb16, 0x0016, 0x0026, 0xb886, 0x080c, 0xab33, 0x1120, 0x9192,
-	0x007e, 0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8,
-	0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198,
-	0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb8ce,
-	0xb8d2, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100, 0xb872,
-	0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896, 0xb89a,
-	0xb89e, 0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c,
-	0x106c, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810, 0xb83a,
-	0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0198, 0x00c6,
-	0x2060, 0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004,
-	0x9c02, 0x1a0c, 0x0d7d, 0x080c, 0x8b5f, 0x00ce, 0x090c, 0x8f03,
-	0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e, 0x013e,
-	0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000, 0xa974,
-	0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x6112, 0x9182,
-	0x0800, 0x1a04, 0x6116, 0x2001, 0x180c, 0x2004, 0x9084, 0x0003,
-	0x1904, 0x611c, 0x9188, 0x1000, 0x2104, 0x905d, 0x0198, 0xb804,
-	0x9084, 0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4, 0x900d, 0x1904,
-	0x612e, 0x080c, 0x64e7, 0x9006, 0x012e, 0x0005, 0x2001, 0x0005,
-	0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082, 0x0006,
-	0x1290, 0x080c, 0xab33, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140,
-	0xb900, 0xd1fc, 0x0d10, 0x2001, 0x0029, 0x2009, 0x1000, 0x0408,
-	0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118,
-	0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004, 0x0040,
-	0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009, 0x1000, 0x0048,
-	0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001, 0x0029,
-	0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd084,
-	0x19d0, 0x9188, 0x1000, 0x2104, 0x9065, 0x09a8, 0x080c, 0x6a5b,
-	0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x60d5, 0x080c, 0x6889,
-	0x0904, 0x60de, 0x0804, 0x60d9, 0x00e6, 0x2071, 0x19e7, 0x7004,
-	0x9086, 0x0002, 0x1128, 0x7030, 0x9080, 0x0004, 0x2004, 0x9b06,
-	0x00ee, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa874,
-	0x908e, 0x00ff, 0x1120, 0x2001, 0x196b, 0x205c, 0x0060, 0xa974,
-	0x9182, 0x0800, 0x1690, 0x9188, 0x1000, 0x2104, 0x905d, 0x01d0,
-	0x080c, 0x69fb, 0x11d0, 0x080c, 0xab73, 0x0570, 0x2b00, 0x6012,
-	0x2900, 0x6016, 0x6023, 0x0009, 0x602b, 0x0000, 0xa874, 0x908e,
-	0x00ff, 0x1110, 0x602b, 0x8000, 0x2009, 0x0043, 0x080c, 0xac68,
-	0x9006, 0x00b0, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0010, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029, 0x9005,
-	0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0, 0x00b6,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04,
-	0x620a, 0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x61e2, 0xb8a0,
-	0x9086, 0x007f, 0x0178, 0x080c, 0x6a63, 0x0160, 0xa994, 0x81ff,
-	0x0130, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c,
-	0x6a5b, 0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8,
-	0x2060, 0x0026, 0x2010, 0x080c, 0xc802, 0x002e, 0x1120, 0x2001,
-	0x0008, 0x0804, 0x620c, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001,
-	0x0008, 0x0804, 0x620c, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016,
-	0x0058, 0x080c, 0xab73, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016,
-	0x600b, 0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0xac68,
-	0x9006, 0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290,
-	0x080c, 0xab33, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900,
-	0xd1fc, 0x0900, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001,
-	0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
-	0x0004, 0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001,
-	0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be,
-	0x0005, 0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091,
-	0x8000, 0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630,
-	0xa8c8, 0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974,
-	0x2079, 0x1800, 0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003,
-	0x1130, 0xaa98, 0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c,
-	0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005,
-	0x012e, 0x00be, 0x00fe, 0x0005, 0x62a1, 0x625c, 0x6273, 0x62a1,
-	0x62a1, 0x62a1, 0x62a1, 0x62a1, 0x2100, 0x9082, 0x007e, 0x1278,
-	0x080c, 0x65bd, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x62a9,
-	0xb814, 0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c,
-	0x49b3, 0x0150, 0x04b0, 0x080c, 0x661e, 0x1598, 0xb810, 0x9306,
-	0x1580, 0xb814, 0x9206, 0x1568, 0x080c, 0xab73, 0x0530, 0x2b00,
-	0x6012, 0x080c, 0xcca8, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023,
-	0x000a, 0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x31e4, 0x9006,
-	0x080c, 0x655a, 0x2001, 0x0002, 0x080c, 0x656e, 0x2001, 0x0200,
-	0xb86e, 0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0xac68, 0x9006,
-	0x0068, 0x2001, 0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e,
-	0x0018, 0x2001, 0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be,
-	0x00fe, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000,
-	0xa894, 0x90c6, 0x0015, 0x0904, 0x6490, 0x90c6, 0x0056, 0x0904,
-	0x6494, 0x90c6, 0x0066, 0x0904, 0x6498, 0x90c6, 0x0067, 0x0904,
-	0x649c, 0x90c6, 0x0068, 0x0904, 0x64a0, 0x90c6, 0x0071, 0x0904,
-	0x64a4, 0x90c6, 0x0074, 0x0904, 0x64a8, 0x90c6, 0x007c, 0x0904,
-	0x64ac, 0x90c6, 0x007e, 0x0904, 0x64b0, 0x90c6, 0x0037, 0x0904,
-	0x64b4, 0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904,
-	0x648b, 0x9182, 0x0800, 0x1a04, 0x648b, 0x080c, 0x661e, 0x1198,
-	0xb804, 0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6,
-	0x006f, 0x0148, 0x080c, 0xab33, 0x1904, 0x6474, 0xb8a0, 0x9084,
-	0xff80, 0x1904, 0x6474, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6,
-	0x005e, 0x0904, 0x63d4, 0x90c6, 0x0064, 0x0904, 0x63fd, 0x2008,
-	0x0804, 0x6396, 0xa998, 0xa8b0, 0x2040, 0x080c, 0xab33, 0x1120,
-	0x9182, 0x007f, 0x0a04, 0x6396, 0x9186, 0x00ff, 0x0904, 0x6396,
-	0x9182, 0x0800, 0x1a04, 0x6396, 0xaaa0, 0xab9c, 0x787c, 0x9306,
-	0x1188, 0x7880, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e,
-	0x0804, 0x6396, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310,
-	0x0804, 0x6396, 0x080c, 0x49b3, 0x0904, 0x63a0, 0x900e, 0x9016,
-	0x90c6, 0x4000, 0x15e0, 0x0006, 0x080c, 0x690d, 0x1108, 0xc185,
-	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080,
-	0x0006, 0x2098, 0x080c, 0x0fb7, 0x20a9, 0x0004, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080,
-	0x000a, 0x2098, 0x080c, 0x0fb7, 0xa8c4, 0xabc8, 0x9305, 0xabcc,
-	0x9305, 0xabd0, 0x9305, 0xabd4, 0x9305, 0xabd8, 0x9305, 0xabdc,
-	0x9305, 0xabe0, 0x9305, 0x9005, 0x0510, 0x000e, 0x00c8, 0x90c6,
-	0x4007, 0x1110, 0x2408, 0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708,
-	0x2610, 0x0070, 0x90c6, 0x4009, 0x1108, 0x0050, 0x90c6, 0x4006,
-	0x0138, 0x2001, 0x4005, 0x2009, 0x000a, 0x0010, 0x2001, 0x4006,
-	0xa896, 0xa99a, 0xaa9e, 0x2001, 0x0030, 0x900e, 0x0478, 0x000e,
-	0x080c, 0xab73, 0x1130, 0x2001, 0x4005, 0x2009, 0x0003, 0x9016,
-	0x0c78, 0x2b00, 0x6012, 0x080c, 0xcca8, 0x2900, 0x6016, 0x6023,
-	0x0001, 0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x31e4, 0x012e, 0x9006, 0x080c, 0x655a, 0x2001,
-	0x0002, 0x080c, 0x656e, 0x2009, 0x0002, 0x080c, 0xac68, 0xa8b0,
-	0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x9006, 0x9005, 0x012e,
-	0x00ee, 0x00fe, 0x00be, 0x0005, 0x080c, 0x56e7, 0x0118, 0x2009,
-	0x0007, 0x00f8, 0xa998, 0xaeb0, 0x080c, 0x661e, 0x1904, 0x6391,
-	0x9186, 0x007f, 0x0130, 0x080c, 0x6a5b, 0x0118, 0x2009, 0x0009,
-	0x0080, 0x0096, 0x080c, 0x103a, 0x1120, 0x009e, 0x2009, 0x0002,
-	0x0040, 0x2900, 0x009e, 0xa806, 0x080c, 0xca00, 0x19b0, 0x2009,
-	0x0003, 0x2001, 0x4005, 0x0804, 0x6398, 0xa998, 0xaeb0, 0x080c,
-	0x661e, 0x1904, 0x6391, 0x0096, 0x080c, 0x103a, 0x1128, 0x009e,
-	0x2009, 0x0002, 0x0804, 0x6451, 0x2900, 0x009e, 0xa806, 0x0096,
-	0x2048, 0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008,
-	0x9080, 0x0006, 0x20a0, 0xbbc8, 0x9398, 0x0006, 0x2398, 0x080c,
-	0x0fb7, 0x009e, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0xd684, 0x1168, 0x080c, 0x56d3, 0xd0b4, 0x1118, 0xa89b, 0x000b,
-	0x00e0, 0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c,
-	0x6a5b, 0x0118, 0xa89b, 0x0009, 0x0080, 0x080c, 0x56e7, 0x0118,
-	0xa89b, 0x0007, 0x0050, 0x080c, 0xc9e3, 0x1904, 0x63cd, 0x2009,
-	0x0003, 0x2001, 0x4005, 0x0804, 0x6398, 0xa87b, 0x0030, 0xa897,
-	0x4005, 0xa804, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8,
-	0xada4, 0x2031, 0x0000, 0x2041, 0x127e, 0x080c, 0xb0ee, 0x1904,
-	0x63cd, 0x2009, 0x0002, 0x08e8, 0x2001, 0x0028, 0x900e, 0x0804,
-	0x63ce, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
-	0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029,
-	0x900e, 0x0804, 0x63ce, 0x2001, 0x0029, 0x900e, 0x0804, 0x63ce,
-	0x080c, 0x3790, 0x0804, 0x63cf, 0x080c, 0x5408, 0x0804, 0x63cf,
-	0x080c, 0x456c, 0x0804, 0x63cf, 0x080c, 0x45e5, 0x0804, 0x63cf,
-	0x080c, 0x4641, 0x0804, 0x63cf, 0x080c, 0x4a76, 0x0804, 0x63cf,
-	0x080c, 0x4d2d, 0x0804, 0x63cf, 0x080c, 0x5073, 0x0804, 0x63cf,
-	0x080c, 0x526c, 0x0804, 0x63cf, 0x080c, 0x39ae, 0x0804, 0x63cf,
-	0x00b6, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1608,
-	0x9182, 0x0800, 0x1258, 0x9188, 0x1000, 0x2104, 0x905d, 0x0130,
-	0x080c, 0x6a5b, 0x1138, 0x00d9, 0x9006, 0x00b0, 0x2001, 0x0028,
-	0x900e, 0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d98,
-	0x2001, 0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e,
-	0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0xa877,
-	0x0000, 0xb8d0, 0x9005, 0x1904, 0x654e, 0xb888, 0x9005, 0x1904,
-	0x654e, 0xb838, 0xb93c, 0x9102, 0x1a04, 0x654e, 0x2b10, 0x080c,
-	0xaba0, 0x0904, 0x654a, 0x8108, 0xb93e, 0x6212, 0x2900, 0x6016,
-	0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878, 0x605e,
-	0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac,
-	0x0588, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1530, 0xa816, 0xa864,
-	0x9094, 0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084, 0x00ff, 0xc0bd,
-	0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x000f, 0x8001,
-	0x1df0, 0x2001, 0x8004, 0x6003, 0x0004, 0x6046, 0x00f6, 0x2079,
-	0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010, 0x2c00, 0x7836,
-	0x781b, 0x8080, 0x00fe, 0x0005, 0x080c, 0x1731, 0x601c, 0xc0bd,
-	0x601e, 0x0c38, 0xd0b4, 0x190c, 0x1c30, 0x2001, 0x8004, 0x6003,
-	0x0002, 0x0c18, 0x81ff, 0x1110, 0xb88b, 0x0001, 0x2908, 0xb8cc,
-	0xb9ce, 0x9005, 0x1110, 0xb9d2, 0x0020, 0x0096, 0x2048, 0xa902,
-	0x009e, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000,
-	0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008, 0xc284,
-	0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126,
-	0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086,
-	0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x6a57, 0x0140,
-	0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600,
-	0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086, 0x0006,
-	0x1120, 0xba90, 0x82ff, 0x090c, 0x0d7d, 0x000e, 0x00ce, 0x012e,
-	0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210,
-	0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c, 0xd0a4,
-	0x0150, 0x080c, 0x6a53, 0x1138, 0x9284, 0x00ff, 0x9086, 0x0007,
-	0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007, 0x9215,
-	0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800, 0x0218,
-	0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000, 0x2204,
-	0x905d, 0x1188, 0x0096, 0x080c, 0x103a, 0x2958, 0x009e, 0x0168,
-	0x2b00, 0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006, 0xb8a6,
-	0xb8ae, 0x080c, 0x603c, 0x9006, 0x0010, 0x9085, 0x0001, 0x002e,
-	0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000, 0x0026,
-	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6, 0x9190,
-	0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d,
-	0x0110, 0x080c, 0x106c, 0x00d6, 0x00c6, 0xb8bc, 0x2060, 0x8cff,
-	0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xc814, 0x0110,
-	0x080c, 0x0fec, 0x080c, 0xabc9, 0x00ce, 0x0c88, 0x00ce, 0x00de,
-	0x2b48, 0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x107c, 0x00de,
-	0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016, 0x9182,
-	0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000, 0x2104,
-	0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136,
-	0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c,
-	0x74d5, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0xab33,
-	0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1982,
-	0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e,
-	0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001,
-	0x6886, 0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048, 0xb862,
-	0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4, 0x20e8,
-	0xb8c8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099,
-	0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069,
-	0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048,
-	0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0,
-	0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211, 0x1218,
-	0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009, 0x0007,
-	0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0x9182,
-	0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421, 0x1218,
-	0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009, 0x0003,
-	0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e, 0x00de,
-	0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034, 0xb896,
-	0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbd4, 0xc384, 0xba00,
-	0x2009, 0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad,
-	0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc,
-	0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbd6,
-	0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126, 0x2091,
-	0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04,
-	0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906,
-	0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080,
-	0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002, 0x9086,
-	0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0d7d, 0x3c00, 0x20e8,
-	0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce,
-	0x014e, 0x013e, 0x0060, 0x080c, 0x103a, 0x0170, 0x2900, 0xb8a6,
-	0xa803, 0x0000, 0x080c, 0x68a9, 0xa807, 0x0001, 0xae12, 0x9085,
-	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091,
-	0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150,
-	0x080c, 0x68b8, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001,
-	0xa806, 0x0020, 0x080c, 0x106c, 0xb8a7, 0x0000, 0x009e, 0x012e,
-	0x0005, 0x0096, 0x00c6, 0xb888, 0x9005, 0x1904, 0x67a2, 0xb8d0,
-	0x904d, 0x0904, 0x67a2, 0x080c, 0xaba0, 0x0904, 0x679e, 0x8210,
-	0xba3e, 0xa800, 0xb8d2, 0x9005, 0x1108, 0xb8ce, 0x2b00, 0x6012,
-	0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040,
-	0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000,
-	0xa87c, 0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568,
-	0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x1530, 0x9084,
-	0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001,
-	0x8004, 0x6003, 0x0004, 0x0030, 0x080c, 0x1c30, 0x2001, 0x8004,
-	0x6003, 0x0002, 0x6046, 0x2001, 0x0010, 0x2c08, 0x080c, 0xa863,
-	0xb838, 0xba3c, 0x9202, 0x0a04, 0x674f, 0x0020, 0x82ff, 0x1110,
-	0xb88b, 0x0001, 0x00ce, 0x009e, 0x0005, 0x080c, 0x1731, 0x601c,
-	0xc0bd, 0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016, 0x20a9, 0x0800,
-	0x900e, 0x0016, 0x080c, 0x661e, 0x1158, 0xb8d0, 0x904d, 0x0140,
-	0x3e00, 0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1108, 0x0041,
-	0x001e, 0x8108, 0x1f04, 0x67b1, 0x001e, 0x00be, 0x009e, 0x0005,
-	0x0096, 0x0016, 0xb8d0, 0x904d, 0x0188, 0xa800, 0xb8d2, 0x9005,
-	0x1108, 0xb8ce, 0x9006, 0xa802, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0xcb12, 0x080c, 0x6d70, 0x0c60, 0x001e, 0x009e,
-	0x0005, 0x0086, 0x9046, 0xb8d0, 0x904d, 0x0198, 0xa86c, 0x9406,
-	0x1118, 0xa870, 0x9506, 0x0128, 0x2940, 0xa800, 0x904d, 0x0148,
-	0x0ca8, 0xa800, 0x88ff, 0x1110, 0xb8d2, 0x0008, 0xa002, 0xa803,
-	0x0000, 0x008e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x00e6,
-	0x0096, 0x00c6, 0x0086, 0x0026, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x19e7, 0x9046, 0x7028, 0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff,
-	0x0120, 0x605c, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118,
-	0xa870, 0x9506, 0x0120, 0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c,
-	0x0006, 0x0066, 0x2830, 0x080c, 0x9f7e, 0x006e, 0x000e, 0x83ff,
-	0x0508, 0x0c08, 0x9046, 0xb8d0, 0x904d, 0x01e0, 0x83ff, 0x0120,
-	0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870,
-	0x9506, 0x0120, 0x2940, 0xa800, 0x2048, 0x0c70, 0xb8d0, 0xaa00,
-	0x0026, 0x9906, 0x1110, 0xbad2, 0x0008, 0xa202, 0x000e, 0x83ff,
-	0x0108, 0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e, 0x00ee, 0x0005,
-	0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x690d,
-	0x0128, 0x080c, 0xc8d5, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
-	0x690d, 0x0128, 0x080c, 0xc876, 0x0010, 0x9085, 0x0001, 0x0005,
-	0x080c, 0x690d, 0x0128, 0x080c, 0xc8d2, 0x0010, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x690d, 0x0128, 0x080c, 0xc895, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x690d, 0x0128, 0x080c, 0xc916, 0x0010,
-	0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085, 0x0001,
-	0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e,
-	0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004,
-	0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128,
-	0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce, 0x013e,
-	0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0004,
-	0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de, 0x014e,
+	0x0014, 0x080c, 0x5eb8, 0x0010, 0x080c, 0x5908, 0x00fe, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x05a8, 0x2011, 0x5e8e, 0x080c, 0x863e,
+	0x9086, 0x0014, 0x1560, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1105, 0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100,
+	0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x7097, 0x0000, 0x709b, 0x000e, 0x080c, 0x5b56, 0x0010, 0x080c,
+	0x5fdf, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x000b, 0x2011, 0x1d0e,
+	0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304,
+	0x080c, 0x5f87, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000,
+	0x080c, 0x5fe6, 0x0118, 0x2013, 0x0000, 0x0020, 0x7060, 0x9085,
+	0x0100, 0x2012, 0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1d0e,
+	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000,
+	0x6812, 0x2009, 0x0240, 0x1f04, 0x5ad8, 0x60c3, 0x0084, 0x080c,
+	0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011,
+	0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1178, 0x080c, 0x6003,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005,
+	0x1120, 0x709b, 0x000c, 0x0029, 0x0010, 0x080c, 0x5fdf, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x000d, 0x080c, 0x5f87, 0x2079, 0x0240,
+	0x7833, 0x1107, 0x7837, 0x0000, 0x080c, 0x6003, 0x20a9, 0x0040,
+	0x2011, 0x026e, 0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186,
+	0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814,
+	0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5b1c, 0x60c3, 0x0084,
+	0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0,
+	0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1198, 0x080c,
+	0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834,
+	0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5f59, 0x709b, 0x000e,
+	0x0029, 0x0010, 0x080c, 0x5fdf, 0x00fe, 0x0005, 0x918d, 0x0001,
+	0x080c, 0x602e, 0x709b, 0x000f, 0x7093, 0x0000, 0x2061, 0x0140,
+	0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005,
+	0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x5e8e, 0x080c, 0x8632,
+	0x0005, 0x7090, 0x9005, 0x0130, 0x2011, 0x5e8e, 0x080c, 0x863e,
+	0x709b, 0x0000, 0x0005, 0x709b, 0x0011, 0x080c, 0xa690, 0x080c,
+	0x6003, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
+	0x8004, 0x20a8, 0x4003, 0x080c, 0x5fe6, 0x11a0, 0x717c, 0x81ff,
+	0x0188, 0x900e, 0x7080, 0x9084, 0x00ff, 0x0160, 0x080c, 0x25fb,
+	0x9186, 0x007e, 0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008,
+	0x080c, 0x5e3b, 0x60c3, 0x0014, 0x080c, 0x5eb8, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0012, 0x0029,
+	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013,
+	0x080c, 0x5f95, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000,
+	0x080c, 0x6003, 0x080c, 0x5fe6, 0x1170, 0x7084, 0x9005, 0x1158,
+	0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e3b,
+	0x0168, 0x080c, 0x5fbc, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x709b, 0x0014, 0x0029, 0x0010, 0x7093, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0015, 0x080c, 0x5f95, 0x2079,
+	0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x6003, 0x080c,
+	0x5fe6, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff,
+	0x0180, 0x9180, 0x3374, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011,
+	0x0008, 0x080c, 0x5e3b, 0x0180, 0x080c, 0x4fe4, 0x0110, 0x080c,
+	0x2664, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb8,
+	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x05f0, 0x2011, 0x5e8e,
+	0x080c, 0x863e, 0x9086, 0x0014, 0x15a8, 0x080c, 0x6003, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100,
+	0x2011, 0x0100, 0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x602e,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x9085, 0x0001, 0x080c, 0x602e, 0x7097,
+	0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70df, 0x0008, 0x709b, 0x0016,
+	0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x080c, 0xa690,
+	0x080c, 0x6003, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204,
+	0x9084, 0x0100, 0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x709b,
+	0x0017, 0x080c, 0x5fe6, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c,
+	0x5dae, 0x1188, 0x9085, 0x0001, 0x080c, 0x2664, 0x20a9, 0x0008,
+	0x080c, 0x6003, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb8, 0x0010,
+	0x080c, 0x5908, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011,
+	0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1190, 0x080c, 0x6003,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005,
+	0x1138, 0x9006, 0x080c, 0x602e, 0x709b, 0x0018, 0x0029, 0x0010,
+	0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0019, 0x080c,
+	0x5f95, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c,
+	0x6003, 0x2009, 0x026e, 0x2039, 0x1d0e, 0x20a9, 0x0040, 0x213e,
+	0x8738, 0x8108, 0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816,
+	0x2009, 0x0260, 0x1f04, 0x5d17, 0x2039, 0x1d0e, 0x080c, 0x5fe6,
+	0x11e8, 0x2728, 0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018,
+	0x9294, 0x00ff, 0x8007, 0x9205, 0x202a, 0x7060, 0x2310, 0x8214,
+	0x92a0, 0x1d0e, 0x2414, 0x938c, 0x0001, 0x0118, 0x9294, 0xff00,
+	0x0018, 0x9294, 0x00ff, 0x8007, 0x9215, 0x2222, 0x20a9, 0x0040,
+	0x2009, 0x024e, 0x270e, 0x8738, 0x8108, 0x9186, 0x0260, 0x1128,
+	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x5d4a, 0x60c3,
+	0x0084, 0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
+	0x01e0, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1198,
+	0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158,
+	0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5f59, 0x709b,
+	0x001a, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x9085,
+	0x0001, 0x080c, 0x602e, 0x709b, 0x001b, 0x080c, 0xa690, 0x080c,
+	0x6003, 0x2011, 0x0260, 0x2009, 0x0240, 0x7490, 0x9480, 0x0018,
+	0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210,
+	0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009,
+	0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5d96,
+	0x60c3, 0x0084, 0x080c, 0x5eb8, 0x0005, 0x0005, 0x0086, 0x0096,
+	0x2029, 0x1848, 0x252c, 0x20a9, 0x0008, 0x2041, 0x1d0e, 0x20e9,
+	0x0001, 0x28a0, 0x080c, 0x6003, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x4003, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016,
+	0x2800, 0x9200, 0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110,
+	0x8210, 0x0008, 0x8211, 0x1f04, 0x5dc8, 0x0804, 0x5e37, 0x82ff,
+	0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6,
+	0x3fff, 0x0904, 0x5e37, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019,
+	0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110,
+	0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008,
+	0x8318, 0x1f04, 0x5dee, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426,
+	0x8425, 0x1f04, 0x5e00, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158,
+	0x0006, 0x2039, 0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8,
+	0x0010, 0x1f04, 0x5e0f, 0x755e, 0x95c8, 0x3374, 0x292d, 0x95ac,
+	0x00ff, 0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2644,
+	0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a,
+	0x7087, 0x0001, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001,
+	0x2898, 0x20a9, 0x0008, 0x4003, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x009e, 0x008e, 0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x22a8, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x2011,
+	0x024e, 0x22a0, 0x4003, 0x014e, 0x013e, 0x01de, 0x01ce, 0x015e,
+	0x2118, 0x9026, 0x2001, 0x0007, 0x939a, 0x0010, 0x0218, 0x8420,
+	0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120, 0x939a, 0x0010, 0x8421,
+	0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8,
+	0x9238, 0x2029, 0x026e, 0x9528, 0x2504, 0x942c, 0x11b8, 0x9405,
+	0x203a, 0x715e, 0x91a0, 0x3374, 0x242d, 0x95ac, 0x00ff, 0x7582,
+	0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2644, 0x001e, 0x60e7,
+	0x0000, 0x65ea, 0x7087, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x708b, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6,
+	0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x5f48, 0x080c, 0x9e32,
+	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1826, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016,
+	0x2009, 0x00f7, 0x080c, 0x5fa5, 0x001e, 0x9094, 0x0010, 0x9285,
+	0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x2979, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c5, 0x2012, 0x2011, 0x19f4, 0x2013, 0x0000, 0x7093,
+	0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x9e25,
+	0x6144, 0xd184, 0x0120, 0x7198, 0x918d, 0x2000, 0x0018, 0x718c,
+	0x918d, 0x1000, 0x2011, 0x1999, 0x2112, 0x2009, 0x07d0, 0x2011,
+	0x5e8e, 0x080c, 0x8708, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xa896, 0x080c, 0xab5e, 0x080c, 0xa8b2,
+	0x2009, 0x00f7, 0x080c, 0x5fa5, 0x2061, 0x1a03, 0x900e, 0x611a,
+	0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061,
+	0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1999, 0x200b,
+	0x0000, 0x2009, 0x002d, 0x2011, 0x5f14, 0x080c, 0x8632, 0x012e,
+	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x9e32, 0x2071, 0x0140,
+	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x080c, 0x74f1,
+	0x0188, 0x080c, 0x750c, 0x1170, 0x080c, 0x77f7, 0x0016, 0x080c,
+	0x2713, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x77f2, 0x080c,
+	0x741a, 0x0050, 0x2009, 0x0001, 0x080c, 0x29f6, 0x2001, 0x0001,
+	0x080c, 0x25a0, 0x080c, 0x5ee4, 0x012e, 0x000e, 0x00ee, 0x0005,
+	0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011,
+	0x8017, 0x2001, 0x1999, 0x201c, 0x080c, 0x4b07, 0x003e, 0x002e,
+	0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1d80, 0x080c,
+	0x6003, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020,
+	0x080c, 0x5ffd, 0x2099, 0x0260, 0x20a1, 0x1d92, 0x0051, 0x20a9,
+	0x000e, 0x080c, 0x6000, 0x2099, 0x0260, 0x20a1, 0x1db2, 0x0009,
+	0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012,
+	0x8108, 0x8210, 0x1f04, 0x5f7d, 0x002e, 0x001e, 0x0005, 0x080c,
+	0xa690, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xa690, 0x080c,
+	0x6003, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061,
+	0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138, 0x2001,
+	0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7,
+	0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x6a67,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe2c9, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c,
+	0x31a6, 0x080c, 0xcf52, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021,
+	0x0007, 0x080c, 0x4cbe, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c,
+	0x5ee4, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005, 0x0006, 0x2001,
+	0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006,
+	0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0020,
+	0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0, 0x910d,
+	0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9,
+	0x0080, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x4004, 0x2079, 0x1d00,
+	0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138,
+	0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe,
+	0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x19a6,
+	0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156,
+	0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04,
+	0x603d, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
+	0x2069, 0x1847, 0x9006, 0xb802, 0xb8d6, 0xb807, 0x0707, 0xb80a,
+	0xb80e, 0xb812, 0x9198, 0x3374, 0x231d, 0x939c, 0x00ff, 0xbb16,
+	0x0016, 0x0026, 0xb886, 0x080c, 0xab57, 0x1120, 0x9192, 0x007e,
+	0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8, 0x9198,
+	0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a,
+	0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb8ce, 0xb8d2,
+	0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100, 0xb872, 0xb876,
+	0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896, 0xb89a, 0xb89e,
+	0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c, 0x106c,
+	0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810, 0xb83a, 0x680c,
+	0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0198, 0x00c6, 0x2060,
+	0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1a0c, 0x0d7d, 0x080c, 0x8b90, 0x00ce, 0x090c, 0x8f34, 0xb8af,
+	0x0000, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e, 0x013e, 0x015e,
+	0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000, 0xa974, 0xae78,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x6119, 0x9182, 0x0800,
+	0x1a04, 0x611d, 0x2001, 0x180c, 0x2004, 0x9084, 0x0003, 0x1904,
+	0x6123, 0x9188, 0x1000, 0x2104, 0x905d, 0x0198, 0xb804, 0x9084,
+	0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4, 0x900d, 0x1904, 0x6135,
+	0x080c, 0x64ee, 0x9006, 0x012e, 0x0005, 0x2001, 0x0005, 0x900e,
+	0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082, 0x0006, 0x1290,
+	0x080c, 0xab57, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900,
+	0xd1fc, 0x0d10, 0x2001, 0x0029, 0x2009, 0x1000, 0x0408, 0x2001,
+	0x0028, 0x00a8, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004, 0x0040, 0x2001,
+	0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009, 0x1000, 0x0048, 0x900e,
+	0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e,
+	0x9005, 0x012e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd084, 0x19d0,
+	0x9188, 0x1000, 0x2104, 0x9065, 0x09a8, 0x080c, 0x6a6b, 0x1990,
+	0xb800, 0xd0bc, 0x0978, 0x0804, 0x60dc, 0x080c, 0x6890, 0x0904,
+	0x60e5, 0x0804, 0x60e0, 0x00e6, 0x2071, 0x19e7, 0x7004, 0x9086,
+	0x0002, 0x1128, 0x7030, 0x9080, 0x0004, 0x2004, 0x9b06, 0x00ee,
+	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa874, 0x908e,
+	0x00ff, 0x1120, 0x2001, 0x196b, 0x205c, 0x0060, 0xa974, 0x9182,
+	0x0800, 0x1690, 0x9188, 0x1000, 0x2104, 0x905d, 0x01d0, 0x080c,
+	0x6a0b, 0x11d0, 0x080c, 0xab97, 0x0570, 0x2b00, 0x6012, 0x2900,
+	0x6016, 0x6023, 0x0009, 0x602b, 0x0000, 0xa874, 0x908e, 0x00ff,
+	0x1110, 0x602b, 0x8000, 0x2009, 0x0043, 0x080c, 0xac8c, 0x9006,
+	0x00b0, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0010, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e,
+	0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x6211,
+	0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x61e9, 0xb8a0, 0x9086,
+	0x007f, 0x0178, 0x080c, 0x6a73, 0x0160, 0xa994, 0x81ff, 0x0130,
+	0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6a6b,
+	0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060,
+	0x0026, 0x2010, 0x080c, 0xc826, 0x002e, 0x1120, 0x2001, 0x0008,
+	0x0804, 0x6213, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008,
+	0x0804, 0x6213, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058,
+	0x080c, 0xab97, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b,
+	0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0xac8c, 0x9006,
+	0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c,
+	0xab57, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc,
+	0x0900, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028,
+	0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
+	0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029,
+	0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000,
+	0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8,
+	0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079,
+	0x1800, 0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130,
+	0xaa98, 0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0010, 0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e,
+	0x0018, 0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e,
+	0x00be, 0x00fe, 0x0005, 0x62a8, 0x6263, 0x627a, 0x62a8, 0x62a8,
+	0x62a8, 0x62a8, 0x62a8, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c,
+	0x65c4, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x62b0, 0xb814,
+	0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x49ba,
+	0x0150, 0x04b0, 0x080c, 0x6625, 0x1598, 0xb810, 0x9306, 0x1580,
+	0xb814, 0x9206, 0x1568, 0x080c, 0xab97, 0x0530, 0x2b00, 0x6012,
+	0x080c, 0xcccc, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
+	0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x31e7, 0x9006, 0x080c,
+	0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x2001, 0x0200, 0xb86e,
+	0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0xac8c, 0x9006, 0x0068,
+	0x2001, 0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
+	0x2001, 0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe,
+	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894,
+	0x90c6, 0x0015, 0x0904, 0x6497, 0x90c6, 0x0056, 0x0904, 0x649b,
+	0x90c6, 0x0066, 0x0904, 0x649f, 0x90c6, 0x0067, 0x0904, 0x64a3,
+	0x90c6, 0x0068, 0x0904, 0x64a7, 0x90c6, 0x0071, 0x0904, 0x64ab,
+	0x90c6, 0x0074, 0x0904, 0x64af, 0x90c6, 0x007c, 0x0904, 0x64b3,
+	0x90c6, 0x007e, 0x0904, 0x64b7, 0x90c6, 0x0037, 0x0904, 0x64bb,
+	0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x6492,
+	0x9182, 0x0800, 0x1a04, 0x6492, 0x080c, 0x6625, 0x1198, 0xb804,
+	0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f,
+	0x0148, 0x080c, 0xab57, 0x1904, 0x647b, 0xb8a0, 0x9084, 0xff80,
+	0x1904, 0x647b, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e,
+	0x0904, 0x63db, 0x90c6, 0x0064, 0x0904, 0x6404, 0x2008, 0x0804,
+	0x639d, 0xa998, 0xa8b0, 0x2040, 0x080c, 0xab57, 0x1120, 0x9182,
+	0x007f, 0x0a04, 0x639d, 0x9186, 0x00ff, 0x0904, 0x639d, 0x9182,
+	0x0800, 0x1a04, 0x639d, 0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188,
+	0x7880, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804,
+	0x639d, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804,
+	0x639d, 0x080c, 0x49ba, 0x0904, 0x63a7, 0x900e, 0x9016, 0x90c6,
+	0x4000, 0x15e0, 0x0006, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006,
+	0x2098, 0x080c, 0x0fb7, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0035, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a,
+	0x2098, 0x080c, 0x0fb7, 0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305,
+	0xabd0, 0x9305, 0xabd4, 0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305,
+	0xabe0, 0x9305, 0x9005, 0x0510, 0x000e, 0x00c8, 0x90c6, 0x4007,
+	0x1110, 0x2408, 0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610,
+	0x0070, 0x90c6, 0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138,
+	0x2001, 0x4005, 0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896,
+	0xa99a, 0xaa9e, 0x2001, 0x0030, 0x900e, 0x0478, 0x000e, 0x080c,
+	0xab97, 0x1130, 0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c78,
+	0x2b00, 0x6012, 0x080c, 0xcccc, 0x2900, 0x6016, 0x6023, 0x0001,
+	0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x31e7, 0x012e, 0x9006, 0x080c, 0x6561, 0x2001, 0x0002,
+	0x080c, 0x6575, 0x2009, 0x0002, 0x080c, 0xac8c, 0xa8b0, 0xd094,
+	0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x9006, 0x9005, 0x012e, 0x00ee,
+	0x00fe, 0x00be, 0x0005, 0x080c, 0x56ee, 0x0118, 0x2009, 0x0007,
+	0x00f8, 0xa998, 0xaeb0, 0x080c, 0x6625, 0x1904, 0x6398, 0x9186,
+	0x007f, 0x0130, 0x080c, 0x6a6b, 0x0118, 0x2009, 0x0009, 0x0080,
+	0x0096, 0x080c, 0x103a, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040,
+	0x2900, 0x009e, 0xa806, 0x080c, 0xca24, 0x19b0, 0x2009, 0x0003,
+	0x2001, 0x4005, 0x0804, 0x639f, 0xa998, 0xaeb0, 0x080c, 0x6625,
+	0x1904, 0x6398, 0x0096, 0x080c, 0x103a, 0x1128, 0x009e, 0x2009,
+	0x0002, 0x0804, 0x6458, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048,
+	0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
+	0x0006, 0x20a0, 0xbbc8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0fb7,
+	0x009e, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684,
+	0x1168, 0x080c, 0x56da, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0,
+	0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x6a6b,
+	0x0118, 0xa89b, 0x0009, 0x0080, 0x080c, 0x56ee, 0x0118, 0xa89b,
+	0x0007, 0x0050, 0x080c, 0xca07, 0x1904, 0x63d4, 0x2009, 0x0003,
+	0x2001, 0x4005, 0x0804, 0x639f, 0xa87b, 0x0030, 0xa897, 0x4005,
+	0xa804, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
+	0x2031, 0x0000, 0x2041, 0x127e, 0x080c, 0xb112, 0x1904, 0x63d4,
+	0x2009, 0x0002, 0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x63d5,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038,
+	0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e,
+	0x0804, 0x63d5, 0x2001, 0x0029, 0x900e, 0x0804, 0x63d5, 0x080c,
+	0x3797, 0x0804, 0x63d6, 0x080c, 0x540f, 0x0804, 0x63d6, 0x080c,
+	0x4573, 0x0804, 0x63d6, 0x080c, 0x45ec, 0x0804, 0x63d6, 0x080c,
+	0x4648, 0x0804, 0x63d6, 0x080c, 0x4a7d, 0x0804, 0x63d6, 0x080c,
+	0x4d34, 0x0804, 0x63d6, 0x080c, 0x507a, 0x0804, 0x63d6, 0x080c,
+	0x5273, 0x0804, 0x63d6, 0x080c, 0x39b5, 0x0804, 0x63d6, 0x00b6,
+	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1608, 0x9182,
+	0x0800, 0x1258, 0x9188, 0x1000, 0x2104, 0x905d, 0x0130, 0x080c,
+	0x6a6b, 0x1138, 0x00d9, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
+	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d98, 0x2001,
+	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0xa877, 0x0000,
+	0xb8d0, 0x9005, 0x1904, 0x6555, 0xb888, 0x9005, 0x1904, 0x6555,
+	0xb838, 0xb93c, 0x9102, 0x1a04, 0x6555, 0x2b10, 0x080c, 0xabc4,
+	0x0904, 0x6551, 0x8108, 0xb93e, 0x6212, 0x2900, 0x6016, 0x6023,
+	0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878, 0x605e, 0xa880,
+	0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac, 0x0588,
+	0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1530, 0xa816, 0xa864, 0x9094,
+	0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084, 0x00ff, 0xc0bd, 0x601e,
+	0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x000f, 0x8001, 0x1df0,
+	0x2001, 0x8004, 0x6003, 0x0004, 0x6046, 0x00f6, 0x2079, 0x0380,
+	0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010, 0x2c00, 0x7836, 0x781b,
+	0x8080, 0x00fe, 0x0005, 0x080c, 0x1731, 0x601c, 0xc0bd, 0x601e,
+	0x0c38, 0xd0b4, 0x190c, 0x1c30, 0x2001, 0x8004, 0x6003, 0x0002,
+	0x0c18, 0x81ff, 0x1110, 0xb88b, 0x0001, 0x2908, 0xb8cc, 0xb9ce,
+	0x9005, 0x1110, 0xb9d2, 0x0020, 0x0096, 0x2048, 0xa902, 0x009e,
+	0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000, 0x6210,
+	0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008, 0xc284, 0xba02,
+	0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6,
+	0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006,
+	0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x6a67, 0x0140, 0x9284,
+	0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600, 0x000e,
+	0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086, 0x0006, 0x1120,
+	0xba90, 0x82ff, 0x090c, 0x0d7d, 0x000e, 0x00ce, 0x012e, 0x00be,
+	0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258,
+	0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150,
+	0x080c, 0x6a63, 0x1138, 0x9284, 0x00ff, 0x9086, 0x0007, 0x1110,
+	0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007, 0x9215, 0xba06,
+	0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800, 0x0218, 0x9085,
+	0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000, 0x2204, 0x905d,
+	0x1188, 0x0096, 0x080c, 0x103a, 0x2958, 0x009e, 0x0168, 0x2b00,
+	0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006, 0xb8a6, 0xb8ae,
+	0x080c, 0x6043, 0x9006, 0x0010, 0x9085, 0x0001, 0x002e, 0x00de,
+	0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000, 0x0026, 0x9182,
+	0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6, 0x9190, 0x1000,
+	0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d, 0x0110,
+	0x080c, 0x106c, 0x00d6, 0x00c6, 0xb8bc, 0x2060, 0x8cff, 0x0168,
+	0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xc838, 0x0110, 0x080c,
+	0x0fec, 0x080c, 0xabed, 0x00ce, 0x0c88, 0x00ce, 0x00de, 0x2b48,
+	0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x107c, 0x00de, 0x9006,
+	0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016, 0x9182, 0x0800,
+	0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146,
+	0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c, 0x74e9,
+	0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0xab57, 0x11d8,
+	0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1982, 0x7048,
+	0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e, 0x00ce,
+	0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001, 0x6886,
+	0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048, 0xb862, 0x704c,
+	0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4, 0x20e8, 0xb8c8,
+	0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099, 0x027a,
+	0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069, 0x0200,
+	0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048, 0xb872,
+	0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0, 0x9086,
+	0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211, 0x1218, 0x2009,
+	0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0,
+	0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0x9182, 0x0349,
+	0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421, 0x1218, 0x2009,
+	0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009, 0x0003, 0x0010,
+	0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005,
+	0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034, 0xb896, 0x703c,
+	0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbd4, 0xc384, 0xba00, 0x2009,
+	0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad, 0x0008,
+	0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc, 0x0128,
+	0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbd6, 0x003e,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000,
+	0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04, 0x9282,
+	0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906, 0x8006,
+	0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080, 0x0004,
+	0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002, 0x9086, 0xffff,
+	0x0120, 0x8109, 0x1dd0, 0x080c, 0x0d7d, 0x3c00, 0x20e8, 0x3300,
+	0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce, 0x014e,
+	0x013e, 0x0060, 0x080c, 0x103a, 0x0170, 0x2900, 0xb8a6, 0xa803,
+	0x0000, 0x080c, 0x68b0, 0xa807, 0x0001, 0xae12, 0x9085, 0x0001,
+	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091, 0x8000,
+	0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150, 0x080c,
+	0x68bf, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001, 0xa806,
+	0x0020, 0x080c, 0x106c, 0xb8a7, 0x0000, 0x009e, 0x012e, 0x0005,
+	0x0096, 0x00c6, 0xb888, 0x9005, 0x1904, 0x67a9, 0xb8d0, 0x904d,
+	0x0904, 0x67a9, 0x080c, 0xabc4, 0x0904, 0x67a5, 0x8210, 0xba3e,
+	0xa800, 0xb8d2, 0x9005, 0x1108, 0xb8ce, 0x2b00, 0x6012, 0x2900,
+	0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878,
+	0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c,
+	0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568, 0xa816,
+	0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x1530, 0x9084, 0x00ff,
+	0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x8004,
+	0x6003, 0x0004, 0x0030, 0x080c, 0x1c30, 0x2001, 0x8004, 0x6003,
+	0x0002, 0x6046, 0x2001, 0x0010, 0x2c08, 0x080c, 0xa887, 0xb838,
+	0xba3c, 0x9202, 0x0a04, 0x6756, 0x0020, 0x82ff, 0x1110, 0xb88b,
+	0x0001, 0x00ce, 0x009e, 0x0005, 0x080c, 0x1731, 0x601c, 0xc0bd,
+	0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016, 0x20a9, 0x0800, 0x900e,
+	0x0016, 0x080c, 0x6625, 0x1158, 0xb8d0, 0x904d, 0x0140, 0x3e00,
+	0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1108, 0x0041, 0x001e,
+	0x8108, 0x1f04, 0x67b8, 0x001e, 0x00be, 0x009e, 0x0005, 0x0096,
+	0x0016, 0xb8d0, 0x904d, 0x0188, 0xa800, 0xb8d2, 0x9005, 0x1108,
+	0xb8ce, 0x9006, 0xa802, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0xcb36, 0x080c, 0x6d80, 0x0c60, 0x001e, 0x009e, 0x0005,
+	0x0086, 0x9046, 0xb8d0, 0x904d, 0x0198, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0128, 0x2940, 0xa800, 0x904d, 0x0148, 0x0ca8,
+	0xa800, 0x88ff, 0x1110, 0xb8d2, 0x0008, 0xa002, 0xa803, 0x0000,
+	0x008e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x00e6, 0x0096,
+	0x00c6, 0x0086, 0x0026, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
+	0x9046, 0x7028, 0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff, 0x0120,
+	0x605c, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870,
+	0x9506, 0x0120, 0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c, 0x0006,
+	0x0066, 0x2830, 0x080c, 0x9fa2, 0x006e, 0x000e, 0x83ff, 0x0508,
+	0x0c08, 0x9046, 0xb8d0, 0x904d, 0x01e0, 0x83ff, 0x0120, 0xa878,
+	0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
+	0x0120, 0x2940, 0xa800, 0x2048, 0x0c70, 0xb8d0, 0xaa00, 0x0026,
+	0x9906, 0x1110, 0xbad2, 0x0008, 0xa202, 0x000e, 0x83ff, 0x0108,
+	0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9016,
+	0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x6914, 0x0128,
+	0x080c, 0xc8f9, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6914,
+	0x0128, 0x080c, 0xc89a, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x6914, 0x0128, 0x080c, 0xc8f6, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x6914, 0x0128, 0x080c, 0xc8b9, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x6914, 0x0128, 0x080c, 0xc93a, 0x0010, 0x9085,
+	0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085, 0x0001, 0x0005,
 	0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e, 0x810f,
 	0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004, 0x2098,
 	0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128, 0x8109,
-	0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300, 0x8001,
-	0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de, 0x014e,
-	0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000,
-	0xb8a4, 0x904d, 0x1128, 0x080c, 0x103a, 0x0168, 0x2900, 0xb8a6,
-	0x080c, 0x68a9, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001,
-	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091,
-	0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x106c,
-	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005,
-	0x00b6, 0x00f6, 0x080c, 0x74d5, 0x01b0, 0x71c4, 0x81ff, 0x1198,
-	0x71dc, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004,
-	0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118,
-	0xb800, 0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x01d0,
-	0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x661e, 0x1168,
-	0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086,
-	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04,
-	0x6934, 0x015e, 0x080c, 0x6a19, 0x0120, 0x2001, 0x1985, 0x200c,
-	0x0038, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0,
-	0x2011, 0x695f, 0x080c, 0x86d7, 0x00fe, 0x00be, 0x0005, 0x00b6,
-	0x2011, 0x695f, 0x080c, 0x860d, 0x080c, 0x6a19, 0x01d8, 0x2001,
-	0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6a57,
-	0x0130, 0x2009, 0x07d0, 0x2011, 0x695f, 0x080c, 0x86d7, 0x00e6,
-	0x2071, 0x1800, 0x9006, 0x707e, 0x7060, 0x7082, 0x080c, 0x2fb2,
-	0x00ee, 0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016,
-	0x080c, 0x661e, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0,
-	0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xe29e, 0xb800, 0xc0e5,
-	0xc0ec, 0xb802, 0x080c, 0x6a53, 0x2001, 0x0707, 0x1128, 0xb804,
-	0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0xa872, 0x2019,
-	0x0029, 0x080c, 0x9374, 0x0076, 0x903e, 0x080c, 0x9246, 0x900e,
-	0x080c, 0xdfc0, 0x007e, 0x004e, 0x080c, 0xa88e, 0x001e, 0x8108,
-	0x1f04, 0x6987, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010,
-	0x2058, 0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6,
-	0x0096, 0x080c, 0x1053, 0x090c, 0x0d7d, 0x2958, 0x009e, 0x2001,
-	0x196b, 0x2b02, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x603c,
+	0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce, 0x013e, 0x0005,
+	0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0004, 0x20a0,
+	0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de, 0x014e, 0x0136,
+	0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e, 0x810f, 0x9184,
+	0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004, 0x2098, 0x20a9,
+	0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128, 0x8109, 0x1dd8,
+	0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300, 0x8001, 0x20a0,
+	0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de, 0x014e, 0x9006,
+	0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4,
+	0x904d, 0x1128, 0x080c, 0x103a, 0x0168, 0x2900, 0xb8a6, 0x080c,
+	0x68b0, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001, 0x012e,
+	0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091, 0x8000,
+	0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x106c, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005, 0x00b6,
+	0x00f6, 0x080c, 0x74e9, 0x01b0, 0x71c4, 0x81ff, 0x1198, 0x71dc,
+	0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004, 0x905d,
+	0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118, 0xb800,
+	0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x01d0, 0x0156,
+	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6625, 0x1168, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086, 0x0006,
+	0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04, 0x693b,
+	0x015e, 0x080c, 0x6a29, 0x0120, 0x2001, 0x1985, 0x200c, 0x0038,
+	0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011,
+	0x6966, 0x080c, 0x8708, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011,
+	0x6966, 0x080c, 0x863e, 0x080c, 0x6a29, 0x01d8, 0x2001, 0x107e,
+	0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6a67, 0x0130,
+	0x2009, 0x07d0, 0x2011, 0x6966, 0x080c, 0x8708, 0x00e6, 0x2071,
+	0x1800, 0x9006, 0x707e, 0x7060, 0x7082, 0x080c, 0x2fb2, 0x00ee,
+	0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x6625, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x0029, 0x080c, 0xe2c9, 0xb800, 0xc0e5, 0xc0ec,
+	0xb802, 0x080c, 0x6a63, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084,
+	0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0xa896, 0x2019, 0x0029,
+	0x080c, 0x93a5, 0x0076, 0x903e, 0x080c, 0x9277, 0x900e, 0x080c,
+	0xdfeb, 0x007e, 0x004e, 0x080c, 0xa8b2, 0x001e, 0x8108, 0x1f04,
+	0x698e, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058,
+	0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096,
+	0x080c, 0x1053, 0x090c, 0x0d7d, 0x2958, 0x009e, 0x2001, 0x196b,
+	0x2b02, 0x8b07, 0x8006, 0x8006, 0x908c, 0x003f, 0xb9c6, 0x908c,
+	0xffc0, 0xb9ca, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x6043,
 	0xb807, 0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200,
 	0xb86c, 0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af,
 	0x0000, 0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800,
@@ -3194,85 +3196,85 @@ unsigned short risc_code01[] = {
 	0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c,
 	0x0d7d, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc,
 	0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc,
-	0x0138, 0x2001, 0x1983, 0x200c, 0x2011, 0x6a49, 0x080c, 0x86d7,
-	0x0005, 0x2011, 0x6a49, 0x080c, 0x860d, 0x2011, 0x1837, 0x2204,
-	0xc0cc, 0x2012, 0x0005, 0x080c, 0x56d3, 0xd0ac, 0x0005, 0x080c,
-	0x56d3, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e,
+	0x0138, 0x2001, 0x1983, 0x200c, 0x2011, 0x6a59, 0x080c, 0x8708,
+	0x0005, 0x2011, 0x6a59, 0x080c, 0x863e, 0x2011, 0x1837, 0x2204,
+	0xc0cc, 0x2012, 0x0005, 0x080c, 0x56da, 0xd0ac, 0x0005, 0x080c,
+	0x56da, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e,
 	0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007,
-	0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xcf2e,
+	0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xcf52,
 	0x0158, 0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004,
 	0x905d, 0x0110, 0xb8d4, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071,
 	0x1910, 0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016,
 	0x701a, 0x701e, 0x700a, 0x7046, 0x2001, 0x1947, 0x2003, 0x0000,
 	0x0005, 0x0016, 0x00e6, 0x2071, 0x1948, 0x900e, 0x710a, 0x080c,
-	0x56d3, 0xd0fc, 0x1140, 0x080c, 0x56d3, 0x900e, 0xd09c, 0x0108,
+	0x56da, 0xd0fc, 0x1140, 0x080c, 0x56da, 0x900e, 0xd09c, 0x0108,
 	0x8108, 0x7102, 0x00f8, 0x2001, 0x1867, 0x200c, 0x9184, 0x0007,
-	0x0002, 0x6a9b, 0x6a9b, 0x6a9b, 0x6a9b, 0x6a9b, 0x6ab1, 0x6abf,
-	0x6a9b, 0x7003, 0x0003, 0x2009, 0x1868, 0x210c, 0x9184, 0xff00,
+	0x0002, 0x6aab, 0x6aab, 0x6aab, 0x6aab, 0x6aab, 0x6ac1, 0x6acf,
+	0x6aab, 0x7003, 0x0003, 0x2009, 0x1868, 0x210c, 0x9184, 0xff00,
 	0x8007, 0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003,
 	0x0005, 0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050,
 	0x684c, 0x9005, 0x1150, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc085,
 	0x702a, 0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158,
-	0x080c, 0x784b, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006,
+	0x080c, 0x785f, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006,
 	0x9006, 0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868,
 	0x700a, 0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016,
 	0x684c, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019,
 	0x702b, 0x0001, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc084, 0x702a,
 	0x7007, 0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005,
-	0x00e6, 0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6d75,
-	0x9286, 0x0003, 0x0904, 0x6c05, 0x9286, 0x0005, 0x0904, 0x6c05,
-	0x2071, 0x1877, 0xa87c, 0x9005, 0x0904, 0x6b66, 0x7140, 0xa868,
-	0x9102, 0x0a04, 0x6d75, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019,
+	0x00e6, 0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6d85,
+	0x9286, 0x0003, 0x0904, 0x6c15, 0x9286, 0x0005, 0x0904, 0x6c15,
+	0x2071, 0x1877, 0xa87c, 0x9005, 0x0904, 0x6b76, 0x7140, 0xa868,
+	0x9102, 0x0a04, 0x6d85, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019,
 	0x2001, 0x8023, 0xa84e, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904,
-	0x6f18, 0x0e04, 0x6f86, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c,
+	0x6f28, 0x0e04, 0x6f96, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c,
 	0x7082, 0xa870, 0x7086, 0xa86c, 0x708a, 0xa880, 0x708e, 0x7036,
 	0x0146, 0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1,
 	0x002a, 0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021,
 	0x2098, 0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x0804,
-	0x6be8, 0xa853, 0x001b, 0x2001, 0x8027, 0x0820, 0x7004, 0xd08c,
-	0x1904, 0x6d75, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6b2a,
-	0x00e6, 0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6d75,
-	0x9286, 0x0003, 0x0904, 0x6c05, 0x9286, 0x0005, 0x0904, 0x6c05,
-	0xa84f, 0x8022, 0xa853, 0x0018, 0x0804, 0x6bcd, 0xa868, 0xd0fc,
+	0x6bf8, 0xa853, 0x001b, 0x2001, 0x8027, 0x0820, 0x7004, 0xd08c,
+	0x1904, 0x6d85, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6b3a,
+	0x00e6, 0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6d85,
+	0x9286, 0x0003, 0x0904, 0x6c15, 0x9286, 0x0005, 0x0904, 0x6c15,
+	0xa84f, 0x8022, 0xa853, 0x0018, 0x0804, 0x6bdd, 0xa868, 0xd0fc,
 	0x11d8, 0x00e6, 0x0026, 0x2001, 0x1948, 0x2004, 0x9005, 0x0904,
-	0x6d75, 0xa87c, 0xd0bc, 0x1904, 0x6d75, 0xa978, 0xa874, 0x9105,
-	0x1904, 0x6d75, 0x2001, 0x1948, 0x2004, 0x0002, 0x6d75, 0x6bc9,
-	0x6c05, 0x6c05, 0x6d75, 0x6c05, 0x0005, 0xa868, 0xd0fc, 0x1500,
-	0x00e6, 0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6d75,
-	0xa87c, 0xd0cc, 0x0904, 0x6d75, 0xa880, 0x9084, 0x00ff, 0x9086,
-	0x0001, 0x1904, 0x6d75, 0x9186, 0x0003, 0x0904, 0x6c05, 0x9186,
-	0x0005, 0x0904, 0x6c05, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028,
+	0x6d85, 0xa87c, 0xd0bc, 0x1904, 0x6d85, 0xa978, 0xa874, 0x9105,
+	0x1904, 0x6d85, 0x2001, 0x1948, 0x2004, 0x0002, 0x6d85, 0x6bd9,
+	0x6c15, 0x6c15, 0x6d85, 0x6c15, 0x0005, 0xa868, 0xd0fc, 0x1500,
+	0x00e6, 0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6d85,
+	0xa87c, 0xd0cc, 0x0904, 0x6d85, 0xa880, 0x9084, 0x00ff, 0x9086,
+	0x0001, 0x1904, 0x6d85, 0x9186, 0x0003, 0x0904, 0x6c15, 0x9186,
+	0x0005, 0x0904, 0x6c15, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028,
 	0x0005, 0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1910, 0x701c,
-	0x9005, 0x1904, 0x6f18, 0x0e04, 0x6f86, 0x2071, 0x0000, 0xa84c,
+	0x9005, 0x1904, 0x6f28, 0x0e04, 0x6f96, 0x2071, 0x0000, 0xa84c,
 	0x7082, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a,
 	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6,
 	0x2071, 0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553,
 	0x002e, 0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6,
 	0x2079, 0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005,
-	0x1904, 0x6cfa, 0x782c, 0x908c, 0x0780, 0x190c, 0x70d2, 0x8004,
-	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6c23, 0x6cfa, 0x6c48,
-	0x6c95, 0x080c, 0x0d7d, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x1904, 0x6d0a, 0x782c, 0x908c, 0x0780, 0x190c, 0x70e2, 0x8004,
+	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6c33, 0x6d0a, 0x6c58,
+	0x6ca5, 0x080c, 0x0d7d, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
 	0x900d, 0x1170, 0x2071, 0x1a03, 0x703c, 0x9005, 0x1328, 0x2001,
 	0x1949, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x0c10,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x0c10,
 	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824,
 	0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x1830,
 	0x210c, 0x918a, 0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c,
 	0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8522, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x70d2, 0xd0a4, 0x19c8, 0x2071, 0x1a03,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x19c8, 0x2071, 0x1a03,
 	0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005, 0x703e,
 	0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904,
 	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200,
-	0x70c2, 0x080c, 0x8522, 0x0804, 0x6c4f, 0x0096, 0x00e6, 0x7824,
+	0x70c2, 0x080c, 0x8553, 0x0804, 0x6c5f, 0x0096, 0x00e6, 0x7824,
 	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x8522, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70d2, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70d2, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70e2, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70e2, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
 	0x1560, 0x2071, 0x1a03, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
 	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e,
 	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
@@ -3280,85 +3282,85 @@ unsigned short risc_code01[] = {
 	0x1a03, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005,
 	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x00fe, 0x002e,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x00fe, 0x002e,
 	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1904, 0x6d4f, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd09c,
+	0x1904, 0x6d5f, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c,
 	0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108,
 	0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x70d2, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70d2, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x190c, 0x70e2, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70e2, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
 	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
-	0x8522, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd0a4, 0x1d60,
+	0x8553, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x1d60,
 	0x00ee, 0x2071, 0x1a03, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
 	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6,
 	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
-	0x8522, 0x00ee, 0x0804, 0x6d0a, 0xa868, 0xd0fc, 0x1560, 0x0096,
+	0x8553, 0x00ee, 0x0804, 0x6d1a, 0xa868, 0xd0fc, 0x1560, 0x0096,
 	0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0fec, 0x009e, 0x0018,
 	0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6,
 	0x2079, 0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005,
-	0x1904, 0x6e92, 0x782c, 0x908c, 0x0780, 0x190c, 0x70d2, 0x8004,
-	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6d94, 0x6e92, 0x6daf,
-	0x6e21, 0x080c, 0x0d7d, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822,
+	0x1904, 0x6ea2, 0x782c, 0x908c, 0x0780, 0x190c, 0x70e2, 0x8004,
+	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6da4, 0x6ea2, 0x6dbf,
+	0x6e31, 0x080c, 0x0d7d, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822,
 	0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x0c60, 0x2071,
-	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6e10, 0x7830,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x0c60, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6e20, 0x7830,
 	0xd0dc, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6,
 	0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x1830, 0x210c,
 	0x918a, 0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108,
 	0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8522, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x70d2, 0xd0a4, 0x19c8, 0x0e04, 0x6e07, 0x7838,
+	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x70e2, 0xd0a4, 0x19c8, 0x0e04, 0x6e17, 0x7838,
 	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
 	0x0013, 0x00de, 0x2001, 0x1921, 0x200c, 0xc184, 0x2102, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x2009,
 	0x1947, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001,
 	0x1921, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x0804,
-	0x6dbe, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8522,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd0a4, 0x1d60, 0x00ee,
-	0x0e04, 0x6e65, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x0804,
+	0x6dce, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x1d60, 0x00ee,
+	0x0e04, 0x6e75, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
 	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046,
 	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6,
 	0x2009, 0x1947, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70d2, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x70e2, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
 	0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
 	0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
 	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x00fe, 0x002e,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x00fe, 0x002e,
 	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1904, 0x6f03, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd09c,
+	0x1904, 0x6f13, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c,
 	0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010,
 	0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd09c, 0x0d50, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x70d2, 0xd0a4, 0x05c8, 0x00e6, 0x7824,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c, 0x0d50, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x05c8, 0x00e6, 0x7824,
 	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x8522, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70d2, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6efc, 0x7838, 0x7938,
+	0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70e2, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6f0c, 0x7838, 0x7938,
 	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
 	0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089,
 	0x2004, 0xd084, 0x190c, 0x11d6, 0x2009, 0x1947, 0x200b, 0x0000,
 	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe,
 	0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c,
 	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x00ee, 0x0804, 0x6ea2,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x00ee, 0x0804, 0x6eb2,
 	0x2071, 0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012,
 	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
-	0xa804, 0x900d, 0x1128, 0x1e04, 0x6f43, 0x002e, 0x00ee, 0x0005,
+	0xa804, 0x900d, 0x1128, 0x1e04, 0x6f53, 0x002e, 0x00ee, 0x0005,
 	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
-	0x8522, 0x0e04, 0x6f2d, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c,
+	0x8553, 0x0e04, 0x6f3d, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c,
 	0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
 	0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278,
 	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6,
-	0x2071, 0x1910, 0x080c, 0x70be, 0x002e, 0x00ee, 0x0005, 0xa850,
+	0x2071, 0x1910, 0x080c, 0x70ce, 0x002e, 0x00ee, 0x0005, 0xa850,
 	0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6,
 	0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868,
 	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003,
@@ -3367,23 +3369,23 @@ unsigned short risc_code01[] = {
 	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
 	0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
 	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8522, 0x002e, 0x00ee, 0x0005,
+	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x002e, 0x00ee, 0x0005,
 	0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860,
 	0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e,
 	0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071,
-	0x1910, 0x7004, 0x0002, 0x6fd1, 0x6fd2, 0x70bd, 0x6fd2, 0x0d7d,
-	0x70bd, 0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6fdc, 0x6fdc,
-	0x7056, 0x7057, 0x6fdc, 0x7057, 0x0126, 0x2091, 0x8000, 0x1e0c,
-	0x70dd, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x7027,
-	0x0e04, 0x7005, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
+	0x1910, 0x7004, 0x0002, 0x6fe1, 0x6fe2, 0x70cd, 0x6fe2, 0x0d7d,
+	0x70cd, 0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6fec, 0x6fec,
+	0x7066, 0x7067, 0x6fec, 0x7067, 0x0126, 0x2091, 0x8000, 0x1e0c,
+	0x70ed, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x7037,
+	0x0e04, 0x7015, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
 	0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019,
 	0x1278, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x11d6, 0x2071, 0x1910, 0x080c, 0x70be, 0x012e, 0x0804, 0x7055,
+	0x11d6, 0x2071, 0x1910, 0x080c, 0x70ce, 0x012e, 0x0804, 0x7065,
 	0xa850, 0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146,
 	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
 	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
 	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2001,
-	0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd09c, 0x2071,
+	0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c, 0x2071,
 	0x1910, 0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184,
 	0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101,
 	0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de,
@@ -3392,10 +3394,10 @@ unsigned short risc_code01[] = {
 	0x2008, 0x2069, 0x1a03, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186,
 	0x0003, 0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1b4e, 0x210c,
 	0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c,
-	0x6838, 0x9106, 0x0190, 0x0e04, 0x7089, 0x2069, 0x0000, 0x6837,
+	0x6838, 0x9106, 0x0190, 0x0e04, 0x7099, 0x2069, 0x0000, 0x6837,
 	0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001,
 	0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x2069, 0x1a03, 0x683f,
-	0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x7153,
+	0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x7163,
 	0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780,
 	0x15c9, 0xd09c, 0x1500, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964,
 	0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff,
@@ -3404,7 +3406,7 @@ unsigned short risc_code01[] = {
 	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091,
 	0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800,
 	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x106c, 0x0005,
-	0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x70d4, 0x0006, 0x0016,
+	0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x70e4, 0x0006, 0x0016,
 	0x2001, 0x8004, 0x0006, 0x0804, 0x0d86, 0x0096, 0x00f6, 0x2079,
 	0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938,
 	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
@@ -3416,7 +3418,7 @@ unsigned short risc_code01[] = {
 	0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0240, 0x7022, 0x2001,
 	0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048,
 	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
-	0x8522, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd0a4, 0x19c8,
+	0x8553, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x19c8,
 	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
 	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
 	0xd084, 0x190c, 0x11d6, 0x2009, 0x1947, 0x200b, 0x0000, 0x00ee,
@@ -3424,3776 +3426,3780 @@ unsigned short risc_code01[] = {
 	0x01b8, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
 	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080,
 	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x00fe, 0x0005,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x70d2, 0xd0a4, 0x0db8, 0x00e6,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x0db8, 0x00e6,
 	0x2071, 0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70c0, 0x8000, 0x70c2, 0x080c, 0x8522, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x70d2, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c,
+	0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x70e2, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c,
 	0x2069, 0x1948, 0x6808, 0x690a, 0x2069, 0x1a03, 0x9102, 0x1118,
 	0x683c, 0x9005, 0x1328, 0x2001, 0x1949, 0x200c, 0x810d, 0x693e,
 	0x00de, 0x00ee, 0x00fe, 0x0005, 0x7098, 0x908a, 0x0029, 0x1a0c,
 	0x0d7d, 0x9082, 0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c,
-	0x2a44, 0x002e, 0x0005, 0x727b, 0x7205, 0x7221, 0x7249, 0x726a,
-	0x72aa, 0x72bc, 0x7221, 0x7292, 0x71c0, 0x71ee, 0x71bf, 0x0005,
+	0x2a44, 0x002e, 0x0005, 0x728f, 0x7215, 0x7231, 0x725b, 0x727e,
+	0x72be, 0x72d0, 0x7231, 0x72a6, 0x71d0, 0x71fe, 0x71cf, 0x0005,
 	0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005,
 	0x1518, 0x709b, 0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c,
-	0x7617, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028,
+	0x762b, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028,
 	0x2069, 0x198f, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a,
 	0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a6b, 0x080c, 0x1ab5,
 	0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069,
 	0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b,
-	0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x76ba, 0x6028,
+	0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x76ce, 0x6028,
 	0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090,
-	0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x732d,
+	0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x7341,
 	0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020,
-	0x080c, 0x732d, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f,
-	0x0005, 0x2001, 0x0088, 0x080c, 0x2a0a, 0x6124, 0xd1cc, 0x11d8,
-	0xd1dc, 0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8, 0x60e3,
-	0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x7501, 0x2001, 0x0080,
-	0x080c, 0x2a0a, 0x709b, 0x0028, 0x0058, 0x709b, 0x001e, 0x0040,
-	0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b, 0x001f,
-	0x0005, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x7501,
-	0x2001, 0x0080, 0x080c, 0x2a0a, 0x6124, 0xd1d4, 0x1180, 0xd1dc,
-	0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x709b, 0x0028,
-	0x0040, 0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b,
-	0x001f, 0x0005, 0x2001, 0x00a0, 0x080c, 0x2a0a, 0x6124, 0xd1dc,
-	0x1138, 0xd1e4, 0x0138, 0x080c, 0x1adf, 0x709b, 0x001e, 0x0010,
-	0x709b, 0x001d, 0x0005, 0x080c, 0x73b6, 0x6124, 0xd1dc, 0x1188,
-	0x080c, 0x732d, 0x0016, 0x080c, 0x1adf, 0x001e, 0xd1d4, 0x1128,
-	0xd1e4, 0x0138, 0x709b, 0x001e, 0x0020, 0x709b, 0x001f, 0x080c,
-	0x732d, 0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x2a0a, 0x000e,
-	0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4,
-	0x0140, 0x709b, 0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b,
-	0x0021, 0x0005, 0x080c, 0x73b6, 0x6124, 0xd1d4, 0x1150, 0xd1dc,
-	0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028, 0x709b, 0x001d,
-	0x0010, 0x709b, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
-	0x2a0a, 0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc,
-	0x1128, 0xd1e4, 0x0158, 0x709b, 0x001e, 0x0040, 0x709b, 0x001d,
-	0x0028, 0x709b, 0x0020, 0x0010, 0x709b, 0x001f, 0x0005, 0x0016,
-	0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0x1800, 0x2091, 0x8000, 0x080c, 0x74d5, 0x11f8, 0x2001,
-	0x180c, 0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102, 0x0026, 0x2011,
-	0x0200, 0x080c, 0x2a44, 0x002e, 0x080c, 0x29f0, 0x6024, 0xd0cc,
-	0x0148, 0x2001, 0x00a0, 0x080c, 0x2a0a, 0x080c, 0x77d9, 0x080c,
-	0x6022, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x74ef,
-	0x0150, 0x080c, 0x74e6, 0x1138, 0x2001, 0x0001, 0x080c, 0x25a0,
-	0x080c, 0x74a9, 0x00a0, 0x080c, 0x73b3, 0x0178, 0x2001, 0x0001,
-	0x080c, 0x25a0, 0x7098, 0x9086, 0x001e, 0x0120, 0x7098, 0x9086,
-	0x0022, 0x1118, 0x709b, 0x0025, 0x0010, 0x709b, 0x0021, 0x012e,
-	0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x733e,
-	0x080c, 0x8719, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011,
-	0x733e, 0x080c, 0x8710, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6,
-	0x0016, 0x080c, 0x9e0e, 0x2071, 0x1800, 0x080c, 0x72d7, 0x001e,
-	0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x0126, 0x080c, 0x9e0e, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a,
-	0x080c, 0xa872, 0x2011, 0x0003, 0x080c, 0xa1ab, 0x2011, 0x0002,
-	0x080c, 0xa1b5, 0x080c, 0xa074, 0x080c, 0x86c5, 0x0036, 0x901e,
-	0x080c, 0xa0f4, 0x003e, 0x080c, 0xa88e, 0x60e3, 0x0000, 0x080c,
-	0xe6d7, 0x080c, 0xe6f2, 0x2009, 0x0004, 0x080c, 0x29f6, 0x080c,
-	0x2916, 0x2001, 0x1800, 0x2003, 0x0004, 0x2011, 0x0008, 0x080c,
-	0x2a44, 0x2011, 0x733e, 0x080c, 0x8719, 0x080c, 0x74ef, 0x0118,
-	0x9006, 0x080c, 0x2a0a, 0x080c, 0x0bc3, 0x2001, 0x0001, 0x080c,
-	0x25a0, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x734b, 0x2071, 0x1a03,
-	0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001,
-	0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0x9084,
-	0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c, 0x2a0a,
-	0x0156, 0x20a9, 0x002d, 0x1d04, 0x73c3, 0x2091, 0x6000, 0x1f04,
-	0x73c3, 0x015e, 0x00d6, 0x2069, 0x1800, 0x689c, 0x8001, 0x0220,
-	0x0118, 0x689e, 0x00de, 0x0005, 0x689f, 0x0014, 0x68ec, 0xd0dc,
-	0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x8725, 0x0c90,
-	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x080c, 0x77e8, 0x2001, 0x196d, 0x2003, 0x0000, 0x9006,
-	0x709a, 0x60e2, 0x6886, 0x080c, 0x266f, 0x9006, 0x080c, 0x2a0a,
-	0x080c, 0x5edd, 0x0026, 0x2011, 0xffff, 0x080c, 0x2a44, 0x002e,
-	0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001,
-	0x197d, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158,
-	0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x7499,
-	0x709b, 0x0022, 0x0040, 0x709b, 0x0021, 0x0028, 0x709b, 0x0023,
-	0x0010, 0x709b, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001,
-	0x0001, 0x080c, 0x266f, 0x080c, 0xa872, 0x0026, 0x080c, 0xab3a,
-	0x002e, 0x080c, 0xa88e, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b,
-	0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000,
-	0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c,
-	0xcf2e, 0x0118, 0x9006, 0x080c, 0x2a34, 0x0804, 0x74a5, 0x6800,
-	0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x29f0, 0x6904, 0xd1d4,
-	0x1140, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x1f04, 0x744a, 0x080c,
-	0x752c, 0x012e, 0x015e, 0x080c, 0x74e6, 0x0170, 0x6044, 0x9005,
-	0x0130, 0x080c, 0x752c, 0x9006, 0x8001, 0x1df0, 0x0028, 0x6804,
-	0xd0d4, 0x1110, 0x080c, 0x752c, 0x080c, 0xcf2e, 0x0118, 0x9006,
-	0x080c, 0x2a34, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130,
-	0x2009, 0x00c8, 0x2011, 0x734b, 0x080c, 0x86d7, 0x002e, 0x001e,
-	0x080c, 0x8519, 0x7034, 0xc085, 0x7036, 0x2001, 0x197d, 0x2003,
-	0x0004, 0x080c, 0x71a4, 0x080c, 0x74e6, 0x0138, 0x6804, 0xd0d4,
-	0x1120, 0xd0dc, 0x1100, 0x080c, 0x77de, 0x00ee, 0x00de, 0x00ce,
-	0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0x1800, 0x080c, 0x8530, 0x080c, 0x8522, 0x080c, 0x77e8,
-	0x2001, 0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886,
-	0x080c, 0x266f, 0x9006, 0x080c, 0x2a0a, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x0026, 0x2011, 0xffff, 0x080c, 0x2a44, 0x002e, 0x602b,
-	0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x197c,
-	0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d7,
-	0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c,
-	0x56d7, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006,
-	0x080c, 0x56d7, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005,
-	0x0006, 0x080c, 0x56d7, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e,
-	0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013,
-	0x0180, 0x0020, 0x080c, 0x268f, 0x900e, 0x0028, 0x080c, 0x6a53,
-	0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x31a3, 0x9006,
-	0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04,
-	0x0130, 0x080c, 0xcf27, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084,
-	0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006,
-	0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x602f, 0x0100,
-	0x602f, 0x0000, 0x602f, 0x0040, 0x602f, 0x0000, 0x20a9, 0x0002,
-	0x080c, 0x29d1, 0x0026, 0x2011, 0x0040, 0x080c, 0x2a44, 0x002e,
-	0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee,
-	0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x266f,
-	0x2001, 0x00a0, 0x0006, 0x080c, 0xcf2e, 0x000e, 0x0130, 0x080c,
-	0x2a28, 0x9006, 0x080c, 0x2a34, 0x0010, 0x080c, 0x2a0a, 0x000e,
-	0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100,
-	0x080c, 0x2981, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x080c, 0xa8d0, 0x0158, 0x2001, 0x0386,
-	0x2004, 0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c, 0xa863, 0x0804,
-	0x7609, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084,
-	0xe1ff, 0x602a, 0x2011, 0x0200, 0x080c, 0x2a44, 0x2001, 0x0090,
-	0x080c, 0x2a0a, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1558, 0x1d04,
-	0x75a4, 0x2091, 0x6000, 0x1f04, 0x75a4, 0x080c, 0xa872, 0x2011,
-	0x0003, 0x080c, 0xa1ab, 0x2011, 0x0002, 0x080c, 0xa1b5, 0x080c,
-	0xa074, 0x901e, 0x080c, 0xa0f4, 0x2001, 0x0386, 0x2003, 0x7000,
-	0x080c, 0xa88e, 0x2001, 0x00a0, 0x080c, 0x2a0a, 0x080c, 0x77d9,
-	0x080c, 0x6022, 0x080c, 0xcf2e, 0x0110, 0x080c, 0x0ce9, 0x9085,
-	0x0001, 0x04e8, 0x2001, 0x0386, 0x2004, 0xd0ac, 0x0110, 0x080c,
-	0x1adf, 0x60e3, 0x0000, 0x2001, 0x196d, 0x2004, 0x080c, 0x266f,
-	0x60e2, 0x2001, 0x0080, 0x080c, 0x2a0a, 0x20a9, 0x0366, 0x2011,
-	0x1e00, 0x080c, 0x2a44, 0x2009, 0x1e00, 0x080c, 0x29f0, 0x6024,
-	0x910c, 0x0140, 0x1d04, 0x75e7, 0x2091, 0x6000, 0x1f04, 0x75e7,
-	0x0804, 0x75ad, 0x2001, 0x0386, 0x2003, 0x7000, 0x6028, 0x9085,
-	0x1e00, 0x602a, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
-	0x6886, 0x080c, 0xcf2e, 0x0110, 0x080c, 0x0ce9, 0x9006, 0x00ee,
-	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
-	0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b,
-	0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a77,
-	0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0,
-	0x0120, 0x6884, 0x9005, 0x1904, 0x7680, 0x2001, 0x0088, 0x080c,
-	0x2a0a, 0x9006, 0x60e2, 0x6886, 0x080c, 0x266f, 0x2069, 0x0200,
-	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01d0, 0x6028, 0x9084,
-	0xfbff, 0x602a, 0x2011, 0x0400, 0x080c, 0x2a44, 0x2069, 0x198f,
-	0x7000, 0x206a, 0x709b, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002,
-	0x1d04, 0x7660, 0x2091, 0x6000, 0x1f04, 0x7660, 0x0804, 0x76b2,
-	0x2069, 0x0140, 0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c, 0x2a44,
-	0x2009, 0x1e00, 0x080c, 0x29f0, 0x6024, 0x910c, 0x0528, 0x9084,
-	0x1a00, 0x1510, 0x1d04, 0x766c, 0x2091, 0x6000, 0x1f04, 0x766c,
-	0x080c, 0xa872, 0x2011, 0x0003, 0x080c, 0xa1ab, 0x2011, 0x0002,
-	0x080c, 0xa1b5, 0x080c, 0xa074, 0x901e, 0x080c, 0xa0f4, 0x080c,
-	0xa88e, 0x2001, 0x00a0, 0x080c, 0x2a0a, 0x080c, 0x77d9, 0x080c,
-	0x6022, 0x9085, 0x0001, 0x00b0, 0x2001, 0x0080, 0x080c, 0x2a0a,
-	0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887,
-	0x0001, 0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x266f,
-	0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0,
-	0x01e8, 0x080c, 0xa872, 0x2011, 0x0003, 0x080c, 0xa1ab, 0x2011,
-	0x0002, 0x080c, 0xa1b5, 0x080c, 0xa074, 0x901e, 0x080c, 0xa0f4,
-	0x080c, 0xa88e, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2a0a,
-	0x080c, 0x77d9, 0x080c, 0x6022, 0x0804, 0x7755, 0x2001, 0x180c,
-	0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x7333, 0x2069,
-	0x0140, 0x2001, 0x0080, 0x080c, 0x2a0a, 0x60e3, 0x0000, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0190, 0x6028,
-	0x9084, 0xfdff, 0x602a, 0x2011, 0x0200, 0x080c, 0x2a44, 0x2069,
-	0x198f, 0x7000, 0x206a, 0x709b, 0x0027, 0x7003, 0x0001, 0x0804,
-	0x7755, 0x2011, 0x1e00, 0x080c, 0x2a44, 0x2009, 0x1e00, 0x080c,
-	0x29f0, 0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04,
-	0x7711, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x8561,
-	0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x1a03,
-	0x7018, 0x00ee, 0x9005, 0x19e8, 0x0500, 0x0026, 0x2011, 0x734b,
-	0x080c, 0x860d, 0x2011, 0x733e, 0x080c, 0x8719, 0x002e, 0x2069,
-	0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001,
-	0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x266f, 0x60e2,
-	0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
-	0x080c, 0xcf27, 0x1904, 0x77c3, 0x7130, 0xd184, 0x1170, 0x080c,
-	0x3361, 0x0138, 0xc18d, 0x7132, 0x2011, 0x1848, 0x2214, 0xd2ac,
-	0x1120, 0x7030, 0xd08c, 0x0904, 0x77c3, 0x2011, 0x1848, 0x220c,
-	0xd1a4, 0x0538, 0x0016, 0x2019, 0x000e, 0x080c, 0xe20e, 0x0156,
-	0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186,
-	0x0080, 0x0188, 0x080c, 0x661e, 0x1170, 0x2120, 0x9006, 0x0016,
-	0x2009, 0x000e, 0x080c, 0xe29e, 0x2009, 0x0001, 0x2011, 0x0100,
-	0x080c, 0x88bb, 0x001e, 0x8108, 0x1f04, 0x778c, 0x00be, 0x015e,
-	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004,
-	0x080c, 0x31a3, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
-	0x900e, 0x080c, 0x661e, 0x1110, 0x080c, 0x603c, 0x8108, 0x1f04,
-	0x77b9, 0x00be, 0x015e, 0x080c, 0x1adf, 0x080c, 0xa872, 0x080c,
-	0xab3a, 0x080c, 0xa88e, 0x60e3, 0x0000, 0x080c, 0x6022, 0x080c,
-	0x7406, 0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x0005, 0x2001, 0x197d, 0x2003, 0x0001, 0x0005, 0x2001, 0x197d,
-	0x2003, 0x0000, 0x0005, 0x2001, 0x197c, 0x2003, 0xaaaa, 0x0005,
-	0x2001, 0x197c, 0x2003, 0x0000, 0x0005, 0x2071, 0x18fa, 0x7003,
-	0x0000, 0x7007, 0x0000, 0x080c, 0x1053, 0x090c, 0x0d7d, 0xa8ab,
-	0xdcb0, 0x2900, 0x704e, 0x080c, 0x1053, 0x090c, 0x0d7d, 0xa8ab,
-	0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f,
-	0x0000, 0x0005, 0x00e6, 0x2071, 0x0040, 0x6848, 0x9005, 0x1118,
-	0x9085, 0x0001, 0x04b0, 0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50,
-	0x9200, 0x7002, 0x6854, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016,
-	0x6850, 0x7002, 0x6854, 0x7006, 0x6858, 0x700a, 0x685c, 0x700e,
-	0x6840, 0x9005, 0x1110, 0x7012, 0x7016, 0x6848, 0x701a, 0x701c,
-	0x9085, 0x0040, 0x701e, 0x2001, 0x0019, 0x7036, 0x702b, 0x0001,
-	0x2001, 0x0004, 0x200c, 0x918c, 0xfff7, 0x918d, 0x8000, 0x2102,
-	0x00d6, 0x2069, 0x18fa, 0x6807, 0x0001, 0x00de, 0x080c, 0x7dd0,
-	0x9006, 0x00ee, 0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003,
-	0x818d, 0x1f04, 0x784f, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071,
-	0x18fa, 0x7004, 0x0002, 0x7865, 0x7866, 0x78b1, 0x790c, 0x7a1c,
-	0x7863, 0x7863, 0x7a46, 0x080c, 0x0d7d, 0x0005, 0x2079, 0x0040,
-	0x2001, 0x1dc0, 0x2003, 0x0000, 0x782c, 0x908c, 0x0780, 0x190c,
-	0x7eb2, 0xd0a4, 0x0570, 0x2001, 0x1dc0, 0x2004, 0x9082, 0x0080,
-	0x1640, 0x1d04, 0x7883, 0x2001, 0x1a06, 0x200c, 0x8109, 0x0508,
-	0x2091, 0x6000, 0x2102, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
-	0xa864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001,
-	0x1800, 0x200c, 0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004,
-	0x0140, 0x9186, 0x0007, 0x0128, 0x9186, 0x0003, 0x1968, 0x080c,
-	0x790c, 0x782c, 0xd09c, 0x090c, 0x7dd0, 0x0005, 0x9082, 0x005a,
-	0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x7942, 0x0c90, 0x00e3,
-	0x08f0, 0x0005, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942,
-	0x7942, 0x7942, 0x7964, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942,
-	0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942,
-	0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x794e, 0x7942,
-	0x7b37, 0x7942, 0x7942, 0x7942, 0x7964, 0x7942, 0x794e, 0x7b78,
-	0x7bb9, 0x7c00, 0x7c14, 0x7942, 0x7942, 0x7964, 0x794e, 0x7978,
-	0x7942, 0x79f0, 0x7cbf, 0x7cda, 0x7942, 0x7964, 0x7942, 0x7978,
-	0x7942, 0x7942, 0x79e6, 0x7cda, 0x7942, 0x7942, 0x7942, 0x7942,
-	0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x798c, 0x7942, 0x7942,
-	0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7942, 0x7e56,
-	0x7942, 0x7e00, 0x7942, 0x7e00, 0x7942, 0x79a1, 0x7942, 0x7942,
-	0x7942, 0x7942, 0x7942, 0x7942, 0x2079, 0x0040, 0x7004, 0x9086,
-	0x0003, 0x1198, 0x782c, 0x080c, 0x7df9, 0xd0a4, 0x0170, 0x7824,
+	0x080c, 0x7341, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f,
+	0x0005, 0x2001, 0x0088, 0x080c, 0x2a0a, 0x6124, 0xd1cc, 0x11e8,
+	0xd1dc, 0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c,
+	0x1adf, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x7515,
+	0x2001, 0x0080, 0x080c, 0x2a0a, 0x709b, 0x0028, 0x0058, 0x709b,
+	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
+	0x709b, 0x001f, 0x0005, 0x080c, 0x1adf, 0x60e3, 0x0001, 0x600c,
+	0xc0b4, 0x600e, 0x080c, 0x7515, 0x2001, 0x0080, 0x080c, 0x2a0a,
+	0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184,
+	0x1e00, 0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028,
+	0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0,
+	0x080c, 0x2a0a, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c,
+	0x1adf, 0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c,
+	0x73ca, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x7341, 0x0016, 0x080c,
+	0x1adf, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e,
+	0x0020, 0x709b, 0x001f, 0x080c, 0x7341, 0x0005, 0x0006, 0x2001,
+	0x00a0, 0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028,
+	0x709b, 0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x73ca,
+	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b,
+	0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x0006, 0x2001, 0x0090, 0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1d4,
+	0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b,
+	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
+	0x709b, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x080c, 0x74e9, 0x11f8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01d0,
+	0xc1b4, 0x2102, 0x0026, 0x2011, 0x0200, 0x080c, 0x2a44, 0x002e,
+	0x080c, 0x29f0, 0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c,
+	0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029, 0x0428, 0x6028, 0xc0cd,
+	0x602a, 0x0408, 0x080c, 0x7503, 0x0150, 0x080c, 0x74fa, 0x1138,
+	0x2001, 0x0001, 0x080c, 0x25a0, 0x080c, 0x74bd, 0x00a0, 0x080c,
+	0x73c7, 0x0178, 0x2001, 0x0001, 0x080c, 0x25a0, 0x7098, 0x9086,
+	0x001e, 0x0120, 0x7098, 0x9086, 0x0022, 0x1118, 0x709b, 0x0025,
+	0x0010, 0x709b, 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e,
+	0x0005, 0x0026, 0x2011, 0x7352, 0x080c, 0x874a, 0x002e, 0x0016,
+	0x0026, 0x2009, 0x0064, 0x2011, 0x7352, 0x080c, 0x8741, 0x002e,
+	0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, 0x9e32, 0x2071,
+	0x1800, 0x080c, 0x72eb, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c,
+	0x9e32, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091,
+	0x8000, 0x6028, 0xc09c, 0x602a, 0x080c, 0xa896, 0x2011, 0x0003,
+	0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098,
+	0x080c, 0x86f6, 0x0036, 0x901e, 0x080c, 0xa118, 0x003e, 0x080c,
+	0xa8b2, 0x60e3, 0x0000, 0x080c, 0xe702, 0x080c, 0xe71d, 0x2009,
+	0x0004, 0x080c, 0x29f6, 0x080c, 0x2916, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x2011, 0x0008, 0x080c, 0x2a44, 0x2011, 0x7352, 0x080c,
+	0x874a, 0x080c, 0x7503, 0x0118, 0x9006, 0x080c, 0x2a0a, 0x080c,
+	0x0bc3, 0x2001, 0x0001, 0x080c, 0x25a0, 0x012e, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6,
+	0x2011, 0x735f, 0x2071, 0x1a03, 0x701c, 0x9206, 0x1118, 0x7018,
+	0x9005, 0x0110, 0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020,
+	0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8,
+	0x2001, 0x00c0, 0x080c, 0x2a0a, 0x0156, 0x20a9, 0x002d, 0x1d04,
+	0x73d7, 0x2091, 0x6000, 0x1f04, 0x73d7, 0x015e, 0x00d6, 0x2069,
+	0x1800, 0x689c, 0x8001, 0x0220, 0x0118, 0x689e, 0x00de, 0x0005,
+	0x689f, 0x0014, 0x68ec, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001,
+	0x1da8, 0x080c, 0x8756, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x77fc, 0x2001,
+	0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c,
+	0x266f, 0x9006, 0x080c, 0x2a0a, 0x080c, 0x5ee4, 0x0026, 0x2011,
+	0xffff, 0x080c, 0x2a44, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de,
+	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x2001, 0x197d, 0x200c, 0x9186, 0x0000,
+	0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186,
+	0x0003, 0x0158, 0x0804, 0x74ad, 0x709b, 0x0022, 0x0040, 0x709b,
+	0x0021, 0x0028, 0x709b, 0x0023, 0x0010, 0x709b, 0x0024, 0x60e3,
+	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x266f, 0x080c,
+	0xa896, 0x0026, 0x080c, 0xab5e, 0x002e, 0x080c, 0xa8b2, 0x7000,
+	0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020,
+	0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac,
+	0x0150, 0x012e, 0x015e, 0x080c, 0xcf52, 0x0118, 0x9006, 0x080c,
+	0x2a34, 0x0804, 0x74b9, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802,
+	0x080c, 0x29f0, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c,
+	0x2a0a, 0x1f04, 0x745e, 0x080c, 0x7540, 0x012e, 0x015e, 0x080c,
+	0x74fa, 0x0170, 0x6044, 0x9005, 0x0130, 0x080c, 0x7540, 0x9006,
+	0x8001, 0x1df0, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x7540,
+	0x080c, 0xcf52, 0x0118, 0x9006, 0x080c, 0x2a34, 0x0016, 0x0026,
+	0x7000, 0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x735f,
+	0x080c, 0x8708, 0x002e, 0x001e, 0x080c, 0x854a, 0x7034, 0xc085,
+	0x7036, 0x2001, 0x197d, 0x2003, 0x0004, 0x080c, 0x71b4, 0x080c,
+	0x74fa, 0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c,
+	0x77f2, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8561,
+	0x080c, 0x8553, 0x080c, 0x77fc, 0x2001, 0x196d, 0x2003, 0x0000,
+	0x9006, 0x709a, 0x60e2, 0x6886, 0x080c, 0x266f, 0x9006, 0x080c,
+	0x2a0a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0026, 0x2011, 0xffff,
+	0x080c, 0x2a44, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce,
+	0x0005, 0x0006, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x000e,
+	0x0005, 0x0006, 0x080c, 0x56de, 0x9084, 0x0030, 0x9086, 0x0000,
+	0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0x9084, 0x0030, 0x9086,
+	0x0030, 0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0x9084, 0x0030,
+	0x9086, 0x0010, 0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0x9084,
+	0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001,
+	0x180c, 0x2004, 0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x268f,
+	0x900e, 0x0028, 0x080c, 0x6a63, 0x1dc8, 0x2009, 0x0002, 0x2019,
+	0x0028, 0x080c, 0x31a6, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005,
+	0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130, 0x080c, 0xcf4b, 0x1128,
+	0x9085, 0x0010, 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005,
+	0x6050, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006,
+	0x6028, 0x0006, 0x602f, 0x0100, 0x602f, 0x0000, 0x602f, 0x0040,
+	0x602f, 0x0000, 0x20a9, 0x0002, 0x080c, 0x29d1, 0x0026, 0x2011,
+	0x0040, 0x080c, 0x2a44, 0x002e, 0x000e, 0x602a, 0x000e, 0x6006,
+	0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001,
+	0x2001, 0x0001, 0x080c, 0x266f, 0x2001, 0x00a0, 0x0006, 0x080c,
+	0xcf52, 0x000e, 0x0130, 0x080c, 0x2a28, 0x9006, 0x080c, 0x2a34,
+	0x0010, 0x080c, 0x2a0a, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5,
+	0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2981, 0x00fe, 0x000e,
+	0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c,
+	0xa8f4, 0x0158, 0x2001, 0x0386, 0x2004, 0xd0b4, 0x1130, 0x2001,
+	0x0016, 0x080c, 0xa887, 0x0804, 0x761d, 0x2001, 0x180c, 0x200c,
+	0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x2011, 0x0200,
+	0x080c, 0x2a44, 0x2001, 0x0090, 0x080c, 0x2a0a, 0x20a9, 0x0366,
+	0x6024, 0xd0cc, 0x1558, 0x1d04, 0x75b8, 0x2091, 0x6000, 0x1f04,
+	0x75b8, 0x080c, 0xa896, 0x2011, 0x0003, 0x080c, 0xa1cf, 0x2011,
+	0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098, 0x901e, 0x080c, 0xa118,
+	0x2001, 0x0386, 0x2003, 0x7000, 0x080c, 0xa8b2, 0x2001, 0x00a0,
+	0x080c, 0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c, 0xcf52,
+	0x0110, 0x080c, 0x0ce9, 0x9085, 0x0001, 0x04e8, 0x2001, 0x0386,
+	0x2004, 0xd0ac, 0x0110, 0x080c, 0x1adf, 0x60e3, 0x0000, 0x2001,
+	0x196d, 0x2004, 0x080c, 0x266f, 0x60e2, 0x2001, 0x0080, 0x080c,
+	0x2a0a, 0x20a9, 0x0366, 0x2011, 0x1e00, 0x080c, 0x2a44, 0x2009,
+	0x1e00, 0x080c, 0x29f0, 0x6024, 0x910c, 0x0140, 0x1d04, 0x75fb,
+	0x2091, 0x6000, 0x1f04, 0x75fb, 0x0804, 0x75c1, 0x2001, 0x0386,
+	0x2003, 0x7000, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b4, 0x9005,
+	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xcf52, 0x0110,
+	0x080c, 0x0ce9, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000, 0x9086,
+	0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540, 0x9086,
+	0x5540, 0x1128, 0x2069, 0x1a77, 0x2d04, 0x8000, 0x206a, 0x2069,
+	0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005, 0x1904,
+	0x7694, 0x2001, 0x0088, 0x080c, 0x2a0a, 0x9006, 0x60e2, 0x6886,
+	0x080c, 0x266f, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
+	0x9005, 0x01d0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x2011, 0x0400,
+	0x080c, 0x2a44, 0x2069, 0x198f, 0x7000, 0x206a, 0x709b, 0x0026,
+	0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x7674, 0x2091, 0x6000,
+	0x1f04, 0x7674, 0x0804, 0x76c6, 0x2069, 0x0140, 0x20a9, 0x0384,
+	0x2011, 0x1e00, 0x080c, 0x2a44, 0x2009, 0x1e00, 0x080c, 0x29f0,
+	0x6024, 0x910c, 0x0528, 0x9084, 0x1a00, 0x1510, 0x1d04, 0x7680,
+	0x2091, 0x6000, 0x1f04, 0x7680, 0x080c, 0xa896, 0x2011, 0x0003,
+	0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098,
+	0x901e, 0x080c, 0xa118, 0x080c, 0xa8b2, 0x2001, 0x00a0, 0x080c,
+	0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029, 0x9085, 0x0001, 0x00b0,
+	0x2001, 0x0080, 0x080c, 0x2a0a, 0x2069, 0x0140, 0x60e3, 0x0000,
+	0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
+	0x196d, 0x2004, 0x080c, 0x266f, 0x60e2, 0x9006, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
+	0x1800, 0x6020, 0x9084, 0x00c0, 0x01e8, 0x080c, 0xa896, 0x2011,
+	0x0003, 0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c,
+	0xa098, 0x901e, 0x080c, 0xa118, 0x080c, 0xa8b2, 0x2069, 0x0140,
+	0x2001, 0x00a0, 0x080c, 0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029,
+	0x0804, 0x7769, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5,
+	0x2102, 0x080c, 0x7347, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c,
+	0x2a0a, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
+	0x6808, 0x9005, 0x0190, 0x6028, 0x9084, 0xfdff, 0x602a, 0x2011,
+	0x0200, 0x080c, 0x2a44, 0x2069, 0x198f, 0x7000, 0x206a, 0x709b,
+	0x0027, 0x7003, 0x0001, 0x0804, 0x7769, 0x2011, 0x1e00, 0x080c,
+	0x2a44, 0x2009, 0x1e00, 0x080c, 0x29f0, 0x6024, 0x910c, 0x01c8,
+	0x9084, 0x1c00, 0x11b0, 0x1d04, 0x7725, 0x0006, 0x0016, 0x00c6,
+	0x00d6, 0x00e6, 0x080c, 0x8592, 0x00ee, 0x00de, 0x00ce, 0x001e,
+	0x000e, 0x00e6, 0x2071, 0x1a03, 0x7018, 0x00ee, 0x9005, 0x19e8,
+	0x0500, 0x0026, 0x2011, 0x735f, 0x080c, 0x863e, 0x2011, 0x7352,
+	0x080c, 0x874a, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4,
+	0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x196d,
+	0x2004, 0x080c, 0x266f, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4,
+	0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x080c, 0xcf4b, 0x1904, 0x77d7,
+	0x7130, 0xd184, 0x1170, 0x080c, 0x3368, 0x0138, 0xc18d, 0x7132,
+	0x2011, 0x1848, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904,
+	0x77d7, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x0538, 0x0016, 0x2019,
+	0x000e, 0x080c, 0xe239, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e,
+	0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6625,
+	0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xe2c9,
+	0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x88ec, 0x001e, 0x8108,
+	0x1f04, 0x77a0, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016,
+	0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x31a6, 0x001e, 0x0078,
+	0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6625, 0x1110,
+	0x080c, 0x6043, 0x8108, 0x1f04, 0x77cd, 0x00be, 0x015e, 0x080c,
+	0x1adf, 0x080c, 0xa896, 0x080c, 0xab5e, 0x080c, 0xa8b2, 0x60e3,
+	0x0000, 0x080c, 0x6029, 0x080c, 0x741a, 0x00ee, 0x00ce, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197d, 0x2003,
+	0x0001, 0x0005, 0x2001, 0x197d, 0x2003, 0x0000, 0x0005, 0x2001,
+	0x197c, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x197c, 0x2003, 0x0000,
+	0x0005, 0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c,
+	0x1053, 0x090c, 0x0d7d, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c,
+	0x1053, 0x090c, 0x0d7d, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867,
+	0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071,
+	0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840,
+	0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101,
+	0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006,
+	0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012,
+	0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001,
+	0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18fa, 0x6807,
+	0x0001, 0x00de, 0x080c, 0x7de4, 0x9006, 0x00ee, 0x0005, 0x900e,
+	0x0156, 0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04, 0x7863, 0x015e,
+	0x0005, 0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002, 0x7879,
+	0x787a, 0x78c5, 0x7920, 0x7a30, 0x7877, 0x7877, 0x7a5a, 0x080c,
+	0x0d7d, 0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0, 0x2003, 0x0000,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x7ec6, 0xd0a4, 0x0570, 0x2001,
+	0x1dc0, 0x2004, 0x9082, 0x0080, 0x1640, 0x1d04, 0x7897, 0x2001,
+	0x1a06, 0x200c, 0x8109, 0x0508, 0x2091, 0x6000, 0x2102, 0x7824,
 	0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a,
-	0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x7dd0, 0x0005,
-	0x7942, 0x794e, 0x7b23, 0x7942, 0x794e, 0x7942, 0x794e, 0x794e,
-	0x7942, 0x794e, 0x7b23, 0x794e, 0x794e, 0x794e, 0x794e, 0x794e,
-	0x7942, 0x794e, 0x7b23, 0x7942, 0x7942, 0x794e, 0x7942, 0x7942,
-	0x7942, 0x794e, 0x00e6, 0x2071, 0x18fa, 0x2009, 0x0400, 0x0071,
-	0x00ee, 0x0005, 0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000,
-	0x0029, 0x0005, 0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001,
-	0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6d70, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
-	0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7ac5, 0x7007,
-	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7ac5, 0x0005,
-	0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007,
-	0x0001, 0x0804, 0x7ae0, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
-	0x701a, 0x704b, 0x7ae0, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
-	0x0904, 0x794a, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7afc,
-	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7afc,
-	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
-	0x794a, 0x7007, 0x0001, 0x2009, 0x1834, 0x210c, 0x81ff, 0x11a8,
-	0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x62b2,
-	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a,
-	0xa982, 0x080c, 0x6d70, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071,
-	0x0d38, 0x9186, 0x0064, 0x0d20, 0x9186, 0x007c, 0x0d08, 0x9186,
-	0x0028, 0x09f0, 0x9186, 0x0038, 0x09d8, 0x9186, 0x0078, 0x09c0,
-	0x9186, 0x005f, 0x09a8, 0x9186, 0x0056, 0x0990, 0xa897, 0x4005,
-	0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x08a0, 0xa87c, 0x9084,
-	0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x7cf1,
-	0x2900, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c,
-	0x9080, 0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401,
-	0x1a04, 0x7952, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7952, 0x82ff,
-	0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7a83, 0x0018,
-	0x9280, 0x7a79, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7a64,
-	0x080c, 0x1053, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022,
-	0x7054, 0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004,
-	0x9100, 0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e,
-	0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108,
-	0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x1124, 0xa06c, 0x908e,
-	0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005,
-	0x7020, 0x2048, 0x080c, 0x106c, 0x7014, 0x2048, 0x0804, 0x7952,
-	0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048,
-	0xa906, 0x711a, 0x0804, 0x7a1c, 0x7014, 0x2048, 0x7007, 0x0001,
-	0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7cf1, 0x0804,
-	0x7ac5, 0x7a7b, 0x7a7f, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a,
-	0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076,
-	0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc,
-	0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0,
-	0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2,
-	0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094,
-	0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088,
-	0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c,
-	0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004,
-	0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1834, 0x210c,
-	0x81ff, 0x1178, 0x080c, 0x60b4, 0x1108, 0x0005, 0x080c, 0x6fb0,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xcb12, 0x080c, 0x6d70, 0x012e,
-	0x0ca0, 0x080c, 0xcf27, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70,
-	0x2009, 0x1834, 0x210c, 0x81ff, 0x1188, 0xa888, 0x9005, 0x0188,
-	0xa883, 0x0000, 0x080c, 0x6142, 0x1108, 0x0005, 0xa87a, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0x0cb8, 0x2001, 0x0028,
-	0x0ca8, 0x2001, 0x0000, 0x0c90, 0x2009, 0x1834, 0x210c, 0x81ff,
-	0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4,
-	0x0120, 0x080c, 0x6214, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c,
-	0x618f, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
-	0x080c, 0x6d70, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98,
-	0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906,
-	0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030,
-	0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6,
-	0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004,
-	0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9,
-	0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c,
-	0x661e, 0x11b8, 0x0066, 0xae80, 0x080c, 0x672e, 0x006e, 0x0088,
-	0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6,
-	0x080c, 0x661e, 0x1110, 0x080c, 0x68fd, 0x8108, 0x1f04, 0x7b60,
-	0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x106c, 0x00be, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0x00be, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6a57, 0x0580,
-	0x2061, 0x1a6f, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff,
-	0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003,
-	0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005,
-	0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff,
-	0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a,
-	0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x7dba,
-	0x012e, 0x0804, 0x7db4, 0x012e, 0x0804, 0x7dae, 0x012e, 0x0804,
-	0x7db1, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6a57,
-	0x05e0, 0x2061, 0x1a6f, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308,
-	0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c,
-	0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001,
-	0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988,
-	0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318,
-	0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250,
-	0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e,
-	0x0804, 0x7dba, 0x012e, 0x0804, 0x7db7, 0x012e, 0x0804, 0x7db4,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a6f, 0x6300,
-	0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804,
-	0x7dc8, 0x012e, 0x0804, 0x7db7, 0x00b6, 0x0126, 0x00c6, 0x2091,
-	0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061,
-	0x1a6f, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888,
-	0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1834, 0x2004,
-	0x9005, 0x0118, 0x080c, 0xac04, 0x0068, 0x6017, 0xf400, 0x6063,
-	0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x6162, 0x2009, 0x0041,
-	0x080c, 0xac68, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138,
-	0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x88bb, 0x002e, 0xa87c,
-	0xd0c4, 0x0148, 0x2061, 0x1a6f, 0x6000, 0xd08c, 0x1120, 0x6008,
-	0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7dba,
-	0x00ce, 0x012e, 0x00be, 0x0804, 0x7db4, 0xa984, 0x9186, 0x002e,
-	0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186,
-	0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8,
-	0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c,
-	0x661e, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065,
-	0x09b8, 0x6007, 0x0024, 0x2001, 0x1986, 0x2004, 0x601a, 0x0804,
-	0x7c4f, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001,
-	0x1834, 0x2004, 0x9005, 0x0150, 0x080c, 0xac04, 0x8eff, 0x0118,
-	0x2e60, 0x080c, 0xac04, 0x00ee, 0x0804, 0x7c4f, 0x6024, 0xc0dc,
-	0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130,
-	0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x91ed, 0x00ee, 0x0804, 0x7c4f, 0x2061,
-	0x1a6f, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7dc8, 0x0126,
-	0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804,
-	0x7dc8, 0x012e, 0xa883, 0x0016, 0x0804, 0x7dc1, 0xa883, 0x0007,
-	0x0804, 0x7dc1, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001,
-	0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x794a, 0x0040,
-	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7cf1,
-	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061,
-	0x1800, 0x61d0, 0x81ff, 0x1904, 0x7d73, 0x6130, 0xd194, 0x1904,
-	0x7d9d, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x0a04, 0x7d67, 0x6068,
-	0x9e02, 0x1a04, 0x7d67, 0x7120, 0x9186, 0x0006, 0x1904, 0x7d59,
-	0x7010, 0x905d, 0x0904, 0x7d73, 0xb800, 0xd0e4, 0x1904, 0x7d97,
-	0x2061, 0x1a6f, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0,
-	0x7024, 0xd0dc, 0x1904, 0x7da0, 0xa883, 0x0000, 0xa803, 0x0000,
-	0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904,
-	0x7da3, 0x080c, 0x56d3, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e,
-	0x2e60, 0x080c, 0x87ae, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048,
-	0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904,
-	0x7da3, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883,
-	0x0006, 0x00be, 0x0804, 0x7dc1, 0xd184, 0x0db8, 0xd1c4, 0x1190,
-	0x00a0, 0xa974, 0x080c, 0x661e, 0x15d0, 0xb800, 0xd0e4, 0x15b8,
-	0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883,
-	0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448,
-	0xa883, 0x0035, 0x0430, 0x080c, 0x56d7, 0xd0fc, 0x01e8, 0xa878,
-	0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6068, 0x9e02, 0x12a8, 0x7120,
-	0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc,
-	0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x7cfd,
-	0x7003, 0x0002, 0x0804, 0x7cfd, 0xa883, 0x0028, 0x0010, 0xa883,
-	0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8,
-	0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014,
-	0x080c, 0xddf2, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e,
-	0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009,
-	0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105,
-	0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0x0005,
-	0x080c, 0x106c, 0x0005, 0x00d6, 0x080c, 0x87a5, 0x00de, 0x0005,
-	0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c,
-	0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7eb2, 0xd09c, 0x11a8,
-	0x2071, 0x1800, 0x70c0, 0x90ea, 0x0020, 0x0278, 0x8001, 0x70c2,
-	0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071,
-	0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de,
-	0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7eb2, 0x000e, 0x0005,
-	0xa898, 0x9084, 0x0003, 0x05a8, 0x080c, 0xab73, 0x05d8, 0x2900,
-	0x6016, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x1138, 0x6028,
-	0xc0fd, 0x602a, 0x2001, 0x196b, 0x2004, 0x0098, 0xa8a0, 0x9084,
-	0x00ff, 0xa99c, 0x918c, 0xff00, 0x9105, 0xa99c, 0x918c, 0x00ff,
-	0x080c, 0x25fb, 0x1540, 0x00b6, 0x080c, 0x661e, 0x2b00, 0x00be,
-	0x1510, 0x6012, 0x6023, 0x0001, 0x2009, 0x0040, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0035, 0x0110, 0x2009, 0x0041, 0x080c, 0xac68,
-	0x0005, 0xa87b, 0x0101, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d70,
-	0x012e, 0x0005, 0xa87b, 0x002c, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6d70, 0x012e, 0x0005, 0xa87b, 0x0028, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6d70, 0x012e, 0x080c, 0xabc9, 0x0005, 0x00d6, 0x00c6,
-	0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282,
-	0x0004, 0x1a04, 0x7ea3, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d,
-	0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084,
-	0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0xab73, 0x1118, 0x080c,
-	0xac3b, 0x05a8, 0x6212, 0xa874, 0x0002, 0x7e81, 0x7e86, 0x7e89,
-	0x7e8f, 0x2019, 0x0002, 0x080c, 0xe20e, 0x0060, 0x080c, 0xe19e,
-	0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xe1bd, 0x0018, 0xa980,
-	0x080c, 0xe19e, 0x080c, 0xabc9, 0xa887, 0x0000, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6d70, 0x012e, 0x00be, 0x001e, 0x002e, 0x003e,
-	0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887, 0x0002,
-	0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887,
-	0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7eb4, 0x0006, 0x0016,
-	0x2001, 0x8003, 0x0006, 0x0804, 0x0d86, 0x2001, 0x1834, 0x2004,
-	0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001, 0x0200,
-	0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec,
-	0x1120, 0x080c, 0x1608, 0x00fe, 0x0005, 0x2001, 0x020d, 0x2003,
-	0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904,
-	0x7f35, 0x68c0, 0x90aa, 0x0005, 0x0a04, 0x8519, 0x7d44, 0x7c40,
-	0xd59c, 0x190c, 0x0d7d, 0x9584, 0x00f6, 0x1508, 0x9484, 0x7000,
-	0x0138, 0x908a, 0x2000, 0x1258, 0x9584, 0x0700, 0x8007, 0x04f0,
-	0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x0db0, 0x00b0, 0x9484,
-	0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0,
-	0x080c, 0xe6af, 0x080c, 0x8410, 0x7817, 0x0140, 0x00a8, 0x9584,
-	0x0076, 0x1118, 0x080c, 0x846c, 0x19c8, 0xd5a4, 0x0148, 0x0046,
-	0x0056, 0x080c, 0x7f85, 0x080c, 0x2115, 0x005e, 0x004e, 0x0020,
-	0x080c, 0xe6af, 0x7817, 0x0140, 0x080c, 0x74d5, 0x0168, 0x2001,
-	0x0111, 0x2004, 0xd08c, 0x0140, 0x6893, 0x0000, 0x2001, 0x0110,
-	0x2003, 0x0008, 0x2003, 0x0000, 0x0489, 0x0005, 0x0002, 0x7f42,
-	0x8232, 0x7f3f, 0x7f3f, 0x7f3f, 0x7f3f, 0x7f3f, 0x7f3f, 0x7817,
-	0x0140, 0x0005, 0x7000, 0x908c, 0xff00, 0x9194, 0xf000, 0x810f,
-	0x9484, 0x0fff, 0x6892, 0x9286, 0x2000, 0x1150, 0x6800, 0x9086,
-	0x0001, 0x1118, 0x080c, 0x5734, 0x0070, 0x080c, 0x7fa5, 0x0058,
-	0x9286, 0x3000, 0x1118, 0x080c, 0x816f, 0x0028, 0x9286, 0x8000,
-	0x1110, 0x080c, 0x8346, 0x7817, 0x0140, 0x0005, 0x2001, 0x1810,
-	0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
-	0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518, 0x080c, 0x4b00,
-	0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079,
-	0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036, 0x0046, 0x0056,
-	0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019, 0xffff, 0x2001,
-	0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c, 0x4b00, 0x002e,
-	0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6, 0x00c6, 0x7010,
-	0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120, 0x9096, 0x0023,
-	0x1904, 0x8140, 0x9186, 0x0023, 0x15c0, 0x080c, 0x83db, 0x0904,
-	0x8140, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186, 0x0004, 0x0138,
-	0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904, 0x8140, 0x7124,
-	0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015, 0x080c,
-	0xac68, 0x0804, 0x8140, 0x908e, 0x0214, 0x0118, 0x908e, 0x0210,
-	0x1130, 0x2009, 0x0015, 0x080c, 0xac68, 0x0804, 0x8140, 0x908e,
-	0x0100, 0x1904, 0x8140, 0x7034, 0x9005, 0x1904, 0x8140, 0x2009,
-	0x0016, 0x080c, 0xac68, 0x0804, 0x8140, 0x9186, 0x0022, 0x1904,
-	0x8140, 0x7030, 0x908e, 0x0300, 0x1580, 0x68dc, 0xd0a4, 0x0528,
-	0xc0b5, 0x68de, 0x7100, 0x918c, 0x00ff, 0x697e, 0x7004, 0x6882,
-	0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff,
-	0x0016, 0x2008, 0x080c, 0x2644, 0x7932, 0x7936, 0x001e, 0x000e,
-	0x00fe, 0x080c, 0x25fb, 0x695e, 0x703c, 0x00e6, 0x2071, 0x0140,
-	0x7086, 0x2071, 0x1800, 0x70b6, 0x00ee, 0x7034, 0x9005, 0x1904,
-	0x8140, 0x2009, 0x0017, 0x0804, 0x810d, 0x908e, 0x0400, 0x1190,
-	0x7034, 0x9005, 0x1904, 0x8140, 0x080c, 0x74d5, 0x0120, 0x2009,
-	0x001d, 0x0804, 0x810d, 0x68dc, 0xc0a5, 0x68de, 0x2009, 0x0030,
-	0x0804, 0x810d, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005, 0x1904,
-	0x8140, 0x2009, 0x0018, 0x0804, 0x810d, 0x908e, 0x2010, 0x1120,
-	0x2009, 0x0019, 0x0804, 0x810d, 0x908e, 0x2110, 0x1120, 0x2009,
-	0x001a, 0x0804, 0x810d, 0x908e, 0x5200, 0x1140, 0x7034, 0x9005,
-	0x1904, 0x8140, 0x2009, 0x001b, 0x0804, 0x810d, 0x908e, 0x5000,
-	0x1140, 0x7034, 0x9005, 0x1904, 0x8140, 0x2009, 0x001c, 0x0804,
-	0x810d, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804, 0x810d,
-	0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x8140, 0x2009,
-	0x0024, 0x0804, 0x810d, 0x908c, 0xff00, 0x918e, 0x2400, 0x1170,
-	0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c, 0x0904, 0x810d,
-	0x080c, 0xd62a, 0x1904, 0x8140, 0x0804, 0x810b, 0x908c, 0xff00,
-	0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804, 0x810d, 0x908e,
-	0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x810d, 0x908e, 0x6104,
-	0x1530, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208, 0x2204, 0x9082,
-	0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015, 0x211c, 0x8108,
-	0x0046, 0x2124, 0x080c, 0x4b00, 0x004e, 0x8108, 0x0f04, 0x80c1,
-	0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a, 0x2009, 0x0260,
-	0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0804, 0x810d, 0x908e,
-	0x6000, 0x1120, 0x2009, 0x003f, 0x0804, 0x810d, 0x908e, 0x5400,
-	0x1138, 0x080c, 0x84c9, 0x1904, 0x8140, 0x2009, 0x0046, 0x04a8,
-	0x908e, 0x5500, 0x1148, 0x080c, 0x84f1, 0x1118, 0x2009, 0x0041,
-	0x0460, 0x2009, 0x0042, 0x0448, 0x908e, 0x7800, 0x1118, 0x2009,
-	0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009, 0x004e, 0x00e8,
-	0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8, 0x908c, 0xff00,
-	0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078, 0x908c, 0xff00,
-	0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038, 0x2009, 0x001d,
-	0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016, 0x2011, 0x0263,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1568, 0x080c, 0x65bd,
-	0x1550, 0xbe12, 0xbd16, 0x001e, 0x0016, 0xb884, 0x9005, 0x1168,
-	0x9186, 0x0046, 0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506,
-	0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0xab73, 0x01a8,
-	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186,
-	0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xac68,
-	0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b00, 0x080c, 0xac3b,
-	0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e,
-	0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007,
-	0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000,
-	0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x91f4, 0x08a0, 0x080c,
-	0x332b, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008,
-	0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x83db, 0x0904,
-	0x81ca, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034,
-	0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0xac68, 0x0498, 0x908e,
-	0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009, 0x0016, 0x080c,
-	0xac68, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030, 0x908e, 0x1400,
-	0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211,
-	0x220c, 0x080c, 0x25fb, 0x11a8, 0x080c, 0x65bd, 0x1190, 0xbe12,
-	0xbd16, 0x080c, 0xab73, 0x0168, 0x2b08, 0x6112, 0x080c, 0xcca8,
-	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0xac68, 0x0010,
-	0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x0046,
-	0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8, 0x9592,
-	0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804,
-	0x822c, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x822c,
-	0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000,
-	0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9, 0x0800,
-	0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f, 0x2071,
-	0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0, 0x9496,
-	0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600, 0x9706,
-	0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745, 0x1148,
-	0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6, 0x0080,
-	0x1d20, 0x8420, 0x8e70, 0x1f04, 0x8201, 0x82ff, 0x1118, 0x9085,
-	0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e,
-	0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f,
-	0x0002, 0x8249, 0x8249, 0x8249, 0x83ed, 0x8249, 0x824c, 0x8271,
-	0x82fa, 0x8249, 0x8249, 0x8249, 0x8249, 0x8249, 0x8249, 0x8249,
-	0x8249, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
-	0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a, 0x1ddc, 0x02a8,
-	0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158,
-	0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x0046, 0x080c, 0xac68, 0x7817, 0x0140, 0x00be,
-	0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904, 0x82d6, 0x7110,
-	0xd1bc, 0x1904, 0x82d6, 0x7108, 0x700c, 0x2028, 0x918c, 0x00ff,
-	0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8, 0x9080, 0x336d,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080, 0x9106, 0x0904,
-	0x82d6, 0x9182, 0x0801, 0x1a04, 0x82d6, 0x9190, 0x1000, 0x2204,
-	0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15b8, 0xba04,
-	0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c, 0xab73, 0x0598,
-	0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112, 0x6023, 0x0006,
-	0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xd88c, 0x00f8, 0x080c,
-	0x6a5b, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c, 0x81ce, 0x11b0,
-	0x0880, 0x080c, 0xab73, 0x2b08, 0x0188, 0x6112, 0x6023, 0x0004,
-	0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005, 0x0010,
-	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x91f4, 0x7817, 0x0140,
-	0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
-	0x2011, 0x8049, 0x080c, 0x4b00, 0x080c, 0xac3b, 0x0d78, 0x2b08,
-	0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x6017,
-	0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c,
-	0x91ed, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0, 0x7020, 0x2060,
-	0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690, 0x6868, 0x9c02,
-	0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650, 0x7008, 0x9084,
-	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510, 0x700c, 0xb914,
-	0x9106, 0x11f0, 0x7124, 0x610a, 0x601c, 0xd0fc, 0x11c8, 0x2001,
-	0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff, 0x9082, 0x000c,
-	0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001, 0x8631, 0x1de0,
-	0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045, 0x080c, 0xac68,
-	0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002, 0x0128,
-	0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c, 0x332b,
-	0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000, 0x1130,
-	0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005, 0x835d,
-	0x835e, 0x835d, 0x835d, 0x83bd, 0x83cc, 0x0005, 0x00b6, 0x7110,
-	0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x83bb, 0x700c, 0x7108,
-	0x080c, 0x25fb, 0x1904, 0x83bb, 0x080c, 0x65bd, 0x1904, 0x83bb,
-	0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x6a5b, 0x0118,
-	0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x83db, 0x00ce, 0x05d8,
-	0x080c, 0xab73, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xcca8, 0x6023,
-	0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xac68, 0x0458,
-	0x080c, 0x6a5b, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c, 0x6a63,
-	0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xab73, 0x2b08, 0x01d8,
-	0x6112, 0x080c, 0xcca8, 0x6023, 0x0005, 0x7120, 0x610a, 0x2009,
-	0x0088, 0x080c, 0xac68, 0x0078, 0x080c, 0xab73, 0x2b08, 0x0158,
-	0x6112, 0x080c, 0xcca8, 0x6023, 0x0004, 0x7120, 0x610a, 0x2009,
-	0x0001, 0x080c, 0xac68, 0x00be, 0x0005, 0x7110, 0xd1bc, 0x0158,
-	0x00d1, 0x0148, 0x080c, 0x833c, 0x1130, 0x7124, 0x610a, 0x2009,
-	0x0089, 0x080c, 0xac68, 0x0005, 0x7110, 0xd1bc, 0x0158, 0x0059,
-	0x0148, 0x080c, 0x833c, 0x1130, 0x7124, 0x610a, 0x2009, 0x008a,
-	0x080c, 0xac68, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0003, 0x1158,
-	0x9c82, 0x1ddc, 0x0240, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1218,
-	0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110, 0xd1bc,
-	0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0, 0x9c82, 0x1ddc,
-	0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff, 0x6110,
-	0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106, 0x1120,
-	0x2009, 0x0051, 0x080c, 0xac68, 0x7817, 0x0140, 0x00be, 0x0005,
-	0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005,
-	0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005,
-	0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086, 0xc000,
-	0x05c0, 0x080c, 0xab73, 0x05a8, 0x0066, 0x00c6, 0x0046, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1590, 0x080c,
-	0x65bd, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012,
-	0x080c, 0xcca8, 0x080c, 0x103a, 0x0500, 0x2900, 0x6062, 0x9006,
-	0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9, 0x000e,
-	0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003, 0x006e,
-	0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x91f4, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0xabc9, 0x006e,
-	0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c, 0xff00,
-	0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x84c3, 0x9186,
-	0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904, 0x84c5,
-	0x7030, 0x908e, 0x0400, 0x0904, 0x84c5, 0x908e, 0x6000, 0x05e8,
-	0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009, 0x1837,
-	0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x6a19, 0x0558,
-	0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106, 0x1518,
-	0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104, 0x9106, 0x11d8,
-	0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8, 0x908e, 0x5200,
-	0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000, 0x09b8, 0x0058,
-	0x9186, 0x0023, 0x1140, 0x080c, 0x83db, 0x0128, 0x6004, 0x9086,
-	0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce,
-	0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020, 0x8427,
-	0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1805,
-	0x2011, 0x027a, 0x080c, 0xbb8a, 0x1178, 0xd48c, 0x0148, 0x20a9,
-	0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c, 0xbb8a, 0x1120,
-	0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e, 0x015e,
-	0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020, 0x8427,
-	0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1805,
-	0x2011, 0x0272, 0x080c, 0xbb8a, 0x1178, 0xd48c, 0x0148, 0x20a9,
-	0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c, 0xbb8a, 0x1120,
-	0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e, 0x015e,
-	0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc, 0x7802,
-	0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084, 0x1130,
-	0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe, 0x0005,
-	0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee, 0x0005,
-	0x2071, 0x1a03, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006, 0x701a,
-	0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x7026, 0x702b,
-	0x9e30, 0x7032, 0x7037, 0x9ead, 0x703f, 0xffff, 0x7042, 0x7047,
-	0x556a, 0x704a, 0x705b, 0x86e0, 0x080c, 0x1053, 0x090c, 0x0d7d,
-	0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab, 0xdcb0,
-	0x0005, 0x2071, 0x1a03, 0x1d04, 0x85fc, 0x2091, 0x6000, 0x700c,
-	0x8001, 0x700e, 0x1590, 0x2001, 0x013c, 0x2004, 0x9005, 0x190c,
-	0x878a, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c,
-	0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c,
-	0x0d7d, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091, 0x8000,
-	0x2069, 0x1800, 0x69ec, 0xd1e4, 0x1138, 0xd1dc, 0x1118, 0x080c,
-	0x874e, 0x0010, 0x080c, 0x8725, 0x7040, 0x900d, 0x0148, 0x8109,
-	0x7142, 0x1130, 0x7044, 0x080f, 0x0018, 0x0126, 0x2091, 0x8000,
-	0x7024, 0x900d, 0x0188, 0x7020, 0x8001, 0x7022, 0x1168, 0x7023,
-	0x0009, 0x8109, 0x7126, 0x9186, 0x03e8, 0x1110, 0x7028, 0x080f,
-	0x81ff, 0x1110, 0x7028, 0x080f, 0x7030, 0x900d, 0x0180, 0x702c,
-	0x8001, 0x702e, 0x1160, 0x702f, 0x0009, 0x8109, 0x7132, 0x0128,
-	0x9184, 0x007f, 0x090c, 0x9f49, 0x0010, 0x7034, 0x080f, 0x703c,
-	0x9005, 0x0118, 0x0310, 0x8001, 0x703e, 0x704c, 0x900d, 0x0168,
-	0x7048, 0x8001, 0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e,
-	0x1120, 0x7150, 0x714e, 0x7058, 0x080f, 0x7018, 0x900d, 0x01d8,
-	0x0016, 0x7070, 0x900d, 0x0158, 0x706c, 0x8001, 0x706e, 0x1138,
-	0x706f, 0x0009, 0x8109, 0x7172, 0x1110, 0x7074, 0x080f, 0x001e,
-	0x7008, 0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a,
-	0x1110, 0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x8624, 0x8625,
-	0x864f, 0x00e6, 0x2071, 0x1a03, 0x7018, 0x9005, 0x1120, 0x711a,
-	0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
-	0x1a03, 0x701c, 0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076,
-	0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1a03, 0xb888, 0x9102,
-	0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005, 0x00b6, 0x2031, 0x0010,
-	0x7110, 0x080c, 0x661e, 0x11a8, 0xb888, 0x8001, 0x0290, 0xb88a,
-	0x1180, 0x0126, 0x2091, 0x8000, 0x0066, 0xb8d0, 0x9005, 0x0138,
-	0x0026, 0xba3c, 0x0016, 0x080c, 0x6749, 0x001e, 0x002e, 0x006e,
-	0x012e, 0x8108, 0x9182, 0x0800, 0x1220, 0x8631, 0x0128, 0x7112,
-	0x0c00, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x2031,
-	0x0010, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6048, 0x9005,
-	0x0128, 0x8001, 0x604a, 0x1110, 0x080c, 0xcb29, 0x6018, 0x9005,
-	0x0904, 0x86a7, 0x00f6, 0x2079, 0x0300, 0x7918, 0xd1b4, 0x1904,
-	0x86ba, 0x781b, 0x2020, 0xa001, 0x7918, 0xd1b4, 0x0120, 0x781b,
-	0x2000, 0x0804, 0x86ba, 0x8001, 0x601a, 0x0106, 0x781b, 0x2000,
-	0xa001, 0x7918, 0xd1ac, 0x1dd0, 0x010e, 0x00fe, 0x1540, 0x6120,
-	0x9186, 0x0003, 0x0148, 0x9186, 0x0006, 0x0130, 0x9186, 0x0009,
-	0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c, 0xc814, 0x01b0, 0x6014,
-	0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082, 0x1999, 0xa886,
-	0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b,
-	0x9108, 0x611a, 0x080c, 0xcf5a, 0x0110, 0x080c, 0xc512, 0x012e,
-	0x9c88, 0x001c, 0x7116, 0x2001, 0x181a, 0x2004, 0x9102, 0x1228,
-	0x8631, 0x0138, 0x2160, 0x0804, 0x8653, 0x7017, 0x1ddc, 0x7007,
-	0x0000, 0x0005, 0x00fe, 0x0c58, 0x00e6, 0x2071, 0x1a03, 0x7027,
-	0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001, 0x1a0c, 0x2003,
-	0x0000, 0x0005, 0x00e6, 0x2071, 0x1a03, 0x7132, 0x702f, 0x0009,
-	0x00ee, 0x0005, 0x2011, 0x1a0f, 0x2013, 0x0000, 0x0005, 0x00e6,
-	0x2071, 0x1a03, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005,
-	0x0086, 0x0026, 0x7054, 0x8000, 0x7056, 0x2001, 0x1a11, 0x2044,
-	0xa06c, 0x9086, 0x0000, 0x0150, 0x7068, 0xa09a, 0x7064, 0xa096,
-	0x7060, 0xa092, 0x705c, 0xa08e, 0x080c, 0x1124, 0x002e, 0x008e,
-	0x0005, 0x0006, 0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x0156, 0x080c, 0x8561, 0x015e, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x001e, 0x000e, 0x0005,
-	0x00e6, 0x2071, 0x1a03, 0x7172, 0x7276, 0x706f, 0x0009, 0x00ee,
-	0x0005, 0x00e6, 0x0006, 0x2071, 0x1a03, 0x7074, 0x9206, 0x1110,
-	0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x2069, 0x1800, 0x69ec,
-	0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140, 0x6a54, 0x6874, 0x9202,
-	0x0288, 0x8117, 0x9294, 0x00c1, 0x0088, 0x9184, 0x0007, 0x01a0,
-	0x8109, 0x9184, 0x0007, 0x0110, 0x69ee, 0x0070, 0x8107, 0x9084,
-	0x0007, 0x910d, 0x8107, 0x9106, 0x9094, 0x00c1, 0x9184, 0xff3e,
-	0x9205, 0x68ee, 0x080c, 0x0f05, 0x002e, 0x0005, 0x69e8, 0x9184,
-	0x003f, 0x05b8, 0x8109, 0x9184, 0x003f, 0x01a8, 0x6a54, 0x6874,
-	0x9202, 0x0220, 0xd1bc, 0x0168, 0xc1bc, 0x0018, 0xd1bc, 0x1148,
-	0xc1bd, 0x2110, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27, 0x00ee,
-	0x0400, 0x69ea, 0x00f0, 0x0026, 0x8107, 0x9094, 0x0007, 0x0128,
-	0x8001, 0x8007, 0x9085, 0x0007, 0x0050, 0x2010, 0x8004, 0x8004,
-	0x8004, 0x9084, 0x0007, 0x9205, 0x8007, 0x9085, 0x0028, 0x9086,
-	0x0040, 0x2010, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27, 0x00ee,
-	0x002e, 0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061,
-	0x0100, 0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f,
-	0x1220, 0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005,
-	0x00c6, 0x2061, 0x1a6f, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003,
-	0x8003, 0x8003, 0x9080, 0x1a6f, 0x2060, 0x0005, 0xa884, 0x908a,
-	0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a6f, 0x6014,
-	0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff,
-	0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c,
-	0x00c0, 0x918e, 0x00c0, 0x0904, 0x8865, 0xd0b4, 0x1168, 0xd0bc,
-	0x1904, 0x883e, 0x2009, 0x0006, 0x080c, 0x8892, 0x0005, 0x900e,
-	0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05c8, 0x908c, 0x2023,
-	0x1550, 0x87ff, 0x1540, 0x6124, 0x918c, 0x0500, 0x1520, 0x6100,
-	0x918e, 0x0007, 0x1500, 0x2009, 0x1869, 0x210c, 0xd184, 0x11d8,
-	0x6003, 0x0003, 0x6007, 0x0043, 0x6047, 0xb035, 0x080c, 0x1c03,
-	0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000, 0x00f6, 0x2079, 0x0380,
-	0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013, 0x2c00, 0x7836, 0x781b,
-	0x8080, 0x00fe, 0x0005, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003,
-	0x1904, 0x888c, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x6024,
-	0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084, 0x1138, 0x87ff,
-	0x1120, 0x2009, 0x0043, 0x0804, 0xac68, 0x0005, 0x87ff, 0x1de8,
-	0x2009, 0x0042, 0x0804, 0xac68, 0x6110, 0x00b6, 0x2158, 0xb900,
-	0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026, 0x0c00, 0xc0d4,
-	0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0, 0xd0fc, 0x0160,
-	0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x888c, 0x908c,
-	0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78, 0x080c,
-	0x1731, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042, 0x080c,
-	0xac68, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
-	0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc, 0x0188, 0x908c,
-	0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003, 0x908e, 0x0002,
-	0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0xac68, 0x0005,
-	0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c, 0xac68,
-	0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20,
-	0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019, 0x0005,
-	0x2009, 0x0001, 0x0096, 0x080c, 0xc814, 0x0518, 0x6014, 0x2048,
-	0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c, 0x918c,
-	0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a6f, 0x6200,
-	0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c,
-	0x6ba5, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c, 0x87ae,
-	0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a6f, 0x6000,
-	0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce, 0x015e,
-	0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120, 0x8001,
-	0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923, 0x7003, 0x0006,
-	0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001, 0x080c, 0x1053,
-	0x090c, 0x0d7d, 0xa867, 0x0006, 0xa86b, 0x0001, 0xa8ab, 0xdcb0,
-	0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000, 0x0005, 0x0096,
-	0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c, 0x721e, 0x6b30,
-	0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a, 0xa89a, 0x6824,
-	0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a, 0x9005, 0x0148,
-	0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100, 0x9210, 0x1208,
-	0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178, 0xc084, 0x7007,
-	0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d, 0x2104, 0x9082,
-	0x0007, 0x2009, 0x1b4e, 0x200a, 0x000e, 0xc095, 0x7012, 0x2008,
-	0x2001, 0x003b, 0x080c, 0x1679, 0x9006, 0x2071, 0x193c, 0x7002,
-	0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6, 0x0126, 0x0156,
-	0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001, 0x0008, 0x910a,
-	0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080, 0x0008, 0x1f04,
-	0x8945, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877, 0x20a9, 0x0007,
-	0x00c6, 0x080c, 0xab73, 0x6023, 0x0009, 0x6003, 0x0004, 0x601f,
-	0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c, 0x8acb, 0x012e,
-	0x1f04, 0x8951, 0x9006, 0x00ce, 0x015e, 0x012e, 0x00ee, 0x0005,
-	0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096, 0x0086, 0x0056,
-	0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004, 0xd084, 0x1128,
-	0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021, 0x002c, 0x2029,
-	0x000a, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x2900, 0x6016, 0x2058,
-	0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a, 0xa8aa, 0xa887,
-	0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010, 0xa89e, 0xae8a,
-	0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160, 0x080c, 0x103a,
-	0x090c, 0x0d7d, 0xad66, 0x2b00, 0xa802, 0x2900, 0xb806, 0x2058,
-	0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e, 0x009e, 0x00be,
-	0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923, 0x7004, 0x004b,
-	0x700c, 0x0002, 0x89bd, 0x89b6, 0x89b6, 0x0005, 0x89c7, 0x8a28,
-	0x8a28, 0x8a28, 0x8a29, 0x8a3a, 0x8a3a, 0x700c, 0x0cba, 0x0126,
-	0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128, 0x78a0, 0x79a0,
-	0x9106, 0x1904, 0x8a1b, 0x2001, 0x0005, 0x2004, 0xd0bc, 0x0130,
-	0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e, 0x7018,
-	0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c, 0x8a69, 0x0490,
-	0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210, 0x2009, 0x000a,
-	0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004, 0x9100, 0x9202,
-	0x0e48, 0x080c, 0x8bb5, 0x2200, 0x9102, 0x0208, 0x2208, 0x0096,
-	0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c, 0x8cbe, 0x2100,
-	0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091, 0x8000, 0x2009,
-	0x1a21, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002, 0x012e, 0x080c,
-	0x1143, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc, 0x0130,
-	0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e, 0x0005,
-	0x0005, 0x700c, 0x0002, 0x8a2e, 0x8a31, 0x8a30, 0x080c, 0x89c5,
-	0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048, 0xa974, 0x009e,
-	0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048, 0x7018, 0x9100,
-	0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020, 0xa892, 0x9006,
-	0x0068, 0x0006, 0x080c, 0x8cbe, 0x2100, 0xaa8c, 0x9210, 0xaa8e,
-	0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e, 0x009e, 0x2f08,
-	0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6, 0x2071, 0x1923,
-	0x700c, 0x0002, 0x8a67, 0x8a67, 0x8a65, 0x700f, 0x0001, 0x00ee,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005, 0x0508, 0x2078,
-	0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000, 0x080c, 0x8ad4,
-	0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c, 0x8b1b, 0x00ee,
-	0x0178, 0x0096, 0x080c, 0x1053, 0x2900, 0x009e, 0x0148, 0xa8aa,
-	0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000, 0x012e, 0x08c8,
-	0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6, 0x2940, 0x2650,
-	0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f, 0x2068, 0x9d88,
-	0x1e55, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c, 0x8c43, 0x080c,
-	0x1e2b, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f, 0x2004, 0xa88a,
-	0x080c, 0x1731, 0x781f, 0x0101, 0x7813, 0x0000, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x8b2a, 0x012e, 0x008e, 0x00ce, 0x00de, 0x0005,
-	0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032, 0x2001, 0x1946,
-	0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923, 0x7030, 0x600e,
-	0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6, 0x0026, 0x9b80,
-	0x8d9d, 0x2005, 0x906d, 0x090c, 0x0d7d, 0x9b80, 0x8d95, 0x2005,
-	0x9065, 0x090c, 0x0d7d, 0x6114, 0x2600, 0x9102, 0x0248, 0x6828,
-	0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce, 0x00de, 0x0005,
-	0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178, 0xc085, 0x6856,
-	0x2011, 0x8026, 0x080c, 0x4b00, 0x684c, 0x0096, 0x904d, 0x090c,
-	0x0d7d, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006, 0x2030, 0x0c20,
-	0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011, 0x8025, 0x080c,
-	0x4b00, 0x684c, 0x0096, 0x904d, 0x090c, 0x0d7d, 0xa800, 0x8000,
-	0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008, 0x8319, 0x7104,
-	0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210, 0x9302, 0x0008,
-	0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c, 0x0d7d, 0x781c,
-	0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0d7d, 0x2069, 0x193c,
-	0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904, 0x8108, 0x9182,
-	0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e, 0x2003, 0x0000,
-	0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014, 0x2048, 0xa8a8,
-	0x0096, 0x2048, 0x9005, 0x190c, 0x106c, 0x009e, 0xa8ab, 0x0000,
-	0x080c, 0x0fec, 0x080c, 0xabc9, 0x00ce, 0x009e, 0x0005, 0x6020,
-	0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110, 0x9006, 0x0005,
-	0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000, 0x0178, 0x6010,
-	0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8ed0, 0x00be, 0x6013,
-	0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861, 0x0005, 0x2009,
-	0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071, 0x1923, 0x7110,
-	0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000, 0x7112, 0x2001,
-	0x003b, 0x080c, 0x1679, 0x00ee, 0x0005, 0x0096, 0x00d6, 0x9006,
-	0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016, 0x702a, 0x7026,
-	0x702f, 0x0000, 0x080c, 0x8d1d, 0x0170, 0x080c, 0x8d52, 0x0158,
-	0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001, 0x701f, 0x000a,
-	0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6, 0x0096, 0x0086,
-	0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100, 0x9202, 0x1618,
-	0x080c, 0x8d52, 0x090c, 0x0d7d, 0x7018, 0x9005, 0x1160, 0x2900,
-	0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e, 0xa806, 0xa802,
-	0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900, 0xa002, 0x701a,
-	0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c, 0x9080, 0x000a,
-	0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de, 0x008e, 0x009e,
-	0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f, 0x831e, 0x831e,
-	0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398, 0x0003, 0x7104,
-	0x080c, 0x8cbe, 0x810c, 0x2100, 0x9318, 0x8003, 0x2228, 0x2021,
-	0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500, 0x8004, 0x20a8,
-	0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c, 0x8cc7, 0x2130,
-	0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102, 0x701e, 0x7004,
-	0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000, 0x2048, 0xa800,
-	0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c, 0x8bb5, 0x002e,
-	0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000, 0x0008, 0x7106,
-	0x2500, 0x9212, 0x1904, 0x8bf4, 0x012e, 0x00ee, 0x014e, 0x013e,
-	0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x9580, 0x8d95, 0x2005, 0x9075, 0x090c, 0x0d7d, 0x080c,
-	0x8c99, 0x012e, 0x9580, 0x8d91, 0x2005, 0x9075, 0x090c, 0x0d7d,
-	0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f, 0x831e, 0x831e,
-	0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100, 0x2098, 0xa860,
-	0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9, 0x0002, 0x4003,
-	0x2e0c, 0x2d00, 0x0002, 0x8c83, 0x8c83, 0x8c85, 0x8c83, 0x8c85,
-	0x8c83, 0x8c83, 0x8c83, 0x8c83, 0x8c83, 0x8c8b, 0x8c83, 0x8c8b,
-	0x8c83, 0x8c83, 0x8c83, 0x080c, 0x0d7d, 0x4104, 0x20a9, 0x0002,
-	0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003, 0x4104, 0x4003,
-	0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee, 0x002e, 0x001e,
-	0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c, 0x2110, 0x00f1,
-	0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282, 0x000a, 0x1198,
-	0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006, 0x080c, 0x8d61,
-	0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010, 0x8001, 0x7012,
-	0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005, 0x0006, 0x810b,
-	0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e, 0x0005, 0x0006,
-	0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c, 0x0240, 0x900e,
-	0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e, 0x0005, 0x900e,
-	0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810, 0x2019, 0x0001,
-	0x2031, 0x8d07, 0x9112, 0x0220, 0x0118, 0x8318, 0x2208, 0x0cd0,
-	0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804, 0xd084, 0x2300,
-	0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967, 0x0a67, 0x8420,
-	0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082, 0x0002, 0x0967,
-	0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67, 0x0cd0, 0x6c1a,
-	0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800, 0x7128, 0x6810,
-	0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318, 0x0cd8, 0x2031,
-	0x8d1a, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096, 0x0046, 0x0126,
-	0x2091, 0x8000, 0x2b00, 0x9080, 0x8d99, 0x2005, 0x9005, 0x090c,
-	0x0d7d, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1053, 0x01d0, 0x2900,
-	0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c, 0x1053, 0x0188,
-	0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026, 0x94a2, 0x000a,
-	0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e, 0x004e, 0x009e,
-	0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00, 0x080c, 0x106c,
-	0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024, 0x2048, 0x9005,
-	0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802, 0x2900, 0x7026,
-	0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004, 0x9005, 0x0138,
-	0x2048, 0xa800, 0x0006, 0x080c, 0x106c, 0x000e, 0x0cb8, 0x009e,
-	0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048, 0xa800, 0x0006,
-	0x080c, 0x106c, 0x000e, 0x0cb8, 0x9006, 0x7002, 0x700a, 0x7006,
-	0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026, 0x702e, 0x009e,
-	0x0005, 0x1a6d, 0x0000, 0x0000, 0x0000, 0x1930, 0x0000, 0x0000,
-	0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877, 0x0000, 0x0000,
-	0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8, 0x2040, 0x2071,
-	0x1877, 0x080c, 0x8ebb, 0xa067, 0x0023, 0x6010, 0x905d, 0x0904,
-	0x8e90, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0, 0xa176, 0x2001,
-	0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000, 0xa898, 0x9005,
-	0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031, 0x0018, 0xa068,
-	0x908a, 0x0019, 0x1a0c, 0x0d7d, 0x2020, 0x2050, 0x2940, 0xa864,
-	0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x1e55, 0x2c65, 0x9786,
-	0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082,
-	0x001b, 0x0002, 0x8dfd, 0x8dfd, 0x8dff, 0x8dfd, 0x8dfd, 0x8dfd,
-	0x8e01, 0x8dfd, 0x8dfd, 0x8dfd, 0x8e03, 0x8dfd, 0x8dfd, 0x8dfd,
-	0x8e05, 0x8dfd, 0x8dfd, 0x8dfd, 0x8e07, 0x8dfd, 0x8dfd, 0x8dfd,
-	0x8e09, 0x8dfd, 0x8dfd, 0x8dfd, 0x8e0b, 0x080c, 0x0d7d, 0xa180,
-	0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0, 0x0488, 0xa1c0,
-	0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a, 0x0034, 0x1a0c,
-	0x0d7d, 0x9082, 0x001b, 0x0002, 0x8e2f, 0x8e2d, 0x8e2d, 0x8e2d,
-	0x8e2d, 0x8e2d, 0x8e31, 0x8e2d, 0x8e2d, 0x8e2d, 0x8e2d, 0x8e2d,
-	0x8e33, 0x8e2d, 0x8e2d, 0x8e2d, 0x8e2d, 0x8e2d, 0x8e35, 0x8e2d,
-	0x8e2d, 0x8e2d, 0x8e2d, 0x8e2d, 0x8e37, 0x080c, 0x0d7d, 0xa180,
-	0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8, 0x0008, 0xa1e0,
-	0x2600, 0x0002, 0x8e53, 0x8e55, 0x8e57, 0x8e59, 0x8e5b, 0x8e5d,
-	0x8e5f, 0x8e61, 0x8e63, 0x8e65, 0x8e67, 0x8e69, 0x8e6b, 0x8e6d,
-	0x8e6f, 0x8e71, 0x8e73, 0x8e75, 0x8e77, 0x8e79, 0x8e7b, 0x8e7d,
-	0x8e7f, 0x8e81, 0x8e83, 0x080c, 0x0d7d, 0xb9e2, 0x0468, 0xb9de,
-	0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2, 0x0428, 0xb9ce,
-	0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2, 0x00e8, 0xb9be,
-	0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2, 0x00a8, 0xb9ae,
-	0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2, 0x0068, 0xb99e,
-	0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992, 0x0028, 0xb98e,
-	0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421, 0x0120, 0x080c,
-	0x1e2b, 0x0804, 0x8dd7, 0x00ae, 0x00be, 0x00ce, 0x00ee, 0x0005,
-	0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff, 0x9006, 0x0804,
-	0x8db9, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058, 0xb810, 0x9005,
-	0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0xbba0, 0x2021,
-	0x0004, 0x2011, 0x8014, 0x080c, 0x4b00, 0x004e, 0x003e, 0x00be,
-	0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834, 0x910a, 0xa936,
-	0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238, 0x0130, 0x7010,
-	0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a, 0xa26a, 0x0005,
-	0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b, 0x0200, 0x7818,
-	0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001, 0x7818, 0xd094,
-	0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079, 0x0000, 0x2c08,
-	0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106, 0x0140, 0x2d00,
-	0x2078, 0x680c, 0x9005, 0x090c, 0x0d7d, 0x2068, 0x0cb0, 0x6b0c,
-	0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b, 0x0200, 0x003e,
-	0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0036,
-	0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff, 0x2071, 0x0300,
-	0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04, 0x8f10, 0x701b,
-	0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90, 0xb8ac, 0x9005,
-	0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004, 0x601b, 0x0000,
-	0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048, 0xa88b, 0x0000,
-	0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0d7d, 0x080c, 0x106c,
-	0x080c, 0x8acb, 0x0c18, 0x2071, 0x0300, 0x701b, 0x0200, 0x015e,
-	0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6,
-	0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x25fb, 0x015e, 0x11b0,
-	0x080c, 0x65bd, 0x190c, 0x0d7d, 0x000e, 0x001e, 0xb912, 0xb816,
-	0x080c, 0xab73, 0x0140, 0x2b00, 0x6012, 0x6023, 0x0001, 0x2009,
-	0x0001, 0x080c, 0xac68, 0x00be, 0x00ce, 0x0005, 0x000e, 0x001e,
-	0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013,
-	0x006e, 0x0005, 0x8f82, 0x8f82, 0x8f82, 0x8f84, 0x8fcd, 0x8f82,
-	0x8f82, 0x8f82, 0x9030, 0x8f82, 0x9068, 0x8f82, 0x8f82, 0x8f82,
-	0x8f82, 0x8f82, 0x080c, 0x0d7d, 0x9182, 0x0040, 0x0002, 0x8f97,
-	0x8f97, 0x8f97, 0x8f97, 0x8f97, 0x8f97, 0x8f97, 0x8f97, 0x8f97,
-	0x8f99, 0x8faa, 0x8f97, 0x8f97, 0x8f97, 0x8f97, 0x8fbb, 0x080c,
-	0x0d7d, 0x0096, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6,
-	0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6b70, 0x080c, 0xabc9,
-	0x009e, 0x0005, 0x080c, 0x960a, 0x00d6, 0x6114, 0x080c, 0xc814,
-	0x0130, 0x0096, 0x6114, 0x2148, 0x080c, 0x6d70, 0x009e, 0x00de,
-	0x080c, 0xabc9, 0x0005, 0x080c, 0x960a, 0x080c, 0x31e4, 0x6114,
-	0x0096, 0x2148, 0x080c, 0xc814, 0x0120, 0xa87b, 0x0029, 0x080c,
-	0x6d70, 0x009e, 0x080c, 0xabc9, 0x0005, 0x601b, 0x0000, 0x9182,
-	0x0040, 0x0096, 0x0002, 0x8fe8, 0x8fe8, 0x8fe8, 0x8fe8, 0x8fe8,
-	0x8fe8, 0x8fe8, 0x8fe8, 0x8fea, 0x8fe8, 0x8fe8, 0x8fe8, 0x902c,
-	0x8fe8, 0x8fe8, 0x8fe8, 0x8fe8, 0x8fe8, 0x8fe8, 0x8ff0, 0x8fe8,
-	0x080c, 0x0d7d, 0x6114, 0x2148, 0xa938, 0x918e, 0xffff, 0x05e0,
-	0x00e6, 0x6114, 0x2148, 0x080c, 0x8da1, 0x0096, 0xa8a8, 0x2048,
-	0x080c, 0x6b08, 0x009e, 0xa8ab, 0x0000, 0x6010, 0x9005, 0x0128,
-	0x00b6, 0x2058, 0x080c, 0x8ed0, 0x00be, 0xae88, 0x00b6, 0x2059,
-	0x0000, 0x080c, 0x8ad4, 0x00be, 0x01e0, 0x2071, 0x193c, 0x080c,
-	0x8b1b, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001, 0x1946, 0x2004,
-	0x9005, 0x1178, 0x0096, 0x080c, 0x103a, 0x2900, 0x009e, 0x0148,
-	0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x8a92, 0x00fe, 0x00ee, 0x009e,
-	0x0005, 0x080c, 0x8acb, 0x0cd0, 0x080c, 0x90e4, 0x009e, 0x0005,
-	0x9182, 0x0040, 0x0096, 0x0002, 0x9044, 0x9044, 0x9044, 0x9046,
-	0x9044, 0x9044, 0x9044, 0x9066, 0x9044, 0x9044, 0x9044, 0x9044,
-	0x9044, 0x9044, 0x9044, 0x9044, 0x080c, 0x0d7d, 0x6003, 0x0003,
-	0x6106, 0x6014, 0x2048, 0xa8ac, 0xa836, 0xa8b0, 0xa83a, 0xa847,
-	0x0000, 0xa84b, 0x0000, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001,
-	0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x080c, 0x1bba,
-	0x2009, 0x8030, 0x080c, 0x9234, 0x009e, 0x0005, 0x080c, 0x0d7d,
-	0x080c, 0x960a, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6,
-	0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6d70, 0x080c, 0xabc9,
-	0x009e, 0x0005, 0x080c, 0xa872, 0x6144, 0xd1fc, 0x0120, 0xd1ac,
-	0x1110, 0x6003, 0x0003, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d,
-	0x0096, 0x0023, 0x009e, 0x080c, 0xa88e, 0x0005, 0x909e, 0x909e,
-	0x909e, 0x90a0, 0x90b1, 0x909e, 0x909e, 0x909e, 0x909e, 0x909e,
-	0x909e, 0x909e, 0x909e, 0x909e, 0x909e, 0x909e, 0x080c, 0x0d7d,
-	0x080c, 0xaa06, 0x6114, 0x2148, 0xa87b, 0x0006, 0x6010, 0x00b6,
-	0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6d70, 0x080c, 0xabc9,
-	0x0005, 0x0491, 0x0005, 0x080c, 0xa872, 0x6000, 0x6144, 0xd1fc,
-	0x0130, 0xd1ac, 0x1120, 0x6003, 0x0003, 0x2009, 0x0003, 0x908a,
-	0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0033, 0x009e, 0x0106, 0x080c,
-	0xa88e, 0x010e, 0x0005, 0x90db, 0x90db, 0x90db, 0x90dd, 0x90e4,
-	0x90db, 0x90db, 0x90db, 0x90db, 0x90db, 0x90db, 0x90db, 0x90db,
-	0x90db, 0x90db, 0x90db, 0x080c, 0x0d7d, 0x0036, 0x00e6, 0x080c,
-	0xaa06, 0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b, 0x0000,
-	0x6014, 0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c,
-	0x8ed0, 0x00be, 0x2071, 0x193c, 0x080c, 0x8b1b, 0x0160, 0x2001,
-	0x187f, 0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c, 0x8a92,
-	0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8, 0x2048,
-	0x080c, 0x106c, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x8acb, 0x0c80,
-	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0000, 0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006,
-	0x8004, 0x8086, 0x818e, 0x1208, 0x9200, 0x1f04, 0x9129, 0x8086,
-	0x818e, 0x004e, 0x003e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x0076, 0x0156, 0x20a9, 0x0010, 0x9005, 0x01c8, 0x911a, 0x12b8,
-	0x8213, 0x818d, 0x0228, 0x911a, 0x1220, 0x1f04, 0x9140, 0x0028,
-	0x911a, 0x2308, 0x8210, 0x1f04, 0x9140, 0x0006, 0x3200, 0x9084,
-	0xefff, 0x2080, 0x000e, 0x015e, 0x007e, 0x012e, 0x0005, 0x0006,
-	0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126, 0x2091, 0x2800, 0x2079,
-	0x19e7, 0x012e, 0x00d6, 0x2069, 0x19e7, 0x6803, 0x0005, 0x0156,
-	0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069, 0x0200, 0x080c, 0xa66c,
-	0x04a9, 0x080c, 0xa657, 0x0491, 0x080c, 0xa65a, 0x0479, 0x080c,
-	0xa65d, 0x0461, 0x080c, 0xa660, 0x0449, 0x080c, 0xa663, 0x0431,
-	0x080c, 0xa666, 0x0419, 0x080c, 0xa669, 0x0401, 0x01de, 0x014e,
-	0x015e, 0x6857, 0x0000, 0x00f6, 0x2079, 0x0380, 0x00f9, 0x7807,
-	0x0003, 0x7803, 0x0000, 0x7803, 0x0001, 0x2069, 0x0004, 0x2d04,
-	0x9084, 0xfffe, 0x9085, 0x8000, 0x206a, 0x2069, 0x0100, 0x6828,
-	0x9084, 0xfffc, 0x682a, 0x00fe, 0x00de, 0x0005, 0x20a9, 0x0020,
-	0x20a1, 0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x7803,
-	0x0000, 0x9006, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, 0x0031,
-	0x782b, 0x1aef, 0x781f, 0xff00, 0x781b, 0xff00, 0x2061, 0x1ae4,
-	0x602f, 0x19e7, 0x6033, 0x1800, 0x6037, 0x1a03, 0x603b, 0x1e55,
-	0x603f, 0x1e65, 0x6042, 0x6047, 0x1aba, 0x00ce, 0x0005, 0x2001,
-	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x01b0, 0x00c6,
-	0x6146, 0x600f, 0x0000, 0x2c08, 0x2061, 0x19e7, 0x602c, 0x8000,
-	0x602e, 0x601c, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x611e,
-	0x00ce, 0x0005, 0x6122, 0x611e, 0x0cd8, 0x6146, 0x2c08, 0x2001,
-	0x0012, 0x080c, 0xa863, 0x0005, 0x0016, 0x2009, 0x8020, 0x6146,
-	0x2c08, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001,
-	0x1128, 0x2001, 0x0019, 0x080c, 0xa863, 0x0088, 0x00c6, 0x2061,
-	0x19e7, 0x602c, 0x8000, 0x602e, 0x600c, 0x9005, 0x0128, 0x9080,
-	0x0003, 0x2102, 0x610e, 0x0010, 0x6112, 0x610e, 0x00ce, 0x001e,
-	0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001,
-	0x0198, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061, 0x19e7,
-	0x6044, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x6146, 0x00ce,
-	0x0005, 0x614a, 0x6146, 0x0cd8, 0x6146, 0x600f, 0x0000, 0x2c08,
-	0x2001, 0x0013, 0x080c, 0xa863, 0x0005, 0x6044, 0xd0dc, 0x0128,
-	0x9006, 0x7007, 0x0000, 0x700a, 0x7032, 0x0005, 0x00f6, 0x00e6,
-	0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066, 0x0056, 0x0036,
-	0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071, 0x19e7, 0x7648,
-	0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x92bf, 0x6010,
-	0x2058, 0xb8a0, 0x9206, 0x1904, 0x92ba, 0x87ff, 0x0120, 0x605c,
-	0x9106, 0x1904, 0x92ba, 0x704c, 0x9c06, 0x1178, 0x0036, 0x2019,
-	0x0001, 0x080c, 0xa0f4, 0x703f, 0x0000, 0x9006, 0x704e, 0x706a,
-	0x7052, 0x706e, 0x003e, 0x2029, 0x0001, 0x080c, 0x923d, 0x7048,
-	0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00,
-	0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c,
-	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x080c, 0xc814, 0x01c8, 0x6014, 0x2048, 0x6020, 0x9086,
-	0x0003, 0x1560, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
-	0x0036, 0x0076, 0x080c, 0xcb12, 0x080c, 0xe5f6, 0x080c, 0x6d70,
-	0x007e, 0x003e, 0x001e, 0x080c, 0xca03, 0x080c, 0xac04, 0x00ce,
-	0x0804, 0x925c, 0x2c78, 0x600c, 0x2060, 0x0804, 0x925c, 0x012e,
-	0x000e, 0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e,
-	0x00be, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xe5f6, 0x080c,
-	0xe241, 0x007e, 0x003e, 0x001e, 0x08c0, 0x6020, 0x9086, 0x0009,
-	0x1168, 0xa87b, 0x0006, 0x0016, 0x0036, 0x0076, 0x080c, 0x6d70,
-	0x080c, 0xabc9, 0x007e, 0x003e, 0x001e, 0x0848, 0x6020, 0x9086,
-	0x000a, 0x0904, 0x92a4, 0x0804, 0x92a2, 0x0006, 0x0066, 0x0096,
-	0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126, 0x2091, 0x8000, 0x2079,
-	0x19e7, 0x7848, 0x9065, 0x0904, 0x9354, 0x600c, 0x0006, 0x600f,
-	0x0000, 0x784c, 0x9c06, 0x11a0, 0x0036, 0x2019, 0x0001, 0x080c,
-	0xa0f4, 0x783f, 0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52, 0x7b6e,
-	0x003e, 0x000e, 0x9005, 0x1118, 0x600c, 0x600f, 0x0000, 0x0006,
-	0x00e6, 0x2f70, 0x080c, 0x923d, 0x00ee, 0x080c, 0xc814, 0x0520,
-	0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1580, 0x3e08, 0x918e,
-	0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x0140, 0x6048, 0x9005, 0x1198, 0x2001, 0x1988,
-	0x2004, 0x604a, 0x0070, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0x6d64, 0x080c, 0xca03, 0x6044, 0xc0fc, 0x6046, 0x080c,
-	0xac04, 0x000e, 0x0804, 0x9302, 0x7e4a, 0x7e46, 0x012e, 0x00fe,
-	0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1118, 0x080c, 0xe241, 0x0c38, 0x6020, 0x9086, 0x0009,
-	0x1130, 0xab7a, 0x080c, 0x6d70, 0x080c, 0xabc9, 0x0c10, 0x6020,
-	0x9086, 0x000a, 0x0990, 0x0878, 0x0016, 0x0026, 0x0086, 0x9046,
-	0x00a9, 0x080c, 0x9465, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6,
-	0x0126, 0x2079, 0x19e7, 0x2091, 0x8000, 0x080c, 0x94ae, 0x080c,
-	0x9542, 0x080c, 0x67ab, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19e7, 0x7620, 0x2660, 0x2678, 0x8cff,
-	0x0904, 0x942a, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x9425,
-	0x88ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x9425, 0x7030, 0x9c06,
-	0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x86c5,
-	0x080c, 0x9e0e, 0x68c3, 0x0000, 0x080c, 0xa314, 0x7033, 0x0000,
-	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
-	0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100,
-	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040, 0x7008,
-	0xc0ad, 0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x9425, 0x7020,
-	0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00,
-	0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000, 0x660c,
-	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c, 0xc814,
-	0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xca29, 0x1118,
-	0x080c, 0xb591, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x0016, 0x0036, 0x0086, 0x080c, 0xcb12, 0x080c, 0xe5f6, 0x080c,
-	0x6d70, 0x008e, 0x003e, 0x001e, 0x080c, 0xca03, 0x080c, 0xac04,
-	0x080c, 0xa1ea, 0x00ce, 0x0804, 0x939f, 0x2c78, 0x600c, 0x2060,
-	0x0804, 0x939f, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xe5f6, 0x080c, 0xe241,
-	0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xb591, 0x6020, 0x9086,
-	0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904,
-	0x940b, 0x9086, 0x008b, 0x0904, 0x940b, 0x0840, 0x6020, 0x9086,
-	0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8,
-	0x9086, 0x008b, 0x09b0, 0x0804, 0x941e, 0x0006, 0x00f6, 0x00e6,
-	0x0096, 0x00b6, 0x00c6, 0x0066, 0x0016, 0x0126, 0x2091, 0x8000,
-	0x9280, 0x1000, 0x2004, 0x905d, 0x2079, 0x19e7, 0x9036, 0x7828,
-	0x2060, 0x8cff, 0x0538, 0x6010, 0x9b06, 0x1500, 0x6043, 0xffff,
-	0x080c, 0xaa51, 0x01d8, 0x610c, 0x0016, 0x080c, 0x9f7e, 0x6014,
-	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
-	0x0086, 0x080c, 0xcb12, 0x080c, 0xe5f6, 0x080c, 0x6d70, 0x008e,
-	0x003e, 0x001e, 0x080c, 0xac04, 0x00ce, 0x08d8, 0x2c30, 0x600c,
-	0x2060, 0x08b8, 0x080c, 0x67c8, 0x012e, 0x001e, 0x006e, 0x00ce,
-	0x00be, 0x009e, 0x00ee, 0x00fe, 0x000e, 0x0005, 0x0096, 0x0006,
-	0x0066, 0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904, 0x9515,
-	0x600c, 0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000, 0x7830,
-	0x9c06, 0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c,
-	0x86c5, 0x080c, 0x9e0e, 0x68c3, 0x0000, 0x080c, 0xa314, 0x7833,
+	0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003,
+	0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128,
+	0x9186, 0x0003, 0x1968, 0x080c, 0x7920, 0x782c, 0xd09c, 0x090c,
+	0x7de4, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18,
+	0x080c, 0x7956, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x7956, 0x7956,
+	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7978, 0x7956,
+	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
+	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
+	0x7956, 0x7956, 0x7962, 0x7956, 0x7b4b, 0x7956, 0x7956, 0x7956,
+	0x7978, 0x7956, 0x7962, 0x7b8c, 0x7bcd, 0x7c14, 0x7c28, 0x7956,
+	0x7956, 0x7978, 0x7962, 0x798c, 0x7956, 0x7a04, 0x7cd3, 0x7cee,
+	0x7956, 0x7978, 0x7956, 0x798c, 0x7956, 0x7956, 0x79fa, 0x7cee,
+	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
+	0x7956, 0x79a0, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
+	0x7956, 0x7956, 0x7956, 0x7e6a, 0x7956, 0x7e14, 0x7956, 0x7e14,
+	0x7956, 0x79b5, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
+	0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c,
+	0x7e0d, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
+	0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50,
+	0x00e9, 0x080c, 0x7de4, 0x0005, 0x7956, 0x7962, 0x7b37, 0x7956,
+	0x7962, 0x7956, 0x7962, 0x7962, 0x7956, 0x7962, 0x7b37, 0x7962,
+	0x7962, 0x7962, 0x7962, 0x7962, 0x7956, 0x7962, 0x7b37, 0x7956,
+	0x7956, 0x7962, 0x7956, 0x7956, 0x7956, 0x7962, 0x00e6, 0x2071,
+	0x18fa, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000,
+	0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800,
+	0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105,
+	0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x0005,
+	0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007,
+	0x0001, 0x0804, 0x7ad9, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x7ad9, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
+	0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7af4, 0x7007,
+	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7af4, 0x0005,
+	0xa864, 0x8007, 0x9084, 0x00ff, 0x0904, 0x795e, 0x8001, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x7b10, 0x7007, 0x0003, 0x7012, 0x2900,
+	0x7016, 0x701a, 0x704b, 0x7b10, 0x0005, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x9086, 0x0001, 0x1904, 0x795e, 0x7007, 0x0001, 0x2009,
+	0x1834, 0x210c, 0x81ff, 0x11a8, 0xa868, 0x9084, 0x00ff, 0xa86a,
+	0xa883, 0x0000, 0x080c, 0x62b9, 0x1108, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x6d80, 0x012e,
+	0x0ca0, 0xa994, 0x9186, 0x0071, 0x0d38, 0x9186, 0x0064, 0x0d20,
+	0x9186, 0x007c, 0x0d08, 0x9186, 0x0028, 0x09f0, 0x9186, 0x0038,
+	0x09d8, 0x9186, 0x0078, 0x09c0, 0x9186, 0x005f, 0x09a8, 0x9186,
+	0x0056, 0x0990, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030,
+	0x900e, 0x08a0, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x7d05, 0x2900, 0x7016, 0x701a, 0x20a9,
+	0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050,
+	0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003,
+	0xa888, 0x7012, 0x9082, 0x0401, 0x1a04, 0x7966, 0xaab4, 0x928a,
+	0x0002, 0x1a04, 0x7966, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105,
+	0x0118, 0x2001, 0x7a97, 0x0018, 0x9280, 0x7a8d, 0x2005, 0x7056,
+	0x7010, 0x9015, 0x0904, 0x7a78, 0x080c, 0x1053, 0x1118, 0x7007,
+	0x0004, 0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866,
+	0x7050, 0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072,
+	0xe008, 0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003,
+	0x800b, 0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e,
+	0x080c, 0x1124, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200,
+	0x0118, 0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x106c,
+	0x7014, 0x2048, 0x0804, 0x7966, 0x7020, 0x2048, 0x7018, 0xa802,
+	0xa807, 0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x7a30,
+	0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8,
+	0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x001e, 0x0904, 0x7d05, 0x0804, 0x7ad9, 0x7a8f, 0x7a93, 0x0002,
+	0x001d, 0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a,
+	0x001d, 0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804,
+	0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4,
+	0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8,
+	0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c,
+	0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090,
+	0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692,
+	0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074,
+	0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e,
+	0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x1178, 0x080c, 0x60bb,
+	0x1108, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xcb36, 0x080c, 0x6d80, 0x012e, 0x0ca0, 0x080c, 0xcf4b, 0x1d70,
+	0x2001, 0x0028, 0x900e, 0x0c70, 0x2009, 0x1834, 0x210c, 0x81ff,
+	0x1188, 0xa888, 0x9005, 0x0188, 0xa883, 0x0000, 0x080c, 0x6149,
+	0x1108, 0x0005, 0xa87a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80,
+	0x012e, 0x0cb8, 0x2001, 0x0028, 0x0ca8, 0x2001, 0x0000, 0x0c90,
+	0x2009, 0x1834, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0,
+	0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x621b, 0x1138,
+	0x0005, 0x9006, 0xa87a, 0x080c, 0x6196, 0x1108, 0x0005, 0x0126,
+	0x2091, 0x8000, 0xa87a, 0xa982, 0x080c, 0x6d80, 0x012e, 0x0cb0,
+	0x2001, 0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018,
+	0xa802, 0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012,
+	0x0118, 0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001,
+	0x7048, 0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878,
+	0x9084, 0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096,
+	0x0001, 0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160,
+	0x9005, 0x11d8, 0xa974, 0x080c, 0x6625, 0x11b8, 0x0066, 0xae80,
+	0x080c, 0x6735, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224,
+	0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x6625, 0x1110, 0x080c,
+	0x6904, 0x8108, 0x1f04, 0x7b74, 0x00ce, 0xa87c, 0xd084, 0x1120,
+	0x080c, 0x106c, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6d80, 0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x080c, 0x6a67, 0x0580, 0x2061, 0x1a6f, 0x6100, 0xd184,
+	0x0178, 0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520,
+	0x6004, 0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8,
+	0x2011, 0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000,
+	0x6016, 0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007,
+	0x9084, 0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d,
+	0x6202, 0x012e, 0x0804, 0x7dce, 0x012e, 0x0804, 0x7dc8, 0x012e,
+	0x0804, 0x7dc2, 0x012e, 0x0804, 0x7dc5, 0x0126, 0x2091, 0x8000,
+	0x7007, 0x0001, 0x080c, 0x6a67, 0x05e0, 0x2061, 0x1a6f, 0x6000,
+	0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484,
+	0x0003, 0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100,
+	0x9210, 0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0,
+	0x9484, 0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082,
+	0x0004, 0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004,
+	0x1168, 0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000,
+	0x6016, 0x6206, 0x630a, 0x012e, 0x0804, 0x7dce, 0x012e, 0x0804,
+	0x7dcb, 0x012e, 0x0804, 0x7dc8, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x2061, 0x1a6f, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318,
+	0x0220, 0x630a, 0x012e, 0x0804, 0x7ddc, 0x012e, 0x0804, 0x7dcb,
+	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c,
+	0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a6f, 0x6000, 0x9084, 0xfcff,
+	0x6002, 0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065,
+	0x0598, 0x2001, 0x1834, 0x2004, 0x9005, 0x0118, 0x080c, 0xac28,
+	0x0068, 0x6017, 0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110,
+	0xa980, 0x6162, 0x2009, 0x0041, 0x080c, 0xac8c, 0xa988, 0x918c,
+	0xff00, 0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff,
+	0x080c, 0x88ec, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a6f,
+	0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce,
+	0x012e, 0x00be, 0x0804, 0x7dce, 0x00ce, 0x012e, 0x00be, 0x0804,
+	0x7dc8, 0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18,
+	0x9186, 0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c,
+	0x200c, 0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186,
+	0x0029, 0x1d10, 0xa974, 0x080c, 0x6625, 0x1968, 0xb800, 0xc0e4,
+	0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001,
+	0x1986, 0x2004, 0x601a, 0x0804, 0x7c63, 0xa88c, 0x9065, 0x0960,
+	0x00e6, 0xa890, 0x9075, 0x2001, 0x1834, 0x2004, 0x9005, 0x0150,
+	0x080c, 0xac28, 0x8eff, 0x0118, 0x2e60, 0x080c, 0xac28, 0x00ee,
+	0x0804, 0x7c63, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007,
+	0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e,
+	0xa8a8, 0x6016, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e,
+	0x00ee, 0x0804, 0x7c63, 0x2061, 0x1a6f, 0x6000, 0xd084, 0x0190,
+	0xd08c, 0x1904, 0x7ddc, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210,
+	0x0220, 0x6206, 0x012e, 0x0804, 0x7ddc, 0x012e, 0xa883, 0x0016,
+	0x0804, 0x7dd5, 0xa883, 0x0007, 0x0804, 0x7dd5, 0xa864, 0x8007,
+	0x9084, 0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069,
+	0x0005, 0x080c, 0x795e, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900,
+	0x7016, 0x701a, 0x704b, 0x7d05, 0x0005, 0x00b6, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x903e, 0x2061, 0x1800, 0x61d0, 0x81ff, 0x1904,
+	0x7d87, 0x6130, 0xd194, 0x1904, 0x7db1, 0xa878, 0x2070, 0x9e82,
+	0x1ddc, 0x0a04, 0x7d7b, 0x6068, 0x9e02, 0x1a04, 0x7d7b, 0x7120,
+	0x9186, 0x0006, 0x1904, 0x7d6d, 0x7010, 0x905d, 0x0904, 0x7d87,
+	0xb800, 0xd0e4, 0x1904, 0x7dab, 0x2061, 0x1a6f, 0x6100, 0x9184,
+	0x0301, 0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7db4,
+	0xa883, 0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198,
+	0x7116, 0xa87c, 0xd0f4, 0x1904, 0x7db7, 0x080c, 0x56da, 0xd09c,
+	0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x87df, 0x012e,
+	0x00ee, 0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902,
+	0x2148, 0xa87c, 0xd0f4, 0x1904, 0x7db7, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x7dd5,
+	0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6625,
+	0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118,
+	0xa883, 0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e,
+	0x0460, 0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c,
+	0x56de, 0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0,
+	0x6068, 0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010,
+	0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000,
+	0x9086, 0x0007, 0x1904, 0x7d11, 0x7003, 0x0002, 0x0804, 0x7d11,
+	0xa883, 0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be,
+	0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60,
+	0x2019, 0x0002, 0x601b, 0x0014, 0x080c, 0xde1b, 0x012e, 0x00ee,
+	0x00be, 0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040,
+	0x2009, 0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001,
+	0xa884, 0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6d80, 0x012e, 0x0005, 0x080c, 0x106c, 0x0005, 0x00d6,
+	0x080c, 0x87d6, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780,
+	0x190c, 0x7ec6, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70c0, 0x90ea,
+	0x0020, 0x0278, 0x8001, 0x70c2, 0x702c, 0x2048, 0xa800, 0x702e,
+	0x9006, 0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c,
+	0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780,
+	0x190c, 0x7ec6, 0x000e, 0x0005, 0xa898, 0x9084, 0x0003, 0x05a8,
+	0x080c, 0xab97, 0x05d8, 0x2900, 0x6016, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0035, 0x1138, 0x6028, 0xc0fd, 0x602a, 0x2001, 0x196b,
+	0x2004, 0x0098, 0xa8a0, 0x9084, 0x00ff, 0xa99c, 0x918c, 0xff00,
+	0x9105, 0xa99c, 0x918c, 0x00ff, 0x080c, 0x25fb, 0x1540, 0x00b6,
+	0x080c, 0x6625, 0x2b00, 0x00be, 0x1510, 0x6012, 0x6023, 0x0001,
+	0x2009, 0x0040, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x0110,
+	0x2009, 0x0041, 0x080c, 0xac8c, 0x0005, 0xa87b, 0x0101, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x0005, 0xa87b, 0x002c,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x0005, 0xa87b,
+	0x0028, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x080c,
+	0xabed, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6,
+	0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7eb7, 0xa97c,
+	0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8,
+	0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10,
+	0x080c, 0xab97, 0x1118, 0x080c, 0xac5f, 0x05a8, 0x6212, 0xa874,
+	0x0002, 0x7e95, 0x7e9a, 0x7e9d, 0x7ea3, 0x2019, 0x0002, 0x080c,
+	0xe239, 0x0060, 0x080c, 0xe1c9, 0x0048, 0x2019, 0x0002, 0xa980,
+	0x080c, 0xe1e8, 0x0018, 0xa980, 0x080c, 0xe1c9, 0x080c, 0xabed,
+	0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e,
+	0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887,
+	0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50,
+	0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000,
+	0x0e04, 0x7ec8, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804,
+	0x0d86, 0x2001, 0x1834, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6,
+	0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102,
+	0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x1608, 0x00fe,
+	0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe,
+	0x0005, 0x781c, 0xd08c, 0x0904, 0x7f49, 0x68c0, 0x90aa, 0x0005,
+	0x0a04, 0x854a, 0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d7d, 0x9584,
+	0x00f6, 0x1508, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1258,
+	0x9584, 0x0700, 0x8007, 0x04f0, 0x7000, 0x9084, 0xff00, 0x9086,
+	0x8100, 0x0db0, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084,
+	0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xe6da, 0x080c, 0x8441,
+	0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x849d,
+	0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x7f99, 0x080c,
+	0x2115, 0x005e, 0x004e, 0x0020, 0x080c, 0xe6da, 0x7817, 0x0140,
+	0x080c, 0x74e9, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140,
+	0x6893, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000,
+	0x0489, 0x0005, 0x0002, 0x7f56, 0x8263, 0x7f53, 0x7f53, 0x7f53,
+	0x7f53, 0x7f53, 0x7f53, 0x7817, 0x0140, 0x0005, 0x7000, 0x908c,
+	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286,
+	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x573b,
+	0x0070, 0x080c, 0x7fb9, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
+	0x81a0, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x8377, 0x7817,
+	0x0140, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011,
+	0x8048, 0x2518, 0x080c, 0x4b07, 0x003e, 0x002e, 0x0005, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30,
+	0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44,
+	0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011,
+	0x8048, 0x080c, 0x4b07, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e,
+	0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096,
+	0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x8171, 0x9186, 0x0023,
+	0x15c0, 0x080c, 0x840c, 0x0904, 0x8171, 0x6120, 0x9186, 0x0001,
+	0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186,
+	0x000a, 0x1904, 0x8171, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
+	0x1130, 0x2009, 0x0015, 0x080c, 0xac8c, 0x0804, 0x8171, 0x908e,
+	0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c,
+	0xac8c, 0x0804, 0x8171, 0x908e, 0x0100, 0x1904, 0x8171, 0x7034,
+	0x9005, 0x1904, 0x8171, 0x2009, 0x0016, 0x080c, 0xac8c, 0x0804,
+	0x8171, 0x9186, 0x0022, 0x1904, 0x8171, 0x7030, 0x908e, 0x0300,
+	0x1580, 0x68dc, 0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c,
+	0x00ff, 0x697e, 0x7004, 0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6,
+	0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2644,
+	0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x25fb, 0x695e,
+	0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b6,
+	0x00ee, 0x7034, 0x9005, 0x1904, 0x8171, 0x2009, 0x0017, 0x0804,
+	0x8121, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x8171,
+	0x080c, 0x74e9, 0x0120, 0x2009, 0x001d, 0x0804, 0x8121, 0x68dc,
+	0xc0a5, 0x68de, 0x2009, 0x0030, 0x0804, 0x8121, 0x908e, 0x0500,
+	0x1140, 0x7034, 0x9005, 0x1904, 0x8171, 0x2009, 0x0018, 0x0804,
+	0x8121, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x8121,
+	0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x8121, 0x908e,
+	0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x8171, 0x2009, 0x001b,
+	0x0804, 0x8121, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x8171, 0x2009, 0x001c, 0x0804, 0x8121, 0x908e, 0x1300, 0x1120,
+	0x2009, 0x0034, 0x0804, 0x8121, 0x908e, 0x1200, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x8171, 0x2009, 0x0024, 0x0804, 0x8121, 0x908c,
+	0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810,
+	0x2004, 0xd09c, 0x0904, 0x8121, 0x080c, 0xd64f, 0x1904, 0x8171,
+	0x0804, 0x811f, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009,
+	0x002a, 0x0804, 0x8121, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020,
+	0x0804, 0x8121, 0x908e, 0x6104, 0x1530, 0x2029, 0x0205, 0x2011,
+	0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8,
+	0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x4b07,
+	0x004e, 0x8108, 0x0f04, 0x80d5, 0x9186, 0x0280, 0x1d88, 0x2504,
+	0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009,
+	0x0023, 0x0804, 0x8121, 0x908e, 0x6000, 0x1120, 0x2009, 0x003f,
+	0x0804, 0x8121, 0x908e, 0x5400, 0x1138, 0x080c, 0x84fa, 0x1904,
+	0x8171, 0x2009, 0x0046, 0x04a8, 0x908e, 0x5500, 0x1148, 0x080c,
+	0x8522, 0x1118, 0x2009, 0x0041, 0x0460, 0x2009, 0x0042, 0x0448,
+	0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000,
+	0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009,
+	0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009,
+	0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009,
+	0x0050, 0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009,
+	0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x25fb, 0x1904, 0x8174, 0x080c, 0x65c4, 0x1904, 0x8174, 0xbe12,
+	0xbd16, 0x001e, 0x0016, 0x080c, 0x74e9, 0x01c0, 0x68dc, 0xd08c,
+	0x1148, 0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00,
+	0x1168, 0x0040, 0x687c, 0x9606, 0x1148, 0x6880, 0x9506, 0x9084,
+	0xff00, 0x1120, 0x9584, 0x00ff, 0xb886, 0x0080, 0xb884, 0x9005,
+	0x1168, 0x9186, 0x0046, 0x1150, 0x687c, 0x9606, 0x1138, 0x6880,
+	0x9506, 0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0xab97,
+	0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e,
+	0x9186, 0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c,
+	0xac8c, 0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b07, 0x080c,
+	0xac5f, 0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x001e, 0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128,
+	0x6007, 0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017,
+	0x0000, 0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x9225, 0x08a0,
+	0x080c, 0x3332, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e,
+	0x0008, 0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x840c,
+	0x0904, 0x81fb, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140,
+	0x7034, 0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0xac8c, 0x0498,
+	0x908e, 0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009, 0x0016,
+	0x080c, 0xac8c, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030, 0x908e,
+	0x1400, 0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x25fb, 0x11a8, 0x080c, 0x65c4, 0x1190,
+	0xbe12, 0xbd16, 0x080c, 0xab97, 0x0168, 0x2b08, 0x6112, 0x080c,
+	0xcccc, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0xac8c,
+	0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6,
+	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8,
+	0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f,
+	0x0804, 0x825d, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
+	0x825d, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
+	0x0000, 0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9,
+	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f,
+	0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0,
+	0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600,
+	0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745,
+	0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6,
+	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x8232, 0x82ff, 0x1118,
+	0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee,
+	0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184,
+	0x000f, 0x0002, 0x827a, 0x827a, 0x827a, 0x841e, 0x827a, 0x827d,
+	0x82a2, 0x832b, 0x827a, 0x827a, 0x827a, 0x827a, 0x827a, 0x827a,
+	0x827a, 0x827a, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110, 0xd1bc,
+	0x01e8, 0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a, 0x1ddc,
+	0x02a8, 0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110,
+	0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0xac8c, 0x7817, 0x0140,
+	0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904, 0x8307,
+	0x7110, 0xd1bc, 0x1904, 0x8307, 0x7108, 0x700c, 0x2028, 0x918c,
+	0x00ff, 0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8, 0x9080,
+	0x3374, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080, 0x9106,
+	0x0904, 0x8307, 0x9182, 0x0801, 0x1a04, 0x8307, 0x9190, 0x1000,
+	0x2204, 0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15b8,
+	0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c, 0xab97,
+	0x0598, 0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112, 0x6023,
+	0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xd8b5, 0x00f8,
+	0x080c, 0x6a6b, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c, 0x81ff,
+	0x11b0, 0x0880, 0x080c, 0xab97, 0x2b08, 0x0188, 0x6112, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005,
+	0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9225, 0x7817,
+	0x0140, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x4b07, 0x080c, 0xac5f, 0x0d78,
+	0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e,
+	0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022,
+	0x080c, 0x921e, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0, 0x7020,
+	0x2060, 0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690, 0x6868,
+	0x9c02, 0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650, 0x7008,
+	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510, 0x700c,
+	0xb914, 0x9106, 0x11f0, 0x7124, 0x610a, 0x601c, 0xd0fc, 0x11c8,
+	0x2001, 0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff, 0x9082,
+	0x000c, 0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001, 0x8631,
+	0x1de0, 0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045, 0x080c,
+	0xac8c, 0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002,
+	0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x3332, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000,
+	0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005,
+	0x838e, 0x838f, 0x838e, 0x838e, 0x83ee, 0x83fd, 0x0005, 0x00b6,
+	0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x83ec, 0x700c,
+	0x7108, 0x080c, 0x25fb, 0x1904, 0x83ec, 0x080c, 0x65c4, 0x1904,
+	0x83ec, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x6a6b,
+	0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x840c, 0x00ce,
+	0x05d8, 0x080c, 0xab97, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xcccc,
+	0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xac8c,
+	0x0458, 0x080c, 0x6a6b, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c,
+	0x6a73, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xab97, 0x2b08,
+	0x01d8, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0005, 0x7120, 0x610a,
+	0x2009, 0x0088, 0x080c, 0xac8c, 0x0078, 0x080c, 0xab97, 0x2b08,
+	0x0158, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x2009, 0x0001, 0x080c, 0xac8c, 0x00be, 0x0005, 0x7110, 0xd1bc,
+	0x0158, 0x00d1, 0x0148, 0x080c, 0x836d, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x0089, 0x080c, 0xac8c, 0x0005, 0x7110, 0xd1bc, 0x0158,
+	0x0059, 0x0148, 0x080c, 0x836d, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x008a, 0x080c, 0xac8c, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0003,
+	0x1158, 0x9c82, 0x1ddc, 0x0240, 0x2001, 0x181a, 0x2004, 0x9c02,
+	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110,
+	0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0, 0x9c82,
+	0x1ddc, 0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff,
+	0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106,
+	0x1120, 0x2009, 0x0051, 0x080c, 0xac8c, 0x7817, 0x0140, 0x00be,
+	0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049,
+	0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009,
+	0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086,
+	0xc000, 0x05c0, 0x080c, 0xab97, 0x05a8, 0x0066, 0x00c6, 0x0046,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1590,
+	0x080c, 0x65c4, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
+	0x6012, 0x080c, 0xcccc, 0x080c, 0x103a, 0x0500, 0x2900, 0x6062,
+	0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9,
+	0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003,
+	0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x9225, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0xabed,
+	0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c,
+	0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x84f4,
+	0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904,
+	0x84f6, 0x7030, 0x908e, 0x0400, 0x0904, 0x84f6, 0x908e, 0x6000,
+	0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009,
+	0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x6a29,
+	0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106,
+	0x1518, 0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104, 0x9106,
+	0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8, 0x908e,
+	0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000, 0x09b8,
+	0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x840c, 0x0128, 0x6004,
+	0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ce, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020,
+	0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x027a, 0x080c, 0xbbae, 0x1178, 0xd48c, 0x0148,
+	0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c, 0xbbae,
+	0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e,
+	0x015e, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020,
+	0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0272, 0x080c, 0xbbae, 0x1178, 0xd48c, 0x0148,
+	0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c, 0xbbae,
+	0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e,
+	0x015e, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc,
+	0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084,
+	0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee,
+	0x0005, 0x2071, 0x1a03, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006,
+	0x701a, 0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x7026,
+	0x702b, 0x9e54, 0x7032, 0x7037, 0x9ed1, 0x703f, 0xffff, 0x7042,
+	0x7047, 0x5571, 0x704a, 0x705b, 0x8711, 0x080c, 0x1053, 0x090c,
+	0x0d7d, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab,
+	0xdcb0, 0x0005, 0x2071, 0x1a03, 0x1d04, 0x862d, 0x2091, 0x6000,
+	0x700c, 0x8001, 0x700e, 0x1590, 0x2001, 0x013c, 0x2004, 0x9005,
+	0x190c, 0x87bb, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158, 0x3a00,
+	0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000,
+	0x080c, 0x0d7d, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091,
+	0x8000, 0x2069, 0x1800, 0x69ec, 0xd1e4, 0x1138, 0xd1dc, 0x1118,
+	0x080c, 0x877f, 0x0010, 0x080c, 0x8756, 0x7040, 0x900d, 0x0148,
+	0x8109, 0x7142, 0x1130, 0x7044, 0x080f, 0x0018, 0x0126, 0x2091,
+	0x8000, 0x7024, 0x900d, 0x0188, 0x7020, 0x8001, 0x7022, 0x1168,
+	0x7023, 0x0009, 0x8109, 0x7126, 0x9186, 0x03e8, 0x1110, 0x7028,
+	0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, 0x7030, 0x900d, 0x0180,
+	0x702c, 0x8001, 0x702e, 0x1160, 0x702f, 0x0009, 0x8109, 0x7132,
+	0x0128, 0x9184, 0x007f, 0x090c, 0x9f6d, 0x0010, 0x7034, 0x080f,
+	0x703c, 0x9005, 0x0118, 0x0310, 0x8001, 0x703e, 0x704c, 0x900d,
+	0x0168, 0x7048, 0x8001, 0x704a, 0x1148, 0x704b, 0x0009, 0x8109,
+	0x714e, 0x1120, 0x7150, 0x714e, 0x7058, 0x080f, 0x7018, 0x900d,
+	0x01d8, 0x0016, 0x7070, 0x900d, 0x0158, 0x706c, 0x8001, 0x706e,
+	0x1138, 0x706f, 0x0009, 0x8109, 0x7172, 0x1110, 0x7074, 0x080f,
+	0x001e, 0x7008, 0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109,
+	0x711a, 0x1110, 0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x8655,
+	0x8656, 0x8680, 0x00e6, 0x2071, 0x1a03, 0x7018, 0x9005, 0x1120,
+	0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006,
+	0x2071, 0x1a03, 0x701c, 0x9206, 0x1120, 0x701a, 0x701e, 0x7072,
+	0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1a03, 0xb888,
+	0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005, 0x00b6, 0x2031,
+	0x0010, 0x7110, 0x080c, 0x6625, 0x11a8, 0xb888, 0x8001, 0x0290,
+	0xb88a, 0x1180, 0x0126, 0x2091, 0x8000, 0x0066, 0xb8d0, 0x9005,
+	0x0138, 0x0026, 0xba3c, 0x0016, 0x080c, 0x6750, 0x001e, 0x002e,
+	0x006e, 0x012e, 0x8108, 0x9182, 0x0800, 0x1220, 0x8631, 0x0128,
+	0x7112, 0x0c00, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005,
+	0x2031, 0x0010, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6048,
+	0x9005, 0x0128, 0x8001, 0x604a, 0x1110, 0x080c, 0xcb4d, 0x6018,
+	0x9005, 0x0904, 0x86d8, 0x00f6, 0x2079, 0x0300, 0x7918, 0xd1b4,
+	0x1904, 0x86eb, 0x781b, 0x2020, 0xa001, 0x7918, 0xd1b4, 0x0120,
+	0x781b, 0x2000, 0x0804, 0x86eb, 0x8001, 0x601a, 0x0106, 0x781b,
+	0x2000, 0xa001, 0x7918, 0xd1ac, 0x1dd0, 0x010e, 0x00fe, 0x1540,
+	0x6120, 0x9186, 0x0003, 0x0148, 0x9186, 0x0006, 0x0130, 0x9186,
+	0x0009, 0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c, 0xc838, 0x01b0,
+	0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082, 0x1999,
+	0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x611a, 0x080c, 0xcf7e, 0x0110, 0x080c, 0xc536,
+	0x012e, 0x9c88, 0x001c, 0x7116, 0x2001, 0x181a, 0x2004, 0x9102,
+	0x1228, 0x8631, 0x0138, 0x2160, 0x0804, 0x8684, 0x7017, 0x1ddc,
+	0x7007, 0x0000, 0x0005, 0x00fe, 0x0c58, 0x00e6, 0x2071, 0x1a03,
+	0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001, 0x1a0c,
+	0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1a03, 0x7132, 0x702f,
+	0x0009, 0x00ee, 0x0005, 0x2011, 0x1a0f, 0x2013, 0x0000, 0x0005,
+	0x00e6, 0x2071, 0x1a03, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee,
+	0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056, 0x2001, 0x1a11,
+	0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068, 0xa09a, 0x7064,
+	0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c, 0x1124, 0x002e,
+	0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x8592, 0x015e, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x001e, 0x000e,
+	0x0005, 0x00e6, 0x2071, 0x1a03, 0x7172, 0x7276, 0x706f, 0x0009,
+	0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1a03, 0x7074, 0x9206,
+	0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x2069, 0x1800,
+	0x69ec, 0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140, 0x6a54, 0x6874,
+	0x9202, 0x0288, 0x8117, 0x9294, 0x00c1, 0x0088, 0x9184, 0x0007,
+	0x01a0, 0x8109, 0x9184, 0x0007, 0x0110, 0x69ee, 0x0070, 0x8107,
+	0x9084, 0x0007, 0x910d, 0x8107, 0x9106, 0x9094, 0x00c1, 0x9184,
+	0xff3e, 0x9205, 0x68ee, 0x080c, 0x0f05, 0x002e, 0x0005, 0x69e8,
+	0x9184, 0x003f, 0x05b8, 0x8109, 0x9184, 0x003f, 0x01a8, 0x6a54,
+	0x6874, 0x9202, 0x0220, 0xd1bc, 0x0168, 0xc1bc, 0x0018, 0xd1bc,
+	0x1148, 0xc1bd, 0x2110, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27,
+	0x00ee, 0x0400, 0x69ea, 0x00f0, 0x0026, 0x8107, 0x9094, 0x0007,
+	0x0128, 0x8001, 0x8007, 0x9085, 0x0007, 0x0050, 0x2010, 0x8004,
+	0x8004, 0x8004, 0x9084, 0x0007, 0x9205, 0x8007, 0x9085, 0x0028,
+	0x9086, 0x0040, 0x2010, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27,
+	0x00ee, 0x002e, 0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d,
+	0x2061, 0x0100, 0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc,
+	0x200f, 0x1220, 0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e,
+	0x0005, 0x00c6, 0x2061, 0x1a6f, 0x00ce, 0x0005, 0x9184, 0x000f,
+	0x8003, 0x8003, 0x8003, 0x9080, 0x1a6f, 0x2060, 0x0005, 0xa884,
+	0x908a, 0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a6f,
+	0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e,
+	0xffff, 0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c,
+	0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x8896, 0xd0b4, 0x1168,
+	0xd0bc, 0x1904, 0x886f, 0x2009, 0x0006, 0x080c, 0x88c3, 0x0005,
+	0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05c8, 0x908c,
+	0x2023, 0x1550, 0x87ff, 0x1540, 0x6124, 0x918c, 0x0500, 0x1520,
+	0x6100, 0x918e, 0x0007, 0x1500, 0x2009, 0x1869, 0x210c, 0xd184,
+	0x11d8, 0x6003, 0x0003, 0x6007, 0x0043, 0x6047, 0xb035, 0x080c,
+	0x1c03, 0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000, 0x00f6, 0x2079,
+	0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013, 0x2c00, 0x7836,
+	0x781b, 0x8080, 0x00fe, 0x0005, 0x908c, 0x0003, 0x0120, 0x918e,
+	0x0003, 0x1904, 0x88bd, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8,
+	0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084, 0x1138,
+	0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xac8c, 0x0005, 0x87ff,
+	0x1de8, 0x2009, 0x0042, 0x0804, 0xac8c, 0x6110, 0x00b6, 0x2158,
+	0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026, 0x0c00,
+	0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0, 0xd0fc,
+	0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x88bd,
+	0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78,
+	0x080c, 0x1731, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042,
+	0x080c, 0xac8c, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
+	0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc, 0x0188,
+	0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003, 0x908e,
+	0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0xac8c,
+	0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c,
+	0xac8c, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
+	0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019,
+	0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xc838, 0x0518, 0x6014,
+	0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c,
+	0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a6f,
+	0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce,
+	0x080c, 0x6bb5, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c,
+	0x87df, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a6f,
+	0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce,
+	0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120,
+	0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923, 0x7003,
+	0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001, 0x080c,
+	0x1053, 0x090c, 0x0d7d, 0xa867, 0x0006, 0xa86b, 0x0001, 0xa8ab,
+	0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000, 0x0005,
+	0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c, 0x721e,
+	0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a, 0xa89a,
+	0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a, 0x9005,
+	0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100, 0x9210,
+	0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178, 0xc084,
+	0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d, 0x2104,
+	0x9082, 0x0007, 0x2009, 0x1b4e, 0x200a, 0x000e, 0xc095, 0x7012,
+	0x2008, 0x2001, 0x003b, 0x080c, 0x1679, 0x9006, 0x2071, 0x193c,
+	0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6, 0x0126,
+	0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001, 0x0008,
+	0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080, 0x0008,
+	0x1f04, 0x8976, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877, 0x20a9,
+	0x0007, 0x00c6, 0x080c, 0xab97, 0x6023, 0x0009, 0x6003, 0x0004,
+	0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c, 0x8afc,
+	0x012e, 0x1f04, 0x8982, 0x9006, 0x00ce, 0x015e, 0x012e, 0x00ee,
+	0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096, 0x0086,
+	0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004, 0xd084,
+	0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021, 0x002c,
+	0x2029, 0x000a, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x2900, 0x6016,
+	0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a, 0xa8aa,
+	0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010, 0xa89e,
+	0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160, 0x080c,
+	0x103a, 0x090c, 0x0d7d, 0xad66, 0x2b00, 0xa802, 0x2900, 0xb806,
+	0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e, 0x009e,
+	0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923, 0x7004,
+	0x004b, 0x700c, 0x0002, 0x89ee, 0x89e7, 0x89e7, 0x0005, 0x89f8,
+	0x8a59, 0x8a59, 0x8a59, 0x8a5a, 0x8a6b, 0x8a6b, 0x700c, 0x0cba,
+	0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128, 0x78a0,
+	0x79a0, 0x9106, 0x1904, 0x8a4c, 0x2001, 0x0005, 0x2004, 0xd0bc,
+	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
+	0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c, 0x8a9a,
+	0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210, 0x2009,
+	0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004, 0x9100,
+	0x9202, 0x0e48, 0x080c, 0x8be6, 0x2200, 0x9102, 0x0208, 0x2208,
+	0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c, 0x8cef,
+	0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091, 0x8000,
+	0x2009, 0x1a21, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002, 0x012e,
+	0x080c, 0x1143, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc,
+	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
+	0x0005, 0x0005, 0x700c, 0x0002, 0x8a5f, 0x8a62, 0x8a61, 0x080c,
+	0x89f6, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048, 0xa974,
+	0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048, 0x7018,
+	0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020, 0xa892,
+	0x9006, 0x0068, 0x0006, 0x080c, 0x8cef, 0x2100, 0xaa8c, 0x9210,
+	0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e, 0x009e,
+	0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6, 0x2071,
+	0x1923, 0x700c, 0x0002, 0x8a98, 0x8a98, 0x8a96, 0x700f, 0x0001,
+	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005, 0x0508,
+	0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000, 0x080c,
+	0x8b05, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c, 0x8b4c,
+	0x00ee, 0x0178, 0x0096, 0x080c, 0x1053, 0x2900, 0x009e, 0x0148,
+	0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000, 0x012e,
+	0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6, 0x2940,
+	0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f, 0x2068,
+	0x9d88, 0x1e55, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c, 0x8c74,
+	0x080c, 0x1e2b, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f, 0x2004,
+	0xa88a, 0x080c, 0x1731, 0x781f, 0x0101, 0x7813, 0x0000, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8b5b, 0x012e, 0x008e, 0x00ce, 0x00de,
+	0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032, 0x2001,
+	0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923, 0x7030,
+	0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6, 0x0026,
+	0x9b80, 0x8dce, 0x2005, 0x906d, 0x090c, 0x0d7d, 0x9b80, 0x8dc6,
+	0x2005, 0x9065, 0x090c, 0x0d7d, 0x6114, 0x2600, 0x9102, 0x0248,
+	0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce, 0x00de,
+	0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178, 0xc085,
+	0x6856, 0x2011, 0x8026, 0x080c, 0x4b07, 0x684c, 0x0096, 0x904d,
+	0x090c, 0x0d7d, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006, 0x2030,
+	0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011, 0x8025,
+	0x080c, 0x4b07, 0x684c, 0x0096, 0x904d, 0x090c, 0x0d7d, 0xa800,
+	0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008, 0x8319,
+	0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210, 0x9302,
+	0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c, 0x0d7d,
+	0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0d7d, 0x2069,
+	0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904, 0x8108,
+	0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e, 0x2003,
+	0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014, 0x2048,
+	0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x106c, 0x009e, 0xa8ab,
+	0x0000, 0x080c, 0x0fec, 0x080c, 0xabed, 0x00ce, 0x009e, 0x0005,
+	0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110, 0x9006,
+	0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000, 0x0178,
+	0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8f01, 0x00be,
+	0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861, 0x0005,
+	0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071, 0x1923,
+	0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000, 0x7112,
+	0x2001, 0x003b, 0x080c, 0x1679, 0x00ee, 0x0005, 0x0096, 0x00d6,
+	0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016, 0x702a,
+	0x7026, 0x702f, 0x0000, 0x080c, 0x8d4e, 0x0170, 0x080c, 0x8d83,
+	0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001, 0x701f,
+	0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6, 0x0096,
+	0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100, 0x9202,
+	0x1618, 0x080c, 0x8d83, 0x090c, 0x0d7d, 0x7018, 0x9005, 0x1160,
+	0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e, 0xa806,
+	0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900, 0xa002,
+	0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c, 0x9080,
+	0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de, 0x008e,
+	0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f, 0x831e,
+	0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398, 0x0003,
+	0x7104, 0x080c, 0x8cef, 0x810c, 0x2100, 0x9318, 0x8003, 0x2228,
+	0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500, 0x8004,
+	0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c, 0x8cf8,
+	0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102, 0x701e,
+	0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000, 0x2048,
+	0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c, 0x8be6,
+	0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000, 0x0008,
+	0x7106, 0x2500, 0x9212, 0x1904, 0x8c25, 0x012e, 0x00ee, 0x014e,
+	0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x9580, 0x8dc6, 0x2005, 0x9075, 0x090c, 0x0d7d,
+	0x080c, 0x8cca, 0x012e, 0x9580, 0x8dc2, 0x2005, 0x9075, 0x090c,
+	0x0d7d, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f, 0x831e,
+	0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100, 0x2098,
+	0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9, 0x0002,
+	0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8cb4, 0x8cb4, 0x8cb6, 0x8cb4,
+	0x8cb6, 0x8cb4, 0x8cb4, 0x8cb4, 0x8cb4, 0x8cb4, 0x8cbc, 0x8cb4,
+	0x8cbc, 0x8cb4, 0x8cb4, 0x8cb4, 0x080c, 0x0d7d, 0x4104, 0x20a9,
+	0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003, 0x4104,
+	0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee, 0x002e,
+	0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c, 0x2110,
+	0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282, 0x000a,
+	0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006, 0x080c,
+	0x8d92, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010, 0x8001,
+	0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005, 0x0006,
+	0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e, 0x0005,
+	0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c, 0x0240,
+	0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e, 0x0005,
+	0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810, 0x2019,
+	0x0001, 0x2031, 0x8d38, 0x9112, 0x0220, 0x0118, 0x8318, 0x2208,
+	0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804, 0xd084,
+	0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967, 0x0a67,
+	0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082, 0x0002,
+	0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67, 0x0cd0,
+	0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800, 0x7128,
+	0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318, 0x0cd8,
+	0x2031, 0x8d4b, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096, 0x0046,
+	0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8dca, 0x2005, 0x9005,
+	0x090c, 0x0d7d, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1053, 0x01d0,
+	0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c, 0x1053,
+	0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026, 0x94a2,
+	0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e, 0x004e,
+	0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00, 0x080c,
+	0x106c, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024, 0x2048,
+	0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802, 0x2900,
+	0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004, 0x9005,
+	0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x106c, 0x000e, 0x0cb8,
+	0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048, 0xa800,
+	0x0006, 0x080c, 0x106c, 0x000e, 0x0cb8, 0x9006, 0x7002, 0x700a,
+	0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026, 0x702e,
+	0x009e, 0x0005, 0x1a6d, 0x0000, 0x0000, 0x0000, 0x1930, 0x0000,
+	0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877, 0x0000,
+	0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8, 0x2040,
+	0x2071, 0x1877, 0x080c, 0x8eec, 0xa067, 0x0023, 0x6010, 0x905d,
+	0x0904, 0x8ec1, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0, 0xa176,
+	0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000, 0xa898,
+	0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031, 0x0018,
+	0xa068, 0x908a, 0x0019, 0x1a0c, 0x0d7d, 0x2020, 0x2050, 0x2940,
+	0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x1e55, 0x2c65,
+	0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c, 0x0d7d,
+	0x9082, 0x001b, 0x0002, 0x8e2e, 0x8e2e, 0x8e30, 0x8e2e, 0x8e2e,
+	0x8e2e, 0x8e32, 0x8e2e, 0x8e2e, 0x8e2e, 0x8e34, 0x8e2e, 0x8e2e,
+	0x8e2e, 0x8e36, 0x8e2e, 0x8e2e, 0x8e2e, 0x8e38, 0x8e2e, 0x8e2e,
+	0x8e2e, 0x8e3a, 0x8e2e, 0x8e2e, 0x8e2e, 0x8e3c, 0x080c, 0x0d7d,
+	0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0, 0x0488,
+	0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a, 0x0034,
+	0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x8e60, 0x8e5e, 0x8e5e,
+	0x8e5e, 0x8e5e, 0x8e5e, 0x8e62, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e,
+	0x8e5e, 0x8e64, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e66,
+	0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e68, 0x080c, 0x0d7d,
+	0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8, 0x0008,
+	0xa1e0, 0x2600, 0x0002, 0x8e84, 0x8e86, 0x8e88, 0x8e8a, 0x8e8c,
+	0x8e8e, 0x8e90, 0x8e92, 0x8e94, 0x8e96, 0x8e98, 0x8e9a, 0x8e9c,
+	0x8e9e, 0x8ea0, 0x8ea2, 0x8ea4, 0x8ea6, 0x8ea8, 0x8eaa, 0x8eac,
+	0x8eae, 0x8eb0, 0x8eb2, 0x8eb4, 0x080c, 0x0d7d, 0xb9e2, 0x0468,
+	0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2, 0x0428,
+	0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2, 0x00e8,
+	0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2, 0x00a8,
+	0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2, 0x0068,
+	0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992, 0x0028,
+	0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421, 0x0120,
+	0x080c, 0x1e2b, 0x0804, 0x8e08, 0x00ae, 0x00be, 0x00ce, 0x00ee,
+	0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff, 0x9006,
+	0x0804, 0x8dea, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058, 0xb810,
+	0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0xbba0,
+	0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b07, 0x004e, 0x003e,
+	0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834, 0x910a,
+	0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238, 0x0130,
+	0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a, 0xa26a,
+	0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b, 0x0200,
+	0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001, 0x7818,
+	0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079, 0x0000,
+	0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106, 0x0140,
+	0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0d7d, 0x2068, 0x0cb0,
+	0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b, 0x0200,
+	0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x00c6,
+	0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff, 0x2071,
+	0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04, 0x8f41,
+	0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90, 0xb8ac,
+	0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004, 0x601b,
+	0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048, 0xa88b,
+	0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0d7d, 0x080c,
+	0x106c, 0x080c, 0x8afc, 0x0c18, 0x2071, 0x0300, 0x701b, 0x0200,
+	0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x0005,
+	0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x25fb, 0x015e,
+	0x11b0, 0x080c, 0x65c4, 0x190c, 0x0d7d, 0x000e, 0x001e, 0xb912,
+	0xb816, 0x080c, 0xab97, 0x0140, 0x2b00, 0x6012, 0x6023, 0x0001,
+	0x2009, 0x0001, 0x080c, 0xac8c, 0x00be, 0x00ce, 0x0005, 0x000e,
+	0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d,
+	0x0013, 0x006e, 0x0005, 0x8fb3, 0x8fb3, 0x8fb3, 0x8fb5, 0x8ffe,
+	0x8fb3, 0x8fb3, 0x8fb3, 0x9061, 0x8fb3, 0x9099, 0x8fb3, 0x8fb3,
+	0x8fb3, 0x8fb3, 0x8fb3, 0x080c, 0x0d7d, 0x9182, 0x0040, 0x0002,
+	0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8,
+	0x8fc8, 0x8fca, 0x8fdb, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fec,
+	0x080c, 0x0d7d, 0x0096, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010,
+	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6b80, 0x080c,
+	0xabed, 0x009e, 0x0005, 0x080c, 0x963b, 0x00d6, 0x6114, 0x080c,
+	0xc838, 0x0130, 0x0096, 0x6114, 0x2148, 0x080c, 0x6d80, 0x009e,
+	0x00de, 0x080c, 0xabed, 0x0005, 0x080c, 0x963b, 0x080c, 0x31e7,
+	0x6114, 0x0096, 0x2148, 0x080c, 0xc838, 0x0120, 0xa87b, 0x0029,
+	0x080c, 0x6d80, 0x009e, 0x080c, 0xabed, 0x0005, 0x601b, 0x0000,
+	0x9182, 0x0040, 0x0096, 0x0002, 0x9019, 0x9019, 0x9019, 0x9019,
+	0x9019, 0x9019, 0x9019, 0x9019, 0x901b, 0x9019, 0x9019, 0x9019,
+	0x905d, 0x9019, 0x9019, 0x9019, 0x9019, 0x9019, 0x9019, 0x9021,
+	0x9019, 0x080c, 0x0d7d, 0x6114, 0x2148, 0xa938, 0x918e, 0xffff,
+	0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8dd2, 0x0096, 0xa8a8,
+	0x2048, 0x080c, 0x6b18, 0x009e, 0xa8ab, 0x0000, 0x6010, 0x9005,
+	0x0128, 0x00b6, 0x2058, 0x080c, 0x8f01, 0x00be, 0xae88, 0x00b6,
+	0x2059, 0x0000, 0x080c, 0x8b05, 0x00be, 0x01e0, 0x2071, 0x193c,
+	0x080c, 0x8b4c, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001, 0x1946,
+	0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x103a, 0x2900, 0x009e,
+	0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x8ac3, 0x00fe, 0x00ee,
+	0x009e, 0x0005, 0x080c, 0x8afc, 0x0cd0, 0x080c, 0x9115, 0x009e,
+	0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x9075, 0x9075, 0x9075,
+	0x9077, 0x9075, 0x9075, 0x9075, 0x9097, 0x9075, 0x9075, 0x9075,
+	0x9075, 0x9075, 0x9075, 0x9075, 0x9075, 0x080c, 0x0d7d, 0x6003,
+	0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa836, 0xa8b0, 0xa83a,
+	0xa847, 0x0000, 0xa84b, 0x0000, 0xa884, 0x9092, 0x199a, 0x0210,
+	0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x080c,
+	0x1bba, 0x2009, 0x8030, 0x080c, 0x9265, 0x009e, 0x0005, 0x080c,
+	0x0d7d, 0x080c, 0x963b, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010,
+	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6d80, 0x080c,
+	0xabed, 0x009e, 0x0005, 0x080c, 0xa896, 0x6144, 0xd1fc, 0x0120,
+	0xd1ac, 0x1110, 0x6003, 0x0003, 0x6000, 0x908a, 0x0016, 0x1a0c,
+	0x0d7d, 0x0096, 0x0023, 0x009e, 0x080c, 0xa8b2, 0x0005, 0x90cf,
+	0x90cf, 0x90cf, 0x90d1, 0x90e2, 0x90cf, 0x90cf, 0x90cf, 0x90cf,
+	0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x080c,
+	0x0d7d, 0x080c, 0xaa2a, 0x6114, 0x2148, 0xa87b, 0x0006, 0x6010,
+	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6d80, 0x080c,
+	0xabed, 0x0005, 0x0491, 0x0005, 0x080c, 0xa896, 0x6000, 0x6144,
+	0xd1fc, 0x0130, 0xd1ac, 0x1120, 0x6003, 0x0003, 0x2009, 0x0003,
+	0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0033, 0x009e, 0x0106,
+	0x080c, 0xa8b2, 0x010e, 0x0005, 0x910c, 0x910c, 0x910c, 0x910e,
+	0x9115, 0x910c, 0x910c, 0x910c, 0x910c, 0x910c, 0x910c, 0x910c,
+	0x910c, 0x910c, 0x910c, 0x910c, 0x080c, 0x0d7d, 0x0036, 0x00e6,
+	0x080c, 0xaa2a, 0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b,
+	0x0000, 0x6014, 0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058,
+	0x080c, 0x8f01, 0x00be, 0x2071, 0x193c, 0x080c, 0x8b4c, 0x0160,
+	0x2001, 0x187f, 0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c,
+	0x8ac3, 0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8,
+	0x2048, 0x080c, 0x106c, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x8afc,
+	0x0c80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010,
+	0x9006, 0x8004, 0x8086, 0x818e, 0x1208, 0x9200, 0x1f04, 0x915a,
+	0x8086, 0x818e, 0x004e, 0x003e, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005, 0x01c8, 0x911a,
+	0x12b8, 0x8213, 0x818d, 0x0228, 0x911a, 0x1220, 0x1f04, 0x9171,
+	0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x9171, 0x0006, 0x3200,
+	0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e, 0x012e, 0x0005,
+	0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126, 0x2091, 0x2800,
+	0x2079, 0x19e7, 0x012e, 0x00d6, 0x2069, 0x19e7, 0x6803, 0x0005,
+	0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069, 0x0200, 0x080c,
+	0xa690, 0x04a9, 0x080c, 0xa67b, 0x0491, 0x080c, 0xa67e, 0x0479,
+	0x080c, 0xa681, 0x0461, 0x080c, 0xa684, 0x0449, 0x080c, 0xa687,
+	0x0431, 0x080c, 0xa68a, 0x0419, 0x080c, 0xa68d, 0x0401, 0x01de,
+	0x014e, 0x015e, 0x6857, 0x0000, 0x00f6, 0x2079, 0x0380, 0x00f9,
+	0x7807, 0x0003, 0x7803, 0x0000, 0x7803, 0x0001, 0x2069, 0x0004,
+	0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000, 0x206a, 0x2069, 0x0100,
+	0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe, 0x00de, 0x0005, 0x20a9,
+	0x0020, 0x20a1, 0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6,
+	0x7803, 0x0000, 0x9006, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827,
+	0x0031, 0x782b, 0x1aef, 0x781f, 0xff00, 0x781b, 0xff00, 0x2061,
+	0x1ae4, 0x602f, 0x19e7, 0x6033, 0x1800, 0x6037, 0x1a03, 0x603b,
+	0x1e55, 0x603f, 0x1e65, 0x6042, 0x6047, 0x1aba, 0x00ce, 0x0005,
+	0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x01b0,
+	0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061, 0x19e7, 0x602c,
+	0x8000, 0x602e, 0x601c, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102,
+	0x611e, 0x00ce, 0x0005, 0x6122, 0x611e, 0x0cd8, 0x6146, 0x2c08,
+	0x2001, 0x0012, 0x080c, 0xa887, 0x0005, 0x0016, 0x2009, 0x8020,
+	0x6146, 0x2c08, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x1128, 0x2001, 0x0019, 0x080c, 0xa887, 0x0088, 0x00c6,
+	0x2061, 0x19e7, 0x602c, 0x8000, 0x602e, 0x600c, 0x9005, 0x0128,
+	0x9080, 0x0003, 0x2102, 0x610e, 0x0010, 0x6112, 0x610e, 0x00ce,
+	0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x0198, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061,
+	0x19e7, 0x6044, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x6146,
+	0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8, 0x6146, 0x600f, 0x0000,
+	0x2c08, 0x2001, 0x0013, 0x080c, 0xa887, 0x0005, 0x6044, 0xd0dc,
+	0x0128, 0x9006, 0x7007, 0x0000, 0x700a, 0x7032, 0x0005, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066, 0x0056,
+	0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071, 0x19e7,
+	0x7648, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x92f0,
+	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x92eb, 0x87ff, 0x0120,
+	0x605c, 0x9106, 0x1904, 0x92eb, 0x704c, 0x9c06, 0x1178, 0x0036,
+	0x2019, 0x0001, 0x080c, 0xa118, 0x703f, 0x0000, 0x9006, 0x704e,
+	0x706a, 0x7052, 0x706e, 0x003e, 0x2029, 0x0001, 0x080c, 0x926e,
+	0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xc838, 0x01c8, 0x6014, 0x2048, 0x6020,
+	0x9086, 0x0003, 0x1560, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x0016, 0x0036, 0x0076, 0x080c, 0xcb36, 0x080c, 0xe621, 0x080c,
+	0x6d80, 0x007e, 0x003e, 0x001e, 0x080c, 0xca27, 0x080c, 0xac28,
+	0x00ce, 0x0804, 0x928d, 0x2c78, 0x600c, 0x2060, 0x0804, 0x928d,
+	0x012e, 0x000e, 0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e,
+	0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xe621,
+	0x080c, 0xe26c, 0x007e, 0x003e, 0x001e, 0x08c0, 0x6020, 0x9086,
+	0x0009, 0x1168, 0xa87b, 0x0006, 0x0016, 0x0036, 0x0076, 0x080c,
+	0x6d80, 0x080c, 0xabed, 0x007e, 0x003e, 0x001e, 0x0848, 0x6020,
+	0x9086, 0x000a, 0x0904, 0x92d5, 0x0804, 0x92d3, 0x0006, 0x0066,
+	0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126, 0x2091, 0x8000,
+	0x2079, 0x19e7, 0x7848, 0x9065, 0x0904, 0x9385, 0x600c, 0x0006,
+	0x600f, 0x0000, 0x784c, 0x9c06, 0x11a0, 0x0036, 0x2019, 0x0001,
+	0x080c, 0xa118, 0x783f, 0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52,
+	0x7b6e, 0x003e, 0x000e, 0x9005, 0x1118, 0x600c, 0x600f, 0x0000,
+	0x0006, 0x00e6, 0x2f70, 0x080c, 0x926e, 0x00ee, 0x080c, 0xc838,
+	0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1580, 0x3e08,
+	0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6048, 0x9005, 0x1198, 0x2001,
+	0x1988, 0x2004, 0x604a, 0x0070, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6d74, 0x080c, 0xca27, 0x6044, 0xc0fc, 0x6046,
+	0x080c, 0xac28, 0x000e, 0x0804, 0x9333, 0x7e4a, 0x7e46, 0x012e,
+	0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1118, 0x080c, 0xe26c, 0x0c38, 0x6020, 0x9086,
+	0x0009, 0x1130, 0xab7a, 0x080c, 0x6d80, 0x080c, 0xabed, 0x0c10,
+	0x6020, 0x9086, 0x000a, 0x0990, 0x0878, 0x0016, 0x0026, 0x0086,
+	0x9046, 0x00a9, 0x080c, 0x9496, 0x008e, 0x002e, 0x001e, 0x0005,
+	0x00f6, 0x0126, 0x2079, 0x19e7, 0x2091, 0x8000, 0x080c, 0x94df,
+	0x080c, 0x9573, 0x080c, 0x67b2, 0x012e, 0x00fe, 0x0005, 0x00b6,
+	0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x7620, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0x945b, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
+	0x9456, 0x88ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x9456, 0x7030,
+	0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c,
+	0x86f6, 0x080c, 0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338, 0x7033,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
 	0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069,
-	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0058,
-	0x080c, 0x69f3, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808, 0xc0ad,
-	0x780a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xc812, 0x01b0,
-	0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xca29, 0x1118, 0x080c,
-	0xb591, 0x0060, 0x080c, 0x69f3, 0x1168, 0xa867, 0x0103, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0x6d70, 0x080c, 0xca03, 0x080c, 0xac04,
-	0x080c, 0xa1ea, 0x000e, 0x0804, 0x94b5, 0x7e22, 0x7e1e, 0x00de,
-	0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1118, 0x080c, 0xe241, 0x0c50, 0x080c, 0xb591, 0x6020, 0x9086,
-	0x0002, 0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990,
-	0x9086, 0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0,
-	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b,
-	0x0d00, 0x0860, 0x0006, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x9036,
-	0x7828, 0x9065, 0x0510, 0x6010, 0x2058, 0x600c, 0x0006, 0x3e08,
-	0x918e, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x11a8, 0x6043, 0xffff,
-	0x080c, 0xaa51, 0x0180, 0x610c, 0x080c, 0x9f7e, 0x6014, 0x2048,
-	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d70, 0x080c,
-	0xac04, 0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce, 0x00be,
-	0x009e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0x080c,
-	0x6134, 0x11b0, 0x2071, 0x19e7, 0x7030, 0x9080, 0x0005, 0x2004,
-	0x904d, 0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19e7, 0x7030,
-	0x9035, 0x0130, 0x9080, 0x0005, 0x2004, 0x9906, 0x1108, 0x0029,
-	0x006e, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6, 0x2660, 0x6043,
-	0xffff, 0x080c, 0xaa51, 0x0178, 0x080c, 0x9f7e, 0x6014, 0x2048,
-	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xcb12, 0x080c,
-	0x6d70, 0x080c, 0xac04, 0x00ce, 0x0005, 0x00b6, 0x00e6, 0x00c6,
-	0x080c, 0xa8d0, 0x0106, 0x190c, 0xa872, 0x2071, 0x0101, 0x2e04,
-	0xc0c4, 0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x190c, 0xa88e,
-	0x00ce, 0x00ee, 0x00be, 0x0005, 0x2071, 0x19e7, 0x7030, 0x9005,
-	0x0da0, 0x9c06, 0x190c, 0x0d7d, 0x7036, 0x080c, 0x86c5, 0x7004,
-	0x9084, 0x0007, 0x0002, 0x95dd, 0x95df, 0x95e6, 0x95f0, 0x95fe,
-	0x95dd, 0x95e6, 0x95db, 0x080c, 0x0d7d, 0x0428, 0x0005, 0x080c,
-	0xaa3c, 0x7007, 0x0000, 0x7033, 0x0000, 0x00e8, 0x0066, 0x9036,
-	0x080c, 0x9f7e, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000, 0x0098,
-	0x080c, 0xaa27, 0x0140, 0x080c, 0xaa3c, 0x0128, 0x0066, 0x9036,
-	0x080c, 0x9f7e, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c, 0xaa27,
-	0x080c, 0xa314, 0x0000, 0x010e, 0x190c, 0xa88e, 0x00ce, 0x00ee,
-	0x00be, 0x0005, 0x00d6, 0x00c6, 0x080c, 0xa8d0, 0x0106, 0x190c,
-	0xa872, 0x6044, 0xd0fc, 0x1130, 0x010e, 0x190c, 0xa88e, 0x00ce,
-	0x00de, 0x0005, 0x2069, 0x19e7, 0x684c, 0x9005, 0x0da8, 0x9c06,
-	0x190c, 0x0d7d, 0x6852, 0x00e6, 0x2d70, 0x080c, 0x923d, 0x00ee,
-	0x080c, 0x86d2, 0x0016, 0x2009, 0x0040, 0x080c, 0x21b0, 0x001e,
-	0x683c, 0x9084, 0x0003, 0x0002, 0x963a, 0x963b, 0x9659, 0x9638,
-	0x080c, 0x0d7d, 0x0460, 0x6868, 0x9086, 0x0001, 0x0190, 0x600c,
-	0x9015, 0x0160, 0x6a4a, 0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046,
-	0x9006, 0x7042, 0x684e, 0x683f, 0x0000, 0x00c8, 0x684a, 0x6846,
-	0x0ca0, 0x686b, 0x0000, 0x6848, 0x9065, 0x0d78, 0x6003, 0x0002,
-	0x0c60, 0x9006, 0x686a, 0x6852, 0x686e, 0x600c, 0x9015, 0x0120,
-	0x6a4a, 0x600f, 0x0000, 0x0018, 0x684e, 0x684a, 0x6846, 0x684f,
-	0x0000, 0x010e, 0x190c, 0xa88e, 0x00ce, 0x00de, 0x0005, 0x0005,
-	0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x9685, 0x9688, 0x9af6,
-	0x9b85, 0x9688, 0x9af6, 0x9b85, 0x9685, 0x9688, 0x9685, 0x9685,
-	0x9685, 0x9685, 0x9685, 0x9685, 0x9685, 0x080c, 0x95ad, 0x0005,
-	0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a,
-	0x0053, 0x1a0c, 0x0d7d, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061,
-	0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x96f4, 0x005b, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
-	0x00be, 0x0005, 0x9879, 0x98b4, 0x98dd, 0x9985, 0x99a7, 0x99ad,
-	0x99ba, 0x99c2, 0x99ce, 0x99d4, 0x99e5, 0x99d4, 0x9a3d, 0x99c2,
-	0x9a49, 0x9a4f, 0x99ce, 0x9a4f, 0x9a5b, 0x96f2, 0x96f2, 0x96f2,
-	0x96f2, 0x96f2, 0x96f2, 0x96f2, 0x96f2, 0x96f2, 0x96f2, 0x96f2,
-	0x9f9f, 0x9fc2, 0x9fd3, 0x9ff3, 0xa025, 0x99ba, 0x96f2, 0x99ba,
-	0x99d4, 0x96f2, 0x98dd, 0x9985, 0x96f2, 0xa407, 0x99d4, 0x96f2,
-	0xa423, 0x99d4, 0x96f2, 0x99ce, 0x9873, 0x9715, 0x96f2, 0xa43f,
-	0xa4ac, 0xa58c, 0x96f2, 0xa599, 0x99b7, 0xa5c4, 0x96f2, 0xa02f,
-	0xa5d0, 0x96f2, 0x080c, 0x0d7d, 0x2100, 0x005b, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be,
-	0x0005, 0xa670, 0xa722, 0x9713, 0x973c, 0x97e8, 0x97f3, 0x9713,
-	0x99ba, 0x9713, 0x983a, 0x9846, 0x9757, 0x9713, 0x9772, 0x97a6,
-	0xaaa7, 0xaaec, 0x99d4, 0x080c, 0x0d7d, 0x00d6, 0x0096, 0x080c,
-	0x9a6e, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814,
-	0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026, 0x60c3,
-	0x0018, 0x080c, 0x9dde, 0x009e, 0x00de, 0x0005, 0x7810, 0x00b6,
-	0x2058, 0xb8a0, 0x00be, 0x080c, 0xab33, 0x1118, 0x9084, 0xff80,
-	0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9a6e,
-	0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878, 0x700e,
-	0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888, 0x701e,
-	0x60c3, 0x0010, 0x080c, 0x9dde, 0x009e, 0x00de, 0x0005, 0x00d6,
-	0x0096, 0x080c, 0x9a6e, 0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc,
-	0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc,
-	0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x9dde, 0x009e,
-	0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x9a6e, 0x20e9, 0x0000, 0x2001, 0x19a3, 0x2003, 0x0000, 0x7814,
-	0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016, 0x200c,
-	0x2001, 0x0001, 0x080c, 0x2195, 0x080c, 0xd58c, 0x9006, 0x080c,
-	0x2195, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9,
-	0x080c, 0x9dde, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9ab9, 0x20e9, 0x0000, 0x2001,
-	0x19a3, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200, 0xa873,
-	0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016, 0x200c,
-	0x080c, 0xd58c, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c60,
-	0x0051, 0x7814, 0x2048, 0x080c, 0x0fec, 0x080c, 0x9dde, 0x012e,
-	0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003, 0x9005,
-	0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005,
-	0x080c, 0x9a6e, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a, 0x60c3,
-	0x0008, 0x0804, 0x9dde, 0x00d6, 0x00e6, 0x080c, 0x9ab9, 0x7814,
-	0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010,
-	0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9,
-	0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x9809, 0x2069, 0x1801,
-	0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x9812, 0x2069,
-	0x19b3, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cd, 0x20a9, 0x001a,
-	0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010, 0x8000,
-	0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68,
-	0x8e70, 0x1f04, 0x9820, 0x60c3, 0x004c, 0x080c, 0x9dde, 0x00ee,
-	0x00de, 0x0005, 0x080c, 0x9a6e, 0x7003, 0x6300, 0x7007, 0x0028,
-	0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9dde, 0x00d6, 0x0026,
-	0x0016, 0x080c, 0x9ab9, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6,
-	0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2069, 0x1923,
-	0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70, 0x2073, 0x0000,
-	0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800, 0x8e70, 0x2073,
-	0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9dde, 0x001e,
-	0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004, 0x609a, 0x0804,
-	0x9dde, 0x080c, 0x9a6e, 0x7003, 0x5200, 0x2069, 0x1847, 0x6804,
-	0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x262e, 0x710e, 0x001e,
-	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
-	0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
-	0x0254, 0x4003, 0x080c, 0xab33, 0x1120, 0xb8a0, 0x9082, 0x007f,
-	0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001, 0x1820, 0x2004,
-	0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x7036,
-	0x60c3, 0x001c, 0x0804, 0x9dde, 0x080c, 0x9a6e, 0x7003, 0x0500,
-	0x080c, 0xab33, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
-	0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004, 0x700e, 0x0030,
-	0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004,
-	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250,
-	0x4003, 0x60c3, 0x0010, 0x0804, 0x9dde, 0x080c, 0x9a6e, 0x9006,
-	0x080c, 0x6a25, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400,
-	0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d, 0x0120,
-	0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0,
-	0x9086, 0x007e, 0x1904, 0x994c, 0x00d6, 0x2069, 0x196c, 0x2001,
-	0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a, 0x6808, 0x9084,
-	0x2000, 0x7012, 0x080c, 0xab4a, 0x680c, 0x7016, 0x701f, 0x2710,
-	0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800, 0x700a, 0x6804,
-	0x700e, 0x6808, 0x080c, 0x74d5, 0x1118, 0x9084, 0x37ff, 0x0010,
-	0x9084, 0x3fff, 0x7012, 0x080c, 0xab4a, 0x680c, 0x7016, 0x00de,
-	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
-	0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
-	0x025a, 0x4003, 0x00d6, 0x080c, 0xa657, 0x2069, 0x1974, 0x2071,
-	0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x56d7, 0xd0e4, 0x0110,
-	0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837, 0x2004, 0xd0a4,
-	0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0, 0x9106, 0x0130,
-	0x2100, 0x60e3, 0x0000, 0x080c, 0x266f, 0x61e2, 0x001e, 0x20e1,
-	0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x20a9,
-	0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1, 0x0256,
-	0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003,
-	0x080c, 0xa657, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099, 0x1974,
-	0x4003, 0x60c3, 0x0074, 0x0804, 0x9dde, 0x080c, 0x9a6e, 0x7003,
-	0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000, 0x9006,
-	0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085,
-	0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085, 0x0002, 0x00d6,
-	0x0804, 0x9a1e, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9dde, 0x080c,
-	0x9a6e, 0x7003, 0x5000, 0x0804, 0x98f7, 0x080c, 0x9a6e, 0x7003,
-	0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9dde, 0x080c,
-	0x9ab0, 0x0010, 0x080c, 0x9ab9, 0x7003, 0x0200, 0x60c3, 0x0004,
-	0x0804, 0x9dde, 0x080c, 0x9ab9, 0x7003, 0x0100, 0x700b, 0x0003,
-	0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9dde, 0x080c, 0x9ab9,
-	0x7003, 0x0200, 0x0804, 0x98f7, 0x080c, 0x9ab9, 0x7003, 0x0100,
-	0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003, 0x7814,
-	0x700e, 0x60c3, 0x0008, 0x0804, 0x9dde, 0x00d6, 0x080c, 0x9ab9,
-	0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894, 0x9086,
-	0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998, 0x9184,
-	0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058, 0x700f,
-	0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700, 0x0010,
-	0x700f, 0x0800, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac,
-	0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x2009,
-	0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026, 0x2009,
-	0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbad4, 0xd28c, 0x1108,
-	0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130,
-	0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026,
-	0x60c3, 0x0014, 0x00de, 0x0804, 0x9dde, 0x080c, 0x9ab9, 0x7003,
-	0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014, 0x0804,
-	0x9dde, 0x080c, 0x9ab9, 0x7003, 0x0200, 0x0804, 0x987d, 0x080c,
-	0x9ab9, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3,
-	0x0008, 0x0804, 0x9dde, 0x080c, 0x9ab9, 0x7003, 0x0100, 0x700b,
-	0x000b, 0x60c3, 0x0008, 0x0804, 0x9dde, 0x0026, 0x00d6, 0x0036,
-	0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6,
-	0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0xa66c,
-	0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c,
-	0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e, 0x003e,
-	0x00de, 0x080c, 0x9dd2, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027,
-	0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0xa66c,
-	0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800, 0x687c,
-	0x700a, 0x6880, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10, 0x7003,
-	0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000, 0x0005,
-	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021, 0x0800,
-	0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300, 0x2021,
-	0x0100, 0x080c, 0xa66c, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
-	0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c, 0x700a, 0x6880,
-	0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e, 0x00de,
-	0x080c, 0x9dd2, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
-	0x024c, 0x002e, 0x0005, 0x080c, 0x9dd2, 0x721a, 0x7a08, 0x7222,
-	0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040,
+	0x7008, 0xc0ad, 0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x9456,
+	0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c,
+	0xc838, 0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xca4d,
+	0x1118, 0x080c, 0xb5b5, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xcb36, 0x080c, 0xe621,
+	0x080c, 0x6d80, 0x008e, 0x003e, 0x001e, 0x080c, 0xca27, 0x080c,
+	0xac28, 0x080c, 0xa20e, 0x00ce, 0x0804, 0x93d0, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x93d0, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086,
+	0x0006, 0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xe621, 0x080c,
+	0xe26c, 0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xb5b5, 0x6020,
+	0x9086, 0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e,
+	0x0904, 0x943c, 0x9086, 0x008b, 0x0904, 0x943c, 0x0840, 0x6020,
+	0x9086, 0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e,
+	0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804, 0x944f, 0x0006, 0x00f6,
+	0x00e6, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x0016, 0x0126, 0x2091,
+	0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x2079, 0x19e7, 0x9036,
+	0x7828, 0x2060, 0x8cff, 0x0538, 0x6010, 0x9b06, 0x1500, 0x6043,
+	0xffff, 0x080c, 0xaa75, 0x01d8, 0x610c, 0x0016, 0x080c, 0x9fa2,
+	0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
+	0x0036, 0x0086, 0x080c, 0xcb36, 0x080c, 0xe621, 0x080c, 0x6d80,
+	0x008e, 0x003e, 0x001e, 0x080c, 0xac28, 0x00ce, 0x08d8, 0x2c30,
+	0x600c, 0x2060, 0x08b8, 0x080c, 0x67cf, 0x012e, 0x001e, 0x006e,
+	0x00ce, 0x00be, 0x009e, 0x00ee, 0x00fe, 0x000e, 0x0005, 0x0096,
+	0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904,
+	0x9546, 0x600c, 0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000,
+	0x7830, 0x9c06, 0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508,
+	0x080c, 0x86f6, 0x080c, 0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338,
+	0x7833, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x0058, 0x080c, 0x6a03, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808,
+	0xc0ad, 0x780a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xc836,
+	0x01b0, 0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xca4d, 0x1118,
+	0x080c, 0xb5b5, 0x0060, 0x080c, 0x6a03, 0x1168, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x080c,
+	0xac28, 0x080c, 0xa20e, 0x000e, 0x0804, 0x94e6, 0x7e22, 0x7e1e,
+	0x00de, 0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086,
+	0x0006, 0x1118, 0x080c, 0xe26c, 0x0c50, 0x080c, 0xb5b5, 0x6020,
+	0x9086, 0x0002, 0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e,
+	0x0990, 0x9086, 0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005,
+	0x19b0, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086,
+	0x008b, 0x0d00, 0x0860, 0x0006, 0x0096, 0x00b6, 0x00c6, 0x0066,
+	0x9036, 0x7828, 0x9065, 0x0510, 0x6010, 0x2058, 0x600c, 0x0006,
+	0x3e08, 0x918e, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x11a8, 0x6043,
+	0xffff, 0x080c, 0xaa75, 0x0180, 0x610c, 0x080c, 0x9fa2, 0x6014,
+	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d80,
+	0x080c, 0xac28, 0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce,
+	0x00be, 0x009e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066,
+	0x080c, 0x613b, 0x11b0, 0x2071, 0x19e7, 0x7030, 0x9080, 0x0005,
+	0x2004, 0x904d, 0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19e7,
+	0x7030, 0x9035, 0x0130, 0x9080, 0x0005, 0x2004, 0x9906, 0x1108,
+	0x0029, 0x006e, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6, 0x2660,
+	0x6043, 0xffff, 0x080c, 0xaa75, 0x0178, 0x080c, 0x9fa2, 0x6014,
+	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xcb36,
+	0x080c, 0x6d80, 0x080c, 0xac28, 0x00ce, 0x0005, 0x00b6, 0x00e6,
+	0x00c6, 0x080c, 0xa8f4, 0x0106, 0x190c, 0xa896, 0x2071, 0x0101,
+	0x2e04, 0xc0c4, 0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x190c,
+	0xa8b2, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x2071, 0x19e7, 0x7030,
+	0x9005, 0x0da0, 0x9c06, 0x190c, 0x0d7d, 0x7036, 0x080c, 0x86f6,
+	0x7004, 0x9084, 0x0007, 0x0002, 0x960e, 0x9610, 0x9617, 0x9621,
+	0x962f, 0x960e, 0x9617, 0x960c, 0x080c, 0x0d7d, 0x0428, 0x0005,
+	0x080c, 0xaa60, 0x7007, 0x0000, 0x7033, 0x0000, 0x00e8, 0x0066,
+	0x9036, 0x080c, 0x9fa2, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000,
+	0x0098, 0x080c, 0xaa4b, 0x0140, 0x080c, 0xaa60, 0x0128, 0x0066,
+	0x9036, 0x080c, 0x9fa2, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c,
+	0xaa4b, 0x080c, 0xa338, 0x0000, 0x010e, 0x190c, 0xa8b2, 0x00ce,
+	0x00ee, 0x00be, 0x0005, 0x00d6, 0x00c6, 0x080c, 0xa8f4, 0x0106,
+	0x190c, 0xa896, 0x6044, 0xd0fc, 0x1130, 0x010e, 0x190c, 0xa8b2,
+	0x00ce, 0x00de, 0x0005, 0x2069, 0x19e7, 0x684c, 0x9005, 0x0da8,
+	0x9c06, 0x190c, 0x0d7d, 0x6852, 0x00e6, 0x2d70, 0x080c, 0x926e,
+	0x00ee, 0x080c, 0x8703, 0x0016, 0x2009, 0x0040, 0x080c, 0x21b0,
+	0x001e, 0x683c, 0x9084, 0x0003, 0x0002, 0x966b, 0x966c, 0x968a,
+	0x9669, 0x080c, 0x0d7d, 0x0460, 0x6868, 0x9086, 0x0001, 0x0190,
+	0x600c, 0x9015, 0x0160, 0x6a4a, 0x600f, 0x0000, 0x6044, 0xc0fc,
+	0x6046, 0x9006, 0x7042, 0x684e, 0x683f, 0x0000, 0x00c8, 0x684a,
+	0x6846, 0x0ca0, 0x686b, 0x0000, 0x6848, 0x9065, 0x0d78, 0x6003,
+	0x0002, 0x0c60, 0x9006, 0x686a, 0x6852, 0x686e, 0x600c, 0x9015,
+	0x0120, 0x6a4a, 0x600f, 0x0000, 0x0018, 0x684e, 0x684a, 0x6846,
+	0x684f, 0x0000, 0x010e, 0x190c, 0xa8b2, 0x00ce, 0x00de, 0x0005,
+	0x0005, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x96b6, 0x96b9,
+	0x9b27, 0x9bb6, 0x96b9, 0x9b27, 0x9bb6, 0x96b6, 0x96b9, 0x96b6,
+	0x96b6, 0x96b6, 0x96b6, 0x96b6, 0x96b6, 0x96b6, 0x080c, 0x95de,
+	0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
 	0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004,
-	0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d,
-	0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082,
-	0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
-	0x9b27, 0x9b36, 0x9b41, 0x9b25, 0x9b25, 0x9b25, 0x9b27, 0x9b25,
-	0x9b25, 0x9b25, 0x9b25, 0x9b25, 0x9b25, 0x080c, 0x0d7d, 0x0411,
-	0x60c3, 0x0000, 0x0026, 0x080c, 0x2979, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9dde, 0x0431, 0x7808,
-	0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c, 0x0804,
-	0x9dde, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004,
-	0x0804, 0x9dde, 0x0026, 0x080c, 0xa66c, 0xb810, 0x9085, 0x8100,
+	0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x6110, 0x2158, 0xb984, 0x2c78,
+	0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x9725, 0x005b,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
+	0x015e, 0x00be, 0x0005, 0x98aa, 0x98e5, 0x990e, 0x99b6, 0x99d8,
+	0x99de, 0x99eb, 0x99f3, 0x99ff, 0x9a05, 0x9a16, 0x9a05, 0x9a6e,
+	0x99f3, 0x9a7a, 0x9a80, 0x99ff, 0x9a80, 0x9a8c, 0x9723, 0x9723,
+	0x9723, 0x9723, 0x9723, 0x9723, 0x9723, 0x9723, 0x9723, 0x9723,
+	0x9723, 0x9fc3, 0x9fe6, 0x9ff7, 0xa017, 0xa049, 0x99eb, 0x9723,
+	0x99eb, 0x9a05, 0x9723, 0x990e, 0x99b6, 0x9723, 0xa42b, 0x9a05,
+	0x9723, 0xa447, 0x9a05, 0x9723, 0x99ff, 0x98a4, 0x9746, 0x9723,
+	0xa463, 0xa4d0, 0xa5b0, 0x9723, 0xa5bd, 0x99e8, 0xa5e8, 0x9723,
+	0xa053, 0xa5f4, 0x9723, 0x080c, 0x0d7d, 0x2100, 0x005b, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
+	0x00be, 0x0005, 0xa694, 0xa746, 0x9744, 0x976d, 0x9819, 0x9824,
+	0x9744, 0x99eb, 0x9744, 0x986b, 0x9877, 0x9788, 0x9744, 0x97a3,
+	0x97d7, 0xaacb, 0xab10, 0x9a05, 0x080c, 0x0d7d, 0x00d6, 0x0096,
+	0x080c, 0x9a9f, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800,
+	0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026,
+	0x60c3, 0x0018, 0x080c, 0x9e02, 0x009e, 0x00de, 0x0005, 0x7810,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xab57, 0x1118, 0x9084,
+	0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c,
+	0x9a9f, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878,
+	0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888,
+	0x701e, 0x60c3, 0x0010, 0x080c, 0x9e02, 0x009e, 0x00de, 0x0005,
+	0x00d6, 0x0096, 0x080c, 0x9a9f, 0x7003, 0x0500, 0x7814, 0x2048,
+	0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016,
+	0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x9e02,
+	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9a9f, 0x20e9, 0x0000, 0x2001, 0x19a3, 0x2003, 0x0000,
+	0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016,
+	0x200c, 0x2001, 0x0001, 0x080c, 0x2195, 0x080c, 0xd5b1, 0x9006,
+	0x080c, 0x2195, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28,
+	0x04d9, 0x080c, 0x9e02, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6,
+	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9aea, 0x20e9, 0x0000,
+	0x2001, 0x19a3, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200,
+	0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016,
+	0x200c, 0x080c, 0xd5b1, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048,
+	0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fec, 0x080c, 0x9e02,
+	0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003,
+	0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0,
+	0x0005, 0x080c, 0x9a9f, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a,
+	0x60c3, 0x0008, 0x0804, 0x9e02, 0x00d6, 0x00e6, 0x080c, 0x9aea,
+	0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095,
+	0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805,
+	0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x983a, 0x2069,
+	0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x9843,
+	0x2069, 0x19b3, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cd, 0x20a9,
+	0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010,
+	0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072,
+	0x8d68, 0x8e70, 0x1f04, 0x9851, 0x60c3, 0x004c, 0x080c, 0x9e02,
+	0x00ee, 0x00de, 0x0005, 0x080c, 0x9a9f, 0x7003, 0x6300, 0x7007,
+	0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x00d6,
+	0x0026, 0x0016, 0x080c, 0x9aea, 0x7003, 0x0200, 0x7814, 0x700e,
+	0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2069,
+	0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70, 0x2073,
+	0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800, 0x8e70,
+	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9e02,
+	0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004, 0x609a,
+	0x0804, 0x9e02, 0x080c, 0x9a9f, 0x7003, 0x5200, 0x2069, 0x1847,
+	0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x262e, 0x710e,
+	0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x0254, 0x4003, 0x080c, 0xab57, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001, 0x1820,
+	0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
+	0x7036, 0x60c3, 0x001c, 0x0804, 0x9e02, 0x080c, 0x9a9f, 0x7003,
+	0x0500, 0x080c, 0xab57, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
+	0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004, 0x700e,
+	0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9,
+	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
+	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x9e02, 0x080c, 0x9a9f,
+	0x9006, 0x080c, 0x6a35, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003,
+	0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d,
+	0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300,
+	0xb8a0, 0x9086, 0x007e, 0x1904, 0x997d, 0x00d6, 0x2069, 0x196c,
+	0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a, 0x6808,
+	0x9084, 0x2000, 0x7012, 0x080c, 0xab6e, 0x680c, 0x7016, 0x701f,
+	0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800, 0x700a,
+	0x6804, 0x700e, 0x6808, 0x080c, 0x74e9, 0x1118, 0x9084, 0x37ff,
+	0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xab6e, 0x680c, 0x7016,
+	0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xa67b, 0x2069, 0x1974,
+	0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x56de, 0xd0e4,
+	0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837, 0x2004,
+	0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0, 0x9106,
+	0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x266f, 0x61e2, 0x001e,
+	0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1,
+	0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a,
+	0x4003, 0x080c, 0xa67b, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099,
+	0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9e02, 0x080c, 0x9a9f,
+	0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000,
+	0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac, 0x1110,
+	0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085, 0x0002,
+	0x00d6, 0x0804, 0x9a4f, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9e02,
+	0x080c, 0x9a9f, 0x7003, 0x5000, 0x0804, 0x9928, 0x080c, 0x9a9f,
+	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9e02,
+	0x080c, 0x9ae1, 0x0010, 0x080c, 0x9aea, 0x7003, 0x0200, 0x60c3,
+	0x0004, 0x0804, 0x9e02, 0x080c, 0x9aea, 0x7003, 0x0100, 0x700b,
+	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x080c,
+	0x9aea, 0x7003, 0x0200, 0x0804, 0x9928, 0x080c, 0x9aea, 0x7003,
+	0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003,
+	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x00d6, 0x080c,
+	0x9aea, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894,
+	0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998,
+	0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058,
+	0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700,
+	0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe,
+	0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010,
+	0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026,
+	0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbad4, 0xd28c,
+	0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec,
+	0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e,
+	0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x9e02, 0x080c, 0x9aea,
+	0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014,
+	0x0804, 0x9e02, 0x080c, 0x9aea, 0x7003, 0x0200, 0x0804, 0x98ae,
+	0x080c, 0x9aea, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00,
+	0x60c3, 0x0008, 0x0804, 0x9e02, 0x080c, 0x9aea, 0x7003, 0x0100,
+	0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x0026, 0x00d6,
+	0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026,
+	0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c,
+	0xa690, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e,
+	0x003e, 0x00de, 0x080c, 0x9df6, 0x721a, 0x9f95, 0x0000, 0x7222,
+	0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c,
+	0xa690, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10,
+	0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000,
+	0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021,
+	0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300,
+	0x2021, 0x0100, 0x080c, 0xa690, 0xb810, 0x9305, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005,
+	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c, 0x700a,
+	0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e,
+	0x00de, 0x080c, 0x9df6, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
+	0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x9df6, 0x721a, 0x7a08,
+	0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c,
+	0x0d7d, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a,
+	0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x0005, 0x9b58, 0x9b67, 0x9b72, 0x9b56, 0x9b56, 0x9b56, 0x9b58,
+	0x9b56, 0x9b56, 0x9b56, 0x9b56, 0x9b56, 0x9b56, 0x080c, 0x0d7d,
+	0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2979, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9e02, 0x0431,
+	0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c,
+	0x0804, 0x9e02, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3,
+	0x0004, 0x0804, 0x9e02, 0x0026, 0x080c, 0xa690, 0xb810, 0x9085,
+	0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
+	0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9aba, 0x0026, 0x080c,
+	0xa690, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012,
+	0x0804, 0x9b1c, 0x0026, 0x080c, 0xa690, 0xb810, 0x9085, 0x8500,
 	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880,
-	0x700e, 0x7013, 0x0009, 0x0804, 0x9a89, 0x0026, 0x080c, 0xa66c,
-	0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804,
-	0x9aeb, 0x0026, 0x080c, 0xa66c, 0xb810, 0x9085, 0x8500, 0x7002,
-	0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e,
-	0x2001, 0x0099, 0x7012, 0x0804, 0x9aeb, 0x00b6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, 0x7804,
-	0x908a, 0x0040, 0x0a0c, 0x0d7d, 0x908a, 0x0057, 0x1a0c, 0x0d7d,
-	0x7910, 0x2158, 0xb984, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040,
-	0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x9bba,
-	0x9bba, 0x9bba, 0x9bde, 0x9bba, 0x9bba, 0x9bba, 0x9bba, 0x9bba,
-	0x9bba, 0x9bba, 0xa1c7, 0xa1cf, 0xa1d7, 0xa1df, 0x9bba, 0x9bba,
-	0x9bba, 0xa1bf, 0x080c, 0x0d7d, 0x6813, 0x0008, 0xba8c, 0x8210,
-	0xb8d4, 0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52, 0x722e, 0x732a,
-	0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10, 0x9295, 0x0600,
-	0x7202, 0xba14, 0x7206, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013,
-	0x0829, 0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x0016, 0x7814,
-	0x9084, 0x0700, 0x8007, 0x0013, 0x001e, 0x0005, 0x9bee, 0x9bee,
-	0x9bf0, 0x9bee, 0x9bee, 0x9bee, 0x9c0a, 0x9bee, 0x080c, 0x0d7d,
-	0x7914, 0x918c, 0x08ff, 0x918d, 0xf600, 0x7916, 0x2009, 0x0003,
-	0x00b9, 0x2069, 0x1847, 0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084,
-	0x00ff, 0x8007, 0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001,
-	0x0804, 0x9dde, 0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0,
-	0x0016, 0x080c, 0xa66c, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002,
-	0xb814, 0x7006, 0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e,
-	0x7013, 0x0888, 0x918d, 0x0008, 0x7116, 0x080c, 0x9dd2, 0x721a,
-	0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071,
-	0x1800, 0x7160, 0x7810, 0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110,
-	0x737c, 0x7480, 0x2500, 0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001,
-	0x04ff, 0x6062, 0x6067, 0xffff, 0x636a, 0x646e, 0x0050, 0x2001,
-	0x00ff, 0x9085, 0x0400, 0x6062, 0x6067, 0xffff, 0x606b, 0x0000,
-	0x616e, 0xb8b8, 0x6073, 0x0530, 0x6077, 0x0008, 0xb88c, 0x8000,
-	0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f,
-	0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048,
-	0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca,
-	0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
-	0x0000, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x0128, 0x609f,
-	0x0000, 0x2001, 0x0092, 0x0058, 0x6028, 0xc0bd, 0x602a, 0x609f,
-	0x00ff, 0x2011, 0xffff, 0x080c, 0x2a44, 0x2001, 0x00b2, 0x2010,
-	0x900e, 0x080c, 0x2a53, 0x2009, 0x07d0, 0x080c, 0x86ca, 0x003e,
-	0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005,
+	0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9b1c, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x7804, 0x908a, 0x0040, 0x0a0c, 0x0d7d, 0x908a, 0x0057, 0x1a0c,
+	0x0d7d, 0x7910, 0x2158, 0xb984, 0x2061, 0x0100, 0x619a, 0x9082,
+	0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
+	0x9beb, 0x9beb, 0x9beb, 0x9c11, 0x9beb, 0x9beb, 0x9beb, 0x9beb,
+	0x9beb, 0x9beb, 0x9beb, 0xa1eb, 0xa1f3, 0xa1fb, 0xa203, 0x9beb,
+	0x9beb, 0x9beb, 0xa1e3, 0x080c, 0x0d7d, 0x6813, 0x0008, 0xba8c,
+	0x8210, 0xb8d4, 0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52, 0x722e,
+	0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10, 0x9295,
+	0x0600, 0x7202, 0xba14, 0x7206, 0x2069, 0x1800, 0x6a7c, 0x720a,
+	0x6a80, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027, 0xffff,
+	0x0005, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e,
+	0x0005, 0x9c21, 0x9c21, 0x9c23, 0x9c21, 0x9c21, 0x9c21, 0x9c3d,
+	0x9c21, 0x080c, 0x0d7d, 0x7914, 0x918c, 0x08ff, 0x918d, 0xf600,
+	0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1847, 0x6804, 0xd0bc,
+	0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010, 0x7033,
+	0x3f00, 0x60c3, 0x0001, 0x0804, 0x9e02, 0x2009, 0x0003, 0x0019,
+	0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0xa690, 0x001e, 0xb810,
+	0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6a7c,
+	0x720a, 0x6a80, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008, 0x7116,
+	0x080c, 0x9df6, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005,
 	0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0036,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058, 0xb8a0,
-	0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582, 0x007e, 0x1250, 0x2500,
-	0x9094, 0xff80, 0x1130, 0x9080, 0x336d, 0x2015, 0x9294, 0x00ff,
-	0x0020, 0xb910, 0xba14, 0x737c, 0x7480, 0x70dc, 0xd0ac, 0x1130,
-	0x9582, 0x007e, 0x1218, 0x9584, 0xff80, 0x0138, 0x9185, 0x0400,
-	0x6062, 0x6266, 0x636a, 0x646e, 0x0030, 0x6063, 0x0400, 0x6266,
-	0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072, 0x6077, 0x0000, 0xb864,
-	0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff,
-	0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000, 0x2b00,
-	0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa848, 0x608a,
-	0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0x009e, 0xb86c,
-	0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xba84,
-	0x629e, 0x00f6, 0x2079, 0x0140, 0x7803, 0x0000, 0x00fe, 0x900e,
-	0x2011, 0x0092, 0x080c, 0x2a53, 0x2009, 0x07d0, 0x080c, 0x86ca,
-	0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be,
-	0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
-	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0,
-	0x2028, 0xb910, 0xba14, 0x737c, 0x7480, 0x7820, 0x0002, 0x9d4e,
-	0x9d4e, 0x9d4e, 0x9d4e, 0x9d4e, 0x9d4e, 0x9d4e, 0x9d4e, 0x9d4e,
-	0x9d4e, 0x9d50, 0x9d4e, 0x9d4e, 0x9d4e, 0x9d4e, 0x080c, 0x0d7d,
-	0x609f, 0x0000, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x05d0, 0xaf90,
-	0x9784, 0xff00, 0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006,
-	0x7814, 0x2048, 0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94,
-	0x87ff, 0x0510, 0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082,
-	0x2f00, 0x6086, 0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129,
-	0x6077, 0x0000, 0x609f, 0x0000, 0x2001, 0x1837, 0x2004, 0xd0ac,
-	0x11a8, 0xd09c, 0x0130, 0x7814, 0x2048, 0xa874, 0x9082, 0x0080,
-	0x1268, 0xb814, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072,
-	0x0c48, 0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc,
-	0x0118, 0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086,
-	0x6266, 0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
-	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa848, 0x608a,
-	0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0xb86c, 0x60ce,
-	0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c, 0xa64c, 0x2009, 0x07d0,
-	0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c,
-	0x86ca, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e,
-	0x00be, 0x0005, 0x7a40, 0x9294, 0x00ff, 0x8217, 0x0005, 0x00d6,
-	0x2069, 0x19e7, 0x686b, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056,
-	0x60a7, 0x9575, 0x00f1, 0x080c, 0x86bc, 0x0005, 0x0016, 0x2001,
-	0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089,
-	0x080c, 0x86bc, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c, 0x2102,
-	0x2001, 0x19e8, 0x2003, 0x0000, 0x2001, 0x19f3, 0x2003, 0x0000,
-	0x0c88, 0x0006, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011, 0x0009,
-	0x080c, 0x2a53, 0x002e, 0x001e, 0x000e, 0x0005, 0x0016, 0x00c6,
-	0x0006, 0x080c, 0xa8d0, 0x0106, 0x190c, 0xa872, 0x2061, 0x0100,
-	0x61a4, 0x60a7, 0x95f5, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011,
-	0x0008, 0x080c, 0x2a53, 0x002e, 0x001e, 0x010e, 0x190c, 0xa88e,
-	0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e, 0x0005,
-	0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x080c, 0x74d5, 0x1510, 0x2001, 0x1a0c, 0x2004, 0x9005, 0x1904,
-	0x9e8f, 0x080c, 0x7576, 0x11a8, 0x2069, 0x0380, 0x6843, 0x0101,
-	0x6844, 0xd084, 0x1de8, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120,
-	0x6024, 0xd084, 0x090c, 0x0d7d, 0x6843, 0x0100, 0x080c, 0x86bc,
-	0x04b0, 0x00c6, 0x2061, 0x19e7, 0x00f0, 0x6904, 0x9194, 0x4000,
-	0x0598, 0x080c, 0x9e0e, 0x080c, 0x2a1a, 0x00c6, 0x2061, 0x19e7,
-	0x6134, 0x9192, 0x0008, 0x1278, 0x8108, 0x6136, 0x080c, 0xa872,
-	0x6130, 0x080c, 0xa88e, 0x00ce, 0x81ff, 0x01c8, 0x080c, 0x86bc,
-	0x080c, 0x9e01, 0x00a0, 0x080c, 0xa872, 0x6130, 0x91e5, 0x0000,
-	0x0150, 0x080c, 0xe6ec, 0x080c, 0x86c5, 0x6003, 0x0001, 0x2009,
-	0x0014, 0x080c, 0xac68, 0x080c, 0xa88e, 0x00ce, 0x0000, 0x002e,
-	0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x1a0c, 0x2004, 0x9005,
-	0x1db0, 0x00c6, 0x2061, 0x19e7, 0x6134, 0x9192, 0x0003, 0x1ad8,
-	0x8108, 0x6136, 0x00ce, 0x080c, 0x86bc, 0x080c, 0x5edd, 0x2009,
-	0x1846, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6, 0x00d6,
-	0x00e6, 0x0016, 0x0026, 0x080c, 0x86d2, 0x080c, 0xa872, 0x2001,
-	0x0387, 0x2003, 0x0202, 0x2071, 0x19e7, 0x714c, 0x81ff, 0x0904,
-	0x9f37, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x74d5, 0x1510,
-	0x0036, 0x2019, 0x0002, 0x080c, 0xa0f4, 0x003e, 0x714c, 0x2160,
-	0x080c, 0xe6ec, 0x2009, 0x004a, 0x6220, 0x9296, 0x0009, 0x1130,
-	0x6114, 0x2148, 0xa87b, 0x0006, 0x2009, 0x004a, 0x6003, 0x0003,
-	0x080c, 0xac68, 0x2001, 0x0386, 0x2003, 0x5040, 0x080c, 0x7576,
-	0x0804, 0x9f37, 0x6904, 0xd1f4, 0x0904, 0x9f44, 0x080c, 0x2a1a,
-	0x00c6, 0x704c, 0x9065, 0x090c, 0x0d7d, 0x6020, 0x00ce, 0x9086,
-	0x0006, 0x1518, 0x61c8, 0x60c4, 0x9105, 0x11f8, 0x2009, 0x180c,
-	0x2104, 0xd0d4, 0x01d0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224,
-	0x9294, 0x0002, 0x1560, 0x0010, 0xc0d4, 0x200a, 0x6014, 0x9084,
-	0xe7fd, 0x9085, 0x0010, 0x6016, 0x704c, 0x2060, 0x080c, 0x960a,
-	0x2009, 0x0049, 0x080c, 0xac68, 0x00d0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa0f4, 0x003e, 0x714c, 0x2160, 0x080c, 0xe6ec, 0x2009,
-	0x004a, 0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b,
-	0x0006, 0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0xac68, 0x2001,
-	0x0387, 0x2003, 0x0200, 0x080c, 0xa88e, 0x002e, 0x001e, 0x00ee,
-	0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0x9eee, 0x0804,
-	0x9ef0, 0x0026, 0x00e6, 0x2071, 0x19e7, 0x706c, 0xd084, 0x01e8,
-	0xc084, 0x706e, 0x714c, 0x81ff, 0x01c0, 0x2071, 0x0100, 0x9188,
-	0x0008, 0x2114, 0x928e, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011,
-	0x0012, 0x080c, 0x2a53, 0x0048, 0x928e, 0x0009, 0x0db0, 0x2009,
-	0x1984, 0x2011, 0x0016, 0x080c, 0x2a53, 0x00ee, 0x002e, 0x0005,
-	0x9036, 0x2001, 0x19f1, 0x2004, 0x9005, 0x0128, 0x9c06, 0x0128,
-	0x2c30, 0x600c, 0x0cc8, 0x9085, 0x0001, 0x0005, 0x00f6, 0x2079,
-	0x19e7, 0x610c, 0x9006, 0x600e, 0x6044, 0xc0fc, 0x6046, 0x86ff,
-	0x1140, 0x7824, 0x9c06, 0x1118, 0x7826, 0x782a, 0x0050, 0x792a,
-	0x0040, 0x00c6, 0x2660, 0x610e, 0x00ce, 0x7824, 0x9c06, 0x1108,
-	0x7e26, 0x080c, 0xa1ea, 0x080c, 0xca03, 0x00fe, 0x0005, 0x080c,
-	0x9a6e, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6,
-	0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6,
-	0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x607c,
-	0x6180, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c,
-	0x0804, 0x9dde, 0x080c, 0x9a6e, 0x7003, 0x0f00, 0x7808, 0xd09c,
-	0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0x9dde, 0x0156, 0x080c, 0x9ab9, 0x7003, 0x0200,
-	0x080c, 0x878a, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5,
-	0x9ef0, 0x0002, 0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70,
-	0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x9fe2, 0x60c3, 0x001c,
-	0x015e, 0x0804, 0x9dde, 0x0016, 0x0026, 0x080c, 0x9a95, 0x080c,
-	0x9aa7, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096,
-	0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021,
-	0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010,
-	0x1250, 0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x9dde,
-	0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0xa657,
-	0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x9a6e, 0x7003,
-	0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9dde, 0x0016,
-	0x0026, 0x080c, 0x9a6e, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814,
-	0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080,
-	0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003,
-	0x8003, 0x60c2, 0x080c, 0x9dde, 0x002e, 0x001e, 0x0005, 0x00e6,
-	0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x7010,
-	0x2060, 0x8cff, 0x0188, 0x080c, 0xca29, 0x1110, 0x080c, 0xb591,
-	0x600c, 0x0006, 0x080c, 0xcca0, 0x600f, 0x0000, 0x080c, 0xabc9,
-	0x080c, 0xa1ea, 0x00ce, 0x0c68, 0x2c00, 0x7012, 0x700e, 0x012e,
-	0x000e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6,
-	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000,
-	0x2001, 0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100,
-	0x2079, 0x0140, 0x2071, 0x19e7, 0x7030, 0x2060, 0x8cff, 0x0548,
-	0x080c, 0x9e0e, 0x6ac0, 0x68c3, 0x0000, 0x080c, 0x86c5, 0x00c6,
-	0x2061, 0x0100, 0x080c, 0xa7a8, 0x00ce, 0x20a9, 0x01f4, 0x04b1,
-	0x080c, 0x95ad, 0x6044, 0xd0ac, 0x1128, 0x2001, 0x1988, 0x2004,
-	0x604a, 0x0020, 0x2009, 0x0013, 0x080c, 0xac68, 0x000e, 0x001e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
-	0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001, 0x0d78, 0x9096,
-	0x0004, 0x0d60, 0x080c, 0x86c5, 0x6814, 0x9084, 0x0001, 0x0110,
-	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x5e87,
-	0x080c, 0x860d, 0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094,
-	0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2a1a,
-	0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0xa0d6,
-	0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a,
-	0x9006, 0x080c, 0x2a0a, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6,
-	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000,
-	0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102, 0x2069, 0x0100,
-	0x2079, 0x0140, 0x2071, 0x0380, 0x701c, 0x0006, 0x701f, 0x0202,
-	0x2071, 0x19e7, 0x704c, 0x2060, 0x8cff, 0x0904, 0xa199, 0x9386,
-	0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904, 0xa199, 0x68af,
-	0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6,
-	0x68cb, 0x0008, 0x080c, 0x86d2, 0x080c, 0x1dd8, 0x0046, 0x2009,
-	0x00a5, 0x080c, 0x0e55, 0x2021, 0x0169, 0x2404, 0x9084, 0x000f,
-	0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008,
-	0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x19e7, 0x6814, 0x9084,
-	0x1984, 0x9085, 0x0012, 0x6816, 0x782b, 0x0008, 0x7057, 0x0000,
-	0x00fe, 0x00ee, 0x9386, 0x0002, 0x1128, 0x7884, 0x9005, 0x1110,
-	0x7887, 0x0001, 0x0016, 0x2009, 0x0040, 0x080c, 0x21b0, 0x001e,
-	0x2009, 0x0000, 0x080c, 0x0e55, 0x004e, 0x20a9, 0x03e8, 0x6824,
-	0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c,
-	0x2a1a, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04,
-	0xa167, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x6827, 0x4000, 0x6824, 0x83ff,
-	0x1180, 0x2009, 0x0049, 0x6020, 0x9086, 0x0009, 0x0150, 0x080c,
-	0x960a, 0x6044, 0xd0ac, 0x1118, 0x6003, 0x0002, 0x0010, 0x080c,
-	0xac68, 0x000e, 0x2071, 0x0380, 0xd08c, 0x1110, 0x701f, 0x0200,
-	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
-	0x19e7, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091,
-	0x8000, 0x2069, 0x19e7, 0x6a3e, 0x012e, 0x00de, 0x0005, 0x080c,
-	0x9bbc, 0x785c, 0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c,
-	0x9bbc, 0x785c, 0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c,
-	0x9bbc, 0x785c, 0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c,
-	0x9bbc, 0x785c, 0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c,
-	0x9bbc, 0x785c, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020,
-	0x0804, 0x9dde, 0x00e6, 0x2071, 0x19e7, 0x702c, 0x9005, 0x0110,
-	0x8001, 0x702e, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
-	0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x7620, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0xa28f,
-	0x8cff, 0x0904, 0xa28f, 0x6020, 0x9086, 0x0006, 0x1904, 0xa28a,
-	0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904, 0xa28a, 0x2039, 0x0000,
-	0x0050, 0x6010, 0x9b06, 0x1904, 0xa28a, 0x85ff, 0x0120, 0x605c,
-	0x9106, 0x1904, 0xa28a, 0x7030, 0x9c06, 0x15b0, 0x2069, 0x0100,
-	0x68c0, 0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001,
-	0x080c, 0x86c5, 0x080c, 0xa314, 0x7033, 0x0000, 0x0428, 0x080c,
-	0x86c5, 0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
-	0x68c3, 0x0000, 0x080c, 0xa314, 0x7033, 0x0000, 0x0036, 0x2069,
-	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824, 0xd084,
-	0x0110, 0x6827, 0x0001, 0x003e, 0x7020, 0x9c36, 0x1110, 0x660c,
-	0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x701e, 0x0010, 0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000,
-	0x6014, 0x0096, 0x2048, 0x080c, 0xc812, 0x0110, 0x080c, 0xe241,
-	0x009e, 0x080c, 0xac04, 0x080c, 0xa1ea, 0x88ff, 0x1190, 0x00ce,
-	0x0804, 0xa205, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa205, 0x9006,
-	0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6,
-	0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19e7, 0x7648, 0x2660, 0x2678, 0x8cff,
-	0x0904, 0xa303, 0x6020, 0x9086, 0x0006, 0x1904, 0xa2fe, 0x87ff,
-	0x0128, 0x2700, 0x9c06, 0x1904, 0xa2fe, 0x0040, 0x6010, 0x9b06,
-	0x15e8, 0x85ff, 0x0118, 0x605c, 0x9106, 0x15c0, 0x704c, 0x9c06,
-	0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa0f4, 0x703f, 0x0000,
-	0x9006, 0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x7048, 0x9c36,
-	0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x0066,
-	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
-	0x6014, 0x2048, 0x080c, 0xc812, 0x0110, 0x080c, 0xe241, 0x080c,
-	0xac04, 0x87ff, 0x1198, 0x00ce, 0x0804, 0xa2af, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0xa2af, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e,
-	0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000,
-	0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e7, 0x7033,
-	0x0000, 0x7004, 0x9086, 0x0003, 0x0158, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x2c10, 0x7648, 0x2660,
-	0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7048, 0x9c36,
-	0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x2c00,
-	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085,
-	0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e,
-	0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19e7, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904,
-	0xa3f6, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904,
-	0xa3f1, 0x7030, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x0904, 0xa3cd, 0x080c, 0x9e0e, 0x68c3, 0x0000, 0x080c, 0xa314,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058, 0x76dc,
+	0x96b4, 0x0028, 0x0110, 0x737c, 0x7480, 0x2500, 0x76dc, 0x96b4,
+	0x0028, 0x0140, 0x2001, 0x04ff, 0x6062, 0x6067, 0xffff, 0x636a,
+	0x646e, 0x0050, 0x2001, 0x00ff, 0x9085, 0x0400, 0x6062, 0x6067,
+	0xffff, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6073, 0x0530, 0x6077,
+	0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085,
+	0x0020, 0x607a, 0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff,
+	0x7814, 0x0096, 0x2048, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838,
+	0x60c6, 0xa834, 0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0x2001, 0x1837, 0x2004, 0x9084,
+	0x0028, 0x0128, 0x609f, 0x0000, 0x2001, 0x0092, 0x0058, 0x6028,
+	0xc0bd, 0x602a, 0x609f, 0x00ff, 0x2011, 0xffff, 0x080c, 0x2a44,
+	0x2001, 0x00b2, 0x2010, 0x900e, 0x080c, 0x2a53, 0x2009, 0x07d0,
+	0x080c, 0x86fb, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00be, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160,
+	0x7810, 0x2058, 0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582,
+	0x007e, 0x1250, 0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x3374,
+	0x2015, 0x9294, 0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480,
+	0x70dc, 0xd0ac, 0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80,
+	0x0138, 0x9185, 0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030,
+	0x6063, 0x0400, 0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072,
+	0x6077, 0x0000, 0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c,
+	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a,
+	0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096,
+	0x2048, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834,
+	0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0xba84, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803,
+	0x0000, 0x00fe, 0x900e, 0x2011, 0x0092, 0x080c, 0x2a53, 0x2009,
+	0x07d0, 0x080c, 0x86fb, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00be, 0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6,
+	0x00c6, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910, 0xba14, 0x737c, 0x7480,
+	0x7820, 0x0002, 0x9d81, 0x9d81, 0x9d81, 0x9d81, 0x9d81, 0x9d81,
+	0x9d81, 0x9d81, 0x9d81, 0x9d81, 0x9d83, 0x9d81, 0x9d81, 0x9d81,
+	0x9d81, 0x080c, 0x0d7d, 0xb884, 0x609e, 0x7814, 0x2048, 0xa87c,
+	0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00, 0x9105, 0x6062, 0x873f,
+	0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878, 0xc0fc, 0x9005,
+	0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198, 0x2039, 0x0098, 0x9705,
+	0x6072, 0x7808, 0x6082, 0x2f00, 0x6086, 0x0038, 0x9185, 0x2200,
+	0x6062, 0x6073, 0x0129, 0x6077, 0x0000, 0xb884, 0x609e, 0x0050,
+	0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0, 0x9185, 0x0200, 0x6062,
+	0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94, 0x87ff, 0x1120,
+	0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a, 0x646e, 0x6077,
+	0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a,
+	0x607f, 0x0000, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6,
+	0xa834, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
+	0x080c, 0xa670, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005,
+	0x0110, 0x2009, 0x1b58, 0x080c, 0x86fb, 0x003e, 0x004e, 0x005e,
+	0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7a40, 0x9294,
+	0x00ff, 0x8217, 0x0005, 0x00d6, 0x2069, 0x19e7, 0x686b, 0x0001,
+	0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c,
+	0x86ed, 0x0005, 0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600,
+	0x9086, 0x0600, 0x0128, 0x0089, 0x080c, 0x86ed, 0x001e, 0x0005,
+	0xc1e5, 0x2001, 0x180c, 0x2102, 0x2001, 0x19e8, 0x2003, 0x0000,
+	0x2001, 0x19f3, 0x2003, 0x0000, 0x0c88, 0x0006, 0x0016, 0x0026,
+	0x2009, 0x1804, 0x2011, 0x0009, 0x080c, 0x2a53, 0x002e, 0x001e,
+	0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x080c, 0xa8f4, 0x0106,
+	0x190c, 0xa896, 0x2061, 0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016,
+	0x0026, 0x2009, 0x1804, 0x2011, 0x0008, 0x080c, 0x2a53, 0x002e,
+	0x001e, 0x010e, 0x190c, 0xa8b2, 0x000e, 0xa001, 0xa001, 0xa001,
+	0x61a6, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x74e9, 0x1510, 0x2001,
+	0x1a0c, 0x2004, 0x9005, 0x1904, 0x9eb3, 0x080c, 0x758a, 0x11a8,
+	0x2069, 0x0380, 0x6843, 0x0101, 0x6844, 0xd084, 0x1de8, 0x2061,
+	0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0d7d,
+	0x6843, 0x0100, 0x080c, 0x86ed, 0x04b0, 0x00c6, 0x2061, 0x19e7,
+	0x00f0, 0x6904, 0x9194, 0x4000, 0x0598, 0x080c, 0x9e32, 0x080c,
+	0x2a1a, 0x00c6, 0x2061, 0x19e7, 0x6134, 0x9192, 0x0008, 0x1278,
+	0x8108, 0x6136, 0x080c, 0xa896, 0x6130, 0x080c, 0xa8b2, 0x00ce,
+	0x81ff, 0x01c8, 0x080c, 0x86ed, 0x080c, 0x9e25, 0x00a0, 0x080c,
+	0xa896, 0x6130, 0x91e5, 0x0000, 0x0150, 0x080c, 0xe717, 0x080c,
+	0x86f6, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0xac8c, 0x080c,
+	0xa8b2, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005,
+	0x2001, 0x1a0c, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e7,
+	0x6134, 0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c,
+	0x86ed, 0x080c, 0x5ee4, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a,
+	0x0c10, 0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c,
+	0x8703, 0x080c, 0xa896, 0x2001, 0x0387, 0x2003, 0x0202, 0x2071,
+	0x19e7, 0x714c, 0x81ff, 0x0904, 0x9f5b, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x74e9, 0x1510, 0x0036, 0x2019, 0x0002, 0x080c,
+	0xa118, 0x003e, 0x714c, 0x2160, 0x080c, 0xe717, 0x2009, 0x004a,
+	0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006,
+	0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0xac8c, 0x2001, 0x0386,
+	0x2003, 0x5040, 0x080c, 0x758a, 0x0804, 0x9f5b, 0x6904, 0xd1f4,
+	0x0904, 0x9f68, 0x080c, 0x2a1a, 0x00c6, 0x704c, 0x9065, 0x090c,
+	0x0d7d, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1518, 0x61c8, 0x60c4,
+	0x9105, 0x11f8, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01d0, 0x6214,
+	0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1560, 0x0010,
+	0xc0d4, 0x200a, 0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016,
+	0x704c, 0x2060, 0x080c, 0x963b, 0x2009, 0x0049, 0x080c, 0xac8c,
+	0x00d0, 0x0036, 0x2019, 0x0001, 0x080c, 0xa118, 0x003e, 0x714c,
+	0x2160, 0x080c, 0xe717, 0x2009, 0x004a, 0x6220, 0x9296, 0x0009,
+	0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009, 0x004a, 0x6003,
+	0x0003, 0x080c, 0xac8c, 0x2001, 0x0387, 0x2003, 0x0200, 0x080c,
+	0xa8b2, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e, 0x0005,
+	0xd1ec, 0x1904, 0x9f12, 0x0804, 0x9f14, 0x0026, 0x00e6, 0x2071,
+	0x19e7, 0x706c, 0xd084, 0x01e8, 0xc084, 0x706e, 0x714c, 0x81ff,
+	0x01c0, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006,
+	0x1138, 0x2009, 0x1984, 0x2011, 0x0012, 0x080c, 0x2a53, 0x0048,
+	0x928e, 0x0009, 0x0db0, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c,
+	0x2a53, 0x00ee, 0x002e, 0x0005, 0x9036, 0x2001, 0x19f1, 0x2004,
+	0x9005, 0x0128, 0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8, 0x9085,
+	0x0001, 0x0005, 0x00f6, 0x2079, 0x19e7, 0x610c, 0x9006, 0x600e,
+	0x6044, 0xc0fc, 0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06, 0x1118,
+	0x7826, 0x782a, 0x0050, 0x792a, 0x0040, 0x00c6, 0x2660, 0x610e,
+	0x00ce, 0x7824, 0x9c06, 0x1108, 0x7e26, 0x080c, 0xa20e, 0x080c,
+	0xca27, 0x00fe, 0x0005, 0x080c, 0x9a9f, 0x7003, 0x1200, 0x7838,
+	0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148,
+	0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be,
+	0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084, 0x00ff, 0x700a,
+	0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x9e02, 0x080c, 0x9a9f,
+	0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff,
+	0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x0156,
+	0x080c, 0x9aea, 0x7003, 0x0200, 0x080c, 0x87bb, 0x20a9, 0x0006,
+	0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002, 0x2305, 0x2072,
+	0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
+	0x1f04, 0xa006, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9e02, 0x0016,
+	0x0026, 0x080c, 0x9ac6, 0x080c, 0x9ad8, 0x9e80, 0x0004, 0x20e9,
+	0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e, 0x7808, 0x9088,
+	0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003, 0x9080, 0x0004,
+	0x8003, 0x60c2, 0x080c, 0x9e02, 0x002e, 0x001e, 0x0005, 0x20a9,
+	0x0010, 0x4003, 0x080c, 0xa67b, 0x20a1, 0x0240, 0x22a8, 0x4003,
+	0x0c68, 0x080c, 0x9a9f, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9e02, 0x0016, 0x0026, 0x080c, 0x9a9f, 0x20e9,
+	0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808,
+	0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x9e02,
+	0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19e7, 0x7010, 0x2060, 0x8cff, 0x0188, 0x080c,
+	0xca4d, 0x1110, 0x080c, 0xb5b5, 0x600c, 0x0006, 0x080c, 0xccc4,
+	0x600f, 0x0000, 0x080c, 0xabed, 0x080c, 0xa20e, 0x00ce, 0x0c68,
+	0x2c00, 0x7012, 0x700e, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005,
+	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
+	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
+	0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7,
+	0x7030, 0x2060, 0x8cff, 0x0548, 0x080c, 0x9e32, 0x6ac0, 0x68c3,
+	0x0000, 0x080c, 0x86f6, 0x00c6, 0x2061, 0x0100, 0x080c, 0xa7cc,
+	0x00ce, 0x20a9, 0x01f4, 0x04b1, 0x080c, 0x95de, 0x6044, 0xd0ac,
+	0x1128, 0x2001, 0x1988, 0x2004, 0x604a, 0x0020, 0x2009, 0x0013,
+	0x080c, 0xac8c, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004,
+	0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x86f6,
+	0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
+	0x68c3, 0x0000, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x20a9, 0x01f4,
+	0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
+	0x9084, 0x4000, 0x190c, 0x2a1a, 0x0090, 0xd084, 0x0118, 0x6827,
+	0x0001, 0x0010, 0x1f04, 0xa0fa, 0x7804, 0x9084, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x0005,
+	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
+	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
+	0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x0380,
+	0x701c, 0x0006, 0x701f, 0x0202, 0x2071, 0x19e7, 0x704c, 0x2060,
+	0x8cff, 0x0904, 0xa1bd, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084,
+	0x0002, 0x0904, 0xa1bd, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009,
+	0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8703,
+	0x080c, 0x1dd8, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e55, 0x2021,
+	0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af,
+	0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090,
+	0x2071, 0x19e7, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816,
+	0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002,
+	0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x0016, 0x2009,
+	0x0040, 0x080c, 0x21b0, 0x001e, 0x2009, 0x0000, 0x080c, 0x0e55,
+	0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004,
+	0x7804, 0x9084, 0x4000, 0x190c, 0x2a1a, 0x0090, 0xd08c, 0x0118,
+	0x6827, 0x0002, 0x0010, 0x1f04, 0xa18b, 0x7804, 0x9084, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
+	0x6827, 0x4000, 0x6824, 0x83ff, 0x1180, 0x2009, 0x0049, 0x6020,
+	0x9086, 0x0009, 0x0150, 0x080c, 0x963b, 0x6044, 0xd0ac, 0x1118,
+	0x6003, 0x0002, 0x0010, 0x080c, 0xac8c, 0x000e, 0x2071, 0x0380,
+	0xd08c, 0x1110, 0x701f, 0x0200, 0x000e, 0x001e, 0x002e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6,
+	0x0126, 0x2091, 0x8000, 0x2069, 0x19e7, 0x6a06, 0x012e, 0x00de,
+	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19e7, 0x6a3e,
+	0x012e, 0x00de, 0x0005, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
+	0x7047, 0x1000, 0x00f8, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
+	0x7047, 0x4000, 0x00b8, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
+	0x7047, 0x2000, 0x0078, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
+	0x7047, 0x0400, 0x0038, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
+	0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9e02, 0x00e6, 0x2071,
+	0x19e7, 0x702c, 0x9005, 0x0110, 0x8001, 0x702e, 0x00ee, 0x0005,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19e7, 0x7620, 0x2660, 0x2678, 0x2039,
+	0x0001, 0x87ff, 0x0904, 0xa2b3, 0x8cff, 0x0904, 0xa2b3, 0x6020,
+	0x9086, 0x0006, 0x1904, 0xa2ae, 0x88ff, 0x0138, 0x2800, 0x9c06,
+	0x1904, 0xa2ae, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06, 0x1904,
+	0xa2ae, 0x85ff, 0x0120, 0x605c, 0x9106, 0x1904, 0xa2ae, 0x7030,
+	0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160, 0x6824,
+	0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x86f6, 0x080c, 0xa338,
+	0x7033, 0x0000, 0x0428, 0x080c, 0x86f6, 0x6820, 0xd0b4, 0x0110,
+	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0xa338,
 	0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
 	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
 	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x7010, 0x9c36, 0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000,
+	0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000,
 	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x080c, 0xca18, 0x1158, 0x080c, 0x3215, 0x080c,
-	0xca29, 0x11f0, 0x080c, 0xb591, 0x00d8, 0x080c, 0xa314, 0x08c0,
-	0x080c, 0xca29, 0x1118, 0x080c, 0xb591, 0x0090, 0x6014, 0x2048,
-	0x080c, 0xc812, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d64, 0x080c, 0xca03,
-	0x080c, 0xcca0, 0x080c, 0xac04, 0x080c, 0xa1ea, 0x00ce, 0x0804,
-	0xa376, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa376, 0x012e, 0x000e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005,
-	0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xe241, 0x0c08, 0x00d6,
-	0x080c, 0x9ab9, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014,
-	0x20e1, 0x0001, 0x2099, 0x1989, 0x20e9, 0x0000, 0x20a1, 0x0250,
-	0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c,
-	0x9dde, 0x00de, 0x0005, 0x080c, 0x9ab9, 0x700b, 0x0800, 0x7814,
-	0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c,
-	0x7026, 0x7860, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7860,
-	0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x9dde, 0x00b6,
-	0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xcea6,
-	0x00de, 0x1904, 0xa4a4, 0x080c, 0x9a6e, 0x7003, 0x1300, 0x782c,
-	0x080c, 0xa5af, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810,
-	0x2058, 0xbaa0, 0x080c, 0xab33, 0x11d8, 0x9286, 0x007e, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180,
-	0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400,
-	0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0,
-	0xb884, 0x700e, 0x00a8, 0x080c, 0xab33, 0x1130, 0x7810, 0x2058,
-	0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181f, 0x2d04,
-	0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e,
-	0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de,
-	0x080c, 0x9dde, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006,
-	0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c,
-	0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0xa522, 0x9186,
-	0x0005, 0x0904, 0xa50a, 0x9186, 0x0004, 0x05f0, 0x9186, 0x0008,
-	0x0904, 0xa513, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700,
-	0x080c, 0xa58c, 0x0005, 0x080c, 0xa54d, 0x00d6, 0x0026, 0x792c,
-	0x2168, 0x2009, 0x4000, 0x6800, 0x6a44, 0xd2fc, 0x11f8, 0x0002,
-	0xa4eb, 0xa4f6, 0xa4ed, 0xa4f6, 0xa4f2, 0xa4eb, 0xa4eb, 0xa4f6,
-	0xa4f6, 0xa4f6, 0xa4f6, 0xa4eb, 0xa4eb, 0xa4eb, 0xa4eb, 0xa4eb,
-	0xa4f6, 0xa4eb, 0xa4f6, 0x080c, 0x0d7d, 0x6824, 0xd0e4, 0x0110,
-	0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022,
-	0x6830, 0x7026, 0x0804, 0xa546, 0x080c, 0xa54d, 0x00d6, 0x0026,
-	0x792c, 0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108,
-	0x900e, 0x04e0, 0x080c, 0xa54d, 0x00d6, 0x0026, 0x792c, 0x2168,
-	0x2009, 0x4000, 0x0498, 0x04c9, 0x00d6, 0x0026, 0x792c, 0x2168,
-	0x2009, 0x4000, 0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108,
-	0x900e, 0x0420, 0x0451, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814,
-	0x0096, 0x2048, 0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e,
-	0x9103, 0x7022, 0x7226, 0x792c, 0x9180, 0x0011, 0x2004, 0xd0fc,
-	0x1148, 0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e,
-	0x0004, 0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3,
-	0x0018, 0x002e, 0x00de, 0x0804, 0x9dde, 0x00b6, 0x0036, 0x0046,
-	0x0056, 0x0066, 0x080c, 0x9ab9, 0x9006, 0x7003, 0x0200, 0x7938,
-	0x710a, 0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0xab33,
-	0x1118, 0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181f, 0x2d2c,
-	0x8d68, 0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de,
-	0x0028, 0x901e, 0xbc84, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080,
-	0x0008, 0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a,
-	0x741e, 0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e,
-	0x004e, 0x003e, 0x00be, 0x0005, 0x080c, 0x9ab9, 0x7003, 0x0100,
-	0x782c, 0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804,
-	0x9dde, 0x080c, 0x9a65, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079,
-	0x783c, 0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084,
-	0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0x9dde, 0x00e6,
-	0x2071, 0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058,
-	0xb8d4, 0xd084, 0x0120, 0x7850, 0x702a, 0x784c, 0x702e, 0x00be,
-	0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c, 0x9ab0, 0x7003, 0x0100,
-	0x782c, 0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9dde,
-	0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026,
-	0x080c, 0x2979, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
-	0x002e, 0x080c, 0x9e01, 0x080c, 0x86bc, 0x0005, 0x0036, 0x0096,
-	0x00d6, 0x00e6, 0x7860, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294,
-	0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194,
-	0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384,
-	0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6,
-	0x2069, 0x0200, 0x080c, 0xa66c, 0x00de, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
-	0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286,
-	0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e,
-	0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0,
-	0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180,
-	0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140,
-	0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x19b2, 0x210c,
-	0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036,
-	0x0026, 0x2110, 0x900e, 0x080c, 0x2a53, 0x002e, 0x0005, 0x2009,
-	0x0009, 0x00a0, 0x2009, 0x000a, 0x0088, 0x2009, 0x000b, 0x0070,
-	0x2009, 0x000c, 0x0058, 0x2009, 0x000d, 0x0040, 0x2009, 0x000e,
-	0x0028, 0x2009, 0x000f, 0x0010, 0x2009, 0x0008, 0x6912, 0x0005,
-	0x080c, 0x9a6e, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048,
-	0x7013, 0x0138, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1138,
-	0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x1904, 0xa711, 0x7003,
-	0x5400, 0x00c6, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0xa998,
-	0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0x6080, 0x700e, 0xa998,
-	0x918c, 0xff00, 0x7112, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2e10,
-	0x9290, 0x0006, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa6a2,
-	0x20a9, 0x0004, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210,
-	0x1f04, 0xa6ac, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098,
-	0x2009, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
-	0x8109, 0x1dc0, 0x00d6, 0x2069, 0x0200, 0x080c, 0xa657, 0x00de,
-	0x2071, 0x0240, 0x2011, 0x0240, 0x2009, 0x0002, 0x20a9, 0x0001,
-	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x2009, 0x0008,
-	0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0,
-	0xa85c, 0x9080, 0x0031, 0x2098, 0x2009, 0x0008, 0x20a9, 0x0001,
-	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00ce, 0x60c3,
-	0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x2001, 0x1837, 0x2004,
-	0x9084, 0x0028, 0x1168, 0x080c, 0x74d5, 0x0150, 0x6028, 0xc0bd,
-	0x602a, 0x2009, 0x1804, 0x2011, 0x0029, 0x080c, 0x2a53, 0x0010,
-	0x080c, 0x9dde, 0x080c, 0x86bc, 0x00de, 0x009e, 0x002e, 0x001e,
-	0x0005, 0x00e6, 0x2071, 0x0240, 0x2001, 0x2200, 0x9085, 0x00ff,
-	0x7002, 0x7007, 0xffff, 0x2071, 0x0100, 0x709b, 0x00ff, 0x00ee,
-	0x0804, 0xa687, 0x080c, 0x9a6e, 0x0016, 0x0026, 0x0096, 0x00d6,
-	0x7814, 0x2048, 0x7013, 0x0138, 0x7003, 0x5500, 0x00c6, 0xa89c,
-	0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105, 0x700a,
-	0xa99c, 0x918c, 0xff00, 0xa8a0, 0x9084, 0x00ff, 0x9105, 0x700e,
-	0xa998, 0x918c, 0xff00, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff,
-	0x910d, 0x7112, 0x6180, 0x7116, 0x2009, 0x0008, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x0029, 0x2098, 0x2e10, 0x9290, 0x0006, 0x20a9,
-	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x20a9,
-	0x0004, 0x2009, 0x1805, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
-	0xa763, 0x20a9, 0x0002, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108,
-	0x8210, 0x1f04, 0xa76d, 0x00d6, 0x0016, 0x2069, 0x0200, 0x080c,
-	0xa657, 0x001e, 0x00de, 0x2071, 0x0240, 0x20a9, 0x0002, 0x2009,
-	0x1803, 0x2011, 0x0240, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
-	0xa783, 0x2009, 0x0008, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
-	0x1dd0, 0x9006, 0x20a9, 0x0008, 0x2012, 0x8210, 0x1f04, 0xa794,
-	0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c,
-	0x9dde, 0x080c, 0x86bc, 0x00de, 0x009e, 0x002e, 0x001e, 0x0005,
-	0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9, 0x0000, 0x2069, 0x0200,
-	0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020,
-	0x9292, 0x0020, 0x0008, 0x9016, 0x20a1, 0x0240, 0x9006, 0x4004,
-	0x82ff, 0x0120, 0x6810, 0x8000, 0x6812, 0x0c60, 0x00de, 0x0005,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19e7, 0x7610, 0x2660, 0x2678, 0x8cff,
-	0x0904, 0xa84f, 0x7030, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0,
-	0x9005, 0x0904, 0xa826, 0x080c, 0x9e0e, 0x68c3, 0x0000, 0x080c,
-	0xa314, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
-	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c,
-	0x2a0a, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x7010, 0x9c36, 0x1110, 0x660c, 0x7612, 0x700c, 0x9c36,
-	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010, 0x700f,
-	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
-	0x2678, 0x600f, 0x0000, 0x080c, 0xca18, 0x1158, 0x080c, 0x3215,
-	0x080c, 0xca29, 0x11f0, 0x080c, 0xb591, 0x00d8, 0x080c, 0xa314,
-	0x08c0, 0x080c, 0xca29, 0x1118, 0x080c, 0xb591, 0x0090, 0x6014,
-	0x2048, 0x080c, 0xc812, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520,
-	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d70, 0x080c,
-	0xca03, 0x080c, 0xcca0, 0x080c, 0xac04, 0x080c, 0xa1ea, 0x00ce,
-	0x0804, 0xa7d7, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa7d7, 0x7013,
-	0x0000, 0x700f, 0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08,
-	0x080c, 0xe241, 0x08f0, 0x00f6, 0x0036, 0x2079, 0x0380, 0x7b18,
-	0xd3bc, 0x1de8, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x003e,
-	0x00fe, 0x0005, 0x0016, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007,
-	0x9086, 0x0001, 0x1188, 0x2001, 0x0015, 0x0c29, 0x2009, 0x1000,
-	0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0120,
-	0x8109, 0x1db0, 0x080c, 0x0d7d, 0x001e, 0x0005, 0x2001, 0x0382,
-	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x1120, 0x2001, 0x0380,
-	0x2003, 0x0001, 0x0005, 0x0156, 0x0016, 0x0026, 0x00e6, 0x900e,
-	0x2071, 0x19e7, 0x0469, 0x0106, 0x0190, 0x7004, 0x9086, 0x0003,
-	0x0148, 0x20a9, 0x1000, 0x6044, 0xd0fc, 0x01d8, 0x1f04, 0xa8ab,
-	0x080c, 0x0d7d, 0x080c, 0xa872, 0x6044, 0xd0fc, 0x0190, 0x7030,
-	0x9c06, 0x1148, 0x080c, 0x95ad, 0x6044, 0xd0dc, 0x0150, 0xc0dc,
-	0x6046, 0x700a, 0x7042, 0x704c, 0x9c06, 0x190c, 0x0d7d, 0x080c,
-	0x960a, 0x010e, 0x1919, 0x00ee, 0x002e, 0x001e, 0x015e, 0x0005,
-	0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0005,
-	0x0126, 0x2091, 0x2400, 0x7808, 0xd0a4, 0x190c, 0x0d76, 0xd09c,
-	0x0128, 0x7820, 0x908c, 0xf000, 0x11b8, 0x0012, 0x012e, 0x0005,
-	0xa8f8, 0xa936, 0xa95d, 0xa994, 0xa9a4, 0xa9b5, 0xa9c4, 0xa9d2,
-	0xa9ff, 0xaa03, 0xa8f8, 0xa8f8, 0xa8f8, 0xa8f8, 0xa8f8, 0xa8f8,
-	0x080c, 0x0d7d, 0x012e, 0x0005, 0x2060, 0x6044, 0xd0bc, 0x0140,
-	0xc0bc, 0x6046, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0012,
-	0x012e, 0x0005, 0xa91d, 0xa91f, 0xa91d, 0xa925, 0xa91d, 0xa91d,
-	0xa91d, 0xa91d, 0xa91d, 0xa91f, 0xa91d, 0xa91f, 0xa91d, 0xa91f,
-	0xa91d, 0xa91d, 0xa91d, 0xa91f, 0xa91d, 0x080c, 0x0d7d, 0x2009,
-	0x0013, 0x080c, 0xac68, 0x012e, 0x0005, 0x6014, 0x2048, 0xa87c,
-	0xd0dc, 0x0130, 0x080c, 0x8890, 0x080c, 0xabc9, 0x012e, 0x0005,
-	0x2009, 0x0049, 0x080c, 0xac68, 0x012e, 0x0005, 0x080c, 0xa872,
-	0x2001, 0x1a0c, 0x2003, 0x0000, 0x7030, 0x9065, 0x090c, 0x0d7d,
-	0x7034, 0x9092, 0x00c8, 0x1258, 0x8000, 0x7036, 0x7004, 0x9086,
-	0x0003, 0x0110, 0x7007, 0x0000, 0x781f, 0x0808, 0x0040, 0x080c,
-	0xe6ec, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0xac68, 0x781f,
-	0x0100, 0x080c, 0xa88e, 0x012e, 0x0005, 0x080c, 0xa872, 0x714c,
-	0x81ff, 0x1128, 0x2011, 0x1a0f, 0x2013, 0x0000, 0x0438, 0x2061,
-	0x0100, 0x7150, 0x9192, 0x7530, 0x12f0, 0x8108, 0x7152, 0x714c,
-	0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138, 0x6014, 0x9084,
-	0x1984, 0x9085, 0x0012, 0x6016, 0x0088, 0x714c, 0x9188, 0x0008,
-	0x210c, 0x918e, 0x0009, 0x0d90, 0x6014, 0x9084, 0x1984, 0x9085,
-	0x0016, 0x6016, 0x0018, 0x706c, 0xc085, 0x706e, 0x781f, 0x0200,
-	0x080c, 0xa88e, 0x012e, 0x0005, 0x080c, 0xa872, 0x714c, 0x2160,
-	0x6003, 0x0003, 0x2009, 0x004a, 0x080c, 0xac68, 0x781f, 0x0200,
-	0x080c, 0xa88e, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820,
-	0x2060, 0x6003, 0x0003, 0x080c, 0xa872, 0x080c, 0x1d60, 0x781f,
-	0x0400, 0x080c, 0xa88e, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8,
-	0x7820, 0x2060, 0x080c, 0xa872, 0x080c, 0x1da8, 0x781f, 0x0400,
-	0x080c, 0xa88e, 0x012e, 0x0005, 0x7030, 0x9065, 0x0148, 0x6044,
-	0xc0bc, 0x6046, 0x7104, 0x9186, 0x0003, 0x0110, 0x080c, 0x9670,
-	0x012e, 0x0005, 0x00f6, 0x703c, 0x9086, 0x0002, 0x0528, 0x704c,
-	0x907d, 0x0510, 0x7844, 0xc0bc, 0x7846, 0x7820, 0x9086, 0x0009,
-	0x0118, 0x080c, 0x9d29, 0x00c0, 0x7828, 0xd0fc, 0x1118, 0x080c,
-	0x9ca8, 0x0090, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1130,
-	0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x1120, 0x2001, 0x0387,
-	0x2003, 0x1000, 0x080c, 0x9c2d, 0x00fe, 0x012e, 0x0005, 0x080c,
-	0x7576, 0x012e, 0x0005, 0x080c, 0x0d7d, 0x0005, 0x00e6, 0x2071,
-	0x19e7, 0x6044, 0xc0bc, 0x6046, 0xd0fc, 0x01b8, 0x704c, 0x9c06,
-	0x1190, 0x2019, 0x0001, 0x080c, 0xa0f4, 0x704f, 0x0000, 0x2001,
-	0x0109, 0x2004, 0xd08c, 0x1138, 0x2001, 0x0108, 0x2004, 0xd0bc,
-	0x1110, 0x703f, 0x0000, 0x080c, 0xa32a, 0x00ee, 0x0005, 0x0026,
-	0x7010, 0x9c06, 0x1178, 0x080c, 0xa1ea, 0x6044, 0xc0fc, 0x6046,
-	0x600c, 0x9015, 0x0120, 0x7212, 0x600f, 0x0000, 0x0010, 0x7212,
-	0x720e, 0x9006, 0x002e, 0x0005, 0x0026, 0x7020, 0x9c06, 0x1178,
-	0x080c, 0xa1ea, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120,
-	0x7222, 0x600f, 0x0000, 0x0010, 0x7222, 0x721e, 0x9006, 0x002e,
-	0x0005, 0x00d6, 0x0036, 0x7830, 0x9c06, 0x1558, 0x2069, 0x0100,
-	0x68c0, 0x9005, 0x01f8, 0x080c, 0x86c5, 0x080c, 0x9e0e, 0x68c3,
-	0x0000, 0x080c, 0xa314, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x9085,
-	0x0001, 0x0038, 0x7808, 0xc0ad, 0x780a, 0x6003, 0x0009, 0x630a,
-	0x9006, 0x003e, 0x00de, 0x0005, 0x0016, 0x0026, 0x0036, 0x6100,
-	0x2019, 0x0100, 0x2001, 0x0382, 0x2004, 0xd09c, 0x0190, 0x00c6,
-	0x0126, 0x2091, 0x2800, 0x0016, 0x0036, 0x080c, 0xa8d8, 0x003e,
-	0x001e, 0x012e, 0x00ce, 0x6200, 0x2200, 0x9106, 0x0d58, 0x2200,
-	0x0010, 0x8319, 0x1d38, 0x003e, 0x002e, 0x001e, 0x0005, 0x00d6,
-	0x0156, 0x080c, 0x9ab9, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100,
-	0x700b, 0x0003, 0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007,
-	0x0000, 0x2069, 0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110,
-	0xc38d, 0x0060, 0x080c, 0x74d5, 0x1110, 0xc3ad, 0x0008, 0xc3a5,
-	0x6adc, 0xd29c, 0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x080c,
-	0x878a, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071,
-	0x0250, 0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398,
-	0x0002, 0x9290, 0x0002, 0x1f04, 0xaad9, 0x60c3, 0x0020, 0x080c,
-	0x9dde, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x9ab9, 0x7a14,
-	0x82ff, 0x0168, 0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238,
-	0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003,
-	0x0200, 0x7007, 0x001c, 0x700f, 0x0001, 0x2011, 0x19bd, 0x2204,
-	0x8007, 0x701a, 0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120,
-	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7022,
-	0x2001, 0x1820, 0x2004, 0x7026, 0x0030, 0x2001, 0x1818, 0x2004,
-	0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
-	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c,
-	0x015e, 0x0804, 0x9dde, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac,
-	0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0xa1ab, 0x2011, 0x0002,
-	0x080c, 0xa1b5, 0x080c, 0xa074, 0x0036, 0x901e, 0x080c, 0xa0f4,
-	0x003e, 0x0005, 0x080c, 0x3366, 0x0188, 0x0016, 0x00b6, 0x00c6,
-	0x7010, 0x9085, 0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x661e,
-	0xb85c, 0xc0ac, 0xb85e, 0x00ce, 0x00be, 0x001e, 0x0005, 0x2071,
-	0x188d, 0x7000, 0x9005, 0x0140, 0x2001, 0x0812, 0x2071, 0x1800,
-	0x7076, 0x707a, 0x706b, 0xffd4, 0x2071, 0x1800, 0x7074, 0x7056,
-	0x705b, 0x1ddc, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091,
-	0x8000, 0x7554, 0x9582, 0x0010, 0x0608, 0x7058, 0x2060, 0x6000,
-	0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208,
-	0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556,
-	0x9ca8, 0x001c, 0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001,
-	0x012e, 0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0,
-	0x00e6, 0x2071, 0x1800, 0x7554, 0x9582, 0x0010, 0x0600, 0x7058,
-	0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068,
-	0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008,
-	0x8529, 0x7556, 0x9ca8, 0x001c, 0x7068, 0x9502, 0x1228, 0x755a,
-	0x9085, 0x0001, 0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc8, 0x9006,
-	0x0cc8, 0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004,
-	0x9c02, 0x1a0c, 0x0d7d, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016,
-	0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x605e,
-	0x6062, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e,
-	0x604a, 0x602a, 0x6046, 0x6042, 0x2061, 0x1800, 0x6054, 0x8000,
-	0x6056, 0x0005, 0x9006, 0x600e, 0x6016, 0x601a, 0x6012, 0x6022,
-	0x6002, 0x601e, 0x605e, 0x6062, 0x604a, 0x6046, 0x2061, 0x1800,
-	0x6054, 0x8000, 0x6056, 0x0005, 0x0006, 0x6000, 0x9086, 0x0000,
-	0x01d0, 0x601c, 0xd084, 0x190c, 0x1a6a, 0x6023, 0x0007, 0x2001,
-	0x1986, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
-	0x601a, 0x080c, 0xe4f9, 0x604b, 0x0000, 0x6044, 0xd0fc, 0x1129,
-	0x9006, 0x6046, 0x6016, 0x000e, 0x0005, 0x080c, 0xa8d0, 0x0106,
-	0x190c, 0xa872, 0x2001, 0x19fa, 0x2004, 0x9c06, 0x1130, 0x0036,
-	0x2019, 0x0001, 0x080c, 0xa0f4, 0x003e, 0x080c, 0xa32a, 0x010e,
-	0x190c, 0xa88e, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091,
-	0x8000, 0x7554, 0x9582, 0x0001, 0x0608, 0x7058, 0x2060, 0x6000,
-	0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208,
-	0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556,
-	0x9ca8, 0x001c, 0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001,
-	0x012e, 0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0,
-	0x6020, 0x9084, 0x000f, 0x0002, 0xac7c, 0xac86, 0xaca1, 0xacbc,
-	0xcf78, 0xcf95, 0xcfb0, 0xac7c, 0xac86, 0x8f69, 0xacd8, 0xac7c,
-	0xac7c, 0xac7c, 0xac7c, 0xac7c, 0x9186, 0x0013, 0x1130, 0x6044,
-	0xd0fc, 0x0110, 0x080c, 0x95ad, 0x0005, 0x0005, 0x0066, 0x6000,
-	0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xac9f,
-	0xb3fd, 0xb5d8, 0xac9f, 0xb66e, 0xafa1, 0xac9f, 0xac9f, 0xb37f,
-	0xbbd6, 0xac9f, 0xac9f, 0xac9f, 0xac9f, 0xac9f, 0xac9f, 0x080c,
-	0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013,
-	0x006e, 0x0005, 0xacba, 0xc1e1, 0xacba, 0xacba, 0xacba, 0xacba,
-	0xacba, 0xacba, 0xc186, 0xc364, 0xacba, 0xc21e, 0xc2a2, 0xc21e,
-	0xc2a2, 0xacba, 0x080c, 0x0d7d, 0x6000, 0x9082, 0x0016, 0x1a0c,
-	0x0d7d, 0x6000, 0x0002, 0xacd6, 0xbc20, 0xbcb7, 0xbe37, 0xbea6,
-	0xacd6, 0xacd6, 0xacd6, 0xbbef, 0xc107, 0xc10a, 0xacd6, 0xacd6,
-	0xacd6, 0xacd6, 0xc13a, 0xacd6, 0xacd6, 0xacd6, 0x080c, 0x0d7d,
-	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e,
-	0x0005, 0xacf1, 0xacf1, 0xad2f, 0xadce, 0xae4e, 0xacf1, 0xacf1,
-	0xacf1, 0xacf3, 0xacf1, 0xacf1, 0xacf1, 0xacf1, 0xacf1, 0xacf1,
-	0xacf1, 0x080c, 0x0d7d, 0x9186, 0x004c, 0x0560, 0x9186, 0x0003,
-	0x190c, 0x0d7d, 0x0096, 0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003,
-	0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e,
-	0xa8ac, 0xa836, 0xa8b0, 0xa83a, 0x9006, 0xa846, 0xa84a, 0xa884,
-	0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213,
-	0x9210, 0x621a, 0x009e, 0x080c, 0x1bba, 0x2009, 0x8030, 0x080c,
-	0x9234, 0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00,
-	0x080c, 0xae70, 0x080c, 0xcf46, 0x6003, 0x0007, 0x0005, 0x00d6,
-	0x0096, 0x00f6, 0x2079, 0x1800, 0x7a90, 0x6014, 0x2048, 0xa87c,
-	0xd0ec, 0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0,
-	0x9005, 0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007,
-	0x2010, 0x0028, 0xa87b, 0x0015, 0x0010, 0xa87b, 0x0000, 0x8214,
-	0xa883, 0x0000, 0xaa02, 0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086,
-	0x0015, 0x1118, 0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016,
-	0x0118, 0x2001, 0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405,
-	0x0002, 0xad96, 0xad96, 0xad91, 0xad94, 0xad96, 0xad8e, 0xad81,
-	0xad81, 0xad81, 0xad81, 0xad81, 0xad81, 0xad81, 0xad81, 0xad81,
-	0xad81, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e,
-	0x004e, 0x00fe, 0x009e, 0x00de, 0x080c, 0x0d7d, 0x080c, 0xb82b,
-	0x0028, 0x080c, 0xb910, 0x0010, 0x080c, 0xba06, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c,
-	0xaf2e, 0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae,
-	0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x0002, 0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041,
-	0x1298, 0x080c, 0xb0ee, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe,
-	0x009e, 0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0xabc9,
-	0x2001, 0x002c, 0x900e, 0x080c, 0xaf94, 0x0c70, 0x91b6, 0x0015,
-	0x0170, 0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0d7d,
-	0x91b2, 0x0050, 0x1a0c, 0x0d7d, 0x9182, 0x0047, 0x0042, 0x080c,
-	0xaa84, 0x0120, 0x9086, 0x0002, 0x0904, 0xad2f, 0x0005, 0xadf0,
-	0xadf0, 0xadf2, 0xae24, 0xadf0, 0xadf0, 0xadf0, 0xadf0, 0xae37,
-	0x080c, 0x0d7d, 0x00d6, 0x0016, 0x0096, 0x6003, 0x0004, 0x6114,
-	0x2148, 0xa87c, 0xd0fc, 0x01c0, 0xa878, 0xc0fc, 0x9005, 0x1158,
-	0xa894, 0x9005, 0x0140, 0x2001, 0x0000, 0x900e, 0x080c, 0xaf94,
-	0x080c, 0xabc9, 0x00a8, 0x6003, 0x0002, 0xa8a4, 0xa9a8, 0x9105,
-	0x1178, 0xa8ae, 0xa8b2, 0x0c78, 0xa87f, 0x0020, 0xa88c, 0xa88a,
-	0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2, 0xa8c7, 0x0000, 0xa8cb, 0x0000,
-	0x009e, 0x001e, 0x00de, 0x0005, 0x080c, 0x960a, 0x00d6, 0x0096,
-	0x6114, 0x2148, 0x080c, 0xc814, 0x0120, 0xa87b, 0x0006, 0x080c,
-	0x6d70, 0x009e, 0x00de, 0x080c, 0xabc9, 0x0804, 0x966f, 0x080c,
-	0x960a, 0x080c, 0x31e4, 0x080c, 0xcf43, 0x00d6, 0x0096, 0x6114,
-	0x2148, 0x080c, 0xc814, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6d70,
-	0x009e, 0x00de, 0x080c, 0xabc9, 0x0804, 0x966f, 0x9182, 0x0047,
-	0x0002, 0xae5e, 0xae60, 0xae5e, 0xae5e, 0xae5e, 0xae5e, 0xae5e,
-	0xae5e, 0xae5e, 0xae5e, 0xae5e, 0xae5e, 0xae60, 0x080c, 0x0d7d,
-	0x00d6, 0x0096, 0x601f, 0x0000, 0x6114, 0x2148, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0x080c, 0x6d70, 0x009e, 0x00de, 0x0804, 0xabc9,
-	0x0026, 0x0036, 0x0056, 0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006,
-	0x080c, 0x103a, 0x000e, 0x090c, 0x0d7d, 0xa960, 0x21e8, 0xa95c,
-	0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a,
-	0x2079, 0x1800, 0x7990, 0x9188, 0x0018, 0x918c, 0x0fff, 0xa972,
-	0xac76, 0x2950, 0x00a6, 0x2001, 0x0205, 0x2003, 0x0000, 0x901e,
-	0x2029, 0x0001, 0x9182, 0x0034, 0x1228, 0x2011, 0x001f, 0x080c,
-	0xc3e7, 0x04c0, 0x2130, 0x2009, 0x0034, 0x2011, 0x001f, 0x080c,
-	0xc3e7, 0x96b2, 0x0034, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fec,
-	0x080c, 0x103a, 0x01d0, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000,
-	0x2920, 0xb406, 0x968a, 0x003d, 0x1230, 0x2608, 0x2011, 0x001b,
-	0x080c, 0xc3e7, 0x00b8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950,
-	0x2011, 0x001b, 0x080c, 0xc3e7, 0x0c18, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0xb070, 0xc0fd,
-	0xb072, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
-	0x95ad, 0x0050, 0xb566, 0x2a48, 0xa804, 0xa807, 0x0000, 0x0006,
-	0x080c, 0x6d70, 0x000e, 0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae,
-	0x009e, 0x006e, 0x005e, 0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6,
-	0x0096, 0x0006, 0x080c, 0x103a, 0x000e, 0x090c, 0x0d7d, 0xa960,
-	0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020,
-	0x4104, 0xaa66, 0xa87a, 0x2079, 0x1800, 0x7990, 0x810c, 0x9188,
-	0x000c, 0x9182, 0x001a, 0x0210, 0x2009, 0x001a, 0x21a8, 0x810b,
-	0xa972, 0xac76, 0x2e98, 0xa85c, 0x9080, 0x001f, 0x20a0, 0x2001,
-	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x4003, 0x2003, 0x0000,
-	0x080c, 0x6d70, 0x009e, 0x00fe, 0x00de, 0x0005, 0x0016, 0x00d6,
-	0x00f6, 0x0096, 0x0016, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
-	0x2102, 0x001e, 0x2079, 0x0200, 0x2e98, 0xa87c, 0xd0ec, 0x0118,
-	0x9e80, 0x000c, 0x2098, 0x2021, 0x003e, 0x901e, 0x9282, 0x0020,
-	0x0218, 0x2011, 0x0020, 0x2018, 0x9486, 0x003e, 0x1170, 0x0096,
-	0x080c, 0x103a, 0x2900, 0x009e, 0x05c0, 0xa806, 0x2048, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x3300, 0x908e, 0x0260,
-	0x0140, 0x2009, 0x0280, 0x9102, 0x920a, 0x0218, 0x2010, 0x2100,
-	0x9318, 0x2200, 0x9402, 0x1228, 0x2400, 0x9202, 0x2410, 0x9318,
-	0x9006, 0x2020, 0x22a8, 0xa800, 0x9200, 0xa802, 0x20e1, 0x0000,
-	0x4003, 0x83ff, 0x0180, 0x3300, 0x9086, 0x0280, 0x1130, 0x7814,
-	0x8000, 0x9085, 0x0080, 0x7816, 0x2e98, 0x2310, 0x84ff, 0x0904,
-	0xaf43, 0x0804, 0xaf45, 0x9085, 0x0001, 0x7817, 0x0000, 0x009e,
-	0x00fe, 0x00de, 0x001e, 0x0005, 0x00d6, 0x0036, 0x0096, 0x6314,
-	0x2348, 0xa87a, 0xa982, 0x080c, 0x6d64, 0x009e, 0x003e, 0x00de,
-	0x0005, 0x91b6, 0x0015, 0x1118, 0x080c, 0xabc9, 0x0030, 0x91b6,
-	0x0016, 0x190c, 0x0d7d, 0x080c, 0xabc9, 0x0005, 0x20a9, 0x000e,
-	0x20e1, 0x0000, 0x2e98, 0x6014, 0x0096, 0x2048, 0xa860, 0x20e8,
-	0xa85c, 0x20a0, 0x009e, 0x4003, 0x0136, 0x9080, 0x001b, 0x2011,
-	0x0006, 0x20a9, 0x0001, 0x3418, 0x8318, 0x23a0, 0x4003, 0x3318,
-	0x8318, 0x2398, 0x8211, 0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0,
-	0x3318, 0x8318, 0x2398, 0x4003, 0x3418, 0x8318, 0x23a0, 0x8211,
-	0x1db8, 0x0096, 0x080c, 0xc814, 0x0130, 0x6014, 0x2048, 0xa807,
-	0x0000, 0xa867, 0x0103, 0x009e, 0x0804, 0xabc9, 0x0096, 0x00d6,
-	0x0036, 0x7330, 0x9386, 0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058,
-	0xb8d7, 0x0000, 0x00be, 0x6014, 0x9005, 0x0130, 0x2048, 0xa807,
-	0x0000, 0xa867, 0x0103, 0xab32, 0x080c, 0xabc9, 0x003e, 0x00de,
-	0x009e, 0x0005, 0x0011, 0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c,
-	0xcf2e, 0x0188, 0x6014, 0x9005, 0x1170, 0x600b, 0x0003, 0x601b,
-	0x0000, 0x604b, 0x0000, 0x2009, 0x0022, 0x080c, 0xb3d5, 0x9006,
-	0x001e, 0x000e, 0x0005, 0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016,
-	0x20a9, 0x0014, 0x9e80, 0x000c, 0x20e1, 0x0000, 0x2098, 0x6014,
+	0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096, 0x2048, 0x080c,
+	0xc836, 0x0110, 0x080c, 0xe26c, 0x009e, 0x080c, 0xac28, 0x080c,
+	0xa20e, 0x88ff, 0x1190, 0x00ce, 0x0804, 0xa229, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0xa229, 0x9006, 0x012e, 0x000e, 0x006e, 0x007e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce,
+	0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6, 0x0096, 0x00c6,
+	0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
+	0x7648, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa327, 0x6020, 0x9086,
+	0x0006, 0x1904, 0xa322, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904,
+	0xa322, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118, 0x605c,
+	0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001,
+	0x080c, 0xa118, 0x703f, 0x0000, 0x9006, 0x704e, 0x706a, 0x7052,
+	0x706e, 0x003e, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
+	0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xc836,
+	0x0110, 0x080c, 0xe26c, 0x080c, 0xac28, 0x87ff, 0x1198, 0x00ce,
+	0x0804, 0xa2d3, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa2d3, 0x9006,
+	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80,
+	0x00e6, 0x2071, 0x19e7, 0x7033, 0x0000, 0x7004, 0x9086, 0x0003,
+	0x0158, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007,
+	0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19e7, 0x2c10, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200,
+	0x9c06, 0x11e0, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
+	0x7047, 0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
+	0x2678, 0x600f, 0x0000, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c,
+	0x2060, 0x08d8, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee,
+	0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x7610,
+	0x2660, 0x2678, 0x8cff, 0x0904, 0xa41a, 0x6010, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x9206, 0x1904, 0xa415, 0x7030, 0x9c06, 0x1520,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xa3f1, 0x080c, 0x9e32,
+	0x68c3, 0x0000, 0x080c, 0xa338, 0x7033, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110, 0x660c,
+	0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xca3c,
+	0x1158, 0x080c, 0x321c, 0x080c, 0xca4d, 0x11f0, 0x080c, 0xb5b5,
+	0x00d8, 0x080c, 0xa338, 0x08c0, 0x080c, 0xca4d, 0x1118, 0x080c,
+	0xb5b5, 0x0090, 0x6014, 0x2048, 0x080c, 0xc836, 0x0168, 0x6020,
+	0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6d74, 0x080c, 0xca27, 0x080c, 0xccc4, 0x080c, 0xac28,
+	0x080c, 0xa20e, 0x00ce, 0x0804, 0xa39a, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0xa39a, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20,
+	0x080c, 0xe26c, 0x0c08, 0x00d6, 0x080c, 0x9aea, 0x7003, 0x0200,
+	0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1989,
+	0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023,
+	0x0004, 0x7027, 0x7878, 0x080c, 0x9e02, 0x00de, 0x0005, 0x080c,
+	0x9aea, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814,
+	0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7860, 0x9084, 0x00ff,
+	0x9085, 0x0200, 0x7002, 0x7860, 0x9084, 0xff00, 0x8007, 0x7006,
+	0x60c2, 0x0804, 0x9e02, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68,
+	0x2009, 0x0035, 0x080c, 0xceca, 0x00de, 0x1904, 0xa4c8, 0x080c,
+	0x9a9f, 0x7003, 0x1300, 0x782c, 0x080c, 0xa5d3, 0x2068, 0x6820,
+	0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0xab57,
+	0x11d8, 0x9286, 0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe,
+	0x0498, 0x9286, 0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd,
+	0x0458, 0x9284, 0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b,
+	0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810,
+	0x700a, 0xb814, 0x700e, 0x00c0, 0xb884, 0x700e, 0x00a8, 0x080c,
+	0xab57, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250,
+	0x00d6, 0x2069, 0x181f, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e,
+	0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016,
+	0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x9e02, 0x00be, 0x0005,
+	0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005,
+	0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186,
+	0x0003, 0x0904, 0xa546, 0x9186, 0x0005, 0x0904, 0xa52e, 0x9186,
+	0x0004, 0x05f0, 0x9186, 0x0008, 0x0904, 0xa537, 0x7807, 0x0037,
+	0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0xa5b0, 0x0005, 0x080c,
+	0xa571, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800,
+	0x6a44, 0xd2fc, 0x11f8, 0x0002, 0xa50f, 0xa51a, 0xa511, 0xa51a,
+	0xa516, 0xa50f, 0xa50f, 0xa51a, 0xa51a, 0xa51a, 0xa51a, 0xa50f,
+	0xa50f, 0xa50f, 0xa50f, 0xa50f, 0xa51a, 0xa50f, 0xa51a, 0x080c,
+	0x0d7d, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010,
+	0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0xa56a,
+	0x080c, 0xa571, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04e0, 0x080c, 0xa571,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0498, 0x04c9,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
+	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x0420, 0x0451, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
+	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
+	0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180, 0x0000, 0x2004,
+	0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000,
+	0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804,
+	0x9e02, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x9aea,
+	0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810,
+	0x2058, 0xb8a0, 0x080c, 0xab57, 0x1118, 0x9092, 0x007e, 0x0268,
+	0x00d6, 0x2069, 0x181f, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000,
+	0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e, 0xbc84, 0x2029,
+	0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004, 0x9086, 0x0003,
+	0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020, 0x7312, 0x7416,
+	0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e, 0x00be, 0x0005,
+	0x080c, 0x9aea, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x080c, 0x9a96, 0x7003,
+	0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012,
+	0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3,
+	0x0010, 0x0804, 0x9e02, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6,
+	0x2078, 0x7810, 0x00b6, 0x2058, 0xb8d4, 0xd084, 0x0120, 0x7850,
+	0x702a, 0x784c, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005,
+	0x080c, 0x9ae1, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x9e02, 0x00a9, 0x7914, 0x712a, 0x60c3,
+	0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x2979, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x9e25, 0x080c,
+	0x86ed, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7860, 0x2048,
+	0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294,
+	0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff,
+	0x908d, 0xc200, 0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870,
+	0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0xa690,
+	0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035,
+	0xaa68, 0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037,
+	0x00ee, 0x00de, 0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096,
+	0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001,
+	0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4,
+	0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5,
+	0x2102, 0x2009, 0x19b2, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010,
+	0x2009, 0x0096, 0x60ab, 0x0036, 0x0026, 0x2110, 0x900e, 0x080c,
+	0x2a53, 0x002e, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a,
+	0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009,
+	0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010,
+	0x2009, 0x0008, 0x6912, 0x0005, 0x080c, 0x9a9f, 0x0016, 0x0026,
+	0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x2001, 0x1837,
+	0x2004, 0x9084, 0x0028, 0x1138, 0x2001, 0x197c, 0x2004, 0x9086,
+	0xaaaa, 0x1904, 0xa735, 0x7003, 0x5400, 0x00c6, 0x2061, 0x1800,
+	0x607c, 0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105,
+	0x700a, 0x6080, 0x700e, 0xa998, 0x918c, 0xff00, 0x7112, 0x20a9,
+	0x0004, 0x2009, 0x1805, 0x2e10, 0x9290, 0x0006, 0x2104, 0x2012,
+	0x8108, 0x8210, 0x1f04, 0xa6c6, 0x20a9, 0x0004, 0x2009, 0x1801,
+	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa6d0, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0029, 0x2098, 0x2009, 0x0006, 0x20a9, 0x0001,
+	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00d6, 0x2069,
+	0x0200, 0x080c, 0xa67b, 0x00de, 0x2071, 0x0240, 0x2011, 0x0240,
+	0x2009, 0x0002, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
+	0x8109, 0x1dc0, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007,
+	0x2012, 0x8210, 0x8109, 0x1dc0, 0xa85c, 0x9080, 0x0031, 0x2098,
+	0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
+	0x8109, 0x1dc0, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1168, 0x080c,
+	0x74e9, 0x0150, 0x6028, 0xc0bd, 0x602a, 0x2009, 0x1804, 0x2011,
+	0x0029, 0x080c, 0x2a53, 0x0010, 0x080c, 0x9e02, 0x080c, 0x86ed,
+	0x00de, 0x009e, 0x002e, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0240,
+	0x2001, 0x2200, 0x9085, 0x00ff, 0x7002, 0x7007, 0xffff, 0x2071,
+	0x0100, 0x709b, 0x00ff, 0x00ee, 0x0804, 0xa6ab, 0x080c, 0x9a9f,
+	0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138,
+	0x7003, 0x5500, 0x00c6, 0xa89c, 0x9084, 0x00ff, 0xa998, 0x810f,
+	0x918c, 0xff00, 0x9105, 0x700a, 0xa99c, 0x918c, 0xff00, 0xa8a0,
+	0x9084, 0x00ff, 0x9105, 0x700e, 0xa998, 0x918c, 0xff00, 0x2061,
+	0x1800, 0x607c, 0x9084, 0x00ff, 0x910d, 0x7112, 0x6180, 0x7116,
+	0x2009, 0x0008, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098,
+	0x2e10, 0x9290, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
+	0x8210, 0x8109, 0x1dc0, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2104,
+	0x2012, 0x8108, 0x8210, 0x1f04, 0xa787, 0x20a9, 0x0002, 0x2009,
+	0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa791, 0x00d6,
+	0x0016, 0x2069, 0x0200, 0x080c, 0xa67b, 0x001e, 0x00de, 0x2071,
+	0x0240, 0x20a9, 0x0002, 0x2009, 0x1803, 0x2011, 0x0240, 0x2104,
+	0x2012, 0x8108, 0x8210, 0x1f04, 0xa7a7, 0x2009, 0x0008, 0x4002,
+	0x8007, 0x2012, 0x8210, 0x8109, 0x1dd0, 0x9006, 0x20a9, 0x0008,
+	0x2012, 0x8210, 0x1f04, 0xa7b8, 0x00ce, 0x60c3, 0x004c, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x080c, 0x9e02, 0x080c, 0x86ed, 0x00de,
+	0x009e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214,
+	0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284,
+	0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016,
+	0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000,
+	0x6812, 0x0c60, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
+	0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa873, 0x7030, 0x9c06,
+	0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xa84a, 0x080c,
+	0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338, 0x7033, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110,
+	0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
+	0xca3c, 0x1158, 0x080c, 0x321c, 0x080c, 0xca4d, 0x11f0, 0x080c,
+	0xb5b5, 0x00d8, 0x080c, 0xa338, 0x08c0, 0x080c, 0xca4d, 0x1118,
+	0x080c, 0xb5b5, 0x0090, 0x6014, 0x2048, 0x080c, 0xc836, 0x0168,
+	0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x080c, 0xccc4, 0x080c,
+	0xac28, 0x080c, 0xa20e, 0x00ce, 0x0804, 0xa7fb, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0xa7fb, 0x7013, 0x0000, 0x700f, 0x0000, 0x012e,
+	0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe26c, 0x08f0, 0x00f6,
+	0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8, 0x7832, 0x7936,
+	0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe, 0x0005, 0x0016, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1188, 0x2001,
+	0x0015, 0x0c29, 0x2009, 0x1000, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0003, 0x0120, 0x8109, 0x1db0, 0x080c, 0x0d7d,
+	0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0003, 0x1120, 0x2001, 0x0380, 0x2003, 0x0001, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x00e6, 0x900e, 0x2071, 0x19e7, 0x0469, 0x0106,
+	0x0190, 0x7004, 0x9086, 0x0003, 0x0148, 0x20a9, 0x1000, 0x6044,
+	0xd0fc, 0x01d8, 0x1f04, 0xa8cf, 0x080c, 0x0d7d, 0x080c, 0xa896,
+	0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148, 0x080c, 0x95de,
+	0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a, 0x7042, 0x704c,
+	0x9c06, 0x190c, 0x0d7d, 0x080c, 0x963b, 0x010e, 0x1919, 0x00ee,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0003, 0x0005, 0x0126, 0x2091, 0x2400, 0x7808,
+	0xd0a4, 0x190c, 0x0d76, 0xd09c, 0x0128, 0x7820, 0x908c, 0xf000,
+	0x11b8, 0x0012, 0x012e, 0x0005, 0xa91c, 0xa95a, 0xa981, 0xa9b8,
+	0xa9c8, 0xa9d9, 0xa9e8, 0xa9f6, 0xaa23, 0xaa27, 0xa91c, 0xa91c,
+	0xa91c, 0xa91c, 0xa91c, 0xa91c, 0x080c, 0x0d7d, 0x012e, 0x0005,
+	0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d7d, 0x0012, 0x012e, 0x0005, 0xa941, 0xa943,
+	0xa941, 0xa949, 0xa941, 0xa941, 0xa941, 0xa941, 0xa941, 0xa943,
+	0xa941, 0xa943, 0xa941, 0xa943, 0xa941, 0xa941, 0xa941, 0xa943,
+	0xa941, 0x080c, 0x0d7d, 0x2009, 0x0013, 0x080c, 0xac8c, 0x012e,
+	0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130, 0x080c, 0x88c1,
+	0x080c, 0xabed, 0x012e, 0x0005, 0x2009, 0x0049, 0x080c, 0xac8c,
+	0x012e, 0x0005, 0x080c, 0xa896, 0x2001, 0x1a0c, 0x2003, 0x0000,
+	0x7030, 0x9065, 0x090c, 0x0d7d, 0x7034, 0x9092, 0x00c8, 0x1258,
+	0x8000, 0x7036, 0x7004, 0x9086, 0x0003, 0x0110, 0x7007, 0x0000,
+	0x781f, 0x0808, 0x0040, 0x080c, 0xe717, 0x6003, 0x0001, 0x2009,
+	0x0014, 0x080c, 0xac8c, 0x781f, 0x0100, 0x080c, 0xa8b2, 0x012e,
+	0x0005, 0x080c, 0xa896, 0x714c, 0x81ff, 0x1128, 0x2011, 0x1a0f,
+	0x2013, 0x0000, 0x0438, 0x2061, 0x0100, 0x7150, 0x9192, 0x7530,
+	0x12f0, 0x8108, 0x7152, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e,
+	0x0006, 0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016,
+	0x0088, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0009, 0x0d90,
+	0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x0018, 0x706c,
+	0xc085, 0x706e, 0x781f, 0x0200, 0x080c, 0xa8b2, 0x012e, 0x0005,
+	0x080c, 0xa896, 0x714c, 0x2160, 0x6003, 0x0003, 0x2009, 0x004a,
+	0x080c, 0xac8c, 0x781f, 0x0200, 0x080c, 0xa8b2, 0x012e, 0x0005,
+	0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x6003, 0x0003, 0x080c,
+	0xa896, 0x080c, 0x1d60, 0x781f, 0x0400, 0x080c, 0xa8b2, 0x012e,
+	0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x080c, 0xa896,
+	0x080c, 0x1da8, 0x781f, 0x0400, 0x080c, 0xa8b2, 0x012e, 0x0005,
+	0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc, 0x6046, 0x7104, 0x9186,
+	0x0003, 0x0110, 0x080c, 0x96a1, 0x012e, 0x0005, 0x00f6, 0x703c,
+	0x9086, 0x0002, 0x0528, 0x704c, 0x907d, 0x0510, 0x7844, 0xc0bc,
+	0x7846, 0x7820, 0x9086, 0x0009, 0x0118, 0x080c, 0x9d5c, 0x00c0,
+	0x7828, 0xd0fc, 0x1118, 0x080c, 0x9cdb, 0x0090, 0x2001, 0x1837,
+	0x2004, 0x9084, 0x0028, 0x1130, 0x2001, 0x197c, 0x2004, 0x9086,
+	0xaaaa, 0x1120, 0x2001, 0x0387, 0x2003, 0x1000, 0x080c, 0x9c60,
+	0x00fe, 0x012e, 0x0005, 0x080c, 0x758a, 0x012e, 0x0005, 0x080c,
+	0x0d7d, 0x0005, 0x00e6, 0x2071, 0x19e7, 0x6044, 0xc0bc, 0x6046,
+	0xd0fc, 0x01b8, 0x704c, 0x9c06, 0x1190, 0x2019, 0x0001, 0x080c,
+	0xa118, 0x704f, 0x0000, 0x2001, 0x0109, 0x2004, 0xd08c, 0x1138,
+	0x2001, 0x0108, 0x2004, 0xd0bc, 0x1110, 0x703f, 0x0000, 0x080c,
+	0xa34e, 0x00ee, 0x0005, 0x0026, 0x7010, 0x9c06, 0x1178, 0x080c,
+	0xa20e, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7212,
+	0x600f, 0x0000, 0x0010, 0x7212, 0x720e, 0x9006, 0x002e, 0x0005,
+	0x0026, 0x7020, 0x9c06, 0x1178, 0x080c, 0xa20e, 0x6044, 0xc0fc,
+	0x6046, 0x600c, 0x9015, 0x0120, 0x7222, 0x600f, 0x0000, 0x0010,
+	0x7222, 0x721e, 0x9006, 0x002e, 0x0005, 0x00d6, 0x0036, 0x7830,
+	0x9c06, 0x1558, 0x2069, 0x0100, 0x68c0, 0x9005, 0x01f8, 0x080c,
+	0x86f6, 0x080c, 0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x9085, 0x0001, 0x0038, 0x7808, 0xc0ad,
+	0x780a, 0x6003, 0x0009, 0x630a, 0x9006, 0x003e, 0x00de, 0x0005,
+	0x0016, 0x0026, 0x0036, 0x6100, 0x2019, 0x0100, 0x2001, 0x0382,
+	0x2004, 0xd09c, 0x0190, 0x00c6, 0x0126, 0x2091, 0x2800, 0x0016,
+	0x0036, 0x080c, 0xa8fc, 0x003e, 0x001e, 0x012e, 0x00ce, 0x6200,
+	0x2200, 0x9106, 0x0d58, 0x2200, 0x0010, 0x8319, 0x1d38, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x00d6, 0x0156, 0x080c, 0x9aea, 0x7a14,
+	0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008,
+	0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800, 0x901e,
+	0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c, 0x74e9,
+	0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6adc, 0xd29c, 0x1110, 0xd2ac,
+	0x0108, 0xc39d, 0x730e, 0x080c, 0x87bb, 0x20a9, 0x0006, 0x2011,
+	0xfff4, 0x2019, 0xfff5, 0x2071, 0x0250, 0x2305, 0x2072, 0x8e70,
+	0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04,
+	0xaafd, 0x60c3, 0x0020, 0x080c, 0x9e02, 0x015e, 0x00de, 0x0005,
+	0x0156, 0x080c, 0x9aea, 0x7a14, 0x82ff, 0x0168, 0x9286, 0xffff,
+	0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007, 0x001c, 0x700f,
+	0x0001, 0x2011, 0x19bd, 0x2204, 0x8007, 0x701a, 0x8210, 0x2204,
+	0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
+	0x2001, 0x181f, 0x2004, 0x7022, 0x2001, 0x1820, 0x2004, 0x7026,
+	0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9,
+	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
+	0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9e02, 0x0006,
+	0x2001, 0x1837, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003,
+	0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098,
+	0x0036, 0x901e, 0x080c, 0xa118, 0x003e, 0x0005, 0x080c, 0x336d,
+	0x0188, 0x0016, 0x00b6, 0x00c6, 0x7010, 0x9085, 0x0020, 0x7012,
+	0x2009, 0x007e, 0x080c, 0x6625, 0xb85c, 0xc0ac, 0xb85e, 0x00ce,
+	0x00be, 0x001e, 0x0005, 0x2071, 0x188d, 0x7000, 0x9005, 0x0140,
+	0x2001, 0x0812, 0x2071, 0x1800, 0x7076, 0x707a, 0x706b, 0xffd4,
+	0x2071, 0x1800, 0x7074, 0x7056, 0x705b, 0x1ddc, 0x0005, 0x00e6,
+	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0010,
+	0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
+	0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x001c, 0x7068, 0x9502,
+	0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b,
+	0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7554,
+	0x9582, 0x0010, 0x0600, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000,
+	0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061,
+	0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x001c,
+	0x7068, 0x9502, 0x1228, 0x755a, 0x9085, 0x0001, 0x00ee, 0x0005,
+	0x705b, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x1ddc, 0x0a0c,
+	0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0d7d, 0x9006,
+	0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012, 0x6023, 0x0000,
+	0x6003, 0x0000, 0x601e, 0x605e, 0x6062, 0x6026, 0x602a, 0x602e,
+	0x6032, 0x6036, 0x603a, 0x603e, 0x604a, 0x602a, 0x6046, 0x6042,
+	0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x0005, 0x9006, 0x600e,
+	0x6016, 0x601a, 0x6012, 0x6022, 0x6002, 0x601e, 0x605e, 0x6062,
+	0x604a, 0x6046, 0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x0005,
+	0x0006, 0x6000, 0x9086, 0x0000, 0x01d0, 0x601c, 0xd084, 0x190c,
+	0x1a6a, 0x6023, 0x0007, 0x2001, 0x1986, 0x2004, 0x0006, 0x9082,
+	0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xe524, 0x604b,
+	0x0000, 0x6044, 0xd0fc, 0x1129, 0x9006, 0x6046, 0x6016, 0x000e,
+	0x0005, 0x080c, 0xa8f4, 0x0106, 0x190c, 0xa896, 0x2001, 0x19fa,
+	0x2004, 0x9c06, 0x1130, 0x0036, 0x2019, 0x0001, 0x080c, 0xa118,
+	0x003e, 0x080c, 0xa34e, 0x010e, 0x190c, 0xa8b2, 0x0005, 0x00e6,
+	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0001,
+	0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
+	0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x001c, 0x7068, 0x9502,
+	0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b,
+	0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002,
+	0xaca0, 0xacaa, 0xacc5, 0xace0, 0xcf9c, 0xcfb9, 0xcfd4, 0xaca0,
+	0xacaa, 0x8f9a, 0xacfc, 0xaca0, 0xaca0, 0xaca0, 0xaca0, 0xaca0,
+	0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c, 0x95de,
+	0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d,
+	0x0013, 0x006e, 0x0005, 0xacc3, 0xb421, 0xb5fc, 0xacc3, 0xb692,
+	0xafc5, 0xacc3, 0xacc3, 0xb3a3, 0xbbfa, 0xacc3, 0xacc3, 0xacc3,
+	0xacc3, 0xacc3, 0xacc3, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xacde, 0xc205,
+	0xacde, 0xacde, 0xacde, 0xacde, 0xacde, 0xacde, 0xc1aa, 0xc388,
+	0xacde, 0xc242, 0xc2c6, 0xc242, 0xc2c6, 0xacde, 0x080c, 0x0d7d,
+	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d7d, 0x6000, 0x0002, 0xacfa,
+	0xbc44, 0xbcdb, 0xbe5b, 0xbeca, 0xacfa, 0xacfa, 0xacfa, 0xbc13,
+	0xc12b, 0xc12e, 0xacfa, 0xacfa, 0xacfa, 0xacfa, 0xc15e, 0xacfa,
+	0xacfa, 0xacfa, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xad15, 0xad15, 0xad53,
+	0xadf2, 0xae72, 0xad15, 0xad15, 0xad15, 0xad17, 0xad15, 0xad15,
+	0xad15, 0xad15, 0xad15, 0xad15, 0xad15, 0x080c, 0x0d7d, 0x9186,
+	0x004c, 0x0560, 0x9186, 0x0003, 0x190c, 0x0d7d, 0x0096, 0x601c,
+	0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c,
+	0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa836, 0xa8b0, 0xa83a,
+	0x9006, 0xa846, 0xa84a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001,
+	0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x080c,
+	0x1bba, 0x2009, 0x8030, 0x080c, 0x9265, 0x0005, 0x6010, 0x00b6,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0xae94, 0x080c, 0xcf6a,
+	0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079, 0x1800,
+	0x7a90, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290, 0x0018,
+	0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc, 0x921a,
+	0x0140, 0x0220, 0xa87b, 0x0007, 0x2010, 0x0028, 0xa87b, 0x0015,
+	0x0010, 0xa87b, 0x0000, 0x8214, 0xa883, 0x0000, 0xaa02, 0x0006,
+	0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400, 0x9005,
+	0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118, 0x2001, 0x0001,
+	0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001, 0x0001, 0x002a,
+	0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0xadba, 0xadba, 0xadb5,
+	0xadb8, 0xadba, 0xadb2, 0xada5, 0xada5, 0xada5, 0xada5, 0xada5,
+	0xada5, 0xada5, 0xada5, 0xada5, 0xada5, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e, 0x00de,
+	0x080c, 0x0d7d, 0x080c, 0xb84f, 0x0028, 0x080c, 0xb934, 0x0010,
+	0x080c, 0xba2a, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e,
+	0x2c00, 0xa896, 0x000e, 0x080c, 0xaf52, 0x0530, 0xa804, 0xa80e,
+	0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0, 0xacd4,
+	0xadd8, 0x2031, 0x0000, 0x2041, 0x1298, 0x080c, 0xb112, 0x0160,
+	0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005, 0x00fe,
+	0x009e, 0x00de, 0x0804, 0xabed, 0x2001, 0x002c, 0x900e, 0x080c,
+	0xafb8, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016, 0x0158,
+	0x91b2, 0x0047, 0x0a0c, 0x0d7d, 0x91b2, 0x0050, 0x1a0c, 0x0d7d,
+	0x9182, 0x0047, 0x0042, 0x080c, 0xaaa8, 0x0120, 0x9086, 0x0002,
+	0x0904, 0xad53, 0x0005, 0xae14, 0xae14, 0xae16, 0xae48, 0xae14,
+	0xae14, 0xae14, 0xae14, 0xae5b, 0x080c, 0x0d7d, 0x00d6, 0x0016,
+	0x0096, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
+	0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001,
+	0x0000, 0x900e, 0x080c, 0xafb8, 0x080c, 0xabed, 0x00a8, 0x6003,
+	0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78,
+	0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2,
+	0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005,
+	0x080c, 0x963b, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xc838,
+	0x0120, 0xa87b, 0x0006, 0x080c, 0x6d80, 0x009e, 0x00de, 0x080c,
+	0xabed, 0x0804, 0x96a0, 0x080c, 0x963b, 0x080c, 0x31e7, 0x080c,
+	0xcf67, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xc838, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6d80, 0x009e, 0x00de, 0x080c, 0xabed,
+	0x0804, 0x96a0, 0x9182, 0x0047, 0x0002, 0xae82, 0xae84, 0xae82,
+	0xae82, 0xae82, 0xae82, 0xae82, 0xae82, 0xae82, 0xae82, 0xae82,
+	0xae82, 0xae84, 0x080c, 0x0d7d, 0x00d6, 0x0096, 0x601f, 0x0000,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6d80,
+	0x009e, 0x00de, 0x0804, 0xabed, 0x0026, 0x0036, 0x0056, 0x0066,
+	0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x103a, 0x000e, 0x090c,
+	0x0d7d, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
+	0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x7990, 0x9188,
+	0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034,
+	0x1228, 0x2011, 0x001f, 0x080c, 0xc40b, 0x04c0, 0x2130, 0x2009,
+	0x0034, 0x2011, 0x001f, 0x080c, 0xc40b, 0x96b2, 0x0034, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0fec, 0x080c, 0x103a, 0x01d0, 0x8528,
+	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
+	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc40b, 0x00b8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc40b,
+	0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
+	0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205,
+	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6d80, 0x000e, 0x2048,
+	0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e,
+	0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x103a,
+	0x000e, 0x090c, 0x0d7d, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
+	0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079,
+	0x1800, 0x7990, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210,
+	0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c,
+	0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
+	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6d80, 0x009e, 0x00fe,
+	0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001,
+	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200,
+	0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021,
+	0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011, 0x0020, 0x2018,
+	0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x103a, 0x2900, 0x009e,
+	0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009, 0x0280, 0x9102,
+	0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200, 0x9402, 0x1228,
+	0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800,
+	0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300,
+	0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
+	0x2e98, 0x2310, 0x84ff, 0x0904, 0xaf67, 0x0804, 0xaf69, 0x9085,
+	0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005,
+	0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c,
+	0x6d74, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
+	0x080c, 0xabed, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0d7d, 0x080c,
+	0xabed, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
+	0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003,
+	0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418,
+	0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8,
+	0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003,
+	0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xc838,
+	0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e,
+	0x0804, 0xabed, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200,
+	0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8d7, 0x0000, 0x00be, 0x6014,
+	0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32,
+	0x080c, 0xabed, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48,
+	0x0cc8, 0x0006, 0x0016, 0x080c, 0xcf52, 0x0188, 0x6014, 0x9005,
+	0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x604b, 0x0000, 0x2009,
+	0x0022, 0x080c, 0xb3f9, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085,
+	0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c,
+	0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001,
+	0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804,
 	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
-	0x2001, 0x0205, 0x2003, 0x0001, 0x2099, 0x0260, 0x20a9, 0x0016,
-	0x4003, 0x20a9, 0x000a, 0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0002,
-	0x2099, 0x0260, 0x20a9, 0x0020, 0x4003, 0x2003, 0x0000, 0x6014,
-	0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x080c, 0xabc9, 0x001e,
-	0x009e, 0x0005, 0x0096, 0x0016, 0x900e, 0x7030, 0x9086, 0x0100,
-	0x0140, 0x7038, 0x9084, 0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff,
-	0x8004, 0x9080, 0x0004, 0x9108, 0x810b, 0x2011, 0x0002, 0x2019,
-	0x000c, 0x6014, 0x2048, 0x080c, 0xc3e7, 0x080c, 0xc814, 0x0140,
-	0x6014, 0x2048, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103,
-	0x080c, 0xabc9, 0x001e, 0x009e, 0x0005, 0x0016, 0x2009, 0x0000,
-	0x7030, 0x9086, 0x0200, 0x0110, 0x2009, 0x0001, 0x0096, 0x6014,
-	0x904d, 0x090c, 0x0d7d, 0xa97a, 0x080c, 0x6d70, 0x009e, 0x080c,
-	0xabc9, 0x001e, 0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100,
-	0x1118, 0x2009, 0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011,
-	0x000c, 0x2019, 0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005,
-	0x0108, 0x2048, 0x080c, 0xc3e7, 0x009e, 0x080c, 0xc814, 0x0148,
-	0xa804, 0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867,
-	0x0103, 0x080c, 0xabc9, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040,
-	0xa030, 0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xb591, 0x00e0,
-	0xa034, 0x8007, 0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
-	0x2041, 0x127e, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006,
-	0x080c, 0x103a, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e,
-	0xa8a2, 0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e,
-	0xab92, 0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x1124, 0x008e,
-	0x9085, 0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008,
-	0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206,
-	0x1520, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206,
-	0x11e0, 0x604b, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c,
-	0xcea6, 0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20,
-	0x9386, 0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0xabc9,
-	0x0020, 0x0039, 0x0010, 0x080c, 0xb20a, 0x002e, 0x00de, 0x00ee,
-	0x0005, 0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xb1e9,
-	0x918e, 0x0016, 0x1904, 0xb208, 0x700c, 0x908c, 0xff00, 0x9186,
-	0x1700, 0x0120, 0x9186, 0x0300, 0x1904, 0xb1c3, 0x89ff, 0x1138,
-	0x6800, 0x9086, 0x000f, 0x0904, 0xb1a5, 0x0804, 0xb206, 0x6808,
-	0x9086, 0xffff, 0x1904, 0xb1eb, 0xa87c, 0x9084, 0x0060, 0x9086,
-	0x0020, 0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0xb1eb, 0x6824,
-	0xd0b4, 0x1904, 0xb1eb, 0x080c, 0xca03, 0x6864, 0xa882, 0xa87c,
-	0xc0dc, 0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001,
-	0x000a, 0x080c, 0x9135, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86,
-	0x82ff, 0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xc53a, 0x00ce,
-	0x0804, 0xb206, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x60b4,
-	0x0010, 0x080c, 0x64b8, 0x00ce, 0x1904, 0xb1eb, 0x00c6, 0x2d60,
-	0x080c, 0xabc9, 0x00ce, 0x0804, 0xb206, 0x00c6, 0x080c, 0xac3b,
-	0x0198, 0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xcca8, 0x6023,
-	0x0003, 0x6904, 0x00c6, 0x2d60, 0x080c, 0xabc9, 0x00ce, 0x080c,
-	0xac68, 0x00ce, 0x0804, 0xb206, 0x2001, 0x1988, 0x2004, 0x684a,
-	0x00ce, 0x0804, 0xb206, 0x7008, 0x9086, 0x000b, 0x11c8, 0x6010,
-	0x00b6, 0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60,
-	0xa87b, 0x0003, 0x080c, 0xcee8, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x91ed, 0x00ce, 0x0430,
-	0x700c, 0x9086, 0x2a00, 0x1138, 0x2001, 0x1988, 0x2004, 0x684a,
-	0x00e8, 0x04c1, 0x00e8, 0x89ff, 0x090c, 0x0d7d, 0x00c6, 0x00d6,
-	0x2d60, 0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x6b86, 0x080c,
-	0xca03, 0x080c, 0xac04, 0x0026, 0x6010, 0x00b6, 0x2058, 0xba3c,
-	0x080c, 0x6749, 0x00be, 0x002e, 0x00de, 0x00ce, 0x080c, 0xabc9,
-	0x009e, 0x0005, 0x9186, 0x0015, 0x1128, 0x2001, 0x1988, 0x2004,
-	0x684a, 0x0068, 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060,
-	0x080c, 0xe4f9, 0x080c, 0x8890, 0x080c, 0xabc9, 0x00ce, 0x080c,
-	0xabc9, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0xacb0, 0xabac,
-	0xd2f4, 0x0130, 0x2001, 0x1988, 0x2004, 0x684a, 0x0804, 0xb284,
-	0x00c6, 0x2d60, 0x080c, 0xc412, 0x00ce, 0x6804, 0x9086, 0x0050,
-	0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050,
-	0x2009, 0x8023, 0x080c, 0x91ed, 0x00ce, 0x04f0, 0x6800, 0x9086,
-	0x000f, 0x01a8, 0x89ff, 0x090c, 0x0d7d, 0x6800, 0x9086, 0x0004,
-	0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff,
-	0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400, 0x2001,
-	0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8,
-	0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20,
-	0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d38,
-	0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c,
-	0xcb92, 0x080c, 0x966f, 0x0010, 0x080c, 0xabc9, 0x004e, 0x003e,
-	0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff,
-	0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904, 0xb2ef,
-	0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x1904,
-	0xb2ef, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286,
-	0x0007, 0x0904, 0xb2ef, 0x9286, 0x0002, 0x0904, 0xb2ef, 0x9286,
-	0x0000, 0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8, 0x2071, 0x026c,
-	0x9186, 0x0015, 0x0570, 0x918e, 0x0016, 0x1100, 0x00c6, 0x6038,
-	0x2060, 0x6104, 0x9186, 0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8,
-	0x9186, 0x004d, 0x0190, 0x9186, 0x004e, 0x0178, 0x9186, 0x0052,
-	0x0160, 0x6014, 0x0096, 0x2048, 0x080c, 0xc814, 0x090c, 0x0d7d,
-	0xa87b, 0x0003, 0x009e, 0x080c, 0xcee8, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x91ed, 0x00ce,
-	0x0030, 0x6038, 0x2070, 0x2001, 0x1988, 0x2004, 0x704a, 0x080c,
-	0xabc9, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6,
-	0x6014, 0x2048, 0x6010, 0x2058, 0x91b6, 0x0015, 0x0130, 0xba08,
-	0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096, 0x0156, 0x0036,
-	0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a, 0x20a9, 0x0004,
-	0x080c, 0xbb9e, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904, 0xb35e,
-	0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019,
-	0x0006, 0x20a9, 0x0004, 0x080c, 0xbb9e, 0x002e, 0x003e, 0x015e,
-	0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d,
-	0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be, 0x0804,
-	0xafd9, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
-	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
-	0x2041, 0x127e, 0x080c, 0xb0ee, 0x0130, 0x00fe, 0x009e, 0x080c,
-	0xabc9, 0x00be, 0x0005, 0x080c, 0xb591, 0x0cb8, 0x2b78, 0x00f6,
-	0x080c, 0x31e4, 0x080c, 0xcf43, 0x00fe, 0x00c6, 0x080c, 0xab73,
-	0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
-	0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x656e, 0x080c, 0x659a,
-	0x080c, 0x91f4, 0x080c, 0x966f, 0x00ce, 0x0804, 0xb331, 0x2100,
-	0x91b2, 0x0053, 0x1a0c, 0x0d7d, 0x91b2, 0x0040, 0x1a04, 0xb3e7,
-	0x0002, 0xb3d5, 0xb3d5, 0xb3cb, 0xb3d5, 0xb3d5, 0xb3d5, 0xb3c9,
-	0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9,
-	0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9,
-	0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9,
-	0xb3d5, 0xb3c9, 0xb3d5, 0xb3d5, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9,
-	0xb3c9, 0xb3cb, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9,
-	0xb3c9, 0xb3c9, 0xb3c9, 0xb3d5, 0xb3d5, 0xb3c9, 0xb3c9, 0xb3c9,
-	0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3c9, 0xb3d5, 0xb3c9,
-	0xb3c9, 0x080c, 0x0d7d, 0x0066, 0x00b6, 0x6610, 0x2658, 0xb8d4,
-	0xc08c, 0xb8d6, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001, 0x6106,
-	0x9186, 0x0032, 0x0118, 0x080c, 0x91f4, 0x0010, 0x080c, 0x91ed,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x966f, 0x012e, 0x0005, 0x2600,
-	0x0002, 0xb3d5, 0xb3d5, 0xb3fb, 0xb3d5, 0xb3d5, 0xb3fb, 0xb3fb,
-	0xb3fb, 0xb3fb, 0xb3d5, 0xb3fb, 0xb3d5, 0xb3fb, 0xb3d5, 0xb3fb,
-	0xb3fb, 0xb3fb, 0xb3fb, 0x080c, 0x0d7d, 0x6004, 0x90b2, 0x0053,
-	0x1a0c, 0x0d7d, 0x91b6, 0x0013, 0x0904, 0xb4d2, 0x91b6, 0x0027,
-	0x1904, 0xb47e, 0x080c, 0x95ad, 0x6004, 0x080c, 0xca18, 0x01b0,
-	0x080c, 0xca29, 0x01a8, 0x908e, 0x0021, 0x0904, 0xb47b, 0x908e,
-	0x0022, 0x1130, 0x080c, 0xb005, 0x0904, 0xb477, 0x0804, 0xb478,
-	0x908e, 0x003d, 0x0904, 0xb47b, 0x0804, 0xb471, 0x080c, 0x3215,
-	0x2001, 0x0007, 0x080c, 0x656e, 0x6010, 0x00b6, 0x2058, 0xb9a0,
-	0x00be, 0x080c, 0xb591, 0x9186, 0x007e, 0x1148, 0x2001, 0x1837,
-	0x2014, 0xc285, 0x080c, 0x74d5, 0x1108, 0xc2ad, 0x2202, 0x080c,
-	0xa872, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xe605,
-	0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028,
-	0x080c, 0x9374, 0x0076, 0x903e, 0x080c, 0x9246, 0x6010, 0x00b6,
-	0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xdfc0, 0x007e, 0x003e,
-	0x002e, 0x001e, 0x080c, 0xa88e, 0x080c, 0xcf43, 0x0016, 0x080c,
-	0xcca0, 0x080c, 0xabc9, 0x001e, 0x080c, 0x32f5, 0x080c, 0x966f,
-	0x0030, 0x080c, 0xcca0, 0x080c, 0xabc9, 0x080c, 0x966f, 0x0005,
-	0x080c, 0xb591, 0x0cb0, 0x080c, 0xb5cd, 0x0c98, 0x9186, 0x0015,
-	0x0118, 0x9186, 0x0016, 0x1140, 0x080c, 0xaa84, 0x0d80, 0x9086,
-	0x0002, 0x0904, 0xb5d8, 0x0c58, 0x9186, 0x0014, 0x1d40, 0x080c,
-	0x95ad, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xb005, 0x09f8,
-	0x080c, 0x31e4, 0x080c, 0xcf43, 0x080c, 0xca18, 0x1190, 0x080c,
-	0x3215, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb591,
-	0x9186, 0x007e, 0x1128, 0x2001, 0x1837, 0x200c, 0xc185, 0x2102,
-	0x0800, 0x080c, 0xca29, 0x1120, 0x080c, 0xb591, 0x0804, 0xb471,
-	0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e,
-	0x2079, 0x0000, 0x080c, 0x359e, 0x00fe, 0x00ee, 0x0804, 0xb471,
-	0x6004, 0x908e, 0x0021, 0x0d40, 0x908e, 0x0022, 0x090c, 0xb591,
-	0x0804, 0xb471, 0x90b2, 0x0040, 0x1a04, 0xb571, 0x2008, 0x0002,
-	0xb51a, 0xb51b, 0xb51e, 0xb521, 0xb524, 0xb527, 0xb518, 0xb518,
-	0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518,
-	0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518,
-	0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb52a, 0xb533,
-	0xb518, 0xb534, 0xb533, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518,
-	0xb533, 0xb533, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518, 0xb518,
-	0xb518, 0xb518, 0xb55c, 0xb533, 0xb518, 0xb52f, 0xb518, 0xb518,
-	0xb518, 0xb530, 0xb518, 0xb518, 0xb518, 0xb533, 0xb557, 0xb518,
-	0x080c, 0x0d7d, 0x00c0, 0x2001, 0x000b, 0x00e8, 0x2001, 0x0003,
-	0x00d0, 0x2001, 0x0005, 0x00b8, 0x2001, 0x0001, 0x00a0, 0x2001,
-	0x0009, 0x0088, 0x6003, 0x0005, 0x080c, 0x966f, 0x0058, 0x0018,
-	0x0010, 0x080c, 0x656e, 0x04b8, 0x080c, 0xcf46, 0x6003, 0x0004,
-	0x080c, 0x966f, 0x0005, 0x080c, 0x656e, 0x6003, 0x0002, 0x0036,
-	0x2019, 0x1852, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1986,
-	0x201c, 0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b,
-	0x831b, 0x9318, 0x631a, 0x003e, 0x080c, 0x966f, 0x0c18, 0x080c,
-	0xcca0, 0x080c, 0xabc9, 0x08f0, 0x00e6, 0x00f6, 0x2071, 0x189e,
-	0x2079, 0x0000, 0x080c, 0x359e, 0x00fe, 0x00ee, 0x080c, 0x95ad,
-	0x080c, 0xabc9, 0x0878, 0x6003, 0x0002, 0x080c, 0xcf46, 0x0804,
-	0x966f, 0x2600, 0x2008, 0x0002, 0xb588, 0xb56b, 0xb586, 0xb56b,
-	0xb56b, 0xb586, 0xb586, 0xb586, 0xb586, 0xb56b, 0xb586, 0xb56b,
-	0xb586, 0xb56b, 0xb586, 0xb586, 0xb586, 0xb586, 0x080c, 0x0d7d,
-	0x0096, 0x6014, 0x2048, 0x080c, 0x6d70, 0x009e, 0x080c, 0xabc9,
-	0x0005, 0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xc814, 0x0568,
-	0x6014, 0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086,
-	0x0056, 0x1148, 0x080c, 0x5474, 0x0130, 0x2001, 0x0000, 0x900e,
-	0x2011, 0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005,
-	0x080c, 0xce0d, 0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000,
-	0x0016, 0x6004, 0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150,
-	0x001e, 0xa867, 0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e,
-	0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048,
-	0xa800, 0x2048, 0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005,
-	0x00b6, 0x6610, 0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c,
-	0x1a0c, 0x0d7d, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xcd2c,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xcd75,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xcda1,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xccc2,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xca62,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xcaa3,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x001f, 0x1120, 0x080c, 0xafae,
-	0x0804, 0xb65d, 0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xb2f5,
-	0x04e0, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c, 0xafe6, 0x04a8,
-	0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0xb10c, 0x0470, 0x6604,
-	0x96b6, 0x0039, 0x1118, 0x080c, 0xb28a, 0x0438, 0x6604, 0x96b6,
-	0x003d, 0x1118, 0x080c, 0xb01e, 0x0400, 0x6604, 0x96b6, 0x0044,
-	0x1118, 0x080c, 0xb05a, 0x00c8, 0x6604, 0x96b6, 0x0049, 0x1118,
-	0x080c, 0xb09b, 0x0090, 0x6604, 0x96b6, 0x0041, 0x1118, 0x080c,
-	0xb085, 0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6,
-	0x0016, 0x1128, 0x00be, 0x0804, 0xb8b7, 0x00be, 0x0005, 0x080c,
-	0xac85, 0x0cd8, 0xb67a, 0xb67d, 0xb67a, 0xb6c4, 0xb67a, 0xb82b,
-	0xb8c4, 0xb67a, 0xb67a, 0xb88d, 0xb67a, 0xb8a3, 0x0096, 0x601f,
-	0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e,
-	0x0804, 0xabc9, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800,
-	0x7090, 0x9086, 0x0074, 0x1540, 0x080c, 0xdf91, 0x11b0, 0x6010,
-	0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110,
-	0xc0c5, 0xb802, 0x00f9, 0x00be, 0x2001, 0x0006, 0x080c, 0x656e,
-	0x080c, 0x3215, 0x080c, 0xabc9, 0x0098, 0x2001, 0x000a, 0x080c,
-	0x656e, 0x080c, 0x3215, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
-	0x91f4, 0x080c, 0x966f, 0x0020, 0x2001, 0x0001, 0x080c, 0xb7fb,
-	0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0160, 0x9006, 0x080c,
-	0x655a, 0x2069, 0x1847, 0x6804, 0xd0a4, 0x0120, 0x2001, 0x0006,
-	0x080c, 0x659a, 0x00de, 0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011,
-	0x1824, 0x2204, 0x9086, 0x0074, 0x1904, 0xb7d2, 0x6010, 0x2058,
-	0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xba11, 0x0804, 0xb736,
-	0x080c, 0xba06, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510,
-	0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
-	0xce0d, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
-	0x2001, 0x0006, 0x080c, 0x656e, 0x080c, 0x3215, 0x080c, 0xabc9,
-	0x0804, 0xb7d5, 0x080c, 0xb7e3, 0x6014, 0x9005, 0x0190, 0x2048,
-	0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xce0d,
-	0x08f8, 0x080c, 0xb7d9, 0x0160, 0x9006, 0x080c, 0x655a, 0x2001,
-	0x0004, 0x080c, 0x659a, 0x2001, 0x0007, 0x080c, 0x656e, 0x08a0,
-	0x2001, 0x0004, 0x080c, 0x656e, 0x6003, 0x0001, 0x6007, 0x0003,
-	0x080c, 0x91f4, 0x080c, 0x966f, 0x0804, 0xb7d5, 0xb85c, 0xd0e4,
-	0x01d8, 0x080c, 0xcc3a, 0x080c, 0x74d5, 0x0118, 0xd0dc, 0x1904,
-	0xb6f8, 0x2011, 0x1837, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x196d,
-	0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x266f,
-	0x78e2, 0x00fe, 0x0804, 0xb6f8, 0x080c, 0xcc7b, 0x2011, 0x1837,
-	0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xe121, 0x000e, 0x1904,
-	0xb6f8, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x656e, 0x9006,
-	0x080c, 0x655a, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520,
-	0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084,
-	0x00ff, 0x78e6, 0x707e, 0x7010, 0x78ea, 0x7082, 0x908c, 0x00ff,
-	0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2644, 0x00f6,
-	0x2100, 0x900e, 0x080c, 0x25fb, 0x795e, 0x00fe, 0x9186, 0x0081,
-	0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079,
-	0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe,
-	0x080c, 0x2644, 0x00f6, 0x2079, 0x1800, 0x7982, 0x2100, 0x900e,
-	0x080c, 0x25fb, 0x795e, 0x00fe, 0x8108, 0x080c, 0x65bd, 0x2b00,
-	0x00ce, 0x1904, 0xb6f8, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c,
-	0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009,
-	0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x656e, 0x6023,
-	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x91f4, 0x080c,
-	0x966f, 0x0018, 0x2001, 0x0001, 0x0431, 0x00de, 0x009e, 0x00be,
-	0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1848,
-	0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xe65e, 0x0190, 0x2071,
-	0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00,
-	0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912,
-	0xba16, 0x00ee, 0x0005, 0x2030, 0x9005, 0x0158, 0x2001, 0x0007,
-	0x080c, 0x656e, 0x080c, 0x56e7, 0x1120, 0x2001, 0x0007, 0x080c,
-	0x659a, 0x2600, 0x9005, 0x11b0, 0x6014, 0x0096, 0x2048, 0xa868,
-	0x009e, 0xd0fc, 0x1178, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058,
-	0xbba0, 0x00be, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b00,
-	0x004e, 0x003e, 0x080c, 0x3215, 0x6020, 0x9086, 0x000a, 0x1108,
-	0x0005, 0x0804, 0xabc9, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071,
-	0x1800, 0x7090, 0x9086, 0x0014, 0x1904, 0xb883, 0x080c, 0x56e7,
-	0x1170, 0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
-	0xbba0, 0x2021, 0x0006, 0x080c, 0x4cb7, 0x004e, 0x003e, 0x00d6,
-	0x6010, 0x2058, 0x080c, 0x66b9, 0x080c, 0xb6b2, 0x00de, 0x080c,
-	0xbad7, 0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001,
-	0x0006, 0x080c, 0x656e, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e,
-	0x2011, 0x4000, 0x080c, 0xce0d, 0x0060, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0x0200, 0x009e, 0x080c, 0x3215, 0x6020, 0x9086, 0x000a, 0x0140,
-	0x080c, 0xabc9, 0x0028, 0x080c, 0xb591, 0x9006, 0x080c, 0xb7fb,
-	0x001e, 0x002e, 0x00ee, 0x00be, 0x0005, 0x2011, 0x1824, 0x2204,
-	0x9086, 0x0014, 0x1160, 0x2001, 0x0002, 0x080c, 0x656e, 0x6003,
-	0x0001, 0x6007, 0x0001, 0x080c, 0x91f4, 0x0804, 0x966f, 0x2001,
-	0x0001, 0x0804, 0xb7fb, 0x2030, 0x2011, 0x1824, 0x2204, 0x9086,
-	0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007, 0x080c,
-	0x656e, 0x0804, 0xabc9, 0x2001, 0x0001, 0x0804, 0xb7fb, 0x0002,
-	0xb67a, 0xb8cf, 0xb67a, 0xb910, 0xb67a, 0xb9bd, 0xb8c4, 0xb67a,
-	0xb67a, 0xb9d1, 0xb67a, 0xb9e3, 0x6604, 0x9686, 0x0003, 0x0904,
-	0xb82b, 0x96b6, 0x001e, 0x1110, 0x080c, 0xabc9, 0x0005, 0x00b6,
-	0x00d6, 0x00c6, 0x080c, 0xb9f5, 0x11a0, 0x9006, 0x080c, 0x655a,
-	0x080c, 0x31e4, 0x080c, 0xcf43, 0x2001, 0x0002, 0x080c, 0x656e,
-	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x91f4, 0x080c, 0x966f,
-	0x0418, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010,
-	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842,
-	0x601b, 0x000a, 0x0088, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00,
-	0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x31e4, 0x080c, 0xcf43,
-	0x2001, 0x0001, 0x080c, 0xb7fb, 0x00ce, 0x00de, 0x00be, 0x0005,
-	0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xba03, 0x00d6, 0x2069,
-	0x197c, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086,
-	0x007e, 0x1138, 0x2069, 0x1820, 0x2d04, 0x8000, 0x206a, 0x00de,
-	0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x655a, 0x2001, 0x0002,
-	0x080c, 0x656e, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x91f4,
-	0x080c, 0x966f, 0x0804, 0xb98d, 0x080c, 0xc814, 0x01b0, 0x6014,
-	0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016,
-	0x2001, 0x0002, 0x080c, 0xce67, 0x00b0, 0x6014, 0x2048, 0xa864,
-	0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004,
-	0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x1110, 0x9006, 0x0c38, 0x080c, 0xb591, 0x2009, 0x026e, 0x2134,
-	0x96b4, 0x00ff, 0x9686, 0x0005, 0x0520, 0x9686, 0x000b, 0x01c8,
-	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009,
-	0x01c0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0190, 0x2001,
-	0x0004, 0x080c, 0x656e, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052,
-	0x0020, 0x2001, 0x0001, 0x080c, 0xb7fb, 0x002e, 0x00be, 0x009e,
-	0x0005, 0x9286, 0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xc814,
-	0x0140, 0xa864, 0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108,
-	0x0c40, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138,
-	0x8001, 0xb842, 0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0,
-	0x9086, 0x007e, 0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5fb5,
-	0x00ee, 0x0010, 0x080c, 0x31e4, 0x0860, 0x080c, 0xba03, 0x1160,
-	0x2001, 0x0004, 0x080c, 0x656e, 0x6003, 0x0001, 0x6007, 0x0003,
-	0x080c, 0x91f4, 0x0804, 0x966f, 0x080c, 0xb591, 0x9006, 0x0804,
-	0xb7fb, 0x0489, 0x1160, 0x2001, 0x0008, 0x080c, 0x656e, 0x6003,
-	0x0001, 0x6007, 0x0005, 0x080c, 0x91f4, 0x0804, 0x966f, 0x2001,
-	0x0001, 0x0804, 0xb7fb, 0x00f9, 0x1160, 0x2001, 0x000a, 0x080c,
-	0x656e, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x91f4, 0x0804,
-	0x966f, 0x2001, 0x0001, 0x0804, 0xb7fb, 0x2009, 0x026e, 0x2104,
-	0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00,
-	0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6,
-	0x0016, 0x6110, 0x2158, 0x080c, 0x662d, 0x001e, 0x00ce, 0x00be,
-	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010,
-	0x2058, 0x2009, 0x1837, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c,
-	0xbaa9, 0x0560, 0x2009, 0x1837, 0x2104, 0xc0cd, 0x200a, 0x080c,
-	0x6a57, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe29e,
-	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009,
-	0x0001, 0x080c, 0x31a3, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2fb2,
-	0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c,
-	0x32f5, 0x8108, 0x1f04, 0xba47, 0x015e, 0x00ce, 0x080c, 0xba06,
-	0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1837,
-	0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038,
-	0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1837, 0x2102,
-	0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181f, 0x206a,
-	0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x1820, 0x206a, 0x78ea,
-	0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009,
-	0x182c, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x2644,
-	0x080c, 0x74d5, 0x0170, 0x2071, 0x0260, 0x2069, 0x1982, 0x7048,
-	0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c,
-	0xcc3a, 0x0040, 0x2001, 0x0006, 0x080c, 0x656e, 0x080c, 0x3215,
-	0x080c, 0xabc9, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be,
-	0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182c,
-	0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff,
-	0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276,
-	0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbb9e, 0x1148,
-	0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xbb9e,
-	0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e, 0x0005, 0x00e6,
-	0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038, 0x9086,
-	0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086,
-	0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6,
-	0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2029, 0x19f3, 0x252c, 0x2021, 0x19fa, 0x2424, 0x2061, 0x1ddc,
-	0x2071, 0x1800, 0x7254, 0x7074, 0x9202, 0x1a04, 0xbb6a, 0x080c,
-	0x8b5f, 0x0904, 0xbb63, 0x080c, 0xe2cf, 0x0904, 0xbb63, 0x6720,
-	0x9786, 0x0007, 0x0904, 0xbb63, 0x2500, 0x9c06, 0x0904, 0xbb63,
-	0x2400, 0x9c06, 0x0904, 0xbb63, 0x3e08, 0x9186, 0x0002, 0x1148,
-	0x6010, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x1590, 0x00c6, 0x6043, 0xffff, 0x6000, 0x9086, 0x0004, 0x1110,
-	0x080c, 0x1a6a, 0x9786, 0x000a, 0x0148, 0x080c, 0xca29, 0x1130,
-	0x00ce, 0x080c, 0xb591, 0x080c, 0xac04, 0x00e8, 0x6014, 0x2048,
-	0x080c, 0xc814, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867, 0x0103,
-	0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec,
-	0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d64, 0x080c, 0xca03,
-	0x080c, 0xac04, 0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1210,
-	0x0804, 0xbb0a, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e, 0x007e,
-	0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118, 0x080c,
-	0xe241, 0x0c30, 0x9786, 0x0009, 0x1148, 0x6000, 0x9086, 0x0004,
-	0x0d08, 0x2009, 0x004c, 0x080c, 0xac68, 0x08e0, 0x9786, 0x000a,
-	0x0938, 0x0820, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318,
-	0x1f04, 0xbb8a, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001,
-	0x0001, 0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6,
-	0x0016, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084,
-	0xffc0, 0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002,
-	0x910e, 0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce,
-	0x013e, 0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010,
-	0x2001, 0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005,
-	0x220c, 0x810f, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
-	0xbbc8, 0x9006, 0x0005, 0x918d, 0x0001, 0x0005, 0x6004, 0x908a,
-	0x0053, 0x1a0c, 0x0d7d, 0x080c, 0xca18, 0x0120, 0x080c, 0xca29,
-	0x0158, 0x0028, 0x080c, 0x3215, 0x080c, 0xca29, 0x0128, 0x080c,
-	0x95ad, 0x080c, 0xabc9, 0x0005, 0x080c, 0xb591, 0x0cc0, 0x9182,
-	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbc0e,
-	0xbc0e, 0xbc0e, 0xbc0e, 0xbc0e, 0xbc0e, 0xbc0e, 0xbc0e, 0xbc0e,
-	0xbc0e, 0xbc0e, 0xbc10, 0xbc10, 0xbc10, 0xbc10, 0xbc0e, 0xbc0e,
-	0xbc0e, 0xbc10, 0xbc0e, 0xbc0e, 0xbc0e, 0xbc0e, 0x080c, 0x0d7d,
-	0x600b, 0xffff, 0x6003, 0x000f, 0x6106, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xcf46, 0x2009, 0x8000, 0x080c, 0x91ed, 0x012e, 0x0005,
-	0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xbc95,
-	0x9186, 0x0027, 0x1520, 0x080c, 0x95ad, 0x080c, 0x31e4, 0x080c,
-	0xcf43, 0x0096, 0x6114, 0x2148, 0x080c, 0xc814, 0x0198, 0x080c,
-	0xca29, 0x1118, 0x080c, 0xb591, 0x0068, 0xa867, 0x0103, 0xa87b,
-	0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6d70,
-	0x080c, 0xca03, 0x009e, 0x080c, 0xabc9, 0x0804, 0x966f, 0x9186,
-	0x0014, 0x1120, 0x6004, 0x9082, 0x0040, 0x0018, 0x080c, 0x0d7d,
-	0x0005, 0x0002, 0xbc73, 0xbc71, 0xbc71, 0xbc71, 0xbc71, 0xbc71,
-	0xbc71, 0xbc71, 0xbc71, 0xbc71, 0xbc71, 0xbc8c, 0xbc8c, 0xbc8c,
-	0xbc8c, 0xbc71, 0xbc8c, 0xbc71, 0xbc8c, 0xbc71, 0xbc71, 0xbc71,
-	0xbc71, 0x080c, 0x0d7d, 0x080c, 0x95ad, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xc814, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877,
-	0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x6d70, 0x080c, 0xca03,
-	0x009e, 0x080c, 0xabc9, 0x0005, 0x080c, 0x95ad, 0x080c, 0xca29,
-	0x090c, 0xb591, 0x080c, 0xabc9, 0x0005, 0x0002, 0xbcaf, 0xbcad,
-	0xbcad, 0xbcad, 0xbcad, 0xbcad, 0xbcad, 0xbcad, 0xbcad, 0xbcad,
-	0xbcad, 0xbcb1, 0xbcb1, 0xbcb1, 0xbcb1, 0xbcad, 0xbcb3, 0xbcad,
-	0xbcb1, 0xbcad, 0xbcad, 0xbcad, 0xbcad, 0x080c, 0x0d7d, 0x080c,
-	0x0d7d, 0x080c, 0x0d7d, 0x080c, 0xabc9, 0x0804, 0x966f, 0x9182,
-	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbcd6,
-	0xbcd6, 0xbcd6, 0xbcd6, 0xbcd6, 0xbd0f, 0xbdfe, 0xbcd6, 0xbe0a,
-	0xbcd6, 0xbcd6, 0xbcd6, 0xbcd6, 0xbcd6, 0xbcd6, 0xbcd6, 0xbcd6,
-	0xbcd6, 0xbcd6, 0xbe0a, 0xbcd8, 0xbcd6, 0xbe08, 0x080c, 0x0d7d,
-	0x00b6, 0x0096, 0x6114, 0x2148, 0x6010, 0x2058, 0xb800, 0xd0bc,
-	0x1508, 0xa87b, 0x0000, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87c,
-	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbe8f, 0x080c,
-	0x6b86, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
-	0xb8d0, 0x9005, 0x0110, 0x080c, 0x6749, 0x080c, 0xabc9, 0x009e,
-	0x00be, 0x0005, 0xa87c, 0xd0ac, 0x09e0, 0xa838, 0xa934, 0x9105,
-	0x09c0, 0xa880, 0xd0bc, 0x19a8, 0x080c, 0xcb59, 0x0c80, 0x00b6,
-	0x0096, 0x6114, 0x2148, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008,
-	0x9036, 0x96b4, 0x0fff, 0x86ff, 0x1590, 0x6010, 0x2058, 0xb800,
-	0xd0bc, 0x1904, 0xbded, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76,
-	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbe8f,
-	0x080c, 0x6b86, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
-	0xba3e, 0xb8d0, 0x9005, 0x0110, 0x080c, 0x6749, 0x601c, 0xd0fc,
-	0x1148, 0x7044, 0xd0e4, 0x1904, 0xbdd1, 0x080c, 0xabc9, 0x009e,
-	0x00be, 0x0005, 0x2009, 0x0211, 0x210c, 0x080c, 0x0d7d, 0x968c,
-	0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbdd5,
-	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
-	0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc,
-	0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34,
-	0x2100, 0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206,
-	0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b,
-	0x0007, 0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e,
-	0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
-	0xc6c4, 0x0804, 0xbd1b, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
-	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
-	0x2011, 0x0025, 0x080c, 0xc3e7, 0x003e, 0xd6cc, 0x0904, 0xbd30,
-	0x7154, 0xa98a, 0x81ff, 0x0904, 0xbd30, 0x9192, 0x0021, 0x1278,
-	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc3e7, 0x2011,
-	0x0205, 0x2013, 0x0000, 0x080c, 0xced3, 0x0804, 0xbd30, 0xa868,
-	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950,
-	0x080c, 0xc386, 0x00ae, 0x080c, 0xced3, 0x080c, 0xc3d7, 0x0804,
-	0xbd32, 0x080c, 0xcb1c, 0x0804, 0xbd47, 0xa87c, 0xd0ac, 0x0904,
-	0xbd58, 0xa880, 0xd0bc, 0x1904, 0xbd58, 0x7348, 0xa838, 0x9306,
-	0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xbd58, 0xd6d4, 0x0190,
-	0xab38, 0x9305, 0x0904, 0xbd58, 0x0068, 0xa87c, 0xd0ac, 0x0904,
-	0xbd23, 0xa838, 0xa934, 0x9105, 0x0904, 0xbd23, 0xa880, 0xd0bc,
-	0x1904, 0xbd23, 0x080c, 0xcb59, 0x0804, 0xbd47, 0x00f6, 0x2079,
-	0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x00fe, 0x0021, 0x0005,
-	0x0011, 0x0005, 0x0005, 0x0096, 0x6003, 0x0002, 0x6007, 0x0043,
-	0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0128, 0x009e, 0x0005, 0x2130,
-	0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213,
-	0x2600, 0x9102, 0x2500, 0x9203, 0x0e90, 0xac46, 0xab4a, 0xae36,
-	0xad3a, 0x6044, 0xd0fc, 0x190c, 0xa89b, 0x604b, 0x0000, 0x080c,
-	0x1c30, 0x1118, 0x6144, 0x080c, 0x9219, 0x009e, 0x0005, 0x9182,
-	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbe56,
-	0xbe56, 0xbe56, 0xbe56, 0xbe56, 0xbe56, 0xbe56, 0xbe56, 0xbe56,
-	0xbe56, 0xbe58, 0xbe56, 0xbe56, 0xbe56, 0xbe56, 0xbe69, 0xbe56,
-	0xbe56, 0xbe56, 0xbe56, 0xbe8d, 0xbe56, 0xbe56, 0x080c, 0x0d7d,
-	0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x95ad, 0x2019, 0x0001,
-	0x080c, 0xa0f4, 0x6003, 0x0002, 0x080c, 0xcf4b, 0x080c, 0x960a,
-	0x0005, 0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x95ad, 0x2019,
-	0x0001, 0x080c, 0xa0f4, 0x080c, 0x960a, 0x080c, 0x31e4, 0x080c,
-	0xcf43, 0x0096, 0x6114, 0x2148, 0x080c, 0xc814, 0x0150, 0xa867,
-	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6d70, 0x080c,
-	0xca03, 0x009e, 0x080c, 0xabc9, 0x0005, 0x080c, 0x0d7d, 0xa87b,
-	0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a,
-	0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a78, 0x2104, 0x8000,
-	0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0057,
-	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbec5, 0xbec5,
-	0xbec5, 0xbec5, 0xbec5, 0xbec7, 0xbec5, 0xbec5, 0xbf84, 0xbec5,
-	0xbec5, 0xbec5, 0xbec5, 0xbec5, 0xbec5, 0xbec5, 0xbec5, 0xbec5,
-	0xbec5, 0xc0c8, 0xbec5, 0xc0d2, 0xbec5, 0x080c, 0x0d7d, 0x601c,
-	0xd0bc, 0x0178, 0xd084, 0x0168, 0xd0f4, 0x0120, 0xc084, 0x601e,
-	0x0804, 0xbcb7, 0x6114, 0x0096, 0x2148, 0xa87c, 0xc0e5, 0xa87e,
-	0x009e, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114,
-	0x2150, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0xb676,
-	0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258,
-	0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904,
-	0xbf7d, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092,
-	0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xbf7d, 0x9686, 0x0100,
-	0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c,
-	0x103a, 0x090c, 0x0d7d, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200,
-	0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070,
-	0xa872, 0x7044, 0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00,
-	0x0120, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186,
-	0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060,
-	0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b,
-	0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084,
-	0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170,
-	0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
-	0x0018, 0x2011, 0x0025, 0x080c, 0xc3e7, 0x003e, 0xd6cc, 0x01e8,
-	0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304,
-	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc3e7, 0x2011, 0x0205,
-	0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020,
-	0xa98a, 0x0c68, 0x2950, 0x080c, 0xc386, 0x080c, 0x1a48, 0x009e,
-	0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001, 0x1988, 0x2004, 0x604a,
-	0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c,
-	0xc0dc, 0xa87e, 0x6003, 0x0002, 0x080c, 0xcf54, 0x0904, 0xc0c3,
-	0x604b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x1500, 0xd1cc, 0x0904, 0xc082, 0xa978, 0xa868, 0xd0fc, 0x0904,
-	0xc043, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150,
-	0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xc011, 0x9086,
-	0x0028, 0x1904, 0xbffd, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804,
-	0xc019, 0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8,
-	0xa838, 0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988,
-	0x6024, 0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0,
-	0xa838, 0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6,
-	0x2058, 0xb83c, 0x8000, 0xb83e, 0x00be, 0x601c, 0xc0fc, 0x601e,
-	0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc,
-	0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec,
-	0x009e, 0x080c, 0xcb59, 0x0804, 0xc0c3, 0xd1dc, 0x0158, 0xa87b,
-	0x0015, 0xb07b, 0x0015, 0x080c, 0xcdf6, 0x0118, 0xb174, 0xc1dc,
-	0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007,
-	0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
-	0xbe8f, 0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020, 0x8a06,
-	0x8006, 0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0, 0x9080,
-	0x0019, 0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e, 0xa87e,
-	0x080c, 0xced3, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fec,
-	0x001e, 0x0804, 0xc0af, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184,
-	0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b,
-	0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015,
-	0xb07b, 0x0015, 0x080c, 0xcdf6, 0x0118, 0xb174, 0xc1dc, 0xb176,
-	0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040,
-	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbe8f,
-	0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c,
-	0x0fec, 0x009e, 0x080c, 0xced3, 0xa974, 0x0016, 0x080c, 0xc3d7,
-	0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6,
-	0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0,
-	0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xcdf6, 0x0118, 0xa974,
-	0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050,
-	0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xbe8f, 0xa974, 0x0016, 0x080c, 0x6b86, 0x001e, 0x6010,
-	0x00b6, 0x2058, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0,
-	0x9005, 0x0120, 0x0016, 0x080c, 0x6749, 0x001e, 0x00be, 0xd1e4,
-	0x1120, 0x080c, 0xabc9, 0x009e, 0x0005, 0x080c, 0xcb1c, 0x0cd8,
-	0x6114, 0x0096, 0x2148, 0xa97c, 0x080c, 0xcf54, 0x190c, 0x1a56,
-	0x009e, 0x0005, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105,
-	0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000, 0xa867, 0x0103, 0x00b6,
-	0x6010, 0x2058, 0xa834, 0xa938, 0x9115, 0x11a0, 0x080c, 0x6b86,
-	0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8d0, 0x9005, 0x0110, 0x080c,
-	0x6749, 0x080c, 0xabc9, 0x00be, 0x009e, 0x0005, 0xa87c, 0xc0dc,
-	0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120, 0xa834, 0x080c, 0xbe8f,
-	0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c, 0xcb59, 0x0c60, 0x080c,
-	0x95ad, 0x0010, 0x080c, 0x960a, 0x601c, 0xd084, 0x0110, 0x080c,
-	0x1a6a, 0x080c, 0xc814, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xca29, 0x1118, 0x080c, 0xb591, 0x00a0, 0xa867, 0x0103, 0x2009,
-	0x180c, 0x210c, 0xd18c, 0x1198, 0xd184, 0x1170, 0x6108, 0xa97a,
-	0x918e, 0x0029, 0x1110, 0x080c, 0xe5f6, 0xa877, 0x0000, 0x080c,
-	0x6d70, 0x009e, 0x0804, 0xac04, 0xa87b, 0x0004, 0x0cb0, 0xa87b,
-	0x0004, 0x0c98, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xc159, 0xc159, 0xc159, 0xc159, 0xc159, 0xc15b,
-	0xc159, 0xc159, 0xc159, 0xc159, 0xc159, 0xc159, 0xc159, 0xc159,
-	0xc159, 0xc159, 0xc159, 0xc159, 0xc159, 0xc159, 0xc17f, 0xc159,
-	0xc159, 0x080c, 0x0d7d, 0x080c, 0x56db, 0x01f8, 0x6014, 0x7144,
-	0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff,
-	0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086, 0x0139,
-	0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897, 0x4000,
-	0xa99a, 0xaa9e, 0x080c, 0x6d70, 0x009e, 0x0804, 0xabc9, 0x080c,
-	0x56db, 0x0dd8, 0x6014, 0x900e, 0x9016, 0x0c10, 0x9182, 0x0085,
-	0x0002, 0xc198, 0xc196, 0xc196, 0xc1a4, 0xc196, 0xc196, 0xc196,
-	0xc196, 0xc196, 0xc196, 0xc196, 0xc196, 0xc196, 0x080c, 0x0d7d,
-	0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0x8020,
-	0x080c, 0x91ed, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6,
-	0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xc802, 0x01a0,
-	0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e,
-	0x1158, 0x00c6, 0x2d60, 0x080c, 0xc412, 0x00ce, 0x0128, 0x6803,
-	0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x91ed, 0x9280, 0x0004, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6,
-	0x2260, 0x080c, 0xcb59, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e,
-	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
-	0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085, 0x00e2,
-	0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d, 0x080c,
-	0x95ad, 0x0096, 0x6014, 0x2048, 0x080c, 0xc814, 0x0140, 0xa867,
-	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6d70, 0x009e,
-	0x080c, 0xac04, 0x0804, 0x966f, 0xc219, 0xc21b, 0xc21b, 0xc219,
-	0xc219, 0xc219, 0xc219, 0xc219, 0xc219, 0xc219, 0xc219, 0xc219,
-	0xc219, 0x080c, 0x0d7d, 0x080c, 0xac04, 0x0005, 0x9186, 0x0013,
-	0x1130, 0x6004, 0x9082, 0x0085, 0x2008, 0x0804, 0xc26a, 0x9186,
-	0x0027, 0x1558, 0x080c, 0x95ad, 0x080c, 0x31e4, 0x080c, 0xcf43,
-	0x0096, 0x6014, 0x2048, 0x080c, 0xc814, 0x0150, 0xa867, 0x0103,
-	0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6d70, 0x080c, 0xca03,
-	0x009e, 0x080c, 0xabc9, 0x0005, 0x9186, 0x0089, 0x0118, 0x9186,
-	0x008a, 0x1140, 0x080c, 0xaa84, 0x0128, 0x9086, 0x000c, 0x0904,
-	0xc2a2, 0x0000, 0x080c, 0xac85, 0x0c70, 0x9186, 0x0014, 0x1d60,
-	0x080c, 0x95ad, 0x0096, 0x6014, 0x2048, 0x080c, 0xc814, 0x0d00,
-	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec,
-	0xa882, 0x0890, 0x0002, 0xc27a, 0xc278, 0xc278, 0xc278, 0xc278,
-	0xc278, 0xc28e, 0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc278,
-	0x080c, 0x0d7d, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010, 0x2001,
-	0x1987, 0x2004, 0x601a, 0x6003, 0x000c, 0x0005, 0x6034, 0x908c,
+	0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020,
+	0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
+	0x0103, 0x080c, 0xabed, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016,
+	0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff,
+	0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108,
+	0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c,
+	0xc40b, 0x080c, 0xc838, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xabed, 0x001e, 0x009e,
+	0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086, 0x0200, 0x0110,
+	0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c, 0x0d7d, 0xa97a,
+	0x080c, 0x6d80, 0x009e, 0x080c, 0xabed, 0x001e, 0x0005, 0x0016,
+	0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004, 0x0010,
+	0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c, 0x6014,
+	0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c, 0xc40b,
+	0x009e, 0x080c, 0xc838, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xabed, 0x009e,
+	0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100,
+	0x1118, 0x080c, 0xb5b5, 0x00e0, 0xa034, 0x8007, 0x800c, 0x8806,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x000c,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c,
+	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x127e, 0x0019, 0x0d08,
+	0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x103a, 0x000e, 0x01b0,
+	0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800,
+	0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086,
+	0x2940, 0x080c, 0x1124, 0x008e, 0x9085, 0x0001, 0x009e, 0x0005,
+	0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6,
+	0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210, 0x00b6,
+	0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x604b, 0x0000, 0x2c68,
+	0x0016, 0x2009, 0x0035, 0x080c, 0xceca, 0x001e, 0x1158, 0x622c,
+	0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386,
+	0x0006, 0x0128, 0x080c, 0xabed, 0x0020, 0x0039, 0x0010, 0x080c,
+	0xb22e, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048,
+	0x9186, 0x0015, 0x0904, 0xb20d, 0x918e, 0x0016, 0x1904, 0xb22c,
+	0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300,
+	0x1904, 0xb1e7, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904,
+	0xb1c9, 0x0804, 0xb22a, 0x6808, 0x9086, 0xffff, 0x1904, 0xb20f,
+	0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940,
+	0x9105, 0x1904, 0xb20f, 0x6824, 0xd0b4, 0x1904, 0xb20f, 0x080c,
+	0xca27, 0x6864, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e,
+	0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x9166, 0xa884,
+	0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6,
+	0x2d60, 0x080c, 0xc55e, 0x00ce, 0x0804, 0xb22a, 0x00c6, 0xa868,
+	0xd0fc, 0x1118, 0x080c, 0x60bb, 0x0010, 0x080c, 0x64bf, 0x00ce,
+	0x1904, 0xb20f, 0x00c6, 0x2d60, 0x080c, 0xabed, 0x00ce, 0x0804,
+	0xb22a, 0x00c6, 0x080c, 0xac5f, 0x0198, 0x6017, 0x0000, 0x6810,
+	0x6012, 0x080c, 0xcccc, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60,
+	0x080c, 0xabed, 0x00ce, 0x080c, 0xac8c, 0x00ce, 0x0804, 0xb22a,
+	0x2001, 0x1988, 0x2004, 0x684a, 0x00ce, 0x0804, 0xb22a, 0x7008,
+	0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc,
+	0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xcf0c,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020,
+	0x080c, 0x921e, 0x00ce, 0x0430, 0x700c, 0x9086, 0x2a00, 0x1138,
+	0x2001, 0x1988, 0x2004, 0x684a, 0x00e8, 0x04c1, 0x00e8, 0x89ff,
+	0x090c, 0x0d7d, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b,
+	0x0003, 0x080c, 0x6b96, 0x080c, 0xca27, 0x080c, 0xac28, 0x0026,
+	0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c, 0x6750, 0x00be, 0x002e,
+	0x00de, 0x00ce, 0x080c, 0xabed, 0x009e, 0x0005, 0x9186, 0x0015,
+	0x1128, 0x2001, 0x1988, 0x2004, 0x684a, 0x0068, 0x918e, 0x0016,
+	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xe524, 0x080c, 0x88c1,
+	0x080c, 0xabed, 0x00ce, 0x080c, 0xabed, 0x0005, 0x0026, 0x0036,
+	0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1988,
+	0x2004, 0x684a, 0x0804, 0xb2a8, 0x00c6, 0x2d60, 0x080c, 0xc436,
+	0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
+	0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c, 0x921e,
+	0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c,
+	0x0d7d, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178,
+	0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001,
+	0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c,
+	0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838,
+	0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306,
+	0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a,
+	0x2001, 0x0005, 0x6832, 0x080c, 0xcbb6, 0x080c, 0x96a0, 0x0010,
+	0x080c, 0xabed, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
+	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
+	0x00be, 0x9206, 0x1904, 0xb313, 0x700c, 0x6210, 0x00b6, 0x2258,
+	0xba14, 0x00be, 0x9206, 0x1904, 0xb313, 0x6038, 0x2068, 0x6824,
+	0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xb313, 0x9286,
+	0x0002, 0x0904, 0xb313, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c,
+	0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e,
+	0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b,
+	0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186,
+	0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048,
+	0x080c, 0xc838, 0x090c, 0x0d7d, 0xa87b, 0x0003, 0x009e, 0x080c,
+	0xcf0c, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009,
+	0x8020, 0x080c, 0x921e, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001,
+	0x1988, 0x2004, 0x704a, 0x080c, 0xabed, 0x002e, 0x00de, 0x00ee,
+	0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058,
+	0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02,
+	0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010,
+	0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xbbc2, 0x002e, 0x003e,
+	0x015e, 0x009e, 0x1904, 0xb382, 0x0096, 0x0156, 0x0036, 0x0026,
+	0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c,
+	0xbbc2, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a,
+	0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128,
+	0x00fe, 0x009e, 0x00be, 0x0804, 0xaffd, 0x0096, 0x2048, 0xaa12,
+	0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
+	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x127e, 0x080c, 0xb112,
+	0x0130, 0x00fe, 0x009e, 0x080c, 0xabed, 0x00be, 0x0005, 0x080c,
+	0xb5b5, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x00fe, 0x00c6, 0x080c, 0xab97, 0x2f00, 0x6012, 0x6017, 0x0000,
+	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007,
+	0x080c, 0x6575, 0x080c, 0x65a1, 0x080c, 0x9225, 0x080c, 0x96a0,
+	0x00ce, 0x0804, 0xb355, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0d7d,
+	0x91b2, 0x0040, 0x1a04, 0xb40b, 0x0002, 0xb3f9, 0xb3f9, 0xb3ef,
+	0xb3f9, 0xb3f9, 0xb3f9, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
+	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
+	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
+	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3f9, 0xb3ed, 0xb3f9, 0xb3f9,
+	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ef, 0xb3ed, 0xb3ed,
+	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3f9,
+	0xb3f9, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
+	0xb3ed, 0xb3ed, 0xb3f9, 0xb3ed, 0xb3ed, 0x080c, 0x0d7d, 0x0066,
+	0x00b6, 0x6610, 0x2658, 0xb8d4, 0xc08c, 0xb8d6, 0x00be, 0x006e,
+	0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c,
+	0x9225, 0x0010, 0x080c, 0x921e, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x96a0, 0x012e, 0x0005, 0x2600, 0x0002, 0xb3f9, 0xb3f9, 0xb41f,
+	0xb3f9, 0xb3f9, 0xb41f, 0xb41f, 0xb41f, 0xb41f, 0xb3f9, 0xb41f,
+	0xb3f9, 0xb41f, 0xb3f9, 0xb41f, 0xb41f, 0xb41f, 0xb41f, 0x080c,
+	0x0d7d, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d, 0x91b6, 0x0013,
+	0x0904, 0xb4f6, 0x91b6, 0x0027, 0x1904, 0xb4a2, 0x080c, 0x95de,
+	0x6004, 0x080c, 0xca3c, 0x01b0, 0x080c, 0xca4d, 0x01a8, 0x908e,
+	0x0021, 0x0904, 0xb49f, 0x908e, 0x0022, 0x1130, 0x080c, 0xb029,
+	0x0904, 0xb49b, 0x0804, 0xb49c, 0x908e, 0x003d, 0x0904, 0xb49f,
+	0x0804, 0xb495, 0x080c, 0x321c, 0x2001, 0x0007, 0x080c, 0x6575,
+	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb5b5, 0x9186,
+	0x007e, 0x1148, 0x2001, 0x1837, 0x2014, 0xc285, 0x080c, 0x74e9,
+	0x1108, 0xc2ad, 0x2202, 0x080c, 0xa896, 0x0036, 0x0026, 0x2019,
+	0x0028, 0x2110, 0x080c, 0xe630, 0x002e, 0x003e, 0x0016, 0x0026,
+	0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x93a5, 0x0076, 0x903e,
+	0x080c, 0x9277, 0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08,
+	0x080c, 0xdfeb, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0xa8b2,
+	0x080c, 0xcf67, 0x0016, 0x080c, 0xccc4, 0x080c, 0xabed, 0x001e,
+	0x080c, 0x32fc, 0x080c, 0x96a0, 0x0030, 0x080c, 0xccc4, 0x080c,
+	0xabed, 0x080c, 0x96a0, 0x0005, 0x080c, 0xb5b5, 0x0cb0, 0x080c,
+	0xb5f1, 0x0c98, 0x9186, 0x0015, 0x0118, 0x9186, 0x0016, 0x1140,
+	0x080c, 0xaaa8, 0x0d80, 0x9086, 0x0002, 0x0904, 0xb5fc, 0x0c58,
+	0x9186, 0x0014, 0x1d40, 0x080c, 0x95de, 0x6004, 0x908e, 0x0022,
+	0x1118, 0x080c, 0xb029, 0x09f8, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x080c, 0xca3c, 0x1190, 0x080c, 0x321c, 0x6010, 0x00b6, 0x2058,
+	0xb9a0, 0x00be, 0x080c, 0xb5b5, 0x9186, 0x007e, 0x1128, 0x2001,
+	0x1837, 0x200c, 0xc185, 0x2102, 0x0800, 0x080c, 0xca4d, 0x1120,
+	0x080c, 0xb5b5, 0x0804, 0xb495, 0x6004, 0x908e, 0x0032, 0x1160,
+	0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x35a5,
+	0x00fe, 0x00ee, 0x0804, 0xb495, 0x6004, 0x908e, 0x0021, 0x0d40,
+	0x908e, 0x0022, 0x090c, 0xb5b5, 0x0804, 0xb495, 0x90b2, 0x0040,
+	0x1a04, 0xb595, 0x2008, 0x0002, 0xb53e, 0xb53f, 0xb542, 0xb545,
+	0xb548, 0xb54b, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c,
+	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c,
+	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c,
+	0xb53c, 0xb53c, 0xb54e, 0xb557, 0xb53c, 0xb558, 0xb557, 0xb53c,
+	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb557, 0xb557, 0xb53c, 0xb53c,
+	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb580, 0xb557,
+	0xb53c, 0xb553, 0xb53c, 0xb53c, 0xb53c, 0xb554, 0xb53c, 0xb53c,
+	0xb53c, 0xb557, 0xb57b, 0xb53c, 0x080c, 0x0d7d, 0x00c0, 0x2001,
+	0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0, 0x2001, 0x0005, 0x00b8,
+	0x2001, 0x0001, 0x00a0, 0x2001, 0x0009, 0x0088, 0x6003, 0x0005,
+	0x080c, 0x96a0, 0x0058, 0x0018, 0x0010, 0x080c, 0x6575, 0x04b8,
+	0x080c, 0xcf6a, 0x6003, 0x0004, 0x080c, 0x96a0, 0x0005, 0x080c,
+	0x6575, 0x6003, 0x0002, 0x0036, 0x2019, 0x1852, 0x2304, 0x9084,
+	0xff00, 0x1120, 0x2001, 0x1986, 0x201c, 0x0040, 0x8007, 0x909a,
+	0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x003e,
+	0x080c, 0x96a0, 0x0c18, 0x080c, 0xccc4, 0x080c, 0xabed, 0x08f0,
+	0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x35a5,
+	0x00fe, 0x00ee, 0x080c, 0x95de, 0x080c, 0xabed, 0x0878, 0x6003,
+	0x0002, 0x080c, 0xcf6a, 0x0804, 0x96a0, 0x2600, 0x2008, 0x0002,
+	0xb5ac, 0xb58f, 0xb5aa, 0xb58f, 0xb58f, 0xb5aa, 0xb5aa, 0xb5aa,
+	0xb5aa, 0xb58f, 0xb5aa, 0xb58f, 0xb5aa, 0xb58f, 0xb5aa, 0xb5aa,
+	0xb5aa, 0xb5aa, 0x080c, 0x0d7d, 0x0096, 0x6014, 0x2048, 0x080c,
+	0x6d80, 0x009e, 0x080c, 0xabed, 0x0005, 0x00e6, 0x0096, 0x0026,
+	0x0016, 0x080c, 0xc838, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086,
+	0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x547b,
+	0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001,
+	0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xce31, 0x0090, 0xa868,
+	0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021,
+	0x0168, 0x908e, 0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833,
+	0x0100, 0x001e, 0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009,
+	0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103,
+	0xa823, 0x8001, 0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804,
+	0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0d7d, 0x6604, 0x96b6,
+	0x004d, 0x1120, 0x080c, 0xcd50, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x0043, 0x1120, 0x080c, 0xcd99, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x004b, 0x1120, 0x080c, 0xcdc5, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x0033, 0x1120, 0x080c, 0xcce6, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x0028, 0x1120, 0x080c, 0xca86, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x0029, 0x1120, 0x080c, 0xcac7, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x001f, 0x1120, 0x080c, 0xafd2, 0x0804, 0xb681, 0x6604, 0x96b6,
+	0x0000, 0x1118, 0x080c, 0xb319, 0x04e0, 0x6604, 0x96b6, 0x0022,
+	0x1118, 0x080c, 0xb00a, 0x04a8, 0x6604, 0x96b6, 0x0035, 0x1118,
+	0x080c, 0xb130, 0x0470, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c,
+	0xb2ae, 0x0438, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xb042,
+	0x0400, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xb07e, 0x00c8,
+	0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xb0bf, 0x0090, 0x6604,
+	0x96b6, 0x0041, 0x1118, 0x080c, 0xb0a9, 0x0058, 0x91b6, 0x0015,
+	0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804,
+	0xb8db, 0x00be, 0x0005, 0x080c, 0xaca9, 0x0cd8, 0xb69e, 0xb6a1,
+	0xb69e, 0xb6e8, 0xb69e, 0xb84f, 0xb8e8, 0xb69e, 0xb69e, 0xb8b1,
+	0xb69e, 0xb8c7, 0x0096, 0x601f, 0x0000, 0x6014, 0x2048, 0xa800,
+	0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0xabed, 0xa001, 0xa001,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x7090, 0x9086, 0x0074, 0x1540,
+	0x080c, 0xdfbc, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c,
+	0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9, 0x00be,
+	0x2001, 0x0006, 0x080c, 0x6575, 0x080c, 0x321c, 0x080c, 0xabed,
+	0x0098, 0x2001, 0x000a, 0x080c, 0x6575, 0x080c, 0x321c, 0x6003,
+	0x0001, 0x6007, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0020,
+	0x2001, 0x0001, 0x080c, 0xb81f, 0x00ee, 0x0005, 0x00d6, 0xb800,
+	0xd084, 0x0160, 0x9006, 0x080c, 0x6561, 0x2069, 0x1847, 0x6804,
+	0xd0a4, 0x0120, 0x2001, 0x0006, 0x080c, 0x65a1, 0x00de, 0x0005,
+	0x00b6, 0x0096, 0x00d6, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074,
+	0x1904, 0xb7f6, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120,
+	0x080c, 0xba35, 0x0804, 0xb75a, 0x080c, 0xba2a, 0x6010, 0x2058,
+	0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000,
+	0x900e, 0x2011, 0x4000, 0x080c, 0xce31, 0x0030, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x6575,
+	0x080c, 0x321c, 0x080c, 0xabed, 0x0804, 0xb7f9, 0x080c, 0xb807,
+	0x6014, 0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e,
+	0x2011, 0x4000, 0x080c, 0xce31, 0x08f8, 0x080c, 0xb7fd, 0x0160,
+	0x9006, 0x080c, 0x6561, 0x2001, 0x0004, 0x080c, 0x65a1, 0x2001,
+	0x0007, 0x080c, 0x6575, 0x08a0, 0x2001, 0x0004, 0x080c, 0x6575,
+	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x9225, 0x080c, 0x96a0,
+	0x0804, 0xb7f9, 0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcc5e, 0x080c,
+	0x74e9, 0x0118, 0xd0dc, 0x1904, 0xb71c, 0x2011, 0x1837, 0x2204,
+	0xc0ad, 0x2012, 0x2001, 0x196d, 0x2004, 0x00f6, 0x2079, 0x0100,
+	0x78e3, 0x0000, 0x080c, 0x266f, 0x78e2, 0x00fe, 0x0804, 0xb71c,
+	0x080c, 0xcc9f, 0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012, 0x0006,
+	0x080c, 0xe14c, 0x000e, 0x1904, 0xb71c, 0xc0b5, 0x2012, 0x2001,
+	0x0006, 0x080c, 0x6575, 0x9006, 0x080c, 0x6561, 0x00c6, 0x2001,
+	0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6,
+	0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e, 0x7010,
+	0x78ea, 0x7082, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e,
+	0x00fe, 0x080c, 0x2644, 0x00f6, 0x2100, 0x900e, 0x080c, 0x25fb,
+	0x795e, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8,
+	0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936,
+	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2644, 0x00f6, 0x2079,
+	0x1800, 0x7982, 0x2100, 0x900e, 0x080c, 0x25fb, 0x795e, 0x00fe,
+	0x8108, 0x080c, 0x65c4, 0x2b00, 0x00ce, 0x1904, 0xb71c, 0x6012,
+	0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c,
+	0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001,
+	0x0002, 0x080c, 0x6575, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0018, 0x2001, 0x0001,
+	0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004,
+	0xd0a4, 0x0120, 0x2001, 0x1848, 0x2004, 0xd0ac, 0x0005, 0x00e6,
+	0x080c, 0xe689, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c,
+	0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0,
+	0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005, 0x2030,
+	0x9005, 0x0158, 0x2001, 0x0007, 0x080c, 0x6575, 0x080c, 0x56ee,
+	0x1120, 0x2001, 0x0007, 0x080c, 0x65a1, 0x2600, 0x9005, 0x11b0,
+	0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc, 0x1178, 0x0036,
+	0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
+	0x2011, 0x8014, 0x080c, 0x4b07, 0x004e, 0x003e, 0x080c, 0x321c,
+	0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0xabed, 0x00b6,
+	0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x7090, 0x9086, 0x0014,
+	0x1904, 0xb8a7, 0x080c, 0x56ee, 0x1170, 0x6014, 0x9005, 0x1158,
+	0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c,
+	0x4cbe, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x66c0,
+	0x080c, 0xb6d6, 0x00de, 0x080c, 0xbafb, 0x1588, 0x6010, 0x2058,
+	0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x6575, 0x0096,
+	0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xce31,
+	0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807,
+	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x321c,
+	0x6020, 0x9086, 0x000a, 0x0140, 0x080c, 0xabed, 0x0028, 0x080c,
+	0xb5b5, 0x9006, 0x080c, 0xb81f, 0x001e, 0x002e, 0x00ee, 0x00be,
+	0x0005, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001,
+	0x0002, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x9225, 0x0804, 0x96a0, 0x2001, 0x0001, 0x0804, 0xb81f, 0x2030,
+	0x2011, 0x1824, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b,
+	0x1120, 0x2001, 0x0007, 0x080c, 0x6575, 0x0804, 0xabed, 0x2001,
+	0x0001, 0x0804, 0xb81f, 0x0002, 0xb69e, 0xb8f3, 0xb69e, 0xb934,
+	0xb69e, 0xb9e1, 0xb8e8, 0xb69e, 0xb69e, 0xb9f5, 0xb69e, 0xba07,
+	0x6604, 0x9686, 0x0003, 0x0904, 0xb84f, 0x96b6, 0x001e, 0x1110,
+	0x080c, 0xabed, 0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xba19,
+	0x11a0, 0x9006, 0x080c, 0x6561, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x2001, 0x0002, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x9225, 0x080c, 0x96a0, 0x0418, 0x2009, 0x026e, 0x2104,
+	0x9086, 0x0009, 0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0170, 0x8001, 0xb842, 0x601b, 0x000a, 0x0088, 0x2009,
+	0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0,
+	0x080c, 0x31e7, 0x080c, 0xcf67, 0x2001, 0x0001, 0x080c, 0xb81f,
+	0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016,
+	0x080c, 0xba27, 0x00d6, 0x2069, 0x197c, 0x2d04, 0x9005, 0x0168,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x1820,
+	0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006,
+	0x080c, 0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0804, 0xb9b1,
+	0x080c, 0xc838, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086,
+	0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xce8b,
+	0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001,
+	0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c,
+	0xb5b5, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005,
+	0x0520, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084,
+	0xff00, 0x1118, 0x9686, 0x0009, 0x01c0, 0x9086, 0x1900, 0x1168,
+	0x9686, 0x0009, 0x0190, 0x2001, 0x0004, 0x080c, 0x6575, 0x2001,
+	0x0028, 0x601a, 0x6007, 0x0052, 0x0020, 0x2001, 0x0001, 0x080c,
+	0xb81f, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160,
+	0x6014, 0x2048, 0x080c, 0xc838, 0x0140, 0xa864, 0x9086, 0x0139,
+	0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c40, 0x6010, 0x2058, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a,
+	0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5fbc, 0x00ee, 0x0010, 0x080c, 0x31e7,
+	0x0860, 0x080c, 0xba27, 0x1160, 0x2001, 0x0004, 0x080c, 0x6575,
+	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x9225, 0x0804, 0x96a0,
+	0x080c, 0xb5b5, 0x9006, 0x0804, 0xb81f, 0x0489, 0x1160, 0x2001,
+	0x0008, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c,
+	0x9225, 0x0804, 0x96a0, 0x2001, 0x0001, 0x0804, 0xb81f, 0x00f9,
+	0x1160, 0x2001, 0x000a, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x9225, 0x0804, 0x96a0, 0x2001, 0x0001, 0x0804,
+	0xb81f, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009,
+	0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085,
+	0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c,
+	0x6634, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6,
+	0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009, 0x1837, 0x2104,
+	0x9085, 0x0003, 0x200a, 0x080c, 0xbacd, 0x0560, 0x2009, 0x1837,
+	0x2104, 0xc0cd, 0x200a, 0x080c, 0x6a67, 0x0158, 0x9006, 0x2020,
+	0x2009, 0x002a, 0x080c, 0xe2c9, 0x2001, 0x180c, 0x200c, 0xc195,
+	0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c, 0x31a6, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x2fb2, 0x00ee, 0x00c6, 0x0156, 0x20a9,
+	0x0781, 0x2009, 0x007f, 0x080c, 0x32fc, 0x8108, 0x1f04, 0xba6b,
+	0x015e, 0x00ce, 0x080c, 0xba2a, 0x2071, 0x0260, 0x2079, 0x0200,
+	0x7817, 0x0001, 0x2001, 0x1837, 0x200c, 0xc1c5, 0x7018, 0xd0fc,
+	0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817,
+	0x0000, 0x2001, 0x1837, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084,
+	0x00ff, 0x2069, 0x181f, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04,
+	0x2069, 0x1820, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084,
+	0xff00, 0x001e, 0x9105, 0x2009, 0x182c, 0x200a, 0x2200, 0x9084,
+	0x00ff, 0x2008, 0x080c, 0x2644, 0x080c, 0x74e9, 0x0170, 0x2071,
+	0x0260, 0x2069, 0x1982, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050,
+	0x680a, 0x7054, 0x680e, 0x080c, 0xcc5e, 0x0040, 0x2001, 0x0006,
+	0x080c, 0x6575, 0x080c, 0x321c, 0x080c, 0xabed, 0x001e, 0x003e,
+	0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036,
+	0x00e6, 0x0156, 0x2019, 0x182c, 0x231c, 0x83ff, 0x01f0, 0x2071,
+	0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205,
+	0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019,
+	0x000a, 0x080c, 0xbbc2, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004,
+	0x2019, 0x0006, 0x080c, 0xbbc2, 0x1100, 0x015e, 0x00ee, 0x003e,
+	0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9086,
+	0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec,
+	0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4,
+	0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ee,
+	0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19f3, 0x252c, 0x2021,
+	0x19fa, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7254, 0x7074,
+	0x9202, 0x1a04, 0xbb8e, 0x080c, 0x8b90, 0x0904, 0xbb87, 0x080c,
+	0xe2fa, 0x0904, 0xbb87, 0x6720, 0x9786, 0x0007, 0x0904, 0xbb87,
+	0x2500, 0x9c06, 0x0904, 0xbb87, 0x2400, 0x9c06, 0x0904, 0xbb87,
+	0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1590, 0x00c6, 0x6043, 0xffff,
+	0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x1a6a, 0x9786, 0x000a,
+	0x0148, 0x080c, 0xca4d, 0x1130, 0x00ce, 0x080c, 0xb5b5, 0x080c,
+	0xac28, 0x00e8, 0x6014, 0x2048, 0x080c, 0xc838, 0x01a8, 0x9786,
+	0x0003, 0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6d74, 0x080c, 0xca27, 0x080c, 0xac28, 0x00ce, 0x9ce0,
+	0x001c, 0x7068, 0x9c02, 0x1210, 0x0804, 0xbb2e, 0x012e, 0x000e,
+	0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005,
+	0x9786, 0x0006, 0x1118, 0x080c, 0xe26c, 0x0c30, 0x9786, 0x0009,
+	0x1148, 0x6000, 0x9086, 0x0004, 0x0d08, 0x2009, 0x004c, 0x080c,
+	0xac8c, 0x08e0, 0x9786, 0x000a, 0x0938, 0x0820, 0x220c, 0x2304,
+	0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbbae, 0x9006, 0x0005,
+	0x2304, 0x9102, 0x0218, 0x2001, 0x0001, 0x0008, 0x9006, 0x918d,
+	0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x8906, 0x8006, 0x8007,
+	0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9300, 0x2098, 0x3518,
+	0x20a9, 0x0001, 0x220c, 0x4002, 0x910e, 0x1140, 0x8210, 0x8319,
+	0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x9102,
+	0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0x918d, 0x0001,
+	0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x810f, 0x2304, 0x9106,
+	0x1130, 0x8210, 0x8318, 0x1f04, 0xbbec, 0x9006, 0x0005, 0x918d,
+	0x0001, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x080c,
+	0xca3c, 0x0120, 0x080c, 0xca4d, 0x0158, 0x0028, 0x080c, 0x321c,
+	0x080c, 0xca4d, 0x0128, 0x080c, 0x95de, 0x080c, 0xabed, 0x0005,
+	0x080c, 0xb5b5, 0x0cc0, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc32,
+	0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc34, 0xbc34,
+	0xbc34, 0xbc34, 0xbc32, 0xbc32, 0xbc32, 0xbc34, 0xbc32, 0xbc32,
+	0xbc32, 0xbc32, 0x080c, 0x0d7d, 0x600b, 0xffff, 0x6003, 0x000f,
+	0x6106, 0x0126, 0x2091, 0x8000, 0x080c, 0xcf6a, 0x2009, 0x8000,
+	0x080c, 0x921e, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
+	0x9082, 0x0040, 0x0804, 0xbcb9, 0x9186, 0x0027, 0x1520, 0x080c,
+	0x95de, 0x080c, 0x31e7, 0x080c, 0xcf67, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xc838, 0x0198, 0x080c, 0xca4d, 0x1118, 0x080c, 0xb5b5,
+	0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c,
+	0xc1c5, 0xa97e, 0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c,
+	0xabed, 0x0804, 0x96a0, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082,
+	0x0040, 0x0018, 0x080c, 0x0d7d, 0x0005, 0x0002, 0xbc97, 0xbc95,
+	0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95,
+	0xbc95, 0xbcb0, 0xbcb0, 0xbcb0, 0xbcb0, 0xbc95, 0xbcb0, 0xbc95,
+	0xbcb0, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0x080c, 0x0d7d, 0x080c,
+	0x95de, 0x0096, 0x6114, 0x2148, 0x080c, 0xc838, 0x0168, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882,
+	0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c, 0xabed, 0x0005,
+	0x080c, 0x95de, 0x080c, 0xca4d, 0x090c, 0xb5b5, 0x080c, 0xabed,
+	0x0005, 0x0002, 0xbcd3, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1,
+	0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd5, 0xbcd5, 0xbcd5,
+	0xbcd5, 0xbcd1, 0xbcd7, 0xbcd1, 0xbcd5, 0xbcd1, 0xbcd1, 0xbcd1,
+	0xbcd1, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x080c,
+	0xabed, 0x0804, 0x96a0, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa,
+	0xbd33, 0xbe22, 0xbcfa, 0xbe2e, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa,
+	0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbe2e, 0xbcfc,
+	0xbcfa, 0xbe2c, 0x080c, 0x0d7d, 0x00b6, 0x0096, 0x6114, 0x2148,
+	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1508, 0xa87b, 0x0000, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xbeb3, 0x080c, 0x6b96, 0x6210, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005, 0x0110, 0x080c,
+	0x6750, 0x080c, 0xabed, 0x009e, 0x00be, 0x0005, 0xa87c, 0xd0ac,
+	0x09e0, 0xa838, 0xa934, 0x9105, 0x09c0, 0xa880, 0xd0bc, 0x19a8,
+	0x080c, 0xcb7d, 0x0c80, 0x00b6, 0x0096, 0x6114, 0x2148, 0x601c,
+	0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0x96b4, 0x0fff, 0x86ff,
+	0x1590, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbe11, 0xa87b,
+	0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xbeb3, 0x080c, 0x6b96, 0x6210, 0x2258,
+	0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005, 0x0110,
+	0x080c, 0x6750, 0x601c, 0xd0fc, 0x1148, 0x7044, 0xd0e4, 0x1904,
+	0xbdf5, 0x080c, 0xabed, 0x009e, 0x00be, 0x0005, 0x2009, 0x0211,
+	0x210c, 0x080c, 0x0d7d, 0x968c, 0x0c00, 0x0150, 0x6010, 0x2058,
+	0xb800, 0xd0bc, 0x1904, 0xbdf9, 0x7348, 0xab92, 0x734c, 0xab8e,
+	0x968c, 0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, 0x0028, 0x1118,
+	0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c,
+	0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0148, 0x7048,
+	0x9106, 0x1118, 0x704c, 0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc,
+	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
+	0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100,
+	0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, 0xbd3f, 0x735c,
+	0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008,
+	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc40b,
+	0x003e, 0xd6cc, 0x0904, 0xbd54, 0x7154, 0xa98a, 0x81ff, 0x0904,
+	0xbd54, 0x9192, 0x0021, 0x1278, 0x8304, 0x9098, 0x0018, 0x2011,
+	0x0029, 0x080c, 0xc40b, 0x2011, 0x0205, 0x2013, 0x0000, 0x080c,
+	0xcef7, 0x0804, 0xbd54, 0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020,
+	0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c, 0xc3aa, 0x00ae, 0x080c,
+	0xcef7, 0x080c, 0xc3fb, 0x0804, 0xbd56, 0x080c, 0xcb40, 0x0804,
+	0xbd6b, 0xa87c, 0xd0ac, 0x0904, 0xbd7c, 0xa880, 0xd0bc, 0x1904,
+	0xbd7c, 0x7348, 0xa838, 0x9306, 0x11c8, 0x734c, 0xa834, 0x931e,
+	0x0904, 0xbd7c, 0xd6d4, 0x0190, 0xab38, 0x9305, 0x0904, 0xbd7c,
+	0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbd47, 0xa838, 0xa934, 0x9105,
+	0x0904, 0xbd47, 0xa880, 0xd0bc, 0x1904, 0xbd47, 0x080c, 0xcb7d,
+	0x0804, 0xbd6b, 0x00f6, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c,
+	0x7d08, 0x00fe, 0x0021, 0x0005, 0x0011, 0x0005, 0x0005, 0x0096,
+	0x6003, 0x0002, 0x6007, 0x0043, 0x6014, 0x2048, 0xa87c, 0xd0ac,
+	0x0128, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac,
+	0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203,
+	0x0e90, 0xac46, 0xab4a, 0xae36, 0xad3a, 0x6044, 0xd0fc, 0x190c,
+	0xa8bf, 0x604b, 0x0000, 0x080c, 0x1c30, 0x1118, 0x6144, 0x080c,
+	0x924a, 0x009e, 0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a,
+	0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7c, 0xbe7a, 0xbe7a,
+	0xbe7a, 0xbe7a, 0xbe8d, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbeb1,
+	0xbe7a, 0xbe7a, 0x080c, 0x0d7d, 0x6004, 0x9086, 0x0040, 0x1110,
+	0x080c, 0x95de, 0x2019, 0x0001, 0x080c, 0xa118, 0x6003, 0x0002,
+	0x080c, 0xcf6f, 0x080c, 0x963b, 0x0005, 0x6004, 0x9086, 0x0040,
+	0x1110, 0x080c, 0x95de, 0x2019, 0x0001, 0x080c, 0xa118, 0x080c,
+	0x963b, 0x080c, 0x31e7, 0x080c, 0xcf67, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xc838, 0x0150, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
+	0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c, 0xabed,
+	0x0005, 0x080c, 0x0d7d, 0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b,
+	0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x0006, 0x0016,
+	0x2009, 0x1a78, 0x2104, 0x8000, 0x200a, 0x001e, 0x000e, 0xa992,
+	0xa88e, 0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbeeb,
+	0xbee9, 0xbee9, 0xbfa8, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbee9,
+	0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xc0ec, 0xbee9, 0xc0f6,
+	0xbee9, 0x080c, 0x0d7d, 0x601c, 0xd0bc, 0x0178, 0xd084, 0x0168,
+	0xd0f4, 0x0120, 0xc084, 0x601e, 0x0804, 0xbcdb, 0x6114, 0x0096,
+	0x2148, 0xa87c, 0xc0e5, 0xa87e, 0x009e, 0x0076, 0x00a6, 0x00e6,
+	0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x601c, 0xd0fc, 0x1110,
+	0x7644, 0x0008, 0x9036, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5,
+	0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
+	0xba3e, 0x00be, 0x86ff, 0x0904, 0xbfa1, 0x9694, 0xff00, 0x9284,
+	0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300,
+	0x0904, 0xbfa1, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
+	0xc6c4, 0xb676, 0x0c38, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x2900,
+	0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068,
+	0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000,
+	0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c,
+	0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028,
+	0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015,
+	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
+	0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190,
+	0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019,
+	0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c,
+	0xc40b, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8,
+	0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
+	0x080c, 0xc40b, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068,
+	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c,
+	0xc3aa, 0x080c, 0x1a48, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005,
+	0x2001, 0x1988, 0x2004, 0x604a, 0x0096, 0x6114, 0x2148, 0xa83c,
+	0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002,
+	0x080c, 0xcf78, 0x0904, 0xc0e7, 0x604b, 0x0000, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xc0a6,
+	0xa978, 0xa868, 0xd0fc, 0x0904, 0xc067, 0x0016, 0xa87c, 0x0006,
+	0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6,
+	0x0002, 0x0904, 0xc035, 0x9086, 0x0028, 0x1904, 0xc021, 0xa87b,
+	0x001c, 0xb07b, 0x001c, 0x0804, 0xc03d, 0x6024, 0xd0f4, 0x11d0,
+	0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120,
+	0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac,
+	0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024,
+	0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e,
+	0x00be, 0x601c, 0xc0fc, 0x601e, 0x9006, 0xa876, 0xa892, 0xa88e,
+	0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0x080c, 0xcb7d, 0x0804,
+	0xc0e7, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c,
+	0xce1a, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128,
+	0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xbeb3, 0xa87c, 0xb07e, 0xa890,
+	0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019,
+	0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f,
+	0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae,
+	0x000e, 0xa882, 0x000e, 0xa87e, 0x080c, 0xcef7, 0x001e, 0xa874,
+	0x0006, 0x2148, 0x080c, 0x0fec, 0x001e, 0x0804, 0xc0d3, 0x0016,
+	0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0,
+	0x9086, 0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0,
+	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xce1a,
+	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
+	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xbeb3, 0xa890, 0xb092, 0xa88c, 0xb08e,
+	0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fec, 0x009e, 0x080c, 0xcef7,
+	0xa974, 0x0016, 0x080c, 0xc3fb, 0x001e, 0x0468, 0xa867, 0x0103,
+	0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028,
+	0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015,
+	0x080c, 0xce1a, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4,
+	0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbeb3, 0xa974, 0x0016,
+	0x080c, 0x6b96, 0x001e, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x82ff,
+	0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005, 0x0120, 0x0016, 0x080c,
+	0x6750, 0x001e, 0x00be, 0xd1e4, 0x1120, 0x080c, 0xabed, 0x009e,
+	0x0005, 0x080c, 0xcb40, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c,
+	0x080c, 0xcf78, 0x190c, 0x1a56, 0x009e, 0x0005, 0x0096, 0x6114,
+	0x2148, 0xa83c, 0xa940, 0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b,
+	0x0000, 0xa867, 0x0103, 0x00b6, 0x6010, 0x2058, 0xa834, 0xa938,
+	0x9115, 0x11a0, 0x080c, 0x6b96, 0xba3c, 0x8211, 0x0208, 0xba3e,
+	0xb8d0, 0x9005, 0x0110, 0x080c, 0x6750, 0x080c, 0xabed, 0x00be,
+	0x009e, 0x0005, 0xa87c, 0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc,
+	0x1120, 0xa834, 0x080c, 0xbeb3, 0x0c28, 0xa880, 0xd0bc, 0x1dc8,
+	0x080c, 0xcb7d, 0x0c60, 0x080c, 0x95de, 0x0010, 0x080c, 0x963b,
+	0x601c, 0xd084, 0x0110, 0x080c, 0x1a6a, 0x080c, 0xc838, 0x01f0,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xca4d, 0x1118, 0x080c, 0xb5b5,
+	0x00a0, 0xa867, 0x0103, 0x2009, 0x180c, 0x210c, 0xd18c, 0x1198,
+	0xd184, 0x1170, 0x6108, 0xa97a, 0x918e, 0x0029, 0x1110, 0x080c,
+	0xe621, 0xa877, 0x0000, 0x080c, 0x6d80, 0x009e, 0x0804, 0xac28,
+	0xa87b, 0x0004, 0x0cb0, 0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xc17d, 0xc17d,
+	0xc17d, 0xc17d, 0xc17d, 0xc17f, 0xc17d, 0xc17d, 0xc17d, 0xc17d,
+	0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d,
+	0xc17d, 0xc17d, 0xc1a3, 0xc17d, 0xc17d, 0x080c, 0x0d7d, 0x080c,
+	0x56e2, 0x01f8, 0x6014, 0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4,
+	0x0118, 0x7264, 0x9294, 0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b,
+	0x0000, 0xa864, 0x9086, 0x0139, 0x0128, 0xa867, 0x0103, 0xa976,
+	0xaa96, 0x0030, 0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6d80,
+	0x009e, 0x0804, 0xabed, 0x080c, 0x56e2, 0x0dd8, 0x6014, 0x900e,
+	0x9016, 0x0c10, 0x9182, 0x0085, 0x0002, 0xc1bc, 0xc1ba, 0xc1ba,
+	0xc1c8, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba,
+	0xc1ba, 0xc1ba, 0x080c, 0x0d7d, 0x6003, 0x0001, 0x6106, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x8020, 0x080c, 0x921e, 0x012e, 0x0005,
+	0x0026, 0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216,
+	0x7220, 0x080c, 0xc826, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000,
+	0x0178, 0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c,
+	0xc436, 0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010,
+	0x6007, 0x0087, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e,
+	0x9280, 0x0004, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140,
+	0x6824, 0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c, 0xcb7d, 0x00ce,
+	0x00ee, 0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160,
+	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c,
+	0x0d7d, 0x9082, 0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186,
+	0x0014, 0x190c, 0x0d7d, 0x080c, 0x95de, 0x0096, 0x6014, 0x2048,
+	0x080c, 0xc838, 0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
+	0x0029, 0x080c, 0x6d80, 0x009e, 0x080c, 0xac28, 0x0804, 0x96a0,
+	0xc23d, 0xc23f, 0xc23f, 0xc23d, 0xc23d, 0xc23d, 0xc23d, 0xc23d,
+	0xc23d, 0xc23d, 0xc23d, 0xc23d, 0xc23d, 0x080c, 0x0d7d, 0x080c,
+	0xac28, 0x0005, 0x9186, 0x0013, 0x1130, 0x6004, 0x9082, 0x0085,
+	0x2008, 0x0804, 0xc28e, 0x9186, 0x0027, 0x1558, 0x080c, 0x95de,
+	0x080c, 0x31e7, 0x080c, 0xcf67, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xc838, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
+	0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c, 0xabed, 0x0005,
+	0x9186, 0x0089, 0x0118, 0x9186, 0x008a, 0x1140, 0x080c, 0xaaa8,
+	0x0128, 0x9086, 0x000c, 0x0904, 0xc2c6, 0x0000, 0x080c, 0xaca9,
+	0x0c70, 0x9186, 0x0014, 0x1d60, 0x080c, 0x95de, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xc838, 0x0d00, 0xa867, 0x0103, 0xa877, 0x0000,
+	0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882, 0x0890, 0x0002, 0xc29e,
+	0xc29c, 0xc29c, 0xc29c, 0xc29c, 0xc29c, 0xc2b2, 0xc29c, 0xc29c,
+	0xc29c, 0xc29c, 0xc29c, 0xc29c, 0x080c, 0x0d7d, 0x6034, 0x908c,
 	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
 	0x2001, 0x1986, 0x0010, 0x2001, 0x1987, 0x2004, 0x601a, 0x6003,
-	0x000e, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
-	0x0012, 0x0804, 0xac85, 0xc2b8, 0xc2b8, 0xc2b8, 0xc2b8, 0xc2ba,
-	0xc307, 0xc2b8, 0xc2b8, 0xc2b8, 0xc2b8, 0xc2b8, 0xc2b8, 0xc2b8,
-	0x080c, 0x0d7d, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xc31b, 0x080c,
-	0xc814, 0x1118, 0x080c, 0xca03, 0x0068, 0x6014, 0x2048, 0x080c,
-	0xcf5a, 0x1110, 0x080c, 0xca03, 0xa867, 0x0103, 0x080c, 0xcf0e,
-	0x080c, 0x6d70, 0x00d6, 0x2c68, 0x080c, 0xab73, 0x01d0, 0x6003,
-	0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c,
-	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c,
-	0xcca8, 0x695c, 0x615e, 0x6023, 0x0001, 0x2009, 0x8020, 0x080c,
-	0x91ed, 0x2d60, 0x00de, 0x080c, 0xabc9, 0x009e, 0x0005, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, 0x0118,
-	0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xcea6, 0x11f0,
-	0x080c, 0xab73, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001,
-	0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c,
-	0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x695c, 0x615e,
-	0x080c, 0xcca8, 0x2009, 0x8020, 0x080c, 0x91ed, 0x2d60, 0x00de,
-	0x0804, 0xabc9, 0x0096, 0x6014, 0x2048, 0x080c, 0xc814, 0x01c8,
-	0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b,
-	0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
-	0x0005, 0x080c, 0xcb18, 0xa877, 0x0000, 0x080c, 0x6d70, 0x080c,
-	0xca03, 0x009e, 0x0804, 0xabc9, 0x0016, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xc814, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877,
-	0x0000, 0x080c, 0x6d70, 0x009e, 0x001e, 0x9186, 0x0013, 0x0158,
-	0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xac85,
-	0x0020, 0x080c, 0x95ad, 0x080c, 0xac04, 0x0005, 0x0056, 0x0066,
-	0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208, 0x0010,
-	0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009, 0x0020,
-	0x2011, 0x0029, 0x080c, 0xc3e7, 0x96b2, 0x0020, 0xb004, 0x904d,
-	0x0110, 0x080c, 0x0fec, 0x080c, 0x103a, 0x0520, 0x8528, 0xa867,
-	0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1228,
-	0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c, 0x2009,
-	0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001, 0x0205,
-	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x95ac,
-	0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
-	0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005, 0x00a6,
-	0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000, 0x080c,
-	0x6d70, 0x2a48, 0x0cb8, 0x080c, 0x6d70, 0x00ae, 0x0005, 0x00f6,
-	0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184, 0x0108,
-	0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c, 0x9200,
-	0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003, 0x8318,
-	0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098, 0x7814,
-	0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817, 0x0000,
-	0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031, 0x0001,
-	0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084, 0x000f,
-	0x001b, 0x006e, 0x012e, 0x0005, 0xc464, 0xc464, 0xc45f, 0xc488,
-	0xc43c, 0xc45f, 0xc43e, 0xc45f, 0xc43c, 0x90b3, 0xc45f, 0xc45f,
-	0xc45f, 0xc43c, 0xc43c, 0xc43c, 0x080c, 0x0d7d, 0x6010, 0x9080,
-	0x0000, 0x2004, 0xd0bc, 0x190c, 0xc488, 0x0036, 0x6014, 0x0096,
-	0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118, 0x2019, 0x000c, 0x0038,
-	0xd094, 0x0118, 0x2019, 0x000d, 0x0010, 0x2019, 0x0010, 0x080c,
-	0xddf2, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x9006,
-	0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11e8, 0x6014,
-	0x2048, 0x080c, 0xc814, 0x01d0, 0x6043, 0xffff, 0xa864, 0x9086,
-	0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e,
-	0x2001, 0x0005, 0x080c, 0x6fb0, 0x080c, 0xcb18, 0x080c, 0x6d64,
-	0x080c, 0xac04, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0,
-	0x080c, 0xa872, 0x080c, 0xcf68, 0x6000, 0x908a, 0x0016, 0x1a0c,
-	0x0d7d, 0x002b, 0x0106, 0x080c, 0xa88e, 0x010e, 0x0005, 0xc4a7,
-	0xc4d5, 0xc4a9, 0xc4fc, 0xc4d0, 0xc4a7, 0xc45f, 0xc464, 0xc464,
-	0xc45f, 0xc45f, 0xc45f, 0xc45f, 0xc45f, 0xc45f, 0xc45f, 0x080c,
-	0x0d7d, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096,
-	0x6014, 0x2048, 0x080c, 0xc814, 0x0158, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0x080c, 0xcb18,
-	0x009e, 0x080c, 0xcee8, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0002, 0x2009, 0x8020, 0x080c, 0x91cf, 0x9085, 0x0001, 0x0005,
-	0x0066, 0x080c, 0x1a6a, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19e7,
-	0x7030, 0x9c06, 0x1120, 0x080c, 0xa074, 0x00ee, 0x0850, 0x6020,
-	0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049,
-	0x0001, 0x2c40, 0x080c, 0xa1f4, 0x009e, 0x008e, 0x0040, 0x0066,
-	0x080c, 0x9f70, 0x190c, 0x0d7d, 0x080c, 0x9f7e, 0x006e, 0x00ee,
-	0x1904, 0xc4a9, 0x0804, 0xc45f, 0x0036, 0x00e6, 0x2071, 0x19e7,
-	0x704c, 0x9c06, 0x1138, 0x901e, 0x080c, 0xa0f4, 0x00ee, 0x003e,
-	0x0804, 0xc4a9, 0x080c, 0xa32a, 0x00ee, 0x003e, 0x1904, 0xc4a9,
-	0x0804, 0xc45f, 0x00c6, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b,
-	0x006e, 0x00ce, 0x0005, 0xc532, 0xc5f4, 0xc75b, 0xc53a, 0xac04,
-	0xc532, 0xdde4, 0xcf50, 0xc5f4, 0x907a, 0xc7da, 0xc52b, 0xc52b,
-	0xc52b, 0xc52b, 0xc52b, 0x080c, 0x0d7d, 0x080c, 0xca29, 0x1110,
-	0x080c, 0xb591, 0x0005, 0x080c, 0x95ad, 0x0804, 0xabc9, 0x601b,
-	0x0001, 0x0005, 0x080c, 0xc814, 0x0130, 0x6014, 0x0096, 0x2048,
-	0x2c00, 0xa896, 0x009e, 0x080c, 0xa872, 0x080c, 0xcf68, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x0804, 0xa88e, 0xc55f,
-	0xc561, 0xc58b, 0xc59f, 0xc5ca, 0xc55f, 0xc532, 0xc532, 0xc532,
-	0xc5a6, 0xc5a6, 0xc55f, 0xc55f, 0xc55f, 0xc55f, 0xc5b0, 0x080c,
-	0x0d7d, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5, 0xa882,
-	0x009e, 0x2071, 0x19e7, 0x7030, 0x9c06, 0x01d0, 0x0066, 0x080c,
-	0x9f70, 0x190c, 0x0d7d, 0x080c, 0x9f7e, 0x006e, 0x080c, 0xcee8,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1987,
-	0x2004, 0x601a, 0x2009, 0x8020, 0x080c, 0x91cf, 0x00ee, 0x0005,
-	0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5,
-	0xa882, 0x009e, 0x080c, 0xcee8, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x91cf, 0x0005, 0x080c,
-	0xa872, 0x080c, 0xaa06, 0x080c, 0xa88e, 0x0c28, 0x0096, 0x601b,
-	0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005,
-	0x080c, 0x56db, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864,
-	0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867,
-	0x0139, 0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x6d70, 0x009e,
-	0x0804, 0xabc9, 0x6014, 0x0096, 0x904d, 0x0508, 0x080c, 0xcf54,
-	0x01f0, 0x080c, 0xa88e, 0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110,
-	0x009e, 0x0005, 0xa884, 0x009e, 0x8003, 0x800b, 0x810b, 0x9108,
-	0x611a, 0x2001, 0x0037, 0x2c08, 0x080c, 0x1679, 0x6000, 0x9086,
-	0x0004, 0x1120, 0x2009, 0x0048, 0x080c, 0xac68, 0x0005, 0x009e,
-	0x080c, 0x1a6a, 0x0804, 0xc58b, 0x6000, 0x908a, 0x0016, 0x1a0c,
-	0x0d7d, 0x000b, 0x0005, 0xc60b, 0xc537, 0xc60d, 0xc60b, 0xc60d,
-	0xc60d, 0xc533, 0xc60b, 0xc52d, 0xc52d, 0xc60b, 0xc60b, 0xc60b,
-	0xc60b, 0xc60b, 0xc60b, 0x080c, 0x0d7d, 0x6010, 0x00b6, 0x2058,
-	0xb804, 0x9084, 0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0d7d,
-	0x00b6, 0x0013, 0x00be, 0x0005, 0xc628, 0xc6f5, 0xc62a, 0xc66a,
-	0xc62a, 0xc66a, 0xc62a, 0xc638, 0xc628, 0xc66a, 0xc628, 0xc659,
-	0x080c, 0x0d7d, 0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004,
-	0x05a8, 0x908e, 0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xc6f1,
-	0x6004, 0x080c, 0xca29, 0x0904, 0xc70e, 0x908e, 0x0004, 0x1110,
-	0x080c, 0x3215, 0x908e, 0x0021, 0x0904, 0xc712, 0x908e, 0x0022,
-	0x0904, 0xc756, 0x908e, 0x003d, 0x0904, 0xc712, 0x908e, 0x0039,
-	0x0904, 0xc716, 0x908e, 0x0035, 0x0904, 0xc716, 0x908e, 0x001e,
-	0x0178, 0x908e, 0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x0110, 0x080c, 0x31e4, 0x080c, 0xb591,
-	0x0804, 0xac04, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904,
-	0xc6e2, 0x9186, 0x0002, 0x1904, 0xc6b7, 0x2001, 0x1837, 0x2004,
-	0xd08c, 0x11c8, 0x080c, 0x74d5, 0x11b0, 0x080c, 0xcf2e, 0x0138,
-	0x080c, 0x74f8, 0x1120, 0x080c, 0x73e0, 0x0804, 0xc73f, 0x2001,
-	0x197d, 0x2003, 0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c,
-	0x7406, 0x0804, 0xc73f, 0x6010, 0x2058, 0x2001, 0x1837, 0x2004,
-	0xd0ac, 0x1904, 0xc73f, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xc73f,
-	0xb840, 0x9084, 0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017,
-	0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x080c,
-	0xab73, 0x0128, 0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de,
-	0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0,
-	0x9086, 0x007e, 0x1170, 0x2009, 0x1837, 0x2104, 0xc085, 0x200a,
-	0x00e6, 0x2071, 0x1800, 0x080c, 0x5fb5, 0x00ee, 0x080c, 0xb591,
-	0x0030, 0x080c, 0xb591, 0x080c, 0x31e4, 0x080c, 0xcf43, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x3215, 0x012e, 0x00ee, 0x080c,
-	0xac04, 0x0005, 0x2001, 0x0002, 0x080c, 0x656e, 0x6003, 0x0001,
-	0x6007, 0x0002, 0x080c, 0x91f4, 0x080c, 0x966f, 0x00de, 0x00ce,
-	0x0c80, 0x080c, 0x3215, 0x0804, 0xc666, 0x00c6, 0x00d6, 0x6104,
-	0x9186, 0x0016, 0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
-	0x9005, 0x0904, 0xc6b7, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c,
-	0x91f4, 0x080c, 0x966f, 0x00de, 0x00ce, 0x0898, 0x080c, 0xb591,
-	0x0804, 0xc668, 0x080c, 0xb5cd, 0x0804, 0xc668, 0x00d6, 0x2c68,
-	0x6104, 0x080c, 0xcea6, 0x00de, 0x0118, 0x080c, 0xabc9, 0x00f0,
-	0x6004, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001,
-	0x1987, 0x2004, 0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5,
-	0x6026, 0x2160, 0x2009, 0x8020, 0x080c, 0x91ed, 0x0005, 0x00de,
-	0x00ce, 0x080c, 0xb591, 0x080c, 0x31e4, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x3215, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b,
-	0x0398, 0x604b, 0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xb005,
-	0x1904, 0xc70e, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d,
-	0x0096, 0x00d6, 0x001b, 0x00de, 0x009e, 0x0005, 0xc776, 0xc776,
-	0xc776, 0xc776, 0xc776, 0xc776, 0xc776, 0xc776, 0xc776, 0xc532,
-	0xc776, 0xc537, 0xc778, 0xc537, 0xc785, 0xc776, 0x080c, 0x0d7d,
-	0x6004, 0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d,
-	0x2009, 0x8020, 0x080c, 0x91ed, 0x0005, 0x080c, 0xcf22, 0x0118,
-	0x080c, 0xcf35, 0x0010, 0x080c, 0xcf43, 0x080c, 0xca03, 0x080c,
-	0xc814, 0x0570, 0x080c, 0x31e4, 0x080c, 0xc814, 0x0168, 0x6014,
-	0x2048, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880,
-	0xc0ed, 0xa882, 0x080c, 0x6d70, 0x2c68, 0x080c, 0xab73, 0x0150,
-	0x6810, 0x6012, 0x080c, 0xcca8, 0x00c6, 0x2d60, 0x080c, 0xac04,
-	0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007,
-	0x0001, 0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x00c8,
-	0x080c, 0xcf22, 0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c,
-	0x31e4, 0x08d0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x080c, 0x31e4, 0x0868, 0x080c,
-	0xac04, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0002,
-	0xc7f0, 0xc7f0, 0xc7f2, 0xc7f2, 0xc7f2, 0xc7f0, 0xc7f0, 0xac04,
-	0xc7f0, 0xc7f0, 0xc7f0, 0xc7f0, 0xc7f0, 0xc7f0, 0xc7f0, 0xc7f0,
-	0x080c, 0x0d7d, 0x080c, 0xa872, 0x080c, 0xaa06, 0x080c, 0xa88e,
-	0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6d70, 0x009e,
-	0x0804, 0xabc9, 0x9284, 0x0003, 0x1158, 0x9282, 0x1ddc, 0x0240,
-	0x2001, 0x181a, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005,
-	0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048,
-	0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c,
-	0x10e5, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7354,
-	0x7074, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xcf2e,
-	0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148,
-	0x080c, 0x31e4, 0x080c, 0xcf43, 0x00c6, 0x080c, 0xac04, 0x00ce,
-	0x0060, 0x080c, 0xcc1a, 0x0148, 0x080c, 0xca29, 0x1110, 0x080c,
-	0xb591, 0x00c6, 0x080c, 0xabc9, 0x00ce, 0x9ce0, 0x001c, 0x7068,
-	0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee,
-	0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff,
-	0x0128, 0x2061, 0x1b32, 0x6112, 0x080c, 0x31e4, 0x9006, 0x0010,
-	0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xab73, 0x01b0, 0x665e, 0x2b00, 0x6012,
-	0x080c, 0x56db, 0x0118, 0x080c, 0xc945, 0x0168, 0x080c, 0xcca8,
-	0x6023, 0x0003, 0x2009, 0x004b, 0x080c, 0xac68, 0x9085, 0x0001,
+	0x000c, 0x0005, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
+	0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010, 0x2001,
+	0x1987, 0x2004, 0x601a, 0x6003, 0x000e, 0x0005, 0x9182, 0x0092,
+	0x1220, 0x9182, 0x0085, 0x0208, 0x0012, 0x0804, 0xaca9, 0xc2dc,
+	0xc2dc, 0xc2dc, 0xc2dc, 0xc2de, 0xc32b, 0xc2dc, 0xc2dc, 0xc2dc,
+	0xc2dc, 0xc2dc, 0xc2dc, 0xc2dc, 0x080c, 0x0d7d, 0x0096, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
+	0x009e, 0x0804, 0xc33f, 0x080c, 0xc838, 0x1118, 0x080c, 0xca27,
+	0x0068, 0x6014, 0x2048, 0x080c, 0xcf7e, 0x1110, 0x080c, 0xca27,
+	0xa867, 0x0103, 0x080c, 0xcf32, 0x080c, 0x6d80, 0x00d6, 0x2c68,
+	0x080c, 0xab97, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, 0x600b,
+	0xffff, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
+	0x613e, 0x6910, 0x6112, 0x080c, 0xcccc, 0x695c, 0x615e, 0x6023,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x2d60, 0x00de, 0x080c,
+	0xabed, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x05a0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0035,
+	0x0130, 0x9186, 0x001e, 0x0118, 0x9186, 0x0039, 0x1538, 0x00d6,
+	0x2c68, 0x080c, 0xceca, 0x11f0, 0x080c, 0xab97, 0x01d8, 0x6106,
+	0x6003, 0x0001, 0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e,
+	0x6930, 0x6132, 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a,
+	0x693c, 0x613e, 0x695c, 0x615e, 0x080c, 0xcccc, 0x2009, 0x8020,
+	0x080c, 0x921e, 0x2d60, 0x00de, 0x0804, 0xabed, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xc838, 0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4,
+	0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118,
+	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xcb3c, 0xa877,
+	0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x0804, 0xabed,
+	0x0016, 0x0096, 0x6014, 0x2048, 0x080c, 0xc838, 0x0140, 0xa867,
+	0x0103, 0xa87b, 0x0028, 0xa877, 0x0000, 0x080c, 0x6d80, 0x009e,
+	0x001e, 0x9186, 0x0013, 0x0158, 0x9186, 0x0014, 0x0130, 0x9186,
+	0x0027, 0x0118, 0x080c, 0xaca9, 0x0020, 0x080c, 0x95de, 0x080c,
+	0xac28, 0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001,
+	0x9182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304,
+	0x9098, 0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xc40b,
+	0x96b2, 0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fec, 0x080c,
+	0x103a, 0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920,
+	0xb406, 0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499,
+	0x00a8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b,
+	0x0451, 0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
+	0x95ad, 0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205,
+	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e,
+	0x006e, 0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055,
+	0x0130, 0xa807, 0x0000, 0x080c, 0x6d80, 0x2a48, 0x0cb8, 0x080c,
+	0x6d80, 0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085,
+	0x0080, 0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001,
+	0xa860, 0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300,
+	0x9e00, 0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018,
+	0x2300, 0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
+	0x8109, 0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126,
+	0x2091, 0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083,
+	0x012e, 0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031,
+	0x0000, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005,
+	0xc488, 0xc488, 0xc483, 0xc4ac, 0xc460, 0xc483, 0xc462, 0xc483,
+	0xc460, 0x90e4, 0xc483, 0xc483, 0xc483, 0xc460, 0xc460, 0xc460,
+	0x080c, 0x0d7d, 0x6010, 0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c,
+	0xc4ac, 0x0036, 0x6014, 0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc,
+	0x0118, 0x2019, 0x000c, 0x0038, 0xd094, 0x0118, 0x2019, 0x000d,
+	0x0010, 0x2019, 0x0010, 0x080c, 0xde1b, 0x6023, 0x0006, 0x6003,
+	0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x0096, 0x86ff, 0x11e8, 0x6014, 0x2048, 0x080c, 0xc838, 0x01d0,
+	0x6043, 0xffff, 0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005,
+	0xa883, 0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6fc0,
+	0x080c, 0xcb3c, 0x080c, 0x6d74, 0x080c, 0xac28, 0x9085, 0x0001,
+	0x009e, 0x0005, 0x9006, 0x0ce0, 0x080c, 0xa896, 0x080c, 0xcf8c,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x002b, 0x0106, 0x080c,
+	0xa8b2, 0x010e, 0x0005, 0xc4cb, 0xc4f9, 0xc4cd, 0xc520, 0xc4f4,
+	0xc4cb, 0xc483, 0xc488, 0xc488, 0xc483, 0xc483, 0xc483, 0xc483,
+	0xc483, 0xc483, 0xc483, 0x080c, 0x0d7d, 0x86ff, 0x1510, 0x6020,
+	0x9086, 0x0006, 0x01f0, 0x0096, 0x6014, 0x2048, 0x080c, 0xc838,
+	0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c,
+	0x0fec, 0x009e, 0x080c, 0xcb3c, 0x009e, 0x080c, 0xcf0c, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c,
+	0x9200, 0x9085, 0x0001, 0x0005, 0x0066, 0x080c, 0x1a6a, 0x006e,
+	0x08a0, 0x00e6, 0x2071, 0x19e7, 0x7030, 0x9c06, 0x1120, 0x080c,
+	0xa098, 0x00ee, 0x0850, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006,
+	0x1150, 0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0xa218,
+	0x009e, 0x008e, 0x0040, 0x0066, 0x080c, 0x9f94, 0x190c, 0x0d7d,
+	0x080c, 0x9fa2, 0x006e, 0x00ee, 0x1904, 0xc4cd, 0x0804, 0xc483,
+	0x0036, 0x00e6, 0x2071, 0x19e7, 0x704c, 0x9c06, 0x1138, 0x901e,
+	0x080c, 0xa118, 0x00ee, 0x003e, 0x0804, 0xc4cd, 0x080c, 0xa34e,
+	0x00ee, 0x003e, 0x1904, 0xc4cd, 0x0804, 0xc483, 0x00c6, 0x0066,
+	0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x00ce, 0x0005, 0xc556,
+	0xc618, 0xc77f, 0xc55e, 0xac28, 0xc556, 0xde0d, 0xcf74, 0xc618,
+	0x90ab, 0xc7fe, 0xc54f, 0xc54f, 0xc54f, 0xc54f, 0xc54f, 0x080c,
+	0x0d7d, 0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5, 0x0005, 0x080c,
+	0x95de, 0x0804, 0xabed, 0x601b, 0x0001, 0x0005, 0x080c, 0xc838,
+	0x0130, 0x6014, 0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x080c,
+	0xa896, 0x080c, 0xcf8c, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d,
+	0x0013, 0x0804, 0xa8b2, 0xc583, 0xc585, 0xc5af, 0xc5c3, 0xc5ee,
+	0xc583, 0xc556, 0xc556, 0xc556, 0xc5ca, 0xc5ca, 0xc583, 0xc583,
+	0xc583, 0xc583, 0xc5d4, 0x080c, 0x0d7d, 0x00e6, 0x6014, 0x0096,
+	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19e7, 0x7030,
+	0x9c06, 0x01d0, 0x0066, 0x080c, 0x9f94, 0x190c, 0x0d7d, 0x080c,
+	0x9fa2, 0x006e, 0x080c, 0xcf0c, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2001, 0x1987, 0x2004, 0x601a, 0x2009, 0x8020,
+	0x080c, 0x9200, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xcf0c,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020,
+	0x080c, 0x9200, 0x0005, 0x080c, 0xa896, 0x080c, 0xaa2a, 0x080c,
+	0xa8b2, 0x0c28, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x56e2, 0x01a8, 0x6014,
+	0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b, 0x0006,
+	0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0x080c, 0x6d80, 0x009e, 0x0804, 0xabed, 0x6014, 0x0096,
+	0x904d, 0x0508, 0x080c, 0xcf78, 0x01f0, 0x080c, 0xa8b2, 0x2001,
+	0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037, 0x2c08,
+	0x080c, 0x1679, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048,
+	0x080c, 0xac8c, 0x0005, 0x009e, 0x080c, 0x1a6a, 0x0804, 0xc5af,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x000b, 0x0005, 0xc62f,
+	0xc55b, 0xc631, 0xc62f, 0xc631, 0xc631, 0xc557, 0xc62f, 0xc551,
+	0xc551, 0xc62f, 0xc62f, 0xc62f, 0xc62f, 0xc62f, 0xc62f, 0x080c,
+	0x0d7d, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be,
+	0x908a, 0x000c, 0x1a0c, 0x0d7d, 0x00b6, 0x0013, 0x00be, 0x0005,
+	0xc64c, 0xc719, 0xc64e, 0xc68e, 0xc64e, 0xc68e, 0xc64e, 0xc65c,
+	0xc64c, 0xc68e, 0xc64c, 0xc67d, 0x080c, 0x0d7d, 0x6004, 0x908e,
+	0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590,
+	0x908e, 0x0052, 0x0904, 0xc715, 0x6004, 0x080c, 0xca4d, 0x0904,
+	0xc732, 0x908e, 0x0004, 0x1110, 0x080c, 0x321c, 0x908e, 0x0021,
+	0x0904, 0xc736, 0x908e, 0x0022, 0x0904, 0xc77a, 0x908e, 0x003d,
+	0x0904, 0xc736, 0x908e, 0x0039, 0x0904, 0xc73a, 0x908e, 0x0035,
+	0x0904, 0xc73a, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140,
+	0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110,
+	0x080c, 0x31e7, 0x080c, 0xb5b5, 0x0804, 0xac28, 0x00c6, 0x00d6,
+	0x6104, 0x9186, 0x0016, 0x0904, 0xc706, 0x9186, 0x0002, 0x1904,
+	0xc6db, 0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x74e9,
+	0x11b0, 0x080c, 0xcf52, 0x0138, 0x080c, 0x750c, 0x1120, 0x080c,
+	0x73f4, 0x0804, 0xc763, 0x2001, 0x197d, 0x2003, 0x0001, 0x2001,
+	0x1800, 0x2003, 0x0001, 0x080c, 0x741a, 0x0804, 0xc763, 0x6010,
+	0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904, 0xc763, 0xb8a0,
+	0x9084, 0xff80, 0x1904, 0xc763, 0xb840, 0x9084, 0x00ff, 0x9005,
+	0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b,
+	0x0398, 0x604b, 0x0000, 0x080c, 0xab97, 0x0128, 0x2b00, 0x6012,
+	0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002,
+	0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009,
+	0x1837, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c,
+	0x5fbc, 0x00ee, 0x080c, 0xb5b5, 0x0030, 0x080c, 0xb5b5, 0x080c,
+	0x31e7, 0x080c, 0xcf67, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x321c, 0x012e, 0x00ee, 0x080c, 0xac28, 0x0005, 0x2001, 0x0002,
+	0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9225,
+	0x080c, 0x96a0, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x321c, 0x0804,
+	0xc68a, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010,
+	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xc6db, 0x8001,
+	0xb842, 0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x00de,
+	0x00ce, 0x0898, 0x080c, 0xb5b5, 0x0804, 0xc68c, 0x080c, 0xb5f1,
+	0x0804, 0xc68c, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xceca, 0x00de,
+	0x0118, 0x080c, 0xabed, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c,
+	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x603c, 0x600a, 0x2001, 0x1987, 0x2004, 0x601a, 0x602c,
+	0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x2009, 0x8020,
+	0x080c, 0x921e, 0x0005, 0x00de, 0x00ce, 0x080c, 0xb5b5, 0x080c,
+	0x31e7, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x321c, 0x6017,
+	0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x012e,
+	0x00ee, 0x0005, 0x080c, 0xb029, 0x1904, 0xc732, 0x0005, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x00d6, 0x001b, 0x00de,
+	0x009e, 0x0005, 0xc79a, 0xc79a, 0xc79a, 0xc79a, 0xc79a, 0xc79a,
+	0xc79a, 0xc79a, 0xc79a, 0xc556, 0xc79a, 0xc55b, 0xc79c, 0xc55b,
+	0xc7a9, 0xc79a, 0x080c, 0x0d7d, 0x6004, 0x9086, 0x008b, 0x0148,
+	0x6007, 0x008b, 0x6003, 0x000d, 0x2009, 0x8020, 0x080c, 0x921e,
+	0x0005, 0x080c, 0xcf46, 0x0118, 0x080c, 0xcf59, 0x0010, 0x080c,
+	0xcf67, 0x080c, 0xca27, 0x080c, 0xc838, 0x0570, 0x080c, 0x31e7,
+	0x080c, 0xc838, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6d80,
+	0x2c68, 0x080c, 0xab97, 0x0150, 0x6810, 0x6012, 0x080c, 0xcccc,
+	0x00c6, 0x2d60, 0x080c, 0xac28, 0x00ce, 0x0008, 0x2d60, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x9225, 0x080c, 0x96a0, 0x00c8, 0x080c, 0xcf46, 0x0138, 0x6034,
+	0x9086, 0x4000, 0x1118, 0x080c, 0x31e7, 0x08d0, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
+	0x080c, 0x31e7, 0x0868, 0x080c, 0xac28, 0x0005, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d7d, 0x0002, 0xc814, 0xc814, 0xc816, 0xc816,
+	0xc816, 0xc814, 0xc814, 0xac28, 0xc814, 0xc814, 0xc814, 0xc814,
+	0xc814, 0xc814, 0xc814, 0xc814, 0x080c, 0x0d7d, 0x080c, 0xa896,
+	0x080c, 0xaa2a, 0x080c, 0xa8b2, 0x6114, 0x0096, 0x2148, 0xa87b,
+	0x0006, 0x080c, 0x6d80, 0x009e, 0x0804, 0xabed, 0x9284, 0x0003,
+	0x1158, 0x9282, 0x1ddc, 0x0240, 0x2001, 0x181a, 0x2004, 0x9202,
+	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028,
+	0x0096, 0x0006, 0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000,
+	0x9086, 0xf000, 0x0110, 0x080c, 0x10e5, 0x000e, 0x009e, 0x0005,
+	0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061,
+	0x1ddc, 0x2071, 0x1800, 0x7354, 0x7074, 0x9302, 0x1640, 0x6020,
+	0x9206, 0x11f8, 0x080c, 0xcf52, 0x0180, 0x9286, 0x0001, 0x1168,
+	0x6004, 0x9086, 0x0004, 0x1148, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x00c6, 0x080c, 0xac28, 0x00ce, 0x0060, 0x080c, 0xcc3e, 0x0148,
+	0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5, 0x00c6, 0x080c, 0xabed,
+	0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208, 0x08a0, 0x012e,
+	0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016,
+	0x9188, 0x1000, 0x210c, 0x81ff, 0x0128, 0x2061, 0x1b32, 0x6112,
+	0x080c, 0x31e7, 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce,
+	0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xab97,
+	0x01b0, 0x665e, 0x2b00, 0x6012, 0x080c, 0x56e2, 0x0118, 0x080c,
+	0xc969, 0x0168, 0x080c, 0xcccc, 0x6023, 0x0003, 0x2009, 0x004b,
+	0x080c, 0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0xac5f,
+	0x0580, 0x605f, 0x0000, 0x2b00, 0x6012, 0x080c, 0xcccc, 0x6023,
+	0x0003, 0x0016, 0x080c, 0xa896, 0x080c, 0x93a5, 0x0076, 0x903e,
+	0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e, 0x080c, 0xa8b2,
+	0x001e, 0xd184, 0x0128, 0x080c, 0xabed, 0x9085, 0x0001, 0x0070,
+	0x080c, 0x56e2, 0x0128, 0xd18c, 0x1170, 0x080c, 0xc969, 0x0148,
+	0x2009, 0x004c, 0x080c, 0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d,
+	0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c,
+	0xab97, 0x2c78, 0x0590, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003,
+	0x2021, 0x0005, 0x080c, 0xc97b, 0x9186, 0x004d, 0x0118, 0x9186,
+	0x004e, 0x0148, 0x2001, 0x1980, 0x200c, 0xd1fc, 0x0168, 0x2f60,
+	0x080c, 0xabed, 0x00d0, 0x2001, 0x197f, 0x200c, 0xd1fc, 0x0120,
+	0x2f60, 0x080c, 0xabed, 0x0088, 0x2f60, 0x080c, 0x56e2, 0x0138,
+	0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e,
+	0x0016, 0x080c, 0xac8c, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce,
+	0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0xab97, 0x2c78,
+	0x0508, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021,
+	0x0004, 0x0489, 0x009e, 0x2001, 0x197e, 0x200c, 0xd1fc, 0x0120,
+	0x2f60, 0x080c, 0xabed, 0x0060, 0x2f60, 0x080c, 0x56e2, 0x0120,
+	0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0xac8c,
+	0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816,
+	0x0c98, 0x00c6, 0x080c, 0x4aa7, 0x00ce, 0x1120, 0x080c, 0xabed,
+	0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xa896, 0x080c, 0x6804, 0x0158, 0x2001, 0xc982, 0x0006,
+	0x900e, 0x2400, 0x080c, 0x6fc0, 0x080c, 0x6d80, 0x000e, 0x0807,
+	0x2418, 0x080c, 0x95a4, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039,
+	0x0001, 0x2608, 0x080c, 0x93bf, 0x008e, 0x080c, 0x9277, 0x2f08,
+	0x2648, 0x080c, 0xdfeb, 0xb93c, 0x81ff, 0x090c, 0x9496, 0x080c,
+	0xa8b2, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xab97, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c,
+	0xcccc, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c,
+	0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac5f, 0x01b8, 0x660a,
+	0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0008, 0x2900, 0x6016,
+	0x00f6, 0x2c78, 0x080c, 0x1731, 0x00fe, 0x2009, 0x0021, 0x080c,
+	0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c,
+	0xab97, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0xac8c, 0x9085,
+	0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xac5f, 0x0188, 0x2b08, 0x6112,
+	0x080c, 0xcccc, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000,
+	0x080c, 0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026,
+	0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0118, 0x8211, 0xba3e,
+	0x1140, 0xb8d0, 0x9005, 0x0128, 0xb888, 0x9005, 0x1110, 0xb88b,
+	0x0001, 0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e,
+	0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110,
+	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020,
+	0x9086, 0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xc838, 0x0168,
+	0xa864, 0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128,
+	0xa868, 0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e,
+	0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac5f,
+	0x0198, 0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x080c, 0x31e7, 0x2009, 0x0028, 0x080c, 0xac8c, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015,
+	0x11a8, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6,
+	0x080c, 0xb807, 0x00be, 0x080c, 0xba2a, 0x6003, 0x0001, 0x6007,
+	0x0029, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0078, 0x6014, 0x0096,
+	0x2048, 0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c,
+	0xce8b, 0x080c, 0xb5b5, 0x080c, 0xabed, 0x0005, 0x0096, 0x6014,
+	0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6d80, 0x012e, 0x009e, 0x080c, 0xabed, 0x0c30, 0x0096,
+	0x9186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x6575, 0x00e8,
+	0x9186, 0x0015, 0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014,
+	0x11e0, 0x6010, 0x00b6, 0x2058, 0x080c, 0x66c0, 0x00be, 0x080c,
+	0xbafb, 0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005,
+	0x0160, 0x2001, 0x0006, 0x080c, 0x6575, 0x6014, 0x2048, 0xa868,
+	0xd0fc, 0x0170, 0x080c, 0xaffd, 0x0048, 0x6014, 0x2048, 0xa868,
+	0xd0fc, 0x0528, 0x080c, 0xb5b5, 0x080c, 0xabed, 0x009e, 0x0005,
+	0x6014, 0x6310, 0x2358, 0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x6914, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6d80, 0x012e, 0x080c, 0xabed, 0x08f8, 0x6014,
+	0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6d80, 0x012e, 0x080c, 0xabed, 0x0840, 0xa878, 0x9086,
+	0x0005, 0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005,
+	0x604b, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050,
+	0x2009, 0x8023, 0x080c, 0x921e, 0x0005, 0x00c6, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0130, 0x0066, 0x6020, 0x9084,
+	0x000f, 0x001b, 0x006e, 0x00ce, 0x0005, 0xc556, 0xcb6f, 0xcb6f,
+	0xcb72, 0xe318, 0xe333, 0xe336, 0xc556, 0xc556, 0xc556, 0xc556,
+	0xc556, 0xc556, 0xc556, 0xc556, 0xc556, 0x080c, 0x0d7d, 0xa001,
+	0xa001, 0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4,
+	0x1110, 0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001, 0x1834, 0x2004, 0x9005,
+	0x1540, 0x00f6, 0x2c78, 0x080c, 0xab97, 0x0508, 0x7810, 0x6012,
+	0x080c, 0xcccc, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a,
+	0x2f00, 0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e,
+	0x6023, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x795c, 0x615e,
+	0x2009, 0x8020, 0x080c, 0x921e, 0x2f60, 0x00fe, 0x0005, 0x2f60,
+	0x00fe, 0x2001, 0x1988, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096,
+	0x6814, 0x2048, 0x681c, 0xd0fc, 0xc0fc, 0x681e, 0xa87c, 0x1108,
+	0xd0e4, 0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000,
+	0xa88f, 0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048,
+	0x080c, 0x0fec, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803,
+	0x0002, 0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0,
+	0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085,
+	0x0c00, 0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0,
+	0x693c, 0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc,
+	0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112,
+	0x695c, 0x615e, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001,
+	0x2009, 0x8020, 0x080c, 0x921e, 0x009e, 0x001e, 0x0005, 0x6024,
+	0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303,
+	0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a,
+	0x633e, 0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402,
+	0xa836, 0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024,
+	0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a,
+	0xa840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016,
+	0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e,
+	0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158,
+	0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b,
+	0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00e6, 0x2001, 0x1982, 0x200c, 0x8000, 0x2014,
+	0x2001, 0x0032, 0x080c, 0x9166, 0x2001, 0x1986, 0x82ff, 0x1110,
+	0x2011, 0x0014, 0x2202, 0x2001, 0x1984, 0x200c, 0x8000, 0x2014,
+	0x2071, 0x196c, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x9166,
+	0x2001, 0x1987, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
+	0x1988, 0x9288, 0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0xa887,
+	0x2001, 0x1a89, 0x2102, 0x2001, 0x0032, 0x080c, 0x1679, 0x080c,
+	0x6a4c, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
+	0x0016, 0x00e6, 0x2001, 0x1986, 0x2003, 0x0028, 0x2001, 0x1987,
+	0x2003, 0x0014, 0x2071, 0x196c, 0x701b, 0x0000, 0x701f, 0x07d0,
+	0x2001, 0x1988, 0x2009, 0x001e, 0x2102, 0x2001, 0x0017, 0x080c,
+	0xa887, 0x2001, 0x1a89, 0x2102, 0x2001, 0x0032, 0x080c, 0x1679,
+	0x00ee, 0x001e, 0x000e, 0x0005, 0x0096, 0x6060, 0x904d, 0x0110,
+	0x080c, 0x106c, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xab97, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0xac8c, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086,
+	0x0018, 0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78,
+	0x080c, 0x975f, 0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080,
+	0xaa54, 0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
+	0x900e, 0x080c, 0x323c, 0x080c, 0xaffd, 0x0020, 0x080c, 0xb5b5,
+	0x080c, 0xabed, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54,
+	0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xab97, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x004d, 0x080c, 0xac8c, 0x9085, 0x0001,
 	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0xbaa0, 0x080c, 0xac3b, 0x0580, 0x605f, 0x0000, 0x2b00,
-	0x6012, 0x080c, 0xcca8, 0x6023, 0x0003, 0x0016, 0x080c, 0xa872,
-	0x080c, 0x9374, 0x0076, 0x903e, 0x080c, 0x9246, 0x2c08, 0x080c,
-	0xdfc0, 0x007e, 0x080c, 0xa88e, 0x001e, 0xd184, 0x0128, 0x080c,
-	0xabc9, 0x9085, 0x0001, 0x0070, 0x080c, 0x56db, 0x0128, 0xd18c,
-	0x1170, 0x080c, 0xc945, 0x0148, 0x2009, 0x004c, 0x080c, 0xac68,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900,
-	0x6016, 0x0c90, 0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6,
-	0x00c6, 0x0046, 0x0016, 0x080c, 0xab73, 0x2c78, 0x0590, 0x7e5e,
-	0x2b00, 0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xc957,
-	0x9186, 0x004d, 0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x1980,
-	0x200c, 0xd1fc, 0x0168, 0x2f60, 0x080c, 0xabc9, 0x00d0, 0x2001,
-	0x197f, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0xabc9, 0x0088,
-	0x2f60, 0x080c, 0x56db, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148,
-	0x0010, 0x2900, 0x7816, 0x001e, 0x0016, 0x080c, 0xac68, 0x9085,
-	0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6,
-	0x0046, 0x080c, 0xab73, 0x2c78, 0x0508, 0x7e5e, 0x2b00, 0x7812,
-	0x7823, 0x0003, 0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001,
-	0x197e, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0xabc9, 0x0060,
-	0x2f60, 0x080c, 0x56db, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130,
-	0x2009, 0x0052, 0x080c, 0xac68, 0x9085, 0x0001, 0x004e, 0x00ce,
-	0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x4aa0,
-	0x00ce, 0x1120, 0x080c, 0xabc9, 0x9006, 0x0005, 0xa867, 0x0000,
-	0xa86b, 0x8000, 0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096,
-	0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0xa872, 0x080c, 0x67fd,
-	0x0158, 0x2001, 0xc95e, 0x0006, 0x900e, 0x2400, 0x080c, 0x6fb0,
-	0x080c, 0x6d70, 0x000e, 0x0807, 0x2418, 0x080c, 0x9573, 0xbaa0,
-	0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x938e,
-	0x008e, 0x080c, 0x9246, 0x2f08, 0x2648, 0x080c, 0xdfc0, 0xb93c,
-	0x81ff, 0x090c, 0x9465, 0x080c, 0xa88e, 0x012e, 0x007e, 0x009e,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xab73, 0x0190,
-	0x660a, 0x2b08, 0x6112, 0x080c, 0xcca8, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x2009, 0x001f, 0x080c, 0xac68, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xac3b, 0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcca8,
-	0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c, 0x1731,
-	0x00fe, 0x2009, 0x0021, 0x080c, 0xac68, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126,
-	0x0016, 0x2091, 0x8000, 0x080c, 0xab73, 0x0198, 0x660a, 0x2b08,
-	0x6112, 0x080c, 0xcca8, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e,
-	0x0016, 0x080c, 0xac68, 0x9085, 0x0001, 0x001e, 0x012e, 0x00ce,
-	0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xac3b, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcca8, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0xac68, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830,
-	0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c,
-	0x82ff, 0x0118, 0x8211, 0xba3e, 0x1140, 0xb8d0, 0x9005, 0x0128,
-	0xb888, 0x9005, 0x1110, 0xb88b, 0x0001, 0x00be, 0x002e, 0x0005,
-	0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140, 0x908e, 0x0003,
-	0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e,
-	0x0005, 0x0006, 0x0096, 0x6020, 0x9086, 0x0004, 0x0190, 0x6014,
-	0x904d, 0x080c, 0xc814, 0x0168, 0xa864, 0x9086, 0x0139, 0x0158,
-	0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xac3b, 0x0198, 0x2b08, 0x6112, 0x080c,
-	0xcca8, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c, 0x31e4, 0x2009,
-	0x0028, 0x080c, 0xac68, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011, 0x1824, 0x2204,
-	0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xb7e3, 0x00be, 0x080c,
-	0xba06, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x91f4, 0x080c,
-	0x966f, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc,
-	0x0148, 0x2001, 0x0001, 0x080c, 0xce67, 0x080c, 0xb591, 0x080c,
-	0xabc9, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c, 0x0d7d, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
-	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0x009e,
-	0x080c, 0xabc9, 0x0c30, 0x0096, 0x9186, 0x0016, 0x1128, 0x2001,
-	0x0004, 0x080c, 0x656e, 0x00e8, 0x9186, 0x0015, 0x1510, 0x2011,
-	0x1824, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6, 0x2058,
-	0x080c, 0x66b9, 0x00be, 0x080c, 0xbad7, 0x1198, 0x6010, 0x00b6,
-	0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001, 0x0006, 0x080c,
-	0x656e, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c, 0xafd9,
-	0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c, 0xb591,
-	0x080c, 0xabc9, 0x009e, 0x0005, 0x6014, 0x6310, 0x2358, 0x904d,
-	0x090c, 0x0d7d, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0x900e, 0x080c, 0x690d, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d70, 0x012e,
-	0x080c, 0xabc9, 0x08f8, 0x6014, 0x904d, 0x090c, 0x0d7d, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
-	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0x080c,
-	0xabc9, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108, 0x0009, 0x0005,
-	0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b, 0x0000, 0x6017, 0x0000,
-	0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c, 0x91ed,
-	0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0130, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x00ce,
-	0x0005, 0xc532, 0xcb4b, 0xcb4b, 0xcb4e, 0xe2ed, 0xe308, 0xe30b,
-	0xc532, 0xc532, 0xc532, 0xc532, 0xc532, 0xc532, 0xc532, 0xc532,
-	0xc532, 0x080c, 0x0d7d, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014,
-	0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e,
-	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550,
-	0x2001, 0x1834, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c,
-	0xab73, 0x0508, 0x7810, 0x6012, 0x080c, 0xcca8, 0x7820, 0x9086,
-	0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808,
-	0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035,
-	0x6003, 0x0001, 0x795c, 0x615e, 0x2009, 0x8020, 0x080c, 0x91ed,
-	0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1988, 0x2004,
-	0x604a, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0x681c, 0xd0fc,
-	0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4, 0x0180, 0xc0e4, 0xa87e,
-	0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000, 0xd0cc, 0x0130,
-	0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fec, 0x6830, 0x6036,
-	0x908e, 0x0001, 0x0148, 0x6803, 0x0002, 0x9086, 0x0005, 0x0170,
-	0x9006, 0x602e, 0x6032, 0x00d0, 0x681c, 0xc085, 0x681e, 0x6803,
-	0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00, 0x6826, 0x6814, 0x2048,
-	0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c, 0x9103, 0x1e48, 0x683c,
-	0x602e, 0x6838, 0x9084, 0xfffc, 0x683a, 0x6032, 0x2d00, 0x603a,
-	0x6808, 0x603e, 0x6910, 0x6112, 0x695c, 0x615e, 0x6023, 0x0001,
-	0x6007, 0x0039, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x91ed,
-	0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4, 0x0510, 0xd0f4, 0x11f8,
-	0x6038, 0x940a, 0x603c, 0x9303, 0x0230, 0x9105, 0x0120, 0x6024,
-	0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e, 0xac3e, 0xab42, 0x0046,
-	0x0036, 0x2400, 0xacac, 0x9402, 0xa836, 0x2300, 0xabb0, 0x9303,
-	0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4, 0x0000, 0x6026, 0x0005,
-	0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840, 0x603e, 0x6024, 0xc0f5,
-	0x6026, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0034, 0x01b8,
-	0x908e, 0x0035, 0x01a0, 0x908e, 0x0036, 0x0188, 0x908e, 0x0037,
-	0x0170, 0x908e, 0x0038, 0x0158, 0x908e, 0x0039, 0x0140, 0x908e,
-	0x003a, 0x0128, 0x908e, 0x003b, 0x0110, 0x9085, 0x0001, 0x001e,
-	0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x2001,
-	0x1982, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x9135,
-	0x2001, 0x1986, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
-	0x1984, 0x200c, 0x8000, 0x2014, 0x2071, 0x196c, 0x711a, 0x721e,
-	0x2001, 0x0064, 0x080c, 0x9135, 0x2001, 0x1987, 0x82ff, 0x1110,
-	0x2011, 0x0014, 0x2202, 0x2001, 0x1988, 0x9288, 0x000a, 0x2102,
-	0x2001, 0x0017, 0x080c, 0xa863, 0x2001, 0x1a89, 0x2102, 0x2001,
-	0x0032, 0x080c, 0x1679, 0x080c, 0x6a3c, 0x00ee, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1986,
-	0x2003, 0x0028, 0x2001, 0x1987, 0x2003, 0x0014, 0x2071, 0x196c,
-	0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1988, 0x2009, 0x001e,
-	0x2102, 0x2001, 0x0017, 0x080c, 0xa863, 0x2001, 0x1a89, 0x2102,
-	0x2001, 0x0032, 0x080c, 0x1679, 0x00ee, 0x001e, 0x000e, 0x0005,
-	0x0096, 0x6060, 0x904d, 0x0110, 0x080c, 0x106c, 0x009e, 0x0005,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xab73, 0x0180,
-	0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
-	0x0033, 0x080c, 0xac68, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
-	0x0015, 0x1500, 0x7090, 0x9086, 0x0018, 0x11e0, 0x6014, 0x2048,
-	0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x972e, 0x01d8, 0x707c,
-	0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54, 0x9206, 0x1140, 0x6210,
-	0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c, 0x3235, 0x080c,
-	0xafd9, 0x0020, 0x080c, 0xb591, 0x080c, 0xabc9, 0x00fe, 0x00ee,
-	0x009e, 0x0005, 0x7060, 0xaa54, 0x9206, 0x0d48, 0x0c80, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xab73, 0x0188, 0x2b08, 0x6112,
-	0x080c, 0xcca8, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x004d,
-	0x080c, 0xac68, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0xab73,
-	0x0180, 0x2b08, 0x6112, 0x080c, 0xcca8, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x001e, 0x080c, 0xac68, 0x9085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036, 0x0046,
-	0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
-	0x0015, 0x1568, 0x7190, 0x6014, 0x2048, 0xa814, 0x8003, 0x9106,
-	0x1530, 0x20e1, 0x0000, 0x2001, 0x19a0, 0x2003, 0x0000, 0x6014,
-	0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007, 0x9094, 0x003f,
-	0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0, 0x2001, 0x19a0,
-	0x0016, 0x200c, 0x080c, 0xd540, 0x001e, 0xa804, 0x9005, 0x0110,
-	0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103, 0x0010, 0x080c,
-	0xb591, 0x080c, 0xabc9, 0x00fe, 0x00ee, 0x009e, 0x006e, 0x005e,
-	0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x7090, 0x9086, 0x0004,
-	0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x972e, 0x01a8, 0x707c,
-	0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78, 0x9206, 0x1110, 0x080c,
-	0x31e4, 0x080c, 0xafd9, 0x0020, 0x080c, 0xb591, 0x080c, 0xabc9,
-	0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa78, 0x9206, 0x0d78,
-	0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
-	0x1550, 0x7090, 0x9086, 0x0004, 0x1530, 0x6014, 0x2048, 0x2c78,
-	0x080c, 0x972e, 0x05f0, 0x707c, 0xaacc, 0x9206, 0x1180, 0x7080,
-	0xaad0, 0x9206, 0x1160, 0x080c, 0x31e4, 0x0016, 0xa998, 0xaab0,
-	0x9284, 0x1000, 0xc0fd, 0x080c, 0x568b, 0x001e, 0x0010, 0x080c,
-	0x5474, 0x080c, 0xc814, 0x0508, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x0080, 0x080c, 0xc814, 0x01b8, 0x6014, 0x2048,
-	0x080c, 0x5474, 0x1d70, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
-	0x080c, 0x6d70, 0x012e, 0x080c, 0xabc9, 0x00fe, 0x00ee, 0x009e,
-	0x0005, 0x7060, 0xaad0, 0x9206, 0x0930, 0x0888, 0x0016, 0x0026,
-	0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0150,
-	0xa890, 0x9106, 0x1118, 0xa88c, 0x9206, 0x0120, 0xa992, 0xaa8e,
-	0x9085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00b6, 0x00d6, 0x0036,
-	0x080c, 0xc814, 0x0904, 0xce63, 0x0096, 0x6314, 0x2348, 0xa87a,
-	0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009,
-	0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x690d, 0x1108, 0xc185,
-	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0,
-	0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0fb7, 0x20a9, 0x0004,
-	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0fb7, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007,
-	0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2,
-	0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x6d64,
-	0x6017, 0x0000, 0x009e, 0x003e, 0x00de, 0x00be, 0x0005, 0x0026,
-	0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6, 0x6214, 0x2248, 0x6210,
-	0x2258, 0x2079, 0x0260, 0x9096, 0x0000, 0x11a0, 0xb814, 0x9084,
-	0x00ff, 0x900e, 0x080c, 0x25fb, 0x2118, 0x831f, 0x939c, 0xff00,
-	0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c,
-	0x4b00, 0x00a8, 0x9096, 0x0001, 0x1148, 0x89ff, 0x0180, 0xa89b,
-	0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x0048, 0x9096, 0x0002,
-	0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x00fe,
-	0x009e, 0x00be, 0x004e, 0x003e, 0x002e, 0x0005, 0x00c6, 0x0026,
-	0x0016, 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008, 0x6a2c, 0x080c,
-	0xc802, 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186,
-	0x0006, 0x1190, 0x6838, 0x9206, 0x0140, 0x683c, 0x9206, 0x1160,
-	0x6108, 0x6838, 0x9106, 0x1140, 0x0020, 0x6008, 0x693c, 0x9106,
-	0x1118, 0x6010, 0x6910, 0x9106, 0x001e, 0x002e, 0x00ce, 0x0005,
-	0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc, 0x0188, 0x918c, 0x00ff,
-	0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c, 0x0f00, 0x810f, 0x918e,
-	0x0001, 0x1128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbe8f, 0x0005,
-	0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0499, 0x01e0,
-	0x080c, 0xc814, 0x01c8, 0x080c, 0xca03, 0x6037, 0x4000, 0x6014,
-	0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c, 0xca29, 0x1118,
-	0x080c, 0xb591, 0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff,
-	0x1129, 0x080c, 0x6d70, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4,
-	0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118,
-	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xcb18, 0xa877,
-	0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005, 0x0006,
-	0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001,
-	0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010,
-	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4cb7,
-	0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1986,
-	0x2004, 0x601a, 0x0005, 0x2001, 0x1988, 0x2004, 0x604a, 0x0005,
-	0x080c, 0xabc9, 0x0804, 0x966f, 0x611c, 0xd1fc, 0xa97c, 0x1108,
-	0xd1e4, 0x0005, 0x601c, 0xd0fc, 0xa87c, 0x1108, 0xd0e4, 0x0005,
-	0x601c, 0xd0fc, 0xc0fc, 0x601e, 0xa87c, 0x1108, 0xd0e4, 0x0005,
-	0x6044, 0xd0fc, 0x0160, 0xd0dc, 0x1128, 0x908c, 0x000f, 0x9186,
-	0x0005, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x0005,
-	0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x001b,
-	0x006e, 0x00be, 0x0005, 0xcf93, 0xd69b, 0xd7ec, 0xcf93, 0xcf93,
-	0xcf93, 0xcf93, 0xcf93, 0xcfca, 0xd86a, 0xcf93, 0xcf93, 0xcf93,
-	0xcf93, 0xcf93, 0xcf93, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xcfae, 0xdd81,
-	0xcfae, 0xcfae, 0xcfae, 0xcfae, 0xcfae, 0xcfae, 0xdd30, 0xddd3,
-	0xcfae, 0xe428, 0xe45c, 0xe428, 0xe45c, 0xcfae, 0x080c, 0x0d7d,
-	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d7d, 0x6000, 0x000a, 0x0005,
-	0xcfc8, 0xda46, 0xdb0f, 0xdb31, 0xdbac, 0xcfc8, 0xdca6, 0xdc34,
-	0xd874, 0xdd08, 0xdd1d, 0xcfc8, 0xcfc8, 0xcfc8, 0xcfc8, 0xcfc8,
-	0x080c, 0x0d7d, 0x91b2, 0x0053, 0x1a0c, 0x0d7d, 0x2100, 0x91b2,
-	0x0040, 0x1a04, 0xd411, 0x0002, 0xd014, 0xd202, 0xd014, 0xd014,
-	0xd014, 0xd20b, 0xd014, 0xd014, 0xd014, 0xd014, 0xd014, 0xd014,
-	0xd014, 0xd014, 0xd014, 0xd014, 0xd014, 0xd014, 0xd014, 0xd014,
-	0xd014, 0xd014, 0xd014, 0xd016, 0xd07d, 0xd08c, 0xd0f0, 0xd11b,
-	0xd194, 0xd1ed, 0xd014, 0xd014, 0xd20e, 0xd014, 0xd014, 0xd223,
-	0xd230, 0xd014, 0xd014, 0xd014, 0xd014, 0xd014, 0xd2b3, 0xd014,
-	0xd014, 0xd2c7, 0xd014, 0xd014, 0xd282, 0xd014, 0xd014, 0xd014,
-	0xd2df, 0xd014, 0xd014, 0xd014, 0xd35c, 0xd014, 0xd014, 0xd014,
-	0xd014, 0xd014, 0xd014, 0xd3d9, 0x080c, 0x0d7d, 0x080c, 0x6a19,
-	0x1150, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009,
-	0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017,
-	0x0000, 0x0804, 0xd1fb, 0x080c, 0x69be, 0x00e6, 0x00c6, 0x0036,
-	0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029,
-	0x080c, 0xa872, 0x080c, 0x9374, 0x0076, 0x903e, 0x080c, 0x9246,
-	0x2c08, 0x080c, 0xdfc0, 0x007e, 0x001e, 0x080c, 0xa88e, 0x001e,
-	0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x662d,
-	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1268, 0x0016, 0x0026,
-	0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x2c08, 0x080c, 0xe685,
-	0x002e, 0x001e, 0x1178, 0x080c, 0xdeee, 0x1904, 0xd0e8, 0x080c,
-	0xde8a, 0x1120, 0x6007, 0x0008, 0x0804, 0xd1fb, 0x6007, 0x0009,
-	0x0804, 0xd1fb, 0x080c, 0xe121, 0x0128, 0x080c, 0xdeee, 0x0d78,
-	0x0804, 0xd0e8, 0x6017, 0x1900, 0x0c88, 0x080c, 0x332b, 0x1904,
-	0xd40e, 0x6106, 0x080c, 0xde3d, 0x6007, 0x0006, 0x0804, 0xd1fb,
-	0x6007, 0x0007, 0x0804, 0xd1fb, 0x080c, 0xe498, 0x1904, 0xd40e,
-	0x080c, 0x332b, 0x1904, 0xd40e, 0x00d6, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001, 0x0001, 0x080c,
-	0x655a, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0188, 0x9686,
-	0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0140,
-	0x9686, 0x0004, 0x0128, 0x9686, 0x0005, 0x0110, 0x00de, 0x0480,
-	0x00e6, 0x2071, 0x0260, 0x7034, 0x9084, 0x0003, 0x1140, 0x7034,
-	0x9082, 0x0014, 0x0220, 0x7030, 0x9084, 0x0003, 0x0130, 0x00ee,
-	0x6017, 0x0000, 0x602f, 0x0007, 0x00b0, 0x00ee, 0x080c, 0xdf56,
-	0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210, 0x2258, 0xbaa0,
-	0x900e, 0x080c, 0x3235, 0x002e, 0x080c, 0x66b9, 0x6007, 0x000a,
-	0x00de, 0x0804, 0xd1fb, 0x6007, 0x000b, 0x00de, 0x0804, 0xd1fb,
-	0x080c, 0x31e4, 0x080c, 0xcf43, 0x6007, 0x0001, 0x0804, 0xd1fb,
-	0x080c, 0xe498, 0x1904, 0xd40e, 0x080c, 0x332b, 0x1904, 0xd40e,
-	0x2071, 0x0260, 0x7034, 0x90b4, 0x0003, 0x1948, 0x90b2, 0x0014,
-	0x0a30, 0x7030, 0x9084, 0x0003, 0x1910, 0x6610, 0x2658, 0xbe04,
-	0x9686, 0x0707, 0x09e8, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e,
-	0x080c, 0x3235, 0x002e, 0x6007, 0x000c, 0x2001, 0x0001, 0x080c,
-	0xe665, 0x0804, 0xd1fb, 0x080c, 0x6a19, 0x1140, 0x2001, 0x1837,
-	0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xd023,
-	0x080c, 0x69be, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082,
-	0x0006, 0x06c8, 0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x659a,
-	0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120,
-	0x9686, 0x0006, 0x1904, 0xd0e8, 0x080c, 0xdf63, 0x1120, 0x6007,
-	0x000e, 0x0804, 0xd1fb, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046,
-	0x080c, 0x31e4, 0x080c, 0xcf43, 0x004e, 0x0016, 0x9006, 0x2009,
-	0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe29e,
+	0x8000, 0x0016, 0x080c, 0xab97, 0x0180, 0x2b08, 0x6112, 0x080c,
+	0xcccc, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xac8c,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014,
+	0x2048, 0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001,
+	0x19a0, 0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906,
+	0x8006, 0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016, 0x200c, 0x080c, 0xd565,
+	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048,
+	0xa867, 0x0103, 0x0010, 0x080c, 0xb5b5, 0x080c, 0xabed, 0x00fe,
+	0x00ee, 0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
+	0x11b8, 0x7090, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78,
+	0x080c, 0x975f, 0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080,
+	0xaa78, 0x9206, 0x1110, 0x080c, 0x31e7, 0x080c, 0xaffd, 0x0020,
+	0x080c, 0xb5b5, 0x080c, 0xabed, 0x00fe, 0x00ee, 0x009e, 0x0005,
+	0x7060, 0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004,
+	0x1530, 0x6014, 0x2048, 0x2c78, 0x080c, 0x975f, 0x05f0, 0x707c,
+	0xaacc, 0x9206, 0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c,
+	0x31e7, 0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c,
+	0x5692, 0x001e, 0x0010, 0x080c, 0x547b, 0x080c, 0xc838, 0x0508,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c,
+	0xc838, 0x01b8, 0x6014, 0x2048, 0x080c, 0x547b, 0x1d70, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126,
+	0x2091, 0x8000, 0xa867, 0x0139, 0x080c, 0x6d80, 0x012e, 0x080c,
+	0xabed, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaad0, 0x9206,
+	0x0930, 0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938,
+	0xaa34, 0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c,
+	0x9206, 0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e,
+	0x0005, 0x00b6, 0x00d6, 0x0036, 0x080c, 0xc838, 0x0904, 0xce87,
+	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580,
+	0x6310, 0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140,
+	0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0fb7, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0,
+	0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7, 0x00ce, 0x0090,
+	0xaa96, 0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016,
+	0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084,
+	0x00ff, 0xa89e, 0x080c, 0x6d74, 0x6017, 0x0000, 0x009e, 0x003e,
+	0x00de, 0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096,
+	0x00f6, 0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096,
+	0x0000, 0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x25fb,
+	0x2118, 0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d,
+	0x7c3c, 0x2011, 0x8018, 0x080c, 0x4b07, 0x00a8, 0x9096, 0x0001,
+	0x1148, 0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
+	0xa8aa, 0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838,
+	0xa8a6, 0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e,
+	0x002e, 0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110,
+	0x6a38, 0x0008, 0x6a2c, 0x080c, 0xc826, 0x01f0, 0x2260, 0x6120,
+	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206,
+	0x0140, 0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140,
+	0x0020, 0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106,
+	0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974,
+	0xd1cc, 0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8,
+	0x918c, 0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xbeb3, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010,
+	0x0036, 0x901e, 0x0499, 0x01e0, 0x080c, 0xc838, 0x01c8, 0x080c,
+	0xca27, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048,
+	0xa87c, 0x080c, 0xca4d, 0x1118, 0x080c, 0xb5b5, 0x0040, 0xa867,
+	0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6d80, 0x009e,
+	0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec,
+	0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
+	0x0005, 0x080c, 0xcb3c, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e,
+	0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
+	0x2021, 0x0007, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x0005, 0x0c51,
+	0x1d81, 0x0005, 0x2001, 0x1986, 0x2004, 0x601a, 0x0005, 0x2001,
+	0x1988, 0x2004, 0x604a, 0x0005, 0x080c, 0xabed, 0x0804, 0x96a0,
+	0x611c, 0xd1fc, 0xa97c, 0x1108, 0xd1e4, 0x0005, 0x601c, 0xd0fc,
+	0xa87c, 0x1108, 0xd0e4, 0x0005, 0x601c, 0xd0fc, 0xc0fc, 0x601e,
+	0xa87c, 0x1108, 0xd0e4, 0x0005, 0x6044, 0xd0fc, 0x0160, 0xd0dc,
+	0x1128, 0x908c, 0x000f, 0x9186, 0x0005, 0x1118, 0x6003, 0x0003,
+	0x0010, 0x6003, 0x0001, 0x0005, 0x00b6, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0d7d, 0x001b, 0x006e, 0x00be, 0x0005, 0xcfb7,
+	0xd6c0, 0xd811, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfee,
+	0xd893, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0x080c,
+	0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013,
+	0x006e, 0x0005, 0xcfd2, 0xddaa, 0xcfd2, 0xcfd2, 0xcfd2, 0xcfd2,
+	0xcfd2, 0xcfd2, 0xdd59, 0xddfc, 0xcfd2, 0xe453, 0xe487, 0xe453,
+	0xe487, 0xcfd2, 0x080c, 0x0d7d, 0x6000, 0x9082, 0x0016, 0x1a0c,
+	0x0d7d, 0x6000, 0x000a, 0x0005, 0xcfec, 0xda6f, 0xdb38, 0xdb5a,
+	0xdbd5, 0xcfec, 0xdccf, 0xdc5d, 0xd89d, 0xdd31, 0xdd46, 0xcfec,
+	0xcfec, 0xcfec, 0xcfec, 0xcfec, 0x080c, 0x0d7d, 0x91b2, 0x0053,
+	0x1a0c, 0x0d7d, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xd436, 0x0002,
+	0xd038, 0xd227, 0xd038, 0xd038, 0xd038, 0xd230, 0xd038, 0xd038,
+	0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038,
+	0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd03a,
+	0xd0a1, 0xd0b0, 0xd114, 0xd13f, 0xd1b8, 0xd212, 0xd038, 0xd038,
+	0xd233, 0xd038, 0xd038, 0xd248, 0xd255, 0xd038, 0xd038, 0xd038,
+	0xd038, 0xd038, 0xd2d8, 0xd038, 0xd038, 0xd2ec, 0xd038, 0xd038,
+	0xd2a7, 0xd038, 0xd038, 0xd038, 0xd304, 0xd038, 0xd038, 0xd038,
+	0xd381, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd3fe,
+	0x080c, 0x0d7d, 0x080c, 0x6a29, 0x1150, 0x2001, 0x1837, 0x2004,
+	0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007,
+	0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xd220, 0x080c,
+	0x69c5, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0xa896, 0x080c, 0x93a5,
+	0x0076, 0x903e, 0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e,
+	0x001e, 0x080c, 0xa8b2, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
+	0x6610, 0x2658, 0x080c, 0x6634, 0xbe04, 0x9684, 0x00ff, 0x9082,
+	0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0,
+	0x00be, 0x2c08, 0x080c, 0xe6b0, 0x002e, 0x001e, 0x1178, 0x080c,
+	0xdf19, 0x1904, 0xd10c, 0x080c, 0xdeb5, 0x1120, 0x6007, 0x0008,
+	0x0804, 0xd220, 0x6007, 0x0009, 0x0804, 0xd220, 0x080c, 0xe14c,
+	0x0128, 0x080c, 0xdf19, 0x0d78, 0x0804, 0xd10c, 0x6017, 0x1900,
+	0x0c88, 0x080c, 0x3332, 0x1904, 0xd433, 0x6106, 0x080c, 0xde66,
+	0x6007, 0x0006, 0x0804, 0xd220, 0x6007, 0x0007, 0x0804, 0xd220,
+	0x080c, 0xe4c3, 0x1904, 0xd433, 0x080c, 0x3332, 0x1904, 0xd433,
+	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
+	0x1220, 0x2001, 0x0001, 0x080c, 0x6561, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686,
+	0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030,
+	0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007,
+	0x00b0, 0x00ee, 0x080c, 0xdf81, 0x1190, 0x9686, 0x0006, 0x1140,
+	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x323c, 0x002e,
+	0x080c, 0x66c0, 0x6007, 0x000a, 0x00de, 0x0804, 0xd220, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xd220, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x6007, 0x0001, 0x0804, 0xd220, 0x080c, 0xe4c3, 0x1904, 0xd433,
+	0x080c, 0x3332, 0x1904, 0xd433, 0x2071, 0x0260, 0x7034, 0x90b4,
+	0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003,
+	0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x323c, 0x002e, 0x6007,
+	0x000c, 0x2001, 0x0001, 0x080c, 0xe690, 0x0804, 0xd220, 0x080c,
+	0x6a29, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xd047, 0x080c, 0x69c5, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138, 0x0026,
+	0x2001, 0x0006, 0x080c, 0x65a1, 0x002e, 0x0050, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd10c,
+	0x080c, 0xdf8e, 0x1120, 0x6007, 0x000e, 0x0804, 0xd220, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148,
+	0x2009, 0x0029, 0x080c, 0xe2c9, 0x6010, 0x2058, 0xb800, 0xc0e5,
+	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xd220, 0x2001,
+	0x0001, 0x080c, 0x6561, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xbbae, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637,
+	0x9682, 0x0004, 0x0a04, 0xd10c, 0x9682, 0x0007, 0x0a04, 0xd168,
+	0x0804, 0xd10c, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd220,
+	0x080c, 0x6a29, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009,
+	0x9086, 0x0008, 0x1110, 0x0804, 0xd047, 0x080c, 0x69c5, 0x6610,
+	0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0698, 0x0150,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006,
+	0x1904, 0xd10c, 0x080c, 0xdfbc, 0x1130, 0x080c, 0xdeb5, 0x1118,
+	0x6007, 0x0010, 0x04e8, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046,
+	0x080c, 0x31e7, 0x080c, 0xcf67, 0x004e, 0x0016, 0x9006, 0x2009,
+	0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe2c9,
 	0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007,
-	0x0001, 0x0804, 0xd1fb, 0x2001, 0x0001, 0x080c, 0x655a, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
-	0x0270, 0x080c, 0xbb8a, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005,
-	0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004, 0x0a04, 0xd0e8,
-	0x9682, 0x0007, 0x0a04, 0xd144, 0x0804, 0xd0e8, 0x6017, 0x1900,
-	0x6007, 0x0009, 0x0804, 0xd1fb, 0x080c, 0x6a19, 0x1140, 0x2001,
-	0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804,
-	0xd023, 0x080c, 0x69be, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff,
-	0x9082, 0x0006, 0x0690, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004,
-	0x0120, 0x9686, 0x0006, 0x1904, 0xd0e8, 0x080c, 0xdf91, 0x1130,
-	0x080c, 0xde8a, 0x1118, 0x6007, 0x0010, 0x04e8, 0x0046, 0x6410,
-	0x2458, 0xbca0, 0x0046, 0x080c, 0x31e4, 0x080c, 0xcf43, 0x004e,
-	0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009,
-	0x0029, 0x080c, 0xe29e, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
-	0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xe121, 0x0140,
-	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0978, 0x0804, 0xd0e8,
-	0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x332b, 0x1904,
-	0xd40e, 0x080c, 0xe498, 0x1904, 0xd40e, 0x080c, 0xd5db, 0x1904,
-	0xd0e8, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x91f4, 0x080c,
-	0x966f, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x91f4,
-	0x080c, 0x966f, 0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c, 0xe498,
-	0x1904, 0xd40e, 0x080c, 0x332b, 0x1904, 0xd40e, 0x080c, 0xd5db,
-	0x1904, 0xd0e8, 0x6007, 0x0020, 0x6003, 0x0001, 0x080c, 0x91f4,
-	0x080c, 0x966f, 0x0005, 0x080c, 0x332b, 0x1904, 0xd40e, 0x6007,
-	0x0023, 0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x0005,
-	0x080c, 0xe498, 0x1904, 0xd40e, 0x080c, 0x332b, 0x1904, 0xd40e,
-	0x080c, 0xd5db, 0x1904, 0xd0e8, 0x0016, 0x0026, 0x00e6, 0x2071,
-	0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08, 0x080c, 0xc802,
-	0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188, 0x6010, 0x9190,
-	0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006,
-	0x080c, 0xe268, 0x1180, 0x7244, 0x9286, 0xffff, 0x01b0, 0x2160,
-	0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296, 0xffff, 0x1180,
-	0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007, 0x1d80, 0x6004,
-	0x9086, 0x0024, 0x1110, 0x080c, 0xabc9, 0x2160, 0x6007, 0x0025,
-	0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x00ee, 0x002e,
-	0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x655a, 0x0156, 0x0016,
-	0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276,
-	0x080c, 0xbb8a, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120, 0x6007,
-	0x0031, 0x0804, 0xd1fb, 0x080c, 0xb7fb, 0x080c, 0x74d5, 0x1190,
-	0x0006, 0x0026, 0x0036, 0x080c, 0x74ef, 0x1138, 0x080c, 0x77d9,
-	0x080c, 0x6022, 0x080c, 0x7406, 0x0010, 0x080c, 0x74a9, 0x003e,
-	0x002e, 0x000e, 0x0005, 0x080c, 0x332b, 0x1904, 0xd40e, 0x080c,
-	0xd5db, 0x1904, 0xd0e8, 0x6106, 0x080c, 0xd5f7, 0x1120, 0x6007,
-	0x002b, 0x0804, 0xd1fb, 0x6007, 0x002c, 0x0804, 0xd1fb, 0x080c,
-	0xe498, 0x1904, 0xd40e, 0x080c, 0x332b, 0x1904, 0xd40e, 0x080c,
-	0xd5db, 0x1904, 0xd0e8, 0x6106, 0x080c, 0xd5fc, 0x1120, 0x6007,
-	0x002e, 0x0804, 0xd1fb, 0x6007, 0x002f, 0x0804, 0xd1fb, 0x080c,
-	0x332b, 0x1904, 0xd40e, 0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058,
-	0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184, 0xff00,
-	0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804,
-	0xd202, 0x080c, 0x56d7, 0xd0e4, 0x0904, 0xd359, 0x2071, 0x026c,
-	0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x080c, 0x6a57,
-	0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118, 0xb814, 0x9206,
-	0x0510, 0x080c, 0x6a53, 0x15b8, 0x2069, 0x1800, 0x6880, 0x9206,
-	0x1590, 0x687c, 0x9106, 0x1578, 0x7210, 0x080c, 0xc802, 0x0590,
-	0x080c, 0xd4c6, 0x0578, 0x080c, 0xe31a, 0x0560, 0x622e, 0x6007,
-	0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x91ed, 0x00ce,
-	0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150, 0x080c,
-	0xc802, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106, 0x1190,
-	0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe268, 0x2c10,
-	0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f, 0x0009, 0x6017,
-	0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003, 0x6017, 0x1700,
-	0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x332b, 0x1904, 0xd40e,
-	0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007, 0x9086, 0x0006,
-	0x1904, 0xd202, 0x00e6, 0x00d6, 0x00c6, 0x080c, 0x56d7, 0xd0e4,
-	0x0904, 0xd3d1, 0x2069, 0x1800, 0x2071, 0x026c, 0x7008, 0x603a,
-	0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08,
-	0x9085, 0x0001, 0x080c, 0xe268, 0x2c10, 0x00ce, 0x05e8, 0x080c,
-	0xc802, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004, 0x9106, 0x15a0,
-	0x00c6, 0x0026, 0x2260, 0x080c, 0xc412, 0x002e, 0x00ce, 0x7118,
-	0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178, 0x9186, 0x0005,
-	0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005, 0x2004, 0x9005,
-	0x0170, 0x080c, 0xd4c6, 0x0904, 0xd352, 0x0056, 0x7510, 0x7614,
-	0x080c, 0xe333, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007,
-	0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x2009,
-	0x8020, 0x080c, 0x91ed, 0x0c78, 0x6007, 0x003b, 0x602f, 0x0003,
-	0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x91ed,
-	0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017, 0x0000, 0x0804,
-	0xd329, 0x00e6, 0x0026, 0x080c, 0x6a19, 0x0550, 0x080c, 0x69be,
-	0x080c, 0xe50a, 0x1518, 0x2071, 0x1800, 0x70dc, 0x9085, 0x0003,
-	0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0, 0x9284, 0x00ff, 0x707e,
-	0x78e6, 0x9284, 0xff00, 0x7280, 0x9205, 0x7082, 0x78ea, 0x00fe,
-	0x70e7, 0x0000, 0x080c, 0x6a57, 0x0120, 0x2011, 0x1a09, 0x2013,
-	0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2fb2, 0x0010, 0x080c, 0xe53c,
-	0x002e, 0x00ee, 0x080c, 0xabc9, 0x0804, 0xd201, 0x080c, 0xabc9,
-	0x0005, 0x2600, 0x0002, 0xd425, 0xd456, 0xd467, 0xd425, 0xd425,
-	0xd427, 0xd478, 0xd425, 0xd425, 0xd425, 0xd444, 0xd425, 0xd425,
-	0xd425, 0xd483, 0xd490, 0xd4c1, 0xd425, 0x080c, 0x0d7d, 0x080c,
-	0xe498, 0x1d20, 0x080c, 0x332b, 0x1d08, 0x080c, 0xd5db, 0x1148,
-	0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001, 0x080c, 0x91f4,
-	0x0005, 0x080c, 0x31e4, 0x080c, 0xcf43, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x91f4, 0x0005, 0x080c, 0xe498, 0x1938, 0x080c,
-	0x332b, 0x1920, 0x080c, 0xd5db, 0x1d60, 0x703c, 0x6016, 0x6007,
-	0x004a, 0x6003, 0x0001, 0x080c, 0x91f4, 0x0005, 0x080c, 0x332b,
-	0x1904, 0xd40e, 0x2009, 0x0041, 0x080c, 0xe545, 0x6007, 0x0047,
-	0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x0005, 0x080c,
-	0x332b, 0x1904, 0xd40e, 0x2009, 0x0042, 0x080c, 0xe545, 0x6007,
-	0x0047, 0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x0005,
-	0x080c, 0x332b, 0x1904, 0xd40e, 0x2009, 0x0046, 0x080c, 0xe545,
-	0x080c, 0xabc9, 0x0005, 0x080c, 0xd4e3, 0x0904, 0xd40e, 0x6007,
-	0x004e, 0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x0005,
-	0x6007, 0x004f, 0x6017, 0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff,
-	0x0508, 0x9186, 0x0001, 0x1160, 0x7140, 0x2001, 0x19bd, 0x2004,
-	0x9106, 0x11b0, 0x7144, 0x2001, 0x19be, 0x2004, 0x9106, 0x0190,
-	0x9186, 0x0002, 0x1168, 0x2011, 0x0276, 0x20a9, 0x0004, 0x6010,
-	0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xbb9e, 0x009e, 0x0110,
-	0x6017, 0x0001, 0x6003, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f,
-	0x0005, 0x6007, 0x0050, 0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6,
-	0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260, 0x6010, 0x2058, 0xb8d4,
-	0xd084, 0x0150, 0x7128, 0x6050, 0x9106, 0x1120, 0x712c, 0x604c,
-	0x9106, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x00be,
-	0x00ee, 0x001e, 0x0005, 0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6,
-	0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x7090, 0x908a,
-	0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x19a0, 0x2003, 0x0000,
-	0x080c, 0x1053, 0x05a0, 0x2900, 0x6016, 0x7090, 0x8004, 0xa816,
-	0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9, 0x001e, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016,
-	0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x1053, 0x01c0, 0x2900,
-	0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016,
-	0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001, 0x0048, 0x2071,
-	0x1800, 0x7093, 0x0000, 0x6014, 0x2048, 0x080c, 0x0fec, 0x9006,
-	0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e, 0x001e, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8,
-	0x080c, 0x2189, 0x2099, 0x026c, 0x2001, 0x0014, 0x3518, 0x9312,
-	0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108,
-	0x080c, 0x2189, 0x2099, 0x0260, 0x0ca8, 0x080c, 0x2189, 0x2061,
-	0x19a0, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
-	0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2189,
-	0x2099, 0x0260, 0x0ca8, 0x2061, 0x19a0, 0x2019, 0x0280, 0x3300,
-	0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0260, 0x6006, 0x8108,
-	0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
-	0x00c6, 0x81ff, 0x11b8, 0x080c, 0x21a1, 0x20a1, 0x024c, 0x2001,
-	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8,
-	0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c, 0x21a1, 0x20a1,
-	0x0240, 0x0c98, 0x080c, 0x21a1, 0x2061, 0x19a3, 0x6004, 0x20a0,
-	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8,
-	0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c, 0x21a1, 0x20a1,
-	0x0240, 0x0c98, 0x2061, 0x19a3, 0x2019, 0x0260, 0x3400, 0x931e,
-	0x0110, 0x6006, 0x0020, 0x2001, 0x0240, 0x6006, 0x8108, 0x2162,
-	0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04,
-	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0170, 0x9686, 0x0004,
-	0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0128, 0x9686,
-	0x0004, 0x0110, 0x9085, 0x0001, 0x006e, 0x00be, 0x0005, 0x00d6,
-	0x080c, 0xd671, 0x00de, 0x0005, 0x00d6, 0x080c, 0xd67e, 0x1520,
-	0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff, 0x9115, 0x6216,
-	0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c, 0xe665, 0x2009,
-	0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c, 0x00ff, 0x6824,
-	0x080c, 0x25fb, 0x1148, 0x2001, 0x0001, 0x080c, 0xe665, 0x2110,
-	0x900e, 0x080c, 0x3235, 0x0018, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0xac3b, 0x0598, 0x0016,
-	0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x25fb, 0x1568, 0x080c, 0x65bd, 0x1550, 0xbe12, 0xbd16, 0x00ce,
-	0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xe498, 0x11c8, 0x080c,
-	0x332b, 0x11b0, 0x080c, 0xd5db, 0x0500, 0x2001, 0x0007, 0x080c,
-	0x656e, 0x2001, 0x0007, 0x080c, 0x659a, 0x6017, 0x0000, 0x6023,
-	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x91f4, 0x0010,
-	0x080c, 0xabc9, 0x9085, 0x0001, 0x00ce, 0x00be, 0x0005, 0x080c,
-	0xabc9, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c, 0xabc9, 0x9006,
-	0x0c98, 0x2069, 0x026d, 0x6800, 0x9082, 0x0010, 0x1228, 0x6017,
-	0x0000, 0x9085, 0x0001, 0x0008, 0x9006, 0x0005, 0x6017, 0x0000,
-	0x2069, 0x026c, 0x6808, 0x9084, 0xff00, 0x9086, 0x0800, 0x1190,
-	0x6904, 0x9186, 0x0018, 0x0118, 0x9186, 0x0014, 0x1158, 0x810f,
-	0x6800, 0x9084, 0x00ff, 0x910d, 0x6162, 0x908e, 0x0014, 0x0110,
-	0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d,
-	0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04, 0xd7c0,
-	0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, 0x190c, 0x0d7d,
-	0x2001, 0x0007, 0x080c, 0x659a, 0x080c, 0x95ad, 0x080c, 0xac04,
-	0x080c, 0x966f, 0x0005, 0xd6fb, 0xd6fd, 0xd6fb, 0xd6fb, 0xd6fb,
-	0xd6fd, 0xd70a, 0xd7bd, 0xd75a, 0xd7bd, 0xd76e, 0xd7bd, 0xd70a,
-	0xd7bd, 0xd7b5, 0xd7bd, 0xd7b5, 0xd7bd, 0xd7bd, 0xd6fb, 0xd6fb,
-	0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb,
-	0xd6fb, 0xd6fd, 0xd6fb, 0xd7bd, 0xd6fb, 0xd6fb, 0xd7bd, 0xd6fb,
-	0xd7ba, 0xd7bd, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd7bd, 0xd7bd,
-	0xd6fb, 0xd7bd, 0xd7bd, 0xd6fb, 0xd705, 0xd6fb, 0xd6fb, 0xd6fb,
-	0xd6fb, 0xd7b9, 0xd7bd, 0xd6fb, 0xd6fb, 0xd7bd, 0xd7bd, 0xd6fb,
-	0xd6fb, 0xd6fb, 0xd6fb, 0x080c, 0x0d7d, 0x080c, 0xcf46, 0x6003,
-	0x0002, 0x080c, 0x966f, 0x0804, 0xd7bf, 0x9006, 0x080c, 0x655a,
-	0x0804, 0xd7bd, 0x080c, 0x6a53, 0x1904, 0xd7bd, 0x9006, 0x080c,
-	0x655a, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6,
-	0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010,
-	0x2058, 0xb884, 0x9005, 0x1178, 0x080c, 0xcf2e, 0x1904, 0xd7bd,
-	0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4cb7, 0x004e,
-	0x003e, 0x0804, 0xd7bd, 0x080c, 0x335c, 0x1904, 0xd7bd, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800,
-	0x78a8, 0x8000, 0x78aa, 0x00fe, 0x2001, 0x0002, 0x080c, 0x656e,
-	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x91f4,
-	0x080c, 0x966f, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c, 0x861b,
-	0x0804, 0xd7bf, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0006, 0x0904, 0xd7bd, 0x9686, 0x0004, 0x0904, 0xd7bd,
-	0x080c, 0x8e99, 0x2001, 0x0004, 0x0804, 0xd7bb, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
-	0xbba0, 0x2021, 0x0006, 0x080c, 0x4cb7, 0x004e, 0x003e, 0x2001,
-	0x0006, 0x080c, 0xd7d9, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4,
-	0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006,
-	0x080c, 0x659a, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001,
-	0x0006, 0x080c, 0x656e, 0x080c, 0x6a53, 0x11f8, 0x2001, 0x1837,
-	0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
-	0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe,
-	0x0804, 0xd744, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0409,
-	0x0020, 0x0018, 0x0010, 0x080c, 0x659a, 0x080c, 0xabc9, 0x0005,
-	0x2600, 0x0002, 0xd7d4, 0xd7d4, 0xd7d4, 0xd7d4, 0xd7d4, 0xd7d6,
-	0xd7d4, 0xd7d6, 0xd7d4, 0xd7d4, 0xd7d6, 0xd7d4, 0xd7d4, 0xd7d4,
-	0xd7d6, 0xd7d6, 0xd7d6, 0xd7d6, 0x080c, 0x0d7d, 0x080c, 0xabc9,
-	0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184,
-	0x0138, 0x080c, 0x656e, 0x9006, 0x080c, 0x655a, 0x080c, 0x3215,
-	0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084,
-	0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0d7d, 0x91b6, 0x0015,
-	0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0d7d, 0x006b,
-	0x0005, 0xb67a, 0xb67a, 0xb67a, 0xb67a, 0xb67a, 0xb67a, 0xd854,
-	0xd819, 0xb67a, 0xb67a, 0xb67a, 0xb67a, 0xb67a, 0xb67a, 0xb67a,
-	0xb67a, 0xb67a, 0xb67a, 0xd854, 0xd85b, 0xb67a, 0xb67a, 0xb67a,
-	0xb67a, 0x00f6, 0x080c, 0x6a53, 0x11d8, 0x080c, 0xcf2e, 0x11c0,
-	0x6010, 0x905d, 0x01a8, 0xb884, 0x9005, 0x0190, 0x9006, 0x080c,
-	0x655a, 0x2001, 0x0002, 0x080c, 0x656e, 0x6023, 0x0001, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x91f4, 0x080c, 0x966f, 0x00d0,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1190,
-	0x080c, 0x661e, 0x0118, 0x080c, 0xabc9, 0x0060, 0xb810, 0x0006,
-	0xb814, 0x0006, 0x080c, 0x603c, 0x000e, 0xb816, 0x000e, 0xb812,
-	0x080c, 0xabc9, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110,
-	0x080c, 0xabc9, 0x0005, 0x080c, 0xba03, 0x1148, 0x6003, 0x0001,
-	0x6007, 0x0001, 0x080c, 0x91f4, 0x080c, 0x966f, 0x0010, 0x080c,
-	0xabc9, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x080c,
-	0x95ad, 0x080c, 0xac04, 0x0005, 0x9182, 0x0040, 0x0002, 0xd88a,
-	0xd88a, 0xd88a, 0xd88a, 0xd88c, 0xd88a, 0xd88a, 0xd88a, 0xd88a,
-	0xd88a, 0xd88a, 0xd88a, 0xd88a, 0xd88a, 0xd88a, 0xd88a, 0xd88a,
-	0xd88a, 0xd88a, 0x080c, 0x0d7d, 0x0096, 0x00b6, 0x00d6, 0x00e6,
-	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11b0,
-	0x6007, 0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904,
-	0xd8f3, 0x080c, 0xe659, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009,
-	0x0001, 0x2011, 0x0200, 0x080c, 0x88bb, 0x0020, 0x9026, 0x080c,
-	0xe4dd, 0x0c30, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x6003, 0x0007,
-	0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e,
-	0x6008, 0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016,
-	0xa876, 0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c,
-	0x6d70, 0x001e, 0x080c, 0xe659, 0x1904, 0xd953, 0x9486, 0x2000,
-	0x1130, 0x2019, 0x0017, 0x080c, 0xe20e, 0x0804, 0xd953, 0x9486,
-	0x0200, 0x1120, 0x080c, 0xe19e, 0x0804, 0xd953, 0x9486, 0x0400,
-	0x0120, 0x9486, 0x1000, 0x1904, 0xd953, 0x2019, 0x0002, 0x080c,
-	0xe1bd, 0x0804, 0xd953, 0x2069, 0x1a6f, 0x6a00, 0xd284, 0x0904,
-	0xd9bd, 0x9284, 0x0300, 0x1904, 0xd9b6, 0x6804, 0x9005, 0x0904,
-	0xd99e, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1053, 0x0904, 0xd95f,
-	0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000,
-	0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xd9c1, 0x9006, 0xa802,
-	0xa867, 0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010,
-	0x2058, 0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c,
-	0xa9be, 0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044,
-	0x9084, 0x0003, 0x9080, 0xd95b, 0x2005, 0xa87e, 0x20a9, 0x000a,
-	0x2001, 0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b,
-	0x0080, 0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003,
-	0x200b, 0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c,
-	0xa9ae, 0x080c, 0x6d73, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de,
-	0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001,
-	0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x103a, 0x1904, 0xd908,
-	0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022,
-	0x080c, 0x91ed, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00,
-	0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114,
-	0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007,
-	0x0043, 0x2009, 0xa025, 0x080c, 0x91ed, 0x0828, 0x6868, 0x602e,
-	0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041,
-	0x2009, 0xa022, 0x080c, 0x91ed, 0x0804, 0xd953, 0x2001, 0x180e,
-	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b00, 0x6017,
-	0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041,
-	0x2009, 0xa022, 0x080c, 0x91ed, 0x0804, 0xd953, 0x6017, 0xf500,
-	0x0c98, 0x6017, 0xf600, 0x0804, 0xd973, 0x6017, 0xf200, 0x0804,
-	0xd973, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00,
-	0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xd95b, 0x2005, 0xa87e,
-	0x2928, 0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c,
-	0xa88e, 0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009,
-	0x0205, 0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011,
-	0x0210, 0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c,
-	0x0d7d, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xda3d, 0x2041, 0x0001,
-	0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003,
-	0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001,
-	0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1053, 0x0170, 0x2900,
-	0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d,
-	0x0118, 0x080c, 0x106c, 0x0cc8, 0x080c, 0x106c, 0x0804, 0xd95f,
-	0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b,
-	0x0000, 0x080c, 0xe241, 0x0804, 0xd953, 0x8010, 0x0004, 0x801a,
-	0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013,
-	0x1160, 0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d7d, 0x9082, 0x0040,
-	0x0a0c, 0x0d7d, 0x2008, 0x0804, 0xdac8, 0x9186, 0x0051, 0x0108,
-	0x0040, 0x080c, 0xaa84, 0x01e8, 0x9086, 0x0002, 0x0904, 0xdb0f,
-	0x00c0, 0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128, 0x9186,
-	0x0014, 0x0150, 0x190c, 0x0d7d, 0x080c, 0xaa84, 0x0150, 0x9086,
-	0x0004, 0x0904, 0xdbac, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008,
-	0x001a, 0x080c, 0xac85, 0x0005, 0xda8f, 0xda91, 0xda91, 0xdab8,
-	0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f,
-	0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f, 0xda8f, 0x080c,
-	0x0d7d, 0x080c, 0x95ad, 0x080c, 0x966f, 0x0036, 0x0096, 0x6014,
-	0x904d, 0x01d8, 0x080c, 0xc814, 0x01c0, 0x6003, 0x0002, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004,
-	0x080c, 0xe241, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001,
-	0x1987, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005,
-	0x0096, 0x080c, 0x95ad, 0x080c, 0x966f, 0x080c, 0xc814, 0x0120,
-	0x6014, 0x2048, 0x080c, 0x106c, 0x080c, 0xac04, 0x009e, 0x0005,
-	0x0002, 0xdadc, 0xdaf1, 0xdade, 0xdb06, 0xdadc, 0xdadc, 0xdadc,
-	0xdadc, 0xdadc, 0xdadc, 0xdadc, 0xdadc, 0xdadc, 0xdadc, 0xdadc,
-	0xdadc, 0xdadc, 0xdadc, 0xdadc, 0x080c, 0x0d7d, 0x0096, 0x6014,
-	0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043,
-	0x080c, 0xac68, 0x0010, 0x6003, 0x0004, 0x080c, 0x966f, 0x009e,
-	0x0005, 0x080c, 0xc814, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c,
-	0x009e, 0xd1ec, 0x1138, 0x080c, 0x8890, 0x080c, 0xabc9, 0x080c,
-	0x966f, 0x0005, 0x080c, 0xe4a1, 0x0db0, 0x0cc8, 0x6003, 0x0001,
-	0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x91ed, 0x0005, 0x9182,
-	0x0040, 0x0002, 0xdb25, 0xdb27, 0xdb25, 0xdb25, 0xdb25, 0xdb25,
-	0xdb25, 0xdb25, 0xdb25, 0xdb25, 0xdb25, 0xdb25, 0xdb25, 0xdb25,
-	0xdb25, 0xdb25, 0xdb25, 0xdb28, 0xdb25, 0x080c, 0x0d7d, 0x0005,
-	0x00d6, 0x080c, 0x8890, 0x00de, 0x080c, 0xe4f9, 0x080c, 0xabc9,
-	0x0005, 0x9182, 0x0040, 0x0002, 0xdb47, 0xdb47, 0xdb47, 0xdb47,
-	0xdb47, 0xdb47, 0xdb47, 0xdb47, 0xdb47, 0xdb49, 0xdb74, 0xdb47,
-	0xdb47, 0xdb47, 0xdb47, 0xdb74, 0xdb47, 0xdb47, 0xdb47, 0x080c,
-	0x0d7d, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x908c,
-	0x0003, 0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168, 0x2009,
-	0x0041, 0x009e, 0x0804, 0xdc34, 0x6003, 0x0007, 0x601b, 0x0000,
-	0x080c, 0x8890, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec,
-	0x1130, 0x080c, 0x8890, 0x080c, 0xabc9, 0x009e, 0x0005, 0x080c,
-	0xe4a1, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c, 0xc1d4,
-	0x2102, 0x0036, 0x080c, 0x960a, 0x080c, 0x966f, 0x6014, 0x0096,
-	0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0188,
-	0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac, 0x6330,
-	0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003, 0x0002,
-	0x0080, 0x2019, 0x0004, 0x080c, 0xe241, 0x6018, 0x9005, 0x1128,
-	0x2001, 0x1987, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000, 0x6003,
-	0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xdbc3,
-	0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc5,
-	0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3, 0xdbc3,
-	0xdbc3, 0xdbc3, 0xdc10, 0x080c, 0x0d7d, 0x6014, 0x0096, 0x2048,
-	0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc,
-	0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009, 0x0041,
-	0x009e, 0x0804, 0xdc34, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
-	0x8890, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006, 0x0046,
-	0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420, 0x6432,
-	0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110, 0x00b6,
-	0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e, 0x210c,
-	0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006, 0x00e9,
-	0x080c, 0x8892, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005,
-	0x6024, 0xd0f4, 0x0128, 0x080c, 0x1670, 0x1904, 0xdbc5, 0x0005,
-	0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105, 0x1120,
-	0x080c, 0x1670, 0x1904, 0xdbc5, 0x0005, 0xd2fc, 0x0140, 0x8002,
-	0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010, 0x2009,
-	0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208, 0x0062,
-	0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d, 0x6024,
-	0xd0dc, 0x090c, 0x0d7d, 0x0005, 0xdc57, 0xdc63, 0xdc6f, 0xdc7b,
-	0xdc57, 0xdc57, 0xdc57, 0xdc57, 0xdc5e, 0xdc59, 0xdc59, 0xdc57,
-	0xdc57, 0xdc57, 0xdc57, 0xdc59, 0xdc57, 0xdc59, 0xdc57, 0x080c,
-	0x0d7d, 0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0x6014, 0x9005,
-	0x190c, 0x0d7d, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091,
-	0x8000, 0x2009, 0xa022, 0x080c, 0x91cf, 0x012e, 0x0005, 0x6003,
-	0x0004, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c,
-	0x91ed, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c, 0x1c03,
-	0x0126, 0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc,
-	0x0188, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x6024, 0xd0cc,
-	0x1148, 0xd0c4, 0x1138, 0xa8a8, 0x9005, 0x1120, 0x6144, 0x918d,
-	0xb035, 0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c, 0x9234,
-	0x012e, 0x0005, 0x6144, 0x918d, 0xa032, 0x0cb8, 0x0126, 0x2091,
-	0x8000, 0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e,
-	0x012e, 0x0005, 0xdcc2, 0xdcc4, 0xdcd9, 0xdcf3, 0xdcc2, 0xdcc2,
-	0xdcc2, 0xdcc2, 0xdcc2, 0xdcc2, 0xdcc2, 0xdcc2, 0xdcc2, 0xdcc2,
-	0xdcc2, 0xdcc2, 0x080c, 0x0d7d, 0x6014, 0x2048, 0xa87c, 0xd0fc,
-	0x0510, 0x909c, 0x0003, 0x939e, 0x0003, 0x01e8, 0x6003, 0x0001,
-	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x91ed,
-	0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003,
-	0x939e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106, 0x2009, 0xa001,
-	0x080c, 0x91ed, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004,
-	0x080c, 0xe241, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98,
-	0x909c, 0x0003, 0x939e, 0x0003, 0x0d70, 0x6003, 0x0003, 0x6106,
-	0x080c, 0x1c03, 0x6144, 0x918d, 0xa035, 0x080c, 0x9234, 0x0005,
-	0x080c, 0x95ad, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
-	0xe5f6, 0x0036, 0x2019, 0x0029, 0x080c, 0xe241, 0x003e, 0x009e,
-	0x080c, 0xac04, 0x080c, 0x966f, 0x0005, 0x080c, 0x960a, 0x6114,
-	0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe5f6, 0x0036, 0x2019,
-	0x0029, 0x080c, 0xe241, 0x003e, 0x009e, 0x080c, 0xac04, 0x0005,
-	0x9182, 0x0085, 0x0002, 0xdd42, 0xdd40, 0xdd40, 0xdd4e, 0xdd40,
-	0xdd40, 0xdd40, 0xdd40, 0xdd40, 0xdd40, 0xdd40, 0xdd40, 0xdd40,
-	0x080c, 0x0d7d, 0x6003, 0x000b, 0x6106, 0x0126, 0x2091, 0x8000,
-	0x2009, 0x8020, 0x080c, 0x91ed, 0x012e, 0x0005, 0x0026, 0x00e6,
-	0x080c, 0xe498, 0x0118, 0x080c, 0xabc9, 0x0440, 0x2071, 0x0260,
-	0x7224, 0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010,
-	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c,
-	0xaef6, 0x7220, 0x080c, 0xe0d7, 0x0118, 0x6007, 0x0086, 0x0040,
-	0x6007, 0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086,
-	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x91ed, 0x00ee, 0x002e,
-	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
-	0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085, 0x00a2,
-	0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0xac85,
-	0x0050, 0x2001, 0x0007, 0x080c, 0x659a, 0x080c, 0x95ad, 0x080c,
-	0xac04, 0x080c, 0x966f, 0x0005, 0xddb1, 0xddb3, 0xddb3, 0xddb1,
-	0xddb1, 0xddb1, 0xddb1, 0xddb1, 0xddb1, 0xddb1, 0xddb1, 0xddb1,
-	0xddb1, 0x080c, 0x0d7d, 0x080c, 0xac04, 0x080c, 0x966f, 0x0005,
-	0x9182, 0x0085, 0x0a0c, 0x0d7d, 0x9182, 0x0092, 0x1a0c, 0x0d7d,
-	0x9182, 0x0085, 0x0002, 0xddd0, 0xddd0, 0xddd0, 0xddd2, 0xddd0,
-	0xddd0, 0xddd0, 0xddd0, 0xddd0, 0xddd0, 0xddd0, 0xddd0, 0xddd0,
-	0x080c, 0x0d7d, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014,
-	0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xac85, 0x0020, 0x080c,
-	0x95ad, 0x080c, 0xac04, 0x0005, 0x0036, 0x080c, 0xe4f9, 0x604b,
-	0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006, 0x6003, 0x0007,
-	0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000, 0x2001, 0x0382,
-	0x2004, 0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110, 0x080c,
-	0xa872, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa1f4, 0x009e,
-	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0xa29f, 0x007e, 0x1520,
-	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
-	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe4f9, 0x080c, 0xcf46,
-	0x080c, 0x1a6a, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xc814,
-	0x0110, 0x080c, 0xe241, 0x009e, 0x6017, 0x0000, 0x080c, 0xe4f9,
-	0x6023, 0x0007, 0x080c, 0xcf46, 0x000e, 0x9086, 0x0003, 0x0110,
-	0x080c, 0xa88e, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6, 0x00b6,
-	0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c, 0x25fb,
-	0x15d8, 0x0016, 0x00c6, 0x080c, 0x661e, 0x15a0, 0x001e, 0x00c6,
-	0x2160, 0x080c, 0xcf43, 0x00ce, 0x002e, 0x0026, 0x0016, 0x080c,
-	0xa872, 0x2019, 0x0029, 0x080c, 0xa366, 0x080c, 0x9374, 0x0076,
-	0x903e, 0x080c, 0x9246, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
-	0xdfc0, 0x007e, 0x080c, 0xa88e, 0x0026, 0xba04, 0x9294, 0xff00,
-	0x8217, 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0,
-	0x080c, 0x32b7, 0x002e, 0x001e, 0x080c, 0x603c, 0xbe12, 0xbd16,
-	0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce,
-	0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1824,
-	0x2104, 0x9086, 0x0074, 0x1904, 0xdee3, 0x2069, 0x0260, 0x6944,
-	0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xdee0,
-	0x2001, 0x197c, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb884,
-	0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001,
-	0x0648, 0x080c, 0xe65e, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009,
-	0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182,
-	0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001,
-	0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100,
-	0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017,
-	0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028,
-	0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008,
-	0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6,
-	0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff,
-	0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00,
-	0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c,
-	0x662d, 0x0804, 0xdf4f, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
-	0x2b48, 0x2019, 0x000a, 0x080c, 0xbb9e, 0x009e, 0x15c8, 0x2011,
-	0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
-	0xbb9e, 0x009e, 0x1568, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006,
-	0x2009, 0x1848, 0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c,
-	0xe29e, 0xb800, 0xc0e5, 0xb802, 0x080c, 0xa872, 0x2019, 0x0029,
-	0x080c, 0x9374, 0x0076, 0x2039, 0x0000, 0x080c, 0x9246, 0x2c08,
-	0x080c, 0xdfc0, 0x007e, 0x080c, 0xa88e, 0x2001, 0x0007, 0x080c,
-	0x659a, 0x2001, 0x0007, 0x080c, 0x656e, 0x001e, 0x004e, 0x9006,
-	0x015e, 0x003e, 0x002e, 0x00be, 0x00ce, 0x0005, 0x00d6, 0x2069,
-	0x026e, 0x6800, 0x9086, 0x0800, 0x0118, 0x6017, 0x0000, 0x0008,
-	0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6, 0x0016, 0x0026, 0x0036,
-	0x0156, 0x2079, 0x026c, 0x7930, 0x7834, 0x080c, 0x25fb, 0x11d0,
-	0x080c, 0x661e, 0x11b8, 0x2011, 0x0270, 0x20a9, 0x0004, 0x0096,
-	0x2b48, 0x2019, 0x000a, 0x080c, 0xbb9e, 0x009e, 0x1158, 0x2011,
-	0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
-	0xbb9e, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00be,
-	0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x11d0, 0x080c,
-	0x661e, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x000a, 0x080c, 0xbb9e, 0x009e, 0x1158, 0x2011, 0x027a,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xbb9e,
-	0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e, 0x00be, 0x0005,
-	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xa8d0, 0x0106, 0x190c, 0xa872,
-	0x2740, 0x2029, 0x19f3, 0x252c, 0x2021, 0x19fa, 0x2424, 0x2061,
-	0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074, 0x81ff, 0x0150, 0x0006,
-	0x9186, 0x1b32, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xe065,
-	0x0018, 0x9606, 0x0904, 0xe065, 0x080c, 0x8b5f, 0x0904, 0xe05c,
-	0x2100, 0x9c06, 0x0904, 0xe05c, 0x080c, 0xe2df, 0x1904, 0xe05c,
-	0x080c, 0xe67b, 0x0904, 0xe05c, 0x080c, 0xe2cf, 0x0904, 0xe05c,
-	0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x335c, 0x0904, 0xe0a7,
-	0x6004, 0x9086, 0x0000, 0x1904, 0xe0a7, 0x9786, 0x0004, 0x0904,
-	0xe0a7, 0x9786, 0x0007, 0x0904, 0xe05c, 0x2500, 0x9c06, 0x0904,
-	0xe05c, 0x2400, 0x9c06, 0x0904, 0xe05c, 0x88ff, 0x0118, 0x605c,
-	0x9906, 0x15d0, 0x0096, 0x6043, 0xffff, 0x6000, 0x9086, 0x0004,
-	0x1120, 0x0016, 0x080c, 0x1a6a, 0x001e, 0x9786, 0x000a, 0x0148,
-	0x080c, 0xca29, 0x1130, 0x080c, 0xb591, 0x009e, 0x080c, 0xac04,
-	0x0418, 0x6014, 0x2048, 0x080c, 0xc814, 0x01d8, 0x9786, 0x0003,
-	0x1588, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878,
-	0x2048, 0x080c, 0x0fec, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0xe5f6, 0x0016, 0x080c, 0xcb12, 0x080c, 0x6d64, 0x001e, 0x080c,
-	0xca03, 0x009e, 0x080c, 0xac04, 0x9ce0, 0x001c, 0x2001, 0x181a,
-	0x2004, 0x9c02, 0x1210, 0x0804, 0xdfd9, 0x010e, 0x190c, 0xa88e,
-	0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce,
-	0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005, 0x0128,
-	0x080c, 0xe5f6, 0x080c, 0xe241, 0x08e0, 0x009e, 0x08e8, 0x9786,
-	0x0009, 0x11f8, 0x6000, 0x9086, 0x0004, 0x01c0, 0x6000, 0x9086,
-	0x0003, 0x11a0, 0x080c, 0x960a, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xc814, 0x0118, 0x6010, 0x080c, 0x6d70, 0x009e, 0x00c6, 0x080c,
-	0xabc9, 0x00ce, 0x0036, 0x080c, 0x966f, 0x003e, 0x009e, 0x0804,
-	0xe05c, 0x9786, 0x000a, 0x0904, 0xe043, 0x0804, 0xe041, 0x81ff,
-	0x0904, 0xe05c, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0138,
-	0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1904, 0xe05c, 0x6000,
-	0x9086, 0x0002, 0x1904, 0xe05c, 0x080c, 0xca18, 0x0138, 0x080c,
-	0xca29, 0x1904, 0xe05c, 0x080c, 0xb591, 0x0038, 0x080c, 0x3215,
-	0x080c, 0xca29, 0x1110, 0x080c, 0xb591, 0x080c, 0xac04, 0x0804,
-	0xe05c, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6,
-	0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xe268, 0x001e,
-	0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005,
-	0xe0f6, 0xe0f6, 0xe0f6, 0xe0f6, 0xe0f6, 0xe0f6, 0xe0f8, 0xe0f6,
-	0xe0f6, 0xe0f6, 0xe0f6, 0xac04, 0xac04, 0xe0f6, 0x9006, 0x0005,
-	0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be,
-	0x2c00, 0x2009, 0x0020, 0x080c, 0xe29e, 0x001e, 0x004e, 0x2019,
-	0x0002, 0x080c, 0xddf2, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096,
-	0x080c, 0xc814, 0x0140, 0x6014, 0x904d, 0x080c, 0xc41f, 0x687b,
-	0x0005, 0x080c, 0x6d70, 0x009e, 0x080c, 0xac04, 0x9085, 0x0001,
-	0x0005, 0x2001, 0x0001, 0x080c, 0x655a, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c,
-	0xbb8a, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091,
-	0x8000, 0x2740, 0x2061, 0x1ddc, 0x2079, 0x0001, 0x8fff, 0x0904,
-	0xe191, 0x2071, 0x1800, 0x7654, 0x7074, 0x8001, 0x9602, 0x1a04,
-	0xe191, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c,
-	0xe2cf, 0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006,
-	0x1538, 0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06,
-	0x11f8, 0x85ff, 0x0118, 0x605c, 0x9106, 0x11d0, 0x0096, 0x601c,
-	0xd084, 0x0140, 0x080c, 0xe4f9, 0x080c, 0xcf46, 0x080c, 0x1a6a,
-	0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xc814, 0x0120, 0x0046,
-	0x080c, 0xe241, 0x004e, 0x009e, 0x080c, 0xac04, 0x88ff, 0x1198,
-	0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804,
-	0xe146, 0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce,
-	0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x080c, 0xa872,
-	0x00b6, 0x0076, 0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20,
-	0x2019, 0x0002, 0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0xa1f4,
-	0x009e, 0x008e, 0x903e, 0x080c, 0xa29f, 0x080c, 0xe137, 0x005e,
-	0x007e, 0x00be, 0x080c, 0xa88e, 0x0005, 0x080c, 0xa872, 0x00b6,
-	0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9,
-	0x007f, 0x900e, 0x0016, 0x0036, 0x080c, 0x661e, 0x1190, 0x0056,
-	0x0086, 0x9046, 0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c,
-	0xa1f4, 0x009e, 0x008e, 0x903e, 0x080c, 0xa29f, 0x080c, 0xe137,
-	0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xe1ca, 0x015e, 0x00ce,
-	0x007e, 0x005e, 0x004e, 0x00be, 0x080c, 0xa88e, 0x0005, 0x080c,
-	0xa872, 0x00b6, 0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046,
-	0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0xa1f4,
-	0x009e, 0x008e, 0x903e, 0x080c, 0xa29f, 0x2c20, 0x080c, 0xe137,
-	0x005e, 0x007e, 0x00be, 0x080c, 0xa88e, 0x0005, 0x080c, 0xa872,
-	0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9,
-	0x0800, 0x900e, 0x0016, 0x0036, 0x080c, 0x661e, 0x11a0, 0x0086,
-	0x9046, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c, 0xe4dd, 0x004e,
-	0x0096, 0x904e, 0x080c, 0xa1f4, 0x009e, 0x008e, 0x903e, 0x080c,
-	0xa29f, 0x080c, 0xe137, 0x003e, 0x001e, 0x8108, 0x1f04, 0xe21a,
-	0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c, 0xa88e,
-	0x0005, 0x0016, 0x00f6, 0x080c, 0xc812, 0x0198, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803,
-	0x0000, 0xab82, 0x080c, 0x6d70, 0x2f48, 0x0cb0, 0xab82, 0x080c,
-	0x6d70, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803,
-	0x0000, 0x080c, 0x6d70, 0x2f48, 0x0cb8, 0x080c, 0x6d70, 0x0c88,
-	0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc, 0x9005, 0x1138, 0x2071,
-	0x1800, 0x7454, 0x7074, 0x8001, 0x9402, 0x12f8, 0x2100, 0x9c06,
-	0x0188, 0x6000, 0x9086, 0x0000, 0x0168, 0x6008, 0x9206, 0x1150,
-	0x6320, 0x9386, 0x0009, 0x01b0, 0x6010, 0x91a0, 0x0004, 0x2424,
-	0x9406, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02,
-	0x1220, 0x0c20, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e,
-	0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68, 0x0c30, 0x0096, 0x0006,
-	0x080c, 0x103a, 0x000e, 0x090c, 0x0d7d, 0xaae2, 0xa867, 0x010d,
-	0xa88e, 0x0026, 0x2010, 0x080c, 0xc802, 0x2001, 0x0000, 0x0120,
-	0x2200, 0x9080, 0x0017, 0x2004, 0x002e, 0xa87a, 0x9186, 0x0020,
-	0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76, 0xa87f, 0x0000, 0x2001,
-	0x198e, 0x2004, 0xa882, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6d70, 0x012e, 0x009e, 0x0005, 0x6700,
-	0x9786, 0x0000, 0x0158, 0x9786, 0x0001, 0x0140, 0x9786, 0x000a,
-	0x0128, 0x9786, 0x0009, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6,
-	0x6010, 0x9075, 0x0138, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206,
-	0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e,
-	0x001e, 0x11a0, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0005, 0x2001, 0x1987,
-	0x2004, 0x601a, 0x2009, 0x8020, 0x080c, 0x91ed, 0x001e, 0x0005,
-	0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118,
-	0x080c, 0xcb59, 0x0030, 0x080c, 0xe4f9, 0x080c, 0x8890, 0x080c,
-	0xabc9, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002,
-	0xe32e, 0xe32e, 0xe32e, 0xe330, 0xe32e, 0xe330, 0xe330, 0xe32e,
-	0xe330, 0xe32e, 0xe32e, 0xe32e, 0xe32e, 0xe32e, 0x9006, 0x0005,
-	0x9085, 0x0001, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f,
-	0x0002, 0xe347, 0xe347, 0xe347, 0xe347, 0xe347, 0xe347, 0xe354,
-	0xe347, 0xe347, 0xe347, 0xe347, 0xe347, 0xe347, 0xe347, 0x6007,
-	0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x2009,
-	0x8020, 0x080c, 0x91ed, 0x0005, 0x0096, 0x00c6, 0x2260, 0x080c,
-	0xe4f9, 0x604b, 0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b,
-	0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186, 0x0007, 0x1904, 0xe3ad,
-	0x6814, 0x9005, 0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de,
-	0x009e, 0x08a8, 0x6007, 0x003a, 0x6003, 0x0001, 0x2009, 0x8020,
-	0x080c, 0x91ed, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x1904,
-	0xe424, 0x6014, 0x9005, 0x1138, 0x6000, 0x9086, 0x0007, 0x190c,
-	0x0d7d, 0x0804, 0xe424, 0x2048, 0x080c, 0xc814, 0x1130, 0x0028,
-	0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084,
-	0x0003, 0x9086, 0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e,
-	0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043, 0x080c, 0xdc34, 0x0804,
-	0xe424, 0x2009, 0x0041, 0x0804, 0xe41e, 0x9186, 0x0005, 0x15a0,
-	0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804,
-	0xe347, 0xd0b4, 0x0128, 0xd0fc, 0x090c, 0x0d7d, 0x0804, 0xe368,
-	0x6007, 0x003a, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x91ed,
-	0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004,
-	0x1904, 0xe424, 0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e,
-	0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c, 0x1731,
-	0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036, 0x080c, 0x103a, 0x090c,
-	0x0d7d, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18,
-	0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360,
-	0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be,
-	0x2004, 0x635c, 0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a,
-	0xae96, 0xa89f, 0x0001, 0x080c, 0x6d70, 0x2019, 0x0045, 0x6008,
-	0x2068, 0x080c, 0xddf2, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003,
-	0x0007, 0x901e, 0x631a, 0x634a, 0x003e, 0x0038, 0x604b, 0x0000,
-	0x6003, 0x0007, 0x080c, 0xdc34, 0x00ce, 0x00de, 0x009e, 0x0005,
-	0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x00c2,
-	0x9186, 0x0027, 0x1178, 0x080c, 0x95ad, 0x0036, 0x0096, 0x6014,
-	0x2048, 0x2019, 0x0004, 0x080c, 0xe241, 0x009e, 0x003e, 0x080c,
-	0x966f, 0x0005, 0x9186, 0x0014, 0x0d70, 0x080c, 0xac85, 0x0005,
-	0xe457, 0xe455, 0xe455, 0xe455, 0xe455, 0xe455, 0xe457, 0xe455,
-	0xe455, 0xe455, 0xe455, 0xe455, 0xe455, 0x080c, 0x0d7d, 0x6003,
-	0x000c, 0x080c, 0x966f, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182,
-	0x0085, 0x0208, 0x001a, 0x080c, 0xac85, 0x0005, 0xe473, 0xe473,
-	0xe473, 0xe473, 0xe475, 0xe495, 0xe473, 0xe473, 0xe473, 0xe473,
-	0xe473, 0xe473, 0xe473, 0x080c, 0x0d7d, 0x00d6, 0x2c68, 0x080c,
-	0xab73, 0x01b0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e,
-	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff,
-	0x6910, 0x6112, 0x6023, 0x0004, 0x2009, 0x8020, 0x080c, 0x91ed,
-	0x2d60, 0x080c, 0xabc9, 0x00de, 0x0005, 0x080c, 0xabc9, 0x0005,
-	0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee,
-	0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002,
-	0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001, 0x1988, 0x2004,
-	0x604a, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009,
-	0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006,
-	0x00d8, 0x2001, 0x1988, 0x200c, 0x2001, 0x1986, 0x2004, 0x9100,
-	0x9080, 0x000a, 0x604a, 0x6010, 0x00b6, 0x2058, 0xb8bc, 0x00be,
-	0x0008, 0x2104, 0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a,
-	0x600f, 0x0000, 0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6,
-	0x615c, 0xb8bc, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x605c,
-	0x9106, 0x1138, 0x600c, 0x2072, 0x080c, 0x8890, 0x080c, 0xabc9,
-	0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e,
-	0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8bc, 0x2068, 0x9005,
-	0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be,
-	0x00de, 0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x182c, 0x2204,
-	0x9084, 0x00ff, 0x2019, 0x026e, 0x2334, 0x9636, 0x1508, 0x8318,
-	0x2334, 0x2204, 0x9084, 0xff00, 0x9636, 0x11d0, 0x2011, 0x0270,
-	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c,
-	0xbb9e, 0x009e, 0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010,
-	0x0096, 0x2048, 0x2019, 0x0006, 0x080c, 0xbb9e, 0x009e, 0x1100,
-	0x015e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c,
-	0x5fb5, 0x080c, 0x2fb2, 0x00ee, 0x0005, 0x0096, 0x0026, 0x080c,
-	0x103a, 0x090c, 0x0d7d, 0xa85c, 0x9080, 0x001a, 0x20a0, 0x20a9,
-	0x000c, 0xa860, 0x20e8, 0x9006, 0x4004, 0x9186, 0x0046, 0x1118,
-	0xa867, 0x0136, 0x0038, 0xa867, 0x0138, 0x9186, 0x0041, 0x0110,
-	0xa87b, 0x0001, 0x7038, 0x9084, 0xff00, 0x7240, 0x9294, 0xff00,
-	0x8007, 0x9215, 0xaa9a, 0x9186, 0x0046, 0x1168, 0x7038, 0x9084,
-	0x00ff, 0x723c, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x723c, 0x9294,
-	0x00ff, 0xaaa2, 0x0060, 0x7040, 0x9084, 0x00ff, 0x7244, 0x9294,
-	0xff00, 0x9215, 0xaa9e, 0x7244, 0x9294, 0x00ff, 0xaaa2, 0x9186,
-	0x0046, 0x1118, 0x9e90, 0x0012, 0x0010, 0x9e90, 0x001a, 0x2204,
-	0x8007, 0xa8a6, 0x8210, 0x2204, 0x8007, 0xa8aa, 0x8210, 0x2204,
-	0x8007, 0xa8ae, 0x8210, 0x2204, 0x8007, 0xa8b2, 0x8210, 0x9186,
-	0x0046, 0x11b8, 0x9e90, 0x0016, 0x2204, 0x8007, 0xa8b6, 0x8210,
-	0x2204, 0x8007, 0xa8ba, 0x8210, 0x2204, 0x8007, 0xa8be, 0x8210,
-	0x2204, 0x8007, 0xa8c2, 0x8210, 0x2011, 0x0205, 0x2013, 0x0001,
-	0x00b0, 0x9e90, 0x001e, 0x2204, 0x8007, 0xa8b6, 0x8210, 0x2204,
-	0x8007, 0xa8ba, 0x2011, 0x0205, 0x2013, 0x0001, 0x2011, 0x0260,
-	0x2204, 0x8007, 0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x9186,
-	0x0046, 0x1118, 0x2011, 0x0262, 0x0010, 0x2011, 0x026a, 0x0146,
-	0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019, 0x0008, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204, 0x8007, 0x4004, 0x8210,
-	0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e, 0x2011, 0x0205, 0x2013,
-	0x0000, 0x002e, 0x080c, 0x6d70, 0x009e, 0x0005, 0x00e6, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc, 0x0108, 0x0011, 0x00ee,
-	0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005, 0x00e6, 0x00d6, 0x00c6,
-	0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0016, 0x0126, 0x2091,
-	0x8000, 0x2029, 0x19f3, 0x252c, 0x2021, 0x19fa, 0x2424, 0x2061,
-	0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074, 0x9606, 0x0578, 0x6720,
-	0x9786, 0x0001, 0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06,
-	0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c, 0xe2cf, 0x01b8, 0x080c,
-	0xe2df, 0x11a0, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c,
-	0x1a6a, 0x001e, 0x080c, 0xca18, 0x1110, 0x080c, 0x3215, 0x080c,
-	0xca29, 0x1110, 0x080c, 0xb591, 0x080c, 0xac04, 0x9ce0, 0x001c,
-	0x2001, 0x181a, 0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e,
-	0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee,
-	0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001,
-	0x1837, 0x2004, 0xd09c, 0x000e, 0x0005, 0x0006, 0x0036, 0x0046,
-	0x080c, 0xcf2e, 0x0168, 0x2019, 0xffff, 0x9005, 0x0128, 0x6010,
-	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004, 0x080c, 0x4cb7,
-	0x004e, 0x003e, 0x000e, 0x6004, 0x9086, 0x0001, 0x1128, 0x080c,
-	0xa366, 0x080c, 0xac04, 0x9006, 0x0005, 0x00e6, 0x00c6, 0x00b6,
-	0x0046, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7454, 0x7074, 0x8001,
-	0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148, 0x6000, 0x9086, 0x0000,
-	0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x0140, 0x9ce0, 0x001c,
-	0x2001, 0x181a, 0x2004, 0x9c02, 0x1220, 0x0c60, 0x9085, 0x0001,
-	0x0008, 0x9006, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x0005, 0x0126,
-	0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071, 0x1840, 0xd5a4,
-	0x0118, 0x7004, 0x8000, 0x7006, 0xd5b4, 0x0118, 0x7000, 0x8000,
-	0x7002, 0xd5ac, 0x0178, 0x2500, 0x9084, 0x0007, 0x908e, 0x0003,
-	0x0148, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x2071,
-	0xfffe, 0x0089, 0x001e, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0126,
-	0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xfff6, 0x0021, 0x00ee,
-	0x000e, 0x012e, 0x0005, 0x2e05, 0x8000, 0x2077, 0x1220, 0x8e70,
-	0x2e05, 0x8000, 0x2077, 0x0005, 0x00e6, 0x2071, 0xfff4, 0x0c99,
-	0x00ee, 0x0005, 0x00e6, 0x2071, 0xfff8, 0x0c69, 0x00ee, 0x0005,
-	0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0x1840, 0x7014,
-	0x8000, 0x7016, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0001, 0x0002,
-	0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
-	0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0xf93e
+	0x0001, 0x00f0, 0x080c, 0xe14c, 0x0140, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0978, 0x0804, 0xd10c, 0x6017, 0x1900, 0x6007,
+	0x0009, 0x0070, 0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xe4c3,
+	0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c, 0x6007, 0x0012,
+	0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0cb0,
+	0x6007, 0x0005, 0x0c68, 0x080c, 0xe4c3, 0x1904, 0xd433, 0x080c,
+	0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c, 0x6007,
+	0x0020, 0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0005,
+	0x080c, 0x3332, 0x1904, 0xd433, 0x6007, 0x0023, 0x6003, 0x0001,
+	0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x080c, 0xe4c3, 0x1904,
+	0xd433, 0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904,
+	0xd10c, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286,
+	0xffff, 0x0180, 0x2c08, 0x080c, 0xc826, 0x01b0, 0x2260, 0x7240,
+	0x6008, 0x9206, 0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206,
+	0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006, 0x080c, 0xe293, 0x1180,
+	0x7244, 0x9286, 0xffff, 0x01b0, 0x2160, 0x6007, 0x0026, 0x6017,
+	0x1700, 0x7214, 0x9296, 0xffff, 0x1180, 0x6007, 0x0025, 0x0068,
+	0x6020, 0x9086, 0x0007, 0x1d80, 0x6004, 0x9086, 0x0024, 0x1110,
+	0x080c, 0xabed, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c,
+	0x9225, 0x080c, 0x96a0, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001,
+	0x0001, 0x080c, 0x6561, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xbbae, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xd220,
+	0x080c, 0xb81f, 0x080c, 0x74e9, 0x1190, 0x0006, 0x0026, 0x0036,
+	0x080c, 0x7503, 0x1138, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c,
+	0x741a, 0x0010, 0x080c, 0x74bd, 0x003e, 0x002e, 0x000e, 0x0005,
+	0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c,
+	0x6106, 0x080c, 0xd61c, 0x1120, 0x6007, 0x002b, 0x0804, 0xd220,
+	0x6007, 0x002c, 0x0804, 0xd220, 0x080c, 0xe4c3, 0x1904, 0xd433,
+	0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c,
+	0x6106, 0x080c, 0xd621, 0x1120, 0x6007, 0x002e, 0x0804, 0xd220,
+	0x6007, 0x002f, 0x0804, 0xd220, 0x080c, 0x3332, 0x1904, 0xd433,
+	0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff,
+	0x9086, 0x0006, 0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006,
+	0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0xd227, 0x080c, 0x56de,
+	0xd0e4, 0x0904, 0xd37e, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014,
+	0x603e, 0x7108, 0x720c, 0x080c, 0x6a67, 0x0140, 0x6010, 0x2058,
+	0xb810, 0x9106, 0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x6a63,
+	0x15b8, 0x2069, 0x1800, 0x6880, 0x9206, 0x1590, 0x687c, 0x9106,
+	0x1578, 0x7210, 0x080c, 0xc826, 0x0590, 0x080c, 0xd4eb, 0x0578,
+	0x080c, 0xe345, 0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001,
+	0x2009, 0x8020, 0x080c, 0x921e, 0x00ce, 0x00de, 0x00ee, 0x0005,
+	0x7214, 0x9286, 0xffff, 0x0150, 0x080c, 0xc826, 0x01c0, 0x9280,
+	0x0002, 0x2004, 0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08,
+	0x9085, 0x0001, 0x080c, 0xe293, 0x2c10, 0x2160, 0x0140, 0x0890,
+	0x6007, 0x0037, 0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007,
+	0x0037, 0x602f, 0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012,
+	0x0868, 0x080c, 0x3332, 0x1904, 0xd433, 0x6010, 0x2058, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x9086, 0x0006, 0x1904, 0xd227, 0x00e6,
+	0x00d6, 0x00c6, 0x080c, 0x56de, 0xd0e4, 0x0904, 0xd3f6, 0x2069,
+	0x1800, 0x2071, 0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286,
+	0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xe293, 0x2c10, 0x00ce, 0x05e8, 0x080c, 0xc826, 0x05d0, 0x7108,
+	0x9280, 0x0002, 0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260,
+	0x080c, 0xc436, 0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f,
+	0x9186, 0x0001, 0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007,
+	0x1198, 0x9280, 0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xd4eb,
+	0x0904, 0xd377, 0x0056, 0x7510, 0x7614, 0x080c, 0xe35e, 0x005e,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009,
+	0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e,
+	0x0c78, 0x6007, 0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x0c10, 0x6007, 0x003b,
+	0x602f, 0x000b, 0x6017, 0x0000, 0x0804, 0xd34e, 0x00e6, 0x0026,
+	0x080c, 0x6a29, 0x0550, 0x080c, 0x69c5, 0x080c, 0xe535, 0x1518,
+	0x2071, 0x1800, 0x70dc, 0x9085, 0x0003, 0x70de, 0x00f6, 0x2079,
+	0x0100, 0x72b0, 0x9284, 0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00,
+	0x7280, 0x9205, 0x7082, 0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c,
+	0x6a67, 0x0120, 0x2011, 0x1a09, 0x2013, 0x07d0, 0xd0ac, 0x1128,
+	0x080c, 0x2fb2, 0x0010, 0x080c, 0xe567, 0x002e, 0x00ee, 0x080c,
+	0xabed, 0x0804, 0xd226, 0x080c, 0xabed, 0x0005, 0x2600, 0x0002,
+	0xd44a, 0xd47b, 0xd48c, 0xd44a, 0xd44a, 0xd44c, 0xd49d, 0xd44a,
+	0xd44a, 0xd44a, 0xd469, 0xd44a, 0xd44a, 0xd44a, 0xd4a8, 0xd4b5,
+	0xd4e6, 0xd44a, 0x080c, 0x0d7d, 0x080c, 0xe4c3, 0x1d20, 0x080c,
+	0x3332, 0x1d08, 0x080c, 0xd600, 0x1148, 0x7038, 0x6016, 0x6007,
+	0x0045, 0x6003, 0x0001, 0x080c, 0x9225, 0x0005, 0x080c, 0x31e7,
+	0x080c, 0xcf67, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9225,
+	0x0005, 0x080c, 0xe4c3, 0x1938, 0x080c, 0x3332, 0x1920, 0x080c,
+	0xd600, 0x1d60, 0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001,
+	0x080c, 0x9225, 0x0005, 0x080c, 0x3332, 0x1904, 0xd433, 0x2009,
+	0x0041, 0x080c, 0xe570, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c,
+	0x9225, 0x080c, 0x96a0, 0x0005, 0x080c, 0x3332, 0x1904, 0xd433,
+	0x2009, 0x0042, 0x080c, 0xe570, 0x6007, 0x0047, 0x6003, 0x0001,
+	0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x080c, 0x3332, 0x1904,
+	0xd433, 0x2009, 0x0046, 0x080c, 0xe570, 0x080c, 0xabed, 0x0005,
+	0x080c, 0xd508, 0x0904, 0xd433, 0x6007, 0x004e, 0x6003, 0x0001,
+	0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x6007, 0x004f, 0x6017,
+	0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001,
+	0x1160, 0x7140, 0x2001, 0x19bd, 0x2004, 0x9106, 0x11b0, 0x7144,
+	0x2001, 0x19be, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168,
+	0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
+	0x000a, 0x080c, 0xbbc2, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x6007, 0x0050,
+	0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6,
+	0x00c6, 0x2260, 0x6010, 0x2058, 0xb8d4, 0xd084, 0x0150, 0x7128,
+	0x6050, 0x9106, 0x1120, 0x712c, 0x604c, 0x9106, 0x0110, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005,
+	0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1800, 0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1,
+	0x0000, 0x2001, 0x19a0, 0x2003, 0x0000, 0x080c, 0x1053, 0x05a0,
+	0x2900, 0x6016, 0x7090, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0,
+	0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016, 0x200c, 0x0471, 0x001e,
+	0x2940, 0x080c, 0x1053, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff,
+	0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016, 0x200c, 0x00b1, 0x001e,
+	0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x7093, 0x0000,
+	0x6014, 0x2048, 0x080c, 0x0fec, 0x9006, 0x012e, 0x01de, 0x01ce,
+	0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x2189, 0x2099,
+	0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2189, 0x2099,
+	0x0260, 0x0ca8, 0x080c, 0x2189, 0x2061, 0x19a0, 0x6004, 0x2098,
+	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x2189, 0x2099, 0x0260, 0x0ca8,
+	0x2061, 0x19a0, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006,
+	0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
+	0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8,
+	0x080c, 0x21a1, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8,
+	0x22a8, 0x8108, 0x080c, 0x21a1, 0x20a1, 0x0240, 0x0c98, 0x080c,
+	0x21a1, 0x2061, 0x19a3, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138,
+	0x22a8, 0x8108, 0x080c, 0x21a1, 0x20a1, 0x0240, 0x0c98, 0x2061,
+	0x19a3, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020,
+	0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296,
+	0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085,
+	0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xd696, 0x00de,
+	0x0005, 0x00d6, 0x080c, 0xd6a3, 0x1520, 0x680c, 0x908c, 0xff00,
+	0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4,
+	0x0130, 0x9006, 0x080c, 0xe690, 0x2009, 0x0001, 0x0078, 0xd1ec,
+	0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x25fb, 0x1148,
+	0x2001, 0x0001, 0x080c, 0xe690, 0x2110, 0x900e, 0x080c, 0x323c,
+	0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
+	0x00c6, 0x080c, 0xac5f, 0x0598, 0x0016, 0x0026, 0x00c6, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1568, 0x080c,
+	0x65c4, 0x1550, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00,
+	0x6012, 0x080c, 0xe4c3, 0x11c8, 0x080c, 0x3332, 0x11b0, 0x080c,
+	0xd600, 0x0500, 0x2001, 0x0007, 0x080c, 0x6575, 0x2001, 0x0007,
+	0x080c, 0x65a1, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x9225, 0x0010, 0x080c, 0xabed, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0xabed, 0x00ce, 0x002e,
+	0x001e, 0x0ca8, 0x080c, 0xabed, 0x9006, 0x0c98, 0x2069, 0x026d,
+	0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808,
+	0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018,
+	0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff,
+	0x910d, 0x6162, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005,
+	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d, 0x91b6, 0x0013, 0x1130,
+	0x2008, 0x91b2, 0x0040, 0x1a04, 0xd7e5, 0x0092, 0x91b6, 0x0027,
+	0x0120, 0x91b6, 0x0014, 0x190c, 0x0d7d, 0x2001, 0x0007, 0x080c,
+	0x65a1, 0x080c, 0x95de, 0x080c, 0xac28, 0x080c, 0x96a0, 0x0005,
+	0xd720, 0xd722, 0xd720, 0xd720, 0xd720, 0xd722, 0xd72f, 0xd7e2,
+	0xd77f, 0xd7e2, 0xd793, 0xd7e2, 0xd72f, 0xd7e2, 0xd7da, 0xd7e2,
+	0xd7da, 0xd7e2, 0xd7e2, 0xd720, 0xd720, 0xd720, 0xd720, 0xd720,
+	0xd720, 0xd720, 0xd720, 0xd720, 0xd720, 0xd720, 0xd722, 0xd720,
+	0xd7e2, 0xd720, 0xd720, 0xd7e2, 0xd720, 0xd7df, 0xd7e2, 0xd720,
+	0xd720, 0xd720, 0xd720, 0xd7e2, 0xd7e2, 0xd720, 0xd7e2, 0xd7e2,
+	0xd720, 0xd72a, 0xd720, 0xd720, 0xd720, 0xd720, 0xd7de, 0xd7e2,
+	0xd720, 0xd720, 0xd7e2, 0xd7e2, 0xd720, 0xd720, 0xd720, 0xd720,
+	0x080c, 0x0d7d, 0x080c, 0xcf6a, 0x6003, 0x0002, 0x080c, 0x96a0,
+	0x0804, 0xd7e4, 0x9006, 0x080c, 0x6561, 0x0804, 0xd7e2, 0x080c,
+	0x6a63, 0x1904, 0xd7e2, 0x9006, 0x080c, 0x6561, 0x6010, 0x2058,
+	0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a8,
+	0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb884, 0x9005,
+	0x1178, 0x080c, 0xcf52, 0x1904, 0xd7e2, 0x0036, 0x0046, 0xbba0,
+	0x2021, 0x0007, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x0804, 0xd7e2,
+	0x080c, 0x3363, 0x1904, 0xd7e2, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa,
+	0x00fe, 0x2001, 0x0002, 0x080c, 0x6575, 0x6023, 0x0001, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x9225, 0x080c, 0x96a0, 0x6110,
+	0x2158, 0x2009, 0x0001, 0x080c, 0x864c, 0x0804, 0xd7e4, 0x6610,
+	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904,
+	0xd7e2, 0x9686, 0x0004, 0x0904, 0xd7e2, 0x080c, 0x8eca, 0x2001,
+	0x0004, 0x0804, 0xd7e0, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
+	0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006,
+	0x080c, 0x4cbe, 0x004e, 0x003e, 0x2001, 0x0006, 0x080c, 0xd7fe,
+	0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637, 0x9686,
+	0x0006, 0x006e, 0x0168, 0x2001, 0x0006, 0x080c, 0x65a1, 0x9284,
+	0x00ff, 0x908e, 0x0007, 0x1120, 0x2001, 0x0006, 0x080c, 0x6575,
+	0x080c, 0x6a63, 0x11f8, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x01d0,
+	0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079,
+	0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0804, 0xd769, 0x2001,
+	0x0004, 0x0030, 0x2001, 0x0006, 0x0409, 0x0020, 0x0018, 0x0010,
+	0x080c, 0x65a1, 0x080c, 0xabed, 0x0005, 0x2600, 0x0002, 0xd7f9,
+	0xd7f9, 0xd7f9, 0xd7f9, 0xd7f9, 0xd7fb, 0xd7f9, 0xd7fb, 0xd7f9,
+	0xd7f9, 0xd7fb, 0xd7f9, 0xd7f9, 0xd7f9, 0xd7fb, 0xd7fb, 0xd7fb,
+	0xd7fb, 0x080c, 0x0d7d, 0x080c, 0xabed, 0x0005, 0x0016, 0x00b6,
+	0x00d6, 0x6110, 0x2158, 0xb900, 0xd184, 0x0138, 0x080c, 0x6575,
+	0x9006, 0x080c, 0x6561, 0x080c, 0x321c, 0x00de, 0x00be, 0x001e,
+	0x0005, 0x6610, 0x2658, 0xb804, 0x9084, 0xff00, 0x8007, 0x90b2,
+	0x000c, 0x1a0c, 0x0d7d, 0x91b6, 0x0015, 0x1110, 0x003b, 0x0028,
+	0x91b6, 0x0016, 0x190c, 0x0d7d, 0x006b, 0x0005, 0xb69e, 0xb69e,
+	0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xd87d, 0xd83e, 0xb69e, 0xb69e,
+	0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e,
+	0xd87d, 0xd884, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0x00f6, 0x080c,
+	0x6a63, 0x11d8, 0x080c, 0xcf52, 0x11c0, 0x6010, 0x905d, 0x01a8,
+	0xb884, 0x9005, 0x0190, 0x9006, 0x080c, 0x6561, 0x2001, 0x0002,
+	0x080c, 0x6575, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x9225, 0x080c, 0x96a0, 0x00f0, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x25fb, 0x11b0, 0x080c, 0x6625, 0x0118,
+	0x080c, 0xabed, 0x0080, 0xb810, 0x0006, 0xb814, 0x0006, 0xb884,
+	0x0006, 0x080c, 0x6043, 0x000e, 0xb886, 0x000e, 0xb816, 0x000e,
+	0xb812, 0x080c, 0xabed, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e,
+	0x1110, 0x080c, 0xabed, 0x0005, 0x080c, 0xba27, 0x1148, 0x6003,
+	0x0001, 0x6007, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0010,
+	0x080c, 0xabed, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d,
+	0x080c, 0x95de, 0x080c, 0xac28, 0x0005, 0x9182, 0x0040, 0x0002,
+	0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b5, 0xd8b3, 0xd8b3, 0xd8b3,
+	0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3,
+	0xd8b3, 0xd8b3, 0xd8b3, 0x080c, 0x0d7d, 0x0096, 0x00b6, 0x00d6,
+	0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005,
+	0x11b0, 0x6007, 0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00,
+	0x0904, 0xd91c, 0x080c, 0xe684, 0x1170, 0x9486, 0x2000, 0x1158,
+	0x2009, 0x0001, 0x2011, 0x0200, 0x080c, 0x88ec, 0x0020, 0x9026,
+	0x080c, 0xe508, 0x0c30, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x6003,
+	0x0007, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00,
+	0xa88e, 0x6008, 0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a,
+	0x0016, 0xa876, 0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036,
+	0x080c, 0x6d80, 0x001e, 0x080c, 0xe684, 0x1904, 0xd97c, 0x9486,
+	0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xe239, 0x0804, 0xd97c,
+	0x9486, 0x0200, 0x1120, 0x080c, 0xe1c9, 0x0804, 0xd97c, 0x9486,
+	0x0400, 0x0120, 0x9486, 0x1000, 0x1904, 0xd97c, 0x2019, 0x0002,
+	0x080c, 0xe1e8, 0x0804, 0xd97c, 0x2069, 0x1a6f, 0x6a00, 0xd284,
+	0x0904, 0xd9e6, 0x9284, 0x0300, 0x1904, 0xd9df, 0x6804, 0x9005,
+	0x0904, 0xd9c7, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1053, 0x0904,
+	0xd988, 0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017,
+	0x0000, 0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xd9ea, 0x9006,
+	0xa802, 0xa867, 0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a,
+	0x6010, 0x2058, 0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba,
+	0xb92c, 0xa9be, 0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xd984, 0x2005, 0xa87e, 0x20a9,
+	0x000a, 0x2001, 0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205,
+	0x200b, 0x0080, 0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0,
+	0x4003, 0x200b, 0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000,
+	0x200c, 0xa9ae, 0x080c, 0x6d83, 0x002e, 0x004e, 0x00fe, 0x00ee,
+	0x00de, 0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000,
+	0x2001, 0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x103a, 0x1904,
+	0xd931, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
+	0xa022, 0x080c, 0x921e, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084,
+	0xff00, 0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016,
+	0x6114, 0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001,
+	0x6007, 0x0043, 0x2009, 0xa025, 0x080c, 0x921e, 0x0828, 0x6868,
+	0x602e, 0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x921e, 0x0804, 0xd97c, 0x2001,
+	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b07,
+	0x6017, 0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x921e, 0x0804, 0xd97c, 0x6017,
+	0xf500, 0x0c98, 0x6017, 0xf600, 0x0804, 0xd99c, 0x6017, 0xf200,
+	0x0804, 0xd99c, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886,
+	0x2c00, 0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xd984, 0x2005,
+	0xa87e, 0x2928, 0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a,
+	0xb82c, 0xa88e, 0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d,
+	0x2009, 0x0205, 0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000,
+	0x2011, 0x0210, 0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111,
+	0x1a0c, 0x0d7d, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xda66, 0x2041,
+	0x0001, 0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8,
+	0x4003, 0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a,
+	0x2001, 0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1053, 0x0170,
+	0x2900, 0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800,
+	0x902d, 0x0118, 0x080c, 0x106c, 0x0cc8, 0x080c, 0x106c, 0x0804,
+	0xd988, 0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205,
+	0x200b, 0x0000, 0x080c, 0xe26c, 0x0804, 0xd97c, 0x8010, 0x0004,
+	0x801a, 0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186,
+	0x0013, 0x1160, 0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d7d, 0x9082,
+	0x0040, 0x0a0c, 0x0d7d, 0x2008, 0x0804, 0xdaf1, 0x9186, 0x0051,
+	0x0108, 0x0040, 0x080c, 0xaaa8, 0x01e8, 0x9086, 0x0002, 0x0904,
+	0xdb38, 0x00c0, 0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128,
+	0x9186, 0x0014, 0x0150, 0x190c, 0x0d7d, 0x080c, 0xaaa8, 0x0150,
+	0x9086, 0x0004, 0x0904, 0xdbd5, 0x0028, 0x6004, 0x9082, 0x0040,
+	0x2008, 0x001a, 0x080c, 0xaca9, 0x0005, 0xdab8, 0xdaba, 0xdaba,
+	0xdae1, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8,
+	0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8,
+	0x080c, 0x0d7d, 0x080c, 0x95de, 0x080c, 0x96a0, 0x0036, 0x0096,
+	0x6014, 0x904d, 0x01d8, 0x080c, 0xc838, 0x01c0, 0x6003, 0x0002,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019,
+	0x0004, 0x080c, 0xe26c, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120,
+	0x2001, 0x1987, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e,
+	0x0005, 0x0096, 0x080c, 0x95de, 0x080c, 0x96a0, 0x080c, 0xc838,
+	0x0120, 0x6014, 0x2048, 0x080c, 0x106c, 0x080c, 0xac28, 0x009e,
+	0x0005, 0x0002, 0xdb05, 0xdb1a, 0xdb07, 0xdb2f, 0xdb05, 0xdb05,
+	0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05,
+	0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0x080c, 0x0d7d, 0x0096,
+	0x6014, 0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009,
+	0x0043, 0x080c, 0xac8c, 0x0010, 0x6003, 0x0004, 0x080c, 0x96a0,
+	0x009e, 0x0005, 0x080c, 0xc838, 0x0138, 0x6114, 0x0096, 0x2148,
+	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x88c1, 0x080c, 0xabed,
+	0x080c, 0x96a0, 0x0005, 0x080c, 0xe4cc, 0x0db0, 0x0cc8, 0x6003,
+	0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x921e, 0x0005,
+	0x9182, 0x0040, 0x0002, 0xdb4e, 0xdb50, 0xdb4e, 0xdb4e, 0xdb4e,
+	0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e,
+	0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb51, 0xdb4e, 0x080c, 0x0d7d,
+	0x0005, 0x00d6, 0x080c, 0x88c1, 0x00de, 0x080c, 0xe524, 0x080c,
+	0xabed, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb70, 0xdb70, 0xdb70,
+	0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb72, 0xdb9d,
+	0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb9d, 0xdb70, 0xdb70, 0xdb70,
+	0x080c, 0x0d7d, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168,
+	0x908c, 0x0003, 0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xdc5d, 0x6003, 0x0007, 0x601b,
+	0x0000, 0x080c, 0x88c1, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c,
+	0xd1ec, 0x1130, 0x080c, 0x88c1, 0x080c, 0xabed, 0x009e, 0x0005,
+	0x080c, 0xe4cc, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c,
+	0xc1d4, 0x2102, 0x0036, 0x080c, 0x963b, 0x080c, 0x96a0, 0x6014,
+	0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac,
+	0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003,
+	0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xe26c, 0x6018, 0x9005,
+	0x1128, 0x2001, 0x1987, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002,
+	0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec,
+	0xdbee, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec,
+	0xdbec, 0xdbec, 0xdbec, 0xdc39, 0x080c, 0x0d7d, 0x6014, 0x0096,
+	0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
+	0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009,
+	0x0041, 0x009e, 0x0804, 0xdc5d, 0x6003, 0x0007, 0x601b, 0x0000,
+	0x080c, 0x88c1, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006,
+	0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420,
+	0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110,
+	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e,
+	0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006,
+	0x00e9, 0x080c, 0x88c3, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e,
+	0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x1670, 0x1904, 0xdbee,
+	0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105,
+	0x1120, 0x080c, 0x1670, 0x1904, 0xdbee, 0x0005, 0xd2fc, 0x0140,
+	0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010,
+	0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208,
+	0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d,
+	0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0xdc80, 0xdc8c, 0xdc98,
+	0xdca4, 0xdc80, 0xdc80, 0xdc80, 0xdc80, 0xdc87, 0xdc82, 0xdc82,
+	0xdc80, 0xdc80, 0xdc80, 0xdc80, 0xdc82, 0xdc80, 0xdc82, 0xdc80,
+	0x080c, 0x0d7d, 0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0x6014,
+	0x9005, 0x190c, 0x0d7d, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126,
+	0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x9200, 0x012e, 0x0005,
+	0x6003, 0x0004, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001,
+	0x080c, 0x921e, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c,
+	0x1c03, 0x0126, 0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c,
+	0xd0fc, 0x0188, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x6024,
+	0xd0cc, 0x1148, 0xd0c4, 0x1138, 0xa8a8, 0x9005, 0x1120, 0x6144,
+	0x918d, 0xb035, 0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c,
+	0x9265, 0x012e, 0x0005, 0x6144, 0x918d, 0xa032, 0x0cb8, 0x0126,
+	0x2091, 0x8000, 0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e,
+	0x003e, 0x012e, 0x0005, 0xdceb, 0xdced, 0xdd02, 0xdd1c, 0xdceb,
+	0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb,
+	0xdceb, 0xdceb, 0xdceb, 0x080c, 0x0d7d, 0x6014, 0x2048, 0xa87c,
+	0xd0fc, 0x0510, 0x909c, 0x0003, 0x939e, 0x0003, 0x01e8, 0x6003,
+	0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c,
+	0x921e, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c,
+	0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106, 0x2009,
+	0xa001, 0x080c, 0x921e, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019,
+	0x0004, 0x080c, 0xe26c, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc,
+	0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70, 0x6003, 0x0003,
+	0x6106, 0x080c, 0x1c03, 0x6144, 0x918d, 0xa035, 0x080c, 0x9265,
+	0x0005, 0x080c, 0x95de, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148,
+	0x080c, 0xe621, 0x0036, 0x2019, 0x0029, 0x080c, 0xe26c, 0x003e,
+	0x009e, 0x080c, 0xac28, 0x080c, 0x96a0, 0x0005, 0x080c, 0x963b,
+	0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe621, 0x0036,
+	0x2019, 0x0029, 0x080c, 0xe26c, 0x003e, 0x009e, 0x080c, 0xac28,
+	0x0005, 0x9182, 0x0085, 0x0002, 0xdd6b, 0xdd69, 0xdd69, 0xdd77,
+	0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69,
+	0xdd69, 0x080c, 0x0d7d, 0x6003, 0x000b, 0x6106, 0x0126, 0x2091,
+	0x8000, 0x2009, 0x8020, 0x080c, 0x921e, 0x012e, 0x0005, 0x0026,
+	0x00e6, 0x080c, 0xe4c3, 0x0118, 0x080c, 0xabed, 0x0440, 0x2071,
+	0x0260, 0x7224, 0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150,
+	0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e,
+	0x080c, 0xaf1a, 0x7220, 0x080c, 0xe102, 0x0118, 0x6007, 0x0086,
+	0x0040, 0x6007, 0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007,
+	0x0086, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x00ee,
+	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
+	0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085,
+	0x00a2, 0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c,
+	0xaca9, 0x0050, 0x2001, 0x0007, 0x080c, 0x65a1, 0x080c, 0x95de,
+	0x080c, 0xac28, 0x080c, 0x96a0, 0x0005, 0xddda, 0xdddc, 0xdddc,
+	0xddda, 0xddda, 0xddda, 0xddda, 0xddda, 0xddda, 0xddda, 0xddda,
+	0xddda, 0xddda, 0x080c, 0x0d7d, 0x080c, 0xac28, 0x080c, 0x96a0,
+	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0d7d, 0x9182, 0x0092, 0x1a0c,
+	0x0d7d, 0x9182, 0x0085, 0x0002, 0xddf9, 0xddf9, 0xddf9, 0xddfb,
+	0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9,
+	0xddf9, 0x080c, 0x0d7d, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaca9, 0x0020,
+	0x080c, 0x95de, 0x080c, 0xac28, 0x0005, 0x0036, 0x080c, 0xe524,
+	0x604b, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006, 0x6003,
+	0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110,
+	0x080c, 0xa896, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa218,
+	0x009e, 0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0xa2c3, 0x007e,
+	0x1520, 0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007,
+	0x01e0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe524, 0x080c,
+	0xcf6a, 0x080c, 0x1a6a, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
+	0xc838, 0x0110, 0x080c, 0xe26c, 0x009e, 0x6017, 0x0000, 0x080c,
+	0xe524, 0x6023, 0x0007, 0x080c, 0xcf6a, 0x000e, 0x9086, 0x0003,
+	0x0110, 0x080c, 0xa8b2, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6,
+	0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c,
+	0x25fb, 0x15e8, 0x0016, 0x00c6, 0x080c, 0x6625, 0x15b0, 0x001e,
+	0x00c6, 0x2160, 0x080c, 0xcf67, 0x00ce, 0x002e, 0x0026, 0x0016,
+	0x080c, 0xa896, 0x2019, 0x0029, 0x080c, 0xa38a, 0x080c, 0x93a5,
+	0x0076, 0x903e, 0x080c, 0x9277, 0x007e, 0x001e, 0x0076, 0x903e,
+	0x080c, 0xdfeb, 0x007e, 0x080c, 0xa8b2, 0x0026, 0xba04, 0x9294,
+	0xff00, 0x8217, 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118,
+	0xbaa0, 0x080c, 0x32be, 0x002e, 0xbc84, 0x001e, 0x080c, 0x6043,
+	0xbe12, 0xbd16, 0xbc86, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e,
+	0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6,
+	0x0016, 0x2009, 0x1824, 0x2104, 0x9086, 0x0074, 0x1904, 0xdf0e,
+	0x2069, 0x0260, 0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184,
+	0x8000, 0x0904, 0xdf0b, 0x2001, 0x197c, 0x2004, 0x9005, 0x1140,
+	0x6010, 0x2058, 0xb884, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598,
+	0x6948, 0x918a, 0x0001, 0x0648, 0x080c, 0xe689, 0x0118, 0x6978,
+	0xd1fc, 0x11b8, 0x2009, 0x0205, 0x200b, 0x0001, 0x693c, 0x81ff,
+	0x1198, 0x6944, 0x9182, 0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178,
+	0x6948, 0x918a, 0x0001, 0x0288, 0x6950, 0x918a, 0x0001, 0x0298,
+	0x00d0, 0x6017, 0x0100, 0x00a0, 0x6017, 0x0300, 0x0088, 0x6017,
+	0x0500, 0x0070, 0x6017, 0x0700, 0x0058, 0x6017, 0x0900, 0x0040,
+	0x6017, 0x0b00, 0x0028, 0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x001e, 0x00be, 0x00de, 0x00ce,
+	0x0005, 0x00c6, 0x00b6, 0x0026, 0x0036, 0x0156, 0x6210, 0x2258,
+	0xbb04, 0x9394, 0x00ff, 0x9286, 0x0006, 0x0180, 0x9286, 0x0004,
+	0x0168, 0x9394, 0xff00, 0x8217, 0x9286, 0x0006, 0x0138, 0x9286,
+	0x0004, 0x0120, 0x080c, 0x6634, 0x0804, 0xdf7a, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbc2,
+	0x009e, 0x15c8, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xbbc2, 0x009e, 0x1568, 0x0046, 0x0016,
+	0xbaa0, 0x2220, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0138,
+	0x2009, 0x0029, 0x080c, 0xe2c9, 0xb800, 0xc0e5, 0xb802, 0x080c,
+	0xa896, 0x2019, 0x0029, 0x080c, 0x93a5, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e, 0x080c, 0xa8b2,
+	0x2001, 0x0007, 0x080c, 0x65a1, 0x2001, 0x0007, 0x080c, 0x6575,
+	0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce,
+	0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118,
+	0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6,
+	0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834,
+	0x080c, 0x25fb, 0x11d0, 0x080c, 0x6625, 0x11b8, 0x2011, 0x0270,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbc2,
+	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xbbc2, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x25fb, 0x11d0, 0x080c, 0x6625, 0x11b8, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbc2, 0x009e,
+	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x0006, 0x080c, 0xbbc2, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
+	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x080c, 0xa8f4,
+	0x0106, 0x190c, 0xa896, 0x2740, 0x2029, 0x19f3, 0x252c, 0x2021,
+	0x19fa, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x81ff, 0x0150, 0x0006, 0x9186, 0x1b32, 0x000e, 0x0128, 0x8001,
+	0x9602, 0x1a04, 0xe090, 0x0018, 0x9606, 0x0904, 0xe090, 0x080c,
+	0x8b90, 0x0904, 0xe087, 0x2100, 0x9c06, 0x0904, 0xe087, 0x080c,
+	0xe30a, 0x1904, 0xe087, 0x080c, 0xe6a6, 0x0904, 0xe087, 0x080c,
+	0xe2fa, 0x0904, 0xe087, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c,
+	0x3363, 0x0904, 0xe0d2, 0x6004, 0x9086, 0x0000, 0x1904, 0xe0d2,
+	0x9786, 0x0004, 0x0904, 0xe0d2, 0x9786, 0x0007, 0x0904, 0xe087,
+	0x2500, 0x9c06, 0x0904, 0xe087, 0x2400, 0x9c06, 0x0904, 0xe087,
+	0x88ff, 0x0118, 0x605c, 0x9906, 0x15d0, 0x0096, 0x6043, 0xffff,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a6a, 0x001e,
+	0x9786, 0x000a, 0x0148, 0x080c, 0xca4d, 0x1130, 0x080c, 0xb5b5,
+	0x009e, 0x080c, 0xac28, 0x0418, 0x6014, 0x2048, 0x080c, 0xc838,
+	0x01d8, 0x9786, 0x0003, 0x1588, 0xa867, 0x0103, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0xe621, 0x0016, 0x080c, 0xcb36, 0x080c,
+	0x6d74, 0x001e, 0x080c, 0xca27, 0x009e, 0x080c, 0xac28, 0x9ce0,
+	0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe004,
+	0x010e, 0x190c, 0xa8b2, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e,
+	0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150,
+	0x9386, 0x0005, 0x0128, 0x080c, 0xe621, 0x080c, 0xe26c, 0x08e0,
+	0x009e, 0x08e8, 0x9786, 0x0009, 0x11f8, 0x6000, 0x9086, 0x0004,
+	0x01c0, 0x6000, 0x9086, 0x0003, 0x11a0, 0x080c, 0x963b, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xc838, 0x0118, 0x6010, 0x080c, 0x6d80,
+	0x009e, 0x00c6, 0x080c, 0xabed, 0x00ce, 0x0036, 0x080c, 0x96a0,
+	0x003e, 0x009e, 0x0804, 0xe087, 0x9786, 0x000a, 0x0904, 0xe06e,
+	0x0804, 0xe06c, 0x81ff, 0x0904, 0xe087, 0x9180, 0x0001, 0x2004,
+	0x9086, 0x0018, 0x0138, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d,
+	0x1904, 0xe087, 0x6000, 0x9086, 0x0002, 0x1904, 0xe087, 0x080c,
+	0xca3c, 0x0138, 0x080c, 0xca4d, 0x1904, 0xe087, 0x080c, 0xb5b5,
+	0x0038, 0x080c, 0x321c, 0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5,
+	0x080c, 0xac28, 0x0804, 0xe087, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006,
+	0x080c, 0xe293, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b,
+	0x00ee, 0x00ce, 0x0005, 0xe121, 0xe121, 0xe121, 0xe121, 0xe121,
+	0xe121, 0xe123, 0xe121, 0xe121, 0xe121, 0xe121, 0xac28, 0xac28,
+	0xe121, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xe2c9,
+	0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xde1b, 0x003e, 0x9085,
+	0x0001, 0x0005, 0x0096, 0x080c, 0xc838, 0x0140, 0x6014, 0x904d,
+	0x080c, 0xc443, 0x687b, 0x0005, 0x080c, 0x6d80, 0x009e, 0x080c,
+	0xac28, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x6561,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xbbae, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
+	0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1ddc, 0x2079,
+	0x0001, 0x8fff, 0x0904, 0xe1bc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x8001, 0x9602, 0x1a04, 0xe1bc, 0x88ff, 0x0120, 0x2800, 0x9c06,
+	0x1590, 0x2078, 0x080c, 0xe2fa, 0x0570, 0x2400, 0x9c06, 0x0558,
+	0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007, 0x0520, 0x88ff,
+	0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118, 0x605c, 0x9106,
+	0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe524, 0x080c,
+	0xcf6a, 0x080c, 0x1a6a, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
+	0xc838, 0x0120, 0x0046, 0x080c, 0xe26c, 0x004e, 0x009e, 0x080c,
+	0xac28, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1210, 0x0804, 0xe171, 0x9006, 0x012e, 0x00be, 0x006e,
+	0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001,
+	0x0ca0, 0x080c, 0xa896, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046,
+	0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096,
+	0x904e, 0x080c, 0xa218, 0x009e, 0x008e, 0x903e, 0x080c, 0xa2c3,
+	0x080c, 0xe162, 0x005e, 0x007e, 0x00be, 0x080c, 0xa8b2, 0x0005,
+	0x080c, 0xa896, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
+	0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c,
+	0x6625, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001,
+	0x0096, 0x904e, 0x080c, 0xa218, 0x009e, 0x008e, 0x903e, 0x080c,
+	0xa2c3, 0x080c, 0xe162, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
+	0xe1f5, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c,
+	0xa8b2, 0x0005, 0x080c, 0xa896, 0x00b6, 0x0076, 0x0056, 0x6210,
+	0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096,
+	0x904e, 0x080c, 0xa218, 0x009e, 0x008e, 0x903e, 0x080c, 0xa2c3,
+	0x2c20, 0x080c, 0xe162, 0x005e, 0x007e, 0x00be, 0x080c, 0xa8b2,
+	0x0005, 0x080c, 0xa896, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
+	0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c,
+	0x6625, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001,
+	0x080c, 0xe508, 0x004e, 0x0096, 0x904e, 0x080c, 0xa218, 0x009e,
+	0x008e, 0x903e, 0x080c, 0xa2c3, 0x080c, 0xe162, 0x003e, 0x001e,
+	0x8108, 0x1f04, 0xe245, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
+	0x00be, 0x080c, 0xa8b2, 0x0005, 0x0016, 0x00f6, 0x080c, 0xc836,
+	0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800,
+	0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x6d80, 0x2f48,
+	0x0cb0, 0xab82, 0x080c, 0x6d80, 0x00fe, 0x001e, 0x0005, 0xa800,
+	0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6d80, 0x2f48, 0x0cb8,
+	0x080c, 0x6d80, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc,
+	0x9005, 0x1138, 0x2071, 0x1800, 0x7454, 0x7074, 0x8001, 0x9402,
+	0x12f8, 0x2100, 0x9c06, 0x0188, 0x6000, 0x9086, 0x0000, 0x0168,
+	0x6008, 0x9206, 0x1150, 0x6320, 0x9386, 0x0009, 0x01b0, 0x6010,
+	0x91a0, 0x0004, 0x2424, 0x9406, 0x0140, 0x9ce0, 0x001c, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1220, 0x0c20, 0x9085, 0x0001, 0x0008,
+	0x9006, 0x003e, 0x004e, 0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68,
+	0x0c30, 0x0096, 0x0006, 0x080c, 0x103a, 0x000e, 0x090c, 0x0d7d,
+	0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xc826,
+	0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0017, 0x2004, 0x002e,
+	0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76,
+	0xa87f, 0x0000, 0x2001, 0x198e, 0x2004, 0xa882, 0x9006, 0xa802,
+	0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e,
+	0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786, 0x0001,
+	0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110, 0x9085,
+	0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8,
+	0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134, 0x918c,
+	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0005, 0x2001, 0x1987, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c,
+	0x921e, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4,
+	0x0158, 0xd0cc, 0x0118, 0x080c, 0xcb7d, 0x0030, 0x080c, 0xe524,
+	0x080c, 0x88c1, 0x080c, 0xabed, 0x0005, 0x9280, 0x0008, 0x2004,
+	0x9084, 0x000f, 0x0002, 0xe359, 0xe359, 0xe359, 0xe35b, 0xe359,
+	0xe35b, 0xe35b, 0xe359, 0xe35b, 0xe359, 0xe359, 0xe359, 0xe359,
+	0xe359, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008,
+	0x2004, 0x9084, 0x000f, 0x0002, 0xe372, 0xe372, 0xe372, 0xe372,
+	0xe372, 0xe372, 0xe37f, 0xe372, 0xe372, 0xe372, 0xe372, 0xe372,
+	0xe372, 0xe372, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x0005, 0x0096,
+	0x00c6, 0x2260, 0x080c, 0xe524, 0x604b, 0x0000, 0x6024, 0xc0f4,
+	0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186,
+	0x0007, 0x1904, 0xe3d8, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c,
+	0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x1904, 0xe44f, 0x6014, 0x9005, 0x1138, 0x6000,
+	0x9086, 0x0007, 0x190c, 0x0d7d, 0x0804, 0xe44f, 0x2048, 0x080c,
+	0xc838, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
+	0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1168, 0xa87c,
+	0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043,
+	0x080c, 0xdc5d, 0x0804, 0xe44f, 0x2009, 0x0041, 0x0804, 0xe449,
+	0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120,
+	0x00de, 0x009e, 0x0804, 0xe372, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
+	0x0d7d, 0x0804, 0xe393, 0x6007, 0x003a, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x921e, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002,
+	0x0120, 0x9186, 0x0004, 0x1904, 0xe44f, 0x6814, 0x2048, 0xa97c,
+	0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6,
+	0x2c78, 0x080c, 0x1731, 0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036,
+	0x080c, 0x103a, 0x090c, 0x0d7d, 0xa867, 0x010d, 0x9006, 0xa802,
+	0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892,
+	0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6,
+	0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c, 0xab7a, 0xa876, 0x9006,
+	0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c, 0x6d80,
+	0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xde1b, 0x2d00, 0x600a,
+	0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a, 0x634a, 0x003e,
+	0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c, 0xdc5d, 0x00ce,
+	0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
+	0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x95de,
+	0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c, 0xe26c,
+	0x009e, 0x003e, 0x080c, 0x96a0, 0x0005, 0x9186, 0x0014, 0x0d70,
+	0x080c, 0xaca9, 0x0005, 0xe482, 0xe480, 0xe480, 0xe480, 0xe480,
+	0xe480, 0xe482, 0xe480, 0xe480, 0xe480, 0xe480, 0xe480, 0xe480,
+	0x080c, 0x0d7d, 0x6003, 0x000c, 0x080c, 0x96a0, 0x0005, 0x9182,
+	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xaca9,
+	0x0005, 0xe49e, 0xe49e, 0xe49e, 0xe49e, 0xe4a0, 0xe4c0, 0xe49e,
+	0xe49e, 0xe49e, 0xe49e, 0xe49e, 0xe49e, 0xe49e, 0x080c, 0x0d7d,
+	0x00d6, 0x2c68, 0x080c, 0xab97, 0x01b0, 0x6003, 0x0001, 0x6007,
+	0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
+	0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x2009,
+	0x8020, 0x080c, 0x921e, 0x2d60, 0x080c, 0xabed, 0x00de, 0x0005,
+	0x080c, 0xabed, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec,
+	0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150,
+	0x2001, 0x1988, 0x2004, 0x604a, 0x2009, 0x1867, 0x210c, 0xd1f4,
+	0x1520, 0x00a0, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024,
+	0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1988, 0x200c, 0x2001,
+	0x1986, 0x2004, 0x9100, 0x9080, 0x000a, 0x604a, 0x6010, 0x00b6,
+	0x2058, 0xb8bc, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088,
+	0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005,
+	0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8bc, 0x2060, 0x8cff, 0x0180,
+	0x84ff, 0x1118, 0x605c, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c,
+	0x88c1, 0x080c, 0xabed, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70,
+	0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058,
+	0xb8bc, 0x2068, 0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0,
+	0x600c, 0x680e, 0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156,
+	0x2011, 0x182c, 0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334,
+	0x9636, 0x1508, 0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636,
+	0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
+	0x2019, 0x000a, 0x080c, 0xbbc2, 0x009e, 0x1168, 0x2011, 0x0274,
+	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c,
+	0xbbc2, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5fbc, 0x080c, 0x2fb2, 0x00ee, 0x0005,
+	0x0096, 0x0026, 0x080c, 0x103a, 0x090c, 0x0d7d, 0xa85c, 0x9080,
+	0x001a, 0x20a0, 0x20a9, 0x000c, 0xa860, 0x20e8, 0x9006, 0x4004,
+	0x9186, 0x0046, 0x1118, 0xa867, 0x0136, 0x0038, 0xa867, 0x0138,
+	0x9186, 0x0041, 0x0110, 0xa87b, 0x0001, 0x7038, 0x9084, 0xff00,
+	0x7240, 0x9294, 0xff00, 0x8007, 0x9215, 0xaa9a, 0x9186, 0x0046,
+	0x1168, 0x7038, 0x9084, 0x00ff, 0x723c, 0x9294, 0xff00, 0x9215,
+	0xaa9e, 0x723c, 0x9294, 0x00ff, 0xaaa2, 0x0060, 0x7040, 0x9084,
+	0x00ff, 0x7244, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x7244, 0x9294,
+	0x00ff, 0xaaa2, 0x9186, 0x0046, 0x1118, 0x9e90, 0x0012, 0x0010,
+	0x9e90, 0x001a, 0x2204, 0x8007, 0xa8a6, 0x8210, 0x2204, 0x8007,
+	0xa8aa, 0x8210, 0x2204, 0x8007, 0xa8ae, 0x8210, 0x2204, 0x8007,
+	0xa8b2, 0x8210, 0x9186, 0x0046, 0x11b8, 0x9e90, 0x0016, 0x2204,
+	0x8007, 0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba, 0x8210, 0x2204,
+	0x8007, 0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x8210, 0x2011,
+	0x0205, 0x2013, 0x0001, 0x00b0, 0x9e90, 0x001e, 0x2204, 0x8007,
+	0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba, 0x2011, 0x0205, 0x2013,
+	0x0001, 0x2011, 0x0260, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204,
+	0x8007, 0xa8c2, 0x9186, 0x0046, 0x1118, 0x2011, 0x0262, 0x0010,
+	0x2011, 0x026a, 0x0146, 0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019,
+	0x0008, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204,
+	0x8007, 0x4004, 0x8210, 0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e,
+	0x2011, 0x0205, 0x2013, 0x0000, 0x002e, 0x080c, 0x6d80, 0x009e,
+	0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc,
+	0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005,
+	0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026,
+	0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19f3, 0x252c, 0x2021,
+	0x19fa, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008,
+	0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c,
+	0xe2fa, 0x01b8, 0x080c, 0xe30a, 0x11a0, 0x6000, 0x9086, 0x0004,
+	0x1120, 0x0016, 0x080c, 0x1a6a, 0x001e, 0x080c, 0xca3c, 0x1110,
+	0x080c, 0x321c, 0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5, 0x080c,
+	0xac28, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208,
+	0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc,
+	0x0005, 0x0006, 0x2001, 0x1837, 0x2004, 0xd09c, 0x000e, 0x0005,
+	0x0006, 0x0036, 0x0046, 0x080c, 0xcf52, 0x0168, 0x2019, 0xffff,
+	0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
+	0x0004, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086,
+	0x0001, 0x1128, 0x080c, 0xa38a, 0x080c, 0xac28, 0x9006, 0x0005,
+	0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1ddc, 0x2071, 0x1800,
+	0x7454, 0x7074, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148,
+	0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206,
+	0x0140, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1220,
+	0x0c60, 0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be, 0x00ce,
+	0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091, 0x8000,
+	0x2071, 0x1840, 0xd5a4, 0x0118, 0x7004, 0x8000, 0x7006, 0xd5b4,
+	0x0118, 0x7000, 0x8000, 0x7002, 0xd5ac, 0x0178, 0x2500, 0x9084,
+	0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130, 0x908e,
+	0x0005, 0x0118, 0x2071, 0xfffe, 0x0089, 0x001e, 0x00ee, 0x000e,
+	0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071,
+	0xfff6, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e05, 0x8000,
+	0x2077, 0x1220, 0x8e70, 0x2e05, 0x8000, 0x2077, 0x0005, 0x00e6,
+	0x2071, 0xfff4, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xfff8,
+	0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
+	0x2071, 0x1840, 0x7014, 0x8000, 0x7016, 0x00ee, 0x000e, 0x012e,
+	0x0005, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040,
+	0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000,
+	0x8000, 0x7155
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2322ipx_length01 = 0xdf17;
+unsigned short fw2322ipx_length01 = 0xdf42;
 #else
-unsigned short risc_code_length01 = 0xdf17;
+unsigned short risc_code_length01 = 0xdf42;
 #endif
 
 /*
@@ -7472,9 +7478,9 @@ unsigned short rseqipx_code01[] = {
 	0x0000, 0x8072, 0x0000, 0x0400, 0x0008, 0x8010, 0x0000, 0x0010,
 	0x000b, 0x0489, 0x0004, 0x04a4, 0x0002, 0x3941, 0x0003, 0x0c37,
 	0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0013, 0x0004, 0x046e,
-	0x0008, 0x11fc, 0x0003, 0x8c3f, 0x0000, 0x8072, 0x0000, 0x0400,
+	0x0008, 0x11fc, 0x000b, 0xb43f, 0x0000, 0x8072, 0x0000, 0x0400,
 	0x0008, 0x8010, 0x0000, 0x000e, 0x000b, 0x0489, 0x0000, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x04fc, 0x000b, 0x8c54, 0x0008, 0x808c,
+	0x0000, 0x0400, 0x0000, 0x04fc, 0x0003, 0xb454, 0x0008, 0x808c,
 	0x0008, 0x0000, 0x0001, 0x9180, 0x0008, 0x0005, 0x0008, 0x7f62,
 	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc44a, 0x0008, 0x0060,
 	0x0008, 0x8062, 0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206,
@@ -7502,7 +7508,7 @@ unsigned short rseqipx_code01[] = {
 	0x0002, 0x3941, 0x0003, 0x0ca7, 0x000f, 0x4000, 0x0000, 0x8072,
 	0x0008, 0x0404, 0x000f, 0x4000, 0x0008, 0x8010, 0x0008, 0x0012,
 	0x000c, 0x035b, 0x0004, 0x046e, 0x0000, 0x1110, 0x000c, 0x035b,
-	0x0008, 0x11fc, 0x000b, 0x8cad, 0x0003, 0x0013, 0x0009, 0xc2c0,
+	0x0008, 0x11fc, 0x0003, 0xb4ad, 0x0003, 0x0013, 0x0009, 0xc2c0,
 	0x0008, 0x00ff, 0x0000, 0x7f00, 0x0001, 0xc3c0, 0x0008, 0xff00,
 	0x0009, 0x00d0, 0x000b, 0x0cd8, 0x0000, 0x0d0a, 0x0001, 0x8580,
 	0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400,
@@ -7516,7 +7522,7 @@ unsigned short rseqipx_code01[] = {
 	0x0000, 0x8066, 0x0000, 0x0809, 0x0003, 0xc4de, 0x0000, 0x8060,
 	0x0000, 0x0400, 0x0001, 0x84c0, 0x0008, 0xff00, 0x0002, 0x7f70,
 	0x0009, 0xff80, 0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0000, 0x0809, 0x000b, 0xc4e9, 0x000f, 0x4000, 0xe552, 0xe9f6
+	0x0000, 0x0809, 0x000b, 0xc4e9, 0x000f, 0x4000, 0xe55a, 0x71f6
 };
 unsigned short rseqipx_code_length01 = 0x09d8;
 /*
diff --git a/drivers/scsi/qla2xxx/ql6312_fw.c b/drivers/scsi/qla2xxx/ql6312_fw.c
index 813eb873d..0384b9c92 100644
--- a/drivers/scsi/qla2xxx/ql6312_fw.c
+++ b/drivers/scsi/qla2xxx/ql6312_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.26 (08:43 Mar 11, 2004)
+ *	Firmware Version 3.02.28 (13:56 Apr 03, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2300flx_version_str[] = {3, 2,26};
+unsigned char fw2300flx_version_str[] = {3, 2,28};
 #else
-unsigned char firmware_version[] = {3, 2,26};
+unsigned char firmware_version[] = {3, 2,28};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2300flx_VERSION_STRING "3.02.26"
+#define fw2300flx_VERSION_STRING "3.02.28"
 #else
-#define FW_VERSION_STRING "3.02.26"
+#define FW_VERSION_STRING "3.02.28"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2300flx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xd57a, 0x0000, 0x0003, 0x0002, 0x001a,
+	0x0470, 0x0000, 0x0000, 0xd59a, 0x0000, 0x0003, 0x0002, 0x001c,
 	0x0317, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3620, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -78,94 +78,94 @@ unsigned short risc_code01[] = {
 	0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f,
 	0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e,
 	0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f03, 0x080c,
-	0x5cd8, 0x080c, 0x9daf, 0x080c, 0x10ba, 0x080c, 0x129f, 0x080c,
-	0x1a53, 0x080c, 0x0d46, 0x080c, 0x103f, 0x080c, 0x3231, 0x080c,
-	0x729f, 0x080c, 0x6616, 0x080c, 0x7f4b, 0x080c, 0x230a, 0x080c,
-	0x8278, 0x080c, 0x7928, 0x080c, 0x2147, 0x080c, 0x227b, 0x080c,
+	0x5cdf, 0x080c, 0x9dc8, 0x080c, 0x10ba, 0x080c, 0x129f, 0x080c,
+	0x1a53, 0x080c, 0x0d46, 0x080c, 0x103f, 0x080c, 0x3238, 0x080c,
+	0x72aa, 0x080c, 0x661d, 0x080c, 0x7f73, 0x080c, 0x230a, 0x080c,
+	0x82a0, 0x080c, 0x7933, 0x080c, 0x2147, 0x080c, 0x227b, 0x080c,
 	0x22ff, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880,
 	0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833,
 	0x0010, 0x0e04, 0x0911, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
 	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1800, 0x7003,
 	0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c,
-	0x4997, 0x080c, 0x3258, 0x080c, 0x7310, 0x080c, 0x6ad6, 0x080c,
-	0x7f74, 0x080c, 0x2ab8, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941,
+	0x499e, 0x080c, 0x325f, 0x080c, 0x731b, 0x080c, 0x6add, 0x080c,
+	0x7f9c, 0x080c, 0x2ab8, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941,
 	0x0ad8, 0x093e, 0x0b8f, 0x0d45, 0x0d45, 0x0d45, 0x080c, 0x0db4,
 	0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001,
-	0x1904, 0x0aab, 0x080c, 0x0e71, 0x080c, 0x6fa7, 0x0150, 0x080c,
-	0x6fca, 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a,
-	0x0468, 0x080c, 0x6ed9, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aab,
-	0x7094, 0x9086, 0x0028, 0x1904, 0x0aab, 0x080c, 0x7f43, 0x080c,
-	0x7f35, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827,
-	0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x6e28, 0x080c,
-	0x8010, 0x2011, 0x6e1b, 0x080c, 0x80e4, 0x2011, 0x5b33, 0x080c,
-	0x8010, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x53e0,
-	0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0aab, 0x2011, 0x5b33,
-	0x080c, 0x8010, 0x2011, 0x6e28, 0x080c, 0x8010, 0x2011, 0x6e1b,
-	0x080c, 0x80e4, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000,
+	0x1904, 0x0aab, 0x080c, 0x0e71, 0x080c, 0x6fb2, 0x0150, 0x080c,
+	0x6fd5, 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a,
+	0x0468, 0x080c, 0x6ee4, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aab,
+	0x7094, 0x9086, 0x0028, 0x1904, 0x0aab, 0x080c, 0x7f6b, 0x080c,
+	0x7f5d, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827,
+	0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x6e33, 0x080c,
+	0x8038, 0x2011, 0x6e26, 0x080c, 0x810c, 0x2011, 0x5b3a, 0x080c,
+	0x8038, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x53e7,
+	0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0aab, 0x2011, 0x5b3a,
+	0x080c, 0x8038, 0x2011, 0x6e33, 0x080c, 0x8038, 0x2011, 0x6e26,
+	0x080c, 0x810c, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000,
 	0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, 0x1977, 0x2004, 0x9005,
-	0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5c80, 0x00ce, 0x0804,
-	0x0aab, 0x780f, 0x006b, 0x7a28, 0x080c, 0x6faf, 0x0118, 0x9295,
+	0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5c87, 0x00ce, 0x0804,
+	0x0aab, 0x780f, 0x006b, 0x7a28, 0x080c, 0x6fba, 0x0118, 0x9295,
 	0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, 0x8010, 0x73d4,
-	0x2001, 0x1978, 0x2003, 0x0001, 0x080c, 0x297e, 0x080c, 0x48d2,
+	0x2001, 0x1978, 0x2003, 0x0001, 0x080c, 0x297e, 0x080c, 0x48d9,
 	0x7244, 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc,
-	0x2102, 0x080c, 0x9626, 0x2011, 0x0004, 0x080c, 0xbb0e, 0x080c,
-	0x645a, 0x080c, 0x6fa7, 0x1120, 0x080c, 0x29c2, 0x02e0, 0x0400,
-	0x080c, 0x5c87, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c,
-	0x55ad, 0x0804, 0x0aab, 0x080c, 0x537f, 0xd094, 0x0188, 0x2011,
-	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5383, 0xd0d4, 0x1118,
+	0x2102, 0x080c, 0x963f, 0x2011, 0x0004, 0x080c, 0xbb27, 0x080c,
+	0x6461, 0x080c, 0x6fb2, 0x1120, 0x080c, 0x29c2, 0x02e0, 0x0400,
+	0x080c, 0x5c8e, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c,
+	0x55b4, 0x0804, 0x0aab, 0x080c, 0x5386, 0xd094, 0x0188, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x538a, 0xd0d4, 0x1118,
 	0x080c, 0x29c2, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
-	0x080c, 0x5383, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x6553,
-	0x0008, 0x2012, 0x080c, 0x6519, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
-	0x00a8, 0x707b, 0x0000, 0x080c, 0x6fa7, 0x1130, 0x70ac, 0x9005,
-	0x1168, 0x080c, 0xbf4a, 0x0050, 0x080c, 0xbf4a, 0x70d8, 0xd09c,
-	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c5d, 0x70e3, 0x0000,
+	0x080c, 0x538a, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x655a,
+	0x0008, 0x2012, 0x080c, 0x6520, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
+	0x00a8, 0x707b, 0x0000, 0x080c, 0x6fb2, 0x1130, 0x70ac, 0x9005,
+	0x1168, 0x080c, 0xbf63, 0x0050, 0x080c, 0xbf63, 0x70d8, 0xd09c,
+	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c64, 0x70e3, 0x0000,
 	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x29ca, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6fa7, 0x1178,
+	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6fb2, 0x1178,
 	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193e, 0x211a, 0x001e,
 	0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019,
 	0x193e, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
-	0xc295, 0x72da, 0x080c, 0x6fa7, 0x0118, 0x9296, 0x0004, 0x0548,
-	0x2011, 0x0001, 0x080c, 0xbb0e, 0x70a7, 0x0000, 0x70ab, 0xffff,
+	0xc295, 0x72da, 0x080c, 0x6fb2, 0x0118, 0x9296, 0x0004, 0x0548,
+	0x2011, 0x0001, 0x080c, 0xbb27, 0x70a7, 0x0000, 0x70ab, 0xffff,
 	0x7003, 0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085,
 	0x0003, 0x782a, 0x00fe, 0x080c, 0x2dbb, 0x2011, 0x0005, 0x080c,
-	0x9758, 0x080c, 0x894b, 0x080c, 0x6fa7, 0x0148, 0x00c6, 0x2061,
+	0x9771, 0x080c, 0x8973, 0x080c, 0x6fb2, 0x0148, 0x00c6, 0x2061,
 	0x0100, 0x0016, 0x2009, 0x0002, 0x61e2, 0x001e, 0x00ce, 0x012e,
 	0x0420, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x00f6,
 	0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a,
-	0x00fe, 0x2011, 0x0005, 0x080c, 0x9758, 0x080c, 0x894b, 0x080c,
-	0x6fa7, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002,
+	0x00fe, 0x2011, 0x0005, 0x080c, 0x9771, 0x080c, 0x8973, 0x080c,
+	0x6fb2, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002,
 	0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6,
-	0x080c, 0x6fa7, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782,
-	0x080c, 0x6fa7, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff,
+	0x080c, 0x6fb2, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782,
+	0x080c, 0x6fb2, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff,
 	0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc,
-	0x090c, 0x30ce, 0x8108, 0x1f04, 0x0abf, 0x707b, 0x0000, 0x707c,
+	0x090c, 0x30d5, 0x8108, 0x1f04, 0x0abf, 0x707b, 0x0000, 0x707c,
 	0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be, 0x00ce, 0x0005,
 	0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904,
 	0x0b8c, 0x70a8, 0x9086, 0xffff, 0x0130, 0x080c, 0x2dbb, 0x080c,
-	0x894b, 0x0804, 0x0b8c, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0540,
+	0x8973, 0x0804, 0x0b8c, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0540,
 	0xd084, 0x0530, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e,
-	0xd08c, 0x01f0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2f43,
-	0x080c, 0x894b, 0x70d8, 0xd094, 0x1904, 0x0b8c, 0x2011, 0x0001,
-	0x080c, 0xc1f9, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2f7d,
-	0x080c, 0x894b, 0x0804, 0x0b8c, 0x70e0, 0x9005, 0x1904, 0x0b8c,
+	0xd08c, 0x01f0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2f46,
+	0x080c, 0x8973, 0x70d8, 0xd094, 0x1904, 0x0b8c, 0x2011, 0x0001,
+	0x080c, 0xc212, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2f80,
+	0x080c, 0x8973, 0x0804, 0x0b8c, 0x70e0, 0x9005, 0x1904, 0x0b8c,
 	0x70a4, 0x9005, 0x1904, 0x0b8c, 0x70d8, 0xd0a4, 0x0118, 0xd0b4,
-	0x0904, 0x0b8c, 0x080c, 0x6519, 0x1904, 0x0b8c, 0x080c, 0x656c,
-	0x1904, 0x0b8c, 0x080c, 0x6553, 0x01c0, 0x0156, 0x00c6, 0x20a9,
-	0x007f, 0x900e, 0x0016, 0x080c, 0x6237, 0x1118, 0xb800, 0xd0ec,
+	0x0904, 0x0b8c, 0x080c, 0x6520, 0x1904, 0x0b8c, 0x080c, 0x6573,
+	0x1904, 0x0b8c, 0x080c, 0x655a, 0x01c0, 0x0156, 0x00c6, 0x20a9,
+	0x007f, 0x900e, 0x0016, 0x080c, 0x623e, 0x1118, 0xb800, 0xd0ec,
 	0x1138, 0x001e, 0x8108, 0x1f04, 0x0b32, 0x00ce, 0x015e, 0x0028,
 	0x001e, 0x00ce, 0x015e, 0x0804, 0x0b8c, 0x0006, 0x2001, 0x0103,
 	0x2003, 0x006b, 0x000e, 0x2011, 0x1984, 0x080c, 0x0f73, 0x2011,
 	0x199e, 0x080c, 0x0f73, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003,
 	0x70ab, 0xffff, 0x080c, 0x0e53, 0x9006, 0x080c, 0x260c, 0x0036,
-	0x0046, 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4a6f, 0x004e,
-	0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, 0x6fca, 0x0150, 0x080c,
-	0x6fa7, 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf,
+	0x0046, 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4a76, 0x004e,
+	0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, 0x6fd5, 0x0150, 0x080c,
+	0x6fb2, 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf,
 	0x782a, 0x00fe, 0x2001, 0x19b9, 0x2004, 0x9086, 0x0005, 0x1120,
-	0x2011, 0x0000, 0x080c, 0x9758, 0x2011, 0x0000, 0x080c, 0x9762,
-	0x080c, 0x894b, 0x080c, 0x8a26, 0x012e, 0x00be, 0x0005, 0x0016,
+	0x2011, 0x0000, 0x080c, 0x9771, 0x2011, 0x0000, 0x080c, 0x977b,
+	0x080c, 0x8973, 0x080c, 0x8a4e, 0x012e, 0x00be, 0x0005, 0x0016,
 	0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904,
-	0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5c46, 0x7940,
+	0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5c4d, 0x7940,
 	0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040,
 	0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954,
 	0xd1ac, 0x1904, 0x0c1c, 0x2001, 0x1978, 0x2004, 0x9005, 0x1518,
@@ -173,13 +173,13 @@ unsigned short risc_code01[] = {
 	0x0001, 0x080c, 0x2990, 0x00b8, 0x080c, 0x2a4d, 0x1138, 0x9006,
 	0x080c, 0x29ad, 0x9006, 0x080c, 0x2990, 0x0068, 0x080c, 0x2a55,
 	0x1d50, 0x2001, 0x1969, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
-	0x27a7, 0x0804, 0x0cfc, 0x080c, 0x6fb8, 0x0148, 0x080c, 0x6fca,
-	0x1118, 0x080c, 0x729a, 0x0050, 0x080c, 0x6faf, 0x0dd0, 0x080c,
-	0x7295, 0x080c, 0x728b, 0x080c, 0x6ed9, 0x0058, 0x080c, 0x6fa7,
-	0x0140, 0x2009, 0x00f8, 0x080c, 0x5c46, 0x7843, 0x0090, 0x7843,
-	0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x6fa7,
+	0x27a7, 0x0804, 0x0cfc, 0x080c, 0x6fc3, 0x0148, 0x080c, 0x6fd5,
+	0x1118, 0x080c, 0x72a5, 0x0050, 0x080c, 0x6fba, 0x0dd0, 0x080c,
+	0x72a0, 0x080c, 0x7296, 0x080c, 0x6ee4, 0x0058, 0x080c, 0x6fb2,
+	0x0140, 0x2009, 0x00f8, 0x080c, 0x5c4d, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x6fb2,
 	0x0138, 0x7824, 0xd0ac, 0x1904, 0x0d01, 0x1f04, 0x0bfb, 0x0070,
-	0x7824, 0x080c, 0x6fc1, 0x0118, 0xd0ac, 0x1904, 0x0d01, 0x9084,
+	0x7824, 0x080c, 0x6fcc, 0x0118, 0xd0ac, 0x1904, 0x0d01, 0x9084,
 	0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, 0x0d01, 0x2001, 0x0001,
 	0x080c, 0x260c, 0x0804, 0x0d14, 0x2001, 0x1978, 0x2004, 0x9005,
 	0x1518, 0x080c, 0x2a45, 0x1148, 0x2001, 0x0001, 0x080c, 0x29ad,
@@ -189,46 +189,46 @@ unsigned short risc_code01[] = {
 	0x080c, 0x27a7, 0x0804, 0x0cfc, 0x7850, 0x9085, 0x0040, 0x7852,
 	0x7938, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a5d, 0x9085,
 	0x2000, 0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c55, 0x080c,
-	0x80c4, 0x1f04, 0x0c55, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf,
-	0x7852, 0x793a, 0x080c, 0x6fb8, 0x0148, 0x080c, 0x6fca, 0x1118,
-	0x080c, 0x729a, 0x0050, 0x080c, 0x6faf, 0x0dd0, 0x080c, 0x7295,
-	0x080c, 0x728b, 0x080c, 0x6ed9, 0x0020, 0x2009, 0x00f8, 0x080c,
-	0x5c46, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c7b, 0x7850, 0x9085,
-	0x1400, 0x7852, 0x080c, 0x6fa7, 0x0120, 0x7843, 0x0090, 0x7843,
-	0x0010, 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x80c4, 0x7820,
-	0xd09c, 0x1588, 0x080c, 0x6fa7, 0x0904, 0x0ce1, 0x7824, 0xd0ac,
-	0x1904, 0x0d01, 0x080c, 0x6fca, 0x1530, 0x0046, 0x2021, 0x0320,
+	0x80ec, 0x1f04, 0x0c55, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf,
+	0x7852, 0x793a, 0x080c, 0x6fc3, 0x0148, 0x080c, 0x6fd5, 0x1118,
+	0x080c, 0x72a5, 0x0050, 0x080c, 0x6fba, 0x0dd0, 0x080c, 0x72a0,
+	0x080c, 0x7296, 0x080c, 0x6ee4, 0x0020, 0x2009, 0x00f8, 0x080c,
+	0x5c4d, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c7b, 0x7850, 0x9085,
+	0x1400, 0x7852, 0x080c, 0x6fb2, 0x0120, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x80ec, 0x7820,
+	0xd09c, 0x1588, 0x080c, 0x6fb2, 0x0904, 0x0ce1, 0x7824, 0xd0ac,
+	0x1904, 0x0d01, 0x080c, 0x6fd5, 0x1530, 0x0046, 0x2021, 0x0320,
 	0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2a5d, 0x7824,
 	0x9084, 0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810,
 	0x2004, 0x9084, 0x9000, 0x0110, 0x080c, 0x0d22, 0x8421, 0x1158,
-	0x1d04, 0x0cbc, 0x080c, 0x80c4, 0x080c, 0x7295, 0x080c, 0x728b,
+	0x1d04, 0x0cbc, 0x080c, 0x80ec, 0x080c, 0x72a0, 0x080c, 0x7296,
 	0x7003, 0x0001, 0x04f0, 0x8319, 0x1940, 0x1d04, 0x0cc9, 0x080c,
-	0x80c4, 0x2009, 0x196c, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x80ec, 0x2009, 0x196c, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
 	0x1178, 0x200b, 0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c,
 	0x2a3e, 0x7924, 0x080c, 0x2a5d, 0xd19c, 0x0110, 0x080c, 0x297e,
-	0x00d8, 0x080c, 0x6fb8, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c,
-	0x6f7f, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2a5d,
-	0x7824, 0x080c, 0x6fc1, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800,
+	0x00d8, 0x080c, 0x6fc3, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c,
+	0x6f8a, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2a5d,
+	0x7824, 0x080c, 0x6fcc, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800,
 	0x0950, 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x260c,
 	0x0078, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
 	0x0002, 0x7906, 0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a,
 	0x7850, 0x9085, 0x0400, 0x7852, 0x2001, 0x1978, 0x2003, 0x0000,
 	0x9006, 0x78f2, 0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e,
 	0x001e, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x80c4, 0x015e,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x80ec, 0x015e,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x001e,
 	0x000e, 0x0005, 0x00e6, 0x2071, 0x1894, 0x7004, 0x9086, 0x0001,
-	0x1110, 0x080c, 0x3258, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061,
-	0x197c, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001a, 0x600f,
+	0x1110, 0x080c, 0x325f, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061,
+	0x197c, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001c, 0x600f,
 	0x0317, 0x2001, 0x194d, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100,
 	0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008, 0x715a,
-	0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbf4a, 0x70e7, 0x00c0,
+	0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbf63, 0x70e7, 0x00c0,
 	0x2061, 0x193d, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0,
 	0x2061, 0x1945, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200,
 	0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061, 0x195a,
 	0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020,
-	0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6237, 0x1178,
+	0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x623e, 0x1178,
 	0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00,
 	0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210, 0x8108,
 	0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079,
@@ -247,7 +247,7 @@ unsigned short risc_code01[] = {
 	0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
 	0x0180, 0x2001, 0x19ea, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
 	0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003,
-	0x1001, 0x080c, 0x538e, 0x1108, 0x0099, 0x0cd8, 0x0005, 0x918c,
+	0x1001, 0x080c, 0x5395, 0x1108, 0x0099, 0x0cd8, 0x0005, 0x918c,
 	0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d,
 	0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f, 0x2102, 0x0005,
 	0x0026, 0x0126, 0x2011, 0x0080, 0x080c, 0x0ecb, 0x20a9, 0x0900,
@@ -313,7 +313,7 @@ unsigned short risc_code01[] = {
 	0x8000, 0x0016, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862,
 	0x9184, 0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091,
 	0x8000, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
-	0x8000, 0x70be, 0x080c, 0x7f35, 0x012e, 0x00ee, 0x0005, 0x2071,
+	0x8000, 0x70be, 0x080c, 0x7f5d, 0x012e, 0x00ee, 0x0005, 0x2071,
 	0x1800, 0x9026, 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e,
 	0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886,
 	0x0440, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x1883,
@@ -377,22 +377,22 @@ unsigned short risc_code01[] = {
 	0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x10f4, 0x0005, 0x00de,
 	0x009e, 0x080c, 0x10f4, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096,
 	0xa0a0, 0x904d, 0x090c, 0x0db4, 0xa06c, 0x908e, 0x0100, 0x0130,
-	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6878,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x687f,
 	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x101d, 0x009e,
 	0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0db4, 0xa06c, 0x908e,
 	0x0100, 0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c,
 	0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006,
 	0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xa076,
 	0xa172, 0xb000, 0xa07a, 0x2810, 0x080c, 0x10d5, 0x00e8, 0xa97c,
-	0xa894, 0x0016, 0x0006, 0x080c, 0x6878, 0x000e, 0x001e, 0xd1fc,
-	0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9e19, 0x00ce,
+	0xa894, 0x0016, 0x0006, 0x080c, 0x687f, 0x000e, 0x001e, 0xd1fc,
+	0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9e32, 0x00ce,
 	0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x101d,
 	0x7007, 0x0000, 0x080c, 0x10f4, 0x00ae, 0x0005, 0x0126, 0x2091,
 	0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002,
 	0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x1105, 0x0005, 0x0126,
 	0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a33, 0x7003, 0x0000,
 	0x78bf, 0x00f6, 0x781b, 0x4800, 0x00c1, 0x7803, 0x0003, 0x780f,
-	0x0000, 0x20a9, 0x0254, 0x2061, 0xd8c3, 0x2c0d, 0x7912, 0xe104,
+	0x0000, 0x20a9, 0x0254, 0x2061, 0xd8e3, 0x2c0d, 0x7912, 0xe104,
 	0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12b5, 0x7807, 0x0007, 0x7803,
 	0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000,
 	0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a34, 0x2003,
@@ -401,9 +401,9 @@ unsigned short risc_code01[] = {
 	0x782b, 0x1a52, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200,
 	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a52, 0x602f,
 	0x1cd0, 0x2001, 0x1819, 0x2004, 0x9082, 0x1cd0, 0x6032, 0x603b,
-	0x1f26, 0x2001, 0x3131, 0xd0fc, 0x190c, 0x0db4, 0x2001, 0x0003,
-	0x2004, 0xd0d4, 0x1118, 0x783f, 0x3131, 0x0020, 0x9084, 0xc000,
-	0x783f, 0xb131, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908,
+	0x1f26, 0x2001, 0x3138, 0xd0fc, 0x190c, 0x0db4, 0x2001, 0x0003,
+	0x2004, 0xd0d4, 0x1118, 0x783f, 0x3138, 0x0020, 0x9084, 0xc000,
+	0x783f, 0xb138, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908,
 	0x9184, 0x0070, 0x190c, 0x0dad, 0xd19c, 0x0158, 0x7820, 0x908c,
 	0xf000, 0x15e8, 0x908a, 0x0024, 0x1a0c, 0x0db4, 0x0023, 0x012e,
 	0x0005, 0x012e, 0x0005, 0x1347, 0x1347, 0x135e, 0x1363, 0x1367,
@@ -412,17 +412,17 @@ unsigned short risc_code01[] = {
 	0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x136e, 0x1347,
 	0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x134b, 0x1349, 0x080c,
 	0x0db4, 0x080c, 0x0dad, 0x080c, 0x14a2, 0x2009, 0x1a4b, 0x2104,
-	0x8000, 0x200a, 0x080c, 0x79fc, 0x080c, 0x1958, 0x0005, 0x2009,
-	0x0048, 0x2060, 0x080c, 0x9e93, 0x012e, 0x0005, 0x7004, 0xc085,
+	0x8000, 0x200a, 0x080c, 0x7a07, 0x080c, 0x1958, 0x0005, 0x2009,
+	0x0048, 0x2060, 0x080c, 0x9eac, 0x012e, 0x0005, 0x7004, 0xc085,
 	0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c,
 	0x14a2, 0x080c, 0x15de, 0x0005, 0x080c, 0x0db4, 0x080c, 0x14a2,
 	0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009,
-	0x0048, 0x080c, 0x9e93, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009,
+	0x0048, 0x080c, 0x9eac, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009,
 	0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8,
 	0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14a7, 0x2001,
 	0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005,
 	0x080c, 0x14a2, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff,
-	0x009e, 0x2009, 0x0048, 0x080c, 0x9e93, 0x0005, 0x080c, 0x14a2,
+	0x009e, 0x2009, 0x0048, 0x080c, 0x9eac, 0x0005, 0x080c, 0x14a2,
 	0x080c, 0x0db4, 0x080c, 0x14a2, 0x080c, 0x141f, 0x7827, 0x0018,
 	0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000,
 	0x9065, 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
@@ -431,12 +431,12 @@ unsigned short risc_code01[] = {
 	0x0050, 0x2003, 0x0020, 0x0480, 0x78ab, 0x0004, 0x7803, 0x0001,
 	0x080c, 0x1438, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c,
 	0x0db4, 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198,
-	0x080c, 0x79fc, 0x080c, 0x1958, 0x080c, 0xbafe, 0x0158, 0xa9ac,
+	0x080c, 0x7a07, 0x080c, 0x1958, 0x080c, 0xbb17, 0x0158, 0xa9ac,
 	0xa936, 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880,
 	0xc0bd, 0xa882, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x6024, 0x190c, 0xbee3, 0x2029, 0x00c8, 0x8529, 0x0128,
-	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd86c,
-	0xd5a4, 0x1118, 0x080c, 0x14a7, 0x0005, 0x080c, 0x79fc, 0x080c,
+	0xd0bc, 0x6024, 0x190c, 0xbefc, 0x2029, 0x00c8, 0x8529, 0x0128,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd88c,
+	0xd5a4, 0x1118, 0x080c, 0x14a7, 0x0005, 0x080c, 0x7a07, 0x080c,
 	0x1958, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016,
 	0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007,
 	0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1518, 0x00fe,
@@ -454,7 +454,7 @@ unsigned short risc_code01[] = {
 	0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12c5, 0x7803, 0x0001,
 	0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
 	0x0020, 0x0069, 0x0ca8, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c,
-	0x9e93, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c,
+	0x9eac, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c,
 	0x141f, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510,
 	0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc,
 	0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841,
@@ -462,7 +462,7 @@ unsigned short risc_code01[] = {
 	0x080c, 0x150a, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827,
 	0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500,
 	0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c,
-	0x79fc, 0x080c, 0x1958, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000,
+	0x7a07, 0x080c, 0x1958, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000,
 	0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020,
 	0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005,
 	0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015,
@@ -478,7 +478,7 @@ unsigned short risc_code01[] = {
 	0x1591, 0x9284, 0x0048, 0x9086, 0x0008, 0x1904, 0x1591, 0x2001,
 	0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136,
 	0x0146, 0x0156, 0x0126, 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016,
-	0x2009, 0x1a4d, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x8382,
+	0x2009, 0x1a4d, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x83aa,
 	0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de,
 	0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016,
@@ -488,7 +488,7 @@ unsigned short risc_code01[] = {
 	0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284,
 	0x0048, 0x9086, 0x0008, 0x11e0, 0x2001, 0x19c7, 0x2004, 0x9005,
 	0x01b8, 0x2001, 0x1a36, 0x2004, 0x9086, 0x0000, 0x0188, 0x2009,
-	0x1a4c, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x9417, 0x2009,
+	0x1a4c, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x9430, 0x2009,
 	0x180c, 0x2104, 0xc0f5, 0x200a, 0x2009, 0xff00, 0x0804, 0x1541,
 	0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
 	0x080c, 0x153a, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004,
@@ -498,9 +498,9 @@ unsigned short risc_code01[] = {
 	0x0904, 0x163d, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc,
 	0x0904, 0x163d, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038,
 	0x00ce, 0x918e, 0x0039, 0x1904, 0x163d, 0x9c06, 0x15f0, 0x0126,
-	0x2091, 0x2600, 0x080c, 0x7943, 0x012e, 0x7358, 0x745c, 0x6014,
+	0x2091, 0x2600, 0x080c, 0x794e, 0x012e, 0x7358, 0x745c, 0x6014,
 	0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x190c, 0xbebe, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004,
+	0xd0bc, 0x190c, 0xbed7, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004,
 	0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058,
 	0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff,
 	0x080c, 0x1f46, 0x1190, 0x080c, 0x17eb, 0x2a00, 0xa816, 0x0130,
@@ -595,7 +595,7 @@ unsigned short risc_code01[] = {
 	0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008, 0xa986, 0x601b,
 	0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934, 0xa88c, 0x9106,
 	0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c, 0xc084, 0x601e,
-	0x2009, 0x0048, 0x0804, 0x9e93, 0x0005, 0x0126, 0x00c6, 0x2091,
+	0x2009, 0x0048, 0x0804, 0x9eac, 0x0005, 0x0126, 0x00c6, 0x2091,
 	0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000, 0x05b0,
 	0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006, 0x2031,
 	0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120, 0x080c,
@@ -606,17 +606,17 @@ unsigned short risc_code01[] = {
 	0x080c, 0x19f4, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x19e1,
 	0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0,
 	0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe,
-	0x080c, 0x6fa7, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001,
+	0x080c, 0x6fb2, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001,
 	0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211,
-	0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x7057, 0x006e,
+	0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x7062, 0x006e,
 	0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138,
 	0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2a69, 0x2009,
 	0x003c, 0x080c, 0x2268, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000,
-	0x9084, 0x003c, 0x1de0, 0x080c, 0x7f35, 0x70a0, 0x70a2, 0x7098,
+	0x9084, 0x003c, 0x1de0, 0x080c, 0x7f5d, 0x70a0, 0x70a2, 0x7098,
 	0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6,
 	0x2079, 0x0300, 0x080c, 0x12c5, 0x7803, 0x0001, 0x00fe, 0x00ee,
 	0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160,
-	0x202c, 0x2003, 0x0000, 0x080c, 0x6fa7, 0x1108, 0x0005, 0x2021,
+	0x202c, 0x2003, 0x0000, 0x080c, 0x6fb2, 0x1108, 0x0005, 0x2021,
 	0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109,
 	0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c, 0x83ff,
 	0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000, 0x0005,
@@ -725,12 +725,12 @@ unsigned short risc_code01[] = {
 	0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c, 0x0db4, 0x0026,
 	0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004, 0x7003, 0x0000,
 	0x7004, 0x0016, 0x080c, 0x1b60, 0x001e, 0x2060, 0x6014, 0x2048,
-	0x080c, 0xbafe, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086,
+	0x080c, 0xbb17, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086,
 	0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001,
 	0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a, 0x60c8, 0xa896,
-	0x7004, 0x2060, 0x00c6, 0x080c, 0xb731, 0x00ce, 0x2001, 0x19c7,
+	0x7004, 0x2060, 0x00c6, 0x080c, 0xb74a, 0x00ce, 0x2001, 0x19c7,
 	0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c, 0x2268, 0x080c,
-	0x98d1, 0x2011, 0x0000, 0x080c, 0x9762, 0x080c, 0x8a26, 0x002e,
+	0x98ea, 0x2011, 0x0000, 0x080c, 0x977b, 0x080c, 0x8a4e, 0x002e,
 	0x0804, 0x1e8e, 0x0126, 0x2091, 0x2400, 0xa858, 0x2040, 0x792c,
 	0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1d07, 0x7000, 0x0002,
 	0x1e8e, 0x1d5c, 0x1ddc, 0x1e8c, 0x8001, 0x7002, 0x7027, 0x0000,
@@ -774,7 +774,7 @@ unsigned short risc_code01[] = {
 	0x0804, 0x1d7e, 0x0804, 0x1d7a, 0x080c, 0x0db4, 0x012e, 0x0005,
 	0x00f6, 0x00e6, 0x2071, 0x1a36, 0x7000, 0x9086, 0x0000, 0x0904,
 	0x1ed9, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c, 0xd194, 0x01b8,
-	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xd8b5,
+	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xd8d5,
 	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0db4, 0x0016, 0x2009,
 	0x0040, 0x080c, 0x2268, 0x001e, 0x2001, 0x020c, 0x2102, 0x2009,
 	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009,
@@ -864,17 +864,17 @@ unsigned short risc_code01[] = {
 	0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002, 0x783b, 0x001f,
 	0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005, 0x2091, 0x2600,
 	0x781c, 0xd0a4, 0x190c, 0x2265, 0x7900, 0xd1dc, 0x1118, 0x9084,
-	0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x218d, 0x2185, 0x7943,
-	0x2185, 0x2187, 0x2187, 0x2187, 0x2187, 0x7929, 0x2185, 0x2189,
+	0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x218d, 0x2185, 0x794e,
+	0x2185, 0x2187, 0x2187, 0x2187, 0x2187, 0x7934, 0x2185, 0x2189,
 	0x2185, 0x2187, 0x2185, 0x2187, 0x2185, 0x080c, 0x0db4, 0x0031,
-	0x0020, 0x080c, 0x7929, 0x080c, 0x7943, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x080c, 0xd8b5, 0x7930, 0x9184, 0x0003, 0x01c0, 0x2001,
+	0x0020, 0x080c, 0x7934, 0x080c, 0x794e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x080c, 0xd8d5, 0x7930, 0x9184, 0x0003, 0x01c0, 0x2001,
 	0x19c7, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133, 0x2004, 0x9005,
-	0x090c, 0x0db4, 0x00c6, 0x2001, 0x19c7, 0x2064, 0x080c, 0xb731,
+	0x090c, 0x0db4, 0x00c6, 0x2001, 0x19c7, 0x2064, 0x080c, 0xb74a,
 	0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x2268, 0x00d0, 0x9184,
-	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x6fa7,
-	0x1138, 0x080c, 0x728b, 0x080c, 0x5cca, 0x080c, 0x6ed9, 0x0010,
-	0x080c, 0x5b89, 0x080c, 0x79f2, 0x0041, 0x0018, 0x9184, 0x9540,
+	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x6fb2,
+	0x1138, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c, 0x6ee4, 0x0010,
+	0x080c, 0x5b90, 0x080c, 0x79fd, 0x0041, 0x0018, 0x9184, 0x9540,
 	0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036, 0x0046,
 	0x0056, 0x2071, 0x1a33, 0x080c, 0x1958, 0x005e, 0x004e, 0x003e,
 	0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071, 0x1800, 0x7128,
@@ -919,96 +919,96 @@ unsigned short risc_code01[] = {
 	0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
 	0x0026, 0x6124, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x002a,
 	0x9195, 0x0004, 0x9284, 0x0007, 0x0002, 0x2347, 0x232d, 0x2330,
-	0x2333, 0x2338, 0x233a, 0x233e, 0x2342, 0x080c, 0x82b5, 0x00b8,
-	0x080c, 0x8382, 0x00a0, 0x080c, 0x8382, 0x080c, 0x82b5, 0x0078,
-	0x0099, 0x0068, 0x080c, 0x82b5, 0x0079, 0x0048, 0x080c, 0x8382,
-	0x0059, 0x0028, 0x080c, 0x8382, 0x080c, 0x82b5, 0x0029, 0x002e,
+	0x2333, 0x2338, 0x233a, 0x233e, 0x2342, 0x080c, 0x82dd, 0x00b8,
+	0x080c, 0x83aa, 0x00a0, 0x080c, 0x83aa, 0x080c, 0x82dd, 0x0078,
+	0x0099, 0x0068, 0x080c, 0x82dd, 0x0079, 0x0048, 0x080c, 0x83aa,
+	0x0059, 0x0028, 0x080c, 0x83aa, 0x080c, 0x82dd, 0x0029, 0x002e,
 	0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c,
 	0x0118, 0xd19c, 0x1904, 0x2595, 0xd1f4, 0x190c, 0x0dad, 0x080c,
-	0x6fa7, 0x0904, 0x23a2, 0x080c, 0xc1f9, 0x1120, 0x7000, 0x9086,
-	0x0003, 0x0570, 0x6024, 0x9084, 0x1800, 0x0550, 0x080c, 0x6fca,
-	0x0118, 0x080c, 0x6fb8, 0x1520, 0x6027, 0x0020, 0x6043, 0x0000,
-	0x080c, 0xc1f9, 0x0168, 0x080c, 0x6fca, 0x1150, 0x2001, 0x1978,
-	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6e28, 0x0804, 0x2598,
+	0x6fb2, 0x0904, 0x23a2, 0x080c, 0xc212, 0x1120, 0x7000, 0x9086,
+	0x0003, 0x0570, 0x6024, 0x9084, 0x1800, 0x0550, 0x080c, 0x6fd5,
+	0x0118, 0x080c, 0x6fc3, 0x1520, 0x6027, 0x0020, 0x6043, 0x0000,
+	0x080c, 0xc212, 0x0168, 0x080c, 0x6fd5, 0x1150, 0x2001, 0x1978,
+	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6e33, 0x0804, 0x2598,
 	0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6, 0x2069, 0x0140,
-	0x080c, 0x6ffe, 0x00de, 0x1904, 0x2598, 0x080c, 0x7295, 0x0428,
-	0x080c, 0x6fca, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
-	0x080c, 0x7295, 0x080c, 0x728b, 0x080c, 0x5cca, 0x080c, 0x6ed9,
+	0x080c, 0x7009, 0x00de, 0x1904, 0x2598, 0x080c, 0x72a0, 0x0428,
+	0x080c, 0x6fd5, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
+	0x080c, 0x72a0, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c, 0x6ee4,
 	0x0804, 0x2595, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4,
 	0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094, 0x9086, 0x0028,
-	0x1110, 0x080c, 0x717a, 0x0804, 0x2595, 0x080c, 0x7290, 0x0048,
-	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x70e0, 0x0804,
-	0x2595, 0x080c, 0x7214, 0x0804, 0x2595, 0xd1ac, 0x0904, 0x24b6,
-	0x080c, 0x6fa7, 0x11c0, 0x6027, 0x0020, 0x0006, 0x0026, 0x0036,
-	0x080c, 0x6fc1, 0x1158, 0x080c, 0x728b, 0x080c, 0x5cca, 0x080c,
-	0x6ed9, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e,
-	0x000e, 0x080c, 0x6f7f, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486,
+	0x1110, 0x080c, 0x7185, 0x0804, 0x2595, 0x080c, 0x729b, 0x0048,
+	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x70eb, 0x0804,
+	0x2595, 0x080c, 0x721f, 0x0804, 0x2595, 0xd1ac, 0x0904, 0x24b6,
+	0x080c, 0x6fb2, 0x11c0, 0x6027, 0x0020, 0x0006, 0x0026, 0x0036,
+	0x080c, 0x6fcc, 0x1158, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c,
+	0x6ee4, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e,
+	0x000e, 0x080c, 0x6f8a, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486,
 	0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043,
 	0x0010, 0x74d6, 0x948c, 0xff00, 0x7038, 0xd084, 0x0178, 0x9186,
 	0xf800, 0x1160, 0x7044, 0xd084, 0x1148, 0xc085, 0x7046, 0x0036,
-	0x2418, 0x2011, 0x8016, 0x080c, 0x48d2, 0x003e, 0x080c, 0xc1f2,
+	0x2418, 0x2011, 0x8016, 0x080c, 0x48d9, 0x003e, 0x080c, 0xc20b,
 	0x1904, 0x2493, 0x9196, 0xff00, 0x05a8, 0x705c, 0x9084, 0x00ff,
 	0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130, 0xd184, 0x1550,
-	0x080c, 0x312c, 0x0128, 0xc18d, 0x7132, 0x080c, 0x6553, 0x1510,
+	0x080c, 0x3133, 0x0128, 0xc18d, 0x7132, 0x080c, 0x655a, 0x1510,
 	0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294, 0xff00, 0x9296,
 	0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x2493, 0x7038, 0xd08c,
 	0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x2493, 0xc1ad,
-	0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c, 0x48d2, 0x003e,
+	0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c, 0x48d9, 0x003e,
 	0x0804, 0x2493, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c,
 	0xd1ac, 0x1904, 0x2493, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011,
-	0x8013, 0x080c, 0x48d2, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011,
+	0x8013, 0x080c, 0x48d9, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011,
 	0x1854, 0x220c, 0x00f0, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100,
-	0x080c, 0x8207, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c,
-	0xd486, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x3131, 0x200d, 0x918c,
-	0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xd50a,
+	0x080c, 0x822f, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c,
+	0xd4a6, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x3138, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xd52a,
 	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004,
-	0x080c, 0x2fa2, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
-	0x900e, 0x080c, 0x6237, 0x1110, 0x080c, 0x5ce4, 0x8108, 0x1f04,
-	0x2489, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0x9d9f, 0x60e3,
+	0x080c, 0x2fa5, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
+	0x900e, 0x080c, 0x623e, 0x1110, 0x080c, 0x5ceb, 0x8108, 0x1f04,
+	0x2489, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0x9db8, 0x60e3,
 	0x0000, 0x001e, 0x2001, 0x1800, 0x2014, 0x9296, 0x0004, 0x1170,
 	0xd19c, 0x11a0, 0x2011, 0x180c, 0x2214, 0xd29c, 0x1120, 0x6204,
 	0x9295, 0x0002, 0x6206, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001,
 	0x2001, 0x1825, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0904,
-	0x2595, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x253e, 0x080c, 0x8090,
-	0x080c, 0x9393, 0x6027, 0x0004, 0x00f6, 0x2019, 0x19c1, 0x2304,
+	0x2595, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x253e, 0x080c, 0x80b8,
+	0x080c, 0x93ac, 0x6027, 0x0004, 0x00f6, 0x2019, 0x19c1, 0x2304,
 	0x907d, 0x0904, 0x250d, 0x7804, 0x9086, 0x0032, 0x15f0, 0x00d6,
 	0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140, 0x782c, 0x685e, 0x7808,
 	0x685a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x1df0, 0x6043,
 	0x0000, 0x2001, 0x003c, 0x8001, 0x1df0, 0x080c, 0x2b24, 0x2001,
 	0x001e, 0x8001, 0x0240, 0x20a9, 0x0009, 0x080c, 0x2a3e, 0x6904,
 	0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006,
-	0x080c, 0x2b14, 0x080c, 0x8846, 0x080c, 0x894b, 0x7814, 0x2048,
-	0xa867, 0x0103, 0x2f60, 0x080c, 0x9e19, 0x009e, 0x00ee, 0x00ce,
+	0x080c, 0x2b14, 0x080c, 0x886e, 0x080c, 0x8973, 0x7814, 0x2048,
+	0xa867, 0x0103, 0x2f60, 0x080c, 0x9e32, 0x009e, 0x00ee, 0x00ce,
 	0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069,
 	0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b24, 0x00de,
-	0x00c6, 0x2061, 0x19b8, 0x6028, 0x080c, 0xc1f9, 0x0120, 0x909a,
+	0x00c6, 0x2061, 0x19b8, 0x6028, 0x080c, 0xc212, 0x0120, 0x909a,
 	0x0003, 0x1258, 0x0018, 0x909a, 0x00c8, 0x1238, 0x8000, 0x602a,
-	0x00ce, 0x080c, 0x936f, 0x0804, 0x2594, 0x2061, 0x0100, 0x62c0,
-	0x080c, 0x9c2a, 0x2019, 0x19c1, 0x2304, 0x9065, 0x0120, 0x2009,
-	0x0027, 0x080c, 0x9e93, 0x00ce, 0x0804, 0x2594, 0xd2bc, 0x0904,
-	0x2581, 0x080c, 0x809d, 0x6014, 0x9084, 0x1984, 0x9085, 0x0010,
+	0x00ce, 0x080c, 0x9388, 0x0804, 0x2594, 0x2061, 0x0100, 0x62c0,
+	0x080c, 0x9c43, 0x2019, 0x19c1, 0x2304, 0x9065, 0x0120, 0x2009,
+	0x0027, 0x080c, 0x9eac, 0x00ce, 0x0804, 0x2594, 0xd2bc, 0x0904,
+	0x2581, 0x080c, 0x80c5, 0x6014, 0x9084, 0x1984, 0x9085, 0x0010,
 	0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084,
 	0x4000, 0x0110, 0x080c, 0x2b24, 0x00de, 0x00c6, 0x2061, 0x19b8,
-	0x6044, 0x080c, 0xc1f9, 0x0120, 0x909a, 0x0003, 0x1628, 0x0018,
+	0x6044, 0x080c, 0xc212, 0x0120, 0x909a, 0x0003, 0x1628, 0x0018,
 	0x909a, 0x00c8, 0x1608, 0x8000, 0x6046, 0x603c, 0x00ce, 0x9005,
-	0x0558, 0x2009, 0x07d0, 0x080c, 0x8095, 0x9080, 0x0008, 0x2004,
+	0x0558, 0x2009, 0x07d0, 0x080c, 0x80bd, 0x9080, 0x0008, 0x2004,
 	0x9086, 0x0006, 0x1138, 0x6114, 0x918c, 0x1984, 0x918d, 0x0012,
 	0x6116, 0x00d0, 0x6114, 0x918c, 0x1984, 0x918d, 0x0016, 0x6116,
 	0x0098, 0x6027, 0x0004, 0x0080, 0x0036, 0x2019, 0x0001, 0x080c,
-	0x96bf, 0x003e, 0x2019, 0x19c7, 0x2304, 0x9065, 0x0120, 0x2009,
-	0x004f, 0x080c, 0x9e93, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x2607,
+	0x96d8, 0x003e, 0x2019, 0x19c7, 0x2304, 0x9065, 0x0120, 0x2009,
+	0x004f, 0x080c, 0x9eac, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x2607,
 	0x7038, 0xd0ac, 0x1904, 0x25dc, 0x0016, 0x0156, 0x6027, 0x0008,
 	0x6050, 0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf, 0x6052,
 	0x080c, 0x2a5d, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012, 0x1d04,
-	0x25af, 0x080c, 0x80c4, 0x1f04, 0x25af, 0x6050, 0x9085, 0x0400,
+	0x25af, 0x080c, 0x80ec, 0x1f04, 0x25af, 0x6050, 0x9085, 0x0400,
 	0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x25bd,
 	0x6150, 0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04, 0x25c6,
-	0x080c, 0x80c4, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e,
+	0x080c, 0x80ec, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e,
 	0x6027, 0x0008, 0x04a0, 0x080c, 0x2a25, 0x1f04, 0x25c6, 0x015e,
 	0x6152, 0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c, 0x602a,
-	0x080c, 0x9d9f, 0x60e3, 0x0000, 0x080c, 0xd894, 0x080c, 0xd8af,
-	0x080c, 0x5383, 0xd0fc, 0x1138, 0x080c, 0xc1f2, 0x1120, 0x9085,
-	0x0001, 0x080c, 0x6fee, 0x9006, 0x080c, 0x2b14, 0x2009, 0x0002,
+	0x080c, 0x9db8, 0x60e3, 0x0000, 0x080c, 0xd8b4, 0x080c, 0xd8cf,
+	0x080c, 0x538a, 0xd0fc, 0x1138, 0x080c, 0xc20b, 0x1120, 0x9085,
+	0x0001, 0x080c, 0x6ff9, 0x9006, 0x080c, 0x2b14, 0x2009, 0x0002,
 	0x080c, 0x2a63, 0x00e6, 0x2071, 0x1800, 0x7003, 0x0004, 0x080c,
 	0x0e80, 0x00ee, 0x6027, 0x0008, 0x080c, 0x0b8f, 0x001e, 0x918c,
 	0xffd0, 0x6126, 0x00ae, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
@@ -1016,33 +1016,33 @@ unsigned short risc_code01[] = {
 	0x70ce, 0x9116, 0x0904, 0x265b, 0x81ff, 0x01a0, 0x2009, 0x0000,
 	0x080c, 0x2a63, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e,
 	0x0007, 0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c,
-	0x48d2, 0x0448, 0x2001, 0x1979, 0x200c, 0x81ff, 0x1140, 0x2001,
+	0x48d9, 0x0448, 0x2001, 0x1979, 0x200c, 0x81ff, 0x1140, 0x2001,
 	0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118,
-	0x2011, 0x8012, 0x080c, 0x48d2, 0x080c, 0x0e80, 0x080c, 0x5383,
-	0xd0fc, 0x1188, 0x080c, 0xc1f2, 0x1170, 0x00c6, 0x080c, 0x26f7,
-	0x080c, 0x9626, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
-	0x080c, 0x2fa2, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
+	0x2011, 0x8012, 0x080c, 0x48d9, 0x080c, 0x0e80, 0x080c, 0x538a,
+	0xd0fc, 0x1188, 0x080c, 0xc20b, 0x1170, 0x00c6, 0x080c, 0x26f7,
+	0x080c, 0x963f, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
+	0x080c, 0x2fa5, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
 	0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
 	0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac, 0x11c8, 0x81ff,
 	0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190, 0x2011, 0x181f,
 	0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148, 0x2011,
 	0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120,
-	0x2500, 0x080c, 0x7c2f, 0x0048, 0x9584, 0x00ff, 0x9080, 0x3131,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x3131,
+	0x2500, 0x080c, 0x7c57, 0x0048, 0x9584, 0x00ff, 0x9080, 0x3138,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x3138,
 	0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140, 0x2001,
 	0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852, 0x6856,
 	0x1f04, 0x26a7, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026, 0x2069,
 	0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214, 0x8214, 0x8214,
 	0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128, 0x9184,
-	0x000f, 0x9080, 0xdd69, 0x2005, 0x6856, 0x8211, 0x1f04, 0x26bc,
+	0x000f, 0x9080, 0xdd89, 0x2005, 0x6856, 0x8211, 0x1f04, 0x26bc,
 	0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800, 0x6030,
 	0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005, 0x0156,
 	0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980, 0x9116,
 	0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001, 0x0402,
 	0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x26ec, 0x680f,
 	0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005, 0x080c,
-	0x537f, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
-	0x2009, 0x002e, 0x080c, 0xd50a, 0x004e, 0x0005, 0x00f6, 0x0016,
+	0x5386, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
+	0x2009, 0x002e, 0x080c, 0xd52a, 0x004e, 0x0005, 0x00f6, 0x0016,
 	0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x2763, 0x080c,
 	0x29c2, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120, 0x2011,
 	0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011, 0x8000,
@@ -1051,9 +1051,9 @@ unsigned short risc_code01[] = {
 	0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078, 0x908e,
 	0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084, 0x0700,
 	0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300, 0x9080,
-	0x0020, 0x2018, 0x080c, 0x8248, 0x928c, 0xff00, 0x0110, 0x2011,
+	0x0020, 0x2018, 0x080c, 0x8270, 0x928c, 0xff00, 0x0110, 0x2011,
 	0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009, 0x0138,
-	0x220a, 0x080c, 0x6fa7, 0x1118, 0x2009, 0x193e, 0x220a, 0x002e,
+	0x220a, 0x080c, 0x6fb2, 0x1118, 0x2009, 0x193e, 0x220a, 0x002e,
 	0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091,
 	0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, 0x8000,
 	0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0dad, 0x002e, 0x001e,
@@ -1069,17 +1069,17 @@ unsigned short risc_code01[] = {
 	0x2832, 0x2001, 0x0001, 0x080c, 0x260c, 0x080c, 0x2a20, 0x2001,
 	0x1963, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006,
 	0x20a9, 0x0009, 0x080c, 0x29de, 0x2001, 0x1961, 0x2003, 0x0006,
-	0x2009, 0x001e, 0x2011, 0x2833, 0x080c, 0x80a2, 0x0005, 0x2009,
+	0x2009, 0x001e, 0x2011, 0x2833, 0x080c, 0x80ca, 0x0005, 0x2009,
 	0x1966, 0x200b, 0x0000, 0x2001, 0x196b, 0x2003, 0x0036, 0x2001,
 	0x196a, 0x2003, 0x002a, 0x2001, 0x1963, 0x2003, 0x0001, 0x9006,
 	0x080c, 0x2990, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x29de,
 	0x2001, 0x1961, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2833,
-	0x080c, 0x80a2, 0x0005, 0x080c, 0x0db4, 0x2001, 0x196b, 0x2003,
+	0x080c, 0x80ca, 0x0005, 0x080c, 0x0db4, 0x2001, 0x196b, 0x2003,
 	0x0036, 0x2001, 0x1963, 0x2003, 0x0003, 0x7a38, 0x9294, 0x0005,
 	0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
 	0x2990, 0x2001, 0x1967, 0x2003, 0x0000, 0x2001, 0xffff, 0x20a9,
 	0x0009, 0x080c, 0x29de, 0x2001, 0x1961, 0x2003, 0x0006, 0x2009,
-	0x001e, 0x2011, 0x2833, 0x080c, 0x80a2, 0x0005, 0x080c, 0x0db4,
+	0x001e, 0x2011, 0x2833, 0x080c, 0x80ca, 0x0005, 0x080c, 0x0db4,
 	0x080c, 0x0db4, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6,
 	0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001, 0x1963,
 	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db4, 0x0043, 0x012e, 0x015e,
@@ -1139,14 +1139,14 @@ unsigned short risc_code01[] = {
 	0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b, 0x0007, 0x0090,
 	0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060, 0x9186, 0x0002,
 	0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003, 0x1118, 0x783b,
-	0x0004, 0x0000, 0x0006, 0x1d04, 0x2a0b, 0x080c, 0x80c4, 0x1f04,
+	0x0004, 0x0000, 0x0006, 0x1d04, 0x2a0b, 0x080c, 0x80ec, 0x1f04,
 	0x2a0b, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, 0x080c,
 	0x2a5d, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e, 0x012e, 0x0005,
 	0x7850, 0x9084, 0xffcf, 0x7852, 0x0005, 0x0006, 0x0156, 0x00f6,
 	0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1130, 0x7820,
 	0xd0e4, 0x1140, 0x1f04, 0x2a2f, 0x0028, 0x7854, 0xd08c, 0x1110,
 	0x1f04, 0x2a35, 0x00fe, 0x015e, 0x000e, 0x0005, 0x1d04, 0x2a3e,
-	0x080c, 0x80c4, 0x1f04, 0x2a3e, 0x0005, 0x0006, 0x2001, 0x196d,
+	0x080c, 0x80ec, 0x1f04, 0x2a3e, 0x0005, 0x0006, 0x2001, 0x196d,
 	0x2004, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x2001, 0x196d,
 	0x2004, 0x9086, 0x0001, 0x000e, 0x0005, 0x0006, 0x2001, 0x196d,
 	0x2004, 0x9086, 0x0002, 0x000e, 0x0005, 0xa001, 0xa001, 0xa001,
@@ -1172,13 +1172,13 @@ unsigned short risc_code01[] = {
 	0x1120, 0x2304, 0x9084, 0x2800, 0x0dc0, 0x001e, 0x919c, 0xffe4,
 	0x9184, 0x0001, 0x0118, 0x9385, 0x0009, 0x6016, 0x9184, 0x0002,
 	0x0118, 0x9385, 0x0012, 0x6016, 0x003e, 0x2001, 0x180c, 0x200c,
-	0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016, 0x0026, 0x080c, 0x6fc1,
+	0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016, 0x0026, 0x080c, 0x6fcc,
 	0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215,
 	0x220a, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140,
 	0x2114, 0x9294, 0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e,
 	0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294,
 	0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016,
-	0x2009, 0x0140, 0x2104, 0x1128, 0x080c, 0x6fc1, 0x0110, 0xc0bc,
+	0x2009, 0x0140, 0x2104, 0x1128, 0x080c, 0x6fcc, 0x0110, 0xc0bc,
 	0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005, 0x2dba, 0x2dba,
 	0x2bde, 0x2bde, 0x2bea, 0x2bea, 0x2bf6, 0x2bf6, 0x2c04, 0x2c04,
 	0x2c10, 0x2c10, 0x2c1e, 0x2c1e, 0x2c2c, 0x2c2c, 0x2c3e, 0x2c3e,
@@ -1258,2610 +1258,2615 @@ unsigned short risc_code01[] = {
 	0x2766, 0x080c, 0x212b, 0x080c, 0x2313, 0x080c, 0x130c, 0x080c,
 	0x2166, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
 	0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026,
-	0x080c, 0x6519, 0x1904, 0x2ebe, 0x72d8, 0x2001, 0x194d, 0x2004,
+	0x080c, 0x6520, 0x1904, 0x2ec1, 0x72d8, 0x2001, 0x194d, 0x2004,
 	0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904,
-	0x2ebe, 0x080c, 0x2ec3, 0x0804, 0x2ebe, 0xd2cc, 0x1904, 0x2ebe,
-	0x080c, 0x6fa7, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2ebe, 0xd294,
-	0x0120, 0x70ab, 0xffff, 0x0804, 0x2ebe, 0x080c, 0x3127, 0x0160,
-	0x080c, 0xc1f9, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e50,
-	0x70ab, 0xffff, 0x0804, 0x2ebe, 0x2001, 0x1817, 0x203c, 0x7290,
-	0xd284, 0x0904, 0x2e50, 0xd28c, 0x1904, 0x2e50, 0x0036, 0x73a8,
+	0x2ec1, 0x080c, 0x2ec6, 0x0804, 0x2ec1, 0xd2cc, 0x1904, 0x2ec1,
+	0x080c, 0x6fb2, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2ec1, 0xd294,
+	0x0120, 0x70ab, 0xffff, 0x0804, 0x2ec1, 0x080c, 0x312e, 0x0160,
+	0x080c, 0xc212, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e53,
+	0x70ab, 0xffff, 0x0804, 0x2ec1, 0x2001, 0x1817, 0x203c, 0x7290,
+	0xd284, 0x0904, 0x2e53, 0xd28c, 0x1904, 0x2e53, 0x0036, 0x73a8,
 	0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80,
 	0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
-	0x9084, 0x00ff, 0x970e, 0x0590, 0x908e, 0x0000, 0x0578, 0x908e,
-	0x00ff, 0x1150, 0x7230, 0xd284, 0x1570, 0x7290, 0xc28d, 0x7292,
-	0x70ab, 0xffff, 0x003e, 0x0460, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x657f, 0x002e, 0x0118, 0x70ab, 0xffff, 0x00f8, 0x900e, 0x080c,
-	0x2663, 0x080c, 0x61d7, 0x11a8, 0x080c, 0x655b, 0x1150, 0x7030,
-	0xd08c, 0x0118, 0xb800, 0xd0bc, 0x0120, 0x080c, 0x2edc, 0x0148,
-	0x0028, 0x080c, 0x3018, 0x080c, 0x2f08, 0x0118, 0x8318, 0x0804,
-	0x2e05, 0x73aa, 0x0010, 0x70ab, 0xffff, 0x003e, 0x0804, 0x2ebe,
-	0x9780, 0x3131, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e,
-	0x70a8, 0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812,
-	0x0220, 0x2008, 0x9802, 0x20a8, 0x0020, 0x70ab, 0xffff, 0x0804,
-	0x2ebe, 0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x2eb3, 0x0026,
-	0x2011, 0x0010, 0x080c, 0x657f, 0x002e, 0x0120, 0x2009, 0xffff,
-	0x0804, 0x2ebb, 0xc484, 0x080c, 0x6237, 0x0138, 0x080c, 0xc1f9,
-	0x1590, 0x080c, 0x61d7, 0x15b8, 0x0008, 0xc485, 0x080c, 0x655b,
-	0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7290,
-	0xd28c, 0x0180, 0x080c, 0x655b, 0x9082, 0x0006, 0x02e0, 0xd484,
-	0x1118, 0x080c, 0x61fb, 0x0028, 0x080c, 0x30a3, 0x01a0, 0x080c,
-	0x30ce, 0x0088, 0x080c, 0x3018, 0x080c, 0xc1f9, 0x1160, 0x080c,
-	0x2f08, 0x0188, 0x0040, 0x080c, 0xc1f9, 0x1118, 0x080c, 0x30a3,
-	0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2e69,
-	0x70ab, 0xffff, 0x0018, 0x001e, 0x015e, 0x71aa, 0x004e, 0x002e,
-	0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70ab, 0x0001, 0x2009,
-	0x007e, 0x080c, 0x61d7, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe,
-	0x080c, 0x3018, 0x04a9, 0x0128, 0x70d8, 0xc0bd, 0x70da, 0x080c,
-	0xbf4a, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
-	0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9e66,
-	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbf73, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x6174, 0x2001, 0x0000, 0x080c, 0x6188, 0x0126, 0x2091,
-	0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e, 0x2009, 0x0004, 0x080c,
-	0x9e93, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
-	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084,
-	0x00ff, 0xb842, 0x080c, 0x9e66, 0x0548, 0x2b00, 0x6012, 0xb800,
-	0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x2fd7, 0x080c, 0xbf73,
-	0x6023, 0x0001, 0x9006, 0x080c, 0x6174, 0x2001, 0x0002, 0x080c,
-	0x6188, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
-	0x2009, 0x0002, 0x080c, 0x9e93, 0x9085, 0x0001, 0x00ce, 0x00de,
-	0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080,
-	0x080c, 0x61d7, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039,
-	0x0110, 0x70df, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016,
-	0x0076, 0x00d6, 0x00c6, 0x080c, 0x9dc3, 0x01d0, 0x2b00, 0x6012,
-	0x080c, 0xbf73, 0x6023, 0x0001, 0x9006, 0x080c, 0x6174, 0x2001,
-	0x0002, 0x080c, 0x6188, 0x0126, 0x2091, 0x8000, 0x70e0, 0x8000,
-	0x70e2, 0x012e, 0x2009, 0x0002, 0x080c, 0x9e93, 0x9085, 0x0001,
-	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126,
-	0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x61d7, 0x11b8, 0xb813,
-	0x00ff, 0xb817, 0xfffd, 0xb8bf, 0x0004, 0x080c, 0x9dc3, 0x0170,
-	0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xbf73,
-	0x2009, 0x0022, 0x080c, 0x9e93, 0x9085, 0x0001, 0x012e, 0x00de,
-	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6,
-	0x21f0, 0x080c, 0x8554, 0x080c, 0x84e3, 0x080c, 0x9c71, 0x080c,
-	0xad5e, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
-	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6237, 0x1140,
-	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x5ce4,
-	0x001e, 0x8108, 0x1f04, 0x2fbc, 0x9686, 0x0001, 0x190c, 0x30fb,
-	0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
-	0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x6210, 0x2258, 0xbaa0,
-	0x0026, 0x2019, 0x0029, 0x080c, 0x8549, 0x0076, 0x2039, 0x0000,
-	0x080c, 0x8441, 0x2c08, 0x080c, 0xd27b, 0x007e, 0x001e, 0xba10,
-	0xbb14, 0x080c, 0x5ce4, 0xba12, 0xbb16, 0x00be, 0x001e, 0x002e,
-	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010,
-	0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800,
-	0x70a4, 0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005,
-	0x2071, 0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8,
-	0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6,
+	0x9084, 0x00ff, 0x970e, 0x05a8, 0x908e, 0x0000, 0x0590, 0x908e,
+	0x00ff, 0x1150, 0x7230, 0xd284, 0x1588, 0x7290, 0xc28d, 0x7292,
+	0x70ab, 0xffff, 0x003e, 0x0478, 0x0026, 0x2011, 0x0010, 0x080c,
+	0x6586, 0x002e, 0x0118, 0x70ab, 0xffff, 0x0410, 0x900e, 0x080c,
+	0x2663, 0x080c, 0x61de, 0x11c0, 0x080c, 0x6562, 0x1168, 0x7030,
+	0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c, 0x645e, 0x0120,
+	0x080c, 0x2edf, 0x0148, 0x0028, 0x080c, 0x301f, 0x080c, 0x2f0b,
+	0x0118, 0x8318, 0x0804, 0x2e05, 0x73aa, 0x0010, 0x70ab, 0xffff,
+	0x003e, 0x0804, 0x2ec1, 0x9780, 0x3138, 0x203d, 0x97bc, 0xff00,
+	0x873f, 0x2041, 0x007e, 0x70a8, 0x9096, 0xffff, 0x1118, 0x900e,
+	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
+	0x70ab, 0xffff, 0x0804, 0x2ec1, 0x2700, 0x0156, 0x0016, 0x9106,
+	0x0904, 0x2eb6, 0x0026, 0x2011, 0x0010, 0x080c, 0x6586, 0x002e,
+	0x0120, 0x2009, 0xffff, 0x0804, 0x2ebe, 0xc484, 0x080c, 0x623e,
+	0x0138, 0x080c, 0xc212, 0x1590, 0x080c, 0x61de, 0x15b8, 0x0008,
+	0xc485, 0x080c, 0x6562, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800,
+	0xd0bc, 0x11e0, 0x7290, 0xd28c, 0x0180, 0x080c, 0x6562, 0x9082,
+	0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x6202, 0x0028, 0x080c,
+	0x30aa, 0x01a0, 0x080c, 0x30d5, 0x0088, 0x080c, 0x301f, 0x080c,
+	0xc212, 0x1160, 0x080c, 0x2f0b, 0x0188, 0x0040, 0x080c, 0xc212,
+	0x1118, 0x080c, 0x30aa, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108,
+	0x015e, 0x1f04, 0x2e6c, 0x70ab, 0xffff, 0x0018, 0x001e, 0x015e,
+	0x71aa, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016,
+	0x70ab, 0x0001, 0x2009, 0x007e, 0x080c, 0x61de, 0x1168, 0xb813,
+	0x00ff, 0xb817, 0xfffe, 0x080c, 0x301f, 0x04a9, 0x0128, 0x70d8,
+	0xc0bd, 0x70da, 0x080c, 0xbf63, 0x001e, 0x00ce, 0x0005, 0x0016,
+	0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff,
+	0xb842, 0x080c, 0x9e7f, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbf8c,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x617b, 0x2001, 0x0000, 0x080c,
+	0x618f, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
+	0x2009, 0x0004, 0x080c, 0x9eac, 0x9085, 0x0001, 0x00ce, 0x00de,
+	0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001,
+	0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9e7f, 0x0548,
+	0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e,
+	0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c,
+	0x2fda, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x9006, 0x080c, 0x617b,
+	0x2001, 0x0002, 0x080c, 0x618f, 0x0126, 0x2091, 0x8000, 0x70a4,
+	0x8000, 0x70a6, 0x012e, 0x2009, 0x0002, 0x080c, 0x9eac, 0x9085,
+	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6,
+	0x0026, 0x2009, 0x0080, 0x080c, 0x61de, 0x1140, 0xb813, 0x00ff,
+	0xb817, 0xfffc, 0x0039, 0x0110, 0x70df, 0xffff, 0x002e, 0x00ce,
+	0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0x9ddc,
+	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f, 0x0126, 0x2091,
+	0x8000, 0x70e0, 0x8000, 0x70e2, 0x012e, 0x2009, 0x0002, 0x080c,
+	0x9eac, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
+	0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c,
+	0x61de, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8bf, 0x0004,
+	0x080c, 0x9ddc, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001,
+	0x620a, 0x080c, 0xbf8c, 0x2009, 0x0022, 0x080c, 0x9eac, 0x9085,
+	0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066,
+	0x0036, 0x0026, 0x00b6, 0x21f0, 0x080c, 0x857c, 0x080c, 0x850b,
+	0x080c, 0x9c8a, 0x080c, 0xad77, 0x3e08, 0x2130, 0x81ff, 0x0120,
+	0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x080c, 0x623e, 0x1140, 0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc,
+	0x1110, 0x080c, 0x5ceb, 0x001e, 0x8108, 0x1f04, 0x2fbf, 0x9686,
+	0x0001, 0x190c, 0x3102, 0x00be, 0x002e, 0x003e, 0x006e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0046, 0x0036, 0x0026, 0x0016,
+	0x00b6, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c,
+	0x8571, 0x0076, 0x2039, 0x0000, 0x080c, 0x8469, 0x2c08, 0x080c,
+	0xd29b, 0x007e, 0x001e, 0xba10, 0xbb14, 0xbcb0, 0x080c, 0x5ceb,
+	0xba12, 0xbb16, 0xbcb2, 0x00be, 0x001e, 0x002e, 0x003e, 0x004e,
+	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058,
+	0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a4,
+	0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8, 0xb800,
+	0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046,
 	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9,
-	0x0001, 0x0080, 0x080c, 0x537f, 0xd0c4, 0x0148, 0x0040, 0x9006,
-	0x0046, 0x2020, 0x2009, 0x002d, 0x080c, 0xd50a, 0x004e, 0x20a9,
-	0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x3083, 0x928e,
-	0x007f, 0x0904, 0x3083, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000,
-	0x210c, 0x81ff, 0x05c0, 0x8fff, 0x1148, 0x2001, 0x195f, 0x0006,
-	0x2003, 0x0001, 0x04e9, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6,
-	0x2158, 0x2001, 0x0001, 0x080c, 0x6525, 0x00ce, 0x00be, 0x2019,
-	0x0029, 0x080c, 0x8549, 0x0076, 0x2039, 0x0000, 0x080c, 0x8441,
-	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
-	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
-	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
-	0xd27b, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x303a, 0x015e,
-	0x001e, 0x002e, 0x003e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x0046, 0x0026, 0x0016, 0x080c, 0x537f, 0xd0c4, 0x0140, 0xd0a4,
-	0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xd50a, 0x001e,
-	0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7290,
-	0x82ff, 0x01e8, 0x080c, 0x6553, 0x11d0, 0x2100, 0x080c, 0x2696,
-	0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04,
-	0xd384, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff,
-	0x9116, 0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085,
-	0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x0036, 0x2019, 0x0029, 0x00a9, 0x003e,
-	0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061,
-	0x1a80, 0x001e, 0x6112, 0x080c, 0x2fd7, 0x001e, 0x080c, 0x61fb,
-	0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c,
-	0x990d, 0x080c, 0xd7c2, 0x002e, 0x001e, 0x0005, 0x2001, 0x1836,
-	0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6fa7, 0x1118,
-	0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6fa7, 0x1110,
-	0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d,
-	0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x61fb, 0x8108,
-	0x1f04, 0x310c, 0x2061, 0x1800, 0x607b, 0x0000, 0x607c, 0x9084,
-	0x00ff, 0x607e, 0x60af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001,
-	0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214, 0xd2ec,
-	0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc,
-	0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1,
-	0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6,
-	0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4,
-	0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa,
-	0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d,
-	0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282,
-	0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074,
-	0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a,
-	0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559,
-	0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d,
-	0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043,
-	0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932,
-	0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227,
-	0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18,
-	0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000,
-	0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000,
-	0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00,
-	0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900,
-	0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200,
-	0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00,
-	0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600,
-	0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00,
-	0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900,
-	0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000,
-	0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000,
-	0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x0001, 0x0070, 0x080c, 0x5386, 0xd0c4, 0x0138, 0x0030, 0x9006,
+	0x2020, 0x2009, 0x002d, 0x080c, 0xd52a, 0x20a9, 0x0800, 0x9016,
+	0x0026, 0x928e, 0x007e, 0x0904, 0x3089, 0x928e, 0x007f, 0x0904,
+	0x3089, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000, 0x210c, 0x81ff,
+	0x05c0, 0x8fff, 0x1148, 0x2001, 0x195f, 0x0006, 0x2003, 0x0001,
+	0x04f1, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
+	0x0001, 0x080c, 0x652c, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
+	0x8571, 0x0076, 0x2039, 0x0000, 0x080c, 0x8469, 0x00b6, 0x00c6,
+	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
+	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
+	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xd29b, 0x001e,
+	0x007e, 0x002e, 0x8210, 0x1f04, 0x3040, 0x015e, 0x001e, 0x002e,
+	0x003e, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046,
+	0x0026, 0x0016, 0x080c, 0x5386, 0xd0c4, 0x0140, 0xd0a4, 0x0130,
+	0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xd52a, 0x001e, 0x002e,
+	0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7290, 0x82ff,
+	0x01e8, 0x080c, 0x655a, 0x11d0, 0x2100, 0x080c, 0x2696, 0x81ff,
+	0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0xd384,
+	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116,
+	0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x0036, 0x2019, 0x0029, 0x00a9, 0x003e, 0x9180,
+	0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1a80,
+	0x001e, 0x6112, 0x080c, 0x2fda, 0x001e, 0x080c, 0x6202, 0x012e,
+	0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0x9926,
+	0x080c, 0xd7e2, 0x002e, 0x001e, 0x0005, 0x2001, 0x1836, 0x2004,
+	0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6fb2, 0x1118, 0x20a9,
+	0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6fb2, 0x1110, 0x900e,
+	0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130,
+	0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x6202, 0x8108, 0x1f04,
+	0x3113, 0x2061, 0x1800, 0x607b, 0x0000, 0x607c, 0x9084, 0x00ff,
+	0x607e, 0x60af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1875,
+	0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214, 0xd2ec, 0x0005,
+	0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da,
+	0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce,
+	0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5,
+	0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3,
+	0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9,
+	0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b,
+	0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081,
+	0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073,
+	0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69,
+	0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056,
+	0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c,
+	0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c,
+	0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831,
+	0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026,
+	0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017,
+	0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000,
+	0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000,
+	0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300,
+	0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100,
+	0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00,
+	0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800,
+	0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000,
+	0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000,
+	0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500,
+	0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000,
+	0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000,
+	0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000,
+	0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000,
+	0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x2071, 0x1894, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a,
-	0x704a, 0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18b0, 0x703f,
-	0x18b0, 0x7007, 0x0001, 0x080c, 0x1004, 0x090c, 0x0db4, 0x2900,
-	0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1004, 0x090c,
-	0x0db4, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005,
-	0x2071, 0x1894, 0x7004, 0x0002, 0x3260, 0x3261, 0x3274, 0x3288,
-	0x0005, 0x1004, 0x3271, 0x0e04, 0x3271, 0x2079, 0x0000, 0x0126,
-	0x2091, 0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e,
-	0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18ae,
-	0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904,
-	0x335c, 0x0005, 0x7018, 0x2048, 0x2061, 0x1800, 0x701c, 0x0807,
-	0x7014, 0x2048, 0xa864, 0x9094, 0x00ff, 0x9296, 0x0029, 0x1120,
-	0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103, 0x0108, 0x0005,
-	0x2079, 0x0000, 0x2061, 0x1800, 0x701c, 0x0807, 0x2061, 0x1800,
-	0x7880, 0x908a, 0x0040, 0x1210, 0x61cc, 0x0042, 0x2100, 0x908a,
-	0x003f, 0x1a04, 0x3359, 0x61cc, 0x0804, 0x32ee, 0x3330, 0x3368,
-	0x3372, 0x3376, 0x3380, 0x3386, 0x338a, 0x339a, 0x339d, 0x33a7,
-	0x33ac, 0x33b1, 0x33bc, 0x33c7, 0x33d6, 0x33e5, 0x33f3, 0x340a,
-	0x3425, 0x3359, 0x34ce, 0x350c, 0x35b2, 0x35c3, 0x35e6, 0x3359,
-	0x3359, 0x3359, 0x361e, 0x363a, 0x3643, 0x3672, 0x3678, 0x3359,
-	0x36be, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x36c9, 0x36d2,
-	0x36da, 0x36dc, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359,
-	0x3708, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x3725, 0x3780,
-	0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x0002, 0x37aa,
-	0x37ad, 0x380c, 0x3825, 0x3855, 0x3af3, 0x3359, 0x4f58, 0x3359,
-	0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x3359, 0x33a7,
-	0x33ac, 0x4014, 0x53a3, 0x402a, 0x4fe7, 0x5038, 0x513b, 0x3359,
-	0x519d, 0x51d9, 0x520a, 0x530e, 0x5237, 0x528e, 0x3359, 0x402e,
-	0x41cf, 0x41e5, 0x420a, 0x426f, 0x42e3, 0x4303, 0x437a, 0x43d6,
-	0x4432, 0x4435, 0x445a, 0x44fa, 0x4560, 0x4568, 0x469a, 0x47fc,
-	0x4830, 0x4a7a, 0x3359, 0x4a98, 0x4b5b, 0x4c31, 0x3359, 0x3359,
-	0x3359, 0x3359, 0x4c97, 0x4cb2, 0x4568, 0x4ef8, 0x714c, 0x0000,
-	0x2021, 0x4000, 0x080c, 0x48ae, 0x0126, 0x2091, 0x8000, 0x0e04,
-	0x333a, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118,
-	0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a,
-	0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x1187, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e,
-	0x0005, 0x2021, 0x4001, 0x08b0, 0x2021, 0x4002, 0x0898, 0x2021,
-	0x4003, 0x0880, 0x2021, 0x4005, 0x0868, 0x2021, 0x4006, 0x0850,
-	0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990,
-	0x0804, 0x48bb, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039, 0x0001,
-	0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x48be,
-	0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x3330, 0x7984, 0x2114,
-	0x0804, 0x3330, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9, 0x0000,
-	0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c,
-	0x0804, 0x3330, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003, 0x2011,
-	0x0002, 0x2019, 0x001a, 0x789b, 0x0317, 0x0804, 0x3330, 0x2039,
-	0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98, 0x7c9c,
-	0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3365, 0x2138,
-	0x7d98, 0x7c9c, 0x0804, 0x336c, 0x79a0, 0x9182, 0x0040, 0x0210,
-	0x0804, 0x3365, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x337a, 0x79a0,
-	0x9182, 0x0040, 0x0210, 0x0804, 0x3365, 0x21e8, 0x7984, 0x7888,
-	0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x3330, 0x2061, 0x0800,
-	0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8, 0x2010,
-	0x9005, 0x0904, 0x3330, 0x0804, 0x335f, 0x79a0, 0x9182, 0x0040,
-	0x0210, 0x0804, 0x3365, 0x21e0, 0x20a9, 0x0001, 0x7984, 0x2198,
-	0x4012, 0x0804, 0x3330, 0x2069, 0x1853, 0x7884, 0x7990, 0x911a,
-	0x1a04, 0x3365, 0x8019, 0x0904, 0x3365, 0x684a, 0x6942, 0x788c,
-	0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c, 0x72bc,
-	0x0804, 0x3330, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a, 0x1a04,
-	0x3365, 0x8019, 0x0904, 0x3365, 0x684e, 0x6946, 0x788c, 0x6862,
-	0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x665d, 0x012e, 0x0804, 0x3330, 0x902e, 0x2520, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x3362, 0x7984, 0x7b88, 0x7a8c,
-	0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101, 0x080c,
-	0x4872, 0x1120, 0x2009, 0x0002, 0x0804, 0x3362, 0x2009, 0x0020,
-	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48bb, 0x701f, 0x3449,
-	0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011, 0x0168,
-	0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096, 0x0048,
-	0x0120, 0x9096, 0x0029, 0x1904, 0x3362, 0x810f, 0x918c, 0x00ff,
-	0x0904, 0x3362, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012, 0x080c,
-	0x4872, 0x1120, 0x2009, 0x0002, 0x0804, 0x3362, 0x2009, 0x0020,
-	0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290, 0x0040,
-	0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080,
-	0x0019, 0xaf60, 0x080c, 0x48bb, 0x701f, 0x3487, 0x0005, 0xa864,
-	0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a, 0x1904,
-	0x3362, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0xa864,
-	0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a, 0x080c,
-	0x5dd6, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x012e,
-	0x0050, 0x080c, 0x60ed, 0x1128, 0x7007, 0x0003, 0x701f, 0x34b3,
-	0x0005, 0x080c, 0x6abf, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005,
-	0x20e1, 0x0001, 0x2099, 0x189c, 0x400a, 0x2100, 0x9210, 0x9399,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x2071, 0x1894, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a,
+	0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0,
+	0x7007, 0x0001, 0x080c, 0x1004, 0x090c, 0x0db4, 0x2900, 0x706a,
+	0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1004, 0x090c, 0x0db4,
+	0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071,
+	0x1894, 0x7004, 0x0002, 0x3267, 0x3268, 0x327b, 0x328f, 0x0005,
+	0x1004, 0x3278, 0x0e04, 0x3278, 0x2079, 0x0000, 0x0126, 0x2091,
+	0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468,
+	0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18ae, 0x2c4c,
+	0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x3363,
+	0x0005, 0x7018, 0x2048, 0x2061, 0x1800, 0x701c, 0x0807, 0x7014,
+	0x2048, 0xa864, 0x9094, 0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78,
+	0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103, 0x0108, 0x0005, 0x2079,
+	0x0000, 0x2061, 0x1800, 0x701c, 0x0807, 0x2061, 0x1800, 0x7880,
+	0x908a, 0x0040, 0x1210, 0x61cc, 0x0042, 0x2100, 0x908a, 0x003f,
+	0x1a04, 0x3360, 0x61cc, 0x0804, 0x32f5, 0x3337, 0x336f, 0x3379,
+	0x337d, 0x3387, 0x338d, 0x3391, 0x33a1, 0x33a4, 0x33ae, 0x33b3,
+	0x33b8, 0x33c3, 0x33ce, 0x33dd, 0x33ec, 0x33fa, 0x3411, 0x342c,
+	0x3360, 0x34d5, 0x3513, 0x35b9, 0x35ca, 0x35ed, 0x3360, 0x3360,
+	0x3360, 0x3625, 0x3641, 0x364a, 0x3679, 0x367f, 0x3360, 0x36c5,
+	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x36d0, 0x36d9, 0x36e1,
+	0x36e3, 0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x370f,
+	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x372c, 0x3787, 0x3360,
+	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x0002, 0x37b1, 0x37b4,
+	0x3813, 0x382c, 0x385c, 0x3afa, 0x3360, 0x4f5f, 0x3360, 0x3360,
+	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x33ae, 0x33b3,
+	0x401b, 0x53aa, 0x4031, 0x4fee, 0x503f, 0x5142, 0x3360, 0x51a4,
+	0x51e0, 0x5211, 0x5315, 0x523e, 0x5295, 0x3360, 0x4035, 0x41d6,
+	0x41ec, 0x4211, 0x4276, 0x42ea, 0x430a, 0x4381, 0x43dd, 0x4439,
+	0x443c, 0x4461, 0x4501, 0x4567, 0x456f, 0x46a1, 0x4803, 0x4837,
+	0x4a81, 0x3360, 0x4a9f, 0x4b62, 0x4c38, 0x3360, 0x3360, 0x3360,
+	0x3360, 0x4c9e, 0x4cb9, 0x456f, 0x4eff, 0x714c, 0x0000, 0x2021,
+	0x4000, 0x080c, 0x48b5, 0x0126, 0x2091, 0x8000, 0x0e04, 0x3341,
+	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
+	0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187,
+	0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005,
+	0x2021, 0x4001, 0x08b0, 0x2021, 0x4002, 0x0898, 0x2021, 0x4003,
+	0x0880, 0x2021, 0x4005, 0x0868, 0x2021, 0x4006, 0x0850, 0x2039,
+	0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804,
+	0x48c2, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039, 0x0001, 0x902e,
+	0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x48c5, 0x7984,
+	0x7888, 0x2114, 0x200a, 0x0804, 0x3337, 0x7984, 0x2114, 0x0804,
+	0x3337, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1,
+	0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804,
+	0x3337, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003, 0x2011, 0x0002,
+	0x2019, 0x001c, 0x789b, 0x0317, 0x0804, 0x3337, 0x2039, 0x0001,
+	0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x336c, 0x2138, 0x7d98,
+	0x7c9c, 0x0804, 0x3373, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
+	0x336c, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3381, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x336c, 0x21e8, 0x7984, 0x7888, 0x20a9,
+	0x0001, 0x21a0, 0x4004, 0x0804, 0x3337, 0x2061, 0x0800, 0xe10c,
+	0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005,
+	0x0904, 0x3337, 0x0804, 0x3366, 0x79a0, 0x9182, 0x0040, 0x0210,
+	0x0804, 0x336c, 0x21e0, 0x20a9, 0x0001, 0x7984, 0x2198, 0x4012,
+	0x0804, 0x3337, 0x2069, 0x1853, 0x7884, 0x7990, 0x911a, 0x1a04,
+	0x336c, 0x8019, 0x0904, 0x336c, 0x684a, 0x6942, 0x788c, 0x6852,
+	0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c, 0x72c7, 0x0804,
+	0x3337, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a, 0x1a04, 0x336c,
+	0x8019, 0x0904, 0x336c, 0x684e, 0x6946, 0x788c, 0x6862, 0x7888,
+	0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6664, 0x012e, 0x0804, 0x3337, 0x902e, 0x2520, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3369, 0x7984, 0x7b88, 0x7a8c, 0x20a9,
+	0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101, 0x080c, 0x4879,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x2009, 0x0020, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x48c2, 0x701f, 0x3450, 0x0005,
+	0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011, 0x0168, 0x9096,
+	0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096, 0x0048, 0x0120,
+	0x9096, 0x0029, 0x1904, 0x3369, 0x810f, 0x918c, 0x00ff, 0x0904,
+	0x3369, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012, 0x080c, 0x4879,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x2009, 0x0020, 0x7068,
+	0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290, 0x0040, 0x9399,
 	0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019,
-	0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x48be, 0x2091, 0x8000,
-	0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887, 0x4953,
-	0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104, 0x7892,
-	0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200, 0x603c,
-	0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e, 0x2091,
-	0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x0180,
-	0x2001, 0x19ea, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004,
-	0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003, 0x1001,
-	0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x3362, 0x7984,
-	0x080c, 0x6237, 0x1904, 0x3365, 0x7e98, 0x9684, 0x3fff, 0x9082,
-	0x4000, 0x1a04, 0x3365, 0x7c88, 0x7d8c, 0x080c, 0x639a, 0x080c,
-	0x6369, 0x0000, 0x1518, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000,
-	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
-	0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018,
-	0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x3362, 0x0c30, 0x080c,
-	0xb731, 0x012e, 0x0904, 0x3362, 0x0804, 0x3330, 0x900e, 0x2001,
-	0x0005, 0x080c, 0x6abf, 0x0126, 0x2091, 0x8000, 0x080c, 0xbdf3,
-	0x080c, 0x6885, 0x012e, 0x0804, 0x3330, 0x00a6, 0x2950, 0xb198,
-	0x080c, 0x6237, 0x1904, 0x359f, 0xb6a4, 0x9684, 0x3fff, 0x9082,
-	0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x639a, 0x080c, 0x6369,
-	0x1520, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086,
-	0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118,
-	0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x1819,
-	0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xb731,
-	0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005,
-	0x080c, 0x6abf, 0x0126, 0x2091, 0x8000, 0x080c, 0xbdf3, 0x080c,
-	0x6878, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010, 0xb097,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48, 0x00ae,
-	0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008, 0x2a48,
-	0x00ae, 0x0005, 0x81ff, 0x1904, 0x3362, 0x080c, 0x4889, 0x0904,
-	0x3365, 0x080c, 0x62fe, 0x0904, 0x3362, 0x080c, 0x63a0, 0x0904,
-	0x3362, 0x0804, 0x42fa, 0x81ff, 0x1904, 0x3362, 0x080c, 0x48a5,
-	0x0904, 0x3365, 0x080c, 0x642e, 0x0904, 0x3362, 0x2019, 0x0005,
-	0x79a8, 0x080c, 0x63bb, 0x0904, 0x3362, 0x7888, 0x908a, 0x1000,
-	0x1a04, 0x3365, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x801e,
-	0x7984, 0xd184, 0x1904, 0x3330, 0x0804, 0x42fa, 0x0126, 0x2091,
-	0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff,
-	0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x6237, 0x11d8,
-	0x080c, 0x642e, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518, 0x00c0,
-	0x2019, 0x0004, 0x900e, 0x080c, 0x63bb, 0x1118, 0x2009, 0x0006,
-	0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b,
-	0x9108, 0x080c, 0x801e, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x3330,
-	0x012e, 0x0804, 0x3362, 0x012e, 0x0804, 0x3365, 0x080c, 0x4889,
-	0x0904, 0x3365, 0x080c, 0x62fe, 0x0904, 0x3362, 0xbaa0, 0x2019,
-	0x0005, 0x00c6, 0x9066, 0x080c, 0x8549, 0x0076, 0x903e, 0x080c,
-	0x8441, 0x900e, 0x080c, 0xd27b, 0x007e, 0x00ce, 0x080c, 0x639a,
-	0x0804, 0x3330, 0x080c, 0x4889, 0x0904, 0x3365, 0x080c, 0x639a,
-	0x2208, 0x0804, 0x3330, 0x0156, 0x00d6, 0x00e6, 0x2069, 0x1906,
-	0x6810, 0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e,
-	0x20a9, 0x007e, 0x2069, 0x1000, 0x2d04, 0x905d, 0x0118, 0xb84c,
-	0x0059, 0x9210, 0x8d68, 0x1f04, 0x3654, 0x2300, 0x9218, 0x00ee,
-	0x00de, 0x015e, 0x0804, 0x3330, 0x00f6, 0x0016, 0x907d, 0x0138,
-	0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e,
-	0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b8, 0x0804, 0x3330,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3362, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x5393, 0x0128, 0x2009, 0x0007, 0x012e, 0x0804,
-	0x3362, 0x012e, 0x6158, 0x9190, 0x3131, 0x2215, 0x9294, 0x00ff,
-	0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8, 0x97c4, 0x000a, 0x98c6,
-	0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4, 0x0022, 0x98c6,
-	0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4, 0x0012, 0x98c6,
-	0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c, 0x6fa7, 0x1118,
-	0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005, 0x0804,
-	0x3362, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3330, 0x6148, 0x624c,
-	0x2019, 0x1957, 0x231c, 0x2001, 0x1958, 0x2004, 0x789a, 0x0804,
-	0x3330, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340, 0x012e,
-	0x0804, 0x3330, 0x080c, 0x48a5, 0x0904, 0x3365, 0xba44, 0xbb38,
-	0x0804, 0x3330, 0x080c, 0x0db4, 0x080c, 0x48a5, 0x2110, 0x0904,
-	0x3365, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140, 0x9084,
-	0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x3362, 0x0126,
-	0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x990d,
-	0x080c, 0x8549, 0x0076, 0x903e, 0x080c, 0x8441, 0x900e, 0x080c,
-	0xd27b, 0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804, 0x3330,
-	0x6148, 0x624c, 0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853,
-	0x831f, 0x9305, 0x6816, 0x788c, 0x2069, 0x1957, 0x2d1c, 0x206a,
-	0x7e98, 0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1958,
-	0x2d04, 0x266a, 0x789a, 0x0804, 0x3330, 0x0126, 0x2091, 0x8000,
-	0x6138, 0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0e9b, 0xd0c4,
-	0x01a8, 0x00d6, 0x78a8, 0x2009, 0x196e, 0x200a, 0x78ac, 0x2011,
-	0x196f, 0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118,
-	0x2214, 0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e,
-	0x2011, 0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080,
-	0x0010, 0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e,
-	0xd1e4, 0x190c, 0x0eb1, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011,
-	0x0114, 0x2012, 0x012e, 0x0804, 0x3330, 0x00f6, 0x2079, 0x1800,
-	0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf,
-	0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897,
-	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005,
-	0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x3365, 0x788c,
-	0x902d, 0x0904, 0x3365, 0x900e, 0x080c, 0x6237, 0x1120, 0xba44,
-	0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0,
-	0x080c, 0x48a5, 0x0904, 0x3365, 0x7888, 0x900d, 0x0904, 0x3365,
-	0x788c, 0x9005, 0x0904, 0x3365, 0xba44, 0xb946, 0xbb38, 0xb83a,
-	0x0804, 0x3330, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c,
-	0x5393, 0x1904, 0x3362, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186,
-	0x00ff, 0x1130, 0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088,
-	0x9182, 0x007f, 0x16e0, 0x9188, 0x3131, 0x210d, 0x918c, 0x00ff,
-	0x2001, 0x1817, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f,
-	0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x9dc3, 0x000e,
-	0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x61dd, 0x2b08,
-	0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4872, 0x01d0,
-	0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a,
-	0x701f, 0x3805, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9e93,
-	0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x3362, 0x00ce,
-	0x0804, 0x3365, 0x080c, 0x9e19, 0x0cb0, 0xa830, 0x9086, 0x0100,
-	0x0904, 0x3362, 0x0804, 0x3330, 0x2061, 0x1a41, 0x0126, 0x2091,
-	0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800,
-	0x6350, 0x6070, 0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e,
-	0x0804, 0x3330, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x3362,
-	0x080c, 0x6fa7, 0x0904, 0x3362, 0x0126, 0x2091, 0x8000, 0x6250,
-	0x6070, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x26cc, 0x080c,
-	0x55ad, 0x012e, 0x0804, 0x3330, 0x012e, 0x0804, 0x3365, 0x0006,
-	0x0016, 0x00c6, 0x00e6, 0x2001, 0x197a, 0x2070, 0x2061, 0x1853,
-	0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x8248, 0x7206,
-	0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3332, 0x7884,
-	0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288,
-	0x012e, 0x0804, 0x3365, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853,
-	0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x3365, 0x012e, 0x0804,
-	0x3362, 0x080c, 0x9d98, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x38d0,
-	0x00c6, 0x080c, 0x4872, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884,
-	0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004,
-	0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004,
-	0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004,
-	0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004,
-	0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3a56,
-	0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930,
-	0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906,
+	0xaf60, 0x080c, 0x48c2, 0x701f, 0x348e, 0x0005, 0xa864, 0x9084,
+	0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a, 0x1904, 0x3369,
+	0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084,
+	0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x5ddd,
+	0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x012e, 0x0050,
+	0x080c, 0x60f4, 0x1128, 0x7007, 0x0003, 0x701f, 0x34ba, 0x0005,
+	0x080c, 0x6ac6, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1,
+	0x0001, 0x2099, 0x189c, 0x400a, 0x2100, 0x9210, 0x9399, 0x0000,
+	0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0x2009,
+	0x0020, 0x012e, 0xaf60, 0x0804, 0x48c5, 0x2091, 0x8000, 0x7837,
+	0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887, 0x4953, 0x788b,
+	0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104, 0x7892, 0x3f00,
+	0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007,
+	0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e, 0x2091, 0x5000,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x0180, 0x2001,
+	0x19ea, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc,
+	0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003, 0x1001, 0x2071,
+	0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x3369, 0x7984, 0x080c,
+	0x623e, 0x1904, 0x336c, 0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x1a04, 0x336c, 0x7c88, 0x7d8c, 0x080c, 0x63a1, 0x080c, 0x6370,
+	0x0000, 0x1518, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001,
+	0x1819, 0x2004, 0x9c02, 0x1a04, 0x3369, 0x0c30, 0x080c, 0xb74a,
+	0x012e, 0x0904, 0x3369, 0x0804, 0x3337, 0x900e, 0x2001, 0x0005,
+	0x080c, 0x6ac6, 0x0126, 0x2091, 0x8000, 0x080c, 0xbe0c, 0x080c,
+	0x688c, 0x012e, 0x0804, 0x3337, 0x00a6, 0x2950, 0xb198, 0x080c,
+	0x623e, 0x1904, 0x35a6, 0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x63a1, 0x080c, 0x6370, 0x1520,
+	0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000,
+	0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870,
+	0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xb74a, 0x012e,
+	0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005, 0x080c,
+	0x6ac6, 0x0126, 0x2091, 0x8000, 0x080c, 0xbe0c, 0x080c, 0x687f,
+	0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010, 0xb097, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48, 0x00ae, 0x0005,
+	0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008, 0x2a48, 0x00ae,
+	0x0005, 0x81ff, 0x1904, 0x3369, 0x080c, 0x4890, 0x0904, 0x336c,
+	0x080c, 0x6305, 0x0904, 0x3369, 0x080c, 0x63a7, 0x0904, 0x3369,
+	0x0804, 0x4301, 0x81ff, 0x1904, 0x3369, 0x080c, 0x48ac, 0x0904,
+	0x336c, 0x080c, 0x6435, 0x0904, 0x3369, 0x2019, 0x0005, 0x79a8,
+	0x080c, 0x63c2, 0x0904, 0x3369, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x336c, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8046, 0x7984,
+	0xd184, 0x1904, 0x3337, 0x0804, 0x4301, 0x0126, 0x2091, 0x8000,
+	0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff, 0x6458,
+	0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x623e, 0x11d8, 0x080c,
+	0x6435, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518, 0x00c0, 0x2019,
+	0x0004, 0x900e, 0x080c, 0x63c2, 0x1118, 0x2009, 0x0006, 0x0078,
+	0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b, 0x9108,
+	0x080c, 0x8046, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x3337, 0x012e,
+	0x0804, 0x3369, 0x012e, 0x0804, 0x336c, 0x080c, 0x4890, 0x0904,
+	0x336c, 0x080c, 0x6305, 0x0904, 0x3369, 0xbaa0, 0x2019, 0x0005,
+	0x00c6, 0x9066, 0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469,
+	0x900e, 0x080c, 0xd29b, 0x007e, 0x00ce, 0x080c, 0x63a1, 0x0804,
+	0x3337, 0x080c, 0x4890, 0x0904, 0x336c, 0x080c, 0x63a1, 0x2208,
+	0x0804, 0x3337, 0x0156, 0x00d6, 0x00e6, 0x2069, 0x1906, 0x6810,
+	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x20a9,
+	0x007e, 0x2069, 0x1000, 0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059,
+	0x9210, 0x8d68, 0x1f04, 0x365b, 0x2300, 0x9218, 0x00ee, 0x00de,
+	0x015e, 0x0804, 0x3337, 0x00f6, 0x0016, 0x907d, 0x0138, 0x9006,
+	0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe,
+	0x0005, 0x2069, 0x1906, 0x6910, 0x62b8, 0x0804, 0x3337, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x539a, 0x0128, 0x2009, 0x0007, 0x012e, 0x0804, 0x3369,
+	0x012e, 0x6158, 0x9190, 0x3138, 0x2215, 0x9294, 0x00ff, 0x6378,
+	0x83ff, 0x0108, 0x627c, 0x67d8, 0x97c4, 0x000a, 0x98c6, 0x000a,
+	0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022,
+	0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012,
+	0x1118, 0x2031, 0x0002, 0x0068, 0x080c, 0x6fb2, 0x1118, 0x2031,
+	0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005, 0x0804, 0x3369,
+	0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3337, 0x6148, 0x624c, 0x2019,
+	0x1957, 0x231c, 0x2001, 0x1958, 0x2004, 0x789a, 0x0804, 0x3337,
+	0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340, 0x012e, 0x0804,
+	0x3337, 0x080c, 0x48ac, 0x0904, 0x336c, 0xba44, 0xbb38, 0x0804,
+	0x3337, 0x080c, 0x0db4, 0x080c, 0x48ac, 0x2110, 0x0904, 0x336c,
+	0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140, 0x9084, 0xff00,
+	0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x3369, 0x0126, 0x2091,
+	0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x9926, 0x080c,
+	0x8571, 0x0076, 0x903e, 0x080c, 0x8469, 0x900e, 0x080c, 0xd29b,
+	0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804, 0x3337, 0x6148,
+	0x624c, 0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f,
+	0x9305, 0x6816, 0x788c, 0x2069, 0x1957, 0x2d1c, 0x206a, 0x7e98,
+	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1958, 0x2d04,
+	0x266a, 0x789a, 0x0804, 0x3337, 0x0126, 0x2091, 0x8000, 0x6138,
+	0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0e9b, 0xd0c4, 0x01a8,
+	0x00d6, 0x78a8, 0x2009, 0x196e, 0x200a, 0x78ac, 0x2011, 0x196f,
+	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
+	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011,
+	0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080, 0x0010,
+	0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4,
+	0x190c, 0x0eb1, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114,
+	0x2012, 0x012e, 0x0804, 0x3337, 0x00f6, 0x2079, 0x1800, 0x7a38,
+	0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002,
+	0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898,
+	0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x336c, 0x788c, 0x902d,
+	0x0904, 0x336c, 0x900e, 0x080c, 0x623e, 0x1120, 0xba44, 0xbb38,
+	0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c,
+	0x48ac, 0x0904, 0x336c, 0x7888, 0x900d, 0x0904, 0x336c, 0x788c,
+	0x9005, 0x0904, 0x336c, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804,
+	0x3337, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x539a,
+	0x1904, 0x3369, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff,
+	0x1130, 0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182,
+	0x007f, 0x16e0, 0x9188, 0x3138, 0x210d, 0x918c, 0x00ff, 0x2001,
+	0x1817, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105,
+	0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x9ddc, 0x000e, 0x0510,
+	0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x61e4, 0x2b08, 0x00be,
+	0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4879, 0x01d0, 0x9006,
+	0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f,
+	0x380c, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9eac, 0x012e,
+	0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x3369, 0x00ce, 0x0804,
+	0x336c, 0x080c, 0x9e32, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904,
+	0x3369, 0x0804, 0x3337, 0x2061, 0x1a41, 0x0126, 0x2091, 0x8000,
+	0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350,
+	0x6070, 0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804,
+	0x3337, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x3369, 0x080c,
+	0x6fb2, 0x0904, 0x3369, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070,
+	0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x26cc, 0x080c, 0x55b4,
+	0x012e, 0x0804, 0x3337, 0x012e, 0x0804, 0x336c, 0x0006, 0x0016,
+	0x00c6, 0x00e6, 0x2001, 0x197a, 0x2070, 0x2061, 0x1853, 0x6008,
+	0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x8270, 0x7206, 0x00ee,
+	0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
+	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3339, 0x7884, 0xd0fc,
+	0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e,
+	0x0804, 0x336c, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908,
+	0x9102, 0x1230, 0x012e, 0x0804, 0x336c, 0x012e, 0x0804, 0x3369,
+	0x080c, 0x9db1, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x38d7, 0x00c6,
+	0x080c, 0x4879, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a,
+	0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a,
+	0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822,
+	0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a,
+	0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080,
+	0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3a5d, 0x0928,
+	0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808,
+	0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c,
+	0x48c2, 0x701f, 0x399a, 0x7023, 0x0001, 0x012e, 0x0005, 0x0046,
+	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x080c, 0x3846, 0x2001, 0x1970, 0x2003, 0x0000, 0x2021, 0x000a,
+	0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1,
+	0x60bf, 0x0012, 0x080c, 0x3acc, 0x080c, 0x3a8b, 0x00f6, 0x00e6,
+	0x0086, 0x2940, 0x2071, 0x1a36, 0x2079, 0x0090, 0x00d6, 0x2069,
+	0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004, 0x780e,
+	0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
+	0x3e5f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d8c, 0x080c, 0x3c91,
+	0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8, 0x080c,
+	0x3ed3, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070,
+	0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084, 0xff00,
+	0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084, 0xff00,
+	0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037, 0x0000,
+	0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004, 0x9106, 0x1168,
+	0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138,
+	0x080c, 0x3c9b, 0x080c, 0x3a86, 0x0058, 0x080c, 0x3a86, 0x080c,
+	0x3df7, 0x080c, 0x3d82, 0x2001, 0x020b, 0x2004, 0xd0e4, 0x0dd8,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
+	0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb, 0x0000,
+	0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x080c, 0x129f, 0x2009, 0x0028, 0x080c, 0x2268,
+	0x2001, 0x0227, 0x200c, 0x2102, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001, 0x1970, 0x2004,
+	0x9005, 0x1118, 0x012e, 0x0804, 0x3337, 0x012e, 0x2021, 0x400c,
+	0x0804, 0x3339, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
+	0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048, 0x7020, 0x20a8,
+	0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x39f6, 0x2048, 0x1f04,
+	0x39aa, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0xa930,
+	0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x0096,
+	0x7014, 0x2048, 0xa864, 0x009e, 0x9086, 0x0103, 0x0170, 0x8906,
 	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x080c, 0x48bb, 0x701f, 0x3993, 0x7023, 0x0001, 0x012e, 0x0005,
-	0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x080c, 0x383f, 0x2001, 0x1970, 0x2003, 0x0000, 0x2021,
-	0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf,
-	0x32e1, 0x60bf, 0x0012, 0x080c, 0x3ac5, 0x080c, 0x3a84, 0x00f6,
-	0x00e6, 0x0086, 0x2940, 0x2071, 0x1a36, 0x2079, 0x0090, 0x00d6,
-	0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004,
-	0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001,
-	0x080c, 0x3e58, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d85, 0x080c,
-	0x3c8a, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8,
-	0x080c, 0x3ecc, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
-	0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084,
-	0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084,
-	0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037,
-	0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004, 0x9106,
-	0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce,
-	0x0138, 0x080c, 0x3c94, 0x080c, 0x3a7f, 0x0058, 0x080c, 0x3a7f,
-	0x080c, 0x3df0, 0x080c, 0x3d7b, 0x2001, 0x020b, 0x2004, 0xd0e4,
-	0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027,
-	0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb,
-	0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c,
-	0x918c, 0xfffd, 0x2102, 0x080c, 0x129f, 0x2009, 0x0028, 0x080c,
-	0x2268, 0x2001, 0x0227, 0x200c, 0x2102, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001, 0x1970,
-	0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x3330, 0x012e, 0x2021,
-	0x400c, 0x0804, 0x3332, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056,
-	0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048, 0x7020,
-	0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x39ef, 0x2048,
-	0x1f04, 0x39a3, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598,
-	0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000,
-	0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086, 0x0103, 0x0170,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x080c, 0x48bb, 0x701f, 0x3993, 0x00b0, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8,
-	0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f68, 0x000e,
-	0x080c, 0x48be, 0x701f, 0x3993, 0x015e, 0x00de, 0x009e, 0x008e,
-	0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x7014,
-	0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x3a54, 0x0450,
-	0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c,
-	0x61d7, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd,
-	0x080c, 0xbfc2, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e,
-	0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x3362, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156,
-	0x701f, 0x3a26, 0x7007, 0x0003, 0x0804, 0x39e4, 0xa830, 0x9086,
-	0x0100, 0x2021, 0x400c, 0x0904, 0x3332, 0x0076, 0xad10, 0xac0c,
-	0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000,
-	0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0,
-	0x0006, 0x080c, 0x0f68, 0x000e, 0x080c, 0x48be, 0x007e, 0x701f,
-	0x3993, 0x7023, 0x0001, 0x0005, 0x0804, 0x3330, 0x0156, 0x00c6,
-	0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010, 0xa832,
-	0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4872, 0x001e, 0x0130,
-	0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58, 0x9006, 0x0010,
-	0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006, 0x00f6, 0x2079,
-	0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e, 0x0005, 0x2001,
-	0x1970, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061,
-	0x0200, 0x2001, 0x197b, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001,
-	0x197a, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x080c, 0x4872,
-	0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e,
-	0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2061, 0x0090,
-	0x2079, 0x0100, 0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040,
-	0x080c, 0x2268, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
-	0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006, 0x600a,
-	0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c, 0x4872,
-	0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001,
-	0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004, 0xa86a, 0x2001,
-	0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873, 0x0000, 0x2001,
-	0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001,
-	0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002,
-	0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0148,
-	0x080c, 0x2a55, 0x1130, 0x9006, 0x080c, 0x29ad, 0x9006, 0x080c,
-	0x2990, 0x7884, 0x9084, 0x0007, 0x0002, 0x3b10, 0x3b19, 0x3b22,
-	0x3b0d, 0x3b0d, 0x3b0d, 0x3b0d, 0x3b0d, 0x012e, 0x0804, 0x3365,
-	0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c, 0x3cde,
-	0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a, 0x080c,
-	0x3cde, 0x0078, 0x080c, 0x6fa7, 0x1128, 0x012e, 0x2009, 0x0016,
-	0x0804, 0x3362, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804,
-	0x3332, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x080c, 0x383f, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8,
-	0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x3fa7, 0x080c,
-	0x3ef7, 0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071,
-	0x1a36, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
-	0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001,
-	0x080c, 0x3e58, 0x080c, 0x2a5d, 0x080c, 0x2a5d, 0x080c, 0x2a5d,
-	0x080c, 0x2a5d, 0x080c, 0x3e58, 0x008e, 0x00ee, 0x00fe, 0x080c,
-	0x3d85, 0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c, 0x3c94, 0x2001,
-	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017,
-	0x080c, 0x3362, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140,
-	0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178,
-	0x2001, 0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3d63, 0x2d00,
-	0x9c05, 0x9b05, 0x0120, 0x080c, 0x3c94, 0x0804, 0x3c41, 0x080c,
-	0x3ecc, 0x080c, 0x3df0, 0x080c, 0x3d46, 0x080c, 0x3d7b, 0x00f6,
-	0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3c94,
-	0x00fe, 0x0804, 0x3c41, 0x00fe, 0x080c, 0x3c8a, 0x1150, 0x8d68,
-	0x2001, 0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3c94,
-	0x0080, 0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908,
-	0x8739, 0x0038, 0x2001, 0x1a33, 0x2004, 0x9086, 0x0000, 0x1904,
-	0x3b91, 0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529,
-	0x2500, 0x9605, 0x0904, 0x3c41, 0x7884, 0xd0bc, 0x0128, 0x2d00,
-	0x9c05, 0x9b05, 0x1904, 0x3c41, 0xa013, 0x0019, 0x2001, 0x032a,
-	0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a33, 0x2003,
-	0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001,
-	0x78b4, 0x9005, 0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040,
-	0x080c, 0x2268, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4,
-	0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090,
-	0x602b, 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3c18, 0x00ce,
-	0x0030, 0xa817, 0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6,
-	0x00c6, 0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001,
-	0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b,
-	0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804,
-	0x3b4b, 0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061,
-	0x0100, 0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020,
-	0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x129f,
-	0x7884, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2009, 0x0028,
-	0x080c, 0x2268, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084,
-	0xb7ef, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090,
-	0x6043, 0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05,
-	0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
-	0x008e, 0x1118, 0x012e, 0x0804, 0x3330, 0x012e, 0x2021, 0x400c,
-	0x0804, 0x3332, 0x9085, 0x0001, 0x1d04, 0x3c93, 0x2091, 0x6000,
-	0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a33, 0x2003, 0x0000,
-	0x0071, 0x2009, 0x0048, 0x080c, 0x2268, 0x2001, 0x0227, 0x2024,
-	0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6,
-	0x00e6, 0x2071, 0x1a36, 0x7000, 0x9086, 0x0000, 0x0520, 0x2079,
-	0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
-	0x1120, 0x2009, 0x0040, 0x080c, 0x2268, 0x782c, 0xd0fc, 0x0d88,
-	0x080c, 0x3ecc, 0x7000, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004,
-	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2268, 0x782b,
-	0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079,
-	0x0100, 0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x26ac,
-	0x7850, 0x9084, 0xfbff, 0x9085, 0x0030, 0x7852, 0x2019, 0x01f4,
-	0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000, 0x7852, 0x20a9,
-	0x0046, 0x1d04, 0x3cf9, 0x2091, 0x6000, 0x1f04, 0x3cf9, 0x7850,
-	0x9085, 0x0400, 0x9084, 0xdfff, 0x7852, 0x2001, 0x0021, 0x2004,
-	0x9084, 0x0003, 0x9086, 0x0001, 0x1120, 0x7850, 0x9084, 0xdfff,
-	0x7852, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9,
-	0x0028, 0xa001, 0x1f04, 0x3d19, 0x7850, 0x9085, 0x1400, 0x7852,
-	0x2019, 0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c, 0x1110, 0x8319,
-	0x1dc8, 0x7827, 0x0048, 0x7850, 0x9085, 0x0400, 0x7852, 0x7843,
-	0x0040, 0x2019, 0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001,
-	0x0100, 0x080c, 0x2b14, 0x7827, 0x0020, 0x7843, 0x0000, 0x9006,
-	0x080c, 0x2b14, 0x7827, 0x0048, 0x00fe, 0x0005, 0x7884, 0xd0ac,
-	0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a33, 0x2079, 0x0320, 0x2001,
-	0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140,
-	0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019,
-	0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe,
-	0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033,
-	0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4,
-	0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084,
-	0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100,
-	0x2001, 0x197b, 0x2004, 0x70e2, 0x080c, 0x3a75, 0x1188, 0x2001,
-	0x181f, 0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e,
-	0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080,
-	0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c, 0x716e,
-	0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809,
-	0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000,
-	0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6,
-	0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085,
-	0x0092, 0x7016, 0x080c, 0x3ecc, 0x00f6, 0x2071, 0x1a33, 0x2079,
-	0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c,
-	0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0,
-	0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c,
-	0x3e58, 0x2011, 0x0001, 0x080c, 0x3e58, 0x00fe, 0x00ee, 0x0005,
-	0x00f6, 0x00e6, 0x2071, 0x1a33, 0x2079, 0x0320, 0x792c, 0xd1fc,
-	0x0904, 0x3e55, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e51,
-	0x7000, 0x0002, 0x3e55, 0x3e06, 0x3e36, 0x3e51, 0xd1bc, 0x1170,
-	0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e58,
-	0x0904, 0x3e55, 0x080c, 0x3e58, 0x0804, 0x3e55, 0x00f6, 0x2079,
-	0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004,
-	0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c,
-	0x3d63, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe,
-	0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002,
-	0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3dfa, 0x2011,
-	0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015,
-	0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960,
-	0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
-	0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058,
-	0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a,
-	0x0007, 0x1a0c, 0x0db4, 0x9398, 0x3e86, 0x231d, 0x083f, 0x9080,
-	0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a,
-	0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001,
-	0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3ec3, 0x3eba,
-	0x3eb1, 0x3ea8, 0x3e9f, 0x3e96, 0x3e8d, 0xa964, 0x7902, 0xa968,
-	0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902,
-	0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984,
-	0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005,
-	0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916,
-	0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0,
-	0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912,
-	0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc,
-	0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071,
-	0x1a36, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002,
-	0x2940, 0x9026, 0x7000, 0x0002, 0x3ef3, 0x3edf, 0x3eea, 0x8001,
-	0x7002, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e58, 0x190c,
-	0x3e58, 0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d38, 0x2011,
-	0x0001, 0x080c, 0x3e58, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004,
-	0x601a, 0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104,
-	0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038,
-	0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x4872,
-	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
-	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
-	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3f6f, 0x1d68,
-	0x2900, 0xa85a, 0x00d0, 0x080c, 0x4872, 0xa813, 0x0019, 0xa817,
-	0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001,
-	0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079,
+	0x080c, 0x48c2, 0x701f, 0x399a, 0x00b0, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0,
+	0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f68, 0x000e, 0x080c,
+	0x48c5, 0x701f, 0x399a, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x7014, 0x2048,
+	0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x3a5b, 0x0450, 0x7014,
+	0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c, 0x61de,
+	0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c,
+	0xbfdb, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x0904, 0x3369, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x701f,
+	0x3a2d, 0x7007, 0x0003, 0x0804, 0x39eb, 0xa830, 0x9086, 0x0100,
+	0x2021, 0x400c, 0x0904, 0x3339, 0x0076, 0xad10, 0xac0c, 0xab24,
+	0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
+	0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006,
+	0x080c, 0x0f68, 0x000e, 0x080c, 0x48c5, 0x007e, 0x701f, 0x399a,
+	0x7023, 0x0001, 0x0005, 0x0804, 0x3337, 0x0156, 0x00c6, 0xa814,
+	0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010, 0xa832, 0x0078,
+	0x81ff, 0x0168, 0x0016, 0x080c, 0x4879, 0x001e, 0x0130, 0xa800,
+	0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x015e, 0x0005, 0x0006, 0x00f6, 0x2079, 0x0000,
+	0x7880, 0x9086, 0x0044, 0x00fe, 0x000e, 0x0005, 0x2001, 0x1970,
+	0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200,
+	0x2001, 0x197b, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x197a,
+	0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x080c, 0x4879, 0xa813,
+	0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004,
+	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2061, 0x0090, 0x2079,
 	0x0100, 0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c,
-	0x2268, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006,
-	0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006,
-	0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
-	0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099,
-	0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e,
-	0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c,
-	0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400,
-	0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c,
-	0x4872, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a,
-	0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
-	0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030,
-	0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4872, 0x2940, 0xa813,
+	0x2268, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a,
+	0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006, 0x600a, 0x600e,
+	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c, 0x4879, 0x2940,
+	0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030,
+	0x2004, 0xa866, 0x2001, 0x0031, 0x2004, 0xa86a, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873, 0x0000, 0x2001, 0x032a,
+	0x2003, 0x0004, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001, 0x020d,
+	0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002, 0x2102,
+	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0148, 0x080c,
+	0x2a55, 0x1130, 0x9006, 0x080c, 0x29ad, 0x9006, 0x080c, 0x2990,
+	0x7884, 0x9084, 0x0007, 0x0002, 0x3b17, 0x3b20, 0x3b29, 0x3b14,
+	0x3b14, 0x3b14, 0x3b14, 0x3b14, 0x012e, 0x0804, 0x336c, 0x2009,
+	0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c, 0x3ce5, 0x00c0,
+	0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a, 0x080c, 0x3ce5,
+	0x0078, 0x080c, 0x6fb2, 0x1128, 0x012e, 0x2009, 0x0016, 0x0804,
+	0x3369, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3339,
+	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x080c, 0x3846, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc,
+	0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x3fae, 0x080c, 0x3efe,
+	0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a36,
+	0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
+	0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
+	0x3e5f, 0x080c, 0x2a5d, 0x080c, 0x2a5d, 0x080c, 0x2a5d, 0x080c,
+	0x2a5d, 0x080c, 0x3e5f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d8c,
+	0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c, 0x3c9b, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c,
+	0x3369, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10,
+	0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001,
+	0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3d6a, 0x2d00, 0x9c05,
+	0x9b05, 0x0120, 0x080c, 0x3c9b, 0x0804, 0x3c48, 0x080c, 0x3ed3,
+	0x080c, 0x3df7, 0x080c, 0x3d4d, 0x080c, 0x3d82, 0x00f6, 0x2079,
+	0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3c9b, 0x00fe,
+	0x0804, 0x3c48, 0x00fe, 0x080c, 0x3c91, 0x1150, 0x8d68, 0x2001,
+	0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3c9b, 0x0080,
+	0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739,
+	0x0038, 0x2001, 0x1a33, 0x2004, 0x9086, 0x0000, 0x1904, 0x3b98,
+	0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500,
+	0x9605, 0x0904, 0x3c48, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05,
+	0x9b05, 0x1904, 0x3c48, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003,
+	0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a33, 0x2003, 0x0003,
+	0x2001, 0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4,
+	0x9005, 0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c,
+	0x2268, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180,
+	0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b,
+	0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3c1f, 0x00ce, 0x0030,
+	0xa817, 0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6,
+	0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004,
+	0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3b52,
+	0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
+	0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001,
+	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x129f, 0x7884,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2009, 0x0028, 0x080c,
+	0x2268, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ef,
+	0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05, 0x9d05,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
+	0x1118, 0x012e, 0x0804, 0x3337, 0x012e, 0x2021, 0x400c, 0x0804,
+	0x3339, 0x9085, 0x0001, 0x1d04, 0x3c9a, 0x2091, 0x6000, 0x8420,
+	0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x2001, 0x1a33, 0x2003, 0x0000, 0x0071,
+	0x2009, 0x0048, 0x080c, 0x2268, 0x2001, 0x0227, 0x2024, 0x2402,
+	0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6,
+	0x2071, 0x1a36, 0x7000, 0x9086, 0x0000, 0x0520, 0x2079, 0x0090,
+	0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120,
+	0x2009, 0x0040, 0x080c, 0x2268, 0x782c, 0xd0fc, 0x0d88, 0x080c,
+	0x3ed3, 0x7000, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004, 0x782c,
+	0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2268, 0x782b, 0x0002,
+	0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x26ac, 0x7850,
+	0x9084, 0xfbff, 0x9085, 0x0030, 0x7852, 0x2019, 0x01f4, 0x8319,
+	0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000, 0x7852, 0x20a9, 0x0046,
+	0x1d04, 0x3d00, 0x2091, 0x6000, 0x1f04, 0x3d00, 0x7850, 0x9085,
+	0x0400, 0x9084, 0xdfff, 0x7852, 0x2001, 0x0021, 0x2004, 0x9084,
+	0x0003, 0x9086, 0x0001, 0x1120, 0x7850, 0x9084, 0xdfff, 0x7852,
+	0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x0028,
+	0xa001, 0x1f04, 0x3d20, 0x7850, 0x9085, 0x1400, 0x7852, 0x2019,
+	0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c, 0x1110, 0x8319, 0x1dc8,
+	0x7827, 0x0048, 0x7850, 0x9085, 0x0400, 0x7852, 0x7843, 0x0040,
+	0x2019, 0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100,
+	0x080c, 0x2b14, 0x7827, 0x0020, 0x7843, 0x0000, 0x9006, 0x080c,
+	0x2b14, 0x7827, 0x0048, 0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8,
+	0x00f6, 0x00e6, 0x2071, 0x1a33, 0x2079, 0x0320, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140, 0x0051,
+	0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019, 0x00ee,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
+	0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033, 0x250a,
+	0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4, 0x0108,
+	0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084, 0x0110,
+	0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100, 0x2001,
+	0x197b, 0x2004, 0x70e2, 0x080c, 0x3a7c, 0x1188, 0x2001, 0x181f,
+	0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e, 0x716a,
+	0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080, 0x702c,
+	0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c, 0x716e, 0x7063,
+	0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809, 0x7077,
+	0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000, 0x7082,
+	0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6, 0x70ab,
+	0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085, 0x0092,
+	0x7016, 0x080c, 0x3ed3, 0x00f6, 0x2071, 0x1a33, 0x2079, 0x0320,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c, 0x780e,
+	0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0, 0x792c,
+	0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c, 0x3e5f,
+	0x2011, 0x0001, 0x080c, 0x3e5f, 0x00fe, 0x00ee, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0x1a33, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904,
+	0x3e5c, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e58, 0x7000,
+	0x0002, 0x3e5c, 0x3e0d, 0x3e3d, 0x3e58, 0xd1bc, 0x1170, 0xd1dc,
+	0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e5f, 0x0904,
+	0x3e5c, 0x080c, 0x3e5f, 0x0804, 0x3e5c, 0x00f6, 0x2079, 0x0300,
+	0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812,
+	0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3d6a,
+	0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec,
+	0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002, 0x9184,
+	0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3e01, 0x2011, 0x0001,
+	0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015, 0x1120,
+	0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960, 0x0828,
+	0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0xa014,
+	0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058, 0x2048,
+	0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a, 0x0007,
+	0x1a0c, 0x0db4, 0x9398, 0x3e8d, 0x231d, 0x083f, 0x9080, 0x0004,
+	0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a, 0x0035,
+	0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001, 0x0019,
+	0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3eca, 0x3ec1, 0x3eb8,
+	0x3eaf, 0x3ea6, 0x3e9d, 0x3e94, 0xa964, 0x7902, 0xa968, 0x7906,
+	0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902, 0xa978,
+	0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984, 0x7902,
+	0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005, 0xa994,
+	0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916, 0x0005,
+	0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0, 0x7916,
+	0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912, 0xa9c0,
+	0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc, 0x7912,
+	0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071, 0x1a36,
+	0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940,
+	0x9026, 0x7000, 0x0002, 0x3efa, 0x3ee6, 0x3ef1, 0x8001, 0x7002,
+	0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e5f, 0x190c, 0x3e5f,
+	0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001,
+	0x080c, 0x3e5f, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004, 0x601a,
+	0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104, 0xc1ac,
+	0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038, 0x2001,
+	0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x4879, 0xa813,
 	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
 	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
-	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3f6f, 0x1d68, 0x2900,
-	0xa85a, 0x00d8, 0x080c, 0x4872, 0x2940, 0xa013, 0x0019, 0xa017,
-	0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001,
-	0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003,
-	0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d,
-	0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a33, 0x2003, 0x0003,
-	0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000,
-	0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d,
-	0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9,
-	0x0013, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x2009,
-	0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005,
-	0x0804, 0x3330, 0x7d98, 0x7c9c, 0x0804, 0x3427, 0x080c, 0x6fa7,
-	0x190c, 0x5c8f, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48bb, 0x701f,
-	0x4042, 0x0005, 0x080c, 0x538e, 0x1130, 0x3b00, 0x3a08, 0xc194,
-	0xc095, 0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904,
-	0x3365, 0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138,
-	0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d,
-	0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104,
-	0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce,
-	0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x3365, 0x9288,
-	0x3131, 0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828,
-	0x908a, 0x007f, 0x1a04, 0x3365, 0x605a, 0x6888, 0x9084, 0x0030,
-	0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1982, 0x9080,
-	0x279f, 0x2005, 0x200a, 0x000e, 0x2009, 0x1983, 0x9080, 0x27a3,
-	0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x3365, 0x908a,
-	0x0841, 0x1a04, 0x3365, 0x9084, 0x0007, 0x1904, 0x3365, 0x680c,
-	0x9005, 0x0904, 0x3365, 0x6810, 0x9005, 0x0904, 0x3365, 0x6848,
-	0x6940, 0x910a, 0x1a04, 0x3365, 0x8001, 0x0904, 0x3365, 0x684c,
-	0x6944, 0x910a, 0x1a04, 0x3365, 0x8001, 0x0904, 0x3365, 0x2009,
-	0x1952, 0x200b, 0x0000, 0x2001, 0x1875, 0x2004, 0xd0c4, 0x0140,
-	0x7884, 0x200a, 0x2009, 0x017f, 0x200a, 0x3b00, 0xc085, 0x20d8,
-	0x6814, 0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e,
-	0x080c, 0x72bc, 0x080c, 0x6628, 0x080c, 0x665d, 0x6808, 0x602a,
-	0x080c, 0x21da, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001,
-	0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x2706, 0x003e, 0x6000,
-	0x9086, 0x0000, 0x1904, 0x41bf, 0x6818, 0x691c, 0x6a20, 0x6b24,
-	0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322,
-	0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007,
-	0x810f, 0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a,
-	0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004,
-	0x20a1, 0x1984, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1,
-	0x199e, 0x20e9, 0x0001, 0x4001, 0x080c, 0x8119, 0x00c6, 0x900e,
-	0x20a9, 0x0001, 0x6b70, 0xd384, 0x0510, 0x0068, 0x2009, 0x0100,
-	0x210c, 0x918e, 0x0008, 0x1110, 0x839d, 0x0010, 0x83f5, 0x3e18,
-	0x12b0, 0x3508, 0x8109, 0x080c, 0x7887, 0x6878, 0x6016, 0x6874,
-	0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006,
-	0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04,
-	0x412e, 0x00ce, 0x00c6, 0x2061, 0x196d, 0x2063, 0x0001, 0x9006,
-	0x080c, 0x29ad, 0x9006, 0x080c, 0x2990, 0x0000, 0x00ce, 0x00e6,
-	0x2c70, 0x080c, 0x0e80, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011,
-	0x0114, 0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284, 0x0030,
-	0x9086, 0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82,
-	0x2001, 0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170,
-	0x928e, 0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa,
-	0x080c, 0x277b, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6,
-	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
-	0x6fa7, 0x0128, 0x080c, 0x4c8b, 0x0110, 0x080c, 0x26cc, 0x60d0,
-	0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x41a7, 0x00d0, 0x080c,
-	0x6fa7, 0x1168, 0x2011, 0x6e28, 0x080c, 0x8010, 0x2011, 0x6e1b,
-	0x080c, 0x80e4, 0x080c, 0x7290, 0x080c, 0x6ed9, 0x0040, 0x080c,
-	0x5b89, 0x0028, 0x6003, 0x0004, 0x2009, 0x41bf, 0x0010, 0x0804,
-	0x3330, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c,
-	0x1118, 0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, 0x0817, 0x6000,
-	0x9086, 0x0000, 0x0904, 0x3362, 0x2069, 0x1853, 0x7890, 0x6842,
-	0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x2039, 0x0001, 0x0804, 0x48be, 0x9006, 0x080c, 0x26cc,
-	0x81ff, 0x1904, 0x3362, 0x080c, 0x6fa7, 0x11b0, 0x080c, 0x728b,
-	0x080c, 0x5cca, 0x080c, 0x312c, 0x0118, 0x6130, 0xc18d, 0x6132,
-	0x080c, 0xc1f9, 0x0130, 0x080c, 0x6fca, 0x1118, 0x080c, 0x6f7f,
-	0x0038, 0x080c, 0x6ed9, 0x0020, 0x080c, 0x5c8f, 0x080c, 0x5b89,
-	0x0804, 0x3330, 0x81ff, 0x1904, 0x3362, 0x080c, 0x6fa7, 0x1110,
-	0x0804, 0x3362, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001,
-	0x1c80, 0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126,
-	0x2091, 0x8000, 0x2039, 0x0001, 0x080c, 0x48be, 0x701f, 0x332e,
-	0x012e, 0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9,
-	0x0040, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304,
-	0x6558, 0x9588, 0x3131, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e,
-	0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x6237, 0x1190,
-	0xb814, 0x821c, 0x0238, 0x9398, 0x1c80, 0x9085, 0xff00, 0x8007,
-	0x201a, 0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4, 0xff00, 0x9405,
-	0x201a, 0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201,
-	0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1,
-	0x1c80, 0x2099, 0x1c80, 0x080c, 0x5c1a, 0x0804, 0x4217, 0x080c,
-	0x48a5, 0x0904, 0x3365, 0x080c, 0x4872, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x3362, 0x080c, 0x537f, 0xd0b4, 0x0558, 0x7884, 0x908e,
-	0x007e, 0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508,
-	0x080c, 0x3127, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x080c, 0xbcc7, 0x1120, 0x2009, 0x0003, 0x0804, 0x3362,
-	0x7007, 0x0003, 0x701f, 0x42a5, 0x0005, 0x080c, 0x48a5, 0x0904,
-	0x3365, 0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008,
-	0x9080, 0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006,
-	0x2098, 0x080c, 0x0f68, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080,
-	0x000a, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0f68, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x0804, 0x48be, 0x81ff, 0x1904, 0x3362, 0x080c, 0x4889,
-	0x0904, 0x3365, 0x080c, 0x63a9, 0x0904, 0x3362, 0x0058, 0xa878,
-	0x9005, 0x0120, 0x2009, 0x0004, 0x0804, 0x3362, 0xa974, 0xaa94,
-	0x0804, 0x3330, 0x080c, 0x5387, 0x0904, 0x3330, 0x701f, 0x42ef,
-	0x7007, 0x0003, 0x0005, 0x81ff, 0x1904, 0x3362, 0x7888, 0x908a,
-	0x1000, 0x1a04, 0x3365, 0x080c, 0x48a5, 0x0904, 0x3365, 0x080c,
-	0x655b, 0x0120, 0x080c, 0x6563, 0x1904, 0x3365, 0x080c, 0x642e,
-	0x0904, 0x3362, 0x2019, 0x0004, 0x900e, 0x080c, 0x63bb, 0x0904,
-	0x3362, 0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000,
-	0x12f8, 0x080c, 0x48a3, 0x01e0, 0x080c, 0x655b, 0x0118, 0x080c,
-	0x6563, 0x11b0, 0x080c, 0x642e, 0x2009, 0x0002, 0x0168, 0x2009,
-	0x0002, 0x2019, 0x0004, 0x080c, 0x63bb, 0x2009, 0x0003, 0x0120,
-	0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010,
-	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
-	0xa897, 0x4000, 0x080c, 0x5387, 0x0110, 0x9006, 0x0018, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110,
-	0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400,
-	0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c,
-	0x6237, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
-	0x801e, 0x0005, 0x81ff, 0x1904, 0x3362, 0x798c, 0x2001, 0x1951,
-	0x918c, 0x8000, 0x2102, 0x080c, 0x4889, 0x0904, 0x3365, 0x080c,
-	0x655b, 0x0120, 0x080c, 0x6563, 0x1904, 0x3365, 0x080c, 0x62fe,
-	0x0904, 0x3362, 0x080c, 0x63b2, 0x0904, 0x3362, 0x2001, 0x1951,
-	0x2004, 0xd0fc, 0x1904, 0x3330, 0x0804, 0x42fa, 0xa9a0, 0x2001,
-	0x1951, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4896, 0x01a0,
-	0x080c, 0x655b, 0x0118, 0x080c, 0x6563, 0x1170, 0x080c, 0x62fe,
-	0x2009, 0x0002, 0x0128, 0x080c, 0x63b2, 0x1170, 0x2009, 0x0003,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1951,
-	0x2004, 0xd0fc, 0x1128, 0x080c, 0x5387, 0x0110, 0x9006, 0x0018,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904,
-	0x3362, 0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c,
-	0x4889, 0x0904, 0x3365, 0x080c, 0x655b, 0x0120, 0x080c, 0x6563,
-	0x1904, 0x3365, 0x080c, 0x62fe, 0x0904, 0x3362, 0x080c, 0x63a0,
-	0x0904, 0x3362, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x3330,
-	0x0804, 0x42fa, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d,
-	0x2102, 0x080c, 0x4896, 0x01a0, 0x080c, 0x655b, 0x0118, 0x080c,
-	0x6563, 0x1170, 0x080c, 0x62fe, 0x2009, 0x0002, 0x0128, 0x080c,
-	0x63a0, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010,
-	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
-	0xa897, 0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c,
-	0x5387, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0000, 0x0005, 0x6100, 0x0804, 0x3330, 0x080c, 0x48a5, 0x0904,
-	0x3365, 0x080c, 0x5393, 0x1904, 0x3362, 0x79a8, 0xd184, 0x1158,
-	0xb834, 0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f,
-	0xba28, 0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007,
-	0x789a, 0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200,
-	0x0804, 0x3330, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1148, 0x939a,
-	0x0003, 0x1a04, 0x3362, 0x6258, 0x7884, 0x9206, 0x1904, 0x44aa,
-	0x2031, 0x1848, 0x2009, 0x013c, 0x2136, 0x2001, 0x1840, 0x2009,
-	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006,
-	0x78a8, 0x9084, 0x0080, 0x11c8, 0x0006, 0x0036, 0x2001, 0x1a4f,
-	0x201c, 0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a50, 0x201c, 0x7b9e,
-	0x2003, 0x0000, 0x2001, 0x1a51, 0x201c, 0x7ba2, 0x2003, 0x0000,
-	0x003e, 0x000e, 0x000e, 0x0804, 0x48be, 0x000e, 0x2031, 0x0000,
-	0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
-	0xa392, 0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f,
-	0x44ca, 0x0005, 0x81ff, 0x1904, 0x3362, 0x080c, 0x48a5, 0x0904,
-	0x3365, 0x080c, 0x655b, 0x1904, 0x3362, 0x00c6, 0x080c, 0x4872,
-	0x00ce, 0x0904, 0x3362, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x7ea8, 0x080c, 0xbc6d, 0x0904, 0x3362, 0x7007, 0x0003, 0x701f,
-	0x44e4, 0x0005, 0x080c, 0x4014, 0x0006, 0x0036, 0x2001, 0x1a4f,
-	0x201c, 0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a50, 0x201c, 0x7b9e,
-	0x2003, 0x0000, 0x2001, 0x1a51, 0x201c, 0x7ba2, 0x2003, 0x0000,
-	0x003e, 0x000e, 0x0804, 0x3330, 0xa830, 0x9086, 0x0100, 0x0904,
-	0x3362, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x0804, 0x48be, 0x9006, 0x080c, 0x26cc, 0x78a8, 0x9084, 0x00ff,
-	0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x3362, 0x080c, 0x6fa7,
-	0x0110, 0x080c, 0x5c8f, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3365,
-	0x7984, 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x3365,
-	0x2100, 0x080c, 0x2696, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x2061, 0x19cb, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000,
-	0x6077, 0x0000, 0x080c, 0x6fa7, 0x1158, 0x080c, 0x728b, 0x080c,
-	0x5cca, 0x9085, 0x0001, 0x080c, 0x6fee, 0x080c, 0x6ed9, 0x00d0,
-	0x080c, 0x9d9f, 0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084,
-	0x00ff, 0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x2009, 0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bb5,
-	0x080c, 0x80a2, 0x7984, 0x080c, 0x6fa7, 0x1110, 0x2009, 0x00ff,
-	0x7a88, 0x080c, 0x435d, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3330,
-	0x7984, 0x080c, 0x61d7, 0x2b08, 0x1904, 0x3365, 0x0804, 0x3330,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3362, 0x60d8, 0xd0ac,
-	0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3362, 0x080c,
-	0x4872, 0x1120, 0x2009, 0x0002, 0x0804, 0x3362, 0x7984, 0x9192,
-	0x0021, 0x1a04, 0x3365, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c,
-	0x9080, 0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x48bb, 0x701f,
-	0x4598, 0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x4e3d, 0x0005,
-	0x2009, 0x0080, 0x080c, 0x6237, 0x1118, 0x080c, 0x655b, 0x0120,
-	0x2021, 0x400a, 0x0804, 0x3332, 0x00d6, 0x0096, 0xa964, 0xaa6c,
-	0xab70, 0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904,
-	0x4631, 0x90be, 0x0112, 0x0904, 0x4631, 0x90be, 0x0113, 0x0904,
-	0x4631, 0x90be, 0x0114, 0x0904, 0x4631, 0x90be, 0x0117, 0x0904,
-	0x4631, 0x90be, 0x011a, 0x0904, 0x4631, 0x90be, 0x011c, 0x0904,
-	0x4631, 0x90be, 0x0121, 0x0904, 0x4618, 0x90be, 0x0131, 0x0904,
-	0x4618, 0x90be, 0x0171, 0x0904, 0x4631, 0x90be, 0x0173, 0x0904,
-	0x4631, 0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804,
-	0x463c, 0x90be, 0x0212, 0x0904, 0x4625, 0x90be, 0x0213, 0x05e8,
-	0x90be, 0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a,
-	0x1120, 0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8,
-	0x90be, 0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x3365, 0x7028,
-	0x9080, 0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0007, 0x080c, 0x467a, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0,
-	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x467a, 0x00c8,
-	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
-	0x20a9, 0x0001, 0x080c, 0x4687, 0x00b8, 0x7028, 0x9080, 0x000e,
-	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c,
-	0x4687, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0,
-	0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4872, 0x0550,
-	0xa868, 0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f,
-	0x0020, 0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba,
-	0xacbe, 0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866,
-	0xa822, 0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xbc88,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x3362, 0x7007, 0x0003, 0x701f,
-	0x4671, 0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804,
-	0x3362, 0xa820, 0x9086, 0x8001, 0x1904, 0x3330, 0x2009, 0x0004,
-	0x0804, 0x3362, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002,
-	0x4104, 0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016,
-	0x0026, 0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304,
-	0x4204, 0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3362,
-	0x60d8, 0xd0ac, 0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804,
-	0x3362, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3362, 0x7984,
-	0x78a8, 0x2040, 0x080c, 0x9d98, 0x1120, 0x9182, 0x007f, 0x0a04,
-	0x3365, 0x9186, 0x00ff, 0x0904, 0x3365, 0x9182, 0x0800, 0x1a04,
-	0x3365, 0x7a8c, 0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e,
-	0x0904, 0x3365, 0x99cc, 0xff00, 0x0904, 0x3365, 0x0126, 0x2091,
-	0x8000, 0x0026, 0x2011, 0x8008, 0x080c, 0x657f, 0x002e, 0x0140,
-	0x918d, 0x8000, 0x080c, 0x65c9, 0x1118, 0x2001, 0x4009, 0x0458,
-	0x080c, 0x478c, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006,
-	0x900e, 0x080c, 0x6457, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408,
-	0x0090, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6,
-	0x4009, 0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001,
-	0x4005, 0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3332, 0x2b00,
-	0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9e66,
-	0x0904, 0x4759, 0x2b00, 0x6012, 0x080c, 0xbf73, 0x2e58, 0x00ee,
-	0x00e6, 0x00c6, 0x080c, 0x4872, 0x00ce, 0x2b70, 0x1158, 0x080c,
-	0x9e19, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002,
-	0x0804, 0x3362, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932,
-	0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x2fd7,
-	0x6023, 0x0001, 0x9006, 0x080c, 0x6174, 0x2001, 0x0002, 0x080c,
-	0x6188, 0x2009, 0x0002, 0x080c, 0x9e93, 0x78a8, 0xd094, 0x0138,
-	0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8bc, 0xc08d, 0xb8be, 0x9085,
-	0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x3362, 0x7007, 0x0003, 0x701f, 0x4768, 0x0005,
-	0xa830, 0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804,
-	0x3332, 0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004,
-	0xba04, 0x9294, 0x00ff, 0x0804, 0x52dc, 0x900e, 0xa868, 0xd0f4,
-	0x1904, 0x3330, 0x080c, 0x6457, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x0804, 0x3330, 0x00e6, 0x00d6, 0x0096, 0x83ff,
-	0x0904, 0x47d4, 0x902e, 0x080c, 0x9d98, 0x0130, 0x9026, 0x20a9,
-	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781,
-	0x2071, 0x107f, 0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8,
-	0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030,
-	0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff,
-	0x11d8, 0xc5fd, 0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8,
-	0xbe14, 0x2600, 0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884,
-	0x0568, 0xd894, 0x1558, 0x080c, 0x655b, 0x1540, 0x2001, 0x4000,
-	0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400,
-	0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c,
-	0x9d98, 0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04,
-	0x47a2, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001,
-	0x0030, 0x080c, 0x61d7, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005,
-	0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x3362, 0x080c, 0x4872, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x3362, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005,
-	0x0904, 0x3365, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04,
-	0x3365, 0x2010, 0x2918, 0x080c, 0x2f7d, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x3362, 0x7007, 0x0003, 0x701f, 0x4827, 0x0005, 0xa830,
-	0x9086, 0x0100, 0x1904, 0x3330, 0x2009, 0x0004, 0x0804, 0x3362,
-	0x7984, 0x080c, 0x9d98, 0x1120, 0x9182, 0x007f, 0x0a04, 0x3365,
-	0x9186, 0x00ff, 0x0904, 0x3365, 0x9182, 0x0800, 0x1a04, 0x3365,
-	0x2001, 0x9000, 0x080c, 0x5337, 0x1904, 0x3362, 0x0804, 0x3330,
-	0xa998, 0x080c, 0x9d98, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186,
-	0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c,
-	0x5337, 0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3f76, 0x1d68, 0x2900,
+	0xa85a, 0x00d0, 0x080c, 0x4879, 0xa813, 0x0019, 0xa817, 0x0001,
+	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
+	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
+	0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079, 0x0100,
+	0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x2268,
+	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001,
+	0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006, 0x600a,
+	0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x2071,
+	0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088,
+	0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e, 0x810b,
+	0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c, 0xd0fc,
+	0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400, 0x7304,
+	0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c, 0x4879,
+	0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a, 0x00ae,
+	0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x2001,
+	0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030, 0x2024,
+	0x2001, 0x0031, 0x201c, 0x080c, 0x4879, 0x2940, 0xa813, 0x0019,
+	0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009,
+	0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c,
+	0x9080, 0x0019, 0x009e, 0x080c, 0x3f76, 0x1d68, 0x2900, 0xa85a,
+	0x00d8, 0x080c, 0x4879, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
+	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001, 0x0031,
+	0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa06e,
+	0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d, 0x0200,
+	0x2102, 0xa017, 0x0000, 0x2001, 0x1a33, 0x2003, 0x0003, 0x2001,
+	0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001,
+	0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002,
+	0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0013,
+	0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x2009, 0x013c,
+	0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005, 0x0804,
+	0x3337, 0x7d98, 0x7c9c, 0x0804, 0x342e, 0x080c, 0x6fb2, 0x190c,
+	0x5c96, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48c2, 0x701f, 0x4049,
+	0x0005, 0x080c, 0x5395, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095,
+	0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904, 0x336c,
+	0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138, 0x6200,
+	0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d, 0x0020,
+	0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0118,
+	0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce, 0xd084,
+	0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x336c, 0x9288, 0x3138,
+	0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828, 0x908a,
+	0x007f, 0x1a04, 0x336c, 0x605a, 0x6888, 0x9084, 0x0030, 0x8004,
+	0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1982, 0x9080, 0x279f,
+	0x2005, 0x200a, 0x000e, 0x2009, 0x1983, 0x9080, 0x27a3, 0x2005,
+	0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x336c, 0x908a, 0x0841,
+	0x1a04, 0x336c, 0x9084, 0x0007, 0x1904, 0x336c, 0x680c, 0x9005,
+	0x0904, 0x336c, 0x6810, 0x9005, 0x0904, 0x336c, 0x6848, 0x6940,
+	0x910a, 0x1a04, 0x336c, 0x8001, 0x0904, 0x336c, 0x684c, 0x6944,
+	0x910a, 0x1a04, 0x336c, 0x8001, 0x0904, 0x336c, 0x2009, 0x1952,
+	0x200b, 0x0000, 0x2001, 0x1875, 0x2004, 0xd0c4, 0x0140, 0x7884,
+	0x200a, 0x2009, 0x017f, 0x200a, 0x3b00, 0xc085, 0x20d8, 0x6814,
+	0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e, 0x080c,
+	0x72c7, 0x080c, 0x662f, 0x080c, 0x6664, 0x6808, 0x602a, 0x080c,
+	0x21da, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001, 0x200b,
+	0x0000, 0x0036, 0x6b08, 0x080c, 0x2706, 0x003e, 0x6000, 0x9086,
+	0x0000, 0x1904, 0x41c6, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007,
+	0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04,
+	0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f,
+	0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+	0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1,
+	0x1984, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1, 0x199e,
+	0x20e9, 0x0001, 0x4001, 0x080c, 0x8141, 0x00c6, 0x900e, 0x20a9,
+	0x0001, 0x6b70, 0xd384, 0x0510, 0x0068, 0x2009, 0x0100, 0x210c,
+	0x918e, 0x0008, 0x1110, 0x839d, 0x0010, 0x83f5, 0x3e18, 0x12b0,
+	0x3508, 0x8109, 0x080c, 0x7892, 0x6878, 0x6016, 0x6874, 0x2008,
+	0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108,
+	0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x4135,
+	0x00ce, 0x00c6, 0x2061, 0x196d, 0x2063, 0x0001, 0x9006, 0x080c,
+	0x29ad, 0x9006, 0x080c, 0x2990, 0x0000, 0x00ce, 0x00e6, 0x2c70,
+	0x080c, 0x0e80, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114,
+	0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086,
+	0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001,
+	0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e,
+	0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c,
+	0x277b, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061,
+	0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x6fb2,
+	0x0128, 0x080c, 0x4c92, 0x0110, 0x080c, 0x26cc, 0x60d0, 0x9005,
+	0x01c0, 0x6003, 0x0001, 0x2009, 0x41ae, 0x00d0, 0x080c, 0x6fb2,
+	0x1168, 0x2011, 0x6e33, 0x080c, 0x8038, 0x2011, 0x6e26, 0x080c,
+	0x810c, 0x080c, 0x729b, 0x080c, 0x6ee4, 0x0040, 0x080c, 0x5b90,
+	0x0028, 0x6003, 0x0004, 0x2009, 0x41c6, 0x0010, 0x0804, 0x3337,
+	0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118,
+	0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, 0x0817, 0x6000, 0x9086,
+	0x0000, 0x0904, 0x3369, 0x2069, 0x1853, 0x7890, 0x6842, 0x7894,
+	0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x2039, 0x0001, 0x0804, 0x48c5, 0x9006, 0x080c, 0x26cc, 0x81ff,
+	0x1904, 0x3369, 0x080c, 0x6fb2, 0x11b0, 0x080c, 0x7296, 0x080c,
+	0x5cd1, 0x080c, 0x3133, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c,
+	0xc212, 0x0130, 0x080c, 0x6fd5, 0x1118, 0x080c, 0x6f8a, 0x0038,
+	0x080c, 0x6ee4, 0x0020, 0x080c, 0x5c96, 0x080c, 0x5b90, 0x0804,
+	0x3337, 0x81ff, 0x1904, 0x3369, 0x080c, 0x6fb2, 0x1110, 0x0804,
+	0x3369, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1c80,
+	0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091,
+	0x8000, 0x2039, 0x0001, 0x080c, 0x48c5, 0x701f, 0x3335, 0x012e,
+	0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9, 0x0040,
+	0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304, 0x6558,
+	0x9588, 0x3138, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011,
+	0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x623e, 0x1190, 0xb814,
+	0x821c, 0x0238, 0x9398, 0x1c80, 0x9085, 0xff00, 0x8007, 0x201a,
+	0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a,
+	0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
+	0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1c80,
+	0x2099, 0x1c80, 0x080c, 0x5c21, 0x0804, 0x421e, 0x080c, 0x48ac,
+	0x0904, 0x336c, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3369, 0x080c, 0x5386, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e,
+	0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c,
+	0x312e, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xbce0, 0x1120, 0x2009, 0x0003, 0x0804, 0x3369, 0x7007,
+	0x0003, 0x701f, 0x42ac, 0x0005, 0x080c, 0x48ac, 0x0904, 0x336c,
+	0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
+	0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f68, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a,
+	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c,
+	0x0f68, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x0804, 0x48c5, 0x81ff, 0x1904, 0x3369, 0x080c, 0x4890, 0x0904,
+	0x336c, 0x080c, 0x63b0, 0x0904, 0x3369, 0x0058, 0xa878, 0x9005,
+	0x0120, 0x2009, 0x0004, 0x0804, 0x3369, 0xa974, 0xaa94, 0x0804,
+	0x3337, 0x080c, 0x538e, 0x0904, 0x3337, 0x701f, 0x42f6, 0x7007,
+	0x0003, 0x0005, 0x81ff, 0x1904, 0x3369, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x336c, 0x080c, 0x48ac, 0x0904, 0x336c, 0x080c, 0x6562,
+	0x0120, 0x080c, 0x656a, 0x1904, 0x336c, 0x080c, 0x6435, 0x0904,
+	0x3369, 0x2019, 0x0004, 0x900e, 0x080c, 0x63c2, 0x0904, 0x3369,
+	0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8,
+	0x080c, 0x48aa, 0x01e0, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a,
+	0x11b0, 0x080c, 0x6435, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x63c2, 0x2009, 0x0003, 0x0120, 0xa998,
+	0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x080c, 0x538e, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071,
+	0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400, 0x9506,
+	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x623e,
+	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8046,
+	0x0005, 0x81ff, 0x1904, 0x3369, 0x798c, 0x2001, 0x1951, 0x918c,
+	0x8000, 0x2102, 0x080c, 0x4890, 0x0904, 0x336c, 0x080c, 0x6562,
+	0x0120, 0x080c, 0x656a, 0x1904, 0x336c, 0x080c, 0x6305, 0x0904,
+	0x3369, 0x080c, 0x63b9, 0x0904, 0x3369, 0x2001, 0x1951, 0x2004,
+	0xd0fc, 0x1904, 0x3337, 0x0804, 0x4301, 0xa9a0, 0x2001, 0x1951,
+	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489d, 0x01a0, 0x080c,
+	0x6562, 0x0118, 0x080c, 0x656a, 0x1170, 0x080c, 0x6305, 0x2009,
+	0x0002, 0x0128, 0x080c, 0x63b9, 0x1170, 0x2009, 0x0003, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1951, 0x2004,
+	0xd0fc, 0x1128, 0x080c, 0x538e, 0x0110, 0x9006, 0x0018, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x3369,
+	0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c, 0x4890,
+	0x0904, 0x336c, 0x080c, 0x6562, 0x0120, 0x080c, 0x656a, 0x1904,
+	0x336c, 0x080c, 0x6305, 0x0904, 0x3369, 0x080c, 0x63a7, 0x0904,
+	0x3369, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x3337, 0x0804,
+	0x4301, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d, 0x2102,
+	0x080c, 0x489d, 0x01a0, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a,
+	0x1170, 0x080c, 0x6305, 0x2009, 0x0002, 0x0128, 0x080c, 0x63a7,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
 	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009,
-	0x000a, 0x0c48, 0x080c, 0x0feb, 0x0198, 0x9006, 0xa802, 0x7014,
-	0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802,
-	0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001,
-	0x0005, 0x7984, 0x080c, 0x6237, 0x1130, 0x7e88, 0x9684, 0x3fff,
-	0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c,
-	0x6237, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208,
-	0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c,
-	0x6237, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114,
-	0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x101d, 0x0cc8, 0x7116,
-	0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000,
-	0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
-	0xa392, 0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f,
-	0x3330, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000,
-	0x2001, 0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x48ef, 0x7a36,
-	0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x0804, 0x4955, 0x0016,
-	0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005,
-	0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c,
-	0x0feb, 0x0904, 0x494d, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001,
-	0x0002, 0x9080, 0x1f26, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0,
-	0x0004, 0x2001, 0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0,
-	0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a,
-	0x0460, 0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105,
-	0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x2060, 0x001e, 0x8108,
-	0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x0feb, 0x1130, 0x8109,
-	0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a,
-	0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002,
-	0x9080, 0x1f26, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a,
-	0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005,
-	0x2c00, 0x9082, 0x001b, 0x0002, 0x4977, 0x4977, 0x4979, 0x4977,
-	0x4977, 0x4977, 0x497d, 0x4977, 0x4977, 0x4977, 0x4981, 0x4977,
-	0x4977, 0x4977, 0x4985, 0x4977, 0x4977, 0x4977, 0x4989, 0x4977,
-	0x4977, 0x4977, 0x498d, 0x4977, 0x4977, 0x4977, 0x4992, 0x080c,
-	0x0db4, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e,
-	0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae,
-	0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce,
-	0x0804, 0x4950, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4950, 0x00e6,
-	0x2071, 0x1894, 0x7048, 0x9005, 0x0904, 0x4a29, 0x0126, 0x2091,
-	0x8000, 0x0e04, 0x4a28, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096,
-	0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500,
-	0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x2060,
-	0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a2b, 0xa804,
-	0x9005, 0x090c, 0x0db4, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000,
-	0x2001, 0x0002, 0x9080, 0x1f26, 0x2005, 0xa04a, 0x0804, 0x4a2b,
-	0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836,
-	0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x87ff,
-	0x0118, 0x2748, 0x080c, 0x101d, 0x7048, 0x8001, 0x704a, 0x9005,
-	0x1170, 0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x101d, 0x9006,
-	0x7042, 0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040,
-	0x9005, 0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004,
-	0x90fa, 0x18f0, 0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006,
-	0x703e, 0x703a, 0x7044, 0x9005, 0x090c, 0x0db4, 0x2048, 0xa800,
-	0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1f26,
-	0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe,
-	0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a4a,
-	0x4a4a, 0x4a4c, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a51, 0x4a4a, 0x4a4a,
-	0x4a4a, 0x4a56, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a5b, 0x4a4a, 0x4a4a,
-	0x4a4a, 0x4a60, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a65, 0x4a4a, 0x4a4a,
-	0x4a4a, 0x4a6a, 0x080c, 0x0db4, 0xaa74, 0xab78, 0xac7c, 0x0804,
-	0x49d6, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x49d6, 0xaa94, 0xab98,
-	0xac9c, 0x0804, 0x49d6, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49d6,
-	0xaab4, 0xabb8, 0xacbc, 0x0804, 0x49d6, 0xaac4, 0xabc8, 0xaccc,
-	0x0804, 0x49d6, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49d6, 0x0026,
-	0x080c, 0x537f, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48d2,
-	0x002e, 0x0005, 0x81ff, 0x1904, 0x3362, 0x0126, 0x2091, 0x8000,
-	0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x6fa7, 0x1158,
-	0x080c, 0x728b, 0x080c, 0x5cca, 0x9085, 0x0001, 0x080c, 0x6fee,
-	0x080c, 0x6ed9, 0x0010, 0x080c, 0x5b89, 0x012e, 0x0804, 0x3330,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3362, 0x080c, 0x5393,
-	0x0120, 0x2009, 0x0007, 0x0804, 0x3362, 0x080c, 0x6553, 0x0120,
-	0x2009, 0x0008, 0x0804, 0x3362, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x657f, 0x002e, 0x0140, 0x7984, 0x080c, 0x65c9, 0x1120, 0x2009,
-	0x4009, 0x0804, 0x3362, 0x080c, 0x3127, 0x0128, 0x7984, 0x080c,
-	0x61d7, 0x1904, 0x3365, 0x080c, 0x48a5, 0x0904, 0x3365, 0x2b00,
-	0x7026, 0x080c, 0x655b, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158,
-	0x900e, 0x080c, 0x6457, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x3330, 0x080c, 0x4872, 0x0904, 0x3362, 0x9006,
-	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd21, 0x0904,
-	0x3362, 0x7888, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x7007,
-	0x0003, 0x701f, 0x4b40, 0x0005, 0x2061, 0x1800, 0x080c, 0x5393,
-	0x2009, 0x0007, 0x1578, 0x080c, 0x6553, 0x0118, 0x2009, 0x0008,
-	0x0448, 0x080c, 0x3127, 0x0120, 0xa998, 0x080c, 0x61d7, 0x1530,
-	0x080c, 0x48a3, 0x0518, 0x080c, 0x655b, 0xa89c, 0x1168, 0x9084,
-	0x0005, 0x1150, 0x900e, 0x080c, 0x6457, 0x1108, 0xc185, 0xb800,
-	0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c,
-	0xbd21, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be,
-	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x538e,
+	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x0005, 0x6100, 0x0804, 0x3337, 0x080c, 0x48ac, 0x0904, 0x336c,
+	0x080c, 0x539a, 0x1904, 0x3369, 0x79a8, 0xd184, 0x1158, 0xb834,
+	0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28,
+	0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a,
+	0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804,
+	0x3337, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1148, 0x939a, 0x0003,
+	0x1a04, 0x3369, 0x6258, 0x7884, 0x9206, 0x1904, 0x44b1, 0x2031,
+	0x1848, 0x2009, 0x013c, 0x2136, 0x2001, 0x1840, 0x2009, 0x000c,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8,
+	0x9084, 0x0080, 0x11c8, 0x0006, 0x0036, 0x2001, 0x1a4f, 0x201c,
+	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a50, 0x201c, 0x7b9e, 0x2003,
+	0x0000, 0x2001, 0x1a51, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
+	0x000e, 0x000e, 0x0804, 0x48c5, 0x000e, 0x2031, 0x0000, 0x2061,
+	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x44d1,
+	0x0005, 0x81ff, 0x1904, 0x3369, 0x080c, 0x48ac, 0x0904, 0x336c,
+	0x080c, 0x6562, 0x1904, 0x3369, 0x00c6, 0x080c, 0x4879, 0x00ce,
+	0x0904, 0x3369, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8,
+	0x080c, 0xbc86, 0x0904, 0x3369, 0x7007, 0x0003, 0x701f, 0x44eb,
+	0x0005, 0x080c, 0x401b, 0x0006, 0x0036, 0x2001, 0x1a4f, 0x201c,
+	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a50, 0x201c, 0x7b9e, 0x2003,
+	0x0000, 0x2001, 0x1a51, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
+	0x000e, 0x0804, 0x3337, 0xa830, 0x9086, 0x0100, 0x0904, 0x3369,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x48c5, 0x9006, 0x080c, 0x26cc, 0x78a8, 0x9084, 0x00ff, 0x9086,
+	0x00ff, 0x0118, 0x81ff, 0x1904, 0x3369, 0x080c, 0x6fb2, 0x0110,
+	0x080c, 0x5c96, 0x7888, 0x908a, 0x1000, 0x1a04, 0x336c, 0x7984,
+	0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x336c, 0x2100,
+	0x080c, 0x2696, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061,
+	0x19cb, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077,
+	0x0000, 0x080c, 0x6fb2, 0x1158, 0x080c, 0x7296, 0x080c, 0x5cd1,
+	0x9085, 0x0001, 0x080c, 0x6ff9, 0x080c, 0x6ee4, 0x00d0, 0x080c,
+	0x9db8, 0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
+	0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
+	0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bbc, 0x080c,
+	0x80ca, 0x7984, 0x080c, 0x6fb2, 0x1110, 0x2009, 0x00ff, 0x7a88,
+	0x080c, 0x4364, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3337, 0x7984,
+	0x080c, 0x61de, 0x2b08, 0x1904, 0x336c, 0x0804, 0x3337, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x60d8, 0xd0ac, 0x1130,
+	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3369, 0x080c, 0x4879,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x7984, 0x9192, 0x0021,
+	0x1a04, 0x336c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
+	0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x48c2, 0x701f, 0x459f,
+	0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x4e44, 0x0005, 0x2009,
+	0x0080, 0x080c, 0x623e, 0x1118, 0x080c, 0x6562, 0x0120, 0x2021,
+	0x400a, 0x0804, 0x3339, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70,
+	0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4638,
+	0x90be, 0x0112, 0x0904, 0x4638, 0x90be, 0x0113, 0x0904, 0x4638,
+	0x90be, 0x0114, 0x0904, 0x4638, 0x90be, 0x0117, 0x0904, 0x4638,
+	0x90be, 0x011a, 0x0904, 0x4638, 0x90be, 0x011c, 0x0904, 0x4638,
+	0x90be, 0x0121, 0x0904, 0x461f, 0x90be, 0x0131, 0x0904, 0x461f,
+	0x90be, 0x0171, 0x0904, 0x4638, 0x90be, 0x0173, 0x0904, 0x4638,
+	0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x4643,
+	0x90be, 0x0212, 0x0904, 0x462c, 0x90be, 0x0213, 0x05e8, 0x90be,
+	0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120,
+	0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be,
+	0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x336c, 0x7028, 0x9080,
+	0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007,
+	0x080c, 0x4681, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4681, 0x00c8, 0x7028,
+	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x080c, 0x468e, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x468e,
+	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
+	0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4879, 0x0550, 0xa868,
+	0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020,
+	0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe,
+	0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822,
+	0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xbca1, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x4678,
+	0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x3369,
+	0xa820, 0x9086, 0x8001, 0x1904, 0x3337, 0x2009, 0x0004, 0x0804,
+	0x3369, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104,
+	0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204,
+	0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x60d8,
+	0xd0ac, 0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x3369,
+	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3369, 0x7984, 0x78a8,
+	0x2040, 0x080c, 0x9db1, 0x1120, 0x9182, 0x007f, 0x0a04, 0x336c,
+	0x9186, 0x00ff, 0x0904, 0x336c, 0x9182, 0x0800, 0x1a04, 0x336c,
+	0x7a8c, 0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e, 0x0904,
+	0x336c, 0x99cc, 0xff00, 0x0904, 0x336c, 0x0126, 0x2091, 0x8000,
+	0x0026, 0x2011, 0x8008, 0x080c, 0x6586, 0x002e, 0x0140, 0x918d,
+	0x8000, 0x080c, 0x65d0, 0x1118, 0x2001, 0x4009, 0x0458, 0x080c,
+	0x4793, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e,
+	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090,
+	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009,
+	0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005,
+	0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3339, 0x2b00, 0x7026,
+	0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9e7f, 0x0904,
+	0x4760, 0x2b00, 0x6012, 0x080c, 0xbf8c, 0x2e58, 0x00ee, 0x00e6,
+	0x00c6, 0x080c, 0x4879, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9e32,
+	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804,
+	0x3369, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868,
+	0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x2fda, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f,
+	0x2009, 0x0002, 0x080c, 0x9eac, 0x78a8, 0xd094, 0x0138, 0x00ee,
+	0x7024, 0x00e6, 0x2058, 0xb8bc, 0xc08d, 0xb8be, 0x9085, 0x0001,
+	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x476f, 0x0005, 0xa830,
+	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3339,
+	0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04,
+	0x9294, 0x00ff, 0x0804, 0x52e3, 0x900e, 0xa868, 0xd0f4, 0x1904,
+	0x3337, 0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3337, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
+	0x47db, 0x902e, 0x080c, 0x9db1, 0x0130, 0x9026, 0x20a9, 0x0800,
+	0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071,
+	0x107f, 0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8, 0x2428,
+	0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030, 0x94ce,
+	0x0080, 0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff, 0x11d8,
+	0xc5fd, 0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8, 0xbe14,
+	0x2600, 0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884, 0x0568,
+	0xd894, 0x1558, 0x080c, 0x6562, 0x1540, 0x2001, 0x4000, 0x0430,
+	0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106,
+	0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9db1,
+	0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x47a9,
+	0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030,
+	0x080c, 0x61de, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e,
+	0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3369, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904,
+	0x336c, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x336c,
+	0x2010, 0x2918, 0x080c, 0x2f80, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3369, 0x7007, 0x0003, 0x701f, 0x482e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1904, 0x3337, 0x2009, 0x0004, 0x0804, 0x3369, 0x7984,
+	0x080c, 0x9db1, 0x1120, 0x9182, 0x007f, 0x0a04, 0x336c, 0x9186,
+	0x00ff, 0x0904, 0x336c, 0x9182, 0x0800, 0x1a04, 0x336c, 0x2001,
+	0x9000, 0x080c, 0x533e, 0x1904, 0x3369, 0x0804, 0x3337, 0xa998,
+	0x080c, 0x9db1, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff,
+	0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x533e,
+	0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
 	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0xa99a, 0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005,
-	0xa830, 0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804,
-	0x3332, 0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52dc,
-	0x900e, 0x080c, 0x6457, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x3330, 0x080c, 0x5393, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x3362, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c,
-	0x4872, 0x1120, 0x2009, 0x0002, 0x0804, 0x3362, 0x900e, 0x2130,
-	0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005,
-	0x702a, 0x20a0, 0x080c, 0x6237, 0x1904, 0x4bde, 0x080c, 0x655b,
-	0x0120, 0x080c, 0x6563, 0x1904, 0x4bde, 0x080c, 0x6553, 0x1130,
-	0x080c, 0x6457, 0x1118, 0xd79c, 0x0904, 0x4bde, 0xd794, 0x1110,
-	0xd784, 0x01a8, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
-	0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0,
-	0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x4687, 0x0048, 0x20a9,
-	0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4687,
-	0x4104, 0xd794, 0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80,
-	0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098,
-	0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9,
-	0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x467a,
-	0x9c80, 0x0026, 0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003,
-	0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c,
-	0x9d98, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186,
-	0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118,
-	0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b7a,
-	0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x3330, 0x7033, 0x0001,
-	0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44,
-	0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e,
-	0xa392, 0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f,
-	0x4c1a, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0,
-	0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c,
-	0xa390, 0xa494, 0xa598, 0x0804, 0x4b7a, 0x7124, 0x810b, 0x0804,
-	0x3330, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184,
-	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3365, 0x9502, 0x0a04,
-	0x3365, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3365, 0x9502,
-	0x0a04, 0x3365, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
-	0x3365, 0x9502, 0x0a04, 0x3365, 0x9284, 0x00ff, 0x90e2, 0x0020,
-	0x0a04, 0x3365, 0x9502, 0x0a04, 0x3365, 0x9384, 0xff00, 0x8007,
-	0x90e2, 0x0020, 0x0a04, 0x3365, 0x9502, 0x0a04, 0x3365, 0x9384,
-	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3365, 0x9502, 0x0a04, 0x3365,
-	0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3365, 0x9502,
-	0x0a04, 0x3365, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3365,
-	0x9502, 0x0a04, 0x3365, 0x2061, 0x195a, 0x6102, 0x6206, 0x630a,
-	0x640e, 0x0804, 0x3330, 0x0006, 0x080c, 0x537f, 0xd0cc, 0x000e,
-	0x0005, 0x0006, 0x080c, 0x5383, 0xd0bc, 0x000e, 0x0005, 0x6170,
-	0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3330, 0x83ff,
-	0x1904, 0x3365, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x3365, 0x2019,
-	0xffff, 0x6074, 0x9302, 0x9200, 0x0a04, 0x3365, 0x7986, 0x6272,
-	0x0804, 0x3330, 0x080c, 0x5393, 0x1904, 0x3362, 0x7c88, 0x7d84,
-	0x7e98, 0x7f8c, 0x080c, 0x4872, 0x0904, 0x3362, 0x900e, 0x901e,
-	0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003,
-	0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
-	0x655b, 0x0118, 0x080c, 0x6563, 0x1148, 0x20a9, 0x0001, 0xb814,
-	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
-	0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148,
-	0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x8248, 0x2208, 0x0804,
-	0x3330, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061,
-	0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034,
-	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10d5, 0x7007,
-	0x0002, 0x701f, 0x4d0c, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120,
-	0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44,
-	0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x4cca, 0x7224, 0x900e,
-	0x2001, 0x0003, 0x080c, 0x8248, 0x2208, 0x0804, 0x3330, 0x00f6,
-	0x00e6, 0x080c, 0x5393, 0x2009, 0x0007, 0x1904, 0x4d9f, 0x2071,
-	0x1894, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4d9f, 0xac9c,
-	0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x1004, 0x2009, 0x0002,
-	0x0904, 0x4d9f, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362,
-	0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8,
-	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x655b, 0x0118, 0x080c,
-	0x6563, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
-	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
-	0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001,
-	0x0003, 0x080c, 0x8248, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a,
-	0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d, 0x9006,
-	0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152,
-	0x7054, 0x9300, 0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058,
-	0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f,
-	0x4dab, 0x000e, 0xa0a2, 0x080c, 0x10d5, 0x9006, 0x0048, 0x009e,
-	0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
-	0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0db4,
-	0x00e6, 0x2071, 0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005,
-	0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c,
-	0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8248,
-	0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d,
-	0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6885, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe,
-	0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x655b,
-	0x0118, 0x080c, 0x6563, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a,
+	0x0c48, 0x080c, 0x0feb, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005,
+	0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086,
+	0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005,
+	0x7984, 0x080c, 0x623e, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x623e,
+	0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e,
+	0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x623e,
+	0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff,
+	0x0128, 0x2148, 0xa904, 0x080c, 0x101d, 0x0cc8, 0x7116, 0x711a,
+	0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061,
+	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x3337,
+	0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001,
+	0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x48f6, 0x7a36, 0x7833,
+	0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1187, 0x0804, 0x495c, 0x0016, 0x0086,
+	0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005, 0x1540,
+	0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x0feb,
+	0x0904, 0x4954, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002,
+	0x9080, 0x1f26, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004,
+	0x2001, 0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0, 0x2c00,
+	0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460,
+	0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016,
+	0x908a, 0x0036, 0x1a0c, 0x0db4, 0x2060, 0x001e, 0x8108, 0x2105,
+	0x9005, 0xa146, 0x1520, 0x080c, 0x0feb, 0x1130, 0x8109, 0xa946,
+	0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046,
+	0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080,
+	0x1f26, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee,
+	0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00,
+	0x9082, 0x001b, 0x0002, 0x497e, 0x497e, 0x4980, 0x497e, 0x497e,
+	0x497e, 0x4984, 0x497e, 0x497e, 0x497e, 0x4988, 0x497e, 0x497e,
+	0x497e, 0x498c, 0x497e, 0x497e, 0x497e, 0x4990, 0x497e, 0x497e,
+	0x497e, 0x4994, 0x497e, 0x497e, 0x497e, 0x4999, 0x080c, 0x0db4,
+	0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878,
+	0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838,
+	0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804,
+	0x4957, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4957, 0x00e6, 0x2071,
+	0x1894, 0x7048, 0x9005, 0x0904, 0x4a30, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x4a2f, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086,
+	0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948,
+	0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x2060, 0x001e,
+	0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a32, 0xa804, 0x9005,
+	0x090c, 0x0db4, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001,
+	0x0002, 0x9080, 0x1f26, 0x2005, 0xa04a, 0x0804, 0x4a32, 0x703c,
+	0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833,
+	0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x87ff, 0x0118,
+	0x2748, 0x080c, 0x101d, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170,
+	0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x101d, 0x9006, 0x7042,
+	0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040, 0x9005,
+	0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa,
+	0x18f0, 0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006, 0x703e,
+	0x703a, 0x7044, 0x9005, 0x090c, 0x0db4, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1f26, 0x2005,
+	0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e,
+	0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a51, 0x4a51,
+	0x4a53, 0x4a51, 0x4a51, 0x4a51, 0x4a58, 0x4a51, 0x4a51, 0x4a51,
+	0x4a5d, 0x4a51, 0x4a51, 0x4a51, 0x4a62, 0x4a51, 0x4a51, 0x4a51,
+	0x4a67, 0x4a51, 0x4a51, 0x4a51, 0x4a6c, 0x4a51, 0x4a51, 0x4a51,
+	0x4a71, 0x080c, 0x0db4, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x49dd,
+	0xaa84, 0xab88, 0xac8c, 0x0804, 0x49dd, 0xaa94, 0xab98, 0xac9c,
+	0x0804, 0x49dd, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49dd, 0xaab4,
+	0xabb8, 0xacbc, 0x0804, 0x49dd, 0xaac4, 0xabc8, 0xaccc, 0x0804,
+	0x49dd, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49dd, 0x0026, 0x080c,
+	0x5386, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48d9, 0x002e,
+	0x0005, 0x81ff, 0x1904, 0x3369, 0x0126, 0x2091, 0x8000, 0x6030,
+	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x6fb2, 0x1158, 0x080c,
+	0x7296, 0x080c, 0x5cd1, 0x9085, 0x0001, 0x080c, 0x6ff9, 0x080c,
+	0x6ee4, 0x0010, 0x080c, 0x5b90, 0x012e, 0x0804, 0x3337, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x080c, 0x539a, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x3369, 0x080c, 0x655a, 0x0120, 0x2009,
+	0x0008, 0x0804, 0x3369, 0x0026, 0x2011, 0x0010, 0x080c, 0x6586,
+	0x002e, 0x0140, 0x7984, 0x080c, 0x65d0, 0x1120, 0x2009, 0x4009,
+	0x0804, 0x3369, 0x080c, 0x312e, 0x0128, 0x7984, 0x080c, 0x61de,
+	0x1904, 0x336c, 0x080c, 0x48ac, 0x0904, 0x336c, 0x2b00, 0x7026,
+	0x080c, 0x6562, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e,
+	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x0804, 0x3337, 0x080c, 0x4879, 0x0904, 0x3369, 0x9006, 0xa866,
+	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd3a, 0x0904, 0x3369,
+	0x7888, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x7007, 0x0003,
+	0x701f, 0x4b47, 0x0005, 0x2061, 0x1800, 0x080c, 0x539a, 0x2009,
+	0x0007, 0x1578, 0x080c, 0x655a, 0x0118, 0x2009, 0x0008, 0x0448,
+	0x080c, 0x312e, 0x0120, 0xa998, 0x080c, 0x61de, 0x1530, 0x080c,
+	0x48aa, 0x0518, 0x080c, 0x6562, 0xa89c, 0x1168, 0x9084, 0x0005,
+	0x1150, 0x900e, 0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xbd3a,
+	0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x2009,
+	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a,
+	0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830,
+	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3339,
+	0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52e3, 0x900e,
+	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x0804, 0x3337, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3369, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4879,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x900e, 0x2130, 0x7126,
+	0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a,
+	0x20a0, 0x080c, 0x623e, 0x1904, 0x4be5, 0x080c, 0x6562, 0x0120,
+	0x080c, 0x656a, 0x1904, 0x4be5, 0x080c, 0x655a, 0x1130, 0x080c,
+	0x645e, 0x1118, 0xd79c, 0x0904, 0x4be5, 0xd794, 0x1110, 0xd784,
+	0x01a8, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x3400,
+	0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00,
+	0x20e0, 0x20a9, 0x0002, 0x080c, 0x468e, 0x0048, 0x20a9, 0x0004,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x468e, 0x4104,
+	0xd794, 0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80, 0x0000,
+	0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9,
+	0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4681, 0x9c80,
+	0x0026, 0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794,
+	0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0x9db1,
+	0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800,
+	0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686,
+	0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b81, 0x86ff,
+	0x1120, 0x7124, 0x810b, 0x0804, 0x3337, 0x7033, 0x0001, 0x7122,
+	0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44, 0xa06b,
+	0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x4c21,
+	0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c,
+	0x9036, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0x0804, 0x4b81, 0x7124, 0x810b, 0x0804, 0x3337,
+	0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00,
+	0x8007, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04, 0x336c,
+	0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04,
+	0x336c, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x336c,
+	0x9502, 0x0a04, 0x336c, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04,
+	0x336c, 0x9502, 0x0a04, 0x336c, 0x9384, 0xff00, 0x8007, 0x90e2,
+	0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04, 0x336c, 0x9384, 0x00ff,
+	0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04, 0x336c, 0x9484,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04,
+	0x336c, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502,
+	0x0a04, 0x336c, 0x2061, 0x195a, 0x6102, 0x6206, 0x630a, 0x640e,
+	0x0804, 0x3337, 0x0006, 0x080c, 0x5386, 0xd0cc, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x538a, 0xd0bc, 0x000e, 0x0005, 0x6170, 0x7a84,
+	0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3337, 0x83ff, 0x1904,
+	0x336c, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x336c, 0x2019, 0xffff,
+	0x6074, 0x9302, 0x9200, 0x0a04, 0x336c, 0x7986, 0x6272, 0x0804,
+	0x3337, 0x080c, 0x539a, 0x1904, 0x3369, 0x7c88, 0x7d84, 0x7e98,
+	0x7f8c, 0x080c, 0x4879, 0x0904, 0x3369, 0x900e, 0x901e, 0x7326,
+	0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a,
+	0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6562,
+	0x0118, 0x080c, 0x656a, 0x1148, 0x20a9, 0x0001, 0xb814, 0x4004,
 	0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800,
-	0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154,
-	0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0db4,
-	0x2148, 0x080c, 0x101d, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008,
-	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6885, 0x012e,
-	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152,
-	0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a,
-	0x080c, 0x10d5, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be,
-	0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118,
-	0x009e, 0x0804, 0x3365, 0xa884, 0xa988, 0x080c, 0x2663, 0x1518,
-	0x080c, 0x61d7, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c,
-	0x4872, 0x01c8, 0x080c, 0x4872, 0x01b0, 0x009e, 0xa867, 0x0000,
-	0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c,
-	0xbca8, 0x1120, 0x2009, 0x0003, 0x0804, 0x3362, 0x7007, 0x0003,
-	0x701f, 0x4e78, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3362,
-	0x7124, 0x080c, 0x30ce, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009,
-	0x0004, 0x0804, 0x3362, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e,
-	0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8,
-	0x20a9, 0x002a, 0x080c, 0x0f68, 0xaa6c, 0xab70, 0xac74, 0xad78,
-	0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6,
-	0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600,
-	0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x48be, 0x97c6, 0x7200,
-	0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae,
-	0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496,
-	0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x4ed4, 0x0005,
-	0x000e, 0x007e, 0x0804, 0x3365, 0x7020, 0x2048, 0xa804, 0x2048,
-	0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
-	0x002a, 0x080c, 0x0f68, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44,
-	0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48be,
-	0x81ff, 0x1904, 0x3362, 0x798c, 0x2001, 0x194f, 0x918c, 0x8000,
-	0x2102, 0x080c, 0x4889, 0x0904, 0x3365, 0x080c, 0x655b, 0x0120,
-	0x080c, 0x6563, 0x1904, 0x3365, 0x080c, 0x62fe, 0x0904, 0x3362,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x63c4, 0x012e, 0x0904, 0x3362,
-	0x2001, 0x194f, 0x2004, 0xd0fc, 0x1904, 0x3330, 0x0804, 0x42fa,
-	0xa9a0, 0x2001, 0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
-	0x4896, 0x01a0, 0x080c, 0x655b, 0x0118, 0x080c, 0x6563, 0x1170,
-	0x080c, 0x62fe, 0x2009, 0x0002, 0x0128, 0x080c, 0x63c4, 0x1170,
-	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0x2001, 0x194f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x5387, 0x0110,
-	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
-	0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x426f, 0x080c, 0x48a5,
-	0x0904, 0x3365, 0x080c, 0x4872, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x3362, 0x080c, 0x655b, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e,
-	0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802,
-	0x0028, 0x080c, 0x537f, 0xd0b4, 0x0904, 0x42a9, 0x7884, 0x908e,
-	0x007e, 0x0904, 0x42a9, 0x908e, 0x007f, 0x0904, 0x42a9, 0x908e,
-	0x0080, 0x0904, 0x42a9, 0xb800, 0xd08c, 0x1904, 0x42a9, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbcc7, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x3362, 0x7007, 0x0003, 0x701f, 0x4fa0, 0x0005,
-	0x080c, 0x48a5, 0x0904, 0x3365, 0x0804, 0x42a9, 0x080c, 0x3127,
-	0x0108, 0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x3362, 0x080c, 0x5393, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x3362, 0x080c, 0x6553, 0x0120, 0x2009, 0x0008, 0x0804,
-	0x3362, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42a9, 0x9006,
-	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd21, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x3362, 0x7007, 0x0003, 0x701f, 0x4fd9,
-	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
-	0x52dc, 0x080c, 0x48a5, 0x0904, 0x3365, 0x0804, 0x4f72, 0x81ff,
-	0x2009, 0x0001, 0x1904, 0x3362, 0x080c, 0x5393, 0x2009, 0x0007,
-	0x1904, 0x3362, 0x080c, 0x6553, 0x0120, 0x2009, 0x0008, 0x0804,
-	0x3362, 0x080c, 0x48a5, 0x0904, 0x3365, 0x080c, 0x655b, 0x2009,
-	0x0009, 0x1904, 0x3362, 0x080c, 0x4872, 0x2009, 0x0002, 0x0904,
-	0x3362, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988,
-	0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed,
-	0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x3365,
-	0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xbf74, 0x2009, 0x0003,
-	0x0904, 0x3362, 0x7007, 0x0003, 0x701f, 0x502f, 0x0005, 0xa830,
-	0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x3362, 0x0804, 0x3330,
-	0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x5393,
-	0x1188, 0x2009, 0x0014, 0x0804, 0x3362, 0xd2dc, 0x1568, 0x81ff,
-	0x2009, 0x0001, 0x1904, 0x3362, 0x080c, 0x5393, 0x2009, 0x0007,
-	0x1904, 0x3362, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x535a,
-	0x0804, 0x3330, 0xd2fc, 0x0158, 0x080c, 0x48a5, 0x0904, 0x3365,
-	0x7984, 0x9284, 0x9000, 0x080c, 0x5337, 0x0804, 0x3330, 0x080c,
-	0x48a5, 0x0904, 0x3365, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
-	0x2009, 0x0009, 0x1904, 0x5118, 0x080c, 0x4872, 0x2009, 0x0002,
-	0x0904, 0x5118, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48bb, 0x701f, 0x5089,
-	0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120,
-	0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x3365, 0xa866, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0x48a5, 0x1110, 0x0804, 0x3365,
-	0x2009, 0x0043, 0x080c, 0xbfdc, 0x2009, 0x0003, 0x0904, 0x5118,
-	0x7007, 0x0003, 0x701f, 0x50ad, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x2009, 0x0004, 0x0904, 0x5118, 0x7984, 0x7aa8, 0x9284, 0x1000,
-	0x080c, 0x5337, 0x0804, 0x3330, 0x00c6, 0xaab0, 0x9284, 0xc000,
-	0x0140, 0xd2ec, 0x0168, 0x080c, 0x5393, 0x1150, 0x2009, 0x0014,
-	0x04f0, 0x2061, 0x1800, 0x080c, 0x5393, 0x2009, 0x0007, 0x15b8,
-	0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x535a, 0x0050, 0xd2fc,
-	0x0178, 0x080c, 0x48a3, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c,
-	0x5337, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438,
-	0x080c, 0x48a3, 0x0510, 0x080c, 0x655b, 0x2009, 0x0009, 0x11b8,
-	0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc,
-	0x9084, 0xff00, 0x1190, 0x080c, 0x48a3, 0x1108, 0x0070, 0x2009,
-	0x004b, 0x080c, 0xbfdc, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429,
-	0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0,
-	0x7aa8, 0xd2dc, 0x0904, 0x3362, 0x0016, 0x7984, 0x9284, 0x1000,
-	0xc0fd, 0x080c, 0x5337, 0x001e, 0x1904, 0x3362, 0x0804, 0x3330,
-	0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150,
-	0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5337, 0x001e,
-	0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x3362, 0x080c, 0x5393, 0x0120, 0x2009, 0x0007, 0x0804, 0x3362,
-	0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6237, 0x1904, 0x3365,
-	0x9186, 0x007f, 0x0138, 0x080c, 0x655b, 0x0120, 0x2009, 0x0009,
-	0x0804, 0x3362, 0x080c, 0x4872, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x3362, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100,
-	0x8007, 0xa80a, 0x080c, 0xbce1, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x3362, 0x7007, 0x0003, 0x701f, 0x5176, 0x0005, 0xa808, 0x8007,
-	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3362, 0xa8e0,
-	0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007,
-	0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48be, 0x080c, 0x4872, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x3362, 0x7984, 0x9194, 0xff00, 0x918c,
-	0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x1984, 0x0040, 0x92c6,
-	0x0001, 0x1118, 0x7023, 0x199e, 0x0010, 0x0804, 0x3365, 0x2009,
-	0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
-	0xaf60, 0x080c, 0x48bb, 0x701f, 0x51c6, 0x0005, 0x2001, 0x182d,
-	0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0,
-	0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804,
-	0x3330, 0x080c, 0x4872, 0x1120, 0x2009, 0x0002, 0x0804, 0x3362,
-	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
-	0x2099, 0x1984, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199e,
-	0x0010, 0x0804, 0x3365, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860,
-	0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a,
+	0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224,
+	0x900e, 0x2001, 0x0003, 0x080c, 0x8270, 0x2208, 0x0804, 0x3337,
+	0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18ae,
+	0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072,
+	0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10d5, 0x7007, 0x0002,
+	0x701f, 0x4d13, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028,
+	0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa48c,
+	0xa590, 0xa694, 0xa798, 0x0804, 0x4cd1, 0x7224, 0x900e, 0x2001,
+	0x0003, 0x080c, 0x8270, 0x2208, 0x0804, 0x3337, 0x00f6, 0x00e6,
+	0x080c, 0x539a, 0x2009, 0x0007, 0x1904, 0x4da6, 0x2071, 0x1894,
+	0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4da6, 0xac9c, 0xad98,
+	0xaea4, 0xafa0, 0x0096, 0x080c, 0x1004, 0x2009, 0x0002, 0x0904,
+	0x4da6, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860,
+	0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000,
+	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a,
+	0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104,
+	0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c,
+	0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001, 0x0003,
+	0x080c, 0x8270, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c,
+	0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d, 0x9006, 0x705e,
+	0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054,
+	0x9300, 0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058, 0xa076,
+	0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x4db2,
+	0x000e, 0xa0a2, 0x080c, 0x10d5, 0x9006, 0x0048, 0x009e, 0xa897,
+	0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee,
+	0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0db4, 0x00e6,
+	0x2071, 0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b, 0x0030,
+	0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005, 0x1158,
+	0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590,
+	0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
+	0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8270, 0xaa9a,
+	0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d, 0x705f,
+	0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x688c,
+	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6562, 0x0118,
+	0x080c, 0x656a, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810,
+	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
+	0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c,
+	0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148,
+	0x080c, 0x101d, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0,
+	0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0xa09f,
+	0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054,
+	0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c,
+	0x10d5, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000,
+	0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e,
+	0x0804, 0x336c, 0xa884, 0xa988, 0x080c, 0x2663, 0x1518, 0x080c,
+	0x61de, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4879,
+	0x01c8, 0x080c, 0x4879, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xbcc1,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3369, 0x7007, 0x0003, 0x701f,
+	0x4e7f, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3369, 0x7124,
+	0x080c, 0x30d5, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004,
+	0x0804, 0x3369, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080,
+	0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
+	0x002a, 0x080c, 0x0f68, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061,
+	0x18ae, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000,
+	0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009,
+	0x0004, 0x000e, 0x007e, 0x0804, 0x48c5, 0x97c6, 0x7200, 0x11b8,
+	0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae, 0x2c44,
+	0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a,
+	0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x4edb, 0x0005, 0x000e,
+	0x007e, 0x0804, 0x336c, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804,
+	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
+	0x080c, 0x0f68, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44, 0xa28c,
+	0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48c5, 0x81ff,
+	0x1904, 0x3369, 0x798c, 0x2001, 0x194f, 0x918c, 0x8000, 0x2102,
+	0x080c, 0x4890, 0x0904, 0x336c, 0x080c, 0x6562, 0x0120, 0x080c,
+	0x656a, 0x1904, 0x336c, 0x080c, 0x6305, 0x0904, 0x3369, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x63cb, 0x012e, 0x0904, 0x3369, 0x2001,
+	0x194f, 0x2004, 0xd0fc, 0x1904, 0x3337, 0x0804, 0x4301, 0xa9a0,
+	0x2001, 0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489d,
+	0x01a0, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a, 0x1170, 0x080c,
+	0x6305, 0x2009, 0x0002, 0x0128, 0x080c, 0x63cb, 0x1170, 0x2009,
+	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001,
+	0x194f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x538e, 0x0110, 0x9006,
+	0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8,
+	0xd08c, 0x1118, 0xd084, 0x0904, 0x4276, 0x080c, 0x48ac, 0x0904,
+	0x336c, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369,
+	0x080c, 0x6562, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005,
+	0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028,
+	0x080c, 0x5386, 0xd0b4, 0x0904, 0x42b0, 0x7884, 0x908e, 0x007e,
+	0x0904, 0x42b0, 0x908e, 0x007f, 0x0904, 0x42b0, 0x908e, 0x0080,
+	0x0904, 0x42b0, 0xb800, 0xd08c, 0x1904, 0x42b0, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbce0, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x4fa7, 0x0005, 0x080c,
+	0x48ac, 0x0904, 0x336c, 0x0804, 0x42b0, 0x080c, 0x312e, 0x0108,
+	0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3369, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3369, 0x080c, 0x655a, 0x0120, 0x2009, 0x0008, 0x0804, 0x3369,
+	0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42b0, 0x9006, 0xa866,
+	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd3a, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x4fe0, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x52e3,
+	0x080c, 0x48ac, 0x0904, 0x336c, 0x0804, 0x4f79, 0x81ff, 0x2009,
+	0x0001, 0x1904, 0x3369, 0x080c, 0x539a, 0x2009, 0x0007, 0x1904,
+	0x3369, 0x080c, 0x655a, 0x0120, 0x2009, 0x0008, 0x0804, 0x3369,
+	0x080c, 0x48ac, 0x0904, 0x336c, 0x080c, 0x6562, 0x2009, 0x0009,
+	0x1904, 0x3369, 0x080c, 0x4879, 0x2009, 0x0002, 0x0904, 0x3369,
+	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194,
+	0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952,
+	0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x336c, 0xc0e5,
+	0xa952, 0xa956, 0xa83e, 0x080c, 0xbf8d, 0x2009, 0x0003, 0x0904,
+	0x3369, 0x7007, 0x0003, 0x701f, 0x5036, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x2009, 0x0004, 0x0904, 0x3369, 0x0804, 0x3337, 0x7aa8,
+	0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x539a, 0x1188,
+	0x2009, 0x0014, 0x0804, 0x3369, 0xd2dc, 0x1568, 0x81ff, 0x2009,
+	0x0001, 0x1904, 0x3369, 0x080c, 0x539a, 0x2009, 0x0007, 0x1904,
+	0x3369, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5361, 0x0804,
+	0x3337, 0xd2fc, 0x0158, 0x080c, 0x48ac, 0x0904, 0x336c, 0x7984,
+	0x9284, 0x9000, 0x080c, 0x533e, 0x0804, 0x3337, 0x080c, 0x48ac,
+	0x0904, 0x336c, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009,
+	0x0009, 0x1904, 0x511f, 0x080c, 0x4879, 0x2009, 0x0002, 0x0904,
+	0x511f, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48c2, 0x701f, 0x5090, 0x0005,
+	0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874,
+	0x9084, 0xff00, 0x0110, 0x1904, 0x336c, 0xa866, 0xa832, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0x48ac, 0x1110, 0x0804, 0x336c, 0x2009,
+	0x0043, 0x080c, 0xbff5, 0x2009, 0x0003, 0x0904, 0x511f, 0x7007,
+	0x0003, 0x701f, 0x50b4, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009,
+	0x0004, 0x0904, 0x511f, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c,
+	0x533e, 0x0804, 0x3337, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140,
+	0xd2ec, 0x0168, 0x080c, 0x539a, 0x1150, 0x2009, 0x0014, 0x04f0,
+	0x2061, 0x1800, 0x080c, 0x539a, 0x2009, 0x0007, 0x15b8, 0xd2f4,
+	0x0128, 0x9284, 0x5000, 0x080c, 0x5361, 0x0050, 0xd2fc, 0x0178,
+	0x080c, 0x48aa, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x533e,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c,
+	0x48aa, 0x0510, 0x080c, 0x6562, 0x2009, 0x0009, 0x11b8, 0xa8c4,
+	0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084,
+	0xff00, 0x1190, 0x080c, 0x48aa, 0x1108, 0x0070, 0x2009, 0x004b,
+	0x080c, 0xbff5, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8,
+	0xd2dc, 0x0904, 0x3369, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd,
+	0x080c, 0x533e, 0x001e, 0x1904, 0x3369, 0x0804, 0x3337, 0x00f6,
+	0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016,
+	0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x533e, 0x001e, 0x9085,
+	0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3369,
+	0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804, 0x3369, 0x7984,
+	0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x623e, 0x1904, 0x336c, 0x9186,
+	0x007f, 0x0138, 0x080c, 0x6562, 0x0120, 0x2009, 0x0009, 0x0804,
+	0x3369, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007,
+	0xa80a, 0x080c, 0xbcfa, 0x1120, 0x2009, 0x0003, 0x0804, 0x3369,
+	0x7007, 0x0003, 0x701f, 0x517d, 0x0005, 0xa808, 0x8007, 0x9086,
+	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3369, 0xa8e0, 0xa866,
+	0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007, 0x9084,
+	0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x0804, 0x48c5, 0x080c, 0x4879, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x3369, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff,
+	0x8217, 0x82ff, 0x1118, 0x7023, 0x1984, 0x0040, 0x92c6, 0x0001,
+	0x1118, 0x7023, 0x199e, 0x0010, 0x0804, 0x336c, 0x2009, 0x001a,
 	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
-	0x0804, 0x48be, 0x7884, 0x908a, 0x1000, 0x1a04, 0x3365, 0x0126,
-	0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061,
-	0x19cb, 0x6142, 0x00ce, 0x012e, 0x0804, 0x3330, 0x00c6, 0x080c,
-	0x6fa7, 0x1160, 0x080c, 0x728b, 0x080c, 0x5cca, 0x9085, 0x0001,
-	0x080c, 0x6fee, 0x080c, 0x6ed9, 0x080c, 0x0db4, 0x2061, 0x1800,
-	0x6030, 0xc09d, 0x6032, 0x080c, 0x5b89, 0x00ce, 0x0005, 0x00c6,
-	0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3362, 0x7884,
-	0x9005, 0x0188, 0x7888, 0x2061, 0x196d, 0x2c0c, 0x2062, 0x080c,
-	0x2a45, 0x01a0, 0x080c, 0x2a4d, 0x0188, 0x080c, 0x2a55, 0x0170,
-	0x2162, 0x0804, 0x3365, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007,
-	0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086,
-	0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026,
-	0x2011, 0x0003, 0x080c, 0x9758, 0x2011, 0x0002, 0x080c, 0x9762,
-	0x002e, 0x080c, 0x9649, 0x0036, 0x901e, 0x080c, 0x96bf, 0x003e,
-	0x60e3, 0x0000, 0x080c, 0xd894, 0x080c, 0xd8af, 0x9085, 0x0001,
-	0x080c, 0x6fee, 0x9006, 0x080c, 0x2b14, 0x2001, 0x1800, 0x2003,
-	0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x3330, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x3362, 0x080c, 0x5393, 0x0120, 0x2009,
-	0x0007, 0x0804, 0x3362, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
-	0x6237, 0x1904, 0x3365, 0x9186, 0x007f, 0x0138, 0x080c, 0x655b,
-	0x0120, 0x2009, 0x0009, 0x0804, 0x3362, 0x080c, 0x4872, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x3362, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x080c, 0xbce4, 0x1120, 0x2009, 0x0003, 0x0804, 0x3362,
-	0x7007, 0x0003, 0x701f, 0x52c5, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x1120, 0x2009, 0x0004, 0x0804, 0x3362, 0xa8e0, 0xa866, 0xa834,
-	0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0xaf60, 0x0804, 0x48be, 0xa898, 0x9086, 0x000d, 0x1904,
-	0x3362, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52e9,
-	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
-	0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986,
-	0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x48ae, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x7007, 0x0001,
-	0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x00c6, 0x2061, 0x19cb, 0x7984, 0x6152, 0x614e, 0x6057,
-	0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888,
-	0x6062, 0x788c, 0x605e, 0x2001, 0x19d9, 0x2044, 0x2001, 0x19e0,
-	0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b,
-	0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3330, 0x0126,
-	0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006,
-	0x080c, 0xbb4b, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000,
-	0x2004, 0x905d, 0x0160, 0x080c, 0x5ce4, 0x080c, 0x9d98, 0x0110,
-	0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085,
-	0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e,
-	0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180,
-	0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080,
-	0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e,
-	0x001e, 0x8108, 0x1f04, 0x5362, 0x015e, 0x012e, 0x0005, 0x2001,
-	0x1854, 0x2004, 0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006,
-	0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e,
-	0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
-	0x0005, 0x0016, 0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a,
-	0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x3365,
-	0x810c, 0x0016, 0x080c, 0x4872, 0x080c, 0x0ef3, 0x2100, 0x2238,
-	0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48bb, 0x701f,
-	0x53ba, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac,
-	0x79a4, 0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071,
-	0x1894, 0x080c, 0x48be, 0x701f, 0x53ce, 0x0005, 0x2061, 0x18ae,
-	0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0efb, 0x002e,
-	0x001e, 0x080c, 0x0fa8, 0x9006, 0xa802, 0xa806, 0x0804, 0x3330,
-	0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800,
-	0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x5589, 0x0068,
-	0xd08c, 0x0118, 0x080c, 0x5492, 0x0040, 0xd094, 0x0118, 0x080c,
-	0x5462, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005,
-	0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68,
-	0x0006, 0x7094, 0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f,
-	0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0,
-	0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294,
-	0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240,
-	0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7,
-	0x080c, 0x5c46, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140,
-	0x6042, 0x6043, 0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3,
-	0x0000, 0x70db, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7093,
-	0x0000, 0x7087, 0x000f, 0x2009, 0x000f, 0x2011, 0x5b2c, 0x080c,
-	0x80a2, 0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b,
-	0xffff, 0x7084, 0x9005, 0x1528, 0x2011, 0x5b2c, 0x080c, 0x8010,
-	0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8,
-	0x6044, 0xd08c, 0x1168, 0x1f04, 0x5478, 0x6242, 0x7097, 0x0000,
-	0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048,
-	0x6242, 0x7097, 0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5ccf,
-	0x0000, 0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c, 0x0db4, 0x000b,
-	0x0005, 0x549c, 0x54ed, 0x5588, 0x00f6, 0x0016, 0x6900, 0x918c,
-	0x0800, 0x708b, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803,
-	0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04,
-	0x54ab, 0x080c, 0x0db4, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898,
-	0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020,
-	0x080c, 0x5cab, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000,
-	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e,
-	0x20a9, 0x0004, 0x4003, 0x080c, 0x9c26, 0x20e1, 0x0001, 0x2099,
+	0x080c, 0x48c2, 0x701f, 0x51cd, 0x0005, 0x2001, 0x182d, 0x2003,
+	0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9,
+	0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x3337,
+	0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x7984,
+	0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099,
+	0x1984, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199e, 0x0010,
+	0x0804, 0x336c, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8,
+	0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804,
+	0x48c5, 0x7884, 0x908a, 0x1000, 0x1a04, 0x336c, 0x0126, 0x2091,
+	0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x19cb,
+	0x6142, 0x00ce, 0x012e, 0x0804, 0x3337, 0x00c6, 0x080c, 0x6fb2,
+	0x1160, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x9085, 0x0001, 0x080c,
+	0x6ff9, 0x080c, 0x6ee4, 0x080c, 0x0db4, 0x2061, 0x1800, 0x6030,
+	0xc09d, 0x6032, 0x080c, 0x5b90, 0x00ce, 0x0005, 0x00c6, 0x2001,
+	0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3369, 0x7884, 0x9005,
+	0x0188, 0x7888, 0x2061, 0x196d, 0x2c0c, 0x2062, 0x080c, 0x2a45,
+	0x01a0, 0x080c, 0x2a4d, 0x0188, 0x080c, 0x2a55, 0x0170, 0x2162,
+	0x0804, 0x336c, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118,
+	0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002,
+	0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026, 0x2011,
+	0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b, 0x002e,
+	0x080c, 0x9662, 0x0036, 0x901e, 0x080c, 0x96d8, 0x003e, 0x60e3,
+	0x0000, 0x080c, 0xd8b4, 0x080c, 0xd8cf, 0x9085, 0x0001, 0x080c,
+	0x6ff9, 0x9006, 0x080c, 0x2b14, 0x2001, 0x1800, 0x2003, 0x0004,
+	0x6027, 0x0008, 0x00ce, 0x0804, 0x3337, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x3369, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007,
+	0x0804, 0x3369, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x623e,
+	0x1904, 0x336c, 0x9186, 0x007f, 0x0138, 0x080c, 0x6562, 0x0120,
+	0x2009, 0x0009, 0x0804, 0x3369, 0x080c, 0x4879, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x3369, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xbcfd, 0x1120, 0x2009, 0x0003, 0x0804, 0x3369, 0x7007,
+	0x0003, 0x701f, 0x52cc, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120,
+	0x2009, 0x0004, 0x0804, 0x3369, 0xa8e0, 0xa866, 0xa834, 0x8007,
+	0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0xaf60, 0x0804, 0x48c5, 0xa898, 0x9086, 0x000d, 0x1904, 0x3369,
+	0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52f0, 0x0010,
+	0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011,
+	0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4,
+	0x799a, 0xa9a8, 0x799e, 0x080c, 0x48b5, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x7007, 0x0001, 0x2091,
+	0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x00c6, 0x2061, 0x19cb, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000,
+	0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062,
+	0x788c, 0x605e, 0x2001, 0x19d9, 0x2044, 0x2001, 0x19e0, 0xa076,
+	0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000,
+	0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3337, 0x0126, 0x2091,
+	0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c,
+	0xbb64, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004,
+	0x905d, 0x0160, 0x080c, 0x5ceb, 0x080c, 0x9db1, 0x0110, 0xb817,
+	0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085, 0x0001,
+	0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e, 0x20a9,
+	0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180, 0x9186,
+	0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080, 0x0138,
+	0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e, 0x001e,
+	0x8108, 0x1f04, 0x5369, 0x015e, 0x012e, 0x0005, 0x2001, 0x1854,
+	0x2004, 0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006, 0x2001,
+	0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004,
+	0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005,
+	0x0016, 0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a, 0x00ee,
+	0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x336c, 0x810c,
+	0x0016, 0x080c, 0x4879, 0x080c, 0x0ef3, 0x2100, 0x2238, 0x7d84,
+	0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48c2, 0x701f, 0x53c1,
+	0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4,
+	0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071, 0x1894,
+	0x080c, 0x48c5, 0x701f, 0x53d5, 0x0005, 0x2061, 0x18ae, 0x2c44,
+	0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0efb, 0x002e, 0x001e,
+	0x080c, 0x0fa8, 0x9006, 0xa802, 0xa806, 0x0804, 0x3337, 0x0126,
+	0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044,
+	0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x5590, 0x0068, 0xd08c,
+	0x0118, 0x080c, 0x5499, 0x0040, 0xd094, 0x0118, 0x080c, 0x5469,
+	0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016,
+	0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006,
+	0x7094, 0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f, 0x0000,
+	0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130,
+	0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00,
+	0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295,
+	0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c,
+	0x5c4d, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042,
+	0x6043, 0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3, 0x0000,
+	0x70db, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7093, 0x0000,
+	0x7087, 0x000f, 0x2009, 0x000f, 0x2011, 0x5b33, 0x080c, 0x80ca,
+	0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b, 0xffff,
+	0x7084, 0x9005, 0x1528, 0x2011, 0x5b33, 0x080c, 0x8038, 0x6040,
+	0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044,
+	0xd08c, 0x1168, 0x1f04, 0x547f, 0x6242, 0x7097, 0x0000, 0x6040,
+	0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242,
+	0x7097, 0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5cd6, 0x0000,
+	0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c, 0x0db4, 0x000b, 0x0005,
+	0x54a3, 0x54f4, 0x558f, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800,
+	0x708b, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc,
+	0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x54b2,
+	0x080c, 0x0db4, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a,
+	0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c,
+	0x5cb2, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1,
+	0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e, 0x20a9,
+	0x0004, 0x4003, 0x080c, 0x9c3f, 0x20e1, 0x0001, 0x2099, 0x1c00,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3,
+	0x000c, 0x600f, 0x0000, 0x080c, 0x5b64, 0x00fe, 0x9006, 0x708e,
+	0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f, 0x0000,
+	0x9025, 0x0904, 0x556c, 0x6020, 0xd0b4, 0x1904, 0x556a, 0x719c,
+	0x81ff, 0x0904, 0x5558, 0x9486, 0x000c, 0x1904, 0x5565, 0x9480,
+	0x0018, 0x8004, 0x20a8, 0x080c, 0x5cab, 0x2011, 0x0260, 0x2019,
+	0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04,
+	0x5511, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
+	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002, 0x7097,
+	0x0002, 0x2009, 0x07d0, 0x2011, 0x5b3a, 0x080c, 0x80ca, 0x080c,
+	0x5cb2, 0x04c0, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7930, 0x918e,
+	0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff,
+	0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5cab, 0x2011, 0x026e,
+	0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230,
+	0x11a0, 0x8210, 0x8318, 0x1f04, 0x554c, 0x0078, 0x709f, 0x0000,
+	0x080c, 0x5cab, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001,
+	0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043,
+	0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042,
+	0x6020, 0xd0b4, 0x1db8, 0x080c, 0x9c3f, 0x20e1, 0x0001, 0x2099,
 	0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003,
-	0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5b5d, 0x00fe, 0x9006,
-	0x708e, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f,
-	0x0000, 0x9025, 0x0904, 0x5565, 0x6020, 0xd0b4, 0x1904, 0x5563,
-	0x719c, 0x81ff, 0x0904, 0x5551, 0x9486, 0x000c, 0x1904, 0x555e,
-	0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5ca4, 0x2011, 0x0260,
-	0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318,
-	0x1f04, 0x550a, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94,
-	0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002,
-	0x7097, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5b33, 0x080c, 0x80a2,
-	0x080c, 0x5cab, 0x04c0, 0x080c, 0x5ca4, 0x2079, 0x0260, 0x7930,
-	0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c,
-	0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5ca4, 0x2011,
-	0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102,
-	0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x5545, 0x0078, 0x709f,
-	0x0000, 0x080c, 0x5ca4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
-	0x0001, 0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008,
-	0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100,
-	0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0x9c26, 0x20e1, 0x0001,
-	0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014,
-	0x4003, 0x60c3, 0x000c, 0x2011, 0x19c2, 0x2013, 0x0000, 0x708f,
-	0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x938a, 0x08d8,
-	0x0005, 0x7094, 0x908a, 0x001d, 0x1a0c, 0x0db4, 0x000b, 0x0005,
-	0x55ba, 0x55cd, 0x55f6, 0x5616, 0x563c, 0x566b, 0x5691, 0x56c9,
-	0x56ef, 0x571d, 0x5758, 0x5790, 0x57ae, 0x57d9, 0x57fb, 0x5816,
-	0x5820, 0x5854, 0x587a, 0x58a9, 0x58cf, 0x5907, 0x594b, 0x5988,
-	0x59a9, 0x5a02, 0x5a24, 0x5a52, 0x5a52, 0x00c6, 0x2061, 0x1800,
-	0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006,
-	0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
-	0x2061, 0x0100, 0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0,
-	0x2011, 0x5b33, 0x080c, 0x80a2, 0x0005, 0x00f6, 0x708c, 0x9086,
-	0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5ca4,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005,
-	0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
-	0x0001, 0x2011, 0x5b33, 0x080c, 0x8010, 0x7097, 0x0010, 0x080c,
-	0x5820, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x0003, 0x6043, 0x0004, 0x2011, 0x5b33, 0x080c, 0x8010, 0x080c,
-	0x5c28, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9,
-	0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x560b,
-	0x60c3, 0x0014, 0x080c, 0x5b5d, 0x00fe, 0x0005, 0x00f6, 0x708c,
-	0x9005, 0x0500, 0x2011, 0x5b33, 0x080c, 0x8010, 0x9086, 0x0014,
-	0x11b8, 0x080c, 0x5ca4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
-	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
-	0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010,
-	0x080c, 0x5c80, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c,
-	0x5c28, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c,
-	0x5ca4, 0x080c, 0x5c87, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158,
-	0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5ae0, 0x0168,
-	0x080c, 0x5c5d, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
-	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
-	0x5b5d, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
-	0x5b33, 0x080c, 0x8010, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ca4,
+	0x60c3, 0x000c, 0x2011, 0x19c2, 0x2013, 0x0000, 0x708f, 0x0000,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x93a3, 0x08d8, 0x0005,
+	0x7094, 0x908a, 0x001d, 0x1a0c, 0x0db4, 0x000b, 0x0005, 0x55c1,
+	0x55d4, 0x55fd, 0x561d, 0x5643, 0x5672, 0x5698, 0x56d0, 0x56f6,
+	0x5724, 0x575f, 0x5797, 0x57b5, 0x57e0, 0x5802, 0x581d, 0x5827,
+	0x585b, 0x5881, 0x58b0, 0x58d6, 0x590e, 0x5952, 0x598f, 0x59b0,
+	0x5a09, 0x5a2b, 0x5a59, 0x5a59, 0x00c6, 0x2061, 0x1800, 0x6003,
+	0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce,
+	0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061,
+	0x0100, 0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0, 0x2011,
+	0x5b3a, 0x080c, 0x80ca, 0x0005, 0x00f6, 0x708c, 0x9086, 0x0014,
+	0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5cab, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188,
+	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
+	0x2011, 0x5b3a, 0x080c, 0x8038, 0x7097, 0x0010, 0x080c, 0x5827,
+	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0003,
+	0x6043, 0x0004, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x080c, 0x5c2f,
+	0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008,
+	0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5612, 0x60c3,
+	0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x0500, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010, 0x080c,
+	0x5c87, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c, 0x5c2f,
+	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cab,
+	0x080c, 0x5c8e, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186,
+	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x0168, 0x080c,
+	0x5c64, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a,
+	0x080c, 0x8038, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
+	0x7097, 0x0006, 0x0029, 0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0007, 0x080c, 0x5c2f, 0x2079, 0x0240, 0x7833,
+	0x1104, 0x7837, 0x0000, 0x080c, 0x5cab, 0x080c, 0x5c8e, 0x11b8,
+	0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180,
+	0x3138, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
+	0x5ae7, 0x0180, 0x080c, 0x4c98, 0x0110, 0x080c, 0x26cc, 0x20a9,
+	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a, 0x080c, 0x8038,
+	0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0008,
+	0x0029, 0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x0009, 0x080c, 0x5c2f, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837,
+	0x0100, 0x080c, 0x5c8e, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c,
+	0x5a5a, 0x1188, 0x9085, 0x0001, 0x080c, 0x26cc, 0x20a9, 0x0008,
+	0x080c, 0x5cab, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x0010,
+	0x080c, 0x55b4, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x05a8,
+	0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014, 0x1560, 0x080c,
+	0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834,
+	0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x000a,
+	0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
+	0x9005, 0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097, 0x000e,
+	0x080c, 0x5802, 0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0, 0x20a9,
+	0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5c2f, 0x2079, 0x0240,
+	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5c8e, 0x0118, 0x2013,
+	0x0000, 0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040,
+	0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108, 0x9186,
+	0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04,
+	0x5784, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x01c0, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086,
+	0x0084, 0x1178, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c, 0x0029,
+	0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x000d,
+	0x080c, 0x5c2f, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000,
+	0x080c, 0x5cab, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e,
+	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000,
+	0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260,
+	0x1f04, 0x57c8, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3a, 0x080c, 0x8038,
+	0x9086, 0x0084, 0x1198, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001,
+	0x080c, 0x5c01, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c, 0x5c87,
+	0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5cd6, 0x7097, 0x000f,
+	0x708f, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5,
+	0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
+	0x2011, 0x5b3a, 0x080c, 0x802c, 0x0005, 0x708c, 0x9005, 0x0130,
+	0x2011, 0x5b3a, 0x080c, 0x8038, 0x7097, 0x0000, 0x0005, 0x7097,
+	0x0011, 0x080c, 0x9c3f, 0x080c, 0x5cab, 0x20e1, 0x0000, 0x2099,
+	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480, 0x0018,
+	0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c,
+	0x5c8e, 0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c, 0x9084,
+	0x00ff, 0x0160, 0x080c, 0x2663, 0x9186, 0x007e, 0x0138, 0x9186,
+	0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x60c3, 0x0014,
+	0x080c, 0x5b64, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
+	0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab,
 	0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005,
 	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
-	0x0001, 0x7097, 0x0006, 0x0029, 0x0010, 0x080c, 0x5c80, 0x00fe,
-	0x0005, 0x00f6, 0x7097, 0x0007, 0x080c, 0x5c28, 0x2079, 0x0240,
-	0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5ca4, 0x080c, 0x5c87,
-	0x11b8, 0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180,
-	0x9180, 0x3131, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008,
-	0x080c, 0x5ae0, 0x0180, 0x080c, 0x4c91, 0x0110, 0x080c, 0x26cc,
-	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b5d, 0x00fe,
-	0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b33, 0x080c,
-	0x8010, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ca4, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
-	0x0008, 0x0029, 0x0010, 0x080c, 0x5c80, 0x00fe, 0x0005, 0x00f6,
-	0x7097, 0x0009, 0x080c, 0x5c28, 0x2079, 0x0240, 0x7833, 0x1105,
-	0x7837, 0x0100, 0x080c, 0x5c87, 0x1150, 0x7080, 0x9005, 0x1138,
-	0x080c, 0x5a53, 0x1188, 0x9085, 0x0001, 0x080c, 0x26cc, 0x20a9,
-	0x0008, 0x080c, 0x5ca4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b5d,
-	0x0010, 0x080c, 0x55ad, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
-	0x05a8, 0x2011, 0x5b33, 0x080c, 0x8010, 0x9086, 0x0014, 0x1560,
-	0x080c, 0x5ca4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520,
-	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
-	0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128,
-	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097,
-	0x000e, 0x080c, 0x57fb, 0x0010, 0x080c, 0x5c80, 0x00fe, 0x0005,
-	0x00f6, 0x7097, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0,
-	0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5c28, 0x2079,
-	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5c87, 0x0118,
-	0x2013, 0x0000, 0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9,
-	0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108,
-	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
-	0x1f04, 0x577d, 0x60c3, 0x0084, 0x080c, 0x5b5d, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x01c0, 0x2011, 0x5b33, 0x080c, 0x8010,
-	0x9086, 0x0084, 0x1178, 0x080c, 0x5ca4, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c,
-	0x0029, 0x0010, 0x080c, 0x5c80, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x000d, 0x080c, 0x5c28, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837,
-	0x0000, 0x080c, 0x5ca4, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009,
-	0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
-	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
-	0x0260, 0x1f04, 0x57c1, 0x60c3, 0x0084, 0x080c, 0x5b5d, 0x00fe,
-	0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b33, 0x080c,
-	0x8010, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ca4, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093,
-	0x0001, 0x080c, 0x5bfa, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c,
-	0x5c80, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5ccf, 0x7097,
-	0x000f, 0x708f, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f,
-	0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009,
-	0x07d0, 0x2011, 0x5b33, 0x080c, 0x8004, 0x0005, 0x708c, 0x9005,
-	0x0130, 0x2011, 0x5b33, 0x080c, 0x8010, 0x7097, 0x0000, 0x0005,
-	0x7097, 0x0011, 0x080c, 0x9c26, 0x080c, 0x5ca4, 0x20e1, 0x0000,
-	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480,
-	0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003,
-	0x080c, 0x5c87, 0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c,
-	0x9084, 0x00ff, 0x0160, 0x080c, 0x2663, 0x9186, 0x007e, 0x0138,
-	0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5ae0, 0x60c3,
-	0x0014, 0x080c, 0x5b5d, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500,
-	0x2011, 0x5b33, 0x080c, 0x8010, 0x9086, 0x0014, 0x11b8, 0x080c,
-	0x5ca4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
-	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110,
-	0x70c3, 0x0001, 0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000,
-	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0013, 0x080c, 0x5c36, 0x2079,
-	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5ca4, 0x080c,
-	0x5c87, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff,
-	0x0138, 0x2011, 0x0008, 0x080c, 0x5ae0, 0x0168, 0x080c, 0x5c5d,
-	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b5d, 0x00fe,
-	0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b33, 0x080c,
-	0x8010, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ca4, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
-	0x0014, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6,
-	0x7097, 0x0015, 0x080c, 0x5c36, 0x2079, 0x0240, 0x7833, 0x1104,
-	0x7837, 0x0000, 0x080c, 0x5ca4, 0x080c, 0x5c87, 0x11b8, 0x7080,
-	0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x3131,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5ae0,
-	0x0180, 0x080c, 0x4c91, 0x0110, 0x080c, 0x26cc, 0x20a9, 0x0008,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b5d, 0x00fe, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x05f0, 0x2011, 0x5b33, 0x080c, 0x8010, 0x9086,
-	0x0014, 0x15a8, 0x080c, 0x5ca4, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e,
-	0x1168, 0x9085, 0x0001, 0x080c, 0x5ccf, 0x7a38, 0xd2fc, 0x0128,
-	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8,
-	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
-	0x9085, 0x0001, 0x080c, 0x5ccf, 0x7093, 0x0000, 0x7a38, 0xd2f4,
-	0x0110, 0x70db, 0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f,
-	0x0000, 0x00fe, 0x0005, 0x080c, 0x9c26, 0x080c, 0x5ca4, 0x20e1,
-	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
-	0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011,
-	0x024d, 0x2012, 0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c87,
-	0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x5a53, 0x1188, 0x9085,
-	0x0001, 0x080c, 0x26cc, 0x20a9, 0x0008, 0x080c, 0x5ca4, 0x20e1,
+	0x0001, 0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x7097, 0x0013, 0x080c, 0x5c3d, 0x2079, 0x0240,
+	0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cab, 0x080c, 0x5c8e,
+	0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff, 0x0138,
+	0x2011, 0x0008, 0x080c, 0x5ae7, 0x0168, 0x080c, 0x5c64, 0x20a9,
+	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a, 0x080c, 0x8038,
+	0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0014,
+	0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x0015, 0x080c, 0x5c3d, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837,
+	0x0000, 0x080c, 0x5cab, 0x080c, 0x5c8e, 0x11b8, 0x7080, 0x9005,
+	0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x3138, 0x200d,
+	0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x0180,
+	0x080c, 0x4c98, 0x0110, 0x080c, 0x26cc, 0x20a9, 0x0008, 0x20e1,
 	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
-	0x60c3, 0x0014, 0x080c, 0x5b5d, 0x0010, 0x080c, 0x55ad, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x01d8, 0x2011, 0x5b33, 0x080c, 0x8010,
-	0x9086, 0x0084, 0x1190, 0x080c, 0x5ca4, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c,
-	0x5ccf, 0x7097, 0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
-	0x0005, 0x00f6, 0x7097, 0x0019, 0x080c, 0x5c36, 0x2079, 0x0240,
-	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5ca4, 0x2009, 0x026e,
-	0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186,
-	0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04,
-	0x59bc, 0x2039, 0x1c0e, 0x080c, 0x5c87, 0x11e8, 0x2728, 0x2514,
-	0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007,
-	0x9205, 0x202a, 0x705c, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414,
-	0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff,
-	0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e,
-	0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812,
-	0x2009, 0x0240, 0x1f04, 0x59ef, 0x60c3, 0x0084, 0x080c, 0x5b5d,
-	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b33,
-	0x080c, 0x8010, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ca4, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140,
-	0x7093, 0x0001, 0x080c, 0x5bfa, 0x7097, 0x001a, 0x0029, 0x0010,
-	0x708f, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5ccf,
-	0x7097, 0x001b, 0x080c, 0x9c26, 0x080c, 0x5ca4, 0x2011, 0x0260,
-	0x2009, 0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084,
-	0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
-	0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000,
-	0x6816, 0x2011, 0x0260, 0x1f04, 0x5a3b, 0x60c3, 0x0084, 0x080c,
-	0x5b5d, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c,
-	0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c,
-	0x5ca4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008,
-	0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c,
-	0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211,
-	0x1f04, 0x5a6d, 0x0804, 0x5adc, 0x82ff, 0x1160, 0xd5d4, 0x0120,
-	0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5adc,
-	0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110,
-	0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424,
-	0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5a93,
-	0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5aa5,
-	0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007,
-	0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5ab4,
-	0x755a, 0x95c8, 0x3131, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532,
-	0x6536, 0x0016, 0x2508, 0x080c, 0x26ac, 0x001e, 0x60e7, 0x0000,
-	0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008,
-	0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005,
-	0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000,
-	0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003,
-	0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001,
-	0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118,
-	0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001,
-	0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e,
-	0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0,
-	0x3131, 0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016,
-	0x2508, 0x080c, 0x26ac, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083,
-	0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087,
-	0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071,
-	0x0140, 0x080c, 0x5be9, 0x080c, 0x9393, 0x7004, 0x9084, 0x4000,
-	0x0110, 0x080c, 0x2b24, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825,
-	0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c,
-	0x5c46, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42,
-	0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x29ca, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
-	0x2011, 0x19c2, 0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x080c, 0x938a, 0x6144, 0xd184, 0x0120,
-	0x7194, 0x918d, 0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011,
-	0x196a, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5b33, 0x080c, 0x80a2,
-	0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x9d9f, 0x2009, 0x00f7, 0x080c, 0x5c46, 0x2061, 0x19cb, 0x900e,
-	0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001,
-	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x196a,
-	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bb5, 0x080c, 0x8004,
-	0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x9393, 0x2071,
-	0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b24, 0x080c,
-	0x6faf, 0x0188, 0x080c, 0x6fca, 0x1170, 0x080c, 0x7295, 0x0016,
-	0x080c, 0x277b, 0x2001, 0x193e, 0x2102, 0x001e, 0x080c, 0x7290,
-	0x080c, 0x6ed9, 0x0050, 0x2009, 0x0001, 0x080c, 0x2a63, 0x2001,
-	0x0001, 0x080c, 0x260c, 0x080c, 0x5b89, 0x012e, 0x000e, 0x00ee,
-	0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036,
-	0x2011, 0x8017, 0x2001, 0x196a, 0x201c, 0x080c, 0x48d2, 0x003e,
-	0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80,
-	0x080c, 0x5ca4, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9,
-	0x0020, 0x080c, 0x5c9e, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051,
-	0x20a9, 0x000e, 0x080c, 0x5ca1, 0x2099, 0x0260, 0x20a1, 0x1cb2,
-	0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0x5c1e, 0x002e, 0x001e, 0x0005,
-	0x080c, 0x9c26, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x9c26,
-	0x080c, 0x5ca4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006,
-	0x2061, 0x0100, 0x810f, 0x2001, 0x1833, 0x2004, 0x9005, 0x1138,
-	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185,
-	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c,
-	0x6557, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd50a,
-	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e,
-	0x080c, 0x2fa2, 0x080c, 0xc1f9, 0x0140, 0x0036, 0x2019, 0xffff,
-	0x2021, 0x0007, 0x080c, 0x4a6f, 0x003e, 0x004e, 0x001e, 0x0005,
-	0x080c, 0x5b89, 0x7097, 0x0000, 0x708f, 0x0000, 0x0005, 0x0006,
-	0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d,
-	0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001,
-	0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0,
-	0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006,
-	0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079,
-	0x1c00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813,
-	0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e,
-	0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001,
-	0x1977, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005,
-	0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108,
-	0x1f04, 0x5cde, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136,
-	0x0146, 0x2069, 0x1853, 0x9006, 0xb802, 0xb8be, 0xb807, 0x0707,
-	0xb80a, 0xb80e, 0xb812, 0x9198, 0x3131, 0x231d, 0x939c, 0x00ff,
-	0xbb16, 0x0016, 0x0026, 0xb8b2, 0x080c, 0x9d98, 0x1120, 0x9192,
-	0x007e, 0x1208, 0xbbb2, 0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8,
-	0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198,
-	0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e,
-	0xb852, 0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
-	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
-	0xb896, 0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
-	0x0110, 0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
-	0x6810, 0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842,
-	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
-	0x5db4, 0x9182, 0x0800, 0x1a04, 0x5db8, 0x2001, 0x180c, 0x2004,
-	0x9084, 0x0003, 0x1904, 0x5dbe, 0x9188, 0x1000, 0x2104, 0x905d,
-	0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4,
-	0x900d, 0x1904, 0x5dd0, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900,
-	0xb852, 0xb84e, 0x080c, 0x83e6, 0x9006, 0x012e, 0x0005, 0x00a6,
-	0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90,
-	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
-	0x9082, 0x0006, 0x1290, 0x080c, 0x9d98, 0x1160, 0xb8a0, 0x9084,
-	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009,
-	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
-	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
-	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8,
-	0x080c, 0x655b, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5d67,
-	0x080c, 0x63d3, 0x0904, 0x5d80, 0x0804, 0x5d6b, 0x00b6, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e51,
-	0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x5e29, 0xb8a0, 0x9086,
-	0x007f, 0x0178, 0x080c, 0x6563, 0x0160, 0xa994, 0x81ff, 0x0130,
-	0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x655b,
-	0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060,
-	0x0026, 0x2010, 0x080c, 0xbaec, 0x002e, 0x1120, 0x2001, 0x0008,
-	0x0804, 0x5e53, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008,
-	0x0804, 0x5e53, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058,
-	0x080c, 0x9dc3, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b,
-	0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9e93, 0x9006,
-	0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c,
-	0x9d98, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc,
-	0x0900, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028,
-	0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
-	0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029,
-	0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005,
-	0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000,
-	0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8,
-	0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079,
-	0x1800, 0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130,
-	0xaa98, 0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c,
-	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
-	0x0010, 0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e,
-	0x0018, 0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e,
-	0x00be, 0x00fe, 0x0005, 0x5ee8, 0x5ea3, 0x5eba, 0x5ee8, 0x5ee8,
-	0x5ee8, 0x5ee8, 0x5ee8, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c,
-	0x61d7, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5ef0, 0xb814,
-	0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x478c,
-	0x0150, 0x04b0, 0x080c, 0x6237, 0x1598, 0xb810, 0x9306, 0x1580,
-	0xb814, 0x9206, 0x1568, 0x080c, 0x9dc3, 0x0530, 0x2b00, 0x6012,
-	0x080c, 0xbf73, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
-	0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x2fd7, 0x9006, 0x080c,
-	0x6174, 0x2001, 0x0002, 0x080c, 0x6188, 0x2001, 0x0200, 0xb86e,
-	0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0x9e93, 0x9006, 0x0068,
-	0x2001, 0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
-	0x2001, 0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe,
-	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894,
-	0x90c6, 0x0015, 0x0904, 0x60c5, 0x90c6, 0x0056, 0x0904, 0x60c9,
-	0x90c6, 0x0066, 0x0904, 0x60cd, 0x90c6, 0x0067, 0x0904, 0x60d1,
-	0x90c6, 0x0068, 0x0904, 0x60d5, 0x90c6, 0x0071, 0x0904, 0x60d9,
-	0x90c6, 0x0074, 0x0904, 0x60dd, 0x90c6, 0x007c, 0x0904, 0x60e1,
-	0x90c6, 0x007e, 0x0904, 0x60e5, 0x90c6, 0x0037, 0x0904, 0x60e9,
-	0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60c0,
-	0x9182, 0x0800, 0x1a04, 0x60c0, 0x080c, 0x6237, 0x1198, 0xb804,
-	0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f,
-	0x0148, 0x080c, 0x9d98, 0x1904, 0x60a9, 0xb8a0, 0x9084, 0xff80,
-	0x1904, 0x60a9, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e,
-	0x0904, 0x6009, 0x90c6, 0x0064, 0x0904, 0x6032, 0x2008, 0x0804,
-	0x5fcc, 0xa998, 0xa8b0, 0x2040, 0x080c, 0x9d98, 0x1120, 0x9182,
-	0x007f, 0x0a04, 0x5fcc, 0x9186, 0x00ff, 0x0904, 0x5fcc, 0x9182,
-	0x0800, 0x1a04, 0x5fcc, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188,
-	0x787c, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804,
-	0x5fcc, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804,
-	0x5fcc, 0x080c, 0x478c, 0x0904, 0x5fd5, 0x900e, 0x9016, 0x90c6,
-	0x4000, 0x1558, 0x0006, 0x080c, 0x6457, 0x1108, 0xc185, 0xb800,
-	0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006,
-	0x2098, 0x080c, 0x0f68, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a,
-	0x2098, 0x080c, 0x0f68, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110,
-	0x2408, 0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070,
-	0x90c6, 0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001,
-	0x4005, 0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a,
-	0xaa9e, 0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9dc3, 0x1130,
-	0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012,
-	0x080c, 0xbf73, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c,
-	0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2fd7,
-	0x012e, 0x9006, 0x080c, 0x6174, 0x2001, 0x0002, 0x080c, 0x6188,
-	0x2009, 0x0002, 0x080c, 0x9e93, 0xa8b0, 0xd094, 0x0118, 0xb8bc,
-	0xc08d, 0xb8be, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be,
-	0x0005, 0x080c, 0x5393, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998,
-	0xaeb0, 0x080c, 0x6237, 0x1904, 0x5fc7, 0x9186, 0x007f, 0x0130,
-	0x080c, 0x655b, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c,
-	0x0feb, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e,
-	0xa806, 0x080c, 0xbce4, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005,
-	0x0804, 0x5fce, 0xa998, 0xaeb0, 0x080c, 0x6237, 0x1904, 0x5fc7,
-	0x0096, 0x080c, 0x0feb, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804,
-	0x6086, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b,
-	0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0,
-	0xbbb8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0f68, 0x009e, 0xa87b,
-	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c,
-	0x537f, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c,
-	0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x655b, 0x0118, 0xa89b,
-	0x0009, 0x0080, 0x080c, 0x5393, 0x0118, 0xa89b, 0x0007, 0x0050,
-	0x080c, 0xbcc7, 0x1904, 0x6002, 0x2009, 0x0003, 0x2001, 0x4005,
-	0x0804, 0x5fce, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
-	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
-	0x2041, 0x122f, 0x080c, 0xa31b, 0x1904, 0x6002, 0x2009, 0x0002,
-	0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x6003, 0x2009, 0x180c,
-	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118,
-	0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x6003,
-	0x2001, 0x0029, 0x900e, 0x0804, 0x6003, 0x080c, 0x3555, 0x0804,
-	0x6004, 0x080c, 0x50bc, 0x0804, 0x6004, 0x080c, 0x4325, 0x0804,
-	0x6004, 0x080c, 0x439e, 0x0804, 0x6004, 0x080c, 0x43fa, 0x0804,
-	0x6004, 0x080c, 0x4848, 0x0804, 0x6004, 0x080c, 0x4af4, 0x0804,
-	0x6004, 0x080c, 0x4d27, 0x0804, 0x6004, 0x080c, 0x4f20, 0x0804,
-	0x6004, 0x080c, 0x3765, 0x0804, 0x6004, 0x00b6, 0xa974, 0xae78,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268,
-	0x9188, 0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x655b, 0x1148,
-	0x00e9, 0x080c, 0x6362, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
-	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001,
-	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802,
-	0x009e, 0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852,
-	0xb84e, 0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c,
-	0x9005, 0x0170, 0x00e6, 0x2071, 0x19b8, 0x7004, 0x9086, 0x0002,
-	0x0168, 0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005,
-	0x2900, 0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06,
-	0x1d80, 0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002,
-	0x00ae, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c,
-	0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905,
-	0x012e, 0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108,
-	0xb852, 0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026,
-	0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285,
-	0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005,
-	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04,
-	0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c,
-	0x6557, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110,
-	0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006,
-	0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0db4, 0x000e,
-	0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091,
-	0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168,
-	0xb89c, 0xd0a4, 0x0150, 0x080c, 0x6553, 0x1138, 0x9284, 0x00ff,
-	0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff,
-	0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182,
-	0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190,
-	0x1000, 0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x0feb, 0x2958,
-	0x009e, 0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860, 0xb8b6,
-	0x9006, 0xb8a6, 0x080c, 0x5ce4, 0x9006, 0x0010, 0x9085, 0x0001,
-	0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000,
-	0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6,
-	0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4,
-	0x904d, 0x0110, 0x080c, 0x101d, 0x00d6, 0x00c6, 0xb8ac, 0x2060,
-	0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xbafe,
-	0x0110, 0x080c, 0x0f9d, 0x080c, 0x9e19, 0x00ce, 0x0c88, 0x00ce,
-	0x00de, 0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c, 0x102d,
-	0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016,
-	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000,
-	0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156,
-	0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802,
-	0x080c, 0x6fa7, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c,
-	0x9d98, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061,
-	0x1953, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054,
-	0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001,
-	0x0001, 0x6886, 0x2069, 0x1800, 0x68b2, 0x7040, 0xb85e, 0x7048,
-	0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8b4,
-	0x20e8, 0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003,
-	0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003,
-	0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e,
-	0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000,
-	0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211,
-	0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009,
-	0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0,
-	0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421,
-	0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009,
-	0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e,
-	0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034,
-	0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbbc, 0xc384,
-	0xba00, 0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110,
-	0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd,
-	0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02,
-	0xbbbe, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126,
-	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0,
-	0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6,
-	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
-	0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002,
-	0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0db4, 0x3c00,
-	0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de,
-	0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0feb, 0x0170, 0x2900,
-	0xb8a6, 0xa803, 0x0000, 0x080c, 0x63f3, 0xa807, 0x0001, 0xae12,
-	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126,
-	0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005,
-	0x1150, 0x080c, 0x6402, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218,
-	0x8001, 0xa806, 0x0020, 0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e,
-	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x83e6, 0x012e,
-	0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091,
-	0x8000, 0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500,
-	0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406,
-	0x1118, 0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70,
-	0x080c, 0x9797, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020,
-	0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff,
-	0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005,
-	0x080c, 0x6457, 0x0128, 0x080c, 0xbbbb, 0x0010, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x6457, 0x0128, 0x080c, 0xbb60, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x6457, 0x0128, 0x080c, 0xbbb8, 0x0010,
-	0x9085, 0x0001, 0x0005, 0x080c, 0x6457, 0x0128, 0x080c, 0xbb7f,
-	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6457, 0x0128, 0x080c,
-	0xbbfc, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118,
-	0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
-	0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
-	0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002,
-	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104,
-	0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
+	0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x05f0, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014,
+	0x15a8, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
+	0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168,
+	0x9085, 0x0001, 0x080c, 0x5cd6, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
+	0x9005, 0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x9085,
+	0x0001, 0x080c, 0x5cd6, 0x7093, 0x0000, 0x7a38, 0xd2f4, 0x0110,
+	0x70db, 0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f, 0x0000,
+	0x00fe, 0x0005, 0x080c, 0x9c3f, 0x080c, 0x5cab, 0x20e1, 0x0000,
+	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e,
+	0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d,
+	0x2012, 0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c8e, 0x1150,
+	0x7080, 0x9005, 0x1138, 0x080c, 0x5a5a, 0x1188, 0x9085, 0x0001,
+	0x080c, 0x26cc, 0x20a9, 0x0008, 0x080c, 0x5cab, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x5b64, 0x0010, 0x080c, 0x55b4, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x01d8, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086,
+	0x0084, 0x1190, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5cd6,
+	0x7097, 0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0019, 0x080c, 0x5c3d, 0x2079, 0x0240, 0x7833,
+	0x1106, 0x7837, 0x0000, 0x080c, 0x5cab, 0x2009, 0x026e, 0x2039,
+	0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280,
+	0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x59c3,
+	0x2039, 0x1c0e, 0x080c, 0x5c8e, 0x11e8, 0x2728, 0x2514, 0x8207,
+	0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205,
+	0x202a, 0x705c, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414, 0x938c,
+	0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007,
+	0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738,
+	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
+	0x0240, 0x1f04, 0x59f6, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3a, 0x080c,
+	0x8038, 0x9086, 0x0084, 0x1198, 0x080c, 0x5cab, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093,
+	0x0001, 0x080c, 0x5c01, 0x7097, 0x001a, 0x0029, 0x0010, 0x708f,
+	0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5cd6, 0x7097,
+	0x001b, 0x080c, 0x9c3f, 0x080c, 0x5cab, 0x2011, 0x0260, 0x2009,
+	0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
+	0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
+	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
+	0x2011, 0x0260, 0x1f04, 0x5a42, 0x60c3, 0x0084, 0x080c, 0x5b64,
+	0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c, 0x20a9,
+	0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5cab,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011,
+	0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6,
+	0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04,
+	0x5a74, 0x0804, 0x5ae3, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6,
+	0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5ae3, 0x918d,
+	0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019,
+	0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240,
+	0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5a9a, 0x04d8,
+	0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5aac, 0x2328,
+	0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200,
+	0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5abb, 0x755a,
+	0x95c8, 0x3138, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536,
+	0x0016, 0x2508, 0x080c, 0x26ac, 0x001e, 0x60e7, 0x0000, 0x65ea,
+	0x2018, 0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e,
+	0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007,
+	0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff,
+	0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff,
+	0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528,
+	0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0, 0x3138,
+	0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016, 0x2508,
+	0x080c, 0x26ac, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083, 0x0001,
+	0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087, 0x0000,
+	0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140,
+	0x080c, 0x5bf0, 0x080c, 0x93ac, 0x7004, 0x9084, 0x4000, 0x0110,
+	0x080c, 0x2b24, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825, 0x2073,
+	0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5c4d,
+	0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e,
+	0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x29ca, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011,
+	0x19c2, 0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3, 0x0056,
+	0x60a7, 0x9575, 0x080c, 0x93a3, 0x6144, 0xd184, 0x0120, 0x7194,
+	0x918d, 0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011, 0x196a,
+	0x2112, 0x2009, 0x07d0, 0x2011, 0x5b3a, 0x080c, 0x80ca, 0x0005,
+	0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9db8,
+	0x2009, 0x00f7, 0x080c, 0x5c4d, 0x2061, 0x19cb, 0x900e, 0x611a,
+	0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061,
+	0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x196a, 0x200b,
+	0x0000, 0x2009, 0x002d, 0x2011, 0x5bbc, 0x080c, 0x802c, 0x012e,
+	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x93ac, 0x2071, 0x0140,
+	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b24, 0x080c, 0x6fba,
+	0x0188, 0x080c, 0x6fd5, 0x1170, 0x080c, 0x72a0, 0x0016, 0x080c,
+	0x277b, 0x2001, 0x193e, 0x2102, 0x001e, 0x080c, 0x729b, 0x080c,
+	0x6ee4, 0x0050, 0x2009, 0x0001, 0x080c, 0x2a63, 0x2001, 0x0001,
+	0x080c, 0x260c, 0x080c, 0x5b90, 0x012e, 0x000e, 0x00ee, 0x0005,
+	0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011,
+	0x8017, 0x2001, 0x196a, 0x201c, 0x080c, 0x48d9, 0x003e, 0x002e,
+	0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x080c,
+	0x5cab, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020,
+	0x080c, 0x5ca5, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051, 0x20a9,
+	0x000e, 0x080c, 0x5ca8, 0x2099, 0x0260, 0x20a1, 0x1cb2, 0x0009,
+	0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012,
+	0x8108, 0x8210, 0x1f04, 0x5c25, 0x002e, 0x001e, 0x0005, 0x080c,
+	0x9c3f, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x9c3f, 0x080c,
+	0x5cab, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061,
+	0x0100, 0x810f, 0x2001, 0x1833, 0x2004, 0x9005, 0x1138, 0x2001,
+	0x1817, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7,
+	0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x655e,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd52a, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c,
+	0x2fa5, 0x080c, 0xc212, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021,
+	0x0007, 0x080c, 0x4a76, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c,
+	0x5b90, 0x7097, 0x0000, 0x708f, 0x0000, 0x0005, 0x0006, 0x2001,
+	0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006,
+	0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0020,
+	0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0, 0x910d,
+	0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9,
+	0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079, 0x1c00,
+	0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138,
+	0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe,
+	0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x1977,
+	0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156,
+	0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04,
+	0x5ce5, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
+	0x2069, 0x1853, 0x9006, 0xb802, 0xb8be, 0xb807, 0x0707, 0xb80a,
+	0xb80e, 0xb812, 0x9198, 0x3138, 0x231d, 0x939c, 0x00ff, 0xbb16,
+	0x0016, 0x0026, 0xb8b2, 0x080c, 0x9db1, 0x1120, 0x9192, 0x007e,
+	0x1208, 0xbbb2, 0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8, 0x9198,
+	0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a,
+	0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e, 0xb852,
+	0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100,
+	0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896,
+	0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110,
+	0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810,
+	0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e,
+	0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x5dbb,
+	0x9182, 0x0800, 0x1a04, 0x5dbf, 0x2001, 0x180c, 0x2004, 0x9084,
+	0x0003, 0x1904, 0x5dc5, 0x9188, 0x1000, 0x2104, 0x905d, 0x0518,
+	0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4, 0x900d,
+	0x1904, 0x5dd7, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900, 0xb852,
+	0xb84e, 0x080c, 0x840e, 0x9006, 0x012e, 0x0005, 0x00a6, 0x2150,
+	0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90, 0x2001,
+	0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082,
+	0x0006, 0x1290, 0x080c, 0x9db1, 0x1160, 0xb8a0, 0x9084, 0xff80,
+	0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009, 0x1000,
+	0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009, 0x1000,
+	0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c, 0x2004,
+	0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8, 0x080c,
+	0x6562, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5d6e, 0x080c,
+	0x63da, 0x0904, 0x5d87, 0x0804, 0x5d72, 0x00b6, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e58, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0904, 0x5e30, 0xb8a0, 0x9086, 0x007f,
+	0x0178, 0x080c, 0x656a, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e,
+	0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6562, 0x1598,
+	0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026,
+	0x2010, 0x080c, 0xbb05, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804,
+	0x5e5a, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804,
+	0x5e5a, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c,
+	0x9ddc, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff,
+	0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9eac, 0x9006, 0x0458,
+	0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0x9db1,
+	0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900,
+	0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050,
+	0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010,
+	0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001,
+	0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0,
+	0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005,
+	0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800,
+	0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98,
+	0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118,
+	0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010,
+	0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be,
+	0x00fe, 0x0005, 0x5eef, 0x5eaa, 0x5ec1, 0x5eef, 0x5eef, 0x5eef,
+	0x5eef, 0x5eef, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x61de,
+	0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5ef7, 0xb814, 0x9206,
+	0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x4793, 0x0150,
+	0x04b0, 0x080c, 0x623e, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814,
+	0x9206, 0x1568, 0x080c, 0x9ddc, 0x0530, 0x2b00, 0x6012, 0x080c,
+	0xbf8c, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878,
+	0x9086, 0x0001, 0x1170, 0x080c, 0x2fda, 0x9006, 0x080c, 0x617b,
+	0x2001, 0x0002, 0x080c, 0x618f, 0x2001, 0x0200, 0xb86e, 0xb893,
+	0x0002, 0x2009, 0x0003, 0x080c, 0x9eac, 0x9006, 0x0068, 0x2001,
+	0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
+	0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005,
+	0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6,
+	0x0015, 0x0904, 0x60cc, 0x90c6, 0x0056, 0x0904, 0x60d0, 0x90c6,
+	0x0066, 0x0904, 0x60d4, 0x90c6, 0x0067, 0x0904, 0x60d8, 0x90c6,
+	0x0068, 0x0904, 0x60dc, 0x90c6, 0x0071, 0x0904, 0x60e0, 0x90c6,
+	0x0074, 0x0904, 0x60e4, 0x90c6, 0x007c, 0x0904, 0x60e8, 0x90c6,
+	0x007e, 0x0904, 0x60ec, 0x90c6, 0x0037, 0x0904, 0x60f0, 0x9016,
+	0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60c7, 0x9182,
+	0x0800, 0x1a04, 0x60c7, 0x080c, 0x623e, 0x1198, 0xb804, 0x9084,
+	0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148,
+	0x080c, 0x9db1, 0x1904, 0x60b0, 0xb8a0, 0x9084, 0xff80, 0x1904,
+	0x60b0, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904,
+	0x6010, 0x90c6, 0x0064, 0x0904, 0x6039, 0x2008, 0x0804, 0x5fd3,
+	0xa998, 0xa8b0, 0x2040, 0x080c, 0x9db1, 0x1120, 0x9182, 0x007f,
+	0x0a04, 0x5fd3, 0x9186, 0x00ff, 0x0904, 0x5fd3, 0x9182, 0x0800,
+	0x1a04, 0x5fd3, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188, 0x787c,
+	0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x5fd3,
+	0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x5fd3,
+	0x080c, 0x4793, 0x0904, 0x5fdc, 0x900e, 0x9016, 0x90c6, 0x4000,
+	0x1558, 0x0006, 0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f68, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
+	0x080c, 0x0f68, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408,
+	0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6,
+	0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005,
+	0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e,
+	0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9ddc, 0x1130, 0x2001,
+	0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c,
+	0xbf8c, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108,
+	0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2fda, 0x012e,
+	0x9006, 0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f, 0x2009,
+	0x0002, 0x080c, 0x9eac, 0xa8b0, 0xd094, 0x0118, 0xb8bc, 0xc08d,
+	0xb8be, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005,
+	0x080c, 0x539a, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0,
+	0x080c, 0x623e, 0x1904, 0x5fce, 0x9186, 0x007f, 0x0130, 0x080c,
+	0x6562, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x0feb,
+	0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806,
+	0x080c, 0xbcfd, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
+	0x5fd5, 0xa998, 0xaeb0, 0x080c, 0x623e, 0x1904, 0x5fce, 0x0096,
+	0x080c, 0x0feb, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x608d,
+	0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8b4,
+	0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbb8,
+	0x9398, 0x0006, 0x2398, 0x080c, 0x0f68, 0x009e, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x5386,
+	0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118,
+	0xa89b, 0x000c, 0x00b0, 0x080c, 0x6562, 0x0118, 0xa89b, 0x0009,
+	0x0080, 0x080c, 0x539a, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c,
+	0xbce0, 0x1904, 0x6009, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
+	0x5fd5, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
+	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x122f, 0x080c, 0xa334, 0x1904, 0x6009, 0x2009, 0x0002, 0x08e8,
+	0x2001, 0x0028, 0x900e, 0x0804, 0x600a, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x600a, 0x2001,
+	0x0029, 0x900e, 0x0804, 0x600a, 0x080c, 0x355c, 0x0804, 0x600b,
+	0x080c, 0x50c3, 0x0804, 0x600b, 0x080c, 0x432c, 0x0804, 0x600b,
+	0x080c, 0x43a5, 0x0804, 0x600b, 0x080c, 0x4401, 0x0804, 0x600b,
+	0x080c, 0x484f, 0x0804, 0x600b, 0x080c, 0x4afb, 0x0804, 0x600b,
+	0x080c, 0x4d2e, 0x0804, 0x600b, 0x080c, 0x4f27, 0x0804, 0x600b,
+	0x080c, 0x376c, 0x0804, 0x600b, 0x00b6, 0xa974, 0xae78, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x6562, 0x1148, 0x00e9,
+	0x080c, 0x6369, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090,
+	0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001, 0x0029,
+	0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802, 0x009e,
+	0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852, 0xb84e,
+	0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c, 0x9005,
+	0x0170, 0x00e6, 0x2071, 0x19b8, 0x7004, 0x9086, 0x0002, 0x0168,
+	0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005, 0x2900,
+	0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06, 0x1d80,
+	0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002, 0x00ae,
+	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c, 0x904d,
+	0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905, 0x012e,
+	0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852,
+	0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008,
+	0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6,
+	0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006,
+	0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x655e,
+	0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011,
+	0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086,
+	0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0db4, 0x000e, 0x00ce,
+	0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
+	0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c,
+	0xd0a4, 0x0150, 0x080c, 0x655a, 0x1138, 0x9284, 0x00ff, 0x9086,
+	0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007,
+	0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800,
+	0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000,
+	0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x0feb, 0x2958, 0x009e,
+	0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860, 0xb8b6, 0x9006,
+	0xb8a6, 0x080c, 0x5ceb, 0x9006, 0x0010, 0x9085, 0x0001, 0x002e,
+	0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000, 0x0026,
+	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6, 0x9190,
+	0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d,
+	0x0110, 0x080c, 0x101d, 0x00d6, 0x00c6, 0xb8ac, 0x2060, 0x8cff,
+	0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xbb17, 0x0110,
+	0x080c, 0x0f9d, 0x080c, 0x9e32, 0x00ce, 0x0c88, 0x00ce, 0x00de,
+	0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c, 0x102d, 0x00de,
+	0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016, 0x9182,
+	0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136,
+	0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c,
+	0x6fb2, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0x9db1,
+	0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1953,
+	0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e,
+	0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001,
+	0x6886, 0x2069, 0x1800, 0x68b2, 0x7040, 0xb85e, 0x7048, 0xb862,
+	0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8b4, 0x20e8,
+	0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099,
+	0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069,
+	0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048,
+	0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0,
+	0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211, 0x1218,
+	0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009, 0x0007,
+	0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0x9182,
+	0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421, 0x1218,
+	0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009, 0x0003,
+	0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e, 0x00de,
+	0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034, 0xb896,
+	0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbbc, 0xc384, 0xba00,
+	0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad,
+	0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc,
+	0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbbe,
+	0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04,
+	0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906,
+	0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080,
+	0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002, 0x9086,
+	0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0db4, 0x3c00, 0x20e8,
+	0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x0060, 0x080c, 0x0feb, 0x0170, 0x2900, 0xb8a6,
+	0xa803, 0x0000, 0x080c, 0x63fa, 0xa807, 0x0001, 0xae12, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091,
+	0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150,
+	0x080c, 0x6409, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001,
+	0xa806, 0x0020, 0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e, 0x012e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x840e, 0x012e, 0x0005,
+	0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091, 0x8000,
+	0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500, 0x83ff,
+	0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70, 0x080c,
+	0x97b0, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020, 0x00a6,
+	0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff, 0x012e,
+	0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c,
+	0x645e, 0x0128, 0x080c, 0xbbd4, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x645e, 0x0128, 0x080c, 0xbb79, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x645e, 0x0128, 0x080c, 0xbbd1, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x645e, 0x0128, 0x080c, 0xbb98, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x645e, 0x0128, 0x080c, 0xbc15,
+	0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085,
+	0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
 	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
 	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
-	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6,
-	0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004,
-	0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126,
-	0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0feb, 0x0168,
-	0x2900, 0xb8a6, 0x080c, 0x63f3, 0xa803, 0x0001, 0xa807, 0x0000,
-	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000,
-	0x080c, 0x101d, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c,
-	0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x6fa7, 0x01b0, 0x71c0,
-	0x81ff, 0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080,
-	0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804,
-	0x00d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6237,
-	0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118,
-	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108,
-	0x1f04, 0x647d, 0x015e, 0x080c, 0x6519, 0x0120, 0x2001, 0x1956,
-	0x200c, 0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0,
-	0x2011, 0x64a7, 0x080c, 0x80a2, 0x00fe, 0x00be, 0x0005, 0x00b6,
-	0x2011, 0x64a7, 0x080c, 0x8010, 0x080c, 0x6519, 0x01d8, 0x2001,
-	0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6557,
-	0x0130, 0x2009, 0x07d0, 0x2011, 0x64a7, 0x080c, 0x80a2, 0x00e6,
-	0x2071, 0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2dbb,
-	0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016,
-	0x080c, 0x6237, 0x1538, 0xb800, 0xd0ec, 0x0520, 0x0046, 0xbaa0,
-	0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xd50a, 0xb800, 0xc0e5,
-	0xc0ec, 0xb802, 0x080c, 0x6553, 0x2001, 0x0707, 0x1128, 0xb804,
-	0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019, 0x0029, 0x080c,
-	0x8549, 0x0076, 0x903e, 0x080c, 0x8441, 0x900e, 0x080c, 0xd27b,
-	0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x64cf, 0x00ce, 0x015e,
-	0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800, 0xc0ec, 0xb802,
-	0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ac,
-	0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be, 0xd0bc,
-	0x0005, 0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110,
-	0xb800, 0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091,
-	0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c,
-	0x0db4, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc,
-	0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1836, 0x2204, 0xd0cc,
-	0x0138, 0x2001, 0x1954, 0x200c, 0x2011, 0x6549, 0x080c, 0x80a2,
-	0x0005, 0x2011, 0x6549, 0x080c, 0x8010, 0x2011, 0x1836, 0x2204,
-	0xc0cc, 0x2012, 0x0005, 0x080c, 0x537f, 0xd0ac, 0x0005, 0x080c,
-	0x537f, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e,
-	0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007,
-	0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xc1f9,
-	0x0158, 0x70d8, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004,
-	0x905d, 0x0110, 0xb8bc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x0006,
-	0x0016, 0x0036, 0x0046, 0x0076, 0x00b6, 0x2001, 0x1817, 0x203c,
-	0x9780, 0x3131, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2018,
-	0x2008, 0x9284, 0x8000, 0x0110, 0x2019, 0x0001, 0x9294, 0x7fff,
-	0x2100, 0x9706, 0x0190, 0x91a0, 0x1000, 0x2404, 0x905d, 0x0168,
-	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1138, 0x83ff, 0x0118,
-	0xb89c, 0xd0a4, 0x0110, 0x8211, 0x0158, 0x8108, 0x83ff, 0x0120,
-	0x9182, 0x0800, 0x0e28, 0x0068, 0x9182, 0x007e, 0x0e08, 0x0048,
-	0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9085, 0x0001, 0x000e,
-	0x0005, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9006, 0x000e,
-	0x0005, 0x0046, 0x0056, 0x0076, 0x00b6, 0x2100, 0x9084, 0x7fff,
-	0x9080, 0x1000, 0x2004, 0x905d, 0x0130, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x0550, 0x9184, 0x8000, 0x0580, 0x2001, 0x1817,
-	0x203c, 0x9780, 0x3131, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006,
-	0x2020, 0x2400, 0x9706, 0x01a0, 0x94a8, 0x1000, 0x2504, 0x905d,
-	0x0178, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1148, 0xb89c,
-	0xd0a4, 0x0130, 0xb814, 0x9206, 0x1118, 0xb810, 0x9306, 0x0128,
-	0x8420, 0x9482, 0x0800, 0x0e28, 0x0048, 0x918c, 0x7fff, 0x00be,
-	0x007e, 0x005e, 0x004e, 0x9085, 0x0001, 0x0005, 0x918c, 0x7fff,
-	0x00be, 0x007e, 0x005e, 0x004e, 0x9006, 0x0005, 0x2071, 0x1906,
-	0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a,
-	0x701e, 0x700a, 0x7046, 0x2001, 0x1919, 0x2003, 0x0000, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0x191a, 0x900e, 0x710a, 0x080c, 0x537f,
-	0xd0fc, 0x1140, 0x080c, 0x537f, 0x900e, 0xd09c, 0x0108, 0x8108,
-	0x7102, 0x0400, 0x2001, 0x1873, 0x200c, 0x9184, 0x0007, 0x9006,
-	0x0002, 0x6632, 0x6632, 0x6632, 0x6632, 0x6632, 0x6649, 0x6657,
-	0x6632, 0x7003, 0x0003, 0x2009, 0x1874, 0x210c, 0x9184, 0xff00,
-	0x8007, 0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003,
-	0x0005, 0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050,
-	0x684c, 0x9005, 0x1150, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc085,
-	0x702a, 0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158,
-	0x080c, 0x72fd, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006,
-	0x9006, 0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868,
-	0x700a, 0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016,
-	0x684c, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019,
-	0x702b, 0x0001, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc084, 0x702a,
-	0x7007, 0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005,
-	0xa868, 0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001, 0x191a, 0x2004,
-	0x9005, 0x0904, 0x688a, 0xa87c, 0xd0bc, 0x1904, 0x688a, 0xa978,
-	0xa874, 0x9105, 0x1904, 0x688a, 0x2001, 0x191a, 0x2004, 0x0002,
-	0x688a, 0x66e3, 0x671f, 0x671f, 0x688a, 0x671f, 0x0005, 0xa868,
-	0xd0fc, 0x1500, 0x00e6, 0x0026, 0x2009, 0x191a, 0x210c, 0x81ff,
-	0x0904, 0x688a, 0xa87c, 0xd0cc, 0x0904, 0x688a, 0xa880, 0x9084,
-	0x00ff, 0x9086, 0x0001, 0x1904, 0x688a, 0x9186, 0x0003, 0x0904,
-	0x671f, 0x9186, 0x0005, 0x0904, 0x671f, 0xa84f, 0x8021, 0xa853,
-	0x0017, 0x0028, 0x0005, 0xa84f, 0x8020, 0xa853, 0x0016, 0x2071,
-	0x1906, 0x701c, 0x9005, 0x1904, 0x6a4a, 0x0e04, 0x6a95, 0x2071,
-	0x0000, 0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036,
-	0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x1187, 0x2071, 0x1800, 0x2011, 0x0001, 0xa804, 0x900d,
-	0x702c, 0x1158, 0xa802, 0x2900, 0x702e, 0x70bc, 0x9200, 0x70be,
-	0x080c, 0x7f35, 0x002e, 0x00ee, 0x0005, 0x0096, 0x2148, 0xa904,
-	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f,
-	0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1906, 0xa803, 0x0000,
-	0x7010, 0x9005, 0x1904, 0x680e, 0x782c, 0x908c, 0x0780, 0x190c,
-	0x6bbc, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x673d,
-	0x680e, 0x6762, 0x67a9, 0x080c, 0x0db4, 0x2071, 0x1800, 0x2900,
-	0x7822, 0xa804, 0x900d, 0x1170, 0x2071, 0x19cb, 0x703c, 0x9005,
-	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
-	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x7f35, 0x0c10, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x1580, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148,
-	0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022, 0x00ee,
-	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
-	0x8000, 0x70be, 0x080c, 0x7f35, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6bbc, 0xd0a4, 0x19f0, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328,
-	0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f35,
-	0x0800, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f35,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x1d60, 0x00ee,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd09c, 0x11a0, 0x009e,
-	0x2900, 0x7822, 0xa804, 0x900d, 0x1560, 0x2071, 0x19cb, 0x703c,
-	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012,
-	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
+	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce,
+	0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de,
+	0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e,
+	0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004,
+	0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128,
+	0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300,
+	0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de,
+	0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0feb, 0x0168, 0x2900,
+	0xb8a6, 0x080c, 0x63fa, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c,
+	0x101d, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4,
+	0x0005, 0x00b6, 0x00f6, 0x080c, 0x6fb2, 0x01b0, 0x71c0, 0x81ff,
+	0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000,
+	0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804, 0x00d0,
+	0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x623e, 0x1168,
+	0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086,
+	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04,
+	0x6484, 0x015e, 0x080c, 0x6520, 0x0120, 0x2001, 0x1956, 0x200c,
+	0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0, 0x2011,
+	0x64ae, 0x080c, 0x80ca, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011,
+	0x64ae, 0x080c, 0x8038, 0x080c, 0x6520, 0x01d8, 0x2001, 0x107e,
+	0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x655e, 0x0130,
+	0x2009, 0x07d0, 0x2011, 0x64ae, 0x080c, 0x80ca, 0x00e6, 0x2071,
+	0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2dbb, 0x00ee,
+	0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x623e, 0x1538, 0xb800, 0xd0ec, 0x0520, 0x0046, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x0029, 0x080c, 0xd52a, 0xb800, 0xc0e5, 0xc0ec,
+	0xb802, 0x080c, 0x655a, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084,
+	0x00ff, 0x9085, 0x0700, 0xb806, 0x2019, 0x0029, 0x080c, 0x8571,
+	0x0076, 0x903e, 0x080c, 0x8469, 0x900e, 0x080c, 0xd29b, 0x007e,
+	0x004e, 0x001e, 0x8108, 0x1f04, 0x64d6, 0x00ce, 0x015e, 0x00be,
+	0x0005, 0x00b6, 0x6010, 0x2058, 0xb800, 0xc0ec, 0xb802, 0x00be,
+	0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ac, 0x0005,
+	0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be, 0xd0bc, 0x0005,
+	0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110, 0xb800,
+	0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000,
+	0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0db4,
+	0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02,
+	0x002e, 0x012e, 0x0005, 0x2011, 0x1836, 0x2204, 0xd0cc, 0x0138,
+	0x2001, 0x1954, 0x200c, 0x2011, 0x6550, 0x080c, 0x80ca, 0x0005,
+	0x2011, 0x6550, 0x080c, 0x8038, 0x2011, 0x1836, 0x2204, 0xc0cc,
+	0x2012, 0x0005, 0x080c, 0x5386, 0xd0ac, 0x0005, 0x080c, 0x5386,
+	0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006,
+	0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e,
+	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xc212, 0x0158,
+	0x70d8, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d,
+	0x0110, 0xb8bc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x0006, 0x0016,
+	0x0036, 0x0046, 0x0076, 0x00b6, 0x2001, 0x1817, 0x203c, 0x9780,
+	0x3138, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2018, 0x2008,
+	0x9284, 0x8000, 0x0110, 0x2019, 0x0001, 0x9294, 0x7fff, 0x2100,
+	0x9706, 0x0190, 0x91a0, 0x1000, 0x2404, 0x905d, 0x0168, 0xb804,
+	0x9084, 0x00ff, 0x9086, 0x0006, 0x1138, 0x83ff, 0x0118, 0xb89c,
+	0xd0a4, 0x0110, 0x8211, 0x0158, 0x8108, 0x83ff, 0x0120, 0x9182,
+	0x0800, 0x0e28, 0x0068, 0x9182, 0x007e, 0x0e08, 0x0048, 0x00be,
+	0x007e, 0x004e, 0x003e, 0x001e, 0x9085, 0x0001, 0x000e, 0x0005,
+	0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9006, 0x000e, 0x0005,
+	0x0046, 0x0056, 0x0076, 0x00b6, 0x2100, 0x9084, 0x7fff, 0x9080,
+	0x1000, 0x2004, 0x905d, 0x0130, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x0550, 0x9184, 0x8000, 0x0580, 0x2001, 0x1817, 0x203c,
+	0x9780, 0x3138, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2020,
+	0x2400, 0x9706, 0x01a0, 0x94a8, 0x1000, 0x2504, 0x905d, 0x0178,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1148, 0xb89c, 0xd0a4,
+	0x0130, 0xb814, 0x9206, 0x1118, 0xb810, 0x9306, 0x0128, 0x8420,
+	0x9482, 0x0800, 0x0e28, 0x0048, 0x918c, 0x7fff, 0x00be, 0x007e,
+	0x005e, 0x004e, 0x9085, 0x0001, 0x0005, 0x918c, 0x7fff, 0x00be,
+	0x007e, 0x005e, 0x004e, 0x9006, 0x0005, 0x2071, 0x1906, 0x7003,
+	0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a, 0x701e,
+	0x700a, 0x7046, 0x2001, 0x1919, 0x2003, 0x0000, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x191a, 0x900e, 0x710a, 0x080c, 0x5386, 0xd0fc,
+	0x1140, 0x080c, 0x5386, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102,
+	0x0400, 0x2001, 0x1873, 0x200c, 0x9184, 0x0007, 0x9006, 0x0002,
+	0x6639, 0x6639, 0x6639, 0x6639, 0x6639, 0x6650, 0x665e, 0x6639,
+	0x7003, 0x0003, 0x2009, 0x1874, 0x210c, 0x9184, 0xff00, 0x8007,
+	0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005,
+	0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c,
+	0x9005, 0x1150, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc085, 0x702a,
+	0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c,
+	0x7308, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006,
+	0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868, 0x700a,
+	0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016, 0x684c,
+	0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b,
+	0x0001, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc084, 0x702a, 0x7007,
+	0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868,
+	0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001, 0x191a, 0x2004, 0x9005,
+	0x0904, 0x6891, 0xa87c, 0xd0bc, 0x1904, 0x6891, 0xa978, 0xa874,
+	0x9105, 0x1904, 0x6891, 0x2001, 0x191a, 0x2004, 0x0002, 0x6891,
+	0x66ea, 0x6726, 0x6726, 0x6891, 0x6726, 0x0005, 0xa868, 0xd0fc,
+	0x1500, 0x00e6, 0x0026, 0x2009, 0x191a, 0x210c, 0x81ff, 0x0904,
+	0x6891, 0xa87c, 0xd0cc, 0x0904, 0x6891, 0xa880, 0x9084, 0x00ff,
+	0x9086, 0x0001, 0x1904, 0x6891, 0x9186, 0x0003, 0x0904, 0x6726,
+	0x9186, 0x0005, 0x0904, 0x6726, 0xa84f, 0x8021, 0xa853, 0x0017,
+	0x0028, 0x0005, 0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1906,
+	0x701c, 0x9005, 0x1904, 0x6a51, 0x0e04, 0x6a9c, 0x2071, 0x0000,
+	0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870,
+	0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x1187, 0x2071, 0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c,
+	0x1158, 0xa802, 0x2900, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
+	0x7f5d, 0x002e, 0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000,
+	0x00f6, 0x2079, 0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010,
+	0x9005, 0x1904, 0x6815, 0x782c, 0x908c, 0x0780, 0x190c, 0x6bc3,
+	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6744, 0x6815,
+	0x6769, 0x67b0, 0x080c, 0x0db4, 0x2071, 0x1800, 0x2900, 0x7822,
 	0xa804, 0x900d, 0x1170, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328,
 	0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
-	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
-	0x080c, 0x7f35, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010,
-	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
-	0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6863, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6bbc, 0xd09c, 0x1198, 0x701c, 0x904d, 0x0180,
-	0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900,
-	0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd09c, 0x0d68,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x01b0, 0x00e6,
-	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70bc, 0x8000, 0x70be, 0x080c, 0x7f35, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6bbc, 0xd0a4, 0x1d60, 0x00ee, 0x2071, 0x19cb, 0x703c,
-	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70bc, 0x9200, 0x70be, 0x080c, 0x7f35, 0x00ee, 0x0804, 0x681e,
-	0xa868, 0xd0fc, 0x1904, 0x68c6, 0x0096, 0xa804, 0xa807, 0x0000,
-	0x904d, 0x190c, 0x0f9d, 0x009e, 0x0018, 0xa868, 0xd0fc, 0x15f0,
-	0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071,
-	0x1800, 0x70e8, 0x8001, 0x01d0, 0x1678, 0x2071, 0x1906, 0xa803,
-	0x0000, 0x7010, 0x9005, 0x1904, 0x69c4, 0x782c, 0x908c, 0x0780,
-	0x190c, 0x6bbc, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002,
-	0x68c7, 0x69c4, 0x68e2, 0x6953, 0x080c, 0x0db4, 0x70eb, 0x0fa0,
-	0x71e4, 0x8107, 0x9106, 0x9094, 0x00c0, 0x9184, 0xff3f, 0x9205,
-	0x70e6, 0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084,
-	0xff3f, 0x9205, 0x20d0, 0x0888, 0x70ea, 0x0878, 0x0005, 0x2071,
-	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
-	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x7f35, 0x0c60, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x1904, 0x6942, 0x7830, 0x8007, 0x9084, 0x001f, 0x9082, 0x0005,
-	0x1220, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071,
-	0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x182f, 0x210c, 0x918a,
-	0x0040, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f35,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x19f0, 0x0e04,
-	0x6939, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
-	0x6836, 0x6833, 0x0013, 0x00de, 0x2001, 0x1917, 0x200c, 0xc184,
-	0x2102, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x2001, 0x1917, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
+	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d,
+	0x0c10, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1580,
+	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009,
+	0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022, 0x00ee, 0x0058,
+	0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
+	0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3,
+	0xd0a4, 0x19f0, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328, 0x2001,
+	0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d, 0x0800,
+	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x1d60, 0x00ee, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c, 0x11a0, 0x009e, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x1560, 0x2071, 0x19cb, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1170, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328, 0x2001,
+	0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x7f35, 0x0804, 0x68f5, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071,
-	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
-	0x080c, 0x7f35, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4,
-	0x1d60, 0x00ee, 0x0e04, 0x6997, 0x7838, 0x7938, 0x910e, 0x1de0,
-	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044,
-	0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6bbc, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822,
-	0xa804, 0x900d, 0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044,
-	0xc085, 0x7046, 0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012,
-	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
-	0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071,
-	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f35,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012,
-	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
-	0xa804, 0x900d, 0x1904, 0x6a35, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6bbc, 0xd09c, 0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005,
-	0x1180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e,
-	0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd09c,
-	0x0d50, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x05c8,
-	0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f35, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6a2e,
+	0x7f5d, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1904, 0x686a, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bc3, 0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010,
+	0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c, 0x0d68, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x01b0, 0x00e6, 0x7824,
+	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
+	0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6bc3, 0xd0a4, 0x1d60, 0x00ee, 0x2071, 0x19cb, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x7f5d, 0x00ee, 0x0804, 0x6825, 0xa868,
+	0xd0fc, 0x1904, 0x68cd, 0x0096, 0xa804, 0xa807, 0x0000, 0x904d,
+	0x190c, 0x0f9d, 0x009e, 0x0018, 0xa868, 0xd0fc, 0x15f0, 0x00e6,
+	0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1800,
+	0x70e8, 0x8001, 0x01d0, 0x1678, 0x2071, 0x1906, 0xa803, 0x0000,
+	0x7010, 0x9005, 0x1904, 0x69cb, 0x782c, 0x908c, 0x0780, 0x190c,
+	0x6bc3, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x68ce,
+	0x69cb, 0x68e9, 0x695a, 0x080c, 0x0db4, 0x70eb, 0x0fa0, 0x71e4,
+	0x8107, 0x9106, 0x9094, 0x00c0, 0x9184, 0xff3f, 0x9205, 0x70e6,
+	0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f,
+	0x9205, 0x20d0, 0x0888, 0x70ea, 0x0878, 0x0005, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d,
+	0x0c60, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904,
+	0x6949, 0x7830, 0x8007, 0x9084, 0x001f, 0x9082, 0x0005, 0x1220,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040,
+	0x712c, 0xd19c, 0x1148, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040,
+	0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x19f0, 0x0e04, 0x6940,
 	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
-	0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2009, 0x1919,
-	0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085,
-	0x7046, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x6833, 0x0013, 0x00de, 0x2001, 0x1917, 0x200c, 0xc184, 0x2102,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187,
+	0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2001, 0x1917, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d,
+	0x0804, 0x68fc, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c,
+	0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x1d60,
+	0x00ee, 0x0e04, 0x699e, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084,
+	0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bc3, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085,
+	0x7046, 0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f35, 0x00ee,
-	0x0804, 0x69d4, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010,
-	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
-	0x711e, 0x2148, 0xa804, 0x900d, 0x1128, 0x1e04, 0x6a75, 0x002e,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1904, 0x6a3c, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3,
+	0xd09c, 0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180,
+	0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900,
+	0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c, 0x0d50,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x05c8, 0x00e6,
+	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bc3, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6a35, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2009, 0x1919, 0x200b,
+	0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d, 0x00ee, 0x0804,
+	0x69db, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1128, 0x1e04, 0x6a7c, 0x002e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
+	0x080c, 0x7f5d, 0x0e04, 0x6a66, 0x2071, 0x1906, 0x701c, 0x2048,
+	0xa84c, 0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
+	0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1906, 0x080c,
+	0x6baf, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1906, 0xa803, 0x0000,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1118, 0x002e,
 	0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904,
 	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200,
-	0x70be, 0x080c, 0x7f35, 0x0e04, 0x6a5f, 0x2071, 0x1906, 0x701c,
-	0x2048, 0xa84c, 0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850,
-	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1906,
-	0x080c, 0x6ba8, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1906, 0xa803,
-	0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
-	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1118,
-	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
-	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
-	0x9200, 0x70be, 0x080c, 0x7f35, 0x002e, 0x00ee, 0x0005, 0x0006,
-	0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e, 0x9084,
-	0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071, 0x1906,
-	0x7004, 0x0002, 0x6ae0, 0x6ae1, 0x6ba7, 0x6ae1, 0x0db4, 0x6ba7,
-	0x0005, 0x2001, 0x191a, 0x2004, 0x0002, 0x6aeb, 0x6aeb, 0x6b40,
-	0x6b41, 0x6aeb, 0x6b41, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6bc7,
-	0x701c, 0x904d, 0x01e0, 0xa84c, 0x9005, 0x01d8, 0x0e04, 0x6b0f,
-	0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
-	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x1187, 0x2071, 0x1906, 0x080c, 0x6ba8, 0x012e,
-	0x0470, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6bbc,
-	0xd09c, 0x2071, 0x1906, 0x1510, 0x2071, 0x1906, 0x700f, 0x0001,
+	0x70be, 0x080c, 0x7f5d, 0x002e, 0x00ee, 0x0005, 0x0006, 0xa87c,
+	0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e, 0x9084, 0x00ff,
+	0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071, 0x1906, 0x7004,
+	0x0002, 0x6ae7, 0x6ae8, 0x6bae, 0x6ae8, 0x0db4, 0x6bae, 0x0005,
+	0x2001, 0x191a, 0x2004, 0x0002, 0x6af2, 0x6af2, 0x6b47, 0x6b48,
+	0x6af2, 0x6b48, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6bce, 0x701c,
+	0x904d, 0x01e0, 0xa84c, 0x9005, 0x01d8, 0x0e04, 0x6b16, 0xa94c,
+	0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036,
+	0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1187, 0x2071, 0x1906, 0x080c, 0x6baf, 0x012e, 0x0470,
+	0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c,
+	0x2071, 0x1906, 0x1510, 0x2071, 0x1906, 0x700f, 0x0001, 0xa964,
+	0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff,
+	0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822,
+	0x00de, 0x2071, 0x1906, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012,
+	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005,
+	0x00d6, 0x2008, 0x2069, 0x19cb, 0x683c, 0x9005, 0x0760, 0x0158,
+	0x9186, 0x0003, 0x0540, 0x2001, 0x1814, 0x2004, 0x2009, 0x1a98,
+	0x210c, 0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050,
+	0x693c, 0x6838, 0x9106, 0x0190, 0x0e04, 0x6b7a, 0x2069, 0x0000,
+	0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2069, 0x19cb,
+	0x683f, 0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c,
+	0x6c3f, 0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094,
+	0x0780, 0x15c9, 0xd09c, 0x1500, 0x2071, 0x1906, 0x700f, 0x0001,
 	0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c,
 	0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050,
-	0x6822, 0x00de, 0x2071, 0x1906, 0x701c, 0x2048, 0x7010, 0x8001,
-	0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005,
-	0x0005, 0x00d6, 0x2008, 0x2069, 0x19cb, 0x683c, 0x9005, 0x0760,
-	0x0158, 0x9186, 0x0003, 0x0540, 0x2001, 0x1814, 0x2004, 0x2009,
-	0x1a98, 0x210c, 0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069,
-	0x0050, 0x693c, 0x6838, 0x9106, 0x0190, 0x0e04, 0x6b73, 0x2069,
-	0x0000, 0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2069,
-	0x19cb, 0x683f, 0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000,
-	0x1e0c, 0x6c38, 0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004,
-	0x9094, 0x0780, 0x15c9, 0xd09c, 0x1500, 0x2071, 0x1906, 0x700f,
-	0x0001, 0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f,
-	0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069,
-	0x0050, 0x6822, 0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012,
-	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001,
-	0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c,
-	0x101d, 0x0005, 0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6bbe,
-	0x0006, 0x0016, 0x2001, 0x8004, 0x0006, 0x0804, 0x0dbd, 0x0096,
-	0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046,
-	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
-	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe,
-	0x009e, 0x0005, 0x782c, 0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8,
-	0x2009, 0x1919, 0x2104, 0x8000, 0x200a, 0x9082, 0x000f, 0x0e78,
-	0x00e6, 0x2071, 0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c,
-	0xd19c, 0x1148, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0218,
-	0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f35, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e,
-	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187,
-	0x2009, 0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e, 0x0005,
-	0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046,
-	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
-	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x1187, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6bbc, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824,
-	0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
-	0x080c, 0x7f35, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4,
-	0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x191a, 0x6808,
-	0x690a, 0x2069, 0x19cb, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328,
-	0x2001, 0x191b, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe,
-	0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0db4, 0x9082, 0x001d,
-	0x001b, 0x6027, 0x1e00, 0x0005, 0x6d5c, 0x6ce6, 0x6d02, 0x6d2a,
-	0x6d4b, 0x6d8b, 0x6d9d, 0x6d02, 0x6d73, 0x6ca1, 0x6ccf, 0x6ca0,
-	0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808,
-	0x9005, 0x1518, 0x7097, 0x0028, 0x2069, 0x1960, 0x2d04, 0x7002,
-	0x080c, 0x70e0, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x7097,
-	0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600,
-	0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a33, 0x080c,
-	0x1958, 0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6,
-	0x2069, 0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160,
-	0x7097, 0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x717a,
-	0x6028, 0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001,
-	0x0090, 0x080c, 0x2b14, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c,
-	0x6e0a, 0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097,
-	0x0020, 0x080c, 0x6e0a, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097,
-	0x001f, 0x0005, 0x2001, 0x0088, 0x080c, 0x2b14, 0x6124, 0xd1cc,
-	0x11d8, 0xd1dc, 0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8,
-	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x6fd3, 0x2001,
-	0x0080, 0x080c, 0x2b14, 0x7097, 0x0028, 0x0058, 0x7097, 0x001e,
-	0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097,
-	0x001f, 0x0005, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c,
-	0x6fd3, 0x2001, 0x0080, 0x080c, 0x2b14, 0x6124, 0xd1d4, 0x1180,
-	0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x7097,
-	0x0028, 0x0040, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010,
-	0x7097, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x6124,
-	0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1982, 0x7097, 0x001e,
-	0x0010, 0x7097, 0x001d, 0x0005, 0x080c, 0x6e8d, 0x6124, 0xd1dc,
-	0x1188, 0x080c, 0x6e0a, 0x0016, 0x080c, 0x1982, 0x001e, 0xd1d4,
-	0x1128, 0xd1e4, 0x0138, 0x7097, 0x001e, 0x0020, 0x7097, 0x001f,
-	0x080c, 0x6e0a, 0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x2b14,
-	0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128,
-	0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010,
-	0x7097, 0x0021, 0x0005, 0x080c, 0x6e8d, 0x6124, 0xd1d4, 0x1150,
-	0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097,
-	0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090,
-	0x080c, 0x2b14, 0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150,
-	0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7097, 0x001e, 0x0040, 0x7097,
-	0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005,
-	0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c, 0x6fa7, 0x11d8,
-	0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0, 0xc1b4, 0x2102, 0x6027,
-	0x0200, 0x080c, 0x2a5d, 0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0,
-	0x080c, 0x2b14, 0x080c, 0x728b, 0x080c, 0x5cca, 0x0428, 0x6028,
-	0xc0cd, 0x602a, 0x0408, 0x080c, 0x6fc1, 0x0150, 0x080c, 0x6fb8,
-	0x1138, 0x2001, 0x0001, 0x080c, 0x260c, 0x080c, 0x6f7f, 0x00a0,
-	0x080c, 0x6e8a, 0x0178, 0x2001, 0x0001, 0x080c, 0x260c, 0x7094,
-	0x9086, 0x001e, 0x0120, 0x7094, 0x9086, 0x0022, 0x1118, 0x7097,
-	0x0025, 0x0010, 0x7097, 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce,
-	0x001e, 0x0005, 0x0026, 0x2011, 0x6e1b, 0x080c, 0x80e4, 0x002e,
-	0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x6e1b, 0x080c, 0x80db,
-	0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, 0x9393,
-	0x2071, 0x1800, 0x080c, 0x6db8, 0x001e, 0x00fe, 0x00ee, 0x0005,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126,
-	0x080c, 0x9393, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
-	0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x080c,
-	0x9758, 0x2011, 0x0002, 0x080c, 0x9762, 0x080c, 0x9649, 0x080c,
-	0x8090, 0x0036, 0x901e, 0x080c, 0x96bf, 0x003e, 0x60e3, 0x0000,
-	0x080c, 0xd894, 0x080c, 0xd8af, 0x2009, 0x0004, 0x080c, 0x2a63,
-	0x080c, 0x297e, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027, 0x0008,
-	0x2011, 0x6e1b, 0x080c, 0x80e4, 0x080c, 0x6fc1, 0x0118, 0x9006,
-	0x080c, 0x2b14, 0x080c, 0x0b8f, 0x2001, 0x0001, 0x080c, 0x260c,
-	0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x0026, 0x00e6, 0x2011, 0x6e28, 0x2071, 0x19cb, 0x701c,
-	0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001, 0x00ee,
-	0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe,
-	0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c, 0x2b14, 0x0156,
-	0x20a9, 0x002d, 0x1d04, 0x6e9a, 0x2091, 0x6000, 0x1f04, 0x6e9a,
-	0x015e, 0x00d6, 0x2069, 0x1800, 0x6898, 0x8001, 0x0220, 0x0118,
-	0x689a, 0x00de, 0x0005, 0x689b, 0x0014, 0x68e4, 0xd0dc, 0x0dc8,
-	0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x80f0, 0x0c90, 0x00c6,
-	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
-	0x080c, 0x729a, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096,
-	0x60e2, 0x6886, 0x080c, 0x26d7, 0x9006, 0x080c, 0x2b14, 0x080c,
-	0x5b89, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce,
-	0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0x1800, 0x2001, 0x194e, 0x200c, 0x9186, 0x0000, 0x0158,
-	0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003,
-	0x0158, 0x0804, 0x6f6f, 0x7097, 0x0022, 0x0040, 0x7097, 0x0021,
-	0x0028, 0x7097, 0x0023, 0x0010, 0x7097, 0x0024, 0x60e3, 0x0000,
-	0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x26d7, 0x0026, 0x080c,
-	0x9d9f, 0x002e, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b, 0x0028,
-	0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9,
-	0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c, 0xc1f9,
-	0x0118, 0x9006, 0x080c, 0x2b3e, 0x0804, 0x6f7b, 0x6800, 0x9084,
-	0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2a5d, 0x6904, 0xd1d4, 0x1140,
-	0x2001, 0x0100, 0x080c, 0x2b14, 0x1f04, 0x6f19, 0x080c, 0x6ffe,
-	0x012e, 0x015e, 0x080c, 0x6fb8, 0x01a8, 0x6044, 0x9005, 0x0168,
-	0x6050, 0x0006, 0x9085, 0x0020, 0x6052, 0x080c, 0x6ffe, 0x9006,
-	0x8001, 0x1df0, 0x000e, 0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110,
-	0x080c, 0x6ffe, 0x080c, 0xc1f9, 0x0118, 0x9006, 0x080c, 0x2b3e,
-	0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130, 0x2009, 0x00c8,
-	0x2011, 0x6e28, 0x080c, 0x80a2, 0x002e, 0x001e, 0x080c, 0x7f2c,
-	0x7034, 0xc085, 0x7036, 0x2001, 0x194e, 0x2003, 0x0004, 0x080c,
-	0x6c89, 0x080c, 0x6fb8, 0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc,
-	0x1100, 0x080c, 0x7290, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6,
-	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
-	0x080c, 0x7f43, 0x080c, 0x7f35, 0x080c, 0x729a, 0x2001, 0x193e,
-	0x2003, 0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x26d7,
-	0x9006, 0x080c, 0x2b14, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027,
-	0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006,
-	0x2001, 0x194d, 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006,
-	0x080c, 0x5383, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005,
-	0x0006, 0x080c, 0x5383, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e,
-	0x0005, 0x0006, 0x080c, 0x5383, 0x9084, 0x0030, 0x9086, 0x0010,
-	0x000e, 0x0005, 0x0006, 0x080c, 0x5383, 0x9084, 0x0030, 0x9086,
-	0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004,
-	0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x26f7, 0x900e, 0x0028,
-	0x080c, 0x6553, 0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c,
-	0x2fa2, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071,
-	0x180c, 0x2e04, 0x0130, 0x080c, 0xc1f2, 0x1128, 0x9085, 0x0010,
-	0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006,
-	0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006,
-	0x0016, 0x6138, 0x6050, 0x9084, 0xfbff, 0x9085, 0x2000, 0x6052,
-	0x613a, 0x20a9, 0x0012, 0x1d04, 0x7013, 0x2091, 0x6000, 0x1f04,
-	0x7013, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400,
-	0x9084, 0xdfff, 0x6052, 0x613a, 0x001e, 0x602f, 0x0040, 0x602f,
-	0x0000, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e,
-	0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c,
-	0x26d7, 0x2001, 0x00a0, 0x0006, 0x080c, 0xc1f9, 0x000e, 0x0130,
-	0x080c, 0x2b32, 0x9006, 0x080c, 0x2b3e, 0x0010, 0x080c, 0x2b14,
-	0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079,
-	0x0100, 0x080c, 0x29d2, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
-	0x2069, 0x0140, 0x2071, 0x1800, 0x6020, 0x9084, 0x0080, 0x0138,
-	0x2001, 0x180c, 0x200c, 0xc1c5, 0x2102, 0x0804, 0x70d2, 0x2001,
-	0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a,
-	0x6027, 0x0200, 0x2001, 0x0090, 0x080c, 0x2b14, 0x20a9, 0x0366,
-	0x6024, 0xd0cc, 0x1518, 0x1d04, 0x7080, 0x2091, 0x6000, 0x1f04,
-	0x7080, 0x2011, 0x0003, 0x080c, 0x9758, 0x2011, 0x0002, 0x080c,
-	0x9762, 0x080c, 0x9649, 0x901e, 0x080c, 0x96bf, 0x2001, 0x00a0,
-	0x080c, 0x2b14, 0x080c, 0x728b, 0x080c, 0x5cca, 0x080c, 0xc1f9,
-	0x0110, 0x080c, 0x0d22, 0x9085, 0x0001, 0x0490, 0x86ff, 0x1110,
-	0x080c, 0x1982, 0x60e3, 0x0000, 0x2001, 0x0002, 0x080c, 0x26d7,
-	0x60e2, 0x2001, 0x0080, 0x080c, 0x2b14, 0x20a9, 0x0366, 0x6027,
-	0x1e00, 0x2009, 0x1e00, 0x080c, 0x2a5d, 0x6024, 0x910c, 0x0138,
-	0x1d04, 0x70b7, 0x2091, 0x6000, 0x1f04, 0x70b7, 0x0810, 0x6028,
-	0x9085, 0x1e00, 0x602a, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001,
-	0x0008, 0x6886, 0x080c, 0xc1f9, 0x0110, 0x080c, 0x0d22, 0x9006,
-	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001,
-	0x020b, 0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069,
-	0x1a49, 0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084,
-	0x00c0, 0x0120, 0x6884, 0x9005, 0x1904, 0x7145, 0x2001, 0x0088,
-	0x080c, 0x2b14, 0x9006, 0x60e2, 0x6886, 0x080c, 0x26d7, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01c0, 0x6028,
-	0x9084, 0xfbff, 0x602a, 0x6027, 0x0400, 0x2069, 0x1960, 0x7000,
-	0x206a, 0x7097, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04,
-	0x7127, 0x2091, 0x6000, 0x1f04, 0x7127, 0x0804, 0x7172, 0x2069,
-	0x0140, 0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c,
-	0x2a5d, 0x6024, 0x910c, 0x0508, 0x9084, 0x1a00, 0x11f0, 0x1d04,
-	0x7133, 0x2091, 0x6000, 0x1f04, 0x7133, 0x2011, 0x0003, 0x080c,
-	0x9758, 0x2011, 0x0002, 0x080c, 0x9762, 0x080c, 0x9649, 0x901e,
-	0x080c, 0x96bf, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c, 0x728b,
-	0x080c, 0x5cca, 0x9085, 0x0001, 0x00a8, 0x2001, 0x0080, 0x080c,
-	0x2b14, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118,
-	0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x26d7,
-	0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0,
-	0x01c8, 0x2011, 0x0003, 0x080c, 0x9758, 0x2011, 0x0002, 0x080c,
-	0x9762, 0x080c, 0x9649, 0x901e, 0x080c, 0x96bf, 0x2069, 0x0140,
-	0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c, 0x728b, 0x080c, 0x5cca,
-	0x0804, 0x720c, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5,
-	0x2102, 0x080c, 0x6e10, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c,
-	0x2b14, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
-	0x6808, 0x9005, 0x0180, 0x6028, 0x9084, 0xfdff, 0x602a, 0x6027,
-	0x0200, 0x2069, 0x1960, 0x7000, 0x206a, 0x7097, 0x0027, 0x7003,
-	0x0001, 0x0804, 0x720c, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c,
-	0x2a5d, 0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04,
-	0x71cb, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x7f74,
-	0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19cb,
-	0x7018, 0x00ee, 0x9005, 0x19f8, 0x01f8, 0x0026, 0x2011, 0x6e28,
-	0x080c, 0x8010, 0x2011, 0x6e1b, 0x080c, 0x80e4, 0x002e, 0x2069,
-	0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001,
-	0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x26d7, 0x60e2, 0x2001,
-	0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c,
-	0xc1f2, 0x1904, 0x7279, 0x7130, 0xd184, 0x1170, 0x080c, 0x312c,
-	0x0138, 0xc18d, 0x7132, 0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120,
-	0x7030, 0xd08c, 0x0904, 0x7279, 0x2011, 0x1854, 0x220c, 0x0438,
-	0x0016, 0x2019, 0x000e, 0x080c, 0xd486, 0x0156, 0x00b6, 0x20a9,
-	0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188,
-	0x080c, 0x6237, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e,
-	0x080c, 0xd50a, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x8207,
-	0x001e, 0x8108, 0x1f04, 0x7242, 0x00be, 0x015e, 0x001e, 0xd1ac,
-	0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x2fa2,
-	0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c,
-	0x6237, 0x1110, 0x080c, 0x5ce4, 0x8108, 0x1f04, 0x726f, 0x00be,
-	0x015e, 0x080c, 0x1982, 0x080c, 0x9d9f, 0x60e3, 0x0000, 0x080c,
-	0x5cca, 0x080c, 0x6ed9, 0x00ee, 0x00ce, 0x004e, 0x003e, 0x002e,
-	0x001e, 0x015e, 0x0005, 0x2001, 0x194e, 0x2003, 0x0001, 0x0005,
-	0x2001, 0x194e, 0x2003, 0x0000, 0x0005, 0x2001, 0x194d, 0x2003,
-	0xaaaa, 0x0005, 0x2001, 0x194d, 0x2003, 0x0000, 0x0005, 0x2071,
-	0x18f0, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c, 0x1004, 0x090c,
-	0x0db4, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x1004, 0x090c,
-	0x0db4, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000, 0xa86b,
-	0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040, 0x6848,
-	0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840, 0x9005, 0x0150,
-	0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006, 0x9006,
-	0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858, 0x700a,
-	0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012, 0x7016, 0x6848,
-	0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001, 0x0019, 0x7036,
-	0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c, 0xfff7, 0x918d,
-	0x8000, 0x2102, 0x00d6, 0x2069, 0x18f0, 0x6807, 0x0001, 0x00de,
-	0x080c, 0x788c, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156, 0x20a9,
-	0x0006, 0x8003, 0x2011, 0x0100, 0x2214, 0x9296, 0x0008, 0x1110,
-	0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04, 0x7301, 0x015e, 0x0005,
-	0x2079, 0x0040, 0x2071, 0x18f0, 0x7004, 0x0002, 0x7320, 0x7321,
-	0x7358, 0x73b3, 0x74f4, 0x731e, 0x731e, 0x751e, 0x080c, 0x0db4,
-	0x0005, 0x2079, 0x0040, 0x782c, 0x908c, 0x0780, 0x190c, 0x7918,
-	0xd0a4, 0x01f0, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864,
-	0x9084, 0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001, 0x1800,
-	0x200c, 0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004, 0x0140,
-	0x9186, 0x0007, 0x0128, 0x9186, 0x0003, 0x19e8, 0x080c, 0x73b3,
-	0x782c, 0xd09c, 0x090c, 0x788c, 0x0005, 0x9082, 0x005a, 0x1218,
-	0x2100, 0x003b, 0x0c18, 0x080c, 0x73e9, 0x0c90, 0x00e3, 0x08f0,
-	0x0005, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x740b, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73f5, 0x73e9, 0x75f3,
-	0x73e9, 0x73e9, 0x73e9, 0x740b, 0x73e9, 0x73f5, 0x7634, 0x7675,
-	0x76bc, 0x76d0, 0x73e9, 0x73e9, 0x740b, 0x73f5, 0x73e9, 0x73e9,
-	0x74c8, 0x777b, 0x7796, 0x73e9, 0x740b, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x74be, 0x7796, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x741f, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x78bc, 0x73e9,
-	0x73e9, 0x73e9, 0x73e9, 0x73e9, 0x7433, 0x73e9, 0x73e9, 0x73e9,
-	0x73e9, 0x73e9, 0x73e9, 0x2079, 0x0040, 0x7004, 0x9086, 0x0003,
-	0x1198, 0x782c, 0x080c, 0x78b5, 0xd0a4, 0x0170, 0x7824, 0x2048,
-	0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x001a,
-	0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x788c, 0x0005, 0x73e9,
-	0x73f5, 0x75df, 0x73e9, 0x73f5, 0x73e9, 0x73f5, 0x73f5, 0x73e9,
-	0x73f5, 0x75df, 0x73f5, 0x73f5, 0x73f5, 0x73f5, 0x73f5, 0x73e9,
-	0x73f5, 0x75df, 0x73e9, 0x73e9, 0x73f5, 0x73e9, 0x73e9, 0x73e9,
-	0x73f5, 0x00e6, 0x2071, 0x18f0, 0x2009, 0x0400, 0x0071, 0x00ee,
-	0x0005, 0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000, 0x0029,
-	0x0005, 0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001, 0xa868,
-	0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6885, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08,
-	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x759d, 0x7007, 0x0003,
-	0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x759d, 0x0005, 0xa864,
-	0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007, 0x0001,
-	0x0804, 0x75b8, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
-	0x704b, 0x75b8, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086,
-	0x0001, 0x1904, 0x73f1, 0x7007, 0x0001, 0x2009, 0x1833, 0x210c,
-	0x81ff, 0x1904, 0x7495, 0xa994, 0x9186, 0x006f, 0x0188, 0x9186,
-	0x0074, 0x15b0, 0x0026, 0x2011, 0x0010, 0x080c, 0x657f, 0x002e,
-	0x0578, 0x0016, 0xa998, 0x080c, 0x65c9, 0x001e, 0x1548, 0x0400,
-	0x080c, 0x6fa7, 0x0140, 0xa897, 0x4005, 0xa89b, 0x0016, 0x2001,
-	0x0030, 0x900e, 0x0438, 0x0026, 0x2011, 0x8008, 0x080c, 0x657f,
-	0x002e, 0x01b0, 0x0016, 0x0026, 0x0036, 0xa998, 0xaaa0, 0xab9c,
-	0x918d, 0x8000, 0x080c, 0x65c9, 0x003e, 0x002e, 0x001e, 0x1140,
-	0xa897, 0x4005, 0xa89b, 0x4009, 0x2001, 0x0030, 0x900e, 0x0050,
-	0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x5ef9,
-	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a,
-	0xa982, 0x080c, 0x6885, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071,
-	0x0904, 0x7443, 0x9186, 0x0064, 0x0904, 0x7443, 0x9186, 0x007c,
-	0x0904, 0x7443, 0x9186, 0x0028, 0x0904, 0x7443, 0x9186, 0x0038,
-	0x0904, 0x7443, 0x9186, 0x0078, 0x0904, 0x7443, 0x9186, 0x005f,
-	0x0904, 0x7443, 0x9186, 0x0056, 0x0904, 0x7443, 0xa897, 0x4005,
-	0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x0860, 0xa87c, 0x9084,
-	0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x77ad,
-	0x2900, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c,
-	0x9080, 0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401,
-	0x1a04, 0x73f9, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x73f9, 0x82ff,
-	0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x755b, 0x0018,
-	0x9280, 0x7551, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x753c,
-	0x080c, 0x1004, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022,
-	0x7054, 0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004,
-	0x9100, 0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e,
-	0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108,
-	0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x10d5, 0xa06c, 0x908e,
-	0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005,
-	0x7020, 0x2048, 0x080c, 0x101d, 0x7014, 0x2048, 0x0804, 0x73f9,
-	0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048,
-	0xa906, 0x711a, 0x0804, 0x74f4, 0x7014, 0x2048, 0x7007, 0x0001,
-	0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x77ad, 0x0804,
-	0x759d, 0x7553, 0x7557, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a,
-	0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076,
-	0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc,
-	0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0,
-	0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2,
-	0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094,
-	0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088,
-	0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c,
-	0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004,
-	0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1833, 0x210c,
-	0x81ff, 0x1178, 0x080c, 0x5d46, 0x1108, 0x0005, 0x080c, 0x6abf,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xbded, 0x080c, 0x6885, 0x012e,
-	0x0ca0, 0x080c, 0xc1f2, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70,
-	0x2009, 0x1833, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0,
-	0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5e5b, 0x1138,
-	0x0005, 0x9006, 0xa87a, 0x080c, 0x5dd6, 0x1108, 0x0005, 0x0126,
-	0x2091, 0x8000, 0xa87a, 0xa982, 0x080c, 0x6885, 0x012e, 0x0cb0,
-	0x2001, 0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018,
-	0xa802, 0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012,
-	0x0118, 0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001,
-	0x7048, 0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878,
-	0x9084, 0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096,
-	0x0001, 0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160,
-	0x9005, 0x11d8, 0xa974, 0x080c, 0x6237, 0x11b8, 0x0066, 0xae80,
-	0x080c, 0x6347, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224,
-	0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x6237, 0x1110, 0x080c,
-	0x6447, 0x8108, 0x1f04, 0x761c, 0x00ce, 0xa87c, 0xd084, 0x1120,
-	0x080c, 0x101d, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6885, 0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x080c, 0x6557, 0x0580, 0x2061, 0x1a41, 0x6100, 0xd184,
-	0x0178, 0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520,
-	0x6004, 0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8,
-	0x2011, 0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000,
-	0x6016, 0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007,
-	0x9084, 0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d,
-	0x6202, 0x012e, 0x0804, 0x7876, 0x012e, 0x0804, 0x7870, 0x012e,
-	0x0804, 0x786a, 0x012e, 0x0804, 0x786d, 0x0126, 0x2091, 0x8000,
-	0x7007, 0x0001, 0x080c, 0x6557, 0x05e0, 0x2061, 0x1a41, 0x6000,
-	0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484,
-	0x0003, 0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100,
-	0x9210, 0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0,
-	0x9484, 0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082,
-	0x0004, 0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004,
-	0x1168, 0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000,
-	0x6016, 0x6206, 0x630a, 0x012e, 0x0804, 0x7876, 0x012e, 0x0804,
-	0x7873, 0x012e, 0x0804, 0x7870, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x2061, 0x1a41, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318,
-	0x0220, 0x630a, 0x012e, 0x0804, 0x7884, 0x012e, 0x0804, 0x7873,
-	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c,
-	0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a41, 0x6000, 0x9084, 0xfcff,
-	0x6002, 0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065,
-	0x0598, 0x2001, 0x1833, 0x2004, 0x9005, 0x0118, 0x080c, 0x9e49,
-	0x0068, 0x6017, 0xf400, 0x605b, 0x0000, 0xa97c, 0xd1a4, 0x0110,
-	0xa980, 0x615a, 0x2009, 0x0041, 0x080c, 0x9e93, 0xa988, 0x918c,
-	0xff00, 0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff,
-	0x080c, 0x8207, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a41,
-	0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce,
-	0x012e, 0x00be, 0x0804, 0x7876, 0x00ce, 0x012e, 0x00be, 0x0804,
-	0x7870, 0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18,
-	0x9186, 0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c,
-	0x200c, 0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186,
-	0x0029, 0x1d10, 0xa974, 0x080c, 0x6237, 0x1968, 0xb800, 0xc0e4,
-	0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001,
-	0x1957, 0x2004, 0x601a, 0x0804, 0x770b, 0xa88c, 0x9065, 0x0960,
-	0x00e6, 0xa890, 0x9075, 0x2001, 0x1833, 0x2004, 0x9005, 0x0150,
-	0x080c, 0x9e49, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9e49, 0x00ee,
-	0x0804, 0x770b, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007,
-	0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e,
-	0xa8a8, 0x6016, 0x6003, 0x0001, 0x080c, 0x83c9, 0x080c, 0x894b,
-	0x00ee, 0x0804, 0x770b, 0x2061, 0x1a41, 0x6000, 0xd084, 0x0190,
-	0xd08c, 0x1904, 0x7884, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210,
-	0x0220, 0x6206, 0x012e, 0x0804, 0x7884, 0x012e, 0xa883, 0x0016,
-	0x0804, 0x787d, 0xa883, 0x0007, 0x0804, 0x787d, 0xa864, 0x8007,
-	0x9084, 0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069,
-	0x0005, 0x080c, 0x73f1, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900,
-	0x7016, 0x701a, 0x704b, 0x77ad, 0x0005, 0x00b6, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x903e, 0x2061, 0x1800, 0x61cc, 0x81ff, 0x1904,
-	0x782f, 0x6130, 0xd194, 0x1904, 0x7859, 0xa878, 0x2070, 0x9e82,
-	0x1cd0, 0x0a04, 0x7823, 0x6064, 0x9e02, 0x1a04, 0x7823, 0x7120,
-	0x9186, 0x0006, 0x1904, 0x7815, 0x7010, 0x905d, 0x0904, 0x782f,
-	0xb800, 0xd0e4, 0x1904, 0x7853, 0x2061, 0x1a41, 0x6100, 0x9184,
-	0x0301, 0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x785c,
-	0xa883, 0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198,
-	0x7116, 0xa87c, 0xd0f4, 0x1904, 0x785f, 0x080c, 0x537f, 0xd09c,
-	0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x8127, 0x012e,
-	0x00ee, 0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902,
-	0x2148, 0xa87c, 0xd0f4, 0x1904, 0x785f, 0x012e, 0x00ee, 0x00be,
-	0x0005, 0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x787d,
-	0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6237,
-	0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118,
-	0xa883, 0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e,
-	0x0460, 0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c,
-	0x5383, 0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x02c0,
-	0x6064, 0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010,
-	0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000,
-	0x9086, 0x0007, 0x1904, 0x77b9, 0x7003, 0x0002, 0x0804, 0x77b9,
-	0xa883, 0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be,
-	0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60,
-	0x2019, 0x0002, 0x601b, 0x0014, 0x080c, 0xd0c7, 0x012e, 0x00ee,
-	0x00be, 0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040,
-	0x2009, 0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001,
-	0xa884, 0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6885, 0x012e, 0x0005, 0x080c, 0x101d, 0x0005, 0x00d6,
-	0x080c, 0x811e, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780,
-	0x190c, 0x7918, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70bc, 0x90ea,
-	0x0040, 0x0278, 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e,
-	0x9006, 0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c,
-	0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780,
-	0x190c, 0x7918, 0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026,
-	0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04,
-	0x7909, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284,
-	0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108,
-	0x04b0, 0x2b10, 0x080c, 0x9dc3, 0x1118, 0x080c, 0x9e66, 0x05a8,
-	0x6212, 0xa874, 0x0002, 0x78e7, 0x78ec, 0x78ef, 0x78f5, 0x2019,
-	0x0002, 0x080c, 0xd486, 0x0060, 0x080c, 0xd422, 0x0048, 0x2019,
-	0x0002, 0xa980, 0x080c, 0xd43d, 0x0018, 0xa980, 0x080c, 0xd422,
-	0x080c, 0x9e19, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6885, 0x012e, 0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de,
-	0x0005, 0xa887, 0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887,
-	0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20,
-	0x2091, 0x8000, 0x0e04, 0x791a, 0x0006, 0x0016, 0x2001, 0x8003,
-	0x0006, 0x0804, 0x0dbd, 0x2001, 0x1833, 0x2004, 0x9005, 0x0005,
-	0x0005, 0x00f6, 0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5,
-	0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c,
-	0x14a7, 0x00fe, 0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f,
-	0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904, 0x799a, 0x68bc,
-	0x90aa, 0x0005, 0x0a04, 0x7f2c, 0x7d44, 0x7c40, 0x9584, 0x00f6,
-	0x1510, 0x9484, 0x7000, 0x0140, 0x908a, 0x2000, 0x1260, 0x9584,
-	0x0700, 0x8007, 0x0804, 0x79a1, 0x7000, 0x9084, 0xff00, 0x9086,
-	0x8100, 0x0da8, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084,
-	0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xd86c, 0x080c, 0x7e71,
-	0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x7ecf,
-	0x19c0, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x79fc, 0x080c,
-	0x21cd, 0x005e, 0x004e, 0x0020, 0x080c, 0xd86c, 0x7817, 0x0140,
-	0x080c, 0x6fa7, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140,
-	0x688f, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000,
-	0x080c, 0x79dd, 0x2001, 0x19c1, 0x2004, 0x9005, 0x090c, 0x894b,
-	0x0005, 0x0002, 0x79b3, 0x7c93, 0x79aa, 0x79aa, 0x79aa, 0x79aa,
-	0x79aa, 0x79aa, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
-	0x090c, 0x894b, 0x0005, 0x7000, 0x908c, 0xff00, 0x9194, 0xf000,
-	0x810f, 0x9484, 0x0fff, 0x688e, 0x9286, 0x2000, 0x1150, 0x6800,
-	0x9086, 0x0001, 0x1118, 0x080c, 0x53e0, 0x0070, 0x080c, 0x7a1c,
-	0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x7bce, 0x0028, 0x9286,
-	0x8000, 0x1110, 0x080c, 0x7da1, 0x7817, 0x0140, 0x2001, 0x19c1,
-	0x2004, 0x9005, 0x090c, 0x894b, 0x0005, 0x2001, 0x1810, 0x2004,
-	0xd08c, 0x0178, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1148,
-	0x0026, 0x0036, 0x2011, 0x8048, 0x2518, 0x080c, 0x48d2, 0x003e,
-	0x002e, 0x0005, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200,
-	0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036, 0x0046, 0x0056, 0x00f6,
-	0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019, 0xffff, 0x2001, 0x1810,
-	0x2004, 0xd08c, 0x0160, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
-	0x1130, 0x0026, 0x2011, 0x8048, 0x080c, 0x48d2, 0x002e, 0x00fe,
-	0x005e, 0x004e, 0x003e, 0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084,
-	0xff00, 0x8007, 0x9096, 0x0001, 0x0120, 0x9096, 0x0023, 0x1904,
-	0x7b9f, 0x9186, 0x0023, 0x15c0, 0x080c, 0x7e36, 0x0904, 0x7b9f,
-	0x6120, 0x9186, 0x0001, 0x0150, 0x9186, 0x0004, 0x0138, 0x9186,
-	0x0008, 0x0120, 0x9186, 0x000a, 0x1904, 0x7b9f, 0x7124, 0x610a,
-	0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015, 0x080c, 0x9e93,
-	0x0804, 0x7b9f, 0x908e, 0x0214, 0x0118, 0x908e, 0x0210, 0x1130,
-	0x2009, 0x0015, 0x080c, 0x9e93, 0x0804, 0x7b9f, 0x908e, 0x0100,
-	0x1904, 0x7b9f, 0x7034, 0x9005, 0x1904, 0x7b9f, 0x2009, 0x0016,
-	0x080c, 0x9e93, 0x0804, 0x7b9f, 0x9186, 0x0022, 0x1904, 0x7b9f,
-	0x7030, 0x908e, 0x0300, 0x1580, 0x68d8, 0xd0a4, 0x0528, 0xc0b5,
-	0x68da, 0x7100, 0x918c, 0x00ff, 0x697a, 0x7004, 0x687e, 0x00f6,
-	0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016,
-	0x2008, 0x080c, 0x26ac, 0x7932, 0x7936, 0x001e, 0x000e, 0x00fe,
-	0x080c, 0x2663, 0x695a, 0x703c, 0x00e6, 0x2071, 0x0140, 0x7086,
-	0x2071, 0x1800, 0x70b2, 0x00ee, 0x7034, 0x9005, 0x1904, 0x7b9f,
-	0x2009, 0x0017, 0x0804, 0x7b6c, 0x908e, 0x0400, 0x1190, 0x7034,
-	0x9005, 0x1904, 0x7b9f, 0x080c, 0x6fa7, 0x0120, 0x2009, 0x001d,
-	0x0804, 0x7b6c, 0x68d8, 0xc0a5, 0x68da, 0x2009, 0x0030, 0x0804,
-	0x7b6c, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005, 0x1904, 0x7b9f,
-	0x2009, 0x0018, 0x0804, 0x7b6c, 0x908e, 0x2010, 0x1120, 0x2009,
-	0x0019, 0x0804, 0x7b6c, 0x908e, 0x2110, 0x1120, 0x2009, 0x001a,
-	0x0804, 0x7b6c, 0x908e, 0x5200, 0x1140, 0x7034, 0x9005, 0x1904,
-	0x7b9f, 0x2009, 0x001b, 0x0804, 0x7b6c, 0x908e, 0x5000, 0x1140,
-	0x7034, 0x9005, 0x1904, 0x7b9f, 0x2009, 0x001c, 0x0804, 0x7b6c,
-	0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804, 0x7b6c, 0x908e,
-	0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x7b9f, 0x2009, 0x0024,
-	0x0804, 0x7b6c, 0x908c, 0xff00, 0x918e, 0x2400, 0x1170, 0x2009,
-	0x002d, 0x2001, 0x1810, 0x2004, 0xd09c, 0x0904, 0x7b6c, 0x080c,
-	0xc89e, 0x1904, 0x7b9f, 0x0804, 0x7b6a, 0x908c, 0xff00, 0x918e,
-	0x5300, 0x1120, 0x2009, 0x002a, 0x0804, 0x7b6c, 0x908e, 0x0f00,
-	0x1120, 0x2009, 0x0020, 0x0804, 0x7b6c, 0x908e, 0x6104, 0x1528,
-	0x2029, 0x0205, 0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004,
-	0x8004, 0x8004, 0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046,
-	0x2124, 0x080c, 0x48d2, 0x004e, 0x8108, 0x0f04, 0x7b38, 0x9186,
-	0x0280, 0x1d88, 0x2504, 0x8000, 0x202a, 0x2009, 0x0260, 0x0c58,
-	0x202b, 0x0000, 0x2009, 0x0023, 0x0478, 0x908e, 0x6000, 0x1118,
-	0x2009, 0x003f, 0x0448, 0x908e, 0x7800, 0x1118, 0x2009, 0x0045,
-	0x0418, 0x908e, 0x1000, 0x1118, 0x2009, 0x004e, 0x00e8, 0x908e,
-	0x6300, 0x1118, 0x2009, 0x004a, 0x00b8, 0x908c, 0xff00, 0x918e,
-	0x5600, 0x1118, 0x2009, 0x004f, 0x0078, 0x908c, 0xff00, 0x918e,
-	0x5700, 0x1118, 0x2009, 0x0050, 0x0038, 0x2009, 0x001d, 0x6838,
-	0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204,
-	0x8211, 0x220c, 0x080c, 0x2663, 0x1568, 0x080c, 0x61d7, 0x1550,
-	0xbe12, 0xbd16, 0x001e, 0x0016, 0xb8b0, 0x9005, 0x1168, 0x9186,
+	0x6822, 0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800,
+	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012,
+	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x101d,
+	0x0005, 0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6bc5, 0x0006,
+	0x0016, 0x2001, 0x8004, 0x0006, 0x0804, 0x0dbd, 0x0096, 0x00f6,
+	0x2079, 0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x009e,
+	0x0005, 0x782c, 0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009,
+	0x1919, 0x2104, 0x8000, 0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6,
+	0x2071, 0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c,
+	0x1148, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022,
+	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bc3, 0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2009,
+	0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x00f6,
+	0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1187, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6bc3, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c,
+	0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x1d70,
+	0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x191a, 0x6808, 0x690a,
+	0x2069, 0x19cb, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328, 0x2001,
+	0x191b, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x7094, 0x908a, 0x0029, 0x1a0c, 0x0db4, 0x9082, 0x001d, 0x001b,
+	0x6027, 0x1e00, 0x0005, 0x6d67, 0x6ced, 0x6d09, 0x6d33, 0x6d56,
+	0x6d96, 0x6da8, 0x6d09, 0x6d7e, 0x6ca8, 0x6cd6, 0x6ca7, 0x0005,
+	0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005,
+	0x1518, 0x7097, 0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c,
+	0x70eb, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028,
+	0x2069, 0x1960, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a,
+	0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a33, 0x080c, 0x1958,
+	0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097,
+	0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x7185, 0x6028,
+	0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090,
+	0x080c, 0x2b14, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6e15,
+	0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020,
+	0x080c, 0x6e15, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f,
+	0x0005, 0x2001, 0x0088, 0x080c, 0x2b14, 0x6124, 0xd1cc, 0x11e8,
+	0xd1dc, 0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c,
+	0x1982, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x6fde,
+	0x2001, 0x0080, 0x080c, 0x2b14, 0x7097, 0x0028, 0x0058, 0x7097,
+	0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010,
+	0x7097, 0x001f, 0x0005, 0x080c, 0x1982, 0x60e3, 0x0001, 0x600c,
+	0xc0b4, 0x600e, 0x080c, 0x6fde, 0x2001, 0x0080, 0x080c, 0x2b14,
+	0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184,
+	0x1e00, 0x1158, 0x7097, 0x0028, 0x0040, 0x7097, 0x001e, 0x0028,
+	0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001, 0x00a0,
+	0x080c, 0x2b14, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c,
+	0x1982, 0x7097, 0x001e, 0x0010, 0x7097, 0x001d, 0x0005, 0x080c,
+	0x6e98, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x6e15, 0x0016, 0x080c,
+	0x1982, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x7097, 0x001e,
+	0x0020, 0x7097, 0x001f, 0x080c, 0x6e15, 0x0005, 0x0006, 0x2001,
+	0x00a0, 0x080c, 0x2b14, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028,
+	0x7097, 0x001d, 0x0010, 0x7097, 0x0021, 0x0005, 0x080c, 0x6e98,
+	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097,
+	0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005,
+	0x0006, 0x2001, 0x0090, 0x080c, 0x2b14, 0x000e, 0x6124, 0xd1d4,
+	0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7097,
+	0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010,
+	0x7097, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x080c, 0x6fb2, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0,
+	0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2a5d, 0x6024, 0xd0cc,
+	0x0148, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c, 0x7296, 0x080c,
+	0x5cd1, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x6fcc,
+	0x0150, 0x080c, 0x6fc3, 0x1138, 0x2001, 0x0001, 0x080c, 0x260c,
+	0x080c, 0x6f8a, 0x00a0, 0x080c, 0x6e95, 0x0178, 0x2001, 0x0001,
+	0x080c, 0x260c, 0x7094, 0x9086, 0x001e, 0x0120, 0x7094, 0x9086,
+	0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097, 0x0021, 0x012e,
+	0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x6e26,
+	0x080c, 0x810c, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011,
+	0x6e26, 0x080c, 0x8103, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6,
+	0x0016, 0x080c, 0x93ac, 0x2071, 0x1800, 0x080c, 0x6dc3, 0x001e,
+	0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x0126, 0x080c, 0x93ac, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a,
+	0x2011, 0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b,
+	0x080c, 0x9662, 0x080c, 0x80b8, 0x0036, 0x901e, 0x080c, 0x96d8,
+	0x003e, 0x60e3, 0x0000, 0x080c, 0xd8b4, 0x080c, 0xd8cf, 0x2009,
+	0x0004, 0x080c, 0x2a63, 0x080c, 0x297e, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x6027, 0x0008, 0x2011, 0x6e26, 0x080c, 0x810c, 0x080c,
+	0x6fcc, 0x0118, 0x9006, 0x080c, 0x2b14, 0x080c, 0x0b8f, 0x2001,
+	0x0001, 0x080c, 0x260c, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x6e33,
+	0x2071, 0x19cb, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110,
+	0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005,
+	0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0,
+	0x080c, 0x2b14, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x6ea5, 0x2091,
+	0x6000, 0x1f04, 0x6ea5, 0x015e, 0x00d6, 0x2069, 0x1800, 0x6898,
+	0x8001, 0x0220, 0x0118, 0x689a, 0x00de, 0x0005, 0x689b, 0x0014,
+	0x68e4, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c,
+	0x8118, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x080c, 0x72a5, 0x2001, 0x193e, 0x2003,
+	0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x26d7, 0x9006,
+	0x080c, 0x2b14, 0x080c, 0x5b90, 0x6027, 0xffff, 0x602b, 0x182f,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001, 0x194e, 0x200c,
+	0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002,
+	0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x6f7a, 0x7097, 0x0022,
+	0x0040, 0x7097, 0x0021, 0x0028, 0x7097, 0x0023, 0x0010, 0x7097,
+	0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c,
+	0x26d7, 0x0026, 0x080c, 0x9db8, 0x002e, 0x7000, 0x908e, 0x0004,
+	0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126,
+	0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e,
+	0x015e, 0x080c, 0xc212, 0x0118, 0x9006, 0x080c, 0x2b3e, 0x0804,
+	0x6f86, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2a5d,
+	0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2b14, 0x1f04,
+	0x6f24, 0x080c, 0x7009, 0x012e, 0x015e, 0x080c, 0x6fc3, 0x01a8,
+	0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085, 0x0020, 0x6052,
+	0x080c, 0x7009, 0x9006, 0x8001, 0x1df0, 0x000e, 0x6052, 0x0028,
+	0x6804, 0xd0d4, 0x1110, 0x080c, 0x7009, 0x080c, 0xc212, 0x0118,
+	0x9006, 0x080c, 0x2b3e, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004,
+	0x0130, 0x2009, 0x00c8, 0x2011, 0x6e33, 0x080c, 0x80ca, 0x002e,
+	0x001e, 0x080c, 0x7f54, 0x7034, 0xc085, 0x7036, 0x2001, 0x194e,
+	0x2003, 0x0004, 0x080c, 0x6c90, 0x080c, 0x6fc3, 0x0138, 0x6804,
+	0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x729b, 0x00ee, 0x00de,
+	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x080c, 0x7f6b, 0x080c, 0x7f5d, 0x080c,
+	0x72a5, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096, 0x60e2,
+	0x6886, 0x080c, 0x26d7, 0x9006, 0x080c, 0x2b14, 0x6043, 0x0090,
+	0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee, 0x00de,
+	0x00ce, 0x0005, 0x0006, 0x2001, 0x194d, 0x2004, 0x9086, 0xaaaa,
+	0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084, 0x0030, 0x9086,
+	0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084, 0x0030,
+	0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084,
+	0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a,
+	0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x0036, 0x0016,
+	0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180, 0x0020, 0x080c,
+	0x26f7, 0x900e, 0x0028, 0x080c, 0x655a, 0x1dc8, 0x2009, 0x0002,
+	0x2019, 0x0028, 0x080c, 0x2fa5, 0x9006, 0x0019, 0x001e, 0x003e,
+	0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130, 0x080c, 0xc20b,
+	0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee,
+	0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004,
+	0x0006, 0x6028, 0x0006, 0x0016, 0x6138, 0x6050, 0x9084, 0xfbff,
+	0x9085, 0x2000, 0x6052, 0x613a, 0x20a9, 0x0012, 0x1d04, 0x701e,
+	0x2091, 0x6000, 0x1f04, 0x701e, 0x602f, 0x0100, 0x602f, 0x0000,
+	0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x613a, 0x001e,
+	0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a, 0x000e, 0x6006,
+	0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001,
+	0x2001, 0x0001, 0x080c, 0x26d7, 0x2001, 0x00a0, 0x0006, 0x080c,
+	0xc212, 0x000e, 0x0130, 0x080c, 0x2b32, 0x9006, 0x080c, 0x2b3e,
+	0x0010, 0x080c, 0x2b14, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5,
+	0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x29d2, 0x00fe, 0x000e,
+	0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x6020,
+	0x9084, 0x0080, 0x0138, 0x2001, 0x180c, 0x200c, 0xc1c5, 0x2102,
+	0x0804, 0x70dd, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028,
+	0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001, 0x0090, 0x080c,
+	0x2b14, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518, 0x1d04, 0x708b,
+	0x2091, 0x6000, 0x1f04, 0x708b, 0x2011, 0x0003, 0x080c, 0x9771,
+	0x2011, 0x0002, 0x080c, 0x977b, 0x080c, 0x9662, 0x901e, 0x080c,
+	0x96d8, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c, 0x7296, 0x080c,
+	0x5cd1, 0x080c, 0xc212, 0x0110, 0x080c, 0x0d22, 0x9085, 0x0001,
+	0x0490, 0x86ff, 0x1110, 0x080c, 0x1982, 0x60e3, 0x0000, 0x2001,
+	0x0002, 0x080c, 0x26d7, 0x60e2, 0x2001, 0x0080, 0x080c, 0x2b14,
+	0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2a5d,
+	0x6024, 0x910c, 0x0138, 0x1d04, 0x70c2, 0x2091, 0x6000, 0x1f04,
+	0x70c2, 0x0810, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b0, 0x9005,
+	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xc212, 0x0110,
+	0x080c, 0x0d22, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000, 0x9086,
+	0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540, 0x9086,
+	0x5540, 0x1128, 0x2069, 0x1a49, 0x2d04, 0x8000, 0x206a, 0x2069,
+	0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005, 0x1904,
+	0x7150, 0x2001, 0x0088, 0x080c, 0x2b14, 0x9006, 0x60e2, 0x6886,
+	0x080c, 0x26d7, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
+	0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x6027, 0x0400,
+	0x2069, 0x1960, 0x7000, 0x206a, 0x7097, 0x0026, 0x7003, 0x0001,
+	0x20a9, 0x0002, 0x1d04, 0x7132, 0x2091, 0x6000, 0x1f04, 0x7132,
+	0x0804, 0x717d, 0x2069, 0x0140, 0x20a9, 0x0384, 0x6027, 0x1e00,
+	0x2009, 0x1e00, 0x080c, 0x2a5d, 0x6024, 0x910c, 0x0508, 0x9084,
+	0x1a00, 0x11f0, 0x1d04, 0x713e, 0x2091, 0x6000, 0x1f04, 0x713e,
+	0x2011, 0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b,
+	0x080c, 0x9662, 0x901e, 0x080c, 0x96d8, 0x2001, 0x00a0, 0x080c,
+	0x2b14, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x9085, 0x0001, 0x00a8,
+	0x2001, 0x0080, 0x080c, 0x2b14, 0x2069, 0x0140, 0x60e3, 0x0000,
+	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
+	0x0002, 0x080c, 0x26d7, 0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x6020, 0x9084, 0x00c0, 0x01c8, 0x2011, 0x0003, 0x080c, 0x9771,
+	0x2011, 0x0002, 0x080c, 0x977b, 0x080c, 0x9662, 0x901e, 0x080c,
+	0x96d8, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c,
+	0x7296, 0x080c, 0x5cd1, 0x0804, 0x7217, 0x2001, 0x180c, 0x200c,
+	0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6e1b, 0x2069, 0x0140,
+	0x2001, 0x0080, 0x080c, 0x2b14, 0x60e3, 0x0000, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0180, 0x6028, 0x9084,
+	0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0x1960, 0x7000, 0x206a,
+	0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x7217, 0x6027, 0x1e00,
+	0x2009, 0x1e00, 0x080c, 0x2a5d, 0x6024, 0x910c, 0x01c8, 0x9084,
+	0x1c00, 0x11b0, 0x1d04, 0x71d6, 0x0006, 0x0016, 0x00c6, 0x00d6,
+	0x00e6, 0x080c, 0x7f9c, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e,
+	0x00e6, 0x2071, 0x19cb, 0x7018, 0x00ee, 0x9005, 0x19f8, 0x01f8,
+	0x0026, 0x2011, 0x6e33, 0x080c, 0x8038, 0x2011, 0x6e26, 0x080c,
+	0x810c, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005,
+	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x0002, 0x080c,
+	0x26d7, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100,
+	0x2071, 0x1800, 0x080c, 0xc20b, 0x1904, 0x7284, 0x7130, 0xd184,
+	0x1170, 0x080c, 0x3133, 0x0138, 0xc18d, 0x7132, 0x2011, 0x1854,
+	0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904, 0x7284, 0x2011,
+	0x1854, 0x220c, 0x0438, 0x0016, 0x2019, 0x000e, 0x080c, 0xd4a6,
+	0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0,
+	0x9186, 0x0080, 0x0188, 0x080c, 0x623e, 0x1170, 0x2120, 0x9006,
+	0x0016, 0x2009, 0x000e, 0x080c, 0xd52a, 0x2009, 0x0001, 0x2011,
+	0x0100, 0x080c, 0x822f, 0x001e, 0x8108, 0x1f04, 0x724d, 0x00be,
+	0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019,
+	0x0004, 0x080c, 0x2fa5, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9,
+	0x007f, 0x900e, 0x080c, 0x623e, 0x1110, 0x080c, 0x5ceb, 0x8108,
+	0x1f04, 0x727a, 0x00be, 0x015e, 0x080c, 0x1982, 0x080c, 0x9db8,
+	0x60e3, 0x0000, 0x080c, 0x5cd1, 0x080c, 0x6ee4, 0x00ee, 0x00ce,
+	0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x194e,
+	0x2003, 0x0001, 0x0005, 0x2001, 0x194e, 0x2003, 0x0000, 0x0005,
+	0x2001, 0x194d, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x194d, 0x2003,
+	0x0000, 0x0005, 0x2071, 0x18f0, 0x7003, 0x0000, 0x7007, 0x0000,
+	0x080c, 0x1004, 0x090c, 0x0db4, 0xa8ab, 0xdcb0, 0x2900, 0x704e,
+	0x080c, 0x1004, 0x090c, 0x0db4, 0xa8ab, 0xdcb0, 0x2900, 0x7052,
+	0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0,
+	0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854,
+	0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854,
+	0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110,
+	0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e,
+	0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18f0,
+	0x6807, 0x0001, 0x00de, 0x080c, 0x7897, 0x9006, 0x00ee, 0x0005,
+	0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x2011, 0x0100, 0x2214,
+	0x9296, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04,
+	0x730c, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18f0, 0x7004,
+	0x0002, 0x732b, 0x732c, 0x7363, 0x73be, 0x74ff, 0x7329, 0x7329,
+	0x7529, 0x080c, 0x0db4, 0x0005, 0x2079, 0x0040, 0x782c, 0x908c,
+	0x0780, 0x190c, 0x7923, 0xd0a4, 0x01f0, 0x7824, 0x2048, 0x9006,
+	0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x0608,
+	0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003, 0x1160, 0x7104,
+	0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128, 0x9186, 0x0003,
+	0x19e8, 0x080c, 0x73be, 0x782c, 0xd09c, 0x090c, 0x7897, 0x0005,
+	0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x73f4,
+	0x0c90, 0x00e3, 0x08f0, 0x0005, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x7416, 0x73f4, 0x73f4, 0x73f4,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
+	0x7400, 0x73f4, 0x75fe, 0x73f4, 0x73f4, 0x73f4, 0x7416, 0x73f4,
+	0x7400, 0x763f, 0x7680, 0x76c7, 0x76db, 0x73f4, 0x73f4, 0x7416,
+	0x7400, 0x73f4, 0x73f4, 0x74d3, 0x7786, 0x77a1, 0x73f4, 0x7416,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x74c9, 0x77a1, 0x73f4, 0x73f4,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x742a,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
+	0x73f4, 0x78c7, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x743e,
+	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x2079, 0x0040,
+	0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x78c0, 0xd0a4,
+	0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084,
+	0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c,
+	0x7897, 0x0005, 0x73f4, 0x7400, 0x75ea, 0x73f4, 0x7400, 0x73f4,
+	0x7400, 0x7400, 0x73f4, 0x7400, 0x75ea, 0x7400, 0x7400, 0x7400,
+	0x7400, 0x7400, 0x73f4, 0x7400, 0x75ea, 0x73f4, 0x73f4, 0x7400,
+	0x73f4, 0x73f4, 0x73f4, 0x7400, 0x00e6, 0x2071, 0x18f0, 0x2009,
+	0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000, 0x0049, 0x0005,
+	0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800, 0x0009, 0x0005,
+	0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x0005, 0xa864, 0x8007,
+	0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x75a8, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x75a8, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001,
+	0x1120, 0x7007, 0x0001, 0x0804, 0x75c3, 0x7007, 0x0003, 0x7012,
+	0x2900, 0x7016, 0x701a, 0x704b, 0x75c3, 0x0005, 0xa864, 0x8007,
+	0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x73fc, 0x7007, 0x0001,
+	0x2009, 0x1833, 0x210c, 0x81ff, 0x1904, 0x74a0, 0xa994, 0x9186,
+	0x006f, 0x0188, 0x9186, 0x0074, 0x15b0, 0x0026, 0x2011, 0x0010,
+	0x080c, 0x6586, 0x002e, 0x0578, 0x0016, 0xa998, 0x080c, 0x65d0,
+	0x001e, 0x1548, 0x0400, 0x080c, 0x6fb2, 0x0140, 0xa897, 0x4005,
+	0xa89b, 0x0016, 0x2001, 0x0030, 0x900e, 0x0438, 0x0026, 0x2011,
+	0x8008, 0x080c, 0x6586, 0x002e, 0x01b0, 0x0016, 0x0026, 0x0036,
+	0xa998, 0xaaa0, 0xab9c, 0x918d, 0x8000, 0x080c, 0x65d0, 0x003e,
+	0x002e, 0x001e, 0x1140, 0xa897, 0x4005, 0xa89b, 0x4009, 0x2001,
+	0x0030, 0x900e, 0x0050, 0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883,
+	0x0000, 0x080c, 0x5f00, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x688c, 0x012e, 0x0ca0,
+	0xa994, 0x9186, 0x0071, 0x0904, 0x744e, 0x9186, 0x0064, 0x0904,
+	0x744e, 0x9186, 0x007c, 0x0904, 0x744e, 0x9186, 0x0028, 0x0904,
+	0x744e, 0x9186, 0x0038, 0x0904, 0x744e, 0x9186, 0x0078, 0x0904,
+	0x744e, 0x9186, 0x005f, 0x0904, 0x744e, 0x9186, 0x0056, 0x0904,
+	0x744e, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030, 0x900e,
+	0x0860, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007,
+	0x0001, 0x0804, 0x77b8, 0x2900, 0x7016, 0x701a, 0x20a9, 0x0004,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050, 0x2040,
+	0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003, 0xa888,
+	0x7012, 0x9082, 0x0401, 0x1a04, 0x7404, 0xaab4, 0x928a, 0x0002,
+	0x1a04, 0x7404, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118,
+	0x2001, 0x7566, 0x0018, 0x9280, 0x755c, 0x2005, 0x7056, 0x7010,
+	0x9015, 0x0904, 0x7547, 0x080c, 0x1004, 0x1118, 0x7007, 0x0004,
+	0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866, 0x7050,
+	0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072, 0xe008,
+	0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003, 0x800b,
+	0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c,
+	0x10d5, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200, 0x0118,
+	0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x101d, 0x7014,
+	0x2048, 0x0804, 0x7404, 0x7020, 0x2048, 0x7018, 0xa802, 0xa807,
+	0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x74ff, 0x7014,
+	0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc,
+	0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e,
+	0x0904, 0x77b8, 0x0804, 0x75a8, 0x755e, 0x7562, 0x0002, 0x001d,
+	0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a, 0x001d,
+	0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050,
+	0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce,
+	0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba,
+	0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae,
+	0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a,
+	0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e,
+	0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e,
+	0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e, 0x0005,
+	0x2009, 0x1833, 0x210c, 0x81ff, 0x1178, 0x080c, 0x5d4d, 0x1108,
+	0x0005, 0x080c, 0x6ac6, 0x0126, 0x2091, 0x8000, 0x080c, 0xbe06,
+	0x080c, 0x688c, 0x012e, 0x0ca0, 0x080c, 0xc20b, 0x1d70, 0x2001,
+	0x0028, 0x900e, 0x0c70, 0x2009, 0x1833, 0x210c, 0x81ff, 0x11d8,
+	0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120,
+	0x080c, 0x5e62, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c, 0x5ddd,
+	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x080c,
+	0x688c, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98, 0x2001,
+	0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906, 0x711a,
+	0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030, 0x7014,
+	0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6, 0x7007,
+	0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004, 0x0540,
+	0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9, 0x0800,
+	0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c, 0x623e,
+	0x11b8, 0x0066, 0xae80, 0x080c, 0x634e, 0x006e, 0x0088, 0x0046,
+	0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6, 0x080c,
+	0x623e, 0x1110, 0x080c, 0x644e, 0x8108, 0x1f04, 0x7627, 0x00ce,
+	0xa87c, 0xd084, 0x1120, 0x080c, 0x101d, 0x00be, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x00be, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x655e, 0x0580, 0x2061,
+	0x1a41, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff, 0x1550,
+	0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003, 0x0000,
+	0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005, 0x1110,
+	0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff, 0x0178,
+	0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a, 0xa888,
+	0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x7881, 0x012e,
+	0x0804, 0x787b, 0x012e, 0x0804, 0x7875, 0x012e, 0x0804, 0x7878,
+	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x655e, 0x05e0,
+	0x2061, 0x1a41, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c,
+	0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c, 0x00ff,
+	0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001, 0x1508,
+	0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988, 0x810f,
+	0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318, 0x0288,
+	0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250, 0xa890,
+	0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e, 0x0804,
+	0x7881, 0x012e, 0x0804, 0x787e, 0x012e, 0x0804, 0x787b, 0x0126,
+	0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a41, 0x6300, 0xd38c,
+	0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804, 0x788f,
+	0x012e, 0x0804, 0x787e, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
+	0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a41,
+	0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888, 0x9005,
+	0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1833, 0x2004, 0x9005,
+	0x0118, 0x080c, 0x9e62, 0x0068, 0x6017, 0xf400, 0x605b, 0x0000,
+	0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009, 0x0041, 0x080c,
+	0x9eac, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138, 0x0026,
+	0x900e, 0x2011, 0xfdff, 0x080c, 0x822f, 0x002e, 0xa87c, 0xd0c4,
+	0x0148, 0x2061, 0x1a41, 0x6000, 0xd08c, 0x1120, 0x6008, 0x8000,
+	0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7881, 0x00ce,
+	0x012e, 0x00be, 0x0804, 0x787b, 0xa984, 0x9186, 0x002e, 0x0d30,
+	0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186, 0x002a,
+	0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8, 0x9186,
+	0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c, 0x623e,
+	0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8,
+	0x6007, 0x0024, 0x2001, 0x1957, 0x2004, 0x601a, 0x0804, 0x7716,
+	0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001, 0x1833,
+	0x2004, 0x9005, 0x0150, 0x080c, 0x9e62, 0x8eff, 0x0118, 0x2e60,
+	0x080c, 0x9e62, 0x00ee, 0x0804, 0x7716, 0x6024, 0xc0dc, 0xc0d5,
+	0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007,
+	0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x00ee, 0x0804, 0x7716, 0x2061, 0x1a41,
+	0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x788f, 0x0126, 0x2091,
+	0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804, 0x788f,
+	0x012e, 0xa883, 0x0016, 0x0804, 0x7888, 0xa883, 0x0007, 0x0804,
+	0x7888, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001, 0x1138,
+	0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x73fc, 0x0040, 0x7007,
+	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x77b8, 0x0005,
+	0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061, 0x1800,
+	0x61cc, 0x81ff, 0x1904, 0x783a, 0x6130, 0xd194, 0x1904, 0x7864,
+	0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x782e, 0x6064, 0x9e02,
+	0x1a04, 0x782e, 0x7120, 0x9186, 0x0006, 0x1904, 0x7820, 0x7010,
+	0x905d, 0x0904, 0x783a, 0xb800, 0xd0e4, 0x1904, 0x785e, 0x2061,
+	0x1a41, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0, 0x7024,
+	0xd0dc, 0x1904, 0x7867, 0xa883, 0x0000, 0xa803, 0x0000, 0x2908,
+	0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904, 0x786a,
+	0x080c, 0x5386, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60,
+	0x080c, 0x814f, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048, 0xa800,
+	0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904, 0x786a,
+	0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883, 0x0006,
+	0x00be, 0x0804, 0x7888, 0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0,
+	0xa974, 0x080c, 0x623e, 0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120,
+	0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883, 0x0008,
+	0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448, 0xa883,
+	0x0035, 0x0430, 0x080c, 0x538a, 0xd0fc, 0x01e8, 0xa878, 0x2070,
+	0x9e82, 0x1cd0, 0x02c0, 0x6064, 0x9e02, 0x12a8, 0x7120, 0x9186,
+	0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158,
+	0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x77c4, 0x7003,
+	0x0002, 0x0804, 0x77c4, 0xa883, 0x0028, 0x0010, 0xa883, 0x0029,
+	0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883,
+	0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014, 0x080c,
+	0xd0e5, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e, 0x0058,
+	0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009, 0x0016,
+	0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105, 0xa886,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x0005, 0x080c,
+	0x101d, 0x0005, 0x00d6, 0x080c, 0x8146, 0x00de, 0x0005, 0x00d6,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c, 0xd084,
+	0x01d8, 0x908c, 0x0780, 0x190c, 0x7923, 0xd09c, 0x11a8, 0x2071,
+	0x1800, 0x70bc, 0x90ea, 0x0040, 0x0278, 0x8001, 0x70be, 0x702c,
+	0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071, 0x0040,
+	0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005,
+	0x0006, 0x9084, 0x0780, 0x190c, 0x7923, 0x000e, 0x0005, 0x00d6,
+	0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74,
+	0x9282, 0x0004, 0x1a04, 0x7914, 0xa97c, 0x9188, 0x1000, 0x2104,
+	0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff,
+	0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0x9ddc, 0x1118,
+	0x080c, 0x9e7f, 0x05a8, 0x6212, 0xa874, 0x0002, 0x78f2, 0x78f7,
+	0x78fa, 0x7900, 0x2019, 0x0002, 0x080c, 0xd4a6, 0x0060, 0x080c,
+	0xd442, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xd45d, 0x0018,
+	0xa980, 0x080c, 0xd442, 0x080c, 0x9e32, 0xa887, 0x0000, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x00be, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887,
+	0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38,
+	0xa887, 0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7925, 0x0006,
+	0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0dbd, 0x2001, 0x1833,
+	0x2004, 0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001,
+	0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c,
+	0xd1ec, 0x1120, 0x080c, 0x14a7, 0x00fe, 0x0005, 0x2001, 0x020d,
+	0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c,
+	0x0904, 0x79a5, 0x68bc, 0x90aa, 0x0005, 0x0a04, 0x7f54, 0x7d44,
+	0x7c40, 0x9584, 0x00f6, 0x1510, 0x9484, 0x7000, 0x0140, 0x908a,
+	0x2000, 0x1260, 0x9584, 0x0700, 0x8007, 0x0804, 0x79ac, 0x7000,
+	0x9084, 0xff00, 0x9086, 0x8100, 0x0da8, 0x00b0, 0x9484, 0x0fff,
+	0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c,
+	0xd88c, 0x080c, 0x7e99, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076,
+	0x1118, 0x080c, 0x7ef7, 0x19c0, 0xd5a4, 0x0148, 0x0046, 0x0056,
+	0x080c, 0x7a07, 0x080c, 0x21cd, 0x005e, 0x004e, 0x0020, 0x080c,
+	0xd88c, 0x7817, 0x0140, 0x080c, 0x6fb2, 0x0168, 0x2001, 0x0111,
+	0x2004, 0xd08c, 0x0140, 0x688f, 0x0000, 0x2001, 0x0110, 0x2003,
+	0x0008, 0x2003, 0x0000, 0x080c, 0x79e8, 0x2001, 0x19c1, 0x2004,
+	0x9005, 0x090c, 0x8973, 0x0005, 0x0002, 0x79be, 0x7cbb, 0x79b5,
+	0x79b5, 0x79b5, 0x79b5, 0x79b5, 0x79b5, 0x7817, 0x0140, 0x2001,
+	0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x0005, 0x7000, 0x908c,
+	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e, 0x9286,
+	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x53e7,
+	0x0070, 0x080c, 0x7a27, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
+	0x7bf6, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7dc9, 0x7817,
+	0x0140, 0x2001, 0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518,
+	0x080c, 0x48d9, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056,
+	0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019,
+	0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c,
+	0x48d9, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6,
+	0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120,
+	0x9096, 0x0023, 0x1904, 0x7bc7, 0x9186, 0x0023, 0x15c0, 0x080c,
+	0x7e5e, 0x0904, 0x7bc7, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186,
+	0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904,
+	0x7bc7, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009,
+	0x0015, 0x080c, 0x9eac, 0x0804, 0x7bc7, 0x908e, 0x0214, 0x0118,
+	0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0x9eac, 0x0804,
+	0x7bc7, 0x908e, 0x0100, 0x1904, 0x7bc7, 0x7034, 0x9005, 0x1904,
+	0x7bc7, 0x2009, 0x0016, 0x080c, 0x9eac, 0x0804, 0x7bc7, 0x9186,
+	0x0022, 0x1904, 0x7bc7, 0x7030, 0x908e, 0x0300, 0x1580, 0x68d8,
+	0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100, 0x918c, 0x00ff, 0x697a,
+	0x7004, 0x687e, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006,
+	0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x26ac, 0x7932, 0x7936,
+	0x001e, 0x000e, 0x00fe, 0x080c, 0x2663, 0x695a, 0x703c, 0x00e6,
+	0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b2, 0x00ee, 0x7034,
+	0x9005, 0x1904, 0x7bc7, 0x2009, 0x0017, 0x0804, 0x7b77, 0x908e,
+	0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x7bc7, 0x080c, 0x6fb2,
+	0x0120, 0x2009, 0x001d, 0x0804, 0x7b77, 0x68d8, 0xc0a5, 0x68da,
+	0x2009, 0x0030, 0x0804, 0x7b77, 0x908e, 0x0500, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x7bc7, 0x2009, 0x0018, 0x0804, 0x7b77, 0x908e,
+	0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7b77, 0x908e, 0x2110,
+	0x1120, 0x2009, 0x001a, 0x0804, 0x7b77, 0x908e, 0x5200, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x7bc7, 0x2009, 0x001b, 0x0804, 0x7b77,
+	0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x7bc7, 0x2009,
+	0x001c, 0x0804, 0x7b77, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034,
+	0x0804, 0x7b77, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x7bc7, 0x2009, 0x0024, 0x0804, 0x7b77, 0x908c, 0xff00, 0x918e,
+	0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c,
+	0x0904, 0x7b77, 0x080c, 0xc8b8, 0x1904, 0x7bc7, 0x0804, 0x7b75,
+	0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804,
+	0x7b77, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7b77,
+	0x908e, 0x6104, 0x1528, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208,
+	0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015,
+	0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x48d9, 0x004e, 0x8108,
+	0x0f04, 0x7b43, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a,
+	0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0478,
+	0x908e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0448, 0x908e, 0x7800,
+	0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009,
+	0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8,
+	0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078,
+	0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038,
+	0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x1904,
+	0x7bca, 0x080c, 0x61de, 0x1904, 0x7bca, 0xbe12, 0xbd16, 0x001e,
+	0x0016, 0x080c, 0x6fb2, 0x01c0, 0x68d8, 0xd08c, 0x1148, 0x7000,
+	0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168, 0x0040,
+	0x6878, 0x9606, 0x1148, 0x687c, 0x9506, 0x9084, 0xff00, 0x1120,
+	0x9584, 0x00ff, 0xb8b2, 0x0080, 0xb8b0, 0x9005, 0x1168, 0x9186,
 	0x0046, 0x1150, 0x6878, 0x9606, 0x1138, 0x687c, 0x9506, 0x9084,
-	0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0x9dc3, 0x01a8, 0x2b08,
+	0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0x9ddc, 0x01a8, 0x2b08,
 	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c,
-	0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0x9e93, 0x00ce,
+	0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0x9eac, 0x00ce,
 	0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec,
-	0x0120, 0x2011, 0x8049, 0x080c, 0x48d2, 0x080c, 0x9e66, 0x0d90,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x48d9, 0x080c, 0x9e7f, 0x0d90,
 	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016,
 	0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009,
 	0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f,
-	0x0009, 0x6003, 0x0001, 0x080c, 0x8411, 0x08a0, 0x080c, 0x30f6,
+	0x0009, 0x6003, 0x0001, 0x080c, 0x8439, 0x08a0, 0x080c, 0x30fd,
 	0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108,
 	0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x7e36, 0x0904, 0x7c2b,
+	0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x7e5e, 0x0904, 0x7c53,
 	0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005,
-	0x15d0, 0x2009, 0x0015, 0x080c, 0x9e93, 0x04a8, 0x908e, 0x0100,
-	0x1590, 0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0x9e93,
+	0x15d0, 0x2009, 0x0015, 0x080c, 0x9eac, 0x04a8, 0x908e, 0x0100,
+	0x1590, 0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0x9eac,
 	0x0450, 0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518,
 	0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
-	0x080c, 0x2663, 0x11b8, 0x080c, 0x61d7, 0x11a0, 0xbe12, 0xbd16,
-	0x080c, 0x9dc3, 0x0178, 0x2b08, 0x6112, 0x080c, 0xbf73, 0x6023,
-	0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x9e93, 0x080c, 0x894b,
+	0x080c, 0x2663, 0x11b8, 0x080c, 0x61de, 0x11a0, 0xbe12, 0xbd16,
+	0x080c, 0x9ddc, 0x0178, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x9eac, 0x080c, 0x8973,
 	0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6,
 	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8,
 	0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f,
-	0x0804, 0x7c8d, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
-	0x7c8d, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
+	0x0804, 0x7cb5, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
+	0x7cb5, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
 	0x0000, 0x2019, 0x1836, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9,
 	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f,
 	0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0,
 	0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600,
 	0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745,
 	0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6,
-	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7c62, 0x82ff, 0x1118,
+	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7c8a, 0x82ff, 0x1118,
 	0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee,
 	0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184,
-	0x000f, 0x0002, 0x7caa, 0x7caa, 0x7caa, 0x7e48, 0x7caa, 0x7cb3,
-	0x7cde, 0x7d6c, 0x7caa, 0x7caa, 0x7caa, 0x7caa, 0x7caa, 0x7caa,
-	0x7caa, 0x7caa, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
-	0x090c, 0x894b, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120,
+	0x000f, 0x0002, 0x7cd2, 0x7cd2, 0x7cd2, 0x7e70, 0x7cd2, 0x7cdb,
+	0x7d06, 0x7d94, 0x7cd2, 0x7cd2, 0x7cd2, 0x7cd2, 0x7cd2, 0x7cd2,
+	0x7cd2, 0x7cd2, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
+	0x090c, 0x8973, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120,
 	0x2160, 0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6864,
 	0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
 	0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x0046, 0x080c, 0x9e93, 0x7817, 0x0140, 0x2001, 0x19c1,
-	0x2004, 0x9005, 0x090c, 0x894b, 0x00be, 0x0005, 0x00b6, 0x00c6,
-	0x9484, 0x0fff, 0x0904, 0x7d42, 0x7110, 0xd1bc, 0x1904, 0x7d42,
+	0x2009, 0x0046, 0x080c, 0x9eac, 0x7817, 0x0140, 0x2001, 0x19c1,
+	0x2004, 0x9005, 0x090c, 0x8973, 0x00be, 0x0005, 0x00b6, 0x00c6,
+	0x9484, 0x0fff, 0x0904, 0x7d6a, 0x7110, 0xd1bc, 0x1904, 0x7d6a,
 	0x7108, 0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00,
-	0x15b0, 0x81ff, 0x15a0, 0x9080, 0x3131, 0x200d, 0x918c, 0xff00,
-	0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x7d42, 0x080c, 0x61d7,
-	0x1904, 0x7d42, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04,
-	0x9294, 0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0x9dc3, 0x05e8,
+	0x15b0, 0x81ff, 0x15a0, 0x9080, 0x3138, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x7d6a, 0x080c, 0x61de,
+	0x1904, 0x7d6a, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04,
+	0x9294, 0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0x9ddc, 0x05e8,
 	0x2b08, 0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006,
-	0x7120, 0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xcaf6,
-	0x0408, 0x080c, 0x655b, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c,
-	0x7c2f, 0x11c0, 0x0898, 0x080c, 0x9dc3, 0x2b08, 0x0198, 0x6112,
+	0x7120, 0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xcb14,
+	0x0408, 0x080c, 0x6562, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c,
+	0x7c57, 0x11c0, 0x0898, 0x080c, 0x9ddc, 0x2b08, 0x0198, 0x6112,
 	0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007,
-	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8411,
-	0x080c, 0x894b, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
-	0x090c, 0x894b, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d2, 0x080c, 0x9e66,
+	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8439,
+	0x080c, 0x8973, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
+	0x090c, 0x8973, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d9, 0x080c, 0x9e7f,
 	0x0d48, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130,
 	0x6156, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x83c9, 0x080c, 0x894b, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
+	0x83f1, 0x080c, 0x8973, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
 	0x7020, 0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8,
 	0x6864, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158,
 	0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x0045, 0x080c, 0x9e93, 0x7817, 0x0140, 0x2001,
-	0x19c1, 0x2004, 0x9005, 0x090c, 0x894b, 0x00be, 0x0005, 0x6120,
+	0x610a, 0x2009, 0x0045, 0x080c, 0x9eac, 0x7817, 0x0140, 0x2001,
+	0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x00be, 0x0005, 0x6120,
 	0x9186, 0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x30f6, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007,
+	0x0005, 0x080c, 0x30fd, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007,
 	0x9086, 0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208,
-	0x000b, 0x0005, 0x7db8, 0x7db9, 0x7db8, 0x7db8, 0x7e18, 0x7e27,
+	0x000b, 0x0005, 0x7de0, 0x7de1, 0x7de0, 0x7de0, 0x7e40, 0x7e4f,
 	0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904,
-	0x7e16, 0x700c, 0x7108, 0x080c, 0x2663, 0x1904, 0x7e16, 0x080c,
-	0x61d7, 0x1904, 0x7e16, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8,
-	0x080c, 0x655b, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c,
-	0x7e36, 0x00ce, 0x05d8, 0x080c, 0x9dc3, 0x2b08, 0x05b8, 0x6112,
-	0x080c, 0xbf73, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088,
-	0x080c, 0x9e93, 0x0458, 0x080c, 0x655b, 0x0148, 0x9086, 0x0004,
-	0x0130, 0x080c, 0x6563, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c,
-	0x9dc3, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xbf73, 0x6023, 0x0005,
-	0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9e93, 0x0078, 0x080c,
-	0x9dc3, 0x2b08, 0x0158, 0x6112, 0x080c, 0xbf73, 0x6023, 0x0004,
-	0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x9e93, 0x00be, 0x0005,
-	0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7d97, 0x1130,
-	0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0x9e93, 0x0005, 0x7110,
-	0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x7d97, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x008a, 0x080c, 0x9e93, 0x0005, 0x7020, 0x2060,
+	0x7e3e, 0x700c, 0x7108, 0x080c, 0x2663, 0x1904, 0x7e3e, 0x080c,
+	0x61de, 0x1904, 0x7e3e, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8,
+	0x080c, 0x6562, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c,
+	0x7e5e, 0x00ce, 0x05d8, 0x080c, 0x9ddc, 0x2b08, 0x05b8, 0x6112,
+	0x080c, 0xbf8c, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088,
+	0x080c, 0x9eac, 0x0458, 0x080c, 0x6562, 0x0148, 0x9086, 0x0004,
+	0x0130, 0x080c, 0x656a, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c,
+	0x9ddc, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0005,
+	0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9eac, 0x0078, 0x080c,
+	0x9ddc, 0x2b08, 0x0158, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x9eac, 0x00be, 0x0005,
+	0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7dbf, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0x9eac, 0x0005, 0x7110,
+	0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x7dbf, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x008a, 0x080c, 0x9eac, 0x0005, 0x7020, 0x2060,
 	0x9c84, 0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x1819,
 	0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8,
 	0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007,
 	0x11b0, 0x9c82, 0x1cd0, 0x0298, 0x6864, 0x9c02, 0x1280, 0x7008,
 	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c,
-	0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9e93, 0x7817,
-	0x0140, 0x2001, 0x19c1, 0x2004, 0x9005, 0x090c, 0x894b, 0x00be,
+	0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9eac, 0x7817,
+	0x0140, 0x2001, 0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x00be,
 	0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049,
 	0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009,
 	0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086,
-	0xc000, 0x05d0, 0x080c, 0x9dc3, 0x05b8, 0x0066, 0x00c6, 0x0046,
+	0xc000, 0x05d0, 0x080c, 0x9ddc, 0x05b8, 0x0066, 0x00c6, 0x0046,
 	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x15a0,
-	0x080c, 0x61d7, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
-	0x6012, 0x080c, 0xbf73, 0x080c, 0x0feb, 0x0510, 0x2900, 0x605a,
+	0x080c, 0x61de, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
+	0x6012, 0x080c, 0xbf8c, 0x080c, 0x0feb, 0x0510, 0x2900, 0x605a,
 	0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9,
 	0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003,
 	0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x8411, 0x080c, 0x894b, 0x00fe, 0x009e, 0x00ce, 0x0005,
-	0x080c, 0x9e19, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6,
+	0x080c, 0x8439, 0x080c, 0x8973, 0x00fe, 0x009e, 0x00ce, 0x0005,
+	0x080c, 0x9e32, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6,
 	0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000,
-	0x1904, 0x7f26, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004,
-	0x9005, 0x1904, 0x7f28, 0x7030, 0x908e, 0x0400, 0x0904, 0x7f28,
+	0x1904, 0x7f4e, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004,
+	0x9005, 0x1904, 0x7f50, 0x7030, 0x908e, 0x0400, 0x0904, 0x7f50,
 	0x908e, 0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300,
 	0x11d8, 0x2009, 0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580,
-	0x080c, 0x6519, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c,
+	0x080c, 0x6520, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c,
 	0x00ff, 0x9106, 0x1518, 0x687c, 0x69ac, 0x918c, 0xff00, 0x9105,
 	0x7104, 0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4,
 	0x11a8, 0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e,
-	0x5000, 0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7e36,
+	0x5000, 0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7e5e,
 	0x0128, 0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010,
 	0x9085, 0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800,
 	0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800,
@@ -3869,20 +3874,20 @@ unsigned short risc_code01[] = {
 	0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084,
 	0x7036, 0x00ee, 0x0005, 0x2071, 0x19cb, 0x7003, 0x0003, 0x700f,
 	0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007,
-	0x0000, 0x7026, 0x702b, 0x93a9, 0x7032, 0x7037, 0x9417, 0x703f,
-	0xffff, 0x7042, 0x7047, 0x521e, 0x704a, 0x705b, 0x80ab, 0x080c,
+	0x0000, 0x7026, 0x702b, 0x93c2, 0x7032, 0x7037, 0x9430, 0x703f,
+	0xffff, 0x7042, 0x7047, 0x5225, 0x704a, 0x705b, 0x80d3, 0x080c,
 	0x1004, 0x090c, 0x0db4, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f,
-	0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19cb, 0x1d04, 0x7fff,
+	0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19cb, 0x1d04, 0x8027,
 	0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1510, 0x2001, 0x1875,
 	0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000,
 	0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x0db4, 0x700f, 0x0361,
-	0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x080c, 0x80f0, 0x7040,
+	0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x080c, 0x8118, 0x7040,
 	0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, 0x080f, 0x0018,
 	0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, 0x7020, 0x8001,
 	0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0x9186, 0x03e8,
 	0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, 0x7030,
 	0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160, 0x702f, 0x0009,
-	0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x9524, 0x0010,
+	0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x953d, 0x0010,
 	0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310, 0x8001, 0x703e,
 	0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a, 0x1148, 0x704b,
 	0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, 0x7058, 0x080f,
@@ -3890,22 +3895,22 @@ unsigned short risc_code01[] = {
 	0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109, 0x7172, 0x1110,
 	0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a, 0x1138, 0x700b,
 	0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, 0x012e, 0x7004,
-	0x0002, 0x8027, 0x8028, 0x8044, 0x00e6, 0x2071, 0x19cb, 0x7018,
+	0x0002, 0x804f, 0x8050, 0x806c, 0x00e6, 0x2071, 0x19cb, 0x7018,
 	0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005,
 	0x00e6, 0x0006, 0x2071, 0x19cb, 0x701c, 0x9206, 0x1120, 0x701a,
 	0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071,
 	0x19cb, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005,
-	0x00b6, 0x7110, 0x080c, 0x6237, 0x1168, 0xb888, 0x8001, 0x0250,
-	0xb88a, 0x1140, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0x894b,
+	0x00b6, 0x7110, 0x080c, 0x623e, 0x1168, 0xb888, 0x8001, 0x0250,
+	0xb88a, 0x1140, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0x8973,
 	0x001e, 0x012e, 0x8108, 0x9182, 0x0800, 0x0218, 0x900e, 0x7007,
 	0x0002, 0x7112, 0x00be, 0x0005, 0x7014, 0x2060, 0x0126, 0x2091,
 	0x8000, 0x6040, 0x9005, 0x0128, 0x8001, 0x6042, 0x1110, 0x080c,
-	0xbe04, 0x6018, 0x9005, 0x0528, 0x8001, 0x601a, 0x1510, 0x6120,
-	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x11c8, 0x080c, 0xbafe,
+	0xbe1d, 0x6018, 0x9005, 0x0528, 0x8001, 0x601a, 0x1510, 0x6120,
+	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x11c8, 0x080c, 0xbb17,
 	0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082,
 	0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
 	0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110, 0x080c,
-	0xb7fc, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x1819, 0x2004,
+	0xb815, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x1819, 0x2004,
 	0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005, 0x00e6,
 	0x2071, 0x19cb, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
 	0x2001, 0x19d4, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19cb,
@@ -3915,7 +3920,7 @@ unsigned short risc_code01[] = {
 	0x2001, 0x19d9, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068,
 	0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c,
 	0x10d5, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x7f74,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x7f9c,
 	0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
 	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19cb, 0x7172, 0x7276,
 	0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19cb,
@@ -3930,93 +3935,93 @@ unsigned short risc_code01[] = {
 	0x908a, 0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a41,
 	0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e,
 	0xffff, 0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c,
-	0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x81b1, 0xd0b4, 0x1168,
-	0xd0bc, 0x1904, 0x818a, 0x2009, 0x0006, 0x080c, 0x81de, 0x0005,
+	0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x81d9, 0xd0b4, 0x1168,
+	0xd0bc, 0x1904, 0x81b2, 0x2009, 0x0006, 0x080c, 0x8206, 0x0005,
 	0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c,
-	0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x81d8, 0x908c, 0x2020,
+	0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x8200, 0x908c, 0x2020,
 	0x918e, 0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1875,
 	0x2104, 0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804,
-	0x9e93, 0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0x9e93,
+	0x9eac, 0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0x9eac,
 	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024,
 	0xc0cd, 0x6026, 0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c,
 	0x6032, 0x08e0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e,
-	0x0003, 0x1904, 0x81d8, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170,
+	0x0003, 0x1904, 0x8200, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170,
 	0x0076, 0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x007e, 0x87ff,
-	0x1120, 0x2009, 0x0042, 0x080c, 0x9e93, 0x0005, 0x6110, 0x00b6,
+	0x1120, 0x2009, 0x0042, 0x080c, 0x9eac, 0x0005, 0x6110, 0x00b6,
 	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126,
 	0x0c38, 0xd0fc, 0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8,
 	0x9084, 0x0003, 0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009,
-	0x0041, 0x080c, 0x9e93, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8,
-	0x2009, 0x0043, 0x080c, 0x9e93, 0x0cb0, 0x6110, 0x00b6, 0x2158,
+	0x0041, 0x080c, 0x9eac, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8,
+	0x2009, 0x0043, 0x080c, 0x9eac, 0x0cb0, 0x6110, 0x00b6, 0x2158,
 	0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00,
 	0x2009, 0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c,
-	0xbafe, 0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186,
+	0xbb17, 0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186,
 	0x0001, 0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158,
 	0x00c6, 0x2061, 0x1a41, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210,
-	0x0208, 0x6206, 0x00ce, 0x080c, 0x66bf, 0x6014, 0x904d, 0x0076,
-	0x2039, 0x0000, 0x190c, 0x8127, 0x007e, 0x009e, 0x0005, 0x0156,
+	0x0208, 0x6206, 0x00ce, 0x080c, 0x66c6, 0x6014, 0x904d, 0x0076,
+	0x2039, 0x0000, 0x190c, 0x814f, 0x007e, 0x009e, 0x0005, 0x0156,
 	0x00c6, 0x2061, 0x1a41, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008,
 	0x9204, 0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138,
 	0x6808, 0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005,
 	0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006,
 	0x8004, 0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118, 0x8086,
 	0x818e, 0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200,
-	0x1f04, 0x8229, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020,
+	0x1f04, 0x8251, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020,
 	0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e, 0x0005,
 	0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005,
 	0x0510, 0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c, 0x97be,
 	0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228, 0x911a,
-	0x1220, 0x1f04, 0x8253, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
-	0x8253, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
+	0x1220, 0x1f04, 0x827b, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
+	0x827b, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
 	0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8,
 	0x0126, 0x2091, 0x2800, 0x2079, 0x19b8, 0x012e, 0x00d6, 0x2069,
 	0x19b8, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000,
-	0x2069, 0x0200, 0x080c, 0x9c26, 0x0401, 0x080c, 0x9c11, 0x00e9,
-	0x080c, 0x9c14, 0x00d1, 0x080c, 0x9c17, 0x00b9, 0x080c, 0x9c1a,
-	0x00a1, 0x080c, 0x9c1d, 0x0089, 0x080c, 0x9c20, 0x0071, 0x080c,
-	0x9c23, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04,
+	0x2069, 0x0200, 0x080c, 0x9c3f, 0x0401, 0x080c, 0x9c2a, 0x00e9,
+	0x080c, 0x9c2d, 0x00d1, 0x080c, 0x9c30, 0x00b9, 0x080c, 0x9c33,
+	0x00a1, 0x080c, 0x9c36, 0x0089, 0x080c, 0x9c39, 0x0071, 0x080c,
+	0x9c3c, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04,
 	0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1,
 	0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027, 0x0001,
-	0x7804, 0x9084, 0x0007, 0x0002, 0x82c6, 0x82ea, 0x8329, 0x82cc,
-	0x82ea, 0x82c6, 0x82c4, 0x82c4, 0x080c, 0x0db4, 0x080c, 0x8090,
-	0x080c, 0x894b, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce,
-	0x0005, 0x2011, 0x5b33, 0x080c, 0x8010, 0x7828, 0x9092, 0x00c8,
-	0x1228, 0x8000, 0x782a, 0x080c, 0x5b73, 0x0c88, 0x62c0, 0x080c,
-	0x9c2a, 0x080c, 0x5b33, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
-	0x0000, 0x0c28, 0x080c, 0x8090, 0x6220, 0xd2a4, 0x0160, 0x782b,
+	0x7804, 0x9084, 0x0007, 0x0002, 0x82ee, 0x8312, 0x8351, 0x82f4,
+	0x8312, 0x82ee, 0x82ec, 0x82ec, 0x080c, 0x0db4, 0x080c, 0x80b8,
+	0x080c, 0x8973, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce,
+	0x0005, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x7828, 0x9092, 0x00c8,
+	0x1228, 0x8000, 0x782a, 0x080c, 0x5b7a, 0x0c88, 0x62c0, 0x080c,
+	0x9c43, 0x080c, 0x5b3a, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
+	0x0000, 0x0c28, 0x080c, 0x80b8, 0x6220, 0xd2a4, 0x0160, 0x782b,
 	0x0000, 0x7824, 0x9065, 0x090c, 0x0db4, 0x2009, 0x0013, 0x080c,
-	0x9e93, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0db4,
+	0x9eac, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0db4,
 	0x7828, 0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c,
 	0x29ca, 0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c,
-	0x0db4, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x894b,
-	0x0c00, 0x080c, 0x936f, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c,
-	0x9c2a, 0x080c, 0xd8a9, 0x2009, 0x0014, 0x080c, 0x9e93, 0x00ce,
+	0x0db4, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x8973,
+	0x0c00, 0x080c, 0x9388, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c,
+	0x9c43, 0x080c, 0xd8c9, 0x2009, 0x0014, 0x080c, 0x9eac, 0x00ce,
 	0x0880, 0x2001, 0x19d4, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160,
 	0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0db4, 0x2009, 0x0013,
-	0x080c, 0x9ee5, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824,
+	0x080c, 0x9efe, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824,
 	0x9005, 0x090c, 0x0db4, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000,
 	0x782a, 0x00de, 0x00ce, 0x00be, 0x080c, 0x29ca, 0x02f0, 0x00b6,
 	0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c, 0x0db4, 0xb800, 0xc0dc,
-	0xb802, 0x7924, 0x2160, 0x080c, 0x9e19, 0xb93c, 0x81ff, 0x090c,
+	0xb802, 0x7924, 0x2160, 0x080c, 0x9e32, 0xb93c, 0x81ff, 0x090c,
 	0x0db4, 0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de,
-	0x00ce, 0x00be, 0x080c, 0x894b, 0x0868, 0x080c, 0x936f, 0x0850,
-	0x2011, 0x0130, 0x2214, 0x080c, 0x9c2a, 0x080c, 0xd8a9, 0x7824,
-	0x9065, 0x2009, 0x0014, 0x080c, 0x9e93, 0x00de, 0x00ce, 0x00be,
-	0x0804, 0x833a, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c,
+	0x00ce, 0x00be, 0x080c, 0x8973, 0x0868, 0x080c, 0x9388, 0x0850,
+	0x2011, 0x0130, 0x2214, 0x080c, 0x9c43, 0x080c, 0xd8c9, 0x7824,
+	0x9065, 0x2009, 0x0014, 0x080c, 0x9eac, 0x00de, 0x00ce, 0x00be,
+	0x0804, 0x8362, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c,
 	0x1d4a, 0x6024, 0x6027, 0x0002, 0xd0f4, 0x1580, 0x62c8, 0x60c4,
 	0x9205, 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c,
-	0x9e93, 0x00ce, 0x0005, 0x2011, 0x19d7, 0x2013, 0x0000, 0x0cc8,
+	0x9eac, 0x00ce, 0x0005, 0x2011, 0x19d7, 0x2013, 0x0000, 0x0cc8,
 	0x793c, 0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x12f0, 0x8108,
 	0x7946, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138,
 	0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x6014,
 	0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x08d8, 0x793c, 0x2160,
-	0x2009, 0x004a, 0x080c, 0x9e93, 0x08a0, 0x7848, 0xc085, 0x784a,
+	0x2009, 0x004a, 0x080c, 0x9eac, 0x08a0, 0x7848, 0xc085, 0x784a,
 	0x0880, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f,
 	0x0000, 0x2c08, 0x2061, 0x19b8, 0x6020, 0x8000, 0x6022, 0x6010,
 	0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce,
 	0x001e, 0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069,
 	0x19b8, 0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086,
-	0x0001, 0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x894b, 0x00de,
+	0x0001, 0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x8973, 0x00de,
 	0x0005, 0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b,
 	0x0000, 0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e,
 	0x2069, 0x19b8, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e,
@@ -4029,156 +4034,156 @@ unsigned short risc_code01[] = {
 	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076,
 	0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e,
 	0x2071, 0x19b8, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
-	0x0904, 0x84b8, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x84b3,
-	0x87ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x84b3, 0x703c, 0x9c06,
-	0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x96bf, 0x7033, 0x0000,
+	0x0904, 0x84e0, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x84db,
+	0x87ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x84db, 0x703c, 0x9c06,
+	0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x96d8, 0x7033, 0x0000,
 	0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001,
 	0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140,
 	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000,
 	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x080c, 0xbafe, 0x01c8, 0x6014, 0x2048, 0x6020,
+	0x600f, 0x0000, 0x080c, 0xbb17, 0x01c8, 0x6014, 0x2048, 0x6020,
 	0x9086, 0x0003, 0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x0016, 0x0036, 0x0076, 0x080c, 0xbded, 0x080c, 0xd7b3, 0x080c,
-	0x6885, 0x007e, 0x003e, 0x001e, 0x080c, 0xbce7, 0x080c, 0x9e49,
-	0x00ce, 0x0804, 0x8457, 0x2c78, 0x600c, 0x2060, 0x0804, 0x8457,
-	0x85ff, 0x0120, 0x0036, 0x080c, 0x8a26, 0x003e, 0x012e, 0x000e,
+	0x0016, 0x0036, 0x0076, 0x080c, 0xbe06, 0x080c, 0xd7d3, 0x080c,
+	0x688c, 0x007e, 0x003e, 0x001e, 0x080c, 0xbd00, 0x080c, 0x9e62,
+	0x00ce, 0x0804, 0x847f, 0x2c78, 0x600c, 0x2060, 0x0804, 0x847f,
+	0x85ff, 0x0120, 0x0036, 0x080c, 0x8a4e, 0x003e, 0x012e, 0x000e,
 	0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be,
 	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xd7b3, 0x080c, 0xd4b5,
+	0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xd7d3, 0x080c, 0xd4d5,
 	0x007e, 0x003e, 0x001e, 0x0890, 0x6020, 0x9086, 0x000a, 0x0904,
-	0x849d, 0x0804, 0x849b, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6,
+	0x84c5, 0x0804, 0x84c3, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6,
 	0x00f6, 0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19b8, 0x7838,
-	0x9065, 0x0904, 0x8533, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c,
-	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0x96bf, 0x7833,
+	0x9065, 0x0904, 0x855b, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c,
+	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0x96d8, 0x7833,
 	0x0000, 0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c,
-	0xbafe, 0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568,
+	0xbb17, 0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568,
 	0x3e08, 0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6,
 	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x1180,
 	0x2001, 0x1959, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0x6878, 0x080c, 0xbce7, 0x080c, 0x9e49,
-	0x000e, 0x0804, 0x84f0, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de,
+	0xa877, 0x0000, 0x080c, 0x687f, 0x080c, 0xbd00, 0x080c, 0x9e62,
+	0x000e, 0x0804, 0x8518, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de,
 	0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1118, 0x080c, 0xd4b5, 0x0c50, 0x6020, 0x9086, 0x000a, 0x09f8,
-	0x08e0, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099, 0x080c, 0x8632,
+	0x1118, 0x080c, 0xd4d5, 0x0c50, 0x6020, 0x9086, 0x000a, 0x09f8,
+	0x08e0, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099, 0x080c, 0x865a,
 	0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079, 0x19b8,
-	0x2091, 0x8000, 0x080c, 0x86c9, 0x080c, 0x8757, 0x012e, 0x00fe,
+	0x2091, 0x8000, 0x080c, 0x86f1, 0x080c, 0x877f, 0x012e, 0x00fe,
 	0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
 	0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7614,
-	0x2660, 0x2678, 0x8cff, 0x0904, 0x85f7, 0x6010, 0x2058, 0xb8a0,
-	0x9206, 0x1904, 0x85f2, 0x88ff, 0x0120, 0x6054, 0x9106, 0x1904,
-	0x85f2, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100, 0x6820, 0xd0a4,
-	0x1508, 0x080c, 0x8090, 0x080c, 0x9393, 0x68c3, 0x0000, 0x080c,
-	0x98c1, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
+	0x2660, 0x2678, 0x8cff, 0x0904, 0x861f, 0x6010, 0x2058, 0xb8a0,
+	0x9206, 0x1904, 0x861a, 0x88ff, 0x0120, 0x6054, 0x9106, 0x1904,
+	0x861a, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100, 0x6820, 0xd0a4,
+	0x1508, 0x080c, 0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c,
+	0x98da, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
 	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c,
 	0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804, 0x85f2, 0x7014,
+	0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804, 0x861a, 0x7014,
 	0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00,
 	0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c,
 	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x6014, 0x2048, 0x080c, 0xbafe, 0x01e8, 0x6020, 0x9086,
-	0x0003, 0x1580, 0x080c, 0xbd04, 0x1118, 0x080c, 0xa7a7, 0x0098,
+	0x0000, 0x6014, 0x2048, 0x080c, 0xbb17, 0x01e8, 0x6020, 0x9086,
+	0x0003, 0x1580, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0098,
 	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086,
-	0x080c, 0xbded, 0x080c, 0xd7b3, 0x080c, 0x6885, 0x008e, 0x003e,
-	0x001e, 0x080c, 0xbce7, 0x080c, 0x9e49, 0x080c, 0x9797, 0x00ce,
-	0x0804, 0x8572, 0x2c78, 0x600c, 0x2060, 0x0804, 0x8572, 0x012e,
+	0x080c, 0xbe06, 0x080c, 0xd7d3, 0x080c, 0x688c, 0x008e, 0x003e,
+	0x001e, 0x080c, 0xbd00, 0x080c, 0x9e62, 0x080c, 0x97b0, 0x00ce,
+	0x0804, 0x859a, 0x2c78, 0x600c, 0x2060, 0x0804, 0x859a, 0x012e,
 	0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e,
 	0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036,
-	0x0086, 0x080c, 0xd7b3, 0x080c, 0xd4b5, 0x008e, 0x003e, 0x001e,
-	0x08d0, 0x080c, 0xa7a7, 0x6020, 0x9086, 0x0002, 0x1160, 0x6004,
-	0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x85d8, 0x9086, 0x008b,
-	0x0904, 0x85d8, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920, 0x6004,
+	0x0086, 0x080c, 0xd7d3, 0x080c, 0xd4d5, 0x008e, 0x003e, 0x001e,
+	0x08d0, 0x080c, 0xa7c0, 0x6020, 0x9086, 0x0002, 0x1160, 0x6004,
+	0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x8600, 0x9086, 0x008b,
+	0x0904, 0x8600, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920, 0x6004,
 	0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086, 0x008b, 0x09b0,
-	0x0804, 0x85eb, 0x00b6, 0x00a6, 0x0096, 0x00c6, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x0904, 0x86c2,
+	0x0804, 0x8613, 0x00b6, 0x00a6, 0x0096, 0x00c6, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x0904, 0x86ea,
 	0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0x19b8, 0xbe54, 0x7018,
 	0x9b06, 0x1108, 0x761a, 0x701c, 0x9b06, 0x1130, 0x86ff, 0x1118,
 	0x7018, 0x701e, 0x0008, 0x761e, 0xb858, 0x904d, 0x0108, 0xae56,
 	0x96d5, 0x0000, 0x0110, 0x2900, 0xb05a, 0xb857, 0x0000, 0xb85b,
-	0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x616a, 0x0904,
-	0x86be, 0x7624, 0x86ff, 0x0904, 0x86ad, 0x9680, 0x0005, 0x2004,
+	0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x6171, 0x0904,
+	0x86e6, 0x7624, 0x86ff, 0x0904, 0x86d5, 0x9680, 0x0005, 0x2004,
 	0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0560,
-	0x080c, 0x8090, 0x080c, 0x9393, 0x68c3, 0x0000, 0x080c, 0x98c1,
+	0x080c, 0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da,
 	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
 	0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14,
 	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
 	0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660,
-	0x080c, 0x9e49, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003,
-	0x0009, 0x630a, 0x00ce, 0x0804, 0x8665, 0x89ff, 0x0158, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbded, 0x080c, 0xd7b3,
-	0x080c, 0x6885, 0x080c, 0x9797, 0x0804, 0x8665, 0x006e, 0x00de,
+	0x080c, 0x9e62, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003,
+	0x0009, 0x630a, 0x00ce, 0x0804, 0x868d, 0x89ff, 0x0158, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbe06, 0x080c, 0xd7d3,
+	0x080c, 0x688c, 0x080c, 0x97b0, 0x0804, 0x868d, 0x006e, 0x00de,
 	0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e, 0x00ae, 0x00be,
 	0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036, 0x7814,
-	0x9065, 0x0904, 0x872a, 0x600c, 0x0006, 0x600f, 0x0000, 0x7824,
+	0x9065, 0x0904, 0x8752, 0x600c, 0x0006, 0x600f, 0x0000, 0x7824,
 	0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c,
-	0x8090, 0x080c, 0x9393, 0x68c3, 0x0000, 0x080c, 0x98c1, 0x7827,
+	0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da, 0x7827,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
 	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x2069,
 	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040,
-	0x080c, 0x6511, 0x1520, 0x6003, 0x0009, 0x630a, 0x2c30, 0x00f8,
-	0x6014, 0x2048, 0x080c, 0xbafc, 0x01b0, 0x6020, 0x9086, 0x0003,
-	0x1508, 0x080c, 0xbd04, 0x1118, 0x080c, 0xa7a7, 0x0060, 0x080c,
-	0x6511, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x6885, 0x080c, 0xbce7, 0x080c, 0x9e49, 0x080c, 0x9797, 0x000e,
-	0x0804, 0x86d0, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e,
-	0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd4b5,
-	0x0c50, 0x080c, 0xa7a7, 0x6020, 0x9086, 0x0002, 0x1150, 0x6004,
+	0x080c, 0x6518, 0x1520, 0x6003, 0x0009, 0x630a, 0x2c30, 0x00f8,
+	0x6014, 0x2048, 0x080c, 0xbb15, 0x01b0, 0x6020, 0x9086, 0x0003,
+	0x1508, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0060, 0x080c,
+	0x6518, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0x688c, 0x080c, 0xbd00, 0x080c, 0x9e62, 0x080c, 0x97b0, 0x000e,
+	0x0804, 0x86f8, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e,
+	0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd4d5,
+	0x0c50, 0x080c, 0xa7c0, 0x6020, 0x9086, 0x0002, 0x1150, 0x6004,
 	0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086, 0x008b, 0x0978,
 	0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004, 0x0006, 0x9086,
 	0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00, 0x0860, 0x0006,
 	0x0066, 0x0096, 0x00b6, 0x00c6, 0x00d6, 0x7818, 0x905d, 0x0904,
-	0x87d7, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a, 0xb800, 0xc0d4,
-	0xc0dc, 0xb802, 0x080c, 0x616a, 0x0904, 0x87d4, 0x7e24, 0x86ff,
-	0x0904, 0x87c7, 0x9680, 0x0005, 0x2004, 0x9906, 0x1904, 0x87c7,
-	0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x87be, 0x080c,
-	0x8090, 0x080c, 0x9393, 0x68c3, 0x0000, 0x080c, 0x98c1, 0x7827,
+	0x87ff, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a, 0xb800, 0xc0d4,
+	0xc0dc, 0xb802, 0x080c, 0x6171, 0x0904, 0x87fc, 0x7e24, 0x86ff,
+	0x0904, 0x87ef, 0x9680, 0x0005, 0x2004, 0x9906, 0x1904, 0x87ef,
+	0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x87e6, 0x080c,
+	0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da, 0x7827,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
 	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x2069,
 	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de,
 	0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168, 0xb800, 0xd0bc, 0x0150,
 	0x9680, 0x0010, 0x200c, 0x81ff, 0x1518, 0x2009, 0x1959, 0x210c,
 	0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660,
-	0x600f, 0x0000, 0x080c, 0x9e49, 0x00ce, 0x0048, 0x00de, 0x00c6,
-	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x876a, 0x89ff,
-	0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6885,
-	0x080c, 0x9797, 0x0804, 0x876a, 0x000e, 0x0804, 0x875e, 0x781e,
+	0x600f, 0x0000, 0x080c, 0x9e62, 0x00ce, 0x0048, 0x00de, 0x00c6,
+	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x8792, 0x89ff,
+	0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x688c,
+	0x080c, 0x97b0, 0x0804, 0x8792, 0x000e, 0x0804, 0x8786, 0x781e,
 	0x781a, 0x00de, 0x00ce, 0x00be, 0x009e, 0x006e, 0x000e, 0x0005,
 	0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc, 0x01a0, 0xb84c,
 	0x904d, 0x0188, 0xa878, 0x9606, 0x1170, 0x2071, 0x19b8, 0x7024,
 	0x9035, 0x0148, 0x9080, 0x0005, 0x2004, 0x9906, 0x1120, 0xb800,
 	0xc0dc, 0xb802, 0x0029, 0x006e, 0x009e, 0x00de, 0x00ee, 0x0005,
 	0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005, 0x1138, 0x00c6, 0x2660,
-	0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c, 0x9393, 0x78c3,
-	0x0000, 0x080c, 0x98c1, 0x7027, 0x0000, 0x0036, 0x2079, 0x0140,
+	0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c, 0x93ac, 0x78c3,
+	0x0000, 0x080c, 0x98da, 0x7027, 0x0000, 0x0036, 0x2079, 0x0140,
 	0x7b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14,
 	0x9006, 0x080c, 0x2b14, 0x2079, 0x0100, 0x7824, 0xd084, 0x0110,
-	0x7827, 0x0001, 0x080c, 0x98c1, 0x003e, 0x080c, 0x616a, 0x00c6,
-	0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c, 0x9e19,
-	0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbded,
-	0x080c, 0x6885, 0x080c, 0x9797, 0x00fe, 0x0005, 0x00b6, 0x00e6,
+	0x7827, 0x0001, 0x080c, 0x98da, 0x003e, 0x080c, 0x6171, 0x00c6,
+	0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c, 0x9e32,
+	0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbe06,
+	0x080c, 0x688c, 0x080c, 0x97b0, 0x00fe, 0x0005, 0x00b6, 0x00e6,
 	0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x2001, 0x180c,
 	0x2014, 0xc2e4, 0x2202, 0x2071, 0x19b8, 0x7004, 0x9084, 0x0007,
-	0x0002, 0x8863, 0x8867, 0x887e, 0x88a7, 0x88e5, 0x8863, 0x887e,
-	0x8861, 0x080c, 0x0db4, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024,
+	0x0002, 0x888b, 0x888f, 0x88a6, 0x88cf, 0x890d, 0x888b, 0x88a6,
+	0x8889, 0x080c, 0x0db4, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024,
 	0x9065, 0x0148, 0x7020, 0x8001, 0x7022, 0x600c, 0x9015, 0x0158,
 	0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce,
 	0x00ee, 0x00be, 0x0005, 0x7216, 0x7212, 0x0ca8, 0x6010, 0x2058,
-	0x080c, 0x616a, 0xb800, 0xc0dc, 0xb802, 0x7007, 0x0000, 0x7027,
+	0x080c, 0x6171, 0xb800, 0xc0dc, 0xb802, 0x7007, 0x0000, 0x7027,
 	0x0000, 0x7020, 0x8001, 0x7022, 0x1148, 0x2001, 0x180c, 0x2014,
 	0xd2ec, 0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005, 0xb854, 0x9015,
-	0x0120, 0x721e, 0x080c, 0x894b, 0x0ca8, 0x7218, 0x721e, 0x080c,
-	0x894b, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x8a26, 0x0c58, 0x7024,
-	0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c, 0x9797, 0x600c,
+	0x0120, 0x721e, 0x080c, 0x8973, 0x0ca8, 0x7218, 0x721e, 0x080c,
+	0x8973, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x8a4e, 0x0c58, 0x7024,
+	0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c, 0x97b0, 0x600c,
 	0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448, 0x720e, 0x720a,
-	0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0x9797, 0x600c, 0x9015,
+	0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0x97b0, 0x600c, 0x9015,
 	0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216, 0x7212, 0x00b8,
-	0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058, 0x080c, 0x616a,
-	0xb800, 0xc0dc, 0xb802, 0x080c, 0x9797, 0x701c, 0x9065, 0x0138,
+	0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058, 0x080c, 0x6171,
+	0xb800, 0xc0dc, 0xb802, 0x080c, 0x97b0, 0x701c, 0x9065, 0x0138,
 	0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218, 0x721e, 0x7027,
 	0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065, 0x0140,
-	0x080c, 0x9797, 0x600c, 0x9015, 0x0158, 0x720e, 0x600f, 0x0000,
-	0x080c, 0x98c1, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0x080c, 0x97b0, 0x600c, 0x9015, 0x0158, 0x720e, 0x600f, 0x0000,
+	0x080c, 0x98da, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005,
 	0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19b8, 0x6830, 0x9084,
-	0x0003, 0x0002, 0x8908, 0x890a, 0x892e, 0x8906, 0x080c, 0x0db4,
+	0x0003, 0x0002, 0x8930, 0x8932, 0x8956, 0x892e, 0x080c, 0x0db4,
 	0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001, 0x01b8, 0x683c,
 	0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a, 0x600f, 0x0000,
 	0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x19d7, 0x2013, 0x0000,
@@ -4188,153 +4193,153 @@ unsigned short risc_code01[] = {
 	0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0018, 0x683e,
 	0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c, 0x200c,
 	0xc1e5, 0x2102, 0x0005, 0x2001, 0x180c, 0x200c, 0xd1ec, 0x0120,
-	0xc1ec, 0x2102, 0x080c, 0x8a26, 0x2001, 0x19c4, 0x2004, 0x9086,
+	0xc1ec, 0x2102, 0x080c, 0x8a4e, 0x2001, 0x19c4, 0x2004, 0x9086,
 	0x0001, 0x0d58, 0x00d6, 0x2069, 0x19b8, 0x6804, 0x9084, 0x0007,
-	0x0002, 0x896b, 0x8a0e, 0x8a0e, 0x8a0e, 0x8a0e, 0x8a10, 0x8a0e,
-	0x8969, 0x080c, 0x0db4, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005,
+	0x0002, 0x8993, 0x8a36, 0x8a36, 0x8a36, 0x8a36, 0x8a38, 0x8a36,
+	0x8991, 0x080c, 0x0db4, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005,
 	0x00c6, 0x680c, 0x9065, 0x0150, 0x6807, 0x0004, 0x6826, 0x682b,
-	0x0000, 0x080c, 0x8a7c, 0x00ce, 0x00de, 0x0005, 0x6814, 0x9065,
-	0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x8a7c,
+	0x0000, 0x080c, 0x8aa4, 0x00ce, 0x00de, 0x0005, 0x6814, 0x9065,
+	0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x8aa4,
 	0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd, 0x0000,
-	0x0904, 0x89fa, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005, 0x01a0,
-	0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x89fa, 0x0028, 0x6818,
-	0x920e, 0x0904, 0x89fa, 0x2058, 0xb84c, 0x900d, 0x0d88, 0xb888,
+	0x0904, 0x8a22, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005, 0x01a0,
+	0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x8a22, 0x0028, 0x6818,
+	0x920e, 0x0904, 0x8a22, 0x2058, 0xb84c, 0x900d, 0x0d88, 0xb888,
 	0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302, 0x1e40,
-	0x080c, 0x9df0, 0x0904, 0x89fa, 0x8318, 0xbb3e, 0x6116, 0x2b10,
+	0x080c, 0x9e09, 0x0904, 0x8a22, 0x8318, 0xbb3e, 0x6116, 0x2b10,
 	0x6212, 0x0096, 0x2148, 0xa880, 0x9084, 0x00ff, 0x605e, 0xa883,
 	0x0000, 0xa884, 0x009e, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
 	0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x6114, 0x0096, 0x2148,
 	0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0538, 0x00f6,
 	0x2c78, 0x2061, 0x0100, 0xbab0, 0x629a, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x080c, 0x8fb4, 0x2069, 0x19b8, 0xbb00, 0xc3dd, 0xbb02,
+	0x0240, 0x080c, 0x8fdc, 0x2069, 0x19b8, 0xbb00, 0xc3dd, 0xbb02,
 	0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x7823, 0x0003,
 	0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00be, 0x00ce,
 	0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0, 0xbb00, 0xc3dd,
 	0xbb02, 0x6807, 0x0006, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x080c,
-	0x9c4a, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de, 0x0005,
+	0x9c63, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de, 0x0005,
 	0x00c6, 0x680c, 0x9065, 0x0138, 0x6807, 0x0004, 0x6826, 0x682b,
-	0x0000, 0x080c, 0x8a7c, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c,
+	0x0000, 0x080c, 0x8aa4, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c,
 	0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005, 0x00f6, 0x00d6,
 	0x2069, 0x19b8, 0x6830, 0x9086, 0x0000, 0x1548, 0x2001, 0x180c,
-	0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c, 0x895a, 0x2069,
+	0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c, 0x8982, 0x2069,
 	0x19b8, 0x2001, 0x180c, 0x200c, 0xd1c4, 0x11e0, 0x6838, 0x907d,
 	0x01b0, 0x6a04, 0x9296, 0x0000, 0x1588, 0x6833, 0x0001, 0x683e,
 	0x6847, 0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400,
-	0x002e, 0x080c, 0x1ae8, 0x1178, 0x012e, 0x080c, 0x91e1, 0x00de,
+	0x002e, 0x080c, 0x1ae8, 0x1178, 0x012e, 0x080c, 0x9209, 0x00de,
 	0x00fe, 0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c,
-	0x7057, 0x006e, 0x08d8, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002,
+	0x7062, 0x006e, 0x08d8, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002,
 	0x780c, 0x9015, 0x0140, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000,
 	0x683f, 0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x6a04, 0x9296,
-	0x0006, 0x0958, 0x0804, 0x8a1e, 0x6020, 0x9084, 0x000f, 0x000b,
-	0x0005, 0x8a90, 0x8a95, 0x8eee, 0x8f7d, 0x8a95, 0x8eee, 0x8f7d,
-	0x8a90, 0x8a95, 0x8a90, 0x8a90, 0x8a90, 0x8a90, 0x8a90, 0x8a90,
-	0x080c, 0x8846, 0x080c, 0x894b, 0x0005, 0x00b6, 0x0156, 0x0136,
+	0x0006, 0x0958, 0x0804, 0x8a46, 0x6020, 0x9084, 0x000f, 0x000b,
+	0x0005, 0x8ab8, 0x8abd, 0x8f16, 0x8fa5, 0x8abd, 0x8f16, 0x8fa5,
+	0x8ab8, 0x8abd, 0x8ab8, 0x8ab8, 0x8ab8, 0x8ab8, 0x8ab8, 0x8ab8,
+	0x080c, 0x886e, 0x080c, 0x8973, 0x0005, 0x00b6, 0x0156, 0x0136,
 	0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069,
 	0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4,
 	0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a,
-	0x0040, 0x1a04, 0x8b01, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8c78,
-	0x8cb3, 0x8cdc, 0x8d7f, 0x8da0, 0x8da6, 0x8db3, 0x8dbb, 0x8dc7,
-	0x8dcd, 0x8dde, 0x8dcd, 0x8e35, 0x8dbb, 0x8e41, 0x8e47, 0x8dc7,
-	0x8e47, 0x8e53, 0x8aff, 0x8aff, 0x8aff, 0x8aff, 0x8aff, 0x8aff,
-	0x8aff, 0x8aff, 0x8aff, 0x8aff, 0x8aff, 0x9576, 0x9599, 0x95aa,
-	0x95ca, 0x95fc, 0x8db3, 0x8aff, 0x8db3, 0x8dcd, 0x8aff, 0x8cdc,
-	0x8d7f, 0x8aff, 0x99ae, 0x8dcd, 0x8aff, 0x99ca, 0x8dcd, 0x8aff,
-	0x8dc7, 0x8c72, 0x8b22, 0x8aff, 0x99e6, 0x9a53, 0x9b2a, 0x8aff,
-	0x9b37, 0x8db0, 0x9b62, 0x8aff, 0x9606, 0x9b8f, 0x8aff, 0x080c,
+	0x0040, 0x1a04, 0x8b29, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8ca0,
+	0x8cdb, 0x8d04, 0x8da7, 0x8dc8, 0x8dce, 0x8ddb, 0x8de3, 0x8def,
+	0x8df5, 0x8e06, 0x8df5, 0x8e5d, 0x8de3, 0x8e69, 0x8e6f, 0x8def,
+	0x8e6f, 0x8e7b, 0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x8b27,
+	0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x958f, 0x95b2, 0x95c3,
+	0x95e3, 0x9615, 0x8ddb, 0x8b27, 0x8ddb, 0x8df5, 0x8b27, 0x8d04,
+	0x8da7, 0x8b27, 0x99c7, 0x8df5, 0x8b27, 0x99e3, 0x8df5, 0x8b27,
+	0x8def, 0x8c9a, 0x8b4a, 0x8b27, 0x99ff, 0x9a6c, 0x9b43, 0x8b27,
+	0x9b50, 0x8dd8, 0x9b7b, 0x8b27, 0x961f, 0x9ba8, 0x8b27, 0x080c,
 	0x0db4, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
-	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8b20, 0x8b20,
-	0x8b20, 0x8b49, 0x8bf5, 0x8c00, 0x8b20, 0x8b20, 0x8b20, 0x8c47,
-	0x8c53, 0x8b64, 0x8b20, 0x8b7f, 0x8bb3, 0x9d0c, 0x9d51, 0x8dcd,
-	0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x8e66, 0x7003, 0x2414,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8b48, 0x8b48,
+	0x8b48, 0x8b71, 0x8c1d, 0x8c28, 0x8b48, 0x8b48, 0x8b48, 0x8c6f,
+	0x8c7b, 0x8b8c, 0x8b48, 0x8ba7, 0x8bdb, 0x9d25, 0x9d6a, 0x8df5,
+	0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x8e8e, 0x7003, 0x2414,
 	0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e,
-	0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x9367,
+	0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x9380,
 	0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be,
-	0x080c, 0x9d98, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001,
-	0x0005, 0x00d6, 0x0096, 0x080c, 0x8e66, 0x7003, 0x0500, 0x7814,
+	0x080c, 0x9db1, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001,
+	0x0005, 0x00d6, 0x0096, 0x080c, 0x8e8e, 0x7003, 0x0500, 0x7814,
 	0x2048, 0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880,
 	0x7016, 0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c,
-	0x9367, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8e66,
+	0x9380, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8e8e,
 	0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e,
 	0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e,
-	0x60c3, 0x0010, 0x080c, 0x9367, 0x009e, 0x00de, 0x0005, 0x00d6,
-	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8e66, 0x20e9, 0x0000,
+	0x60c3, 0x0010, 0x080c, 0x9380, 0x009e, 0x00de, 0x0005, 0x00d6,
+	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8e8e, 0x20e9, 0x0000,
 	0x2001, 0x1974, 0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003,
 	0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
 	0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c,
-	0x224d, 0x080c, 0xc800, 0x9006, 0x080c, 0x224d, 0x001e, 0xa804,
-	0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x9367, 0x012e,
+	0x224d, 0x080c, 0xc81a, 0x9006, 0x080c, 0x224d, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x9380, 0x012e,
 	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x8eb1, 0x20e9, 0x0000, 0x2001, 0x1974, 0x2003, 0x0000,
+	0x080c, 0x8ed9, 0x20e9, 0x0000, 0x2001, 0x1974, 0x2003, 0x0000,
 	0x7814, 0x2048, 0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003,
 	0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
-	0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x080c, 0xc800, 0x001e,
+	0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x080c, 0xc81a, 0x001e,
 	0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048,
-	0x080c, 0x0f9d, 0x080c, 0x9367, 0x012e, 0x009e, 0x00de, 0x0005,
+	0x080c, 0x0f9d, 0x080c, 0x9380, 0x012e, 0x009e, 0x00de, 0x0005,
 	0x60c0, 0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004,
-	0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8e66, 0x7003,
-	0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x9367,
-	0x00d6, 0x00e6, 0x080c, 0x8eb1, 0x7814, 0x9084, 0xff00, 0x2073,
+	0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8e8e, 0x7003,
+	0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x9380,
+	0x00d6, 0x00e6, 0x080c, 0x8ed9, 0x7814, 0x9084, 0xff00, 0x2073,
 	0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073,
 	0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68,
-	0x8e70, 0x1f04, 0x8c16, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76,
-	0x8d68, 0x8e70, 0x1f04, 0x8c1f, 0x2069, 0x1984, 0x9086, 0xdf00,
+	0x8e70, 0x1f04, 0x8c3e, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76,
+	0x8d68, 0x8e70, 0x1f04, 0x8c47, 0x2069, 0x1984, 0x9086, 0xdf00,
 	0x0110, 0x2069, 0x199e, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148,
 	0x00c6, 0x2061, 0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071,
-	0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x8c2d,
-	0x60c3, 0x004c, 0x080c, 0x9367, 0x00ee, 0x00de, 0x0005, 0x080c,
-	0x8e66, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0x9367, 0x00d6, 0x0026, 0x0016, 0x080c, 0x8eb1,
+	0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x8c55,
+	0x60c3, 0x004c, 0x080c, 0x9380, 0x00ee, 0x00de, 0x0005, 0x080c,
+	0x8e8e, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9380, 0x00d6, 0x0026, 0x0016, 0x080c, 0x8ed9,
 	0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009,
 	0x0001, 0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, 0x2073, 0x0000,
-	0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9367, 0x001e, 0x002e,
-	0x00de, 0x0005, 0x2001, 0x1817, 0x2004, 0x609a, 0x0804, 0x9367,
-	0x080c, 0x8e66, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804, 0xd084,
+	0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9380, 0x001e, 0x002e,
+	0x00de, 0x0005, 0x2001, 0x1817, 0x2004, 0x609a, 0x0804, 0x9380,
+	0x080c, 0x8e8e, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804, 0xd084,
 	0x0130, 0x6828, 0x0016, 0x080c, 0x2696, 0x710e, 0x001e, 0x20a9,
 	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
 	0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x0254,
-	0x4003, 0x080c, 0x9d98, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
+	0x4003, 0x080c, 0x9db1, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
 	0x2001, 0x181e, 0x2004, 0x7032, 0x2001, 0x181f, 0x2004, 0x7036,
 	0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3,
-	0x001c, 0x0804, 0x9367, 0x080c, 0x8e66, 0x7003, 0x0500, 0x080c,
-	0x9d98, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181e,
+	0x001c, 0x0804, 0x9380, 0x080c, 0x8e8e, 0x7003, 0x0500, 0x080c,
+	0x9db1, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181e,
 	0x2004, 0x700a, 0x2001, 0x181f, 0x2004, 0x700e, 0x0030, 0x2001,
 	0x1817, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1,
 	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003,
-	0x60c3, 0x0010, 0x0804, 0x9367, 0x080c, 0x8e66, 0x9006, 0x080c,
-	0x6525, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c,
+	0x60c3, 0x0010, 0x0804, 0x9380, 0x080c, 0x8e8e, 0x9006, 0x080c,
+	0x652c, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c,
 	0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d, 0x0120, 0x9006,
 	0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0, 0x9086,
-	0x007e, 0x1904, 0x8d47, 0x00d6, 0x2069, 0x193d, 0x2001, 0x1836,
+	0x007e, 0x1904, 0x8d6f, 0x00d6, 0x2069, 0x193d, 0x2001, 0x1836,
 	0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808, 0x9084, 0x2000,
 	0x7012, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c,
 	0x7026, 0x0080, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c,
-	0x6fa7, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012,
+	0x6fb2, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012,
 	0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
 	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004,
-	0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0x9c11,
+	0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0x9c2a,
 	0x2069, 0x1945, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c,
-	0x5383, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a0, 0x2001,
+	0x538a, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a0, 0x2001,
 	0x1836, 0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009, 0x0002, 0x60e0,
 	0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x26d7, 0x61e2,
 	0x001e, 0x20e1, 0x0001, 0x2099, 0x193d, 0x20e9, 0x0000, 0x20a1,
 	0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805,
 	0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
-	0x025a, 0x4003, 0x080c, 0x9c11, 0x20a1, 0x024e, 0x20a9, 0x0008,
-	0x2099, 0x1945, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9367, 0x080c,
-	0x8e66, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f,
+	0x025a, 0x4003, 0x080c, 0x9c2a, 0x20a1, 0x024e, 0x20a9, 0x0008,
+	0x2099, 0x1945, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9380, 0x080c,
+	0x8e8e, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f,
 	0x2000, 0x9006, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe, 0xd1ac,
 	0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x9085, 0x0002,
-	0x00d6, 0x0804, 0x8e16, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9367,
-	0x080c, 0x8e66, 0x7003, 0x5000, 0x0804, 0x8cf6, 0x080c, 0x8e66,
-	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9367,
-	0x080c, 0x8ea8, 0x0010, 0x080c, 0x8eb1, 0x7003, 0x0200, 0x60c3,
-	0x0004, 0x0804, 0x9367, 0x080c, 0x8eb1, 0x7003, 0x0100, 0x700b,
-	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9367, 0x080c,
-	0x8eb1, 0x7003, 0x0200, 0x0804, 0x8cf6, 0x080c, 0x8eb1, 0x7003,
+	0x00d6, 0x0804, 0x8e3e, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9380,
+	0x080c, 0x8e8e, 0x7003, 0x5000, 0x0804, 0x8d1e, 0x080c, 0x8e8e,
+	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9380,
+	0x080c, 0x8ed0, 0x0010, 0x080c, 0x8ed9, 0x7003, 0x0200, 0x60c3,
+	0x0004, 0x0804, 0x9380, 0x080c, 0x8ed9, 0x7003, 0x0100, 0x700b,
+	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9380, 0x080c,
+	0x8ed9, 0x7003, 0x0200, 0x0804, 0x8d1e, 0x080c, 0x8ed9, 0x7003,
 	0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003,
-	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9367, 0x00d6, 0x080c,
-	0x8eb1, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894,
+	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380, 0x00d6, 0x080c,
+	0x8ed9, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894,
 	0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998,
 	0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058,
 	0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700,
@@ -4344,56 +4349,56 @@ unsigned short risc_code01[] = {
 	0x1873, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbabc, 0xd28c, 0x1108,
 	0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130,
 	0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026,
-	0x60c3, 0x0014, 0x00de, 0x0804, 0x9367, 0x080c, 0x8eb1, 0x7003,
+	0x60c3, 0x0014, 0x00de, 0x0804, 0x9380, 0x080c, 0x8ed9, 0x7003,
 	0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014, 0x0804,
-	0x9367, 0x080c, 0x8eb1, 0x7003, 0x0200, 0x0804, 0x8c7c, 0x080c,
-	0x8eb1, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3,
-	0x0008, 0x0804, 0x9367, 0x080c, 0x8eb1, 0x7003, 0x0100, 0x700b,
-	0x000b, 0x60c3, 0x0008, 0x0804, 0x9367, 0x0026, 0x00d6, 0x0036,
+	0x9380, 0x080c, 0x8ed9, 0x7003, 0x0200, 0x0804, 0x8ca4, 0x080c,
+	0x8ed9, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3,
+	0x0008, 0x0804, 0x9380, 0x080c, 0x8ed9, 0x7003, 0x0100, 0x700b,
+	0x000b, 0x60c3, 0x0008, 0x0804, 0x9380, 0x0026, 0x00d6, 0x0036,
 	0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6,
-	0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x9c26,
+	0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x9c3f,
 	0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
 	0x700a, 0x687c, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e, 0x003e,
-	0x00de, 0x080c, 0x9355, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027,
-	0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0x9c26,
+	0x00de, 0x080c, 0x936e, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027,
+	0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0x9c3f,
 	0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800, 0x6878,
 	0x700a, 0x687c, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10, 0x7003,
 	0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000, 0x0005,
 	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021, 0x0800,
 	0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300, 0x2021,
-	0x0100, 0x080c, 0x9c26, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
+	0x0100, 0x080c, 0x9c3f, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
 	0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005, 0x1128,
 	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878, 0x700a, 0x687c,
 	0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e, 0x00de,
-	0x080c, 0x9355, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
-	0x024c, 0x002e, 0x0005, 0x080c, 0x9355, 0x721a, 0x7a08, 0x7222,
+	0x080c, 0x936e, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
+	0x024c, 0x002e, 0x0005, 0x080c, 0x936e, 0x721a, 0x7a08, 0x7222,
 	0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6,
 	0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004,
 	0x908a, 0x0085, 0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4,
 	0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082,
 	0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
-	0x8f1f, 0x8f2e, 0x8f39, 0x8f1d, 0x8f1d, 0x8f1d, 0x8f1f, 0x8f1d,
-	0x8f1d, 0x8f1d, 0x8f1d, 0x8f1d, 0x8f1d, 0x080c, 0x0db4, 0x0411,
+	0x8f47, 0x8f56, 0x8f61, 0x8f45, 0x8f45, 0x8f45, 0x8f47, 0x8f45,
+	0x8f45, 0x8f45, 0x8f45, 0x8f45, 0x8f45, 0x080c, 0x0db4, 0x0411,
 	0x60c3, 0x0000, 0x0026, 0x080c, 0x29ca, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9367, 0x0431, 0x7808,
+	0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9380, 0x0431, 0x7808,
 	0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c, 0x0804,
-	0x9367, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004,
-	0x0804, 0x9367, 0x0026, 0x080c, 0x9c26, 0xb810, 0x9085, 0x8100,
+	0x9380, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004,
+	0x0804, 0x9380, 0x0026, 0x080c, 0x9c3f, 0xb810, 0x9085, 0x8100,
 	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c,
-	0x700e, 0x7013, 0x0009, 0x0804, 0x8e81, 0x0026, 0x080c, 0x9c26,
+	0x700e, 0x7013, 0x0009, 0x0804, 0x8ea9, 0x0026, 0x080c, 0x9c3f,
 	0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
 	0x6878, 0x700a, 0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804,
-	0x8ee3, 0x0026, 0x080c, 0x9c26, 0xb810, 0x9085, 0x8500, 0x7002,
+	0x8f0b, 0x0026, 0x080c, 0x9c3f, 0xb810, 0x9085, 0x8500, 0x7002,
 	0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e,
-	0x2001, 0x0099, 0x7012, 0x0804, 0x8ee3, 0x00b6, 0x00c6, 0x00d6,
+	0x2001, 0x0099, 0x7012, 0x0804, 0x8f0b, 0x00b6, 0x00c6, 0x00d6,
 	0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, 0x7804,
 	0x908a, 0x0040, 0x0a0c, 0x0db4, 0x908a, 0x0054, 0x1a0c, 0x0db4,
 	0x7910, 0x2158, 0xb9b0, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040,
-	0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8fb4,
-	0x9070, 0x9043, 0x9192, 0x8fb2, 0x8fb2, 0x8fb2, 0x8fb2, 0x8fb2,
-	0x8fb2, 0x8fb2, 0x9774, 0x977c, 0x9784, 0x978c, 0x8fb2, 0x9b6e,
-	0x8fb2, 0x976c, 0x080c, 0x0db4, 0x0096, 0x780b, 0xffff, 0x080c,
-	0x901f, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64, 0x96b4, 0x00ff,
+	0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8fdc,
+	0x9098, 0x906b, 0x91ba, 0x8fda, 0x8fda, 0x8fda, 0x8fda, 0x8fda,
+	0x8fda, 0x8fda, 0x978d, 0x9795, 0x979d, 0x97a5, 0x8fda, 0x9b87,
+	0x8fda, 0x9785, 0x080c, 0x0db4, 0x0096, 0x780b, 0xffff, 0x080c,
+	0x9047, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64, 0x96b4, 0x00ff,
 	0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032, 0xa8b8, 0x7036, 0xa8bc,
 	0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132, 0xa97c, 0x9184, 0x000f,
 	0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001, 0x0004,
@@ -4412,19 +4417,19 @@ unsigned short risc_code01[] = {
 	0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222,
 	0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081, 0x7814, 0x2048,
 	0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a, 0xa8ac, 0x700e,
-	0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0x9367, 0x6813, 0x0008,
+	0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0x9380, 0x6813, 0x0008,
 	0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x6878, 0x700a, 0x687c, 0x700e, 0x7013, 0x0889, 0x080c, 0x9355,
+	0x6878, 0x700a, 0x687c, 0x700e, 0x7013, 0x0889, 0x080c, 0x936e,
 	0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x0005,
-	0x00d6, 0x0096, 0x080c, 0x9170, 0x7814, 0x2048, 0x080c, 0xbafc,
+	0x00d6, 0x0096, 0x080c, 0x9198, 0x7814, 0x2048, 0x080c, 0xbb15,
 	0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033, 0x0010, 0x9006,
-	0x001b, 0x009e, 0x00de, 0x0005, 0x908e, 0x90f7, 0x9107, 0x912d,
-	0x9139, 0x914a, 0x9152, 0x908c, 0x080c, 0x0db4, 0x0016, 0x0036,
+	0x001b, 0x009e, 0x00de, 0x0005, 0x90b6, 0x911f, 0x912f, 0x9155,
+	0x9161, 0x9172, 0x917a, 0x90b4, 0x080c, 0x0db4, 0x0016, 0x0036,
 	0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003, 0x1198, 0xaba8,
 	0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a, 0xa894, 0x701e,
-	0x003e, 0x001e, 0x2001, 0x1982, 0x2004, 0x60c2, 0x0804, 0x9367,
+	0x003e, 0x001e, 0x2001, 0x1982, 0x2004, 0x60c2, 0x0804, 0x9380,
 	0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0db4, 0xaba8, 0x7824,
-	0xd0cc, 0x1904, 0x90f4, 0x7316, 0xa898, 0x701a, 0xa894, 0x701e,
+	0xd0cc, 0x1904, 0x911c, 0x7316, 0xa898, 0x701a, 0xa894, 0x701e,
 	0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018, 0x9384, 0x0300,
 	0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc, 0x0110, 0xa8a4,
 	0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011, 0x0258, 0x20e9,
@@ -4432,2071 +4437,2070 @@ unsigned short risc_code01[] = {
 	0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000, 0x6812, 0x2011,
 	0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810, 0xc084, 0x6812,
 	0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245, 0x201a, 0x61c2,
-	0x003e, 0x001e, 0x0804, 0x9367, 0xc3e5, 0x0804, 0x90b3, 0x2011,
+	0x003e, 0x001e, 0x0804, 0x9380, 0xc3e5, 0x0804, 0x90db, 0x2011,
 	0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4, 0x0110, 0x2011, 0x0028,
 	0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8, 0xc2e5, 0x2011,
 	0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e, 0x9105, 0x0108,
 	0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x7027,
 	0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047, 0x0500, 0x704f,
 	0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071, 0x0240, 0x700b,
-	0x2500, 0x60c3, 0x0032, 0x0804, 0x9367, 0x2011, 0x0028, 0x7824,
-	0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804, 0x9367, 0x0cd0,
+	0x2500, 0x60c3, 0x0032, 0x0804, 0x9380, 0x2011, 0x0028, 0x7824,
+	0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804, 0x9380, 0x0cd0,
 	0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
 	0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x0020,
-	0x0804, 0x9367, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
+	0x0804, 0x9380, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
 	0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00, 0x7816, 0x9384,
 	0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
 	0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006, 0x7824, 0xd0cc,
 	0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e, 0x003e, 0x0818,
 	0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700, 0x7002, 0xb814,
 	0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x7824,
-	0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0x9355, 0x721a, 0x7a08,
+	0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0x936e, 0x721a, 0x7a08,
 	0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x7013,
 	0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013,
-	0x001e, 0x0005, 0x91a2, 0x91a2, 0x91a4, 0x91a2, 0x91a2, 0x91a2,
-	0x91be, 0x91a2, 0x080c, 0x0db4, 0x7914, 0x918c, 0x08ff, 0x918d,
+	0x001e, 0x0005, 0x91ca, 0x91ca, 0x91cc, 0x91ca, 0x91ca, 0x91ca,
+	0x91e6, 0x91ca, 0x080c, 0x0db4, 0x7914, 0x918c, 0x08ff, 0x918d,
 	0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1853, 0x6804,
 	0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010,
-	0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x9367, 0x2009, 0x0003,
-	0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x9c26, 0x001e,
+	0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x9380, 0x2009, 0x0003,
+	0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x9c3f, 0x001e,
 	0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
 	0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008,
-	0x7116, 0x080c, 0x9355, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
+	0x7116, 0x080c, 0x936e, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
 	0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
 	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0,
 	0x2028, 0xb910, 0xba14, 0x7378, 0x747c, 0x7820, 0x90be, 0x0006,
-	0x0904, 0x92c4, 0x90be, 0x000a, 0x1904, 0x9280, 0x609f, 0x0000,
-	0x7814, 0x2048, 0xa87c, 0xd0fc, 0x05d0, 0xaf90, 0x9784, 0xff00,
+	0x0904, 0x92dd, 0x90be, 0x000a, 0x1904, 0x9299, 0xb8b0, 0x609e,
+	0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00,
 	0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048,
-	0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0510,
+	0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198,
 	0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086,
 	0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000,
-	0x609f, 0x0000, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x11a8, 0xd09c,
-	0x0130, 0x7814, 0x2048, 0xa874, 0x9082, 0x0080, 0x1268, 0xb814,
-	0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0c48, 0x9185,
-	0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94,
-	0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a,
-	0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834, 0x608e,
-	0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
-	0x60d7, 0x0000, 0x080c, 0x9c0b, 0x2009, 0x07d0, 0x60c4, 0x9084,
-	0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x8095, 0x003e,
-	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005,
-	0x7804, 0x9086, 0x0040, 0x0904, 0x9300, 0x9185, 0x0100, 0x6062,
-	0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008, 0x60af,
-	0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086,
-	0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
-	0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbab0, 0x629e, 0x080c, 0x9c0b,
-	0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009,
-	0x1b58, 0x080c, 0x8095, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de,
-	0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c, 0x9084,
-	0x0003, 0x9086, 0x0002, 0x0904, 0x931c, 0x9185, 0x0100, 0x6062,
-	0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0xb88c,
-	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838, 0x607e,
-	0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c, 0x608e,
-	0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108, 0x7932,
-	0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af, 0x95d5,
-	0x60d7, 0x0000, 0xbab0, 0x629e, 0x080c, 0x9be8, 0x0804, 0x92b0,
-	0xb8bc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c, 0x7846,
-	0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062, 0x6266,
-	0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af, 0x9575,
-	0x60d7, 0x0000, 0x0804, 0x9293, 0x9185, 0x0700, 0x6062, 0x6266,
-	0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073, 0x0889,
-	0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
-	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086,
-	0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
-	0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
-	0xbab0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0x9c0b, 0x0804,
-	0x92b0, 0x080c, 0x9be8, 0x0804, 0x92b0, 0x7a10, 0x00b6, 0x2258,
-	0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217, 0x0005,
-	0x00d6, 0x2069, 0x19b8, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8087, 0x0005, 0x0016,
-	0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128,
-	0x0089, 0x080c, 0x8087, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c,
-	0x2102, 0x2001, 0x19b9, 0x2003, 0x0000, 0x2001, 0x19c1, 0x2003,
-	0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085, 0x0009,
-	0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100,
-	0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085, 0x0008,
-	0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e,
-	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x6fa7, 0x11e8, 0x2001, 0x19d4, 0x2004, 0x9005,
-	0x1904, 0x93f9, 0x0066, 0x2031, 0x0001, 0x080c, 0x7057, 0x006e,
-	0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084,
-	0x090c, 0x0db4, 0x080c, 0x8087, 0x0460, 0x00c6, 0x2061, 0x19b8,
-	0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0x9393, 0x080c,
-	0x2b24, 0x00c6, 0x2061, 0x19b8, 0x6128, 0x9192, 0x0008, 0x1258,
-	0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x8087,
-	0x080c, 0x938a, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140, 0x080c,
-	0xd8a9, 0x080c, 0x8090, 0x2009, 0x0014, 0x080c, 0x9e93, 0x00ce,
-	0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x19d4,
-	0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b8, 0x6128, 0x9192,
-	0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x8087, 0x080c,
-	0x5b89, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096,
-	0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x809d, 0x2071,
-	0x19b8, 0x713c, 0x81ff, 0x0904, 0x9489, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x6fa7, 0x11b0, 0x0036, 0x2019, 0x0002, 0x080c,
-	0x96bf, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8a9, 0x2009, 0x004a,
-	0x080c, 0x9e93, 0x0066, 0x2031, 0x0001, 0x080c, 0x7057, 0x006e,
-	0x0804, 0x9489, 0x080c, 0x9495, 0x0904, 0x9489, 0x6904, 0xd1f4,
-	0x0904, 0x9490, 0x080c, 0x2b24, 0x00c6, 0x703c, 0x9065, 0x090c,
-	0x0db4, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528, 0x61c8, 0x60c4,
-	0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01e0, 0x6214,
-	0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1510, 0x0030,
-	0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2a77, 0x6014, 0x9084,
-	0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060, 0x2009, 0x0049,
-	0x080c, 0x9e93, 0x0070, 0x0036, 0x2019, 0x0001, 0x080c, 0x96bf,
-	0x003e, 0x713c, 0x2160, 0x080c, 0xd8a9, 0x2009, 0x004a, 0x080c,
-	0x9e93, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e, 0x0005,
-	0xd1ec, 0x1904, 0x944a, 0x0804, 0x944c, 0x00d6, 0x00c6, 0x0096,
-	0x703c, 0x9065, 0x090c, 0x0db4, 0x2001, 0x1836, 0x2004, 0xd09c,
-	0x1904, 0x9521, 0x2001, 0x0306, 0x200c, 0x9184, 0x0030, 0x0904,
-	0x9521, 0x9184, 0x0048, 0x9086, 0x0008, 0x1904, 0x9521, 0x2001,
-	0x020b, 0x2004, 0xd0fc, 0x0904, 0x9521, 0xd08c, 0x0904, 0x9521,
-	0x2009, 0x1a50, 0x2104, 0x8000, 0x0208, 0x200a, 0x2069, 0x0100,
-	0x6914, 0x918c, 0x0184, 0x918d, 0x0010, 0x6916, 0x69c8, 0x2011,
-	0x0020, 0x68c8, 0x9106, 0x1570, 0x8211, 0x1dd8, 0x2001, 0x0306,
-	0x2003, 0x4800, 0x2001, 0x009a, 0x2003, 0x0004, 0x2001, 0x1a36,
-	0x2003, 0x0000, 0x2001, 0x1a3f, 0x2003, 0x0000, 0x6a88, 0x698c,
-	0x2200, 0x9105, 0x1120, 0x2c10, 0x080c, 0x1a5c, 0x0040, 0x6014,
-	0x2048, 0xaa3a, 0xa936, 0x6ac4, 0x69c8, 0xa946, 0xaa4a, 0x0126,
-	0x00c6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1ae8, 0x190c, 0x0db4,
-	0x012e, 0x0090, 0x2009, 0x1a51, 0x2104, 0x8000, 0x0208, 0x200a,
-	0x69c8, 0x2011, 0x0020, 0x8211, 0x1df0, 0x68c8, 0x9106, 0x1dc0,
-	0x69c4, 0x68c8, 0x9105, 0x0160, 0x6824, 0xd08c, 0x0110, 0x6827,
-	0x0002, 0x7048, 0xc085, 0x704a, 0x0079, 0x7048, 0xc084, 0x704a,
-	0x2009, 0x07d0, 0x080c, 0x8095, 0x9006, 0x009e, 0x00ce, 0x00de,
-	0x0005, 0x9085, 0x0001, 0x0cc8, 0x0026, 0x00e6, 0x2071, 0x19b8,
-	0x7048, 0xd084, 0x01c0, 0x713c, 0x81ff, 0x01a8, 0x2071, 0x0100,
-	0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138, 0x7014, 0x9084,
-	0x1984, 0x9085, 0x0012, 0x7016, 0x0030, 0x7014, 0x9084, 0x1984,
-	0x9085, 0x0016, 0x7016, 0x00ee, 0x002e, 0x0005, 0x00b6, 0x00e6,
-	0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x6010, 0x2058, 0xbca0, 0x2071, 0x19b8, 0x7018, 0x2058,
-	0x8bff, 0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0,
-	0x6014, 0x0096, 0x2048, 0xac6c, 0xad70, 0xae78, 0x009e, 0x080c,
-	0x6369, 0x0110, 0x9085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x080c, 0x8e66,
-	0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820,
-	0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058,
-	0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x6078, 0x617c,
-	0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804,
-	0x9367, 0x080c, 0x8e66, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128,
-	0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008,
-	0x0804, 0x9367, 0x0156, 0x080c, 0x8eb1, 0x7003, 0x0200, 0x2011,
-	0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019,
-	0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398,
-	0x0002, 0x9290, 0x0002, 0x1f04, 0x95bb, 0x60c3, 0x001c, 0x015e,
-	0x0804, 0x9367, 0x0016, 0x0026, 0x080c, 0x8e8d, 0x080c, 0x8e9f,
-	0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048,
-	0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
-	0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250,
-	0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x9367, 0x002e,
-	0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0x9c11, 0x20a1,
-	0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x8e66, 0x7003, 0x6200,
-	0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9367, 0x0016, 0x0026,
-	0x080c, 0x8e66, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096,
-	0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023,
-	0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003,
-	0x60c2, 0x080c, 0x9367, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x700c, 0x2060,
-	0x8cff, 0x0178, 0x080c, 0xbd04, 0x1110, 0x080c, 0xa7a7, 0x600c,
-	0x0006, 0x080c, 0xbf6b, 0x080c, 0x9e19, 0x080c, 0x9797, 0x00ce,
-	0x0c78, 0x2c00, 0x700e, 0x700a, 0x012e, 0x000e, 0x00ce, 0x00ee,
-	0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
-	0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c,
-	0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
-	0x19b8, 0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c, 0x9393, 0x6ac0,
-	0x68c3, 0x0000, 0x080c, 0x8090, 0x00c6, 0x2061, 0x0100, 0x080c,
-	0x9c2a, 0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009, 0x0013, 0x080c,
-	0x9e93, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096,
-	0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x8090, 0x6814,
-	0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3,
-	0x0000, 0x2011, 0x5b33, 0x080c, 0x8010, 0x20a9, 0x01f4, 0x0009,
-	0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084,
-	0x4000, 0x190c, 0x2b24, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001,
-	0x0010, 0x1f04, 0x96a1, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001,
-	0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x0005, 0x0126,
-	0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016,
-	0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff,
-	0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19b8, 0x703c,
-	0x2060, 0x8cff, 0x0904, 0x974d, 0x9386, 0x0002, 0x1128, 0x6814,
-	0x9084, 0x0002, 0x0904, 0x974d, 0x68af, 0x95f5, 0x6817, 0x0010,
-	0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c,
-	0x809d, 0x080c, 0x1e90, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e2f,
-	0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8,
-	0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079,
-	0x0090, 0x2071, 0x1a36, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012,
-	0x6816, 0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386,
-	0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x2001,
-	0x1952, 0x200c, 0x080c, 0x0e2f, 0x004e, 0x20a9, 0x03e8, 0x6824,
-	0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c,
-	0x2b24, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04,
-	0x9727, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2b14, 0x9006, 0x080c, 0x2b14, 0x6827, 0x4000, 0x6824, 0x83ff,
-	0x1120, 0x2009, 0x0049, 0x080c, 0x9e93, 0x000e, 0x001e, 0x002e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005,
-	0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8, 0x6a06, 0x012e,
-	0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8,
-	0x6a32, 0x012e, 0x00de, 0x0005, 0x080c, 0x901f, 0x7854, 0x7032,
-	0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x901f, 0x7854, 0x7032,
-	0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x901f, 0x7854, 0x7032,
-	0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x901f, 0x7854, 0x7032,
-	0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x901f, 0x7854, 0x7032,
-	0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9367, 0x00e6,
-	0x2071, 0x19b8, 0x7020, 0x9005, 0x0110, 0x8001, 0x7022, 0x00ee,
-	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7614, 0x2660, 0x2678,
-	0x2039, 0x0001, 0x87ff, 0x0904, 0x983c, 0x8cff, 0x0904, 0x983c,
-	0x6020, 0x9086, 0x0006, 0x1904, 0x9837, 0x88ff, 0x0138, 0x2800,
-	0x9c06, 0x1904, 0x9837, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06,
-	0x1904, 0x9837, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x9837,
-	0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160,
-	0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x8090, 0x080c,
-	0x98c1, 0x7027, 0x0000, 0x0428, 0x080c, 0x8090, 0x6820, 0xd0b4,
-	0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c,
-	0x98c1, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
-	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c,
-	0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36,
-	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013,
-	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
-	0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096, 0x2048,
-	0x080c, 0xbafc, 0x0110, 0x080c, 0xd4b5, 0x009e, 0x080c, 0x9e49,
-	0x080c, 0x9797, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x97b2, 0x2c78,
-	0x600c, 0x2060, 0x0804, 0x97b2, 0x9006, 0x012e, 0x000e, 0x006e,
-	0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000,
-	0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6, 0x0096,
-	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x19b8, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0x98b0, 0x6020,
-	0x9086, 0x0006, 0x1904, 0x98ab, 0x87ff, 0x0128, 0x2700, 0x9c06,
-	0x1904, 0x98ab, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118,
-	0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168, 0x0036, 0x2019,
-	0x0001, 0x080c, 0x96bf, 0x7033, 0x0000, 0x9006, 0x703e, 0x7042,
-	0x7046, 0x704a, 0x003e, 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a,
-	0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036,
-	0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c,
-	0xbafc, 0x0110, 0x080c, 0xd4b5, 0x080c, 0x9e49, 0x87ff, 0x1198,
-	0x00ce, 0x0804, 0x985c, 0x2c78, 0x600c, 0x2060, 0x0804, 0x985c,
-	0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e, 0x00de,
-	0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001,
-	0x0c80, 0x00e6, 0x2071, 0x19b8, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee,
-	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19b8, 0x2c10, 0x7638, 0x2660, 0x2678,
-	0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7038, 0x9c36, 0x1110,
-	0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
-	0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085, 0x0001,
-	0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e, 0x002e,
-	0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6,
-	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x19b8, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0x999d,
-	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x9998,
-	0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
-	0x9974, 0x080c, 0x9393, 0x68c3, 0x0000, 0x080c, 0x98c1, 0x7027,
-	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x2069,
-	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c,
-	0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00,
-	0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c,
-	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x080c, 0xbcf3, 0x1158, 0x080c, 0x2ffc, 0x080c, 0xbd04,
-	0x11f0, 0x080c, 0xa7a7, 0x00d8, 0x080c, 0x98c1, 0x08c0, 0x080c,
-	0xbd04, 0x1118, 0x080c, 0xa7a7, 0x0090, 0x6014, 0x2048, 0x080c,
-	0xbafc, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103,
-	0xab7a, 0xa877, 0x0000, 0x080c, 0x6878, 0x080c, 0xbce7, 0x080c,
-	0xbf6b, 0x080c, 0x9e49, 0x080c, 0x9797, 0x00ce, 0x0804, 0x991d,
-	0x2c78, 0x600c, 0x2060, 0x0804, 0x991d, 0x012e, 0x000e, 0x002e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020,
-	0x9086, 0x0006, 0x1d20, 0x080c, 0xd4b5, 0x0c08, 0x00d6, 0x080c,
-	0x8eb1, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1,
-	0x0001, 0x2099, 0x195a, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9,
-	0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0x9367,
-	0x00de, 0x0005, 0x080c, 0x8eb1, 0x700b, 0x0800, 0x7814, 0x9084,
-	0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, 0x7026,
-	0x7858, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7858, 0x9084,
-	0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x9367, 0x00b6, 0x00d6,
-	0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xc171, 0x00de,
-	0x1904, 0x9a4b, 0x080c, 0x8e66, 0x7003, 0x1300, 0x782c, 0x080c,
-	0x9b4d, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058,
-	0xbaa0, 0x080c, 0x9d98, 0x11d8, 0x9286, 0x007e, 0x1128, 0x700b,
-	0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128, 0x700b,
-	0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180, 0x9286,
-	0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8,
-	0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0, 0x6098,
-	0x700e, 0x00a8, 0x080c, 0x9d98, 0x1130, 0x7810, 0x2058, 0xb8a0,
-	0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181e, 0x2d04, 0x700a,
-	0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838,
-	0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c,
-	0x9367, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e,
-	0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186,
-	0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0x9ac5, 0x9186, 0x0005,
-	0x0904, 0x9aae, 0x9186, 0x0004, 0x05d8, 0x9186, 0x0008, 0x0904,
-	0x9ab6, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c,
-	0x9b2a, 0x0005, 0x080c, 0x9aeb, 0x00d6, 0x0026, 0x792c, 0x2168,
-	0x2009, 0x4000, 0x6800, 0x0002, 0x9a8f, 0x9a9a, 0x9a91, 0x9a9a,
-	0x9a96, 0x9a8f, 0x9a8f, 0x9a9a, 0x9a9a, 0x9a9a, 0x9a9a, 0x9a8f,
-	0x9a8f, 0x9a8f, 0x9a8f, 0x9a8f, 0x9a9a, 0x9a8f, 0x9a9a, 0x080c,
-	0x0db4, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010,
-	0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x9ae4,
-	0x080c, 0x9aeb, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
-	0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04b0, 0x04e1, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0470, 0x04a1, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005, 0x0118,
-	0x9286, 0x0002, 0x1108, 0x900e, 0x00f8, 0x0429, 0x00d6, 0x0026,
-	0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834, 0x9112,
-	0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c, 0x9180,
-	0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118,
-	0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e,
-	0x00de, 0x0804, 0x9367, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066,
-	0x080c, 0x8eb1, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c,
-	0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0x9d98, 0x1118, 0x9092,
-	0x007e, 0x0268, 0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68, 0x2d34,
-	0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e,
-	0x6498, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004,
-	0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020,
-	0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e,
-	0x00be, 0x0005, 0x080c, 0x8eb1, 0x7003, 0x0100, 0x782c, 0x700a,
-	0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9367, 0x080c,
-	0x8e5d, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e,
-	0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007,
-	0x701a, 0x60c3, 0x0010, 0x0804, 0x9367, 0x00e6, 0x2071, 0x0240,
-	0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8bc, 0xd084,
-	0x0120, 0x7848, 0x702a, 0x7844, 0x702e, 0x00be, 0x00fe, 0x000e,
-	0x00ee, 0x0005, 0x080c, 0x8ea8, 0x7003, 0x0100, 0x782c, 0x700a,
-	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9367, 0x0021, 0x60c3,
-	0x0000, 0x0804, 0x9367, 0x00d6, 0x080c, 0x9c26, 0xb810, 0x9085,
-	0x0300, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
-	0x687c, 0x700e, 0x7013, 0x0819, 0x080c, 0x9355, 0x721a, 0x2f10,
-	0x7222, 0x7a08, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x00a9,
-	0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c,
-	0x29ca, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e,
-	0x080c, 0x938a, 0x080c, 0x8087, 0x0005, 0x0036, 0x0096, 0x00d6,
-	0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd,
-	0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff,
-	0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384, 0xff00,
-	0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069,
-	0x0200, 0x080c, 0x9c26, 0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240,
-	0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098,
-	0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286, 0x3000,
-	0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e, 0x0005,
-	0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084,
-	0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824,
-	0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001,
-	0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x1983, 0x210c, 0x009e,
-	0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x6116,
-	0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088, 0x2009,
-	0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d, 0x0040,
-	0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009, 0x0008,
-	0x6912, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9, 0x0000,
-	0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0, 0x0128,
-	0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1, 0x0240,
-	0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812, 0x0c60,
-	0x00de, 0x0005, 0x00d6, 0x0096, 0x6014, 0x2048, 0xa878, 0x6056,
-	0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946, 0xa84a, 0x6023, 0x0003,
-	0x6007, 0x0040, 0x6003, 0x0003, 0x600b, 0xffff, 0xa817, 0x0001,
-	0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813, 0x1f24, 0x080c, 0x842e,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x8a26, 0x012e, 0x009e, 0x00de,
-	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x760c, 0x2660, 0x2678,
-	0x8cff, 0x0904, 0x9cf8, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100,
-	0x68c0, 0x9005, 0x0904, 0x9ccf, 0x080c, 0x9393, 0x68c3, 0x0000,
-	0x080c, 0x98c1, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0xb8b0, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0,
+	0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118,
+	0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266,
+	0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff,
+	0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834,
+	0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af,
+	0x95d5, 0x60d7, 0x0000, 0x080c, 0x9c24, 0x2009, 0x07d0, 0x60c4,
+	0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x80bd,
+	0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be,
+	0x0005, 0x7804, 0x9086, 0x0040, 0x0904, 0x9319, 0x9185, 0x0100,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff,
+	0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808,
+	0x6086, 0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848,
+	0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbab0, 0x629e, 0x080c,
+	0x9c24, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110,
+	0x2009, 0x1b58, 0x080c, 0x80bd, 0x003e, 0x004e, 0x005e, 0x00ce,
+	0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x0904, 0x9335, 0x9185, 0x0100,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008,
+	0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838,
+	0x607e, 0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c,
+	0x608e, 0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108,
+	0x7932, 0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af,
+	0x95d5, 0x60d7, 0x0000, 0xbab0, 0x629e, 0x080c, 0x9c01, 0x0804,
+	0x92c9, 0xb8bc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c,
+	0x7846, 0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af,
+	0x9575, 0x60d7, 0x0000, 0x0804, 0x92ac, 0x9185, 0x0700, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073,
+	0x0889, 0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000,
+	0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00,
+	0x6086, 0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848,
+	0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7,
+	0x0000, 0xbab0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0x9c24,
+	0x0804, 0x92c9, 0x080c, 0x9c01, 0x0804, 0x92c9, 0x7a10, 0x00b6,
+	0x2258, 0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217,
+	0x0005, 0x00d6, 0x2069, 0x19b8, 0x6843, 0x0001, 0x00de, 0x0005,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x80af, 0x0005,
+	0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600,
+	0x0128, 0x0089, 0x080c, 0x80af, 0x001e, 0x0005, 0xc1e5, 0x2001,
+	0x180c, 0x2102, 0x2001, 0x19b9, 0x2003, 0x0000, 0x2001, 0x19c1,
+	0x2003, 0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085,
+	0x0009, 0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061,
+	0x0100, 0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085,
+	0x0008, 0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce,
+	0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x080c, 0x6fb2, 0x11e8, 0x2001, 0x19d4, 0x2004,
+	0x9005, 0x1904, 0x9412, 0x0066, 0x2031, 0x0001, 0x080c, 0x7062,
+	0x006e, 0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024,
+	0xd084, 0x090c, 0x0db4, 0x080c, 0x80af, 0x0460, 0x00c6, 0x2061,
+	0x19b8, 0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0x93ac,
+	0x080c, 0x2b24, 0x00c6, 0x2061, 0x19b8, 0x6128, 0x9192, 0x0008,
+	0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c,
+	0x80af, 0x080c, 0x93a3, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140,
+	0x080c, 0xd8c9, 0x080c, 0x80b8, 0x2009, 0x0014, 0x080c, 0x9eac,
+	0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001,
+	0x19d4, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b8, 0x6128,
+	0x9192, 0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x80af,
+	0x080c, 0x5b90, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10,
+	0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x80c5,
+	0x2071, 0x19b8, 0x713c, 0x81ff, 0x0904, 0x94a2, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x080c, 0x6fb2, 0x11b0, 0x0036, 0x2019, 0x0002,
+	0x080c, 0x96d8, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8c9, 0x2009,
+	0x004a, 0x080c, 0x9eac, 0x0066, 0x2031, 0x0001, 0x080c, 0x7062,
+	0x006e, 0x0804, 0x94a2, 0x080c, 0x94ae, 0x0904, 0x94a2, 0x6904,
+	0xd1f4, 0x0904, 0x94a9, 0x080c, 0x2b24, 0x00c6, 0x703c, 0x9065,
+	0x090c, 0x0db4, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528, 0x61c8,
+	0x60c4, 0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01e0,
+	0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1510,
+	0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2a77, 0x6014,
+	0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060, 0x2009,
+	0x0049, 0x080c, 0x9eac, 0x0070, 0x0036, 0x2019, 0x0001, 0x080c,
+	0x96d8, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8c9, 0x2009, 0x004a,
+	0x080c, 0x9eac, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e,
+	0x0005, 0xd1ec, 0x1904, 0x9463, 0x0804, 0x9465, 0x00d6, 0x00c6,
+	0x0096, 0x703c, 0x9065, 0x090c, 0x0db4, 0x2001, 0x1836, 0x2004,
+	0xd09c, 0x1904, 0x953a, 0x2001, 0x0306, 0x200c, 0x9184, 0x0030,
+	0x0904, 0x953a, 0x9184, 0x0048, 0x9086, 0x0008, 0x1904, 0x953a,
+	0x2001, 0x020b, 0x2004, 0xd0fc, 0x0904, 0x953a, 0xd08c, 0x0904,
+	0x953a, 0x2009, 0x1a50, 0x2104, 0x8000, 0x0208, 0x200a, 0x2069,
+	0x0100, 0x6914, 0x918c, 0x0184, 0x918d, 0x0010, 0x6916, 0x69c8,
+	0x2011, 0x0020, 0x68c8, 0x9106, 0x1570, 0x8211, 0x1dd8, 0x2001,
+	0x0306, 0x2003, 0x4800, 0x2001, 0x009a, 0x2003, 0x0004, 0x2001,
+	0x1a36, 0x2003, 0x0000, 0x2001, 0x1a3f, 0x2003, 0x0000, 0x6a88,
+	0x698c, 0x2200, 0x9105, 0x1120, 0x2c10, 0x080c, 0x1a5c, 0x0040,
+	0x6014, 0x2048, 0xaa3a, 0xa936, 0x6ac4, 0x69c8, 0xa946, 0xaa4a,
+	0x0126, 0x00c6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1ae8, 0x190c,
+	0x0db4, 0x012e, 0x0090, 0x2009, 0x1a51, 0x2104, 0x8000, 0x0208,
+	0x200a, 0x69c8, 0x2011, 0x0020, 0x8211, 0x1df0, 0x68c8, 0x9106,
+	0x1dc0, 0x69c4, 0x68c8, 0x9105, 0x0160, 0x6824, 0xd08c, 0x0110,
+	0x6827, 0x0002, 0x7048, 0xc085, 0x704a, 0x0079, 0x7048, 0xc084,
+	0x704a, 0x2009, 0x07d0, 0x080c, 0x80bd, 0x9006, 0x009e, 0x00ce,
+	0x00de, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0026, 0x00e6, 0x2071,
+	0x19b8, 0x7048, 0xd084, 0x01c0, 0x713c, 0x81ff, 0x01a8, 0x2071,
+	0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138, 0x7014,
+	0x9084, 0x1984, 0x9085, 0x0012, 0x7016, 0x0030, 0x7014, 0x9084,
+	0x1984, 0x9085, 0x0016, 0x7016, 0x00ee, 0x002e, 0x0005, 0x00b6,
+	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x6010, 0x2058, 0xbca0, 0x2071, 0x19b8, 0x7018,
+	0x2058, 0x8bff, 0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854, 0x2058,
+	0x0cc0, 0x6014, 0x0096, 0x2048, 0xac6c, 0xad70, 0xae78, 0x009e,
+	0x080c, 0x6370, 0x0110, 0x9085, 0x0001, 0x012e, 0x000e, 0x004e,
+	0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x080c,
+	0x8e8e, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6,
+	0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6,
+	0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x6078,
+	0x617c, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c,
+	0x0804, 0x9380, 0x080c, 0x8e8e, 0x7003, 0x0f00, 0x7808, 0xd09c,
+	0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9380, 0x0156, 0x080c, 0x8ed9, 0x7003, 0x0200,
+	0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011, 0x1840,
+	0x2019, 0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70, 0x2276, 0x8e70,
+	0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x95d4, 0x60c3, 0x001c,
+	0x015e, 0x0804, 0x9380, 0x0016, 0x0026, 0x080c, 0x8eb5, 0x080c,
+	0x8ec7, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096,
+	0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021,
+	0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010,
+	0x1250, 0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x9380,
+	0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0x9c2a,
+	0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x8e8e, 0x7003,
+	0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380, 0x0016,
+	0x0026, 0x080c, 0x8e8e, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814,
+	0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080,
+	0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003,
+	0x8003, 0x60c2, 0x080c, 0x9380, 0x002e, 0x001e, 0x0005, 0x00e6,
+	0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x700c,
+	0x2060, 0x8cff, 0x0178, 0x080c, 0xbd1d, 0x1110, 0x080c, 0xa7c0,
+	0x600c, 0x0006, 0x080c, 0xbf84, 0x080c, 0x9e32, 0x080c, 0x97b0,
+	0x00ce, 0x0c78, 0x2c00, 0x700e, 0x700a, 0x012e, 0x000e, 0x00ce,
+	0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c,
+	0x200c, 0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140,
+	0x2071, 0x19b8, 0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c, 0x93ac,
+	0x6ac0, 0x68c3, 0x0000, 0x080c, 0x80b8, 0x00c6, 0x2061, 0x0100,
+	0x080c, 0x9c43, 0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009, 0x0013,
+	0x080c, 0x9eac, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004,
+	0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x80b8,
+	0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
+	0x68c3, 0x0000, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x20a9, 0x01f4,
+	0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
+	0x9084, 0x4000, 0x190c, 0x2b24, 0x0090, 0xd084, 0x0118, 0x6827,
+	0x0001, 0x0010, 0x1f04, 0x96ba, 0x7804, 0x9084, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x0005,
+	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
+	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
+	0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19b8,
+	0x703c, 0x2060, 0x8cff, 0x0904, 0x9766, 0x9386, 0x0002, 0x1128,
+	0x6814, 0x9084, 0x0002, 0x0904, 0x9766, 0x68af, 0x95f5, 0x6817,
+	0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008,
+	0x080c, 0x80c5, 0x080c, 0x1e90, 0x0046, 0x2009, 0x00a5, 0x080c,
+	0x0e2f, 0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004,
+	0x11f8, 0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6,
+	0x2079, 0x0090, 0x2071, 0x1a36, 0x6814, 0x9084, 0x1984, 0x9085,
+	0x0012, 0x6816, 0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee,
+	0x9386, 0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001,
+	0x2001, 0x1952, 0x200c, 0x080c, 0x0e2f, 0x004e, 0x20a9, 0x03e8,
+	0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000,
+	0x190c, 0x2b24, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010,
+	0x1f04, 0x9740, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x6827, 0x4000, 0x6824,
+	0x83ff, 0x1120, 0x2009, 0x0049, 0x080c, 0x9eac, 0x000e, 0x001e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
+	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8, 0x6a06,
+	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
+	0x19b8, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c, 0x9047, 0x7854,
+	0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x9047, 0x7854,
+	0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x9047, 0x7854,
+	0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x9047, 0x7854,
+	0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x9047, 0x7854,
+	0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9380,
+	0x00e6, 0x2071, 0x19b8, 0x7020, 0x9005, 0x0110, 0x8001, 0x7022,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7614, 0x2660,
+	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0x9855, 0x8cff, 0x0904,
+	0x9855, 0x6020, 0x9086, 0x0006, 0x1904, 0x9850, 0x88ff, 0x0138,
+	0x2800, 0x9c06, 0x1904, 0x9850, 0x2039, 0x0000, 0x0050, 0x6010,
+	0x9b06, 0x1904, 0x9850, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904,
+	0x9850, 0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x80b8,
+	0x080c, 0x98da, 0x7027, 0x0000, 0x0428, 0x080c, 0x80b8, 0x6820,
+	0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
+	0x080c, 0x98da, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
 	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006,
 	0x080c, 0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010,
-	0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
-	0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xbcf3, 0x1158, 0x080c,
-	0x2ffc, 0x080c, 0xbd04, 0x11f0, 0x080c, 0xa7a7, 0x00d8, 0x080c,
-	0x98c1, 0x08c0, 0x080c, 0xbd04, 0x1118, 0x080c, 0xa7a7, 0x0090,
-	0x6014, 0x2048, 0x080c, 0xbafc, 0x0168, 0x6020, 0x9086, 0x0003,
-	0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6885,
-	0x080c, 0xbce7, 0x080c, 0xbf6b, 0x080c, 0x9e49, 0x080c, 0x9797,
-	0x00ce, 0x0804, 0x9c80, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9c80,
-	0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e, 0x00ae,
-	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1d08, 0x080c, 0xd4b5, 0x08f0, 0x00d6, 0x0156, 0x080c, 0x8eb1,
-	0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3,
-	0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800,
-	0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c,
-	0x6fa7, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c, 0x1110,
-	0xd2ac, 0x0108, 0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0, 0x2312,
-	0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x2071, 0x0250,
-	0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
-	0x1f04, 0x9d40, 0x60c3, 0x0020, 0x080c, 0x9367, 0x015e, 0x00de,
-	0x0005, 0x0156, 0x080c, 0x8eb1, 0x7a14, 0x82ff, 0x0168, 0x9286,
-	0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100, 0x700b,
-	0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007, 0x001c,
-	0x700f, 0x0001, 0x2011, 0x198e, 0x2204, 0x8007, 0x701a, 0x8210,
-	0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f,
-	0x0248, 0x2001, 0x181e, 0x2004, 0x7022, 0x2001, 0x181f, 0x2004,
-	0x7026, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7026,
-	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
-	0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9367,
-	0x0006, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011,
-	0x0003, 0x080c, 0x9758, 0x2011, 0x0002, 0x080c, 0x9762, 0x080c,
-	0x9649, 0x0036, 0x901e, 0x080c, 0x96bf, 0x003e, 0x0005, 0x2071,
-	0x1883, 0x7000, 0x9005, 0x0140, 0x2001, 0x0976, 0x2071, 0x1800,
-	0x7072, 0x7076, 0x7067, 0xffe0, 0x2071, 0x1800, 0x7070, 0x7052,
-	0x7057, 0x1cd0, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091,
-	0x8000, 0x7550, 0x9582, 0x0010, 0x0608, 0x7054, 0x2060, 0x6000,
-	0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7064, 0x9c02, 0x1208,
-	0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552,
-	0x9ca8, 0x0018, 0x7064, 0x9502, 0x1230, 0x7556, 0x9085, 0x0001,
-	0x012e, 0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc0, 0x9006, 0x0cc0,
-	0x00e6, 0x2071, 0x1800, 0x7550, 0x9582, 0x0010, 0x0600, 0x7054,
-	0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7064,
-	0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008,
-	0x8529, 0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502, 0x1228, 0x7556,
-	0x9085, 0x0001, 0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc8, 0x9006,
-	0x0cc8, 0x9c82, 0x1cd0, 0x0a0c, 0x0db4, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1a0c, 0x0db4, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016,
-	0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x6056,
-	0x605a, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e,
-	0x6042, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x9086, 0x0001,
-	0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x894b, 0x012e,
-	0x0cc0, 0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c, 0xd084,
-	0x190c, 0x190d, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001, 0x1957,
-	0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a,
-	0x080c, 0xd767, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6, 0x0126,
-	0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0001, 0x0608,
+	0x0001, 0x003e, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010,
+	0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096,
+	0x2048, 0x080c, 0xbb15, 0x0110, 0x080c, 0xd4d5, 0x009e, 0x080c,
+	0x9e62, 0x080c, 0x97b0, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x97cb,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x97cb, 0x9006, 0x012e, 0x000e,
+	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
+	0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6,
+	0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b8, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0x98c9,
+	0x6020, 0x9086, 0x0006, 0x1904, 0x98c4, 0x87ff, 0x0128, 0x2700,
+	0x9c06, 0x1904, 0x98c4, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff,
+	0x0118, 0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x96d8, 0x7033, 0x0000, 0x9006, 0x703e,
+	0x7042, 0x7046, 0x704a, 0x003e, 0x7038, 0x9c36, 0x1110, 0x660c,
+	0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
+	0x080c, 0xbb15, 0x0110, 0x080c, 0xd4d5, 0x080c, 0x9e62, 0x87ff,
+	0x1198, 0x00ce, 0x0804, 0x9875, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x9875, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd,
+	0x0001, 0x0c80, 0x00e6, 0x2071, 0x19b8, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x2c10, 0x7638, 0x2660,
+	0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7038, 0x9c36,
+	0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085,
+	0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e,
+	0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19b8, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904,
+	0x99b6, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904,
+	0x99b1, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0904, 0x998d, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xbd0c, 0x1158, 0x080c, 0x3003, 0x080c,
+	0xbd1d, 0x11f0, 0x080c, 0xa7c0, 0x00d8, 0x080c, 0x98da, 0x08c0,
+	0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0090, 0x6014, 0x2048,
+	0x080c, 0xbb15, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x687f, 0x080c, 0xbd00,
+	0x080c, 0xbf84, 0x080c, 0x9e62, 0x080c, 0x97b0, 0x00ce, 0x0804,
+	0x9936, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9936, 0x012e, 0x000e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xd4d5, 0x0c08, 0x00d6,
+	0x080c, 0x8ed9, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014,
+	0x20e1, 0x0001, 0x2099, 0x195a, 0x20e9, 0x0000, 0x20a1, 0x0250,
+	0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c,
+	0x9380, 0x00de, 0x0005, 0x080c, 0x8ed9, 0x700b, 0x0800, 0x7814,
+	0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c,
+	0x7026, 0x7858, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7858,
+	0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x9380, 0x00b6,
+	0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xc18a,
+	0x00de, 0x1904, 0x9a64, 0x080c, 0x8e8e, 0x7003, 0x1300, 0x782c,
+	0x080c, 0x9b66, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810,
+	0x2058, 0xbaa0, 0x080c, 0x9db1, 0x11d8, 0x9286, 0x007e, 0x1128,
+	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128,
+	0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180,
+	0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400,
+	0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0,
+	0x6098, 0x700e, 0x00a8, 0x080c, 0x9db1, 0x1130, 0x7810, 0x2058,
+	0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181e, 0x2d04,
+	0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e,
+	0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de,
+	0x080c, 0x9380, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006,
+	0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c,
+	0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0x9ade, 0x9186,
+	0x0005, 0x0904, 0x9ac7, 0x9186, 0x0004, 0x05d8, 0x9186, 0x0008,
+	0x0904, 0x9acf, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700,
+	0x080c, 0x9b43, 0x0005, 0x080c, 0x9b04, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x6800, 0x0002, 0x9aa8, 0x9ab3, 0x9aaa,
+	0x9ab3, 0x9aaf, 0x9aa8, 0x9aa8, 0x9ab3, 0x9ab3, 0x9ab3, 0x9ab3,
+	0x9aa8, 0x9aa8, 0x9aa8, 0x9aa8, 0x9aa8, 0x9ab3, 0x9aa8, 0x9ab3,
+	0x080c, 0x0db4, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e,
+	0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804,
+	0x9afd, 0x080c, 0x9b04, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04b0, 0x04e1,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0470, 0x04a1,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
+	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x00f8, 0x0429, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
+	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
+	0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004,
+	0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018,
+	0x002e, 0x00de, 0x0804, 0x9380, 0x00b6, 0x0036, 0x0046, 0x0056,
+	0x0066, 0x080c, 0x8ed9, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a,
+	0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0x9db1, 0x1118,
+	0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68,
+	0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028,
+	0x901e, 0x6498, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008,
+	0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e,
+	0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e,
+	0x003e, 0x00be, 0x0005, 0x080c, 0x8ed9, 0x7003, 0x0100, 0x782c,
+	0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380,
+	0x080c, 0x8e85, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c,
+	0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff,
+	0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0x9380, 0x00e6, 0x2071,
+	0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8bc,
+	0xd084, 0x0120, 0x7848, 0x702a, 0x7844, 0x702e, 0x00be, 0x00fe,
+	0x000e, 0x00ee, 0x0005, 0x080c, 0x8ed0, 0x7003, 0x0100, 0x782c,
+	0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380, 0x0021,
+	0x60c3, 0x0000, 0x0804, 0x9380, 0x00d6, 0x080c, 0x9c3f, 0xb810,
+	0x9085, 0x0300, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
+	0x700a, 0x687c, 0x700e, 0x7013, 0x0819, 0x080c, 0x936e, 0x721a,
+	0x2f10, 0x7222, 0x7a08, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005,
+	0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026,
+	0x080c, 0x29ca, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
+	0x002e, 0x080c, 0x93a3, 0x080c, 0x80af, 0x0005, 0x0036, 0x0096,
+	0x00d6, 0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294,
+	0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194,
+	0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384,
+	0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6,
+	0x2069, 0x0200, 0x080c, 0x9c3f, 0x00de, 0x20e9, 0x0000, 0x20a1,
+	0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
+	0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286,
+	0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e,
+	0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0,
+	0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180,
+	0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140,
+	0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x1983, 0x210c,
+	0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036,
+	0x6116, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088,
+	0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d,
+	0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009,
+	0x0008, 0x6912, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9,
+	0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0,
+	0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1,
+	0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812,
+	0x0c60, 0x00de, 0x0005, 0x00d6, 0x0096, 0x6014, 0x2048, 0xa878,
+	0x6056, 0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946, 0xa84a, 0x6023,
+	0x0003, 0x6007, 0x0040, 0x6003, 0x0003, 0x600b, 0xffff, 0xa817,
+	0x0001, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813, 0x1f24, 0x080c,
+	0x8456, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a4e, 0x012e, 0x009e,
+	0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096,
+	0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x760c, 0x2660,
+	0x2678, 0x8cff, 0x0904, 0x9d11, 0x7024, 0x9c06, 0x1520, 0x2069,
+	0x0100, 0x68c0, 0x9005, 0x0904, 0x9ce8, 0x080c, 0x93ac, 0x68c3,
+	0x0000, 0x080c, 0x98da, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14,
+	0x9006, 0x080c, 0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e,
+	0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a,
+	0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xbd0c, 0x1158,
+	0x080c, 0x3003, 0x080c, 0xbd1d, 0x11f0, 0x080c, 0xa7c0, 0x00d8,
+	0x080c, 0x98da, 0x08c0, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0,
+	0x0090, 0x6014, 0x2048, 0x080c, 0xbb15, 0x0168, 0x6020, 0x9086,
+	0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0x688c, 0x080c, 0xbd00, 0x080c, 0xbf84, 0x080c, 0x9e62, 0x080c,
+	0x97b0, 0x00ce, 0x0804, 0x9c99, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x9c99, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e,
+	0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086,
+	0x0006, 0x1d08, 0x080c, 0xd4d5, 0x08f0, 0x00d6, 0x0156, 0x080c,
+	0x8ed9, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069,
+	0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060,
+	0x080c, 0x6fb2, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c,
+	0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0,
+	0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x2071,
+	0x0250, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290,
+	0x0002, 0x1f04, 0x9d59, 0x60c3, 0x0020, 0x080c, 0x9380, 0x015e,
+	0x00de, 0x0005, 0x0156, 0x080c, 0x8ed9, 0x7a14, 0x82ff, 0x0168,
+	0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007,
+	0x001c, 0x700f, 0x0001, 0x2011, 0x198e, 0x2204, 0x8007, 0x701a,
+	0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7022, 0x2001, 0x181f,
+	0x2004, 0x7026, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
+	0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804,
+	0x9380, 0x0006, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005,
+	0x2011, 0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b,
+	0x080c, 0x9662, 0x0036, 0x901e, 0x080c, 0x96d8, 0x003e, 0x0005,
+	0x2071, 0x1883, 0x7000, 0x9005, 0x0140, 0x2001, 0x0976, 0x2071,
+	0x1800, 0x7072, 0x7076, 0x7067, 0xffe0, 0x2071, 0x1800, 0x7070,
+	0x7052, 0x7057, 0x1cd0, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800,
+	0x2091, 0x8000, 0x7550, 0x9582, 0x0010, 0x0608, 0x7054, 0x2060,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018, 0x7064, 0x9c02,
+	0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003, 0x0008, 0x8529,
+	0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502, 0x1230, 0x7556, 0x9085,
+	0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc0, 0x9006,
+	0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7550, 0x9582, 0x0010, 0x0600,
 	0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x0018,
 	0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98, 0x6003,
-	0x0008, 0x8529, 0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502, 0x1230,
-	0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1cd0,
-	0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002, 0x9ea6,
-	0x9eaf, 0x9eca, 0x9ee5, 0xc21f, 0xc23c, 0xc257, 0x9ea6, 0x9eaf,
-	0x9ea6, 0x9f01, 0x9ea6, 0x9ea6, 0x9ea6, 0x9ea6, 0x9186, 0x0013,
-	0x1128, 0x080c, 0x8846, 0x080c, 0x894b, 0x0005, 0x0005, 0x0066,
-	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e, 0x0005,
-	0x9ec8, 0xa620, 0xa7ee, 0x9ec8, 0xa87c, 0xa1e4, 0x9ec8, 0x9ec8,
-	0xa5a2, 0xae1e, 0x9ec8, 0x9ec8, 0x9ec8, 0x9ec8, 0x9ec8, 0x9ec8,
+	0x0008, 0x8529, 0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502, 0x1228,
+	0x7556, 0x9085, 0x0001, 0x00ee, 0x0005, 0x7057, 0x1cd0, 0x0cc8,
+	0x9006, 0x0cc8, 0x9c82, 0x1cd0, 0x0a0c, 0x0db4, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1a0c, 0x0db4, 0x9006, 0x6006, 0x600a, 0x600e,
+	0x6016, 0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e,
+	0x6056, 0x605a, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a,
+	0x603e, 0x6042, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x9086,
+	0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x8973,
+	0x012e, 0x0cc0, 0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c,
+	0xd084, 0x190c, 0x190d, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001,
+	0x1957, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
+	0x601a, 0x080c, 0xd787, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6,
+	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0001,
+	0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
+	0x0018, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98,
+	0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502,
+	0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057,
+	0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002,
+	0x9ebf, 0x9ec8, 0x9ee3, 0x9efe, 0xc238, 0xc255, 0xc270, 0x9ebf,
+	0x9ec8, 0x9ebf, 0x9f1a, 0x9ebf, 0x9ebf, 0x9ebf, 0x9ebf, 0x9186,
+	0x0013, 0x1128, 0x080c, 0x886e, 0x080c, 0x8973, 0x0005, 0x0005,
+	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e,
+	0x0005, 0x9ee1, 0xa639, 0xa807, 0x9ee1, 0xa895, 0xa1fd, 0x9ee1,
+	0x9ee1, 0xa5bb, 0xae37, 0x9ee1, 0x9ee1, 0x9ee1, 0x9ee1, 0x9ee1,
+	0x9ee1, 0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0db4, 0x0013, 0x006e, 0x0005, 0x9efc, 0xb50b, 0x9efc, 0x9efc,
+	0x9efc, 0x9efc, 0x9efc, 0x9efc, 0xb4b0, 0xb68d, 0x9efc, 0xb54c,
+	0xb5cb, 0xb54c, 0xb5cb, 0x9efc, 0x080c, 0x0db4, 0x6000, 0x9082,
+	0x0016, 0x1a0c, 0x0db4, 0x6000, 0x0002, 0x9f18, 0xae7e, 0xaf63,
+	0xb093, 0xb23e, 0x9f18, 0x9f18, 0x9f18, 0xae52, 0xb43c, 0xb43f,
+	0x9f18, 0x9f18, 0x9f18, 0x9f18, 0xb46e, 0x9f18, 0x9f18, 0x9f18,
 	0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4,
-	0x0013, 0x006e, 0x0005, 0x9ee3, 0xb4f2, 0x9ee3, 0x9ee3, 0x9ee3,
-	0x9ee3, 0x9ee3, 0x9ee3, 0xb497, 0xb674, 0x9ee3, 0xb533, 0xb5b2,
-	0xb533, 0xb5b2, 0x9ee3, 0x080c, 0x0db4, 0x6000, 0x9082, 0x0016,
-	0x1a0c, 0x0db4, 0x6000, 0x0002, 0x9eff, 0xae65, 0xaf4a, 0xb07a,
-	0xb225, 0x9eff, 0x9eff, 0x9eff, 0xae39, 0xb423, 0xb426, 0x9eff,
-	0x9eff, 0x9eff, 0x9eff, 0xb455, 0x9eff, 0x9eff, 0x9eff, 0x080c,
-	0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013,
-	0x006e, 0x0005, 0x9f1a, 0x9f1a, 0x9f5d, 0x9ffc, 0xa091, 0x9f1a,
-	0x9f1a, 0x9f1a, 0x9f1c, 0x9f1a, 0x9f1a, 0x9f1a, 0x9f1a, 0x9f1a,
-	0x9f1a, 0x9f1a, 0x080c, 0x0db4, 0x9186, 0x004c, 0x0588, 0x9186,
-	0x0003, 0x190c, 0x0db4, 0x0096, 0x601c, 0xc0ed, 0x601e, 0x6003,
-	0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000, 0xc0b5,
-	0xa87e, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0x9006, 0xa836, 0xa83a,
-	0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013,
-	0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1a5c, 0x080c,
-	0x842e, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a26, 0x012e, 0x0005,
-	0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0xa0b3,
-	0x080c, 0xc211, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6,
-	0x2079, 0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110,
-	0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140,
-	0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010, 0x0028,
-	0xa87b, 0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883, 0x0000,
-	0xaa02, 0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118,
-	0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001,
-	0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0x9fc4,
-	0x9fc4, 0x9fbf, 0x9fc2, 0x9fc4, 0x9fbc, 0x9faf, 0x9faf, 0x9faf,
-	0x9faf, 0x9faf, 0x9faf, 0x9faf, 0x9faf, 0x9faf, 0x9faf, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe,
-	0x009e, 0x00de, 0x080c, 0x0db4, 0x080c, 0xaa5d, 0x0028, 0x080c,
-	0xab80, 0x0010, 0x080c, 0xac6f, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xa171, 0x0530,
-	0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc,
-	0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x1249, 0x080c,
-	0xa31b, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de,
-	0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0x9e19, 0x2001, 0x002c,
-	0x900e, 0x080c, 0xa1d7, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6,
-	0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0db4, 0x91b2, 0x0050,
-	0x1a0c, 0x0db4, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109, 0x2004,
-	0xd08c, 0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026,
-	0x080c, 0x8382, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000,
-	0x9086, 0x0002, 0x1110, 0x0804, 0x9f5d, 0x0005, 0xa02f, 0xa02f,
-	0xa031, 0xa067, 0xa02f, 0xa02f, 0xa02f, 0xa02f, 0xa07a, 0x080c,
-	0x0db4, 0x00d6, 0x0016, 0x0096, 0x080c, 0x88fb, 0x080c, 0x8a26,
-	0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0, 0xa878,
-	0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001, 0x0000,
-	0x900e, 0x080c, 0xa1d7, 0x080c, 0x9e19, 0x00a8, 0x6003, 0x0002,
-	0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78, 0xa87f,
-	0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2, 0xa8c7,
-	0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005, 0x080c,
-	0x88fb, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbafe, 0x0120,
-	0xa87b, 0x0006, 0x080c, 0x6885, 0x009e, 0x00de, 0x080c, 0x9e19,
-	0x0804, 0x8a26, 0x080c, 0x88fb, 0x080c, 0x2fd7, 0x080c, 0xc20e,
-	0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbafe, 0x0120, 0xa87b,
-	0x0029, 0x080c, 0x6885, 0x009e, 0x00de, 0x080c, 0x9e19, 0x0804,
-	0x8a26, 0x9182, 0x0047, 0x0002, 0xa0a1, 0xa0a3, 0xa0a1, 0xa0a1,
-	0xa0a1, 0xa0a1, 0xa0a1, 0xa0a1, 0xa0a1, 0xa0a1, 0xa0a1, 0xa0a1,
-	0xa0a3, 0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x150f, 0x6114,
-	0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6885, 0x009e,
-	0x00de, 0x0804, 0x9e19, 0x0026, 0x0036, 0x0056, 0x0066, 0x0096,
-	0x00a6, 0x00f6, 0x0006, 0x080c, 0x0feb, 0x000e, 0x090c, 0x0db4,
-	0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9,
-	0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x798c, 0x9188, 0x0018,
-	0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001, 0x0205,
-	0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034, 0x1228,
-	0x2011, 0x001f, 0x080c, 0xb6f9, 0x04c0, 0x2130, 0x2009, 0x0034,
-	0x2011, 0x001f, 0x080c, 0xb6f9, 0x96b2, 0x0034, 0xb004, 0x904d,
-	0x0110, 0x080c, 0x0f9d, 0x080c, 0x0feb, 0x01d0, 0x8528, 0xa867,
-	0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1230,
-	0x2608, 0x2011, 0x001b, 0x080c, 0xb6f9, 0x00b8, 0x96b2, 0x003c,
-	0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb6f9, 0x0c18,
-	0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050,
-	0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48, 0xa804,
-	0xa807, 0x0000, 0x0006, 0x080c, 0x6885, 0x000e, 0x2048, 0x9005,
-	0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e, 0x002e,
-	0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0feb, 0x000e,
-	0x090c, 0x0db4, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0,
-	0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079, 0x1800,
-	0x798c, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210, 0x2009,
-	0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c, 0x9080,
-	0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102,
-	0x4003, 0x2003, 0x0000, 0x080c, 0x6885, 0x009e, 0x00fe, 0x00de,
-	0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001, 0x0205,
-	0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200, 0x2e98,
-	0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021, 0x003e,
-	0x901e, 0x9282, 0x0020, 0x0218, 0x2011, 0x0020, 0x2018, 0x9486,
-	0x003e, 0x1170, 0x0096, 0x080c, 0x0feb, 0x2900, 0x009e, 0x05c0,
-	0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
-	0x3300, 0x908e, 0x0260, 0x0140, 0x2009, 0x0280, 0x9102, 0x920a,
-	0x0218, 0x2010, 0x2100, 0x9318, 0x2200, 0x9402, 0x1228, 0x2400,
-	0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800, 0x9200,
-	0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300, 0x9086,
-	0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x2e98,
-	0x2310, 0x84ff, 0x0904, 0xa186, 0x0804, 0xa188, 0x9085, 0x0001,
-	0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005, 0x00d6,
-	0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c, 0x6878,
-	0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118, 0x080c,
-	0x9e19, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x080c, 0x9e19,
-	0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014, 0x0096,
-	0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003, 0x0136,
-	0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418, 0x8318,
-	0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8, 0x2011,
-	0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003, 0x3418,
-	0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xbafe, 0x0130,
-	0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e, 0x0804,
-	0x9e19, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200, 0x11a8,
-	0x6010, 0x00b6, 0x2058, 0xb8bf, 0x0000, 0x00be, 0x6014, 0x9005,
-	0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32, 0x080c,
-	0x9e19, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48, 0x0cc8,
-	0x0006, 0x0016, 0x080c, 0xc1f9, 0x0188, 0x6014, 0x9005, 0x1170,
-	0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009, 0x0022,
-	0x080c, 0xa5f8, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085, 0x0001,
-	0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c, 0x20e1,
-	0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001, 0x2099,
-	0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804, 0x2048,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001,
-	0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020, 0x4003,
-	0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103,
-	0x080c, 0x9e19, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016, 0x900e,
-	0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff, 0x800c,
-	0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108, 0x810b,
-	0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c, 0xb6f9,
-	0x080c, 0xbafe, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000, 0xa864,
-	0xa8e2, 0xa867, 0x0103, 0x080c, 0x9e19, 0x001e, 0x009e, 0x0005,
-	0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004,
-	0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c,
-	0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c,
-	0xb6f9, 0x009e, 0x080c, 0xbafe, 0x0148, 0xa804, 0x9005, 0x1158,
-	0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9e19,
-	0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086,
-	0x0100, 0x1118, 0x080c, 0xa7a7, 0x00e0, 0xa034, 0x8007, 0x800c,
-	0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0,
-	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x122f, 0x0019,
-	0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0feb, 0x000e,
-	0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a,
-	0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a,
-	0x0086, 0x2940, 0x080c, 0x10d5, 0x008e, 0x9085, 0x0001, 0x009e,
-	0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210,
-	0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210,
-	0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x6043, 0x0000,
-	0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xc171, 0x001e, 0x1158,
-	0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130,
-	0x9386, 0x0006, 0x0128, 0x080c, 0x9e19, 0x0020, 0x0039, 0x0010,
-	0x080c, 0xa42d, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814,
-	0x2048, 0x9186, 0x0015, 0x0904, 0xa415, 0x918e, 0x0016, 0x1904,
-	0xa42b, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186,
-	0x0300, 0x1904, 0xa3ef, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f,
-	0x0904, 0xa3d2, 0x0804, 0xa429, 0x6808, 0x9086, 0xffff, 0x1904,
-	0xa417, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c,
-	0xa940, 0x9105, 0x1904, 0xa417, 0x6824, 0xd0b4, 0x1904, 0xa417,
-	0x080c, 0xbce7, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4,
-	0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x8248,
-	0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138,
-	0x00c6, 0x2d60, 0x080c, 0xb823, 0x00ce, 0x0804, 0xa429, 0x00c6,
-	0xa868, 0xd0fc, 0x1118, 0x080c, 0x5d46, 0x0010, 0x080c, 0x60ed,
-	0x00ce, 0x1904, 0xa417, 0x00c6, 0x2d60, 0x080c, 0x9e19, 0x00ce,
-	0x0804, 0xa429, 0x00c6, 0x080c, 0x9e66, 0x0198, 0x6017, 0x0000,
-	0x6810, 0x6012, 0x080c, 0xbf73, 0x6023, 0x0003, 0x6904, 0x00c6,
-	0x2d60, 0x080c, 0x9e19, 0x00ce, 0x080c, 0x9e93, 0x00ce, 0x0804,
-	0xa429, 0x2001, 0x1959, 0x2004, 0x6842, 0x00ce, 0x04d0, 0x7008,
-	0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc,
-	0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xc1b3,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x83c9,
-	0x080c, 0x894b, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00, 0x1138,
-	0x2001, 0x1959, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0, 0x89ff,
-	0x090c, 0x0db4, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b,
-	0x0003, 0x080c, 0x66a0, 0x080c, 0xbce7, 0x080c, 0x9e49, 0x00de,
-	0x00ce, 0x080c, 0x9e19, 0x009e, 0x0005, 0x9186, 0x0015, 0x1128,
-	0x2001, 0x1959, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016, 0x1160,
-	0x00c6, 0x2d00, 0x2060, 0x080c, 0xd767, 0x080c, 0x81dc, 0x080c,
-	0x9e19, 0x00ce, 0x080c, 0x9e19, 0x0005, 0x0026, 0x0036, 0x0046,
-	0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1959, 0x2004,
-	0x6842, 0x0804, 0xa4a7, 0x00c6, 0x2d60, 0x080c, 0xb724, 0x00ce,
-	0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003,
-	0x0001, 0x6007, 0x0050, 0x080c, 0x83c9, 0x080c, 0x894b, 0x00ce,
-	0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c, 0x0db4,
-	0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843,
-	0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001,
-	0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4,
-	0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934,
-	0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118,
-	0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a, 0x2001,
-	0x0005, 0x6832, 0x080c, 0xbe6a, 0x080c, 0x894b, 0x0010, 0x080c,
-	0x9e19, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026,
-	0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be,
-	0x9206, 0x1904, 0xa512, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14,
-	0x00be, 0x9206, 0x1904, 0xa512, 0x6038, 0x2068, 0x6824, 0xc0dc,
-	0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xa512, 0x9286, 0x0002,
-	0x0904, 0xa512, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c, 0x9306,
-	0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e, 0x0016,
-	0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b, 0x01c0,
-	0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186, 0x004e,
-	0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048, 0x080c,
-	0xbafe, 0x090c, 0x0db4, 0xa87b, 0x0003, 0x009e, 0x080c, 0xc1b3,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x83c9,
-	0x080c, 0x894b, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x1959,
-	0x2004, 0x7042, 0x080c, 0x9e19, 0x002e, 0x00de, 0x00ee, 0x0005,
-	0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058, 0x91b6,
-	0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460,
-	0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019,
-	0x000a, 0x20a9, 0x0004, 0x080c, 0xadf4, 0x002e, 0x003e, 0x015e,
-	0x009e, 0x1904, 0xa581, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48,
-	0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c, 0xadf4,
-	0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c,
-	0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe,
-	0x009e, 0x00be, 0x0804, 0xa21c, 0x0096, 0x2048, 0xaa12, 0xab16,
-	0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8,
-	0xada4, 0x2031, 0x0000, 0x2041, 0x122f, 0x080c, 0xa31b, 0x0130,
-	0x00fe, 0x009e, 0x080c, 0x9e19, 0x00be, 0x0005, 0x080c, 0xa7a7,
-	0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x00fe,
-	0x00c6, 0x080c, 0x9dc3, 0x2f00, 0x6012, 0x6017, 0x0000, 0x6023,
-	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x080c,
-	0x6188, 0x080c, 0x61b4, 0x080c, 0x8411, 0x080c, 0x894b, 0x00ce,
-	0x0804, 0xa554, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0db4, 0x91b2,
-	0x0040, 0x1a04, 0xa60a, 0x0002, 0xa5f8, 0xa5f8, 0xa5ee, 0xa5f8,
-	0xa5f8, 0xa5f8, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec,
-	0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec,
-	0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec,
-	0xa5ec, 0xa5ec, 0xa5ec, 0xa5f8, 0xa5ec, 0xa5f8, 0xa5f8, 0xa5ec,
-	0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ee, 0xa5ec, 0xa5ec, 0xa5ec,
-	0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5f8, 0xa5f8,
-	0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec, 0xa5ec,
-	0xa5ec, 0xa5f8, 0xa5ec, 0xa5ec, 0x080c, 0x0db4, 0x0066, 0x00b6,
-	0x6610, 0x2658, 0xb8bc, 0xc08c, 0xb8be, 0x00be, 0x006e, 0x0000,
-	0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c, 0x8411,
-	0x0010, 0x080c, 0x83c9, 0x0126, 0x2091, 0x8000, 0x080c, 0x894b,
-	0x012e, 0x0005, 0x2600, 0x0002, 0xa61e, 0xa61e, 0xa61e, 0xa5f8,
-	0xa5f8, 0xa61e, 0xa61e, 0xa61e, 0xa61e, 0xa5f8, 0xa61e, 0xa5f8,
-	0xa61e, 0xa5f8, 0xa61e, 0xa61e, 0xa61e, 0xa61e, 0x080c, 0x0db4,
-	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6, 0x0013, 0x0904,
-	0xa6e2, 0x91b6, 0x0027, 0x1904, 0xa69d, 0x080c, 0x8846, 0x6004,
-	0x080c, 0xbcf3, 0x01b0, 0x080c, 0xbd04, 0x01a8, 0x908e, 0x0021,
-	0x0904, 0xa69a, 0x908e, 0x0022, 0x1130, 0x080c, 0xa248, 0x0904,
-	0xa696, 0x0804, 0xa697, 0x908e, 0x003d, 0x0904, 0xa69a, 0x0804,
-	0xa690, 0x080c, 0x2ffc, 0x2001, 0x0007, 0x080c, 0x6188, 0x6010,
-	0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa7a7, 0x9186, 0x007e,
-	0x1148, 0x2001, 0x1836, 0x2014, 0xc285, 0x080c, 0x6fa7, 0x1108,
-	0xc2ad, 0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c,
-	0xd7c2, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019,
-	0x0028, 0x080c, 0x8549, 0x0076, 0x903e, 0x080c, 0x8441, 0x6010,
-	0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xd27b, 0x007e,
-	0x003e, 0x002e, 0x001e, 0x080c, 0xc20e, 0x0016, 0x080c, 0xbf6b,
-	0x080c, 0x9e19, 0x001e, 0x080c, 0x30ce, 0x080c, 0x894b, 0x0030,
-	0x080c, 0xbf6b, 0x080c, 0x9e19, 0x080c, 0x894b, 0x0005, 0x080c,
-	0xa7a7, 0x0cb0, 0x080c, 0xa7e3, 0x0c98, 0x9186, 0x0014, 0x1db0,
-	0x080c, 0x8846, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xa248,
-	0x0d68, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x080c, 0xbcf3, 0x1190,
-	0x080c, 0x2ffc, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c,
-	0xa7a7, 0x9186, 0x007e, 0x1128, 0x2001, 0x1836, 0x200c, 0xc185,
-	0x2102, 0x0870, 0x080c, 0xbd04, 0x1118, 0x080c, 0xa7a7, 0x0840,
-	0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x1894,
-	0x2079, 0x0000, 0x080c, 0x3362, 0x00fe, 0x00ee, 0x0804, 0xa690,
-	0x6004, 0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c, 0xa7a7,
-	0x0804, 0xa690, 0x90b2, 0x0040, 0x1a04, 0xa790, 0x2008, 0x0002,
-	0xa72a, 0xa72b, 0xa72e, 0xa731, 0xa734, 0xa737, 0xa728, 0xa728,
-	0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728,
-	0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728,
-	0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa73a, 0xa745,
-	0xa728, 0xa747, 0xa745, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728,
-	0xa745, 0xa745, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728, 0xa728,
-	0xa728, 0xa728, 0xa777, 0xa745, 0xa728, 0xa741, 0xa728, 0xa728,
-	0xa728, 0xa742, 0xa728, 0xa728, 0xa728, 0xa745, 0xa76e, 0xa728,
-	0x080c, 0x0db4, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001, 0x0003,
-	0x00f8, 0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001,
-	0x0009, 0x00b0, 0x080c, 0x8846, 0x6003, 0x0005, 0x080c, 0x894b,
-	0x0070, 0x0018, 0x0010, 0x080c, 0x6188, 0x0804, 0xa788, 0x080c,
-	0x8846, 0x080c, 0xc211, 0x6003, 0x0004, 0x080c, 0x894b, 0x0005,
-	0x080c, 0x6188, 0x080c, 0x8846, 0x6003, 0x0002, 0x0036, 0x2019,
-	0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1957, 0x201c,
-	0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b,
-	0x9318, 0x631a, 0x003e, 0x080c, 0x894b, 0x0c08, 0x080c, 0x8846,
-	0x080c, 0xbf6b, 0x080c, 0x9e19, 0x080c, 0x894b, 0x08c0, 0x00e6,
-	0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x3362, 0x00fe,
-	0x00ee, 0x080c, 0x8846, 0x080c, 0x9e19, 0x080c, 0x894b, 0x0838,
-	0x080c, 0x8846, 0x6003, 0x0002, 0x080c, 0xc211, 0x0804, 0x894b,
-	0x2600, 0x2008, 0x0002, 0xa7a5, 0xa7a5, 0xa7a5, 0xa788, 0xa788,
-	0xa7a5, 0xa7a5, 0xa7a5, 0xa7a5, 0xa788, 0xa7a5, 0xa788, 0xa7a5,
-	0xa788, 0xa7a5, 0xa7a5, 0xa7a5, 0xa7a5, 0x080c, 0x0db4, 0x00e6,
-	0x0096, 0x0026, 0x0016, 0x080c, 0xbafe, 0x0568, 0x6014, 0x2048,
-	0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148,
-	0x080c, 0x5128, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
-	0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xc0d8,
-	0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016, 0x6004,
-	0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150, 0x001e, 0xa867,
-	0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e, 0x00ee, 0x0005,
-	0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800, 0x2048,
-	0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005, 0x00b6, 0x6610,
-	0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0db4,
-	0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xbff7, 0x0804, 0xa86b,
-	0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xc040, 0x0804, 0xa86b,
-	0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xc06c, 0x0804, 0xa86b,
-	0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbf8d, 0x0804, 0xa86b,
-	0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xbd3d, 0x0804, 0xa86b,
-	0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbd7e, 0x0804, 0xa86b,
-	0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0xa1f1, 0x04e0, 0x6604,
-	0x96b6, 0x0000, 0x1118, 0x080c, 0xa518, 0x04a8, 0x6604, 0x96b6,
-	0x0022, 0x1118, 0x080c, 0xa229, 0x0470, 0x6604, 0x96b6, 0x0035,
-	0x1118, 0x080c, 0xa339, 0x0438, 0x6604, 0x96b6, 0x0039, 0x1118,
-	0x080c, 0xa4ad, 0x0400, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c,
-	0xa261, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xa29d,
-	0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xa2c8, 0x0058,
-	0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128,
-	0x00be, 0x0804, 0xab29, 0x00be, 0x0005, 0x080c, 0x9eae, 0x0cd8,
-	0xa888, 0xa88b, 0xa888, 0xa8cf, 0xa888, 0xaa5d, 0xab36, 0xa888,
-	0xa888, 0xab03, 0xa888, 0xab17, 0x0096, 0x080c, 0x150f, 0x6014,
-	0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0x9e19,
-	0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708c, 0x9086,
-	0x0074, 0x1540, 0x080c, 0xd24c, 0x11b0, 0x6010, 0x00b6, 0x2058,
-	0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802,
-	0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x6188, 0x080c, 0x2ffc,
-	0x080c, 0x9e19, 0x0088, 0x2001, 0x000a, 0x080c, 0x6188, 0x080c,
-	0x2ffc, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8411, 0x080c,
-	0x894b, 0x0010, 0x080c, 0xaa48, 0x00ee, 0x0005, 0x00d6, 0xb800,
-	0xd084, 0x0158, 0x9006, 0x080c, 0x6174, 0x2069, 0x1853, 0x6804,
-	0x0020, 0x2001, 0x0006, 0x080c, 0x61b4, 0x00de, 0x0005, 0x00b6,
-	0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1904,
-	0xaa21, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c,
-	0xac7a, 0x0804, 0xa986, 0x00d6, 0x080c, 0x6fa7, 0x0198, 0x0026,
-	0x2011, 0x0010, 0x080c, 0x657f, 0x002e, 0x05c8, 0x080c, 0x5393,
-	0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x657f, 0x002e,
-	0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xc0d8,
-	0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x2ffc, 0x080c,
-	0x9e19, 0x001e, 0x080c, 0x30ce, 0x00de, 0x0804, 0xaa22, 0x00de,
-	0x080c, 0xac6f, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510,
-	0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
-	0xc0d8, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
-	0x2001, 0x0006, 0x080c, 0x6188, 0x080c, 0x2ffc, 0x080c, 0x9e19,
-	0x0804, 0xaa22, 0x080c, 0xaa30, 0x6014, 0x9005, 0x0190, 0x2048,
-	0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xc0d8,
-	0x08f8, 0x080c, 0xaa26, 0x0160, 0x9006, 0x080c, 0x6174, 0x2001,
-	0x0004, 0x080c, 0x61b4, 0x2001, 0x0007, 0x080c, 0x6188, 0x08a0,
-	0x2001, 0x0004, 0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0003,
-	0x080c, 0x8411, 0x080c, 0x894b, 0x0804, 0xaa22, 0xb85c, 0xd0e4,
-	0x01d0, 0x080c, 0xbf0d, 0x080c, 0x6fa7, 0x0118, 0xd0dc, 0x1904,
-	0xa948, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x0002,
-	0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x26d7, 0x78e2,
-	0x00fe, 0x0804, 0xa948, 0x080c, 0xbf4a, 0x2011, 0x1836, 0x2204,
-	0xc0a5, 0x2012, 0x0006, 0x080c, 0xd3a5, 0x000e, 0x1904, 0xa948,
-	0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x6188, 0x9006, 0x080c,
-	0x6174, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6,
-	0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff,
-	0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff, 0x00ee,
-	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x26ac, 0x00f6, 0x2100,
-	0x900e, 0x080c, 0x2663, 0x795a, 0x00fe, 0x9186, 0x0081, 0x01d8,
-	0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100,
-	0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c,
-	0x26ac, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100, 0x900e, 0x080c,
-	0x2663, 0x795a, 0x00fe, 0x8108, 0x080c, 0x61d7, 0x2b00, 0x00ce,
-	0x1904, 0xa948, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150,
-	0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d,
-	0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x6188, 0x6023, 0x0001,
-	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8411, 0x080c, 0x894b,
-	0x0008, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810,
-	0x2004, 0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac, 0x0005,
-	0x00e6, 0x080c, 0xd81b, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c,
-	0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058,
-	0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005,
-	0x2030, 0x2001, 0x0007, 0x080c, 0x6188, 0x080c, 0x5393, 0x1120,
-	0x2001, 0x0007, 0x080c, 0x61b4, 0x080c, 0x2ffc, 0x6020, 0x9086,
-	0x000a, 0x1108, 0x0005, 0x0804, 0x9e19, 0x00b6, 0x00e6, 0x0026,
-	0x0016, 0x2071, 0x1800, 0x708c, 0x9086, 0x0014, 0x1904, 0xaafa,
-	0x00d6, 0x080c, 0x6fa7, 0x0198, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x657f, 0x002e, 0x05c8, 0x080c, 0x5393, 0x1540, 0x6014, 0x2048,
-	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8, 0x0026,
-	0x2011, 0x8008, 0x080c, 0x657f, 0x002e, 0x0530, 0x6014, 0x2048,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0030,
-	0x900e, 0x2011, 0x4009, 0x080c, 0xc0d8, 0x0040, 0x6014, 0x2048,
-	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010, 0x2058,
-	0xb9a0, 0x0016, 0x080c, 0x2ffc, 0x080c, 0x9e19, 0x001e, 0x080c,
-	0x30ce, 0x00de, 0x0804, 0xaafe, 0x00de, 0x080c, 0x5393, 0x1170,
-	0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0,
-	0x2021, 0x0006, 0x080c, 0x4a6f, 0x004e, 0x003e, 0x00d6, 0x6010,
-	0x2058, 0x080c, 0x62d2, 0x080c, 0xa8be, 0x00de, 0x080c, 0xad40,
-	0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006,
-	0x080c, 0x6188, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
-	0x4000, 0x080c, 0xc0d8, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
-	0x009e, 0x080c, 0x2ffc, 0x6020, 0x9086, 0x000a, 0x0138, 0x080c,
-	0x9e19, 0x0020, 0x080c, 0xa7a7, 0x080c, 0xaa48, 0x001e, 0x002e,
-	0x00ee, 0x00be, 0x0005, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014,
-	0x1160, 0x2001, 0x0002, 0x080c, 0x6188, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x8411, 0x0804, 0x894b, 0x0804, 0xaa48, 0x2030,
-	0x2011, 0x1823, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b,
-	0x1120, 0x2001, 0x0007, 0x080c, 0x6188, 0x0804, 0x9e19, 0x0804,
-	0xaa48, 0x0002, 0xa888, 0xab41, 0xa888, 0xab80, 0xa888, 0xac2b,
-	0xab36, 0xa888, 0xa888, 0xac3e, 0xa888, 0xac4e, 0x6604, 0x9686,
-	0x0003, 0x0904, 0xaa5d, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9e19,
-	0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xac5e, 0x11a0, 0x9006,
-	0x080c, 0x6174, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x2001, 0x0002,
-	0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8411,
-	0x080c, 0x894b, 0x0408, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009,
-	0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170,
-	0x8001, 0xb842, 0x601b, 0x000a, 0x0078, 0x2009, 0x026f, 0x2104,
-	0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x2fd7,
-	0x080c, 0xc20e, 0x080c, 0xaa48, 0x00ce, 0x00de, 0x00be, 0x0005,
-	0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xac6c, 0x00d6, 0x2069,
-	0x194d, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086,
-	0x007e, 0x1138, 0x2069, 0x181f, 0x2d04, 0x8000, 0x206a, 0x00de,
-	0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x6174, 0x2001, 0x0002,
-	0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8411,
-	0x080c, 0x894b, 0x0804, 0xabfb, 0x080c, 0xbafe, 0x01b0, 0x6014,
-	0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016,
-	0x2001, 0x0002, 0x080c, 0xc132, 0x00b0, 0x6014, 0x2048, 0xa864,
-	0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004,
-	0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x1110, 0x9006, 0x0c38, 0x080c, 0xa7a7, 0x2009, 0x026e, 0x2134,
-	0x96b4, 0x00ff, 0x9686, 0x0005, 0x0510, 0x9686, 0x000b, 0x01c8,
-	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009,
-	0x01b0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0180, 0x2001,
-	0x0004, 0x080c, 0x6188, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052,
-	0x0010, 0x080c, 0xaa48, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286,
-	0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xbafe, 0x0140, 0xa864,
-	0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c50, 0x6010,
-	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842,
-	0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e,
-	0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c5d, 0x00ee, 0x0010,
-	0x080c, 0x2fd7, 0x0870, 0x080c, 0xac6c, 0x1160, 0x2001, 0x0004,
-	0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x8411,
-	0x0804, 0x894b, 0x080c, 0xa7a7, 0x0804, 0xaa48, 0x0469, 0x1160,
-	0x2001, 0x0008, 0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0005,
-	0x080c, 0x8411, 0x0804, 0x894b, 0x0804, 0xaa48, 0x00e9, 0x1160,
-	0x2001, 0x000a, 0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0001,
-	0x080c, 0x8411, 0x0804, 0x894b, 0x0804, 0xaa48, 0x2009, 0x026e,
-	0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084,
-	0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6,
-	0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x6246, 0x001e, 0x00ce,
-	0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016,
-	0x6010, 0x2058, 0x2009, 0x1836, 0x2104, 0x9085, 0x0003, 0x200a,
-	0x080c, 0xad12, 0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd, 0x200a,
-	0x080c, 0x6557, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c,
-	0xd50a, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
-	0x2009, 0x0001, 0x080c, 0x2fa2, 0x00e6, 0x2071, 0x1800, 0x080c,
-	0x2dbb, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f,
-	0x080c, 0x30ce, 0x8108, 0x1f04, 0xacb0, 0x015e, 0x00ce, 0x080c,
-	0xac6f, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001,
-	0x1836, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118,
-	0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1836,
-	0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181e,
-	0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f, 0x206a,
-	0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105,
-	0x2009, 0x182b, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c,
-	0x26ac, 0x080c, 0x6fa7, 0x0170, 0x2071, 0x0260, 0x2069, 0x1953,
-	0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e,
-	0x080c, 0xbf0d, 0x0040, 0x2001, 0x0006, 0x080c, 0x6188, 0x080c,
-	0x2ffc, 0x080c, 0x9e19, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe,
-	0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019,
-	0x182b, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294,
-	0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011,
-	0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xadf4,
-	0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c,
-	0xadf4, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e, 0x0005,
-	0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038,
-	0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00,
-	0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110,
-	0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096,
-	0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2029, 0x19c1, 0x252c, 0x2021, 0x19c7, 0x2424, 0x2061,
-	0x1cd0, 0x2071, 0x1800, 0x7250, 0x7070, 0x9202, 0x1a04, 0xadcc,
-	0x080c, 0xd53b, 0x0904, 0xadc5, 0x6720, 0x9786, 0x0007, 0x0904,
-	0xadc5, 0x2500, 0x9c06, 0x0904, 0xadc5, 0x2400, 0x9c06, 0x05e8,
-	0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1580, 0x00c6, 0x6000, 0x9086,
-	0x0004, 0x1110, 0x080c, 0x190d, 0x9786, 0x000a, 0x0148, 0x080c,
-	0xbd04, 0x1130, 0x00ce, 0x080c, 0xa7a7, 0x080c, 0x9e49, 0x00e8,
-	0x6014, 0x2048, 0x080c, 0xbafe, 0x01a8, 0x9786, 0x0003, 0x1530,
-	0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
-	0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6878,
-	0x080c, 0xbce7, 0x080c, 0x9e49, 0x00ce, 0x9ce0, 0x0018, 0x7064,
-	0x9c02, 0x1210, 0x0804, 0xad73, 0x012e, 0x000e, 0x002e, 0x004e,
-	0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006,
-	0x1118, 0x080c, 0xd4b5, 0x0c30, 0x9786, 0x000a, 0x0998, 0x0880,
-	0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xade0,
-	0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001, 0x0008,
-	0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x8906,
-	0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9300,
-	0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e, 0x1140,
-	0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e, 0x0005,
-	0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000,
-	0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x6004, 0x908a,
-	0x0053, 0x1a0c, 0x0db4, 0x080c, 0xbcf3, 0x0120, 0x080c, 0xbd04,
-	0x0168, 0x0028, 0x080c, 0x2ffc, 0x080c, 0xbd04, 0x0138, 0x080c,
-	0x8846, 0x080c, 0x9e19, 0x080c, 0x894b, 0x0005, 0x080c, 0xa7a7,
-	0x0cb0, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
-	0x0005, 0xae55, 0xae55, 0xae55, 0xae55, 0xae55, 0xae55, 0xae55,
-	0xae55, 0xae55, 0xae55, 0xae55, 0xae57, 0xae57, 0xae57, 0xae57,
-	0xae55, 0xae55, 0xae55, 0xae57, 0xae55, 0x080c, 0x0db4, 0x600b,
-	0xffff, 0x6003, 0x0001, 0x6106, 0x080c, 0x83c9, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x894b, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128,
-	0x6004, 0x9082, 0x0040, 0x0804, 0xaf0c, 0x9186, 0x0027, 0x1520,
-	0x080c, 0x8846, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x0096, 0x6114,
-	0x2148, 0x080c, 0xbafe, 0x0198, 0x080c, 0xbd04, 0x1118, 0x080c,
-	0xa7a7, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000,
-	0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6885, 0x080c, 0xbce7, 0x009e,
-	0x080c, 0x9e19, 0x0804, 0x894b, 0x9186, 0x0014, 0x1120, 0x6004,
-	0x9082, 0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186, 0x0045,
-	0x0138, 0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c, 0x0db4,
-	0x2001, 0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091, 0x2800,
-	0x0006, 0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6, 0x2079,
-	0x19b8, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x82b5, 0x00ce,
-	0x00ee, 0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
-	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xaf4a, 0x0005, 0x0002,
-	0xaee6, 0xaee4, 0xaee4, 0xaee4, 0xaee4, 0xaee4, 0xaee4, 0xaee4,
-	0xaee4, 0xaee4, 0xaee4, 0xaf01, 0xaf01, 0xaf01, 0xaf01, 0xaee4,
-	0xaf01, 0xaee4, 0xaf01, 0xaee4, 0x080c, 0x0db4, 0x080c, 0x8846,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xbafe, 0x0168, 0xa867, 0x0103,
-	0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c,
-	0x6885, 0x080c, 0xbce7, 0x009e, 0x080c, 0x9e19, 0x080c, 0x894b,
-	0x0005, 0x080c, 0x8846, 0x080c, 0xbd04, 0x090c, 0xa7a7, 0x080c,
-	0x9e19, 0x080c, 0x894b, 0x0005, 0x0002, 0xaf23, 0xaf21, 0xaf21,
-	0xaf21, 0xaf21, 0xaf21, 0xaf21, 0xaf21, 0xaf21, 0xaf21, 0xaf21,
-	0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf21, 0xaf44, 0xaf21, 0xaf3a,
-	0xaf21, 0x080c, 0x0db4, 0x0096, 0x080c, 0x8846, 0x6014, 0x2048,
-	0x2001, 0x1959, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140, 0x6003,
-	0x0004, 0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005, 0x6003,
-	0x0002, 0x0cb8, 0x080c, 0x8846, 0x080c, 0xc211, 0x080c, 0xc216,
-	0x6003, 0x000f, 0x0804, 0x894b, 0x080c, 0x8846, 0x080c, 0x9e19,
-	0x0804, 0x894b, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xaf66, 0xaf66, 0xaf66, 0xaf66, 0xaf66, 0xaf68,
-	0xb045, 0xaf66, 0xb079, 0xaf66, 0xaf66, 0xaf66, 0xaf66, 0xaf66,
-	0xaf66, 0xaf66, 0xaf66, 0xaf66, 0xaf66, 0xb079, 0x080c, 0x0db4,
-	0x00b6, 0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff, 0x86ff,
-	0x1528, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xb034, 0xa87b,
-	0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834,
-	0xa938, 0x9115, 0x190c, 0xb20e, 0x080c, 0x66a0, 0x6210, 0x2258,
-	0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4, 0x1904,
-	0xb018, 0x080c, 0x9e19, 0x009e, 0x00be, 0x0005, 0x968c, 0x0c00,
-	0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xb01c, 0x7348,
-	0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0508,
-	0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0,
-	0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100,
-	0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206, 0x0118,
-	0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007,
-	0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4,
-	0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4,
-	0x0804, 0xaf6f, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
-	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
-	0x0025, 0x080c, 0xb6f9, 0x003e, 0xd6cc, 0x0904, 0xaf84, 0x7154,
-	0xa98a, 0x81ff, 0x0904, 0xaf84, 0x9192, 0x0021, 0x1278, 0x8304,
-	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb6f9, 0x2011, 0x0205,
-	0x2013, 0x0000, 0x080c, 0xc19e, 0x0804, 0xaf84, 0xa868, 0xd0fc,
-	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c,
-	0xb698, 0x00ae, 0x080c, 0xc19e, 0x080c, 0xb6e9, 0x0804, 0xaf86,
-	0x080c, 0xbdf7, 0x0804, 0xaf93, 0xa87c, 0xd0ac, 0x0904, 0xaf9f,
-	0xa880, 0xd0bc, 0x1904, 0xaf9f, 0x7348, 0xa838, 0x9306, 0x11c8,
-	0x734c, 0xa834, 0x931e, 0x0904, 0xaf9f, 0xd6d4, 0x0190, 0xab38,
-	0x9305, 0x0904, 0xaf9f, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xaf77,
-	0xa838, 0xa934, 0x9105, 0x0904, 0xaf77, 0xa880, 0xd0bc, 0x1904,
-	0xaf77, 0x080c, 0xbe31, 0x0804, 0xaf93, 0x0096, 0x00f6, 0x6003,
-	0x0003, 0x6007, 0x0043, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c,
-	0x7d08, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140, 0x6003, 0x0002,
-	0x00fe, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac,
-	0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203,
-	0x0e90, 0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe, 0x6043, 0x0000,
-	0x2c10, 0x080c, 0x1a5c, 0x080c, 0x842e, 0x080c, 0x8a26, 0x009e,
-	0x0005, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xb096, 0xb096, 0xb096, 0xb096, 0xb096, 0xb098,
-	0xb12e, 0xb096, 0xb096, 0xb145, 0xb1d1, 0xb096, 0xb096, 0xb096,
-	0xb096, 0xb1e6, 0xb096, 0xb096, 0xb096, 0xb096, 0x080c, 0x0db4,
-	0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150,
-	0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210,
-	0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be,
-	0x86ff, 0x0904, 0xb129, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120,
-	0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xb129,
-	0x080c, 0x0feb, 0x090c, 0x0db4, 0x2900, 0xb07a, 0xb77c, 0xc7cd,
-	0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070,
-	0xa872, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c,
-	0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028,
-	0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015,
-	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
-	0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190,
-	0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019,
-	0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c,
-	0xb6f9, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8,
-	0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
-	0x080c, 0xb6f9, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068,
-	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c,
-	0xb698, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6, 0x00a6,
-	0x6003, 0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
-	0x6014, 0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a, 0x00ae, 0x00fe,
-	0x2c10, 0x080c, 0x1a5c, 0x0804, 0x9360, 0x6003, 0x0002, 0x6004,
-	0x9086, 0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c, 0xd0ac,
-	0x0160, 0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078, 0x080c,
-	0x1648, 0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002, 0x009e,
-	0x080c, 0x8846, 0x080c, 0x894b, 0x0096, 0x2001, 0x1959, 0x2004,
-	0x6042, 0x080c, 0x88fb, 0x080c, 0x8a26, 0x6114, 0x2148, 0xa97c,
-	0xd1e4, 0x0904, 0xb1cc, 0xd1cc, 0x05a8, 0xa978, 0xa868, 0xd0fc,
-	0x0538, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0019, 0x20a0, 0x810e, 0x810e, 0x810f, 0x9184,
-	0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019, 0x2098, 0x0156,
-	0x20a9, 0x0020, 0x4003, 0x015e, 0x000e, 0xa882, 0x000e, 0xa87e,
-	0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0f9d, 0x001e, 0x0440,
-	0x0016, 0x080c, 0x0f9d, 0x009e, 0xa974, 0x0016, 0x080c, 0xb6e9,
-	0x001e, 0x00f0, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6,
-	0x0002, 0x0180, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060,
-	0xd1dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4, 0x0118, 0xa87b,
-	0x0007, 0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x66a0, 0x001e,
-	0xd1e4, 0x1120, 0x080c, 0x9e19, 0x009e, 0x0005, 0x080c, 0xbdf7,
-	0x0cd8, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x8846, 0x080c,
-	0x894b, 0x2019, 0x0001, 0x080c, 0x96bf, 0x6003, 0x0002, 0x080c,
-	0xc216, 0x080c, 0x88fb, 0x080c, 0x8a26, 0x0005, 0x6004, 0x9086,
-	0x0040, 0x1120, 0x080c, 0x8846, 0x080c, 0x894b, 0x2019, 0x0001,
-	0x080c, 0x96bf, 0x080c, 0x88fb, 0x080c, 0x2fd7, 0x080c, 0xc20e,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xbafe, 0x0150, 0xa867, 0x0103,
-	0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6885, 0x080c, 0xbce7,
-	0x009e, 0x080c, 0x9e19, 0x080c, 0x8a26, 0x0005, 0xa87b, 0x0015,
-	0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189,
-	0x0000, 0x0006, 0x0016, 0x2009, 0x1a4a, 0x2104, 0x8000, 0x200a,
-	0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054, 0x1220,
-	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb241, 0xb241, 0xb241,
-	0xb241, 0xb241, 0xb243, 0xb241, 0xb241, 0xb2e9, 0xb241, 0xb241,
-	0xb241, 0xb241, 0xb241, 0xb241, 0xb241, 0xb241, 0xb241, 0xb241,
-	0xb41a, 0x080c, 0x0db4, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071,
-	0x0260, 0x6114, 0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c,
-	0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110,
-	0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xb2e2, 0x9694, 0xff00,
-	0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284,
-	0x0300, 0x0904, 0xb2e2, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005,
-	0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0feb, 0x090c, 0x0db4,
-	0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103,
-	0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084,
-	0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92,
+	0x0013, 0x006e, 0x0005, 0x9f33, 0x9f33, 0x9f76, 0xa015, 0xa0aa,
+	0x9f33, 0x9f33, 0x9f33, 0x9f35, 0x9f33, 0x9f33, 0x9f33, 0x9f33,
+	0x9f33, 0x9f33, 0x9f33, 0x080c, 0x0db4, 0x9186, 0x004c, 0x0588,
+	0x9186, 0x0003, 0x190c, 0x0db4, 0x0096, 0x601c, 0xc0ed, 0x601e,
+	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000,
+	0xc0b5, 0xa87e, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0x9006, 0xa836,
+	0xa83a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
+	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1a5c,
+	0x080c, 0x8456, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a4e, 0x012e,
+	0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c,
+	0xa0cc, 0x080c, 0xc22a, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
+	0x00f6, 0x2079, 0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec,
+	0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005,
+	0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010,
+	0x0028, 0xa87b, 0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883,
+	0x0000, 0xaa02, 0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015,
+	0x1118, 0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118,
+	0x2001, 0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002,
+	0x9fdd, 0x9fdd, 0x9fd8, 0x9fdb, 0x9fdd, 0x9fd5, 0x9fc8, 0x9fc8,
+	0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e,
+	0x00fe, 0x009e, 0x00de, 0x080c, 0x0db4, 0x080c, 0xaa76, 0x0028,
+	0x080c, 0xab99, 0x0010, 0x080c, 0xac88, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xa18a,
+	0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x1249,
+	0x080c, 0xa334, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
+	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0x9e32, 0x2001,
+	0x002c, 0x900e, 0x080c, 0xa1f0, 0x0c70, 0x91b6, 0x0015, 0x0170,
+	0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0db4, 0x91b2,
+	0x0050, 0x1a0c, 0x0db4, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109,
+	0x2004, 0xd08c, 0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x080c, 0x83aa, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
+	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0x9f76, 0x0005, 0xa048,
+	0xa048, 0xa04a, 0xa080, 0xa048, 0xa048, 0xa048, 0xa048, 0xa093,
+	0x080c, 0x0db4, 0x00d6, 0x0016, 0x0096, 0x080c, 0x8923, 0x080c,
+	0x8a4e, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
+	0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001,
+	0x0000, 0x900e, 0x080c, 0xa1f0, 0x080c, 0x9e32, 0x00a8, 0x6003,
+	0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78,
+	0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2,
+	0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005,
+	0x080c, 0x8923, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17,
+	0x0120, 0xa87b, 0x0006, 0x080c, 0x688c, 0x009e, 0x00de, 0x080c,
+	0x9e32, 0x0804, 0x8a4e, 0x080c, 0x8923, 0x080c, 0x2fda, 0x080c,
+	0xc227, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x688c, 0x009e, 0x00de, 0x080c, 0x9e32,
+	0x0804, 0x8a4e, 0x9182, 0x0047, 0x0002, 0xa0ba, 0xa0bc, 0xa0ba,
+	0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba,
+	0xa0ba, 0xa0bc, 0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x150f,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x688c,
+	0x009e, 0x00de, 0x0804, 0x9e32, 0x0026, 0x0036, 0x0056, 0x0066,
+	0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x0feb, 0x000e, 0x090c,
+	0x0db4, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
+	0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x798c, 0x9188,
+	0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034,
+	0x1228, 0x2011, 0x001f, 0x080c, 0xb712, 0x04c0, 0x2130, 0x2009,
+	0x0034, 0x2011, 0x001f, 0x080c, 0xb712, 0x96b2, 0x0034, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0f9d, 0x080c, 0x0feb, 0x01d0, 0x8528,
+	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
+	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb712, 0x00b8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb712,
+	0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
+	0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205,
+	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x688c, 0x000e, 0x2048,
+	0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e,
+	0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0feb,
+	0x000e, 0x090c, 0x0db4, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
+	0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079,
+	0x1800, 0x798c, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210,
+	0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c,
+	0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
+	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x688c, 0x009e, 0x00fe,
+	0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001,
+	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200,
+	0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021,
+	0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011, 0x0020, 0x2018,
+	0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x0feb, 0x2900, 0x009e,
+	0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009, 0x0280, 0x9102,
+	0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200, 0x9402, 0x1228,
+	0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800,
+	0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300,
+	0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
+	0x2e98, 0x2310, 0x84ff, 0x0904, 0xa19f, 0x0804, 0xa1a1, 0x9085,
+	0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005,
+	0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c,
+	0x687f, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
+	0x080c, 0x9e32, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x080c,
+	0x9e32, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
+	0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003,
+	0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418,
+	0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8,
+	0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003,
+	0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xbb17,
+	0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e,
+	0x0804, 0x9e32, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200,
+	0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8bf, 0x0000, 0x00be, 0x6014,
+	0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32,
+	0x080c, 0x9e32, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48,
+	0x0cc8, 0x0006, 0x0016, 0x080c, 0xc212, 0x0188, 0x6014, 0x9005,
+	0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009,
+	0x0022, 0x080c, 0xa611, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085,
+	0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c,
+	0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001,
+	0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804,
+	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
+	0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020,
+	0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
+	0x0103, 0x080c, 0x9e32, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016,
+	0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff,
+	0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108,
+	0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c,
+	0xb712, 0x080c, 0xbb17, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9e32, 0x001e, 0x009e,
+	0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009,
+	0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019,
+	0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048,
+	0x080c, 0xb712, 0x009e, 0x080c, 0xbb17, 0x0148, 0xa804, 0x9005,
+	0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c,
+	0x9e32, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007,
+	0x9086, 0x0100, 0x1118, 0x080c, 0xa7c0, 0x00e0, 0xa034, 0x8007,
+	0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x122f,
+	0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0feb,
+	0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006,
+	0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96,
+	0xad9a, 0x0086, 0x2940, 0x080c, 0x10d5, 0x008e, 0x9085, 0x0001,
+	0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff,
+	0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c,
+	0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x6043,
+	0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xc18a, 0x001e,
+	0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003,
+	0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0x9e32, 0x0020, 0x0039,
+	0x0010, 0x080c, 0xa446, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096,
+	0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xa42e, 0x918e, 0x0016,
+	0x1904, 0xa444, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120,
+	0x9186, 0x0300, 0x1904, 0xa408, 0x89ff, 0x1138, 0x6800, 0x9086,
+	0x000f, 0x0904, 0xa3eb, 0x0804, 0xa442, 0x6808, 0x9086, 0xffff,
+	0x1904, 0xa430, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128,
+	0xa83c, 0xa940, 0x9105, 0x1904, 0xa430, 0x6824, 0xd0b4, 0x1904,
+	0xa430, 0x080c, 0xbd00, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4,
+	0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c,
+	0x8270, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e,
+	0x1138, 0x00c6, 0x2d60, 0x080c, 0xb83c, 0x00ce, 0x0804, 0xa442,
+	0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5d4d, 0x0010, 0x080c,
+	0x60f4, 0x00ce, 0x1904, 0xa430, 0x00c6, 0x2d60, 0x080c, 0x9e32,
+	0x00ce, 0x0804, 0xa442, 0x00c6, 0x080c, 0x9e7f, 0x0198, 0x6017,
+	0x0000, 0x6810, 0x6012, 0x080c, 0xbf8c, 0x6023, 0x0003, 0x6904,
+	0x00c6, 0x2d60, 0x080c, 0x9e32, 0x00ce, 0x080c, 0x9eac, 0x00ce,
+	0x0804, 0xa442, 0x2001, 0x1959, 0x2004, 0x6842, 0x00ce, 0x04d0,
+	0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900,
+	0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c,
+	0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00,
+	0x1138, 0x2001, 0x1959, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0,
+	0x89ff, 0x090c, 0x0db4, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103,
+	0xa87b, 0x0003, 0x080c, 0x66a7, 0x080c, 0xbd00, 0x080c, 0x9e62,
+	0x00de, 0x00ce, 0x080c, 0x9e32, 0x009e, 0x0005, 0x9186, 0x0015,
+	0x1128, 0x2001, 0x1959, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016,
+	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xd787, 0x080c, 0x8204,
+	0x080c, 0x9e32, 0x00ce, 0x080c, 0x9e32, 0x0005, 0x0026, 0x0036,
+	0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1959,
+	0x2004, 0x6842, 0x0804, 0xa4c0, 0x00c6, 0x2d60, 0x080c, 0xb73d,
+	0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
+	0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x83f1, 0x080c, 0x8973,
+	0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c,
+	0x0db4, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178,
+	0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001,
+	0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c,
+	0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838,
+	0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306,
+	0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a,
+	0x2001, 0x0005, 0x6832, 0x080c, 0xbe83, 0x080c, 0x8973, 0x0010,
+	0x080c, 0x9e32, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
+	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
+	0x00be, 0x9206, 0x1904, 0xa52b, 0x700c, 0x6210, 0x00b6, 0x2258,
+	0xba14, 0x00be, 0x9206, 0x1904, 0xa52b, 0x6038, 0x2068, 0x6824,
+	0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xa52b, 0x9286,
+	0x0002, 0x0904, 0xa52b, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c,
+	0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e,
+	0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b,
+	0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186,
+	0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048,
+	0x080c, 0xbb17, 0x090c, 0x0db4, 0xa87b, 0x0003, 0x009e, 0x080c,
+	0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001,
+	0x1959, 0x2004, 0x7042, 0x080c, 0x9e32, 0x002e, 0x00de, 0x00ee,
+	0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058,
+	0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02,
+	0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010,
+	0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xae0d, 0x002e, 0x003e,
+	0x015e, 0x009e, 0x1904, 0xa59a, 0x0096, 0x0156, 0x0036, 0x0026,
+	0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c,
+	0xae0d, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a,
+	0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128,
+	0x00fe, 0x009e, 0x00be, 0x0804, 0xa235, 0x0096, 0x2048, 0xaa12,
+	0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
+	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x122f, 0x080c, 0xa334,
+	0x0130, 0x00fe, 0x009e, 0x080c, 0x9e32, 0x00be, 0x0005, 0x080c,
+	0xa7c0, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x2fda, 0x080c, 0xc227,
+	0x00fe, 0x00c6, 0x080c, 0x9ddc, 0x2f00, 0x6012, 0x6017, 0x0000,
+	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007,
+	0x080c, 0x618f, 0x080c, 0x61bb, 0x080c, 0x8439, 0x080c, 0x8973,
+	0x00ce, 0x0804, 0xa56d, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0db4,
+	0x91b2, 0x0040, 0x1a04, 0xa623, 0x0002, 0xa611, 0xa611, 0xa607,
+	0xa611, 0xa611, 0xa611, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
+	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
+	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
+	0xa605, 0xa605, 0xa605, 0xa605, 0xa611, 0xa605, 0xa611, 0xa611,
+	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa607, 0xa605, 0xa605,
+	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa611,
+	0xa611, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
+	0xa605, 0xa605, 0xa611, 0xa605, 0xa605, 0x080c, 0x0db4, 0x0066,
+	0x00b6, 0x6610, 0x2658, 0xb8bc, 0xc08c, 0xb8be, 0x00be, 0x006e,
+	0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c,
+	0x8439, 0x0010, 0x080c, 0x83f1, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8973, 0x012e, 0x0005, 0x2600, 0x0002, 0xa637, 0xa637, 0xa637,
+	0xa611, 0xa611, 0xa637, 0xa637, 0xa637, 0xa637, 0xa611, 0xa637,
+	0xa611, 0xa637, 0xa611, 0xa637, 0xa637, 0xa637, 0xa637, 0x080c,
+	0x0db4, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6, 0x0013,
+	0x0904, 0xa6fb, 0x91b6, 0x0027, 0x1904, 0xa6b6, 0x080c, 0x886e,
+	0x6004, 0x080c, 0xbd0c, 0x01b0, 0x080c, 0xbd1d, 0x01a8, 0x908e,
+	0x0021, 0x0904, 0xa6b3, 0x908e, 0x0022, 0x1130, 0x080c, 0xa261,
+	0x0904, 0xa6af, 0x0804, 0xa6b0, 0x908e, 0x003d, 0x0904, 0xa6b3,
+	0x0804, 0xa6a9, 0x080c, 0x3003, 0x2001, 0x0007, 0x080c, 0x618f,
+	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa7c0, 0x9186,
+	0x007e, 0x1148, 0x2001, 0x1836, 0x2014, 0xc285, 0x080c, 0x6fb2,
+	0x1108, 0xc2ad, 0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110,
+	0x080c, 0xd7e2, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110,
+	0x2019, 0x0028, 0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469,
+	0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xd29b,
+	0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0xc227, 0x0016, 0x080c,
+	0xbf84, 0x080c, 0x9e32, 0x001e, 0x080c, 0x30d5, 0x080c, 0x8973,
+	0x0030, 0x080c, 0xbf84, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0005,
+	0x080c, 0xa7c0, 0x0cb0, 0x080c, 0xa7fc, 0x0c98, 0x9186, 0x0014,
+	0x1db0, 0x080c, 0x886e, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c,
+	0xa261, 0x0d68, 0x080c, 0x2fda, 0x080c, 0xc227, 0x080c, 0xbd0c,
+	0x1190, 0x080c, 0x3003, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be,
+	0x080c, 0xa7c0, 0x9186, 0x007e, 0x1128, 0x2001, 0x1836, 0x200c,
+	0xc185, 0x2102, 0x0870, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0,
+	0x0840, 0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071,
+	0x1894, 0x2079, 0x0000, 0x080c, 0x3369, 0x00fe, 0x00ee, 0x0804,
+	0xa6a9, 0x6004, 0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c,
+	0xa7c0, 0x0804, 0xa6a9, 0x90b2, 0x0040, 0x1a04, 0xa7a9, 0x2008,
+	0x0002, 0xa743, 0xa744, 0xa747, 0xa74a, 0xa74d, 0xa750, 0xa741,
+	0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741,
+	0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741,
+	0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa753,
+	0xa75e, 0xa741, 0xa760, 0xa75e, 0xa741, 0xa741, 0xa741, 0xa741,
+	0xa741, 0xa75e, 0xa75e, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741,
+	0xa741, 0xa741, 0xa741, 0xa790, 0xa75e, 0xa741, 0xa75a, 0xa741,
+	0xa741, 0xa741, 0xa75b, 0xa741, 0xa741, 0xa741, 0xa75e, 0xa787,
+	0xa741, 0x080c, 0x0db4, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001,
+	0x0003, 0x00f8, 0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8,
+	0x2001, 0x0009, 0x00b0, 0x080c, 0x886e, 0x6003, 0x0005, 0x080c,
+	0x8973, 0x0070, 0x0018, 0x0010, 0x080c, 0x618f, 0x0804, 0xa7a1,
+	0x080c, 0x886e, 0x080c, 0xc22a, 0x6003, 0x0004, 0x080c, 0x8973,
+	0x0005, 0x080c, 0x618f, 0x080c, 0x886e, 0x6003, 0x0002, 0x0036,
+	0x2019, 0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1957,
+	0x201c, 0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b,
+	0x831b, 0x9318, 0x631a, 0x003e, 0x080c, 0x8973, 0x0c08, 0x080c,
+	0x886e, 0x080c, 0xbf84, 0x080c, 0x9e32, 0x080c, 0x8973, 0x08c0,
+	0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x3369,
+	0x00fe, 0x00ee, 0x080c, 0x886e, 0x080c, 0x9e32, 0x080c, 0x8973,
+	0x0838, 0x080c, 0x886e, 0x6003, 0x0002, 0x080c, 0xc22a, 0x0804,
+	0x8973, 0x2600, 0x2008, 0x0002, 0xa7be, 0xa7be, 0xa7be, 0xa7a1,
+	0xa7a1, 0xa7be, 0xa7be, 0xa7be, 0xa7be, 0xa7a1, 0xa7be, 0xa7a1,
+	0xa7be, 0xa7a1, 0xa7be, 0xa7be, 0xa7be, 0xa7be, 0x080c, 0x0db4,
+	0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xbb17, 0x0568, 0x6014,
+	0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056,
+	0x1148, 0x080c, 0x512f, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c,
+	0xc0f1, 0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016,
+	0x6004, 0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150, 0x001e,
+	0xa867, 0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e, 0x00ee,
+	0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800,
+	0x2048, 0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005, 0x00b6,
+	0x6610, 0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c,
+	0x0db4, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xc010, 0x0804,
+	0xa884, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xc059, 0x0804,
+	0xa884, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xc085, 0x0804,
+	0xa884, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbfa6, 0x0804,
+	0xa884, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xbd56, 0x0804,
+	0xa884, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbd97, 0x0804,
+	0xa884, 0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0xa20a, 0x04e0,
+	0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xa531, 0x04a8, 0x6604,
+	0x96b6, 0x0022, 0x1118, 0x080c, 0xa242, 0x0470, 0x6604, 0x96b6,
+	0x0035, 0x1118, 0x080c, 0xa352, 0x0438, 0x6604, 0x96b6, 0x0039,
+	0x1118, 0x080c, 0xa4c6, 0x0400, 0x6604, 0x96b6, 0x003d, 0x1118,
+	0x080c, 0xa27a, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c,
+	0xa2b6, 0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xa2e1,
+	0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016,
+	0x1128, 0x00be, 0x0804, 0xab42, 0x00be, 0x0005, 0x080c, 0x9ec7,
+	0x0cd8, 0xa8a1, 0xa8a4, 0xa8a1, 0xa8e8, 0xa8a1, 0xaa76, 0xab4f,
+	0xa8a1, 0xa8a1, 0xab1c, 0xa8a1, 0xab30, 0x0096, 0x080c, 0x150f,
+	0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804,
+	0x9e32, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708c,
+	0x9086, 0x0074, 0x1540, 0x080c, 0xd26c, 0x11b0, 0x6010, 0x00b6,
+	0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5,
+	0xb802, 0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x618f, 0x080c,
+	0x3003, 0x080c, 0x9e32, 0x0088, 0x2001, 0x000a, 0x080c, 0x618f,
+	0x080c, 0x3003, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8439,
+	0x080c, 0x8973, 0x0010, 0x080c, 0xaa61, 0x00ee, 0x0005, 0x00d6,
+	0xb800, 0xd084, 0x0158, 0x9006, 0x080c, 0x617b, 0x2069, 0x1853,
+	0x6804, 0x0020, 0x2001, 0x0006, 0x080c, 0x61bb, 0x00de, 0x0005,
+	0x00b6, 0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074,
+	0x1904, 0xaa3a, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120,
+	0x080c, 0xac93, 0x0804, 0xa99f, 0x00d6, 0x080c, 0x6fb2, 0x0198,
+	0x0026, 0x2011, 0x0010, 0x080c, 0x6586, 0x002e, 0x05c8, 0x080c,
+	0x539a, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x6586,
+	0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c,
+	0xc0f1, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x3003,
+	0x080c, 0x9e32, 0x001e, 0x080c, 0x30d5, 0x00de, 0x0804, 0xaa3b,
+	0x00de, 0x080c, 0xac88, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080,
+	0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x080c, 0xc0f1, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
+	0x0200, 0x2001, 0x0006, 0x080c, 0x618f, 0x080c, 0x3003, 0x080c,
+	0x9e32, 0x0804, 0xaa3b, 0x080c, 0xaa49, 0x6014, 0x9005, 0x0190,
+	0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
+	0xc0f1, 0x08f8, 0x080c, 0xaa3f, 0x0160, 0x9006, 0x080c, 0x617b,
+	0x2001, 0x0004, 0x080c, 0x61bb, 0x2001, 0x0007, 0x080c, 0x618f,
+	0x08a0, 0x2001, 0x0004, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
+	0x0003, 0x080c, 0x8439, 0x080c, 0x8973, 0x0804, 0xaa3b, 0xb85c,
+	0xd0e4, 0x01d0, 0x080c, 0xbf26, 0x080c, 0x6fb2, 0x0118, 0xd0dc,
+	0x1904, 0xa961, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001,
+	0x0002, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x26d7,
+	0x78e2, 0x00fe, 0x0804, 0xa961, 0x080c, 0xbf63, 0x2011, 0x1836,
+	0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xd3c5, 0x000e, 0x1904,
+	0xa961, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x618f, 0x9006,
+	0x080c, 0x617b, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520,
+	0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084,
+	0x00ff, 0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff,
+	0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x26ac, 0x00f6,
+	0x2100, 0x900e, 0x080c, 0x2663, 0x795a, 0x00fe, 0x9186, 0x0081,
+	0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079,
+	0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe,
+	0x080c, 0x26ac, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100, 0x900e,
+	0x080c, 0x2663, 0x795a, 0x00fe, 0x8108, 0x080c, 0x61de, 0x2b00,
+	0x00ce, 0x1904, 0xa961, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c,
+	0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009,
+	0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x618f, 0x6023,
+	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8439, 0x080c,
+	0x8973, 0x0008, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001,
+	0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac,
+	0x0005, 0x00e6, 0x080c, 0xd83b, 0x0190, 0x2071, 0x0260, 0x7108,
+	0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010,
+	0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee,
+	0x0005, 0x2030, 0x2001, 0x0007, 0x080c, 0x618f, 0x080c, 0x539a,
+	0x1120, 0x2001, 0x0007, 0x080c, 0x61bb, 0x080c, 0x3003, 0x6020,
+	0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0x9e32, 0x00b6, 0x00e6,
+	0x0026, 0x0016, 0x2071, 0x1800, 0x708c, 0x9086, 0x0014, 0x1904,
+	0xab13, 0x00d6, 0x080c, 0x6fb2, 0x0198, 0x0026, 0x2011, 0x0010,
+	0x080c, 0x6586, 0x002e, 0x05c8, 0x080c, 0x539a, 0x1540, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8,
+	0x0026, 0x2011, 0x8008, 0x080c, 0x6586, 0x002e, 0x0530, 0x6014,
+	0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
+	0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xc0f1, 0x0040, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010,
+	0x2058, 0xb9a0, 0x0016, 0x080c, 0x3003, 0x080c, 0x9e32, 0x001e,
+	0x080c, 0x30d5, 0x00de, 0x0804, 0xab17, 0x00de, 0x080c, 0x539a,
+	0x1170, 0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
+	0xbba0, 0x2021, 0x0006, 0x080c, 0x4a76, 0x004e, 0x003e, 0x00d6,
+	0x6010, 0x2058, 0x080c, 0x62d9, 0x080c, 0xa8d7, 0x00de, 0x080c,
+	0xad59, 0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001,
+	0x0006, 0x080c, 0x618f, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e,
+	0x2011, 0x4000, 0x080c, 0xc0f1, 0x0060, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
+	0x0200, 0x009e, 0x080c, 0x3003, 0x6020, 0x9086, 0x000a, 0x0138,
+	0x080c, 0x9e32, 0x0020, 0x080c, 0xa7c0, 0x080c, 0xaa61, 0x001e,
+	0x002e, 0x00ee, 0x00be, 0x0005, 0x2011, 0x1823, 0x2204, 0x9086,
+	0x0014, 0x1160, 0x2001, 0x0002, 0x080c, 0x618f, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x8439, 0x0804, 0x8973, 0x0804, 0xaa61,
+	0x2030, 0x2011, 0x1823, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6,
+	0x000b, 0x1120, 0x2001, 0x0007, 0x080c, 0x618f, 0x0804, 0x9e32,
+	0x0804, 0xaa61, 0x0002, 0xa8a1, 0xab5a, 0xa8a1, 0xab99, 0xa8a1,
+	0xac44, 0xab4f, 0xa8a1, 0xa8a1, 0xac57, 0xa8a1, 0xac67, 0x6604,
+	0x9686, 0x0003, 0x0904, 0xaa76, 0x96b6, 0x001e, 0x1110, 0x080c,
+	0x9e32, 0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xac77, 0x11a0,
+	0x9006, 0x080c, 0x617b, 0x080c, 0x2fda, 0x080c, 0xc227, 0x2001,
+	0x0002, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x8439, 0x080c, 0x8973, 0x0408, 0x2009, 0x026e, 0x2104, 0x9086,
+	0x0009, 0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
+	0x0170, 0x8001, 0xb842, 0x601b, 0x000a, 0x0078, 0x2009, 0x026f,
+	0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c,
+	0x2fda, 0x080c, 0xc227, 0x080c, 0xaa61, 0x00ce, 0x00de, 0x00be,
+	0x0005, 0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xac85, 0x00d6,
+	0x2069, 0x194d, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0,
+	0x9086, 0x007e, 0x1138, 0x2069, 0x181f, 0x2d04, 0x8000, 0x206a,
+	0x00de, 0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x617b, 0x2001,
+	0x0002, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
+	0x8439, 0x080c, 0x8973, 0x0804, 0xac14, 0x080c, 0xbb17, 0x01b0,
+	0x6014, 0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007,
+	0x0016, 0x2001, 0x0002, 0x080c, 0xc14b, 0x00b0, 0x6014, 0x2048,
+	0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e,
+	0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x1110, 0x9006, 0x0c38, 0x080c, 0xa7c0, 0x2009, 0x026e,
+	0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005, 0x0510, 0x9686, 0x000b,
+	0x01c8, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686,
+	0x0009, 0x01b0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0180,
+	0x2001, 0x0004, 0x080c, 0x618f, 0x2001, 0x0028, 0x601a, 0x6007,
+	0x0052, 0x0010, 0x080c, 0xaa61, 0x002e, 0x00be, 0x009e, 0x0005,
+	0x9286, 0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xbb17, 0x0140,
+	0xa864, 0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c50,
+	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001,
+	0xb842, 0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086,
+	0x007e, 0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c64, 0x00ee,
+	0x0010, 0x080c, 0x2fda, 0x0870, 0x080c, 0xac85, 0x1160, 0x2001,
+	0x0004, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
+	0x8439, 0x0804, 0x8973, 0x080c, 0xa7c0, 0x0804, 0xaa61, 0x0469,
+	0x1160, 0x2001, 0x0008, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
+	0x0005, 0x080c, 0x8439, 0x0804, 0x8973, 0x0804, 0xaa61, 0x00e9,
+	0x1160, 0x2001, 0x000a, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x8439, 0x0804, 0x8973, 0x0804, 0xaa61, 0x2009,
+	0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104,
+	0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x624d, 0x001e,
+	0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036,
+	0x0016, 0x6010, 0x2058, 0x2009, 0x1836, 0x2104, 0x9085, 0x0003,
+	0x200a, 0x080c, 0xad2b, 0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd,
+	0x200a, 0x080c, 0x655e, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
+	0x080c, 0xd52a, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
+	0x002a, 0x2009, 0x0001, 0x080c, 0x2fa5, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x2dbb, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009,
+	0x007f, 0x080c, 0x30d5, 0x8108, 0x1f04, 0xacc9, 0x015e, 0x00ce,
+	0x080c, 0xac88, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001,
+	0x2001, 0x1836, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc,
+	0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001,
+	0x1836, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069,
+	0x181e, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f,
+	0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e,
+	0x9105, 0x2009, 0x182b, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008,
+	0x080c, 0x26ac, 0x080c, 0x6fb2, 0x0170, 0x2071, 0x0260, 0x2069,
+	0x1953, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054,
+	0x680e, 0x080c, 0xbf26, 0x0040, 0x2001, 0x0006, 0x080c, 0x618f,
+	0x080c, 0x3003, 0x080c, 0x9e32, 0x001e, 0x003e, 0x00de, 0x00ee,
+	0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156,
+	0x2019, 0x182b, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200,
+	0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198,
+	0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c,
+	0xae0d, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006,
+	0x080c, 0xae0d, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e,
+	0x0005, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8,
+	0x7038, 0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084,
+	0x0f00, 0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac,
+	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
+	0x0096, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2029, 0x19c1, 0x252c, 0x2021, 0x19c7, 0x2424,
+	0x2061, 0x1cd0, 0x2071, 0x1800, 0x7250, 0x7070, 0x9202, 0x1a04,
+	0xade5, 0x080c, 0xd55b, 0x0904, 0xadde, 0x6720, 0x9786, 0x0007,
+	0x0904, 0xadde, 0x2500, 0x9c06, 0x0904, 0xadde, 0x2400, 0x9c06,
+	0x05e8, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1580, 0x00c6, 0x6000,
+	0x9086, 0x0004, 0x1110, 0x080c, 0x190d, 0x9786, 0x000a, 0x0148,
+	0x080c, 0xbd1d, 0x1130, 0x00ce, 0x080c, 0xa7c0, 0x080c, 0x9e62,
+	0x00e8, 0x6014, 0x2048, 0x080c, 0xbb17, 0x01a8, 0x9786, 0x0003,
+	0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878,
+	0x2048, 0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0x687f, 0x080c, 0xbd00, 0x080c, 0x9e62, 0x00ce, 0x9ce0, 0x0018,
+	0x7064, 0x9c02, 0x1210, 0x0804, 0xad8c, 0x012e, 0x000e, 0x002e,
+	0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786,
+	0x0006, 0x1118, 0x080c, 0xd4d5, 0x0c30, 0x9786, 0x000a, 0x0998,
+	0x0880, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
+	0xadf9, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001,
+	0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016,
+	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
+	0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e,
+	0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e,
+	0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001,
+	0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x6004,
+	0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c, 0xbd0c, 0x0120, 0x080c,
+	0xbd1d, 0x0168, 0x0028, 0x080c, 0x3003, 0x080c, 0xbd1d, 0x0138,
+	0x080c, 0x886e, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0005, 0x080c,
+	0xa7c0, 0x0cb0, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e,
+	0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae70, 0xae70, 0xae70,
+	0xae70, 0xae6e, 0xae6e, 0xae6e, 0xae70, 0xae6e, 0x080c, 0x0db4,
+	0x600b, 0xffff, 0x6003, 0x0001, 0x6106, 0x080c, 0x83f1, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8973, 0x012e, 0x0005, 0x9186, 0x0013,
+	0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xaf25, 0x9186, 0x0027,
+	0x1520, 0x080c, 0x886e, 0x080c, 0x2fda, 0x080c, 0xc227, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xbb17, 0x0198, 0x080c, 0xbd1d, 0x1118,
+	0x080c, 0xa7c0, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
+	0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x688c, 0x080c, 0xbd00,
+	0x009e, 0x080c, 0x9e32, 0x0804, 0x8973, 0x9186, 0x0014, 0x1120,
+	0x6004, 0x9082, 0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186,
+	0x0045, 0x0138, 0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c,
+	0x0db4, 0x2001, 0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6,
+	0x2079, 0x19b8, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x82dd,
+	0x00ce, 0x00ee, 0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e,
+	0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xaf63, 0x0005,
+	0x0002, 0xaeff, 0xaefd, 0xaefd, 0xaefd, 0xaefd, 0xaefd, 0xaefd,
+	0xaefd, 0xaefd, 0xaefd, 0xaefd, 0xaf1a, 0xaf1a, 0xaf1a, 0xaf1a,
+	0xaefd, 0xaf1a, 0xaefd, 0xaf1a, 0xaefd, 0x080c, 0x0db4, 0x080c,
+	0x886e, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17, 0x0168, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882,
+	0x080c, 0x688c, 0x080c, 0xbd00, 0x009e, 0x080c, 0x9e32, 0x080c,
+	0x8973, 0x0005, 0x080c, 0x886e, 0x080c, 0xbd1d, 0x090c, 0xa7c0,
+	0x080c, 0x9e32, 0x080c, 0x8973, 0x0005, 0x0002, 0xaf3c, 0xaf3a,
+	0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a,
+	0xaf3a, 0xaf53, 0xaf53, 0xaf53, 0xaf53, 0xaf3a, 0xaf5d, 0xaf3a,
+	0xaf53, 0xaf3a, 0x080c, 0x0db4, 0x0096, 0x080c, 0x886e, 0x6014,
+	0x2048, 0x2001, 0x1959, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140,
+	0x6003, 0x0004, 0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005,
+	0x6003, 0x0002, 0x0cb8, 0x080c, 0x886e, 0x080c, 0xc22a, 0x080c,
+	0xc22f, 0x6003, 0x000f, 0x0804, 0x8973, 0x080c, 0x886e, 0x080c,
+	0x9e32, 0x0804, 0x8973, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f,
+	0xaf81, 0xb05e, 0xaf7f, 0xb092, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f,
+	0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xb092, 0x080c,
+	0x0db4, 0x00b6, 0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff,
+	0x86ff, 0x1528, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xb04d,
+	0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xb227, 0x080c, 0x66a7, 0x6210,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4,
+	0x1904, 0xb031, 0x080c, 0x9e32, 0x009e, 0x00be, 0x0005, 0x968c,
+	0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xb035,
+	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
+	0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc,
+	0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34,
+	0x2100, 0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206,
+	0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b,
+	0x0007, 0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e,
+	0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
+	0xc6c4, 0x0804, 0xaf88, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
+	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
+	0x2011, 0x0025, 0x080c, 0xb712, 0x003e, 0xd6cc, 0x0904, 0xaf9d,
+	0x7154, 0xa98a, 0x81ff, 0x0904, 0xaf9d, 0x9192, 0x0021, 0x1278,
+	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb712, 0x2011,
+	0x0205, 0x2013, 0x0000, 0x080c, 0xc1b7, 0x0804, 0xaf9d, 0xa868,
+	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950,
+	0x080c, 0xb6b1, 0x00ae, 0x080c, 0xc1b7, 0x080c, 0xb702, 0x0804,
+	0xaf9f, 0x080c, 0xbe10, 0x0804, 0xafac, 0xa87c, 0xd0ac, 0x0904,
+	0xafb8, 0xa880, 0xd0bc, 0x1904, 0xafb8, 0x7348, 0xa838, 0x9306,
+	0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xafb8, 0xd6d4, 0x0190,
+	0xab38, 0x9305, 0x0904, 0xafb8, 0x0068, 0xa87c, 0xd0ac, 0x0904,
+	0xaf90, 0xa838, 0xa934, 0x9105, 0x0904, 0xaf90, 0xa880, 0xd0bc,
+	0x1904, 0xaf90, 0x080c, 0xbe4a, 0x0804, 0xafac, 0x0096, 0x00f6,
+	0x6003, 0x0003, 0x6007, 0x0043, 0x2079, 0x026c, 0x7c04, 0x7b00,
+	0x7e0c, 0x7d08, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140, 0x6003,
+	0x0002, 0x00fe, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400,
+	0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500,
+	0x9203, 0x0e90, 0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe, 0x6043,
+	0x0000, 0x2c10, 0x080c, 0x1a5c, 0x080c, 0x8456, 0x080c, 0x8a4e,
+	0x009e, 0x0005, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xb0af, 0xb0af, 0xb0af, 0xb0af, 0xb0af,
+	0xb0b1, 0xb147, 0xb0af, 0xb0af, 0xb15e, 0xb1ea, 0xb0af, 0xb0af,
+	0xb0af, 0xb0af, 0xb1ff, 0xb0af, 0xb0af, 0xb0af, 0xb0af, 0x080c,
+	0x0db4, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114,
+	0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e,
+	0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0x00be, 0x86ff, 0x0904, 0xb142, 0x9694, 0xff00, 0x9284, 0x0c00,
+	0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904,
+	0xb142, 0x080c, 0x0feb, 0x090c, 0x0db4, 0x2900, 0xb07a, 0xb77c,
+	0xc7cd, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e,
+	0xb070, 0xa872, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92,
 	0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186,
 	0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b,
 	0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b,
 	0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4,
 	0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
 	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
-	0x080c, 0xb6f9, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff,
+	0x080c, 0xb712, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff,
 	0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011,
-	0x0029, 0x080c, 0xb6f9, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
+	0x0029, 0x080c, 0xb712, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
 	0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950,
-	0x080c, 0xb698, 0x080c, 0x18eb, 0x009e, 0x00ee, 0x00ae, 0x007e,
-	0x0005, 0x2001, 0x1959, 0x2004, 0x6042, 0x0096, 0x6114, 0x2148,
-	0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003,
-	0x0002, 0xa97c, 0xd1e4, 0x0904, 0xb415, 0x6043, 0x0000, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904,
-	0xb3e4, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xb3a5, 0x0016, 0xa87c,
-	0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff,
-	0x90b6, 0x0002, 0x0904, 0xb373, 0x9086, 0x0028, 0x1904, 0xb35f,
-	0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xb37b, 0x6024, 0xd0f4,
-	0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206,
-	0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148,
-	0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e,
-	0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000,
-	0xb83e, 0x00be, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4,
-	0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048,
-	0x080c, 0x0f9d, 0x009e, 0x080c, 0xbe31, 0x0804, 0xb415, 0xd1dc,
-	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xc0c1, 0x0118,
+	0x080c, 0xb6b1, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6,
+	0x00a6, 0x6003, 0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c,
+	0x7d08, 0x6014, 0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a, 0x00ae,
+	0x00fe, 0x2c10, 0x080c, 0x1a5c, 0x0804, 0x9379, 0x6003, 0x0002,
+	0x6004, 0x9086, 0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c,
+	0xd0ac, 0x0160, 0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078,
+	0x080c, 0x1648, 0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002,
+	0x009e, 0x080c, 0x886e, 0x080c, 0x8973, 0x0096, 0x2001, 0x1959,
+	0x2004, 0x6042, 0x080c, 0x8923, 0x080c, 0x8a4e, 0x6114, 0x2148,
+	0xa97c, 0xd1e4, 0x0904, 0xb1e5, 0xd1cc, 0x05a8, 0xa978, 0xa868,
+	0xd0fc, 0x0538, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0xa860,
+	0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x810e, 0x810e, 0x810f,
+	0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019, 0x2098,
+	0x0156, 0x20a9, 0x0020, 0x4003, 0x015e, 0x000e, 0xa882, 0x000e,
+	0xa87e, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0f9d, 0x001e,
+	0x0440, 0x0016, 0x080c, 0x0f9d, 0x009e, 0xa974, 0x0016, 0x080c,
+	0xb702, 0x001e, 0x00f0, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x0180, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
+	0x0060, 0xd1dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4, 0x0118,
+	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x66a7,
+	0x001e, 0xd1e4, 0x1120, 0x080c, 0x9e32, 0x009e, 0x0005, 0x080c,
+	0xbe10, 0x0cd8, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x886e,
+	0x080c, 0x8973, 0x2019, 0x0001, 0x080c, 0x96d8, 0x6003, 0x0002,
+	0x080c, 0xc22f, 0x080c, 0x8923, 0x080c, 0x8a4e, 0x0005, 0x6004,
+	0x9086, 0x0040, 0x1120, 0x080c, 0x886e, 0x080c, 0x8973, 0x2019,
+	0x0001, 0x080c, 0x96d8, 0x080c, 0x8923, 0x080c, 0x2fda, 0x080c,
+	0xc227, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17, 0x0150, 0xa867,
+	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x688c, 0x080c,
+	0xbd00, 0x009e, 0x080c, 0x9e32, 0x080c, 0x8a4e, 0x0005, 0xa87b,
+	0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a,
+	0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a4a, 0x2104, 0x8000,
+	0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb25a, 0xb25a,
+	0xb25a, 0xb25a, 0xb25a, 0xb25c, 0xb25a, 0xb25a, 0xb302, 0xb25a,
+	0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a,
+	0xb25a, 0xb433, 0x080c, 0x0db4, 0x0076, 0x00a6, 0x00e6, 0x0096,
+	0x2071, 0x0260, 0x6114, 0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff,
+	0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff,
+	0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xb2fb, 0x9694,
+	0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e,
+	0x9284, 0x0300, 0x0904, 0xb2fb, 0x9686, 0x0100, 0x1130, 0x7064,
+	0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0feb, 0x090c,
+	0x0db4, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867,
+	0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044,
+	0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348,
+	0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180,
+	0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118,
+	0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010,
+	0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e,
+	0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
+	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
+	0x0025, 0x080c, 0xb712, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a,
+	0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018,
+	0x2011, 0x0029, 0x080c, 0xb712, 0x2011, 0x0205, 0x2013, 0x0000,
+	0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68,
+	0x2950, 0x080c, 0xb6b1, 0x080c, 0x18eb, 0x009e, 0x00ee, 0x00ae,
+	0x007e, 0x0005, 0x2001, 0x1959, 0x2004, 0x6042, 0x0096, 0x6114,
+	0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e,
+	0x6003, 0x0002, 0xa97c, 0xd1e4, 0x0904, 0xb42e, 0x6043, 0x0000,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc,
+	0x0904, 0xb3fd, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xb3be, 0x0016,
+	0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184,
+	0x00ff, 0x90b6, 0x0002, 0x0904, 0xb38c, 0x9086, 0x0028, 0x1904,
+	0xb378, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xb394, 0x6024,
+	0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90,
+	0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4,
+	0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103,
+	0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c,
+	0x8000, 0xb83e, 0x00be, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c,
+	0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878,
+	0x2048, 0x080c, 0x0f9d, 0x009e, 0x080c, 0xbe4a, 0x0804, 0xb42e,
+	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xc0da,
+	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
+	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xb227, 0xa87c, 0xb07e, 0xa890, 0xb092,
+	0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0,
+	0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0,
+	0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e,
+	0xa882, 0x000e, 0xa87e, 0x080c, 0xc1b7, 0x001e, 0xa874, 0x0006,
+	0x2148, 0x080c, 0x0f9d, 0x001e, 0x0804, 0xb42a, 0x0016, 0x00a6,
+	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086,
+	0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc,
+	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xc0da, 0x0118,
 	0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007,
 	0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xb20e, 0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c,
-	0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9,
-	0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0, 0x9084,
-	0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e, 0xa882,
-	0x000e, 0xa87e, 0x080c, 0xc19e, 0x001e, 0xa874, 0x0006, 0x2148,
-	0x080c, 0x0f9d, 0x001e, 0x0804, 0xb411, 0x0016, 0x00a6, 0x2150,
-	0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028,
-	0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158,
-	0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xc0c1, 0x0118, 0xb174,
-	0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b,
-	0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xb20e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e,
-	0x00ae, 0x080c, 0x0f9d, 0x009e, 0x080c, 0xc19e, 0xa974, 0x0016,
-	0x080c, 0xb6e9, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184,
-	0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b,
-	0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xc0c1,
-	0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b,
-	0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834,
-	0xa938, 0x9115, 0x190c, 0xb20e, 0xa974, 0x0016, 0x080c, 0x66a0,
-	0x001e, 0xd1e4, 0x1120, 0x080c, 0x9e19, 0x009e, 0x0005, 0x080c,
-	0xbdf7, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4, 0x190c,
-	0x18f9, 0x009e, 0x0005, 0x080c, 0x8846, 0x0010, 0x080c, 0x88fb,
-	0x080c, 0xbafe, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c, 0xbd04,
-	0x1118, 0x080c, 0xa7a7, 0x00a0, 0xa867, 0x0103, 0x2009, 0x180c,
-	0x210c, 0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a, 0x918e,
-	0x0029, 0x1110, 0x080c, 0xd7b3, 0xa877, 0x0000, 0x080c, 0x6885,
-	0x009e, 0x080c, 0x9e19, 0x080c, 0x894b, 0x0804, 0x8a26, 0xa87b,
-	0x0004, 0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054, 0x1220,
-	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb471, 0xb471, 0xb471,
-	0xb471, 0xb471, 0xb473, 0xb471, 0xb471, 0xb471, 0xb471, 0xb471,
-	0xb471, 0xb471, 0xb471, 0xb471, 0xb471, 0xb471, 0xb471, 0xb471,
-	0xb471, 0x080c, 0x0db4, 0x080c, 0x5387, 0x01f8, 0x6014, 0x7144,
-	0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff,
-	0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086, 0x0139,
-	0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897, 0x4000,
-	0xa99a, 0xaa9e, 0x080c, 0x6885, 0x009e, 0x0804, 0x9e19, 0x9182,
-	0x0085, 0x0002, 0xb4a9, 0xb4a7, 0xb4a7, 0xb4b5, 0xb4a7, 0xb4a7,
-	0xb4a7, 0xb4a7, 0xb4a7, 0xb4a7, 0xb4a7, 0xb4a7, 0xb4a7, 0x080c,
-	0x0db4, 0x6003, 0x0001, 0x6106, 0x080c, 0x83c9, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x894b, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
-	0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xbaec,
-	0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10,
-	0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb724, 0x00ce, 0x0128,
-	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
-	0x0001, 0x080c, 0x83c9, 0x080c, 0x894b, 0x9280, 0x0004, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128,
-	0x00c6, 0x2260, 0x080c, 0xbe31, 0x00ce, 0x00ee, 0x00de, 0x005e,
-	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
-	0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085,
-	0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0db4,
-	0x080c, 0x8846, 0x0096, 0x6014, 0x2048, 0x080c, 0xbafe, 0x0140,
-	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6885,
-	0x009e, 0x080c, 0x9e49, 0x0804, 0x894b, 0xb52a, 0xb52c, 0xb52c,
-	0xb52a, 0xb52a, 0xb52a, 0xb52a, 0xb52a, 0xb52a, 0xb52a, 0xb52a,
-	0xb52a, 0xb52a, 0x080c, 0x0db4, 0x080c, 0x8846, 0x080c, 0x9e49,
-	0x080c, 0x894b, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
-	0x0085, 0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c, 0x8846,
-	0x080c, 0x2fd7, 0x080c, 0xc20e, 0x0096, 0x6014, 0x2048, 0x080c,
-	0xbafe, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
-	0x080c, 0x6885, 0x080c, 0xbce7, 0x009e, 0x080c, 0x9e19, 0x080c,
-	0x894b, 0x0005, 0x080c, 0x9eae, 0x0ce0, 0x9186, 0x0014, 0x1dd0,
-	0x080c, 0x8846, 0x0096, 0x6014, 0x2048, 0x080c, 0xbafe, 0x0d60,
-	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec,
-	0xa882, 0x08f0, 0x0002, 0xb582, 0xb580, 0xb580, 0xb580, 0xb580,
-	0xb580, 0xb59a, 0xb580, 0xb580, 0xb580, 0xb580, 0xb580, 0xb580,
-	0x080c, 0x0db4, 0x080c, 0x8846, 0x6034, 0x908c, 0xff00, 0x810f,
-	0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1957,
-	0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000c, 0x080c,
-	0x894b, 0x0005, 0x080c, 0x8846, 0x6034, 0x908c, 0xff00, 0x810f,
-	0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1957,
-	0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000e, 0x080c,
-	0x894b, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
-	0x0012, 0x0804, 0x9eae, 0xb5c8, 0xb5c8, 0xb5c8, 0xb5c8, 0xb5ca,
-	0xb617, 0xb5c8, 0xb5c8, 0xb5c8, 0xb5c8, 0xb5c8, 0xb5c8, 0xb5c8,
-	0x080c, 0x0db4, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb62b, 0x080c,
-	0xbafe, 0x1118, 0x080c, 0xbce7, 0x0068, 0x6014, 0x2048, 0xa87c,
-	0xd0e4, 0x1110, 0x080c, 0xbce7, 0xa867, 0x0103, 0x080c, 0xc1d9,
-	0x080c, 0x6885, 0x00d6, 0x2c68, 0x080c, 0x9dc3, 0x01d0, 0x6003,
-	0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c,
-	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c,
-	0xbf73, 0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x83c9, 0x080c,
-	0x894b, 0x2d60, 0x00de, 0x080c, 0x9e19, 0x009e, 0x0005, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, 0x0118,
-	0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xc171, 0x11f0,
-	0x080c, 0x9dc3, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001,
-	0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c,
-	0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954, 0x6156,
-	0x080c, 0xbf73, 0x080c, 0x83c9, 0x080c, 0x894b, 0x2d60, 0x00de,
-	0x0804, 0x9e19, 0x0096, 0x6014, 0x2048, 0x080c, 0xbafe, 0x01c8,
-	0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b,
-	0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
-	0x0005, 0x080c, 0xbdf3, 0xa877, 0x0000, 0x080c, 0x6885, 0x080c,
-	0xbce7, 0x009e, 0x0804, 0x9e19, 0x0016, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xbafe, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877,
-	0x0000, 0x080c, 0x6885, 0x009e, 0x001e, 0x9186, 0x0013, 0x0148,
-	0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9eae,
-	0x0030, 0x080c, 0x8846, 0x080c, 0x9e49, 0x080c, 0x894b, 0x0005,
-	0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101,
-	0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018,
-	0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xb6f9, 0x96b2, 0x0020,
-	0xb004, 0x904d, 0x0110, 0x080c, 0x0f9d, 0x080c, 0x0feb, 0x0520,
-	0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a,
-	0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2,
-	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28,
-	0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003,
-	0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000,
-	0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e,
-	0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807,
-	0x0000, 0x080c, 0x6885, 0x2a48, 0x0cb8, 0x080c, 0x6885, 0x00ae,
-	0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816,
-	0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8,
-	0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098,
-	0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00,
-	0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80,
-	0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000,
-	0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020,
-	0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb75f, 0xb75f,
-	0xb75a, 0xb781, 0xb74d, 0xb75a, 0xb781, 0xb75a, 0xb74d, 0xb74d,
-	0xb75a, 0xb75a, 0xb75a, 0xb74d, 0xb74d, 0x080c, 0x0db4, 0x0036,
-	0x2019, 0x0010, 0x080c, 0xd0c7, 0x6023, 0x0006, 0x6003, 0x0007,
-	0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096,
-	0x86ff, 0x11d8, 0x6014, 0x2048, 0x080c, 0xbafe, 0x01c0, 0xa864,
-	0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028,
-	0x900e, 0x2001, 0x0005, 0x080c, 0x6abf, 0x080c, 0xbdf3, 0x080c,
-	0x6878, 0x080c, 0x9e49, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006,
-	0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002, 0xb797,
-	0xb7c5, 0xb799, 0xb7e6, 0xb7c0, 0xb797, 0xb75a, 0xb75f, 0xb75f,
-	0xb75a, 0xb75a, 0xb75a, 0xb75a, 0xb75a, 0xb75a, 0xb75a, 0x080c,
-	0x0db4, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096,
-	0x6014, 0x2048, 0x080c, 0xbafe, 0x0158, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0f9d, 0x009e, 0x080c, 0xbdf3,
-	0x009e, 0x080c, 0xc1b3, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0002, 0x080c, 0x83c9, 0x080c, 0x894b, 0x9085, 0x0001, 0x0005,
-	0x0066, 0x080c, 0x190d, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19b8,
-	0x7024, 0x9c06, 0x1120, 0x080c, 0x9649, 0x00ee, 0x0850, 0x6020,
-	0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049,
-	0x0001, 0x2c40, 0x080c, 0x97a1, 0x009e, 0x008e, 0x0010, 0x080c,
-	0x9546, 0x00ee, 0x1904, 0xb799, 0x0804, 0xb75a, 0x0036, 0x00e6,
-	0x2071, 0x19b8, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c, 0x96bf,
-	0x00ee, 0x003e, 0x0804, 0xb799, 0x080c, 0x98d1, 0x00ee, 0x003e,
-	0x1904, 0xb799, 0x0804, 0xb75a, 0x00c6, 0x6020, 0x9084, 0x000f,
-	0x0013, 0x00ce, 0x0005, 0xb819, 0xb8e2, 0xba49, 0xb823, 0x9e49,
-	0xb819, 0xd0b9, 0xc21b, 0xb8e2, 0xb812, 0xbac8, 0xb812, 0xb812,
-	0xb812, 0xb812, 0x080c, 0x0db4, 0x080c, 0xbd04, 0x1110, 0x080c,
-	0xa7a7, 0x0005, 0x080c, 0x8846, 0x080c, 0x894b, 0x0804, 0x9e19,
-	0x601b, 0x0001, 0x0005, 0x080c, 0xbafe, 0x0130, 0x6014, 0x0096,
-	0x2048, 0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016, 0x1a0c,
-	0x0db4, 0x0002, 0xb842, 0xb844, 0xb868, 0xb87c, 0xb8a0, 0xb842,
-	0xb819, 0xb819, 0xb819, 0xb87c, 0xb87c, 0xb842, 0xb842, 0xb842,
-	0xb842, 0xb886, 0x080c, 0x0db4, 0x00e6, 0x6014, 0x0096, 0x2048,
-	0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b8, 0x7024, 0x9c06,
-	0x01a0, 0x080c, 0x9546, 0x080c, 0xc1b3, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x6023, 0x0002, 0x2001, 0x1958, 0x2004, 0x601a, 0x080c,
-	0x83c9, 0x080c, 0x894b, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8,
-	0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c,
-	0xc1b3, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
-	0x83c9, 0x080c, 0x894b, 0x0005, 0x0096, 0x601b, 0x0001, 0x6014,
-	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x5387,
-	0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103,
-	0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0x080c, 0x6885, 0x009e, 0x0804, 0x9e19,
-	0x6014, 0x0096, 0x904d, 0x05c8, 0xa97c, 0xd1e4, 0x05b0, 0x2001,
-	0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e,
-	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0030, 0x2c08,
-	0x080c, 0x1518, 0x2001, 0x030c, 0x2004, 0x9086, 0x0041, 0x11a0,
-	0x6014, 0x0096, 0x904d, 0x090c, 0x0db4, 0xa880, 0xd0f4, 0x1130,
-	0xc0f5, 0xa882, 0x009e, 0x601b, 0x0002, 0x0070, 0x009e, 0x2001,
-	0x0037, 0x2c08, 0x080c, 0x1518, 0x6000, 0x9086, 0x0004, 0x1120,
-	0x2009, 0x0048, 0x080c, 0x9e93, 0x0005, 0x009e, 0x080c, 0x190d,
-	0x0804, 0xb868, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x000b,
-	0x0005, 0xb8f9, 0xb820, 0xb8fb, 0xb8f9, 0xb8fb, 0xb8fb, 0xb81a,
-	0xb8f9, 0xb814, 0xb814, 0xb8f9, 0xb8f9, 0xb8f9, 0xb8f9, 0xb8f9,
-	0xb8f9, 0x080c, 0x0db4, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084,
-	0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0db4, 0x00b6, 0x0013,
-	0x00be, 0x0005, 0xb916, 0xb9e3, 0xb918, 0xb958, 0xb918, 0xb958,
-	0xb918, 0xb926, 0xb916, 0xb958, 0xb916, 0xb947, 0x080c, 0x0db4,
-	0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e,
-	0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xb9df, 0x6004, 0x080c,
-	0xbd04, 0x0904, 0xb9fc, 0x908e, 0x0004, 0x1110, 0x080c, 0x2ffc,
-	0x908e, 0x0021, 0x0904, 0xba00, 0x908e, 0x0022, 0x0904, 0xba44,
-	0x908e, 0x003d, 0x0904, 0xba00, 0x908e, 0x0039, 0x0904, 0xba04,
-	0x908e, 0x0035, 0x0904, 0xba04, 0x908e, 0x001e, 0x0178, 0x908e,
-	0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x0110, 0x080c, 0x2fd7, 0x080c, 0xa7a7, 0x0804, 0x9e49,
-	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xb9d0, 0x9186,
-	0x0002, 0x1904, 0xb9a5, 0x2001, 0x1836, 0x2004, 0xd08c, 0x11c8,
-	0x080c, 0x6fa7, 0x11b0, 0x080c, 0xc1f9, 0x0138, 0x080c, 0x6fca,
-	0x1120, 0x080c, 0x6eb7, 0x0804, 0xba2d, 0x2001, 0x194e, 0x2003,
-	0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x6ed9, 0x0804,
-	0xba2d, 0x6010, 0x2058, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x1904,
-	0xba2d, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xba2d, 0xb840, 0x9084,
-	0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023,
-	0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0x9dc3, 0x0128,
-	0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004,
-	0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e,
-	0x1170, 0x2009, 0x1836, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071,
-	0x1800, 0x080c, 0x5c5d, 0x00ee, 0x080c, 0xa7a7, 0x0030, 0x080c,
-	0xa7a7, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x2ffc, 0x012e, 0x00ee, 0x080c, 0x9e49, 0x0005,
-	0x2001, 0x0002, 0x080c, 0x6188, 0x6003, 0x0001, 0x6007, 0x0002,
-	0x080c, 0x8411, 0x080c, 0x894b, 0x00de, 0x00ce, 0x0c80, 0x080c,
-	0x2ffc, 0x0804, 0xb954, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016,
-	0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904,
-	0xb9a5, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x8411, 0x080c,
-	0x894b, 0x00de, 0x00ce, 0x0898, 0x080c, 0xa7a7, 0x0804, 0xb956,
-	0x080c, 0xa7e3, 0x0804, 0xb956, 0x00d6, 0x2c68, 0x6104, 0x080c,
-	0xc171, 0x00de, 0x0118, 0x080c, 0x9e19, 0x00f0, 0x6004, 0x8007,
-	0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1958, 0x2004,
-	0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160,
-	0x080c, 0x83c9, 0x080c, 0x894b, 0x0005, 0x00de, 0x00ce, 0x080c,
-	0xa7a7, 0x080c, 0x2fd7, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x2ffc, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x6043,
-	0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xa248, 0x1904, 0xb9fc,
-	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0096, 0x00d6,
-	0x001b, 0x00de, 0x009e, 0x0005, 0xba64, 0xba64, 0xba64, 0xba64,
-	0xba64, 0xba64, 0xba64, 0xba64, 0xba64, 0xb819, 0xba64, 0xb820,
-	0xba66, 0xb820, 0xba73, 0xba64, 0x080c, 0x0db4, 0x6004, 0x9086,
-	0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x080c, 0x83c9,
-	0x080c, 0x894b, 0x0005, 0x080c, 0xc1ed, 0x0118, 0x080c, 0xc200,
-	0x0010, 0x080c, 0xc20e, 0x080c, 0xbce7, 0x080c, 0xbafe, 0x0570,
-	0x080c, 0x2fd7, 0x080c, 0xbafe, 0x0168, 0x6014, 0x2048, 0xa867,
-	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882,
-	0x080c, 0x6885, 0x2c68, 0x080c, 0x9dc3, 0x0150, 0x6810, 0x6012,
-	0x080c, 0xbf73, 0x00c6, 0x2d60, 0x080c, 0x9e49, 0x00ce, 0x0008,
-	0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x8411, 0x080c, 0x894b, 0x00c8, 0x080c, 0xc1ed,
-	0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x2fd7, 0x08d0,
-	0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186,
-	0x0035, 0x1118, 0x080c, 0x2fd7, 0x0868, 0x080c, 0x9e49, 0x0005,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002, 0xbade, 0xbade,
-	0xbae0, 0xbae0, 0xbae0, 0xbade, 0xbade, 0x9e49, 0xbade, 0xbade,
-	0xbade, 0xbade, 0xbade, 0xbade, 0xbade, 0xbade, 0x080c, 0x0db4,
-	0x080c, 0x98d1, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c,
-	0x6885, 0x009e, 0x0804, 0x9e19, 0x9284, 0x0007, 0x1158, 0x9282,
-	0x1cd0, 0x0240, 0x2001, 0x1819, 0x2004, 0x9202, 0x1218, 0x9085,
-	0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006,
-	0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000,
-	0x0110, 0x080c, 0x1096, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6,
-	0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071,
-	0x1800, 0x7350, 0x7070, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8,
-	0x080c, 0xc1f9, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086,
-	0x0004, 0x1148, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x00c6, 0x080c,
-	0x9e49, 0x00ce, 0x0060, 0x080c, 0xbeed, 0x0148, 0x080c, 0xbd04,
-	0x1110, 0x080c, 0xa7a7, 0x00c6, 0x080c, 0x9e19, 0x00ce, 0x9ce0,
-	0x0018, 0x7064, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e,
-	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000,
-	0x210c, 0x81ff, 0x0128, 0x2061, 0x1a80, 0x6112, 0x080c, 0x2fd7,
-	0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9dc3, 0x01b0, 0x6656,
-	0x2b00, 0x6012, 0x080c, 0x5387, 0x0118, 0x080c, 0xbc2b, 0x0168,
-	0x080c, 0xbf73, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c, 0x9e93,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9e66, 0x0560, 0x6057,
-	0x0000, 0x2b00, 0x6012, 0x080c, 0xbf73, 0x6023, 0x0003, 0x0016,
-	0x080c, 0x8549, 0x0076, 0x903e, 0x080c, 0x8441, 0x2c08, 0x080c,
-	0xd27b, 0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0x9e19, 0x9085,
-	0x0001, 0x0070, 0x080c, 0x5387, 0x0128, 0xd18c, 0x1170, 0x080c,
-	0xbc2b, 0x0148, 0x2009, 0x004c, 0x080c, 0x9e93, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90,
-	0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046,
-	0x0016, 0x080c, 0x9dc3, 0x2c78, 0x0590, 0x7e56, 0x2b00, 0x7812,
-	0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xbc3d, 0x9186, 0x004d,
-	0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x1951, 0x200c, 0xd1fc,
-	0x0168, 0x2f60, 0x080c, 0x9e19, 0x00d0, 0x2001, 0x1950, 0x200c,
-	0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9e19, 0x0088, 0x2f60, 0x080c,
-	0x5387, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900,
-	0x7816, 0x001e, 0x0016, 0x080c, 0x9e93, 0x9085, 0x0001, 0x001e,
-	0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c,
-	0x9dc3, 0x2c78, 0x0508, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003,
-	0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x194f, 0x200c,
-	0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9e19, 0x0060, 0x2f60, 0x080c,
-	0x5387, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052,
-	0x080c, 0x9e93, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005,
-	0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x4872, 0x00ce, 0x1120,
-	0x080c, 0x9e19, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000,
-	0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x636b, 0x0158, 0x2001, 0xbc42, 0x0006,
-	0x900e, 0x2400, 0x080c, 0x6abf, 0x080c, 0x6885, 0x000e, 0x0807,
-	0x2418, 0x080c, 0x87e0, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039,
-	0x0001, 0x2608, 0x080c, 0x8561, 0x008e, 0x080c, 0x8441, 0x2f08,
-	0x2648, 0x080c, 0xd27b, 0xb93c, 0x81ff, 0x090c, 0x8632, 0x080c,
-	0x894b, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x9dc3, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c,
-	0xbf73, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c,
-	0x9e93, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e66, 0x01b8, 0x660a,
-	0x2b08, 0x6112, 0x080c, 0xbf73, 0x6023, 0x0008, 0x2900, 0x6016,
-	0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x2009, 0x0021, 0x080c,
-	0x9e93, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c,
-	0x9dc3, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbf73, 0x6023,
-	0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0x9e93, 0x9085,
-	0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9e66, 0x0188, 0x2b08, 0x6112,
-	0x080c, 0xbf73, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000,
-	0x080c, 0x9e93, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026,
-	0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
-	0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002,
-	0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085,
-	0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020, 0x9086,
-	0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xbafe, 0x0168, 0xa864,
-	0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868,
-	0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e66, 0x0198,
-	0x2b08, 0x6112, 0x080c, 0xbf73, 0x6023, 0x0001, 0x2900, 0x6016,
-	0x080c, 0x2fd7, 0x2009, 0x0028, 0x080c, 0x9e93, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8,
-	0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c,
-	0xaa30, 0x00be, 0x080c, 0xac6f, 0x6003, 0x0001, 0x6007, 0x0029,
-	0x080c, 0x8411, 0x080c, 0x894b, 0x0078, 0x6014, 0x0096, 0x2048,
-	0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xc132,
-	0x080c, 0xa7a7, 0x080c, 0x9e19, 0x0005, 0x0096, 0x6014, 0x904d,
-	0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
-	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6885, 0x012e, 0x009e, 0x080c, 0x9e19, 0x0c30, 0x0096, 0x9186,
-	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x6188, 0x00e8, 0x9186,
-	0x0015, 0x1510, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x11e0,
-	0x6010, 0x00b6, 0x2058, 0x080c, 0x62d2, 0x00be, 0x080c, 0xad40,
-	0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160,
-	0x2001, 0x0006, 0x080c, 0x6188, 0x6014, 0x2048, 0xa868, 0xd0fc,
-	0x0170, 0x080c, 0xa21c, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc,
-	0x0528, 0x080c, 0xa7a7, 0x080c, 0x9e19, 0x009e, 0x0005, 0x6014,
-	0x6310, 0x2358, 0x904d, 0x090c, 0x0db4, 0xa87b, 0x0000, 0xa883,
-	0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x6457, 0x1108, 0xc185,
-	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6885, 0x012e, 0x080c, 0x9e19, 0x08f8, 0x6014, 0x904d,
-	0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
-	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6885, 0x012e, 0x080c, 0x9e19, 0x0840, 0xa878, 0x9086, 0x0005,
-	0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043,
-	0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c,
-	0x83c9, 0x080c, 0x894b, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013,
-	0x00ce, 0x0005, 0xb819, 0xbe23, 0xbe23, 0xbe26, 0xd559, 0xd574,
-	0xd577, 0xb819, 0xb819, 0xb819, 0xb819, 0xb819, 0xb819, 0xb819,
-	0xb819, 0x080c, 0x0db4, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014,
-	0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e,
-	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550,
-	0x2001, 0x1833, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c,
-	0x9dc3, 0x0508, 0x7810, 0x6012, 0x080c, 0xbf73, 0x7820, 0x9086,
-	0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808,
-	0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035,
-	0x6003, 0x0001, 0x7954, 0x6156, 0x080c, 0x83c9, 0x080c, 0x894b,
-	0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1959, 0x2004,
-	0x6042, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0xa87c, 0xd0e4,
-	0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f,
-	0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c,
-	0x0f9d, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803, 0x0002,
-	0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0, 0x681c,
-	0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00,
-	0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c,
-	0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a,
-	0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x6954,
-	0x6156, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x080c,
-	0x83c9, 0x080c, 0x894b, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4,
-	0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230,
-	0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e,
-	0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836,
-	0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4,
-	0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840,
-	0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, 0x6004,
-	0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, 0x0036,
-	0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e,
-	0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110,
-	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x00e6, 0x2001, 0x1953, 0x200c, 0x8000, 0x2014, 0x2001,
-	0x0032, 0x080c, 0x8248, 0x2001, 0x1957, 0x82ff, 0x1110, 0x2011,
-	0x0014, 0x2202, 0x2001, 0x1955, 0x200c, 0x8000, 0x2014, 0x2071,
-	0x193d, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8248, 0x2001,
-	0x1958, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1959,
-	0x9288, 0x000a, 0x2102, 0x2001, 0x1a61, 0x2102, 0x2001, 0x0032,
-	0x080c, 0x1518, 0x080c, 0x653c, 0x00ee, 0x003e, 0x002e, 0x001e,
-	0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1957, 0x2003,
-	0x0028, 0x2001, 0x1958, 0x2003, 0x0014, 0x2071, 0x193d, 0x701b,
-	0x0000, 0x701f, 0x07d0, 0x2001, 0x1959, 0x2009, 0x001e, 0x2102,
-	0x2001, 0x1a61, 0x2102, 0x2001, 0x0032, 0x080c, 0x1518, 0x00ee,
-	0x001e, 0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110, 0x080c,
-	0x101d, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9dc3, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0x9e93, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x708c, 0x9086, 0x0018,
-	0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c,
-	0x8b3b, 0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54,
-	0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e,
-	0x080c, 0x301c, 0x080c, 0xa21c, 0x0020, 0x080c, 0xa7a7, 0x080c,
-	0x9e19, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54, 0x9206,
-	0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9dc3,
-	0x0188, 0x2b08, 0x6112, 0x080c, 0xbf73, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x2009, 0x004d, 0x080c, 0x9e93, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x0016, 0x080c, 0x9dc3, 0x0180, 0x2b08, 0x6112, 0x080c, 0xbf73,
-	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9e93, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016,
-	0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x718c, 0x6014, 0x2048,
-	0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x1971,
-	0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006,
-	0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x080c, 0xc7b4, 0x001e,
-	0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867,
-	0x0103, 0x0010, 0x080c, 0xa7a7, 0x080c, 0x9e19, 0x00fe, 0x00ee,
-	0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
-	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8,
-	0x708c, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c,
-	0x8b3b, 0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78,
-	0x9206, 0x1110, 0x080c, 0x2fd7, 0x080c, 0xa21c, 0x0020, 0x080c,
-	0xa7a7, 0x080c, 0x9e19, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c,
-	0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071,
-	0x1800, 0x9186, 0x0015, 0x1550, 0x708c, 0x9086, 0x0004, 0x1530,
-	0x6014, 0x2048, 0x2c78, 0x080c, 0x8b3b, 0x05f0, 0x7078, 0xaacc,
-	0x9206, 0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c, 0x2fd7,
-	0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5337,
-	0x001e, 0x0010, 0x080c, 0x5128, 0x080c, 0xbafe, 0x0508, 0xa87b,
-	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xbafe,
-	0x01b8, 0x6014, 0x2048, 0x080c, 0x5128, 0x1d70, 0xa87b, 0x0030,
-	0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091,
-	0x8000, 0xa867, 0x0139, 0x080c, 0x6885, 0x012e, 0x080c, 0x9e19,
-	0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaad0, 0x9206, 0x0930,
-	0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34,
-	0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c, 0x9206,
-	0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e, 0x0005,
-	0x00b6, 0x00d6, 0x0036, 0x080c, 0xbafe, 0x0904, 0xc12e, 0x0096,
-	0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310,
-	0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c,
-	0x6457, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96,
-	0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
-	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c,
-	0x0f68, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8,
-	0x9080, 0x000a, 0x2098, 0x080c, 0x0f68, 0x00ce, 0x0090, 0xaa96,
-	0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110,
-	0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff,
-	0xa89e, 0x080c, 0x6878, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de,
-	0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6,
-	0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096, 0x0000,
-	0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2663, 0x2118,
-	0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c,
-	0x2011, 0x8018, 0x080c, 0x48d2, 0x00a8, 0x9096, 0x0001, 0x1148,
-	0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa,
-	0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6,
-	0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e, 0x002e,
-	0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110, 0x6a38,
-	0x0008, 0x6a2c, 0x080c, 0xbaec, 0x01f0, 0x2260, 0x6120, 0x9186,
-	0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206, 0x0140,
-	0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140, 0x0020,
-	0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106, 0x001e,
-	0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc,
-	0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c,
-	0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xb20e, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036,
-	0x901e, 0x0499, 0x01e0, 0x080c, 0xbafe, 0x01c8, 0x080c, 0xbce7,
-	0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c,
-	0x080c, 0xbd04, 0x1118, 0x080c, 0xa7a7, 0x0040, 0xa867, 0x0103,
-	0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6885, 0x009e, 0x003e,
-	0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882,
-	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
-	0x080c, 0xbdf3, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004,
-	0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e,
-	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005,
-	0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
-	0x0007, 0x080c, 0x4a6f, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81,
-	0x0005, 0x2001, 0x1957, 0x2004, 0x601a, 0x0005, 0x2001, 0x1959,
-	0x2004, 0x6042, 0x0005, 0x080c, 0x9e19, 0x0804, 0x894b, 0x00b6,
-	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x001b, 0x006e,
-	0x00be, 0x0005, 0xc23a, 0xc911, 0xca6c, 0xc23a, 0xc23a, 0xc23a,
-	0xc23a, 0xc23a, 0xc271, 0xcaea, 0xc23a, 0xc23a, 0xc23a, 0xc23a,
-	0xc23a, 0xc23a, 0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016,
-	0x1a0c, 0x0db4, 0x0013, 0x006e, 0x0005, 0xc255, 0xd052, 0xc255,
-	0xc255, 0xc255, 0xc255, 0xc255, 0xc255, 0xcfff, 0xd0a6, 0xc255,
-	0xd694, 0xd6ca, 0xd694, 0xd6ca, 0xc255, 0x080c, 0x0db4, 0x6000,
-	0x9082, 0x0016, 0x1a0c, 0x0db4, 0x6000, 0x000a, 0x0005, 0xc26f,
-	0xccc7, 0xcdb7, 0xcdd9, 0xce98, 0xc26f, 0xcf76, 0xcf20, 0xcaf6,
-	0xcfd5, 0xcfea, 0xc26f, 0xc26f, 0xc26f, 0xc26f, 0xc26f, 0x080c,
-	0x0db4, 0x91b2, 0x0053, 0x1a0c, 0x0db4, 0x2100, 0x91b2, 0x0040,
-	0x1a04, 0xc6b2, 0x0002, 0xc2bb, 0xc4a3, 0xc2bb, 0xc2bb, 0xc2bb,
-	0xc4ac, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb,
-	0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb,
-	0xc2bb, 0xc2bb, 0xc2bd, 0xc320, 0xc32f, 0xc393, 0xc3be, 0xc436,
-	0xc48e, 0xc2bb, 0xc2bb, 0xc4af, 0xc2bb, 0xc2bb, 0xc4c4, 0xc4d1,
-	0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb, 0xc554, 0xc2bb, 0xc2bb,
-	0xc568, 0xc2bb, 0xc2bb, 0xc523, 0xc2bb, 0xc2bb, 0xc2bb, 0xc580,
-	0xc2bb, 0xc2bb, 0xc2bb, 0xc5fd, 0xc2bb, 0xc2bb, 0xc2bb, 0xc2bb,
-	0xc2bb, 0xc2bb, 0xc67a, 0x080c, 0x0db4, 0x080c, 0x6519, 0x1150,
-	0x2001, 0x1836, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086,
-	0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017, 0x0000,
-	0x0804, 0xc49c, 0x080c, 0x6502, 0x00e6, 0x00c6, 0x0036, 0x0026,
-	0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c,
-	0x8549, 0x0076, 0x903e, 0x080c, 0x8441, 0x2c08, 0x080c, 0xd27b,
-	0x007e, 0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610,
-	0x2658, 0x080c, 0x6246, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
-	0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
-	0x2c08, 0x080c, 0xd842, 0x002e, 0x001e, 0x1178, 0x080c, 0xd1ae,
-	0x1904, 0xc38b, 0x080c, 0xd14a, 0x1120, 0x6007, 0x0008, 0x0804,
-	0xc49c, 0x6007, 0x0009, 0x0804, 0xc49c, 0x080c, 0xd3a5, 0x0128,
-	0x080c, 0xd1ae, 0x0d78, 0x0804, 0xc38b, 0x6017, 0x1900, 0x0c88,
-	0x080c, 0x30f6, 0x1904, 0xc6af, 0x6106, 0x080c, 0xd101, 0x6007,
-	0x0006, 0x0804, 0xc49c, 0x6007, 0x0007, 0x0804, 0xc49c, 0x080c,
-	0xd706, 0x1904, 0xc6af, 0x080c, 0x30f6, 0x1904, 0xc6af, 0x00d6,
-	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220,
-	0x2001, 0x0001, 0x080c, 0x6174, 0x96b4, 0xff00, 0x8637, 0x9686,
-	0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff,
-	0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686, 0x0005,
-	0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9084,
-	0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030, 0x9084,
-	0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007, 0x00b0,
-	0x00ee, 0x080c, 0xd211, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026,
-	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x301c, 0x002e, 0x080c,
-	0x62d2, 0x6007, 0x000a, 0x00de, 0x0804, 0xc49c, 0x6007, 0x000b,
-	0x00de, 0x0804, 0xc49c, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x6007,
-	0x0001, 0x0804, 0xc49c, 0x080c, 0xd706, 0x1904, 0xc6af, 0x080c,
-	0x30f6, 0x1904, 0xc6af, 0x2071, 0x0260, 0x7034, 0x90b4, 0x0003,
-	0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003, 0x1910,
-	0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026, 0x6210,
-	0x2258, 0xbaa0, 0x900e, 0x080c, 0x301c, 0x002e, 0x6007, 0x000c,
-	0x2001, 0x0001, 0x080c, 0xd822, 0x0804, 0xc49c, 0x080c, 0x6519,
-	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
-	0x1110, 0x0804, 0xc2ca, 0x080c, 0x6502, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026, 0x2001,
-	0x0006, 0x080c, 0x61b4, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc38b, 0x080c,
-	0xd21e, 0x1120, 0x6007, 0x000e, 0x0804, 0xc49c, 0x0046, 0x6410,
-	0x2458, 0xbca0, 0x0046, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x004e,
-	0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009, 0x0029,
-	0x080c, 0xd50a, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
-	0x004e, 0x6007, 0x0001, 0x0804, 0xc49c, 0x2001, 0x0001, 0x080c,
-	0x6174, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0270, 0x080c, 0xade0, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
-	0x0a04, 0xc38b, 0x9682, 0x0007, 0x0a04, 0xc3e7, 0x0804, 0xc38b,
-	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc49c, 0x080c, 0x6519,
-	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
-	0x1110, 0x0804, 0xc2ca, 0x080c, 0x6502, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x0688, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc38b, 0x080c,
-	0xd24c, 0x1130, 0x080c, 0xd14a, 0x1118, 0x6007, 0x0010, 0x04e0,
-	0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fd7, 0x080c,
-	0xc20e, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048,
-	0x2009, 0x0029, 0x080c, 0xd50a, 0x6010, 0x2058, 0xb800, 0xc0e5,
-	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xd3a5,
-	0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980, 0x0804,
-	0xc38b, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x30f6,
-	0x1904, 0xc6af, 0x080c, 0xd706, 0x1904, 0xc6af, 0x080c, 0xc84f,
-	0x1904, 0xc38b, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x8411,
-	0x080c, 0x894b, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x8411, 0x080c, 0x894b, 0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c,
-	0xd706, 0x1904, 0xc6af, 0x080c, 0x30f6, 0x1904, 0xc6af, 0x080c,
-	0xc84f, 0x1904, 0xc38b, 0x6007, 0x0020, 0x6003, 0x0001, 0x080c,
-	0x8411, 0x080c, 0x894b, 0x0005, 0x080c, 0x30f6, 0x1904, 0xc6af,
-	0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8411, 0x080c, 0x894b,
-	0x0005, 0x080c, 0xd706, 0x1904, 0xc6af, 0x080c, 0x30f6, 0x1904,
-	0xc6af, 0x080c, 0xc84f, 0x1904, 0xc38b, 0x0016, 0x0026, 0x00e6,
-	0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08, 0x080c,
-	0xbaec, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188, 0x6010,
-	0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08,
-	0x9006, 0x080c, 0xd4dc, 0x1180, 0x7244, 0x9286, 0xffff, 0x01b0,
-	0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296, 0xffff,
-	0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007, 0x1d80,
-	0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x9e19, 0x2160, 0x6007,
-	0x0025, 0x6003, 0x0001, 0x080c, 0x8411, 0x080c, 0x894b, 0x00ee,
-	0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x6174, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011,
-	0x0276, 0x080c, 0xade0, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120,
-	0x6007, 0x0031, 0x0804, 0xc49c, 0x080c, 0xaa48, 0x080c, 0x6fa7,
-	0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6fc1, 0x1138, 0x080c,
-	0x728b, 0x080c, 0x5cca, 0x080c, 0x6ed9, 0x0010, 0x080c, 0x6f7f,
-	0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x30f6, 0x1904, 0xc6af,
-	0x080c, 0xc84f, 0x1904, 0xc38b, 0x6106, 0x080c, 0xc86b, 0x1120,
-	0x6007, 0x002b, 0x0804, 0xc49c, 0x6007, 0x002c, 0x0804, 0xc49c,
-	0x080c, 0xd706, 0x1904, 0xc6af, 0x080c, 0x30f6, 0x1904, 0xc6af,
-	0x080c, 0xc84f, 0x1904, 0xc38b, 0x6106, 0x080c, 0xc870, 0x1120,
-	0x6007, 0x002e, 0x0804, 0xc49c, 0x6007, 0x002f, 0x0804, 0xc49c,
-	0x080c, 0x30f6, 0x1904, 0xc6af, 0x00e6, 0x00d6, 0x00c6, 0x6010,
-	0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184,
-	0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee,
-	0x0804, 0xc4a3, 0x080c, 0x5383, 0xd0e4, 0x0904, 0xc5fa, 0x2071,
-	0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x080c,
-	0x6557, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118, 0xb814,
-	0x9206, 0x0510, 0x080c, 0x6553, 0x15b8, 0x2069, 0x1800, 0x687c,
-	0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c, 0xbaec,
-	0x0590, 0x080c, 0xc73a, 0x0578, 0x080c, 0xd586, 0x0560, 0x622e,
-	0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x83c9, 0x080c, 0x894b,
-	0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150,
-	0x080c, 0xbaec, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106,
-	0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd4dc,
-	0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f, 0x0009,
-	0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003, 0x6017,
-	0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x30f6, 0x1904,
-	0xc6af, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007, 0x9086,
-	0x0006, 0x1904, 0xc4a3, 0x00e6, 0x00d6, 0x00c6, 0x080c, 0x5383,
-	0xd0e4, 0x0904, 0xc672, 0x2069, 0x1800, 0x2071, 0x026c, 0x7008,
-	0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6,
-	0x2c08, 0x9085, 0x0001, 0x080c, 0xd4dc, 0x2c10, 0x00ce, 0x05e8,
-	0x080c, 0xbaec, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004, 0x9106,
-	0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb724, 0x002e, 0x00ce,
-	0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178, 0x9186,
-	0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005, 0x2004,
-	0x9005, 0x0170, 0x080c, 0xc73a, 0x0904, 0xc5f3, 0x0056, 0x7510,
-	0x7614, 0x080c, 0xd59f, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005,
-	0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001,
-	0x080c, 0x83c9, 0x080c, 0x894b, 0x0c78, 0x6007, 0x003b, 0x602f,
-	0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c, 0x83c9, 0x080c,
-	0x894b, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017, 0x0000,
-	0x0804, 0xc5ca, 0x00e6, 0x0026, 0x080c, 0x6519, 0x0550, 0x080c,
-	0x6502, 0x080c, 0xd778, 0x1518, 0x2071, 0x1800, 0x70d8, 0x9085,
-	0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284, 0x00ff,
-	0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e, 0x78ea,
-	0x00fe, 0x70e3, 0x0000, 0x080c, 0x6557, 0x0120, 0x2011, 0x19d1,
-	0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2dbb, 0x0010, 0x080c,
-	0xd7aa, 0x002e, 0x00ee, 0x080c, 0x9e19, 0x0804, 0xc4a2, 0x080c,
-	0x9e19, 0x0005, 0x2600, 0x0002, 0xc6c6, 0xc6c6, 0xc6c6, 0xc6c6,
-	0xc6c6, 0xc6c8, 0xc6c6, 0xc6c6, 0xc6c6, 0xc6c6, 0xc6e5, 0xc6c6,
-	0xc6c6, 0xc6c6, 0xc6f7, 0xc704, 0xc735, 0xc6c6, 0x080c, 0x0db4,
-	0x080c, 0xd706, 0x1d20, 0x080c, 0x30f6, 0x1d08, 0x080c, 0xc84f,
-	0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001, 0x080c,
-	0x8411, 0x0005, 0x080c, 0x2fd7, 0x080c, 0xc20e, 0x6007, 0x0001,
-	0x6003, 0x0001, 0x080c, 0x8411, 0x0005, 0x080c, 0xd706, 0x1938,
-	0x080c, 0x30f6, 0x1920, 0x080c, 0xc84f, 0x1d60, 0x703c, 0x6016,
-	0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8411, 0x0005, 0x080c,
-	0xc757, 0x0904, 0xc6af, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c,
-	0x8411, 0x080c, 0x894b, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000,
-	0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160,
-	0x7140, 0x2001, 0x198e, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001,
-	0x198f, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011,
-	0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a,
-	0x080c, 0xadf4, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x8411, 0x080c, 0x894b, 0x0005, 0x6007, 0x0050, 0x703c,
-	0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6,
-	0x2260, 0x6010, 0x2058, 0xb8bc, 0xd084, 0x0150, 0x7128, 0x6048,
-	0x9106, 0x1120, 0x712c, 0x6044, 0x9106, 0x0110, 0x9006, 0x0010,
-	0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005, 0x0016,
-	0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000,
-	0x2001, 0x1971, 0x2003, 0x0000, 0x080c, 0x1004, 0x05a0, 0x2900,
-	0x6016, 0x708c, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833,
-	0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b,
-	0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940,
-	0x080c, 0x1004, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180,
-	0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b,
-	0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000,
-	0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x708f, 0x0000, 0x6014,
-	0x2048, 0x080c, 0x0f9d, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee,
-	0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
-	0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x2241, 0x2099, 0x026c,
-	0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8,
-	0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2241, 0x2099, 0x0260,
-	0x0ca8, 0x080c, 0x2241, 0x2061, 0x1971, 0x6004, 0x2098, 0x6008,
-	0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003,
-	0x22a8, 0x8108, 0x080c, 0x2241, 0x2099, 0x0260, 0x0ca8, 0x2061,
-	0x1971, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020,
-	0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296,
-	0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c,
-	0x2259, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218,
-	0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8,
-	0x8108, 0x080c, 0x2259, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x2259,
-	0x2061, 0x1974, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218,
-	0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8,
-	0x8108, 0x080c, 0x2259, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x1974,
-	0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001,
-	0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff,
-	0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6,
-	0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686,
-	0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff,
-	0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001,
-	0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xc8e7, 0x00de, 0x0005,
-	0x00d6, 0x080c, 0xc8f4, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820,
-	0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130,
-	0x9006, 0x080c, 0xd822, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180,
-	0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x2663, 0x1148, 0x2001,
-	0x0001, 0x080c, 0xd822, 0x2110, 0x900e, 0x080c, 0x301c, 0x0018,
-	0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6,
-	0x080c, 0x9e66, 0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x1578, 0x080c, 0x61d7,
-	0x1560, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012,
-	0x080c, 0xd706, 0x11d8, 0x080c, 0x30f6, 0x11c0, 0x080c, 0xc84f,
-	0x0510, 0x2001, 0x0007, 0x080c, 0x6188, 0x2001, 0x0007, 0x080c,
-	0x61b4, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x8411, 0x080c, 0x894b, 0x0010, 0x080c, 0x9e19,
-	0x9085, 0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0x9e19, 0x00ce,
-	0x002e, 0x001e, 0x0ca8, 0x080c, 0x9e19, 0x9006, 0x0c98, 0x2069,
-	0x026d, 0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085,
-	0x0001, 0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c,
-	0x6808, 0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186,
-	0x0018, 0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084,
-	0x00ff, 0x910d, 0x615a, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010,
-	0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6, 0x0013,
-	0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04, 0xca3c, 0x0092, 0x91b6,
-	0x0027, 0x0120, 0x91b6, 0x0014, 0x190c, 0x0db4, 0x2001, 0x0007,
-	0x080c, 0x61b4, 0x080c, 0x8846, 0x080c, 0x9e49, 0x080c, 0x894b,
-	0x0005, 0xc971, 0xc973, 0xc971, 0xc971, 0xc971, 0xc973, 0xc982,
-	0xca35, 0xc9d4, 0xca35, 0xc9e6, 0xca35, 0xc982, 0xca35, 0xca2d,
-	0xca35, 0xca2d, 0xca35, 0xca35, 0xc971, 0xc971, 0xc971, 0xc971,
-	0xc971, 0xc971, 0xc971, 0xc971, 0xc971, 0xc971, 0xc971, 0xc973,
-	0xc971, 0xca35, 0xc971, 0xc971, 0xca35, 0xc971, 0xca32, 0xca35,
-	0xc971, 0xc971, 0xc971, 0xc971, 0xca35, 0xca35, 0xc971, 0xca35,
-	0xca35, 0xc971, 0xc97d, 0xc971, 0xc971, 0xc971, 0xc971, 0xca31,
-	0xca35, 0xc971, 0xc971, 0xca35, 0xca35, 0xc971, 0xc971, 0xc971,
-	0xc971, 0x080c, 0x0db4, 0x080c, 0x8846, 0x080c, 0xc211, 0x6003,
-	0x0002, 0x080c, 0x894b, 0x0804, 0xca3b, 0x9006, 0x080c, 0x6174,
-	0x0804, 0xca35, 0x080c, 0x6553, 0x1904, 0xca35, 0x9006, 0x080c,
-	0x6174, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6,
-	0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x0428, 0x6010,
-	0x2058, 0xb8b0, 0x9005, 0x1178, 0x080c, 0xc1f9, 0x1904, 0xca35,
-	0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4a6f, 0x004e,
-	0x003e, 0x0804, 0xca35, 0x080c, 0x3127, 0x1904, 0xca35, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800,
-	0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001, 0x0002, 0x080c, 0x6188,
-	0x080c, 0x8846, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
-	0x080c, 0x8411, 0x080c, 0x894b, 0x6110, 0x2158, 0x2009, 0x0001,
-	0x080c, 0x801e, 0x0804, 0xca3b, 0x6610, 0x2658, 0xbe04, 0x96b4,
-	0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xca35, 0x9686, 0x0004,
-	0x0904, 0xca35, 0x2001, 0x0004, 0x0804, 0xca33, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
-	0xbba0, 0x2021, 0x0006, 0x080c, 0x4a6f, 0x004e, 0x003e, 0x2001,
-	0x0006, 0x080c, 0xca59, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4,
-	0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006,
-	0x080c, 0x61b4, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001,
-	0x0006, 0x080c, 0x6188, 0x080c, 0x6553, 0x11f8, 0x2001, 0x1836,
-	0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
-	0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe,
-	0x0804, 0xc9bc, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0449,
-	0x0020, 0x0018, 0x0010, 0x080c, 0x61b4, 0x080c, 0x8846, 0x080c,
-	0x9e19, 0x080c, 0x894b, 0x0005, 0x2600, 0x0002, 0xca50, 0xca50,
-	0xca50, 0xca50, 0xca50, 0xca52, 0xca50, 0xca50, 0xca50, 0xca50,
-	0xca52, 0xca50, 0xca50, 0xca50, 0xca52, 0xca52, 0xca52, 0xca52,
-	0x080c, 0x0db4, 0x080c, 0x8846, 0x080c, 0x9e19, 0x080c, 0x894b,
-	0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184,
-	0x0138, 0x080c, 0x6188, 0x9006, 0x080c, 0x6174, 0x080c, 0x2ffc,
-	0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084,
-	0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0db4, 0x91b6, 0x0015,
-	0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x006b,
-	0x0005, 0xa888, 0xa888, 0xa888, 0xa888, 0xa888, 0xa888, 0xcad4,
-	0xca99, 0xa888, 0xa888, 0xa888, 0xa888, 0xa888, 0xa888, 0xa888,
-	0xa888, 0xa888, 0xa888, 0xcad4, 0xcadb, 0xa888, 0xa888, 0xa888,
-	0xa888, 0x00f6, 0x080c, 0x6553, 0x11d8, 0x080c, 0xc1f9, 0x11c0,
-	0x6010, 0x905d, 0x01a8, 0xb8b0, 0x9005, 0x0190, 0x9006, 0x080c,
-	0x6174, 0x2001, 0x0002, 0x080c, 0x6188, 0x6023, 0x0001, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x8411, 0x080c, 0x894b, 0x00d0,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x1190,
-	0x080c, 0x6237, 0x0118, 0x080c, 0x9e19, 0x0060, 0xb810, 0x0006,
-	0xb814, 0x0006, 0x080c, 0x5ce4, 0x000e, 0xb816, 0x000e, 0xb812,
-	0x080c, 0x9e19, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110,
-	0x080c, 0x9e19, 0x0005, 0x080c, 0xac6c, 0x1148, 0x6003, 0x0001,
-	0x6007, 0x0001, 0x080c, 0x8411, 0x080c, 0x894b, 0x0010, 0x080c,
-	0x9e19, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c,
-	0x8846, 0x080c, 0x9e49, 0x080c, 0x894b, 0x0005, 0x9182, 0x0040,
-	0x0002, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0e, 0xcb0c, 0xcb0c,
-	0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c,
-	0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0x080c, 0x0db4, 0x0096, 0x00b6,
-	0x00d6, 0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac,
-	0x9005, 0x11a8, 0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00,
-	0x0904, 0xcb74, 0x080c, 0xd816, 0x1170, 0x9486, 0x2000, 0x1158,
-	0x2009, 0x0001, 0x2011, 0x0200, 0x080c, 0x8207, 0x0020, 0x9026,
-	0x080c, 0xd74b, 0x0c38, 0x080c, 0x0feb, 0x090c, 0x0db4, 0x6003,
-	0x0007, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00,
-	0xa88e, 0x6008, 0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a,
-	0x0016, 0xa876, 0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036,
-	0x080c, 0x6885, 0x001e, 0x080c, 0xd816, 0x1904, 0xcbd4, 0x9486,
-	0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xd486, 0x0804, 0xcbd4,
-	0x9486, 0x0200, 0x1120, 0x080c, 0xd422, 0x0804, 0xcbd4, 0x9486,
-	0x0400, 0x0120, 0x9486, 0x1000, 0x1904, 0xcbd4, 0x2019, 0x0002,
-	0x080c, 0xd43d, 0x0804, 0xcbd4, 0x2069, 0x1a41, 0x6a00, 0xd284,
-	0x0904, 0xcc3e, 0x9284, 0x0300, 0x1904, 0xcc37, 0x6804, 0x9005,
-	0x0904, 0xcc1f, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1004, 0x0904,
-	0xcbe0, 0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017,
-	0x0000, 0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xcc42, 0x9006,
-	0xa802, 0xa867, 0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a,
-	0x6010, 0x2058, 0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba,
-	0xb92c, 0xa9be, 0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d,
-	0x7044, 0x9084, 0x0003, 0x9080, 0xcbdc, 0x2005, 0xa87e, 0x20a9,
-	0x000a, 0x2001, 0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205,
-	0x200b, 0x0080, 0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0,
-	0x4003, 0x200b, 0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000,
-	0x200c, 0xa9ae, 0x080c, 0x6885, 0x002e, 0x004e, 0x00fe, 0x00ee,
-	0x00de, 0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000,
-	0x2001, 0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x0feb, 0x1904,
-	0xcb89, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x83c9, 0x080c, 0x894b, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084,
-	0xff00, 0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016,
-	0x6114, 0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001,
-	0x6007, 0x0043, 0x080c, 0x83c9, 0x080c, 0x894b, 0x0828, 0x6868,
-	0x602e, 0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x080c, 0x83c9, 0x080c, 0x894b, 0x0804, 0xcbd4, 0x2001,
-	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d2,
-	0x6017, 0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x080c, 0x83c9, 0x080c, 0x894b, 0x0804, 0xcbd4, 0x6017,
-	0xf500, 0x0c98, 0x6017, 0xf600, 0x0804, 0xcbf4, 0x6017, 0xf200,
-	0x0804, 0xcbf4, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886,
-	0x2c00, 0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xcbdc, 0x2005,
-	0xa87e, 0x2928, 0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a,
-	0xb82c, 0xa88e, 0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d,
-	0x2009, 0x0205, 0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000,
-	0x2011, 0x0210, 0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111,
-	0x1a0c, 0x0db4, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xccbe, 0x2041,
-	0x0001, 0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8,
-	0x4003, 0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a,
-	0x2001, 0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1004, 0x0170,
-	0x2900, 0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800,
-	0x902d, 0x0118, 0x080c, 0x101d, 0x0cc8, 0x080c, 0x101d, 0x0804,
-	0xcbe0, 0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205,
-	0x200b, 0x0000, 0x080c, 0xd4b5, 0x0804, 0xcbd4, 0x8010, 0x0004,
-	0x801a, 0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186,
-	0x0013, 0x1160, 0x6004, 0x908a, 0x0054, 0x1a0c, 0x0db4, 0x9082,
-	0x0040, 0x0a0c, 0x0db4, 0x2008, 0x0804, 0xcd6f, 0x9186, 0x0051,
-	0x0108, 0x00c0, 0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xcd20,
-	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x82b5,
-	0x002e, 0x001e, 0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580,
-	0x0804, 0xcdb7, 0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128,
-	0x9186, 0x0014, 0x0500, 0x190c, 0x0db4, 0x2001, 0x0109, 0x2004,
-	0xd084, 0x01f0, 0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061,
-	0x0100, 0x0006, 0x0016, 0x0026, 0x080c, 0x82b5, 0x002e, 0x001e,
-	0x000e, 0x00ce, 0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c,
-	0x0db4, 0x0804, 0xce98, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a,
-	0x080c, 0x9eae, 0x0005, 0xcd36, 0xcd38, 0xcd38, 0xcd5f, 0xcd36,
-	0xcd36, 0xcd36, 0xcd36, 0xcd36, 0xcd36, 0xcd36, 0xcd36, 0xcd36,
-	0xcd36, 0xcd36, 0xcd36, 0xcd36, 0xcd36, 0xcd36, 0x080c, 0x0db4,
-	0x080c, 0x8846, 0x080c, 0x894b, 0x0036, 0x0096, 0x6014, 0x904d,
-	0x01d8, 0x080c, 0xbafe, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c,
-	0xd4b5, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1958,
-	0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096,
-	0x080c, 0x8846, 0x080c, 0x894b, 0x080c, 0xbafe, 0x0120, 0x6014,
-	0x2048, 0x080c, 0x101d, 0x080c, 0x9e49, 0x009e, 0x0005, 0x0002,
-	0xcd83, 0xcd9a, 0xcd85, 0xcdb1, 0xcd83, 0xcd83, 0xcd83, 0xcd83,
-	0xcd83, 0xcd83, 0xcd83, 0xcd83, 0xcd83, 0xcd83, 0xcd83, 0xcd83,
-	0xcd83, 0xcd83, 0xcd83, 0x080c, 0x0db4, 0x0096, 0x080c, 0x8846,
-	0x6014, 0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009,
-	0x0043, 0x080c, 0x9e93, 0x0010, 0x6003, 0x0004, 0x080c, 0x894b,
-	0x009e, 0x0005, 0x080c, 0x8846, 0x080c, 0xbafe, 0x0138, 0x6114,
-	0x0096, 0x2148, 0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x81dc,
-	0x080c, 0x9e19, 0x080c, 0x894b, 0x0005, 0x080c, 0xd70f, 0x0db0,
-	0x0cc8, 0x080c, 0x8846, 0x2009, 0x0041, 0x0804, 0xcf20, 0x9182,
-	0x0040, 0x0002, 0xcdcd, 0xcdcf, 0xcdcd, 0xcdcd, 0xcdcd, 0xcdcd,
-	0xcdcd, 0xcdcd, 0xcdcd, 0xcdcd, 0xcdcd, 0xcdcd, 0xcdcd, 0xcdcd,
-	0xcdcd, 0xcdcd, 0xcdcd, 0xcdd0, 0xcdcd, 0x080c, 0x0db4, 0x0005,
-	0x00d6, 0x080c, 0x81dc, 0x00de, 0x080c, 0xd767, 0x080c, 0x9e19,
-	0x0005, 0x9182, 0x0040, 0x0002, 0xcdef, 0xcdef, 0xcdef, 0xcdef,
-	0xcdef, 0xcdef, 0xcdef, 0xcdef, 0xcdef, 0xcdf1, 0xce60, 0xcdef,
-	0xcdef, 0xcdef, 0xcdef, 0xce60, 0xcdef, 0xcdef, 0xcdef, 0x080c,
-	0x0db4, 0x2001, 0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001,
-	0x0132, 0x200c, 0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xce60,
-	0x2009, 0x180c, 0x2104, 0xd0d4, 0x0904, 0xce60, 0xc0d4, 0x200a,
-	0x2009, 0x0105, 0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a,
-	0x2001, 0x1873, 0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c,
-	0x88fb, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c,
-	0x0003, 0x918e, 0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4,
-	0x11e0, 0x080c, 0x8a26, 0x2009, 0x0041, 0x009e, 0x0804, 0xcf20,
-	0x080c, 0x8a26, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x81dc,
-	0x009e, 0x0005, 0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8,
-	0x2001, 0x011f, 0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c,
-	0xc1d4, 0x2102, 0xd1cc, 0x0110, 0x080c, 0x2a77, 0x080c, 0x8a26,
-	0x6014, 0x2048, 0xa97c, 0xd1ec, 0x1130, 0x080c, 0x81dc, 0x080c,
-	0x9e19, 0x009e, 0x0005, 0x080c, 0xd70f, 0x0db8, 0x009e, 0x0005,
-	0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x88fb,
-	0x080c, 0x8a26, 0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086,
-	0x0002, 0x0140, 0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c,
-	0x931b, 0x632e, 0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c,
-	0xd4b5, 0x6018, 0x9005, 0x1128, 0x2001, 0x1958, 0x2004, 0x8003,
-	0x601a, 0x6017, 0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005,
-	0x9182, 0x0040, 0x0002, 0xceaf, 0xceaf, 0xceaf, 0xceaf, 0xceaf,
-	0xceaf, 0xceaf, 0xceaf, 0xceb1, 0xceaf, 0xceaf, 0xceaf, 0xceaf,
-	0xceaf, 0xceaf, 0xceaf, 0xceaf, 0xceaf, 0xceaf, 0xcefc, 0x080c,
-	0x0db4, 0x6014, 0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6,
-	0x2158, 0xb900, 0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c,
-	0xd0fc, 0x0128, 0x2009, 0x0041, 0x009e, 0x0804, 0xcf20, 0x6003,
-	0x0007, 0x601b, 0x0000, 0x080c, 0x81dc, 0x009e, 0x0005, 0x6124,
-	0xd1f4, 0x1d58, 0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200,
-	0x910b, 0x6030, 0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e,
-	0x000e, 0x08d8, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc,
-	0x1178, 0x2009, 0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007,
-	0x0010, 0x6003, 0x0006, 0x00e9, 0x080c, 0x81de, 0x009e, 0x0005,
-	0x6003, 0x0002, 0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c,
-	0x150f, 0x1904, 0xceb1, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834,
-	0xa938, 0x009e, 0x9105, 0x1120, 0x080c, 0x150f, 0x1904, 0xceb1,
-	0x0005, 0xd2fc, 0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000,
-	0x2009, 0x0009, 0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005,
-	0x9182, 0x0040, 0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186,
-	0x0014, 0x190c, 0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005,
-	0xcf43, 0xcf4f, 0xcf5b, 0xcf67, 0xcf43, 0xcf43, 0xcf43, 0xcf43,
-	0xcf4a, 0xcf45, 0xcf45, 0xcf43, 0xcf43, 0xcf43, 0xcf43, 0xcf45,
-	0xcf43, 0xcf45, 0xcf43, 0x080c, 0x0db4, 0x6024, 0xd0dc, 0x090c,
-	0x0db4, 0x0005, 0x6014, 0x9005, 0x190c, 0x0db4, 0x0005, 0x6003,
-	0x0001, 0x6106, 0x080c, 0x83c9, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x894b, 0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x83c9,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x894b, 0x012e, 0x0005, 0x6003,
-	0x0003, 0x6106, 0x2c10, 0x080c, 0x1a5c, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x842e, 0x080c, 0x8a26, 0x012e, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e,
-	0x012e, 0x0005, 0xcf92, 0xcf94, 0xcfa6, 0xcfc0, 0xcf92, 0xcf92,
-	0xcf92, 0xcf92, 0xcf92, 0xcf92, 0xcf92, 0xcf92, 0xcf92, 0xcf92,
-	0xcf92, 0xcf92, 0x080c, 0x0db4, 0x6014, 0x2048, 0xa87c, 0xd0fc,
-	0x01f8, 0x909c, 0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x83c9, 0x080c, 0x894b, 0x0470, 0x6014, 0x2048,
-	0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140,
-	0x6003, 0x0001, 0x6106, 0x080c, 0x83c9, 0x080c, 0x894b, 0x00e0,
-	0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c, 0xd4b5, 0x00a0,
-	0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e,
-	0x0003, 0x0d70, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1a5c,
-	0x080c, 0x842e, 0x080c, 0x8a26, 0x0005, 0x080c, 0x8846, 0x6114,
-	0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xd7b3, 0x0036, 0x2019,
-	0x0029, 0x080c, 0xd4b5, 0x003e, 0x009e, 0x080c, 0x9e49, 0x080c,
-	0x894b, 0x0005, 0x080c, 0x88fb, 0x6114, 0x81ff, 0x0158, 0x0096,
-	0x2148, 0x080c, 0xd7b3, 0x0036, 0x2019, 0x0029, 0x080c, 0xd4b5,
-	0x003e, 0x009e, 0x080c, 0x9e49, 0x080c, 0x8a26, 0x0005, 0x9182,
-	0x0085, 0x0002, 0xd011, 0xd00f, 0xd00f, 0xd01d, 0xd00f, 0xd00f,
-	0xd00f, 0xd00f, 0xd00f, 0xd00f, 0xd00f, 0xd00f, 0xd00f, 0x080c,
-	0x0db4, 0x6003, 0x000b, 0x6106, 0x080c, 0x83c9, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x894b, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c,
-	0xd706, 0x0118, 0x080c, 0x9e19, 0x0450, 0x2071, 0x0260, 0x7224,
-	0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6,
-	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0xa139,
-	0x7220, 0x080c, 0xd35b, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007,
-	0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003,
-	0x0001, 0x080c, 0x83c9, 0x080c, 0x894b, 0x080c, 0x8a26, 0x00ee,
-	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
-	0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085,
-	0x00a2, 0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c,
-	0x9eae, 0x0050, 0x2001, 0x0007, 0x080c, 0x61b4, 0x080c, 0x8846,
-	0x080c, 0x9e49, 0x080c, 0x894b, 0x0005, 0xd082, 0xd084, 0xd084,
-	0xd082, 0xd082, 0xd082, 0xd082, 0xd082, 0xd082, 0xd082, 0xd082,
-	0xd082, 0xd082, 0x080c, 0x0db4, 0x080c, 0x8846, 0x080c, 0x9e49,
-	0x080c, 0x894b, 0x0005, 0x9182, 0x0085, 0x0a0c, 0x0db4, 0x9182,
-	0x0092, 0x1a0c, 0x0db4, 0x9182, 0x0085, 0x0002, 0xd0a3, 0xd0a3,
-	0xd0a3, 0xd0a5, 0xd0a3, 0xd0a3, 0xd0a3, 0xd0a3, 0xd0a3, 0xd0a3,
-	0xd0a3, 0xd0a3, 0xd0a3, 0x080c, 0x0db4, 0x0005, 0x9186, 0x0013,
+	0x9115, 0x190c, 0xb227, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c,
+	0xb07e, 0x00ae, 0x080c, 0x0f9d, 0x009e, 0x080c, 0xc1b7, 0xa974,
+	0x0016, 0x080c, 0xb702, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118,
+	0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c,
+	0xc0da, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118,
+	0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xb227, 0xa974, 0x0016, 0x080c,
+	0x66a7, 0x001e, 0xd1e4, 0x1120, 0x080c, 0x9e32, 0x009e, 0x0005,
+	0x080c, 0xbe10, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4,
+	0x190c, 0x18f9, 0x009e, 0x0005, 0x080c, 0x886e, 0x0010, 0x080c,
+	0x8923, 0x080c, 0xbb17, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x00a0, 0xa867, 0x0103, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a,
+	0x918e, 0x0029, 0x1110, 0x080c, 0xd7d3, 0xa877, 0x0000, 0x080c,
+	0x688c, 0x009e, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0804, 0x8a4e,
+	0xa87b, 0x0004, 0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb48a, 0xb48a,
+	0xb48a, 0xb48a, 0xb48a, 0xb48c, 0xb48a, 0xb48a, 0xb48a, 0xb48a,
+	0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a,
+	0xb48a, 0xb48a, 0x080c, 0x0db4, 0x080c, 0x538e, 0x01f8, 0x6014,
+	0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294,
+	0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086,
+	0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897,
+	0x4000, 0xa99a, 0xaa9e, 0x080c, 0x688c, 0x009e, 0x0804, 0x9e32,
+	0x9182, 0x0085, 0x0002, 0xb4c2, 0xb4c0, 0xb4c0, 0xb4ce, 0xb4c0,
+	0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0,
+	0x080c, 0x0db4, 0x6003, 0x0001, 0x6106, 0x080c, 0x83f1, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8973, 0x012e, 0x0005, 0x0026, 0x0056,
+	0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c,
+	0xbb05, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010,
+	0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb73d, 0x00ce,
+	0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087,
+	0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x9280, 0x0004,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec,
+	0x0128, 0x00c6, 0x2260, 0x080c, 0xbe4a, 0x00ce, 0x00ee, 0x00de,
+	0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a,
+	0x0085, 0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082,
+	0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c,
+	0x0db4, 0x080c, 0x886e, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb17,
+	0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
+	0x688c, 0x009e, 0x080c, 0x9e62, 0x0804, 0x8973, 0xb543, 0xb545,
+	0xb545, 0xb543, 0xb543, 0xb543, 0xb543, 0xb543, 0xb543, 0xb543,
+	0xb543, 0xb543, 0xb543, 0x080c, 0x0db4, 0x080c, 0x886e, 0x080c,
+	0x9e62, 0x080c, 0x8973, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
+	0x9082, 0x0085, 0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c,
+	0x886e, 0x080c, 0x2fda, 0x080c, 0xc227, 0x0096, 0x6014, 0x2048,
+	0x080c, 0xbb17, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
+	0x0029, 0x080c, 0x688c, 0x080c, 0xbd00, 0x009e, 0x080c, 0x9e32,
+	0x080c, 0x8973, 0x0005, 0x080c, 0x9ec7, 0x0ce0, 0x9186, 0x0014,
+	0x1dd0, 0x080c, 0x886e, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb17,
+	0x0d60, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880,
+	0xc0ec, 0xa882, 0x08f0, 0x0002, 0xb59b, 0xb599, 0xb599, 0xb599,
+	0xb599, 0xb599, 0xb5b3, 0xb599, 0xb599, 0xb599, 0xb599, 0xb599,
+	0xb599, 0x080c, 0x0db4, 0x080c, 0x886e, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
+	0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000c,
+	0x080c, 0x8973, 0x0005, 0x080c, 0x886e, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
+	0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000e,
+	0x080c, 0x8973, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x0012, 0x0804, 0x9ec7, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1,
+	0xb5e3, 0xb630, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1,
+	0xb5e1, 0x080c, 0x0db4, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb644,
+	0x080c, 0xbb17, 0x1118, 0x080c, 0xbd00, 0x0068, 0x6014, 0x2048,
+	0xa87c, 0xd0e4, 0x1110, 0x080c, 0xbd00, 0xa867, 0x0103, 0x080c,
+	0xc1f2, 0x080c, 0x688c, 0x00d6, 0x2c68, 0x080c, 0x9ddc, 0x01d0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e,
+	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112,
+	0x080c, 0xbf8c, 0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x83f1,
+	0x080c, 0x8973, 0x2d60, 0x00de, 0x080c, 0x9e32, 0x009e, 0x0005,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e,
+	0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xc18a,
+	0x11f0, 0x080c, 0x9ddc, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023,
+	0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934,
+	0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954,
+	0x6156, 0x080c, 0xbf8c, 0x080c, 0x83f1, 0x080c, 0x8973, 0x2d60,
+	0x00de, 0x0804, 0x9e32, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb17,
+	0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882,
+	0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020,
+	0xa87b, 0x0005, 0x080c, 0xbe0c, 0xa877, 0x0000, 0x080c, 0x688c,
+	0x080c, 0xbd00, 0x009e, 0x0804, 0x9e32, 0x0016, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xbb17, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028,
+	0xa877, 0x0000, 0x080c, 0x688c, 0x009e, 0x001e, 0x9186, 0x0013,
 	0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
-	0x9eae, 0x0030, 0x080c, 0x8846, 0x080c, 0x9e49, 0x080c, 0x894b,
-	0x0005, 0x0036, 0x080c, 0xd767, 0x6043, 0x0000, 0x2019, 0x000b,
-	0x0031, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126,
-	0x0036, 0x2091, 0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c,
-	0x97a1, 0x009e, 0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0x984c,
-	0x007e, 0x1520, 0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086,
-	0x0007, 0x01e0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd767,
-	0x080c, 0xc211, 0x080c, 0x190d, 0x6023, 0x0007, 0x6014, 0x2048,
-	0x080c, 0xbafe, 0x0110, 0x080c, 0xd4b5, 0x009e, 0x6017, 0x0000,
-	0x080c, 0xd767, 0x6023, 0x0007, 0x080c, 0xc211, 0x003e, 0x012e,
-	0x0005, 0x00f6, 0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260,
-	0x7938, 0x783c, 0x080c, 0x2663, 0x15b8, 0x0016, 0x00c6, 0x080c,
-	0x6237, 0x1580, 0x001e, 0x00c6, 0x2160, 0x080c, 0xc20e, 0x00ce,
-	0x002e, 0x0026, 0x0016, 0x2019, 0x0029, 0x080c, 0x990d, 0x080c,
-	0x8549, 0x0076, 0x903e, 0x080c, 0x8441, 0x007e, 0x001e, 0x0076,
-	0x903e, 0x080c, 0xd27b, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00,
-	0x8217, 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0,
-	0x080c, 0x3090, 0x002e, 0x001e, 0x080c, 0x5ce4, 0xbe12, 0xbd16,
+	0x9ec7, 0x0030, 0x080c, 0x886e, 0x080c, 0x9e62, 0x080c, 0x8973,
+	0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182,
+	0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098,
+	0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xb712, 0x96b2,
+	0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0f9d, 0x080c, 0x0feb,
+	0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
+	0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8,
+	0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451,
+	0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
+	0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003,
+	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e,
+	0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130,
+	0xa807, 0x0000, 0x080c, 0x688c, 0x2a48, 0x0cb8, 0x080c, 0x688c,
+	0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080,
+	0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860,
+	0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00,
+	0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300,
+	0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109,
+	0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091,
+	0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e,
+	0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000,
+	0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb778,
+	0xb778, 0xb773, 0xb79a, 0xb766, 0xb773, 0xb79a, 0xb773, 0xb766,
+	0xb766, 0xb773, 0xb773, 0xb773, 0xb766, 0xb766, 0x080c, 0x0db4,
+	0x0036, 0x2019, 0x0010, 0x080c, 0xd0e5, 0x6023, 0x0006, 0x6003,
+	0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x0096, 0x86ff, 0x11d8, 0x6014, 0x2048, 0x080c, 0xbb17, 0x01c0,
+	0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000,
+	0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6ac6, 0x080c, 0xbe0c,
+	0x080c, 0x687f, 0x080c, 0x9e62, 0x9085, 0x0001, 0x009e, 0x0005,
+	0x9006, 0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002,
+	0xb7b0, 0xb7de, 0xb7b2, 0xb7ff, 0xb7d9, 0xb7b0, 0xb773, 0xb778,
+	0xb778, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773,
+	0x080c, 0x0db4, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xbb17, 0x0158, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0f9d, 0x009e, 0x080c,
+	0xbe0c, 0x009e, 0x080c, 0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x080c, 0x83f1, 0x080c, 0x8973, 0x9085, 0x0001,
+	0x0005, 0x0066, 0x080c, 0x190d, 0x006e, 0x08a0, 0x00e6, 0x2071,
+	0x19b8, 0x7024, 0x9c06, 0x1120, 0x080c, 0x9662, 0x00ee, 0x0850,
+	0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096,
+	0x2049, 0x0001, 0x2c40, 0x080c, 0x97ba, 0x009e, 0x008e, 0x0010,
+	0x080c, 0x955f, 0x00ee, 0x1904, 0xb7b2, 0x0804, 0xb773, 0x0036,
+	0x00e6, 0x2071, 0x19b8, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c,
+	0x96d8, 0x00ee, 0x003e, 0x0804, 0xb7b2, 0x080c, 0x98ea, 0x00ee,
+	0x003e, 0x1904, 0xb7b2, 0x0804, 0xb773, 0x00c6, 0x6020, 0x9084,
+	0x000f, 0x0013, 0x00ce, 0x0005, 0xb832, 0xb8fb, 0xba62, 0xb83c,
+	0x9e62, 0xb832, 0xd0d7, 0xc234, 0xb8fb, 0xb82b, 0xbae1, 0xb82b,
+	0xb82b, 0xb82b, 0xb82b, 0x080c, 0x0db4, 0x080c, 0xbd1d, 0x1110,
+	0x080c, 0xa7c0, 0x0005, 0x080c, 0x886e, 0x080c, 0x8973, 0x0804,
+	0x9e32, 0x601b, 0x0001, 0x0005, 0x080c, 0xbb17, 0x0130, 0x6014,
+	0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0db4, 0x0002, 0xb85b, 0xb85d, 0xb881, 0xb895, 0xb8b9,
+	0xb85b, 0xb832, 0xb832, 0xb832, 0xb895, 0xb895, 0xb85b, 0xb85b,
+	0xb85b, 0xb85b, 0xb89f, 0x080c, 0x0db4, 0x00e6, 0x6014, 0x0096,
+	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b8, 0x7024,
+	0x9c06, 0x01a0, 0x080c, 0x955f, 0x080c, 0xc1cc, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1958, 0x2004, 0x601a,
+	0x080c, 0x83f1, 0x080c, 0x8973, 0x00ee, 0x0005, 0x601b, 0x0001,
+	0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x080c, 0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x83f1, 0x080c, 0x8973, 0x0005, 0x0096, 0x601b, 0x0001,
+	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c,
+	0x538e, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139,
+	0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x688c, 0x009e, 0x0804,
+	0x9e32, 0x6014, 0x0096, 0x904d, 0x05c8, 0xa97c, 0xd1e4, 0x05b0,
+	0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884,
+	0x009e, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0030,
+	0x2c08, 0x080c, 0x1518, 0x2001, 0x030c, 0x2004, 0x9086, 0x0041,
+	0x11a0, 0x6014, 0x0096, 0x904d, 0x090c, 0x0db4, 0xa880, 0xd0f4,
+	0x1130, 0xc0f5, 0xa882, 0x009e, 0x601b, 0x0002, 0x0070, 0x009e,
+	0x2001, 0x0037, 0x2c08, 0x080c, 0x1518, 0x6000, 0x9086, 0x0004,
+	0x1120, 0x2009, 0x0048, 0x080c, 0x9eac, 0x0005, 0x009e, 0x080c,
+	0x190d, 0x0804, 0xb881, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4,
+	0x000b, 0x0005, 0xb912, 0xb839, 0xb914, 0xb912, 0xb914, 0xb914,
+	0xb833, 0xb912, 0xb82d, 0xb82d, 0xb912, 0xb912, 0xb912, 0xb912,
+	0xb912, 0xb912, 0x080c, 0x0db4, 0x6010, 0x00b6, 0x2058, 0xb804,
+	0x9084, 0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0db4, 0x00b6,
+	0x0013, 0x00be, 0x0005, 0xb92f, 0xb9fc, 0xb931, 0xb971, 0xb931,
+	0xb971, 0xb931, 0xb93f, 0xb92f, 0xb971, 0xb92f, 0xb960, 0x080c,
+	0x0db4, 0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8,
+	0x908e, 0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xb9f8, 0x6004,
+	0x080c, 0xbd1d, 0x0904, 0xba15, 0x908e, 0x0004, 0x1110, 0x080c,
+	0x3003, 0x908e, 0x0021, 0x0904, 0xba19, 0x908e, 0x0022, 0x0904,
+	0xba5d, 0x908e, 0x003d, 0x0904, 0xba19, 0x908e, 0x0039, 0x0904,
+	0xba1d, 0x908e, 0x0035, 0x0904, 0xba1d, 0x908e, 0x001e, 0x0178,
+	0x908e, 0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x0110, 0x080c, 0x2fda, 0x080c, 0xa7c0, 0x0804,
+	0x9e62, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xb9e9,
+	0x9186, 0x0002, 0x1904, 0xb9be, 0x2001, 0x1836, 0x2004, 0xd08c,
+	0x11c8, 0x080c, 0x6fb2, 0x11b0, 0x080c, 0xc212, 0x0138, 0x080c,
+	0x6fd5, 0x1120, 0x080c, 0x6ec2, 0x0804, 0xba46, 0x2001, 0x194e,
+	0x2003, 0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x6ee4,
+	0x0804, 0xba46, 0x6010, 0x2058, 0x2001, 0x1836, 0x2004, 0xd0ac,
+	0x1904, 0xba46, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xba46, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000,
+	0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0x9ddc,
+	0x0128, 0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce,
+	0x6004, 0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086,
+	0x007e, 0x1170, 0x2009, 0x1836, 0x2104, 0xc085, 0x200a, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5c64, 0x00ee, 0x080c, 0xa7c0, 0x0030,
+	0x080c, 0xa7c0, 0x080c, 0x2fda, 0x080c, 0xc227, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x3003, 0x012e, 0x00ee, 0x080c, 0x9e62,
+	0x0005, 0x2001, 0x0002, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x8439, 0x080c, 0x8973, 0x00de, 0x00ce, 0x0c80,
+	0x080c, 0x3003, 0x0804, 0xb96d, 0x00c6, 0x00d6, 0x6104, 0x9186,
+	0x0016, 0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
+	0x0904, 0xb9be, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x8439,
+	0x080c, 0x8973, 0x00de, 0x00ce, 0x0898, 0x080c, 0xa7c0, 0x0804,
+	0xb96f, 0x080c, 0xa7fc, 0x0804, 0xb96f, 0x00d6, 0x2c68, 0x6104,
+	0x080c, 0xc18a, 0x00de, 0x0118, 0x080c, 0x9e32, 0x00f0, 0x6004,
+	0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1958,
+	0x2004, 0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026,
+	0x2160, 0x080c, 0x83f1, 0x080c, 0x8973, 0x0005, 0x00de, 0x00ce,
+	0x080c, 0xa7c0, 0x080c, 0x2fda, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x3003, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
+	0x6043, 0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xa261, 0x1904,
+	0xba15, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0096,
+	0x00d6, 0x001b, 0x00de, 0x009e, 0x0005, 0xba7d, 0xba7d, 0xba7d,
+	0xba7d, 0xba7d, 0xba7d, 0xba7d, 0xba7d, 0xba7d, 0xb832, 0xba7d,
+	0xb839, 0xba7f, 0xb839, 0xba8c, 0xba7d, 0x080c, 0x0db4, 0x6004,
+	0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x0005, 0x080c, 0xc206, 0x0118, 0x080c,
+	0xc219, 0x0010, 0x080c, 0xc227, 0x080c, 0xbd00, 0x080c, 0xbb17,
+	0x0570, 0x080c, 0x2fda, 0x080c, 0xbb17, 0x0168, 0x6014, 0x2048,
+	0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed,
+	0xa882, 0x080c, 0x688c, 0x2c68, 0x080c, 0x9ddc, 0x0150, 0x6810,
+	0x6012, 0x080c, 0xbf8c, 0x00c6, 0x2d60, 0x080c, 0x9e62, 0x00ce,
+	0x0008, 0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x00c8, 0x080c,
+	0xc206, 0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x2fda,
+	0x08d0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x080c, 0x2fda, 0x0868, 0x080c, 0x9e62,
+	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002, 0xbaf7,
+	0xbaf7, 0xbaf9, 0xbaf9, 0xbaf9, 0xbaf7, 0xbaf7, 0x9e62, 0xbaf7,
+	0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0x080c,
+	0x0db4, 0x080c, 0x98ea, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006,
+	0x080c, 0x688c, 0x009e, 0x0804, 0x9e32, 0x9284, 0x0007, 0x1158,
+	0x9282, 0x1cd0, 0x0240, 0x2001, 0x1819, 0x2004, 0x9202, 0x1218,
+	0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096,
+	0x0006, 0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086,
+	0xf000, 0x0110, 0x080c, 0x1096, 0x000e, 0x009e, 0x0005, 0x00e6,
+	0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0,
+	0x2071, 0x1800, 0x7350, 0x7070, 0x9302, 0x1640, 0x6020, 0x9206,
+	0x11f8, 0x080c, 0xc212, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004,
+	0x9086, 0x0004, 0x1148, 0x080c, 0x2fda, 0x080c, 0xc227, 0x00c6,
+	0x080c, 0x9e62, 0x00ce, 0x0060, 0x080c, 0xbf06, 0x0148, 0x080c,
+	0xbd1d, 0x1110, 0x080c, 0xa7c0, 0x00c6, 0x080c, 0x9e32, 0x00ce,
+	0x9ce0, 0x0018, 0x7064, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e,
+	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188,
+	0x1000, 0x210c, 0x81ff, 0x0128, 0x2061, 0x1a80, 0x6112, 0x080c,
+	0x2fda, 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9ddc, 0x01b0,
+	0x6656, 0x2b00, 0x6012, 0x080c, 0x538e, 0x0118, 0x080c, 0xbc44,
+	0x0168, 0x080c, 0xbf8c, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c,
+	0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9e7f, 0x0560,
+	0x6057, 0x0000, 0x2b00, 0x6012, 0x080c, 0xbf8c, 0x6023, 0x0003,
+	0x0016, 0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469, 0x2c08,
+	0x080c, 0xd29b, 0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0x9e32,
+	0x9085, 0x0001, 0x0070, 0x080c, 0x538e, 0x0128, 0xd18c, 0x1170,
+	0x080c, 0xbc44, 0x0148, 0x2009, 0x004c, 0x080c, 0x9eac, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016,
+	0x0c90, 0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6,
+	0x0046, 0x0016, 0x080c, 0x9ddc, 0x2c78, 0x0590, 0x7e56, 0x2b00,
+	0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xbc56, 0x9186,
+	0x004d, 0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x1951, 0x200c,
+	0xd1fc, 0x0168, 0x2f60, 0x080c, 0x9e32, 0x00d0, 0x2001, 0x1950,
+	0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9e32, 0x0088, 0x2f60,
+	0x080c, 0x538e, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010,
+	0x2900, 0x7816, 0x001e, 0x0016, 0x080c, 0x9eac, 0x9085, 0x0001,
+	0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046,
+	0x080c, 0x9ddc, 0x2c78, 0x0508, 0x7e56, 0x2b00, 0x7812, 0x7823,
+	0x0003, 0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x194f,
+	0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9e32, 0x0060, 0x2f60,
+	0x080c, 0x538e, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009,
+	0x0052, 0x080c, 0x9eac, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe,
+	0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x4879, 0x00ce,
+	0x1120, 0x080c, 0x9e32, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b,
+	0x8000, 0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6372, 0x0158, 0x2001, 0xbc5b,
+	0x0006, 0x900e, 0x2400, 0x080c, 0x6ac6, 0x080c, 0x688c, 0x000e,
+	0x0807, 0x2418, 0x080c, 0x8808, 0xbaa0, 0x0086, 0x2041, 0x0001,
+	0x2039, 0x0001, 0x2608, 0x080c, 0x8589, 0x008e, 0x080c, 0x8469,
+	0x2f08, 0x2648, 0x080c, 0xd29b, 0xb93c, 0x81ff, 0x090c, 0x865a,
+	0x080c, 0x8973, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9ddc, 0x0190, 0x660a, 0x2b08, 0x6112,
+	0x080c, 0xbf8c, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f,
+	0x080c, 0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e7f, 0x01b8,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0008, 0x2900,
+	0x6016, 0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x2009, 0x0021,
+	0x080c, 0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000,
+	0x080c, 0x9ddc, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbf8c,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0x9eac,
+	0x9085, 0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e7f, 0x0188, 0x2b08,
+	0x6112, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
+	0x0000, 0x080c, 0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818,
+	0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
+	0xba3e, 0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e,
+	0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110,
+	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020,
+	0x9086, 0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xbb17, 0x0168,
+	0xa864, 0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128,
+	0xa868, 0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e,
+	0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e7f,
+	0x0198, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x080c, 0x2fda, 0x2009, 0x0028, 0x080c, 0x9eac, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015,
+	0x11a8, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6,
+	0x080c, 0xaa49, 0x00be, 0x080c, 0xac88, 0x6003, 0x0001, 0x6007,
+	0x0029, 0x080c, 0x8439, 0x080c, 0x8973, 0x0078, 0x6014, 0x0096,
+	0x2048, 0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c,
+	0xc14b, 0x080c, 0xa7c0, 0x080c, 0x9e32, 0x0005, 0x0096, 0x6014,
+	0x904d, 0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x688c, 0x012e, 0x009e, 0x080c, 0x9e32, 0x0c30, 0x0096,
+	0x9186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x618f, 0x00e8,
+	0x9186, 0x0015, 0x1510, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014,
+	0x11e0, 0x6010, 0x00b6, 0x2058, 0x080c, 0x62d9, 0x00be, 0x080c,
+	0xad59, 0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005,
+	0x0160, 0x2001, 0x0006, 0x080c, 0x618f, 0x6014, 0x2048, 0xa868,
+	0xd0fc, 0x0170, 0x080c, 0xa235, 0x0048, 0x6014, 0x2048, 0xa868,
+	0xd0fc, 0x0528, 0x080c, 0xa7c0, 0x080c, 0x9e32, 0x009e, 0x0005,
+	0x6014, 0x6310, 0x2358, 0x904d, 0x090c, 0x0db4, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x645e, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x688c, 0x012e, 0x080c, 0x9e32, 0x08f8, 0x6014,
+	0x904d, 0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x688c, 0x012e, 0x080c, 0x9e32, 0x0840, 0xa878, 0x9086,
+	0x0005, 0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005,
+	0x6043, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050,
+	0x080c, 0x83f1, 0x080c, 0x8973, 0x0005, 0x00c6, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f,
+	0x0013, 0x00ce, 0x0005, 0xb832, 0xbe3c, 0xbe3c, 0xbe3f, 0xd579,
+	0xd594, 0xd597, 0xb832, 0xb832, 0xb832, 0xb832, 0xb832, 0xb832,
+	0xb832, 0xb832, 0x080c, 0x0db4, 0xa001, 0xa001, 0x0005, 0x0096,
+	0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010,
+	0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0550, 0x2001, 0x1833, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78,
+	0x080c, 0x9ddc, 0x0508, 0x7810, 0x6012, 0x080c, 0xbf8c, 0x7820,
+	0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020,
+	0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007,
+	0x0035, 0x6003, 0x0001, 0x7954, 0x6156, 0x080c, 0x83f1, 0x080c,
+	0x8973, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1959,
+	0x2004, 0x6042, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0xa87c,
+	0xd0e4, 0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000,
+	0xa88f, 0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048,
+	0x080c, 0x0f9d, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803,
+	0x0002, 0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0,
+	0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085,
+	0x0c00, 0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0,
+	0x693c, 0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc,
+	0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112,
+	0x6954, 0x6156, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001,
+	0x080c, 0x83f1, 0x080c, 0x8973, 0x009e, 0x001e, 0x0005, 0x6024,
+	0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303,
+	0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a,
+	0x633e, 0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402,
+	0xa836, 0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024,
+	0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a,
+	0xa840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016,
+	0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e,
+	0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158,
+	0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b,
+	0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00e6, 0x2001, 0x1953, 0x200c, 0x8000, 0x2014,
+	0x2001, 0x0032, 0x080c, 0x8270, 0x2001, 0x1957, 0x82ff, 0x1110,
+	0x2011, 0x0014, 0x2202, 0x2001, 0x1955, 0x200c, 0x8000, 0x2014,
+	0x2071, 0x193d, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8270,
+	0x2001, 0x1958, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
+	0x1959, 0x9288, 0x000a, 0x2102, 0x2001, 0x1a61, 0x2102, 0x2001,
+	0x0032, 0x080c, 0x1518, 0x080c, 0x6543, 0x00ee, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1957,
+	0x2003, 0x0028, 0x2001, 0x1958, 0x2003, 0x0014, 0x2071, 0x193d,
+	0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1959, 0x2009, 0x001e,
+	0x2102, 0x2001, 0x1a61, 0x2102, 0x2001, 0x0032, 0x080c, 0x1518,
+	0x00ee, 0x001e, 0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110,
+	0x080c, 0x101d, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9ddc, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0x9eac, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x708c, 0x9086,
+	0x0018, 0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78,
+	0x080c, 0x8b63, 0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c,
+	0xaa54, 0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
+	0x900e, 0x080c, 0x3023, 0x080c, 0xa235, 0x0020, 0x080c, 0xa7c0,
+	0x080c, 0x9e32, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54,
+	0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9ddc, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x004d, 0x080c, 0x9eac, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x0016, 0x080c, 0x9ddc, 0x0180, 0x2b08, 0x6112, 0x080c,
+	0xbf8c, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9eac,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x718c, 0x6014,
+	0x2048, 0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001,
+	0x1971, 0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906,
+	0x8006, 0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x080c, 0xc7ce,
+	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048,
+	0xa867, 0x0103, 0x0010, 0x080c, 0xa7c0, 0x080c, 0x9e32, 0x00fe,
+	0x00ee, 0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
+	0x11b8, 0x708c, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78,
+	0x080c, 0x8b63, 0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c,
+	0xaa78, 0x9206, 0x1110, 0x080c, 0x2fda, 0x080c, 0xa235, 0x0020,
+	0x080c, 0xa7c0, 0x080c, 0x9e32, 0x00fe, 0x00ee, 0x009e, 0x0005,
+	0x705c, 0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1550, 0x708c, 0x9086, 0x0004,
+	0x1530, 0x6014, 0x2048, 0x2c78, 0x080c, 0x8b63, 0x05f0, 0x7078,
+	0xaacc, 0x9206, 0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c,
+	0x2fda, 0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c,
+	0x533e, 0x001e, 0x0010, 0x080c, 0x512f, 0x080c, 0xbb17, 0x0508,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c,
+	0xbb17, 0x01b8, 0x6014, 0x2048, 0x080c, 0x512f, 0x1d70, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126,
+	0x2091, 0x8000, 0xa867, 0x0139, 0x080c, 0x688c, 0x012e, 0x080c,
+	0x9e32, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaad0, 0x9206,
+	0x0930, 0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938,
+	0xaa34, 0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c,
+	0x9206, 0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e,
+	0x0005, 0x00b6, 0x00d6, 0x0036, 0x080c, 0xbb17, 0x0904, 0xc147,
+	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580,
+	0x6310, 0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140,
+	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f68, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0,
+	0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f68, 0x00ce, 0x0090,
+	0xaa96, 0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016,
+	0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084,
+	0x00ff, 0xa89e, 0x080c, 0x687f, 0x6017, 0x0000, 0x009e, 0x003e,
+	0x00de, 0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096,
+	0x00f6, 0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096,
+	0x0000, 0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2663,
+	0x2118, 0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d,
+	0x7c3c, 0x2011, 0x8018, 0x080c, 0x48d9, 0x00a8, 0x9096, 0x0001,
+	0x1148, 0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
+	0xa8aa, 0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838,
+	0xa8a6, 0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e,
+	0x002e, 0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110,
+	0x6a38, 0x0008, 0x6a2c, 0x080c, 0xbb05, 0x01f0, 0x2260, 0x6120,
+	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206,
+	0x0140, 0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140,
+	0x0020, 0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106,
+	0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974,
+	0xd1cc, 0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8,
+	0x918c, 0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xb227, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010,
+	0x0036, 0x901e, 0x0499, 0x01e0, 0x080c, 0xbb17, 0x01c8, 0x080c,
+	0xbd00, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048,
+	0xa87c, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0040, 0xa867,
+	0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x688c, 0x009e,
+	0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec,
+	0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
+	0x0005, 0x080c, 0xbe0c, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e,
+	0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
+	0x2021, 0x0007, 0x080c, 0x4a76, 0x004e, 0x003e, 0x0005, 0x0c51,
+	0x1d81, 0x0005, 0x2001, 0x1957, 0x2004, 0x601a, 0x0005, 0x2001,
+	0x1959, 0x2004, 0x6042, 0x0005, 0x080c, 0x9e32, 0x0804, 0x8973,
+	0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x001b,
+	0x006e, 0x00be, 0x0005, 0xc253, 0xc92b, 0xca86, 0xc253, 0xc253,
+	0xc253, 0xc253, 0xc253, 0xc28a, 0xcb08, 0xc253, 0xc253, 0xc253,
+	0xc253, 0xc253, 0xc253, 0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e, 0x0005, 0xc26e, 0xd070,
+	0xc26e, 0xc26e, 0xc26e, 0xc26e, 0xc26e, 0xc26e, 0xd01d, 0xd0c4,
+	0xc26e, 0xd6b4, 0xd6ea, 0xd6b4, 0xd6ea, 0xc26e, 0x080c, 0x0db4,
+	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0db4, 0x6000, 0x000a, 0x0005,
+	0xc288, 0xcce5, 0xcdd5, 0xcdf7, 0xceb6, 0xc288, 0xcf94, 0xcf3e,
+	0xcb14, 0xcff3, 0xd008, 0xc288, 0xc288, 0xc288, 0xc288, 0xc288,
+	0x080c, 0x0db4, 0x91b2, 0x0053, 0x1a0c, 0x0db4, 0x2100, 0x91b2,
+	0x0040, 0x1a04, 0xc6cc, 0x0002, 0xc2d4, 0xc4bd, 0xc2d4, 0xc2d4,
+	0xc2d4, 0xc4c6, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4,
+	0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4,
+	0xc2d4, 0xc2d4, 0xc2d4, 0xc2d6, 0xc339, 0xc348, 0xc3ac, 0xc3d7,
+	0xc44f, 0xc4a8, 0xc2d4, 0xc2d4, 0xc4c9, 0xc2d4, 0xc2d4, 0xc4de,
+	0xc4eb, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc56e, 0xc2d4,
+	0xc2d4, 0xc582, 0xc2d4, 0xc2d4, 0xc53d, 0xc2d4, 0xc2d4, 0xc2d4,
+	0xc59a, 0xc2d4, 0xc2d4, 0xc2d4, 0xc617, 0xc2d4, 0xc2d4, 0xc2d4,
+	0xc2d4, 0xc2d4, 0xc2d4, 0xc694, 0x080c, 0x0db4, 0x080c, 0x6520,
+	0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009,
+	0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017,
+	0x0000, 0x0804, 0xc4b6, 0x080c, 0x6509, 0x00e6, 0x00c6, 0x0036,
+	0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029,
+	0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469, 0x2c08, 0x080c,
+	0xd29b, 0x007e, 0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
+	0x6610, 0x2658, 0x080c, 0x624d, 0xbe04, 0x9684, 0x00ff, 0x9082,
+	0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0,
+	0x00be, 0x2c08, 0x080c, 0xd862, 0x002e, 0x001e, 0x1178, 0x080c,
+	0xd1ce, 0x1904, 0xc3a4, 0x080c, 0xd16a, 0x1120, 0x6007, 0x0008,
+	0x0804, 0xc4b6, 0x6007, 0x0009, 0x0804, 0xc4b6, 0x080c, 0xd3c5,
+	0x0128, 0x080c, 0xd1ce, 0x0d78, 0x0804, 0xc3a4, 0x6017, 0x1900,
+	0x0c88, 0x080c, 0x30fd, 0x1904, 0xc6c9, 0x6106, 0x080c, 0xd11f,
+	0x6007, 0x0006, 0x0804, 0xc4b6, 0x6007, 0x0007, 0x0804, 0xc4b6,
+	0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c, 0x30fd, 0x1904, 0xc6c9,
+	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
+	0x1220, 0x2001, 0x0001, 0x080c, 0x617b, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686,
+	0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030,
+	0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007,
+	0x00b0, 0x00ee, 0x080c, 0xd231, 0x1190, 0x9686, 0x0006, 0x1140,
+	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x3023, 0x002e,
+	0x080c, 0x62d9, 0x6007, 0x000a, 0x00de, 0x0804, 0xc4b6, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xc4b6, 0x080c, 0x2fda, 0x080c, 0xc227,
+	0x6007, 0x0001, 0x0804, 0xc4b6, 0x080c, 0xd726, 0x1904, 0xc6c9,
+	0x080c, 0x30fd, 0x1904, 0xc6c9, 0x2071, 0x0260, 0x7034, 0x90b4,
+	0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003,
+	0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x3023, 0x002e, 0x6007,
+	0x000c, 0x2001, 0x0001, 0x080c, 0xd842, 0x0804, 0xc4b6, 0x080c,
+	0x6520, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xc2e3, 0x080c, 0x6509, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026,
+	0x2001, 0x0006, 0x080c, 0x61bb, 0x002e, 0x0050, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc3a4,
+	0x080c, 0xd23e, 0x1120, 0x6007, 0x000e, 0x0804, 0xc4b6, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fda, 0x080c, 0xc227,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009,
+	0x0029, 0x080c, 0xd52a, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
+	0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xc4b6, 0x2001, 0x0001,
+	0x080c, 0x617b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xadf9, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682,
+	0x0004, 0x0a04, 0xc3a4, 0x9682, 0x0007, 0x0a04, 0xc400, 0x0804,
+	0xc3a4, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc4b6, 0x080c,
+	0x6520, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xc2e3, 0x080c, 0x6509, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0690, 0x0150, 0x96b4,
+	0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904,
+	0xc3a4, 0x080c, 0xd26c, 0x1130, 0x080c, 0xd16a, 0x1118, 0x6007,
+	0x0010, 0x04e0, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c,
+	0x2fda, 0x080c, 0xc227, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854,
+	0x210c, 0x0048, 0x2009, 0x0029, 0x080c, 0xd52a, 0x6010, 0x2058,
+	0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0,
+	0x080c, 0xd3c5, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
+	0x0980, 0x0804, 0xc3a4, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070,
+	0x080c, 0x30fd, 0x1904, 0xc6c9, 0x080c, 0xd726, 0x1904, 0xc6c9,
+	0x080c, 0xc869, 0x1904, 0xc3a4, 0x6007, 0x0012, 0x6003, 0x0001,
+	0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0cb0, 0x6007, 0x0005,
+	0x0c68, 0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c, 0x30fd, 0x1904,
+	0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x6007, 0x0020, 0x6003,
+	0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x080c, 0x30fd,
+	0x1904, 0xc6c9, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8439,
+	0x080c, 0x8973, 0x0005, 0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c,
+	0x30fd, 0x1904, 0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x0016,
+	0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180,
+	0x2c08, 0x080c, 0xbb05, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206,
+	0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050,
+	0x7240, 0x2c08, 0x9006, 0x080c, 0xd4fc, 0x1180, 0x7244, 0x9286,
+	0xffff, 0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214,
+	0x9296, 0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086,
+	0x0007, 0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x9e32,
+	0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x8439, 0x080c,
+	0x8973, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c,
+	0x617b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0276, 0x080c, 0xadf9, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xc4b6, 0x080c, 0xaa61,
+	0x080c, 0x6fb2, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6fcc,
+	0x1138, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c, 0x6ee4, 0x0010,
+	0x080c, 0x6f8a, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x30fd,
+	0x1904, 0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x6106, 0x080c,
+	0xc885, 0x1120, 0x6007, 0x002b, 0x0804, 0xc4b6, 0x6007, 0x002c,
+	0x0804, 0xc4b6, 0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c, 0x30fd,
+	0x1904, 0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x6106, 0x080c,
+	0xc88a, 0x1120, 0x6007, 0x002e, 0x0804, 0xc4b6, 0x6007, 0x002f,
+	0x0804, 0xc4b6, 0x080c, 0x30fd, 0x1904, 0xc6c9, 0x00e6, 0x00d6,
+	0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006,
+	0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce,
+	0x00de, 0x00ee, 0x0804, 0xc4bd, 0x080c, 0x538a, 0xd0e4, 0x0904,
+	0xc614, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108,
+	0x720c, 0x080c, 0x655e, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106,
+	0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x655a, 0x15b8, 0x2069,
+	0x1800, 0x687c, 0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210,
+	0x080c, 0xbb05, 0x0590, 0x080c, 0xc754, 0x0578, 0x080c, 0xd5a6,
+	0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x83f1,
+	0x080c, 0x8973, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286,
+	0xffff, 0x0150, 0x080c, 0xbb05, 0x01c0, 0x9280, 0x0002, 0x2004,
+	0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001,
+	0x080c, 0xd4fc, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037,
+	0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f,
+	0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c,
+	0x30fd, 0x1904, 0xc6c9, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00,
+	0x8007, 0x9086, 0x0006, 0x1904, 0xc4bd, 0x00e6, 0x00d6, 0x00c6,
+	0x080c, 0x538a, 0xd0e4, 0x0904, 0xc68c, 0x2069, 0x1800, 0x2071,
+	0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150,
+	0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd4fc, 0x2c10,
+	0x00ce, 0x05e8, 0x080c, 0xbb05, 0x05d0, 0x7108, 0x9280, 0x0002,
+	0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb73d,
+	0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001,
+	0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280,
+	0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xc754, 0x0904, 0xc60d,
+	0x0056, 0x7510, 0x7614, 0x080c, 0xd5bf, 0x005e, 0x00ce, 0x00de,
+	0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
+	0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x0c78, 0x6007,
+	0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b,
+	0x6017, 0x0000, 0x0804, 0xc5e4, 0x00e6, 0x0026, 0x080c, 0x6520,
+	0x0550, 0x080c, 0x6509, 0x080c, 0xd798, 0x1518, 0x2071, 0x1800,
+	0x70d8, 0x9085, 0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac,
+	0x9284, 0x00ff, 0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205,
+	0x707e, 0x78ea, 0x00fe, 0x70e3, 0x0000, 0x080c, 0x655e, 0x0120,
+	0x2011, 0x19d1, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2dbb,
+	0x0010, 0x080c, 0xd7ca, 0x002e, 0x00ee, 0x080c, 0x9e32, 0x0804,
+	0xc4bc, 0x080c, 0x9e32, 0x0005, 0x2600, 0x0002, 0xc6e0, 0xc6e0,
+	0xc6e0, 0xc6e0, 0xc6e0, 0xc6e2, 0xc6e0, 0xc6e0, 0xc6e0, 0xc6e0,
+	0xc6ff, 0xc6e0, 0xc6e0, 0xc6e0, 0xc711, 0xc71e, 0xc74f, 0xc6e0,
+	0x080c, 0x0db4, 0x080c, 0xd726, 0x1d20, 0x080c, 0x30fd, 0x1d08,
+	0x080c, 0xc869, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003,
+	0x0001, 0x080c, 0x8439, 0x0005, 0x080c, 0x2fda, 0x080c, 0xc227,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8439, 0x0005, 0x080c,
+	0xd726, 0x1938, 0x080c, 0x30fd, 0x1920, 0x080c, 0xc869, 0x1d60,
+	0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8439,
+	0x0005, 0x080c, 0xc771, 0x0904, 0xc6c9, 0x6007, 0x004e, 0x6003,
+	0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x6007, 0x004f,
+	0x6017, 0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186,
+	0x0001, 0x1160, 0x7140, 0x2001, 0x198e, 0x2004, 0x9106, 0x11b0,
+	0x7144, 0x2001, 0x198f, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002,
+	0x1168, 0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
+	0x2019, 0x000a, 0x080c, 0xae0d, 0x009e, 0x0110, 0x6017, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x6007,
+	0x0050, 0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260,
+	0x00b6, 0x00c6, 0x2260, 0x6010, 0x2058, 0xb8bc, 0xd084, 0x0150,
+	0x7128, 0x6048, 0x9106, 0x1120, 0x712c, 0x6044, 0x9106, 0x0110,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e,
+	0x0005, 0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8,
+	0x20e1, 0x0000, 0x2001, 0x1971, 0x2003, 0x0000, 0x080c, 0x1004,
+	0x05a0, 0x2900, 0x6016, 0x708c, 0x8004, 0xa816, 0x908a, 0x001e,
+	0x02d0, 0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x0471,
+	0x001e, 0x2940, 0x080c, 0x1004, 0x01c0, 0x2900, 0xa006, 0x2100,
+	0x81ff, 0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x00b1,
+	0x001e, 0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x708f,
+	0x0000, 0x6014, 0x2048, 0x080c, 0x0f9d, 0x9006, 0x012e, 0x01de,
+	0x01ce, 0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x2241,
+	0x2099, 0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2241,
+	0x2099, 0x0260, 0x0ca8, 0x080c, 0x2241, 0x2061, 0x1971, 0x6004,
+	0x2098, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048,
+	0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2241, 0x2099, 0x0260,
+	0x0ca8, 0x2061, 0x1971, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110,
+	0x6006, 0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292,
+	0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff,
+	0x11b8, 0x080c, 0x2259, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518,
+	0x9312, 0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff,
+	0x01f8, 0x22a8, 0x8108, 0x080c, 0x2259, 0x20a1, 0x0240, 0x0c98,
+	0x080c, 0x2259, 0x2061, 0x1974, 0x6004, 0x20a0, 0x6008, 0x3518,
+	0x9312, 0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff,
+	0x0138, 0x22a8, 0x8108, 0x080c, 0x2259, 0x20a1, 0x0240, 0x0c98,
+	0x2061, 0x1974, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006,
+	0x0020, 0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
+	0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04,
+	0x96b4, 0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110,
+	0x9085, 0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xc901,
+	0x00de, 0x0005, 0x00d6, 0x080c, 0xc90e, 0x1520, 0x680c, 0x908c,
+	0xff00, 0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e,
+	0xd1e4, 0x0130, 0x9006, 0x080c, 0xd842, 0x2009, 0x0001, 0x0078,
+	0xd1ec, 0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x2663,
+	0x1148, 0x2001, 0x0001, 0x080c, 0xd842, 0x2110, 0x900e, 0x080c,
+	0x3023, 0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005,
+	0x00b6, 0x00c6, 0x080c, 0x9e7f, 0x05a8, 0x0016, 0x0026, 0x00c6,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x1578,
+	0x080c, 0x61de, 0x1560, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e,
+	0x2b00, 0x6012, 0x080c, 0xd726, 0x11d8, 0x080c, 0x30fd, 0x11c0,
+	0x080c, 0xc869, 0x0510, 0x2001, 0x0007, 0x080c, 0x618f, 0x2001,
+	0x0007, 0x080c, 0x61bb, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0010,
+	0x080c, 0x9e32, 0x9085, 0x0001, 0x00ce, 0x00be, 0x0005, 0x080c,
+	0x9e32, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c, 0x9e32, 0x9006,
+	0x0c98, 0x2069, 0x026d, 0x6800, 0x9082, 0x0010, 0x1228, 0x6017,
+	0x0000, 0x9085, 0x0001, 0x0008, 0x9006, 0x0005, 0x6017, 0x0000,
+	0x2069, 0x026c, 0x6808, 0x9084, 0xff00, 0x9086, 0x0800, 0x1190,
+	0x6904, 0x9186, 0x0018, 0x0118, 0x9186, 0x0014, 0x1158, 0x810f,
+	0x6800, 0x9084, 0x00ff, 0x910d, 0x615a, 0x908e, 0x0014, 0x0110,
+	0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4,
+	0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04, 0xca56,
+	0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, 0x190c, 0x0db4,
+	0x2001, 0x0007, 0x080c, 0x61bb, 0x080c, 0x886e, 0x080c, 0x9e62,
+	0x080c, 0x8973, 0x0005, 0xc98b, 0xc98d, 0xc98b, 0xc98b, 0xc98b,
+	0xc98d, 0xc99c, 0xca4f, 0xc9ee, 0xca4f, 0xca00, 0xca4f, 0xc99c,
+	0xca4f, 0xca47, 0xca4f, 0xca47, 0xca4f, 0xca4f, 0xc98b, 0xc98b,
+	0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b,
+	0xc98b, 0xc98d, 0xc98b, 0xca4f, 0xc98b, 0xc98b, 0xca4f, 0xc98b,
+	0xca4c, 0xca4f, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xca4f, 0xca4f,
+	0xc98b, 0xca4f, 0xca4f, 0xc98b, 0xc997, 0xc98b, 0xc98b, 0xc98b,
+	0xc98b, 0xca4b, 0xca4f, 0xc98b, 0xc98b, 0xca4f, 0xca4f, 0xc98b,
+	0xc98b, 0xc98b, 0xc98b, 0x080c, 0x0db4, 0x080c, 0x886e, 0x080c,
+	0xc22a, 0x6003, 0x0002, 0x080c, 0x8973, 0x0804, 0xca55, 0x9006,
+	0x080c, 0x617b, 0x0804, 0xca4f, 0x080c, 0x655a, 0x1904, 0xca4f,
+	0x9006, 0x080c, 0x617b, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff,
+	0x1140, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe,
+	0x0428, 0x6010, 0x2058, 0xb8b0, 0x9005, 0x1178, 0x080c, 0xc212,
+	0x1904, 0xca4f, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c,
+	0x4a76, 0x004e, 0x003e, 0x0804, 0xca4f, 0x080c, 0x312e, 0x1904,
+	0xca4f, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6,
+	0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001, 0x0002,
+	0x080c, 0x618f, 0x080c, 0x886e, 0x6023, 0x0001, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x8439, 0x080c, 0x8973, 0x6110, 0x2158,
+	0x2009, 0x0001, 0x080c, 0x8046, 0x0804, 0xca55, 0x6610, 0x2658,
+	0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xca4f,
+	0x9686, 0x0004, 0x0904, 0xca4f, 0x2001, 0x0004, 0x0804, 0xca4d,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046,
+	0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a76, 0x004e,
+	0x003e, 0x2001, 0x0006, 0x080c, 0xca73, 0x6610, 0x2658, 0xbe04,
+	0x0066, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168,
+	0x2001, 0x0006, 0x080c, 0x61bb, 0x9284, 0x00ff, 0x908e, 0x0007,
+	0x1120, 0x2001, 0x0006, 0x080c, 0x618f, 0x080c, 0x655a, 0x11f8,
+	0x2001, 0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff,
+	0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000,
+	0x78a6, 0x00fe, 0x0804, 0xc9d6, 0x2001, 0x0004, 0x0030, 0x2001,
+	0x0006, 0x0449, 0x0020, 0x0018, 0x0010, 0x080c, 0x61bb, 0x080c,
+	0x886e, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0005, 0x2600, 0x0002,
+	0xca6a, 0xca6a, 0xca6a, 0xca6a, 0xca6a, 0xca6c, 0xca6a, 0xca6a,
+	0xca6a, 0xca6a, 0xca6c, 0xca6a, 0xca6a, 0xca6a, 0xca6c, 0xca6c,
+	0xca6c, 0xca6c, 0x080c, 0x0db4, 0x080c, 0x886e, 0x080c, 0x9e32,
+	0x080c, 0x8973, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158,
+	0xb900, 0xd184, 0x0138, 0x080c, 0x618f, 0x9006, 0x080c, 0x617b,
+	0x080c, 0x3003, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658,
+	0xb804, 0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0db4,
+	0x91b6, 0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c,
+	0x0db4, 0x006b, 0x0005, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1,
+	0xa8a1, 0xcaf2, 0xcab3, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1,
+	0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xcaf2, 0xcaf9, 0xa8a1,
+	0xa8a1, 0xa8a1, 0xa8a1, 0x00f6, 0x080c, 0x655a, 0x11d8, 0x080c,
+	0xc212, 0x11c0, 0x6010, 0x905d, 0x01a8, 0xb8b0, 0x9005, 0x0190,
+	0x9006, 0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f, 0x6023,
+	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8439, 0x080c,
+	0x8973, 0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x2663, 0x11b0, 0x080c, 0x623e, 0x0118, 0x080c, 0x9e32, 0x0080,
+	0xb810, 0x0006, 0xb814, 0x0006, 0xb8b0, 0x0006, 0x080c, 0x5ceb,
+	0x000e, 0xb8b2, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0x9e32,
+	0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9e32,
+	0x0005, 0x080c, 0xac85, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x8439, 0x080c, 0x8973, 0x0010, 0x080c, 0x9e32, 0x0005,
+	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c, 0x886e, 0x080c,
+	0x9e62, 0x080c, 0x8973, 0x0005, 0x9182, 0x0040, 0x0002, 0xcb2a,
+	0xcb2a, 0xcb2a, 0xcb2a, 0xcb2c, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a,
+	0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a,
+	0xcb2a, 0xcb2a, 0x080c, 0x0db4, 0x0096, 0x00b6, 0x00d6, 0x00e6,
+	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005, 0x11a8,
+	0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xcb92,
+	0x080c, 0xd836, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
+	0x2011, 0x0200, 0x080c, 0x822f, 0x0020, 0x9026, 0x080c, 0xd76b,
+	0x0c38, 0x080c, 0x0feb, 0x090c, 0x0db4, 0x6003, 0x0007, 0xa867,
+	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
+	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
+	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x688c,
+	0x001e, 0x080c, 0xd836, 0x1904, 0xcbf2, 0x9486, 0x2000, 0x1130,
+	0x2019, 0x0017, 0x080c, 0xd4a6, 0x0804, 0xcbf2, 0x9486, 0x0200,
+	0x1120, 0x080c, 0xd442, 0x0804, 0xcbf2, 0x9486, 0x0400, 0x0120,
+	0x9486, 0x1000, 0x1904, 0xcbf2, 0x2019, 0x0002, 0x080c, 0xd45d,
+	0x0804, 0xcbf2, 0x2069, 0x1a41, 0x6a00, 0xd284, 0x0904, 0xcc5c,
+	0x9284, 0x0300, 0x1904, 0xcc55, 0x6804, 0x9005, 0x0904, 0xcc3d,
+	0x2d78, 0x6003, 0x0007, 0x080c, 0x1004, 0x0904, 0xcbfe, 0x7800,
+	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
+	0x180f, 0x2004, 0xd084, 0x1904, 0xcc60, 0x9006, 0xa802, 0xa867,
+	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
+	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
+	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
+	0x0003, 0x9080, 0xcbfa, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
+	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
+	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
+	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
+	0x080c, 0x688c, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
+	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
+	0x2004, 0xd084, 0x0120, 0x080c, 0x0feb, 0x1904, 0xcba7, 0x6017,
+	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x83f1, 0x080c,
+	0x8973, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
+	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
+	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
+	0x080c, 0x83f1, 0x080c, 0x8973, 0x0828, 0x6868, 0x602e, 0x686c,
+	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x0804, 0xcbf2, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d9, 0x6017, 0xf300,
+	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x0804, 0xcbf2, 0x6017, 0xf500, 0x0c98,
+	0x6017, 0xf600, 0x0804, 0xcc12, 0x6017, 0xf200, 0x0804, 0xcc12,
+	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xcbfa, 0x2005, 0xa87e, 0x2928,
+	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
+	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
+	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
+	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0db4,
+	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0029, 0x20a0, 0x2011, 0xccdc, 0x2041, 0x0001, 0x223d,
+	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
+	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
+	0x2098, 0x0c68, 0x2950, 0x080c, 0x1004, 0x0170, 0x2900, 0xb002,
+	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
+	0x080c, 0x101d, 0x0cc8, 0x080c, 0x101d, 0x0804, 0xcbfe, 0x2548,
+	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
+	0x080c, 0xd4d5, 0x0804, 0xcbf2, 0x8010, 0x0004, 0x801a, 0x0006,
+	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
+	0x6004, 0x908a, 0x0054, 0x1a0c, 0x0db4, 0x9082, 0x0040, 0x0a0c,
+	0x0db4, 0x2008, 0x0804, 0xcd8d, 0x9186, 0x0051, 0x0108, 0x00c0,
+	0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xcd3e, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x82dd, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xcdd5,
+	0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
+	0x0500, 0x190c, 0x0db4, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
+	0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006,
+	0x0016, 0x0026, 0x080c, 0x82dd, 0x002e, 0x001e, 0x000e, 0x00ce,
+	0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0db4, 0x0804,
+	0xceb6, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0x9ec7,
+	0x0005, 0xcd54, 0xcd56, 0xcd56, 0xcd7d, 0xcd54, 0xcd54, 0xcd54,
+	0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54,
+	0xcd54, 0xcd54, 0xcd54, 0xcd54, 0x080c, 0x0db4, 0x080c, 0x886e,
+	0x080c, 0x8973, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c,
+	0xbb17, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xd4d5, 0x6017,
+	0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1958, 0x2004, 0x601a,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x886e,
+	0x080c, 0x8973, 0x080c, 0xbb17, 0x0120, 0x6014, 0x2048, 0x080c,
+	0x101d, 0x080c, 0x9e62, 0x009e, 0x0005, 0x0002, 0xcda1, 0xcdb8,
+	0xcda3, 0xcdcf, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1,
+	0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1,
+	0xcda1, 0x080c, 0x0db4, 0x0096, 0x080c, 0x886e, 0x6014, 0x2048,
+	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
+	0x9eac, 0x0010, 0x6003, 0x0004, 0x080c, 0x8973, 0x009e, 0x0005,
+	0x080c, 0x886e, 0x080c, 0xbb17, 0x0138, 0x6114, 0x0096, 0x2148,
+	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x8204, 0x080c, 0x9e32,
+	0x080c, 0x8973, 0x0005, 0x080c, 0xd72f, 0x0db0, 0x0cc8, 0x080c,
+	0x886e, 0x2009, 0x0041, 0x0804, 0xcf3e, 0x9182, 0x0040, 0x0002,
+	0xcdeb, 0xcded, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb,
+	0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb,
+	0xcdeb, 0xcdee, 0xcdeb, 0x080c, 0x0db4, 0x0005, 0x00d6, 0x080c,
+	0x8204, 0x00de, 0x080c, 0xd787, 0x080c, 0x9e32, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xce0d, 0xce0d, 0xce0d, 0xce0d, 0xce0d, 0xce0d,
+	0xce0d, 0xce0d, 0xce0d, 0xce0f, 0xce7e, 0xce0d, 0xce0d, 0xce0d,
+	0xce0d, 0xce7e, 0xce0d, 0xce0d, 0xce0d, 0x080c, 0x0db4, 0x2001,
+	0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c,
+	0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xce7e, 0x2009, 0x180c,
+	0x2104, 0xd0d4, 0x0904, 0xce7e, 0xc0d4, 0x200a, 0x2009, 0x0105,
+	0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1873,
+	0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x8923, 0x6014,
+	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e,
+	0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c,
+	0x8a4e, 0x2009, 0x0041, 0x009e, 0x0804, 0xcf3e, 0x080c, 0x8a4e,
+	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x8204, 0x009e, 0x0005,
+	0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f,
+	0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
+	0xd1cc, 0x0110, 0x080c, 0x2a77, 0x080c, 0x8a4e, 0x6014, 0x2048,
+	0xa97c, 0xd1ec, 0x1130, 0x080c, 0x8204, 0x080c, 0x9e32, 0x009e,
+	0x0005, 0x080c, 0xd72f, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c,
+	0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x8923, 0x080c, 0x8a4e,
+	0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140,
+	0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e,
+	0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xd4d5, 0x6018,
+	0x9005, 0x1128, 0x2001, 0x1958, 0x2004, 0x8003, 0x601a, 0x6017,
+	0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd,
+	0xcecd, 0xcecf, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd,
+	0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcf1a, 0x080c, 0x0db4, 0x6014,
+	0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xcf3e, 0x6003, 0x0007, 0x601b,
+	0x0000, 0x080c, 0x8204, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58,
+	0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030,
+	0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8,
+	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009,
+	0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003,
+	0x0006, 0x00e9, 0x080c, 0x8206, 0x009e, 0x0005, 0x6003, 0x0002,
+	0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x150f, 0x1904,
+	0xcecf, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e,
+	0x9105, 0x1120, 0x080c, 0x150f, 0x1904, 0xcecf, 0x0005, 0xd2fc,
+	0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009,
+	0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040,
+	0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c,
+	0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005, 0xcf61, 0xcf6d,
+	0xcf79, 0xcf85, 0xcf61, 0xcf61, 0xcf61, 0xcf61, 0xcf68, 0xcf63,
+	0xcf63, 0xcf61, 0xcf61, 0xcf61, 0xcf61, 0xcf63, 0xcf61, 0xcf63,
+	0xcf61, 0x080c, 0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005,
+	0x6014, 0x9005, 0x190c, 0x0db4, 0x0005, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x83f1, 0x0126, 0x2091, 0x8000, 0x080c, 0x8973, 0x012e,
+	0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x83f1, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x8973, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106,
+	0x2c10, 0x080c, 0x1a5c, 0x0126, 0x2091, 0x8000, 0x080c, 0x8456,
+	0x080c, 0x8a4e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
+	0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005,
+	0xcfb0, 0xcfb2, 0xcfc4, 0xcfde, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0,
+	0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0,
+	0x080c, 0x0db4, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c,
+	0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc,
+	0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001,
+	0x6106, 0x080c, 0x83f1, 0x080c, 0x8973, 0x00e0, 0x901e, 0x6316,
+	0x631a, 0x2019, 0x0004, 0x080c, 0xd4d5, 0x00a0, 0x6014, 0x2048,
+	0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1a5c, 0x080c, 0x8456,
+	0x080c, 0x8a4e, 0x0005, 0x080c, 0x886e, 0x6114, 0x81ff, 0x0158,
+	0x0096, 0x2148, 0x080c, 0xd7d3, 0x0036, 0x2019, 0x0029, 0x080c,
+	0xd4d5, 0x003e, 0x009e, 0x080c, 0x9e62, 0x080c, 0x8973, 0x0005,
+	0x080c, 0x8923, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
+	0xd7d3, 0x0036, 0x2019, 0x0029, 0x080c, 0xd4d5, 0x003e, 0x009e,
+	0x080c, 0x9e62, 0x080c, 0x8a4e, 0x0005, 0x9182, 0x0085, 0x0002,
+	0xd02f, 0xd02d, 0xd02d, 0xd03b, 0xd02d, 0xd02d, 0xd02d, 0xd02d,
+	0xd02d, 0xd02d, 0xd02d, 0xd02d, 0xd02d, 0x080c, 0x0db4, 0x6003,
+	0x000b, 0x6106, 0x080c, 0x83f1, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8973, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xd726, 0x0118,
+	0x080c, 0x9e32, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001,
+	0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0,
+	0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0xa152, 0x7220, 0x080c,
+	0xd37b, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224,
+	0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c,
+	0x83f1, 0x080c, 0x8973, 0x080c, 0x8a4e, 0x00ee, 0x002e, 0x0005,
+	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db4,
+	0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085, 0x00a2, 0x9186,
+	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9ec7, 0x0050,
+	0x2001, 0x0007, 0x080c, 0x61bb, 0x080c, 0x886e, 0x080c, 0x9e62,
+	0x080c, 0x8973, 0x0005, 0xd0a0, 0xd0a2, 0xd0a2, 0xd0a0, 0xd0a0,
+	0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0,
+	0x080c, 0x0db4, 0x080c, 0x886e, 0x080c, 0x9e62, 0x080c, 0x8973,
+	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0db4, 0x9182, 0x0092, 0x1a0c,
+	0x0db4, 0x9182, 0x0085, 0x0002, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c3,
+	0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1,
+	0xd0c1, 0x080c, 0x0db4, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9ec7, 0x0030,
+	0x080c, 0x886e, 0x080c, 0x9e62, 0x080c, 0x8973, 0x0005, 0x0036,
+	0x080c, 0xd787, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
+	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
+	0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x97ba, 0x009e,
+	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0x9865, 0x007e, 0x1520,
+	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
+	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd787, 0x080c, 0xc22a,
+	0x080c, 0x190d, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xbb17,
+	0x0110, 0x080c, 0xd4d5, 0x009e, 0x6017, 0x0000, 0x080c, 0xd787,
+	0x6023, 0x0007, 0x080c, 0xc22a, 0x003e, 0x012e, 0x0005, 0x00f6,
+	0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c,
+	0x080c, 0x2663, 0x15c8, 0x0016, 0x00c6, 0x080c, 0x623e, 0x1590,
+	0x001e, 0x00c6, 0x2160, 0x080c, 0xc227, 0x00ce, 0x002e, 0x0026,
+	0x0016, 0x2019, 0x0029, 0x080c, 0x9926, 0x080c, 0x8571, 0x0076,
+	0x903e, 0x080c, 0x8469, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
+	0xd29b, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286,
+	0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x3097,
+	0x002e, 0xbcb0, 0x001e, 0x080c, 0x5ceb, 0xbe12, 0xbd16, 0xbcb2,
 	0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce,
 	0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1823,
-	0x2104, 0x9086, 0x0074, 0x1904, 0xd1a3, 0x2069, 0x0260, 0x6944,
-	0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xd1a0,
+	0x2104, 0x9086, 0x0074, 0x1904, 0xd1c3, 0x2069, 0x0260, 0x6944,
+	0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xd1c0,
 	0x2001, 0x194d, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8b0,
 	0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001,
-	0x0648, 0x080c, 0xd81b, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009,
+	0x0648, 0x080c, 0xd83b, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009,
 	0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182,
 	0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001,
 	0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100,
@@ -6507,105 +6511,105 @@ unsigned short risc_code01[] = {
 	0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff,
 	0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00,
 	0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c,
-	0x6246, 0x0804, 0xd20a, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
-	0x2b48, 0x2019, 0x000a, 0x080c, 0xadf4, 0x009e, 0x15a0, 0x2011,
+	0x624d, 0x0804, 0xd22a, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x000a, 0x080c, 0xae0d, 0x009e, 0x15a0, 0x2011,
 	0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
-	0xadf4, 0x009e, 0x1540, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006,
-	0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c, 0xd50a,
-	0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x8549, 0x0076,
-	0x2039, 0x0000, 0x080c, 0x8441, 0x2c08, 0x080c, 0xd27b, 0x007e,
-	0x2001, 0x0007, 0x080c, 0x61b4, 0x2001, 0x0007, 0x080c, 0x6188,
+	0xae0d, 0x009e, 0x1540, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006,
+	0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c, 0xd52a,
+	0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x8571, 0x0076,
+	0x2039, 0x0000, 0x080c, 0x8469, 0x2c08, 0x080c, 0xd29b, 0x007e,
+	0x2001, 0x0007, 0x080c, 0x61bb, 0x2001, 0x0007, 0x080c, 0x618f,
 	0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce,
 	0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118,
 	0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6,
 	0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834,
-	0x080c, 0x2663, 0x11d0, 0x080c, 0x6237, 0x11b8, 0x2011, 0x0270,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xadf4,
+	0x080c, 0x2663, 0x11d0, 0x080c, 0x623e, 0x11b8, 0x2011, 0x0270,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xae0d,
 	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x0006, 0x080c, 0xadf4, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x2019, 0x0006, 0x080c, 0xae0d, 0x009e, 0x015e, 0x003e, 0x002e,
 	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
 	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x2663, 0x11d0, 0x080c, 0x6237, 0x11b8, 0x2011, 0x0276, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xadf4, 0x009e,
+	0x2663, 0x11d0, 0x080c, 0x623e, 0x11b8, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xae0d, 0x009e,
 	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x0006, 0x080c, 0xadf4, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x0006, 0x080c, 0xae0d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
 	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
 	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029,
 	0x19c1, 0x252c, 0x2021, 0x19c7, 0x2424, 0x2061, 0x1cd0, 0x2071,
 	0x1800, 0x7650, 0x7070, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1a80,
-	0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd314, 0x0018, 0x9606,
-	0x0904, 0xd314, 0x2100, 0x9c06, 0x0904, 0xd30b, 0x080c, 0xd54b,
-	0x1904, 0xd30b, 0x080c, 0xd838, 0x0904, 0xd30b, 0x080c, 0xd53b,
-	0x0904, 0xd30b, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x3127,
-	0x0904, 0xd32f, 0x6004, 0x9086, 0x0000, 0x1904, 0xd32f, 0x9786,
-	0x0004, 0x0904, 0xd32f, 0x9786, 0x0007, 0x0904, 0xd30b, 0x2500,
-	0x9c06, 0x0904, 0xd30b, 0x2400, 0x9c06, 0x05e8, 0x88ff, 0x0118,
+	0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd334, 0x0018, 0x9606,
+	0x0904, 0xd334, 0x2100, 0x9c06, 0x0904, 0xd32b, 0x080c, 0xd56b,
+	0x1904, 0xd32b, 0x080c, 0xd858, 0x0904, 0xd32b, 0x080c, 0xd55b,
+	0x0904, 0xd32b, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x312e,
+	0x0904, 0xd34f, 0x6004, 0x9086, 0x0000, 0x1904, 0xd34f, 0x9786,
+	0x0004, 0x0904, 0xd34f, 0x9786, 0x0007, 0x0904, 0xd32b, 0x2500,
+	0x9c06, 0x0904, 0xd32b, 0x2400, 0x9c06, 0x05e8, 0x88ff, 0x0118,
 	0x6054, 0x9906, 0x15c0, 0x0096, 0x6000, 0x9086, 0x0004, 0x1120,
 	0x0016, 0x080c, 0x190d, 0x001e, 0x9786, 0x000a, 0x0148, 0x080c,
-	0xbd04, 0x1130, 0x080c, 0xa7a7, 0x009e, 0x080c, 0x9e49, 0x0418,
-	0x6014, 0x2048, 0x080c, 0xbafe, 0x01d8, 0x9786, 0x0003, 0x1570,
+	0xbd1d, 0x1130, 0x080c, 0xa7c0, 0x009e, 0x080c, 0x9e62, 0x0418,
+	0x6014, 0x2048, 0x080c, 0xbb17, 0x01d8, 0x9786, 0x0003, 0x1570,
 	0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
-	0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0xd7b3,
-	0x0016, 0x080c, 0xbded, 0x080c, 0x6878, 0x001e, 0x080c, 0xbce7,
-	0x009e, 0x080c, 0x9e49, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1210, 0x0804, 0xd28f, 0x012e, 0x002e, 0x004e, 0x005e,
+	0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0xd7d3,
+	0x0016, 0x080c, 0xbe06, 0x080c, 0x687f, 0x001e, 0x080c, 0xbd00,
+	0x009e, 0x080c, 0x9e62, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x1210, 0x0804, 0xd2af, 0x012e, 0x002e, 0x004e, 0x005e,
 	0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006,
-	0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd7b3, 0x080c, 0xd4b5,
+	0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd7d3, 0x080c, 0xd4d5,
 	0x08f8, 0x009e, 0x0c00, 0x9786, 0x000a, 0x0920, 0x0808, 0x81ff,
 	0x09d0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130, 0x9180,
 	0x0001, 0x2004, 0x9086, 0x002d, 0x1970, 0x6000, 0x9086, 0x0002,
-	0x1950, 0x080c, 0xbcf3, 0x0130, 0x080c, 0xbd04, 0x1920, 0x080c,
-	0xa7a7, 0x0038, 0x080c, 0x2ffc, 0x080c, 0xbd04, 0x1110, 0x080c,
-	0xa7a7, 0x080c, 0x9e49, 0x0804, 0xd30b, 0xa864, 0x9084, 0x00ff,
+	0x1950, 0x080c, 0xbd0c, 0x0130, 0x080c, 0xbd1d, 0x1920, 0x080c,
+	0xa7c0, 0x0038, 0x080c, 0x3003, 0x080c, 0xbd1d, 0x1110, 0x080c,
+	0xa7c0, 0x080c, 0x9e62, 0x0804, 0xd32b, 0xa864, 0x9084, 0x00ff,
 	0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170,
-	0x9006, 0x080c, 0xd4dc, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f,
-	0x001b, 0x00ee, 0x00ce, 0x0005, 0xd37a, 0xd37a, 0xd37a, 0xd37a,
-	0xd37a, 0xd37a, 0xd37c, 0xd37a, 0xd37a, 0xd37a, 0xd37a, 0x9e49,
-	0x9e49, 0xd37a, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010,
+	0x9006, 0x080c, 0xd4fc, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f,
+	0x001b, 0x00ee, 0x00ce, 0x0005, 0xd39a, 0xd39a, 0xd39a, 0xd39a,
+	0xd39a, 0xd39a, 0xd39c, 0xd39a, 0xd39a, 0xd39a, 0xd39a, 0x9e62,
+	0x9e62, 0xd39a, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010,
 	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c,
-	0xd50a, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xd0c7, 0x003e,
-	0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xbafe, 0x0140, 0x6014,
-	0x904d, 0x080c, 0xb731, 0x687b, 0x0005, 0x080c, 0x6885, 0x009e,
-	0x080c, 0x9e49, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c,
-	0x6174, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0276, 0x080c, 0xade0, 0x003e, 0x002e, 0x001e,
+	0xd52a, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xd0e5, 0x003e,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xbb17, 0x0140, 0x6014,
+	0x904d, 0x080c, 0xb74a, 0x687b, 0x0005, 0x080c, 0x688c, 0x009e,
+	0x080c, 0x9e62, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c,
+	0x617b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0276, 0x080c, 0xadf9, 0x003e, 0x002e, 0x001e,
 	0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076,
 	0x0066, 0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1cd0,
-	0x2079, 0x0001, 0x8fff, 0x0904, 0xd415, 0x2071, 0x1800, 0x7650,
-	0x7070, 0x8001, 0x9602, 0x1a04, 0xd415, 0x88ff, 0x0120, 0x2800,
-	0x9c06, 0x1590, 0x2078, 0x080c, 0xd53b, 0x0570, 0x2400, 0x9c06,
+	0x2079, 0x0001, 0x8fff, 0x0904, 0xd435, 0x2071, 0x1800, 0x7650,
+	0x7070, 0x8001, 0x9602, 0x1a04, 0xd435, 0x88ff, 0x0120, 0x2800,
+	0x9c06, 0x1590, 0x2078, 0x080c, 0xd55b, 0x0570, 0x2400, 0x9c06,
 	0x0558, 0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007, 0x0520,
 	0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118, 0x6054,
-	0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd767,
-	0x080c, 0xc211, 0x080c, 0x190d, 0x6023, 0x0007, 0x6014, 0x2048,
-	0x080c, 0xbafe, 0x0120, 0x0046, 0x080c, 0xd4b5, 0x004e, 0x009e,
-	0x080c, 0x9e49, 0x88ff, 0x1198, 0x9ce0, 0x0018, 0x2001, 0x1819,
-	0x2004, 0x9c02, 0x1210, 0x0804, 0xd3ca, 0x9006, 0x012e, 0x00be,
+	0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd787,
+	0x080c, 0xc22a, 0x080c, 0x190d, 0x6023, 0x0007, 0x6014, 0x2048,
+	0x080c, 0xbb17, 0x0120, 0x0046, 0x080c, 0xd4d5, 0x004e, 0x009e,
+	0x080c, 0x9e62, 0x88ff, 0x1198, 0x9ce0, 0x0018, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1210, 0x0804, 0xd3ea, 0x9006, 0x012e, 0x00be,
 	0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5,
 	0x0001, 0x0ca0, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046, 0x2029,
 	0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096, 0x904e,
-	0x080c, 0x97a1, 0x009e, 0x008e, 0x903e, 0x080c, 0x984c, 0x080c,
-	0xd3bb, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056,
+	0x080c, 0x97ba, 0x009e, 0x008e, 0x903e, 0x080c, 0x9865, 0x080c,
+	0xd3db, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056,
 	0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e,
-	0x0016, 0x0036, 0x080c, 0x6237, 0x1190, 0x0056, 0x0086, 0x9046,
-	0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x97a1, 0x009e,
-	0x008e, 0x903e, 0x080c, 0x984c, 0x080c, 0xd3bb, 0x005e, 0x003e,
-	0x001e, 0x8108, 0x1f04, 0xd448, 0x015e, 0x00ce, 0x007e, 0x005e,
+	0x0016, 0x0036, 0x080c, 0x623e, 0x1190, 0x0056, 0x0086, 0x9046,
+	0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x97ba, 0x009e,
+	0x008e, 0x903e, 0x080c, 0x9865, 0x080c, 0xd3db, 0x005e, 0x003e,
+	0x001e, 0x8108, 0x1f04, 0xd468, 0x015e, 0x00ce, 0x007e, 0x005e,
 	0x004e, 0x00be, 0x0005, 0x00b6, 0x0076, 0x0056, 0x6210, 0x2258,
 	0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x904e,
-	0x080c, 0x97a1, 0x009e, 0x008e, 0x903e, 0x080c, 0x984c, 0x2c20,
-	0x080c, 0xd3bb, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046,
+	0x080c, 0x97ba, 0x009e, 0x008e, 0x903e, 0x080c, 0x9865, 0x2c20,
+	0x080c, 0xd3db, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046,
 	0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e,
-	0x0016, 0x0036, 0x080c, 0x6237, 0x11a0, 0x0086, 0x9046, 0x2828,
-	0x0046, 0x2021, 0x0001, 0x080c, 0xd74b, 0x004e, 0x0096, 0x904e,
-	0x080c, 0x97a1, 0x009e, 0x008e, 0x903e, 0x080c, 0x984c, 0x080c,
-	0xd3bb, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd490, 0x015e, 0x00ce,
+	0x0016, 0x0036, 0x080c, 0x623e, 0x11a0, 0x0086, 0x9046, 0x2828,
+	0x0046, 0x2021, 0x0001, 0x080c, 0xd76b, 0x004e, 0x0096, 0x904e,
+	0x080c, 0x97ba, 0x009e, 0x008e, 0x903e, 0x080c, 0x9865, 0x080c,
+	0xd3db, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd4b0, 0x015e, 0x00ce,
 	0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x0016, 0x00f6, 0x080c,
-	0xbafc, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180,
-	0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x6885,
-	0x2f48, 0x0cb0, 0xab82, 0x080c, 0x6885, 0x00fe, 0x001e, 0x0005,
-	0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6885, 0x2f48,
-	0x0cb8, 0x080c, 0x6885, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061,
+	0xbb15, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180,
+	0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x688c,
+	0x2f48, 0x0cb0, 0xab82, 0x080c, 0x688c, 0x00fe, 0x001e, 0x0005,
+	0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x688c, 0x2f48,
+	0x0cb8, 0x080c, 0x688c, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061,
 	0x1cd0, 0x9005, 0x1138, 0x2071, 0x1800, 0x7450, 0x7070, 0x8001,
 	0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086, 0x0000,
 	0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004, 0x2424,
@@ -6613,43 +6617,43 @@ unsigned short risc_code01[] = {
 	0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e,
 	0x00ee, 0x0005, 0x0096, 0x0006, 0x080c, 0x0feb, 0x000e, 0x090c,
 	0x0db4, 0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c,
-	0xbaec, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0015, 0x2004,
+	0xbb05, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0015, 0x2004,
 	0x002e, 0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff, 0xa986,
 	0xac76, 0xa87f, 0x0000, 0x2001, 0x195f, 0x2004, 0xa882, 0x9006,
-	0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6885,
+	0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x688c,
 	0x012e, 0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786,
 	0x0001, 0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110,
 	0x9085, 0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6,
 	0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085, 0x0001,
 	0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134,
 	0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0005, 0x2001, 0x1958, 0x2004, 0x601a, 0x080c, 0x83c9,
-	0x080c, 0x894b, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024,
-	0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbe31, 0x0030, 0x080c,
-	0xd767, 0x080c, 0x81dc, 0x080c, 0x9e19, 0x0005, 0x9280, 0x0008,
-	0x2004, 0x9084, 0x000f, 0x0002, 0xd59a, 0xd59a, 0xd59a, 0xd59c,
-	0xd59a, 0xd59c, 0xd59c, 0xd59a, 0xd59c, 0xd59a, 0xd59a, 0xd59a,
-	0xd59a, 0xd59a, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280,
-	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd5b3, 0xd5b3, 0xd5b3,
-	0xd5b3, 0xd5b3, 0xd5b3, 0xd5c0, 0xd5b3, 0xd5b3, 0xd5b3, 0xd5b3,
-	0xd5b3, 0xd5b3, 0xd5b3, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017,
-	0x2a00, 0x6003, 0x0001, 0x080c, 0x83c9, 0x080c, 0x894b, 0x0005,
-	0x0096, 0x00c6, 0x2260, 0x080c, 0xd767, 0x6043, 0x0000, 0x6024,
+	0x6023, 0x0005, 0x2001, 0x1958, 0x2004, 0x601a, 0x080c, 0x83f1,
+	0x080c, 0x8973, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024,
+	0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbe4a, 0x0030, 0x080c,
+	0xd787, 0x080c, 0x8204, 0x080c, 0x9e32, 0x0005, 0x9280, 0x0008,
+	0x2004, 0x9084, 0x000f, 0x0002, 0xd5ba, 0xd5ba, 0xd5ba, 0xd5bc,
+	0xd5ba, 0xd5bc, 0xd5bc, 0xd5ba, 0xd5bc, 0xd5ba, 0xd5ba, 0xd5ba,
+	0xd5ba, 0xd5ba, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280,
+	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd5d3, 0xd5d3, 0xd5d3,
+	0xd5d3, 0xd5d3, 0xd5d3, 0xd5e0, 0xd5d3, 0xd5d3, 0xd5d3, 0xd5d3,
+	0xd5d3, 0xd5d3, 0xd5d3, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017,
+	0x2a00, 0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x0005,
+	0x0096, 0x00c6, 0x2260, 0x080c, 0xd787, 0x6043, 0x0000, 0x6024,
 	0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268,
-	0x9186, 0x0007, 0x1904, 0xd619, 0x6814, 0x9005, 0x0138, 0x2048,
+	0x9186, 0x0007, 0x1904, 0xd639, 0x6814, 0x9005, 0x0138, 0x2048,
 	0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a,
-	0x6003, 0x0001, 0x080c, 0x83c9, 0x080c, 0x894b, 0x00c6, 0x2d60,
-	0x6100, 0x9186, 0x0002, 0x1904, 0xd690, 0x6014, 0x9005, 0x1138,
-	0x6000, 0x9086, 0x0007, 0x190c, 0x0db4, 0x0804, 0xd690, 0x2048,
-	0x080c, 0xbafe, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0,
+	0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x00c6, 0x2d60,
+	0x6100, 0x9186, 0x0002, 0x1904, 0xd6b0, 0x6014, 0x9005, 0x1138,
+	0x6000, 0x9086, 0x0007, 0x190c, 0x0db4, 0x0804, 0xd6b0, 0x2048,
+	0x080c, 0xbb17, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0,
 	0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1168,
 	0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009,
-	0x0043, 0x080c, 0xcf20, 0x0804, 0xd690, 0x2009, 0x0041, 0x0804,
-	0xd68a, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc,
-	0x1120, 0x00de, 0x009e, 0x0804, 0xd5b3, 0xd0b4, 0x0128, 0xd0fc,
-	0x090c, 0x0db4, 0x0804, 0xd5d4, 0x6007, 0x003a, 0x6003, 0x0001,
-	0x080c, 0x83c9, 0x080c, 0x894b, 0x00c6, 0x2d60, 0x6100, 0x9186,
-	0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd690, 0x6814, 0x2048,
+	0x0043, 0x080c, 0xcf3e, 0x0804, 0xd6b0, 0x2009, 0x0041, 0x0804,
+	0xd6aa, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc,
+	0x1120, 0x00de, 0x009e, 0x0804, 0xd5d3, 0xd0b4, 0x0128, 0xd0fc,
+	0x090c, 0x0db4, 0x0804, 0xd5f4, 0x6007, 0x003a, 0x6003, 0x0001,
+	0x080c, 0x83f1, 0x080c, 0x8973, 0x00c6, 0x2d60, 0x6100, 0x9186,
+	0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd6b0, 0x6814, 0x2048,
 	0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982,
 	0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x2009, 0x0042, 0x04d0,
 	0x0036, 0x080c, 0x0feb, 0x090c, 0x0db4, 0xa867, 0x010d, 0x9006,
@@ -6657,24 +6661,24 @@ unsigned short risc_code01[] = {
 	0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010,
 	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x6354, 0xab7a, 0xa876,
 	0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c,
-	0x6885, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xd0c7, 0x2d00,
+	0x688c, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xd0e5, 0x2d00,
 	0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a, 0x6342,
-	0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c, 0xcf20,
+	0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c, 0xcf3e,
 	0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
 	0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c,
-	0x8846, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c,
-	0xd4b5, 0x009e, 0x003e, 0x080c, 0x894b, 0x0005, 0x9186, 0x0014,
-	0x0d70, 0x080c, 0x9eae, 0x0005, 0xd6c3, 0xd6c1, 0xd6c1, 0xd6c1,
-	0xd6c1, 0xd6c1, 0xd6c3, 0xd6c1, 0xd6c1, 0xd6c1, 0xd6c1, 0xd6c1,
-	0xd6c1, 0x080c, 0x0db4, 0x080c, 0x8846, 0x6003, 0x000c, 0x080c,
-	0x894b, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
-	0x001a, 0x080c, 0x9eae, 0x0005, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1,
-	0xd6e3, 0xd703, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1,
-	0xd6e1, 0x080c, 0x0db4, 0x00d6, 0x2c68, 0x080c, 0x9dc3, 0x01b0,
+	0x886e, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c,
+	0xd4d5, 0x009e, 0x003e, 0x080c, 0x8973, 0x0005, 0x9186, 0x0014,
+	0x0d70, 0x080c, 0x9ec7, 0x0005, 0xd6e3, 0xd6e1, 0xd6e1, 0xd6e1,
+	0xd6e1, 0xd6e1, 0xd6e3, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1,
+	0xd6e1, 0x080c, 0x0db4, 0x080c, 0x886e, 0x6003, 0x000c, 0x080c,
+	0x8973, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
+	0x001a, 0x080c, 0x9ec7, 0x0005, 0xd701, 0xd701, 0xd701, 0xd701,
+	0xd703, 0xd723, 0xd701, 0xd701, 0xd701, 0xd701, 0xd701, 0xd701,
+	0xd701, 0x080c, 0x0db4, 0x00d6, 0x2c68, 0x080c, 0x9ddc, 0x01b0,
 	0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, 0x613a,
 	0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, 0x6112,
-	0x6023, 0x0004, 0x080c, 0x83c9, 0x080c, 0x894b, 0x2d60, 0x080c,
-	0x9e19, 0x00de, 0x0005, 0x080c, 0x9e19, 0x0005, 0x00e6, 0x6010,
+	0x6023, 0x0004, 0x080c, 0x83f1, 0x080c, 0x8973, 0x2d60, 0x080c,
+	0x9e32, 0x00de, 0x0005, 0x080c, 0x9e32, 0x0005, 0x00e6, 0x6010,
 	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009,
 	0x1873, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5,
 	0x6026, 0xd0cc, 0x0150, 0x2001, 0x1959, 0x2004, 0x6042, 0x2009,
@@ -6685,17 +6689,17 @@ unsigned short risc_code01[] = {
 	0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000,
 	0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6154, 0xb8ac,
 	0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6054, 0x9106, 0x1138,
-	0x600c, 0x2072, 0x080c, 0x81dc, 0x080c, 0x9e19, 0x0010, 0x9cf0,
+	0x600c, 0x2072, 0x080c, 0x8204, 0x080c, 0x9e32, 0x0010, 0x9cf0,
 	0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6,
 	0x00b6, 0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130, 0x9c06,
 	0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de, 0x0005,
 	0x0026, 0x0036, 0x0156, 0x2011, 0x182b, 0x2204, 0x9084, 0x00ff,
 	0x2019, 0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334, 0x2204,
 	0x9084, 0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004,
-	0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xadf4, 0x009e,
+	0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xae0d, 0x009e,
 	0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
-	0x2019, 0x0006, 0x080c, 0xadf4, 0x009e, 0x1100, 0x015e, 0x003e,
-	0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c5d, 0x080c,
+	0x2019, 0x0006, 0x080c, 0xae0d, 0x009e, 0x1100, 0x015e, 0x003e,
+	0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c64, 0x080c,
 	0x2dbb, 0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
 	0x00be, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5,
 	0xa882, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056,
@@ -6703,17 +6707,17 @@ unsigned short risc_code01[] = {
 	0x252c, 0x2021, 0x19c7, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800,
 	0x7650, 0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118,
 	0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06,
-	0x01d0, 0x080c, 0xd53b, 0x01b8, 0x080c, 0xd54b, 0x11a0, 0x6000,
+	0x01d0, 0x080c, 0xd55b, 0x01b8, 0x080c, 0xd56b, 0x11a0, 0x6000,
 	0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x190d, 0x001e, 0x080c,
-	0xbcf3, 0x1110, 0x080c, 0x2ffc, 0x080c, 0xbd04, 0x1110, 0x080c,
-	0xa7a7, 0x080c, 0x9e49, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
+	0xbd0c, 0x1110, 0x080c, 0x3003, 0x080c, 0xbd1d, 0x1110, 0x080c,
+	0xa7c0, 0x080c, 0x9e62, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
 	0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e,
 	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810,
 	0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004, 0xd09c,
-	0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xc1f9, 0x0168,
+	0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xc212, 0x0168,
 	0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0,
-	0x00be, 0x2021, 0x0004, 0x080c, 0x4a6f, 0x004e, 0x003e, 0x000e,
-	0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x990d, 0x080c, 0x9e49,
+	0x00be, 0x2021, 0x0004, 0x080c, 0x4a76, 0x004e, 0x003e, 0x000e,
+	0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x9926, 0x080c, 0x9e62,
 	0x9006, 0x0005, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1cd0,
 	0x2071, 0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12b8, 0x2100,
 	0x9c06, 0x0148, 0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058,
@@ -6881,11 +6885,11 @@ unsigned short risc_code01[] = {
 	0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x022a, 0x000b, 0x15b6,
 	0xf4ac, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040,
 	0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000,
-	0x8000, 0xbd16
+	0x8000, 0x89e3
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300flx_length01 = 0xd57a;
+unsigned short fw2300flx_length01 = 0xd59a;
 #else
-unsigned short risc_code_length01 = 0xd57a;
+unsigned short risc_code_length01 = 0xd59a;
 #endif
 
diff --git a/drivers/scsi/qla2xxx/ql6322_fw.c b/drivers/scsi/qla2xxx/ql6322_fw.c
index 384994a56..f8744fa9b 100644
--- a/drivers/scsi/qla2xxx/ql6322_fw.c
+++ b/drivers/scsi/qla2xxx/ql6322_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.26 (08:08 Mar 11, 2004)
+ *	Firmware Version 3.02.28 (14:05 Apr 03, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2322flx_version_str[] = {3, 2,26};
+unsigned char fw2322flx_version_str[] = {3, 2,28};
 #else
-unsigned char firmware_version[] = {3, 2,26};
+unsigned char firmware_version[] = {3, 2,28};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2322flx_VERSION_STRING "3.02.26"
+#define fw2322flx_VERSION_STRING "3.02.28"
 #else
-#define FW_VERSION_STRING "3.02.26"
+#define FW_VERSION_STRING "3.02.28"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2322flx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xce19, 0x0000, 0x0003, 0x0002, 0x001a,
+	0x0470, 0x0000, 0x0000, 0xce3b, 0x0000, 0x0003, 0x0002, 0x001c,
 	0x0317, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3620, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -82,94 +82,94 @@ unsigned short risc_code01[] = {
 	0x20a8, 0x900e, 0x4104, 0x2009, 0x1800, 0x810d, 0x810d, 0x810d,
 	0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9,
 	0x0001, 0x20a1, 0x0800, 0x900e, 0x20a9, 0x0800, 0x4104, 0x8211,
-	0x1dd8, 0x080c, 0x0f3a, 0x080c, 0x5ce3, 0x080c, 0x9b62, 0x080c,
-	0x10f1, 0x080c, 0x12d6, 0x080c, 0x1a5a, 0x080c, 0x8418, 0x080c,
-	0x0cf7, 0x080c, 0x1076, 0x080c, 0x3284, 0x080c, 0x73c0, 0x080c,
-	0x671b, 0x080c, 0x8062, 0x080c, 0x20dd, 0x080c, 0x7a54, 0x080c,
+	0x1dd8, 0x080c, 0x0f3a, 0x080c, 0x5cea, 0x080c, 0x9b7d, 0x080c,
+	0x10f1, 0x080c, 0x12d6, 0x080c, 0x1a5a, 0x080c, 0x8440, 0x080c,
+	0x0cf7, 0x080c, 0x1076, 0x080c, 0x328b, 0x080c, 0x73cb, 0x080c,
+	0x6722, 0x080c, 0x808a, 0x080c, 0x20dd, 0x080c, 0x7a5f, 0x080c,
 	0x1f2b, 0x080c, 0x2065, 0x080c, 0x20d2, 0x2091, 0x3009, 0x7883,
 	0x0000, 0x1004, 0x0941, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883,
 	0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, 0x0935, 0x2091,
 	0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
 	0x11be, 0x2071, 0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000,
-	0x908e, 0x0003, 0x1158, 0x080c, 0x4996, 0x080c, 0x32ab, 0x080c,
-	0x7428, 0x080c, 0x6bc3, 0x080c, 0x808b, 0x0c78, 0x000b, 0x0c98,
+	0x908e, 0x0003, 0x1158, 0x080c, 0x499d, 0x080c, 0x32b2, 0x080c,
+	0x7433, 0x080c, 0x6bca, 0x080c, 0x80b3, 0x0c78, 0x000b, 0x0c98,
 	0x0962, 0x0963, 0x0afa, 0x0960, 0x0bab, 0x0cf6, 0x0cf6, 0x0cf6,
 	0x080c, 0x0d65, 0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000,
-	0x9086, 0x0001, 0x1904, 0x0acd, 0x080c, 0x0e8d, 0x080c, 0x70ac,
-	0x0150, 0x080c, 0x70cf, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085,
-	0x1800, 0x782a, 0x0478, 0x080c, 0x6fdd, 0x7000, 0x9086, 0x0001,
+	0x9086, 0x0001, 0x1904, 0x0acd, 0x080c, 0x0e8d, 0x080c, 0x70b7,
+	0x0150, 0x080c, 0x70da, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085,
+	0x1800, 0x782a, 0x0478, 0x080c, 0x6fe8, 0x7000, 0x9086, 0x0001,
 	0x1904, 0x0acd, 0x7094, 0x9086, 0x0028, 0x1904, 0x0acd, 0x080c,
-	0x805a, 0x080c, 0x804c, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079,
+	0x8082, 0x080c, 0x8074, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079,
 	0x0100, 0x2011, 0xffff, 0x080c, 0x286d, 0x7a28, 0x9295, 0x5e2c,
-	0x7a2a, 0x2011, 0x6f22, 0x080c, 0x8131, 0x2011, 0x6f15, 0x080c,
-	0x8237, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x2011, 0x8030, 0x901e,
-	0x7392, 0x04d0, 0x080c, 0x53e7, 0x2079, 0x0100, 0x7844, 0x9005,
-	0x1904, 0x0acd, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x2011, 0x6f22,
-	0x080c, 0x8131, 0x2011, 0x6f15, 0x080c, 0x8237, 0x2001, 0x0265,
+	0x7a2a, 0x2011, 0x6f2d, 0x080c, 0x8159, 0x2011, 0x6f20, 0x080c,
+	0x825f, 0x2011, 0x5b41, 0x080c, 0x8159, 0x2011, 0x8030, 0x901e,
+	0x7392, 0x04d0, 0x080c, 0x53ee, 0x2079, 0x0100, 0x7844, 0x9005,
+	0x1904, 0x0acd, 0x2011, 0x5b41, 0x080c, 0x8159, 0x2011, 0x6f2d,
+	0x080c, 0x8159, 0x2011, 0x6f20, 0x080c, 0x825f, 0x2001, 0x0265,
 	0x2001, 0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842,
 	0x2001, 0x1977, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100,
-	0x080c, 0x5c8b, 0x00ce, 0x0804, 0x0acd, 0x780f, 0x006b, 0x7a28,
-	0x080c, 0x70b4, 0x0118, 0x9295, 0x5e2c, 0x0010, 0x9295, 0x402c,
+	0x080c, 0x5c92, 0x00ce, 0x0804, 0x0acd, 0x780f, 0x006b, 0x7a28,
+	0x080c, 0x70bf, 0x0118, 0x9295, 0x5e2c, 0x0010, 0x9295, 0x402c,
 	0x7a2a, 0x2011, 0x8010, 0x73d4, 0x2001, 0x1978, 0x2003, 0x0001,
-	0x080c, 0x273f, 0x080c, 0x48d1, 0x7244, 0xc284, 0x7246, 0x2001,
+	0x080c, 0x273f, 0x080c, 0x48d8, 0x7244, 0xc284, 0x7246, 0x2001,
 	0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x2001, 0x0390, 0x2003,
-	0x0400, 0x080c, 0x98ad, 0x080c, 0x91c6, 0x2011, 0x0004, 0x080c,
-	0xb83c, 0x080c, 0x98c9, 0x080c, 0x655b, 0x080c, 0x70ac, 0x1120,
-	0x080c, 0x279a, 0x0600, 0x0420, 0x080c, 0x5c92, 0x0140, 0x7093,
-	0x0001, 0x70cf, 0x0000, 0x080c, 0x55b4, 0x0804, 0x0acd, 0x080c,
-	0x5386, 0xd094, 0x01a8, 0x2001, 0x0390, 0x2003, 0x0404, 0x2011,
-	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x538a, 0xd0d4, 0x1118,
+	0x0400, 0x080c, 0x98c8, 0x080c, 0x91e1, 0x2011, 0x0004, 0x080c,
+	0xb857, 0x080c, 0x98e4, 0x080c, 0x6562, 0x080c, 0x70b7, 0x1120,
+	0x080c, 0x279a, 0x0600, 0x0420, 0x080c, 0x5c99, 0x0140, 0x7093,
+	0x0001, 0x70cf, 0x0000, 0x080c, 0x55bb, 0x0804, 0x0acd, 0x080c,
+	0x538d, 0xd094, 0x01a8, 0x2001, 0x0390, 0x2003, 0x0404, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5391, 0xd0d4, 0x1118,
 	0x080c, 0x279a, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
-	0x080c, 0x538a, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x6658,
-	0x0008, 0x2012, 0x080c, 0x661e, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
-	0x00a8, 0x707b, 0x0000, 0x080c, 0x70ac, 0x1130, 0x70ac, 0x9005,
-	0x1168, 0x080c, 0xbc93, 0x0050, 0x080c, 0xbc93, 0x70d8, 0xd09c,
-	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c68, 0x70e3, 0x0000,
+	0x080c, 0x5391, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x665f,
+	0x0008, 0x2012, 0x080c, 0x6625, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
+	0x00a8, 0x707b, 0x0000, 0x080c, 0x70b7, 0x1130, 0x70ac, 0x9005,
+	0x1168, 0x080c, 0xbcae, 0x0050, 0x080c, 0xbcae, 0x70d8, 0xd09c,
+	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c6f, 0x70e3, 0x0000,
 	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x27a2, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x70ac, 0x1178,
+	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x70b7, 0x1178,
 	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193e, 0x211a, 0x001e,
 	0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019,
 	0x193e, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
-	0xc295, 0x72da, 0x080c, 0x70ac, 0x0118, 0x9296, 0x0004, 0x0518,
-	0x2011, 0x0001, 0x080c, 0xb83c, 0x70a7, 0x0000, 0x70ab, 0xffff,
-	0x7003, 0x0002, 0x00fe, 0x080c, 0x2ddb, 0x080c, 0x98ad, 0x2011,
-	0x0005, 0x080c, 0x931e, 0x080c, 0x98c9, 0x080c, 0x70ac, 0x0148,
+	0xc295, 0x72da, 0x080c, 0x70b7, 0x0118, 0x9296, 0x0004, 0x0518,
+	0x2011, 0x0001, 0x080c, 0xb857, 0x70a7, 0x0000, 0x70ab, 0xffff,
+	0x7003, 0x0002, 0x00fe, 0x080c, 0x2ddb, 0x080c, 0x98c8, 0x2011,
+	0x0005, 0x080c, 0x9339, 0x080c, 0x98e4, 0x080c, 0x70b7, 0x0148,
 	0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002, 0x61e2, 0x001e,
 	0x00ce, 0x012e, 0x00e0, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003,
-	0x0002, 0x080c, 0x98ad, 0x2011, 0x0005, 0x080c, 0x931e, 0x080c,
-	0x98c9, 0x080c, 0x70ac, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016,
+	0x0002, 0x080c, 0x98c8, 0x2011, 0x0005, 0x080c, 0x9339, 0x080c,
+	0x98e4, 0x080c, 0x70b7, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016,
 	0x2009, 0x0002, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005,
-	0x00c6, 0x00b6, 0x080c, 0x70ac, 0x1118, 0x20a9, 0x0800, 0x0010,
-	0x20a9, 0x0782, 0x080c, 0x70ac, 0x1110, 0x900e, 0x0010, 0x2009,
+	0x00c6, 0x00b6, 0x080c, 0x70b7, 0x1118, 0x20a9, 0x0800, 0x0010,
+	0x20a9, 0x0782, 0x080c, 0x70b7, 0x1110, 0x900e, 0x0010, 0x2009,
 	0x007e, 0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110,
-	0xb800, 0xd0bc, 0x090c, 0x3113, 0x8108, 0x1f04, 0x0ae1, 0x707b,
+	0xb800, 0xd0bc, 0x090c, 0x311a, 0x8108, 0x1f04, 0x0ae1, 0x707b,
 	0x0000, 0x707c, 0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be,
 	0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086,
 	0x0002, 0x1904, 0x0ba8, 0x70a8, 0x9086, 0xffff, 0x0120, 0x080c,
 	0x2ddb, 0x0804, 0x0ba8, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0520,
 	0xd084, 0x0510, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e,
-	0xd08c, 0x01d0, 0x70dc, 0x9086, 0xffff, 0x0190, 0x080c, 0x2f63,
-	0x70d8, 0xd094, 0x1904, 0x0ba8, 0x2011, 0x0001, 0x080c, 0xbf46,
-	0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2f9d, 0x0804, 0x0ba8,
+	0xd08c, 0x01d0, 0x70dc, 0x9086, 0xffff, 0x0190, 0x080c, 0x2f66,
+	0x70d8, 0xd094, 0x1904, 0x0ba8, 0x2011, 0x0001, 0x080c, 0xbf61,
+	0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2fa0, 0x0804, 0x0ba8,
 	0x70e0, 0x9005, 0x1904, 0x0ba8, 0x70a4, 0x9005, 0x1904, 0x0ba8,
-	0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba8, 0x080c, 0x661e,
-	0x1904, 0x0ba8, 0x080c, 0x6671, 0x1904, 0x0ba8, 0x080c, 0x6658,
+	0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba8, 0x080c, 0x6625,
+	0x1904, 0x0ba8, 0x080c, 0x6678, 0x1904, 0x0ba8, 0x080c, 0x665f,
 	0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
-	0x6269, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04,
+	0x6270, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04,
 	0x0b4e, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804,
 	0x0ba8, 0x0006, 0x2001, 0x0103, 0x2003, 0x006b, 0x000e, 0x2011,
 	0x1984, 0x080c, 0x0faa, 0x2011, 0x199e, 0x080c, 0x0faa, 0x7030,
 	0xc08c, 0x7032, 0x7003, 0x0003, 0x70ab, 0xffff, 0x080c, 0x0e61,
 	0x9006, 0x080c, 0x23c9, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
-	0x0006, 0x080c, 0x4a6e, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
-	0x080c, 0x70cf, 0x0150, 0x080c, 0x70ac, 0x7828, 0x0118, 0x9084,
-	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0x98ad,
+	0x0006, 0x080c, 0x4a75, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
+	0x080c, 0x70da, 0x0150, 0x080c, 0x70b7, 0x7828, 0x0118, 0x9084,
+	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0x98c8,
 	0x2001, 0x19b9, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
-	0x080c, 0x931e, 0x2011, 0x0000, 0x080c, 0x9328, 0x080c, 0x98c9,
+	0x080c, 0x9339, 0x2011, 0x0000, 0x080c, 0x9343, 0x080c, 0x98e4,
 	0x012e, 0x00be, 0x0005, 0x0016, 0x0026, 0x0046, 0x00f6, 0x0126,
 	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
-	0x2009, 0x00f7, 0x080c, 0x5c51, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x2009, 0x00f7, 0x080c, 0x5c58, 0x7940, 0x918c, 0x0010, 0x7942,
 	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x286d, 0xd19c,
 	0x0120, 0x2011, 0x0008, 0x080c, 0x286d, 0x0006, 0x0036, 0x0156,
 	0x0000, 0x2001, 0x1978, 0x2004, 0x9005, 0x1518, 0x080c, 0x2801,
@@ -178,26 +178,26 @@ unsigned short risc_code01[] = {
 	0x9006, 0x080c, 0x2751, 0x0068, 0x080c, 0x2811, 0x1d50, 0x2001,
 	0x1969, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2568, 0x0804,
 	0x0ca9, 0x080c, 0x2890, 0x080c, 0x28d4, 0x20a9, 0x003a, 0x1d04,
-	0x0bff, 0x080c, 0x8217, 0x1f04, 0x0bff, 0x080c, 0x70bd, 0x0148,
-	0x080c, 0x70cf, 0x1118, 0x080c, 0x73bb, 0x0050, 0x080c, 0x70b4,
-	0x0dd0, 0x080c, 0x73b6, 0x080c, 0x73ac, 0x080c, 0x6fdd, 0x0020,
-	0x2009, 0x00f8, 0x080c, 0x5c51, 0x7850, 0xc0e5, 0x7852, 0x080c,
-	0x70ac, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
-	0x2019, 0xea60, 0x0d0c, 0x8217, 0x7820, 0xd09c, 0x15a0, 0x080c,
-	0x70ac, 0x0904, 0x0c8b, 0x7824, 0xd0ac, 0x1904, 0x0cae, 0x080c,
-	0x70cf, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x0bff, 0x080c, 0x823f, 0x1f04, 0x0bff, 0x080c, 0x70c8, 0x0148,
+	0x080c, 0x70da, 0x1118, 0x080c, 0x73c6, 0x0050, 0x080c, 0x70bf,
+	0x0dd0, 0x080c, 0x73c1, 0x080c, 0x73b7, 0x080c, 0x6fe8, 0x0020,
+	0x2009, 0x00f8, 0x080c, 0x5c58, 0x7850, 0xc0e5, 0x7852, 0x080c,
+	0x70b7, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x823f, 0x7820, 0xd09c, 0x15a0, 0x080c,
+	0x70b7, 0x0904, 0x0c8b, 0x7824, 0xd0ac, 0x1904, 0x0cae, 0x080c,
+	0x70da, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
 	0x2011, 0x1800, 0x080c, 0x286d, 0x080c, 0x2819, 0x7824, 0x9084,
 	0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0cd1, 0x8421, 0x1160, 0x1d04,
-	0x0c5b, 0x080c, 0x8217, 0x080c, 0x73b6, 0x080c, 0x73ac, 0x7003,
+	0x0c5b, 0x080c, 0x823f, 0x080c, 0x73c1, 0x080c, 0x73b7, 0x7003,
 	0x0001, 0x0804, 0x0cae, 0x8319, 0x1928, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0cd1, 0x1d04, 0x0c71, 0x080c,
-	0x8217, 0x2009, 0x196c, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x823f, 0x2009, 0x196c, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
 	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x286d, 0x20a9,
 	0x0002, 0x080c, 0x27fa, 0x7924, 0x080c, 0x2819, 0xd19c, 0x0110,
-	0x080c, 0x273f, 0x00f0, 0x080c, 0x70bd, 0x1140, 0x94a2, 0x03e8,
-	0x1128, 0x080c, 0x7080, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
-	0x080c, 0x286d, 0x080c, 0x2819, 0x7824, 0x080c, 0x70c6, 0x0110,
+	0x080c, 0x273f, 0x00f0, 0x080c, 0x70c8, 0x1140, 0x94a2, 0x03e8,
+	0x1128, 0x080c, 0x708b, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
+	0x080c, 0x286d, 0x080c, 0x2819, 0x7824, 0x080c, 0x70d1, 0x0110,
 	0xd0ac, 0x1160, 0x9084, 0x1800, 0x0904, 0x0c63, 0x7003, 0x0001,
 	0x0028, 0x2001, 0x0001, 0x080c, 0x23c9, 0x00a0, 0x7850, 0xc0e4,
 	0x7852, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
@@ -205,20 +205,20 @@ unsigned short risc_code01[] = {
 	0x0028, 0x782a, 0x2001, 0x1978, 0x2003, 0x0000, 0x9006, 0x78f2,
 	0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x002e, 0x001e,
 	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x8217, 0x015e,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x823f, 0x015e,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x002e,
 	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x1894, 0x7004, 0x9086,
-	0x0001, 0x1110, 0x080c, 0x32ab, 0x00ee, 0x0005, 0x0005, 0x2a70,
-	0x2061, 0x197c, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001a,
+	0x0001, 0x1110, 0x080c, 0x32b2, 0x00ee, 0x0005, 0x0005, 0x2a70,
+	0x2061, 0x197c, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001c,
 	0x600f, 0x0317, 0x2001, 0x194d, 0x900e, 0x2102, 0x7192, 0x2001,
 	0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008,
-	0x715a, 0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbc93, 0x70eb,
+	0x715a, 0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbcae, 0x70eb,
 	0x00c0, 0x2061, 0x193d, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
 	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f,
 	0x07d0, 0x2061, 0x1945, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
 	0x195a, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
-	0x2020, 0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6269,
+	0x2020, 0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6270,
 	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
 	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
 	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
@@ -237,11 +237,11 @@ unsigned short risc_code01[] = {
 	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
 	0x2004, 0xd084, 0x0180, 0x2001, 0x19f3, 0x2004, 0x9005, 0x0128,
 	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
-	0x0002, 0x2003, 0x1001, 0x080c, 0x5395, 0x1170, 0x080c, 0x0efb,
-	0x0110, 0x080c, 0x0e4e, 0x080c, 0x5395, 0x1130, 0x2071, 0x1800,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x539c, 0x1170, 0x080c, 0x0efb,
+	0x0110, 0x080c, 0x0e4e, 0x080c, 0x539c, 0x1130, 0x2071, 0x1800,
 	0x2011, 0x8000, 0x080c, 0x0f0f, 0x0c70, 0x0005, 0x2001, 0x0382,
 	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1120, 0x2001, 0x0015,
-	0x080c, 0x989e, 0x2079, 0x0380, 0x2069, 0x1ad4, 0x7818, 0x6802,
+	0x080c, 0x98b9, 0x2079, 0x0380, 0x2069, 0x1ad4, 0x7818, 0x6802,
 	0x781c, 0x6806, 0x7840, 0x680a, 0x7844, 0x680e, 0x782c, 0x6812,
 	0x2019, 0x1adf, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
 	0x8210, 0x8318, 0x8210, 0x9282, 0x0011, 0x0ea8, 0x2011, 0xdead,
@@ -320,7 +320,7 @@ unsigned short risc_code01[] = {
 	0x0016, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862, 0x9184,
 	0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091, 0x8000,
 	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
-	0x70be, 0x080c, 0x804c, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x70be, 0x080c, 0x8074, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9026, 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e, 0x8940,
 	0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0440,
 	0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x1883, 0x7000,
@@ -384,15 +384,15 @@ unsigned short risc_code01[] = {
 	0x008e, 0x00de, 0x009e, 0x080c, 0x112b, 0x0005, 0x00de, 0x009e,
 	0x080c, 0x112b, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0,
 	0x904d, 0x090c, 0x0d65, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6983, 0xa09f,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x698a, 0xa09f,
 	0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x1054, 0x009e, 0x0005,
 	0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0d65, 0xa06c, 0x908e, 0x0100,
 	0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050,
 	0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007,
 	0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xa076, 0xa172,
 	0xb000, 0xa07a, 0x2810, 0x080c, 0x110c, 0x00e8, 0xa97c, 0xa894,
-	0x0016, 0x0006, 0x080c, 0x6983, 0x000e, 0x001e, 0xd1fc, 0x1138,
-	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9bcc, 0x00ce, 0x7008,
+	0x0016, 0x0006, 0x080c, 0x698a, 0x000e, 0x001e, 0xd1fc, 0x1138,
+	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9be7, 0x00ce, 0x7008,
 	0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x1054, 0x7007,
 	0x0000, 0x080c, 0x112b, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000,
 	0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e,
@@ -411,9 +411,9 @@ unsigned short risc_code01[] = {
 	0x190c, 0x0d5e, 0xd19c, 0x05a0, 0x7820, 0x908c, 0xf000, 0x0540,
 	0x2060, 0x6020, 0x9086, 0x0003, 0x1550, 0x6000, 0x9086, 0x0004,
 	0x1530, 0x6114, 0x2148, 0xa876, 0xa87a, 0xa867, 0x0103, 0x080c,
-	0x67a5, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208, 0xba3e,
-	0xb8c0, 0x9005, 0x190c, 0x6394, 0x00be, 0x6044, 0xd0fc, 0x190c,
-	0x98d6, 0x080c, 0x9bf4, 0x7808, 0xd09c, 0x19b0, 0x012e, 0x0005,
+	0x67ac, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208, 0xba3e,
+	0xb8c0, 0x9005, 0x190c, 0x639b, 0x00be, 0x6044, 0xd0fc, 0x190c,
+	0x98f1, 0x080c, 0x9c0f, 0x7808, 0xd09c, 0x19b0, 0x012e, 0x0005,
 	0x908a, 0x0024, 0x1a0c, 0x0d65, 0x002b, 0x012e, 0x0005, 0x04b0,
 	0x012e, 0x0005, 0x138e, 0x13b4, 0x13e4, 0x13e9, 0x13ed, 0x13f2,
 	0x141a, 0x141e, 0x142c, 0x1430, 0x138e, 0x14ba, 0x14be, 0x1521,
@@ -421,25 +421,25 @@ unsigned short risc_code01[] = {
 	0x138e, 0x138e, 0x138e, 0x138e, 0x138e, 0x13f4, 0x138e, 0x13bc,
 	0x13e1, 0x13a8, 0x138e, 0x13c8, 0x1392, 0x1390, 0x080c, 0x0d65,
 	0x080c, 0x0d5e, 0x080c, 0x1528, 0x2009, 0x1a49, 0x2104, 0x8000,
-	0x200a, 0x080c, 0x7b17, 0x080c, 0x195f, 0x0005, 0x6044, 0xd0fc,
-	0x190c, 0x98d6, 0x2009, 0x0055, 0x080c, 0x9c6a, 0x012e, 0x0005,
-	0x080c, 0x1528, 0x2060, 0x6044, 0xd0fc, 0x190c, 0x98d6, 0x2009,
-	0x0055, 0x080c, 0x9c6a, 0x0005, 0x2009, 0x0048, 0x080c, 0x1528,
-	0x2060, 0x080c, 0x9c6a, 0x0005, 0x2009, 0x0054, 0x080c, 0x1528,
-	0x2060, 0x6044, 0xd0fc, 0x190c, 0x98d6, 0x080c, 0x9c6a, 0x0005,
+	0x200a, 0x080c, 0x7b22, 0x080c, 0x195f, 0x0005, 0x6044, 0xd0fc,
+	0x190c, 0x98f1, 0x2009, 0x0055, 0x080c, 0x9c85, 0x012e, 0x0005,
+	0x080c, 0x1528, 0x2060, 0x6044, 0xd0fc, 0x190c, 0x98f1, 0x2009,
+	0x0055, 0x080c, 0x9c85, 0x0005, 0x2009, 0x0048, 0x080c, 0x1528,
+	0x2060, 0x080c, 0x9c85, 0x0005, 0x2009, 0x0054, 0x080c, 0x1528,
+	0x2060, 0x6044, 0xd0fc, 0x190c, 0x98f1, 0x080c, 0x9c85, 0x0005,
 	0x080c, 0x1528, 0x2060, 0x0056, 0x0066, 0x080c, 0x1528, 0x2028,
 	0x080c, 0x1528, 0x2030, 0x0036, 0x0046, 0x2021, 0x0000, 0x2418,
-	0x2009, 0x0056, 0x080c, 0x9c6a, 0x004e, 0x003e, 0x006e, 0x005e,
+	0x2009, 0x0056, 0x080c, 0x9c85, 0x004e, 0x003e, 0x006e, 0x005e,
 	0x0005, 0x080c, 0x1528, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006,
 	0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x1528, 0x080c,
 	0x15e5, 0x0005, 0x080c, 0x0d65, 0x080c, 0x1528, 0x2060, 0x6014,
 	0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c,
-	0x9c6a, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109,
+	0x9c85, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109,
 	0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218,
 	0x2004, 0xd0ec, 0x1110, 0x080c, 0x152d, 0x2001, 0x0307, 0x2003,
 	0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x1528,
 	0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009,
-	0x0048, 0x080c, 0x9c6a, 0x0005, 0x080c, 0x1528, 0x080c, 0x0d65,
+	0x0048, 0x080c, 0x9c85, 0x0005, 0x080c, 0x1528, 0x080c, 0x0d65,
 	0x080c, 0x1528, 0x080c, 0x14a5, 0x7827, 0x0018, 0x79ac, 0xd1dc,
 	0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, 0x0138,
 	0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0400, 0x7004,
@@ -447,13 +447,13 @@ unsigned short risc_code01[] = {
 	0xd1bc, 0x090c, 0x0d65, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
 	0x0020, 0x0480, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x14be,
 	0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0d65, 0x6014,
-	0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7b17,
-	0x080c, 0x195f, 0x080c, 0xb82c, 0x0158, 0xa9ac, 0xa936, 0xa9b0,
+	0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7b22,
+	0x080c, 0x195f, 0x080c, 0xb847, 0x0158, 0xa9ac, 0xa936, 0xa9b0,
 	0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882,
 	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024,
-	0x190c, 0xbc28, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201,
-	0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd5b1, 0xd5a4, 0x1118,
-	0x080c, 0x152d, 0x0005, 0x080c, 0x7b17, 0x080c, 0x195f, 0x0005,
+	0x190c, 0xbc43, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd5d3, 0xd5a4, 0x1118,
+	0x080c, 0x152d, 0x0005, 0x080c, 0x7b22, 0x080c, 0x195f, 0x0005,
 	0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076,
 	0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003,
 	0x0120, 0x2001, 0x0016, 0x080c, 0x159e, 0x00fe, 0x007e, 0x006e,
@@ -470,7 +470,7 @@ unsigned short risc_code01[] = {
 	0x0218, 0x2004, 0xd0ec, 0x1110, 0x0401, 0x0040, 0x2001, 0x020d,
 	0x2003, 0x0020, 0x080c, 0x12ea, 0x7803, 0x0001, 0x00ee, 0x001e,
 	0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0069,
-	0x0ca8, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x9c6a, 0x0005,
+	0x0ca8, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x9c85, 0x0005,
 	0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x14a5, 0x00d6,
 	0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005,
 	0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528,
@@ -478,7 +478,7 @@ unsigned short risc_code01[] = {
 	0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x1590,
 	0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1,
 	0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005,
-	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7b17, 0x080c,
+	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7b22, 0x080c,
 	0x195f, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018,
 	0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307,
 	0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084,
@@ -499,9 +499,9 @@ unsigned short risc_code01[] = {
 	0x1644, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904,
 	0x1644, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce,
 	0x918e, 0x0039, 0x1904, 0x1644, 0x9c06, 0x15f0, 0x0126, 0x2091,
-	0x2600, 0x080c, 0x7a6f, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d,
+	0x2600, 0x080c, 0x7a7a, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d,
 	0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x190c, 0xbc03, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004, 0xd0b4,
+	0x190c, 0xbc1e, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004, 0xd0b4,
 	0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800,
 	0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c,
 	0x1d17, 0x1190, 0x080c, 0x17f2, 0x2a00, 0xa816, 0x0130, 0x2800,
@@ -596,7 +596,7 @@ unsigned short risc_code01[] = {
 	0x81ff, 0x1118, 0xa887, 0x0001, 0x0008, 0xa986, 0x601b, 0x0002,
 	0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934, 0xa88c, 0x9106, 0x1158,
 	0xa938, 0xa890, 0x9106, 0x1138, 0x601c, 0xc084, 0x601e, 0x2009,
-	0x0048, 0x0804, 0x9c6a, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200,
+	0x0048, 0x0804, 0x9c85, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200,
 	0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000, 0x05b0, 0x9186,
 	0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006, 0x2031, 0x0008,
 	0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120, 0x080c, 0x132a,
@@ -607,17 +607,17 @@ unsigned short risc_code01[] = {
 	0x19fb, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x19e8, 0x7827,
 	0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6,
 	0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c,
-	0x70ac, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160,
+	0x70b7, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160,
 	0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0,
-	0x0081, 0x2001, 0x0386, 0x2003, 0x2020, 0x080c, 0x714d, 0x0005,
+	0x0081, 0x2001, 0x0386, 0x2003, 0x2020, 0x080c, 0x7158, 0x0005,
 	0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202,
 	0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2825, 0x2009, 0x003c,
 	0x080c, 0x2052, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084,
-	0x003c, 0x1de0, 0x080c, 0x804c, 0x70a0, 0x70a2, 0x7098, 0x709a,
+	0x003c, 0x1de0, 0x080c, 0x8074, 0x70a0, 0x70a2, 0x7098, 0x709a,
 	0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079,
 	0x0300, 0x080c, 0x12ea, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005,
 	0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c,
-	0x2003, 0x0000, 0x080c, 0x70ac, 0x1108, 0x0005, 0x2021, 0x0260,
+	0x2003, 0x0000, 0x080c, 0x70b7, 0x1108, 0x0005, 0x2021, 0x0260,
 	0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c,
 	0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c, 0x83ff, 0x1110,
 	0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000, 0x0005, 0x0046,
@@ -693,12 +693,12 @@ unsigned short risc_code01[] = {
 	0x080c, 0x0d65, 0x00f6, 0x00e6, 0x0096, 0x00c6, 0x0026, 0x704c,
 	0x9c06, 0x190c, 0x0d65, 0x2079, 0x0090, 0x2001, 0x0105, 0x2003,
 	0x0010, 0x782b, 0x0004, 0x7057, 0x0000, 0x6014, 0x2048, 0x080c,
-	0xb82c, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006,
+	0xb847, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006,
 	0x1170, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0,
 	0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a, 0x60c8, 0xa896, 0x704c,
-	0x2060, 0x00c6, 0x080c, 0xb437, 0x080c, 0x98ad, 0x00ce, 0x704c,
-	0x9c06, 0x1150, 0x2009, 0x0040, 0x080c, 0x2052, 0x080c, 0x949d,
-	0x2011, 0x0000, 0x080c, 0x9328, 0x002e, 0x00ce, 0x009e, 0x00ee,
+	0x2060, 0x00c6, 0x080c, 0xb452, 0x080c, 0x98c8, 0x00ce, 0x704c,
+	0x9c06, 0x1150, 0x2009, 0x0040, 0x080c, 0x2052, 0x080c, 0x94b8,
+	0x2011, 0x0000, 0x080c, 0x9343, 0x002e, 0x00ce, 0x009e, 0x00ee,
 	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0090, 0x781c, 0x0006, 0x7818,
 	0x0006, 0x2079, 0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012,
 	0x7816, 0x2019, 0x1000, 0x8319, 0x090c, 0x0d65, 0x7820, 0xd0bc,
@@ -708,11 +708,11 @@ unsigned short risc_code01[] = {
 	0x00fe, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x19b8, 0x7054, 0x9086,
 	0x0000, 0x0904, 0x1cc8, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c,
 	0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188,
-	0x080c, 0xd5fa, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d65,
+	0x080c, 0xd61c, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d65,
 	0x0016, 0x2009, 0x0040, 0x080c, 0x2052, 0x001e, 0x2001, 0x020c,
 	0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
 	0x1120, 0x2009, 0x0040, 0x080c, 0x2052, 0x782c, 0xd0fc, 0x09a8,
-	0x080c, 0x98c9, 0x782c, 0xd0fc, 0x1de8, 0x080c, 0x98ad, 0x7054,
+	0x080c, 0x98e4, 0x782c, 0xd0fc, 0x1de8, 0x080c, 0x98c8, 0x7054,
 	0x9086, 0x0000, 0x1950, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8,
 	0x2009, 0x0040, 0x080c, 0x2052, 0x782b, 0x0002, 0x7057, 0x0000,
 	0x00ee, 0x00fe, 0x0005, 0x080c, 0x0d65, 0x8c60, 0x2c05, 0x9005,
@@ -797,17 +797,17 @@ unsigned short risc_code01[] = {
 	0x781b, 0x0002, 0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600,
 	0x012e, 0x0005, 0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x204f,
 	0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e,
-	0x0002, 0x1f71, 0x1f69, 0x7a6f, 0x1f69, 0x1f6b, 0x1f6b, 0x1f6b,
-	0x1f6b, 0x7a55, 0x1f69, 0x1f6d, 0x1f69, 0x1f6b, 0x1f69, 0x1f6b,
-	0x1f69, 0x080c, 0x0d65, 0x0031, 0x0020, 0x080c, 0x7a55, 0x080c,
-	0x7a6f, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c, 0xd5fa, 0x7930,
-	0x9184, 0x0003, 0x01f0, 0x080c, 0x98ad, 0x2001, 0x19cb, 0x2004,
+	0x0002, 0x1f71, 0x1f69, 0x7a7a, 0x1f69, 0x1f6b, 0x1f6b, 0x1f6b,
+	0x1f6b, 0x7a60, 0x1f69, 0x1f6d, 0x1f69, 0x1f6b, 0x1f69, 0x1f6b,
+	0x1f69, 0x080c, 0x0d65, 0x0031, 0x0020, 0x080c, 0x7a60, 0x080c,
+	0x7a7a, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c, 0xd61c, 0x7930,
+	0x9184, 0x0003, 0x01f0, 0x080c, 0x98c8, 0x2001, 0x19cb, 0x2004,
 	0x9005, 0x0180, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d65,
-	0x00c6, 0x2001, 0x19cb, 0x2064, 0x080c, 0x98c9, 0x080c, 0xb437,
-	0x00ce, 0x0408, 0x2009, 0x0040, 0x080c, 0x2052, 0x080c, 0x98c9,
+	0x00c6, 0x2001, 0x19cb, 0x2064, 0x080c, 0x98e4, 0x080c, 0xb452,
+	0x00ce, 0x0408, 0x2009, 0x0040, 0x080c, 0x2052, 0x080c, 0x98e4,
 	0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160,
-	0x080c, 0x70ac, 0x1138, 0x080c, 0x73ac, 0x080c, 0x5cd5, 0x080c,
-	0x6fdd, 0x0010, 0x080c, 0x5b90, 0x080c, 0x7b0d, 0x0041, 0x0018,
+	0x080c, 0x70b7, 0x1138, 0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c,
+	0x6fe8, 0x0010, 0x080c, 0x5b97, 0x080c, 0x7b18, 0x0041, 0x0018,
 	0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6,
 	0x0036, 0x0046, 0x0056, 0x2071, 0x1a3c, 0x080c, 0x195f, 0x005e,
 	0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071,
@@ -852,90 +852,90 @@ unsigned short risc_code01[] = {
 	0x0007, 0x0002, 0x2105, 0x2102, 0x2102, 0x2102, 0x2104, 0x2102,
 	0x2102, 0x2102, 0x080c, 0x0d65, 0x0029, 0x002e, 0x001e, 0x000e,
 	0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118, 0xd19c,
-	0x1904, 0x2364, 0xd1f4, 0x190c, 0x0d5e, 0x080c, 0x70ac, 0x0904,
-	0x2162, 0x080c, 0xbf46, 0x1120, 0x7000, 0x9086, 0x0003, 0x0580,
-	0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x70cf, 0x0118, 0x080c,
-	0x70bd, 0x1530, 0x2011, 0x0020, 0x080c, 0x286d, 0x6043, 0x0000,
-	0x080c, 0xbf46, 0x0168, 0x080c, 0x70cf, 0x1150, 0x2001, 0x1978,
-	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6f22, 0x0804, 0x2367,
+	0x1904, 0x2364, 0xd1f4, 0x190c, 0x0d5e, 0x080c, 0x70b7, 0x0904,
+	0x2162, 0x080c, 0xbf61, 0x1120, 0x7000, 0x9086, 0x0003, 0x0580,
+	0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x70da, 0x0118, 0x080c,
+	0x70c8, 0x1530, 0x2011, 0x0020, 0x080c, 0x286d, 0x6043, 0x0000,
+	0x080c, 0xbf61, 0x0168, 0x080c, 0x70da, 0x1150, 0x2001, 0x1978,
+	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6f2d, 0x0804, 0x2367,
 	0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6, 0x2069, 0x0140,
-	0x080c, 0x7103, 0x00de, 0x1904, 0x2367, 0x080c, 0x73b6, 0x0428,
-	0x080c, 0x70cf, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
-	0x080c, 0x73b6, 0x080c, 0x73ac, 0x080c, 0x5cd5, 0x080c, 0x6fdd,
+	0x080c, 0x710e, 0x00de, 0x1904, 0x2367, 0x080c, 0x73c1, 0x0428,
+	0x080c, 0x70da, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
+	0x080c, 0x73c1, 0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c, 0x6fe8,
 	0x0804, 0x2364, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4,
 	0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094, 0x9086, 0x0028,
-	0x1110, 0x080c, 0x728f, 0x0804, 0x2364, 0x080c, 0x73b1, 0x0048,
-	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x71ed, 0x0804,
-	0x2364, 0x080c, 0x7331, 0x0804, 0x2364, 0xd1ac, 0x0904, 0x227e,
-	0x080c, 0x70ac, 0x11d0, 0x2011, 0x0020, 0x080c, 0x286d, 0x0006,
-	0x0026, 0x0036, 0x080c, 0x70c6, 0x1158, 0x080c, 0x73ac, 0x080c,
-	0x5cd5, 0x080c, 0x6fdd, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
-	0x003e, 0x002e, 0x000e, 0x080c, 0x7080, 0x0016, 0x0046, 0x00c6,
+	0x1110, 0x080c, 0x729a, 0x0804, 0x2364, 0x080c, 0x73bc, 0x0048,
+	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x71f8, 0x0804,
+	0x2364, 0x080c, 0x733c, 0x0804, 0x2364, 0xd1ac, 0x0904, 0x227e,
+	0x080c, 0x70b7, 0x11d0, 0x2011, 0x0020, 0x080c, 0x286d, 0x0006,
+	0x0026, 0x0036, 0x080c, 0x70d1, 0x1158, 0x080c, 0x73b7, 0x080c,
+	0x5cdc, 0x080c, 0x6fe8, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
+	0x003e, 0x002e, 0x000e, 0x080c, 0x708b, 0x0016, 0x0046, 0x00c6,
 	0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043,
 	0x0090, 0x6043, 0x0010, 0x74d6, 0x948c, 0xff00, 0x7038, 0xd084,
 	0x0178, 0x9186, 0xf800, 0x1160, 0x7044, 0xd084, 0x1148, 0xc085,
-	0x7046, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x48d1, 0x003e,
-	0x080c, 0xbf3f, 0x1904, 0x2255, 0x9196, 0xff00, 0x05a8, 0x705c,
+	0x7046, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x48d8, 0x003e,
+	0x080c, 0xbf5a, 0x1904, 0x2255, 0x9196, 0xff00, 0x05a8, 0x705c,
 	0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130,
-	0xd184, 0x1550, 0x080c, 0x317f, 0x0128, 0xc18d, 0x7132, 0x080c,
-	0x6658, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
+	0xd184, 0x1550, 0x080c, 0x3186, 0x0128, 0xc18d, 0x7132, 0x080c,
+	0x665f, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
 	0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x2255,
 	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
 	0x2255, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c,
-	0x48d1, 0x003e, 0x0804, 0x2255, 0x7038, 0xd08c, 0x1140, 0x2001,
+	0x48d8, 0x003e, 0x0804, 0x2255, 0x7038, 0xd08c, 0x1140, 0x2001,
 	0x180c, 0x200c, 0xd1ac, 0x1904, 0x2255, 0xc1ad, 0x2102, 0x0036,
-	0x73d4, 0x2011, 0x8013, 0x080c, 0x48d1, 0x003e, 0x7130, 0xc185,
+	0x73d4, 0x2011, 0x8013, 0x080c, 0x48d8, 0x003e, 0x7130, 0xc185,
 	0x7132, 0x2011, 0x1854, 0x220c, 0x00f0, 0x0016, 0x2009, 0x0001,
-	0x2011, 0x0100, 0x080c, 0x83c3, 0x2019, 0x000e, 0x00c6, 0x2061,
-	0x0000, 0x080c, 0xd1c9, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x3184,
+	0x2011, 0x0100, 0x080c, 0x83eb, 0x2019, 0x000e, 0x00c6, 0x2061,
+	0x0000, 0x080c, 0xd1eb, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x318b,
 	0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e,
-	0x080c, 0xd251, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002,
-	0x2019, 0x0004, 0x080c, 0x2fc2, 0x001e, 0x0078, 0x0156, 0x00b6,
-	0x20a9, 0x007f, 0x900e, 0x080c, 0x6269, 0x1110, 0x080c, 0x5cef,
+	0x080c, 0xd273, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x2fc5, 0x001e, 0x0078, 0x0156, 0x00b6,
+	0x20a9, 0x007f, 0x900e, 0x080c, 0x6270, 0x1110, 0x080c, 0x5cf6,
 	0x8108, 0x1f04, 0x224b, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c,
-	0x98ad, 0x080c, 0x9b52, 0x080c, 0x98c9, 0x60e3, 0x0000, 0x001e,
+	0x98c8, 0x080c, 0x9b6d, 0x080c, 0x98e4, 0x60e3, 0x0000, 0x001e,
 	0x2001, 0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c, 0x11b0,
 	0x2011, 0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295, 0x0002,
 	0x6206, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x1825,
 	0x2003, 0x0000, 0x2011, 0x0020, 0x080c, 0x286d, 0xd194, 0x0904,
-	0x2364, 0x0016, 0x080c, 0x98ad, 0x6220, 0xd2b4, 0x0904, 0x230c,
-	0x080c, 0x81e3, 0x080c, 0x8f9c, 0x2011, 0x0004, 0x080c, 0x286d,
+	0x2364, 0x0016, 0x080c, 0x98c8, 0x6220, 0xd2b4, 0x0904, 0x230c,
+	0x080c, 0x820b, 0x080c, 0x8fb7, 0x2011, 0x0004, 0x080c, 0x286d,
 	0x00f6, 0x2019, 0x19c4, 0x2304, 0x907d, 0x0904, 0x22d9, 0x7804,
 	0x9086, 0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069,
 	0x0140, 0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001,
 	0x0003, 0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001,
 	0x1df0, 0x080c, 0x2843, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9,
 	0x0009, 0x080c, 0x27fa, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001,
-	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x080c, 0x884c,
-	0x080c, 0x98c9, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c,
-	0x9bcc, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae,
+	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x080c, 0x8874,
+	0x080c, 0x98e4, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c,
+	0x9be7, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae,
 	0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000,
 	0x0110, 0x080c, 0x2843, 0x00de, 0x00c6, 0x2061, 0x19b8, 0x6034,
-	0x080c, 0xbf46, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a,
-	0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x8f74, 0x0804,
-	0x2361, 0x2061, 0x0100, 0x62c0, 0x080c, 0x97e3, 0x2019, 0x19c4,
+	0x080c, 0xbf61, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a,
+	0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x8f8f, 0x0804,
+	0x2361, 0x2061, 0x0100, 0x62c0, 0x080c, 0x97fe, 0x2019, 0x19c4,
 	0x2304, 0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027, 0x080c,
-	0x9c6a, 0x00ce, 0x0804, 0x2361, 0xd2bc, 0x05e0, 0x080c, 0x81f0,
+	0x9c85, 0x00ce, 0x0804, 0x2361, 0xd2bc, 0x05e0, 0x080c, 0x8218,
 	0x2011, 0x0004, 0x080c, 0x286d, 0x00d6, 0x2069, 0x0140, 0x6804,
 	0x9084, 0x4000, 0x0110, 0x080c, 0x2843, 0x00de, 0x00c6, 0x2061,
-	0x19b8, 0x6050, 0x080c, 0xbf46, 0x0120, 0x909a, 0x0003, 0x1638,
+	0x19b8, 0x6050, 0x080c, 0xbf61, 0x0120, 0x909a, 0x0003, 0x1638,
 	0x0018, 0x909a, 0x00c8, 0x1618, 0x8000, 0x6052, 0x604c, 0x00ce,
-	0x9005, 0x0578, 0x2009, 0x07d0, 0x080c, 0x81e8, 0x9080, 0x0008,
+	0x9005, 0x0578, 0x2009, 0x07d0, 0x080c, 0x8210, 0x9080, 0x0008,
 	0x2004, 0x9086, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012,
 	0x080c, 0x287c, 0x00f0, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c,
 	0x287c, 0x00b8, 0x2011, 0x0004, 0x080c, 0x286d, 0x0090, 0x0036,
-	0x2019, 0x0001, 0x080c, 0x926b, 0x003e, 0x2019, 0x19cb, 0x2304,
-	0x9065, 0x0130, 0x2009, 0x004f, 0x6003, 0x0003, 0x080c, 0x9c6a,
-	0x00ce, 0x080c, 0x98c9, 0x001e, 0xd19c, 0x0904, 0x23c2, 0x7038,
+	0x2019, 0x0001, 0x080c, 0x9286, 0x003e, 0x2019, 0x19cb, 0x2304,
+	0x9065, 0x0130, 0x2009, 0x004f, 0x6003, 0x0003, 0x080c, 0x9c85,
+	0x00ce, 0x080c, 0x98e4, 0x001e, 0xd19c, 0x0904, 0x23c2, 0x7038,
 	0xd0ac, 0x1538, 0x0016, 0x0156, 0x2011, 0x0008, 0x080c, 0x286d,
 	0x6050, 0xc0e5, 0x6052, 0x20a9, 0x0367, 0x1f04, 0x238f, 0x1d04,
-	0x2377, 0x080c, 0x8217, 0x6020, 0xd09c, 0x1db8, 0x00f6, 0x2079,
+	0x2377, 0x080c, 0x823f, 0x6020, 0xd09c, 0x1db8, 0x00f6, 0x2079,
 	0x0100, 0x080c, 0x27aa, 0x00fe, 0x1d80, 0x6050, 0xc0e4, 0x6052,
 	0x2011, 0x0008, 0x080c, 0x286d, 0x015e, 0x001e, 0x0498, 0x015e,
-	0x001e, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98ad, 0x080c,
-	0x9b52, 0x080c, 0x98c9, 0x60e3, 0x0000, 0x080c, 0xd5d9, 0x080c,
-	0xd5f4, 0x080c, 0x538a, 0xd0fc, 0x1138, 0x080c, 0xbf3f, 0x1120,
-	0x9085, 0x0001, 0x080c, 0x70f3, 0x9006, 0x080c, 0x2833, 0x2009,
+	0x001e, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98c8, 0x080c,
+	0x9b6d, 0x080c, 0x98e4, 0x60e3, 0x0000, 0x080c, 0xd5fb, 0x080c,
+	0xd616, 0x080c, 0x5391, 0xd0fc, 0x1138, 0x080c, 0xbf5a, 0x1120,
+	0x9085, 0x0001, 0x080c, 0x70fe, 0x9006, 0x080c, 0x2833, 0x2009,
 	0x0002, 0x080c, 0x281f, 0x00e6, 0x2071, 0x1800, 0x7003, 0x0004,
 	0x080c, 0x0e9c, 0x00ee, 0x2011, 0x0008, 0x080c, 0x286d, 0x080c,
 	0x0bab, 0x001e, 0x918c, 0xffd0, 0x2110, 0x080c, 0x286d, 0x00ae,
@@ -943,34 +943,34 @@ unsigned short risc_code01[] = {
 	0x2091, 0x8000, 0x2071, 0x1800, 0x71cc, 0x70ce, 0x9116, 0x0904,
 	0x241c, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x281f, 0x2011,
 	0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019,
-	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x48d1, 0x0468, 0x2001,
+	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x48d8, 0x0468, 0x2001,
 	0x1979, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4,
 	0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c,
-	0x48d1, 0x080c, 0x0e9c, 0x080c, 0x538a, 0xd0fc, 0x11a8, 0x080c,
-	0xbf3f, 0x1190, 0x00c6, 0x080c, 0x24b8, 0x080c, 0x98ad, 0x080c,
-	0x91c6, 0x080c, 0x98c9, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009,
-	0x0002, 0x080c, 0x2fc2, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e,
+	0x48d8, 0x080c, 0x0e9c, 0x080c, 0x5391, 0xd0fc, 0x11a8, 0x080c,
+	0xbf5a, 0x1190, 0x00c6, 0x080c, 0x24b8, 0x080c, 0x98c8, 0x080c,
+	0x91e1, 0x080c, 0x98e4, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009,
+	0x0002, 0x080c, 0x2fc5, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e,
 	0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130,
 	0x9094, 0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac, 0x11c8,
 	0x81ff, 0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190, 0x2011,
 	0x181f, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148,
 	0x2011, 0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206,
-	0x1120, 0x2500, 0x080c, 0x7d48, 0x0048, 0x9584, 0x00ff, 0x9080,
-	0x3184, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080,
-	0x3184, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140,
+	0x1120, 0x2500, 0x080c, 0x7d70, 0x0048, 0x9584, 0x00ff, 0x9080,
+	0x318b, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080,
+	0x318b, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140,
 	0x2001, 0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852,
 	0x6856, 0x1f04, 0x2468, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026,
 	0x2069, 0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214, 0x8214,
 	0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128,
-	0x9184, 0x000f, 0x9080, 0xd608, 0x2005, 0x6856, 0x8211, 0x1f04,
+	0x9184, 0x000f, 0x9080, 0xd62a, 0x2005, 0x6856, 0x8211, 0x1f04,
 	0x247d, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800,
 	0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005,
 	0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980,
 	0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001,
 	0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x24ad,
 	0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005,
-	0x080c, 0x5386, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046,
-	0x2020, 0x2009, 0x002e, 0x080c, 0xd251, 0x004e, 0x0005, 0x00f6,
+	0x080c, 0x538d, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046,
+	0x2020, 0x2009, 0x002e, 0x080c, 0xd273, 0x004e, 0x0005, 0x00f6,
 	0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x2524,
 	0x080c, 0x279a, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120,
 	0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011,
@@ -979,9 +979,9 @@ unsigned short risc_code01[] = {
 	0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078,
 	0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084,
 	0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300,
-	0x9080, 0x0020, 0x2018, 0x080c, 0x83f1, 0x928c, 0xff00, 0x0110,
+	0x9080, 0x0020, 0x2018, 0x080c, 0x8419, 0x928c, 0xff00, 0x0110,
 	0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009,
-	0x0138, 0x220a, 0x080c, 0x70ac, 0x1118, 0x2009, 0x193e, 0x220a,
+	0x0138, 0x220a, 0x080c, 0x70b7, 0x1118, 0x2009, 0x193e, 0x220a,
 	0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126,
 	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c,
 	0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0d5e, 0x002e,
@@ -997,17 +997,17 @@ unsigned short risc_code01[] = {
 	0x25f1, 0x25f3, 0x2001, 0x0001, 0x080c, 0x23c9, 0x080c, 0x27e4,
 	0x2001, 0x1963, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a,
 	0x9006, 0x20a9, 0x0009, 0x080c, 0x27b6, 0x2001, 0x1961, 0x2003,
-	0x0006, 0x2009, 0x001e, 0x2011, 0x25f4, 0x080c, 0x81f5, 0x0005,
+	0x0006, 0x2009, 0x001e, 0x2011, 0x25f4, 0x080c, 0x821d, 0x0005,
 	0x2009, 0x1966, 0x200b, 0x0000, 0x2001, 0x196b, 0x2003, 0x0036,
 	0x2001, 0x196a, 0x2003, 0x002a, 0x2001, 0x1963, 0x2003, 0x0001,
 	0x9006, 0x080c, 0x2751, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c,
 	0x27b6, 0x2001, 0x1961, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011,
-	0x25f4, 0x080c, 0x81f5, 0x0005, 0x080c, 0x0d65, 0x2001, 0x196b,
+	0x25f4, 0x080c, 0x821d, 0x0005, 0x080c, 0x0d65, 0x2001, 0x196b,
 	0x2003, 0x0036, 0x2001, 0x1963, 0x2003, 0x0003, 0x7a38, 0x9294,
 	0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
 	0x080c, 0x2751, 0x2001, 0x1967, 0x2003, 0x0000, 0x2001, 0xffff,
 	0x20a9, 0x0009, 0x080c, 0x27b6, 0x2001, 0x1961, 0x2003, 0x0006,
-	0x2009, 0x001e, 0x2011, 0x25f4, 0x080c, 0x81f5, 0x0005, 0x080c,
+	0x2009, 0x001e, 0x2011, 0x25f4, 0x080c, 0x821d, 0x0005, 0x080c,
 	0x0d65, 0x080c, 0x0d65, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6,
 	0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001,
 	0x1963, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d65, 0x0043, 0x012e,
@@ -1069,24 +1069,24 @@ unsigned short risc_code01[] = {
 	0x783b, 0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006,
 	0x0060, 0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186,
 	0x0003, 0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x27d6,
-	0x080c, 0x8217, 0x1f04, 0x27d6, 0x7850, 0x9085, 0x1000, 0x7852,
+	0x080c, 0x823f, 0x1f04, 0x27d6, 0x7850, 0x9085, 0x1000, 0x7852,
 	0x000e, 0x001e, 0x012e, 0x0005, 0x080c, 0x28d4, 0x0005, 0x0006,
 	0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac,
 	0x1100, 0x7854, 0xd08c, 0x1110, 0x1f04, 0x27f1, 0x00fe, 0x015e,
-	0x000e, 0x0005, 0x1d04, 0x27fa, 0x080c, 0x8217, 0x1f04, 0x27fa,
+	0x000e, 0x0005, 0x1d04, 0x27fa, 0x080c, 0x823f, 0x1f04, 0x27fa,
 	0x0005, 0x0006, 0x2001, 0x196d, 0x2004, 0x9086, 0x0000, 0x000e,
 	0x0005, 0x0006, 0x2001, 0x196d, 0x2004, 0x9086, 0x0001, 0x000e,
 	0x0005, 0x0006, 0x2001, 0x196d, 0x2004, 0x9086, 0x0002, 0x000e,
 	0x0005, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006,
 	0x2001, 0x1979, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104,
 	0xd0dc, 0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001,
-	0xa001, 0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x70c6, 0x0108,
+	0xa001, 0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x70d1, 0x0108,
 	0xc0bc, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a,
 	0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114,
 	0x9294, 0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e,
 	0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001,
 	0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009,
-	0x0140, 0x2104, 0x1128, 0x080c, 0x70c6, 0x0110, 0xc0bc, 0x0008,
+	0x0140, 0x2104, 0x1128, 0x080c, 0x70d1, 0x0110, 0xc0bc, 0x0008,
 	0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380,
 	0x7843, 0x0101, 0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202,
 	0x7843, 0x0100, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843,
@@ -1193,2654 +1193,2659 @@ unsigned short risc_code01[] = {
 	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
 	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x20e6,
 	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
 	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x9913, 0x080c, 0x20e6, 0x0804, 0x2dd2,
+	0x0146, 0x0156, 0x080c, 0x992e, 0x080c, 0x20e6, 0x0804, 0x2dd2,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x1f20, 0x080c, 0x9913, 0x0804, 0x2dd2, 0x0106, 0x0006,
+	0x080c, 0x1f20, 0x080c, 0x992e, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20,
-	0x080c, 0x9913, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913,
+	0x080c, 0x992e, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
 	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913, 0x080c, 0x20e6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e, 0x080c, 0x20e6,
 	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x9913,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
 	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x9913,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
 	0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
 	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913, 0x080c, 0x20e6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e, 0x080c, 0x20e6,
 	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x9913,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
 	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x9913,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
 	0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
 	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9913,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
 	0x080c, 0x20e6, 0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x1f20, 0x080c, 0x9913, 0x080c, 0x132a, 0x080c, 0x1f4a,
+	0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x132a, 0x080c, 0x1f4a,
 	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x9913, 0x080c, 0x20e6,
+	0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x20e6,
 	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x9913, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x9913,
+	0x080c, 0x992e, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x992e,
 	0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
 	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x9913, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x080c, 0x992e, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
 	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x9913, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
+	0x080c, 0x992e, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x9913, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
+	0x080c, 0x992e, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x9913, 0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2,
+	0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x9913, 0x080c, 0x1f4a,
+	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x1f4a,
 	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x9913,
+	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e,
 	0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x9913, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
+	0x080c, 0x992e, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x9913, 0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2,
+	0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x9913, 0x080c, 0x132a,
+	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x132a,
 	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x9913,
+	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e,
 	0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
 	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x9913, 0x080c, 0x132a, 0x080c, 0x1f4a, 0x04d8, 0x0106,
+	0x080c, 0x992e, 0x080c, 0x132a, 0x080c, 0x1f4a, 0x04d8, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2527, 0x080c, 0x9913, 0x080c, 0x20e6, 0x080c, 0x132a, 0x080c,
+	0x2527, 0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x132a, 0x080c,
 	0x1f4a, 0x0440, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
 	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x132a,
-	0x080c, 0x9913, 0x080c, 0x1f4a, 0x00a8, 0x0106, 0x0006, 0x0126,
+	0x080c, 0x992e, 0x080c, 0x1f4a, 0x00a8, 0x0106, 0x0006, 0x0126,
 	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c,
-	0x1f20, 0x080c, 0x9913, 0x080c, 0x20e6, 0x080c, 0x132a, 0x080c,
+	0x1f20, 0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x132a, 0x080c,
 	0x1f4a, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
 	0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026,
-	0x080c, 0x661e, 0x1904, 0x2ede, 0x72d8, 0x2001, 0x194d, 0x2004,
+	0x080c, 0x6625, 0x1904, 0x2ee1, 0x72d8, 0x2001, 0x194d, 0x2004,
 	0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904,
-	0x2ede, 0x080c, 0x2ee3, 0x0804, 0x2ede, 0xd2cc, 0x1904, 0x2ede,
-	0x080c, 0x70ac, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2ede, 0xd294,
-	0x0120, 0x70ab, 0xffff, 0x0804, 0x2ede, 0x080c, 0x317a, 0x0160,
-	0x080c, 0xbf46, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e70,
-	0x70ab, 0xffff, 0x0804, 0x2ede, 0x2001, 0x1817, 0x203c, 0x7290,
-	0xd284, 0x0904, 0x2e70, 0xd28c, 0x1904, 0x2e70, 0x0036, 0x73a8,
+	0x2ee1, 0x080c, 0x2ee6, 0x0804, 0x2ee1, 0xd2cc, 0x1904, 0x2ee1,
+	0x080c, 0x70b7, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2ee1, 0xd294,
+	0x0120, 0x70ab, 0xffff, 0x0804, 0x2ee1, 0x080c, 0x3181, 0x0160,
+	0x080c, 0xbf61, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e73,
+	0x70ab, 0xffff, 0x0804, 0x2ee1, 0x2001, 0x1817, 0x203c, 0x7290,
+	0xd284, 0x0904, 0x2e73, 0xd28c, 0x1904, 0x2e73, 0x0036, 0x73a8,
 	0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80,
 	0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
-	0x9084, 0x00ff, 0x970e, 0x0590, 0x908e, 0x0000, 0x0578, 0x908e,
-	0x00ff, 0x1150, 0x7230, 0xd284, 0x1570, 0x7290, 0xc28d, 0x7292,
-	0x70ab, 0xffff, 0x003e, 0x0460, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x6684, 0x002e, 0x0118, 0x70ab, 0xffff, 0x00f8, 0x900e, 0x080c,
-	0x2424, 0x080c, 0x6209, 0x11a8, 0x080c, 0x6660, 0x1150, 0x7030,
-	0xd08c, 0x0118, 0xb800, 0xd0bc, 0x0120, 0x080c, 0x2efc, 0x0148,
-	0x0028, 0x080c, 0x3050, 0x080c, 0x2f28, 0x0118, 0x8318, 0x0804,
-	0x2e25, 0x73aa, 0x0010, 0x70ab, 0xffff, 0x003e, 0x0804, 0x2ede,
-	0x9780, 0x3184, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e,
-	0x70a8, 0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812,
-	0x0220, 0x2008, 0x9802, 0x20a8, 0x0020, 0x70ab, 0xffff, 0x0804,
-	0x2ede, 0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x2ed3, 0x0026,
-	0x2011, 0x0010, 0x080c, 0x6684, 0x002e, 0x0120, 0x2009, 0xffff,
-	0x0804, 0x2edb, 0xc484, 0x080c, 0x6269, 0x0138, 0x080c, 0xbf46,
-	0x1590, 0x080c, 0x6209, 0x15b8, 0x0008, 0xc485, 0x080c, 0x6660,
-	0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7290,
-	0xd28c, 0x0180, 0x080c, 0x6660, 0x9082, 0x0006, 0x02e0, 0xd484,
-	0x1118, 0x080c, 0x622d, 0x0028, 0x080c, 0x30e8, 0x01a0, 0x080c,
-	0x3113, 0x0088, 0x080c, 0x3050, 0x080c, 0xbf46, 0x1160, 0x080c,
-	0x2f28, 0x0188, 0x0040, 0x080c, 0xbf46, 0x1118, 0x080c, 0x30e8,
-	0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x2e89,
-	0x70ab, 0xffff, 0x0018, 0x001e, 0x015e, 0x71aa, 0x004e, 0x002e,
-	0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70ab, 0x0001, 0x2009,
-	0x007e, 0x080c, 0x6209, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe,
-	0x080c, 0x3050, 0x04a9, 0x0128, 0x70d8, 0xc0bd, 0x70da, 0x080c,
-	0xbc93, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
-	0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9c3d,
-	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbcc0, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x61a6, 0x2001, 0x0000, 0x080c, 0x61ba, 0x0126, 0x2091,
-	0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e, 0x2009, 0x0004, 0x080c,
-	0x9c6a, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
-	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084,
-	0x00ff, 0xb842, 0x080c, 0x9c3d, 0x0548, 0x2b00, 0x6012, 0xb800,
-	0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x3003, 0x080c, 0xbcc0,
-	0x6023, 0x0001, 0x9006, 0x080c, 0x61a6, 0x2001, 0x0002, 0x080c,
-	0x61ba, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
-	0x2009, 0x0002, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x00ce, 0x00de,
-	0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080,
-	0x080c, 0x6209, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039,
-	0x0110, 0x70df, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016,
-	0x0076, 0x00d6, 0x00c6, 0x080c, 0x9b76, 0x01d0, 0x2b00, 0x6012,
-	0x080c, 0xbcc0, 0x6023, 0x0001, 0x9006, 0x080c, 0x61a6, 0x2001,
-	0x0002, 0x080c, 0x61ba, 0x0126, 0x2091, 0x8000, 0x70e0, 0x8000,
-	0x70e2, 0x012e, 0x2009, 0x0002, 0x080c, 0x9c6a, 0x9085, 0x0001,
-	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126,
-	0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x6209, 0x11b8, 0xb813,
-	0x00ff, 0xb817, 0xfffd, 0xb8c7, 0x0004, 0x080c, 0x9b76, 0x0170,
-	0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xbcc0,
-	0x2009, 0x0022, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e, 0x00de,
-	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6,
-	0x21f0, 0x9036, 0x080c, 0x98ad, 0x1110, 0x2031, 0x0001, 0x0066,
-	0x080c, 0x861e, 0x080c, 0x859e, 0x080c, 0x9803, 0x080c, 0xab2b,
-	0x006e, 0x86ff, 0x0110, 0x080c, 0x98c9, 0x3e08, 0x2130, 0x81ff,
-	0x0120, 0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f, 0x900e,
-	0x0016, 0x080c, 0x6269, 0x1140, 0x9686, 0x0002, 0x1118, 0xb800,
-	0xd0bc, 0x1110, 0x080c, 0x5cef, 0x001e, 0x8108, 0x1f04, 0x2fe8,
-	0x9686, 0x0001, 0x190c, 0x314e, 0x00be, 0x002e, 0x003e, 0x006e,
-	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016,
-	0x00b6, 0x9016, 0x080c, 0x98ad, 0x1110, 0x2011, 0x0001, 0x0026,
-	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x8613,
-	0x0076, 0x2039, 0x0000, 0x080c, 0x8502, 0x2c08, 0x080c, 0xcfa6,
-	0x007e, 0x001e, 0x002e, 0x82ff, 0x0110, 0x080c, 0x98c9, 0xba10,
-	0xbb14, 0x080c, 0x5cef, 0xba12, 0xbb16, 0x00be, 0x001e, 0x002e,
-	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010,
-	0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800,
-	0x70a4, 0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005,
-	0x2071, 0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8,
-	0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6,
-	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c, 0x98ad,
+	0x9084, 0x00ff, 0x970e, 0x05a8, 0x908e, 0x0000, 0x0590, 0x908e,
+	0x00ff, 0x1150, 0x7230, 0xd284, 0x1588, 0x7290, 0xc28d, 0x7292,
+	0x70ab, 0xffff, 0x003e, 0x0478, 0x0026, 0x2011, 0x0010, 0x080c,
+	0x668b, 0x002e, 0x0118, 0x70ab, 0xffff, 0x0410, 0x900e, 0x080c,
+	0x2424, 0x080c, 0x6210, 0x11c0, 0x080c, 0x6667, 0x1168, 0x7030,
+	0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c, 0x655f, 0x0120,
+	0x080c, 0x2eff, 0x0148, 0x0028, 0x080c, 0x3057, 0x080c, 0x2f2b,
+	0x0118, 0x8318, 0x0804, 0x2e25, 0x73aa, 0x0010, 0x70ab, 0xffff,
+	0x003e, 0x0804, 0x2ee1, 0x9780, 0x318b, 0x203d, 0x97bc, 0xff00,
+	0x873f, 0x2041, 0x007e, 0x70a8, 0x9096, 0xffff, 0x1118, 0x900e,
+	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
+	0x70ab, 0xffff, 0x0804, 0x2ee1, 0x2700, 0x0156, 0x0016, 0x9106,
+	0x0904, 0x2ed6, 0x0026, 0x2011, 0x0010, 0x080c, 0x668b, 0x002e,
+	0x0120, 0x2009, 0xffff, 0x0804, 0x2ede, 0xc484, 0x080c, 0x6270,
+	0x0138, 0x080c, 0xbf61, 0x1590, 0x080c, 0x6210, 0x15b8, 0x0008,
+	0xc485, 0x080c, 0x6667, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800,
+	0xd0bc, 0x11e0, 0x7290, 0xd28c, 0x0180, 0x080c, 0x6667, 0x9082,
+	0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x6234, 0x0028, 0x080c,
+	0x30ef, 0x01a0, 0x080c, 0x311a, 0x0088, 0x080c, 0x3057, 0x080c,
+	0xbf61, 0x1160, 0x080c, 0x2f2b, 0x0188, 0x0040, 0x080c, 0xbf61,
+	0x1118, 0x080c, 0x30ef, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108,
+	0x015e, 0x1f04, 0x2e8c, 0x70ab, 0xffff, 0x0018, 0x001e, 0x015e,
+	0x71aa, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016,
+	0x70ab, 0x0001, 0x2009, 0x007e, 0x080c, 0x6210, 0x1168, 0xb813,
+	0x00ff, 0xb817, 0xfffe, 0x080c, 0x3057, 0x04a9, 0x0128, 0x70d8,
+	0xc0bd, 0x70da, 0x080c, 0xbcae, 0x001e, 0x00ce, 0x0005, 0x0016,
+	0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff,
+	0xb842, 0x080c, 0x9c58, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbcdb,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x61ad, 0x2001, 0x0000, 0x080c,
+	0x61c1, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
+	0x2009, 0x0004, 0x080c, 0x9c85, 0x9085, 0x0001, 0x00ce, 0x00de,
+	0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001,
+	0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9c58, 0x0548,
+	0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e,
+	0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c,
+	0x3006, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x9006, 0x080c, 0x61ad,
+	0x2001, 0x0002, 0x080c, 0x61c1, 0x0126, 0x2091, 0x8000, 0x70a4,
+	0x8000, 0x70a6, 0x012e, 0x2009, 0x0002, 0x080c, 0x9c85, 0x9085,
+	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6,
+	0x0026, 0x2009, 0x0080, 0x080c, 0x6210, 0x1140, 0xb813, 0x00ff,
+	0xb817, 0xfffc, 0x0039, 0x0110, 0x70df, 0xffff, 0x002e, 0x00ce,
+	0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0x9b91,
+	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1, 0x0126, 0x2091,
+	0x8000, 0x70e0, 0x8000, 0x70e2, 0x012e, 0x2009, 0x0002, 0x080c,
+	0x9c85, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
+	0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c,
+	0x6210, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8c7, 0x0004,
+	0x080c, 0x9b91, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001,
+	0x620a, 0x080c, 0xbcdb, 0x2009, 0x0022, 0x080c, 0x9c85, 0x9085,
+	0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066,
+	0x0036, 0x0026, 0x00b6, 0x21f0, 0x9036, 0x080c, 0x98c8, 0x1110,
+	0x2031, 0x0001, 0x0066, 0x080c, 0x8646, 0x080c, 0x85c6, 0x080c,
+	0x981e, 0x080c, 0xab46, 0x006e, 0x86ff, 0x0110, 0x080c, 0x98e4,
+	0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e, 0x0018,
+	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6270, 0x1140, 0x9686,
+	0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x5cf6, 0x001e,
+	0x8108, 0x1f04, 0x2feb, 0x9686, 0x0001, 0x190c, 0x3155, 0x00be,
+	0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6,
+	0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x9016, 0x080c, 0x98c8,
+	0x1110, 0x2011, 0x0001, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x0026,
+	0x2019, 0x0029, 0x080c, 0x863b, 0x0076, 0x2039, 0x0000, 0x080c,
+	0x852a, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x001e, 0x002e, 0x82ff,
+	0x0110, 0x080c, 0x98e4, 0xba10, 0xbb14, 0xbc84, 0x080c, 0x5cf6,
+	0xba12, 0xbb16, 0xbc86, 0x00be, 0x001e, 0x002e, 0x003e, 0x004e,
+	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058,
+	0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a4,
+	0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8, 0xb800,
+	0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046,
+	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c, 0x98c8,
 	0x1110, 0x2011, 0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9, 0x0001,
-	0x0080, 0x080c, 0x5386, 0xd0c4, 0x0148, 0x0040, 0x9006, 0x0046,
-	0x2020, 0x2009, 0x002d, 0x080c, 0xd251, 0x004e, 0x20a9, 0x0800,
-	0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x30c3, 0x928e, 0x007f,
-	0x0904, 0x30c3, 0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c,
-	0x81ff, 0x05c8, 0x8fff, 0x1150, 0x2001, 0x195f, 0x0006, 0x2003,
-	0x0001, 0x080c, 0x30d5, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6,
-	0x2158, 0x2001, 0x0001, 0x080c, 0x662a, 0x00ce, 0x00be, 0x2019,
-	0x0029, 0x080c, 0x8613, 0x0076, 0x2039, 0x0000, 0x080c, 0x8502,
-	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
-	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
-	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
-	0xcfa6, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x3079, 0x002e,
-	0x82ff, 0x0110, 0x080c, 0x98c9, 0x015e, 0x001e, 0x002e, 0x003e,
-	0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016,
-	0x080c, 0x5386, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220,
-	0x2009, 0x0029, 0x080c, 0xd251, 0x001e, 0x002e, 0x004e, 0x0005,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x7290, 0x82ff, 0x01e8, 0x080c,
-	0x6658, 0x11d0, 0x2100, 0x080c, 0x2457, 0x81ff, 0x01b8, 0x2019,
-	0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0xd384, 0x0120, 0x9084,
-	0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138, 0x9096,
-	0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x0066, 0x9036, 0x080c, 0x98ad, 0x1110, 0x2031, 0x0001, 0x0066,
-	0x0036, 0x2019, 0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff, 0x0110,
-	0x080c, 0x98c9, 0x006e, 0x9180, 0x1000, 0x2004, 0x9065, 0x0158,
-	0x0016, 0x00c6, 0x2061, 0x1b02, 0x001e, 0x6112, 0x080c, 0x3003,
-	0x001e, 0x080c, 0x622d, 0x012e, 0x00ce, 0x001e, 0x0005, 0x0016,
-	0x0026, 0x2110, 0x080c, 0x94d9, 0x080c, 0xd507, 0x002e, 0x001e,
-	0x0005, 0x2001, 0x1836, 0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6,
-	0x080c, 0x70ac, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782,
-	0x080c, 0x70ac, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x9180,
-	0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc,
-	0x090c, 0x622d, 0x8108, 0x1f04, 0x315f, 0x2061, 0x1800, 0x607b,
-	0x0000, 0x607c, 0x9084, 0x00ff, 0x607e, 0x60af, 0x0000, 0x00be,
-	0x00ce, 0x0005, 0x2001, 0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011,
-	0x1854, 0x2214, 0xd2ec, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2,
-	0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4,
-	0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca,
-	0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9,
-	0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad,
-	0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3,
-	0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f,
-	0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079,
-	0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d,
-	0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863,
-	0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252,
-	0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047,
-	0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35,
-	0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b,
-	0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e,
-	0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004,
-	0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000,
-	0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00,
-	0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00,
-	0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500,
-	0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00,
-	0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000,
-	0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800,
-	0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200,
-	0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00,
-	0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000,
-	0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000,
-	0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x0070, 0x080c, 0x538d, 0xd0c4, 0x0138, 0x0030, 0x9006, 0x2020,
+	0x2009, 0x002d, 0x080c, 0xd273, 0x20a9, 0x0800, 0x9016, 0x0026,
+	0x928e, 0x007e, 0x0904, 0x30c9, 0x928e, 0x007f, 0x0904, 0x30c9,
+	0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c8,
+	0x8fff, 0x1150, 0x2001, 0x195f, 0x0006, 0x2003, 0x0001, 0x080c,
+	0x30dc, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
+	0x0001, 0x080c, 0x6631, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
+	0x863b, 0x0076, 0x2039, 0x0000, 0x080c, 0x852a, 0x00b6, 0x00c6,
+	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
+	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
+	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xcfc8, 0x001e,
+	0x007e, 0x002e, 0x8210, 0x1f04, 0x307f, 0x002e, 0x82ff, 0x0110,
+	0x080c, 0x98e4, 0x015e, 0x001e, 0x002e, 0x003e, 0x004e, 0x00be,
+	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016, 0x080c,
+	0x538d, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220, 0x2009,
+	0x0029, 0x080c, 0xd273, 0x001e, 0x002e, 0x004e, 0x0005, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x7290, 0x82ff, 0x01e8, 0x080c, 0x665f,
+	0x11d0, 0x2100, 0x080c, 0x2457, 0x81ff, 0x01b8, 0x2019, 0x0001,
+	0x8314, 0x92e0, 0x1d80, 0x2c04, 0xd384, 0x0120, 0x9084, 0xff00,
+	0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138, 0x9096, 0x00ff,
+	0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0066,
+	0x9036, 0x080c, 0x98c8, 0x1110, 0x2031, 0x0001, 0x0066, 0x0036,
+	0x2019, 0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff, 0x0110, 0x080c,
+	0x98e4, 0x006e, 0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016,
+	0x00c6, 0x2061, 0x1b02, 0x001e, 0x6112, 0x080c, 0x3006, 0x001e,
+	0x080c, 0x6234, 0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026,
+	0x2110, 0x080c, 0x94f4, 0x080c, 0xd529, 0x002e, 0x001e, 0x0005,
+	0x2001, 0x1836, 0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c,
+	0x70b7, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
+	0x70b7, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000,
+	0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c,
+	0x6234, 0x8108, 0x1f04, 0x3166, 0x2061, 0x1800, 0x607b, 0x0000,
+	0x607c, 0x9084, 0x00ff, 0x607e, 0x60af, 0x0000, 0x00be, 0x00ce,
+	0x0005, 0x2001, 0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854,
+	0x2214, 0xd2ec, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1,
+	0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3,
+	0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9,
+	0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6,
+	0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac,
+	0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f,
+	0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488,
+	0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76,
+	0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c,
+	0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c,
+	0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151,
+	0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46,
+	0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034,
+	0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a,
+	0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d,
+	0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902,
+	0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500,
+	0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000,
+	0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000,
+	0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400,
+	0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00,
+	0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000,
+	0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100,
+	0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00,
+	0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600,
+	0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200,
+	0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x1894, 0x7003, 0x0002,
-	0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046,
-	0x703b, 0x18b0, 0x703f, 0x18b0, 0x7007, 0x0001, 0x080c, 0x103b,
-	0x090c, 0x0d65, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
-	0x080c, 0x103b, 0x090c, 0x0d65, 0x2900, 0x706e, 0xa867, 0x0002,
-	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x1894, 0x7004, 0x0002, 0x32b3,
-	0x32b4, 0x32c7, 0x32db, 0x0005, 0x1004, 0x32c4, 0x0e04, 0x32c4,
-	0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128,
-	0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079,
-	0x0000, 0x2061, 0x18ae, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128,
-	0x9086, 0x0200, 0x0904, 0x33af, 0x0005, 0x7018, 0x2048, 0x2061,
-	0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff,
-	0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086,
-	0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c,
-	0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61cc,
-	0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x33ac, 0x61cc, 0x0804,
-	0x3341, 0x3383, 0x33bb, 0x33c5, 0x33c9, 0x33d3, 0x33d9, 0x33dd,
-	0x33ed, 0x33f0, 0x33fa, 0x33ff, 0x3404, 0x340f, 0x341a, 0x3429,
-	0x3438, 0x3446, 0x345d, 0x3478, 0x33ac, 0x3521, 0x355f, 0x3604,
-	0x3615, 0x3638, 0x33ac, 0x33ac, 0x33ac, 0x3670, 0x3690, 0x3699,
-	0x36c5, 0x36cb, 0x33ac, 0x3711, 0x33ac, 0x33ac, 0x33ac, 0x33ac,
-	0x33ac, 0x371c, 0x3725, 0x372d, 0x372f, 0x33ac, 0x33ac, 0x33ac,
-	0x33ac, 0x33ac, 0x33ac, 0x375f, 0x33ac, 0x33ac, 0x33ac, 0x33ac,
-	0x33ac, 0x377c, 0x37d7, 0x33ac, 0x33ac, 0x33ac, 0x33ac, 0x33ac,
-	0x33ac, 0x0002, 0x3801, 0x3804, 0x3863, 0x387c, 0x38ac, 0x3b4e,
-	0x33ac, 0x4f57, 0x33ac, 0x33ac, 0x33ac, 0x33ac, 0x33ac, 0x33ac,
-	0x33ac, 0x33ac, 0x33fa, 0x33ff, 0x404d, 0x53aa, 0x4063, 0x4fe6,
-	0x5037, 0x513a, 0x33ac, 0x519c, 0x51d8, 0x5209, 0x5315, 0x5236,
-	0x5295, 0x33ac, 0x4067, 0x41f7, 0x420d, 0x4232, 0x4297, 0x430b,
-	0x432b, 0x43a2, 0x43fe, 0x445a, 0x445d, 0x4482, 0x44f5, 0x455f,
-	0x4567, 0x4699, 0x47fb, 0x482f, 0x4a79, 0x33ac, 0x4a97, 0x4b5a,
-	0x4c30, 0x33ac, 0x33ac, 0x33ac, 0x33ac, 0x4c96, 0x4cb1, 0x4567,
-	0x4ef7, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x48ad, 0x0126,
-	0x2091, 0x8000, 0x0e04, 0x338d, 0x0010, 0x012e, 0x0cc0, 0x7c36,
-	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
-	0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11be, 0x7007, 0x0001, 0x2091, 0x5000,
-	0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021,
-	0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868,
-	0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88,
-	0x7a8c, 0x7884, 0x7990, 0x0804, 0x48ba, 0x7883, 0x0004, 0x7884,
-	0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
-	0x7990, 0x0804, 0x48bd, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804,
-	0x3383, 0x7984, 0x2114, 0x0804, 0x3383, 0x20e1, 0x0000, 0x2099,
-	0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003,
-	0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3383, 0x7884, 0x2060, 0x04d8,
-	0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001a, 0x789b, 0x0317,
-	0x0804, 0x3383, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039,
-	0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210,
-	0x0804, 0x33b8, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x33bf, 0x79a0,
-	0x9182, 0x0040, 0x0210, 0x0804, 0x33b8, 0x2138, 0x7d98, 0x7c9c,
-	0x0804, 0x33cd, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x33b8,
-	0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804,
-	0x3383, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60,
-	0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3383, 0x0804, 0x33b2,
-	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x33b8, 0x21e0, 0x20a9,
-	0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3383, 0x2069, 0x1853,
-	0x7884, 0x7990, 0x911a, 0x1a04, 0x33b8, 0x8019, 0x0904, 0x33b8,
-	0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a,
-	0x685e, 0x080c, 0x73dd, 0x0804, 0x3383, 0x2069, 0x1853, 0x7884,
-	0x7994, 0x911a, 0x1a04, 0x33b8, 0x8019, 0x0904, 0x33b8, 0x684e,
-	0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6762, 0x012e, 0x0804, 0x3383,
-	0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33b5,
-	0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1,
-	0x189c, 0x4101, 0x080c, 0x4871, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x33b5, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
-	0x48ba, 0x701f, 0x349c, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff,
-	0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015,
-	0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x33b5,
-	0x810f, 0x918c, 0x00ff, 0x0904, 0x33b5, 0x7112, 0x7010, 0x8001,
-	0x0560, 0x7012, 0x080c, 0x4871, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x33b5, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494,
-	0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
-	0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48ba, 0x701f,
-	0x34da, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120,
-	0x9096, 0x000a, 0x1904, 0x33b5, 0x0888, 0x7014, 0x2048, 0xa868,
-	0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160,
-	0xc2fd, 0xaa7a, 0x080c, 0x5ddd, 0x0150, 0x0126, 0x2091, 0x8000,
-	0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x60f4, 0x1128, 0x7007,
-	0x0003, 0x701f, 0x3506, 0x0005, 0x080c, 0x6bac, 0x0126, 0x2091,
-	0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x189c, 0x400a,
-	0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
-	0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804,
-	0x48bd, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883,
-	0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009,
-	0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200,
-	0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd,
-	0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x0180, 0x2001, 0x19f3, 0x2004, 0x9005, 0x0128,
-	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
-	0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff,
-	0x1904, 0x33b5, 0x7984, 0x080c, 0x6269, 0x1904, 0x33b8, 0x7e98,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x33b8, 0x7c88, 0x7d8c,
-	0x080c, 0x649b, 0x080c, 0x642c, 0x1518, 0x2061, 0x1ddc, 0x0126,
-	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
-	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e,
-	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x33b5,
-	0x0c30, 0x080c, 0xb437, 0x012e, 0x0904, 0x33b5, 0x0804, 0x3383,
-	0x900e, 0x2001, 0x0005, 0x080c, 0x6bac, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xbb30, 0x080c, 0x698f, 0x012e, 0x0804, 0x3383, 0x00a6,
-	0x2950, 0xb198, 0x080c, 0x6269, 0x1904, 0x35f1, 0xb6a4, 0x9684,
-	0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x649b,
-	0x080c, 0x6446, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000,
-	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
-	0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c,
-	0x2001, 0x1819, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28,
-	0x080c, 0xb437, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e,
-	0x2001, 0x0005, 0x080c, 0x6bac, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xbb30, 0x080c, 0x6983, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a,
-	0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
-	0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001,
-	0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x33b5, 0x080c,
-	0x4888, 0x0904, 0x33b8, 0x080c, 0x6330, 0x0904, 0x33b5, 0x080c,
-	0x64a1, 0x0904, 0x33b5, 0x0804, 0x4322, 0x81ff, 0x1904, 0x33b5,
-	0x080c, 0x48a4, 0x0904, 0x33b8, 0x080c, 0x652f, 0x0904, 0x33b5,
-	0x2019, 0x0005, 0x79a8, 0x080c, 0x64bc, 0x0904, 0x33b5, 0x7888,
-	0x908a, 0x1000, 0x1a04, 0x33b8, 0x8003, 0x800b, 0x810b, 0x9108,
-	0x080c, 0x813f, 0x7984, 0xd184, 0x1904, 0x3383, 0x0804, 0x4322,
-	0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450,
-	0x2029, 0x07ff, 0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c,
-	0x6269, 0x11d8, 0x080c, 0x652f, 0x1128, 0x2009, 0x0002, 0x62bc,
-	0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x64bc, 0x1118,
-	0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x080c, 0x813f, 0x8529, 0x1ae0, 0x012e,
-	0x0804, 0x3383, 0x012e, 0x0804, 0x33b5, 0x012e, 0x0804, 0x33b8,
-	0x080c, 0x4888, 0x0904, 0x33b8, 0x080c, 0x6330, 0x0904, 0x33b5,
-	0x080c, 0x98ad, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
-	0x8613, 0x0076, 0x903e, 0x080c, 0x8502, 0x900e, 0x080c, 0xcfa6,
-	0x007e, 0x00ce, 0x080c, 0x98c9, 0x080c, 0x649b, 0x0804, 0x3383,
-	0x080c, 0x4888, 0x0904, 0x33b8, 0x080c, 0x649b, 0x2208, 0x0804,
-	0x3383, 0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1906, 0x6810,
-	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071,
-	0x19b8, 0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300,
-	0x9218, 0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3383, 0x00f6,
-	0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110,
-	0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1906, 0x6910,
-	0x62b8, 0x0804, 0x3383, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x33b5, 0x0126, 0x2091, 0x8000, 0x080c, 0x539a, 0x0128, 0x2009,
-	0x0007, 0x012e, 0x0804, 0x33b5, 0x012e, 0x6158, 0x9190, 0x3184,
-	0x2215, 0x9294, 0x00ff, 0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8,
-	0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8,
-	0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8,
-	0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068,
-	0x080c, 0x70ac, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120,
-	0x2009, 0x0005, 0x0804, 0x33b5, 0x9036, 0x7e9a, 0x7f9e, 0x0804,
-	0x3383, 0x6148, 0x624c, 0x2019, 0x1957, 0x231c, 0x2001, 0x1958,
-	0x2004, 0x789a, 0x0804, 0x3383, 0x0126, 0x2091, 0x8000, 0x6138,
-	0x623c, 0x6340, 0x012e, 0x0804, 0x3383, 0x080c, 0x48a4, 0x0904,
-	0x33b8, 0xba44, 0xbb38, 0x0804, 0x3383, 0x080c, 0x0d65, 0x080c,
-	0x48a4, 0x2110, 0x0904, 0x33b8, 0xb804, 0x908c, 0x00ff, 0x918e,
-	0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009,
-	0x1904, 0x33b5, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6,
-	0x9066, 0x080c, 0x98ad, 0x080c, 0x94d9, 0x080c, 0x8613, 0x0076,
-	0x903e, 0x080c, 0x8502, 0x900e, 0x080c, 0xcfa6, 0x007e, 0x00ce,
-	0x080c, 0x98c9, 0xb807, 0x0407, 0x012e, 0x0804, 0x3383, 0x6148,
-	0x624c, 0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f,
-	0x9305, 0x6816, 0x788c, 0x2069, 0x1957, 0x2d1c, 0x206a, 0x7e98,
-	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1958, 0x2d04,
-	0x266a, 0x789a, 0x0804, 0x3383, 0x0126, 0x2091, 0x8000, 0x6138,
-	0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0eb4, 0xd0c4, 0x01a8,
-	0x00d6, 0x78a8, 0x2009, 0x196e, 0x200a, 0x78ac, 0x2011, 0x196f,
-	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
-	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011,
-	0x0116, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010,
-	0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4,
-	0x190c, 0x0ecf, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114,
-	0x2012, 0x012e, 0x0804, 0x3383, 0x00f6, 0x2079, 0x1800, 0x7a38,
-	0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002,
-	0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898,
-	0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x33b8, 0x788c, 0x902d,
-	0x0904, 0x33b8, 0x900e, 0x080c, 0x6269, 0x1120, 0xba44, 0xbb38,
-	0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c,
-	0x48a4, 0x0904, 0x33b8, 0x7888, 0x900d, 0x0904, 0x33b8, 0x788c,
-	0x9005, 0x0904, 0x33b8, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804,
-	0x3383, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x539a,
-	0x1904, 0x33b5, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff,
-	0x1130, 0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182,
-	0x007f, 0x16e0, 0x9188, 0x3184, 0x210d, 0x918c, 0x00ff, 0x2001,
-	0x1817, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105,
-	0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x9b76, 0x000e, 0x0510,
-	0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x620f, 0x2b08, 0x00be,
-	0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4871, 0x01d0, 0x9006,
-	0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f,
-	0x385c, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9c6a, 0x012e,
-	0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x33b5, 0x00ce, 0x0804,
-	0x33b8, 0x080c, 0x9bcc, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904,
-	0x33b5, 0x0804, 0x3383, 0x2061, 0x1a3f, 0x0126, 0x2091, 0x8000,
-	0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350,
-	0x6070, 0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804,
-	0x3383, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x33b5, 0x080c,
-	0x70ac, 0x0904, 0x33b5, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070,
-	0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x248d, 0x080c, 0x55b4,
-	0x012e, 0x0804, 0x3383, 0x012e, 0x0804, 0x33b8, 0x0006, 0x0016,
-	0x00c6, 0x00e6, 0x2001, 0x197a, 0x2070, 0x2061, 0x1853, 0x6008,
-	0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x83f1, 0x7206, 0x00ee,
-	0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
-	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3385, 0x7884, 0xd0fc,
-	0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e,
-	0x0804, 0x33b8, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908,
-	0x9102, 0x1230, 0x012e, 0x0804, 0x33b8, 0x012e, 0x0804, 0x33b5,
-	0x080c, 0x9b4b, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3927, 0x00c6,
-	0x080c, 0x4871, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a,
-	0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a,
-	0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822,
-	0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a,
-	0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080,
-	0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3ab1, 0x0928,
-	0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808,
-	0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c,
-	0x48ba, 0x701f, 0x39ee, 0x7023, 0x0001, 0x012e, 0x0005, 0x080c,
-	0x98ad, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x080c, 0x3896, 0x2001, 0x1970, 0x2003, 0x0000,
-	0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000,
-	0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3b20, 0x080c, 0x3adf,
-	0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19b8, 0x2079, 0x0090,
-	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035,
-	0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011,
-	0x0001, 0x080c, 0x3e91, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dbe,
-	0x080c, 0x3ceb, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140,
-	0x1db8, 0x080c, 0x3f05, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe,
-	0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050,
-	0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050,
-	0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054,
-	0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004,
-	0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00,
-	0x00ce, 0x0138, 0x080c, 0x3cf5, 0x080c, 0x3ada, 0x0058, 0x080c,
-	0x3ada, 0x080c, 0x3e29, 0x080c, 0x3db4, 0x2001, 0x020b, 0x2004,
-	0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
-	0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020,
-	0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004,
-	0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x12d6, 0x2009, 0x0028,
-	0x080c, 0x2052, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c, 0x98c9,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
-	0x004e, 0x2001, 0x1970, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804,
-	0x3383, 0x012e, 0x2021, 0x400c, 0x0804, 0x3385, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156,
-	0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005,
-	0x0904, 0x3a4a, 0x2048, 0x1f04, 0x39fe, 0x7068, 0x2040, 0xa28c,
-	0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029,
-	0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e,
-	0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x48ba, 0x701f, 0x39ee,
-	0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006,
-	0x080c, 0x0f9f, 0x000e, 0x080c, 0x48bd, 0x701f, 0x39ee, 0x015e,
-	0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118,
-	0x701f, 0x3aaf, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
-	0x2009, 0x007f, 0x080c, 0x6209, 0x0110, 0x9006, 0x0030, 0xb813,
-	0x00ff, 0xb817, 0xfffd, 0x080c, 0xbd0f, 0x015e, 0x00de, 0x009e,
-	0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904,
-	0x33b5, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086,
-	0x0096, 0x00d6, 0x0156, 0x701f, 0x3a81, 0x7007, 0x0003, 0x0804,
-	0x3a3f, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3385,
-	0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4,
+	0x8000, 0x8000, 0x8000, 0x2071, 0x1894, 0x7003, 0x0002, 0x9006,
+	0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046, 0x703b,
+	0x18b0, 0x703f, 0x18b0, 0x7007, 0x0001, 0x080c, 0x103b, 0x090c,
+	0x0d65, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c,
+	0x103b, 0x090c, 0x0d65, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab,
+	0xdcb0, 0x0005, 0x2071, 0x1894, 0x7004, 0x0002, 0x32ba, 0x32bb,
+	0x32ce, 0x32e2, 0x0005, 0x1004, 0x32cb, 0x0e04, 0x32cb, 0x2079,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128, 0x700f,
+	0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000,
+	0x2061, 0x18ae, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128, 0x9086,
+	0x0200, 0x0904, 0x33b6, 0x0005, 0x7018, 0x2048, 0x2061, 0x1800,
+	0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff, 0x9296,
+	0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103,
+	0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c, 0x0807,
+	0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61cc, 0x0042,
+	0x2100, 0x908a, 0x003f, 0x1a04, 0x33b3, 0x61cc, 0x0804, 0x3348,
+	0x338a, 0x33c2, 0x33cc, 0x33d0, 0x33da, 0x33e0, 0x33e4, 0x33f4,
+	0x33f7, 0x3401, 0x3406, 0x340b, 0x3416, 0x3421, 0x3430, 0x343f,
+	0x344d, 0x3464, 0x347f, 0x33b3, 0x3528, 0x3566, 0x360b, 0x361c,
+	0x363f, 0x33b3, 0x33b3, 0x33b3, 0x3677, 0x3697, 0x36a0, 0x36cc,
+	0x36d2, 0x33b3, 0x3718, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
+	0x3723, 0x372c, 0x3734, 0x3736, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
+	0x33b3, 0x33b3, 0x3766, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
+	0x3783, 0x37de, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
+	0x0002, 0x3808, 0x380b, 0x386a, 0x3883, 0x38b3, 0x3b55, 0x33b3,
+	0x4f5e, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
+	0x33b3, 0x3401, 0x3406, 0x4054, 0x53b1, 0x406a, 0x4fed, 0x503e,
+	0x5141, 0x33b3, 0x51a3, 0x51df, 0x5210, 0x531c, 0x523d, 0x529c,
+	0x33b3, 0x406e, 0x41fe, 0x4214, 0x4239, 0x429e, 0x4312, 0x4332,
+	0x43a9, 0x4405, 0x4461, 0x4464, 0x4489, 0x44fc, 0x4566, 0x456e,
+	0x46a0, 0x4802, 0x4836, 0x4a80, 0x33b3, 0x4a9e, 0x4b61, 0x4c37,
+	0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x4c9d, 0x4cb8, 0x456e, 0x4efe,
+	0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x48b4, 0x0126, 0x2091,
+	0x8000, 0x0e04, 0x3394, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486,
+	0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82,
+	0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11be, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f,
+	0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021, 0x4002,
+	0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868, 0x2021,
+	0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c,
+	0x7884, 0x7990, 0x0804, 0x48c1, 0x7883, 0x0004, 0x7884, 0x0807,
+	0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990,
+	0x0804, 0x48c4, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x338a,
+	0x7984, 0x2114, 0x0804, 0x338a, 0x20e1, 0x0000, 0x2099, 0x0021,
+	0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984,
+	0x7a88, 0x7b8c, 0x0804, 0x338a, 0x7884, 0x2060, 0x04d8, 0x2009,
+	0x0003, 0x2011, 0x0002, 0x2019, 0x001c, 0x789b, 0x0317, 0x0804,
+	0x338a, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001,
+	0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
+	0x33bf, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x33c6, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x33bf, 0x2138, 0x7d98, 0x7c9c, 0x0804,
+	0x33d4, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x33bf, 0x21e8,
+	0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x338a,
+	0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109,
+	0x1dd8, 0x2010, 0x9005, 0x0904, 0x338a, 0x0804, 0x33b9, 0x79a0,
+	0x9182, 0x0040, 0x0210, 0x0804, 0x33bf, 0x21e0, 0x20a9, 0x0001,
+	0x7984, 0x2198, 0x4012, 0x0804, 0x338a, 0x2069, 0x1853, 0x7884,
+	0x7990, 0x911a, 0x1a04, 0x33bf, 0x8019, 0x0904, 0x33bf, 0x684a,
+	0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e,
+	0x080c, 0x73e8, 0x0804, 0x338a, 0x2069, 0x1853, 0x7884, 0x7994,
+	0x911a, 0x1a04, 0x33bf, 0x8019, 0x0904, 0x33bf, 0x684e, 0x6946,
+	0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6769, 0x012e, 0x0804, 0x338a, 0x902e,
+	0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc, 0x7984,
+	0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c,
+	0x4101, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc,
+	0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48c1,
+	0x701f, 0x34a3, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096,
+	0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138,
+	0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x33bc, 0x810f,
+	0x918c, 0x00ff, 0x0904, 0x33bc, 0x7112, 0x7010, 0x8001, 0x0560,
+	0x7012, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc,
+	0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598,
+	0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
+	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48c1, 0x701f, 0x34e1,
+	0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096,
+	0x000a, 0x1904, 0x33bc, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd,
+	0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd,
+	0xaa7a, 0x080c, 0x5de4, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a,
+	0xa982, 0x012e, 0x0050, 0x080c, 0x60fb, 0x1128, 0x7007, 0x0003,
+	0x701f, 0x350d, 0x0005, 0x080c, 0x6bb3, 0x0126, 0x2091, 0x8000,
+	0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x189c, 0x400a, 0x2100,
+	0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
+	0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x48c4,
+	0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000,
+	0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f,
+	0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061,
+	0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104,
+	0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x0180, 0x2001, 0x19f3, 0x2004, 0x9005, 0x0128, 0x2001,
+	0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002,
+	0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904,
+	0x33bc, 0x7984, 0x080c, 0x6270, 0x1904, 0x33bf, 0x7e98, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x1a04, 0x33bf, 0x7c88, 0x7d8c, 0x080c,
+	0x64a2, 0x080c, 0x6433, 0x1518, 0x2061, 0x1ddc, 0x0126, 0x2091,
+	0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130,
+	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0,
+	0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x33bc, 0x0c30,
+	0x080c, 0xb452, 0x012e, 0x0904, 0x33bc, 0x0804, 0x338a, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6bb3, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xbb4b, 0x080c, 0x6996, 0x012e, 0x0804, 0x338a, 0x00a6, 0x2950,
+	0xb198, 0x080c, 0x6270, 0x1904, 0x35f8, 0xb6a4, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x64a2, 0x080c,
+	0x644d, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c, 0x2001,
+	0x1819, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c,
+	0xb452, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6bb3, 0x0126, 0x2091, 0x8000, 0x080c, 0xbb4b,
+	0x080c, 0x698a, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010,
+	0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48,
+	0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008,
+	0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x488f,
+	0x0904, 0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x080c, 0x64a8,
+	0x0904, 0x33bc, 0x0804, 0x4329, 0x81ff, 0x1904, 0x33bc, 0x080c,
+	0x48ab, 0x0904, 0x33bf, 0x080c, 0x6536, 0x0904, 0x33bc, 0x2019,
+	0x0005, 0x79a8, 0x080c, 0x64c3, 0x0904, 0x33bc, 0x7888, 0x908a,
+	0x1000, 0x1a04, 0x33bf, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
+	0x8167, 0x7984, 0xd184, 0x1904, 0x338a, 0x0804, 0x4329, 0x0126,
+	0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029,
+	0x07ff, 0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x6270,
+	0x11d8, 0x080c, 0x6536, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518,
+	0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x64c3, 0x1118, 0x2009,
+	0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x080c, 0x8167, 0x8529, 0x1ae0, 0x012e, 0x0804,
+	0x338a, 0x012e, 0x0804, 0x33bc, 0x012e, 0x0804, 0x33bf, 0x080c,
+	0x488f, 0x0904, 0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x080c,
+	0x98c8, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x863b,
+	0x0076, 0x903e, 0x080c, 0x852a, 0x900e, 0x080c, 0xcfc8, 0x007e,
+	0x00ce, 0x080c, 0x98e4, 0x080c, 0x64a2, 0x0804, 0x338a, 0x080c,
+	0x488f, 0x0904, 0x33bf, 0x080c, 0x64a2, 0x2208, 0x0804, 0x338a,
+	0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1906, 0x6810, 0x6914,
+	0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071, 0x19b8,
+	0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300, 0x9218,
+	0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x338a, 0x00f6, 0x0016,
+	0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178,
+	0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b8,
+	0x0804, 0x338a, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x53a1, 0x0128, 0x2009, 0x0007,
+	0x012e, 0x0804, 0x33bc, 0x012e, 0x6158, 0x9190, 0x318b, 0x2215,
+	0x9294, 0x00ff, 0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8, 0x97c4,
+	0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4,
+	0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4,
+	0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c,
+	0x70b7, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009,
+	0x0005, 0x0804, 0x33bc, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x338a,
+	0x6148, 0x624c, 0x2019, 0x1957, 0x231c, 0x2001, 0x1958, 0x2004,
+	0x789a, 0x0804, 0x338a, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c,
+	0x6340, 0x012e, 0x0804, 0x338a, 0x080c, 0x48ab, 0x0904, 0x33bf,
+	0xba44, 0xbb38, 0x0804, 0x338a, 0x080c, 0x0d65, 0x080c, 0x48ab,
+	0x2110, 0x0904, 0x33bf, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006,
+	0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904,
+	0x33bc, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066,
+	0x080c, 0x98c8, 0x080c, 0x94f4, 0x080c, 0x863b, 0x0076, 0x903e,
+	0x080c, 0x852a, 0x900e, 0x080c, 0xcfc8, 0x007e, 0x00ce, 0x080c,
+	0x98e4, 0xb807, 0x0407, 0x012e, 0x0804, 0x338a, 0x6148, 0x624c,
+	0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f, 0x9305,
+	0x6816, 0x788c, 0x2069, 0x1957, 0x2d1c, 0x206a, 0x7e98, 0x9682,
+	0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1958, 0x2d04, 0x266a,
+	0x789a, 0x0804, 0x338a, 0x0126, 0x2091, 0x8000, 0x6138, 0x7884,
+	0x603a, 0x910e, 0xd1b4, 0x190c, 0x0eb4, 0xd0c4, 0x01a8, 0x00d6,
+	0x78a8, 0x2009, 0x196e, 0x200a, 0x78ac, 0x2011, 0x196f, 0x2012,
+	0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a,
+	0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011, 0x0116,
+	0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010, 0x918c,
+	0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4, 0x190c,
+	0x0ecf, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114, 0x2012,
+	0x012e, 0x0804, 0x338a, 0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898,
+	0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214,
+	0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898, 0x9005,
+	0x01a8, 0x7888, 0x9025, 0x0904, 0x33bf, 0x788c, 0x902d, 0x0904,
+	0x33bf, 0x900e, 0x080c, 0x6270, 0x1120, 0xba44, 0xbb38, 0xbc46,
+	0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x48ab,
+	0x0904, 0x33bf, 0x7888, 0x900d, 0x0904, 0x33bf, 0x788c, 0x9005,
+	0x0904, 0x33bf, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804, 0x338a,
+	0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x53a1, 0x1904,
+	0x33bc, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff, 0x1130,
+	0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182, 0x007f,
+	0x16e0, 0x9188, 0x318b, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1817,
+	0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105, 0x0126,
+	0x2091, 0x8000, 0x0006, 0x080c, 0x9b91, 0x000e, 0x0510, 0x602e,
+	0x620a, 0x7984, 0x00b6, 0x080c, 0x6216, 0x2b08, 0x00be, 0x1500,
+	0x6112, 0x6023, 0x0001, 0x080c, 0x4878, 0x01d0, 0x9006, 0xa866,
+	0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f, 0x3863,
+	0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9c85, 0x012e, 0x00ce,
+	0x0005, 0x012e, 0x00ce, 0x0804, 0x33bc, 0x00ce, 0x0804, 0x33bf,
+	0x080c, 0x9be7, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904, 0x33bc,
+	0x0804, 0x338a, 0x2061, 0x1a3f, 0x0126, 0x2091, 0x8000, 0x6000,
+	0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350, 0x6070,
+	0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804, 0x338a,
+	0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x70b7,
+	0x0904, 0x33bc, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070, 0x9202,
+	0x0248, 0x9085, 0x0001, 0x080c, 0x248d, 0x080c, 0x55bb, 0x012e,
+	0x0804, 0x338a, 0x012e, 0x0804, 0x33bf, 0x0006, 0x0016, 0x00c6,
+	0x00e6, 0x2001, 0x197a, 0x2070, 0x2061, 0x1853, 0x6008, 0x2072,
+	0x900e, 0x2011, 0x1400, 0x080c, 0x8419, 0x7206, 0x00ee, 0x00ce,
+	0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0128,
+	0x012e, 0x2021, 0x400b, 0x0804, 0x338c, 0x7884, 0xd0fc, 0x0148,
+	0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e, 0x0804,
+	0x33bf, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908, 0x9102,
+	0x1230, 0x012e, 0x0804, 0x33bf, 0x012e, 0x0804, 0x33bc, 0x080c,
+	0x9b66, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x392e, 0x00c6, 0x080c,
+	0x4878, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a, 0x7898,
+	0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a, 0x2001,
+	0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822, 0x2001,
+	0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a, 0x2001,
+	0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080, 0x0003,
+	0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3ab8, 0x0928, 0x7014,
+	0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808, 0xd0b4,
 	0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0,
-	0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f9f, 0x000e, 0x080c,
-	0x48bd, 0x007e, 0x701f, 0x39ee, 0x7023, 0x0001, 0x0005, 0x0804,
-	0x3383, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833,
-	0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c,
-	0x4871, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100,
-	0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005,
-	0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe,
-	0x000e, 0x0005, 0x2001, 0x1970, 0x2003, 0x0001, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004, 0x601a,
-	0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104, 0xc1ac,
-	0x6106, 0x080c, 0x4871, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900,
-	0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004,
-	0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x197a, 0x2004,
-	0x6036, 0x2009, 0x0040, 0x080c, 0x2052, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000,
-	0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x00e6, 0x080c, 0x4871, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
-	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031,
-	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
-	0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300,
-	0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004,
-	0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x81ff, 0x0148, 0x080c, 0x2811, 0x1130, 0x9006, 0x080c,
-	0x276e, 0x9006, 0x080c, 0x2751, 0x7884, 0x9084, 0x0007, 0x0002,
-	0x3b6b, 0x3b74, 0x3b7d, 0x3b68, 0x3b68, 0x3b68, 0x3b68, 0x3b68,
-	0x012e, 0x0804, 0x33b8, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800,
-	0x200a, 0x080c, 0x3d3f, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085,
-	0x4000, 0x200a, 0x080c, 0x3d3f, 0x0078, 0x080c, 0x70ac, 0x1128,
-	0x012e, 0x2009, 0x0016, 0x0804, 0x33b5, 0x81ff, 0x0128, 0x012e,
-	0x2021, 0x400b, 0x0804, 0x3385, 0x080c, 0x98ad, 0x0086, 0x0096,
-	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3896,
-	0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068,
-	0x2060, 0x2058, 0x080c, 0x3fe0, 0x080c, 0x3f30, 0x903e, 0x2720,
-	0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19b8, 0x2079, 0x0090,
-	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e,
-	0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3e91, 0x080c,
-	0x2819, 0x080c, 0x2819, 0x080c, 0x2819, 0x080c, 0x2819, 0x080c,
-	0x3e91, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dbe, 0x2009, 0x9c40,
-	0x8109, 0x11b0, 0x080c, 0x3cf5, 0x2001, 0x0004, 0x200c, 0x918c,
-	0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x33b5, 0x0cf8,
-	0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079,
-	0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c,
-	0x81ff, 0x0150, 0x080c, 0x3d9c, 0x2d00, 0x9c05, 0x9b05, 0x0120,
-	0x080c, 0x3cf5, 0x0804, 0x3c9e, 0x080c, 0x3f05, 0x080c, 0x3e29,
-	0x080c, 0x3d7f, 0x080c, 0x3db4, 0x00f6, 0x2079, 0x0100, 0x7824,
-	0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3cf5, 0x00fe, 0x0804, 0x3c9e,
-	0x00fe, 0x080c, 0x3ceb, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602,
-	0x2001, 0x0033, 0x2502, 0x080c, 0x3cf5, 0x0080, 0x87ff, 0x0138,
-	0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001,
-	0x1a3c, 0x2004, 0x9086, 0x0000, 0x1904, 0x3bee, 0x2001, 0x032f,
-	0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904,
-	0x3c9e, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904,
-	0x3c9e, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884,
-	0xd0ac, 0x1148, 0x2001, 0x1a3c, 0x2003, 0x0003, 0x2001, 0x032a,
-	0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108,
-	0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x2052, 0x2900,
-	0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000,
-	0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001,
-	0x0203, 0x2004, 0x1f04, 0x3c75, 0x00ce, 0x0030, 0xa817, 0x0001,
-	0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100,
-	0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6,
-	0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3ba8, 0x001e, 0x00c6,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
-	0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c,
-	0x918c, 0xfffd, 0x2102, 0x080c, 0x12d6, 0x7884, 0x9084, 0x0003,
-	0x9086, 0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x2052, 0x2001,
-	0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c, 0x28d4,
-	0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x080c, 0x98c9, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00,
-	0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
-	0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3383, 0x012e, 0x2021,
-	0x400c, 0x0804, 0x3385, 0x9085, 0x0001, 0x1d04, 0x3cf4, 0x2091,
-	0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003,
-	0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a3c, 0x2003,
-	0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x2052, 0x2001, 0x0227,
-	0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005,
-	0x00f6, 0x00e6, 0x2071, 0x19b8, 0x7054, 0x9086, 0x0000, 0x0520,
-	0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c,
-	0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x2052, 0x782c, 0xd0fc,
-	0x0d88, 0x080c, 0x3f05, 0x7054, 0x9086, 0x0000, 0x1d58, 0x782b,
-	0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2052,
-	0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6,
-	0x2079, 0x0100, 0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c,
-	0x246d, 0x080c, 0x2890, 0x080c, 0x28d4, 0x784b, 0xf7f7, 0x7843,
-	0x0090, 0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019, 0x61a8,
-	0x7820, 0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4, 0x7852,
-	0x2011, 0x0048, 0x080c, 0x286d, 0x7843, 0x0040, 0x2019, 0x01f4,
-	0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2833,
-	0x2011, 0x0020, 0x080c, 0x286d, 0x7843, 0x0000, 0x9006, 0x080c,
-	0x2833, 0x2011, 0x0048, 0x080c, 0x286d, 0x00fe, 0x0005, 0x7884,
-	0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a3c, 0x2079, 0x0320,
-	0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000,
-	0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b,
-	0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc,
-	0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009,
-	0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68,
-	0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c,
-	0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071,
-	0x0100, 0x2001, 0x197b, 0x2004, 0x70e2, 0x080c, 0x3ad0, 0x1188,
-	0x2001, 0x181f, 0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff,
-	0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109,
-	0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c,
-	0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073,
-	0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080,
-	0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e,
-	0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984,
-	0x9085, 0x0092, 0x7016, 0x080c, 0x3f05, 0x00f6, 0x2071, 0x1a3c,
-	0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
-	0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109,
-	0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011,
-	0x080c, 0x3e91, 0x2011, 0x0001, 0x080c, 0x3e91, 0x00fe, 0x00ee,
-	0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a3c, 0x2079, 0x0320, 0x792c,
-	0xd1fc, 0x0904, 0x3e8e, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904,
-	0x3e8a, 0x7000, 0x0002, 0x3e8e, 0x3e3f, 0x3e6f, 0x3e8a, 0xd1bc,
-	0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c,
-	0x3e91, 0x0904, 0x3e8e, 0x080c, 0x3e91, 0x0804, 0x3e8e, 0x00f6,
-	0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b,
-	0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8,
-	0x080c, 0x3d9c, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8,
-	0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001,
-	0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3e33,
-	0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086,
-	0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc,
-	0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe,
-	0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016,
-	0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c,
-	0x938a, 0x0007, 0x1a0c, 0x0d65, 0x9398, 0x3ebf, 0x231d, 0x083f,
-	0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e,
-	0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a,
-	0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3efc,
-	0x3ef3, 0x3eea, 0x3ee1, 0x3ed8, 0x3ecf, 0x3ec6, 0xa964, 0x7902,
-	0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974,
-	0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005,
-	0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916,
-	0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0,
-	0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912,
-	0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc,
-	0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906,
-	0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086,
-	0x2071, 0x19b8, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b,
-	0x0002, 0x2940, 0x9026, 0x7054, 0x0002, 0x3f2c, 0x3f18, 0x3f23,
-	0x8001, 0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e91,
-	0x190c, 0x3e91, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc, 0x1d38,
-	0x2011, 0x0001, 0x080c, 0x3e91, 0x008e, 0x00ee, 0x00fe, 0x0005,
-	0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197b,
-	0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce,
-	0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520,
-	0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c,
-	0x4871, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
-	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
-	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3fa8,
-	0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4871, 0xa813, 0x0019,
-	0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866,
-	0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090,
-	0x2079, 0x0100, 0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040,
-	0x080c, 0x2052, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a,
-	0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca,
-	0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000,
-	0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a,
-	0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041,
-	0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005,
-	0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086,
-	0x080c, 0x4871, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006,
-	0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005,
-	0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001,
-	0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4871, 0x2940,
-	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
-	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
-	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3fa8, 0x1d68,
-	0x2900, 0xa85a, 0x00d8, 0x080c, 0x4871, 0x2940, 0xa013, 0x0019,
-	0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066,
-	0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a,
-	0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c,
-	0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a3c, 0x2003,
-	0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x48c1,
+	0x701f, 0x39f5, 0x7023, 0x0001, 0x012e, 0x0005, 0x080c, 0x98c8,
+	0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x080c, 0x389d, 0x2001, 0x1970, 0x2003, 0x0000, 0x2021,
+	0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf,
+	0x32e1, 0x60bf, 0x0012, 0x080c, 0x3b27, 0x080c, 0x3ae6, 0x00f6,
+	0x00e6, 0x0086, 0x2940, 0x2071, 0x19b8, 0x2079, 0x0090, 0x00d6,
+	0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004,
+	0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001,
+	0x080c, 0x3e98, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dc5, 0x080c,
+	0x3cf2, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8,
+	0x080c, 0x3f0c, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
+	0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084,
+	0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084,
+	0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037,
+	0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004, 0x9106,
+	0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce,
+	0x0138, 0x080c, 0x3cfc, 0x080c, 0x3ae1, 0x0058, 0x080c, 0x3ae1,
+	0x080c, 0x3e30, 0x080c, 0x3dbb, 0x2001, 0x020b, 0x2004, 0xd0e4,
+	0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027,
+	0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb,
+	0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfffd, 0x2102, 0x080c, 0x12d6, 0x2009, 0x0028, 0x080c,
+	0x2052, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c, 0x98e4, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e,
+	0x2001, 0x1970, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x338a,
+	0x012e, 0x2021, 0x400c, 0x0804, 0x338c, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014,
+	0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904,
+	0x3a51, 0x2048, 0x1f04, 0x3a05, 0x7068, 0x2040, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000,
+	0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086,
+	0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x080c, 0x48c1, 0x701f, 0x39f5, 0x00b0,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c,
+	0x0f9f, 0x000e, 0x080c, 0x48c4, 0x701f, 0x39f5, 0x015e, 0x00de,
+	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f,
+	0x3ab6, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009,
+	0x007f, 0x080c, 0x6210, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff,
+	0xb817, 0xfffd, 0x080c, 0xbd2a, 0x015e, 0x00de, 0x009e, 0x008e,
+	0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x33bc,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096,
+	0x00d6, 0x0156, 0x701f, 0x3a88, 0x7007, 0x0003, 0x0804, 0x3a46,
+	0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x338c, 0x0076,
+	0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120,
+	0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098,
+	0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f9f, 0x000e, 0x080c, 0x48c4,
+	0x007e, 0x701f, 0x39f5, 0x7023, 0x0001, 0x0005, 0x0804, 0x338a,
+	0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e,
+	0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4878,
+	0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006,
+	0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e,
+	0x0005, 0x2001, 0x1970, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004, 0x601a, 0x2061,
+	0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106,
+	0x080c, 0x4878, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a,
+	0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a,
+	0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x197a, 0x2004, 0x6036,
+	0x2009, 0x0040, 0x080c, 0x2052, 0x2001, 0x002a, 0x2004, 0x9084,
+	0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca,
+	0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
+	0x080c, 0x4878, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800,
+	0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004,
+	0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873,
+	0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003,
 	0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c,
 	0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x20a9, 0x0013, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004,
-	0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108,
-	0x0005, 0x0804, 0x3383, 0x7d98, 0x7c9c, 0x0804, 0x347a, 0x080c,
-	0x70ac, 0x190c, 0x5c9a, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48ba,
-	0x701f, 0x407b, 0x0005, 0x080c, 0x5395, 0x1130, 0x3b00, 0x3a08,
-	0xc194, 0xc095, 0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005,
-	0x0904, 0x33b8, 0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104,
-	0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010,
-	0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100,
-	0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106,
-	0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x33b8,
-	0x9288, 0x3184, 0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130,
-	0x6828, 0x908a, 0x007f, 0x1a04, 0x33b8, 0x605a, 0x6888, 0x9084,
-	0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1982,
-	0x9080, 0x2560, 0x2005, 0x200a, 0x2008, 0x2001, 0x0018, 0x080c,
-	0x989e, 0x2009, 0x0390, 0x200b, 0x0400, 0x000e, 0x2009, 0x1983,
-	0x9080, 0x2564, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04,
-	0x33b8, 0x908a, 0x0841, 0x1a04, 0x33b8, 0x9084, 0x0007, 0x1904,
-	0x33b8, 0x680c, 0x9005, 0x0904, 0x33b8, 0x6810, 0x9005, 0x0904,
-	0x33b8, 0x6848, 0x6940, 0x910a, 0x1a04, 0x33b8, 0x8001, 0x0904,
-	0x33b8, 0x684c, 0x6944, 0x910a, 0x1a04, 0x33b8, 0x8001, 0x0904,
-	0x33b8, 0x6814, 0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff,
-	0x604e, 0x080c, 0x73dd, 0x080c, 0x672d, 0x080c, 0x6762, 0x6808,
-	0x602a, 0x080c, 0x1fc4, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001,
-	0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x24c7, 0x003e,
-	0x6000, 0x9086, 0x0000, 0x1904, 0x41e7, 0x6818, 0x691c, 0x6a20,
-	0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e,
-	0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c,
-	0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006,
-	0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9,
-	0x0004, 0x20a1, 0x1984, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004,
-	0x20a1, 0x199e, 0x20e9, 0x0001, 0x4001, 0x080c, 0x82a8, 0x00c6,
-	0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8, 0x0020, 0x839d,
-	0x12b0, 0x3508, 0x8109, 0x080c, 0x79b3, 0x6878, 0x6016, 0x6874,
-	0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006,
-	0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04,
-	0x415f, 0x00ce, 0x00c6, 0x2061, 0x196d, 0x2063, 0x0001, 0x9006,
-	0x080c, 0x276e, 0x9006, 0x080c, 0x2751, 0x0000, 0x00ce, 0x00e6,
-	0x2c70, 0x080c, 0x0e9c, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011,
-	0x0114, 0x2204, 0x9085, 0x0180, 0x2012, 0x6a80, 0x9284, 0x0030,
-	0x9086, 0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82,
-	0x2001, 0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170,
-	0x928e, 0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa,
-	0x080c, 0x253c, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6,
-	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
-	0x70ac, 0x0128, 0x080c, 0x4c8a, 0x0110, 0x080c, 0x248d, 0x60d0,
-	0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x41cf, 0x00d0, 0x080c,
-	0x70ac, 0x1168, 0x2011, 0x6f22, 0x080c, 0x8131, 0x2011, 0x6f15,
-	0x080c, 0x8237, 0x080c, 0x73b1, 0x080c, 0x6fdd, 0x0040, 0x080c,
-	0x5b90, 0x0028, 0x6003, 0x0004, 0x2009, 0x41e7, 0x0010, 0x0804,
-	0x3383, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c,
-	0x1118, 0x2091, 0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000,
-	0x9086, 0x0000, 0x0904, 0x33b5, 0x2069, 0x1853, 0x7890, 0x6842,
-	0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x2039, 0x0001, 0x0804, 0x48bd, 0x9006, 0x080c, 0x248d,
-	0x81ff, 0x1904, 0x33b5, 0x080c, 0x70ac, 0x11b0, 0x080c, 0x73ac,
-	0x080c, 0x5cd5, 0x080c, 0x317f, 0x0118, 0x6130, 0xc18d, 0x6132,
-	0x080c, 0xbf46, 0x0130, 0x080c, 0x70cf, 0x1118, 0x080c, 0x7080,
-	0x0038, 0x080c, 0x6fdd, 0x0020, 0x080c, 0x5c9a, 0x080c, 0x5b90,
-	0x0804, 0x3383, 0x81ff, 0x1904, 0x33b5, 0x080c, 0x70ac, 0x1110,
-	0x0804, 0x33b5, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001,
-	0x1d80, 0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126,
-	0x2091, 0x8000, 0x2039, 0x0001, 0x080c, 0x48bd, 0x701f, 0x3381,
-	0x012e, 0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9,
-	0x0040, 0x20e9, 0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304,
-	0x6558, 0x9588, 0x3184, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e,
-	0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x6269, 0x1190,
-	0xb814, 0x821c, 0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007,
-	0x201a, 0x0038, 0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405,
-	0x201a, 0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201,
-	0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1,
-	0x1d80, 0x2099, 0x1d80, 0x080c, 0x5c25, 0x0804, 0x423f, 0x080c,
-	0x48a4, 0x0904, 0x33b8, 0x080c, 0x4871, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x33b5, 0x080c, 0x5386, 0xd0b4, 0x0558, 0x7884, 0x908e,
-	0x007e, 0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508,
-	0x080c, 0x317a, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x080c, 0xb9fb, 0x1120, 0x2009, 0x0003, 0x0804, 0x33b5,
-	0x7007, 0x0003, 0x701f, 0x42cd, 0x0005, 0x080c, 0x48a4, 0x0904,
-	0x33b8, 0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008,
-	0x9080, 0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006,
-	0x2098, 0x080c, 0x0f9f, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080,
-	0x000a, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0f9f, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x0804, 0x48bd, 0x81ff, 0x1904, 0x33b5, 0x080c, 0x4888,
-	0x0904, 0x33b8, 0x080c, 0x64aa, 0x0904, 0x33b5, 0x0058, 0xa878,
-	0x9005, 0x0120, 0x2009, 0x0004, 0x0804, 0x33b5, 0xa974, 0xaa94,
-	0x0804, 0x3383, 0x080c, 0x538e, 0x0904, 0x3383, 0x701f, 0x4317,
-	0x7007, 0x0003, 0x0005, 0x81ff, 0x1904, 0x33b5, 0x7888, 0x908a,
-	0x1000, 0x1a04, 0x33b8, 0x080c, 0x48a4, 0x0904, 0x33b8, 0x080c,
-	0x6660, 0x0120, 0x080c, 0x6668, 0x1904, 0x33b8, 0x080c, 0x652f,
-	0x0904, 0x33b5, 0x2019, 0x0004, 0x900e, 0x080c, 0x64bc, 0x0904,
-	0x33b5, 0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000,
-	0x12f8, 0x080c, 0x48a2, 0x01e0, 0x080c, 0x6660, 0x0118, 0x080c,
-	0x6668, 0x11b0, 0x080c, 0x652f, 0x2009, 0x0002, 0x0168, 0x2009,
-	0x0002, 0x2019, 0x0004, 0x080c, 0x64bc, 0x2009, 0x0003, 0x0120,
-	0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010,
-	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
-	0xa897, 0x4000, 0x080c, 0x538e, 0x0110, 0x9006, 0x0018, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110,
-	0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400,
-	0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c,
-	0x6269, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
-	0x813f, 0x0005, 0x81ff, 0x1904, 0x33b5, 0x798c, 0x2001, 0x1951,
-	0x918c, 0x8000, 0x2102, 0x080c, 0x4888, 0x0904, 0x33b8, 0x080c,
-	0x6660, 0x0120, 0x080c, 0x6668, 0x1904, 0x33b8, 0x080c, 0x6330,
-	0x0904, 0x33b5, 0x080c, 0x64b3, 0x0904, 0x33b5, 0x2001, 0x1951,
-	0x2004, 0xd0fc, 0x1904, 0x3383, 0x0804, 0x4322, 0xa9a0, 0x2001,
-	0x1951, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4895, 0x01a0,
-	0x080c, 0x6660, 0x0118, 0x080c, 0x6668, 0x1170, 0x080c, 0x6330,
-	0x2009, 0x0002, 0x0128, 0x080c, 0x64b3, 0x1170, 0x2009, 0x0003,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1951,
-	0x2004, 0xd0fc, 0x1128, 0x080c, 0x538e, 0x0110, 0x9006, 0x0018,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904,
-	0x33b5, 0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c,
-	0x4888, 0x0904, 0x33b8, 0x080c, 0x6660, 0x0120, 0x080c, 0x6668,
-	0x1904, 0x33b8, 0x080c, 0x6330, 0x0904, 0x33b5, 0x080c, 0x64a1,
-	0x0904, 0x33b5, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x3383,
-	0x0804, 0x4322, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d,
-	0x2102, 0x080c, 0x4895, 0x01a0, 0x080c, 0x6660, 0x0118, 0x080c,
-	0x6668, 0x1170, 0x080c, 0x6330, 0x2009, 0x0002, 0x0128, 0x080c,
-	0x64a1, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010,
-	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
-	0xa897, 0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c,
-	0x538e, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0000, 0x0005, 0x6100, 0x0804, 0x3383, 0x080c, 0x48a4, 0x0904,
-	0x33b8, 0x080c, 0x539a, 0x1904, 0x33b5, 0x79a8, 0xd184, 0x1158,
-	0xb834, 0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f,
-	0xba28, 0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007,
-	0x789a, 0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200,
-	0x0804, 0x3383, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a,
-	0x0003, 0x1a04, 0x33b5, 0x6258, 0x7884, 0x9206, 0x1560, 0x2031,
-	0x1848, 0x2009, 0x013c, 0x2136, 0x2001, 0x1840, 0x2009, 0x000c,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8,
-	0x9084, 0x0080, 0x1118, 0x000e, 0x0804, 0x48bd, 0x000e, 0x2031,
-	0x0000, 0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076,
-	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x110c, 0x7007, 0x0002,
-	0x701f, 0x44db, 0x0005, 0x81ff, 0x1904, 0x33b5, 0x080c, 0x48a4,
-	0x0904, 0x33b8, 0x080c, 0x6660, 0x1904, 0x33b5, 0x00c6, 0x080c,
-	0x4871, 0x00ce, 0x0904, 0x33b5, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x7ea8, 0x080c, 0xb9a1, 0x0904, 0x33b5, 0x7007, 0x0003,
-	0x701f, 0x44df, 0x0005, 0x080c, 0x404d, 0x0804, 0x3383, 0xa830,
-	0x9086, 0x0100, 0x0904, 0x33b5, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48bd, 0x9006, 0x080c, 0x248d,
-	0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904,
-	0x33b5, 0x080c, 0x70ac, 0x0110, 0x080c, 0x5c9a, 0x7888, 0x908a,
-	0x1000, 0x1a04, 0x33b8, 0x7984, 0x9186, 0x00ff, 0x0138, 0x9182,
-	0x007f, 0x1a04, 0x33b8, 0x2100, 0x080c, 0x2457, 0x0026, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x2061, 0x19d4, 0x601b, 0x0000, 0x601f,
-	0x0000, 0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x70ac, 0x1158,
-	0x080c, 0x73ac, 0x080c, 0x5cd5, 0x9085, 0x0001, 0x080c, 0x70f3,
-	0x080c, 0x6fdd, 0x00f0, 0x080c, 0x98ad, 0x080c, 0x9b52, 0x080c,
-	0x98c9, 0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
-	0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
-	0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bc0, 0x080c,
-	0x81f5, 0x7984, 0x080c, 0x70ac, 0x1110, 0x2009, 0x00ff, 0x7a88,
-	0x080c, 0x4385, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3383, 0x7984,
-	0x080c, 0x6209, 0x2b08, 0x1904, 0x33b8, 0x0804, 0x3383, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x33b5, 0x60d8, 0xd0ac, 0x1130,
-	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x33b5, 0x080c, 0x4871,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x33b5, 0x7984, 0x9192, 0x0021,
-	0x1a04, 0x33b8, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
-	0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x48ba, 0x701f, 0x4597,
-	0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x4e3c, 0x0005, 0x2009,
-	0x0080, 0x080c, 0x6269, 0x1118, 0x080c, 0x6660, 0x0120, 0x2021,
-	0x400a, 0x0804, 0x3385, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70,
-	0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4630,
-	0x90be, 0x0112, 0x0904, 0x4630, 0x90be, 0x0113, 0x0904, 0x4630,
-	0x90be, 0x0114, 0x0904, 0x4630, 0x90be, 0x0117, 0x0904, 0x4630,
-	0x90be, 0x011a, 0x0904, 0x4630, 0x90be, 0x011c, 0x0904, 0x4630,
-	0x90be, 0x0121, 0x0904, 0x4617, 0x90be, 0x0131, 0x0904, 0x4617,
-	0x90be, 0x0171, 0x0904, 0x4630, 0x90be, 0x0173, 0x0904, 0x4630,
-	0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x463b,
-	0x90be, 0x0212, 0x0904, 0x4624, 0x90be, 0x0213, 0x05e8, 0x90be,
-	0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120,
-	0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be,
-	0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x33b8, 0x7028, 0x9080,
-	0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007,
-	0x080c, 0x4679, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
-	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4679, 0x00c8, 0x7028,
+	0x81ff, 0x0148, 0x080c, 0x2811, 0x1130, 0x9006, 0x080c, 0x276e,
+	0x9006, 0x080c, 0x2751, 0x7884, 0x9084, 0x0007, 0x0002, 0x3b72,
+	0x3b7b, 0x3b84, 0x3b6f, 0x3b6f, 0x3b6f, 0x3b6f, 0x3b6f, 0x012e,
+	0x0804, 0x33bf, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a,
+	0x080c, 0x3d46, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000,
+	0x200a, 0x080c, 0x3d46, 0x0078, 0x080c, 0x70b7, 0x1128, 0x012e,
+	0x2009, 0x0016, 0x0804, 0x33bc, 0x81ff, 0x0128, 0x012e, 0x2021,
+	0x400b, 0x0804, 0x338c, 0x080c, 0x98c8, 0x0086, 0x0096, 0x00a6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x389d, 0x2009,
+	0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060,
+	0x2058, 0x080c, 0x3fe7, 0x080c, 0x3f37, 0x903e, 0x2720, 0x00f6,
+	0x00e6, 0x0086, 0x2940, 0x2071, 0x19b8, 0x2079, 0x0090, 0x00d6,
+	0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0,
+	0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3e98, 0x080c, 0x2819,
+	0x080c, 0x2819, 0x080c, 0x2819, 0x080c, 0x2819, 0x080c, 0x3e98,
+	0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dc5, 0x2009, 0x9c40, 0x8109,
+	0x11b0, 0x080c, 0x3cfc, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd,
+	0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x33bc, 0x0cf8, 0x2001,
+	0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000,
+	0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff,
+	0x0150, 0x080c, 0x3da3, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c,
+	0x3cfc, 0x0804, 0x3ca5, 0x080c, 0x3f0c, 0x080c, 0x3e30, 0x080c,
+	0x3d86, 0x080c, 0x3dbb, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac,
+	0x0130, 0x8b58, 0x080c, 0x3cfc, 0x00fe, 0x0804, 0x3ca5, 0x00fe,
+	0x080c, 0x3cf2, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001,
+	0x0033, 0x2502, 0x080c, 0x3cfc, 0x0080, 0x87ff, 0x0138, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a3c,
+	0x2004, 0x9086, 0x0000, 0x1904, 0x3bf5, 0x2001, 0x032f, 0x2003,
+	0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3ca5,
+	0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3ca5,
+	0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac,
+	0x1148, 0x2001, 0x1a3c, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003,
+	0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016,
+	0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x2052, 0x2900, 0xa85a,
+	0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6,
+	0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203,
+	0x2004, 0x1f04, 0x3c7c, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0,
+	0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061,
+	0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
+	0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3baf, 0x001e, 0x00c6, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106,
+	0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x080c, 0x12d6, 0x7884, 0x9084, 0x0003, 0x9086,
+	0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x2052, 0x2001, 0x0227,
+	0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c, 0x28d4, 0x6052,
+	0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x080c, 0x98e4, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05,
+	0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x008e, 0x1118, 0x012e, 0x0804, 0x338a, 0x012e, 0x2021, 0x400c,
+	0x0804, 0x338c, 0x9085, 0x0001, 0x1d04, 0x3cfb, 0x2091, 0x6000,
+	0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a3c, 0x2003, 0x0000,
+	0x0071, 0x2009, 0x0048, 0x080c, 0x2052, 0x2001, 0x0227, 0x2024,
+	0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0x19b8, 0x7054, 0x9086, 0x0000, 0x0520, 0x2079,
+	0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
+	0x1120, 0x2009, 0x0040, 0x080c, 0x2052, 0x782c, 0xd0fc, 0x0d88,
+	0x080c, 0x3f0c, 0x7054, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004,
+	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2052, 0x782b,
+	0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079,
+	0x0100, 0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x246d,
+	0x080c, 0x2890, 0x080c, 0x28d4, 0x784b, 0xf7f7, 0x7843, 0x0090,
+	0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019, 0x61a8, 0x7820,
+	0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4, 0x7852, 0x2011,
+	0x0048, 0x080c, 0x286d, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001,
+	0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2833, 0x2011,
+	0x0020, 0x080c, 0x286d, 0x7843, 0x0000, 0x9006, 0x080c, 0x2833,
+	0x2011, 0x0048, 0x080c, 0x286d, 0x00fe, 0x0005, 0x7884, 0xd0ac,
+	0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a3c, 0x2079, 0x0320, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140,
+	0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019,
+	0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe,
+	0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033,
+	0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4,
+	0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084,
+	0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100,
+	0x2001, 0x197b, 0x2004, 0x70e2, 0x080c, 0x3ad7, 0x1188, 0x2001,
+	0x181f, 0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e,
+	0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080,
+	0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c, 0x716e,
+	0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809,
+	0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000,
+	0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6,
+	0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085,
+	0x0092, 0x7016, 0x080c, 0x3f0c, 0x00f6, 0x2071, 0x1a3c, 0x2079,
+	0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c,
+	0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0,
+	0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c,
+	0x3e98, 0x2011, 0x0001, 0x080c, 0x3e98, 0x00fe, 0x00ee, 0x0005,
+	0x00f6, 0x00e6, 0x2071, 0x1a3c, 0x2079, 0x0320, 0x792c, 0xd1fc,
+	0x0904, 0x3e95, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e91,
+	0x7000, 0x0002, 0x3e95, 0x3e46, 0x3e76, 0x3e91, 0xd1bc, 0x1170,
+	0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e98,
+	0x0904, 0x3e95, 0x080c, 0x3e98, 0x0804, 0x3e95, 0x00f6, 0x2079,
+	0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004,
+	0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c,
+	0x3da3, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe,
+	0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002,
+	0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3e3a, 0x2011,
+	0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015,
+	0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960,
+	0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058,
+	0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a,
+	0x0007, 0x1a0c, 0x0d65, 0x9398, 0x3ec6, 0x231d, 0x083f, 0x9080,
+	0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a,
+	0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001,
+	0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3f03, 0x3efa,
+	0x3ef1, 0x3ee8, 0x3edf, 0x3ed6, 0x3ecd, 0xa964, 0x7902, 0xa968,
+	0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902,
+	0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984,
+	0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005,
+	0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916,
+	0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0,
+	0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912,
+	0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc,
+	0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071,
+	0x19b8, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002,
+	0x2940, 0x9026, 0x7054, 0x0002, 0x3f33, 0x3f1f, 0x3f2a, 0x8001,
+	0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e98, 0x190c,
+	0x3e98, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc, 0x1d38, 0x2011,
+	0x0001, 0x080c, 0x3e98, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6,
+	0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004,
+	0x601a, 0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104,
+	0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038,
+	0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x4878,
+	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
+	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
+	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3faf, 0x1d68,
+	0x2900, 0xa85a, 0x00d0, 0x080c, 0x4878, 0xa813, 0x0019, 0xa817,
+	0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001,
+	0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079,
+	0x0100, 0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c,
+	0x2052, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006,
+	0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006,
+	0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
+	0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099,
+	0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e,
+	0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c,
+	0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400,
+	0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c,
+	0x4878, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a,
+	0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
+	0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030,
+	0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4878, 0x2940, 0xa813,
+	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
+	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
+	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3faf, 0x1d68, 0x2900,
+	0xa85a, 0x00d8, 0x080c, 0x4878, 0x2940, 0xa013, 0x0019, 0xa017,
+	0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001,
+	0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003,
+	0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d,
+	0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a3c, 0x2003, 0x0003,
+	0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000,
+	0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d,
+	0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9,
+	0x0013, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x2009,
+	0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005,
+	0x0804, 0x338a, 0x7d98, 0x7c9c, 0x0804, 0x3481, 0x080c, 0x70b7,
+	0x190c, 0x5ca1, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48c1, 0x701f,
+	0x4082, 0x0005, 0x080c, 0x539c, 0x1130, 0x3b00, 0x3a08, 0xc194,
+	0xc095, 0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904,
+	0x33bf, 0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138,
+	0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d,
+	0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104,
+	0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce,
+	0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x33bf, 0x9288,
+	0x318b, 0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828,
+	0x908a, 0x007f, 0x1a04, 0x33bf, 0x605a, 0x6888, 0x9084, 0x0030,
+	0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1982, 0x9080,
+	0x2560, 0x2005, 0x200a, 0x2008, 0x2001, 0x0018, 0x080c, 0x98b9,
+	0x2009, 0x0390, 0x200b, 0x0400, 0x000e, 0x2009, 0x1983, 0x9080,
+	0x2564, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x33bf,
+	0x908a, 0x0841, 0x1a04, 0x33bf, 0x9084, 0x0007, 0x1904, 0x33bf,
+	0x680c, 0x9005, 0x0904, 0x33bf, 0x6810, 0x9005, 0x0904, 0x33bf,
+	0x6848, 0x6940, 0x910a, 0x1a04, 0x33bf, 0x8001, 0x0904, 0x33bf,
+	0x684c, 0x6944, 0x910a, 0x1a04, 0x33bf, 0x8001, 0x0904, 0x33bf,
+	0x6814, 0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e,
+	0x080c, 0x73e8, 0x080c, 0x6734, 0x080c, 0x6769, 0x6808, 0x602a,
+	0x080c, 0x1fc4, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001,
+	0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x24c7, 0x003e, 0x6000,
+	0x9086, 0x0000, 0x1904, 0x41ee, 0x6818, 0x691c, 0x6a20, 0x6b24,
+	0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322,
+	0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007,
+	0x810f, 0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a,
+	0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004,
+	0x20a1, 0x1984, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1,
+	0x199e, 0x20e9, 0x0001, 0x4001, 0x080c, 0x82d0, 0x00c6, 0x900e,
+	0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8, 0x0020, 0x839d, 0x12b0,
+	0x3508, 0x8109, 0x080c, 0x79be, 0x6878, 0x6016, 0x6874, 0x2008,
+	0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108,
+	0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x4166,
+	0x00ce, 0x00c6, 0x2061, 0x196d, 0x2063, 0x0001, 0x9006, 0x080c,
+	0x276e, 0x9006, 0x080c, 0x2751, 0x0000, 0x00ce, 0x00e6, 0x2c70,
+	0x080c, 0x0e9c, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114,
+	0x2204, 0x9085, 0x0180, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086,
+	0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001,
+	0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e,
+	0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c,
+	0x253c, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061,
+	0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x70b7,
+	0x0128, 0x080c, 0x4c91, 0x0110, 0x080c, 0x248d, 0x60d0, 0x9005,
+	0x01c0, 0x6003, 0x0001, 0x2009, 0x41d6, 0x00d0, 0x080c, 0x70b7,
+	0x1168, 0x2011, 0x6f2d, 0x080c, 0x8159, 0x2011, 0x6f20, 0x080c,
+	0x825f, 0x080c, 0x73bc, 0x080c, 0x6fe8, 0x0040, 0x080c, 0x5b97,
+	0x0028, 0x6003, 0x0004, 0x2009, 0x41ee, 0x0010, 0x0804, 0x338a,
+	0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118,
+	0x2091, 0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086,
+	0x0000, 0x0904, 0x33bc, 0x2069, 0x1853, 0x7890, 0x6842, 0x7894,
+	0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x2039, 0x0001, 0x0804, 0x48c4, 0x9006, 0x080c, 0x248d, 0x81ff,
+	0x1904, 0x33bc, 0x080c, 0x70b7, 0x11b0, 0x080c, 0x73b7, 0x080c,
+	0x5cdc, 0x080c, 0x3186, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c,
+	0xbf61, 0x0130, 0x080c, 0x70da, 0x1118, 0x080c, 0x708b, 0x0038,
+	0x080c, 0x6fe8, 0x0020, 0x080c, 0x5ca1, 0x080c, 0x5b97, 0x0804,
+	0x338a, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x70b7, 0x1110, 0x0804,
+	0x33bc, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80,
+	0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091,
+	0x8000, 0x2039, 0x0001, 0x080c, 0x48c4, 0x701f, 0x3388, 0x012e,
+	0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040,
+	0x20e9, 0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x6558,
+	0x9588, 0x318b, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011,
+	0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x6270, 0x1190, 0xb814,
+	0x821c, 0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a,
+	0x0038, 0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a,
+	0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
+	0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80,
+	0x2099, 0x1d80, 0x080c, 0x5c2c, 0x0804, 0x4246, 0x080c, 0x48ab,
+	0x0904, 0x33bf, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x33bc, 0x080c, 0x538d, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e,
+	0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c,
+	0x3181, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xba16, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc, 0x7007,
+	0x0003, 0x701f, 0x42d4, 0x0005, 0x080c, 0x48ab, 0x0904, 0x33bf,
+	0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
+	0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f9f, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a,
+	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c,
+	0x0f9f, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x0804, 0x48c4, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x488f, 0x0904,
+	0x33bf, 0x080c, 0x64b1, 0x0904, 0x33bc, 0x0058, 0xa878, 0x9005,
+	0x0120, 0x2009, 0x0004, 0x0804, 0x33bc, 0xa974, 0xaa94, 0x0804,
+	0x338a, 0x080c, 0x5395, 0x0904, 0x338a, 0x701f, 0x431e, 0x7007,
+	0x0003, 0x0005, 0x81ff, 0x1904, 0x33bc, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x33bf, 0x080c, 0x48ab, 0x0904, 0x33bf, 0x080c, 0x6667,
+	0x0120, 0x080c, 0x666f, 0x1904, 0x33bf, 0x080c, 0x6536, 0x0904,
+	0x33bc, 0x2019, 0x0004, 0x900e, 0x080c, 0x64c3, 0x0904, 0x33bc,
+	0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8,
+	0x080c, 0x48a9, 0x01e0, 0x080c, 0x6667, 0x0118, 0x080c, 0x666f,
+	0x11b0, 0x080c, 0x6536, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x64c3, 0x2009, 0x0003, 0x0120, 0xa998,
+	0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x080c, 0x5395, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071,
+	0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400, 0x9506,
+	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6270,
+	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8167,
+	0x0005, 0x81ff, 0x1904, 0x33bc, 0x798c, 0x2001, 0x1951, 0x918c,
+	0x8000, 0x2102, 0x080c, 0x488f, 0x0904, 0x33bf, 0x080c, 0x6667,
+	0x0120, 0x080c, 0x666f, 0x1904, 0x33bf, 0x080c, 0x6337, 0x0904,
+	0x33bc, 0x080c, 0x64ba, 0x0904, 0x33bc, 0x2001, 0x1951, 0x2004,
+	0xd0fc, 0x1904, 0x338a, 0x0804, 0x4329, 0xa9a0, 0x2001, 0x1951,
+	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489c, 0x01a0, 0x080c,
+	0x6667, 0x0118, 0x080c, 0x666f, 0x1170, 0x080c, 0x6337, 0x2009,
+	0x0002, 0x0128, 0x080c, 0x64ba, 0x1170, 0x2009, 0x0003, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1951, 0x2004,
+	0xd0fc, 0x1128, 0x080c, 0x5395, 0x0110, 0x9006, 0x0018, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x33bc,
+	0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c, 0x488f,
+	0x0904, 0x33bf, 0x080c, 0x6667, 0x0120, 0x080c, 0x666f, 0x1904,
+	0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x080c, 0x64a8, 0x0904,
+	0x33bc, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x338a, 0x0804,
+	0x4329, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d, 0x2102,
+	0x080c, 0x489c, 0x01a0, 0x080c, 0x6667, 0x0118, 0x080c, 0x666f,
+	0x1170, 0x080c, 0x6337, 0x2009, 0x0002, 0x0128, 0x080c, 0x64a8,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x5395,
+	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x0005, 0x6100, 0x0804, 0x338a, 0x080c, 0x48ab, 0x0904, 0x33bf,
+	0x080c, 0x53a1, 0x1904, 0x33bc, 0x79a8, 0xd184, 0x1158, 0xb834,
+	0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28,
+	0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a,
+	0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804,
+	0x338a, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003,
+	0x1a04, 0x33bc, 0x6258, 0x7884, 0x9206, 0x1560, 0x2031, 0x1848,
+	0x2009, 0x013c, 0x2136, 0x2001, 0x1840, 0x2009, 0x000c, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8, 0x9084,
+	0x0080, 0x1118, 0x000e, 0x0804, 0x48c4, 0x000e, 0x2031, 0x0000,
+	0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
+	0xa392, 0xa496, 0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f,
+	0x44e2, 0x0005, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x48ab, 0x0904,
+	0x33bf, 0x080c, 0x6667, 0x1904, 0x33bc, 0x00c6, 0x080c, 0x4878,
+	0x00ce, 0x0904, 0x33bc, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x7ea8, 0x080c, 0xb9bc, 0x0904, 0x33bc, 0x7007, 0x0003, 0x701f,
+	0x44e6, 0x0005, 0x080c, 0x4054, 0x0804, 0x338a, 0xa830, 0x9086,
+	0x0100, 0x0904, 0x33bc, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x0804, 0x48c4, 0x9006, 0x080c, 0x248d, 0x78a8,
+	0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x33bc,
+	0x080c, 0x70b7, 0x0110, 0x080c, 0x5ca1, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x33bf, 0x7984, 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f,
+	0x1a04, 0x33bf, 0x2100, 0x080c, 0x2457, 0x0026, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x2061, 0x19d4, 0x601b, 0x0000, 0x601f, 0x0000,
+	0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x70b7, 0x1158, 0x080c,
+	0x73b7, 0x080c, 0x5cdc, 0x9085, 0x0001, 0x080c, 0x70fe, 0x080c,
+	0x6fe8, 0x00f0, 0x080c, 0x98c8, 0x080c, 0x9b6d, 0x080c, 0x98e4,
+	0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x810f,
+	0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x196a,
+	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bc7, 0x080c, 0x821d,
+	0x7984, 0x080c, 0x70b7, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c,
+	0x438c, 0x012e, 0x00ce, 0x002e, 0x0804, 0x338a, 0x7984, 0x080c,
+	0x6210, 0x2b08, 0x1904, 0x33bf, 0x0804, 0x338a, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x33bc, 0x60d8, 0xd0ac, 0x1130, 0xd09c,
+	0x1120, 0x2009, 0x0005, 0x0804, 0x33bc, 0x080c, 0x4878, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x33bc, 0x7984, 0x9192, 0x0021, 0x1a04,
+	0x33bf, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0x702a, 0xaf60, 0x7736, 0x080c, 0x48c1, 0x701f, 0x459e, 0x7880,
+	0x9086, 0x006e, 0x0110, 0x701f, 0x4e43, 0x0005, 0x2009, 0x0080,
+	0x080c, 0x6270, 0x1118, 0x080c, 0x6667, 0x0120, 0x2021, 0x400a,
+	0x0804, 0x338c, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74,
+	0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4637, 0x90be,
+	0x0112, 0x0904, 0x4637, 0x90be, 0x0113, 0x0904, 0x4637, 0x90be,
+	0x0114, 0x0904, 0x4637, 0x90be, 0x0117, 0x0904, 0x4637, 0x90be,
+	0x011a, 0x0904, 0x4637, 0x90be, 0x011c, 0x0904, 0x4637, 0x90be,
+	0x0121, 0x0904, 0x461e, 0x90be, 0x0131, 0x0904, 0x461e, 0x90be,
+	0x0171, 0x0904, 0x4637, 0x90be, 0x0173, 0x0904, 0x4637, 0x90be,
+	0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x4642, 0x90be,
+	0x0212, 0x0904, 0x462b, 0x90be, 0x0213, 0x05e8, 0x90be, 0x0214,
+	0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120, 0xa89c,
+	0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be, 0x0300,
+	0x05b0, 0x009e, 0x00de, 0x0804, 0x33bf, 0x7028, 0x9080, 0x0010,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c,
+	0x4680, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x4680, 0x00c8, 0x7028, 0x9080,
+	0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
+	0x080c, 0x468d, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x468d, 0x7028,
 	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0001, 0x080c, 0x4686, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098,
-	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4686,
-	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
-	0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4871, 0x0550, 0xa868,
-	0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020,
-	0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe,
-	0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822,
-	0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xb9bc, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x33b5, 0x7007, 0x0003, 0x701f, 0x4670,
-	0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x33b5,
-	0xa820, 0x9086, 0x8001, 0x1904, 0x3383, 0x2009, 0x0004, 0x0804,
-	0x33b5, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104,
-	0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204,
-	0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33b5, 0x60d8,
-	0xd0ac, 0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x33b5,
-	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x33b5, 0x7984, 0x78a8,
-	0x2040, 0x080c, 0x9b4b, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33b8,
-	0x9186, 0x00ff, 0x0904, 0x33b8, 0x9182, 0x0800, 0x1a04, 0x33b8,
-	0x7a8c, 0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e, 0x0904,
-	0x33b8, 0x99cc, 0xff00, 0x0904, 0x33b8, 0x0126, 0x2091, 0x8000,
-	0x0026, 0x2011, 0x8008, 0x080c, 0x6684, 0x002e, 0x0140, 0x918d,
-	0x8000, 0x080c, 0x66ce, 0x1118, 0x2001, 0x4009, 0x0458, 0x080c,
-	0x478b, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e,
-	0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090,
-	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009,
-	0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005,
-	0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3385, 0x2b00, 0x7026,
-	0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9c3d, 0x0904,
-	0x4758, 0x2b00, 0x6012, 0x080c, 0xbcc0, 0x2e58, 0x00ee, 0x00e6,
-	0x00c6, 0x080c, 0x4871, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9bcc,
-	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804,
-	0x33b5, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868,
-	0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x3003, 0x6023,
-	0x0001, 0x9006, 0x080c, 0x61a6, 0x2001, 0x0002, 0x080c, 0x61ba,
-	0x2009, 0x0002, 0x080c, 0x9c6a, 0x78a8, 0xd094, 0x0138, 0x00ee,
-	0x7024, 0x00e6, 0x2058, 0xb8c4, 0xc08d, 0xb8c6, 0x9085, 0x0001,
-	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x33b5, 0x7007, 0x0003, 0x701f, 0x4767, 0x0005, 0xa830,
-	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3385,
-	0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04,
-	0x9294, 0x00ff, 0x0804, 0x52e3, 0x900e, 0xa868, 0xd0f4, 0x1904,
-	0x3383, 0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x3383, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
-	0x47d3, 0x902e, 0x080c, 0x9b4b, 0x0130, 0x9026, 0x20a9, 0x0800,
-	0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071,
-	0x107f, 0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8, 0x2428,
-	0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030, 0x94ce,
-	0x0080, 0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff, 0x11d8,
-	0xc5fd, 0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8, 0xbe14,
-	0x2600, 0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884, 0x0568,
-	0xd894, 0x1558, 0x080c, 0x6660, 0x1540, 0x2001, 0x4000, 0x0430,
-	0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106,
-	0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9b4b,
-	0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x47a1,
-	0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030,
-	0x080c, 0x6209, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e,
-	0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x33b5, 0x080c, 0x4871, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b5,
-	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904,
-	0x33b8, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x33b8,
-	0x2010, 0x2918, 0x080c, 0x2f9d, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x33b5, 0x7007, 0x0003, 0x701f, 0x4826, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x1904, 0x3383, 0x2009, 0x0004, 0x0804, 0x33b5, 0x7984,
-	0x080c, 0x9b4b, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33b8, 0x9186,
-	0x00ff, 0x0904, 0x33b8, 0x9182, 0x0800, 0x1a04, 0x33b8, 0x2001,
-	0x9000, 0x080c, 0x533e, 0x1904, 0x33b5, 0x0804, 0x3383, 0xa998,
-	0x080c, 0x9b4b, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff,
-	0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x533e,
-	0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a,
-	0x0c48, 0x080c, 0x1022, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005,
-	0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086,
-	0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005,
-	0x7984, 0x080c, 0x6269, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082,
-	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6269,
-	0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e,
-	0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6269,
-	0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff,
-	0x0128, 0x2148, 0xa904, 0x080c, 0x1054, 0x0cc8, 0x7116, 0x711a,
-	0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061,
-	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x3383,
-	0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001,
-	0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x48ee, 0x7a36, 0x7833,
-	0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11be, 0x0804, 0x4954, 0x0016, 0x0086,
-	0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005, 0x1540,
-	0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x1022,
-	0x0904, 0x494c, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002,
-	0x9080, 0x1cf7, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004,
-	0x2001, 0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0, 0x2c00,
-	0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460,
-	0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016,
-	0x908a, 0x0036, 0x1a0c, 0x0d65, 0x2060, 0x001e, 0x8108, 0x2105,
-	0x9005, 0xa146, 0x1520, 0x080c, 0x1022, 0x1130, 0x8109, 0xa946,
-	0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046,
-	0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080,
-	0x1cf7, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee,
-	0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00,
-	0x9082, 0x001b, 0x0002, 0x4976, 0x4976, 0x4978, 0x4976, 0x4976,
-	0x4976, 0x497c, 0x4976, 0x4976, 0x4976, 0x4980, 0x4976, 0x4976,
-	0x4976, 0x4984, 0x4976, 0x4976, 0x4976, 0x4988, 0x4976, 0x4976,
-	0x4976, 0x498c, 0x4976, 0x4976, 0x4976, 0x4991, 0x080c, 0x0d65,
-	0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878,
-	0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838,
-	0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804,
-	0x494f, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x494f, 0x00e6, 0x2071,
-	0x1894, 0x7048, 0x9005, 0x0904, 0x4a28, 0x0126, 0x2091, 0x8000,
-	0x0e04, 0x4a27, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086,
-	0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948,
-	0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x2060, 0x001e,
-	0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a2a, 0xa804, 0x9005,
-	0x090c, 0x0d65, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001,
-	0x0002, 0x9080, 0x1cf7, 0x2005, 0xa04a, 0x0804, 0x4a2a, 0x703c,
-	0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833,
-	0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x87ff, 0x0118,
-	0x2748, 0x080c, 0x1054, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170,
-	0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x1054, 0x9006, 0x7042,
-	0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040, 0x9005,
-	0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa,
-	0x18f0, 0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006, 0x703e,
-	0x703a, 0x7044, 0x9005, 0x090c, 0x0d65, 0x2048, 0xa800, 0x9005,
-	0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1cf7, 0x2005,
-	0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e,
-	0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a49, 0x4a49,
-	0x4a4b, 0x4a49, 0x4a49, 0x4a49, 0x4a50, 0x4a49, 0x4a49, 0x4a49,
-	0x4a55, 0x4a49, 0x4a49, 0x4a49, 0x4a5a, 0x4a49, 0x4a49, 0x4a49,
-	0x4a5f, 0x4a49, 0x4a49, 0x4a49, 0x4a64, 0x4a49, 0x4a49, 0x4a49,
-	0x4a69, 0x080c, 0x0d65, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x49d5,
-	0xaa84, 0xab88, 0xac8c, 0x0804, 0x49d5, 0xaa94, 0xab98, 0xac9c,
-	0x0804, 0x49d5, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49d5, 0xaab4,
-	0xabb8, 0xacbc, 0x0804, 0x49d5, 0xaac4, 0xabc8, 0xaccc, 0x0804,
-	0x49d5, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49d5, 0x0026, 0x080c,
-	0x5386, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48d1, 0x002e,
-	0x0005, 0x81ff, 0x1904, 0x33b5, 0x0126, 0x2091, 0x8000, 0x6030,
-	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x70ac, 0x1158, 0x080c,
-	0x73ac, 0x080c, 0x5cd5, 0x9085, 0x0001, 0x080c, 0x70f3, 0x080c,
-	0x6fdd, 0x0010, 0x080c, 0x5b90, 0x012e, 0x0804, 0x3383, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x33b5, 0x080c, 0x539a, 0x0120,
-	0x2009, 0x0007, 0x0804, 0x33b5, 0x080c, 0x6658, 0x0120, 0x2009,
-	0x0008, 0x0804, 0x33b5, 0x0026, 0x2011, 0x0010, 0x080c, 0x6684,
-	0x002e, 0x0140, 0x7984, 0x080c, 0x66ce, 0x1120, 0x2009, 0x4009,
-	0x0804, 0x33b5, 0x080c, 0x317a, 0x0128, 0x7984, 0x080c, 0x6209,
-	0x1904, 0x33b8, 0x080c, 0x48a4, 0x0904, 0x33b8, 0x2b00, 0x7026,
-	0x080c, 0x6660, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e,
-	0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x0804, 0x3383, 0x080c, 0x4871, 0x0904, 0x33b5, 0x9006, 0xa866,
-	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba5e, 0x0904, 0x33b5,
-	0x7888, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x7007, 0x0003,
-	0x701f, 0x4b3f, 0x0005, 0x2061, 0x1800, 0x080c, 0x539a, 0x2009,
-	0x0007, 0x1578, 0x080c, 0x6658, 0x0118, 0x2009, 0x0008, 0x0448,
-	0x080c, 0x317a, 0x0120, 0xa998, 0x080c, 0x6209, 0x1530, 0x080c,
-	0x48a2, 0x0518, 0x080c, 0x6660, 0xa89c, 0x1168, 0x9084, 0x0005,
-	0x1150, 0x900e, 0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xba5e,
-	0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x2009,
-	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a,
-	0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830,
-	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3385,
-	0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52e3, 0x900e,
-	0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x0804, 0x3383, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x33b5, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4871,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x33b5, 0x900e, 0x2130, 0x7126,
-	0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a,
-	0x20a0, 0x080c, 0x6269, 0x1904, 0x4bdd, 0x080c, 0x6660, 0x0120,
-	0x080c, 0x6668, 0x1904, 0x4bdd, 0x080c, 0x6658, 0x1130, 0x080c,
-	0x6558, 0x1118, 0xd79c, 0x0904, 0x4bdd, 0xd794, 0x1110, 0xd784,
-	0x01a8, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x3400,
-	0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00,
-	0x20e0, 0x20a9, 0x0002, 0x080c, 0x4686, 0x0048, 0x20a9, 0x0004,
-	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4686, 0x4104,
-	0xd794, 0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80, 0x0000,
-	0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9,
-	0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002,
-	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4679, 0x9c80,
-	0x0026, 0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794,
-	0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0x9b4b,
-	0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800,
-	0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686,
-	0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b79, 0x86ff,
-	0x1120, 0x7124, 0x810b, 0x0804, 0x3383, 0x7033, 0x0001, 0x7122,
-	0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44, 0xa06b,
-	0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x4c19,
-	0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c,
-	0x9036, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0x0804, 0x4b79, 0x7124, 0x810b, 0x0804, 0x3383,
-	0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00,
-	0x8007, 0x90e2, 0x0020, 0x0a04, 0x33b8, 0x9502, 0x0a04, 0x33b8,
-	0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33b8, 0x9502, 0x0a04,
-	0x33b8, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x33b8,
-	0x9502, 0x0a04, 0x33b8, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04,
-	0x33b8, 0x9502, 0x0a04, 0x33b8, 0x9384, 0xff00, 0x8007, 0x90e2,
-	0x0020, 0x0a04, 0x33b8, 0x9502, 0x0a04, 0x33b8, 0x9384, 0x00ff,
-	0x90e2, 0x0020, 0x0a04, 0x33b8, 0x9502, 0x0a04, 0x33b8, 0x9484,
-	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x33b8, 0x9502, 0x0a04,
-	0x33b8, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33b8, 0x9502,
-	0x0a04, 0x33b8, 0x2061, 0x195a, 0x6102, 0x6206, 0x630a, 0x640e,
-	0x0804, 0x3383, 0x0006, 0x080c, 0x5386, 0xd0cc, 0x000e, 0x0005,
-	0x0006, 0x080c, 0x538a, 0xd0bc, 0x000e, 0x0005, 0x6170, 0x7a84,
-	0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3383, 0x83ff, 0x1904,
-	0x33b8, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x33b8, 0x2019, 0xffff,
-	0x6074, 0x9302, 0x9200, 0x0a04, 0x33b8, 0x7986, 0x6272, 0x0804,
-	0x3383, 0x080c, 0x539a, 0x1904, 0x33b5, 0x7c88, 0x7d84, 0x7e98,
-	0x7f8c, 0x080c, 0x4871, 0x0904, 0x33b5, 0x900e, 0x901e, 0x7326,
-	0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a,
-	0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6660,
-	0x0118, 0x080c, 0x6668, 0x1148, 0x20a9, 0x0001, 0xb814, 0x4004,
-	0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800,
-	0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224,
-	0x900e, 0x2001, 0x0003, 0x080c, 0x83f1, 0x2208, 0x0804, 0x3383,
-	0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18ae,
-	0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072,
-	0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x110c, 0x7007, 0x0002,
-	0x701f, 0x4d0b, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028,
-	0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa48c,
-	0xa590, 0xa694, 0xa798, 0x0804, 0x4cc9, 0x7224, 0x900e, 0x2001,
-	0x0003, 0x080c, 0x83f1, 0x2208, 0x0804, 0x3383, 0x00f6, 0x00e6,
-	0x080c, 0x539a, 0x2009, 0x0007, 0x1904, 0x4d9e, 0x2071, 0x1894,
-	0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4d9e, 0xac9c, 0xad98,
-	0xaea4, 0xafa0, 0x0096, 0x080c, 0x103b, 0x2009, 0x0002, 0x0904,
-	0x4d9e, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860,
-	0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000,
-	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6660, 0x0118, 0x080c, 0x6668,
-	0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104,
-	0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c,
-	0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001, 0x0003,
-	0x080c, 0x83f1, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c,
-	0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c, 0x1054, 0x9006, 0x705e,
-	0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054,
-	0x9300, 0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058, 0xa076,
-	0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x4daa,
-	0x000e, 0xa0a2, 0x080c, 0x110c, 0x9006, 0x0048, 0x009e, 0xa897,
-	0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0d65, 0x00e6,
-	0x2071, 0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b, 0x0030,
-	0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005, 0x1158,
-	0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590,
-	0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
-	0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x83f1, 0xaa9a,
-	0x715c, 0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c, 0x1054, 0x705f,
-	0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f,
-	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005,
-	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6660, 0x0118,
-	0x080c, 0x6668, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810,
+	0x0001, 0x04f1, 0x00c6, 0x080c, 0x4878, 0x0550, 0xa868, 0xc0fd,
+	0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b,
+	0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2,
+	0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822, 0xa868,
+	0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xb9d7, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x33bc, 0x7007, 0x0003, 0x701f, 0x4677, 0x0005,
+	0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x33bc, 0xa820,
+	0x9086, 0x8001, 0x1904, 0x338a, 0x2009, 0x0004, 0x0804, 0x33bc,
+	0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104, 0x4004,
+	0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204, 0x4104,
+	0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc, 0x60d8, 0xd0ac,
+	0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x33bc, 0xd09c,
+	0x1120, 0x2009, 0x0005, 0x0804, 0x33bc, 0x7984, 0x78a8, 0x2040,
+	0x080c, 0x9b66, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33bf, 0x9186,
+	0x00ff, 0x0904, 0x33bf, 0x9182, 0x0800, 0x1a04, 0x33bf, 0x7a8c,
+	0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e, 0x0904, 0x33bf,
+	0x99cc, 0xff00, 0x0904, 0x33bf, 0x0126, 0x2091, 0x8000, 0x0026,
+	0x2011, 0x8008, 0x080c, 0x668b, 0x002e, 0x0140, 0x918d, 0x8000,
+	0x080c, 0x66d5, 0x1118, 0x2001, 0x4009, 0x0458, 0x080c, 0x4792,
+	0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e, 0x080c,
+	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x000e,
+	0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090, 0x90c6,
+	0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009, 0x1108,
+	0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005, 0x2009,
+	0x000a, 0x2020, 0x012e, 0x0804, 0x338c, 0x2b00, 0x7026, 0x0016,
+	0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9c58, 0x0904, 0x475f,
+	0x2b00, 0x6012, 0x080c, 0xbcdb, 0x2e58, 0x00ee, 0x00e6, 0x00c6,
+	0x080c, 0x4878, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9be7, 0x00ee,
+	0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804, 0x33bc,
+	0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd,
+	0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x3006, 0x6023, 0x0001,
+	0x9006, 0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1, 0x2009,
+	0x0002, 0x080c, 0x9c85, 0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024,
+	0x00e6, 0x2058, 0xb8c4, 0xc08d, 0xb8c6, 0x9085, 0x0001, 0x00ee,
+	0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x33bc, 0x7007, 0x0003, 0x701f, 0x476e, 0x0005, 0xa830, 0x2008,
+	0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x338c, 0x9086,
+	0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04, 0x9294,
+	0x00ff, 0x0804, 0x52ea, 0x900e, 0xa868, 0xd0f4, 0x1904, 0x338a,
+	0x080c, 0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x0804, 0x338a, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904, 0x47da,
+	0x902e, 0x080c, 0x9b66, 0x0130, 0x9026, 0x20a9, 0x0800, 0x2071,
+	0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071, 0x107f,
+	0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8, 0x2428, 0x94ce,
+	0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030, 0x94ce, 0x0080,
+	0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff, 0x11d8, 0xc5fd,
+	0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8, 0xbe14, 0x2600,
+	0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884, 0x0568, 0xd894,
+	0x1558, 0x080c, 0x6667, 0x1540, 0x2001, 0x4000, 0x0430, 0x2001,
+	0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106, 0x1158,
+	0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9b66, 0x1930,
+	0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x47a8, 0x85ff,
+	0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, 0x080c,
+	0x6210, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e, 0x00de,
+	0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc,
+	0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904, 0x33bf,
+	0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x33bf, 0x2010,
+	0x2918, 0x080c, 0x2fa0, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc,
+	0x7007, 0x0003, 0x701f, 0x482d, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1904, 0x338a, 0x2009, 0x0004, 0x0804, 0x33bc, 0x7984, 0x080c,
+	0x9b66, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33bf, 0x9186, 0x00ff,
+	0x0904, 0x33bf, 0x9182, 0x0800, 0x1a04, 0x33bf, 0x2001, 0x9000,
+	0x080c, 0x5345, 0x1904, 0x33bc, 0x0804, 0x338a, 0xa998, 0x080c,
+	0x9b66, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff, 0x0168,
+	0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x5345, 0x11a8,
+	0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a, 0x0c48,
+	0x080c, 0x1022, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005, 0x1120,
+	0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086, 0x2040,
+	0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005, 0x7984,
+	0x080c, 0x6270, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6270, 0x1130,
+	0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff,
+	0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6270, 0x1108,
+	0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff, 0x0128,
+	0x2148, 0xa904, 0x080c, 0x1054, 0x0cc8, 0x7116, 0x711a, 0x001e,
+	0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061, 0x18ae,
+	0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496,
+	0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x338a, 0x0005,
+	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x18a6,
+	0x2004, 0x9005, 0x1190, 0x0e04, 0x48f5, 0x7a36, 0x7833, 0x0012,
+	0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11be, 0x0804, 0x495b, 0x0016, 0x0086, 0x0096,
+	0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005, 0x1540, 0x7148,
+	0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x1022, 0x0904,
+	0x4953, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002, 0x9080,
+	0x1cf7, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004, 0x2001,
+	0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0, 0x2c00, 0x703a,
+	0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460, 0x7148,
+	0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016, 0x908a,
+	0x0036, 0x1a0c, 0x0d65, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005,
+	0xa146, 0x1520, 0x080c, 0x1022, 0x1130, 0x8109, 0xa946, 0x7148,
+	0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046, 0x2800,
+	0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080, 0x1cf7,
+	0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce,
+	0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082,
+	0x001b, 0x0002, 0x497d, 0x497d, 0x497f, 0x497d, 0x497d, 0x497d,
+	0x4983, 0x497d, 0x497d, 0x497d, 0x4987, 0x497d, 0x497d, 0x497d,
+	0x498b, 0x497d, 0x497d, 0x497d, 0x498f, 0x497d, 0x497d, 0x497d,
+	0x4993, 0x497d, 0x497d, 0x497d, 0x4998, 0x080c, 0x0d65, 0xa276,
+	0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296,
+	0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6,
+	0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4956,
+	0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4956, 0x00e6, 0x2071, 0x1894,
+	0x7048, 0x9005, 0x0904, 0x4a2f, 0x0126, 0x2091, 0x8000, 0x0e04,
+	0x4a2e, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086, 0x0076,
+	0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948, 0x2105,
+	0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x2060, 0x001e, 0x8108,
+	0x2105, 0x9005, 0xa94a, 0x1904, 0x4a31, 0xa804, 0x9005, 0x090c,
+	0x0d65, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001, 0x0002,
+	0x9080, 0x1cf7, 0x2005, 0xa04a, 0x0804, 0x4a31, 0x703c, 0x2060,
+	0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833, 0x0012,
+	0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x87ff, 0x0118, 0x2748,
+	0x080c, 0x1054, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170, 0x7040,
+	0x2048, 0x9005, 0x0128, 0x080c, 0x1054, 0x9006, 0x7042, 0x7046,
+	0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040, 0x9005, 0x1508,
+	0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa, 0x18f0,
+	0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006, 0x703e, 0x703a,
+	0x7044, 0x9005, 0x090c, 0x0d65, 0x2048, 0xa800, 0x9005, 0x1de0,
+	0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1cf7, 0x2005, 0xa84a,
+	0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee,
+	0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a50, 0x4a50, 0x4a52,
+	0x4a50, 0x4a50, 0x4a50, 0x4a57, 0x4a50, 0x4a50, 0x4a50, 0x4a5c,
+	0x4a50, 0x4a50, 0x4a50, 0x4a61, 0x4a50, 0x4a50, 0x4a50, 0x4a66,
+	0x4a50, 0x4a50, 0x4a50, 0x4a6b, 0x4a50, 0x4a50, 0x4a50, 0x4a70,
+	0x080c, 0x0d65, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x49dc, 0xaa84,
+	0xab88, 0xac8c, 0x0804, 0x49dc, 0xaa94, 0xab98, 0xac9c, 0x0804,
+	0x49dc, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49dc, 0xaab4, 0xabb8,
+	0xacbc, 0x0804, 0x49dc, 0xaac4, 0xabc8, 0xaccc, 0x0804, 0x49dc,
+	0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49dc, 0x0026, 0x080c, 0x538d,
+	0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48d8, 0x002e, 0x0005,
+	0x81ff, 0x1904, 0x33bc, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d,
+	0xc085, 0xc0ac, 0x6032, 0x080c, 0x70b7, 0x1158, 0x080c, 0x73b7,
+	0x080c, 0x5cdc, 0x9085, 0x0001, 0x080c, 0x70fe, 0x080c, 0x6fe8,
+	0x0010, 0x080c, 0x5b97, 0x012e, 0x0804, 0x338a, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x33bc, 0x080c, 0x53a1, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x33bc, 0x080c, 0x665f, 0x0120, 0x2009, 0x0008,
+	0x0804, 0x33bc, 0x0026, 0x2011, 0x0010, 0x080c, 0x668b, 0x002e,
+	0x0140, 0x7984, 0x080c, 0x66d5, 0x1120, 0x2009, 0x4009, 0x0804,
+	0x33bc, 0x080c, 0x3181, 0x0128, 0x7984, 0x080c, 0x6210, 0x1904,
+	0x33bf, 0x080c, 0x48ab, 0x0904, 0x33bf, 0x2b00, 0x7026, 0x080c,
+	0x6667, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c,
+	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
+	0x338a, 0x080c, 0x4878, 0x0904, 0x33bc, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba79, 0x0904, 0x33bc, 0x7888,
+	0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x7007, 0x0003, 0x701f,
+	0x4b46, 0x0005, 0x2061, 0x1800, 0x080c, 0x53a1, 0x2009, 0x0007,
+	0x1578, 0x080c, 0x665f, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c,
+	0x3181, 0x0120, 0xa998, 0x080c, 0x6210, 0x1530, 0x080c, 0x48a9,
+	0x0518, 0x080c, 0x6667, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150,
+	0x900e, 0x080c, 0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xba79, 0x11e0,
+	0xa89c, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x2009, 0x0003,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a, 0x9006,
+	0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830, 0x2008,
+	0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x338c, 0x9086,
+	0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52ea, 0x900e, 0x080c,
+	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
+	0x338a, 0x080c, 0x53a1, 0x0120, 0x2009, 0x0007, 0x0804, 0x33bc,
+	0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4878, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x33bc, 0x900e, 0x2130, 0x7126, 0x7132,
+	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0,
+	0x080c, 0x6270, 0x1904, 0x4be4, 0x080c, 0x6667, 0x0120, 0x080c,
+	0x666f, 0x1904, 0x4be4, 0x080c, 0x665f, 0x1130, 0x080c, 0x655f,
+	0x1118, 0xd79c, 0x0904, 0x4be4, 0xd794, 0x1110, 0xd784, 0x01a8,
+	0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x3400, 0xd794,
+	0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
+	0x20a9, 0x0002, 0x080c, 0x468d, 0x0048, 0x20a9, 0x0004, 0x4003,
+	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x468d, 0x4104, 0xd794,
+	0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80, 0x0000, 0x2098,
+	0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9, 0x0001,
+	0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x4003,
+	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4680, 0x9c80, 0x0026,
+	0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110,
+	0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0x9b66, 0x0118,
+	0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170,
+	0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020,
+	0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b80, 0x86ff, 0x1120,
+	0x7124, 0x810b, 0x0804, 0x338a, 0x7033, 0x0001, 0x7122, 0x7024,
+	0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000,
+	0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496,
+	0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x4c20, 0x0005,
+	0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036,
+	0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494,
+	0xa598, 0x0804, 0x4b80, 0x7124, 0x810b, 0x0804, 0x338a, 0x2029,
+	0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf, 0x9184,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf,
+	0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502,
+	0x0a04, 0x33bf, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33bf,
+	0x9502, 0x0a04, 0x33bf, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020,
+	0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf, 0x9384, 0x00ff, 0x90e2,
+	0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf, 0x9484, 0xff00,
+	0x8007, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf,
+	0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04,
+	0x33bf, 0x2061, 0x195a, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804,
+	0x338a, 0x0006, 0x080c, 0x538d, 0xd0cc, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x5391, 0xd0bc, 0x000e, 0x0005, 0x6170, 0x7a84, 0x6300,
+	0x82ff, 0x1118, 0x7986, 0x0804, 0x338a, 0x83ff, 0x1904, 0x33bf,
+	0x2001, 0xfff0, 0x9200, 0x1a04, 0x33bf, 0x2019, 0xffff, 0x6074,
+	0x9302, 0x9200, 0x0a04, 0x33bf, 0x7986, 0x6272, 0x0804, 0x338a,
+	0x080c, 0x53a1, 0x1904, 0x33bc, 0x7c88, 0x7d84, 0x7e98, 0x7f8c,
+	0x080c, 0x4878, 0x0904, 0x33bc, 0x900e, 0x901e, 0x7326, 0x7332,
+	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0,
+	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6667, 0x0118,
+	0x080c, 0x666f, 0x1148, 0x20a9, 0x0001, 0xb814, 0x4004, 0xb810,
 	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
-	0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c,
-	0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0d65, 0x2148,
-	0x080c, 0x1054, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0,
-	0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0xa09f,
-	0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054,
-	0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c,
-	0x110c, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000,
-	0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e,
-	0x0804, 0x33b8, 0xa884, 0xa988, 0x080c, 0x2424, 0x1518, 0x080c,
-	0x6209, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4871,
-	0x01c8, 0x080c, 0x4871, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868,
-	0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xb9dc,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x33b5, 0x7007, 0x0003, 0x701f,
-	0x4e77, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x33b5, 0x7124,
-	0x080c, 0x3113, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004,
-	0x0804, 0x33b5, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080,
-	0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
-	0x002a, 0x080c, 0x0f9f, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061,
-	0x18ae, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000,
-	0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009,
-	0x0004, 0x000e, 0x007e, 0x0804, 0x48bd, 0x97c6, 0x7200, 0x11b8,
-	0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae, 0x2c44,
-	0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a,
-	0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x4ed3, 0x0005, 0x000e,
-	0x007e, 0x0804, 0x33b8, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804,
-	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
-	0x080c, 0x0f9f, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44, 0xa28c,
-	0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48bd, 0x81ff,
-	0x1904, 0x33b5, 0x798c, 0x2001, 0x194f, 0x918c, 0x8000, 0x2102,
-	0x080c, 0x4888, 0x0904, 0x33b8, 0x080c, 0x6660, 0x0120, 0x080c,
-	0x6668, 0x1904, 0x33b8, 0x080c, 0x6330, 0x0904, 0x33b5, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x64c5, 0x012e, 0x0904, 0x33b5, 0x2001,
-	0x194f, 0x2004, 0xd0fc, 0x1904, 0x3383, 0x0804, 0x4322, 0xa9a0,
-	0x2001, 0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4895,
-	0x01a0, 0x080c, 0x6660, 0x0118, 0x080c, 0x6668, 0x1170, 0x080c,
-	0x6330, 0x2009, 0x0002, 0x0128, 0x080c, 0x64c5, 0x1170, 0x2009,
-	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001,
-	0x194f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x538e, 0x0110, 0x9006,
-	0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8,
-	0xd08c, 0x1118, 0xd084, 0x0904, 0x4297, 0x080c, 0x48a4, 0x0904,
-	0x33b8, 0x080c, 0x4871, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b5,
-	0x080c, 0x6660, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005,
-	0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028,
-	0x080c, 0x5386, 0xd0b4, 0x0904, 0x42d1, 0x7884, 0x908e, 0x007e,
-	0x0904, 0x42d1, 0x908e, 0x007f, 0x0904, 0x42d1, 0x908e, 0x0080,
-	0x0904, 0x42d1, 0xb800, 0xd08c, 0x1904, 0x42d1, 0xa867, 0x0000,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xb9fb, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x33b5, 0x7007, 0x0003, 0x701f, 0x4f9f, 0x0005, 0x080c,
-	0x48a4, 0x0904, 0x33b8, 0x0804, 0x42d1, 0x080c, 0x317a, 0x0108,
-	0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x33b5, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x33b5, 0x080c, 0x6658, 0x0120, 0x2009, 0x0008, 0x0804, 0x33b5,
-	0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42d1, 0x9006, 0xa866,
-	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba5e, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x33b5, 0x7007, 0x0003, 0x701f, 0x4fd8, 0x0005,
-	0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x52e3,
-	0x080c, 0x48a4, 0x0904, 0x33b8, 0x0804, 0x4f71, 0x81ff, 0x2009,
-	0x0001, 0x1904, 0x33b5, 0x080c, 0x539a, 0x2009, 0x0007, 0x1904,
-	0x33b5, 0x080c, 0x6658, 0x0120, 0x2009, 0x0008, 0x0804, 0x33b5,
-	0x080c, 0x48a4, 0x0904, 0x33b8, 0x080c, 0x6660, 0x2009, 0x0009,
-	0x1904, 0x33b5, 0x080c, 0x4871, 0x2009, 0x0002, 0x0904, 0x33b5,
-	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194,
-	0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952,
-	0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x33b8, 0xc0e5,
-	0xa952, 0xa956, 0xa83e, 0x080c, 0xbcc1, 0x2009, 0x0003, 0x0904,
-	0x33b5, 0x7007, 0x0003, 0x701f, 0x502e, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x2009, 0x0004, 0x0904, 0x33b5, 0x0804, 0x3383, 0x7aa8,
-	0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x539a, 0x1188,
-	0x2009, 0x0014, 0x0804, 0x33b5, 0xd2dc, 0x1568, 0x81ff, 0x2009,
-	0x0001, 0x1904, 0x33b5, 0x080c, 0x539a, 0x2009, 0x0007, 0x1904,
-	0x33b5, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5361, 0x0804,
-	0x3383, 0xd2fc, 0x0158, 0x080c, 0x48a4, 0x0904, 0x33b8, 0x7984,
-	0x9284, 0x9000, 0x080c, 0x533e, 0x0804, 0x3383, 0x080c, 0x48a4,
-	0x0904, 0x33b8, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009,
-	0x0009, 0x1904, 0x5117, 0x080c, 0x4871, 0x2009, 0x0002, 0x0904,
-	0x5117, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48ba, 0x701f, 0x5088, 0x0005,
-	0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874,
-	0x9084, 0xff00, 0x0110, 0x1904, 0x33b8, 0xa866, 0xa832, 0xa868,
-	0xc0fd, 0xa86a, 0x080c, 0x48a4, 0x1110, 0x0804, 0x33b8, 0x2009,
-	0x0043, 0x080c, 0xbd29, 0x2009, 0x0003, 0x0904, 0x5117, 0x7007,
-	0x0003, 0x701f, 0x50ac, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009,
-	0x0004, 0x0904, 0x5117, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c,
-	0x533e, 0x0804, 0x3383, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140,
-	0xd2ec, 0x0168, 0x080c, 0x539a, 0x1150, 0x2009, 0x0014, 0x04f0,
-	0x2061, 0x1800, 0x080c, 0x539a, 0x2009, 0x0007, 0x15b8, 0xd2f4,
-	0x0128, 0x9284, 0x5000, 0x080c, 0x5361, 0x0050, 0xd2fc, 0x0178,
-	0x080c, 0x48a2, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x533e,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c,
-	0x48a2, 0x0510, 0x080c, 0x6660, 0x2009, 0x0009, 0x11b8, 0xa8c4,
-	0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084,
-	0xff00, 0x1190, 0x080c, 0x48a2, 0x1108, 0x0070, 0x2009, 0x004b,
-	0x080c, 0xbd29, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0,
+	0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e,
+	0x2001, 0x0003, 0x080c, 0x8419, 0x2208, 0x0804, 0x338a, 0x7033,
+	0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18ae, 0x2c44,
+	0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072, 0xa48e,
+	0xa592, 0xa696, 0xa79a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f,
+	0x4d12, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028, 0x20a0,
+	0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa48c, 0xa590,
+	0xa694, 0xa798, 0x0804, 0x4cd0, 0x7224, 0x900e, 0x2001, 0x0003,
+	0x080c, 0x8419, 0x2208, 0x0804, 0x338a, 0x00f6, 0x00e6, 0x080c,
+	0x53a1, 0x2009, 0x0007, 0x1904, 0x4da5, 0x2071, 0x1894, 0x745c,
+	0x84ff, 0x2009, 0x000e, 0x1904, 0x4da5, 0xac9c, 0xad98, 0xaea4,
+	0xafa0, 0x0096, 0x080c, 0x103b, 0x2009, 0x0002, 0x0904, 0x4da5,
+	0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860, 0x7066,
+	0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
+	0x8bff, 0x0178, 0x080c, 0x6667, 0x0118, 0x080c, 0x666f, 0x1148,
+	0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
+	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x01e8,
+	0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x8419, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff,
+	0x090c, 0x0d65, 0x2148, 0x080c, 0x1054, 0x9006, 0x705e, 0x918d,
+	0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300,
+	0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064,
+	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x4db1, 0x000e,
+	0xa0a2, 0x080c, 0x110c, 0x9006, 0x0048, 0x009e, 0xa897, 0x4005,
+	0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe,
+	0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0d65, 0x00e6, 0x2071,
+	0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005, 0x1158, 0x7150,
+	0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694,
+	0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8419, 0xaa9a, 0x715c,
+	0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c, 0x1054, 0x705f, 0x0000,
+	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996, 0x012e,
+	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8,
+	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6667, 0x0118, 0x080c,
+	0x666f, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
+	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
+	0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a,
+	0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c,
+	0x1054, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6996, 0x012e, 0xa09f, 0x0000,
+	0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300,
+	0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x110c,
+	0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000, 0x0148,
+	0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e, 0x0804,
+	0x33bf, 0xa884, 0xa988, 0x080c, 0x2424, 0x1518, 0x080c, 0x6210,
+	0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4878, 0x01c8,
+	0x080c, 0x4878, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xb9f7, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x33bc, 0x7007, 0x0003, 0x701f, 0x4e7e,
+	0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x33bc, 0x7124, 0x080c,
+	0x311a, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004, 0x0804,
+	0x33bc, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080, 0x0002,
+	0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
+	0x080c, 0x0f9f, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061, 0x18ae,
+	0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118,
+	0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009, 0x0004,
+	0x000e, 0x007e, 0x0804, 0x48c4, 0x97c6, 0x7200, 0x11b8, 0x96c2,
+	0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae, 0x2c44, 0xa076,
+	0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x110c, 0x7007, 0x0002, 0x701f, 0x4eda, 0x0005, 0x000e, 0x007e,
+	0x0804, 0x33bf, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804, 0x2048,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c,
+	0x0f9f, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48c4, 0x81ff, 0x1904,
+	0x33bc, 0x798c, 0x2001, 0x194f, 0x918c, 0x8000, 0x2102, 0x080c,
+	0x488f, 0x0904, 0x33bf, 0x080c, 0x6667, 0x0120, 0x080c, 0x666f,
+	0x1904, 0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x64cc, 0x012e, 0x0904, 0x33bc, 0x2001, 0x194f,
+	0x2004, 0xd0fc, 0x1904, 0x338a, 0x0804, 0x4329, 0xa9a0, 0x2001,
+	0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489c, 0x01a0,
+	0x080c, 0x6667, 0x0118, 0x080c, 0x666f, 0x1170, 0x080c, 0x6337,
+	0x2009, 0x0002, 0x0128, 0x080c, 0x64cc, 0x1170, 0x2009, 0x0003,
 	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8,
-	0xd2dc, 0x0904, 0x33b5, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd,
-	0x080c, 0x533e, 0x001e, 0x1904, 0x33b5, 0x0804, 0x3383, 0x00f6,
-	0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016,
-	0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x533e, 0x001e, 0x9085,
-	0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33b5,
-	0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804, 0x33b5, 0x7984,
-	0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6269, 0x1904, 0x33b8, 0x9186,
-	0x007f, 0x0138, 0x080c, 0x6660, 0x0120, 0x2009, 0x0009, 0x0804,
-	0x33b5, 0x080c, 0x4871, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b5,
-	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007,
-	0xa80a, 0x080c, 0xba15, 0x1120, 0x2009, 0x0003, 0x0804, 0x33b5,
-	0x7007, 0x0003, 0x701f, 0x5175, 0x0005, 0xa808, 0x8007, 0x9086,
-	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x33b5, 0xa8e0, 0xa866,
-	0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007, 0x9084,
-	0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x0804, 0x48bd, 0x080c, 0x4871, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x33b5, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff,
-	0x8217, 0x82ff, 0x1118, 0x7023, 0x1984, 0x0040, 0x92c6, 0x0001,
-	0x1118, 0x7023, 0x199e, 0x0010, 0x0804, 0x33b8, 0x2009, 0x001a,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
-	0x080c, 0x48ba, 0x701f, 0x51c5, 0x0005, 0x2001, 0x182d, 0x2003,
-	0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9,
-	0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x3383,
-	0x080c, 0x4871, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b5, 0x7984,
-	0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099,
-	0x1984, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199e, 0x0010,
-	0x0804, 0x33b8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8,
-	0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804,
-	0x48bd, 0x7884, 0x908a, 0x1000, 0x1a04, 0x33b8, 0x0126, 0x2091,
-	0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x19d4,
-	0x6142, 0x00ce, 0x012e, 0x0804, 0x3383, 0x00c6, 0x080c, 0x70ac,
-	0x1160, 0x080c, 0x73ac, 0x080c, 0x5cd5, 0x9085, 0x0001, 0x080c,
-	0x70f3, 0x080c, 0x6fdd, 0x080c, 0x0d65, 0x2061, 0x1800, 0x6030,
-	0xc09d, 0x6032, 0x080c, 0x5b90, 0x00ce, 0x0005, 0x00c6, 0x2001,
-	0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x33b5, 0x7884, 0x9005,
-	0x0188, 0x7888, 0x2061, 0x196d, 0x2c0c, 0x2062, 0x080c, 0x2801,
-	0x01a0, 0x080c, 0x2809, 0x0188, 0x080c, 0x2811, 0x0170, 0x2162,
-	0x0804, 0x33b8, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118,
-	0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002,
-	0x1588, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98ad,
-	0x0026, 0x2011, 0x0003, 0x080c, 0x931e, 0x2011, 0x0002, 0x080c,
-	0x9328, 0x002e, 0x080c, 0x91eb, 0x0036, 0x901e, 0x080c, 0x926b,
-	0x003e, 0x080c, 0x98c9, 0x60e3, 0x0000, 0x080c, 0xd5d9, 0x080c,
-	0xd5f4, 0x9085, 0x0001, 0x080c, 0x70f3, 0x9006, 0x080c, 0x2833,
-	0x2001, 0x1800, 0x2003, 0x0004, 0x0026, 0x2011, 0x0008, 0x080c,
-	0x286d, 0x002e, 0x00ce, 0x0804, 0x3383, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x33b5, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x33b5, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6269,
-	0x1904, 0x33b8, 0x9186, 0x007f, 0x0138, 0x080c, 0x6660, 0x0120,
-	0x2009, 0x0009, 0x0804, 0x33b5, 0x080c, 0x4871, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x33b5, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xba18, 0x1120, 0x2009, 0x0003, 0x0804, 0x33b5, 0x7007,
-	0x0003, 0x701f, 0x52cc, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120,
-	0x2009, 0x0004, 0x0804, 0x33b5, 0xa8e0, 0xa866, 0xa834, 0x8007,
-	0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0xaf60, 0x0804, 0x48bd, 0xa898, 0x9086, 0x000d, 0x1904, 0x33b5,
-	0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52f0, 0x0010,
-	0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011,
-	0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4,
-	0x799a, 0xa9a8, 0x799e, 0x080c, 0x48ad, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x7007, 0x0001, 0x2091,
-	0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x00c6, 0x2061, 0x19d4, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000,
-	0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062,
-	0x788c, 0x605e, 0x2001, 0x19e2, 0x2044, 0x2001, 0x19e9, 0xa076,
-	0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000,
-	0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3383, 0x0126, 0x2091,
-	0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c,
-	0xb879, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004,
-	0x905d, 0x0160, 0x080c, 0x5cef, 0x080c, 0x9b4b, 0x0110, 0xb817,
-	0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085, 0x0001,
-	0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e, 0x20a9,
-	0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180, 0x9186,
-	0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080, 0x0138,
-	0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e, 0x001e,
-	0x8108, 0x1f04, 0x5369, 0x015e, 0x012e, 0x0005, 0x2001, 0x1854,
-	0x2004, 0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006, 0x2001,
-	0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004,
-	0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a, 0x00ee,
-	0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x33b8, 0x810c,
-	0x0016, 0x080c, 0x4871, 0x080c, 0x0f2a, 0x2100, 0x2238, 0x7d84,
-	0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48ba, 0x701f, 0x53c1,
-	0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4,
-	0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071, 0x1894,
-	0x080c, 0x48bd, 0x701f, 0x53d5, 0x0005, 0x2061, 0x18ae, 0x2c44,
-	0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0f32, 0x002e, 0x001e,
-	0x080c, 0x0fdf, 0x9006, 0xa802, 0xa806, 0x0804, 0x3383, 0x0126,
-	0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044,
-	0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x5590, 0x0068, 0xd08c,
-	0x0118, 0x080c, 0x5499, 0x0040, 0xd094, 0x0118, 0x080c, 0x5469,
-	0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016,
-	0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006,
-	0x7094, 0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f, 0x0000,
-	0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130,
-	0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00,
-	0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295,
-	0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c,
-	0x5c51, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042,
-	0x6043, 0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3, 0x0000,
-	0x70db, 0x0000, 0x2009, 0x1d80, 0x200b, 0x0000, 0x7093, 0x0000,
-	0x7087, 0x000f, 0x2009, 0x000f, 0x2011, 0x5b33, 0x080c, 0x81f5,
-	0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b, 0xffff,
-	0x7084, 0x9005, 0x1528, 0x2011, 0x5b33, 0x080c, 0x8131, 0x6040,
-	0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044,
-	0xd08c, 0x1168, 0x1f04, 0x547f, 0x6242, 0x7097, 0x0000, 0x6040,
-	0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242,
-	0x7097, 0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5cda, 0x0000,
-	0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c, 0x0d65, 0x000b, 0x0005,
-	0x54a3, 0x54f4, 0x558f, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800,
-	0x708b, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc,
-	0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x54b2,
-	0x080c, 0x0d65, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a,
-	0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c,
-	0x5cb6, 0x2079, 0x1d00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1,
-	0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1d0e, 0x20a9,
-	0x0004, 0x4003, 0x080c, 0x97df, 0x20e1, 0x0001, 0x2099, 0x1d00,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x194f,
+	0x2004, 0xd0fc, 0x1128, 0x080c, 0x5395, 0x0110, 0x9006, 0x0018,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c,
+	0x1118, 0xd084, 0x0904, 0x429e, 0x080c, 0x48ab, 0x0904, 0x33bf,
+	0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0x080c,
+	0x6667, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0,
+	0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c,
+	0x538d, 0xd0b4, 0x0904, 0x42d8, 0x7884, 0x908e, 0x007e, 0x0904,
+	0x42d8, 0x908e, 0x007f, 0x0904, 0x42d8, 0x908e, 0x0080, 0x0904,
+	0x42d8, 0xb800, 0xd08c, 0x1904, 0x42d8, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xba16, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x33bc, 0x7007, 0x0003, 0x701f, 0x4fa6, 0x0005, 0x080c, 0x48ab,
+	0x0904, 0x33bf, 0x0804, 0x42d8, 0x080c, 0x3181, 0x0108, 0x0005,
+	0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x33bc, 0x080c, 0x53a1, 0x0120, 0x2009, 0x0007, 0x0804, 0x33bc,
+	0x080c, 0x665f, 0x0120, 0x2009, 0x0008, 0x0804, 0x33bc, 0xb89c,
+	0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42d8, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba79, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x33bc, 0x7007, 0x0003, 0x701f, 0x4fdf, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x52ea, 0x080c,
+	0x48ab, 0x0904, 0x33bf, 0x0804, 0x4f78, 0x81ff, 0x2009, 0x0001,
+	0x1904, 0x33bc, 0x080c, 0x53a1, 0x2009, 0x0007, 0x1904, 0x33bc,
+	0x080c, 0x665f, 0x0120, 0x2009, 0x0008, 0x0804, 0x33bc, 0x080c,
+	0x48ab, 0x0904, 0x33bf, 0x080c, 0x6667, 0x2009, 0x0009, 0x1904,
+	0x33bc, 0x080c, 0x4878, 0x2009, 0x0002, 0x0904, 0x33bc, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00,
+	0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c,
+	0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x33bf, 0xc0e5, 0xa952,
+	0xa956, 0xa83e, 0x080c, 0xbcdc, 0x2009, 0x0003, 0x0904, 0x33bc,
+	0x7007, 0x0003, 0x701f, 0x5035, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x2009, 0x0004, 0x0904, 0x33bc, 0x0804, 0x338a, 0x7aa8, 0x9284,
+	0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x53a1, 0x1188, 0x2009,
+	0x0014, 0x0804, 0x33bc, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001,
+	0x1904, 0x33bc, 0x080c, 0x53a1, 0x2009, 0x0007, 0x1904, 0x33bc,
+	0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5368, 0x0804, 0x338a,
+	0xd2fc, 0x0158, 0x080c, 0x48ab, 0x0904, 0x33bf, 0x7984, 0x9284,
+	0x9000, 0x080c, 0x5345, 0x0804, 0x338a, 0x080c, 0x48ab, 0x0904,
+	0x33bf, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009,
+	0x1904, 0x511e, 0x080c, 0x4878, 0x2009, 0x0002, 0x0904, 0x511e,
+	0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x080c, 0x48c1, 0x701f, 0x508f, 0x0005, 0xa86c,
+	0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084,
+	0xff00, 0x0110, 0x1904, 0x33bf, 0xa866, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0x48ab, 0x1110, 0x0804, 0x33bf, 0x2009, 0x0043,
+	0x080c, 0xbd44, 0x2009, 0x0003, 0x0904, 0x511e, 0x7007, 0x0003,
+	0x701f, 0x50b3, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
+	0x0904, 0x511e, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x5345,
+	0x0804, 0x338a, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec,
+	0x0168, 0x080c, 0x53a1, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061,
+	0x1800, 0x080c, 0x53a1, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128,
+	0x9284, 0x5000, 0x080c, 0x5368, 0x0050, 0xd2fc, 0x0178, 0x080c,
+	0x48a9, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x5345, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x48a9,
+	0x0510, 0x080c, 0x6667, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086,
+	0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00,
+	0x1190, 0x080c, 0x48a9, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c,
+	0xbd44, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc,
+	0x0904, 0x33bc, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c,
+	0x5345, 0x001e, 0x1904, 0x33bc, 0x0804, 0x338a, 0x00f6, 0x2d78,
+	0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998,
+	0x9284, 0x1000, 0xc0fd, 0x080c, 0x5345, 0x001e, 0x9085, 0x0001,
+	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc, 0x080c,
+	0x53a1, 0x0120, 0x2009, 0x0007, 0x0804, 0x33bc, 0x7984, 0x7ea8,
+	0x96b4, 0x00ff, 0x080c, 0x6270, 0x1904, 0x33bf, 0x9186, 0x007f,
+	0x0138, 0x080c, 0x6667, 0x0120, 0x2009, 0x0009, 0x0804, 0x33bc,
+	0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a,
+	0x080c, 0xba30, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc, 0x7007,
+	0x0003, 0x701f, 0x517c, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x33bc, 0xa8e0, 0xa866, 0xa810,
+	0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007, 0x9084, 0x00ff,
+	0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x0804, 0x48c4, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x33bc, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217,
+	0x82ff, 0x1118, 0x7023, 0x1984, 0x0040, 0x92c6, 0x0001, 0x1118,
+	0x7023, 0x199e, 0x0010, 0x0804, 0x33bf, 0x2009, 0x001a, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
+	0x48c1, 0x701f, 0x51cc, 0x0005, 0x2001, 0x182d, 0x2003, 0x0001,
+	0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a,
+	0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x338a, 0x080c,
+	0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0x7984, 0x9194,
+	0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x1984,
+	0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199e, 0x0010, 0x0804,
+	0x33bf, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9,
+	0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x48c4,
+	0x7884, 0x908a, 0x1000, 0x1a04, 0x33bf, 0x0126, 0x2091, 0x8000,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x19d4, 0x6142,
+	0x00ce, 0x012e, 0x0804, 0x338a, 0x00c6, 0x080c, 0x70b7, 0x1160,
+	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x9085, 0x0001, 0x080c, 0x70fe,
+	0x080c, 0x6fe8, 0x080c, 0x0d65, 0x2061, 0x1800, 0x6030, 0xc09d,
+	0x6032, 0x080c, 0x5b97, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800,
+	0x2004, 0x908e, 0x0000, 0x0904, 0x33bc, 0x7884, 0x9005, 0x0188,
+	0x7888, 0x2061, 0x196d, 0x2c0c, 0x2062, 0x080c, 0x2801, 0x01a0,
+	0x080c, 0x2809, 0x0188, 0x080c, 0x2811, 0x0170, 0x2162, 0x0804,
+	0x33bf, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009,
+	0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1588,
+	0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98c8, 0x0026,
+	0x2011, 0x0003, 0x080c, 0x9339, 0x2011, 0x0002, 0x080c, 0x9343,
+	0x002e, 0x080c, 0x9206, 0x0036, 0x901e, 0x080c, 0x9286, 0x003e,
+	0x080c, 0x98e4, 0x60e3, 0x0000, 0x080c, 0xd5fb, 0x080c, 0xd616,
+	0x9085, 0x0001, 0x080c, 0x70fe, 0x9006, 0x080c, 0x2833, 0x2001,
+	0x1800, 0x2003, 0x0004, 0x0026, 0x2011, 0x0008, 0x080c, 0x286d,
+	0x002e, 0x00ce, 0x0804, 0x338a, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x33bc, 0x080c, 0x53a1, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x33bc, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6270, 0x1904,
+	0x33bf, 0x9186, 0x007f, 0x0138, 0x080c, 0x6667, 0x0120, 0x2009,
+	0x0009, 0x0804, 0x33bc, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x33bc, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xba33, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc, 0x7007, 0x0003,
+	0x701f, 0x52d3, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x33bc, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c,
+	0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60,
+	0x0804, 0x48c4, 0xa898, 0x9086, 0x000d, 0x1904, 0x33bc, 0x2021,
+	0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52f7, 0x0010, 0x012e,
+	0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010,
+	0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a,
+	0xa9a8, 0x799e, 0x080c, 0x48b4, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11be, 0x7007, 0x0001, 0x2091, 0x5000,
+	0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6,
+	0x2061, 0x19d4, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b,
+	0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c,
+	0x605e, 0x2001, 0x19e2, 0x2044, 0x2001, 0x19e9, 0xa076, 0xa060,
+	0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f,
+	0x0000, 0x00ce, 0x012e, 0x0804, 0x338a, 0x0126, 0x2091, 0x8000,
+	0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xb894,
+	0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d,
+	0x0160, 0x080c, 0x5cf6, 0x080c, 0x9b66, 0x0110, 0xb817, 0x0000,
+	0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8,
+	0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e, 0x20a9, 0x0800,
+	0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180, 0x9186, 0x007e,
+	0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080, 0x0138, 0x9186,
+	0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e, 0x001e, 0x8108,
+	0x1f04, 0x5370, 0x015e, 0x012e, 0x0005, 0x2001, 0x1854, 0x2004,
+	0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810,
+	0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4,
+	0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e,
+	0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x33bf, 0x810c, 0x0016,
+	0x080c, 0x4878, 0x080c, 0x0f2a, 0x2100, 0x2238, 0x7d84, 0x7c88,
+	0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48c1, 0x701f, 0x53c8, 0x0005,
+	0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c,
+	0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071, 0x1894, 0x080c,
+	0x48c4, 0x701f, 0x53dc, 0x0005, 0x2061, 0x18ae, 0x2c44, 0x0016,
+	0x0026, 0xa270, 0xa174, 0x080c, 0x0f32, 0x002e, 0x001e, 0x080c,
+	0x0fdf, 0x9006, 0xa802, 0xa806, 0x0804, 0x338a, 0x0126, 0x0156,
+	0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4,
+	0x11e8, 0xd084, 0x0118, 0x080c, 0x5597, 0x0068, 0xd08c, 0x0118,
+	0x080c, 0x54a0, 0x0040, 0xd094, 0x0118, 0x080c, 0x5470, 0x0018,
+	0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016, 0x6128,
+	0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006, 0x7094,
+	0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f, 0x0000, 0x624c,
+	0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00, 0x9296,
+	0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100,
+	0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x5c58,
+	0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042, 0x6043,
+	0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3, 0x0000, 0x70db,
+	0x0000, 0x2009, 0x1d80, 0x200b, 0x0000, 0x7093, 0x0000, 0x7087,
+	0x000f, 0x2009, 0x000f, 0x2011, 0x5b3a, 0x080c, 0x821d, 0x0005,
+	0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b, 0xffff, 0x7084,
+	0x9005, 0x1528, 0x2011, 0x5b3a, 0x080c, 0x8159, 0x6040, 0x9094,
+	0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c,
+	0x1168, 0x1f04, 0x5486, 0x6242, 0x7097, 0x0000, 0x6040, 0x9094,
+	0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242, 0x7097,
+	0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5ce1, 0x0000, 0x0005,
+	0x7088, 0x908a, 0x0003, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0x54aa,
+	0x54fb, 0x5596, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800, 0x708b,
+	0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9,
+	0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x54b9, 0x080c,
+	0x0d65, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a, 0xa001,
+	0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c, 0x5cbd,
+	0x2079, 0x1d00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004,
+	0x4003, 0x080c, 0x97fa, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c,
+	0x600f, 0x0000, 0x080c, 0x5b6b, 0x00fe, 0x9006, 0x708e, 0x6043,
+	0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f, 0x0000, 0x9025,
+	0x0904, 0x5573, 0x6020, 0xd0b4, 0x1904, 0x5571, 0x719c, 0x81ff,
+	0x0904, 0x555f, 0x9486, 0x000c, 0x1904, 0x556c, 0x9480, 0x0018,
+	0x8004, 0x20a8, 0x080c, 0x5cb6, 0x2011, 0x0260, 0x2019, 0x1d00,
+	0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, 0x5518,
+	0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
+	0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002, 0x7097, 0x0002,
+	0x2009, 0x07d0, 0x2011, 0x5b41, 0x080c, 0x821d, 0x080c, 0x5cbd,
+	0x04c0, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7930, 0x918e, 0x1101,
+	0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, 0x1118,
+	0x7804, 0x9005, 0x0190, 0x080c, 0x5cb6, 0x2011, 0x026e, 0x2019,
+	0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230, 0x11a0,
+	0x8210, 0x8318, 0x1f04, 0x5553, 0x0078, 0x709f, 0x0000, 0x080c,
+	0x5cb6, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1,
+	0x1d00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043, 0x0000,
+	0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042, 0x6020,
+	0xd0b4, 0x1db8, 0x080c, 0x97fa, 0x20e1, 0x0001, 0x2099, 0x1d00,
 	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3,
-	0x000c, 0x600f, 0x0000, 0x080c, 0x5b64, 0x00fe, 0x9006, 0x708e,
-	0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f, 0x0000,
-	0x9025, 0x0904, 0x556c, 0x6020, 0xd0b4, 0x1904, 0x556a, 0x719c,
-	0x81ff, 0x0904, 0x5558, 0x9486, 0x000c, 0x1904, 0x5565, 0x9480,
-	0x0018, 0x8004, 0x20a8, 0x080c, 0x5caf, 0x2011, 0x0260, 0x2019,
-	0x1d00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04,
-	0x5511, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
-	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002, 0x7097,
-	0x0002, 0x2009, 0x07d0, 0x2011, 0x5b3a, 0x080c, 0x81f5, 0x080c,
-	0x5cb6, 0x04c0, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7930, 0x918e,
-	0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff,
-	0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5caf, 0x2011, 0x026e,
-	0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230,
-	0x11a0, 0x8210, 0x8318, 0x1f04, 0x554c, 0x0078, 0x709f, 0x0000,
-	0x080c, 0x5caf, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001,
-	0x20a1, 0x1d00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043,
-	0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042,
-	0x6020, 0xd0b4, 0x1db8, 0x080c, 0x97df, 0x20e1, 0x0001, 0x2099,
-	0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003,
-	0x60c3, 0x000c, 0x2011, 0x19c5, 0x2013, 0x0000, 0x708f, 0x0000,
-	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x8f8f, 0x08d8, 0x0005,
-	0x7094, 0x908a, 0x001d, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0x55c1,
-	0x55d4, 0x55fd, 0x561d, 0x5643, 0x5672, 0x5698, 0x56d0, 0x56f6,
-	0x5724, 0x575f, 0x5797, 0x57b5, 0x57e0, 0x5802, 0x581d, 0x5827,
-	0x585b, 0x5881, 0x58b0, 0x58d6, 0x590e, 0x5952, 0x598f, 0x59b0,
-	0x5a09, 0x5a2b, 0x5a59, 0x5a59, 0x00c6, 0x2061, 0x1800, 0x6003,
-	0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce,
-	0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061,
-	0x0100, 0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0, 0x2011,
-	0x5b3a, 0x080c, 0x81f5, 0x0005, 0x00f6, 0x708c, 0x9086, 0x0014,
-	0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5caf, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188,
-	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
-	0x2011, 0x5b3a, 0x080c, 0x8131, 0x7097, 0x0010, 0x080c, 0x5827,
-	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0003,
-	0x6043, 0x0004, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x080c, 0x5c33,
-	0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008,
-	0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5612, 0x60c3,
-	0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
-	0x0500, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x9086, 0x0014, 0x11b8,
-	0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178,
-	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
-	0x1110, 0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010, 0x080c,
-	0x5c8b, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c, 0x5c33,
-	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5caf,
-	0x080c, 0x5c92, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186,
-	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x0168, 0x080c,
-	0x5c68, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64,
-	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a,
-	0x080c, 0x8131, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5caf, 0x2079,
+	0x000c, 0x2011, 0x19c5, 0x2013, 0x0000, 0x708f, 0x0000, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x080c, 0x8faa, 0x08d8, 0x0005, 0x7094,
+	0x908a, 0x001d, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0x55c8, 0x55db,
+	0x5604, 0x5624, 0x564a, 0x5679, 0x569f, 0x56d7, 0x56fd, 0x572b,
+	0x5766, 0x579e, 0x57bc, 0x57e7, 0x5809, 0x5824, 0x582e, 0x5862,
+	0x5888, 0x58b7, 0x58dd, 0x5915, 0x5959, 0x5996, 0x59b7, 0x5a10,
+	0x5a32, 0x5a60, 0x5a60, 0x00c6, 0x2061, 0x1800, 0x6003, 0x0007,
+	0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005,
+	0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100,
+	0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0, 0x2011, 0x5b41,
+	0x080c, 0x821d, 0x0005, 0x00f6, 0x708c, 0x9086, 0x0014, 0x1510,
+	0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5cb6, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x2011,
+	0x5b41, 0x080c, 0x8159, 0x7097, 0x0010, 0x080c, 0x582e, 0x0010,
+	0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0003, 0x6043,
+	0x0004, 0x2011, 0x5b41, 0x080c, 0x8159, 0x080c, 0x5c3a, 0x2079,
+	0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88,
+	0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5619, 0x60c3, 0x0014,
+	0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500,
+	0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110,
+	0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010, 0x080c, 0x5c92,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c, 0x5c3a, 0x2079,
+	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cb6, 0x080c,
+	0x5c99, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff,
+	0x0138, 0x2011, 0x0008, 0x080c, 0x5aee, 0x0168, 0x080c, 0x5c6f,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b41, 0x080c,
+	0x8159, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
+	0x0006, 0x0029, 0x0010, 0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x0007, 0x080c, 0x5c3a, 0x2079, 0x0240, 0x7833, 0x1104,
+	0x7837, 0x0000, 0x080c, 0x5cb6, 0x080c, 0x5c99, 0x11b8, 0x7080,
+	0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x318b,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5aee,
+	0x0180, 0x080c, 0x4c97, 0x0110, 0x080c, 0x248d, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x0500, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0008, 0x0029,
+	0x0010, 0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0009,
+	0x080c, 0x5c3a, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837, 0x0100,
+	0x080c, 0x5c99, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x5a61,
+	0x1188, 0x9085, 0x0001, 0x080c, 0x248d, 0x20a9, 0x0008, 0x080c,
+	0x5cb6, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x0010, 0x080c,
+	0x55bb, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x05a8, 0x2011,
+	0x5b41, 0x080c, 0x8159, 0x9086, 0x0014, 0x1560, 0x080c, 0x5cb6,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834, 0x9084,
+	0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x000a, 0x00b1,
+	0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097, 0x000e, 0x080c,
+	0x5809, 0x0010, 0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x000b, 0x2011, 0x1d0e, 0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040,
+	0x2019, 0xffff, 0x4304, 0x080c, 0x5c3a, 0x2079, 0x0240, 0x7833,
+	0x1106, 0x7837, 0x0000, 0x080c, 0x5c99, 0x0118, 0x2013, 0x0000,
+	0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040, 0x2009,
+	0x024e, 0x2011, 0x1d0e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
+	0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x578b,
+	0x60c3, 0x0084, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x01c0, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0084,
+	0x1178, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
+	0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c, 0x0029, 0x0010,
+	0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x000d, 0x080c,
+	0x5c3a, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000, 0x080c,
+	0x5cb6, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e, 0x220e,
+	0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812,
+	0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04,
+	0x57cf, 0x60c3, 0x0084, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x01e0, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086,
+	0x0084, 0x1198, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001, 0x080c,
+	0x5c0c, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c, 0x5c92, 0x00fe,
+	0x0005, 0x918d, 0x0001, 0x080c, 0x5ce1, 0x7097, 0x000f, 0x708f,
+	0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061,
+	0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011,
+	0x5b41, 0x080c, 0x814d, 0x0005, 0x708c, 0x9005, 0x0130, 0x2011,
+	0x5b41, 0x080c, 0x8159, 0x7097, 0x0000, 0x0005, 0x7097, 0x0011,
+	0x080c, 0x97fa, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480, 0x0018, 0x9080,
+	0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c, 0x5c99,
+	0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c, 0x9084, 0x00ff,
+	0x0160, 0x080c, 0x2424, 0x9186, 0x007e, 0x0138, 0x9186, 0x0080,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x5aee, 0x60c3, 0x0014, 0x080c,
+	0x5b6b, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b41,
+	0x080c, 0x8159, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079,
 	0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160,
 	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
-	0x7097, 0x0006, 0x0029, 0x0010, 0x080c, 0x5c8b, 0x00fe, 0x0005,
-	0x00f6, 0x7097, 0x0007, 0x080c, 0x5c33, 0x2079, 0x0240, 0x7833,
-	0x1104, 0x7837, 0x0000, 0x080c, 0x5caf, 0x080c, 0x5c92, 0x11b8,
-	0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180,
-	0x3184, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
-	0x5ae7, 0x0180, 0x080c, 0x4c90, 0x0110, 0x080c, 0x248d, 0x20a9,
-	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a, 0x080c, 0x8131,
-	0x9086, 0x0014, 0x11b8, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0008,
-	0x0029, 0x0010, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x0009, 0x080c, 0x5c33, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837,
-	0x0100, 0x080c, 0x5c92, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c,
-	0x5a5a, 0x1188, 0x9085, 0x0001, 0x080c, 0x248d, 0x20a9, 0x0008,
-	0x080c, 0x5caf, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x0010,
-	0x080c, 0x55b4, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x05a8,
-	0x2011, 0x5b3a, 0x080c, 0x8131, 0x9086, 0x0014, 0x1560, 0x080c,
-	0x5caf, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834,
-	0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x000a,
-	0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
-	0x9005, 0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097, 0x000e,
-	0x080c, 0x5802, 0x0010, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6,
-	0x7097, 0x000b, 0x2011, 0x1d0e, 0x20e9, 0x0001, 0x22a0, 0x20a9,
-	0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5c33, 0x2079, 0x0240,
-	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5c92, 0x0118, 0x2013,
-	0x0000, 0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040,
-	0x2009, 0x024e, 0x2011, 0x1d0e, 0x220e, 0x8210, 0x8108, 0x9186,
-	0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04,
-	0x5784, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x01c0, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x9086,
-	0x0084, 0x1178, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c, 0x0029,
-	0x0010, 0x080c, 0x5c8b, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x000d,
-	0x080c, 0x5c33, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000,
-	0x080c, 0x5caf, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e,
-	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000,
-	0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260,
-	0x1f04, 0x57c8, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3a, 0x080c, 0x8131,
-	0x9086, 0x0084, 0x1198, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001,
-	0x080c, 0x5c05, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c, 0x5c8b,
-	0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5cda, 0x7097, 0x000f,
-	0x708f, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5,
-	0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
-	0x2011, 0x5b3a, 0x080c, 0x8125, 0x0005, 0x708c, 0x9005, 0x0130,
-	0x2011, 0x5b3a, 0x080c, 0x8131, 0x7097, 0x0000, 0x0005, 0x7097,
-	0x0011, 0x080c, 0x97df, 0x080c, 0x5caf, 0x20e1, 0x0000, 0x2099,
-	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480, 0x0018,
-	0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c,
-	0x5c92, 0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c, 0x9084,
-	0x00ff, 0x0160, 0x080c, 0x2424, 0x9186, 0x007e, 0x0138, 0x9186,
-	0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x60c3, 0x0014,
-	0x080c, 0x5b64, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
-	0x5b3a, 0x080c, 0x8131, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5caf,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005,
-	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
-	0x0001, 0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
-	0x0005, 0x00f6, 0x7097, 0x0013, 0x080c, 0x5c41, 0x2079, 0x0240,
-	0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5caf, 0x080c, 0x5c92,
-	0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff, 0x0138,
-	0x2011, 0x0008, 0x080c, 0x5ae7, 0x0168, 0x080c, 0x5c68, 0x20a9,
-	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a, 0x080c, 0x8131,
-	0x9086, 0x0014, 0x11b8, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0014,
-	0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x0015, 0x080c, 0x5c41, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837,
-	0x0000, 0x080c, 0x5caf, 0x080c, 0x5c92, 0x11b8, 0x7080, 0x9005,
-	0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x3184, 0x200d,
-	0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x0180,
-	0x080c, 0x4c90, 0x0110, 0x080c, 0x248d, 0x20a9, 0x0008, 0x20e1,
-	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
-	0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6, 0x708c,
-	0x9005, 0x05f0, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x9086, 0x0014,
-	0x15a8, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
-	0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168,
-	0x9085, 0x0001, 0x080c, 0x5cda, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
-	0x9005, 0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x9085,
-	0x0001, 0x080c, 0x5cda, 0x7093, 0x0000, 0x7a38, 0xd2f4, 0x0110,
-	0x70db, 0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f, 0x0000,
-	0x00fe, 0x0005, 0x080c, 0x97df, 0x080c, 0x5caf, 0x20e1, 0x0000,
-	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e,
-	0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d,
-	0x2012, 0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c92, 0x1150,
-	0x7080, 0x9005, 0x1138, 0x080c, 0x5a5a, 0x1188, 0x9085, 0x0001,
-	0x080c, 0x248d, 0x20a9, 0x0008, 0x080c, 0x5caf, 0x20e1, 0x0000,
+	0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0013, 0x080c, 0x5c48, 0x2079, 0x0240, 0x7833,
+	0x1103, 0x7837, 0x0000, 0x080c, 0x5cb6, 0x080c, 0x5c99, 0x1170,
+	0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff, 0x0138, 0x2011,
+	0x0008, 0x080c, 0x5aee, 0x0168, 0x080c, 0x5c6f, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x0500, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0014, 0x0029,
+	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0015,
+	0x080c, 0x5c48, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000,
+	0x080c, 0x5cb6, 0x080c, 0x5c99, 0x11b8, 0x7080, 0x9005, 0x11a0,
+	0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x318b, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5aee, 0x0180, 0x080c,
+	0x4c97, 0x0110, 0x080c, 0x248d, 0x20a9, 0x0008, 0x20e1, 0x0000,
 	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
-	0x0014, 0x080c, 0x5b64, 0x0010, 0x080c, 0x55b4, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x01d8, 0x2011, 0x5b3a, 0x080c, 0x8131, 0x9086,
-	0x0084, 0x1190, 0x080c, 0x5caf, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5cda,
-	0x7097, 0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
-	0x00f6, 0x7097, 0x0019, 0x080c, 0x5c41, 0x2079, 0x0240, 0x7833,
-	0x1106, 0x7837, 0x0000, 0x080c, 0x5caf, 0x2009, 0x026e, 0x2039,
-	0x1d0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280,
-	0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x59c3,
-	0x2039, 0x1d0e, 0x080c, 0x5c92, 0x11e8, 0x2728, 0x2514, 0x8207,
-	0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205,
-	0x202a, 0x705c, 0x2310, 0x8214, 0x92a0, 0x1d0e, 0x2414, 0x938c,
-	0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007,
-	0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738,
-	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
-	0x0240, 0x1f04, 0x59f6, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe,
-	0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3a, 0x080c,
-	0x8131, 0x9086, 0x0084, 0x1198, 0x080c, 0x5caf, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093,
-	0x0001, 0x080c, 0x5c05, 0x7097, 0x001a, 0x0029, 0x0010, 0x708f,
-	0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5cda, 0x7097,
-	0x001b, 0x080c, 0x97df, 0x080c, 0x5caf, 0x2011, 0x0260, 0x2009,
-	0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
-	0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
-	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
-	0x2011, 0x0260, 0x1f04, 0x5a42, 0x60c3, 0x0084, 0x080c, 0x5b64,
-	0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c, 0x20a9,
-	0x0008, 0x2041, 0x1d0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5caf,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011,
-	0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6,
-	0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04,
-	0x5a74, 0x0804, 0x5ae3, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6,
-	0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5ae3, 0x918d,
-	0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019,
-	0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240,
-	0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5a9a, 0x04d8,
-	0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5aac, 0x2328,
-	0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200,
-	0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5abb, 0x755a,
-	0x95c8, 0x3184, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536,
-	0x0016, 0x2508, 0x080c, 0x246d, 0x001e, 0x60e7, 0x0000, 0x65ea,
-	0x2018, 0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003,
-	0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099,
-	0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e,
-	0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007,
-	0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff,
-	0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff,
-	0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528,
-	0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0, 0x3184,
-	0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016, 0x2508,
-	0x080c, 0x246d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083, 0x0001,
-	0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087, 0x0000,
-	0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140,
-	0x080c, 0x5bf4, 0x080c, 0x8f9c, 0x7004, 0x9084, 0x4000, 0x0110,
-	0x080c, 0x2843, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825, 0x2073,
-	0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5c51,
-	0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e,
-	0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x27a2, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011,
-	0x19c5, 0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3, 0x0056,
-	0x60a7, 0x9575, 0x080c, 0x8f8f, 0x6144, 0xd184, 0x0120, 0x7194,
-	0x918d, 0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011, 0x196a,
-	0x2112, 0x2009, 0x07d0, 0x2011, 0x5b3a, 0x080c, 0x81f5, 0x0005,
-	0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x98ad,
-	0x080c, 0x9b52, 0x080c, 0x98c9, 0x2009, 0x00f7, 0x080c, 0x5c51,
-	0x2061, 0x19d4, 0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061,
-	0x1800, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x2009, 0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011,
-	0x5bc0, 0x080c, 0x8125, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005,
-	0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100,
-	0x080c, 0x8f9c, 0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110,
-	0x080c, 0x2843, 0x080c, 0x70b4, 0x0188, 0x080c, 0x70cf, 0x1170,
-	0x080c, 0x73b6, 0x0016, 0x080c, 0x253c, 0x2001, 0x193e, 0x2102,
-	0x001e, 0x080c, 0x73b1, 0x080c, 0x6fdd, 0x0050, 0x2009, 0x0001,
-	0x080c, 0x281f, 0x2001, 0x0001, 0x080c, 0x23c9, 0x080c, 0x5b90,
-	0x012e, 0x000e, 0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc,
-	0x0158, 0x0026, 0x0036, 0x2011, 0x8017, 0x2001, 0x196a, 0x201c,
-	0x080c, 0x48d1, 0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9,
-	0x0001, 0x20a1, 0x1d80, 0x080c, 0x5caf, 0x20e9, 0x0000, 0x2099,
-	0x026e, 0x0099, 0x20a9, 0x0020, 0x080c, 0x5ca9, 0x2099, 0x0260,
-	0x20a1, 0x1d92, 0x0051, 0x20a9, 0x000e, 0x080c, 0x5cac, 0x2099,
-	0x0260, 0x20a1, 0x1db2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410,
-	0x3308, 0x2104, 0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x5c29,
-	0x002e, 0x001e, 0x0005, 0x080c, 0x97df, 0x20e1, 0x0001, 0x2099,
-	0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003,
-	0x0005, 0x080c, 0x97df, 0x080c, 0x5caf, 0x20e1, 0x0000, 0x2099,
-	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003,
-	0x0005, 0x00c6, 0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1833,
-	0x2004, 0x9005, 0x1138, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
-	0x9105, 0x0010, 0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005,
-	0x0016, 0x0046, 0x080c, 0x665c, 0x0158, 0x9006, 0x2020, 0x2009,
-	0x002a, 0x080c, 0xd251, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102,
-	0x2019, 0x002a, 0x900e, 0x080c, 0x2fc2, 0x080c, 0xbf46, 0x0140,
-	0x0036, 0x2019, 0xffff, 0x2021, 0x0007, 0x080c, 0x4a6e, 0x003e,
-	0x004e, 0x001e, 0x0005, 0x080c, 0x5b90, 0x7097, 0x0000, 0x708f,
-	0x0000, 0x0005, 0x0006, 0x2001, 0x180c, 0x2004, 0xd09c, 0x0100,
-	0x000e, 0x0005, 0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001,
-	0x0101, 0x200c, 0x918d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e,
-	0x0005, 0x2009, 0x0001, 0x0020, 0x2009, 0x0002, 0x0008, 0x900e,
-	0x6814, 0x9084, 0xffc0, 0x910d, 0x6916, 0x0005, 0x00f6, 0x0156,
-	0x0146, 0x01d6, 0x9006, 0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1,
-	0x1d00, 0x4004, 0x2079, 0x1d00, 0x7803, 0x2200, 0x7807, 0x00ef,
-	0x780f, 0x00ef, 0x7813, 0x0138, 0x7823, 0xffff, 0x7827, 0xffff,
-	0x01de, 0x014e, 0x015e, 0x00fe, 0x0005, 0x2001, 0x1800, 0x2003,
-	0x0001, 0x0005, 0x2001, 0x1977, 0x0118, 0x2003, 0x0001, 0x0010,
-	0x2003, 0x0000, 0x0005, 0x0156, 0x20a9, 0x0800, 0x2009, 0x1000,
-	0x9006, 0x200a, 0x8108, 0x1f04, 0x5ce9, 0x015e, 0x0005, 0x00d6,
-	0x0036, 0x0156, 0x0136, 0x0146, 0x2069, 0x1853, 0x9006, 0xb802,
-	0xb8c6, 0xb807, 0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x3184,
-	0x231d, 0x939c, 0x00ff, 0xbb16, 0x0016, 0x0026, 0xb886, 0x080c,
-	0x9b4b, 0x1120, 0x9192, 0x007e, 0x1208, 0xbb86, 0x20a9, 0x0004,
-	0xb8b4, 0x20e8, 0xb9b8, 0x9198, 0x0006, 0x9006, 0x23a0, 0x4004,
-	0x20a9, 0x0004, 0x9198, 0x000a, 0x23a0, 0x4004, 0x002e, 0x001e,
-	0xb83e, 0xb842, 0xb8be, 0xb8c2, 0xb85e, 0xb862, 0xb866, 0xb86a,
-	0xb86f, 0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893,
-	0x0008, 0xb896, 0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4,
-	0x904d, 0x0110, 0x080c, 0x1054, 0xb8a7, 0x0000, 0x009e, 0x9006,
-	0xb84a, 0x6810, 0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff,
-	0xb842, 0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126,
-	0x2091, 0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000,
-	0x1a04, 0x5dad, 0x9182, 0x0800, 0x1a04, 0x5db1, 0x2001, 0x180c,
-	0x2004, 0x9084, 0x0003, 0x1904, 0x5db7, 0x9188, 0x1000, 0x2104,
-	0x905d, 0x0198, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1188,
-	0xb8a4, 0x900d, 0x1904, 0x5dc9, 0x080c, 0x6123, 0x9006, 0x012e,
-	0x0005, 0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e,
-	0x0498, 0x9082, 0x0006, 0x1290, 0x080c, 0x9b4b, 0x1160, 0xb8a0,
-	0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0d10, 0x2001, 0x0029,
-	0x2009, 0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c,
-	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118,
-	0x2001, 0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118,
-	0x2009, 0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e,
-	0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001,
-	0x180c, 0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x9065,
-	0x09a8, 0x080c, 0x6660, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804,
-	0x5d70, 0x080c, 0x64d4, 0x0904, 0x5d79, 0x0804, 0x5d74, 0x00e6,
-	0x2071, 0x19b8, 0x7004, 0x9086, 0x0002, 0x1128, 0x7030, 0x9080,
-	0x0004, 0x2004, 0x9b06, 0x00ee, 0x0005, 0x00b6, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e58, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0904, 0x5e30, 0xb8a0, 0x9086, 0x007f,
-	0x0178, 0x080c, 0x6668, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e,
-	0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6660, 0x1598,
-	0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026,
-	0x2010, 0x080c, 0xb81a, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804,
-	0x5e5a, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804,
-	0x5e5a, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c,
-	0x9b76, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff,
-	0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9c6a, 0x9006, 0x0458,
-	0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0x9b4b,
-	0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900,
-	0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090,
-	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050,
-	0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010,
-	0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001,
-	0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0,
-	0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005,
-	0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800,
-	0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98,
-	0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118,
-	0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010,
-	0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be,
-	0x00fe, 0x0005, 0x5eef, 0x5eaa, 0x5ec1, 0x5eef, 0x5eef, 0x5eef,
-	0x5eef, 0x5eef, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x6209,
-	0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5ef7, 0xb814, 0x9206,
-	0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x478b, 0x0150,
-	0x04b0, 0x080c, 0x6269, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814,
-	0x9206, 0x1568, 0x080c, 0x9b76, 0x0530, 0x2b00, 0x6012, 0x080c,
-	0xbcc0, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878,
-	0x9086, 0x0001, 0x1170, 0x080c, 0x3003, 0x9006, 0x080c, 0x61a6,
-	0x2001, 0x0002, 0x080c, 0x61ba, 0x2001, 0x0200, 0xb86e, 0xb893,
-	0x0002, 0x2009, 0x0003, 0x080c, 0x9c6a, 0x9006, 0x0068, 0x2001,
-	0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
-	0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005,
-	0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6,
-	0x0015, 0x0904, 0x60cc, 0x90c6, 0x0056, 0x0904, 0x60d0, 0x90c6,
-	0x0066, 0x0904, 0x60d4, 0x90c6, 0x0067, 0x0904, 0x60d8, 0x90c6,
-	0x0068, 0x0904, 0x60dc, 0x90c6, 0x0071, 0x0904, 0x60e0, 0x90c6,
-	0x0074, 0x0904, 0x60e4, 0x90c6, 0x007c, 0x0904, 0x60e8, 0x90c6,
-	0x007e, 0x0904, 0x60ec, 0x90c6, 0x0037, 0x0904, 0x60f0, 0x9016,
-	0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60c7, 0x9182,
-	0x0800, 0x1a04, 0x60c7, 0x080c, 0x6269, 0x1198, 0xb804, 0x9084,
-	0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148,
-	0x080c, 0x9b4b, 0x1904, 0x60b0, 0xb8a0, 0x9084, 0xff80, 0x1904,
-	0x60b0, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904,
-	0x6010, 0x90c6, 0x0064, 0x0904, 0x6039, 0x2008, 0x0804, 0x5fd3,
-	0xa998, 0xa8b0, 0x2040, 0x080c, 0x9b4b, 0x1120, 0x9182, 0x007f,
-	0x0a04, 0x5fd3, 0x9186, 0x00ff, 0x0904, 0x5fd3, 0x9182, 0x0800,
-	0x1a04, 0x5fd3, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188, 0x787c,
-	0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x5fd3,
-	0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x5fd3,
-	0x080c, 0x478b, 0x0904, 0x5fdc, 0x900e, 0x9016, 0x90c6, 0x4000,
-	0x1558, 0x0006, 0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0f9f, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0f9f, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408,
-	0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6,
-	0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005,
-	0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e,
-	0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9b76, 0x1130, 0x2001,
-	0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c,
-	0xbcc0, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108,
-	0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x3003, 0x012e,
-	0x9006, 0x080c, 0x61a6, 0x2001, 0x0002, 0x080c, 0x61ba, 0x2009,
-	0x0002, 0x080c, 0x9c6a, 0xa8b0, 0xd094, 0x0118, 0xb8c4, 0xc08d,
-	0xb8c6, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005,
-	0x080c, 0x539a, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0,
-	0x080c, 0x6269, 0x1904, 0x5fce, 0x9186, 0x007f, 0x0130, 0x080c,
-	0x6660, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x1022,
-	0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806,
-	0x080c, 0xba18, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
-	0x5fd5, 0xa998, 0xaeb0, 0x080c, 0x6269, 0x1904, 0x5fce, 0x0096,
-	0x080c, 0x1022, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x608d,
-	0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8b4,
-	0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
-	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbb8,
-	0x9398, 0x0006, 0x2398, 0x080c, 0x0f9f, 0x009e, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x5386,
-	0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118,
-	0xa89b, 0x000c, 0x00b0, 0x080c, 0x6660, 0x0118, 0xa89b, 0x0009,
-	0x0080, 0x080c, 0x539a, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c,
-	0xb9fb, 0x1904, 0x6009, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
-	0x5fd5, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
-	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
-	0x1266, 0x080c, 0xa0da, 0x1904, 0x6009, 0x2009, 0x0002, 0x08e8,
-	0x2001, 0x0028, 0x900e, 0x0804, 0x600a, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x600a, 0x2001,
-	0x0029, 0x900e, 0x0804, 0x600a, 0x080c, 0x35a7, 0x0804, 0x600b,
-	0x080c, 0x50bb, 0x0804, 0x600b, 0x080c, 0x434d, 0x0804, 0x600b,
-	0x080c, 0x43c6, 0x0804, 0x600b, 0x080c, 0x4422, 0x0804, 0x600b,
-	0x080c, 0x4847, 0x0804, 0x600b, 0x080c, 0x4af3, 0x0804, 0x600b,
-	0x080c, 0x4d26, 0x0804, 0x600b, 0x080c, 0x4f1f, 0x0804, 0x600b,
-	0x080c, 0x37bc, 0x0804, 0x600b, 0x00b6, 0xa974, 0xae78, 0x9684,
-	0x3fff, 0x9082, 0x4000, 0x1608, 0x9182, 0x0800, 0x1258, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0130, 0x080c, 0x6660, 0x1138, 0x00d9,
-	0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090, 0x9082, 0x0006,
-	0x1240, 0xb900, 0xd1fc, 0x0d98, 0x2001, 0x0029, 0x2009, 0x1000,
-	0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e,
-	0x9005, 0x00be, 0x0005, 0xa877, 0x0000, 0xb8c0, 0x9005, 0x1904,
-	0x619a, 0xb888, 0x9005, 0x1904, 0x619a, 0xb838, 0xb93c, 0x9102,
-	0x1a04, 0x619a, 0x2b10, 0x080c, 0x9ba3, 0x0904, 0x6196, 0x8108,
-	0xb93e, 0x6212, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff,
+	0x0014, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x05f0, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0014, 0x15a8,
+	0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1568,
+	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168, 0x9085,
+	0x0001, 0x080c, 0x5ce1, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x9085, 0x0001,
+	0x080c, 0x5ce1, 0x7093, 0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70db,
+	0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
+	0x0005, 0x080c, 0x97fa, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099,
+	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003,
+	0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d, 0x2012,
+	0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c99, 0x1150, 0x7080,
+	0x9005, 0x1138, 0x080c, 0x5a61, 0x1188, 0x9085, 0x0001, 0x080c,
+	0x248d, 0x20a9, 0x0008, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5b6b, 0x0010, 0x080c, 0x55bb, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x01d8, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0084,
+	0x1190, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
+	0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5ce1, 0x7097,
+	0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x0019, 0x080c, 0x5c48, 0x2079, 0x0240, 0x7833, 0x1106,
+	0x7837, 0x0000, 0x080c, 0x5cb6, 0x2009, 0x026e, 0x2039, 0x1d0e,
+	0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280, 0x1128,
+	0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x59ca, 0x2039,
+	0x1d0e, 0x080c, 0x5c99, 0x11e8, 0x2728, 0x2514, 0x8207, 0x9084,
+	0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205, 0x202a,
+	0x705c, 0x2310, 0x8214, 0x92a0, 0x1d0e, 0x2414, 0x938c, 0x0001,
+	0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007, 0x9215,
+	0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738, 0x8108,
+	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
+	0x1f04, 0x59fd, 0x60c3, 0x0084, 0x080c, 0x5b6b, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b41, 0x080c, 0x8159,
+	0x9086, 0x0084, 0x1198, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001,
+	0x080c, 0x5c0c, 0x7097, 0x001a, 0x0029, 0x0010, 0x708f, 0x0000,
+	0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5ce1, 0x7097, 0x001b,
+	0x080c, 0x97fa, 0x080c, 0x5cb6, 0x2011, 0x0260, 0x2009, 0x0240,
+	0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004,
+	0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
+	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
+	0x0260, 0x1f04, 0x5a49, 0x60c3, 0x0084, 0x080c, 0x5b6b, 0x0005,
+	0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c, 0x20a9, 0x0008,
+	0x2041, 0x1d0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5cb6, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007,
+	0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff,
+	0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x5a7b,
+	0x0804, 0x5aea, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff,
+	0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5aea, 0x918d, 0xc000,
+	0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010,
+	0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4,
+	0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5aa1, 0x04d8, 0x23a8,
+	0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5ab3, 0x2328, 0x8529,
+	0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a,
+	0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5ac2, 0x755a, 0x95c8,
+	0x318b, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016,
+	0x2508, 0x080c, 0x246d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018,
+	0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e, 0x013e,
+	0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007, 0x939a,
+	0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120,
+	0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118,
+	0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528, 0x2504,
+	0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0, 0x318b, 0x242d,
+	0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
+	0x246d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083, 0x0001, 0x9084,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087, 0x0000, 0x00ee,
+	0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c,
+	0x5bfb, 0x080c, 0x8fb7, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2843, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825, 0x2073, 0x0000,
+	0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5c58, 0x001e,
+	0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e,
+	0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x27a2,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011, 0x19c5,
+	0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x080c, 0x8faa, 0x6144, 0xd184, 0x0120, 0x7194, 0x918d,
+	0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011, 0x196a, 0x2112,
+	0x2009, 0x07d0, 0x2011, 0x5b41, 0x080c, 0x821d, 0x0005, 0x0016,
+	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x98c8, 0x080c,
+	0x9b6d, 0x080c, 0x98e4, 0x2009, 0x00f7, 0x080c, 0x5c58, 0x2061,
+	0x19d4, 0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800,
+	0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x2009, 0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bc7,
+	0x080c, 0x814d, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c,
+	0x8fb7, 0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2843, 0x080c, 0x70bf, 0x0188, 0x080c, 0x70da, 0x1170, 0x080c,
+	0x73c1, 0x0016, 0x080c, 0x253c, 0x2001, 0x193e, 0x2102, 0x001e,
+	0x080c, 0x73bc, 0x080c, 0x6fe8, 0x0050, 0x2009, 0x0001, 0x080c,
+	0x281f, 0x2001, 0x0001, 0x080c, 0x23c9, 0x080c, 0x5b97, 0x012e,
+	0x000e, 0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158,
+	0x0026, 0x0036, 0x2011, 0x8017, 0x2001, 0x196a, 0x201c, 0x080c,
+	0x48d8, 0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001,
+	0x20a1, 0x1d80, 0x080c, 0x5cb6, 0x20e9, 0x0000, 0x2099, 0x026e,
+	0x0099, 0x20a9, 0x0020, 0x080c, 0x5cb0, 0x2099, 0x0260, 0x20a1,
+	0x1d92, 0x0051, 0x20a9, 0x000e, 0x080c, 0x5cb3, 0x2099, 0x0260,
+	0x20a1, 0x1db2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308,
+	0x2104, 0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x5c30, 0x002e,
+	0x001e, 0x0005, 0x080c, 0x97fa, 0x20e1, 0x0001, 0x2099, 0x1d00,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
+	0x080c, 0x97fa, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
+	0x00c6, 0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1833, 0x2004,
+	0x9005, 0x1138, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x9105,
+	0x0010, 0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016,
+	0x0046, 0x080c, 0x6663, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
+	0x080c, 0xd273, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
+	0x002a, 0x900e, 0x080c, 0x2fc5, 0x080c, 0xbf61, 0x0140, 0x0036,
+	0x2019, 0xffff, 0x2021, 0x0007, 0x080c, 0x4a75, 0x003e, 0x004e,
+	0x001e, 0x0005, 0x080c, 0x5b97, 0x7097, 0x0000, 0x708f, 0x0000,
+	0x0005, 0x0006, 0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e,
+	0x0005, 0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101,
+	0x200c, 0x918d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005,
+	0x2009, 0x0001, 0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814,
+	0x9084, 0xffc0, 0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146,
+	0x01d6, 0x9006, 0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1d00,
+	0x4004, 0x2079, 0x1d00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f,
+	0x00ef, 0x7813, 0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de,
+	0x014e, 0x015e, 0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001,
+	0x0005, 0x2001, 0x1977, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003,
+	0x0000, 0x0005, 0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006,
+	0x200a, 0x8108, 0x1f04, 0x5cf0, 0x015e, 0x0005, 0x00d6, 0x0036,
+	0x0156, 0x0136, 0x0146, 0x2069, 0x1853, 0x9006, 0xb802, 0xb8c6,
+	0xb807, 0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x318b, 0x231d,
+	0x939c, 0x00ff, 0xbb16, 0x0016, 0x0026, 0xb886, 0x080c, 0x9b66,
+	0x1120, 0x9192, 0x007e, 0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8b4,
+	0x20e8, 0xb9b8, 0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9,
+	0x0004, 0x9198, 0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e,
+	0xb842, 0xb8be, 0xb8c2, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
+	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
+	0xb896, 0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
+	0x0110, 0x080c, 0x1054, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
+	0x6810, 0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842,
+	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
+	0x5db4, 0x9182, 0x0800, 0x1a04, 0x5db8, 0x2001, 0x180c, 0x2004,
+	0x9084, 0x0003, 0x1904, 0x5dbe, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0198, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4,
+	0x900d, 0x1904, 0x5dd0, 0x080c, 0x612a, 0x9006, 0x012e, 0x0005,
+	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
+	0x9082, 0x0006, 0x1290, 0x080c, 0x9b66, 0x1160, 0xb8a0, 0x9084,
+	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0d10, 0x2001, 0x0029, 0x2009,
+	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
+	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
+	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x9065, 0x09a8,
+	0x080c, 0x6667, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5d77,
+	0x080c, 0x64db, 0x0904, 0x5d80, 0x0804, 0x5d7b, 0x00e6, 0x2071,
+	0x19b8, 0x7004, 0x9086, 0x0002, 0x1128, 0x7030, 0x9080, 0x0004,
+	0x2004, 0x9b06, 0x00ee, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e5f, 0x9188, 0x1000,
+	0x2104, 0x905d, 0x0904, 0x5e37, 0xb8a0, 0x9086, 0x007f, 0x0178,
+	0x080c, 0x666f, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004,
+	0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6667, 0x1598, 0xa87c,
+	0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010,
+	0x080c, 0xb835, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x5e61,
+	0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x5e61,
+	0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0x9b91,
+	0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023,
+	0x000a, 0x2009, 0x0003, 0x080c, 0x9c85, 0x9006, 0x0458, 0x2001,
+	0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0x9b66, 0x1160,
+	0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001,
+	0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001,
+	0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c,
+	0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005,
+	0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518,
+	0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800, 0x9182,
+	0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98, 0xab94,
+	0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
+	0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be, 0x00fe,
+	0x0005, 0x5ef6, 0x5eb1, 0x5ec8, 0x5ef6, 0x5ef6, 0x5ef6, 0x5ef6,
+	0x5ef6, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x6210, 0x0148,
+	0x9046, 0xb810, 0x9306, 0x1904, 0x5efe, 0xb814, 0x9206, 0x15f0,
+	0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x4792, 0x0150, 0x04b0,
+	0x080c, 0x6270, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206,
+	0x1568, 0x080c, 0x9b91, 0x0530, 0x2b00, 0x6012, 0x080c, 0xbcdb,
+	0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086,
+	0x0001, 0x1170, 0x080c, 0x3006, 0x9006, 0x080c, 0x61ad, 0x2001,
+	0x0002, 0x080c, 0x61c1, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002,
+	0x2009, 0x0003, 0x080c, 0x9c85, 0x9006, 0x0068, 0x2001, 0x0001,
+	0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0028,
+	0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6,
+	0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6, 0x0015,
+	0x0904, 0x60d3, 0x90c6, 0x0056, 0x0904, 0x60d7, 0x90c6, 0x0066,
+	0x0904, 0x60db, 0x90c6, 0x0067, 0x0904, 0x60df, 0x90c6, 0x0068,
+	0x0904, 0x60e3, 0x90c6, 0x0071, 0x0904, 0x60e7, 0x90c6, 0x0074,
+	0x0904, 0x60eb, 0x90c6, 0x007c, 0x0904, 0x60ef, 0x90c6, 0x007e,
+	0x0904, 0x60f3, 0x90c6, 0x0037, 0x0904, 0x60f7, 0x9016, 0x2079,
+	0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60ce, 0x9182, 0x0800,
+	0x1a04, 0x60ce, 0x080c, 0x6270, 0x1198, 0xb804, 0x9084, 0x00ff,
+	0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c,
+	0x9b66, 0x1904, 0x60b7, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x60b7,
+	0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x6017,
+	0x90c6, 0x0064, 0x0904, 0x6040, 0x2008, 0x0804, 0x5fda, 0xa998,
+	0xa8b0, 0x2040, 0x080c, 0x9b66, 0x1120, 0x9182, 0x007f, 0x0a04,
+	0x5fda, 0x9186, 0x00ff, 0x0904, 0x5fda, 0x9182, 0x0800, 0x1a04,
+	0x5fda, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188, 0x787c, 0x0096,
+	0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x5fda, 0x99cc,
+	0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x5fda, 0x080c,
+	0x4792, 0x0904, 0x5fe3, 0x900e, 0x9016, 0x90c6, 0x4000, 0x1558,
+	0x0006, 0x080c, 0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
+	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0f9f, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035,
+	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c,
+	0x0f9f, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x00a0,
+	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6, 0x4009,
+	0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005, 0x2009,
+	0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e, 0x2001,
+	0x0030, 0x900e, 0x0470, 0x080c, 0x9b91, 0x1130, 0x2001, 0x4005,
+	0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c, 0xbcdb,
+	0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108, 0xc0f5,
+	0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x3006, 0x012e, 0x9006,
+	0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1, 0x2009, 0x0002,
+	0x080c, 0x9c85, 0xa8b0, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6,
+	0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x080c,
+	0x53a1, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0, 0x080c,
+	0x6270, 0x1904, 0x5fd5, 0x9186, 0x007f, 0x0130, 0x080c, 0x6667,
+	0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x1022, 0x1120,
+	0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806, 0x080c,
+	0xba33, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x5fdc,
+	0xa998, 0xaeb0, 0x080c, 0x6270, 0x1904, 0x5fd5, 0x0096, 0x080c,
+	0x1022, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x6094, 0x2900,
+	0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8b4, 0x20e0,
+	0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
+	0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbb8, 0x9398,
+	0x0006, 0x2398, 0x080c, 0x0f9f, 0x009e, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x538d, 0xd0b4,
+	0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118, 0xa89b,
+	0x000c, 0x00b0, 0x080c, 0x6667, 0x0118, 0xa89b, 0x0009, 0x0080,
+	0x080c, 0x53a1, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c, 0xba16,
+	0x1904, 0x6010, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x5fdc,
+	0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b,
+	0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1266,
+	0x080c, 0xa0f5, 0x1904, 0x6010, 0x2009, 0x0002, 0x08e8, 0x2001,
+	0x0028, 0x900e, 0x0804, 0x6011, 0x2009, 0x180c, 0x210c, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x6011, 0x2001, 0x0029,
+	0x900e, 0x0804, 0x6011, 0x080c, 0x35ae, 0x0804, 0x6012, 0x080c,
+	0x50c2, 0x0804, 0x6012, 0x080c, 0x4354, 0x0804, 0x6012, 0x080c,
+	0x43cd, 0x0804, 0x6012, 0x080c, 0x4429, 0x0804, 0x6012, 0x080c,
+	0x484e, 0x0804, 0x6012, 0x080c, 0x4afa, 0x0804, 0x6012, 0x080c,
+	0x4d2d, 0x0804, 0x6012, 0x080c, 0x4f26, 0x0804, 0x6012, 0x080c,
+	0x37c3, 0x0804, 0x6012, 0x00b6, 0xa974, 0xae78, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x1608, 0x9182, 0x0800, 0x1258, 0x9188, 0x1000,
+	0x2104, 0x905d, 0x0130, 0x080c, 0x6667, 0x1138, 0x00d9, 0x9006,
+	0x00b0, 0x2001, 0x0028, 0x900e, 0x0090, 0x9082, 0x0006, 0x1240,
+	0xb900, 0xd1fc, 0x0d98, 0x2001, 0x0029, 0x2009, 0x1000, 0x0038,
+	0x2001, 0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9005,
+	0x00be, 0x0005, 0xa877, 0x0000, 0xb8c0, 0x9005, 0x1904, 0x61a1,
+	0xb888, 0x9005, 0x1904, 0x61a1, 0xb838, 0xb93c, 0x9102, 0x1a04,
+	0x61a1, 0x2b10, 0x080c, 0x9bbe, 0x0904, 0x619d, 0x8108, 0xb93e,
+	0x6212, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007,
+	0x0040, 0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883,
+	0x0000, 0xa87c, 0xd0ac, 0x05c0, 0xc0dd, 0xa87e, 0xa888, 0x8001,
+	0x1568, 0x2001, 0x00f8, 0x8001, 0xa001, 0xa001, 0xa001, 0x1dd8,
+	0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084,
+	0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001,
+	0x000f, 0x8001, 0x1df0, 0x2001, 0x8004, 0x6003, 0x0004, 0x6046,
+	0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010,
+	0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x080c, 0x164f,
+	0x601c, 0xc0bd, 0x601e, 0x0c38, 0x0006, 0x2001, 0x00e8, 0x8001,
+	0xa001, 0xa001, 0xa001, 0x1dd8, 0x000e, 0xd0b4, 0x190c, 0x1ad2,
+	0x2001, 0x8004, 0x6003, 0x0002, 0x08d0, 0x81ff, 0x1110, 0xb88b,
+	0x0001, 0x2908, 0xb8bc, 0xb9be, 0x9005, 0x1110, 0xb9c2, 0x0020,
+	0x0096, 0x2048, 0xa902, 0x009e, 0x0005, 0x00b6, 0x0126, 0x00c6,
+	0x0026, 0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110,
+	0xc285, 0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be,
+	0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258,
+	0xba04, 0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158,
+	0x080c, 0x6663, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007,
+	0x1110, 0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06,
+	0x0006, 0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0d65,
+	0x000e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6,
+	0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006,
+	0x1168, 0xb89c, 0xd0a4, 0x0150, 0x080c, 0x665f, 0x1138, 0x9284,
+	0x00ff, 0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294,
+	0x00ff, 0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005,
+	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026,
+	0x9190, 0x1000, 0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x1022,
+	0x2958, 0x009e, 0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860,
+	0xb8b6, 0x9006, 0xb8a6, 0x080c, 0x5cf6, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091,
+	0x8000, 0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458,
+	0x00d6, 0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000,
+	0xb8a4, 0x904d, 0x0110, 0x080c, 0x1054, 0x00d6, 0x00c6, 0xb8ac,
+	0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c,
+	0xb847, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x9be7, 0x00ce, 0x0c88,
+	0x00ce, 0x00de, 0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c,
+	0x1064, 0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005,
+	0x0016, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6,
+	0x0156, 0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c,
+	0xb802, 0x080c, 0x70b7, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120,
+	0x080c, 0x9b66, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6,
+	0x2061, 0x1953, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a,
+	0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110,
+	0x2001, 0x0001, 0x6886, 0x2069, 0x1800, 0x68b2, 0x7040, 0xb85e,
+	0x7048, 0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276,
+	0xb8b4, 0x20e8, 0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004,
+	0x4003, 0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004,
+	0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144,
+	0xb96e, 0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817,
+	0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182,
+	0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218,
+	0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006,
+	0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182,
+	0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218,
+	0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e,
+	0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260,
+	0x7034, 0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbc4,
+	0xc384, 0xba00, 0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec,
+	0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138,
+	0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc,
+	0xba02, 0xbbc6, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff,
+	0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084,
+	0xffc0, 0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001,
+	0x4002, 0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0d65,
+	0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x1022, 0x0170,
+	0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x64fb, 0xa807, 0x0001,
+	0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
+	0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800,
+	0x9005, 0x1150, 0x080c, 0x650a, 0x1158, 0xa804, 0x908a, 0x0002,
+	0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x1054, 0xb8a7, 0x0000,
+	0x009e, 0x012e, 0x0005, 0x0096, 0x00c6, 0xb888, 0x9005, 0x1904,
+	0x63f4, 0xb8c0, 0x904d, 0x0904, 0x63f4, 0x080c, 0x9bbe, 0x0904,
+	0x63f0, 0x8210, 0xba3e, 0xa800, 0xb8c2, 0x9005, 0x1108, 0xb8be,
+	0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff,
 	0x6007, 0x0040, 0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066,
-	0xa883, 0x0000, 0xa87c, 0xd0ac, 0x05c0, 0xc0dd, 0xa87e, 0xa888,
-	0x8001, 0x1568, 0x2001, 0x00f8, 0x8001, 0xa001, 0xa001, 0xa001,
-	0x1dd8, 0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x11f8,
-	0x9084, 0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a,
-	0x2001, 0x000f, 0x8001, 0x1df0, 0x2001, 0x8004, 0x6003, 0x0004,
-	0x6046, 0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833,
-	0x0010, 0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x080c,
-	0x164f, 0x601c, 0xc0bd, 0x601e, 0x0c38, 0x0006, 0x2001, 0x00e8,
-	0x8001, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x000e, 0xd0b4, 0x190c,
-	0x1ad2, 0x2001, 0x8004, 0x6003, 0x0002, 0x08d0, 0x81ff, 0x1110,
-	0xb88b, 0x0001, 0x2908, 0xb8bc, 0xb9be, 0x9005, 0x1110, 0xb9c2,
-	0x0020, 0x0096, 0x2048, 0xa902, 0x009e, 0x0005, 0x00b6, 0x0126,
-	0x00c6, 0x0026, 0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005,
-	0x0110, 0xc285, 0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e,
-	0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210,
-	0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac,
-	0x0158, 0x080c, 0x665c, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086,
-	0x0007, 0x1110, 0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215,
-	0xba06, 0x0006, 0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c,
-	0x0d65, 0x000e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126,
-	0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086,
-	0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150, 0x080c, 0x6658, 0x1138,
-	0x9284, 0x00ff, 0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e,
-	0x9294, 0x00ff, 0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be,
-	0x0005, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6,
-	0x0026, 0x9190, 0x1000, 0x2204, 0x905d, 0x1180, 0x0096, 0x080c,
-	0x1022, 0x2958, 0x009e, 0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba,
-	0xb860, 0xb8b6, 0x9006, 0xb8a6, 0x080c, 0x5cef, 0x9006, 0x0010,
-	0x9085, 0x0001, 0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126,
-	0x2091, 0x8000, 0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001,
-	0x0458, 0x00d6, 0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013,
-	0x0000, 0xb8a4, 0x904d, 0x0110, 0x080c, 0x1054, 0x00d6, 0x00c6,
-	0xb8ac, 0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048,
-	0x080c, 0xb82c, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x9bcc, 0x00ce,
-	0x0c88, 0x00ce, 0x00de, 0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862,
-	0x080c, 0x1064, 0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be,
-	0x0005, 0x0016, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030,
-	0x9188, 0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005,
-	0x00d6, 0x0156, 0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800,
-	0xc08c, 0xb802, 0x080c, 0x70ac, 0x1510, 0xb8a0, 0x9086, 0x007e,
-	0x0120, 0x080c, 0x9b4b, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8,
-	0x00c6, 0x2061, 0x1953, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050,
-	0x600a, 0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005,
-	0x1110, 0x2001, 0x0001, 0x6886, 0x2069, 0x1800, 0x68b2, 0x7040,
-	0xb85e, 0x7048, 0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099,
-	0x0276, 0xb8b4, 0x20e8, 0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9,
-	0x0004, 0x4003, 0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9,
-	0x0004, 0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a,
-	0x7144, 0xb96e, 0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200,
-	0x6817, 0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e,
-	0x9182, 0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259,
-	0x1218, 0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009,
-	0x0006, 0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070,
-	0x9182, 0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581,
-	0x1218, 0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e,
-	0x013e, 0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071,
-	0x0260, 0x7034, 0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036,
-	0xbbc4, 0xc384, 0xba00, 0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120,
-	0xd1ec, 0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4,
-	0x0138, 0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008,
-	0xc2bc, 0xba02, 0xbbc6, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005,
-	0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900,
-	0x81ff, 0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146,
-	0x01c6, 0x01d6, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0,
-	0x9084, 0xffc0, 0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9,
-	0x0001, 0x4002, 0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c,
-	0x0d65, 0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210,
-	0xaa06, 0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x1022,
-	0x0170, 0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x64f4, 0xa807,
-	0x0001, 0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006,
-	0x0cd8, 0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188,
-	0xa800, 0x9005, 0x1150, 0x080c, 0x6503, 0x1158, 0xa804, 0x908a,
-	0x0002, 0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x1054, 0xb8a7,
-	0x0000, 0x009e, 0x012e, 0x0005, 0x0096, 0x00c6, 0xb888, 0x9005,
-	0x1904, 0x63ed, 0xb8c0, 0x904d, 0x0904, 0x63ed, 0x080c, 0x9ba3,
-	0x0904, 0x63e9, 0x8210, 0xba3e, 0xa800, 0xb8c2, 0x9005, 0x1108,
-	0xb8be, 0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b,
-	0xffff, 0x6007, 0x0040, 0xa878, 0x605e, 0xa880, 0x9084, 0x00ff,
-	0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac, 0x01c8, 0xc0dd, 0xa87e,
-	0xa888, 0x8001, 0x1568, 0xa816, 0xa864, 0x9094, 0x00f7, 0x9296,
-	0x0011, 0x1530, 0x9084, 0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0,
-	0xa836, 0xaa3a, 0x2001, 0x8004, 0x6003, 0x0004, 0x0030, 0x080c,
-	0x1ad2, 0x2001, 0x8004, 0x6003, 0x0002, 0x6046, 0x2001, 0x0010,
-	0x2c08, 0x080c, 0x989e, 0xb838, 0xba3c, 0x9202, 0x0a04, 0x639a,
-	0x0020, 0x82ff, 0x1110, 0xb88b, 0x0001, 0x00ce, 0x009e, 0x0005,
-	0x080c, 0x164f, 0x601c, 0xc0bd, 0x601e, 0x08e0, 0x00b6, 0x0096,
-	0x0016, 0x20a9, 0x0800, 0x900e, 0x0016, 0x080c, 0x6269, 0x1158,
-	0xb8c0, 0x904d, 0x0140, 0x3e00, 0x9086, 0x0002, 0x1118, 0xb800,
-	0xd0bc, 0x1108, 0x0041, 0x001e, 0x8108, 0x1f04, 0x63fc, 0x001e,
-	0x00be, 0x009e, 0x0005, 0x0096, 0x0016, 0xb8c0, 0x904d, 0x0188,
-	0xa800, 0xb8c2, 0x9005, 0x1108, 0xb8be, 0x9006, 0xa802, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbb2a, 0x080c, 0x698f,
-	0x0c60, 0x001e, 0x009e, 0x0005, 0x0086, 0x9046, 0xb8c0, 0x904d,
-	0x0198, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0128, 0x2940,
-	0xa800, 0x904d, 0x0148, 0x0ca8, 0xa800, 0x88ff, 0x1110, 0xb8c2,
-	0x0008, 0xa002, 0xa803, 0x0000, 0x008e, 0x0005, 0x901e, 0x0010,
-	0x2019, 0x0001, 0x00e6, 0x0096, 0x00c6, 0x0086, 0x0026, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19b8, 0x9046, 0x7028, 0x9065, 0x01e8,
-	0x6014, 0x2068, 0x83ff, 0x0120, 0x605c, 0x9606, 0x0158, 0x0030,
-	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2c40, 0x600c,
-	0x2060, 0x0c60, 0x600c, 0x0006, 0x0066, 0x2830, 0x080c, 0x90f5,
-	0x006e, 0x000e, 0x83ff, 0x0508, 0x0c08, 0x9046, 0xb8c0, 0x904d,
-	0x01e0, 0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c,
-	0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2940, 0xa800, 0x2048,
-	0x0c70, 0xb8c0, 0xaa00, 0x0026, 0x9906, 0x1110, 0xbac2, 0x0008,
-	0xa202, 0x000e, 0x83ff, 0x0108, 0x0c10, 0x002e, 0x008e, 0x00ce,
-	0x009e, 0x00ee, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001,
-	0x0005, 0x080c, 0x6558, 0x0128, 0x080c, 0xb8ed, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x6558, 0x0128, 0x080c, 0xb88e, 0x0010,
-	0x9085, 0x0001, 0x0005, 0x080c, 0x6558, 0x0128, 0x080c, 0xb8ea,
-	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6558, 0x0128, 0x080c,
-	0xb8ad, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6558, 0x0128,
-	0x080c, 0xb92e, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d,
-	0x1118, 0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005,
-	0x11b8, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184,
-	0xffc0, 0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010,
-	0x4002, 0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008,
-	0x9006, 0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff,
-	0x4104, 0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
+	0xa883, 0x0000, 0xa87c, 0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888,
+	0x8001, 0x1568, 0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011,
+	0x1530, 0x9084, 0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836,
+	0xaa3a, 0x2001, 0x8004, 0x6003, 0x0004, 0x0030, 0x080c, 0x1ad2,
+	0x2001, 0x8004, 0x6003, 0x0002, 0x6046, 0x2001, 0x0010, 0x2c08,
+	0x080c, 0x98b9, 0xb838, 0xba3c, 0x9202, 0x0a04, 0x63a1, 0x0020,
+	0x82ff, 0x1110, 0xb88b, 0x0001, 0x00ce, 0x009e, 0x0005, 0x080c,
+	0x164f, 0x601c, 0xc0bd, 0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016,
+	0x20a9, 0x0800, 0x900e, 0x0016, 0x080c, 0x6270, 0x1158, 0xb8c0,
+	0x904d, 0x0140, 0x3e00, 0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc,
+	0x1108, 0x0041, 0x001e, 0x8108, 0x1f04, 0x6403, 0x001e, 0x00be,
+	0x009e, 0x0005, 0x0096, 0x0016, 0xb8c0, 0x904d, 0x0188, 0xa800,
+	0xb8c2, 0x9005, 0x1108, 0xb8be, 0x9006, 0xa802, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0xbb45, 0x080c, 0x6996, 0x0c60,
+	0x001e, 0x009e, 0x0005, 0x0086, 0x9046, 0xb8c0, 0x904d, 0x0198,
+	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0128, 0x2940, 0xa800,
+	0x904d, 0x0148, 0x0ca8, 0xa800, 0x88ff, 0x1110, 0xb8c2, 0x0008,
+	0xa002, 0xa803, 0x0000, 0x008e, 0x0005, 0x901e, 0x0010, 0x2019,
+	0x0001, 0x00e6, 0x0096, 0x00c6, 0x0086, 0x0026, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19b8, 0x9046, 0x7028, 0x9065, 0x01e8, 0x6014,
+	0x2068, 0x83ff, 0x0120, 0x605c, 0x9606, 0x0158, 0x0030, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2c40, 0x600c, 0x2060,
+	0x0c60, 0x600c, 0x0006, 0x0066, 0x2830, 0x080c, 0x9110, 0x006e,
+	0x000e, 0x83ff, 0x0508, 0x0c08, 0x9046, 0xb8c0, 0x904d, 0x01e0,
+	0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0120, 0x2940, 0xa800, 0x2048, 0x0c70,
+	0xb8c0, 0xaa00, 0x0026, 0x9906, 0x1110, 0xbac2, 0x0008, 0xa202,
+	0x000e, 0x83ff, 0x0108, 0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e,
+	0x00ee, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005,
+	0x080c, 0x655f, 0x0128, 0x080c, 0xb908, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x655f, 0x0128, 0x080c, 0xb8a9, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x655f, 0x0128, 0x080c, 0xb905, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x655f, 0x0128, 0x080c, 0xb8c8,
+	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x655f, 0x0128, 0x080c,
+	0xb949, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118,
+	0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
 	0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
 	0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002,
-	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146,
-	0x01d6, 0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff,
-	0x4004, 0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x1022,
-	0x0168, 0x2900, 0xb8a6, 0x080c, 0x64f4, 0xa803, 0x0001, 0xa807,
-	0x0000, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
-	0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7,
-	0x0000, 0x080c, 0x1054, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005,
-	0xb89c, 0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x70ac, 0x01b0,
-	0x71c0, 0x81ff, 0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e,
-	0x9080, 0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853,
-	0x7804, 0x00d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
-	0x6269, 0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004,
-	0x0118, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e,
-	0x8108, 0x1f04, 0x657e, 0x015e, 0x080c, 0x661e, 0x0120, 0x2001,
-	0x1956, 0x200c, 0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009,
-	0x07d0, 0x2011, 0x65a8, 0x080c, 0x81f5, 0x00fe, 0x00be, 0x0005,
-	0x00b6, 0x2011, 0x65a8, 0x080c, 0x8131, 0x080c, 0x661e, 0x01d8,
-	0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c,
-	0x665c, 0x0130, 0x2009, 0x07d0, 0x2011, 0x65a8, 0x080c, 0x81f5,
-	0x00e6, 0x2071, 0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c,
-	0x2ddb, 0x00ee, 0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
-	0x0016, 0x080c, 0x6269, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046,
-	0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xd251, 0xb800,
-	0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x6658, 0x2001, 0x0707, 0x1128,
-	0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0x98ad,
-	0x2019, 0x0029, 0x080c, 0x8613, 0x0076, 0x903e, 0x080c, 0x8502,
-	0x900e, 0x080c, 0xcfa6, 0x007e, 0x004e, 0x080c, 0x98c9, 0x001e,
-	0x8108, 0x1f04, 0x65d0, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6,
-	0x6010, 0x2058, 0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x7810,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ac, 0x0005, 0x6010, 0x00b6,
-	0x905d, 0x0108, 0xb800, 0x00be, 0xd0bc, 0x0005, 0x00b6, 0x00f6,
-	0x2001, 0x107e, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0ec, 0x00fe,
-	0x00be, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000, 0x0006, 0xbaa0,
-	0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0d65, 0x000e, 0xba00,
-	0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e,
-	0x0005, 0x2011, 0x1836, 0x2204, 0xd0cc, 0x0138, 0x2001, 0x1954,
-	0x200c, 0x2011, 0x664e, 0x080c, 0x81f5, 0x0005, 0x2011, 0x664e,
-	0x080c, 0x8131, 0x2011, 0x1836, 0x2204, 0xc0cc, 0x2012, 0x0005,
-	0x080c, 0x5386, 0xd0ac, 0x0005, 0x080c, 0x5386, 0xd0a4, 0x0005,
-	0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006, 0x001e, 0x0005,
-	0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e, 0x0006, 0x001e,
-	0x0005, 0x00b6, 0x00f6, 0x080c, 0xbf46, 0x0158, 0x70d8, 0x9084,
-	0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d, 0x0110, 0xb8c4,
-	0xd094, 0x00fe, 0x00be, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046,
-	0x0076, 0x00b6, 0x2001, 0x1817, 0x203c, 0x9780, 0x3184, 0x203d,
-	0x97bc, 0xff00, 0x873f, 0x9006, 0x2018, 0x2008, 0x9284, 0x8000,
-	0x0110, 0x2019, 0x0001, 0x9294, 0x7fff, 0x2100, 0x9706, 0x0190,
-	0x91a0, 0x1000, 0x2404, 0x905d, 0x0168, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x1138, 0x83ff, 0x0118, 0xb89c, 0xd0a4, 0x0110,
-	0x8211, 0x0158, 0x8108, 0x83ff, 0x0120, 0x9182, 0x0800, 0x0e28,
-	0x0068, 0x9182, 0x007e, 0x0e08, 0x0048, 0x00be, 0x007e, 0x004e,
-	0x003e, 0x001e, 0x9085, 0x0001, 0x000e, 0x0005, 0x00be, 0x007e,
-	0x004e, 0x003e, 0x001e, 0x9006, 0x000e, 0x0005, 0x0046, 0x0056,
-	0x0076, 0x00b6, 0x2100, 0x9084, 0x7fff, 0x9080, 0x1000, 0x2004,
-	0x905d, 0x0130, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0550,
-	0x9184, 0x8000, 0x0580, 0x2001, 0x1817, 0x203c, 0x9780, 0x3184,
-	0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2020, 0x2400, 0x9706,
-	0x01a0, 0x94a8, 0x1000, 0x2504, 0x905d, 0x0178, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x1148, 0xb89c, 0xd0a4, 0x0130, 0xb814,
-	0x9206, 0x1118, 0xb810, 0x9306, 0x0128, 0x8420, 0x9482, 0x0800,
-	0x0e28, 0x0048, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e,
-	0x9085, 0x0001, 0x0005, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e,
-	0x004e, 0x9006, 0x0005, 0x2071, 0x1906, 0x7003, 0x0001, 0x7007,
-	0x0000, 0x9006, 0x7012, 0x7016, 0x701a, 0x701e, 0x700a, 0x7046,
-	0x2001, 0x1919, 0x2003, 0x0000, 0x0005, 0x0016, 0x00e6, 0x2071,
-	0x191a, 0x900e, 0x710a, 0x080c, 0x5386, 0xd0fc, 0x1140, 0x080c,
-	0x5386, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0400, 0x2001,
-	0x1873, 0x200c, 0x9184, 0x0007, 0x9006, 0x0002, 0x6737, 0x6737,
-	0x6737, 0x6737, 0x6737, 0x674e, 0x675c, 0x6737, 0x7003, 0x0003,
-	0x2009, 0x1874, 0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110,
-	0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee,
-	0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150,
-	0x00e6, 0x2071, 0x1906, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085,
-	0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c, 0x741e, 0x6a60,
-	0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016,
-	0x6860, 0x7002, 0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e,
-	0x6844, 0x9005, 0x1110, 0x7012, 0x7016, 0x684c, 0x701a, 0x701c,
-	0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b, 0x0001, 0x00e6,
-	0x2071, 0x1906, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b,
-	0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868, 0xd0fc, 0x11d8,
-	0x00e6, 0x0026, 0x2001, 0x191a, 0x2004, 0x9005, 0x0904, 0x6994,
-	0xa87c, 0xd0bc, 0x1904, 0x6994, 0xa978, 0xa874, 0x9105, 0x1904,
-	0x6994, 0x2001, 0x191a, 0x2004, 0x0002, 0x6994, 0x67e8, 0x6824,
-	0x6824, 0x6994, 0x6824, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
-	0x0026, 0x2009, 0x191a, 0x210c, 0x81ff, 0x0904, 0x6994, 0xa87c,
-	0xd0cc, 0x0904, 0x6994, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
-	0x1904, 0x6994, 0x9186, 0x0003, 0x0904, 0x6824, 0x9186, 0x0005,
-	0x0904, 0x6824, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
-	0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1906, 0x701c, 0x9005,
-	0x1904, 0x6b37, 0x0e04, 0x6b82, 0x2071, 0x0000, 0xa84c, 0x7082,
-	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2071,
-	0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802,
-	0x2900, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x804c, 0x002e,
-	0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079,
-	0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
-	0x6919, 0x782c, 0x908c, 0x0780, 0x190c, 0x6ca9, 0x8004, 0x8004,
-	0x8004, 0x9084, 0x0003, 0x0002, 0x6842, 0x6919, 0x6867, 0x68b4,
-	0x080c, 0x0d65, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x1170, 0x2071, 0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b,
-	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
-	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x804c, 0x0c10, 0x2071,
-	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824, 0x00e6,
-	0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c,
-	0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108,
-	0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x804c, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6ca9, 0xd0a4, 0x19c8, 0x2071, 0x19d4, 0x703c,
-	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
-	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
-	0x080c, 0x804c, 0x0804, 0x686e, 0x0096, 0x00e6, 0x7824, 0x2048,
-	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
-	0x70be, 0x080c, 0x804c, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9,
-	0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9,
-	0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560,
-	0x2071, 0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004,
-	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908,
-	0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902,
-	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x19d4,
-	0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70bc, 0x9200, 0x70be, 0x080c, 0x804c, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
-	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
-	0x696e, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9, 0xd09c, 0x1198,
-	0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a,
-	0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6ca9, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9,
-	0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x804c,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9, 0xd0a4, 0x1d60, 0x00ee,
+	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104,
+	0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
+	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
+	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
+	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6,
+	0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004,
+	0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x1022, 0x0168,
+	0x2900, 0xb8a6, 0x080c, 0x64fb, 0xa803, 0x0001, 0xa807, 0x0000,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000,
+	0x080c, 0x1054, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c,
+	0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x70b7, 0x01b0, 0x71c0,
+	0x81ff, 0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080,
+	0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804,
+	0x00d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6270,
+	0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118,
+	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108,
+	0x1f04, 0x6585, 0x015e, 0x080c, 0x6625, 0x0120, 0x2001, 0x1956,
+	0x200c, 0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0,
+	0x2011, 0x65af, 0x080c, 0x821d, 0x00fe, 0x00be, 0x0005, 0x00b6,
+	0x2011, 0x65af, 0x080c, 0x8159, 0x080c, 0x6625, 0x01d8, 0x2001,
+	0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6663,
+	0x0130, 0x2009, 0x07d0, 0x2011, 0x65af, 0x080c, 0x821d, 0x00e6,
+	0x2071, 0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2ddb,
+	0x00ee, 0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x080c, 0x6270, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0,
+	0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xd273, 0xb800, 0xc0e5,
+	0xc0ec, 0xb802, 0x080c, 0x665f, 0x2001, 0x0707, 0x1128, 0xb804,
+	0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0x98c8, 0x2019,
+	0x0029, 0x080c, 0x863b, 0x0076, 0x903e, 0x080c, 0x852a, 0x900e,
+	0x080c, 0xcfc8, 0x007e, 0x004e, 0x080c, 0x98e4, 0x001e, 0x8108,
+	0x1f04, 0x65d7, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010,
+	0x2058, 0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x7810, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d,
+	0x0108, 0xb800, 0x00be, 0xd0bc, 0x0005, 0x00b6, 0x00f6, 0x2001,
+	0x107e, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0ec, 0x00fe, 0x00be,
+	0x0005, 0x0126, 0x0026, 0x2091, 0x8000, 0x0006, 0xbaa0, 0x9290,
+	0x1000, 0x2204, 0x9b06, 0x190c, 0x0d65, 0x000e, 0xba00, 0x9005,
+	0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005,
+	0x2011, 0x1836, 0x2204, 0xd0cc, 0x0138, 0x2001, 0x1954, 0x200c,
+	0x2011, 0x6655, 0x080c, 0x821d, 0x0005, 0x2011, 0x6655, 0x080c,
+	0x8159, 0x2011, 0x1836, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c,
+	0x538d, 0xd0ac, 0x0005, 0x080c, 0x538d, 0xd0a4, 0x0005, 0x0016,
+	0xb904, 0x9184, 0x00ff, 0x908e, 0x0006, 0x001e, 0x0005, 0x0016,
+	0xb904, 0x9184, 0xff00, 0x8007, 0x908e, 0x0006, 0x001e, 0x0005,
+	0x00b6, 0x00f6, 0x080c, 0xbf61, 0x0158, 0x70d8, 0x9084, 0x0028,
+	0x0138, 0x2001, 0x107f, 0x2004, 0x905d, 0x0110, 0xb8c4, 0xd094,
+	0x00fe, 0x00be, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x0076,
+	0x00b6, 0x2001, 0x1817, 0x203c, 0x9780, 0x318b, 0x203d, 0x97bc,
+	0xff00, 0x873f, 0x9006, 0x2018, 0x2008, 0x9284, 0x8000, 0x0110,
+	0x2019, 0x0001, 0x9294, 0x7fff, 0x2100, 0x9706, 0x0190, 0x91a0,
+	0x1000, 0x2404, 0x905d, 0x0168, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x1138, 0x83ff, 0x0118, 0xb89c, 0xd0a4, 0x0110, 0x8211,
+	0x0158, 0x8108, 0x83ff, 0x0120, 0x9182, 0x0800, 0x0e28, 0x0068,
+	0x9182, 0x007e, 0x0e08, 0x0048, 0x00be, 0x007e, 0x004e, 0x003e,
+	0x001e, 0x9085, 0x0001, 0x000e, 0x0005, 0x00be, 0x007e, 0x004e,
+	0x003e, 0x001e, 0x9006, 0x000e, 0x0005, 0x0046, 0x0056, 0x0076,
+	0x00b6, 0x2100, 0x9084, 0x7fff, 0x9080, 0x1000, 0x2004, 0x905d,
+	0x0130, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0550, 0x9184,
+	0x8000, 0x0580, 0x2001, 0x1817, 0x203c, 0x9780, 0x318b, 0x203d,
+	0x97bc, 0xff00, 0x873f, 0x9006, 0x2020, 0x2400, 0x9706, 0x01a0,
+	0x94a8, 0x1000, 0x2504, 0x905d, 0x0178, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x1148, 0xb89c, 0xd0a4, 0x0130, 0xb814, 0x9206,
+	0x1118, 0xb810, 0x9306, 0x0128, 0x8420, 0x9482, 0x0800, 0x0e28,
+	0x0048, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e, 0x9085,
+	0x0001, 0x0005, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e,
+	0x9006, 0x0005, 0x2071, 0x1906, 0x7003, 0x0001, 0x7007, 0x0000,
+	0x9006, 0x7012, 0x7016, 0x701a, 0x701e, 0x700a, 0x7046, 0x2001,
+	0x1919, 0x2003, 0x0000, 0x0005, 0x0016, 0x00e6, 0x2071, 0x191a,
+	0x900e, 0x710a, 0x080c, 0x538d, 0xd0fc, 0x1140, 0x080c, 0x538d,
+	0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0400, 0x2001, 0x1873,
+	0x200c, 0x9184, 0x0007, 0x9006, 0x0002, 0x673e, 0x673e, 0x673e,
+	0x673e, 0x673e, 0x6755, 0x6763, 0x673e, 0x7003, 0x0003, 0x2009,
+	0x1874, 0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110, 0x2001,
+	0x0002, 0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e,
+	0x0005, 0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6,
+	0x2071, 0x1906, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001,
+	0x0488, 0x6844, 0x9005, 0x0158, 0x080c, 0x7429, 0x6a60, 0x9200,
+	0x7002, 0x6864, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6860,
+	0x7002, 0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e, 0x6844,
+	0x9005, 0x1110, 0x7012, 0x7016, 0x684c, 0x701a, 0x701c, 0x9085,
+	0x0040, 0x701e, 0x7037, 0x0019, 0x702b, 0x0001, 0x00e6, 0x2071,
+	0x1906, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b, 0x0000,
+	0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868, 0xd0fc, 0x11d8, 0x00e6,
+	0x0026, 0x2001, 0x191a, 0x2004, 0x9005, 0x0904, 0x699b, 0xa87c,
+	0xd0bc, 0x1904, 0x699b, 0xa978, 0xa874, 0x9105, 0x1904, 0x699b,
+	0x2001, 0x191a, 0x2004, 0x0002, 0x699b, 0x67ef, 0x682b, 0x682b,
+	0x699b, 0x682b, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026,
+	0x2009, 0x191a, 0x210c, 0x81ff, 0x0904, 0x699b, 0xa87c, 0xd0cc,
+	0x0904, 0x699b, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
+	0x699b, 0x9186, 0x0003, 0x0904, 0x682b, 0x9186, 0x0005, 0x0904,
+	0x682b, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005, 0xa84f,
+	0x8020, 0xa853, 0x0016, 0x2071, 0x1906, 0x701c, 0x9005, 0x1904,
+	0x6b3e, 0x0e04, 0x6b89, 0x2071, 0x0000, 0xa84c, 0x7082, 0xa850,
+	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2071, 0x1800,
+	0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802, 0x2900,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x002e, 0x00ee,
+	0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
+	0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6920,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x6cb0, 0x8004, 0x8004, 0x8004,
+	0x9084, 0x0003, 0x0002, 0x6849, 0x6920, 0x686e, 0x68bb, 0x080c,
+	0x0d65, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1170,
 	0x2071, 0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004,
-	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071,
-	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x804c,
-	0x00ee, 0x0804, 0x6929, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804,
-	0xa807, 0x0000, 0x904d, 0x190c, 0x0fd4, 0x009e, 0x0018, 0xa868,
-	0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079,
-	0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
-	0x6ab1, 0x782c, 0x908c, 0x0780, 0x190c, 0x6ca9, 0x8004, 0x8004,
-	0x8004, 0x9084, 0x0003, 0x0002, 0x69b3, 0x6ab1, 0x69ce, 0x6a40,
-	0x080c, 0x0d65, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
-	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
+	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
 	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70bc, 0x9200, 0x70be, 0x080c, 0x804c, 0x0c60, 0x2071, 0x1800,
-	0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6a2f, 0x7830, 0xd0dc,
-	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x0c10, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824, 0x00e6, 0x2071,
 	0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c, 0x918a,
 	0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102,
 	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70bc, 0x8000, 0x70be, 0x080c, 0x804c, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6ca9, 0xd0a4, 0x19c8, 0x0e04, 0x6a26, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x2001, 0x1917, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009, 0x1919,
-	0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1917,
-	0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
-	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x804c, 0x0804, 0x69dd,
-	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x804c, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6ca9, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
-	0x6a84, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
-	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009,
-	0x1919, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9,
-	0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x11e0,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x0c58,
-	0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
-	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1120,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70bc, 0x9200, 0x70be, 0x080c, 0x804c, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
-	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904,
-	0x6b22, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9, 0xd09c, 0x11b0,
-	0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001,
-	0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6ca9, 0xd09c, 0x0d50, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6ca9, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048,
-	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
-	0x70be, 0x080c, 0x804c, 0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9,
-	0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6b1b, 0x7838, 0x7938, 0x910e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6cb0, 0xd0a4, 0x19c8, 0x2071, 0x19d4, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
+	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
+	0x8074, 0x0804, 0x6875, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4,
+	0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c,
+	0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560, 0x2071,
+	0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908, 0x7010,
+	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
+	0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x19d4, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x8074, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6975,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c, 0x1198, 0x701c,
+	0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800,
+	0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0,
+	0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4,
+	0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x1d60, 0x00ee, 0x2071,
+	0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x00ee,
+	0x0804, 0x6930, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804, 0xa807,
+	0x0000, 0x904d, 0x190c, 0x0fd4, 0x009e, 0x0018, 0xa868, 0xd0fc,
+	0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
+	0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6ab8,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x6cb0, 0x8004, 0x8004, 0x8004,
+	0x9084, 0x0003, 0x0002, 0x69ba, 0x6ab8, 0x69d5, 0x6a47, 0x080c,
+	0x0d65, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x8074, 0x0c60, 0x2071, 0x1800, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x1904, 0x6a36, 0x7830, 0xd0dc, 0x1120,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040,
+	0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040,
+	0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee,
+	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
+	0x8000, 0x70be, 0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6cb0, 0xd0a4, 0x19c8, 0x0e04, 0x6a2d, 0x7838, 0x7938, 0x910e,
 	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
-	0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11be, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0x2001, 0x1917, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009, 0x1919, 0x200b,
+	0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1917, 0x200c,
+	0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x0804, 0x69e4, 0x0096,
+	0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900,
+	0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6a8b,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009, 0x1919,
+	0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c,
+	0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x11e0, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x0c58, 0x009e,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1120, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
 	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
-	0x9200, 0x70be, 0x080c, 0x804c, 0x00ee, 0x0804, 0x6ac1, 0x2071,
-	0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
-	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
-	0x900d, 0x1128, 0x1e04, 0x6b62, 0x002e, 0x00ee, 0x0005, 0x2071,
+	0x9200, 0x70be, 0x080c, 0x8074, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6b29,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c, 0x11b0, 0x701c,
+	0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001, 0x7012,
+	0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6cb0, 0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6cb0, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4,
+	0x1d60, 0x00ee, 0x0e04, 0x6b22, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044,
+	0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11be, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904,
+	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200,
+	0x70be, 0x080c, 0x8074, 0x00ee, 0x0804, 0x6ac8, 0x2071, 0x1906,
+	0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
+	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
+	0x1128, 0x1e04, 0x6b69, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x0e04,
+	0x6b53, 0x2071, 0x1906, 0x701c, 0x2048, 0xa84c, 0x900d, 0x0d18,
+	0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036,
+	0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11be, 0x2071, 0x1906, 0x080c, 0x6c9c, 0x002e, 0x00ee,
+	0x0005, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1118, 0x002e, 0x00ee, 0x0005, 0x2071,
 	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x804c,
-	0x0e04, 0x6b4c, 0x2071, 0x1906, 0x701c, 0x2048, 0xa84c, 0x900d,
-	0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
-	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11be, 0x2071, 0x1906, 0x080c, 0x6c95, 0x002e,
-	0x00ee, 0x0005, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010,
-	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
-	0x711e, 0x2148, 0xa804, 0x900d, 0x1118, 0x002e, 0x00ee, 0x0005,
-	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
-	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x804c, 0x002e, 0x00ee, 0x0005, 0x0006, 0xa87c, 0x0006, 0xa867,
-	0x0103, 0x20a9, 0x001c, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001d,
-	0x20a0, 0x9006, 0x4004, 0x000e, 0x9084, 0x00ff, 0xa87e, 0x000e,
-	0xa87a, 0xa982, 0x0005, 0x2071, 0x1906, 0x7004, 0x0002, 0x6bcd,
-	0x6bce, 0x6c94, 0x6bce, 0x0d65, 0x6c94, 0x0005, 0x2001, 0x191a,
-	0x2004, 0x0002, 0x6bd8, 0x6bd8, 0x6c2d, 0x6c2e, 0x6bd8, 0x6c2e,
-	0x0126, 0x2091, 0x8000, 0x1e0c, 0x6cb4, 0x701c, 0x904d, 0x01e0,
-	0xa84c, 0x9005, 0x01d8, 0x0e04, 0x6bfc, 0xa94c, 0x2071, 0x0000,
-	0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be,
-	0x2071, 0x1906, 0x080c, 0x6c95, 0x012e, 0x0470, 0x2001, 0x005b,
-	0x2004, 0x9094, 0x0780, 0x190c, 0x6ca9, 0xd09c, 0x2071, 0x1906,
-	0x1510, 0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff,
-	0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108,
-	0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071,
-	0x1906, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
-	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008,
-	0x2069, 0x19d4, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003,
-	0x0540, 0x2001, 0x1814, 0x2004, 0x2009, 0x1b1e, 0x210c, 0x9102,
-	0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838,
-	0x9106, 0x0190, 0x0e04, 0x6c60, 0x2069, 0x0000, 0x6837, 0x8040,
-	0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11be, 0x2069, 0x19d4, 0x683f, 0xffff,
-	0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6d2a, 0x701c,
-	0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9,
-	0xd09c, 0x1500, 0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184,
-	0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101,
-	0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074,
+	0x002e, 0x00ee, 0x0005, 0x0006, 0xa87c, 0x0006, 0xa867, 0x0103,
+	0x20a9, 0x001c, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0,
+	0x9006, 0x4004, 0x000e, 0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a,
+	0xa982, 0x0005, 0x2071, 0x1906, 0x7004, 0x0002, 0x6bd4, 0x6bd5,
+	0x6c9b, 0x6bd5, 0x0d65, 0x6c9b, 0x0005, 0x2001, 0x191a, 0x2004,
+	0x0002, 0x6bdf, 0x6bdf, 0x6c34, 0x6c35, 0x6bdf, 0x6c35, 0x0126,
+	0x2091, 0x8000, 0x1e0c, 0x6cbb, 0x701c, 0x904d, 0x01e0, 0xa84c,
+	0x9005, 0x01d8, 0x0e04, 0x6c03, 0xa94c, 0x2071, 0x0000, 0x7182,
+	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2071,
+	0x1906, 0x080c, 0x6c9c, 0x012e, 0x0470, 0x2001, 0x005b, 0x2004,
+	0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c, 0x2071, 0x1906, 0x1510,
+	0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff, 0x9086,
+	0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e,
+	0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071, 0x1906,
 	0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005,
-	0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
-	0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x1054, 0x0005, 0x012e,
-	0x0005, 0x2091, 0x8000, 0x0e04, 0x6cab, 0x0006, 0x0016, 0x2001,
-	0x8004, 0x0006, 0x0804, 0x0d6e, 0x0096, 0x00f6, 0x2079, 0x0050,
-	0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e,
-	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be,
-	0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x009e, 0x0005, 0x782c,
-	0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1919, 0x2104,
-	0x8000, 0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071, 0x1800,
-	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009,
-	0x182f, 0x210c, 0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0,
-	0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x804c,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6ca9, 0xd0a4, 0x19c8, 0x7838,
-	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
-	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x11be, 0x2009, 0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe,
-	0x009e, 0x0005, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8,
-	0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
-	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x00fe, 0x0005, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6ca9, 0xd0a4, 0x0db8, 0x00e6, 0x2071,
-	0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
-	0x8000, 0x70be, 0x080c, 0x804c, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6ca9, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069,
-	0x191a, 0x6808, 0x690a, 0x2069, 0x19d4, 0x9102, 0x1118, 0x683c,
-	0x9005, 0x1328, 0x2001, 0x191b, 0x200c, 0x810d, 0x693e, 0x00de,
-	0x00ee, 0x00fe, 0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0d65,
-	0x9082, 0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x286d,
-	0x002e, 0x0005, 0x6e52, 0x6ddc, 0x6df8, 0x6e20, 0x6e41, 0x6e81,
-	0x6e93, 0x6df8, 0x6e69, 0x6d97, 0x6dc5, 0x6d96, 0x0005, 0x00d6,
-	0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518,
-	0x7097, 0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x71ed,
-	0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028, 0x2069,
-	0x1960, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6,
-	0x0036, 0x0046, 0x0056, 0x2071, 0x1a3c, 0x080c, 0x195f, 0x005e,
-	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
-	0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097, 0x0028,
-	0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x728f, 0x6028, 0x9085,
-	0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
-	0x2833, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6f04, 0xd1d4,
-	0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020, 0x080c,
-	0x6f04, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005,
-	0x2001, 0x0088, 0x080c, 0x2833, 0x6124, 0xd1cc, 0x11d8, 0xd1dc,
-	0x11b0, 0xd1e4, 0x1188, 0x9184, 0x1e00, 0x11c8, 0x60e3, 0x0001,
-	0x600c, 0xc0b4, 0x600e, 0x080c, 0x70d8, 0x2001, 0x0080, 0x080c,
-	0x2833, 0x7097, 0x0028, 0x0058, 0x7097, 0x001e, 0x0040, 0x7097,
-	0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005,
-	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x70d8, 0x2001,
-	0x0080, 0x080c, 0x2833, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158,
-	0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x7097, 0x0028, 0x0040,
-	0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f,
-	0x0005, 0x2001, 0x00a0, 0x080c, 0x2833, 0x6124, 0xd1dc, 0x1138,
-	0xd1e4, 0x0138, 0x080c, 0x1989, 0x7097, 0x001e, 0x0010, 0x7097,
-	0x001d, 0x0005, 0x080c, 0x6f8d, 0x6124, 0xd1dc, 0x1188, 0x080c,
-	0x6f04, 0x0016, 0x080c, 0x1989, 0x001e, 0xd1d4, 0x1128, 0xd1e4,
-	0x0138, 0x7097, 0x001e, 0x0020, 0x7097, 0x001f, 0x080c, 0x6f04,
-	0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x2833, 0x000e, 0x6124,
-	0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140,
-	0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x0021,
-	0x0005, 0x080c, 0x6f8d, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128,
-	0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010,
-	0x7097, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2833,
-	0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128,
-	0xd1e4, 0x0158, 0x7097, 0x001e, 0x0040, 0x7097, 0x001d, 0x0028,
-	0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005, 0x0016, 0x00c6,
-	0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x2091, 0x8000, 0x080c, 0x70ac, 0x11f8, 0x2001, 0x180c,
-	0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102, 0x0026, 0x2011, 0x0200,
-	0x080c, 0x286d, 0x002e, 0x080c, 0x2819, 0x6024, 0xd0cc, 0x0148,
-	0x2001, 0x00a0, 0x080c, 0x2833, 0x080c, 0x73ac, 0x080c, 0x5cd5,
-	0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x70c6, 0x0150,
-	0x080c, 0x70bd, 0x1138, 0x2001, 0x0001, 0x080c, 0x23c9, 0x080c,
-	0x7080, 0x00a0, 0x080c, 0x6f8a, 0x0178, 0x2001, 0x0001, 0x080c,
-	0x23c9, 0x7094, 0x9086, 0x001e, 0x0120, 0x7094, 0x9086, 0x0022,
-	0x1118, 0x7097, 0x0025, 0x0010, 0x7097, 0x0021, 0x012e, 0x00ee,
-	0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x6f15, 0x080c,
-	0x8237, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x6f15,
-	0x080c, 0x822e, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016,
-	0x080c, 0x8f9c, 0x2071, 0x1800, 0x080c, 0x6eae, 0x001e, 0x00fe,
-	0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x0126, 0x080c, 0x8f9c, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x080c,
-	0x98ad, 0x2011, 0x0003, 0x080c, 0x931e, 0x2011, 0x0002, 0x080c,
-	0x9328, 0x080c, 0x91eb, 0x080c, 0x81e3, 0x0036, 0x901e, 0x080c,
-	0x926b, 0x003e, 0x080c, 0x98c9, 0x60e3, 0x0000, 0x080c, 0xd5d9,
-	0x080c, 0xd5f4, 0x2009, 0x0004, 0x080c, 0x281f, 0x080c, 0x273f,
-	0x2001, 0x1800, 0x2003, 0x0004, 0x2011, 0x0008, 0x080c, 0x286d,
-	0x2011, 0x6f15, 0x080c, 0x8237, 0x080c, 0x70c6, 0x0118, 0x9006,
-	0x080c, 0x2833, 0x080c, 0x0bab, 0x2001, 0x0001, 0x080c, 0x23c9,
-	0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x0026, 0x00e6, 0x2011, 0x6f22, 0x2071, 0x19d4, 0x701c,
-	0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085, 0x0001, 0x00ee,
-	0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe,
-	0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c, 0x2833, 0x0156,
-	0x20a9, 0x002d, 0x1d04, 0x6f9a, 0x2091, 0x6000, 0x1f04, 0x6f9a,
-	0x015e, 0x00d6, 0x2069, 0x1800, 0x6898, 0x8001, 0x0220, 0x0118,
-	0x689a, 0x00de, 0x0005, 0x689b, 0x0014, 0x68e8, 0xd0dc, 0x0dc8,
-	0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x8243, 0x0c90, 0x00c6,
-	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
-	0x080c, 0x73bb, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096,
-	0x60e2, 0x6886, 0x080c, 0x2498, 0x9006, 0x080c, 0x2833, 0x080c,
-	0x5b90, 0x0026, 0x2011, 0xffff, 0x080c, 0x286d, 0x002e, 0x602b,
-	0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
-	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001, 0x194e,
-	0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158, 0x9186,
-	0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x7070, 0x7097,
-	0x0022, 0x0040, 0x7097, 0x0021, 0x0028, 0x7097, 0x0023, 0x0010,
-	0x7097, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
-	0x080c, 0x2498, 0x080c, 0x98ad, 0x0026, 0x080c, 0x9b52, 0x002e,
-	0x080c, 0x98c9, 0x7000, 0x908e, 0x0004, 0x0118, 0x602b, 0x0028,
-	0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9,
-	0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c, 0xbf46,
-	0x0118, 0x9006, 0x080c, 0x285d, 0x0804, 0x707c, 0x6800, 0x9084,
-	0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2819, 0x6904, 0xd1d4, 0x1140,
-	0x2001, 0x0100, 0x080c, 0x2833, 0x1f04, 0x7021, 0x080c, 0x7103,
-	0x012e, 0x015e, 0x080c, 0x70bd, 0x0170, 0x6044, 0x9005, 0x0130,
-	0x080c, 0x7103, 0x9006, 0x8001, 0x1df0, 0x0028, 0x6804, 0xd0d4,
-	0x1110, 0x080c, 0x7103, 0x080c, 0xbf46, 0x0118, 0x9006, 0x080c,
-	0x285d, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004, 0x0130, 0x2009,
-	0x00c8, 0x2011, 0x6f22, 0x080c, 0x81f5, 0x002e, 0x001e, 0x080c,
-	0x8043, 0x7034, 0xc085, 0x7036, 0x2001, 0x194e, 0x2003, 0x0004,
-	0x080c, 0x6d7b, 0x080c, 0x70bd, 0x0138, 0x6804, 0xd0d4, 0x1120,
-	0xd0dc, 0x1100, 0x080c, 0x73b1, 0x00ee, 0x00de, 0x00ce, 0x0005,
+	0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008, 0x2069,
+	0x19d4, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003, 0x0540,
+	0x2001, 0x1814, 0x2004, 0x2009, 0x1b1e, 0x210c, 0x9102, 0x1500,
+	0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838, 0x9106,
+	0x0190, 0x0e04, 0x6c67, 0x2069, 0x0000, 0x6837, 0x8040, 0x6833,
+	0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11be, 0x2069, 0x19d4, 0x683f, 0xffff, 0x012e,
+	0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6d31, 0x701c, 0x904d,
+	0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9, 0xd09c,
+	0x1500, 0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff,
+	0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108,
+	0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x701c,
+	0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108,
+	0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091, 0x8000, 0x701c,
+	0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005,
+	0x1108, 0x701a, 0x012e, 0x080c, 0x1054, 0x0005, 0x012e, 0x0005,
+	0x2091, 0x8000, 0x0e04, 0x6cb2, 0x0006, 0x0016, 0x2001, 0x8004,
+	0x0006, 0x0804, 0x0d6e, 0x0096, 0x00f6, 0x2079, 0x0050, 0x7044,
+	0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009,
+	0x1919, 0x200b, 0x0000, 0x00fe, 0x009e, 0x0005, 0x782c, 0x9094,
+	0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1919, 0x2104, 0x8000,
+	0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071, 0x1800, 0x7824,
+	0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f,
+	0x210c, 0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c,
+	0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x19c8, 0x7838, 0x7938,
+	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
+	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x11be, 0x2009, 0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e,
+	0x0005, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084,
+	0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11be, 0x00fe, 0x0005, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800,
+	0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
+	0x70be, 0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0,
+	0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x191a,
+	0x6808, 0x690a, 0x2069, 0x19d4, 0x9102, 0x1118, 0x683c, 0x9005,
+	0x1328, 0x2001, 0x191b, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0d65, 0x9082,
+	0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x286d, 0x002e,
+	0x0005, 0x6e5d, 0x6de3, 0x6dff, 0x6e29, 0x6e4c, 0x6e8c, 0x6e9e,
+	0x6dff, 0x6e74, 0x6d9e, 0x6dcc, 0x6d9d, 0x0005, 0x00d6, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518, 0x7097,
+	0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x71f8, 0x6028,
+	0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028, 0x2069, 0x1960,
+	0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6, 0x0036,
+	0x0046, 0x0056, 0x2071, 0x1a3c, 0x080c, 0x195f, 0x005e, 0x004e,
+	0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804,
+	0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097, 0x0028, 0x2069,
+	0x1960, 0x2d04, 0x7002, 0x080c, 0x729a, 0x6028, 0x9085, 0x0600,
+	0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2833,
+	0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6f0f, 0xd1d4, 0x1160,
+	0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020, 0x080c, 0x6f0f,
+	0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001,
+	0x0088, 0x080c, 0x2833, 0x6124, 0xd1cc, 0x11e8, 0xd1dc, 0x11c0,
+	0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c, 0x1989, 0x60e3,
+	0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x70e3, 0x2001, 0x0080,
+	0x080c, 0x2833, 0x7097, 0x0028, 0x0058, 0x7097, 0x001e, 0x0040,
+	0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f,
+	0x0005, 0x080c, 0x1989, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e,
+	0x080c, 0x70e3, 0x2001, 0x0080, 0x080c, 0x2833, 0x6124, 0xd1d4,
+	0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158,
+	0x7097, 0x0028, 0x0040, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d,
+	0x0010, 0x7097, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c, 0x2833,
+	0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1989, 0x7097,
+	0x001e, 0x0010, 0x7097, 0x001d, 0x0005, 0x080c, 0x6f98, 0x6124,
+	0xd1dc, 0x1188, 0x080c, 0x6f0f, 0x0016, 0x080c, 0x1989, 0x001e,
+	0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x7097, 0x001e, 0x0020, 0x7097,
+	0x001f, 0x080c, 0x6f0f, 0x0005, 0x0006, 0x2001, 0x00a0, 0x080c,
+	0x2833, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc,
+	0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d,
+	0x0010, 0x7097, 0x0021, 0x0005, 0x080c, 0x6f98, 0x6124, 0xd1d4,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028,
+	0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x0006, 0x2001,
+	0x0090, 0x080c, 0x2833, 0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7097, 0x001e, 0x0040,
+	0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f,
+	0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c, 0x70b7,
+	0x11f8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102,
+	0x0026, 0x2011, 0x0200, 0x080c, 0x286d, 0x002e, 0x080c, 0x2819,
+	0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x2833, 0x080c,
+	0x73b7, 0x080c, 0x5cdc, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408,
+	0x080c, 0x70d1, 0x0150, 0x080c, 0x70c8, 0x1138, 0x2001, 0x0001,
+	0x080c, 0x23c9, 0x080c, 0x708b, 0x00a0, 0x080c, 0x6f95, 0x0178,
+	0x2001, 0x0001, 0x080c, 0x23c9, 0x7094, 0x9086, 0x001e, 0x0120,
+	0x7094, 0x9086, 0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097,
+	0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026,
+	0x2011, 0x6f20, 0x080c, 0x825f, 0x002e, 0x0016, 0x0026, 0x2009,
+	0x0064, 0x2011, 0x6f20, 0x080c, 0x8256, 0x002e, 0x001e, 0x0005,
+	0x00e6, 0x00f6, 0x0016, 0x080c, 0x8fb7, 0x2071, 0x1800, 0x080c,
+	0x6eb9, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0x8fb7, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028,
+	0xc09c, 0x602a, 0x080c, 0x98c8, 0x2011, 0x0003, 0x080c, 0x9339,
+	0x2011, 0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x080c, 0x820b,
+	0x0036, 0x901e, 0x080c, 0x9286, 0x003e, 0x080c, 0x98e4, 0x60e3,
+	0x0000, 0x080c, 0xd5fb, 0x080c, 0xd616, 0x2009, 0x0004, 0x080c,
+	0x281f, 0x080c, 0x273f, 0x2001, 0x1800, 0x2003, 0x0004, 0x2011,
+	0x0008, 0x080c, 0x286d, 0x2011, 0x6f20, 0x080c, 0x825f, 0x080c,
+	0x70d1, 0x0118, 0x9006, 0x080c, 0x2833, 0x080c, 0x0bab, 0x2001,
+	0x0001, 0x080c, 0x23c9, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x6f2d,
+	0x2071, 0x19d4, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110,
+	0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005,
+	0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0,
+	0x080c, 0x2833, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x6fa5, 0x2091,
+	0x6000, 0x1f04, 0x6fa5, 0x015e, 0x00d6, 0x2069, 0x1800, 0x6898,
+	0x8001, 0x0220, 0x0118, 0x689a, 0x00de, 0x0005, 0x689b, 0x0014,
+	0x68e8, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c,
+	0x826b, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x080c, 0x73c6, 0x2001, 0x193e, 0x2003,
+	0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x2498, 0x9006,
+	0x080c, 0x2833, 0x080c, 0x5b97, 0x0026, 0x2011, 0xffff, 0x080c,
+	0x286d, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005,
 	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x080c, 0x805a, 0x080c, 0x804c, 0x080c, 0x73bb, 0x2001,
-	0x193e, 0x2003, 0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c,
-	0x2498, 0x9006, 0x080c, 0x2833, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x0026, 0x2011, 0xffff, 0x080c, 0x286d, 0x002e, 0x602b, 0x182c,
-	0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x194d, 0x2004,
-	0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084,
-	0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a,
-	0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c,
-	0x538a, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006,
-	0x080c, 0x538a, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005,
-	0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180,
-	0x0020, 0x080c, 0x24b8, 0x900e, 0x0028, 0x080c, 0x6658, 0x1dc8,
-	0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x2fc2, 0x9006, 0x0019,
-	0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130,
-	0x080c, 0xbf3f, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef,
-	0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c,
-	0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x602f, 0x0100, 0x602f,
-	0x0000, 0x602f, 0x0040, 0x602f, 0x0000, 0x20a9, 0x0002, 0x080c,
-	0x27fa, 0x0026, 0x2011, 0x0040, 0x080c, 0x286d, 0x002e, 0x000e,
-	0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3,
-	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x2498, 0x2001,
-	0x00a0, 0x0006, 0x080c, 0xbf46, 0x000e, 0x0130, 0x080c, 0x2851,
-	0x9006, 0x080c, 0x285d, 0x0010, 0x080c, 0x2833, 0x000e, 0x6052,
-	0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c,
-	0x27aa, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0x1800, 0x080c, 0x990b, 0x0158, 0x2001, 0x0386, 0x2004,
-	0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c, 0x989e, 0x0804, 0x71df,
-	0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff,
-	0x602a, 0x2011, 0x0200, 0x080c, 0x286d, 0x2001, 0x0090, 0x080c,
-	0x2833, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1558, 0x1d04, 0x717b,
-	0x2091, 0x6000, 0x1f04, 0x717b, 0x080c, 0x98ad, 0x2011, 0x0003,
-	0x080c, 0x931e, 0x2011, 0x0002, 0x080c, 0x9328, 0x080c, 0x91eb,
-	0x901e, 0x080c, 0x926b, 0x2001, 0x0386, 0x2003, 0x7000, 0x080c,
-	0x98c9, 0x2001, 0x00a0, 0x080c, 0x2833, 0x080c, 0x73ac, 0x080c,
-	0x5cd5, 0x080c, 0xbf46, 0x0110, 0x080c, 0x0cd1, 0x9085, 0x0001,
-	0x04e0, 0x2001, 0x0386, 0x2004, 0xd0ac, 0x0110, 0x080c, 0x1989,
-	0x60e3, 0x0000, 0x2001, 0x0002, 0x080c, 0x2498, 0x60e2, 0x2001,
-	0x0080, 0x080c, 0x2833, 0x20a9, 0x0366, 0x2011, 0x1e00, 0x080c,
-	0x286d, 0x2009, 0x1e00, 0x080c, 0x2819, 0x6024, 0x910c, 0x0140,
-	0x1d04, 0x71bd, 0x2091, 0x6000, 0x1f04, 0x71bd, 0x0804, 0x7184,
-	0x2001, 0x0386, 0x2003, 0x7000, 0x6028, 0x9085, 0x1e00, 0x602a,
-	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c,
-	0xbf46, 0x0110, 0x080c, 0x0cd1, 0x9006, 0x00ee, 0x00de, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
-	0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084,
-	0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a47, 0x2d04, 0x8000,
-	0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884,
-	0x9005, 0x1904, 0x7256, 0x2001, 0x0088, 0x080c, 0x2833, 0x9006,
-	0x60e2, 0x6886, 0x080c, 0x2498, 0x2069, 0x0200, 0x6804, 0x9005,
-	0x1118, 0x6808, 0x9005, 0x01d0, 0x6028, 0x9084, 0xfbff, 0x602a,
-	0x2011, 0x0400, 0x080c, 0x286d, 0x2069, 0x1960, 0x7000, 0x206a,
-	0x7097, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x7236,
-	0x2091, 0x6000, 0x1f04, 0x7236, 0x0804, 0x7287, 0x2069, 0x0140,
-	0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c, 0x286d, 0x2009, 0x1e00,
-	0x080c, 0x2819, 0x6024, 0x910c, 0x0528, 0x9084, 0x1a00, 0x1510,
-	0x1d04, 0x7242, 0x2091, 0x6000, 0x1f04, 0x7242, 0x080c, 0x98ad,
-	0x2011, 0x0003, 0x080c, 0x931e, 0x2011, 0x0002, 0x080c, 0x9328,
-	0x080c, 0x91eb, 0x901e, 0x080c, 0x926b, 0x080c, 0x98c9, 0x2001,
-	0x00a0, 0x080c, 0x2833, 0x080c, 0x73ac, 0x080c, 0x5cd5, 0x9085,
-	0x0001, 0x00a8, 0x2001, 0x0080, 0x080c, 0x2833, 0x2069, 0x0140,
-	0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
-	0x6886, 0x2001, 0x0002, 0x080c, 0x2498, 0x60e2, 0x9006, 0x00ee,
-	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
-	0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01e8, 0x080c, 0x98ad,
-	0x2011, 0x0003, 0x080c, 0x931e, 0x2011, 0x0002, 0x080c, 0x9328,
-	0x080c, 0x91eb, 0x901e, 0x080c, 0x926b, 0x080c, 0x98c9, 0x2069,
-	0x0140, 0x2001, 0x00a0, 0x080c, 0x2833, 0x080c, 0x73ac, 0x080c,
-	0x5cd5, 0x0804, 0x7329, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160,
-	0xc1b5, 0x2102, 0x080c, 0x6f0a, 0x2069, 0x0140, 0x2001, 0x0080,
-	0x080c, 0x2833, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005,
-	0x1118, 0x6808, 0x9005, 0x0190, 0x6028, 0x9084, 0xfdff, 0x602a,
-	0x2011, 0x0200, 0x080c, 0x286d, 0x2069, 0x1960, 0x7000, 0x206a,
-	0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x7329, 0x2011, 0x1e00,
-	0x080c, 0x286d, 0x2009, 0x1e00, 0x080c, 0x2819, 0x6024, 0x910c,
-	0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x72e6, 0x0006, 0x0016,
-	0x00c6, 0x00d6, 0x00e6, 0x080c, 0x808b, 0x00ee, 0x00de, 0x00ce,
-	0x001e, 0x000e, 0x00e6, 0x2071, 0x19d4, 0x7018, 0x00ee, 0x9005,
-	0x19e8, 0x01f8, 0x0026, 0x2011, 0x6f22, 0x080c, 0x8131, 0x2011,
-	0x6f15, 0x080c, 0x8237, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000,
-	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
-	0x0002, 0x080c, 0x2498, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4,
-	0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x080c, 0xbf3f, 0x1904, 0x7396,
-	0x7130, 0xd184, 0x1170, 0x080c, 0x317f, 0x0138, 0xc18d, 0x7132,
-	0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904,
-	0x7396, 0x2011, 0x1854, 0x220c, 0x0438, 0x0016, 0x2019, 0x000e,
-	0x080c, 0xd1c9, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186,
-	0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6269, 0x1170,
-	0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xd251, 0x2009,
-	0x0001, 0x2011, 0x0100, 0x080c, 0x83c3, 0x001e, 0x8108, 0x1f04,
-	0x735f, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
-	0x0002, 0x2019, 0x0004, 0x080c, 0x2fc2, 0x001e, 0x0078, 0x0156,
-	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6269, 0x1110, 0x080c,
-	0x5cef, 0x8108, 0x1f04, 0x738c, 0x00be, 0x015e, 0x080c, 0x1989,
-	0x080c, 0x98ad, 0x080c, 0x9b52, 0x080c, 0x98c9, 0x60e3, 0x0000,
-	0x080c, 0x5cd5, 0x080c, 0x6fdd, 0x00ee, 0x00ce, 0x004e, 0x003e,
-	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x194e, 0x2003, 0x0001,
-	0x0005, 0x2001, 0x194e, 0x2003, 0x0000, 0x0005, 0x2001, 0x194d,
-	0x2003, 0xaaaa, 0x0005, 0x2001, 0x194d, 0x2003, 0x0000, 0x0005,
-	0x2071, 0x18f0, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c, 0x103b,
-	0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x103b,
-	0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000,
-	0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040,
-	0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840, 0x9005,
-	0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006,
-	0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858,
-	0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012, 0x7016,
-	0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001, 0x0019,
-	0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c, 0xfff7,
-	0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18f0, 0x6807, 0x0001,
-	0x00de, 0x080c, 0x79b8, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156,
-	0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04, 0x7422, 0x015e, 0x0005,
-	0x2079, 0x0040, 0x2071, 0x18f0, 0x7004, 0x0002, 0x7438, 0x7439,
-	0x7484, 0x74df, 0x7620, 0x7436, 0x7436, 0x764a, 0x080c, 0x0d65,
-	0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0, 0x2003, 0x0000, 0x782c,
-	0x908c, 0x0780, 0x190c, 0x7a44, 0xd0a4, 0x0570, 0x2001, 0x1dc0,
-	0x2004, 0x9082, 0x0080, 0x1640, 0x1d04, 0x7456, 0x2001, 0x19d7,
-	0x200c, 0x8109, 0x0508, 0x2091, 0x6000, 0x2102, 0x7824, 0x2048,
-	0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x0040,
-	0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003, 0x1160,
-	0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128, 0x9186,
-	0x0003, 0x1968, 0x080c, 0x74df, 0x782c, 0xd09c, 0x090c, 0x79b8,
-	0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c,
-	0x7515, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x7515, 0x7515, 0x7515,
-	0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7537, 0x7515, 0x7515,
-	0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515,
-	0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515,
-	0x7515, 0x7521, 0x7515, 0x771f, 0x7515, 0x7515, 0x7515, 0x7537,
-	0x7515, 0x7521, 0x7760, 0x77a1, 0x77e8, 0x77fc, 0x7515, 0x7515,
-	0x7537, 0x7521, 0x7515, 0x7515, 0x75f4, 0x78a7, 0x78c2, 0x7515,
-	0x7537, 0x7515, 0x7515, 0x7515, 0x7515, 0x75ea, 0x78c2, 0x7515,
-	0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515,
-	0x754b, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515,
-	0x7515, 0x7515, 0x79e8, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515,
-	0x755f, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x7515, 0x2079,
-	0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x79e1,
-	0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864,
-	0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9,
-	0x080c, 0x79b8, 0x0005, 0x7515, 0x7521, 0x770b, 0x7515, 0x7521,
-	0x7515, 0x7521, 0x7521, 0x7515, 0x7521, 0x770b, 0x7521, 0x7521,
-	0x7521, 0x7521, 0x7521, 0x7515, 0x7521, 0x770b, 0x7515, 0x7515,
-	0x7521, 0x7515, 0x7515, 0x7515, 0x7521, 0x00e6, 0x2071, 0x18f0,
-	0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000, 0x0049,
-	0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800, 0x0009,
-	0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0x0005, 0xa864,
-	0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001,
-	0x0804, 0x76c9, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
-	0x704b, 0x76c9, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968,
-	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x76e4, 0x7007, 0x0003,
-	0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x76e4, 0x0005, 0xa864,
-	0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x751d, 0x7007,
-	0x0001, 0x2009, 0x1833, 0x210c, 0x81ff, 0x1904, 0x75c1, 0xa994,
-	0x9186, 0x006f, 0x0188, 0x9186, 0x0074, 0x15b0, 0x0026, 0x2011,
-	0x0010, 0x080c, 0x6684, 0x002e, 0x0578, 0x0016, 0xa998, 0x080c,
-	0x66ce, 0x001e, 0x1548, 0x0400, 0x080c, 0x70ac, 0x0140, 0xa897,
-	0x4005, 0xa89b, 0x0016, 0x2001, 0x0030, 0x900e, 0x0438, 0x0026,
-	0x2011, 0x8008, 0x080c, 0x6684, 0x002e, 0x01b0, 0x0016, 0x0026,
-	0x0036, 0xa998, 0xaaa0, 0xab9c, 0x918d, 0x8000, 0x080c, 0x66ce,
-	0x003e, 0x002e, 0x001e, 0x1140, 0xa897, 0x4005, 0xa89b, 0x4009,
-	0x2001, 0x0030, 0x900e, 0x0050, 0xa868, 0x9084, 0x00ff, 0xa86a,
-	0xa883, 0x0000, 0x080c, 0x5f00, 0x1108, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x698f, 0x012e,
-	0x0ca0, 0xa994, 0x9186, 0x0071, 0x0904, 0x756f, 0x9186, 0x0064,
-	0x0904, 0x756f, 0x9186, 0x007c, 0x0904, 0x756f, 0x9186, 0x0028,
-	0x0904, 0x756f, 0x9186, 0x0038, 0x0904, 0x756f, 0x9186, 0x0078,
-	0x0904, 0x756f, 0x9186, 0x005f, 0x0904, 0x756f, 0x9186, 0x0056,
-	0x0904, 0x756f, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030,
-	0x900e, 0x0860, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120,
-	0x7007, 0x0001, 0x0804, 0x78d9, 0x2900, 0x7016, 0x701a, 0x20a9,
-	0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050,
-	0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003,
-	0xa888, 0x7012, 0x9082, 0x0401, 0x1a04, 0x7525, 0xaab4, 0x928a,
-	0x0002, 0x1a04, 0x7525, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105,
-	0x0118, 0x2001, 0x7687, 0x0018, 0x9280, 0x767d, 0x2005, 0x7056,
-	0x7010, 0x9015, 0x0904, 0x7668, 0x080c, 0x103b, 0x1118, 0x7007,
-	0x0004, 0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866,
-	0x7050, 0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072,
-	0xe008, 0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003,
-	0x800b, 0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e,
-	0x080c, 0x110c, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200,
-	0x0118, 0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x1054,
-	0x7014, 0x2048, 0x0804, 0x7525, 0x7020, 0x2048, 0x7018, 0xa802,
-	0xa807, 0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x7620,
-	0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8,
-	0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x001e, 0x0904, 0x78d9, 0x0804, 0x76c9, 0x767f, 0x7683, 0x0002,
-	0x001d, 0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a,
-	0x001d, 0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804,
-	0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4,
-	0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8,
-	0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c,
-	0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090,
-	0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692,
-	0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074,
-	0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e,
-	0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x1178, 0x080c, 0x5d4f,
-	0x1108, 0x0005, 0x080c, 0x6bac, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xbb2a, 0x080c, 0x698f, 0x012e, 0x0ca0, 0x080c, 0xbf3f, 0x1d70,
-	0x2001, 0x0028, 0x900e, 0x0c70, 0x2009, 0x1833, 0x210c, 0x81ff,
-	0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4,
-	0x0120, 0x080c, 0x5e62, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c,
-	0x5ddd, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
-	0x080c, 0x698f, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98,
-	0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906,
-	0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030,
-	0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6,
-	0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004,
-	0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9,
-	0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c,
-	0x6269, 0x11b8, 0x0066, 0xae80, 0x080c, 0x6379, 0x006e, 0x0088,
-	0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6,
-	0x080c, 0x6269, 0x1110, 0x080c, 0x6548, 0x8108, 0x1f04, 0x7748,
-	0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x1054, 0x00be, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0x00be, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x665c, 0x0580,
-	0x2061, 0x1a3f, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff,
-	0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003,
-	0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005,
-	0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff,
-	0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a,
-	0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x79a2,
-	0x012e, 0x0804, 0x799c, 0x012e, 0x0804, 0x7996, 0x012e, 0x0804,
-	0x7999, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x665c,
-	0x05e0, 0x2061, 0x1a3f, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308,
-	0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c,
-	0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001,
-	0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988,
-	0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318,
-	0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250,
-	0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e,
-	0x0804, 0x79a2, 0x012e, 0x0804, 0x799f, 0x012e, 0x0804, 0x799c,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a3f, 0x6300,
-	0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804,
-	0x79b0, 0x012e, 0x0804, 0x799f, 0x00b6, 0x0126, 0x00c6, 0x2091,
-	0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061,
-	0x1a3f, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888,
-	0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1833, 0x2004,
-	0x9005, 0x0118, 0x080c, 0x9c06, 0x0068, 0x6017, 0xf400, 0x6063,
-	0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x6162, 0x2009, 0x0041,
-	0x080c, 0x9c6a, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138,
-	0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x83c3, 0x002e, 0xa87c,
-	0xd0c4, 0x0148, 0x2061, 0x1a3f, 0x6000, 0xd08c, 0x1120, 0x6008,
-	0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x79a2,
-	0x00ce, 0x012e, 0x00be, 0x0804, 0x799c, 0xa984, 0x9186, 0x002e,
-	0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186,
-	0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8,
-	0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c,
-	0x6269, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065,
-	0x09b8, 0x6007, 0x0024, 0x2001, 0x1957, 0x2004, 0x601a, 0x0804,
-	0x7837, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001,
-	0x1833, 0x2004, 0x9005, 0x0150, 0x080c, 0x9c06, 0x8eff, 0x0118,
-	0x2e60, 0x080c, 0x9c06, 0x00ee, 0x0804, 0x7837, 0x6024, 0xc0dc,
-	0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130,
-	0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x84a9, 0x00ee, 0x0804, 0x7837, 0x2061,
-	0x1a3f, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x79b0, 0x0126,
-	0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804,
-	0x79b0, 0x012e, 0xa883, 0x0016, 0x0804, 0x79a9, 0xa883, 0x0007,
-	0x0804, 0x79a9, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001,
-	0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x751d, 0x0040,
-	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x78d9,
-	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061,
-	0x1800, 0x61cc, 0x81ff, 0x1904, 0x795b, 0x6130, 0xd194, 0x1904,
-	0x7985, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x0a04, 0x794f, 0x6064,
-	0x9e02, 0x1a04, 0x794f, 0x7120, 0x9186, 0x0006, 0x1904, 0x7941,
-	0x7010, 0x905d, 0x0904, 0x795b, 0xb800, 0xd0e4, 0x1904, 0x797f,
-	0x2061, 0x1a3f, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0,
-	0x7024, 0xd0dc, 0x1904, 0x7988, 0xa883, 0x0000, 0xa803, 0x0000,
-	0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904,
-	0x798b, 0x080c, 0x5386, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e,
-	0x2e60, 0x080c, 0x82b6, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048,
-	0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904,
-	0x798b, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883,
-	0x0006, 0x00be, 0x0804, 0x79a9, 0xd184, 0x0db8, 0xd1c4, 0x1190,
-	0x00a0, 0xa974, 0x080c, 0x6269, 0x15d0, 0xb800, 0xd0e4, 0x15b8,
-	0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883,
-	0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448,
-	0xa883, 0x0035, 0x0430, 0x080c, 0x538a, 0xd0fc, 0x01e8, 0xa878,
-	0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6064, 0x9e02, 0x12a8, 0x7120,
-	0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc,
-	0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x78e5,
-	0x7003, 0x0002, 0x0804, 0x78e5, 0xa883, 0x0028, 0x0010, 0xa883,
-	0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8,
-	0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014,
-	0x080c, 0xcdd9, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e,
-	0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009,
-	0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105,
-	0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0x0005,
-	0x080c, 0x1054, 0x0005, 0x00d6, 0x080c, 0x82ad, 0x00de, 0x0005,
-	0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c,
-	0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7a44, 0xd09c, 0x11a8,
-	0x2071, 0x1800, 0x70bc, 0x90ea, 0x0040, 0x0278, 0x8001, 0x70be,
-	0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071,
-	0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de,
-	0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7a44, 0x000e, 0x0005,
-	0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001,
-	0xaa74, 0x9282, 0x0004, 0x1a04, 0x7a35, 0xa97c, 0x9188, 0x1000,
-	0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084,
-	0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0x9b76,
-	0x1118, 0x080c, 0x9c3d, 0x05a8, 0x6212, 0xa874, 0x0002, 0x7a13,
-	0x7a18, 0x7a1b, 0x7a21, 0x2019, 0x0002, 0x080c, 0xd1c9, 0x0060,
-	0x080c, 0xd159, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xd178,
-	0x0018, 0xa980, 0x080c, 0xd159, 0x080c, 0x9bcc, 0xa887, 0x0000,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0x00be, 0x001e,
-	0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80,
-	0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004,
-	0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7a46,
-	0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0d6e, 0x2001,
-	0x1833, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300,
-	0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218,
-	0x210c, 0xd1ec, 0x1120, 0x080c, 0x152d, 0x00fe, 0x0005, 0x2001,
-	0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c,
-	0xd08c, 0x0904, 0x7ac7, 0x68bc, 0x90aa, 0x0005, 0x0a04, 0x8043,
-	0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d65, 0x9584, 0x00f6, 0x1508,
-	0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1258, 0x9584, 0x0700,
-	0x8007, 0x04f0, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x0db0,
-	0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086,
-	0x8100, 0x11c0, 0x080c, 0xd5b1, 0x080c, 0x7f8a, 0x7817, 0x0140,
-	0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x7fe6, 0x19c8, 0xd5a4,
-	0x0148, 0x0046, 0x0056, 0x080c, 0x7b17, 0x080c, 0x1fb7, 0x005e,
-	0x004e, 0x0020, 0x080c, 0xd5b1, 0x7817, 0x0140, 0x080c, 0x70ac,
-	0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140, 0x688f, 0x0000,
-	0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000, 0x0489, 0x0005,
-	0x0002, 0x7ad4, 0x7dac, 0x7ad1, 0x7ad1, 0x7ad1, 0x7ad1, 0x7ad1,
-	0x7ad1, 0x7817, 0x0140, 0x0005, 0x7000, 0x908c, 0xff00, 0x9194,
-	0xf000, 0x810f, 0x9484, 0x0fff, 0x688e, 0x9286, 0x2000, 0x1150,
-	0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x53e7, 0x0070, 0x080c,
-	0x7b37, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x7ce9, 0x0028,
-	0x9286, 0x8000, 0x1110, 0x080c, 0x7ec0, 0x7817, 0x0140, 0x0005,
-	0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518,
-	0x080c, 0x48d1, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056,
-	0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036,
-	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019,
-	0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c,
-	0x48d1, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6,
-	0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120,
-	0x9096, 0x0023, 0x1904, 0x7cba, 0x9186, 0x0023, 0x15c0, 0x080c,
-	0x7f55, 0x0904, 0x7cba, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186,
-	0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904,
-	0x7cba, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009,
-	0x0015, 0x080c, 0x9c6a, 0x0804, 0x7cba, 0x908e, 0x0214, 0x0118,
-	0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0x9c6a, 0x0804,
-	0x7cba, 0x908e, 0x0100, 0x1904, 0x7cba, 0x7034, 0x9005, 0x1904,
-	0x7cba, 0x2009, 0x0016, 0x080c, 0x9c6a, 0x0804, 0x7cba, 0x9186,
-	0x0022, 0x1904, 0x7cba, 0x7030, 0x908e, 0x0300, 0x1580, 0x68d8,
-	0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100, 0x918c, 0x00ff, 0x697a,
-	0x7004, 0x687e, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006,
-	0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x246d, 0x7932, 0x7936,
-	0x001e, 0x000e, 0x00fe, 0x080c, 0x2424, 0x695a, 0x703c, 0x00e6,
-	0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b2, 0x00ee, 0x7034,
-	0x9005, 0x1904, 0x7cba, 0x2009, 0x0017, 0x0804, 0x7c87, 0x908e,
-	0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x7cba, 0x080c, 0x70ac,
-	0x0120, 0x2009, 0x001d, 0x0804, 0x7c87, 0x68d8, 0xc0a5, 0x68da,
-	0x2009, 0x0030, 0x0804, 0x7c87, 0x908e, 0x0500, 0x1140, 0x7034,
-	0x9005, 0x1904, 0x7cba, 0x2009, 0x0018, 0x0804, 0x7c87, 0x908e,
-	0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7c87, 0x908e, 0x2110,
-	0x1120, 0x2009, 0x001a, 0x0804, 0x7c87, 0x908e, 0x5200, 0x1140,
-	0x7034, 0x9005, 0x1904, 0x7cba, 0x2009, 0x001b, 0x0804, 0x7c87,
-	0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x7cba, 0x2009,
-	0x001c, 0x0804, 0x7c87, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034,
-	0x0804, 0x7c87, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904,
-	0x7cba, 0x2009, 0x0024, 0x0804, 0x7c87, 0x908c, 0xff00, 0x918e,
-	0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c,
-	0x0904, 0x7c87, 0x080c, 0xc613, 0x1904, 0x7cba, 0x0804, 0x7c85,
-	0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804,
-	0x7c87, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7c87,
-	0x908e, 0x6104, 0x1528, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208,
-	0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015,
-	0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x48d1, 0x004e, 0x8108,
-	0x0f04, 0x7c53, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a,
-	0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0478,
-	0x908e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0448, 0x908e, 0x7800,
-	0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009,
-	0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8,
-	0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078,
-	0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038,
-	0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x1568,
-	0x080c, 0x6209, 0x1550, 0xbe12, 0xbd16, 0x001e, 0x0016, 0xb884,
+	0x1800, 0x2001, 0x194e, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186,
+	0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158,
+	0x0804, 0x707b, 0x7097, 0x0022, 0x0040, 0x7097, 0x0021, 0x0028,
+	0x7097, 0x0023, 0x0010, 0x7097, 0x0024, 0x60e3, 0x0000, 0x6887,
+	0x0001, 0x2001, 0x0001, 0x080c, 0x2498, 0x080c, 0x98c8, 0x0026,
+	0x080c, 0x9b6d, 0x002e, 0x080c, 0x98e4, 0x7000, 0x908e, 0x0004,
+	0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126,
+	0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e,
+	0x015e, 0x080c, 0xbf61, 0x0118, 0x9006, 0x080c, 0x285d, 0x0804,
+	0x7087, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2819,
+	0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2833, 0x1f04,
+	0x702c, 0x080c, 0x710e, 0x012e, 0x015e, 0x080c, 0x70c8, 0x0170,
+	0x6044, 0x9005, 0x0130, 0x080c, 0x710e, 0x9006, 0x8001, 0x1df0,
+	0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x710e, 0x080c, 0xbf61,
+	0x0118, 0x9006, 0x080c, 0x285d, 0x0016, 0x0026, 0x7000, 0x908e,
+	0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x6f2d, 0x080c, 0x821d,
+	0x002e, 0x001e, 0x080c, 0x806b, 0x7034, 0xc085, 0x7036, 0x2001,
+	0x194e, 0x2003, 0x0004, 0x080c, 0x6d82, 0x080c, 0x70c8, 0x0138,
+	0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x73bc, 0x00ee,
+	0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8082, 0x080c, 0x8074,
+	0x080c, 0x73c6, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096,
+	0x60e2, 0x6886, 0x080c, 0x2498, 0x9006, 0x080c, 0x2833, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x0026, 0x2011, 0xffff, 0x080c, 0x286d,
+	0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006,
+	0x2001, 0x194d, 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x5391, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x5391, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e,
+	0x0005, 0x0006, 0x080c, 0x5391, 0x9084, 0x0030, 0x9086, 0x0010,
+	0x000e, 0x0005, 0x0006, 0x080c, 0x5391, 0x9084, 0x0030, 0x9086,
+	0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004,
+	0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x24b8, 0x900e, 0x0028,
+	0x080c, 0x665f, 0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c,
+	0x2fc5, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071,
+	0x180c, 0x2e04, 0x0130, 0x080c, 0xbf5a, 0x1128, 0x9085, 0x0010,
+	0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006,
+	0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006,
+	0x602f, 0x0100, 0x602f, 0x0000, 0x602f, 0x0040, 0x602f, 0x0000,
+	0x20a9, 0x0002, 0x080c, 0x27fa, 0x0026, 0x2011, 0x0040, 0x080c,
+	0x286d, 0x002e, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e,
+	0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
+	0x080c, 0x2498, 0x2001, 0x00a0, 0x0006, 0x080c, 0xbf61, 0x000e,
+	0x0130, 0x080c, 0x2851, 0x9006, 0x080c, 0x285d, 0x0010, 0x080c,
+	0x2833, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6,
+	0x2079, 0x0100, 0x080c, 0x27aa, 0x00fe, 0x000e, 0x6052, 0x0005,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x9926, 0x0158,
+	0x2001, 0x0386, 0x2004, 0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c,
+	0x98b9, 0x0804, 0x71ea, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102,
+	0x6028, 0x9084, 0xe1ff, 0x602a, 0x2011, 0x0200, 0x080c, 0x286d,
+	0x2001, 0x0090, 0x080c, 0x2833, 0x20a9, 0x0366, 0x6024, 0xd0cc,
+	0x1558, 0x1d04, 0x7186, 0x2091, 0x6000, 0x1f04, 0x7186, 0x080c,
+	0x98c8, 0x2011, 0x0003, 0x080c, 0x9339, 0x2011, 0x0002, 0x080c,
+	0x9343, 0x080c, 0x9206, 0x901e, 0x080c, 0x9286, 0x2001, 0x0386,
+	0x2003, 0x7000, 0x080c, 0x98e4, 0x2001, 0x00a0, 0x080c, 0x2833,
+	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c, 0xbf61, 0x0110, 0x080c,
+	0x0cd1, 0x9085, 0x0001, 0x04e0, 0x2001, 0x0386, 0x2004, 0xd0ac,
+	0x0110, 0x080c, 0x1989, 0x60e3, 0x0000, 0x2001, 0x0002, 0x080c,
+	0x2498, 0x60e2, 0x2001, 0x0080, 0x080c, 0x2833, 0x20a9, 0x0366,
+	0x2011, 0x1e00, 0x080c, 0x286d, 0x2009, 0x1e00, 0x080c, 0x2819,
+	0x6024, 0x910c, 0x0140, 0x1d04, 0x71c8, 0x2091, 0x6000, 0x1f04,
+	0x71c8, 0x0804, 0x718f, 0x2001, 0x0386, 0x2003, 0x7000, 0x6028,
+	0x9085, 0x1e00, 0x602a, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001,
+	0x0008, 0x6886, 0x080c, 0xbf61, 0x0110, 0x080c, 0x0cd1, 0x9006,
+	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001,
+	0x020b, 0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069,
+	0x1a47, 0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084,
+	0x00c0, 0x0120, 0x6884, 0x9005, 0x1904, 0x7261, 0x2001, 0x0088,
+	0x080c, 0x2833, 0x9006, 0x60e2, 0x6886, 0x080c, 0x2498, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01d0, 0x6028,
+	0x9084, 0xfbff, 0x602a, 0x2011, 0x0400, 0x080c, 0x286d, 0x2069,
+	0x1960, 0x7000, 0x206a, 0x7097, 0x0026, 0x7003, 0x0001, 0x20a9,
+	0x0002, 0x1d04, 0x7241, 0x2091, 0x6000, 0x1f04, 0x7241, 0x0804,
+	0x7292, 0x2069, 0x0140, 0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c,
+	0x286d, 0x2009, 0x1e00, 0x080c, 0x2819, 0x6024, 0x910c, 0x0528,
+	0x9084, 0x1a00, 0x1510, 0x1d04, 0x724d, 0x2091, 0x6000, 0x1f04,
+	0x724d, 0x080c, 0x98c8, 0x2011, 0x0003, 0x080c, 0x9339, 0x2011,
+	0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x901e, 0x080c, 0x9286,
+	0x080c, 0x98e4, 0x2001, 0x00a0, 0x080c, 0x2833, 0x080c, 0x73b7,
+	0x080c, 0x5cdc, 0x9085, 0x0001, 0x00a8, 0x2001, 0x0080, 0x080c,
+	0x2833, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118,
+	0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x2498,
+	0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0,
+	0x01e8, 0x080c, 0x98c8, 0x2011, 0x0003, 0x080c, 0x9339, 0x2011,
+	0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x901e, 0x080c, 0x9286,
+	0x080c, 0x98e4, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2833,
+	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x0804, 0x7334, 0x2001, 0x180c,
+	0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6f15, 0x2069,
+	0x0140, 0x2001, 0x0080, 0x080c, 0x2833, 0x60e3, 0x0000, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0190, 0x6028,
+	0x9084, 0xfdff, 0x602a, 0x2011, 0x0200, 0x080c, 0x286d, 0x2069,
+	0x1960, 0x7000, 0x206a, 0x7097, 0x0027, 0x7003, 0x0001, 0x0804,
+	0x7334, 0x2011, 0x1e00, 0x080c, 0x286d, 0x2009, 0x1e00, 0x080c,
+	0x2819, 0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04,
+	0x72f1, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x80b3,
+	0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19d4,
+	0x7018, 0x00ee, 0x9005, 0x19e8, 0x01f8, 0x0026, 0x2011, 0x6f2d,
+	0x080c, 0x8159, 0x2011, 0x6f20, 0x080c, 0x825f, 0x002e, 0x2069,
+	0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001,
+	0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x2498, 0x60e2, 0x2001,
+	0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c,
+	0xbf5a, 0x1904, 0x73a1, 0x7130, 0xd184, 0x1170, 0x080c, 0x3186,
+	0x0138, 0xc18d, 0x7132, 0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120,
+	0x7030, 0xd08c, 0x0904, 0x73a1, 0x2011, 0x1854, 0x220c, 0x0438,
+	0x0016, 0x2019, 0x000e, 0x080c, 0xd1eb, 0x0156, 0x00b6, 0x20a9,
+	0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188,
+	0x080c, 0x6270, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e,
+	0x080c, 0xd273, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x83eb,
+	0x001e, 0x8108, 0x1f04, 0x736a, 0x00be, 0x015e, 0x001e, 0xd1ac,
+	0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x2fc5,
+	0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c,
+	0x6270, 0x1110, 0x080c, 0x5cf6, 0x8108, 0x1f04, 0x7397, 0x00be,
+	0x015e, 0x080c, 0x1989, 0x080c, 0x98c8, 0x080c, 0x9b6d, 0x080c,
+	0x98e4, 0x60e3, 0x0000, 0x080c, 0x5cdc, 0x080c, 0x6fe8, 0x00ee,
+	0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001,
+	0x194e, 0x2003, 0x0001, 0x0005, 0x2001, 0x194e, 0x2003, 0x0000,
+	0x0005, 0x2001, 0x194d, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x194d,
+	0x2003, 0x0000, 0x0005, 0x2071, 0x18f0, 0x7003, 0x0000, 0x7007,
+	0x0000, 0x080c, 0x103b, 0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900,
+	0x704e, 0x080c, 0x103b, 0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900,
+	0x7052, 0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005,
+	0x00e6, 0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001,
+	0x04b0, 0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002,
+	0x6854, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002,
+	0x6854, 0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005,
+	0x1110, 0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040,
+	0x701e, 0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069,
+	0x18f0, 0x6807, 0x0001, 0x00de, 0x080c, 0x79c3, 0x9006, 0x00ee,
+	0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04,
+	0x742d, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18f0, 0x7004,
+	0x0002, 0x7443, 0x7444, 0x748f, 0x74ea, 0x762b, 0x7441, 0x7441,
+	0x7655, 0x080c, 0x0d65, 0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0,
+	0x2003, 0x0000, 0x782c, 0x908c, 0x0780, 0x190c, 0x7a4f, 0xd0a4,
+	0x0570, 0x2001, 0x1dc0, 0x2004, 0x9082, 0x0080, 0x1640, 0x1d04,
+	0x7461, 0x2001, 0x19d7, 0x200c, 0x8109, 0x0508, 0x2091, 0x6000,
+	0x2102, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084,
+	0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c,
+	0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186,
+	0x0007, 0x0128, 0x9186, 0x0003, 0x1968, 0x080c, 0x74ea, 0x782c,
+	0xd09c, 0x090c, 0x79c3, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100,
+	0x003b, 0x0c18, 0x080c, 0x7520, 0x0c90, 0x00e3, 0x08f0, 0x0005,
+	0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x7542, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x7520, 0x7520, 0x7520, 0x7520, 0x752c, 0x7520, 0x772a, 0x7520,
+	0x7520, 0x7520, 0x7542, 0x7520, 0x752c, 0x776b, 0x77ac, 0x77f3,
+	0x7807, 0x7520, 0x7520, 0x7542, 0x752c, 0x7520, 0x7520, 0x75ff,
+	0x78b2, 0x78cd, 0x7520, 0x7542, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x75f5, 0x78cd, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x7520, 0x7520, 0x7520, 0x7556, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x79f3, 0x7520, 0x7520,
+	0x7520, 0x7520, 0x7520, 0x756a, 0x7520, 0x7520, 0x7520, 0x7520,
+	0x7520, 0x7520, 0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198,
+	0x782c, 0x080c, 0x79ec, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006,
+	0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210,
+	0x002b, 0x0c50, 0x00e9, 0x080c, 0x79c3, 0x0005, 0x7520, 0x752c,
+	0x7716, 0x7520, 0x752c, 0x7520, 0x752c, 0x752c, 0x7520, 0x752c,
+	0x7716, 0x752c, 0x752c, 0x752c, 0x752c, 0x752c, 0x7520, 0x752c,
+	0x7716, 0x7520, 0x7520, 0x752c, 0x7520, 0x7520, 0x7520, 0x752c,
+	0x00e6, 0x2071, 0x18f0, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005,
+	0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005,
+	0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084,
+	0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996,
+	0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001,
+	0x1120, 0x7007, 0x0001, 0x0804, 0x76d4, 0x7007, 0x0003, 0x7012,
+	0x2900, 0x7016, 0x701a, 0x704b, 0x76d4, 0x0005, 0xa864, 0x8007,
+	0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x76ef, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x76ef, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x7528, 0x7007, 0x0001, 0x2009, 0x1833, 0x210c, 0x81ff,
+	0x1904, 0x75cc, 0xa994, 0x9186, 0x006f, 0x0188, 0x9186, 0x0074,
+	0x15b0, 0x0026, 0x2011, 0x0010, 0x080c, 0x668b, 0x002e, 0x0578,
+	0x0016, 0xa998, 0x080c, 0x66d5, 0x001e, 0x1548, 0x0400, 0x080c,
+	0x70b7, 0x0140, 0xa897, 0x4005, 0xa89b, 0x0016, 0x2001, 0x0030,
+	0x900e, 0x0438, 0x0026, 0x2011, 0x8008, 0x080c, 0x668b, 0x002e,
+	0x01b0, 0x0016, 0x0026, 0x0036, 0xa998, 0xaaa0, 0xab9c, 0x918d,
+	0x8000, 0x080c, 0x66d5, 0x003e, 0x002e, 0x001e, 0x1140, 0xa897,
+	0x4005, 0xa89b, 0x4009, 0x2001, 0x0030, 0x900e, 0x0050, 0xa868,
+	0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x5f07, 0x1108,
+	0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a, 0xa982,
+	0x080c, 0x6996, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071, 0x0904,
+	0x757a, 0x9186, 0x0064, 0x0904, 0x757a, 0x9186, 0x007c, 0x0904,
+	0x757a, 0x9186, 0x0028, 0x0904, 0x757a, 0x9186, 0x0038, 0x0904,
+	0x757a, 0x9186, 0x0078, 0x0904, 0x757a, 0x9186, 0x005f, 0x0904,
+	0x757a, 0x9186, 0x0056, 0x0904, 0x757a, 0xa897, 0x4005, 0xa89b,
+	0x0001, 0x2001, 0x0030, 0x900e, 0x0860, 0xa87c, 0x9084, 0x00c0,
+	0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x78e4, 0x2900,
+	0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080,
+	0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080,
+	0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401, 0x1a04,
+	0x7530, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7530, 0x82ff, 0x1138,
+	0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7692, 0x0018, 0x9280,
+	0x7688, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7673, 0x080c,
+	0x103b, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022, 0x7054,
+	0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004, 0x9100,
+	0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e, 0x2200,
+	0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108, 0x9108,
+	0xa17a, 0x810b, 0xa17e, 0x080c, 0x110c, 0xa06c, 0x908e, 0x0100,
+	0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005, 0x7020,
+	0x2048, 0x080c, 0x1054, 0x7014, 0x2048, 0x0804, 0x7530, 0x7020,
+	0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048, 0xa906,
+	0x711a, 0x0804, 0x762b, 0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4,
+	0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x78e4, 0x0804, 0x76d4,
+	0x768a, 0x768e, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a, 0x001b,
+	0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076, 0x0066,
+	0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de,
+	0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca,
+	0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be,
+	0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e,
+	0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a,
+	0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e,
+	0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055,
+	0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1833, 0x210c, 0x81ff,
+	0x1178, 0x080c, 0x5d56, 0x1108, 0x0005, 0x080c, 0x6bb3, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xbb45, 0x080c, 0x6996, 0x012e, 0x0ca0,
+	0x080c, 0xbf5a, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70, 0x2009,
+	0x1833, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883,
+	0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5e69, 0x1138, 0x0005,
+	0x9006, 0xa87a, 0x080c, 0x5de4, 0x1108, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa87a, 0xa982, 0x080c, 0x6996, 0x012e, 0x0cb0, 0x2001,
+	0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018, 0xa802,
+	0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0118,
+	0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001, 0x7048,
+	0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878, 0x9084,
+	0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096, 0x0001,
+	0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160, 0x9005,
+	0x11d8, 0xa974, 0x080c, 0x6270, 0x11b8, 0x0066, 0xae80, 0x080c,
+	0x6380, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484,
+	0x2412, 0x004e, 0x00c6, 0x080c, 0x6270, 0x1110, 0x080c, 0x654f,
+	0x8108, 0x1f04, 0x7753, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c,
+	0x1054, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996,
+	0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x080c, 0x6663, 0x0580, 0x2061, 0x1a3f, 0x6100, 0xd184, 0x0178,
+	0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004,
+	0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011,
+	0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016,
+	0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007, 0x9084,
+	0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d, 0x6202,
+	0x012e, 0x0804, 0x79ad, 0x012e, 0x0804, 0x79a7, 0x012e, 0x0804,
+	0x79a1, 0x012e, 0x0804, 0x79a4, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x080c, 0x6663, 0x05e0, 0x2061, 0x1a3f, 0x6000, 0xd084,
+	0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484, 0x0003,
+	0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100, 0x9210,
+	0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0, 0x9484,
+	0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082, 0x0004,
+	0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004, 0x1168,
+	0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000, 0x6016,
+	0x6206, 0x630a, 0x012e, 0x0804, 0x79ad, 0x012e, 0x0804, 0x79aa,
+	0x012e, 0x0804, 0x79a7, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x2061, 0x1a3f, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220,
+	0x630a, 0x012e, 0x0804, 0x79bb, 0x012e, 0x0804, 0x79aa, 0x00b6,
+	0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac,
+	0x0148, 0x00c6, 0x2061, 0x1a3f, 0x6000, 0x9084, 0xfcff, 0x6002,
+	0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598,
+	0x2001, 0x1833, 0x2004, 0x9005, 0x0118, 0x080c, 0x9c21, 0x0068,
+	0x6017, 0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980,
+	0x6162, 0x2009, 0x0041, 0x080c, 0x9c85, 0xa988, 0x918c, 0xff00,
+	0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c,
+	0x83eb, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a3f, 0x6000,
+	0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e,
+	0x00be, 0x0804, 0x79ad, 0x00ce, 0x012e, 0x00be, 0x0804, 0x79a7,
+	0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186,
+	0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c, 0x200c,
+	0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186, 0x0029,
+	0x1d10, 0xa974, 0x080c, 0x6270, 0x1968, 0xb800, 0xc0e4, 0xb802,
+	0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1957,
+	0x2004, 0x601a, 0x0804, 0x7842, 0xa88c, 0x9065, 0x0960, 0x00e6,
+	0xa890, 0x9075, 0x2001, 0x1833, 0x2004, 0x9005, 0x0150, 0x080c,
+	0x9c21, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9c21, 0x00ee, 0x0804,
+	0x7842, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a,
+	0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8,
+	0x6016, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ee,
+	0x0804, 0x7842, 0x2061, 0x1a3f, 0x6000, 0xd084, 0x0190, 0xd08c,
+	0x1904, 0x79bb, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220,
+	0x6206, 0x012e, 0x0804, 0x79bb, 0x012e, 0xa883, 0x0016, 0x0804,
+	0x79b4, 0xa883, 0x0007, 0x0804, 0x79b4, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005,
+	0x080c, 0x7528, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x78e4, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x903e, 0x2061, 0x1800, 0x61cc, 0x81ff, 0x1904, 0x7966,
+	0x6130, 0xd194, 0x1904, 0x7990, 0xa878, 0x2070, 0x9e82, 0x1ddc,
+	0x0a04, 0x795a, 0x6064, 0x9e02, 0x1a04, 0x795a, 0x7120, 0x9186,
+	0x0006, 0x1904, 0x794c, 0x7010, 0x905d, 0x0904, 0x7966, 0xb800,
+	0xd0e4, 0x1904, 0x798a, 0x2061, 0x1a3f, 0x6100, 0x9184, 0x0301,
+	0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7993, 0xa883,
+	0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116,
+	0xa87c, 0xd0f4, 0x1904, 0x7996, 0x080c, 0x538d, 0xd09c, 0x1118,
+	0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x82de, 0x012e, 0x00ee,
+	0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148,
+	0xa87c, 0xd0f4, 0x1904, 0x7996, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x79b4, 0xd184,
+	0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6270, 0x15d0,
+	0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883,
+	0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460,
+	0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x5391,
+	0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6064,
+	0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d,
+	0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086,
+	0x0007, 0x1904, 0x78f0, 0x7003, 0x0002, 0x0804, 0x78f0, 0xa883,
+	0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420,
+	0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019,
+	0x0002, 0x601b, 0x0014, 0x080c, 0xcdf9, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009,
+	0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0xa884,
+	0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6996, 0x012e, 0x0005, 0x080c, 0x1054, 0x0005, 0x00d6, 0x080c,
+	0x82d5, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c,
+	0x7a4f, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70bc, 0x90ea, 0x0040,
+	0x0278, 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006,
+	0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28,
+	0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c,
+	0x7a4f, 0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016,
+	0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7a40,
+	0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140,
+	0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0,
+	0x2b10, 0x080c, 0x9b91, 0x1118, 0x080c, 0x9c58, 0x05a8, 0x6212,
+	0xa874, 0x0002, 0x7a1e, 0x7a23, 0x7a26, 0x7a2c, 0x2019, 0x0002,
+	0x080c, 0xd1eb, 0x0060, 0x080c, 0xd17b, 0x0048, 0x2019, 0x0002,
+	0xa980, 0x080c, 0xd19a, 0x0018, 0xa980, 0x080c, 0xd17b, 0x080c,
+	0x9be7, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996,
+	0x012e, 0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005,
+	0xa887, 0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005,
+	0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091,
+	0x8000, 0x0e04, 0x7a51, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006,
+	0x0804, 0x0d6e, 0x2001, 0x1833, 0x2004, 0x9005, 0x0005, 0x0005,
+	0x00f6, 0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc,
+	0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x152d,
+	0x00fe, 0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300,
+	0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904, 0x7ad2, 0x68bc, 0x90aa,
+	0x0005, 0x0a04, 0x806b, 0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d65,
+	0x9584, 0x00f6, 0x1508, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000,
+	0x1258, 0x9584, 0x0700, 0x8007, 0x04f0, 0x7000, 0x9084, 0xff00,
+	0x9086, 0x8100, 0x0db0, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000,
+	0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xd5d3, 0x080c,
+	0x7fb2, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c,
+	0x800e, 0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x7b22,
+	0x080c, 0x1fb7, 0x005e, 0x004e, 0x0020, 0x080c, 0xd5d3, 0x7817,
+	0x0140, 0x080c, 0x70b7, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c,
+	0x0140, 0x688f, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003,
+	0x0000, 0x0489, 0x0005, 0x0002, 0x7adf, 0x7dd4, 0x7adc, 0x7adc,
+	0x7adc, 0x7adc, 0x7adc, 0x7adc, 0x7817, 0x0140, 0x0005, 0x7000,
+	0x908c, 0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e,
+	0x9286, 0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c,
+	0x53ee, 0x0070, 0x080c, 0x7b42, 0x0058, 0x9286, 0x3000, 0x1118,
+	0x080c, 0x7d11, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7ee8,
+	0x7817, 0x0140, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036,
+	0x2011, 0x8048, 0x2518, 0x080c, 0x48d8, 0x003e, 0x002e, 0x0005,
+	0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe,
+	0x7c30, 0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200,
+	0x7d44, 0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c,
+	0x0160, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026,
+	0x2011, 0x8048, 0x080c, 0x48d8, 0x002e, 0x00fe, 0x005e, 0x004e,
+	0x003e, 0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007,
+	0x9096, 0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x7ce2, 0x9186,
+	0x0023, 0x15c0, 0x080c, 0x7f7d, 0x0904, 0x7ce2, 0x6120, 0x9186,
+	0x0001, 0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120,
+	0x9186, 0x000a, 0x1904, 0x7ce2, 0x7124, 0x610a, 0x7030, 0x908e,
+	0x0200, 0x1130, 0x2009, 0x0015, 0x080c, 0x9c85, 0x0804, 0x7ce2,
+	0x908e, 0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015,
+	0x080c, 0x9c85, 0x0804, 0x7ce2, 0x908e, 0x0100, 0x1904, 0x7ce2,
+	0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0016, 0x080c, 0x9c85,
+	0x0804, 0x7ce2, 0x9186, 0x0022, 0x1904, 0x7ce2, 0x7030, 0x908e,
+	0x0300, 0x1580, 0x68d8, 0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100,
+	0x918c, 0x00ff, 0x697a, 0x7004, 0x687e, 0x00f6, 0x2079, 0x0100,
+	0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c,
+	0x246d, 0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x2424,
+	0x695a, 0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800,
+	0x70b2, 0x00ee, 0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0017,
+	0x0804, 0x7c92, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904,
+	0x7ce2, 0x080c, 0x70b7, 0x0120, 0x2009, 0x001d, 0x0804, 0x7c92,
+	0x68d8, 0xc0a5, 0x68da, 0x2009, 0x0030, 0x0804, 0x7c92, 0x908e,
+	0x0500, 0x1140, 0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0018,
+	0x0804, 0x7c92, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804,
+	0x7c92, 0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x7c92,
+	0x908e, 0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009,
+	0x001b, 0x0804, 0x7c92, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005,
+	0x1904, 0x7ce2, 0x2009, 0x001c, 0x0804, 0x7c92, 0x908e, 0x1300,
+	0x1120, 0x2009, 0x0034, 0x0804, 0x7c92, 0x908e, 0x1200, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0024, 0x0804, 0x7c92,
+	0x908c, 0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001,
+	0x1810, 0x2004, 0xd09c, 0x0904, 0x7c92, 0x080c, 0xc62f, 0x1904,
+	0x7ce2, 0x0804, 0x7c90, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120,
+	0x2009, 0x002a, 0x0804, 0x7c92, 0x908e, 0x0f00, 0x1120, 0x2009,
+	0x0020, 0x0804, 0x7c92, 0x908e, 0x6104, 0x1528, 0x2029, 0x0205,
+	0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004,
+	0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c,
+	0x48d8, 0x004e, 0x8108, 0x0f04, 0x7c5e, 0x9186, 0x0280, 0x1d88,
+	0x2504, 0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000,
+	0x2009, 0x0023, 0x0478, 0x908e, 0x6000, 0x1118, 0x2009, 0x003f,
+	0x0448, 0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e,
+	0x1000, 0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118,
+	0x2009, 0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118,
+	0x2009, 0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118,
+	0x2009, 0x0050, 0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110,
+	0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x2424, 0x1904, 0x7ce5, 0x080c, 0x6210, 0x1904, 0x7ce5,
+	0xbe12, 0xbd16, 0x001e, 0x0016, 0x080c, 0x70b7, 0x01c0, 0x68d8,
+	0xd08c, 0x1148, 0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084,
+	0xff00, 0x1168, 0x0040, 0x6878, 0x9606, 0x1148, 0x687c, 0x9506,
+	0x9084, 0xff00, 0x1120, 0x9584, 0x00ff, 0xb886, 0x0080, 0xb884,
 	0x9005, 0x1168, 0x9186, 0x0046, 0x1150, 0x6878, 0x9606, 0x1138,
 	0x687c, 0x9506, 0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c,
-	0x9b76, 0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x9b91, 0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
 	0x001e, 0x9186, 0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e,
-	0x080c, 0x9c6a, 0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001,
-	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d1,
-	0x080c, 0x9c3d, 0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120,
+	0x080c, 0x9c85, 0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001,
+	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d8,
+	0x080c, 0x9c58, 0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120,
 	0x610a, 0x001e, 0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030,
 	0x1128, 0x6007, 0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051,
-	0x6017, 0x0000, 0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x84b0,
-	0x08a0, 0x080c, 0x3149, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007,
+	0x6017, 0x0000, 0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x84d8,
+	0x08a0, 0x080c, 0x3150, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007,
 	0x908e, 0x0008, 0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046,
 	0x7000, 0x908c, 0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c,
-	0x7f55, 0x0904, 0x7d44, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
-	0x1140, 0x7034, 0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0x9c6a,
+	0x7f7d, 0x0904, 0x7d6c, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
+	0x1140, 0x7034, 0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0x9c85,
 	0x0498, 0x908e, 0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009,
-	0x0016, 0x080c, 0x9c6a, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030,
+	0x0016, 0x080c, 0x9c85, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030,
 	0x908e, 0x1400, 0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x11a8, 0x080c, 0x6209,
-	0x1190, 0xbe12, 0xbd16, 0x080c, 0x9b76, 0x0168, 0x2b08, 0x6112,
-	0x080c, 0xbcc0, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c,
-	0x9c6a, 0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005,
+	0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x11a8, 0x080c, 0x6210,
+	0x1190, 0xbe12, 0xbd16, 0x080c, 0x9b91, 0x0168, 0x2b08, 0x6112,
+	0x080c, 0xbcdb, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c,
+	0x9c85, 0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005,
 	0x00b6, 0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff,
 	0x11b8, 0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009,
-	0x007f, 0x0804, 0x7da6, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e,
-	0x0804, 0x7da6, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0,
+	0x007f, 0x0804, 0x7dce, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e,
+	0x0804, 0x7dce, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0,
 	0x2011, 0x0000, 0x2019, 0x1836, 0x231c, 0xd3ac, 0x0130, 0x9026,
 	0x20a9, 0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9,
 	0x077f, 0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff,
 	0x11d0, 0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10,
 	0x2600, 0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0,
 	0x9745, 0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118,
-	0x94c6, 0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7d7b, 0x82ff,
+	0x94c6, 0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7da3, 0x82ff,
 	0x1118, 0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de,
 	0x00ee, 0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f,
-	0x9184, 0x000f, 0x0002, 0x7dc3, 0x7dc3, 0x7dc3, 0x7f67, 0x7dc3,
-	0x7dc6, 0x7deb, 0x7e74, 0x7dc3, 0x7dc3, 0x7dc3, 0x7dc3, 0x7dc3,
-	0x7dc3, 0x7dc3, 0x7dc3, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110,
+	0x9184, 0x000f, 0x0002, 0x7deb, 0x7deb, 0x7deb, 0x7f8f, 0x7deb,
+	0x7dee, 0x7e13, 0x7e9c, 0x7deb, 0x7deb, 0x7deb, 0x7deb, 0x7deb,
+	0x7deb, 0x7deb, 0x7deb, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110,
 	0xd1bc, 0x01e8, 0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a,
 	0x1ddc, 0x02a8, 0x6864, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff,
 	0x6110, 0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106,
-	0x1130, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0x9c6a, 0x7817,
+	0x1130, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0x9c85, 0x7817,
 	0x0140, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904,
-	0x7e50, 0x7110, 0xd1bc, 0x1904, 0x7e50, 0x7108, 0x700c, 0x2028,
+	0x7e78, 0x7110, 0xd1bc, 0x1904, 0x7e78, 0x7108, 0x700c, 0x2028,
 	0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8,
-	0x9080, 0x3184, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080,
-	0x9106, 0x0904, 0x7e50, 0x9182, 0x0801, 0x1a04, 0x7e50, 0x9190,
+	0x9080, 0x318b, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080,
+	0x9106, 0x0904, 0x7e78, 0x9182, 0x0801, 0x1a04, 0x7e78, 0x9190,
 	0x1000, 0x2204, 0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec,
 	0x15b8, 0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c,
-	0x9b76, 0x0598, 0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112,
-	0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xc873,
-	0x00f8, 0x080c, 0x6660, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c,
-	0x7d48, 0x11b0, 0x0880, 0x080c, 0x9b76, 0x2b08, 0x0188, 0x6112,
+	0x9b91, 0x0598, 0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112,
+	0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xc893,
+	0x00f8, 0x080c, 0x6667, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c,
+	0x7d70, 0x11b0, 0x0880, 0x080c, 0x9b91, 0x2b08, 0x0188, 0x6112,
 	0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007,
-	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84b0,
+	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84d8,
 	0x7817, 0x0140, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d1, 0x080c, 0x9c3d,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d8, 0x080c, 0x9c58,
 	0x0d78, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130,
 	0x615e, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x84a9, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0,
+	0xa022, 0x080c, 0x84d1, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0,
 	0x7020, 0x2060, 0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690,
 	0x6864, 0x9c02, 0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650,
 	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510,
@@ -3848,55 +3853,55 @@ unsigned short risc_code01[] = {
 	0x11c8, 0x2001, 0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff,
 	0x9082, 0x000c, 0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001,
 	0x8631, 0x1de0, 0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045,
-	0x080c, 0x9c6a, 0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186,
+	0x080c, 0x9c85, 0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186,
 	0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005,
-	0x080c, 0x3149, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086,
+	0x080c, 0x3150, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086,
 	0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b,
-	0x0005, 0x7ed7, 0x7ed8, 0x7ed7, 0x7ed7, 0x7f37, 0x7f46, 0x0005,
-	0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x7f35,
-	0x700c, 0x7108, 0x080c, 0x2424, 0x1904, 0x7f35, 0x080c, 0x6209,
-	0x1904, 0x7f35, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c,
-	0x6660, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x7f55,
-	0x00ce, 0x05d8, 0x080c, 0x9b76, 0x2b08, 0x05b8, 0x6112, 0x080c,
-	0xbcc0, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
-	0x9c6a, 0x0458, 0x080c, 0x6660, 0x0148, 0x9086, 0x0004, 0x0130,
-	0x080c, 0x6668, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0x9b76,
-	0x2b08, 0x01d8, 0x6112, 0x080c, 0xbcc0, 0x6023, 0x0005, 0x7120,
-	0x610a, 0x2009, 0x0088, 0x080c, 0x9c6a, 0x0078, 0x080c, 0x9b76,
-	0x2b08, 0x0158, 0x6112, 0x080c, 0xbcc0, 0x6023, 0x0004, 0x7120,
-	0x610a, 0x2009, 0x0001, 0x080c, 0x9c6a, 0x00be, 0x0005, 0x7110,
-	0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7eb6, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x0089, 0x080c, 0x9c6a, 0x0005, 0x7110, 0xd1bc,
-	0x0158, 0x0059, 0x0148, 0x080c, 0x7eb6, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x008a, 0x080c, 0x9c6a, 0x0005, 0x7020, 0x2060, 0x9c84,
+	0x0005, 0x7eff, 0x7f00, 0x7eff, 0x7eff, 0x7f5f, 0x7f6e, 0x0005,
+	0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x7f5d,
+	0x700c, 0x7108, 0x080c, 0x2424, 0x1904, 0x7f5d, 0x080c, 0x6210,
+	0x1904, 0x7f5d, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c,
+	0x6667, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x7f7d,
+	0x00ce, 0x05d8, 0x080c, 0x9b91, 0x2b08, 0x05b8, 0x6112, 0x080c,
+	0xbcdb, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
+	0x9c85, 0x0458, 0x080c, 0x6667, 0x0148, 0x9086, 0x0004, 0x0130,
+	0x080c, 0x666f, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0x9b91,
+	0x2b08, 0x01d8, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0005, 0x7120,
+	0x610a, 0x2009, 0x0088, 0x080c, 0x9c85, 0x0078, 0x080c, 0x9b91,
+	0x2b08, 0x0158, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0004, 0x7120,
+	0x610a, 0x2009, 0x0001, 0x080c, 0x9c85, 0x00be, 0x0005, 0x7110,
+	0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7ede, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x0089, 0x080c, 0x9c85, 0x0005, 0x7110, 0xd1bc,
+	0x0158, 0x0059, 0x0148, 0x080c, 0x7ede, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x008a, 0x080c, 0x9c85, 0x0005, 0x7020, 0x2060, 0x9c84,
 	0x0003, 0x1158, 0x9c82, 0x1ddc, 0x0240, 0x2001, 0x1819, 0x2004,
 	0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6,
 	0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0,
 	0x9c82, 0x1ddc, 0x0298, 0x6864, 0x9c02, 0x1280, 0x7008, 0x9084,
 	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914,
-	0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9c6a, 0x7817, 0x0140,
+	0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9c85, 0x7817, 0x0140,
 	0x00be, 0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206,
 	0x0049, 0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213,
 	0x0009, 0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000,
-	0x9086, 0xc000, 0x05c0, 0x080c, 0x9b76, 0x05a8, 0x0066, 0x00c6,
+	0x9086, 0xc000, 0x05c0, 0x080c, 0x9b91, 0x05a8, 0x0066, 0x00c6,
 	0x0046, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424,
-	0x1590, 0x080c, 0x6209, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e,
-	0x00ce, 0x6012, 0x080c, 0xbcc0, 0x080c, 0x1022, 0x0500, 0x2900,
+	0x1590, 0x080c, 0x6210, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e,
+	0x00ce, 0x6012, 0x080c, 0xbcdb, 0x080c, 0x1022, 0x0500, 0x2900,
 	0x6062, 0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b,
 	0x20a9, 0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98,
 	0x4003, 0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x84b0, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c,
-	0x9bcc, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000,
+	0x0001, 0x080c, 0x84d8, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c,
+	0x9be7, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000,
 	0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904,
-	0x803d, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005,
-	0x1904, 0x803f, 0x7030, 0x908e, 0x0400, 0x0904, 0x803f, 0x908e,
+	0x8065, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005,
+	0x1904, 0x8067, 0x7030, 0x908e, 0x0400, 0x0904, 0x8067, 0x908e,
 	0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8,
 	0x2009, 0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c,
-	0x661e, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff,
+	0x6625, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff,
 	0x9106, 0x1518, 0x687c, 0x69ac, 0x918c, 0xff00, 0x9105, 0x7104,
 	0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8,
 	0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000,
-	0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7f55, 0x0128,
+	0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7f7d, 0x0128,
 	0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085,
 	0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5,
 	0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834,
@@ -3904,21 +3909,21 @@ unsigned short risc_code01[] = {
 	0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036,
 	0x00ee, 0x0005, 0x2071, 0x19d4, 0x7003, 0x0003, 0x700f, 0x0361,
 	0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000,
-	0x7026, 0x702b, 0x8fbe, 0x7032, 0x7037, 0x903b, 0x703f, 0xffff,
-	0x7042, 0x7047, 0x521d, 0x704a, 0x705b, 0x81fe, 0x080c, 0x103b,
+	0x7026, 0x702b, 0x8fd9, 0x7032, 0x7037, 0x9056, 0x703f, 0xffff,
+	0x7042, 0x7047, 0x5224, 0x704a, 0x705b, 0x8226, 0x080c, 0x103b,
 	0x090c, 0x0d65, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100,
-	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19d4, 0x1d04, 0x8120, 0x2091,
+	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19d4, 0x1d04, 0x8148, 0x2091,
 	0x6000, 0x700c, 0x8001, 0x700e, 0x1560, 0x2001, 0x1875, 0x2004,
 	0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1,
 	0x0001, 0x20d1, 0x0000, 0x080c, 0x0d65, 0x700f, 0x0361, 0x7007,
 	0x0001, 0x0126, 0x2091, 0x8000, 0x2069, 0x1800, 0x69e8, 0xd1e4,
-	0x1138, 0xd1dc, 0x1118, 0x080c, 0x826c, 0x0010, 0x080c, 0x8243,
+	0x1138, 0xd1dc, 0x1118, 0x080c, 0x8294, 0x0010, 0x080c, 0x826b,
 	0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, 0x080f,
 	0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, 0x7020,
 	0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0x9186,
 	0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f,
 	0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160, 0x702f,
-	0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x90c3,
+	0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x90de,
 	0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310, 0x8001,
 	0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a, 0x1148,
 	0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, 0x7058,
@@ -3926,29 +3931,29 @@ unsigned short risc_code01[] = {
 	0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109, 0x7172,
 	0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a, 0x1138,
 	0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, 0x012e,
-	0x7004, 0x0002, 0x8148, 0x8149, 0x8173, 0x00e6, 0x2071, 0x19d4,
+	0x7004, 0x0002, 0x8170, 0x8171, 0x819b, 0x00e6, 0x2071, 0x19d4,
 	0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee,
 	0x0005, 0x00e6, 0x0006, 0x2071, 0x19d4, 0x701c, 0x9206, 0x1120,
 	0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6,
 	0x2071, 0x19d4, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005,
-	0x0005, 0x00b6, 0x2031, 0x0010, 0x7110, 0x080c, 0x6269, 0x11a8,
+	0x0005, 0x00b6, 0x2031, 0x0010, 0x7110, 0x080c, 0x6270, 0x11a8,
 	0xb888, 0x8001, 0x0290, 0xb88a, 0x1180, 0x0126, 0x2091, 0x8000,
 	0x0066, 0xb8c0, 0x9005, 0x0138, 0x0026, 0xba3c, 0x0016, 0x080c,
-	0x6394, 0x001e, 0x002e, 0x006e, 0x012e, 0x8108, 0x9182, 0x0800,
+	0x639b, 0x001e, 0x002e, 0x006e, 0x012e, 0x8108, 0x9182, 0x0800,
 	0x1220, 0x8631, 0x0128, 0x7112, 0x0c00, 0x900e, 0x7007, 0x0002,
 	0x7112, 0x00be, 0x0005, 0x2031, 0x0010, 0x7014, 0x2060, 0x0126,
 	0x2091, 0x8000, 0x6048, 0x9005, 0x0128, 0x8001, 0x604a, 0x1110,
-	0x080c, 0xbb41, 0x6018, 0x9005, 0x0904, 0x81c5, 0x00f6, 0x2079,
-	0x0300, 0x7918, 0xd1b4, 0x1904, 0x81d8, 0x781b, 0x2020, 0xa001,
-	0x7918, 0xd1b4, 0x0120, 0x781b, 0x2000, 0x0804, 0x81d8, 0x8001,
+	0x080c, 0xbb5c, 0x6018, 0x9005, 0x0904, 0x81ed, 0x00f6, 0x2079,
+	0x0300, 0x7918, 0xd1b4, 0x1904, 0x8200, 0x781b, 0x2020, 0xa001,
+	0x7918, 0xd1b4, 0x0120, 0x781b, 0x2000, 0x0804, 0x8200, 0x8001,
 	0x601a, 0x0106, 0x781b, 0x2000, 0xa001, 0x7918, 0xd1ac, 0x1dd0,
 	0x010e, 0x00fe, 0x1510, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186,
-	0x0006, 0x11c8, 0x080c, 0xb82c, 0x01b0, 0x6014, 0x2048, 0xa884,
+	0x0006, 0x11c8, 0x080c, 0xb847, 0x01b0, 0x6014, 0x2048, 0xa884,
 	0x908a, 0x199a, 0x0280, 0x9082, 0x1999, 0xa886, 0x908a, 0x199a,
 	0x0210, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a,
-	0x080c, 0xbf72, 0x0110, 0x080c, 0xb52a, 0x012e, 0x9c88, 0x001c,
+	0x080c, 0xbf8d, 0x0110, 0x080c, 0xb545, 0x012e, 0x9c88, 0x001c,
 	0x7116, 0x2001, 0x1819, 0x2004, 0x9102, 0x1228, 0x8631, 0x0138,
-	0x2160, 0x0804, 0x8177, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x0005,
+	0x2160, 0x0804, 0x819f, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x0005,
 	0x00fe, 0x0c58, 0x00e6, 0x2071, 0x19d4, 0x7027, 0x07d0, 0x7023,
 	0x0009, 0x00ee, 0x0005, 0x2001, 0x19dd, 0x2003, 0x0000, 0x0005,
 	0x00e6, 0x2071, 0x19d4, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005,
@@ -3958,7 +3963,7 @@ unsigned short risc_code01[] = {
 	0x0000, 0x0150, 0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092,
 	0x705c, 0xa08e, 0x080c, 0x110c, 0x002e, 0x008e, 0x0005, 0x0006,
 	0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x0156, 0x080c, 0x808b, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x0156, 0x080c, 0x80b3, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
 	0x00be, 0x00ae, 0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071,
 	0x19d4, 0x7172, 0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6,
 	0x0006, 0x2071, 0x19d4, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076,
@@ -3980,8 +3985,8 @@ unsigned short risc_code01[] = {
 	0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a3f, 0x6014,
 	0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff,
 	0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c,
-	0x00c0, 0x918e, 0x00c0, 0x0904, 0x836d, 0xd0b4, 0x1168, 0xd0bc,
-	0x1904, 0x8346, 0x2009, 0x0006, 0x080c, 0x839a, 0x0005, 0x900e,
+	0x00c0, 0x918e, 0x00c0, 0x0904, 0x8395, 0xd0b4, 0x1168, 0xd0bc,
+	0x1904, 0x836e, 0x2009, 0x0006, 0x080c, 0x83c2, 0x0005, 0x900e,
 	0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05c8, 0x908c, 0x2023,
 	0x1550, 0x87ff, 0x1540, 0x6124, 0x918c, 0x0500, 0x1520, 0x6100,
 	0x918e, 0x0007, 0x1500, 0x2009, 0x1875, 0x210c, 0xd184, 0x11d8,
@@ -3989,44 +3994,44 @@ unsigned short risc_code01[] = {
 	0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000, 0x00f6, 0x2079, 0x0380,
 	0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013, 0x2c00, 0x7836, 0x781b,
 	0x8080, 0x00fe, 0x0005, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003,
-	0x1904, 0x8394, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x6024,
+	0x1904, 0x83bc, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x6024,
 	0xd0d4, 0x11e8, 0x2009, 0x1875, 0x2104, 0xd084, 0x1138, 0x87ff,
-	0x1120, 0x2009, 0x0043, 0x0804, 0x9c6a, 0x0005, 0x87ff, 0x1de8,
-	0x2009, 0x0042, 0x0804, 0x9c6a, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x1120, 0x2009, 0x0043, 0x0804, 0x9c85, 0x0005, 0x87ff, 0x1de8,
+	0x2009, 0x0042, 0x0804, 0x9c85, 0x6110, 0x00b6, 0x2158, 0xb900,
 	0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026, 0x0c00, 0xc0d4,
 	0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0, 0xd0fc, 0x0160,
-	0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x8394, 0x908c,
+	0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x83bc, 0x908c,
 	0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78, 0x080c,
 	0x164f, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042, 0x080c,
-	0x9c6a, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
+	0x9c85, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
 	0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc, 0x0188, 0x908c,
 	0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003, 0x908e, 0x0002,
-	0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0x9c6a, 0x0005,
-	0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c, 0x9c6a,
+	0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0x9c85, 0x0005,
+	0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c, 0x9c85,
 	0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20,
 	0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019, 0x0005,
-	0x2009, 0x0001, 0x0096, 0x080c, 0xb82c, 0x0518, 0x6014, 0x2048,
+	0x2009, 0x0001, 0x0096, 0x080c, 0xb847, 0x0518, 0x6014, 0x2048,
 	0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c, 0x918c,
 	0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a3f, 0x6200,
 	0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c,
-	0x67c4, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c, 0x82b6,
+	0x67cb, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c, 0x82de,
 	0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a3f, 0x6000,
 	0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce, 0x015e,
 	0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120, 0x8001,
 	0x680a, 0x9085, 0x0001, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
 	0x0046, 0x20a9, 0x0010, 0x9006, 0x8004, 0x8086, 0x818e, 0x1208,
-	0x9200, 0x1f04, 0x83e5, 0x8086, 0x818e, 0x004e, 0x003e, 0x012e,
+	0x9200, 0x1f04, 0x840d, 0x8086, 0x818e, 0x004e, 0x003e, 0x012e,
 	0x0005, 0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010,
 	0x9005, 0x01c8, 0x911a, 0x12b8, 0x8213, 0x818d, 0x0228, 0x911a,
-	0x1220, 0x1f04, 0x83fc, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
-	0x83fc, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
+	0x1220, 0x1f04, 0x8424, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
+	0x8424, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
 	0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8,
 	0x0126, 0x2091, 0x2800, 0x2079, 0x19b8, 0x012e, 0x00d6, 0x2069,
 	0x19b8, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000,
-	0x2069, 0x0200, 0x080c, 0x97df, 0x04a9, 0x080c, 0x97ca, 0x0491,
-	0x080c, 0x97cd, 0x0479, 0x080c, 0x97d0, 0x0461, 0x080c, 0x97d3,
-	0x0449, 0x080c, 0x97d6, 0x0431, 0x080c, 0x97d9, 0x0419, 0x080c,
-	0x97dc, 0x0401, 0x01de, 0x014e, 0x015e, 0x6857, 0x0000, 0x00f6,
+	0x2069, 0x0200, 0x080c, 0x97fa, 0x04a9, 0x080c, 0x97e5, 0x0491,
+	0x080c, 0x97e8, 0x0479, 0x080c, 0x97eb, 0x0461, 0x080c, 0x97ee,
+	0x0449, 0x080c, 0x97f1, 0x0431, 0x080c, 0x97f4, 0x0419, 0x080c,
+	0x97f7, 0x0401, 0x01de, 0x014e, 0x015e, 0x6857, 0x0000, 0x00f6,
 	0x2079, 0x0380, 0x00f9, 0x7807, 0x0003, 0x7803, 0x0000, 0x7803,
 	0x0001, 0x2069, 0x0004, 0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000,
 	0x206a, 0x2069, 0x0100, 0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe,
@@ -4039,256 +4044,256 @@ unsigned short risc_code01[] = {
 	0x9086, 0x0001, 0x01b0, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08,
 	0x2061, 0x19b8, 0x602c, 0x8000, 0x602e, 0x601c, 0x9005, 0x0130,
 	0x9080, 0x0003, 0x2102, 0x611e, 0x00ce, 0x0005, 0x6122, 0x611e,
-	0x0cd8, 0x6146, 0x2c08, 0x2001, 0x0012, 0x080c, 0x989e, 0x0005,
+	0x0cd8, 0x6146, 0x2c08, 0x2001, 0x0012, 0x080c, 0x98b9, 0x0005,
 	0x0016, 0x2009, 0x8020, 0x6146, 0x2c08, 0x2001, 0x0382, 0x2004,
 	0x9084, 0x0007, 0x9086, 0x0001, 0x1128, 0x2001, 0x0019, 0x080c,
-	0x989e, 0x0088, 0x00c6, 0x2061, 0x19b8, 0x602c, 0x8000, 0x602e,
+	0x98b9, 0x0088, 0x00c6, 0x2061, 0x19b8, 0x602c, 0x8000, 0x602e,
 	0x600c, 0x9005, 0x0128, 0x9080, 0x0003, 0x2102, 0x610e, 0x0010,
 	0x6112, 0x610e, 0x00ce, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004,
 	0x9084, 0x0007, 0x9086, 0x0001, 0x0198, 0x00c6, 0x6146, 0x600f,
 	0x0000, 0x2c08, 0x2061, 0x19b8, 0x6044, 0x9005, 0x0130, 0x9080,
 	0x0003, 0x2102, 0x6146, 0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8,
-	0x6146, 0x600f, 0x0000, 0x2c08, 0x2001, 0x0013, 0x080c, 0x989e,
+	0x6146, 0x600f, 0x0000, 0x2c08, 0x2001, 0x0013, 0x080c, 0x98b9,
 	0x0005, 0x6044, 0xd0dc, 0x0128, 0x9006, 0x7007, 0x0000, 0x700a,
 	0x7032, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096,
 	0x0076, 0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126,
 	0x902e, 0x2071, 0x19b8, 0x7648, 0x2660, 0x2678, 0x2091, 0x8000,
-	0x8cff, 0x0904, 0x857b, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
-	0x8576, 0x87ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x8576, 0x704c,
-	0x9c06, 0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x926b, 0x703f,
+	0x8cff, 0x0904, 0x85a3, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
+	0x859e, 0x87ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x859e, 0x704c,
+	0x9c06, 0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x9286, 0x703f,
 	0x0000, 0x9006, 0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x2029,
-	0x0001, 0x080c, 0x84f9, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a,
+	0x0001, 0x080c, 0x8521, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a,
 	0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046,
 	0x0010, 0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xb82c, 0x01c8,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xb847, 0x01c8,
 	0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1560, 0xa867, 0x0103,
-	0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0xbb2a,
-	0x080c, 0xd4f8, 0x080c, 0x698f, 0x007e, 0x003e, 0x001e, 0x080c,
-	0xba1b, 0x080c, 0x9c06, 0x00ce, 0x0804, 0x8518, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0x8518, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e,
+	0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0xbb45,
+	0x080c, 0xd51a, 0x080c, 0x6996, 0x007e, 0x003e, 0x001e, 0x080c,
+	0xba36, 0x080c, 0x9c21, 0x00ce, 0x0804, 0x8540, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x8540, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e,
 	0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee,
 	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036,
-	0x0076, 0x080c, 0xd4f8, 0x080c, 0xd1fc, 0x007e, 0x003e, 0x001e,
+	0x0076, 0x080c, 0xd51a, 0x080c, 0xd21e, 0x007e, 0x003e, 0x001e,
 	0x08c0, 0x6020, 0x9086, 0x000a, 0x0918, 0x0800, 0x0006, 0x0066,
 	0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126, 0x2091, 0x8000,
-	0x2079, 0x19b8, 0x7848, 0x9065, 0x0904, 0x85fd, 0x600c, 0x0006,
+	0x2079, 0x19b8, 0x7848, 0x9065, 0x0904, 0x8625, 0x600c, 0x0006,
 	0x600f, 0x0000, 0x784c, 0x9c06, 0x11a0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0x926b, 0x783f, 0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52,
+	0x080c, 0x9286, 0x783f, 0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52,
 	0x7b6e, 0x003e, 0x000e, 0x9005, 0x1118, 0x600c, 0x600f, 0x0000,
-	0x0006, 0x00e6, 0x2f70, 0x080c, 0x84f9, 0x00ee, 0x080c, 0xb82c,
+	0x0006, 0x00e6, 0x2f70, 0x080c, 0x8521, 0x00ee, 0x080c, 0xb847,
 	0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1580, 0x3e08,
 	0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058,
 	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6048, 0x9005, 0x1198, 0x2001,
 	0x1959, 0x2004, 0x604a, 0x0070, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6983, 0x080c, 0xba1b, 0x6044, 0xc0fc, 0x6046,
-	0x080c, 0x9c06, 0x000e, 0x0804, 0x85ab, 0x7e4a, 0x7e46, 0x012e,
+	0x0000, 0x080c, 0x698a, 0x080c, 0xba36, 0x6044, 0xc0fc, 0x6046,
+	0x080c, 0x9c21, 0x000e, 0x0804, 0x85d3, 0x7e4a, 0x7e46, 0x012e,
 	0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020,
-	0x9086, 0x0006, 0x1118, 0x080c, 0xd1fc, 0x0c38, 0x6020, 0x9086,
+	0x9086, 0x0006, 0x1118, 0x080c, 0xd21e, 0x0c38, 0x6020, 0x9086,
 	0x000a, 0x09e0, 0x08c8, 0x0016, 0x0026, 0x0086, 0x9046, 0x00a9,
-	0x080c, 0x8704, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126,
-	0x2079, 0x19b8, 0x2091, 0x8000, 0x080c, 0x874d, 0x080c, 0x87e1,
-	0x080c, 0x63f6, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6,
+	0x080c, 0x872c, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126,
+	0x2079, 0x19b8, 0x2091, 0x8000, 0x080c, 0x8775, 0x080c, 0x8809,
+	0x080c, 0x63fd, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6,
 	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091,
 	0x8000, 0x2071, 0x19b8, 0x7620, 0x2660, 0x2678, 0x8cff, 0x0904,
-	0x86c9, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x86c4, 0x88ff,
-	0x0120, 0x605c, 0x9106, 0x1904, 0x86c4, 0x7030, 0x9c06, 0x1570,
-	0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x81e3, 0x080c,
-	0x8f9c, 0x68c3, 0x0000, 0x080c, 0x9487, 0x7033, 0x0000, 0x0036,
+	0x86f1, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x86ec, 0x88ff,
+	0x0120, 0x605c, 0x9106, 0x1904, 0x86ec, 0x7030, 0x9c06, 0x1570,
+	0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x820b, 0x080c,
+	0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7033, 0x0000, 0x0036,
 	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
 	0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100, 0x6824,
 	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040, 0x7008, 0xc0ad,
-	0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x86c4, 0x7020, 0x9c36,
+	0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x86ec, 0x7020, 0x9c36,
 	0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00, 0x9f36,
 	0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000, 0x660c, 0x0066,
 	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
-	0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c, 0xb82c, 0x01e8,
-	0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xba41, 0x1118, 0x080c,
-	0xa574, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
-	0x0036, 0x0086, 0x080c, 0xbb2a, 0x080c, 0xd4f8, 0x080c, 0x698f,
-	0x008e, 0x003e, 0x001e, 0x080c, 0xba1b, 0x080c, 0x9c06, 0x080c,
-	0x935d, 0x00ce, 0x0804, 0x863e, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x863e, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c, 0xb847, 0x01e8,
+	0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xba5c, 0x1118, 0x080c,
+	0xa58f, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
+	0x0036, 0x0086, 0x080c, 0xbb45, 0x080c, 0xd51a, 0x080c, 0x6996,
+	0x008e, 0x003e, 0x001e, 0x080c, 0xba36, 0x080c, 0x9c21, 0x080c,
+	0x9378, 0x00ce, 0x0804, 0x8666, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x8666, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee,
 	0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
-	0x0016, 0x0036, 0x0086, 0x080c, 0xd4f8, 0x080c, 0xd1fc, 0x008e,
-	0x003e, 0x001e, 0x08d0, 0x080c, 0xa574, 0x6020, 0x9086, 0x0002,
-	0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x86aa,
-	0x9086, 0x008b, 0x0904, 0x86aa, 0x0840, 0x6020, 0x9086, 0x0005,
+	0x0016, 0x0036, 0x0086, 0x080c, 0xd51a, 0x080c, 0xd21e, 0x008e,
+	0x003e, 0x001e, 0x08d0, 0x080c, 0xa58f, 0x6020, 0x9086, 0x0002,
+	0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x86d2,
+	0x9086, 0x008b, 0x0904, 0x86d2, 0x0840, 0x6020, 0x9086, 0x0005,
 	0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086,
-	0x008b, 0x09b0, 0x0804, 0x86bd, 0x0006, 0x00f6, 0x00e6, 0x0096,
+	0x008b, 0x09b0, 0x0804, 0x86e5, 0x0006, 0x00f6, 0x00e6, 0x0096,
 	0x00b6, 0x00c6, 0x0066, 0x0016, 0x0126, 0x2091, 0x8000, 0x9280,
 	0x1000, 0x2004, 0x905d, 0x2079, 0x19b8, 0x9036, 0x7828, 0x2060,
 	0x8cff, 0x0538, 0x6010, 0x9b06, 0x1500, 0x6043, 0xffff, 0x080c,
-	0x9a69, 0x01d8, 0x610c, 0x0016, 0x080c, 0x90f5, 0x6014, 0x2048,
+	0x9a84, 0x01d8, 0x610c, 0x0016, 0x080c, 0x9110, 0x6014, 0x2048,
 	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086,
-	0x080c, 0xbb2a, 0x080c, 0xd4f8, 0x080c, 0x698f, 0x008e, 0x003e,
-	0x001e, 0x080c, 0x9c06, 0x00ce, 0x08d8, 0x2c30, 0x600c, 0x2060,
-	0x08b8, 0x080c, 0x6413, 0x012e, 0x001e, 0x006e, 0x00ce, 0x00be,
+	0x080c, 0xbb45, 0x080c, 0xd51a, 0x080c, 0x6996, 0x008e, 0x003e,
+	0x001e, 0x080c, 0x9c21, 0x00ce, 0x08d8, 0x2c30, 0x600c, 0x2060,
+	0x08b8, 0x080c, 0x641a, 0x012e, 0x001e, 0x006e, 0x00ce, 0x00be,
 	0x009e, 0x00ee, 0x00fe, 0x000e, 0x0005, 0x0096, 0x0006, 0x0066,
-	0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904, 0x87b4, 0x600c,
+	0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904, 0x87dc, 0x600c,
 	0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000, 0x7830, 0x9c06,
-	0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x81e3,
-	0x080c, 0x8f9c, 0x68c3, 0x0000, 0x080c, 0x9487, 0x7833, 0x0000,
+	0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x820b,
+	0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7833, 0x0000,
 	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
 	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100,
 	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0058, 0x080c,
-	0x6616, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808, 0xc0ad, 0x780a,
-	0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xb82a, 0x01b0, 0x6020,
-	0x9086, 0x0003, 0x1508, 0x080c, 0xba41, 0x1118, 0x080c, 0xa574,
-	0x0060, 0x080c, 0x6616, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x698f, 0x080c, 0xba1b, 0x080c, 0x9c06, 0x080c,
-	0x935d, 0x000e, 0x0804, 0x8754, 0x7e22, 0x7e1e, 0x00de, 0x00ce,
+	0x661d, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808, 0xc0ad, 0x780a,
+	0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xb845, 0x01b0, 0x6020,
+	0x9086, 0x0003, 0x1508, 0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f,
+	0x0060, 0x080c, 0x661d, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6996, 0x080c, 0xba36, 0x080c, 0x9c21, 0x080c,
+	0x9378, 0x000e, 0x0804, 0x877c, 0x7e22, 0x7e1e, 0x00de, 0x00ce,
 	0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
-	0x080c, 0xd1fc, 0x0c50, 0x080c, 0xa574, 0x6020, 0x9086, 0x0002,
+	0x080c, 0xd21e, 0x0c50, 0x080c, 0xa58f, 0x6020, 0x9086, 0x0002,
 	0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086,
 	0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004,
 	0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00,
 	0x0860, 0x0006, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x9036, 0x7828,
 	0x9065, 0x0510, 0x6010, 0x2058, 0x600c, 0x0006, 0x3e08, 0x918e,
 	0x0002, 0x1118, 0xb800, 0xd0bc, 0x11a8, 0x6043, 0xffff, 0x080c,
-	0x9a69, 0x0180, 0x610c, 0x080c, 0x90f5, 0x6014, 0x2048, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x698f, 0x080c, 0x9c06,
+	0x9a84, 0x0180, 0x610c, 0x080c, 0x9110, 0x6014, 0x2048, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6996, 0x080c, 0x9c21,
 	0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce, 0x00be, 0x009e,
-	0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0x080c, 0x5dcf,
+	0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0x080c, 0x5dd6,
 	0x11b0, 0x2071, 0x19b8, 0x7030, 0x9080, 0x0005, 0x2004, 0x904d,
 	0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19b8, 0x7030, 0x9035,
 	0x0130, 0x9080, 0x0005, 0x2004, 0x9906, 0x1108, 0x0029, 0x006e,
 	0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6, 0x2660, 0x6043, 0xffff,
-	0x080c, 0x9a69, 0x0178, 0x080c, 0x90f5, 0x6014, 0x2048, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbb2a, 0x080c, 0x698f,
-	0x080c, 0x9c06, 0x00ce, 0x0005, 0x00b6, 0x00e6, 0x00c6, 0x080c,
-	0x990b, 0x0106, 0x190c, 0x98ad, 0x2071, 0x0101, 0x2e04, 0xc0c4,
-	0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x190c, 0x98c9, 0x00ce,
+	0x080c, 0x9a84, 0x0178, 0x080c, 0x9110, 0x6014, 0x2048, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbb45, 0x080c, 0x6996,
+	0x080c, 0x9c21, 0x00ce, 0x0005, 0x00b6, 0x00e6, 0x00c6, 0x080c,
+	0x9926, 0x0106, 0x190c, 0x98c8, 0x2071, 0x0101, 0x2e04, 0xc0c4,
+	0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x190c, 0x98e4, 0x00ce,
 	0x00ee, 0x00be, 0x0005, 0x2071, 0x19b8, 0x7030, 0x9005, 0x0da0,
-	0x9c06, 0x190c, 0x0d65, 0x7036, 0x080c, 0x81e3, 0x7004, 0x9084,
-	0x0007, 0x0002, 0x887c, 0x887e, 0x8885, 0x888f, 0x889d, 0x887c,
-	0x8885, 0x887a, 0x080c, 0x0d65, 0x0428, 0x0005, 0x080c, 0x9a54,
+	0x9c06, 0x190c, 0x0d65, 0x7036, 0x080c, 0x820b, 0x7004, 0x9084,
+	0x0007, 0x0002, 0x88a4, 0x88a6, 0x88ad, 0x88b7, 0x88c5, 0x88a4,
+	0x88ad, 0x88a2, 0x080c, 0x0d65, 0x0428, 0x0005, 0x080c, 0x9a6f,
 	0x7007, 0x0000, 0x7033, 0x0000, 0x00e8, 0x0066, 0x9036, 0x080c,
-	0x90f5, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000, 0x0098, 0x080c,
-	0x9a3f, 0x0140, 0x080c, 0x9a54, 0x0128, 0x0066, 0x9036, 0x080c,
-	0x90f5, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c, 0x9a3f, 0x080c,
-	0x9487, 0x0000, 0x010e, 0x190c, 0x98c9, 0x00ce, 0x00ee, 0x00be,
-	0x0005, 0x00d6, 0x00c6, 0x080c, 0x990b, 0x0106, 0x190c, 0x98ad,
-	0x6044, 0xd0fc, 0x1130, 0x010e, 0x190c, 0x98c9, 0x00ce, 0x00de,
+	0x9110, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000, 0x0098, 0x080c,
+	0x9a5a, 0x0140, 0x080c, 0x9a6f, 0x0128, 0x0066, 0x9036, 0x080c,
+	0x9110, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c, 0x9a5a, 0x080c,
+	0x94a2, 0x0000, 0x010e, 0x190c, 0x98e4, 0x00ce, 0x00ee, 0x00be,
+	0x0005, 0x00d6, 0x00c6, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8,
+	0x6044, 0xd0fc, 0x1130, 0x010e, 0x190c, 0x98e4, 0x00ce, 0x00de,
 	0x0005, 0x2069, 0x19b8, 0x684c, 0x9005, 0x0da8, 0x9c06, 0x190c,
-	0x0d65, 0x6852, 0x00e6, 0x2d70, 0x080c, 0x84f9, 0x00ee, 0x080c,
-	0x81f0, 0x0016, 0x2009, 0x0040, 0x080c, 0x2052, 0x001e, 0x683c,
-	0x9084, 0x0003, 0x0002, 0x88d9, 0x88da, 0x88f8, 0x88d7, 0x080c,
+	0x0d65, 0x6852, 0x00e6, 0x2d70, 0x080c, 0x8521, 0x00ee, 0x080c,
+	0x8218, 0x0016, 0x2009, 0x0040, 0x080c, 0x2052, 0x001e, 0x683c,
+	0x9084, 0x0003, 0x0002, 0x8901, 0x8902, 0x8920, 0x88ff, 0x080c,
 	0x0d65, 0x0460, 0x6868, 0x9086, 0x0001, 0x0190, 0x600c, 0x9015,
 	0x0160, 0x6a4a, 0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046, 0x9006,
 	0x7042, 0x684e, 0x683f, 0x0000, 0x00c8, 0x684a, 0x6846, 0x0ca0,
 	0x686b, 0x0000, 0x6848, 0x9065, 0x0d78, 0x6003, 0x0002, 0x0c60,
 	0x9006, 0x686a, 0x6852, 0x686e, 0x600c, 0x9015, 0x0120, 0x6a4a,
 	0x600f, 0x0000, 0x0018, 0x684e, 0x684a, 0x6846, 0x684f, 0x0000,
-	0x010e, 0x190c, 0x98c9, 0x00ce, 0x00de, 0x0005, 0x0005, 0x6020,
-	0x9084, 0x000f, 0x000b, 0x0005, 0x8924, 0x8927, 0x8d80, 0x8e0f,
-	0x8927, 0x8d80, 0x8e0f, 0x8924, 0x8927, 0x8924, 0x8924, 0x8924,
-	0x8924, 0x8924, 0x8924, 0x8924, 0x080c, 0x884c, 0x0005, 0x00b6,
+	0x010e, 0x190c, 0x98e4, 0x00ce, 0x00de, 0x0005, 0x0005, 0x6020,
+	0x9084, 0x000f, 0x000b, 0x0005, 0x894c, 0x894f, 0x8da8, 0x8e37,
+	0x894f, 0x8da8, 0x8e37, 0x894c, 0x894f, 0x894c, 0x894c, 0x894c,
+	0x894c, 0x894c, 0x894c, 0x894c, 0x080c, 0x8874, 0x0005, 0x00b6,
 	0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6,
 	0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0053,
 	0x1a0c, 0x0d65, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100,
-	0x619a, 0x908a, 0x0040, 0x1a04, 0x8993, 0x005b, 0x00fe, 0x00ee,
+	0x619a, 0x908a, 0x0040, 0x1a04, 0x89bb, 0x005b, 0x00fe, 0x00ee,
 	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be,
-	0x0005, 0x8b0a, 0x8b45, 0x8b6e, 0x8c11, 0x8c32, 0x8c38, 0x8c45,
-	0x8c4d, 0x8c59, 0x8c5f, 0x8c70, 0x8c5f, 0x8cc7, 0x8c4d, 0x8cd3,
-	0x8cd9, 0x8c59, 0x8cd9, 0x8ce5, 0x8991, 0x8991, 0x8991, 0x8991,
-	0x8991, 0x8991, 0x8991, 0x8991, 0x8991, 0x8991, 0x8991, 0x9116,
-	0x9139, 0x914a, 0x916a, 0x919c, 0x8c45, 0x8991, 0x8c45, 0x8c5f,
-	0x8991, 0x8b6e, 0x8c11, 0x8991, 0x957a, 0x8c5f, 0x8991, 0x9596,
-	0x8c5f, 0x8991, 0x8c59, 0x8b04, 0x89b4, 0x8991, 0x95b2, 0x961f,
-	0x96ff, 0x8991, 0x970c, 0x8c42, 0x9737, 0x8991, 0x91a6, 0x9743,
-	0x8991, 0x080c, 0x0d65, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de,
+	0x0005, 0x8b32, 0x8b6d, 0x8b96, 0x8c39, 0x8c5a, 0x8c60, 0x8c6d,
+	0x8c75, 0x8c81, 0x8c87, 0x8c98, 0x8c87, 0x8cef, 0x8c75, 0x8cfb,
+	0x8d01, 0x8c81, 0x8d01, 0x8d0d, 0x89b9, 0x89b9, 0x89b9, 0x89b9,
+	0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x9131,
+	0x9154, 0x9165, 0x9185, 0x91b7, 0x8c6d, 0x89b9, 0x8c6d, 0x8c87,
+	0x89b9, 0x8b96, 0x8c39, 0x89b9, 0x9595, 0x8c87, 0x89b9, 0x95b1,
+	0x8c87, 0x89b9, 0x8c81, 0x8b2c, 0x89dc, 0x89b9, 0x95cd, 0x963a,
+	0x971a, 0x89b9, 0x9727, 0x8c6a, 0x9752, 0x89b9, 0x91c1, 0x975e,
+	0x89b9, 0x080c, 0x0d65, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de,
 	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005,
-	0x89b2, 0x89b2, 0x89b2, 0x89db, 0x8a87, 0x8a92, 0x89b2, 0x89b2,
-	0x89b2, 0x8ad9, 0x8ae5, 0x89f6, 0x89b2, 0x8a11, 0x8a45, 0x9abf,
-	0x9b04, 0x8c5f, 0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c, 0x8cf8,
+	0x89da, 0x89da, 0x89da, 0x8a03, 0x8aaf, 0x8aba, 0x89da, 0x89da,
+	0x89da, 0x8b01, 0x8b0d, 0x8a1e, 0x89da, 0x8a39, 0x8a6d, 0x9ada,
+	0x9b1f, 0x8c87, 0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c, 0x8d20,
 	0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2048,
 	0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018,
-	0x080c, 0x8f6c, 0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058,
-	0xb8a0, 0x00be, 0x080c, 0x9b4b, 0x1118, 0x9084, 0xff80, 0x0110,
-	0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8cf8, 0x7003,
+	0x080c, 0x8f87, 0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x080c, 0x9b66, 0x1118, 0x9084, 0xff80, 0x0110,
+	0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8d20, 0x7003,
 	0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878, 0x700e, 0xa87c,
 	0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888, 0x701e, 0x60c3,
-	0x0010, 0x080c, 0x8f6c, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
-	0x080c, 0x8cf8, 0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a,
+	0x0010, 0x080c, 0x8f87, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
+	0x080c, 0x8d20, 0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a,
 	0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a,
-	0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x8f6c, 0x009e, 0x00de,
-	0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8cf8,
+	0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x8f87, 0x009e, 0x00de,
+	0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8d20,
 	0x20e9, 0x0000, 0x2001, 0x1974, 0x2003, 0x0000, 0x7814, 0x2048,
 	0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c,
 	0x9080, 0x001b, 0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x2001,
-	0x0001, 0x080c, 0x2037, 0x080c, 0xc575, 0x9006, 0x080c, 0x2037,
+	0x0001, 0x080c, 0x2037, 0x080c, 0xc591, 0x9006, 0x080c, 0x2037,
 	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c,
-	0x8f6c, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8d43, 0x20e9, 0x0000, 0x2001, 0x1974,
+	0x8f87, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8d6b, 0x20e9, 0x0000, 0x2001, 0x1974,
 	0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200, 0xa873, 0x0000,
 	0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c,
 	0x9080, 0x001b, 0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x080c,
-	0xc575, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051,
-	0x7814, 0x2048, 0x080c, 0x0fd4, 0x080c, 0x8f6c, 0x012e, 0x009e,
+	0xc591, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051,
+	0x7814, 0x2048, 0x080c, 0x0fd4, 0x080c, 0x8f87, 0x012e, 0x009e,
 	0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003, 0x9005, 0x0130,
 	0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c,
-	0x8cf8, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008,
-	0x0804, 0x8f6c, 0x00d6, 0x00e6, 0x080c, 0x8d43, 0x7814, 0x9084,
+	0x8d20, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008,
+	0x0804, 0x8f87, 0x00d6, 0x00e6, 0x080c, 0x8d6b, 0x7814, 0x9084,
 	0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272,
 	0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004,
-	0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8aa8, 0x2069, 0x1801, 0x20a9,
-	0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8ab1, 0x2069, 0x1984,
+	0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8ad0, 0x2069, 0x1801, 0x20a9,
+	0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8ad9, 0x2069, 0x1984,
 	0x9086, 0xdf00, 0x0110, 0x2069, 0x199e, 0x20a9, 0x001a, 0x9e86,
 	0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010, 0x8000, 0x6012,
 	0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70,
-	0x1f04, 0x8abf, 0x60c3, 0x004c, 0x080c, 0x8f6c, 0x00ee, 0x00de,
-	0x0005, 0x080c, 0x8cf8, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808,
-	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x00d6, 0x0026, 0x0016,
-	0x080c, 0x8d43, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0,
+	0x1f04, 0x8ae7, 0x60c3, 0x004c, 0x080c, 0x8f87, 0x00ee, 0x00de,
+	0x0005, 0x080c, 0x8d20, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x00d6, 0x0026, 0x0016,
+	0x080c, 0x8d6b, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0,
 	0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2073, 0x0800, 0x8e70,
-	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x8f6c,
+	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x8f87,
 	0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1817, 0x2004, 0x609a,
-	0x0804, 0x8f6c, 0x080c, 0x8cf8, 0x7003, 0x5200, 0x2069, 0x1853,
+	0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003, 0x5200, 0x2069, 0x1853,
 	0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2457, 0x710e,
 	0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
 	0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
-	0x20a1, 0x0254, 0x4003, 0x080c, 0x9b4b, 0x1120, 0xb8a0, 0x9082,
+	0x20a1, 0x0254, 0x4003, 0x080c, 0x9b66, 0x1120, 0xb8a0, 0x9082,
 	0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7032, 0x2001, 0x181f,
 	0x2004, 0x7036, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
-	0x7036, 0x60c3, 0x001c, 0x0804, 0x8f6c, 0x080c, 0x8cf8, 0x7003,
-	0x0500, 0x080c, 0x9b4b, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
+	0x7036, 0x60c3, 0x001c, 0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003,
+	0x0500, 0x080c, 0x9b66, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
 	0x2001, 0x181e, 0x2004, 0x700a, 0x2001, 0x181f, 0x2004, 0x700e,
 	0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9,
 	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
-	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x8f6c, 0x080c, 0x8cf8,
-	0x9006, 0x080c, 0x662a, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003,
+	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x8f87, 0x080c, 0x8d20,
+	0x9006, 0x080c, 0x6631, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003,
 	0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d,
 	0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300,
-	0xb8a0, 0x9086, 0x007e, 0x1904, 0x8bd9, 0x00d6, 0x2069, 0x193d,
+	0xb8a0, 0x9086, 0x007e, 0x1904, 0x8c01, 0x00d6, 0x2069, 0x193d,
 	0x2001, 0x1836, 0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808,
 	0x9084, 0x2000, 0x7012, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818,
 	0x7022, 0x681c, 0x7026, 0x0080, 0x6800, 0x700a, 0x6804, 0x700e,
-	0x6808, 0x080c, 0x70ac, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084,
+	0x6808, 0x080c, 0x70b7, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084,
 	0x3fff, 0x7012, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1,
 	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003,
 	0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6,
-	0x080c, 0x97ca, 0x2069, 0x1945, 0x2071, 0x024e, 0x6800, 0xc0dd,
-	0x7002, 0x080c, 0x538a, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de,
+	0x080c, 0x97e5, 0x2069, 0x1945, 0x2071, 0x024e, 0x6800, 0xc0dd,
+	0x7002, 0x080c, 0x5391, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de,
 	0x04a0, 0x2001, 0x1836, 0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009,
 	0x0002, 0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c,
 	0x2498, 0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099, 0x193d, 0x20e9,
 	0x0000, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004,
 	0x2099, 0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099,
-	0x1801, 0x20a1, 0x025a, 0x4003, 0x080c, 0x97ca, 0x20a1, 0x024e,
+	0x1801, 0x20a1, 0x025a, 0x4003, 0x080c, 0x97e5, 0x20a1, 0x024e,
 	0x20a9, 0x0008, 0x2099, 0x1945, 0x4003, 0x60c3, 0x0074, 0x0804,
-	0x8f6c, 0x080c, 0x8cf8, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b,
+	0x8f87, 0x080c, 0x8d20, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b,
 	0x0800, 0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1853, 0x7904,
 	0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010,
-	0x9085, 0x0002, 0x00d6, 0x0804, 0x8ca8, 0x7026, 0x60c3, 0x0014,
-	0x0804, 0x8f6c, 0x080c, 0x8cf8, 0x7003, 0x5000, 0x0804, 0x8b88,
-	0x080c, 0x8cf8, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014,
-	0x0804, 0x8f6c, 0x080c, 0x8d3a, 0x0010, 0x080c, 0x8d43, 0x7003,
-	0x0200, 0x60c3, 0x0004, 0x0804, 0x8f6c, 0x080c, 0x8d43, 0x7003,
+	0x9085, 0x0002, 0x00d6, 0x0804, 0x8cd0, 0x7026, 0x60c3, 0x0014,
+	0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003, 0x5000, 0x0804, 0x8bb0,
+	0x080c, 0x8d20, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014,
+	0x0804, 0x8f87, 0x080c, 0x8d62, 0x0010, 0x080c, 0x8d6b, 0x7003,
+	0x0200, 0x60c3, 0x0004, 0x0804, 0x8f87, 0x080c, 0x8d6b, 0x7003,
 	0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804,
-	0x8f6c, 0x080c, 0x8d43, 0x7003, 0x0200, 0x0804, 0x8b88, 0x080c,
-	0x8d43, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010,
-	0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f6c,
-	0x00d6, 0x080c, 0x8d43, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b,
+	0x8f87, 0x080c, 0x8d6b, 0x7003, 0x0200, 0x0804, 0x8bb0, 0x080c,
+	0x8d6b, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010,
+	0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87,
+	0x00d6, 0x080c, 0x8d6b, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b,
 	0x0800, 0xb894, 0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030,
 	0x0190, 0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f,
 	0x2100, 0x0058, 0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028,
@@ -4298,2359 +4303,2358 @@ unsigned short risc_code01[] = {
 	0x0026, 0x2009, 0x1873, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbac4,
 	0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140,
 	0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd,
-	0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x8f6c, 0x080c,
-	0x8d43, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3,
-	0x0014, 0x0804, 0x8f6c, 0x080c, 0x8d43, 0x7003, 0x0200, 0x0804,
-	0x8b0e, 0x080c, 0x8d43, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f,
-	0x2a00, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x080c, 0x8d43, 0x7003,
-	0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x0026,
+	0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x8f87, 0x080c,
+	0x8d6b, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3,
+	0x0014, 0x0804, 0x8f87, 0x080c, 0x8d6b, 0x7003, 0x0200, 0x0804,
+	0x8b36, 0x080c, 0x8d6b, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f,
+	0x2a00, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x080c, 0x8d6b, 0x7003,
+	0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x0026,
 	0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040,
 	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100,
-	0x080c, 0x97df, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x080c, 0x97fa, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
 	0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x9485, 0x0029, 0x7012,
-	0x004e, 0x003e, 0x00de, 0x080c, 0x8f60, 0x721a, 0x9f95, 0x0000,
+	0x004e, 0x003e, 0x00de, 0x080c, 0x8f7b, 0x721a, 0x9f95, 0x0000,
 	0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026,
-	0x080c, 0x97df, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069,
+	0x080c, 0x97fa, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069,
 	0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x00de, 0x7013, 0x2029,
 	0x0c10, 0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f,
 	0x0000, 0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300,
 	0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
-	0x2300, 0x2021, 0x0100, 0x080c, 0x97df, 0xb810, 0x9305, 0x7002,
+	0x2300, 0x2021, 0x0100, 0x080c, 0x97fa, 0xb810, 0x9305, 0x7002,
 	0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814,
 	0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878,
 	0x700a, 0x687c, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e,
-	0x003e, 0x00de, 0x080c, 0x8f60, 0x721a, 0x7a08, 0x7222, 0x2f10,
-	0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x8f60, 0x721a,
+	0x003e, 0x00de, 0x080c, 0x8f7b, 0x721a, 0x7a08, 0x7222, 0x2f10,
+	0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x8f7b, 0x721a,
 	0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005,
 	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071,
 	0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092,
 	0x1a0c, 0x0d65, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100,
 	0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x0005, 0x8db1, 0x8dc0, 0x8dcb, 0x8daf, 0x8daf, 0x8daf,
-	0x8db1, 0x8daf, 0x8daf, 0x8daf, 0x8daf, 0x8daf, 0x8daf, 0x080c,
+	0x00be, 0x0005, 0x8dd9, 0x8de8, 0x8df3, 0x8dd7, 0x8dd7, 0x8dd7,
+	0x8dd9, 0x8dd7, 0x8dd7, 0x8dd7, 0x8dd7, 0x8dd7, 0x8dd7, 0x080c,
 	0x0d65, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x27a2, 0x0228,
-	0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x8f6c,
+	0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x8f87,
 	0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3,
-	0x000c, 0x0804, 0x8f6c, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300,
-	0x60c3, 0x0004, 0x0804, 0x8f6c, 0x0026, 0x080c, 0x97df, 0xb810,
+	0x000c, 0x0804, 0x8f87, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300,
+	0x60c3, 0x0004, 0x0804, 0x8f87, 0x0026, 0x080c, 0x97fa, 0xb810,
 	0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
-	0x700a, 0x687c, 0x700e, 0x7013, 0x0009, 0x0804, 0x8d13, 0x0026,
-	0x080c, 0x97df, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006,
+	0x700a, 0x687c, 0x700e, 0x7013, 0x0009, 0x0804, 0x8d3b, 0x0026,
+	0x080c, 0x97fa, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006,
 	0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x2001, 0x0099,
-	0x7012, 0x0804, 0x8d75, 0x0026, 0x080c, 0x97df, 0xb810, 0x9085,
+	0x7012, 0x0804, 0x8d9d, 0x0026, 0x080c, 0x97fa, 0xb810, 0x9085,
 	0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
-	0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8d75, 0x00b6,
+	0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8d9d, 0x00b6,
 	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071,
 	0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0d65, 0x908a, 0x0057,
 	0x1a0c, 0x0d65, 0x7910, 0x2158, 0xb984, 0x2061, 0x0100, 0x619a,
 	0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x0005, 0x8e44, 0x8e44, 0x8e44, 0x8e68, 0x8e44, 0x8e44, 0x8e44,
-	0x8e44, 0x8e44, 0x8e44, 0x8e44, 0x933a, 0x9342, 0x934a, 0x9352,
-	0x8e44, 0x8e44, 0x8e44, 0x9332, 0x080c, 0x0d65, 0x6813, 0x0008,
+	0x0005, 0x8e6c, 0x8e6c, 0x8e6c, 0x8e92, 0x8e6c, 0x8e6c, 0x8e6c,
+	0x8e6c, 0x8e6c, 0x8e6c, 0x8e6c, 0x9355, 0x935d, 0x9365, 0x936d,
+	0x8e6c, 0x8e6c, 0x8e6c, 0x934d, 0x080c, 0x0d65, 0x6813, 0x0008,
 	0xba8c, 0x8210, 0xb8c4, 0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52,
 	0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10,
-	0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x6a78, 0x720a, 0x6a7c,
-	0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027, 0xffff, 0x0005,
-	0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e, 0x0005,
-	0x8e78, 0x8e78, 0x8e7a, 0x8e78, 0x8e78, 0x8e78, 0x8e94, 0x8e78,
-	0x080c, 0x0d65, 0x7914, 0x918c, 0x08ff, 0x918d, 0xf600, 0x7916,
-	0x2009, 0x0003, 0x00b9, 0x2069, 0x1853, 0x6804, 0xd0bc, 0x0130,
-	0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010, 0x7033, 0x3f00,
-	0x60c3, 0x0001, 0x0804, 0x8f6c, 0x2009, 0x0003, 0x0019, 0x7033,
-	0x7f00, 0x0cb0, 0x0016, 0x080c, 0x97df, 0x001e, 0xb810, 0x9085,
-	0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6a78, 0x720a,
-	0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008, 0x7116, 0x080c,
-	0x8f60, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6,
-	0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036, 0x2061,
-	0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910,
-	0xba14, 0x7378, 0x747c, 0x7820, 0x0002, 0x8edc, 0x8edc, 0x8edc,
-	0x8edc, 0x8edc, 0x8edc, 0x8edc, 0x8edc, 0x8edc, 0x8edc, 0x8ede,
-	0x8edc, 0x8edc, 0x8edc, 0x8edc, 0x080c, 0x0d65, 0x609f, 0x0000,
-	0x7814, 0x2048, 0xa87c, 0xd0fc, 0x05d0, 0xaf90, 0x9784, 0xff00,
-	0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048,
-	0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0510,
-	0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086,
-	0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000,
-	0x609f, 0x0000, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x11a8, 0xd09c,
-	0x0130, 0x7814, 0x2048, 0xa874, 0x9082, 0x0080, 0x1268, 0xb814,
-	0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0c48, 0x9185,
-	0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94,
-	0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a,
-	0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x607a, 0x607f, 0x0000, 0xa848, 0x608a, 0xa844, 0x608e,
-	0xa838, 0x60c6, 0xa834, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
-	0x60d7, 0x0000, 0x080c, 0x97bf, 0x2009, 0x07d0, 0x60c4, 0x9084,
-	0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x81e8, 0x003e,
-	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005,
-	0x7a40, 0x9294, 0x00ff, 0x8217, 0x0005, 0x00d6, 0x2069, 0x19b8,
-	0x686b, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575,
-	0x00f1, 0x080c, 0x81da, 0x0005, 0x0016, 0x2001, 0x180c, 0x200c,
-	0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089, 0x080c, 0x81da,
-	0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c, 0x2102, 0x2001, 0x19b9,
-	0x2003, 0x0000, 0x2001, 0x19c4, 0x2003, 0x0000, 0x0c88, 0x0006,
-	0x0016, 0x0026, 0x2009, 0x1804, 0x2011, 0x0009, 0x080c, 0x287c,
-	0x002e, 0x001e, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x080c,
-	0x990b, 0x0106, 0x190c, 0x98ad, 0x2061, 0x0100, 0x61a4, 0x60a7,
-	0x95f5, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011, 0x0008, 0x080c,
-	0x287c, 0x002e, 0x001e, 0x010e, 0x190c, 0x98c9, 0x000e, 0xa001,
-	0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6,
-	0x0016, 0x0026, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x70ac,
-	0x1510, 0x2001, 0x19dd, 0x2004, 0x9005, 0x1904, 0x901d, 0x080c,
-	0x714d, 0x11a8, 0x2069, 0x0380, 0x6843, 0x0101, 0x6844, 0xd084,
-	0x1de8, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084,
-	0x090c, 0x0d65, 0x6843, 0x0100, 0x080c, 0x81da, 0x04b0, 0x00c6,
-	0x2061, 0x19b8, 0x00f0, 0x6904, 0x9194, 0x4000, 0x0598, 0x080c,
-	0x8f9c, 0x080c, 0x2843, 0x00c6, 0x2061, 0x19b8, 0x6134, 0x9192,
-	0x0008, 0x1278, 0x8108, 0x6136, 0x080c, 0x98ad, 0x6130, 0x080c,
-	0x98c9, 0x00ce, 0x81ff, 0x01c8, 0x080c, 0x81da, 0x080c, 0x8f8f,
-	0x00a0, 0x080c, 0x98ad, 0x6130, 0x91e5, 0x0000, 0x0150, 0x080c,
-	0xd5ee, 0x080c, 0x81e3, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c,
-	0x9c6a, 0x080c, 0x98c9, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de,
-	0x00ce, 0x0005, 0x2001, 0x19dd, 0x2004, 0x9005, 0x1db0, 0x00c6,
-	0x2061, 0x19b8, 0x6134, 0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136,
-	0x00ce, 0x080c, 0x81da, 0x080c, 0x5b90, 0x2009, 0x1852, 0x2114,
-	0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016,
-	0x0026, 0x080c, 0x81f0, 0x080c, 0x98ad, 0x2001, 0x0387, 0x2003,
-	0x0202, 0x2071, 0x19b8, 0x714c, 0x81ff, 0x0904, 0x90b1, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x080c, 0x70ac, 0x11c0, 0x0036, 0x2019,
-	0x0002, 0x080c, 0x926b, 0x003e, 0x714c, 0x2160, 0x080c, 0xd5ee,
-	0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0x9c6a, 0x2001, 0x0386,
-	0x2003, 0x5040, 0x080c, 0x714d, 0x0804, 0x90b1, 0x6904, 0xd1f4,
-	0x0904, 0x90be, 0x080c, 0x2843, 0x00c6, 0x704c, 0x9065, 0x090c,
-	0x0d65, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1518, 0x61c8, 0x60c4,
-	0x9105, 0x11f8, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01d0, 0x6214,
-	0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1510, 0x0010,
-	0xc0d4, 0x200a, 0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016,
-	0x704c, 0x2060, 0x080c, 0x88a9, 0x2009, 0x0049, 0x080c, 0x9c6a,
-	0x0080, 0x0036, 0x2019, 0x0001, 0x080c, 0x926b, 0x003e, 0x714c,
-	0x2160, 0x080c, 0xd5ee, 0x2009, 0x004a, 0x6003, 0x0003, 0x080c,
-	0x9c6a, 0x2001, 0x0387, 0x2003, 0x0200, 0x080c, 0x98c9, 0x002e,
-	0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904,
-	0x9072, 0x0804, 0x9074, 0x0026, 0x00e6, 0x2071, 0x19b8, 0x706c,
-	0xd084, 0x01d0, 0xc084, 0x706e, 0x714c, 0x81ff, 0x01a8, 0x2071,
-	0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138, 0x2009,
-	0x1984, 0x2011, 0x0012, 0x080c, 0x287c, 0x0030, 0x2009, 0x1984,
-	0x2011, 0x0016, 0x080c, 0x287c, 0x00ee, 0x002e, 0x0005, 0x9036,
-	0x2001, 0x19c2, 0x2004, 0x9005, 0x0128, 0x9c06, 0x0128, 0x2c30,
-	0x600c, 0x0cc8, 0x9085, 0x0001, 0x0005, 0x00f6, 0x2079, 0x19b8,
-	0x610c, 0x9006, 0x600e, 0x6044, 0xc0fc, 0x6046, 0x86ff, 0x1140,
-	0x7824, 0x9c06, 0x1118, 0x7826, 0x782a, 0x0050, 0x792a, 0x0040,
-	0x00c6, 0x2660, 0x610e, 0x00ce, 0x7824, 0x9c06, 0x1108, 0x7e26,
-	0x080c, 0x935d, 0x080c, 0xba1b, 0x00fe, 0x0005, 0x080c, 0x8cf8,
-	0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820,
-	0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058,
-	0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x6078, 0x617c,
-	0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804,
-	0x8f6c, 0x080c, 0x8cf8, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128,
-	0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008,
-	0x0804, 0x8f6c, 0x0156, 0x080c, 0x8d43, 0x7003, 0x0200, 0x2011,
-	0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019,
-	0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398,
-	0x0002, 0x9290, 0x0002, 0x1f04, 0x915b, 0x60c3, 0x001c, 0x015e,
-	0x0804, 0x8f6c, 0x0016, 0x0026, 0x080c, 0x8d1f, 0x080c, 0x8d31,
-	0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048,
-	0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
-	0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250,
-	0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x8f6c, 0x002e,
-	0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0x97ca, 0x20a1,
-	0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x8cf8, 0x7003, 0x6200,
-	0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x0016, 0x0026,
-	0x080c, 0x8cf8, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096,
-	0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023,
-	0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003,
-	0x60c2, 0x080c, 0x8f6c, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7010, 0x2060,
-	0x8cff, 0x0188, 0x080c, 0xba41, 0x1110, 0x080c, 0xa574, 0x600c,
-	0x0006, 0x080c, 0xbcb8, 0x600f, 0x0000, 0x080c, 0x9bcc, 0x080c,
-	0x935d, 0x00ce, 0x0c68, 0x2c00, 0x7012, 0x700e, 0x012e, 0x000e,
-	0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001,
-	0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079,
-	0x0140, 0x2071, 0x19b8, 0x7030, 0x2060, 0x8cff, 0x0548, 0x080c,
-	0x8f9c, 0x6ac0, 0x68c3, 0x0000, 0x080c, 0x81e3, 0x00c6, 0x2061,
-	0x0100, 0x080c, 0x97e3, 0x00ce, 0x20a9, 0x01f4, 0x04b1, 0x080c,
-	0x884c, 0x6044, 0xd0ac, 0x1128, 0x2001, 0x1959, 0x2004, 0x604a,
-	0x0020, 0x2009, 0x0013, 0x080c, 0x9c6a, 0x000e, 0x001e, 0x002e,
-	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005,
-	0x2001, 0x1800, 0x2004, 0x9096, 0x0001, 0x0d78, 0x9096, 0x0004,
-	0x0d60, 0x080c, 0x81e3, 0x6814, 0x9084, 0x0001, 0x0110, 0x68a7,
-	0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x5b3a, 0x080c,
-	0x8131, 0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094, 0x0140,
-	0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2843, 0x0090,
-	0xd084, 0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0x924d, 0x7804,
-	0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2833, 0x9006,
-	0x080c, 0x2833, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001,
-	0x180c, 0x200c, 0x918c, 0xdbff, 0x2102, 0x2069, 0x0100, 0x2079,
-	0x0140, 0x2071, 0x0380, 0x701c, 0x0006, 0x701f, 0x0202, 0x2071,
-	0x19b8, 0x704c, 0x2060, 0x8cff, 0x0904, 0x930c, 0x9386, 0x0002,
-	0x1128, 0x6814, 0x9084, 0x0002, 0x0904, 0x930c, 0x68af, 0x95f5,
-	0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb,
-	0x0008, 0x080c, 0x81f0, 0x080c, 0x1c7a, 0x0046, 0x2009, 0x00a5,
-	0x080c, 0x0e3d, 0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086,
-	0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6,
-	0x00f6, 0x2079, 0x0090, 0x2071, 0x19b8, 0x6814, 0x9084, 0x1984,
-	0x9085, 0x0012, 0x6816, 0x782b, 0x0008, 0x7057, 0x0000, 0x00fe,
-	0x00ee, 0x9386, 0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887,
-	0x0001, 0x0016, 0x2009, 0x0040, 0x080c, 0x2052, 0x001e, 0x2009,
-	0x0000, 0x080c, 0x0e3d, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094,
-	0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2843,
-	0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0x92de,
-	0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2833,
-	0x9006, 0x080c, 0x2833, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1160,
-	0x2009, 0x0049, 0x080c, 0x88a9, 0x6044, 0xd0ac, 0x1118, 0x6003,
-	0x0002, 0x0010, 0x080c, 0x9c6a, 0x000e, 0x2071, 0x0380, 0xd08c,
-	0x1110, 0x701f, 0x0200, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce,
-	0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6, 0x0126,
-	0x2091, 0x8000, 0x2069, 0x19b8, 0x6a06, 0x012e, 0x00de, 0x0005,
-	0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8, 0x6a3e, 0x012e,
-	0x00de, 0x0005, 0x080c, 0x8e46, 0x785c, 0x7032, 0x7042, 0x7047,
-	0x1000, 0x00f8, 0x080c, 0x8e46, 0x785c, 0x7032, 0x7042, 0x7047,
-	0x4000, 0x00b8, 0x080c, 0x8e46, 0x785c, 0x7032, 0x7042, 0x7047,
-	0x2000, 0x0078, 0x080c, 0x8e46, 0x785c, 0x7032, 0x7042, 0x7047,
-	0x0400, 0x0038, 0x080c, 0x8e46, 0x785c, 0x7032, 0x7042, 0x7047,
-	0x0200, 0x60c3, 0x0020, 0x0804, 0x8f6c, 0x00e6, 0x2071, 0x19b8,
-	0x702c, 0x9005, 0x0110, 0x8001, 0x702e, 0x00ee, 0x0005, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19b8, 0x7620, 0x2660, 0x2678, 0x2039, 0x0001,
-	0x87ff, 0x0904, 0x9402, 0x8cff, 0x0904, 0x9402, 0x6020, 0x9086,
-	0x0006, 0x1904, 0x93fd, 0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904,
-	0x93fd, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06, 0x1904, 0x93fd,
-	0x85ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x93fd, 0x7030, 0x9c06,
-	0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160, 0x6824, 0xd084,
-	0x0148, 0x6827, 0x0001, 0x080c, 0x81e3, 0x080c, 0x9487, 0x7033,
-	0x0000, 0x0428, 0x080c, 0x81e3, 0x6820, 0xd0b4, 0x0110, 0x68a7,
-	0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0x9487, 0x7033,
+	0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x2069, 0x1800, 0x6a78,
+	0x720a, 0x6a7c, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027,
+	0xffff, 0x0005, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013,
+	0x001e, 0x0005, 0x8ea2, 0x8ea2, 0x8ea4, 0x8ea2, 0x8ea2, 0x8ea2,
+	0x8ebe, 0x8ea2, 0x080c, 0x0d65, 0x7914, 0x918c, 0x08ff, 0x918d,
+	0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1853, 0x6804,
+	0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010,
+	0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x8f87, 0x2009, 0x0003,
+	0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x97fa, 0x001e,
+	0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008,
+	0x7116, 0x080c, 0x8f7b, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
+	0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
+	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0,
+	0x2028, 0xb910, 0xba14, 0x7378, 0x747c, 0x7820, 0x0002, 0x8f06,
+	0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06,
+	0x8f06, 0x8f08, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x080c, 0x0d65,
+	0xb884, 0x609e, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90,
+	0x9784, 0xff00, 0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006,
+	0x7814, 0x2048, 0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94,
+	0x87ff, 0x0198, 0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082,
+	0x2f00, 0x6086, 0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129,
+	0x6077, 0x0000, 0xb884, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705,
+	0x6072, 0x0cc0, 0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c,
+	0xd0fc, 0x0118, 0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808,
+	0x6086, 0x6266, 0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000,
+	0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa848,
+	0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0xb86c,
+	0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c, 0x97da, 0x2009,
+	0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58,
+	0x080c, 0x8210, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x009e, 0x00be, 0x0005, 0x7a40, 0x9294, 0x00ff, 0x8217, 0x0005,
+	0x00d6, 0x2069, 0x19b8, 0x686b, 0x0001, 0x00de, 0x0005, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8202, 0x0005, 0x0016,
+	0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128,
+	0x0089, 0x080c, 0x8202, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c,
+	0x2102, 0x2001, 0x19b9, 0x2003, 0x0000, 0x2001, 0x19c4, 0x2003,
+	0x0000, 0x0c88, 0x0006, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011,
+	0x0009, 0x080c, 0x287c, 0x002e, 0x001e, 0x000e, 0x0005, 0x0016,
+	0x00c6, 0x0006, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8, 0x2061,
+	0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016, 0x0026, 0x2009, 0x1804,
+	0x2011, 0x0008, 0x080c, 0x287c, 0x002e, 0x001e, 0x010e, 0x190c,
+	0x98e4, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e,
+	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x70b7, 0x1510, 0x2001, 0x19dd, 0x2004, 0x9005,
+	0x1904, 0x9038, 0x080c, 0x7158, 0x11a8, 0x2069, 0x0380, 0x6843,
+	0x0101, 0x6844, 0xd084, 0x1de8, 0x2061, 0x0100, 0x6020, 0xd0b4,
+	0x1120, 0x6024, 0xd084, 0x090c, 0x0d65, 0x6843, 0x0100, 0x080c,
+	0x8202, 0x04b0, 0x00c6, 0x2061, 0x19b8, 0x00f0, 0x6904, 0x9194,
+	0x4000, 0x0598, 0x080c, 0x8fb7, 0x080c, 0x2843, 0x00c6, 0x2061,
+	0x19b8, 0x6134, 0x9192, 0x0008, 0x1278, 0x8108, 0x6136, 0x080c,
+	0x98c8, 0x6130, 0x080c, 0x98e4, 0x00ce, 0x81ff, 0x01c8, 0x080c,
+	0x8202, 0x080c, 0x8faa, 0x00a0, 0x080c, 0x98c8, 0x6130, 0x91e5,
+	0x0000, 0x0150, 0x080c, 0xd610, 0x080c, 0x820b, 0x6003, 0x0001,
+	0x2009, 0x0014, 0x080c, 0x9c85, 0x080c, 0x98e4, 0x00ce, 0x0000,
+	0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x19dd, 0x2004,
+	0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b8, 0x6134, 0x9192, 0x0003,
+	0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c, 0x8202, 0x080c, 0x5b97,
+	0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6,
+	0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x8218, 0x080c, 0x98c8,
+	0x2001, 0x0387, 0x2003, 0x0202, 0x2071, 0x19b8, 0x714c, 0x81ff,
+	0x0904, 0x90cc, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x70b7,
+	0x11c0, 0x0036, 0x2019, 0x0002, 0x080c, 0x9286, 0x003e, 0x714c,
+	0x2160, 0x080c, 0xd610, 0x2009, 0x004a, 0x6003, 0x0003, 0x080c,
+	0x9c85, 0x2001, 0x0386, 0x2003, 0x5040, 0x080c, 0x7158, 0x0804,
+	0x90cc, 0x6904, 0xd1f4, 0x0904, 0x90d9, 0x080c, 0x2843, 0x00c6,
+	0x704c, 0x9065, 0x090c, 0x0d65, 0x6020, 0x00ce, 0x9086, 0x0006,
+	0x1518, 0x61c8, 0x60c4, 0x9105, 0x11f8, 0x2009, 0x180c, 0x2104,
+	0xd0d4, 0x01d0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294,
+	0x0002, 0x1510, 0x0010, 0xc0d4, 0x200a, 0x6014, 0x9084, 0xe7fd,
+	0x9085, 0x0010, 0x6016, 0x704c, 0x2060, 0x080c, 0x88d1, 0x2009,
+	0x0049, 0x080c, 0x9c85, 0x0080, 0x0036, 0x2019, 0x0001, 0x080c,
+	0x9286, 0x003e, 0x714c, 0x2160, 0x080c, 0xd610, 0x2009, 0x004a,
+	0x6003, 0x0003, 0x080c, 0x9c85, 0x2001, 0x0387, 0x2003, 0x0200,
+	0x080c, 0x98e4, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e,
+	0x0005, 0xd1ec, 0x1904, 0x908d, 0x0804, 0x908f, 0x0026, 0x00e6,
+	0x2071, 0x19b8, 0x706c, 0xd084, 0x01d0, 0xc084, 0x706e, 0x714c,
+	0x81ff, 0x01a8, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e,
+	0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012, 0x080c, 0x287c,
+	0x0030, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c, 0x287c, 0x00ee,
+	0x002e, 0x0005, 0x9036, 0x2001, 0x19c2, 0x2004, 0x9005, 0x0128,
+	0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8, 0x9085, 0x0001, 0x0005,
+	0x00f6, 0x2079, 0x19b8, 0x610c, 0x9006, 0x600e, 0x6044, 0xc0fc,
+	0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06, 0x1118, 0x7826, 0x782a,
+	0x0050, 0x792a, 0x0040, 0x00c6, 0x2660, 0x610e, 0x00ce, 0x7824,
+	0x9c06, 0x1108, 0x7e26, 0x080c, 0x9378, 0x080c, 0xba36, 0x00fe,
+	0x0005, 0x080c, 0x8d20, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c,
+	0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005,
+	0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061,
+	0x1800, 0x6078, 0x617c, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce,
+	0x60c3, 0x002c, 0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003, 0x0f00,
+	0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x0156, 0x080c, 0x8d6b,
+	0x7003, 0x0200, 0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006,
+	0x2011, 0x1840, 0x2019, 0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70,
+	0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x9176,
+	0x60c3, 0x001c, 0x015e, 0x0804, 0x8f87, 0x0016, 0x0026, 0x080c,
+	0x8d47, 0x080c, 0x8d59, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0,
+	0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x0021, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8,
+	0x9192, 0x0010, 0x1250, 0x4003, 0x9080, 0x0004, 0x8003, 0x60c2,
+	0x080c, 0x8f87, 0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003,
+	0x080c, 0x97e5, 0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c,
+	0x8d20, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0x8f87, 0x0016, 0x0026, 0x080c, 0x8d20, 0x20e9, 0x0000, 0x20a1,
+	0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002,
+	0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x8f87, 0x002e, 0x001e,
+	0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b8, 0x7010, 0x2060, 0x8cff, 0x0188, 0x080c, 0xba5c, 0x1110,
+	0x080c, 0xa58f, 0x600c, 0x0006, 0x080c, 0xbcd3, 0x600f, 0x0000,
+	0x080c, 0x9be7, 0x080c, 0x9378, 0x00ce, 0x0c68, 0x2c00, 0x7012,
+	0x700e, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
+	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102,
+	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19b8, 0x7030, 0x2060,
+	0x8cff, 0x0548, 0x080c, 0x8fb7, 0x6ac0, 0x68c3, 0x0000, 0x080c,
+	0x820b, 0x00c6, 0x2061, 0x0100, 0x080c, 0x97fe, 0x00ce, 0x20a9,
+	0x01f4, 0x04b1, 0x080c, 0x8874, 0x6044, 0xd0ac, 0x1128, 0x2001,
+	0x1959, 0x2004, 0x604a, 0x0020, 0x2009, 0x0013, 0x080c, 0x9c85,
+	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
+	0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001,
+	0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x820b, 0x6814, 0x9084,
+	0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
+	0x2011, 0x5b41, 0x080c, 0x8159, 0x20a9, 0x01f4, 0x0009, 0x08c0,
+	0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000,
+	0x190c, 0x2843, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010,
+	0x1f04, 0x9268, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x0005, 0x0126, 0x0156,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
+	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102,
+	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x0380, 0x701c, 0x0006,
+	0x701f, 0x0202, 0x2071, 0x19b8, 0x704c, 0x2060, 0x8cff, 0x0904,
+	0x9327, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904,
+	0x9327, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109,
+	0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8218, 0x080c, 0x1c7a,
+	0x0046, 0x2009, 0x00a5, 0x080c, 0x0e3d, 0x2021, 0x0169, 0x2404,
+	0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6,
+	0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x19b8,
+	0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816, 0x782b, 0x0008,
+	0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002, 0x1128, 0x7884,
+	0x9005, 0x1110, 0x7887, 0x0001, 0x0016, 0x2009, 0x0040, 0x080c,
+	0x2052, 0x001e, 0x2009, 0x0000, 0x080c, 0x0e3d, 0x004e, 0x20a9,
+	0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084,
+	0x4000, 0x190c, 0x2843, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002,
+	0x0010, 0x1f04, 0x92f9, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x6827, 0x4000,
+	0x6824, 0x83ff, 0x1160, 0x2009, 0x0049, 0x080c, 0x88d1, 0x6044,
+	0xd0ac, 0x1118, 0x6003, 0x0002, 0x0010, 0x080c, 0x9c85, 0x000e,
+	0x2071, 0x0380, 0xd08c, 0x1110, 0x701f, 0x0200, 0x000e, 0x001e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
+	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8, 0x6a06,
+	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
+	0x19b8, 0x6a3e, 0x012e, 0x00de, 0x0005, 0x080c, 0x8e6e, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x8e6e, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x8e6e, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x8e6e, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x8e6e, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x8f87,
+	0x00e6, 0x2071, 0x19b8, 0x702c, 0x9005, 0x0110, 0x8001, 0x702e,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7620, 0x2660,
+	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0x941d, 0x8cff, 0x0904,
+	0x941d, 0x6020, 0x9086, 0x0006, 0x1904, 0x9418, 0x88ff, 0x0138,
+	0x2800, 0x9c06, 0x1904, 0x9418, 0x2039, 0x0000, 0x0050, 0x6010,
+	0x9b06, 0x1904, 0x9418, 0x85ff, 0x0120, 0x605c, 0x9106, 0x1904,
+	0x9418, 0x7030, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x820b,
+	0x080c, 0x94a2, 0x7033, 0x0000, 0x0428, 0x080c, 0x820b, 0x6820,
+	0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
+	0x080c, 0x94a2, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2833, 0x9006,
+	0x080c, 0x2833, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010,
+	0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096,
+	0x2048, 0x080c, 0xb845, 0x0110, 0x080c, 0xd21e, 0x009e, 0x080c,
+	0x9c21, 0x080c, 0x9378, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x9393,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x9393, 0x9006, 0x012e, 0x000e,
+	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
+	0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6,
+	0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b8, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9491,
+	0x6020, 0x9086, 0x0006, 0x1904, 0x948c, 0x87ff, 0x0128, 0x2700,
+	0x9c06, 0x1904, 0x948c, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff,
+	0x0118, 0x605c, 0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x9286, 0x703f, 0x0000, 0x9006, 0x704e,
+	0x706a, 0x7052, 0x706e, 0x003e, 0x7048, 0x9c36, 0x1110, 0x660c,
+	0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
+	0x080c, 0xb845, 0x0110, 0x080c, 0xd21e, 0x080c, 0x9c21, 0x87ff,
+	0x1198, 0x00ce, 0x0804, 0x943d, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x943d, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd,
+	0x0001, 0x0c80, 0x00e6, 0x2071, 0x19b8, 0x7033, 0x0000, 0x7004,
+	0x9086, 0x0003, 0x0158, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002,
+	0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19b8, 0x2c10, 0x7648, 0x2660, 0x2678, 0x8cff,
+	0x0518, 0x2200, 0x9c06, 0x11e0, 0x7048, 0x9c36, 0x1110, 0x660c,
+	0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085, 0x0001, 0x0020,
+	0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e, 0x002e, 0x006e,
+	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b8, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9584, 0x6010,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x957f, 0x7030,
+	0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x955b,
+	0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7033, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36,
+	0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x080c, 0xba4b, 0x1158, 0x080c, 0x303b, 0x080c, 0xba5c, 0x11f0,
+	0x080c, 0xa58f, 0x00d8, 0x080c, 0x94a2, 0x08c0, 0x080c, 0xba5c,
+	0x1118, 0x080c, 0xa58f, 0x0090, 0x6014, 0x2048, 0x080c, 0xb845,
+	0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x698a, 0x080c, 0xba36, 0x080c, 0xbcd3,
+	0x080c, 0x9c21, 0x080c, 0x9378, 0x00ce, 0x0804, 0x9504, 0x2c78,
+	0x600c, 0x2060, 0x0804, 0x9504, 0x012e, 0x000e, 0x002e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086,
+	0x0006, 0x1d20, 0x080c, 0xd21e, 0x0c08, 0x00d6, 0x080c, 0x8d6b,
+	0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001,
+	0x2099, 0x195a, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004,
+	0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0x8f87, 0x00de,
+	0x0005, 0x080c, 0x8d6b, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00,
+	0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7860,
+	0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7860, 0x9084, 0xff00,
+	0x8007, 0x7006, 0x60c2, 0x0804, 0x8f87, 0x00b6, 0x00d6, 0x0016,
+	0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xbed9, 0x00de, 0x1904,
+	0x9632, 0x080c, 0x8d20, 0x7003, 0x1300, 0x782c, 0x080c, 0x973d,
+	0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0,
+	0x080c, 0x9b66, 0x11d8, 0x9286, 0x007e, 0x1128, 0x700b, 0x00ff,
+	0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128, 0x700b, 0x00ff,
+	0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180, 0x9286, 0x0080,
+	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000,
+	0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0, 0xb884, 0x700e,
+	0x00a8, 0x080c, 0x9b66, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082,
+	0x007e, 0x0250, 0x00d6, 0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68,
+	0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012,
+	0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x8f87,
+	0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de,
+	0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006,
+	0x01c0, 0x9186, 0x0003, 0x0904, 0x96b0, 0x9186, 0x0005, 0x0904,
+	0x9698, 0x9186, 0x0004, 0x05f0, 0x9186, 0x0008, 0x0904, 0x96a1,
+	0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0x971a,
+	0x0005, 0x080c, 0x96db, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x6800, 0x6a44, 0xd2fc, 0x11f8, 0x0002, 0x9679, 0x9684,
+	0x967b, 0x9684, 0x9680, 0x9679, 0x9679, 0x9684, 0x9684, 0x9684,
+	0x9684, 0x9679, 0x9679, 0x9679, 0x9679, 0x9679, 0x9684, 0x9679,
+	0x9684, 0x080c, 0x0d65, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110,
+	0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026,
+	0x0804, 0x96d4, 0x080c, 0x96db, 0x00d6, 0x0026, 0x792c, 0x2168,
+	0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04e0,
+	0x080c, 0x96db, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x0498, 0x04c9, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x0420,
+	0x0451, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048,
+	0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022,
+	0x7226, 0x792c, 0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180,
+	0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118,
+	0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e,
+	0x00de, 0x0804, 0x8f87, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066,
+	0x080c, 0x8d6b, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c,
+	0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0x9b66, 0x1118, 0x9092,
+	0x007e, 0x0268, 0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68, 0x2d34,
+	0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e,
+	0xbc84, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004,
+	0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020,
+	0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e,
+	0x00be, 0x0005, 0x080c, 0x8d6b, 0x7003, 0x0100, 0x782c, 0x700a,
+	0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x080c,
+	0x8d17, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e,
+	0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007,
+	0x701a, 0x60c3, 0x0010, 0x0804, 0x8f87, 0x00e6, 0x2071, 0x0240,
+	0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8c4, 0xd084,
+	0x0120, 0x7850, 0x702a, 0x784c, 0x702e, 0x00be, 0x00fe, 0x000e,
+	0x00ee, 0x0005, 0x080c, 0x8d62, 0x7003, 0x0100, 0x782c, 0x700a,
+	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x00a9, 0x7914,
+	0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x27a2,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c,
+	0x8faa, 0x080c, 0x8202, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6,
+	0x7860, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e,
+	0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74,
+	0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384, 0xff00, 0x9215,
+	0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200,
+	0x080c, 0x97fa, 0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x4003,
+	0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286, 0x3000, 0x0110,
+	0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e, 0x0005, 0x900e,
+	0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003,
+	0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc,
+	0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c,
+	0x200c, 0xc1d5, 0x2102, 0x2009, 0x1983, 0x210c, 0x009e, 0x918d,
+	0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x0026, 0x2110,
+	0x900e, 0x080c, 0x287c, 0x002e, 0x0005, 0x2009, 0x0009, 0x00a0,
+	0x2009, 0x000a, 0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c,
+	0x0058, 0x2009, 0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009,
+	0x000f, 0x0010, 0x2009, 0x0008, 0x6912, 0x0005, 0x00d6, 0x9290,
+	0x0018, 0x8214, 0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000,
+	0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020,
+	0x0008, 0x9016, 0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120,
+	0x6810, 0x8000, 0x6812, 0x0c60, 0x00de, 0x0005, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b8, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x98a5,
+	0x7030, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
+	0x987c, 0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7033,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
 	0x2001, 0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069,
-	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7020,
-	0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00,
-	0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000, 0x660c,
-	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff,
-	0x1168, 0x600f, 0x0000, 0x6014, 0x0096, 0x2048, 0x080c, 0xb82a,
-	0x0110, 0x080c, 0xd1fc, 0x009e, 0x080c, 0x9c06, 0x080c, 0x935d,
-	0x88ff, 0x1190, 0x00ce, 0x0804, 0x9378, 0x2c78, 0x600c, 0x2060,
-	0x0804, 0x9378, 0x9006, 0x012e, 0x000e, 0x006e, 0x007e, 0x00ce,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5,
-	0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0066,
-	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7648,
-	0x2660, 0x2678, 0x8cff, 0x0904, 0x9476, 0x6020, 0x9086, 0x0006,
-	0x1904, 0x9471, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904, 0x9471,
-	0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118, 0x605c, 0x9106,
-	0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c,
-	0x926b, 0x703f, 0x0000, 0x9006, 0x704e, 0x706a, 0x7052, 0x706e,
-	0x003e, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36,
-	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047,
-	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
-	0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xb82a, 0x0110,
-	0x080c, 0xd1fc, 0x080c, 0x9c06, 0x87ff, 0x1198, 0x00ce, 0x0804,
-	0x9422, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9422, 0x9006, 0x012e,
-	0x000e, 0x002e, 0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe,
-	0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6,
-	0x2071, 0x19b8, 0x7033, 0x0000, 0x7004, 0x9086, 0x0003, 0x0158,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007, 0x0005,
-	0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6,
-	0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8,
-	0x2c10, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06,
-	0x11e0, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36,
-	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047,
-	0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c, 0x2060,
-	0x08d8, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe,
-	0x0005, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7610, 0x2660,
-	0x2678, 0x8cff, 0x0904, 0x9569, 0x6010, 0x00b6, 0x2058, 0xb8a0,
-	0x00be, 0x9206, 0x1904, 0x9564, 0x7030, 0x9c06, 0x1520, 0x2069,
-	0x0100, 0x68c0, 0x9005, 0x0904, 0x9540, 0x080c, 0x8f9c, 0x68c3,
-	0x0000, 0x080c, 0x9487, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010,
+	0x9c36, 0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x080c, 0xba4b, 0x1158, 0x080c, 0x303b, 0x080c, 0xba5c,
+	0x11f0, 0x080c, 0xa58f, 0x00d8, 0x080c, 0x94a2, 0x08c0, 0x080c,
+	0xba5c, 0x1118, 0x080c, 0xa58f, 0x0090, 0x6014, 0x2048, 0x080c,
+	0xb845, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6996, 0x080c, 0xba36, 0x080c,
+	0xbcd3, 0x080c, 0x9c21, 0x080c, 0x9378, 0x00ce, 0x0804, 0x982d,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x982d, 0x7013, 0x0000, 0x700f,
+	0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xd21e,
+	0x08f0, 0x00f6, 0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8,
+	0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe, 0x0005,
+	0x0016, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001,
+	0x1188, 0x2001, 0x0015, 0x0c29, 0x2009, 0x1000, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0120, 0x8109, 0x1db0,
+	0x080c, 0x0d65, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0003, 0x1120, 0x2001, 0x0380, 0x2003, 0x0001,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x00e6, 0x900e, 0x2071, 0x19b8,
+	0x0469, 0x0106, 0x0190, 0x7004, 0x9086, 0x0003, 0x0148, 0x20a9,
+	0x1000, 0x6044, 0xd0fc, 0x01d8, 0x1f04, 0x9901, 0x080c, 0x0d65,
+	0x080c, 0x98c8, 0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148,
+	0x080c, 0x8874, 0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a,
+	0x7042, 0x704c, 0x9c06, 0x190c, 0x0d65, 0x080c, 0x88d1, 0x010e,
+	0x1919, 0x00ee, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0005, 0x0126, 0x2091,
+	0x2400, 0x7808, 0xd0a4, 0x190c, 0x0d5e, 0xd09c, 0x0128, 0x7820,
+	0x908c, 0xf000, 0x11b8, 0x0012, 0x012e, 0x0005, 0x994e, 0x998c,
+	0x99b3, 0x99e3, 0x99f3, 0x9a04, 0x9a13, 0x9a21, 0x9a32, 0x9a36,
+	0x994e, 0x994e, 0x994e, 0x994e, 0x994e, 0x994e, 0x080c, 0x0d65,
+	0x012e, 0x0005, 0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0012, 0x012e, 0x0005,
+	0x9973, 0x9975, 0x9973, 0x997b, 0x9973, 0x9973, 0x9973, 0x9973,
+	0x9973, 0x9975, 0x9973, 0x9975, 0x9973, 0x9975, 0x9973, 0x9973,
+	0x9973, 0x9975, 0x9973, 0x080c, 0x0d65, 0x2009, 0x0013, 0x080c,
+	0x9c85, 0x012e, 0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130,
+	0x080c, 0x83c0, 0x080c, 0x9be7, 0x012e, 0x0005, 0x2009, 0x0049,
+	0x080c, 0x9c85, 0x012e, 0x0005, 0x080c, 0x98c8, 0x2001, 0x19dd,
+	0x2003, 0x0000, 0x7030, 0x9065, 0x090c, 0x0d65, 0x7034, 0x9092,
+	0x00c8, 0x1258, 0x8000, 0x7036, 0x7004, 0x9086, 0x0003, 0x0110,
+	0x7007, 0x0000, 0x781f, 0x0808, 0x0040, 0x080c, 0xd610, 0x6003,
+	0x0001, 0x2009, 0x0014, 0x080c, 0x9c85, 0x781f, 0x0100, 0x080c,
+	0x98e4, 0x012e, 0x0005, 0x080c, 0x98c8, 0x714c, 0x81ff, 0x1128,
+	0x2011, 0x19e0, 0x2013, 0x0000, 0x0400, 0x2061, 0x0100, 0x7150,
+	0x9192, 0x7530, 0x12b8, 0x8108, 0x7152, 0x714c, 0x9188, 0x0008,
+	0x210c, 0x918e, 0x0006, 0x1138, 0x6014, 0x9084, 0x1984, 0x9085,
+	0x0012, 0x6016, 0x0050, 0x6014, 0x9084, 0x1984, 0x9085, 0x0016,
+	0x6016, 0x0018, 0x706c, 0xc085, 0x706e, 0x781f, 0x0200, 0x080c,
+	0x98e4, 0x012e, 0x0005, 0x080c, 0x98c8, 0x714c, 0x2160, 0x6003,
+	0x0003, 0x2009, 0x004a, 0x080c, 0x9c85, 0x781f, 0x0200, 0x080c,
+	0x98e4, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060,
+	0x6003, 0x0003, 0x080c, 0x98c8, 0x080c, 0x1c02, 0x781f, 0x0400,
+	0x080c, 0x98e4, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820,
+	0x2060, 0x080c, 0x98c8, 0x080c, 0x1c4a, 0x781f, 0x0400, 0x080c,
+	0x98e4, 0x012e, 0x0005, 0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc,
+	0x6046, 0x7104, 0x9186, 0x0003, 0x0110, 0x080c, 0x8937, 0x012e,
+	0x0005, 0x00f6, 0x703c, 0x9086, 0x0002, 0x0148, 0x704c, 0x907d,
+	0x0130, 0x7844, 0xc0bc, 0x7846, 0x080c, 0x8ee1, 0x0000, 0x00fe,
+	0x012e, 0x0005, 0x080c, 0x7158, 0x012e, 0x0005, 0x080c, 0x0d65,
+	0x0005, 0x00e6, 0x2071, 0x19b8, 0x6044, 0xc0bc, 0x6046, 0xd0fc,
+	0x01b8, 0x704c, 0x9c06, 0x1190, 0x2019, 0x0001, 0x080c, 0x9286,
+	0x704f, 0x0000, 0x2001, 0x0109, 0x2004, 0xd08c, 0x1138, 0x2001,
+	0x0108, 0x2004, 0xd0bc, 0x1110, 0x703f, 0x0000, 0x080c, 0x94b8,
+	0x00ee, 0x0005, 0x0026, 0x7010, 0x9c06, 0x1178, 0x080c, 0x9378,
+	0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7212, 0x600f,
+	0x0000, 0x0010, 0x7212, 0x720e, 0x9006, 0x002e, 0x0005, 0x0026,
+	0x7020, 0x9c06, 0x1178, 0x080c, 0x9378, 0x6044, 0xc0fc, 0x6046,
+	0x600c, 0x9015, 0x0120, 0x7222, 0x600f, 0x0000, 0x0010, 0x7222,
+	0x721e, 0x9006, 0x002e, 0x0005, 0x00d6, 0x0036, 0x7830, 0x9c06,
+	0x1558, 0x2069, 0x0100, 0x68c0, 0x9005, 0x01f8, 0x080c, 0x820b,
+	0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x2069, 0x0140,
 	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2833,
 	0x9006, 0x080c, 0x2833, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
-	0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110, 0x660c, 0x7612,
-	0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700e,
-	0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xba30, 0x1158,
-	0x080c, 0x3034, 0x080c, 0xba41, 0x11f0, 0x080c, 0xa574, 0x00d8,
-	0x080c, 0x9487, 0x08c0, 0x080c, 0xba41, 0x1118, 0x080c, 0xa574,
-	0x0090, 0x6014, 0x2048, 0x080c, 0xb82a, 0x0168, 0x6020, 0x9086,
-	0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x6983, 0x080c, 0xba1b, 0x080c, 0xbcb8, 0x080c, 0x9c06, 0x080c,
-	0x935d, 0x00ce, 0x0804, 0x94e9, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x94e9, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20, 0x080c,
-	0xd1fc, 0x0c08, 0x00d6, 0x080c, 0x8d43, 0x7003, 0x0200, 0x7007,
-	0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x195a, 0x20e9,
-	0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023, 0x0004,
-	0x7027, 0x7878, 0x080c, 0x8f6c, 0x00de, 0x0005, 0x080c, 0x8d43,
-	0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814, 0x9084,
-	0x00ff, 0x7022, 0x782c, 0x7026, 0x7860, 0x9084, 0x00ff, 0x9085,
-	0x0200, 0x7002, 0x7860, 0x9084, 0xff00, 0x8007, 0x7006, 0x60c2,
-	0x0804, 0x8f6c, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009,
-	0x0035, 0x080c, 0xbebe, 0x00de, 0x1904, 0x9617, 0x080c, 0x8cf8,
-	0x7003, 0x1300, 0x782c, 0x080c, 0x9722, 0x2068, 0x6820, 0x9086,
-	0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0x9b4b, 0x11d8,
-	0x9286, 0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498,
-	0x9286, 0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458,
-	0x9284, 0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b, 0x00ff,
-	0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a,
-	0xb814, 0x700e, 0x00c0, 0xb884, 0x700e, 0x00a8, 0x080c, 0x9b4b,
-	0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6,
-	0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de,
-	0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3,
-	0x000c, 0x001e, 0x00de, 0x080c, 0x8f6c, 0x00be, 0x0005, 0x781b,
-	0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005, 0x792c,
-	0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186, 0x0003,
-	0x0904, 0x9695, 0x9186, 0x0005, 0x0904, 0x967d, 0x9186, 0x0004,
-	0x05f0, 0x9186, 0x0008, 0x0904, 0x9686, 0x7807, 0x0037, 0x782f,
-	0x0003, 0x7817, 0x1700, 0x080c, 0x96ff, 0x0005, 0x080c, 0x96c0,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800, 0x6a44,
-	0xd2fc, 0x11f8, 0x0002, 0x965e, 0x9669, 0x9660, 0x9669, 0x9665,
-	0x965e, 0x965e, 0x9669, 0x9669, 0x9669, 0x9669, 0x965e, 0x965e,
-	0x965e, 0x965e, 0x965e, 0x9669, 0x965e, 0x9669, 0x080c, 0x0d65,
-	0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009,
-	0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x96b9, 0x080c,
-	0x96c0, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6a00,
-	0x9286, 0x0002, 0x1108, 0x900e, 0x04e0, 0x080c, 0x96c0, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0498, 0x04c9, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005, 0x0118,
-	0x9286, 0x0002, 0x1108, 0x900e, 0x0420, 0x0451, 0x00d6, 0x0026,
-	0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834, 0x9112,
-	0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c, 0x9180,
-	0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180, 0x0000, 0x2004, 0x908e,
-	0x0002, 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0008,
-	0x900e, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804, 0x8f6c,
-	0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x8d43, 0x9006,
-	0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x2058,
-	0xb8a0, 0x080c, 0x9b4b, 0x1118, 0x9092, 0x007e, 0x0268, 0x00d6,
-	0x2069, 0x181e, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000, 0x2b5c,
-	0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e, 0xbc84, 0x2029, 0x0000,
-	0x6634, 0x782c, 0x9080, 0x0008, 0x2004, 0x9086, 0x0003, 0x1128,
-	0x7512, 0x7616, 0x731a, 0x741e, 0x0020, 0x7312, 0x7416, 0x751a,
-	0x761e, 0x006e, 0x005e, 0x004e, 0x003e, 0x00be, 0x0005, 0x080c,
-	0x8d43, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x700e,
-	0x60c3, 0x0008, 0x0804, 0x8f6c, 0x080c, 0x8cef, 0x7003, 0x1400,
-	0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012, 0x7830,
-	0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010,
-	0x0804, 0x8f6c, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6, 0x2078,
-	0x7810, 0x00b6, 0x2058, 0xb8c4, 0xd084, 0x0120, 0x7850, 0x702a,
-	0x784c, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c,
-	0x8d3a, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0x8f6c, 0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000,
-	0x60a7, 0x9575, 0x0026, 0x080c, 0x27a2, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x8f8f, 0x080c, 0x81da,
-	0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7860, 0x2048, 0xaa7c,
-	0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300,
-	0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d,
-	0xc200, 0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78,
-	0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0x97df, 0x00de,
-	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68,
-	0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee,
-	0x00de, 0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096, 0x2048,
-	0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001, 0x180c,
-	0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158,
-	0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102,
-	0x2009, 0x1983, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010, 0x2009,
-	0x0096, 0x60ab, 0x0036, 0x0026, 0x2110, 0x900e, 0x080c, 0x287c,
-	0x002e, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088,
-	0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d,
-	0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009,
-	0x0008, 0x6912, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9,
-	0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0,
-	0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1,
-	0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812,
-	0x0c60, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6,
-	0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7610,
-	0x2660, 0x2678, 0x8cff, 0x0904, 0x988a, 0x7030, 0x9c06, 0x1520,
-	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x9861, 0x080c, 0x8f9c,
-	0x68c3, 0x0000, 0x080c, 0x9487, 0x7033, 0x0000, 0x0036, 0x2069,
-	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100, 0x6824, 0xd084,
-	0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110, 0x660c,
-	0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xba30,
-	0x1158, 0x080c, 0x3034, 0x080c, 0xba41, 0x11f0, 0x080c, 0xa574,
-	0x00d8, 0x080c, 0x9487, 0x08c0, 0x080c, 0xba41, 0x1118, 0x080c,
-	0xa574, 0x0090, 0x6014, 0x2048, 0x080c, 0xb82a, 0x0168, 0x6020,
-	0x9086, 0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0x698f, 0x080c, 0xba1b, 0x080c, 0xbcb8, 0x080c, 0x9c06,
-	0x080c, 0x935d, 0x00ce, 0x0804, 0x9812, 0x2c78, 0x600c, 0x2060,
-	0x0804, 0x9812, 0x7013, 0x0000, 0x700f, 0x0000, 0x012e, 0x006e,
-	0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020,
-	0x9086, 0x0006, 0x1d08, 0x080c, 0xd1fc, 0x08f0, 0x00f6, 0x0036,
-	0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8, 0x7832, 0x7936, 0x7a3a,
-	0x781b, 0x8080, 0x003e, 0x00fe, 0x0005, 0x0016, 0x2001, 0x0382,
-	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1188, 0x2001, 0x0015,
-	0x0c29, 0x2009, 0x1000, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007,
-	0x9086, 0x0003, 0x0120, 0x8109, 0x1db0, 0x080c, 0x0d65, 0x001e,
-	0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003,
-	0x1120, 0x2001, 0x0380, 0x2003, 0x0001, 0x0005, 0x0156, 0x0016,
-	0x0026, 0x00e6, 0x900e, 0x2071, 0x19b8, 0x0469, 0x0106, 0x0190,
-	0x7004, 0x9086, 0x0003, 0x0148, 0x20a9, 0x1000, 0x6044, 0xd0fc,
-	0x01d8, 0x1f04, 0x98e6, 0x080c, 0x0d65, 0x080c, 0x98ad, 0x6044,
-	0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148, 0x080c, 0x884c, 0x6044,
-	0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a, 0x7042, 0x704c, 0x9c06,
-	0x190c, 0x0d65, 0x080c, 0x88a9, 0x010e, 0x1919, 0x00ee, 0x002e,
-	0x001e, 0x015e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007,
-	0x9086, 0x0003, 0x0005, 0x0126, 0x2091, 0x2400, 0x7808, 0xd0a4,
-	0x190c, 0x0d5e, 0xd09c, 0x0128, 0x7820, 0x908c, 0xf000, 0x11b8,
-	0x0012, 0x012e, 0x0005, 0x9933, 0x9971, 0x9998, 0x99c8, 0x99d8,
-	0x99e9, 0x99f8, 0x9a06, 0x9a17, 0x9a1b, 0x9933, 0x9933, 0x9933,
-	0x9933, 0x9933, 0x9933, 0x080c, 0x0d65, 0x012e, 0x0005, 0x2060,
-	0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046, 0x6000, 0x908a, 0x0016,
-	0x1a0c, 0x0d65, 0x0012, 0x012e, 0x0005, 0x9958, 0x995a, 0x9958,
-	0x9960, 0x9958, 0x9958, 0x9958, 0x9958, 0x9958, 0x995a, 0x9958,
-	0x995a, 0x9958, 0x995a, 0x9958, 0x9958, 0x9958, 0x995a, 0x9958,
-	0x080c, 0x0d65, 0x2009, 0x0013, 0x080c, 0x9c6a, 0x012e, 0x0005,
-	0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130, 0x080c, 0x8398, 0x080c,
-	0x9bcc, 0x012e, 0x0005, 0x2009, 0x0049, 0x080c, 0x9c6a, 0x012e,
-	0x0005, 0x080c, 0x98ad, 0x2001, 0x19dd, 0x2003, 0x0000, 0x7030,
-	0x9065, 0x090c, 0x0d65, 0x7034, 0x9092, 0x00c8, 0x1258, 0x8000,
-	0x7036, 0x7004, 0x9086, 0x0003, 0x0110, 0x7007, 0x0000, 0x781f,
-	0x0808, 0x0040, 0x080c, 0xd5ee, 0x6003, 0x0001, 0x2009, 0x0014,
-	0x080c, 0x9c6a, 0x781f, 0x0100, 0x080c, 0x98c9, 0x012e, 0x0005,
-	0x080c, 0x98ad, 0x714c, 0x81ff, 0x1128, 0x2011, 0x19e0, 0x2013,
-	0x0000, 0x0400, 0x2061, 0x0100, 0x7150, 0x9192, 0x7530, 0x12b8,
-	0x8108, 0x7152, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006,
-	0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0050,
-	0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x0018, 0x706c,
-	0xc085, 0x706e, 0x781f, 0x0200, 0x080c, 0x98c9, 0x012e, 0x0005,
-	0x080c, 0x98ad, 0x714c, 0x2160, 0x6003, 0x0003, 0x2009, 0x004a,
-	0x080c, 0x9c6a, 0x781f, 0x0200, 0x080c, 0x98c9, 0x012e, 0x0005,
-	0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x6003, 0x0003, 0x080c,
-	0x98ad, 0x080c, 0x1c02, 0x781f, 0x0400, 0x080c, 0x98c9, 0x012e,
-	0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x080c, 0x98ad,
-	0x080c, 0x1c4a, 0x781f, 0x0400, 0x080c, 0x98c9, 0x012e, 0x0005,
-	0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc, 0x6046, 0x7104, 0x9186,
-	0x0003, 0x0110, 0x080c, 0x890f, 0x012e, 0x0005, 0x00f6, 0x703c,
-	0x9086, 0x0002, 0x0148, 0x704c, 0x907d, 0x0130, 0x7844, 0xc0bc,
-	0x7846, 0x080c, 0x8eb7, 0x0000, 0x00fe, 0x012e, 0x0005, 0x080c,
-	0x714d, 0x012e, 0x0005, 0x080c, 0x0d65, 0x0005, 0x00e6, 0x2071,
-	0x19b8, 0x6044, 0xc0bc, 0x6046, 0xd0fc, 0x01b8, 0x704c, 0x9c06,
-	0x1190, 0x2019, 0x0001, 0x080c, 0x926b, 0x704f, 0x0000, 0x2001,
-	0x0109, 0x2004, 0xd08c, 0x1138, 0x2001, 0x0108, 0x2004, 0xd0bc,
-	0x1110, 0x703f, 0x0000, 0x080c, 0x949d, 0x00ee, 0x0005, 0x0026,
-	0x7010, 0x9c06, 0x1178, 0x080c, 0x935d, 0x6044, 0xc0fc, 0x6046,
-	0x600c, 0x9015, 0x0120, 0x7212, 0x600f, 0x0000, 0x0010, 0x7212,
-	0x720e, 0x9006, 0x002e, 0x0005, 0x0026, 0x7020, 0x9c06, 0x1178,
-	0x080c, 0x935d, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120,
-	0x7222, 0x600f, 0x0000, 0x0010, 0x7222, 0x721e, 0x9006, 0x002e,
-	0x0005, 0x00d6, 0x0036, 0x7830, 0x9c06, 0x1558, 0x2069, 0x0100,
-	0x68c0, 0x9005, 0x01f8, 0x080c, 0x81e3, 0x080c, 0x8f9c, 0x68c3,
-	0x0000, 0x080c, 0x9487, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x9085,
-	0x0001, 0x0038, 0x7808, 0xc0ad, 0x780a, 0x6003, 0x0009, 0x630a,
-	0x9006, 0x003e, 0x00de, 0x0005, 0x0016, 0x0026, 0x0036, 0x6100,
-	0x2019, 0x0100, 0x2001, 0x0382, 0x2004, 0xd09c, 0x0190, 0x00c6,
-	0x0126, 0x2091, 0x2800, 0x0016, 0x0036, 0x080c, 0x9913, 0x003e,
-	0x001e, 0x012e, 0x00ce, 0x6200, 0x2200, 0x9106, 0x0d58, 0x2200,
-	0x0010, 0x8319, 0x1d38, 0x003e, 0x002e, 0x001e, 0x0005, 0x00d6,
-	0x0156, 0x080c, 0x8d43, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100,
-	0x700b, 0x0003, 0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007,
-	0x0000, 0x2069, 0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110,
-	0xc38d, 0x0060, 0x080c, 0x70ac, 0x1110, 0xc3ad, 0x0008, 0xc3a5,
-	0x6ad8, 0xd29c, 0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x2011,
-	0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019,
-	0x1841, 0x2071, 0x0250, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398,
-	0x0002, 0x9290, 0x0002, 0x1f04, 0x9af3, 0x60c3, 0x0020, 0x080c,
-	0x8f6c, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x8d43, 0x7a14,
-	0x82ff, 0x0168, 0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238,
-	0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003,
-	0x0200, 0x7007, 0x001c, 0x700f, 0x0001, 0x2011, 0x198e, 0x2204,
-	0x8007, 0x701a, 0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120,
-	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7022,
-	0x2001, 0x181f, 0x2004, 0x7026, 0x0030, 0x2001, 0x1817, 0x2004,
-	0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
-	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c,
-	0x015e, 0x0804, 0x8f6c, 0x0006, 0x2001, 0x1836, 0x2004, 0xd0ac,
-	0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0x931e, 0x2011, 0x0002,
-	0x080c, 0x9328, 0x080c, 0x91eb, 0x0036, 0x901e, 0x080c, 0x926b,
-	0x003e, 0x0005, 0x2071, 0x1883, 0x7000, 0x9005, 0x0140, 0x2001,
-	0x0812, 0x2071, 0x1800, 0x7072, 0x7076, 0x7067, 0xffd4, 0x2071,
-	0x1800, 0x7070, 0x7052, 0x7057, 0x1ddc, 0x0005, 0x00e6, 0x0126,
-	0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0010, 0x0608,
-	0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c,
-	0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003,
-	0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064, 0x9502, 0x1230,
-	0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1ddc,
-	0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7550, 0x9582,
-	0x0010, 0x0600, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148,
+	0x6827, 0x0001, 0x9085, 0x0001, 0x0038, 0x7808, 0xc0ad, 0x780a,
+	0x6003, 0x0009, 0x630a, 0x9006, 0x003e, 0x00de, 0x0005, 0x0016,
+	0x0026, 0x0036, 0x6100, 0x2019, 0x0100, 0x2001, 0x0382, 0x2004,
+	0xd09c, 0x0190, 0x00c6, 0x0126, 0x2091, 0x2800, 0x0016, 0x0036,
+	0x080c, 0x992e, 0x003e, 0x001e, 0x012e, 0x00ce, 0x6200, 0x2200,
+	0x9106, 0x0d58, 0x2200, 0x0010, 0x8319, 0x1d38, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x00d6, 0x0156, 0x080c, 0x8d6b, 0x7a14, 0x82ff,
+	0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0490,
+	0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800, 0x901e, 0x6800,
+	0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c, 0x70b7, 0x1110,
+	0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c, 0x1110, 0xd2ac, 0x0108,
+	0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006,
+	0x2011, 0x1840, 0x2019, 0x1841, 0x2071, 0x0250, 0x2376, 0x8e70,
+	0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x9b0e,
+	0x60c3, 0x0020, 0x080c, 0x8f87, 0x015e, 0x00de, 0x0005, 0x0156,
+	0x080c, 0x8d6b, 0x7a14, 0x82ff, 0x0168, 0x9286, 0xffff, 0x0118,
+	0x9282, 0x000e, 0x1238, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3,
+	0x0008, 0x0488, 0x7003, 0x0200, 0x7007, 0x001c, 0x700f, 0x0001,
+	0x2011, 0x198e, 0x2204, 0x8007, 0x701a, 0x8210, 0x2204, 0x8007,
+	0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
+	0x181e, 0x2004, 0x7022, 0x2001, 0x181f, 0x2004, 0x7026, 0x0030,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256,
+	0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x8f87, 0x0006, 0x2001,
+	0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003, 0x080c,
+	0x9339, 0x2011, 0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x0036,
+	0x901e, 0x080c, 0x9286, 0x003e, 0x0005, 0x2071, 0x1883, 0x7000,
+	0x9005, 0x0140, 0x2001, 0x0812, 0x2071, 0x1800, 0x7072, 0x7076,
+	0x7067, 0xffd4, 0x2071, 0x1800, 0x7070, 0x7052, 0x7057, 0x1ddc,
+	0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550,
+	0x9582, 0x0010, 0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000,
+	0x0148, 0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061,
+	0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c,
+	0x7064, 0x9502, 0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee,
+	0x0005, 0x7057, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071,
+	0x1800, 0x7550, 0x9582, 0x0010, 0x0600, 0x7054, 0x2060, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208,
+	0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552,
+	0x9ca8, 0x001c, 0x7064, 0x9502, 0x1228, 0x7556, 0x9085, 0x0001,
+	0x00ee, 0x0005, 0x7057, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82,
+	0x1ddc, 0x0a0c, 0x0d65, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1a0c,
+	0x0d65, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012,
+	0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x605e, 0x6062, 0x6026,
+	0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x604a, 0x6046,
+	0x6042, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x0005, 0x9006,
+	0x600e, 0x6016, 0x601a, 0x6012, 0x6022, 0x6002, 0x601e, 0x605e,
+	0x6062, 0x604a, 0x6046, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052,
+	0x0005, 0x0006, 0x6000, 0x9086, 0x0000, 0x01d0, 0x601c, 0xd084,
+	0x190c, 0x1914, 0x6023, 0x0007, 0x2001, 0x1957, 0x2004, 0x0006,
+	0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xd4ce,
+	0x604b, 0x0000, 0x6044, 0xd0fc, 0x1129, 0x9006, 0x6046, 0x6016,
+	0x000e, 0x0005, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8, 0x2001,
+	0x19cb, 0x2004, 0x9c06, 0x1130, 0x0036, 0x2019, 0x0001, 0x080c,
+	0x9286, 0x003e, 0x080c, 0x94b8, 0x010e, 0x190c, 0x98e4, 0x0005,
+	0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582,
+	0x0001, 0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148,
 	0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc,
 	0x0c98, 0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064,
-	0x9502, 0x1228, 0x7556, 0x9085, 0x0001, 0x00ee, 0x0005, 0x7057,
-	0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x1ddc, 0x0a0c, 0x0d65,
-	0x2001, 0x1819, 0x2004, 0x9c02, 0x1a0c, 0x0d65, 0x9006, 0x6006,
-	0x600a, 0x600e, 0x6016, 0x601a, 0x6012, 0x6023, 0x0000, 0x6003,
-	0x0000, 0x601e, 0x605e, 0x6062, 0x6026, 0x602a, 0x602e, 0x6032,
-	0x6036, 0x603a, 0x603e, 0x604a, 0x6046, 0x6042, 0x2061, 0x1800,
-	0x6050, 0x8000, 0x6052, 0x0005, 0x9006, 0x600e, 0x6016, 0x601a,
-	0x6012, 0x6022, 0x6002, 0x601e, 0x605e, 0x6062, 0x604a, 0x6046,
-	0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x0005, 0x0006, 0x6000,
-	0x9086, 0x0000, 0x01d0, 0x601c, 0xd084, 0x190c, 0x1914, 0x6023,
-	0x0007, 0x2001, 0x1957, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e,
-	0x0208, 0x8004, 0x601a, 0x080c, 0xd4ac, 0x604b, 0x0000, 0x6044,
-	0xd0fc, 0x1129, 0x9006, 0x6046, 0x6016, 0x000e, 0x0005, 0x080c,
-	0x990b, 0x0106, 0x190c, 0x98ad, 0x2001, 0x19cb, 0x2004, 0x9c06,
-	0x1130, 0x0036, 0x2019, 0x0001, 0x080c, 0x926b, 0x003e, 0x080c,
-	0x949d, 0x010e, 0x190c, 0x98c9, 0x0005, 0x00e6, 0x0126, 0x2071,
-	0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0001, 0x0608, 0x7054,
-	0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7064,
-	0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008,
-	0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064, 0x9502, 0x1230, 0x7556,
-	0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1ddc, 0x0cc0,
-	0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002, 0x9c7e, 0x9c88,
-	0x9ca3, 0x9cbe, 0xbf90, 0xbfad, 0xbfc8, 0x9c7e, 0x9c88, 0x9c7e,
-	0x9cda, 0x9c7e, 0x9c7e, 0x9c7e, 0x9c7e, 0x9c7e, 0x9186, 0x0013,
-	0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c, 0x884c, 0x0005, 0x0005,
-	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e,
-	0x0005, 0x9ca1, 0xa3e9, 0xa5bb, 0x9ca1, 0xa649, 0x9fa3, 0x9ca1,
-	0x9ca1, 0xa36b, 0xabee, 0x9ca1, 0x9ca1, 0x9ca1, 0x9ca1, 0x9ca1,
-	0x9ca1, 0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
-	0x0d65, 0x0013, 0x006e, 0x0005, 0x9cbc, 0xb1f9, 0x9cbc, 0x9cbc,
-	0x9cbc, 0x9cbc, 0x9cbc, 0x9cbc, 0xb19e, 0xb37c, 0x9cbc, 0xb236,
-	0xb2ba, 0xb236, 0xb2ba, 0x9cbc, 0x080c, 0x0d65, 0x6000, 0x9082,
-	0x0016, 0x1a0c, 0x0d65, 0x6000, 0x0002, 0x9cd8, 0xac38, 0xaccf,
-	0xae4f, 0xaebe, 0x9cd8, 0x9cd8, 0x9cd8, 0xac07, 0xb11f, 0xb122,
-	0x9cd8, 0x9cd8, 0x9cd8, 0x9cd8, 0xb152, 0x9cd8, 0x9cd8, 0x9cd8,
-	0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65,
-	0x0013, 0x006e, 0x0005, 0x9cf3, 0x9cf3, 0x9d31, 0x9dd0, 0x9e50,
-	0x9cf3, 0x9cf3, 0x9cf3, 0x9cf5, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3,
-	0x9cf3, 0x9cf3, 0x9cf3, 0x080c, 0x0d65, 0x9186, 0x004c, 0x0560,
-	0x9186, 0x0003, 0x190c, 0x0d65, 0x0096, 0x601c, 0xc0ed, 0x601e,
-	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000,
-	0xc0b5, 0xa87e, 0xa8ac, 0xa836, 0xa8b0, 0xa83a, 0x9006, 0xa846,
-	0xa84a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
-	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x080c, 0x1a64, 0x2009,
-	0x8030, 0x080c, 0x84f0, 0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0,
-	0x00be, 0x2c00, 0x080c, 0x9e72, 0x080c, 0xbf5e, 0x6003, 0x0007,
-	0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079, 0x1800, 0x7a8c, 0x6014,
-	0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc,
-	0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220,
-	0xa87b, 0x0007, 0x2010, 0x0028, 0xa87b, 0x0015, 0x0010, 0xa87b,
-	0x0000, 0x8214, 0xa883, 0x0000, 0xaa02, 0x0006, 0x0016, 0x0026,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400, 0x9005, 0x1108, 0x009a,
-	0x2100, 0x9086, 0x0015, 0x1118, 0x2001, 0x0001, 0x0038, 0x2100,
-	0x9086, 0x0016, 0x0118, 0x2001, 0x0001, 0x002a, 0x94a4, 0x0007,
-	0x8423, 0x9405, 0x0002, 0x9d98, 0x9d98, 0x9d93, 0x9d96, 0x9d98,
-	0x9d90, 0x9d83, 0x9d83, 0x9d83, 0x9d83, 0x9d83, 0x9d83, 0x9d83,
-	0x9d83, 0x9d83, 0x9d83, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e,
-	0x001e, 0x000e, 0x004e, 0x00fe, 0x009e, 0x00de, 0x080c, 0x0d65,
-	0x080c, 0xa82a, 0x0028, 0x080c, 0xa94d, 0x0010, 0x080c, 0xaa3c,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896,
-	0x000e, 0x080c, 0x9f30, 0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050,
-	0xb100, 0x00ae, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031,
-	0x0000, 0x2041, 0x1280, 0x080c, 0xa0da, 0x0160, 0x000e, 0x9005,
-	0x0120, 0x00fe, 0x009e, 0x00de, 0x0005, 0x00fe, 0x009e, 0x00de,
-	0x0804, 0x9bcc, 0x2001, 0x002c, 0x900e, 0x080c, 0x9f96, 0x0c70,
-	0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047,
-	0x0a0c, 0x0d65, 0x91b2, 0x0050, 0x1a0c, 0x0d65, 0x9182, 0x0047,
-	0x0042, 0x080c, 0x9a9c, 0x0120, 0x9086, 0x0002, 0x0904, 0x9d31,
-	0x0005, 0x9df2, 0x9df2, 0x9df4, 0x9e26, 0x9df2, 0x9df2, 0x9df2,
-	0x9df2, 0x9e39, 0x080c, 0x0d65, 0x00d6, 0x0016, 0x0096, 0x6003,
-	0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0, 0xa878, 0xc0fc,
-	0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001, 0x0000, 0x900e,
-	0x080c, 0x9f96, 0x080c, 0x9bcc, 0x00a8, 0x6003, 0x0002, 0xa8a4,
-	0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78, 0xa87f, 0x0020,
-	0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2, 0xa8c7, 0x0000,
-	0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005, 0x080c, 0x88a9,
-	0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xb82c, 0x0120, 0xa87b,
-	0x0006, 0x080c, 0x698f, 0x009e, 0x00de, 0x080c, 0x9bcc, 0x0804,
-	0x890e, 0x080c, 0x88a9, 0x080c, 0x3003, 0x080c, 0xbf5b, 0x00d6,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xb82c, 0x0120, 0xa87b, 0x0029,
-	0x080c, 0x698f, 0x009e, 0x00de, 0x080c, 0x9bcc, 0x0804, 0x890e,
-	0x9182, 0x0047, 0x0002, 0x9e60, 0x9e62, 0x9e60, 0x9e60, 0x9e60,
-	0x9e60, 0x9e60, 0x9e60, 0x9e60, 0x9e60, 0x9e60, 0x9e60, 0x9e62,
-	0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c, 0x1595, 0x6114, 0x2148,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x698f, 0x009e, 0x00de,
-	0x0804, 0x9bcc, 0x0026, 0x0036, 0x0056, 0x0066, 0x0096, 0x00a6,
-	0x00f6, 0x0006, 0x080c, 0x1022, 0x000e, 0x090c, 0x0d65, 0xa960,
-	0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020,
-	0x4104, 0xa87a, 0x2079, 0x1800, 0x798c, 0x9188, 0x0018, 0x918c,
-	0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034, 0x1228, 0x2011,
-	0x001f, 0x080c, 0xb3ff, 0x04c0, 0x2130, 0x2009, 0x0034, 0x2011,
-	0x001f, 0x080c, 0xb3ff, 0x96b2, 0x0034, 0xb004, 0x904d, 0x0110,
-	0x080c, 0x0fd4, 0x080c, 0x1022, 0x01d0, 0x8528, 0xa867, 0x0110,
-	0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1230, 0x2608,
-	0x2011, 0x001b, 0x080c, 0xb3ff, 0x00b8, 0x96b2, 0x003c, 0x2009,
-	0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb3ff, 0x0c18, 0x2001,
+	0x9502, 0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005,
+	0x7057, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f,
+	0x0002, 0x9c99, 0x9ca3, 0x9cbe, 0x9cd9, 0xbfab, 0xbfc8, 0xbfe3,
+	0x9c99, 0x9ca3, 0x9c99, 0x9cf5, 0x9c99, 0x9c99, 0x9c99, 0x9c99,
+	0x9c99, 0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c,
+	0x8874, 0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0d65, 0x0013, 0x006e, 0x0005, 0x9cbc, 0xa404, 0xa5d6, 0x9cbc,
+	0xa664, 0x9fbe, 0x9cbc, 0x9cbc, 0xa386, 0xac09, 0x9cbc, 0x9cbc,
+	0x9cbc, 0x9cbc, 0x9cbc, 0x9cbc, 0x080c, 0x0d65, 0x0066, 0x6000,
+	0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9cd7,
+	0xb214, 0x9cd7, 0x9cd7, 0x9cd7, 0x9cd7, 0x9cd7, 0x9cd7, 0xb1b9,
+	0xb397, 0x9cd7, 0xb251, 0xb2d5, 0xb251, 0xb2d5, 0x9cd7, 0x080c,
+	0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65, 0x6000, 0x0002,
+	0x9cf3, 0xac53, 0xacea, 0xae6a, 0xaed9, 0x9cf3, 0x9cf3, 0x9cf3,
+	0xac22, 0xb13a, 0xb13d, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0xb16d,
+	0x9cf3, 0x9cf3, 0x9cf3, 0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9d0e, 0x9d0e,
+	0x9d4c, 0x9deb, 0x9e6b, 0x9d0e, 0x9d0e, 0x9d0e, 0x9d10, 0x9d0e,
+	0x9d0e, 0x9d0e, 0x9d0e, 0x9d0e, 0x9d0e, 0x9d0e, 0x080c, 0x0d65,
+	0x9186, 0x004c, 0x0560, 0x9186, 0x0003, 0x190c, 0x0d65, 0x0096,
+	0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048,
+	0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa836, 0xa8b0,
+	0xa83a, 0x9006, 0xa846, 0xa84a, 0xa884, 0x9092, 0x199a, 0x0210,
+	0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x009e,
+	0x080c, 0x1a64, 0x2009, 0x8030, 0x080c, 0x8518, 0x0005, 0x6010,
+	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0x9e8d, 0x080c,
+	0xbf79, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079,
+	0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290,
+	0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc,
+	0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010, 0x0028, 0xa87b,
+	0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883, 0x0000, 0xaa02,
+	0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400,
+	0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118, 0x2001,
+	0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001, 0x0001,
+	0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0x9db3, 0x9db3,
+	0x9dae, 0x9db1, 0x9db3, 0x9dab, 0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e,
+	0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e,
+	0x00de, 0x080c, 0x0d65, 0x080c, 0xa845, 0x0028, 0x080c, 0xa968,
+	0x0010, 0x080c, 0xaa57, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e,
+	0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0x9f4b, 0x0530, 0xa804,
+	0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0,
+	0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x1280, 0x080c, 0xa0f5,
+	0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005,
+	0x00fe, 0x009e, 0x00de, 0x0804, 0x9be7, 0x2001, 0x002c, 0x900e,
+	0x080c, 0x9fb1, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016,
+	0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0d65, 0x91b2, 0x0050, 0x1a0c,
+	0x0d65, 0x9182, 0x0047, 0x0042, 0x080c, 0x9ab7, 0x0120, 0x9086,
+	0x0002, 0x0904, 0x9d4c, 0x0005, 0x9e0d, 0x9e0d, 0x9e0f, 0x9e41,
+	0x9e0d, 0x9e0d, 0x9e0d, 0x9e0d, 0x9e54, 0x080c, 0x0d65, 0x00d6,
+	0x0016, 0x0096, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc,
+	0x01c0, 0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140,
+	0x2001, 0x0000, 0x900e, 0x080c, 0x9fb1, 0x080c, 0x9be7, 0x00a8,
+	0x6003, 0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2,
+	0x0c78, 0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8,
+	0xa8b2, 0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de,
+	0x0005, 0x080c, 0x88d1, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xb847, 0x0120, 0xa87b, 0x0006, 0x080c, 0x6996, 0x009e, 0x00de,
+	0x080c, 0x9be7, 0x0804, 0x8936, 0x080c, 0x88d1, 0x080c, 0x3006,
+	0x080c, 0xbf76, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xb847,
+	0x0120, 0xa87b, 0x0029, 0x080c, 0x6996, 0x009e, 0x00de, 0x080c,
+	0x9be7, 0x0804, 0x8936, 0x9182, 0x0047, 0x0002, 0x9e7b, 0x9e7d,
+	0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b,
+	0x9e7b, 0x9e7b, 0x9e7d, 0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c,
+	0x1595, 0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c,
+	0x6996, 0x009e, 0x00de, 0x0804, 0x9be7, 0x0026, 0x0036, 0x0056,
+	0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x1022, 0x000e,
+	0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0,
+	0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x798c,
+	0x9188, 0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6,
+	0x2001, 0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182,
+	0x0034, 0x1228, 0x2011, 0x001f, 0x080c, 0xb41a, 0x04c0, 0x2130,
+	0x2009, 0x0034, 0x2011, 0x001f, 0x080c, 0xb41a, 0x96b2, 0x0034,
+	0xb004, 0x904d, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022, 0x01d0,
+	0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a,
+	0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb41a, 0x00b8,
+	0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c,
+	0xb41a, 0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
+	0x95ad, 0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001,
 	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566,
-	0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000,
-	0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48, 0xa804, 0xa807,
-	0x0000, 0x0006, 0x080c, 0x698f, 0x000e, 0x2048, 0x9005, 0x1db0,
-	0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e, 0x002e, 0x0005,
-	0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x1022, 0x000e, 0x090c,
-	0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
-	0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a, 0x2079, 0x1800, 0x798c,
-	0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210, 0x2009, 0x001a,
-	0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c, 0x9080, 0x001f,
-	0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x4003,
-	0x2003, 0x0000, 0x080c, 0x698f, 0x009e, 0x00fe, 0x00de, 0x0005,
-	0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001, 0x0205, 0x200c,
-	0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200, 0x2e98, 0xa87c,
-	0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021, 0x003e, 0x901e,
-	0x9282, 0x0020, 0x0218, 0x2011, 0x0020, 0x2018, 0x9486, 0x003e,
-	0x1170, 0x0096, 0x080c, 0x1022, 0x2900, 0x009e, 0x05c0, 0xa806,
-	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x3300,
-	0x908e, 0x0260, 0x0140, 0x2009, 0x0280, 0x9102, 0x920a, 0x0218,
-	0x2010, 0x2100, 0x9318, 0x2200, 0x9402, 0x1228, 0x2400, 0x9202,
-	0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800, 0x9200, 0xa802,
-	0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300, 0x9086, 0x0280,
-	0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x2e98, 0x2310,
-	0x84ff, 0x0904, 0x9f45, 0x0804, 0x9f47, 0x9085, 0x0001, 0x7817,
-	0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005, 0x00d6, 0x0036,
-	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c, 0x6983, 0x009e,
-	0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118, 0x080c, 0x9bcc,
-	0x0030, 0x91b6, 0x0016, 0x190c, 0x0d65, 0x080c, 0x9bcc, 0x0005,
-	0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014, 0x0096, 0x2048,
-	0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003, 0x0136, 0x9080,
-	0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418, 0x8318, 0x23a0,
-	0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8, 0x2011, 0x0006,
-	0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003, 0x3418, 0x8318,
-	0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xb82c, 0x0130, 0x6014,
-	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e, 0x0804, 0x9bcc,
-	0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200, 0x11a8, 0x6010,
-	0x00b6, 0x2058, 0xb8c7, 0x0000, 0x00be, 0x6014, 0x9005, 0x0130,
-	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32, 0x080c, 0x9bcc,
-	0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48, 0x0cc8, 0x0006,
-	0x0016, 0x080c, 0xbf46, 0x0188, 0x6014, 0x9005, 0x1170, 0x600b,
-	0x0003, 0x601b, 0x0000, 0x604b, 0x0000, 0x2009, 0x0022, 0x080c,
-	0xa3c1, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085, 0x0001, 0x0cd0,
-	0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c, 0x20e1, 0x0000,
-	0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
-	0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001, 0x2099, 0x0260,
-	0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804, 0x2048, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205,
-	0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020, 0x4003, 0x2003,
-	0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x080c,
-	0x9bcc, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016, 0x900e, 0x7030,
-	0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff, 0x800c, 0x703c,
-	0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108, 0x810b, 0x2011,
-	0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c, 0xb3ff, 0x080c,
-	0xb82c, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000, 0xa864, 0xa8e2,
-	0xa867, 0x0103, 0x080c, 0x9bcc, 0x001e, 0x009e, 0x0005, 0x0016,
-	0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004, 0x0010,
-	0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c, 0x6014,
-	0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c, 0xb3ff,
-	0x009e, 0x080c, 0xb82c, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807,
-	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9bcc, 0x009e,
-	0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100,
-	0x1118, 0x080c, 0xa574, 0x00e0, 0xa034, 0x8007, 0x800c, 0x8806,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x000c,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c,
-	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1266, 0x0019, 0x0d08,
-	0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x1022, 0x000e, 0x01b0,
-	0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800,
-	0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086,
-	0x2940, 0x080c, 0x110c, 0x008e, 0x9085, 0x0001, 0x009e, 0x0005,
-	0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6,
-	0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210, 0x00b6,
-	0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x604b, 0x0000, 0x2c68,
-	0x0016, 0x2009, 0x0035, 0x080c, 0xbebe, 0x001e, 0x1158, 0x622c,
-	0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386,
-	0x0006, 0x0128, 0x080c, 0x9bcc, 0x0020, 0x0039, 0x0010, 0x080c,
-	0xa1f6, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048,
-	0x9186, 0x0015, 0x0904, 0xa1d5, 0x918e, 0x0016, 0x1904, 0xa1f4,
-	0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300,
-	0x1904, 0xa1af, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904,
-	0xa191, 0x0804, 0xa1f2, 0x6808, 0x9086, 0xffff, 0x1904, 0xa1d7,
-	0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940,
-	0x9105, 0x1904, 0xa1d7, 0x6824, 0xd0b4, 0x1904, 0xa1d7, 0x080c,
-	0xba1b, 0x6864, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e,
-	0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x83f1, 0xa884,
-	0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6,
-	0x2d60, 0x080c, 0xb552, 0x00ce, 0x0804, 0xa1f2, 0x00c6, 0xa868,
-	0xd0fc, 0x1118, 0x080c, 0x5d4f, 0x0010, 0x080c, 0x60f4, 0x00ce,
-	0x1904, 0xa1d7, 0x00c6, 0x2d60, 0x080c, 0x9bcc, 0x00ce, 0x0804,
-	0xa1f2, 0x00c6, 0x080c, 0x9c3d, 0x0198, 0x6017, 0x0000, 0x6810,
-	0x6012, 0x080c, 0xbcc0, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60,
-	0x080c, 0x9bcc, 0x00ce, 0x080c, 0x9c6a, 0x00ce, 0x0804, 0xa1f2,
-	0x2001, 0x1959, 0x2004, 0x684a, 0x00ce, 0x0804, 0xa1f2, 0x7008,
-	0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc,
-	0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xbf00,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020,
-	0x080c, 0x84a9, 0x00ce, 0x0430, 0x700c, 0x9086, 0x2a00, 0x1138,
-	0x2001, 0x1959, 0x2004, 0x684a, 0x00e8, 0x04c1, 0x00e8, 0x89ff,
-	0x090c, 0x0d65, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b,
-	0x0003, 0x080c, 0x67a5, 0x080c, 0xba1b, 0x080c, 0x9c06, 0x0026,
-	0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c, 0x6394, 0x00be, 0x002e,
-	0x00de, 0x00ce, 0x080c, 0x9bcc, 0x009e, 0x0005, 0x9186, 0x0015,
-	0x1128, 0x2001, 0x1959, 0x2004, 0x684a, 0x0068, 0x918e, 0x0016,
-	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xd4ac, 0x080c, 0x8398,
-	0x080c, 0x9bcc, 0x00ce, 0x080c, 0x9bcc, 0x0005, 0x0026, 0x0036,
-	0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1959,
-	0x2004, 0x684a, 0x0804, 0xa270, 0x00c6, 0x2d60, 0x080c, 0xb42a,
-	0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
-	0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c, 0x84a9,
-	0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c,
-	0x0d65, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178,
-	0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001,
-	0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c,
-	0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838,
-	0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306,
-	0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a,
-	0x2001, 0x0005, 0x6832, 0x080c, 0xbbaa, 0x080c, 0x890e, 0x0010,
-	0x080c, 0x9bcc, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
-	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
-	0x00be, 0x9206, 0x1904, 0xa2db, 0x700c, 0x6210, 0x00b6, 0x2258,
-	0xba14, 0x00be, 0x9206, 0x1904, 0xa2db, 0x6038, 0x2068, 0x6824,
-	0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xa2db, 0x9286,
-	0x0002, 0x0904, 0xa2db, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c,
-	0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e,
-	0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b,
-	0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186,
-	0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048,
-	0x080c, 0xb82c, 0x090c, 0x0d65, 0xa87b, 0x0003, 0x009e, 0x080c,
-	0xbf00, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009,
-	0x8020, 0x080c, 0x84a9, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001,
-	0x1959, 0x2004, 0x704a, 0x080c, 0x9bcc, 0x002e, 0x00de, 0x00ee,
-	0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058,
-	0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02,
-	0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010,
-	0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xabc4, 0x002e, 0x003e,
-	0x015e, 0x009e, 0x1904, 0xa34a, 0x0096, 0x0156, 0x0036, 0x0026,
-	0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c,
-	0xabc4, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a,
-	0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128,
-	0x00fe, 0x009e, 0x00be, 0x0804, 0x9fdb, 0x0096, 0x2048, 0xaa12,
-	0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
-	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1266, 0x080c, 0xa0da,
-	0x0130, 0x00fe, 0x009e, 0x080c, 0x9bcc, 0x00be, 0x0005, 0x080c,
-	0xa574, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x3003, 0x080c, 0xbf5b,
-	0x00fe, 0x00c6, 0x080c, 0x9b76, 0x2f00, 0x6012, 0x6017, 0x0000,
-	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007,
-	0x080c, 0x61ba, 0x080c, 0x61e6, 0x080c, 0x84b0, 0x080c, 0x890e,
-	0x00ce, 0x0804, 0xa31d, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0d65,
-	0x91b2, 0x0040, 0x1a04, 0xa3d3, 0x0002, 0xa3c1, 0xa3c1, 0xa3b7,
-	0xa3c1, 0xa3c1, 0xa3c1, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5,
-	0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5,
-	0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5,
-	0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3c1, 0xa3b5, 0xa3c1, 0xa3c1,
-	0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b7, 0xa3b5, 0xa3b5,
-	0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3c1,
-	0xa3c1, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5, 0xa3b5,
-	0xa3b5, 0xa3b5, 0xa3c1, 0xa3b5, 0xa3b5, 0x080c, 0x0d65, 0x0066,
-	0x00b6, 0x6610, 0x2658, 0xb8c4, 0xc08c, 0xb8c6, 0x00be, 0x006e,
-	0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c,
-	0x84b0, 0x0010, 0x080c, 0x84a9, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x890e, 0x012e, 0x0005, 0x2600, 0x0002, 0xa3e7, 0xa3e7, 0xa3e7,
-	0xa3c1, 0xa3c1, 0xa3e7, 0xa3e7, 0xa3e7, 0xa3e7, 0xa3c1, 0xa3e7,
-	0xa3c1, 0xa3e7, 0xa3c1, 0xa3e7, 0xa3e7, 0xa3e7, 0xa3e7, 0x080c,
-	0x0d65, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d65, 0x91b6, 0x0013,
-	0x0904, 0xa4be, 0x91b6, 0x0027, 0x1904, 0xa46a, 0x080c, 0x884c,
-	0x6004, 0x080c, 0xba30, 0x01b0, 0x080c, 0xba41, 0x01a8, 0x908e,
-	0x0021, 0x0904, 0xa467, 0x908e, 0x0022, 0x1130, 0x080c, 0xa007,
-	0x0904, 0xa463, 0x0804, 0xa464, 0x908e, 0x003d, 0x0904, 0xa467,
-	0x0804, 0xa45d, 0x080c, 0x3034, 0x2001, 0x0007, 0x080c, 0x61ba,
-	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa574, 0x9186,
-	0x007e, 0x1148, 0x2001, 0x1836, 0x2014, 0xc285, 0x080c, 0x70ac,
-	0x1108, 0xc2ad, 0x2202, 0x080c, 0x98ad, 0x0036, 0x0026, 0x2019,
-	0x0028, 0x2110, 0x080c, 0xd507, 0x002e, 0x003e, 0x0016, 0x0026,
-	0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x8613, 0x0076, 0x903e,
-	0x080c, 0x8502, 0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08,
-	0x080c, 0xcfa6, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0x98c9,
-	0x080c, 0xbf5b, 0x0016, 0x080c, 0xbcb8, 0x080c, 0x9bcc, 0x001e,
-	0x080c, 0x3113, 0x080c, 0x890e, 0x0030, 0x080c, 0xbcb8, 0x080c,
-	0x9bcc, 0x080c, 0x890e, 0x0005, 0x080c, 0xa574, 0x0cb0, 0x080c,
-	0xa5b0, 0x0c98, 0x9186, 0x0015, 0x0118, 0x9186, 0x0016, 0x1140,
-	0x080c, 0x9a9c, 0x0d80, 0x9086, 0x0002, 0x0904, 0xa5bb, 0x0c58,
-	0x9186, 0x0014, 0x1d40, 0x080c, 0x884c, 0x6004, 0x908e, 0x0022,
-	0x1118, 0x080c, 0xa007, 0x09f8, 0x080c, 0x3003, 0x080c, 0xbf5b,
-	0x080c, 0xba30, 0x1190, 0x080c, 0x3034, 0x6010, 0x00b6, 0x2058,
-	0xb9a0, 0x00be, 0x080c, 0xa574, 0x9186, 0x007e, 0x1128, 0x2001,
-	0x1836, 0x200c, 0xc185, 0x2102, 0x0800, 0x080c, 0xba41, 0x1120,
-	0x080c, 0xa574, 0x0804, 0xa45d, 0x6004, 0x908e, 0x0032, 0x1160,
-	0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x33b5,
-	0x00fe, 0x00ee, 0x0804, 0xa45d, 0x6004, 0x908e, 0x0021, 0x0d40,
-	0x908e, 0x0022, 0x090c, 0xa574, 0x0804, 0xa45d, 0x90b2, 0x0040,
-	0x1a04, 0xa55d, 0x2008, 0x0002, 0xa506, 0xa507, 0xa50a, 0xa50d,
-	0xa510, 0xa513, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504,
-	0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504,
-	0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504,
-	0xa504, 0xa504, 0xa516, 0xa51f, 0xa504, 0xa520, 0xa51f, 0xa504,
-	0xa504, 0xa504, 0xa504, 0xa504, 0xa51f, 0xa51f, 0xa504, 0xa504,
-	0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa504, 0xa548, 0xa51f,
-	0xa504, 0xa51b, 0xa504, 0xa504, 0xa504, 0xa51c, 0xa504, 0xa504,
-	0xa504, 0xa51f, 0xa543, 0xa504, 0x080c, 0x0d65, 0x00c0, 0x2001,
-	0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0, 0x2001, 0x0005, 0x00b8,
-	0x2001, 0x0001, 0x00a0, 0x2001, 0x0009, 0x0088, 0x6003, 0x0005,
-	0x080c, 0x890e, 0x0058, 0x0018, 0x0010, 0x080c, 0x61ba, 0x04b8,
-	0x080c, 0xbf5e, 0x6003, 0x0004, 0x080c, 0x890e, 0x0005, 0x080c,
-	0x61ba, 0x6003, 0x0002, 0x0036, 0x2019, 0x185e, 0x2304, 0x9084,
-	0xff00, 0x1120, 0x2001, 0x1957, 0x201c, 0x0040, 0x8007, 0x909a,
-	0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x003e,
-	0x080c, 0x890e, 0x0c18, 0x080c, 0xbcb8, 0x080c, 0x9bcc, 0x08f0,
-	0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x33b5,
-	0x00fe, 0x00ee, 0x080c, 0x884c, 0x080c, 0x9bcc, 0x0878, 0x6003,
-	0x0002, 0x080c, 0xbf5e, 0x0804, 0x890e, 0x2600, 0x2008, 0x0002,
-	0xa572, 0xa572, 0xa572, 0xa557, 0xa557, 0xa572, 0xa572, 0xa572,
-	0xa572, 0xa557, 0xa572, 0xa557, 0xa572, 0xa557, 0xa572, 0xa572,
-	0xa572, 0xa572, 0x080c, 0x0d65, 0x00e6, 0x0096, 0x0026, 0x0016,
-	0x080c, 0xb82c, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086, 0x0139,
-	0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x5127, 0x0130,
-	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001, 0x0030,
-	0x900e, 0x2011, 0x4005, 0x080c, 0xbe25, 0x0090, 0xa868, 0xd0fc,
-	0x0178, 0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021, 0x0168,
-	0x908e, 0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833, 0x0100,
-	0x001e, 0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0,
-	0x0096, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0xa823,
-	0x8001, 0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804, 0x9084,
-	0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0d65, 0x6604, 0x96b6, 0x004d,
-	0x1120, 0x080c, 0xbd44, 0x0804, 0xa638, 0x6604, 0x96b6, 0x0043,
-	0x1120, 0x080c, 0xbd8d, 0x0804, 0xa638, 0x6604, 0x96b6, 0x004b,
-	0x1120, 0x080c, 0xbdb9, 0x0804, 0xa638, 0x6604, 0x96b6, 0x0033,
-	0x1120, 0x080c, 0xbcda, 0x0804, 0xa638, 0x6604, 0x96b6, 0x0028,
-	0x1120, 0x080c, 0xba7a, 0x0804, 0xa638, 0x6604, 0x96b6, 0x0029,
-	0x1120, 0x080c, 0xbabb, 0x0804, 0xa638, 0x6604, 0x96b6, 0x001f,
-	0x1118, 0x080c, 0x9fb0, 0x04e0, 0x6604, 0x96b6, 0x0000, 0x1118,
-	0x080c, 0xa2e1, 0x04a8, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c,
-	0x9fe8, 0x0470, 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0xa0f8,
-	0x0438, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c, 0xa276, 0x0400,
-	0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xa020, 0x00c8, 0x6604,
-	0x96b6, 0x0044, 0x1118, 0x080c, 0xa05c, 0x0090, 0x6604, 0x96b6,
-	0x0049, 0x1118, 0x080c, 0xa087, 0x0058, 0x91b6, 0x0015, 0x1110,
-	0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804, 0xa8f6,
-	0x00be, 0x0005, 0x080c, 0x9c87, 0x0cd8, 0xa655, 0xa658, 0xa655,
-	0xa69c, 0xa655, 0xa82a, 0xa903, 0xa655, 0xa655, 0xa8d0, 0xa655,
-	0xa8e4, 0x0096, 0x080c, 0x1595, 0x6014, 0x2048, 0xa800, 0x2048,
-	0xa867, 0x0103, 0x009e, 0x0804, 0x9bcc, 0xa001, 0xa001, 0x0005,
-	0x00e6, 0x2071, 0x1800, 0x708c, 0x9086, 0x0074, 0x1540, 0x080c,
-	0xcf77, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128,
-	0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00e9, 0x00be, 0x2001,
-	0x0006, 0x080c, 0x61ba, 0x080c, 0x3034, 0x080c, 0x9bcc, 0x0088,
-	0x2001, 0x000a, 0x080c, 0x61ba, 0x080c, 0x3034, 0x6003, 0x0001,
-	0x6007, 0x0001, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0010, 0x080c,
-	0xa815, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0158, 0x9006,
-	0x080c, 0x61a6, 0x2069, 0x1853, 0x6804, 0x0020, 0x2001, 0x0006,
-	0x080c, 0x61e6, 0x00de, 0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011,
-	0x1823, 0x2204, 0x9086, 0x0074, 0x1904, 0xa7ee, 0x6010, 0x2058,
-	0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xaa47, 0x0804, 0xa753,
-	0x00d6, 0x080c, 0x70ac, 0x0198, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x6684, 0x002e, 0x05c8, 0x080c, 0x539a, 0x1540, 0x6014, 0x2048,
+	0x2a48, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6996, 0x000e,
+	0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e,
+	0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c,
+	0x1022, 0x000e, 0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188,
+	0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a,
+	0x2079, 0x1800, 0x798c, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a,
+	0x0210, 0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98,
+	0xa85c, 0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d,
+	0x0080, 0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6996, 0x009e,
+	0x00fe, 0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016,
+	0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079,
+	0x0200, 0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098,
+	0x2021, 0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011, 0x0020,
+	0x2018, 0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x1022, 0x2900,
+	0x009e, 0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0002, 0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009, 0x0280,
+	0x9102, 0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200, 0x9402,
+	0x1228, 0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8,
+	0xa800, 0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180,
+	0x3300, 0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080,
+	0x7816, 0x2e98, 0x2310, 0x84ff, 0x0904, 0x9f60, 0x0804, 0x9f62,
+	0x9085, 0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e,
+	0x0005, 0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982,
+	0x080c, 0x698a, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015,
+	0x1118, 0x080c, 0x9be7, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0d65,
+	0x080c, 0x9be7, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98,
+	0x6014, 0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e,
+	0x4003, 0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001,
+	0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211,
+	0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398,
+	0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c,
+	0xb847, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0x009e, 0x0804, 0x9be7, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386,
+	0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8c7, 0x0000, 0x00be,
+	0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xab32, 0x080c, 0x9be7, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011,
+	0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xbf61, 0x0188, 0x6014,
+	0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x604b, 0x0000,
+	0x2009, 0x0022, 0x080c, 0xa3dc, 0x9006, 0x001e, 0x000e, 0x0005,
+	0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80,
+	0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003,
+	0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a,
+	0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
+	0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9,
+	0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0x080c, 0x9be7, 0x001e, 0x009e, 0x0005, 0x0096,
+	0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084,
+	0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004,
+	0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048,
+	0x080c, 0xb41a, 0x080c, 0xb847, 0x0140, 0x6014, 0x2048, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9be7, 0x001e,
+	0x009e, 0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118,
+	0x2009, 0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c,
+	0x2019, 0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108,
+	0x2048, 0x080c, 0xb41a, 0x009e, 0x080c, 0xb847, 0x0148, 0xa804,
+	0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103,
+	0x080c, 0x9be7, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030,
+	0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xa58f, 0x00e0, 0xa034,
+	0x8007, 0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
+	0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x1266, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c,
+	0x1022, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2,
+	0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92,
+	0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x110c, 0x008e, 0x9085,
+	0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084,
+	0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520,
+	0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0,
+	0x604b, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xbed9,
+	0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386,
+	0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0x9be7, 0x0020,
+	0x0039, 0x0010, 0x080c, 0xa211, 0x002e, 0x00de, 0x00ee, 0x0005,
+	0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xa1f0, 0x918e,
+	0x0016, 0x1904, 0xa20f, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700,
+	0x0120, 0x9186, 0x0300, 0x1904, 0xa1ca, 0x89ff, 0x1138, 0x6800,
+	0x9086, 0x000f, 0x0904, 0xa1ac, 0x0804, 0xa20d, 0x6808, 0x9086,
+	0xffff, 0x1904, 0xa1f2, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020,
+	0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0xa1f2, 0x6824, 0xd0b4,
+	0x1904, 0xa1f2, 0x080c, 0xba36, 0x6864, 0xa882, 0xa87c, 0xc0dc,
+	0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a,
+	0x080c, 0x8419, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff,
+	0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xb56d, 0x00ce, 0x0804,
+	0xa20d, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5d56, 0x0010,
+	0x080c, 0x60fb, 0x00ce, 0x1904, 0xa1f2, 0x00c6, 0x2d60, 0x080c,
+	0x9be7, 0x00ce, 0x0804, 0xa20d, 0x00c6, 0x080c, 0x9c58, 0x0198,
+	0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0003,
+	0x6904, 0x00c6, 0x2d60, 0x080c, 0x9be7, 0x00ce, 0x080c, 0x9c85,
+	0x00ce, 0x0804, 0xa20d, 0x2001, 0x1959, 0x2004, 0x684a, 0x00ce,
+	0x0804, 0xa20d, 0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6,
+	0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b,
+	0x0003, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ce, 0x0430, 0x700c,
+	0x9086, 0x2a00, 0x1138, 0x2001, 0x1959, 0x2004, 0x684a, 0x00e8,
+	0x04c1, 0x00e8, 0x89ff, 0x090c, 0x0d65, 0x00c6, 0x00d6, 0x2d60,
+	0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x67ac, 0x080c, 0xba36,
+	0x080c, 0x9c21, 0x0026, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c,
+	0x639b, 0x00be, 0x002e, 0x00de, 0x00ce, 0x080c, 0x9be7, 0x009e,
+	0x0005, 0x9186, 0x0015, 0x1128, 0x2001, 0x1959, 0x2004, 0x684a,
+	0x0068, 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c,
+	0xd4ce, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x00ce, 0x080c, 0x9be7,
+	0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4,
+	0x0130, 0x2001, 0x1959, 0x2004, 0x684a, 0x0804, 0xa28b, 0x00c6,
+	0x2d60, 0x080c, 0xb445, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1168,
+	0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009,
+	0x8023, 0x080c, 0x84d1, 0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f,
+	0x01a8, 0x89ff, 0x090c, 0x0d65, 0x6800, 0x9086, 0x0004, 0x1190,
+	0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880,
+	0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400, 0x2001, 0x0007,
+	0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824,
+	0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec,
+	0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d38, 0x7020,
+	0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c, 0xbbc5,
+	0x080c, 0x8936, 0x0010, 0x080c, 0x9be7, 0x004e, 0x003e, 0x002e,
+	0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210,
+	0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904, 0xa2f6, 0x700c,
+	0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x1904, 0xa2f6,
+	0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007,
+	0x0904, 0xa2f6, 0x9286, 0x0002, 0x0904, 0xa2f6, 0x9286, 0x0000,
+	0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8, 0x2071, 0x026c, 0x9186,
+	0x0015, 0x0570, 0x918e, 0x0016, 0x1100, 0x00c6, 0x6038, 0x2060,
+	0x6104, 0x9186, 0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186,
+	0x004d, 0x0190, 0x9186, 0x004e, 0x0178, 0x9186, 0x0052, 0x0160,
+	0x6014, 0x0096, 0x2048, 0x080c, 0xb847, 0x090c, 0x0d65, 0xa87b,
+	0x0003, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ce, 0x0030,
+	0x6038, 0x2070, 0x2001, 0x1959, 0x2004, 0x704a, 0x080c, 0x9be7,
+	0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014,
+	0x2048, 0x6010, 0x2058, 0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c,
+	0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096, 0x0156, 0x0036, 0x0026,
+	0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a, 0x20a9, 0x0004, 0x080c,
+	0xabdf, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904, 0xa365, 0x0096,
+	0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006,
+	0x20a9, 0x0004, 0x080c, 0xabdf, 0x002e, 0x003e, 0x015e, 0x009e,
+	0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02,
+	0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be, 0x0804, 0x9ff6,
+	0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
+	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x1266, 0x080c, 0xa0f5, 0x0130, 0x00fe, 0x009e, 0x080c, 0x9be7,
+	0x00be, 0x0005, 0x080c, 0xa58f, 0x0cb8, 0x2b78, 0x00f6, 0x080c,
+	0x3006, 0x080c, 0xbf76, 0x00fe, 0x00c6, 0x080c, 0x9b91, 0x2f00,
+	0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x2001, 0x0007, 0x080c, 0x61c1, 0x080c, 0x61ed, 0x080c,
+	0x84d8, 0x080c, 0x8936, 0x00ce, 0x0804, 0xa338, 0x2100, 0x91b2,
+	0x0053, 0x1a0c, 0x0d65, 0x91b2, 0x0040, 0x1a04, 0xa3ee, 0x0002,
+	0xa3dc, 0xa3dc, 0xa3d2, 0xa3dc, 0xa3dc, 0xa3dc, 0xa3d0, 0xa3d0,
+	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
+	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
+	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3dc,
+	0xa3d0, 0xa3dc, 0xa3dc, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
+	0xa3d2, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
+	0xa3d0, 0xa3d0, 0xa3dc, 0xa3dc, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
+	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3dc, 0xa3d0, 0xa3d0,
+	0x080c, 0x0d65, 0x0066, 0x00b6, 0x6610, 0x2658, 0xb8c4, 0xc08c,
+	0xb8c6, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001, 0x6106, 0x9186,
+	0x0032, 0x0118, 0x080c, 0x84d8, 0x0010, 0x080c, 0x84d1, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x8936, 0x012e, 0x0005, 0x2600, 0x0002,
+	0xa402, 0xa402, 0xa402, 0xa3dc, 0xa3dc, 0xa402, 0xa402, 0xa402,
+	0xa402, 0xa3dc, 0xa402, 0xa3dc, 0xa402, 0xa3dc, 0xa402, 0xa402,
+	0xa402, 0xa402, 0x080c, 0x0d65, 0x6004, 0x90b2, 0x0053, 0x1a0c,
+	0x0d65, 0x91b6, 0x0013, 0x0904, 0xa4d9, 0x91b6, 0x0027, 0x1904,
+	0xa485, 0x080c, 0x8874, 0x6004, 0x080c, 0xba4b, 0x01b0, 0x080c,
+	0xba5c, 0x01a8, 0x908e, 0x0021, 0x0904, 0xa482, 0x908e, 0x0022,
+	0x1130, 0x080c, 0xa022, 0x0904, 0xa47e, 0x0804, 0xa47f, 0x908e,
+	0x003d, 0x0904, 0xa482, 0x0804, 0xa478, 0x080c, 0x303b, 0x2001,
+	0x0007, 0x080c, 0x61c1, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be,
+	0x080c, 0xa58f, 0x9186, 0x007e, 0x1148, 0x2001, 0x1836, 0x2014,
+	0xc285, 0x080c, 0x70b7, 0x1108, 0xc2ad, 0x2202, 0x080c, 0x98c8,
+	0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xd529, 0x002e,
+	0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c,
+	0x863b, 0x0076, 0x903e, 0x080c, 0x852a, 0x6010, 0x00b6, 0x905d,
+	0x0100, 0x00be, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x003e, 0x002e,
+	0x001e, 0x080c, 0x98e4, 0x080c, 0xbf76, 0x0016, 0x080c, 0xbcd3,
+	0x080c, 0x9be7, 0x001e, 0x080c, 0x311a, 0x080c, 0x8936, 0x0030,
+	0x080c, 0xbcd3, 0x080c, 0x9be7, 0x080c, 0x8936, 0x0005, 0x080c,
+	0xa58f, 0x0cb0, 0x080c, 0xa5cb, 0x0c98, 0x9186, 0x0015, 0x0118,
+	0x9186, 0x0016, 0x1140, 0x080c, 0x9ab7, 0x0d80, 0x9086, 0x0002,
+	0x0904, 0xa5d6, 0x0c58, 0x9186, 0x0014, 0x1d40, 0x080c, 0x8874,
+	0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xa022, 0x09f8, 0x080c,
+	0x3006, 0x080c, 0xbf76, 0x080c, 0xba4b, 0x1190, 0x080c, 0x303b,
+	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa58f, 0x9186,
+	0x007e, 0x1128, 0x2001, 0x1836, 0x200c, 0xc185, 0x2102, 0x0800,
+	0x080c, 0xba5c, 0x1120, 0x080c, 0xa58f, 0x0804, 0xa478, 0x6004,
+	0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079,
+	0x0000, 0x080c, 0x33bc, 0x00fe, 0x00ee, 0x0804, 0xa478, 0x6004,
+	0x908e, 0x0021, 0x0d40, 0x908e, 0x0022, 0x090c, 0xa58f, 0x0804,
+	0xa478, 0x90b2, 0x0040, 0x1a04, 0xa578, 0x2008, 0x0002, 0xa521,
+	0xa522, 0xa525, 0xa528, 0xa52b, 0xa52e, 0xa51f, 0xa51f, 0xa51f,
+	0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f,
+	0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f,
+	0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa531, 0xa53a, 0xa51f,
+	0xa53b, 0xa53a, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa53a,
+	0xa53a, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f,
+	0xa51f, 0xa563, 0xa53a, 0xa51f, 0xa536, 0xa51f, 0xa51f, 0xa51f,
+	0xa537, 0xa51f, 0xa51f, 0xa51f, 0xa53a, 0xa55e, 0xa51f, 0x080c,
+	0x0d65, 0x00c0, 0x2001, 0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0,
+	0x2001, 0x0005, 0x00b8, 0x2001, 0x0001, 0x00a0, 0x2001, 0x0009,
+	0x0088, 0x6003, 0x0005, 0x080c, 0x8936, 0x0058, 0x0018, 0x0010,
+	0x080c, 0x61c1, 0x04b8, 0x080c, 0xbf79, 0x6003, 0x0004, 0x080c,
+	0x8936, 0x0005, 0x080c, 0x61c1, 0x6003, 0x0002, 0x0036, 0x2019,
+	0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1957, 0x201c,
+	0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b,
+	0x9318, 0x631a, 0x003e, 0x080c, 0x8936, 0x0c18, 0x080c, 0xbcd3,
+	0x080c, 0x9be7, 0x08f0, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079,
+	0x0000, 0x080c, 0x33bc, 0x00fe, 0x00ee, 0x080c, 0x8874, 0x080c,
+	0x9be7, 0x0878, 0x6003, 0x0002, 0x080c, 0xbf79, 0x0804, 0x8936,
+	0x2600, 0x2008, 0x0002, 0xa58d, 0xa58d, 0xa58d, 0xa572, 0xa572,
+	0xa58d, 0xa58d, 0xa58d, 0xa58d, 0xa572, 0xa58d, 0xa572, 0xa58d,
+	0xa572, 0xa58d, 0xa58d, 0xa58d, 0xa58d, 0x080c, 0x0d65, 0x00e6,
+	0x0096, 0x0026, 0x0016, 0x080c, 0xb847, 0x0568, 0x6014, 0x2048,
+	0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148,
+	0x080c, 0x512e, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xbe40,
+	0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016, 0x6004,
+	0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150, 0x001e, 0xa867,
+	0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e, 0x00ee, 0x0005,
+	0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005, 0x00b6, 0x6610,
+	0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0d65,
+	0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xbd5f, 0x0804, 0xa653,
+	0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xbda8, 0x0804, 0xa653,
+	0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xbdd4, 0x0804, 0xa653,
+	0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbcf5, 0x0804, 0xa653,
+	0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xba95, 0x0804, 0xa653,
+	0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbad6, 0x0804, 0xa653,
+	0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0x9fcb, 0x04e0, 0x6604,
+	0x96b6, 0x0000, 0x1118, 0x080c, 0xa2fc, 0x04a8, 0x6604, 0x96b6,
+	0x0022, 0x1118, 0x080c, 0xa003, 0x0470, 0x6604, 0x96b6, 0x0035,
+	0x1118, 0x080c, 0xa113, 0x0438, 0x6604, 0x96b6, 0x0039, 0x1118,
+	0x080c, 0xa291, 0x0400, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c,
+	0xa03b, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xa077,
+	0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xa0a2, 0x0058,
+	0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128,
+	0x00be, 0x0804, 0xa911, 0x00be, 0x0005, 0x080c, 0x9ca2, 0x0cd8,
+	0xa670, 0xa673, 0xa670, 0xa6b7, 0xa670, 0xa845, 0xa91e, 0xa670,
+	0xa670, 0xa8eb, 0xa670, 0xa8ff, 0x0096, 0x080c, 0x1595, 0x6014,
+	0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0x9be7,
+	0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708c, 0x9086,
+	0x0074, 0x1540, 0x080c, 0xcf99, 0x11b0, 0x6010, 0x00b6, 0x2058,
+	0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802,
+	0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x61c1, 0x080c, 0x303b,
+	0x080c, 0x9be7, 0x0088, 0x2001, 0x000a, 0x080c, 0x61c1, 0x080c,
+	0x303b, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x84d8, 0x080c,
+	0x8936, 0x0010, 0x080c, 0xa830, 0x00ee, 0x0005, 0x00d6, 0xb800,
+	0xd084, 0x0158, 0x9006, 0x080c, 0x61ad, 0x2069, 0x1853, 0x6804,
+	0x0020, 0x2001, 0x0006, 0x080c, 0x61ed, 0x00de, 0x0005, 0x00b6,
+	0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1904,
+	0xa809, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c,
+	0xaa62, 0x0804, 0xa76e, 0x00d6, 0x080c, 0x70b7, 0x0198, 0x0026,
+	0x2011, 0x0010, 0x080c, 0x668b, 0x002e, 0x05c8, 0x080c, 0x53a1,
+	0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
+	0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x668b, 0x002e,
+	0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xbe40,
+	0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
+	0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x303b, 0x080c,
+	0x9be7, 0x001e, 0x080c, 0x311a, 0x00de, 0x0804, 0xa80a, 0x00de,
+	0x080c, 0xaa57, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510,
+	0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
+	0xbe40, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
+	0x2001, 0x0006, 0x080c, 0x61c1, 0x080c, 0x303b, 0x080c, 0x9be7,
+	0x0804, 0xa80a, 0x080c, 0xa818, 0x6014, 0x9005, 0x0190, 0x2048,
+	0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
+	0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbe40,
+	0x08f8, 0x080c, 0xa80e, 0x0160, 0x9006, 0x080c, 0x61ad, 0x2001,
+	0x0004, 0x080c, 0x61ed, 0x2001, 0x0007, 0x080c, 0x61c1, 0x08a0,
+	0x2001, 0x0004, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0003,
+	0x080c, 0x84d8, 0x080c, 0x8936, 0x0804, 0xa80a, 0xb85c, 0xd0e4,
+	0x01d0, 0x080c, 0xbc6d, 0x080c, 0x70b7, 0x0118, 0xd0dc, 0x1904,
+	0xa730, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x0002,
+	0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x2498, 0x78e2,
+	0x00fe, 0x0804, 0xa730, 0x080c, 0xbcae, 0x2011, 0x1836, 0x2204,
+	0xc0a5, 0x2012, 0x0006, 0x080c, 0xd0fe, 0x000e, 0x1904, 0xa730,
+	0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x61c1, 0x9006, 0x080c,
+	0x61ad, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6,
+	0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff,
+	0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff, 0x00ee,
+	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x246d, 0x00f6, 0x2100,
+	0x900e, 0x080c, 0x2424, 0x795a, 0x00fe, 0x9186, 0x0081, 0x01d8,
+	0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100,
+	0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c,
+	0x246d, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100, 0x900e, 0x080c,
+	0x2424, 0x795a, 0x00fe, 0x8108, 0x080c, 0x6210, 0x2b00, 0x00ce,
+	0x1904, 0xa730, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150,
+	0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d,
+	0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x61c1, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8, 0x080c, 0x8936,
+	0x0008, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac, 0x0005,
+	0x00e6, 0x080c, 0xd582, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c,
+	0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058,
+	0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005,
+	0x2030, 0x2001, 0x0007, 0x080c, 0x61c1, 0x080c, 0x53a1, 0x1120,
+	0x2001, 0x0007, 0x080c, 0x61ed, 0x080c, 0x303b, 0x6020, 0x9086,
+	0x000a, 0x1108, 0x0005, 0x0804, 0x9be7, 0x00b6, 0x00e6, 0x0026,
+	0x0016, 0x2071, 0x1800, 0x708c, 0x9086, 0x0014, 0x1904, 0xa8e2,
+	0x00d6, 0x080c, 0x70b7, 0x0198, 0x0026, 0x2011, 0x0010, 0x080c,
+	0x668b, 0x002e, 0x05c8, 0x080c, 0x53a1, 0x1540, 0x6014, 0x2048,
 	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8, 0x0026,
-	0x2011, 0x8008, 0x080c, 0x6684, 0x002e, 0x0530, 0x6014, 0x2048,
+	0x2011, 0x8008, 0x080c, 0x668b, 0x002e, 0x0530, 0x6014, 0x2048,
 	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0030,
-	0x900e, 0x2011, 0x4009, 0x080c, 0xbe25, 0x0040, 0x6014, 0x2048,
+	0x900e, 0x2011, 0x4009, 0x080c, 0xbe40, 0x0040, 0x6014, 0x2048,
 	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010, 0x2058,
-	0xb9a0, 0x0016, 0x080c, 0x3034, 0x080c, 0x9bcc, 0x001e, 0x080c,
-	0x3113, 0x00de, 0x0804, 0xa7ef, 0x00de, 0x080c, 0xaa3c, 0x6010,
-	0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014, 0x9005, 0x01a8,
-	0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
-	0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbe25, 0x0030, 0xa807,
-	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x2001, 0x0006, 0x080c,
-	0x61ba, 0x080c, 0x3034, 0x080c, 0x9bcc, 0x0804, 0xa7ef, 0x080c,
-	0xa7fd, 0x6014, 0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001, 0x0000,
-	0x900e, 0x2011, 0x4000, 0x080c, 0xbe25, 0x08f8, 0x080c, 0xa7f3,
-	0x0160, 0x9006, 0x080c, 0x61a6, 0x2001, 0x0004, 0x080c, 0x61e6,
-	0x2001, 0x0007, 0x080c, 0x61ba, 0x08a0, 0x2001, 0x0004, 0x080c,
-	0x61ba, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x84b0, 0x080c,
-	0x890e, 0x0804, 0xa7ef, 0xb85c, 0xd0e4, 0x01d0, 0x080c, 0xbc52,
-	0x080c, 0x70ac, 0x0118, 0xd0dc, 0x1904, 0xa715, 0x2011, 0x1836,
-	0x2204, 0xc0ad, 0x2012, 0x2001, 0x0002, 0x00f6, 0x2079, 0x0100,
-	0x78e3, 0x0000, 0x080c, 0x2498, 0x78e2, 0x00fe, 0x0804, 0xa715,
-	0x080c, 0xbc93, 0x2011, 0x1836, 0x2204, 0xc0a5, 0x2012, 0x0006,
-	0x080c, 0xd0dc, 0x000e, 0x1904, 0xa715, 0xc0b5, 0x2012, 0x2001,
-	0x0006, 0x080c, 0x61ba, 0x9006, 0x080c, 0x61a6, 0x00c6, 0x2001,
-	0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6,
-	0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707a, 0x7010,
-	0x78ea, 0x707e, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e,
-	0x00fe, 0x080c, 0x246d, 0x00f6, 0x2100, 0x900e, 0x080c, 0x2424,
-	0x795a, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8,
-	0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936,
-	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x246d, 0x00f6, 0x2079,
-	0x1800, 0x797e, 0x2100, 0x900e, 0x080c, 0x2424, 0x795a, 0x00fe,
-	0x8108, 0x080c, 0x6209, 0x2b00, 0x00ce, 0x1904, 0xa715, 0x6012,
-	0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c,
-	0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001,
-	0x0002, 0x080c, 0x61ba, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
-	0x0002, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0008, 0x0431, 0x00de,
-	0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120,
-	0x2001, 0x1854, 0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xd560,
-	0x0190, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118,
-	0x9284, 0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80,
-	0x1110, 0xb912, 0xba16, 0x00ee, 0x0005, 0x2030, 0x2001, 0x0007,
-	0x080c, 0x61ba, 0x080c, 0x539a, 0x1120, 0x2001, 0x0007, 0x080c,
-	0x61e6, 0x080c, 0x3034, 0x6020, 0x9086, 0x000a, 0x1108, 0x0005,
-	0x0804, 0x9bcc, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1800,
-	0x708c, 0x9086, 0x0014, 0x1904, 0xa8c7, 0x00d6, 0x080c, 0x70ac,
-	0x0198, 0x0026, 0x2011, 0x0010, 0x080c, 0x6684, 0x002e, 0x05c8,
-	0x080c, 0x539a, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
-	0x0103, 0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c,
-	0x6684, 0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009,
-	0x080c, 0xbe25, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
-	0x0103, 0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c,
-	0x3034, 0x080c, 0x9bcc, 0x001e, 0x080c, 0x3113, 0x00de, 0x0804,
-	0xa8cb, 0x00de, 0x080c, 0x539a, 0x1170, 0x6014, 0x9005, 0x1158,
-	0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c,
-	0x4a6e, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x6304,
-	0x080c, 0xa68b, 0x00de, 0x080c, 0xab0d, 0x1588, 0x6010, 0x2058,
-	0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x61ba, 0x0096,
-	0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbe25,
-	0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807,
-	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x3034,
-	0x6020, 0x9086, 0x000a, 0x0138, 0x080c, 0x9bcc, 0x0020, 0x080c,
-	0xa574, 0x080c, 0xa815, 0x001e, 0x002e, 0x00ee, 0x00be, 0x0005,
-	0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001, 0x0002,
-	0x080c, 0x61ba, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x84b0,
-	0x0804, 0x890e, 0x0804, 0xa815, 0x2030, 0x2011, 0x1823, 0x2204,
-	0x9086, 0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007,
-	0x080c, 0x61ba, 0x0804, 0x9bcc, 0x0804, 0xa815, 0x0002, 0xa655,
-	0xa90e, 0xa655, 0xa94d, 0xa655, 0xa9f8, 0xa903, 0xa655, 0xa655,
-	0xaa0b, 0xa655, 0xaa1b, 0x6604, 0x9686, 0x0003, 0x0904, 0xa82a,
-	0x96b6, 0x001e, 0x1110, 0x080c, 0x9bcc, 0x0005, 0x00b6, 0x00d6,
-	0x00c6, 0x080c, 0xaa2b, 0x11a0, 0x9006, 0x080c, 0x61a6, 0x080c,
-	0x3003, 0x080c, 0xbf5b, 0x2001, 0x0002, 0x080c, 0x61ba, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0408,
-	0x2009, 0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058,
-	0xb840, 0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b,
-	0x000a, 0x0078, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
-	0x1900, 0x1108, 0x08a0, 0x080c, 0x3003, 0x080c, 0xbf5b, 0x080c,
-	0xa815, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026,
-	0x9016, 0x080c, 0xaa39, 0x00d6, 0x2069, 0x194d, 0x2d04, 0x9005,
-	0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069,
-	0x181f, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088,
-	0x9006, 0x080c, 0x61a6, 0x2001, 0x0002, 0x080c, 0x61ba, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0804,
-	0xa9c8, 0x080c, 0xb82c, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010,
-	0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c,
-	0xbe7f, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001,
-	0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010,
-	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38,
-	0x080c, 0xa574, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686,
-	0x0005, 0x0510, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104,
-	0x9084, 0xff00, 0x1118, 0x9686, 0x0009, 0x01b0, 0x9086, 0x1900,
-	0x1168, 0x9686, 0x0009, 0x0180, 0x2001, 0x0004, 0x080c, 0x61ba,
-	0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0010, 0x080c, 0xa815,
-	0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160, 0x6014,
-	0x2048, 0x080c, 0xb82c, 0x0140, 0xa864, 0x9086, 0x0139, 0x0118,
-	0xa868, 0xd0fc, 0x0108, 0x0c50, 0x6010, 0x2058, 0xb840, 0x9084,
-	0x00ff, 0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a, 0x6007,
-	0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6, 0x2071,
-	0x1800, 0x080c, 0x5c68, 0x00ee, 0x0010, 0x080c, 0x3003, 0x0870,
-	0x080c, 0xaa39, 0x1160, 0x2001, 0x0004, 0x080c, 0x61ba, 0x6003,
-	0x0001, 0x6007, 0x0003, 0x080c, 0x84b0, 0x0804, 0x890e, 0x080c,
-	0xa574, 0x0804, 0xa815, 0x0469, 0x1160, 0x2001, 0x0008, 0x080c,
-	0x61ba, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x84b0, 0x0804,
-	0x890e, 0x0804, 0xa815, 0x00e9, 0x1160, 0x2001, 0x000a, 0x080c,
-	0x61ba, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x84b0, 0x0804,
-	0x890e, 0x0804, 0xa815, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003,
-	0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00,
-	0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110,
-	0x2158, 0x080c, 0x6278, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6,
-	0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009,
-	0x1836, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xaadf, 0x0560,
-	0x2009, 0x1836, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x665c, 0x0158,
-	0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd251, 0x2001, 0x180c,
-	0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c,
-	0x2fc2, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2ddb, 0x00ee, 0x00c6,
-	0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x3113, 0x8108,
-	0x1f04, 0xaa7d, 0x015e, 0x00ce, 0x080c, 0xaa3c, 0x2071, 0x0260,
-	0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1836, 0x200c, 0xc1c5,
-	0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108,
-	0xc1c4, 0x7817, 0x0000, 0x2001, 0x1836, 0x2102, 0x2079, 0x0100,
-	0x2e04, 0x9084, 0x00ff, 0x2069, 0x181e, 0x206a, 0x78e6, 0x0006,
-	0x8e70, 0x2e04, 0x2069, 0x181f, 0x206a, 0x78ea, 0x7832, 0x7836,
-	0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182b, 0x200a,
-	0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x246d, 0x080c, 0x70ac,
-	0x0170, 0x2071, 0x0260, 0x2069, 0x1953, 0x7048, 0x206a, 0x704c,
-	0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xbc52, 0x0040,
-	0x2001, 0x0006, 0x080c, 0x61ba, 0x080c, 0x3034, 0x080c, 0x9bcc,
-	0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096,
-	0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182b, 0x231c, 0x83ff,
-	0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084,
-	0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004,
-	0x2b48, 0x2019, 0x000a, 0x080c, 0xabc4, 0x1148, 0x2011, 0x027a,
-	0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xabc4, 0x1100, 0x015e,
-	0x00ee, 0x003e, 0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260,
-	0x7034, 0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188,
-	0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138,
-	0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056,
-	0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c4,
-	0x252c, 0x2021, 0x19cb, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800,
-	0x7250, 0x7070, 0x9202, 0x1a04, 0xab9c, 0x080c, 0xd282, 0x0904,
-	0xab95, 0x6720, 0x9786, 0x0007, 0x0904, 0xab95, 0x2500, 0x9c06,
-	0x0904, 0xab95, 0x2400, 0x9c06, 0x0904, 0xab95, 0x3e08, 0x9186,
-	0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x1590, 0x00c6, 0x6043, 0xffff, 0x6000, 0x9086,
-	0x0004, 0x1110, 0x080c, 0x1914, 0x9786, 0x000a, 0x0148, 0x080c,
-	0xba41, 0x1130, 0x00ce, 0x080c, 0xa574, 0x080c, 0x9c06, 0x00e8,
-	0x6014, 0x2048, 0x080c, 0xb82c, 0x01a8, 0x9786, 0x0003, 0x1530,
-	0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
-	0x080c, 0x0fd4, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6983,
-	0x080c, 0xba1b, 0x080c, 0x9c06, 0x00ce, 0x9ce0, 0x001c, 0x7064,
-	0x9c02, 0x1210, 0x0804, 0xab40, 0x012e, 0x000e, 0x002e, 0x004e,
-	0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006,
-	0x1118, 0x080c, 0xd1fc, 0x0c30, 0x9786, 0x000a, 0x0998, 0x0880,
-	0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xabb0,
-	0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001, 0x0008,
-	0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x8906,
-	0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9300,
-	0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e, 0x1140,
-	0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e, 0x0005,
-	0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000,
-	0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x6004, 0x908a,
-	0x0053, 0x1a0c, 0x0d65, 0x080c, 0xba30, 0x0120, 0x080c, 0xba41,
-	0x0158, 0x0028, 0x080c, 0x3034, 0x080c, 0xba41, 0x0128, 0x080c,
-	0x884c, 0x080c, 0x9bcc, 0x0005, 0x080c, 0xa574, 0x0cc0, 0x9182,
-	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xac26,
-	0xac26, 0xac26, 0xac26, 0xac26, 0xac26, 0xac26, 0xac26, 0xac26,
-	0xac26, 0xac26, 0xac28, 0xac28, 0xac28, 0xac28, 0xac26, 0xac26,
-	0xac26, 0xac28, 0xac26, 0xac26, 0xac26, 0xac26, 0x080c, 0x0d65,
-	0x600b, 0xffff, 0x6003, 0x000f, 0x6106, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xbf5e, 0x2009, 0x8000, 0x080c, 0x84a9, 0x012e, 0x0005,
-	0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xacad,
-	0x9186, 0x0027, 0x1520, 0x080c, 0x884c, 0x080c, 0x3003, 0x080c,
-	0xbf5b, 0x0096, 0x6114, 0x2148, 0x080c, 0xb82c, 0x0198, 0x080c,
-	0xba41, 0x1118, 0x080c, 0xa574, 0x0068, 0xa867, 0x0103, 0xa87b,
-	0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x698f,
-	0x080c, 0xba1b, 0x009e, 0x080c, 0x9bcc, 0x0804, 0x890e, 0x9186,
-	0x0014, 0x1120, 0x6004, 0x9082, 0x0040, 0x0018, 0x080c, 0x0d65,
-	0x0005, 0x0002, 0xac8b, 0xac89, 0xac89, 0xac89, 0xac89, 0xac89,
-	0xac89, 0xac89, 0xac89, 0xac89, 0xac89, 0xaca4, 0xaca4, 0xaca4,
-	0xaca4, 0xac89, 0xaca4, 0xac89, 0xaca4, 0xac89, 0xac89, 0xac89,
-	0xac89, 0x080c, 0x0d65, 0x080c, 0x884c, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xb82c, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877,
-	0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x698f, 0x080c, 0xba1b,
-	0x009e, 0x080c, 0x9bcc, 0x0005, 0x080c, 0x884c, 0x080c, 0xba41,
-	0x090c, 0xa574, 0x080c, 0x9bcc, 0x0005, 0x0002, 0xacc7, 0xacc5,
-	0xacc5, 0xacc5, 0xacc5, 0xacc5, 0xacc5, 0xacc5, 0xacc5, 0xacc5,
-	0xacc5, 0xacc9, 0xacc9, 0xacc9, 0xacc9, 0xacc5, 0xaccb, 0xacc5,
-	0xacc9, 0xacc5, 0xacc5, 0xacc5, 0xacc5, 0x080c, 0x0d65, 0x080c,
-	0x0d65, 0x080c, 0x0d65, 0x080c, 0x9bcc, 0x0804, 0x890e, 0x9182,
-	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xacee,
-	0xacee, 0xacee, 0xacee, 0xacee, 0xad27, 0xae16, 0xacee, 0xae22,
-	0xacee, 0xacee, 0xacee, 0xacee, 0xacee, 0xacee, 0xacee, 0xacee,
-	0xacee, 0xacee, 0xae22, 0xacf0, 0xacee, 0xae20, 0x080c, 0x0d65,
-	0x00b6, 0x0096, 0x6114, 0x2148, 0x6010, 0x2058, 0xb800, 0xd0bc,
-	0x1508, 0xa87b, 0x0000, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87c,
-	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaea7, 0x080c,
-	0x67a5, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
-	0xb8c0, 0x9005, 0x0110, 0x080c, 0x6394, 0x080c, 0x9bcc, 0x009e,
-	0x00be, 0x0005, 0xa87c, 0xd0ac, 0x09e0, 0xa838, 0xa934, 0x9105,
-	0x09c0, 0xa880, 0xd0bc, 0x19a8, 0x080c, 0xbb71, 0x0c80, 0x00b6,
-	0x0096, 0x6114, 0x2148, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008,
-	0x9036, 0x96b4, 0x0fff, 0x86ff, 0x1590, 0x6010, 0x2058, 0xb800,
-	0xd0bc, 0x1904, 0xae05, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76,
-	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaea7,
-	0x080c, 0x67a5, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
-	0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c, 0x6394, 0x601c, 0xd0fc,
-	0x1148, 0x7044, 0xd0e4, 0x1904, 0xade9, 0x080c, 0x9bcc, 0x009e,
-	0x00be, 0x0005, 0x2009, 0x0211, 0x210c, 0x080c, 0x0d65, 0x968c,
-	0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xaded,
-	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
-	0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc,
-	0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34,
-	0x2100, 0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206,
-	0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b,
-	0x0007, 0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e,
-	0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
-	0xc6c4, 0x0804, 0xad33, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
-	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
-	0x2011, 0x0025, 0x080c, 0xb3ff, 0x003e, 0xd6cc, 0x0904, 0xad48,
-	0x7154, 0xa98a, 0x81ff, 0x0904, 0xad48, 0x9192, 0x0021, 0x1278,
-	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb3ff, 0x2011,
-	0x0205, 0x2013, 0x0000, 0x080c, 0xbeeb, 0x0804, 0xad48, 0xa868,
-	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950,
-	0x080c, 0xb39e, 0x00ae, 0x080c, 0xbeeb, 0x080c, 0xb3ef, 0x0804,
-	0xad4a, 0x080c, 0xbb34, 0x0804, 0xad5f, 0xa87c, 0xd0ac, 0x0904,
-	0xad70, 0xa880, 0xd0bc, 0x1904, 0xad70, 0x7348, 0xa838, 0x9306,
-	0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xad70, 0xd6d4, 0x0190,
-	0xab38, 0x9305, 0x0904, 0xad70, 0x0068, 0xa87c, 0xd0ac, 0x0904,
-	0xad3b, 0xa838, 0xa934, 0x9105, 0x0904, 0xad3b, 0xa880, 0xd0bc,
-	0x1904, 0xad3b, 0x080c, 0xbb71, 0x0804, 0xad5f, 0x00f6, 0x2079,
-	0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x00fe, 0x0021, 0x0005,
-	0x0011, 0x0005, 0x0005, 0x0096, 0x6003, 0x0002, 0x6007, 0x0043,
-	0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0128, 0x009e, 0x0005, 0x2130,
-	0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213,
-	0x2600, 0x9102, 0x2500, 0x9203, 0x0e90, 0xac46, 0xab4a, 0xae36,
-	0xad3a, 0x6044, 0xd0fc, 0x190c, 0x98d6, 0x604b, 0x0000, 0x080c,
-	0x1ad2, 0x1118, 0x6144, 0x080c, 0x84d5, 0x009e, 0x0005, 0x9182,
-	0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xae6e,
-	0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e,
-	0xae6e, 0xae70, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae81, 0xae6e,
-	0xae6e, 0xae6e, 0xae6e, 0xaea5, 0xae6e, 0xae6e, 0x080c, 0x0d65,
-	0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x884c, 0x2019, 0x0001,
-	0x080c, 0x926b, 0x6003, 0x0002, 0x080c, 0xbf63, 0x080c, 0x88a9,
-	0x0005, 0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x884c, 0x2019,
-	0x0001, 0x080c, 0x926b, 0x080c, 0x88a9, 0x080c, 0x3003, 0x080c,
-	0xbf5b, 0x0096, 0x6114, 0x2148, 0x080c, 0xb82c, 0x0150, 0xa867,
-	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x698f, 0x080c,
-	0xba1b, 0x009e, 0x080c, 0x9bcc, 0x0005, 0x080c, 0x0d65, 0xa87b,
-	0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a,
-	0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a48, 0x2104, 0x8000,
-	0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0057,
-	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xaedd, 0xaedd,
-	0xaedd, 0xaedd, 0xaedd, 0xaedf, 0xaedd, 0xaedd, 0xaf9c, 0xaedd,
-	0xaedd, 0xaedd, 0xaedd, 0xaedd, 0xaedd, 0xaedd, 0xaedd, 0xaedd,
-	0xaedd, 0xb0e0, 0xaedd, 0xb0ea, 0xaedd, 0x080c, 0x0d65, 0x601c,
-	0xd0bc, 0x0178, 0xd084, 0x0168, 0xd0f4, 0x0120, 0xc084, 0x601e,
-	0x0804, 0xaccf, 0x6114, 0x0096, 0x2148, 0xa87c, 0xc0e5, 0xa87e,
-	0x009e, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114,
-	0x2150, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0xb676,
-	0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258,
-	0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904,
-	0xaf95, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092,
-	0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xaf95, 0x9686, 0x0100,
-	0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c,
-	0x1022, 0x090c, 0x0d65, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200,
-	0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070,
-	0xa872, 0x7044, 0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00,
-	0x0120, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186,
-	0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060,
-	0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b,
-	0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084,
-	0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170,
-	0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
-	0x0018, 0x2011, 0x0025, 0x080c, 0xb3ff, 0x003e, 0xd6cc, 0x01e8,
-	0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304,
-	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb3ff, 0x2011, 0x0205,
-	0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020,
-	0xa98a, 0x0c68, 0x2950, 0x080c, 0xb39e, 0x080c, 0x18f2, 0x009e,
-	0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001, 0x1959, 0x2004, 0x604a,
-	0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c,
-	0xc0dc, 0xa87e, 0x6003, 0x0002, 0x080c, 0xbf6c, 0x0904, 0xb0db,
-	0x604b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x1500, 0xd1cc, 0x0904, 0xb09a, 0xa978, 0xa868, 0xd0fc, 0x0904,
-	0xb05b, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150,
-	0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xb029, 0x9086,
-	0x0028, 0x1904, 0xb015, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804,
-	0xb031, 0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8,
-	0xa838, 0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988,
-	0x6024, 0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0,
-	0xa838, 0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6,
-	0x2058, 0xb83c, 0x8000, 0xb83e, 0x00be, 0x601c, 0xc0fc, 0x601e,
-	0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc,
-	0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4,
-	0x009e, 0x080c, 0xbb71, 0x0804, 0xb0db, 0xd1dc, 0x0158, 0xa87b,
-	0x0015, 0xb07b, 0x0015, 0x080c, 0xbe0e, 0x0118, 0xb174, 0xc1dc,
-	0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007,
-	0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
-	0xaea7, 0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020, 0x8a06,
-	0x8006, 0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0, 0x9080,
-	0x0019, 0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e, 0xa87e,
-	0x080c, 0xbeeb, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fd4,
-	0x001e, 0x0804, 0xb0c7, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184,
-	0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b,
-	0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015,
-	0xb07b, 0x0015, 0x080c, 0xbe0e, 0x0118, 0xb174, 0xc1dc, 0xb176,
-	0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040,
-	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaea7,
-	0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c,
-	0x0fd4, 0x009e, 0x080c, 0xbeeb, 0xa974, 0x0016, 0x080c, 0xb3ef,
-	0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6,
-	0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0,
-	0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xbe0e, 0x0118, 0xa974,
-	0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050,
-	0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xaea7, 0xa974, 0x0016, 0x080c, 0x67a5, 0x001e, 0x6010,
-	0x00b6, 0x2058, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8c0,
-	0x9005, 0x0120, 0x0016, 0x080c, 0x6394, 0x001e, 0x00be, 0xd1e4,
-	0x1120, 0x080c, 0x9bcc, 0x009e, 0x0005, 0x080c, 0xbb34, 0x0cd8,
-	0x6114, 0x0096, 0x2148, 0xa97c, 0x080c, 0xbf6c, 0x190c, 0x1900,
-	0x009e, 0x0005, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105,
-	0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000, 0xa867, 0x0103, 0x00b6,
-	0x6010, 0x2058, 0xa834, 0xa938, 0x9115, 0x11a0, 0x080c, 0x67a5,
-	0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c,
-	0x6394, 0x080c, 0x9bcc, 0x00be, 0x009e, 0x0005, 0xa87c, 0xc0dc,
-	0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120, 0xa834, 0x080c, 0xaea7,
-	0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c, 0xbb71, 0x0c60, 0x080c,
-	0x884c, 0x0010, 0x080c, 0x88a9, 0x601c, 0xd084, 0x0110, 0x080c,
-	0x1914, 0x080c, 0xb82c, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xba41, 0x1118, 0x080c, 0xa574, 0x00a0, 0xa867, 0x0103, 0x2009,
-	0x180c, 0x210c, 0xd18c, 0x1198, 0xd184, 0x1170, 0x6108, 0xa97a,
-	0x918e, 0x0029, 0x1110, 0x080c, 0xd4f8, 0xa877, 0x0000, 0x080c,
-	0x698f, 0x009e, 0x0804, 0x9c06, 0xa87b, 0x0004, 0x0cb0, 0xa87b,
-	0x0004, 0x0c98, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xb171, 0xb171, 0xb171, 0xb171, 0xb171, 0xb173,
-	0xb171, 0xb171, 0xb171, 0xb171, 0xb171, 0xb171, 0xb171, 0xb171,
-	0xb171, 0xb171, 0xb171, 0xb171, 0xb171, 0xb171, 0xb197, 0xb171,
-	0xb171, 0x080c, 0x0d65, 0x080c, 0x538e, 0x01f8, 0x6014, 0x7144,
-	0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff,
-	0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086, 0x0139,
-	0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897, 0x4000,
-	0xa99a, 0xaa9e, 0x080c, 0x698f, 0x009e, 0x0804, 0x9bcc, 0x080c,
-	0x538e, 0x0dd8, 0x6014, 0x900e, 0x9016, 0x0c10, 0x9182, 0x0085,
-	0x0002, 0xb1b0, 0xb1ae, 0xb1ae, 0xb1bc, 0xb1ae, 0xb1ae, 0xb1ae,
-	0xb1ae, 0xb1ae, 0xb1ae, 0xb1ae, 0xb1ae, 0xb1ae, 0x080c, 0x0d65,
-	0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0x8020,
-	0x080c, 0x84a9, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6,
-	0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xb81a, 0x01a0,
-	0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e,
-	0x1158, 0x00c6, 0x2d60, 0x080c, 0xb42a, 0x00ce, 0x0128, 0x6803,
-	0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x84a9, 0x9280, 0x0004, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6,
-	0x2260, 0x080c, 0xbb71, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e,
-	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
-	0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65, 0x9082, 0x0085, 0x00e2,
-	0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d65, 0x080c,
-	0x884c, 0x0096, 0x6014, 0x2048, 0x080c, 0xb82c, 0x0140, 0xa867,
-	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x698f, 0x009e,
-	0x080c, 0x9c06, 0x0804, 0x890e, 0xb231, 0xb233, 0xb233, 0xb231,
-	0xb231, 0xb231, 0xb231, 0xb231, 0xb231, 0xb231, 0xb231, 0xb231,
-	0xb231, 0x080c, 0x0d65, 0x080c, 0x9c06, 0x0005, 0x9186, 0x0013,
-	0x1130, 0x6004, 0x9082, 0x0085, 0x2008, 0x0804, 0xb282, 0x9186,
-	0x0027, 0x1558, 0x080c, 0x884c, 0x080c, 0x3003, 0x080c, 0xbf5b,
-	0x0096, 0x6014, 0x2048, 0x080c, 0xb82c, 0x0150, 0xa867, 0x0103,
-	0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x698f, 0x080c, 0xba1b,
-	0x009e, 0x080c, 0x9bcc, 0x0005, 0x9186, 0x0089, 0x0118, 0x9186,
-	0x008a, 0x1140, 0x080c, 0x9a9c, 0x0128, 0x9086, 0x000c, 0x0904,
-	0xb2ba, 0x0000, 0x080c, 0x9c87, 0x0c70, 0x9186, 0x0014, 0x1d60,
-	0x080c, 0x884c, 0x0096, 0x6014, 0x2048, 0x080c, 0xb82c, 0x0d00,
-	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec,
-	0xa882, 0x0890, 0x0002, 0xb292, 0xb290, 0xb290, 0xb290, 0xb290,
-	0xb290, 0xb2a6, 0xb290, 0xb290, 0xb290, 0xb290, 0xb290, 0xb290,
-	0x080c, 0x0d65, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1957, 0x0010, 0x2001,
-	0x1958, 0x2004, 0x601a, 0x6003, 0x000c, 0x0005, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
-	0x2001, 0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003,
-	0x000e, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
-	0x0012, 0x0804, 0x9c87, 0xb2d0, 0xb2d0, 0xb2d0, 0xb2d0, 0xb2d2,
-	0xb31f, 0xb2d0, 0xb2d0, 0xb2d0, 0xb2d0, 0xb2d0, 0xb2d0, 0xb2d0,
-	0x080c, 0x0d65, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb333, 0x080c,
-	0xb82c, 0x1118, 0x080c, 0xba1b, 0x0068, 0x6014, 0x2048, 0x080c,
-	0xbf72, 0x1110, 0x080c, 0xba1b, 0xa867, 0x0103, 0x080c, 0xbf26,
-	0x080c, 0x698f, 0x00d6, 0x2c68, 0x080c, 0x9b76, 0x01d0, 0x6003,
-	0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c,
-	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c,
-	0xbcc0, 0x695c, 0x615e, 0x6023, 0x0001, 0x2009, 0x8020, 0x080c,
-	0x84a9, 0x2d60, 0x00de, 0x080c, 0x9bcc, 0x009e, 0x0005, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, 0x0118,
-	0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xbebe, 0x11f0,
-	0x080c, 0x9b76, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001,
-	0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c,
-	0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x695c, 0x615e,
-	0x080c, 0xbcc0, 0x2009, 0x8020, 0x080c, 0x84a9, 0x2d60, 0x00de,
-	0x0804, 0x9bcc, 0x0096, 0x6014, 0x2048, 0x080c, 0xb82c, 0x01c8,
-	0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b,
-	0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
-	0x0005, 0x080c, 0xbb30, 0xa877, 0x0000, 0x080c, 0x698f, 0x080c,
-	0xba1b, 0x009e, 0x0804, 0x9bcc, 0x0016, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xb82c, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877,
-	0x0000, 0x080c, 0x698f, 0x009e, 0x001e, 0x9186, 0x0013, 0x0158,
-	0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9c87,
-	0x0020, 0x080c, 0x884c, 0x080c, 0x9c06, 0x0005, 0x0056, 0x0066,
-	0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208, 0x0010,
-	0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009, 0x0020,
-	0x2011, 0x0029, 0x080c, 0xb3ff, 0x96b2, 0x0020, 0xb004, 0x904d,
-	0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022, 0x0520, 0x8528, 0xa867,
-	0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1228,
-	0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c, 0x2009,
-	0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001, 0x0205,
-	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x95ac,
-	0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
-	0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005, 0x00a6,
-	0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000, 0x080c,
-	0x698f, 0x2a48, 0x0cb8, 0x080c, 0x698f, 0x00ae, 0x0005, 0x00f6,
-	0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184, 0x0108,
-	0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c, 0x9200,
-	0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003, 0x8318,
-	0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098, 0x7814,
-	0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817, 0x0000,
-	0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031, 0x0001,
-	0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084, 0x000f,
-	0x001b, 0x006e, 0x012e, 0x0005, 0xb47c, 0xb47c, 0xb477, 0xb4a0,
-	0xb454, 0xb477, 0xb456, 0xb477, 0xb454, 0xb454, 0xb477, 0xb477,
-	0xb477, 0xb454, 0xb454, 0xb454, 0x080c, 0x0d65, 0x6010, 0x9080,
-	0x0000, 0x2004, 0xd0bc, 0x190c, 0xb4a0, 0x0036, 0x6014, 0x0096,
-	0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118, 0x2019, 0x000c, 0x0038,
-	0xd094, 0x0118, 0x2019, 0x000d, 0x0010, 0x2019, 0x0010, 0x080c,
-	0xcdd9, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x9006,
-	0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11e8, 0x6014,
-	0x2048, 0x080c, 0xb82c, 0x01d0, 0x6043, 0xffff, 0xa864, 0x9086,
-	0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e,
-	0x2001, 0x0005, 0x080c, 0x6bac, 0x080c, 0xbb30, 0x080c, 0x6983,
-	0x080c, 0x9c06, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0,
-	0x080c, 0x98ad, 0x080c, 0xbf80, 0x6000, 0x908a, 0x0016, 0x1a0c,
-	0x0d65, 0x002b, 0x0106, 0x080c, 0x98c9, 0x010e, 0x0005, 0xb4bf,
-	0xb4ed, 0xb4c1, 0xb514, 0xb4e8, 0xb4bf, 0xb477, 0xb47c, 0xb47c,
-	0xb477, 0xb477, 0xb477, 0xb477, 0xb477, 0xb477, 0xb477, 0x080c,
-	0x0d65, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096,
-	0x6014, 0x2048, 0x080c, 0xb82c, 0x0158, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e, 0x080c, 0xbb30,
-	0x009e, 0x080c, 0xbf00, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0002, 0x2009, 0x8020, 0x080c, 0x848b, 0x9085, 0x0001, 0x0005,
-	0x0066, 0x080c, 0x1914, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19b8,
-	0x7030, 0x9c06, 0x1120, 0x080c, 0x91eb, 0x00ee, 0x0850, 0x6020,
-	0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049,
-	0x0001, 0x2c40, 0x080c, 0x9367, 0x009e, 0x008e, 0x0040, 0x0066,
-	0x080c, 0x90e7, 0x190c, 0x0d65, 0x080c, 0x90f5, 0x006e, 0x00ee,
-	0x1904, 0xb4c1, 0x0804, 0xb477, 0x0036, 0x00e6, 0x2071, 0x19b8,
-	0x704c, 0x9c06, 0x1138, 0x901e, 0x080c, 0x926b, 0x00ee, 0x003e,
-	0x0804, 0xb4c1, 0x080c, 0x949d, 0x00ee, 0x003e, 0x1904, 0xb4c1,
-	0x0804, 0xb477, 0x00c6, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b,
-	0x006e, 0x00ce, 0x0005, 0xb54a, 0xb60c, 0xb773, 0xb552, 0x9c06,
-	0xb54a, 0xcdcb, 0xbf68, 0xb60c, 0xb543, 0xb7f2, 0xb543, 0xb543,
-	0xb543, 0xb543, 0xb543, 0x080c, 0x0d65, 0x080c, 0xba41, 0x1110,
-	0x080c, 0xa574, 0x0005, 0x080c, 0x884c, 0x0804, 0x9bcc, 0x601b,
-	0x0001, 0x0005, 0x080c, 0xb82c, 0x0130, 0x6014, 0x0096, 0x2048,
-	0x2c00, 0xa896, 0x009e, 0x080c, 0x98ad, 0x080c, 0xbf80, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x0804, 0x98c9, 0xb577,
-	0xb579, 0xb5a3, 0xb5b7, 0xb5e2, 0xb577, 0xb54a, 0xb54a, 0xb54a,
-	0xb5be, 0xb5be, 0xb577, 0xb577, 0xb577, 0xb577, 0xb5c8, 0x080c,
-	0x0d65, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5, 0xa882,
-	0x009e, 0x2071, 0x19b8, 0x7030, 0x9c06, 0x01d0, 0x0066, 0x080c,
-	0x90e7, 0x190c, 0x0d65, 0x080c, 0x90f5, 0x006e, 0x080c, 0xbf00,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1958,
-	0x2004, 0x601a, 0x2009, 0x8020, 0x080c, 0x848b, 0x00ee, 0x0005,
-	0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5,
-	0xa882, 0x009e, 0x080c, 0xbf00, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x848b, 0x0005, 0x080c,
-	0x98ad, 0x080c, 0x9a1e, 0x080c, 0x98c9, 0x0c28, 0x0096, 0x601b,
-	0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005,
-	0x080c, 0x538e, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864,
-	0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867,
-	0x0139, 0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x698f, 0x009e,
-	0x0804, 0x9bcc, 0x6014, 0x0096, 0x904d, 0x0508, 0x080c, 0xbf6c,
-	0x01f0, 0x080c, 0x98c9, 0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110,
-	0x009e, 0x0005, 0xa884, 0x009e, 0x8003, 0x800b, 0x810b, 0x9108,
-	0x611a, 0x2001, 0x0037, 0x2c08, 0x080c, 0x159e, 0x6000, 0x9086,
-	0x0004, 0x1120, 0x2009, 0x0048, 0x080c, 0x9c6a, 0x0005, 0x009e,
-	0x080c, 0x1914, 0x0804, 0xb5a3, 0x6000, 0x908a, 0x0016, 0x1a0c,
-	0x0d65, 0x000b, 0x0005, 0xb623, 0xb54f, 0xb625, 0xb623, 0xb625,
-	0xb625, 0xb54b, 0xb623, 0xb545, 0xb545, 0xb623, 0xb623, 0xb623,
-	0xb623, 0xb623, 0xb623, 0x080c, 0x0d65, 0x6010, 0x00b6, 0x2058,
-	0xb804, 0x9084, 0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0d65,
-	0x00b6, 0x0013, 0x00be, 0x0005, 0xb640, 0xb70d, 0xb642, 0xb682,
-	0xb642, 0xb682, 0xb642, 0xb650, 0xb640, 0xb682, 0xb640, 0xb671,
-	0x080c, 0x0d65, 0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004,
-	0x05a8, 0x908e, 0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xb709,
-	0x6004, 0x080c, 0xba41, 0x0904, 0xb726, 0x908e, 0x0004, 0x1110,
-	0x080c, 0x3034, 0x908e, 0x0021, 0x0904, 0xb72a, 0x908e, 0x0022,
-	0x0904, 0xb76e, 0x908e, 0x003d, 0x0904, 0xb72a, 0x908e, 0x0039,
-	0x0904, 0xb72e, 0x908e, 0x0035, 0x0904, 0xb72e, 0x908e, 0x001e,
-	0x0178, 0x908e, 0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x0110, 0x080c, 0x3003, 0x080c, 0xa574,
-	0x0804, 0x9c06, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904,
-	0xb6fa, 0x9186, 0x0002, 0x1904, 0xb6cf, 0x2001, 0x1836, 0x2004,
-	0xd08c, 0x11c8, 0x080c, 0x70ac, 0x11b0, 0x080c, 0xbf46, 0x0138,
-	0x080c, 0x70cf, 0x1120, 0x080c, 0x6fb7, 0x0804, 0xb757, 0x2001,
-	0x194e, 0x2003, 0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c,
-	0x6fdd, 0x0804, 0xb757, 0x6010, 0x2058, 0x2001, 0x1836, 0x2004,
-	0xd0ac, 0x1904, 0xb757, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xb757,
-	0xb840, 0x9084, 0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017,
-	0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x080c,
-	0x9b76, 0x0128, 0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de,
-	0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0,
-	0x9086, 0x007e, 0x1170, 0x2009, 0x1836, 0x2104, 0xc085, 0x200a,
-	0x00e6, 0x2071, 0x1800, 0x080c, 0x5c68, 0x00ee, 0x080c, 0xa574,
-	0x0030, 0x080c, 0xa574, 0x080c, 0x3003, 0x080c, 0xbf5b, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x3034, 0x012e, 0x00ee, 0x080c,
-	0x9c06, 0x0005, 0x2001, 0x0002, 0x080c, 0x61ba, 0x6003, 0x0001,
-	0x6007, 0x0002, 0x080c, 0x84b0, 0x080c, 0x890e, 0x00de, 0x00ce,
-	0x0c80, 0x080c, 0x3034, 0x0804, 0xb67e, 0x00c6, 0x00d6, 0x6104,
-	0x9186, 0x0016, 0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
-	0x9005, 0x0904, 0xb6cf, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c,
-	0x84b0, 0x080c, 0x890e, 0x00de, 0x00ce, 0x0898, 0x080c, 0xa574,
-	0x0804, 0xb680, 0x080c, 0xa5b0, 0x0804, 0xb680, 0x00d6, 0x2c68,
-	0x6104, 0x080c, 0xbebe, 0x00de, 0x0118, 0x080c, 0x9bcc, 0x00f0,
-	0x6004, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001,
-	0x1958, 0x2004, 0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5,
-	0x6026, 0x2160, 0x2009, 0x8020, 0x080c, 0x84a9, 0x0005, 0x00de,
-	0x00ce, 0x080c, 0xa574, 0x080c, 0x3003, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x3034, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b,
-	0x0398, 0x604b, 0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xa007,
-	0x1904, 0xb726, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65,
-	0x0096, 0x00d6, 0x001b, 0x00de, 0x009e, 0x0005, 0xb78e, 0xb78e,
-	0xb78e, 0xb78e, 0xb78e, 0xb78e, 0xb78e, 0xb78e, 0xb78e, 0xb54a,
-	0xb78e, 0xb54f, 0xb790, 0xb54f, 0xb79d, 0xb78e, 0x080c, 0x0d65,
-	0x6004, 0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d,
-	0x2009, 0x8020, 0x080c, 0x84a9, 0x0005, 0x080c, 0xbf3a, 0x0118,
-	0x080c, 0xbf4d, 0x0010, 0x080c, 0xbf5b, 0x080c, 0xba1b, 0x080c,
-	0xb82c, 0x0570, 0x080c, 0x3003, 0x080c, 0xb82c, 0x0168, 0x6014,
-	0x2048, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880,
-	0xc0ed, 0xa882, 0x080c, 0x698f, 0x2c68, 0x080c, 0x9b76, 0x0150,
-	0x6810, 0x6012, 0x080c, 0xbcc0, 0x00c6, 0x2d60, 0x080c, 0x9c06,
-	0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007,
-	0x0001, 0x6003, 0x0001, 0x080c, 0x84b0, 0x080c, 0x890e, 0x00c8,
-	0x080c, 0xbf3a, 0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c,
-	0x3003, 0x08d0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x080c, 0x3003, 0x0868, 0x080c,
-	0x9c06, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0002,
-	0xb808, 0xb808, 0xb80a, 0xb80a, 0xb80a, 0xb808, 0xb808, 0x9c06,
-	0xb808, 0xb808, 0xb808, 0xb808, 0xb808, 0xb808, 0xb808, 0xb808,
-	0x080c, 0x0d65, 0x080c, 0x98ad, 0x080c, 0x9a1e, 0x080c, 0x98c9,
-	0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x698f, 0x009e,
-	0x0804, 0x9bcc, 0x9284, 0x0003, 0x1158, 0x9282, 0x1ddc, 0x0240,
-	0x2001, 0x1819, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005,
-	0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048,
-	0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c,
-	0x10cd, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7350,
-	0x7070, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xbf46,
-	0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148,
-	0x080c, 0x3003, 0x080c, 0xbf5b, 0x00c6, 0x080c, 0x9c06, 0x00ce,
-	0x0060, 0x080c, 0xbc32, 0x0148, 0x080c, 0xba41, 0x1110, 0x080c,
-	0xa574, 0x00c6, 0x080c, 0x9bcc, 0x00ce, 0x9ce0, 0x001c, 0x7064,
-	0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee,
-	0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff,
-	0x0128, 0x2061, 0x1b02, 0x6112, 0x080c, 0x3003, 0x9006, 0x0010,
-	0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x9b76, 0x01b0, 0x665e, 0x2b00, 0x6012,
-	0x080c, 0x538e, 0x0118, 0x080c, 0xb95d, 0x0168, 0x080c, 0xbcc0,
-	0x6023, 0x0003, 0x2009, 0x004b, 0x080c, 0x9c6a, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0xbaa0, 0x080c, 0x9c3d, 0x0580, 0x605f, 0x0000, 0x2b00,
-	0x6012, 0x080c, 0xbcc0, 0x6023, 0x0003, 0x0016, 0x080c, 0x98ad,
-	0x080c, 0x8613, 0x0076, 0x903e, 0x080c, 0x8502, 0x2c08, 0x080c,
-	0xcfa6, 0x007e, 0x080c, 0x98c9, 0x001e, 0xd184, 0x0128, 0x080c,
-	0x9bcc, 0x9085, 0x0001, 0x0070, 0x080c, 0x538e, 0x0128, 0xd18c,
-	0x1170, 0x080c, 0xb95d, 0x0148, 0x2009, 0x004c, 0x080c, 0x9c6a,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900,
-	0x6016, 0x0c90, 0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6,
-	0x00c6, 0x0046, 0x0016, 0x080c, 0x9b76, 0x2c78, 0x0590, 0x7e5e,
-	0x2b00, 0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xb96f,
-	0x9186, 0x004d, 0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x1951,
-	0x200c, 0xd1fc, 0x0168, 0x2f60, 0x080c, 0x9bcc, 0x00d0, 0x2001,
-	0x1950, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9bcc, 0x0088,
-	0x2f60, 0x080c, 0x538e, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148,
-	0x0010, 0x2900, 0x7816, 0x001e, 0x0016, 0x080c, 0x9c6a, 0x9085,
-	0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6,
-	0x0046, 0x080c, 0x9b76, 0x2c78, 0x0508, 0x7e5e, 0x2b00, 0x7812,
-	0x7823, 0x0003, 0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001,
-	0x194f, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9bcc, 0x0060,
-	0x2f60, 0x080c, 0x538e, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130,
-	0x2009, 0x0052, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x004e, 0x00ce,
-	0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x4871,
-	0x00ce, 0x1120, 0x080c, 0x9bcc, 0x9006, 0x0005, 0xa867, 0x0000,
-	0xa86b, 0x8000, 0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096,
-	0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0x98ad, 0x080c, 0x6448,
-	0x0158, 0x2001, 0xb976, 0x0006, 0x900e, 0x2400, 0x080c, 0x6bac,
-	0x080c, 0x698f, 0x000e, 0x0807, 0x2418, 0x080c, 0x8812, 0xbaa0,
-	0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x862d,
-	0x008e, 0x080c, 0x8502, 0x2f08, 0x2648, 0x080c, 0xcfa6, 0xb93c,
-	0x81ff, 0x090c, 0x8704, 0x080c, 0x98c9, 0x012e, 0x007e, 0x009e,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b76, 0x0190,
-	0x660a, 0x2b08, 0x6112, 0x080c, 0xbcc0, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x2009, 0x001f, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e,
+	0xb9a0, 0x0016, 0x080c, 0x303b, 0x080c, 0x9be7, 0x001e, 0x080c,
+	0x311a, 0x00de, 0x0804, 0xa8e6, 0x00de, 0x080c, 0x53a1, 0x1170,
+	0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0,
+	0x2021, 0x0006, 0x080c, 0x4a75, 0x004e, 0x003e, 0x00d6, 0x6010,
+	0x2058, 0x080c, 0x630b, 0x080c, 0xa6a6, 0x00de, 0x080c, 0xab28,
+	0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006,
+	0x080c, 0x61c1, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xbe40, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
+	0x009e, 0x080c, 0x303b, 0x6020, 0x9086, 0x000a, 0x0138, 0x080c,
+	0x9be7, 0x0020, 0x080c, 0xa58f, 0x080c, 0xa830, 0x001e, 0x002e,
+	0x00ee, 0x00be, 0x0005, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014,
+	0x1160, 0x2001, 0x0002, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x84d8, 0x0804, 0x8936, 0x0804, 0xa830, 0x2030,
+	0x2011, 0x1823, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b,
+	0x1120, 0x2001, 0x0007, 0x080c, 0x61c1, 0x0804, 0x9be7, 0x0804,
+	0xa830, 0x0002, 0xa670, 0xa929, 0xa670, 0xa968, 0xa670, 0xaa13,
+	0xa91e, 0xa670, 0xa670, 0xaa26, 0xa670, 0xaa36, 0x6604, 0x9686,
+	0x0003, 0x0904, 0xa845, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9be7,
+	0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xaa46, 0x11a0, 0x9006,
+	0x080c, 0x61ad, 0x080c, 0x3006, 0x080c, 0xbf76, 0x2001, 0x0002,
+	0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8,
+	0x080c, 0x8936, 0x0408, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009,
+	0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170,
+	0x8001, 0xb842, 0x601b, 0x000a, 0x0078, 0x2009, 0x026f, 0x2104,
+	0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x3006,
+	0x080c, 0xbf76, 0x080c, 0xa830, 0x00ce, 0x00de, 0x00be, 0x0005,
+	0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xaa54, 0x00d6, 0x2069,
+	0x194d, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086,
+	0x007e, 0x1138, 0x2069, 0x181f, 0x2d04, 0x8000, 0x206a, 0x00de,
+	0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x61ad, 0x2001, 0x0002,
+	0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8,
+	0x080c, 0x8936, 0x0804, 0xa9e3, 0x080c, 0xb847, 0x01b0, 0x6014,
+	0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016,
+	0x2001, 0x0002, 0x080c, 0xbe9a, 0x00b0, 0x6014, 0x2048, 0xa864,
+	0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004,
+	0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
+	0x1110, 0x9006, 0x0c38, 0x080c, 0xa58f, 0x2009, 0x026e, 0x2134,
+	0x96b4, 0x00ff, 0x9686, 0x0005, 0x0510, 0x9686, 0x000b, 0x01c8,
+	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009,
+	0x01b0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0180, 0x2001,
+	0x0004, 0x080c, 0x61c1, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052,
+	0x0010, 0x080c, 0xa830, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286,
+	0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xb847, 0x0140, 0xa864,
+	0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c50, 0x6010,
+	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842,
+	0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e,
+	0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6f, 0x00ee, 0x0010,
+	0x080c, 0x3006, 0x0870, 0x080c, 0xaa54, 0x1160, 0x2001, 0x0004,
+	0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x84d8,
+	0x0804, 0x8936, 0x080c, 0xa58f, 0x0804, 0xa830, 0x0469, 0x1160,
+	0x2001, 0x0008, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0005,
+	0x080c, 0x84d8, 0x0804, 0x8936, 0x0804, 0xa830, 0x00e9, 0x1160,
+	0x2001, 0x000a, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x84d8, 0x0804, 0x8936, 0x0804, 0xa830, 0x2009, 0x026e,
+	0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084,
+	0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6,
+	0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x627f, 0x001e, 0x00ce,
+	0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016,
+	0x6010, 0x2058, 0x2009, 0x1836, 0x2104, 0x9085, 0x0003, 0x200a,
+	0x080c, 0xaafa, 0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd, 0x200a,
+	0x080c, 0x6663, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c,
+	0xd273, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
+	0x2009, 0x0001, 0x080c, 0x2fc5, 0x00e6, 0x2071, 0x1800, 0x080c,
+	0x2ddb, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f,
+	0x080c, 0x311a, 0x8108, 0x1f04, 0xaa98, 0x015e, 0x00ce, 0x080c,
+	0xaa57, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001,
+	0x1836, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118,
+	0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1836,
+	0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181e,
+	0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f, 0x206a,
+	0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105,
+	0x2009, 0x182b, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c,
+	0x246d, 0x080c, 0x70b7, 0x0170, 0x2071, 0x0260, 0x2069, 0x1953,
+	0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e,
+	0x080c, 0xbc6d, 0x0040, 0x2001, 0x0006, 0x080c, 0x61c1, 0x080c,
+	0x303b, 0x080c, 0x9be7, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe,
+	0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019,
+	0x182b, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294,
+	0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011,
+	0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xabdf,
+	0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c,
+	0xabdf, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e, 0x0005,
+	0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038,
+	0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00,
+	0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096,
+	0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2029, 0x19c4, 0x252c, 0x2021, 0x19cb, 0x2424, 0x2061,
+	0x1ddc, 0x2071, 0x1800, 0x7250, 0x7070, 0x9202, 0x1a04, 0xabb7,
+	0x080c, 0xd2a4, 0x0904, 0xabb0, 0x6720, 0x9786, 0x0007, 0x0904,
+	0xabb0, 0x2500, 0x9c06, 0x0904, 0xabb0, 0x2400, 0x9c06, 0x0904,
+	0xabb0, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1590, 0x00c6, 0x6043,
+	0xffff, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x1914, 0x9786,
+	0x000a, 0x0148, 0x080c, 0xba5c, 0x1130, 0x00ce, 0x080c, 0xa58f,
+	0x080c, 0x9c21, 0x00e8, 0x6014, 0x2048, 0x080c, 0xb847, 0x01a8,
+	0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130,
+	0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x698a, 0x080c, 0xba36, 0x080c, 0x9c21, 0x00ce,
+	0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1210, 0x0804, 0xab5b, 0x012e,
+	0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee,
+	0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xd21e, 0x0c30, 0x9786,
+	0x000a, 0x0998, 0x0880, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210,
+	0x8318, 0x1f04, 0xabcb, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218,
+	0x2001, 0x0001, 0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136,
+	0x01c6, 0x0016, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0,
+	0x9084, 0xffc0, 0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c,
+	0x4002, 0x910e, 0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e,
+	0x01ce, 0x013e, 0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001,
+	0x0010, 0x2001, 0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e,
+	0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x080c, 0xba4b,
+	0x0120, 0x080c, 0xba5c, 0x0158, 0x0028, 0x080c, 0x303b, 0x080c,
+	0xba5c, 0x0128, 0x080c, 0x8874, 0x080c, 0x9be7, 0x0005, 0x080c,
+	0xa58f, 0x0cc0, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xac41, 0xac41, 0xac41, 0xac41, 0xac41, 0xac41,
+	0xac41, 0xac41, 0xac41, 0xac41, 0xac41, 0xac43, 0xac43, 0xac43,
+	0xac43, 0xac41, 0xac41, 0xac41, 0xac43, 0xac41, 0xac41, 0xac41,
+	0xac41, 0x080c, 0x0d65, 0x600b, 0xffff, 0x6003, 0x000f, 0x6106,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xbf79, 0x2009, 0x8000, 0x080c,
+	0x84d1, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
+	0x0040, 0x0804, 0xacc8, 0x9186, 0x0027, 0x1520, 0x080c, 0x8874,
+	0x080c, 0x3006, 0x080c, 0xbf76, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xb847, 0x0198, 0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f, 0x0068,
+	0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5,
+	0xa97e, 0x080c, 0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7,
+	0x0804, 0x8936, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082, 0x0040,
+	0x0018, 0x080c, 0x0d65, 0x0005, 0x0002, 0xaca6, 0xaca4, 0xaca4,
+	0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4,
+	0xacbf, 0xacbf, 0xacbf, 0xacbf, 0xaca4, 0xacbf, 0xaca4, 0xacbf,
+	0xaca4, 0xaca4, 0xaca4, 0xaca4, 0x080c, 0x0d65, 0x080c, 0x8874,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xb847, 0x0168, 0xa867, 0x0103,
+	0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c,
+	0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7, 0x0005, 0x080c,
+	0x8874, 0x080c, 0xba5c, 0x090c, 0xa58f, 0x080c, 0x9be7, 0x0005,
+	0x0002, 0xace2, 0xace0, 0xace0, 0xace0, 0xace0, 0xace0, 0xace0,
+	0xace0, 0xace0, 0xace0, 0xace0, 0xace4, 0xace4, 0xace4, 0xace4,
+	0xace0, 0xace6, 0xace0, 0xace4, 0xace0, 0xace0, 0xace0, 0xace0,
+	0x080c, 0x0d65, 0x080c, 0x0d65, 0x080c, 0x0d65, 0x080c, 0x9be7,
+	0x0804, 0x8936, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xad09, 0xad09, 0xad09, 0xad09, 0xad09, 0xad42,
+	0xae31, 0xad09, 0xae3d, 0xad09, 0xad09, 0xad09, 0xad09, 0xad09,
+	0xad09, 0xad09, 0xad09, 0xad09, 0xad09, 0xae3d, 0xad0b, 0xad09,
+	0xae3b, 0x080c, 0x0d65, 0x00b6, 0x0096, 0x6114, 0x2148, 0x6010,
+	0x2058, 0xb800, 0xd0bc, 0x1508, 0xa87b, 0x0000, 0xa867, 0x0103,
+	0xa877, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xaec2, 0x080c, 0x67ac, 0x6210, 0x2258, 0xba3c, 0x82ff,
+	0x0110, 0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c, 0x639b,
+	0x080c, 0x9be7, 0x009e, 0x00be, 0x0005, 0xa87c, 0xd0ac, 0x09e0,
+	0xa838, 0xa934, 0x9105, 0x09c0, 0xa880, 0xd0bc, 0x19a8, 0x080c,
+	0xbb8c, 0x0c80, 0x00b6, 0x0096, 0x6114, 0x2148, 0x601c, 0xd0fc,
+	0x1110, 0x7644, 0x0008, 0x9036, 0x96b4, 0x0fff, 0x86ff, 0x1590,
+	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xae20, 0xa87b, 0x0000,
+	0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xaec2, 0x080c, 0x67ac, 0x6210, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c,
+	0x639b, 0x601c, 0xd0fc, 0x1148, 0x7044, 0xd0e4, 0x1904, 0xae04,
+	0x080c, 0x9be7, 0x009e, 0x00be, 0x0005, 0x2009, 0x0211, 0x210c,
+	0x080c, 0x0d65, 0x968c, 0x0c00, 0x0150, 0x6010, 0x2058, 0xb800,
+	0xd0bc, 0x1904, 0xae08, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c,
+	0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, 0x0028, 0x1118, 0xa87b,
+	0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac,
+	0x0170, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0148, 0x7048, 0x9106,
+	0x1118, 0x704c, 0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038,
+	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xa867,
+	0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130,
+	0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, 0xad4e, 0x735c, 0xab86,
+	0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036,
+	0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xb41a, 0x003e,
+	0xd6cc, 0x0904, 0xad63, 0x7154, 0xa98a, 0x81ff, 0x0904, 0xad63,
+	0x9192, 0x0021, 0x1278, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
+	0x080c, 0xb41a, 0x2011, 0x0205, 0x2013, 0x0000, 0x080c, 0xbf06,
+	0x0804, 0xad63, 0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
+	0x0c50, 0x00a6, 0x2950, 0x080c, 0xb3b9, 0x00ae, 0x080c, 0xbf06,
+	0x080c, 0xb40a, 0x0804, 0xad65, 0x080c, 0xbb4f, 0x0804, 0xad7a,
+	0xa87c, 0xd0ac, 0x0904, 0xad8b, 0xa880, 0xd0bc, 0x1904, 0xad8b,
+	0x7348, 0xa838, 0x9306, 0x11c8, 0x734c, 0xa834, 0x931e, 0x0904,
+	0xad8b, 0xd6d4, 0x0190, 0xab38, 0x9305, 0x0904, 0xad8b, 0x0068,
+	0xa87c, 0xd0ac, 0x0904, 0xad56, 0xa838, 0xa934, 0x9105, 0x0904,
+	0xad56, 0xa880, 0xd0bc, 0x1904, 0xad56, 0x080c, 0xbb8c, 0x0804,
+	0xad7a, 0x00f6, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
+	0x00fe, 0x0021, 0x0005, 0x0011, 0x0005, 0x0005, 0x0096, 0x6003,
+	0x0002, 0x6007, 0x0043, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0128,
+	0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a,
+	0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203, 0x0e90,
+	0xac46, 0xab4a, 0xae36, 0xad3a, 0x6044, 0xd0fc, 0x190c, 0x98f1,
+	0x604b, 0x0000, 0x080c, 0x1ad2, 0x1118, 0x6144, 0x080c, 0x84fd,
+	0x009e, 0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
+	0x000a, 0x0005, 0xae89, 0xae89, 0xae89, 0xae89, 0xae89, 0xae89,
+	0xae89, 0xae89, 0xae89, 0xae89, 0xae8b, 0xae89, 0xae89, 0xae89,
+	0xae89, 0xae9c, 0xae89, 0xae89, 0xae89, 0xae89, 0xaec0, 0xae89,
+	0xae89, 0x080c, 0x0d65, 0x6004, 0x9086, 0x0040, 0x1110, 0x080c,
+	0x8874, 0x2019, 0x0001, 0x080c, 0x9286, 0x6003, 0x0002, 0x080c,
+	0xbf7e, 0x080c, 0x88d1, 0x0005, 0x6004, 0x9086, 0x0040, 0x1110,
+	0x080c, 0x8874, 0x2019, 0x0001, 0x080c, 0x9286, 0x080c, 0x88d1,
+	0x080c, 0x3006, 0x080c, 0xbf76, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xb847, 0x0150, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000,
+	0x080c, 0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7, 0x0005,
+	0x080c, 0x0d65, 0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007,
+	0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x0006, 0x0016, 0x2009,
+	0x1a48, 0x2104, 0x8000, 0x200a, 0x001e, 0x000e, 0xa992, 0xa88e,
+	0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaefa, 0xaef8,
+	0xaef8, 0xafb7, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaef8,
+	0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xb0fb, 0xaef8, 0xb105, 0xaef8,
+	0x080c, 0x0d65, 0x601c, 0xd0bc, 0x0178, 0xd084, 0x0168, 0xd0f4,
+	0x0120, 0xc084, 0x601e, 0x0804, 0xacea, 0x6114, 0x0096, 0x2148,
+	0xa87c, 0xc0e5, 0xa87e, 0x009e, 0x0076, 0x00a6, 0x00e6, 0x0096,
+	0x2071, 0x0260, 0x6114, 0x2150, 0x601c, 0xd0fc, 0x1110, 0x7644,
+	0x0008, 0x9036, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e,
+	0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0x00be, 0x86ff, 0x0904, 0xafb0, 0x9694, 0xff00, 0x9284, 0x0c00,
+	0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904,
+	0xafb0, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4,
+	0xb676, 0x0c38, 0x080c, 0x1022, 0x090c, 0x0d65, 0x2900, 0xb07a,
+	0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a,
+	0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000, 0x9635,
+	0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e,
+	0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118,
+	0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038,
+	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e,
+	0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c,
+	0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008,
+	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xb41a,
+	0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192,
+	0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c,
+	0xb41a, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc,
+	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xb3b9,
+	0x080c, 0x18f2, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001,
+	0x1959, 0x2004, 0x604a, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940,
+	0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002, 0x080c,
+	0xbf87, 0x0904, 0xb0f6, 0x604b, 0x0000, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xb0b5, 0xa978,
+	0xa868, 0xd0fc, 0x0904, 0xb076, 0x0016, 0xa87c, 0x0006, 0xa880,
+	0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002,
+	0x0904, 0xb044, 0x9086, 0x0028, 0x1904, 0xb030, 0xa87b, 0x001c,
+	0xb07b, 0x001c, 0x0804, 0xb04c, 0x6024, 0xd0f4, 0x11d0, 0xa838,
+	0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120, 0xa88c,
+	0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac, 0xa834,
+	0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024, 0xc0f5,
+	0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e, 0x00be,
+	0x601c, 0xc0fc, 0x601e, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c,
+	0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878,
+	0x2048, 0x080c, 0x0fd4, 0x009e, 0x080c, 0xbb8c, 0x0804, 0xb0f6,
+	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbe29,
+	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
+	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xaec2, 0xa87c, 0xb07e, 0xa890, 0xb092,
+	0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0,
+	0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0,
+	0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e,
+	0xa882, 0x000e, 0xa87e, 0x080c, 0xbf06, 0x001e, 0xa874, 0x0006,
+	0x2148, 0x080c, 0x0fd4, 0x001e, 0x0804, 0xb0e2, 0x0016, 0x00a6,
+	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086,
+	0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc,
+	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbe29, 0x0118,
+	0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007,
+	0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xaec2, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c,
+	0xb07e, 0x00ae, 0x080c, 0x0fd4, 0x009e, 0x080c, 0xbf06, 0xa974,
+	0x0016, 0x080c, 0xb40a, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118,
+	0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c,
+	0xbe29, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118,
+	0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xaec2, 0xa974, 0x0016, 0x080c,
+	0x67ac, 0x001e, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x82ff, 0x0110,
+	0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0120, 0x0016, 0x080c, 0x639b,
+	0x001e, 0x00be, 0xd1e4, 0x1120, 0x080c, 0x9be7, 0x009e, 0x0005,
+	0x080c, 0xbb4f, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0x080c,
+	0xbf87, 0x190c, 0x1900, 0x009e, 0x0005, 0x0096, 0x6114, 0x2148,
+	0xa83c, 0xa940, 0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000,
+	0xa867, 0x0103, 0x00b6, 0x6010, 0x2058, 0xa834, 0xa938, 0x9115,
+	0x11a0, 0x080c, 0x67ac, 0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8c0,
+	0x9005, 0x0110, 0x080c, 0x639b, 0x080c, 0x9be7, 0x00be, 0x009e,
+	0x0005, 0xa87c, 0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120,
+	0xa834, 0x080c, 0xaec2, 0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c,
+	0xbb8c, 0x0c60, 0x080c, 0x8874, 0x0010, 0x080c, 0x88d1, 0x601c,
+	0xd084, 0x0110, 0x080c, 0x1914, 0x080c, 0xb847, 0x01f0, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f, 0x00a0,
+	0xa867, 0x0103, 0x2009, 0x180c, 0x210c, 0xd18c, 0x1198, 0xd184,
+	0x1170, 0x6108, 0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xd51a,
+	0xa877, 0x0000, 0x080c, 0x6996, 0x009e, 0x0804, 0x9c21, 0xa87b,
+	0x0004, 0x0cb0, 0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb18c, 0xb18c, 0xb18c,
+	0xb18c, 0xb18c, 0xb18e, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c,
+	0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c,
+	0xb18c, 0xb1b2, 0xb18c, 0xb18c, 0x080c, 0x0d65, 0x080c, 0x5395,
+	0x01f8, 0x6014, 0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118,
+	0x7264, 0x9294, 0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000,
+	0xa864, 0x9086, 0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96,
+	0x0030, 0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6996, 0x009e,
+	0x0804, 0x9be7, 0x080c, 0x5395, 0x0dd8, 0x6014, 0x900e, 0x9016,
+	0x0c10, 0x9182, 0x0085, 0x0002, 0xb1cb, 0xb1c9, 0xb1c9, 0xb1d7,
+	0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9,
+	0xb1c9, 0x080c, 0x0d65, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091,
+	0x8000, 0x2009, 0x8020, 0x080c, 0x84d1, 0x012e, 0x0005, 0x0026,
+	0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220,
+	0x080c, 0xb835, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178,
+	0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb445,
+	0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007,
+	0x0087, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x9280,
+	0x0004, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824,
+	0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c, 0xbb8c, 0x00ce, 0x00ee,
+	0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004,
+	0x908a, 0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65,
+	0x9082, 0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014,
+	0x190c, 0x0d65, 0x080c, 0x8874, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xb847, 0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
+	0x080c, 0x6996, 0x009e, 0x080c, 0x9c21, 0x0804, 0x8936, 0xb24c,
+	0xb24e, 0xb24e, 0xb24c, 0xb24c, 0xb24c, 0xb24c, 0xb24c, 0xb24c,
+	0xb24c, 0xb24c, 0xb24c, 0xb24c, 0x080c, 0x0d65, 0x080c, 0x9c21,
+	0x0005, 0x9186, 0x0013, 0x1130, 0x6004, 0x9082, 0x0085, 0x2008,
+	0x0804, 0xb29d, 0x9186, 0x0027, 0x1558, 0x080c, 0x8874, 0x080c,
+	0x3006, 0x080c, 0xbf76, 0x0096, 0x6014, 0x2048, 0x080c, 0xb847,
+	0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
+	0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7, 0x0005, 0x9186,
+	0x0089, 0x0118, 0x9186, 0x008a, 0x1140, 0x080c, 0x9ab7, 0x0128,
+	0x9086, 0x000c, 0x0904, 0xb2d5, 0x0000, 0x080c, 0x9ca2, 0x0c70,
+	0x9186, 0x0014, 0x1d60, 0x080c, 0x8874, 0x0096, 0x6014, 0x2048,
+	0x080c, 0xb847, 0x0d00, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
+	0x0006, 0xa880, 0xc0ec, 0xa882, 0x0890, 0x0002, 0xb2ad, 0xb2ab,
+	0xb2ab, 0xb2ab, 0xb2ab, 0xb2ab, 0xb2c1, 0xb2ab, 0xb2ab, 0xb2ab,
+	0xb2ab, 0xb2ab, 0xb2ab, 0x080c, 0x0d65, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
+	0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000c,
+	0x0005, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
+	0x9186, 0x0035, 0x1118, 0x2001, 0x1957, 0x0010, 0x2001, 0x1958,
+	0x2004, 0x601a, 0x6003, 0x000e, 0x0005, 0x9182, 0x0092, 0x1220,
+	0x9182, 0x0085, 0x0208, 0x0012, 0x0804, 0x9ca2, 0xb2eb, 0xb2eb,
+	0xb2eb, 0xb2eb, 0xb2ed, 0xb33a, 0xb2eb, 0xb2eb, 0xb2eb, 0xb2eb,
+	0xb2eb, 0xb2eb, 0xb2eb, 0x080c, 0x0d65, 0x0096, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e,
+	0x0804, 0xb34e, 0x080c, 0xb847, 0x1118, 0x080c, 0xba36, 0x0068,
+	0x6014, 0x2048, 0x080c, 0xbf8d, 0x1110, 0x080c, 0xba36, 0xa867,
+	0x0103, 0x080c, 0xbf41, 0x080c, 0x6996, 0x00d6, 0x2c68, 0x080c,
+	0x9b91, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff,
+	0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e,
+	0x6910, 0x6112, 0x080c, 0xbcdb, 0x695c, 0x615e, 0x6023, 0x0001,
+	0x2009, 0x8020, 0x080c, 0x84d1, 0x2d60, 0x00de, 0x080c, 0x9be7,
+	0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x05a0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130,
+	0x9186, 0x001e, 0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68,
+	0x080c, 0xbed9, 0x11f0, 0x080c, 0x9b91, 0x01d8, 0x6106, 0x6003,
+	0x0001, 0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930,
+	0x6132, 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c,
+	0x613e, 0x695c, 0x615e, 0x080c, 0xbcdb, 0x2009, 0x8020, 0x080c,
+	0x84d1, 0x2d60, 0x00de, 0x0804, 0x9be7, 0x0096, 0x6014, 0x2048,
+	0x080c, 0xb847, 0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128,
+	0xc0ec, 0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b,
+	0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xbb4b, 0xa877, 0x0000,
+	0x080c, 0x6996, 0x080c, 0xba36, 0x009e, 0x0804, 0x9be7, 0x0016,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xb847, 0x0140, 0xa867, 0x0103,
+	0xa87b, 0x0028, 0xa877, 0x0000, 0x080c, 0x6996, 0x009e, 0x001e,
+	0x9186, 0x0013, 0x0158, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027,
+	0x0118, 0x080c, 0x9ca2, 0x0020, 0x080c, 0x8874, 0x080c, 0x9c21,
+	0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182,
+	0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098,
+	0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xb41a, 0x96b2,
+	0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022,
+	0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
+	0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8,
+	0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451,
+	0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
+	0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003,
+	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e,
+	0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130,
+	0xa807, 0x0000, 0x080c, 0x6996, 0x2a48, 0x0cb8, 0x080c, 0x6996,
+	0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080,
+	0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860,
+	0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00,
+	0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300,
+	0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109,
+	0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091,
+	0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e,
+	0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000,
+	0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb497,
+	0xb497, 0xb492, 0xb4bb, 0xb46f, 0xb492, 0xb471, 0xb492, 0xb46f,
+	0xb46f, 0xb492, 0xb492, 0xb492, 0xb46f, 0xb46f, 0xb46f, 0x080c,
+	0x0d65, 0x6010, 0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c, 0xb4bb,
+	0x0036, 0x6014, 0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118,
+	0x2019, 0x000c, 0x0038, 0xd094, 0x0118, 0x2019, 0x000d, 0x0010,
+	0x2019, 0x0010, 0x080c, 0xcdf9, 0x6023, 0x0006, 0x6003, 0x0007,
+	0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096,
+	0x86ff, 0x11e8, 0x6014, 0x2048, 0x080c, 0xb847, 0x01d0, 0x6043,
+	0xffff, 0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883,
+	0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6bb3, 0x080c,
+	0xbb4b, 0x080c, 0x698a, 0x080c, 0x9c21, 0x9085, 0x0001, 0x009e,
+	0x0005, 0x9006, 0x0ce0, 0x080c, 0x98c8, 0x080c, 0xbf9b, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0d65, 0x002b, 0x0106, 0x080c, 0x98e4,
+	0x010e, 0x0005, 0xb4da, 0xb508, 0xb4dc, 0xb52f, 0xb503, 0xb4da,
+	0xb492, 0xb497, 0xb497, 0xb492, 0xb492, 0xb492, 0xb492, 0xb492,
+	0xb492, 0xb492, 0x080c, 0x0d65, 0x86ff, 0x1510, 0x6020, 0x9086,
+	0x0006, 0x01f0, 0x0096, 0x6014, 0x2048, 0x080c, 0xb847, 0x0158,
+	0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4,
+	0x009e, 0x080c, 0xbb4b, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x84b3,
+	0x9085, 0x0001, 0x0005, 0x0066, 0x080c, 0x1914, 0x006e, 0x08a0,
+	0x00e6, 0x2071, 0x19b8, 0x7030, 0x9c06, 0x1120, 0x080c, 0x9206,
+	0x00ee, 0x0850, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150,
+	0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0x9382, 0x009e,
+	0x008e, 0x0040, 0x0066, 0x080c, 0x9102, 0x190c, 0x0d65, 0x080c,
+	0x9110, 0x006e, 0x00ee, 0x1904, 0xb4dc, 0x0804, 0xb492, 0x0036,
+	0x00e6, 0x2071, 0x19b8, 0x704c, 0x9c06, 0x1138, 0x901e, 0x080c,
+	0x9286, 0x00ee, 0x003e, 0x0804, 0xb4dc, 0x080c, 0x94b8, 0x00ee,
+	0x003e, 0x1904, 0xb4dc, 0x0804, 0xb492, 0x00c6, 0x0066, 0x6020,
+	0x9084, 0x000f, 0x001b, 0x006e, 0x00ce, 0x0005, 0xb565, 0xb627,
+	0xb78e, 0xb56d, 0x9c21, 0xb565, 0xcdeb, 0xbf83, 0xb627, 0xb55e,
+	0xb80d, 0xb55e, 0xb55e, 0xb55e, 0xb55e, 0xb55e, 0x080c, 0x0d65,
+	0x080c, 0xba5c, 0x1110, 0x080c, 0xa58f, 0x0005, 0x080c, 0x8874,
+	0x0804, 0x9be7, 0x601b, 0x0001, 0x0005, 0x080c, 0xb847, 0x0130,
+	0x6014, 0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x080c, 0x98c8,
+	0x080c, 0xbf9b, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0013,
+	0x0804, 0x98e4, 0xb592, 0xb594, 0xb5be, 0xb5d2, 0xb5fd, 0xb592,
+	0xb565, 0xb565, 0xb565, 0xb5d9, 0xb5d9, 0xb592, 0xb592, 0xb592,
+	0xb592, 0xb5e3, 0x080c, 0x0d65, 0x00e6, 0x6014, 0x0096, 0x2048,
+	0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b8, 0x7030, 0x9c06,
+	0x01d0, 0x0066, 0x080c, 0x9102, 0x190c, 0x0d65, 0x080c, 0x9110,
+	0x006e, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x2001, 0x1958, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c,
+	0x84b3, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014,
+	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xbf1b, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c,
+	0x84b3, 0x0005, 0x080c, 0x98c8, 0x080c, 0x9a39, 0x080c, 0x98e4,
+	0x0c28, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5,
+	0xa882, 0x009e, 0x0005, 0x080c, 0x5395, 0x01a8, 0x6014, 0x0096,
+	0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086,
+	0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0x080c, 0x6996, 0x009e, 0x0804, 0x9be7, 0x6014, 0x0096, 0x904d,
+	0x0508, 0x080c, 0xbf87, 0x01f0, 0x080c, 0x98e4, 0x2001, 0x180f,
+	0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037, 0x2c08, 0x080c,
+	0x159e, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c,
+	0x9c85, 0x0005, 0x009e, 0x080c, 0x1914, 0x0804, 0xb5be, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0xb63e, 0xb56a,
+	0xb640, 0xb63e, 0xb640, 0xb640, 0xb566, 0xb63e, 0xb560, 0xb560,
+	0xb63e, 0xb63e, 0xb63e, 0xb63e, 0xb63e, 0xb63e, 0x080c, 0x0d65,
+	0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a,
+	0x000c, 0x1a0c, 0x0d65, 0x00b6, 0x0013, 0x00be, 0x0005, 0xb65b,
+	0xb728, 0xb65d, 0xb69d, 0xb65d, 0xb69d, 0xb65d, 0xb66b, 0xb65b,
+	0xb69d, 0xb65b, 0xb68c, 0x080c, 0x0d65, 0x6004, 0x908e, 0x0016,
+	0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e,
+	0x0052, 0x0904, 0xb724, 0x6004, 0x080c, 0xba5c, 0x0904, 0xb741,
+	0x908e, 0x0004, 0x1110, 0x080c, 0x303b, 0x908e, 0x0021, 0x0904,
+	0xb745, 0x908e, 0x0022, 0x0904, 0xb789, 0x908e, 0x003d, 0x0904,
+	0xb745, 0x908e, 0x0039, 0x0904, 0xb749, 0x908e, 0x0035, 0x0904,
+	0xb749, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010,
+	0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c,
+	0x3006, 0x080c, 0xa58f, 0x0804, 0x9c21, 0x00c6, 0x00d6, 0x6104,
+	0x9186, 0x0016, 0x0904, 0xb715, 0x9186, 0x0002, 0x1904, 0xb6ea,
+	0x2001, 0x1836, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x70b7, 0x11b0,
+	0x080c, 0xbf61, 0x0138, 0x080c, 0x70da, 0x1120, 0x080c, 0x6fc2,
+	0x0804, 0xb772, 0x2001, 0x194e, 0x2003, 0x0001, 0x2001, 0x1800,
+	0x2003, 0x0001, 0x080c, 0x6fe8, 0x0804, 0xb772, 0x6010, 0x2058,
+	0x2001, 0x1836, 0x2004, 0xd0ac, 0x1904, 0xb772, 0xb8a0, 0x9084,
+	0xff80, 0x1904, 0xb772, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190,
+	0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
+	0x604b, 0x0000, 0x080c, 0x9b91, 0x0128, 0x2b00, 0x6012, 0x6023,
+	0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1836,
+	0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6f,
+	0x00ee, 0x080c, 0xa58f, 0x0030, 0x080c, 0xa58f, 0x080c, 0x3006,
+	0x080c, 0xbf76, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x303b,
+	0x012e, 0x00ee, 0x080c, 0x9c21, 0x0005, 0x2001, 0x0002, 0x080c,
+	0x61c1, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8, 0x080c,
+	0x8936, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x303b, 0x0804, 0xb699,
+	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xb6ea, 0x8001, 0xb842,
+	0x6003, 0x0001, 0x080c, 0x84d8, 0x080c, 0x8936, 0x00de, 0x00ce,
+	0x0898, 0x080c, 0xa58f, 0x0804, 0xb69b, 0x080c, 0xa5cb, 0x0804,
+	0xb69b, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xbed9, 0x00de, 0x0118,
+	0x080c, 0x9be7, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c, 0x00ff,
+	0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x603c, 0x600a, 0x2001, 0x1958, 0x2004, 0x601a, 0x602c, 0x2c08,
+	0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x2009, 0x8020, 0x080c,
+	0x84d1, 0x0005, 0x00de, 0x00ce, 0x080c, 0xa58f, 0x080c, 0x3006,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x303b, 0x6017, 0x0000,
+	0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x012e, 0x00ee,
+	0x0005, 0x080c, 0xa022, 0x1904, 0xb741, 0x0005, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d65, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e,
+	0x0005, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9,
+	0xb7a9, 0xb7a9, 0xb565, 0xb7a9, 0xb56a, 0xb7ab, 0xb56a, 0xb7b8,
+	0xb7a9, 0x080c, 0x0d65, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007,
+	0x008b, 0x6003, 0x000d, 0x2009, 0x8020, 0x080c, 0x84d1, 0x0005,
+	0x080c, 0xbf55, 0x0118, 0x080c, 0xbf68, 0x0010, 0x080c, 0xbf76,
+	0x080c, 0xba36, 0x080c, 0xb847, 0x0570, 0x080c, 0x3006, 0x080c,
+	0xb847, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006,
+	0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6996, 0x2c68,
+	0x080c, 0x9b91, 0x0150, 0x6810, 0x6012, 0x080c, 0xbcdb, 0x00c6,
+	0x2d60, 0x080c, 0x9c21, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000,
+	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84d8,
+	0x080c, 0x8936, 0x00c8, 0x080c, 0xbf55, 0x0138, 0x6034, 0x9086,
+	0x4000, 0x1118, 0x080c, 0x3006, 0x08d0, 0x6034, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c,
+	0x3006, 0x0868, 0x080c, 0x9c21, 0x0005, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0d65, 0x0002, 0xb823, 0xb823, 0xb825, 0xb825, 0xb825,
+	0xb823, 0xb823, 0x9c21, 0xb823, 0xb823, 0xb823, 0xb823, 0xb823,
+	0xb823, 0xb823, 0xb823, 0x080c, 0x0d65, 0x080c, 0x98c8, 0x080c,
+	0x9a39, 0x080c, 0x98e4, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006,
+	0x080c, 0x6996, 0x009e, 0x0804, 0x9be7, 0x9284, 0x0003, 0x1158,
+	0x9282, 0x1ddc, 0x0240, 0x2001, 0x1819, 0x2004, 0x9202, 0x1218,
+	0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096,
+	0x0006, 0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086,
+	0xf000, 0x0110, 0x080c, 0x10cd, 0x000e, 0x009e, 0x0005, 0x00e6,
+	0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1ddc,
+	0x2071, 0x1800, 0x7350, 0x7070, 0x9302, 0x1640, 0x6020, 0x9206,
+	0x11f8, 0x080c, 0xbf61, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004,
+	0x9086, 0x0004, 0x1148, 0x080c, 0x3006, 0x080c, 0xbf76, 0x00c6,
+	0x080c, 0x9c21, 0x00ce, 0x0060, 0x080c, 0xbc4d, 0x0148, 0x080c,
+	0xba5c, 0x1110, 0x080c, 0xa58f, 0x00c6, 0x080c, 0x9be7, 0x00ce,
+	0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e,
+	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188,
+	0x1000, 0x210c, 0x81ff, 0x0128, 0x2061, 0x1b02, 0x6112, 0x080c,
+	0x3006, 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b91, 0x01b0,
+	0x665e, 0x2b00, 0x6012, 0x080c, 0x5395, 0x0118, 0x080c, 0xb978,
+	0x0168, 0x080c, 0xbcdb, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c,
+	0x9c85, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9c58, 0x0580,
+	0x605f, 0x0000, 0x2b00, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0003,
+	0x0016, 0x080c, 0x98c8, 0x080c, 0x863b, 0x0076, 0x903e, 0x080c,
+	0x852a, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x080c, 0x98e4, 0x001e,
+	0xd184, 0x0128, 0x080c, 0x9be7, 0x9085, 0x0001, 0x0070, 0x080c,
+	0x5395, 0x0128, 0xd18c, 0x1170, 0x080c, 0xb978, 0x0148, 0x2009,
+	0x004c, 0x080c, 0x9c85, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d, 0x0010,
+	0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c, 0x9b91,
+	0x2c78, 0x0590, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021,
+	0x0005, 0x080c, 0xb98a, 0x9186, 0x004d, 0x0118, 0x9186, 0x004e,
+	0x0148, 0x2001, 0x1951, 0x200c, 0xd1fc, 0x0168, 0x2f60, 0x080c,
+	0x9be7, 0x00d0, 0x2001, 0x1950, 0x200c, 0xd1fc, 0x0120, 0x2f60,
+	0x080c, 0x9be7, 0x0088, 0x2f60, 0x080c, 0x5395, 0x0138, 0xd18c,
+	0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e, 0x0016,
+	0x080c, 0x9c85, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe,
+	0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0x9b91, 0x2c78, 0x0508,
+	0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021, 0x0004,
+	0x0489, 0x009e, 0x2001, 0x194f, 0x200c, 0xd1fc, 0x0120, 0x2f60,
+	0x080c, 0x9be7, 0x0060, 0x2f60, 0x080c, 0x5395, 0x0120, 0xd18c,
+	0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0x9c85, 0x9085,
+	0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98,
+	0x00c6, 0x080c, 0x4878, 0x00ce, 0x1120, 0x080c, 0x9be7, 0x9006,
+	0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016, 0x9085,
+	0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x98c8, 0x080c, 0x644f, 0x0158, 0x2001, 0xb991, 0x0006, 0x900e,
+	0x2400, 0x080c, 0x6bb3, 0x080c, 0x6996, 0x000e, 0x0807, 0x2418,
+	0x080c, 0x883a, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001,
+	0x2608, 0x080c, 0x8655, 0x008e, 0x080c, 0x852a, 0x2f08, 0x2648,
+	0x080c, 0xcfc8, 0xb93c, 0x81ff, 0x090c, 0x872c, 0x080c, 0x98e4,
+	0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9b91, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbcdb,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0x9c85,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9c58, 0x01b8, 0x660a, 0x2b08,
+	0x6112, 0x080c, 0xbcdb, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6,
+	0x2c78, 0x080c, 0x164f, 0x00fe, 0x2009, 0x0021, 0x080c, 0x9c85,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
+	0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0x9b91,
+	0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0x9c85, 0x9085, 0x0001,
+	0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9c58, 0x0188, 0x2b08, 0x6112, 0x080c,
+	0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c,
+	0x9c85, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6,
+	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0118, 0x8211, 0xba3e, 0x1140,
+	0xb8c0, 0x9005, 0x0128, 0xb888, 0x9005, 0x1110, 0xb88b, 0x0001,
+	0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002,
+	0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085,
+	0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020, 0x9086,
+	0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xb847, 0x0168, 0xa864,
+	0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868,
+	0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c58, 0x0198,
+	0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x080c, 0x3006, 0x2009, 0x0028, 0x080c, 0x9c85, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8,
+	0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c,
+	0xa818, 0x00be, 0x080c, 0xaa57, 0x6003, 0x0001, 0x6007, 0x0029,
+	0x080c, 0x84d8, 0x080c, 0x8936, 0x0078, 0x6014, 0x0096, 0x2048,
+	0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xbe9a,
+	0x080c, 0xa58f, 0x080c, 0x9be7, 0x0005, 0x0096, 0x6014, 0x904d,
+	0x090c, 0x0d65, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6996, 0x012e, 0x009e, 0x080c, 0x9be7, 0x0c30, 0x0096, 0x9186,
+	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x61c1, 0x00e8, 0x9186,
+	0x0015, 0x1510, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x11e0,
+	0x6010, 0x00b6, 0x2058, 0x080c, 0x630b, 0x00be, 0x080c, 0xab28,
+	0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160,
+	0x2001, 0x0006, 0x080c, 0x61c1, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0170, 0x080c, 0x9ff6, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0528, 0x080c, 0xa58f, 0x080c, 0x9be7, 0x009e, 0x0005, 0x6014,
+	0x6310, 0x2358, 0x904d, 0x090c, 0x0d65, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x655f, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6996, 0x012e, 0x080c, 0x9be7, 0x08f8, 0x6014, 0x904d,
+	0x090c, 0x0d65, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6996, 0x012e, 0x080c, 0x9be7, 0x0840, 0xa878, 0x9086, 0x0005,
+	0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b,
+	0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009,
+	0x8023, 0x080c, 0x84d1, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0130, 0x0066, 0x6020, 0x9084, 0x000f,
+	0x001b, 0x006e, 0x00ce, 0x0005, 0xb565, 0xbb7e, 0xbb7e, 0xbb81,
+	0xd2c2, 0xd2dd, 0xd2e0, 0xb565, 0xb565, 0xb565, 0xb565, 0xb565,
+	0xb565, 0xb565, 0xb565, 0xb565, 0x080c, 0x0d65, 0xa001, 0xa001,
+	0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110,
+	0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0550, 0x2001, 0x1833, 0x2004, 0x9005, 0x1540,
+	0x00f6, 0x2c78, 0x080c, 0x9b91, 0x0508, 0x7810, 0x6012, 0x080c,
+	0xbcdb, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00,
+	0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023,
+	0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x795c, 0x615e, 0x2009,
+	0x8020, 0x080c, 0x84d1, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe,
+	0x2001, 0x1959, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096, 0x6814,
+	0x2048, 0x681c, 0xd0fc, 0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4,
+	0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f,
+	0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c,
+	0x0fd4, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803, 0x0002,
+	0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0, 0x681c,
+	0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00,
+	0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c,
+	0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a,
+	0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x695c,
+	0x615e, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x84d1, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4,
+	0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230,
+	0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e,
+	0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836,
+	0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4,
+	0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840,
+	0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, 0x6004,
+	0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, 0x0036,
+	0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e,
+	0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110,
+	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x00e6, 0x2001, 0x1953, 0x200c, 0x8000, 0x2014, 0x2001,
+	0x0032, 0x080c, 0x8419, 0x2001, 0x1957, 0x82ff, 0x1110, 0x2011,
+	0x0014, 0x2202, 0x2001, 0x1955, 0x200c, 0x8000, 0x2014, 0x2071,
+	0x193d, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8419, 0x2001,
+	0x1958, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1959,
+	0x9288, 0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0x98b9, 0x2001,
+	0x1a59, 0x2102, 0x2001, 0x0032, 0x080c, 0x159e, 0x080c, 0x6648,
+	0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x00e6, 0x2001, 0x1957, 0x2003, 0x0028, 0x2001, 0x1958, 0x2003,
+	0x0014, 0x2071, 0x193d, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001,
+	0x1959, 0x2009, 0x001e, 0x2102, 0x2001, 0x0017, 0x080c, 0x98b9,
+	0x2001, 0x1a59, 0x2102, 0x2001, 0x0032, 0x080c, 0x159e, 0x00ee,
+	0x001e, 0x000e, 0x0005, 0x0096, 0x6060, 0x904d, 0x0110, 0x080c,
+	0x1054, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9b91, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0x9c85, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x708c, 0x9086, 0x0018,
+	0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c,
+	0x89f5, 0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54,
+	0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e,
+	0x080c, 0x305b, 0x080c, 0x9ff6, 0x0020, 0x080c, 0xa58f, 0x080c,
+	0x9be7, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54, 0x9206,
+	0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b91,
+	0x0188, 0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x004d, 0x080c, 0x9c85, 0x9085, 0x0001, 0x012e,
 	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9c3d, 0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbcc0,
-	0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c, 0x164f,
-	0x00fe, 0x2009, 0x0021, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126,
-	0x0016, 0x2091, 0x8000, 0x080c, 0x9b76, 0x0198, 0x660a, 0x2b08,
-	0x6112, 0x080c, 0xbcc0, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e,
-	0x0016, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x001e, 0x012e, 0x00ce,
-	0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x9c3d, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbcc0, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0x9c6a, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830,
-	0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c,
-	0x82ff, 0x0118, 0x8211, 0xba3e, 0x1140, 0xb8c0, 0x9005, 0x0128,
-	0xb888, 0x9005, 0x1110, 0xb88b, 0x0001, 0x00be, 0x002e, 0x0005,
-	0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140, 0x908e, 0x0003,
-	0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e,
-	0x0005, 0x0006, 0x0096, 0x6020, 0x9086, 0x0004, 0x0190, 0x6014,
-	0x904d, 0x080c, 0xb82c, 0x0168, 0xa864, 0x9086, 0x0139, 0x0158,
-	0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x9c3d, 0x0198, 0x2b08, 0x6112, 0x080c,
-	0xbcc0, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c, 0x3003, 0x2009,
-	0x0028, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011, 0x1823, 0x2204,
-	0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xa7fd, 0x00be, 0x080c,
-	0xaa3c, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c, 0x84b0, 0x080c,
-	0x890e, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc,
-	0x0148, 0x2001, 0x0001, 0x080c, 0xbe7f, 0x080c, 0xa574, 0x080c,
-	0x9bcc, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c, 0x0d65, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
-	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0x009e,
-	0x080c, 0x9bcc, 0x0c30, 0x0096, 0x9186, 0x0016, 0x1128, 0x2001,
-	0x0004, 0x080c, 0x61ba, 0x00e8, 0x9186, 0x0015, 0x1510, 0x2011,
-	0x1823, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6, 0x2058,
-	0x080c, 0x6304, 0x00be, 0x080c, 0xab0d, 0x1198, 0x6010, 0x00b6,
-	0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001, 0x0006, 0x080c,
-	0x61ba, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c, 0x9fdb,
-	0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c, 0xa574,
-	0x080c, 0x9bcc, 0x009e, 0x0005, 0x6014, 0x6310, 0x2358, 0x904d,
-	0x090c, 0x0d65, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0x900e, 0x080c, 0x6558, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e,
-	0x080c, 0x9bcc, 0x08f8, 0x6014, 0x904d, 0x090c, 0x0d65, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867,
-	0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e, 0x080c,
-	0x9bcc, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108, 0x0009, 0x0005,
-	0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b, 0x0000, 0x6017, 0x0000,
-	0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c, 0x84a9,
-	0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0130, 0x0066, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x00ce,
-	0x0005, 0xb54a, 0xbb63, 0xbb63, 0xbb66, 0xd2a0, 0xd2bb, 0xd2be,
-	0xb54a, 0xb54a, 0xb54a, 0xb54a, 0xb54a, 0xb54a, 0xb54a, 0xb54a,
-	0xb54a, 0x080c, 0x0d65, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014,
-	0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e,
-	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550,
-	0x2001, 0x1833, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c,
-	0x9b76, 0x0508, 0x7810, 0x6012, 0x080c, 0xbcc0, 0x7820, 0x9086,
-	0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808,
-	0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035,
-	0x6003, 0x0001, 0x795c, 0x615e, 0x2009, 0x8020, 0x080c, 0x84a9,
-	0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1959, 0x2004,
-	0x604a, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0x681c, 0xd0fc,
-	0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4, 0x0180, 0xc0e4, 0xa87e,
-	0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000, 0xd0cc, 0x0130,
-	0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x6830, 0x6036,
-	0x908e, 0x0001, 0x0148, 0x6803, 0x0002, 0x9086, 0x0005, 0x0170,
-	0x9006, 0x602e, 0x6032, 0x00d0, 0x681c, 0xc085, 0x681e, 0x6803,
-	0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00, 0x6826, 0x6814, 0x2048,
-	0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c, 0x9103, 0x1e48, 0x683c,
-	0x602e, 0x6838, 0x9084, 0xfffc, 0x683a, 0x6032, 0x2d00, 0x603a,
-	0x6808, 0x603e, 0x6910, 0x6112, 0x695c, 0x615e, 0x6023, 0x0001,
-	0x6007, 0x0039, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84a9,
-	0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4, 0x0510, 0xd0f4, 0x11f8,
-	0x6038, 0x940a, 0x603c, 0x9303, 0x0230, 0x9105, 0x0120, 0x6024,
-	0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e, 0xac3e, 0xab42, 0x0046,
-	0x0036, 0x2400, 0xacac, 0x9402, 0xa836, 0x2300, 0xabb0, 0x9303,
-	0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4, 0x0000, 0x6026, 0x0005,
-	0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840, 0x603e, 0x6024, 0xc0f5,
-	0x6026, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0034, 0x01b8,
-	0x908e, 0x0035, 0x01a0, 0x908e, 0x0036, 0x0188, 0x908e, 0x0037,
-	0x0170, 0x908e, 0x0038, 0x0158, 0x908e, 0x0039, 0x0140, 0x908e,
-	0x003a, 0x0128, 0x908e, 0x003b, 0x0110, 0x9085, 0x0001, 0x001e,
-	0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x2001,
-	0x1953, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x83f1,
-	0x2001, 0x1957, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
-	0x1955, 0x200c, 0x8000, 0x2014, 0x2071, 0x193d, 0x711a, 0x721e,
-	0x2001, 0x0064, 0x080c, 0x83f1, 0x2001, 0x1958, 0x82ff, 0x1110,
-	0x2011, 0x0014, 0x2202, 0x2001, 0x1959, 0x9288, 0x000a, 0x2102,
-	0x2001, 0x0017, 0x080c, 0x989e, 0x2001, 0x1a59, 0x2102, 0x2001,
-	0x0032, 0x080c, 0x159e, 0x080c, 0x6641, 0x00ee, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1957,
-	0x2003, 0x0028, 0x2001, 0x1958, 0x2003, 0x0014, 0x2071, 0x193d,
-	0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1959, 0x2009, 0x001e,
-	0x2102, 0x2001, 0x0017, 0x080c, 0x989e, 0x2001, 0x1a59, 0x2102,
-	0x2001, 0x0032, 0x080c, 0x159e, 0x00ee, 0x001e, 0x000e, 0x0005,
-	0x0096, 0x6060, 0x904d, 0x0110, 0x080c, 0x1054, 0x009e, 0x0005,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b76, 0x0180,
-	0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
-	0x0033, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
-	0x0015, 0x1500, 0x708c, 0x9086, 0x0018, 0x11e0, 0x6014, 0x2048,
-	0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x89cd, 0x01d8, 0x7078,
-	0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54, 0x9206, 0x1140, 0x6210,
-	0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c, 0x3054, 0x080c,
-	0x9fdb, 0x0020, 0x080c, 0xa574, 0x080c, 0x9bcc, 0x00fe, 0x00ee,
-	0x009e, 0x0005, 0x705c, 0xaa54, 0x9206, 0x0d48, 0x0c80, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9b76, 0x0188, 0x2b08, 0x6112,
-	0x080c, 0xbcc0, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x004d,
-	0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0x9b76,
-	0x0180, 0x2b08, 0x6112, 0x080c, 0xbcc0, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x001e, 0x080c, 0x9c6a, 0x9085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036, 0x0046,
-	0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186,
-	0x0015, 0x1568, 0x718c, 0x6014, 0x2048, 0xa814, 0x8003, 0x9106,
-	0x1530, 0x20e1, 0x0000, 0x2001, 0x1971, 0x2003, 0x0000, 0x6014,
-	0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007, 0x9094, 0x003f,
-	0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0, 0x2001, 0x1971,
-	0x0016, 0x200c, 0x080c, 0xc529, 0x001e, 0xa804, 0x9005, 0x0110,
-	0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103, 0x0010, 0x080c,
-	0xa574, 0x080c, 0x9bcc, 0x00fe, 0x00ee, 0x009e, 0x006e, 0x005e,
-	0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x708c, 0x9086, 0x0004,
-	0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x89cd, 0x01a8, 0x7078,
-	0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78, 0x9206, 0x1110, 0x080c,
-	0x3003, 0x080c, 0x9fdb, 0x0020, 0x080c, 0xa574, 0x080c, 0x9bcc,
-	0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa78, 0x9206, 0x0d78,
-	0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
-	0x1550, 0x708c, 0x9086, 0x0004, 0x1530, 0x6014, 0x2048, 0x2c78,
-	0x080c, 0x89cd, 0x05f0, 0x7078, 0xaacc, 0x9206, 0x1180, 0x707c,
-	0xaad0, 0x9206, 0x1160, 0x080c, 0x3003, 0x0016, 0xa998, 0xaab0,
-	0x9284, 0x1000, 0xc0fd, 0x080c, 0x533e, 0x001e, 0x0010, 0x080c,
-	0x5127, 0x080c, 0xb82c, 0x0508, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x0080, 0x080c, 0xb82c, 0x01b8, 0x6014, 0x2048,
-	0x080c, 0x5127, 0x1d70, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
-	0x080c, 0x698f, 0x012e, 0x080c, 0x9bcc, 0x00fe, 0x00ee, 0x009e,
-	0x0005, 0x705c, 0xaad0, 0x9206, 0x0930, 0x0888, 0x0016, 0x0026,
-	0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0150,
-	0xa890, 0x9106, 0x1118, 0xa88c, 0x9206, 0x0120, 0xa992, 0xaa8e,
-	0x9085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00b6, 0x00d6, 0x0036,
-	0x080c, 0xb82c, 0x0904, 0xbe7b, 0x0096, 0x6314, 0x2348, 0xa87a,
-	0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009,
-	0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x6558, 0x1108, 0xc185,
-	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0,
-	0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f9f, 0x20a9, 0x0004,
-	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0f9f, 0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007,
-	0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2,
-	0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x6983,
-	0x6017, 0x0000, 0x009e, 0x003e, 0x00de, 0x00be, 0x0005, 0x0026,
-	0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6, 0x6214, 0x2248, 0x6210,
-	0x2258, 0x2079, 0x0260, 0x9096, 0x0000, 0x11a0, 0xb814, 0x9084,
-	0x00ff, 0x900e, 0x080c, 0x2424, 0x2118, 0x831f, 0x939c, 0xff00,
-	0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c,
-	0x48d1, 0x00a8, 0x9096, 0x0001, 0x1148, 0x89ff, 0x0180, 0xa89b,
-	0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x0048, 0x9096, 0x0002,
-	0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x00fe,
-	0x009e, 0x00be, 0x004e, 0x003e, 0x002e, 0x0005, 0x00c6, 0x0026,
-	0x0016, 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008, 0x6a2c, 0x080c,
-	0xb81a, 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186,
-	0x0006, 0x1190, 0x6838, 0x9206, 0x0140, 0x683c, 0x9206, 0x1160,
-	0x6108, 0x6838, 0x9106, 0x1140, 0x0020, 0x6008, 0x693c, 0x9106,
-	0x1118, 0x6010, 0x6910, 0x9106, 0x001e, 0x002e, 0x00ce, 0x0005,
-	0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc, 0x0188, 0x918c, 0x00ff,
-	0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c, 0x0f00, 0x810f, 0x918e,
-	0x0001, 0x1128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaea7, 0x0005,
-	0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e, 0x0499, 0x01e0,
-	0x080c, 0xb82c, 0x01c8, 0x080c, 0xba1b, 0x6037, 0x4000, 0x6014,
-	0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c, 0xba41, 0x1118,
-	0x080c, 0xa574, 0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff,
-	0x1129, 0x080c, 0x698f, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4,
-	0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118,
-	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xbb30, 0xa877,
-	0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005, 0x0006,
-	0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001,
-	0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010,
-	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4a6e,
-	0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1957,
-	0x2004, 0x601a, 0x0005, 0x2001, 0x1959, 0x2004, 0x604a, 0x0005,
-	0x080c, 0x9bcc, 0x0804, 0x890e, 0x611c, 0xd1fc, 0xa97c, 0x1108,
-	0xd1e4, 0x0005, 0x601c, 0xd0fc, 0xa87c, 0x1108, 0xd0e4, 0x0005,
-	0x601c, 0xd0fc, 0xc0fc, 0x601e, 0xa87c, 0x1108, 0xd0e4, 0x0005,
-	0x6044, 0xd0fc, 0x0160, 0xd0dc, 0x1128, 0x908c, 0x000f, 0x9186,
-	0x0005, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x0005,
-	0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x001b,
-	0x006e, 0x00be, 0x0005, 0xbfab, 0xc684, 0xc7d3, 0xbfab, 0xbfab,
-	0xbfab, 0xbfab, 0xbfab, 0xbfe2, 0xc851, 0xbfab, 0xbfab, 0xbfab,
-	0xbfab, 0xbfab, 0xbfab, 0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0xbfc6, 0xcd68,
-	0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xcd17, 0xcdba,
-	0xbfc6, 0xd3db, 0xd40f, 0xd3db, 0xd40f, 0xbfc6, 0x080c, 0x0d65,
-	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65, 0x6000, 0x000a, 0x0005,
-	0xbfe0, 0xca2d, 0xcaf6, 0xcb18, 0xcb93, 0xbfe0, 0xcc8d, 0xcc1b,
-	0xc85b, 0xccef, 0xcd04, 0xbfe0, 0xbfe0, 0xbfe0, 0xbfe0, 0xbfe0,
-	0x080c, 0x0d65, 0x91b2, 0x0053, 0x1a0c, 0x0d65, 0x2100, 0x91b2,
-	0x0040, 0x1a04, 0xc427, 0x0002, 0xc02c, 0xc218, 0xc02c, 0xc02c,
-	0xc02c, 0xc221, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c,
-	0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c,
-	0xc02c, 0xc02c, 0xc02c, 0xc02e, 0xc095, 0xc0a4, 0xc108, 0xc133,
-	0xc1ab, 0xc203, 0xc02c, 0xc02c, 0xc224, 0xc02c, 0xc02c, 0xc239,
-	0xc246, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc02c, 0xc2c9, 0xc02c,
-	0xc02c, 0xc2dd, 0xc02c, 0xc02c, 0xc298, 0xc02c, 0xc02c, 0xc02c,
-	0xc2f5, 0xc02c, 0xc02c, 0xc02c, 0xc372, 0xc02c, 0xc02c, 0xc02c,
-	0xc02c, 0xc02c, 0xc02c, 0xc3ef, 0x080c, 0x0d65, 0x080c, 0x661e,
-	0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009,
-	0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017,
-	0x0000, 0x0804, 0xc211, 0x080c, 0x6607, 0x00e6, 0x00c6, 0x0036,
-	0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029,
-	0x080c, 0x98ad, 0x080c, 0x8613, 0x0076, 0x903e, 0x080c, 0x8502,
-	0x2c08, 0x080c, 0xcfa6, 0x007e, 0x001e, 0x080c, 0x98c9, 0x001e,
-	0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x6278,
-	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1268, 0x0016, 0x0026,
-	0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x2c08, 0x080c, 0xd587,
-	0x002e, 0x001e, 0x1178, 0x080c, 0xced5, 0x1904, 0xc100, 0x080c,
-	0xce71, 0x1120, 0x6007, 0x0008, 0x0804, 0xc211, 0x6007, 0x0009,
-	0x0804, 0xc211, 0x080c, 0xd0dc, 0x0128, 0x080c, 0xced5, 0x0d78,
-	0x0804, 0xc100, 0x6017, 0x1900, 0x0c88, 0x080c, 0x3149, 0x1904,
-	0xc424, 0x6106, 0x080c, 0xce24, 0x6007, 0x0006, 0x0804, 0xc211,
-	0x6007, 0x0007, 0x0804, 0xc211, 0x080c, 0xd44b, 0x1904, 0xc424,
-	0x080c, 0x3149, 0x1904, 0xc424, 0x00d6, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001, 0x0001, 0x080c,
-	0x61a6, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0188, 0x9686,
-	0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0140,
-	0x9686, 0x0004, 0x0128, 0x9686, 0x0005, 0x0110, 0x00de, 0x0480,
-	0x00e6, 0x2071, 0x0260, 0x7034, 0x9084, 0x0003, 0x1140, 0x7034,
-	0x9082, 0x0014, 0x0220, 0x7030, 0x9084, 0x0003, 0x0130, 0x00ee,
-	0x6017, 0x0000, 0x602f, 0x0007, 0x00b0, 0x00ee, 0x080c, 0xcf3c,
-	0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210, 0x2258, 0xbaa0,
-	0x900e, 0x080c, 0x3054, 0x002e, 0x080c, 0x6304, 0x6007, 0x000a,
-	0x00de, 0x0804, 0xc211, 0x6007, 0x000b, 0x00de, 0x0804, 0xc211,
-	0x080c, 0x3003, 0x080c, 0xbf5b, 0x6007, 0x0001, 0x0804, 0xc211,
-	0x080c, 0xd44b, 0x1904, 0xc424, 0x080c, 0x3149, 0x1904, 0xc424,
-	0x2071, 0x0260, 0x7034, 0x90b4, 0x0003, 0x1948, 0x90b2, 0x0014,
-	0x0a30, 0x7030, 0x9084, 0x0003, 0x1910, 0x6610, 0x2658, 0xbe04,
-	0x9686, 0x0707, 0x09e8, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e,
-	0x080c, 0x3054, 0x002e, 0x6007, 0x000c, 0x2001, 0x0001, 0x080c,
-	0xd567, 0x0804, 0xc211, 0x080c, 0x661e, 0x1140, 0x2001, 0x1836,
-	0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xc03b,
-	0x080c, 0x6607, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082,
-	0x0006, 0x06c0, 0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x61e6,
-	0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120,
-	0x9686, 0x0006, 0x1904, 0xc100, 0x080c, 0xcf49, 0x1120, 0x6007,
-	0x000e, 0x0804, 0xc211, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046,
-	0x080c, 0x3003, 0x080c, 0xbf5b, 0x004e, 0x0016, 0x9006, 0x2009,
-	0x1854, 0x210c, 0x0048, 0x2009, 0x0029, 0x080c, 0xd251, 0x6010,
-	0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001,
-	0x0804, 0xc211, 0x2001, 0x0001, 0x080c, 0x61a6, 0x0156, 0x0016,
-	0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0270,
-	0x080c, 0xabb0, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0168,
-	0x96b4, 0xff00, 0x8637, 0x9682, 0x0004, 0x0a04, 0xc100, 0x9682,
-	0x0007, 0x0a04, 0xc15c, 0x0804, 0xc100, 0x6017, 0x1900, 0x6007,
-	0x0009, 0x0804, 0xc211, 0x080c, 0x661e, 0x1140, 0x2001, 0x1836,
-	0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xc03b,
-	0x080c, 0x6607, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082,
-	0x0006, 0x0688, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120,
-	0x9686, 0x0006, 0x1904, 0xc100, 0x080c, 0xcf77, 0x1130, 0x080c,
-	0xce71, 0x1118, 0x6007, 0x0010, 0x04e0, 0x0046, 0x6410, 0x2458,
-	0xbca0, 0x0046, 0x080c, 0x3003, 0x080c, 0xbf5b, 0x004e, 0x0016,
-	0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009, 0x0029, 0x080c,
-	0xd251, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e,
-	0x6007, 0x0001, 0x00f0, 0x080c, 0xd0dc, 0x0140, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0006, 0x0980, 0x0804, 0xc100, 0x6017, 0x1900,
-	0x6007, 0x0009, 0x0070, 0x080c, 0x3149, 0x1904, 0xc424, 0x080c,
-	0xd44b, 0x1904, 0xc424, 0x080c, 0xc5c4, 0x1904, 0xc100, 0x6007,
-	0x0012, 0x6003, 0x0001, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0005,
-	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84b0, 0x080c, 0x890e,
-	0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c, 0xd44b, 0x1904, 0xc424,
-	0x080c, 0x3149, 0x1904, 0xc424, 0x080c, 0xc5c4, 0x1904, 0xc100,
-	0x6007, 0x0020, 0x6003, 0x0001, 0x080c, 0x84b0, 0x080c, 0x890e,
-	0x0005, 0x080c, 0x3149, 0x1904, 0xc424, 0x6007, 0x0023, 0x6003,
-	0x0001, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0005, 0x080c, 0xd44b,
-	0x1904, 0xc424, 0x080c, 0x3149, 0x1904, 0xc424, 0x080c, 0xc5c4,
-	0x1904, 0xc100, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7244,
-	0x9286, 0xffff, 0x0180, 0x2c08, 0x080c, 0xb81a, 0x01b0, 0x2260,
-	0x7240, 0x6008, 0x9206, 0x1188, 0x6010, 0x9190, 0x0004, 0x2214,
-	0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006, 0x080c, 0xd223,
-	0x1180, 0x7244, 0x9286, 0xffff, 0x01b0, 0x2160, 0x6007, 0x0026,
-	0x6017, 0x1700, 0x7214, 0x9296, 0xffff, 0x1180, 0x6007, 0x0025,
-	0x0068, 0x6020, 0x9086, 0x0007, 0x1d80, 0x6004, 0x9086, 0x0024,
-	0x1110, 0x080c, 0x9bcc, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001,
-	0x080c, 0x84b0, 0x080c, 0x890e, 0x00ee, 0x002e, 0x001e, 0x0005,
-	0x2001, 0x0001, 0x080c, 0x61a6, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xabb0,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0120, 0x6007, 0x0031, 0x0804,
-	0xc211, 0x080c, 0xa815, 0x080c, 0x70ac, 0x1190, 0x0006, 0x0026,
-	0x0036, 0x080c, 0x70c6, 0x1138, 0x080c, 0x73ac, 0x080c, 0x5cd5,
-	0x080c, 0x6fdd, 0x0010, 0x080c, 0x7080, 0x003e, 0x002e, 0x000e,
-	0x0005, 0x080c, 0x3149, 0x1904, 0xc424, 0x080c, 0xc5c4, 0x1904,
-	0xc100, 0x6106, 0x080c, 0xc5e0, 0x1120, 0x6007, 0x002b, 0x0804,
-	0xc211, 0x6007, 0x002c, 0x0804, 0xc211, 0x080c, 0xd44b, 0x1904,
-	0xc424, 0x080c, 0x3149, 0x1904, 0xc424, 0x080c, 0xc5c4, 0x1904,
-	0xc100, 0x6106, 0x080c, 0xc5e5, 0x1120, 0x6007, 0x002e, 0x0804,
-	0xc211, 0x6007, 0x002f, 0x0804, 0xc211, 0x080c, 0x3149, 0x1904,
-	0xc424, 0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058, 0xb904, 0x9184,
-	0x00ff, 0x9086, 0x0006, 0x0158, 0x9184, 0xff00, 0x8007, 0x9086,
-	0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0xc218, 0x080c,
-	0x538a, 0xd0e4, 0x0904, 0xc36f, 0x2071, 0x026c, 0x7010, 0x603a,
-	0x7014, 0x603e, 0x7108, 0x720c, 0x080c, 0x665c, 0x0140, 0x6010,
-	0x2058, 0xb810, 0x9106, 0x1118, 0xb814, 0x9206, 0x0510, 0x080c,
-	0x6658, 0x15b8, 0x2069, 0x1800, 0x687c, 0x9206, 0x1590, 0x6878,
-	0x9106, 0x1578, 0x7210, 0x080c, 0xb81a, 0x0590, 0x080c, 0xc4af,
-	0x0578, 0x080c, 0xd2cd, 0x0560, 0x622e, 0x6007, 0x0036, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x84a9, 0x00ce, 0x00de, 0x00ee,
-	0x0005, 0x7214, 0x9286, 0xffff, 0x0150, 0x080c, 0xb81a, 0x01c0,
-	0x9280, 0x0002, 0x2004, 0x7110, 0x9106, 0x1190, 0x08e0, 0x7210,
-	0x2c08, 0x9085, 0x0001, 0x080c, 0xd223, 0x2c10, 0x2160, 0x0140,
-	0x0890, 0x6007, 0x0037, 0x602f, 0x0009, 0x6017, 0x1500, 0x08b8,
-	0x6007, 0x0037, 0x602f, 0x0003, 0x6017, 0x1700, 0x0880, 0x6007,
-	0x0012, 0x0868, 0x080c, 0x3149, 0x1904, 0xc424, 0x6010, 0x2058,
-	0xb804, 0x9084, 0xff00, 0x8007, 0x9086, 0x0006, 0x1904, 0xc218,
-	0x00e6, 0x00d6, 0x00c6, 0x080c, 0x538a, 0xd0e4, 0x0904, 0xc3e7,
-	0x2069, 0x1800, 0x2071, 0x026c, 0x7008, 0x603a, 0x720c, 0x623e,
-	0x9286, 0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001,
-	0x080c, 0xd223, 0x2c10, 0x00ce, 0x05e8, 0x080c, 0xb81a, 0x05d0,
-	0x7108, 0x9280, 0x0002, 0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026,
-	0x2260, 0x080c, 0xb42a, 0x002e, 0x00ce, 0x7118, 0x918c, 0xff00,
-	0x810f, 0x9186, 0x0001, 0x0178, 0x9186, 0x0005, 0x0118, 0x9186,
-	0x0007, 0x1198, 0x9280, 0x0005, 0x2004, 0x9005, 0x0170, 0x080c,
-	0xc4af, 0x0904, 0xc368, 0x0056, 0x7510, 0x7614, 0x080c, 0xd2e6,
-	0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007, 0x003b, 0x602f,
-	0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
-	0x84a9, 0x0c78, 0x6007, 0x003b, 0x602f, 0x0003, 0x6017, 0x0300,
-	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84a9, 0x0c10, 0x6007,
-	0x003b, 0x602f, 0x000b, 0x6017, 0x0000, 0x0804, 0xc33f, 0x00e6,
-	0x0026, 0x080c, 0x661e, 0x0550, 0x080c, 0x6607, 0x080c, 0xd4bd,
-	0x1518, 0x2071, 0x1800, 0x70d8, 0x9085, 0x0003, 0x70da, 0x00f6,
-	0x2079, 0x0100, 0x72ac, 0x9284, 0x00ff, 0x707a, 0x78e6, 0x9284,
-	0xff00, 0x727c, 0x9205, 0x707e, 0x78ea, 0x00fe, 0x70e3, 0x0000,
-	0x080c, 0x665c, 0x0120, 0x2011, 0x19da, 0x2013, 0x07d0, 0xd0ac,
-	0x1128, 0x080c, 0x2ddb, 0x0010, 0x080c, 0xd4ef, 0x002e, 0x00ee,
-	0x080c, 0x9bcc, 0x0804, 0xc217, 0x080c, 0x9bcc, 0x0005, 0x2600,
-	0x0002, 0xc43b, 0xc43b, 0xc43b, 0xc43b, 0xc43b, 0xc43d, 0xc43b,
-	0xc43b, 0xc43b, 0xc43b, 0xc45a, 0xc43b, 0xc43b, 0xc43b, 0xc46c,
-	0xc479, 0xc4aa, 0xc43b, 0x080c, 0x0d65, 0x080c, 0xd44b, 0x1d20,
-	0x080c, 0x3149, 0x1d08, 0x080c, 0xc5c4, 0x1148, 0x7038, 0x6016,
-	0x6007, 0x0045, 0x6003, 0x0001, 0x080c, 0x84b0, 0x0005, 0x080c,
-	0x3003, 0x080c, 0xbf5b, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x84b0, 0x0005, 0x080c, 0xd44b, 0x1938, 0x080c, 0x3149, 0x1920,
-	0x080c, 0xc5c4, 0x1d60, 0x703c, 0x6016, 0x6007, 0x004a, 0x6003,
-	0x0001, 0x080c, 0x84b0, 0x0005, 0x080c, 0xc4cc, 0x0904, 0xc424,
-	0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x84b0, 0x080c, 0x890e,
-	0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134, 0x918c, 0x00ff,
-	0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140, 0x2001, 0x198e,
-	0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x198f, 0x2004, 0x9106,
-	0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276, 0x20a9, 0x0004,
-	0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xabc4, 0x009e,
-	0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c, 0x84b0, 0x080c,
-	0x890e, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016, 0x0ca0, 0x0016,
-	0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260, 0x6010, 0x2058,
-	0xb8c4, 0xd084, 0x0150, 0x7128, 0x6050, 0x9106, 0x1120, 0x712c,
-	0x604c, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce,
-	0x00be, 0x00ee, 0x001e, 0x0005, 0x0016, 0x0096, 0x0086, 0x00e6,
-	0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x708c,
-	0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x1971, 0x2003,
-	0x0000, 0x080c, 0x103b, 0x05a0, 0x2900, 0x6016, 0x708c, 0x8004,
-	0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9, 0x001e,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x1971,
-	0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x103b, 0x01c0,
-	0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832, 0x20a8,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001, 0x1971,
-	0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001, 0x0048,
-	0x2071, 0x1800, 0x708f, 0x0000, 0x6014, 0x2048, 0x080c, 0x0fd4,
-	0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e, 0x001e,
-	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c, 0xffff,
-	0x11a8, 0x080c, 0x202b, 0x2099, 0x026c, 0x2001, 0x0014, 0x3518,
-	0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003, 0x22a8,
-	0x8108, 0x080c, 0x202b, 0x2099, 0x0260, 0x0ca8, 0x080c, 0x202b,
-	0x2061, 0x1971, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312, 0x1218,
-	0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c,
-	0x202b, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x1971, 0x2019, 0x0280,
-	0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0260, 0x6006,
-	0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x2043, 0x20a1, 0x024c,
-	0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0418,
-	0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c, 0x2043,
-	0x20a1, 0x0240, 0x0c98, 0x080c, 0x2043, 0x2061, 0x1974, 0x6004,
-	0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0058,
-	0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c, 0x2043,
-	0x20a1, 0x0240, 0x0c98, 0x2061, 0x1974, 0x2019, 0x0260, 0x3400,
-	0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240, 0x6006, 0x8108,
-	0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066, 0x6610, 0x2658,
-	0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0170, 0x9686,
-	0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0128,
-	0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e, 0x00be, 0x0005,
-	0x00d6, 0x080c, 0xc65a, 0x00de, 0x0005, 0x00d6, 0x080c, 0xc667,
-	0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff, 0x9115,
-	0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c, 0xd567,
-	0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c, 0x00ff,
-	0x6824, 0x080c, 0x2424, 0x1148, 0x2001, 0x0001, 0x080c, 0xd567,
-	0x2110, 0x900e, 0x080c, 0x3054, 0x0018, 0x9085, 0x0001, 0x0008,
-	0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0x9c3d, 0x0598,
-	0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
-	0x080c, 0x2424, 0x1568, 0x080c, 0x6209, 0x1550, 0xbe12, 0xbd16,
-	0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xd44b, 0x11c8,
-	0x080c, 0x3149, 0x11b0, 0x080c, 0xc5c4, 0x0500, 0x2001, 0x0007,
-	0x080c, 0x61ba, 0x2001, 0x0007, 0x080c, 0x61e6, 0x6017, 0x0000,
-	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84b0,
-	0x0010, 0x080c, 0x9bcc, 0x9085, 0x0001, 0x00ce, 0x00be, 0x0005,
-	0x080c, 0x9bcc, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c, 0x9bcc,
-	0x9006, 0x0c98, 0x2069, 0x026d, 0x6800, 0x9082, 0x0010, 0x1228,
-	0x6017, 0x0000, 0x9085, 0x0001, 0x0008, 0x9006, 0x0005, 0x6017,
-	0x0000, 0x2069, 0x026c, 0x6808, 0x9084, 0xff00, 0x9086, 0x0800,
-	0x1190, 0x6904, 0x9186, 0x0018, 0x0118, 0x9186, 0x0014, 0x1158,
-	0x810f, 0x6800, 0x9084, 0x00ff, 0x910d, 0x6162, 0x908e, 0x0014,
-	0x0110, 0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c,
-	0x0d65, 0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04,
-	0xc7a7, 0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, 0x190c,
-	0x0d65, 0x2001, 0x0007, 0x080c, 0x61e6, 0x080c, 0x884c, 0x080c,
-	0x9c06, 0x080c, 0x890e, 0x0005, 0xc6e4, 0xc6e6, 0xc6e4, 0xc6e4,
-	0xc6e4, 0xc6e6, 0xc6f3, 0xc7a4, 0xc743, 0xc7a4, 0xc755, 0xc7a4,
-	0xc6f3, 0xc7a4, 0xc79c, 0xc7a4, 0xc79c, 0xc7a4, 0xc7a4, 0xc6e4,
-	0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4,
-	0xc6e4, 0xc6e4, 0xc6e6, 0xc6e4, 0xc7a4, 0xc6e4, 0xc6e4, 0xc7a4,
-	0xc6e4, 0xc7a1, 0xc7a4, 0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4, 0xc7a4,
-	0xc7a4, 0xc6e4, 0xc7a4, 0xc7a4, 0xc6e4, 0xc6ee, 0xc6e4, 0xc6e4,
-	0xc6e4, 0xc6e4, 0xc7a0, 0xc7a4, 0xc6e4, 0xc6e4, 0xc7a4, 0xc7a4,
-	0xc6e4, 0xc6e4, 0xc6e4, 0xc6e4, 0x080c, 0x0d65, 0x080c, 0xbf5e,
-	0x6003, 0x0002, 0x080c, 0x890e, 0x0804, 0xc7a6, 0x9006, 0x080c,
-	0x61a6, 0x0804, 0xc7a4, 0x080c, 0x6658, 0x1904, 0xc7a4, 0x9006,
-	0x080c, 0x61a6, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140,
-	0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x0428,
-	0x6010, 0x2058, 0xb884, 0x9005, 0x1178, 0x080c, 0xbf46, 0x1904,
-	0xc7a4, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4a6e,
-	0x004e, 0x003e, 0x0804, 0xc7a4, 0x080c, 0x317a, 0x1904, 0xc7a4,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079,
-	0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001, 0x0002, 0x080c,
-	0x61ba, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x84b0, 0x080c, 0x890e, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c,
-	0x813f, 0x0804, 0xc7a6, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0006, 0x0904, 0xc7a4, 0x9686, 0x0004, 0x0904,
-	0xc7a4, 0x2001, 0x0004, 0x0804, 0xc7a2, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0,
-	0x2021, 0x0006, 0x080c, 0x4a6e, 0x004e, 0x003e, 0x2001, 0x0006,
-	0x080c, 0xc7c0, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006, 0x080c,
-	0x61e6, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001, 0x0006,
-	0x080c, 0x61ba, 0x080c, 0x6658, 0x11f8, 0x2001, 0x1836, 0x2004,
-	0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x01a0,
-	0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x0804,
-	0xc72d, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0409, 0x0020,
-	0x0018, 0x0010, 0x080c, 0x61e6, 0x080c, 0x9bcc, 0x0005, 0x2600,
-	0x0002, 0xc7bb, 0xc7bb, 0xc7bb, 0xc7bb, 0xc7bb, 0xc7bd, 0xc7bb,
-	0xc7bb, 0xc7bb, 0xc7bb, 0xc7bd, 0xc7bb, 0xc7bb, 0xc7bb, 0xc7bd,
-	0xc7bd, 0xc7bd, 0xc7bd, 0x080c, 0x0d65, 0x080c, 0x9bcc, 0x0005,
-	0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184, 0x0138,
-	0x080c, 0x61ba, 0x9006, 0x080c, 0x61a6, 0x080c, 0x3034, 0x00de,
-	0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084, 0xff00,
-	0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0d65, 0x91b6, 0x0015, 0x1110,
-	0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0d65, 0x006b, 0x0005,
-	0xa655, 0xa655, 0xa655, 0xa655, 0xa655, 0xa655, 0xc83b, 0xc800,
-	0xa655, 0xa655, 0xa655, 0xa655, 0xa655, 0xa655, 0xa655, 0xa655,
-	0xa655, 0xa655, 0xc83b, 0xc842, 0xa655, 0xa655, 0xa655, 0xa655,
-	0x00f6, 0x080c, 0x6658, 0x11d8, 0x080c, 0xbf46, 0x11c0, 0x6010,
-	0x905d, 0x01a8, 0xb884, 0x9005, 0x0190, 0x9006, 0x080c, 0x61a6,
-	0x2001, 0x0002, 0x080c, 0x61ba, 0x6023, 0x0001, 0x6003, 0x0001,
-	0x6007, 0x0002, 0x080c, 0x84b0, 0x080c, 0x890e, 0x00d0, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x1190, 0x080c,
-	0x6269, 0x0118, 0x080c, 0x9bcc, 0x0060, 0xb810, 0x0006, 0xb814,
-	0x0006, 0x080c, 0x5cef, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c,
-	0x9bcc, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c,
-	0x9bcc, 0x0005, 0x080c, 0xaa39, 0x1148, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x84b0, 0x080c, 0x890e, 0x0010, 0x080c, 0x9bcc,
-	0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x080c, 0x884c,
-	0x080c, 0x9c06, 0x0005, 0x9182, 0x0040, 0x0002, 0xc871, 0xc871,
-	0xc871, 0xc871, 0xc873, 0xc871, 0xc871, 0xc871, 0xc871, 0xc871,
-	0xc871, 0xc871, 0xc871, 0xc871, 0xc871, 0xc871, 0xc871, 0xc871,
-	0xc871, 0x080c, 0x0d65, 0x0096, 0x00b6, 0x00d6, 0x00e6, 0x00f6,
+	0x0016, 0x080c, 0x9b91, 0x0180, 0x2b08, 0x6112, 0x080c, 0xbcdb,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9c85, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x718c, 0x6014, 0x2048,
+	0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x1971,
+	0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006,
+	0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x080c, 0xc545, 0x001e,
+	0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867,
+	0x0103, 0x0010, 0x080c, 0xa58f, 0x080c, 0x9be7, 0x00fe, 0x00ee,
+	0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8,
+	0x708c, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c,
+	0x89f5, 0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78,
+	0x9206, 0x1110, 0x080c, 0x3006, 0x080c, 0x9ff6, 0x0020, 0x080c,
+	0xa58f, 0x080c, 0x9be7, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c,
+	0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1550, 0x708c, 0x9086, 0x0004, 0x1530,
+	0x6014, 0x2048, 0x2c78, 0x080c, 0x89f5, 0x05f0, 0x7078, 0xaacc,
+	0x9206, 0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c, 0x3006,
+	0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5345,
+	0x001e, 0x0010, 0x080c, 0x512e, 0x080c, 0xb847, 0x0508, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xb847,
+	0x01b8, 0x6014, 0x2048, 0x080c, 0x512e, 0x1d70, 0xa87b, 0x0030,
+	0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091,
+	0x8000, 0xa867, 0x0139, 0x080c, 0x6996, 0x012e, 0x080c, 0x9be7,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaad0, 0x9206, 0x0930,
+	0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34,
+	0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c, 0x9206,
+	0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e, 0x0005,
+	0x00b6, 0x00d6, 0x0036, 0x080c, 0xb847, 0x0904, 0xbe96, 0x0096,
+	0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310,
+	0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c,
+	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96,
+	0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
+	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0f9f, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8,
+	0x9080, 0x000a, 0x2098, 0x080c, 0x0f9f, 0x00ce, 0x0090, 0xaa96,
+	0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110,
+	0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff,
+	0xa89e, 0x080c, 0x698a, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de,
+	0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6,
+	0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096, 0x0000,
+	0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2424, 0x2118,
+	0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c,
+	0x2011, 0x8018, 0x080c, 0x48d8, 0x00a8, 0x9096, 0x0001, 0x1148,
+	0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa,
+	0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6,
+	0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e, 0x002e,
+	0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110, 0x6a38,
+	0x0008, 0x6a2c, 0x080c, 0xb835, 0x01f0, 0x2260, 0x6120, 0x9186,
+	0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206, 0x0140,
+	0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140, 0x0020,
+	0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106, 0x001e,
+	0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc,
+	0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c,
+	0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xaec2, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036,
+	0x901e, 0x0499, 0x01e0, 0x080c, 0xb847, 0x01c8, 0x080c, 0xba36,
+	0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c,
+	0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f, 0x0040, 0xa867, 0x0103,
+	0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6996, 0x009e, 0x003e,
+	0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882,
+	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
+	0x080c, 0xbb4b, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004,
+	0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e,
+	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005,
+	0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
+	0x0007, 0x080c, 0x4a75, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81,
+	0x0005, 0x2001, 0x1957, 0x2004, 0x601a, 0x0005, 0x2001, 0x1959,
+	0x2004, 0x604a, 0x0005, 0x080c, 0x9be7, 0x0804, 0x8936, 0x611c,
+	0xd1fc, 0xa97c, 0x1108, 0xd1e4, 0x0005, 0x601c, 0xd0fc, 0xa87c,
+	0x1108, 0xd0e4, 0x0005, 0x601c, 0xd0fc, 0xc0fc, 0x601e, 0xa87c,
+	0x1108, 0xd0e4, 0x0005, 0x6044, 0xd0fc, 0x0160, 0xd0dc, 0x1128,
+	0x908c, 0x000f, 0x9186, 0x0005, 0x1118, 0x6003, 0x0003, 0x0010,
+	0x6003, 0x0001, 0x0005, 0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d65, 0x001b, 0x006e, 0x00be, 0x0005, 0xbfc6, 0xc6a0,
+	0xc7ef, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbffd, 0xc871,
+	0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0x080c, 0x0d65,
+	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e,
+	0x0005, 0xbfe1, 0xcd88, 0xbfe1, 0xbfe1, 0xbfe1, 0xbfe1, 0xbfe1,
+	0xbfe1, 0xcd37, 0xcdda, 0xbfe1, 0xd3fd, 0xd431, 0xd3fd, 0xd431,
+	0xbfe1, 0x080c, 0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65,
+	0x6000, 0x000a, 0x0005, 0xbffb, 0xca4d, 0xcb16, 0xcb38, 0xcbb3,
+	0xbffb, 0xccad, 0xcc3b, 0xc87b, 0xcd0f, 0xcd24, 0xbffb, 0xbffb,
+	0xbffb, 0xbffb, 0xbffb, 0x080c, 0x0d65, 0x91b2, 0x0053, 0x1a0c,
+	0x0d65, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xc443, 0x0002, 0xc047,
+	0xc234, 0xc047, 0xc047, 0xc047, 0xc23d, 0xc047, 0xc047, 0xc047,
+	0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047,
+	0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc049, 0xc0b0,
+	0xc0bf, 0xc123, 0xc14e, 0xc1c6, 0xc21f, 0xc047, 0xc047, 0xc240,
+	0xc047, 0xc047, 0xc255, 0xc262, 0xc047, 0xc047, 0xc047, 0xc047,
+	0xc047, 0xc2e5, 0xc047, 0xc047, 0xc2f9, 0xc047, 0xc047, 0xc2b4,
+	0xc047, 0xc047, 0xc047, 0xc311, 0xc047, 0xc047, 0xc047, 0xc38e,
+	0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc40b, 0x080c,
+	0x0d65, 0x080c, 0x6625, 0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc,
+	0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007, 0x0009,
+	0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xc22d, 0x080c, 0x660e,
+	0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0,
+	0x0026, 0x2019, 0x0029, 0x080c, 0x98c8, 0x080c, 0x863b, 0x0076,
+	0x903e, 0x080c, 0x852a, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x001e,
+	0x080c, 0x98e4, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610,
+	0x2658, 0x080c, 0x627f, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
+	0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
+	0x2c08, 0x080c, 0xd5a9, 0x002e, 0x001e, 0x1178, 0x080c, 0xcef7,
+	0x1904, 0xc11b, 0x080c, 0xce93, 0x1120, 0x6007, 0x0008, 0x0804,
+	0xc22d, 0x6007, 0x0009, 0x0804, 0xc22d, 0x080c, 0xd0fe, 0x0128,
+	0x080c, 0xcef7, 0x0d78, 0x0804, 0xc11b, 0x6017, 0x1900, 0x0c88,
+	0x080c, 0x3150, 0x1904, 0xc440, 0x6106, 0x080c, 0xce44, 0x6007,
+	0x0006, 0x0804, 0xc22d, 0x6007, 0x0007, 0x0804, 0xc22d, 0x080c,
+	0xd46d, 0x1904, 0xc440, 0x080c, 0x3150, 0x1904, 0xc440, 0x00d6,
+	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220,
+	0x2001, 0x0001, 0x080c, 0x61ad, 0x96b4, 0xff00, 0x8637, 0x9686,
+	0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff,
+	0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686, 0x0005,
+	0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9084,
+	0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030, 0x9084,
+	0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007, 0x00b0,
+	0x00ee, 0x080c, 0xcf5e, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x305b, 0x002e, 0x080c,
+	0x630b, 0x6007, 0x000a, 0x00de, 0x0804, 0xc22d, 0x6007, 0x000b,
+	0x00de, 0x0804, 0xc22d, 0x080c, 0x3006, 0x080c, 0xbf76, 0x6007,
+	0x0001, 0x0804, 0xc22d, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c,
+	0x3150, 0x1904, 0xc440, 0x2071, 0x0260, 0x7034, 0x90b4, 0x0003,
+	0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003, 0x1910,
+	0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026, 0x6210,
+	0x2258, 0xbaa0, 0x900e, 0x080c, 0x305b, 0x002e, 0x6007, 0x000c,
+	0x2001, 0x0001, 0x080c, 0xd589, 0x0804, 0xc22d, 0x080c, 0x6625,
+	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1110, 0x0804, 0xc056, 0x080c, 0x660e, 0x6610, 0x2658, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026, 0x2001,
+	0x0006, 0x080c, 0x61ed, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc11b, 0x080c,
+	0xcf6b, 0x1120, 0x6007, 0x000e, 0x0804, 0xc22d, 0x0046, 0x6410,
+	0x2458, 0xbca0, 0x0046, 0x080c, 0x3006, 0x080c, 0xbf76, 0x004e,
+	0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009, 0x0029,
+	0x080c, 0xd273, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
+	0x004e, 0x6007, 0x0001, 0x0804, 0xc22d, 0x2001, 0x0001, 0x080c,
+	0x61ad, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
+	0x1805, 0x2011, 0x0270, 0x080c, 0xabcb, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
+	0x0a04, 0xc11b, 0x9682, 0x0007, 0x0a04, 0xc177, 0x0804, 0xc11b,
+	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc22d, 0x080c, 0x6625,
+	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
+	0x1110, 0x0804, 0xc056, 0x080c, 0x660e, 0x6610, 0x2658, 0xbe04,
+	0x9684, 0x00ff, 0x9082, 0x0006, 0x0690, 0x0150, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc11b,
+	0x080c, 0xcf99, 0x1130, 0x080c, 0xce93, 0x1118, 0x6007, 0x0010,
+	0x04e0, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x3006,
+	0x080c, 0xbf76, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c,
+	0x0048, 0x2009, 0x0029, 0x080c, 0xd273, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
+	0xd0fe, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980,
+	0x0804, 0xc11b, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
+	0x3150, 0x1904, 0xc440, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c,
+	0xc5e0, 0x1904, 0xc11b, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
+	0x84d8, 0x080c, 0x8936, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x84d8, 0x080c, 0x8936, 0x0cb0, 0x6007, 0x0005, 0x0c68,
+	0x080c, 0xd46d, 0x1904, 0xc440, 0x080c, 0x3150, 0x1904, 0xc440,
+	0x080c, 0xc5e0, 0x1904, 0xc11b, 0x6007, 0x0020, 0x6003, 0x0001,
+	0x080c, 0x84d8, 0x080c, 0x8936, 0x0005, 0x080c, 0x3150, 0x1904,
+	0xc440, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x84d8, 0x080c,
+	0x8936, 0x0005, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c, 0x3150,
+	0x1904, 0xc440, 0x080c, 0xc5e0, 0x1904, 0xc11b, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
+	0x080c, 0xb835, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
+	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
+	0x2c08, 0x9006, 0x080c, 0xd245, 0x1180, 0x7244, 0x9286, 0xffff,
+	0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296,
+	0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007,
+	0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x9be7, 0x2160,
+	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x84d8, 0x080c, 0x8936,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x61ad,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xabcb, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0120, 0x6007, 0x0031, 0x0804, 0xc22d, 0x080c, 0xa830, 0x080c,
+	0x70b7, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x70d1, 0x1138,
+	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c, 0x6fe8, 0x0010, 0x080c,
+	0x708b, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x3150, 0x1904,
+	0xc440, 0x080c, 0xc5e0, 0x1904, 0xc11b, 0x6106, 0x080c, 0xc5fc,
+	0x1120, 0x6007, 0x002b, 0x0804, 0xc22d, 0x6007, 0x002c, 0x0804,
+	0xc22d, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c, 0x3150, 0x1904,
+	0xc440, 0x080c, 0xc5e0, 0x1904, 0xc11b, 0x6106, 0x080c, 0xc601,
+	0x1120, 0x6007, 0x002e, 0x0804, 0xc22d, 0x6007, 0x002f, 0x0804,
+	0xc22d, 0x080c, 0x3150, 0x1904, 0xc440, 0x00e6, 0x00d6, 0x00c6,
+	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
+	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
+	0x00ee, 0x0804, 0xc234, 0x080c, 0x5391, 0xd0e4, 0x0904, 0xc38b,
+	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
+	0x080c, 0x6663, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
+	0xb814, 0x9206, 0x0510, 0x080c, 0x665f, 0x15b8, 0x2069, 0x1800,
+	0x687c, 0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c,
+	0xb835, 0x0590, 0x080c, 0xc4cb, 0x0578, 0x080c, 0xd2ef, 0x0560,
+	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x84d1, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
+	0x0150, 0x080c, 0xb835, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
+	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xd245, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
+	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
+	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x3150,
+	0x1904, 0xc440, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0006, 0x1904, 0xc234, 0x00e6, 0x00d6, 0x00c6, 0x080c,
+	0x5391, 0xd0e4, 0x0904, 0xc403, 0x2069, 0x1800, 0x2071, 0x026c,
+	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
+	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd245, 0x2c10, 0x00ce,
+	0x05e8, 0x080c, 0xb835, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
+	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb445, 0x002e,
+	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
+	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
+	0x2004, 0x9005, 0x0170, 0x080c, 0xc4cb, 0x0904, 0xc384, 0x0056,
+	0x7510, 0x7614, 0x080c, 0xd308, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x0c78, 0x6007, 0x003b,
+	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x84d1, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
+	0x0000, 0x0804, 0xc35b, 0x00e6, 0x0026, 0x080c, 0x6625, 0x0550,
+	0x080c, 0x660e, 0x080c, 0xd4df, 0x1518, 0x2071, 0x1800, 0x70d8,
+	0x9085, 0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284,
+	0x00ff, 0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e,
+	0x78ea, 0x00fe, 0x70e3, 0x0000, 0x080c, 0x6663, 0x0120, 0x2011,
+	0x19da, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2ddb, 0x0010,
+	0x080c, 0xd511, 0x002e, 0x00ee, 0x080c, 0x9be7, 0x0804, 0xc233,
+	0x080c, 0x9be7, 0x0005, 0x2600, 0x0002, 0xc457, 0xc457, 0xc457,
+	0xc457, 0xc457, 0xc459, 0xc457, 0xc457, 0xc457, 0xc457, 0xc476,
+	0xc457, 0xc457, 0xc457, 0xc488, 0xc495, 0xc4c6, 0xc457, 0x080c,
+	0x0d65, 0x080c, 0xd46d, 0x1d20, 0x080c, 0x3150, 0x1d08, 0x080c,
+	0xc5e0, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
+	0x080c, 0x84d8, 0x0005, 0x080c, 0x3006, 0x080c, 0xbf76, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x84d8, 0x0005, 0x080c, 0xd46d,
+	0x1938, 0x080c, 0x3150, 0x1920, 0x080c, 0xc5e0, 0x1d60, 0x703c,
+	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x84d8, 0x0005,
+	0x080c, 0xc4e8, 0x0904, 0xc440, 0x6007, 0x004e, 0x6003, 0x0001,
+	0x080c, 0x84d8, 0x080c, 0x8936, 0x0005, 0x6007, 0x004f, 0x6017,
+	0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001,
+	0x1160, 0x7140, 0x2001, 0x198e, 0x2004, 0x9106, 0x11b0, 0x7144,
+	0x2001, 0x198f, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168,
+	0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
+	0x000a, 0x080c, 0xabdf, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x84d8, 0x080c, 0x8936, 0x0005, 0x6007, 0x0050,
+	0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6,
+	0x00c6, 0x2260, 0x6010, 0x2058, 0xb8c4, 0xd084, 0x0150, 0x7128,
+	0x6050, 0x9106, 0x1120, 0x712c, 0x604c, 0x9106, 0x0110, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005,
+	0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1,
+	0x0000, 0x2001, 0x1971, 0x2003, 0x0000, 0x080c, 0x103b, 0x05a0,
+	0x2900, 0x6016, 0x708c, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0,
+	0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x0471, 0x001e,
+	0x2940, 0x080c, 0x103b, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff,
+	0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x00b1, 0x001e,
+	0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x708f, 0x0000,
+	0x6014, 0x2048, 0x080c, 0x0fd4, 0x9006, 0x012e, 0x01de, 0x01ce,
+	0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x202b, 0x2099,
+	0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x202b, 0x2099,
+	0x0260, 0x0ca8, 0x080c, 0x202b, 0x2061, 0x1971, 0x6004, 0x2098,
+	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x202b, 0x2099, 0x0260, 0x0ca8,
+	0x2061, 0x1971, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006,
+	0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
+	0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8,
+	0x080c, 0x2043, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8,
+	0x22a8, 0x8108, 0x080c, 0x2043, 0x20a1, 0x0240, 0x0c98, 0x080c,
+	0x2043, 0x2061, 0x1974, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138,
+	0x22a8, 0x8108, 0x080c, 0x2043, 0x20a1, 0x0240, 0x0c98, 0x2061,
+	0x1974, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020,
+	0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296,
+	0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085,
+	0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xc676, 0x00de,
+	0x0005, 0x00d6, 0x080c, 0xc683, 0x1520, 0x680c, 0x908c, 0xff00,
+	0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4,
+	0x0130, 0x9006, 0x080c, 0xd589, 0x2009, 0x0001, 0x0078, 0xd1ec,
+	0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x2424, 0x1148,
+	0x2001, 0x0001, 0x080c, 0xd589, 0x2110, 0x900e, 0x080c, 0x305b,
+	0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
+	0x00c6, 0x080c, 0x9c58, 0x0598, 0x0016, 0x0026, 0x00c6, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x1568, 0x080c,
+	0x6210, 0x1550, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00,
+	0x6012, 0x080c, 0xd46d, 0x11c8, 0x080c, 0x3150, 0x11b0, 0x080c,
+	0xc5e0, 0x0500, 0x2001, 0x0007, 0x080c, 0x61c1, 0x2001, 0x0007,
+	0x080c, 0x61ed, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x84d8, 0x0010, 0x080c, 0x9be7, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0x9be7, 0x00ce, 0x002e,
+	0x001e, 0x0ca8, 0x080c, 0x9be7, 0x9006, 0x0c98, 0x2069, 0x026d,
+	0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808,
+	0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018,
+	0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff,
+	0x910d, 0x6162, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005,
+	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d65, 0x91b6, 0x0013, 0x1130,
+	0x2008, 0x91b2, 0x0040, 0x1a04, 0xc7c3, 0x0092, 0x91b6, 0x0027,
+	0x0120, 0x91b6, 0x0014, 0x190c, 0x0d65, 0x2001, 0x0007, 0x080c,
+	0x61ed, 0x080c, 0x8874, 0x080c, 0x9c21, 0x080c, 0x8936, 0x0005,
+	0xc700, 0xc702, 0xc700, 0xc700, 0xc700, 0xc702, 0xc70f, 0xc7c0,
+	0xc75f, 0xc7c0, 0xc771, 0xc7c0, 0xc70f, 0xc7c0, 0xc7b8, 0xc7c0,
+	0xc7b8, 0xc7c0, 0xc7c0, 0xc700, 0xc700, 0xc700, 0xc700, 0xc700,
+	0xc700, 0xc700, 0xc700, 0xc700, 0xc700, 0xc700, 0xc702, 0xc700,
+	0xc7c0, 0xc700, 0xc700, 0xc7c0, 0xc700, 0xc7bd, 0xc7c0, 0xc700,
+	0xc700, 0xc700, 0xc700, 0xc7c0, 0xc7c0, 0xc700, 0xc7c0, 0xc7c0,
+	0xc700, 0xc70a, 0xc700, 0xc700, 0xc700, 0xc700, 0xc7bc, 0xc7c0,
+	0xc700, 0xc700, 0xc7c0, 0xc7c0, 0xc700, 0xc700, 0xc700, 0xc700,
+	0x080c, 0x0d65, 0x080c, 0xbf79, 0x6003, 0x0002, 0x080c, 0x8936,
+	0x0804, 0xc7c2, 0x9006, 0x080c, 0x61ad, 0x0804, 0xc7c0, 0x080c,
+	0x665f, 0x1904, 0xc7c0, 0x9006, 0x080c, 0x61ad, 0x6010, 0x2058,
+	0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a4,
+	0x8000, 0x78a6, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb884, 0x9005,
+	0x1178, 0x080c, 0xbf61, 0x1904, 0xc7c0, 0x0036, 0x0046, 0xbba0,
+	0x2021, 0x0007, 0x080c, 0x4a75, 0x004e, 0x003e, 0x0804, 0xc7c0,
+	0x080c, 0x3181, 0x1904, 0xc7c0, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
+	0x00fe, 0x2001, 0x0002, 0x080c, 0x61c1, 0x6023, 0x0001, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x84d8, 0x080c, 0x8936, 0x6110,
+	0x2158, 0x2009, 0x0001, 0x080c, 0x8167, 0x0804, 0xc7c2, 0x6610,
+	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904,
+	0xc7c0, 0x9686, 0x0004, 0x0904, 0xc7c0, 0x2001, 0x0004, 0x0804,
+	0xc7be, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036,
+	0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a75,
+	0x004e, 0x003e, 0x2001, 0x0006, 0x080c, 0xc7dc, 0x6610, 0x2658,
+	0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e,
+	0x0168, 0x2001, 0x0006, 0x080c, 0x61ed, 0x9284, 0x00ff, 0x908e,
+	0x0007, 0x1120, 0x2001, 0x0006, 0x080c, 0x61c1, 0x080c, 0x665f,
+	0x11f8, 0x2001, 0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4,
+	0x8000, 0x78a6, 0x00fe, 0x0804, 0xc749, 0x2001, 0x0004, 0x0030,
+	0x2001, 0x0006, 0x0409, 0x0020, 0x0018, 0x0010, 0x080c, 0x61ed,
+	0x080c, 0x9be7, 0x0005, 0x2600, 0x0002, 0xc7d7, 0xc7d7, 0xc7d7,
+	0xc7d7, 0xc7d7, 0xc7d9, 0xc7d7, 0xc7d7, 0xc7d7, 0xc7d7, 0xc7d9,
+	0xc7d7, 0xc7d7, 0xc7d7, 0xc7d9, 0xc7d9, 0xc7d9, 0xc7d9, 0x080c,
+	0x0d65, 0x080c, 0x9be7, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110,
+	0x2158, 0xb900, 0xd184, 0x0138, 0x080c, 0x61c1, 0x9006, 0x080c,
+	0x61ad, 0x080c, 0x303b, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610,
+	0x2658, 0xb804, 0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c,
+	0x0d65, 0x91b6, 0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016,
+	0x190c, 0x0d65, 0x006b, 0x0005, 0xa670, 0xa670, 0xa670, 0xa670,
+	0xa670, 0xa670, 0xc85b, 0xc81c, 0xa670, 0xa670, 0xa670, 0xa670,
+	0xa670, 0xa670, 0xa670, 0xa670, 0xa670, 0xa670, 0xc85b, 0xc862,
+	0xa670, 0xa670, 0xa670, 0xa670, 0x00f6, 0x080c, 0x665f, 0x11d8,
+	0x080c, 0xbf61, 0x11c0, 0x6010, 0x905d, 0x01a8, 0xb884, 0x9005,
+	0x0190, 0x9006, 0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8,
+	0x080c, 0x8936, 0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x2424, 0x11b0, 0x080c, 0x6270, 0x0118, 0x080c, 0x9be7,
+	0x0080, 0xb810, 0x0006, 0xb814, 0x0006, 0xb884, 0x0006, 0x080c,
+	0x5cf6, 0x000e, 0xb886, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c,
+	0x9be7, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c,
+	0x9be7, 0x0005, 0x080c, 0xaa54, 0x1148, 0x6003, 0x0001, 0x6007,
+	0x0001, 0x080c, 0x84d8, 0x080c, 0x8936, 0x0010, 0x080c, 0x9be7,
+	0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x080c, 0x8874,
+	0x080c, 0x9c21, 0x0005, 0x9182, 0x0040, 0x0002, 0xc891, 0xc891,
+	0xc891, 0xc891, 0xc893, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891,
+	0xc891, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891,
+	0xc891, 0x080c, 0x0d65, 0x0096, 0x00b6, 0x00d6, 0x00e6, 0x00f6,
 	0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005, 0x11b0, 0x6007,
-	0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xc8da,
-	0x080c, 0xd55b, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
-	0x2011, 0x0200, 0x080c, 0x83c3, 0x0020, 0x9026, 0x080c, 0xd490,
+	0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xc8fa,
+	0x080c, 0xd57d, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
+	0x2011, 0x0200, 0x080c, 0x83eb, 0x0020, 0x9026, 0x080c, 0xd4b2,
 	0x0c30, 0x080c, 0x1022, 0x090c, 0x0d65, 0x6003, 0x0007, 0xa867,
 	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
 	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
-	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x698f,
-	0x001e, 0x080c, 0xd55b, 0x1904, 0xc93a, 0x9486, 0x2000, 0x1130,
-	0x2019, 0x0017, 0x080c, 0xd1c9, 0x0804, 0xc93a, 0x9486, 0x0200,
-	0x1120, 0x080c, 0xd159, 0x0804, 0xc93a, 0x9486, 0x0400, 0x0120,
-	0x9486, 0x1000, 0x1904, 0xc93a, 0x2019, 0x0002, 0x080c, 0xd178,
-	0x0804, 0xc93a, 0x2069, 0x1a3f, 0x6a00, 0xd284, 0x0904, 0xc9a4,
-	0x9284, 0x0300, 0x1904, 0xc99d, 0x6804, 0x9005, 0x0904, 0xc985,
-	0x2d78, 0x6003, 0x0007, 0x080c, 0x103b, 0x0904, 0xc946, 0x7800,
+	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6996,
+	0x001e, 0x080c, 0xd57d, 0x1904, 0xc95a, 0x9486, 0x2000, 0x1130,
+	0x2019, 0x0017, 0x080c, 0xd1eb, 0x0804, 0xc95a, 0x9486, 0x0200,
+	0x1120, 0x080c, 0xd17b, 0x0804, 0xc95a, 0x9486, 0x0400, 0x0120,
+	0x9486, 0x1000, 0x1904, 0xc95a, 0x2019, 0x0002, 0x080c, 0xd19a,
+	0x0804, 0xc95a, 0x2069, 0x1a3f, 0x6a00, 0xd284, 0x0904, 0xc9c4,
+	0x9284, 0x0300, 0x1904, 0xc9bd, 0x6804, 0x9005, 0x0904, 0xc9a5,
+	0x2d78, 0x6003, 0x0007, 0x080c, 0x103b, 0x0904, 0xc966, 0x7800,
 	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
-	0x180f, 0x2004, 0xd084, 0x1904, 0xc9a8, 0x9006, 0xa802, 0xa867,
+	0x180f, 0x2004, 0xd084, 0x1904, 0xc9c8, 0x9006, 0xa802, 0xa867,
 	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
 	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
 	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
-	0x0003, 0x9080, 0xc942, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
+	0x0003, 0x9080, 0xc962, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
 	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
 	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
 	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
-	0x080c, 0x6992, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
+	0x080c, 0x6999, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
 	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
-	0x2004, 0xd084, 0x0120, 0x080c, 0x1022, 0x1904, 0xc8ef, 0x6017,
+	0x2004, 0xd084, 0x0120, 0x080c, 0x1022, 0x1904, 0xc90f, 0x6017,
 	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c,
-	0x84a9, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
+	0x84d1, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
 	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
 	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
-	0x2009, 0xa025, 0x080c, 0x84a9, 0x0828, 0x6868, 0x602e, 0x686c,
+	0x2009, 0xa025, 0x080c, 0x84d1, 0x0828, 0x6868, 0x602e, 0x686c,
 	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x84a9, 0x0804, 0xc93a, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d1, 0x6017, 0xf300,
+	0xa022, 0x080c, 0x84d1, 0x0804, 0xc95a, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d8, 0x6017, 0xf300,
 	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x84a9, 0x0804, 0xc93a, 0x6017, 0xf500, 0x0c98,
-	0x6017, 0xf600, 0x0804, 0xc95a, 0x6017, 0xf200, 0x0804, 0xc95a,
+	0xa022, 0x080c, 0x84d1, 0x0804, 0xc95a, 0x6017, 0xf500, 0x0c98,
+	0x6017, 0xf600, 0x0804, 0xc97a, 0x6017, 0xf200, 0x0804, 0xc97a,
 	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
-	0x7044, 0x9084, 0x0003, 0x9080, 0xc942, 0x2005, 0xa87e, 0x2928,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xc962, 0x2005, 0xa87e, 0x2928,
 	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
 	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
 	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
 	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0d65,
 	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0029, 0x20a0, 0x2011, 0xca24, 0x2041, 0x0001, 0x223d,
+	0x9080, 0x0029, 0x20a0, 0x2011, 0xca44, 0x2041, 0x0001, 0x223d,
 	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
 	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
 	0x2098, 0x0c68, 0x2950, 0x080c, 0x103b, 0x0170, 0x2900, 0xb002,
 	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
 	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
-	0x080c, 0x1054, 0x0cc8, 0x080c, 0x1054, 0x0804, 0xc946, 0x2548,
+	0x080c, 0x1054, 0x0cc8, 0x080c, 0x1054, 0x0804, 0xc966, 0x2548,
 	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
-	0x080c, 0xd1fc, 0x0804, 0xc93a, 0x8010, 0x0004, 0x801a, 0x0006,
+	0x080c, 0xd21e, 0x0804, 0xc95a, 0x8010, 0x0004, 0x801a, 0x0006,
 	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
 	0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d65, 0x9082, 0x0040, 0x0a0c,
-	0x0d65, 0x2008, 0x0804, 0xcaaf, 0x9186, 0x0051, 0x0108, 0x0040,
-	0x080c, 0x9a9c, 0x01e8, 0x9086, 0x0002, 0x0904, 0xcaf6, 0x00c0,
+	0x0d65, 0x2008, 0x0804, 0xcacf, 0x9186, 0x0051, 0x0108, 0x0040,
+	0x080c, 0x9ab7, 0x01e8, 0x9086, 0x0002, 0x0904, 0xcb16, 0x00c0,
 	0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
-	0x0150, 0x190c, 0x0d65, 0x080c, 0x9a9c, 0x0150, 0x9086, 0x0004,
-	0x0904, 0xcb93, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a,
-	0x080c, 0x9c87, 0x0005, 0xca76, 0xca78, 0xca78, 0xca9f, 0xca76,
-	0xca76, 0xca76, 0xca76, 0xca76, 0xca76, 0xca76, 0xca76, 0xca76,
-	0xca76, 0xca76, 0xca76, 0xca76, 0xca76, 0xca76, 0x080c, 0x0d65,
-	0x080c, 0x884c, 0x080c, 0x890e, 0x0036, 0x0096, 0x6014, 0x904d,
-	0x01d8, 0x080c, 0xb82c, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6,
+	0x0150, 0x190c, 0x0d65, 0x080c, 0x9ab7, 0x0150, 0x9086, 0x0004,
+	0x0904, 0xcbb3, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a,
+	0x080c, 0x9ca2, 0x0005, 0xca96, 0xca98, 0xca98, 0xcabf, 0xca96,
+	0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96,
+	0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0x080c, 0x0d65,
+	0x080c, 0x8874, 0x080c, 0x8936, 0x0036, 0x0096, 0x6014, 0x904d,
+	0x01d8, 0x080c, 0xb847, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6,
 	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c,
-	0xd1fc, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1958,
+	0xd21e, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1958,
 	0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096,
-	0x080c, 0x884c, 0x080c, 0x890e, 0x080c, 0xb82c, 0x0120, 0x6014,
-	0x2048, 0x080c, 0x1054, 0x080c, 0x9c06, 0x009e, 0x0005, 0x0002,
-	0xcac3, 0xcad8, 0xcac5, 0xcaed, 0xcac3, 0xcac3, 0xcac3, 0xcac3,
-	0xcac3, 0xcac3, 0xcac3, 0xcac3, 0xcac3, 0xcac3, 0xcac3, 0xcac3,
-	0xcac3, 0xcac3, 0xcac3, 0x080c, 0x0d65, 0x0096, 0x6014, 0x2048,
+	0x080c, 0x8874, 0x080c, 0x8936, 0x080c, 0xb847, 0x0120, 0x6014,
+	0x2048, 0x080c, 0x1054, 0x080c, 0x9c21, 0x009e, 0x0005, 0x0002,
+	0xcae3, 0xcaf8, 0xcae5, 0xcb0d, 0xcae3, 0xcae3, 0xcae3, 0xcae3,
+	0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3,
+	0xcae3, 0xcae3, 0xcae3, 0x080c, 0x0d65, 0x0096, 0x6014, 0x2048,
 	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
-	0x9c6a, 0x0010, 0x6003, 0x0004, 0x080c, 0x890e, 0x009e, 0x0005,
-	0x080c, 0xb82c, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c, 0x009e,
-	0xd1ec, 0x1138, 0x080c, 0x8398, 0x080c, 0x9bcc, 0x080c, 0x890e,
-	0x0005, 0x080c, 0xd454, 0x0db0, 0x0cc8, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x2009, 0xa022, 0x080c, 0x84a9, 0x0005, 0x9182, 0x0040,
-	0x0002, 0xcb0c, 0xcb0e, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c,
-	0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c, 0xcb0c,
-	0xcb0c, 0xcb0c, 0xcb0f, 0xcb0c, 0x080c, 0x0d65, 0x0005, 0x00d6,
-	0x080c, 0x8398, 0x00de, 0x080c, 0xd4ac, 0x080c, 0x9bcc, 0x0005,
-	0x9182, 0x0040, 0x0002, 0xcb2e, 0xcb2e, 0xcb2e, 0xcb2e, 0xcb2e,
-	0xcb2e, 0xcb2e, 0xcb2e, 0xcb2e, 0xcb30, 0xcb5b, 0xcb2e, 0xcb2e,
-	0xcb2e, 0xcb2e, 0xcb5b, 0xcb2e, 0xcb2e, 0xcb2e, 0x080c, 0x0d65,
+	0x9c85, 0x0010, 0x6003, 0x0004, 0x080c, 0x8936, 0x009e, 0x0005,
+	0x080c, 0xb847, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c, 0x009e,
+	0xd1ec, 0x1138, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x080c, 0x8936,
+	0x0005, 0x080c, 0xd476, 0x0db0, 0x0cc8, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x84d1, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xcb2c, 0xcb2e, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c,
+	0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c,
+	0xcb2c, 0xcb2c, 0xcb2f, 0xcb2c, 0x080c, 0x0d65, 0x0005, 0x00d6,
+	0x080c, 0x83c0, 0x00de, 0x080c, 0xd4ce, 0x080c, 0x9be7, 0x0005,
+	0x9182, 0x0040, 0x0002, 0xcb4e, 0xcb4e, 0xcb4e, 0xcb4e, 0xcb4e,
+	0xcb4e, 0xcb4e, 0xcb4e, 0xcb4e, 0xcb50, 0xcb7b, 0xcb4e, 0xcb4e,
+	0xcb4e, 0xcb4e, 0xcb7b, 0xcb4e, 0xcb4e, 0xcb4e, 0x080c, 0x0d65,
 	0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x908c, 0x0003,
 	0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168, 0x2009, 0x0041,
-	0x009e, 0x0804, 0xcc1b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
-	0x8398, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec, 0x1130,
-	0x080c, 0x8398, 0x080c, 0x9bcc, 0x009e, 0x0005, 0x080c, 0xd454,
+	0x009e, 0x0804, 0xcc3b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
+	0x83c0, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec, 0x1130,
+	0x080c, 0x83c0, 0x080c, 0x9be7, 0x009e, 0x0005, 0x080c, 0xd476,
 	0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
-	0x0036, 0x080c, 0x88a9, 0x080c, 0x890e, 0x6014, 0x0096, 0x2048,
+	0x0036, 0x080c, 0x88d1, 0x080c, 0x8936, 0x6014, 0x0096, 0x2048,
 	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0188, 0xa87c,
 	0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac, 0x6330, 0x931a,
 	0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003, 0x0002, 0x0080,
-	0x2019, 0x0004, 0x080c, 0xd1fc, 0x6018, 0x9005, 0x1128, 0x2001,
+	0x2019, 0x0004, 0x080c, 0xd21e, 0x6018, 0x9005, 0x1128, 0x2001,
 	0x1958, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000, 0x6003, 0x0007,
-	0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xcbaa, 0xcbaa,
-	0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbac, 0xcbaa,
-	0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa, 0xcbaa,
-	0xcbaa, 0xcbf7, 0x080c, 0x0d65, 0x6014, 0x0096, 0x2048, 0xa834,
+	0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xcbca, 0xcbca,
+	0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbcc, 0xcbca,
+	0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca,
+	0xcbca, 0xcc17, 0x080c, 0x0d65, 0x6014, 0x0096, 0x2048, 0xa834,
 	0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1190,
 	0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009, 0x0041, 0x009e,
-	0x0804, 0xcc1b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x8398,
+	0x0804, 0xcc3b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x83c0,
 	0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006, 0x0046, 0xacac,
 	0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420, 0x6432, 0x602c,
 	0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110, 0x00b6, 0x2158,
 	0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e, 0x210c, 0xd19c,
 	0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006, 0x00e9, 0x080c,
-	0x839a, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005, 0x6024,
-	0xd0f4, 0x0128, 0x080c, 0x1595, 0x1904, 0xcbac, 0x0005, 0x6014,
+	0x83c2, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005, 0x6024,
+	0xd0f4, 0x0128, 0x080c, 0x1595, 0x1904, 0xcbcc, 0x0005, 0x6014,
 	0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105, 0x1120, 0x080c,
-	0x1595, 0x1904, 0xcbac, 0x0005, 0xd2fc, 0x0140, 0x8002, 0x8000,
+	0x1595, 0x1904, 0xcbcc, 0x0005, 0xd2fc, 0x0140, 0x8002, 0x8000,
 	0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010, 0x2009, 0x0015,
 	0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208, 0x0062, 0x9186,
 	0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d65, 0x6024, 0xd0dc,
-	0x090c, 0x0d65, 0x0005, 0xcc3e, 0xcc4a, 0xcc56, 0xcc62, 0xcc3e,
-	0xcc3e, 0xcc3e, 0xcc3e, 0xcc45, 0xcc40, 0xcc40, 0xcc3e, 0xcc3e,
-	0xcc3e, 0xcc3e, 0xcc40, 0xcc3e, 0xcc40, 0xcc3e, 0x080c, 0x0d65,
+	0x090c, 0x0d65, 0x0005, 0xcc5e, 0xcc6a, 0xcc76, 0xcc82, 0xcc5e,
+	0xcc5e, 0xcc5e, 0xcc5e, 0xcc65, 0xcc60, 0xcc60, 0xcc5e, 0xcc5e,
+	0xcc5e, 0xcc5e, 0xcc60, 0xcc5e, 0xcc60, 0xcc5e, 0x080c, 0x0d65,
 	0x6024, 0xd0dc, 0x090c, 0x0d65, 0x0005, 0x6014, 0x9005, 0x190c,
 	0x0d65, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000,
-	0x2009, 0xa022, 0x080c, 0x848b, 0x012e, 0x0005, 0x6003, 0x0004,
-	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c, 0x84a9,
+	0x2009, 0xa022, 0x080c, 0x84b3, 0x012e, 0x0005, 0x6003, 0x0004,
+	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c, 0x84d1,
 	0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c, 0x1aa5, 0x0126,
 	0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188,
 	0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x6024, 0xd0cc, 0x1148,
 	0xd0c4, 0x1138, 0xa8a8, 0x9005, 0x1120, 0x6144, 0x918d, 0xb035,
-	0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c, 0x84f0, 0x012e,
+	0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c, 0x8518, 0x012e,
 	0x0005, 0x6144, 0x918d, 0xa032, 0x0cb8, 0x0126, 0x2091, 0x8000,
 	0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e,
-	0x0005, 0xcca9, 0xccab, 0xccc0, 0xccda, 0xcca9, 0xcca9, 0xcca9,
-	0xcca9, 0xcca9, 0xcca9, 0xcca9, 0xcca9, 0xcca9, 0xcca9, 0xcca9,
-	0xcca9, 0x080c, 0x0d65, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0510,
+	0x0005, 0xccc9, 0xcccb, 0xcce0, 0xccfa, 0xccc9, 0xccc9, 0xccc9,
+	0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9,
+	0xccc9, 0x080c, 0x0d65, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0510,
 	0x909c, 0x0003, 0x939e, 0x0003, 0x01e8, 0x6003, 0x0001, 0x6106,
-	0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x84a9, 0x0470,
+	0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x84d1, 0x0470,
 	0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e,
 	0x0003, 0x0140, 0x6003, 0x0001, 0x6106, 0x2009, 0xa001, 0x080c,
-	0x84a9, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c,
-	0xd1fc, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c,
+	0x84d1, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c,
+	0xd21e, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c,
 	0x0003, 0x939e, 0x0003, 0x0d70, 0x6003, 0x0003, 0x6106, 0x080c,
-	0x1aa5, 0x6144, 0x918d, 0xa035, 0x080c, 0x84f0, 0x0005, 0x080c,
-	0x884c, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xd4f8,
-	0x0036, 0x2019, 0x0029, 0x080c, 0xd1fc, 0x003e, 0x009e, 0x080c,
-	0x9c06, 0x080c, 0x890e, 0x0005, 0x080c, 0x88a9, 0x6114, 0x81ff,
-	0x0158, 0x0096, 0x2148, 0x080c, 0xd4f8, 0x0036, 0x2019, 0x0029,
-	0x080c, 0xd1fc, 0x003e, 0x009e, 0x080c, 0x9c06, 0x0005, 0x9182,
-	0x0085, 0x0002, 0xcd29, 0xcd27, 0xcd27, 0xcd35, 0xcd27, 0xcd27,
-	0xcd27, 0xcd27, 0xcd27, 0xcd27, 0xcd27, 0xcd27, 0xcd27, 0x080c,
+	0x1aa5, 0x6144, 0x918d, 0xa035, 0x080c, 0x8518, 0x0005, 0x080c,
+	0x8874, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xd51a,
+	0x0036, 0x2019, 0x0029, 0x080c, 0xd21e, 0x003e, 0x009e, 0x080c,
+	0x9c21, 0x080c, 0x8936, 0x0005, 0x080c, 0x88d1, 0x6114, 0x81ff,
+	0x0158, 0x0096, 0x2148, 0x080c, 0xd51a, 0x0036, 0x2019, 0x0029,
+	0x080c, 0xd21e, 0x003e, 0x009e, 0x080c, 0x9c21, 0x0005, 0x9182,
+	0x0085, 0x0002, 0xcd49, 0xcd47, 0xcd47, 0xcd55, 0xcd47, 0xcd47,
+	0xcd47, 0xcd47, 0xcd47, 0xcd47, 0xcd47, 0xcd47, 0xcd47, 0x080c,
 	0x0d65, 0x6003, 0x000b, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009,
-	0x8020, 0x080c, 0x84a9, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c,
-	0xd44b, 0x0118, 0x080c, 0x9bcc, 0x0440, 0x2071, 0x0260, 0x7224,
+	0x8020, 0x080c, 0x84d1, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c,
+	0xd46d, 0x0118, 0x080c, 0x9be7, 0x0440, 0x2071, 0x0260, 0x7224,
 	0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6,
-	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0x9ef8,
-	0x7220, 0x080c, 0xd092, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0x9f13,
+	0x7220, 0x080c, 0xd0b4, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007,
 	0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x84a9, 0x00ee, 0x002e, 0x0005,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ee, 0x002e, 0x0005,
 	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d65,
 	0x908a, 0x0092, 0x1a0c, 0x0d65, 0x9082, 0x0085, 0x00a2, 0x9186,
-	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9c87, 0x0050,
-	0x2001, 0x0007, 0x080c, 0x61e6, 0x080c, 0x884c, 0x080c, 0x9c06,
-	0x080c, 0x890e, 0x0005, 0xcd98, 0xcd9a, 0xcd9a, 0xcd98, 0xcd98,
-	0xcd98, 0xcd98, 0xcd98, 0xcd98, 0xcd98, 0xcd98, 0xcd98, 0xcd98,
-	0x080c, 0x0d65, 0x080c, 0x9c06, 0x080c, 0x890e, 0x0005, 0x9182,
+	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9ca2, 0x0050,
+	0x2001, 0x0007, 0x080c, 0x61ed, 0x080c, 0x8874, 0x080c, 0x9c21,
+	0x080c, 0x8936, 0x0005, 0xcdb8, 0xcdba, 0xcdba, 0xcdb8, 0xcdb8,
+	0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8,
+	0x080c, 0x0d65, 0x080c, 0x9c21, 0x080c, 0x8936, 0x0005, 0x9182,
 	0x0085, 0x0a0c, 0x0d65, 0x9182, 0x0092, 0x1a0c, 0x0d65, 0x9182,
-	0x0085, 0x0002, 0xcdb7, 0xcdb7, 0xcdb7, 0xcdb9, 0xcdb7, 0xcdb7,
-	0xcdb7, 0xcdb7, 0xcdb7, 0xcdb7, 0xcdb7, 0xcdb7, 0xcdb7, 0x080c,
+	0x0085, 0x0002, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd9, 0xcdd7, 0xcdd7,
+	0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0x080c,
 	0x0d65, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014, 0x0130,
-	0x9186, 0x0027, 0x0118, 0x080c, 0x9c87, 0x0020, 0x080c, 0x884c,
-	0x080c, 0x9c06, 0x0005, 0x0036, 0x080c, 0xd4ac, 0x604b, 0x0000,
+	0x9186, 0x0027, 0x0118, 0x080c, 0x9ca2, 0x0020, 0x080c, 0x8874,
+	0x080c, 0x9c21, 0x0005, 0x0036, 0x080c, 0xd4ce, 0x604b, 0x0000,
 	0x2019, 0x000b, 0x0031, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e,
 	0x0005, 0x0126, 0x0036, 0x2091, 0x8000, 0x2001, 0x0382, 0x2004,
-	0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110, 0x080c, 0x98ad,
-	0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x9367, 0x009e, 0x008e,
-	0x1550, 0x0076, 0x2c38, 0x080c, 0x9412, 0x007e, 0x1520, 0x6000,
+	0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110, 0x080c, 0x98c8,
+	0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e,
+	0x1550, 0x0076, 0x2c38, 0x080c, 0x942d, 0x007e, 0x1520, 0x6000,
 	0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0, 0x0096,
-	0x601c, 0xd084, 0x0140, 0x080c, 0xd4ac, 0x080c, 0xbf5e, 0x080c,
-	0x1914, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb82c, 0x0110,
-	0x080c, 0xd1fc, 0x009e, 0x6017, 0x0000, 0x080c, 0xd4ac, 0x6023,
-	0x0007, 0x080c, 0xbf5e, 0x000e, 0x9086, 0x0003, 0x0110, 0x080c,
-	0x98c9, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6, 0x00b6, 0x0036,
-	0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c, 0x2424, 0x15d8,
-	0x0016, 0x00c6, 0x080c, 0x6269, 0x15a0, 0x001e, 0x00c6, 0x2160,
-	0x080c, 0xbf5b, 0x00ce, 0x002e, 0x0026, 0x0016, 0x080c, 0x98ad,
-	0x2019, 0x0029, 0x080c, 0x94d9, 0x080c, 0x8613, 0x0076, 0x903e,
-	0x080c, 0x8502, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c, 0xcfa6,
-	0x007e, 0x080c, 0x98c9, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217,
+	0x601c, 0xd084, 0x0140, 0x080c, 0xd4ce, 0x080c, 0xbf79, 0x080c,
+	0x1914, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb847, 0x0110,
+	0x080c, 0xd21e, 0x009e, 0x6017, 0x0000, 0x080c, 0xd4ce, 0x6023,
+	0x0007, 0x080c, 0xbf79, 0x000e, 0x9086, 0x0003, 0x0110, 0x080c,
+	0x98e4, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6, 0x00b6, 0x0036,
+	0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c, 0x2424, 0x15e8,
+	0x0016, 0x00c6, 0x080c, 0x6270, 0x15b0, 0x001e, 0x00c6, 0x2160,
+	0x080c, 0xbf76, 0x00ce, 0x002e, 0x0026, 0x0016, 0x080c, 0x98c8,
+	0x2019, 0x0029, 0x080c, 0x94f4, 0x080c, 0x863b, 0x0076, 0x903e,
+	0x080c, 0x852a, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c, 0xcfc8,
+	0x007e, 0x080c, 0x98e4, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217,
 	0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c,
-	0x30d5, 0x002e, 0x001e, 0x080c, 0x5cef, 0xbe12, 0xbd16, 0x9006,
-	0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe,
-	0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1823, 0x2104,
-	0x9086, 0x0074, 0x1904, 0xceca, 0x2069, 0x0260, 0x6944, 0x9182,
-	0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xcec7, 0x2001,
-	0x194d, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb884, 0x9005,
-	0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001, 0x0648,
-	0x080c, 0xd560, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009, 0x0205,
-	0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182, 0x0100,
-	0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001, 0x0288,
-	0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100, 0x00a0,
-	0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017, 0x0700,
-	0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028, 0x6017,
-	0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6, 0x0026,
-	0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff, 0x9286,
-	0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00, 0x8217,
-	0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c, 0x6278,
-	0x0804, 0xcf35, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x000a, 0x080c, 0xabc4, 0x009e, 0x15c0, 0x2011, 0x027a,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xabc4,
-	0x009e, 0x1560, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009,
-	0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c, 0xd251, 0xb800,
-	0xc0e5, 0xb802, 0x080c, 0x98ad, 0x2019, 0x0029, 0x080c, 0x8613,
-	0x0076, 0x2039, 0x0000, 0x080c, 0x8502, 0x2c08, 0x080c, 0xcfa6,
-	0x007e, 0x080c, 0x98c9, 0x2001, 0x0007, 0x080c, 0x61e6, 0x2001,
-	0x0007, 0x080c, 0x61ba, 0x001e, 0x004e, 0x9006, 0x015e, 0x003e,
-	0x002e, 0x00be, 0x00ce, 0x0005, 0x00d6, 0x2069, 0x026e, 0x6800,
-	0x9086, 0x0800, 0x0118, 0x6017, 0x0000, 0x0008, 0x9006, 0x00de,
-	0x0005, 0x00b6, 0x00f6, 0x0016, 0x0026, 0x0036, 0x0156, 0x2079,
-	0x026c, 0x7930, 0x7834, 0x080c, 0x2424, 0x11d0, 0x080c, 0x6269,
-	0x11b8, 0x2011, 0x0270, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x000a, 0x080c, 0xabc4, 0x009e, 0x1158, 0x2011, 0x0274, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xabc4, 0x009e,
-	0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6,
-	0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011, 0x0263, 0x2204,
-	0x8211, 0x220c, 0x080c, 0x2424, 0x11d0, 0x080c, 0x6269, 0x11b8,
-	0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a,
-	0x080c, 0xabc4, 0x009e, 0x1158, 0x2011, 0x027a, 0x20a9, 0x0004,
-	0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xabc4, 0x009e, 0x015e,
-	0x003e, 0x002e, 0x001e, 0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6,
-	0x0086, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x990b, 0x0106, 0x190c, 0x98ad, 0x2740, 0x2029,
-	0x19c4, 0x252c, 0x2021, 0x19cb, 0x2424, 0x2061, 0x1ddc, 0x2071,
-	0x1800, 0x7650, 0x7070, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1b02,
-	0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd047, 0x0018, 0x9606,
-	0x0904, 0xd047, 0x2100, 0x9c06, 0x0904, 0xd03e, 0x080c, 0xd292,
-	0x1904, 0xd03e, 0x080c, 0xd57d, 0x0904, 0xd03e, 0x080c, 0xd282,
-	0x0904, 0xd03e, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x317a,
-	0x0904, 0xd066, 0x6004, 0x9086, 0x0000, 0x1904, 0xd066, 0x9786,
-	0x0004, 0x0904, 0xd066, 0x9786, 0x0007, 0x0904, 0xd03e, 0x2500,
-	0x9c06, 0x0904, 0xd03e, 0x2400, 0x9c06, 0x0904, 0xd03e, 0x88ff,
-	0x0118, 0x605c, 0x9906, 0x15d0, 0x0096, 0x6043, 0xffff, 0x6000,
-	0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1914, 0x001e, 0x9786,
-	0x000a, 0x0148, 0x080c, 0xba41, 0x1130, 0x080c, 0xa574, 0x009e,
-	0x080c, 0x9c06, 0x0418, 0x6014, 0x2048, 0x080c, 0xb82c, 0x01d8,
-	0x9786, 0x0003, 0x1588, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0xd4f8, 0x0016, 0x080c, 0xbb2a, 0x080c, 0x6983,
-	0x001e, 0x080c, 0xba1b, 0x009e, 0x080c, 0x9c06, 0x9ce0, 0x001c,
-	0x2001, 0x1819, 0x2004, 0x9c02, 0x1210, 0x0804, 0xcfbf, 0x010e,
-	0x190c, 0x98c9, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e,
-	0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386,
-	0x0005, 0x0128, 0x080c, 0xd4f8, 0x080c, 0xd1fc, 0x08e0, 0x009e,
-	0x08e8, 0x9786, 0x000a, 0x0908, 0x0804, 0xd023, 0x81ff, 0x09b0,
-	0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130, 0x9180, 0x0001,
-	0x2004, 0x9086, 0x002d, 0x1950, 0x6000, 0x9086, 0x0002, 0x1930,
-	0x080c, 0xba30, 0x0130, 0x080c, 0xba41, 0x1900, 0x080c, 0xa574,
-	0x0038, 0x080c, 0x3034, 0x080c, 0xba41, 0x1110, 0x080c, 0xa574,
-	0x080c, 0x9c06, 0x0804, 0xd03e, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006,
-	0x080c, 0xd223, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b,
-	0x00ee, 0x00ce, 0x0005, 0xd0b1, 0xd0b1, 0xd0b1, 0xd0b1, 0xd0b1,
-	0xd0b1, 0xd0b3, 0xd0b1, 0xd0b1, 0xd0b1, 0xd0b1, 0x9c06, 0x9c06,
-	0xd0b1, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6,
-	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xd251,
-	0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xcdd9, 0x003e, 0x9085,
-	0x0001, 0x0005, 0x0096, 0x080c, 0xb82c, 0x0140, 0x6014, 0x904d,
-	0x080c, 0xb437, 0x687b, 0x0005, 0x080c, 0x698f, 0x009e, 0x080c,
-	0x9c06, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x61a6,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
-	0x2011, 0x0276, 0x080c, 0xabb0, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
-	0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1ddc, 0x2079,
-	0x0001, 0x8fff, 0x0904, 0xd14c, 0x2071, 0x1800, 0x7650, 0x7070,
-	0x8001, 0x9602, 0x1a04, 0xd14c, 0x88ff, 0x0120, 0x2800, 0x9c06,
-	0x1590, 0x2078, 0x080c, 0xd282, 0x0570, 0x2400, 0x9c06, 0x0558,
-	0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007, 0x0520, 0x88ff,
-	0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118, 0x605c, 0x9106,
-	0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd4ac, 0x080c,
-	0xbf5e, 0x080c, 0x1914, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
-	0xb82c, 0x0120, 0x0046, 0x080c, 0xd1fc, 0x004e, 0x009e, 0x080c,
-	0x9c06, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1210, 0x0804, 0xd101, 0x9006, 0x012e, 0x00be, 0x006e,
-	0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001,
-	0x0ca0, 0x080c, 0x98ad, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046,
-	0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096,
-	0x904e, 0x080c, 0x9367, 0x009e, 0x008e, 0x903e, 0x080c, 0x9412,
-	0x080c, 0xd0f2, 0x005e, 0x007e, 0x00be, 0x080c, 0x98c9, 0x0005,
-	0x080c, 0x98ad, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
-	0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c,
-	0x6269, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001,
-	0x0096, 0x904e, 0x080c, 0x9367, 0x009e, 0x008e, 0x903e, 0x080c,
-	0x9412, 0x080c, 0xd0f2, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
-	0xd185, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c,
-	0x98c9, 0x0005, 0x080c, 0x98ad, 0x00b6, 0x0076, 0x0056, 0x6210,
-	0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096,
-	0x904e, 0x080c, 0x9367, 0x009e, 0x008e, 0x903e, 0x080c, 0x9412,
-	0x2c20, 0x080c, 0xd0f2, 0x005e, 0x007e, 0x00be, 0x080c, 0x98c9,
-	0x0005, 0x080c, 0x98ad, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
-	0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c,
-	0x6269, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001,
-	0x080c, 0xd490, 0x004e, 0x0096, 0x904e, 0x080c, 0x9367, 0x009e,
-	0x008e, 0x903e, 0x080c, 0x9412, 0x080c, 0xd0f2, 0x003e, 0x001e,
-	0x8108, 0x1f04, 0xd1d5, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
-	0x00be, 0x080c, 0x98c9, 0x0005, 0x0016, 0x00f6, 0x080c, 0xb82a,
-	0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800,
-	0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x698f, 0x2f48,
-	0x0cb0, 0xab82, 0x080c, 0x698f, 0x00fe, 0x001e, 0x0005, 0xa800,
-	0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x698f, 0x2f48, 0x0cb8,
-	0x080c, 0x698f, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc,
-	0x9005, 0x1138, 0x2071, 0x1800, 0x7450, 0x7070, 0x8001, 0x9402,
-	0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086, 0x0000, 0x0148,
-	0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004, 0x2424, 0x9406,
-	0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1220,
-	0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e, 0x00ee,
-	0x0005, 0x0096, 0x0006, 0x080c, 0x1022, 0x000e, 0x090c, 0x0d65,
-	0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xb81a,
-	0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0017, 0x2004, 0x002e,
-	0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76,
-	0xa87f, 0x0000, 0x2001, 0x195f, 0x2004, 0xa882, 0x9006, 0xa802,
-	0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x698f, 0x012e,
-	0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786, 0x0001,
-	0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110, 0x9085,
-	0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6, 0x2058,
-	0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8,
-	0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134, 0x918c,
-	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0005, 0x2001, 0x1958, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c,
-	0x84a9, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4,
-	0x0158, 0xd0cc, 0x0118, 0x080c, 0xbb71, 0x0030, 0x080c, 0xd4ac,
-	0x080c, 0x8398, 0x080c, 0x9bcc, 0x0005, 0x9280, 0x0008, 0x2004,
-	0x9084, 0x000f, 0x0002, 0xd2e1, 0xd2e1, 0xd2e1, 0xd2e3, 0xd2e1,
-	0xd2e3, 0xd2e3, 0xd2e1, 0xd2e3, 0xd2e1, 0xd2e1, 0xd2e1, 0xd2e1,
-	0xd2e1, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008,
-	0x2004, 0x9084, 0x000f, 0x0002, 0xd2fa, 0xd2fa, 0xd2fa, 0xd2fa,
-	0xd2fa, 0xd2fa, 0xd307, 0xd2fa, 0xd2fa, 0xd2fa, 0xd2fa, 0xd2fa,
-	0xd2fa, 0xd2fa, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
-	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84a9, 0x0005, 0x0096,
-	0x00c6, 0x2260, 0x080c, 0xd4ac, 0x604b, 0x0000, 0x6024, 0xc0f4,
-	0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186,
-	0x0007, 0x1904, 0xd360, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c,
-	0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x84a9, 0x00c6, 0x2d60, 0x6100,
-	0x9186, 0x0002, 0x1904, 0xd3d7, 0x6014, 0x9005, 0x1138, 0x6000,
-	0x9086, 0x0007, 0x190c, 0x0d65, 0x0804, 0xd3d7, 0x2048, 0x080c,
-	0xb82c, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
-	0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1168, 0xa87c,
-	0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043,
-	0x080c, 0xcc1b, 0x0804, 0xd3d7, 0x2009, 0x0041, 0x0804, 0xd3d1,
-	0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120,
-	0x00de, 0x009e, 0x0804, 0xd2fa, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
-	0x0d65, 0x0804, 0xd31b, 0x6007, 0x003a, 0x6003, 0x0001, 0x2009,
-	0x8020, 0x080c, 0x84a9, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002,
-	0x0120, 0x9186, 0x0004, 0x1904, 0xd3d7, 0x6814, 0x2048, 0xa97c,
-	0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6,
-	0x2c78, 0x080c, 0x164f, 0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036,
-	0x080c, 0x1022, 0x090c, 0x0d65, 0xa867, 0x010d, 0x9006, 0xa802,
-	0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892,
-	0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6,
-	0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c, 0xab7a, 0xa876, 0x9006,
-	0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c, 0x698f,
-	0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xcdd9, 0x2d00, 0x600a,
-	0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a, 0x634a, 0x003e,
-	0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c, 0xcc1b, 0x00ce,
-	0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
-	0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x884c,
-	0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c, 0xd1fc,
-	0x009e, 0x003e, 0x080c, 0x890e, 0x0005, 0x9186, 0x0014, 0x0d70,
-	0x080c, 0x9c87, 0x0005, 0xd40a, 0xd408, 0xd408, 0xd408, 0xd408,
-	0xd408, 0xd40a, 0xd408, 0xd408, 0xd408, 0xd408, 0xd408, 0xd408,
-	0x080c, 0x0d65, 0x6003, 0x000c, 0x080c, 0x890e, 0x0005, 0x9182,
-	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0x9c87,
-	0x0005, 0xd426, 0xd426, 0xd426, 0xd426, 0xd428, 0xd448, 0xd426,
-	0xd426, 0xd426, 0xd426, 0xd426, 0xd426, 0xd426, 0x080c, 0x0d65,
-	0x00d6, 0x2c68, 0x080c, 0x9b76, 0x01b0, 0x6003, 0x0001, 0x6007,
-	0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
-	0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x2009,
-	0x8020, 0x080c, 0x84a9, 0x2d60, 0x080c, 0x9bcc, 0x00de, 0x0005,
-	0x080c, 0x9bcc, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1873, 0x210c, 0xd1ec,
-	0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150,
-	0x2001, 0x1959, 0x2004, 0x604a, 0x2009, 0x1873, 0x210c, 0xd1f4,
-	0x1520, 0x00a0, 0x2009, 0x1873, 0x210c, 0xd1f4, 0x0128, 0x6024,
-	0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1959, 0x200c, 0x2001,
-	0x1957, 0x2004, 0x9100, 0x9080, 0x000a, 0x604a, 0x6010, 0x00b6,
-	0x2058, 0xb8ac, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088,
-	0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005,
-	0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8ac, 0x2060, 0x8cff, 0x0180,
-	0x84ff, 0x1118, 0x605c, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c,
-	0x8398, 0x080c, 0x9bcc, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70,
-	0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058,
-	0xb8ac, 0x2068, 0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0,
-	0x600c, 0x680e, 0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156,
-	0x2011, 0x182b, 0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334,
-	0x9636, 0x1508, 0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636,
-	0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
-	0x2019, 0x000a, 0x080c, 0xabc4, 0x009e, 0x1168, 0x2011, 0x0274,
-	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c,
-	0xabc4, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
-	0x2071, 0x1800, 0x080c, 0x5c68, 0x080c, 0x2ddb, 0x00ee, 0x0005,
-	0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc, 0x0108,
-	0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005, 0x00e6,
-	0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0016,
-	0x0126, 0x2091, 0x8000, 0x2029, 0x19c4, 0x252c, 0x2021, 0x19cb,
-	0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7650, 0x7070, 0x9606,
-	0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008, 0x1500,
-	0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c, 0xd282,
-	0x01b8, 0x080c, 0xd292, 0x11a0, 0x6000, 0x9086, 0x0004, 0x1120,
-	0x0016, 0x080c, 0x1914, 0x001e, 0x080c, 0xba30, 0x1110, 0x080c,
-	0x3034, 0x080c, 0xba41, 0x1110, 0x080c, 0xa574, 0x080c, 0x9c06,
-	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1208, 0x0858,
-	0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce,
-	0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005,
-	0x0006, 0x2001, 0x1836, 0x2004, 0xd09c, 0x000e, 0x0005, 0x0006,
-	0x0036, 0x0046, 0x080c, 0xbf46, 0x0168, 0x2019, 0xffff, 0x9005,
-	0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
-	0x080c, 0x4a6e, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086, 0x0001,
-	0x1128, 0x080c, 0x94d9, 0x080c, 0x9c06, 0x9006, 0x0005, 0x00e6,
-	0x00c6, 0x00b6, 0x0046, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7450,
-	0x7070, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148, 0x6000,
-	0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x0140,
-	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1220, 0x0c60,
-	0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be, 0x00ce, 0x00ee,
-	0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071,
-	0x1840, 0xd5a4, 0x0118, 0x7034, 0x8000, 0x7036, 0xd5b4, 0x0118,
-	0x7030, 0x8000, 0x7032, 0xd5ac, 0x0178, 0x2500, 0x9084, 0x0007,
-	0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005,
-	0x0118, 0x2071, 0x184a, 0x0089, 0x001e, 0x00ee, 0x000e, 0x012e,
-	0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0x1842,
-	0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e04, 0x8000, 0x2072,
-	0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x0005, 0x00e6, 0x2071,
-	0x1840, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1844, 0x0c69,
-	0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071,
-	0x1840, 0x7044, 0x8000, 0x7046, 0x00ee, 0x000e, 0x012e, 0x0005,
-	0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
-	0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000,
-	0x7c76
+	0x30dc, 0x002e, 0xbc84, 0x001e, 0x080c, 0x5cf6, 0xbe12, 0xbd16,
+	0xbc86, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be,
+	0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009,
+	0x1823, 0x2104, 0x9086, 0x0074, 0x1904, 0xceec, 0x2069, 0x0260,
+	0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904,
+	0xcee9, 0x2001, 0x194d, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058,
+	0xb884, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a,
+	0x0001, 0x0648, 0x080c, 0xd582, 0x0118, 0x6978, 0xd1fc, 0x11b8,
+	0x2009, 0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944,
+	0x9182, 0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a,
+	0x0001, 0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017,
+	0x0100, 0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070,
+	0x6017, 0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00,
+	0x0028, 0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6,
+	0x00b6, 0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394,
+	0x00ff, 0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394,
+	0xff00, 0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120,
+	0x080c, 0x627f, 0x0804, 0xcf57, 0x2011, 0x0276, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x15c0,
+	0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
+	0x080c, 0xabdf, 0x009e, 0x1560, 0x0046, 0x0016, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c,
+	0xd273, 0xb800, 0xc0e5, 0xb802, 0x080c, 0x98c8, 0x2019, 0x0029,
+	0x080c, 0x863b, 0x0076, 0x2039, 0x0000, 0x080c, 0x852a, 0x2c08,
+	0x080c, 0xcfc8, 0x007e, 0x080c, 0x98e4, 0x2001, 0x0007, 0x080c,
+	0x61ed, 0x2001, 0x0007, 0x080c, 0x61c1, 0x001e, 0x004e, 0x9006,
+	0x015e, 0x003e, 0x002e, 0x00be, 0x00ce, 0x0005, 0x00d6, 0x2069,
+	0x026e, 0x6800, 0x9086, 0x0800, 0x0118, 0x6017, 0x0000, 0x0008,
+	0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6, 0x0016, 0x0026, 0x0036,
+	0x0156, 0x2079, 0x026c, 0x7930, 0x7834, 0x080c, 0x2424, 0x11d0,
+	0x080c, 0x6270, 0x11b8, 0x2011, 0x0270, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x1158, 0x2011,
+	0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
+	0xabdf, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00be,
+	0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x11d0, 0x080c,
+	0x6270, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x1158, 0x2011, 0x027a,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xabdf,
+	0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e, 0x00be, 0x0005,
+	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8,
+	0x2740, 0x2029, 0x19c4, 0x252c, 0x2021, 0x19cb, 0x2424, 0x2061,
+	0x1ddc, 0x2071, 0x1800, 0x7650, 0x7070, 0x81ff, 0x0150, 0x0006,
+	0x9186, 0x1b02, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd069,
+	0x0018, 0x9606, 0x0904, 0xd069, 0x2100, 0x9c06, 0x0904, 0xd060,
+	0x080c, 0xd2b4, 0x1904, 0xd060, 0x080c, 0xd59f, 0x0904, 0xd060,
+	0x080c, 0xd2a4, 0x0904, 0xd060, 0x6720, 0x9786, 0x0001, 0x1148,
+	0x080c, 0x3181, 0x0904, 0xd088, 0x6004, 0x9086, 0x0000, 0x1904,
+	0xd088, 0x9786, 0x0004, 0x0904, 0xd088, 0x9786, 0x0007, 0x0904,
+	0xd060, 0x2500, 0x9c06, 0x0904, 0xd060, 0x2400, 0x9c06, 0x0904,
+	0xd060, 0x88ff, 0x0118, 0x605c, 0x9906, 0x15d0, 0x0096, 0x6043,
+	0xffff, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1914,
+	0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xba5c, 0x1130, 0x080c,
+	0xa58f, 0x009e, 0x080c, 0x9c21, 0x0418, 0x6014, 0x2048, 0x080c,
+	0xb847, 0x01d8, 0x9786, 0x0003, 0x1588, 0xa867, 0x0103, 0xa87c,
+	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0xd51a, 0x0016, 0x080c, 0xbb45,
+	0x080c, 0x698a, 0x001e, 0x080c, 0xba36, 0x009e, 0x080c, 0x9c21,
+	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1210, 0x0804,
+	0xcfe1, 0x010e, 0x190c, 0x98e4, 0x012e, 0x002e, 0x004e, 0x005e,
+	0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006,
+	0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd51a, 0x080c, 0xd21e,
+	0x08e0, 0x009e, 0x08e8, 0x9786, 0x000a, 0x0908, 0x0804, 0xd045,
+	0x81ff, 0x09b0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130,
+	0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1950, 0x6000, 0x9086,
+	0x0002, 0x1930, 0x080c, 0xba4b, 0x0130, 0x080c, 0xba5c, 0x1900,
+	0x080c, 0xa58f, 0x0038, 0x080c, 0x303b, 0x080c, 0xba5c, 0x1110,
+	0x080c, 0xa58f, 0x080c, 0x9c21, 0x0804, 0xd060, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08,
+	0x2170, 0x9006, 0x080c, 0xd245, 0x001e, 0x0120, 0x6020, 0x9084,
+	0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xd0d3, 0xd0d3, 0xd0d3,
+	0xd0d3, 0xd0d3, 0xd0d3, 0xd0d5, 0xd0d3, 0xd0d3, 0xd0d3, 0xd0d3,
+	0x9c21, 0x9c21, 0xd0d3, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016,
+	0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020,
+	0x080c, 0xd273, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xcdf9,
+	0x003e, 0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xb847, 0x0140,
+	0x6014, 0x904d, 0x080c, 0xb452, 0x687b, 0x0005, 0x080c, 0x6996,
+	0x009e, 0x080c, 0x9c21, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001,
+	0x080c, 0x61ad, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xabcb, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086,
+	0x0076, 0x0066, 0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061,
+	0x1ddc, 0x2079, 0x0001, 0x8fff, 0x0904, 0xd16e, 0x2071, 0x1800,
+	0x7650, 0x7070, 0x8001, 0x9602, 0x1a04, 0xd16e, 0x88ff, 0x0120,
+	0x2800, 0x9c06, 0x1590, 0x2078, 0x080c, 0xd2a4, 0x0570, 0x2400,
+	0x9c06, 0x0558, 0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007,
+	0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118,
+	0x605c, 0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c,
+	0xd4ce, 0x080c, 0xbf79, 0x080c, 0x1914, 0x6023, 0x0007, 0x6014,
+	0x2048, 0x080c, 0xb847, 0x0120, 0x0046, 0x080c, 0xd21e, 0x004e,
+	0x009e, 0x080c, 0x9c21, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001,
+	0x1819, 0x2004, 0x9c02, 0x1210, 0x0804, 0xd123, 0x9006, 0x012e,
+	0x00be, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x98c5, 0x0001, 0x0ca0, 0x080c, 0x98c8, 0x00b6, 0x0076, 0x0056,
+	0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210,
+	0x2258, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e, 0x903e,
+	0x080c, 0x942d, 0x080c, 0xd114, 0x005e, 0x007e, 0x00be, 0x080c,
+	0x98e4, 0x0005, 0x080c, 0x98c8, 0x00b6, 0x0046, 0x0056, 0x0076,
+	0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x0036, 0x080c, 0x6270, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508,
+	0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e,
+	0x903e, 0x080c, 0x942d, 0x080c, 0xd114, 0x005e, 0x003e, 0x001e,
+	0x8108, 0x1f04, 0xd1a7, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
+	0x00be, 0x080c, 0x98e4, 0x0005, 0x080c, 0x98c8, 0x00b6, 0x0076,
+	0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019,
+	0x0048, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e, 0x903e,
+	0x080c, 0x942d, 0x2c20, 0x080c, 0xd114, 0x005e, 0x007e, 0x00be,
+	0x080c, 0x98e4, 0x0005, 0x080c, 0x98c8, 0x00b6, 0x0046, 0x0056,
+	0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016,
+	0x0036, 0x080c, 0x6270, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046,
+	0x2021, 0x0001, 0x080c, 0xd4b2, 0x004e, 0x0096, 0x904e, 0x080c,
+	0x9382, 0x009e, 0x008e, 0x903e, 0x080c, 0x942d, 0x080c, 0xd114,
+	0x003e, 0x001e, 0x8108, 0x1f04, 0xd1f7, 0x015e, 0x00ce, 0x007e,
+	0x005e, 0x004e, 0x00be, 0x080c, 0x98e4, 0x0005, 0x0016, 0x00f6,
+	0x080c, 0xb845, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046,
+	0x0180, 0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c,
+	0x6996, 0x2f48, 0x0cb0, 0xab82, 0x080c, 0x6996, 0x00fe, 0x001e,
+	0x0005, 0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6996,
+	0x2f48, 0x0cb8, 0x080c, 0x6996, 0x0c88, 0x00e6, 0x0046, 0x0036,
+	0x2061, 0x1ddc, 0x9005, 0x1138, 0x2071, 0x1800, 0x7450, 0x7070,
+	0x8001, 0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004,
+	0x2424, 0x9406, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e,
+	0x004e, 0x00ee, 0x0005, 0x0096, 0x0006, 0x080c, 0x1022, 0x000e,
+	0x090c, 0x0d65, 0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010,
+	0x080c, 0xb835, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0017,
+	0x2004, 0x002e, 0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff,
+	0xa986, 0xac76, 0xa87f, 0x0000, 0x2001, 0x195f, 0x2004, 0xa882,
+	0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6996, 0x012e, 0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158,
+	0x9786, 0x0001, 0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009,
+	0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085,
+	0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007,
+	0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0005, 0x2001, 0x1958, 0x2004, 0x601a, 0x2009,
+	0x8020, 0x080c, 0x84d1, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005,
+	0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbb8c, 0x0030,
+	0x080c, 0xd4ce, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x0005, 0x9280,
+	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd303, 0xd303, 0xd303,
+	0xd305, 0xd303, 0xd305, 0xd305, 0xd303, 0xd305, 0xd303, 0xd303,
+	0xd303, 0xd303, 0xd303, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd31c, 0xd31c,
+	0xd31c, 0xd31c, 0xd31c, 0xd31c, 0xd329, 0xd31c, 0xd31c, 0xd31c,
+	0xd31c, 0xd31c, 0xd31c, 0xd31c, 0x6007, 0x003b, 0x602f, 0x0009,
+	0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1,
+	0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xd4ce, 0x604b, 0x0000,
+	0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6,
+	0x2268, 0x9186, 0x0007, 0x1904, 0xd382, 0x6814, 0x9005, 0x0138,
+	0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007,
+	0x003a, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00c6,
+	0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xd3f9, 0x6014, 0x9005,
+	0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0d65, 0x0804, 0xd3f9,
+	0x2048, 0x080c, 0xb847, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882,
+	0x2009, 0x0043, 0x080c, 0xcc3b, 0x0804, 0xd3f9, 0x2009, 0x0041,
+	0x0804, 0xd3f3, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c,
+	0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xd31c, 0xd0b4, 0x0128,
+	0xd0fc, 0x090c, 0x0d65, 0x0804, 0xd33d, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd3f9, 0x6814,
+	0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc,
+	0xa982, 0x00f6, 0x2c78, 0x080c, 0x164f, 0x00fe, 0x2009, 0x0042,
+	0x04d0, 0x0036, 0x080c, 0x1022, 0x090c, 0x0d65, 0xa867, 0x010d,
+	0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045,
+	0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026,
+	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c, 0xab7a,
+	0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001,
+	0x080c, 0x6996, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xcdf9,
+	0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a,
+	0x634a, 0x003e, 0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c,
+	0xcc3b, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128,
+	0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178,
+	0x080c, 0x8874, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004,
+	0x080c, 0xd21e, 0x009e, 0x003e, 0x080c, 0x8936, 0x0005, 0x9186,
+	0x0014, 0x0d70, 0x080c, 0x9ca2, 0x0005, 0xd42c, 0xd42a, 0xd42a,
+	0xd42a, 0xd42a, 0xd42a, 0xd42c, 0xd42a, 0xd42a, 0xd42a, 0xd42a,
+	0xd42a, 0xd42a, 0x080c, 0x0d65, 0x6003, 0x000c, 0x080c, 0x8936,
+	0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a,
+	0x080c, 0x9ca2, 0x0005, 0xd448, 0xd448, 0xd448, 0xd448, 0xd44a,
+	0xd46a, 0xd448, 0xd448, 0xd448, 0xd448, 0xd448, 0xd448, 0xd448,
+	0x080c, 0x0d65, 0x00d6, 0x2c68, 0x080c, 0x9b91, 0x01b0, 0x6003,
+	0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009,
+	0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023,
+	0x0004, 0x2009, 0x8020, 0x080c, 0x84d1, 0x2d60, 0x080c, 0x9be7,
+	0x00de, 0x0005, 0x080c, 0x9be7, 0x0005, 0x00e6, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1873,
+	0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026,
+	0xd0cc, 0x0150, 0x2001, 0x1959, 0x2004, 0x604a, 0x2009, 0x1873,
+	0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1873, 0x210c, 0xd1f4,
+	0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1959,
+	0x200c, 0x2001, 0x1957, 0x2004, 0x9100, 0x9080, 0x000a, 0x604a,
+	0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008, 0x2104, 0x9005,
+	0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085,
+	0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8ac, 0x2060,
+	0x8cff, 0x0180, 0x84ff, 0x1118, 0x605c, 0x9106, 0x1138, 0x600c,
+	0x2072, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x0010, 0x9cf0, 0x0003,
+	0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6,
+	0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130, 0x9c06, 0x0110,
+	0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de, 0x0005, 0x0026,
+	0x0036, 0x0156, 0x2011, 0x182b, 0x2204, 0x9084, 0x00ff, 0x2019,
+	0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334, 0x2204, 0x9084,
+	0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004, 0x6010,
+	0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x1168,
+	0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
+	0x0006, 0x080c, 0xabdf, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6f, 0x080c, 0x2ddb,
+	0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882,
+	0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046,
+	0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c4, 0x252c,
+	0x2021, 0x19cb, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7650,
+	0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786,
+	0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0,
+	0x080c, 0xd2a4, 0x01b8, 0x080c, 0xd2b4, 0x11a0, 0x6000, 0x9086,
+	0x0004, 0x1120, 0x0016, 0x080c, 0x1914, 0x001e, 0x080c, 0xba4b,
+	0x1110, 0x080c, 0x303b, 0x080c, 0xba5c, 0x1110, 0x080c, 0xa58f,
+	0x080c, 0x9c21, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e,
+	0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004,
+	0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004, 0xd09c, 0x000e,
+	0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xbf61, 0x0168, 0x2019,
+	0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
+	0x2021, 0x0004, 0x080c, 0x4a75, 0x004e, 0x003e, 0x000e, 0x6004,
+	0x9086, 0x0001, 0x1128, 0x080c, 0x94f4, 0x080c, 0x9c21, 0x9006,
+	0x0005, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1ddc, 0x2071,
+	0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06,
+	0x0148, 0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0,
+	0x9206, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1220, 0x0c60, 0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be,
+	0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091,
+	0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7034, 0x8000, 0x7036,
+	0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0178, 0x2500,
+	0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130,
+	0x908e, 0x0005, 0x0118, 0x2071, 0x184a, 0x0089, 0x001e, 0x00ee,
+	0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
+	0x2071, 0x1842, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e04,
+	0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x0005,
+	0x00e6, 0x2071, 0x1840, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071,
+	0x1844, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
+	0x8000, 0x2071, 0x1840, 0x7044, 0x8000, 0x7046, 0x00ee, 0x000e,
+	0x012e, 0x0005, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
+	0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
+	0x4000, 0x8000, 0xfddb
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2322flx_length01 = 0xce19;
+unsigned short fw2322flx_length01 = 0xce3b;
 #else
-unsigned short risc_code_length01 = 0xce19;
+unsigned short risc_code_length01 = 0xce3b;
 #endif
 
 /*
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index fd29cba70..af381fa6f 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -53,7 +53,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		qla_printk(KERN_WARNING, ha,
 		    "Firmware has been previously dumped (%p) -- ignoring "
 		    "request...\n", ha->fw_dump);
-		return;
+		goto qla2300_fw_dump_failed;
 	}
 
 	/* Allocate (large) dump buffer. */
@@ -64,7 +64,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		qla_printk(KERN_WARNING, ha,
 		    "Unable to allocated memory for firmware dump (%d/%Zd).\n",
 		    ha->fw_dump_order, sizeof(struct qla2300_fw_dump));
-		return;
+		goto qla2300_fw_dump_failed;
 	}
 	fw = ha->fw_dump;
 
@@ -360,7 +360,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
 	if (rval != QLA_SUCCESS) {
 		qla_printk(KERN_WARNING, ha,
-		    "Failed to dump firmware (%d)!!!\n", rval);
+		    "Failed to dump firmware (%x)!!!\n", rval);
 
 		free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
 		ha->fw_dump = NULL;
@@ -370,6 +370,7 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		    ha->host_no, ha->fw_dump);
 	}
 
+qla2300_fw_dump_failed:
 	if (!hardware_locked)
 		spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
@@ -569,7 +570,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 {
 	int		rval;
 	uint32_t	cnt, timer;
-	uint32_t	risc_address;
+	uint16_t	risc_address;
 	uint16_t	mb0, mb2;
 
 	device_reg_t	*reg;
@@ -589,7 +590,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		qla_printk(KERN_WARNING, ha,
 		    "Firmware has been previously dumped (%p) -- ignoring "
 		    "request...\n", ha->fw_dump);
-		return;
+		goto qla2100_fw_dump_failed;
 	}
 
 	/* Allocate (large) dump buffer. */
@@ -600,7 +601,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		qla_printk(KERN_WARNING, ha,
 		    "Unable to allocated memory for firmware dump (%d/%Zd).\n",
 		    ha->fw_dump_order, sizeof(struct qla2100_fw_dump));
-		return;
+		goto qla2100_fw_dump_failed;
 	}
 	fw = ha->fw_dump;
 
@@ -616,7 +617,6 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		else
 			rval = QLA_FUNCTION_TIMEOUT;
 	}
-
 	if (rval == QLA_SUCCESS) {
 		dmp_reg = (uint16_t *)(reg + 0);
 		for (cnt = 0; cnt < sizeof(fw->pbiu_reg) / 2; cnt++) 
@@ -694,18 +694,8 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		for (cnt = 0; cnt < sizeof(fw->fpm_b1_reg) / 2; cnt++) 
 			fw->fpm_b1_reg[cnt] = RD_REG_WORD(dmp_reg++);
 
-		/* Disable ISP interrupts. */
-		WRT_REG_WORD(&reg->ictrl, 0);
-
-		/* Reset RISC module. */
-		WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
-
-		/* Release RISC module. */
-		WRT_REG_WORD(&reg->hccr, HCCR_RELEASE_RISC); 
-
-		/* Insure mailbox registers are free. */
-		WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 
-		WRT_REG_WORD(&reg->hccr, HCCR_CLR_HOST_INT); 
+		/* Reset the ISP. */
+		WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
 	}
 
 	for (cnt = 30000; RD_MAILBOX_REG(ha, reg, 0) != 0 &&
@@ -729,7 +719,6 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 			else
 				rval = QLA_FUNCTION_TIMEOUT;
 		}
-
 		if (rval == QLA_SUCCESS) {
 			/* Set memory configuration and timing. */
 			if (IS_QLA2100(ha))
@@ -750,7 +739,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 	}
 	for (cnt = 0; cnt < sizeof(fw->risc_ram) / 2 && rval == QLA_SUCCESS;
 	    cnt++, risc_address++) {
- 		WRT_MAILBOX_REG(ha, reg, 1, (uint16_t)risc_address);
+ 		WRT_MAILBOX_REG(ha, reg, 1, risc_address);
 		WRT_REG_WORD(&reg->hccr, HCCR_SET_HOST_INT);
 
 		for (timer = 6000000; timer != 0; timer--) {
@@ -783,7 +772,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 
 	if (rval != QLA_SUCCESS) {
 		qla_printk(KERN_WARNING, ha,
-		    "Failed to dump firmware (%d)!!!\n", rval);
+		    "Failed to dump firmware (%x)!!!\n", rval);
 
 		free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
 		ha->fw_dump = NULL;
@@ -793,6 +782,7 @@ qla2100_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 		    ha->host_no, ha->fw_dump);
 	}
 
+qla2100_fw_dump_failed:
 	if (!hardware_locked)
 		spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 75e225c56..9d9045be3 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -154,6 +154,9 @@
 #define RD_REG_BYTE(addr)		readb(addr)
 #define RD_REG_WORD(addr)		readw(addr)
 #define RD_REG_DWORD(addr)		readl(addr)
+#define RD_REG_BYTE_RELAXED(addr)	readb_relaxed(addr)
+#define RD_REG_WORD_RELAXED(addr)	readw_relaxed(addr)
+#define RD_REG_DWORD_RELAXED(addr)	readl_relaxed(addr)
 #define WRT_REG_BYTE(addr, data)	writeb(data,addr)
 #define WRT_REG_WORD(addr, data)	writew(data,addr)
 #define WRT_REG_DWORD(addr, data)	writel(data,addr)
@@ -209,20 +212,11 @@
 #define MAX_OUTSTANDING_COMMANDS	1024
 
 /* ISP request and response entry counts (37-65535) */
-#define REQUEST_ENTRY_CNT		2048	/* Number of request entries. */
+#define REQUEST_ENTRY_CNT_2100		128	/* Number of request entries. */
+#define REQUEST_ENTRY_CNT_2200		2048	/* Number of request entries. */
 #define RESPONSE_ENTRY_CNT_2100		64	/* Number of response entries.*/
 #define RESPONSE_ENTRY_CNT_2300		512	/* Number of response entries.*/
 
-/* Calculations for SG segments */
-#define SEGS_PER_REQUEST_32	3 
-#define SEGS_PER_CONT_32	7
-#define SG_SEGMENTS_32 (SEGS_PER_REQUEST_32 + \
-    (SEGS_PER_CONT_32 * (REQUEST_ENTRY_CNT - 2)))     
-#define SEGS_PER_REQUEST_64	2 
-#define SEGS_PER_CONT_64	5
-#define SG_SEGMENTS_64 (SEGS_PER_REQUEST_64 + \
-    (SEGS_PER_CONT_64 * (REQUEST_ENTRY_CNT - 2)))     
-
 /*
  * SCSI Request Block 
  */
@@ -294,7 +288,8 @@ typedef struct srb {
 
 #define SRB_BUSY		BIT_8	/* Command is in busy retry state */
 #define SRB_FO_CANCEL		BIT_9	/* Command don't need to do failover */
-#define	SRB_IOCTL		BIT_10	/* IOCTL command. */
+#define SRB_IOCTL		BIT_10	/* IOCTL command. */
+#define SRB_TAPE		BIT_11	/* FCP2 (Tape) command. */
 
 /*
  * SRB state definitions
@@ -1931,10 +1926,6 @@ struct ct_sns_pkt {
 #define	RFT_ID_SNS_CMD_SIZE	60
 #define	RFT_ID_SNS_DATA_SIZE	16
 
-#define	RFF_ID_SNS_SCMD_LEN	8
-#define	RFF_ID_SNS_CMD_SIZE	32
-#define	RFF_ID_SNS_DATA_SIZE	16
-
 #define	RNN_ID_SNS_SCMD_LEN	10
 #define	RNN_ID_SNS_CMD_SIZE	36
 #define	RNN_ID_SNS_DATA_SIZE	16
@@ -1970,7 +1961,6 @@ struct sns_cmd_pkt {
 		} cmd;
 
 		uint8_t rft_data[RFT_ID_SNS_DATA_SIZE];
-		uint8_t rff_data[RFF_ID_SNS_DATA_SIZE];
 		uint8_t rnn_data[RNN_ID_SNS_DATA_SIZE];
 		uint8_t gan_data[GA_NXT_SNS_DATA_SIZE];
 		uint8_t gid_data[GID_PT_SNS_DATA_SIZE];
@@ -2123,6 +2113,7 @@ typedef struct scsi_qla_host {
 	request_t       *request_ring_ptr;  /* Current address. */
 	uint16_t        req_ring_index;     /* Current index. */
 	uint16_t        req_q_cnt;          /* Number of available entries. */
+	uint16_t	request_q_length;
 
 	dma_addr_t	response_dma;       /* Physical address. */
 	response_t      *response_ring;     /* Base virtual address */
@@ -2340,8 +2331,6 @@ typedef struct scsi_qla_host {
 
 	uint8_t     node_name[WWN_SIZE];
 	uint8_t     nvram_version; 
-	uint8_t     optrom_major; 
-	uint8_t     optrom_minor; 
 	uint32_t    isp_abort_cnt;
 
 	/* Adapter I/O statistics for failover */
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index ed2d2bbc3..78bde6063 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -198,7 +198,7 @@ extern int
 qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
 
 extern uint8_t
-qla2x00_get_link_status(scsi_qla_host_t *, uint8_t, link_stat_t *, uint16_t *);
+qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *, uint16_t *);
 
 extern int
 qla2x00_lip_reset(scsi_qla_host_t *);
@@ -255,14 +255,6 @@ extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
 extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
 extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
 extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
-extern void qla2x00_flash_enable(scsi_qla_host_t *);
-extern void qla2x00_flash_disable(scsi_qla_host_t *);
-extern uint8_t qla2x00_read_flash_byte(scsi_qla_host_t *, uint32_t);
-extern uint8_t qla2x00_get_flash_manufacturer(scsi_qla_host_t *);
-extern uint16_t qla2x00_get_flash_version(scsi_qla_host_t *);
-extern uint16_t qla2x00_get_flash_image(scsi_qla_host_t *, uint8_t *);
-extern uint16_t qla2x00_set_flash_image(scsi_qla_host_t *, uint8_t *);
-
 /*
  * Global Function Prototypes in qla_dbg.c source file.
  */
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 899815278..2789f890a 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -34,7 +34,6 @@ static int qla2x00_sns_gid_pt(scsi_qla_host_t *, sw_info_t *);
 static int qla2x00_sns_gpn_id(scsi_qla_host_t *, sw_info_t *);
 static int qla2x00_sns_gnn_id(scsi_qla_host_t *, sw_info_t *);
 static int qla2x00_sns_rft_id(scsi_qla_host_t *);
-static int qla2x00_sns_rff_id(scsi_qla_host_t *);
 static int qla2x00_sns_rnn_id(scsi_qla_host_t *);
 
 /**
@@ -113,7 +112,7 @@ qla2x00_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		return (qla2x00_sns_ga_nxt(ha, fcport));
 	}
 
@@ -201,7 +200,7 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list)
 
 	struct ct_sns_gid_pt_data *gid_data;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		return (qla2x00_sns_gid_pt(ha, list));
 	}
 
@@ -278,7 +277,7 @@ qla2x00_gpn_id(scsi_qla_host_t *ha, sw_info_t *list)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		return (qla2x00_sns_gpn_id(ha, list));
 	}
 
@@ -343,7 +342,7 @@ qla2x00_gnn_id(scsi_qla_host_t *ha, sw_info_t *list)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		return (qla2x00_sns_gnn_id(ha, list));
 	}
 
@@ -422,7 +421,7 @@ qla2x00_rft_id(scsi_qla_host_t *ha)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		return (qla2x00_sns_rft_id(ha));
 	}
 
@@ -479,8 +478,10 @@ qla2x00_rff_id(scsi_qla_host_t *ha)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
-		return (qla2x00_sns_rff_id(ha));
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
+		DEBUG2(printk("scsi(%ld): RFF_ID call unsupported on "
+		    "ISP2100/ISP2200.\n", ha->host_no));
+		return (QLA_SUCCESS);
 	}
 
 	/* Issue RFF_ID */
@@ -536,7 +537,7 @@ qla2x00_rnn_id(scsi_qla_host_t *ha)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		return (qla2x00_sns_rnn_id(ha));
 	}
 
@@ -595,9 +596,9 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha)
 	struct ct_sns_req	*ct_req;
 	struct ct_sns_rsp	*ct_rsp;
 
-	if (IS_QLA2200(ha)) {
+	if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 		DEBUG2(printk("scsi(%ld): RSNN_ID call unsupported on "
-		    "ISP2200.\n", ha->host_no));
+		    "ISP2100/ISP2200.\n", ha->host_no));
 		return (QLA_SUCCESS);
 	}
 
@@ -1003,55 +1004,6 @@ qla2x00_sns_rft_id(scsi_qla_host_t *ha)
 	return (rval);
 }
 
-/**
- * qla2x00_sns_rff_id() - SNS Register FC-4 Features (RFF_ID) supported by the
- * HBA.
- * @ha: HA context
- *
- * This command uses the old Exectute SNS Command mailbox routine.
- *
- * Returns 0 on success.
- */
-static int
-qla2x00_sns_rff_id(scsi_qla_host_t *ha)
-{
-	int		rval;
-
-	struct sns_cmd_pkt	*sns_cmd;
-
-	/* Issue RFF_ID. */
-	/* Prepare SNS command request. */
-	sns_cmd = qla2x00_prep_sns_cmd(ha, RFF_ID_CMD, RFF_ID_SNS_SCMD_LEN,
-	    RFF_ID_SNS_DATA_SIZE);
-
-	/* Prepare SNS command arguments -- port_id, FC-4 feature, FC-4 type */
-	sns_cmd->p.cmd.param[0] = ha->d_id.b.al_pa;
-	sns_cmd->p.cmd.param[1] = ha->d_id.b.area;
-	sns_cmd->p.cmd.param[2] = ha->d_id.b.domain;
-
-	sns_cmd->p.cmd.param[6] = 0x08;			/* SCSI - FCP */
-
-	/* Execute SNS command. */
-	rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RFF_ID_SNS_CMD_SIZE / 2,
-	    sizeof(struct sns_cmd_pkt));
-	if (rval != QLA_SUCCESS) {
-		/*EMPTY*/
-		DEBUG2_3(printk("scsi(%ld): RFF_ID Send SNS failed (%d).\n",
-		    ha->host_no, rval));
-	} else if (sns_cmd->p.rff_data[8] != 0x80 ||
-	    sns_cmd->p.rff_data[9] != 0x02) {
-		DEBUG2_3(printk("scsi(%ld): RFF_ID failed, rejected request, "
-		    "rff_rsp:\n", ha->host_no));
-		DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.rff_data, 16));
-		rval = QLA_FUNCTION_FAILED;
-	} else {
-		DEBUG2(printk("scsi(%ld): RFF_ID exiting normally.\n",
-		    ha->host_no));
-	}
-
-	return (rval);
-}
-
 /**
  * qla2x00_sns_rnn_id() - SNS Register Node Name (RNN_ID) of the HBA.
  * HBA.
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 661ca6c97..ccc153198 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -102,9 +102,9 @@ int
 qla2x00_initialize_adapter(scsi_qla_host_t *ha)
 {
 	int	rval;
-	uint8_t	isp_init = 0;
 	uint8_t	restart_risc = 0;
 	uint8_t	retry;
+	uint32_t wait_time;
 
 	/* Clear adapter flags. */
 	ha->flags.online = FALSE;
@@ -133,14 +133,9 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
 	/* Initialize target map database. */
 	qla2x00_init_tgt_map(ha);
 
-	/* Get Flash Version */
-	qla2x00_get_flash_version(ha);
-
 	qla_printk(KERN_INFO, ha, "Configure NVRAM parameters...\n");
 	qla2x00_nvram_config(ha);
 
-	ha->retry_count = ql2xretrycount;
-
 	qla_printk(KERN_INFO, ha, "Verifying loaded RISC code...\n");
 
 #if 0
@@ -161,7 +156,6 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
 	 */
 	do {
 		restart_risc = 0;
-		isp_init = 0;
 
 		/* If firmware needs to be loaded */
 		if (qla2x00_isp_firmware(ha) != QLA_SUCCESS) {
@@ -180,21 +174,22 @@ check_fw_ready_again:
 			 * value OR a minimum of 4 seconds OR If no 
 			 * cable, only 5 seconds.
 			 */
-			if (!qla2x00_fw_ready(ha)) {
+			rval = qla2x00_fw_ready(ha);
+			if (rval == QLA_SUCCESS) {
 				clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
 
 				/*
-				 * Go setup flash database devices with proper
-				 * Loop ID's.
+				 * Wait at most MAX_TARGET RSCNs for a stable
+				 * link.
 				 */
+				wait_time = 256;
 				do {
 					clear_bit(LOOP_RESYNC_NEEDED,
 					    &ha->dpc_flags);
 					rval = qla2x00_configure_loop(ha);
 
-					if (test_bit(ISP_ABORT_NEEDED,
+					if (test_and_clear_bit(ISP_ABORT_NEEDED,
 					    &ha->dpc_flags)) {
-
 						restart_risc = 1;
 						break;
 					}
@@ -209,20 +204,22 @@ check_fw_ready_again:
 					    LOOP_DOWN && retry--) {
 						goto check_fw_ready_again;
 					}
+					wait_time--;
 				} while (!atomic_read(&ha->loop_down_timer) &&
 				    retry &&
-				    (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
+				    wait_time &&
+				    (test_bit(LOOP_RESYNC_NEEDED,
+					&ha->dpc_flags)));
+
+				if (wait_time == 0)
+					rval = QLA_FUNCTION_FAILED;
+				if (ha->mem_err)
+					restart_risc = 1;
 			}
-
-			if (ha->mem_err) {
-				restart_risc = 1;
-			}
-			isp_init = 1;
-
 		}
 	} while (restart_risc && retry--);
 
-	if (isp_init) {
+	if (rval == QLA_SUCCESS) {
 		/* Retrieve firmware information */
 		qla2x00_get_fw_version(ha, &ha->fw_major_version,
 		    &ha->fw_minor_version, &ha->fw_subminor_version,
@@ -234,9 +231,7 @@ check_fw_ready_again:
 		ha->marker_needed = 0;
 
 		ha->flags.online = TRUE;
-	}
-
-	if (rval) {
+	} else {
 		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
 	}
 
@@ -290,7 +285,7 @@ qla2x00_pci_config(scsi_qla_host_t *ha)
 		/* PCI Specification Revision 2.3 changes */
 		if (IS_QLA2322(ha) || IS_QLA6322(ha))
 			/* Command Register - Reset Interrupt Disable. */
-			w &= ~BIT_10;
+			w &= ~PCI_COMMAND_INTX_DISABLE;
 
 		/*
 		 * If this is a 2300 card and not 2312, reset the
@@ -603,10 +598,11 @@ qla2x00_chip_diag(scsi_qla_host_t *ha)
 	ha->product_id[3] = mb[4];
 
 	/* Adjust fw RISC transfer size */
-	if (REQUEST_ENTRY_CNT > 1024)
+	if (ha->request_q_length > 1024)
 		ha->fw_transfer_size = REQUEST_ENTRY_SIZE * 1024;
 	else
-		ha->fw_transfer_size = REQUEST_ENTRY_SIZE * REQUEST_ENTRY_CNT;
+		ha->fw_transfer_size = REQUEST_ENTRY_SIZE *
+		    ha->request_q_length;
 
 	if (IS_QLA2200(ha) &&
 	    RD_MAILBOX_REG(ha, reg, 7) == QLA2200A_RISC_ROM_VER) {
@@ -773,6 +769,54 @@ qla2x00_init_response_q_entries(scsi_qla_host_t *ha)
 
 }
 
+/**
+ * qla2x00_update_fw_options() - Read and process firmware options.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static void
+qla2x00_update_fw_options(scsi_qla_host_t *ha)
+{
+	/* Setup seriallink options */
+	uint16_t swing, emphasis;
+
+	memset(ha->fw_options, 0, sizeof(ha->fw_options));
+	qla2x00_get_fw_options(ha, ha->fw_options);
+
+	if (IS_QLA2100(ha) || IS_QLA2200(ha))
+		return;
+
+	/* Serial Link options. */
+	DEBUG3(printk("scsi(%ld): Serial link options:\n",
+	    ha->host_no));
+	DEBUG3(qla2x00_dump_buffer((uint8_t *)&ha->fw_seriallink_options,
+	    sizeof(ha->fw_seriallink_options)));
+
+	ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
+	if (ha->fw_seriallink_options[1] & BIT_2)
+		ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING;
+
+	/*  1G settings */
+	swing = ha->fw_seriallink_options[0] & (BIT_2 | BIT_1 | BIT_0);
+	emphasis = ha->fw_seriallink_options[0] & (BIT_4 | BIT_3);
+	emphasis >>= 3;
+	ha->fw_options[10] = (emphasis << 14) | (swing << 8) | 0x3;
+
+	/*  2G settings */
+	swing = ha->fw_seriallink_options[0] & (BIT_7 | BIT_6 | BIT_5);
+	swing >>= 5;
+	emphasis = ha->fw_seriallink_options[1] & (BIT_1 | BIT_0);
+	ha->fw_options[11] = (emphasis << 14) | (swing << 8) | 0x3;
+
+	/* FCP2 options. */
+	/*  Return command IOCBs without waiting for an ABTS to complete. */
+	ha->fw_options[3] |= BIT_13;
+
+	/* Update Serial Link options. */
+	qla2x00_set_fw_options(ha, ha->fw_options);
+}
+
 /**
  * qla2x00_init_rings() - Initializes firmware.
  * @ha: HA context
@@ -805,7 +849,7 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
 	/* Initialize firmware. */
 	ha->request_ring_ptr  = ha->request_ring;
 	ha->req_ring_index    = 0;
-	ha->req_q_cnt         = REQUEST_ENTRY_CNT;
+	ha->req_q_cnt         = ha->request_q_length;
 	ha->response_ring_ptr = ha->response_ring;
 	ha->rsp_ring_index    = 0;
 
@@ -826,35 +870,8 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
 		DEBUG2_3(printk("scsi(%ld): Init firmware **** FAILED ****.\n",
 		    ha->host_no));
 	} else {
-		/* Setup seriallink options */
-		uint16_t swing, emphasis;
-
-		DEBUG3(printk("scsi(%ld): Serial link options:\n",
-		    ha->host_no));
-		DEBUG3(qla2x00_dump_buffer(
-		    (uint8_t *)&ha->fw_seriallink_options,
-		    sizeof(ha->fw_seriallink_options)));
-
-		memset(ha->fw_options, 0, sizeof(ha->fw_options));
-		qla2x00_get_fw_options(ha, ha->fw_options);
-
-		ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
-		if (ha->fw_seriallink_options[1] & BIT_2)
-			ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING;
-
-		/* 1G settings */
-		swing = ha->fw_seriallink_options[0] & (BIT_2 | BIT_1 | BIT_0);
-		emphasis = ha->fw_seriallink_options[0] & (BIT_4 | BIT_3);
-		emphasis >>= 3;
-		ha->fw_options[10] = (emphasis << 14) | (swing << 8) | 0x3;
-
-		/* 2G settings */
-		swing = ha->fw_seriallink_options[0] & (BIT_7 | BIT_6 | BIT_5);
-		swing >>= 5;
-		emphasis = ha->fw_seriallink_options[1] & (BIT_1 | BIT_0);
-		ha->fw_options[11] = (emphasis << 14) | (swing << 8) | 0x3;
-
-		qla2x00_set_fw_options(ha, ha->fw_options);
+		/* Update any ISP specific firmware options. */
+		qla2x00_update_fw_options(ha);
 
 		DEBUG3(printk("scsi(%ld): Init firmware -- success.\n",
 		    ha->host_no));
@@ -946,7 +963,7 @@ qla2x00_fw_ready(scsi_qla_host_t *ha)
 			break;
 
 		/* Delay for a while */
-		set_current_state(TASK_INTERRUPTIBLE);
+		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(HZ / 2);
 
 		DEBUG3(printk("scsi(%ld): fw_state=%x curr time=%lx.\n",
@@ -1005,10 +1022,6 @@ qla2x00_configure_hba(scsi_qla_host_t *ha)
 
 	ha->loop_id = loop_id;
 
-	/* Make sure 2100 only has loop, in case of any firmware bug. */
-	if (IS_QLA2100(ha))
-		topo = 0;
-
 	/* initialize */
 	ha->min_external_loopid = SNS_FIRST_LOOP_ID;
 	ha->operating_mode = LOOP;
@@ -1381,7 +1394,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
 	 */
 	icb->request_q_outpointer = __constant_cpu_to_le16(0);
 	icb->response_q_inpointer = __constant_cpu_to_le16(0);
-	icb->request_q_length = __constant_cpu_to_le16(REQUEST_ENTRY_CNT);
+	icb->request_q_length = cpu_to_le16(ha->request_q_length);
 	icb->response_q_length = cpu_to_le16(ha->response_q_length);
 	icb->request_q_address[0] = cpu_to_le32(LSD(ha->request_dma));
 	icb->request_q_address[1] = cpu_to_le32(MSD(ha->request_dma));
@@ -1496,24 +1509,24 @@ static int
 qla2x00_configure_loop(scsi_qla_host_t *ha) 
 {
 	int  rval;
-	uint8_t  rval1 = 0;
 	unsigned long flags, save_flags;
 
 	rval = QLA_SUCCESS;
 
 	/* Get Initiator ID */
-	if (qla2x00_configure_hba(ha)) {
-		DEBUG(printk("scsi(%ld): Unable to configure HBA.\n",
-		    ha->host_no));
-		return (QLA_FUNCTION_FAILED);
+	if (test_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags)) {
+		rval = qla2x00_configure_hba(ha);
+		if (rval != QLA_SUCCESS) {
+			DEBUG(printk("scsi(%ld): Unable to configure HBA.\n",
+			    ha->host_no));
+			return (rval);
+		}
 	}
 
 	save_flags = flags = ha->dpc_flags;
 	DEBUG(printk("scsi(%ld): Configure loop -- dpc flags =0x%lx\n",
 	    ha->host_no, flags));
 
-	/* dg 02/26/02 ha->dpc_flags &= ~(LOCAL_LOOP_UPDATE | RSCN_UPDATE); */
-
 	/*
 	 * If we have both an RSCN and PORT UPDATE pending then handle them
 	 * both at the same time.
@@ -1544,50 +1557,32 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
 		set_bit(LOCAL_LOOP_UPDATE, &flags);
 	}
 
-	do {
-		if (test_bit(LOCAL_LOOP_UPDATE, &flags)) {
-			rval = rval | qla2x00_configure_local_loop(ha);
-		}
-
-		if (test_bit(RSCN_UPDATE, &flags)) {
-			rval1 = qla2x00_configure_fabric(ha);
-			if ((rval1 & BIT_0) && ha->sns_retry_cnt < 8) {
-				ha->sns_retry_cnt++;
-				set_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags);
-			}
+	if (test_bit(LOCAL_LOOP_UPDATE, &flags)) {
+		if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			rval = qla2x00_configure_local_loop(ha);
 		}
+	}
 
-		/* Isolate error status. */
-		if (rval & BIT_0) {
-			rval = 1;
+	if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) {
+		if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
+			rval = QLA_FUNCTION_FAILED;
 		} else {
-			rval = QLA_SUCCESS;
+			rval = qla2x00_configure_fabric(ha);
 		}
+	}
 
-	} while (rval != QLA_SUCCESS);
-
-	if (!atomic_read(&ha->loop_down_timer) &&
-	    !(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))) {
-
-		qla2x00_config_os(ha);
-
-		/* If we found all devices then go ready */
-		if (!(test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags))) {
+	if (rval == QLA_SUCCESS) {
+		if (atomic_read(&ha->loop_down_timer) ||
+		    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
+			rval = QLA_FUNCTION_FAILED;
+		} else {
+			qla2x00_config_os(ha);
 			atomic_set(&ha->loop_state, LOOP_READY);
 
 			DEBUG(printk("scsi(%ld): LOOP READY\n", ha->host_no));
-		} else {
-			if (test_bit(LOCAL_LOOP_UPDATE, &save_flags))
-				set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
-			if (test_bit(RSCN_UPDATE, &save_flags))
-				set_bit(RSCN_UPDATE, &ha->dpc_flags);
 		}
-	} else {
-		DEBUG(printk("scsi(%ld): Loop down counter running= %d or "
-		    "Resync needed- dpc flags= %ld\n",
-		    ha->host_no,
-		    atomic_read(&ha->loop_down_timer), ha->dpc_flags));
-		/* ???? dg 02/26/02  rval = 1; */
 	}
 
 	if (rval) {
@@ -1619,7 +1614,6 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
  *
  * Returns:
  *	0 = success.
- *	BIT_0 = error.
  */
 static int
 qla2x00_configure_local_loop(scsi_qla_host_t *ha) 
@@ -1644,19 +1638,9 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
 	uint16_t	loop_id;
 	uint8_t		domain, area, al_pa;
 
-	rval = QLA_SUCCESS;
 	found_devs = 0;
 	new_fcport = NULL;
 
-	/*
-	 * No point in continuing if the loop is in a volatile state -- 
-	 * reschedule LOCAL_LOOP_UPDATE for later processing
-	 */
-	if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
-		set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
-		return (rval);
-	}
-
 	entries = MAX_FIBRE_DEVICES;
 	id_list = pci_alloc_consistent(ha->pdev, MAX_ID_LIST_SIZE,
 	    &id_list_dma);
@@ -1668,7 +1652,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
 		    "Memory Allocation failed - port_list");
 
 		ha->mem_err++;
-		return (BIT_0);
+		return (QLA_MEMORY_ALLOC_FAILED);
 	}
 	memset(id_list, 0, MAX_ID_LIST_SIZE);
 
@@ -1677,8 +1661,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
 
 	/* Get list of logged in devices. */
 	rval = qla2x00_get_id_list(ha, id_list, id_list_dma, &entries);
-	if (rval) {
-		rval = BIT_0;
+	if (rval != QLA_SUCCESS) {
 		goto cleanup_allocation;
 	}
 
@@ -1690,7 +1673,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
 	/* Allocate temporary fcport for any new fcports discovered. */
 	new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
 	if (new_fcport == NULL) {
-		rval = BIT_0;
+		rval = QLA_MEMORY_ALLOC_FAILED;
 		goto cleanup_allocation;
 	}
 	new_fcport->flags &= ~FCF_FABRIC_DEVICE;
@@ -1783,7 +1766,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
 			fcport = new_fcport;
 			new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
 			if (new_fcport == NULL) {
-				rval = BIT_0;
+				rval = QLA_MEMORY_ALLOC_FAILED;
 				goto cleanup_allocation;
 			}
 			new_fcport->flags &= ~FCF_FABRIC_DEVICE;
@@ -1800,7 +1783,7 @@ cleanup_allocation:
 	if (new_fcport)
 		kfree(new_fcport);
 
-	if (rval & BIT_0) {
+	if (rval != QLA_SUCCESS) {
 		DEBUG2(printk("scsi(%ld): Configure local loop error exit: "
 		    "rval=%x\n", ha->host_no, rval));
 	}
@@ -2339,7 +2322,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
 	/* Mark devices that need re-synchronization. */
 	rval2 = qla2x00_device_resync(ha);
 	if (rval2 == QLA_RSCNS_HANDLED) {
-		/* No, point doing the scan, just continue. */
+		/* No point doing the scan, just continue. */
 		return (QLA_SUCCESS);
 	}
 	do {
@@ -2489,7 +2472,6 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
  *
  * Returns:
  *	0 = success.
- *	BIT_0 = error.
  *
  * Context:
  *	Kernel context.
@@ -3082,6 +3064,7 @@ int
 qla2x00_loop_resync(scsi_qla_host_t *ha) 
 {
 	int   rval;
+	uint32_t wait_time;
 
 	rval = QLA_SUCCESS;
 
@@ -3090,6 +3073,8 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
 	clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
 	if (ha->flags.online) {
 		if (!(rval = qla2x00_fw_ready(ha))) {
+			/* Wait at most MAX_TARGET RSCNs for a stable link. */
+			wait_time = 256;
 			do {
 				/* v2.19.05b6 */
 				atomic_set(&ha->loop_state, LOOP_UPDATE);
@@ -3104,12 +3089,13 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
 				clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
 
 				qla2x00_configure_loop(ha);
-
+				wait_time--;
 			} while (!atomic_read(&ha->loop_down_timer) &&
 				!(test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) &&
+				wait_time &&
 				(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
 		}
-		qla2x00_restart_queues(ha,TRUE);
+		qla2x00_restart_queues(ha, TRUE);
 	}
 
 	if (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) {
@@ -3150,6 +3136,10 @@ qla2x00_restart_queues(scsi_qla_host_t *ha, uint8_t flush)
 		spin_lock_irqsave(&ha->list_lock,flags);
 		list_for_each_safe(list, temp, &ha->pending_queue) {
 			sp = list_entry(list, srb_t, list);
+
+			if ((sp->flags & SRB_TAPE))
+				continue;
+			 
 			/* 
 			 * When time expire return request back to OS as BUSY 
 			 */
@@ -3292,6 +3282,7 @@ qla2x00_config_os(scsi_qla_host_t *ha)
 static uint16_t
 qla2x00_fcport_bind(scsi_qla_host_t *ha, fc_port_t *fcport) 
 {
+	int		found;
 	uint16_t	tgt;
 	os_tgt_t	*tq;
 
@@ -3300,18 +3291,32 @@ qla2x00_fcport_bind(scsi_qla_host_t *ha, fc_port_t *fcport)
 		if ((tq = TGT_Q(ha, tgt)) == NULL)
 			continue;
 
-		if (ha->binding_type == BIND_BY_PORT_ID &&
-		    fcport->d_id.b24 == tq->d_id.b24) {
-			memcpy(tq->node_name, fcport->node_name, WWN_SIZE);
-			memcpy(tq->port_name, fcport->port_name, WWN_SIZE);
+		found = 0;
+		switch (ha->binding_type) {
+		case BIND_BY_PORT_ID:
+			if (fcport->d_id.b24 == tq->d_id.b24) {
+				memcpy(tq->node_name, fcport->node_name,
+				    WWN_SIZE);
+				memcpy(tq->port_name, fcport->port_name,
+				    WWN_SIZE);
+				found++;
+			}
 			break;
-		}
-
-		if (memcmp(fcport->port_name, tq->port_name, WWN_SIZE) == 0) {
-			/* In case of persistent binding, update the WWNN */
-			memcpy(tq->node_name, fcport->node_name, WWN_SIZE);
+		case BIND_BY_PORT_NAME:    
+			if (memcmp(fcport->port_name, tq->port_name,
+			    WWN_SIZE) == 0) {
+				/*
+				 * In case of persistent binding, update the
+				 * WWNN.
+				 */
+				memcpy(tq->node_name, fcport->node_name,
+				    WWN_SIZE);
+				found++;
+			}
 			break;
 		}
+		if (found)
+		    break;	
 	}
 
 	/* TODO: honor the ConfigRequired flag */
@@ -4226,6 +4231,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
 	uint8_t		status = 0;
 	device_reg_t	*reg;
 	unsigned long	flags = 0;
+	uint32_t wait_time;
 
 	/* If firmware needs to be loaded */
 	if (qla2x00_isp_firmware(ha)) {
@@ -4269,11 +4275,15 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
 					__func__,
 					status);)
 			ha->flags.online = TRUE;
+			/* Wait at most MAX_TARGET RSCNs for a stable link. */
+			wait_time = 256;
 			do {
 				clear_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
 				qla2x00_configure_loop(ha);
+				wait_time--;
 			} while (!atomic_read(&ha->loop_down_timer) &&
 				!(test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) &&
+				wait_time &&
 				(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
 		}
 
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 78a1c57ee..0baccf130 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -124,7 +124,7 @@ qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *ha)
 
 	/* Adjust ring index. */
 	ha->req_ring_index++;
-	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+	if (ha->req_ring_index == ha->request_q_length) {
 		ha->req_ring_index = 0;
 		ha->request_ring_ptr = ha->request_ring;
 	} else {
@@ -153,7 +153,7 @@ qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *ha)
 
 	/* Adjust ring index. */
 	ha->req_ring_index++;
-	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+	if (ha->req_ring_index == ha->request_q_length) {
 		ha->req_ring_index = 0;
 		ha->request_ring_ptr = ha->request_ring;
 	} else {
@@ -390,11 +390,11 @@ qla2x00_start_scsi(srb_t *sp)
 
 	if (ha->req_q_cnt < (sp->req_cnt + 2)) {
 		/* Calculate number of free request entries */
-		cnt = RD_REG_WORD(ISP_REQ_Q_OUT(ha, reg));
+		cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg));
 		if (ha->req_ring_index < cnt)
 			ha->req_q_cnt = cnt - ha->req_ring_index;
 		else
-			ha->req_q_cnt = REQUEST_ENTRY_CNT -
+			ha->req_q_cnt = ha->request_q_length -
 			    (ha->req_ring_index - cnt);
 	}
 
@@ -484,7 +484,7 @@ qla2x00_start_scsi(srb_t *sp)
 
 	/* Adjust ring index. */
 	ha->req_ring_index++;
-	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+	if (ha->req_ring_index == ha->request_q_length) {
 		ha->req_ring_index = 0;
 		ha->request_ring_ptr = ha->request_ring;
 	} else
@@ -499,7 +499,7 @@ qla2x00_start_scsi(srb_t *sp)
 
 	/* Set chip new ring index. */
 	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
-	RD_REG_WORD(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
+	RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
 
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 	return (QLA_SUCCESS);
@@ -588,7 +588,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha)
 			if  (ha->req_ring_index < cnt)
 				ha->req_q_cnt = cnt - ha->req_ring_index;
 			else
-				ha->req_q_cnt = REQUEST_ENTRY_CNT -
+				ha->req_q_cnt = ha->request_q_length -
 				    (ha->req_ring_index - cnt);
 		}
 		/* If room for request in request ring. */
@@ -658,7 +658,7 @@ qla2x00_ms_req_pkt(scsi_qla_host_t *ha, srb_t  *sp)
 			if (ha->req_ring_index < cnt) {
 				ha->req_q_cnt = cnt - ha->req_ring_index;
 			} else {
-				ha->req_q_cnt = REQUEST_ENTRY_CNT -
+				ha->req_q_cnt = ha->request_q_length -
 				    (ha->req_ring_index - cnt);
 			}
 		}
@@ -740,7 +740,7 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha)
 
 	/* Adjust ring index. */
 	ha->req_ring_index++;
-	if (ha->req_ring_index == REQUEST_ENTRY_CNT) {
+	if (ha->req_ring_index == ha->request_q_length) {
 		ha->req_ring_index = 0;
 		ha->request_ring_ptr = ha->request_ring;
 	} else
@@ -748,5 +748,5 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha)
 
 	/* Set chip new ring index. */
 	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
-	RD_REG_WORD(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
+	RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
 }
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 415242a11..382a4fe93 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -165,7 +165,7 @@ qla2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 				break;
 			}
 			WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
-			RD_REG_WORD(&reg->hccr);
+			RD_REG_WORD_RELAXED(&reg->hccr);
 		}
 	}
 
@@ -907,7 +907,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 	 * If loop is in transient state Report DID_BUS_BUSY
 	 */
 	if ((comp_status != CS_COMPLETE || scsi_status != 0)) {
-		if (!(sp->flags & SRB_IOCTL) &&
+		if (!(sp->flags & (SRB_IOCTL | SRB_TAPE)) &&
 		    (atomic_read(&ha->loop_down_timer) ||
 			atomic_read(&ha->loop_state) != LOOP_READY)) {
 
@@ -986,7 +986,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 		if (sp->request_sense_length != 0)
 			ha->status_srb = sp;
 
-		if (!(sp->flags & SRB_IOCTL) &&
+		if (!(sp->flags & (SRB_IOCTL | SRB_TAPE)) &&
 		    qla2x00_check_sense(cp, lq) == QLA_SUCCESS) {
 			/* Throw away status_cont if any */
 			ha->status_srb = NULL;
@@ -1053,7 +1053,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 			if (sp->request_sense_length != 0)
 				ha->status_srb = sp;
 
-			if (!(sp->flags & SRB_IOCTL) &&
+			if (!(sp->flags & (SRB_IOCTL | SRB_TAPE)) &&
 			    (qla2x00_check_sense(cp, lq) == QLA_SUCCESS)) {
 				ha->status_srb = NULL;
 				add_to_scsi_retry_queue(ha, sp);
@@ -1137,7 +1137,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 		    ha->host_no, t, l, cp->serial_number, comp_status,
 		    atomic_read(&fcport->state)));
 
-		if ((sp->flags & SRB_IOCTL) ||
+		if ((sp->flags & (SRB_IOCTL | SRB_TAPE)) ||
 		    atomic_read(&fcport->state) == FCS_DEVICE_DEAD) {
 			cp->result = DID_NO_CONNECT << 16;
 			if (atomic_read(&ha->loop_state) == LOOP_DOWN) 
@@ -1162,7 +1162,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 		    "scsi(%ld): RESET status detected 0x%x-0x%x.\n",
 		    ha->host_no, comp_status, scsi_status));
 
-		if (sp->flags & SRB_IOCTL) {
+		if (sp->flags & (SRB_IOCTL | SRB_TAPE)) {
 			cp->result = DID_RESET << 16;
 		} else {
 			qla2x00_extend_timeout(cp, EXTEND_CMD_TIMEOUT);
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index d879cf472..8fbe3fdd7 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -279,6 +279,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 			DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): "
 			    "timeout schedule isp_abort_needed.\n",
 			    ha->host_no);)
+			qla_printk(KERN_WARNING, ha,
+			    "Mailbox command timeout occured. Scheduling ISP "
+			    "abort.\n");
 			set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 			if (ha->dpc_wait && !ha->dpc_active) 
 				up(ha->dpc_wait);
@@ -290,6 +293,9 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 			    "calling abort_isp\n", ha->host_no);)
 			DEBUG2_3_11(printk("qla2x00_mailbox_command(%ld): "
 			    "timeout calling abort_isp\n", ha->host_no);)
+			qla_printk(KERN_WARNING, ha,
+			    "Mailbox command timeout occured. Issuing ISP "
+			    "abort.\n");
 
 			set_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags);
 			clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
@@ -981,7 +987,6 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
 
 	if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
 	    atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
-		/* v2.19.8 Ignore abort request if port is down */
 		return 1;
 	}
 
@@ -1062,6 +1067,9 @@ qla2x00_abort_device(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun)
 	qla2x00_marker(ha, loop_id, lun, MK_SYNC_ID_LUN);
 
 	if (rval != QLA_SUCCESS) {
+		qla_printk(KERN_WARNING, ha,
+		    "Failed Abort Device Mailbox command. Scheduling ISP "
+		    "abort.\n");
 		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 		if (ha->dpc_wait && !ha->dpc_active) 
 			up(ha->dpc_wait);
@@ -1598,7 +1606,7 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t *name,
  *	BIT_1 = mailbox error.
  */
 uint8_t
-qla2x00_get_link_status(scsi_qla_host_t *ha, uint8_t loop_id,
+qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id,
     link_stat_t *ret_buf, uint16_t *status)
 {
 	int rval;
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 788aa7a14..cf3b81211 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -168,7 +168,6 @@ static struct scsi_host_template qla2x00_driver_template = {
 	.slave_configure	= qla2xxx_slave_configure,
 
 	.this_id		= -1,
-	.can_queue		= REQUEST_ENTRY_CNT+128,
 	.cmd_per_lun		= 3,
 	.use_clustering		= ENABLE_CLUSTERING,
 	.sg_tablesize		= SG_ALL,
@@ -776,10 +775,13 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
 
 	/* Only modify the allowed count if the target is a *non* tape device */
 	if ((fcport->flags & FCF_TAPE_PRESENT) == 0) {
+		sp->flags &= ~SRB_TAPE;
 		if (cmd->allowed < ql2xretrycount) {
 			cmd->allowed = ql2xretrycount;
 		}
-	}
+	} else
+		sp->flags |= SRB_TAPE;
+
 
 	DEBUG5(printk("scsi(%ld:%2d:%2d): (queuecmd) queue sp = %p, "
 	    "flags=0x%x fo retry=%d, pid=%ld\n",
@@ -808,7 +810,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
 	    atomic_read(&ha2->loop_state) == LOOP_DEAD) {
 		/*
 		 * Add the command to the done-queue for later failover
-		 * processing
+		 * processing.
 		 */
 		cmd->result = DID_NO_CONNECT << 16;
 		if (atomic_read(&ha2->loop_state) == LOOP_DOWN) 
@@ -822,7 +824,8 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
 		spin_lock_irq(ha->host->host_lock);
 		return (0);
 	}
-	if (tq && test_bit(TQF_SUSPENDED, &tq->flags)) {
+	if (tq && test_bit(TQF_SUSPENDED, &tq->flags) &&
+	    (sp->flags & SRB_TAPE) == 0) {
 		/* If target suspended put incoming I/O in retry_q. */
 		qla2x00_extend_timeout(sp->cmd, 10);
 		add_to_scsi_retry_queue(ha, sp);
@@ -834,7 +837,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
 		device_reg_t *reg;
 		reg = ha->iobase;
 		
-		if (RD_REG_WORD(ISP_RSP_Q_IN(ha, reg)) != ha->rsp_ring_index) {
+		if (ha->response_ring_ptr->signature != RESPONSE_PROCESSED) {
 			spin_lock_irqsave(&ha->hardware_lock, flags);	
 			qla2x00_process_response_queue(ha);
 			spin_unlock_irqrestore(&ha->hardware_lock, flags);
@@ -914,7 +917,7 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
 
 		spin_unlock_irq(ha->host->host_lock);
 
-		set_current_state(TASK_INTERRUPTIBLE);
+		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(2*HZ);
 
 		spin_lock_irq(ha->host->host_lock);
@@ -962,7 +965,7 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
 	    test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) &&
 		time_before(jiffies, wait_online)) {
 
-		set_current_state(TASK_INTERRUPTIBLE);
+		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(HZ);
 	}
 	if (ha->flags.online == TRUE) 
@@ -1005,7 +1008,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
 	    atomic_read(&ha->loop_state) == LOOP_DOWN) ||
 	    test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
 	    atomic_read(&ha->loop_state) != LOOP_READY) {
-		set_current_state(TASK_INTERRUPTIBLE);
+		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(HZ);
 		if (time_after_eq(jiffies, loop_timeout)) {
 			return_status = QLA_FUNCTION_FAILED;
@@ -1783,10 +1786,9 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
 		queue_depth = 32;
 
 	if (sdev->tagged_supported) {
-#if defined(MODULE)
-		if (!(ql2xmaxqdepth == 0 || ql2xmaxqdepth > 256))
+		if (ql2xmaxqdepth != 0 && ql2xmaxqdepth <= 0xffffU)
 			queue_depth = ql2xmaxqdepth;
-#endif 
+
 		ql2xmaxqdepth = queue_depth;
 
 		scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth);
@@ -1983,19 +1985,24 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
 	if (IS_QLA2100(ha)) {
 		ha->max_targets = MAX_TARGETS_2100;
 		ha->mbx_count = MAILBOX_REGISTER_COUNT_2100;
+		ha->request_q_length = REQUEST_ENTRY_CNT_2100;
 		ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
 		ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
+		host->sg_tablesize = 32;
 	} else if (IS_QLA2200(ha)) {
 		ha->max_targets = MAX_TARGETS_2200;
 		ha->mbx_count = MAILBOX_REGISTER_COUNT;
+		ha->request_q_length = REQUEST_ENTRY_CNT_2200;
 		ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
 		ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
 	} else /*if (IS_QLA2300(ha))*/ {
 		ha->max_targets = MAX_TARGETS_2200;
 		ha->mbx_count = MAILBOX_REGISTER_COUNT;
+		ha->request_q_length = REQUEST_ENTRY_CNT_2200;
 		ha->response_q_length = RESPONSE_ENTRY_CNT_2300;
 		ha->last_loop_id = SNS_LAST_LOOP_ID_2300;
 	}
+	host->can_queue = ha->request_q_length + 128;
 
 	/* load the F/W, read paramaters, and init the H/W */
 	ha->instance = num_hosts;
@@ -2020,6 +2027,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
 	spin_lock_init(&ha->mbx_reg_lock);
 	spin_lock_init(&ha->list_lock);
 
+	ha->dpc_pid = -1;
 	init_completion(&ha->dpc_inited);
 	init_completion(&ha->dpc_exited);
 
@@ -2125,8 +2133,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
 
 		qla2x00_check_fabric_devices(ha);
 
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(5);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/100);
 	}
 
 	pci_set_drvdata(pdev, ha);
@@ -2313,18 +2321,17 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
     char **start, off_t offset, int length, int inout)
 {
 	struct info_str	info;
-	int		i;
 	int             retval = -EINVAL;
 	os_lun_t	*up;
-	fc_port_t	*fcport;
+	os_tgt_t	*tq;
 	unsigned int	t, l;
 	uint32_t        tmp_sn;
-	unsigned long   *flags;
+	uint32_t	*flags;
 	uint8_t		*loop_state;
 	int	found;
 	scsi_qla_host_t *ha;
 	char fw_info[30];
-
+ 
 	DEBUG3(printk(KERN_INFO
 	    "Entering proc_info buff_in=%p, offset=0x%lx, length=0x%x\n",
 	    buffer, offset, length);)
@@ -2390,8 +2397,8 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
 		(unsigned long long)ha->response_dma);
 
 	copy_info(&info,
-	    "Request Queue count = %ld, Response Queue count = %ld\n",
-	    (long)REQUEST_ENTRY_CNT, (long)ha->response_q_length);
+	    "Request Queue count = %d, Response Queue count = %d\n",
+	    ha->request_q_length, ha->response_q_length);
 
 	copy_info(&info,
 	    "Total number of active commands = %ld\n",
@@ -2428,7 +2435,7 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
 	    ha->done_q_cnt, ha->scsi_retry_q_cnt);
 
 
-	flags = (unsigned long *) &ha->flags;
+	flags = (uint32_t *) &ha->flags;
 
 	if (atomic_read(&ha->loop_state) == LOOP_DOWN) {
 		loop_state = "DOWN";
@@ -2502,24 +2509,19 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
 	    ha->init_cb->port_name[7]);
 
 	/* Print out device port names */
-	i = 0;
- 	list_for_each_entry(fcport, &ha->fcports, list) {
-		if (fcport->port_type != FCT_TARGET)
+	for (t = 0; t < MAX_FIBRE_DEVICES; t++) {
+		if ((tq = TGT_Q(ha, t)) == NULL)
 			continue;
 
 		copy_info(&info,
 		    "scsi-qla%d-target-%d="
-		    "%02x%02x%02x%02x%02x%02x%02x%02x:%02x%02x%02x;\n",
-		    (int)ha->instance, i,
-		    fcport->port_name[0], fcport->port_name[1],
-		    fcport->port_name[2], fcport->port_name[3],
-		    fcport->port_name[4], fcport->port_name[5],
-		    fcport->port_name[6], fcport->port_name[7],
-		    fcport->d_id.b.domain, fcport->d_id.b.area,
-		    fcport->d_id.b.al_pa);
-		i++;
+		    "%02x%02x%02x%02x%02x%02x%02x%02x;\n",
+		    (int)ha->instance, t,
+		    tq->port_name[0], tq->port_name[1],
+		    tq->port_name[2], tq->port_name[3],
+		    tq->port_name[4], tq->port_name[5],
+		    tq->port_name[6], tq->port_name[7]);
 	}
-
 	copy_info(&info, "\nSCSI LUN Information:\n");
 	copy_info(&info,
 	    "(Id:Lun)  * - indicates lun is not registered with the OS.\n");
@@ -2861,14 +2863,14 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 		 * little delay and a retry.
 		 */
 		ha->request_ring = pci_alloc_consistent(ha->pdev,
-		    ((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+		    ((ha->request_q_length + 1) * (sizeof(request_t))),
 		    &ha->request_dma);
 		if (ha->request_ring == NULL) {
 			qla_printk(KERN_WARNING, ha,
 			    "Memory Allocation failed - request_ring\n");
 
 			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
+			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 
 			continue;
@@ -2882,7 +2884,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 			    "Memory Allocation failed - response_ring\n");
 
 			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
+			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 
 			continue;
@@ -2896,7 +2898,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 			    "Memory Allocation failed - init_cb\n");
 
 			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
+			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 
 			continue;
@@ -2909,7 +2911,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 			    "Memory Allocation failed - ioctl_mem\n");
 
 			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
+			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 
 			continue;
@@ -2921,14 +2923,14 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 			    "qla2x00_allocate_sp_pool()\n");
 
 			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
+			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 
 			continue;
 		}
 
 		/* Allocate memory for SNS commands */
-		if (IS_QLA2200(ha)) {
+		if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 			/* Get consistent memory allocated for SNS commands */
 			ha->sns_cmd = pci_alloc_consistent(ha->pdev,
 			    sizeof(struct sns_cmd_pkt), &ha->sns_cmd_dma);
@@ -2938,13 +2940,13 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 				    "Memory Allocation failed - sns_cmd\n");
 
 				qla2x00_mem_free(ha);
-				set_current_state(TASK_INTERRUPTIBLE);
+				set_current_state(TASK_UNINTERRUPTIBLE);
 				schedule_timeout(HZ/10);
 
 				continue;
 			}
 			memset(ha->sns_cmd, 0, sizeof(struct sns_cmd_pkt));
-		} else if (!IS_QLA2100(ha)) {
+		} else {
 			/* Get consistent memory allocated for MS IOCB */
 			ha->ms_iocb = pci_alloc_consistent(ha->pdev,
 			    sizeof(ms_iocb_entry_t), &ha->ms_iocb_dma);
@@ -2954,7 +2956,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 				    "Memory Allocation failed - ms_iocb\n");
 
 				qla2x00_mem_free(ha);
-				set_current_state(TASK_INTERRUPTIBLE);
+				set_current_state(TASK_UNINTERRUPTIBLE);
 				schedule_timeout(HZ/10);
 
 				continue;
@@ -2973,7 +2975,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 				    "Memory Allocation failed - ct_sns\n");
 
 				qla2x00_mem_free(ha);
-				set_current_state(TASK_INTERRUPTIBLE);
+				set_current_state(TASK_UNINTERRUPTIBLE);
 				schedule_timeout(HZ/10);
 
 				continue;
@@ -2990,7 +2992,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
 			    "Memory Allocation failed - iodesc_pd\n");
 
 			qla2x00_mem_free(ha);
-			set_current_state(TASK_INTERRUPTIBLE);
+			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(HZ/10);
 
 			continue;
@@ -3077,7 +3079,7 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
 
 	if (ha->request_ring) {
 		pci_free_consistent(ha->pdev,
-		    ((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))),
+		    ((ha->request_q_length + 1) * (sizeof(request_t))),
 		    ha->request_ring, ha->request_dma);
 	}
 
@@ -3852,6 +3854,8 @@ qla2x00_timer(scsi_qla_host_t *ha)
 				DEBUG(printk("scsi(%ld): Loop down - "
 				    "aborting ISP.\n",
 				    ha->host_no));
+				qla_printk(KERN_WARNING, ha,
+				    "Loop down - aborting ISP.\n");
 
 				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 			}
@@ -3936,8 +3940,8 @@ qla2x00_cmd_timeout(srb_t *sp)
 	int processed;
 	scsi_qla_host_t *vis_ha, *dest_ha;
 	struct scsi_cmnd *cmd;
-	ulong      flags;
-	fc_port_t	*fcport;
+	unsigned long flags, cpu_flags;
+	fc_port_t *fcport;
 
 	cmd = sp->cmd;
 	vis_ha = (scsi_qla_host_t *)cmd->device->host->hostdata;
@@ -4032,6 +4036,64 @@ qla2x00_cmd_timeout(srb_t *sp)
 		 return;
 	}
 
+	spin_lock_irqsave(&dest_ha->list_lock, cpu_flags);
+	if (sp->state == SRB_DONE_STATE) {
+		/* IO in done_q  -- leave it */
+		DEBUG(printk("scsi(%ld): Found in Done queue pid %ld sp=%p.\n",
+		    dest_ha->host_no, cmd->serial_number, sp));
+	} else if (sp->state == SRB_SUSPENDED_STATE) {
+		DEBUG(printk("scsi(%ld): Found SP %p in suspended state  "
+		    "- pid %ld:\n",
+		    dest_ha->host_no, sp, cmd->serial_number));
+		DEBUG(qla2x00_dump_buffer((uint8_t *)sp, sizeof(srb_t));)
+	} else if (sp->state == SRB_ACTIVE_STATE) {
+		/*
+		 * IO is with ISP find the command in our active list.
+		 */
+		spin_unlock_irqrestore(&dest_ha->list_lock, cpu_flags);
+		spin_lock_irqsave(&dest_ha->hardware_lock, flags);
+		if (sp == dest_ha->outstanding_cmds[
+		    (unsigned long)sp->cmd->host_scribble]) {
+
+			DEBUG(printk("cmd_timeout: Found in ISP \n"));
+
+			if (sp->flags & SRB_TAPE) {
+				/*
+				 * We cannot allow the midlayer error handler
+				 * to wakeup and begin the abort process.
+				 * Extend the timer so that the firmware can
+				 * properly return the IOCB.
+				 */
+				DEBUG(printk("cmd_timeout: Extending timeout "
+				    "of FCP2 tape command!\n"));
+				qla2x00_extend_timeout(sp->cmd,
+				    EXTEND_CMD_TIMEOUT);
+			}
+			sp->state = SRB_ACTIVE_TIMEOUT_STATE;
+			spin_unlock_irqrestore(&dest_ha->hardware_lock, flags);
+		} else {
+			spin_unlock_irqrestore(&dest_ha->hardware_lock, flags);
+			printk(KERN_INFO 
+				"qla_cmd_timeout: State indicates it is with "
+				"ISP, But not in active array\n");
+		}
+		spin_lock_irqsave(&dest_ha->list_lock, cpu_flags);
+	} else if (sp->state == SRB_ACTIVE_TIMEOUT_STATE) {
+		DEBUG(printk("qla2100%ld: Found in Active timeout state"
+				"pid %ld, State = %x., \n",
+				dest_ha->host_no,
+				sp->cmd->serial_number, sp->state);)
+	} else {
+		/* EMPTY */
+		DEBUG2(printk("cmd_timeout%ld: LOST command state = "
+				"0x%x, sp=%p\n",
+				vis_ha->host_no, sp->state,sp);)
+
+		qla_printk(KERN_INFO, vis_ha,
+			"cmd_timeout: LOST command state = 0x%x\n", sp->state);
+	}
+	spin_unlock_irqrestore(&dest_ha->list_lock, cpu_flags);
+
 	DEBUG3(printk("cmd_timeout: Leaving\n");)
 }
 
@@ -4180,9 +4242,6 @@ qla2x00_process_response_queue_in_zio_mode(scsi_qla_host_t *ha)
 	spin_lock_irqsave(&ha->hardware_lock,flags);
 	qla2x00_process_response_queue(ha);
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
-
-	if (!list_empty(&ha->done_queue))
-		qla2x00_done(ha);
 }
 
 /*
@@ -4261,7 +4320,7 @@ qla2x00_next(scsi_qla_host_t *vis_ha)
 		 * continues until the LOOP DOWN time expires or the condition
 		 * goes away.
 		 */
-	 	if (!(sp->flags & SRB_IOCTL) &&
+		if (!(sp->flags & (SRB_IOCTL | SRB_TAPE)) &&
 		    (atomic_read(&fcport->state) != FCS_ONLINE ||
 			test_bit(ABORT_ISP_ACTIVE, &dest_ha->dpc_flags) ||
 			atomic_read(&dest_ha->loop_state) != LOOP_READY)) {
@@ -4286,7 +4345,7 @@ qla2x00_next(scsi_qla_host_t *vis_ha)
 		 * If this request's lun is suspended then put the request on
 		 * the  scsi_retry queue. 
 		 */
-	 	if (!(sp->flags & SRB_IOCTL) &&
+	 	if (!(sp->flags & (SRB_IOCTL | SRB_TAPE)) &&
 		    sp->lun_queue->q_state == LUN_STATE_WAIT) {
 			DEBUG3(printk("scsi(%ld): lun wait state - pid=%ld, "
 			    "opcode=%d, allowed=%d, retries=%d\n",
diff --git a/drivers/scsi/qla2xxx/qla_rscn.c b/drivers/scsi/qla2xxx/qla_rscn.c
index 4f37f62bf..c522d03c1 100644
--- a/drivers/scsi/qla2xxx/qla_rscn.c
+++ b/drivers/scsi/qla2xxx/qla_rscn.c
@@ -283,6 +283,8 @@ qla2x00_iodesc_timeout(unsigned long data)
 
 	qla2x00_free_iodesc(iodesc);
 
+	qla_printk(KERN_WARNING, iodesc->ha,
+	    "IO descriptor timeout. Scheduling ISP abort.\n");
 	set_bit(ISP_ABORT_NEEDED, &iodesc->ha->dpc_flags);
 }
 
@@ -385,7 +387,7 @@ qla2x00_get_mbx_iocb_entry(scsi_qla_host_t *ha, uint32_t handle)
 		if  (ha->req_ring_index < cnt)
 			ha->req_q_cnt = cnt - ha->req_ring_index;
 		else
-			ha->req_q_cnt = REQUEST_ENTRY_CNT -
+			ha->req_q_cnt = ha->request_q_length -
 			    (ha->req_ring_index - cnt);
 	}
 	if (ha->req_q_cnt >= 3) {
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index b1ccdee8d..c6b027c93 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -24,20 +24,6 @@ static uint16_t qla2x00_nvram_request(scsi_qla_host_t *, uint32_t);
 static void qla2x00_nv_deselect(scsi_qla_host_t *);
 static void qla2x00_nv_write(scsi_qla_host_t *, uint16_t);
 
-uint8_t qla2x00_read_flash_byte(scsi_qla_host_t *, uint32_t);
-static void qla2x00_write_flash_byte(scsi_qla_host_t *, uint32_t, uint8_t);
-static uint8_t qla2x00_poll_flash(scsi_qla_host_t *ha,
-		uint32_t addr, uint8_t poll_data, uint8_t mid);
-static uint8_t qla2x00_program_flash_address(scsi_qla_host_t *ha,
-		uint32_t addr, uint8_t data, uint8_t mid);
-static uint8_t qla2x00_erase_flash_sector(scsi_qla_host_t *ha,
-		uint32_t addr, uint32_t sec_mask, uint8_t mid);
-
-uint8_t qla2x00_get_flash_manufacturer(scsi_qla_host_t *ha);
-uint16_t qla2x00_get_flash_version(scsi_qla_host_t *);
-uint16_t qla2x00_get_flash_image(scsi_qla_host_t *ha, uint8_t *image);
-uint16_t qla2x00_set_flash_image(scsi_qla_host_t *ha, uint8_t *image);
-
 
 /*
  * NVRAM support routines
@@ -279,435 +265,3 @@ qla2x00_nv_write(scsi_qla_host_t *ha, uint16_t data)
 	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
 }
 
-/*
- * Flash support routines
- */
-
-/**
- * qla2x00_flash_enable() - Setup flash for reading and writing.
- * @ha: HA context
- */
-void
-qla2x00_flash_enable(scsi_qla_host_t *ha)
-{
-	uint16_t	data;
-	device_reg_t	*reg = ha->iobase;
-
-	data = RD_REG_WORD(&reg->ctrl_status);
-	data |= CSR_FLASH_ENABLE;
-	WRT_REG_WORD(&reg->ctrl_status, data);
-	RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
-}
-
-/**
- * qla2x00_flash_disable() - Disable flash and allow RISC to run.
- * @ha: HA context
- */
-void
-qla2x00_flash_disable(scsi_qla_host_t *ha)
-{
-	uint16_t	data;
-	device_reg_t	*reg = ha->iobase;
-
-	data = RD_REG_WORD(&reg->ctrl_status);
-	data &= ~(CSR_FLASH_ENABLE);
-	WRT_REG_WORD(&reg->ctrl_status, data);
-	RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
-}
-
-/**
- * qla2x00_read_flash_byte() - Reads a byte from flash
- * @ha: HA context
- * @addr: Address in flash to read
- *
- * A word is read from the chip, but, only the lower byte is valid.
- *
- * Returns the byte read from flash @addr.
- */
-uint8_t
-qla2x00_read_flash_byte(scsi_qla_host_t *ha, uint32_t addr)
-{
-	uint16_t	data;
-	uint16_t	bank_select;
-	device_reg_t	*reg = ha->iobase;
-
-	/* Setup bit 16 of flash address. */
-	bank_select = RD_REG_WORD(&reg->ctrl_status);
-	if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) {
-		bank_select |= CSR_FLASH_64K_BANK;
-		WRT_REG_WORD(&reg->ctrl_status, bank_select);
-		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
-	} else if (((addr & BIT_16) == 0) &&
-	    (bank_select & CSR_FLASH_64K_BANK)) {
-		bank_select &= ~(CSR_FLASH_64K_BANK);
-		WRT_REG_WORD(&reg->ctrl_status, bank_select);
-		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
-	}
-
-	/* The ISP2312 v2 chip cannot access the FLASH registers via MMIO. */
-	if (IS_QLA2312(ha) && ha->product_id[3] == 0x2 && ha->pio_address) {
-		uint16_t data2;
-
-		reg = (device_reg_t *)ha->pio_address;
-		outw((uint16_t)addr, (unsigned long)(&reg->flash_address));
-		do {
-			data = inw((unsigned long)(&reg->flash_data));
-			barrier();
-			cpu_relax();
-			data2 = inw((unsigned long)(&reg->flash_data));
-		} while (data != data2);
-	} else {
-		WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
-		data = qla2x00_debounce_register(&reg->flash_data);
-	}
-
-	return ((uint8_t)data);
-}
-
-/**
- * qla2x00_write_flash_byte() - Write a byte to flash
- * @ha: HA context
- * @addr: Address in flash to write
- * @data: Data to write
- */
-static void
-qla2x00_write_flash_byte(scsi_qla_host_t *ha, uint32_t addr, uint8_t data)
-{
-	uint16_t	bank_select;
-	device_reg_t	*reg = ha->iobase;
-
-	/* Setup bit 16 of flash address. */
-	bank_select = RD_REG_WORD(&reg->ctrl_status);
-	if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) {
-		bank_select |= CSR_FLASH_64K_BANK;
-		WRT_REG_WORD(&reg->ctrl_status, bank_select);
-		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
-	} else if (((addr & BIT_16) == 0) &&
-	    (bank_select & CSR_FLASH_64K_BANK)) {
-		bank_select &= ~(CSR_FLASH_64K_BANK);
-		WRT_REG_WORD(&reg->ctrl_status, bank_select);
-		RD_REG_WORD(&reg->ctrl_status);	/* PCI Posting. */
-	}
-
-	/* The ISP2312 v2 chip cannot access the FLASH registers via MMIO. */
-	if (IS_QLA2312(ha) && ha->product_id[3] == 0x2 && ha->pio_address) {
-		reg = (device_reg_t *)ha->pio_address;
-		outw((uint16_t)addr, (unsigned long)(&reg->flash_address));
-		outw((uint16_t)data, (unsigned long)(&reg->flash_data));
-	} else {
-		WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
-		RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
-		WRT_REG_WORD(&reg->flash_data, (uint16_t)data);
-		RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
-	}
-}
-
-/**
- * qla2x00_poll_flash() - Polls flash for completion.
- * @ha: HA context
- * @addr: Address in flash to poll
- * @poll_data: Data to be polled
- * @mid: Flash manufacturer ID
- *
- * This function polls the device until bit 7 of what is read matches data
- * bit 7 or until data bit 5 becomes a 1.  If that hapens, the flash ROM timed
- * out (a fatal error).  The flash book recommeds reading bit 7 again after
- * reading bit 5 as a 1.
- *
- * Returns 0 on success, else non-zero.
- */
-static uint8_t
-qla2x00_poll_flash(scsi_qla_host_t *ha,
-    uint32_t addr, uint8_t poll_data, uint8_t mid)
-{
-	uint8_t		status;
-	uint8_t		flash_data;
-	uint32_t	cnt;
-	int		failed_pass;
-
-	status = 1;
-	failed_pass = 1;
-
-	/* Wait for 30 seconds for command to finish. */
-	poll_data &= BIT_7;
-	for (cnt = 3000000; cnt; cnt--) {
-		flash_data = qla2x00_read_flash_byte(ha, addr);
-		if ((flash_data & BIT_7) == poll_data) {
-			status = 0;
-			break;
-		}
-
-		if (mid != 0x40 && mid != 0xda) {
-			if (flash_data & BIT_5)
-				failed_pass--;
-			if (failed_pass < 0)
-				break;
-		}
-		udelay(10);
-		barrier();
-	}
-	return (status);
-}
-
-/**
- * qla2x00_program_flash_address() - Programs a flash address
- * @ha: HA context
- * @addr: Address in flash to program
- * @data: Data to be written in flash
- * @mid: Flash manufacturer ID
- *
- * Returns 0 on success, else non-zero.
- */
-static uint8_t
-qla2x00_program_flash_address(scsi_qla_host_t *ha,
-    uint32_t addr, uint8_t data, uint8_t mid)
-{
-	/* Write Program Command Sequence */
-	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
-	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
-	qla2x00_write_flash_byte(ha, 0x5555, 0xa0);
-	qla2x00_write_flash_byte(ha, addr, data);
-
-	/* Wait for write to complete. */
-	return (qla2x00_poll_flash(ha, addr, data, mid));
-}
-
-/**
- * qla2x00_erase_flash_sector() - Erase a flash sector.
- * @ha: HA context
- * @addr: Flash sector to erase
- * @sec_mask: Sector address mask
- * @mid: Flash manufacturer ID
- *
- * Returns 0 on success, else non-zero.
- */
-static uint8_t
-qla2x00_erase_flash_sector(scsi_qla_host_t *ha,
-    uint32_t addr, uint32_t sec_mask, uint8_t mid)
-{
-	/* Individual Sector Erase Command Sequence */
-	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
-	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
-	qla2x00_write_flash_byte(ha, 0x5555, 0x80);
-	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
-	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
-
-	if (mid == 0xda)
-		qla2x00_write_flash_byte(ha, addr & sec_mask, 0x10);
-	else
-		qla2x00_write_flash_byte(ha, addr & sec_mask, 0x30);
-
-	udelay(150);
-
-	/* Wait for erase to complete. */
-	return (qla2x00_poll_flash(ha, addr, 0x80, mid));
-}
-
-/**
- * qla2x00_get_flash_manufacturer() - Read manufacturer ID from flash chip.
- * @ha: HA context
- *
- * Returns the manufacturer's ID read from the flash chip.
- */
-uint8_t
-qla2x00_get_flash_manufacturer(scsi_qla_host_t *ha)
-{
-	uint8_t	manuf_id;
-
-	qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
-	qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
-	qla2x00_write_flash_byte(ha, 0x5555, 0x90);
-	manuf_id = qla2x00_read_flash_byte(ha, 0x0001);
-
-	return (manuf_id);
-}
-
-/**
- * qla2x00_get_flash_version() - Read version information from flash.
- * @ha: HA context
- *
- * Returns QLA_SUCCESS on successful retrieval of flash version.
- */
-uint16_t
-qla2x00_get_flash_version(scsi_qla_host_t *ha)
-{
-	uint16_t	ret = QLA_SUCCESS;
-	uint32_t	loop_cnt = 1;  /* this is for error exit only */
-	uint32_t	pcir_adr;
-
-	/* The ISP2312 v2 chip cannot access the FLASH registers via MMIO. */
-	if (IS_QLA2312(ha) && ha->product_id[3] == 0x2 && !ha->pio_address)
-		ret = QLA_FUNCTION_FAILED;
-
-	qla2x00_flash_enable(ha);
-	do {	/* Loop once to provide quick error exit */
-		/* Match signature */
-		if (!(qla2x00_read_flash_byte(ha, 0) == 0x55 &&
-		    qla2x00_read_flash_byte(ha, 1) == 0xaa)) {
-			/* No signature */
-			DEBUG2(printk("scsi(%ld): No matching FLASH "
-			    "signature.\n", ha->host_no));
-			ret = QLA_FUNCTION_FAILED;
-			break;
-		}
-
-		pcir_adr = qla2x00_read_flash_byte(ha, 0x18) & 0xff;
-
-		/* validate signature of PCI data structure */
-		if ((qla2x00_read_flash_byte(ha, pcir_adr)) == 'P' &&
-		    (qla2x00_read_flash_byte(ha, pcir_adr + 1)) == 'C' &&
-		    (qla2x00_read_flash_byte(ha, pcir_adr + 2)) == 'I' &&
-		    (qla2x00_read_flash_byte(ha, pcir_adr + 3)) == 'R') {
-
-			/* Read version */
-			ha->optrom_minor =
-			    qla2x00_read_flash_byte(ha, pcir_adr + 0x12);
-			ha->optrom_major =
-			    qla2x00_read_flash_byte(ha, pcir_adr + 0x13);
-			DEBUG3(printk("%s(): got %d.%d.\n",
-			    __func__, ha->optrom_major, ha->optrom_minor));
-		} else {
-			/* error */
-			DEBUG2(printk("%s(): PCI data struct not found. "
-			    "pcir_adr=%x.\n",
-			    __func__, pcir_adr));
-			ret = QLA_FUNCTION_FAILED;
-			break;
-		}
-
-	} while (--loop_cnt);
-	qla2x00_flash_disable(ha);
-
-	return (ret);
-}
-
-/**
- * qla2x00_get_flash_image() - Read image from flash chip.
- * @ha: HA context
- * @image: Buffer to receive flash image
- *
- * Returns 0 on success, else non-zero.
- */
-uint16_t
-qla2x00_get_flash_image(scsi_qla_host_t *ha, uint8_t *image)
-{
-	uint32_t	addr;
-	uint32_t	midpoint;
-	uint8_t		*data;
-	device_reg_t	*reg = ha->iobase;
-
-	midpoint = FLASH_IMAGE_SIZE / 2;
-
-	qla2x00_flash_enable(ha);
-	WRT_REG_WORD(&reg->nvram, 0);
-	RD_REG_WORD(&reg->nvram);		/* PCI Posting. */
-	for (addr = 0, data = image; addr < FLASH_IMAGE_SIZE; addr++, data++) {
-		if (addr == midpoint)
-			WRT_REG_WORD(&reg->nvram, NVR_SELECT);
-
-		*data = qla2x00_read_flash_byte(ha, addr);
-	}
-	qla2x00_flash_disable(ha);
-
-	return (0);
-}
-
-/**
- * qla2x00_set_flash_image() - Write image to flash chip.
- * @ha: HA context
- * @image: Source image to write to flash
- *
- * Returns 0 on success, else non-zero.
- */
-uint16_t
-qla2x00_set_flash_image(scsi_qla_host_t *ha, uint8_t *image)
-{
-	uint16_t	status;
-	uint32_t	addr;
-	uint32_t	midpoint;
-	uint32_t	sec_mask;
-	uint32_t	rest_addr;
-	uint8_t		mid;
-	uint8_t		sec_number;
-	uint8_t		data;
-	device_reg_t	*reg = ha->iobase;
-
-	status = 0;
-	sec_number = 0;
-
-	/* Reset ISP chip. */
-	WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
-	RD_REG_WORD(&reg->ctrl_status);		/* PCI Posting. */
-
-	qla2x00_flash_enable(ha);
-	do {	/* Loop once to provide quick error exit */
-		/* Structure of flash memory based on manufacturer */
-		mid = qla2x00_get_flash_manufacturer(ha);
-		if (mid == 0x6d) {
-			// Am29LV001 part
-			rest_addr = 0x1fff;
-			sec_mask = 0x1e000;
-		} else if (mid == 0x40) {
-			// Mostel v29c51001 part
-			rest_addr = 0x1ff;
-			sec_mask = 0x1fe00;
-		} else if (mid == 0xbf) {
-			// SST39sf10 part
-			rest_addr = 0xfff;
-			sec_mask = 0x1f000;
-		} else if (mid == 0xda) {
-			// Winbond W29EE011 part
-			rest_addr = 0x7f;
-			sec_mask = 0x1ff80;
-			addr = 0;
-			if (qla2x00_erase_flash_sector(ha, addr, sec_mask,
-			    mid)) {
-				status = 1;
-				break;
-			}
-		} else {
-			// Am29F010 part
-			rest_addr = 0x3fff;
-			sec_mask = 0x1c000;
-		}
-
-		midpoint = FLASH_IMAGE_SIZE / 2;
-		for (addr = 0; addr < FLASH_IMAGE_SIZE; addr++) {
-			data = *image++;
-			/* Are we at the beginning of a sector? */
-			if (!(addr & rest_addr)) {
-				if (addr == midpoint)
-					WRT_REG_WORD(&reg->nvram, NVR_SELECT);
-
-				/* Then erase it */
-				if (qla2x00_erase_flash_sector(ha, addr,
-				    sec_mask, mid)) {
-					status = 1;
-					break;
-				}
-
-				sec_number++;
-			}
-			if (mid == 0x6d) {
-				if (sec_number == 1 &&
-				    (addr == (rest_addr - 1))) {
-					rest_addr = 0x0fff;
-					sec_mask   = 0x1f000;
-				} else if (sec_number == 3 && (addr & 0x7ffe)) {
-					rest_addr = 0x3fff;
-					sec_mask   = 0x1c000;
-				}
-			}
-
-			if (qla2x00_program_flash_address(ha, addr, data,
-			    mid)) {
-				status = 1;
-				break;
-			}
-		}
-	} while (0);
-
-	qla2x00_flash_disable(ha);
-
-	return (status);
-}
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index 2fcc81e58..a2cccee20 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -19,9 +19,9 @@
 /*
  * Driver version 
  */
-#define QLA2XXX_VERSION      "8.00.00b11-k"
+#define QLA2XXX_VERSION      "8.00.00b12-k"
 
 #define QLA_DRIVER_MAJOR_VER	8
 #define QLA_DRIVER_MINOR_VER	0
 #define QLA_DRIVER_PATCH_VER	0
-#define QLA_DRIVER_BETA_VER	11
+#define QLA_DRIVER_BETA_VER	12
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index ac97103b9..1641932a7 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -1,43 +1,19 @@
-/*----------------------------------------------------------------*/
 /*
-   Qlogic linux driver - work in progress. No Warranty express or implied.
-   Use at your own risk.  Support Tort Reform so you won't have to read all
-   these silly disclaimers.
-
-   Copyright 1994, Tom Zerucha.   
-   tz@execpc.com
-   
-   Additional Code, and much appreciated help by
-   Michael A. Griffith
-   grif@cs.ucr.edu
-
-   Thanks to Eric Youngdale and Dave Hinds for loadable module and PCMCIA
-   help respectively, and for suffering through my foolishness during the
-   debugging process.
-
-   Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
-   (you can reference it, but it is incomplete and inaccurate in places)
-
-   Version 0.46 1/30/97 - kernel 1.2.0+
-
-   Functions as standalone, loadable, and PCMCIA driver, the latter from
-   Dave Hinds' PCMCIA package.
-   
-   Cleaned up 26/10/2002 by Alan Cox <alan@redhat.com> as part of the 2.5
-   SCSI driver cleanup and audit. This driver still needs work on the
-   following
-   	-	Non terminating hardware waits
-   	-	Some layering violations with its pcmcia stub
-
-   Redistributable under terms of the GNU General Public License
-
-   For the avoidance of doubt the "preferred form" of this code is one which
-   is in an open non patent encumbered format. Where cryptographic key signing
-   forms part of the process of creating an executable the information
-   including keys needed to generate an equivalently functional executable
-   are deemed to be part of the source code.
-
-*/
+ * Qlogic FAS408 ISA card driver
+ *
+ * Copyright 1994, Tom Zerucha.   
+ * tz@execpc.com
+ * 
+ * Redistributable under terms of the GNU General Public License
+ *
+ * For the avoidance of doubt the "preferred form" of this code is one which
+ * is in an open non patent encumbered format. Where cryptographic key signing
+ * forms part of the process of creating an executable the information
+ * including keys needed to generate an equivalently functional executable
+ * are deemed to be part of the source code.
+ *
+ * Check qlogicfas408.c for more credits and info.
+ */
 
 #include <linux/module.h>
 #include <linux/blkdev.h>		/* to get disk capacity */
@@ -57,429 +33,28 @@
 
 #include "scsi.h"
 #include "hosts.h"
-#include "qlogicfas.h"
+#include "qlogicfas408.h"
 
-/*----------------------------------------------------------------*/
-int qlcfg5 = (XTALFREQ << 5);	/* 15625/512 */
-int qlcfg6 = SYNCXFRPD;
-int qlcfg7 = SYNCOFFST;
-int qlcfg8 = (SLOWCABLE << 7) | (QL_ENABLE_PARITY << 4);
-int qlcfg9 = ((XTALFREQ + 4) / 5);
-int qlcfgc = (FASTCLK << 3) | (FASTSCSI << 4);
-
-static char qlogicfas_name[] = "qlogicfas";
-
-int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
-
-/*----------------------------------------------------------------*/
-
-/*----------------------------------------------------------------*/
-/* local functions */
-/*----------------------------------------------------------------*/
-
-/* error recovery - reset everything */
-
-static void ql_zap(qlogicfas_priv_t priv)
-{
-	int x;
-	int qbase = priv->qbase;
-
-	x = inb(qbase + 0xd);
-	REG0;
-	outb(3, qbase + 3);	/* reset SCSI */
-	outb(2, qbase + 3);	/* reset chip */
-	if (x & 0x80)
-		REG1;
-}
-
-/*
- *	Do a pseudo-dma tranfer
+/* Set the following to 2 to use normal interrupt (active high/totempole-
+ * tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
+ * drain
  */
- 
-static int ql_pdma(qlogicfas_priv_t priv, int phase, char *request, int reqlen)
-{
-	int j;
-	int qbase = priv->qbase;
-	j = 0;
-	if (phase & 1) {	/* in */
-#if QL_TURBO_PDMA
-		rtrc(4)
-		/* empty fifo in large chunks */
-		if (reqlen >= 128 && (inb(qbase + 8) & 2)) {	/* full */
-			insl(qbase + 4, request, 32);
-			reqlen -= 128;
-			request += 128;
-		}
-		while (reqlen >= 84 && !(j & 0xc0))	/* 2/3 */
-			if ((j = inb(qbase + 8)) & 4) 
-			{
-				insl(qbase + 4, request, 21);
-				reqlen -= 84;
-				request += 84;
-			}
-		if (reqlen >= 44 && (inb(qbase + 8) & 8)) {	/* 1/3 */
-			insl(qbase + 4, request, 11);
-			reqlen -= 44;
-			request += 44;
-		}
-#endif
-		/* until both empty and int (or until reclen is 0) */
-		rtrc(7)
-		j = 0;
-		while (reqlen && !((j & 0x10) && (j & 0xc0))) 
-		{
-			/* while bytes to receive and not empty */
-			j &= 0xc0;
-			while (reqlen && !((j = inb(qbase + 8)) & 0x10)) 
-			{
-				*request++ = inb(qbase + 4);
-				reqlen--;
-			}
-			if (j & 0x10)
-				j = inb(qbase + 8);
-
-		}
-	} else {		/* out */
-#if QL_TURBO_PDMA
-		rtrc(4)
-		    if (reqlen >= 128 && inb(qbase + 8) & 0x10) {	/* empty */
-			outsl(qbase + 4, request, 32);
-			reqlen -= 128;
-			request += 128;
-		}
-		while (reqlen >= 84 && !(j & 0xc0))	/* 1/3 */
-			if (!((j = inb(qbase + 8)) & 8)) {
-				outsl(qbase + 4, request, 21);
-				reqlen -= 84;
-				request += 84;
-			}
-		if (reqlen >= 40 && !(inb(qbase + 8) & 4)) {	/* 2/3 */
-			outsl(qbase + 4, request, 10);
-			reqlen -= 40;
-			request += 40;
-		}
-#endif
-		/* until full and int (or until reclen is 0) */
-		rtrc(7)
-		    j = 0;
-		while (reqlen && !((j & 2) && (j & 0xc0))) {
-			/* while bytes to send and not full */
-			while (reqlen && !((j = inb(qbase + 8)) & 2)) 
-			{
-				outb(*request++, qbase + 4);
-				reqlen--;
-			}
-			if (j & 2)
-				j = inb(qbase + 8);
-		}
-	}
-	/* maybe return reqlen */
-	return inb(qbase + 8) & 0xc0;
-}
-
-/*
- *	Wait for interrupt flag (polled - not real hardware interrupt) 
- */
-
-static int ql_wai(qlogicfas_priv_t priv)
-{
-	int k;
-	int qbase = priv->qbase;
-	unsigned long i;
-
-	k = 0;
-	i = jiffies + WATCHDOG;
-	while (time_before(jiffies, i) && !priv->qabort &&
-					!((k = inb(qbase + 4)) & 0xe0)) {
-		barrier();
-		cpu_relax();
-	}
-	if (time_after_eq(jiffies, i))
-		return (DID_TIME_OUT);
-	if (priv->qabort)
-		return (priv->qabort == 1 ? DID_ABORT : DID_RESET);
-	if (k & 0x60)
-		ql_zap(priv);
-	if (k & 0x20)
-		return (DID_PARITY);
-	if (k & 0x40)
-		return (DID_ERROR);
-	return 0;
-}
-
-/*
- *	Initiate scsi command - queueing handler 
- *	caller must hold host lock
- */
-
-static void ql_icmd(Scsi_Cmnd * cmd)
-{
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(cmd->device->host->hostdata[0]);
-	int 	qbase = priv->qbase;
-	unsigned int i;
-
-	priv->qabort = 0;
-
-	REG0;
-	/* clearing of interrupts and the fifo is needed */
-
-	inb(qbase + 5);		/* clear interrupts */
-	if (inb(qbase + 5))	/* if still interrupting */
-		outb(2, qbase + 3);	/* reset chip */
-	else if (inb(qbase + 7) & 0x1f)
-		outb(1, qbase + 3);	/* clear fifo */
-	while (inb(qbase + 5));	/* clear ints */
-	REG1;
-	outb(1, qbase + 8);	/* set for PIO pseudo DMA */
-	outb(0, qbase + 0xb);	/* disable ints */
-	inb(qbase + 8);		/* clear int bits */
-	REG0;
-	outb(0x40, qbase + 0xb);	/* enable features */
-
-	/* configurables */
-	outb(qlcfgc, qbase + 0xc);
-	/* config: no reset interrupt, (initiator) bus id */
-	outb(0x40 | qlcfg8 | priv->qinitid, qbase + 8);
-	outb(qlcfg7, qbase + 7);
-	outb(qlcfg6, qbase + 6);
-	 /**/ outb(qlcfg5, qbase + 5);	/* select timer */
-	outb(qlcfg9 & 7, qbase + 9);	/* prescaler */
-/*	outb(0x99, qbase + 5);	*/
-	outb(cmd->device->id, qbase + 4);
-
-	for (i = 0; i < cmd->cmd_len; i++)
-		outb(cmd->cmnd[i], qbase + 2);
-
-	priv->qlcmd = cmd;
-	outb(0x41, qbase + 3);	/* select and send command */
-}
-
-/*
- *	Process scsi command - usually after interrupt 
- */
-
-static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
-{
-	unsigned int i, j;
-	unsigned long k;
-	unsigned int result;	/* ultimate return result */
-	unsigned int status;	/* scsi returned status */
-	unsigned int message;	/* scsi returned message */
-	unsigned int phase;	/* recorded scsi phase */
-	unsigned int reqlen;	/* total length of transfer */
-	struct scatterlist *sglist;	/* scatter-gather list pointer */
-	unsigned int sgcount;	/* sg counter */
-	char *buf;
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(cmd->device->host->hostdata[0]);
-	int qbase = priv->qbase;
-
-	rtrc(1)
-	j = inb(qbase + 6);
-	i = inb(qbase + 5);
-	if (i == 0x20) {
-		return (DID_NO_CONNECT << 16);
-	}
-	i |= inb(qbase + 5);	/* the 0x10 bit can be set after the 0x08 */
-	if (i != 0x18) {
-		printk(KERN_ERR "Ql:Bad Interrupt status:%02x\n", i);
-		ql_zap(priv);
-		return (DID_BAD_INTR << 16);
-	}
-	j &= 7;			/* j = inb( qbase + 7 ) >> 5; */
-
-	/* correct status is supposed to be step 4 */
-	/* it sometimes returns step 3 but with 0 bytes left to send */
-	/* We can try stuffing the FIFO with the max each time, but we will get a
-	   sequence of 3 if any bytes are left (but we do flush the FIFO anyway */
-
-	if (j != 3 && j != 4) {
-		printk(KERN_ERR "Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n",
-		     j, i, inb(qbase + 7) & 0x1f);
-		ql_zap(priv);
-		return (DID_ERROR << 16);
-	}
-	result = DID_OK;
-	if (inb(qbase + 7) & 0x1f)	/* if some bytes in fifo */
-		outb(1, qbase + 3);	/* clear fifo */
-	/* note that request_bufflen is the total xfer size when sg is used */
-	reqlen = cmd->request_bufflen;
-	/* note that it won't work if transfers > 16M are requested */
-	if (reqlen && !((phase = inb(qbase + 4)) & 6)) {	/* data phase */
-		rtrc(2)
-		outb(reqlen, qbase);	/* low-mid xfer cnt */
-		outb(reqlen >> 8, qbase + 1);	/* low-mid xfer cnt */
-		outb(reqlen >> 16, qbase + 0xe);	/* high xfer cnt */
-		outb(0x90, qbase + 3);	/* command do xfer */
-		/* PIO pseudo DMA to buffer or sglist */
-		REG1;
-		if (!cmd->use_sg)
-			ql_pdma(priv, phase, cmd->request_buffer,
-				cmd->request_bufflen);
-		else {
-			sgcount = cmd->use_sg;
-			sglist = cmd->request_buffer;
-			while (sgcount--) {
-				if (priv->qabort) {
-					REG0;
-					return ((priv->qabort == 1 ?
-						DID_ABORT : DID_RESET) << 16);
-				}
-				buf = page_address(sglist->page) + sglist->offset;
-				if (ql_pdma(priv, phase, buf, sglist->length))
-					break;
-				sglist++;
-			}
-		}
-		REG0;
-		rtrc(2)
-		/*
-		 *	Wait for irq (split into second state of irq handler
-		 *	if this can take time) 
-		 */
-		if ((k = ql_wai(priv)))
-			return (k << 16);
-		k = inb(qbase + 5);	/* should be 0x10, bus service */
-	}
-
-	/*
-	 *	Enter Status (and Message In) Phase 
-	 */
-	 
-	k = jiffies + WATCHDOG;
-
-	while (time_before(jiffies, k) && !priv->qabort &&
-						!(inb(qbase + 4) & 6))
-		cpu_relax();	/* wait for status phase */
-
-	if (time_after_eq(jiffies, k)) {
-		ql_zap(priv);
-		return (DID_TIME_OUT << 16);
-	}
-
-	/* FIXME: timeout ?? */
-	while (inb(qbase + 5))
-		cpu_relax();	/* clear pending ints */
-
-	if (priv->qabort)
-		return ((priv->qabort == 1 ? DID_ABORT : DID_RESET) << 16);
-
-	outb(0x11, qbase + 3);	/* get status and message */
-	if ((k = ql_wai(priv)))
-		return (k << 16);
-	i = inb(qbase + 5);	/* get chip irq stat */
-	j = inb(qbase + 7) & 0x1f;	/* and bytes rec'd */
-	status = inb(qbase + 2);
-	message = inb(qbase + 2);
-
-	/*
-	 *	Should get function complete int if Status and message, else 
-	 *	bus serv if only status 
-	 */
-	if (!((i == 8 && j == 2) || (i == 0x10 && j == 1))) {
-		printk(KERN_ERR "Ql:Error during status phase, int=%02X, %d bytes recd\n", i, j);
-		result = DID_ERROR;
-	}
-	outb(0x12, qbase + 3);	/* done, disconnect */
-	rtrc(1)
-	if ((k = ql_wai(priv)))
-		return (k << 16);
-
-	/*
-	 *	Should get bus service interrupt and disconnect interrupt 
-	 */
-	 
-	i = inb(qbase + 5);	/* should be bus service */
-	while (!priv->qabort && ((i & 0x20) != 0x20)) {
-		barrier();
-		cpu_relax();
-		i |= inb(qbase + 5);
-	}
-	rtrc(0)
+#define INT_TYPE	2
 
-	if (priv->qabort)
-		return ((priv->qabort == 1 ? DID_ABORT : DID_RESET) << 16);
-		
-	return (result << 16) | (message << 8) | (status & STATUS_MASK);
-}
-
-/*
- *	Interrupt handler 
- */
-
-static void ql_ihandl(int irq, void *dev_id, struct pt_regs *regs)
-{
-	Scsi_Cmnd *icmd;
-	struct Scsi_Host *host = (struct Scsi_Host *)dev_id;
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(host->hostdata[0]);
-	int qbase = priv->qbase;
-	REG0;
-
-	if (!(inb(qbase + 4) & 0x80))	/* false alarm? */
-		return;
-
-	if (priv->qlcmd == NULL) {	/* no command to process? */
-		int i;
-		i = 16;
-		while (i-- && inb(qbase + 5));	/* maybe also ql_zap() */
-		return;
-	}
-	icmd = priv->qlcmd;
-	icmd->result = ql_pcmd(icmd);
-	priv->qlcmd = NULL;
-	/*
-	 *	If result is CHECK CONDITION done calls qcommand to request 
-	 *	sense 
-	 */
-	(icmd->scsi_done) (icmd);
-}
-
-irqreturn_t do_ql_ihandl(int irq, void *dev_id, struct pt_regs *regs)
-{
-	unsigned long flags;
-	struct Scsi_Host *host = dev_id;
-
-	spin_lock_irqsave(host->host_lock, flags);
-	ql_ihandl(irq, dev_id, regs);
-	spin_unlock_irqrestore(host->host_lock, flags);
-	return IRQ_HANDLED;
-}
-
-/*
- *	Queued command
- */
-
-int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
-{
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(cmd->device->host->hostdata[0]);
-	if (cmd->device->id == priv->qinitid) {
-		cmd->result = DID_BAD_TARGET << 16;
-		done(cmd);
-		return 0;
-	}
-
-	cmd->scsi_done = done;
-	/* wait for the last command's interrupt to finish */
-	while (priv->qlcmd != NULL) {
-		barrier();
-		cpu_relax();
-	}
-	ql_icmd(cmd);
-	return 0;
-}
+static char qlogicfas_name[] = "qlogicfas";
 
-#ifndef PCMCIA
 /*
  *	Look for qlogic card and init if found 
  */
  
-struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
+static struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host,
+								int qbase,
 								int qlirq)
 {
-	int i, j;		/* these are only used by IRQ detect */
 	int qltyp;		/* type of chip */
 	int qinitid;
 	struct Scsi_Host *hreg;	/* registered host structure */
-	qlogicfas_priv_t priv;
+	struct qlogicfas408_priv *priv;
 
 	/*	Qlogic Cards only exist at 0x230 or 0x330 (the chip itself
 	 *	decodes the address - I check 230 first since MIDI cards are
@@ -490,70 +65,36 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
 	 *	the second card, but I haven't tested this.
 	 */
 
-	if (!qbase) {
-		for (qbase = 0x230; qbase < 0x430; qbase += 0x100) {
-			if (!request_region(qbase, 0x10, qlogicfas_name))
-				continue;
-			REG1;
-			if (((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7)
-			    && ((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7))
-				break;
-			release_region(qbase, 0x10);
-		}
-		if (qbase == 0x430)
-			return NULL;
-	} else
-		printk(KERN_INFO "Ql: Using preset base address of %03x\n", qbase);
+	if (!qbase || qlirq == -1)
+		goto err;
 
-	qltyp = inb(qbase + 0xe) & 0xf8;
+	if (!request_region(qbase, 0x10, qlogicfas_name)) {
+		printk(KERN_INFO "%s: address %#x is busy\n", qlogicfas_name,
+							      qbase);
+		goto err;
+	}
+
+	if (!qlogicfas408_detect(qbase, INT_TYPE)) {
+		printk(KERN_WARNING "%s: probe failed for %#x\n",
+								qlogicfas_name,
+								qbase);
+		goto err_release_mem;
+	}
+
+	printk(KERN_INFO "%s: Using preset base address of %03x,"
+			 " IRQ %d\n", qlogicfas_name, qbase, qlirq);
+
+	qltyp = qlogicfas408_get_chip_type(qbase, INT_TYPE);
 	qinitid = host->this_id;
 	if (qinitid < 0)
 		qinitid = 7;	/* if no ID, use 7 */
-	outb(1, qbase + 8);	/* set for PIO pseudo DMA */
-	REG0;
-	outb(0x40 | qlcfg8 | qinitid, qbase + 8);	/* (ini) bus id, disable scsi rst */
-	outb(qlcfg5, qbase + 5);	/* select timer */
-	outb(qlcfg9, qbase + 9);	/* prescaler */
-
-#if QL_RESET_AT_START
-	outb(3, qbase + 3);
-	REG1;
-	/* FIXME: timeout */
-	while (inb(qbase + 0xf) & 4)
-		cpu_relax();
-	REG0;
-#endif
-
-	/*
-	 *	IRQ probe - toggle pin and check request pending 
-	 */
 
-	if (qlirq == -1) {
-		i = 0xffff;
-		j = 3;
-		outb(0x90, qbase + 3);	/* illegal command - cause interrupt */
-		REG1;
-		outb(10, 0x20);	/* access pending interrupt map */
-		outb(10, 0xa0);
-		while (j--) {
-			outb(0xb0 | QL_INT_ACTIVE_HIGH, qbase + 0xd);	/* int pin off */
-			i &= ~(inb(0x20) | (inb(0xa0) << 8));		/* find IRQ off */
-			outb(0xb4 | QL_INT_ACTIVE_HIGH, qbase + 0xd);	/* int pin on */
-			i &= inb(0x20) | (inb(0xa0) << 8);		/* find IRQ on */
-		}
-		REG0;
-		while (inb(qbase + 5));	/* purge int */
-		j = -1;
-		while (i)	/* find on bit */
-			i >>= 1, j++;	/* should check for exactly 1 on */
-		qlirq = j;
-	} else
-		printk(KERN_INFO "Ql: Using preset IRQ %d\n", qlirq);
-
-	hreg = scsi_host_alloc(host, sizeof(struct qlogicfas_priv));
+	qlogicfas408_setup(qbase, qinitid, INT_TYPE);
+
+	hreg = scsi_host_alloc(host, sizeof(struct qlogicfas408_priv));
 	if (!hreg)
 		goto err_release_mem;
-	priv = (qlogicfas_priv_t)&(hreg->hostdata[0]);
+	priv = get_priv_by_host(hreg);
 	hreg->io_port = qbase;
 	hreg->n_io_port = 16;
 	hreg->dma_channel = -1;
@@ -563,13 +104,14 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
 	priv->qlirq = qlirq;
 	priv->qinitid = qinitid;
 	priv->shost = hreg;
+	priv->int_type = INT_TYPE;
 
 	sprintf(priv->qinfo,
 		"Qlogicfas Driver version 0.46, chip %02X at %03X, IRQ %d, TPdma:%d",
 		qltyp, qbase, qlirq, QL_TURBO_PDMA);
 	host->name = qlogicfas_name;
 
-	if (request_irq(qlirq, do_ql_ihandl, 0, qlogicfas_name, hreg))
+	if (request_irq(qlirq, qlogicfas408_ihandl, 0, qlogicfas_name, hreg))
 		goto free_scsi_host;
 
 	if (scsi_add_host(hreg, NULL))
@@ -587,11 +129,12 @@ free_scsi_host:
 
 err_release_mem:
 	release_region(qbase, 0x10);
+err:
 	return NULL;
 }
 
 #define MAX_QLOGICFAS	8
-static qlogicfas_priv_t cards;
+static struct qlogicfas408_priv *cards;
 static int iobase[MAX_QLOGICFAS];
 static int irq[MAX_QLOGICFAS] = { [0 ... MAX_QLOGICFAS-1] = -1 };
 MODULE_PARM(iobase, "1-" __MODULE_STRING(MAX_QLOGICFAS) "i");
@@ -599,23 +142,21 @@ MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_QLOGICFAS) "i");
 MODULE_PARM_DESC(iobase, "I/O address");
 MODULE_PARM_DESC(irq, "IRQ");
 
-int __devinit qlogicfas_detect(Scsi_Host_Template *sht)
+static int __devinit qlogicfas_detect(Scsi_Host_Template *sht)
 {
-	struct Scsi_Host	*shost;
-	qlogicfas_priv_t	priv;
-	int	i,
-		num = 0;
+	struct Scsi_Host *shost;
+	struct qlogicfas408_priv *priv;
+	int num;
 
-	for (i = 0; i < MAX_QLOGICFAS; i++) {
+	for (num = 0; num < MAX_QLOGICFAS; num++) {
 		shost = __qlogicfas_detect(sht, iobase[num], irq[num]);
 		if (shost == NULL) {
 			/* no more devices */
 			break;
 		}
-		priv = (qlogicfas_priv_t)&(shost->hostdata[0]);
+		priv = get_priv_by_host(shost);
 		priv->next = cards;
 		cards = priv;
-		num++;
 	}
 
 	return num;
@@ -623,13 +164,10 @@ int __devinit qlogicfas_detect(Scsi_Host_Template *sht)
 
 static int qlogicfas_release(struct Scsi_Host *shost)
 {
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(shost->hostdata[0]);
-	int qbase = priv->qbase;
+	struct qlogicfas408_priv *priv = get_priv_by_host(shost);
 
 	if (shost->irq) {
-		REG1;
-		outb(0, qbase + 0xb);	/* disable ints */
-	
+		qlogicfas408_disable_ints(priv);	
 		free_irq(shost->irq, shost);
 	}
 	if (shost->dma_channel != 0xff)
@@ -641,100 +179,21 @@ static int qlogicfas_release(struct Scsi_Host *shost)
 
 	return 0;
 }
-#endif	/* ifndef PCMCIA */
-
-/* 
- *	Return bios parameters 
- */
-
-int qlogicfas_biosparam(struct scsi_device * disk,
-		        struct block_device *dev,
-			sector_t capacity, int ip[])
-{
-/* This should mimic the DOS Qlogic driver's behavior exactly */
-	ip[0] = 0x40;
-	ip[1] = 0x20;
-	ip[2] = (unsigned long) capacity / (ip[0] * ip[1]);
-	if (ip[2] > 1024) {
-		ip[0] = 0xff;
-		ip[1] = 0x3f;
-		ip[2] = (unsigned long) capacity / (ip[0] * ip[1]);
-#if 0
-		if (ip[2] > 1023)
-			ip[2] = 1023;
-#endif
-	}
-	return 0;
-}
-
-/*
- *	Abort a command in progress
- */
- 
-static int qlogicfas_abort(Scsi_Cmnd * cmd)
-{
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(cmd->device->host->hostdata[0]);
-	priv->qabort = 1;
-	ql_zap(priv);
-	return SUCCESS;
-}
-
-/* 
- *	Reset SCSI bus
- *	FIXME: This function is invoked with cmd = NULL directly by
- *	the PCMCIA qlogic_stub code. This wants fixing
- */
-
-int qlogicfas_bus_reset(Scsi_Cmnd * cmd)
-{
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(cmd->device->host->hostdata[0]);
-	priv->qabort = 2;
-	ql_zap(priv);
-	return SUCCESS;
-}
-
-/* 
- *	Reset SCSI host controller
- */
-
-static int qlogicfas_host_reset(Scsi_Cmnd * cmd)
-{
-	return FAILED;
-}
-
-/* 
- *	Reset SCSI device
- */
-
-static int qlogicfas_device_reset(Scsi_Cmnd * cmd)
-{
-	return FAILED;
-}
-
-/*
- *	Return info string
- */
-
-static const char *qlogicfas_info(struct Scsi_Host *host)
-{
-	qlogicfas_priv_t priv = (qlogicfas_priv_t)&(host->hostdata[0]);
-	return priv->qinfo;
-}
 
 /*
  *	The driver template is also needed for PCMCIA
  */
-Scsi_Host_Template qlogicfas_driver_template = {
+static Scsi_Host_Template qlogicfas_driver_template = {
 	.module			= THIS_MODULE,
 	.name			= qlogicfas_name,
 	.proc_name		= qlogicfas_name,
-	.info			= qlogicfas_info,
-	.queuecommand		= qlogicfas_queuecommand,
-	.eh_abort_handler	= qlogicfas_abort,
-	.eh_bus_reset_handler	= qlogicfas_bus_reset,
-	.eh_device_reset_handler= qlogicfas_device_reset,
-	.eh_host_reset_handler	= qlogicfas_host_reset,
-	.bios_param		= qlogicfas_biosparam,
+	.info			= qlogicfas408_info,
+	.queuecommand		= qlogicfas408_queuecommand,
+	.eh_abort_handler	= qlogicfas408_abort,
+	.eh_bus_reset_handler	= qlogicfas408_bus_reset,
+	.eh_device_reset_handler= qlogicfas408_device_reset,
+	.eh_host_reset_handler	= qlogicfas408_host_reset,
+	.bios_param		= qlogicfas408_biosparam,
 	.can_queue		= 1,
 	.this_id		= -1,
 	.sg_tablesize		= SG_ALL,
@@ -742,11 +201,13 @@ Scsi_Host_Template qlogicfas_driver_template = {
 	.use_clustering		= DISABLE_CLUSTERING,
 };
 
-#ifndef PCMCIA
 static __init int qlogicfas_init(void)
 {
 	if (!qlogicfas_detect(&qlogicfas_driver_template)) {
 		/* no cards found */
+		printk(KERN_INFO "%s: no cards were found, please specify "
+				 "I/O address and IRQ using iobase= and irq= "
+				 "options", qlogicfas_name);
 		return -ENODEV;
 	}
 
@@ -755,16 +216,15 @@ static __init int qlogicfas_init(void)
 
 static __exit void qlogicfas_exit(void)
 {
-	qlogicfas_priv_t	priv;
+	struct qlogicfas408_priv *priv;
 
 	for (priv = cards; priv != NULL; priv = priv->next)
 		qlogicfas_release(priv->shost);
 }
 
 MODULE_AUTHOR("Tom Zerucha, Michael Griffith");
-MODULE_DESCRIPTION("Driver for the Qlogic FAS SCSI controllers");
+MODULE_DESCRIPTION("Driver for the Qlogic FAS408 based ISA card");
 MODULE_LICENSE("GPL");
 module_init(qlogicfas_init);
 module_exit(qlogicfas_exit);
-#endif	/* ifndef PCMCIA */
 
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c
index 5b6ce0a88..32c9cd413 100644
--- a/drivers/scsi/qlogicfas408.c
+++ b/drivers/scsi/qlogicfas408.c
@@ -56,7 +56,7 @@
 #include <asm/dma.h>
 
 #include "scsi.h"
-#include <scsi/scsi_host.h>
+#include "hosts.h"
 #include "qlogicfas408.h"
 
 /*----------------------------------------------------------------*/
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index c3ba6c226..c49ca7f2f 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -23,11 +23,10 @@
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
 
 #include <asm/byteorder.h>
 
-#include "scsi.h"
-#include "hosts.h"
 #include "qlogicpti.h"
 
 #include <asm/sbus.h>
@@ -39,7 +38,15 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include <linux/module.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_request.h>
+#include <scsi/scsi_tcq.h>
+#include <scsi/scsi_host.h>
+
+
 
 #define MAX_TARGETS	16
 #define MAX_LUNS	8	/* 32 for 1.31 F/W */
@@ -809,7 +816,7 @@ static int __init qpti_map_queues(struct qlogicpti *qpti)
 }
 
 /* Detect all PTI Qlogic ISP's in the machine. */
-static int __init qlogicpti_detect(Scsi_Host_Template *tpnt)
+static int __init qlogicpti_detect(struct scsi_host_template *tpnt)
 {
 	struct qlogicpti *qpti;
 	struct Scsi_Host *qpti_host;
@@ -878,7 +885,7 @@ static int __init qlogicpti_detect(Scsi_Host_Template *tpnt)
 			qpti_get_bursts(qpti);
 			qpti_get_clock(qpti);
 
-			/* Clear out Scsi_Cmnd array. */
+			/* Clear out scsi_cmnd array. */
 			memset(qpti->cmd_slots, 0, sizeof(qpti->cmd_slots));
 
 			if (qpti_map_queues(qpti) < 0)
@@ -997,7 +1004,7 @@ static inline void marker_frob(struct Command_Entry *cmd)
 	marker->rsvd = 0;
 }
 
-static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd,
+static inline void cmd_frob(struct Command_Entry *cmd, struct scsi_cmnd *Cmnd,
 			    struct qlogicpti *qpti)
 {
 	memset(cmd, 0, sizeof(struct Command_Entry));
@@ -1027,7 +1034,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd,
 }
 
 /* Do it to it baby. */
-static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd,
+static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
 			   struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr)
 {
 	struct dataseg *ds;
@@ -1038,7 +1045,7 @@ static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd,
 		int sg_count;
 
 		sg = (struct scatterlist *) Cmnd->buffer;
-		sg_count = sbus_map_sg(qpti->sdev, sg, Cmnd->use_sg, scsi_to_sbus_dma_dir(Cmnd->sc_data_direction));
+		sg_count = sbus_map_sg(qpti->sdev, sg, Cmnd->use_sg, Cmnd->sc_data_direction);
 
 		ds = cmd->dataseg;
 		cmd->segment_cnt = sg_count;
@@ -1081,7 +1088,7 @@ static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd,
 			sbus_map_single(qpti->sdev,
 					Cmnd->request_buffer,
 					Cmnd->request_bufflen,
-					scsi_to_sbus_dma_dir(Cmnd->sc_data_direction));
+					Cmnd->sc_data_direction);
 
 		cmd->dataseg[0].d_base = (u32) ((unsigned long)Cmnd->SCp.ptr);
 		cmd->dataseg[0].d_count = Cmnd->request_bufflen;
@@ -1115,11 +1122,11 @@ static inline void update_can_queue(struct Scsi_Host *host, u_int in_ptr, u_int
 /*
  * Until we scan the entire bus with inquiries, go throught this fella...
  */
-static void ourdone(Scsi_Cmnd *Cmnd)
+static void ourdone(struct scsi_cmnd *Cmnd)
 {
 	struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
 	int tgt = Cmnd->device->id;
-	void (*done) (Scsi_Cmnd *);
+	void (*done) (struct scsi_cmnd *);
 
 	/* This grot added by DaveM, blame him for ugliness.
 	 * The issue is that in the 2.3.x driver we use the
@@ -1127,7 +1134,7 @@ static void ourdone(Scsi_Cmnd *Cmnd)
 	 * completion linked list at interrupt service time,
 	 * so we have to store the done function pointer elsewhere.
 	 */
-	done = (void (*)(Scsi_Cmnd *))
+	done = (void (*)(struct scsi_cmnd *))
 		(((unsigned long) Cmnd->SCp.Message)
 #ifdef __sparc_v9__
 		 | ((unsigned long) Cmnd->SCp.Status << 32UL)
@@ -1164,10 +1171,10 @@ static void ourdone(Scsi_Cmnd *Cmnd)
 	done(Cmnd);
 }
 
-static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *));
+static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *));
 
-static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
-				       void (*done)(Scsi_Cmnd *))
+static int qlogicpti_queuecommand_slow(struct scsi_cmnd *Cmnd,
+				       void (*done)(struct scsi_cmnd *))
 {
 	struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
 
@@ -1238,7 +1245,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
  *
  * "This code must fly." -davem
  */
-static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
+static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *))
 {
 	struct Scsi_Host *host = Cmnd->device->host;
 	struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
@@ -1351,9 +1358,9 @@ static int qlogicpti_return_status(struct Status_Entry *sts, int id)
 	return (sts->scsi_status & STATUS_MASK) | (host_status << 16);
 }
 
-static Scsi_Cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
+static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
 {
-	Scsi_Cmnd *Cmnd, *done_queue = NULL;
+	struct scsi_cmnd *Cmnd, *done_queue = NULL;
 	struct Status_Entry *sts;
 	u_int in_ptr, out_ptr;
 
@@ -1412,12 +1419,12 @@ static Scsi_Cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
 			sbus_unmap_sg(qpti->sdev,
 				      (struct scatterlist *)Cmnd->buffer,
 				      Cmnd->use_sg,
-				      scsi_to_sbus_dma_dir(Cmnd->sc_data_direction));
+				      Cmnd->sc_data_direction);
 		} else {
 			sbus_unmap_single(qpti->sdev,
 					  (__u32)((unsigned long)Cmnd->SCp.ptr),
 					  Cmnd->request_bufflen,
-					  scsi_to_sbus_dma_dir(Cmnd->sc_data_direction));
+					  Cmnd->sc_data_direction);
 		}
 		qpti->cmd_count[Cmnd->device->id]--;
 		sbus_writew(out_ptr, qpti->qregs + MBOX5);
@@ -1433,16 +1440,16 @@ static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct qlogicpti *qpti = dev_id;
 	unsigned long flags;
-	Scsi_Cmnd *dq;
+	struct scsi_cmnd *dq;
 
 	spin_lock_irqsave(qpti->qhost->host_lock, flags);
 	dq = qlogicpti_intr_handler(qpti);
 
 	if (dq != NULL) {
 		do {
-			Scsi_Cmnd *next;
+			struct scsi_cmnd *next;
 
-			next = (Scsi_Cmnd *) dq->host_scribble;
+			next = (struct scsi_cmnd *) dq->host_scribble;
 			dq->scsi_done(dq);
 			dq = next;
 		} while (dq != NULL);
@@ -1452,7 +1459,7 @@ static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
 	return IRQ_HANDLED;
 }
 
-static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
+static int qlogicpti_abort(struct scsi_cmnd *Cmnd)
 {
 	u_short param[6];
 	struct Scsi_Host *host = Cmnd->device->host;
@@ -1489,7 +1496,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
 	return return_status;
 }
 
-static int qlogicpti_reset(Scsi_Cmnd *Cmnd)
+static int qlogicpti_reset(struct scsi_cmnd *Cmnd)
 {
 	u_short param[6];
 	struct Scsi_Host *host = Cmnd->device->host;
@@ -1513,7 +1520,7 @@ static int qlogicpti_reset(Scsi_Cmnd *Cmnd)
 	return return_status;
 }
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
 	.detect			= qlogicpti_detect,
 	.release		= qlogicpti_release,
 	.info			= qlogicpti_info,
diff --git a/drivers/scsi/qlogicpti.h b/drivers/scsi/qlogicpti.h
index 942e286e1..a40ff75ca 100644
--- a/drivers/scsi/qlogicpti.h
+++ b/drivers/scsi/qlogicpti.h
@@ -6,8 +6,6 @@
 #ifndef _QLOGICPTI_H
 #define _QLOGICPTI_H
 
-#include <linux/config.h>
-
 /* Qlogic/SBUS controller registers. */
 #define SBUS_CFG1	0x006UL
 #define SBUS_CTRL	0x008UL
@@ -332,6 +330,8 @@ struct pti_queue_entry {
 	char __opaque[QUEUE_ENTRY_LEN];
 };
 
+struct scsi_cmnd;
+
 /* Software state for the driver. */
 struct qlogicpti {
 	/* These are the hot elements in the cache, so they come first. */
@@ -352,7 +352,7 @@ struct qlogicpti {
 	 * Ex000 sparc64 machines with >4GB of ram we just keep track of the
 	 * scsi command pointers here.  This is essentially what Matt Jacob does. -DaveM
 	 */
-	Scsi_Cmnd                *cmd_slots[QLOGICPTI_REQ_QUEUE_LEN + 1];
+	struct scsi_cmnd         *cmd_slots[QLOGICPTI_REQ_QUEUE_LEN + 1];
 
 	/* The rest of the elements are unimportant for performance. */
 	struct qlogicpti         *next;
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 233ed7e08..268b2c345 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -1,6 +1,10 @@
 /*
  *  sata_promise.c - Promise SATA
  *
+ *  Maintained by:  Jeff Garzik <jgarzik@pobox.com>
+ *  		    Please ALWAYS copy linux-ide@vger.kernel.org
+ *		    on emails.
+ *
  *  Copyright 2003-2004 Red Hat, Inc.
  *
  *  The contents of this file are subject to the Open
@@ -30,19 +34,17 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 #include <asm/io.h>
+#include "sata_promise.h"
 
 #define DRV_NAME	"sata_promise"
-#define DRV_VERSION	"0.92"
+#define DRV_VERSION	"1.00"
 
 
 enum {
-	PDC_PRD_TBL		= 0x44,	/* Direct command DMA table addr */
-
 	PDC_PKT_SUBMIT		= 0x40, /* Command packet pointer addr */
-	PDC_HDMA_PKT_SUBMIT	= 0x100, /* Host DMA packet pointer addr */
 	PDC_INT_SEQMASK		= 0x40,	/* Mask of asserted SEQ INTs */
 	PDC_TBG_MODE		= 0x41,	/* TBG mode */
 	PDC_FLASH_CTL		= 0x44, /* Flash control register */
@@ -51,141 +53,39 @@ enum {
 	PDC_CTLSTAT		= 0x60,	/* IDE control and status (per port) */
 	PDC_SATA_PLUG_CSR	= 0x6C, /* SATA Plug control/status reg */
 	PDC_SLEW_CTL		= 0x470, /* slew rate control reg */
-	PDC_HDMA_CTLSTAT	= 0x12C, /* Host DMA control / status */
-
-	PDC_20621_SEQCTL	= 0x400,
-	PDC_20621_SEQMASK	= 0x480,
-	PDC_20621_GENERAL_CTL	= 0x484,
-	PDC_20621_PAGE_SIZE	= (32 * 1024),
-
-	/* chosen, not constant, values; we design our own DIMM mem map */
-	PDC_20621_DIMM_WINDOW	= 0x0C,	/* page# for 32K DIMM window */
-	PDC_20621_DIMM_BASE	= 0x00200000,
-	PDC_20621_DIMM_DATA	= (64 * 1024),
-	PDC_DIMM_DATA_STEP	= (256 * 1024),
-	PDC_DIMM_WINDOW_STEP	= (8 * 1024),
-	PDC_DIMM_HOST_PRD	= (6 * 1024),
-	PDC_DIMM_HOST_PKT	= (128 * 0),
-	PDC_DIMM_HPKT_PRD	= (128 * 1),
-	PDC_DIMM_ATA_PKT	= (128 * 2),
-	PDC_DIMM_APKT_PRD	= (128 * 3),
-	PDC_DIMM_HEADER_SZ	= PDC_DIMM_APKT_PRD + 128,
-	PDC_PAGE_WINDOW		= 0x40,
-	PDC_PAGE_DATA		= PDC_PAGE_WINDOW +
-				  (PDC_20621_DIMM_DATA / PDC_20621_PAGE_SIZE),
-	PDC_PAGE_SET		= PDC_DIMM_DATA_STEP / PDC_20621_PAGE_SIZE,
-
-	PDC_CHIP0_OFS		= 0xC0000, /* offset of chip #0 */
-
-	PDC_20621_ERR_MASK	= (1<<19) | (1<<20) | (1<<21) | (1<<22) |
-				  (1<<23),
+
 	PDC_ERR_MASK		= (1<<19) | (1<<20) | (1<<21) | (1<<22) |
 				  (1<<8) | (1<<9) | (1<<10),
 
 	board_2037x		= 0,	/* FastTrak S150 TX2plus */
 	board_20319		= 1,	/* FastTrak S150 TX4 */
-	board_20621		= 2,	/* FastTrak S150 SX4 */
 
 	PDC_HAS_PATA		= (1 << 1), /* PDC20375 has PATA */
 
-	PDC_FLAG_20621		= (1 << 30), /* we have a 20621 */
 	PDC_RESET		= (1 << 11), /* HDMA reset */
-
-	PDC_MAX_HDMA		= 32,
-	PDC_HDMA_Q_MASK		= (PDC_MAX_HDMA - 1),
-
-	PDC_DIMM0_SPD_DEV_ADDRESS     = 0x50,
-	PDC_DIMM1_SPD_DEV_ADDRESS     = 0x51,
-	PDC_MAX_DIMM_MODULE           = 0x02,
-	PDC_I2C_CONTROL_OFFSET        = 0x48,
-	PDC_I2C_ADDR_DATA_OFFSET      = 0x4C,
-	PDC_DIMM0_CONTROL_OFFSET      = 0x80,
-	PDC_DIMM1_CONTROL_OFFSET      = 0x84,
-	PDC_SDRAM_CONTROL_OFFSET      = 0x88,
-	PDC_I2C_WRITE                 = 0x00000000,
-	PDC_I2C_READ                  = 0x00000040,	
-	PDC_I2C_START                 = 0x00000080,
-	PDC_I2C_MASK_INT              = 0x00000020,
-	PDC_I2C_COMPLETE              = 0x00010000,
-	PDC_I2C_NO_ACK                = 0x00100000,
-	PDC_DIMM_SPD_SUBADDRESS_START = 0x00,
-	PDC_DIMM_SPD_SUBADDRESS_END   = 0x7F,
-	PDC_DIMM_SPD_ROW_NUM          = 3,
-	PDC_DIMM_SPD_COLUMN_NUM       = 4,
-	PDC_DIMM_SPD_MODULE_ROW       = 5,
-	PDC_DIMM_SPD_TYPE             = 11,
-	PDC_DIMM_SPD_FRESH_RATE       = 12,         
-	PDC_DIMM_SPD_BANK_NUM         = 17,	
-	PDC_DIMM_SPD_CAS_LATENCY      = 18,
-	PDC_DIMM_SPD_ATTRIBUTE        = 21,    
-	PDC_DIMM_SPD_ROW_PRE_CHARGE   = 27,
-	PDC_DIMM_SPD_ROW_ACTIVE_DELAY = 28,      
-	PDC_DIMM_SPD_RAS_CAS_DELAY    = 29,
-	PDC_DIMM_SPD_ACTIVE_PRECHARGE = 30,
-	PDC_DIMM_SPD_SYSTEM_FREQ      = 126,
-	PDC_CTL_STATUS		      = 0x08,	
-	PDC_DIMM_WINDOW_CTLR	      = 0x0C,
-	PDC_TIME_CONTROL              = 0x3C,
-	PDC_TIME_PERIOD               = 0x40,
-	PDC_TIME_COUNTER              = 0x44,
-	PDC_GENERAL_CTLR	      = 0x484,
-	PCI_PLL_INIT                  = 0x8A531824,
-	PCI_X_TCOUNT                  = 0xEE1E5CFF
 };
 
 
 struct pdc_port_priv {
-	u8			dimm_buf[(ATA_PRD_SZ * ATA_MAX_PRD) + 512];
 	u8			*pkt;
 	dma_addr_t		pkt_dma;
 };
 
-struct pdc_host_priv {
-	void			*dimm_mmio;
-
-	unsigned int		doing_hdma;
-	unsigned int		hdma_prod;
-	unsigned int		hdma_cons;
-	struct {
-		struct ata_queued_cmd *qc;
-		unsigned int	seq;
-		unsigned long	pkt_ofs;
-	} hdma[32];
-};
-
-
 static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg);
 static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
 static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
+static void pdc_dma_setup(struct ata_queued_cmd *qc);
 static void pdc_dma_start(struct ata_queued_cmd *qc);
-static void pdc20621_dma_start(struct ata_queued_cmd *qc);
 static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
-static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
 static void pdc_eng_timeout(struct ata_port *ap);
-static void pdc_20621_phy_reset (struct ata_port *ap);
 static int pdc_port_start(struct ata_port *ap);
 static void pdc_port_stop(struct ata_port *ap);
 static void pdc_phy_reset(struct ata_port *ap);
 static void pdc_fill_sg(struct ata_queued_cmd *qc);
-static void pdc20621_fill_sg(struct ata_queued_cmd *qc);
 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
-static void pdc20621_host_stop(struct ata_host_set *host_set);
 static inline void pdc_dma_complete (struct ata_port *ap,
                                      struct ata_queued_cmd *qc, int have_err);
-static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe);
-static int pdc20621_detect_dimm(struct ata_probe_ent *pe);
-static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, 
-				      u32 device, u32 subaddr, u32 *pdata);
-static int pdc20621_prog_dimm0(struct ata_probe_ent *pe);
-static unsigned int pdc20621_prog_dimm_global(struct ata_probe_ent *pe);
-#ifdef ATA_VERBOSE_DEBUG
-static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, 
-				   void *psource, u32 offset, u32 size);
-#endif
-static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, 
-				 void *psource, u32 offset, u32 size);
-
 
 static Scsi_Host_Template pdc_sata_sht = {
 	.module			= THIS_MODULE,
@@ -212,6 +112,7 @@ static struct ata_port_operations pdc_sata_ops = {
 	.check_status		= ata_check_status_mmio,
 	.exec_command		= pdc_exec_command_mmio,
 	.phy_reset		= pdc_phy_reset,
+	.bmdma_setup            = pdc_dma_setup,
 	.bmdma_start            = pdc_dma_start,
 	.fill_sg		= pdc_fill_sg,
 	.eng_timeout		= pdc_eng_timeout,
@@ -222,22 +123,6 @@ static struct ata_port_operations pdc_sata_ops = {
 	.port_stop		= pdc_port_stop,
 };
 
-static struct ata_port_operations pdc_20621_ops = {
-	.port_disable		= ata_port_disable,
-	.tf_load		= pdc_tf_load_mmio,
-	.tf_read		= ata_tf_read_mmio,
-	.check_status		= ata_check_status_mmio,
-	.exec_command		= pdc_exec_command_mmio,
-	.phy_reset		= pdc_20621_phy_reset,
-	.bmdma_start            = pdc20621_dma_start,
-	.fill_sg		= pdc20621_fill_sg,
-	.eng_timeout		= pdc_eng_timeout,
-	.irq_handler		= pdc20621_interrupt,
-	.port_start		= pdc_port_start,
-	.port_stop		= pdc_port_stop,
-	.host_stop		= pdc20621_host_stop,
-};
-
 static struct ata_port_info pdc_port_info[] = {
 	/* board_2037x */
 	{
@@ -258,18 +143,6 @@ static struct ata_port_info pdc_port_info[] = {
 		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
 		.port_ops	= &pdc_sata_ops,
 	},
-
-	/* board_20621 */
-	{
-		.sht		= &pdc_sata_sht,
-		.host_flags	= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
-				  ATA_FLAG_SRST | ATA_FLAG_MMIO |
-				  PDC_FLAG_20621,
-		.pio_mask	= 0x03, /* pio3-4 */
-		.udma_mask	= 0x7f, /* udma0-6 ; FIXME */
-		.port_ops	= &pdc_20621_ops,
-	},
-
 };
 
 static struct pci_device_id pdc_sata_pci_tbl[] = {
@@ -285,8 +158,6 @@ static struct pci_device_id pdc_sata_pci_tbl[] = {
 	  board_20319 },
 	{ PCI_VENDOR_ID_PROMISE, 0x3319, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 	  board_20319 },
-	{ PCI_VENDOR_ID_PROMISE, 0x6622, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-	  board_20621 },
 	{ }	/* terminate list */
 };
 
@@ -299,15 +170,6 @@ static struct pci_driver pdc_sata_pci_driver = {
 };
 
 
-static void pdc20621_host_stop(struct ata_host_set *host_set)
-{
-	struct pdc_host_priv *hpriv = host_set->private_data;
-	void *dimm_mmio = hpriv->dimm_mmio;
-
-	iounmap(dimm_mmio);
-	kfree(hpriv);
-}
-
 static int pdc_port_start(struct ata_port *ap)
 {
 	struct pci_dev *pdev = ap->host_set->pdev;
@@ -355,14 +217,6 @@ static void pdc_port_stop(struct ata_port *ap)
 }
 
 
-static void pdc_20621_phy_reset (struct ata_port *ap)
-{
-	VPRINTK("ENTER\n");
-        ap->cbl = ATA_CBL_SATA;
-        ata_port_probe(ap);
-        ata_bus_reset(ap);
-}
-
 static void pdc_reset_port(struct ata_port *ap)
 {
 	void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT;
@@ -407,587 +261,6 @@ static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
 	writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4));
 }
 
-enum pdc_packet_bits {
-	PDC_PKT_READ		= (1 << 2),
-	PDC_PKT_NODATA		= (1 << 3),
-
-	PDC_PKT_SIZEMASK	= (1 << 7) | (1 << 6) | (1 << 5),
-	PDC_PKT_CLEAR_BSY	= (1 << 4),
-	PDC_PKT_WAIT_DRDY	= (1 << 3) | (1 << 4),
-	PDC_LAST_REG		= (1 << 3),
-
-	PDC_REG_DEVCTL		= (1 << 3) | (1 << 2) | (1 << 1),
-};
-
-static inline unsigned int pdc_pkt_header(struct ata_taskfile *tf,
-					  dma_addr_t sg_table,
-					  unsigned int devno, u8 *buf)
-{
-	u8 dev_reg;
-	u32 *buf32 = (u32 *) buf;
-
-	/* set control bits (byte 0), zero delay seq id (byte 3),
-	 * and seq id (byte 2)
-	 */
-	switch (tf->protocol) {
-	case ATA_PROT_DMA:
-		if (!(tf->flags & ATA_TFLAG_WRITE))
-			buf32[0] = cpu_to_le32(PDC_PKT_READ);
-		else
-			buf32[0] = 0;
-		break;
-
-	case ATA_PROT_NODATA:
-		buf32[0] = cpu_to_le32(PDC_PKT_NODATA);
-		break;
-
-	default:
-		BUG();
-		break;
-	}
-
-	buf32[1] = cpu_to_le32(sg_table);	/* S/G table addr */
-	buf32[2] = 0;				/* no next-packet */
-
-	if (devno == 0)
-		dev_reg = ATA_DEVICE_OBS;
-	else
-		dev_reg = ATA_DEVICE_OBS | ATA_DEV1;
-
-	/* select device */
-	buf[12] = (1 << 5) | PDC_PKT_CLEAR_BSY | ATA_REG_DEVICE;
-	buf[13] = dev_reg;
-
-	/* device control register */
-	buf[14] = (1 << 5) | PDC_REG_DEVCTL;
-	buf[15] = tf->ctl;
-
-	return 16; 	/* offset of next byte */
-}
-
-static inline unsigned int pdc_pkt_footer(struct ata_taskfile *tf, u8 *buf,
-				  unsigned int i)
-{
-	if (tf->flags & ATA_TFLAG_DEVICE) {
-		buf[i++] = (1 << 5) | ATA_REG_DEVICE;
-		buf[i++] = tf->device;
-	}
-
-	/* and finally the command itself; also includes end-of-pkt marker */
-	buf[i++] = (1 << 5) | PDC_LAST_REG | ATA_REG_CMD;
-	buf[i++] = tf->command;
-
-	return i;
-}
-
-static inline unsigned int pdc_prep_lba28(struct ata_taskfile *tf, u8 *buf, unsigned int i)
-{
-	/* the "(1 << 5)" should be read "(count << 5)" */
-
-	/* ATA command block registers */
-	buf[i++] = (1 << 5) | ATA_REG_FEATURE;
-	buf[i++] = tf->feature;
-
-	buf[i++] = (1 << 5) | ATA_REG_NSECT;
-	buf[i++] = tf->nsect;
-
-	buf[i++] = (1 << 5) | ATA_REG_LBAL;
-	buf[i++] = tf->lbal;
-
-	buf[i++] = (1 << 5) | ATA_REG_LBAM;
-	buf[i++] = tf->lbam;
-
-	buf[i++] = (1 << 5) | ATA_REG_LBAH;
-	buf[i++] = tf->lbah;
-
-	return i;
-}
-
-static inline unsigned int pdc_prep_lba48(struct ata_taskfile *tf, u8 *buf, unsigned int i)
-{
-	/* the "(2 << 5)" should be read "(count << 5)" */
-
-	/* ATA command block registers */
-	buf[i++] = (2 << 5) | ATA_REG_FEATURE;
-	buf[i++] = tf->hob_feature;
-	buf[i++] = tf->feature;
-
-	buf[i++] = (2 << 5) | ATA_REG_NSECT;
-	buf[i++] = tf->hob_nsect;
-	buf[i++] = tf->nsect;
-
-	buf[i++] = (2 << 5) | ATA_REG_LBAL;
-	buf[i++] = tf->hob_lbal;
-	buf[i++] = tf->lbal;
-
-	buf[i++] = (2 << 5) | ATA_REG_LBAM;
-	buf[i++] = tf->hob_lbam;
-	buf[i++] = tf->lbam;
-
-	buf[i++] = (2 << 5) | ATA_REG_LBAH;
-	buf[i++] = tf->hob_lbah;
-	buf[i++] = tf->lbah;
-
-	return i;
-}
-
-static inline void pdc20621_ata_sg(struct ata_taskfile *tf, u8 *buf,
-				    	   unsigned int portno,
-					   unsigned int total_len)
-{
-	u32 addr;
-	unsigned int dw = PDC_DIMM_APKT_PRD >> 2;
-	u32 *buf32 = (u32 *) buf;
-
-	/* output ATA packet S/G table */
-	addr = PDC_20621_DIMM_BASE + PDC_20621_DIMM_DATA +
-	       (PDC_DIMM_DATA_STEP * portno);
-	VPRINTK("ATA sg addr 0x%x, %d\n", addr, addr);
-	buf32[dw] = cpu_to_le32(addr);
-	buf32[dw + 1] = cpu_to_le32(total_len | ATA_PRD_EOT);
-
-	VPRINTK("ATA PSG @ %x == (0x%x, 0x%x)\n",
-		PDC_20621_DIMM_BASE +
-		       (PDC_DIMM_WINDOW_STEP * portno) +
-		       PDC_DIMM_APKT_PRD,
-		buf32[dw], buf32[dw + 1]);
-}
-
-static inline void pdc20621_host_sg(struct ata_taskfile *tf, u8 *buf,
-				    	    unsigned int portno,
-					    unsigned int total_len)
-{
-	u32 addr;
-	unsigned int dw = PDC_DIMM_HPKT_PRD >> 2;
-	u32 *buf32 = (u32 *) buf;
-
-	/* output Host DMA packet S/G table */
-	addr = PDC_20621_DIMM_BASE + PDC_20621_DIMM_DATA +
-	       (PDC_DIMM_DATA_STEP * portno);
-
-	buf32[dw] = cpu_to_le32(addr);
-	buf32[dw + 1] = cpu_to_le32(total_len | ATA_PRD_EOT);
-
-	VPRINTK("HOST PSG @ %x == (0x%x, 0x%x)\n",
-		PDC_20621_DIMM_BASE +
-		       (PDC_DIMM_WINDOW_STEP * portno) +
-		       PDC_DIMM_HPKT_PRD,
-		buf32[dw], buf32[dw + 1]);
-}
-
-static inline unsigned int pdc20621_ata_pkt(struct ata_taskfile *tf,
-					    unsigned int devno, u8 *buf,
-					    unsigned int portno)
-{
-	unsigned int i, dw;
-	u32 *buf32 = (u32 *) buf;
-	u8 dev_reg;
-
-	unsigned int dimm_sg = PDC_20621_DIMM_BASE +
-			       (PDC_DIMM_WINDOW_STEP * portno) +
-			       PDC_DIMM_APKT_PRD;
-	VPRINTK("ENTER, dimm_sg == 0x%x, %d\n", dimm_sg, dimm_sg);
-
-	i = PDC_DIMM_ATA_PKT;
-
-	/*
-	 * Set up ATA packet
-	 */
-	if ((tf->protocol == ATA_PROT_DMA) && (!(tf->flags & ATA_TFLAG_WRITE)))
-		buf[i++] = PDC_PKT_READ;
-	else if (tf->protocol == ATA_PROT_NODATA)
-		buf[i++] = PDC_PKT_NODATA;
-	else
-		buf[i++] = 0;
-	buf[i++] = 0;			/* reserved */
-	buf[i++] = portno + 1;		/* seq. id */
-	buf[i++] = 0xff;		/* delay seq. id */
-
-	/* dimm dma S/G, and next-pkt */
-	dw = i >> 2;
-	buf32[dw] = cpu_to_le32(dimm_sg);
-	buf32[dw + 1] = 0;
-	i += 8;
-
-	if (devno == 0)
-		dev_reg = ATA_DEVICE_OBS;
-	else
-		dev_reg = ATA_DEVICE_OBS | ATA_DEV1;
-
-	/* select device */
-	buf[i++] = (1 << 5) | PDC_PKT_CLEAR_BSY | ATA_REG_DEVICE;
-	buf[i++] = dev_reg;
-
-	/* device control register */
-	buf[i++] = (1 << 5) | PDC_REG_DEVCTL;
-	buf[i++] = tf->ctl;
-
-	return i;
-}
-
-static inline void pdc20621_host_pkt(struct ata_taskfile *tf, u8 *buf,
-				     unsigned int portno)
-{
-	unsigned int dw;
-	u32 tmp, *buf32 = (u32 *) buf;
-
-	unsigned int host_sg = PDC_20621_DIMM_BASE +
-			       (PDC_DIMM_WINDOW_STEP * portno) +
-			       PDC_DIMM_HOST_PRD;
-	unsigned int dimm_sg = PDC_20621_DIMM_BASE +
-			       (PDC_DIMM_WINDOW_STEP * portno) +
-			       PDC_DIMM_HPKT_PRD;
-	VPRINTK("ENTER, dimm_sg == 0x%x, %d\n", dimm_sg, dimm_sg);
-	VPRINTK("host_sg == 0x%x, %d\n", host_sg, host_sg);
-
-	dw = PDC_DIMM_HOST_PKT >> 2;
-
-	/*
-	 * Set up Host DMA packet
-	 */
-	if ((tf->protocol == ATA_PROT_DMA) && (!(tf->flags & ATA_TFLAG_WRITE)))
-		tmp = PDC_PKT_READ;
-	else
-		tmp = 0;
-	tmp |= ((portno + 1 + 4) << 16);	/* seq. id */
-	tmp |= (0xff << 24);			/* delay seq. id */
-	buf32[dw + 0] = cpu_to_le32(tmp);
-	buf32[dw + 1] = cpu_to_le32(host_sg);
-	buf32[dw + 2] = cpu_to_le32(dimm_sg);
-	buf32[dw + 3] = 0;
-
-	VPRINTK("HOST PKT @ %x == (0x%x 0x%x 0x%x 0x%x)\n",
-		PDC_20621_DIMM_BASE + (PDC_DIMM_WINDOW_STEP * portno) +
-			PDC_DIMM_HOST_PKT,
-		buf32[dw + 0],
-		buf32[dw + 1],
-		buf32[dw + 2],
-		buf32[dw + 3]);
-}
-
-static void pdc20621_fill_sg(struct ata_queued_cmd *qc)
-{
-	struct scatterlist *sg = qc->sg;
-	struct ata_port *ap = qc->ap;
-	struct pdc_port_priv *pp = ap->private_data;
-	void *mmio = ap->host_set->mmio_base;
-	struct pdc_host_priv *hpriv = ap->host_set->private_data;
-	void *dimm_mmio = hpriv->dimm_mmio;
-	unsigned int portno = ap->port_no;
-	unsigned int i, last, idx, total_len = 0, sgt_len;
-	u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ];
-
-	VPRINTK("ata%u: ENTER\n", ap->id);
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	/*
-	 * Build S/G table
-	 */
-	last = qc->n_elem;
-	idx = 0;
-	for (i = 0; i < last; i++) {
-		buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i]));
-		buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i]));
-		total_len += sg[i].length;
-	}
-	buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT);
-	sgt_len = idx * 4;
-
-	/*
-	 * Build ATA, host DMA packets
-	 */
-	pdc20621_host_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len);
-	pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno);
-
-	pdc20621_ata_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len);
-	i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno);
-
-	if (qc->tf.flags & ATA_TFLAG_LBA48)
-		i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i);
-	else
-		i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i);
-
-	pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i);
-
-	/* copy three S/G tables and two packets to DIMM MMIO window */
-	memcpy_toio(dimm_mmio + (portno * PDC_DIMM_WINDOW_STEP),
-		    &pp->dimm_buf, PDC_DIMM_HEADER_SZ);
-	memcpy_toio(dimm_mmio + (portno * PDC_DIMM_WINDOW_STEP) +
-		    PDC_DIMM_HOST_PRD,
-		    &pp->dimm_buf[PDC_DIMM_HEADER_SZ], sgt_len);
-
-	/* force host FIFO dump */
-	writel(0x00000001, mmio + PDC_20621_GENERAL_CTL);
-
-	readl(dimm_mmio);	/* MMIO PCI posting flush */
-
-	VPRINTK("ata pkt buf ofs %u, prd size %u, mmio copied\n", i, sgt_len);
-}
-
-static void __pdc20621_push_hdma(struct ata_queued_cmd *qc,
-				 unsigned int seq,
-				 u32 pkt_ofs)
-{
-	struct ata_port *ap = qc->ap;
-	struct ata_host_set *host_set = ap->host_set;
-	void *mmio = host_set->mmio_base;
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
-	readl(mmio + PDC_20621_SEQCTL + (seq * 4));	/* flush */
-
-	writel(pkt_ofs, mmio + PDC_HDMA_PKT_SUBMIT);
-	readl(mmio + PDC_HDMA_PKT_SUBMIT);	/* flush */
-}
-
-static void pdc20621_push_hdma(struct ata_queued_cmd *qc,
-				unsigned int seq,
-				u32 pkt_ofs)
-{
-	struct ata_port *ap = qc->ap;
-	struct pdc_host_priv *pp = ap->host_set->private_data;
-	unsigned int idx = pp->hdma_prod & PDC_HDMA_Q_MASK;
-
-	if (!pp->doing_hdma) {
-		__pdc20621_push_hdma(qc, seq, pkt_ofs);
-		pp->doing_hdma = 1;
-		return;
-	}
-
-	pp->hdma[idx].qc = qc;
-	pp->hdma[idx].seq = seq;
-	pp->hdma[idx].pkt_ofs = pkt_ofs;
-	pp->hdma_prod++;
-}
-
-static void pdc20621_pop_hdma(struct ata_queued_cmd *qc)
-{
-	struct ata_port *ap = qc->ap;
-	struct pdc_host_priv *pp = ap->host_set->private_data;
-	unsigned int idx = pp->hdma_cons & PDC_HDMA_Q_MASK;
-
-	/* if nothing on queue, we're done */
-	if (pp->hdma_prod == pp->hdma_cons) {
-		pp->doing_hdma = 0;
-		return;
-	}
-
-	__pdc20621_push_hdma(pp->hdma[idx].qc, pp->hdma[idx].seq,
-			     pp->hdma[idx].pkt_ofs);
-	pp->hdma_cons++;
-}
-
-#ifdef ATA_VERBOSE_DEBUG
-static void pdc20621_dump_hdma(struct ata_queued_cmd *qc)
-{
-	struct ata_port *ap = qc->ap;
-	unsigned int port_no = ap->port_no;
-	struct pdc_host_priv *hpriv = ap->host_set->private_data;
-	void *dimm_mmio = hpriv->dimm_mmio;
-
-	dimm_mmio += (port_no * PDC_DIMM_WINDOW_STEP);
-	dimm_mmio += PDC_DIMM_HOST_PKT;
-
-	printk(KERN_ERR "HDMA[0] == 0x%08X\n", readl(dimm_mmio));
-	printk(KERN_ERR "HDMA[1] == 0x%08X\n", readl(dimm_mmio + 4));
-	printk(KERN_ERR "HDMA[2] == 0x%08X\n", readl(dimm_mmio + 8));
-	printk(KERN_ERR "HDMA[3] == 0x%08X\n", readl(dimm_mmio + 12));
-}
-#else
-static inline void pdc20621_dump_hdma(struct ata_queued_cmd *qc) { }
-#endif /* ATA_VERBOSE_DEBUG */
-
-static void pdc20621_dma_start(struct ata_queued_cmd *qc)
-{
-	struct ata_port *ap = qc->ap;
-	struct ata_host_set *host_set = ap->host_set;
-	unsigned int port_no = ap->port_no;
-	void *mmio = host_set->mmio_base;
-	unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
-	u8 seq = (u8) (port_no + 1);
-	unsigned int doing_hdma = 0, port_ofs;
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	VPRINTK("ata%u: ENTER\n", ap->id);
-
-	port_ofs = PDC_20621_DIMM_BASE + (PDC_DIMM_WINDOW_STEP * port_no);
-
-	/* if writing, we (1) DMA to DIMM, then (2) do ATA command */
-	if (rw) {
-		doing_hdma = 1;
-		seq += 4;
-	}
-
-	wmb();			/* flush PRD, pkt writes */
-
-	if (doing_hdma) {
-		pdc20621_dump_hdma(qc);
-		pdc20621_push_hdma(qc, seq, port_ofs + PDC_DIMM_HOST_PKT);
-		VPRINTK("queued ofs 0x%x (%u), seq %u\n",
-			port_ofs + PDC_DIMM_HOST_PKT,
-			port_ofs + PDC_DIMM_HOST_PKT,
-			seq);
-	} else {
-		writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
-		readl(mmio + PDC_20621_SEQCTL + (seq * 4));	/* flush */
-
-		writel(port_ofs + PDC_DIMM_ATA_PKT,
-		       (void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
-		readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
-		VPRINTK("submitted ofs 0x%x (%u), seq %u\n",
-			port_ofs + PDC_DIMM_ATA_PKT,
-			port_ofs + PDC_DIMM_ATA_PKT,
-			seq);
-	}
-}
-
-static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
-                                          struct ata_queued_cmd *qc,
-					  unsigned int doing_hdma,
-					  void *mmio)
-{
-	unsigned int port_no = ap->port_no;
-	unsigned int port_ofs =
-		PDC_20621_DIMM_BASE + (PDC_DIMM_WINDOW_STEP * port_no);
-	u8 status;
-	unsigned int handled = 0;
-
-	VPRINTK("ENTER\n");
-
-	if ((qc->tf.protocol == ATA_PROT_DMA) &&	/* read */
-	    (!(qc->tf.flags & ATA_TFLAG_WRITE))) {
-
-		/* step two - DMA from DIMM to host */
-		if (doing_hdma) {
-			VPRINTK("ata%u: read hdma, 0x%x 0x%x\n", ap->id,
-				readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
-			pdc_dma_complete(ap, qc, 0);
-			pdc20621_pop_hdma(qc);
-		}
-
-		/* step one - exec ATA command */
-		else {
-			u8 seq = (u8) (port_no + 1 + 4);
-			VPRINTK("ata%u: read ata, 0x%x 0x%x\n", ap->id,
-				readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
-
-			/* submit hdma pkt */
-			pdc20621_dump_hdma(qc);
-			pdc20621_push_hdma(qc, seq,
-					   port_ofs + PDC_DIMM_HOST_PKT);
-		}
-		handled = 1;
-
-	} else if (qc->tf.protocol == ATA_PROT_DMA) {	/* write */
-
-		/* step one - DMA from host to DIMM */
-		if (doing_hdma) {
-			u8 seq = (u8) (port_no + 1);
-			VPRINTK("ata%u: write hdma, 0x%x 0x%x\n", ap->id,
-				readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
-
-			/* submit ata pkt */
-			writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
-			readl(mmio + PDC_20621_SEQCTL + (seq * 4));
-			writel(port_ofs + PDC_DIMM_ATA_PKT,
-			       (void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
-			readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
-		}
-
-		/* step two - execute ATA command */
-		else {
-			VPRINTK("ata%u: write ata, 0x%x 0x%x\n", ap->id,
-				readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
-			pdc_dma_complete(ap, qc, 0);
-			pdc20621_pop_hdma(qc);
-		}
-		handled = 1;
-
-	/* command completion, but no data xfer */
-	} else if (qc->tf.protocol == ATA_PROT_NODATA) {
-
-		status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
-		DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status);
-		ata_qc_complete(qc, status, 0);
-		handled = 1;
-
-	} else {
-		ap->stats.idle_irq++;
-	}
-
-	return handled;
-}
-
-static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
-{
-	struct ata_host_set *host_set = dev_instance;
-	struct ata_port *ap;
-	u32 mask = 0;
-	unsigned int i, tmp, port_no;
-	unsigned int handled = 0;
-	void *mmio_base;
-
-	VPRINTK("ENTER\n");
-
-	if (!host_set || !host_set->mmio_base) {
-		VPRINTK("QUICK EXIT\n");
-		return IRQ_NONE;
-	}
-
-	mmio_base = host_set->mmio_base;
-
-	/* reading should also clear interrupts */
-	mmio_base += PDC_CHIP0_OFS;
-	mask = readl(mmio_base + PDC_20621_SEQMASK);
-	VPRINTK("mask == 0x%x\n", mask);
-
-	if (mask == 0xffffffff) {
-		VPRINTK("QUICK EXIT 2\n");
-		return IRQ_NONE;
-	}
-	mask &= 0xffff;		/* only 16 tags possible */
-	if (!mask) {
-		VPRINTK("QUICK EXIT 3\n");
-		return IRQ_NONE;
-	}
-
-        spin_lock(&host_set->lock);
-
-        for (i = 1; i < 9; i++) {
-		port_no = i - 1;
-		if (port_no > 3)
-			port_no -= 4;
-		if (port_no >= host_set->n_ports)
-			ap = NULL;
-		else
-			ap = host_set->ports[port_no];
-		tmp = mask & (1 << i);
-		VPRINTK("seq %u, port_no %u, ap %p, tmp %x\n", i, port_no, ap, tmp);
-		if (tmp && ap && (!(ap->flags & ATA_FLAG_PORT_DISABLED))) {
-			struct ata_queued_cmd *qc;
-
-			qc = ata_qc_from_tag(ap, ap->active_tag);
-			if (qc && ((qc->flags & ATA_QCFLAG_POLL) == 0))
-				handled += pdc20621_host_intr(ap, qc, (i > 4),
-							      mmio_base);
-		}
-	}
-
-        spin_unlock(&host_set->lock);
-
-	VPRINTK("mask == 0x%x\n", mask);
-
-	VPRINTK("EXIT\n");
-
-	return IRQ_RETVAL(handled);
-}
-
 static void pdc_fill_sg(struct ata_queued_cmd *qc)
 {
 	struct pdc_port_priv *pp = qc->ap->private_data;
@@ -1014,8 +287,7 @@ static inline void pdc_dma_complete (struct ata_port *ap,
 	u8 err_bit = have_err ? ATA_ERR : 0;
 
 	/* get drive status; clear intr; complete txn */
-	ata_qc_complete(ata_qc_from_tag(ap, ap->active_tag),
-			ata_wait_idle(ap) | err_bit, 0);
+	ata_qc_complete(qc, ata_wait_idle(ap) | err_bit);
 }
 
 static void pdc_eng_timeout(struct ata_port *ap)
@@ -1043,8 +315,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
 	switch (qc->tf.protocol) {
 	case ATA_PROT_DMA:
 		printk(KERN_ERR "ata%u: DMA timeout\n", ap->id);
-		ata_qc_complete(ata_qc_from_tag(ap, ap->active_tag),
-			        ata_wait_idle(ap) | ATA_ERR, 0);
+		ata_qc_complete(qc, ata_wait_idle(ap) | ATA_ERR);
 		break;
 
 	case ATA_PROT_NODATA:
@@ -1053,7 +324,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
 		printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x\n",
 		       ap->id, qc->tf.command, drv_stat);
 
-		ata_qc_complete(qc, drv_stat, 1);
+		ata_qc_complete(qc, drv_stat);
 		break;
 
 	default:
@@ -1062,7 +333,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
 		printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
 		       ap->id, qc->tf.command, drv_stat);
 
-		ata_qc_complete(qc, drv_stat, 1);
+		ata_qc_complete(qc, drv_stat);
 		break;
 	}
 
@@ -1095,7 +366,7 @@ static inline unsigned int pdc_host_intr( struct ata_port *ap,
 		DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status);
 		if (have_err)
 			status |= ATA_ERR;
-		ata_qc_complete(qc, status, 0);
+		ata_qc_complete(qc, status);
 		handled = 1;
 		break;
 
@@ -1148,7 +419,7 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *r
 			struct ata_queued_cmd *qc;
 
 			qc = ata_qc_from_tag(ap, ap->active_tag);
-			if (qc && ((qc->flags & ATA_QCFLAG_POLL) == 0))
+			if (qc && (!(qc->tf.ctl & ATA_NIEN)))
 				handled += pdc_host_intr(ap, qc);
 		}
 	}
@@ -1160,6 +431,12 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *r
 	return IRQ_RETVAL(handled);
 }
 
+static void pdc_dma_setup(struct ata_queued_cmd *qc)
+{
+	/* nothing for now.  later, we will call standard
+	 * code in libata-core for ATAPI here */
+}
+
 static void pdc_dma_start(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
@@ -1180,14 +457,14 @@ static void pdc_dma_start(struct ata_queued_cmd *qc)
 
 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	if (tf->protocol == ATA_PROT_PIO)
+	if (tf->protocol != ATA_PROT_DMA)
 		ata_tf_load_mmio(ap, tf);
 }
 
 
 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	if (tf->protocol == ATA_PROT_PIO)
+	if (tf->protocol != ATA_PROT_DMA)
 		ata_exec_command_mmio(ap, tf);
 }
 
@@ -1210,456 +487,11 @@ static void pdc_sata_setup_port(struct ata_ioports *port, unsigned long base)
 }
 
 
-#ifdef ATA_VERBOSE_DEBUG
-static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, void *psource, 
-				   u32 offset, u32 size)
-{
-	u32 window_size;
-	u16 idx;
-	u8 page_mask;
-	long dist;
-	void *mmio = pe->mmio_base;
-	struct pdc_host_priv *hpriv = pe->private_data;
-	void *dimm_mmio = hpriv->dimm_mmio;
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	page_mask = 0x00;	
-   	window_size = 0x2000 * 4; /* 32K byte uchar size */  
-	idx = (u16) (offset / window_size); 
-
-	writel(0x01, mmio + PDC_GENERAL_CTLR);
-	readl(mmio + PDC_GENERAL_CTLR);
-	writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
-	readl(mmio + PDC_DIMM_WINDOW_CTLR);
-
-	offset -= (idx * window_size);
-	idx++;
-	dist = ((long) (window_size - (offset + size))) >= 0 ? size : 
-		(long) (window_size - offset);
-	memcpy_fromio((char *) psource, (char *) (dimm_mmio + offset / 4), 
-		      dist);
-
-	psource += dist;    
-	size -= dist;
-	for (; (long) size >= (long) window_size ;) {
-		writel(0x01, mmio + PDC_GENERAL_CTLR);
-		readl(mmio + PDC_GENERAL_CTLR);
-		writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
-		readl(mmio + PDC_DIMM_WINDOW_CTLR);
-		memcpy_fromio((char *) psource, (char *) (dimm_mmio), 
-			      window_size / 4);
-		psource += window_size;
-		size -= window_size;
-		idx ++;
-	}
-
-	if (size) {
-		writel(0x01, mmio + PDC_GENERAL_CTLR);
-		readl(mmio + PDC_GENERAL_CTLR);
-		writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
-		readl(mmio + PDC_DIMM_WINDOW_CTLR);
-		memcpy_fromio((char *) psource, (char *) (dimm_mmio), 
-			      size / 4);
-	}
-}
-#endif
-
-
-static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, 
-				 u32 offset, u32 size)
-{
-	u32 window_size;
-	u16 idx;
-	u8 page_mask;
-	long dist;
-	void *mmio = pe->mmio_base;
-	struct pdc_host_priv *hpriv = pe->private_data;
-	void *dimm_mmio = hpriv->dimm_mmio;
-
-	/* hard-code chip #0 */   
-	mmio += PDC_CHIP0_OFS;
-
-	page_mask = 0x00;	
-   	window_size = 0x2000 * 4;       /* 32K byte uchar size */  
-	idx = (u16) (offset / window_size);
-
-	writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
-	readl(mmio + PDC_DIMM_WINDOW_CTLR);
-	offset -= (idx * window_size); 
-	idx++;
-	dist = ((long) (window_size - (offset + size))) >= 0 ? size : 
-		(long) (window_size - offset);
-	memcpy_toio((char *) (dimm_mmio + offset / 4), (char *) psource, dist);
-	writel(0x01, mmio + PDC_GENERAL_CTLR);
-	readl(mmio + PDC_GENERAL_CTLR);
-
-	psource += dist;    
-	size -= dist;
-	for (; (long) size >= (long) window_size ;) {
-		writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
-		readl(mmio + PDC_DIMM_WINDOW_CTLR);
-		memcpy_toio((char *) (dimm_mmio), (char *) psource, 
-			    window_size / 4);
-		writel(0x01, mmio + PDC_GENERAL_CTLR);
-		readl(mmio + PDC_GENERAL_CTLR);
-		psource += window_size;
-		size -= window_size;
-		idx ++;
-	}
-    
-	if (size) {
-		writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
-		readl(mmio + PDC_DIMM_WINDOW_CTLR);
-		memcpy_toio((char *) (dimm_mmio), (char *) psource, size / 4);
-		writel(0x01, mmio + PDC_GENERAL_CTLR);
-		readl(mmio + PDC_GENERAL_CTLR);
-	}
-}
-
-
-static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, u32 device, 
-				      u32 subaddr, u32 *pdata)
-{
-	void *mmio = pe->mmio_base;
-	u32 i2creg  = 0;
-	u32 status;     
-	u32 count =0;
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	i2creg |= device << 24;
-	i2creg |= subaddr << 16;
-
-	/* Set the device and subaddress */
-	writel(i2creg, mmio + PDC_I2C_ADDR_DATA_OFFSET);
-	readl(mmio + PDC_I2C_ADDR_DATA_OFFSET);
-
-	/* Write Control to perform read operation, mask int */
-	writel(PDC_I2C_READ | PDC_I2C_START | PDC_I2C_MASK_INT, 
-	       mmio + PDC_I2C_CONTROL_OFFSET);
-
-	for (count = 0; count <= 1000; count ++) {
-		status = readl(mmio + PDC_I2C_CONTROL_OFFSET);
-		if (status & PDC_I2C_COMPLETE) {
-			status = readl(mmio + PDC_I2C_ADDR_DATA_OFFSET);
-			break;
-		} else if (count == 1000)
-			return 0;
-	}
-
-	*pdata = (status >> 8) & 0x000000ff;
-	return 1;           
-}
-
-
-static int pdc20621_detect_dimm(struct ata_probe_ent *pe)
-{
-	u32 data=0 ;
-  	if (pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 
-			     PDC_DIMM_SPD_SYSTEM_FREQ, &data)) {
-   		if (data == 100)
-			return 100;
-  	} else
-		return 0;
- 	
-   	if (pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 9, &data)) {
-		if(data <= 0x75) 
-			return 133;
-   	} else
-		return 0;
-   	
-   	return 0;
-}
-
-
-static int pdc20621_prog_dimm0(struct ata_probe_ent *pe)
-{
-	u32 spd0[50];
-	u32 data = 0;
-   	int size, i;
-   	u8 bdimmsize; 
-   	void *mmio = pe->mmio_base;
-	static const struct {
-		unsigned int reg;
-		unsigned int ofs;
-	} pdc_i2c_read_data [] = {
-		{ PDC_DIMM_SPD_TYPE, 11 },		
-		{ PDC_DIMM_SPD_FRESH_RATE, 12 },
-		{ PDC_DIMM_SPD_COLUMN_NUM, 4 }, 
-		{ PDC_DIMM_SPD_ATTRIBUTE, 21 },
-		{ PDC_DIMM_SPD_ROW_NUM, 3 },
-		{ PDC_DIMM_SPD_BANK_NUM, 17 },
-		{ PDC_DIMM_SPD_MODULE_ROW, 5 },
-		{ PDC_DIMM_SPD_ROW_PRE_CHARGE, 27 },
-		{ PDC_DIMM_SPD_ROW_ACTIVE_DELAY, 28 },
-		{ PDC_DIMM_SPD_RAS_CAS_DELAY, 29 },
-		{ PDC_DIMM_SPD_ACTIVE_PRECHARGE, 30 },
-		{ PDC_DIMM_SPD_CAS_LATENCY, 18 },       
-	};
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	for(i=0; i<ARRAY_SIZE(pdc_i2c_read_data); i++)
-		pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS,
-				  pdc_i2c_read_data[i].reg, 
-				  &spd0[pdc_i2c_read_data[i].ofs]);
-  
-   	data |= (spd0[4] - 8) | ((spd0[21] != 0) << 3) | ((spd0[3]-11) << 4);
-   	data |= ((spd0[17] / 4) << 6) | ((spd0[5] / 2) << 7) | 
-		((((spd0[27] + 9) / 10) - 1) << 8) ;
-   	data |= (((((spd0[29] > spd0[28]) 
-		    ? spd0[29] : spd0[28]) + 9) / 10) - 1) << 10; 
-   	data |= ((spd0[30] - spd0[29] + 9) / 10 - 2) << 12;
-   
-   	if (spd0[18] & 0x08) 
-		data |= ((0x03) << 14);
-   	else if (spd0[18] & 0x04)
-		data |= ((0x02) << 14);
-   	else if (spd0[18] & 0x01)
-		data |= ((0x01) << 14);
-   	else
-		data |= (0 << 14);
-
-  	/* 
-	   Calculate the size of bDIMMSize (power of 2) and
-	   merge the DIMM size by program start/end address.
-	*/
-
-   	bdimmsize = spd0[4] + (spd0[5] / 2) + spd0[3] + (spd0[17] / 2) + 3;
-   	size = (1 << bdimmsize) >> 20;	/* size = xxx(MB) */
-   	data |= (((size / 16) - 1) << 16);
-   	data |= (0 << 23);
-	data |= 8;
-   	writel(data, mmio + PDC_DIMM0_CONTROL_OFFSET); 
-	readl(mmio + PDC_DIMM0_CONTROL_OFFSET);
-   	return size;                          
-}
-
-
-static unsigned int pdc20621_prog_dimm_global(struct ata_probe_ent *pe)
-{
-	u32 data, spd0;
-   	int error, i;
-   	void *mmio = pe->mmio_base;
-
-	/* hard-code chip #0 */
-   	mmio += PDC_CHIP0_OFS;
-
-   	/*
-	  Set To Default : DIMM Module Global Control Register (0x022259F1)
-	  DIMM Arbitration Disable (bit 20)
-	  DIMM Data/Control Output Driving Selection (bit12 - bit15)
-	  Refresh Enable (bit 17)
-	*/
-
-	data = 0x022259F1;   
-	writel(data, mmio + PDC_SDRAM_CONTROL_OFFSET);
-	readl(mmio + PDC_SDRAM_CONTROL_OFFSET);
-
-	/* Turn on for ECC */
-	pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 
-			  PDC_DIMM_SPD_TYPE, &spd0);
-	if (spd0 == 0x02) {
-		data |= (0x01 << 16);
-		writel(data, mmio + PDC_SDRAM_CONTROL_OFFSET);
-		readl(mmio + PDC_SDRAM_CONTROL_OFFSET);
-		printk(KERN_ERR "Local DIMM ECC Enabled\n");
-   	}
-
-   	/* DIMM Initialization Select/Enable (bit 18/19) */
-   	data &= (~(1<<18));
-   	data |= (1<<19);
-   	writel(data, mmio + PDC_SDRAM_CONTROL_OFFSET);
-
-   	error = 1;                     
-   	for (i = 1; i <= 10; i++) {   /* polling ~5 secs */
-		data = readl(mmio + PDC_SDRAM_CONTROL_OFFSET);
-		if (!(data & (1<<19))) {
-	   		error = 0;
-	   		break;     
-		}
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout((i * 100) * HZ / 1000);
-   	}
-   	return error;
-}
-	
-
-static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe)
-{
-	int speed, size, length; 
-	u32 addr,spd0,pci_status;
-	u32 tmp=0;
-	u32 time_period=0;
-	u32 tcount=0;
-	u32 ticks=0;
-	u32 clock=0;
-	u32 fparam=0;
-   	void *mmio = pe->mmio_base;
-
-	/* hard-code chip #0 */
-   	mmio += PDC_CHIP0_OFS;
-
-	/* Initialize PLL based upon PCI Bus Frequency */
-
-	/* Initialize Time Period Register */
-	writel(0xffffffff, mmio + PDC_TIME_PERIOD);
-	time_period = readl(mmio + PDC_TIME_PERIOD);
-	VPRINTK("Time Period Register (0x40): 0x%x\n", time_period);
-
-	/* Enable timer */
-	writel(0x00001a0, mmio + PDC_TIME_CONTROL);
-	readl(mmio + PDC_TIME_CONTROL);
-
-	/* Wait 3 seconds */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(3 * HZ);
-
-	/* 
-	   When timer is enabled, counter is decreased every internal
-	   clock cycle.
-	*/
-
-	tcount = readl(mmio + PDC_TIME_COUNTER);
-	VPRINTK("Time Counter Register (0x44): 0x%x\n", tcount);
-
-	/* 
-	   If SX4 is on PCI-X bus, after 3 seconds, the timer counter
-	   register should be >= (0xffffffff - 3x10^8).
-	*/
-	if(tcount >= PCI_X_TCOUNT) {
-		ticks = (time_period - tcount);
-		VPRINTK("Num counters 0x%x (%d)\n", ticks, ticks);
-	
-		clock = (ticks / 300000);
-		VPRINTK("10 * Internal clk = 0x%x (%d)\n", clock, clock);
-		
-		clock = (clock * 33);
-		VPRINTK("10 * Internal clk * 33 = 0x%x (%d)\n", clock, clock);
-
-		/* PLL F Param (bit 22:16) */
-		fparam = (1400000 / clock) - 2;
-		VPRINTK("PLL F Param: 0x%x (%d)\n", fparam, fparam);
-		
-		/* OD param = 0x2 (bit 31:30), R param = 0x5 (bit 29:25) */
-		pci_status = (0x8a001824 | (fparam << 16));
-	} else
-		pci_status = PCI_PLL_INIT;
-
-	/* Initialize PLL. */
-	VPRINTK("pci_status: 0x%x\n", pci_status);
-	writel(pci_status, mmio + PDC_CTL_STATUS);
-	readl(mmio + PDC_CTL_STATUS);
-
-	/* 
-	   Read SPD of DIMM by I2C interface,
-	   and program the DIMM Module Controller.
-	*/
- 	if (!(speed = pdc20621_detect_dimm(pe))) {
-		printk(KERN_ERR "Detect Local DIMM Fail\n");  
-		return 1;	/* DIMM error */
-   	}
-   	VPRINTK("Local DIMM Speed = %d\n", speed);
-
-   	/* Programming DIMM0 Module Control Register (index_CID0:80h) */ 
-   	size = pdc20621_prog_dimm0(pe);
-   	VPRINTK("Local DIMM Size = %dMB\n",size);
-
-   	/* Programming DIMM Module Global Control Register (index_CID0:88h) */ 
-   	if (pdc20621_prog_dimm_global(pe)) {
-		printk(KERN_ERR "Programming DIMM Module Global Control Register Fail\n");
-		return 1;
-   	}
-
-#ifdef ATA_VERBOSE_DEBUG
-	{
-		u8 test_parttern1[40] = {0x55,0xAA,'P','r','o','m','i','s','e',' ',
-  				'N','o','t',' ','Y','e','t',' ','D','e','f','i','n','e','d',' ',
- 				 '1','.','1','0',
-  				'9','8','0','3','1','6','1','2',0,0};
-		u8 test_parttern2[40] = {0};
-
-		pdc20621_put_to_dimm(pe, (void *) test_parttern2, 0x10040, 40);
-		pdc20621_put_to_dimm(pe, (void *) test_parttern2, 0x40, 40);
-
-		pdc20621_put_to_dimm(pe, (void *) test_parttern1, 0x10040, 40);
-		pdc20621_get_from_dimm(pe, (void *) test_parttern2, 0x40, 40);
-		printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], 
-		       test_parttern2[1], &(test_parttern2[2]));
-		pdc20621_get_from_dimm(pe, (void *) test_parttern2, 0x10040, 
-				       40);
-		printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], 
-		       test_parttern2[1], &(test_parttern2[2]));
-
-		pdc20621_put_to_dimm(pe, (void *) test_parttern1, 0x40, 40);
-		pdc20621_get_from_dimm(pe, (void *) test_parttern2, 0x40, 40);
-		printk(KERN_ERR "%x, %x, %s\n", test_parttern2[0], 
-		       test_parttern2[1], &(test_parttern2[2]));
-	}
-#endif
-
-	/* ECC initiliazation. */
-
-	pdc20621_i2c_read(pe, PDC_DIMM0_SPD_DEV_ADDRESS, 
-			  PDC_DIMM_SPD_TYPE, &spd0);
-	if (spd0 == 0x02) {
-		VPRINTK("Start ECC initialization\n");
-		addr = 0;
-		length = size * 1024 * 1024;
-		while (addr < length) {
-			pdc20621_put_to_dimm(pe, (void *) &tmp, addr, 
-					     sizeof(u32));
-			addr += sizeof(u32);
-		}
-		VPRINTK("Finish ECC initialization\n");
-	}
-	return 0;
-}
-
-
-static void pdc_20621_init(struct ata_probe_ent *pe)
-{
-	u32 tmp;
-	void *mmio = pe->mmio_base;
-
-	/* hard-code chip #0 */
-	mmio += PDC_CHIP0_OFS;
-
-	/*
-	 * Select page 0x40 for our 32k DIMM window
-	 */
-	tmp = readl(mmio + PDC_20621_DIMM_WINDOW) & 0xffff0000;
-	tmp |= PDC_PAGE_WINDOW;	/* page 40h; arbitrarily selected */
-	writel(tmp, mmio + PDC_20621_DIMM_WINDOW);
-
-	/*
-	 * Reset Host DMA
-	 */
-	tmp = readl(mmio + PDC_HDMA_CTLSTAT);
-	tmp |= PDC_RESET;
-	writel(tmp, mmio + PDC_HDMA_CTLSTAT);
-	readl(mmio + PDC_HDMA_CTLSTAT);		/* flush */
-
-	udelay(10);
-
-	tmp = readl(mmio + PDC_HDMA_CTLSTAT);
-	tmp &= ~PDC_RESET;
-	writel(tmp, mmio + PDC_HDMA_CTLSTAT);
-	readl(mmio + PDC_HDMA_CTLSTAT);		/* flush */
-}
-
 static void pdc_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
 {
 	void *mmio = pe->mmio_base;
 	u32 tmp;
 
-	if (chip_id == board_20621)
-		BUG();
-
 	/*
 	 * Except for the hotplug stuff, this is voodoo from the
 	 * Promise driver.  Label this entire section
@@ -1687,7 +519,7 @@ static void pdc_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
 
 	readl(mmio + PDC_TBG_MODE);	/* flush */
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(msecs_to_jiffies(10));
+	schedule_timeout(msecs_to_jiffies(10) + 1);
 
 	/* adjust slew rate control register. */
 	tmp = readl(mmio + PDC_SLEW_CTL);
@@ -1701,10 +533,8 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
 	static int printed_version;
 	struct ata_probe_ent *probe_ent = NULL;
 	unsigned long base;
-	void *mmio_base, *dimm_mmio = NULL;
-	struct pdc_host_priv *hpriv = NULL;
+	void *mmio_base;
 	unsigned int board_idx = (unsigned int) ent->driver_data;
-	unsigned int have_20621 = (board_idx == board_20621);
 	int rc;
 
 	if (!printed_version++)
@@ -1747,25 +577,6 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
 	}
 	base = (unsigned long) mmio_base;
 
-	if (have_20621) {
-		hpriv = kmalloc(sizeof(*hpriv), GFP_KERNEL);
-		if (!hpriv) {
-			rc = -ENOMEM;
-			goto err_out_iounmap;
-		}
-		memset(hpriv, 0, sizeof(*hpriv));
-
-		dimm_mmio = ioremap(pci_resource_start(pdev, 4),
-				    pci_resource_len(pdev, 4));
-		if (!dimm_mmio) {
-			kfree(hpriv);
-			rc = -ENOMEM;
-			goto err_out_iounmap;
-		}
-
-		hpriv->dimm_mmio = dimm_mmio;
-	}
-
 	probe_ent->sht		= pdc_port_info[board_idx].sht;
 	probe_ent->host_flags	= pdc_port_info[board_idx].host_flags;
 	probe_ent->pio_mask	= pdc_port_info[board_idx].pio_mask;
@@ -1776,32 +587,22 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
        	probe_ent->irq_flags = SA_SHIRQ;
 	probe_ent->mmio_base = mmio_base;
 
-	if (have_20621) {
-		probe_ent->private_data = hpriv;
-		base += PDC_CHIP0_OFS;
-	}
-
 	pdc_sata_setup_port(&probe_ent->port[0], base + 0x200);
 	pdc_sata_setup_port(&probe_ent->port[1], base + 0x280);
 
-	if (!have_20621) {
-		probe_ent->port[0].scr_addr = base + 0x400;
-		probe_ent->port[1].scr_addr = base + 0x500;
-	}
+	probe_ent->port[0].scr_addr = base + 0x400;
+	probe_ent->port[1].scr_addr = base + 0x500;
 
 	/* notice 4-port boards */
 	switch (board_idx) {
 	case board_20319:
-	case board_20621:
        		probe_ent->n_ports = 4;
 
 		pdc_sata_setup_port(&probe_ent->port[2], base + 0x300);
 		pdc_sata_setup_port(&probe_ent->port[3], base + 0x380);
 
-		if (!have_20621) {
-			probe_ent->port[2].scr_addr = base + 0x600;
-			probe_ent->port[3].scr_addr = base + 0x700;
-		}
+		probe_ent->port[2].scr_addr = base + 0x600;
+		probe_ent->port[3].scr_addr = base + 0x700;
 		break;
 	case board_2037x:
        		probe_ent->n_ports = 2;
@@ -1814,15 +615,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
 	pci_set_master(pdev);
 
 	/* initialize adapter */
-	if (have_20621) {
-		/* initialize local dimm */
-		if (pdc20621_dimm_init(probe_ent)) {
-			rc = -ENOMEM;
-			goto err_out_iounmap_dimm;
-		}
-		pdc_20621_init(probe_ent);
-	} else
-		pdc_host_init(board_idx, probe_ent);
+	pdc_host_init(board_idx, probe_ent);
 
 	/* FIXME: check ata_device_add return value */
 	ata_device_add(probe_ent);
@@ -1830,11 +623,6 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
 
 	return 0;
 
-err_out_iounmap_dimm:		/* only get to this label if 20621 */
-	kfree(hpriv);
-	iounmap(dimm_mmio);
-err_out_iounmap:
-	iounmap(mmio_base);
 err_out_free_ent:
 	kfree(probe_ent);
 err_out_regions:
@@ -1858,7 +646,7 @@ static void __exit pdc_sata_exit(void)
 
 
 MODULE_AUTHOR("Jeff Garzik");
-MODULE_DESCRIPTION("Promise SATA low-level driver");
+MODULE_DESCRIPTION("Promise SATA TX2/TX4 low-level driver");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, pdc_sata_pci_tbl);
 
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 219dcef7d..33ae676e2 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -1,5 +1,9 @@
 /*
- *  ata_sil.c - Silicon Image SATA
+ *  sata_sil.c - Silicon Image SATA
+ *
+ *  Maintained by:  Jeff Garzik <jgarzik@pobox.com>
+ *  		    Please ALWAYS copy linux-ide@vger.kernel.org
+ *		    on emails.
  *
  *  Copyright 2003 Red Hat, Inc.
  *  Copyright 2003 Benjamin Herrenschmidt <benh@kernel.crashing.org>
@@ -30,7 +34,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #define DRV_NAME	"sata_sil"
@@ -125,6 +129,7 @@ static struct ata_port_operations sil_ops = {
 	.exec_command		= ata_exec_command_mmio,
 	.phy_reset		= sata_phy_reset,
 	.post_set_mode		= sil_post_set_mode,
+	.bmdma_setup            = ata_bmdma_setup_mmio,
 	.bmdma_start            = ata_bmdma_start_mmio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
@@ -262,7 +267,7 @@ static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
  *
  *	20040111 - Seagate drives affected by the Mod15Write bug are blacklisted
  *	The Maxtor quirk is in the blacklist, but I'm keeping the original
- *	pessimistic fix for the following reasons:
+ *	pessimistic fix for the following reasons...
  *	- There seems to be less info on it, only one device gleaned off the
  *	Windows	driver, maybe only one is affected.  More info would be greatly
  *	appreciated.
@@ -271,8 +276,14 @@ static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
 static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
 {
 	unsigned int n, quirks = 0;
-	const char *s = &dev->product[0];
-	unsigned int len = strnlen(s, sizeof(dev->product));
+	unsigned char model_num[40];
+	const char *s;
+	unsigned int len;
+
+	ata_dev_id_string(dev, model_num, ATA_ID_PROD_OFS,
+			  sizeof(model_num));
+	s = &model_num[0];
+	len = strnlen(s, sizeof(model_num));
 
 	/* ATAPI specifies that empty space is blank-filled; remove blanks */
 	while ((len > 0) && (s[len - 1] == ' '))
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index ed45248e3..8965ee281 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -1,6 +1,10 @@
 /*
  *  sata_sis.c - Silicon Integrated Systems SATA
  *
+ *  Maintained by:  Uwe Koziolek
+ *  		    Please ALWAYS copy linux-ide@vger.kernel.org
+ *		    on emails.
+ *
  *  Copyright 2004 Uwe Koziolek
  *
  *  The contents of this file are subject to the Open
@@ -30,7 +34,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #define DRV_NAME	"sata_sis"
@@ -56,7 +60,8 @@ static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg);
 static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
 
 static struct pci_device_id sis_pci_tbl[] = {
-	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 },
+	{ PCI_VENDOR_ID_SI, 0x180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 },
+	{ PCI_VENDOR_ID_SI, 0x181, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 },
 	{ }	/* terminate list */
 };
 
@@ -93,6 +98,7 @@ static struct ata_port_operations sis_ops = {
 	.check_status		= ata_check_status_pio,
 	.exec_command		= ata_exec_command_pio,
 	.phy_reset		= sata_phy_reset,
+	.bmdma_setup            = ata_bmdma_setup_pio,
 	.bmdma_start            = ata_bmdma_start_pio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 59064c6ce..60841abc4 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -1,5 +1,10 @@
 /*
- *  ata_k2.c - Broadcom (Apple K2) SATA
+ *  sata_svw.c - ServerWorks / Apple K2 SATA
+ *
+ *  Maintained by: Benjamin Herrenschmidt <benh@kernel.crashing.org> and
+ *		   Jeff Garzik <jgarzik@pobox.com>
+ *  		    Please ALWAYS copy linux-ide@vger.kernel.org
+ *		    on emails.
  *
  *  Copyright 2003 Benjamin Herrenschmidt <benh@kernel.crashing.org>
  *
@@ -35,7 +40,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #ifdef CONFIG_PPC_OF
@@ -226,6 +231,7 @@ static struct ata_port_operations k2_sata_ops = {
 	.check_status		= k2_stat_check_status,
 	.exec_command		= ata_exec_command_mmio,
 	.phy_reset		= sata_phy_reset,
+	.bmdma_setup            = ata_bmdma_setup_mmio,
 	.bmdma_start            = ata_bmdma_start_mmio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index 75013729e..3268fdf7e 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -826,14 +826,14 @@ out:
 
 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	if (tf->protocol == ATA_PROT_PIO)
+	if (tf->protocol != ATA_PROT_DMA)
 		ata_tf_load_mmio(ap, tf);
 }
 
 
 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	if (tf->protocol == ATA_PROT_PIO)
+	if (tf->protocol != ATA_PROT_DMA)
 		ata_exec_command_mmio(ap, tf);
 }
 
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index 27fe2a842..46d385128 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -1,6 +1,10 @@
 /*
    sata_via.c - VIA Serial ATA controllers
 
+   Maintained by:  Jeff Garzik <jgarzik@pobox.com>
+   		   Please ALWAYS copy linux-ide@vger.kernel.org
+ 		   on emails.
+
    Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
    Copyright 2003-2004 Jeff Garzik
 
@@ -29,7 +33,7 @@
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 #include <asm/io.h>
 
@@ -102,6 +106,7 @@ static struct ata_port_operations svia_sata_ops = {
 
 	.phy_reset		= sata_phy_reset,
 
+	.bmdma_setup            = ata_bmdma_setup_pio,
 	.bmdma_start            = ata_bmdma_start_pio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
@@ -143,17 +148,6 @@ static unsigned long svia_scr_addr(unsigned long addr, unsigned int port)
 	return addr + (port * 128);
 }
 
-/**
- *	svia_init_one -
- *	@pdev:
- *	@ent:
- *
- *	LOCKING:
- *
- *	RETURNS:
- *
- */
-
 static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version;
@@ -284,27 +278,11 @@ err_out:
 	return rc;
 }
 
-/**
- *	svia_init -
- *
- *	LOCKING:
- *
- *	RETURNS:
- *
- */
-
 static int __init svia_init(void)
 {
 	return pci_module_init(&svia_pci_driver);
 }
 
-/**
- *	svia_exit -
- *
- *	LOCKING:
- *
- */
-
 static void __exit svia_exit(void)
 {
 	pci_unregister_driver(&svia_pci_driver);
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index 03691b64b..e0ad17121 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -1,6 +1,10 @@
 /*
  *  sata_vsc.c - Vitesse VSC7174 4 port DPA SATA
  *
+ *  Maintained by:  Jeremy Higdon @ SGI
+ * 		    Please ALWAYS copy linux-ide@vger.kernel.org
+ *		    on emails.
+ *
  *  Copyright 2004 SGI
  *
  *  Bits from Jeff Garzik, Copyright RedHat, Inc.
@@ -18,7 +22,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #define DRV_NAME	"sata_vsc"
@@ -171,7 +175,7 @@ irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance, struct pt_regs *reg
 				struct ata_queued_cmd *qc;
 
 				qc = ata_qc_from_tag(ap, ap->active_tag);
-				if (qc && ((qc->flags & ATA_QCFLAG_POLL) == 0))
+				if (qc && (!(qc->tf.ctl & ATA_NIEN)))
 					handled += ata_host_intr(ap, qc);
 			}
 		}
@@ -209,6 +213,7 @@ static struct ata_port_operations vsc_sata_ops = {
 	.exec_command		= ata_exec_command_mmio,
 	.check_status		= ata_check_status_mmio,
 	.phy_reset		= sata_phy_reset,
+	.bmdma_setup            = ata_bmdma_setup_mmio,
 	.bmdma_start            = ata_bmdma_start_mmio,
 	.fill_sg		= ata_fill_sg,
 	.eng_timeout		= ata_eng_timeout,
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 4cff61bf9..12f81878f 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -977,8 +977,6 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)
  */
 int scsi_device_get(struct scsi_device *sdev)
 {
-	if(!sdev)
-		return -ENXIO;
 	if (sdev->sdev_state == SDEV_DEL || sdev->sdev_state == SDEV_CANCEL)
 		return -ENXIO;
 	if (!get_device(&sdev->sdev_gendev))
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 25c87cc6d..da7dfb3d9 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -1461,7 +1461,7 @@ static ssize_t sdebug_add_host_store(struct device_driver * ddp,
 DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show, 
 	    sdebug_add_host_store)
 
-static void do_create_driverfs_files()
+static void do_create_driverfs_files(void)
 {
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay);
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts);
@@ -1473,7 +1473,7 @@ static void do_create_driverfs_files()
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host);
 }
 
-static void do_remove_driverfs_files()
+static void do_remove_driverfs_files(void)
 {
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host);
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_scsi_level);
@@ -1594,7 +1594,7 @@ static void sdebug_release_adapter(struct device * dev)
         kfree(sdbg_host);
 }
 
-static int sdebug_add_adapter()
+static int sdebug_add_adapter(void)
 {
 	int k, devs_per_host;
         int error = 0;
@@ -1657,7 +1657,7 @@ clean:
         return error;
 }
 
-static void sdebug_remove_adapter()
+static void sdebug_remove_adapter(void)
 {
         struct sdebug_host_info * sdbg_host = NULL;
 
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index dfa5ac1ce..cb97efc6c 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -433,7 +433,7 @@ stop_output:
  * To add a black/white list entry for vendor and model with an integer
  * value of flag to the scsi device info list.
  */
-static int proc_scsi_devinfo_write(struct file *file, const char *buf,
+static int proc_scsi_devinfo_write(struct file *file, const char __user *buf,
 				   unsigned long length, void *data)
 {
 	char *buffer;
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 53d4b5dd5..03390c078 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -42,14 +42,14 @@
  * (int *) arg
  */
 
-static int ioctl_probe(struct Scsi_Host *host, void *buffer)
+static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
 {
 	unsigned int len, slen;
 	const char *string;
 	int temp = host->hostt->present;
 
 	if (temp && buffer) {
-		if (get_user(len, (unsigned int *) buffer))
+		if (get_user(len, (unsigned int __user *) buffer))
 			return -EFAULT;
 
 		if (host->hostt->info)
@@ -204,11 +204,11 @@ int scsi_set_medium_removal(struct scsi_device *sdev, char state)
 #define OMAX_SB_LEN 16		/* Old sense buffer length */
 
 int scsi_ioctl_send_command(struct scsi_device *sdev,
-			    struct scsi_ioctl_command *sic)
+			    struct scsi_ioctl_command __user *sic)
 {
 	char *buf;
 	unsigned char cmd[MAX_COMMAND_SIZE];
-	char *cmd_in;
+	char __user *cmd_in;
 	struct scsi_request *sreq;
 	unsigned char opcode;
 	unsigned int inlen, outlen, cmdlen;
@@ -361,7 +361,7 @@ error:
  *                  device)
  *          any copy_to_user() error on failure there
  */
-static int scsi_ioctl_get_pci(struct scsi_device *sdev, void *arg)
+static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg)
 {
 	struct device *dev = scsi_get_device(sdev->host);
 
@@ -376,7 +376,7 @@ static int scsi_ioctl_get_pci(struct scsi_device *sdev, void *arg)
  * not take a major/minor number as the dev field.  Rather, it takes
  * a pointer to a scsi_devices[] element, a structure. 
  */
-int scsi_ioctl(struct scsi_device *sdev, int cmd, void *arg)
+int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
 {
 	char scsi_cmd[MAX_COMMAND_SIZE];
 
@@ -402,19 +402,18 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void *arg)
 			 + ((sdev->lun & 0xff) << 8)
 			 + ((sdev->channel & 0xff) << 16)
 			 + ((sdev->host->host_no & 0xff) << 24),
-			 &((struct scsi_idlun *)arg)->dev_id);
+			 &((struct scsi_idlun __user *)arg)->dev_id);
 		__put_user(sdev->host->unique_id,
-			 &((struct scsi_idlun *)arg)->host_unique_id);
+			 &((struct scsi_idlun __user *)arg)->host_unique_id);
 		return 0;
 	case SCSI_IOCTL_GET_BUS_NUMBER:
-		return put_user(sdev->host->host_no, (int *)arg);
+		return put_user(sdev->host->host_no, (int __user *)arg);
 	case SCSI_IOCTL_PROBE_HOST:
 		return ioctl_probe(sdev->host, arg);
 	case SCSI_IOCTL_SEND_COMMAND:
 		if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
 			return -EACCES;
-		return scsi_ioctl_send_command(sdev,
-				(struct scsi_ioctl_command *)arg);
+		return scsi_ioctl_send_command(sdev, arg);
 	case SCSI_IOCTL_DOORLOCK:
 		return scsi_set_medium_removal(sdev, SCSI_REMOVAL_PREVENT);
 	case SCSI_IOCTL_DOORUNLOCK:
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 48b4717e8..f77d2e8c7 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1610,7 +1610,9 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 
 	case SDEV_CANCEL:
 		switch (oldstate) {
+		case SDEV_CREATED:
 		case SDEV_RUNNING:
+		case SDEV_OFFLINE:
 			break;
 		default:
 			goto illegal;
@@ -1619,9 +1621,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 
 	case SDEV_DEL:
 		switch (oldstate) {
-		case SDEV_CREATED:
 		case SDEV_CANCEL:
-		case SDEV_OFFLINE:
 			break;
 		default:
 			goto illegal;
diff --git a/drivers/scsi/scsi_logging.h b/drivers/scsi/scsi_logging.h
index 56589d704..e1722ba94 100644
--- a/drivers/scsi/scsi_logging.h
+++ b/drivers/scsi/scsi_logging.h
@@ -46,7 +46,7 @@ extern unsigned int scsi_logging_level;
 
 #define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD)		\
 {								\
-        if ((SCSI_LOG_LEVEL(SHIFT, BITS)) > (LEVEL))		\
+        if (unlikely((SCSI_LOG_LEVEL(SHIFT, BITS)) > (LEVEL)))	\
 		(CMD);						\
 }
 #else
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 126225bcb..00e160ac4 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -54,7 +54,7 @@ static int proc_scsi_read(char *buffer, char **start, off_t offset,
 	return n;
 }
 
-static int proc_scsi_write_proc(struct file *file, const char *buf,
+static int proc_scsi_write_proc(struct file *file, const char __user *buf,
                            unsigned long count, void *data)
 {
 	struct Scsi_Host *shost = data;
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 370afffe6..699d274b6 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -80,7 +80,6 @@ module_param_named(max_luns, max_scsi_luns, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(max_luns,
 		 "last scsi LUN (should be between 1 and 2^32-1)");
 
-#ifdef CONFIG_SCSI_REPORT_LUNS
 /*
  * max_scsi_report_luns: the maximum number of LUNS that will be
  * returned from the REPORT LUNS command. 8 times this value must
@@ -88,13 +87,19 @@ MODULE_PARM_DESC(max_luns,
  * in practice, the maximum number of LUNs suppored by any device
  * is about 16k.
  */
-static unsigned int max_scsi_report_luns = 128;
+static unsigned int max_scsi_report_luns = 511;
 
 module_param_named(max_report_luns, max_scsi_report_luns, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(max_report_luns,
 		 "REPORT LUNS maximum number of LUNS received (should be"
 		 " between 1 and 16384)");
-#endif
+
+static unsigned int scsi_inq_timeout = SCSI_TIMEOUT/HZ+3;
+
+module_param_named(inq_timeout, scsi_inq_timeout, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(inq_timeout, 
+		 "Timeout (in seconds) waiting for devices to answer INQUIRY."
+		 " Default is 5. Some non-compliant devices need more.");
 
 /**
  * scsi_unlock_floptical - unlock device via a special MODE SENSE command
@@ -212,6 +217,11 @@ static struct scsi_device *scsi_alloc_sdev(struct Scsi_Host *shost,
 	INIT_LIST_HEAD(&sdev->starved_entry);
 	spin_lock_init(&sdev->list_lock);
 
+
+	/* if the device needs this changing, it may do so in the
+	 * slave_configure function */
+	sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
+
 	/*
 	 * Some low level driver could use device->type
 	 */
@@ -330,6 +340,7 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result,
 	struct scsi_device *sdev = sreq->sr_device;	/* a bit ugly */
 	unsigned char scsi_cmd[MAX_COMMAND_SIZE];
 	int possible_inq_resp_len;
+	int count = 0;
 
 	*bflags = 0;
  repeat_inquiry:
@@ -345,24 +356,29 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result,
 
 	memset(inq_result, 0, 36);
 	scsi_wait_req(sreq, (void *) scsi_cmd, (void *) inq_result, 36,
-		      SCSI_TIMEOUT + 4 * HZ, 3);
+		      HZ/2 + HZ*scsi_inq_timeout, 3);
 
 	SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: 1st INQUIRY %s with"
 			" code 0x%x\n", sreq->sr_result ?
 			"failed" : "successful", sreq->sr_result));
+	++count;
 
 	if (sreq->sr_result) {
 		if ((driver_byte(sreq->sr_result) & DRIVER_SENSE) != 0 &&
 		    (sreq->sr_sense_buffer[2] & 0xf) == UNIT_ATTENTION &&
-		    sreq->sr_sense_buffer[12] == 0x28 &&
+		    (sreq->sr_sense_buffer[12] == 0x28 ||
+		     sreq->sr_sense_buffer[12] == 0x29) &&
 		    sreq->sr_sense_buffer[13] == 0) {
-			/* not-ready to ready transition - good */
+			/* not-ready to ready transition or power-on - good */
 			/* dpg: bogus? INQUIRY never returns UNIT_ATTENTION */
-		} else
-			/*
-			 * assume no peripheral if any other sort of error
-			 */
-			return;
+			/* Supposedly, but many buggy devices do so anyway */
+			if (count < 3)
+				goto repeat_inquiry;
+		}
+		/*
+		 * assume no peripheral if any other sort of error
+		 */
+		return;
 	}
 
 	/*
@@ -394,7 +410,7 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result,
 		memset(inq_result, 0, possible_inq_resp_len);
 		scsi_wait_req(sreq, (void *) scsi_cmd,
 			      (void *) inq_result,
-			      possible_inq_resp_len, SCSI_TIMEOUT + 4 * HZ, 3);
+			      possible_inq_resp_len, (1+scsi_inq_timeout)*(HZ/2), 3);
 		SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: 2nd INQUIRY"
 				" %s with code 0x%x\n", sreq->sr_result ?
 				"failed" : "successful", sreq->sr_result));
@@ -543,17 +559,12 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
 	 * 011 the same. Stay compatible with previous code, and create a
 	 * Scsi_Device for a PQ of 1
 	 *
-	 * XXX Save the PQ field let the upper layers figure out if they
-	 * want to attach or not to this device, do not set online FALSE;
-	 * otherwise, offline devices still get an sd allocated, and they
-	 * use up an sd slot.
-	 */
-	if (((inq_result[0] >> 5) & 7) == 1) {
-		SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: peripheral"
-				" qualifier of 1, device offlined\n"));
-		scsi_device_set_state(sdev, SDEV_OFFLINE);
-	}
+	 * Don't set the device offline here; rather let the upper
+	 * level drivers eval the PQ to decide whether they should
+	 * attach. So remove ((inq_result[0] >> 5) & 7) == 1 check.
+	 */ 
 
+	sdev->inq_periph_qual = (inq_result[0] >> 5) & 7;
 	sdev->removable = (0x80 & inq_result[1]) >> 7;
 	sdev->lockable = sdev->removable;
 	sdev->soft_reset = (inq_result[7] & 1) && ((inq_result[3] & 7) == 2);
@@ -627,10 +638,6 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
 		spin_unlock_irqrestore(sdev->host->host_lock, flags);
 	}
 
-	/* if the device needs this changing, it may do so in the detect
-	 * function */
-	sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
-
 	sdev->use_10_for_rw = 1;
 
 	if (*bflags & BLIST_MS_SKIP_PAGE_08)
@@ -862,7 +869,6 @@ static void scsi_sequential_lun_scan(struct Scsi_Host *shost, uint channel,
 			return;
 }
 
-#ifdef CONFIG_SCSI_REPORT_LUNS
 /**
  * scsilun_to_int: convert a scsi_lun to an int
  * @scsilun:	struct scsi_lun to be converted.
@@ -923,9 +929,14 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags,
 	u8 *data;
 
 	/*
-	 * Only support SCSI-3 and up devices.
+	 * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
+	 * Also allow SCSI-2 if BLIST_REPORTLUN2 is set and host adapter does
+	 * support more than 8 LUNs.
 	 */
-	if (sdev->scsi_level < SCSI_3)
+	if ((bflags & BLIST_NOREPORTLUN) || 
+	     sdev->scsi_level < SCSI_2 ||
+	    (sdev->scsi_level < SCSI_3 && 
+	     (!(bflags & BLIST_REPORTLUN2) || sdev->host->max_lun <= 8)) )
 		return 1;
 	if (bflags & BLIST_NOLUN)
 		return 0;
@@ -1089,9 +1100,6 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags,
 	printk(ALLOC_FAILURE_MSG, __FUNCTION__);
 	return 0;
 }
-#else
-# define scsi_report_lun_scan(sdev, blags, rescan)	(1)
-#endif	/* CONFIG_SCSI_REPORT_LUNS */
 
 struct scsi_device *scsi_add_device(struct Scsi_Host *shost,
 				    uint channel, uint id, uint lun)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index e212bc18b..fceb6f9a1 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -181,7 +181,8 @@ struct class sdev_class = {
 /* all probing is done in the individual ->probe routines */
 static int scsi_bus_match(struct device *dev, struct device_driver *gendrv)
 {
-	return 1;
+	struct scsi_device *sdp = to_scsi_device(dev);
+	return (sdp->inq_periph_qual == SCSI_INQ_PQ_CON)? 1: 0;
 }
 
 struct bus_type scsi_bus_type = {
@@ -301,6 +302,26 @@ sdev_rd_attr (vendor, "%.8s\n");
 sdev_rd_attr (model, "%.16s\n");
 sdev_rd_attr (rev, "%.4s\n");
 
+static ssize_t
+sdev_show_timeout (struct device *dev, char *buf)
+{
+	struct scsi_device *sdev;
+	sdev = to_scsi_device(dev);
+	return snprintf (buf, 20, "%d\n", sdev->timeout / HZ);
+}
+
+static ssize_t
+sdev_store_timeout (struct device *dev, const char *buf, size_t count)
+{
+	struct scsi_device *sdev;
+	int timeout;
+	sdev = to_scsi_device(dev);
+	sscanf (buf, "%d\n", &timeout);
+	sdev->timeout = timeout * HZ;
+	return count;
+}
+static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout)
+
 static ssize_t
 store_rescan_field (struct device *dev, const char *buf, size_t count) 
 {
@@ -367,6 +388,7 @@ static struct device_attribute *scsi_sysfs_sdev_attrs[] = {
 	&dev_attr_rescan,
 	&dev_attr_delete,
 	&dev_attr_state,
+	&dev_attr_timeout,
 	NULL
 };
 
diff --git a/drivers/scsi/scsiiom.c b/drivers/scsi/scsiiom.c
index 5f2fb7627..b9285e51a 100644
--- a/drivers/scsi/scsiiom.c
+++ b/drivers/scsi/scsiiom.c
@@ -15,7 +15,7 @@ dc390_freetag (PDCB pDCB, PSRB pSRB)
 };
 
 
-UCHAR
+static UCHAR
 dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
 {
     UCHAR cmd; UCHAR  disc_allowed, try_sync_nego;
@@ -227,7 +227,7 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 #if DMA_INT
     UCHAR  dstatus;
 #endif
-    DC390_AFLAGS DC390_IFLAGS; //DC390_DFLAGS
+    DC390_IFLAGS;
 
     pACB = (PACB)dev_id;
     for (pACB2 = dc390_pACB_start; (pACB2 && pACB2 != pACB); pACB2 = pACB2->pNextACB);
@@ -237,26 +237,21 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 	return IRQ_NONE;
     }
     
-    //DC390_LOCK_DRV;
-
     sstatus = DC390_read8 (Scsi_Status);
     if( !(sstatus & INTERRUPT) )
-	{ /*DC390_UNLOCK_DRV;*/ return IRQ_NONE; };
+	return IRQ_NONE;
 
     DEBUG1(printk (KERN_DEBUG "sstatus=%02x,", sstatus));
 
 #if DMA_INT
     DC390_LOCK_IO(pACB->pScsiHost);
-    DC390_LOCK_ACB;
     dstatus = dc390_dma_intr (pACB);
-    DC390_UNLOCK_ACB;
     DC390_UNLOCK_IO(pACB->pScsiHost);
 
     DEBUG1(printk (KERN_DEBUG "dstatus=%02x,", dstatus));
     if (! (dstatus & SCSI_INTERRUPT))
       {
 	DEBUG0(printk (KERN_WARNING "DC390 Int w/o SCSI actions (only DMA?)\n"));
-	//DC390_UNLOCK_DRV;
 	return IRQ_NONE;
       };
 #else
@@ -266,8 +261,6 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 #endif
 
     DC390_LOCK_IO(pACB->pScsiHost);
-    DC390_LOCK_ACB;
-    //DC390_UNLOCK_DRV_NI; /* Allow _other_ CPUs to process IRQ (useful for shared IRQs) */
 
     istate = DC390_read8 (Intern_State);
     istatus = DC390_read8 (INT_Status); /* This clears Scsi_Status, Intern_State and INT_Status ! */
@@ -339,14 +332,11 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
     }
 
  unlock:
-    //DC390_LOCK_DRV_NI;
-    DC390_UNLOCK_ACB;
     DC390_UNLOCK_IO(pACB->pScsiHost);
-    //DC390_UNLOCK_DRV; /* Restore initial flags */
     return IRQ_HANDLED;
 }
 
-irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 {
     irqreturn_t ret;
     DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq));
@@ -356,7 +346,7 @@ irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
     return ret;
 }
 
-void
+static void
 dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 {
     UCHAR   sstatus;
@@ -410,7 +400,7 @@ dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
     }	    
 }
 
-void
+static void
 dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 {
     UCHAR   sstatus, residual, bval;
@@ -521,7 +511,7 @@ din_1:
     {
 	    DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
 	    DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */
-    }	    
+    }
 }
 
 static void
@@ -740,9 +730,9 @@ dc390_restore_ptr (PACB pACB, PSRB pSRB)
 	psgl = pSRB->pSegmentList;
 	//dc390_pci_sync(pSRB);
 
-	while (pSRB->TotalXferredLen + (ULONG) psgl->length < pSRB->Saved_Ptr)
+	while (pSRB->TotalXferredLen + (ULONG) sg_dma_len(psgl) < pSRB->Saved_Ptr)
 	{
-	    pSRB->TotalXferredLen += (ULONG) psgl->length;
+	    pSRB->TotalXferredLen += (ULONG) sg_dma_len(psgl);
 	    pSRB->SGIndex++;
 	    if( pSRB->SGIndex < pSRB->SGcount )
 	    {
@@ -762,7 +752,7 @@ dc390_restore_ptr (PACB pACB, PSRB pSRB)
     } else if(pcmd->request_buffer) {
 	//dc390_pci_sync(pSRB);
 
-	pSRB->Segmentx.length = pcmd->request_bufflen - pSRB->Saved_Ptr;
+	sg_dma_len(&pSRB->Segmentx) = pcmd->request_bufflen - pSRB->Saved_Ptr;
 	pSRB->SGcount = 1;
 	pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
     } else {
@@ -873,7 +863,7 @@ dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 }
 
 
-void
+static void
 dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
 {
     PSGL   psgl;
@@ -885,6 +875,8 @@ dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
 	if (pDCB) printk (KERN_ERR "DC390: pSRB == pTmpSRB! (TagQ Error?) (%02i-%i)\n",
 			  pDCB->TargetID, pDCB->TargetLUN);
 	else printk (KERN_ERR "DC390: pSRB == pTmpSRB! (TagQ Error?) (DCB 0!)\n");
+
+	pSRB->pSRBDCB = pDCB;
 	dc390_EnableMsgOut_Abort (pACB, pSRB);
 	if (pDCB) pDCB->DCBFlag |= ABORT_DEV;
 	return;
@@ -1150,7 +1142,6 @@ dc390_Disconnect( PACB pACB )
 	    pSRB = psrb;
 	}
 	pDCB->pGoingSRB = 0;
-	dc390_Query_to_Waiting (pACB);
 	dc390_Waiting_process (pACB);
     }
     else
@@ -1466,7 +1457,7 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
 		ptr2 = pSRB->pSegmentList;
 		for( i=pSRB->SGIndex; i < bval; i++)
 		{
-		    swlval += ptr2->length;
+		    swlval += sg_dma_len(ptr2);
 		    ptr2++;
 		}
 		REMOVABLEDEBUG(printk(KERN_INFO "XferredLen=%08x,NotXferLen=%08x\n",\
@@ -1619,20 +1610,15 @@ ckc_e:
 	  pACB->scan_devices = 0;
      };
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,30)
     pcmd->resid = pcmd->request_bufflen - pSRB->TotalXferredLen;
-#endif
 
     if (!DCB_removed) dc390_Going_remove (pDCB, pSRB);
     /* Add to free list */
     dc390_Free_insert (pACB, pSRB);
 
     DEBUG0(printk (KERN_DEBUG "DC390: SRBdone: done pid %li\n", pcmd->pid));
-    DC390_UNLOCK_ACB_NI;
     pcmd->scsi_done (pcmd);
-    DC390_LOCK_ACB_NI;
 
-    dc390_Query_to_Waiting (pACB);
     dc390_Waiting_process (pACB);
     return;
 }
@@ -1668,9 +1654,7 @@ dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd )
 /*	    ReleaseSRB( pDCB, pSRB ); */
 
 	    DEBUG0(printk (KERN_DEBUG "DC390: DoingSRB_Done: done pid %li\n", pcmd->pid));
-	    DC390_UNLOCK_ACB_NI;
 	    pcmd->scsi_done( pcmd );
-	    DC390_LOCK_ACB_NI;
 #endif	
 	    psrb  = psrb2;
 	}
@@ -1679,7 +1663,6 @@ dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd )
 	pdcb->TagMask = 0;
 	pdcb = pdcb->pNextDCB;
     } while( pdcb != pDCB );
-    dc390_Query_to_Waiting (pACB);
 }
 
 
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 90dd5aee0..9d29d78e1 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -179,7 +179,16 @@ static struct scsi_disk *scsi_disk_get(struct gendisk *disk)
 		goto out;
 	sdkp = scsi_disk(disk);
 	if (!kref_get(&sdkp->kref))
-		sdkp = NULL;
+		goto out_sdkp;
+	if (scsi_device_get(sdkp->device))
+		goto out_put;
+	up(&sd_ref_sem);
+	return sdkp;
+
+ out_put:
+	kref_put(&sdkp->kref);
+ out_sdkp:
+	sdkp = NULL;
  out:
 	up(&sd_ref_sem);
 	return sdkp;
@@ -188,6 +197,7 @@ static struct scsi_disk *scsi_disk_get(struct gendisk *disk)
 static void scsi_disk_put(struct scsi_disk *sdkp)
 {
 	down(&sd_ref_sem);
+	scsi_device_put(sdkp->device);
 	kref_put(&sdkp->kref);
 	up(&sd_ref_sem);
 }
@@ -207,9 +217,7 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
 	sector_t block;
 	struct scsi_device *sdp = SCpnt->device;
 
-	timeout = SD_TIMEOUT;
-	if (SCpnt->device->type != TYPE_DISK)
-		timeout = SD_MOD_TIMEOUT;
+	timeout = sdp->timeout;
 
 	/*
 	 * these are already setup, just copy cdb basically
@@ -503,7 +511,7 @@ static int sd_release(struct inode *inode, struct file *filp)
 	return 0;
 }
 
-static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc)
+static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry __user *loc)
 {
 	struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk);
 	struct scsi_device *sdp = sdkp->device;
@@ -528,7 +536,7 @@ static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc)
 	if (put_user(diskinfo[2], &loc->cylinders))
 		return -EFAULT;
 	if (put_user((unsigned)get_start_sect(bdev),
-	             (unsigned long *)&loc->start))
+	             (unsigned long __user *)&loc->start))
 		return -EFAULT;
 	return 0;
 }
@@ -553,6 +561,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
 	struct block_device *bdev = inode->i_bdev;
 	struct gendisk *disk = bdev->bd_disk;
 	struct scsi_device *sdp = scsi_disk(disk)->device;
+	void __user *p = (void __user *)arg;
 	int error;
     
 	SCSI_LOG_IOCTL(1, printk("sd_ioctl: disk=%s, cmd=0x%x\n",
@@ -570,7 +579,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
 	if (cmd == HDIO_GETGEO) {
 		if (!arg)
 			return -EINVAL;
-		return sd_hdio_getgeo(bdev, (struct hd_geometry *)arg);
+		return sd_hdio_getgeo(bdev, p);
 	}
 
 	/*
@@ -581,13 +590,13 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
 	switch (cmd) {
 		case SCSI_IOCTL_GET_IDLUN:
 		case SCSI_IOCTL_GET_BUS_NUMBER:
-			return scsi_ioctl(sdp, cmd, (void *)arg);
+			return scsi_ioctl(sdp, cmd, p);
 		default:
-			error = scsi_cmd_ioctl(disk, cmd, arg);
+			error = scsi_cmd_ioctl(disk, cmd, p);
 			if (error != -ENOTTY)
 				return error;
 	}
-	return scsi_ioctl(sdp, cmd, (void *)arg);
+	return scsi_ioctl(sdp, cmd, p);
 }
 
 static void set_media_not_present(struct scsi_disk *sdkp)
@@ -1342,16 +1351,13 @@ static int sd_probe(struct device *dev)
 	if ((sdp->type != TYPE_DISK) && (sdp->type != TYPE_MOD))
 		goto out;
 
-	if ((error = scsi_device_get(sdp)) != 0)
-		goto out;
-
 	SCSI_LOG_HLQUEUE(3, printk("sd_attach: scsi device: <%d,%d,%d,%d>\n", 
 			 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun));
 
 	error = -ENOMEM;
 	sdkp = kmalloc(sizeof(*sdkp), GFP_KERNEL);
 	if (!sdkp)
-		goto out_put_sdev;
+		goto out;
 
 	memset (sdkp, 0, sizeof(*sdkp));
 	kref_init(&sdkp->kref, scsi_disk_release);
@@ -1382,6 +1388,13 @@ static int sd_probe(struct device *dev)
 	sdkp->index = index;
 	sdkp->openers = 0;
 
+	if (!sdp->timeout) {
+		if (sdp->type == TYPE_DISK)
+			sdp->timeout = SD_TIMEOUT;
+		else
+			sdp->timeout = SD_MOD_TIMEOUT;
+	}
+
 	devno = make_sd_dev(index, 0);
 	gd->major = MAJOR(devno);
 	gd->first_minor = MINOR(devno);
@@ -1427,8 +1440,6 @@ out_put:
 	put_disk(gd);
 out_free:
 	kfree(sdkp);
-out_put_sdev:
-	scsi_device_put(sdp);
 out:
 	return error;
 }
@@ -1450,7 +1461,9 @@ static int sd_remove(struct device *dev)
 
 	del_gendisk(sdkp->disk);
 	sd_shutdown(dev);
-	scsi_disk_put(sdkp);
+	down(&sd_ref_sem);
+	kref_put(&sdkp->kref);
+	up(&sd_ref_sem);
 
 	return 0;
 }
@@ -1467,7 +1480,6 @@ static int sd_remove(struct device *dev)
 static void scsi_disk_release(struct kref *kref)
 {
 	struct scsi_disk *sdkp = to_scsi_disk(kref);
-	struct scsi_device *sdev = sdkp->device;
 	struct gendisk *disk = sdkp->disk;
 	
 	spin_lock(&sd_index_lock);
@@ -1479,8 +1491,6 @@ static void scsi_disk_release(struct kref *kref)
 	put_disk(disk);
 
 	kfree(sdkp);
-
-	scsi_device_put(sdev);
 }
 
 /*
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 36fa1dd2a..5db8178c3 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -7,7 +7,7 @@
  * Original driver (sg.c):
  *        Copyright (C) 1992 Lawrence Foard
  * Version 2 and 3 extensions to driver:
- *        Copyright (C) 1998 - 2002 Douglas Gilbert
+ *        Copyright (C) 1998 - 2004 Douglas Gilbert
  *
  *  Modified  19-JAN-1998  Richard Gooch <rgooch@atnf.csiro.au>  Devfs support
  *
@@ -17,27 +17,18 @@
  * any later version.
  *
  */
-#include <linux/config.h>
-static int sg_version_num = 30530;	/* 2 digits for each component */
+
+static int sg_version_num = 30531;	/* 2 digits for each component */
+#define SG_VERSION_STR "3.5.31"
+
 /*
  *  D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes:
  *      - scsi logging is available via SCSI_LOG_TIMEOUT macros. First
  *        the kernel/module needs to be built with CONFIG_SCSI_LOGGING
  *        (otherwise the macros compile to empty statements).
- *        Then before running the program to be debugged enter:
- *          # echo "scsi log timeout 7" > /proc/scsi/scsi
- *        This will send copious output to the console and the log which
- *        is usually /var/log/messages. To turn off debugging enter:
- *          # echo "scsi log timeout 0" > /proc/scsi/scsi
- *        The 'timeout' token was chosen because it is relatively unused.
- *        The token 'hlcomplete' should be used but that triggers too
- *        much output from the sd device driver. To dump the current
- *        state of the SCSI mid level data structures enter:
- *          # echo "scsi dump 1" > /proc/scsi/scsi
- *        To dump the state of sg's data structures use:
- *          # cat /proc/scsi/sg/debug
  *
  */
+#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/fs.h>
@@ -69,7 +60,7 @@ static int sg_version_num = 30530;	/* 2 digits for each component */
 
 #ifdef CONFIG_SCSI_PROC_FS
 #include <linux/proc_fs.h>
-static char *sg_version_str = "3.5.30 [20040124]";
+static char *sg_version_date = "20040513";
 
 static int sg_proc_init(void);
 static void sg_proc_cleanup(void);
@@ -110,7 +101,7 @@ static int sg_allow_dio = SG_ALLOW_DIO_DEF;
 #define SG_SECTOR_SZ 512
 #define SG_SECTOR_MSK (SG_SECTOR_SZ - 1)
 
-#define SG_DEV_ARR_LUMP 6	/* amount to over allocate sg_dev_arr by */
+#define SG_DEV_ARR_LUMP 32	/* amount to over allocate sg_dev_arr by */
 
 static int sg_add(struct class_device *);
 static void sg_remove(struct class_device *);
@@ -191,17 +182,17 @@ static void sg_finish_rem_req(Sg_request * srp);
 static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
 static int sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp,
 			 int tablesize);
-static ssize_t sg_new_read(Sg_fd * sfp, char *buf, size_t count,
+static ssize_t sg_new_read(Sg_fd * sfp, char __user *buf, size_t count,
 			   Sg_request * srp);
-static ssize_t sg_new_write(Sg_fd * sfp, const char *buf, size_t count,
+static ssize_t sg_new_write(Sg_fd * sfp, const char __user *buf, size_t count,
 			    int blocking, int read_only, Sg_request ** o_srp);
 static int sg_common_write(Sg_fd * sfp, Sg_request * srp,
 			   unsigned char *cmnd, int timeout, int blocking);
 static int sg_u_iovec(sg_io_hdr_t * hp, int sg_num, int ind,
-		      int wr_xf, int *countp, unsigned char **up);
+		      int wr_xf, int *countp, unsigned char __user **up);
 static int sg_write_xfer(Sg_request * srp);
 static int sg_read_xfer(Sg_request * srp);
-static int sg_read_oxfer(Sg_request * srp, char *outp, int num_read_xfer);
+static int sg_read_oxfer(Sg_request * srp, char __user *outp, int num_read_xfer);
 static void sg_remove_scat(Sg_scatter_hold * schp);
 static void sg_build_reserve(Sg_fd * sfp, int req_size);
 static void sg_link_reserve(Sg_fd * sfp, Sg_request * srp, int size);
@@ -338,7 +329,7 @@ sg_release(struct inode *inode, struct file *filp)
 }
 
 static ssize_t
-sg_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 {
 	int k, res;
 	Sg_device *sdp;
@@ -452,7 +443,7 @@ sg_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
 }
 
 static ssize_t
-sg_new_read(Sg_fd * sfp, char *buf, size_t count, Sg_request * srp)
+sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp)
 {
 	sg_io_hdr_t *hp = &srp->header;
 	int err = 0;
@@ -490,7 +481,7 @@ sg_new_read(Sg_fd * sfp, char *buf, size_t count, Sg_request * srp)
 }
 
 static ssize_t
-sg_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 {
 	int mxsize, cmd_size, k;
 	int input_size, blocking;
@@ -567,7 +558,7 @@ sg_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
 	else
 		hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV : SG_DXFER_NONE;
 	hp->dxfer_len = mxsize;
-	hp->dxferp = (unsigned char *) buf + cmd_size;
+	hp->dxferp = (char __user *)buf + cmd_size;
 	hp->sbp = NULL;
 	hp->timeout = old_hdr.reply_len;	/* structure abuse ... */
 	hp->flags = input_size;	/* structure abuse ... */
@@ -580,7 +571,7 @@ sg_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
 }
 
 static ssize_t
-sg_new_write(Sg_fd * sfp, const char *buf, size_t count,
+sg_new_write(Sg_fd * sfp, const char __user *buf, size_t count,
 	     int blocking, int read_only, Sg_request ** o_srp)
 {
 	int k;
@@ -735,6 +726,8 @@ static int
 sg_ioctl(struct inode *inode, struct file *filp,
 	 unsigned int cmd_in, unsigned long arg)
 {
+	void __user *p = (void __user *)arg;
+	int __user *ip = p;
 	int result, val, read_only;
 	Sg_device *sdp;
 	Sg_fd *sfp;
@@ -756,12 +749,11 @@ sg_ioctl(struct inode *inode, struct file *filp,
 				return -ENODEV;
 			if (!scsi_block_when_processing_errors(sdp->device))
 				return -ENXIO;
-			result = verify_area(VERIFY_WRITE, (void *) arg,
-					SZ_SG_IO_HDR);
+			result = verify_area(VERIFY_WRITE, p, SZ_SG_IO_HDR);
 			if (result)
 				return result;
 			result =
-			    sg_new_write(sfp, (const char *) arg, SZ_SG_IO_HDR,
+			    sg_new_write(sfp, p, SZ_SG_IO_HDR,
 					 blocking, read_only, &srp);
 			if (result < 0)
 				return result;
@@ -781,11 +773,11 @@ sg_ioctl(struct inode *inode, struct file *filp,
 				return result;	/* -ERESTARTSYS because signal hit process */
 			}
 			srp->done = 2;
-			result = sg_new_read(sfp, (char *) arg, SZ_SG_IO_HDR, srp);
+			result = sg_new_read(sfp, p, SZ_SG_IO_HDR, srp);
 			return (result < 0) ? result : 0;
 		}
 	case SG_SET_TIMEOUT:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		if (val < 0)
@@ -800,7 +792,7 @@ sg_ioctl(struct inode *inode, struct file *filp,
 				/* strange ..., for backward compatibility */
 		return sfp->timeout_user;
 	case SG_SET_FORCE_LOW_DMA:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		if (val) {
@@ -817,15 +809,14 @@ sg_ioctl(struct inode *inode, struct file *filp,
 		}
 		return 0;
 	case SG_GET_LOW_DMA:
-		return put_user((int) sfp->low_dma, (int *) arg);
+		return put_user((int) sfp->low_dma, ip);
 	case SG_GET_SCSI_ID:
 		result =
-		    verify_area(VERIFY_WRITE, (void *) arg,
-				sizeof (sg_scsi_id_t));
+		    verify_area(VERIFY_WRITE, p, sizeof (sg_scsi_id_t));
 		if (result)
 			return result;
 		else {
-			sg_scsi_id_t *sg_idp = (sg_scsi_id_t *) arg;
+			sg_scsi_id_t __user *sg_idp = p;
 
 			if (sdp->detached)
 				return -ENODEV;
@@ -845,13 +836,13 @@ sg_ioctl(struct inode *inode, struct file *filp,
 			return 0;
 		}
 	case SG_SET_FORCE_PACK_ID:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		sfp->force_packid = val ? 1 : 0;
 		return 0;
 	case SG_GET_PACK_ID:
-		result = verify_area(VERIFY_WRITE, (void *) arg, sizeof (int));
+		result = verify_area(VERIFY_WRITE, ip, sizeof (int));
 		if (result)
 			return result;
 		read_lock_irqsave(&sfp->rq_list_lock, iflags);
@@ -859,12 +850,12 @@ sg_ioctl(struct inode *inode, struct file *filp,
 			if ((1 == srp->done) && (!srp->sg_io_owned)) {
 				read_unlock_irqrestore(&sfp->rq_list_lock,
 						       iflags);
-				__put_user(srp->header.pack_id, (int *) arg);
+				__put_user(srp->header.pack_id, ip);
 				return 0;
 			}
 		}
 		read_unlock_irqrestore(&sfp->rq_list_lock, iflags);
-		__put_user(-1, (int *) arg);
+		__put_user(-1, ip);
 		return 0;
 	case SG_GET_NUM_WAITING:
 		read_lock_irqsave(&sfp->rq_list_lock, iflags);
@@ -873,11 +864,11 @@ sg_ioctl(struct inode *inode, struct file *filp,
 				++val;
 		}
 		read_unlock_irqrestore(&sfp->rq_list_lock, iflags);
-		return put_user(val, (int *) arg);
+		return put_user(val, ip);
 	case SG_GET_SG_TABLESIZE:
-		return put_user(sdp->sg_tablesize, (int *) arg);
+		return put_user(sdp->sg_tablesize, ip);
 	case SG_SET_RESERVED_SIZE:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
                 if (val < 0)
@@ -891,37 +882,37 @@ sg_ioctl(struct inode *inode, struct file *filp,
 		return 0;
 	case SG_GET_RESERVED_SIZE:
 		val = (int) sfp->reserve.bufflen;
-		return put_user(val, (int *) arg);
+		return put_user(val, ip);
 	case SG_SET_COMMAND_Q:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		sfp->cmd_q = val ? 1 : 0;
 		return 0;
 	case SG_GET_COMMAND_Q:
-		return put_user((int) sfp->cmd_q, (int *) arg);
+		return put_user((int) sfp->cmd_q, ip);
 	case SG_SET_KEEP_ORPHAN:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		sfp->keep_orphan = val;
 		return 0;
 	case SG_GET_KEEP_ORPHAN:
-		return put_user((int) sfp->keep_orphan, (int *) arg);
+		return put_user((int) sfp->keep_orphan, ip);
 	case SG_NEXT_CMD_LEN:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		sfp->next_cmd_len = (val > 0) ? val : 0;
 		return 0;
 	case SG_GET_VERSION_NUM:
-		return put_user(sg_version_num, (int *) arg);
+		return put_user(sg_version_num, ip);
 	case SG_GET_ACCESS_COUNT:
 		/* faked - we don't have a real access count anymore */
 		val = (sdp->device ? 1 : 0);
-		return put_user(val, (int *) arg);
+		return put_user(val, ip);
 	case SG_GET_REQUEST_TABLE:
-		result = verify_area(VERIFY_WRITE, (void *) arg,
+		result = verify_area(VERIFY_WRITE, p,
 				     SZ_SG_REQ_INFO * SG_MAX_QUEUE);
 		if (result)
 			return result;
@@ -949,13 +940,13 @@ sg_ioctl(struct inode *inode, struct file *filp,
 				}
 			}
 			read_unlock_irqrestore(&sfp->rq_list_lock, iflags);
-			return (__copy_to_user((void *) arg, rinfo,
+			return (__copy_to_user(p, rinfo,
 			        SZ_SG_REQ_INFO * SG_MAX_QUEUE) ? -EFAULT : 0);
 		}
 	case SG_EMULATED_HOST:
 		if (sdp->detached)
 			return -ENODEV;
-		return put_user(sdp->device->host->hostt->emulated, (int *) arg);
+		return put_user(sdp->device->host->hostt->emulated, ip);
 	case SG_SCSI_RESET:
 		if (sdp->detached)
 			return -ENODEV;
@@ -965,7 +956,7 @@ sg_ioctl(struct inode *inode, struct file *filp,
 				return -EBUSY;
 		} else if (!scsi_block_when_processing_errors(sdp->device))
 			return -EBUSY;
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		if (SG_SCSI_RESET_NOTHING == val)
@@ -992,16 +983,16 @@ sg_ioctl(struct inode *inode, struct file *filp,
 			return -ENODEV;
 		if (read_only) {
 			unsigned char opcode = WRITE_6;
-			Scsi_Ioctl_Command *siocp = (void *) arg;
+			Scsi_Ioctl_Command __user *siocp = p;
 
 			if (copy_from_user(&opcode, siocp->data, 1))
 				return -EFAULT;
 			if (!sg_allow_access(opcode, sdp->device->type))
 				return -EPERM;
 		}
-		return scsi_ioctl_send_command(sdp->device, (void *) arg);
+		return scsi_ioctl_send_command(sdp->device, p);
 	case SG_SET_DEBUG:
-		result = get_user(val, (int *) arg);
+		result = get_user(val, ip);
 		if (result)
 			return result;
 		sdp->sgdebug = (char) val;
@@ -1012,11 +1003,11 @@ sg_ioctl(struct inode *inode, struct file *filp,
 	case SG_GET_TRANSFORM:
 		if (sdp->detached)
 			return -ENODEV;
-		return scsi_ioctl(sdp->device, cmd_in, (void *) arg);
+		return scsi_ioctl(sdp->device, cmd_in, p);
 	default:
 		if (read_only)
 			return -EPERM;	/* don't know so take safe approach */
-		return scsi_ioctl(sdp->device, cmd_in, (void *) arg);
+		return scsi_ioctl(sdp->device, cmd_in, p);
 	}
 }
 
@@ -1099,10 +1090,10 @@ sg_rb_correct4mmap(Sg_scatter_hold * rsv_schp, int startFinish)
 				page_ptr = sg_scatg2virt(sclp) + m;
 				page = virt_to_page(page_ptr);
 				if (startFinish)
-					atomic_inc(&page->count);
+					get_page(page);
 				else {
 					if (page_count(page) > 0)
-						atomic_dec(&page->count);
+						__put_page(page);
 				}
 			}
 		}
@@ -1111,10 +1102,10 @@ sg_rb_correct4mmap(Sg_scatter_hold * rsv_schp, int startFinish)
 			page_ptr = (unsigned char *) rsv_schp->buffer + m;
 			page = virt_to_page(page_ptr);
 			if (startFinish)
-				atomic_inc(&page->count);
+				get_page(page);
 			else {
 				if (page_count(page) > 0)
-					atomic_dec(&page->count);
+					__put_page(page);
 			}
 		}
 	}
@@ -1333,85 +1324,44 @@ static struct class_simple * sg_sysfs_class;
 
 static int sg_sysfs_valid = 0;
 
-static int
-sg_add(struct class_device *cl_dev)
+static int sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 {
-	struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);
-	struct gendisk *disk;
-	Sg_device *sdp = NULL;
+	Sg_device *sdp;
 	unsigned long iflags;
-	struct cdev * cdev = NULL;
+	void *old_sg_dev_arr = NULL;
 	int k, error;
 
-	disk = alloc_disk(1);
-	if (!disk)
+	sdp = vmalloc(sizeof(Sg_device));
+	if (!sdp)
 		return -ENOMEM;
 
-	cdev = cdev_alloc();
-	if (! cdev)
-		return -ENOMEM;
 	write_lock_irqsave(&sg_dev_arr_lock, iflags);
-	if (sg_nr_dev >= sg_dev_max) {	/* try to resize */
+	if (unlikely(sg_nr_dev >= sg_dev_max)) {	/* try to resize */
 		Sg_device **tmp_da;
 		int tmp_dev_max = sg_nr_dev + SG_DEV_ARR_LUMP;
-
 		write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
-		tmp_da = (Sg_device **)vmalloc(
-				tmp_dev_max * sizeof(Sg_device *));
-		if (NULL == tmp_da) {
-			printk(KERN_ERR
-			       "sg_add: device array cannot be resized\n");
-			error = -ENOMEM;
-			goto out;
-		}
+
+		tmp_da = vmalloc(tmp_dev_max * sizeof(Sg_device *));
+		if (unlikely(!tmp_da))
+			goto expand_failed;
+
 		write_lock_irqsave(&sg_dev_arr_lock, iflags);
-		memset(tmp_da, 0, tmp_dev_max * sizeof (Sg_device *));
-		memcpy(tmp_da, sg_dev_arr,
-		       sg_dev_max * sizeof (Sg_device *));
-		vfree((char *) sg_dev_arr);
+		memset(tmp_da, 0, tmp_dev_max * sizeof(Sg_device *));
+		memcpy(tmp_da, sg_dev_arr, sg_dev_max * sizeof(Sg_device *));
+		old_sg_dev_arr = sg_dev_arr;
 		sg_dev_arr = tmp_da;
 		sg_dev_max = tmp_dev_max;
 	}
 
-find_empty_slot:
 	for (k = 0; k < sg_dev_max; k++)
 		if (!sg_dev_arr[k])
 			break;
-	if (k >= SG_MAX_DEVS) {
-		write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
-		printk(KERN_WARNING
-		       "Unable to attach sg device <%d, %d, %d, %d>"
-		       " type=%d, minor number exceeds %d\n",
-		       scsidp->host->host_no, scsidp->channel, scsidp->id,
-		       scsidp->lun, scsidp->type, SG_MAX_DEVS - 1);
-		if (NULL != sdp)
-			vfree((char *) sdp);
-		error = -ENODEV;
-		goto out;
-	}
-	if (k < sg_dev_max) {
-		if (NULL == sdp) {
-			write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
-			sdp = (Sg_device *)vmalloc(sizeof(Sg_device));
-			write_lock_irqsave(&sg_dev_arr_lock, iflags);
-			if (!sg_dev_arr[k])
-				goto find_empty_slot;
-		}
-	} else
-		sdp = NULL;
-	if (NULL == sdp) {
-		write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
-		printk(KERN_ERR "sg_add: Sg_device cannot be allocated\n");
-		error = -ENOMEM;
-		goto out;
-	}
+	if (unlikely(k >= SG_MAX_DEVS))
+		goto overflow;
 
-	SCSI_LOG_TIMEOUT(3, printk("sg_add: dev=%d \n", k));
 	memset(sdp, 0, sizeof(*sdp));
+	SCSI_LOG_TIMEOUT(3, printk("sg_alloc: dev=%d \n", k));
 	sprintf(disk->disk_name, "sg%d", k);
-	cdev->owner = THIS_MODULE;
-	cdev->ops = &sg_fops;
-	disk->major = SCSI_GENERIC_MAJOR;
 	disk->first_minor = k;
 	sdp->disk = disk;
 	sdp->device = scsidp;
@@ -1421,6 +1371,55 @@ find_empty_slot:
 	sg_nr_dev++;
 	sg_dev_arr[k] = sdp;
 	write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
+	error = k;
+
+ out:
+	if (error < 0)
+		vfree(sdp);
+	vfree(old_sg_dev_arr);
+	return error;
+
+ expand_failed:
+	printk(KERN_ERR "sg_alloc: device array cannot be resized\n");
+	error = -ENOMEM;
+	goto out;
+
+ overflow:
+	write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
+	printk(KERN_WARNING
+	       "Unable to attach sg device <%d, %d, %d, %d> type=%d, minor "
+	       "number exceeds %d\n", scsidp->host->host_no, scsidp->channel,
+	       scsidp->id, scsidp->lun, scsidp->type, SG_MAX_DEVS - 1);
+	error = -ENODEV;
+	goto out;
+}
+
+static int
+sg_add(struct class_device *cl_dev)
+{
+	struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);
+	struct gendisk *disk;
+	Sg_device *sdp = NULL;
+	struct cdev * cdev = NULL;
+	int error, k;
+
+	disk = alloc_disk(1);
+	if (!disk)
+		return -ENOMEM;
+	disk->major = SCSI_GENERIC_MAJOR;
+
+	error = -ENOMEM;
+	cdev = cdev_alloc();
+	if (!cdev)
+		goto out;
+	cdev->owner = THIS_MODULE;
+	cdev->ops = &sg_fops;
+
+	error = sg_alloc(disk, scsidp);
+	if (error < 0)
+		goto out;
+	k = error;
+	sdp = sg_dev_arr[k];
 
 	devfs_mk_cdev(MKDEV(SCSI_GENERIC_MAJOR, k),
 			S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,
@@ -1543,6 +1542,7 @@ module_param_named(allow_dio, sg_allow_dio, int, 0);
 MODULE_AUTHOR("Douglas Gilbert");
 MODULE_DESCRIPTION("SCSI generic (sg) driver");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(SG_VERSION_STR);
 
 MODULE_PARM_DESC(def_reserved_size, "size of buffer reserved for each fd");
 MODULE_PARM_DESC(allow_dio, "allow direct I/O (default: 0 (disallow))");
@@ -1901,7 +1901,7 @@ sg_write_xfer(Sg_request * srp)
 	int iovec_count = (int) hp->iovec_count;
 	int dxfer_dir = hp->dxfer_direction;
 	unsigned char *p;
-	unsigned char *up;
+	unsigned char __user *up;
 	int new_interface = ('\0' == hp->interface_id) ? 0 : 1;
 
 	if ((SG_DXFER_UNKNOWN == dxfer_dir) || (SG_DXFER_TO_DEV == dxfer_dir) ||
@@ -1987,26 +1987,23 @@ sg_write_xfer(Sg_request * srp)
 
 static int
 sg_u_iovec(sg_io_hdr_t * hp, int sg_num, int ind,
-	   int wr_xf, int *countp, unsigned char **up)
+	   int wr_xf, int *countp, unsigned char __user **up)
 {
 	int num_xfer = (int) hp->dxfer_len;
-	unsigned char *p;
+	unsigned char __user *p = hp->dxferp;
 	int count, k;
-	sg_iovec_t u_iovec;
 
 	if (0 == sg_num) {
-		p = (unsigned char *) hp->dxferp;
 		if (wr_xf && ('\0' == hp->interface_id))
 			count = (int) hp->flags;	/* holds "old" input_size */
 		else
 			count = num_xfer;
 	} else {
-		if (__copy_from_user(&u_iovec,
-				     (unsigned char *) hp->dxferp +
-				     (ind * SZ_SG_IOVEC), SZ_SG_IOVEC))
+		sg_iovec_t iovec;
+		if (__copy_from_user(&iovec, p + ind*SZ_SG_IOVEC, SZ_SG_IOVEC))
 			return -EFAULT;
-		p = (unsigned char *) u_iovec.iov_base;
-		count = (int) u_iovec.iov_len;
+		p = iovec.iov_base;
+		count = (int) iovec.iov_len;
 	}
 	if ((k = verify_area(wr_xf ? VERIFY_READ : VERIFY_WRITE, p, count)))
 		return k;
@@ -2058,7 +2055,7 @@ sg_read_xfer(Sg_request * srp)
 	int iovec_count = (int) hp->iovec_count;
 	int dxfer_dir = hp->dxfer_direction;
 	unsigned char *p;
-	unsigned char *up;
+	unsigned char __user *up;
 	int new_interface = ('\0' == hp->interface_id) ? 0 : 1;
 
 	if ((SG_DXFER_UNKNOWN == dxfer_dir) || (SG_DXFER_FROM_DEV == dxfer_dir)
@@ -2143,7 +2140,7 @@ sg_read_xfer(Sg_request * srp)
 }
 
 static int
-sg_read_oxfer(Sg_request * srp, char *outp, int num_read_xfer)
+sg_read_oxfer(Sg_request * srp, char __user *outp, int num_read_xfer)
 {
 	Sg_scatter_hold *schp = &srp->data;
 
@@ -2844,7 +2841,8 @@ sg_proc_write_dressz(struct file *filp, const char __user *buffer,
 
 static int sg_proc_seq_show_version(struct seq_file *s, void *v)
 {
-	seq_printf(s, "%d\t%s\n", sg_version_num, sg_version_str);
+	seq_printf(s, "%d\t%s [%s]\n", sg_version_num, SG_VERSION_STR,
+		   sg_version_date);
 	return 0;
 }
 
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 72a84ff0d..dd5627cbe 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -1,32 +1,32 @@
 /*
- * sgiwd93.c: SGI WD93 scsi driver.
+ * 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) 1996 David S. Miller (dm@engr.sgi.com)
- *		 1999 Andrew R. Baker (andrewb@uab.edu)
- *		      - Support for 2nd SCSI controller on Indigo2
- *		 2001 Florian Lohoff (flo@rfc822.org)
- *		      - Delete HPC scatter gather (Read corruption on 
- *		        multiple disks)
- *		      - Cleanup wback cache handling
+ * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu)
+ * Copyright (C) 2001 Florian Lohoff (flo@rfc822.org)
+ * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org)
  * 
  * (In all truth, Jed Schimmel wrote all this code.)
- *
  */
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/blkdev.h>
 #include <linux/version.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/spinlock.h>
 
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/sgialib.h>
 #include <asm/sgi/sgi.h>
-#include <asm/sgi/sgimc.h>
-#include <asm/sgi/sgihpc.h>
-#include <asm/sgi/sgint23.h>
+#include <asm/sgi/mc.h>
+#include <asm/sgi/hpc3.h>
+#include <asm/sgi/ip22.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 
@@ -37,95 +37,130 @@
 
 #include <linux/stat.h>
 
+#if 0
+#define DPRINTK(args...)	printk(args)
+#else
+#define DPRINTK(args...)
+#endif
+
+#define HDATA(ptr) ((struct ip22_hostdata *)((ptr)->hostdata))
+
+struct ip22_hostdata {
+	struct WD33C93_hostdata wh;
+	struct hpc_data {
+		dma_addr_t      dma;
+		void            * cpu;
+	} hd;
+};
+
 struct hpc_chunk {
 	struct hpc_dma_desc desc;
 	u32 _padding;	/* align to quadword boundary */
 };
 
-struct Scsi_Host *sgiwd93_host = NULL;
-struct Scsi_Host *sgiwd93_host1 = NULL;
+struct Scsi_Host *sgiwd93_host;
+struct Scsi_Host *sgiwd93_host1;
 
 /* Wuff wuff, wuff, wd33c93.c, wuff wuff, object oriented, bow wow. */
+static inline void write_wd33c93_count(const wd33c93_regs regs,
+                                      unsigned long value)
+{
+	*regs.SASR = WD_TRANSFER_COUNT_MSB;
+	mb();
+	*regs.SCMD = ((value >> 16) & 0xff);
+	*regs.SCMD = ((value >>  8) & 0xff);
+	*regs.SCMD = ((value >>  0) & 0xff);
+	mb();
+}
 
-/* XXX woof! */
-static void sgiwd93_intr(int irq, void *dev_id, struct pt_regs *regs)
+static inline unsigned long read_wd33c93_count(const wd33c93_regs regs)
 {
-	unsigned long flags;
-	struct Scsi_Host *dev = dev_id;
-	
-	spin_lock_irqsave(dev->host_lock, flags);
-	wd33c93_intr((struct Scsi_Host *) dev_id);
-	spin_unlock_irqrestore(dev->host_lock, flags);
+	unsigned long value;
+
+	*regs.SASR = WD_TRANSFER_COUNT_MSB;
+	mb();
+	value =  ((*regs.SCMD & 0xff) << 16);
+	value |= ((*regs.SCMD & 0xff) <<  8);
+	value |= ((*regs.SCMD & 0xff) <<  0);
+	mb();
+	return value;
 }
 
-#undef DEBUG_DMA
+static irqreturn_t sgiwd93_intr(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct Scsi_Host * host = (struct Scsi_Host *) dev_id;
+	unsigned long flags;
+
+	spin_lock_irqsave(host->host_lock, flags);
+	wd33c93_intr(host);
+	spin_unlock_irqrestore(host->host_lock, flags);
+
+	return IRQ_HANDLED;
+}
 
 static inline
-void fill_hpc_entries (struct hpc_chunk **hcp, char *addr, unsigned long len)
+void fill_hpc_entries(struct hpc_chunk *hcp, Scsi_Cmnd *cmd, int datainp)
 {
-	unsigned long physaddr;
+	unsigned long len = cmd->SCp.this_residual;
+	void *addr = cmd->SCp.ptr;
+	dma_addr_t physaddr;
 	unsigned long count;
-	
-	physaddr = PHYSADDR(addr);
+
+	physaddr = dma_map_single(NULL, addr, len, cmd->sc_data_direction);
+	cmd->SCp.dma_handle = physaddr;
+
 	while (len) {
 		/*
 		 * even cntinfo could be up to 16383, without
 		 * magic only 8192 works correctly
 		 */
 		count = len > 8192 ? 8192 : len;
-		(*hcp)->desc.pbuf = physaddr;
-		(*hcp)->desc.cntinfo = count;
-		(*hcp)++;
+		hcp->desc.pbuf = physaddr;
+		hcp->desc.cntinfo = count;
+		hcp++;
 		len -= count;
 		physaddr += count;
 	}
+
+	/*
+	 * To make sure, if we trip an HPC bug, that we transfer every single
+	 * byte, we tag on an extra zero length dma descriptor at the end of
+	 * the chain.
+	 */
+	hcp->desc.pbuf = 0;
+	hcp->desc.cntinfo = HPCDMA_EOX;
 }
 
 static int dma_setup(Scsi_Cmnd *cmd, int datainp)
 {
-	struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)cmd->host->hostdata;
-	struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) cmd->host->base;
-	struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->dma_bounce_buffer;
+	struct ip22_hostdata *hdata = HDATA(cmd->device->host);
+	struct hpc3_scsiregs *hregs =
+		(struct hpc3_scsiregs *) cmd->device->host->base;
+	struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->hd.cpu;
 
-#ifdef DEBUG_DMA
-	printk("dma_setup: datainp<%d> hcp<%p> ",
-	       datainp, hcp);
-#endif
+	DPRINTK("dma_setup: datainp<%d> hcp<%p> ", datainp, hcp);
 
-	hdata->dma_dir = datainp;
+	hdata->wh.dma_dir = datainp;
 
 	/*
-	 * wd33c93 shouldn't pass us bogus dma_setups, but
-	 * it does:-( The other wd33c93 drivers deal with
-	 * it the same way (which isn't that obvious).
-	 * IMHO a better fix would be, not to do these
-	 * dma setups in the first place
+	 * wd33c93 shouldn't pass us bogus dma_setups, but it does:-(  The
+	 * other wd33c93 drivers deal with it the same way (which isn't that
+	 * obvious).  IMHO a better fix would be, not to do these dma setups
+	 * in the first place.
 	 */
-	if (cmd->SCp.ptr == NULL)
+	if (cmd->SCp.ptr == NULL || cmd->SCp.this_residual == 0)
 		return 1;
 
-	fill_hpc_entries (&hcp, cmd->SCp.ptr,cmd->SCp.this_residual);
+	fill_hpc_entries(hcp, cmd, datainp);
 
-	/* To make sure, if we trip an HPC bug, that we transfer
-	 * every single byte, we tag on an extra zero length dma
-	 * descriptor at the end of the chain.
-	 */
-	hcp->desc.pbuf = 0;
-	hcp->desc.cntinfo = (HPCDMA_EOX);
-
-#ifdef DEBUG_DMA
-	printk(" HPCGO\n");
-#endif
+	DPRINTK(" HPCGO\n");
 
 	/* Start up the HPC. */
-	hregs->ndptr = PHYSADDR(hdata->dma_bounce_buffer);
-	if(datainp) {
-		dma_cache_inv((unsigned long) cmd->SCp.ptr, cmd->SCp.this_residual);
-		hregs->ctrl = (HPC3_SCTRL_ACTIVE);
-	} else {
-		dma_cache_wback_inv((unsigned long) cmd->SCp.ptr, cmd->SCp.this_residual);
-		hregs->ctrl = (HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR);
-	}
+	hregs->ndptr = hdata->hd.dma;
+	if (datainp)
+		hregs->ctrl = HPC3_SCTRL_ACTIVE;
+	else
+		hregs->ctrl = HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR;
 
 	return 0;
 }
@@ -133,29 +168,27 @@ static int dma_setup(Scsi_Cmnd *cmd, int datainp)
 static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
 		     int status)
 {
-	struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)instance->hostdata;
+	struct ip22_hostdata *hdata = HDATA(instance);
 	struct hpc3_scsiregs *hregs;
 
 	if (!SCpnt)
 		return;
 
-	hregs = (struct hpc3_scsiregs *) SCpnt->host->base;
+	hregs = (struct hpc3_scsiregs *) SCpnt->device->host->base;
 
-#ifdef DEBUG_DMA
-	printk("dma_stop: status<%d> ", status);
-#endif
+	DPRINTK("dma_stop: status<%d> ", status);
 
 	/* First stop the HPC and flush it's FIFO. */
-	if(hdata->dma_dir) {
+	if (hdata->wh.dma_dir) {
 		hregs->ctrl |= HPC3_SCTRL_FLUSH;
-		while(hregs->ctrl & HPC3_SCTRL_ACTIVE)
+		while (hregs->ctrl & HPC3_SCTRL_ACTIVE)
 			barrier();
 	}
 	hregs->ctrl = 0;
+	dma_unmap_single(NULL, SCpnt->SCp.dma_handle, SCpnt->SCp.this_residual,
+	                 SCpnt->sc_data_direction);
 
-#ifdef DEBUG_DMA
-	printk("\n");
-#endif
+	DPRINTK("\n");
 }
 
 void sgiwd93_reset(unsigned long base)
@@ -163,142 +196,142 @@ void sgiwd93_reset(unsigned long base)
 	struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) base;
 
 	hregs->ctrl = HPC3_SCTRL_CRESET;
-	udelay (50);
+	udelay(50);
 	hregs->ctrl = 0;
 }
 
-static inline void init_hpc_chain(uchar *buf)
+static inline void init_hpc_chain(struct hpc_data *hd)
 {
-	struct hpc_chunk *hcp = (struct hpc_chunk *) buf;
+	struct hpc_chunk *hcp = (struct hpc_chunk *) hd->cpu;
+	struct hpc_chunk *dma = (struct hpc_chunk *) hd->dma;
 	unsigned long start, end;
 
-	start = (unsigned long) buf;
+	start = (unsigned long) hcp;
 	end = start + PAGE_SIZE;
-	while(start < end) {
-		hcp->desc.pnext = PHYSADDR((hcp + 1));
+	while (start < end) {
+		hcp->desc.pnext = (u32) (dma + 1);
 		hcp->desc.cntinfo = HPCDMA_EOX;
-		hcp++;
+		hcp++; dma++;
 		start += sizeof(struct hpc_chunk);
 	};
 	hcp--;
-	hcp->desc.pnext = PHYSADDR(buf);
-
-	/* Force flush to memory */
-	dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
+	hcp->desc.pnext = hd->dma;
 }
 
-int __init sgiwd93_detect(Scsi_Host_Template *SGIblows)
+static struct Scsi_Host * __init sgiwd93_setup_scsi(
+	Scsi_Host_Template *SGIblows, int unit, int irq,
+	struct hpc3_scsiregs *hregs, unsigned char *wdregs)
 {
-	static unsigned char called = 0;
-	struct hpc3_scsiregs *hregs = &hpc3c0->scsi_chan0;
-	struct hpc3_scsiregs *hregs1 = &hpc3c0->scsi_chan1;
-	struct WD33C93_hostdata *hdata;
-	struct WD33C93_hostdata *hdata1;
+	struct ip22_hostdata *hdata;
+	struct Scsi_Host *host;
 	wd33c93_regs regs;
-	uchar *buf;
-	
-	if(called)
-		return 0; /* Should bitch on the console about this... */
 
-	SGIblows->proc_name = "SGIWD93";
+	host = scsi_register(SGIblows, sizeof(struct ip22_hostdata));
+	if (!host)
+		return NULL;
 
-	sgiwd93_host = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata));
-	if(sgiwd93_host == NULL)
-		return 0;
-	sgiwd93_host->base = (unsigned long) hregs;
-	sgiwd93_host->irq = SGI_WD93_0_IRQ;
-
-	buf = (uchar *) get_zeroed_page(GFP_KERNEL);
-	if (!buf) {
-		printk(KERN_WARNING "sgiwd93: Could not allocate memory for host0 buffer.\n");
-		scsi_unregister(sgiwd93_host);
-		return 0;
+	host->base = (unsigned long) hregs;
+	host->irq = irq;
+
+	hdata = HDATA(host);
+	hdata->hd.cpu = dma_alloc_coherent(NULL, PAGE_SIZE, &hdata->hd.dma,
+	                                   GFP_KERNEL);
+	if (!hdata->hd.cpu) {
+		printk(KERN_WARNING "sgiwd93: Could not allocate memory for "
+		       "host %d buffer.\n", unit);
+		goto out_unregister;
 	}
-	init_hpc_chain(buf);
-	
-	/* HPC_SCSI_REG0 | 0x03 | KSEG1 */
-	regs.SASR = (unsigned char*) KSEG1ADDR (0x1fbc0003);
-	regs.SCMD = (unsigned char*) KSEG1ADDR (0x1fbc0007);
-	wd33c93_init(sgiwd93_host, regs, dma_setup, dma_stop, WD33C93_FS_16_20);
-
-	hdata = (struct WD33C93_hostdata *)sgiwd93_host->hostdata;
-	hdata->no_sync = 0;
-	hdata->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
-
-	if (request_irq(SGI_WD93_0_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host)) {
-		printk(KERN_WARNING "sgiwd93: Could not register IRQ %d (for host 0).\n", SGI_WD93_0_IRQ);
-		wd33c93_release();
-		free_page((unsigned long)buf);
-		scsi_unregister(sgiwd93_host);
-		return 0;
+	init_hpc_chain(&hdata->hd);
+
+	regs.SASR = wdregs + 3;
+	regs.SCMD = wdregs + 7;
+
+	wd33c93_init(host, regs, dma_setup, dma_stop, WD33C93_FS_16_20);
+
+	hdata->wh.no_sync = 0;
+
+	if (request_irq(irq, sgiwd93_intr, 0, "SGI WD93", (void *) host)) {
+		printk(KERN_WARNING "sgiwd93: Could not register irq %d "
+		       "for host %d.\n", irq, unit);
+		goto out_free;
 	}
-        /* set up second controller on the Indigo2 */
-	if(!sgi_guiness) {
-		sgiwd93_host1 = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata));
-		if(sgiwd93_host1 != NULL)
-		{
-			sgiwd93_host1->base = (unsigned long) hregs1;
-			sgiwd93_host1->irq = SGI_WD93_1_IRQ;
-	
-			buf = (uchar *) get_zeroed_page(GFP_KERNEL);
-			if (!buf) {
-				printk(KERN_WARNING "sgiwd93: Could not allocate memory for host1 buffer.\n");
-				scsi_unregister(sgiwd93_host1);
-				called = 1;
-				return 1; /* We registered host0 so return success*/
-			}
-			init_hpc_chain(buf);
-
-			/* HPC_SCSI_REG1 | 0x03 | KSEG1 */
-			regs.SASR = (unsigned char*) KSEG1ADDR(0x1fbc8003);
-			regs.SCMD = (unsigned char*) KSEG1ADDR(0x1fbc8007);
-			wd33c93_init(sgiwd93_host1, regs, dma_setup, dma_stop,
-			             WD33C93_FS_16_20);
-	
-			hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata;
-			hdata1->no_sync = 0;
-			hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
-	
-			if (request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host1)) {
-				printk(KERN_WARNING "sgiwd93: Could not allocate irq %d (for host1).\n", SGI_WD93_1_IRQ);
-				wd33c93_release();
-				free_page((unsigned long)buf);
-				scsi_unregister(sgiwd93_host1);
-				/* Fall through since host0 registered OK */
-			}
-		}
+	return host;
+
+out_free:
+	dma_free_coherent(NULL, PAGE_SIZE, hdata->hd.cpu, hdata->hd.dma);
+	wd33c93_release();
+
+out_unregister:
+	scsi_unregister(host);
+
+	return NULL;
+}
+
+int __init sgiwd93_detect(Scsi_Host_Template *SGIblows)
+{
+	int found = 0;
+
+	SGIblows->proc_name = "SGIWD93";
+	sgiwd93_host = sgiwd93_setup_scsi(SGIblows, 0, SGI_WD93_0_IRQ,
+	                                  &hpc3c0->scsi_chan0,
+	                                  (unsigned char *)hpc3c0->scsi0_ext);
+	if (sgiwd93_host)
+		found++;
+
+	/* Set up second controller on the Indigo2 */
+	if (ip22_is_fullhouse()) {
+		sgiwd93_host1 = sgiwd93_setup_scsi(SGIblows, 1, SGI_WD93_1_IRQ,
+		                          &hpc3c0->scsi_chan1,
+		                          (unsigned char *)hpc3c0->scsi1_ext);
+		if (sgiwd93_host1)
+			found++;
 	}
-	
-	called = 1;
 
-	return 1; /* Found one. */
+	return found;
 }
 
 int sgiwd93_release(struct Scsi_Host *instance)
 {
-	free_irq(SGI_WD93_0_IRQ, sgiwd93_intr);
-	free_page(KSEG0ADDR(hdata->dma_bounce_buffer));
+	struct ip22_hostdata *hdata = HDATA(instance);
+	int irq = 0;
+
+	if (sgiwd93_host && sgiwd93_host == instance)
+		irq = SGI_WD93_0_IRQ;
+	else if (sgiwd93_host1 && sgiwd93_host1 == instance)
+		irq = SGI_WD93_1_IRQ;
+
+	free_irq(irq, sgiwd93_intr);
+	dma_free_coherent(NULL, PAGE_SIZE, hdata->hd.cpu, hdata->hd.dma);
 	wd33c93_release();
-	if(!sgi_guiness) {
-		free_irq(SGI_WD93_1_IRQ, sgiwd93_intr);
-		free_page(KSEG0ADDR(hdata1->dma_bounce_buffer));
-		wd33c93_release();
-	}
+
 	return 1;
 }
 
+static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
+{
+	/* FIXME perform bus-specific reset */
+	wd33c93_host_reset(cmd);
+	return SUCCESS;
+}
+
+/*
+ * Kludge alert - the SCSI code calls the abort and reset method with int
+ * arguments not with pointers.  So this is going to blow up beautyfully
+ * on 64-bit systems with memory outside the compat address spaces.
+ */
 static Scsi_Host_Template driver_template = {
-	.proc_name	     = "SGIWD93",
-	.name                = "SGI WD93",
-	.detect              = sgiwd93_detect,
-	.release             = sgiwd93_release,
-	.queuecommand        = wd33c93_queuecommand,
-	.abort               = wd33c93_abort,
-	.reset               = wd33c93_reset,
-	.can_queue           = CAN_QUEUE,
-	.this_id             = 7,
-	.sg_tablesize        = SG_ALL,
-	.cmd_per_lun	     = CMD_PER_LUN,
-	.use_clustering      = DISABLE_CLUSTERING,
+	.proc_name		= "SGIWD93",
+	.name			= "SGI WD93",
+	.detect			= sgiwd93_detect,
+	.release		= sgiwd93_release,
+	.queuecommand		= wd33c93_queuecommand,
+	.eh_abort_handler	= wd33c93_abort,
+	.eh_bus_reset_handler	= sgiwd93_bus_reset,
+	.eh_host_reset_handler	= wd33c93_host_reset,
+	.can_queue		= CAN_QUEUE,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= CMD_PER_LUN,
+	.use_clustering		= DISABLE_CLUSTERING,
 };
 #include "scsi_module.c"
diff --git a/drivers/scsi/sgiwd93.h b/drivers/scsi/sgiwd93.h
index 5d710eeae..981d0b7a8 100644
--- a/drivers/scsi/sgiwd93.h
+++ b/drivers/scsi/sgiwd93.h
@@ -19,6 +19,6 @@ int sgiwd93_release(struct Scsi_Host *instance);
 const char *wd33c93_info(void);
 int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
 int wd33c93_abort(Scsi_Cmnd *);
-int wd33c93_reset(Scsi_Cmnd *, unsigned int);
+int wd33c93_host_reset(Scsi_Cmnd * SCpnt);
 
 #endif /* !(_SGIWD93_H) */
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index a4db57af5..9c3ddba40 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -99,7 +99,7 @@ static void get_sectorsize(struct scsi_cd *);
 static void get_capabilities(struct scsi_cd *);
 
 static int sr_media_change(struct cdrom_device_info *, int);
-static int sr_packet(struct cdrom_device_info *, struct cdrom_generic_command *);
+static int sr_packet(struct cdrom_device_info *, struct packet_command *);
 
 static struct cdrom_device_ops sr_dops = {
 	.open			= sr_open,
@@ -138,7 +138,15 @@ static inline struct scsi_cd *scsi_cd_get(struct gendisk *disk)
 		goto out;
 	cd = scsi_cd(disk);
 	if (!kref_get(&cd->kref))
-		cd = NULL;
+		goto out_null;
+	if (scsi_device_get(cd->device))
+		goto out_put;
+	goto out;
+
+ out_put:
+	kref_put(&cd->kref);
+ out_null:
+	cd = NULL;
  out:
 	up(&sr_ref_sem);
 	return cd;
@@ -147,6 +155,7 @@ static inline struct scsi_cd *scsi_cd_get(struct gendisk *disk)
 static inline void scsi_cd_put(struct scsi_cd *cd)
 {
 	down(&sr_ref_sem);
+	scsi_device_put(cd->device);
 	kref_put(&cd->kref);
 	up(&sr_ref_sem);
 }
@@ -490,7 +499,7 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
         switch (cmd) {
                 case SCSI_IOCTL_GET_IDLUN:
                 case SCSI_IOCTL_GET_BUS_NUMBER:
-                        return scsi_ioctl(sdev, cmd, (void *)arg);
+                        return scsi_ioctl(sdev, cmd, (void __user *)arg);
 	}
 	return cdrom_ioctl(&cd->cdi, inode, cmd, arg);
 }
@@ -558,13 +567,10 @@ static int sr_probe(struct device *dev)
 	if (sdev->type != TYPE_ROM && sdev->type != TYPE_WORM)
 		goto fail;
 
-	if ((error = scsi_device_get(sdev)) != 0)
-		goto fail;
-
 	error = -ENOMEM;
 	cd = kmalloc(sizeof(*cd), GFP_KERNEL);
 	if (!cd)
-		goto fail_put_sdev;
+		goto fail;
 	memset(cd, 0, sizeof(*cd));
 
 	kref_init(&cd->kref, sr_kref_release);
@@ -637,8 +643,6 @@ fail_put:
 	put_disk(disk);
 fail_free:
 	kfree(cd);
-fail_put_sdev:
-	scsi_device_put(sdev);
 fail:
 	return error;
 }
@@ -904,7 +908,7 @@ static void get_capabilities(struct scsi_cd *cd)
  * by the Uniform CD-ROM layer. 
  */
 static int sr_packet(struct cdrom_device_info *cdi,
-		struct cdrom_generic_command *cgc)
+		struct packet_command *cgc)
 {
 	if (cgc->timeout <= 0)
 		cgc->timeout = IOCTL_TIMEOUT;
@@ -926,7 +930,6 @@ static int sr_packet(struct cdrom_device_info *cdi,
 static void sr_kref_release(struct kref *kref)
 {
 	struct scsi_cd *cd = container_of(kref, struct scsi_cd, kref);
-	struct scsi_device *sdev = cd->device;
 	struct gendisk *disk = cd->disk;
 
 	spin_lock(&sr_index_lock);
@@ -940,8 +943,6 @@ static void sr_kref_release(struct kref *kref)
 	put_disk(disk);
 
 	kfree(cd);
-
-	scsi_device_put(sdev);
 }
 
 static int sr_remove(struct device *dev)
@@ -950,7 +951,9 @@ static int sr_remove(struct device *dev)
 
 	del_gendisk(cd->disk);
 
-	scsi_cd_put(cd);
+	down(&sr_ref_sem);
+	kref_put(&cd->kref);
+	up(&sr_ref_sem);
 
 	return 0;
 }
diff --git a/drivers/scsi/sr.h b/drivers/scsi/sr.h
index b77847496..bfbabb6a4 100644
--- a/drivers/scsi/sr.h
+++ b/drivers/scsi/sr.h
@@ -43,7 +43,7 @@ typedef struct scsi_cd {
 	struct gendisk *disk;
 } Scsi_CD;
 
-int sr_do_ioctl(Scsi_CD *, struct cdrom_generic_command *);
+int sr_do_ioctl(Scsi_CD *, struct packet_command *);
 
 int sr_lock_door(struct cdrom_device_info *, int);
 int sr_tray_move(struct cdrom_device_info *, int);
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index 0416030f7..3fc83dc73 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -34,7 +34,7 @@ static int sr_fake_playtrkind(struct cdrom_device_info *cdi, struct cdrom_ti *ti
 {
 	struct cdrom_tocentry trk0_te, trk1_te;
 	struct cdrom_tochdr tochdr;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int ntracks, ret;
 
 	if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCHDR, &tochdr)))
@@ -57,7 +57,7 @@ static int sr_fake_playtrkind(struct cdrom_device_info *cdi, struct cdrom_ti *ti
 	if ((ret = sr_audio_ioctl(cdi, CDROMREADTOCENTRY, &trk1_te)))
 		return ret;
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_PLAY_AUDIO_MSF;
 	cgc.cmd[3] = trk0_te.cdte_addr.msf.minute;
 	cgc.cmd[4] = trk0_te.cdte_addr.msf.second;
@@ -74,7 +74,7 @@ static int sr_fake_playtrkind(struct cdrom_device_info *cdi, struct cdrom_ti *ti
    error code is.  Normally the UNIT_ATTENTION code will automatically
    clear after one error */
 
-int sr_do_ioctl(Scsi_CD *cd, struct cdrom_generic_command *cgc)
+int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
 {
 	struct scsi_request *SRpnt;
 	struct scsi_device *SDev;
@@ -178,9 +178,9 @@ int sr_do_ioctl(Scsi_CD *cd, struct cdrom_generic_command *cgc)
 
 static int test_unit_ready(Scsi_CD *cd)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_TEST_UNIT_READY;
 	cgc.quiet = 1;
 	cgc.data_direction = SCSI_DATA_NONE;
@@ -191,9 +191,9 @@ static int test_unit_ready(Scsi_CD *cd)
 int sr_tray_move(struct cdrom_device_info *cdi, int pos)
 {
 	Scsi_CD *cd = cdi->handle;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_START_STOP_UNIT;
 	cgc.cmd[4] = (pos == 0) ? 0x03 /* close */ : 0x02 /* eject */ ;
 	cgc.data_direction = SCSI_DATA_NONE;
@@ -269,11 +269,11 @@ int sr_get_last_session(struct cdrom_device_info *cdi,
 int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
 {
 	Scsi_CD *cd = cdi->handle;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
 	int result;
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_READ_SUBCHANNEL;
 	cgc.cmd[2] = 0x40;	/* I do want the subchannel info */
 	cgc.cmd[3] = 0x02;	/* Give me medium catalog number info */
@@ -299,14 +299,14 @@ int sr_reset(struct cdrom_device_info *cdi)
 int sr_select_speed(struct cdrom_device_info *cdi, int speed)
 {
 	Scsi_CD *cd = cdi->handle;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
 	if (speed == 0)
 		speed = 0xffff;	/* set to max */
 	else
 		speed *= 177;	/* Nx to kbyte/s */
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_SET_SPEED;	/* SET CD SPEED */
 	cgc.cmd[2] = (speed >> 8) & 0xff;	/* MSB for speed (in kbytes/sec) */
 	cgc.cmd[3] = speed & 0xff;	/* LSB */
@@ -327,11 +327,11 @@ int sr_select_speed(struct cdrom_device_info *cdi, int speed)
 int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
 {
 	Scsi_CD *cd = cdi->handle;
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int result;
 	unsigned char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.timeout = IOCTL_TIMEOUT;
 
 	switch (cmd) {
@@ -428,14 +428,14 @@ int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
 
 static int sr_read_cd(Scsi_CD *cd, unsigned char *dest, int lba, int format, int blksize)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 
 #ifdef DEBUG
 	printk("%s: sr_read_cd lba=%d format=%d blksize=%d\n",
 	       cd->cdi.name, lba, format, blksize);
 #endif
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_READ_CD;	/* READ_CD */
 	cgc.cmd[1] = ((format & 7) << 2);
 	cgc.cmd[2] = (unsigned char) (lba >> 24) & 0xff;
@@ -470,7 +470,7 @@ static int sr_read_cd(Scsi_CD *cd, unsigned char *dest, int lba, int format, int
 
 static int sr_read_sector(Scsi_CD *cd, int lba, int blksize, unsigned char *dest)
 {
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int rc;
 
 	/* we try the READ CD command first... */
@@ -491,7 +491,7 @@ static int sr_read_sector(Scsi_CD *cd, int lba, int blksize, unsigned char *dest
 	printk("%s: sr_read_sector lba=%d blksize=%d\n", cd->cdi.name, lba, blksize);
 #endif
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_READ_10;
 	cgc.cmd[2] = (unsigned char) (lba >> 24) & 0xff;
 	cgc.cmd[3] = (unsigned char) (lba >> 16) & 0xff;
@@ -541,5 +541,5 @@ int sr_dev_ioctl(struct cdrom_device_info *cdi,
 		 unsigned int cmd, unsigned long arg)
 {
 	Scsi_CD *cd = cdi->handle;
-	return scsi_ioctl(cd->device, cmd, (void *)arg);
+	return scsi_ioctl(cd->device, cmd, (void __user *)arg);
 }
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c
index 6fb97529c..2f7894e70 100644
--- a/drivers/scsi/sr_vendor.c
+++ b/drivers/scsi/sr_vendor.c
@@ -107,7 +107,7 @@ void sr_vendor_init(Scsi_CD *cd)
 int sr_set_blocklength(Scsi_CD *cd, int blocklength)
 {
 	unsigned char *buffer;	/* the buffer for the ioctl */
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	struct ccs_modesel_head *modesel;
 	int rc, density = 0;
 
@@ -123,7 +123,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
 #ifdef DEBUG
 	printk("%s: MODE SELECT 0x%x/%d\n", cd->cdi.name, density, blocklength);
 #endif
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = MODE_SELECT;
 	cgc.cmd[1] = (1 << 4);
 	cgc.cmd[4] = 12;
@@ -157,7 +157,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 	Scsi_CD *cd = cdi->handle;
 	unsigned long sector;
 	unsigned char *buffer;	/* the buffer for the ioctl */
-	struct cdrom_generic_command cgc;
+	struct packet_command cgc;
 	int rc, no_multi;
 
 	if (cd->cdi.mask & CDC_MULTI_SESSION)
@@ -171,7 +171,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 	no_multi = 0;		/* flag: the drive can't handle multisession */
 	rc = 0;
 
-	memset(&cgc, 0, sizeof(struct cdrom_generic_command));
+	memset(&cgc, 0, sizeof(struct packet_command));
 
 	switch (cd->vendor) {
 
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index cf4e64881..0e2891593 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -17,7 +17,7 @@
    Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
  */
 
-static char *verstr = "20040318";
+static char *verstr = "20040403";
 
 #include <linux/module.h>
 
@@ -176,8 +176,8 @@ static int modes_defined;
 static ST_buffer *new_tape_buffer(int, int, int);
 static int enlarge_buffer(ST_buffer *, int, int);
 static void normalize_buffer(ST_buffer *);
-static int append_to_buffer(const char *, ST_buffer *, int);
-static int from_buffer(ST_buffer *, char *, int);
+static int append_to_buffer(const char __user *, ST_buffer *, int);
+static int from_buffer(ST_buffer *, char __user *, int);
 static void move_buffer_data(ST_buffer *, int);
 static void buf_to_sg(ST_buffer *, unsigned int);
 
@@ -486,7 +486,7 @@ static int cross_eof(Scsi_Tape * STp, int forward)
 		   tape_name(STp), forward ? "forward" : "backward"));
 
 	SRpnt = st_do_scsi(NULL, STp, cmd, 0, SCSI_DATA_NONE,
-			   STp->timeout, MAX_RETRIES, TRUE);
+			   STp->device->timeout, MAX_RETRIES, TRUE);
 	if (!SRpnt)
 		return (STp->buffer)->syscall_result;
 
@@ -544,7 +544,7 @@ static int flush_write_buffer(Scsi_Tape * STp)
 		cmd[4] = blks;
 
 		SRpnt = st_do_scsi(NULL, STp, cmd, transfer, SCSI_DATA_WRITE,
-				   STp->timeout, MAX_WRITE_RETRIES, TRUE);
+				   STp->device->timeout, MAX_WRITE_RETRIES, TRUE);
 		if (!SRpnt)
 			return (STp->buffer)->syscall_result;
 
@@ -867,7 +867,7 @@ static int check_tape(Scsi_Tape *STp, struct file *filp)
 		memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE);
 		cmd[0] = READ_BLOCK_LIMITS;
 
-		SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, SCSI_DATA_READ, STp->timeout,
+		SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, SCSI_DATA_READ, STp->device->timeout,
 				   MAX_READY_RETRIES, TRUE);
 		if (!SRpnt) {
 			retval = (STp->buffer)->syscall_result;
@@ -894,7 +894,7 @@ static int check_tape(Scsi_Tape *STp, struct file *filp)
 	cmd[0] = MODE_SENSE;
 	cmd[4] = 12;
 
-	SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, SCSI_DATA_READ, STp->timeout,
+	SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, SCSI_DATA_READ, STp->device->timeout,
 			   MAX_READY_RETRIES, TRUE);
 	if (!SRpnt) {
 		retval = (STp->buffer)->syscall_result;
@@ -1031,7 +1031,8 @@ static int st_open(struct inode *inode, struct file *filp)
 
 	/* See that we have at least a one page buffer available */
 	if (!enlarge_buffer(STp->buffer, PAGE_SIZE, STp->restr_dma)) {
-		printk(KERN_WARNING "%s: Can't allocate tape buffer.\n", name);
+		printk(KERN_WARNING "%s: Can't allocate one page tape buffer.\n",
+		       name);
 		retval = (-EOVERFLOW);
 		goto err_out;
 	}
@@ -1115,7 +1116,7 @@ static int st_flush(struct file *filp)
 		cmd[4] = 1 + STp->two_fm;
 
 		SRpnt = st_do_scsi(NULL, STp, cmd, 0, SCSI_DATA_NONE,
-				   STp->timeout, MAX_WRITE_RETRIES, TRUE);
+				   STp->device->timeout, MAX_WRITE_RETRIES, TRUE);
 		if (!SRpnt) {
 			result = (STp->buffer)->syscall_result;
 			goto out;
@@ -1275,7 +1276,7 @@ static ssize_t rw_checks(Scsi_Tape *STp, struct file *filp, size_t count, loff_t
 }
 
 
-static int setup_buffering(Scsi_Tape *STp, const char *buf, size_t count, int is_read)
+static int setup_buffering(Scsi_Tape *STp, const char __user *buf, size_t count, int is_read)
 {
 	int i, bufsize, retval = 0;
 	ST_buffer *STbp = STp->buffer;
@@ -1318,6 +1319,8 @@ static int setup_buffering(Scsi_Tape *STp, const char *buf, size_t count, int is
 			bufsize = count;
 		if (bufsize > STbp->buffer_size &&
 		    !enlarge_buffer(STbp, bufsize, STp->restr_dma)) {
+			printk(KERN_WARNING "%s: Can't allocate %d byte tape buffer.\n",
+			       tape_name(STp), bufsize);
 			retval = (-EOVERFLOW);
 			goto out;
 		}
@@ -1345,7 +1348,7 @@ static void release_buffering(Scsi_Tape *STp)
 
 /* Write command */
 static ssize_t
- st_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
+st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 {
 	ssize_t total;
 	ssize_t i, do_count, blks, transfer;
@@ -1353,7 +1356,7 @@ static ssize_t
 	int undone, retry_eot = 0, scode;
 	int async_write;
 	unsigned char cmd[MAX_COMMAND_SIZE];
-	const char *b_point;
+	const char __user *b_point;
 	Scsi_Request *SRpnt = NULL;
 	Scsi_Tape *STp = filp->private_data;
 	ST_mode *STm;
@@ -1506,7 +1509,7 @@ static ssize_t
 		cmd[4] = blks;
 
 		SRpnt = st_do_scsi(SRpnt, STp, cmd, transfer, SCSI_DATA_WRITE,
-				   STp->timeout, MAX_WRITE_RETRIES, !async_write);
+				   STp->device->timeout, MAX_WRITE_RETRIES, !async_write);
 		if (!SRpnt) {
 			retval = STbp->syscall_result;
 			goto out;
@@ -1676,7 +1679,7 @@ static long read_tape(Scsi_Tape *STp, long count, Scsi_Request ** aSRpnt)
 
 	SRpnt = *aSRpnt;
 	SRpnt = st_do_scsi(SRpnt, STp, cmd, bytes, SCSI_DATA_READ,
-			   STp->timeout, MAX_RETRIES, TRUE);
+			   STp->device->timeout, MAX_RETRIES, TRUE);
 	release_buffering(STp);
 	*aSRpnt = SRpnt;
 	if (!SRpnt)
@@ -1814,7 +1817,7 @@ static long read_tape(Scsi_Tape *STp, long count, Scsi_Request ** aSRpnt)
 
 /* Read command */
 static ssize_t
- st_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
+st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 {
 	ssize_t total;
 	ssize_t retval = 0;
@@ -1960,26 +1963,29 @@ static ssize_t
 
 
 
+DEB(
 /* Set the driver options */
 static void st_log_options(Scsi_Tape * STp, ST_mode * STm, char *name)
 {
-	printk(KERN_INFO
-	       "%s: Mode %d options: buffer writes: %d, async writes: %d, read ahead: %d\n",
-	       name, STp->current_mode, STm->do_buffer_writes, STm->do_async_writes,
-	       STm->do_read_ahead);
-	printk(KERN_INFO
-	       "%s:    can bsr: %d, two FMs: %d, fast mteom: %d, auto lock: %d,\n",
-	       name, STp->can_bsr, STp->two_fm, STp->fast_mteom, STp->do_auto_lock);
-	printk(KERN_INFO
-	       "%s:    defs for wr: %d, no block limits: %d, partitions: %d, s2 log: %d\n",
-	       name, STm->defaults_for_writes, STp->omit_blklims, STp->can_partitions,
-	       STp->scsi2_logical);
-	printk(KERN_INFO
-	       "%s:    sysv: %d nowait: %d\n", name, STm->sysv, STp->immediate);
-        DEB(printk(KERN_INFO
-                   "%s:    debugging: %d\n",
-                   name, debugging);)
+	if (debugging) {
+		printk(KERN_INFO
+		       "%s: Mode %d options: buffer writes: %d, async writes: %d, read ahead: %d\n",
+		       name, STp->current_mode, STm->do_buffer_writes, STm->do_async_writes,
+		       STm->do_read_ahead);
+		printk(KERN_INFO
+		       "%s:    can bsr: %d, two FMs: %d, fast mteom: %d, auto lock: %d,\n",
+		       name, STp->can_bsr, STp->two_fm, STp->fast_mteom, STp->do_auto_lock);
+		printk(KERN_INFO
+		       "%s:    defs for wr: %d, no block limits: %d, partitions: %d, s2 log: %d\n",
+		       name, STm->defaults_for_writes, STp->omit_blklims, STp->can_partitions,
+		       STp->scsi2_logical);
+		printk(KERN_INFO
+		       "%s:    sysv: %d nowait: %d\n", name, STm->sysv, STp->immediate);
+		printk(KERN_INFO "%s:    debugging: %d\n",
+		       name, debugging);
+	}
 }
+	)
 
 
 static int st_set_options(Scsi_Tape *STp, long options)
@@ -2017,8 +2023,8 @@ static int st_set_options(Scsi_Tape *STp, long options)
 		STp->scsi2_logical = (options & MT_ST_SCSI2LOGICAL) != 0;
 		STp->immediate = (options & MT_ST_NOWAIT) != 0;
 		STm->sysv = (options & MT_ST_SYSV) != 0;
-		DEB( debugging = (options & MT_ST_DEBUGGING) != 0; )
-		st_log_options(STp, STm, name);
+		DEB( debugging = (options & MT_ST_DEBUGGING) != 0;
+		     st_log_options(STp, STm, name); )
 	} else if (code == MT_ST_SETBOOLEANS || code == MT_ST_CLEARBOOLEANS) {
 		value = (code == MT_ST_SETBOOLEANS);
 		if ((options & MT_ST_BUFFER_WRITES) != 0)
@@ -2050,19 +2056,19 @@ static int st_set_options(Scsi_Tape *STp, long options)
 			STm->sysv = value;
                 DEB(
 		if ((options & MT_ST_DEBUGGING) != 0)
-			debugging = value; )
-		st_log_options(STp, STm, name);
+			debugging = value;
+			st_log_options(STp, STm, name); )
 	} else if (code == MT_ST_WRITE_THRESHOLD) {
 		/* Retained for compatibility */
 	} else if (code == MT_ST_DEF_BLKSIZE) {
 		value = (options & ~MT_ST_OPTIONS);
 		if (value == ~MT_ST_OPTIONS) {
 			STm->default_blksize = (-1);
-			printk(KERN_INFO "%s: Default block size disabled.\n", name);
+			DEBC( printk(KERN_INFO "%s: Default block size disabled.\n", name));
 		} else {
 			STm->default_blksize = value;
-			printk(KERN_INFO "%s: Default block size set to %d bytes.\n",
-			       name, STm->default_blksize);
+			DEBC( printk(KERN_INFO "%s: Default block size set to %d bytes.\n",
+			       name, STm->default_blksize));
 			if (STp->ready == ST_READY) {
 				STp->blksize_changed = FALSE;
 				set_mode_densblk(STp, STm);
@@ -2072,12 +2078,12 @@ static int st_set_options(Scsi_Tape *STp, long options)
 		value = (options & ~MT_ST_OPTIONS);
 		if ((value & MT_ST_SET_LONG_TIMEOUT) != 0) {
 			STp->long_timeout = (value & ~MT_ST_SET_LONG_TIMEOUT) * HZ;
-			printk(KERN_INFO "%s: Long timeout set to %d seconds.\n", name,
-			       (value & ~MT_ST_SET_LONG_TIMEOUT));
+			DEBC( printk(KERN_INFO "%s: Long timeout set to %d seconds.\n", name,
+			       (value & ~MT_ST_SET_LONG_TIMEOUT)));
 		} else {
-			STp->timeout = value * HZ;
-			printk(KERN_INFO "%s: Normal timeout set to %d seconds.\n",
-                               name, value);
+			STp->device->timeout = value * HZ;
+			DEBC( printk(KERN_INFO "%s: Normal timeout set to %d seconds.\n",
+				name, value) );
 		}
 	} else if (code == MT_ST_SET_CLN) {
 		value = (options & ~MT_ST_OPTIONS) & 0xff;
@@ -2096,12 +2102,12 @@ static int st_set_options(Scsi_Tape *STp, long options)
 		if (code == MT_ST_DEF_DENSITY) {
 			if (value == MT_ST_CLEAR_DEFAULT) {
 				STm->default_density = (-1);
-				printk(KERN_INFO "%s: Density default disabled.\n",
-                                       name);
+				DEBC( printk(KERN_INFO "%s: Density default disabled.\n",
+                                       name));
 			} else {
 				STm->default_density = value & 0xff;
-				printk(KERN_INFO "%s: Density default set to %x\n",
-				       name, STm->default_density);
+				DEBC( printk(KERN_INFO "%s: Density default set to %x\n",
+				       name, STm->default_density));
 				if (STp->ready == ST_READY) {
 					STp->density_changed = FALSE;
 					set_mode_densblk(STp, STm);
@@ -2110,31 +2116,31 @@ static int st_set_options(Scsi_Tape *STp, long options)
 		} else if (code == MT_ST_DEF_DRVBUFFER) {
 			if (value == MT_ST_CLEAR_DEFAULT) {
 				STp->default_drvbuffer = 0xff;
-				printk(KERN_INFO
-                                       "%s: Drive buffer default disabled.\n", name);
+				DEBC( printk(KERN_INFO
+                                       "%s: Drive buffer default disabled.\n", name));
 			} else {
 				STp->default_drvbuffer = value & 7;
-				printk(KERN_INFO
+				DEBC( printk(KERN_INFO
                                        "%s: Drive buffer default set to %x\n",
-				       name, STp->default_drvbuffer);
+				       name, STp->default_drvbuffer));
 				if (STp->ready == ST_READY)
 					st_int_ioctl(STp, MTSETDRVBUFFER, STp->default_drvbuffer);
 			}
 		} else if (code == MT_ST_DEF_COMPRESSION) {
 			if (value == MT_ST_CLEAR_DEFAULT) {
 				STm->default_compression = ST_DONT_TOUCH;
-				printk(KERN_INFO
-                                       "%s: Compression default disabled.\n", name);
+				DEBC( printk(KERN_INFO
+                                       "%s: Compression default disabled.\n", name));
 			} else {
 				if ((value & 0xff00) != 0) {
 					STp->c_algo = (value & 0xff00) >> 8;
-					printk(KERN_INFO "%s: Compression algorithm set to 0x%x.\n",
-					       name, STp->c_algo);
+					DEBC( printk(KERN_INFO "%s: Compression algorithm set to 0x%x.\n",
+					       name, STp->c_algo));
 				}
 				if ((value & 0xff) != 0xff) {
 					STm->default_compression = (value & 1 ? ST_YES : ST_NO);
-					printk(KERN_INFO "%s: Compression default set to %x\n",
-					       name, (value & 1));
+					DEBC( printk(KERN_INFO "%s: Compression default set to %x\n",
+					       name, (value & 1)));
 					if (STp->ready == ST_READY) {
 						STp->compression_changed = FALSE;
 						st_compression(STp, (STm->default_compression == ST_YES));
@@ -2183,7 +2189,7 @@ static int read_mode_page(Scsi_Tape *STp, int page, int omit_block_descs)
 	cmd[4] = 255;
 
 	SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_READ,
-			   STp->timeout, 0, TRUE);
+			   STp->device->timeout, 0, TRUE);
 	if (SRpnt == NULL)
 		return (STp->buffer)->syscall_result;
 
@@ -2214,7 +2220,7 @@ static int write_mode_page(Scsi_Tape *STp, int page, int slow)
 	(STp->buffer)->b_data[pgo + MP_OFF_PAGE_NBR] &= MP_MSK_PAGE_NBR;
 
 	SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_WRITE,
-			   (slow ? STp->long_timeout : STp->timeout), 0, TRUE);
+			   (slow ? STp->long_timeout : STp->device->timeout), 0, TRUE);
 	if (SRpnt == NULL)
 		return (STp->buffer)->syscall_result;
 
@@ -2326,7 +2332,7 @@ static int do_load_unload(Scsi_Tape *STp, struct file *filp, int load_code)
 	}
 	if (STp->immediate) {
 		cmd[1] = 1;	/* Don't wait for completion */
-		timeout = STp->timeout;
+		timeout = STp->device->timeout;
 	}
 	else
 		timeout = STp->long_timeout;
@@ -2506,7 +2512,7 @@ static int st_int_ioctl(Scsi_Tape *STp, unsigned int cmd_in, unsigned long arg)
 		cmd[2] = (arg >> 16);
 		cmd[3] = (arg >> 8);
 		cmd[4] = arg;
-		timeout = STp->timeout;
+		timeout = STp->device->timeout;
                 DEBC(
                      if (cmd_in == MTWEOF)
                                printk(ST_DEB_MSG "%s: Writing %d filemarks.\n", name,
@@ -2524,7 +2530,7 @@ static int st_int_ioctl(Scsi_Tape *STp, unsigned int cmd_in, unsigned long arg)
 		cmd[0] = REZERO_UNIT;
 		if (STp->immediate) {
 			cmd[1] = 1;	/* Don't wait for completion */
-			timeout = STp->timeout;
+			timeout = STp->device->timeout;
 		}
                 DEBC(printk(ST_DEB_MSG "%s: Rewinding tape.\n", name));
 		fileno = blkno = at_sm = 0;
@@ -2537,7 +2543,7 @@ static int st_int_ioctl(Scsi_Tape *STp, unsigned int cmd_in, unsigned long arg)
 		cmd[0] = START_STOP;
 		if (STp->immediate) {
 			cmd[1] = 1;	/* Don't wait for completion */
-			timeout = STp->timeout;
+			timeout = STp->device->timeout;
 		}
 		cmd[4] = 3;
                 DEBC(printk(ST_DEB_MSG "%s: Retensioning tape.\n", name));
@@ -2570,7 +2576,7 @@ static int st_int_ioctl(Scsi_Tape *STp, unsigned int cmd_in, unsigned long arg)
 		cmd[1] = (arg ? 1 : 0);	/* Long erase with non-zero argument */
 		if (STp->immediate) {
 			cmd[1] |= 2;	/* Don't wait for completion */
-			timeout = STp->timeout;
+			timeout = STp->device->timeout;
 		}
 		else
 			timeout = STp->long_timeout * 8;
@@ -2622,7 +2628,7 @@ static int st_int_ioctl(Scsi_Tape *STp, unsigned int cmd_in, unsigned long arg)
 		(STp->buffer)->b_data[9] = (ltmp >> 16);
 		(STp->buffer)->b_data[10] = (ltmp >> 8);
 		(STp->buffer)->b_data[11] = ltmp;
-		timeout = STp->timeout;
+		timeout = STp->device->timeout;
                 DEBC(
 			if (cmd_in == MTSETBLK || cmd_in == SET_DENS_AND_BLK)
 				printk(ST_DEB_MSG
@@ -2803,7 +2809,7 @@ static int get_location(Scsi_Tape *STp, unsigned int *block, int *partition,
 		if (!logical && !STp->scsi2_logical)
 			scmd[1] = 1;
 	}
-	SRpnt = st_do_scsi(NULL, STp, scmd, 20, SCSI_DATA_READ, STp->timeout,
+	SRpnt = st_do_scsi(NULL, STp, scmd, 20, SCSI_DATA_READ, STp->device->timeout,
 			   MAX_READY_RETRIES, TRUE);
 	if (!SRpnt)
 		return (STp->buffer)->syscall_result;
@@ -2905,7 +2911,7 @@ static int set_location(Scsi_Tape *STp, unsigned int block, int partition,
 	}
 	if (STp->immediate) {
 		scmd[1] |= 1;		/* Don't wait for completion */
-		timeout = STp->timeout;
+		timeout = STp->device->timeout;
 	}
 
 	SRpnt = st_do_scsi(NULL, STp, scmd, 0, SCSI_DATA_NONE,
@@ -3103,6 +3109,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
 	ST_mode *STm;
 	ST_partstat *STps;
 	char *name = tape_name(STp);
+	void __user *p = (void __user *)arg;
 
 	if (down_interruptible(&STp->lock))
 		return -ERESTARTSYS;
@@ -3138,7 +3145,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
 			goto out;
 		}
 
-		i = copy_from_user((char *) &mtc, (char *) arg, sizeof(struct mtop));
+		i = copy_from_user(&mtc, p, sizeof(struct mtop));
 		if (i) {
 			retval = (-EFAULT);
 			goto out;
@@ -3374,8 +3381,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
 		if (STp->cleaning_req)
 			mt_status.mt_gstat |= GMT_CLN(0xffffffff);
 
-		i = copy_to_user((char *) arg, (char *) &(mt_status),
-				 sizeof(struct mtget));
+		i = copy_to_user(p, &mt_status, sizeof(struct mtget));
 		if (i) {
 			retval = (-EFAULT);
 			goto out;
@@ -3396,17 +3402,23 @@ static int st_ioctl(struct inode *inode, struct file *file,
 			goto out;
 		}
 		mt_pos.mt_blkno = blk;
-		i = copy_to_user((char *) arg, (char *) (&mt_pos), sizeof(struct mtpos));
+		i = copy_to_user(p, &mt_pos, sizeof(struct mtpos));
 		if (i)
 			retval = (-EFAULT);
 		goto out;
 	}
 	up(&STp->lock);
-	i = scsi_cmd_ioctl(STp->disk, cmd_in, arg);
-	if (i != -ENOTTY)
-		return i;
-	else
-		return scsi_ioctl(STp->device, cmd_in, (void *) arg);
+	switch (cmd_in) {
+		case SCSI_IOCTL_GET_IDLUN:
+		case SCSI_IOCTL_GET_BUS_NUMBER:
+			break;
+		default:
+			i = scsi_cmd_ioctl(STp->disk, cmd_in, p);
+			if (i != -ENOTTY)
+				return i;
+			break;
+	}
+	return scsi_ioctl(STp->device, cmd_in, p);
 
  out:
 	up(&STp->lock);
@@ -3465,7 +3477,7 @@ static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma)
 	if (nbr <= 0)
 		return FALSE;
 
-	priority = GFP_KERNEL;
+	priority = GFP_KERNEL | __GFP_NOWARN;
 	if (need_dma)
 		priority |= GFP_DMA;
 	for (b_size = PAGE_SIZE, order=0;
@@ -3482,8 +3494,6 @@ static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma)
 				order--;
 				continue;
 			}
-			printk(KERN_NOTICE "st: failed to enlarge buffer to %d bytes.\n",
-			       new_size);
 			DEB(STbuffer->buffer_size = got);
 			normalize_buffer(STbuffer);
 			return FALSE;
@@ -3495,9 +3505,6 @@ static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma)
 		segs++;
 	}
 	STbuffer->b_data = page_address(STbuffer->frp[0].page);
-        DEBC(printk(ST_DEB_MSG
-                    "st: Succeeded to enlarge buffer at %p to %d bytes (segs %d->%d, %d).\n",
-                    STbuffer, got, STbuffer->orig_frp_segs, STbuffer->frp_segs, b_size));
 
 	return TRUE;
 }
@@ -3513,11 +3520,6 @@ static void normalize_buffer(ST_buffer * STbuffer)
 		__free_pages(STbuffer->frp[i].page, order);
 		STbuffer->buffer_size -= STbuffer->frp[i].length;
 	}
-        DEB(
-	if (debugging && STbuffer->orig_frp_segs < STbuffer->frp_segs)
-		printk(ST_DEB_MSG "st: Buffer at %p normalized to %d bytes (segs %d->%d).\n",
-		       STbuffer, STbuffer->buffer_size, STbuffer->frp_segs, STbuffer->orig_frp_segs);
-        ) /* end DEB */
 	STbuffer->frp_segs = STbuffer->orig_frp_segs;
 	STbuffer->frp_sg_current = 0;
 }
@@ -3525,7 +3527,7 @@ static void normalize_buffer(ST_buffer * STbuffer)
 
 /* Move data from the user buffer to the tape buffer. Returns zero (success) or
    negative error code. */
-static int append_to_buffer(const char *ubp, ST_buffer * st_bp, int do_count)
+static int append_to_buffer(const char __user *ubp, ST_buffer * st_bp, int do_count)
 {
 	int i, cnt, res, offset;
 
@@ -3547,18 +3549,16 @@ static int append_to_buffer(const char *ubp, ST_buffer * st_bp, int do_count)
 		ubp += cnt;
 		offset = 0;
 	}
-	if (do_count) {		/* Should never happen */
-		printk(KERN_WARNING "st: append_to_buffer overflow (left %d).\n",
-		       do_count);
+	if (do_count) /* Should never happen */
 		return (-EIO);
-	}
+
 	return 0;
 }
 
 
 /* Move data from the tape buffer to the user buffer. Returns zero (success) or
    negative error code. */
-static int from_buffer(ST_buffer * st_bp, char *ubp, int do_count)
+static int from_buffer(ST_buffer * st_bp, char __user *ubp, int do_count)
 {
 	int i, cnt, res, offset;
 
@@ -3581,11 +3581,9 @@ static int from_buffer(ST_buffer * st_bp, char *ubp, int do_count)
 		ubp += cnt;
 		offset = 0;
 	}
-	if (do_count) {		/* Should never happen */
-		printk(KERN_WARNING "st: from_buffer overflow (left %d).\n",
-		       do_count);
+	if (do_count) /* Should never happen */
 		return (-EIO);
-	}
+
 	return 0;
 }
 
@@ -3606,10 +3604,6 @@ static void move_buffer_data(ST_buffer * st_bp, int offset)
 			break;
 		offset -= st_bp->frp[src_seg].length;
 	}
-	if (src_seg == st_bp->frp_segs) {	/* Should never happen */
-		printk(KERN_WARNING "st: move_buffer offset overflow.\n");
-		return;
-	}
 
 	st_bp->buffer_bytes = st_bp->read_pointer = total;
 	for (dst_seg=dst_offset=0; total > 0; ) {
@@ -3844,7 +3838,7 @@ static int st_probe(struct device *dev)
 	tpnt->partition = 0;
 	tpnt->new_partition = 0;
 	tpnt->nbr_partitions = 0;
-	tpnt->timeout = ST_TIMEOUT;
+	tpnt->device->timeout = ST_TIMEOUT;
 	tpnt->long_timeout = ST_LONG_TIMEOUT;
 	tpnt->try_dio = try_direct_io && !SDp->host->unchecked_isa_dma;
 
diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h
index 876f2a82c..56ca7a785 100644
--- a/drivers/scsi/st.h
+++ b/drivers/scsi/st.h
@@ -100,7 +100,6 @@ typedef struct {
 	unsigned char c_algo;			/* compression algorithm */
 	unsigned char pos_unknown;			/* after reset position unknown */
 	int tape_type;
-	int timeout;		/* timeout for normal commands */
 	int long_timeout;	/* timeout for commands known to take long time */
 
 	unsigned long max_pfn;	/* the maximum page number reachable by the HBA */
diff --git a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h
index c58f84836..ce819093a 100644
--- a/drivers/scsi/sym53c8xx_comm.h
+++ b/drivers/scsi/sym53c8xx_comm.h
@@ -59,12 +59,9 @@
 **	sym53c8xx and ncr53c8xx drivers should share.
 **	The sharing will be achieved in a further version  
 **	of the driver bundle. For now, only the ncr53c8xx 
-**	driver includes	this file.
+**	driver includes this file.
 */
 
-#define MIN(a,b)        (((a) < (b)) ? (a) : (b))
-#define MAX(a,b)        (((a) > (b)) ? (a) : (b))
-
 /*==========================================================
 **
 **	Hmmm... What complex some PCI-HOST bridges actually 
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index 6d5966fb2..c9c6cbc26 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -168,6 +168,10 @@
  *	2.1a  03/11/29  GL, KG	Initial fixing for 2.6. Convert to	*
  *				use the current PCI-mapping API, update	*
  *				command-queuing.			*
+ *	2.1b  04/04/13  GL	Fix for 64-bit platforms		*
+ *	2.1b1 04/01/31	GL	(applied 05.04) Remove internal		*
+ *				command-queuing.			*
+ *	2.1b2 04/02/01	CH	(applied 05.04) Fix error-handling	*
  ***********************************************************************/
 
 /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */
@@ -260,16 +264,10 @@
  * undef  : traditional save_flags; cli; restore_flags;
  */
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30)
-# include <linux/init.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,30)
-# include <linux/spinlock.h>
-#else
-# include <asm/spinlock.h>
-#endif
-#endif
+#include <linux/init.h>
+#include <linux/spinlock.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,99) && defined(MODULE)
+#if defined(MODULE)
 static struct pci_device_id tmscsim_pci_tbl[] = {
 	{
 		.vendor		= PCI_VENDOR_ID_AMD,
@@ -283,23 +281,10 @@ MODULE_DEVICE_TABLE(pci, tmscsim_pci_tbl);
 #endif
 	
 #define USE_SPINLOCKS 1
-#define NEW_PCI 1
 
-#define DC390_AFLAGS 
 #define DC390_IFLAGS unsigned long iflags
-#define DC390_DFLAGS unsigned long dflags
-spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
 #define DC390_LOCK_IO(dev) spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags)
 #define DC390_UNLOCK_IO(dev) spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags)
-#define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)
-#define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
-#define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
-#define DC390_UNLOCK_DRV_NI spin_unlock (&dc390_drvlock)
-#define DC390_LOCK_ACB /* DC390_LOCK_IO */
-#define DC390_UNLOCK_ACB /* DC390_UNLOCK_IO */
-#define DC390_LOCK_ACB_NI /* spin_lock (&(pACB->lock)) */
-#define DC390_UNLOCK_ACB_NI /* spin_unlock (&(pACB->lock)) */
-#define DC390_LOCKA_INIT /* DC390_LOCKA_INIT */
 
 /* These macros are used for uniform access to 2.0.x and 2.1.x PCI config space*/
 
@@ -313,10 +298,7 @@ spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
 #define PCI_READ_CONFIG_BYTE(pd, rv, bv) pci_read_config_byte (pd, rv, bv)
 #define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pci_write_config_word (pd, rv, bv)
 #define PCI_READ_CONFIG_WORD(pd, rv, bv) pci_read_config_word (pd, rv, bv)
-#define PCI_BUS_DEV pdev->bus->number, pdev->devfn
 #define PCI_PRESENT (1)
-#define PCI_SET_MASTER pci_set_master (pdev)
-#define PCI_FIND_DEVICE(vend, id) (pdev = pci_find_device (vend, id, pdev))
 #define PCI_GET_IO_AND_IRQ do{io_port = pci_resource_start (pdev, 0); irq = pdev->irq;} while(0)
 
 #include "tmscsim.h"
@@ -325,46 +307,42 @@ spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
 # define __init
 #endif
 
-UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
-void dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-void dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-void dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-void dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-void dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
+static void dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 static void dc390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus);
 
 static void dc390_SetXferRate( PACB pACB, PDCB pDCB );
-void dc390_Disconnect( PACB pACB );
-void dc390_Reselect( PACB pACB );
-void dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB );
-void dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd );
+static void dc390_Disconnect( PACB pACB );
+static void dc390_Reselect( PACB pACB );
+static void dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB );
+static void dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd );
 static void dc390_ScsiRstDetect( PACB pACB );
 static void dc390_ResetSCSIBus( PACB pACB );
 static void __inline__ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB );
 static void __inline__ dc390_InvalidCmd( PACB pACB );
 static void __inline__ dc390_EnableMsgOut_Abort (PACB, PSRB);
 static void dc390_remove_dev (PACB pACB, PDCB pDCB);
-irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *);
+static irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *);
 
-int    dc390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, UCHAR index );
-void   dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun);
-void   dc390_updateDCB (PACB pACB, PDCB pDCB);
+static int    dc390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, UCHAR index );
+static void   dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun);
+static void   dc390_updateDCB (PACB pACB, PDCB pDCB);
 
 static int DC390_release(struct Scsi_Host *host);
 static int dc390_shutdown (struct Scsi_Host *host);
 
-
-//static PSHT	dc390_pSHT_start = NULL;
-//static PSH	dc390_pSH_start = NULL;
-//static PSH	dc390_pSH_current = NULL;
 static PACB	dc390_pACB_start= NULL;
 static PACB	dc390_pACB_current = NULL;
 static ULONG	dc390_lastabortedpid = 0;
@@ -372,14 +350,11 @@ static UINT	dc390_laststatus = 0;
 static UCHAR	dc390_adapterCnt = 0;
 
 /* Startup values, to be overriden on the commandline */
-int tmscsim[] = {-2, -2, -2, -2, -2, -2};
+static int tmscsim[] = {-2, -2, -2, -2, -2, -2};
 
-# if defined(MODULE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30)
+#if defined(MODULE)
 MODULE_PARM(tmscsim, "1-6i");
 MODULE_PARM_DESC(tmscsim, "Host SCSI ID, Speed (0=10MHz), Device Flags, Adapter Flags, Max Tags (log2(tags)-1), DelayReset (s)");
-# endif
-
-#if defined(MODULE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30)
 MODULE_AUTHOR("C.L. Huang / Kurt Garloff");
 MODULE_DESCRIPTION("SCSI host adapter driver for Tekram DC390 and other AMD53C974A based PCI SCSI adapters");
 MODULE_LICENSE("GPL");
@@ -438,22 +413,15 @@ static char* dc390_p1_str[] = {
 #endif   
 
 /* Devices erroneously pretending to be able to do TagQ */
-UCHAR  dc390_baddevname1[2][28] ={
+static UCHAR  dc390_baddevname1[2][28] ={
        "SEAGATE ST3390N         9546",
        "HP      C3323-300       4269"};
 #define BADDEVCNT	2
 
 static char*  dc390_adapname = "DC390";
-UCHAR  dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN];
-UCHAR  dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20};
-UCHAR  dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20};
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,30)
-struct proc_dir_entry	DC390_proc_scsi_tmscsim ={
-       PROC_SCSI_DC390T, 7 ,"tmscsim",
-       S_IFDIR | S_IRUGO | S_IXUGO, 2
-       };
-#endif
+static UCHAR  dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN];
+static UCHAR  dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20};
+static UCHAR  dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20};
 
 /***********************************************************************
  * Functions for access to DC390 EEPROM
@@ -518,7 +486,7 @@ static void __init dc390_check_for_safe_settings (void)
 }
 
 
-int __initdata tmscsim_def[] = {7, 0 /* 10MHz */,
+static int __initdata tmscsim_def[] = {7, 0 /* 10MHz */,
 		PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_
 		| SYNC_NEGO_ | TAG_QUEUEING_,
 		MORE2_DRV | GREATER_1G | RST_SCSI_BUS | ACTIVE_NEGATION
@@ -549,8 +517,7 @@ static void __init dc390_fill_with_defaults (void)
 /* Override defaults on cmdline:
  * tmscsim: AdaptID, MaxSpeed (Index), DevMode (Bitmapped), AdaptMode (Bitmapped)
  */
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,13)
-int __init dc390_setup (char *str)
+static int __init dc390_setup (char *str)
 {	
 	int ints[8];
 	int i, im;
@@ -570,24 +537,6 @@ int __init dc390_setup (char *str)
 __setup("tmscsim=", dc390_setup);
 #endif
 
-#else
-void __init dc390_setup (char *str, int *ints)
-{
-	int i, im;
-	im = ints[0];
-	if (im > 6)
-	{
-		printk (KERN_NOTICE "DC390: ignore extra params!\n");
-		im = 6;
-	}
-	for (i = 0; i < im; i++)
-		tmscsim[i] = ints[i+1];
-	/* dc390_checkparams (); */
-}
-#endif
-
-
-
 static void __init dc390_EEpromOutDI( PDEVDECL, PUCHAR regval, UCHAR Carry )
 {
     UCHAR bval;
@@ -751,37 +700,6 @@ static PSRB dc390_find_cmd_in_SRBq (PSCSICMD cmd, PSRB queue)
     return q;
 }
 #endif
-    
-
-/* Append to Query List */
-static void dc390_Query_append( PSCSICMD cmd, PACB pACB )
-{
-	dc390_cmd_scp_t *cmdq = (dc390_cmd_scp_t *)&cmd->SCp;
-
-	DEBUG0(printk ("DC390: Append cmd %li to Query\n", cmd->pid));
-
-	list_add_tail(&cmdq->list, &pACB->cmdq);
-	pACB->QueryCnt++;
-	pACB->CmdOutOfSRB++;
-}
-
-
-/* Return next cmd from Query list */
-static PSCSICMD dc390_Query_get ( PACB pACB )
-{
-	PSCSICMD  pcmd;
-	dc390_cmd_scp_t *cmdq;
-	if (list_empty(&pACB->cmdq))
-		return NULL;
-
-	pcmd = (PSCSICMD) list_entry(pACB->cmdq.next, struct scsi_cmnd_list, scp.list);
-	DEBUG0(printk ("DC390: Get cmd %li from Query\n", pcmd->pid));
-	cmdq = (dc390_cmd_scp_t *)&pcmd->SCp;
-	list_del(&cmdq->list);
-	pACB->QueryCnt--;
-	return pcmd;
-}
-
 
 /* Return next free SRB */
 static __inline__ PSRB dc390_Free_get ( PACB pACB )
@@ -891,17 +809,7 @@ static __inline__ void dc390_Waiting_to_Going ( PDCB pDCB, PSRB pSRB )
 	dc390_Going_append (pDCB, pSRB);
 }
 
-/* 2.0 timer compatibility */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,30)
- static inline int timer_pending(struct timer_list * timer)
- {
-	return timer->prev != NULL;
- }
- #define time_after(a,b)         ((long)(b) - (long)(a) < 0)
- #define time_before(a,b)        time_after(b,a)
-#endif
-
-void DC390_waiting_timed_out (unsigned long ptr);
+static void DC390_waiting_timed_out (unsigned long ptr);
 /* Sets the timer to wake us up */
 static void dc390_waiting_timer (PACB pACB, unsigned long to)
 {
@@ -954,16 +862,13 @@ static void dc390_Waiting_process ( PACB pACB )
 }
 
 /* Wake up waiting queue */
-void DC390_waiting_timed_out (unsigned long ptr)
+static void DC390_waiting_timed_out (unsigned long ptr)
 {
 	PACB pACB = (PACB)ptr;
 	DC390_IFLAGS;
-	DC390_AFLAGS;
 	DEBUG0(printk ("DC390: Debug: Waiting queue woken up by timer!\n"));
 	DC390_LOCK_IO(pACB->pScsiHost);
-	DC390_LOCK_ACB;
 	dc390_Waiting_process (pACB);
-	DC390_UNLOCK_ACB;
 	DC390_UNLOCK_IO(pACB->pScsiHost);
 }
 
@@ -1022,7 +927,7 @@ static int dc390_pci_map (PSRB pSRB)
 			pci_map_page(pdev, virt_to_page(pcmd->sense_buffer),
 				     (unsigned long)pcmd->sense_buffer & ~PAGE_MASK, sizeof(pcmd->sense_buffer),
 				     DMA_FROM_DEVICE);
-		pSRB->Segmentx.length = sizeof(pcmd->sense_buffer);
+		sg_dma_len(&pSRB->Segmentx) = sizeof(pcmd->sense_buffer);
 		pSRB->SGcount = 1;
 		pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
 		DEBUG1(printk("%s(): Mapped sense buffer %p at %x\n", __FUNCTION__, pcmd->sense_buffer, cmdp->saved_dma_handle));
@@ -1043,7 +948,7 @@ static int dc390_pci_map (PSRB pSRB)
 				     (unsigned long)pcmd->request_buffer & ~PAGE_MASK,
 				     pcmd->request_bufflen, scsi_to_pci_dma_dir(pcmd->sc_data_direction));
 		/* TODO: error handling */
-		pSRB->Segmentx.length = pcmd->request_bufflen;
+		sg_dma_len(&pSRB->Segmentx) = pcmd->request_bufflen;
 		pSRB->SGcount = 1;
 		pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
 		DEBUG1(printk("%s(): Mapped request buffer %p at %x\n", __FUNCTION__, pcmd->request_buffer, cmdp->saved_dma_handle));
@@ -1113,37 +1018,6 @@ static void dc390_BuildSRB (Scsi_Cmnd* pcmd, PDCB pDCB, PSRB pSRB)
     /* KG: deferred PCI mapping to dc390_StartSCSI */
 }
 
-/* Put cmnd from Query to Waiting list and send next Waiting cmnd */
-static void dc390_Query_to_Waiting (PACB pACB)
-{
-    Scsi_Cmnd *pcmd;
-    PSRB   pSRB;
-    PDCB   pDCB;
-
-    if( pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV) )
-	return;
-
-    while (pACB->QueryCnt)
-    {
-	pSRB = dc390_Free_get ( pACB );
-	if (!pSRB) return;
-	pcmd = dc390_Query_get ( pACB );
-	if (!pcmd) { dc390_Free_insert (pACB, pSRB); return; } /* should not happen */
-	pDCB = dc390_findDCB (pACB, pcmd->device->id, pcmd->device->lun);
-	if (!pDCB) 
-	{ 
-		dc390_Free_insert (pACB, pSRB);
-		printk (KERN_ERR "DC390: Command in queue to non-existing device!\n");
-		pcmd->result = MK_RES(DRIVER_ERROR,DID_ERROR,0,0);
-		DC390_UNLOCK_ACB_NI;
-		pcmd->done (pcmd);
-		DC390_LOCK_ACB_NI;
-	}
-	dc390_BuildSRB (pcmd, pDCB, pSRB);
-	dc390_Waiting_append ( pDCB, pSRB );
-    }
-}
-
 /***********************************************************************
  * Function : static int DC390_queue_command (Scsi_Cmnd *cmd,
  *					       void (*done)(Scsi_Cmnd *))
@@ -1163,24 +1037,17 @@ static void dc390_Query_to_Waiting (PACB pACB)
  *
  ***********************************************************************/
 
-int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
+static int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
 {
     PDCB   pDCB;
     PSRB   pSRB;
     PACB   pACB = (PACB) cmd->device->host->hostdata;
-    DC390_AFLAGS;
-
 
     DEBUG0(/*  if(pACB->scan_devices) */	\
 	printk(KERN_INFO "DC390: Queue Cmd=%02x,Tgt=%d,LUN=%d (pid=%li), buffer=%p\n",\
 	       cmd->cmnd[0],cmd->device->id,cmd->device->lun,cmd->pid, cmd->buffer));
 
-    DC390_LOCK_ACB;
-    
-    /* Assume BAD_TARGET; will be cleared later */
-    cmd->result = DID_BAD_TARGET << 16;
-   
-    /* TODO: Change the policy: Alway accept TEST_UNIT_READY or INQUIRY 
+    /* TODO: Change the policy: Always accept TEST_UNIT_READY or INQUIRY 
      * commands and alloc a DCB for the device if not yet there. DCB will
      * be removed in dc390_SRBdone if SEL_TIMEOUT */
 
@@ -1190,17 +1057,6 @@ int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
     else if( (pACB->scan_devices) && (cmd->cmnd[0] == READ_6) )
 	pACB->scan_devices = 0;
 
-    if ( ( cmd->device->id >= pACB->pScsiHost->max_id ) || 
-	 (cmd->device->lun >= pACB->pScsiHost->max_lun) )
-    {
-/*	printk ("DC390: Ignore target %d lun %d\n",
-		cmd->device->id, cmd->device->lun); */
-	DC390_UNLOCK_ACB;
-	//return (1);
-	done (cmd);
-	return (0);
-    }
-
     if( (pACB->scan_devices || cmd->cmnd[0] == TEST_UNIT_READY || cmd->cmnd[0] == INQUIRY) && 
        !(pACB->DCBmap[cmd->device->id] & (1 << cmd->device->lun)) )
     {
@@ -1211,14 +1067,7 @@ int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
 	  {
 	    printk (KERN_ERR "DC390: kmalloc for DCB failed, target %02x lun %02x\n", 
 		    cmd->device->id, cmd->device->lun);
-	    DC390_UNLOCK_ACB;
-	    printk ("DC390: No DCB in queue_command!\n");
-#ifdef USE_NEW_EH
-	    return (1);
-#else
-	    done (cmd);
-	    return (0);
-#endif
+	    goto fail;
 	  }
             
     }
@@ -1226,10 +1075,7 @@ int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
     {
 	printk(KERN_INFO "DC390: Ignore target %02x lun %02x\n",
 		cmd->device->id, cmd->device->lun); 
-	DC390_UNLOCK_ACB;
-	//return (1);
-	done (cmd);
-	return (0);
+	goto fail;
     }
     else
     {
@@ -1238,60 +1084,34 @@ int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
 	 {  /* should never happen */
 	    printk (KERN_ERR "DC390: no DCB failed, target %02x lun %02x\n", 
 		    cmd->device->id, cmd->device->lun);
-	    DC390_UNLOCK_ACB;
-	    printk ("DC390: No DCB in queuecommand (2)!\n");
-#ifdef USE_NEW_EH
-	    return (1);
-#else
-	    done (cmd);
-	    return (0);
-#endif
+	    goto fail;
 	 }
     }
 
     pACB->Cmds++;
     cmd->scsi_done = done;
     cmd->result = 0;
-	
-    dc390_Query_to_Waiting (pACB);
 
-    if( pACB->QueryCnt ) /* Unsent commands ? */
-    {
-	DEBUG0(printk ("DC390: QueryCnt != 0\n"));
-	dc390_Query_append ( cmd, pACB );
-	dc390_Waiting_process (pACB);
-    }
-    else if (pDCB->pWaitingSRB)
-    {
- 	pSRB = dc390_Free_get ( pACB );
-	DEBUG0(if (!pSRB) printk ("DC390: No free SRB but Waiting\n"); else printk ("DC390: Free SRB w/ Waiting\n"));
-	if (!pSRB) dc390_Query_append (cmd, pACB);
-	else 
-	  {
-	    dc390_BuildSRB (cmd, pDCB, pSRB);
-	    dc390_Waiting_append (pDCB, pSRB);
-	  }
-	dc390_Waiting_process (pACB);
-    }
-    else
-    {
- 	pSRB = dc390_Free_get ( pACB );
-	DEBUG0(if (!pSRB) printk ("DC390: No free SRB w/o Waiting\n"); else printk ("DC390: Free SRB w/o Waiting\n"));
-	if (!pSRB)
-	{
-	    dc390_Query_append (cmd, pACB);
-	    dc390_Waiting_process (pACB);
-	}
-	else 
-	{
-	    dc390_BuildSRB (cmd, pDCB, pSRB);
-	    dc390_SendSRB (pACB, pSRB);
-	}
-    }
+    pSRB = dc390_Free_get(pACB);
+    if (!pSRB)
+	    goto requeue;
+
+    dc390_BuildSRB(cmd, pDCB, pSRB);
+    if (pDCB->pWaitingSRB) {
+	    dc390_Waiting_append(pDCB, pSRB);
+	    dc390_Waiting_process(pACB);
+    } else
+	    dc390_SendSRB(pACB, pSRB);
 
-    DC390_UNLOCK_ACB;
     DEBUG1(printk (KERN_DEBUG " ... command (pid %li) queued successfully.\n", cmd->pid));
     return(0);
+
+ requeue:
+    return 1;
+ fail:
+    cmd->result = DID_BAD_TARGET << 16;
+    done(cmd);
+    return 0;
 }
 
 /* We ignore mapping problems, as we expect everybody to respect 
@@ -1384,8 +1204,8 @@ static int partsize(unsigned char *buf, unsigned long capacity,
  * Note:
  *   In contrary to other externally callable funcs (DC390_), we don't lock
  ***********************************************************************/
-int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
-		sector_t capacity, int geom[])
+static int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
+			     sector_t capacity, int geom[])
 {
     int heads, sectors, cylinders;
     PACB pACB = (PACB) sdev->host->hostdata;
@@ -1421,15 +1241,14 @@ int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
     return (0);
 }
 #else
-int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
-		sector_t capacity, int geom[])
+static int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
+			     sector_t capacity, int geom[])
 {
     return scsicam_bios_param (bdev, capacity, geom);
 }
 #endif
 
-
-void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
+static void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
 {
     USHORT pstat; PDEVDECL1;
     if (!pDCB) pDCB = pACB->pActiveDCB;
@@ -1483,7 +1302,7 @@ void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
  * Status: Buggy !
  ***********************************************************************/
 
-int DC390_abort (Scsi_Cmnd *cmd)
+static int DC390_abort (Scsi_Cmnd *cmd)
 {
     PDCB  pDCB;
     PSRB  pSRB, psrb;
@@ -1491,28 +1310,10 @@ int DC390_abort (Scsi_Cmnd *cmd)
     int   status;
     //ULONG sbac;
     PACB  pACB = (PACB) cmd->device->host->hostdata;
-    DC390_AFLAGS;
-
-    DC390_LOCK_ACB;
 
     printk ("DC390: Abort command (pid %li, Device %02i-%02i)\n",
 	    cmd->pid, cmd->device->id, cmd->device->lun);
 
-    /* First scan Query list */
-    if( pACB->QueryCnt )
-    {
-	struct scsi_cmnd_list *t, *pcmd_l;
-	list_for_each_entry_safe(pcmd_l, t, &pACB->cmdq, scp.list)
-		if( (struct scsi_cmnd*)pcmd_l == cmd )
-		{
-			/* Found: Dequeue */
-			list_del(&pcmd_l->scp.list);
-			pACB->QueryCnt--;
-			status = SCSI_ABORT_SUCCESS;
-			goto  ABO_X;
-		}
-    }
-	
     pDCB = dc390_findDCB (pACB, cmd->device->id, cmd->device->lun);
     if( !pDCB ) goto  NOT_RUN;
 
@@ -1625,7 +1426,6 @@ ABO_X:
     }
 #endif
     dc390_lastabortedpid = cmd->pid;
-    DC390_UNLOCK_ACB;
     //do_DC390_Interrupt (pACB->IRQLevel, 0, 0);
 #ifndef USE_NEW_EH	
     if (status == SCSI_ABORT_SUCCESS) cmd->scsi_done(cmd);
@@ -1708,15 +1508,13 @@ static void dc390_RecoverSRB( PACB pACB )
  * Returns : 0 on success.
  ***********************************************************************/
 
-int DC390_reset (Scsi_Cmnd *cmd)
+static int DC390_reset (Scsi_Cmnd *cmd)
 {
     UCHAR   bval;
     PACB    pACB = (PACB) cmd->device->host->hostdata;
-    DC390_AFLAGS;
 
     printk(KERN_INFO "DC390: RESET ... ");
 
-    DC390_LOCK_ACB;
     if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer);
     bval = DC390_read8 (CtrlReg1);
     bval |= DIS_INT_ON_SCSI_RST;
@@ -1745,7 +1543,6 @@ int DC390_reset (Scsi_Cmnd *cmd)
     dc390_Waiting_process( pACB );
 
     printk("done\n");
-    DC390_UNLOCK_ACB;
     return( SCSI_RESET_SUCCESS );
 }
 
@@ -1760,14 +1557,14 @@ int DC390_reset (Scsi_Cmnd *cmd)
  * Inputs : SCSI id and lun
  ***********************************************************************/
 
-void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun )
+static void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun )
 {
     PEEprom	prom;
     UCHAR	index;
     PDCB pDCB, pDCB2;
 
     pDCB = kmalloc (sizeof(DC390_DCB), GFP_ATOMIC);
-    DCBDEBUG(printk (KERN_INFO "DC390: alloc mem for DCB (ID %i, LUN %i): %p\n"	\
+    DCBDEBUG(printk (KERN_INFO "DC390: alloc mem for DCB (ID %i, LUN %i): %p\n",	\
 		     id, lun, pDCB));
  
     *ppDCB = pDCB;
@@ -1845,7 +1642,7 @@ void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun )
  * Purpose :  Set the configuration dependent DCB parameters
  ***********************************************************************/
 
-void dc390_updateDCB (PACB pACB, PDCB pDCB)
+static void dc390_updateDCB (PACB pACB, PDCB pDCB)
 {
   pDCB->SyncMode &= EN_TAG_QUEUEING | SYNC_NEGO_DONE /*| EN_ATN_STOP*/;
   if (pDCB->DevMode & TAG_QUEUEING_) {
@@ -1869,25 +1666,6 @@ void dc390_updateDCB (PACB pACB, PDCB pDCB)
 	pDCB->CtrlR1 |= PARITY_ERR_REPO;
 }  
 
-
-/***********************************************************************
- * Function : static void dc390_updateDCBs ()
- *
- * Purpose :  Set the configuration dependent DCB params for all DCBs
- ***********************************************************************/
-
-static void dc390_updateDCBs (PACB pACB)
-{
-  int i;
-  PDCB pDCB = pACB->pLinkDCB;
-  for (i = 0; i < pACB->DCBCnt; i++)
-    {
-      dc390_updateDCB (pACB, pDCB);
-      pDCB = pDCB->pNextDCB;
-    }
-}
-  
-
 /***********************************************************************
  * Function : static void dc390_initSRB()
  *
@@ -1902,7 +1680,7 @@ static void __inline__ dc390_initSRB( PSRB psrb )
 }
 
 
-void dc390_linkSRB( PACB pACB )
+static void dc390_linkSRB( PACB pACB )
 {
     UINT   count, i;
 
@@ -1927,11 +1705,10 @@ void dc390_linkSRB( PACB pACB )
  *	    io_port, Irq, index: Resources and adapter index
  ***********************************************************************/
 
-void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
+static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
 {
     PACB    pACB;
     UCHAR   i;
-    DC390_AFLAGS;
 
     psh->can_queue = MAX_CMD_QUEUE;
     psh->cmd_per_lun = MAX_CMD_PER_LUN;
@@ -1939,11 +1716,7 @@ void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
     psh->io_port = io_port;
     psh->n_io_port = 0x80;
     psh->irq = Irq;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,50)
     psh->base = io_port;
-#else
-    psh->base = (char*)io_port;
-#endif	
     psh->unique_id = io_port;
     psh->dma_channel = -1;
     psh->last_reset = jiffies;
@@ -1970,8 +1743,6 @@ void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
     pACB->pActiveDCB = NULL;
     pACB->pFreeSRB = pACB->SRB_array;
     pACB->SRBCount = MAX_SRB_CNT;
-    pACB->QueryCnt = 0;
-    INIT_LIST_HEAD(&pACB->cmdq);
     pACB->AdapterIndex = index;
     pACB->status = 0;
     psh->this_id = dc390_eepromBuf[index][EE_ADAPT_SCSI_ID];
@@ -2007,7 +1778,7 @@ void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
  * Outputs: 0 on success, -1 on error
  ***********************************************************************/
 
-int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
+static int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
 {
     PACB   pACB, pACB2;
     UCHAR  dstate;
@@ -2086,7 +1857,7 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
  * Inputs : host - pointer to this host adapter's structure
  *	    io_port - IO ports mapped to this adapter
  *	    Irq - IRQ assigned to this adpater
- *	    PDEVDECL - PCI access handle
+ *	    struct pci_dev - PCI access handle
  *	    index - Adapter index
  *
  * Outputs: 0 on success, -1 on error
@@ -2095,12 +1866,11 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
  *	not in DC390_detect, called from outside 
  ***********************************************************************/
 
-static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, PDEVDECL, UCHAR index)
+static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, struct pci_dev *pdev, UCHAR index)
 {
     PSH   psh;
     PACB  pACB;
-    DC390_AFLAGS;
-    
+
     if (dc390_CheckEEpromCheckSum (PDEV, index))
     {
 	int speed;
@@ -2126,21 +1896,6 @@ static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, PDEVDECL, UCH
 	
     scsi_set_device(psh, &pdev->dev);
     pACB = (PACB) psh->hostdata;
-    DC390_LOCKA_INIT;
-    DC390_LOCK_ACB;
-
-#if 0
-    if( !dc390_pSH_start )
-    {
-        dc390_pSH_start = psh;
-        dc390_pSH_current = psh;
-    }
-    else
-    {
-        dc390_pSH_current->next = psh;
-        dc390_pSH_current = psh;
-    }
-#endif
 
     DEBUG0(printk(KERN_INFO "DC390: pSH = %8x, Index %02i\n", (UINT) psh, index));
 
@@ -2154,59 +1909,15 @@ static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, PDEVDECL, UCH
 		      (UINT) pACB, (UINT) pACB->DCBmap, (UINT) pACB->SRB_array));
 	DEBUG0(printk("DC390: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",\
 		      sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) ));
-
-	DC390_UNLOCK_ACB;
         return (0);
     }
     else
     {
-	//dc390_pSH_start = NULL;
 	scsi_unregister( psh );
-	DC390_UNLOCK_ACB;
 	return( -1 );
     }
 }
 
-
-/***********************************************************************
- * Function : int DC390_detect(Scsi_Host_Template *psht)
- *
- * Purpose : detects and initializes AMD53C974 SCSI chips
- *	     that were autoprobed, overridden on the LILO command line,
- *	     or specified at compile time.
- *
- * Inputs : psht - template for this SCSI adapter
- *
- * Returns : number of host adapters detected
- *
- ***********************************************************************/
-
-#ifndef NEW_PCI
-/* Acc. to PCI 2.1 spec it's up to the driver to enable Bus mastering:
- * We use pci_set_master () for 2.1.x and this func for 2.0.x:	*/
-static void __init dc390_set_master (PDEVDECL)
-{
-	USHORT cmd;
-	UCHAR lat;
-	
-	PCI_READ_CONFIG_WORD (PDEV, PCI_COMMAND, &cmd);
-	
-        if (! (cmd & PCI_COMMAND_MASTER)) {	
-		printk("PCI: Enabling bus mastering for device %02x:%02x\n",
-		       PCI_BUS_DEV);
-		cmd |= PCI_COMMAND_MASTER;
-		PCI_WRITE_CONFIG_WORD(PDEV, PCI_COMMAND, cmd);
-	}
-	PCI_READ_CONFIG_BYTE (PDEV, PCI_LATENCY_TIMER, &lat);
-	if (lat < 16 /* || lat == 255 */) {
-		printk("PCI: Setting latency timer of device %02x:%02x from %i to 64\n",
-		       PCI_BUS_DEV, lat);
-		PCI_WRITE_CONFIG_BYTE(PDEV, PCI_LATENCY_TIMER, 64);
-	}
-	
-}
-#endif /* ! NEW_PCI */
-
 static void __init dc390_set_pci_cfg (PDEVDECL)
 {
 	USHORT cmd;
@@ -2215,30 +1926,31 @@ static void __init dc390_set_pci_cfg (PDEVDECL)
 	PCI_WRITE_CONFIG_WORD (PDEV, PCI_COMMAND, cmd);
 	PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));
 }
-	
 
 int __init DC390_detect (Scsi_Host_Template *psht)
 {
-    PDEVDECL0;
+    struct pci_dev *pdev = NULL;
     UCHAR   irq;
     ULONG   io_port;
 
-    //dc390_pSHT_start = psht;
     dc390_pACB_start = NULL;
 
     if ( PCI_PRESENT )
-	while (PCI_FIND_DEVICE (PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974))
+	    while ((pdev = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974, pdev)))
 	{
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,30)
 	    if (pci_enable_device (pdev))
 		continue;
-#endif
+
+	    if (pci_set_dma_mask(pdev, 0xffffffff)) {
+		    printk(KERN_ERR "DC390(%i): No suitable DMA available.\n", dc390_adapterCnt);
+		    continue;
+	    }
 	    PCI_GET_IO_AND_IRQ;
 	    DEBUG0(printk(KERN_INFO "DC390(%i): IO_PORT=%04x,IRQ=%x\n", dc390_adapterCnt, (UINT) io_port, irq));
 
 	    if( !DC390_init(psht, io_port, irq, PDEV, dc390_adapterCnt))
 	    {
-		PCI_SET_MASTER;
+		pci_set_master(pdev);
 		dc390_set_pci_cfg (PDEV);
 		dc390_adapterCnt++;
 	    }
@@ -2247,495 +1959,12 @@ int __init DC390_detect (Scsi_Host_Template *psht)
 	printk (KERN_ERR "DC390: No PCI BIOS found!\n");
    
     if (dc390_adapterCnt)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,30)
 	psht->proc_name = "tmscsim";
-#else
-	psht->proc_dir = &DC390_proc_scsi_tmscsim;
-#endif
+
     printk(KERN_INFO "DC390: %i adapters found\n", dc390_adapterCnt);
     return( dc390_adapterCnt );
 }
 
-
-/***********************************************************************
- * Functions: dc390_inquiry(), dc390_inquiry_done()
- *
- * Purpose: When changing speed etc., we have to issue an INQUIRY
- *	    command to make sure, we agree upon the nego parameters
- *	    with the device
- ***********************************************************************/
-
-static void dc390_inquiry_done (Scsi_Cmnd* cmd)
-{
-   printk (KERN_INFO "DC390: INQUIRY (ID %02x LUN %02x) returned %08x\n",
-	   cmd->device->id, cmd->device->lun, cmd->result);
-   if (cmd->result)
-   {
-	PACB pACB = (PACB)cmd->device->host->hostdata;
-	PDCB pDCB = dc390_findDCB (pACB, cmd->device->id, cmd->device->lun);
-	printk ("DC390: Unsetting DsCn, Sync and TagQ!\n");
-	if (pDCB)
-	{
-		pDCB->DevMode &= ~(SYNC_NEGO_ | TAG_QUEUEING_ | EN_DISCONNECT_ );
-		dc390_updateDCB (pACB, pDCB);
-	}
-   }
-   kfree (cmd);
-}
-
-void dc390_inquiry (PACB pACB, PDCB pDCB)
-{
-   char* buffer;
-   Scsi_Cmnd* cmd;
-   cmd = kmalloc (sizeof(Scsi_Cmnd) + 256, GFP_ATOMIC);
-   if (!cmd) { printk ("DC390: kmalloc failed in inquiry!\n"); return; }
-   buffer = (char*)cmd + sizeof(Scsi_Cmnd);
-
-   memset (cmd, 0, sizeof(Scsi_Cmnd) + 256);
-   cmd->cmnd[0] = INQUIRY;
-   cmd->cmnd[1] = (pDCB->TargetLUN << 5) & 0xe0;
-   cmd->cmnd[4] = 0xff;
-   
-   cmd->cmd_len = 6; cmd->old_cmd_len = 6;
-/* TODO FIXME */
-/*    cmd->host = pACB->pScsiHost; */
-   cmd->device->id = pDCB->TargetID;
-   cmd->device->lun = pDCB->TargetLUN; 
-   cmd->serial_number = 1;
-   cmd->pid = 390;
-   cmd->bufflen = 128;
-   cmd->buffer = buffer;
-   cmd->request_bufflen = 128;
-   cmd->request_buffer = &buffer[128];
-   cmd->done = dc390_inquiry_done;
-   cmd->scsi_done = dc390_inquiry_done;
-   cmd->timeout_per_command = HZ;
-
-   cmd->request->rq_status = RQ_SCSI_BUSY;
-
-   pDCB->SyncMode &= ~SYNC_NEGO_DONE;
-   printk (KERN_INFO "DC390: Queue INQUIRY command to dev ID %02x LUN %02x\n",
-	   pDCB->TargetID, pDCB->TargetLUN);
-   DC390_queue_command (cmd, dc390_inquiry_done);
-}
-
-/***********************************************************************
- * Functions: dc390_sendstart(), dc390_sendstart_done()
- *
- * Purpose: When changing speed etc., we have to issue an INQUIRY
- *	    command to make sure, we agree upon the nego parameters
- *	    with the device
- ***********************************************************************/
-
-static void dc390_sendstart_done (Scsi_Cmnd* cmd)
-{
-   printk (KERN_INFO "DC390: SENDSTART (ID %02x LUN %02x) returned %08x\n",
-	   cmd->device->id, cmd->device->lun, cmd->result);
-   kfree (cmd);
-}
-
-void dc390_sendstart (PACB pACB, PDCB pDCB)
-{
-   char* buffer;
-   Scsi_Cmnd* cmd;
-   cmd = kmalloc (sizeof(Scsi_Cmnd) + 256, GFP_ATOMIC);
-   if (!cmd) { printk ("DC390: kmalloc failed in sendstart!\n"); return; }
-   buffer = (char*)cmd + sizeof(Scsi_Cmnd);
-
-   memset (cmd, 0, sizeof(Scsi_Cmnd) + 256);
-   cmd->cmnd[0] = 0x1b; /* START_STOP_UNIT */
-   cmd->cmnd[1] = (pDCB->TargetLUN << 5) & 0xe0;
-   cmd->cmnd[4] = 0x01; /* START */
-   
-   cmd->cmd_len = 6; cmd->old_cmd_len = 6;
-/* TODO FIXME */
-/*    cmd->host = pACB->pScsiHost; */
-   cmd->device->id = pDCB->TargetID;
-   cmd->device->lun = pDCB->TargetLUN; 
-   cmd->serial_number = 1;
-   cmd->pid = 310;
-   cmd->bufflen = 128;
-   cmd->buffer = buffer;
-   cmd->request_bufflen = 128;
-   cmd->request_buffer = &buffer[128];
-   cmd->done = dc390_sendstart_done;
-   cmd->scsi_done = dc390_sendstart_done;
-   cmd->timeout_per_command = 5*HZ;
-
-   cmd->request->rq_status = RQ_SCSI_BUSY;
-
-   pDCB->SyncMode &= ~SYNC_NEGO_DONE;
-   printk (KERN_INFO "DC390: Queue SEND_START command to dev ID %02x LUN %02x\n",
-	   pDCB->TargetID, pDCB->TargetLUN);
-   DC390_queue_command (cmd, dc390_sendstart_done);
-}
-
-/********************************************************************
- * Function: dc390_set_info()
- *
- * Purpose: Change adapter config
- *
- * Strings are parsed similar to the output of tmscsim_proc_info ()
- * '-' means no change
- *******************************************************************/
-
-static int dc390_scanf (char** buffer, char** pos, char** p0, int* var)
-{
-   *p0 = *pos;
-   *var = simple_strtoul (*p0, pos, 10);
-   if (*p0 == *pos) return -1;
-   *pos = strsep (buffer, " \t\n:=,;.");
-   return 0;
-}
-
-#define SCANF(buffer, pos, p0, var, min, max)		\
-if (dc390_scanf (&buffer, &pos, &p0, &var)) goto einv;	\
-else if (var<min || var>max) goto einv2
-
-static int dc390_yesno (char** buffer, char** pos, char* var, char bmask)
-{
-   switch (**pos)
-     {
-      case 'Y': *var |= bmask; break;
-      case 'N': *var &= ~bmask; break;
-      case '-': break;
-      default: return -1;
-     }
-   *pos = strsep (buffer, " \t\n:=,;");
-   return 0;
-}
-
-#define YESNO(buffer, pos, var, bmask)					\
-	if (dc390_yesno (&buffer, &pos, &var, bmask)) goto einv;	\
-	else dc390_updateDCB (pACB, pDCB);				\
-	if (!pos) goto ok
-
-static int dc390_search (char** buffer, char** pos, char** p0, char* var, char* txt, int max, int scale, char* ign)
-{
-   int dum;
-   if (! memcmp (*pos, txt, strlen(txt)))
-     {
-	*p0 = strsep (buffer, " \t\n:=,;");
-	if (!*p0) return -1;
-	dum = simple_strtoul (*p0, pos, 10);
-	if (*p0 == *pos) return -1;
-	if (dum >= 0 && dum <= max) 
-	  { *var = (dum * 100) / scale; }
-	else return -2;
-	*pos = strsep (buffer, " \t\n:=,;");
-	if (*ign && *pos && strlen(*pos) >= strlen(ign) && 
-	    !(memcmp (*pos, ign, strlen(ign)))) 
-		*pos = strsep (buffer, " \t\n:=,;");
-
-     }
-   return 0;
-}
-
-#define SEARCH(buffer, pos, p0, var, txt, max)						\
-if (dc390_search (&buffer, &pos, &p0, (PUCHAR)(&var), txt, max, 100, "")) goto einv2;	\
-else if (!p1) goto ok2
-
-#define SEARCH2(buffer, pos, p0, var, txt, max, scale)					\
-if (dc390_search (&buffer, &pos, &p0, &var, txt, max, scale, "")) goto einv2; 		\
-else if (!p1) goto ok2
-
-#define SEARCH3(buffer, pos, p0, var, txt, max, scale, ign)				\
-if (dc390_search (&buffer, &pos, &p0, &var, txt, max, scale, ign)) goto einv2;		\
-else if (!p1) goto ok2
-
-
-#ifdef DC390_PARSEDEBUG
-static char _prstr[256];
-char* prstr (char* p, char* e)
-{
-   char* c = _prstr;
-   while (p < e)
-     if (*p == 0) { *c++ = ':'; p++; }
-     else if (*p == 10) { *c++ = '\\'; *c++ = 'n'; p++; }
-     else *c++ = *p++;
-   *c = 0;
-   return _prstr;
-}
-#endif
-
-int dc390_set_info (char *buffer, int length, PACB pACB)
-{
-  char *pos = buffer, *p0 = buffer;
-  char needs_inquiry = 0; 
-  int dum = 0;
-  char dev;
-  PDCB pDCB = pACB->pLinkDCB;
-  DC390_IFLAGS;
-  DC390_AFLAGS;
-  pos[length] = 0;
-
-  DC390_LOCK_IO(pACB->pScsiHost);
-  DC390_LOCK_ACB;
-  /* UPPERCASE */ 
-  /* Don't use kernel toupper, because of 2.0.x bug: ctmp unexported */
-  while (*pos) 
-    { if (*pos >='a' && *pos <= 'z') *pos = *pos + 'A' - 'a'; pos++; }
-  
-  /* Remove WS */
-  pos = strsep (&buffer, " \t:\n=,;");
-  if (!*pos) goto ok;
-   
- next:
-  if (!memcmp (pos, "RESET", 5)) goto reset;
-  else if (!memcmp (pos, "INQUIRY", 7)) goto inquiry;
-  else if (!memcmp (pos, "REMOVE", 6)) goto remove;
-  else if (!memcmp (pos, "ADD", 3)) goto add;
-  else if (!memcmp (pos, "START", 5)) goto start;
-  else if (!memcmp (pos, "DUMP", 4)) goto dump;
-  
-  if (isdigit (*pos))
-    {
-      /* Device config line */
-      int dev, id, lun; char* pdec;
-      char olddevmode;
-      
-      SCANF (buffer, pos, p0, dev, 0, pACB->DCBCnt-1);
-      if (*pos) { SCANF (buffer, pos, p0, id, 0, 7); } else goto einv;
-      if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
-      if (!*pos) goto einv;
-      
-      PARSEDEBUG(printk (KERN_INFO "DC390: config line %i %i %i:\"%s\"\n", dev, id, lun, prstr (pos, &buffer[length])));
-      pDCB = pACB->pLinkDCB;
-      for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
-      /* Sanity Check */
-      if (pDCB->TargetID != id || pDCB->TargetLUN != lun) 
-	 {
-	    printk (KERN_ERR "DC390: no such device: Idx=%02i ID=%02i LUN=%02i\n",
-		    dev, id, lun);
-	    goto einv2;
-	 }
-
-      if (pDCB->pWaitingSRB || pDCB->pGoingSRB)
-      {
-	  printk ("DC390: Cannot change dev (%i-%i) cfg: Pending requests\n",
-		  pDCB->TargetID, pDCB->TargetLUN);
-	  goto einv;
-      }
-	  
-      olddevmode = pDCB->DevMode;
-      YESNO (buffer, pos, pDCB->DevMode, PARITY_CHK_);
-      needs_inquiry++;
-      YESNO (buffer, pos, pDCB->DevMode, SYNC_NEGO_);
-      if ((olddevmode & SYNC_NEGO_) == (pDCB->DevMode & SYNC_NEGO_)) needs_inquiry--;
-      needs_inquiry++;
-      YESNO (buffer, pos, pDCB->DevMode, EN_DISCONNECT_);
-      if ((olddevmode & EN_DISCONNECT_) == (pDCB->DevMode & EN_DISCONNECT_)) needs_inquiry--;
-      YESNO (buffer, pos, pDCB->DevMode, SEND_START_);
-      needs_inquiry++;
-      YESNO (buffer, pos, pDCB->DevMode, TAG_QUEUEING_);
-      if ((olddevmode & TAG_QUEUEING_) == (pDCB->DevMode & TAG_QUEUEING_)) needs_inquiry--;
-
-      dc390_updateDCB (pACB, pDCB);
-      if (!*pos) goto ok;
-       
-      olddevmode = pDCB->NegoPeriod;
-      /* Look for decimal point (Speed) */
-      pdec = pos; 
-      while (pdec++ < &buffer[length]) if (*pdec == '.') break;
-      /* NegoPeriod */
-      if (*pos != '-')
-	{
-	  SCANF (buffer, pos, p0, dum, 72, 800); 
-	  pDCB->NegoPeriod = dum >> 2;
-	  if (pDCB->NegoPeriod != olddevmode) needs_inquiry++;
-	  if (!pos) goto ok;
-	  if (memcmp (pos, "NS", 2) == 0) pos = strsep (&pos, " \t\n:=,;.");
-	}
-      else pos = strsep (&pos, " \t\n:=,;.");
-      if (!*pos) goto ok;
-      
-      /* Sync Speed in MHz */
-      if (*pos != '-')
-	{
-	  SCANF (buffer, pos, p0, dum, 1, 13); 
-	  pDCB->NegoPeriod = (1000/dum) >> 2;
-	  if (pDCB->NegoPeriod != olddevmode && !pos) needs_inquiry++;
-	  if (!*pos) goto ok;
-	  /* decimal */
-	  if (pos-1 == pdec)
-	     {
-		int dumold = dum;
-		dum = simple_strtoul (pos, &p0, 10) * 10;
-		for (; p0-pos > 1; p0--) dum /= 10;
-		pDCB->NegoPeriod = (100000/(100*dumold + dum)) >> 2;
-		if (pDCB->NegoPeriod < 19) pDCB->NegoPeriod = 19;
-		pos = strsep (&pos, " \t\n:=,;");
-		if (!*pos) goto ok;
-	     }
-	  if (*pos == 'M') pos = strsep (&pos, " \t\n:=,;");
-	  if (pDCB->NegoPeriod != olddevmode) needs_inquiry++;
-	}
-      else pos = strsep (&pos, " \t\n:=,;");
-      /* dc390_updateDCB (pACB, pDCB); */
-      if (!*pos) goto ok;
-
-      olddevmode = pDCB->SyncOffset;
-      /* SyncOffs */
-      if (*pos != '-')
-	{
-	  SCANF (buffer, pos, p0, dum, 0, 0x0f); 
-	  pDCB->SyncOffset = dum;
-	  if (pDCB->SyncOffset > olddevmode) needs_inquiry++;
-	}
-      else pos = strsep (&pos, " \t\n:=,;");
-      if (!*pos) goto ok;
-      dc390_updateDCB (pACB, pDCB);
-
-      //olddevmode = pDCB->MaxCommand;
-      /* MaxCommand (Tags) */
-      if (*pos != '-')
-	{
-	  SCANF (buffer, pos, p0, dum, 1, 32 /*pACB->TagMaxNum*/);
-	  if (pDCB->SyncMode & EN_TAG_QUEUEING)
-		pDCB->MaxCommand = dum;
-	  else printk (KERN_INFO "DC390: Can't set MaxCmd larger than one without Tag Queueing!\n");
-	}
-      else pos = strsep (&pos, " \t\n:=,;");
-
-    }
-  else
-    {
-      char* p1 = pos; UCHAR dum, newadaptid;
-      PARSEDEBUG(printk (KERN_INFO "DC390: chg adapt cfg \"%s\"\n", prstr (pos, &buffer[length])));
-      dum = GLITCH_TO_NS (pACB->glitch_cfg);
-      /* Adapter setting */
-      SEARCH (buffer, pos, p0, pACB->pScsiHost->max_id, "MAXID", 8); 
-      SEARCH (buffer, pos, p0, pACB->pScsiHost->max_lun, "MAXLUN", 8); 
-      SEARCH (buffer, pos, p0, newadaptid, "ADAPTERID", 7);
-      SEARCH (buffer, pos, p0, pACB->TagMaxNum, "TAGMAXNUM", 32);
-      SEARCH (buffer, pos, p0, pACB->ACBFlag, "ACBFLAG", 255);
-      SEARCH3 (buffer, pos, p0, dum, "GLITCHEATER", 40, 1000, "NS");
-      SEARCH3 (buffer, pos, p0, pACB->sel_timeout, "SELTIMEOUT", 400, 163, "MS");
-      SEARCH3 (buffer, pos, p0, dc390_eepromBuf[pACB->AdapterIndex][EE_DELAY], "DELAYRESET", 180, 100, "S");
-    ok2:
-      pACB->glitch_cfg = NS_TO_GLITCH (dum);
-      if (pACB->sel_timeout < 60) pACB->sel_timeout = 60;
-      DC390_write8 (Scsi_TimeOut, pACB->sel_timeout);
-      if (newadaptid != pACB->pScsiHost->this_id)
-      {
-	pACB->pScsiHost->this_id = newadaptid;
-	dc390_ResetDevParam (pACB);
-      }	    
-      //dum = 0; while (1 << dum <= pACB->TagMaxNum) dum ++;
-      //pACB->TagMaxNum &= (1 << --dum);
-      dc390_updateDCBs (pACB);
-      // All devs should be INQUIRED now
-      if (pos == p1) goto einv;
-    }
-  if (*pos) goto next;
-      
- ok:
-  DC390_UNLOCK_ACB;
-  if (needs_inquiry) 
-     { dc390_updateDCB (pACB, pDCB); dc390_inquiry (pACB, pDCB); }
-  DC390_UNLOCK_IO(pACB->pScsiHost);
-  return (length);
-
- einv2:
-  pos = p0;
- einv:
-  DC390_UNLOCK_ACB;
-  DC390_UNLOCK_IO(pACB->pScsiHost);
-  printk (KERN_WARNING "DC390: parse error near \"%s\"\n", (pos? pos: "NULL"));
-  return (-EINVAL);
-   
- reset:
-     {
-	Scsi_Cmnd cmd;
-	/* TODO FIXME */
-	/* cmd.host = pACB->pScsiHost; */
-	printk (KERN_WARNING "DC390: Driver reset requested!\n");
-	DC390_UNLOCK_ACB;
-	DC390_reset (&cmd);
-	DC390_UNLOCK_IO(pACB->pScsiHost);
-     }
-  return (length);
-
- dump:
-     {
-	dc390_dumpinfo (pACB, 0, 0);
-	DC390_UNLOCK_ACB;
-	DC390_UNLOCK_IO(pACB->pScsiHost);       
-     }
-  return (length);
-	
- inquiry:
-     {
-	pos = strsep (&pos, " \t\n.:;="); if (!*pos) goto einv;
-	dev = simple_strtoul (pos, &p0, 10);
-	if (dev >= pACB->DCBCnt) goto einv_dev;
-	for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
-	printk (KERN_NOTICE " DC390: Issue INQUIRY command to Dev(Idx) %i SCSI ID %i LUN %i\n",
-		dev, pDCB->TargetID, pDCB->TargetLUN);
-	DC390_UNLOCK_ACB;
-	dc390_inquiry (pACB, pDCB);
-	DC390_UNLOCK_IO(pACB->pScsiHost);
-     }
-   return (length);
-
- remove:
-     {
-	pos = strsep (&pos, " \t\n.:;="); if (!*pos) goto einv;
-	dev = simple_strtoul (pos, &p0, 10);
-	if (dev >= pACB->DCBCnt) goto einv_dev;
-	for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
-	printk (KERN_NOTICE " DC390: Remove DCB for Dev(Idx) %i SCSI ID %i LUN %i\n",
-		dev, pDCB->TargetID, pDCB->TargetLUN);
-	/* TO DO: We should make sure no pending commands are left */
-	dc390_remove_dev (pACB, pDCB);
-	DC390_UNLOCK_ACB;
-	DC390_UNLOCK_IO(pACB->pScsiHost);
-     }
-   return (length);
-
- add:
-     {
-	int id, lun;
-	pos = strsep (&pos, " \t\n.:;=");
-	if (*pos) { SCANF (buffer, pos, p0, id, 0, 7); } else goto einv;
-	if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
-	pDCB = dc390_findDCB (pACB, id, lun);
-	if (pDCB) { printk ("DC390: ADD: Device already existing\n"); goto einv; }
-	dc390_initDCB (pACB, &pDCB, id, lun);
-	DC390_UNLOCK_ACB;
-	dc390_inquiry (pACB, pDCB);
-	DC390_UNLOCK_IO(pACB->pScsiHost);
-     }
-   return (length);
-
- start:
-     {
-	int id, lun;
-	pos = strsep (&pos, " \t\n.:;=");
-	if (*pos) { SCANF (buffer, pos, p0, id, 0, 7); } else goto einv;
-	if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
-	pDCB = dc390_findDCB (pACB, id, lun);
-	if (pDCB) printk ("DC390: SendStart: Device already existing ...\n");
-	else dc390_initDCB (pACB, &pDCB, id, lun);
-	DC390_UNLOCK_ACB;
-	dc390_sendstart (pACB, pDCB);
-	dc390_inquiry (pACB, pDCB);
-	DC390_UNLOCK_IO(pACB->pScsiHost);
-     }
-   return (length);
-
- einv_dev:
-   printk (KERN_WARNING "DC390: Ignore cmnd to invalid Dev(Idx) %i. Valid range: 0 - %i.\n", 
-	   dev, pACB->DCBCnt - 1);
-   DC390_UNLOCK_ACB;
-   DC390_UNLOCK_IO(pACB->pScsiHost);
-   return (-EINVAL);
-}
-
-#undef SEARCH
-#undef YESNO
-#undef SCANF
-
 /********************************************************************
  * Function: DC390_proc_info(char* buffer, char **start,
  *			     off_t offset, int length, int hostno, int inout)
@@ -2763,15 +1992,13 @@ int dc390_set_info (char *buffer, int length, PACB pACB)
  else SPRINTF(" No  ")
 
 
-int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
-		     off_t offset, int length, int inout)
+static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
+			    off_t offset, int length, int inout)
 {
   int dev, spd, spd1;
   char *pos = buffer;
-  struct scsi_cmnd_list *cl;
   PACB pACB;
   PDCB pDCB;
-  DC390_AFLAGS;
 
   pACB = dc390_pACB_start;
 
@@ -2785,13 +2012,11 @@ int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
   if (pACB == (PACB)-1) return(-ESRCH);
 
   if(inout) /* Has data been written to the file ? */
-      return dc390_set_info(buffer, length, pACB);
+      return -ENOSYS;
    
   SPRINTF("Tekram DC390/AM53C974 PCI SCSI Host Adapter, ");
   SPRINTF("Driver Version %s\n", DC390_VERSION);
 
-  DC390_LOCK_ACB;
-
   SPRINTF("SCSI Host Nr %i, ", shpnt->host_no);
   SPRINTF("%s Adapter Nr %i\n", dc390_adapname, pACB->AdapterIndex);
   SPRINTF("IOPortBase 0x%04x, ", pACB->IOPortBase);
@@ -2839,9 +2064,6 @@ int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
       SPRINTF ("      %02i\n", pDCB->MaxCommand);
       pDCB = pDCB->pNextDCB;
      }
-    SPRINTF ("Commands in Queues: Query: %li:", pACB->QueryCnt);
-    list_for_each_entry(cl, &pACB->cmdq, scp.list)
-	SPRINTF (" %li", ((struct scsi_cmnd*)cl)->pid);
     if (timer_pending(&pACB->Waiting_Timer)) SPRINTF ("Waiting queue timer running\n");
     else SPRINTF ("\n");
     pDCB = pACB->pLinkDCB;
@@ -2876,8 +2098,6 @@ int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
     SPRINTF("\n");
 #endif
   
-
-  DC390_UNLOCK_ACB;
   *start = buffer + offset;
 
   if (pos - buffer < offset)
@@ -2919,7 +2139,7 @@ static int dc390_shutdown (struct Scsi_Host *host)
     return( 0 );
 }
 
-void dc390_freeDCBs (struct Scsi_Host *host)
+static void dc390_freeDCBs (struct Scsi_Host *host)
 {
     PDCB pDCB, nDCB;
     PACB pACB = (PACB)(host->hostdata);
@@ -2938,13 +2158,12 @@ void dc390_freeDCBs (struct Scsi_Host *host)
 
 }
 
-int DC390_release (struct Scsi_Host *host)
+static int DC390_release (struct Scsi_Host *host)
 {
-    DC390_AFLAGS DC390_IFLAGS;
+    DC390_IFLAGS;
     PACB pACB = (PACB)(host->hostdata);
 
     DC390_LOCK_IO(host);
-    DC390_LOCK_ACB;
 
     /* TO DO: We should check for outstanding commands first. */
     dc390_shutdown (host);
@@ -2957,7 +2176,6 @@ int DC390_release (struct Scsi_Host *host)
 
     release_region(host->io_port,host->n_io_port);
     dc390_freeDCBs (host);
-    DC390_UNLOCK_ACB;
     DC390_UNLOCK_IO(host);
     scsi_unregister(host);
     return( 1 );
diff --git a/drivers/scsi/tmscsim.h b/drivers/scsi/tmscsim.h
index cda771660..fd12e6062 100644
--- a/drivers/scsi/tmscsim.h
+++ b/drivers/scsi/tmscsim.h
@@ -214,16 +214,12 @@ PSRB		pFreeSRB;
 PSRB		pTmpSRB;
 
 /* 0x2c: */
-ULONG		QueryCnt;
-struct list_head	cmdq;
-
-/* 0x38: */
 UCHAR		msgin123[4];
 UCHAR		DCBmap[MAX_SCSI_ID];
 UCHAR		Connected;
 UCHAR		pad;
 
-/* 0x3c: */
+/* 0x30: */
 #if defined(USE_SPINLOCKS) && USE_SPINLOCKS > 1 && (defined(CONFIG_SMP) || DEBUG_SPINLOCKS > 0)
 spinlock_t	lock;
 #endif
@@ -234,20 +230,20 @@ UCHAR		MsgLen;
 UCHAR		Ignore_IRQ;	/* Not used */
 
 PDEVDECL1;			/* Pointer to PCI cfg. space */
-/* 0x4c/0x48: */
+/* 0x40/0x3c: */
 ULONG		Cmds;
 UINT		SelLost;
 UINT		SelConn;
 UINT		CmdInQ;
 UINT		CmdOutOfSRB;
 	
-/* 0x60/0x5c: */
+/* 0x54/0x50: */
 struct timer_list	Waiting_Timer;
-/* 0x74/0x70: */
+/* 0x68/0x64: */
 DC390_SRB	TmpSRB;
-/* 0xd8/0xd4: */
+/* 0xcc/0xc8: */
 DC390_SRB	SRB_array[MAX_SRB_CNT]; 	/* 50 SRBs */
-/* 0xfb0/0xfac: */
+/* 0xfa4/0xfa0: */
 };
 
 typedef  struct  _ACB	 DC390_ACB, *PACB;
@@ -406,16 +402,9 @@ typedef  struct  _ACB	 DC390_ACB, *PACB;
  *	SISC query queue
  */
 typedef struct {
-	struct list_head	list;
 	dma_addr_t		saved_dma_handle;
 } dc390_cmd_scp_t;
 
-struct scsi_cmnd_list
-{
-	char dummy[offsetof(struct scsi_cmnd, SCp)];
-	dc390_cmd_scp_t scp;
-};
-
 /*
 **  Inquiry Data format
 */
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 4dca4c11a..167733100 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -165,6 +165,7 @@
  * Removed now obsolete wd7000.h
  */
 
+#include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
@@ -846,7 +847,7 @@ static inline int command_out(Adapter * host, unchar * cmd, int len)
 static inline Scb *alloc_scbs(struct Scsi_Host *host, int needed)
 {
 	register Scb *scb, *p = NULL;
-	register unsigned long flags;
+	unsigned long flags;
 	register unsigned long timeout = jiffies + WAITnexttimeout;
 	register unsigned long now;
 	int i;
@@ -898,7 +899,7 @@ static inline Scb *alloc_scbs(struct Scsi_Host *host, int needed)
 
 static inline void free_scb(Scb * scb)
 {
-	register unsigned long flags;
+	unsigned long flags;
 
 	spin_lock_irqsave(&scbpool_lock, flags);
 
@@ -936,7 +937,7 @@ static int mail_out(Adapter * host, Scb * scbptr)
  */
 {
 	register int i, ogmb;
-	register unsigned long flags;
+	unsigned long flags;
 	unchar start_ogmb;
 	Mailbox *ogmbs = host->mb.ogmb;
 	int *next_ogmb = &(host->next_ogmb);
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index c8fa14eb7..64e296ad3 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -1650,7 +1650,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
 	
 	if (tty_hung_up_p(filp)) {
 		DBG_CNT("before DEC-hung");
-		MOD_DEC_USE_COUNT;
 		local_irq_restore(flags);
 		return;
 	}
@@ -1677,7 +1676,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
 	}
 	if (state->count) {
 		DBG_CNT("before DEC-2");
-		MOD_DEC_USE_COUNT;
 		local_irq_restore(flags);
 		return;
 	}
@@ -1732,7 +1730,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
 	}
 	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
 	wake_up_interruptible(&info->close_wait);
-	MOD_DEC_USE_COUNT;
 	local_irq_restore(flags);
 }
 
@@ -1993,14 +1990,12 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
 	if (retval)
 		return retval;
 
-	MOD_INC_USE_COUNT;
 	retval = block_til_ready(tty, filp, info);
 	if (retval) {
 #ifdef SERIAL_DEBUG_OPEN
 		printk("rs_open returning after block_til_ready with %d\n",
 		       retval);
 #endif
-		MOD_DEC_USE_COUNT;
 		return retval;
 	}
 
@@ -2476,6 +2471,7 @@ long console_360_init(long kmem_start, long kmem_end)
 static	int	baud_idx;
 
 static struct tty_operations rs_360_ops = {
+	.owner = THIS_MODULE,
 	.open = rs_360_open,
 	.close = rs_360_close,
 	.write = rs_360_write,
diff --git a/drivers/serial/8250_acpi.c b/drivers/serial/8250_acpi.c
index e914b7a5b..d8c8a8157 100644
--- a/drivers/serial/8250_acpi.c
+++ b/drivers/serial/8250_acpi.c
@@ -14,7 +14,6 @@
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/serial.h>
-#include <linux/tty.h>
 #include <linux/serial_core.h>
 
 #include <acpi/acpi_bus.h>
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index cf42b9d0c..3b3427e0b 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -28,7 +28,6 @@
 
 #include <asm/bitops.h>
 #include <asm/byteorder.h>
-#include <asm/serial.h>
 #include <asm/io.h>
 
 #include "8250.h"
@@ -704,7 +703,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
 		.subdevice	= PCI_SUBDEVICE_ID_OCTPRO232,
 		.init		= sbs_init,
 		.setup		= sbs_setup,
-		.exit		= sbs_exit
+		.exit		= __devexit_p(sbs_exit),
 	},
 	/*
 	 * SBS Technologies, Inc., PMC-OCTALPRO 422
@@ -716,7 +715,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
 		.subdevice	= PCI_SUBDEVICE_ID_OCTPRO422,
 		.init		= sbs_init,
 		.setup		= sbs_setup,
-		.exit		= sbs_exit
+		.exit		= __devexit_p(sbs_exit),
 	},
 	/*
 	 * SBS Technologies, Inc., P-Octal 232
@@ -728,7 +727,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
 		.subdevice	= PCI_SUBDEVICE_ID_POCTAL232,
 		.init		= sbs_init,
 		.setup		= sbs_setup,
-		.exit		= sbs_exit
+		.exit		= __devexit_p(sbs_exit),
 	},
 	/*
 	 * SBS Technologies, Inc., P-Octal 422
@@ -740,7 +739,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
 		.subdevice	= PCI_SUBDEVICE_ID_POCTAL422,
 		.init		= sbs_init,
 		.setup		= sbs_setup,
-		.exit		= sbs_exit
+		.exit		= __devexit_p(sbs_exit),
 	},
 
 	/*
@@ -1585,7 +1584,7 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
 	struct pci_board *board, tmp;
 	struct pci_serial_quirk *quirk;
 	struct serial_struct serial_req;
-	int base_baud, rc, nr_ports, i;
+	int rc, nr_ports, i;
 
 	if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
 		printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
@@ -1663,16 +1662,11 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
 	priv->quirk = quirk;
 	pci_set_drvdata(dev, priv);
 
-	base_baud = board->base_baud;
-	if (!base_baud) {
-		moan_device("Board entry does not specify baud rate.", dev);
-		base_baud = BASE_BAUD;
-	}
 	for (i = 0; i < nr_ports; i++) {
 		memset(&serial_req, 0, sizeof(serial_req));
 		serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE |
 				   UPF_RESOURCES | UPF_SHARE_IRQ;
-		serial_req.baud_base = base_baud;
+		serial_req.baud_base = board->base_baud;
 		serial_req.irq = get_pci_irq(dev, board, i);
 		if (quirk->setup(dev, board, &serial_req, i))
 			break;
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index a0d988dc9..abbbe3fc3 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -437,7 +437,7 @@ static struct pnp_driver serial_pnp_driver = {
 	.name		= "serial",
 	.id_table	= pnp_dev_table,
 	.probe		= serial_pnp_probe,
-	.remove		= serial_pnp_remove,
+	.remove		= __devexit_p(serial_pnp_remove),
 };
 
 static int __init serial8250_pnp_init(void)
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 23f452ad3..8e6060f42 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -259,6 +259,7 @@ config SERIAL_S3C2410
 config SERIAL_S3C2410_CONSOLE
 	bool "Support for console on S3C2410 serial port"
 	depends on SERIAL_S3C2410=y
+	select SERIAL_CORE_CONSOLE
 	help
 	  Allow selection of the S3C2410 on-board serial ports for use as
 	  an virtual console.
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index 5df209699..d452d4b40 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -483,7 +483,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        		if (r3 & CHBEXT)
        			pmz_status_handle(uap_b, regs);
        	       	if (r3 & CHBRxIP)
-       			pmz_receive_chars(uap_b, regs);
+       			tty = pmz_receive_chars(uap_b, regs);
        		if (r3 & CHBTxIP)
        			pmz_transmit_chars(uap_b);
 	       	rc = IRQ_HANDLED;
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 42e83fda4..082e1b552 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -33,7 +33,6 @@
 #include <linux/sysrq.h>
 #include <linux/serial_reg.h>
 #include <linux/circ_buf.h>
-#include <linux/serial.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
@@ -386,9 +385,6 @@ static int serial_pxa_startup(struct uart_port *port)
 	if (retval)
 		return retval;
 
-	CKEN |= up->cken;
-	udelay(1);
-
 	/*
 	 * Clear the FIFO buffers and disable them.
 	 * (they will be reenabled in set_termios())
@@ -461,8 +457,6 @@ static void serial_pxa_shutdown(struct uart_port *port)
 				  UART_FCR_CLEAR_RCVR |
 				  UART_FCR_CLEAR_XMIT);
 	serial_out(up, UART_FCR, 0);
-
-	CKEN &= ~up->cken;
 }
 
 static void
@@ -576,10 +570,14 @@ static void
 serial_pxa_pm(struct uart_port *port, unsigned int state,
 	      unsigned int oldstate)
 {
+	struct uart_pxa_port *up = (struct uart_pxa_port *)port;
 	if (state) {
 		/* sleep */
+		CKEN &= ~up->cken;
 	} else {
 		/* wake */
+		CKEN |= up->cken;
+		udelay(1);
 	}
 }
 
@@ -760,13 +758,12 @@ static struct uart_pxa_port serial_pxa_ports[] = {
 	.cken	= CKEN6_FFUART,
 	.port	= {
 		.type		= PORT_PXA,
-		.iotype		= SERIAL_IO_MEM,
+		.iotype		= UPIO_MEM,
 		.membase	= (void *)&FFUART,
 		.mapbase	= __PREG(FFUART),
 		.irq		= IRQ_FFUART,
 		.uartclk	= 921600 * 16,
 		.fifosize	= 64,
-		.flags		= ASYNC_SKIP_TEST,
 		.ops		= &serial_pxa_pops,
 		.line		= 0,
 	},
@@ -775,13 +772,12 @@ static struct uart_pxa_port serial_pxa_ports[] = {
 	.cken	= CKEN7_BTUART,
 	.port	= {
 		.type		= PORT_PXA,
-		.iotype		= SERIAL_IO_MEM,
+		.iotype		= UPIO_MEM,
 		.membase	= (void *)&BTUART,
 		.mapbase	= __PREG(BTUART),
 		.irq		= IRQ_BTUART,
 		.uartclk	= 921600 * 16,
 		.fifosize	= 64,
-		.flags		= ASYNC_SKIP_TEST,
 		.ops		= &serial_pxa_pops,
 		.line		= 1,
 	},
@@ -790,13 +786,12 @@ static struct uart_pxa_port serial_pxa_ports[] = {
 	.cken	= CKEN5_STUART,
 	.port	= {
 		.type		= PORT_PXA,
-		.iotype		= SERIAL_IO_MEM,
+		.iotype		= UPIO_MEM,
 		.membase	= (void *)&STUART,
 		.mapbase	= __PREG(STUART),
 		.irq		= IRQ_STUART,
 		.uartclk	= 921600 * 16,
 		.fifosize	= 64,
-		.flags		= ASYNC_SKIP_TEST,
 		.ops		= &serial_pxa_pops,
 		.line		= 2,
 	},
@@ -830,6 +825,10 @@ static int __init serial_pxa_init(void)
 
 static void __exit serial_pxa_exit(void)
 {
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(serial_pxa_ports); i++)
+		uart_remove_one_port(&serial_pxa_reg, &serial_pxa_ports[i].port);
 	uart_unregister_driver(&serial_pxa_reg);
 }
 
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 84b4a8e0a..22a02bd69 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -37,7 +37,7 @@
 
 #define SERIAL_S3C2410_NAME	"ttySAC"
 #define SERIAL_S3C2410_MAJOR	204
-#define SERIAL_S3C2410_MINOR	4
+#define SERIAL_S3C2410_MINOR	64
 
 /* we can support 3 uarts, but not always use them */
 
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 66bb3cfb2..774ad38b8 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -460,7 +460,7 @@ __uart_put_char(struct uart_port *port, struct circ_buf *circ, unsigned char c)
 
 static inline int
 __uart_user_write(struct uart_port *port, struct circ_buf *circ,
-		  const unsigned char *buf, int count)
+		  const unsigned char __user *buf, int count)
 {
 	unsigned long flags;
 	int c, ret = 0;
@@ -546,9 +546,11 @@ uart_write(struct tty_struct *tty, int from_user, const unsigned char * buf,
 		return 0;
 
 	if (from_user)
-		ret = __uart_user_write(state->port, &state->info->xmit, buf, count);
+		ret = __uart_user_write(state->port, &state->info->xmit,
+				(const unsigned char __user *)buf, count);
 	else
-		ret = __uart_kern_write(state->port, &state->info->xmit, buf, count);
+		ret = __uart_kern_write(state->port, &state->info->xmit,
+					buf, count);
 
 	uart_start(tty);
 	return ret;
@@ -634,7 +636,8 @@ static void uart_unthrottle(struct tty_struct *tty)
 		uart_set_mctrl(port, TIOCM_RTS);
 }
 
-static int uart_get_info(struct uart_state *state, struct serial_struct *retinfo)
+static int uart_get_info(struct uart_state *state,
+			 struct serial_struct __user *retinfo)
 {
 	struct uart_port *port = state->port;
 	struct serial_struct tmp;
@@ -662,8 +665,8 @@ static int uart_get_info(struct uart_state *state, struct serial_struct *retinfo
 	return 0;
 }
 
-static int
-uart_set_info(struct uart_state *state, struct serial_struct *newinfo)
+static int uart_set_info(struct uart_state *state,
+			 struct serial_struct __user *newinfo)
 {
 	struct serial_struct new_serial;
 	struct uart_port *port = state->port;
@@ -856,7 +859,8 @@ uart_set_info(struct uart_state *state, struct serial_struct *newinfo)
  * uart_get_lsr_info - get line status register info.
  * Note: uart_ioctl protects us against hangups.
  */
-static int uart_get_lsr_info(struct uart_state *state, unsigned int *value)
+static int uart_get_lsr_info(struct uart_state *state,
+			     unsigned int __user *value)
 {
 	struct uart_port *port = state->port;
 	unsigned int result;
@@ -1035,8 +1039,8 @@ uart_wait_modem_status(struct uart_state *state, unsigned long arg)
  * NB: both 1->0 and 0->1 transitions are counted except for
  *     RI where only 0->1 is counted.
  */
-static int
-uart_get_count(struct uart_state *state, struct serial_icounter_struct *icnt)
+static int uart_get_count(struct uart_state *state,
+			  struct serial_icounter_struct __user *icnt)
 {
 	struct serial_icounter_struct icount;
 	struct uart_icount cnow;
@@ -1069,6 +1073,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
 	   unsigned long arg)
 {
 	struct uart_state *state = tty->driver_data;
+	void __user *uarg = (void __user *)arg;
 	int ret = -ENOIOCTLCMD;
 
 	BUG_ON(!kernel_locked());
@@ -1078,11 +1083,11 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
 	 */
 	switch (cmd) {
 	case TIOCGSERIAL:
-		ret = uart_get_info(state, (struct serial_struct *)arg);
+		ret = uart_get_info(state, uarg);
 		break;
 
 	case TIOCSSERIAL:
-		ret = uart_set_info(state, (struct serial_struct *)arg);
+		ret = uart_set_info(state, uarg);
 		break;
 
 	case TIOCSERCONFIG:
@@ -1112,7 +1117,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
 		break;
 
 	case TIOCGICOUNT:
-		ret = uart_get_count(state, (struct serial_icounter_struct *)arg);
+		ret = uart_get_count(state, uarg);
 		break;
 	}
 
@@ -1132,7 +1137,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
 	 */
 	switch (cmd) {
 	case TIOCSERGETLSR: /* Get line status register */
-		ret = uart_get_lsr_info(state, (unsigned int *)arg);
+		ret = uart_get_lsr_info(state, uarg);
 		break;
 
 	default: {
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 14d5c8abd..f5f3e08bf 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -758,7 +758,8 @@ static int sci_notifier(struct notifier_block *self, unsigned long phase, void *
 	struct cpufreq_freqs *freqs = p;
 	int i;
 
-	if (phase == CPUFREQ_POSTCHANGE) {
+	if ((phase == CPUFREQ_POSTCHANGE) ||
+	    (phase == CPUFREQ_RESUMECHANGE)){
 		for (i = 0; i < SCI_NPORTS; i++) {
 			struct uart_port *port = &sci_ports[i];
 
@@ -904,14 +905,14 @@ static int sci_startup(struct uart_port *port)
 {
 	struct sci_port *s = &sci_ports[port->line];
 
-	sci_request_irq(s);
-	sci_start_tx(port, 1);
-	sci_start_rx(port, 1);
-
 #if defined(__H8300S__)
 	h8300_sci_enable(port, sci_enable);
 #endif
 
+	sci_request_irq(s);
+	sci_start_tx(port, 1);
+	sci_start_rx(port, 1);
+
 	return 0;
 }
 
@@ -1328,6 +1329,7 @@ static int __init serial_console_setup(struct console *co, char *options)
 	int bits = 8;
 	int parity = 'n';
 	int flow = 'n';
+	int ret;
 
 	if (co->index >= SCI_NPORTS)
 		co->index = 0;
@@ -1344,11 +1346,20 @@ static int __init serial_console_setup(struct console *co, char *options)
 	port->uartclk = current_cpu_data.module_clock * 16;
 #else
 	port->uartclk = CONFIG_CPU_CLOCK;
+#endif
+#if defined(__H8300S__)
+	h8300_sci_enable(port, sci_enable);
 #endif
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 
-	return uart_set_options(port, co, baud, parity, bits, flow);
+	ret = uart_set_options(port, co, baud, parity, bits, flow);
+#if defined(__H8300H__) || defined(__H8300S__)
+	/* disable rx interrupt */
+	if (ret == 0)
+		sci_stop_rx(port);
+#endif
+	return ret;
 }
 
 static struct console serial_console = {
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 6747b8baf..494df5557 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -97,9 +97,10 @@ static __inline__ void sunsab_cec_wait(struct uart_sunsab_port *up)
 		udelay(1);
 }
 
-static void receive_chars(struct uart_sunsab_port *up,
-			  union sab82532_irq_status *stat,
-			  struct pt_regs *regs)
+static struct tty_struct *
+receive_chars(struct uart_sunsab_port *up,
+	      union sab82532_irq_status *stat,
+	      struct pt_regs *regs)
 {
 	struct tty_struct *tty = NULL;
 	unsigned char buf[32];
@@ -126,7 +127,7 @@ static void receive_chars(struct uart_sunsab_port *up,
 	if (stat->sreg.isr0 & SAB82532_ISR0_TIME) {
 		sunsab_cec_wait(up);
 		writeb(SAB82532_CMDR_RFRD, &up->regs->w.cmdr);
-		return;
+		return tty;
 	}
 
 	if (stat->sreg.isr0 & SAB82532_ISR0_RFO)
@@ -153,7 +154,7 @@ static void receive_chars(struct uart_sunsab_port *up,
 		if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
 			tty->flip.work.func((void *)tty);
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
-				return; // if TTY_DONT_FLIP is set
+				return tty; // if TTY_DONT_FLIP is set
 		}
 
 		*tty->flip.char_buf_ptr = ch;
@@ -225,11 +226,10 @@ static void receive_chars(struct uart_sunsab_port *up,
 		}
 	}
 
-	if (tty)
-		tty_flip_buffer_push(tty);
-
 	if (saw_console_brk)
 		sun_do_break();
+
+	return tty;
 }
 
 static void sunsab_stop_tx(struct uart_port *, unsigned int);
@@ -311,6 +311,7 @@ static void check_status(struct uart_sunsab_port *up,
 static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct uart_sunsab_port *up = dev_id;
+	struct tty_struct *tty;
 	union sab82532_irq_status status;
 	unsigned long flags;
 
@@ -322,10 +323,11 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	if (readb(&up->regs->r.gis) & SAB82532_GIS_ISA1)
 		status.sreg.isr1 = readb(&up->regs->r.isr1);
 
+	tty = NULL;
 	if (status.stat) {
 		if (status.sreg.isr0 & (SAB82532_ISR0_TCD | SAB82532_ISR0_TIME |
 					SAB82532_ISR0_RFO | SAB82532_ISR0_RPF))
-			receive_chars(up, &status, regs);
+			tty = receive_chars(up, &status, regs);
 		if ((status.sreg.isr0 & SAB82532_ISR0_CDSC) ||
 		    (status.sreg.isr1 & SAB82532_ISR1_CSC))
 			check_status(up, &status);
@@ -335,6 +337,9 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 	spin_unlock(&up->port.lock);
 
+	if (tty)
+		tty_flip_buffer_push(tty);
+
 	up++;
 
 	spin_lock(&up->port.lock);
@@ -345,10 +350,11 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	if (readb(&up->regs->r.gis) & SAB82532_GIS_ISB1)
 		status.sreg.isr1 = readb(&up->regs->r.isr1);
 
+	tty = NULL;
 	if (status.stat) {
 		if (status.sreg.isr0 & (SAB82532_ISR0_TCD | SAB82532_ISR0_TIME |
 					SAB82532_ISR0_RFO | SAB82532_ISR0_RPF))
-			receive_chars(up, &status, regs);
+			tty = receive_chars(up, &status, regs);
 		if ((status.sreg.isr0 & SAB82532_ISR0_CDSC) ||
 		    (status.sreg.isr1 & (SAB82532_ISR1_BRK | SAB82532_ISR1_CSC)))
 			check_status(up, &status);
@@ -358,6 +364,9 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 	spin_unlock_irqrestore(&up->port.lock, flags);
 
+	if (tty)
+		tty_flip_buffer_push(tty);
+
 	return IRQ_HANDLED;
 }
 
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index dffd7b67e..d72a7aaf2 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -310,7 +310,7 @@ static void sunsu_enable_ms(struct uart_port *port)
 	spin_unlock_irqrestore(&up->port.lock, flags);
 }
 
-static _INLINE_ void
+static _INLINE_ struct tty_struct *
 receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs *regs)
 {
 	struct tty_struct *tty = up->port.info->tty;
@@ -322,7 +322,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs
 		if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
 			tty->flip.work.func((void *)tty);
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
-				return; // if TTY_DONT_FLIP is set
+				return tty; // if TTY_DONT_FLIP is set
 		}
 		ch = serial_inp(up, UART_RX);
 		*tty->flip.char_buf_ptr = ch;
@@ -396,10 +396,11 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs
 	ignore_char:
 		*status = serial_inp(up, UART_LSR);
 	} while ((*status & UART_LSR_DR) && (max_count-- > 0));
-	tty_flip_buffer_push(tty);
 
 	if (saw_console_brk)
 		sun_do_break();
+
+	return tty;
 }
 
 static _INLINE_ void transmit_chars(struct uart_sunsu_port *up)
@@ -464,12 +465,23 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id, struct pt_regs
 	spin_lock_irqsave(&up->port.lock, flags);
 
 	do {
+		struct tty_struct *tty;
+
 		status = serial_inp(up, UART_LSR);
+		tty = NULL;
 		if (status & UART_LSR_DR)
-			receive_chars(up, &status, regs);
+			tty = receive_chars(up, &status, regs);
 		check_modem_status(up);
 		if (status & UART_LSR_THRE)
 			transmit_chars(up);
+
+		spin_unlock_irqrestore(&up->port.lock, flags);
+
+		if (tty)
+			tty_flip_buffer_push(tty);
+
+		spin_lock_irqsave(&up->port.lock, flags);
+
 	} while (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT));
 
 	spin_unlock_irqrestore(&up->port.lock, flags);
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 506e6e71c..b38c02593 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -313,9 +313,10 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up,
 	}
 }
 
-static void sunzilog_receive_chars(struct uart_sunzilog_port *up,
-				   struct zilog_channel *channel,
-				   struct pt_regs *regs)
+static struct tty_struct *
+sunzilog_receive_chars(struct uart_sunzilog_port *up,
+		       struct zilog_channel *channel,
+		       struct pt_regs *regs)
 {
 	struct tty_struct *tty;
 	unsigned char ch, r1;
@@ -414,8 +415,7 @@ static void sunzilog_receive_chars(struct uart_sunzilog_port *up,
 		}
 	}
 
-	if (tty)
-		tty_flip_buffer_push(tty);
+	return tty;
 }
 
 static void sunzilog_status_handle(struct uart_sunzilog_port *up,
@@ -550,19 +550,21 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg
 	while (up) {
 		struct zilog_channel *channel
 			= ZILOG_CHANNEL_FROM_PORT(&up->port);
+		struct tty_struct *tty;
 		unsigned char r3;
 
 		spin_lock(&up->port.lock);
 		r3 = read_zsreg(channel, R3);
 
 		/* Channel A */
+		tty = NULL;
 		if (r3 & (CHAEXT | CHATxIP | CHARxIP)) {
 			sbus_writeb(RES_H_IUS, &channel->control);
 			ZSDELAY();
 			ZS_WSYNC(channel);
 
 			if (r3 & CHARxIP)
-				sunzilog_receive_chars(up, channel, regs);
+				tty = sunzilog_receive_chars(up, channel, regs);
 			if (r3 & CHAEXT)
 				sunzilog_status_handle(up, channel, regs);
 			if (r3 & CHATxIP)
@@ -570,18 +572,22 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg
 		}
 		spin_unlock(&up->port.lock);
 
+		if (tty)
+			tty_flip_buffer_push(tty);
+
 		/* Channel B */
 		up = up->next;
 		channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
 
 		spin_lock(&up->port.lock);
+		tty = NULL;
 		if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) {
 			sbus_writeb(RES_H_IUS, &channel->control);
 			ZSDELAY();
 			ZS_WSYNC(channel);
 
 			if (r3 & CHBRxIP)
-				sunzilog_receive_chars(up, channel, regs);
+				tty = sunzilog_receive_chars(up, channel, regs);
 			if (r3 & CHBEXT)
 				sunzilog_status_handle(up, channel, regs);
 			if (r3 & CHBTxIP)
@@ -589,6 +595,9 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg
 		}
 		spin_unlock(&up->port.lock);
 
+		if (tty)
+			tty_flip_buffer_push(tty);
+
 		up = up->next;
 	}
 
diff --git a/drivers/telephony/ixj.h b/drivers/telephony/ixj.h
index aa5122231..65d837d5f 100644
--- a/drivers/telephony/ixj.h
+++ b/drivers/telephony/ixj.h
@@ -1198,22 +1198,13 @@ typedef struct {
 	int aec_level;
 	int cid_play_aec_level;
 	int readers, writers;
-#if LINUX_VERSION_CODE < 0x020400
-	struct wait_queue *poll_q;
-	struct wait_queue *read_q;
-#else
         wait_queue_head_t poll_q;
         wait_queue_head_t read_q;
-#endif
 	char *read_buffer, *read_buffer_end;
 	char *read_convert_buffer;
 	size_t read_buffer_size;
 	unsigned int read_buffer_ready;
-#if LINUX_VERSION_CODE < 0x020400
-	struct wait_queue *write_q;
-#else
         wait_queue_head_t write_q;
-#endif
 	char *write_buffer, *write_buffer_end;
 	char *write_convert_buffer;
 	size_t write_buffer_size;
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 4b3fb3009..e3787f35c 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -66,3 +66,4 @@ obj-$(CONFIG_USB_SPEEDTOUCH)	+= misc/
 obj-$(CONFIG_USB_TEST)		+= misc/
 obj-$(CONFIG_USB_TIGL)		+= misc/
 obj-$(CONFIG_USB_USS720)	+= misc/
+obj-$(CONFIG_USB_PHIDGETSERVO)	+= misc/
diff --git a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c
index 0ae754e2f..2e8f5200c 100644
--- a/drivers/usb/class/bluetty.c
+++ b/drivers/usb/class/bluetty.c
@@ -1234,7 +1234,7 @@ static struct tty_operations bluetooth_ops = {
 	.chars_in_buffer =	bluetooth_chars_in_buffer,
 };
 
-int usb_bluetooth_init(void)
+static int usb_bluetooth_init(void)
 {
 	int i;
 	int result;
@@ -1283,7 +1283,7 @@ int usb_bluetooth_init(void)
 }
 
 
-void usb_bluetooth_exit(void)
+static void usb_bluetooth_exit(void)
 {
 	usb_deregister(&usb_bluetooth_driver);
 	tty_unregister_driver(bluetooth_tty_driver);
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 441817076..0c2ca79b5 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -567,6 +567,8 @@ static void acm_tty_set_termios(struct tty_struct *tty, struct termios *termios_
  * USB probe and disconnect routines.
  */
 
+#define CHECK_XFERTYPE(descr, xfer_type) (((descr)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == xfer_type)
+			
 static int acm_probe (struct usb_interface *intf,
 		      const struct usb_device_id *id)
 {
@@ -583,143 +585,150 @@ static int acm_probe (struct usb_interface *intf,
 
 	dev = interface_to_usbdev (intf);
 
-			cfacm = dev->actconfig;
-	
-			/* We know we're probe()d with the control interface. */
-			ifcom = intf->cur_altsetting;
-
-			/* ACM doesn't guarantee the data interface is
-			 * adjacent to the control interface, or that if one
-			 * is there it's not for call management ... so find
-			 * it
-			 */
-			for (j = 0; j < cfacm->desc.bNumInterfaces; j++) {
-				ifdata = cfacm->interface[j]->cur_altsetting;
-				data = cfacm->interface[j];
-
-				if (ifdata->desc.bInterfaceClass == 10 &&
-				    ifdata->desc.bNumEndpoints == 2) {
-					epctrl = &ifcom->endpoint[0].desc;
-					epread = &ifdata->endpoint[0].desc;
-					epwrite = &ifdata->endpoint[1].desc;
-
-					if ((epctrl->bEndpointAddress & 0x80) != 0x80 ||
-					    (epctrl->bmAttributes & 3) != 3 ||
-					    (epread->bmAttributes & 3) != 2 || 
-					    (epwrite->bmAttributes & 3) != 2 ||
-					    ((epread->bEndpointAddress & 0x80) ^ (epwrite->bEndpointAddress & 0x80)) != 0x80) 
-						goto next_interface;
-
-					if ((epread->bEndpointAddress & 0x80) != 0x80) {
-						epread = &ifdata->endpoint[1].desc;
-						epwrite = &ifdata->endpoint[0].desc;
-					}
-					dbg("found data interface at %d\n", j);
-					break;
-				} else {
-next_interface:
-					ifdata = NULL;
-					data = NULL;
-				}
+	cfacm = dev->actconfig;
+
+	/* We know we're probe()d with the control interface. */
+	ifcom = intf->cur_altsetting;
+
+	/* ACM doesn't guarantee the data interface is
+	 * adjacent to the control interface, or that if one
+	 * is there it's not for call management ... so find
+	 * it
+	 */
+	for (j = 0; j < cfacm->desc.bNumInterfaces; j++) {
+		ifdata = cfacm->interface[j]->cur_altsetting;
+		data = cfacm->interface[j];
+
+		if (ifdata->desc.bInterfaceClass == USB_CLASS_CDC_DATA
+		    && ifdata->desc.bNumEndpoints == 2) {
+			
+			epctrl = &ifcom->endpoint[0].desc;
+			epread = &ifdata->endpoint[0].desc;
+			epwrite = &ifdata->endpoint[1].desc;
+
+			if ((epctrl->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN
+			    || !CHECK_XFERTYPE(epctrl,  USB_ENDPOINT_XFER_INT)
+			    || !CHECK_XFERTYPE(epread,  USB_ENDPOINT_XFER_BULK)
+			    || !CHECK_XFERTYPE(epwrite, USB_ENDPOINT_XFER_BULK)
+			    || ((epread->bEndpointAddress & USB_DIR_IN)
+			        ^ (epwrite->bEndpointAddress & USB_DIR_IN)) != USB_DIR_IN) {
+				/* not suitable */
+				goto next_interface;
+			}
+			
+			if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
+				/* descriptors are swapped */
+				epread = &ifdata->endpoint[1].desc;
+				epwrite = &ifdata->endpoint[0].desc;
 			}
+			dev_dbg(&intf->dev, "found data interface at %d\n", j);
+			break;
+		} else {
+next_interface:
+			ifdata = NULL;
+			data = NULL;
+		}
+	}
 
-			/* there's been a problem */
-			if (!ifdata) {
-				dbg("interface not found (%p)\n", ifdata);
-				return -ENODEV;
+	/* there's been a problem */
+	if (!ifdata) {
+		dev_dbg(&intf->dev, "data interface not found\n");
+		return -ENODEV;
 
-			}
+	}
 
-			for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++);
-			if (acm_table[minor]) {
-				err("no more free acm devices");
-				return -ENODEV;
-			}
+	for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++);
+	if (acm_table[minor]) {
+		err("no more free acm devices");
+		return -ENODEV;
+	}
 
-			if (!(acm = kmalloc(sizeof(struct acm), GFP_KERNEL))) {
-				err("out of memory");
-				return -ENOMEM;
-			}
-			memset(acm, 0, sizeof(struct acm));
-
-			ctrlsize = epctrl->wMaxPacketSize;
-			readsize = epread->wMaxPacketSize;
-			acm->writesize = epwrite->wMaxPacketSize;
-			acm->control = intf;
-			acm->data = data;
-			acm->minor = minor;
-			acm->dev = dev;
-
-			acm->bh.func = acm_rx_tasklet;
-			acm->bh.data = (unsigned long) acm;
-			INIT_WORK(&acm->work, acm_softint, acm);
-
-			if (!(buf = kmalloc(ctrlsize + readsize + acm->writesize, GFP_KERNEL))) {
-				err("out of memory");
-				kfree(acm);
-				return -ENOMEM;
-			}
+	if (!(acm = kmalloc(sizeof(struct acm), GFP_KERNEL))) {
+		dev_dbg(&intf->dev, "out of memory (acm kmalloc)\n");
+		return -ENOMEM;
+	}
+	
+	memset(acm, 0, sizeof(struct acm));
+
+	ctrlsize = epctrl->wMaxPacketSize;
+	readsize = epread->wMaxPacketSize;
+	acm->writesize = epwrite->wMaxPacketSize;
+	acm->control = intf;
+	acm->data = data;
+	acm->minor = minor;
+	acm->dev = dev;
+
+	acm->bh.func = acm_rx_tasklet;
+	acm->bh.data = (unsigned long) acm;
+	INIT_WORK(&acm->work, acm_softint, acm);
+
+	if (!(buf = kmalloc(ctrlsize + readsize + acm->writesize, GFP_KERNEL))) {
+		dev_dbg(&intf->dev, "out of memory (buf kmalloc)\n");
+		kfree(acm);
+		return -ENOMEM;
+	}
 
-			acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
-			if (!acm->ctrlurb) {
-				err("out of memory");
-				kfree(acm);
-				kfree(buf);
-				return -ENOMEM;
-			}
-			acm->readurb = usb_alloc_urb(0, GFP_KERNEL);
-			if (!acm->readurb) {
-				err("out of memory");
-				usb_free_urb(acm->ctrlurb);
-				kfree(acm);
-				kfree(buf);
-				return -ENOMEM;
-			}
-			acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
-			if (!acm->writeurb) {
-				err("out of memory");
-				usb_free_urb(acm->readurb);
-				usb_free_urb(acm->ctrlurb);
-				kfree(acm);
-				kfree(buf);
-				return -ENOMEM;
-			}
+	acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!acm->ctrlurb) {
+		dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n");
+		kfree(acm);
+		kfree(buf);
+		return -ENOMEM;
+	}
+	acm->readurb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!acm->readurb) {
+		dev_dbg(&intf->dev, "out of memory (readurb kmalloc)\n");
+		usb_free_urb(acm->ctrlurb);
+		kfree(acm);
+		kfree(buf);
+		return -ENOMEM;
+	}
+	acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!acm->writeurb) {
+		dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n");
+		usb_free_urb(acm->readurb);
+		usb_free_urb(acm->ctrlurb);
+		kfree(acm);
+		kfree(buf);
+		return -ENOMEM;
+	}
 
-			usb_fill_int_urb(acm->ctrlurb, dev, usb_rcvintpipe(dev, epctrl->bEndpointAddress),
-				buf, ctrlsize, acm_ctrl_irq, acm, epctrl->bInterval);
+	usb_fill_int_urb(acm->ctrlurb, dev, usb_rcvintpipe(dev, epctrl->bEndpointAddress),
+		buf, ctrlsize, acm_ctrl_irq, acm, epctrl->bInterval);
 
-			usb_fill_bulk_urb(acm->readurb, dev, usb_rcvbulkpipe(dev, epread->bEndpointAddress),
-				buf += ctrlsize, readsize, acm_read_bulk, acm);
-			acm->readurb->transfer_flags |= URB_NO_FSBR;
+	usb_fill_bulk_urb(acm->readurb, dev, usb_rcvbulkpipe(dev, epread->bEndpointAddress),
+		buf += ctrlsize, readsize, acm_read_bulk, acm);
+	acm->readurb->transfer_flags |= URB_NO_FSBR;
 
-			usb_fill_bulk_urb(acm->writeurb, dev, usb_sndbulkpipe(dev, epwrite->bEndpointAddress),
-				buf += readsize, acm->writesize, acm_write_bulk, acm);
-			acm->writeurb->transfer_flags |= URB_NO_FSBR;
+	usb_fill_bulk_urb(acm->writeurb, dev, usb_sndbulkpipe(dev, epwrite->bEndpointAddress),
+		buf += readsize, acm->writesize, acm_write_bulk, acm);
+	acm->writeurb->transfer_flags |= URB_NO_FSBR;
 
-			dev_info(&intf->dev, "ttyACM%d: USB ACM device", minor);
+	if ( (j = usb_driver_claim_interface(&acm_driver, data, acm)) != 0) {
+		err("claim failed");
+		usb_free_urb(acm->ctrlurb);
+		usb_free_urb(acm->readurb);
+		usb_free_urb(acm->writeurb);
+		kfree(acm);
+		kfree(buf);
+		return j;
+	} 
 
-			acm_set_control(acm, acm->ctrlout);
+	tty_register_device(acm_tty_driver, minor, &intf->dev);
 
-			acm->line.speed = cpu_to_le32(9600);
-			acm->line.databits = 8;
-			acm_set_line(acm, &acm->line);
+	dev_info(&intf->dev, "ttyACM%d: USB ACM device\n", minor);
 
-			if ( (j = usb_driver_claim_interface(&acm_driver, data, acm)) != 0) {
-				err("claim failed");
-				usb_free_urb(acm->ctrlurb);
-				usb_free_urb(acm->readurb);
-				usb_free_urb(acm->writeurb);
-				kfree(acm);
-				kfree(buf);
-				return j;
-			} 
+	acm_set_control(acm, acm->ctrlout);
 
-			tty_register_device(acm_tty_driver, minor, &intf->dev);
+	acm->line.speed = cpu_to_le32(9600);
+	acm->line.databits = 8;
+	acm_set_line(acm, &acm->line);
 
-			acm_table[minor] = acm;
-			usb_set_intfdata (intf, acm);
-			return 0;
+	acm_table[minor] = acm;
+	usb_set_intfdata (intf, acm);
+	return 0;
 }
+#undef CHECK_XFERTYPE
 
 static void acm_disconnect(struct usb_interface *intf)
 {
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 0e269d788..8836be095 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -226,11 +226,21 @@ extern struct usb_driver usblp_driver;
 
 static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, int recip, int value, void *buf, int len)
 {
-	int retval = usb_control_msg(usblp->dev,
+	int retval;
+	int index = usblp->ifnum;
+
+	/* High byte has the interface index.
+	   Low byte has the alternate setting.
+	 */
+	if ((request == USBLP_REQ_GET_ID) && (type == USB_TYPE_CLASS)) {
+	  index = (usblp->ifnum<<8)|usblp->protocol[usblp->current_protocol].alt_setting;
+	}
+
+	retval = usb_control_msg(usblp->dev,
 		dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0),
-		request, type | dir | recip, value, usblp->ifnum, buf, len, USBLP_WRITE_TIMEOUT);
-	dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d len: %#x result: %d",
-		request, !!dir, recip, value, len, retval);
+		request, type | dir | recip, value, index, buf, len, USBLP_WRITE_TIMEOUT);
+	dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d",
+		request, !!dir, recip, value, index, len, retval);
 	return retval < 0 ? retval : 0;
 }
 
@@ -440,6 +450,9 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		goto done;
 	}
 
+	dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd),
+		_IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) );
+
 	if (_IOC_TYPE(cmd) == 'P')	/* new-style ioctl number */
 
 		switch (_IOC_NR(cmd)) {
diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile
index e3907e097..9e8c377b8 100644
--- a/drivers/usb/core/Makefile
+++ b/drivers/usb/core/Makefile
@@ -3,7 +3,7 @@
 #
 
 usbcore-objs	:= usb.o hub.o hcd.o urb.o message.o \
-			config.o file.o buffer.o driverfs.o
+			config.o file.o buffer.o sysfs.o
 
 ifeq ($(CONFIG_PCI),y)
 	usbcore-objs	+= hcd-pci.o
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 5f24e9ce1..06f667d33 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -18,6 +18,11 @@
 #define USB_MAXCONFIG			8	/* Arbitrary limit */
 
 
+static inline const char *plural(int n)
+{
+	return (n == 1 ? "" : "s");
+}
+
 static int find_next_descriptor(unsigned char *buffer, int size,
     int dt1, int dt2, int *num_skipped)
 {
@@ -26,7 +31,7 @@ static int find_next_descriptor(unsigned char *buffer, int size,
 	unsigned char *buffer0 = buffer;
 
 	/* Find the next descriptor of type dt1 or dt2 */
-	while (size >= sizeof(struct usb_descriptor_header)) {
+	while (size > 0) {
 		h = (struct usb_descriptor_header *) buffer;
 		if (h->bDescriptorType == dt1 || h->bDescriptorType == dt2)
 			break;
@@ -43,46 +48,46 @@ static int find_next_descriptor(unsigned char *buffer, int size,
 }
 
 static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
-    int asnum, struct usb_host_endpoint *endpoint,
+    int asnum, struct usb_host_interface *ifp, int num_ep,
     unsigned char *buffer, int size)
 {
 	unsigned char *buffer0 = buffer;
-	struct usb_descriptor_header *header;
+	struct usb_endpoint_descriptor *d;
+	struct usb_host_endpoint *endpoint;
 	int n, i;
 
-	header = (struct usb_descriptor_header *)buffer;
-	if (header->bDescriptorType != USB_DT_ENDPOINT) {
-		dev_err(ddev, "config %d interface %d altsetting %d has an "
-		    "unexpected descriptor of type 0x%X, "
-		    "expecting endpoint type 0x%X\n",
-		    cfgno, inum, asnum,
-		    header->bDescriptorType, USB_DT_ENDPOINT);
-		return -EINVAL;
-	}
+	d = (struct usb_endpoint_descriptor *) buffer;
+	buffer += d->bLength;
+	size -= d->bLength;
 
-	if (header->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE)
-		memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_AUDIO_SIZE);
-	else if (header->bLength >= USB_DT_ENDPOINT_SIZE)
-		memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_SIZE);
+	if (d->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE)
+		n = USB_DT_ENDPOINT_AUDIO_SIZE;
+	else if (d->bLength >= USB_DT_ENDPOINT_SIZE)
+		n = USB_DT_ENDPOINT_SIZE;
 	else {
-		dev_err(ddev, "config %d interface %d altsetting %d has an "
-		    "invalid endpoint descriptor of length %d\n",
-		    cfgno, inum, asnum, header->bLength);
-		return -EINVAL;
+		dev_warn(ddev, "config %d interface %d altsetting %d has an "
+		    "invalid endpoint descriptor of length %d, skipping\n",
+		    cfgno, inum, asnum, d->bLength);
+		goto skip_to_next_endpoint_or_interface_descriptor;
 	}
 
-	i = endpoint->desc.bEndpointAddress & ~USB_ENDPOINT_DIR_MASK;
+	i = d->bEndpointAddress & ~USB_ENDPOINT_DIR_MASK;
 	if (i >= 16 || i == 0) {
-		dev_err(ddev, "config %d interface %d altsetting %d has an "
-		    "invalid endpoint with address 0x%X\n",
-		    cfgno, inum, asnum, endpoint->desc.bEndpointAddress);
-		return -EINVAL;
+		dev_warn(ddev, "config %d interface %d altsetting %d has an "
+		    "invalid endpoint with address 0x%X, skipping\n",
+		    cfgno, inum, asnum, d->bEndpointAddress);
+		goto skip_to_next_endpoint_or_interface_descriptor;
 	}
 
-	le16_to_cpus(&endpoint->desc.wMaxPacketSize);
+	/* Only store as many endpoints as we have room for */
+	if (ifp->desc.bNumEndpoints >= num_ep)
+		goto skip_to_next_endpoint_or_interface_descriptor;
+
+	endpoint = &ifp->endpoint[ifp->desc.bNumEndpoints];
+	++ifp->desc.bNumEndpoints;
 
-	buffer += header->bLength;
-	size -= header->bLength;
+	memcpy(&endpoint->desc, d, n);
+	le16_to_cpus(&endpoint->desc.wMaxPacketSize);
 
 	/* Skip over any Class Specific or Vendor Specific descriptors;
 	 * find the next endpoint or interface descriptor */
@@ -91,67 +96,72 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
 	    USB_DT_INTERFACE, &n);
 	endpoint->extralen = i;
 	if (n > 0)
-		dev_dbg(ddev, "skipped %d class/vendor specific endpoint "
-		    "descriptors\n", n);
+		dev_dbg(ddev, "skipped %d descriptor%s after %s\n",
+		    n, plural(n), "endpoint");
+	return buffer - buffer0 + i;
+
+skip_to_next_endpoint_or_interface_descriptor:
+	i = find_next_descriptor(buffer, size, USB_DT_ENDPOINT,
+	    USB_DT_INTERFACE, NULL);
 	return buffer - buffer0 + i;
 }
 
-static void usb_free_intf(struct usb_interface *intf)
+static void usb_release_interface_cache(struct kref *ref)
 {
+	struct usb_interface_cache *intfc = ref_to_usb_interface_cache(ref);
 	int j;
 
-	if (intf->altsetting) {
-		for (j = 0; j < intf->num_altsetting; j++) {
-			struct usb_host_interface *alt = &intf->altsetting[j];
-
-			kfree(alt->endpoint);
-		}
-		kfree(intf->altsetting);
-	}
-	kfree(intf);
+	for (j = 0; j < intfc->num_altsetting; j++)
+		kfree(intfc->altsetting[j].endpoint);
+	kfree(intfc);
 }
 
 static int usb_parse_interface(struct device *ddev, int cfgno,
-    struct usb_host_config *config, unsigned char *buffer, int size)
+    struct usb_host_config *config, unsigned char *buffer, int size,
+    u8 inums[], u8 nalts[])
 {
 	unsigned char *buffer0 = buffer;
 	struct usb_interface_descriptor	*d;
 	int inum, asnum;
-	struct usb_interface *interface;
+	struct usb_interface_cache *intfc;
 	struct usb_host_interface *alt;
 	int i, n;
 	int len, retval;
+	int num_ep, num_ep_orig;
 
 	d = (struct usb_interface_descriptor *) buffer;
 	buffer += d->bLength;
 	size -= d->bLength;
 
-	if (d->bDescriptorType != USB_DT_INTERFACE) {
-		dev_err(ddev, "config %d has an unexpected descriptor of type "
-		    "0x%X, expecting interface type 0x%X\n",
-		    cfgno, d->bDescriptorType, USB_DT_INTERFACE);
-		return -EINVAL;
-	}
+	if (d->bLength < USB_DT_INTERFACE_SIZE)
+		goto skip_to_next_interface_descriptor;
 
+	/* Which interface entry is this? */
+	intfc = NULL;
 	inum = d->bInterfaceNumber;
-	if (inum >= config->desc.bNumInterfaces)
+	for (i = 0; i < config->desc.bNumInterfaces; ++i) {
+		if (inums[i] == inum) {
+			intfc = config->intf_cache[i];
+			break;
+		}
+	}
+	if (!intfc || intfc->num_altsetting >= nalts[i])
 		goto skip_to_next_interface_descriptor;
 
-	interface = config->interface[inum];
+	/* Check for duplicate altsetting entries */
 	asnum = d->bAlternateSetting;
-	if (asnum >= interface->num_altsetting) {
-		dev_err(ddev, "config %d interface %d has an invalid "
-		    "alternate setting number: %d but max is %d\n",
-		    cfgno, inum, asnum, interface->num_altsetting - 1);
-		return -EINVAL;
+	for ((i = 0, alt = &intfc->altsetting[0]);
+	      i < intfc->num_altsetting;
+	     (++i, ++alt)) {
+		if (alt->desc.bAlternateSetting == asnum) {
+			dev_warn(ddev, "Duplicate descriptor for config %d "
+			    "interface %d altsetting %d, skipping\n",
+			    cfgno, inum, asnum);
+			goto skip_to_next_interface_descriptor;
+		}
 	}
 
-	alt = &interface->altsetting[asnum];
-	if (alt->desc.bLength) {
-		dev_err(ddev, "Duplicate descriptor for config %d "
-		    "interface %d altsetting %d\n", cfgno, inum, asnum);
-		return -EINVAL;
-	}
+	++intfc->num_altsetting;
 	memcpy(&alt->desc, d, USB_DT_INTERFACE_SIZE);
 
 	/* Skip over any Class Specific or Vendor Specific descriptors;
@@ -161,41 +171,48 @@ static int usb_parse_interface(struct device *ddev, int cfgno,
 	    USB_DT_INTERFACE, &n);
 	alt->extralen = i;
 	if (n > 0)
-		dev_dbg(ddev, "skipped %d class/vendor specific "
-		    "interface descriptors\n", n);
+		dev_dbg(ddev, "skipped %d descriptor%s after %s\n",
+		    n, plural(n), "interface");
 	buffer += i;
 	size -= i;
 
-	if (alt->desc.bNumEndpoints > USB_MAXENDPOINTS) {
-		dev_err(ddev, "too many endpoints for config %d interface %d "
-		    "altsetting %d: %d, maximum allowed: %d\n",
-		    cfgno, inum, asnum, alt->desc.bNumEndpoints,
-		    USB_MAXENDPOINTS);
-		return -EINVAL;
+	/* Allocate space for the right(?) number of endpoints */
+	num_ep = num_ep_orig = alt->desc.bNumEndpoints;
+	alt->desc.bNumEndpoints = 0;		// Use as a counter
+	if (num_ep > USB_MAXENDPOINTS) {
+		dev_warn(ddev, "too many endpoints for config %d interface %d "
+		    "altsetting %d: %d, using maximum allowed: %d\n",
+		    cfgno, inum, asnum, num_ep, USB_MAXENDPOINTS);
+		num_ep = USB_MAXENDPOINTS;
 	}
 
-	len = alt->desc.bNumEndpoints * sizeof(struct usb_host_endpoint);
+	len = sizeof(struct usb_host_endpoint) * num_ep;
 	alt->endpoint = kmalloc(len, GFP_KERNEL);
 	if (!alt->endpoint)
 		return -ENOMEM;
 	memset(alt->endpoint, 0, len);
 
-	for (i = 0; i < alt->desc.bNumEndpoints; i++) {
-		if (size < USB_DT_ENDPOINT_SIZE) {
-			dev_err(ddev, "too few endpoint descriptors for "
-			    "config %d interface %d altsetting %d\n",
-			    cfgno, inum, asnum);
-			return -EINVAL;
-		}
-
-		retval = usb_parse_endpoint(ddev, cfgno, inum, asnum,
-		    alt->endpoint + i, buffer, size);
+	/* Parse all the endpoint descriptors */
+	n = 0;
+	while (size > 0) {
+		if (((struct usb_descriptor_header *) buffer)->bDescriptorType
+		     == USB_DT_INTERFACE)
+			break;
+		retval = usb_parse_endpoint(ddev, cfgno, inum, asnum, alt,
+		    num_ep, buffer, size);
 		if (retval < 0)
 			return retval;
+		++n;
 
 		buffer += retval;
 		size -= retval;
 	}
+
+	if (n != num_ep_orig)
+		dev_warn(ddev, "config %d interface %d altsetting %d has %d "
+		    "endpoint descriptor%s, different from the interface "
+		    "descriptor's value: %d\n",
+		    cfgno, inum, asnum, n, plural(n), num_ep_orig);
 	return buffer - buffer0;
 
 skip_to_next_interface_descriptor:
@@ -207,14 +224,16 @@ skip_to_next_interface_descriptor:
 int usb_parse_configuration(struct device *ddev, int cfgidx,
     struct usb_host_config *config, unsigned char *buffer, int size)
 {
+	unsigned char *buffer0 = buffer;
 	int cfgno;
 	int nintf, nintf_orig;
 	int i, j, n;
-	struct usb_interface *interface;
+	struct usb_interface_cache *intfc;
 	unsigned char *buffer2;
 	int size2;
 	struct usb_descriptor_header *header;
 	int len, retval;
+	u8 inums[USB_MAXINTERFACES], nalts[USB_MAXINTERFACES];
 
 	memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE);
 	if (config->desc.bDescriptorType != USB_DT_CONFIG ||
@@ -224,7 +243,6 @@ int usb_parse_configuration(struct device *ddev, int cfgidx,
 		    config->desc.bDescriptorType, config->desc.bLength);
 		return -EINVAL;
 	}
-	config->desc.wTotalLength = size;
 	cfgno = config->desc.bConfigurationValue;
 
 	buffer += config->desc.bLength;
@@ -235,84 +253,110 @@ int usb_parse_configuration(struct device *ddev, int cfgidx,
 		dev_warn(ddev, "config %d has too many interfaces: %d, "
 		    "using maximum allowed: %d\n",
 		    cfgno, nintf, USB_MAXINTERFACES);
-		config->desc.bNumInterfaces = nintf = USB_MAXINTERFACES;
-	}
-
-	for (i = 0; i < nintf; ++i) {
-		interface = config->interface[i] =
-		    kmalloc(sizeof(struct usb_interface), GFP_KERNEL);
-		if (!interface)
-			return -ENOMEM;
-		memset(interface, 0, sizeof(struct usb_interface));
+		nintf = USB_MAXINTERFACES;
 	}
 
 	/* Go through the descriptors, checking their length and counting the
 	 * number of altsettings for each interface */
+	n = 0;
 	for ((buffer2 = buffer, size2 = size);
-	      size2 >= sizeof(struct usb_descriptor_header);
+	      size2 > 0;
 	     (buffer2 += header->bLength, size2 -= header->bLength)) {
 
+		if (size2 < sizeof(struct usb_descriptor_header)) {
+			dev_warn(ddev, "config %d descriptor has %d excess "
+			    "byte%s, ignoring\n",
+			    cfgno, size2, plural(size2));
+			break;
+		}
+
 		header = (struct usb_descriptor_header *) buffer2;
 		if ((header->bLength > size2) || (header->bLength < 2)) {
-			dev_err(ddev, "config %d has an invalid descriptor "
-			    "of length %d\n", cfgno, header->bLength);
-			return -EINVAL;
+			dev_warn(ddev, "config %d has an invalid descriptor "
+			    "of length %d, skipping remainder of the config\n",
+			    cfgno, header->bLength);
+			break;
 		}
 
 		if (header->bDescriptorType == USB_DT_INTERFACE) {
 			struct usb_interface_descriptor *d;
+			int inum;
 
 			d = (struct usb_interface_descriptor *) header;
 			if (d->bLength < USB_DT_INTERFACE_SIZE) {
-				dev_err(ddev, "config %d has an invalid "
-				    "interface descriptor of length %d\n",
-				    cfgno, d->bLength);
-				return -EINVAL;
+				dev_warn(ddev, "config %d has an invalid "
+				    "interface descriptor of length %d, "
+				    "skipping\n", cfgno, d->bLength);
+				continue;
 			}
 
-			i = d->bInterfaceNumber;
-			if (i >= nintf_orig) {
-				dev_err(ddev, "config %d has an invalid "
+			inum = d->bInterfaceNumber;
+			if (inum >= nintf_orig)
+				dev_warn(ddev, "config %d has an invalid "
 				    "interface number: %d but max is %d\n",
-				    cfgno, i, nintf_orig - 1);
-				return -EINVAL;
+				    cfgno, inum, nintf_orig - 1);
+
+			/* Have we already encountered this interface?
+			 * Count its altsettings */
+			for (i = 0; i < n; ++i) {
+				if (inums[i] == inum)
+					break;
+			}
+			if (i < n) {
+				if (nalts[i] < 255)
+					++nalts[i];
+			} else if (n < USB_MAXINTERFACES) {
+				inums[n] = inum;
+				nalts[n] = 1;
+				++n;
 			}
-			if (i < nintf)
-				++config->interface[i]->num_altsetting;
 
 		} else if (header->bDescriptorType == USB_DT_DEVICE ||
-			    header->bDescriptorType == USB_DT_CONFIG) {
-			dev_err(ddev, "config %d contains an unexpected "
-			    "descriptor of type 0x%X\n",
+			    header->bDescriptorType == USB_DT_CONFIG)
+			dev_warn(ddev, "config %d contains an unexpected "
+			    "descriptor of type 0x%X, skipping\n",
 			    cfgno, header->bDescriptorType);
-			return -EINVAL;
-		}
 
 	}	/* for ((buffer2 = buffer, size2 = size); ...) */
-
-	/* Allocate the altsetting arrays */
+	size = buffer2 - buffer;
+	config->desc.wTotalLength = buffer2 - buffer0;
+
+	if (n != nintf)
+		dev_warn(ddev, "config %d has %d interface%s, different from "
+		    "the descriptor's value: %d\n",
+		    cfgno, n, plural(n), nintf_orig);
+	else if (n == 0)
+		dev_warn(ddev, "config %d has no interfaces?\n", cfgno);
+	config->desc.bNumInterfaces = nintf = n;
+
+	/* Check for missing interface numbers */
 	for (i = 0; i < nintf; ++i) {
-		interface = config->interface[i];
-		if (interface->num_altsetting > USB_MAXALTSETTING) {
-			dev_err(ddev, "too many alternate settings for "
-			    "config %d interface %d: %d, "
-			    "maximum allowed: %d\n",
-			    cfgno, i, interface->num_altsetting,
-			    USB_MAXALTSETTING);
-			return -EINVAL;
+		for (j = 0; j < nintf; ++j) {
+			if (inums[j] == i)
+				break;
 		}
-		if (interface->num_altsetting == 0) {
-			dev_err(ddev, "config %d has no interface number "
+		if (j >= nintf)
+			dev_warn(ddev, "config %d has no interface number "
 			    "%d\n", cfgno, i);
-			return -EINVAL;
+	}
+
+	/* Allocate the usb_interface_caches and altsetting arrays */
+	for (i = 0; i < nintf; ++i) {
+		j = nalts[i];
+		if (j > USB_MAXALTSETTING) {
+			dev_warn(ddev, "too many alternate settings for "
+			    "config %d interface %d: %d, "
+			    "using maximum allowed: %d\n",
+			    cfgno, inums[i], j, USB_MAXALTSETTING);
+			nalts[i] = j = USB_MAXALTSETTING;
 		}
 
-		len = sizeof(*interface->altsetting) *
-		    interface->num_altsetting;
-		interface->altsetting = kmalloc(len, GFP_KERNEL);
-		if (!interface->altsetting)
+		len = sizeof(*intfc) + sizeof(struct usb_host_interface) * j;
+		config->intf_cache[i] = intfc = kmalloc(len, GFP_KERNEL);
+		if (!intfc)
 			return -ENOMEM;
-		memset(interface->altsetting, 0, len);
+		memset(intfc, 0, len);
+		kref_init(&intfc->ref, usb_release_interface_cache);
 	}
 
 	/* Skip over any Class Specific or Vendor Specific descriptors;
@@ -322,15 +366,15 @@ int usb_parse_configuration(struct device *ddev, int cfgidx,
 	    USB_DT_INTERFACE, &n);
 	config->extralen = i;
 	if (n > 0)
-		dev_dbg(ddev, "skipped %d class/vendor specific "
-		    "configuration descriptors\n", n);
+		dev_dbg(ddev, "skipped %d descriptor%s after %s\n",
+		    n, plural(n), "configuration");
 	buffer += i;
 	size -= i;
 
 	/* Parse all the interface/altsetting descriptors */
-	while (size >= sizeof(struct usb_descriptor_header)) {
+	while (size > 0) {
 		retval = usb_parse_interface(ddev, cfgno, config,
-		    buffer, size);
+		    buffer, size, inums, nalts);
 		if (retval < 0)
 			return retval;
 
@@ -340,17 +384,20 @@ int usb_parse_configuration(struct device *ddev, int cfgidx,
 
 	/* Check for missing altsettings */
 	for (i = 0; i < nintf; ++i) {
-		interface = config->interface[i];
-		for (j = 0; j < interface->num_altsetting; ++j) {
-			if (!interface->altsetting[j].desc.bLength) {
-				dev_err(ddev, "config %d interface %d has no "
-				    "altsetting %d\n", cfgno, i, j);
-				return -EINVAL;
+		intfc = config->intf_cache[i];
+		for (j = 0; j < intfc->num_altsetting; ++j) {
+			for (n = 0; n < intfc->num_altsetting; ++n) {
+				if (intfc->altsetting[n].desc.
+				    bAlternateSetting == j)
+					break;
 			}
+			if (n >= intfc->num_altsetting)
+				dev_warn(ddev, "config %d interface %d has no "
+				    "altsetting %d\n", cfgno, inums[i], j);
 		}
 	}
 
-	return size;
+	return 0;
 }
 
 // hub-only!! ... and only exported for reset/reinit path.
@@ -374,10 +421,8 @@ void usb_destroy_configuration(struct usb_device *dev)
 		struct usb_host_config *cf = &dev->config[c];
 
 		for (i = 0; i < cf->desc.bNumInterfaces; i++) {
-			struct usb_interface *ifp = cf->interface[i];
-
-			if (ifp)
-				usb_free_intf(ifp);
+			if (cf->intf_cache[i])
+				kref_put(&cf->intf_cache[i]->ref);
 		}
 	}
 	kfree(dev->config);
@@ -420,23 +465,24 @@ int usb_get_configuration(struct usb_device *dev)
 		goto err2;
 	memset(dev->rawdescriptors, 0, length);
 
-	buffer = kmalloc(8, GFP_KERNEL);
+	buffer = kmalloc(USB_DT_CONFIG_SIZE, GFP_KERNEL);
 	if (!buffer)
 		goto err2;
 	desc = (struct usb_config_descriptor *)buffer;
 
 	for (cfgno = 0; cfgno < ncfg; cfgno++) {
-		/* We grab the first 8 bytes so we know how long the whole */
-		/* configuration is */
+		/* We grab just the first descriptor so we know how long
+		 * the whole configuration is */
 		result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,
-		    buffer, 8);
+		    buffer, USB_DT_CONFIG_SIZE);
 		if (result < 0) {
 			dev_err(ddev, "unable to read config index %d "
-			    "descriptor\n", cfgno);
+			    "descriptor/%s\n", cfgno, "start");
 			goto err;
-		} else if (result < 8) {
+		} else if (result < 4) {
 			dev_err(ddev, "config index %d descriptor too short "
-			    "(expected %i, got %i)\n", cfgno, 8, result);
+			    "(expected %i, got %i)\n", cfgno,
+			    USB_DT_CONFIG_SIZE, result);
 			result = -EINVAL;
 			goto err;
 		}
@@ -453,26 +499,21 @@ int usb_get_configuration(struct usb_device *dev)
 		    bigbuffer, length);
 		if (result < 0) {
 			dev_err(ddev, "unable to read config index %d "
-			    "descriptor\n", cfgno);
+			    "descriptor/%s\n", cfgno, "all");
 			kfree(bigbuffer);
 			goto err;
 		}
 		if (result < length) {
-			dev_err(ddev, "config index %d descriptor too short "
+			dev_warn(ddev, "config index %d descriptor too short "
 			    "(expected %i, got %i)\n", cfgno, length, result);
-			result = -EINVAL;
-			kfree(bigbuffer);
-			goto err;
+			length = result;
 		}
 
 		dev->rawdescriptors[cfgno] = bigbuffer;
 
 		result = usb_parse_configuration(&dev->dev, cfgno,
 		    &dev->config[cfgno], bigbuffer, length);
-		if (result > 0)
-			dev_dbg(ddev, "config index %d descriptor has %d "
-			    "excess byte(s)\n", cfgno, result);
-		else if (result < 0) {
+		if (result < 0) {
 			++cfgno;
 			goto err;
 		}
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index aa6f7baa6..30b4378aa 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -232,13 +232,21 @@ static char *usb_dump_endpoint_descriptor (
 	return start;
 }
 
-static char *usb_dump_interface_descriptor(char *start, char *end, const struct usb_interface *iface, int setno)
+static char *usb_dump_interface_descriptor(char *start, char *end,
+	const struct usb_interface_cache *intfc,
+	const struct usb_interface *iface,
+	int setno)
 {
-	struct usb_interface_descriptor *desc = &iface->altsetting[setno].desc;
+	const struct usb_interface_descriptor *desc = &intfc->altsetting[setno].desc;
+	char *driver_name = "";
 
 	if (start > end)
 		return start;
 	down_read(&usb_bus_type.subsys.rwsem);
+	if (iface)
+		driver_name = (iface->dev.driver
+				? iface->dev.driver->name
+				: "(none)");
 	start += sprintf(start, format_iface,
 			 desc->bInterfaceNumber,
 			 desc->bAlternateSetting,
@@ -247,9 +255,7 @@ static char *usb_dump_interface_descriptor(char *start, char *end, const struct
 			 class_decode(desc->bInterfaceClass),
 			 desc->bInterfaceSubClass,
 			 desc->bInterfaceProtocol,
-			 iface->dev.driver
-				? iface->dev.driver->name
-				: "(none)");
+			 driver_name);
 	up_read(&usb_bus_type.subsys.rwsem);
 	return start;
 }
@@ -258,13 +264,14 @@ static char *usb_dump_interface(
 	int speed,
 	char *start,
 	char *end,
+	const struct usb_interface_cache *intfc,
 	const struct usb_interface *iface,
 	int setno
 ) {
-	struct usb_host_interface *desc = &iface->altsetting[setno];
+	const struct usb_host_interface *desc = &intfc->altsetting[setno];
 	int i;
 
-	start = usb_dump_interface_descriptor(start, end, iface, setno);
+	start = usb_dump_interface_descriptor(start, end, intfc, iface, setno);
 	for (i = 0; i < desc->desc.bNumEndpoints; i++) {
 		if (start > end)
 			return start;
@@ -303,6 +310,7 @@ static char *usb_dump_config (
 )
 {
 	int i, j;
+	struct usb_interface_cache *intfc;
 	struct usb_interface *interface;
 
 	if (start > end)
@@ -311,14 +319,13 @@ static char *usb_dump_config (
 		return start + sprintf(start, "(null Cfg. desc.)\n");
 	start = usb_dump_config_descriptor(start, end, &config->desc, active);
 	for (i = 0; i < config->desc.bNumInterfaces; i++) {
+		intfc = config->intf_cache[i];
 		interface = config->interface[i];
-		if (!interface)
-			break;
-		for (j = 0; j < interface->num_altsetting; j++) {
+		for (j = 0; j < intfc->num_altsetting; j++) {
 			if (start > end)
 				return start;
 			start = usb_dump_interface(speed,
-					start, end, interface, j);
+				start, end, intfc, interface, j);
 		}
 	}
 	return start;
@@ -395,7 +402,7 @@ static char *usb_dump_desc(char *start, char *end, struct usb_device *dev)
 		return start;
 	
 	start = usb_dump_device_strings (start, end, dev);
-	
+
 	for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
 		if (start > end)
 			return start;
@@ -445,6 +452,7 @@ static char *usb_dump_string(char *start, char *end, const struct usb_device *de
  * nbytes - the maximum number of bytes to write
  * skip_bytes - the number of bytes to skip before writing anything
  * file_offset - the offset into the devices file on completion
+ * The caller must own the usbdev->serialize semaphore.
  */
 static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes, loff_t *skip_bytes, loff_t *file_offset,
 				struct usb_device *usbdev, struct usb_bus *bus, int level, int index, int count)
@@ -545,9 +553,13 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes, loff_t *ski
 	
 	/* Now look at all of this device's children. */
 	for (chix = 0; chix < usbdev->maxchild; chix++) {
-		if (usbdev->children[chix]) {
-			ret = usb_device_dump(buffer, nbytes, skip_bytes, file_offset, usbdev->children[chix],
+		struct usb_device *childdev = usbdev->children[chix];
+
+		if (childdev) {
+			down(&childdev->serialize);
+			ret = usb_device_dump(buffer, nbytes, skip_bytes, file_offset, childdev,
 					bus, level + 1, chix, ++cnt);
+			up(&childdev->serialize);
 			if (ret == -EFAULT)
 				return total_written;
 			total_written += ret;
@@ -575,8 +587,11 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte
 	for (buslist = usb_bus_list.next; buslist != &usb_bus_list; buslist = buslist->next) {
 		/* print devices for this bus */
 		bus = list_entry(buslist, struct usb_bus, bus_list);
+
 		/* recurse through all children of the root hub */
+		down(&bus->root_hub->serialize);
 		ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos, bus->root_hub, bus, 0, 0, 0);
+		up(&bus->root_hub->serialize);
 		if (ret < 0) {
 			up(&usb_bus_list_lock);
 			return ret;
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index ed1296ad9..29799129a 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -45,6 +45,7 @@
 #include <linux/usbdevice_fs.h>
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
+#include <linux/moduleparam.h>
 
 #include "hcd.h"	/* for usbcore internals */
 #include "usb.h"
@@ -54,12 +55,28 @@ struct async {
 	struct dev_state *ps;
 	struct task_struct *task;
 	unsigned int signr;
-	unsigned int intf;
+	unsigned int ifnum;
 	void __user *userbuffer;
 	void __user *userurb;
 	struct urb *urb;
 };
 
+static int usbfs_snoop = 0;
+module_param (usbfs_snoop, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC (usbfs_snoop, "true to log all usbfs traffic");
+
+#define snoop(dev, format, arg...)				\
+	do {							\
+		if (usbfs_snoop)				\
+			dev_info( dev , format , ## arg);	\
+	} while (0)
+
+
+static inline int connected (struct usb_device *dev)
+{
+	return dev->state != USB_STATE_NOTATTACHED;
+}
+
 static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
 {
 	loff_t ret;
@@ -87,14 +104,15 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
 static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
 {
 	struct dev_state *ps = (struct dev_state *)file->private_data;
+	struct usb_device *dev = ps->dev;
 	ssize_t ret = 0;
 	unsigned len;
 	loff_t pos;
 	int i;
 
 	pos = *ppos;
-	down_read(&ps->devsem);
-	if (!ps->dev) {
+	down(&dev->serialize);
+	if (!connected(dev)) {
 		ret = -ENODEV;
 		goto err;
 	} else if (pos < 0) {
@@ -106,7 +124,7 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, l
 		len = sizeof(struct usb_device_descriptor) - pos;
 		if (len > nbytes)
 			len = nbytes;
-		if (copy_to_user(buf, ((char *)&ps->dev->descriptor) + pos, len)) {
+		if (copy_to_user(buf, ((char *)&dev->descriptor) + pos, len)) {
 			ret = -EFAULT;
 			goto err;
 		}
@@ -118,9 +136,9 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, l
 	}
 
 	pos = sizeof(struct usb_device_descriptor);
-	for (i = 0; nbytes && i < ps->dev->descriptor.bNumConfigurations; i++) {
+	for (i = 0; nbytes && i < dev->descriptor.bNumConfigurations; i++) {
 		struct usb_config_descriptor *config =
-			(struct usb_config_descriptor *)ps->dev->rawdescriptors[i];
+			(struct usb_config_descriptor *)dev->rawdescriptors[i];
 		unsigned int length = le16_to_cpu(config->wTotalLength);
 
 		if (*ppos < pos + length) {
@@ -128,7 +146,7 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, l
 			/* The descriptor may claim to be longer than it
 			 * really is.  Here is the actual allocated length. */
 			unsigned alloclen =
-				ps->dev->config[i].desc.wTotalLength;
+				dev->config[i].desc.wTotalLength;
 
 			len = length - (*ppos - pos);
 			if (len > nbytes)
@@ -138,7 +156,7 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, l
 			if (alloclen > (*ppos - pos)) {
 				alloclen -= (*ppos - pos);
 				if (copy_to_user(buf,
-				    ps->dev->rawdescriptors[i] + (*ppos - pos),
+				    dev->rawdescriptors[i] + (*ppos - pos),
 				    min(len, alloclen))) {
 					ret = -EFAULT;
 					goto err;
@@ -155,35 +173,10 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, l
 	}
 
 err:
-	up_read(&ps->devsem);
+	up(&dev->serialize);
 	return ret;
 }
 
-extern inline unsigned int ld2(unsigned int x)
-{
-        unsigned int r = 0;
-        
-        if (x >= 0x10000) {
-                x >>= 16;
-                r += 16;
-        }
-        if (x >= 0x100) {
-                x >>= 8;
-                r += 8;
-        }
-        if (x >= 0x10) {
-                x >>= 4;
-                r += 4;
-        }
-        if (x >= 4) {
-                x >>= 2;
-                r += 2;
-        }
-        if (x >= 2)
-                r++;
-        return r;
-}
-
 /*
  * async list handling
  */
@@ -213,7 +206,7 @@ static void free_async(struct async *as)
         kfree(as);
 }
 
-extern __inline__ void async_newpending(struct async *as)
+static inline void async_newpending(struct async *as)
 {
         struct dev_state *ps = as->ps;
         unsigned long flags;
@@ -223,7 +216,7 @@ extern __inline__ void async_newpending(struct async *as)
         spin_unlock_irqrestore(&ps->lock, flags);
 }
 
-extern __inline__ void async_removepending(struct async *as)
+static inline void async_removepending(struct async *as)
 {
         struct dev_state *ps = as->ps;
         unsigned long flags;
@@ -233,7 +226,7 @@ extern __inline__ void async_removepending(struct async *as)
         spin_unlock_irqrestore(&ps->lock, flags);
 }
 
-extern __inline__ struct async *async_getcompleted(struct dev_state *ps)
+static inline struct async *async_getcompleted(struct dev_state *ps)
 {
         unsigned long flags;
         struct async *as = NULL;
@@ -247,7 +240,7 @@ extern __inline__ struct async *async_getcompleted(struct dev_state *ps)
         return as;
 }
 
-extern __inline__ struct async *async_getpending(struct dev_state *ps, void __user *userurb)
+static inline struct async *async_getpending(struct dev_state *ps, void __user *userurb)
 {
         unsigned long flags;
         struct async *as;
@@ -301,7 +294,7 @@ static void destroy_async (struct dev_state *ps, struct list_head *list)
 		free_async(as);
 }
 
-static void destroy_async_on_interface (struct dev_state *ps, unsigned int intf)
+static void destroy_async_on_interface (struct dev_state *ps, unsigned int ifnum)
 {
 	struct list_head *p, *q, hitlist;
 	unsigned long flags;
@@ -309,13 +302,13 @@ static void destroy_async_on_interface (struct dev_state *ps, unsigned int intf)
 	INIT_LIST_HEAD(&hitlist);
 	spin_lock_irqsave(&ps->lock, flags);
 	list_for_each_safe(p, q, &ps->async_pending)
-		if (intf == list_entry(p, struct async, asynclist)->intf)
+		if (ifnum == list_entry(p, struct async, asynclist)->ifnum)
 			list_move_tail(p, &hitlist);
 	spin_unlock_irqrestore(&ps->lock, flags);
 	destroy_async(ps, &hitlist);
 }
 
-extern __inline__ void destroy_all_async(struct dev_state *ps)
+static inline void destroy_all_async(struct dev_state *ps)
 {
 	        destroy_async(ps, &ps->async_pending);
 }
@@ -335,6 +328,7 @@ static int driver_probe (struct usb_interface *intf,
 static void driver_disconnect(struct usb_interface *intf)
 {
 	struct dev_state *ps = usb_get_intfdata (intf);
+	unsigned int ifnum = intf->altsetting->desc.bInterfaceNumber;
 
 	if (!ps)
 		return;
@@ -343,13 +337,15 @@ static void driver_disconnect(struct usb_interface *intf)
 	 * all pending I/O requests; 2.6 does that.
 	 */
 
-	/* prevent new I/O requests */
-	ps->dev = 0;
-	clear_bit(intf->cur_altsetting->desc.bInterfaceNumber, &ps->ifclaimed);
+	if (likely(ifnum < 8*sizeof(ps->ifclaimed)))
+		clear_bit(ifnum, &ps->ifclaimed);
+	else
+		warn("interface number %u out of range", ifnum);
+
 	usb_set_intfdata (intf, NULL);
 
 	/* force async requests to complete */
-	destroy_all_async (ps);
+	destroy_async_on_interface(ps, ifnum);
 }
 
 struct usb_driver usbdevfs_driver = {
@@ -359,71 +355,70 @@ struct usb_driver usbdevfs_driver = {
 	.disconnect =	driver_disconnect,
 };
 
-static int claimintf(struct dev_state *ps, unsigned int intf)
+static int claimintf(struct dev_state *ps, unsigned int ifnum)
 {
 	struct usb_device *dev = ps->dev;
-	struct usb_interface *iface;
+	struct usb_interface *intf;
 	int err;
 
-	if (intf >= 8*sizeof(ps->ifclaimed) || !dev
-			|| intf >= dev->actconfig->desc.bNumInterfaces)
+	if (ifnum >= 8*sizeof(ps->ifclaimed))
 		return -EINVAL;
 	/* already claimed */
-	if (test_bit(intf, &ps->ifclaimed))
+	if (test_bit(ifnum, &ps->ifclaimed))
 		return 0;
-	iface = dev->actconfig->interface[intf];
-	err = -EBUSY;
 
 	/* lock against other changes to driver bindings */
 	down_write(&usb_bus_type.subsys.rwsem);
-	if (!usb_interface_claimed(iface)) {
-		usb_driver_claim_interface(&usbdevfs_driver, iface, ps);
-		set_bit(intf, &ps->ifclaimed);
-		err = 0;
-	}
+	intf = usb_ifnum_to_if(dev, ifnum);
+	if (!intf)
+		err = -ENOENT;
+	else
+		err = usb_driver_claim_interface(&usbdevfs_driver, intf, ps);
 	up_write(&usb_bus_type.subsys.rwsem);
+	if (err == 0)
+		set_bit(ifnum, &ps->ifclaimed);
 	return err;
 }
 
-static int releaseintf(struct dev_state *ps, unsigned int intf)
+static int releaseintf(struct dev_state *ps, unsigned int ifnum)
 {
 	struct usb_device *dev;
-	struct usb_interface *iface;
+	struct usb_interface *intf;
 	int err;
 
-	if (intf >= 8*sizeof(ps->ifclaimed))
-		return -EINVAL;
 	err = -EINVAL;
+	if (ifnum >= 8*sizeof(ps->ifclaimed))
+		return err;
 	dev = ps->dev;
-	down(&dev->serialize);
 	/* lock against other changes to driver bindings */
 	down_write(&usb_bus_type.subsys.rwsem);
-	if (test_and_clear_bit(intf, &ps->ifclaimed)) {
-		iface = dev->actconfig->interface[intf];
-		usb_driver_release_interface(&usbdevfs_driver, iface);
+	intf = usb_ifnum_to_if(dev, ifnum);
+	if (!intf)
+		err = -ENOENT;
+	else if (test_and_clear_bit(ifnum, &ps->ifclaimed)) {
+		usb_driver_release_interface(&usbdevfs_driver, intf);
 		err = 0;
 	}
 	up_write(&usb_bus_type.subsys.rwsem);
-	up(&dev->serialize);
 	return err;
 }
 
-static int checkintf(struct dev_state *ps, unsigned int intf)
+static int checkintf(struct dev_state *ps, unsigned int ifnum)
 {
-	if (intf >= 8*sizeof(ps->ifclaimed))
+	if (ifnum >= 8*sizeof(ps->ifclaimed))
 		return -EINVAL;
-	if (test_bit(intf, &ps->ifclaimed))
+	if (test_bit(ifnum, &ps->ifclaimed))
 		return 0;
 	/* if not yet claimed, claim it for the driver */
-	printk(KERN_WARNING "usbfs: process %d (%s) did not claim interface %u before use\n",
-	       current->pid, current->comm, intf);
-	return claimintf(ps, intf);
+	dev_warn(&ps->dev->dev, "usbfs: process %d (%s) did not claim interface %u before use\n",
+	       current->pid, current->comm, ifnum);
+	return claimintf(ps, ifnum);
 }
 
 static int findintfep(struct usb_device *dev, unsigned int ep)
 {
 	unsigned int i, j, e;
-        struct usb_interface *iface;
+        struct usb_interface *intf;
 	struct usb_host_interface *alts;
 	struct usb_endpoint_descriptor *endpt;
 
@@ -432,58 +427,38 @@ static int findintfep(struct usb_device *dev, unsigned int ep)
 	if (!dev->actconfig)
 		return -ESRCH;
 	for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
-		iface = dev->actconfig->interface[i];
-		for (j = 0; j < iface->num_altsetting; j++) {
-                        alts = &iface->altsetting[j];
+		intf = dev->actconfig->interface[i];
+		for (j = 0; j < intf->num_altsetting; j++) {
+                        alts = &intf->altsetting[j];
 			for (e = 0; e < alts->desc.bNumEndpoints; e++) {
 				endpt = &alts->endpoint[e].desc;
 				if (endpt->bEndpointAddress == ep)
-					return i;
+					return alts->desc.bInterfaceNumber;
 			}
 		}
 	}
 	return -ENOENT; 
 }
 
-static int findintfif(struct usb_device *dev, unsigned int ifn)
-{
-	unsigned int i;
-
-	if (ifn & ~0xff)
-		return -EINVAL;
-	if (!dev->actconfig)
-		return -ESRCH;
-	for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
-		if (dev->actconfig->interface[i]->
-				altsetting[0].desc.bInterfaceNumber == ifn)
-			return i;
-	}
-	return -ENOENT; 
-}
-
 static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsigned int index)
 {
-	int ret;
+	int ret = 0;
 
 	if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
 		return 0;
 
+	index &= 0xff;
 	switch (requesttype & USB_RECIP_MASK) {
 	case USB_RECIP_ENDPOINT:
-		if ((ret = findintfep(ps->dev, index & 0xff)) < 0)
-			return ret;
-		if ((ret = checkintf(ps, ret)))
-			return ret;
+		if ((ret = findintfep(ps->dev, index)) >= 0)
+			ret = checkintf(ps, ret);
 		break;
 
 	case USB_RECIP_INTERFACE:
-		if ((ret = findintfif(ps->dev, index & 0xff)) < 0)
-			return ret;
-		if ((ret = checkintf(ps, ret)))
-			return ret;
+		ret = checkintf(ps, index);
 		break;
 	}
-	return 0;
+	return ret;
 }
 
 /*
@@ -496,8 +471,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
 	int ret;
 
 	/* 
-	 * no locking necessary here, as both sys_open (actually filp_open)
-	 * and the hub thread have the kernel lock
+	 * no locking necessary here, as chrdev_open has the kernel lock
 	 * (still acquire the kernel lock for safety)
 	 */
 	ret = -ENOMEM;
@@ -506,7 +480,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
 
 	lock_kernel();
 	ret = -ENOENT;
-	dev = inode->u.generic_ip;
+	dev = usb_get_dev(inode->u.generic_ip);
 	if (!dev) {
 		kfree(ps);
 		goto out;
@@ -518,7 +492,6 @@ static int usbdev_open(struct inode *inode, struct file *file)
 	INIT_LIST_HEAD(&ps->async_pending);
 	INIT_LIST_HEAD(&ps->async_completed);
 	init_waitqueue_head(&ps->wait);
-	init_rwsem(&ps->devsem);
 	ps->discsignr = 0;
 	ps->disctask = current;
 	ps->disccontext = NULL;
@@ -535,18 +508,21 @@ static int usbdev_open(struct inode *inode, struct file *file)
 static int usbdev_release(struct inode *inode, struct file *file)
 {
 	struct dev_state *ps = (struct dev_state *)file->private_data;
-	unsigned int i;
+	struct usb_device *dev = ps->dev;
+	unsigned int ifnum;
 
-	lock_kernel();
+	down(&dev->serialize);
 	list_del_init(&ps->list);
 
-	if (ps->dev) {
-		for (i = 0; ps->ifclaimed && i < 8*sizeof(ps->ifclaimed); i++)
-			if (test_bit(i, &ps->ifclaimed))
-				releaseintf(ps, i);
+	if (connected(dev)) {
+		for (ifnum = 0; ps->ifclaimed && ifnum < 8*sizeof(ps->ifclaimed); ifnum++)
+			if (test_bit(ifnum, &ps->ifclaimed))
+				releaseintf(ps, ifnum);
+		destroy_all_async(ps);
 	}
-	unlock_kernel();
-	destroy_all_async(ps);
+	up(&dev->serialize);
+	usb_put_dev(dev);
+	ps->dev = NULL;
 	kfree(ps);
         return 0;
 }
@@ -557,7 +533,7 @@ static int proc_control(struct dev_state *ps, void __user *arg)
 	struct usbdevfs_ctrltransfer ctrl;
 	unsigned int tmo;
 	unsigned char *tbuf;
-	int i, ret;
+	int i, j, ret;
 
 	if (copy_from_user(&ctrl, arg, sizeof(ctrl)))
 		return -EFAULT;
@@ -573,9 +549,18 @@ static int proc_control(struct dev_state *ps, void __user *arg)
 			free_page((unsigned long)tbuf);
 			return -EINVAL;
 		}
+		snoop(&dev->dev, "control read: bRequest=%02x bRrequestType=%02x wValue=%04x wIndex=%04x\n", 
+			ctrl.bRequest, ctrl.bRequestType, ctrl.wValue, ctrl.wIndex);
+
 		i = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ctrl.bRequest, ctrl.bRequestType,
 				       ctrl.wValue, ctrl.wIndex, tbuf, ctrl.wLength, tmo);
 		if ((i > 0) && ctrl.wLength) {
+			if (usbfs_snoop) {
+				dev_info(&dev->dev, "control read: data ");
+				for (j = 0; j < ctrl.wLength; ++j)
+					printk ("%02x ", (unsigned char)((char *)ctrl.data)[j]);
+				printk("\n");
+			}
 			if (copy_to_user(ctrl.data, tbuf, ctrl.wLength)) {
 				free_page((unsigned long)tbuf);
 				return -EFAULT;
@@ -588,15 +573,23 @@ static int proc_control(struct dev_state *ps, void __user *arg)
 				return -EFAULT;
 			}
 		}
+		snoop(&dev->dev, "control write: bRequest=%02x bRrequestType=%02x wValue=%04x wIndex=%04x\n", 
+			ctrl.bRequest, ctrl.bRequestType, ctrl.wValue, ctrl.wIndex);
+		if (usbfs_snoop) {
+			dev_info(&dev->dev, "control write: data: ");
+			for (j = 0; j < ctrl.wLength; ++j)
+				printk ("%02x ", (unsigned char)((char *)ctrl.data)[j]);
+			printk("\n");
+		}
 		i = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ctrl.bRequest, ctrl.bRequestType,
 				       ctrl.wValue, ctrl.wIndex, tbuf, ctrl.wLength, tmo);
 	}
 	free_page((unsigned long)tbuf);
 	if (i<0) {
-		printk(KERN_DEBUG "usbfs: USBDEVFS_CONTROL failed "
-			"cmd %s dev %d rqt %u rq %u len %u ret %d\n", 
-			current->comm,
-		       dev->devnum, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i);
+		dev_printk(KERN_DEBUG, &dev->dev, "usbfs: USBDEVFS_CONTROL "
+			   "failed cmd %s rqt %u rq %u len %u ret %d\n",
+			   current->comm, ctrl.bRequestType, ctrl.bRequest,
+			   ctrl.wLength, i);
 	}
 	return i;
 }
@@ -649,8 +642,8 @@ static int proc_bulk(struct dev_state *ps, void __user *arg)
 	}
 	kfree(tbuf);
 	if (i < 0) {
-		printk(KERN_WARNING "usbfs: USBDEVFS_BULK failed dev %d ep 0x%x len %u ret %d\n", 
-		       dev->devnum, bulk.ep, bulk.len, i);
+		dev_warn(&dev->dev, "usbfs: USBDEVFS_BULK failed "
+			 "ep 0x%x len %u ret %d\n", bulk.ep, bulk.len, i);
 		return i;
 	}
 	return len2;
@@ -695,20 +688,22 @@ static int proc_clearhalt(struct dev_state *ps, void __user *arg)
 static int proc_getdriver(struct dev_state *ps, void __user *arg)
 {
 	struct usbdevfs_getdriver gd;
-	struct usb_interface *interface;
+	struct usb_interface *intf;
 	int ret;
 
 	if (copy_from_user(&gd, arg, sizeof(gd)))
 		return -EFAULT;
-	if ((ret = findintfif(ps->dev, gd.interface)) < 0)
-		return ret;
-	interface = ps->dev->actconfig->interface[ret];
-	if (!interface->dev.driver)
-		return -ENODATA;
-	strncpy(gd.driver, interface->dev.driver->name, sizeof(gd.driver));
-	if (copy_to_user(arg, &gd, sizeof(gd)))
-		return -EFAULT;
-	return 0;
+	down_read(&usb_bus_type.subsys.rwsem);
+	intf = usb_ifnum_to_if(ps->dev, gd.interface);
+	if (!intf || !intf->dev.driver)
+		ret = -ENODATA;
+	else {
+		strncpy(gd.driver, intf->dev.driver->name,
+				sizeof(gd.driver));
+		ret = (copy_to_user(arg, &gd, sizeof(gd)) ? -EFAULT : 0);
+	}
+	up_read(&usb_bus_type.subsys.rwsem);
+	return ret;
 }
 
 static int proc_connectinfo(struct dev_state *ps, void __user *arg)
@@ -724,31 +719,21 @@ static int proc_connectinfo(struct dev_state *ps, void __user *arg)
 
 static int proc_resetdevice(struct dev_state *ps)
 {
-	/* FIXME when usb_reset_device() is fixed we'll need to grab
-	 * ps->dev->serialize before calling it.
-	 */
-	return usb_reset_device(ps->dev);
+	return __usb_reset_device(ps->dev);
 
 }
 
 static int proc_setintf(struct dev_state *ps, void __user *arg)
 {
 	struct usbdevfs_setinterface setintf;
-	struct usb_interface *interface;
 	int ret;
 
 	if (copy_from_user(&setintf, arg, sizeof(setintf)))
 		return -EFAULT;
-	if ((ret = findintfif(ps->dev, setintf.interface)) < 0)
+	if ((ret = checkintf(ps, setintf.interface)))
 		return ret;
-	interface = ps->dev->actconfig->interface[ret];
-	if (interface->dev.driver) {
-		if ((ret = checkintf(ps, ret)))
-			return ret;
-	}
-	if (usb_set_interface(ps->dev, setintf.interface, setintf.altsetting))
-		return -EINVAL;
-	return 0;
+	return usb_set_interface(ps->dev, setintf.interface,
+			setintf.altsetting);
 }
 
 static int proc_setconfig(struct dev_state *ps, void __user *arg)
@@ -760,7 +745,6 @@ static int proc_setconfig(struct dev_state *ps, void __user *arg)
 	if (get_user(u, (unsigned int __user *)arg))
 		return -EFAULT;
 
-	down(&ps->dev->serialize);
  	actconfig = ps->dev->actconfig;
  
  	/* Don't touch the device if any interfaces are claimed.
@@ -796,7 +780,6 @@ static int proc_setconfig(struct dev_state *ps, void __user *arg)
 		else
 			status = usb_set_configuration(ps->dev, u);
 	}
-	up(&ps->dev->serialize);
 
 	return status;
 }
@@ -809,7 +792,7 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
 	struct async *as;
 	struct usb_ctrlrequest *dr = NULL;
 	unsigned int u, totlen, isofrmlen;
-	int ret, interval = 0, intf = -1;
+	int ret, interval = 0, ifnum = -1;
 
 	if (copy_from_user(&uurb, arg, sizeof(uurb)))
 		return -EFAULT;
@@ -821,9 +804,9 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
 	if (uurb.signr != 0 && (uurb.signr < SIGRTMIN || uurb.signr > SIGRTMAX))
 		return -EINVAL;
 	if (!(uurb.type == USBDEVFS_URB_TYPE_CONTROL && (uurb.endpoint & ~USB_ENDPOINT_DIR_MASK) == 0)) {
-		if ((intf = findintfep(ps->dev, uurb.endpoint)) < 0)
-			return intf;
-		if ((ret = checkintf(ps, intf)))
+		if ((ifnum = findintfep(ps->dev, uurb.endpoint)) < 0)
+			return ifnum;
+		if ((ret = checkintf(ps, ifnum)))
 			return ret;
 	}
 	switch(uurb.type) {
@@ -873,10 +856,13 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
 		/* arbitrary limit */
 		if (uurb.number_of_packets < 1 || uurb.number_of_packets > 128)
 			return -EINVAL;
+		if (!(ep_desc = usb_epnum_to_ep_desc(ps->dev, uurb.endpoint)))
+			return -ENOENT;
+		interval = 1 << min (15, ep_desc->bInterval - 1);
 		isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb.number_of_packets;
 		if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL)))
 			return -ENOMEM;
-		if (copy_from_user(isopkt, &((struct usbdevfs_urb *)arg)->iso_frame_desc, isofrmlen)) {
+		if (copy_from_user(isopkt, &((struct usbdevfs_urb __user *)arg)->iso_frame_desc, isofrmlen)) {
 			kfree(isopkt);
 			return -EFAULT;
 		}
@@ -898,7 +884,10 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
 		uurb.number_of_packets = 0;
 		if (!(ep_desc = usb_epnum_to_ep_desc(ps->dev, uurb.endpoint)))
 			return -ENOENT;
-		interval = ep_desc->bInterval;
+		if (ps->dev->speed == USB_SPEED_HIGH)
+			interval = 1 << min (15, ep_desc->bInterval - 1);
+		else
+			interval = ep_desc->bInterval;
 		if (uurb.buffer_length > 16384)
 			return -EINVAL;
 		if (!access_ok((uurb.endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb.buffer, uurb.buffer_length))
@@ -947,7 +936,7 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
 	else
 		as->userbuffer = NULL;
 	as->signr = uurb.signr;
-	as->intf = intf;
+	as->ifnum = ifnum;
 	as->task = current;
 	if (!(uurb.endpoint & USB_DIR_IN)) {
 		if (copy_from_user(as->urb->transfer_buffer, uurb.buffer, as->urb->transfer_buffer_length)) {
@@ -957,7 +946,7 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
 	}
         async_newpending(as);
         if ((ret = usb_submit_urb(as->urb, GFP_KERNEL))) {
-		printk(KERN_DEBUG "usbfs: usb_submit_urb returned %d\n", ret);
+		dev_printk(KERN_DEBUG, &ps->dev->dev, "usbfs: usb_submit_urb returned %d\n", ret);
                 async_removepending(as);
                 free_async(as);
                 return ret;
@@ -1012,18 +1001,19 @@ static int proc_reapurb(struct dev_state *ps, void __user *arg)
         DECLARE_WAITQUEUE(wait, current);
 	struct async *as = NULL;
 	void __user *addr;
+	struct usb_device *dev = ps->dev;
 	int ret;
 
 	add_wait_queue(&ps->wait, &wait);
-	while (ps->dev) {
+	while (connected(dev)) {
 		__set_current_state(TASK_INTERRUPTIBLE);
 		if ((as = async_getcompleted(ps)))
 			break;
 		if (signal_pending(current))
 			break;
-		up_read(&ps->devsem);
+		up(&dev->serialize);
 		schedule();
-		down_read(&ps->devsem);
+		down(&dev->serialize);
 	}
 	remove_wait_queue(&ps->wait, &wait);
 	set_current_state(TASK_RUNNING);
@@ -1033,7 +1023,7 @@ static int proc_reapurb(struct dev_state *ps, void __user *arg)
 		free_async(as);
 		if (ret)
 			return ret;
-		if (put_user(addr, (void **)arg))
+		if (put_user(addr, (void __user * __user *)arg))
 			return -EFAULT;
 		return 0;
 	}
@@ -1055,7 +1045,7 @@ static int proc_reapurbnonblock(struct dev_state *ps, void __user *arg)
 	free_async(as);
 	if (ret)
 		return ret;
-	if (put_user(addr, (void **)arg))
+	if (put_user(addr, (void __user * __user *)arg))
 		return -EFAULT;
 	return 0;
 }
@@ -1075,28 +1065,23 @@ static int proc_disconnectsignal(struct dev_state *ps, void __user *arg)
 
 static int proc_claiminterface(struct dev_state *ps, void __user *arg)
 {
-	unsigned int intf;
-	int ret;
+	unsigned int ifnum;
 
-	if (get_user(intf, (unsigned int __user *)arg))
+	if (get_user(ifnum, (unsigned int __user *)arg))
 		return -EFAULT;
-	if ((ret = findintfif(ps->dev, intf)) < 0)
-		return ret;
-	return claimintf(ps, ret);
+	return claimintf(ps, ifnum);
 }
 
 static int proc_releaseinterface(struct dev_state *ps, void __user *arg)
 {
-	unsigned int intf;
+	unsigned int ifnum;
 	int ret;
 
-	if (get_user(intf, (unsigned int __user *)arg))
+	if (get_user(ifnum, (unsigned int __user *)arg))
 		return -EFAULT;
-	if ((ret = findintfif(ps->dev, intf)) < 0)
-		return ret;
-	if ((ret = releaseintf(ps, intf)) < 0)
+	if ((ret = releaseintf(ps, ifnum)) < 0)
 		return ret;
-	destroy_async_on_interface (ps, intf);
+	destroy_async_on_interface (ps, ifnum);
 	return 0;
 }
 
@@ -1106,7 +1091,7 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
 	int			size;
 	void			*buf = 0;
 	int			retval = 0;
-	struct usb_interface    *ifp = 0;
+	struct usb_interface    *intf = 0;
 	struct usb_driver       *driver = 0;
 
 	/* get input parameters and alloc buffer */
@@ -1125,26 +1110,25 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
 		}
 	}
 
-	if (!ps->dev) {
+	if (!connected(ps->dev)) {
 		if (buf)
 			kfree(buf);
 		return -ENODEV;
 	}
 
-	down(&ps->dev->serialize);
 	if (ps->dev->state != USB_STATE_CONFIGURED)
 		retval = -ENODEV;
-	else if (!(ifp = usb_ifnum_to_if (ps->dev, ctrl.ifno)))
+	else if (!(intf = usb_ifnum_to_if (ps->dev, ctrl.ifno)))
                retval = -EINVAL;
 	else switch (ctrl.ioctl_code) {
 
 	/* disconnect kernel driver from interface */
 	case USBDEVFS_DISCONNECT:
 		down_write(&usb_bus_type.subsys.rwsem);
-		if (ifp->dev.driver) {
-			driver = to_usb_driver(ifp->dev.driver);
-			dev_dbg (&ifp->dev, "disconnect by usbfs\n");
-			usb_driver_release_interface(driver, ifp);
+		if (intf->dev.driver) {
+			driver = to_usb_driver(intf->dev.driver);
+			dev_dbg (&intf->dev, "disconnect by usbfs\n");
+			usb_driver_release_interface(driver, intf);
 		} else
 			retval = -ENODATA;
 		up_write(&usb_bus_type.subsys.rwsem);
@@ -1152,24 +1136,23 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
 
 	/* let kernel drivers try to (re)bind to the interface */
 	case USBDEVFS_CONNECT:
-		bus_rescan_devices(ifp->dev.bus);
+		bus_rescan_devices(intf->dev.bus);
 		break;
 
 	/* talk directly to the interface's driver */
 	default:
 		down_read(&usb_bus_type.subsys.rwsem);
-		if (ifp->dev.driver)
-			driver = to_usb_driver(ifp->dev.driver);
+		if (intf->dev.driver)
+			driver = to_usb_driver(intf->dev.driver);
 		if (driver == 0 || driver->ioctl == 0) {
 			retval = -ENOTTY;
 		} else {
-			retval = driver->ioctl (ifp, ctrl.ioctl_code, buf);
+			retval = driver->ioctl (intf, ctrl.ioctl_code, buf);
 			if (retval == -ENOIOCTLCMD)
 				retval = -ENOTTY;
 		}
 		up_read(&usb_bus_type.subsys.rwsem);
 	}
-	up(&ps->dev->serialize);
 
 	/* cleanup and return */
 	if (retval >= 0
@@ -1190,95 +1173,115 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
 static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct dev_state *ps = (struct dev_state *)file->private_data;
+	struct usb_device *dev = ps->dev;
+	void __user *p = (void __user *)arg;
 	int ret = -ENOTTY;
 
 	if (!(file->f_mode & FMODE_WRITE))
 		return -EPERM;
-	down_read(&ps->devsem);
-	if (!ps->dev) {
-		up_read(&ps->devsem);
+	down(&dev->serialize);
+	if (!connected(dev)) {
+		up(&dev->serialize);
 		return -ENODEV;
 	}
+
 	switch (cmd) {
 	case USBDEVFS_CONTROL:
-		ret = proc_control(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: CONTROL\n", __FUNCTION__);
+		ret = proc_control(ps, p);
 		if (ret >= 0)
 			inode->i_mtime = CURRENT_TIME;
 		break;
 
 	case USBDEVFS_BULK:
-		ret = proc_bulk(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: BULK\n", __FUNCTION__);
+		ret = proc_bulk(ps, p);
 		if (ret >= 0)
 			inode->i_mtime = CURRENT_TIME;
 		break;
 
 	case USBDEVFS_RESETEP:
-		ret = proc_resetep(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: RESETEP\n", __FUNCTION__);
+		ret = proc_resetep(ps, p);
 		if (ret >= 0)
 			inode->i_mtime = CURRENT_TIME;
 		break;
 
 	case USBDEVFS_RESET:
+		snoop(&dev->dev, "%s: RESET\n", __FUNCTION__);
 		ret = proc_resetdevice(ps);
 		break;
 
 	case USBDEVFS_CLEAR_HALT:
-		ret = proc_clearhalt(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: CLEAR_HALT\n", __FUNCTION__);
+		ret = proc_clearhalt(ps, p);
 		if (ret >= 0)
 			inode->i_mtime = CURRENT_TIME;
 		break;
 
 	case USBDEVFS_GETDRIVER:
-		ret = proc_getdriver(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: GETDRIVER\n", __FUNCTION__);
+		ret = proc_getdriver(ps, p);
 		break;
 
 	case USBDEVFS_CONNECTINFO:
-		ret = proc_connectinfo(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: CONNECTINFO\n", __FUNCTION__);
+		ret = proc_connectinfo(ps, p);
 		break;
 
 	case USBDEVFS_SETINTERFACE:
-		ret = proc_setintf(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: SETINTERFACE\n", __FUNCTION__);
+		ret = proc_setintf(ps, p);
 		break;
 
 	case USBDEVFS_SETCONFIGURATION:
-		ret = proc_setconfig(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: SETCONFIGURATION\n", __FUNCTION__);
+		ret = proc_setconfig(ps, p);
 		break;
 
 	case USBDEVFS_SUBMITURB:
-		ret = proc_submiturb(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: SUBMITURB\n", __FUNCTION__);
+		ret = proc_submiturb(ps, p);
 		if (ret >= 0)
 			inode->i_mtime = CURRENT_TIME;
 		break;
 
 	case USBDEVFS_DISCARDURB:
-		ret = proc_unlinkurb(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: DISCARDURB\n", __FUNCTION__);
+		ret = proc_unlinkurb(ps, p);
 		break;
 
 	case USBDEVFS_REAPURB:
-		ret = proc_reapurb(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: REAPURB\n", __FUNCTION__);
+		ret = proc_reapurb(ps, p);
 		break;
 
 	case USBDEVFS_REAPURBNDELAY:
-		ret = proc_reapurbnonblock(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: REAPURBDELAY\n", __FUNCTION__);
+		ret = proc_reapurbnonblock(ps, p);
 		break;
 
 	case USBDEVFS_DISCSIGNAL:
-		ret = proc_disconnectsignal(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: DISCSIGNAL\n", __FUNCTION__);
+		ret = proc_disconnectsignal(ps, p);
 		break;
 
 	case USBDEVFS_CLAIMINTERFACE:
-		ret = proc_claiminterface(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: CLAIMINTERFACE\n", __FUNCTION__);
+		ret = proc_claiminterface(ps, p);
 		break;
 
 	case USBDEVFS_RELEASEINTERFACE:
-		ret = proc_releaseinterface(ps, (void __user *)arg);
+		snoop(&dev->dev, "%s: RELEASEINTERFACE\n", __FUNCTION__);
+		ret = proc_releaseinterface(ps, p);
 		break;
 
 	case USBDEVFS_IOCTL:
-		ret = proc_ioctl(ps, (void __user *) arg);
+		snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__);
+		ret = proc_ioctl(ps, p);
 		break;
 	}
-	up_read(&ps->devsem);
+	up(&dev->serialize);
 	if (ret >= 0)
 		inode->i_atime = CURRENT_TIME;
 	return ret;
@@ -1293,7 +1296,7 @@ static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wai
 	poll_wait(file, &ps->wait, wait);
 	if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed))
 		mask |= POLLOUT | POLLWRNORM;
-	if (!ps->dev)
+	if (!connected(ps->dev))
 		mask |= POLLERR | POLLHUP;
 	return mask;
 }
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 5cba0648e..da209adc3 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -279,41 +279,54 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
 {
 	struct usb_hcd		*hcd;
 	int			retval = 0;
+	int			has_pci_pm;
 
 	hcd = pci_get_drvdata(dev);
-	dev_dbg (hcd->self.controller, "suspend D%d --> D%d\n",
-			dev->current_state, state);
 
-	if (pci_find_capability(dev, PCI_CAP_ID_PM)) {
-		dev_dbg(hcd->self.controller, "No PM capability\n");
-		return 0;
-	}
+	/* even when the PCI layer rejects some of the PCI calls
+	 * below, HCs can try global suspend and reduce DMA traffic.
+	 * PM-sensitive HCDs may already have done this.
+	 */
+	has_pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);
+	if (has_pci_pm)
+		dev_dbg(hcd->self.controller, "suspend D%d --> D%d\n",
+			dev->current_state, state);
 
 	switch (hcd->state) {
 	case USB_STATE_HALT:
 		dev_dbg (hcd->self.controller, "halted; hcd not suspended\n");
 		break;
-	case USB_STATE_SUSPENDED:
+	case HCD_STATE_SUSPENDED:
 		dev_dbg (hcd->self.controller, "hcd already suspended\n");
 		break;
 	default:
-		/* remote wakeup needs hub->suspend() cooperation */
-		// pci_enable_wake (dev, 3, 1);
-
-		pci_save_state (dev, hcd->pci_state);
-
-		/* driver may want to disable DMA etc */
-		hcd->state = USB_STATE_QUIESCING;
 		retval = hcd->driver->suspend (hcd, state);
 		if (retval)
 			dev_dbg (hcd->self.controller, 
 					"suspend fail, retval %d\n",
 					retval);
-		else
-			hcd->state = USB_STATE_SUSPENDED;
+		else {
+			hcd->state = HCD_STATE_SUSPENDED;
+			pci_save_state (dev, hcd->pci_state);
+#ifdef	CONFIG_USB_SUSPEND
+			pci_enable_wake (dev, state, hcd->remote_wakeup);
+			pci_enable_wake (dev, 4, hcd->remote_wakeup);
+#endif
+			/* no DMA or IRQs except in D0 */
+			pci_disable_device (dev);
+			free_irq (hcd->irq, hcd);
+			
+			if (has_pci_pm)
+				retval = pci_set_power_state (dev, state);
+			dev->dev.power.power_state = state;
+			if (retval < 0) {
+				dev_dbg (&dev->dev,
+						"PCI suspend fail, %d\n",
+						retval);
+				(void) usb_hcd_pci_resume (dev);
+			}
+		}
 	}
-
- 	pci_set_power_state (dev, state);
 	return retval;
 }
 EXPORT_SYMBOL (usb_hcd_pci_suspend);
@@ -328,23 +341,37 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
 {
 	struct usb_hcd		*hcd;
 	int			retval;
+	int			has_pci_pm;
 
 	hcd = pci_get_drvdata(dev);
-	dev_dbg (hcd->self.controller, "resume from state D%d\n",
-			dev->current_state);
+	has_pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);
+	if (has_pci_pm)
+		dev_dbg(hcd->self.controller, "resume from state D%d\n",
+				dev->current_state);
 
-	if (hcd->state != USB_STATE_SUSPENDED) {
+	if (hcd->state != HCD_STATE_SUSPENDED) {
 		dev_dbg (hcd->self.controller, 
 				"can't resume, not suspended!\n");
 		return -EL3HLT;
 	}
 	hcd->state = USB_STATE_RESUMING;
 
-	pci_set_power_state (dev, 0);
+	if (has_pci_pm)
+		pci_set_power_state (dev, 0);
+	dev->dev.power.power_state = 0;
+	retval = request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ,
+				hcd->description, hcd);
+	if (retval < 0) {
+		dev_err (hcd->self.controller,
+			"can't restore IRQ after resume!\n");
+		return retval;
+	}
+	pci_set_master (dev);
 	pci_restore_state (dev, hcd->pci_state);
-
-	/* remote wakeup needs hub->suspend() cooperation */
-	// pci_enable_wake (dev, 3, 0);
+#ifdef	CONFIG_USB_SUSPEND
+	pci_enable_wake (dev, dev->current_state, 0);
+	pci_enable_wake (dev, 4, 0);
+#endif
 
 	retval = hcd->driver->resume (hcd);
 	if (!HCD_IS_RUNNING (hcd->state)) {
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index e40346c7c..04a8b324d 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -171,10 +171,10 @@ static const u8 fs_rh_config_descriptor [] = {
 	0x01,       /*  __u8  bNumInterfaces; (1) */
 	0x01,       /*  __u8  bConfigurationValue; */
 	0x00,       /*  __u8  iConfiguration; */
-	0x40,       /*  __u8  bmAttributes; 
-				 Bit 7: Bus-powered,
+	0xc0,       /*  __u8  bmAttributes; 
+				 Bit 7: must be set,
 				     6: Self-powered,
-				     5 Remote-wakwup,
+				     5: Remote wakeup,
 				     4..0: resvd */
 	0x00,       /*  __u8  MaxPower; */
       
@@ -218,10 +218,10 @@ static const u8 hs_rh_config_descriptor [] = {
 	0x01,       /*  __u8  bNumInterfaces; (1) */
 	0x01,       /*  __u8  bConfigurationValue; */
 	0x00,       /*  __u8  iConfiguration; */
-	0x40,       /*  __u8  bmAttributes; 
-				 Bit 7: Bus-powered,
+	0xc0,       /*  __u8  bmAttributes; 
+				 Bit 7: must be set,
 				     6: Self-powered,
-				     5 Remote-wakwup,
+				     5: Remote wakeup,
 				     4..0: resvd */
 	0x00,       /*  __u8  MaxPower; */
       
@@ -324,13 +324,15 @@ static int rh_string (
 /* Root hub control transfers execute synchronously */
 static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 {
-	struct usb_ctrlrequest *cmd = (struct usb_ctrlrequest *) urb->setup_packet;
+	struct usb_ctrlrequest *cmd;
  	u16		typeReq, wValue, wIndex, wLength;
 	const u8	*bufp = 0;
 	u8		*ubuf = urb->transfer_buffer;
 	int		len = 0;
+	int		patch_wakeup = 0;
 	unsigned long	flags;
 
+	cmd = (struct usb_ctrlrequest *) urb->setup_packet;
 	typeReq  = (cmd->bRequestType << 8) | cmd->bRequest;
 	wValue   = le16_to_cpu (cmd->wValue);
 	wIndex   = le16_to_cpu (cmd->wIndex);
@@ -347,13 +349,21 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 	/* DEVICE REQUESTS */
 
 	case DeviceRequest | USB_REQ_GET_STATUS:
-		// DEVICE_REMOTE_WAKEUP
-		ubuf [0] = 1; // selfpowered
+		ubuf [0] = (hcd->remote_wakeup << USB_DEVICE_REMOTE_WAKEUP)
+				| (1 << USB_DEVICE_SELF_POWERED);
 		ubuf [1] = 0;
-			/* FALLTHROUGH */
+		break;
 	case DeviceOutRequest | USB_REQ_CLEAR_FEATURE:
+		if (wValue == USB_DEVICE_REMOTE_WAKEUP)
+			hcd->remote_wakeup = 0;
+		else
+			goto error;
+		break;
 	case DeviceOutRequest | USB_REQ_SET_FEATURE:
-		dev_dbg (hcd->self.controller, "no device features yet yet\n");
+		if (hcd->can_wakeup && wValue == USB_DEVICE_REMOTE_WAKEUP)
+			hcd->remote_wakeup = 1;
+		else
+			goto error;
 		break;
 	case DeviceRequest | USB_REQ_GET_CONFIGURATION:
 		ubuf [0] = 1;
@@ -379,6 +389,8 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 				bufp = fs_rh_config_descriptor;
 				len = sizeof fs_rh_config_descriptor;
 			}
+			if (hcd->can_wakeup)
+				patch_wakeup = 1;
 			break;
 		case USB_DT_STRING << 8:
 			urb->actual_length = rh_string (
@@ -444,6 +456,11 @@ error:
 		urb->actual_length = len;
 		// always USB_DIR_IN, toward host
 		memcpy (ubuf, bufp, len);
+
+		/* report whether RH hardware supports remote wakeup */
+		if (patch_wakeup)
+			((struct usb_config_descriptor *)ubuf)->bmAttributes
+				|= USB_CONFIG_ATT_WAKEUP;
 	}
 
 	/* any errors get returned through the urb completion */
@@ -762,10 +779,22 @@ int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev
 	set_bit (devnum, usb_dev->bus->devmap.devicemap);
 	usb_dev->state = USB_STATE_ADDRESS;
 
+	usb_dev->epmaxpacketin[0] = usb_dev->epmaxpacketout[0] = 64;
+	retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE);
+	if (retval != sizeof usb_dev->descriptor) {
+		dev_dbg (parent_dev, "can't read %s device descriptor %d\n",
+				usb_dev->dev.bus_id, retval);
+		return (retval < 0) ? retval : -EMSGSIZE;
+	}
+
+	(void) usb_get_dev (usb_dev);
+	down (&usb_dev->serialize);
 	retval = usb_new_device (usb_dev);
 	if (retval)
 		dev_err (parent_dev, "can't register root hub for %s, %d\n",
 				usb_dev->dev.bus_id, retval);
+	up (&usb_dev->serialize);
+	usb_put_dev (usb_dev);
 	return retval;
 }
 EXPORT_SYMBOL (usb_register_root_hub);
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 57143644b..f56fa8026 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -74,6 +74,8 @@ struct usb_hcd {	/* usb_bus.hcpriv points to this */
 	 */
 	struct hc_driver	*driver;	/* hw-specific hooks */
 	unsigned		saw_irq : 1;
+	unsigned		can_wakeup:1;	/* hw supports wakeup? */
+	unsigned		remote_wakeup:1;/* sw should use wakeup? */
 	int			irq;		/* irq allocated */
 	void			*regs;		/* device memory/io */
 
@@ -94,7 +96,7 @@ struct usb_hcd {	/* usb_bus.hcpriv points to this */
 #	define	USB_STATE_RUNNING	(__ACTIVE)
 #	define	USB_STATE_QUIESCING	(__SUSPEND|__TRANSIENT|__ACTIVE)
 #	define	USB_STATE_RESUMING	(__SUSPEND|__TRANSIENT)
-#	define	USB_STATE_SUSPENDED	(__SUSPEND)
+#	define	HCD_STATE_SUSPENDED	(__SUSPEND)
 
 #define	HCD_IS_RUNNING(state) ((state) & __ACTIVE)
 #define	HCD_IS_SUSPENDED(state) ((state) & __SUSPEND)
@@ -241,13 +243,13 @@ extern void usb_hc_died (struct usb_hcd *hcd);
 extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
 					struct usb_bus *, unsigned port);
 extern int usb_new_device(struct usb_device *dev);
-extern void usb_choose_address(struct usb_device *dev);
 extern void usb_disconnect(struct usb_device **);
+extern void usb_choose_address(struct usb_device *dev);
+extern void usb_release_address(struct usb_device *dev);
 
 /* exported to hub driver ONLY to support usb_reset_device () */
 extern int usb_get_configuration(struct usb_device *dev);
 extern void usb_destroy_configuration(struct usb_device *dev);
-extern int usb_set_address(struct usb_device *dev);
 
 /* use these only before the device's address has been set */
 #define usb_snddefctrl(dev)		((PIPE_CONTROL << 30))
@@ -327,7 +329,7 @@ extern int usb_check_bandwidth (struct usb_device *dev, struct urb *urb);
 #define HS_USECS(bytes) NS_TO_US ( ((55 * 8 * 2083)/1000) \
 	+ ((2083UL * (3167 + BitTime (bytes)))/1000) \
 	+ USB2_HOST_DELAY)
-#define HS_USECS_ISO(bytes) NS_TO_US ( ((long)(38 * 8 * 2.083)) \
+#define HS_USECS_ISO(bytes) NS_TO_US ( ((38 * 8 * 2083)/1000) \
 	+ ((2083UL * (3167 + BitTime (bytes)))/1000) \
 	+ USB2_HOST_DELAY)
 
@@ -344,9 +346,16 @@ extern void usb_deregister_bus (struct usb_bus *);
 extern int usb_register_root_hub (struct usb_device *usb_dev,
 		struct device *parent_dev);
 
-/* for portability to 2.4, hcds should call this */
 static inline int hcd_register_root (struct usb_hcd *hcd)
 {
+	/* hcd->driver->start() reported can_wakeup, probably with
+	 * assistance from board's boot firmware.
+	 * NOTE:  normal devices won't enable wakeup by default.
+	 */
+	if (hcd->can_wakeup)
+		dev_dbg (hcd->self.controller, "supports USB remote wakeup\n");
+	hcd->remote_wakeup = hcd->can_wakeup;
+
 	return usb_register_root_hub (
 		hcd_to_bus (hcd)->root_hub, hcd->self.controller);
 }
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 9aec0030b..cdade3278 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -38,7 +38,6 @@
 
 /* Wakes up khubd */
 static spinlock_t hub_event_lock = SPIN_LOCK_UNLOCKED;
-static DECLARE_MUTEX(usb_address0_sem);
 
 static LIST_HEAD(hub_event_list);	/* List of hubs needing servicing */
 static LIST_HEAD(hub_list);		/* List of all hubs (for cleanup) */
@@ -66,15 +65,15 @@ static inline char *portspeed (int portstatus)
 #endif
 
 /* for dev_info, dev_dbg, etc */
-static inline struct device *hubdev (struct usb_device *dev)
+static inline struct device *hubdev (struct usb_device *hdev)
 {
-	return &dev->actconfig->interface[0]->dev;
+	return &hdev->actconfig->interface[0]->dev;
 }
 
 /* USB 2.0 spec Section 11.24.4.5 */
-static int get_hub_descriptor(struct usb_device *dev, void *data, int size)
+static int get_hub_descriptor(struct usb_device *hdev, void *data, int size)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+	return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
 		USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,
 		USB_DT_HUB << 8, 0, data, size, HZ * USB_CTRL_GET_TIMEOUT);
 }
@@ -82,27 +81,27 @@ static int get_hub_descriptor(struct usb_device *dev, void *data, int size)
 /*
  * USB 2.0 spec Section 11.24.2.1
  */
-static int clear_hub_feature(struct usb_device *dev, int feature)
+static int clear_hub_feature(struct usb_device *hdev, int feature)
 {
-	return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+	return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
 		USB_REQ_CLEAR_FEATURE, USB_RT_HUB, feature, 0, NULL, 0, HZ);
 }
 
 /*
  * USB 2.0 spec Section 11.24.2.2
  */
-static int clear_port_feature(struct usb_device *dev, int port, int feature)
+static int clear_port_feature(struct usb_device *hdev, int port, int feature)
 {
-	return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+	return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
 		USB_REQ_CLEAR_FEATURE, USB_RT_PORT, feature, port, NULL, 0, HZ);
 }
 
 /*
  * USB 2.0 spec Section 11.24.2.13
  */
-static int set_port_feature(struct usb_device *dev, int port, int feature)
+static int set_port_feature(struct usb_device *hdev, int port, int feature)
 {
-	return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+	return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
 		USB_REQ_SET_FEATURE, USB_RT_PORT, feature, port, NULL, 0, HZ);
 }
 
@@ -111,16 +110,15 @@ static int set_port_feature(struct usb_device *dev, int port, int feature)
  * for info about using port indicators
  */
 static void set_port_led(
-	struct usb_device *dev,
-	struct usb_hub *hub,
+	struct usb_device *hdev,
 	int port,
 	int selector
 )
 {
-	int status = set_port_feature(dev, (selector << 8) | port,
+	int status = set_port_feature(hdev, (selector << 8) | port,
 			USB_PORT_FEAT_INDICATOR);
 	if (status < 0)
-		dev_dbg (&hub->intf->dev,
+		dev_dbg (hubdev (hdev),
 			"port %d indicator %s status %d\n",
 			port,
 			({ char *s; switch (selector) {
@@ -138,12 +136,12 @@ static void set_port_led(
 static void led_work (void *__hub)
 {
 	struct usb_hub		*hub = __hub;
-	struct usb_device	*dev = interface_to_usbdev (hub->intf);
+	struct usb_device	*hdev = interface_to_usbdev (hub->intf);
 	unsigned		i;
 	unsigned		changed = 0;
 	int			cursor = -1;
 
-	if (dev->state != USB_STATE_CONFIGURED)
+	if (hdev->state != USB_STATE_CONFIGURED)
 		return;
 
 	for (i = 0; i < hub->descriptor->bNbrPorts; i++) {
@@ -190,13 +188,13 @@ static void led_work (void *__hub)
 		}
 		if (selector != HUB_LED_AUTO)
 			changed = 1;
-		set_port_led(dev, hub, i + 1, selector);
+		set_port_led(hdev, i + 1, selector);
 		hub->indicator[i] = mode;
 	}
 	if (!changed && blinkenlights) {
 		cursor++;
 		cursor %= hub->descriptor->bNbrPorts;
-		set_port_led(dev, hub, cursor + 1, HUB_LED_GREEN);
+		set_port_led(hdev, cursor + 1, HUB_LED_GREEN);
 		hub->indicator[cursor] = INDICATOR_CYCLE;
 		changed++;
 	}
@@ -207,10 +205,10 @@ static void led_work (void *__hub)
 /*
  * USB 2.0 spec Section 11.24.2.6
  */
-static int get_hub_status(struct usb_device *dev,
+static int get_hub_status(struct usb_device *hdev,
 		struct usb_hub_status *data)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+	return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
 		USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0,
 		data, sizeof(*data), HZ * USB_CTRL_GET_TIMEOUT);
 }
@@ -218,10 +216,10 @@ static int get_hub_status(struct usb_device *dev,
 /*
  * USB 2.0 spec Section 11.24.2.7
  */
-static int get_port_status(struct usb_device *dev, int port,
+static int get_port_status(struct usb_device *hdev, int port,
 		struct usb_port_status *data)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+	return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
 		USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port,
 		data, sizeof(*data), HZ * USB_CTRL_GET_TIMEOUT);
 }
@@ -279,9 +277,9 @@ done:
 
 /* USB 2.0 spec Section 11.24.2.3 */
 static inline int
-hub_clear_tt_buffer (struct usb_device *hub, u16 devinfo, u16 tt)
+hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
 {
-	return usb_control_msg (hub, usb_rcvctrlpipe (hub, 0),
+	return usb_control_msg (hdev, usb_rcvctrlpipe (hdev, 0),
 		HUB_CLEAR_TT_BUFFER, USB_RT_PORT,
 		devinfo, tt, 0, 0, HZ);
 }
@@ -301,7 +299,7 @@ static void hub_tt_kevent (void *arg)
 	while (!list_empty (&hub->tt.clear_list)) {
 		struct list_head	*temp;
 		struct usb_tt_clear	*clear;
-		struct usb_device	*dev;
+		struct usb_device	*hdev;
 		int			status;
 
 		temp = hub->tt.clear_list.next;
@@ -310,12 +308,13 @@ static void hub_tt_kevent (void *arg)
 
 		/* drop lock so HCD can concurrently report other TT errors */
 		spin_unlock_irqrestore (&hub->tt.lock, flags);
-		dev = interface_to_usbdev (hub->intf);
-		status = hub_clear_tt_buffer (dev, clear->devinfo, clear->tt);
+		hdev = interface_to_usbdev (hub->intf);
+		status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt);
 		spin_lock_irqsave (&hub->tt.lock, flags);
 
 		if (status)
-			dev_err (&dev->dev, "clear tt %d (%04x) error %d\n",
+			dev_err (&hdev->dev,
+				"clear tt %d (%04x) error %d\n",
 				clear->tt, clear->devinfo, status);
 		kfree (clear);
 	}
@@ -335,9 +334,9 @@ static void hub_tt_kevent (void *arg)
  * It may not be possible for that hub to handle additional full (or low)
  * speed transactions until that state is fully cleared out.
  */
-void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe)
+void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
 {
-	struct usb_tt		*tt = dev->tt;
+	struct usb_tt		*tt = udev->tt;
 	unsigned long		flags;
 	struct usb_tt_clear	*clear;
 
@@ -346,15 +345,15 @@ void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe)
 	 * there can be many TTs per hub).  even if they're uncommon.
 	 */
 	if ((clear = kmalloc (sizeof *clear, SLAB_ATOMIC)) == 0) {
-		dev_err (&dev->dev, "can't save CLEAR_TT_BUFFER state\n");
+		dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
 		/* FIXME recover somehow ... RESET_TT? */
 		return;
 	}
 
 	/* info that CLEAR_TT_BUFFER needs */
-	clear->tt = tt->multi ? dev->ttport : 1;
+	clear->tt = tt->multi ? udev->ttport : 1;
 	clear->devinfo = usb_pipeendpoint (pipe);
-	clear->devinfo |= dev->devnum << 4;
+	clear->devinfo |= udev->devnum << 4;
 	clear->devinfo |= usb_pipecontrol (pipe)
 			? (USB_ENDPOINT_XFER_CONTROL << 11)
 			: (USB_ENDPOINT_XFER_BULK << 11);
@@ -370,29 +369,30 @@ void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe)
 
 static void hub_power_on(struct usb_hub *hub)
 {
-	struct usb_device *dev;
+	struct usb_device *hdev;
 	int i;
 
-	/* Enable power to the ports */
-	dev_dbg(hubdev(interface_to_usbdev(hub->intf)),
-		"enabling power on all ports\n");
-	dev = interface_to_usbdev(hub->intf);
-	for (i = 0; i < hub->descriptor->bNbrPorts; i++)
-		set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
+	/* if hub supports power switching, enable power on each port */
+	if ((hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) < 2) {
+		dev_dbg(&hub->intf->dev, "enabling power on all ports\n");
+		hdev = interface_to_usbdev(hub->intf);
+		for (i = 0; i < hub->descriptor->bNbrPorts; i++)
+			set_port_feature(hdev, i + 1, USB_PORT_FEAT_POWER);
+	}
 
 	/* Wait for power to be enabled */
-	wait_ms(hub->descriptor->bPwrOn2PwrGood * 2);
+	msleep(hub->descriptor->bPwrOn2PwrGood * 2);
 }
 
 static int hub_hub_status(struct usb_hub *hub,
 		u16 *status, u16 *change)
 {
-	struct usb_device *dev = interface_to_usbdev (hub->intf);
+	struct usb_device *hdev = interface_to_usbdev (hub->intf);
 	int ret;
 
-	ret = get_hub_status(dev, &hub->status->hub);
+	ret = get_hub_status(hdev, &hub->status->hub);
 	if (ret < 0)
-		dev_err (hubdev (dev),
+		dev_err (&hub->intf->dev,
 			"%s failed (err = %d)\n", __FUNCTION__, ret);
 	else {
 		*status = le16_to_cpu(hub->status->hub.wHubStatus);
@@ -405,14 +405,14 @@ static int hub_hub_status(struct usb_hub *hub,
 static int hub_configure(struct usb_hub *hub,
 	struct usb_endpoint_descriptor *endpoint)
 {
-	struct usb_device *dev = interface_to_usbdev (hub->intf);
-	struct device *hub_dev;
+	struct usb_device *hdev = interface_to_usbdev (hub->intf);
+	struct device *hub_dev = &hub->intf->dev;
 	u16 hubstatus, hubchange;
 	unsigned int pipe;
 	int maxp, ret;
 	char *message;
 
-	hub->buffer = usb_buffer_alloc(dev, sizeof(*hub->buffer), GFP_KERNEL,
+	hub->buffer = usb_buffer_alloc(hdev, sizeof(*hub->buffer), GFP_KERNEL,
 			&hub->buffer_dma);
 	if (!hub->buffer) {
 		message = "can't allocate hub irq buffer";
@@ -438,7 +438,7 @@ static int hub_configure(struct usb_hub *hub,
 	 * hub->descriptor can handle USB_MAXCHILDREN ports,
 	 * but the hub can/will return fewer bytes here.
 	 */
-	ret = get_hub_descriptor(dev, hub->descriptor,
+	ret = get_hub_descriptor(hdev, hub->descriptor,
 			sizeof(*hub->descriptor));
 	if (ret < 0) {
 		message = "can't read hub descriptor";
@@ -449,10 +449,9 @@ static int hub_configure(struct usb_hub *hub,
 		goto fail;
 	}
 
-	hub_dev = hubdev(dev);
-	dev->maxchild = hub->descriptor->bNbrPorts;
-	dev_info (hub_dev, "%d port%s detected\n", dev->maxchild,
-		(dev->maxchild == 1) ? "" : "s");
+	hdev->maxchild = hub->descriptor->bNbrPorts;
+	dev_info (hub_dev, "%d port%s detected\n", hdev->maxchild,
+		(hdev->maxchild == 1) ? "" : "s");
 
 	le16_to_cpus(&hub->descriptor->wHubCharacteristics);
 
@@ -460,11 +459,11 @@ static int hub_configure(struct usb_hub *hub,
 		int	i;
 		char	portstr [USB_MAXCHILDREN + 1];
 
-		for (i = 0; i < dev->maxchild; i++)
+		for (i = 0; i < hdev->maxchild; i++)
 			portstr[i] = hub->descriptor->DeviceRemovable
 				    [((i + 1) / 8)] & (1 << ((i + 1) % 8))
 				? 'F' : 'R';
-		portstr[dev->maxchild] = 0;
+		portstr[hdev->maxchild] = 0;
 		dev_dbg(hub_dev, "compound device; port removable status: %s\n", portstr);
 	} else
 		dev_dbg(hub_dev, "standalone hub\n");
@@ -498,32 +497,32 @@ static int hub_configure(struct usb_hub *hub,
 	spin_lock_init (&hub->tt.lock);
 	INIT_LIST_HEAD (&hub->tt.clear_list);
 	INIT_WORK (&hub->tt.kevent, hub_tt_kevent, hub);
-	switch (dev->descriptor.bDeviceProtocol) {
+	switch (hdev->descriptor.bDeviceProtocol) {
 		case 0:
 			break;
 		case 1:
 			dev_dbg(hub_dev, "Single TT\n");
-			hub->tt.hub = dev;
+			hub->tt.hub = hdev;
 			break;
 		case 2:
-			ret = usb_set_interface(dev, 0, 1);
+			ret = usb_set_interface(hdev, 0, 1);
 			if (ret == 0) {
 				dev_dbg(hub_dev, "TT per port\n");
 				hub->tt.multi = 1;
 			} else
 				dev_err(hub_dev, "Using single TT (err %d)\n",
 					ret);
-			hub->tt.hub = dev;
+			hub->tt.hub = hdev;
 			break;
 		default:
 			dev_dbg(hub_dev, "Unrecognized hub protocol %d\n",
-				dev->descriptor.bDeviceProtocol);
+				hdev->descriptor.bDeviceProtocol);
 			break;
 	}
 
 	switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_TTTT) {
 		case 0x00:
-			if (dev->descriptor.bDeviceProtocol != 0)
+			if (hdev->descriptor.bDeviceProtocol != 0)
 				dev_dbg(hub_dev, "TT requires at most 8 FS bit times\n");
 			break;
 		case 0x20:
@@ -545,8 +544,25 @@ static int hub_configure(struct usb_hub *hub,
 
 	dev_dbg(hub_dev, "power on to power good time: %dms\n",
 		hub->descriptor->bPwrOn2PwrGood * 2);
-	dev_dbg(hub_dev, "hub controller current requirement: %dmA\n",
-		hub->descriptor->bHubContrCurrent);
+
+	/* power budgeting mostly matters with bus-powered hubs,
+	 * and battery-powered root hubs (may provide just 8 mA).
+	 */
+	ret = usb_get_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);
+	if (ret < 0) {
+		message = "can't get hub status";
+		goto fail;
+	}
+	cpu_to_le16s(&hubstatus);
+	if ((hubstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0) {
+		dev_dbg(hub_dev, "hub controller current requirement: %dmA\n",
+			hub->descriptor->bHubContrCurrent);
+		hub->power_budget = (501 - hub->descriptor->bHubContrCurrent)
+					/ 2;
+		dev_dbg(hub_dev, "%dmA bus power budget for children\n",
+			hub->power_budget * 2);
+	}
+
 
 	ret = hub_hub_status(hub, &hubstatus, &hubchange);
 	if (ret < 0) {
@@ -554,20 +570,19 @@ static int hub_configure(struct usb_hub *hub,
 		goto fail;
 	}
 
-	/* FIXME implement per-port power budgeting;
-	 * enable it for bus-powered hubs.
-	 */
-	dev_dbg(hub_dev, "local power source is %s\n",
-		(hubstatus & HUB_STATUS_LOCAL_POWER)
-		? "lost (inactive)" : "good");
+	/* local power status reports aren't always correct */
+	if (hdev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_SELFPOWER)
+		dev_dbg(hub_dev, "local power source is %s\n",
+			(hubstatus & HUB_STATUS_LOCAL_POWER)
+			? "lost (inactive)" : "good");
 
 	if ((hub->descriptor->wHubCharacteristics & HUB_CHAR_OCPM) == 0)
 		dev_dbg(hub_dev, "%sover-current condition exists\n",
 			(hubstatus & HUB_STATUS_OVERCURRENT) ? "" : "no ");
 
 	/* Start the interrupt endpoint */
-	pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
-	maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+	pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress);
+	maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe));
 
 	if (maxp > sizeof(*hub->buffer))
 		maxp = sizeof(*hub->buffer);
@@ -579,7 +594,7 @@ static int hub_configure(struct usb_hub *hub,
 		goto fail;
 	}
 
-	usb_fill_int_urb(hub->urb, dev, pipe, *hub->buffer, maxp, hub_irq,
+	usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq,
 		hub, endpoint->bInterval);
 	hub->urb->transfer_dma = hub->buffer_dma;
 	hub->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
@@ -595,7 +610,7 @@ static int hub_configure(struct usb_hub *hub,
 
 	/* maybe start cycling the hub leds */
 	if (hub->has_indicators && blinkenlights) {
-		set_port_led(dev, hub, 1, HUB_LED_GREEN);
+		set_port_led(hdev, 1, HUB_LED_GREEN);
 		hub->indicator [0] = INDICATOR_CYCLE;
 		schedule_delayed_work(&hub->leds, LED_CYCLE_PERIOD);
 	}
@@ -605,12 +620,14 @@ static int hub_configure(struct usb_hub *hub,
 	return 0;
 
 fail:
-	dev_err (&hub->intf->dev, "config failed, %s (err %d)\n",
+	dev_err (hub_dev, "config failed, %s (err %d)\n",
 			message, ret);
 	/* hub_disconnect() frees urb and descriptor */
 	return ret;
 }
 
+static unsigned highspeed_hubs;
+
 static void hub_disconnect(struct usb_interface *intf)
 {
 	struct usb_hub *hub = usb_get_intfdata (intf);
@@ -620,6 +637,9 @@ static void hub_disconnect(struct usb_interface *intf)
 	if (!hub)
 		return;
 
+	if (interface_to_usbdev(intf)->speed == USB_SPEED_HIGH)
+		highspeed_hubs--;
+
 	usb_set_intfdata (intf, NULL);
 	spin_lock_irqsave(&hub_event_lock, flags);
 	hub->urb_complete = &urb_complete;
@@ -672,19 +692,21 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
 	struct usb_host_interface *desc;
 	struct usb_endpoint_descriptor *endpoint;
-	struct usb_device *dev;
+	struct usb_device *hdev;
 	struct usb_hub *hub;
+	struct device *hub_dev;
 	unsigned long flags;
 
 	desc = intf->cur_altsetting;
-	dev = interface_to_usbdev(intf);
+	hdev = interface_to_usbdev(intf);
+	hub_dev = &intf->dev;
 
 	/* Some hubs have a subclass of 1, which AFAICT according to the */
 	/*  specs is not defined, but it works */
 	if ((desc->desc.bInterfaceSubClass != 0) &&
 	    (desc->desc.bInterfaceSubClass != 1)) {
 descriptor_error:
-		dev_err (&intf->dev, "bad descriptor, ignoring hub\n");
+		dev_err (hub_dev, "bad descriptor, ignoring hub\n");
 		return -EIO;
 	}
 
@@ -708,11 +730,11 @@ descriptor_error:
 	}
 
 	/* We found a hub */
-	dev_info (hubdev (dev), "USB hub found\n");
+	dev_info (hub_dev, "USB hub found\n");
 
 	hub = kmalloc(sizeof(*hub), GFP_KERNEL);
 	if (!hub) {
-		dev_dbg (hubdev(dev), "couldn't kmalloc hub struct\n");
+		dev_dbg (hub_dev, "couldn't kmalloc hub struct\n");
 		return -ENOMEM;
 	}
 
@@ -731,6 +753,9 @@ descriptor_error:
 
 	usb_set_intfdata (intf, hub);
 
+	if (hdev->speed == USB_SPEED_HIGH)
+		highspeed_hubs++;
+
 	if (hub_configure(hub, endpoint) >= 0)
 		return 0;
 
@@ -741,7 +766,7 @@ descriptor_error:
 static int
 hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
 {
-	struct usb_device *hub = interface_to_usbdev (intf);
+	struct usb_device *hdev = interface_to_usbdev (intf);
 
 	/* assert ifno == 0 (part of hub spec) */
 	switch (code) {
@@ -751,16 +776,16 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
 		int i;
 
 		spin_lock_irqsave(&hub_event_lock, flags);
-		if (hub->devnum <= 0)
+		if (hdev->devnum <= 0)
 			info->nports = 0;
 		else {
-			info->nports = hub->maxchild;
+			info->nports = hdev->maxchild;
 			for (i = 0; i < info->nports; i++) {
-				if (hub->children[i] == NULL)
+				if (hdev->children[i] == NULL)
 					info->port[i] = 0;
 				else
 					info->port[i] =
-						hub->children[i]->devnum;
+						hdev->children[i]->devnum;
 			}
 		}
 		spin_unlock_irqrestore(&hub_event_lock, flags);
@@ -775,13 +800,13 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
 
 static int hub_reset(struct usb_hub *hub)
 {
-	struct usb_device *dev = interface_to_usbdev(hub->intf);
+	struct usb_device *hdev = interface_to_usbdev(hub->intf);
 	int i;
 
 	/* Disconnect any attached devices */
 	for (i = 0; i < hub->descriptor->bNbrPorts; i++) {
-		if (dev->children[i])
-			usb_disconnect(&dev->children[i]);
+		if (hdev->children[i])
+			usb_disconnect(&hdev->children[i]);
 	}
 
 	/* Attempt to reset the hub */
@@ -790,10 +815,10 @@ static int hub_reset(struct usb_hub *hub)
 	else
 		return -1;
 
-	if (usb_reset_device(dev))
+	if (usb_reset_device(hdev))
 		return -1;
 
-	hub->urb->dev = dev;                                                    
+	hub->urb->dev = hdev;                                                    
 	if (usb_submit_urb(hub->urb, GFP_KERNEL))
 		return -1;
 
@@ -802,36 +827,36 @@ static int hub_reset(struct usb_hub *hub)
 	return 0;
 }
 
-static void hub_start_disconnect(struct usb_device *dev)
+static void hub_start_disconnect(struct usb_device *hdev)
 {
-	struct usb_device *parent = dev->parent;
+	struct usb_device *parent = hdev->parent;
 	int i;
 
 	/* Find the device pointer to disconnect */
 	if (parent) {
 		for (i = 0; i < parent->maxchild; i++) {
-			if (parent->children[i] == dev) {
+			if (parent->children[i] == hdev) {
 				usb_disconnect(&parent->children[i]);
 				return;
 			}
 		}
 	}
 
-	dev_err(&dev->dev, "cannot disconnect hub!\n");
+	dev_err(&hdev->dev, "cannot disconnect hub!\n");
 }
 
-static int hub_port_status(struct usb_device *dev, int port,
+static int hub_port_status(struct usb_device *hdev, int port,
 			       u16 *status, u16 *change)
 {
-	struct usb_hub *hub = usb_get_intfdata(dev->actconfig->interface[0]);
+	struct usb_hub *hub = usb_get_intfdata(hdev->actconfig->interface[0]);
 	int ret;
 
 	if (!hub)
 		return -ENODEV;
 
-	ret = get_port_status(dev, port + 1, &hub->status->port);
+	ret = get_port_status(hdev, port + 1, &hub->status->port);
 	if (ret < 0)
-		dev_err (hubdev (dev),
+		dev_err (&hub->intf->dev,
 			"%s failed (err = %d)\n", __FUNCTION__, ret);
 	else {
 		*status = le16_to_cpu(hub->status->port.wPortStatus);
@@ -841,16 +866,18 @@ static int hub_port_status(struct usb_device *dev, int port,
 	return ret;
 }
 
-#define HUB_RESET_TRIES		5
-#define HUB_PROBE_TRIES		2
+#define PORT_RESET_TRIES	5
+#define SET_ADDRESS_TRIES	2
+#define GET_DESCRIPTOR_TRIES	2
+#define SET_CONFIG_TRIES	2
+
 #define HUB_ROOT_RESET_TIME	50	/* times are in msec */
 #define HUB_SHORT_RESET_TIME	10
 #define HUB_LONG_RESET_TIME	200
 #define HUB_RESET_TIMEOUT	500
 
-/* return: -1 on error, 0 on success, 1 on disconnect.  */
-static int hub_port_wait_reset(struct usb_device *hub, int port,
-				struct usb_device *dev, unsigned int delay)
+static int hub_port_wait_reset(struct usb_device *hdev, int port,
+				struct usb_device *udev, unsigned int delay)
 {
 	int delay_time, ret;
 	u16 portstatus;
@@ -860,31 +887,30 @@ static int hub_port_wait_reset(struct usb_device *hub, int port,
 			delay_time < HUB_RESET_TIMEOUT;
 			delay_time += delay) {
 		/* wait to give the device a chance to reset */
-		wait_ms(delay);
+		msleep(delay);
 
 		/* read and decode port status */
-		ret = hub_port_status(hub, port, &portstatus, &portchange);
-		if (ret < 0) {
-			return -1;
-		}
+		ret = hub_port_status(hdev, port, &portstatus, &portchange);
+		if (ret < 0)
+			return ret;
 
 		/* Device went away? */
 		if (!(portstatus & USB_PORT_STAT_CONNECTION))
-			return 1;
+			return -ENOTCONN;
 
 		/* bomb out completely if something weird happened */
 		if ((portchange & USB_PORT_STAT_C_CONNECTION))
-			return -1;
+			return -EINVAL;
 
 		/* if we`ve finished resetting, then break out of the loop */
 		if (!(portstatus & USB_PORT_STAT_RESET) &&
 		    (portstatus & USB_PORT_STAT_ENABLE)) {
 			if (portstatus & USB_PORT_STAT_HIGH_SPEED)
-				dev->speed = USB_SPEED_HIGH;
+				udev->speed = USB_SPEED_HIGH;
 			else if (portstatus & USB_PORT_STAT_LOW_SPEED)
-				dev->speed = USB_SPEED_LOW;
+				udev->speed = USB_SPEED_LOW;
 			else
-				dev->speed = USB_SPEED_FULL;
+				udev->speed = USB_SPEED_FULL;
 			return 0;
 		}
 
@@ -892,55 +918,55 @@ static int hub_port_wait_reset(struct usb_device *hub, int port,
 		if (delay_time >= 2 * HUB_SHORT_RESET_TIME)
 			delay = HUB_LONG_RESET_TIME;
 
-		dev_dbg (hubdev (hub),
+		dev_dbg (hubdev (hdev),
 			"port %d not reset yet, waiting %dms\n",
 			port + 1, delay);
 	}
 
-	return -1;
+	return -EBUSY;
 }
 
-/* return: -1 on error, 0 on success, 1 on disconnect.  */
-static int hub_port_reset(struct usb_device *hub, int port,
-				struct usb_device *dev, unsigned int delay)
+static int hub_port_reset(struct usb_device *hdev, int port,
+				struct usb_device *udev, unsigned int delay)
 {
 	int i, status;
+	struct device *hub_dev = hubdev (hdev);
 
 	/* Reset the port */
-	for (i = 0; i < HUB_RESET_TRIES; i++) {
-		set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET);
+	for (i = 0; i < PORT_RESET_TRIES; i++) {
+		set_port_feature(hdev, port + 1, USB_PORT_FEAT_RESET);
 
 		/* return on disconnect or reset */
-		status = hub_port_wait_reset(hub, port, dev, delay);
-		if (status != -1) {
-			clear_port_feature(hub,
+		status = hub_port_wait_reset(hdev, port, udev, delay);
+		if (status == -ENOTCONN || status == 0) {
+			clear_port_feature(hdev,
 				port + 1, USB_PORT_FEAT_C_RESET);
-			dev->state = status
+			udev->state = status
 					? USB_STATE_NOTATTACHED
 					: USB_STATE_DEFAULT;
 			return status;
 		}
 
-		dev_dbg (hubdev (hub),
+		dev_dbg (hub_dev,
 			"port %d not enabled, trying reset again...\n",
 			port + 1);
 		delay = HUB_LONG_RESET_TIME;
 	}
 
-	dev_err (hubdev (hub),
+	dev_err (hub_dev,
 		"Cannot enable port %i.  Maybe the USB cable is bad?\n",
 		port + 1);
 
-	return -1;
+	return status;
 }
 
-int hub_port_disable(struct usb_device *hub, int port)
+static int hub_port_disable(struct usb_device *hdev, int port)
 {
 	int ret;
 
-	ret = clear_port_feature(hub, port + 1, USB_PORT_FEAT_ENABLE);
+	ret = clear_port_feature(hdev, port + 1, USB_PORT_FEAT_ENABLE);
 	if (ret)
-		dev_err(hubdev(hub), "cannot disable port %d (err = %d)\n",
+		dev_err(hubdev(hdev), "cannot disable port %d (err = %d)\n",
 			port + 1, ret);
 
 	return ret;
@@ -964,8 +990,7 @@ int hub_port_disable(struct usb_device *hub, int port)
 #define HUB_DEBOUNCE_STEP	 25
 #define HUB_DEBOUNCE_STABLE	  4
 
-/* return: -1 on error, 0 on success, 1 on disconnect.  */
-static int hub_port_debounce(struct usb_device *hub, int port)
+static int hub_port_debounce(struct usb_device *hdev, int port)
 {
 	int ret;
 	int delay_time, stable_count;
@@ -975,11 +1000,11 @@ static int hub_port_debounce(struct usb_device *hub, int port)
 	connection = 0;
 	stable_count = 0;
 	for (delay_time = 0; delay_time < HUB_DEBOUNCE_TIMEOUT; delay_time += HUB_DEBOUNCE_STEP) {
-		wait_ms(HUB_DEBOUNCE_STEP);
+		msleep(HUB_DEBOUNCE_STEP);
 
-		ret = hub_port_status(hub, port, &portstatus, &portchange);
+		ret = hub_port_status(hdev, port, &portstatus, &portchange);
 		if (ret < 0)
-			return -1;
+			return ret;
 
 		if ((portstatus & USB_PORT_STAT_CONNECTION) == connection) {
 			if (connection) {
@@ -992,130 +1017,400 @@ static int hub_port_debounce(struct usb_device *hub, int port)
 		connection = portstatus & USB_PORT_STAT_CONNECTION;
 
 		if ((portchange & USB_PORT_STAT_C_CONNECTION)) {
-			clear_port_feature(hub, port+1, USB_PORT_FEAT_C_CONNECTION);
+			clear_port_feature(hdev, port+1, USB_PORT_FEAT_C_CONNECTION);
 		}
 	}
 
-	dev_dbg (hubdev (hub),
+	dev_dbg (hubdev (hdev),
 		"debounce: port %d: delay %dms stable %d status 0x%x\n",
 		port + 1, delay_time, stable_count, portstatus);
 
-	return ((portstatus&USB_PORT_STAT_CONNECTION)) ? 0 : 1;
+	return (portstatus & USB_PORT_STAT_CONNECTION) ? 0 : -ENOTCONN;
 }
 
-static void hub_port_connect_change(struct usb_hub *hubstate, int port,
-					u16 portstatus, u16 portchange)
+static int hub_set_address(struct usb_device *udev)
 {
-	struct usb_device *hub = interface_to_usbdev(hubstate->intf);
-	struct usb_device *dev;
-	unsigned int delay = HUB_SHORT_RESET_TIME;
-	int i;
-
-	dev_dbg (&hubstate->intf->dev,
-		"port %d, status %x, change %x, %s\n",
-		port + 1, portstatus, portchange, portspeed (portstatus));
-
-	/* Clear the connection change status */
-	clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_CONNECTION);
-
-	/* Disconnect any existing devices under this port */
-	if (hub->children[port])
-		usb_disconnect(&hub->children[port]);
+	int retval;
 
-	/* Return now if nothing is connected */
-	if (!(portstatus & USB_PORT_STAT_CONNECTION)) {
-		if (portstatus & USB_PORT_STAT_ENABLE)
-			hub_port_disable(hub, port);
+	if (udev->devnum == 0)
+		return -EINVAL;
+	if (udev->state != USB_STATE_DEFAULT &&
+			udev->state != USB_STATE_ADDRESS)
+		return -EINVAL;
+	retval = usb_control_msg(udev, usb_snddefctrl(udev),
+		USB_REQ_SET_ADDRESS, 0, udev->devnum, 0,
+		NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
+	if (retval == 0)
+		udev->state = USB_STATE_ADDRESS;
+	return retval;
+}
 
-		return;
-	}
+/* reset device, (re)assign address, get device descriptor.
+ * device connection is stable, no more debouncing needed.
+ * returns device in USB_STATE_ADDRESS, except on error.
+ * on error return, device is no longer usable (ref dropped).
+ *
+ * caller owns dev->serialize for the device, guarding against
+ * config changes and disconnect processing.
+ */
+static int
+hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
+{
+	static DECLARE_MUTEX(usb_address0_sem);
 
-	if (hub_port_debounce(hub, port)) {
-		dev_err (&hubstate->intf->dev,
-			"connect-debounce failed, port %d disabled\n",
-			port+1);
-		hub_port_disable(hub, port);
-		return;
-	}
+	int			i, j, retval;
+	unsigned		delay = HUB_SHORT_RESET_TIME;
+	enum usb_device_speed	oldspeed = udev->speed;
 
 	/* root hub ports have a slightly longer reset period
 	 * (from USB 2.0 spec, section 7.1.7.5)
 	 */
-	if (!hub->parent)
+	if (!hdev->parent)
 		delay = HUB_ROOT_RESET_TIME;
 
 	/* Some low speed devices have problems with the quick delay, so */
 	/*  be a bit pessimistic with those devices. RHbug #23670 */
-	if (portstatus & USB_PORT_STAT_LOW_SPEED)
+	if (oldspeed == USB_SPEED_LOW)
 		delay = HUB_LONG_RESET_TIME;
 
 	down(&usb_address0_sem);
 
-	for (i = 0; i < HUB_PROBE_TRIES; i++) {
-
-		/* Allocate a new device struct */
-		dev = usb_alloc_dev(hub, hub->bus, port);
-		if (!dev) {
-			dev_err (&hubstate->intf->dev,
-				"couldn't allocate usb_device\n");
-			break;
-		}
-
-		dev->state = USB_STATE_POWERED;
-
-		/* Reset the device, and detect its speed */
-		if (hub_port_reset(hub, port, dev, delay)) {
-			usb_put_dev(dev);
-			break;
-		}
+	/* Reset the device; full speed may morph to high speed */
+	retval = hub_port_reset(hdev, port, udev, delay);
+	if (retval < 0)		/* error or disconnect */
+		goto fail;
+				/* success, speed is known */
+	retval = -ENODEV;
 
-		/* Find a new address for it */
-		usb_choose_address(dev);
+	if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) {
+		dev_dbg(&udev->dev, "device reset changed speed!\n");
+		goto fail;
+	}
+  
+	/* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
+	 * it's fixed size except for full speed devices.
+	 */
+	switch (udev->speed) {
+	case USB_SPEED_HIGH:		/* fixed at 64 */
+		i = 64;
+		break;
+	case USB_SPEED_FULL:		/* 8, 16, 32, or 64 */
+		/* to determine the ep0 maxpacket size, read the first 8
+		 * bytes from the device descriptor to get bMaxPacketSize0;
+		 * then correct our initial (small) guess.
+		 */
+		// FALLTHROUGH
+	case USB_SPEED_LOW:		/* fixed at 8 */
+		i = 8;
+		break;
+	default:
+		goto fail;
+	}
+	udev->epmaxpacketin [0] = i;
+	udev->epmaxpacketout[0] = i;
+ 
+	/* set the address */
+	if (udev->devnum <= 0) {
+		usb_choose_address(udev);
+		if (udev->devnum <= 0)
+			goto fail;
 
 		/* Set up TT records, if needed  */
-		if (hub->tt) {
-			dev->tt = hub->tt;
-			dev->ttport = hub->ttport;
-		} else if (dev->speed != USB_SPEED_HIGH
-				&& hub->speed == USB_SPEED_HIGH) {
-			dev->tt = &hubstate->tt;
-			dev->ttport = port + 1;
+		if (hdev->tt) {
+			udev->tt = hdev->tt;
+			udev->ttport = hdev->ttport;
+		} else if (udev->speed != USB_SPEED_HIGH
+				&& hdev->speed == USB_SPEED_HIGH) {
+			struct usb_hub	*hub;
+ 
+			hub = usb_get_intfdata (hdev->actconfig
+							->interface[0]);
+			udev->tt = &hub->tt;
+			udev->ttport = port + 1;
 		}
 
-		dev_info (&dev->dev,
-			"new %s speed USB device using address %d\n",
-			({ char *speed; switch (dev->speed) {
+		/* force the right log message (below) at low speed */
+		oldspeed = USB_SPEED_UNKNOWN;
+	}
+ 
+	dev_info (&udev->dev,
+			"%s %s speed USB device using address %d\n",
+			(oldspeed == USB_SPEED_UNKNOWN) ? "new" : "reset",
+			({ char *speed; switch (udev->speed) {
 			case USB_SPEED_LOW:	speed = "low";	break;
 			case USB_SPEED_FULL:	speed = "full";	break;
 			case USB_SPEED_HIGH:	speed = "high";	break;
 			default: 		speed = "?";	break;
 			}; speed;}),
-			dev->devnum);
+			udev->devnum);
+ 
+	/* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way?
+	 * Because device hardware and firmware is sometimes buggy in
+	 * this area, and this is how Linux has done it for ages.
+	 * Change it cautiously.
+	 *
+	 * NOTE:  Windows gets the descriptor first, seemingly to help
+	 * work around device bugs like "can't use addresses with bit 3
+	 * set in certain configurations".  Yes, really.
+	 */
+	for (i = 0; i < GET_DESCRIPTOR_TRIES; ++i) {
+		for (j = 0; j < SET_ADDRESS_TRIES; ++j) {
+			retval = hub_set_address(udev);
+			if (retval >= 0)
+				break;
+			msleep(200);
+		}
+		if (retval < 0) {
+			dev_err(&udev->dev,
+				"device not accepting address %d, error %d\n",
+				udev->devnum, retval);
+ fail:
+			hub_port_disable(hdev, port);
+			usb_release_address(udev);
+			usb_put_dev(udev);
+			up(&usb_address0_sem);
+			return retval;
+		}
+ 
+		/* cope with hardware quirkiness:
+		 *  - let SET_ADDRESS settle, some device hardware wants it
+		 *  - read ep0 maxpacket even for high and low speed,
+  		 */
+		msleep(10);
+		retval = usb_get_device_descriptor(udev, 8);
+		if (retval >= 8)
+			break;
+		msleep(100);
+	}
+	if (retval != 8) {
+		dev_err(&udev->dev, "device descriptor read/%s, error %d\n",
+				"8", retval);
+		if (retval >= 0)
+			retval = -EMSGSIZE;
+		goto fail;
+	}
+	if (udev->speed == USB_SPEED_FULL
+			&& (udev->epmaxpacketin [0]
+				!= udev->descriptor.bMaxPacketSize0)) {
+		usb_disable_endpoint(udev, 0);
+		usb_endpoint_running(udev, 0, 1);
+		usb_endpoint_running(udev, 0, 0);
+		udev->epmaxpacketin [0] = udev->descriptor.bMaxPacketSize0;
+		udev->epmaxpacketout[0] = udev->descriptor.bMaxPacketSize0;
+	}
+  
+	retval = usb_get_device_descriptor(udev, USB_DT_DEVICE_SIZE);
+	if (retval < (signed)sizeof(udev->descriptor)) {
+		dev_err(&udev->dev, "device descriptor read/%s, error %d\n",
+			"all", retval);
+		if (retval >= 0)
+			retval = -ENOMSG;
+		goto fail;
+	}
 
-		/* Run it through the hoops (find a driver, etc) */
-		if (usb_new_device(dev) == 0) {
-			hub->children[port] = dev;
-			goto done;
+	/* now dev is visible to other tasks */
+	hdev->children[port] = udev;
+
+	up(&usb_address0_sem);
+	return 0;
+}
+
+static void
+check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port)
+{
+	struct usb_qualifier_descriptor	*qual;
+	int				status;
+
+	qual = kmalloc (sizeof *qual, SLAB_KERNEL);
+	if (qual == 0)
+		return;
+
+	status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0,
+			qual, sizeof *qual);
+	if (status == sizeof *qual) {
+		dev_info(&udev->dev, "not running at top speed; "
+			"connect to a high speed hub\n");
+		/* hub LEDs are probably harder to miss than syslog */
+		if (hub->has_indicators) {
+			hub->indicator[port] = INDICATOR_GREEN_BLINK;
+			schedule_work (&hub->leds);
 		}
+	}
+	kfree (qual);
+}
 
-		/* Free the configuration if there was an error */
-		usb_put_dev(dev);
+static unsigned
+hub_power_remaining (struct usb_hub *hub, struct usb_device *hdev)
+{
+	int remaining;
+	unsigned i;
 
-		/* Switch to a long reset time */
-		delay = HUB_LONG_RESET_TIME;
+	remaining = hub->power_budget;
+	if (!remaining)		/* self-powered */
+		return 0;
+
+	for (i = 0; i < hdev->maxchild; i++) {
+		struct usb_device	*udev = hdev->children[i];
+		int			delta;
+
+		if (!udev)
+			continue;
+
+		if (udev->actconfig)
+			delta = udev->actconfig->desc.bMaxPower;
+		else
+			delta = 50;
+		// dev_dbg(&udev->dev, "budgeted %dmA\n", 2 * delta);
+		remaining -= delta;
+	}
+	if (remaining < 0) {
+		dev_warn(&hub->intf->dev,
+			"%dmA over power budget!\n",
+			-2 * remaining);
+		remaining = 0;
+	}
+	return remaining;
+}
+ 
+static void hub_port_connect_change(struct usb_hub *hub, int port,
+					u16 portstatus, u16 portchange)
+{
+	struct usb_device *hdev = interface_to_usbdev(hub->intf);
+	struct device *hub_dev = &hub->intf->dev;
+	int status, i;
+ 
+	dev_dbg (hub_dev,
+		"port %d, status %04x, change %04x, %s\n",
+		port + 1, portstatus, portchange, portspeed (portstatus));
+ 
+	/* Clear the connection change status */
+	clear_port_feature(hdev, port + 1, USB_PORT_FEAT_C_CONNECTION);
+
+	if (hub->has_indicators) {
+		set_port_led(hdev, port + 1, HUB_LED_AUTO);
+		hub->indicator[port] = INDICATOR_AUTO;
+	}
+ 
+	/* Disconnect any existing devices under this port */
+	if (hdev->children[port])
+		usb_disconnect(&hdev->children[port]);
+
+	/* Return now if nothing is connected */
+	if (!(portstatus & USB_PORT_STAT_CONNECTION)) {
+
+		/* maybe switch power back on (e.g. root hub was reset) */
+		if ((hub->descriptor->wHubCharacteristics
+					& HUB_CHAR_LPSM) < 2
+				&& !(portstatus & (1 << USB_PORT_FEAT_POWER)))
+			set_port_feature(hdev, port + 1, USB_PORT_FEAT_POWER);
+ 
+		if (portstatus & USB_PORT_STAT_ENABLE)
+  			goto done;
+		return;
+	}
+  
+	if (hub_port_debounce(hdev, port)) {
+		dev_err (hub_dev,
+			"connect-debounce failed, port %d disabled\n",
+			port+1);
+		goto done;
 	}
 
-	hub_port_disable(hub, port);
+	for (i = 0; i < SET_CONFIG_TRIES; i++) {
+		struct usb_device *udev;
+
+		/* reallocate for each attempt, since references
+		 * to the previous one can escape in various ways
+		 */
+		udev = usb_alloc_dev(hdev, hdev->bus, port);
+		if (!udev) {
+			dev_err (hub_dev,
+				"couldn't allocate port %d usb_device\n", port+1);
+			goto done;
+		}
+		udev->state = USB_STATE_POWERED;
+	  
+		/* hub can tell if it's lowspeed already:  D- pullup (not D+) */
+		if (portstatus & USB_PORT_STAT_LOW_SPEED)
+			udev->speed = USB_SPEED_LOW;
+		else
+			udev->speed = USB_SPEED_UNKNOWN;
+
+		/* reset, set address, get descriptor, add to hub's children */
+		down (&udev->serialize);
+		status = hub_port_init(hdev, udev, port);
+		if (status == -ENOTCONN)
+			break;
+		if (status < 0)
+			continue;
+
+		/* consecutive bus-powered hubs aren't reliable; they can
+		 * violate the voltage drop budget.  if the new child has
+		 * a "powered" LED, users should notice we didn't enable it
+		 * (without reading syslog), even without per-port LEDs
+		 * on the parent.
+		 */
+		if (udev->descriptor.bDeviceClass == USB_CLASS_HUB
+				&& hub->power_budget) {
+			u16	devstat;
+
+			status = usb_get_status(udev, USB_RECIP_DEVICE, 0,
+					&devstat);
+			if (status < 0) {
+				dev_dbg(&udev->dev, "get status %d ?\n", status);
+				continue;
+			}
+			cpu_to_le16s(&devstat);
+			if ((devstat & (1 << USB_DEVICE_SELF_POWERED)) == 0) {
+				dev_err(&udev->dev,
+					"can't connect bus-powered hub "
+					"to this port\n");
+				if (hub->has_indicators) {
+					hub->indicator[port] =
+						INDICATOR_AMBER_BLINK;
+					schedule_work (&hub->leds);
+				}
+				hdev->children[port] = NULL;
+				usb_put_dev(udev);
+				hub_port_disable(hdev, port);
+				return;
+			}
+		}
+ 
+		/* check for devices running slower than they could */
+		if (udev->descriptor.bcdUSB >= 0x0200
+				&& udev->speed == USB_SPEED_FULL
+				&& highspeed_hubs != 0)
+			check_highspeed (hub, udev, port);
+
+		/* Run it through the hoops (find a driver, etc) */
+		status = usb_new_device(udev);
+		if (status != 0) {
+			hdev->children[port] = NULL;
+			continue;
+		}
+		up (&udev->serialize);
+
+		status = hub_power_remaining(hub, hdev);
+		if (status)
+			dev_dbg(hub_dev,
+				"%dmA power budget left\n",
+				2 * status);
+
+		return;
+	}
+ 
 done:
-	up(&usb_address0_sem);
+	hub_port_disable(hdev, port);
 }
 
 static void hub_events(void)
 {
 	unsigned long flags;
 	struct list_head *tmp;
-	struct usb_device *dev;
+	struct usb_device *hdev;
 	struct usb_hub *hub;
+	struct device *hub_dev;
 	u16 hubstatus;
 	u16 hubchange;
 	u16 portstatus;
@@ -1138,7 +1433,8 @@ static void hub_events(void)
 		tmp = hub_event_list.next;
 
 		hub = list_entry(tmp, struct usb_hub, event_list);
-		dev = interface_to_usbdev(hub->intf);
+		hdev = interface_to_usbdev(hub->intf);
+		hub_dev = &hub->intf->dev;
 
 		list_del_init(tmp);
 
@@ -1148,14 +1444,14 @@ static void hub_events(void)
 		spin_unlock_irqrestore(&hub_event_lock, flags);
 
 		if (hub->error) {
-			dev_dbg (&hub->intf->dev, "resetting for error %d\n",
+			dev_dbg (hub_dev, "resetting for error %d\n",
 				hub->error);
 
 			if (hub_reset(hub)) {
-				dev_dbg (&hub->intf->dev,
+				dev_dbg (hub_dev,
 					"can't reset; disconnecting\n");
 				up(&hub->khubd_sem);
-				hub_start_disconnect(dev);
+				hub_start_disconnect(hdev);
 				continue;
 			}
 
@@ -1164,7 +1460,7 @@ static void hub_events(void)
 		}
 
 		for (i = 0; i < hub->descriptor->bNbrPorts; i++) {
-			ret = hub_port_status(dev, i, &portstatus, &portchange);
+			ret = hub_port_status(hdev, i, &portstatus, &portchange);
 			if (ret < 0) {
 				continue;
 			}
@@ -1172,10 +1468,10 @@ static void hub_events(void)
 			if (portchange & USB_PORT_STAT_C_CONNECTION) {
 				hub_port_connect_change(hub, i, portstatus, portchange);
 			} else if (portchange & USB_PORT_STAT_C_ENABLE) {
-				dev_dbg (hubdev (dev),
-					"port %d enable change, status %x\n",
+				dev_dbg (hub_dev,
+					"port %d enable change, status %08x\n",
 					i + 1, portstatus);
-				clear_port_feature(dev,
+				clear_port_feature(hdev,
 					i + 1, USB_PORT_FEAT_C_ENABLE);
 
 				/*
@@ -1186,8 +1482,8 @@ static void hub_events(void)
 				 */
 				if (!(portstatus & USB_PORT_STAT_ENABLE)
 				    && (portstatus & USB_PORT_STAT_CONNECTION)
-				    && (dev->children[i])) {
-					dev_err (&hub->intf->dev,
+				    && (hdev->children[i])) {
+					dev_err (hub_dev,
 					    "port %i "
 					    "disabled by hub (EMI?), "
 					    "re-enabling...",
@@ -1198,43 +1494,43 @@ static void hub_events(void)
 			}
 
 			if (portchange & USB_PORT_STAT_C_SUSPEND) {
-				dev_dbg (&hub->intf->dev,
+				dev_dbg (hub_dev,
 					"suspend change on port %d\n",
 					i + 1);
-				clear_port_feature(dev,
+				clear_port_feature(hdev,
 					i + 1,  USB_PORT_FEAT_C_SUSPEND);
 			}
 			
 			if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
-				dev_err (&hub->intf->dev,
+				dev_err (hub_dev,
 					"over-current change on port %d\n",
 					i + 1);
-				clear_port_feature(dev,
+				clear_port_feature(hdev,
 					i + 1, USB_PORT_FEAT_C_OVER_CURRENT);
 				hub_power_on(hub);
 			}
 
 			if (portchange & USB_PORT_STAT_C_RESET) {
-				dev_dbg (&hub->intf->dev,
+				dev_dbg (hub_dev,
 					"reset change on port %d\n",
 					i + 1);
-				clear_port_feature(dev,
+				clear_port_feature(hdev,
 					i + 1, USB_PORT_FEAT_C_RESET);
 			}
 		} /* end for i */
 
 		/* deal with hub status changes */
 		if (hub_hub_status(hub, &hubstatus, &hubchange) < 0)
-			dev_err (&hub->intf->dev, "get_hub_status failed\n");
+			dev_err (hub_dev, "get_hub_status failed\n");
 		else {
 			if (hubchange & HUB_CHANGE_LOCAL_POWER) {
-				dev_dbg (&hub->intf->dev, "power change\n");
-				clear_hub_feature(dev, C_HUB_LOCAL_POWER);
+				dev_dbg (hub_dev, "power change\n");
+				clear_hub_feature(hdev, C_HUB_LOCAL_POWER);
 			}
 			if (hubchange & HUB_CHANGE_OVERCURRENT) {
-				dev_dbg (&hub->intf->dev, "overcurrent change\n");
-				wait_ms(500);	/* Cool down */
-				clear_hub_feature(dev, C_HUB_OVER_CURRENT);
+				dev_dbg (hub_dev, "overcurrent change\n");
+				msleep(500);	/* Cool down */
+				clear_hub_feature(hdev, C_HUB_OVER_CURRENT);
                         	hub_power_on(hub);
 			}
 		}
@@ -1244,7 +1540,7 @@ static void hub_events(void)
 	spin_unlock_irqrestore(&hub_event_lock, flags);
 }
 
-static int hub_thread(void *__hub)
+static int hub_thread(void *__unused)
 {
 	/*
 	 * This thread doesn't need any user-level access,
@@ -1331,30 +1627,73 @@ void usb_hub_cleanup(void)
 	usb_deregister(&hub_driver);
 } /* usb_hub_cleanup() */
 
+
+static int config_descriptors_changed(struct usb_device *udev)
+{
+	unsigned			index;
+	unsigned			len = 0;
+	struct usb_config_descriptor	*buf;
+
+	for (index = 0; index < udev->descriptor.bNumConfigurations; index++) {
+		if (len < udev->config[index].desc.wTotalLength)
+			len = udev->config[index].desc.wTotalLength;
+	}
+	buf = kmalloc (len, SLAB_KERNEL);
+	if (buf == 0) {
+		dev_err(&udev->dev, "no mem to re-read configs after reset\n");
+		/* assume the worst */
+		return 1;
+	}
+	for (index = 0; index < udev->descriptor.bNumConfigurations; index++) {
+		int length;
+		int old_length = udev->config[index].desc.wTotalLength;
+
+		length = usb_get_descriptor(udev, USB_DT_CONFIG, index, buf,
+				old_length);
+		if (length < old_length) {
+			dev_dbg(&udev->dev, "config index %d, error %d\n",
+					index, length);
+			break;
+		}
+		if (memcmp (buf, udev->rawdescriptors[index], old_length)
+				!= 0) {
+			dev_dbg(&udev->dev, "config index %d changed (#%d)\n",
+				index, buf->bConfigurationValue);
+/* FIXME enable this when we can re-enumerate after reset;
+ * until then DFU-ish drivers need this and other workarounds
+ */
+//			break;
+		}
+	}
+	kfree(buf);
+	return index != udev->descriptor.bNumConfigurations;
+}
+
 /*
- * WARNING - If a driver calls usb_reset_device, you should simulate a
- * disconnect() and probe() for other interfaces you doesn't claim. This
- * is left up to the driver writer right now. This insures other drivers
- * have a chance to re-setup their interface.
+ * WARNING - don't reset any device unless drivers for all of its
+ * interfaces are expecting that reset!  Maybe some driver->reset()
+ * method should eventually help ensure sufficient cooperation.
  *
- * Take a look at proc_resetdevice in devio.c for some sample code to
- * do this.
- * Use this only from within your probe function, otherwise use
- * usb_reset_device() below, which ensure proper locking
+ * This is the same as usb_reset_device() except that the caller
+ * already holds dev->serialize.  For example, it's safe to use
+ * this from a driver probe() routine after downloading new firmware.
  */
-int usb_physical_reset_device(struct usb_device *dev)
+int __usb_reset_device(struct usb_device *udev)
 {
-	struct usb_device *parent = dev->parent;
-	struct usb_device_descriptor *descriptor;
+	struct usb_device *parent = udev->parent;
+	struct usb_device_descriptor descriptor = udev->descriptor;
 	int i, ret, port = -1;
 
-	if (!parent) {
-		err("attempting to reset root hub!");
+	if (udev->maxchild) {
+		/* this requires hub- or hcd-specific logic;
+		 * see hub_reset() and OHCI hc_restart()
+		 */
+		dev_dbg(&udev->dev, "%s for hub!\n", __FUNCTION__);
 		return -EINVAL;
 	}
 
 	for (i = 0; i < parent->maxchild; i++)
-		if (parent->children[i] == dev) {
+		if (parent->children[i] == udev) {
 			port = i;
 			break;
 		}
@@ -1362,114 +1701,69 @@ int usb_physical_reset_device(struct usb_device *dev)
 	if (port < 0)
 		return -ENOENT;
 
-	descriptor = kmalloc(sizeof *descriptor, GFP_NOIO);
-	if (!descriptor) {
-		return -ENOMEM;
-	}
-
-	down(&usb_address0_sem);
-
-	/* Send a reset to the device */
-	if (hub_port_reset(parent, port, dev, HUB_SHORT_RESET_TIME)) {
-		hub_port_disable(parent, port);
-		up(&usb_address0_sem);
-		kfree(descriptor);
-		return(-ENODEV);
-	}
-
-	/* Reprogram the Address */
-	ret = usb_set_address(dev);
-	if (ret < 0) {
-		err("USB device not accepting new address (error=%d)", ret);
-		hub_port_disable(parent, port);
-		up(&usb_address0_sem);
-		kfree(descriptor);
-		return ret;
-	}
-
-	/* Let the SET_ADDRESS settle */
-	wait_ms(10);
-
-	up(&usb_address0_sem);
-
-	/*
-	 * Now we fetch the configuration descriptors for the device and
-	 * see if anything has changed. If it has, we dump the current
-	 * parsed descriptors and reparse from scratch. Then we leave
-	 * the device alone for the caller to finish setting up.
-	 *
-	 * If nothing changed, we reprogram the configuration and then
-	 * the alternate settings.
-	 */
-
-	ret = usb_get_descriptor(dev, USB_DT_DEVICE, 0, descriptor,
-			sizeof(*descriptor));
-	if (ret < 0) {
-		kfree(descriptor);
-		return ret;
-	}
-
-	le16_to_cpus(&descriptor->bcdUSB);
-	le16_to_cpus(&descriptor->idVendor);
-	le16_to_cpus(&descriptor->idProduct);
-	le16_to_cpus(&descriptor->bcdDevice);
-
-	if (memcmp(&dev->descriptor, descriptor, sizeof(*descriptor))) {
-		kfree(descriptor);
-		usb_destroy_configuration(dev);
-
-		/* FIXME Linux doesn't yet handle these "device morphed"
-		 * paths.  DFU variants need this to work ... and they
-		 * include the "config descriptors changed" case this
-		 * doesn't yet detect!
-		 */
-		dev->state = USB_STATE_NOTATTACHED;
-		dev_err(&dev->dev, "device morphed (DFU?), nyet supported\n");
-
-		return -ENODEV;
-	}
-
-	kfree(descriptor);
+	ret = hub_port_init(parent, udev, port);
+	if (ret < 0)
+		goto re_enumerate;
+ 
+	/* Device might have changed firmware (DFU or similar) */
+	if (memcmp(&udev->descriptor, &descriptor, sizeof descriptor)
+			|| config_descriptors_changed (udev)) {
+		dev_info(&udev->dev, "device firmware changed\n");
+		udev->descriptor = descriptor;	/* for disconnect() calls */
+		goto re_enumerate;
+  	}
+  
+	if (!udev->actconfig)
+		return 0;
 
-	ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
 			USB_REQ_SET_CONFIGURATION, 0,
-			dev->actconfig->desc.bConfigurationValue, 0,
+			udev->actconfig->desc.bConfigurationValue, 0,
 			NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
 	if (ret < 0) {
-		err("failed to set dev %s active configuration (error=%d)",
-			dev->devpath, ret);
-		return ret;
-	}
-	dev->state = USB_STATE_CONFIGURED;
-
-	for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
-		struct usb_interface *intf = dev->actconfig->interface[i];
+		dev_err(&udev->dev,
+			"can't restore configuration #%d (error=%d)\n",
+			udev->actconfig->desc.bConfigurationValue, ret);
+		goto re_enumerate;
+  	}
+	udev->state = USB_STATE_CONFIGURED;
+
+	for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
+		struct usb_interface *intf = udev->actconfig->interface[i];
 		struct usb_interface_descriptor *desc;
 
+		/* set_interface resets host side toggle and halt status even
+		 * for altsetting zero.  the interface may have no driver.
+		 */
 		desc = &intf->cur_altsetting->desc;
-		ret = usb_set_interface(dev, desc->bInterfaceNumber,
+		ret = usb_set_interface(udev, desc->bInterfaceNumber,
 			desc->bAlternateSetting);
 		if (ret < 0) {
-			err("failed to set active alternate setting "
-				"for dev %s interface %d (error=%d)",
-				dev->devpath, desc->bInterfaceNumber, ret);
-			return ret;
+			dev_err(&udev->dev, "failed to restore interface %d "
+				"altsetting %d (error=%d)\n",
+				desc->bInterfaceNumber,
+				desc->bAlternateSetting,
+				ret);
+			goto re_enumerate;
 		}
 	}
 
 	return 0;
+ 
+re_enumerate:
+	/* FIXME make some task re-enumerate; don't just mark unusable */
+	udev->state = USB_STATE_NOTATTACHED;
+	return -ENODEV;
 }
+EXPORT_SYMBOL(__usb_reset_device);
 
 int usb_reset_device(struct usb_device *udev)
 {
-	struct device *gdev = &udev->dev;
 	int r;
 	
-	down_read(&gdev->bus->subsys.rwsem);
-	r = usb_physical_reset_device(udev);
-	up_read(&gdev->bus->subsys.rwsem);
+	down(&udev->serialize);
+	r = __usb_reset_device(udev);
+	up(&udev->serialize);
 
 	return r;
 }
-
-
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 33b21925e..a24b1afa7 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -209,6 +209,8 @@ struct usb_hub {
 	struct semaphore	khubd_sem;
 	struct usb_tt		tt;		/* Transaction Translator */
 
+	u8			power_budget;	/* in 2mA units; or zero */
+
 	unsigned		has_indicators:1;
 	enum hub_led_mode	indicator[USB_MAXCHILDREN];
 	struct work_struct	leds;
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 8076c2437..e9046f684 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -717,9 +717,6 @@ void usbfs_remove_device(struct usb_device *dev)
 	while (!list_empty(&dev->filelist)) {
 		ds = list_entry(dev->filelist.next, struct dev_state, list);
 		list_del_init(&ds->list);
-		down_write(&ds->devsem);
-		ds->dev = NULL;
-		up_write(&ds->devsem);
 		if (ds->discsignr) {
 			sinfo.si_signo = SIGPIPE;
 			sinfo.si_errno = EPIPE;
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index fad1c2243..6304f2750 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -796,10 +796,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf)
 	}
 }
 
-static void release_interface(struct device *dev)
-{
-}
-
 /*
  * usb_disable_device - Disable all the endpoints for a USB device
  * @dev: the device whose endpoints are being disabled
@@ -834,7 +830,15 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
 			interface = dev->actconfig->interface[i];
 			dev_dbg (&dev->dev, "unregistering interface %s\n",
 				interface->dev.bus_id);
-			device_unregister (&interface->dev);
+			device_del (&interface->dev);
+		}
+
+		/* Now that the interfaces are unbound, nobody should
+		 * try to access them.
+		 */
+		for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
+			put_device (&dev->actconfig->interface[i]->dev);
+			dev->actconfig->interface[i] = NULL;
 		}
 		dev->actconfig = 0;
 		if (dev->state == USB_STATE_CONFIGURED)
@@ -1071,6 +1075,16 @@ int usb_reset_configuration(struct usb_device *dev)
 	return 0;
 }
 
+static void release_interface(struct device *dev)
+{
+	struct usb_interface *intf = to_usb_interface(dev);
+	struct usb_interface_cache *intfc =
+			altsetting_to_usb_interface_cache(intf->altsetting);
+
+	kref_put(&intfc->ref);
+	kfree(intf);
+}
+
 /*
  * usb_set_configuration - Makes a particular device setting be current
  * @dev: the device whose configuration is being updated
@@ -1109,19 +1123,19 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 {
 	int i, ret;
 	struct usb_host_config *cp = NULL;
-	
+	struct usb_interface **new_interfaces = NULL;
+	int n, nintf;
+
 	/* dev->serialize guards all config changes */
 
-	for (i=0; i<dev->descriptor.bNumConfigurations; i++) {
+	for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
 		if (dev->config[i].desc.bConfigurationValue == configuration) {
 			cp = &dev->config[i];
 			break;
 		}
 	}
-	if ((!cp && configuration != 0)) {
-		ret = -EINVAL;
-		goto out;
-	}
+	if ((!cp && configuration != 0))
+		return -EINVAL;
 
 	/* The USB spec says configuration 0 means unconfigured.
 	 * But if a device includes a configuration numbered 0,
@@ -1130,6 +1144,34 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 	if (cp && configuration == 0)
 		dev_warn(&dev->dev, "config 0 descriptor??\n");
 
+	/* Allocate memory for new interfaces before doing anything else,
+	 * so that if we run out then nothing will have changed. */
+	n = nintf = 0;
+	if (cp) {
+		nintf = cp->desc.bNumInterfaces;
+		new_interfaces = kmalloc(nintf * sizeof(*new_interfaces),
+				GFP_KERNEL);
+		if (!new_interfaces) {
+			dev_err(&dev->dev, "Out of memory");
+			return -ENOMEM;
+		}
+
+		for (; n < nintf; ++n) {
+			new_interfaces[n] = kmalloc(
+					sizeof(struct usb_interface),
+					GFP_KERNEL);
+			if (!new_interfaces[n]) {
+				dev_err(&dev->dev, "Out of memory");
+				ret = -ENOMEM;
+free_interfaces:
+				while (--n >= 0)
+					kfree(new_interfaces[n]);
+				kfree(new_interfaces);
+				return ret;
+			}
+		}
+	}
+
 	/* if it's already configured, clear out old state first.
 	 * getting rid of old interfaces means unbinding their drivers.
 	 */
@@ -1139,7 +1181,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 	if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 			USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
 			NULL, 0, HZ * USB_CTRL_SET_TIMEOUT)) < 0)
-		goto out;
+		goto free_interfaces;
 
 	dev->actconfig = cp;
 	if (!cp)
@@ -1147,14 +1189,21 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 	else {
 		dev->state = USB_STATE_CONFIGURED;
 
-		/* re-initialize hc/hcd/usbcore interface/endpoint state.
-		 * this triggers binding of drivers to interfaces; and
-		 * maybe probe() calls will choose different altsettings.
+		/* Initialize the new interface structures and the
+		 * hc/hcd/usbcore interface/endpoint state.
 		 */
-		for (i = 0; i < cp->desc.bNumInterfaces; ++i) {
-			struct usb_interface *intf = cp->interface[i];
+		for (i = 0; i < nintf; ++i) {
+			struct usb_interface_cache *intfc;
+			struct usb_interface *intf;
 			struct usb_host_interface *alt;
 
+			cp->interface[i] = intf = new_interfaces[i];
+			memset(intf, 0, sizeof(*intf));
+			intfc = cp->intf_cache[i];
+			intf->altsetting = intfc->altsetting;
+			intf->num_altsetting = intfc->num_altsetting;
+			kref_get(&intfc->ref);
+
 			alt = usb_altnum_to_altsetting(intf, 0);
 
 			/* No altsetting 0?  We'll assume the first altsetting.
@@ -1178,12 +1227,15 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 				 configuration,
 				 alt->desc.bInterfaceNumber);
 		}
+		kfree(new_interfaces);
 
-		/* Now that all interfaces are setup, probe() calls
-		 * may claim() any interface that's not yet bound.
-		 * Many class drivers need that: CDC, audio, video, etc.
+		/* Now that all the interfaces are set up, register them
+		 * to trigger binding of drivers to interfaces.  probe()
+		 * routines may install different altsettings and may
+		 * claim() any interfaces not yet bound.  Many class drivers
+		 * need that: CDC, audio, video, etc.
 		 */
-		for (i = 0; i < cp->desc.bNumInterfaces; ++i) {
+		for (i = 0; i < nintf; ++i) {
 			struct usb_interface *intf = cp->interface[i];
 			struct usb_interface_descriptor *desc;
 
@@ -1200,11 +1252,10 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 					ret);
 				continue;
 			}
-			usb_create_driverfs_intf_files (intf);
+			usb_create_sysfs_intf_files (intf);
 		}
 	}
 
-out:
 	return ret;
 }
 
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index d5a75b1ac..25d5d1926 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -13,6 +13,14 @@
 #include <linux/usb.h>
 #include "hcd.h"
 
+#define to_urb(d) container_of(d, struct urb, kref)
+
+static void urb_destroy(struct kref *kref)
+{
+	struct urb *urb = to_urb(kref);
+	kfree(urb);
+}
+
 /**
  * usb_init_urb - initializes a urb so that it can be used by a USB driver
  * @urb: pointer to the urb to initialize
@@ -31,7 +39,7 @@ void usb_init_urb(struct urb *urb)
 {
 	if (urb) {
 		memset(urb, 0, sizeof(*urb));
-		urb->count = (atomic_t)ATOMIC_INIT(1);
+		kref_init(&urb->kref, urb_destroy);
 		spin_lock_init(&urb->lock);
 	}
 }
@@ -80,8 +88,7 @@ struct urb *usb_alloc_urb(int iso_packets, int mem_flags)
 void usb_free_urb(struct urb *urb)
 {
 	if (urb)
-		if (atomic_dec_and_test(&urb->count))
-			kfree(urb);
+		kref_put(&urb->kref);
 }
 
 /**
@@ -96,11 +103,9 @@ void usb_free_urb(struct urb *urb)
  */
 struct urb * usb_get_urb(struct urb *urb)
 {
-	if (urb) {
-		atomic_inc(&urb->count);
-		return urb;
-	} else
-		return NULL;
+	if (urb)
+		kref_get(&urb->kref);
+	return urb;
 }
 		
 		
@@ -232,6 +237,8 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
 	    (dev->state < USB_STATE_DEFAULT) ||
 	    (!dev->bus) || (dev->devnum <= 0))
 		return -ENODEV;
+	if (dev->state == USB_STATE_SUSPENDED)
+		return -EHOSTUNREACH;
 	if (!(op = dev->bus->op) || !op->submit_urb)
 		return -ENODEV;
 
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 0da70f7af..3c2ddb5d0 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -198,6 +198,9 @@ void usb_deregister(struct usb_driver *driver)
  * This routine helps device drivers avoid such mistakes.
  * However, you should make sure that you do the right thing with any
  * alternate settings available for this interfaces.
+ *
+ * Don't call this function unless you are bound to one of the interfaces
+ * on this device or you own the dev->serialize semaphore!
  */
 struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
 {
@@ -228,6 +231,9 @@ struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
  * it would be incorrect to assume that the first altsetting entry in
  * the array corresponds to altsetting zero.  This routine helps device
  * drivers avoid such mistakes.
+ *
+ * Don't call this function unless you are bound to the intf interface
+ * or you own the device's ->serialize semaphore!
  */
 struct usb_host_interface *usb_altnum_to_altsetting(struct usb_interface *intf,
 		unsigned int altnum)
@@ -992,12 +998,10 @@ void usb_disconnect(struct usb_device **pdev)
 	 */
 	usb_disable_device(dev, 0);
 
-	dev_dbg (&dev->dev, "unregistering device\n");
 	/* Free the device number and remove the /proc/bus/usb entry */
-	if (dev->devnum > 0) {
-		clear_bit(dev->devnum, dev->bus->devmap.devicemap);
-		usbfs_remove_device(dev);
-	}
+	dev_dbg (&dev->dev, "unregistering device\n");
+	usb_release_address(dev);
+	usbfs_remove_device(dev);
 	up(&dev->serialize);
 	device_unregister(&dev->dev);
 }
@@ -1032,24 +1036,23 @@ void usb_choose_address(struct usb_device *dev)
 	}
 }
 
-
-// hub-only!! ... and only exported for reset/reinit path.
-// otherwise used internally, for usb_new_device()
-int usb_set_address(struct usb_device *dev)
+/**
+ * usb_release_address - deallocate device address (usbcore-internal)
+ * @dev: newly removed device
+ *
+ * Removes and deallocates the address assigned to a device.
+ * Only hub drivers (but not virtual root hub drivers for host
+ * controllers) should ever call this.
+ */
+void usb_release_address(struct usb_device *dev)
 {
-	int retval;
-
-	if (dev->devnum == 0)
-		return -EINVAL;
-	if (dev->state != USB_STATE_DEFAULT && dev->state != USB_STATE_ADDRESS)
-		return -EINVAL;
-	retval = usb_control_msg(dev, usb_snddefctrl(dev), USB_REQ_SET_ADDRESS,
-		0, dev->devnum, 0, NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
-	if (retval == 0)
-		dev->state = USB_STATE_ADDRESS;
-	return retval;
+	if (dev->devnum > 0) {
+		clear_bit(dev->devnum, dev->bus->devmap.devicemap);
+		dev->devnum = -1;
+	}
 }
 
+
 static inline void usb_show_string(struct usb_device *dev, char *id, int index)
 {
 	char *buf;
@@ -1063,92 +1066,59 @@ static inline void usb_show_string(struct usb_device *dev, char *id, int index)
 	kfree(buf);
 }
 
+static int usb_choose_configuration(struct usb_device *dev)
+{
+	int c, i;
+
+	c = dev->config[0].desc.bConfigurationValue;
+	if (dev->descriptor.bNumConfigurations != 1) {
+		for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
+			struct usb_interface_descriptor	*desc;
+
+			/* heuristic:  Linux is more likely to have class
+			 * drivers, so avoid vendor-specific interfaces.
+			 */
+			desc = &dev->config[i].intf_cache[0]
+					->altsetting->desc;
+			if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
+				continue;
+			/* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
+			if (desc->bInterfaceClass == USB_CLASS_COMM
+					&& desc->bInterfaceSubClass == 2
+					&& desc->bInterfaceProtocol == 0xff)
+				continue;
+			c = dev->config[i].desc.bConfigurationValue;
+			break;
+		}
+		dev_info(&dev->dev,
+			"configuration #%d chosen from %d choices\n",
+			c, dev->descriptor.bNumConfigurations);
+	}
+	return c;
+}
+
 /*
- * By the time we get here, we chose a new device address
- * and is in the default state. We need to identify the thing and
- * get the ball rolling..
+ * usb_new_device - perform initial device setup (usbcore-internal)
+ * @dev: newly addressed device (in ADDRESS state)
  *
- * Returns 0 for success, != 0 for error.
+ * This is called with devices which have been enumerated, but not yet
+ * configured.  The device descriptor is available, but not descriptors
+ * for any device configuration.  The caller owns dev->serialize, and
+ * the device is not visible through sysfs or other filesystem code.
+ *
+ * Returns 0 for success (device is configured and listed, with its
+ * interfaces, in sysfs); else a negative errno value.  On error, one
+ * reference count to the device has been dropped.
  *
  * This call is synchronous, and may not be used in an interrupt context.
  *
  * Only the hub driver should ever call this; root hub registration
  * uses it only indirectly.
  */
-#define NEW_DEVICE_RETRYS	2
-#define SET_ADDRESS_RETRYS	2
 int usb_new_device(struct usb_device *dev)
 {
-	int err = -EINVAL;
-	int i;
-	int j;
-	int config;
-
-	/* USB 2.0 section 5.5.3 talks about ep0 maxpacket ...
-	 * it's fixed size except for full speed devices.
-	 */
-	switch (dev->speed) {
-	case USB_SPEED_HIGH:		/* fixed at 64 */
-		i = 64;
-		break;
-	case USB_SPEED_FULL:		/* 8, 16, 32, or 64 */
-		/* to determine the ep0 maxpacket size, read the first 8
-		 * bytes from the device descriptor to get bMaxPacketSize0;
-		 * then correct our initial (small) guess.
-		 */
-		// FALLTHROUGH
-	case USB_SPEED_LOW:		/* fixed at 8 */
-		i = 8;
-		break;
-	default:
-		goto fail;
-	}
-	dev->epmaxpacketin [0] = i;
-	dev->epmaxpacketout[0] = i;
-
-	for (i = 0; i < NEW_DEVICE_RETRYS; ++i) {
-
-		for (j = 0; j < SET_ADDRESS_RETRYS; ++j) {
-			err = usb_set_address(dev);
-			if (err >= 0)
-				break;
-			wait_ms(200);
-		}
-		if (err < 0) {
-			dev_err(&dev->dev,
-				"device not accepting address %d, error %d\n",
-				dev->devnum, err);
-			goto fail;
-		}
-
-		wait_ms(10);	/* Let the SET_ADDRESS settle */
-
-		/* high and low speed devices don't need this... */
-		err = usb_get_device_descriptor(dev, 8);
-		if (err >= 8)
-			break;
-		wait_ms(100);
-	}
-
-	if (err < 8) {
-		dev_err(&dev->dev, "device descriptor read/8, error %d\n", err);
-		goto fail;
-	}
-	if (dev->speed == USB_SPEED_FULL) {
-		usb_disable_endpoint(dev, 0);
-		usb_endpoint_running(dev, 0, 1);
-		usb_endpoint_running(dev, 0, 0);
-		dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0;
-		dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;
-	}
-
-	/* USB device state == addressed ... still not usable */
-
-	err = usb_get_device_descriptor(dev, sizeof(dev->descriptor));
-	if (err != (signed)sizeof(dev->descriptor)) {
-		dev_err(&dev->dev, "device descriptor read/all, error %d\n", err);
-		goto fail;
-	}
+	int err;
+	int c;
 
 	err = usb_get_configuration(dev);
 	if (err < 0) {
@@ -1170,51 +1140,22 @@ int usb_new_device(struct usb_device *dev)
 		usb_show_string(dev, "SerialNumber", dev->descriptor.iSerialNumber);
 #endif
 
-	down(&dev->serialize);
-
 	/* put device-specific files into sysfs */
 	err = device_add (&dev->dev);
 	if (err) {
 		dev_err(&dev->dev, "can't device_add, error %d\n", err);
-		up(&dev->serialize);
 		goto fail;
 	}
-	usb_create_driverfs_dev_files (dev);
+	usb_create_sysfs_dev_files (dev);
 
 	/* choose and set the configuration. that registers the interfaces
 	 * with the driver core, and lets usb device drivers bind to them.
 	 * NOTE:  should interact with hub power budgeting.
 	 */
-	config = dev->config[0].desc.bConfigurationValue;
-	if (dev->descriptor.bNumConfigurations != 1) {
-		for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
-			struct usb_interface_descriptor	*desc;
-
-			/* heuristic:  Linux is more likely to have class
-			 * drivers, so avoid vendor-specific interfaces.
-			 */
-			desc = &dev->config[i].interface[0]
-					->altsetting->desc;
-			if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
-				continue;
-			/* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
-			if (desc->bInterfaceClass == USB_CLASS_COMM
-					&& desc->bInterfaceSubClass == 2
-					&& desc->bInterfaceProtocol == 0xff)
-				continue;
-			config = dev->config[i].desc.bConfigurationValue;
-			break;
-		}
-		dev_info(&dev->dev,
-			"configuration #%d chosen from %d choices\n",
-			config,
-			dev->descriptor.bNumConfigurations);
-	}
-	err = usb_set_configuration(dev, config);
-	up(&dev->serialize);
+	c = usb_choose_configuration(dev);
+	err = usb_set_configuration(dev, c);
 	if (err) {
-		dev_err(&dev->dev, "can't set config #%d, error %d\n",
-			config, err);
+		dev_err(&dev->dev, "can't set config #%d, error %d\n", c, err);
 		device_del(&dev->dev);
 		goto fail;
 	}
@@ -1226,9 +1167,9 @@ int usb_new_device(struct usb_device *dev)
 
 	return 0;
 fail:
-	dev->state = USB_STATE_DEFAULT;
-	clear_bit(dev->devnum, dev->bus->devmap.devicemap);
-	dev->devnum = -1;
+	dev->state = USB_STATE_NOTATTACHED;
+	usb_release_address(dev);
+	usb_put_dev(dev);
 	return err;
 }
 
@@ -1577,20 +1518,40 @@ int usb_disabled(void)
  */
 static int __init usb_init(void)
 {
+	int retval;
 	if (nousb) {
 		pr_info ("%s: USB support disabled\n", usbcore_name);
 		return 0;
 	}
 
-	bus_register(&usb_bus_type);
+	retval = bus_register(&usb_bus_type);
+	if (retval) 
+		goto out;
 	usb_host_init();
-	usb_major_init();
-	usbfs_init();
-	usb_hub_init();
-
-	driver_register(&usb_generic_driver);
+	retval = usb_major_init();
+	if (retval)
+		goto major_init_failed;
+	retval = usbfs_init();
+	if (retval)
+		goto fs_init_failed;
+	retval = usb_hub_init();
+	if (retval)
+		goto hub_init_failed;
+
+	retval = driver_register(&usb_generic_driver);
+	if (!retval)
+		goto out;
 
-	return 0;
+	usb_hub_cleanup();
+hub_init_failed:
+	usbfs_cleanup();
+fs_init_failed:
+	usb_major_cleanup();	
+major_init_failed:
+	usb_host_cleanup();
+	bus_unregister(&usb_bus_type);
+out:
+	return retval;
 }
 
 /*
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 5126d551c..886b79daa 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -1,7 +1,7 @@
 /* Functions local to drivers/usb/core/ */
 
-extern void usb_create_driverfs_dev_files (struct usb_device *dev);
-extern void usb_create_driverfs_intf_files (struct usb_interface *intf);
+extern void usb_create_sysfs_dev_files (struct usb_device *dev);
+extern void usb_create_sysfs_intf_files (struct usb_interface *intf);
 extern int usb_probe_interface (struct device *dev);
 extern int usb_unbind_interface (struct device *dev);
 
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 3d4bf28f9..71c1cdc34 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -95,6 +95,7 @@ config USB_PXA2XX
 config USB_PXA2XX_SMALL
 	depends on USB_GADGET_PXA2XX
 	bool
+	default n if USB_ETH_RNDIS
 	default y if USB_ZERO
 	default y if USB_ETH
 	default y if USB_G_SERIAL
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 637bbc1a9..5fd8ea6f6 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -144,6 +144,7 @@ struct dummy {
 	struct usb_gadget_driver	*driver;
 	struct dummy_request		fifo_req;
 	u8				fifo_buf [FIFO_SIZE];
+	u16				devstatus;
 
 	struct hcd_dev			*hdev;
 
@@ -156,6 +157,8 @@ struct dummy {
 	u32				port_status;
 	int				started;
 	struct completion		released;
+	unsigned			resuming:1;
+	unsigned long			re_timeout;
 };
 
 static struct dummy	*the_controller;
@@ -556,8 +559,37 @@ static int dummy_g_get_frame (struct usb_gadget *_gadget)
 	return tv.tv_usec / 1000;
 }
 
+static int dummy_wakeup (struct usb_gadget *_gadget)
+{
+	struct dummy	*dum;
+
+	dum = container_of (_gadget, struct dummy, gadget);
+	if ((dum->devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) == 0
+			|| !(dum->port_status & (1 << USB_PORT_FEAT_SUSPEND)))
+		return -EINVAL;
+
+	/* hub notices our request, issues downstream resume, etc */
+	dum->resuming = 1;
+	dum->port_status |= (1 << USB_PORT_FEAT_C_SUSPEND);
+	return 0;
+}
+
+static int dummy_set_selfpowered (struct usb_gadget *_gadget, int value)
+{
+	struct dummy	*dum;
+
+	dum = container_of (_gadget, struct dummy, gadget);
+	if (value)
+		dum->devstatus |= (1 << USB_DEVICE_SELF_POWERED);
+	else
+		dum->devstatus &= ~(1 << USB_DEVICE_SELF_POWERED);
+	return 0;
+}
+
 static const struct usb_gadget_ops dummy_ops = {
 	.get_frame	= dummy_g_get_frame,
+	.wakeup		= dummy_wakeup,
+	.set_selfpowered = dummy_set_selfpowered,
 };
 
 /*-------------------------------------------------------------------------*/
@@ -653,6 +685,9 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	dum->gadget.ops = &dummy_ops;
 	dum->gadget.is_dualspeed = 1;
 
+	dum->devstatus = 0;
+	dum->resuming = 0;
+
 	INIT_LIST_HEAD (&dum->gadget.ep_list);
 	for (i = 0; i < DUMMY_ENDPOINTS; i++) {
 		struct dummy_ep	*ep = &dum->ep [i];
@@ -1130,8 +1165,19 @@ restart:
 				break;
 			case USB_REQ_SET_FEATURE:
 				if (setup.bRequestType == Dev_Request) {
-					// remote wakeup, and (hs) test mode
-					value = -EOPNOTSUPP;
+					value = 0;
+					switch (setup.wValue) {
+					case USB_DEVICE_REMOTE_WAKEUP:
+						break;
+					default:
+						value = -EOPNOTSUPP;
+					}
+					if (value == 0) {
+						dum->devstatus |=
+							(1 << setup.wValue);
+						maybe_set_status (urb, 0);
+					}
+
 				} else if (setup.bRequestType == Ep_Request) {
 					// endpoint halt
 					ep2 = find_endpoint (dum,
@@ -1147,9 +1193,17 @@ restart:
 				break;
 			case USB_REQ_CLEAR_FEATURE:
 				if (setup.bRequestType == Dev_Request) {
-					// remote wakeup
-					value = 0;
-					maybe_set_status (urb, 0);
+					switch (setup.wValue) {
+					case USB_DEVICE_REMOTE_WAKEUP:
+						dum->devstatus &= ~(1 <<
+							USB_DEVICE_REMOTE_WAKEUP);
+						value = 0;
+						maybe_set_status (urb, 0);
+						break;
+					default:
+						value = -EOPNOTSUPP;
+						break;
+					}
 				} else if (setup.bRequestType == Ep_Request) {
 					// endpoint halt
 					ep2 = find_endpoint (dum,
@@ -1185,6 +1239,10 @@ restart:
 		break;
 	}
 	buf [0] = ep2->halted;
+						} else if (setup.bRequestType ==
+								Dev_InRequest) {
+							buf [0] = (u8)
+								dum->devstatus;
 						} else
 							buf [0] = 0;
 					}
@@ -1338,8 +1396,21 @@ static int dummy_hub_control (
 	case ClearHubFeature:
 		break;
 	case ClearPortFeature:
-		// FIXME won't some of these need special handling?
-		dum->port_status &= ~(1 << wValue);
+		switch (wValue) {
+		case USB_PORT_FEAT_SUSPEND:
+			/* 20msec resume signaling */
+			dum->resuming = 1;
+			dum->re_timeout = jiffies + ((HZ * 20)/1000);
+			break;
+		case USB_PORT_FEAT_POWER:
+			dum->port_status = 0;
+			dum->address = 0;
+			dum->hdev = 0;
+			dum->resuming = 0;
+			break;
+		default:
+			dum->port_status &= ~(1 << wValue);
+		}
 		break;
 	case GetHubDescriptor:
 		hub_descriptor ((struct usb_hub_descriptor *) buf);
@@ -1350,33 +1421,28 @@ static int dummy_hub_control (
 	case GetPortStatus:
 		if (wIndex != 1)
 			retval = -EPIPE;
-		((u16 *) buf)[0] = cpu_to_le16 (dum->port_status);
-		((u16 *) buf)[1] = cpu_to_le16 (dum->port_status >> 16);
-		break;
-	case SetHubFeature:
-		retval = -EPIPE;
-		break;
-	case SetPortFeature:
-		if (wValue == USB_PORT_FEAT_RESET) {
-			/* if it's already running, disconnect first */
-			if (dum->port_status & USB_PORT_STAT_ENABLE) {
-				dum->port_status &= ~(USB_PORT_STAT_ENABLE
-						| USB_PORT_STAT_LOW_SPEED
-						| USB_PORT_STAT_HIGH_SPEED);
-				if (dum->driver) {
-					dev_dbg (hardware, "disconnect\n");
-					stop_activity (dum, dum->driver);
-				}
 
-				/* FIXME test that code path! */
-			} else
-				dum->port_status |=
-					(1 << USB_PORT_FEAT_C_ENABLE);
-
-			dum->port_status |= USB_PORT_STAT_ENABLE |
-				  (1 << USB_PORT_FEAT_C_RESET);
+		/* whoever resets or resumes must GetPortStatus to
+		 * complete it!!
+		 */
+		if (dum->resuming && time_after (jiffies, dum->re_timeout)) {
+			dum->port_status |= (1 << USB_PORT_FEAT_C_SUSPEND);
+			dum->port_status &= ~(1 << USB_PORT_FEAT_SUSPEND);
+			dum->resuming = 0;
+			dum->re_timeout = 0;
+			if (dum->driver->resume) {
+				spin_unlock (&dum->lock);
+				dum->driver->resume (&dum->gadget);
+				spin_lock (&dum->lock);
+			}
+		}
+		if ((dum->port_status & (1 << USB_PORT_FEAT_RESET)) != 0
+				&& time_after (jiffies, dum->re_timeout)) {
+			dum->port_status |= (1 << USB_PORT_FEAT_C_RESET);
+			dum->port_status &= ~(1 << USB_PORT_FEAT_RESET);
+			dum->re_timeout = 0;
 			if (dum->driver) {
-
+				dum->port_status |= USB_PORT_STAT_ENABLE;
 				/* give it the best speed we agree on */
 				dum->gadget.speed = dum->driver->speed;
 				dum->gadget.ep0->maxpacket = 64;
@@ -1395,8 +1461,42 @@ static int dummy_hub_control (
 					break;
 				}
 			}
-		} else
+		}
+		((u16 *) buf)[0] = cpu_to_le16 (dum->port_status);
+		((u16 *) buf)[1] = cpu_to_le16 (dum->port_status >> 16);
+		break;
+	case SetHubFeature:
+		retval = -EPIPE;
+		break;
+	case SetPortFeature:
+		switch (wValue) {
+		case USB_PORT_FEAT_SUSPEND:
+			dum->port_status |= (1 << USB_PORT_FEAT_SUSPEND);
+			if (dum->driver->suspend) {
+				spin_unlock (&dum->lock);
+				dum->driver->suspend (&dum->gadget);
+				spin_lock (&dum->lock);
+			}
+			break;
+		case USB_PORT_FEAT_RESET:
+			/* if it's already running, disconnect first */
+			if (dum->port_status & USB_PORT_STAT_ENABLE) {
+				dum->port_status &= ~(USB_PORT_STAT_ENABLE
+						| USB_PORT_STAT_LOW_SPEED
+						| USB_PORT_STAT_HIGH_SPEED);
+				if (dum->driver) {
+					dev_dbg (hardware, "disconnect\n");
+					stop_activity (dum, dum->driver);
+				}
+
+				/* FIXME test that code path! */
+			}
+			/* 50msec reset signaling */
+			dum->re_timeout = jiffies + ((HZ * 50)/1000);
+			/* FALLTHROUGH */
+		default:
 			dum->port_status |= (1 << wValue);
+		}
 		break;
 
 	default:
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index b15c44a5c..a67ba2632 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -96,7 +96,8 @@ ep_matches (
 				/* for now, avoid PXA "interrupt-in";
 				 * it's documented as never using DATA1.
 				 */
-				if (gadget_is_pxa (gadget))
+				if (gadget_is_pxa (gadget)
+						&& 'i' == tmp [1])
 					return 0;
 				break;
 			case USB_ENDPOINT_XFER_BULK:
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 7c86d1588..2891eeeef 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -40,6 +40,7 @@
 #include <linux/version.h>
 #include <linux/device.h>
 #include <linux/moduleparam.h>
+#include <linux/ctype.h>
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
@@ -117,6 +118,7 @@ struct eth_dev {
 	unsigned		zlp:1;
 	unsigned		cdc:1;
 	unsigned		rndis:1;
+	u16			cdc_filter;
 	unsigned long		todo;
 #define	WORK_RX_MEMORY		0
 	int			rndis_config;
@@ -192,6 +194,16 @@ static char *__initdata iProduct;
 module_param(iProduct, charp, S_IRUGO);
 MODULE_PARM_DESC(iProduct, "USB Product string");
 
+/* initial value, changed by "ifconfig usb0 hw ether xx:xx:xx:xx:xx:xx" */
+static char *__initdata dev_addr;
+module_param(dev_addr, charp, S_IRUGO);
+MODULE_PARM_DESC(iProduct, "Device Ethernet Address");
+
+/* this address is invisible to ifconfig */
+static char *__initdata host_addr;
+module_param(host_addr, charp, S_IRUGO);
+MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
+
 
 /*-------------------------------------------------------------------------*/
 
@@ -1139,6 +1151,9 @@ eth_set_config (struct eth_dev *dev, unsigned number, int gfp_flags)
 	}
 	eth_reset_config (dev);
 
+	/* default:  pass all packets, no multicast filtering */
+	dev->cdc_filter = 0x000f;
+
 	switch (number) {
 	case DEV_CONFIG_VALUE:
 		dev->rndis = 0;
@@ -1311,9 +1326,20 @@ static void eth_setup_complete (struct usb_ep *ep, struct usb_request *req)
  * section 3.6.2.1 table 4 has ACM requests; RNDIS requires the
  * encapsulated command mechanism.
  */
-#define CDC_SEND_ENCAPSULATED_COMMAND	0x00	/* optional */
-#define CDC_GET_ENCAPSULATED_RESPONSE	0x01	/* optional */
-#define CDC_SET_ETHERNET_PACKET_FILTER	0x43	/* required */
+#define CDC_SEND_ENCAPSULATED_COMMAND		0x00	/* optional */
+#define CDC_GET_ENCAPSULATED_RESPONSE		0x01	/* optional */
+#define CDC_SET_ETHERNET_MULTICAST_FILTERS	0x40	/* optional */
+#define CDC_SET_ETHERNET_PM_PATTERN_FILTER	0x41	/* optional */
+#define CDC_GET_ETHERNET_PM_PATTERN_FILTER	0x42	/* optional */
+#define CDC_SET_ETHERNET_PACKET_FILTER		0x43	/* required */
+#define CDC_GET_ETHERNET_STATISTIC		0x44	/* optional */
+
+/* table 62; bits in cdc_filter */
+#define	CDC_PACKET_TYPE_PROMISCUOUS		(1 << 0)
+#define	CDC_PACKET_TYPE_ALL_MULTICAST		(1 << 1) /* no filter */
+#define	CDC_PACKET_TYPE_DIRECTED		(1 << 2)
+#define	CDC_PACKET_TYPE_BROADCAST		(1 << 3)
+#define	CDC_PACKET_TYPE_MULTICAST		(1 << 4) /* filtered */
 
 #ifdef CONFIG_USB_ETH_RNDIS
 
@@ -1513,8 +1539,9 @@ done_set_intf:
 		DEBUG (dev, "NOP packet filter %04x\n", ctrl->wValue);
 		/* NOTE: table 62 has 5 filter bits to reduce traffic,
 		 * and we "must" support multicast and promiscuous.
-		 * this NOP implements a bad filter...
+		 * this NOP implements a bad filter (always promisc)
 		 */
+		dev->cdc_filter = ctrl->wValue;
 		value = 0;
 		break;
 #endif /* DEV_CONFIG_CDC */
@@ -1624,12 +1651,12 @@ static struct net_device_stats *eth_get_stats (struct net_device *net)
 	return &((struct eth_dev *) net->priv)->stats;
 }
 
-static int eth_ethtool_ioctl (struct net_device *net, void *useraddr)
+static int eth_ethtool_ioctl (struct net_device *net, void __user *useraddr)
 {
 	struct eth_dev	*dev = (struct eth_dev *) net->priv;
 	u32		cmd;
 
-	if (get_user (cmd, (u32 *)useraddr))
+	if (get_user (cmd, (u32 __user *)useraddr))
 		return -EFAULT;
 	switch (cmd) {
 
@@ -1667,7 +1694,7 @@ static int eth_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
 {
 	switch (cmd) {
 	case SIOCETHTOOL:
-		return eth_ethtool_ioctl (net, (void *)rq->ifr_data);
+		return eth_ethtool_ioctl(net, rq->ifr_data);
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -1942,6 +1969,11 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
 	struct usb_request	*req = 0;
 	unsigned long		flags;
 
+	/* FIXME check dev->cdc_filter to decide whether to send this,
+	 * instead of acting as if CDC_PACKET_TYPE_PROMISCUOUS were
+	 * always set.  RNDIS has the same kind of outgoing filter.
+	 */
+
 	spin_lock_irqsave (&dev->lock, flags);
 	req = container_of (dev->tx_reqs.next, struct usb_request, list);
 	list_del (&req->list);
@@ -2178,6 +2210,36 @@ eth_unbind (struct usb_gadget *gadget)
 	set_gadget_data (gadget, 0);
 }
 
+static u8 __init nibble (unsigned char c)
+{
+	if (likely (isdigit (c)))
+		return c - '0';
+	c = toupper (c);
+	if (likely (isxdigit (c)))
+		return 10 + c - 'A';
+	return 0;
+}
+
+static void __init get_ether_addr (const char *str, u8 *dev_addr)
+{
+	if (str) {
+		unsigned	i;
+
+		for (i = 0; i < 6; i++) {
+			unsigned char num;
+
+			if((*str == '.') || (*str == ':'))
+				str++;
+			num = nibble(*str++) << 4;
+			num |= (nibble(*str++));
+			dev_addr [i] = num;
+		}
+		if (is_valid_ether_addr (dev_addr))
+			return;
+	}
+	random_ether_addr(dev_addr);
+}
+
 static int __init
 eth_bind (struct usb_gadget *gadget)
 {
@@ -2372,21 +2434,13 @@ autoconf_fail:
 	dev->cdc = cdc;
 	dev->zlp = zlp;
 
-	/* FIXME make these addresses configurable with module params.
-	 * also the manufacturer and product strings.
-	 */
-
-	/* one random address for the gadget device ... both of these could
-	 * reasonably come from an id prom or a module parameter.
-	 */
-	random_ether_addr(net->dev_addr);
-
-	/* ... another address for the host, on the other end of the
-	 * link, gets exported through CDC (see CDC spec table 41)
-	 * and RNDIS.
+	/* Module params for these addresses should come from ID proms.
+	 * The host side address is used with CDC and RNDIS, and commonly
+	 * end ups in a persistent config database.
 	 */
+	get_ether_addr(dev_addr, net->dev_addr);
 	if (cdc || rndis) {
-		random_ether_addr(dev->host_mac);
+		get_ether_addr(host_addr, dev->host_mac);
 #ifdef	DEV_CONFIG_CDC
 		snprintf (ethaddr, sizeof ethaddr, "%02X%02X%02X%02X%02X%02X",
 			dev->host_mac [0], dev->host_mac [1],
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 9a78238f6..55f424691 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -2054,7 +2054,7 @@ static int do_request_sense(struct fsg_dev *fsg, struct fsg_buffhd *bh)
 	buf[0] = 0x80 | 0x70;			// Valid, current error
 	buf[2] = SK(sd);
 	put_be32(&buf[3], sdinfo);		// Sense information
-	buf[7] = 18 - 7;			// Additional sense length
+	buf[7] = 18 - 8;			// Additional sense length
 	buf[12] = ASC(sd);
 	buf[13] = ASCQ(sd);
 	return 18;
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index dfb3de0a3..3093bceb9 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -20,7 +20,7 @@
 #define	gadget_is_dummy(g)	0
 #endif
 
-#ifdef CONFIG_USB_GADGET_PXA
+#ifdef CONFIG_USB_GADGET_PXA2XX
 #define	gadget_is_pxa(g)	!strcmp("pxa2xx_udc", (g)->name)
 #else
 #define	gadget_is_pxa(g)	0
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 4e40342f1..4ad4d2f7f 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -51,6 +51,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/system.h>
+#include <asm/mach-types.h>
 #include <asm/unaligned.h>
 #include <asm/hardware.h>
 
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index a85cf7a6c..fd4e8002e 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -22,6 +22,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/version.h>
@@ -51,7 +52,7 @@
 #define DEBUG if (rndis_debug) printk 
 static int rndis_debug = 0;
 
-MODULE_PARM (rndis_debug, "i");
+module_param (rndis_debug, bool, 0);
 MODULE_PARM_DESC (rndis_debug, "enable debugging");
 
 #else
@@ -78,44 +79,6 @@ static int rndis_keepalive_response (int configNr,
 
 static rndis_resp_t *rndis_add_response (int configNr, u32 length);
 
-/* helper functions */
-static u32 devFlags2currentFilter (struct net_device *dev)
-{
-	u32 filter = 0;
-	
-	if (!dev) return 0;
-	
-	if (dev->flags & IFF_MULTICAST) 
-	    filter |= NDIS_PACKET_TYPE_MULTICAST;
-	if (dev->flags & IFF_BROADCAST)
-	    filter |= NDIS_PACKET_TYPE_BROADCAST;
-	if (dev->flags & IFF_ALLMULTI)
-	    filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
-	if (dev->flags & IFF_PROMISC)
-	    filter |= NDIS_PACKET_TYPE_PROMISCUOUS;
-	
-	return filter;
-}
-
-static void currentFilter2devFlags (u32 currentFilter, struct net_device *dev)
-{
-	/* FIXME the filter is supposed to control what gets
-	 * forwarded from gadget to host; but dev->flags controls
-	 * reporting from host to gadget ...
-	 */
-#if 0
-	if (!dev) return;
-	if (currentFilter & NDIS_PACKET_TYPE_MULTICAST)
-	    dev->flags |= IFF_MULTICAST;
-	if (currentFilter & NDIS_PACKET_TYPE_BROADCAST)
-	    dev->flags |= IFF_BROADCAST;
-	if (currentFilter & NDIS_PACKET_TYPE_ALL_MULTICAST)
-	    dev->flags |= IFF_ALLMULTI;
-	if (currentFilter & NDIS_PACKET_TYPE_PROMISCUOUS)
-	    dev->flags |= IFF_PROMISC;
-#endif
-}
-
 /* FIXME OMITTED OIDs, that RNDIS-on-USB "must" support, include
  *  - power management (OID_PNP_CAPABILITIES, ...)
  *  - network wakeup (OID_PNP_ENABLE_WAKE_UP, ...)
@@ -252,13 +215,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 			rndis_per_dev_params [configNr].vendorDescr, length);
 		retval = 0;
 		break;
-		
+
 	/* mandatory */
 	case OID_GEN_CURRENT_PACKET_FILTER:
 		DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = devFlags2currentFilter (
-					rndis_per_dev_params [configNr].dev);
+		*((u32 *) resp + 6) = rndis_per_dev_params[configNr].filter;
 		retval = 0;
 		break;
 		
@@ -767,16 +729,24 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
 
 	switch (OID) {
 	case OID_GEN_CURRENT_PACKET_FILTER:
-		DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__);
 		params = &rndis_per_dev_params [configNr];
-		currentFilter2devFlags(cp[28], params->dev);
 		retval = 0;
 
+		/* FIXME use this NDIS_PACKET_TYPE_* bitflags to
+		 * filter packets in hard_start_xmit()
+		 * NDIS_PACKET_TYPE_x == CDC_PACKET_TYPE_x for x in:
+		 *	PROMISCUOUS, DIRECTED,
+		 *	MULTICAST, ALL_MULTICAST, BROADCAST
+		 */
+		params->filter = *(u32 *)buf;
+		DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
+			__FUNCTION__, params->filter);
+
 		/* this call has a significant side effect:  it's
 		 * what makes the packet flow start and stop, like
 		 * activating the CDC Ethernet altsetting.
 		 */
-		if (cp[28]) {
+		if (params->filter) {
 			params->state = RNDIS_DATA_INITIALIZED;
 			netif_carrier_on(params->dev);
 			if (netif_running(params->dev))
diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h
index 86719b31e..150ec8e5a 100644
--- a/drivers/usb/gadget/rndis.h
+++ b/drivers/usb/gadget/rndis.h
@@ -277,6 +277,7 @@ typedef struct rndis_params
 	u8			confignr;
 	int			used;
 	enum rndis_state	state;
+	u32			filter;
 	u32			medium;
 	u32			speed;
 	u32			media_state;
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index bd13911b7..ba646704d 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -33,7 +33,6 @@
 #include <linux/uts.h>
 #include <linux/version.h>
 #include <linux/wait.h>
-#include <linux/list.h>
 #include <linux/proc_fs.h>
 #include <linux/device.h>
 #include <linux/tty.h>
@@ -155,9 +154,8 @@ do {									\
 
 #define GS_CLOSE_TIMEOUT		15
 
-/* debug macro */
+/* debug settings */
 #if G_SERIAL_DEBUG
-
 static int debug = G_SERIAL_DEBUG;
 
 #define gs_debug(format, arg...) \
@@ -595,8 +593,10 @@ MODULE_DESCRIPTION(GS_LONG_NAME);
 MODULE_AUTHOR("Al Borchers");
 MODULE_LICENSE("GPL");
 
+#if G_SERIAL_DEBUG
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Enable debugging, 0=off, 1=on");
+#endif
 
 MODULE_PARM(read_q_size, "i");
 MODULE_PARM_DESC(read_q_size, "Read request queue size, default=32");
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 2e220d328..d779790d1 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -130,6 +130,9 @@ struct zero_dev {
 	 */
 	u8			config;
 	struct usb_ep		*in_ep, *out_ep;
+
+	/* autoresume timer */
+	struct timer_list	resume;
 };
 
 #define xprintk(d,level,fmt,args...) \
@@ -167,6 +170,12 @@ module_param (buflen, uint, S_IRUGO|S_IWUSR);
 module_param (qlen, uint, S_IRUGO|S_IWUSR);
 module_param (pattern, uint, S_IRUGO|S_IWUSR);
 
+/*
+ * if it's nonzero, autoresume says how many seconds to wait
+ * before trying to wake up the host after suspend.
+ */
+static unsigned autoresume = 0;
+module_param (autoresume, uint, 0);
 
 /*
  * Normally the "loopback" configuration is second (index 1) so
@@ -224,7 +233,7 @@ device_desc = {
 	.bNumConfigurations =	2,
 };
 
-static const struct usb_config_descriptor
+static struct usb_config_descriptor
 source_sink_config = {
 	.bLength =		sizeof source_sink_config,
 	.bDescriptorType =	USB_DT_CONFIG,
@@ -237,7 +246,7 @@ source_sink_config = {
 	.bMaxPower =		1,	/* self-powered */
 };
 
-static const struct usb_config_descriptor
+static struct usb_config_descriptor
 loopback_config = {
 	.bLength =		sizeof loopback_config,
 	.bDescriptorType =	USB_DT_CONFIG,
@@ -1060,6 +1069,19 @@ zero_disconnect (struct usb_gadget *gadget)
 	 */
 }
 
+static void
+zero_autoresume (unsigned long _dev)
+{
+	struct zero_dev	*dev = (struct zero_dev *) _dev;
+	int		status;
+
+	/* normally the host would be woken up for something
+	 * more significant than just a timer firing...
+	 */
+	status = usb_gadget_wakeup (dev->gadget);
+	DBG (dev, "wakeup --> %d\n", status);
+}
+
 /*-------------------------------------------------------------------------*/
 
 static void
@@ -1072,6 +1094,7 @@ zero_unbind (struct usb_gadget *gadget)
 	/* we've already been disconnected ... no i/o is active */
 	if (dev->req)
 		free_ep_req (gadget->ep0, dev->req);
+	del_timer_sync (&dev->resume);
 	kfree (dev);
 	set_gadget_data (gadget, 0);
 }
@@ -1176,6 +1199,14 @@ autoconf_fail:
 
 	usb_gadget_set_selfpowered (gadget);
 
+	init_timer (&dev->resume);
+	dev->resume.function = zero_autoresume;
+	dev->resume.data = (unsigned long) dev;
+	if (autoresume) {
+		source_sink_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+		loopback_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+	}
+
 	gadget->ep0->driver_data = dev;
 
 	INFO (dev, "%s, version: " DRIVER_VERSION "\n", longname);
@@ -1193,6 +1224,33 @@ enomem:
 	return -ENOMEM;
 }
 
+/*-------------------------------------------------------------------------*/
+
+static void
+zero_suspend (struct usb_gadget *gadget)
+{
+	struct zero_dev		*dev = get_gadget_data (gadget);
+
+	if (gadget->speed == USB_SPEED_UNKNOWN)
+		return;
+
+	if (autoresume) {
+		mod_timer (&dev->resume, jiffies + (HZ * autoresume));
+		DBG (dev, "suspend, wakeup in %d seconds\n", autoresume);
+	} else
+		DBG (dev, "suspend\n");
+}
+
+static void
+zero_resume (struct usb_gadget *gadget)
+{
+	struct zero_dev		*dev = get_gadget_data (gadget);
+
+	DBG (dev, "resume\n");
+	del_timer (&dev->resume);
+}
+
+
 /*-------------------------------------------------------------------------*/
 
 static struct usb_gadget_driver zero_driver = {
@@ -1208,6 +1266,9 @@ static struct usb_gadget_driver zero_driver = {
 	.setup		= zero_setup,
 	.disconnect	= zero_disconnect,
 
+	.suspend	= zero_suspend,
+	.resume		= zero_resume,
+
 	.driver 	= {
 		.name		= (char *) shortname,
 		// .shutdown = ...
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 530cfd9f8..8ade5dec0 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -170,6 +170,20 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
 		itd->index[6], itd->index[7]);
 }
 
+static void __attribute__((__unused__))
+dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) 
+{
+	ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n",
+		label, sitd->frame, sitd, le32_to_cpu(sitd->hw_next), sitd->urb);
+	ehci_dbg (ehci,
+		"  addr %08x sched %04x result %08x buf %08x %08x\n", 
+		le32_to_cpu(sitd->hw_fullspeed_ep),
+		le32_to_cpu(sitd->hw_uframe),
+		le32_to_cpu(sitd->hw_results),
+		le32_to_cpu(sitd->hw_buf [0]),
+		le32_to_cpu(sitd->hw_buf [1]));
+}
+
 static int __attribute__((__unused__))
 dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
 {
@@ -625,11 +639,20 @@ show_registers (struct class_device *class_dev, char *buf)
 
 	spin_lock_irqsave (&ehci->lock, flags);
 
+	if (bus->controller->power.power_state) {
+		size = scnprintf (next, size,
+			"bus %s, device %s (driver " DRIVER_VERSION ")\n"
+			"SUSPENDED (no register access)\n",
+			hcd->self.controller->bus->name,
+			hcd->self.controller->bus_id);
+		goto done;
+	}
+
 	/* Capability Registers */
 	i = HC_VERSION(readl (&ehci->caps->hc_capbase));
 	temp = scnprintf (next, size,
-		"bus %s device %s\n"
-		"EHCI %x.%02x, hcd state %d (driver " DRIVER_VERSION ")\n",
+		"bus %s, device %s (driver " DRIVER_VERSION ")\n"
+		"EHCI %x.%02x, hcd state %d\n",
 		hcd->self.controller->bus->name,
 		hcd->self.controller->bus_id,
 		i >> 8, i & 0x0ff, ehci->hcd.state);
@@ -672,7 +695,7 @@ show_registers (struct class_device *class_dev, char *buf)
 	next += temp;
 
 	for (i = 0; i < HCS_N_PORTS (ehci->hcs_params); i++) {
-		temp = dbg_port_buf (scratch, sizeof scratch, label, i,
+		temp = dbg_port_buf (scratch, sizeof scratch, label, i + 1,
 				readl (&ehci->regs->port_status [i]));
 		temp = scnprintf (next, size, fmt, temp, scratch);
 		size -= temp;
@@ -701,6 +724,7 @@ show_registers (struct class_device *class_dev, char *buf)
 	next += temp;
 #endif
 
+done:
 	spin_unlock_irqrestore (&ehci->lock, flags);
 
 	return PAGE_SIZE - size;
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 7a52853df..08fb7643b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 by David Brownell
+ * Copyright (c) 2000-2004 by David Brownell
  * 
  * 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
@@ -69,6 +69,7 @@
  *
  * HISTORY:
  *
+ * 2004-05-10 Root hub and PCI suspend/resume support; remote wakeup. (db)
  * 2004-02-24 Replace pci_* with generic dma_* API calls (dsaxena@plexity.net)
  * 2003-12-29 Rewritten high speed iso transfer support (by Michal Sojka,
  *	<sojkam@centrum.cz>, updates by DB).
@@ -96,7 +97,7 @@
  * 2001-June	Works with usb-storage and NEC EHCI on 2.4
  */
 
-#define DRIVER_VERSION "2003-Dec-29"
+#define DRIVER_VERSION "2004-May-10"
 #define DRIVER_AUTHOR "David Brownell"
 #define DRIVER_DESC "USB 2.0 'Enhanced' Host Controller (EHCI) Driver"
 
@@ -128,7 +129,7 @@ static int log2_irq_thresh = 0;		// 0 to 6
 module_param (log2_irq_thresh, int, S_IRUGO);
 MODULE_PARM_DESC (log2_irq_thresh, "log2 IRQ latency, 1-64 microframes");
 
-#define	INTR_MASK (STS_IAA | STS_FATAL | STS_ERR | STS_INT)
+#define	INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
 
 /*-------------------------------------------------------------------------*/
 
@@ -201,6 +202,7 @@ static int ehci_reset (struct ehci_hcd *ehci)
 	dbg_cmd (ehci, "reset", command);
 	writel (command, &ehci->regs->command);
 	ehci->hcd.state = USB_STATE_HALT;
+	ehci->next_statechange = jiffies;
 	return handshake (&ehci->regs->command, CMD_RESET, 0, 250 * 1000);
 }
 
@@ -241,6 +243,8 @@ static void ehci_ready (struct ehci_hcd *ehci)
 
 /*-------------------------------------------------------------------------*/
 
+static void ehci_work(struct ehci_hcd *ehci, struct pt_regs *regs);
+
 #include "ehci-hub.c"
 #include "ehci-mem.c"
 #include "ehci-q.c"
@@ -248,8 +252,6 @@ static void ehci_ready (struct ehci_hcd *ehci)
 
 /*-------------------------------------------------------------------------*/
 
-static void ehci_work(struct ehci_hcd *ehci, struct pt_regs *regs);
-
 static void ehci_watchdog (unsigned long param)
 {
 	struct ehci_hcd		*ehci = (struct ehci_hcd *) param;
@@ -295,7 +297,7 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
 
 		/* and wait a while for it to happen */
 		do {
-			wait_ms (10);
+			msleep(10);
 			msec -= 10;
 			pci_read_config_dword (to_pci_dev(ehci->hcd.self.controller), where, &cap);
 		} while ((cap & (1 << 16)) && msec);
@@ -428,12 +430,17 @@ static int ehci_start (struct usb_hcd *hcd)
 #ifdef	CONFIG_PCI
 	if (hcd->self.controller->bus == &pci_bus_type) {
 		struct pci_dev		*pdev;
+		u16			port_wake;
 
 		pdev = to_pci_dev(hcd->self.controller);
 
 		/* Serial Bus Release Number is at PCI 0x60 offset */
 		pci_read_config_byte(pdev, 0x60, &sbrn);
 
+		/* port wake capability, reported by boot firmware */
+		pci_read_config_word(pdev, 0x62, &port_wake);
+		hcd->can_wakeup = (port_wake & 1) != 0;
+
 		/* help hc dma work well with cachelines */
 		pci_set_mwi (pdev);
 
@@ -615,41 +622,26 @@ static int ehci_get_frame (struct usb_hcd *hcd)
 
 /* suspend/resume, section 4.3 */
 
+/* These routines rely on PCI to handle powerdown and wakeup, and
+ * transceivers that don't need any software attention to set up
+ * the right sort of wakeup.  
+ */
+
 static int ehci_suspend (struct usb_hcd *hcd, u32 state)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
-	int			ports;
-	int			i;
-
-	ehci_dbg (ehci, "suspend to %d\n", state);
-
-	ports = HCS_N_PORTS (ehci->hcs_params);
 
-	// FIXME:  This assumes what's probably a D3 level suspend...
+	while (time_before (jiffies, ehci->next_statechange))
+		msleep (100);
 
-	// FIXME:  usb wakeup events on this bus should resume the machine.
-	// pci config register PORTWAKECAP controls which ports can do it;
-	// bios may have initted the register...
-
-	/* suspend each port, then stop the hc */
-	for (i = 0; i < ports; i++) {
-		int	temp = readl (&ehci->regs->port_status [i]);
-
-		if ((temp & PORT_PE) == 0
-				|| (temp & PORT_OWNER) != 0)
-			continue;
-		ehci_dbg (ehci, "suspend port %d", i);
-		temp |= PORT_SUSPEND;
-		writel (temp, &ehci->regs->port_status [i]);
-	}
-
-	if (hcd->state == USB_STATE_RUNNING)
-		ehci_ready (ehci);
-	writel (readl (&ehci->regs->command) & ~CMD_RUN, &ehci->regs->command);
-
-// save pci FLADJ value
+#ifdef	CONFIG_USB_SUSPEND
+	(void) usb_suspend_device (hcd->self.root_hub);
+#else
+	/* FIXME lock root hub */
+	(void) ehci_hub_suspend (hcd);
+#endif
 
-	/* who tells PCI to reduce power consumption? */
+	// save (PCI) FLADJ in case of Vaux power loss
 
 	return 0;
 }
@@ -657,40 +649,22 @@ static int ehci_suspend (struct usb_hcd *hcd, u32 state)
 static int ehci_resume (struct usb_hcd *hcd)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
-	int			ports;
-	int			i;
-
-	ehci_dbg (ehci, "resume\n");
-
-	ports = HCS_N_PORTS (ehci->hcs_params);
-
-	// FIXME:  if controller didn't retain state,
-	// return and let generic code clean it up
-	// test configured_flag ?
-
-	/* resume HC and each port */
-// restore pci FLADJ value
-	// khubd and drivers will set HC running, if needed;
-	hcd->state = USB_STATE_RUNNING;
-	// FIXME Philips/Intel/... etc don't really have a "READY"
-	// state ... turn on CMD_RUN too
-	for (i = 0; i < ports; i++) {
-		int	temp = readl (&ehci->regs->port_status [i]);
-
-		if ((temp & PORT_PE) == 0
-				|| (temp & PORT_SUSPEND) != 0)
-			continue;
-		ehci_dbg (ehci, "resume port %d", i);
-		temp |= PORT_RESUME;
-		writel (temp, &ehci->regs->port_status [i]);
-		readl (&ehci->regs->command);	/* unblock posted writes */
-
-		wait_ms (20);
-		temp &= ~PORT_RESUME;
-		writel (temp, &ehci->regs->port_status [i]);
-	}
-	readl (&ehci->regs->command);	/* unblock posted writes */
-	return 0;
+	int			retval;
+
+	// maybe restore (PCI) FLADJ
+
+	while (time_before (jiffies, ehci->next_statechange))
+		msleep (100);
+
+#ifdef	CONFIG_USB_SUSPEND
+	retval = usb_resume_device (hcd->self.root_hub);
+#else
+	/* FIXME lock root hub */
+	retval = ehci_hub_resume (hcd);
+#endif
+	if (retval == 0)
+		hcd->self.controller->power.power_state = 0;
+	return retval;
 }
 
 #endif
@@ -752,7 +726,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
 	bh = 0;
 
 #ifdef	EHCI_VERBOSE_DEBUG
-	/* unrequested/ignored: Port Change Detect, Frame List Rollover */
+	/* unrequested/ignored: Frame List Rollover */
 	dbg_status (ehci, "irq", status);
 #endif
 
@@ -774,6 +748,34 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
 		bh = 1;
 	}
 
+	/* remote wakeup [4.3.1] */
+	if ((status & STS_PCD) && ehci->hcd.remote_wakeup) {
+		unsigned	i = HCS_N_PORTS (ehci->hcs_params);
+
+		/* resume root hub? */
+		status = readl (&ehci->regs->command);
+		if (!(status & CMD_RUN))
+			writel (status | CMD_RUN, &ehci->regs->command);
+
+		while (i--) {
+			status = readl (&ehci->regs->port_status [i]);
+			if (status & PORT_OWNER)
+				continue;
+			if (!(status & PORT_RESUME)
+					|| ehci->reset_done [i] != 0)
+				continue;
+
+			/* start 20 msec resume signaling from this port,
+			 * and make khubd collect PORT_STAT_C_SUSPEND to
+			 * stop that signaling.
+			 */
+			ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
+			mod_timer (&ehci->hcd.rh_timer,
+					ehci->reset_done [i] + 1);
+			ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
+		}
+	}
+
 	/* PCI errors [4.15.2.4] */
 	if (unlikely ((status & STS_FATAL) != 0)) {
 		ehci_err (ehci, "fatal error\n");
@@ -814,7 +816,6 @@ static int ehci_urb_enqueue (
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
 	struct list_head	qtd_list;
 
-	urb->transfer_flags &= ~EHCI_STATE_UNLINK;
 	INIT_LIST_HEAD (&qtd_list);
 
 	switch (usb_pipetype (urb->pipe)) {
@@ -914,7 +915,6 @@ static int ehci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb)
 
 		// wait till next completion, do it then.
 		// completion irqs can wait up to 1024 msec,
-		urb->transfer_flags |= EHCI_STATE_UNLINK;
 		break;
 	}
 	spin_unlock_irqrestore (&ehci->lock, flags);
@@ -965,7 +965,7 @@ idle_timeout:
 		goto rescan;
 	case QH_STATE_IDLE:		/* fully unlinked */
 		if (list_empty (&qh->qtd_list)) {
-			qh_put (ehci, qh);
+			qh_put (qh);
 			break;
 		}
 		/* else FALL THROUGH */
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 2113ff8df..f72102345 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -28,6 +28,131 @@
 
 /*-------------------------------------------------------------------------*/
 
+#ifdef	CONFIG_PM
+
+static int ehci_hub_suspend (struct usb_hcd *hcd)
+{
+	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	struct usb_device	*root = hcd_to_bus (&ehci->hcd)->root_hub;
+	int			port;
+	int			status = 0;
+
+	if (root->dev.power.power_state != 0)
+		return 0;
+	if (time_before (jiffies, ehci->next_statechange))
+		return -EAGAIN;
+
+	port = HCS_N_PORTS (ehci->hcs_params);
+	spin_lock_irq (&ehci->lock);
+
+	/* suspend any active/unsuspended ports, maybe allow wakeup */
+	while (port--) {
+		u32	t1 = readl (&ehci->regs->port_status [port]);
+		u32	t2 = t1;
+
+		if ((t1 & PORT_PE) && !(t1 & PORT_OWNER))
+			t2 |= PORT_SUSPEND;
+		if (ehci->hcd.remote_wakeup)
+			t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E;
+		else
+			t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);
+
+		if (t1 != t2) {
+			ehci_vdbg (ehci, "port %d, %08x -> %08x\n",
+				port + 1, t1, t2);
+			writel (t2, &ehci->regs->port_status [port]);
+		}
+	}
+
+	/* stop schedules, then turn off HC and clean any completed work */
+	if (hcd->state == USB_STATE_RUNNING)
+		ehci_ready (ehci);
+	ehci->command = readl (&ehci->regs->command);
+	writel (ehci->command & ~CMD_RUN, &ehci->regs->command);
+	if (ehci->reclaim)
+		ehci->reclaim_ready = 1;
+	ehci_work (ehci, 0);
+	(void) handshake (&ehci->regs->status, STS_HALT, STS_HALT, 2000);
+
+	root->dev.power.power_state = 3;
+	ehci->next_statechange = jiffies + msecs_to_jiffies(10);
+	spin_unlock_irq (&ehci->lock);
+	return status;
+}
+
+
+/* caller owns root->serialize, and should reset/reinit on error */
+static int ehci_hub_resume (struct usb_hcd *hcd)
+{
+	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	struct usb_device	*root = hcd_to_bus (&ehci->hcd)->root_hub;
+	u32			temp;
+	int			i;
+
+	if (!root->dev.power.power_state)
+		return 0;
+	if (time_before (jiffies, ehci->next_statechange))
+		return -EAGAIN;
+
+	/* re-init operational registers in case we lost power */
+	if (readl (&ehci->regs->intr_enable) == 0) {
+		writel (INTR_MASK, &ehci->regs->intr_enable);
+		writel (0, &ehci->regs->segment);
+		writel (ehci->periodic_dma, &ehci->regs->frame_list);
+		writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next);
+		/* FIXME will this work even (pci) vAUX was lost? */
+	}
+
+	/* restore CMD_RUN, framelist size, and irq threshold */
+	writel (ehci->command, &ehci->regs->command);
+
+	/* take ports out of suspend */
+	i = HCS_N_PORTS (ehci->hcs_params);
+	while (i--) {
+		temp = readl (&ehci->regs->port_status [i]);
+		temp &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);
+		if (temp & PORT_SUSPEND) {
+			ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
+			temp |= PORT_RESUME;
+		}
+		writel (temp, &ehci->regs->port_status [i]);
+	}
+	i = HCS_N_PORTS (ehci->hcs_params);
+	msleep (20);
+	while (i--) {
+		temp = readl (&ehci->regs->port_status [i]);
+		if ((temp & PORT_SUSPEND) == 0)
+			continue;
+		temp &= ~PORT_RESUME;
+		writel (temp, &ehci->regs->port_status [i]);
+		ehci_vdbg (ehci, "resumed port %d\n", i + 1);
+	}
+	(void) readl (&ehci->regs->command);
+
+	/* maybe re-activate the schedule(s) */
+	temp = 0;
+	if (ehci->async->qh_next.qh)
+		temp |= CMD_ASE;
+	if (ehci->periodic_sched)
+		temp |= CMD_PSE;
+	if (temp)
+		writel (ehci->command | temp, &ehci->regs->command);
+
+	root->dev.power.power_state = 0;
+	ehci->next_statechange = jiffies + msecs_to_jiffies(5);
+	ehci->hcd.state = USB_STATE_RUNNING;
+	return 0;
+}
+
+#else
+
+#define ehci_hub_suspend	0
+#define ehci_hub_resume		0
+
+#endif	/* CONFIG_PM */
+
+/*-------------------------------------------------------------------------*/
+
 static int check_reset_complete (
 	struct ehci_hcd	*ehci,
 	int		index,
@@ -99,7 +224,11 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
 		}
 		if (!(temp & PORT_CONNECT))
 			ehci->reset_done [i] = 0;
-		if ((temp & (PORT_CSC | PORT_PEC | PORT_OCC)) != 0) {
+		if ((temp & (PORT_CSC | PORT_PEC | PORT_OCC)) != 0
+				// PORT_STAT_C_SUSPEND?
+				|| ((temp & PORT_RESUME) != 0
+					&& time_after (jiffies,
+						ehci->reset_done [i]))) {
 			if (i < 7)
 			    buf [0] |= 1 << (i + 1);
 			else
@@ -143,6 +272,8 @@ ehci_hub_descriptor (
 
 /*-------------------------------------------------------------------------*/
 
+#define	PORT_WAKE_BITS 	(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
+
 static int ehci_hub_control (
 	struct usb_hcd	*hcd,
 	u16		typeReq,
@@ -194,8 +325,20 @@ static int ehci_hub_control (
 				&ehci->regs->port_status [wIndex]);
 			break;
 		case USB_PORT_FEAT_SUSPEND:
+			if (temp & PORT_RESET)
+				goto error;
+			if (temp & PORT_SUSPEND) {
+				if ((temp & PORT_PE) == 0)
+					goto error;
+				/* resume signaling for 20 msec */
+				writel ((temp & ~PORT_WAKE_BITS) | PORT_RESUME,
+					&ehci->regs->port_status [wIndex]);
+				ehci->reset_done [wIndex] = jiffies
+						+ msecs_to_jiffies (20);
+			}
+			break;
 		case USB_PORT_FEAT_C_SUSPEND:
-			/* ? */
+			/* we auto-clear this feature */
 			break;
 		case USB_PORT_FEAT_POWER:
 			if (HCS_PPC (ehci->hcs_params))
@@ -239,15 +382,37 @@ static int ehci_hub_control (
 			status |= 1 << USB_PORT_FEAT_C_CONNECTION;
 		if (temp & PORT_PEC)
 			status |= 1 << USB_PORT_FEAT_C_ENABLE;
-		// USB_PORT_FEAT_C_SUSPEND
 		if (temp & PORT_OCC)
 			status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT;
 
+		/* whoever resumes must GetPortStatus to complete it!! */
+		if ((temp & PORT_RESUME)
+				&& time_after (jiffies,
+					ehci->reset_done [wIndex])) {
+			status |= 1 << USB_PORT_FEAT_C_SUSPEND;
+			ehci->reset_done [wIndex] = 0;
+
+			/* stop resume signaling */
+			temp = readl (&ehci->regs->port_status [wIndex]);
+			writel (temp & ~PORT_RESUME,
+				&ehci->regs->port_status [wIndex]);
+			retval = handshake (
+					&ehci->regs->port_status [wIndex],
+					PORT_RESUME, 0, 2000 /* 2msec */);
+			if (retval != 0) {
+				ehci_err (ehci, "port %d resume error %d\n",
+					wIndex + 1, retval);
+				goto error;
+			}
+			temp &= ~(PORT_SUSPEND|PORT_RESUME|(3<<10));
+		}
+
 		/* whoever resets must GetPortStatus to complete it!! */
 		if ((temp & PORT_RESET)
 				&& time_after (jiffies,
 					ehci->reset_done [wIndex])) {
 			status |= 1 << USB_PORT_FEAT_C_RESET;
+			ehci->reset_done [wIndex] = 0;
 
 			/* force reset to complete */
 			writel (temp & ~PORT_RESET,
@@ -275,7 +440,7 @@ static int ehci_hub_control (
 			}
 			if (temp & PORT_PE)
 				status |= 1 << USB_PORT_FEAT_ENABLE;
-			if (temp & PORT_SUSPEND)
+			if (temp & (PORT_SUSPEND|PORT_RESUME))
 				status |= 1 << USB_PORT_FEAT_SUSPEND;
 			if (temp & PORT_OC)
 				status |= 1 << USB_PORT_FEAT_OVER_CURRENT;
@@ -312,6 +477,11 @@ static int ehci_hub_control (
 
 		switch (wValue) {
 		case USB_PORT_FEAT_SUSPEND:
+			if ((temp & PORT_PE) == 0
+					|| (temp & PORT_RESET) != 0)
+				goto error;
+			if (ehci->hcd.remote_wakeup)
+				temp |= PORT_WAKE_BITS;
 			writel (temp | PORT_SUSPEND,
 				&ehci->regs->port_status [wIndex]);
 			break;
@@ -321,6 +491,8 @@ static int ehci_hub_control (
 					&ehci->regs->port_status [wIndex]);
 			break;
 		case USB_PORT_FEAT_RESET:
+			if (temp & PORT_RESUME)
+				goto error;
 			/* line status bits may report this as low speed,
 			 * which can be fine if this root hub has a
 			 * transaction translator built in.
@@ -342,7 +514,7 @@ static int ehci_hub_control (
 				 * usb 2.0 spec says 50 ms resets on root
 				 */
 				ehci->reset_done [wIndex] = jiffies
-				    	+ ((50 /* msec */ * HZ) / 1000);
+						+ msecs_to_jiffies (50);
 			}
 			writel (temp, &ehci->regs->port_status [wIndex]);
 			break;
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index e04da1f58..5f9381622 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -87,6 +87,22 @@ static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd)
 }
 
 
+static void qh_destroy (struct kref *kref)
+{
+	struct ehci_qh *qh = container_of(kref, struct ehci_qh, kref);
+	struct ehci_hcd *ehci = qh->ehci;
+
+	/* clean qtds first, and know this is not linked */
+	if (!list_empty (&qh->qtd_list) || qh->qh_next.ptr) {
+		ehci_dbg (ehci, "unused qh not empty!\n");
+		BUG ();
+	}
+	if (qh->dummy)
+		ehci_qtd_free (ehci, qh->dummy);
+	usb_put_dev (qh->dev);
+	dma_pool_free (ehci->qh_pool, qh, qh->qh_dma);
+}
+
 static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags)
 {
 	struct ehci_qh		*qh;
@@ -98,7 +114,8 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags)
 		return qh;
 
 	memset (qh, 0, sizeof *qh);
-	atomic_set (&qh->refcount, 1);
+	kref_init(&qh->kref, qh_destroy);
+	qh->ehci = ehci;
 	qh->qh_dma = dma;
 	// INIT_LIST_HEAD (&qh->qh_list);
 	INIT_LIST_HEAD (&qh->qtd_list);
@@ -114,25 +131,15 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags)
 }
 
 /* to share a qh (cpu threads, or hc) */
-static inline struct ehci_qh *qh_get (/* ehci, */ struct ehci_qh *qh)
+static inline struct ehci_qh *qh_get (struct ehci_qh *qh)
 {
-	atomic_inc (&qh->refcount);
+	kref_get(&qh->kref);
 	return qh;
 }
 
-static void qh_put (struct ehci_hcd *ehci, struct ehci_qh *qh)
+static inline void qh_put (struct ehci_qh *qh)
 {
-	if (!atomic_dec_and_test (&qh->refcount))
-		return;
-	/* clean qtds first, and know this is not linked */
-	if (!list_empty (&qh->qtd_list) || qh->qh_next.ptr) {
-		ehci_dbg (ehci, "unused qh not empty!\n");
-		BUG ();
-	}
-	if (qh->dummy)
-		ehci_qtd_free (ehci, qh->dummy);
-	usb_put_dev (qh->dev);
-	dma_pool_free (ehci->qh_pool, qh, qh->qh_dma);
+	kref_put(&qh->kref);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -145,7 +152,7 @@ static void qh_put (struct ehci_hcd *ehci, struct ehci_qh *qh)
 static void ehci_mem_cleanup (struct ehci_hcd *ehci)
 {
 	if (ehci->async)
-		qh_put (ehci, ehci->async);
+		qh_put (ehci->async);
 	ehci->async = 0;
 
 	/* DMA consistent memory and pools */
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index fd8634b31..7c39b86d1 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -193,7 +193,7 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs)
 			/* ... update hc-wide periodic stats (for usbfs) */
 			hcd_to_bus (&ehci->hcd)->bandwidth_int_reqs--;
 		}
-		qh_put (ehci, qh);
+		qh_put (qh);
 	}
 
 	spin_lock (&urb->lock);
@@ -708,7 +708,7 @@ qh_make (
 	default:
  		dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed);
 done:
-		qh_put (ehci, qh);
+		qh_put (qh);
 		return 0;
 	}
 
@@ -951,7 +951,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
 	// qh->hw_next = cpu_to_le32 (qh->qh_dma);
 	qh->qh_state = QH_STATE_IDLE;
 	qh->qh_next.qh = 0;
-	qh_put (ehci, qh);			// refcount from reclaim 
+	qh_put (qh);			// refcount from reclaim 
 
 	/* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
 	next = qh->reclaim;
@@ -965,7 +965,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
 			&& HCD_IS_RUNNING (ehci->hcd.state))
 		qh_link_async (ehci, qh);
 	else {
-		qh_put (ehci, qh);		// refcount from async list
+		qh_put (qh);		// refcount from async list
 
 		/* it's not free to turn the async schedule on/off; leave it
 		 * active but idle for a while once it empties.
@@ -1067,7 +1067,7 @@ rescan:
 				qh = qh_get (qh);
 				qh->stamp = ehci->stamp;
 				temp = qh_completions (ehci, qh, regs);
-				qh_put (ehci, qh);
+				qh_put (qh);
 				if (temp != 0) {
 					goto rescan;
 				}
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index e067274ef..3682fb948 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -312,7 +312,7 @@ static void intr_deschedule (
 
 	do {
 		periodic_unlink (ehci, frame, qh);
-		qh_put (ehci, qh);
+		qh_put (qh);
 		frame += qh->period;
 	} while (frame < ehci->periodic_size);
 
@@ -355,7 +355,7 @@ static void intr_deschedule (
 
 	dbg ("descheduled qh %p, period = %d frame = %d count = %d, urbs = %d",
 		qh, qh->period, frame,
-		atomic_read (&qh->refcount), ehci->periodic_sched);
+		atomic_read (&qh->kref.refcount), ehci->periodic_sched);
 }
 
 static int check_period (
@@ -1846,7 +1846,7 @@ restart:
 				modified = qh_completions (ehci, temp.qh, regs);
 				if (unlikely (list_empty (&temp.qh->qtd_list)))
 					intr_deschedule (ehci, temp.qh, 0);
-				qh_put (ehci, temp.qh);
+				qh_put (temp.qh);
 				break;
 			case Q_TYPE_FSTN:
 				/* for "save place" FSTNs, look at QH entries
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 8cd5b7b2c..ed4d00291 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -84,6 +84,8 @@ struct ehci_hcd {			/* one per controller */
 	struct notifier_block	reboot_notifier;
 	unsigned long		actions;
 	unsigned		stamp;
+	unsigned long		next_statechange;
+	u32			command;
 
 	unsigned		is_arc_rh_tt:1;	/* ARC roothub with TT */
 
@@ -99,8 +101,6 @@ struct ehci_hcd {			/* one per controller */
 /* unwrap an HCD pointer to get an EHCI_HCD pointer */ 
 #define hcd_to_ehci(hcd_ptr) container_of(hcd_ptr, struct ehci_hcd, hcd)
 
-/* NOTE:  urb->transfer_flags expected to not use this bit !!! */
-#define EHCI_STATE_UNLINK	0x8000		/* urb being unlinked */
 
 enum ehci_timer_action {
 	TIMER_IO_WATCHDOG,
@@ -221,7 +221,7 @@ struct ehci_regs {
 	u32		segment; 	/* address bits 63:32 if needed */
 	/* PERIODICLISTBASE: offset 0x14 */
 	u32		frame_list; 	/* points to periodic list */
-	/* ASYNCICLISTADDR: offset 0x18 */
+	/* ASYNCLISTADDR: offset 0x18 */
 	u32		async_next;	/* address of next async queue head */
 
 	u32		reserved [9];
@@ -237,7 +237,10 @@ struct ehci_regs {
 #define PORT_WKDISC_E	(1<<21)		/* wake on disconnect (enable) */
 #define PORT_WKCONN_E	(1<<20)		/* wake on connect (enable) */
 /* 19:16 for port testing */
-/* 15:14 for using port indicator leds (if HCS_INDICATOR allows) */
+#define PORT_LED_OFF	(0<<14)
+#define PORT_LED_AMBER	(1<<14)
+#define PORT_LED_GREEN	(2<<14)
+#define PORT_LED_MASK	(3<<14)
 #define PORT_OWNER	(1<<13)		/* true: companion hc owns this port */
 #define PORT_POWER	(1<<12)		/* true: has power (see PPC) */
 #define PORT_USB11(x) (((x)&(3<<10))==(1<<10))	/* USB 1.1 device */
@@ -366,7 +369,8 @@ struct ehci_qh {
 	struct ehci_qtd		*dummy;
 	struct ehci_qh		*reclaim;	/* next to reclaim */
 
-	atomic_t		refcount;
+	struct ehci_hcd		*ehci;
+	struct kref		kref;
 	unsigned		stamp;
 
 	u8			qh_state;
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 8d2a7526a..3918eb3f2 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -617,7 +617,17 @@ show_registers (struct class_device *class_dev, char *buf)
 	/* dump driver info, then registers in spec order */
 
 	ohci_dbg_sw (ohci, &next, &size,
-		"%s version " DRIVER_VERSION "\n", hcd_name);
+		"bus %s, device %s\n"
+		"%s version " DRIVER_VERSION "\n",
+		hcd->self.controller->bus->name,
+		hcd->self.controller->bus_id,
+		hcd_name);
+
+	if (bus->controller->power.power_state) {
+		size -= scnprintf (next, size,
+			"SUSPENDED (no register access)\n");
+		goto done;
+	}
 
 	ohci_dump_status(ohci, &next, &size);
 
@@ -657,8 +667,8 @@ show_registers (struct class_device *class_dev, char *buf)
 	/* roothub */
 	ohci_dump_roothub (ohci, 1, &next, &size);
 
+done:
 	spin_unlock_irqrestore (&ohci->lock, flags);
-
 	return PAGE_SIZE - size;
 }
 static CLASS_DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 44144a553..b5279a019 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -117,8 +117,8 @@
 
 /* For initializing controller (mask in an HCFS mode too) */
 #define	OHCI_CONTROL_INIT 	OHCI_CTRL_CBSR
-
-#define OHCI_UNLINK_TIMEOUT	 (HZ / 10)
+#define	OHCI_INTR_INIT \
+	(OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_RD | OHCI_INTR_WDH)
 
 /*-------------------------------------------------------------------------*/
 
@@ -126,11 +126,6 @@ static const char	hcd_name [] = "ohci_hcd";
 
 #include "ohci.h"
 
-static inline void disable (struct ohci_hcd *ohci)
-{
-	ohci->hcd.state = USB_STATE_HALT;
-}
-
 #include "ohci-hub.c"
 #include "ohci-dbg.c"
 #include "ohci-mem.c"
@@ -206,8 +201,7 @@ static int ohci_urb_enqueue (
 	if (!urb_priv)
 		return -ENOMEM;
 	memset (urb_priv, 0, sizeof (urb_priv_t) + size * sizeof (struct td *));
-	
-	/* fill the private part of the URB */
+	INIT_LIST_HEAD (&urb_priv->pending);
 	urb_priv->length = size;
 	urb_priv->ed = ed;	
 
@@ -397,6 +391,16 @@ static int hc_reset (struct ohci_hcd *ohci)
 {
 	u32 temp;
 
+	/* boot firmware should have set this up (5.1.1.3.1) */
+	if (!ohci->fminterval) {
+		temp = readl (&ohci->regs->fminterval);
+		if (temp & 0x3fff0000)
+			ohci->fminterval = temp;
+		else
+			ohci->fminterval = DEFAULT_FMINTERVAL;
+		/* also: power/overcurrent flags in roothub.a */
+	}
+
 	/* SMM owns the HC?  not for long!
 	 * On PA-RISC, PDC can leave IR set incorrectly; ignore it there.
 	 */
@@ -413,7 +417,7 @@ static int hc_reset (struct ohci_hcd *ohci)
 		writel (OHCI_INTR_OC, &ohci->regs->intrenable);
 		writel (OHCI_OCR, &ohci->regs->cmdstatus);
 		while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
-			wait_ms (10);
+			msleep (10);
 			if (--temp == 0) {
 				ohci_err (ohci, "USB HC TakeOver failed!\n");
 				return -1;
@@ -430,9 +434,12 @@ static int hc_reset (struct ohci_hcd *ohci)
 
   	/* Reset USB (needed by some controllers); RemoteWakeupConnected
 	 * saved if boot firmware (BIOS/SMM/...) told us it's connected
+	 * (for OHCI integrated on mainboard, it normally is)
 	 */
 	ohci->hc_control = readl (&ohci->regs->control);
 	ohci->hc_control &= OHCI_CTRL_RWC;	/* hcfs 0 = RESET */
+	if (ohci->hc_control)
+		ohci->hcd.can_wakeup = 1;
 	writel (ohci->hc_control, &ohci->regs->control);
 	if (power_switching) {
 		unsigned ports = roothub_a (ohci) & RH_A_NDP; 
@@ -444,7 +451,7 @@ static int hc_reset (struct ohci_hcd *ohci)
 	}
 	// flush those pci writes
 	(void) readl (&ohci->regs->control);
-	wait_ms (50);
+	msleep (50);
 
 	/* HC Reset requires max 10 us delay */
 	writel (OHCI_HCR,  &ohci->regs->cmdstatus);
@@ -473,9 +480,6 @@ static int hc_reset (struct ohci_hcd *ohci)
 
 /*-------------------------------------------------------------------------*/
 
-#define	FI		0x2edf		/* 12000 bits per frame (-1) */
-#define LSTHRESH	0x628		/* lowspeed bit threshold */
-
 /* Start an OHCI controller, set the BUS operational
  * enable interrupts 
  * connect the virtual root hub
@@ -486,7 +490,6 @@ static int hc_start (struct ohci_hcd *ohci)
   	struct usb_device	*udev;
   	struct usb_bus		*bus;
 
-	spin_lock_init (&ohci->lock);
 	disable (ohci);
 
 	/* Tell the controller where the control and bulk lists are
@@ -497,12 +500,7 @@ static int hc_start (struct ohci_hcd *ohci)
 	/* a reset clears this */
 	writel ((u32) ohci->hcca_dma, &ohci->regs->hcca);
 
-	/* force default fmInterval (we won't adjust it); init thresholds
-	 * for last FS and LS packets, reserve 90% for periodic.
-	 */
-	writel ((((6 * (FI - 210)) / 7) << 16) | FI, &ohci->regs->fminterval);
-	writel (((9 * FI) / 10) & 0x3fff, &ohci->regs->periodicstart);
-	writel (LSTHRESH, &ohci->regs->lsthresh);
+	periodic_reinit (ohci);
 
 	/* some OHCI implementations are finicky about how they init.
 	 * bogus values here mean not even enumeration could work.
@@ -519,8 +517,11 @@ static int hc_start (struct ohci_hcd *ohci)
  	writel (ohci->hc_control, &ohci->regs->control);
 	ohci->hcd.state = USB_STATE_RUNNING;
 
+	/* wake on ConnectStatusChange, matching external hubs */
+	writel (RH_HS_DRWE, &ohci->regs->roothub.status);
+
 	/* Choose the interrupts we care about now, others later on demand */
-	mask = OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_WDH;
+	mask = OHCI_INTR_INIT;
 	writel (mask, &ohci->regs->intrstatus);
 	writel (mask, &ohci->regs->intrenable);
 
@@ -551,9 +552,14 @@ static int hc_start (struct ohci_hcd *ohci)
 
 	// POTPGT delay is bits 24-31, in 2 ms units.
 	mdelay ((roothub_a (ohci) >> 23) & 0x1fe);
+	bus = hcd_to_bus (&ohci->hcd);
+
+	if (bus->root_hub) {
+		ohci->hcd.state = USB_STATE_RUNNING;
+		return 0;
+	}
  
 	/* connect the virtual root hub */
-	bus = hcd_to_bus (&ohci->hcd);
 	bus->root_hub = udev = usb_alloc_dev (NULL, bus, 0);
 	ohci->hcd.state = USB_STATE_RUNNING;
 	if (!udev) {
@@ -610,11 +616,18 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
 		ohci_dump (ohci, 1);
 		hc_reset (ohci);
 	}
-  
+
+	if (ints & OHCI_INTR_RD) {
+		ohci_vdbg (ohci, "resume detect\n");
+		schedule_work(&ohci->rh_resume);
+	}
+
 	if (ints & OHCI_INTR_WDH) {
 		if (HCD_IS_RUNNING(hcd->state))
 			writel (OHCI_INTR_WDH, &regs->intrdisable);	
-		dl_done_list (ohci, dl_reverse_done_list (ohci), ptregs);
+		spin_lock (&ohci->lock);
+		dl_done_list (ohci, ptregs);
+		spin_unlock (&ohci->lock);
 		if (HCD_IS_RUNNING(hcd->state))
 			writel (OHCI_INTR_WDH, &regs->intrenable); 
 	}
@@ -654,6 +667,7 @@ static void ohci_stop (struct usb_hcd *hcd)
 		ohci->hcd.state);
 	ohci_dump (ohci, 1);
 
+	flush_scheduled_work();
 	if (HCD_IS_RUNNING(ohci->hcd.state))
 		hc_reset (ohci);
 	
@@ -670,22 +684,68 @@ static void ohci_stop (struct usb_hcd *hcd)
 
 /*-------------------------------------------------------------------------*/
 
-// FIXME:  this restart logic should be generic,
-// and handle full hcd state cleanup
-
-/* controller died; cleanup debris, then restart */
 /* must not be called from interrupt context */
 
 #ifdef CONFIG_PM
+
+static void mark_children_gone (struct usb_device *dev)
+{
+	unsigned i;
+
+	for (i = 0; i < dev->maxchild; i++) {
+		if (dev->children [i] == 0)
+			continue;
+		dev->children [i]->state = USB_STATE_NOTATTACHED;
+		mark_children_gone (dev->children [i]);
+	}
+}
+
 static int hc_restart (struct ohci_hcd *ohci)
 {
 	int temp;
 	int i;
-
+	struct urb_priv *priv;
+
+	/* mark any devices gone, so they do nothing till khubd disconnects.
+	 * recycle any "live" eds/tds (and urbs) right away.
+	 * later, khubd disconnect processing will recycle the other state,
+	 * (either as disconnect/reconnect, or maybe someday as a reset).
+	 */ 
+	spin_lock_irq(&ohci->lock);
 	disable (ohci);
-	if (hcd_to_bus (&ohci->hcd)->root_hub)
-		usb_disconnect (&hcd_to_bus (&ohci->hcd)->root_hub);
-	
+	mark_children_gone (ohci->hcd.self.root_hub);
+	if (!list_empty (&ohci->pending))
+		ohci_dbg(ohci, "abort schedule...\n");
+	list_for_each_entry (priv, &ohci->pending, pending) {
+		struct urb	*urb = priv->td[0]->urb;
+		struct ed	*ed = priv->ed;
+
+		switch (ed->state) {
+		case ED_OPER:
+			ed->state = ED_UNLINK;
+			ed->hwINFO |= ED_DEQUEUE;
+			ed_deschedule (ohci, ed);
+
+			ed->ed_next = ohci->ed_rm_list;
+			ed->ed_prev = 0;
+			ohci->ed_rm_list = ed;
+			/* FALLTHROUGH */
+		case ED_UNLINK:
+			break;
+		default:
+			ohci_dbg(ohci, "bogus ed %p state %d\n",
+					ed, ed->state);
+		}
+
+		spin_lock (&urb->lock);
+		urb->status = -ESHUTDOWN;
+		spin_unlock (&urb->lock);
+	}
+	finish_unlinks (ohci, 0, 0);
+	spin_unlock_irq(&ohci->lock);
+
+	/* paranoia, in case that didn't work: */
+
 	/* empty the interrupt branches */
 	for (i = 0; i < NUM_INTS; i++) ohci->load [i] = 0;
 	for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table [i] = 0;
@@ -700,8 +760,20 @@ static int hc_restart (struct ohci_hcd *ohci)
 	if ((temp = hc_reset (ohci)) < 0 || (temp = hc_start (ohci)) < 0) {
 		ohci_err (ohci, "can't restart, %d\n", temp);
 		return temp;
-	} else
+	} else {
+		/* here we "know" root ports should always stay powered,
+		 * and that if we try to turn them back on the root hub
+		 * will respond to CSC processing.
+		 */
+		i = roothub_a (ohci) & RH_A_NDP;
+		while (i--)
+			writel (RH_PS_PSS,
+				&ohci->regs->roothub.portstatus [temp]);
+		ohci->hcd.self.root_hub->dev.power.power_state = 0;
+		ohci->hcd.state = USB_STATE_RUNNING;
 		ohci_dbg (ohci, "restart complete\n");
+		ohci_dump (ohci, 1);
+	}
 	return 0;
 }
 #endif
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 25aa7c85c..516d87d9c 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -60,6 +60,261 @@ static u32 roothub_portstatus (struct ohci_hcd *hc, int i)
 		(temp & RH_PS_CCS) ? " CCS" : "" \
 		);
 
+/*-------------------------------------------------------------------------*/
+
+#if	defined(CONFIG_USB_SUSPEND) || defined(CONFIG_PM)
+
+#define OHCI_SCHED_ENABLES \
+	(OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE)
+
+static void dl_done_list (struct ohci_hcd *, struct pt_regs *);
+static void finish_unlinks (struct ohci_hcd *, u16 , struct pt_regs *);
+
+static int ohci_hub_suspend (struct usb_hcd *hcd)
+{
+	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
+	struct usb_device	*root = hcd_to_bus (&ohci->hcd)->root_hub;
+	int			status = 0;
+
+	if (root->dev.power.power_state != 0)
+		return 0;
+	if (time_before (jiffies, ohci->next_statechange))
+		return -EAGAIN;
+
+	spin_lock_irq (&ohci->lock);
+
+	ohci->hc_control = readl (&ohci->regs->control);
+	switch (ohci->hc_control & OHCI_CTRL_HCFS) {
+	case OHCI_USB_RESUME:
+		ohci_dbg (ohci, "resume/suspend?\n");
+		ohci->hc_control &= ~OHCI_CTRL_HCFS;
+		ohci->hc_control |= OHCI_USB_RESET;
+		writel (ohci->hc_control, &ohci->regs->control);
+		(void) readl (&ohci->regs->control);
+		/* FALL THROUGH */
+	case OHCI_USB_RESET:
+		status = -EBUSY;
+		ohci_dbg (ohci, "needs reinit!\n");
+		goto done;
+	case OHCI_USB_SUSPEND:
+		ohci_dbg (ohci, "already suspended?\n");
+		goto succeed;
+	}
+	ohci_dbg (ohci, "suspend root hub\n");
+
+	/* First stop any processing */
+	ohci->hcd.state = USB_STATE_QUIESCING;
+	if (ohci->hc_control & OHCI_SCHED_ENABLES) {
+		int		limit;
+
+		ohci->hc_control &= ~OHCI_SCHED_ENABLES;
+		writel (ohci->hc_control, &ohci->regs->control);
+		ohci->hc_control = readl (&ohci->regs->control);
+		writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
+
+		/* sched disables take effect on the next frame,
+		 * then the last WDH could take 6+ msec
+		 */
+		ohci_dbg (ohci, "stopping schedules ...\n");
+		limit = 2000;
+		while (limit > 0) {
+			udelay (250);
+			limit =- 250;
+			if (readl (&ohci->regs->intrstatus) & OHCI_INTR_SF)
+				break;
+		}
+		dl_done_list (ohci, 0);
+		mdelay (7);
+	}
+	dl_done_list (ohci, 0);
+	finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), 0);
+	writel (readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
+
+	/* maybe resume can wake root hub */
+	if (ohci->hcd.remote_wakeup)
+		ohci->hc_control |= OHCI_CTRL_RWE;
+	else
+		ohci->hc_control &= ~OHCI_CTRL_RWE;
+
+	/* Suspend hub */
+	ohci->hc_control &= ~OHCI_CTRL_HCFS;
+	ohci->hc_control |= OHCI_USB_SUSPEND;
+	writel (ohci->hc_control, &ohci->regs->control);
+	(void) readl (&ohci->regs->control);
+
+	/* no resumes until devices finish suspending */
+	ohci->next_statechange = jiffies + msecs_to_jiffies (5);
+
+succeed:
+	/* it's not USB_STATE_SUSPENDED unless access to this
+	 * hub from the non-usb side (PCI, SOC, etc) stopped 
+	 */
+	root->dev.power.power_state = 3;
+done:
+	spin_unlock_irq (&ohci->lock);
+	return status;
+}
+
+static inline struct ed *find_head (struct ed *ed)
+{
+	/* for bulk and control lists */
+	while (ed->ed_prev)
+		ed = ed->ed_prev;
+	return ed;
+}
+
+static int hc_restart (struct ohci_hcd *ohci);
+
+/* caller owns root->serialize */
+static int ohci_hub_resume (struct usb_hcd *hcd)
+{
+	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
+	struct usb_device	*root = hcd_to_bus (&ohci->hcd)->root_hub;
+	u32			temp, enables;
+	int			status = -EINPROGRESS;
+
+	if (!root->dev.power.power_state)
+		return 0;
+	if (time_before (jiffies, ohci->next_statechange))
+		return -EAGAIN;
+
+	spin_lock_irq (&ohci->lock);
+	ohci->hc_control = readl (&ohci->regs->control);
+	switch (ohci->hc_control & OHCI_CTRL_HCFS) {
+	case OHCI_USB_SUSPEND:
+		ohci->hc_control &= ~(OHCI_CTRL_HCFS|OHCI_SCHED_ENABLES);
+		ohci->hc_control |= OHCI_USB_RESUME;
+		writel (ohci->hc_control, &ohci->regs->control);
+		(void) readl (&ohci->regs->control);
+		ohci_dbg (ohci, "resume root hub\n");
+		break;
+	case OHCI_USB_RESUME:
+		/* HCFS changes sometime after INTR_RD */
+		ohci_info (ohci, "remote wakeup\n");
+		break;
+	case OHCI_USB_OPER:
+		ohci_dbg (ohci, "odd resume\n");
+		root->dev.power.power_state = 0;
+		status = 0;
+		break;
+	default:		/* RESET, we lost power */
+		ohci_dbg (ohci, "root hub hardware reset\n");
+		status = -EBUSY;
+	}
+	spin_unlock_irq (&ohci->lock);
+	if (status == -EBUSY)
+		return hc_restart (ohci);
+	if (status != -EINPROGRESS)
+		return status;
+
+	temp = roothub_a (ohci) & RH_A_NDP;
+	enables = 0;
+	while (temp--) {
+		u32 stat = readl (&ohci->regs->roothub.portstatus [temp]);
+
+		/* force global, not selective, resume */
+		if (!(stat & RH_PS_PSS))
+			continue;
+		writel (RH_PS_POCI, &ohci->regs->roothub.portstatus [temp]);
+	}
+
+	/* Some controllers (lucent) need extra-long delays */
+	ohci->hcd.state = USB_STATE_RESUMING;
+	mdelay (20 /* usb 11.5.1.10 */ + 15);
+
+	temp = readl (&ohci->regs->control);
+	temp &= OHCI_CTRL_HCFS;
+	if (temp != OHCI_USB_RESUME) {
+		ohci_err (ohci, "controller won't resume\n");
+		return -EBUSY;
+	}
+
+	/* disable old schedule state, reinit from scratch */
+	writel (0, &ohci->regs->ed_controlhead);
+	writel (0, &ohci->regs->ed_controlcurrent);
+	writel (0, &ohci->regs->ed_bulkhead);
+	writel (0, &ohci->regs->ed_bulkcurrent);
+	writel (0, &ohci->regs->ed_periodcurrent);
+	writel ((u32) ohci->hcca_dma, &ohci->regs->hcca);
+
+	periodic_reinit (ohci);
+
+	/* interrupts might have been disabled */
+	writel (OHCI_INTR_INIT, &ohci->regs->intrenable);
+	if (ohci->ed_rm_list)
+		writel (OHCI_INTR_SF, &ohci->regs->intrenable);
+	writel (readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
+
+	/* Then re-enable operations */
+	writel (OHCI_USB_OPER, &ohci->regs->control);
+	(void) readl (&ohci->regs->control);
+	msleep (3);
+
+	temp = OHCI_CONTROL_INIT | OHCI_USB_OPER;
+	if (ohci->hcd.can_wakeup)
+		temp |= OHCI_CTRL_RWC;
+	ohci->hc_control = temp;
+	writel (temp, &ohci->regs->control);
+	(void) readl (&ohci->regs->control);
+
+	/* TRSMRCY */
+	msleep (10);
+	root->dev.power.power_state = 0;
+
+	/* keep it alive for ~5x suspend + resume costs */
+	ohci->next_statechange = jiffies + msecs_to_jiffies (250);
+
+	/* maybe turn schedules back on */
+	enables = 0;
+	temp = 0;
+	if (!ohci->ed_rm_list) {
+		if (ohci->ed_controltail) {
+			writel (find_head (ohci->ed_controltail)->dma,
+				&ohci->regs->ed_controlhead);
+			enables |= OHCI_CTRL_CLE;
+			temp |= OHCI_CLF;
+		}
+		if (ohci->ed_bulktail) {
+			writel (find_head (ohci->ed_bulktail)->dma,
+				&ohci->regs->ed_bulkhead);
+			enables |= OHCI_CTRL_BLE;
+			temp |= OHCI_BLF;
+		}
+	}
+	if (hcd_to_bus (&ohci->hcd)->bandwidth_isoc_reqs
+			|| hcd_to_bus (&ohci->hcd)->bandwidth_int_reqs)
+		enables |= OHCI_CTRL_PLE|OHCI_CTRL_IE;
+	if (enables) {
+		ohci_dbg (ohci, "restarting schedules ... %08x\n", enables);
+		ohci->hc_control |= enables;
+		writel (ohci->hc_control, &ohci->regs->control);
+		if (temp)
+			writel (status, &ohci->regs->cmdstatus);
+		(void) readl (&ohci->regs->control);
+	}
+
+	ohci->hcd.state = USB_STATE_RUNNING;
+	return 0;
+}
+
+static void ohci_rh_resume (void *_hcd)
+{
+	struct usb_hcd	*hcd = _hcd;
+
+	down (&hcd->self.root_hub->serialize);
+	(void) ohci_hub_resume (hcd);
+	up (&hcd->self.root_hub->serialize);
+}
+
+#else
+
+static void ohci_rh_resume (void *_hcd)
+{
+	struct ohci_hcd	*ohci = hcd_to_ohci (_hcd);
+	ohci_dbg(ohci, "rh_resume ??\n");
+}
+
+#endif	/* CONFIG_USB_SUSPEND || CONFIG_PM */
 
 /*-------------------------------------------------------------------------*/
 
@@ -70,6 +325,7 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
 {
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
 	int		ports, i, changed = 0, length = 1;
+	int		can_suspend = 1;
 
 	ports = roothub_a (ohci) & RH_A_NDP; 
 	if (ports > MAX_ROOT_PORTS) {
@@ -95,16 +351,45 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
 	for (i = 0; i < ports; i++) {
 		u32	status = roothub_portstatus (ohci, i);
 
-		status &= RH_PS_CSC | RH_PS_PESC | RH_PS_PSSC
-				| RH_PS_OCIC | RH_PS_PRSC;
-		if (status) {
+		if (status & (RH_PS_CSC | RH_PS_PESC | RH_PS_PSSC
+				| RH_PS_OCIC | RH_PS_PRSC)) {
 			changed = 1;
 			if (i < 7)
 			    buf [0] |= 1 << (i + 1);
 			else
 			    buf [1] |= 1 << (i - 7);
+			continue;
 		}
+
+		/* can suspend if no ports are enabled; or if all all
+		 * enabled ports are suspended AND remote wakeup is on.
+		 */
+		if (!(status & RH_PS_CCS))
+			continue;
+		if ((status & RH_PS_PSS) && ohci->hcd.remote_wakeup)
+			continue;
+		can_suspend = 0;
 	}
+
+#ifdef CONFIG_PM
+	/* save power by suspending idle root hubs;
+	 * INTR_RD wakes us when there's work
+	 */
+	if (can_suspend
+			&& !changed
+			&& !ohci->ed_rm_list
+			&& ((OHCI_CTRL_HCFS | OHCI_SCHED_ENABLES)
+					& ohci->hc_control)
+				== OHCI_USB_OPER
+			&& down_trylock (&hcd->self.root_hub->serialize) == 0
+			) {
+		ohci_vdbg (ohci, "autosuspend\n");
+		(void) ohci_hub_suspend (&ohci->hcd);
+		ohci->hcd.state = USB_STATE_RUNNING;
+		up (&hcd->self.root_hub->serialize);
+	}
+#endif
+
 	return changed ? length : 0;
 }
 
@@ -188,6 +473,9 @@ static int ohci_hub_control (
 			break;
 		case USB_PORT_FEAT_SUSPEND:
 			temp = RH_PS_POCI;
+			if ((ohci->hc_control & OHCI_CTRL_HCFS)
+					!= OHCI_USB_OPER)
+				schedule_work (&ohci->rh_resume);
 			break;
 		case USB_PORT_FEAT_C_SUSPEND:
 			temp = RH_PS_PSSC;
diff --git a/drivers/usb/host/ohci-mem.c b/drivers/usb/host/ohci-mem.c
index 069cb69a1..bfc59d258 100644
--- a/drivers/usb/host/ohci-mem.c
+++ b/drivers/usb/host/ohci-mem.c
@@ -31,6 +31,9 @@ static struct usb_hcd *ohci_hcd_alloc (void)
 	if (ohci != 0) {
 		memset (ohci, 0, sizeof (struct ohci_hcd));
 		ohci->hcd.product_desc = "OHCI Host Controller";
+		spin_lock_init (&ohci->lock);
+		INIT_LIST_HEAD (&ohci->pending);
+		INIT_WORK (&ohci->rh_resume, ohci_rh_resume, &ohci->hcd);
 		return &ohci->hcd;
 	}
 	return 0;
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index ec22fbc2e..0e7f9f804 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -36,6 +36,7 @@ ohci_pci_reset (struct usb_hcd *hcd)
 	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
 
 	ohci->regs = hcd->regs;
+	ohci->next_statechange = jiffies;
 	return hc_reset (ohci);
 }
 
@@ -118,74 +119,26 @@ ohci_pci_start (struct usb_hcd *hcd)
 static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
 {
 	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
-	u16			cmd;
-	u32			tmp;
 
-	if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) {
-		ohci_dbg (ohci, "can't suspend (state is %s)\n",
-			hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS));
-		return -EIO;
-	}
+	/* suspend root hub, hoping it keeps power during suspend */
+	while (time_before (jiffies, ohci->next_statechange))
+		msleep (100);
+
+#ifdef	CONFIG_USB_SUSPEND
+	(void) usb_suspend_device (hcd->self.root_hub);
+#else
+	down (&hcd->self.root_hub->serialize);
+	(void) ohci_hub_suspend (hcd);
+	up (&hcd->self.root_hub->serialize);
+#endif
 
-	/* act as if usb suspend can always be used */
-	ohci_dbg (ohci, "suspend to %d\n", state);
+	/* let things settle down a bit */
+	msleep (100);
 	
-	/* First stop processing */
-  	spin_lock_irq (&ohci->lock);
-	ohci->hc_control &=
-		~(OHCI_CTRL_PLE|OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_IE);
-	writel (ohci->hc_control, &ohci->regs->control);
-	writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
-	(void) readl (&ohci->regs->intrstatus);
-  	spin_unlock_irq (&ohci->lock);
-
-	/* Wait a frame or two */
-	mdelay (1);
-	if (!readl (&ohci->regs->intrstatus) & OHCI_INTR_SF)
-		mdelay (1);
-		
 #ifdef CONFIG_PMAC_PBOOK
 	if (_machine == _MACH_Pmac)
 		disable_irq ((to_pci_dev(hcd->self.controller))->irq);
- 	/* else, 2.4 assumes shared irqs -- don't disable */
-#endif
 
-	/* Enable remote wakeup */
-	writel (readl (&ohci->regs->intrenable) | OHCI_INTR_RD,
-		&ohci->regs->intrenable);
-
-	/* Suspend chip and let things settle down a bit */
-  	spin_lock_irq (&ohci->lock);
- 	ohci->hc_control = OHCI_USB_SUSPEND;
- 	writel (ohci->hc_control, &ohci->regs->control);
-	(void) readl (&ohci->regs->control);
-  	spin_unlock_irq (&ohci->lock);
-
-	set_current_state (TASK_UNINTERRUPTIBLE);
-	schedule_timeout (HZ/2);
-
-	tmp = readl (&ohci->regs->control) | OHCI_CTRL_HCFS;
-	switch (tmp) {
-		case OHCI_USB_RESET:
-		case OHCI_USB_RESUME:
-		case OHCI_USB_OPER:
-			ohci_err (ohci, "can't suspend; hcfs %d\n", tmp);
-			break;
-		case OHCI_USB_SUSPEND:
-			ohci_dbg (ohci, "suspended\n");
-			break;
-	}
-
-	/* In some rare situations, Apple's OHCI have happily trashed
-	 * memory during sleep. We disable its bus master bit during
-	 * suspend
-	 */
-	pci_read_config_word (to_pci_dev(hcd->self.controller), PCI_COMMAND, 
-				&cmd);
-	cmd &= ~PCI_COMMAND_MASTER;
-	pci_write_config_word (to_pci_dev(hcd->self.controller), PCI_COMMAND, 
-				cmd);
-#ifdef CONFIG_PMAC_PBOOK
 	{
 	   	struct device_node	*of_node;
  
@@ -202,7 +155,6 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
 static int ohci_pci_resume (struct usb_hcd *hcd)
 {
 	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
-	int			temp;
 	int			retval = 0;
 
 #ifdef CONFIG_PMAC_PBOOK
@@ -215,90 +167,25 @@ static int ohci_pci_resume (struct usb_hcd *hcd)
 			pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1);
 	}
 #endif
-	/* did we suspend, or were we powered off? */
-	ohci->hc_control = readl (&ohci->regs->control);
-	temp = ohci->hc_control & OHCI_CTRL_HCFS;
 
-#ifdef DEBUG
-	/* the registers may look crazy here */
-	ohci_dump_status (ohci, 0, 0);
+	/* resume root hub */
+	while (time_before (jiffies, ohci->next_statechange))
+		msleep (100);
+#ifdef	CONFIG_USB_SUSPEND
+	/* get extra cleanup even if remote wakeup isn't in use */
+	retval = usb_resume_device (hcd->self.root_hub);
+#else
+	down (&hcd->self.root_hub->serialize);
+	retval = ohci_hub_resume (hcd);
+	up (&hcd->self.root_hub->serialize);
 #endif
 
-	/* Re-enable bus mastering */
-	pci_set_master (to_pci_dev(ohci->hcd.self.controller));
-	
-	switch (temp) {
-
-	case OHCI_USB_RESET:	// lost power
-restart:
-		ohci_info (ohci, "USB restart\n");
-		retval = hc_restart (ohci);
-		break;
-
-	case OHCI_USB_SUSPEND:	// host wakeup
-	case OHCI_USB_RESUME:	// remote wakeup
-		ohci_info (ohci, "USB continue from %s wakeup\n",
-			 (temp == OHCI_USB_SUSPEND)
-				? "host" : "remote");
-
-		/* we "should" only need RESUME if we're SUSPENDed ... */
-		ohci->hc_control = OHCI_USB_RESUME;
-		writel (ohci->hc_control, &ohci->regs->control);
-		(void) readl (&ohci->regs->control);
-		/* Some controllers (lucent) need extra-long delays */
-		mdelay (35); /* no schedule here ! */
-
-		temp = readl (&ohci->regs->control);
-		temp = ohci->hc_control & OHCI_CTRL_HCFS;
-		if (temp != OHCI_USB_RESUME) {
-			ohci_err (ohci, "controller won't resume\n");
-			/* maybe we can reset */
-			goto restart;
-		}
-
-		/* Then re-enable operations */
-		writel (OHCI_USB_OPER, &ohci->regs->control);
-		(void) readl (&ohci->regs->control);
-		mdelay (3);
-
-		spin_lock_irq (&ohci->lock);
-		ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER;
-		if (!ohci->ed_rm_list) {
-			if (ohci->ed_controltail)
-				ohci->hc_control |= OHCI_CTRL_CLE;
-			if (ohci->ed_bulktail)
-				ohci->hc_control |= OHCI_CTRL_BLE;
-		}
-		if (hcd_to_bus (&ohci->hcd)->bandwidth_isoc_reqs
-				|| hcd_to_bus (&ohci->hcd)->bandwidth_int_reqs)
-			ohci->hc_control |= OHCI_CTRL_PLE|OHCI_CTRL_IE;
-		hcd->state = USB_STATE_RUNNING;
-		writel (ohci->hc_control, &ohci->regs->control);
-
-		/* trigger a start-frame interrupt (why?) */
-		writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
-		writel (OHCI_INTR_SF, &ohci->regs->intrenable);
-
-		writel (OHCI_INTR_WDH, &ohci->regs->intrdisable);	
-		(void) readl (&ohci->regs->intrdisable);
-		spin_unlock_irq (&ohci->lock);
-
+	if (retval == 0) {
+		hcd->self.controller->power.power_state = 0;
 #ifdef CONFIG_PMAC_PBOOK
 		if (_machine == _MACH_Pmac)
 			enable_irq (to_pci_dev(hcd->self.controller)->irq);
 #endif
-
-		/* Check for a pending done list */
-		if (ohci->hcca->done_head)
-			dl_done_list (ohci, dl_reverse_done_list (ohci), NULL);
-		writel (OHCI_INTR_WDH, &ohci->regs->intrenable); 
-
-		/* assume there are TDs on the bulk and control lists */
-		writel (OHCI_BLF | OHCI_CLF, &ohci->regs->cmdstatus);
-		break;
-
-	default:
-		ohci_warn (ohci, "odd PCI resume\n");
 	}
 	return retval;
 }
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index 99b156ded..f103b15b5 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -22,6 +22,7 @@ static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv)
 		}
 	}
 
+	list_del (&urb_priv->pending);
 	kfree (urb_priv);
 }
 
@@ -169,6 +170,9 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
 {	 
 	int	branch;
 
+	if (ohci->hcd.state == USB_STATE_QUIESCING)
+		return -EAGAIN;
+
 	ed->state = ED_OPER;
 	ed->ed_prev = 0;
 	ed->ed_next = 0;
@@ -419,7 +423,7 @@ static struct ed *ed_get (
 	}
 
 	/* NOTE: only ep0 currently needs this "re"init logic, during
-	 * enumeration (after set_address, or if ep0 maxpacket >8).
+	 * enumeration (after set_address).
 	 */
   	if (ed->state == ED_IDLE) {
 		u32	info;
@@ -593,6 +597,7 @@ static void td_submit_urb (
 	}
 
 	urb_priv->td_cnt = 0;
+	list_add (&urb_priv->pending, &ohci->pending);
 
 	if (data_len)
 		data = urb->transfer_dma;
@@ -865,9 +870,6 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci)
 	u32		td_dma;
 	struct td	*td_rev = NULL;
 	struct td	*td = NULL;
-  	unsigned long	flags;
-
-  	spin_lock_irqsave (&ohci->lock, flags);
 
 	td_dma = le32_to_cpup (&ohci->hcca->done_head);
 	ohci->hcca->done_head = 0;
@@ -899,7 +901,6 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci)
 		td_rev = td;
 		td_dma = le32_to_cpup (&td->hwNextTD);
 	}	
-	spin_unlock_irqrestore (&ohci->lock, flags);
 	return td_rev;
 }
 
@@ -1013,7 +1014,9 @@ rescan_this:
    	}
 
 	/* maybe reenable control and bulk lists */ 
-	if (HCD_IS_RUNNING(ohci->hcd.state) && !ohci->ed_rm_list) {
+	if (HCD_IS_RUNNING(ohci->hcd.state)
+			&& ohci->hcd.state != USB_STATE_QUIESCING
+			&& !ohci->ed_rm_list) {
 		u32	command = 0, control = 0;
 
 		if (ohci->ed_controltail) {
@@ -1053,11 +1056,10 @@ rescan_this:
  * scanning the (re-reversed) donelist as this does.
  */
 static void
-dl_done_list (struct ohci_hcd *ohci, struct td *td, struct pt_regs *regs)
+dl_done_list (struct ohci_hcd *ohci, struct pt_regs *regs)
 {
-	unsigned long	flags;
+	struct td	*td = dl_reverse_done_list (ohci);
 
-  	spin_lock_irqsave (&ohci->lock, flags);
   	while (td) {
 		struct td	*td_next = td->next_dl_td;
 		struct urb	*urb = td->urb;
@@ -1098,5 +1100,4 @@ dl_done_list (struct ohci_hcd *ohci, struct td *td, struct pt_regs *regs)
 
     		td = td_next;
   	}  
-	spin_unlock_irqrestore (&ohci->lock, flags);
 }
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 679db4711..70f32ef72 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -318,8 +318,9 @@ struct ohci_regs {
 /* hcd-private per-urb state */
 typedef struct urb_priv {
 	struct ed		*ed;
-	__u16			length;		// # tds in this request
-	__u16			td_cnt;		// tds already serviced
+	u16			length;		// # tds in this request
+	u16			td_cnt;		// tds already serviced
+	struct list_head	pending;
 	struct td		*td [0];	// all TDs in this request
 
 } urb_priv_t;
@@ -364,12 +365,17 @@ struct ohci_hcd {
 	struct dma_pool		*td_cache;
 	struct dma_pool		*ed_cache;
 	struct td		*td_hash [TD_HASH_SIZE];
+	struct list_head	pending;
 
 	/*
 	 * driver state
 	 */
 	int			load [NUM_INTS];
 	u32 			hc_control;	/* copy of hc control reg */
+	unsigned long		next_statechange;	/* suspend/resume */
+	u32			fminterval;		/* saved register */
+
+	struct work_struct	rh_resume;
 
 	unsigned long		flags;		/* for HC bugs */
 #define	OHCI_QUIRK_AMD756	0x01			/* erratum #4 */
@@ -386,6 +392,24 @@ struct ohci_hcd {
 
 /*-------------------------------------------------------------------------*/
 
+static inline void disable (struct ohci_hcd *ohci)
+{
+	ohci->hcd.state = USB_STATE_HALT;
+}
+
+#define	FI			0x2edf		/* 12000 bits per frame (-1) */
+#define	DEFAULT_FMINTERVAL 	((((6 * (FI - 210)) / 7) << 16) | FI)
+#define LSTHRESH		0x628		/* lowspeed bit threshold */
+
+static inline void periodic_reinit (struct ohci_hcd *ohci)
+{
+	writel (ohci->fminterval, &ohci->regs->fminterval);
+	writel (((9 * FI) / 10) & 0x3fff, &ohci->regs->periodicstart);
+	writel (LSTHRESH, &ohci->regs->lsthresh);
+}
+
+/*-------------------------------------------------------------------------*/
+
 #ifndef DEBUG
 #define STUB_DEBUG_FILES
 #endif	/* DEBUG */
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index c2e63e29b..86e4c3a11 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -567,8 +567,8 @@ static loff_t uhci_proc_lseek(struct file *file, loff_t off, int whence)
 	return (file->f_pos = new);
 }
 
-static ssize_t uhci_proc_read(struct file *file, char *buf, size_t nbytes,
-			loff_t *ppos)
+static ssize_t uhci_proc_read(struct file *file, char __user *buf,
+				size_t nbytes, loff_t *ppos)
 {
 	struct uhci_proc *up = file->private_data;
 	unsigned int pos;
@@ -578,14 +578,9 @@ static ssize_t uhci_proc_read(struct file *file, char *buf, size_t nbytes,
 	size = up->size;
 	if (pos >= size)
 		return 0;
-	if (nbytes >= size)
-		nbytes = size;
-	if (pos + nbytes > size)
+	if (nbytes > size - pos)
 		nbytes = size - pos;
 
-	if (!access_ok(VERIFY_WRITE, buf, nbytes))
-		return -EINVAL;
-
 	if (copy_to_user(buf, up->data + pos, nbytes))
 		return -EFAULT;
 
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index f25c6ddf6..afe032003 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -95,6 +95,10 @@ static kmem_cache_t *uhci_up_cachep;	/* urb_priv */
 static int uhci_get_current_frame_number(struct uhci_hcd *uhci);
 static int uhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb);
 static void uhci_unlink_generic(struct uhci_hcd *uhci, struct urb *urb);
+static void uhci_remove_pending_urbps(struct uhci_hcd *uhci);
+static void uhci_finish_completion(struct usb_hcd *hcd, struct pt_regs *regs);
+static void uhci_free_pending_qhs(struct uhci_hcd *uhci);
+static void uhci_free_pending_tds(struct uhci_hcd *uhci);
 
 static void hc_state_transitions(struct uhci_hcd *uhci);
 
@@ -157,8 +161,8 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci, struct usb_device *d
 	return td;
 }
 
-static inline void uhci_fill_td(struct uhci_td *td, __u32 status,
-		__u32 token, __u32 buffer)
+static inline void uhci_fill_td(struct uhci_td *td, u32 status,
+		u32 token, u32 buffer)
 {
 	td->status = cpu_to_le32(status);
 	td->token = cpu_to_le32(token);
@@ -184,11 +188,11 @@ static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td,
 		list_add_tail(&td->fl_list, &ftd->fl_list);
 
 		td->link = ltd->link;
-		mb();
+		wmb();
 		ltd->link = cpu_to_le32(td->dma_handle);
 	} else {
 		td->link = uhci->fl->frame[framenum];
-		mb();
+		wmb();
 		uhci->fl->frame[framenum] = cpu_to_le32(td->dma_handle);
 		uhci->fl->frame_cpu[framenum] = td;
 	}
@@ -218,7 +222,7 @@ static void uhci_remove_td(struct uhci_hcd *uhci, struct uhci_td *td)
 		ptd->link = td->link;
 	}
 
-	mb();
+	wmb();
 	td->link = UHCI_PTR_TERM;
 
 	list_del_init(&td->fl_list);
@@ -332,17 +336,7 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct
 	/* Grab the last QH */
 	lqh = list_entry(skelqh->list.prev, struct uhci_qh, list);
 
-	/*
-	 * Patch this endpoint's URB's QHs to point to the next skelqh:
-	 *    skelqh --> ... lqh --> newqh --> next skelqh
-	 * Do this first, so the HC always sees the right QH after this one.
-	 */
-	list_for_each (tmp, &urbp->queue_list) {
-		struct urb_priv *turbp =
-			list_entry(tmp, struct urb_priv, queue_list);
-
-		turbp->qh->link = lqh->link;
-	}
+	/* Point to the next skelqh */
 	urbp->qh->link = lqh->link;
 	wmb();				/* Ordering is important */
 
@@ -362,15 +356,15 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct
 	 *
 	 * The HC could see (and use!) any of these as we write them.
 	 */
+	lqh->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
 	if (lqh->urbp) {
 		list_for_each (tmp, &lqh->urbp->queue_list) {
 			struct urb_priv *turbp =
 				list_entry(tmp, struct urb_priv, queue_list);
 
-			turbp->qh->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
+			turbp->qh->link = lqh->link;
 		}
 	}
-	lqh->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
 
 	list_add_tail(&urbp->qh->list, &skelqh->list);
 }
@@ -382,7 +376,8 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct
 static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
 {
 	struct uhci_qh *pqh;
-	__u32 newlink;
+	u32 newlink;
+	unsigned int age;
 
 	if (!qh)
 		return;
@@ -423,7 +418,7 @@ static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
 				turbp->qh->link = newlink;
 			}
 		}
-		mb();
+		wmb();
 
 		/* Leave qh->link in case the HC is on the QH now, it will */
 		/* continue the rest of the schedule */
@@ -435,6 +430,12 @@ static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
 	list_del_init(&qh->urbp->queue_list);
 	qh->urbp = NULL;
 
+	age = uhci_get_current_frame_number(uhci);
+	if (age != uhci->qh_remove_age) {
+		uhci_free_pending_qhs(uhci);
+		uhci->qh_remove_age = age;
+	}
+
 	/* Check to see if the remove list is empty. Set the IOC bit */
 	/* to force an interrupt so we can remove the QH */
 	if (list_empty(&uhci->qh_remove_list))
@@ -510,7 +511,7 @@ static void uhci_append_queued_urb(struct uhci_hcd *uhci, struct urb *eurb, stru
 	/* All qh's in the queue need to link to the next queue */
 	urbp->qh->link = eurbp->qh->link;
 
-	mb();			/* Make sure we flush everything */
+	wmb();			/* Make sure we flush everything */
 
 	lltd->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
 
@@ -638,6 +639,7 @@ static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb)
 {
 	struct list_head *head, *tmp;
 	struct urb_priv *urbp;
+	unsigned int age;
 
 	urbp = (struct urb_priv *)urb->hcpriv;
 	if (!urbp)
@@ -647,6 +649,12 @@ static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb)
 		dev_warn(uhci_dev(uhci), "urb %p still on uhci->urb_list "
 				"or uhci->remove_list!\n", urb);
 
+	age = uhci_get_current_frame_number(uhci);
+	if (age != uhci->td_remove_age) {
+		uhci_free_pending_tds(uhci);
+		uhci->td_remove_age = age;
+	}
+
 	/* Check to see if the remove list is empty. Set the IOC bit */
 	/* to force an interrupt so we can remove the TD's*/
 	if (list_empty(&uhci->td_remove_list))
@@ -1044,9 +1052,13 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, struct urb
 			usb_pipeout(urb->pipe));
 	}
 
-	/* Set the flag on the last packet */
-	if (!(urb->transfer_flags & URB_NO_INTERRUPT))
-		td->status |= cpu_to_le32(TD_CTRL_IOC);
+	/* Set the interrupt-on-completion flag on the last packet.
+	 * A more-or-less typical 4 KB URB (= size of one memory page)
+	 * will require about 3 ms to transfer; that's a little on the
+	 * fast side but not enough to justify delaying an interrupt
+	 * more than 2 or 3 URBs, so we will ignore the URB_NO_INTERRUPT
+	 * flag setting. */
+	td->status |= cpu_to_le32(TD_CTRL_IOC);
 
 	qh = uhci_alloc_qh(uhci, urb->dev);
 	if (!qh)
@@ -1518,6 +1530,7 @@ static int uhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 	unsigned long flags;
 	struct urb_priv *urbp;
+	unsigned int age;
 
 	spin_lock_irqsave(&uhci->schedule_lock, flags);
 	urbp = urb->hcpriv;
@@ -1527,6 +1540,12 @@ static int uhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
 
 	uhci_unlink_generic(uhci, urb);
 
+	age = uhci_get_current_frame_number(uhci);
+	if (age != uhci->urb_remove_age) {
+		uhci_remove_pending_urbps(uhci);
+		uhci->urb_remove_age = age;
+	}
+
 	/* If we're the first, set the next interrupt bit */
 	if (list_empty(&uhci->urb_remove_list))
 		uhci_set_next_interrupt(uhci);
@@ -1596,6 +1615,12 @@ static void stall_callback(unsigned long ptr)
 	INIT_LIST_HEAD(&list);
 
 	spin_lock_irqsave(&uhci->schedule_lock, flags);
+	if (!list_empty(&uhci->urb_remove_list) &&
+	    uhci_get_current_frame_number(uhci) != uhci->urb_remove_age) {
+		uhci_remove_pending_urbps(uhci);
+		uhci_finish_completion(hcd, NULL);
+	}
+
 	head = &uhci->urb_list;
 	tmp = head->next;
 	while (tmp != head) {
@@ -1734,6 +1759,7 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 	unsigned int io_addr = uhci->io_addr;
 	unsigned short status;
 	struct list_head *tmp, *head;
+	unsigned int age;
 
 	/*
 	 * Read the interrupt status, and write it back to clear the
@@ -1764,11 +1790,20 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 
 	spin_lock(&uhci->schedule_lock);
 
-	uhci_free_pending_qhs(uhci);
-	uhci_free_pending_tds(uhci);
-	uhci_remove_pending_urbps(uhci);
-
-	uhci_clear_next_interrupt(uhci);
+	age = uhci_get_current_frame_number(uhci);
+	if (age != uhci->qh_remove_age)
+		uhci_free_pending_qhs(uhci);
+	if (age != uhci->td_remove_age)
+		uhci_free_pending_tds(uhci);
+	if (age != uhci->urb_remove_age)
+		uhci_remove_pending_urbps(uhci);
+
+	if (list_empty(&uhci->urb_remove_list) &&
+	    list_empty(&uhci->td_remove_list) &&
+	    list_empty(&uhci->qh_remove_list))
+		uhci_clear_next_interrupt(uhci);
+	else
+		uhci_set_next_interrupt(uhci);
 
 	/* Walk the list of pending URB's to see which ones completed */
 	head = &uhci->urb_list;
@@ -1786,6 +1821,9 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 
 	spin_unlock(&uhci->schedule_lock);
 
+	/* Wake up anyone waiting for an URB to complete */
+	wake_up_all(&uhci->waitqh);
+
 	return IRQ_HANDLED;
 }
 
@@ -2086,6 +2124,8 @@ static int uhci_start(struct usb_hcd *hcd)
 
 	INIT_LIST_HEAD(&uhci->complete_list);
 
+	init_waitqueue_head(&uhci->waitqh);
+
 	uhci->fl = dma_alloc_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
 			&dma_handle, 0);
 	if (!uhci->fl) {
@@ -2296,6 +2336,9 @@ static void uhci_stop(struct usb_hcd *hcd)
 	uhci_free_pending_qhs(uhci);
 	uhci_free_pending_tds(uhci);
 	spin_unlock_irq(&uhci->schedule_lock);
+
+	/* Wake up anyone waiting for an URB to complete */
+	wake_up_all(&uhci->waitqh);
 	
 	release_uhci(uhci);
 }
@@ -2361,6 +2404,46 @@ static void uhci_hcd_free(struct usb_hcd *hcd)
 	kfree(hcd_to_uhci(hcd));
 }
 
+/* Are there any URBs for a particular device/endpoint on a given list? */
+static int urbs_for_ep_list(struct list_head *head,
+		struct hcd_dev *hdev, int ep)
+{
+	struct urb_priv *urbp;
+
+	list_for_each_entry(urbp, head, urb_list) {
+		struct urb *urb = urbp->urb;
+
+		if (hdev == urb->dev->hcpriv && ep ==
+				(usb_pipeendpoint(urb->pipe) |
+				 usb_pipein(urb->pipe)))
+			return 1;
+	}
+	return 0;
+}
+
+/* Are there any URBs for a particular device/endpoint? */
+static int urbs_for_ep(struct uhci_hcd *uhci, struct hcd_dev *hdev, int ep)
+{
+	int rc;
+
+	spin_lock_irq(&uhci->schedule_lock);
+	rc = (urbs_for_ep_list(&uhci->urb_list, hdev, ep) ||
+			urbs_for_ep_list(&uhci->complete_list, hdev, ep) ||
+			urbs_for_ep_list(&uhci->urb_remove_list, hdev, ep));
+	spin_unlock_irq(&uhci->schedule_lock);
+	return rc;
+}
+
+/* Wait until all the URBs for a particular device/endpoint are gone */
+static void uhci_hcd_endpoint_disable(struct usb_hcd *hcd,
+		struct hcd_dev *hdev, int endpoint)
+{
+	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
+
+	wait_event_interruptible(uhci->waitqh,
+			!urbs_for_ep(uhci, hdev, endpoint));
+}
+
 static int uhci_hcd_get_frame_number(struct usb_hcd *hcd)
 {
 	return uhci_get_current_frame_number(hcd_to_uhci(hcd));
@@ -2390,6 +2473,7 @@ static const struct hc_driver uhci_driver = {
 	.urb_enqueue =		uhci_urb_enqueue,
 	.urb_dequeue =		uhci_urb_dequeue,
 
+	.endpoint_disable =	uhci_hcd_endpoint_disable,
 	.get_frame_number =	uhci_hcd_get_frame_number,
 
 	.hub_status_data =	uhci_hub_status_data,
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 7f8bd85ba..b4bf3b6ca 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -80,7 +80,7 @@
 #define CAN_SCHEDULE_FRAMES	1000	/* how far future frames can be scheduled */
 
 struct uhci_frame_list {
-	__u32 frame[UHCI_NUMFRAMES];
+	u32 frame[UHCI_NUMFRAMES];
 
 	void *frame_cpu[UHCI_NUMFRAMES];
 
@@ -105,8 +105,8 @@ struct urb_priv;
  */
 struct uhci_qh {
 	/* Hardware fields */
-	__u32 link;			/* Next queue */
-	__u32 element;			/* Queue element pointer */
+	u32 link;			/* Next queue */
+	u32 element;			/* Queue element pointer */
 
 	/* Software fields */
 	dma_addr_t dma_handle;
@@ -185,10 +185,10 @@ struct uhci_qh {
  */
 struct uhci_td {
 	/* Hardware fields */
-	__u32 link;
-	__u32 status;
-	__u32 token;
-	__u32 buffer;
+	u32 link;
+	u32 status;
+	u32 token;
+	u32 buffer;
 
 	/* Software fields */
 	dma_addr_t dma_handle;
@@ -357,12 +357,15 @@ struct uhci_hcd {
 
 	/* List of QH's that are done, but waiting to be unlinked (race) */
 	struct list_head qh_remove_list;	/* P: uhci->schedule_lock */
+	unsigned int qh_remove_age;		/* Age in frames */
 
 	/* List of TD's that are done, but waiting to be freed (race) */
 	struct list_head td_remove_list;	/* P: uhci->schedule_lock */
+	unsigned int td_remove_age;		/* Age in frames */
 
 	/* List of asynchronously unlinked URB's */
 	struct list_head urb_remove_list;	/* P: uhci->schedule_lock */
+	unsigned int urb_remove_age;		/* Age in frames */
 
 	/* List of URB's awaiting completion callback */
 	struct list_head complete_list;		/* P: uhci->schedule_lock */
@@ -370,6 +373,8 @@ struct uhci_hcd {
 	int rh_numports;
 
 	struct timer_list stall_timer;
+
+	wait_queue_head_t waitqh;		/* endpoint_disable waiters */
 };
 
 struct urb_priv {
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
index f1b934c54..b05c16866 100644
--- a/drivers/usb/image/mdc800.c
+++ b/drivers/usb/image/mdc800.c
@@ -33,7 +33,7 @@
  * Fix: mdc800 used sleep_on and slept with io_lock held.
  * Converted sleep_on to waitqueues with schedule_timeout and made io_lock
  * a semaphore from a spinlock.
- * by Oliver Neukum <520047054719-0001@t-online.de>
+ * by Oliver Neukum <oliver@neukum.name>
  * (02/12/2001)
  * 
  * Identify version on module load.
@@ -41,7 +41,7 @@
  *
  * version 0.7.5
  * Fixed potential SMP races with Spinlocks.
- * Thanks to Oliver Neukum <oliver.neukum@lrz.uni-muenchen.de> who 
+ * Thanks to Oliver Neukum <oliver@neukum.name> who 
  * noticed the race conditions.
  * (30/10/2000)
  *
@@ -312,14 +312,17 @@ static void mdc800_usb_irq (struct urb *urb, struct pt_regs *res)
 static int mdc800_usb_waitForIRQ (int mode, int msec)
 {
         DECLARE_WAITQUEUE(wait, current);
+	long timeout;
 
 	mdc800->camera_request_ready=1+mode;
 
 	add_wait_queue(&mdc800->irq_wait, &wait);
 	set_current_state(TASK_INTERRUPTIBLE);
-	if (!mdc800->irq_woken)
+	timeout = msec*HZ/1000;
+	while (!mdc800->irq_woken && timeout)
 	{
-		schedule_timeout (msec*HZ/1000);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		timeout = schedule_timeout (timeout);
 	}
         remove_wait_queue(&mdc800->irq_wait, &wait);
 	set_current_state(TASK_RUNNING);
@@ -668,6 +671,7 @@ static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, lof
 {
 	size_t left=len, sts=len; /* single transfer size */
 	char* ptr=buf;
+	long timeout;
 	DECLARE_WAITQUEUE(wait, current);
 
 	down (&mdc800->io_lock);
@@ -715,10 +719,11 @@ static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, lof
 					return len-left;
 				}
 				add_wait_queue(&mdc800->download_wait, &wait);
-				set_current_state(TASK_INTERRUPTIBLE);
-				if (!mdc800->downloaded)
+				timeout = TO_DOWNLOAD_GET_READY*HZ/1000;
+				while (!mdc800->downloaded && timeout)
 				{
-					schedule_timeout (TO_DOWNLOAD_GET_READY*HZ/1000);
+					set_current_state(TASK_UNINTERRUPTIBLE);
+					timeout = schedule_timeout (timeout);
 				}
 				set_current_state(TASK_RUNNING);
 				remove_wait_queue(&mdc800->download_wait, &wait);
@@ -819,6 +824,7 @@ static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t l
 		if (mdc800->in_count == 8)
 		{
 			int answersize;
+			long timeout;
 
 			if (mdc800_usb_waitForIRQ (0,TO_GET_READY))
 			{
@@ -839,10 +845,11 @@ static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t l
 				return -EIO;
 			}
 			add_wait_queue(&mdc800->write_wait, &wait);
-			set_current_state(TASK_INTERRUPTIBLE);
-			if (!mdc800->written)
+			timeout = TO_WRITE_GET_READY*HZ/1000;
+			while (!mdc800->written && timeout)
 			{
-				schedule_timeout (TO_WRITE_GET_READY*HZ/1000);
+				set_current_state(TASK_UNINTERRUPTIBLE);
+				timeout = schedule_timeout (timeout);
 			}
                         set_current_state(TASK_RUNNING);
 			remove_wait_queue(&mdc800->write_wait, &wait);
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig
index a0fb9f48b..0f0282289 100644
--- a/drivers/usb/input/Kconfig
+++ b/drivers/usb/input/Kconfig
@@ -191,6 +191,19 @@ config USB_MTOUCH
 	  To compile this driver as a module, choose M here: the
 	  module will be called mtouchusb.
 
+config USB_EGALAX
+	tristate "eGalax TouchKit USB Touchscreen Driver"
+	depends on USB && INPUT
+	---help---
+	  Say Y here if you want to use a eGalax TouchKit USB
+	  Touchscreen controller.
+
+	  The driver has been tested on a Xenarc 700TSV monitor
+	  with eGalax touchscreen.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called touchkitusb.
+
 config USB_XPAD
 	tristate "X-Box gamepad support"
 	depends on USB && INPUT
diff --git a/drivers/usb/input/Makefile b/drivers/usb/input/Makefile
index ac1770c80..6bcedd16b 100644
--- a/drivers/usb/input/Makefile
+++ b/drivers/usb/input/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_USB_KBD)		+= usbkbd.o
 obj-$(CONFIG_USB_KBTAB)		+= kbtab.o
 obj-$(CONFIG_USB_MOUSE)		+= usbmouse.o
 obj-$(CONFIG_USB_MTOUCH)	+= mtouchusb.o
+obj-$(CONFIG_USB_EGALAX)	+= touchkitusb.o
 obj-$(CONFIG_USB_POWERMATE)	+= powermate.o
 obj-$(CONFIG_USB_WACOM)		+= wacom.o
 obj-$(CONFIG_USB_XPAD)		+= xpad.o
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
index 69f5099ca..81caa0dfe 100644
--- a/drivers/usb/input/aiptek.c
+++ b/drivers/usb/input/aiptek.c
@@ -1,7 +1,9 @@
 /*
- *  Native support for the Aiptek 8000U
- *
- *  Copyright (c) 2001 Chris Atenasio		<chris@crud.net>
+ *  Native support for the Aiptek HyperPen USB Tablets
+ *  (4000U/5000U/6000U/8000U/12000U)
+ *  
+ *  Copyright (c) 2001      Chris Atenasio   <chris@crud.net>
+ *  Copyright (c) 2002-2004 Bryan W. Headley <bwheadley@earthlink.net>
  *
  *  based on wacom.c by
  *     Vojtech Pavlik      <vojtech@suse.cz>
@@ -11,17 +13,48 @@
  *     James E. Blair      <corvus@gnu.org>
  *     Daniel Egger        <egger@suse.de>
  *
- *
  *  Many thanks to Oliver Kuechemann for his support.
  *
  *  ChangeLog:
  *      v0.1 - Initial release
- *      v0.2 - Hack to get around fake event 28's.
+ *      v0.2 - Hack to get around fake event 28's. (Bryan W. Headley)
  *      v0.3 - Make URB dynamic (Bryan W. Headley, Jun-8-2002)
- *             (kernel 2.5.x variant, June-14-2002)
- */
-
-/*
+ *             Released to Linux 2.4.19 and 2.5.x
+ *      v0.4 - Rewrote substantial portions of the code to deal with
+ *             corrected control sequences, timing, dynamic configuration,
+ *             support of 6000U - 12000U, procfs, and macro key support
+ *             (Jan-1-2003 - Feb-5-2003, Bryan W. Headley)
+ *      v1.0 - Added support for diagnostic messages, count of messages
+ *             received from URB - Mar-8-2003, Bryan W. Headley
+ *      v1.1 - added support for tablet resolution, changed DV and proximity
+ *             some corrections - Jun-22-2003, martin schneebacher
+ *           - Added support for the sysfs interface, deprecating the
+ *             procfs interface for 2.5.x kernel. Also added support for
+ *             Wheel command. Bryan W. Headley July-15-2003.
+ *      v1.2 - Reworked jitter timer as a kernel thread. 
+ *             Bryan W. Headley November-28-2003/Jan-10-2004.
+ *      v1.3 - Repaired issue of kernel thread going nuts on single-processor
+ *             machines, introduced programmableDelay as a command line
+ *             parameter. Feb 7 2004, Bryan W. Headley.
+ *      v1.4 - Re-wire jitter so it does not require a thread. Courtesy of
+ *             Rene van Paassen. Added reporting of physical pointer device
+ *             (e.g., stylus, mouse in reports 2, 3, 4, 5. We don't know
+ *             for reports 1, 6.)
+ *             what physical device reports for reports 1, 6.) Also enabled
+ *             MOUSE and LENS tool button modes. Renamed "rubber" to "eraser".
+ *             Feb 20, 2004, Bryan W. Headley.
+ *      v1.5 - Added previousJitterable, so we don't do jitter delay when the
+ *             user is holding a button down for periods of time.
+ *
+ * NOTE:
+ *      This kernel driver is augmented by the "Aiptek" XFree86 input
+ *      driver for your X server, as well as the Gaiptek GUI Front-end
+ *      "Tablet Manager". 
+ *      These three products are highly interactive with one another, 
+ *      so therefore it's easier to document them all as one subsystem.
+ *      Please visit the project's "home page", located at, 
+ *      http://aiptektablet.sourceforge.net.
+ *
  * 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
@@ -37,373 +70,2229 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#include <linux/jiffies.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/usb.h>
+#include <linux/sched.h>
+#include <asm/uaccess.h>
 #include <asm/unaligned.h>
-#include <asm/byteorder.h>
+
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.3"
-#define DRIVER_AUTHOR "Chris Atenasio <chris@crud.net>"
-#define DRIVER_DESC "USB Aiptek 6000U/8000U tablet driver (Linux 2.5.x)"
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
+#define DRIVER_VERSION "v1.5 (May-15-2004)"
+#define DRIVER_AUTHOR  "Bryan W. Headley/Chris Atenasio"
+#define DRIVER_DESC    "Aiptek HyperPen USB Tablet Driver (Linux 2.6.x)"
 
 /*
  * Aiptek status packet:
  *
+ * (returned as Report 1 - relative coordinates from mouse and stylus)
+ *
+ *        bit7  bit6  bit5  bit4  bit3  bit2  bit1  bit0
+ * byte0   0     0     0     0     0     0     0     1
+ * byte1   0     0     0     0     0    BS2   BS    Tip
+ * byte2  X7    X6    X5    X4    X3    X2    X1    X0
+ * byte3  Y7    Y6    Y5    Y4    Y3    Y2    Y1    Y0
+ *
+ * (returned as Report 2 - absolute coordinates from the stylus)
+ *
+ *        bit7  bit6  bit5  bit4  bit3  bit2  bit1  bit0
+ * byte0   0     0     0     0     0     0     1     0
+ * byte1  X7    X6    X5    X4    X3    X2    X1    X0
+ * byte2  X15   X14   X13   X12   X11   X10   X9    X8
+ * byte3  Y7    Y6    Y5    Y4    Y3    Y2    Y1    Y0
+ * byte4  Y15   Y14   Y13   Y12   Y11   Y10   Y9    Y8
+ * byte5   *     *     *    BS2   BS1   Tip   IR    DV
+ * byte6  P7    P6    P5    P4    P3    P2    P1    P0
+ * byte7  P15   P14   P13   P12   P11   P10   P9    P8
+ *
+ * (returned as Report 3 - absolute coordinates from the mouse)
+ *
  *        bit7  bit6  bit5  bit4  bit3  bit2  bit1  bit0
  * byte0   0     0     0     0     0     0     1     0
  * byte1  X7    X6    X5    X4    X3    X2    X1    X0
  * byte2  X15   X14   X13   X12   X11   X10   X9    X8
  * byte3  Y7    Y6    Y5    Y4    Y3    Y2    Y1    Y0
  * byte4  Y15   Y14   Y13   Y12   Y11   Y10   Y9    Y8
- * byte5   *     *     *    BS2   BS1   Tip   DV    IR
+ * byte5   *     *     *    BS2   BS1   Tip   IR    DV
  * byte6  P7    P6    P5    P4    P3    P2    P1    P0
  * byte7  P15   P14   P13   P12   P11   P10   P9    P8
  *
+ * (returned as Report 4 - macrokeys from the stylus)
+ *
+ *        bit7  bit6  bit5  bit4  bit3  bit2  bit1  bit0
+ * byte0   0     0     0     0     0     1     0     0
+ * byte1   0     0     0    BS2   BS    Tip   IR    DV
+ * byte2   0     0     0     0     0     0     1     0
+ * byte3   0     0     0    K4    K3    K2    K1    K0
+ * byte4  P7    P6    P5    P4    P3    P2    P1    P0
+ * byte5  P15   P14   P13   P12   P11   P10   P9    P8
+ *
+ * (returned as Report 5 - macrokeys from the mouse)
+ *
+ *        bit7  bit6  bit5  bit4  bit3  bit2  bit1  bit0
+ * byte0   0     0     0     0     0     1     0     0
+ * byte1   0     0     0    BS2   BS    Tip   IR    DV
+ * byte2   0     0     0     0     0     0     1     0
+ * byte3   0     0     0    K4    K3    K2    K1    K0
+ * byte4  P7    P6    P5    P4    P3    P2    P1    P0
+ * byte5  P15   P14   P13   P12   P11   P10   P9    P8
+ *
  * IR: In Range = Proximity on
  * DV = Data Valid
+ * BS = Barrel Switch (as in, macro keys)
+ * BS2 also referred to as Tablet Pick
  *
- * 
  * Command Summary:
  *
+ * Use report_type CONTROL (3)
+ * Use report_id   2
+ *
  * Command/Data    Description     Return Bytes    Return Value
  * 0x10/0x00       SwitchToMouse       0
  * 0x10/0x01       SwitchToTablet      0
- * 0x18/0x04       Resolution500LPI    0
- * 0x17/0x00       FilterOn            0
+ * 0x18/0x04       SetResolution       0 
  * 0x12/0xFF       AutoGainOn          0
+ * 0x17/0x00       FilterOn            0
  * 0x01/0x00       GetXExtension       2           MaxX
  * 0x01/0x01       GetYExtension       2           MaxY
  * 0x02/0x00       GetModelCode        2           ModelCode = LOBYTE
  * 0x03/0x00       GetODMCode          2           ODMCode
  * 0x08/0x00       GetPressureLevels   2           =512
  * 0x04/0x00       GetFirmwareVersion  2           Firmware Version
- *
+ * 0x11/0x02       EnableMacroKeys     0
  *
  * To initialize the tablet:
  *
- * (1) Send command Resolution500LPI
- * (2) Option Commands (GetXExtension, GetYExtension)
- * (3) Send command SwitchToTablet
+ * (1) Send Resolution500LPI (Command)
+ * (2) Query for Model code (Option Report)
+ * (3) Query for ODM code (Option Report)
+ * (4) Query for firmware (Option Report)
+ * (5) Query for GetXExtension (Option Report)
+ * (6) Query for GetYExtension (Option Report)
+ * (7) Query for GetPressureLevels (Option Report)
+ * (8) SwitchToTablet for Absolute coordinates, or
+ *     SwitchToMouse for Relative coordinates (Command)
+ * (9) EnableMacroKeys (Command)
+ * (10) FilterOn (Command)
+ * (11) AutoGainOn (Command)
+ *
+ * (Step 9 can be omitted, but you'll then have no function keys.)
  */
 
-#define USB_VENDOR_ID_AIPTEK   0x08ca
+#define USB_VENDOR_ID_AIPTEK				0x08ca
+#define USB_REQ_GET_REPORT				0x01
+#define USB_REQ_SET_REPORT				0x09
+
+	/* PointerMode codes
+	 */
+#define AIPTEK_POINTER_ONLY_MOUSE_MODE			0
+#define AIPTEK_POINTER_ONLY_STYLUS_MODE			1
+#define AIPTEK_POINTER_EITHER_MODE			2
+
+#define AIPTEK_POINTER_ALLOW_MOUSE_MODE(a)		\
+	(a == AIPTEK_POINTER_ONLY_MOUSE_MODE ||		\
+	 a == AIPTEK_POINTER_EITHER_MODE)
+#define AIPTEK_POINTER_ALLOW_STYLUS_MODE(a)		\
+	(a == AIPTEK_POINTER_ONLY_STYLUS_MODE ||	\
+	 a == AIPTEK_POINTER_EITHER_MODE)
+
+	/* CoordinateMode code
+	 */
+#define AIPTEK_COORDINATE_RELATIVE_MODE			0
+#define AIPTEK_COORDINATE_ABSOLUTE_MODE			1
+
+       /* XTilt and YTilt values
+        */
+#define AIPTEK_TILT_MIN					(-128)
+#define AIPTEK_TILT_MAX					127
+#define AIPTEK_TILT_DISABLE				(-10101)
+
+	/* Wheel values
+	 */
+#define AIPTEK_WHEEL_MIN				0
+#define AIPTEK_WHEEL_MAX				1024
+#define AIPTEK_WHEEL_DISABLE				(-10101)
+
+	/* ToolCode values, which BTW are 0x140 .. 0x14f
+	 * We have things set up such that if TOOL_BUTTON_FIRED_BIT is
+	 * not set, we'll send one instance of AIPTEK_TOOL_BUTTON_xxx.
+	 *
+	 * Whenever the user resets the value, TOOL_BUTTON_FIRED_BIT will
+	 * get reset.
+	 */
+#define TOOL_BUTTON(x)					((x) & 0x14f)
+#define TOOL_BUTTON_FIRED(x)				((x) & 0x200)
+#define TOOL_BUTTON_FIRED_BIT				0x200
+	/* toolMode codes
+	 */
+#define AIPTEK_TOOL_BUTTON_PEN_MODE			BTN_TOOL_PEN
+#define AIPTEK_TOOL_BUTTON_PEN_MODE			BTN_TOOL_PEN
+#define AIPTEK_TOOL_BUTTON_PENCIL_MODE			BTN_TOOL_PENCIL
+#define AIPTEK_TOOL_BUTTON_BRUSH_MODE			BTN_TOOL_BRUSH
+#define AIPTEK_TOOL_BUTTON_AIRBRUSH_MODE		BTN_TOOL_AIRBRUSH
+#define AIPTEK_TOOL_BUTTON_ERASER_MODE			BTN_TOOL_RUBBER
+#define AIPTEK_TOOL_BUTTON_MOUSE_MODE			BTN_TOOL_MOUSE
+#define AIPTEK_TOOL_BUTTON_LENS_MODE			BTN_TOOL_LENS
+
+	/* Diagnostic message codes
+	 */
+#define AIPTEK_DIAGNOSTIC_NA				0
+#define AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE	1
+#define AIPTEK_DIAGNOSTIC_SENDING_ABSOLUTE_IN_RELATIVE	2
+#define AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED		3
+
+	/* Time to wait (in ms) to help mask hand jittering 
+	 * when pressing the stylus buttons.
+	 */
+#define AIPTEK_JITTER_DELAY_DEFAULT			50
+
+	/* Time to wait (in ms) in-between sending the tablet
+	 * a command and beginning the process of reading the return
+	 * sequence from the tablet.
+	 */
+#define AIPTEK_PROGRAMMABLE_DELAY_25		25
+#define AIPTEK_PROGRAMMABLE_DELAY_50		50
+#define AIPTEK_PROGRAMMABLE_DELAY_100		100
+#define AIPTEK_PROGRAMMABLE_DELAY_200		200
+#define AIPTEK_PROGRAMMABLE_DELAY_300		300
+#define AIPTEK_PROGRAMMABLE_DELAY_400		400
+#define AIPTEK_PROGRAMMABLE_DELAY_DEFAULT	AIPTEK_PROGRAMMABLE_DELAY_400
+
+	/* Mouse button programming
+	 */
+#define AIPTEK_MOUSE_LEFT_BUTTON		0x01
+#define AIPTEK_MOUSE_RIGHT_BUTTON		0x02
+#define AIPTEK_MOUSE_MIDDLE_BUTTON		0x04
+
+	/* Stylus button programming
+	 */
+#define AIPTEK_STYLUS_LOWER_BUTTON		0x08
+#define AIPTEK_STYLUS_UPPER_BUTTON		0x10
+
+	/* Length of incoming packet from the tablet
+	 */
+#define AIPTEK_PACKET_LENGTH			8
+
+	/* We report in EV_MISC both the proximity and
+	 * whether the report came from the stylus, tablet mouse
+	 * or "unknown" -- Unknown when the tablet is in relative
+	 * mode, because we only get report 1's.
+	 */
+#define AIPTEK_REPORT_TOOL_UNKNOWN		0x10
+#define AIPTEK_REPORT_TOOL_STYLUS		0x20
+#define AIPTEK_REPORT_TOOL_MOUSE		0x40
+
+static int programmableDelay = AIPTEK_PROGRAMMABLE_DELAY_DEFAULT;
+static int jitterDelay = AIPTEK_JITTER_DELAY_DEFAULT;
 
 struct aiptek_features {
-	char *name;
-	int pktlen;
-	int x_max;
-	int y_max;
-	int pressure_min;
-	int pressure_max;
-	usb_complete_t irq;
-	unsigned long evbit;
-	unsigned long absbit;
-	unsigned long relbit;
-	unsigned long btnbit;
-	unsigned long digibit;
+	int odmCode;		/* Tablet manufacturer code       */
+	int modelCode;		/* Tablet model code (not unique) */
+	int firmwareCode;	/* prom/eeprom version            */
+	char usbPath[64 + 1];	/* device's physical usb path     */
+	char inputPath[64 + 1];	/* input device path              */
+	char manuName[64 + 1];	/* manufacturer name              */
+	char prodName[64 + 1];	/* product name                   */
+};
+
+struct aiptek_settings {
+	int pointerMode;	/* stylus-, mouse-only or either */
+	int coordinateMode;	/* absolute/relative coords      */
+	int toolMode;		/* pen, pencil, brush, etc. tool */
+	int xTilt;		/* synthetic xTilt amount        */
+	int yTilt;		/* synthetic yTilt amount        */
+	int wheel;		/* synthetic wheel amount        */
+	int stylusButtonUpper;	/* stylus upper btn delivers...  */
+	int stylusButtonLower;	/* stylus lower btn delivers...  */
+	int mouseButtonLeft;	/* mouse left btn delivers...    */
+	int mouseButtonMiddle;	/* mouse middle btn delivers...  */
+	int mouseButtonRight;	/* mouse right btn delivers...   */
+	int programmableDelay;	/* delay for tablet programming  */
+	int jitterDelay;	/* delay for hand jittering      */
 };
 
 struct aiptek {
-	struct input_dev dev;
-	struct usb_device *usbdev;
-	struct urb *irq;
-	struct aiptek_features *features;
-	int tool;
-	int open;
-
-	signed char *data;
-	dma_addr_t data_dma;
+	struct input_dev inputdev;		/* input device struct           */
+	struct usb_device *usbdev;		/* usb device struct             */
+	struct urb *urb;			/* urb for incoming reports      */
+	dma_addr_t data_dma;			/* our dma stuffage              */
+	struct aiptek_features features;	/* tablet's array of features    */
+	struct aiptek_settings curSetting;	/* tablet's current programmable */
+	struct aiptek_settings newSetting;	/* ... and new param settings    */
+	unsigned int ifnum;			/* interface number for IO       */
+	int openCount;				/* module use counter            */
+	int diagnostic;				/* tablet diagnostic codes       */
+	unsigned long eventCount;		/* event count                   */
+	int inDelay;				/* jitter: in jitter delay?      */
+	unsigned long endDelay;			/* jitter: time when delay ends  */
+	int previousJitterable;			/* jitterable prev value     */
+	unsigned char *data;			/* incoming packet data          */
+};
+
+/*
+ * Permit easy lookup of keyboard events to send, versus
+ * the bitmap which comes from the tablet. This hides the
+ * issue that the F_keys are not sequentially numbered.
+ */
+static int macroKeyEvents[] = {
+	KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
+	KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
+	KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
+	KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22, KEY_F23,
+	KEY_F24, KEY_STOP, KEY_AGAIN, KEY_PROPS, KEY_UNDO,
+	KEY_FRONT, KEY_COPY, KEY_OPEN, KEY_PASTE, 0
 };
 
-static void
-aiptek_irq(struct urb *urb, struct pt_regs *regs)
+/***********************************************************************
+ * Relative reports deliver values in 2's complement format to
+ * deal with negative offsets.
+ */
+static int aiptek_convert_from_2s_complement(unsigned char c)
+{
+	int ret;
+	unsigned char b = c;
+	int negate = 0;
+
+	if ((b & 0x80) != 0) {
+		b = ~b;
+		b--;
+		negate = 1;
+	}
+	ret = b;
+	ret = (negate == 1) ? -ret : ret;
+	return ret;
+}
+
+/***********************************************************************
+ * aiptek_irq can receive one of six potential reports.
+ * The documentation for each is in the body of the function.
+ *
+ * The tablet reports on several attributes per invocation of
+ * aiptek_irq. Because the Linux Input Event system allows the
+ * transmission of ONE attribute per input_report_xxx() call,
+ * collation has to be done on the other end to reconstitute
+ * a complete tablet report. Further, the number of Input Event reports
+ * submitted varies, depending on what USB report type, and circumstance.
+ * To deal with this, EV_MSC is used to indicate an 'end-of-report'
+ * message. This has been an undocumented convention understood by the kernel
+ * tablet driver and clients such as gpm and XFree86's tablet drivers.
+ *
+ * Of the information received from the tablet, the one piece I
+ * cannot transmit is the proximity bit (without resorting to an EV_MSC
+ * convention above.) I therefore have taken over REL_MISC and ABS_MISC
+ * (for relative and absolute reports, respectively) for communicating
+ * Proximity. Why two events? I thought it interesting to know if the
+ * Proximity event occured while the tablet was in absolute or relative
+ * mode.
+ *
+ * Other tablets use the notion of a certain minimum stylus pressure
+ * to infer proximity. While that could have been done, that is yet
+ * another 'by convention' behavior, the documentation for which
+ * would be spread between two (or more) pieces of software.
+ *
+ * EV_MSC usage was terminated for this purpose in Linux 2.5.x, and
+ * replaced with the input_sync() method (which emits EV_SYN.)
+ */
+
+static void aiptek_irq(struct urb *urb, struct pt_regs *regs)
 {
 	struct aiptek *aiptek = urb->context;
 	unsigned char *data = aiptek->data;
-	struct input_dev *dev = &aiptek->dev;
-	int x;
-	int y;
-	int pressure;
-	int proximity;
-	int retval;
+	struct input_dev *inputdev = &aiptek->inputdev;
+	int jitterable = 0;
+	int retval, macro, x, y, z, left, right, middle, p, dv, tip, bs, pck;
 
 	switch (urb->status) {
 	case 0:
-		/* success */
+		/* Success */
 		break;
+
 	case -ECONNRESET:
 	case -ENOENT:
 	case -ESHUTDOWN:
-		/* this urb is terminated, clean up */
-		dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
+		/* This urb is terminated, clean up */
+		dbg("%s - urb shutting down with status: %d",
+		    __FUNCTION__, urb->status);
 		return;
+
 	default:
-		dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
+		dbg("%s - nonzero urb status received: %d",
+		    __FUNCTION__, urb->status);
+		goto exit;
+	}
+
+	/* See if we are in a delay loop -- throw out report if true.
+	 */
+	if (aiptek->inDelay == 1 && time_after(aiptek->endDelay, jiffies)) {
 		goto exit;
 	}
 
-	if ((data[0] & 2) == 0) {
-		dbg("received unknown report #%d", data[0]);
+	aiptek->inDelay = 0;
+	aiptek->eventCount++;
+
+	/* Report 1 delivers relative coordinates with either a stylus
+	 * or the mouse. You do not know, however, which input
+	 * tool generated the event.
+	 */
+	if (data[0] == 1) {
+		if (aiptek->curSetting.coordinateMode ==
+		    AIPTEK_COORDINATE_ABSOLUTE_MODE) {
+			aiptek->diagnostic =
+			    AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE;
+		} else {
+			input_regs(inputdev, regs);
+
+			x = aiptek_convert_from_2s_complement(data[2]);
+			y = aiptek_convert_from_2s_complement(data[3]);
+
+			/* jitterable keeps track of whether any button has been pressed.
+			 * We're also using it to remap the physical mouse button mask
+			 * to pseudo-settings. (We don't specifically care about it's
+			 * value after moving/transposing mouse button bitmasks, except
+			 * that a non-zero value indicates that one or more
+			 * mouse button was pressed.)
+			 */
+			jitterable = data[5] & 0x07;
+
+			left = (data[5] & aiptek->curSetting.mouseButtonLeft) != 0 ? 1 : 0;
+			right = (data[5] & aiptek->curSetting.mouseButtonRight) != 0 ? 1 : 0;
+			middle = (data[5] & aiptek->curSetting.mouseButtonMiddle) != 0 ? 1 : 0;
+
+			input_report_key(inputdev, BTN_LEFT, left);
+			input_report_key(inputdev, BTN_MIDDLE, middle);
+			input_report_key(inputdev, BTN_RIGHT, right);
+			input_report_rel(inputdev, REL_X, x);
+			input_report_rel(inputdev, REL_Y, y);
+			input_report_rel(inputdev, REL_MISC, 1 | AIPTEK_REPORT_TOOL_UNKNOWN);
+
+			/* Wheel support is in the form of a single-event
+			 * firing.
+			 */
+			if (aiptek->curSetting.wheel != AIPTEK_WHEEL_DISABLE) {
+				input_report_rel(inputdev, REL_WHEEL,
+						 aiptek->curSetting.wheel);
+				aiptek->curSetting.wheel = AIPTEK_WHEEL_DISABLE;
+			}
+			input_sync(inputdev);
+		}
+	}
+	/* Report 2 is delivered only by the stylus, and delivers
+	 * absolute coordinates.
+	 */
+	else if (data[0] == 2) {
+		if (aiptek->curSetting.coordinateMode == AIPTEK_COORDINATE_RELATIVE_MODE) {
+			aiptek->diagnostic = AIPTEK_DIAGNOSTIC_SENDING_ABSOLUTE_IN_RELATIVE;
+		} else if (!AIPTEK_POINTER_ALLOW_STYLUS_MODE
+			    (aiptek->curSetting.pointerMode)) {
+				aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED;
+		} else {
+			input_regs(inputdev, regs);
+
+			x = le16_to_cpu(get_unaligned((__u16 *) (data + 1)));
+			y = le16_to_cpu(get_unaligned((__u16 *) (data + 3)));
+			z = le16_to_cpu(get_unaligned((__u16 *) (data + 6)));
+
+			p = (data[5] & 0x01) != 0 ? 1 : 0;
+			dv = (data[5] & 0x02) != 0 ? 1 : 0;
+			tip = (data[5] & 0x04) != 0 ? 1 : 0;
+
+			/* Use jitterable to re-arrange button masks
+			 */
+			jitterable = data[5] & 0x18;
+
+			bs = (data[5] & aiptek->curSetting.stylusButtonLower) != 0 ? 1 : 0;
+			pck = (data[5] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0;
+
+			/* dv indicates 'data valid' (e.g., the tablet is in sync
+			 * and has delivered a "correct" report) We will ignore
+			 * all 'bad' reports...
+			 */
+			if (dv != 0) {
+				/* If we've not already sent a tool_button_?? code, do
+				 * so now. Then set FIRED_BIT so it won't be resent unless
+				 * the user forces FIRED_BIT off.
+				 */
+				if (TOOL_BUTTON_FIRED
+				    (aiptek->curSetting.toolMode) == 0) {
+					input_report_key(inputdev,
+							 TOOL_BUTTON(aiptek->curSetting.toolMode),
+							 1);
+					aiptek->curSetting.toolMode |= TOOL_BUTTON_FIRED_BIT;
+				}
+
+				if (p != 0) {
+					input_report_abs(inputdev, ABS_X, x);
+					input_report_abs(inputdev, ABS_Y, y);
+					input_report_abs(inputdev, ABS_PRESSURE, z);
+
+					input_report_key(inputdev, BTN_TOUCH, tip);
+					input_report_key(inputdev, BTN_STYLUS, bs);
+					input_report_key(inputdev, BTN_STYLUS2, pck);
+
+					if (aiptek->curSetting.xTilt !=
+					    AIPTEK_TILT_DISABLE) {
+						input_report_abs(inputdev,
+								 ABS_TILT_X,
+								 aiptek->curSetting.xTilt);
+					}
+					if (aiptek->curSetting.yTilt != AIPTEK_TILT_DISABLE) {
+						input_report_abs(inputdev,
+								 ABS_TILT_Y,
+								 aiptek->curSetting.yTilt);
+					}
+
+					/* Wheel support is in the form of a single-event
+					 * firing.
+					 */
+					if (aiptek->curSetting.wheel !=
+					    AIPTEK_WHEEL_DISABLE) {
+						input_report_abs(inputdev,
+								 ABS_WHEEL,
+								 aiptek->curSetting.wheel);
+						aiptek->curSetting.wheel = AIPTEK_WHEEL_DISABLE;
+					}
+				}
+				input_report_abs(inputdev, ABS_MISC, p | AIPTEK_REPORT_TOOL_STYLUS);
+				input_sync(inputdev);
+			}
+		}
+	}
+	/* Report 3's come from the mouse in absolute mode.
+	 */
+	else if (data[0] == 3) {
+		if (aiptek->curSetting.coordinateMode == AIPTEK_COORDINATE_RELATIVE_MODE) {
+			aiptek->diagnostic = AIPTEK_DIAGNOSTIC_SENDING_ABSOLUTE_IN_RELATIVE;
+		} else if (!AIPTEK_POINTER_ALLOW_MOUSE_MODE
+			(aiptek->curSetting.pointerMode)) {
+			aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED;
+		} else {
+			input_regs(inputdev, regs);
+			x = le16_to_cpu(get_unaligned((__u16 *) (data + 1)));
+			y = le16_to_cpu(get_unaligned((__u16 *) (data + 3)));
+
+			jitterable = data[5] & 0x1c;
+
+			p = (data[5] & 0x01) != 0 ? 1 : 0;
+			dv = (data[5] & 0x02) != 0 ? 1 : 0;
+			left = (data[5] & aiptek->curSetting.mouseButtonLeft) != 0 ? 1 : 0;
+			right = (data[5] & aiptek->curSetting.mouseButtonRight) != 0 ? 1 : 0;
+			middle = (data[5] & aiptek->curSetting.mouseButtonMiddle) != 0 ? 1 : 0;
+
+			if (dv != 0) {
+				/* If we've not already sent a tool_button_?? code, do
+				 * so now. Then set FIRED_BIT so it won't be resent unless
+				 * the user forces FIRED_BIT off.
+				 */
+				if (TOOL_BUTTON_FIRED
+				    (aiptek->curSetting.toolMode) == 0) {
+					input_report_key(inputdev,
+							 TOOL_BUTTON(aiptek->curSetting.toolMode),
+							 1);
+					aiptek->curSetting.toolMode |= TOOL_BUTTON_FIRED_BIT;
+				}
+
+				if (p != 0) {
+					input_report_abs(inputdev, ABS_X, x);
+					input_report_abs(inputdev, ABS_Y, y);
+
+					input_report_key(inputdev, BTN_LEFT, left);
+					input_report_key(inputdev, BTN_MIDDLE, middle);
+					input_report_key(inputdev, BTN_RIGHT, right);
+
+					/* Wheel support is in the form of a single-event
+					 * firing.
+					 */
+					if (aiptek->curSetting.wheel != AIPTEK_WHEEL_DISABLE) {
+						input_report_abs(inputdev,
+								 ABS_WHEEL,
+								 aiptek->curSetting.wheel);
+						aiptek->curSetting.wheel = AIPTEK_WHEEL_DISABLE;
+					}
+				}
+				input_report_rel(inputdev, REL_MISC, p | AIPTEK_REPORT_TOOL_MOUSE);
+				input_sync(inputdev);
+			}
+		}
+	}
+	/* Report 4s come from the macro keys when pressed by stylus
+	 */
+	else if (data[0] == 4) {
+		jitterable = data[1] & 0x18;
+
+		p = (data[1] & 0x01) != 0 ? 1 : 0;
+		dv = (data[1] & 0x02) != 0 ? 1 : 0;
+		tip = (data[1] & 0x04) != 0 ? 1 : 0;
+		bs = (data[1] & aiptek->curSetting.stylusButtonLower) != 0 ? 1 : 0;
+		pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0;
+
+		macro = data[3];
+		z = le16_to_cpu(get_unaligned((__u16 *) (data + 4)));
+
+		if (dv != 0) {
+			input_regs(inputdev, regs);
+
+			/* If we've not already sent a tool_button_?? code, do
+			 * so now. Then set FIRED_BIT so it won't be resent unless
+			 * the user forces FIRED_BIT off.
+			 */
+			if (TOOL_BUTTON_FIRED(aiptek->curSetting.toolMode) == 0) {
+				input_report_key(inputdev,
+						 TOOL_BUTTON(aiptek->curSetting.toolMode),
+						 1);
+				aiptek->curSetting.toolMode |= TOOL_BUTTON_FIRED_BIT;
+			}
+
+			if (p != 0) {
+				input_report_key(inputdev, BTN_TOUCH, tip);
+				input_report_key(inputdev, BTN_STYLUS, bs);
+				input_report_key(inputdev, BTN_STYLUS2, pck);
+				input_report_abs(inputdev, ABS_PRESSURE, z);
+			}
+
+			/* For safety, we're sending key 'break' codes for the
+			 * neighboring macro keys.
+			 */
+			if (macro > 0) {
+				input_report_key(inputdev,
+						 macroKeyEvents[macro - 1], 0);
+			}
+			if (macro < 25) {
+				input_report_key(inputdev,
+						 macroKeyEvents[macro + 1], 0);
+			}
+			input_report_key(inputdev, macroKeyEvents[macro], p);
+			input_report_abs(inputdev, ABS_MISC,
+					 p | AIPTEK_REPORT_TOOL_STYLUS);
+			input_sync(inputdev);
+		}
 	}
+	/* Report 5s come from the macro keys when pressed by mouse
+	 */
+	else if (data[0] == 5) {
+		jitterable = data[1] & 0x1c;
 
-	input_regs(dev, regs);
+		p = (data[1] & 0x01) != 0 ? 1 : 0;
+		dv = (data[1] & 0x02) != 0 ? 1 : 0;
+		left = (data[1]& aiptek->curSetting.mouseButtonLeft) != 0 ? 1 : 0;
+		right = (data[1] & aiptek->curSetting.mouseButtonRight) != 0 ? 1 : 0;
+		middle = (data[1] & aiptek->curSetting.mouseButtonMiddle) != 0 ? 1 : 0;
+		macro = data[3];
 
-	proximity = data[5] & 0x01;
-	input_report_key(dev, BTN_TOOL_PEN, proximity);
+		if (dv != 0) {
+			input_regs(inputdev, regs);
 
-	x = le16_to_cpu(get_unaligned((u16 *) &data[1]));
-	y = le16_to_cpu(get_unaligned((u16 *) &data[3]));
-	pressure = le16_to_cpu(*(u16 *) &data[6]);
-	pressure -= aiptek->features->pressure_min;
+			/* If we've not already sent a tool_button_?? code, do
+			 * so now. Then set FIRED_BIT so it won't be resent unless
+			 * the user forces FIRED_BIT off.
+			 */
+			if (TOOL_BUTTON_FIRED(aiptek->curSetting.toolMode) == 0) {
+				input_report_key(inputdev,
+						 TOOL_BUTTON(aiptek->curSetting.toolMode),
+						 1);
+				aiptek->curSetting.toolMode |= TOOL_BUTTON_FIRED_BIT;
+			}
 
-	if (pressure < 0) {
-		pressure = 0;
+			if (p != 0) {
+				input_report_key(inputdev, BTN_LEFT, left);
+				input_report_key(inputdev, BTN_MIDDLE, middle);
+				input_report_key(inputdev, BTN_RIGHT, right);
+			}
+
+			/* For safety, we're sending key 'break' codes for the
+			 * neighboring macro keys.
+			 */
+			if (macro > 0) {
+				input_report_key(inputdev,
+						 macroKeyEvents[macro - 1], 0);
+			}
+			if (macro < 25) {
+				input_report_key(inputdev,
+						 macroKeyEvents[macro + 1], 0);
+			}
+
+			input_report_key(inputdev, macroKeyEvents[macro], 1);
+			input_report_rel(inputdev, ABS_MISC,
+					 p | AIPTEK_REPORT_TOOL_MOUSE);
+			input_sync(inputdev);
+		}
 	}
+	/* We have no idea which tool can generate a report 6. Theoretically,
+	 * neither need to, having been given reports 4 & 5 for such use.
+	 * However, report 6 is the 'official-looking' report for macroKeys;
+	 * reports 4 & 5 supposively are used to support unnamed, unknown
+	 * hat switches (which just so happen to be the macroKeys.)
+	 */
+	else if (data[0] == 6) {
+		macro = le16_to_cpu(get_unaligned((__u16 *) (data + 1)));
+		input_regs(inputdev, regs);
+
+		if (macro > 0) {
+			input_report_key(inputdev, macroKeyEvents[macro - 1],
+					 0);
+		}
+		if (macro < 25) {
+			input_report_key(inputdev, macroKeyEvents[macro + 1],
+					 0);
+		}
+
+		/* If we've not already sent a tool_button_?? code, do
+		 * so now. Then set FIRED_BIT so it won't be resent unless
+		 * the user forces FIRED_BIT off.
+		 */
+		if (TOOL_BUTTON_FIRED(aiptek->curSetting.toolMode) == 0) {
+			input_report_key(inputdev,
+					 TOOL_BUTTON(aiptek->curSetting.
+						     toolMode), 1);
+			aiptek->curSetting.toolMode |= TOOL_BUTTON_FIRED_BIT;
+		}
 
-	if (proximity) {
-		input_report_abs(dev, ABS_X, x);
-		input_report_abs(dev, ABS_Y, y);
-		input_report_abs(dev, ABS_PRESSURE, pressure);
-		input_report_key(dev, BTN_TOUCH, data[5] & 0x04);
-		input_report_key(dev, BTN_STYLUS, data[5] & 0x08);
-		input_report_key(dev, BTN_STYLUS2, data[5] & 0x10);
+		input_report_key(inputdev, macroKeyEvents[macro], 1);
+		input_report_abs(inputdev, ABS_MISC,
+				 1 | AIPTEK_REPORT_TOOL_UNKNOWN);
+		input_sync(inputdev);
+	} else {
+		dbg("Unknown report %d", data[0]);
 	}
 
-	input_sync(dev);
+	/* Jitter may occur when the user presses a button on the stlyus
+	 * or the mouse. What we do to prevent that is wait 'x' milliseconds
+	 * following a 'jitterable' event, which should give the hand some time
+	 * stabilize itself.
+	 *
+	 * We just introduced aiptek->previousJitterable to carry forth the
+	 * notion that jitter occurs when the button state changes from on to off:
+	 * a person drawing, holding a button down is not subject to jittering.
+	 * With that in mind, changing from upper button depressed to lower button
+	 * WILL transition through a jitter delay.
+	 */
+
+	if (aiptek->previousJitterable != jitterable &&
+	    aiptek->curSetting.jitterDelay != 0 && aiptek->inDelay != 1) {
+		aiptek->endDelay = jiffies +
+		    ((aiptek->curSetting.jitterDelay * HZ) / 1000);
+		aiptek->inDelay = 1;
+	}
+	aiptek->previousJitterable = jitterable;
 
 exit:
-	retval = usb_submit_urb (urb, GFP_ATOMIC);
-	if (retval)
-		err ("%s - usb_submit_urb failed with result %d",
-		     __FUNCTION__, retval);
+	retval = usb_submit_urb(urb, GFP_ATOMIC);
+	if (retval != 0) {
+		err("%s - usb_submit_urb failed with result %d",
+		    __FUNCTION__, retval);
+	}
 }
 
-struct aiptek_features aiptek_features[] = {
-	{"Aiptek 6000U/8000U",
-	 8, 3000, 2250, 26, 511, aiptek_irq, 0, 0, 0, 0},
-	{NULL, 0}
-};
-
+/***********************************************************************
+ * These are the USB id's known so far. We do not identify them to
+ * specific Aiptek model numbers, because there has been overlaps,
+ * use, and reuse of id's in existing models. Certain models have
+ * been known to use more than one ID, indicative perhaps of
+ * manufacturing revisions. In any event, we consider these 
+ * IDs to not be model-specific nor unique.
+ */
 struct usb_device_id aiptek_ids[] = {
-	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x20), .driver_info = 0},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x01)},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x10)},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x20)},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x21)},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x22)},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x23)},
+	{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x24)},
 	{}
 };
 
 MODULE_DEVICE_TABLE(usb, aiptek_ids);
 
-static int
-aiptek_open(struct input_dev *dev)
+/***********************************************************************
+ * Open an instance of the tablet driver.
+ */
+static int aiptek_open(struct input_dev *inputdev)
 {
-	struct aiptek *aiptek = dev->private;
+	struct aiptek *aiptek = inputdev->private;
 
-	if (aiptek->open++)
+	if (aiptek->openCount++ > 0) {
 		return 0;
+	}
 
-	aiptek->irq->dev = aiptek->usbdev;
-	if (usb_submit_urb(aiptek->irq, GFP_KERNEL)) {
-		aiptek->open--;
+	aiptek->urb->dev = aiptek->usbdev;
+	if (usb_submit_urb(aiptek->urb, GFP_KERNEL) != 0) {
+		aiptek->openCount--;
 		return -EIO;
 	}
 
 	return 0;
 }
 
-static void
-aiptek_close(struct input_dev *dev)
+/***********************************************************************
+ * Close an instance of the tablet driver.
+ */
+static void aiptek_close(struct input_dev *inputdev)
 {
-	struct aiptek *aiptek = dev->private;
+	struct aiptek *aiptek = inputdev->private;
+
+	if (--aiptek->openCount == 0) {
+		usb_unlink_urb(aiptek->urb);
+	}
+}
 
-	if (!--aiptek->open)
-		usb_unlink_urb(aiptek->irq);
+/***********************************************************************
+ * aiptek_set_report and aiptek_get_report() are borrowed from Linux 2.4.x, 
+ * where they were known as usb_set_report and usb_get_report.
+ */
+static int
+aiptek_set_report(struct aiptek *aiptek,
+		  unsigned char report_type,
+		  unsigned char report_id, void *buffer, int size)
+{
+	return usb_control_msg(aiptek->usbdev,
+			       usb_sndctrlpipe(aiptek->usbdev, 0),
+			       USB_REQ_SET_REPORT,
+			       USB_TYPE_CLASS | USB_RECIP_INTERFACE |
+			       USB_DIR_OUT, (report_type << 8) + report_id,
+			       aiptek->ifnum, buffer, size, 5 * HZ);
 }
 
-#define USB_REQ_SET_REPORT	0x09
 static int
-usb_set_report(struct usb_device *dev, struct usb_host_interface *inter, unsigned char type,
-		unsigned char id, void *buf, int size)
+aiptek_get_report(struct aiptek *aiptek,
+		  unsigned char report_type,
+		  unsigned char report_id, void *buffer, int size)
 {
-	return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-		USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
-		(type << 8) + id, inter->desc.bInterfaceNumber, buf, size, HZ);
+	return usb_control_msg(aiptek->usbdev,
+			       usb_rcvctrlpipe(aiptek->usbdev, 0),
+			       USB_REQ_GET_REPORT,
+			       USB_TYPE_CLASS | USB_RECIP_INTERFACE |
+			       USB_DIR_IN, (report_type << 8) + report_id,
+			       aiptek->ifnum, buffer, size, 5 * HZ);
 }
 
+/***********************************************************************
+ * Send a command to the tablet.
+ */
 static int
-aiptek_command(struct usb_device *dev, struct usb_host_interface *inter,
-	       unsigned char command, unsigned char data)
+aiptek_command(struct aiptek *aiptek, unsigned char command, unsigned char data)
 {
+	const int sizeof_buf = 3 * sizeof(u8);
+	int ret;
 	u8 *buf;
-	int err;
-	
-	buf = kmalloc(3, GFP_KERNEL);
+
+	buf = kmalloc(sizeof_buf, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
 
-	buf[0] = 4;
+	buf[0] = 2;
 	buf[1] = command;
 	buf[2] = data;
 
-	if ((err = usb_set_report(dev, inter, 3, 2, buf, 3)) != 3) {
-		dbg("aiptek_command: 0x%x 0x%x\n", command, data);
+	if ((ret =
+	     aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
+		dbg("aiptek_program: failed, tried to send: 0x%02x 0x%02x",
+		    command, data);
 	}
-	
 	kfree(buf);
-	return err < 0 ? err : 0;
+	return ret < 0 ? ret : 0;
 }
 
-static int 
-aiptek_probe(struct usb_interface *intf,
-	     const struct usb_device_id *id)
+/***********************************************************************
+ * Retrieve information from the tablet. Querying info is defined as first
+ * sending the {command,data} sequence as a command, followed by a wait
+ * (aka, "programmaticDelay") and then a "read" request.
+ */
+static int
+aiptek_query(struct aiptek *aiptek, unsigned char command, unsigned char data)
 {
-	struct usb_device *dev = interface_to_usbdev (intf);
-	struct usb_host_interface *interface = intf->cur_altsetting;
-	struct usb_endpoint_descriptor *endpoint;
-	struct aiptek *aiptek;
-	int err = -ENOMEM;
+	const int sizeof_buf = 3 * sizeof(u8);
+	int ret;
+	u8 *buf;
 
-	if (!(aiptek = kmalloc(sizeof (struct aiptek), GFP_KERNEL)))
-		goto error_out_noalloc;
+	buf = kmalloc(sizeof_buf, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
 
-	memset(aiptek, 0, sizeof (struct aiptek));
+	buf[0] = 2;
+	buf[1] = command;
+	buf[2] = data;
 
-	aiptek->data = usb_buffer_alloc(dev, 10, GFP_KERNEL, &aiptek->data_dma);
-	if (!aiptek->data) {
-		goto error_out_nobuf;
+	if (aiptek_command(aiptek, command, data) != 0) {
+		kfree(buf);
+		return -EIO;
 	}
+	msleep(aiptek->curSetting.programmableDelay);
 
-	aiptek->irq = usb_alloc_urb(0, GFP_KERNEL);
-	if (!aiptek->irq) {
-		goto error_out_nourb;
+	if ((ret =
+	     aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
+		dbg("aiptek_query failed: returned 0x%02x 0x%02x 0x%02x",
+		    buf[0], buf[1], buf[2]);
+		ret = -EIO;
+	} else {
+		ret = le16_to_cpu(get_unaligned((__u16 *) (buf + 1)));
 	}
+	kfree(buf);
+	return ret;
+}
+
+/***********************************************************************
+ * Program the tablet into either absolute or relative mode.
+ * We also get information about the tablet's size.
+ */
+static int aiptek_program_tablet(struct aiptek *aiptek)
+{
+	int ret;
+	/* Execute Resolution500LPI */
+	if ((ret = aiptek_command(aiptek, 0x18, 0x04)) < 0)
+		return ret;
 
-	/* Resolution500LPI */
-	err = aiptek_command(dev, interface, 0x18, 0x04);
-	if (err)
-		goto error_out;
+	/* Query getModelCode */
+	if ((ret = aiptek_query(aiptek, 0x02, 0x00)) < 0)
+		return ret;
+	aiptek->features.modelCode = ret & 0xff;
 
-	/* SwitchToTablet */
-	err = aiptek_command(dev, interface, 0x10, 0x01);
-	if (err)
-		goto error_out;
+	/* Query getODMCode */
+	if ((ret = aiptek_query(aiptek, 0x03, 0x00)) < 0)
+		return ret;
+	aiptek->features.odmCode = ret;
 
-	aiptek->features = aiptek_features + id->driver_info;
+	/* Query getFirmwareCode */
+	if ((ret = aiptek_query(aiptek, 0x04, 0x00)) < 0)
+		return ret;
+	aiptek->features.firmwareCode = ret;
 
-	aiptek->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC) |
-	    aiptek->features->evbit;
+	/* Query getXextension */
+	if ((ret = aiptek_query(aiptek, 0x01, 0x00)) < 0)
+		return ret;
+	aiptek->inputdev.absmin[ABS_X] = 0;
+	aiptek->inputdev.absmax[ABS_X] = ret - 1;
 
-	aiptek->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE) |
-	    BIT(ABS_MISC) | aiptek->features->absbit;
+	/* Query getYextension */
+	if ((ret = aiptek_query(aiptek, 0x01, 0x01)) < 0)
+		return ret;
+	aiptek->inputdev.absmin[ABS_Y] = 0;
+	aiptek->inputdev.absmax[ABS_Y] = ret - 1;
 
-	aiptek->dev.relbit[0] |= aiptek->features->relbit;
+	/* Query getPressureLevels */
+	if ((ret = aiptek_query(aiptek, 0x08, 0x00)) < 0)
+		return ret;
+	aiptek->inputdev.absmin[ABS_PRESSURE] = 0;
+	aiptek->inputdev.absmax[ABS_PRESSURE] = ret - 1;
 
-	aiptek->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) |
-	    BIT(BTN_MIDDLE) | aiptek->features->btnbit;
+	/* Depending on whether we are in absolute or relative mode, we will
+	 * do a switchToTablet(absolute) or switchToMouse(relative) command.
+	 */
+	if (aiptek->curSetting.coordinateMode ==
+	    AIPTEK_COORDINATE_ABSOLUTE_MODE) {
+		/* Execute switchToTablet */
+		if ((ret = aiptek_command(aiptek, 0x10, 0x01)) < 0) {
+			return ret;
+		}
+	} else {
+		/* Execute switchToMouse */
+		if ((ret = aiptek_command(aiptek, 0x10, 0x00)) < 0) {
+			return ret;
+		}
+	}
 
-	aiptek->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) |
-	    BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOUCH) |
-	    BIT(BTN_STYLUS) | BIT(BTN_STYLUS2) | aiptek->features->digibit;
+	/* Enable the macro keys */
+	if ((ret = aiptek_command(aiptek, 0x11, 0x02)) < 0)
+		return ret;
+#if 0
+	/* Execute FilterOn */
+	if ((ret = aiptek_command(aiptek, 0x17, 0x00)) < 0)
+		return ret;
+#endif
 
-	aiptek->dev.mscbit[0] = BIT(MSC_SERIAL);
+	/* Execute AutoGainOn */
+	if ((ret = aiptek_command(aiptek, 0x12, 0xff)) < 0)
+		return ret;
 
-	aiptek->dev.absmax[ABS_X] = aiptek->features->x_max;
-	aiptek->dev.absmax[ABS_Y] = aiptek->features->y_max;
-	aiptek->dev.absmax[ABS_PRESSURE] = aiptek->features->pressure_max -
-	    aiptek->features->pressure_min;
+	/* Reset the eventCount, so we track events from last (re)programming
+	 */
+	aiptek->diagnostic = AIPTEK_DIAGNOSTIC_NA;
+	aiptek->eventCount = 0;
 
-	aiptek->dev.absfuzz[ABS_X] = 0;
-	aiptek->dev.absfuzz[ABS_Y] = 0;
+	return 0;
+}
 
-	aiptek->dev.private = aiptek;
-	aiptek->dev.open = aiptek_open;
-	aiptek->dev.close = aiptek_close;
+/***********************************************************************
+ * Sysfs functions. Sysfs prefers that individually-tunable parameters
+ * exist in their separate pseudo-files. Summary data that is immutable
+ * may exist in a singular file so long as you don't define a writeable
+ * interface.
+ */
 
-	aiptek->dev.name = aiptek->features->name;
-	aiptek->dev.id.bustype = BUS_USB;
-	aiptek->dev.id.vendor = dev->descriptor.idVendor;
-	aiptek->dev.id.product = dev->descriptor.idProduct;
-	aiptek->dev.id.version = dev->descriptor.bcdDevice;
-	aiptek->dev.dev = &intf->dev;
-	aiptek->usbdev = dev;
+/***********************************************************************
+ * support the 'size' file -- display support
+ */
+static ssize_t show_tabletSize(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
 
-	endpoint = &intf->altsetting[0].endpoint[0].desc;
+	if (aiptek == NULL)
+		return 0;
 
-	if (aiptek->features->pktlen > 10)
-		BUG();
+	return snprintf(buf, PAGE_SIZE, "%dx%d\n",
+			aiptek->inputdev.absmax[ABS_X] + 1,
+			aiptek->inputdev.absmax[ABS_Y] + 1);
+}
 
-	usb_fill_int_urb(aiptek->irq, dev,
-			 usb_rcvintpipe(dev, endpoint->bEndpointAddress),
-			 aiptek->data, aiptek->features->pktlen,
-			 aiptek->features->irq, aiptek, endpoint->bInterval);
-	aiptek->irq->transfer_dma = aiptek->data_dma;
-	aiptek->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+/* These structs define the sysfs files, param #1 is the name of the
+ * file, param 2 is the file permissions, param 3 & 4 are to the
+ * output generator and input parser routines. Absence of a routine is
+ * permitted -- it only means can't either 'cat' the file, or send data
+ * to it.
+ */
+static DEVICE_ATTR(size, S_IRUGO, show_tabletSize, NULL);
 
-	input_register_device(&aiptek->dev);
+/***********************************************************************
+ * support routines for the 'product_id' file
+ */
+static ssize_t show_tabletProductId(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
 
-	printk(KERN_INFO "input: %s on usb%d:%d\n",
-	       aiptek->features->name, dev->bus->busnum, dev->devnum);
+	if (aiptek == NULL)
+		return 0;
 
-	usb_set_intfdata(intf, aiptek);
-	return 0;
+	return snprintf(buf, PAGE_SIZE, "0x%04x\n",
+			aiptek->inputdev.id.product);
+}
+
+static DEVICE_ATTR(product_id, S_IRUGO, show_tabletProductId, NULL);
+
+/***********************************************************************
+ * support routines for the 'vendor_id' file
+ */
+static ssize_t show_tabletVendorId(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
 
-error_out:
-	usb_free_urb(aiptek->irq);
-error_out_nourb:
-	usb_buffer_free(dev, 10, aiptek->data, aiptek->data_dma);
-error_out_nobuf:
-	kfree(aiptek);
-error_out_noalloc:
-	return err;
-	
+	return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->inputdev.id.vendor);
 }
 
-static void
-aiptek_disconnect(struct usb_interface *intf)
+static DEVICE_ATTR(vendor_id, S_IRUGO, show_tabletVendorId, NULL);
+
+/***********************************************************************
+ * support routines for the 'vendor' file
+ */
+static ssize_t show_tabletManufacturer(struct device *dev, char *buf)
 {
-	struct aiptek *aiptek  = usb_get_intfdata (intf);
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	int retval;
 
-	usb_set_intfdata(intf, NULL);
-	if (aiptek) {
-		usb_unlink_urb(aiptek->irq);
-		input_unregister_device(&aiptek->dev);
-		usb_free_urb(aiptek->irq);
-		usb_buffer_free(interface_to_usbdev(intf), 10, aiptek->data, aiptek->data_dma);
-		kfree(aiptek);
+	if (aiptek == NULL)
+		return 0;
+
+	retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->features.manuName);
+	return retval;
+}
+
+static DEVICE_ATTR(vendor, S_IRUGO, show_tabletManufacturer, NULL);
+
+/***********************************************************************
+ * support routines for the 'product' file
+ */
+static ssize_t show_tabletProduct(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	int retval;
+
+	if (aiptek == NULL)
+		return 0;
+
+	retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->features.prodName);
+	return retval;
+}
+
+static DEVICE_ATTR(product, S_IRUGO, show_tabletProduct, NULL);
+
+/***********************************************************************
+ * support routines for the 'pointer_mode' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletPointerMode(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.pointerMode) {
+	case AIPTEK_POINTER_ONLY_STYLUS_MODE:
+		s = "stylus";
+		break;
+
+	case AIPTEK_POINTER_ONLY_MOUSE_MODE:
+		s = "mouse";
+		break;
+
+	case AIPTEK_POINTER_EITHER_MODE:
+		s = "either";
+		break;
+
+	default:
+		s = "unknown";
+		break;
 	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
 }
 
-static struct usb_driver aiptek_driver = {
-	.owner =	THIS_MODULE,
-	.name =		"aiptek",
-	.probe =	aiptek_probe,
-	.disconnect =	aiptek_disconnect,
-	.id_table =	aiptek_ids,
-};
+static ssize_t
+store_tabletPointerMode(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "stylus") == 0) {
+		aiptek->newSetting.pointerMode =
+		    AIPTEK_POINTER_ONLY_STYLUS_MODE;
+	} else if (strcmp(buf, "mouse") == 0) {
+		aiptek->newSetting.pointerMode = AIPTEK_POINTER_ONLY_MOUSE_MODE;
+	} else if (strcmp(buf, "either") == 0) {
+		aiptek->newSetting.pointerMode = AIPTEK_POINTER_EITHER_MODE;
+	}
+	return count;
+}
 
-static int __init
-aiptek_init(void)
+static DEVICE_ATTR(pointer_mode,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletPointerMode, store_tabletPointerMode);
+
+/***********************************************************************
+ * support routines for the 'coordinate_mode' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletCoordinateMode(struct device *dev, char *buf)
 {
-	int result = usb_register(&aiptek_driver);
-	if (result == 0) {
-		info(DRIVER_VERSION " " DRIVER_AUTHOR);
-		info(DRIVER_DESC);
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.coordinateMode) {
+	case AIPTEK_COORDINATE_ABSOLUTE_MODE:
+		s = "absolute";
+		break;
+
+	case AIPTEK_COORDINATE_RELATIVE_MODE:
+		s = "relative";
+		break;
+
+	default:
+		s = "unknown";
+		break;
 	}
-	return result;
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
 }
 
-static void __exit
-aiptek_exit(void)
+static ssize_t
+store_tabletCoordinateMode(struct device *dev, const char *buf, size_t count)
 {
-	usb_deregister(&aiptek_driver);
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "absolute") == 0) {
+		aiptek->newSetting.pointerMode =
+		    AIPTEK_COORDINATE_ABSOLUTE_MODE;
+	} else if (strcmp(buf, "relative") == 0) {
+		aiptek->newSetting.pointerMode =
+		    AIPTEK_COORDINATE_RELATIVE_MODE;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(coordinate_mode,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletCoordinateMode, store_tabletCoordinateMode);
+
+/***********************************************************************
+ * support routines for the 'tool_mode' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletToolMode(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (TOOL_BUTTON(aiptek->curSetting.toolMode)) {
+	case AIPTEK_TOOL_BUTTON_MOUSE_MODE:
+		s = "mouse";
+		break;
+
+	case AIPTEK_TOOL_BUTTON_ERASER_MODE:
+		s = "eraser";
+		break;
+
+	case AIPTEK_TOOL_BUTTON_PENCIL_MODE:
+		s = "pencil";
+		break;
+
+	case AIPTEK_TOOL_BUTTON_PEN_MODE:
+		s = "pen";
+		break;
+
+	case AIPTEK_TOOL_BUTTON_BRUSH_MODE:
+		s = "brush";
+		break;
+
+	case AIPTEK_TOOL_BUTTON_AIRBRUSH_MODE:
+		s = "airbrush";
+		break;
+
+	case AIPTEK_TOOL_BUTTON_LENS_MODE:
+		s = "lens";
+		break;
+
+	default:
+		s = "unknown";
+		break;
+	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
 }
 
+static ssize_t
+store_tabletToolMode(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "mouse") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_MOUSE_MODE;
+	} else if (strcmp(buf, "eraser") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_ERASER_MODE;
+	} else if (strcmp(buf, "pencil") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_PENCIL_MODE;
+	} else if (strcmp(buf, "pen") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_PEN_MODE;
+	} else if (strcmp(buf, "brush") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_BRUSH_MODE;
+	} else if (strcmp(buf, "airbrush") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_AIRBRUSH_MODE;
+	} else if (strcmp(buf, "lens") == 0) {
+		aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_LENS_MODE;
+	}
+
+	return count;
+}
+
+static DEVICE_ATTR(tool_mode,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletToolMode, store_tabletToolMode);
+
+/***********************************************************************
+ * support routines for the 'xtilt' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletXtilt(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (aiptek->curSetting.xTilt == AIPTEK_TILT_DISABLE) {
+		return snprintf(buf, PAGE_SIZE, "disable\n");
+	} else {
+		return snprintf(buf, PAGE_SIZE, "%d\n",
+				aiptek->curSetting.xTilt);
+	}
+}
+
+static ssize_t
+store_tabletXtilt(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	int x;
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "disable") == 0) {
+		aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE;
+	} else {
+		x = (int)simple_strtol(buf, 0, 10);
+		if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) {
+			aiptek->newSetting.xTilt = x;
+		}
+	}
+	return count;
+}
+
+static DEVICE_ATTR(xtilt,
+		   S_IRUGO | S_IWUGO, show_tabletXtilt, store_tabletXtilt);
+
+/***********************************************************************
+ * support routines for the 'ytilt' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletYtilt(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (aiptek->curSetting.yTilt == AIPTEK_TILT_DISABLE) {
+		return snprintf(buf, PAGE_SIZE, "disable\n");
+	} else {
+		return snprintf(buf, PAGE_SIZE, "%d\n",
+				aiptek->curSetting.yTilt);
+	}
+}
+
+static ssize_t
+store_tabletYtilt(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	int y;
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "disable") == 0) {
+		aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE;
+	} else {
+		y = (int)simple_strtol(buf, 0, 10);
+		if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) {
+			aiptek->newSetting.yTilt = y;
+		}
+	}
+	return count;
+}
+
+static DEVICE_ATTR(ytilt,
+		   S_IRUGO | S_IWUGO, show_tabletYtilt, store_tabletYtilt);
+
+/***********************************************************************
+ * support routines for the 'jitter' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletJitterDelay(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "%d\n", aiptek->curSetting.jitterDelay);
+}
+
+static ssize_t
+store_tabletJitterDelay(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, 0, 10);
+	return count;
+}
+
+static DEVICE_ATTR(jitter,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletJitterDelay, store_tabletJitterDelay);
+
+/***********************************************************************
+ * support routines for the 'delay' file. Note that this file
+ * both displays current setting and allows reprogramming.
+ */
+static ssize_t show_tabletProgrammableDelay(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "%d\n",
+			aiptek->curSetting.programmableDelay);
+}
+
+static ssize_t
+store_tabletProgrammableDelay(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, 0, 10);
+	return count;
+}
+
+static DEVICE_ATTR(delay,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletProgrammableDelay, store_tabletProgrammableDelay);
+
+/***********************************************************************
+ * support routines for the 'input_path' file. Note that this file
+ * only displays current setting.
+ */
+static ssize_t show_tabletInputDevice(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "/dev/input/%s\n",
+			aiptek->features.inputPath);
+}
+
+static DEVICE_ATTR(input_path, S_IRUGO, show_tabletInputDevice, NULL);
+
+/***********************************************************************
+ * support routines for the 'event_count' file. Note that this file
+ * only displays current setting.
+ */
+static ssize_t show_tabletEventsReceived(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "%ld\n", aiptek->eventCount);
+}
+
+static DEVICE_ATTR(event_count, S_IRUGO, show_tabletEventsReceived, NULL);
+
+/***********************************************************************
+ * support routines for the 'diagnostic' file. Note that this file
+ * only displays current setting.
+ */
+static ssize_t show_tabletDiagnosticMessage(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *retMsg;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->diagnostic) {
+	case AIPTEK_DIAGNOSTIC_NA:
+		retMsg = "no errors\n";
+		break;
+
+	case AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE:
+		retMsg = "Error: receiving relative reports\n";
+		break;
+
+	case AIPTEK_DIAGNOSTIC_SENDING_ABSOLUTE_IN_RELATIVE:
+		retMsg = "Error: receiving absolute reports\n";
+		break;
+
+	case AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED:
+		if (aiptek->curSetting.pointerMode ==
+		    AIPTEK_POINTER_ONLY_MOUSE_MODE) {
+			retMsg = "Error: receiving stylus reports\n";
+		} else {
+			retMsg = "Error: receiving mouse reports\n";
+		}
+		break;
+
+	default:
+		return 0;
+	}
+	return snprintf(buf, PAGE_SIZE, retMsg);
+}
+
+static DEVICE_ATTR(diagnostic, S_IRUGO, show_tabletDiagnosticMessage, NULL);
+
+/***********************************************************************
+ * support routines for the 'stylus_upper' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletStylusUpper(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.stylusButtonUpper) {
+	case AIPTEK_STYLUS_UPPER_BUTTON:
+		s = "upper";
+		break;
+
+	case AIPTEK_STYLUS_LOWER_BUTTON:
+		s = "lower";
+		break;
+
+	default:
+		s = "unknown";
+		break;
+	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
+}
+
+static ssize_t
+store_tabletStylusUpper(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "upper") == 0) {
+		aiptek->newSetting.stylusButtonUpper =
+		    AIPTEK_STYLUS_UPPER_BUTTON;
+	} else if (strcmp(buf, "lower") == 0) {
+		aiptek->newSetting.stylusButtonUpper =
+		    AIPTEK_STYLUS_LOWER_BUTTON;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(stylus_upper,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletStylusUpper, store_tabletStylusUpper);
+
+/***********************************************************************
+ * support routines for the 'stylus_lower' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletStylusLower(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.stylusButtonLower) {
+	case AIPTEK_STYLUS_UPPER_BUTTON:
+		s = "upper";
+		break;
+
+	case AIPTEK_STYLUS_LOWER_BUTTON:
+		s = "lower";
+		break;
+
+	default:
+		s = "unknown";
+		break;
+	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
+}
+
+static ssize_t
+store_tabletStylusLower(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "upper") == 0) {
+		aiptek->newSetting.stylusButtonLower =
+		    AIPTEK_STYLUS_UPPER_BUTTON;
+	} else if (strcmp(buf, "lower") == 0) {
+		aiptek->newSetting.stylusButtonLower =
+		    AIPTEK_STYLUS_LOWER_BUTTON;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(stylus_lower,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletStylusLower, store_tabletStylusLower);
+
+/***********************************************************************
+ * support routines for the 'mouse_left' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletMouseLeft(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.mouseButtonLeft) {
+	case AIPTEK_MOUSE_LEFT_BUTTON:
+		s = "left";
+		break;
+
+	case AIPTEK_MOUSE_MIDDLE_BUTTON:
+		s = "middle";
+		break;
+
+	case AIPTEK_MOUSE_RIGHT_BUTTON:
+		s = "right";
+		break;
+
+	default:
+		s = "unknown";
+		break;
+	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
+}
+
+static ssize_t
+store_tabletMouseLeft(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "left") == 0) {
+		aiptek->newSetting.mouseButtonLeft = AIPTEK_MOUSE_LEFT_BUTTON;
+	} else if (strcmp(buf, "middle") == 0) {
+		aiptek->newSetting.mouseButtonLeft = AIPTEK_MOUSE_MIDDLE_BUTTON;
+	} else if (strcmp(buf, "right") == 0) {
+		aiptek->newSetting.mouseButtonLeft = AIPTEK_MOUSE_RIGHT_BUTTON;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(mouse_left,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletMouseLeft, store_tabletMouseLeft);
+
+/***********************************************************************
+ * support routines for the 'mouse_middle' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletMouseMiddle(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.mouseButtonMiddle) {
+	case AIPTEK_MOUSE_LEFT_BUTTON:
+		s = "left";
+		break;
+
+	case AIPTEK_MOUSE_MIDDLE_BUTTON:
+		s = "middle";
+		break;
+
+	case AIPTEK_MOUSE_RIGHT_BUTTON:
+		s = "right";
+		break;
+
+	default:
+		s = "unknown";
+		break;
+	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
+}
+
+static ssize_t
+store_tabletMouseMiddle(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "left") == 0) {
+		aiptek->newSetting.mouseButtonMiddle = AIPTEK_MOUSE_LEFT_BUTTON;
+	} else if (strcmp(buf, "middle") == 0) {
+		aiptek->newSetting.mouseButtonMiddle =
+		    AIPTEK_MOUSE_MIDDLE_BUTTON;
+	} else if (strcmp(buf, "right") == 0) {
+		aiptek->newSetting.mouseButtonMiddle =
+		    AIPTEK_MOUSE_RIGHT_BUTTON;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(mouse_middle,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletMouseMiddle, store_tabletMouseMiddle);
+
+/***********************************************************************
+ * support routines for the 'mouse_right' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletMouseRight(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+	char *s;
+
+	if (aiptek == NULL)
+		return 0;
+
+	switch (aiptek->curSetting.mouseButtonRight) {
+	case AIPTEK_MOUSE_LEFT_BUTTON:
+		s = "left";
+		break;
+
+	case AIPTEK_MOUSE_MIDDLE_BUTTON:
+		s = "middle";
+		break;
+
+	case AIPTEK_MOUSE_RIGHT_BUTTON:
+		s = "right";
+		break;
+
+	default:
+		s = "unknown";
+		break;
+	}
+	return snprintf(buf, PAGE_SIZE, "%s\n", s);
+}
+
+static ssize_t
+store_tabletMouseRight(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (strcmp(buf, "left") == 0) {
+		aiptek->newSetting.mouseButtonRight = AIPTEK_MOUSE_LEFT_BUTTON;
+	} else if (strcmp(buf, "middle") == 0) {
+		aiptek->newSetting.mouseButtonRight =
+		    AIPTEK_MOUSE_MIDDLE_BUTTON;
+	} else if (strcmp(buf, "right") == 0) {
+		aiptek->newSetting.mouseButtonRight = AIPTEK_MOUSE_RIGHT_BUTTON;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(mouse_right,
+		   S_IRUGO | S_IWUGO,
+		   show_tabletMouseRight, store_tabletMouseRight);
+
+/***********************************************************************
+ * support routines for the 'wheel' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletWheel(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	if (aiptek->curSetting.wheel == AIPTEK_WHEEL_DISABLE) {
+		return snprintf(buf, PAGE_SIZE, "disable\n");
+	} else {
+		return snprintf(buf, PAGE_SIZE, "%d\n",
+				aiptek->curSetting.wheel);
+	}
+}
+
+static ssize_t
+store_tabletWheel(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	aiptek->newSetting.wheel = (int)simple_strtol(buf, 0, 10);
+	return count;
+}
+
+static DEVICE_ATTR(wheel,
+		   S_IRUGO | S_IWUGO, show_tabletWheel, store_tabletWheel);
+
+/***********************************************************************
+ * support routines for the 'execute' file. Note that this file
+ * both displays current setting and allows for setting changing.
+ */
+static ssize_t show_tabletExecute(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	/* There is nothing useful to display, so a one-line manual
+	 * is in order...
+	 */
+	return snprintf(buf, PAGE_SIZE,
+			"Write anything to this file to program your tablet.\n");
+}
+
+static ssize_t
+store_tabletExecute(struct device *dev, const char *buf, size_t count)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	/* We do not care what you write to this file. Merely the action
+	 * of writing to this file triggers a tablet reprogramming.
+	 */
+	memcpy(&aiptek->curSetting, &aiptek->newSetting,
+	       sizeof(struct aiptek_settings));
+
+	if (aiptek_program_tablet(aiptek) < 0)
+		return -EIO;
+
+	return count;
+}
+
+static DEVICE_ATTR(execute,
+		   S_IRUGO | S_IWUGO, show_tabletExecute, store_tabletExecute);
+
+/***********************************************************************
+ * support routines for the 'odm_code' file. Note that this file
+ * only displays current setting.
+ */
+static ssize_t show_tabletODMCode(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.odmCode);
+}
+
+static DEVICE_ATTR(odm_code, S_IRUGO, show_tabletODMCode, NULL);
+
+/***********************************************************************
+ * support routines for the 'model_code' file. Note that this file
+ * only displays current setting.
+ */
+static ssize_t show_tabletModelCode(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.modelCode);
+}
+
+static DEVICE_ATTR(model_code, S_IRUGO, show_tabletModelCode, NULL);
+
+/***********************************************************************
+ * support routines for the 'firmware_code' file. Note that this file
+ * only displays current setting.
+ */
+static ssize_t show_firmwareCode(struct device *dev, char *buf)
+{
+	struct aiptek *aiptek = dev_get_drvdata(dev);
+
+	if (aiptek == NULL)
+		return 0;
+
+	return snprintf(buf, PAGE_SIZE, "%04x\n",
+			aiptek->features.firmwareCode);
+}
+
+static DEVICE_ATTR(firmware_code, S_IRUGO, show_firmwareCode, NULL);
+
+/***********************************************************************
+ * This routine removes all existing sysfs files managed by this device
+ * driver.
+ */
+static void aiptek_delete_files(struct device *dev)
+{
+	device_remove_file(dev, &dev_attr_size);
+	device_remove_file(dev, &dev_attr_product_id);
+	device_remove_file(dev, &dev_attr_vendor_id);
+	device_remove_file(dev, &dev_attr_vendor);
+	device_remove_file(dev, &dev_attr_product);
+	device_remove_file(dev, &dev_attr_pointer_mode);
+	device_remove_file(dev, &dev_attr_coordinate_mode);
+	device_remove_file(dev, &dev_attr_tool_mode);
+	device_remove_file(dev, &dev_attr_xtilt);
+	device_remove_file(dev, &dev_attr_ytilt);
+	device_remove_file(dev, &dev_attr_jitter);
+	device_remove_file(dev, &dev_attr_delay);
+	device_remove_file(dev, &dev_attr_input_path);
+	device_remove_file(dev, &dev_attr_event_count);
+	device_remove_file(dev, &dev_attr_diagnostic);
+	device_remove_file(dev, &dev_attr_odm_code);
+	device_remove_file(dev, &dev_attr_model_code);
+	device_remove_file(dev, &dev_attr_firmware_code);
+	device_remove_file(dev, &dev_attr_stylus_lower);
+	device_remove_file(dev, &dev_attr_stylus_upper);
+	device_remove_file(dev, &dev_attr_mouse_left);
+	device_remove_file(dev, &dev_attr_mouse_middle);
+	device_remove_file(dev, &dev_attr_mouse_right);
+	device_remove_file(dev, &dev_attr_wheel);
+	device_remove_file(dev, &dev_attr_execute);
+}
+
+/***********************************************************************
+ * This routine creates the sysfs files managed by this device
+ * driver.
+ */
+static int aiptek_add_files(struct device *dev)
+{
+	int ret;
+
+	if ((ret = device_create_file(dev, &dev_attr_size)) ||
+	    (ret = device_create_file(dev, &dev_attr_product_id)) ||
+	    (ret = device_create_file(dev, &dev_attr_vendor_id)) ||
+	    (ret = device_create_file(dev, &dev_attr_vendor)) ||
+	    (ret = device_create_file(dev, &dev_attr_product)) ||
+	    (ret = device_create_file(dev, &dev_attr_pointer_mode)) ||
+	    (ret = device_create_file(dev, &dev_attr_coordinate_mode)) ||
+	    (ret = device_create_file(dev, &dev_attr_tool_mode)) ||
+	    (ret = device_create_file(dev, &dev_attr_xtilt)) ||
+	    (ret = device_create_file(dev, &dev_attr_ytilt)) ||
+	    (ret = device_create_file(dev, &dev_attr_jitter)) ||
+	    (ret = device_create_file(dev, &dev_attr_delay)) ||
+	    (ret = device_create_file(dev, &dev_attr_input_path)) ||
+	    (ret = device_create_file(dev, &dev_attr_event_count)) ||
+	    (ret = device_create_file(dev, &dev_attr_diagnostic)) ||
+	    (ret = device_create_file(dev, &dev_attr_odm_code)) ||
+	    (ret = device_create_file(dev, &dev_attr_model_code)) ||
+	    (ret = device_create_file(dev, &dev_attr_firmware_code)) ||
+	    (ret = device_create_file(dev, &dev_attr_stylus_lower)) ||
+	    (ret = device_create_file(dev, &dev_attr_stylus_upper)) ||
+	    (ret = device_create_file(dev, &dev_attr_mouse_left)) ||
+	    (ret = device_create_file(dev, &dev_attr_mouse_middle)) ||
+	    (ret = device_create_file(dev, &dev_attr_mouse_right)) ||
+	    (ret = device_create_file(dev, &dev_attr_wheel)) ||
+	    (ret = device_create_file(dev, &dev_attr_execute))) {
+		err("aiptek: killing own sysfs device files\n");
+		aiptek_delete_files(dev);
+	}
+	return ret;
+}
+
+/***********************************************************************
+ * This routine is called when a tablet has been identified. It basically
+ * sets up the tablet and the driver's internal structures.
+ */
+static int
+aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+	struct usb_device *usbdev = interface_to_usbdev(intf);
+	struct usb_endpoint_descriptor *endpoint;
+	struct aiptek *aiptek;
+	struct input_dev *inputdev;
+	struct input_handle *inputhandle;
+	struct list_head *node, *next;
+	char path[64 + 1];
+	int i;
+	int speeds[] = { 0,
+		AIPTEK_PROGRAMMABLE_DELAY_50,
+		AIPTEK_PROGRAMMABLE_DELAY_400,
+		AIPTEK_PROGRAMMABLE_DELAY_25,
+		AIPTEK_PROGRAMMABLE_DELAY_100,
+		AIPTEK_PROGRAMMABLE_DELAY_200,
+		AIPTEK_PROGRAMMABLE_DELAY_300
+	};
+
+	/* programmableDelay is where the command-line specified
+	 * delay is kept. We make it the first element of speeds[],
+	 * so therefore, your override speed is tried first, then the
+	 * remainder. Note that the default value of 400ms will be tried
+	 * if you do not specify any command line parameter.
+	 */
+	speeds[0] = programmableDelay;
+
+	if ((aiptek = kmalloc(sizeof(struct aiptek), GFP_KERNEL)) == NULL)
+		return -ENOMEM;
+	memset(aiptek, 0, sizeof(struct aiptek));
+
+	aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
+					SLAB_ATOMIC, &aiptek->data_dma);
+	if (aiptek->data == NULL) {
+		kfree(aiptek);
+		return -ENOMEM;
+	}
+
+	aiptek->urb = usb_alloc_urb(0, GFP_KERNEL);
+	if (aiptek->urb == NULL) {
+		usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data,
+				aiptek->data_dma);
+		kfree(aiptek);
+		return -ENOMEM;
+	}
+
+	/* Set up the curSettings struct. Said struct contains the current
+	 * programmable parameters. The newSetting struct contains changes
+	 * the user makes to the settings via the sysfs interface. Those
+	 * changes are not "committed" to curSettings until the user
+	 * writes to the sysfs/.../execute file.
+	 */
+	aiptek->curSetting.pointerMode = AIPTEK_POINTER_EITHER_MODE;
+	aiptek->curSetting.coordinateMode = AIPTEK_COORDINATE_ABSOLUTE_MODE;
+	aiptek->curSetting.toolMode = AIPTEK_TOOL_BUTTON_PEN_MODE;
+	aiptek->curSetting.xTilt = AIPTEK_TILT_DISABLE;
+	aiptek->curSetting.yTilt = AIPTEK_TILT_DISABLE;
+	aiptek->curSetting.mouseButtonLeft = AIPTEK_MOUSE_LEFT_BUTTON;
+	aiptek->curSetting.mouseButtonMiddle = AIPTEK_MOUSE_MIDDLE_BUTTON;
+	aiptek->curSetting.mouseButtonRight = AIPTEK_MOUSE_RIGHT_BUTTON;
+	aiptek->curSetting.stylusButtonUpper = AIPTEK_STYLUS_UPPER_BUTTON;
+	aiptek->curSetting.stylusButtonLower = AIPTEK_STYLUS_LOWER_BUTTON;
+	aiptek->curSetting.jitterDelay = jitterDelay;
+	aiptek->curSetting.programmableDelay = programmableDelay;
+
+	/* Both structs should have equivalent settings
+	 */
+	memcpy(&aiptek->newSetting, &aiptek->curSetting,
+	       sizeof(struct aiptek_settings));
+
+	/* Now program the capacities of the tablet, in terms of being
+	 * an input device.
+	 */
+	aiptek->inputdev.evbit[0] |= BIT(EV_KEY)
+	    | BIT(EV_ABS)
+	    | BIT(EV_REL)
+	    | BIT(EV_MSC);
+
+	aiptek->inputdev.absbit[0] |=
+	    (BIT(ABS_X) |
+	     BIT(ABS_Y) |
+	     BIT(ABS_PRESSURE) |
+	     BIT(ABS_TILT_X) |
+	     BIT(ABS_TILT_Y) | BIT(ABS_WHEEL) | BIT(ABS_MISC));
+
+	aiptek->inputdev.relbit[0] |=
+	    (BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL) | BIT(REL_MISC));
+
+	aiptek->inputdev.keybit[LONG(BTN_LEFT)] |=
+	    (BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE));
+
+	aiptek->inputdev.keybit[LONG(BTN_DIGI)] |=
+	    (BIT(BTN_TOOL_PEN) |
+	     BIT(BTN_TOOL_RUBBER) |
+	     BIT(BTN_TOOL_PENCIL) |
+	     BIT(BTN_TOOL_AIRBRUSH) |
+	     BIT(BTN_TOOL_BRUSH) |
+	     BIT(BTN_TOOL_MOUSE) |
+	     BIT(BTN_TOOL_LENS) |
+	     BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2));
+
+	aiptek->inputdev.mscbit[0] = BIT(MSC_SERIAL);
+
+	/* Programming the tablet macro keys needs to be done with a for loop
+	 * as the keycodes are discontiguous.
+	 */
+	for (i = 0; i < sizeof(macroKeyEvents) / sizeof(macroKeyEvents[0]); ++i)
+		set_bit(macroKeyEvents[i], aiptek->inputdev.keybit);
+
+	/* Set up client data, pointers to open and close routines
+	 * for the input device.
+	 */
+	aiptek->inputdev.private = aiptek;
+	aiptek->inputdev.open = aiptek_open;
+	aiptek->inputdev.close = aiptek_close;
+
+	/* Determine the usb devices' physical path.
+	 * Asketh not why we always pretend we're using "../input0",
+	 * but I suspect this will have to be refactored one
+	 * day if a single USB device can be a keyboard & a mouse
+	 * & a tablet, and the inputX number actually will tell
+	 * us something...
+	 */
+	if (usb_make_path(usbdev, path, 64) > 0)
+		sprintf(aiptek->features.usbPath, "%s/input0", path);
+
+	/* Program the input device coordinate capacities. We do not yet
+	 * know what maximum X, Y, and Z values are, so we're putting fake
+	 * values in. Later, we'll ask the tablet to put in the correct
+	 * values.
+	 */
+	aiptek->inputdev.absmin[ABS_X] = 0;
+	aiptek->inputdev.absmax[ABS_X] = 2999;
+	aiptek->inputdev.absmin[ABS_Y] = 0;
+	aiptek->inputdev.absmax[ABS_Y] = 2249;
+	aiptek->inputdev.absmin[ABS_PRESSURE] = 0;
+	aiptek->inputdev.absmax[ABS_PRESSURE] = 511;
+	aiptek->inputdev.absmin[ABS_TILT_X] = AIPTEK_TILT_MIN;
+	aiptek->inputdev.absmax[ABS_TILT_X] = AIPTEK_TILT_MAX;
+	aiptek->inputdev.absmin[ABS_TILT_Y] = AIPTEK_TILT_MIN;
+	aiptek->inputdev.absmax[ABS_TILT_Y] = AIPTEK_TILT_MAX;
+	aiptek->inputdev.absmin[ABS_WHEEL] = AIPTEK_WHEEL_MIN;
+	aiptek->inputdev.absmax[ABS_WHEEL] = AIPTEK_WHEEL_MAX - 1;
+	aiptek->inputdev.absfuzz[ABS_X] = 0;
+	aiptek->inputdev.absfuzz[ABS_Y] = 0;
+	aiptek->inputdev.absfuzz[ABS_PRESSURE] = 0;
+	aiptek->inputdev.absfuzz[ABS_TILT_X] = 0;
+	aiptek->inputdev.absfuzz[ABS_TILT_Y] = 0;
+	aiptek->inputdev.absfuzz[ABS_WHEEL] = 0;
+	aiptek->inputdev.absflat[ABS_X] = 0;
+	aiptek->inputdev.absflat[ABS_Y] = 0;
+	aiptek->inputdev.absflat[ABS_PRESSURE] = 0;
+	aiptek->inputdev.absflat[ABS_TILT_X] = 0;
+	aiptek->inputdev.absflat[ABS_TILT_Y] = 0;
+	aiptek->inputdev.absflat[ABS_WHEEL] = 0;
+	aiptek->inputdev.name = "Aiptek";
+	aiptek->inputdev.phys = aiptek->features.usbPath;
+	aiptek->inputdev.id.bustype = BUS_USB;
+	aiptek->inputdev.id.vendor = usbdev->descriptor.idVendor;
+	aiptek->inputdev.id.product = usbdev->descriptor.idProduct;
+	aiptek->inputdev.id.version = usbdev->descriptor.bcdDevice;
+
+	aiptek->usbdev = usbdev;
+	aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
+	aiptek->inDelay = 0;
+	aiptek->endDelay = 0;
+	aiptek->previousJitterable = 0;
+
+	endpoint = &intf->altsetting[0].endpoint[0].desc;
+
+	/* Go set up our URB, which is called when the tablet receives
+	 * input.
+	 */
+	usb_fill_int_urb(aiptek->urb,
+			 aiptek->usbdev,
+			 usb_rcvintpipe(aiptek->usbdev,
+					endpoint->bEndpointAddress),
+			 aiptek->data, 8, aiptek_irq, aiptek,
+			 endpoint->bInterval);
+
+	aiptek->urb->transfer_dma = aiptek->data_dma;
+	aiptek->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+	/* Register the tablet as an Input Device
+	 */
+	input_register_device(&aiptek->inputdev);
+
+	/* Go and decode the USB representation of the tablet's manufacturer
+	 * name and product name. They only change once every hotplug event,
+	 * which is why we put it here instead of in the sysfs interface.
+	 */
+	usb_string(usbdev,
+		   usbdev->descriptor.iManufacturer,
+		   aiptek->features.manuName,
+		   sizeof(aiptek->features.manuName));
+	usb_string(usbdev,
+		   usbdev->descriptor.iProduct,
+		   aiptek->features.prodName,
+		   sizeof(aiptek->features.prodName));
+
+	/* We now will look for the evdev device which is mapped to
+	 * the tablet. The partial name is kept in the link list of
+	 * input_handles associated with this input device.
+	 * What identifies an evdev input_handler is that it begins
+	 * with 'event', continues with a digit, and that in turn
+	 * is mapped to /{devfs}/input/eventN.
+	 */
+	inputdev = &aiptek->inputdev;
+	list_for_each_safe(node, next, &inputdev->h_list) {
+		inputhandle = to_handle(node);
+		if (strncmp(inputhandle->name, "event", 5) == 0) {
+			strcpy(aiptek->features.inputPath, inputhandle->name);
+			break;
+		}
+	}
+
+	info("input: Aiptek on %s (%s)\n", path, aiptek->features.inputPath);
+
+	/* Program the tablet. This sets the tablet up in the mode
+	 * specified in newSetting, and also queries the tablet's
+	 * physical capacities.
+	 *
+	 * Sanity check: if a tablet doesn't like the slow programmatic
+	 * delay, we often get sizes of 0x0. Let's use that as an indicator
+	 * to try faster delays, up to 25 ms. If that logic fails, well, you'll
+	 * have to explain to us how your tablet thinks it's 0x0, and yet that's
+	 * not an error :-)
+	 */
+
+	for (i = 0; i < sizeof(speeds) / sizeof(speeds[0]); ++i) {
+		aiptek->curSetting.programmableDelay = speeds[i];
+		(void)aiptek_program_tablet(aiptek);
+		if (aiptek->inputdev.absmax[ABS_X] > 0) {
+			info("input: Aiptek using %d ms programming speed\n",
+			     aiptek->curSetting.programmableDelay);
+			break;
+		}
+	}
+
+	/* Associate this driver's struct with the usb interface.
+	 */
+	usb_set_intfdata(intf, aiptek);
+
+	/* Set up the sysfs files
+	 */
+	aiptek_add_files(&intf->dev);
+
+	/* Make sure the evdev module is loaded. Assuming evdev IS a module :-)
+	 */
+	if (request_module("evdev") != 0)
+		info("aiptek: error loading 'evdev' module");
+
+	return 0;
+}
+
+/* Forward declaration */
+static void aiptek_disconnect(struct usb_interface *intf);
+
+static struct usb_driver aiptek_driver = {
+	.owner = THIS_MODULE,
+	.name = "aiptek",
+	.probe = aiptek_probe,
+	.disconnect = aiptek_disconnect,
+	.id_table = aiptek_ids,
+};
+
+/***********************************************************************
+ * Deal with tablet disconnecting from the system.
+ */
+static void aiptek_disconnect(struct usb_interface *intf)
+{
+	struct aiptek *aiptek = usb_get_intfdata(intf);
+
+	/* Disassociate driver's struct with usb interface
+	 */
+	usb_set_intfdata(intf, NULL);
+	if (aiptek != NULL) {
+		/* Free & unhook everything from the system.
+		 */
+		usb_unlink_urb(aiptek->urb);
+		input_unregister_device(&aiptek->inputdev);
+		aiptek_delete_files(&intf->dev);
+		usb_free_urb(aiptek->urb);
+		usb_buffer_free(interface_to_usbdev(intf),
+				AIPTEK_PACKET_LENGTH,
+				aiptek->data, aiptek->data_dma);
+		kfree(aiptek);
+		aiptek = NULL;
+	}
+}
+
+static int __init aiptek_init(void)
+{
+	int result = usb_register(&aiptek_driver);
+	if (result == 0) {
+		info(DRIVER_VERSION ": " DRIVER_AUTHOR);
+		info(DRIVER_DESC);
+	}
+	return result;
+}
+
+static void __exit aiptek_exit(void)
+{
+	usb_deregister(&aiptek_driver);
+}
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
+
+MODULE_PARM(programmableDelay, "i");
+MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming");
+MODULE_PARM(jitterDelay, "i");
+MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay");
+
 module_init(aiptek_init);
 module_exit(aiptek_exit);
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 3d0759817..663a6b764 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -958,7 +958,7 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
  * Create a report.
  */
 
-void hid_output_report(struct hid_report *report, __u8 *data)
+static void hid_output_report(struct hid_report *report, __u8 *data)
 {
 	unsigned n;
 
@@ -1038,7 +1038,8 @@ int hid_find_report_by_usage(struct hid_device *hid, __u32 wanted_usage, struct
 	return -1;
 }
 
-int hid_find_field_in_report(struct hid_report *report, __u32 wanted_usage, struct hid_field **field)
+#if 0
+static int hid_find_field_in_report(struct hid_report *report, __u32 wanted_usage, struct hid_field **field)
 {
 	int i, j;
 
@@ -1051,6 +1052,7 @@ int hid_find_field_in_report(struct hid_report *report, __u32 wanted_usage, stru
 
 	return -1;
 }
+#endif
 
 static int hid_submit_out(struct hid_device *hid)
 {
@@ -1357,7 +1359,13 @@ void hid_init_reports(struct hid_device *hid)
 #define USB_DEVICE_ID_KBGEAR_JAMSTUDIO  0x1001
 
 #define USB_VENDOR_ID_AIPTEK		0x08ca
-#define USB_DEVICE_ID_AIPTEK_6000	0x0020
+#define USB_DEVICE_ID_AIPTEK_01		0x0001
+#define USB_DEVICE_ID_AIPTEK_10		0x0010
+#define USB_DEVICE_ID_AIPTEK_20		0x0020
+#define USB_DEVICE_ID_AIPTEK_21		0x0021
+#define USB_DEVICE_ID_AIPTEK_22		0x0022
+#define USB_DEVICE_ID_AIPTEK_23		0x0023
+#define USB_DEVICE_ID_AIPTEK_24		0x0024
 
 #define USB_VENDOR_ID_GRIFFIN		0x077d
 #define USB_DEVICE_ID_POWERMATE		0x0410
@@ -1412,13 +1420,27 @@ void hid_init_reports(struct hid_device *hid)
 #define USB_VENDOR_ID_CHIC		0x05fe
 #define USB_DEVICE_ID_CHIC_GAMEPAD	0x0014
 
-struct hid_blacklist {
+#define USB_VENDOR_ID_GLAB		0x06c2
+#define USB_DEVICE_ID_4_PHIDGETSERVO_30	0x0038
+#define USB_DEVICE_ID_1_PHIDGETSERVO_30	0x0039
+
+#define USB_VENDOR_ID_WISEGROUP		0x0925
+#define USB_DEVICE_ID_1_PHIDGETSERVO_20	0x8101
+#define USB_DEVICE_ID_4_PHIDGETSERVO_20	0x8104
+
+static struct hid_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
 	unsigned quirks;
 } hid_blacklist[] = {
 
-	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_6000, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_21, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_22, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_23, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_24, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
@@ -1459,6 +1481,10 @@ struct hid_blacklist {
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
 
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET },
@@ -1767,7 +1793,7 @@ MODULE_DEVICE_TABLE (usb, hid_usb_ids);
 
 static struct usb_driver hid_driver = {
 	.owner =	THIS_MODULE,
-	.name =		"hid",
+	.name =		"usbhid",
 	.probe =	hid_probe,
 	.disconnect =	hid_disconnect,
 	.id_table =	hid_usb_ids,
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 76b38decc..c995d93f6 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -232,7 +232,7 @@ static int hiddev_fasync(int fd, struct file *file, int on)
 static struct usb_class_driver hiddev_class;
 static void hiddev_cleanup(struct hiddev *hiddev)
 {
-	hiddev_table[hiddev->hid->minor] = NULL;
+	hiddev_table[hiddev->hid->minor - HIDDEV_MINOR_BASE] = NULL;
 	usb_deregister_dev(hiddev->hid->intf, &hiddev_class);
 	kfree(hiddev);
 }
@@ -612,7 +612,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		uref = &uref_multi->uref;
 		if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
 			if (copy_from_user(uref_multi, (void *) arg, 
-					   sizeof(uref_multi)))
+					   sizeof(*uref_multi)))
 				goto fault;
 		} else {
 			if (copy_from_user(uref, (void *) arg, sizeof(*uref)))
diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c
index 84d6e861a..43af4031f 100644
--- a/drivers/usb/input/kbtab.c
+++ b/drivers/usb/input/kbtab.c
@@ -95,7 +95,7 @@ static void kbtab_irq(struct urb *urb, struct pt_regs *regs)
 		     __FUNCTION__, retval);
 }
 
-struct usb_device_id kbtab_ids[] = {
+static struct usb_device_id kbtab_ids[] = {
 	{ USB_DEVICE(USB_VENDOR_ID_KBGEAR, 0x1001), .driver_info = 0 },
 	{ }
 };
diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c
index 4c80c3ec5..ae5713876 100644
--- a/drivers/usb/input/mtouchusb.c
+++ b/drivers/usb/input/mtouchusb.c
@@ -28,6 +28,12 @@
  *    Complete rewrite using Linux Input in 2.6.3
  *    Unfortunately no calibration support at this time
  *
+ *  1.4 04/25/2004 (TEJ) tejohnson@yahoo.com
+ *    Changed reset from standard USB dev reset to vendor reset
+ *    Changed data sent to host from compensated to raw coordinates
+ *    Eliminated vendor/product module params
+ *    Performed multiple successfull tests with an EXII-5010UC
+ *
  *****************************************************************************/
 
 #include <linux/config.h>
@@ -45,25 +51,28 @@
 #include <linux/init.h>
 #include <linux/usb.h>
 
-#define MTOUCHUSB_MIN_XC                0xc8
-#define MTOUCHUSB_MAX_XC                0xff78
+#define MTOUCHUSB_MIN_XC                0x0
+#define MTOUCHUSB_MAX_XC                0x4000
 #define MTOUCHUSB_XC_FUZZ               0x0
 #define MTOUCHUSB_XC_FLAT               0x0
 #define MTOUCHUSB_MIN_YC                0x0
-#define MTOUCHUSB_MAX_YC                0xff78
+#define MTOUCHUSB_MAX_YC                0x4000
 #define MTOUCHUSB_YC_FUZZ               0x0
 #define MTOUCHUSB_YC_FLAT               0x0
-#define MTOUCHUSB_ASYC_REPORT           1
-#define MTOUCHUSB_REPORT_SIZE_DATA      11
+
+#define MTOUCHUSB_ASYNC_REPORT          1
+#define MTOUCHUSB_RESET                 7
+#define MTOUCHUSB_REPORT_DATA_SIZE      11
 #define MTOUCHUSB_REQ_CTRLLR_ID         10
 
-#define MTOUCHUSB_GET_XC(data)          (data[4]<<8 | data[3])
-#define MTOUCHUSB_GET_YC(data)          (data[6]<<8 | data[5])
+#define MTOUCHUSB_GET_XC(data)          (data[8]<<8 | data[7])
+#define MTOUCHUSB_GET_YC(data)          (data[10]<<8 | data[9])
 #define MTOUCHUSB_GET_TOUCHED(data)     ((data[2] & 0x40) ? 1:0)
 
-#define DRIVER_VERSION "v0.1"
+#define DRIVER_VERSION "v1.4"
 #define DRIVER_AUTHOR "Todd E. Johnson, tejohnson@yahoo.com"
-#define DRIVER_DESC "Microtouch USB HID Touchscreen Driver"
+#define DRIVER_DESC "3M USB Touchscreen Driver"
+#define DRIVER_LICENSE "GPL"
 
 struct mtouch_usb {
         unsigned char *data;
@@ -76,11 +85,9 @@ struct mtouch_usb {
         char phys[64];
 };
 
-static __s32 vendor=-1, product=-1;
-
 static struct usb_device_id mtouchusb_devices [] = {
-        { USB_DEVICE(0x0596, 0x0001) }, /* 3M (Formerly MicroTouch) 14-206 */
-        { }                             /* Terminating entry */
+        { USB_DEVICE(0x0596, 0x0001) },
+        { }
 };
 
 static void mtouchusb_irq(struct urb *urb, struct pt_regs *regs)
@@ -135,8 +142,10 @@ static int mtouchusb_open (struct input_dev *input)
 
         mtouch->irq->dev = mtouch->udev;
 
-        if (usb_submit_urb (mtouch->irq, GFP_ATOMIC))
+        if (usb_submit_urb (mtouch->irq, GFP_ATOMIC)) {
+                mtouch->open--;
                 return -EIO;
+        }
 
         return 0;
 }
@@ -153,7 +162,7 @@ static int mtouchusb_alloc_buffers(struct usb_device *udev, struct mtouch_usb *m
 {
         dbg("%s - called", __FUNCTION__);
 
-        mtouch->data = usb_buffer_alloc(udev, MTOUCHUSB_REPORT_SIZE_DATA,
+        mtouch->data = usb_buffer_alloc(udev, MTOUCHUSB_REPORT_DATA_SIZE,
                                         SLAB_ATOMIC, &mtouch->data_dma);
 
         if (!mtouch->data)
@@ -167,7 +176,7 @@ static void mtouchusb_free_buffers(struct usb_device *udev, struct mtouch_usb *m
         dbg("%s - called", __FUNCTION__);
 
         if (mtouch->data)
-                usb_buffer_free(udev, MTOUCHUSB_REPORT_SIZE_DATA,
+                usb_buffer_free(udev, MTOUCHUSB_REPORT_DATA_SIZE,
                                 mtouch->data, mtouch->data_dma);
 }
 
@@ -180,41 +189,8 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
         char path[64];
         char *buf;
         int nRet;
-        int ix;
-        char valid_device = 0;
 
         dbg("%s - called", __FUNCTION__);
-        if (vendor != -1 && product != -1) {
-                info("%s - User specified USB Touch -- Vend:Prod - %x:%x",
-                     __FUNCTION__, vendor, product);
-        }
-
-        for (ix = 0; ix < sizeof (mtouchusb_devices) /
-             sizeof (struct usb_device_id); ix++) {
-                if ((udev->descriptor.idVendor ==
-                     mtouchusb_devices [ix].idVendor) &&
-                     (udev->descriptor.idProduct ==
-                     mtouchusb_devices [ix].idProduct)) {
-                        valid_device = 1;
-                        break;
-                }
-        }
-
-        if (udev->descriptor.idVendor == vendor &&
-            udev->descriptor.idProduct == product) {  /* User specified */
-                valid_device = 1;
-        }
-
-        if (!valid_device) {
-                err("%s - No valid device!", __FUNCTION__);
-                return -EIO;
-        }
-
-        if (udev->descriptor.bNumConfigurations != 1) {
-                err("%s -  Only one device configuration is supported.",
-                    __FUNCTION__);
-                return -EIO;
-        }
 
         dbg("%s - setting interface", __FUNCTION__);
         interface = intf->cur_altsetting;
@@ -222,11 +198,6 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
         dbg("%s - setting endpoint", __FUNCTION__);
         endpoint = &interface->endpoint[0].desc;
 
-        if (interface->desc.bNumEndpoints != 1) {
-                err("%s - Only one endpoint is supported.", __FUNCTION__);
-                return -EIO;
-        }
-
         if (!(mtouch = kmalloc (sizeof (struct mtouch_usb), GFP_KERNEL))) {
                 err("%s - Out of memory.", __FUNCTION__);
                 return -ENOMEM;
@@ -266,8 +237,8 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
         mtouch->input.absmax[ABS_X] =  MTOUCHUSB_MAX_XC;
         mtouch->input.absfuzz[ABS_X] = MTOUCHUSB_XC_FUZZ;
         mtouch->input.absflat[ABS_X] = MTOUCHUSB_XC_FLAT;
-        mtouch->input.absmin[ABS_Y] =  MTOUCHUSB_MAX_YC;
-        mtouch->input.absmax[ABS_Y] =  MTOUCHUSB_MIN_YC;
+        mtouch->input.absmin[ABS_Y] =  MTOUCHUSB_MIN_YC;
+        mtouch->input.absmax[ABS_Y] =  MTOUCHUSB_MAX_YC;
         mtouch->input.absfuzz[ABS_Y] = MTOUCHUSB_YC_FUZZ;
         mtouch->input.absflat[ABS_Y] = MTOUCHUSB_YC_FLAT;
 
@@ -290,15 +261,15 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
         kfree(buf);
 
         nRet = usb_control_msg(mtouch->udev,
-                               usb_rcvctrlpipe(udev, 0x80),
-                               USB_REQ_GET_CONFIGURATION,
-                               USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+                               usb_rcvctrlpipe(udev, 0),
+                               MTOUCHUSB_RESET,
+                               USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+                               1,
                                0,
-                               0x81,
                                NULL,
                                0,
                                HZ * USB_CTRL_SET_TIMEOUT);
-        dbg("%s - usb_control_msg - USB_REQ_GET_CONFIGURATION - bytes|err: %d",
+        dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d",
             __FUNCTION__, nRet);
 
         dbg("%s - usb_alloc_urb: mtouch->irq", __FUNCTION__);
@@ -315,7 +286,7 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
                          mtouch->udev,
                          usb_rcvintpipe(mtouch->udev, 0x81),
                          mtouch->data,
-                         MTOUCHUSB_REPORT_SIZE_DATA,
+                         MTOUCHUSB_REPORT_DATA_SIZE,
                          mtouchusb_irq,
                          mtouch,
                          endpoint->bInterval);
@@ -324,15 +295,15 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
         input_register_device(&mtouch->input);
 
         nRet = usb_control_msg(mtouch->udev,
-                               usb_rcvctrlpipe(udev, 0x80),
-                               MTOUCHUSB_ASYC_REPORT,
+                               usb_rcvctrlpipe(udev, 0),
+                               MTOUCHUSB_ASYNC_REPORT,
                                USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                               MTOUCHUSB_ASYC_REPORT,
-                               MTOUCHUSB_ASYC_REPORT,
+                               1,
+                               1,
                                NULL,
                                0,
                                HZ * USB_CTRL_SET_TIMEOUT);
-        dbg("%s - usb_control_msg - MTOUCHUSB_ASYC_REPORT - bytes|err: %d",
+        dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d",
             __FUNCTION__, nRet);
 
         printk(KERN_INFO "input: %s on %s\n", mtouch->name, path);
@@ -383,9 +354,3 @@ module_exit(mtouchusb_cleanup);
 MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
-MODULE_PARM(vendor, "i");
-MODULE_PARM_DESC(vendor, "User specified USB idVendor");
-MODULE_PARM(product, "i");
-MODULE_PARM_DESC(product, "User specified USB idProduct");
-
-
diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
index 37b05362c..eb78b995e 100644
--- a/drivers/usb/input/powermate.c
+++ b/drivers/usb/input/powermate.c
@@ -33,6 +33,7 @@
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/spinlock.h>
 #include <linux/usb.h>
 
 #define POWERMATE_VENDOR	0x077d	/* Griffin Technology, Inc. */
@@ -67,7 +68,7 @@ struct powermate_device {
 	dma_addr_t configcr_dma;
 	struct usb_device *udev;
 	struct input_dev input;
-	struct semaphore lock;
+	spinlock_t lock;
 	int static_brightness;
 	int pulse_speed;
 	int pulse_table;
@@ -116,7 +117,7 @@ exit:
 		     __FUNCTION__, retval);
 }
 
-/* Decide if we need to issue a control message and do so. Must be called with pm->lock down */
+/* Decide if we need to issue a control message and do so. Must be called with pm->lock taken */
 static void powermate_sync_state(struct powermate_device *pm)
 {
 	if (pm->requires_update == 0) 
@@ -194,19 +195,22 @@ static void powermate_sync_state(struct powermate_device *pm)
 static void powermate_config_complete(struct urb *urb, struct pt_regs *regs)
 {
 	struct powermate_device *pm = urb->context;
+	unsigned long flags;
 
 	if (urb->status)
 		printk(KERN_ERR "powermate: config urb returned %d\n", urb->status);
 	
-	down(&pm->lock);
+	spin_lock_irqsave(&pm->lock, flags);
 	powermate_sync_state(pm);
-	up(&pm->lock);
+	spin_unlock_irqrestore(&pm->lock, flags);
 }
 
 /* Set the LED up as described and begin the sync with the hardware if required */
 static void powermate_pulse_led(struct powermate_device *pm, int static_brightness, int pulse_speed, 
 				int pulse_table, int pulse_asleep, int pulse_awake)
 {
+	unsigned long flags;
+
 	if (pulse_speed < 0)
 		pulse_speed = 0;
 	if (pulse_table < 0)
@@ -219,7 +223,8 @@ static void powermate_pulse_led(struct powermate_device *pm, int static_brightne
 	pulse_asleep = !!pulse_asleep;
 	pulse_awake = !!pulse_awake;
 
-	down(&pm->lock);
+
+	spin_lock_irqsave(&pm->lock, flags);
 
 	/* mark state updates which are required */
 	if (static_brightness != pm->static_brightness){
@@ -242,7 +247,7 @@ static void powermate_pulse_led(struct powermate_device *pm, int static_brightne
 
 	powermate_sync_state(pm);
    
-	up(&pm->lock);
+	spin_unlock_irqrestore(&pm->lock, flags);
 }
 
 /* Callback from the Input layer when an event arrives from userspace to configure the LED */
@@ -344,7 +349,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
 		return -ENOMEM;
 	}
 
-	init_MUTEX(&pm->lock);
+	pm->lock = SPIN_LOCK_UNLOCKED;
 	init_input_dev(&pm->input);
 
 	/* get a handle to the interrupt data pipe */
@@ -411,7 +416,6 @@ static void powermate_disconnect(struct usb_interface *intf)
 
 	usb_set_intfdata(intf, NULL);
 	if (pm) {
-		down(&pm->lock);
 		pm->requires_update = 0;
 		usb_unlink_urb(pm->irq);
 		input_unregister_device(&pm->input);
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
index 62298cf75..c66001351 100644
--- a/drivers/usb/input/wacom.c
+++ b/drivers/usb/input/wacom.c
@@ -527,7 +527,7 @@ exit:
 		     __FUNCTION__, retval);
 }
 
-struct wacom_features wacom_features[] = {
+static struct wacom_features wacom_features[] = {
 	{ "Wacom Penpartner",    7,   5040,  3780,  255, 32, 0, wacom_penpartner_irq },
         { "Wacom Graphire",      8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
 	{ "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
@@ -556,7 +556,7 @@ struct wacom_features wacom_features[] = {
  	{ }
 };
 
-struct usb_device_id wacom_ids[] = {
+static struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x00) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10) },
 	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11) },
diff --git a/drivers/usb/media/Kconfig b/drivers/usb/media/Kconfig
index eba7ef348..00bf32230 100644
--- a/drivers/usb/media/Kconfig
+++ b/drivers/usb/media/Kconfig
@@ -108,7 +108,7 @@ config USB_OV511
 
 config USB_PWC
 	tristate "USB Philips Cameras"
-	depends on USB && VIDEO_DEV && BROKEN
+	depends on USB && VIDEO_DEV
 	---help---
 	  Say Y or M here if you want to use one of these Philips & OEM
           webcams:
diff --git a/drivers/usb/media/dsbr100.c b/drivers/usb/media/dsbr100.c
index 5c777bd26..f6b18a218 100644
--- a/drivers/usb/media/dsbr100.c
+++ b/drivers/usb/media/dsbr100.c
@@ -33,6 +33,9 @@
 
  History:
 
+ Version 0.40:
+  Markus: Updates for 2.6.x kernels, code layout changes, name sanitizing
+
  Version 0.30:
  	Markus: Updates for 2.5.x kernel and more ISO compliant source
 
@@ -75,13 +78,17 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.30"
+#define DRIVER_VERSION "v0.40"
 #define DRIVER_AUTHOR "Markus Demleitner <msdemlei@tucana.harvard.edu>"
 #define DRIVER_DESC "D-Link DSB-R100 USB FM radio driver"
 
 #define DSB100_VENDOR 0x04b4
 #define DSB100_PRODUCT 0x1002
 
+/* Commands the device appears to understand */
+#define DSB100_TUNE 1
+#define DSB100_ONOFF 2
+
 #define TB_LEN 16
 
 /* Frequency limits in MHz -- these are European values.  For Japanese
@@ -102,15 +109,19 @@ static int usb_dsbr100_close(struct inode *inode, struct file *file);
 static int radio_nr = -1;
 MODULE_PARM(radio_nr, "i");
 
-typedef struct
-{
-	struct usb_device *dev;
+/* Data for one (physical) device */
+typedef struct {
+	struct usb_device *usbdev;
+	struct video_device *videodev;
 	unsigned char transfer_buffer[TB_LEN];
 	int curfreq;
 	int stereo;
-} usb_dsbr100;
+	int users;
+	int removed;
+} dsbr100_device;
 
 
+/* File system interface */
 static struct file_operations usb_dsbr100_fops = {
 	.owner =	THIS_MODULE,
 	.open =		usb_dsbr100_open,
@@ -118,65 +129,84 @@ static struct file_operations usb_dsbr100_fops = {
 	.ioctl =        usb_dsbr100_ioctl,
 	.llseek =       no_llseek,
 };
-static struct video_device usb_dsbr100_radio=
+
+/* V4L interface */
+static struct video_device dsbr100_videodev_template=
 {
 	.owner =	THIS_MODULE,
 	.name =		"D-Link DSB-R 100",
 	.type =		VID_TYPE_TUNER,
 	.hardware =	VID_HARDWARE_AZTECH,
 	.fops =         &usb_dsbr100_fops,
+	.release = video_device_release,
 };
 
-static int users = 0;
-
-static struct usb_device_id usb_dsbr100_table [] = {
+static struct usb_device_id usb_dsbr100_device_table [] = {
 	{ USB_DEVICE(DSB100_VENDOR, DSB100_PRODUCT) },
 	{ }						/* Terminating entry */
 };
 
-MODULE_DEVICE_TABLE (usb, usb_dsbr100_table);
+MODULE_DEVICE_TABLE (usb, usb_dsbr100_device_table);
 
+/* USB subsystem interface */
 static struct usb_driver usb_dsbr100_driver = {
 	.owner =	THIS_MODULE,
 	.name =		"dsbr100",
 	.probe =	usb_dsbr100_probe,
 	.disconnect =	usb_dsbr100_disconnect,
-	.id_table =	usb_dsbr100_table,
+	.id_table =	usb_dsbr100_device_table,
 };
 
+/* Low-level device interface begins here */
 
-static int dsbr100_start(usb_dsbr100 *radio)
+/* switch on radio */
+static int dsbr100_start(dsbr100_device *radio)
 {
-	if (usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x00, 0xC0, 0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
-	    usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x02, 0xC0, 0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
+	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+			USB_REQ_GET_STATUS, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+			0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
+	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+			DSB100_ONOFF, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+			0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
 		return -1;
 	return (radio->transfer_buffer)[0];
 }
 
 
-static int dsbr100_stop(usb_dsbr100 *radio)
+/* switch off radio */
+static int dsbr100_stop(dsbr100_device *radio)
 {
-	if (usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x00, 0xC0, 0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
-	    usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x02, 0xC0, 0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
+	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+			USB_REQ_GET_STATUS, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+			0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
+	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+			DSB100_ONOFF, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+			0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
 		return -1;
 	return (radio->transfer_buffer)[0];
 }
 
-
-static int dsbr100_setfreq(usb_dsbr100 *radio, int freq)
+/* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
+static int dsbr100_setfreq(dsbr100_device *radio, int freq)
 {
 	freq = (freq/16*80)/1000+856;
-	if (usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x01, 0xC0, (freq>>8)&0x00ff, freq&0xff, 
-		radio->transfer_buffer, 8, 300)<0 ||
-	    usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x00, 0xC0, 0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
-	    usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x00, 0xC0, 0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
+	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+			DSB100_TUNE, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+			(freq>>8)&0x00ff, freq&0xff, 
+			radio->transfer_buffer, 8, 300)<0 ||
+	   usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+		 	USB_REQ_GET_STATUS, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+			0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
+	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+			USB_REQ_GET_STATUS, 
+			USB_TYPE_VENDOR | USB_RECIP_DEVICE |  USB_DIR_IN,
+			0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
 		radio->stereo = -1;
 		return -1;
 	}
@@ -184,61 +214,91 @@ static int dsbr100_setfreq(usb_dsbr100 *radio, int freq)
 	return (radio->transfer_buffer)[0];
 }
 
-static void dsbr100_getstat(usb_dsbr100 *radio)
+/* return the device status.  This is, in effect, just whether it
+sees a stereo signal or not.  Pity. */
+static void dsbr100_getstat(dsbr100_device *radio)
 {
-	if (usb_control_msg(radio->dev, usb_rcvctrlpipe(radio->dev, 0),
-		0x00, 0xC0, 0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
+	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
+		USB_REQ_GET_STATUS, 
+		USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
+		0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
 		radio->stereo = -1;
 	else
 		radio->stereo = ! (radio->transfer_buffer[0]&0x01);
 }
 
 
+/* USB subsystem interface begins here */
+
+/* check if the device is present and register with v4l and
+usb if it is */
 static int usb_dsbr100_probe(struct usb_interface *intf, 
 			 const struct usb_device_id *id)
 {
-	usb_dsbr100 *radio;
+	dsbr100_device *radio;
 
-	if (!(radio = kmalloc(sizeof(usb_dsbr100),GFP_KERNEL)))
+	if (!(radio = kmalloc(sizeof(dsbr100_device), GFP_KERNEL)))
+		return -ENOMEM;
+	if (!(radio->videodev = video_device_alloc())) {
+		kfree(radio);
 		return -ENOMEM;
-	usb_dsbr100_radio.priv = radio;
-	radio->dev = interface_to_usbdev (intf);
+	}
+	memcpy(radio->videodev, &dsbr100_videodev_template, 
+		sizeof(dsbr100_videodev_template));
+	radio->removed = 0;
+	radio->users = 0;
+	radio->usbdev = interface_to_usbdev(intf);
 	radio->curfreq = FREQ_MIN*FREQ_MUL;
-	usb_set_intfdata (intf, radio);
+	video_set_drvdata(radio->videodev, radio);
+	if (video_register_device(radio->videodev, VFL_TYPE_RADIO,
+		radio_nr)) {
+		warn("Could not register video device");
+		video_device_release(radio->videodev);
+		kfree(radio);
+		return -EIO;
+	}
+	usb_set_intfdata(intf, radio);
 	return 0;
 }
 
+/* handle unplugging of the device, release data structures
+if nothing keeps us from doing it.  If something is still
+keeping us busy, the release callback of v4l will take care
+of releasing it.  stv680.c does not relase its private
+data, so I don't do this here either.  Checking out the
+code I'd expect I better did that, but if there's a memory
+leak here it's tiny (~50 bytes per disconnect) */
 static void usb_dsbr100_disconnect(struct usb_interface *intf)
 {
-	usb_dsbr100 *radio = usb_get_intfdata (intf);
+	dsbr100_device *radio = usb_get_intfdata(intf);
 
 	usb_set_intfdata (intf, NULL);
-
 	if (radio) {
-		lock_kernel();
-		if (users) {
-			unlock_kernel();
-			return;
+		video_unregister_device(radio->videodev);
+		radio->videodev = NULL;
+		if (radio->users) {
+			kfree(radio);
+		} else {
+			radio->removed = 1;
 		}
-		kfree(radio);
-		usb_dsbr100_radio.priv = NULL;
-		unlock_kernel();
 	}
 }
 
+
+/* Video for Linux interface */
+
 static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
 				unsigned int cmd, void *arg)
 {
-	struct video_device *dev = video_devdata(file);
-	usb_dsbr100 *radio=dev->priv;
+	dsbr100_device *radio=video_get_drvdata(video_devdata(file));
 
 	if (!radio)
-		return -EINVAL;
+		return -EIO;
 
-	switch(cmd)
-	{
+	switch(cmd) {
 		case VIDIOCGCAP: {
 			struct video_capability *v = arg;
+
 			memset(v, 0, sizeof(*v));
 			v->type = VID_TYPE_TUNER;
 			v->channels = 1;
@@ -248,6 +308,7 @@ static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
 		}
 		case VIDIOCGTUNER: {
 			struct video_tuner *v = arg;
+
 			dsbr100_getstat(radio);
 			if(v->tuner)	/* Only 1 tuner */ 
 				return -EINVAL;
@@ -263,21 +324,21 @@ static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
 		}
 		case VIDIOCSTUNER: {
 			struct video_tuner *v = arg;
+
 			if(v->tuner!=0)
 				return -EINVAL;
 			/* Only 1 tuner so no setting needed ! */
 			return 0;
 		}
-		case VIDIOCGFREQ:
-		{
+		case VIDIOCGFREQ: {
 			int *freq = arg;
+
 			if (radio->curfreq==-1)
 				return -EINVAL;
 			*freq = radio->curfreq;
 			return 0;
 		}
-		case VIDIOCSFREQ:
-		{
+		case VIDIOCSFREQ: {
 			int *freq = arg;
 
 			radio->curfreq = *freq;
@@ -287,6 +348,7 @@ static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
 		}
 		case VIDIOCGAUDIO: {
 			struct video_audio *v = arg;
+
 			memset(v, 0, sizeof(*v));
 			v->flags |= VIDEO_AUDIO_MUTABLE;
 			v->mode = VIDEO_SOUND_STEREO;
@@ -297,9 +359,9 @@ static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
 		}
 		case VIDIOCSAUDIO: {
 			struct video_audio *v = arg;
+
 			if (v->audio) 
 				return -EINVAL;
-
 			if (v->flags&VIDEO_AUDIO_MUTE) {
 				if (dsbr100_stop(radio)==-1)
 					warn("Radio did not respond properly");
@@ -322,64 +384,40 @@ static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
 
 static int usb_dsbr100_open(struct inode *inode, struct file *file)
 {
-	struct video_device *dev = video_devdata(file);
-	usb_dsbr100 *radio=dev->priv;
+	dsbr100_device *radio=video_get_drvdata(video_devdata(file));
 
-	if (! radio) {
-		warn("Radio not initialised");
-		return -EAGAIN;
-	}
-	if(users)
-	{
-		warn("Radio in use");
-		return -EBUSY;
-	}
-	users++;
-	if (dsbr100_start(radio)<0)
+	radio->users = 1;
+	if (dsbr100_start(radio)<0) {
 		warn("Radio did not start up properly");
+		radio->users = 0;
+		return -EIO;
+	}
 	dsbr100_setfreq(radio, radio->curfreq);
 	return 0;
 }
 
 static int usb_dsbr100_close(struct inode *inode, struct file *file)
 {
-	struct video_device *dev = video_devdata(file);
-	usb_dsbr100 *radio=dev->priv;
+	dsbr100_device *radio=video_get_drvdata(video_devdata(file));
 
 	if (!radio)
 		return -ENODEV;
-	users--;
+	radio->users = 0;
+	if (radio->removed) {
+		kfree(radio);
+	}
 	return 0;
 }
 
 static int __init dsbr100_init(void)
 {
-	int retval;
-	usb_dsbr100_radio.priv = NULL;
-	retval = usb_register(&usb_dsbr100_driver);
-	if (retval)
-		goto failed_usb_register;
-	retval = video_register_device(&usb_dsbr100_radio, VFL_TYPE_RADIO,
-				       radio_nr);
-	if (retval) {	
-		warn("Couldn't register video device");
-		goto failed_video_register;
-	}
+	int retval = usb_register(&usb_dsbr100_driver);
 	info(DRIVER_VERSION ":" DRIVER_DESC);
-	return 0;
-failed_video_register:
-	usb_deregister(&usb_dsbr100_driver);
-failed_usb_register:
 	return retval;
 }
 
 static void __exit dsbr100_exit(void)
 {
-	usb_dsbr100 *radio=usb_dsbr100_radio.priv;
-
-	if (radio)
-		dsbr100_stop(radio);
-	video_unregister_device(&usb_dsbr100_radio);
 	usb_deregister(&usb_dsbr100_driver);
 }
 
diff --git a/drivers/usb/media/ibmcam.c b/drivers/usb/media/ibmcam.c
index 0d5d7181f..2740aeb0f 100644
--- a/drivers/usb/media/ibmcam.c
+++ b/drivers/usb/media/ibmcam.c
@@ -3647,7 +3647,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id *
 {
 	struct usb_device *dev = interface_to_usbdev(intf);
 	struct uvd *uvd = NULL;
-	int i, nas, model=0, canvasX=0, canvasY=0;
+	int ix, i, nas, model=0, canvasX=0, canvasY=0;
 	int actInterface=-1, inactInterface=-1, maxPS=0;
 	__u8 ifnum = intf->altsetting->desc.bInterfaceNumber;
 	unsigned char video_ep = 0;
@@ -3718,7 +3718,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id *
 	} while (0);
 
 	/* Validate found interface: must have one ISO endpoint */
-	nas = dev->actconfig->interface[ifnum]->num_altsetting;
+	nas = intf->num_altsetting;
 	if (debug > 0)
 		info("Number of alternate settings=%d.", nas);
 	if (nas < 2) {
@@ -3726,11 +3726,12 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id *
 		return -ENODEV;
 	}
 	/* Validate all alternate settings */
-	for (i=0; i < nas; i++) {
+	for (ix=0; ix < nas; ix++) {
 		const struct usb_host_interface *interface;
 		const struct usb_endpoint_descriptor *endpoint;
 
-		interface = &dev->actconfig->interface[ifnum]->altsetting[i];
+		interface = &intf->altsetting[ix];
+		i = interface->desc.bAlternateSetting;
 		if (interface->desc.bNumEndpoints != 1) {
 			err("Interface %d. has %u. endpoints!",
 			    ifnum, (unsigned)(interface->desc.bNumEndpoints));
diff --git a/drivers/usb/media/konicawc.c b/drivers/usb/media/konicawc.c
index 8fafc27d4..311138c62 100644
--- a/drivers/usb/media/konicawc.c
+++ b/drivers/usb/media/konicawc.c
@@ -381,9 +381,15 @@ static int konicawc_start_data(struct uvd *uvd)
 	int i, errFlag;
 	struct konicawc *cam = (struct konicawc *)uvd->user_data;
 	int pktsz;
-	struct usb_host_interface *interface;
-
-	interface = &dev->actconfig->interface[uvd->iface]->altsetting[spd_to_iface[cam->speed]];
+	struct usb_interface *intf;
+	struct usb_host_interface *interface = NULL;
+
+	intf = usb_ifnum_to_if(dev, uvd->iface);
+	if (intf)
+		interface = usb_altnum_to_altsetting(intf,
+				spd_to_iface[cam->speed]);
+	if (!interface)
+		return -ENXIO;
 	pktsz = interface->endpoint[1].desc.wMaxPacketSize;
 	DEBUG(1, "pktsz = %d", pktsz);
 	if (!CAMERA_IS_OPERATIONAL(uvd)) {
@@ -721,7 +727,7 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id
 {
 	struct usb_device *dev = interface_to_usbdev(intf);
 	struct uvd *uvd = NULL;
-	int i, nas;
+	int ix, i, nas;
 	int actInterface=-1, inactInterface=-1, maxPS=0;
 	unsigned char video_ep = 0;
 
@@ -741,11 +747,12 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id
 		return -ENODEV;
 	}
 	/* Validate all alternate settings */
-	for (i=0; i < nas; i++) {
+	for (ix=0; ix < nas; ix++) {
 		const struct usb_host_interface *interface;
 		const struct usb_endpoint_descriptor *endpoint;
 
-		interface = &intf->altsetting[i];
+		interface = &intf->altsetting[ix];
+		i = interface->desc.bAlternateSetting;
 		if (interface->desc.bNumEndpoints != 2) {
 			err("Interface %d. has %u. endpoints!",
 			    interface->desc.bInterfaceNumber,
diff --git a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c
index cde6a020a..c9cef9900 100644
--- a/drivers/usb/media/ov511.c
+++ b/drivers/usb/media/ov511.c
@@ -5603,8 +5603,16 @@ ov518_configure(struct usb_ov511 *ov)
 
 	if (ov->bridge == BRG_OV518)
 	{
-		struct usb_interface *ifp = ov->dev->config[0].interface[0];
-		__u16 mxps = ifp->altsetting[7].endpoint[0].desc.wMaxPacketSize;
+		struct usb_interface *ifp;
+		struct usb_host_interface *alt;
+		__u16 mxps = 0;
+
+		ifp = usb_ifnum_to_if(ov->dev, 0);
+		if (ifp) {
+			alt = usb_altnum_to_altsetting(ifp, 7);
+			if (alt)
+				mxps = alt->endpoint[0].desc.wMaxPacketSize;
+		}
 
 		/* Some OV518s have packet numbering by default, some don't */
 		if (mxps == 897)
@@ -5805,7 +5813,7 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	if (dev->descriptor.bNumConfigurations != 1)
 		return -ENODEV;
 
-	idesc = &intf->altsetting[0].desc;
+	idesc = &intf->cur_altsetting->desc;
 
 	if (idesc->bInterfaceClass != 0xFF)
 		return -ENODEV;
diff --git a/drivers/usb/media/pwc-if.c b/drivers/usb/media/pwc-if.c
index cbdf7d285..aea703bed 100644
--- a/drivers/usb/media/pwc-if.c
+++ b/drivers/usb/media/pwc-if.c
@@ -129,7 +129,6 @@ static struct {
 
 static int pwc_video_open(struct inode *inode, struct file *file);
 static int pwc_video_close(struct inode *inode, struct file *file);
-static int pwc_video_release(struct video_device *);			  
 static ssize_t pwc_video_read(struct file *file, char *buf,
 			  size_t count, loff_t *ppos);
 static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
@@ -789,7 +788,8 @@ static int pwc_isoc_init(struct pwc_device *pdev)
 	struct urb *urb;
 	int i, j, ret;
 
-	struct usb_host_interface *idesc;
+	struct usb_interface *intf;
+	struct usb_host_interface *idesc = NULL;
 
 	if (pdev == NULL)
 		return -EFAULT;
@@ -801,7 +801,9 @@ static int pwc_isoc_init(struct pwc_device *pdev)
 	/* Get the current alternate interface, adjust packet size */
 	if (!udev->actconfig)
 		return -EFAULT;
-	idesc = &udev->actconfig->interface[0]->altsetting[pdev->valternate];
+	intf = usb_ifnum_to_if(udev, 0);
+	if (intf)
+		idesc = usb_altnum_to_altsetting(intf, pdev->valternate);
 	if (!idesc)
 		return -EFAULT;
 
@@ -1118,12 +1120,6 @@ static int pwc_video_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static int pwc_video_release(struct video_device *vfd)
-{
-	Trace(TRACE_OPEN, "pwc_video_release() called. Now what?\n");
-}
-		
-
 /*
  *	FIXME: what about two parallel reads ????
  *      ANSWER: Not supported. You can't open the device more than once,
@@ -1852,7 +1848,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 		}
 	}
 
-	pdev->vdev.release = pwc_video_release;
+	pdev->vdev.release = video_device_release;
 	i = video_register_device(&pdev->vdev, VFL_TYPE_GRABBER, video_nr);
 	if (i < 0) {
 		Err("Failed to register as video device (%d).\n", i);
diff --git a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c
index 455d99f39..ac19cfb5d 100644
--- a/drivers/usb/media/se401.c
+++ b/drivers/usb/media/se401.c
@@ -1326,7 +1326,7 @@ static int se401_probe(struct usb_interface *intf,
         if (dev->descriptor.bNumConfigurations != 1)
                 return -ENODEV;
 
-        interface = &intf->altsetting[0].desc;
+        interface = &intf->cur_altsetting->desc;
 
         /* Is it an se401? */
         if (dev->descriptor.idVendor == 0x03e8 &&
diff --git a/drivers/usb/media/ultracam.c b/drivers/usb/media/ultracam.c
index b60b16f9e..cbaf7d804 100644
--- a/drivers/usb/media/ultracam.c
+++ b/drivers/usb/media/ultracam.c
@@ -95,7 +95,7 @@ MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128)
  * 02-Nov-2000 First (mostly dummy) version.
  * 06-Nov-2000 Rewrote to dump all data into frame.
  */
-void ultracam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
+static void ultracam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
 {
 	int n;
 
@@ -513,7 +513,7 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id
 {
 	struct usb_device *dev = interface_to_usbdev(intf);
 	struct uvd *uvd = NULL;
-	int i, nas;
+	int ix, i, nas;
 	int actInterface=-1, inactInterface=-1, maxPS=0;
 	unsigned char video_ep = 0;
 
@@ -540,11 +540,12 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id
 		return -ENODEV;
 	}
 	/* Validate all alternate settings */
-	for (i=0; i < nas; i++) {
+	for (ix=0; ix < nas; ix++) {
 		const struct usb_host_interface *interface;
 		const struct usb_endpoint_descriptor *endpoint;
 
-		interface = &intf->altsetting[i];
+		interface = &intf->altsetting[ix];
+		i = interface->desc.bAlternateSetting;
 		if (interface->desc.bNumEndpoints != 1) {
 			err("Interface %d. has %u. endpoints!",
 			    interface->desc.bInterfaceNumber,
diff --git a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c
index ac1cc0216..79629c370 100644
--- a/drivers/usb/media/vicam.c
+++ b/drivers/usb/media/vicam.c
@@ -1303,7 +1303,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
 
 	printk(KERN_INFO "ViCam based webcam connected\n");
 
-	interface = &intf->altsetting[0];
+	interface = intf->cur_altsetting;
 
 	DBG(KERN_DEBUG "Interface %d. has %u. endpoints!\n",
 	       interface->desc.bInterfaceNumber, (unsigned) (interface->desc.bNumEndpoints));
diff --git a/drivers/usb/media/w9968cf.c b/drivers/usb/media/w9968cf.c
index 107ed4c22..f81bf5987 100644
--- a/drivers/usb/media/w9968cf.c
+++ b/drivers/usb/media/w9968cf.c
@@ -1578,7 +1578,7 @@ static int w9968cf_i2c_init(struct w9968cf_device* cam)
 
 	static struct i2c_adapter adap = {
 		.id =                I2C_ALGO_SMBUS | I2C_HW_SMBUS_W9968CF,
-		.class =             I2C_ADAP_CLASS_CAM_DIGITAL,
+		.class =             I2C_CLASS_CAM_DIGITAL,
 		.owner =             THIS_MODULE,
 		.client_register =   w9968cf_i2c_attach_inform,
 		.client_unregister = w9968cf_i2c_detach_inform,
diff --git a/drivers/usb/media/w9968cf.h b/drivers/usb/media/w9968cf.h
index b57bcd742..3076d87da 100644
--- a/drivers/usb/media/w9968cf.h
+++ b/drivers/usb/media/w9968cf.h
@@ -189,8 +189,8 @@ enum w9968cf_vpp_flag {
 	VPP_UYVY_TO_RGBX = 0x08,
 };
 
-struct list_head w9968cf_dev_list; /* head of V4L registered cameras list */
-LIST_HEAD(w9968cf_dev_list);
+static struct list_head w9968cf_dev_list; /* head of V4L registered cameras list */
+static LIST_HEAD(w9968cf_dev_list);
 struct semaphore w9968cf_devlist_sem; /* semaphore for list traversal */
 
 /* Main device driver structure */
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index 7a558c591..8c958af4a 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -133,6 +133,18 @@ config USB_SPEEDTOUCH
 	  To compile this driver as a module, choose M here: the
 	  module will be called speedtch.
 
+config USB_PHIDGETSERVO
+	tristate "USB PhidgetServo support"
+	depends on USB
+	help
+	  Say Y here if you want to connect an 1 or 4 Motor PhidgetServo 
+	  servo controller version 2.0 or 3.0.
+
+	  Phidgets Inc. has a web page at <http://www.phidgets.com/>.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called phidgetservo.
+
 config USB_TEST
 	tristate "USB testing driver (DEVELOPMENT)"
 	depends on USB && USB_DEVICEFS && EXPERIMENTAL
diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
index e6095ce3d..d641a470e 100644
--- a/drivers/usb/misc/Makefile
+++ b/drivers/usb/misc/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_USB_SPEEDTOUCH)	+= speedtch.o
 obj-$(CONFIG_USB_TEST)		+= usbtest.o
 obj-$(CONFIG_USB_TIGL)		+= tiglusb.o
 obj-$(CONFIG_USB_USS720)	+= uss720.o
+obj-$(CONFIG_USB_PHIDGETSERVO)	+= phidgetservo.o
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c
index 8ea6a7498..4d27eab24 100644
--- a/drivers/usb/misc/cytherm.c
+++ b/drivers/usb/misc/cytherm.c
@@ -46,9 +46,6 @@ struct usb_cytherm {
 static int cytherm_probe(struct usb_interface *interface, 
 			 const struct usb_device_id *id);
 static void cytherm_disconnect(struct usb_interface *interface);
-int vendor_command(struct usb_device *dev, unsigned char request, 
-		   unsigned char value, unsigned char index,
-		   void *buf, int size);
 
 
 /* usb specific object needed to register this driver with the usb subsystem */
@@ -71,9 +68,9 @@ static struct usb_driver cytherm_driver = {
 
 
 /* Send a vendor command to device */
-int vendor_command(struct usb_device *dev, unsigned char request, 
-		   unsigned char value, unsigned char index,
-		   void *buf, int size)
+static int vendor_command(struct usb_device *dev, unsigned char request, 
+			  unsigned char value, unsigned char index,
+			  void *buf, int size)
 {
 	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
 			       request, 
@@ -122,12 +119,12 @@ static ssize_t set_brightness(struct device *dev, const char *buf,
 	retval = vendor_command(cytherm->udev, WRITE_RAM, BRIGHTNESS, 
 				cytherm->brightness, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
 	/* Inform µC that we have changed the brightness setting */
 	retval = vendor_command(cytherm->udev, WRITE_RAM, BRIGHTNESS_SEM,
 				0x01, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
    
 	kfree(buffer);
    
@@ -161,13 +158,13 @@ static ssize_t show_temp(struct device *dev, char *buf)
 	/* read temperature */
 	retval = vendor_command(cytherm->udev, READ_RAM, TEMP, 0, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
 	temp = buffer[1];
    
 	/* read sign */
 	retval = vendor_command(cytherm->udev, READ_RAM, SIGN, 0, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
 	sign = buffer[1];
 
 	kfree(buffer);
@@ -205,7 +202,7 @@ static ssize_t show_button(struct device *dev, char *buf)
 	/* check button */
 	retval = vendor_command(cytherm->udev, READ_RAM, BUTTON, 0, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
    
 	retval = buffer[1];
 
@@ -242,7 +239,7 @@ static ssize_t show_port0(struct device *dev, char *buf)
 
 	retval = vendor_command(cytherm->udev, READ_PORT, 0, 0, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
 
 	retval = buffer[1];
 
@@ -277,7 +274,7 @@ static ssize_t set_port0(struct device *dev, const char *buf, size_t count)
 	retval = vendor_command(cytherm->udev, WRITE_PORT, 0,
 				tmp, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
 
 	kfree(buffer);
 
@@ -302,7 +299,7 @@ static ssize_t show_port1(struct device *dev, char *buf)
 
 	retval = vendor_command(cytherm->udev, READ_PORT, 1, 0, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
    
 	retval = buffer[1];
 
@@ -337,7 +334,7 @@ static ssize_t set_port1(struct device *dev, const char *buf, size_t count)
 	retval = vendor_command(cytherm->udev, WRITE_PORT, 1,
 				tmp, buffer, 8);
 	if (retval)
-		dev_dbg(&led->udev->dev, "retval = %d\n", retval);
+		dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
 
 	kfree(buffer);
 
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index ed18ed908..cd37e011c 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -194,7 +194,7 @@ static int emi26_load_firmware (struct usb_device *dev)
 
 	/* return 1 to fail the driver inialization
 	 * and give real driver change to load */
-	return 1;
+	err = 1;
 
 wraperr:
 	kfree(buf);
@@ -226,7 +226,7 @@ static void emi26_disconnect(struct usb_interface *intf)
 {
 }
 
-struct usb_driver emi26_driver = {
+static struct usb_driver emi26_driver = {
 	.owner		= THIS_MODULE,
 	.name		= "emi26 - firmware loader",
 	.probe		= emi26_probe,
diff --git a/drivers/usb/misc/emi26_fw.h b/drivers/usb/misc/emi26_fw.h
index 68698262b..90bfdacd8 100644
--- a/drivers/usb/misc/emi26_fw.h
+++ b/drivers/usb/misc/emi26_fw.h
@@ -17,7 +17,7 @@
  * any driver which includes this firmware, in whole or in part,
  * requires the inclusion of this statement.
  */
-INTEL_HEX_RECORD g_bitstream[]={
+static INTEL_HEX_RECORD g_bitstream[]={
 {  16, 0x8010, 0, {0xff,0xff,0xff,0xff,0xaa,0x99,0x55,0x66,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x07 } },
 {  16, 0x8020, 0, {0x30,0x01,0x60,0x01,0x00,0x00,0x00,0x0b,0x30,0x01,0x20,0x01,0x00,0x80,0x3f,0x2d } },
 {  16, 0x8030, 0, {0x30,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x09 } },
@@ -4406,7 +4406,7 @@ INTEL_HEX_RECORD g_bitstream[]={
  * any driver which includes this firmware, in whole or in part,
  * requires the inclusion of this statement.
  */
-INTEL_HEX_RECORD g_Firmware[] = {
+static INTEL_HEX_RECORD g_Firmware[] = {
 {   3,0x0000,0,{0x02,0x43,0x56} },
 {   3,0x0003,0,{0x02,0x4b,0xcd} },
 {   3,0x000b,0,{0x02,0x4b,0xd2} },
@@ -5669,7 +5669,7 @@ DATE=12.02.2002
  * any driver which includes this firmware, in whole or in part,
  * requires the inclusion of this statement.
  */
-INTEL_HEX_RECORD g_Loader[] = {
+static INTEL_HEX_RECORD g_Loader[] = {
 {   3,0x0000,0,{0x02,0x03,0x1c} },
 {   3,0x0043,0,{0x02,0x04,0x00} },
 {  16,0x0100,0,{0x90,0x7f,0xe9,0xe0,0x24,0x5b,0x60,0x60,0x24,0x02,0x60,0x03,0x02,0x01,0xbe,0x90} },
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 6b11910fe..5c5cb4184 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -229,6 +229,8 @@ static int emi62_load_firmware (struct usb_device *dev)
 		goto wraperr;
 	}
 
+	kfree(buf);
+
 	/* return 1 to fail the driver inialization
 	 * and give real driver change to load */
 	return 1;
@@ -265,7 +267,7 @@ static void emi62_disconnect(struct usb_interface *intf)
 {
 }
 
-struct usb_driver emi62_driver = {
+static struct usb_driver emi62_driver = {
 	.owner		= THIS_MODULE,
 	.name		= "emi62 - firmware loader",
 	.probe		= emi62_probe,
diff --git a/drivers/usb/misc/emi62_fw_m.h b/drivers/usb/misc/emi62_fw_m.h
index 7ddede6c7..3567c9001 100644
--- a/drivers/usb/misc/emi62_fw_m.h
+++ b/drivers/usb/misc/emi62_fw_m.h
@@ -3,7 +3,7 @@
  */
 /* generated Tue Jun 3 21:36:11 EEST 2003 */
 
-INTEL_HEX_RECORD g_emi62bs[]={
+static INTEL_HEX_RECORD g_emi62bs[]={
   16, 0x8010, 0, {0xff,0xff,0xff,0xff,0xaa,0x99,0x55,0x66,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x07 },
   16, 0x8020, 0, {0x30,0x01,0x60,0x01,0x00,0x00,0x00,0x0d,0x30,0x01,0x20,0x01,0x00,0x80,0x3f,0x2d },
   16, 0x8030, 0, {0x30,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x09 },
@@ -6112,7 +6112,7 @@ INTEL_HEX_RECORD g_emi62bs[]={
 };
 // VERSION= 1.0.0.191
 // DATE= 2002oct28
-INTEL_HEX_RECORD g_HexMidiFw62[] = {
+static INTEL_HEX_RECORD g_HexMidiFw62[] = {
    3,0x0000,0,{0x02,0x46,0xb9},
    3,0x0003,0,{0x02,0x0f,0xfd},
    3,0x000b,0,{0x02,0x4e,0x0f},
@@ -8640,7 +8640,8 @@ INTEL_HEX_RECORD g_HexMidiFw62[] = {
 /*
 VERSION=1.04.062
 DATE=16.10.2002  
-*/INTEL_HEX_RECORD g_emi62_loader[] = {
+*/
+static INTEL_HEX_RECORD g_emi62_loader[] = {
    3,0x0000,0,{0x02,0x02,0x87},
    3,0x0043,0,{0x02,0x04,0x00},
   16,0x0100,0,{0xe4,0xff,0xfe,0xc2,0x20,0xd2,0xe8,0x43,0xd8,0x20,0x90,0x7f,0xab,0x74,0xff,0xf0},
diff --git a/drivers/usb/misc/emi62_fw_s.h b/drivers/usb/misc/emi62_fw_s.h
index dac0c6d35..cef05e851 100644
--- a/drivers/usb/misc/emi62_fw_s.h
+++ b/drivers/usb/misc/emi62_fw_s.h
@@ -3,7 +3,7 @@
  */
 /* generated Tue Apr 15 21:59:42 EEST 2003 */
 
-INTEL_HEX_RECORD g_emi62bs[]={
+static INTEL_HEX_RECORD g_emi62bs[]={
  {16, 0x8010, 0, {0xff,0xff,0xff,0xff,0xaa,0x99,0x55,0x66,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x07 }},
  {16, 0x8020, 0, {0x30,0x01,0x60,0x01,0x00,0x00,0x00,0x0d,0x30,0x01,0x20,0x01,0x00,0x80,0x3f,0x2d }},
  {16, 0x8030, 0, {0x30,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x01,0x00,0x00,0x00,0x09 }},
@@ -6112,7 +6112,7 @@ INTEL_HEX_RECORD g_emi62bs[]={
 };
 // VERSION= 1.0.0.191
 // DATE= 2002oct28
-INTEL_HEX_RECORD g_HexSpdifFw62[] = {
+static INTEL_HEX_RECORD g_HexSpdifFw62[] = {
   {3,0x0000,0,{0x02,0x45,0xf9}},
  { 3,0x0003,0,{0x02,0x0f,0xfd}},
  { 3,0x000b,0,{0x02,0x4d,0x9b}},
@@ -8623,7 +8623,8 @@ INTEL_HEX_RECORD g_HexSpdifFw62[] = {
 /*
 VERSION=1.04.062
 DATE=16.10.2002  
-*/INTEL_HEX_RECORD g_emi62_loader[] = {
+*/
+static INTEL_HEX_RECORD g_emi62_loader[] = {
  { 3,0x0000,0,{0x02,0x02,0x87}},
  { 3,0x0043,0,{0x02,0x04,0x00}},
  {16,0x0100,0,{0xe4,0xff,0xfe,0xc2,0x20,0xd2,0xe8,0x43,0xd8,0x20,0x90,0x7f,0xab,0x74,0xff,0xf0}},
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 14abec8cc..c44f65a0b 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -1,8 +1,8 @@
 /*
  * LEGO USB Tower driver
  *
- * Copyright (C) 2003 David Glance <davidgsf@sourceforge.net> 
- *               2001 Juergen Stuber <stuber@loria.fr>
+ * Copyright (C) 2003 David Glance <davidgsf@sourceforge.net>
+ *               2001-2004 Juergen Stuber <starblue@users.sourceforge.net>
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License as
@@ -33,14 +33,44 @@
  *   - changed to use lego0 rather than tower0
  *   - changed dbg() to use __func__ rather than deprecated __FUNCTION__
  * 2003-01-12 - 0.53 david (david@csse.uwa.edu.au)
- *   - changed read and write to write everything or timeout (from a patch by Chris Riesen and 
- *     Brett Thaeler driver)
+ *   - changed read and write to write everything or
+ *     timeout (from a patch by Chris Riesen and Brett Thaeler driver)
  *   - added ioctl functionality to set timeouts
- * 2003-07-18 - 0.54 davidgsf (david@csse.uwa.edu.au) 
+ * 2003-07-18 - 0.54 davidgsf (david@csse.uwa.edu.au)
  *   - initial import into LegoUSB project
  *   - merge of existing LegoUSB.c driver
- * 2003-07-18 - 0.56 davidgsf (david@csse.uwa.edu.au) 
+ * 2003-07-18 - 0.56 davidgsf (david@csse.uwa.edu.au)
  *   - port to 2.6 style driver
+ * 2004-02-29 - 0.6 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - fix locking
+ *   - unlink read URBs which are no longer needed
+ *   - allow increased buffer size, eliminates need for timeout on write
+ *   - have read URB running continuously
+ *   - added poll
+ *   - forbid seeking
+ *   - added nonblocking I/O
+ *   - changed back __func__ to __FUNCTION__
+ *   - read and log tower firmware version
+ *   - reset tower on probe, avoids failure of first write
+ * 2004-03-09 - 0.7 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - timeout read now only after inactivity, shorten default accordingly
+ * 2004-03-11 - 0.8 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - log major, minor instead of possibly confusing device filename
+ *   - whitespace cleanup
+ * 2004-03-12 - 0.9 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - normalize whitespace in debug messages
+ *   - take care about endianness in control message responses
+ * 2004-03-13 - 0.91 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - make default intervals longer to accommodate current EHCI driver
+ * 2004-03-19 - 0.92 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - replaced atomic_t by memory barriers
+ * 2004-04-21 - 0.93 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - wait for completion of write urb in release (needed for remotecontrol)
+ *   - corrected poll for write direction (missing negation)
+ * 2004-04-22 - 0.94 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - make device locking interruptible
+ * 2004-04-30 - 0.95 Juergen Stuber <starblue@users.sourceforge.net>
+ *   - check for valid udev on resubmitting and unlinking urbs
  */
 
 #include <linux/config.h>
@@ -53,33 +83,113 @@
 #include <linux/completion.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
+#include <linux/poll.h>
 
 
 #ifdef CONFIG_USB_DEBUG
 	static int debug = 4;
 #else
-	static int debug = 1;
+	static int debug = 0;
 #endif
 
 /* Use our own dbg macro */
 #undef dbg
-#define dbg(lvl, format, arg...) do { if (debug >= lvl) printk(KERN_DEBUG  __FILE__ " : " format " \n", ## arg); } while (0)
+#define dbg(lvl, format, arg...) do { if (debug >= lvl) printk(KERN_DEBUG  __FILE__ ": " format "\n", ## arg); } while (0)
 
 
 /* Version Information */
-#define DRIVER_VERSION "v0.56"
-#define DRIVER_AUTHOR "David Glance, davidgsf@sourceforge.net"
+#define DRIVER_VERSION "v0.95"
+#define DRIVER_AUTHOR "Juergen Stuber <starblue@sourceforge.net>"
 #define DRIVER_DESC "LEGO USB Tower Driver"
 
-/* Module paramaters */
+/* Module parameters */
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
+/* The defaults are chosen to work with the latest versions of leJOS and NQC.
+ */
+
+/* Some legacy software likes to receive packets in one piece.
+ * In this case read_buffer_size should exceed the maximal packet length
+ * (417 for datalog uploads), and packet_timeout should be set.
+ */
+static size_t read_buffer_size = 480;
+MODULE_PARM(read_buffer_size, "i");
+MODULE_PARM_DESC(read_buffer_size, "Read buffer size");
+
+/* Some legacy software likes to send packets in one piece.
+ * In this case write_buffer_size should exceed the maximal packet length
+ * (417 for firmware and program downloads).
+ * A problem with long writes is that the following read may time out
+ * if the software is not prepared to wait long enough.
+ */
+static size_t write_buffer_size = 480;
+MODULE_PARM(write_buffer_size, "i");
+MODULE_PARM_DESC(write_buffer_size, "Write buffer size");
+
+/* Some legacy software expects reads to contain whole LASM packets.
+ * To achieve this, characters which arrive before a packet timeout
+ * occurs will be returned in a single read operation.
+ * A problem with long reads is that the software may time out
+ * if it is not prepared to wait long enough.
+ * The packet timeout should be greater than the time between the
+ * reception of subsequent characters, which should arrive about
+ * every 5ms for the standard 2400 baud.
+ * Set it to 0 to disable.
+ */
+static int packet_timeout = 50;
+MODULE_PARM(packet_timeout, "i");
+MODULE_PARM_DESC(packet_timeout, "Packet timeout in ms");
+
+/* Some legacy software expects blocking reads to time out.
+ * Timeout occurs after the specified time of read and write inactivity.
+ * Set it to 0 to disable.
+ */
+static int read_timeout = 200;
+MODULE_PARM(read_timeout, "i");
+MODULE_PARM_DESC(read_timeout, "Read timeout in ms");
+
+/* As of kernel version 2.6.4 ehci-hcd uses an
+ * "only one interrupt transfer per frame" shortcut
+ * to simplify the scheduling of periodic transfers.
+ * This conflicts with our standard 1ms intervals for in and out URBs.
+ * We use default intervals of 2ms for in and 8ms for out transfers,
+ * which is fast enough for 2400 baud and allows a small additional load.
+ * Increase the interval to allow more devices that do interrupt transfers,
+ * or set to 0 to use the standard interval from the endpoint descriptors.
+ */
+static int interrupt_in_interval = 2;
+MODULE_PARM(interrupt_in_interval, "i");
+MODULE_PARM_DESC(interrupt_in_interval, "Interrupt in interval in ms");
+
+static int interrupt_out_interval = 8;
+MODULE_PARM(interrupt_out_interval, "i");
+MODULE_PARM_DESC(interrupt_out_interval, "Interrupt out interval in ms");
 
 /* Define these values to match your device */
 #define LEGO_USB_TOWER_VENDOR_ID	0x0694
 #define LEGO_USB_TOWER_PRODUCT_ID	0x0001
 
+/* Vendor requests */
+#define LEGO_USB_TOWER_REQUEST_RESET		0x04
+#define LEGO_USB_TOWER_REQUEST_GET_VERSION	0xFD
+
+struct tower_reset_reply {
+	__u16 size;		/* little-endian */
+	__u8 err_code;
+	__u8 spare;
+} __attribute__ ((packed));
+
+struct tower_get_version_reply {
+	__u16 size;		/* little-endian */
+	__u8 err_code;
+	__u8 spare;
+	__u8 major;
+	__u8 minor;
+	__u16 build_no;		/* little-endian */
+} __attribute__ ((packed));
+
+
 /* table of devices that work with this driver */
 static struct usb_device_id tower_table [] = {
 	{ USB_DEVICE(LEGO_USB_TOWER_VENDOR_ID, LEGO_USB_TOWER_PRODUCT_ID) },
@@ -90,22 +200,21 @@ MODULE_DEVICE_TABLE (usb, tower_table);
 
 #define LEGO_USB_TOWER_MINOR_BASE	160
 
-/* we can have up to this number of device plugged in at once */
-#define MAX_DEVICES		16
-
-#define COMMAND_TIMEOUT		(2*HZ)  /* 2 second timeout for a command */
 
 /* Structure to hold all of our device specific stuff */
 struct lego_usb_tower {
 	struct semaphore	sem;		/* locks this structure */
-	struct usb_device* 	udev;		/* save off the usb device pointer */
-	struct usb_interface*   interface;
+	struct usb_device*	udev;		/* save off the usb device pointer */
 	unsigned char		minor;		/* the starting minor number for this device */
 
 	int			open_count;	/* number of times this port has been opened */
 
 	char*			read_buffer;
-	int			read_buffer_length;
+	size_t			read_buffer_length; /* this much came in */
+	size_t			read_packet_length; /* this much will be returned on read */
+	spinlock_t		read_buffer_lock;
+	int			packet_timeout_jiffies;
+	unsigned long		read_last_arrival;
 
 	wait_queue_head_t	read_wait;
 	wait_queue_head_t	write_wait;
@@ -113,18 +222,18 @@ struct lego_usb_tower {
 	char*			interrupt_in_buffer;
 	struct usb_endpoint_descriptor* interrupt_in_endpoint;
 	struct urb*		interrupt_in_urb;
+	int			interrupt_in_interval;
+	int			interrupt_in_running;
+	int			interrupt_in_done;
 
 	char*			interrupt_out_buffer;
 	struct usb_endpoint_descriptor* interrupt_out_endpoint;
 	struct urb*		interrupt_out_urb;
+	int			interrupt_out_interval;
+	int			interrupt_out_busy;
 
 };
 
-/* Note that no locking is needed:
- * read_buffer is arbitrated by read_buffer_length == 0
- * interrupt_out_buffer is arbitrated by interrupt_out_urb->status == -EINPROGRESS
- * interrupt_in_buffer belongs to urb alone and is overwritten on overflow
- */
 
 /* local function prototypes */
 static ssize_t tower_read	(struct file *file, char *buffer, size_t count, loff_t *ppos);
@@ -132,8 +241,11 @@ static ssize_t tower_write	(struct file *file, const char *buffer, size_t count,
 static inline void tower_delete (struct lego_usb_tower *dev);
 static int tower_open		(struct inode *inode, struct file *file);
 static int tower_release	(struct inode *inode, struct file *file);
-static int tower_release_internal (struct lego_usb_tower *dev);
+static unsigned int tower_poll	(struct file *file, poll_table *wait);
+static loff_t tower_llseek	(struct file *file, loff_t off, int whence);
+
 static void tower_abort_transfers (struct lego_usb_tower *dev);
+static void tower_check_for_read_packet (struct lego_usb_tower *dev);
 static void tower_interrupt_in_callback (struct urb *urb, struct pt_regs *regs);
 static void tower_interrupt_out_callback (struct urb *urb, struct pt_regs *regs);
 
@@ -146,14 +258,16 @@ static DECLARE_MUTEX (disconnect_sem);
 
 /* file operations needed when we register this driver */
 static struct file_operations tower_fops = {
-	.owner = 	THIS_MODULE,
-	.read  = 	tower_read,
+	.owner =	THIS_MODULE,
+	.read  =	tower_read,
 	.write =	tower_write,
 	.open =		tower_open,
-	.release = 	tower_release,
+	.release =	tower_release,
+	.poll =		tower_poll,
+	.llseek =	tower_llseek,
 };
 
-/* 
+/*
  * usb class driver info in order to get a minor number from the usb core,
  * and to have the device registered with devfs and the driver core
  */
@@ -167,11 +281,11 @@ static struct usb_class_driver tower_class = {
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver tower_driver = {
-	.owner =        THIS_MODULE,
-	.name =	        "legousbtower",
-	.probe = 	tower_probe,
-	.disconnect = 	tower_disconnect,
-	.id_table = 	tower_table,
+	.owner =	THIS_MODULE,
+	.name =		"legousbtower",
+	.probe =	tower_probe,
+	.disconnect =	tower_disconnect,
+	.id_table =	tower_table,
 };
 
 
@@ -183,8 +297,8 @@ static inline void lego_usb_tower_debug_data (int level, const char *function, i
 	int i;
 
 	if (debug < level)
-		return; 
-	
+		return;
+
 	printk (KERN_DEBUG __FILE__": %s - length = %d, data = ", function, size);
 	for (i = 0; i < size; ++i) {
 		printk ("%.2x ", data[i]);
@@ -198,7 +312,7 @@ static inline void lego_usb_tower_debug_data (int level, const char *function, i
  */
 static inline void tower_delete (struct lego_usb_tower *dev)
 {
-	dbg(2, "%s enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	tower_abort_transfers (dev);
 
@@ -214,7 +328,7 @@ static inline void tower_delete (struct lego_usb_tower *dev)
 	kfree (dev->interrupt_out_buffer);
 	kfree (dev);
 
-	dbg(2, "%s : leave", __func__);
+	dbg(2, "%s: leave", __FUNCTION__);
 }
 
 
@@ -228,7 +342,7 @@ static int tower_open (struct inode *inode, struct file *file)
 	int retval = 0;
 	struct usb_interface *interface;
 
-	dbg(2,"%s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	subminor = iminor(inode);
 
@@ -240,37 +354,63 @@ static int tower_open (struct inode *inode, struct file *file)
 		err ("%s - error, can't find device for minor %d",
 		     __FUNCTION__, subminor);
 		retval = -ENODEV;
-		goto exit_no_device;
+		goto unlock_disconnect_exit;
 	}
 
 	dev = usb_get_intfdata(interface);
 
 	if (!dev) {
 		retval = -ENODEV;
-		goto exit_no_device;
+		goto unlock_disconnect_exit;
 	}
 
 	/* lock this device */
-	down (&dev->sem);
-
-	
-	/* increment our usage count for the device */
-	++dev->open_count;
-
-	/* save device in the file's private structure */
-	file->private_data = dev;
+	if (down_interruptible (&dev->sem)) {
+	        retval = -ERESTARTSYS;
+		goto unlock_disconnect_exit;
+	}
 
+	/* allow opening only once */
+	if (dev->open_count) {
+		retval = -EBUSY;
+		goto unlock_exit;
+	}
+	dev->open_count = 1;
 
 	/* initialize in direction */
 	dev->read_buffer_length = 0;
+	dev->read_packet_length = 0;
+	usb_fill_int_urb (dev->interrupt_in_urb,
+			  dev->udev,
+			  usb_rcvintpipe(dev->udev, dev->interrupt_in_endpoint->bEndpointAddress),
+			  dev->interrupt_in_buffer,
+			  dev->interrupt_in_endpoint->wMaxPacketSize,
+			  tower_interrupt_in_callback,
+			  dev,
+			  dev->interrupt_in_interval);
+
+	dev->interrupt_in_running = 1;
+	dev->interrupt_in_done = 0;
+	mb();
+
+	retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL);
+	if (retval) {
+		err("Couldn't submit interrupt_in_urb %d", retval);
+		dev->interrupt_in_running = 0;
+		dev->open_count = 0;
+		goto unlock_exit;
+	}
 
-	up (&dev->sem);
+	/* save device in the file's private structure */
+	file->private_data = dev;
 
-exit_no_device:
+unlock_exit:
+	up (&dev->sem);
 
+unlock_disconnect_exit:
 	up (&disconnect_sem);
 
-	dbg(2,"%s : leave, return value %d ", __func__, retval);
+	dbg(2, "%s: leave, return value %d ", __FUNCTION__, retval);
 
 	return retval;
 }
@@ -283,87 +423,137 @@ static int tower_release (struct inode *inode, struct file *file)
 	struct lego_usb_tower *dev;
 	int retval = 0;
 
-	dbg(2," %s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	dev = (struct lego_usb_tower *)file->private_data;
 
 	if (dev == NULL) {
-		dbg(1," %s : object is NULL", __func__);
+		dbg(1, "%s: object is NULL", __FUNCTION__);
 		retval = -ENODEV;
 		goto exit;
 	}
 
+	if (down_interruptible (&dev->sem)) {
+	        retval = -ERESTARTSYS;
+		goto exit;
+	}
 
-	/* lock our device */
-	down (&dev->sem);
-
- 	if (dev->open_count <= 0) {
-		dbg(1," %s : device not opened", __func__);
+	if (dev->open_count != 1) {
+		dbg(1, "%s: device not opened exactly once", __FUNCTION__);
 		retval = -ENODEV;
+		goto unlock_exit;
+	}
+	if (dev->udev == NULL) {
+		/* the device was unplugged before the file was released */
+		up (&dev->sem);	/* unlock here as tower_delete frees dev */
+		tower_delete (dev);
 		goto exit;
 	}
 
-	/* do the work */
-	retval = tower_release_internal (dev);
+	/* wait until write transfer is finished */
+	if (dev->interrupt_out_busy) {
+		wait_event_interruptible_timeout (dev->write_wait, !dev->interrupt_out_busy, 2 * HZ);
+	}
+	tower_abort_transfers (dev);
+	dev->open_count = 0;
+
+unlock_exit:
+	up (&dev->sem);
 
 exit:
-	up (&dev->sem);
-	dbg(2," %s : leave, return value %d", __func__, retval);
+	dbg(2, "%s: leave, return value %d", __FUNCTION__, retval);
 	return retval;
 }
 
 
 /**
- *	tower_release_internal
+ *	tower_abort_transfers
+ *      aborts transfers and frees associated data structures
  */
-static int tower_release_internal (struct lego_usb_tower *dev)
+static void tower_abort_transfers (struct lego_usb_tower *dev)
 {
-	int retval = 0;
-
-	dbg(2," %s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
-	if (dev->udev == NULL) {
-		/* the device was unplugged before the file was released */
-		tower_delete (dev);
+	if (dev == NULL) {
+		dbg(1, "%s: dev is null", __FUNCTION__);
 		goto exit;
 	}
 
-	/* decrement our usage count for the device */
-	--dev->open_count;
-	if (dev->open_count <= 0) {
-		tower_abort_transfers (dev);
-		dev->open_count = 0;
+	/* shutdown transfer */
+	if (dev->interrupt_in_running) {
+		dev->interrupt_in_running = 0;
+		mb();
+		if (dev->interrupt_in_urb != NULL && dev->udev) {
+			usb_unlink_urb (dev->interrupt_in_urb);
+		}
+	}
+	if (dev->interrupt_out_busy) {
+		if (dev->interrupt_out_urb != NULL && dev->udev) {
+			usb_unlink_urb (dev->interrupt_out_urb);
+		}
 	}
 
 exit:
-	dbg(2," %s : leave", __func__);
-	return retval;
+	dbg(2, "%s: leave", __FUNCTION__);
 }
 
 
 /**
- *	tower_abort_transfers
- *      aborts transfers and frees associated data structures
+ *	tower_check_for_read_packet
+ *
+ *      To get correct semantics for signals and non-blocking I/O
+ *      with packetizing we pretend not to see any data in the read buffer
+ *      until it has been there unchanged for at least
+ *      dev->packet_timeout_jiffies, or until the buffer is full.
  */
-static void tower_abort_transfers (struct lego_usb_tower *dev)
+static void tower_check_for_read_packet (struct lego_usb_tower *dev)
 {
-	dbg(2," %s : enter", __func__);
-
-	if (dev == NULL) {
-		dbg(1," %s : dev is null", __func__);
-	        goto exit;
+	spin_lock_irq (&dev->read_buffer_lock);
+	if (!packet_timeout
+	    || time_after(jiffies, dev->read_last_arrival + dev->packet_timeout_jiffies)
+	    || dev->read_buffer_length == read_buffer_size) {
+		dev->read_packet_length = dev->read_buffer_length;
 	}
+	dev->interrupt_in_done = 0;
+	spin_unlock_irq (&dev->read_buffer_lock);
+}
 
-	/* shutdown transfer */
-	if (dev->interrupt_in_urb != NULL) {
-		usb_unlink_urb (dev->interrupt_in_urb);
+
+/**
+ *	tower_poll
+ */
+static unsigned int tower_poll (struct file *file, poll_table *wait)
+{
+	struct lego_usb_tower *dev;
+	unsigned int mask = 0;
+
+	dbg(2, "%s: enter", __FUNCTION__);
+
+	dev = file->private_data;
+
+	poll_wait(file, &dev->read_wait, wait);
+	poll_wait(file, &dev->write_wait, wait);
+
+	tower_check_for_read_packet(dev);
+	if (dev->read_packet_length > 0) {
+		mask |= POLLIN | POLLRDNORM;
 	}
-	if (dev->interrupt_out_urb != NULL) {
-		usb_unlink_urb (dev->interrupt_out_urb);
+	if (!dev->interrupt_out_busy) {
+		mask |= POLLOUT | POLLWRNORM;
 	}
 
-exit:
-	dbg(2," %s : leave", __func__);
+	dbg(2, "%s: leave, mask = %d", __FUNCTION__, mask);
+
+	return mask;
+}
+
+
+/**
+ *	tower_llseek
+ */
+static loff_t tower_llseek (struct file *file, loff_t off, int whence)
+{
+	return -ESPIPE;		/* unseekable */
 }
 
 
@@ -373,96 +563,87 @@ exit:
 static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t *ppos)
 {
 	struct lego_usb_tower *dev;
-	size_t bytes_read = 0;
 	size_t bytes_to_read;
 	int i;
 	int retval = 0;
-	int timeout = 0;
+	unsigned long timeout = 0;
 
-	dbg(2," %s : enter, count = %Zd", __func__, count);
+	dbg(2, "%s: enter, count = %Zd", __FUNCTION__, count);
 
 	dev = (struct lego_usb_tower *)file->private_data;
-	
+
 	/* lock this object */
-	down (&dev->sem);
+	if (down_interruptible (&dev->sem)) {
+		retval = -ERESTARTSYS;
+		goto exit;
+	}
 
 	/* verify that the device wasn't unplugged */
 	if (dev->udev == NULL) {
 		retval = -ENODEV;
 		err("No device or device unplugged %d", retval);
-		goto exit;
+		goto unlock_exit;
 	}
 
 	/* verify that we actually have some data to read */
 	if (count == 0) {
-		dbg(1," %s : read request of 0 bytes", __func__);
-		goto exit;
+		dbg(1, "%s: read request of 0 bytes", __FUNCTION__);
+		goto unlock_exit;
 	}
 
+	if (read_timeout) {
+		timeout = jiffies + read_timeout * HZ / 1000;
+	}
 
-	timeout = COMMAND_TIMEOUT;
-
-	while (1) {
-		if (dev->read_buffer_length == 0) {
-
-			/* start reading */
-			usb_fill_int_urb (dev->interrupt_in_urb,dev->udev,
-					  usb_rcvintpipe(dev->udev, dev->interrupt_in_endpoint->bEndpointAddress),
-					  dev->interrupt_in_buffer,
-					  dev->interrupt_in_endpoint->wMaxPacketSize,
-					  tower_interrupt_in_callback,
-					  dev,
-					  dev->interrupt_in_endpoint->bInterval);
-			
-			retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL);
-			
-			if (retval < 0) {
-				err("Couldn't submit interrupt_in_urb");
-				goto exit;
-			}
+	/* wait for data */
+	tower_check_for_read_packet (dev);
+	while (dev->read_packet_length == 0) {
+		if (file->f_flags & O_NONBLOCK) {
+			retval = -EAGAIN;
+			goto unlock_exit;
+		}
+		retval = wait_event_interruptible_timeout(dev->read_wait, dev->interrupt_in_done, dev->packet_timeout_jiffies);
+		if (retval < 0) {
+			goto unlock_exit;
+		}
 
-			if (timeout <= 0) {
-			        retval = -ETIMEDOUT;
-			        goto exit;
-			}
+		/* reset read timeout during read or write activity */
+		if (read_timeout
+		    && (dev->read_buffer_length || dev->interrupt_out_busy)) {
+			timeout = jiffies + read_timeout * HZ / 1000;
+		}
+		/* check for read timeout */
+		if (read_timeout && time_after (jiffies, timeout)) {
+			retval = -ETIMEDOUT;
+			goto unlock_exit;
+		}
+		tower_check_for_read_packet (dev);
+	}
 
-			if (signal_pending(current)) {
-				retval = -EINTR;
-				goto exit;
-			}
+	/* copy the data from read_buffer into userspace */
+	bytes_to_read = min(count, dev->read_packet_length);
 
-			up (&dev->sem);
-			timeout = interruptible_sleep_on_timeout (&dev->read_wait, timeout);
-			down (&dev->sem);
+	if (copy_to_user (buffer, dev->read_buffer, bytes_to_read)) {
+		retval = -EFAULT;
+		goto unlock_exit;
+	}
 
-		} else {
-			/* copy the data from read_buffer into userspace */
-			bytes_to_read = count > dev->read_buffer_length ? dev->read_buffer_length : count;
-			if (copy_to_user (buffer, dev->read_buffer, bytes_to_read) != 0) {
-				retval = -EFAULT;
-				goto exit;
-			}
-			dev->read_buffer_length -= bytes_to_read;
-			for (i=0; i<dev->read_buffer_length; i++) {
-				dev->read_buffer[i] = dev->read_buffer[i+bytes_to_read];
-			}
-
-			buffer += bytes_to_read;
-			count -= bytes_to_read;
-			bytes_read += bytes_to_read;
-			if (count == 0) {
-				break;
-			}
-		}
+	spin_lock_irq (&dev->read_buffer_lock);
+	dev->read_buffer_length -= bytes_to_read;
+	dev->read_packet_length -= bytes_to_read;
+	for (i=0; i<dev->read_buffer_length; i++) {
+		dev->read_buffer[i] = dev->read_buffer[i+bytes_to_read];
 	}
+	spin_unlock_irq (&dev->read_buffer_lock);
 
-	retval = bytes_read;
+	retval = bytes_to_read;
 
-exit:
+unlock_exit:
 	/* unlock the device */
 	up (&dev->sem);
 
-	dbg(2," %s : leave, return value %d", __func__, retval);
+exit:
+	dbg(2, "%s: leave, return value %d", __FUNCTION__, retval);
 	return retval;
 }
 
@@ -473,107 +654,80 @@ exit:
 static ssize_t tower_write (struct file *file, const char *buffer, size_t count, loff_t *ppos)
 {
 	struct lego_usb_tower *dev;
-	size_t bytes_written = 0;
 	size_t bytes_to_write;
-	size_t buffer_size;
 	int retval = 0;
-	int timeout = 0;
 
-	dbg(2," %s : enter, count = %Zd", __func__, count);
+	dbg(2, "%s: enter, count = %Zd", __FUNCTION__, count);
 
 	dev = (struct lego_usb_tower *)file->private_data;
 
 	/* lock this object */
-	down (&dev->sem);
+	if (down_interruptible (&dev->sem)) {
+		retval = -ERESTARTSYS;
+		goto exit;
+	}
 
 	/* verify that the device wasn't unplugged */
 	if (dev->udev == NULL) {
 		retval = -ENODEV;
 		err("No device or device unplugged %d", retval);
-		goto exit;
+		goto unlock_exit;
 	}
 
 	/* verify that we actually have some data to write */
 	if (count == 0) {
-		dbg(1," %s : write request of 0 bytes", __func__);
-		goto exit;
+		dbg(1, "%s: write request of 0 bytes", __FUNCTION__);
+		goto unlock_exit;
 	}
 
+	/* wait until previous transfer is finished */
+	while (dev->interrupt_out_busy) {
+		if (file->f_flags & O_NONBLOCK) {
+			retval = -EAGAIN;
+			goto unlock_exit;
+		}
+		retval = wait_event_interruptible (dev->write_wait, !dev->interrupt_out_busy);
+		if (retval) {
+			goto unlock_exit;
+		}
+	}
 
-	while (count > 0) {
-		if (dev->interrupt_out_urb->status == -EINPROGRESS) {
-			timeout = COMMAND_TIMEOUT;
-
-			while (timeout > 0) {
-				if (signal_pending(current)) {
-					dbg(1," %s : interrupted", __func__);
-					retval = -EINTR;
-					goto exit;
-				}
-				up (&dev->sem);
-				timeout = interruptible_sleep_on_timeout (&dev->write_wait, timeout);
-				down (&dev->sem);
-				if (timeout > 0) {
-					break;
-				}
-				dbg(1," %s : interrupted timeout: %d", __func__, timeout);
-			}
+	/* write the data into interrupt_out_buffer from userspace */
+	bytes_to_write = min(count, write_buffer_size);
+	dbg(4, "%s: count = %Zd, bytes_to_write = %Zd", __FUNCTION__, count, bytes_to_write);
 
+	if (copy_from_user (dev->interrupt_out_buffer, buffer, bytes_to_write)) {
+		retval = -EFAULT;
+		goto unlock_exit;
+	}
 
-			dbg(1," %s : final timeout: %d", __func__, timeout);
+	/* send off the urb */
+	usb_fill_int_urb(dev->interrupt_out_urb,
+			 dev->udev,
+			 usb_sndintpipe(dev->udev, dev->interrupt_out_endpoint->bEndpointAddress),
+			 dev->interrupt_out_buffer,
+			 bytes_to_write,
+			 tower_interrupt_out_callback,
+			 dev,
+			 dev->interrupt_out_interval);
 
-			if (timeout == 0) {
-				dbg(1, "%s - command timed out.", __func__);
-				retval = -ETIMEDOUT;
-				goto exit;
-			}
+	dev->interrupt_out_busy = 1;
+	wmb();
 
-			dbg(4," %s : in progress, count = %Zd", __func__, count);
-		} else {
-			dbg(4," %s : sending, count = %Zd", __func__, count);
-
-			/* write the data into interrupt_out_buffer from userspace */
-			buffer_size = dev->interrupt_out_endpoint->wMaxPacketSize;
-			bytes_to_write = count > buffer_size ? buffer_size : count;
-			dbg(4," %s : buffer_size = %Zd, count = %Zd, bytes_to_write = %Zd", __func__, buffer_size, count, bytes_to_write);
-
-			if (copy_from_user (dev->interrupt_out_buffer, buffer, bytes_to_write) != 0) {
-				retval = -EFAULT;
-				goto exit;
-			}
-
-			/* send off the urb */
-			usb_fill_int_urb(dev->interrupt_out_urb,
-					dev->udev, 
-					usb_sndintpipe(dev->udev, dev->interrupt_out_endpoint->bEndpointAddress),
-					dev->interrupt_out_buffer,
-					bytes_to_write,
-					tower_interrupt_out_callback,
-					dev,
-					dev->interrupt_in_endpoint->bInterval);
-
-			dev->interrupt_out_urb->actual_length = bytes_to_write;
-			retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL);
-
-			if (retval < 0) {
-				err("Couldn't submit interrupt_out_urb %d", retval);
-				goto exit;
-			}
-
-			buffer += bytes_to_write;
-			count -= bytes_to_write;
-
-			bytes_written += bytes_to_write;
-		}
+	retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL);
+	if (retval) {
+		dev->interrupt_out_busy = 0;
+		err("Couldn't submit interrupt_out_urb %d", retval);
+		goto unlock_exit;
 	}
+	retval = bytes_to_write;
 
-	retval = bytes_written;
-
-exit:
+unlock_exit:
 	/* unlock the device */
 	up (&dev->sem);
 
-	dbg(2," %s : leave, return value %d", __func__, retval);
+exit:
+	dbg(2, "%s: leave, return value %d", __FUNCTION__, retval);
 
 	return retval;
 }
@@ -585,39 +739,53 @@ exit:
 static void tower_interrupt_in_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
+	int retval;
 
-	dbg(4," %s : enter, status %d", __func__, urb->status);
+	dbg(4, "%s: enter, status %d", __FUNCTION__, urb->status);
 
-	lego_usb_tower_debug_data(5,__func__, urb->actual_length, urb->transfer_buffer);
+	lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 
-	if (urb->status != 0) {
-		if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) {
-			dbg(1," %s : nonzero status received: %d", __func__, urb->status);
+	if (urb->status) {
+		if (urb->status == -ENOENT ||
+		    urb->status == -ECONNRESET ||
+		    urb->status == -ESHUTDOWN) {
+			goto exit;
+		} else {
+			dbg(1, "%s: nonzero status received: %d", __FUNCTION__, urb->status);
+			goto resubmit; /* maybe we can recover */
 		}
-		goto exit;
 	}
 
-	down (&dev->sem);
-
 	if (urb->actual_length > 0) {
-		if (dev->read_buffer_length < (4 * dev->interrupt_in_endpoint->wMaxPacketSize) - (urb->actual_length)) {
-
-			memcpy (dev->read_buffer+dev->read_buffer_length, dev->interrupt_in_buffer, urb->actual_length);
-
+		spin_lock (&dev->read_buffer_lock);
+		if (dev->read_buffer_length + urb->actual_length < read_buffer_size) {
+			memcpy (dev->read_buffer + dev->read_buffer_length,
+				dev->interrupt_in_buffer,
+				urb->actual_length);
 			dev->read_buffer_length += urb->actual_length;
-			dbg(1," %s reading  %d ", __func__, urb->actual_length);
-			wake_up_interruptible (&dev->read_wait);
-
+			dev->read_last_arrival = jiffies;
+			dbg(3, "%s: received %d bytes", __FUNCTION__, urb->actual_length);
 		} else {
-			dbg(1," %s : read_buffer overflow", __func__);
+			printk(KERN_WARNING "%s: read_buffer overflow, %d bytes dropped", __FUNCTION__, urb->actual_length);
 		}
+		spin_unlock (&dev->read_buffer_lock);
 	}
 
-	up (&dev->sem);
+resubmit:
+	/* resubmit if we're still running */
+	if (dev->interrupt_in_running && dev->udev) {
+		retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC);
+		if (retval) {
+			err("%s: usb_submit_urb failed (%d)", __FUNCTION__, retval);
+		}
+	}
 
 exit:
-	lego_usb_tower_debug_data(5,__func__, urb->actual_length, urb->transfer_buffer);
-	dbg(4," %s : leave, status %d", __func__, urb->status);
+	dev->interrupt_in_done = 1;
+	wake_up_interruptible (&dev->read_wait);
+
+	lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
+	dbg(4, "%s: leave, status %d", __FUNCTION__, urb->status);
 }
 
 
@@ -628,22 +796,22 @@ static void tower_interrupt_out_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
 
-	dbg(4," %s : enter, status %d", __func__, urb->status);
-	lego_usb_tower_debug_data(5,__func__, urb->actual_length, urb->transfer_buffer);
+	dbg(4, "%s: enter, status %d", __FUNCTION__, urb->status);
+	lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 
-	if (urb->status != 0) {
-		if ((urb->status != -ENOENT) && 
-		    (urb->status != -ECONNRESET)) {
-			dbg(1, " %s :nonzero status received: %d", __func__, urb->status);
-		}
-		goto exit;
-	}                        
+	/* sync/async unlink faults aren't errors */
+	if (urb->status && !(urb->status == -ENOENT ||
+			     urb->status == -ECONNRESET ||
+			     urb->status == -ESHUTDOWN)) {
+		dbg(1, "%s - nonzero write bulk status received: %d",
+		    __FUNCTION__, urb->status);
+	}
 
+	dev->interrupt_out_busy = 0;
 	wake_up_interruptible(&dev->write_wait);
-exit:
 
-	lego_usb_tower_debug_data(5,__func__, urb->actual_length, urb->transfer_buffer);
-	dbg(4," %s : leave, status %d", __func__, urb->status);
+	lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
+	dbg(4, "%s: leave, status %d", __FUNCTION__, urb->status);
 }
 
 
@@ -659,15 +827,18 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 	struct lego_usb_tower *dev = NULL;
 	struct usb_host_interface *iface_desc;
 	struct usb_endpoint_descriptor* endpoint;
+	struct tower_reset_reply reset_reply;
+	struct tower_get_version_reply get_version_reply;
 	int i;
 	int retval = -ENOMEM;
+	int result;
 
-	dbg(2," %s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	if (udev == NULL) {
 		info ("udev is NULL.");
 	}
-	
+
 	/* See if the device offered us matches what we can accept */
 	if ((udev->descriptor.idVendor != LEGO_USB_TOWER_VENDOR_ID) ||
 	    (udev->descriptor.idProduct != LEGO_USB_TOWER_PRODUCT_ID)) {
@@ -691,6 +862,10 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 
 	dev->read_buffer = NULL;
 	dev->read_buffer_length = 0;
+	dev->read_packet_length = 0;
+	spin_lock_init (&dev->read_buffer_lock);
+	dev->packet_timeout_jiffies = packet_timeout * HZ / 1000;
+	dev->read_last_arrival = jiffies;
 
 	init_waitqueue_head (&dev->read_wait);
 	init_waitqueue_head (&dev->write_wait);
@@ -698,13 +873,15 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 	dev->interrupt_in_buffer = NULL;
 	dev->interrupt_in_endpoint = NULL;
 	dev->interrupt_in_urb = NULL;
+	dev->interrupt_in_running = 0;
+	dev->interrupt_in_done = 0;
 
 	dev->interrupt_out_buffer = NULL;
 	dev->interrupt_out_endpoint = NULL;
 	dev->interrupt_out_urb = NULL;
+	dev->interrupt_out_busy = 0;
 
-
-	iface_desc = &interface->altsetting[0];
+	iface_desc = interface->cur_altsetting;
 
 	/* set up the endpoint information */
 	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
@@ -714,7 +891,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 		    ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)) {
 			dev->interrupt_in_endpoint = endpoint;
 		}
-		
+
 		if (((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) &&
 		    ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)) {
 			dev->interrupt_out_endpoint = endpoint;
@@ -729,7 +906,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 		goto error;
 	}
 
-	dev->read_buffer = kmalloc ((4*dev->interrupt_in_endpoint->wMaxPacketSize), GFP_KERNEL);
+	dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL);
 	if (!dev->read_buffer) {
 		err("Couldn't allocate read_buffer");
 		goto error;
@@ -744,7 +921,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 		err("Couldn't allocate interrupt_in_urb");
 		goto error;
 	}
-	dev->interrupt_out_buffer = kmalloc (dev->interrupt_out_endpoint->wMaxPacketSize, GFP_KERNEL);
+	dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL);
 	if (!dev->interrupt_out_buffer) {
 		err("Couldn't allocate interrupt_out_buffer");
 		goto error;
@@ -753,7 +930,9 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 	if (!dev->interrupt_out_urb) {
 		err("Couldn't allocate interrupt_out_urb");
 		goto error;
-	}                
+	}
+	dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval;
+	dev->interrupt_out_interval = interrupt_out_interval ? interrupt_out_interval : dev->interrupt_out_endpoint->bInterval;
 
 	/* we can register the device now, as it is ready */
 	usb_set_intfdata (interface, dev);
@@ -766,16 +945,50 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
 		usb_set_intfdata (interface, NULL);
 		goto error;
 	}
-
 	dev->minor = interface->minor;
 
 	/* let the user know what node this device is now attached to */
-	info ("LEGO USB Tower device now attached to /dev/usb/lego%d", (dev->minor - LEGO_USB_TOWER_MINOR_BASE));
+	info ("LEGO USB Tower #%d now attached to major %d minor %d", (dev->minor - LEGO_USB_TOWER_MINOR_BASE), USB_MAJOR, dev->minor);
+
+	/* reset the tower */
+	result = usb_control_msg (udev,
+				  usb_rcvctrlpipe(udev, 0),
+				  LEGO_USB_TOWER_REQUEST_RESET,
+				  USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE,
+				  0,
+				  0,
+				  &reset_reply,
+				  sizeof(reset_reply),
+				  HZ);
+	if (result < 0) {
+		err("LEGO USB Tower reset control request failed");
+		retval = result;
+		goto error;
+	}
 
+	/* get the firmware version and log it */
+	result = usb_control_msg (udev,
+				  usb_rcvctrlpipe(udev, 0),
+				  LEGO_USB_TOWER_REQUEST_GET_VERSION,
+				  USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE,
+				  0,
+				  0,
+				  &get_version_reply,
+				  sizeof(get_version_reply),
+				  HZ);
+	if (result < 0) {
+		err("LEGO USB Tower get version control request failed");
+		retval = result;
+		goto error;
+	}
+	info("LEGO USB Tower firmware version is %d.%d build %d",
+	     get_version_reply.major,
+	     get_version_reply.minor,
+	     le16_to_cpu(get_version_reply.build_no));
 
 
 exit:
-	dbg(2," %s : leave, return value 0x%.8lx (dev)", __func__, (long) dev);
+	dbg(2, "%s: leave, return value 0x%.8lx (dev)", __FUNCTION__, (long) dev);
 
 	return retval;
 
@@ -795,7 +1008,7 @@ static void tower_disconnect (struct usb_interface *interface)
 	struct lego_usb_tower *dev;
 	int minor;
 
-	dbg(2," %s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	down (&disconnect_sem);
 
@@ -823,7 +1036,7 @@ static void tower_disconnect (struct usb_interface *interface)
 
 	info("LEGO USB Tower #%d now disconnected", (minor - LEGO_USB_TOWER_MINOR_BASE));
 
-	dbg(2," %s : leave", __func__);
+	dbg(2, "%s: leave", __FUNCTION__);
 }
 
 
@@ -836,7 +1049,7 @@ static int __init lego_usb_tower_init(void)
 	int result;
 	int retval = 0;
 
-	dbg(2," %s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	/* register this driver with the USB subsystem */
 	result = usb_register(&tower_driver);
@@ -849,7 +1062,7 @@ static int __init lego_usb_tower_init(void)
 	info(DRIVER_DESC " " DRIVER_VERSION);
 
 exit:
-	dbg(2," %s : leave, return value %d", __func__, retval);
+	dbg(2, "%s: leave, return value %d", __FUNCTION__, retval);
 
 	return retval;
 }
@@ -860,12 +1073,12 @@ exit:
  */
 static void __exit lego_usb_tower_exit(void)
 {
-	dbg(2," %s : enter", __func__);
+	dbg(2, "%s: enter", __FUNCTION__);
 
 	/* deregister this driver with the USB subsystem */
 	usb_deregister (&tower_driver);
 
-	dbg(2," %s : leave", __func__);
+	dbg(2, "%s: leave", __FUNCTION__);
 }
 
 module_init (lego_usb_tower_init);
diff --git a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c
index f9609d060..d6e195820 100644
--- a/drivers/usb/misc/speedtch.c
+++ b/drivers/usb/misc/speedtch.c
@@ -269,7 +269,7 @@ struct udsl_instance_data {
 static void udsl_atm_dev_close (struct atm_dev *dev);
 static int udsl_atm_open (struct atm_vcc *vcc);
 static void udsl_atm_close (struct atm_vcc *vcc);
-static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg);
+static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void __user *arg);
 static int udsl_atm_send (struct atm_vcc *vcc, struct sk_buff *skb);
 static int udsl_atm_proc_read (struct atm_dev *atm_dev, loff_t *pos, char *page);
 
@@ -991,11 +991,11 @@ static void udsl_atm_close (struct atm_vcc *vcc)
 	dbg ("udsl_atm_close successful");
 }
 
-static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void *arg)
+static int udsl_atm_ioctl (struct atm_dev *dev, unsigned int cmd, void __user *arg)
 {
 	switch (cmd) {
 	case ATM_QUERYLOOP:
-		return put_user (ATM_LM_NONE, (int *) arg) ? -EFAULT : 0;
+		return put_user (ATM_LM_NONE, (int __user *)arg) ? -EFAULT : 0;
 	default:
 		return -ENOIOCTLCMD;
 	}
diff --git a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
index 58d2ec90c..471873b0c 100644
--- a/drivers/usb/misc/tiglusb.c
+++ b/drivers/usb/misc/tiglusb.c
@@ -33,6 +33,7 @@
 #include <linux/usb.h>
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
+#include <linux/device.h>
 
 #include <linux/ticable.h>
 #include "tiglusb.h"
@@ -49,6 +50,7 @@
 
 static tiglusb_t tiglusb[MAXTIGL];
 static int timeout = TIMAXTIME;	/* timeout in tenth of seconds     */
+static struct class_simple *tiglusb_class;
 
 /*---------- misc functions ------------------------------------------- */
 
@@ -336,7 +338,7 @@ tiglusb_probe (struct usb_interface *intf,
 {
 	struct usb_device *dev = interface_to_usbdev(intf);
 	int minor = -1;
-	int i;
+	int i, err = 0;
 	ptiglusb_t s;
 
 	dbg ("probing vendor id 0x%x, device id 0x%x",
@@ -347,18 +349,23 @@ tiglusb_probe (struct usb_interface *intf,
 	 * the TIGL hardware, there's only 1 configuration.
 	 */
 
-	if (dev->descriptor.bNumConfigurations != 1)
-		return -ENODEV;
+	if (dev->descriptor.bNumConfigurations != 1) {
+		err = -ENODEV;
+		goto out;
+	}
 
 	if ((dev->descriptor.idProduct != 0xe001)
-	    && (dev->descriptor.idVendor != 0x451))
-		return -ENODEV;
+	    && (dev->descriptor.idVendor != 0x451)) {
+		err = -ENODEV;
+		goto out;
+	}
 
 	// NOTE:  it's already in this config, this shouldn't be needed.
 	// is this working around some hardware bug?
 	if (usb_reset_configuration (dev) < 0) {
 		err ("tiglusb_probe: reset_configuration failed");
-		return -ENODEV;
+		err = -ENODEV;
+		goto out;
 	}
 
 	/*
@@ -372,8 +379,10 @@ tiglusb_probe (struct usb_interface *intf,
 		}
 	}
 
-	if (minor == -1)
-		return -ENODEV;
+	if (minor == -1) {
+		err = -ENODEV;
+		goto out;
+	}
 
 	s = &tiglusb[minor];
 
@@ -383,17 +392,28 @@ tiglusb_probe (struct usb_interface *intf,
 	up (&s->mutex);
 	dbg ("bound to interface");
 
-	devfs_mk_cdev(MKDEV(TIUSB_MAJOR, TIUSB_MINOR) + s->minor,
+	class_simple_device_add(tiglusb_class, MKDEV(TIUSB_MAJOR, TIUSB_MINOR + s->minor),
+			NULL, "usb%d", s->minor);
+	err = devfs_mk_cdev(MKDEV(TIUSB_MAJOR, TIUSB_MINOR) + s->minor,
 			S_IFCHR | S_IRUGO | S_IWUGO,
 			"ticables/usb/%d", s->minor);
 
+	if (err)
+		goto out_class;
+
 	/* Display firmware version */
 	info ("firmware revision %i.%02x",
 		dev->descriptor.bcdDevice >> 8,
 		dev->descriptor.bcdDevice & 0xff);
 
 	usb_set_intfdata (intf, s);
-	return 0;
+	err = 0;
+	goto out;
+
+out_class:
+	class_simple_device_remove(MKDEV(TIUSB_MAJOR, TIUSB_MINOR + s->minor));
+out:
+	return err;
 }
 
 static void
@@ -423,6 +443,7 @@ tiglusb_disconnect (struct usb_interface *intf)
 	s->dev = NULL;
 	s->opened = 0;
 
+	class_simple_device_remove(MKDEV(TIUSB_MAJOR, TIUSB_MINOR + s->minor));
 	devfs_remove("ticables/usb/%d", s->minor);
 
 	info ("device %d removed", s->minor);
@@ -473,7 +494,7 @@ static int __init
 tiglusb_init (void)
 {
 	unsigned u;
-	int result;
+	int result, err = 0;
 
 	/* initialize struct */
 	for (u = 0; u < MAXTIGL; u++) {
@@ -490,28 +511,41 @@ tiglusb_init (void)
 	/* register device */
 	if (register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) {
 		err ("unable to get major %d", TIUSB_MAJOR);
-		return -EIO;
+		err = -EIO;
+		goto out;
 	}
 
 	/* Use devfs, tree: /dev/ticables/usb/[0..3] */
 	devfs_mk_dir ("ticables/usb");
 
+	tiglusb_class = class_simple_create(THIS_MODULE, "tiglusb");
+	if (IS_ERR(tiglusb_class)) {
+		err = PTR_ERR(tiglusb_class);
+		goto out_chrdev;
+	}
 	/* register USB module */
 	result = usb_register (&tiglusb_driver);
 	if (result < 0) {
-		unregister_chrdev (TIUSB_MAJOR, "tiglusb");
-		return -1;
+		err = -1;
+		goto out_chrdev;
 	}
 
 	info (DRIVER_DESC ", version " DRIVER_VERSION);
 
-	return 0;
+	err = 0;
+	goto out;
+
+out_chrdev:
+	unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+out:
+	return err;
 }
 
 static void __exit
 tiglusb_cleanup (void)
 {
 	usb_deregister (&tiglusb_driver);
+	class_simple_destroy(tiglusb_class);
 	devfs_remove("ticables/usb");
 	unregister_chrdev (TIUSB_MAJOR, "tiglusb");
 }
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index f7be4dc9a..2fb1fae8c 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -802,6 +802,7 @@ error:
 				switch (status) {
 				case -EINPROGRESS:
 				case -EBUSY:
+				case -EIDRM:
 					continue;
 				default:
 					dbg ("urb unlink --> %d", status);
@@ -1038,8 +1039,6 @@ static void unlink1_callback (struct urb *urb, struct pt_regs *regs)
 	if (!status)
 		status = usb_submit_urb (urb, SLAB_ATOMIC);
 	if (status) {
-		if (status == -ECONNRESET || status == -ENOENT)
-			status = 0;
 		urb->status = status;
 		complete ((struct completion *) urb->context);
 	}
@@ -1074,11 +1073,12 @@ static int unlink1 (struct usbtest_dev *dev, int pipe, int size, int async)
 	/* unlinking that should always work.  variable delay tests more
 	 * hcd states and code paths, even with little other system load.
 	 */
-	wait_ms (jiffies % (2 * INTERRUPT_RATE));
+	msleep (jiffies % (2 * INTERRUPT_RATE));
 retry:
 	retval = usb_unlink_urb (urb);
-	if (retval == -EBUSY) {
+	if (retval == -EBUSY || retval == -EIDRM) {
 		/* we can't unlink urbs while they're completing.
+		 * or if they've completed, and we haven't resubmitted.
 		 * "normal" drivers would prevent resubmission, but
 		 * since we're testing unlink paths, we can't.
 		 */
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c
index d20b9b814..0bc5ccc24 100644
--- a/drivers/usb/misc/uss720.c
+++ b/drivers/usb/misc/uss720.c
@@ -553,7 +553,7 @@ static int uss720_probe(struct usb_interface *intf,
 	i = usb_set_interface(usbdev, intf->altsetting->desc.bInterfaceNumber, 2);
 	printk(KERN_DEBUG "uss720: set inteface result %d\n", i);
 
-	interface = &intf->altsetting[2];
+	interface = intf->cur_altsetting;
 
 	/*
 	 * Allocate parport interface 
diff --git a/drivers/usb/net/catc.c b/drivers/usb/net/catc.c
index d705e815a..de9bf863e 100644
--- a/drivers/usb/net/catc.c
+++ b/drivers/usb/net/catc.c
@@ -672,7 +672,7 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
         struct catc *catc = dev->priv;
         u32 cmd;
         
-        if (get_user(cmd, (u32 *)useraddr))
+        if (get_user(cmd, (u32 __user *)useraddr))
                 return -EFAULT;
 
         switch (cmd) {
@@ -726,7 +726,7 @@ static int catc_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
         switch(cmd) {
         case SIOCETHTOOL:
-                return netdev_ethtool_ioctl(dev, (void __user *)rq->ifr_data);
+                return netdev_ethtool_ioctl(dev, rq->ifr_data);
         default:
                 return -EOPNOTSUPP;
         }
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
index 09c6bbe66..42a248f8f 100644
--- a/drivers/usb/net/kaweth.c
+++ b/drivers/usb/net/kaweth.c
@@ -123,9 +123,10 @@ static int kaweth_probe(
 		const struct usb_device_id *id	/* from id_table */
 	);
 static void kaweth_disconnect(struct usb_interface *intf);
-int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
-				struct usb_ctrlrequest *cmd, void *data,
-				int len, int timeout);
+static int kaweth_internal_control_msg(struct usb_device *usb_dev,
+				       unsigned int pipe,
+				       struct usb_ctrlrequest *cmd, void *data,
+				       int len, int timeout);
 
 /****************************************************************
  *     usb_device_id
@@ -736,7 +737,7 @@ static int kaweth_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
 {
 	switch (cmd) {
 	case SIOCETHTOOL:
-		return netdev_ethtool_ioctl(net, (void __user *)rq->ifr_data);
+		return netdev_ethtool_ioctl(net, rq->ifr_data);
 	}
 	return -EOPNOTSUPP;
 }
@@ -1239,20 +1240,21 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
         init_waitqueue_head(&awd.wqh);
         awd.done = 0;
 
-        set_current_state(TASK_INTERRUPTIBLE);
         add_wait_queue(&awd.wqh, &wait);
         urb->context = &awd;
-        status = usb_submit_urb(urb, GFP_ATOMIC);
+        status = usb_submit_urb(urb, GFP_NOIO);
         if (status) {
                 // something went wrong
                 usb_free_urb(urb);
-                set_current_state(TASK_RUNNING);
                 remove_wait_queue(&awd.wqh, &wait);
                 return status;
         }
 
-	while (timeout && !awd.done)
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	while (timeout && !awd.done) {
 		timeout = schedule_timeout(timeout);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+	}
 
         set_current_state(TASK_RUNNING);
         remove_wait_queue(&awd.wqh, &wait);
@@ -1277,9 +1279,10 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
 
 /*-------------------------------------------------------------------*/
 // returns status (negative) or length (positive)
-int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
-                            struct usb_ctrlrequest *cmd, void *data, int len,
-			    int timeout)
+static int kaweth_internal_control_msg(struct usb_device *usb_dev,
+				       unsigned int pipe,
+				       struct usb_ctrlrequest *cmd, void *data,
+				       int len, int timeout)
 {
         struct urb *urb;
         int retv;
@@ -1305,7 +1308,7 @@ int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
 /****************************************************************
  *     kaweth_init
  ****************************************************************/
-int __init kaweth_init(void)
+static int __init kaweth_init(void)
 {
 	kaweth_dbg("Driver loading");
 	return usb_register(&kaweth_driver);
@@ -1314,7 +1317,7 @@ int __init kaweth_init(void)
 /****************************************************************
  *     kaweth_exit
  ****************************************************************/
-void __exit kaweth_exit(void)
+static void __exit kaweth_exit(void)
 {
 	usb_deregister(&kaweth_driver);
 }
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
index 5174c9fbf..5142d8a07 100644
--- a/drivers/usb/net/pegasus.c
+++ b/drivers/usb/net/pegasus.c
@@ -1030,7 +1030,7 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void __user *uaddr)
 	int cmd;
 
 	pegasus = net->priv;
-	if (get_user(cmd, (int *) uaddr))
+	if (get_user(cmd, (int __user *) uaddr))
 		return -EFAULT;
 	switch (cmd) {
 	case ETHTOOL_GDRVINFO:{
@@ -1107,13 +1107,13 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void __user *uaddr)
 #endif
 static int pegasus_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
 {
-	__u16 *data = (__u16 *) & rq->ifr_data;
+	__u16 *data = (__u16 *) & rq->ifr_ifru;
 	pegasus_t *pegasus = net->priv;
 	int res;
 
 	switch (cmd) {
 	case SIOCETHTOOL:
-		res = pegasus_ethtool_ioctl(net, (void __user *)rq->ifr_data);
+		res = pegasus_ethtool_ioctl(net, rq->ifr_data);
 		break;
 	case SIOCDEVPRIVATE:
 		data[0] = pegasus->phy;
@@ -1321,13 +1321,13 @@ static struct usb_driver pegasus_driver = {
 	.id_table = pegasus_ids,
 };
 
-int __init pegasus_init(void)
+static int __init pegasus_init(void)
 {
 	info(DRIVER_VERSION ":" DRIVER_DESC);
 	return usb_register(&pegasus_driver);
 }
 
-void __exit pegasus_exit(void)
+static void __exit pegasus_exit(void)
 {
 	usb_deregister(&pegasus_driver);
 }
diff --git a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h
index 52832af7e..411758b7d 100644
--- a/drivers/usb/net/pegasus.h
+++ b/drivers/usb/net/pegasus.h
@@ -136,6 +136,7 @@ struct usb_eth_dev {
 #define	VENDOR_LANEED		0x056e
 #define	VENDOR_LINKSYS		0x066b
 #define	VENDOR_MELCO		0x0411
+#define	VENDOR_MICROSOFT	0x045e
 #define	VENDOR_MOBILITY		0x1342
 #define	VENDOR_NETGEAR		0x0846
 #define	VENDOR_OCT		0x0b39
@@ -265,6 +266,8 @@ PEGASUS_DEV( "MELCO/BUFFALO LUA-TX", VENDOR_MELCO, 0x0005,
 		DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "MELCO/BUFFALO LUA2-TX", VENDOR_MELCO, 0x0009,
 		DEFAULT_GPIO_RESET | PEGASUS_II )
+PEGASUS_DEV( "Microsoft MN-110", VENDOR_MICROSOFT, 0x007a,
+		DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "NETGEAR FA101", VENDOR_NETGEAR, 0x1020,
 		DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "OCT Inc.", VENDOR_OCT, 0x0109,
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c
index 10de61868..2be3eba6b 100644
--- a/drivers/usb/net/rtl8150.c
+++ b/drivers/usb/net/rtl8150.c
@@ -167,7 +167,7 @@ struct rtl8150 {
 
 typedef struct rtl8150 rtl8150_t;
 
-unsigned long multicast_filter_limit = 32;
+static unsigned long multicast_filter_limit = 32;
 
 static void fill_skb_pool(rtl8150_t *);
 static void free_skb_pool(rtl8150_t *);
@@ -516,7 +516,7 @@ static void write_bulk_callback(struct urb *urb, struct pt_regs *regs)
 	netif_wake_queue(dev->netdev);
 }
 
-void intr_callback(struct urb *urb, struct pt_regs *regs)
+static void intr_callback(struct urb *urb, struct pt_regs *regs)
 {
 	rtl8150_t *dev;
 	__u8 *d;
@@ -776,13 +776,13 @@ static int rtl8150_close(struct net_device *netdev)
 	return res;
 }
 
-static int rtl8150_ethtool_ioctl(struct net_device *netdev, void *uaddr)
+static int rtl8150_ethtool_ioctl(struct net_device *netdev, void __user *uaddr)
 {
 	rtl8150_t *dev;
 	int cmd;
 
 	dev = netdev->priv;
-	if (get_user(cmd, (int *) uaddr))
+	if (get_user(cmd, (int __user *) uaddr))
 		return -EFAULT;
 
 	switch (cmd) {
@@ -856,7 +856,7 @@ static int rtl8150_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
 	int res;
 
 	dev = netdev->priv;
-	data = (u16 *) & rq->ifr_data;
+	data = (u16 *) & rq->ifr_ifru;
 	res = 0;
 
 	switch (cmd) {
@@ -977,13 +977,13 @@ static void rtl8150_disconnect(struct usb_interface *intf)
 	}
 }
 
-int __init usb_rtl8150_init(void)
+static int __init usb_rtl8150_init(void)
 {
 	info(DRIVER_DESC " " DRIVER_VERSION);
 	return usb_register(&rtl8150_driver);
 }
 
-void __exit usb_rtl8150_exit(void)
+static void __exit usb_rtl8150_exit(void)
 {
 	usb_deregister(&rtl8150_driver);
 }
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index 58b3cf131..557edde67 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -107,7 +107,13 @@
  *
  *-------------------------------------------------------------------------*/
 
+// #define	DEBUG			// error path messages, extra info
+// #define	VERBOSE			// more; success messages
+
 #include <linux/config.h>
+#ifdef	CONFIG_USB_DEBUG
+#   define DEBUG
+#endif
 #include <linux/module.h>
 #include <linux/kmod.h>
 #include <linux/sched.h>
@@ -120,25 +126,15 @@
 #include <linux/mii.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
-
-
-// #define	DEBUG			// error path messages, extra info
-// #define	VERBOSE			// more; success messages
-#define	REALLY_QUEUE
-
-#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
-#   define DEBUG
-#endif
 #include <linux/usb.h>
-
 #include <asm/io.h>
 #include <asm/scatterlist.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
 
-
 #define DRIVER_VERSION		"25-Aug-2003"
 
+
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -148,13 +144,8 @@
  * For high speed, each frame comfortably fits almost 36 max size
  * Ethernet packets (so queues should be bigger).
  */
-#ifdef REALLY_QUEUE
 #define	RX_QLEN(dev) (((dev)->udev->speed == USB_SPEED_HIGH) ? 60 : 4)
 #define	TX_QLEN(dev) (((dev)->udev->speed == USB_SPEED_HIGH) ? 60 : 4)
-#else
-#define	RX_QLEN(dev)		1
-#define	TX_QLEN(dev)		1
-#endif
 
 // packets are always ethernet inside
 // ... except they can be bigger (limit of 64K with NetChip framing)
@@ -606,7 +597,7 @@ static void ax8817x_mdio_write(struct net_device *netdev, int phy_id, int loc, i
 	ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf);
 }
 
-void ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
+static void ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
 {
 	struct usbnet *dev = (struct usbnet *)net->priv;
 	u8 opt;
@@ -626,7 +617,7 @@ void ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
 	}
 }
 
-int ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
+static int ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
 {
 	struct usbnet *dev = (struct usbnet *)net->priv;
 	u8 opt = 0;
@@ -646,8 +637,8 @@ int ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
 	return 0;
 }
 
-int ax8817x_get_eeprom(struct net_device *net, 
-		       struct ethtool_eeprom *eeprom, u8 *data)
+static int ax8817x_get_eeprom(struct net_device *net,
+			      struct ethtool_eeprom *eeprom, u8 *data)
 {
 	struct usbnet *dev = (struct usbnet *)net->priv;
 	u16 *ebuf = (u16 *)data;
@@ -729,7 +720,7 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
 					(gpio_bits >> (i * 8)) & 0xff, 0, 0,
 					buf)) < 0)
 			return ret;
-		wait_ms(5);
+		msleep(5);
 	}
 
 	if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x80, 0, 0, buf)) < 0) {
@@ -928,8 +919,8 @@ static struct usb_driver usbnet_driver;
  */
 static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf)
 {
-	u8				*buf = intf->altsetting->extra;
-	int				len = intf->altsetting->extralen;
+	u8				*buf = intf->cur_altsetting->extra;
+	int				len = intf->cur_altsetting->extralen;
 	struct usb_interface_descriptor	*d;
 	struct cdc_state		*info = (void *) &dev->data;
 	int				status;
@@ -955,7 +946,7 @@ static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf)
 	/* this assumes that if there's a non-RNDIS vendor variant
 	 * of cdc-acm, it'll fail RNDIS requests cleanly.
 	 */
-	rndis = (intf->altsetting->desc.bInterfaceProtocol == 0xff);
+	rndis = (intf->cur_altsetting->desc.bInterfaceProtocol == 0xff);
 
 	memset (info, 0, sizeof *info);
 	info->control = intf;
@@ -1006,7 +997,7 @@ static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf)
 			if (!info->control || !info->data) {
 				dev_dbg (&intf->dev,
 					"master #%u/%p slave #%u/%p\n",
-					info->u->bMasterInterface0
+					info->u->bMasterInterface0,
 					info->control,
 					info->u->bSlaveInterface0,
 					info->data);
@@ -1025,7 +1016,7 @@ static int generic_cdc_bind (struct usbnet *dev, struct usb_interface *intf)
 			}
 
 			/* a data interface altsetting does the real i/o */
-			d = &info->data->altsetting->desc;
+			d = &info->data->cur_altsetting->desc;
 			if (d->bInterfaceClass != USB_CLASS_CDC_DATA) {
 				dev_dbg (&intf->dev, "slave class %u\n",
 					d->bInterfaceClass);
@@ -1142,10 +1133,13 @@ get_ethernet_addr (struct usbnet *dev, struct ether_desc *e)
 	unsigned char	buf [13];
 
 	tmp = usb_string (dev->udev, e->iMACAddress, buf, sizeof buf);
-	if (tmp < 0)
+	if (tmp != 12) {
+		dev_dbg (&dev->udev->dev,
+			"bad MAC string %d fetch, %d\n", e->iMACAddress, tmp);
+		if (tmp >= 0)
+			tmp = -EINVAL;
 		return tmp;
-	else if (tmp != 12)
-		return -EINVAL;
+	}
 	for (i = tmp = 0; i < 6; i++, tmp += 2)
 		dev->net->dev_addr [i] =
 			 (nibble (buf [tmp]) << 4) + nibble (buf [tmp + 1]);
@@ -2674,9 +2668,7 @@ static int usbnet_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
 	struct usbnet *dev = (struct usbnet *)net->priv;
 
 	if (dev->mii.mdio_read != NULL && dev->mii.mdio_write != NULL)
-		return generic_mii_ioctl(&dev->mii,
-				(struct mii_ioctl_data *) &rq->ifr_data,
-				cmd, NULL);
+		return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
 	}
 #endif
 	return -EOPNOTSUPP;
@@ -3014,7 +3006,7 @@ static struct ethtool_ops usbnet_ethtool_ops;
 
 // precondition: never called in_interrupt
 
-int
+static int
 usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 {
 	struct usbnet			*dev;
@@ -3204,6 +3196,10 @@ static const struct usb_device_id	products [] = {
 	// Hawking UF200, TrendNet TU2-ET100
 	USB_DEVICE (0x07b8, 0x420a),
 	.driver_info =  (unsigned long) &hawking_uf200_info,
+}, {
+        // Billionton Systems, USB2AR 
+        USB_DEVICE (0x08dd, 0x90ff),
+        .driver_info =  (unsigned long) &ax8817x_info,
 }, {
 	// ATEN UC210T
 	USB_DEVICE (0x0557, 0x2009),
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 6cf317c7d..46c0ebfb5 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -314,8 +314,8 @@ config USB_SERIAL_KLSI
 	  module will be called kl5kusb105.
 
 config USB_SERIAL_KOBIL_SCT
-        tristate "USB KOBIL chipcard reader (EXPERIMENTAL)"
-        depends on USB_SERIAL && EXPERIMENTAL
+        tristate "USB KOBIL chipcard reader"
+        depends on USB_SERIAL
         ---help---
           Say Y here if you want to use one of the following KOBIL USB chipcard
           readers:
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 4592d7a57..ad222ecc4 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -244,23 +244,12 @@ exit:
 
 static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial *serial;
-
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-
 	dbg("%s port %d", __FUNCTION__, port->number);
 
-	if (serial->dev) {
-		/* shutdown our bulk reads and writes */
-		usb_unlink_urb (port->write_urb);
-		usb_unlink_urb (port->read_urb);
-		usb_unlink_urb (port->interrupt_in_urb);
-	}
+	/* shutdown our bulk reads and writes */
+	usb_unlink_urb (port->write_urb);
+	usb_unlink_urb (port->read_urb);
+	usb_unlink_urb (port->interrupt_in_urb);
 } /* belkin_sa_close */
 
 
@@ -268,7 +257,6 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 	struct belkin_sa_private *priv;
-	struct usb_serial *serial;
 	unsigned char *data = urb->transfer_buffer;
 	int retval;
 	unsigned long flags;
@@ -288,14 +276,6 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
 		goto exit;
 	}
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
-	serial = port->serial;
-
-	if (serial_paranoia_check (serial, __FUNCTION__))
-		return;
-	
 	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
 
 	/* Handle known interrupt data */
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 977da0680..237d9d30d 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -137,7 +137,7 @@ static int __init usb_console_setup(struct console *co, char *options)
 
 	/* grab the first serial port that happens to be connected */
 	serial = usb_serial_get_by_index(0);
-	if (serial_paranoia_check (serial, __FUNCTION__)) {
+	if (serial == NULL) {
 		/* no device is connected yet, sorry :( */
 		err ("No USB device connected to ttyUSB0");
 		return -ENODEV;
@@ -199,11 +199,12 @@ static void usb_console_write(struct console *co, const char *buf, unsigned coun
 {
 	static struct usbcons_info *info = &usbcons_info;
 	struct usb_serial_port *port = info->port;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
+	struct usb_serial *serial;
 	int retval = -ENODEV;
 
-	if (!serial || !port)
+	if (!port)
 		return;
+	serial = port->serial;
 
 	if (count == 0)
 		return;
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 20198f105..9ca40acd3 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -109,7 +109,7 @@ struct cyberjack_private {
 	short		rdtodo;		/* Bytes still to read */
 	unsigned char	wrbuf[5*64];	/* Buffer for collecting data to write */
 	short		wrfilled;	/* Overall data size we already got */
-	short		wrsent;		/* Data akready sent */
+	short		wrsent;		/* Data already sent */
 };
 
 /* do some startup allocations not currently performed by usb_serial_probe() */
@@ -155,15 +155,10 @@ static int  cyberjack_open (struct usb_serial_port *port, struct file *filp)
 	unsigned long flags;
 	int result = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	dbg("%s - usb_clear_halt", __FUNCTION__ );
 	usb_clear_halt(port->serial->dev, port->write_urb->pipe);
-	usb_clear_halt(port->serial->dev, port->read_urb->pipe);
-	usb_clear_halt(port->serial->dev, port->interrupt_in_urb->pipe);
 
 	/* force low_latency on so that our tty_push actually forces
 	 * the data through, otherwise it is scheduled, and with high
@@ -215,7 +210,6 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
 	unsigned long flags;
 	int result;
 	int wrexpected;
-	unsigned char localbuf[CYBERJACK_LOCAL_BUF_SIZE];	/* Buffer for collecting data to write */
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	dbg("%s - from_user %d", __FUNCTION__, from_user);
@@ -232,29 +226,23 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	if( (count+priv->wrfilled)>sizeof(priv->wrbuf) ||
-		(count>sizeof(localbuf)) ) {
-		/* To much data  for buffer. Reset buffer. */
+	if( (count+priv->wrfilled)>sizeof(priv->wrbuf) ) {
+		/* To much data for buffer. Reset buffer. */
 		priv->wrfilled=0;
 		spin_unlock_irqrestore(&priv->lock, flags);
 		return (0);
 	}
 
-	spin_unlock_irqrestore(&priv->lock, flags);
-
 	/* Copy data */
 	if (from_user) {
-		if (copy_from_user(localbuf, buf, count)) {
+		if (copy_from_user(priv->wrbuf+priv->wrfilled, buf, count)) {
+			spin_unlock_irqrestore(&priv->lock, flags);
 			return -EFAULT;
 		}
 	} else {
-		memcpy (localbuf, buf, count);
+		memcpy (priv->wrbuf+priv->wrfilled, buf, count);
 	}  
 
-	spin_lock_irqsave(&priv->lock, flags);
-
-	memcpy (priv->wrbuf+priv->wrfilled, localbuf, count);
-
 	usb_serial_debug_data (__FILE__, __FUNCTION__, count,
 		priv->wrbuf+priv->wrfilled);
 	priv->wrfilled += count;
@@ -321,23 +309,15 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 	struct cyberjack_private *priv = usb_get_serial_port_data(port);
-	struct usb_serial *serial;
 	unsigned char *data = urb->transfer_buffer;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	/* the urb might have been killed. */
 	if (urb->status)
 		return;
 
-	serial = port->serial;
-	if (serial_paranoia_check (serial, __FUNCTION__))
-		return;
-
 	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
 
 	/* React only to interrupts signaling a bulk_in transfer */
@@ -386,7 +366,6 @@ static void cyberjack_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 	struct cyberjack_private *priv = usb_get_serial_port_data(port);
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
 	short todo;
@@ -395,11 +374,6 @@ static void cyberjack_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
@@ -447,15 +421,9 @@ static void cyberjack_write_bulk_callback (struct urb *urb, struct pt_regs *regs
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 	struct cyberjack_private *priv = usb_get_serial_port_data(port);
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -483,11 +451,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb, struct pt_regs *regs
 		priv->wrsent+=length;
 
 		/* set up our urb */
-		usb_fill_bulk_urb(port->write_urb, serial->dev, 
-			      usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
+		usb_fill_bulk_urb(port->write_urb, port->serial->dev, 
+			      usb_sndbulkpipe(port->serial->dev, port->bulk_out_endpointAddress),
 			      port->write_urb->transfer_buffer, length,
-			      ((serial->type->write_bulk_callback) ? 
-			       serial->type->write_bulk_callback : 
+			      ((port->serial->type->write_bulk_callback) ? 
+			       port->serial->type->write_bulk_callback : 
 			       cyberjack_write_bulk_callback), 
 			      port);
 
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 29a8140e4..3c123be55 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1396,11 +1396,6 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
 		return;
 	}
 
-	/* further sanity checks */
-	if( port_paranoia_check( port, __FUNCTION__ )
-	|| serial_paranoia_check( serial, __FUNCTION__ ) )
-		return;
-
 	/* try to send any buffered data on this port, if it is open */
 	spin_lock( &priv->dp_port_lock );
 	priv->dp_write_urb_in_use = 0;
@@ -1798,7 +1793,6 @@ dbg( "digi_read_bulk_callback: TOP" );
 		return;
 	}
 	if( port->serial == NULL
-	|| serial_paranoia_check( port->serial, __FUNCTION__ )
 	|| (serial_priv=usb_get_serial_data(port->serial)) == NULL ) {
 		err("%s: serial is bad or serial->private is NULL, status=%d", __FUNCTION__, urb->status );
 		return;
@@ -1851,11 +1845,6 @@ static int digi_read_inb_callback( struct urb *urb )
 	unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
 	int flag,throttled;
 
-
-	/* sanity check */
-	if( port_paranoia_check( port, __FUNCTION__ ) )
-		return( -1 );
-
 	/* do not process callbacks on closed ports */
 	/* but do continue the read chain */
 	if( port->open_count == 0 )
@@ -1980,9 +1969,8 @@ opcode, line, status, val );
 
 		port = serial->port[line];
 
-		if( port_paranoia_check( port, __FUNCTION__ )
-		|| (priv=usb_get_serial_port_data(port)) == NULL )
-			return( -1 );
+		if ((priv=usb_get_serial_port_data(port)) == NULL )
+			return -1;
 
 		if( opcode == DIGI_CMD_READ_INPUT_SIGNALS ) {
 
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 9af8f5ca9..677b31fc5 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -157,9 +157,6 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
 	struct usb_serial *serial = port->serial;
 	int result = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	/* Force default termio settings */
@@ -190,21 +187,10 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
 
 static void empeg_close (struct usb_serial_port *port, struct file * filp)
 {
-	struct usb_serial *serial;
-
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-
-	if (serial->dev) {
-		/* shutdown our bulk read */
-		usb_unlink_urb (port->read_urb);
-	}
+	/* shutdown our bulk read */
+	usb_unlink_urb (port->read_urb);
 	/* Uncomment the following line if you want to see some statistics in your syslog */
 	/* dev_info (&port->dev, "Bytes In = %d  Bytes Out = %d\n", bytes_in, bytes_out); */
 }
@@ -353,9 +339,6 @@ static void empeg_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	if (urb->status) {
@@ -370,22 +353,13 @@ static void empeg_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
 	int i;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -416,8 +390,8 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	/* Continue trying to always read  */
 	usb_fill_bulk_urb(
 		port->read_urb,
-		serial->dev, 
-		usb_rcvbulkpipe(serial->dev,
+		port->serial->dev, 
+		usb_rcvbulkpipe(port->serial->dev,
 			port->bulk_in_endpointAddress),
 		port->read_urb->transfer_buffer,
 		port->read_urb->transfer_buffer_length,
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index d9949deda..c15f3e57c 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -17,6 +17,9 @@
  * See http://ftdi-usb-sio.sourceforge.net for upto date testing info
  *	and extra documentation
  *
+ * (27/May/2004) Ian Abbott
+ *      Improved throttling code, mostly stolen from the WhiteHEAT driver.
+ *
  * (26/Mar/2004) Jan Capek
  *      Added PID's for ICD-U20/ICD-U40 - incircuit PIC debuggers from CCS Inc.
  *
@@ -584,6 +587,10 @@ static struct usb_driver ftdi_driver = {
 #define BUFSZ 512
 #define PKTSZ 64
 
+/* rx_flags */
+#define THROTTLED		0x01
+#define ACTUALLY_THROTTLED	0x02
+
 struct ftdi_private {
 	ftdi_chip_type_t chip_type;
 				/* type of the device, either SIO or FT8U232AM */
@@ -598,6 +605,8 @@ struct ftdi_private {
 	unsigned long last_dtr_rts;	/* saved modem control outputs */
         wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
  	char prev_status, diff_status;        /* Used for TIOCMIWAIT */
+	__u8 rx_flags;		/* receive state flags (throttling) */
+	spinlock_t rx_lock;	/* spinlock for receive state */
 
 	int force_baud;		/* if non-zero, force the baud rate to this value */
 	int force_rtscts;	/* if non-zero, force RTS-CTS to always be enabled */
@@ -625,6 +634,7 @@ static int  ftdi_write_room		(struct usb_serial_port *port);
 static int  ftdi_chars_in_buffer	(struct usb_serial_port *port);
 static void ftdi_write_bulk_callback	(struct urb *urb, struct pt_regs *regs);
 static void ftdi_read_bulk_callback	(struct urb *urb, struct pt_regs *regs);
+static void ftdi_process_read		(struct usb_serial_port *port);
 static void ftdi_set_termios		(struct usb_serial_port *port, struct termios * old);
 static int  ftdi_tiocmget               (struct usb_serial_port *port, struct file *file);
 static int  ftdi_tiocmset		(struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear);
@@ -1110,6 +1120,7 @@ static int ftdi_common_startup (struct usb_serial *serial)
 	}
 	memset(priv, 0, sizeof(*priv));
 
+	spin_lock_init(&priv->rx_lock);
         init_waitqueue_head(&priv->delta_msr_wait);
 	/* This will push the characters through immediately rather
 	   than queue a task to deliver them */
@@ -1273,8 +1284,8 @@ static void ftdi_shutdown (struct usb_serial *serial)
 	 */
 
 	if (priv) {
-		kfree(priv);
 		usb_set_serial_port_data(port, NULL);
+		kfree(priv);
 	}
 } /* ftdi_shutdown */
 
@@ -1282,8 +1293,9 @@ static void ftdi_shutdown (struct usb_serial *serial)
 static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
 { /* ftdi_open */
 	struct termios tmp_termios;
-	struct usb_serial *serial = port->serial;
+	struct usb_device *dev = port->serial->dev;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
+	unsigned long flags;
 	
 	int result = 0;
 	char buf[1]; /* Needed for the usb_control_msg I think */
@@ -1295,7 +1307,7 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
 
 	/* No error checking for this (will get errors later anyway) */
 	/* See ftdi_sio.h for description of what is reset */
-	usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+	usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 			FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, 
 			FTDI_SIO_RESET_SIO, 
 			0, buf, 0, WDR_TIMEOUT);
@@ -1317,9 +1329,14 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
 		err("%s Error from RTS HIGH urb", __FUNCTION__);
 	}
 
+	/* Not throttled */
+	spin_lock_irqsave(&priv->rx_lock, flags);
+	priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED);
+	spin_unlock_irqrestore(&priv->rx_lock, flags);
+
 	/* Start reading from the device */
-	usb_fill_bulk_urb(port->read_urb, serial->dev, 
-		      usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+	usb_fill_bulk_urb(port->read_urb, dev,
+		      usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress),
 		      port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
 		      ftdi_read_bulk_callback, port);
 	result = usb_submit_urb(port->read_urb, GFP_KERNEL);
@@ -1342,47 +1359,42 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
 
 static void ftdi_close (struct usb_serial_port *port, struct file *filp)
 { /* ftdi_close */
-	struct usb_serial *serial;
 	unsigned int c_cflag = port->tty->termios->c_cflag;
 	char buf[1];
 
 	dbg("%s", __FUNCTION__);
 
-	serial = get_usb_serial ( port, __FUNCTION__);
-	if (!serial)
-		return;
-
-	if (serial->dev) {
-		if (c_cflag & HUPCL){
-			/* Disable flow control */
-			if (usb_control_msg(serial->dev, 
-					    usb_sndctrlpipe(serial->dev, 0),
-					    FTDI_SIO_SET_FLOW_CTRL_REQUEST,
-					    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
-					    0, 0, buf, 0, WDR_TIMEOUT) < 0) {
-				err("error from flowcontrol urb");
-			}	    
+	if (c_cflag & HUPCL){
+		/* Disable flow control */
+		if (usb_control_msg(port->serial->dev, 
+				    usb_sndctrlpipe(port->serial->dev, 0),
+				    FTDI_SIO_SET_FLOW_CTRL_REQUEST,
+				    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
+				    0, 0, buf, 0, WDR_TIMEOUT) < 0) {
+			err("error from flowcontrol urb");
+		}	    
 
-			/* drop DTR */
-			if (set_dtr(port, LOW) < 0){
-				err("Error from DTR LOW urb");
-			}
-			/* drop RTS */
-			if (set_rts(port, LOW) < 0) {
-				err("Error from RTS LOW urb");
-			}
-		} /* Note change no line if hupcl is off */
-		
-		/* shutdown our bulk read */
-		if (port->read_urb) {
-			if (usb_unlink_urb (port->read_urb) < 0) {
-				err("Error unlinking read urb");
-			}
+		/* drop DTR */
+		if (set_dtr(port, LOW) < 0){
+			err("Error from DTR LOW urb");
 		}
-
-	} /* if (serial->dev) */
-
-
+		/* drop RTS */
+		if (set_rts(port, LOW) < 0) {
+			err("Error from RTS LOW urb");
+		}
+	} /* Note change no line if hupcl is off */
+	
+	/* shutdown our bulk read */
+	if (port->read_urb) {
+		if (usb_unlink_urb (port->read_urb) < 0) {
+			/* Generally, this isn't an error.  If the previous
+			   read bulk callback occurred (or is about to occur)
+			   while the port was being closed or was throtted
+			   (and is still throttled), the read urb will not
+			   have been submitted. */
+			dbg("%s - failed to unlink read urb (generally not an error)", __FUNCTION__);
+		}
+	}
 } /* ftdi_close */
 
 
@@ -1397,7 +1409,6 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
 static int ftdi_write (struct usb_serial_port *port, int from_user,
 			   const unsigned char *buf, int count)
 { /* ftdi_write */
-	struct usb_serial *serial = get_usb_serial ( port, __FUNCTION__);
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	struct urb *urb;
 	unsigned char *buffer;
@@ -1484,8 +1495,8 @@ static int ftdi_write (struct usb_serial_port *port, int from_user,
 	usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, buffer);
 
 	/* fill the buffer and send it */
-	usb_fill_bulk_urb(urb, serial->dev, 
-		      usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
+	usb_fill_bulk_urb(urb, port->serial->dev, 
+		      usb_sndbulkpipe(port->serial->dev, port->bulk_out_endpointAddress),
 		      buffer, transfer_size,
 		      ftdi_write_bulk_callback, port);
 
@@ -1513,9 +1524,6 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	/* free up the transfer buffer, as usb_free_urb() does not do this */
 	kfree (urb->transfer_buffer);
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
 	if (urb->status) {
@@ -1558,16 +1566,8 @@ static int ftdi_chars_in_buffer (struct usb_serial_port *port)
 static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 { /* ftdi_read_bulk_callback */
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial;
 	struct tty_struct *tty;
 	struct ftdi_private *priv;
-	char error_flag;
-       	unsigned char *data = urb->transfer_buffer;
-
-	int i;
-	int result;
-	int need_flip;
-	int packet_offset;
 
 	if (urb->number_of_packets > 0) {
 		err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__,
@@ -1575,20 +1575,11 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		err("%s transfer_flags %x ", __FUNCTION__,urb->transfer_flags );
 	}
 
-	dbg("%s", __FUNCTION__);
+	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (port_paranoia_check (port, __FUNCTION__)) {
-		return;
-	}
 	if (port->open_count <= 0)
 		return;
 
-	serial = get_usb_serial(port,__FUNCTION__);
-	if (!serial){
-		dbg("%s - bad serial pointer - exiting",__FUNCTION__);
-		return;
-	}
-	
 	tty = port->tty;
 	if (!tty) {
 		dbg("%s - bad tty pointer - exiting",__FUNCTION__);
@@ -1596,6 +1587,14 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	}
 
 	priv = usb_get_serial_port_data(port);
+	if (!priv) {
+		dbg("%s - bad port private data pointer - exiting", __FUNCTION__);
+		return;
+	}
+
+	if (urb != port->read_urb) {
+		err("%s - Not my urb!", __FUNCTION__);
+	}
 
 	if (urb->status) {
 		/* This will happen at close every time so it is a dbg not an err */
@@ -1603,6 +1602,59 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
+	/* If throttled, delay receive processing until unthrottled. */
+	spin_lock(&priv->rx_lock);
+	if (priv->rx_flags & THROTTLED) {
+		dbg("Deferring read urb processing until unthrottled");
+		priv->rx_flags |= ACTUALLY_THROTTLED;
+		spin_unlock(&priv->rx_lock);
+		return;
+	}
+	spin_unlock(&priv->rx_lock);
+
+	ftdi_process_read(port);
+
+} /* ftdi_read_bulk_callback */
+
+
+static void ftdi_process_read (struct usb_serial_port *port)
+{ /* ftdi_process_read */
+	struct urb *urb;
+	struct tty_struct *tty;
+	struct ftdi_private *priv;
+	char error_flag;
+       	unsigned char *data;
+
+	int i;
+	int result;
+	int need_flip;
+	int packet_offset;
+
+	dbg("%s - port %d", __FUNCTION__, port->number);
+
+	if (port->open_count <= 0)
+		return;
+
+	tty = port->tty;
+	if (!tty) {
+		dbg("%s - bad tty pointer - exiting",__FUNCTION__);
+		return;
+	}
+
+	priv = usb_get_serial_port_data(port);
+	if (!priv) {
+		dbg("%s - bad port private data pointer - exiting", __FUNCTION__);
+		return;
+	}
+
+	urb = port->read_urb;
+	if (!urb) {
+		dbg("%s - bad read_urb pointer - exiting", __FUNCTION__);
+		return;
+	}
+
+	data = urb->transfer_buffer;
+
         /* The first two bytes of every read packet are status */
 	if (urb->actual_length > 2) {
 		usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
@@ -1696,8 +1748,8 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	/* if the port is closed stop trying to read */
 	if (port->open_count > 0){
 		/* Continue trying to always read  */
-		usb_fill_bulk_urb(port->read_urb, serial->dev, 
-			      usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+		usb_fill_bulk_urb(port->read_urb, port->serial->dev, 
+			      usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
 			      port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
 			      ftdi_read_bulk_callback, port);
 
@@ -1707,12 +1759,11 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	}
 
 	return;
-} /* ftdi_read_bulk_callback */
+} /* ftdi_process_read */
 
 
 static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
 {
-	struct usb_serial *serial = port->serial;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	__u16 urb_value = 0; 
 	char buf[1];
@@ -1728,7 +1779,7 @@ static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
 	}
 
 	
-	if (usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+	if (usb_control_msg(port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0),
 			    FTDI_SIO_SET_DATA_REQUEST, 
 			    FTDI_SIO_SET_DATA_REQUEST_TYPE,
 			    urb_value , 0,
@@ -1748,7 +1799,7 @@ static void ftdi_break_ctl( struct usb_serial_port *port, int break_state )
 
 static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_termios)
 { /* ftdi_termios */
-	struct usb_serial *serial = port->serial;
+	struct usb_device *dev = port->serial->dev;
 	unsigned int cflag = port->tty->termios->c_cflag;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	__u16 urb_value; /* will hold the new flags */
@@ -1807,7 +1858,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 	 *  or'ed with this value  */
 	priv->last_set_data_urb_value = urb_value;
 	
-	if (usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+	if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 			    FTDI_SIO_SET_DATA_REQUEST, 
 			    FTDI_SIO_SET_DATA_REQUEST_TYPE,
 			    urb_value , 0,
@@ -1818,7 +1869,7 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 	/* Now do the baudrate */
 	if ((cflag & CBAUD) == B0 ) {
 		/* Disable flow control */
-		if (usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+		if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 				    FTDI_SIO_SET_FLOW_CTRL_REQUEST, 
 				    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
 				    0, 0, 
@@ -1844,8 +1895,8 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 	/* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
 	if (cflag & CRTSCTS) {
 		dbg("%s Setting to CRTSCTS flow control", __FUNCTION__);
-		if (usb_control_msg(serial->dev, 
-				    usb_sndctrlpipe(serial->dev, 0),
+		if (usb_control_msg(dev, 
+				    usb_sndctrlpipe(dev, 0),
 				    FTDI_SIO_SET_FLOW_CTRL_REQUEST, 
 				    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
 				    0 , FTDI_SIO_RTS_CTS_HS,
@@ -1870,8 +1921,8 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 			vstop=port->tty->termios->c_cc[VSTOP];
 			urb_value=(vstop << 8) | (vstart);
 
-			if (usb_control_msg(serial->dev,
-					    usb_sndctrlpipe(serial->dev, 0),
+			if (usb_control_msg(dev,
+					    usb_sndctrlpipe(dev, 0),
 					    FTDI_SIO_SET_FLOW_CTRL_REQUEST,
 					    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
 					    urb_value , FTDI_SIO_XON_XOFF_HS,
@@ -1882,8 +1933,8 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 			/* else clause to only run if cfag ! CRTSCTS and iflag ! XOFF */
 			/* CHECKME Assuming XON/XOFF handled by tty stack - not by device */
 			dbg("%s Turning off hardware flow control", __FUNCTION__);
-			if (usb_control_msg(serial->dev, 
-					    usb_sndctrlpipe(serial->dev, 0),
+			if (usb_control_msg(dev, 
+					    usb_sndctrlpipe(dev, 0),
 					    FTDI_SIO_SET_FLOW_CTRL_REQUEST, 
 					    FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
 					    0, 0, 
@@ -1899,7 +1950,6 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
 
 static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
 {
-	struct usb_serial *serial = port->serial;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	unsigned char buf[2];
 	int ret;
@@ -1908,8 +1958,8 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
 	switch (priv->chip_type) {
 	case SIO:
 		/* Request the status from the device */
-		if ((ret = usb_control_msg(serial->dev, 
-					   usb_rcvctrlpipe(serial->dev, 0),
+		if ((ret = usb_control_msg(port->serial->dev, 
+					   usb_rcvctrlpipe(port->serial->dev, 0),
 					   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
 					   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
 					   0, 0, 
@@ -1923,8 +1973,8 @@ static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
 	case FT232BM:
 		/* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same
 		   format as the data returned from the in point */
-		if ((ret = usb_control_msg(serial->dev, 
-					   usb_rcvctrlpipe(serial->dev, 0),
+		if ((ret = usb_control_msg(port->serial->dev, 
+					   usb_rcvctrlpipe(port->serial->dev, 0),
 					   FTDI_SIO_GET_MODEM_STATUS_REQUEST, 
 					   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
 					   0, 0, 
@@ -2099,28 +2149,32 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
 
 static void ftdi_throttle (struct usb_serial_port *port)
 {
+	struct ftdi_private *priv = usb_get_serial_port_data(port);
+	unsigned long flags;
+
 	dbg("%s - port %d", __FUNCTION__, port->number);
-	usb_unlink_urb (port->read_urb);
+
+	spin_lock_irqsave(&priv->rx_lock, flags);
+	priv->rx_flags |= THROTTLED;
+	spin_unlock_irqrestore(&priv->rx_lock, flags);
 }
 
 
 static void ftdi_unthrottle (struct usb_serial_port *port)
 {
-	int result;
-	struct usb_serial *serial = port->serial;
+	struct ftdi_private *priv = usb_get_serial_port_data(port);
+	int actually_throttled;
+	unsigned long flags;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	port->read_urb->dev = serial->dev;
+	spin_lock_irqsave(&priv->rx_lock, flags);
+	actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED;
+	priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED);
+	spin_unlock_irqrestore(&priv->rx_lock, flags);
 
-	usb_fill_bulk_urb(port->read_urb, serial->dev, 
-		      usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
-		      port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
-		      ftdi_read_bulk_callback, port);
-
-	result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-	if (result)
-		err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
+	if (actually_throttled)
+		ftdi_process_read(port);
 }
 
 static int __init ftdi_init (void)
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 118d509b0..37a53a16e 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -16,6 +16,7 @@
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/usb.h>
 #include <asm/uaccess.h>
 
@@ -32,10 +33,10 @@
 static __u16 vendor  = 0x05f9;
 static __u16 product = 0xffff;
 
-MODULE_PARM(vendor, "h");
+module_param(vendor, ushort, 0);
 MODULE_PARM_DESC(vendor, "User specified USB idVendor");
 
-MODULE_PARM(product, "h");
+module_param(product, ushort, 0);
 MODULE_PARM_DESC(product, "User specified USB idProduct");
 
 static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
@@ -83,9 +84,6 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
 	struct usb_serial *serial = port->serial;
 	int result = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	/* force low_latency on so that our tty_push actually forces the data through, 
@@ -223,7 +221,7 @@ int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port)
 void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
+	struct usb_serial *serial = port->serial;
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
 	int i;
@@ -231,11 +229,6 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -273,15 +266,9 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
 void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 		return;
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index eddcfd519..5b2249bc9 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -776,10 +776,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s", __FUNCTION__);
 
-	if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) {
-		return;
-	}
-
 	switch (urb->status) {
 	case 0:
 		/* success */
@@ -825,19 +821,17 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
 			txCredits = data[position] | (data[position+1] << 8);
 			if (txCredits) {
 				port = edge_serial->serial->port[portNumber];
-				if (port_paranoia_check (port, __FUNCTION__) == 0) {
-					edge_port = usb_get_serial_port_data(port);
-					if (edge_port->open) {
-						edge_port->txCredits += txCredits;
-						dbg("%s - txcredits for port%d = %d", __FUNCTION__, portNumber, edge_port->txCredits);
+				edge_port = usb_get_serial_port_data(port);
+				if (edge_port->open) {
+					edge_port->txCredits += txCredits;
+					dbg("%s - txcredits for port%d = %d", __FUNCTION__, portNumber, edge_port->txCredits);
 
-						/* tell the tty driver that something has changed */
-						if (edge_port->port->tty)
-							wake_up_interruptible(&edge_port->port->tty->write_wait);
+					/* tell the tty driver that something has changed */
+					if (edge_port->port->tty)
+						wake_up_interruptible(&edge_port->port->tty->write_wait);
 
-						// Since we have more credit, check if more data can be sent
-						send_more_port_data(edge_serial, edge_port);
-					}
+					// Since we have more credit, check if more data can be sent
+					send_more_port_data(edge_serial, edge_port);
 				}
 			}
 			position += 2;
@@ -867,10 +861,6 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s", __FUNCTION__);
 
-	if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) {
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -916,10 +906,6 @@ static void edge_bulk_out_data_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s", __FUNCTION__);
 
-	if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 	}
@@ -969,10 +955,6 @@ static void edge_bulk_out_cmd_callback (struct urb *urb, struct pt_regs *regs)
 	/* Free the command urb */
 	usb_free_urb (urb);
 
-	if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
-		return;
-	}
-
 	if (status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, status);
 		return;
@@ -1009,9 +991,6 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
 	int response;
 	int timeout;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	if (edge_port == NULL)
@@ -1240,55 +1219,45 @@ static void block_until_tx_empty (struct edgeport_port *edge_port)
  *****************************************************************************/
 static void edge_close (struct usb_serial_port *port, struct file * filp)
 {
-	struct usb_serial *serial;
 	struct edgeport_serial *edge_serial;
 	struct edgeport_port *edge_port;
 	int status;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 			 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-	
-	edge_serial = usb_get_serial_data(serial);
+	edge_serial = usb_get_serial_data(port->serial);
 	edge_port = usb_get_serial_port_data(port);
 	if ((edge_serial == NULL) || (edge_port == NULL))
 		return;
 	
-	if (serial->dev) {
-		// block until tx is empty
-		block_until_tx_empty(edge_port);
+	// block until tx is empty
+	block_until_tx_empty(edge_port);
 
-		edge_port->closePending = TRUE;
+	edge_port->closePending = TRUE;
 
-		/* flush and chase */
-		edge_port->chaseResponsePending = TRUE;
+	/* flush and chase */
+	edge_port->chaseResponsePending = TRUE;
 
-		dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__);
-		status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0);
-		if (status == 0) {
-			// block until chase finished
-			block_until_chase_response(edge_port);
-		} else {
-			edge_port->chaseResponsePending = FALSE;
-		}
+	dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__);
+	status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0);
+	if (status == 0) {
+		// block until chase finished
+		block_until_chase_response(edge_port);
+	} else {
+		edge_port->chaseResponsePending = FALSE;
+	}
 
-		/* close the port */
-		dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__);
-		send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0);
+	/* close the port */
+	dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__);
+	send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0);
 
-		//port->close = TRUE;
-		edge_port->closePending = FALSE;
-		edge_port->open = FALSE;
-		edge_port->openPending = FALSE;
+	//port->close = TRUE;
+	edge_port->closePending = FALSE;
+	edge_port->open = FALSE;
+	edge_port->openPending = FALSE;
 
-		if (edge_port->write_urb) {
-			usb_unlink_urb (edge_port->write_urb);
-		}
+	if (edge_port->write_urb) {
+		usb_unlink_urb (edge_port->write_urb);
 	}
 
 	if (edge_port->write_urb) {
@@ -2071,24 +2040,22 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
 				/* spit this data back into the tty driver if this port is open */
 				if (rxLen) {
 					port = edge_serial->serial->port[edge_serial->rxPort];
-					if (port_paranoia_check (port, __FUNCTION__) == 0) {
-        					edge_port = usb_get_serial_port_data(port);
-						if (edge_port->open) {
-							tty = edge_port->port->tty;
-							if (tty) {
-								dbg("%s - Sending %d bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort);
-								for (i = 0; i < rxLen ; ++i) {
-									/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
-									if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
-										tty_flip_buffer_push(tty);
-									}
-									/* this doesn't actually push the data through unless tty->low_latency is set */
-									tty_insert_flip_char(tty, buffer[i], 0);
+					edge_port = usb_get_serial_port_data(port);
+					if (edge_port->open) {
+						tty = edge_port->port->tty;
+						if (tty) {
+							dbg("%s - Sending %d bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort);
+							for (i = 0; i < rxLen ; ++i) {
+								/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
+								if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
+									tty_flip_buffer_push(tty);
 								}
-								tty_flip_buffer_push(tty);
+								/* this doesn't actually push the data through unless tty->low_latency is set */
+								tty_insert_flip_char(tty, buffer[i], 0);
 							}
-							edge_port->icount.rx += rxLen;
+							tty_flip_buffer_push(tty);
 						}
+						edge_port->icount.rx += rxLen;
 					}
 					buffer += rxLen;
 				}
@@ -2124,9 +2091,6 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
 
 	/* switch the port pointer to the one being currently talked about */
 	port = edge_serial->serial->port[edge_serial->rxPort];
-	if (port_paranoia_check (port, __FUNCTION__)) {
-		return;
-	}
         edge_port = usb_get_serial_port_data(port);
 	if (edge_port == NULL) {
 		dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort);
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 4c87da42a..853cf1700 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -279,8 +279,8 @@ static int TIPurgeDataSync (struct usb_serial_port *port, __u16 mask)
  * @address_type: Can read both XDATA and I2C
  * @buffer: pointer to input data buffer
  */
-int TIReadDownloadMemory (struct usb_device *dev, int start_address, int length,
-			  __u8 address_type, __u8 *buffer)
+static int TIReadDownloadMemory(struct usb_device *dev, int start_address,
+				int length, __u8 address_type, __u8 *buffer)
 {
 	int status = 0;
 	__u8 read_length;
@@ -328,7 +328,7 @@ int TIReadDownloadMemory (struct usb_device *dev, int start_address, int length,
 	return status;
 }
 
-int TIReadRam (struct usb_device *dev, int start_address, int length, __u8 *buffer)
+static int TIReadRam (struct usb_device *dev, int start_address, int length, __u8 *buffer)
 {
 	return TIReadDownloadMemory (dev,
 				     start_address,
@@ -552,7 +552,7 @@ restart_tx_loop:
 			break;
 
 		/* Block the thread for 10ms */
-		wait_ms (10);
+		msleep(10);
 
 		if (last_count == port->tx.count) {
 			/* No activity.. count down. */
@@ -581,7 +581,7 @@ restart_tx_loop:
 		/* This function takes 4 ms; */
 		if (!TIIsTxActive (port)) {
 			/* Delay a few char times */
-			wait_ms (50);
+			msleep(50);
 			dbg ("%s - Empty", __FUNCTION__);
 			return;
 		}
@@ -612,7 +612,7 @@ static int TIChooseConfiguration (struct usb_device *dev)
 	return 0;
 }
 
-int TIReadRom (struct edgeport_serial *serial, int start_address, int length, __u8 *buffer)
+static int TIReadRom (struct edgeport_serial *serial, int start_address, int length, __u8 *buffer)
 {
 	int status;
 
@@ -632,7 +632,7 @@ int TIReadRom (struct edgeport_serial *serial, int start_address, int length, __
 	return status;
 }
 
-int TIWriteRom (struct edgeport_serial *serial, int start_address, int length, __u8 *buffer)
+static int TIWriteRom (struct edgeport_serial *serial, int start_address, int length, __u8 *buffer)
 {
 	if (serial->product_info.TiMode == TI_MODE_BOOT)
 		return TIWriteBootMemory (serial,
@@ -995,7 +995,7 @@ static int TIDownloadFirmware (struct edgeport_serial *serial)
 	if (status)
 		return status;
 
-	interface = &serial->serial->dev->config->interface[0]->altsetting->desc;
+	interface = &serial->serial->interface->cur_altsetting->desc;
 	if (!interface) {
 		dev_err (&serial->serial->dev->dev, "%s - no interface set, error!", __FUNCTION__);
 		return -ENODEV;
@@ -1649,10 +1649,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s", __FUNCTION__);
 
-	if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) {
-		return;
-	}
-
 	switch (urb->status) {
 	case 0:
 		/* success */
@@ -1685,11 +1681,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
 	dbg ("%s - port_number %d, function %d, info 0x%x",
 	     __FUNCTION__, port_number, function, data[1]);
 	port = edge_serial->serial->port[port_number];
-	if (port_paranoia_check (port, __FUNCTION__)) {
-		dbg ("%s - change found for port that is not present",
-		     __FUNCTION__);
-		return;
-	}
 	edge_port = usb_get_serial_port_data(port);
 	if (!edge_port) {
 		dbg ("%s - edge_port not found", __FUNCTION__);
@@ -1744,9 +1735,6 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s", __FUNCTION__);
 
-	if (port_paranoia_check (edge_port->port, __FUNCTION__))
-		return;
-
 	if (urb->status) {
 		dbg ("%s - nonzero read bulk status received: %d",
 		     __FUNCTION__, urb->status);
@@ -1804,23 +1792,17 @@ exit:
 static void edge_bulk_out_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct tty_struct *tty;
 
 	dbg ("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg ("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg ("%s - nonzero write bulk status received: %d",
 		     __FUNCTION__, urb->status);
 
 		if (urb->status == -EPIPE) {
 			/* clear any problem that might have happened on this pipe */
-			usb_clear_halt (serial->dev, urb->pipe);
+			usb_clear_halt (port->serial->dev, urb->pipe);
 		}
 		return;
 	}
@@ -1848,9 +1830,6 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
 	u16 open_settings;
 	u8 transaction_timeout;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	if (edge_port == NULL)
@@ -1993,61 +1972,50 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
 
 static void edge_close (struct usb_serial_port *port, struct file * filp)
 {
-	struct usb_serial *serial;
 	struct edgeport_serial *edge_serial;
 	struct edgeport_port *edge_port;
 	int port_number;
 	int status;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 			 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-	
-	edge_serial = usb_get_serial_data(serial);
+	edge_serial = usb_get_serial_data(port->serial);
 	edge_port = usb_get_serial_port_data(port);
 	if ((edge_serial == NULL) || (edge_port == NULL))
 		return;
 	
-	if (serial->dev) {
-		/* The bulkreadcompletion routine will check 
-		 * this flag and dump add read data */
-		edge_port->close_pending = 1;
-
-		/* chase the port close */
-		TIChasePort (edge_port);
-
-		usb_unlink_urb (port->read_urb);
-
-		/* assuming we can still talk to the device,
-		 * send a close port command to it */
-		dbg("%s - send umpc_close_port", __FUNCTION__);
-		port_number = port->number - port->serial->minor;
-		status = TIWriteCommandSync (port->serial->dev,
-					     UMPC_CLOSE_PORT,
-					     (__u8)(UMPM_UART1_PORT + port_number),
-					     0,
-					     NULL,
-					     0);
-		--edge_port->edge_serial->num_ports_open;
-		if (edge_port->edge_serial->num_ports_open <= 0) {
-			/* last port is now closed, let's shut down our interrupt urb */
-			usb_unlink_urb (serial->port[0]->interrupt_in_urb);
-			edge_port->edge_serial->num_ports_open = 0;
-		}
-	edge_port->close_pending = 0;
+	/* The bulkreadcompletion routine will check 
+	 * this flag and dump add read data */
+	edge_port->close_pending = 1;
+
+	/* chase the port close */
+	TIChasePort (edge_port);
+
+	usb_unlink_urb (port->read_urb);
+
+	/* assuming we can still talk to the device,
+	 * send a close port command to it */
+	dbg("%s - send umpc_close_port", __FUNCTION__);
+	port_number = port->number - port->serial->minor;
+	status = TIWriteCommandSync (port->serial->dev,
+				     UMPC_CLOSE_PORT,
+				     (__u8)(UMPM_UART1_PORT + port_number),
+				     0,
+				     NULL,
+				     0);
+	--edge_port->edge_serial->num_ports_open;
+	if (edge_port->edge_serial->num_ports_open <= 0) {
+		/* last port is now closed, let's shut down our interrupt urb */
+		usb_unlink_urb (port->serial->port[0]->interrupt_in_urb);
+		edge_port->edge_serial->num_ports_open = 0;
 	}
+	edge_port->close_pending = 0;
 
 	dbg("%s - exited", __FUNCTION__);
 }
 
 static int edge_write (struct usb_serial_port *port, int from_user, const unsigned char *data, int count)
 {
-	struct usb_serial *serial = port->serial;
 	struct edgeport_port *edge_port = usb_get_serial_port_data(port);
 	int result;
 
@@ -2080,8 +2048,8 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
 	usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
 
 	/* set up our urb */
-	usb_fill_bulk_urb (port->write_urb, serial->dev,
-			   usb_sndbulkpipe (serial->dev,
+	usb_fill_bulk_urb (port->write_urb, port->serial->dev,
+			   usb_sndbulkpipe (port->serial->dev,
 					    port->bulk_out_endpointAddress),
 			   port->write_urb->transfer_buffer, count,
 			   edge_bulk_out_callback,
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 3798e3ca5..0b7677283 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -150,7 +150,7 @@ static struct usb_driver ipaq_driver = {
 
 
 /* All of the device info needed for the Compaq iPAQ */
-struct usb_serial_device_type ipaq_device = {
+static struct usb_serial_device_type ipaq_device = {
 	.owner =		THIS_MODULE,
 	.name =			"PocketPC PDA",
 	.id_table =		ipaq_id_table,
@@ -181,10 +181,6 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
 	int			i, result = 0;
 	int			retries = KP_RETRIES;
 
-	if (port_paranoia_check(port, __FUNCTION__)) {
-		return -ENODEV;
-	}
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	bytes_in = 0;
@@ -288,23 +284,13 @@ error:
 
 static void ipaq_close(struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial	*serial;
 	struct ipaq_private	*priv = usb_get_serial_port_data(port);
 
-	if (port_paranoia_check(port, __FUNCTION__)) {
-		return; 
-	}
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 			 
-	serial = get_usb_serial(port, __FUNCTION__);
-	if (!serial)
-		return;
-
 	/*
 	 * shut down bulk read and write
 	 */
-
 	usb_unlink_urb(port->write_urb);
 	usb_unlink_urb(port->read_urb);
 	ipaq_destroy_lists(port);
@@ -318,21 +304,12 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp)
 static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port	*port = (struct usb_serial_port *)urb->context;
-	struct usb_serial	*serial = get_usb_serial (port, __FUNCTION__);
 	struct tty_struct	*tty;
 	unsigned char		*data = urb->transfer_buffer;
 	int			i, result;
 
-	if (port_paranoia_check(port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -355,8 +332,8 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
 	}
 
 	/* Continue trying to always read  */
-	usb_fill_bulk_urb(port->read_urb, serial->dev, 
-		      usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+	usb_fill_bulk_urb(port->read_urb, port->serial->dev, 
+		      usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
 		      port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
 		      ipaq_read_bulk_callback, port);
 	result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
@@ -488,10 +465,6 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
 	unsigned long		flags;
 	int			result;
 
-	if (port_paranoia_check (port, __FUNCTION__)) {
-		return;
-	}
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
 	if (urb->status) {
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index e2d0d67a3..0adcbb1f8 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -138,7 +138,7 @@ static struct usb_driver ir_driver = {
 };
 
 
-struct usb_serial_device_type ir_device = {
+static struct usb_serial_device_type ir_device = {
 	.owner =		THIS_MODULE,
 	.name =			"IR Dongle",
 	.id_table =		id_table,
@@ -279,13 +279,9 @@ static int ir_startup (struct usb_serial *serial)
 
 static int ir_open (struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial *serial = port->serial;
 	char *buffer;
 	int result = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	if (buffer_size) {
@@ -313,8 +309,8 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
 	/* Start reading from the device */
 	usb_fill_bulk_urb (
 		port->read_urb,
-		serial->dev, 
-		usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+		port->serial->dev, 
+		usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
 		port->read_urb->transfer_buffer,
 		port->read_urb->transfer_buffer_length,
 		ir_read_bulk_callback,
@@ -328,21 +324,10 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
 
 static void ir_close (struct usb_serial_port *port, struct file * filp)
 {
-	struct usb_serial *serial;
-
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 			 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-	
-	if (serial->dev) {
-		/* shutdown our bulk read */
-		usb_unlink_urb (port->read_urb);
-	}
+	/* shutdown our bulk read */
+	usb_unlink_urb (port->read_urb);
 }
 
 static int ir_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count)
@@ -411,9 +396,6 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
 	if (urb->status) {
@@ -433,21 +415,12 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (!port->open_count) {
 		dbg("%s - port closed.", __FUNCTION__);
 		return;
@@ -496,8 +469,8 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 			/* Continue trying to always read */
 			usb_fill_bulk_urb (
 				port->read_urb,
-				serial->dev, 
-				usb_rcvbulkpipe(serial->dev,
+				port->serial->dev, 
+				usb_rcvbulkpipe(port->serial->dev,
 					port->bulk_in_endpointAddress),
 				port->read_urb->transfer_buffer,
 				port->read_urb->transfer_buffer_length,
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index e96e7fd68..2f2abaeec 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -133,9 +133,6 @@
 
 	/* Per device and per port private data */
 struct keyspan_serial_private {
-	/* number of active ports */
-	atomic_t	active_count;
-
 	const struct keyspan_device_details	*device_details;
 
 	struct urb	*instat_urb;
@@ -1144,14 +1141,10 @@ static inline void stop_urb(struct urb *urb)
 static void keyspan_close(struct usb_serial_port *port, struct file *filp)
 {
 	int			i;
-	struct usb_serial	*serial;
+	struct usb_serial	*serial = port->serial;
 	struct keyspan_serial_private 	*s_priv;
 	struct keyspan_port_private 	*p_priv;
 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-
 	dbg("%s", __FUNCTION__);
 	s_priv = usb_get_serial_data(serial);
 	p_priv = usb_get_serial_port_data(port);
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
index e35371158..7b60835c4 100644
--- a/drivers/usb/serial/keyspan.h
+++ b/drivers/usb/serial/keyspan.h
@@ -326,6 +326,22 @@ static const struct keyspan_device_details usa19qi_device_details = {
 	.baudclk		= KEYSPAN_USA19_BAUDCLK,
 };
 
+static const struct keyspan_device_details mpr_device_details = {
+	.product_id		= keyspan_mpr_product_id,
+	.msg_format		= msg_usa28,
+	.num_ports		= 1,
+	.indat_endp_flip	= 1,
+	.outdat_endp_flip	= 1,
+	.indat_endpoints	= {0x81},
+	.outdat_endpoints	= {0x01},
+	.inack_endpoints	= {0x83},
+	.outcont_endpoints	= {0x03},
+	.instat_endpoint	= 0x84,
+	.glocont_endpoint	= -1,
+	.calculate_baud_rate	= keyspan_usa28_calc_baud,
+	.baudclk		= KEYSPAN_USA19_BAUDCLK,
+};
+
 static const struct keyspan_device_details usa19qw_device_details = {
 	.product_id		= keyspan_usa19qw_product_id,
 	.msg_format		= msg_usa26,
@@ -460,6 +476,7 @@ static const struct keyspan_device_details *keyspan_devices[] = {
 	&usa18x_device_details,
 	&usa19_device_details,
 	&usa19qi_device_details,
+	&mpr_device_details,
 	&usa19qw_device_details,
 	&usa19w_device_details,
 	&usa19hs_device_details,
@@ -535,7 +552,7 @@ static struct usb_device_id keyspan_1port_ids[] = {
 	{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) },
 	{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) },
 	{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) },
-	{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) },
+	{ USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) },
 	{ } /* Terminating entry */
 };
 
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 36d8e6a8f..5a349aee9 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -226,8 +226,7 @@ static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
 static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial;
-       	struct tty_struct *tty;
+       	struct tty_struct *tty = port->tty;
 	unsigned char *data = urb->transfer_buffer;
 	int i;
 	int status;
@@ -249,22 +248,11 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
 		goto exit;
 	}
 
-	
-	if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
-		return;
-	}
-
-	serial = port->serial;
-	if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
-		return;
-	}
-	
  	/* see if the message is data or a status interrupt */
 	switch (data[0]) {
 	case 0:
 		/* rest of message is rx data */
 		if (urb->actual_length) {
-			tty = serial->port[0]->tty;
 			for (i = 1; i < urb->actual_length ; ++i) {
 				tty_insert_flip_char(tty, data[i], 0);
 			}
@@ -278,7 +266,6 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
 		case 1: /* modemline change */
 			break;
 		case 2: /* tx unthrottle interrupt */
-			tty = serial->port[0]->tty;
 			priv->tx_throttled = 0;
 			/* queue up a wakeup at scheduler time */
 			schedule_work(&priv->wakeup_work);
@@ -633,20 +620,10 @@ exit:
 static void keyspan_pda_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial;
 	struct keyspan_pda_private *priv;
 
 	priv = usb_get_serial_port_data(port);
 
-	if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
-		return;
-	}
-
-	serial = port->serial;
-	if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
-		return;
-	}
-	
 	/* queue up a wakeup at scheduler time */
 	schedule_work(&priv->wakeup_work);
 }
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index cb52024bf..c9b5af2b8 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -187,12 +187,13 @@ struct klsi_105_private {
 
 #define KLSI_TIMEOUT	 (HZ * 5 ) /* default urb timeout */
 
-static int klsi_105_chg_port_settings(struct usb_serial *serial,
+static int klsi_105_chg_port_settings(struct usb_serial_port *port,
 				      struct klsi_105_port_settings *settings)
 {
 	int rc;
 
-        rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
+        rc = usb_control_msg(port->serial->dev,
+			     usb_sndctrlpipe(port->serial->dev, 0),
 			     KL5KUSB105A_SIO_SET_DATA,
                              USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_INTERFACE,
 			     0, /* value */
@@ -227,7 +228,7 @@ static unsigned long klsi_105_status2linestate(const __u16 status)
  */
 /* It seems that the status buffer has always only 2 bytes length */
 #define KLSI_STATUSBUF_LEN	2
-static int klsi_105_get_line_state(struct usb_serial *serial,
+static int klsi_105_get_line_state(struct usb_serial_port *port,
 				   unsigned long *line_state_p)
 {
 	int rc;
@@ -235,7 +236,8 @@ static int klsi_105_get_line_state(struct usb_serial *serial,
 	__u16 status;
 
 	info("%s - sending SIO Poll request", __FUNCTION__);
-        rc = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
+        rc = usb_control_msg(port->serial->dev,
+			     usb_rcvctrlpipe(port->serial->dev, 0),
 			     KL5KUSB105A_SIO_POLL,
                              USB_TYPE_VENDOR | USB_DIR_IN,
 			     0, /* value */
@@ -362,7 +364,6 @@ static void klsi_105_shutdown (struct usb_serial *serial)
 
 static int  klsi_105_open (struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial *serial = port->serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	int retval = 0;
 	int rc;
@@ -389,7 +390,7 @@ static int  klsi_105_open (struct usb_serial_port *port, struct file *filp)
 	cfg.databits = kl5kusb105a_dtb_8;
 	cfg.unknown1 = 0;
 	cfg.unknown2 = 1;
-	klsi_105_chg_port_settings(serial, &cfg);
+	klsi_105_chg_port_settings(port, &cfg);
 	
 	/* set up termios structure */
 	spin_lock_irqsave (&priv->lock, flags);
@@ -407,8 +408,8 @@ static int  klsi_105_open (struct usb_serial_port *port, struct file *filp)
 	spin_unlock_irqrestore (&priv->lock, flags);
 
 	/* READ_ON and urb submission */
-	usb_fill_bulk_urb(port->read_urb, serial->dev, 
-		      usb_rcvbulkpipe(serial->dev,
+	usb_fill_bulk_urb(port->read_urb, port->serial->dev, 
+		      usb_rcvbulkpipe(port->serial->dev,
 				      port->bulk_in_endpointAddress),
 		      port->read_urb->transfer_buffer,
 		      port->read_urb->transfer_buffer_length,
@@ -422,7 +423,8 @@ static int  klsi_105_open (struct usb_serial_port *port, struct file *filp)
 		goto exit;
 	}
 
-	rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0),
+	rc = usb_control_msg(port->serial->dev,
+			     usb_sndctrlpipe(port->serial->dev,0),
 			     KL5KUSB105A_SIO_CONFIGURE,
 			     USB_TYPE_VENDOR|USB_DIR_OUT|USB_RECIP_INTERFACE,
 			     KL5KUSB105A_SIO_CONFIGURE_READ_ON,
@@ -436,7 +438,7 @@ static int  klsi_105_open (struct usb_serial_port *port, struct file *filp)
 	} else 
 		dbg("%s - enabled reading", __FUNCTION__);
 
-	rc = klsi_105_get_line_state(serial, &line_state);
+	rc = klsi_105_get_line_state(port, &line_state);
 	if (rc >= 0) {
 		spin_lock_irqsave (&priv->lock, flags);
 		priv->line_state = line_state;
@@ -453,20 +455,14 @@ exit:
 
 static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial *serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	int rc;
 
 	dbg("%s port %d", __FUNCTION__, port->number);
 
-	serial = get_usb_serial (port, __FUNCTION__);
-
-	if(!serial)
-		return;
-
 	/* send READ_OFF */
-	rc = usb_control_msg (serial->dev,
-			      usb_sndctrlpipe(serial->dev, 0),
+	rc = usb_control_msg (port->serial->dev,
+			      usb_sndctrlpipe(port->serial->dev, 0),
 			      KL5KUSB105A_SIO_CONFIGURE,
 			      USB_TYPE_VENDOR | USB_DIR_OUT,
 			      KL5KUSB105A_SIO_CONFIGURE_READ_OFF,
@@ -497,7 +493,6 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
 static int klsi_105_write (struct usb_serial_port *port, int from_user,
 			   const unsigned char *buf, int count)
 {
-	struct usb_serial *serial = port->serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	int result, size;
 	int bytes_sent=0;
@@ -551,8 +546,8 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
 		((__u8 *)urb->transfer_buffer)[1] = (__u8) ((size & 0xFF00)>>8);
 
 		/* set up our urb */
-		usb_fill_bulk_urb(urb, serial->dev,
-			      usb_sndbulkpipe(serial->dev,
+		usb_fill_bulk_urb(urb, port->serial->dev,
+			      usb_sndbulkpipe(port->serial->dev,
 					      port->bulk_out_endpointAddress),
 			      urb->transfer_buffer,
 			      URB_TRANSFER_BUFFER_SIZE,
@@ -579,15 +574,9 @@ exit:
 static void klsi_105_write_bulk_callback ( struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = port->serial;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
 		    urb->status);
@@ -646,7 +635,6 @@ static int klsi_105_write_room (struct usb_serial_port *port)
 static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = port->serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
@@ -660,10 +648,6 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		    urb->status);
                 return;
         }
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
 	
 	/* The data received is again preceded by a length double-byte in LSB-
 	 * first order (see klsi_105_write() )
@@ -714,8 +698,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		priv->bytes_in += bytes_sent;
 	}
 	/* Continue trying to always read  */
-	usb_fill_bulk_urb(port->read_urb, serial->dev, 
-		      usb_rcvbulkpipe(serial->dev,
+	usb_fill_bulk_urb(port->read_urb, port->serial->dev, 
+		      usb_rcvbulkpipe(port->serial->dev,
 				      port->bulk_in_endpointAddress),
 		      port->read_urb->transfer_buffer,
 		      port->read_urb->transfer_buffer_length,
@@ -730,7 +714,6 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 static void klsi_105_set_termios (struct usb_serial_port *port,
 				  struct termios *old_termios)
 {
-	struct usb_serial *serial = port->serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	unsigned int iflag = port->tty->termios->c_iflag;
 	unsigned int old_iflag = old_termios->c_iflag;
@@ -868,7 +851,7 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
 	spin_unlock_irqrestore (&priv->lock, flags);
 	
 	/* now commit changes to device */
-	klsi_105_chg_port_settings(serial, &cfg);
+	klsi_105_chg_port_settings(port, &cfg);
 } /* klsi_105_set_termios */
 
 
@@ -890,14 +873,13 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state )
 
 static int klsi_105_tiocmget (struct usb_serial_port *port, struct file *file)
 {
-	struct usb_serial *serial = port->serial;
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
 	unsigned long flags;
 	int rc;
 	unsigned long line_state;
 	dbg("%s - request, just guessing", __FUNCTION__);
 
-	rc = klsi_105_get_line_state(serial, &line_state);
+	rc = klsi_105_get_line_state(port, &line_state);
 	if (rc < 0) {
 		err("Reading line control failed (error = %d)", rc);
 		/* better return value? EAGAIN? */
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 82319a9d1..79cb22e31 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -21,6 +21,9 @@
  * Supported readers: USB TWIN, KAAN Standard Plus and SecOVID Reader Plus
  * (Adapter K), B1 Professional and KAAN Professional (Adapter B)
  * 
+ * (21/05/2004) tw
+ *      Fix bug with P'n'P readers
+ *
  * (28/05/2003) tw
  *      Add support for KAAN SIM
  *
@@ -59,7 +62,7 @@
 #include "usb-serial.h"
 
 /* Version Information */
-#define DRIVER_VERSION "28/05/2003"
+#define DRIVER_VERSION "21/05/2004"
 #define DRIVER_AUTHOR "KOBIL Systems GmbH - http://www.kobil.com"
 #define DRIVER_DESC "KOBIL USB Smart Card Terminal Driver (experimental)"
 
@@ -110,7 +113,7 @@ static struct usb_driver kobil_driver = {
 };
 
 
-struct usb_serial_device_type kobil_device = {
+static struct usb_serial_device_type kobil_device = {
 	.owner =		THIS_MODULE,
 	.name =			"KOBIL USB smart card terminal",
 	.id_table =		id_table,
@@ -183,7 +186,7 @@ static int kobil_startup (struct usb_serial *serial)
 	pdev = serial->dev;
  	actconfig = pdev->actconfig;
  	interface = actconfig->interface[0];
-	altsetting = interface->altsetting;
+	altsetting = interface->cur_altsetting;
  	endpoint = altsetting->endpoint;
   
  	for (i = 0; i < altsetting->desc.bNumEndpoints; i++) {
@@ -230,9 +233,6 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp)
 	priv = usb_get_serial_port_data(port);
 	priv->line_state = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-
 	// someone sets the dev to 0 if the close method has been called
 	port->interrupt_in_urb->dev = port->serial->dev;
 
@@ -342,6 +342,12 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp)
 			);
 		dbg("%s - port %d Send reset_all_queues URB returns: %i", __FUNCTION__, port->number, result);
 	}
+	if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID || priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
+	    priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
+		// start reading (Adapter B 'cause PNP string)
+		result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC  ); 
+		dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result);
+	}
 
 	kfree(transfer_buffer);
 	return 0;
@@ -459,6 +465,11 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
 	if ( ((priv->device_type != KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 2) && (priv->filled >= (priv->buf[1] + 3))) || 
 	     ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 3) && (priv->filled >= (priv->buf[2] + 4))) ) {
 		
+		// stop reading (except TWIN and KAAN SIM)
+		if ( (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) || (priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) ) {
+			usb_unlink_urb( port->interrupt_in_urb );
+		}
+
 		todo = priv->filled - priv->cur_pos;
 
 		while(todo > 0) {
@@ -466,25 +477,23 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
 			length = (todo < 8) ? todo : 8;
 			// copy data to transfer buffer
 			memcpy(port->write_urb->transfer_buffer, priv->buf + priv->cur_pos, length );
-			
-			usb_fill_bulk_urb( port->write_urb,
-					   port->serial->dev,
-					   usb_sndbulkpipe( port->serial->dev, priv->write_int_endpoint_address),
-					   port->write_urb->transfer_buffer,
-					   length,
-					   kobil_write_callback,
-					   port
+			usb_fill_int_urb( port->write_urb,
+					  port->serial->dev,
+					  usb_sndintpipe(port->serial->dev, priv->write_int_endpoint_address),
+					  port->write_urb->transfer_buffer,
+					  length,
+					  kobil_write_callback,
+					  port,
+					  8
 				);
 
 			priv->cur_pos = priv->cur_pos + length;
-			result = usb_submit_urb( port->write_urb, GFP_ATOMIC );
+			result = usb_submit_urb( port->write_urb, GFP_NOIO );
 			dbg("%s - port %d Send write URB returns: %i", __FUNCTION__, port->number, result);
 			todo = priv->filled - priv->cur_pos;
 
 			if (todo > 0) {
-				//mdelay(16);
-				set_current_state(TASK_UNINTERRUPTIBLE);
-				schedule_timeout(24 * HZ / 1000);
+				msleep(24);
 			}
 
 		} // end while
@@ -495,9 +504,14 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
 		// someone sets the dev to 0 if the close method has been called
 		port->interrupt_in_urb->dev = port->serial->dev;
 		
-		// start reading
-		result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC ); 
-		dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result);
+		// start reading (except TWIN and KAAN SIM)
+		if ( (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) || (priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) ) {
+			// someone sets the dev to 0 if the close method has been called
+			port->interrupt_in_urb->dev = port->serial->dev;
+			
+			result = usb_submit_urb( port->interrupt_in_urb, GFP_NOIO ); 
+			dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result);
+		}
 	}
 	return count;
 }
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 9719ab776..5c4602be7 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -151,20 +151,13 @@ struct omninet_data
 
 static int omninet_open (struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial	*serial;
+	struct usb_serial	*serial = port->serial;
 	struct usb_serial_port	*wport;
 	struct omninet_data	*od;
 	int			result = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return -ENODEV;
-
 	od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL );
 	if( !od ) {
 		err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct omninet_data));
@@ -189,24 +182,15 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
 
 static void omninet_close (struct usb_serial_port *port, struct file * filp)
 {
-	struct usb_serial 	*serial;
+	struct usb_serial 	*serial = port->serial;
 	struct usb_serial_port 	*wport;
 	struct omninet_data 	*od;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-
-	if (serial->dev) {
-		wport = serial->port[1];
-		usb_unlink_urb (wport->write_urb);
-		usb_unlink_urb (port->read_urb);
-	}
+	wport = serial->port[1];
+	usb_unlink_urb(wport->write_urb);
+	usb_unlink_urb(port->read_urb);
 
 	od = usb_get_serial_port_data(port);
 	if (od)
@@ -221,8 +205,6 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
 static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port 	*port 	= (struct usb_serial_port *)urb->context;
-	struct usb_serial	*serial = get_usb_serial (port, __FUNCTION__);
-
 	unsigned char 		*data 	= urb->transfer_buffer;
 	struct omninet_header 	*header = (struct omninet_header *) &data[0];
 
@@ -231,11 +213,6 @@ static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 //	dbg("omninet_read_bulk_callback");
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -259,8 +236,8 @@ static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	}
 
 	/* Continue trying to always read  */
-	usb_fill_bulk_urb(urb, serial->dev, 
-		      usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
+	usb_fill_bulk_urb(urb, port->serial->dev, 
+		      usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
 		      urb->transfer_buffer, urb->transfer_buffer_length,
 		      omninet_read_bulk_callback, port);
 	result = usb_submit_urb(urb, GFP_ATOMIC);
@@ -344,20 +321,9 @@ static void omninet_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 /*	struct omninet_header	*header = (struct omninet_header  *) urb->transfer_buffer; */
 	struct usb_serial_port 	*port   = (struct usb_serial_port *) urb->context;
-	struct usb_serial 	*serial;
 
 //	dbg("omninet_write_bulk_callback, port %0x\n", port);
 
-
-	if (port_paranoia_check (port, __FUNCTION__)) {
-		return;
-	}
-
-	serial = port->serial;
-	if (serial_paranoia_check (serial, __FUNCTION__)) {
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 		return;
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 81f712cdd..e274cec85 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -1,7 +1,7 @@
 /*
  * Prolific PL2303 USB to serial adaptor driver
  *
- * Copyright (C) 2001-2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com)
  * Copyright (C) 2003 IBM Corp.
  *
  * Original driver for 2.2.x by anonymous
@@ -45,6 +45,7 @@
 #include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
@@ -80,6 +81,7 @@ static struct usb_device_id id_table [] = {
 	{ USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
 	{ USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
 	{ USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
+	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
 
@@ -410,9 +412,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
 	unsigned char *buf;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-		
 	dbg("%s -  port %d", __FUNCTION__, port->number);
 
 	usb_clear_halt(serial->dev, port->write_urb->pipe);
@@ -473,18 +472,11 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
 
 static void pl2303_close (struct usb_serial_port *port, struct file *filp)
 {
-	struct usb_serial *serial;
 	struct pl2303_private *priv;
 	unsigned long flags;
 	unsigned int c_cflag;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	/* shutdown our urbs */
@@ -661,7 +653,6 @@ static void pl2303_shutdown (struct usb_serial *serial)
 static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct pl2303_private *priv = usb_get_serial_port_data(port);
 	unsigned char *data = urb->transfer_buffer;
 	unsigned long flags;
@@ -685,9 +676,6 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs)
 		goto exit;
 	}
 
-	if (!serial) {
-		return;
-	}
 
 	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 
@@ -712,7 +700,6 @@ exit:
 static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct pl2303_private *priv = usb_get_serial_port_data(port);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
@@ -722,16 +709,8 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	u8 status;
 	char tty_flag;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
 		if (!port->open_count) {
@@ -742,7 +721,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 			/* PL2303 mysteriously fails with -EPROTO reschedule the read */
 			dbg("%s - caught -EPROTO, resubmitting the urb", __FUNCTION__);
 			urb->status = 0;
-			urb->dev = serial->dev;
+			urb->dev = port->serial->dev;
 			result = usb_submit_urb(urb, GFP_ATOMIC);
 			if (result)
 				dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
@@ -790,7 +769,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 	/* Schedule the next read _if_ we are still open */
 	if (port->open_count) {
-		urb->dev = serial->dev;
+		urb->dev = port->serial->dev;
 		result = usb_submit_urb(urb, GFP_ATOMIC);
 		if (result)
 			dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
@@ -806,16 +785,10 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
 	if (urb->status) {
 		/* error in the urb, so we have to resubmit it */
-		if (serial_paranoia_check (port->serial, __FUNCTION__)) {
-			return;
-		}
 		dbg("%s - Overflow in write", __FUNCTION__);
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 		port->write_urb->transfer_buffer_length = 1;
@@ -862,6 +835,6 @@ module_exit(pl2303_exit);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 971c5bb47..a3130625a 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -41,3 +41,6 @@
 
 #define SITECOM_VENDOR_ID	0x6189
 #define SITECOM_PRODUCT_ID	0x2068
+
+#define ALCATEL_VENDOR_ID	0x11f7
+#define ALCATEL_PRODUCT_ID	0x02df
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
index a55c631c1..a04d01dcf 100644
--- a/drivers/usb/serial/safe_serial.c
+++ b/drivers/usb/serial/safe_serial.c
@@ -211,7 +211,6 @@ static __u16 __inline__ fcs_compute10 (unsigned char *sp, int len, __u16 fcs)
 static void safe_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	unsigned char *data = urb->transfer_buffer;
 	unsigned char length = urb->actual_length;
 	int i;
@@ -219,11 +218,6 @@ static void safe_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg ("%s", __FUNCTION__);
 
-	if (!serial) {
-		dbg ("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg ("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -272,8 +266,8 @@ static void safe_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	}
 
 	/* Continue trying to always read  */
-	usb_fill_bulk_urb (urb, serial->dev,
-		       usb_rcvbulkpipe (serial->dev, port->bulk_in_endpointAddress),
+	usb_fill_bulk_urb (urb, port->serial->dev,
+		       usb_rcvbulkpipe (port->serial->dev, port->bulk_in_endpointAddress),
 		       urb->transfer_buffer, urb->transfer_buffer_length,
 		       safe_read_bulk_callback, port);
 
@@ -284,7 +278,6 @@ static void safe_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 static int safe_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count)
 {
-	struct usb_serial *serial = port->serial;
 	unsigned char *data;
 	int result;
 	int i;
@@ -367,7 +360,7 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign
 		printk ("\n");
 	}
 #endif
-	port->write_urb->dev = serial->dev;
+	port->write_urb->dev = port->serial->dev;
 	if ((result = usb_submit_urb (port->write_urb, GFP_KERNEL))) {
 		err ("%s - failed submitting write urb, error %d", __FUNCTION__, result);
 		return 0;
@@ -395,7 +388,7 @@ static int safe_write_room (struct usb_serial_port *port)
 
 static int safe_startup (struct usb_serial *serial)
 {
-	switch (serial->interface->altsetting->desc.bInterfaceProtocol) {
+	switch (serial->interface->cur_altsetting->desc.bInterfaceProtocol) {
 	case LINEO_SAFESERIAL_CRC:
 		break;
 	case LINEO_SAFESERIAL_CRC_PADDED:
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 609c1d164..19c92e818 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1,7 +1,7 @@
 /*
  * USB Serial Converter driver
  *
- * Copyright (C) 1999 - 2003 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 1999 - 2004 Greg Kroah-Hartman (greg@kroah.com)
  * Copyright (C) 2000 Peter Berger (pberger@brimson.com)
  * Copyright (C) 2000 Al Borchers (borchers@steinerpoint.com)
  *
@@ -330,6 +330,7 @@
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/smp_lock.h>
@@ -416,8 +417,7 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po
 			}
 		if (good_spot == 0)
 			continue;
-			
-		serial->magic = USB_SERIAL_MAGIC;
+
 		*minor = i;
 		dbg("%s - minor base = %d", __FUNCTION__, *minor);
 		for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i)
@@ -460,9 +460,10 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
 
 	/* get the serial object associated with this tty pointer */
 	serial = usb_serial_get_by_index(tty->index);
-
-	if (serial_paranoia_check (serial, __FUNCTION__))
-		return -ENODEV;
+	if (!serial) {
+		retval = -ENODEV;
+		goto bailout;
+	}
 
 	/* set up our port structure making the tty driver remember our port object, and us it */
 	portNumber = tty->index - serial->minor;
@@ -496,9 +497,8 @@ bailout:
 static void serial_close(struct tty_struct *tty, struct file * filp)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 
-	if (!serial)
+	if (!port)
 		return;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
@@ -524,12 +524,8 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
 static int serial_write (struct tty_struct * tty, int from_user, const unsigned char *buf, int count)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	int retval = -EINVAL;
 
-	if (!serial)
-		return -ENODEV;
-
 	dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count);
 
 	if (!port->open_count) {
@@ -538,7 +534,7 @@ static int serial_write (struct tty_struct * tty, int from_user, const unsigned
 	}
 
 	/* pass on to the driver specific version of this function */
-	retval = serial->type->write(port, from_user, buf, count);
+	retval = port->serial->type->write(port, from_user, buf, count);
 
 exit:
 	return retval;
@@ -547,12 +543,8 @@ exit:
 static int serial_write_room (struct tty_struct *tty) 
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	int retval = -EINVAL;
 
-	if (!serial)
-		return -ENODEV;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	if (!port->open_count) {
@@ -561,7 +553,7 @@ static int serial_write_room (struct tty_struct *tty)
 	}
 
 	/* pass on to the driver specific version of this function */
-	retval = serial->type->write_room(port);
+	retval = port->serial->type->write_room(port);
 
 exit:
 	return retval;
@@ -570,12 +562,8 @@ exit:
 static int serial_chars_in_buffer (struct tty_struct *tty) 
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	int retval = -EINVAL;
 
-	if (!serial)
-		return -ENODEV;
-
 	dbg("%s = port %d", __FUNCTION__, port->number);
 
 	if (!port->open_count) {
@@ -584,7 +572,7 @@ static int serial_chars_in_buffer (struct tty_struct *tty)
 	}
 
 	/* pass on to the driver specific version of this function */
-	retval = serial->type->chars_in_buffer(port);
+	retval = port->serial->type->chars_in_buffer(port);
 
 exit:
 	return retval;
@@ -593,10 +581,6 @@ exit:
 static void serial_throttle (struct tty_struct * tty)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-
-	if (!serial)
-		return;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -606,8 +590,8 @@ static void serial_throttle (struct tty_struct * tty)
 	}
 
 	/* pass on to the driver specific version of this function */
-	if (serial->type->throttle)
-		serial->type->throttle(port);
+	if (port->serial->type->throttle)
+		port->serial->type->throttle(port);
 
 exit:
 	;
@@ -616,10 +600,6 @@ exit:
 static void serial_unthrottle (struct tty_struct * tty)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-
-	if (!serial)
-		return;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -629,8 +609,8 @@ static void serial_unthrottle (struct tty_struct * tty)
 	}
 
 	/* pass on to the driver specific version of this function */
-	if (serial->type->unthrottle)
-		serial->type->unthrottle(port);
+	if (port->serial->type->unthrottle)
+		port->serial->type->unthrottle(port);
 
 exit:
 	;
@@ -639,12 +619,8 @@ exit:
 static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	int retval = -ENODEV;
 
-	if (!serial)
-		return -ENODEV;
-
 	dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
 
 	if (!port->open_count) {
@@ -653,8 +629,8 @@ static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned in
 	}
 
 	/* pass on to the driver specific version of this function if it is available */
-	if (serial->type->ioctl)
-		retval = serial->type->ioctl(port, file, cmd, arg);
+	if (port->serial->type->ioctl)
+		retval = port->serial->type->ioctl(port, file, cmd, arg);
 	else
 		retval = -ENOIOCTLCMD;
 
@@ -665,10 +641,6 @@ exit:
 static void serial_set_termios (struct tty_struct *tty, struct termios * old)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-
-	if (!serial)
-		return;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -678,8 +650,8 @@ static void serial_set_termios (struct tty_struct *tty, struct termios * old)
 	}
 
 	/* pass on to the driver specific version of this function if it is available */
-	if (serial->type->set_termios)
-		serial->type->set_termios(port, old);
+	if (port->serial->type->set_termios)
+		port->serial->type->set_termios(port, old);
 
 exit:
 	;
@@ -688,10 +660,6 @@ exit:
 static void serial_break (struct tty_struct *tty, int break_state)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-
-	if (!serial)
-		return;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -701,8 +669,8 @@ static void serial_break (struct tty_struct *tty, int break_state)
 	}
 
 	/* pass on to the driver specific version of this function if it is available */
-	if (serial->type->break_ctl)
-		serial->type->break_ctl(port, break_state);
+	if (port->serial->type->break_ctl)
+		port->serial->type->break_ctl(port, break_state);
 
 exit:
 	;
@@ -761,10 +729,6 @@ done:
 static int serial_tiocmget (struct tty_struct *tty, struct file *file)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-
-	if (!serial)
-		goto exit;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -773,8 +737,8 @@ static int serial_tiocmget (struct tty_struct *tty, struct file *file)
 		goto exit;
 	}
 
-	if (serial->type->tiocmget)
-		return serial->type->tiocmget(port, file);
+	if (port->serial->type->tiocmget)
+		return port->serial->type->tiocmget(port, file);
 
 exit:
 	return -EINVAL;
@@ -784,10 +748,6 @@ static int serial_tiocmset (struct tty_struct *tty, struct file *file,
 			    unsigned int set, unsigned int clear)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
-
-	if (!serial)
-		goto exit;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -796,8 +756,8 @@ static int serial_tiocmset (struct tty_struct *tty, struct file *file,
 		goto exit;
 	}
 
-	if (serial->type->tiocmset)
-		return serial->type->tiocmset(port, file, set, clear);
+	if (port->serial->type->tiocmset)
+		return port->serial->type->tiocmset(port, file, set, clear);
 
 exit:
 	return -EINVAL;
@@ -806,7 +766,6 @@ exit:
 void usb_serial_port_softint(void *private)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)private;
-	struct usb_serial *serial;
 	struct tty_struct *tty;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
@@ -814,10 +773,6 @@ void usb_serial_port_softint(void *private)
 	if (!port)
 		return;
 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-
 	tty = port->tty;
 	if (!tty)
 		return;
@@ -1037,7 +992,7 @@ int usb_serial_probe(struct usb_interface *interface,
 	     (dev->descriptor.idProduct == ATEN_PRODUCT_ID))) {
 		if (interface != dev->actconfig->interface[0]) {
 			/* check out the endpoints of the other interface*/
-			iface_desc = &dev->actconfig->interface[0]->altsetting[0];
+			iface_desc = dev->actconfig->interface[0]->cur_altsetting;
 			for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
 				endpoint = &iface_desc->endpoint[i].desc;
 				if ((endpoint->bEndpointAddress & 0x80) &&
@@ -1117,7 +1072,6 @@ int usb_serial_probe(struct usb_interface *interface,
 		memset(port, 0x00, sizeof(struct usb_serial_port));
 		port->number = i + serial->minor;
 		port->serial = serial;
-		port->magic = USB_SERIAL_PORT_MAGIC;
 		INIT_WORK(&port->work, usb_serial_port_softint, port);
 		serial->port[i] = port;
 	}
@@ -1463,5 +1417,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index a7d0c7783..766546dc3 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -1,7 +1,7 @@
 /*
  * USB Serial Converter driver
  *
- *	Copyright (C) 1999 - 2003
+ *	Copyright (C) 1999 - 2004
  *	    Greg Kroah-Hartman (greg@kroah.com)
  *
  *	This program is free software; you can redistribute it and/or modify
@@ -62,15 +62,11 @@
 
 #define MAX_NUM_PORTS		8	/* The maximum number of ports one device can grab at once */
 
-#define USB_SERIAL_MAGIC	0x6702	/* magic number for usb_serial struct */
-#define USB_SERIAL_PORT_MAGIC	0x7301	/* magic number for usb_serial_port struct */
-
 /* parity check flag */
 #define RELEVANT_IFLAG(iflag)	(iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
 
 /**
  * usb_serial_port: structure for the specific ports of a device.
- * @magic: magic number for internal validity of this pointer.
  * @serial: pointer back to the struct usb_serial owner of this port.
  * @tty: pointer to the corresponding tty for this port.
  * @number: the number of the port (the minor number).
@@ -95,8 +91,7 @@
  * ports of a device.
  */
 struct usb_serial_port {
-	int			magic;
-	struct usb_serial	*serial;
+	struct usb_serial *	serial;
 	struct tty_struct *	tty;
 	unsigned char		number;
 
@@ -133,7 +128,6 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void
 
 /**
  * usb_serial - structure used by the usb-serial core for a device
- * @magic: magic number for internal validity of this pointer.
  * @dev: pointer to the struct usb_device for this device
  * @type: pointer to the struct usb_serial_device_type for this device
  * @interface: pointer to the struct usb_interface for this device
@@ -151,7 +145,6 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void
  *	usb_set_serial_data() to access this.
  */
 struct usb_serial {
-	int				magic;
 	struct usb_device *		dev;
 	struct usb_serial_device_type *	type;
 	struct usb_interface *		interface;
@@ -301,60 +294,6 @@ extern struct usb_serial_device_type usb_serial_generic_device;
 extern struct bus_type usb_serial_bus_type;
 extern struct tty_driver *usb_serial_tty_driver;
 
-/* Inline functions to check the sanity of a pointer that is passed to us */
-static inline int serial_paranoia_check (struct usb_serial *serial, const char *function)
-{
-	if (!serial) {
-		dbg("%s - serial == NULL", function);
-		return -1;
-	}
-	if (serial->magic != USB_SERIAL_MAGIC) {
-		dbg("%s - bad magic number for serial", function);
-		return -1;
-	}
-	if (!serial->type) {
-		dbg("%s - serial->type == NULL!", function);
-		return -1;
-	}
-
-	return 0;
-}
-
-
-static inline int port_paranoia_check (struct usb_serial_port *port, const char *function)
-{
-	if (!port) {
-		dbg("%s - port == NULL", function);
-		return -1;
-	}
-	if (port->magic != USB_SERIAL_PORT_MAGIC) {
-		dbg("%s - bad magic number for port", function);
-		return -1;
-	}
-	if (!port->serial) {
-		dbg("%s - port->serial == NULL", function);
-		return -1;
-	}
-
-	return 0;
-}
-
-
-static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const char *function) 
-{ 
-	/* if no port was specified, or it fails a paranoia check */
-	if (!port || 
-		port_paranoia_check (port, function) ||
-		serial_paranoia_check (port->serial, function)) {
-		/* then say that we don't have a valid usb_serial thing, which will
-		 * end up genrating -ENODEV return values */ 
-		return NULL;
-	}
-
-	return port->serial;
-}
-
-
 static inline void usb_serial_debug_data (const char *file, const char *function, int size, const unsigned char *data)
 {
 	int i;
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 37e0dae94..377a18479 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -2,7 +2,7 @@
  * USB HandSpring Visor, Palm m50x, and Sony Clie driver
  * (supports all of the Palm OS USB devices)
  *
- *	Copyright (C) 1999 - 2003
+ *	Copyright (C) 1999 - 2004
  *	    Greg Kroah-Hartman (greg@kroah.com)
  *
  *	This program is free software; you can redistribute it and/or modify
@@ -151,6 +151,7 @@
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
@@ -194,8 +195,8 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
 static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_id *id);
 
 /* Parameters that may be passed into the module. */
-static int vendor = -1;
-static int product = -1;
+static __u16 vendor;
+static __u16 product;
 
 static struct usb_device_id id_table [] = {
 	{ USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID),
@@ -222,6 +223,8 @@ static struct usb_device_id id_table [] = {
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_Z_ID),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
+	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE31_ID),
+		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE_ID),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_0_ID),
@@ -273,6 +276,7 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_M130_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_T_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_Z_ID) },
+	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE31_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_3_5_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_0_ID) },
@@ -393,9 +397,6 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
 	struct usb_serial *serial = port->serial;
 	int result = 0;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return -ENODEV;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
 	if (!port->read_urb) {
@@ -443,18 +444,10 @@ exit:
 
 static void visor_close (struct usb_serial_port *port, struct file * filp)
 {
-	struct usb_serial *serial;
 	unsigned char *transfer_buffer;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 			 
-	serial = get_usb_serial (port, __FUNCTION__);
-	if (!serial)
-		return;
-	
 	/* shutdown our urbs */
 	usb_unlink_urb (port->read_urb);
 	if (port->interrupt_in_urb)
@@ -463,8 +456,8 @@ static void visor_close (struct usb_serial_port *port, struct file * filp)
 	/* Try to send shutdown message, if the device is gone, this will just fail. */
 	transfer_buffer =  kmalloc (0x12, GFP_KERNEL);
 	if (transfer_buffer) {
-		usb_control_msg (serial->dev,
-				 usb_rcvctrlpipe(serial->dev, 0),
+		usb_control_msg (port->serial->dev,
+				 usb_rcvctrlpipe(port->serial->dev, 0),
 				 VISOR_CLOSE_NOTIFICATION, 0xc2,
 				 0x0000, 0x0000, 
 				 transfer_buffer, 0x12, 300);
@@ -568,9 +561,6 @@ static void visor_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	/* free up the transfer buffer, as usb_free_urb() does not do this */
 	kfree (urb->transfer_buffer);
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-	
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
 	if (urb->status)
@@ -584,22 +574,13 @@ static void visor_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct tty_struct *tty;
 	unsigned char *data = urb->transfer_buffer;
 	int i;
 	int result;
 
-	if (port_paranoia_check (port, __FUNCTION__))
-		return;
-
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
@@ -622,9 +603,9 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	bytes_in += urb->actual_length;
 
 	/* Continue trying to always read  */
-	usb_fill_bulk_urb (port->read_urb, serial->dev,
-			   usb_rcvbulkpipe (serial->dev,
-					    port->bulk_in_endpointAddress),
+	usb_fill_bulk_urb (port->read_urb, port->serial->dev,
+			   usb_rcvbulkpipe(port->serial->dev,
+					   port->bulk_in_endpointAddress),
 			   port->read_urb->transfer_buffer,
 			   port->read_urb->transfer_buffer_length,
 			   visor_read_bulk_callback, port);
@@ -699,7 +680,7 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
 	char *string;
 	int retval = 0;
 	int i;
-	int num_ports;
+	int num_ports = 0;
 
 	dbg("%s", __FUNCTION__);
 
@@ -721,41 +702,50 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
 			__FUNCTION__, retval);
 		goto exit;
 	}
-		
-	connection_info = (struct visor_connection_info *)transfer_buffer;
-
-	le16_to_cpus(&connection_info->num_ports);
-	num_ports = connection_info->num_ports;
-	/* handle devices that report invalid stuff here */
-	if (num_ports > 2)
-		num_ports = 2;
-	dev_info(dev, "%s: Number of ports: %d\n", serial->type->name,
-		connection_info->num_ports);
 
-	for (i = 0; i < num_ports; ++i) {
-		switch (connection_info->connections[i].port_function_id) {
-			case VISOR_FUNCTION_GENERIC:
-				string = "Generic";
-				break;
-			case VISOR_FUNCTION_DEBUGGER:
-				string = "Debugger";
-				break;
-			case VISOR_FUNCTION_HOTSYNC:
-				string = "HotSync";
-				break;
-			case VISOR_FUNCTION_CONSOLE:
-				string = "Console";
-				break;
-			case VISOR_FUNCTION_REMOTE_FILE_SYS:
-				string = "Remote File System";
-				break;
-			default:
-				string = "unknown";
-				break;	
+	if (retval == sizeof(*connection_info)) {
+	        connection_info = (struct visor_connection_info *)transfer_buffer;
+
+		le16_to_cpus(&connection_info->num_ports);
+		num_ports = connection_info->num_ports;
+
+		for (i = 0; i < num_ports; ++i) {
+			switch (connection_info->connections[i].port_function_id) {
+				case VISOR_FUNCTION_GENERIC:
+					string = "Generic";
+					break;
+				case VISOR_FUNCTION_DEBUGGER:
+					string = "Debugger";
+					break;
+				case VISOR_FUNCTION_HOTSYNC:
+					string = "HotSync";
+					break;
+				case VISOR_FUNCTION_CONSOLE:
+					string = "Console";
+					break;
+				case VISOR_FUNCTION_REMOTE_FILE_SYS:
+					string = "Remote File System";
+					break;
+				default:
+					string = "unknown";
+					break;
+			}
+			dev_info(dev, "%s: port %d, is for %s use\n",
+				serial->type->name,
+				connection_info->connections[i].port, string);
 		}
-		dev_info(dev, "%s: port %d, is for %s use\n", serial->type->name,
-			 connection_info->connections[i].port, string);
 	}
+	/*
+	* Handle devices that report invalid stuff here.
+	*/
+	if (num_ports == 0 || num_ports > 2) {
+		dev_warn (dev, "%s: No valid connect info available\n",
+			serial->type->name);
+		num_ports = 2;
+	}
+  
+	dev_info(dev, "%s: Number of ports: %d\n", serial->type->name,
+		num_ports);
 
 	/*
 	 * save off our num_ports info so that we can use it in the
@@ -887,8 +877,7 @@ static int clie_3_5_startup (struct usb_serial *serial)
  
 static int treo_attach (struct usb_serial *serial)
 {
-	struct usb_serial_port *port;
-	int i;
+	struct usb_serial_port *swap_port;
 
 	/* Only do this endpoint hack for the Handspring devices with
 	 * interrupt in endpoints, which for now are the Treo devices. */
@@ -898,31 +887,28 @@ static int treo_attach (struct usb_serial *serial)
 
 	dbg("%s", __FUNCTION__);
 
-	/* Ok, this is pretty ugly, but these devices want to use the
-	 * interrupt endpoint as paired up with a bulk endpoint for a
-	 * "virtual serial port".  So let's force the endpoints to be
-	 * where we want them to be. */
-	for (i = serial->num_bulk_in; i < serial->num_ports; ++i) {
-		port = serial->port[i];
-		port->read_urb = serial->port[0]->read_urb;
-		port->bulk_in_endpointAddress = serial->port[0]->bulk_in_endpointAddress;
-		port->bulk_in_buffer = serial->port[0]->bulk_in_buffer;
-	}
-
-	for (i = serial->num_bulk_out; i < serial->num_ports; ++i) {
-		port = serial->port[i];
-		port->write_urb = serial->port[0]->write_urb;
-		port->bulk_out_size = serial->port[0]->bulk_out_size;
-		port->bulk_out_endpointAddress = serial->port[0]->bulk_out_endpointAddress;
-		port->bulk_out_buffer = serial->port[0]->bulk_out_buffer;
-	}
-
-	for (i = serial->num_interrupt_in; i < serial->num_ports; ++i) {
-		port = serial->port[i];
-		port->interrupt_in_urb = serial->port[0]->interrupt_in_urb;
-		port->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress;
-		port->interrupt_in_buffer = serial->port[0]->interrupt_in_buffer;
-	}
+	/*
+	* It appears that Treos want to use the 1st interrupt endpoint to
+	* communicate with the 2nd bulk out endpoint, so let's swap the 1st
+	* and 2nd bulk in and interrupt endpoints.  Note that swapping the
+	* bulk out endpoints would break lots of apps that want to communicate
+	* on the second port.
+	*/
+#define COPY_PORT(dest, src)						\
+	dest->read_urb = src->read_urb;					\
+	dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress;	\
+	dest->bulk_in_buffer = src->bulk_in_buffer;			\
+	dest->interrupt_in_urb = src->interrupt_in_urb;			\
+	dest->interrupt_in_endpointAddress = src->interrupt_in_endpointAddress;	\
+	dest->interrupt_in_buffer = src->interrupt_in_buffer;
+
+	swap_port = kmalloc(sizeof(*swap_port), GFP_KERNEL);
+	if (!swap_port)
+		return -ENOMEM;
+	COPY_PORT(swap_port, serial->port[0]);
+	COPY_PORT(serial->port[0], serial->port[1]);
+	COPY_PORT(serial->port[1], swap_port);
+	kfree(swap_port);
 
 	return 0;
 }
@@ -1099,10 +1085,10 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
-MODULE_PARM(vendor, "i");
+module_param(vendor, ushort, 0);
 MODULE_PARM_DESC(vendor, "User specified vendor ID");
-MODULE_PARM(product, "i");
+module_param(product, ushort, 0);
 MODULE_PARM_DESC(product, "User specified product ID");
diff --git a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h
index e586a6d97..6062273ab 100644
--- a/drivers/usb/serial/visor.h
+++ b/drivers/usb/serial/visor.h
@@ -31,6 +31,7 @@
 #define PALM_M130_ID			0x0050
 #define PALM_TUNGSTEN_T_ID		0x0060
 #define PALM_TUNGSTEN_Z_ID		0x0031
+#define PALM_ZIRE31_ID			0x0061
 #define PALM_ZIRE_ID			0x0070
 #define PALM_M100_ID			0x0080
 
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index cc9d849c1..e79afadc3 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -984,7 +984,6 @@ static void command_port_write_callback (struct urb *urb, struct pt_regs *regs)
 static void command_port_read_callback (struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *command_port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (command_port, __FUNCTION__);
 	struct whiteheat_command_private *command_info;
 	unsigned char *data = urb->transfer_buffer;
 	int result;
@@ -997,11 +996,6 @@ static void command_port_read_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-	
 	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
 
 	command_info = usb_get_serial_port_data(command_port);
@@ -1029,7 +1023,7 @@ static void command_port_read_callback (struct urb *urb, struct pt_regs *regs)
 	}
 	
 	/* Continue trying to always read */
-	command_port->read_urb->dev = serial->dev;
+	command_port->read_urb->dev = command_port->serial->dev;
 	result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC);
 	spin_unlock_irqrestore(&command_info->lock, flags);
 	if (result)
@@ -1040,7 +1034,6 @@ static void command_port_read_callback (struct urb *urb, struct pt_regs *regs)
 static void whiteheat_read_callback(struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct whiteheat_urb_wrap *wrap;
 	unsigned char *data = urb->transfer_buffer;
 	struct whiteheat_private *info = usb_get_serial_port_data(port);
@@ -1057,14 +1050,6 @@ static void whiteheat_read_callback(struct urb *urb, struct pt_regs *regs)
 	list_del(&wrap->list);
 	spin_unlock(&info->lock);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		spin_lock(&info->lock);
-		list_add(&wrap->list, &info->rx_urbs_free);
-		spin_unlock(&info->lock);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		spin_lock(&info->lock);
@@ -1091,7 +1076,6 @@ static void whiteheat_read_callback(struct urb *urb, struct pt_regs *regs)
 static void whiteheat_write_callback(struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-	struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 	struct whiteheat_private *info = usb_get_serial_port_data(port);
 	struct whiteheat_urb_wrap *wrap;
 
@@ -1108,11 +1092,6 @@ static void whiteheat_write_callback(struct urb *urb, struct pt_regs *regs)
 	list_add(&wrap->list, &info->tx_urbs_free);
 	spin_unlock(&info->lock);
 
-	if (!serial) {
-		dbg("%s - bad serial pointer, exiting", __FUNCTION__);
-		return;
-	}
-
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 		return;
diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
index 832894dea..58baacc9a 100644
--- a/drivers/usb/storage/datafab.c
+++ b/drivers/usb/storage/datafab.c
@@ -321,7 +321,7 @@ static int datafab_determine_lun(struct us_data *us,
 			goto leave;
 		}
 
-		wait_ms(20);
+		msleep(20);
 	}
 
 	rc = USB_STOR_TRANSPORT_ERROR;
@@ -489,7 +489,7 @@ static int datafab_handle_mode_sense(struct us_data *us,
 	return USB_STOR_TRANSPORT_GOOD;
 }
 
-void datafab_info_destructor(void *extra)
+static void datafab_info_destructor(void *extra)
 {
 	// this routine is a placeholder...
 	// currently, we don't allocate any extra memory so we're okay
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index 7bb613f08..43cc9c5e0 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -349,7 +349,7 @@ struct sense_data {
  * RETURNS:
  *    void
  */
-void isd200_build_sense(struct us_data *us, Scsi_Cmnd *srb)
+static void isd200_build_sense(struct us_data *us, Scsi_Cmnd *srb)
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	struct sense_data *buf = (struct sense_data *) &srb->sense_buffer[0];
@@ -505,7 +505,7 @@ static int isd200_action( struct us_data *us, int action,
  * RETURNS:
  *    ISD status code
  */
-int isd200_read_regs( struct us_data *us )
+static int isd200_read_regs( struct us_data *us )
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	int retStatus = ISD200_GOOD;
@@ -534,7 +534,7 @@ int isd200_read_regs( struct us_data *us )
  * This is used by the protocol layers to actually send the message to
  * the device and receive the response.
  */
-void isd200_invoke_transport( struct us_data *us, 
+static void isd200_invoke_transport( struct us_data *us, 
 			      Scsi_Cmnd *srb, 
 			      union ata_cdb *ataCdb )
 {
@@ -677,7 +677,7 @@ static void isd200_log_config( struct isd200_info* info )
  * RETURNS:
  *    ISD status code
  */
-int isd200_write_config( struct us_data *us ) 
+static int isd200_write_config( struct us_data *us ) 
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	int retStatus = ISD200_GOOD;
@@ -720,7 +720,7 @@ int isd200_write_config( struct us_data *us )
  * RETURNS:
  *    ISD status code
  */
-int isd200_read_config( struct us_data *us ) 
+static int isd200_read_config( struct us_data *us ) 
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	int retStatus = ISD200_GOOD;
@@ -765,7 +765,7 @@ int isd200_read_config( struct us_data *us )
  * RETURNS:
  *    NT status code
  */
-int isd200_atapi_soft_reset( struct us_data *us ) 
+static int isd200_atapi_soft_reset( struct us_data *us ) 
 {
 	int retStatus = ISD200_GOOD;
 	int transferStatus;
@@ -791,7 +791,7 @@ int isd200_atapi_soft_reset( struct us_data *us )
  * RETURNS:
  *    ISD status code
  */
-int isd200_srst( struct us_data *us ) 
+static int isd200_srst( struct us_data *us ) 
 {
 	int retStatus = ISD200_GOOD;
 	int transferStatus;
@@ -806,7 +806,7 @@ int isd200_srst( struct us_data *us )
 		retStatus = ISD200_ERROR;
 	} else {
 		/* delay 10ms to give the drive a chance to see it */
-		wait_ms(10);
+		msleep(10);
 
 		transferStatus = isd200_action( us, ACTION_REENABLE, NULL, 0 );
 		if (transferStatus != ISD200_TRANSPORT_GOOD) {
@@ -814,7 +814,7 @@ int isd200_srst( struct us_data *us )
 			retStatus = ISD200_ERROR;
 		} else {
 			/* delay 50ms to give the drive a chance to recover after SRST */
-			wait_ms(50);
+			msleep(50);
 		}
 	}
 
@@ -937,7 +937,7 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave,
  * RETURNS:
  *    ISD status code
  */
-int isd200_manual_enum(struct us_data *us)
+static int isd200_manual_enum(struct us_data *us)
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	int retStatus = ISD200_GOOD;
@@ -981,7 +981,7 @@ int isd200_manual_enum(struct us_data *us)
  * RETURNS:
  *    ISD status code
  */
-int isd200_get_inquiry_data( struct us_data *us )
+static int isd200_get_inquiry_data( struct us_data *us )
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	int retStatus = ISD200_GOOD;
@@ -1124,8 +1124,8 @@ int isd200_get_inquiry_data( struct us_data *us )
  *    TRUE if the command needs to be sent to the transport layer
  *    FALSE otherwise
  */
-int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us, 
-		       union ata_cdb * ataCdb)
+static int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us,
+			      union ata_cdb * ataCdb)
 {
 	struct isd200_info *info = (struct isd200_info *)us->extra;
 	struct hd_driveid *id = info->id;
@@ -1339,7 +1339,7 @@ int isd200_scsi_to_ata(Scsi_Cmnd *srb, struct us_data *us,
  *
  * Frees the driver structure.
  */
-void isd200_free_info_ptrs(void *info_)
+static void isd200_free_info_ptrs(void *info_)
 {
 	struct isd200_info *info = (struct isd200_info *) info_;
 
@@ -1357,7 +1357,7 @@ void isd200_free_info_ptrs(void *info_)
  * RETURNS:
  *    ISD status code
  */
-int isd200_init_info(struct us_data *us)
+static int isd200_init_info(struct us_data *us)
 {
 	int retStatus = ISD200_GOOD;
 	struct isd200_info *info;
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
index 77429109c..39b24e59f 100644
--- a/drivers/usb/storage/jumpshot.c
+++ b/drivers/usb/storage/jumpshot.c
@@ -253,7 +253,7 @@ static int jumpshot_write_data(struct us_data *us,
 			if (result != USB_STOR_TRANSPORT_GOOD) {
 				// I have not experimented to find the smallest value.
 				//
-				wait_ms(50); 
+				msleep(50); 
 			}
 		} while ((result != USB_STOR_TRANSPORT_GOOD) && (waitcount < 10));
 
@@ -416,7 +416,7 @@ static int jumpshot_handle_mode_sense(struct us_data *us,
 }
 
 
-void jumpshot_info_destructor(void *extra)
+static void jumpshot_info_destructor(void *extra)
 {
 	// this routine is a placeholder...
 	// currently, we don't allocate any extra blocks so we're okay
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 1bdd36765..ca3be781e 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -159,14 +159,18 @@ static int command_abort( Scsi_Cmnd *srb )
 		return FAILED;
 	}
 
-	/* Set state to ABORTING, set the ABORTING bit, and release the lock */
+	/* Set state to ABORTING and set the ABORTING bit, but only if
+	 * a device reset isn't already in progress (to avoid interfering
+	 * with the reset).  To prevent races with auto-reset, we must
+	 * stop any ongoing USB transfers while still holding the host
+	 * lock. */
 	us->sm_state = US_STATE_ABORTING;
-	set_bit(US_FLIDX_ABORTING, &us->flags);
+	if (!test_bit(US_FLIDX_RESETTING, &us->flags)) {
+		set_bit(US_FLIDX_ABORTING, &us->flags);
+		usb_stor_stop_transport(us);
+	}
 	scsi_unlock(host);
 
-	/* Stop an ongoing USB transfer */
-	usb_stor_stop_transport(us);
-
 	/* Wait for the aborted command to finish */
 	wait_for_completion(&us->notify);
 
@@ -254,18 +258,17 @@ static int bus_reset( Scsi_Cmnd *srb )
 }
 
 /* Report a driver-initiated device reset to the SCSI layer.
- * Calling this for a SCSI-initiated reset is unnecessary but harmless. */
+ * Calling this for a SCSI-initiated reset is unnecessary but harmless.
+ * The caller must own the SCSI host lock. */
 void usb_stor_report_device_reset(struct us_data *us)
 {
 	int i;
 
-	scsi_lock(us->host);
 	scsi_report_device_reset(us->host, 0, 0);
 	if (us->flags & US_FL_SCM_MULT_TARG) {
 		for (i = 1; i < us->host->max_id; ++i)
 			scsi_report_device_reset(us->host, 0, i);
 	}
-	scsi_unlock(us->host);
 }
 
 /***********************************************************************
diff --git a/drivers/usb/storage/scsiglue.h b/drivers/usb/storage/scsiglue.h
index 7bd4eaa89..e5dc7613b 100644
--- a/drivers/usb/storage/scsiglue.h
+++ b/drivers/usb/storage/scsiglue.h
@@ -43,7 +43,7 @@
 
 #include <linux/blkdev.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "usb.h"
 
 extern void usb_stor_report_device_reset(struct us_data *us);
diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
index 7dcbf6ee3..b0af06e4f 100644
--- a/drivers/usb/storage/shuttle_usbat.c
+++ b/drivers/usb/storage/shuttle_usbat.c
@@ -55,11 +55,11 @@
 
 int transferred = 0;
 
-int usbat_read(struct us_data *us,
-	     unsigned char access,
-	     unsigned char reg, 
-	     unsigned char *content) {
-
+static int usbat_read(struct us_data *us,
+		      unsigned char access,
+		      unsigned char reg,
+		      unsigned char *content)
+{
 	int result;
 
 	result = usb_stor_ctrl_transfer(us,
@@ -74,11 +74,11 @@ int usbat_read(struct us_data *us,
 	return result;
 }
 
-int usbat_write(struct us_data *us,
-	     unsigned char access,
-	     unsigned char reg, 
-	     unsigned char content) {
-
+static int usbat_write(struct us_data *us,
+		       unsigned char access,
+		       unsigned char reg,
+		       unsigned char content)
+{
 	int result;
 
 	result = usb_stor_ctrl_transfer(us,
@@ -93,14 +93,14 @@ int usbat_write(struct us_data *us,
 	return result;
 }
 
-int usbat_set_shuttle_features(struct us_data *us,
-	     unsigned char external_trigger,
-	     unsigned char epp_control, 
-	     unsigned char mask_byte, 
-	     unsigned char test_pattern, 
-	     unsigned char subcountH, 
-	     unsigned char subcountL) {
-
+static int usbat_set_shuttle_features(struct us_data *us,
+				      unsigned char external_trigger,
+				      unsigned char epp_control,
+				      unsigned char mask_byte,
+				      unsigned char test_pattern,
+				      unsigned char subcountH,
+				      unsigned char subcountL)
+{
 	int result;
 	unsigned char *command = us->iobuf;
 
@@ -125,13 +125,13 @@ int usbat_set_shuttle_features(struct us_data *us,
 	return result;
 }
 
-int usbat_read_block(struct us_data *us,
-	     unsigned char access,
-	     unsigned char reg, 
-	     unsigned char *content,
-	     unsigned short len,
-	     int use_sg) {
-
+static int usbat_read_block(struct us_data *us,
+			    unsigned char access,
+			    unsigned char reg,
+			    unsigned char *content,
+			    unsigned short len,
+			    int use_sg)
+{
 	int result;
 	unsigned char *command = us->iobuf;
 
@@ -171,8 +171,8 @@ int usbat_read_block(struct us_data *us,
  * an error condition.
  */
 
-int usbat_wait_not_busy(struct us_data *us, int minutes) {
-
+static int usbat_wait_not_busy(struct us_data *us, int minutes)
+{
 	int i;
 	int result;
 	unsigned char *status = us->iobuf;
@@ -202,13 +202,13 @@ int usbat_wait_not_busy(struct us_data *us, int minutes) {
 		}
 
 		if (i<500)
-			wait_ms(10); // 5 seconds
+			msleep(10); // 5 seconds
 		else if (i<700)
-			wait_ms(50); // 10 seconds
+			msleep(50); // 10 seconds
 		else if (i<1200)
-			wait_ms(100); // 50 seconds
+			msleep(100); // 50 seconds
 		else
-			wait_ms(1000); // X minutes
+			msleep(1000); // X minutes
 	}
 
 	US_DEBUGP("Waited not busy for %d minutes, timing out.\n",
@@ -216,14 +216,13 @@ int usbat_wait_not_busy(struct us_data *us, int minutes) {
 	return USB_STOR_TRANSPORT_FAILED;
 }
 
-int usbat_write_block(struct us_data *us,
-	     unsigned char access,
-	     unsigned char reg, 
-	     unsigned char *content,
-	     unsigned short len,
-	     int use_sg,
-	     int minutes) {
-
+static int usbat_write_block(struct us_data *us,
+			     unsigned char access, 
+			     unsigned char reg,
+			     unsigned char *content,
+			     unsigned short len,
+			     int use_sg, int minutes)
+{
 	int result;
 	unsigned char *command = us->iobuf;
 
@@ -260,21 +259,21 @@ int usbat_write_block(struct us_data *us,
 	return usbat_wait_not_busy(us, minutes);
 }
 
-int usbat_rw_block_test(struct us_data *us,
-	     unsigned char access,
-	     unsigned char *registers,
-	     unsigned char *data_out,
-	     unsigned short num_registers,
-	     unsigned char data_reg, 
-	     unsigned char status_reg, 
-	     unsigned char timeout, 
-	     unsigned char qualifier, 
-	     int direction,
-	     unsigned char *content,
-	     unsigned short len,
-	     int use_sg,
-	     int minutes) {
-
+static int usbat_rw_block_test(struct us_data *us,
+			       unsigned char access,
+			       unsigned char *registers,
+			       unsigned char *data_out,
+			       unsigned short num_registers,
+			       unsigned char data_reg,
+			       unsigned char status_reg,
+			       unsigned char timeout,
+			       unsigned char qualifier,
+			       int direction,
+			       unsigned char *content,
+			       unsigned short len,
+			       int use_sg,
+			       int minutes)
+{
 	int result;
 	unsigned int pipe = (direction == SCSI_DATA_READ) ?
 			us->recv_bulk_pipe : us->send_bulk_pipe;
@@ -431,12 +430,12 @@ int usbat_rw_block_test(struct us_data *us,
  * transfers of data!
  */
 
-int usbat_multiple_write(struct us_data *us, 
-			unsigned char access,
-			unsigned char *registers,
-			unsigned char *data_out,
-			unsigned short num_registers) {
-
+static int usbat_multiple_write(struct us_data *us,
+				unsigned char access,
+				unsigned char *registers,
+				unsigned char *data_out,
+				unsigned short num_registers)
+{
 	int result;
 	unsigned char *data = us->iobuf;
 	int i;
@@ -479,9 +478,8 @@ int usbat_multiple_write(struct us_data *us,
 	return usbat_wait_not_busy(us, 0);
 }
 
-int usbat_read_user_io(struct us_data *us,
-		unsigned char *data_flags) {
-
+static int usbat_read_user_io(struct us_data *us, unsigned char *data_flags)
+{
 	int result;
 
 	result = usb_stor_ctrl_transfer(us,
@@ -496,10 +494,10 @@ int usbat_read_user_io(struct us_data *us,
 	return result;
 }
 
-int usbat_write_user_io(struct us_data *us,
-		unsigned char enable_flags,
-		unsigned char data_flags) {
-
+static int usbat_write_user_io(struct us_data *us,
+			       unsigned char enable_flags,
+			       unsigned char data_flags)
+{
 	int result;
 
 	result = usb_stor_ctrl_transfer(us,
@@ -519,11 +517,11 @@ int usbat_write_user_io(struct us_data *us,
  * a little ( <= 65535 byte) ATAPI pipe
  */
 
-int usbat_handle_read10(struct us_data *us,
-		unsigned char *registers,
-		unsigned char *data,
-		Scsi_Cmnd *srb) {
-
+static int usbat_handle_read10(struct us_data *us,
+			       unsigned char *registers,
+			       unsigned char *data,
+			       Scsi_Cmnd *srb)
+{
 	int result = USB_STOR_TRANSPORT_GOOD;
 	unsigned char *buffer;
 	unsigned int len;
@@ -630,8 +628,8 @@ int usbat_handle_read10(struct us_data *us,
 	return result;
 }
 
-static int hp_8200e_select_and_test_registers(struct us_data *us) {
-
+static int hp_8200e_select_and_test_registers(struct us_data *us)
+{
 	int selector;
 	unsigned char *status = us->iobuf;
 
@@ -679,8 +677,8 @@ static int hp_8200e_select_and_test_registers(struct us_data *us) {
 	return USB_STOR_TRANSPORT_GOOD;
 }
 
-int init_8200e(struct us_data *us) {
-
+int init_8200e(struct us_data *us)
+{
 	int result;
 	unsigned char *status = us->iobuf;
 
@@ -693,7 +691,7 @@ int init_8200e(struct us_data *us) {
 
 	US_DEBUGP("INIT 1\n");
 
-	wait_ms(2000);
+	msleep(2000);
 
 	if (usbat_read_user_io(us, status) !=
 			USB_STOR_XFER_GOOD)
@@ -727,7 +725,7 @@ int init_8200e(struct us_data *us) {
 
 	US_DEBUGP("INIT 5\n");
 
-	wait_ms(250);
+	msleep(250);
 
 	// Write 0x80 to ISA port 0x3F
 
@@ -778,7 +776,7 @@ int init_8200e(struct us_data *us) {
 
 	US_DEBUGP("INIT 12\n");
 
-	wait_ms(1400);
+	msleep(1400);
 
 	if (usbat_read_user_io(us, status) !=
 			USB_STOR_XFER_GOOD)
diff --git a/drivers/usb/storage/shuttle_usbat.h b/drivers/usb/storage/shuttle_usbat.h
index ad5078f16..e9c4aead5 100644
--- a/drivers/usb/storage/shuttle_usbat.h
+++ b/drivers/usb/storage/shuttle_usbat.h
@@ -52,27 +52,7 @@
 #define USBAT_UIO_OE0		0x10 // I/O 0 set=output/clr=input
 #define USBAT_UIO_ADPRST	0x01 // Reset SCM chip
 
-/* USBAT-specific commands */
-
-extern int usbat_read(struct us_data *us, unsigned char access,
-	unsigned char reg, unsigned char *content);
-extern int usbat_write(struct us_data *us, unsigned char access,
-	unsigned char reg, unsigned char content);
-extern int usbat_read_block(struct us_data *us, unsigned char access,
-	unsigned char reg, unsigned char *content, unsigned short len,
-	int use_sg);
-extern int usbat_write_block(struct us_data *us, unsigned char access,
-	unsigned char reg, unsigned char *content, unsigned short len,
-	int use_sg, int minutes);
-extern int usbat_multiple_write(struct us_data *us, unsigned char access,
-	unsigned char *registers, unsigned char *data_out,
-	unsigned short num_registers);
-extern int usbat_read_user_io(struct us_data *us, unsigned char *data_flags);
-extern int usbat_write_user_io(struct us_data *us,
-	unsigned char enable_flags, unsigned char data_flags);
-
 /* HP 8200e stuff */
-
 extern int hp8200e_transport(Scsi_Cmnd *srb, struct us_data *us);
 extern int init_8200e(struct us_data *us);
 
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index bb738c8d9..e42c59a1b 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -137,7 +137,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)
 	int status;
 
 	/* don't submit URBs during abort/disconnect processing */
-	if (us->flags & DONT_SUBMIT)
+	if (us->flags & ABORTING_OR_DISCONNECTING)
 		return -EIO;
 
 	/* set up data structures for the wakeup system */
@@ -172,7 +172,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)
 	set_bit(US_FLIDX_URB_ACTIVE, &us->flags);
 
 	/* did an abort/disconnect occur during the submission? */
-	if (us->flags & DONT_SUBMIT) {
+	if (us->flags & ABORTING_OR_DISCONNECTING) {
 
 		/* cancel the URB, if it hasn't been cancelled already */
 		if (test_and_clear_bit(US_FLIDX_URB_ACTIVE, &us->flags)) {
@@ -440,7 +440,7 @@ int usb_stor_bulk_transfer_sglist(struct us_data *us, unsigned int pipe,
 	int result;
 
 	/* don't submit s-g requests during abort/disconnect processing */
-	if (us->flags & DONT_SUBMIT)
+	if (us->flags & ABORTING_OR_DISCONNECTING)
 		return USB_STOR_XFER_ERROR;
 
 	/* initialize the scatter-gather request block */
@@ -458,7 +458,7 @@ int usb_stor_bulk_transfer_sglist(struct us_data *us, unsigned int pipe,
 	set_bit(US_FLIDX_SG_ACTIVE, &us->flags);
 
 	/* did an abort/disconnect occur during the submission? */
-	if (us->flags & DONT_SUBMIT) {
+	if (us->flags & ABORTING_OR_DISCONNECTING) {
 
 		/* cancel the request, if it hasn't been cancelled already */
 		if (test_and_clear_bit(US_FLIDX_SG_ACTIVE, &us->flags)) {
@@ -712,14 +712,10 @@ void usb_stor_invoke_transport(Scsi_Cmnd *srb, struct us_data *us)
 
 	/* abort processing: the bulk-only transport requires a reset
 	 * following an abort */
-	Handle_Abort:
+  Handle_Abort:
 	srb->result = DID_ABORT << 16;
-	if (us->protocol == US_PR_BULK) {
-
-		/* permit the reset transfer to take place */
-		clear_bit(US_FLIDX_ABORTING, &us->flags);
+	if (us->protocol == US_PR_BULK)
 		us->transport_reset(us);
-	}
 }
 
 /* Stop the current URB transfer */
@@ -912,6 +908,17 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
 				 USB_RECIP_INTERFACE,
 				 0, us->ifnum, us->iobuf, 1, HZ);
 
+	/* 
+	 * Some devices (i.e. Iomega Zip100) need this -- apparently
+	 * the bulk pipes get STALLed when the GetMaxLUN request is
+	 * processed.   This is, in theory, harmless to all other devices
+	 * (regardless of if they stall or not).
+	 */
+	if (result < 0) {
+		usb_stor_clear_halt(us, us->recv_bulk_pipe);
+		usb_stor_clear_halt(us, us->send_bulk_pipe);
+	}
+
 	US_DEBUGP("GetMaxLUN command result is %d, data is %d\n", 
 		  result, us->iobuf[0]);
 
@@ -1079,35 +1086,39 @@ static int usb_stor_reset_common(struct us_data *us,
 {
 	int result;
 	int result2;
+	int rc = FAILED;
 
-	/* Let the SCSI layer know we are doing a reset */
+	/* Let the SCSI layer know we are doing a reset, set the
+	 * RESETTING bit, and clear the ABORTING bit so that the reset
+	 * may proceed.
+	 */
+	scsi_lock(us->host);
 	usb_stor_report_device_reset(us);
+	set_bit(US_FLIDX_RESETTING, &us->flags);
+	clear_bit(US_FLIDX_ABORTING, &us->flags);
+	scsi_unlock(us->host);
 
 	/* A 20-second timeout may seem rather long, but a LaCie
-	 *  StudioDrive USB2 device takes 16+ seconds to get going
-	 *  following a powerup or USB attach event. */
-
+	 * StudioDrive USB2 device takes 16+ seconds to get going
+	 * following a powerup or USB attach event.
+	 */
 	result = usb_stor_control_msg(us, us->send_ctrl_pipe,
 			request, requesttype, value, index, data, size,
 			20*HZ);
 	if (result < 0) {
 		US_DEBUGP("Soft reset failed: %d\n", result);
-		return FAILED;
+		goto Done;
 	}
 
 	/* long wait for reset, so unlock to allow disconnects */
 	up(&us->dev_semaphore);
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ*6);
+	msleep(6000);
 	down(&us->dev_semaphore);
 	if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) {
 		US_DEBUGP("Reset interrupted by disconnect\n");
-		return FAILED;
+		goto Done;
 	}
 
-	/* permit the clear-halt transfers to take place */
-	clear_bit(US_FLIDX_ABORTING, &us->flags);
-
 	US_DEBUGP("Soft reset: clearing bulk-in endpoint halt\n");
 	result = usb_stor_clear_halt(us, us->recv_bulk_pipe);
 
@@ -1117,10 +1128,14 @@ static int usb_stor_reset_common(struct us_data *us,
 	/* return a result code based on the result of the control message */
 	if (result < 0 || result2 < 0) {
 		US_DEBUGP("Soft reset failed\n");
-		return FAILED;
+		goto Done;
 	}
 	US_DEBUGP("Soft reset done\n");
-	return SUCCESS;
+	rc = SUCCESS;
+
+  Done:
+	clear_bit(US_FLIDX_RESETTING, &us->flags);
+	return rc;
 }
 
 /* This issues a CB[I] Reset to the device in question
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 63febd760..56de0bdf2 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -90,6 +90,12 @@ UNUSUAL_DEV(  0x0436, 0x0005, 0x0100, 0x0100,
  		US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ),
 #endif
 
+/* Patch submitted by Alessandro Fracchetti <al.fracchetti@tin.it> */
+UNUSUAL_DEV(  0x0482, 0x0105, 0x0100, 0x0100,
+		"Kyocera",
+		"Finecam L3",
+		US_SC_SCSI, US_PR_BULK, NULL, US_FL_FIX_INQUIRY),
+
 /* Patch submitted by Philipp Friedrich <philipp@void.at> */
 UNUSUAL_DEV(  0x0482, 0x0100, 0x0100, 0x0100,
 		"Kyocera",
@@ -297,6 +303,13 @@ UNUSUAL_DEV(  0x054c, 0x002e, 0x0106, 0x0310,
 		US_SC_SCSI, US_PR_DEVICE, NULL,
 		US_FL_SINGLE_LUN | US_FL_MODE_XLATE),
 
+/* Submitted by Rajesh Kumble Nayak <nayak@obs-nice.fr> */
+UNUSUAL_DEV(  0x054c, 0x002e, 0x0500, 0x0500, 
+		"Sony",
+		"Handycam HC-85",
+		US_SC_UFI, US_PR_DEVICE, NULL,
+		US_FL_SINGLE_LUN | US_FL_MODE_XLATE),
+
 UNUSUAL_DEV(  0x054c, 0x0032, 0x0000, 0x9999,
 		"Sony",
 		"Memorystick MSC-U01N",
@@ -322,6 +335,13 @@ UNUSUAL_DEV(  0x054c, 0x006d, 0x0000, 0x9999,
 		"PEG Mass Storage",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_FIX_INQUIRY ),
+
+/* Submitted by Mike Alborn <malborn@deandra.homeip.net> */
+UNUSUAL_DEV(  0x054c, 0x016a, 0x0000, 0x9999,
+		"Sony",
+		"PEG Mass Storage",
+		US_SC_DEVICE, US_PR_DEVICE, NULL,
+		US_FL_FIX_INQUIRY ),
 		
 UNUSUAL_DEV(  0x057b, 0x0000, 0x0000, 0x0299, 
 		"Y-E Data",
@@ -438,22 +458,6 @@ UNUSUAL_DEV(  0x066b, 0x0105, 0x0100, 0x0100,
 		US_FL_SINGLE_LUN ),
 #endif
 
-/* Following three Minolta cameras reported by Martin Pool
- * <mbp@sourcefrog.net>.  Originally discovered by Kedar Petankar,
- * Matthew Geier, Mikael Lofj"ard, Marcel de Boer.
- */
-UNUSUAL_DEV( 0x0686, 0x4006, 0x0001, 0x0001,
-		"Minolta",
-		"DiMAGE 7",
-		US_SC_SCSI, US_PR_DEVICE, NULL,
-		0 ),
-
-UNUSUAL_DEV( 0x0686, 0x400f, 0x0001, 0x0001,
-		"Minolta",
-		"DiMAGE 7Hi",
-		US_SC_SCSI, US_PR_DEVICE, NULL,
-		0 ),
-
 /* Submitted by Benny Sjostrand <benny@hostmobility.com> */
 UNUSUAL_DEV( 0x0686, 0x4011, 0x0001, 0x0001,
 		"Minolta",
@@ -629,7 +633,7 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9009,
 		"Casio",
 		"QV DigitalCamera",
 		US_SC_DEVICE, US_PR_CB, NULL,
-		US_FL_FIX_INQUIRY ),
+		US_FL_NEED_OVERRIDE | US_FL_FIX_INQUIRY ),
 
 /* Later Casio cameras apparently tell the truth */
 UNUSUAL_DEV( 0x07cf, 0x1001, 0x9010, 0x9999,
@@ -688,7 +692,7 @@ UNUSUAL_DEV(  0x097a, 0x0001, 0x0000, 0x0001,
 UNUSUAL_DEV(  0x0a16, 0x8888, 0x0100, 0x0100,
 		"IBM",
 		"IBM USB Memory Key",
-		US_SC_SCSI, US_PR_BULK, NULL,
+		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_FIX_INQUIRY ),
 
 /* This Pentax still camera is not conformant
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index e32ae272d..634282265 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -84,8 +84,6 @@
 
 
 #include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 
@@ -490,7 +488,7 @@ static void get_device_info(struct us_data *us, int id_index)
 		if (unusual_dev->useTransport != US_PR_DEVICE &&
 			us->protocol == idesc->bInterfaceProtocol)
 			msg += 2;
-		if (msg >= 0)
+		if (msg >= 0 && !(unusual_dev->flags & US_FL_NEED_OVERRIDE))
 			printk(KERN_NOTICE USB_STORAGE "This device "
 				"(%04x,%04x,%04x S %02x P %02x)"
 				" has %s in unusual_devs.h\n"
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 2dee62aa5..7ef571a17 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -49,7 +49,7 @@
 #include <linux/smp_lock.h>
 #include <linux/completion.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 struct us_data;
 
@@ -69,6 +69,7 @@ struct us_unusual_dev {
 /* Flag definitions: these entries are static */
 #define US_FL_SINGLE_LUN      0x00000001 /* allow access to only LUN 0	    */
 #define US_FL_MODE_XLATE      0          /* [no longer used]                */
+#define US_FL_NEED_OVERRIDE   0x00000004 /* unusual_devs entry is necessary */
 #define US_FL_IGNORE_SER      0		 /* [no longer used]		    */
 #define US_FL_SCM_MULT_TARG   0x00000020 /* supports multiple targets	    */
 #define US_FL_FIX_INQUIRY     0x00000040 /* INQUIRY response needs faking   */
@@ -79,8 +80,9 @@ struct us_unusual_dev {
 #define US_FLIDX_SG_ACTIVE	19  /* 0x00080000  current_sg is in use   */
 #define US_FLIDX_ABORTING	20  /* 0x00100000  abort is in progress   */
 #define US_FLIDX_DISCONNECTING	21  /* 0x00200000  disconnect in progress */
-#define DONT_SUBMIT	((1UL << US_FLIDX_ABORTING) | \
-			 (1UL << US_FLIDX_DISCONNECTING))
+#define ABORTING_OR_DISCONNECTING	((1UL << US_FLIDX_ABORTING) | \
+					 (1UL << US_FLIDX_DISCONNECTING))
+#define US_FLIDX_RESETTING	22  /* 0x00400000  device reset in progress */
 
 
 /* processing state machine states */
diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c
index 32c05bc24..5e9bcf5a8 100644
--- a/drivers/video/68328fb.c
+++ b/drivers/video/68328fb.c
@@ -1,29 +1,30 @@
 /*
- * linux/arch/m68knommu/console/68328fb.c -- Low level implementation of the
- *                                           mc68328 LCD frame buffer device
+ *  linux/drivers/video/68328fb.c -- Low level implementation of the
+ *                                   mc68x328 LCD frame buffer device
  *
- *    Copyright (C) 1998,1999 Kenneth Albanowski <kjahds@kjahds.com>,
- *                            The Silver Hammer Group, Ltd.
- *
- *
- * This file is based on the Amiga CyberVision frame buffer device (Cyberfb.c):
+ *	Copyright (C) 2003 Georges Menie
  *
- *    Copyright (C) 1996 Martin Apel
- *                       Geert Uytterhoeven
+ *  This driver assumes an already configured controller (e.g. from config.c)
+ *  Keep the code clean of board specific initialization.
  *
+ *  This code has not been tested with colors, colormap management functions
+ *  are minimal (no colormap data written to the 68328 registers...)
  *
- * This file is based on the Amiga frame buffer device (amifb.c):
+ *  initial version of this driver:
+ *    Copyright (C) 1998,1999 Kenneth Albanowski <kjahds@kjahds.com>,
+ *                            The Silver Hammer Group, Ltd.
  *
- *    Copyright (C) 1995 Geert Uytterhoeven
+ *  this version is based on :
  *
+ *  linux/drivers/video/vfb.c -- Virtual frame buffer device
  *
- * History:
- *   - 17 Feb 98: Original version by Kenneth Albanowski <kjahds@kjahds.com>
+ *      Copyright (C) 2002 James Simmons
  *
+ *	Copyright (C) 1997 Geert Uytterhoeven
  *
- * 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.
+ *  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.
  */
 
 #include <linux/module.h>
@@ -33,417 +34,452 @@
 #include <linux/mm.h>
 #include <linux/tty.h>
 #include <linux/slab.h>
+#include <linux/vmalloc.h>
 #include <linux/delay.h>
-#include <linux/config.h>
-#include <asm/segment.h>
-#include <asm/system.h>
-#include <asm/irq.h>
-#include <asm/pgtable.h>
+#include <linux/interrupt.h>
+#include <asm/uaccess.h>
 #include <linux/fb.h>
+#include <linux/init.h>
+
+#if defined(CONFIG_M68VZ328)
+#include <asm/MC68VZ328.h>
+#elif defined(CONFIG_M68EZ328)
+#include <asm/MC68EZ328.h>
+#elif defined(CONFIG_M68328)
+#include <asm/MC68328.h>
+#else
+#error wrong architecture for the MC68x328 frame buffer device
+#endif
 
-#define arraysize(x)    (sizeof(x)/sizeof(*(x)))
-
-static struct fb_info fb_info;
+#if defined(CONFIG_FB_68328_INVERT)
+#define MC68X328FB_MONO_VISUAL FB_VISUAL_MONO01
+#else
+#define MC68X328FB_MONO_VISUAL FB_VISUAL_MONO10
+#endif
 
-   /*
-    *    mc68328vision Graphics Board
-    */
+static u_long videomemory;
+static u_long videomemorysize;
 
-#define CYBER8_WIDTH 1152
-#define CYBER8_HEIGHT 886
-#define CYBER8_PIXCLOCK 12500	/* ++Geert: Just a guess */
+static struct fb_info fb_info;
+static u32 mc68x328fb_pseudo_palette[17];
+
+static struct fb_var_screeninfo mc68x328fb_default __initdata = {
+	.red =		{ 0, 8, 0 },
+      	.green =	{ 0, 8, 0 },
+      	.blue =		{ 0, 8, 0 },
+      	.activate =	FB_ACTIVATE_TEST,
+      	.height =	-1,
+      	.width =	-1,
+      	.pixclock =	20000,
+      	.left_margin =	64,
+      	.right_margin =	64,
+      	.upper_margin =	32,
+      	.lower_margin =	32,
+      	.hsync_len =	64,
+      	.vsync_len =	2,
+      	.vmode =	FB_VMODE_NONINTERLACED,
+};
 
-#define CYBER16_WIDTH 800
-#define CYBER16_HEIGHT 600
-#define CYBER16_PIXCLOCK 25000	/* ++Geert: Just a guess */
+static struct fb_fix_screeninfo mc68x328fb_fix __initdata = {
+	.id =		"68328fb",
+	.type =		FB_TYPE_PACKED_PIXELS,
+	.xpanstep =	1,
+	.ypanstep =	1,
+	.ywrapstep =	1,
+	.accel =	FB_ACCEL_NONE,
+};
 
-#define PALM_WIDTH 160
-#define PALM_HEIGHT 160
+    /*
+     *  Interface used by the world
+     */
+int mc68x328fb_init(void);
+int mc68x328fb_setup(char *);
+
+static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
+			 struct fb_info *info);
+static int mc68x328fb_set_par(struct fb_info *info);
+static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			 u_int transp, struct fb_info *info);
+static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
+			   struct fb_info *info);
+static int mc68x328fb_mmap(struct fb_info *info, struct file *file,
+		    struct vm_area_struct *vma);
+
+static struct fb_ops mc68x328fb_ops = {
+	.fb_check_var	= mc68x328fb_check_var,
+	.fb_set_par	= mc68x328fb_set_par,
+	.fb_setcolreg	= mc68x328fb_setcolreg,
+	.fb_pan_display	= mc68x328fb_pan_display,
+	.fb_fillrect	= cfb_fillrect,
+	.fb_copyarea	= cfb_copyarea,
+	.fb_imageblit	= cfb_imageblit,
+	.fb_cursor	= soft_cursor,
+	.fb_mmap	= mc68x328fb_mmap,
+};
 
-/*static int mc68328Key = 0;
-static u_char mc68328_colour_table [256][4];*/
+    /*
+     *  Internal routines
+     */
 
-   /*
-    *    Predefined Video Mode Names
-    */
+static u_long get_line_length(int xres_virtual, int bpp)
+{
+	u_long length;
 
-static char *mc68328_fb_modenames[] = {
+	length = xres_virtual * bpp;
+	length = (length + 31) & ~31;
+	length >>= 3;
+	return (length);
+}
 
-	/*
-	 *    Autodetect (Default) Video Mode
-	 */
+    /*
+     *  Setting the video mode has been split into two parts.
+     *  First part, xxxfb_check_var, must not write anything
+     *  to hardware, it should only verify and adjust var.
+     *  This means it doesn't alter par but it does use hardware
+     *  data from it to check this var. 
+     */
 
-	"default",
+static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
+			 struct fb_info *info)
+{
+	u_long line_length;
 
 	/*
-	 *    Predefined Video Modes
+	 *  FB_VMODE_CONUPDATE and FB_VMODE_SMOOTH_XPAN are equal!
+	 *  as FB_VMODE_SMOOTH_XPAN is only used internally
 	 */
 
-	"Palm",			/* Palm Pilot devices, 1.0 and higher */
-	"Palm Grey",		/* Palm Pilot devices, 1.0 and higher */
+	if (var->vmode & FB_VMODE_CONUPDATE) {
+		var->vmode |= FB_VMODE_YWRAP;
+		var->xoffset = info->var.xoffset;
+		var->yoffset = info->var.yoffset;
+	}
 
 	/*
-	 *    Dummy Video Modes
+	 *  Some very basic checks
 	 */
+	if (!var->xres)
+		var->xres = 1;
+	if (!var->yres)
+		var->yres = 1;
+	if (var->xres > var->xres_virtual)
+		var->xres_virtual = var->xres;
+	if (var->yres > var->yres_virtual)
+		var->yres_virtual = var->yres;
+	if (var->bits_per_pixel <= 1)
+		var->bits_per_pixel = 1;
+	else if (var->bits_per_pixel <= 8)
+		var->bits_per_pixel = 8;
+	else if (var->bits_per_pixel <= 16)
+		var->bits_per_pixel = 16;
+	else if (var->bits_per_pixel <= 24)
+		var->bits_per_pixel = 24;
+	else if (var->bits_per_pixel <= 32)
+		var->bits_per_pixel = 32;
+	else
+		return -EINVAL;
 
-	"dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
-	    "dummy",
-	"dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
-	    "dummy",
-	"dummy", "dummy", "dummy", "dummy",
+	if (var->xres_virtual < var->xoffset + var->xres)
+		var->xres_virtual = var->xoffset + var->xres;
+	if (var->yres_virtual < var->yoffset + var->yres)
+		var->yres_virtual = var->yoffset + var->yres;
 
 	/*
-	 *    User Defined Video Modes
-	 *
-	 *    This doesn't work yet!!
+	 *  Memory limit
 	 */
-
-	"user0", "user1", "user2", "user3", "user4", "user5", "user6",
-	    "user7"
-};
-
-
-   /*
-    *    Predefined Video Mode Definitions
-    */
-
-static struct fb_var_screeninfo mc68328_fb_predefined[] = {
+	line_length =
+	    get_line_length(var->xres_virtual, var->bits_per_pixel);
+	if (line_length * var->yres_virtual > videomemorysize)
+		return -ENOMEM;
 
 	/*
-	 *    Autodetect (Default) Video Mode
+	 * Now that we checked it we alter var. The reason being is that the video
+	 * mode passed in might not work but slight changes to it might make it 
+	 * work. This way we let the user know what is acceptable.
 	 */
+	switch (var->bits_per_pixel) {
+	case 1:
+	case 8:
+		var->red.offset = 0;
+		var->red.length = 8;
+		var->green.offset = 0;
+		var->green.length = 8;
+		var->blue.offset = 0;
+		var->blue.length = 8;
+		var->transp.offset = 0;
+		var->transp.length = 0;
+		break;
+	case 16:		/* RGBA 5551 */
+		if (var->transp.length) {
+			var->red.offset = 0;
+			var->red.length = 5;
+			var->green.offset = 5;
+			var->green.length = 5;
+			var->blue.offset = 10;
+			var->blue.length = 5;
+			var->transp.offset = 15;
+			var->transp.length = 1;
+		} else {	/* RGB 565 */
+			var->red.offset = 0;
+			var->red.length = 5;
+			var->green.offset = 5;
+			var->green.length = 6;
+			var->blue.offset = 11;
+			var->blue.length = 5;
+			var->transp.offset = 0;
+			var->transp.length = 0;
+		}
+		break;
+	case 24:		/* RGB 888 */
+		var->red.offset = 0;
+		var->red.length = 8;
+		var->green.offset = 8;
+		var->green.length = 8;
+		var->blue.offset = 16;
+		var->blue.length = 8;
+		var->transp.offset = 0;
+		var->transp.length = 0;
+		break;
+	case 32:		/* RGBA 8888 */
+		var->red.offset = 0;
+		var->red.length = 8;
+		var->green.offset = 8;
+		var->green.length = 8;
+		var->blue.offset = 16;
+		var->blue.length = 8;
+		var->transp.offset = 24;
+		var->transp.length = 8;
+		break;
+	}
+	var->red.msb_right = 0;
+	var->green.msb_right = 0;
+	var->blue.msb_right = 0;
+	var->transp.msb_right = 0;
 
-	{0,},
+	return 0;
+}
 
-	/*
-	 *    Predefined Video Modes
-	 */
+/* This routine actually sets the video mode. It's in here where we
+ * the hardware state info->par and fix which can be affected by the 
+ * change in par. For this driver it doesn't do much. 
+ */
+static int mc68x328fb_set_par(struct fb_info *info)
+{
+	info->fix.line_length = get_line_length(info->var.xres_virtual,
+						info->var.bits_per_pixel);
+	return 0;
+}
 
-	{
-	 /* Palm */
-	 PALM_WIDTH, PALM_HEIGHT, PALM_WIDTH, PALM_HEIGHT,
-	 0, 0,
-	 1, -1,
-	 {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 0, 0},
-	 0, 0,
-	 -1, -1,		/* phys height, width */
-	 FB_ACCEL_NONE,
-	 0, 0, 0, 0, 0, 0, 0,	/* timing */
-	 0,			/* sync */
-	 FB_VMODE_NONINTERLACED},
-	{
-	 /* Palm Grey */
-	 PALM_WIDTH, PALM_HEIGHT, PALM_WIDTH, PALM_HEIGHT,
-	 0, 0,
-	 2, -1,
-	 {0, 2, 0}, {0, 2, 0}, {0, 2, 0}, {0, 0, 0},
-	 0, 0,
-	 -1, -1,		/* phys height, width */
-	 FB_ACCEL_NONE,
-	 0, 0, 0, 0, 0, 0, 0,	/* timing */
-	 0,			/* sync */
-	 FB_VMODE_NONINTERLACED},
+    /*
+     *  Set a single color register. The values supplied are already
+     *  rounded down to the hardware's capabilities (according to the
+     *  entries in the var structure). Return != 0 for invalid regno.
+     */
 
+static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+			 u_int transp, struct fb_info *info)
+{
+	if (regno >= 256)	/* no. of hw registers */
+		return 1;
 	/*
-	 *    Dummy Video Modes
+	 * Program hardware... do anything you want with transp
 	 */
 
-	{0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,},
-	{0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,},
-	{0,}, {0,},
+	/* grayscale works only partially under directcolor */
+	if (info->var.grayscale) {
+		/* grayscale = 0.30*R + 0.59*G + 0.11*B */
+		red = green = blue =
+		    (red * 77 + green * 151 + blue * 28) >> 8;
+	}
 
-	/*
-	 *    User Defined Video Modes
+	/* Directcolor:
+	 *   var->{color}.offset contains start of bitfield
+	 *   var->{color}.length contains length of bitfield
+	 *   {hardwarespecific} contains width of RAMDAC
+	 *   cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
+	 *   RAMDAC[X] is programmed to (red, green, blue)
+	 * 
+	 * Pseudocolor:
+	 *    uses offset = 0 && length = RAMDAC register width.
+	 *    var->{color}.offset is 0
+	 *    var->{color}.length contains widht of DAC
+	 *    cmap is not used
+	 *    RAMDAC[X] is programmed to (red, green, blue)
+	 * Truecolor:
+	 *    does not use DAC. Usually 3 are present.
+	 *    var->{color}.offset contains start of bitfield
+	 *    var->{color}.length contains length of bitfield
+	 *    cmap is programmed to (red << red.offset) | (green << green.offset) |
+	 *                      (blue << blue.offset) | (transp << transp.offset)
+	 *    RAMDAC does not exist
 	 */
-
-	{0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,}, {0,}
-};
-
-static struct fb_fix_screeninfo mc68328_fix __initdata = {
-	.id		= "mc68328";
-	.smem_len 	= 160 * 160 /8;
-	.type 		= FB_TYPE_PACKED_PIXELS;
-	.accel 		= FB_ACCEL_NONE;
-};
-
-#define NUM_TOTAL_MODES    arraysize(mc68328_fb_predefined)
-#define NUM_PREDEF_MODES   (3)
-
-static int mc68328fb_inverse = 0;
-static int mc68328fb_mode = 0;
-static int mc68328fbCursorMode = 0;
-
-   /*
-    *    Some default modes
-    */
-
-#define PALM_DEFMODE     (1)
-#define CYBER16_DEFMODE    (2)
-
-   /*
-    *    Interface used by the world
-    */
-int mc68328_fb_init(void);
-
-static int mc68328fb_setcolreg(u_int regno, u_int red, u_int green,
-			       u_int blue, u_int transp);
-static void mc68328fb_blank(int blank, struct fb_info *info);
-
-   /*
-    *    Accelerated Functions used by the low level console driver
-    */
-
-void mc68328_WaitQueue(u_short fifo);
-void mc68328_WaitBlit(void);
-void mc68328_BitBLT(u_short curx, u_short cury, u_short destx,
-		    u_short desty, u_short width, u_short height,
-		    u_short mode);
-void mc68328_RectFill(u_short x, u_short y, u_short width, u_short height,
-		      u_short mode, u_short color);
-void mc68328_MoveCursor(u_short x, u_short y);
-
-   /*
-    *    Internal routines
-    */
-static int get_video_mode(const char *name);
-
-   /*
-    *    Set a single color register. The values supplied are already
-    *    rounded down to the hardware's capabilities (according to the
-    *    entries in the var structure). Return != 0 for invalid regno.
-    */
-
-static int mc68328fb_setcolreg(u_int regno, u_int red, u_int green,
-			       u_int blue, u_int transp)
-{
-	return 1;
-#if 0
-	if (regno > 255)
-		return (1);
-
-	*(mc68328Regs + 0x3c8) = (char) regno;
-	mc68328_colour_table[regno][0] = red & 0xff;
-	mc68328_colour_table[regno][1] = green & 0xff;
-	mc68328_colour_table[regno][2] = blue & 0xff;
-	mc68328_colour_table[regno][3] = transp;
-
-	*(mc68328Regs + 0x3c9) = (red & 0xff) >> 2;
-	*(mc68328Regs + 0x3c9) = (green & 0xff) >> 2;
-	*(mc68328Regs + 0x3c9) = (blue & 0xff) >> 2;
-
-	return (0);
-#endif
+#define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16)
+	switch (info->fix.visual) {
+	case FB_VISUAL_TRUECOLOR:
+	case FB_VISUAL_PSEUDOCOLOR:
+		red = CNVT_TOHW(red, info->var.red.length);
+		green = CNVT_TOHW(green, info->var.green.length);
+		blue = CNVT_TOHW(blue, info->var.blue.length);
+		transp = CNVT_TOHW(transp, info->var.transp.length);
+		break;
+	case FB_VISUAL_DIRECTCOLOR:
+		red = CNVT_TOHW(red, 8);	/* expect 8 bit DAC */
+		green = CNVT_TOHW(green, 8);
+		blue = CNVT_TOHW(blue, 8);
+		/* hey, there is bug in transp handling... */
+		transp = CNVT_TOHW(transp, 8);
+		break;
+	}
+#undef CNVT_TOHW
+	/* Truecolor has hardware independent palette */
+	if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
+		u32 v;
+
+		if (regno >= 16)
+			return 1;
+
+		v = (red << info->var.red.offset) |
+		    (green << info->var.green.offset) |
+		    (blue << info->var.blue.offset) |
+		    (transp << info->var.transp.offset);
+		switch (info->var.bits_per_pixel) {
+		case 8:
+			break;
+		case 16:
+			((u32 *) (info->pseudo_palette))[regno] = v;
+			break;
+		case 24:
+		case 32:
+			((u32 *) (info->pseudo_palette))[regno] = v;
+			break;
+		}
+		return 0;
+	}
+	return 0;
 }
 
-   /*
-    *    (Un)Blank the screen
-    */
+    /*
+     *  Pan or Wrap the Display
+     *
+     *  This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
+     */
 
-static void mc68328fb_blank(int blank, struct fb_info *info)
+static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
+			   struct fb_info *info)
 {
-#if 0
-	if (blank)
-		(*(volatile unsigned char *) 0xFFFFFA27) &= ~128;
+	if (var->vmode & FB_VMODE_YWRAP) {
+		if (var->yoffset < 0
+		    || var->yoffset >= info->var.yres_virtual
+		    || var->xoffset)
+			return -EINVAL;
+	} else {
+		if (var->xoffset + var->xres > info->var.xres_virtual ||
+		    var->yoffset + var->yres > info->var.yres_virtual)
+			return -EINVAL;
+	}
+	info->var.xoffset = var->xoffset;
+	info->var.yoffset = var->yoffset;
+	if (var->vmode & FB_VMODE_YWRAP)
+		info->var.vmode |= FB_VMODE_YWRAP;
 	else
-		(*(volatile unsigned char *) 0xFFFFFA27) |= 128;
-#endif
-}
-
-
-/**************************************************************
- * We are waiting for "fifo" FIFO-slots empty
- */
-void mc68328_WaitQueue(u_short fifo)
-{
+		info->var.vmode &= ~FB_VMODE_YWRAP;
+	return 0;
 }
 
-/**************************************************************
- * We are waiting for Hardware (Graphics Engine) not busy
- */
-void mc68328_WaitBlit(void)
-{
-}
+    /*
+     *  Most drivers don't need their own mmap function 
+     */
 
-/**************************************************************
- * BitBLT - Through the Plane
- */
-void mc68328_BitBLT(u_short curx, u_short cury, u_short destx,
-		    u_short desty, u_short width, u_short height,
-		    u_short mode)
+static int mc68x328fb_mmap(struct fb_info *info, struct file *file,
+		    struct vm_area_struct *vma)
 {
-#if 0
-	u_short blitcmd = S3_BITBLT;
-
-/* Set drawing direction */
-/* -Y, X maj, -X (default) */
-	if (curx > destx)
-		blitcmd |= 0x0020;	/* Drawing direction +X */
-	else {
-		curx += (width - 1);
-		destx += (width - 1);
-	}
-
-	if (cury > desty)
-		blitcmd |= 0x0080;	/* Drawing direction +Y */
-	else {
-		cury += (height - 1);
-		desty += (height - 1);
-	}
-
-	mc68328_WaitQueue(0x8000);
-
-	*((u_short volatile *) (mc68328Regs + S3_PIXEL_CNTL)) = 0xa000;
-	*((u_short volatile *) (mc68328Regs + S3_FRGD_MIX)) =
-	    (0x0060 | mode);
-
-	*((u_short volatile *) (mc68328Regs + S3_CUR_X)) = curx;
-	*((u_short volatile *) (mc68328Regs + S3_CUR_Y)) = cury;
+#ifndef MMU
+	/* this is uClinux (no MMU) specific code */
 
-	*((u_short volatile *) (mc68328Regs + S3_DESTX_DIASTP)) = destx;
-	*((u_short volatile *) (mc68328Regs + S3_DESTY_AXSTP)) = desty;
+	vma->vm_flags |= VM_RESERVED;
+	vma->vm_start = videomemory;
 
-	*((u_short volatile *) (mc68328Regs + S3_MIN_AXIS_PCNT)) =
-	    height - 1;
-	*((u_short volatile *) (mc68328Regs + S3_MAJ_AXIS_PCNT)) =
-	    width - 1;
-
-	*((u_short volatile *) (mc68328Regs + S3_CMD)) = blitcmd;
+	return 0;
+#else
+	return -EINVAL;
 #endif
 }
 
-/**************************************************************
- * Rectangle Fill Solid
- */
-void mc68328_RectFill(u_short x, u_short y, u_short width, u_short height,
-		      u_short mode, u_short color)
+int __init mc68x328fb_setup(char *options)
 {
 #if 0
-	u_short blitcmd = S3_FILLEDRECT;
-
-	mc68328_WaitQueue(0x8000);
-
-	*((u_short volatile *) (mc68328Regs + S3_PIXEL_CNTL)) = 0xa000;
-	*((u_short volatile *) (mc68328Regs + S3_FRGD_MIX)) =
-	    (0x0020 | mode);
-
-	*((u_short volatile *) (mc68328Regs + S3_MULT_MISC)) = 0xe000;
-	*((u_short volatile *) (mc68328Regs + S3_FRGD_COLOR)) = color;
-
-	*((u_short volatile *) (mc68328Regs + S3_CUR_X)) = x;
-	*((u_short volatile *) (mc68328Regs + S3_CUR_Y)) = y;
-
-	*((u_short volatile *) (mc68328Regs + S3_MIN_AXIS_PCNT)) =
-	    height - 1;
-	*((u_short volatile *) (mc68328Regs + S3_MAJ_AXIS_PCNT)) =
-	    width - 1;
-
-	*((u_short volatile *) (mc68328Regs + S3_CMD)) = blitcmd;
+	char *this_opt;
 #endif
-}
 
-
-/**************************************************************
- * Move cursor to x, y
- */
-void mc68328_MoveCursor(u_short x, u_short y)
-{
-	(*(volatile unsigned short *) 0xFFFFFA18) =
-	    (mc68328fbCursorMode << 14) | x;
-	(*(volatile unsigned short *) 0xFFFFFA1A) = y;
+	if (!options || !*options)
+		return 1;
 #if 0
-	*(mc68328Regs + S3_CRTC_ADR) = 0x39;
-	*(mc68328Regs + S3_CRTC_DATA) = 0xa0;
-
-	*(mc68328Regs + S3_CRTC_ADR) = S3_HWGC_ORGX_H;
-	*(mc68328Regs + S3_CRTC_DATA) = (char) ((x & 0x0700) >> 8);
-	*(mc68328Regs + S3_CRTC_ADR) = S3_HWGC_ORGX_L;
-	*(mc68328Regs + S3_CRTC_DATA) = (char) (x & 0x00ff);
-
-	*(mc68328Regs + S3_CRTC_ADR) = S3_HWGC_ORGY_H;
-	*(mc68328Regs + S3_CRTC_DATA) = (char) ((y & 0x0700) >> 8);
-	*(mc68328Regs + S3_CRTC_ADR) = S3_HWGC_ORGY_L;
-	*(mc68328Regs + S3_CRTC_DATA) = (char) (y & 0x00ff);
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt)
+			continue;
+		if (!strncmp(this_opt, "disable", 7))
+			mc68x328fb_enable = 0;
+	}
 #endif
+	return 1;
 }
 
-/* -------------------- Generic routines ------------------------------------ */
-
-   /*
-    *    Default Colormaps
-    */
-
-static u_short red16[] =
-    { 0xc000, 0x0000, 0x0000, 0x0000, 0xc000, 0xc000, 0xc000, 0x0000,
-	0x8000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff
-};
-static u_short green16[] =
-    { 0xc000, 0x0000, 0xc000, 0xc000, 0x0000, 0x0000, 0xc000, 0x0000,
-	0x8000, 0x0000, 0xffff, 0xffff, 0x0000, 0x0000, 0xffff, 0xffff
-};
-static u_short blue16[] =
-    { 0xc000, 0x0000, 0x0000, 0xc000, 0x0000, 0xc000, 0x0000, 0x0000,
-	0x8000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff
-};
-
+    /*
+     *  Initialisation
+     */
 
-static struct fb_cmap default_16_colors =
-    { 0, 16, red16, green16, blue16, NULL };
-
-
-static struct fb_cmap *get_default_colormap(int bpp)
+int __init mc68x328fb_init(void)
 {
-	return (&default_16_colors);
-}
-
-
-#define CNVT_TOHW(val,width)     ((((val)<<(width))+0x7fff-(val))>>16)
-#define CNVT_FROMHW(val,width)   (((width) ? ((((val)<<16)-(val)) / \
-                                              ((1<<(width))-1)) : 0))
-
-static struct fb_ops mc68328_fb_ops = {
-	.owner		= THIS_MODULE,
-	.fb_setcolreg	= mc68328fb_setcolreg,
-	.fb_fillrect	= cfbfillrect,
-	.fb_copyarea	= cfbcopyarea,
-	.fb_imageblit	= cfbimgblt,
-	.fb_cursor	= softcursor,
-};
-
+	/*
+	 *  initialize the default mode from the LCD controller registers
+	 */
+	mc68x328fb_default.xres = LXMAX;
+	mc68x328fb_default.yres = LYMAX+1;
+	mc68x328fb_default.xres_virtual = mc68x328fb_default.xres;
+	mc68x328fb_default.yres_virtual = mc68x328fb_default.yres;
+	mc68x328fb_default.bits_per_pixel = 1 + (LPICF & 0x01);
+	videomemory = LSSA;
+	videomemorysize = (mc68x328fb_default.xres_virtual+7) / 8 *
+		mc68x328fb_default.yres_virtual * mc68x328fb_default.bits_per_pixel;
+
+	fb_info.screen_base = (void *)videomemory;
+	fb_info.fbops = &mc68x328fb_ops;
+	fb_info.var = mc68x328fb_default;
+	fb_info.fix = mc68x328fb_fix;
+	fb_info.fix.smem_start = videomemory;
+	fb_info.fix.smem_len = videomemorysize;
+	fb_info.fix.line_length =
+		get_line_length(mc68x328fb_default.xres_virtual, mc68x328fb_default.bits_per_pixel);
+	fb_info.fix.visual = (mc68x328fb_default.bits_per_pixel) == 1 ?
+		MC68X328FB_MONO_VISUAL : FB_VISUAL_PSEUDOCOLOR;
+	fb_info.pseudo_palette = &mc68x328fb_pseudo_palette;
+	fb_info.flags = FBINFO_FLAG_DEFAULT;
+
+	fb_alloc_cmap(&fb_info.cmap, 256, 0);
+
+	if (register_framebuffer(&fb_info) < 0) {
+		return -EINVAL;
+	}
 
-   /*
-    *    Initialization
-    */
+	printk(KERN_INFO
+		"fb%d: %s frame buffer device\n", fb_info.node,	fb_info.fix.id);
+	printk(KERN_INFO
+		"fb%d: %dx%dx%d at 0x%08lx\n", fb_info.node,
+		mc68x328fb_default.xres_virtual, mc68x328fb_default.yres_virtual,
+		1 << mc68x328fb_default.bits_per_pixel, videomemory);
 
-int __init mc68328_fb_init(void)
-{
-	if (mc68328fb_mode == -1)
-		mc68328fb_mode = PALM_DEFMODE;
-	mc68328_fix.smem_start = (*(volatile unsigned long *) 0xFFFFFA00);
-	/*kernel_map (board_addr + 0x01400000, 0x00400000, */
-	
-	info->var = mc68328_fb_predefined[mc68328fb_mode];
-	
-	if (info->var.bits_per_pixel == 1)
-		fix->visual = FB_VISUAL_MONO01;
-	else
-		fix->visual = FB_VISUAL_DIRECTCOLOR;
-	info->screen_base = (u_char *) mc68328_fix.smem_start;
-	
-	if (register_framebuffer(&fb_info) < 0)
-		panic("Cannot register frame buffer\n");
 	return 0;
 }
 
-   /*
-    *    Get a Video Mode
-    */
+#ifdef MODULE
 
-static int get_video_mode(const char *name)
+static void __exit mc68x328fb_cleanup(void)
 {
-	int i;
-
-	for (i = 1; i < NUM_PREDEF_MODES; i++)
-		if (!strcmp(name, mc68328_fb_modenames[i]))
-			return (i);
-	return (0);
+	unregister_framebuffer(&fb_info);
 }
+
+module_init(mc68x328fb_init);
+module_exit(mc68x328fb_cleanup);
+
+MODULE_LICENSE("GPL");
+#endif				/* MODULE */
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 47be65081..4d58fc501 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -225,6 +225,10 @@ config FB_CT65550
 	  This is the frame buffer device driver for the Chips & Technologies
 	  65550 graphics chip in PowerBooks.
 
+config FB_ASILIANT
+	bool "Chips 69000 display support"
+	depends on FB && PCI
+
 config FB_IMSTT
 	bool "IMS Twin Turbo display support"
 	depends on FB && PCI
@@ -308,6 +312,14 @@ config FB_HGA
 	  As this card technology is 15 years old, most people will answer N
 	  here.
 
+config FB_HGA_ACCEL
+	bool "Hercules mono Acceleration functions (EXPERIMENTAL)"
+	depends on FB_HGA && EXPERIMENTAL
+	---help---
+	This will compile the Hercules mono graphics with
+	acceleration functions.
+
+
 config VIDEO_SELECT
 	bool
 	depends on FB && X86
@@ -319,6 +331,21 @@ config FB_SGIVW
 	help
 	  SGI Visual Workstation support for framebuffer graphics.
 
+config FB_GBE
+	bool "SGI Graphics Backend frame buffer support"
+	depends on FB && (SGI_IP32 || X86_VISWS)
+ 	help
+	  This is the frame buffer device driver for SGI Graphics Backend.
+	  This chip is used in SGI O2 and Visual Workstation 320/540.
+
+config FB_GBE_MEM
+	int "Video memory size in MB"
+	depends on FB_GBE
+	default 8
+	help
+	  This is the amount of memory reserved for the framebuffer,
+	  which can be any value between 1MB and 8MB.
+
 config BUS_I2C
 	bool
 	depends on FB && VISWS
@@ -743,6 +770,14 @@ config FB_3DFX
 	  To compile this driver as a module, choose M here: the
 	  module will be called tdfxfb.
 
+config FB_3DFX_ACCEL
+	bool "3Dfx Banshee/Voodoo3 Acceleration functions (EXPERIMENTAL)"
+	depends on FB_3DFX && EXPERIMENTAL
+	---help---
+	This will compile the 3Dfx Banshee/Voodoo3 frame buffer device
+	with acceleration functions.
+
+
 config FB_VOODOO1
 	tristate "3Dfx Voodoo Graphics (sst1) support"
 	depends on FB && PCI
@@ -772,6 +807,14 @@ config FB_TRIDENT
 	  To compile this driver as a module, choose M here: the
 	  module will be called tridentfb.
 
+config FB_TRIDENT_ACCEL
+	bool "Trident Acceleration functions (EXPERIMENTAL)"
+	depends on FB_TRIDENT && EXPERIMENTAL
+	---help---
+	This will compile the Trident frame buffer device with
+	acceleration functions.
+
+
 config FB_PM3
 	tristate "Permedia3 support"
 	depends on FB && PCI && BROKEN
@@ -880,6 +923,37 @@ config FB_68328
 	  Say Y here if you want to support the built-in frame buffer of
 	  the Motorola 68328 CPU family.
 
+config FB_PXA
+	tristate "PXA LCD framebuffer support"
+	depends on FB && ARCH_PXA
+	---help---
+	  Frame buffer driver for the built-in LCD controller in the Intel
+	  PXA2x0 processor.
+
+	  This driver is also available as a module ( = code which can be
+	  inserted and removed from the running kernel whenever you want). The
+	  module will be called vfb. If you want to compile it as a module,
+	  say M here and read <file:Documentation/modules.txt>.
+
+	  If unsure, say N.
+
+config FB_PXA_PARAMETERS
+	bool "PXA LCD command line parameters"
+	default n
+	depends on FB_PXA
+	---help---
+	  Enable the use of kernel command line or module parameters
+	  to configure the physical properties of the LCD panel when
+	  using the PXA LCD driver.
+
+	  This option allows you to override the panel parameters
+	  supplied by the platform in order to support multiple
+	  different models of flatpanel. If you will only be using a
+	  single model of flatpanel then you can safely leave this
+	  option disabled.
+
+	  Documentation/fb/pxafb.txt describes the available parameters.
+
 config FB_VIRTUAL
 	tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)"
 	depends on FB
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 5876a9019..22644fc8d 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -20,9 +20,9 @@ obj-$(CONFIG_FB_PM3)		  += pm3fb.o
 obj-$(CONFIG_FB_APOLLO)           += dnfb.o cfbfillrect.o cfbimgblt.o
 obj-$(CONFIG_FB_Q40)              += q40fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_ATARI)            += atafb.o
-obj-$(CONFIG_FB_68328)            += 68328fb.o
+obj-$(CONFIG_FB_68328)            += 68328fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_RADEON_OLD)	  += radeonfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
-obj-$(CONFIG_FB_NEOMAGIC)         += neofb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
+obj-$(CONFIG_FB_NEOMAGIC)         += neofb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o vgastate.o
 obj-$(CONFIG_FB_IGA)              += igafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_CONTROL)          += controlfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_PLATINUM)         += platinumfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
@@ -31,6 +31,7 @@ obj-$(CONFIG_FB_CT65550)          += chipsfb.o cfbfillrect.o cfbcopyarea.o cfbim
 obj-$(CONFIG_FB_CLPS711X)         += clps711xfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_CYBER)            += cyberfb.o
 obj-$(CONFIG_FB_CYBER2000)        += cyber2000fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
+obj-$(CONFIG_FB_GBE)              += gbefb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_SGIVW)            += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_3DFX)             += tdfxfb.o cfbimgblt.o
 obj-$(CONFIG_FB_MAC)              += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o 
@@ -72,6 +73,7 @@ obj-$(CONFIG_FB_E1355)            += epson1355fb.o
 obj-$(CONFIG_FB_PVR2)             += pvr2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_KYRO)             += kyro/ cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_VOODOO1)          += sstfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
+obj-$(CONFIG_FB_ASILIANT)	  += asiliantfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 
 obj-$(CONFIG_FB_FFB)               += ffb.o sbuslib.o cfbimgblt.o cfbcopyarea.o
 obj-$(CONFIG_FB_CG6)               += cg6.o sbuslib.o cfbimgblt.o cfbcopyarea.o
@@ -87,4 +89,4 @@ obj-$(CONFIG_FB_TCX)               += tcx.o sbuslib.o cfbimgblt.o cfbcopyarea.o
 				      cfbfillrect.o
 obj-$(CONFIG_FB_LEO)               += leo.o sbuslib.o cfbimgblt.o cfbcopyarea.o \
 				      cfbfillrect.o
-
+obj-$(CONFIG_FB_PXA)		   += pxafb.o cfbimgblt.o cfbcopyarea.o cfbfillrect.o
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index add29728e..15ec1295b 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -2819,8 +2819,6 @@ int __init atafb_init(void)
 	       fb_info.node, fb_info.modename, screen_len>>10);
 
 	/* TODO: This driver cannot be unloaded yet */
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -3097,13 +3095,4 @@ int init_module(void)
 {
 	return atafb_init();
 }
-
-void cleanup_module(void)
-{
-	/* Not reached because the usecount will never
-	   be decremented to zero */
-	unregister_framebuffer(&fb_info);
-	/* atari_stram_free( screen_base ); */
-	/* TODO: further clean up ... */
-}
 #endif /* MODULE */
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index a6ef46758..5e7c2d28a 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -1231,10 +1231,7 @@ static void atyfb_palette(int enter)
 
 	for (i = 0; i < FB_MAX; i++) {
 		info = registered_fb[i];
-		if (info &&
-		    info->fbops == &atyfb_ops &&
-		    info->display_fg &&
-		    info->display_fg->vc_num == i) {
+		if (info && info->fbops == &atyfb_ops) {
 			par = (struct atyfb_par *) info->par;
 			
 			atyfb_save_palette(par, enter);
@@ -1941,6 +1938,19 @@ int __init atyfb_init(void)
 			if (i < 0)
 				continue;
 
+			rp = &pdev->resource[0];
+			if (rp->flags & IORESOURCE_IO)
+				rp = &pdev->resource[1];
+			addr = rp->start;
+			if (!addr)
+				continue;
+
+			res_start = rp->start;
+			res_size = rp->end - rp->start + 1;
+			if (!request_mem_region
+			    (res_start, res_size, "atyfb"))
+				continue;
+
 			info =
 			    kmalloc(sizeof(struct fb_info), GFP_ATOMIC);
 			if (!info) {
@@ -1963,19 +1973,6 @@ int __init atyfb_init(void)
 			info->fix = atyfb_fix;
 			info->par = default_par;
 
-			rp = &pdev->resource[0];
-			if (rp->flags & IORESOURCE_IO)
-				rp = &pdev->resource[1];
-			addr = rp->start;
-			if (!addr)
-				continue;
-
-			res_start = rp->start;
-			res_size = rp->end - rp->start + 1;
-			if (!request_mem_region
-			    (res_start, res_size, "atyfb"))
-				continue;
-
 #ifdef __sparc__
 			/*
 			 * Map memory-mapped registers.
@@ -2003,6 +2000,7 @@ int __init atyfb_init(void)
 			if (!default_par->mmap_map) {
 				printk
 				    ("atyfb_init: can't alloc mmap_map\n");
+				kfree(default_par);
 				kfree(info);
 				release_mem_region(res_start, res_size);
 				return -ENXIO;
@@ -2220,6 +2218,9 @@ int __init atyfb_init(void)
 			    ioremap(info->fix.mmio_start, 0x1000);
 
 			if (!default_par->ati_regbase) {
+#ifdef __sparc__
+				kfree(default_par->mmap_map);
+#endif
 				kfree(default_par);
 				kfree(info);
 				release_mem_region(res_start, res_size);
@@ -2250,6 +2251,10 @@ int __init atyfb_init(void)
 			    (char *) ioremap(addr, 0x800000);
 
 			if (!info->screen_base) {
+#ifdef __sparc__
+				kfree(default_par->mmap_map);
+#endif
+				kfree(default_par);
 				kfree(info);
 				release_mem_region(res_start, res_size);
 				return -ENXIO;
@@ -2261,6 +2266,7 @@ int __init atyfb_init(void)
 				if (default_par->mmap_map)
 					kfree(default_par->mmap_map);
 #endif
+				kfree(default_par);
 				kfree(info);
 				release_mem_region(res_start, res_size);
 				return -ENXIO;
@@ -2329,6 +2335,7 @@ int __init atyfb_init(void)
 		memset(default_par, 0, sizeof(struct atyfb_par));
 
 		info->fix = atyfb_fix;
+		info->par = default_par;
 
 		/*
 		 *  Map the video memory (physical address given) to somewhere in the
@@ -2360,6 +2367,7 @@ int __init atyfb_init(void)
 		}
 
 		if (!aty_init(info, "ISA bus")) {
+			kfree(default_par);
 			kfree(info);
 			/* This is insufficient! kernel_map has added two large chunks!! */
 			return -ENXIO;
diff --git a/drivers/video/aty/radeon_accel.c b/drivers/video/aty/radeon_accel.c
index c662e35c4..82614b4b4 100644
--- a/drivers/video/aty/radeon_accel.c
+++ b/drivers/video/aty/radeon_accel.c
@@ -13,7 +13,10 @@ static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo,
 		rinfo->dp_gui_master_cntl  /* contains, like GMC_DST_32BPP */
                 | GMC_BRUSH_SOLID_COLOR
                 | ROP3_P);
-	OUTREG(DP_BRUSH_FRGD_CLR, region->color);
+	if (radeon_get_dstbpp(rinfo->depth) != DST_8BPP)
+		OUTREG(DP_BRUSH_FRGD_CLR, rinfo->pseudo_palette[region->color]);
+	else
+		OUTREG(DP_BRUSH_FRGD_CLR, region->color);
 	OUTREG(DP_WRITE_MSK, 0xffffffff);
 	OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
 
@@ -53,6 +56,18 @@ void radeonfb_fillrect(struct fb_info *info, const struct fb_fillrect *region)
 static void radeonfb_prim_copyarea(struct radeonfb_info *rinfo, 
 				   const struct fb_copyarea *area)
 {
+	int xdir, ydir;
+	u32 sx, sy, dx, dy, w, h;
+
+	w = area->width; h = area->height;
+	dx = area->dx; dy = area->dy;
+	sx = area->sx; sy = area->sy;
+	xdir = sx - dx;
+	ydir = sy - dy;
+
+	if ( xdir < 0 ) { sx += w-1; dx += w-1; }
+	if ( ydir < 0 ) { sy += h-1; dy += h-1; }
+
 	radeon_fifo_wait(3);
 	OUTREG(DP_GUI_MASTER_CNTL,
 		rinfo->dp_gui_master_cntl /* i.e. GMC_DST_32BPP */
@@ -60,12 +75,13 @@ static void radeonfb_prim_copyarea(struct radeonfb_info *rinfo,
 		| ROP3_S 
 		| DP_SRC_RECT );
 	OUTREG(DP_WRITE_MSK, 0xffffffff);
-	OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
+	OUTREG(DP_CNTL, (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0)
+			| (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
 
 	radeon_fifo_wait(3);
-	OUTREG(SRC_Y_X, (area->sy << 16) | area->sx);
-	OUTREG(DST_Y_X, (area->dy << 16) | area->dx);
-	OUTREG(DST_HEIGHT_WIDTH, (area->height << 16) | area->width);
+	OUTREG(SRC_Y_X, (sy << 16) | sx);
+	OUTREG(DST_Y_X, (dy << 16) | dx);
+	OUTREG(DST_HEIGHT_WIDTH, (h << 16) | w);
 }
 
 
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index a00d86c66..d88079eb9 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -1144,6 +1144,7 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
 
 	/* Set PPLL ref. div */
 	if (rinfo->family == CHIP_FAMILY_R300 ||
+	    rinfo->family == CHIP_FAMILY_RS300 ||
 	    rinfo->family == CHIP_FAMILY_R350 ||
 	    rinfo->family == CHIP_FAMILY_RV350) {
 		if (mode->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) {
@@ -1184,7 +1185,7 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
 		~(PPLL_RESET | PPLL_SLEEP | PPLL_ATOMIC_UPDATE_EN | PPLL_VGA_ATOMIC_UPDATE_EN));
 
 	/* We may want some locking ... oh well */
-       	wait_ms(5);
+       	msleep(5);
 
 	/* Switch back VCLK source to PPLL */
 	OUTPLLP(VCLK_ECP_CNTL, VCLK_SRC_SEL_PPLLCLK, ~VCLK_SRC_SEL_MASK);
@@ -1783,7 +1784,6 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
 	info->pseudo_palette = rinfo->pseudo_palette;
         info->flags = FBINFO_FLAG_DEFAULT;
         info->fbops = &radeonfb_ops;
-        info->display_fg = NULL;
         info->screen_base = (char *)rinfo->fb_base;
 
 	/* Fill fix common fields */
@@ -1855,7 +1855,8 @@ static int radeon_set_backlight_enable(int on, int level, void *data)
 	     rinfo->family == CHIP_FAMILY_RV280 ||
 	     rinfo->family == CHIP_FAMILY_RV350) &&
 	    !machine_is_compatible("PowerBook4,3") &&
-	    !machine_is_compatible("PowerBook6,3"))
+	    !machine_is_compatible("PowerBook6,3") &&
+	    !machine_is_compatible("PowerBook6,5"))
 		conv_table = backlight_conv_m7;
 	else
 		conv_table = backlight_conv_m6;
@@ -1865,7 +1866,7 @@ static int radeon_set_backlight_enable(int on, int level, void *data)
 	lvds_gen_cntl |= (LVDS_BL_MOD_EN | LVDS_BLON);
 	if (on && (level > BACKLIGHT_OFF)) {
 		lvds_gen_cntl |= LVDS_DIGON;
-		if (!lvds_gen_cntl & LVDS_ON) {
+		if (!(lvds_gen_cntl & LVDS_ON)) {
 			lvds_gen_cntl &= ~LVDS_BLON;
 			OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
 			(void)INREG(LVDS_GEN_CNTL);
@@ -2129,7 +2130,31 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
 #endif /* CONFIG_PPC_OF */
 
 	/* framebuffer size */
-	tmp = INREG(CONFIG_MEMSIZE);
+        if ((rinfo->family == CHIP_FAMILY_RS100) ||
+            (rinfo->family == CHIP_FAMILY_RS200) ||
+            (rinfo->family == CHIP_FAMILY_RS300)) {
+          u32 tom = INREG(NB_TOM);
+          tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
+ 
+          OUTREG(MC_FB_LOCATION, tom);
+          OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
+          OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
+          OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16);
+ 
+          /* This is supposed to fix the crtc2 noise problem. */
+          OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000);
+ 
+          if ((rinfo->family == CHIP_FAMILY_RS100) ||
+              (rinfo->family == CHIP_FAMILY_RS200)) {
+             /* This is to workaround the asic bug for RMX, some versions
+                of BIOS dosen't have this register initialized correctly.
+             */
+             OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN,
+                     ~CRTC_H_CUTOFF_ACTIVE_EN);
+          }
+        } else {
+          tmp = INREG(CONFIG_MEMSIZE);
+        }
 
 	/* mem size is bits [28:0], mask off the rest */
 	rinfo->video_ram = tmp & CONFIG_MEMSIZE_MASK;
@@ -2204,6 +2229,7 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
 			rinfo->mapped_vram /= 2;
 			continue;
 		}
+		memset_io(rinfo->fb_base, 0, rinfo->mapped_vram);
 		break;
 	}
 
diff --git a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c
index af351c023..e87ef153d 100644
--- a/drivers/video/aty/radeon_i2c.c
+++ b/drivers/video/aty/radeon_i2c.c
@@ -189,12 +189,12 @@ int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 **out_e
 		 */
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(13);
+		msleep(13);
 
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
 		for (j = 0; j < 5; j++) {
-			wait_ms(10);
+			msleep(10);
 			if (INREG(reg) & VGA_DDC_CLK_INPUT)
 				break;
 		}
@@ -203,13 +203,13 @@ int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 **out_e
 
 		OUTREG(reg, INREG(reg) | VGA_DDC_DATA_OUT_EN);
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		OUTREG(reg, INREG(reg) | VGA_DDC_CLK_OUT_EN);
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 
 		/* Do the real work */
 		edid = radeon_do_probe_i2c_edid(&rinfo->i2c[conn-1]);
@@ -217,19 +217,19 @@ int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 **out_e
 		OUTREG(reg, INREG(reg) | 
 				(VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
 		for (j = 0; j < 10; j++) {
-			wait_ms(10);
+			msleep(10);
 			if (INREG(reg) & VGA_DDC_CLK_INPUT)
 				break;
 		}
 
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		OUTREG(reg, INREG(reg) |
 				(VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index e93e94c5c..94ff455d0 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -653,7 +653,8 @@ static void radeon_fixup_panel_info(struct radeonfb_info *rinfo)
 		rinfo->panel_info.use_bios_dividers = 1;
 	}
 	/* iBook G4 */
-	if (machine_is_compatible("PowerBook6,3")) {
+        if (machine_is_compatible("PowerBook6,3") |
+            machine_is_compatible("PowerBook6,5")) {
 		rinfo->panel_info.ref_divider = rinfo->pll.ref_div;
 		rinfo->panel_info.post_divider = 0x6;
 		rinfo->panel_info.fbk_divider = 0xad;
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index 8bc80fa6f..c5e37bdbb 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -867,7 +867,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, u32 state)
 	}
 
 	/* Blank display and LCD */
-	radeonfb_blank(VESA_POWERDOWN+1, info);
+	radeonfb_blank(VESA_POWERDOWN, info);
 
 	/* Sleep */
 	rinfo->asleep = 1;
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index a316e826f..dd26c0242 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -223,8 +223,6 @@ struct radeon_regs {
 
        	/* Palette */
 	int		palette_valid;
-	u32		palette[256];
-	u32		palette2[256];
 };
 
 struct panel_info {
@@ -440,15 +438,6 @@ static inline u32 _INPLL(struct radeonfb_info *rinfo, u32 addr)
 /*
  * Inline utilities
  */
-
-static inline void wait_ms(unsigned long ms)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout((ms * HZ + 999) / 1000);
-}
-
-
-
 static inline int round_div(int num, int den)
 {
         return (num + (den / 2)) / den;
diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
index f9c8f7a6d..bfdd40665 100644
--- a/drivers/video/console/Makefile
+++ b/drivers/video/console/Makefile
@@ -19,7 +19,7 @@ font-objs += $(font-objs-y)
 # Each configuration option enables a list of files.
 
 obj-$(CONFIG_DUMMY_CONSOLE)       += dummycon.o
-obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
+obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o font.o
 obj-$(CONFIG_PROM_CONSOLE)        += promcon.o promcon_tbl.o
 obj-$(CONFIG_STI_CONSOLE)         += sticon.o sticore.o
 obj-$(CONFIG_VGA_CONSOLE)         += vgacon.o
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index 1fd54dc42..cbe338681 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -11,6 +11,7 @@
 #include <linux/console.h>
 #include <linux/vt_kern.h>
 #include <linux/init.h>
+#include <linux/module.h>
 
 /*
  *  Dummy console driver
@@ -58,6 +59,7 @@ static int dummycon_dummy(void)
  */
 
 const struct consw dummy_con = {
+    .owner =		THIS_MODULE,
     .con_startup =	dummycon_startup,
     .con_init =		dummycon_init,
     .con_deinit =	DUMMY,
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index c5dc7ddb7..d0f9920c2 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -115,6 +115,8 @@ static int softback_lines;
 static int first_fb_vc;
 static int last_fb_vc = MAX_NR_CONSOLES - 1;
 static int fbcon_is_default = 1; 
+/* font data */
+static char fontname[40];
 
 #define REFCOUNT(fd)	(((int *)(fd))[-1])
 #define FNTSIZE(fd)	(((int *)(fd))[-2])
@@ -168,9 +170,7 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines);
 /*
  *  Internal routines
  */
-static void fbcon_set_display(struct vc_data *vc, int init, int logo);
 static __inline__ int real_y(struct display *p, int ypos);
-static __inline__ void updatescrollmode(struct display *p, struct vc_data *vc);
 static __inline__ void ywrap_up(struct vc_data *vc, int count);
 static __inline__ void ywrap_down(struct vc_data *vc, int count);
 static __inline__ void ypan_up(struct vc_data *vc, int count);
@@ -233,18 +233,15 @@ static void cursor_timer_handler(unsigned long dev_addr)
 
 int __init fb_console_setup(char *this_opt)
 {
-	int unit, i, j;
 	char *options;
+	int i, j;
 
 	if (!this_opt || !*this_opt)
 		return 0;
 
 	while ((options = strsep(&this_opt, ",")) != NULL) {
-		if (!strncmp(options, "font:", 5)) {
-			for (unit = 0; unit < MAX_NR_CONSOLES; unit++)
-				strcpy(fb_display[unit].fontname,
-				       options + 5);
-		}
+		if (!strncmp(options, "font:", 5))
+			strcpy(fontname, options + 5);
 		
 		if (!strncmp(options, "scrollback:", 11)) {
 			options += 11;
@@ -304,8 +301,7 @@ int set_con2fb_map(int unit, int newidx)
 		return -ENODEV;
 	con2fb_map[unit] = newidx;
 	fbcon_is_default = (vc->vc_sw == &fb_con) ? 1 : 0;
-	take_over_console(&fb_con, unit, unit, fbcon_is_default);
-	return 0;
+	return take_over_console(&fb_con, unit, unit, fbcon_is_default);
 }
 
 /*
@@ -443,11 +439,13 @@ void accel_clear_margins(struct vc_data *vc, struct fb_info *info,
 static const char *fbcon_startup(void)
 {
 	const char *display_desc = "frame buffer device";
+	struct display *p = &fb_display[fg_console];
+	struct vc_data *vc = vc_cons[fg_console].d;
 	struct font_desc *font = NULL;
 	struct module *owner;
 	struct fb_info *info;
-	struct vc_data *vc;
 	static int done = 0;
+	int cols, rows;
 	int irqres;
 
 	irqres = 1;
@@ -494,37 +492,35 @@ static const char *fbcon_startup(void)
 		softback_lines = 0;
 	}
 
-	font = get_default_font(info->var.xres, info->var.yres);	
-
-	vc = (struct vc_data *) kmalloc(sizeof(struct vc_data), GFP_ATOMIC); 
-
-	if (!vc) {
-		if (softback_buf)
-			kfree((void *) softback_buf);
-		return NULL;
-	}
-
 	/* Setup default font */
-	vc->vc_font.data = font->data;
-	vc->vc_font.width = font->width;
-	vc->vc_font.height = font->height;
-	vc->vc_font.charcount = 256; /* FIXME  Need to support more fonts */
-
-	vc->vc_cols = info->var.xres/vc->vc_font.width;
-	vc->vc_rows = info->var.yres/vc->vc_font.height;
+	if (!p->fontdata) {
+		if (!fontname[0] || !(font = find_font(fontname)))
+			font = get_default_font(info->var.xres,
+						   info->var.yres);
+		vc->vc_font.width = font->width;
+		vc->vc_font.height = font->height;
+		vc->vc_font.data = p->fontdata = font->data;
+		vc->vc_font.charcount = 256; /* FIXME  Need to support more fonts */
+	}
 
-	/* We trust the mode the driver supplies. */
+	/*
+	 * We must always set the mode. The mode of the previous console
+	 * driver could be in the same resolution but we are using different
+	 * hardware so we have to initialize the hardware.
+	 */
 	if (info->fbops->fb_set_par)
 		info->fbops->fb_set_par(info);
+	cols = info->var.xres/vc->vc_font.width;
+	rows = info->var.yres/vc->vc_font.height;
+	vc_resize(vc->vc_num, cols, rows);
 
 	DPRINTK("mode:   %s\n", info->fix.id);
 	DPRINTK("visual: %d\n", info->fix.visual);
 	DPRINTK("res:    %dx%d-%d\n", info->var.xres,
 		info->var.yres,
 		info->var.bits_per_pixel);
+	con_set_default_unimap(vc->vc_num);
 
-	info->display_fg = vc;
-	
 #ifdef CONFIG_ATARI
 	if (MACH_IS_ATARI) {
 		cursor_blink_rate = ATARI_CURSOR_BLINK_RATE;
@@ -598,99 +594,61 @@ static const char *fbcon_startup(void)
 }
 
 static void fbcon_init(struct vc_data *vc, int init)
-{
-	int unit = vc->vc_num;
-	struct fb_info *info;
-
-	/* on which frame buffer will we open this console? */
-	info = registered_fb[(int) con2fb_map[unit]];
-	
-	if (info->var.accel_flags)
-		fb_display[unit].scrollmode = SCROLL_YNOMOVE;
-	else
-		fb_display[unit].scrollmode = SCROLL_YREDRAW;
-	fbcon_set_display(vc, init, !init);
-}
-
-static void fbcon_deinit(struct vc_data *vc)
-{
-	struct display *p = &fb_display[vc->vc_num];
-
-	fbcon_free_font(p);
-}
-
-static __inline__ void updatescrollmode(struct display *p, struct vc_data *vc)
-{
-	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
-
-	int m;
-	if (p->scrollmode & __SCROLL_YFIXED)
-		return;
-	if (divides(info->fix.ywrapstep, vc->vc_font.height) &&
-	    divides(vc->vc_font.height, info->var.yres_virtual))
-		m = __SCROLL_YWRAP;
-	else if (divides(info->fix.ypanstep, vc->vc_font.height) &&
-		 info->var.yres_virtual >= info->var.yres + vc->vc_font.height)
-		m = __SCROLL_YPAN;
-	else if (p->scrollmode & __SCROLL_YNOMOVE)
-		m = __SCROLL_YREDRAW;
-	else
-		m = __SCROLL_YMOVE;
-	p->scrollmode = (p->scrollmode & ~__SCROLL_YMASK) | m;
-}
-
-static void fbcon_set_display(struct vc_data *vc, int init, int logo)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
-	int nr_rows, nr_cols, old_rows, old_cols, i, charcnt = 256;
-	struct display *p = &fb_display[vc->vc_num];
+	struct vc_data **default_mode = vc->vc_display_fg;
+	struct display *t, *p = &fb_display[vc->vc_num];
+	int display_fg = (*default_mode)->vc_num;
+	int logo = 1, rows, cols, charcnt = 256;
 	unsigned short *save = NULL, *r, *q;
-	struct font_desc *font;
 
-	if (vc->vc_num != fg_console || (info->flags & FBINFO_FLAG_MODULE) ||
+	if (vc->vc_num != display_fg || (info->flags & FBINFO_FLAG_MODULE) ||
 	    (info->fix.type == FB_TYPE_TEXT))
 		logo = 0;
 
 	info->var.xoffset = info->var.yoffset = p->yscroll = 0;	/* reset wrap/pan */
 
-	for (i = 0; i < MAX_NR_CONSOLES; i++)
-		if (vc && i != vc->vc_num && fb_display[i].fontdata) 
-			break;
-
-	fbcon_free_font(p);
-	if (i < MAX_NR_CONSOLES) {
-		struct display *q = &fb_display[i];
-		struct vc_data *tmp = vc_cons[i].d;
-		
-		/* If we are not the first console on this
-		   fb, copy the font from that console */
-		vc->vc_font.width = tmp->vc_font.width;
-		vc->vc_font.height = tmp->vc_font.height;
-		vc->vc_font.data = p->fontdata = q->fontdata;
-		p->userfont = q->userfont;
-		if (p->userfont) {
-			REFCOUNT(p->fontdata)++;
-			charcnt = FNTCHARCNT(p->fontdata);
-		}
-		con_copy_unimap(vc->vc_num, i);
+	/* If we are not the first console on this
+	   fb, copy the font from that console */
+	t = &fb_display[display_fg];
+	vc->vc_font.width = (*default_mode)->vc_font.width;
+	vc->vc_font.height = (*default_mode)->vc_font.height;
+	vc->vc_font.data = p->fontdata = t->fontdata;
+	p->userfont = t->userfont;
+	if (p->userfont) {
+		REFCOUNT(p->fontdata)++;
+		charcnt = FNTCHARCNT(p->fontdata);
 	}
+	con_copy_unimap(vc->vc_num, display_fg);
 
-	if (!p->fontdata) {
-		if (!p->fontname[0] || !(font = find_font(p->fontname)))
-			font = get_default_font(info->var.xres,
-						   info->var.yres);
-		vc->vc_font.width = font->width;
-		vc->vc_font.height = font->height;
-		vc->vc_font.data = p->fontdata = font->data;
+	vc->vc_can_do_color = info->var.bits_per_pixel != 1;
+	vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
+	if (charcnt == 256) {
+		vc->vc_hi_font_mask = 0;
+	} else {
+		vc->vc_hi_font_mask = 0x100;
+		if (vc->vc_can_do_color)
+			vc->vc_complement_mask <<= 1;
 	}
 
-	updatescrollmode(p, vc);
+	cols = info->var.xres / vc->vc_font.width;
+	rows = info->var.yres / vc->vc_font.height;
+	vc_resize(vc->vc_num, cols, rows);
 
-	old_cols = vc->vc_cols;
-	old_rows = vc->vc_rows;
+	if (info->var.accel_flags)
+		p->scrollmode = SCROLL_YNOMOVE;
+	else
+		p->scrollmode = SCROLL_YREDRAW;
 
-	nr_cols = info->var.xres / vc->vc_font.width;
-	nr_rows = info->var.yres / vc->vc_font.height;
+	/*
+	 *  ++guenther: console.c:vc_allocate() relies on initializing
+	 *  vc_{cols,rows}, but we must not set those if we are only
+	 *  resizing the console.
+	 */
+	if (init) {
+		vc->vc_cols = cols;
+		vc->vc_rows = rows;
+	}
 
 	if (logo) {
 		/* Need to make room for the logo */
@@ -701,34 +659,28 @@ static void fbcon_set_display(struct vc_data *vc, int init, int logo)
 		logo_lines = (logo_height + vc->vc_font.height - 1) /
 			     vc->vc_font.height;
 		q = (unsigned short *) (vc->vc_origin +
-					vc->vc_size_row * old_rows);
-		step = logo_lines * old_cols;
-		for (r = q - logo_lines * old_cols; r < q; r++)
+					vc->vc_size_row * rows);
+		step = logo_lines * cols;
+		for (r = q - logo_lines * cols; r < q; r++)
 			if (scr_readw(r) != vc->vc_video_erase_char)
 				break;
-		if (r != q && nr_rows >= old_rows + logo_lines) {
-			save =
-			    kmalloc(logo_lines * nr_cols * 2, GFP_KERNEL);
+		if (r != q && rows >= rows + logo_lines) {
+			save = kmalloc(logo_lines * cols * 2, GFP_KERNEL);
 			if (save) {
-				int i =
-				    old_cols <
-				    nr_cols ? old_cols : nr_cols;
 				scr_memsetw(save, vc->vc_video_erase_char,
-					    logo_lines * nr_cols * 2);
+					    logo_lines * cols * 2);
 				r = q - step;
-				for (cnt = 0; cnt < logo_lines;
-				     cnt++, r += i)
-					scr_memcpyw(save + cnt * nr_cols,
-						    r, 2 * i);
+				for (cnt = 0; cnt < logo_lines; cnt++, r += cols)
+					scr_memcpyw(save + cnt * cols, r, 2 * cols);
 				r = q;
 			}
 		}
 		if (r == q) {
 			/* We can scroll screen down */
-			r = q - step - old_cols;
-			for (cnt = old_rows - logo_lines; cnt > 0; cnt--) {
+			r = q - step - cols;
+			for (cnt = rows - logo_lines; cnt > 0; cnt--) {
 				scr_memcpyw(r + step, r, vc->vc_size_row);
-				r -= old_cols;
+				r -= cols;
 			}
 			if (!save) {
 				vc->vc_y += logo_lines;
@@ -738,55 +690,20 @@ static void fbcon_set_display(struct vc_data *vc, int init, int logo)
 		scr_memsetw((unsigned short *) vc->vc_origin,
 			    vc->vc_video_erase_char,
 			    vc->vc_size_row * logo_lines);
-	}
-
-	/*
-	 *  ++guenther: console.c:vc_allocate() relies on initializing
-	 *  vc_{cols,rows}, but we must not set those if we are only
-	 *  resizing the console.
-	 */
-	if (init) {
-		vc->vc_cols = nr_cols;
-		vc->vc_rows = nr_rows;
-	}
-	p->vrows = info->var.yres_virtual / vc->vc_font.height;
-	if(info->var.yres > (vc->vc_font.height * (vc->vc_rows + 1))) {
-		p->vrows -= (info->var.yres - (vc->vc_font.height * vc->vc_rows)) / vc->vc_font.height;
-	}
-	if ((info->var.yres % vc->vc_font.height) &&
-	    (info->var.yres_virtual % vc->vc_font.height <
-	     info->var.yres % vc->vc_font.height))
-		p->vrows--;
-	vc->vc_can_do_color = info->var.bits_per_pixel != 1;
-	vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
-	if (charcnt == 256) {
-		vc->vc_hi_font_mask = 0;
-	} else {
-		vc->vc_hi_font_mask = 0x100;
-		if (vc->vc_can_do_color)
-			vc->vc_complement_mask <<= 1;
-	}
 
-	if (!init) {
-		if (vc->vc_cols != nr_cols || vc->vc_rows != nr_rows)
-			vc_resize(vc->vc_num, nr_cols, nr_rows);
-		else if (CON_IS_VISIBLE(vc) &&
-			 vt_cons[vc->vc_num]->vc_mode == KD_TEXT) {
+		if (CON_IS_VISIBLE(vc) && vt_cons[vc->vc_num]->vc_mode == KD_TEXT) {
 			accel_clear_margins(vc, info, 0);
 			update_screen(vc->vc_num);
 		}
 		if (save) {
 			q = (unsigned short *) (vc->vc_origin +
 						vc->vc_size_row *
-						old_rows);
-			scr_memcpyw(q, save, logo_lines * nr_cols * 2);
+						rows);
+			scr_memcpyw(q, save, logo_lines * cols * 2);
 			vc->vc_y += logo_lines;
 			vc->vc_pos += logo_lines * vc->vc_size_row;
 			kfree(save);
 		}
-	}
-
-	if (logo) {
 		if (logo_lines > vc->vc_bottom) {
 			logo_shown = -1;
 			printk(KERN_INFO
@@ -797,7 +714,7 @@ static void fbcon_set_display(struct vc_data *vc, int init, int logo)
 		}
 	}
 
-	if (vc->vc_num == fg_console && softback_buf) {
+	if (vc->vc_num == display_fg && softback_buf) {
 		int l = fbcon_softback_size / vc->vc_size_row;
 		if (l > 5)
 			softback_end = softback_buf + l * vc->vc_size_row;
@@ -809,6 +726,12 @@ static void fbcon_set_display(struct vc_data *vc, int init, int logo)
 	}
 }
 
+static void fbcon_deinit(struct vc_data *vc)
+{
+	struct display *p = &fb_display[vc->vc_num];
+
+	fbcon_free_font(p);
+}
 
 /* ====================================================================== */
 
@@ -1542,6 +1465,25 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s
 			height, width);
 }
 
+static __inline__ void updatescrollmode(struct display *p, struct fb_info *info, struct vc_data *vc)
+{
+	int m;
+
+	if (p->scrollmode & __SCROLL_YFIXED)
+		return;
+	if (divides(info->fix.ywrapstep, vc->vc_font.height) &&
+	    divides(vc->vc_font.height, info->var.yres_virtual))
+		m = __SCROLL_YWRAP;
+	else if (divides(info->fix.ypanstep, vc->vc_font.height) &&
+		 info->var.yres_virtual >= info->var.yres + vc->vc_font.height)
+		m = __SCROLL_YPAN;
+	else if (p->scrollmode & __SCROLL_YNOMOVE)
+		m = __SCROLL_YREDRAW;
+	else
+		m = __SCROLL_YMOVE;
+	p->scrollmode = (p->scrollmode & ~__SCROLL_YMASK) | m;
+}
+
 static int fbcon_resize(struct vc_data *vc, unsigned int width, 
 			unsigned int height)
 {
@@ -1556,20 +1498,30 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
 	var.yres = height * fh;
 	x_diff = info->var.xres - var.xres;
 	y_diff = info->var.yres - var.yres;
-	if (x_diff < 0 || x_diff > fw ||
-	   (y_diff < 0 || y_diff > fh)) {
-		var.activate = FB_ACTIVATE_TEST;
-		err = fb_set_var(info, &var);
-		if (err || width > var.xres/fw ||
-		    height > var.yres/fh)
+	if (x_diff < 0 || x_diff > fw || (y_diff < 0 || y_diff > fh)) {
+		char mode[40];
+
+		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
+		if (!info->fbops->fb_set_par)
+			return -EINVAL;
+
+		sprintf(mode, "%dx%d", var.xres, var.yres);
+		err = fb_find_mode(&var, info, mode, NULL, 0, NULL,
+					info->var.bits_per_pixel);
+		if (!err || width > var.xres/fw || height > var.yres/fh)
 			return -EINVAL;
 		DPRINTK("resize now %ix%i\n", var.xres, var.yres);
-		var.activate = FB_ACTIVATE_NOW;
-		fb_set_var(info, &var);
+		if (CON_IS_VISIBLE(vc)) {
+			var.activate = FB_ACTIVATE_NOW;
+			fb_set_var(info, &var);
+		}
 	}
 	p->vrows = var.yres_virtual/fh;
 	if (var.yres > (fh * (height + 1)))
 		p->vrows -= (var.yres - (fh * height)) / fh;
+	if ((var.yres % fh) && (var.yres_virtual % fh < var.yres % fh))
+		p->vrows--;
+	updatescrollmode(p, info, vc);
 	return 0;
 }
 
@@ -1839,16 +1791,6 @@ static int fbcon_do_set_font(struct vc_data *vc, struct console_font_op *op,
 	if (resize) {
 		/* reset wrap/pan */
 		info->var.xoffset = info->var.yoffset = p->yscroll = 0;
-		p->vrows = info->var.yres_virtual / h;
-
-#if 0          /* INCOMPLETE - let the console gurus handle this */
-		if(info->var.yres > (h * (vc->vc_rows + 1))
-			p->vrows -= (info->var.yres - (h * vc->vc_rows)) / h;
-#endif
-		if ((info->var.yres % h)
-		    && (info->var.yres_virtual % h < info->var.yres % h))
-			p->vrows--;
-		updatescrollmode(p, vc);
 		vc_resize(vc->vc_num, info->var.xres / w, info->var.yres / h);
 		if (CON_IS_VISIBLE(vc) && softback_buf) {
 			int l = fbcon_softback_size / vc->vc_size_row;
@@ -2257,6 +2199,7 @@ static int fbcon_event_notify(struct notifier_block *self,
  */
 
 const struct consw fb_con = {
+	.owner			= THIS_MODULE,
 	.con_startup 		= fbcon_startup,
 	.con_init 		= fbcon_init,
 	.con_deinit 		= fbcon_deinit,
@@ -2286,10 +2229,16 @@ static int fbcon_event_notifier_registered;
 
 int __init fb_console_init(void)
 {
+	int err;
+
 	if (!num_registered_fb)
 		return -ENODEV;
 
-	take_over_console(&fb_con, first_fb_vc, last_fb_vc, fbcon_is_default);
+	err = take_over_console(&fb_con, first_fb_vc, last_fb_vc,
+				fbcon_is_default);
+	if (err)
+		return err;
+
 	acquire_console_sem();
 	if (!fbcon_event_notifier_registered) {
 		fb_register_client(&fbcon_event_notifer);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index ac19e9c83..a9d036b0a 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -27,7 +27,6 @@ struct display {
     /* Filled in by the frame buffer device */
     u_short inverse;                /* != 0 text black on white as default */
     /* Filled in by the low-level console driver */
-    char fontname[40];              /* Font associated to this display */	
     u_char *fontdata;
     int userfont;                   /* != 0 if fontdata kmalloc()ed */
     u_short scrollmode;             /* Scroll Method */
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index 8e30b248f..8f7f3a7d4 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -370,8 +370,6 @@ static void mdacon_init(struct vc_data *c, int init)
 
 	if (mda_display_fg == NULL)
 		mda_display_fg = c;
-
-	MOD_INC_USE_COUNT;
 }
 
 static void mdacon_deinit(struct vc_data *c)
@@ -380,8 +378,6 @@ static void mdacon_deinit(struct vc_data *c)
 
 	if (mda_display_fg == c)
 		mda_display_fg = NULL;
-
-	MOD_DEC_USE_COUNT;
 }
 
 static inline u16 mda_convert_attr(u16 ch)
@@ -586,6 +582,7 @@ static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines)
  */
 
 const struct consw mda_con = {
+	.owner =		THIS_MODULE,
 	.con_startup =		mdacon_startup,
 	.con_init =		mdacon_init,
 	.con_deinit =		mdacon_deinit,
@@ -609,8 +606,7 @@ int __init mda_console_init(void)
 	if (mda_first_vc > mda_last_vc)
 		return 1;
 
-	take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0);
-	return 0;
+	return take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0);
 }
 
 void __exit mda_console_exit(void)
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index 69916019c..5e4fdc08e 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -32,6 +32,7 @@
 
 
 extern struct font_desc font_vga_8x16;
+extern unsigned long sgi_gfxaddr;
 
 #define FONT_DATA ((unsigned char *)font_vga_8x16.data)
 
@@ -43,7 +44,7 @@ extern struct font_desc font_vga_8x16;
 
 static unsigned char *font_data[MAX_NR_CONSOLES];
 
-extern struct newport_regs *npregs;
+static struct newport_regs *npregs;
 
 static int logo_active;
 static int topscan;
@@ -51,6 +52,8 @@ static int xcurs_correction = 29;
 static int newport_xsize;
 static int newport_ysize;
 
+static int newport_set_def_font(int unit, struct console_font_op *op);
+
 #define BMASK(c) (c << 24)
 
 #define RENDER(regs, cp) do { \
@@ -95,11 +98,33 @@ static inline void newport_init_cmap(void)
 	}
 }
 
+static void newport_show_logo(void)
+{
 #ifdef CONFIG_LOGO_SGI_CLUT224
-static void newport_show_logo(void);
-#else
-#define newport_show_logo()	do { } while (0)
-#endif
+	const struct linux_logo *logo = fb_find_logo(8);
+	const unsigned char *clut = logo->clut;
+	const unsigned char *data = logo->data;
+	unsigned long i;
+
+	for (i = 0; i < logo->clutsize; i++) {
+		newport_bfwait();
+		newport_cmap_setaddr(npregs, i + 0x20);
+		newport_cmap_setrgb(npregs, clut[0], clut[1], clut[2]);
+		clut += 3;
+	}
+
+	newport_wait();
+	npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
+				 NPORT_DMODE0_CHOST);
+
+	npregs->set.xystarti = ((newport_xsize - logo->width) << 16) | (0);
+	npregs->set.xyendi = ((newport_xsize - 1) << 16);
+	newport_wait();
+
+	for (i = 0; i < logo->width*logo->height; i++)
+		npregs->go.hostrw0 = *data++ << 24;
+#endif /* CONFIG_LOGO_SGI_CLUT224 */
+}
 
 static inline void newport_clear_screen(int xstart, int ystart, int xend,
 					int yend, int ci)
@@ -258,26 +283,22 @@ static void newport_get_revisions(void)
 		xcurs_correction = 21;
 }
 
-#ifdef MODULE
+/* Can't be __init, take_over_console may call it later */
 static const char *newport_startup(void)
-#else
-static const char *__init newport_startup(void)
-#endif
 {
 	int i;
-	struct newport_regs *p;
-
-	npregs = (struct newport_regs *) (KSEG1 + 0x1f0f0000);
 
-	p = npregs;
-	p->cset.config = NPORT_CFG_GD0;
+	if (!sgi_gfxaddr)
+		return NULL;
+	npregs = (struct newport_regs *) (KSEG1 + sgi_gfxaddr);
+	npregs->cset.config = NPORT_CFG_GD0;
 
 	if (newport_wait()) {
 		return NULL;
 	}
 
-	p->set.xstarti = TESTVAL;
-	if (p->set._xstart.word != XSTI_TO_FXSTART(TESTVAL))
+	npregs->set.xstarti = TESTVAL;
+	if (npregs->set._xstart.word != XSTI_TO_FXSTART(TESTVAL))
 		return NULL;
 
 	for (i = 0; i < MAX_NR_CONSOLES; i++)
@@ -287,8 +308,6 @@ static const char *__init newport_startup(void)
 	newport_get_revisions();
 	newport_get_screensize();
 
-	/* gfx_init (display_desc); */
-
 	return "SGI Newport";
 }
 
@@ -299,6 +318,15 @@ static void newport_init(struct vc_data *vc, int init)
 	vc->vc_can_do_color = 1;
 }
 
+static void newport_deinit(struct vc_data *c)
+{
+	int i;
+
+	/* free memory used by user font */
+	for (i = 0; i < MAX_NR_CONSOLES; i++)
+		newport_set_def_font(i, NULL);
+}
+
 static void newport_clear(struct vc_data *vc, int sy, int sx, int height,
 			  int width)
 {
@@ -677,9 +705,10 @@ static int newport_dummy(struct vc_data *c)
 #define DUMMY (void *) newport_dummy
 
 const struct consw newport_con = {
+    .owner =		THIS_MODULE,
     .con_startup =	newport_startup,
     .con_init =		newport_init,
-    .con_deinit =	DUMMY,
+    .con_deinit =	newport_deinit,
     .con_clear =	newport_clear,
     .con_putc =		newport_putc,
     .con_putcs =	newport_putcs,
@@ -696,63 +725,18 @@ const struct consw newport_con = {
 };
 
 #ifdef MODULE
-MODULE_LICENSE("GPL");
-
-int init_module(void)
+static int __init newport_console_init(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;
+	return take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
 }
 
-int cleanup_module(void)
+static void __exit newport_console_exit(void)
 {
-	int i;
-
-	printk("Unloading SGI Newport Console Driver\n");
-	/* free memory used by user font */
-	for (i = 0; i < MAX_NR_CONSOLES; i++)
-		newport_set_def_font(i, NULL);
-
-	return 0;
+	give_up_console(&newport_con);
 }
-#endif
-
 
-#ifdef CONFIG_LOGO_SGI_CLUT224
-
-#undef __initdata
-#define __initdata
-#include "../logo/logo_sgi_clut224.c"
-
-static void newport_show_logo(void)
-{
-	const struct linux_logo *logo = &logo_sgi_clut224;
-	const unsigned char *clut = logo->clut;
-	const unsigned char *data = logo->data;
-	unsigned long i;
-
-	for (i = 0; i < logo->clutsize; i++) {
-		newport_bfwait();
-		newport_cmap_setaddr(npregs, i + 0x20);
-		newport_cmap_setrgb(npregs, clut[0], clut[1], clut[2]);
-		clut += 3;
-	}
-
-	newport_wait();
-	npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
-				 NPORT_DMODE0_CHOST);
-
-	npregs->set.xystarti = ((newport_xsize - logo->width) << 16) | (0);
-	npregs->set.xyendi = ((newport_xsize - 1) << 16);
-	newport_wait();
-
-	for (i = 0; i < logo->width*logo->height; i++)
-		npregs->go.hostrw0 = *data++ << 24;
-}
-#endif /* CONFIG_LOGO_SGI_CLUT224 */
+module_init(newport_console_init);
+module_exit(newport_console_exit);
+#endif
 
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/console/promcon.c b/drivers/video/console/promcon.c
index 6c788c914..1458b1613 100644
--- a/drivers/video/console/promcon.c
+++ b/drivers/video/console/promcon.c
@@ -574,6 +574,7 @@ static int promcon_dummy(void)
 #define DUMMY (void *) promcon_dummy
 
 const struct consw prom_con = {
+	.owner =		THIS_MODULE,
 	.con_startup =		promcon_startup,
 	.con_init =		promcon_init,
 	.con_deinit =		promcon_deinit,
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 9d7816b20..92dffc676 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -354,6 +354,7 @@ static void sticon_save_screen(struct vc_data *conp)
 }
 
 static struct consw sti_con = {
+	.owner			= THIS_MODULE,
 	.con_startup		= sticon_startup,
 	.con_init		= sticon_init,
 	.con_deinit		= sticon_deinit,
@@ -390,7 +391,7 @@ int __init sticonsole_init(void)
 
     if (conswitchp == &dummy_con) {
 	printk(KERN_INFO "sticon: Initializing STI text console.\n");
-	take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1, 1);
+	return take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1, 1);
     }
     return 0;
 }
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 347e2fd33..b75ab0df6 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1065,6 +1065,7 @@ static int vgacon_dummy(struct vc_data *c)
 #define DUMMY (void *) vgacon_dummy
 
 const struct consw vga_con = {
+	.owner = THIS_MODULE,
 	.con_startup = vgacon_startup,
 	.con_init = vgacon_init,
 	.con_deinit = vgacon_deinit,
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index ecdd31fd8..0afebb72c 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1721,7 +1721,7 @@ int __init cyber2000fb_init(void)
 	err = cyberpro_vl_probe();
 	if (!err) {
 		ret = 0;
-		MOD_INC_USE_COUNT;
+		__module_get(THIS_MODULE);
 	}
 #endif
 #ifdef CONFIG_PCI
diff --git a/drivers/video/cyberfb.c b/drivers/video/cyberfb.c
index 45bbd37c0..a3e189f90 100644
--- a/drivers/video/cyberfb.c
+++ b/drivers/video/cyberfb.c
@@ -1065,7 +1065,6 @@ int __init cyberfb_init(void)
 		   fb_info.node, fb_info.modename, CyberSize>>10);
 
 	    /* TODO: This driver cannot be unloaded yet */
-	    MOD_INC_USE_COUNT;
 	    DPRINTK("EXIT\n");
 	    return 0;
 	}
@@ -1206,14 +1205,6 @@ int init_module(void)
 {
 	return cyberfb_init();
 }
-
-void cleanup_module(void)
-{
-	/* Not reached because the usecount will never be
-	   decremented to zero */
-	unregister_framebuffer(&fb_info);
-	/* TODO: clean up ... */
-}
 #endif /* MODULE */
 
 /*
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 5e2846649..80d81e398 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -114,6 +114,8 @@ extern int valkyriefb_setup(char*);
 extern int chips_init(void);
 extern int g364fb_init(void);
 extern int sa1100fb_init(void);
+extern int pxafb_init(void);
+extern int pxafb_setup(char*);
 extern int fm2fb_init(void);
 extern int fm2fb_setup(char*);
 extern int q40fb_init(void);
@@ -121,6 +123,8 @@ extern int sun3fb_init(void);
 extern int sun3fb_setup(char *);
 extern int sgivwfb_init(void);
 extern int sgivwfb_setup(char*);
+extern int gbefb_init(void);
+extern int gbefb_setup(char*);
 extern int rivafb_init(void);
 extern int rivafb_setup(char*);
 extern int tdfxfb_init(void);
@@ -166,6 +170,8 @@ extern int leo_init(void);
 extern int leo_setup(char*);
 extern int kyrofb_init(void);
 extern int kyrofb_setup(char*);
+extern int mc68x328fb_init(void);
+extern int mc68x328fb_setup(char *);
 
 static struct {
 	const char *name;
@@ -307,6 +313,9 @@ static struct {
 #ifdef CONFIG_FB_SGIVW
 	{ "sgivwfb", sgivwfb_init, sgivwfb_setup },
 #endif
+#ifdef CONFIG_FB_GBE
+	{ "gbefb", gbefb_init, gbefb_setup },
+#endif
 #ifdef CONFIG_FB_ACORN
 	{ "acornfb", acornfb_init, acornfb_setup },
 #endif
@@ -340,6 +349,9 @@ static struct {
 #ifdef CONFIG_FB_SA1100
 	{ "sa1100fb", sa1100fb_init, NULL },
 #endif
+#ifdef CONFIG_FB_PXA
+	{ "pxafb", pxafb_init, pxafb_setup },
+#endif
 #ifdef CONFIG_FB_SUN3
 	{ "sun3fb", sun3fb_init, sun3fb_setup },
 #endif
@@ -370,6 +382,9 @@ static struct {
 #ifdef CONFIG_FB_KYRO
 	{ "kyrofb", kyrofb_init, kyrofb_setup },
 #endif
+#ifdef CONFIG_FB_68328
+	{ "68328fb", mc68x328fb_init, mc68x328fb_setup },
+#endif
 
 	/*
 	 * Generic drivers that don't use resource management (yet)
@@ -411,12 +426,13 @@ static int ofonly __initdata = 0;
 /*
  * Drawing helpers.
  */
-u8 sys_inbuf(struct fb_info *info, u8 *src)
-{	
+static u8 fb_sys_inbuf(struct fb_info *info, u8 *src)
+{
 	return *src;
 }
 
-void sys_outbuf(struct fb_info *info, u8 *dst, u8 *src, unsigned int size)
+static void fb_sys_outbuf(struct fb_info *info, u8 *dst,
+				u8 *src, unsigned int size)
 {
 	memcpy(dst, src, size);
 }	
@@ -1013,7 +1029,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	struct fb_con2fbmap con2fb;
 #endif
 	struct fb_cmap cmap;
-	int i, rc;
+	int i;
 	
 	if (!fb)
 		return -ENODEV;
@@ -1055,9 +1071,9 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 	case FBIO_CURSOR:
 		acquire_console_sem();
-		rc = fb_cursor(info, (struct fb_cursor *) arg);
+		i = fb_cursor(info, (struct fb_cursor *) arg);
 		release_console_sem();
-		return rc;
+		return i;
 #ifdef CONFIG_FRAMEBUFFER_CONSOLE
 	case FBIOGET_CON2FBMAP:
 		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
@@ -1178,8 +1194,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
 	if (boot_cpu_data.x86 > 3)
 		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
 #elif defined(__mips__)
-	pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
-	pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
+	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #elif defined(__hppa__)
 	pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
 #elif defined(__ia64__) || defined(__arm__) || defined(__sh__)
@@ -1286,14 +1301,15 @@ register_framebuffer(struct fb_info *fb_info)
 			fb_info->pixmap.size = FBPIXMAPSIZE;
 			fb_info->pixmap.buf_align = 1;
 			fb_info->pixmap.scan_align = 1;
+			fb_info->pixmap.access_align = 4;
 			fb_info->pixmap.flags = FB_PIXMAP_DEFAULT;
 		}
 	}	
 	fb_info->pixmap.offset = 0;
 	if (fb_info->pixmap.outbuf == NULL)
-		fb_info->pixmap.outbuf = sys_outbuf;
+		fb_info->pixmap.outbuf = fb_sys_outbuf;
 	if (fb_info->pixmap.inbuf == NULL)
-		fb_info->pixmap.inbuf = sys_inbuf;
+		fb_info->pixmap.inbuf = fb_sys_inbuf;
 
 	if (fb_info->sprite.addr == NULL) {
 		fb_info->sprite.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL);
@@ -1301,14 +1317,15 @@ register_framebuffer(struct fb_info *fb_info)
 			fb_info->sprite.size = FBPIXMAPSIZE;
 			fb_info->sprite.buf_align = 1;
 			fb_info->sprite.scan_align = 1;
+			fb_info->sprite.access_align = 4;
 			fb_info->sprite.flags = FB_PIXMAP_DEFAULT;
 		}
 	}
 	fb_info->sprite.offset = 0;
 	if (fb_info->sprite.outbuf == NULL)
-		fb_info->sprite.outbuf = sys_outbuf;
+		fb_info->sprite.outbuf = fb_sys_outbuf;
 	if (fb_info->sprite.inbuf == NULL)
-		fb_info->sprite.inbuf = sys_inbuf;
+		fb_info->sprite.inbuf = fb_sys_inbuf;
 
 	registered_fb[i] = fb_info;
 
diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index 617734e46..05244ce4a 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -448,6 +448,10 @@ static int hgafb_blank(int blank_mode, struct fb_info *info)
 	return 0;
 }
 
+/*
+ * Accel functions
+ */
+#ifdef CONFIG_FB_HGA_ACCEL
 static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 {
 	u_int rows, y;
@@ -510,6 +514,11 @@ static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image)
 		*dest = d;
 	}
 }
+#else /* !CONFIG_FB_HGA_ACCEL */
+#define hgafb_fillrect cfb_fillrect
+#define hgafb_copyarea cfb_copyarea
+#define hgafb_imageblit cfb_imageblit
+#endif /* CONFIG_FB_HGA_ACCEL */
 
 
 static struct fb_ops hgafb_ops = {
@@ -519,9 +528,9 @@ static struct fb_ops hgafb_ops = {
 	.fb_setcolreg	= hgafb_setcolreg,
 	.fb_pan_display	= hgafb_pan_display,
 	.fb_blank	= hgafb_blank,
-	.fb_fillrect	= cfb_fillrect, //hgafb_fillrect,
-	.fb_copyarea	= cfb_copyarea,	//hgafb_copyarea,
-	.fb_imageblit	= cfb_imageblit,//hgafb_imageblit,
+	.fb_fillrect	= hgafb_fillrect,
+	.fb_copyarea	= hgafb_copyarea,
+	.fb_imageblit	= hgafb_imageblit,
 };
 		
 /* ------------------------------------------------------------------------- *
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index 3c7c42213..6b1635c4c 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -1084,6 +1084,7 @@ imsttfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 	while(read_reg_le32(par->dc_regs, SSTATUS) & 0x40);
 }
 
+#if 0
 static int
 imsttfb_load_cursor_image(struct imstt_par *par, int width, int height, __u8 fgc)
 {
@@ -1191,7 +1192,6 @@ imstt_set_cursor(struct imstt_par *par, struct fb_image *d, int on)
 	}
 }
 
-#if 0
 static int 
 imsttfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 {
diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
index 3ac34c1d5..2dc5b4e92 100644
--- a/drivers/video/logo/logo.c
+++ b/drivers/video/logo/logo.c
@@ -16,7 +16,7 @@
 #include <asm/setup.h>
 #endif
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_MIPS64)
+#ifdef CONFIG_MIPS
 #include <asm/bootinfo.h>
 #endif
 
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c
index 111f4c04e..777e7e038 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.c
+++ b/drivers/video/matrox/matroxfb_DAC1064.c
@@ -660,7 +660,7 @@ static int MGA1064_preinit(WPMINFO2) {
 	ACCESS_FBINFO(features.accel.has_cacheflush) = 1;
 
 	ACCESS_FBINFO(outputs[0]).output = &m1064;
-	ACCESS_FBINFO(outputs[0]).src = MATROXFB_SRC_CRTC1;
+	ACCESS_FBINFO(outputs[0]).src = ACCESS_FBINFO(outputs[0]).default_src;
 	ACCESS_FBINFO(outputs[0]).data = MINFO;
 	ACCESS_FBINFO(outputs[0]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
 
@@ -859,7 +859,7 @@ static int MGAG100_preinit(WPMINFO2) {
 	{
 		ACCESS_FBINFO(outputs[0]).output = &m1064;
 	}
-	ACCESS_FBINFO(outputs[0]).src = MATROXFB_SRC_CRTC1;
+	ACCESS_FBINFO(outputs[0]).src = ACCESS_FBINFO(outputs[0]).default_src;
 	ACCESS_FBINFO(outputs[0]).data = MINFO;
 	ACCESS_FBINFO(outputs[0]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
 
diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c
index cef3472aa..537ade5d8 100644
--- a/drivers/video/matrox/matroxfb_Ti3026.c
+++ b/drivers/video/matrox/matroxfb_Ti3026.c
@@ -692,7 +692,7 @@ static int Ti3026_preinit(WPMINFO2) {
 
 	ACCESS_FBINFO(outputs[0]).data = MINFO;
 	ACCESS_FBINFO(outputs[0]).output = &ti3026_output;
-	ACCESS_FBINFO(outputs[0]).src = MATROXFB_SRC_CRTC1;
+	ACCESS_FBINFO(outputs[0]).src = ACCESS_FBINFO(outputs[0]).default_src;
 	ACCESS_FBINFO(outputs[0]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
 
 	if (ACCESS_FBINFO(devflags.noinit))
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 1388470cc..88c0aea0a 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -1272,6 +1272,7 @@ static unsigned int maxclk;		/* "matrox:maxclk:xxxxM" */
 static int dfp;				/* "matrox:dfp */
 static int dfp_type = -1;		/* "matrox:dfp:xxx */
 static int memtype = -1;		/* "matrox:memtype:xxx" */
+static char outputs[8];			/* "matrox:outputs:xxx" */
 
 #ifndef MODULE
 static char videomode[64];		/* "matrox:mode:xxxxx" or "matrox:xxxxx" */
@@ -1537,6 +1538,39 @@ static struct fb_videomode defaultmode = {
 
 static int hotplug = 0;
 
+static void setDefaultOutputs(WPMINFO2) {
+	unsigned int i;
+	const char* ptr;
+
+	ACCESS_FBINFO(outputs[0]).default_src = MATROXFB_SRC_CRTC1;
+	if (ACCESS_FBINFO(devflags.g450dac)) {
+		ACCESS_FBINFO(outputs[1]).default_src = MATROXFB_SRC_CRTC1;
+		ACCESS_FBINFO(outputs[2]).default_src = MATROXFB_SRC_CRTC1;
+	} else if (dfp) {
+		ACCESS_FBINFO(outputs[2]).default_src = MATROXFB_SRC_CRTC1;
+	}
+	ptr = outputs;
+	for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) {
+		char c = *ptr++;
+
+		if (c == 0) {
+			break;
+		}
+		if (c == '0') {
+			ACCESS_FBINFO(outputs[i]).default_src = MATROXFB_SRC_NONE;
+		} else if (c == '1') {
+			ACCESS_FBINFO(outputs[i]).default_src = MATROXFB_SRC_CRTC1;
+		} else if (c == '2' && ACCESS_FBINFO(devflags.crtc2)) {
+			ACCESS_FBINFO(outputs[i]).default_src = MATROXFB_SRC_CRTC2;
+		} else {
+			printk(KERN_ERR "matroxfb: Unknown outputs setting\n");
+			break;
+		}
+	}
+	/* Nullify this option for subsequent adapters */
+	outputs[0] = 0;
+}
+
 static int initMatrox2(WPMINFO struct board* b){
 	unsigned long ctrlptr_phys = 0;
 	unsigned long video_base_phys = 0;
@@ -1577,20 +1611,18 @@ static int initMatrox2(WPMINFO struct board* b){
 	ACCESS_FBINFO(devflags.crtc2) = (b->flags & DEVF_CRTC2) != 0;
 	ACCESS_FBINFO(devflags.maven_capable) = (b->flags & DEVF_MAVEN_CAPABLE) != 0;
 	ACCESS_FBINFO(devflags.dualhead) = (b->flags & DEVF_DUALHEAD) != 0;
+	ACCESS_FBINFO(devflags.dfp_type) = dfp_type;
+	ACCESS_FBINFO(devflags.g450dac) = (b->flags & DEVF_G450DAC) != 0;
+	ACCESS_FBINFO(devflags.textstep) = ACCESS_FBINFO(devflags.vgastep) * ACCESS_FBINFO(devflags.textmode);
+	ACCESS_FBINFO(devflags.textvram) = 65536 / ACCESS_FBINFO(devflags.textmode);
+	setDefaultOutputs(PMINFO2);
 	if (b->flags & DEVF_PANELLINK_CAPABLE) {
 		ACCESS_FBINFO(outputs[2]).data = MINFO;
 		ACCESS_FBINFO(outputs[2]).output = &panellink_output;
-		if (dfp)
-			ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_CRTC1;
-		else
-			ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_NONE;
+		ACCESS_FBINFO(outputs[2]).src = ACCESS_FBINFO(outputs[2]).default_src;
 		ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
 		ACCESS_FBINFO(devflags.panellink) = 1;
 	}
-	ACCESS_FBINFO(devflags.dfp_type) = dfp_type;
-	ACCESS_FBINFO(devflags.g450dac) = (b->flags & DEVF_G450DAC) != 0;
-	ACCESS_FBINFO(devflags.textstep) = ACCESS_FBINFO(devflags.vgastep) * ACCESS_FBINFO(devflags.textmode);
-	ACCESS_FBINFO(devflags.textvram) = 65536 / ACCESS_FBINFO(devflags.textmode);
 
 	if (ACCESS_FBINFO(capable.cross4MB) < 0)
 		ACCESS_FBINFO(capable.cross4MB) = b->flags & DEVF_CROSS4MB;
@@ -1813,6 +1845,13 @@ static int initMatrox2(WPMINFO struct board* b){
 							to yres_virtual * xres_virtual < 2^32 */
 	}
 	matroxfb_init_fix(PMINFO2);
+	/* Normalize values (namely yres_virtual) */
+	matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon));
+	/* And put it into "current" var. Do NOT program hardware yet, or we'll not take over
+	 * vgacon correctly. fbcon_startup will call fb_set_par for us, WITHOUT check_var,
+	 * and unfortunately it will do it BEFORE vgacon contents is saved, so it won't work
+	 * anyway. But we at least tried... */
+	ACCESS_FBINFO(fbcon.var) = vesafb_defined;
 	err = -EINVAL;
 
 	printk(KERN_INFO "matroxfb: %dx%dx%dbpp (virtual: %dx%d)\n",
@@ -1834,6 +1873,9 @@ static int initMatrox2(WPMINFO struct board* b){
 		 * until someone tells me what is proper thing to do */
 		printk(KERN_INFO "fb%d: initializing hardware\n",
 			ACCESS_FBINFO(fbcon.node));
+		/* We have to use FB_ACTIVATE_FORCE, as we had to put vesafb_defined to the fbcon.var
+		 * already before, so register_framebuffer works correctly. */
+		vesafb_defined.activate |= FB_ACTIVATE_FORCE;
 		fb_set_var(&ACCESS_FBINFO(fbcon), &vesafb_defined);
 	}
 	return 0;
@@ -2288,6 +2330,8 @@ int __init matroxfb_setup(char *options) {
 			mem = simple_strtoul(this_opt+4, NULL, 0);
 		else if (!strncmp(this_opt, "mode:", 5))
 			strlcpy(videomode, this_opt+5, sizeof(videomode));
+		else if (!strncmp(this_opt, "outputs:", 8))
+			strlcpy(outputs, this_opt+8, sizeof(outputs));
 		else if (!strncmp(this_opt, "dfp:", 4)) {
 			dfp_type = simple_strtoul(this_opt+4, NULL, 0);
 			dfp = 1;
@@ -2463,6 +2507,8 @@ MODULE_PARM(dfp, "i");
 MODULE_PARM_DESC(dfp, "Specifies whether to use digital flat panel interface of G200/G400 (0 or 1) (default=0)");
 MODULE_PARM(dfp_type, "i");
 MODULE_PARM_DESC(dfp_type, "Specifies DFP interface type (0 to 255) (default=read from hardware)");
+MODULE_PARM(outputs, "c8");
+MODULE_PARM_DESC(outputs, "Specifies which CRTC is mapped to which output (string of up to three letters, consisting of 0 (disabled), 1 (CRTC1), 2 (CRTC2)) (default=111 for Gx50, 101 for G200/G400 with DFP, and 100 for all other devices)");
 #ifdef CONFIG_PPC_PMAC
 MODULE_PARM(vmode, "i");
 MODULE_PARM_DESC(vmode, "Specify the vmode mode number that should be used (640x480 default)");
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index de00f8444..152dde87c 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -479,6 +479,7 @@ struct matrox_fb_info {
 	struct matrox_altout*	output;
 	void*			data;
 	unsigned int		mode;
+	unsigned int		default_src;
 			      } outputs[MATROXFB_MAX_OUTPUTS];
 
 #define MATROXFB_MAX_FB_DRIVERS		5
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
index 27221ec48..d6f393593 100644
--- a/drivers/video/matrox/matroxfb_crtc2.c
+++ b/drivers/video/matrox/matroxfb_crtc2.c
@@ -628,15 +628,6 @@ static int matroxfb_dh_regit(CPMINFO struct matroxfb_dh_fb_info* m2info) {
 	m2info->mmio.vbase = ACCESS_FBINFO(mmio.vbase);
 	m2info->mmio.len = ACCESS_FBINFO(mmio.len);
 
-	/*
-	 *  If we have unused output, connect CRTC2 to it...
-	 */
-	if (ACCESS_FBINFO(outputs[1]).output &&
-	    ACCESS_FBINFO(outputs[1]).src == MATROXFB_SRC_NONE &&
-	    ACCESS_FBINFO(outputs[2]).src == MATROXFB_SRC_NONE) {
-		ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_CRTC2;
-	}
-
 	matroxfb_dh_init_fix(m2info);
 	if (register_framebuffer(&m2info->fbcon)) {
 		return -ENXIO;
diff --git a/drivers/video/matrox/matroxfb_g450.c b/drivers/video/matrox/matroxfb_g450.c
index 780dc6a84..35008af7d 100644
--- a/drivers/video/matrox/matroxfb_g450.c
+++ b/drivers/video/matrox/matroxfb_g450.c
@@ -591,11 +591,11 @@ void matroxfb_g450_connect(WPMINFO2) {
 	if (ACCESS_FBINFO(devflags.g450dac)) {
 		down_write(&ACCESS_FBINFO(altout.lock));
 		tvo_fill_defaults(PMINFO2);
-		ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_CRTC1;
+		ACCESS_FBINFO(outputs[1]).src = ACCESS_FBINFO(outputs[1]).default_src;
 		ACCESS_FBINFO(outputs[1]).data = MINFO;
 		ACCESS_FBINFO(outputs[1]).output = &matroxfb_g450_altout;
 		ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
-		ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_CRTC1;
+		ACCESS_FBINFO(outputs[2]).src = ACCESS_FBINFO(outputs[2]).default_src;
 		ACCESS_FBINFO(outputs[2]).data = MINFO;
 		ACCESS_FBINFO(outputs[2]).output = &matroxfb_g450_dvi;
 		ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c
index 70c5a8167..e529841cd 100644
--- a/drivers/video/matrox/matroxfb_maven.c
+++ b/drivers/video/matrox/matroxfb_maven.c
@@ -1188,7 +1188,7 @@ static int maven_init_client(struct i2c_client* clnt) {
 	md->client = clnt;
 	down_write(&ACCESS_FBINFO(altout.lock));
 	ACCESS_FBINFO(outputs[1]).output = &maven_altout;
-	ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE;
+	ACCESS_FBINFO(outputs[1]).src = ACCESS_FBINFO(outputs[1]).default_src;
 	ACCESS_FBINFO(outputs[1]).data = md;
 	ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
 	up_write(&ACCESS_FBINFO(altout.lock));
@@ -1249,6 +1249,7 @@ static int maven_detect_client(struct i2c_adapter* adapter, int address, int kin
 		err = -ENOMEM;
 		goto ERROR0;
 	}
+	memset(new_client, 0, sizeof(*new_client) + sizeof(*data));
 	data = (struct maven_data*)(new_client + 1);
 	i2c_set_clientdata(new_client, data);
 	new_client->addr = address;
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index d9b0a2f96..cd157349c 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -391,7 +391,7 @@ static int my_atoi(const char *name)
 }
 
 /**
- *	__fb_try_mode - test a video mode
+ *	fb_try_mode - test a video mode
  *	@var: frame buffer user defined part of display
  *	@info: frame buffer info structure
  *	@mode: frame buffer video mode structure
@@ -403,10 +403,10 @@ static int my_atoi(const char *name)
  *
  */
 
-int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
+int fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
 		  const struct fb_videomode *mode, unsigned int bpp)
 {
-    int err = 1;
+    int err = 0;
 
     DPRINTK("Trying mode %s %dx%d-%d@%d\n", mode->name ? mode->name : "noname",
 	    mode->xres, mode->yres, bpp, mode->refresh);
@@ -430,10 +430,9 @@ int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
     if (info->fbops->fb_check_var)
     	err = info->fbops->fb_check_var(var, info);
     var->activate &= ~FB_ACTIVATE_TEST;
-    return !err;
+    return err;
 }
 
-
 /**
  *	fb_find_mode - finds a valid video mode
  *	@var: frame buffer user defined part of display
@@ -536,18 +535,18 @@ done:
 		if ((name_matches(db[j], name, namelen) ||
 		     (res_specified && res_matches(db[j], xres, yres))) &&
 		    (!i || db[j].refresh == refresh) &&
-		    __fb_try_mode(var, info, &db[j], bpp))
+		    !fb_try_mode(var, info, &db[j], bpp))
 		    return 2-i;
 	}
     }
 
     DPRINTK("Trying default video mode\n");
-    if (__fb_try_mode(var, info, default_mode, default_bpp))
+    if (!fb_try_mode(var, info, default_mode, default_bpp))
 	return 3;
 
     DPRINTK("Trying all modes\n");
     for (i = 0; i < dbsize; i++)
-	if (__fb_try_mode(var, info, &db[i], default_bpp))
+	if (!fb_try_mode(var, info, &db[i], default_bpp))
 	    return 4;
 
     DPRINTK("No valid mode found\n");
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index e12b2aff8..dfa6e35d7 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -81,13 +81,13 @@ extern int tosh_smm(SMMRegisters *regs);
 #include <asm/mtrr.h>
 #endif
 
+#include <video/vga.h>
 #include <video/neomagic.h>
 
-#define NEOFB_VERSION "0.4.1"
+#define NEOFB_VERSION "0.4.2"
 
 /* --------------------------------------------------------------------- */
 
-static int disabled;
 static int internal;
 static int external;
 static int libretto;
@@ -100,8 +100,6 @@ static int nopciburst;
 MODULE_AUTHOR("(c) 2001-2002  Denis Oliver Kropp <dok@convergence.de>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("FBDev driver for NeoMagic PCI Chips");
-MODULE_PARM(disabled, "i");
-MODULE_PARM_DESC(disabled, "Disable this driver's initialization.");
 MODULE_PARM(internal, "i");
 MODULE_PARM_DESC(internal, "Enable output on internal LCD Display.");
 MODULE_PARM(external, "i");
@@ -152,6 +150,16 @@ static biosMode bios32[] = {
 };
 #endif
 
+static inline u32 read_le32(int regindex, const struct neofb_par *par)
+{
+	return readl(par->neo2200 + par->cursorOff + regindex);
+}
+
+static inline void write_le32(int regindex, u32 val, const struct neofb_par *par)
+{
+	writel(val, par->neo2200 + par->cursorOff + regindex);
+}
+
 static int neoFindMode(int xres, int yres, int depth)
 {
 	int xres_s;
@@ -363,44 +371,61 @@ static int vgaHWInit(const struct fb_var_screeninfo *var,
 	par->Attribute[18] = 0x0F;
 	par->Attribute[19] = 0x00;
 	par->Attribute[20] = 0x00;
-
 	return 0;
 }
 
-static void vgaHWLock(void)
+static void vgaHWLock(struct vgastate *state)
 {
 	/* Protect CRTC[0-7] */
-	VGAwCR(0x11, VGArCR(0x11) | 0x80);
+	vga_wcrt(state->vgabase, 0x11, vga_rcrt(state->vgabase, 0x11) | 0x80);
 }
 
 static void vgaHWUnlock(void)
 {
 	/* Unprotect CRTC[0-7] */
-	VGAwCR(0x11, VGArCR(0x11) & ~0x80);
+	vga_wcrt(NULL, 0x11, vga_rcrt(NULL, 0x11) & ~0x80);
 }
 
-static void neoLock(void)
+static void neoLock(struct vgastate *state)
 {
-	VGAwGR(0x09, 0x00);
-	vgaHWLock();
+	vga_wgfx(state->vgabase, 0x09, 0x00);
+	vgaHWLock(state);
 }
 
 static void neoUnlock(void)
 {
 	vgaHWUnlock();
-	VGAwGR(0x09, 0x26);
+	vga_wgfx(NULL, 0x09, 0x26);
 }
 
 /*
- * vgaHWSeqReset
- *      perform a sequencer reset.
+ * VGA Palette management
  */
-void vgaHWSeqReset(int start)
+static int paletteEnabled = 0;
+
+inline void VGAenablePalette(void)
 {
-	if (start)
-		VGAwSEQ(0x00, 0x01);	/* Synchronous Reset */
+	vga_r(NULL, VGA_IS1_RC);
+	vga_w(NULL, VGA_ATT_W, 0x00);
+	paletteEnabled = 1;
+}
+
+inline void VGAdisablePalette(void)
+{
+	vga_r(NULL, VGA_IS1_RC);
+	vga_w(NULL, VGA_ATT_W, 0x20);
+	paletteEnabled = 0;
+}
+
+inline void VGAwATTR(u8 index, u8 value)
+{
+	if (paletteEnabled)
+		index &= ~0x20;
 	else
-		VGAwSEQ(0x00, 0x03);	/* End Reset */
+		index |= 0x20;
+
+	vga_r(NULL, VGA_IS1_RC);
+	vga_wattr(NULL, index, value);
 }
 
 void vgaHWProtect(int on)
@@ -411,21 +436,18 @@ void vgaHWProtect(int on)
 		/*
 		 * Turn off screen and disable sequencer.
 		 */
-		tmp = VGArSEQ(0x01);
-
-		vgaHWSeqReset(1);	/* start synchronous reset */
-		VGAwSEQ(0x01, tmp | 0x20);	/* disable the display */
+		tmp = vga_rseq(NULL, 0x01);
+		vga_wseq(NULL, 0x00, 0x01);		/* Synchronous Reset */
+		vga_wseq(NULL, 0x01, tmp | 0x20);	/* disable the display */
 
 		VGAenablePalette();
 	} else {
 		/*
 		 * Reenable sequencer, then turn on screen.
 		 */
-
-		tmp = VGArSEQ(0x01);
-
-		VGAwSEQ(0x01, tmp & ~0x20);	/* reenable display */
-		vgaHWSeqReset(0);	/* clear synchronousreset */
+		tmp = vga_rseq(NULL, 0x01);
+		vga_wseq(NULL, 0x01, tmp & ~0x20);	/* reenable display */
+		vga_wseq(NULL, 0x00, 0x03);		/* clear synchronousreset */
 
 		VGAdisablePalette();
 	}
@@ -436,19 +458,19 @@ static void vgaHWRestore(const struct fb_info *info,
 {
 	int i;
 
-	VGAwMISC(par->MiscOutReg);
+	vga_w(NULL, VGA_MIS_W, par->MiscOutReg);
 
 	for (i = 1; i < 5; i++)
-		VGAwSEQ(i, par->Sequencer[i]);
+		vga_wseq(NULL, i, par->Sequencer[i]);
 
 	/* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 or CRTC[17] */
-	VGAwCR(17, par->CRTC[17] & ~0x80);
+	vga_wcrt(NULL, 17, par->CRTC[17] & ~0x80);
 
 	for (i = 0; i < 25; i++)
-		VGAwCR(i, par->CRTC[i]);
+		vga_wcrt(NULL, i, par->CRTC[i]);
 
 	for (i = 0; i < 9; i++)
-		VGAwGR(i, par->Graphics[i]);
+		vga_wgfx(NULL, i, par->Graphics[i]);
 
 	VGAenablePalette();
 
@@ -534,6 +556,36 @@ static inline void neo2200_accel_init(struct fb_info *info,
 
 /* --------------------------------------------------------------------- */
 
+static int
+neofb_open(struct fb_info *info, int user)
+{
+	struct neofb_par *par = (struct neofb_par *) info->par;
+	int cnt = atomic_read(&par->ref_count);
+
+	if (cnt) {
+		memset(&par->state, 0, sizeof(struct vgastate));
+		par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS;
+		save_vga(&par->state);
+	}
+	atomic_inc(&par->ref_count);
+	return 0;
+}
+
+static int
+neofb_release(struct fb_info *info, int user)
+{
+	struct neofb_par *par = (struct neofb_par *) info->par;
+	int cnt = atomic_read(&par->ref_count);
+
+	if (!cnt)
+		return -EINVAL;
+	if (cnt == 1) {
+		restore_vga(&par->state);
+	}
+	atomic_dec(&par->ref_count);
+	return 0;
+}
+
 static int
 neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
@@ -672,16 +724,13 @@ neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 	if (var->xres_virtual < var->xres)
 		var->xres_virtual = var->xres;
 
-	memlen =
-	    var->xres_virtual * var->bits_per_pixel * var->yres_virtual /
-	    8;
+	memlen = var->xres_virtual * var->bits_per_pixel * var->yres_virtual >> 3;
+
 	if (memlen > vramlen) {
-		var->yres_virtual =
-		    vramlen * 8 / (var->xres_virtual *
-				   var->bits_per_pixel);
-		memlen =
-		    var->xres_virtual * var->bits_per_pixel *
-		    var->yres_virtual / 8;
+		var->yres_virtual =  vramlen * 8 / (var->xres_virtual *
+				   	var->bits_per_pixel);
+		memlen = var->xres_virtual * var->bits_per_pixel *
+				var->yres_virtual / 8;
 	}
 
 	/* we must round yres/xres down, we already rounded y/xres_virtual up
@@ -981,13 +1030,13 @@ static int neofb_set_par(struct fb_info *info)
 	}
 
 	/* alread unlocked above */
-	/* BOGUS  VGAwGR (0x09, 0x26); */
+	/* BOGUS  vga_wgfx(NULL, 0x09, 0x26); */
 
 	/* don't know what this is, but it's 0 from bootup anyway */
-	VGAwGR(0x15, 0x00);
+	vga_wgfx(NULL, 0x15, 0x00);
 
 	/* was set to 0x01 by my bios in text and vesa modes */
-	VGAwGR(0x0A, par->GeneralLockReg);
+	vga_wgfx(NULL, 0x0A, par->GeneralLockReg);
 
 	/*
 	 * The color mode needs to be set before calling vgaHWRestore
@@ -996,7 +1045,7 @@ static int neofb_set_par(struct fb_info *info)
 	 * NOTE: Make sure we don't change bits make sure we don't change
 	 * any reserved bits.
 	 */
-	temp = VGArGR(0x90);
+	temp = vga_rgfx(NULL, 0x90);
 	switch (info->fix.accel) {
 	case FB_ACCEL_NEOMAGIC_NM2070:
 		temp &= 0xF0;	/* Save bits 7:4 */
@@ -1015,7 +1064,7 @@ static int neofb_set_par(struct fb_info *info)
 		break;
 	}
 
-	VGAwGR(0x90, temp);
+	vga_wgfx(NULL, 0x90, temp);
 
 	/*
 	 * In some rare cases a lockup might occur if we don't delay
@@ -1027,9 +1076,9 @@ static int neofb_set_par(struct fb_info *info)
 	 * Disable horizontal and vertical graphics and text expansions so
 	 * that vgaHWRestore works properly.
 	 */
-	temp = VGArGR(0x25);
+	temp = vga_rgfx(NULL, 0x25);
 	temp &= 0x39;
-	VGAwGR(0x25, temp);
+	vga_wgfx(NULL, 0x25, temp);
 
 	/*
 	 * Sleep for 200ms to make sure that the two operations above have
@@ -1041,19 +1090,18 @@ static int neofb_set_par(struct fb_info *info)
 	 * This function handles restoring the generic VGA registers.  */
 	vgaHWRestore(info, par);
 
-
-	VGAwGR(0x0E, par->ExtCRTDispAddr);
-	VGAwGR(0x0F, par->ExtCRTOffset);
-	temp = VGArGR(0x10);
+	vga_wgfx(NULL, 0x0E, par->ExtCRTDispAddr);
+	vga_wgfx(NULL, 0x0F, par->ExtCRTOffset);
+	temp = vga_rgfx(NULL, 0x10);
 	temp &= 0x0F;		/* Save bits 3:0 */
 	temp |= (par->SysIfaceCntl1 & ~0x0F);	/* VESA Bios sets bit 1! */
-	VGAwGR(0x10, temp);
+	vga_wgfx(NULL, 0x10, temp);
 
-	VGAwGR(0x11, par->SysIfaceCntl2);
-	VGAwGR(0x15, 0 /*par->SingleAddrPage */ );
-	VGAwGR(0x16, 0 /*par->DualAddrPage */ );
+	vga_wgfx(NULL, 0x11, par->SysIfaceCntl2);
+	vga_wgfx(NULL, 0x15, 0 /*par->SingleAddrPage */ );
+	vga_wgfx(NULL, 0x16, 0 /*par->DualAddrPage */ );
 
-	temp = VGArGR(0x20);
+	temp = vga_rgfx(NULL, 0x20);
 	switch (info->fix.accel) {
 	case FB_ACCEL_NEOMAGIC_NM2070:
 		temp &= 0xFC;	/* Save bits 7:2 */
@@ -1074,79 +1122,78 @@ static int neofb_set_par(struct fb_info *info)
 		temp |= (par->PanelDispCntlReg1 & ~0x98);
 		break;
 	}
-	VGAwGR(0x20, temp);
+	vga_wgfx(NULL, 0x20, temp);
 
-	temp = VGArGR(0x25);
+	temp = vga_rgfx(NULL, 0x25);
 	temp &= 0x38;		/* Save bits 5:3 */
 	temp |= (par->PanelDispCntlReg2 & ~0x38);
-	VGAwGR(0x25, temp);
+	vga_wgfx(NULL, 0x25, temp);
 
 	if (info->fix.accel != FB_ACCEL_NEOMAGIC_NM2070) {
-		temp = VGArGR(0x30);
+		temp = vga_rgfx(NULL, 0x30);
 		temp &= 0xEF;	/* Save bits 7:5 and bits 3:0 */
 		temp |= (par->PanelDispCntlReg3 & ~0xEF);
-		VGAwGR(0x30, temp);
+		vga_wgfx(NULL, 0x30, temp);
 	}
 
-	VGAwGR(0x28, par->PanelVertCenterReg1);
-	VGAwGR(0x29, par->PanelVertCenterReg2);
-	VGAwGR(0x2a, par->PanelVertCenterReg3);
+	vga_wgfx(NULL, 0x28, par->PanelVertCenterReg1);
+	vga_wgfx(NULL, 0x29, par->PanelVertCenterReg2);
+	vga_wgfx(NULL, 0x2a, par->PanelVertCenterReg3);
 
 	if (info->fix.accel != FB_ACCEL_NEOMAGIC_NM2070) {
-		VGAwGR(0x32, par->PanelVertCenterReg4);
-		VGAwGR(0x33, par->PanelHorizCenterReg1);
-		VGAwGR(0x34, par->PanelHorizCenterReg2);
-		VGAwGR(0x35, par->PanelHorizCenterReg3);
+		vga_wgfx(NULL, 0x32, par->PanelVertCenterReg4);
+		vga_wgfx(NULL, 0x33, par->PanelHorizCenterReg1);
+		vga_wgfx(NULL, 0x34, par->PanelHorizCenterReg2);
+		vga_wgfx(NULL, 0x35, par->PanelHorizCenterReg3);
 	}
 
 	if (info->fix.accel == FB_ACCEL_NEOMAGIC_NM2160)
-		VGAwGR(0x36, par->PanelHorizCenterReg4);
+		vga_wgfx(NULL, 0x36, par->PanelHorizCenterReg4);
 
 	if (info->fix.accel == FB_ACCEL_NEOMAGIC_NM2200 ||
 	    info->fix.accel == FB_ACCEL_NEOMAGIC_NM2230 ||
 	    info->fix.accel == FB_ACCEL_NEOMAGIC_NM2360 ||
 	    info->fix.accel == FB_ACCEL_NEOMAGIC_NM2380) {
-		VGAwGR(0x36, par->PanelHorizCenterReg4);
-		VGAwGR(0x37, par->PanelVertCenterReg5);
-		VGAwGR(0x38, par->PanelHorizCenterReg5);
+		vga_wgfx(NULL, 0x36, par->PanelHorizCenterReg4);
+		vga_wgfx(NULL, 0x37, par->PanelVertCenterReg5);
+		vga_wgfx(NULL, 0x38, par->PanelHorizCenterReg5);
 
 		clock_hi = 1;
 	}
 
 	/* Program VCLK3 if needed. */
-	if (par->ProgramVCLK && ((VGArGR(0x9B) != par->VCLK3NumeratorLow)
-				 || (VGArGR(0x9F) != par->VCLK3Denominator)
-				 || (clock_hi && ((VGArGR(0x8F) & ~0x0f)
-						  != (par->
-						      VCLK3NumeratorHigh &
+	if (par->ProgramVCLK && ((vga_rgfx(NULL, 0x9B) != par->VCLK3NumeratorLow)
+				 || (vga_rgfx(NULL, 0x9F) != par->VCLK3Denominator)
+				 || (clock_hi && ((vga_rgfx(NULL, 0x8F) & ~0x0f)
+						  != (par->VCLK3NumeratorHigh &
 						      ~0x0F))))) {
-		VGAwGR(0x9B, par->VCLK3NumeratorLow);
+		vga_wgfx(NULL, 0x9B, par->VCLK3NumeratorLow);
 		if (clock_hi) {
-			temp = VGArGR(0x8F);
+			temp = vga_rgfx(NULL, 0x8F);
 			temp &= 0x0F;	/* Save bits 3:0 */
 			temp |= (par->VCLK3NumeratorHigh & ~0x0F);
-			VGAwGR(0x8F, temp);
+			vga_wgfx(NULL, 0x8F, temp);
 		}
-		VGAwGR(0x9F, par->VCLK3Denominator);
+		vga_wgfx(NULL, 0x9F, par->VCLK3Denominator);
 	}
 
 	if (par->biosMode)
-		VGAwCR(0x23, par->biosMode);
+		vga_wcrt(NULL, 0x23, par->biosMode);
 
-	VGAwGR(0x93, 0xc0);	/* Gives 5x faster framebuffer writes !!! */
+	vga_wgfx(NULL, 0x93, 0xc0);	/* Gives 5x faster framebuffer writes !!! */
 
 	/* Program vertical extension register */
 	if (info->fix.accel == FB_ACCEL_NEOMAGIC_NM2200 ||
 	    info->fix.accel == FB_ACCEL_NEOMAGIC_NM2230 ||
 	    info->fix.accel == FB_ACCEL_NEOMAGIC_NM2360 ||
 	    info->fix.accel == FB_ACCEL_NEOMAGIC_NM2380) {
-		VGAwCR(0x70, par->VerticalExt);
+		vga_wcrt(NULL, 0x70, par->VerticalExt);
 	}
 
 	vgaHWProtect(0);	/* Turn on screen */
 
 	/* Calling this also locks offset registers required in update_start */
-	neoLock();
+	neoLock(&par->state);
 
 	info->fix.line_length =
 	    info->var.xres_virtual * (info->var.bits_per_pixel >> 3);
@@ -1167,6 +1214,8 @@ static int neofb_set_par(struct fb_info *info)
 static void neofb_update_start(struct fb_info *info,
 			       struct fb_var_screeninfo *var)
 {
+	struct neofb_par *par = (struct neofb_par *) info->par;
+	struct vgastate *state = &par->state;
 	int oldExtCRTDispAddr;
 	int Base;
 
@@ -1180,18 +1229,18 @@ static void neofb_update_start(struct fb_info *info,
 	/*
 	 * These are the generic starting address registers.
 	 */
-	VGAwCR(0x0C, (Base & 0x00FF00) >> 8);
-	VGAwCR(0x0D, (Base & 0x00FF));
+	vga_wcrt(state->vgabase, 0x0C, (Base & 0x00FF00) >> 8);
+	vga_wcrt(state->vgabase, 0x0D, (Base & 0x00FF));
 
 	/*
 	 * Make sure we don't clobber some other bits that might already
 	 * have been set. NOTE: NM2200 has a writable bit 3, but it shouldn't
 	 * be needed.
 	 */
-	oldExtCRTDispAddr = VGArGR(0x0E);
-	VGAwGR(0x0E, (((Base >> 16) & 0x0f) | (oldExtCRTDispAddr & 0xf0)));
+	oldExtCRTDispAddr = vga_rgfx(NULL, 0x0E);
+	vga_wgfx(state->vgabase, 0x0E, (((Base >> 16) & 0x0f) | (oldExtCRTDispAddr & 0xf0)));
 
-	neoLock();
+	neoLock(state);
 }
 
 /*
@@ -1227,7 +1276,7 @@ static int neofb_pan_display(struct fb_var_screeninfo *var,
 static int neofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 			   u_int transp, struct fb_info *fb)
 {
-	if (regno >= NR_PALETTE)
+	if (regno >= 255)
 		return -EINVAL;
 
 	switch (fb->var.bits_per_pixel) {
@@ -1353,7 +1402,7 @@ neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 	}
 
 	par->neo2200->dstStart =
-	    dst * ((info->var.bits_per_pixel + 7) / 8);
+	    dst * ((info->var.bits_per_pixel + 7) >> 3);
 	par->neo2200->xyExt =
 	    (rect->height << 16) | (rect->width & 0xffff);
 }
@@ -1361,24 +1410,20 @@ neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 static void
 neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 {
-	struct neofb_par *par = (struct neofb_par *) info->par;
 	u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy;
+	struct neofb_par *par = (struct neofb_par *) info->par;
 	u_long src, dst, bltCntl;
 
 	bltCntl = NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0C0000;
 
-	if (sy < dy) {
+	if ((dy > sy) || ((dy == sy) && (dx > sx))) {
+		/* Start with the lower right corner */
 		sy += (area->height - 1);
 		dy += (area->height - 1);
-
-		bltCntl |= NEO_BC0_DST_Y_DEC | NEO_BC0_SRC_Y_DEC;
-	}
-
-	if (area->sx < area->dx) {
 		sx += (area->width - 1);
 		dx += (area->width - 1);
 
-		bltCntl |= NEO_BC0_X_DEC;
+		bltCntl |= NEO_BC0_X_DEC | NEO_BC0_DST_Y_DEC | NEO_BC0_SRC_Y_DEC;
 	}
 
 	src = sx * (info->var.bits_per_pixel >> 3) + sy*info->fix.line_length;
@@ -1395,6 +1440,7 @@ neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 	    (area->height << 16) | (area->width & 0xffff);
 }
 
+/*
 static void
 neo2200_imageblit(struct fb_info *info, const struct fb_image *image)
 {
@@ -1431,6 +1477,7 @@ neo2200_imageblit(struct fb_info *info, const struct fb_image *image)
 	memcpy(par->mmio_vbase + 0x100000, image->data,
 	       (image->width * image->height) >> 3);
 }
+*/
 
 static void
 neofb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
@@ -1439,7 +1486,7 @@ neofb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 		case FB_ACCEL_NEOMAGIC_NM2200:
 		case FB_ACCEL_NEOMAGIC_NM2230: 
 		case FB_ACCEL_NEOMAGIC_NM2360: 
-		case FB_ACCEL_NEOMAGIC_NM2380: 
+		case FB_ACCEL_NEOMAGIC_NM2380:
 			neo2200_fillrect(info, rect);
 			break;
 		default:
@@ -1467,17 +1514,22 @@ neofb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 static void
 neofb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
-	switch (info->fix.accel) {
-		case FB_ACCEL_NEOMAGIC_NM2200:
-		case FB_ACCEL_NEOMAGIC_NM2230: 
-		case FB_ACCEL_NEOMAGIC_NM2360: 
-		case FB_ACCEL_NEOMAGIC_NM2380: 
-			neo2200_imageblit(info, image);
-			break;
-		default:
-			cfb_imageblit(info, image);
-			break;
-	}
+/*
+	if (image->depth == 1) {
+		switch (info->fix.accel) {
+			case FB_ACCEL_NEOMAGIC_NM2200:
+			case FB_ACCEL_NEOMAGIC_NM2230:
+			case FB_ACCEL_NEOMAGIC_NM2360:
+			case FB_ACCEL_NEOMAGIC_NM2380:
+				neo2200_imageblit(info, image);
+				break;
+			default:
+				cfb_imageblit(info, image);
+				break;
+		}
+	} else
+*/
+		cfb_imageblit(info, image);
 }	
 
 static int 
@@ -1496,8 +1548,67 @@ neofb_sync(struct fb_info *info)
 	return 0;		
 }
 
+/*
+static void
+neofb_draw_cursor(struct fb_info *info, u8 *dst, u8 *src, unsigned int width)
+{
+	//memset_io(info->sprite.addr, 0xff, 1);
+}
+
+static int
+neofb_cursor(struct fb_info *info, struct fb_cursor *cursor)
+{
+	struct neofb_par *par = (struct neofb_par *) info->par;
+
+	* Disable cursor *
+	write_le32(NEOREG_CURSCNTL, ~NEO_CURS_ENABLE, par);
+
+	if (cursor->set & FB_CUR_SETPOS) {
+		u32 x = cursor->image.dx;
+		u32 y = cursor->image.dy;
+
+		info->cursor.image.dx = x;
+		info->cursor.image.dy = y;
+		write_le32(NEOREG_CURSX, x, par);
+		write_le32(NEOREG_CURSY, y, par);
+	}
+
+	if (cursor->set & FB_CUR_SETSIZE) {
+		info->cursor.image.height = cursor->image.height;
+		info->cursor.image.width = cursor->image.width;
+	}
+
+	if (cursor->set & FB_CUR_SETHOT)
+		info->cursor.hot = cursor->hot;
+
+	if (cursor->set & FB_CUR_SETCMAP) {
+		if (cursor->image.depth == 1) {
+			u32 fg = cursor->image.fg_color;
+			u32 bg = cursor->image.bg_color;
+
+			info->cursor.image.fg_color = fg;
+			info->cursor.image.bg_color = bg;
+
+			fg = ((fg & 0xff0000) >> 16) | ((fg & 0xff) << 16) | (fg & 0xff00);
+			bg = ((bg & 0xff0000) >> 16) | ((bg & 0xff) << 16) | (bg & 0xff00);
+			write_le32(NEOREG_CURSFGCOLOR, fg, par);
+			write_le32(NEOREG_CURSBGCOLOR, bg, par);
+		}
+	}
+
+	if (cursor->set & FB_CUR_SETSHAPE)
+		fb_load_cursor_image(info);
+
+	if (info->cursor.enable)
+		write_le32(NEOREG_CURSCNTL, NEO_CURS_ENABLE, par);
+	return 0;
+}
+*/
+
 static struct fb_ops neofb_ops = {
 	.owner		= THIS_MODULE,
+	.fb_open	= neofb_open,
+	.fb_release	= neofb_release,
 	.fb_check_var	= neofb_check_var,
 	.fb_set_par	= neofb_set_par,
 	.fb_setcolreg	= neofb_setcolreg,
@@ -1631,31 +1742,31 @@ static int __devinit neo_map_mmio(struct fb_info *info,
 	return 0;
 }
 
-static void __devinit neo_unmap_mmio(struct fb_info *info)
+static void neo_unmap_mmio(struct fb_info *info)
 {
 	struct neofb_par *par = (struct neofb_par *) info->par;
 
 	DBG("neo_unmap_mmio");
 
-	if (par->mmio_vbase) {
-		iounmap(par->mmio_vbase);
-		par->mmio_vbase = NULL;
+	iounmap(par->mmio_vbase);
+	par->mmio_vbase = NULL;
 
-		release_mem_region(info->fix.mmio_start,
-				   info->fix.mmio_len);
-	}
+	release_mem_region(info->fix.mmio_start,
+			   info->fix.mmio_len);
 }
 
 static int __devinit neo_map_video(struct fb_info *info,
 				   struct pci_dev *dev, int video_len)
 {
+	//unsigned long addr;
+
 	DBG("neo_map_video");
 
 	info->fix.smem_start = pci_resource_start(dev, 0);
 	info->fix.smem_len = video_len;
 
-	if (!request_mem_region
-	    (info->fix.smem_start, info->fix.smem_len, "frame buffer")) {
+	if (!request_mem_region(info->fix.smem_start, info->fix.smem_len,
+				"frame buffer")) {
 		printk("neofb: frame buffer in use\n");
 		return -EBUSY;
 	}
@@ -1673,33 +1784,36 @@ static int __devinit neo_map_video(struct fb_info *info,
 
 #ifdef CONFIG_MTRR
 	((struct neofb_par *)(info->par))->mtrr =
-	    mtrr_add(info->fix.smem_start, pci_resource_len(dev, 0),
-		     MTRR_TYPE_WRCOMB, 1);
+		mtrr_add(info->fix.smem_start, pci_resource_len(dev, 0),
+				MTRR_TYPE_WRCOMB, 1);
 #endif
 
 	/* Clear framebuffer, it's all white in memory after boot */
 	memset(info->screen_base, 0, info->fix.smem_len);
+
+	/* Allocate Cursor drawing pad.
+	info->fix.smem_len -= PAGE_SIZE;
+	addr = info->fix.smem_start + info->fix.smem_len;
+	write_le32(NEOREG_CURSMEMPOS, ((0x000f & (addr >> 10)) << 8) |
+					((0x0ff0 & (addr >> 10)) >> 4), par);
+	addr = (unsigned long) info->screen_base + info->fix.smem_len;
+	info->sprite.addr = (u8 *) addr; */
 	return 0;
 }
 
-static void __devinit neo_unmap_video(struct fb_info *info)
+static void neo_unmap_video(struct fb_info *info)
 {
-
-	DBG("neo_unmap_video");
-
-	if (info->screen_base) {
 #ifdef CONFIG_MTRR
-		struct neofb_par *par = (struct neofb_par *) info->par;
-		mtrr_del(par->mtrr, info->fix.smem_start,
-			 info->fix.smem_len);
-#endif
+	struct neofb_par *par = (struct neofb_par *) info->par;
 
-		iounmap(info->screen_base);
-		info->screen_base = NULL;
+	mtrr_del(par->mtrr, info->fix.smem_start,
+		 info->fix.smem_len);
+#endif
+	iounmap(info->screen_base);
+	info->screen_base = NULL;
 
-		release_mem_region(info->fix.smem_start,
-				   info->fix.smem_len);
-	}
+	release_mem_region(info->fix.smem_start,
+			   info->fix.smem_len);
 }
 
 static int __devinit neo_init_hw(struct fb_info *info)
@@ -1723,16 +1837,16 @@ static int __devinit neo_init_hw(struct fb_info *info)
 	printk(KERN_DEBUG "--- Neo extended register dump ---\n");
 	for (w = 0; w < 0x85; w++)
 		printk(KERN_DEBUG "CR %p: %p\n", (void *) w,
-		       (void *) VGArCR(w));
+		       (void *) vga_rcrt(NULL, w);
 	for (w = 0; w < 0xC7; w++)
 		printk(KERN_DEBUG "GR %p: %p\n", (void *) w,
-		       (void *) VGArGR(w));
+		       (void *) vga_rgfx(NULL, w));
 #endif
 
 	/* Determine the panel type */
-	VGAwGR(0x09, 0x26);
-	type = VGArGR(0x21);
-	display = VGArGR(0x20);
+	vga_wgfx(NULL, 0x09, 0x26);
+	type = vga_rgfx(NULL, 0x21);
+	display = vga_rgfx(NULL, 0x20);
 	if (!par->internal_display && !par->external_display) {
 		par->internal_display = display & 2 || !(display & 3) ? 1 : 0;
 		par->external_display = display & 1;
@@ -1742,8 +1856,8 @@ static int __devinit neo_init_hw(struct fb_info *info)
 	}
 
 	/* Determine panel width -- used in NeoValidMode. */
-	w = VGArGR(0x20);
-	VGAwGR(0x09, 0x00);
+	w = vga_rgfx(NULL, 0x20);
+	vga_wgfx(NULL, 0x09, 0x00);
 	switch ((w & 0x18) >> 3) {
 	case 0x00:
 		par->NeoPanelWidth = 640;
@@ -1868,10 +1982,16 @@ static int __devinit neo_init_hw(struct fb_info *info)
 		par->neo2200 = (Neo2200 *) par->mmio_vbase;
 		break;
 	}
-
+/*
+	info->sprite.size = CursorMem;
+	info->sprite.scan_align = 1;
+	info->sprite.buf_align = 1;
+	info->sprite.flags = FB_PIXMAP_IO;
+	info->sprite.outbuf = neofb_draw_cursor;
+*/
 	par->maxClock = maxClock;
-
-	return videoRam * 1024;
+	par->cursorOff = CursorOff;
+	return ((videoRam * 1024));
 }
 
 
@@ -1881,15 +2001,12 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
 	struct fb_info *info;
 	struct neofb_par *par;
 
-	info = kmalloc(sizeof(struct fb_info) + sizeof(struct neofb_par) + 
-		       sizeof(u32) * 17, GFP_KERNEL);
+	info = framebuffer_alloc(sizeof(struct neofb_par) + sizeof(u32) * 256, &dev->dev);
 
 	if (!info)
 		return NULL;
 
-	memset(info, 0, sizeof(struct fb_info) + sizeof(struct neofb_par) + sizeof(u32) * 17);
-
-	par = (struct neofb_par *) (info + 1);
+	par = info->par;
 
 	info->fix.accel = id->driver_data;
 
@@ -1939,23 +2056,18 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
 
 	info->fbops = &neofb_ops;
 	info->flags = FBINFO_FLAG_DEFAULT;
-	info->par = par;
 	info->pseudo_palette = (void *) (par + 1);
-
-	fb_alloc_cmap(&info->cmap, NR_PALETTE, 0);
-
 	return info;
 }
 
-static void __devinit neo_free_fb_info(struct fb_info *info)
+static void neo_free_fb_info(struct fb_info *info)
 {
 	if (info) {
 		/*
 		 * Free the colourmap
 		 */
-		fb_alloc_cmap(&info->cmap, 0, 0);
-
-		kfree(info);
+		fb_dealloc_cmap(&info->cmap);
+		framebuffer_release(info);
 	}
 }
 
@@ -1978,21 +2090,24 @@ static int __devinit neofb_probe(struct pci_dev *dev,
 	err = -ENOMEM;
 	info = neo_alloc_fb_info(dev, id);
 	if (!info)
-		goto failed;
+		return err;
 
 	err = neo_map_mmio(info, dev);
 	if (err)
-		goto failed;
+		goto err_map_mmio;
 
 	video_len = neo_init_hw(info);
 	if (video_len < 0) {
 		err = video_len;
-		goto failed;
+		goto err_init_hw;
 	}
 
 	err = neo_map_video(info, dev, video_len);
 	if (err)
-		goto failed;
+		goto err_init_hw;
+
+	if (neofb_check_var(&info->var, info))
+		goto err_map_video;
 
 	/*
 	 * Calculate the hsync and vsync frequencies.  Note that
@@ -2013,10 +2128,12 @@ static int __devinit neofb_probe(struct pci_dev *dev,
 	       info->fix.smem_len >> 10, info->var.xres,
 	       info->var.yres, h_sync / 1000, h_sync % 1000, v_sync);
 
+	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
+		goto err_map_video;
 
 	err = register_framebuffer(info);
 	if (err < 0)
-		goto failed;
+		goto err_reg_fb;
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
 	       info->node, info->fix.id);
@@ -2027,11 +2144,14 @@ static int __devinit neofb_probe(struct pci_dev *dev,
 	pci_set_drvdata(dev, info);
 	return 0;
 
-      failed:
+err_reg_fb:
+	fb_dealloc_cmap(&info->cmap);
+err_map_video:
 	neo_unmap_video(info);
+err_init_hw:
 	neo_unmap_mmio(info);
+err_map_mmio:
 	neo_free_fb_info(info);
-
 	return err;
 }
 
@@ -2103,24 +2223,6 @@ static struct pci_driver neofb_driver = {
 	.remove =	__devexit_p(neofb_remove)
 };
 
-/* **************************** init-time only **************************** */
-
-static void __init neo_init(void)
-{
-	DBG("neo_init");
-	pci_register_driver(&neofb_driver);
-}
-
-/* **************************** exit-time only **************************** */
-
-static void __exit neo_done(void)
-{
-	DBG("neo_done");
-	pci_unregister_driver(&neofb_driver);
-}
-
-#ifndef MODULE
-
 /* ************************* init in-kernel code ************************** */
 
 int __init neofb_setup(char *options)
@@ -2136,8 +2238,6 @@ int __init neofb_setup(char *options)
 		if (!*this_opt)
 			continue;
 
-		if (!strncmp(this_opt, "disabled", 8))
-			disabled = 1;
 		if (!strncmp(this_opt, "internal", 8))
 			internal = 1;
 		if (!strncmp(this_opt, "external", 8))
@@ -2153,41 +2253,18 @@ int __init neofb_setup(char *options)
 	return 0;
 }
 
-static int __initdata initialized = 0;
-
 int __init neofb_init(void)
 {
-	DBG("neofb_init");
-
-	if (disabled)
-		return -ENXIO;
-
-	if (!initialized) {
-		initialized = 1;
-		neo_init();
-	}
-
-	/* never return failure, user can hotplug card later... */
-	return 0;
+	return pci_register_driver(&neofb_driver);
 }
 
-#else
-
-/* *************************** init module code **************************** */
+#ifdef MODULE
 
-int __init init_module(void)
+static void __exit neofb_exit(void)
 {
-	DBG("init_module");
-
-	if (disabled)
-		return -ENXIO;
-
-	neo_init();
-
-	/* never return failure; user can hotplug card later... */
-	return 0;
+	pci_unregister_driver(&neofb_driver);
 }
 
+module_init(neofb_init);
+module_exit(neofb_exit);
 #endif				/* MODULE */
-
-module_exit(neo_done);
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 483b07062..61953c1e1 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -62,6 +62,16 @@
 #define DPRINTK(a,b...)
 #endif
 
+/*
+ * The 2.4 driver calls reset_card() at init time, where it also sets the
+ * initial mode. I don't think the driver should touch the chip until
+ * the console sets a video mode. So I was calling this at the start
+ * of setting a mode. However, certainly on 1280x1024 depth 16 on my
+ * PCI Graphics Blaster Exxtreme this causes the display to smear
+ * slightly.  I don't know why. Guesses to jim.hague@acm.org.
+ */
+#undef RESET_CARD_ON_MODE_SET
+
 /*
  * Driver data 
  */
@@ -340,16 +350,7 @@ static void clear_palette(struct pm2fb_par* p) {
 	}
 }
 
-#if 0
-/*
- * FIXME:
- * The 2.4 driver calls this at init time, where it also sets the
- * initial mode. I don't think the driver should touch the chip
- * until the console sets a video mode. So I was calling this
- * at the start of setting a mode. However, certainly on 1280x1024
- * depth 16 this causes the display to smear slightly.
- * I don't know why. Guesses to jim.hague@acm.org.
- */
+#ifdef RESET_CARD_ON_MODE_SET
 static void reset_card(struct pm2fb_par* p)
 {
 	if (p->type == PM2_TYPE_PERMEDIA2V)
@@ -501,6 +502,8 @@ static void set_video(struct pm2fb_par* p, u32 video) {
 	u32 vsync;
 
 	vsync = video;
+
+	DPRINTK("video = 0x%x\n", video);
 	
 	/*
 	 * The hardware cursor needs +vsync to recognise vert retrace.
@@ -660,6 +663,9 @@ static int pm2fb_set_par(struct fb_info *info)
 	u32 xres;
 	int data64;
 
+#ifdef RESET_CARD_ON_MODE_SET
+	reset_card(par);
+#endif
 	reset_config(par);
 	clear_palette(par);
     
@@ -721,8 +727,7 @@ static int pm2fb_set_par(struct fb_info *info)
 
 	info->fix.visual =
 		(depth == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
-	info->fix.line_length =
-		info->var.xres * ((info->var.bits_per_pixel + 7) >> 3);
+	info->fix.line_length = info->var.xres * depth / 8;
 	info->cmap.len = 256;
 
 	/*
@@ -803,6 +808,8 @@ static int pm2fb_set_par(struct fb_info *info)
 		break;
 	}
 	set_pixclock(par, pixclock);
+	DPRINTK("Setting graphics mode at %dx%d depth %d\n",
+		info->var.xres, info->var.yres, info->var.bits_per_pixel);
 	return 0;	
 }
 
@@ -843,7 +850,8 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
 	 *   var->{color}.offset contains start of bitfield
 	 *   var->{color}.length contains length of bitfield
 	 *   {hardwarespecific} contains width of DAC
-	 *   cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
+	 *   cmap[X] is programmed to
+	 *   (X << red.offset) | (X << green.offset) | (X << blue.offset)
 	 *   RAMDAC[X] is programmed to (red, green, blue)
 	 *
 	 * Pseudocolor:
@@ -856,8 +864,9 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
 	 *    does not use RAMDAC (usually has 3 of them).
 	 *    var->{color}.offset contains start of bitfield
 	 *    var->{color}.length contains length of bitfield
-	 *    cmap is programmed to (red << red.offset) | (green << green.offset) |
-	 *                      (blue << blue.offset) | (transp << transp.offset)
+	 *    cmap is programmed to
+	 *    (red << red.offset) | (green << green.offset) |
+	 *    (blue << blue.offset) | (transp << transp.offset)
 	 *    RAMDAC does not exist
 	 */
 #define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16)
@@ -962,6 +971,11 @@ static int pm2fb_blank(int blank_mode, struct fb_info *info)
 	struct pm2fb_par *par = (struct pm2fb_par *) info->par;
 	u32 video = par->video;
 
+	DPRINTK("blank_mode %d\n", blank_mode);
+
+	/* Turn everything on, then disable as requested. */
+	video |= (PM2F_VIDEO_ENABLE | PM2F_HSYNC_MASK | PM2F_VSYNC_MASK);
+
 	switch (blank_mode) {
 	case 0: 	/* Screen: On; HSync: On, VSync: On */
 		break;
@@ -1030,15 +1044,12 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
 		return err;
 	}
 
-	size = sizeof(struct fb_info) + sizeof(struct pm2fb_par) + 256 * sizeof(u32);
-
+	size = sizeof(struct pm2fb_par) + 256 * sizeof(u32);
 	info = framebuffer_alloc(size, &pdev->dev);
 	if ( !info )
 		return -ENOMEM;
-	memset(info, 0, size);
-    
-	default_par = info->par;
- 
+	default_par = (struct pm2fb_par *) info->par;
+
 	switch (pdev->device) {
 	case  PCI_DEVICE_ID_TI_TVP4020:
 		strcpy(pm2fb_fix.id, "TVP4020");
@@ -1112,7 +1123,6 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev,
 
 	info->fbops		= &pm2fb_ops;
 	info->fix		= pm2fb_fix; 	
-	info->par		= default_par;
 	info->pseudo_palette	= (void *)(default_par + 1); 
 	info->flags		= FBINFO_FLAG_DEFAULT;
 
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 0c86ff989..bfa3f8b58 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -432,7 +432,7 @@ static inline unsigned int get_pcd(unsigned int pixclock)
          * (DPC) bit? or perhaps set it based on the various clock
          * speeds */
 
-	pcd = (unsigned long long)get_lclk_frequency_10khz() * (unsigned long long)pixclock;
+	pcd = (unsigned long long)get_lcdclk_frequency_10khz() * pixclock;
 	pcd /= 100000000 * 2;
 	/* no need for this, since we should subtract 1 anyway. they cancel */
 	/* pcd += 1; */ /* make up for integer math truncations */
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index 58c2254f8..0c7b267e4 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -1,9 +1,9 @@
-/* 
+/*
  * linux/drivers/video/q40fb.c -- Q40 frame buffer device
  *
- * Copyright (C) 2001 
+ * Copyright (C) 2001
  *
- *      Richard Zidlicky <Richard.Zidlicky@stud.informatik.uni-erlangen.de>
+ *      Richard Zidlicky <rz@linux-m68k.org>
  *
  *  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
@@ -30,9 +30,6 @@
 
 #define Q40_PHYS_SCREEN_ADDR 0xFE800000
 
-static u32 pseudo_palette[17];
-static struct fb_info fb_info;
-
 static struct fb_fix_screeninfo q40fb_fix __initdata = {
 	.id		= "Q40",
 	.smem_len	= 1024*1024,
@@ -48,7 +45,7 @@ static struct fb_var_screeninfo q40fb_var __initdata = {
 	.xres_virtual	= 1024,
 	.yres_virtual	= 512,
 	.bits_per_pixel	= 16,
-    	.red		= {6, 5, 0}, 
+    	.red		= {6, 5, 0},
 	.green		= {11, 5, 0},
 	.blue		= {0, 6, 0},
 	.activate	= FB_ACTIVATE_NOW,
@@ -57,24 +54,8 @@ static struct fb_var_screeninfo q40fb_var __initdata = {
 	.vmode		= FB_VMODE_NONINTERLACED,
 };
 
-/* frame buffer operations */
-int q40fb_init(void);
-
-static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
-                           unsigned blue, unsigned transp,
-                           struct fb_info *info);
-
-static struct fb_ops q40fb_ops = {
-	.owner		= THIS_MODULE,
-	.fb_setcolreg	= q40fb_setcolreg,
-	.fb_fillrect	= cfb_fillrect,
-	.fb_copyarea	= cfb_copyarea,
-	.fb_imageblit	= cfb_imageblit,
-	.fb_cursor	= soft_cursor,
-};
-
 static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
-		  	   unsigned blue, unsigned transp,
+			   unsigned blue, unsigned transp,
 			   struct fb_info *info)
 {
     /*
@@ -82,46 +63,94 @@ static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green,
      *  magnitude.
      *  Return != 0 for invalid regno.
      */
-  
+
+    if (regno > 255)
+	    return 1;
     red>>=11;
     green>>=11;
     blue>>=10;
 
     if (regno < 16) {
-	((u16 *)info->pseudo_palette)[regno] = ((red & 31) <<6) |
+	((u32 *)info->pseudo_palette)[regno] = ((red & 31) <<6) |
 					       ((green & 31) << 11) |
 					       (blue & 63);
     }
     return 0;
 }
 
-int q40fb_init(void)
+static struct fb_ops q40fb_ops = {
+	.owner		= THIS_MODULE,
+	.fb_setcolreg	= q40fb_setcolreg,
+	.fb_fillrect	= cfb_fillrect,
+	.fb_copyarea	= cfb_copyarea,
+	.fb_imageblit	= cfb_imageblit,
+	.fb_cursor	= soft_cursor,
+};
+
+static int __init q40fb_probe(struct device *device)
 {
-        if ( !MACH_IS_Q40)
-	  return -ENXIO;
+	struct platform_device *dev = to_platform_device(device);
+	struct fb_info *info;
+
+	if (!MACH_IS_Q40)
+		return -ENXIO;
 
 	/* mapped in q40/config.c */
 	q40fb_fix.smem_start = Q40_PHYS_SCREEN_ADDR;
-	
-	fb_info.var = q40fb_var;
-	fb_info.fix = q40fb_fix;
-	fb_info.fbops = &q40fb_ops;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;  /* not as module for now */
-	fb_info.pseudo_palette = pseudo_palette;	
-   	fb_info.screen_base = (char *) q40fb_fix.smem_start;
 
-	fb_alloc_cmap(&fb_info.cmap, 16, 0);
+	info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
+	if (!info)
+		return -ENOMEM;
+
+	info->var = q40fb_var;
+	info->fix = q40fb_fix;
+	info->fbops = &q40fb_ops;
+	info->flags = FBINFO_FLAG_DEFAULT;  /* not as module for now */
+	info->pseudo_palette = info->par;
+	info->par = NULL;
+	info->screen_base = (char *) q40fb_fix.smem_start;
+
+	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
+		framebuffer_release(info);
+		return -ENOMEM;
+	}
 
 	master_outb(3, DISPLAY_CONTROL_REG);
 
-	if (register_framebuffer(&fb_info) < 0) {
+	if (register_framebuffer(info) < 0) {
 		printk(KERN_ERR "Unable to register Q40 frame buffer\n");
+		fb_dealloc_cmap(&info->cmap);
+		framebuffer_release(info);
 		return -EINVAL;
 	}
 
         printk(KERN_INFO "fb%d: Q40 frame buffer alive and kicking !\n",
-	       fb_info.node);
+	       info->node);
 	return 0;
 }
 
-MODULE_LICENSE("GPL");	
+static struct device_driver q40fb_driver = {
+	.name	= "q40fb",
+	.bus	= &platform_bus_type,
+	.probe	= q40fb_probe,
+};
+
+static struct platform_device q40fb_device = {
+	.name	= "q40fb",
+};
+
+int __init q40fb_init(void)
+{
+	int ret = 0;
+
+	ret = driver_register(&q40fb_driver);
+
+	if (!ret) {
+		ret = platform_device_register(&q40fb_device);
+		if (ret)
+			driver_unregister(&q40fb_driver);
+	}
+	return ret;
+}
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
index ee54ad812..9f258b07d 100644
--- a/drivers/video/radeonfb.c
+++ b/drivers/video/radeonfb.c
@@ -2252,7 +2252,6 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
 	info->pseudo_palette = rinfo->pseudo_palette;
         info->flags = FBINFO_FLAG_DEFAULT;
         info->fbops = &radeonfb_ops;
-        info->display_fg = NULL;
         info->screen_base = (char *)rinfo->fb_base;
 
 	/* Fill fix common fields */
diff --git a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c
index 5b6d5aaa9..5e2c64f62 100644
--- a/drivers/video/retz3fb.c
+++ b/drivers/video/retz3fb.c
@@ -1432,8 +1432,6 @@ int __init retz3fb_init(void)
 		       fb_info->modename, zinfo->fbsize>>10);
 
 		/* FIXME: This driver cannot be unloaded yet */
-		MOD_INC_USE_COUNT;
-
 		res = 0;
 	}
 	return res;
@@ -1491,16 +1489,6 @@ int init_module(void)
 {
 	return retz3fb_init();
 }
-
-void cleanup_module(void)
-{
-	/*
-	 * Not reached because the usecount will never
-	 * be decremented to zero
-	 *
-	 * FIXME: clean up ... *
-	 */
-}
 #endif
 
 
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 91b1f19d6..1df67bcbc 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -492,17 +492,17 @@ static inline void reverse_order(u32 *l)
  * CALLED FROM:
  * rivafb_cursor()
  */
-static void rivafb_load_cursor_image(struct riva_par *par, u8 *data, 
-				     u8 *mask, u16 bg, u16 fg, u32 w, u32 h)
+static void rivafb_load_cursor_image(struct riva_par *par, u8 *data8,
+				     u8 *mask8, u16 bg, u16 fg, u32 w, u32 h)
 {
 	int i, j, k = 0;
 	u32 b, m, tmp;
+	u32 *data = (u32 *)data8;
+	u32 *mask = (u32 *)mask8;
 
 	for (i = 0; i < h; i++) {
-		b = *((u32 *)data);
-		b = (u32)((u32 *)b + 1);
-		m = *((u32 *)mask);
-		m = (u32)((u32 *)m + 1);
+		b = *data++;
+		m = *mask++;
 		reverse_order(&b);
 		
 		for (j = 0; j < w/2; j++) {
@@ -1620,14 +1620,27 @@ static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 	struct riva_par *par = (struct riva_par *) info->par;
 	struct device_node *dp;
 	unsigned char *pedid = NULL;
+	unsigned char *disptype = NULL;
+	static char *propnames[] = {
+		"DFP,EDID", "LCD,EDID", "EDID", "EDID1", "EDID,B", "EDID,A", NULL };
+	int i;
 
 	dp = pci_device_to_OF_node(pd);
-	pedid = (unsigned char *)get_property(dp, "EDID,B", 0);
-
-	if (pedid) {
+	for (; dp != NULL; dp = dp->child) {
+		disptype = (unsigned char *)get_property(dp, "display-type", NULL);
+		if (disptype == NULL)
+			continue;
+		if (strncmp(disptype, "LCD", 3) != 0)
+			continue;
+		for (i = 0; propnames[i] != NULL; ++i) {
+			pedid = (unsigned char *)
+				get_property(dp, propnames[i], NULL);
+			if (pedid != NULL) {
 		par->EDID = pedid;
 		return 1;
-	} else
+			}
+		}
+	}
 		return 0;
 }
 #endif /* CONFIG_PPC_OF */
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index 7022df087..b14a667db 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -326,6 +326,22 @@ static struct sa1100fb_mach_info brutus_info __initdata = {
 };
 #endif
 
+#ifdef CONFIG_SA1100_COLLIE
+static struct sa1100fb_mach_info collie_info __initdata = {
+	pixclock:	171521,		bpp:		16,
+	xres:		320,		yres:		240,
+
+	hsync_len:	5,		vsync_len:	1,
+	left_margin:	11,		upper_margin:	2,
+	right_margin:	30,		lower_margin:	0,
+
+	sync:		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+
+	lccr0:		LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+	lccr3:		LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+};
+#endif
+
 #ifdef CONFIG_SA1100_FREEBIRD
 #warning Please check this carefully
 static struct sa1100fb_mach_info freebird_info __initdata = {
@@ -635,6 +651,11 @@ sa1100fb_get_machine_info(struct sa1100fb_info *fbi)
 		inf = &brutus_info;
 	}
 #endif
+#ifdef CONFIG_SA1100_COLLIE
+	if (machine_is_collie()) {
+		inf = &collie_info;
+	}
+#endif
 #ifdef CONFIG_SA1100_FREEBIRD
 	if (machine_is_freebird()) {
 		inf = &freebird_info;
@@ -1765,8 +1786,6 @@ static int __init sa1100fb_probe(struct device *dev)
 #endif
 
 	/* This driver cannot be unloaded at the moment */
-	MOD_INC_USE_COUNT;
-
 	return 0;
 
 failed:
diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c
index a09be527d..c1ab754d3 100644
--- a/drivers/video/sbuslib.c
+++ b/drivers/video/sbuslib.c
@@ -122,6 +122,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
 		cmap.red = &red;
 		cmap.green = &green;
 		cmap.blue = &blue;
+		cmap.transp = NULL;
 		for (i = 0; i < count; i++) {
 			int err;
 
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 89479a9eb..4006cf72e 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -166,7 +166,11 @@ static int tdfxfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *inf
 static void tdfxfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 static void tdfxfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);  
 static void tdfxfb_imageblit(struct fb_info *info, const struct fb_image *image); 
+#ifdef CONFIG_FB_3DFX_ACCEL
 static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor);
+#else /* !CONFIG_FB_3DFX_ACCEL */
+#define tdfxfb_cursor soft_cursor
+#endif /* CONFIG_FB_3DFX_ACCEL */
 static int banshee_wait_idle(struct fb_info *info);
 
 static struct fb_ops tdfxfb_ops = {
@@ -180,7 +184,7 @@ static struct fb_ops tdfxfb_ops = {
 	.fb_copyarea	= tdfxfb_copyarea,
 	.fb_imageblit	= tdfxfb_imageblit,
 	.fb_sync	= banshee_wait_idle,
-	.fb_cursor	= soft_cursor,
+	.fb_cursor	= tdfxfb_cursor,
 };
 
 /*
@@ -1001,6 +1005,7 @@ static void tdfxfb_imageblit(struct fb_info *info, const struct fb_image *image)
 	banshee_wait_idle(info);
 }
 
+#ifdef CONFIG_FB_3DFX_ACCEL
 static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 {
 	struct tdfx_par *par = (struct tdfx_par *) info->par;
@@ -1137,6 +1142,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 	spin_unlock_irqrestore(&par->DAClock, flags);
 	return 0;
 }
+#endif /* CONFIG_FB_3DFX_ACCEL */
 
 /**
  *      tdfxfb_probe - Device Initializiation
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c
index 5cd2c2255..3d02b0de9 100644
--- a/drivers/video/tgafb.c
+++ b/drivers/video/tgafb.c
@@ -23,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/fb.h>
 #include <linux/pci.h>
+#include <linux/selection.h>
 #include <asm/io.h>
 #include <video/tgafb.h>
 #include <linux/selection.h>
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index 500e97766..17f8101ff 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -450,7 +450,7 @@ static struct accel_switch accel_image = {
 /*
  * Accel functions called by the upper layers
  */
-
+#ifdef CONFIG_FB_TRIDENT_ACCEL
 static void tridentfb_fillrect(struct fb_info * info, const struct fb_fillrect *fr)
 {
 	int bpp = info->var.bits_per_pixel;
@@ -474,6 +474,11 @@ static void tridentfb_copyarea(struct fb_info *info, const struct fb_copyarea *c
 	acc->copy_rect(ca->sx,ca->sy,ca->dx,ca->dy,ca->width,ca->height);
 	acc->wait_engine();
 }
+#else /* !CONFIG_FB_TRIDENT_ACCEL */
+#define tridentfb_fillrect cfb_fillrect
+#define tridentfb_copyarea cfb_copyarea
+#endif /* CONFIG_FB_TRIDENT_ACCEL */
+
 
 /*
  * Hardware access functions
@@ -1265,10 +1270,8 @@ static struct fb_ops tridentfb_ops = {
 	.fb_blank = tridentfb_blank,
 	.fb_check_var = tridentfb_check_var,
 	.fb_set_par = tridentfb_set_par,
-//	.fb_fillrect = tridentfb_fillrect,
-//	.fb_copyarea= tridentfb_copyarea,
-	.fb_fillrect = cfb_fillrect,
-	.fb_copyarea= cfb_copyarea,
+	.fb_fillrect = tridentfb_fillrect,
+	.fb_copyarea= tridentfb_copyarea,
 	.fb_imageblit = cfb_imageblit,
 	.fb_cursor = soft_cursor,
 };
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index 88571b368..b8cb97508 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -47,12 +47,9 @@ static struct fb_fix_screeninfo vesafb_fix __initdata = {
 	.accel	= FB_ACCEL_NONE,
 };
 
-static struct fb_info fb_info;
-static u32 pseudo_palette[17];
-
 static int             inverse   = 0;
 static int             mtrr      = 1;
-
+static int	       vram __initdata = 0; /* Set amount of memory to be used */
 static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
 static int             ypan       = 0;  /* 0..nothing, 1..ypan, 2..ywrap */
 static unsigned short  *pmi_base  = 0;
@@ -210,14 +207,17 @@ int __init vesafb_setup(char *options)
 			mtrr=1;
 		else if (! strcmp(this_opt, "nomtrr"))
 			mtrr=0;
+		else if (! strncmp(this_opt, "vram:", 5))
+			vram = simple_strtoul(this_opt+5, NULL, 0);
 	}
 	return 0;
 }
 
-int __init vesafb_init(void)
+static int __init vesafb_probe(struct device *device)
 {
-	int video_cmap_len;
-	int i;
+	struct platform_device *dev = to_platform_device(device);
+	struct fb_info *info;
+	int i, err;
 
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
 		return -ENXIO;
@@ -229,7 +229,18 @@ int __init vesafb_init(void)
 	vesafb_defined.xres = screen_info.lfb_width;
 	vesafb_defined.yres = screen_info.lfb_height;
 	vesafb_fix.line_length = screen_info.lfb_linelength;
-	vesafb_fix.smem_len = screen_info.lfb_size * 65536;
+
+	/* Allocate enough memory for double buffering */
+	vesafb_fix.smem_len = screen_info.lfb_width * screen_info.lfb_height * vesafb_defined.bits_per_pixel >> 2;
+
+	/* check that we don't remap more memory than old cards have */
+	if (vesafb_fix.smem_len > (screen_info.lfb_size * 65536))
+		vesafb_fix.smem_len = screen_info.lfb_size * 65536;
+
+	/* Set video size according to vram boot option */
+	if (vram)
+		vesafb_fix.smem_len = vram * 1024 * 1024;
+
 	vesafb_fix.visual   = (vesafb_defined.bits_per_pixel == 8) ?
 		FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
 
@@ -251,17 +262,25 @@ int __init vesafb_init(void)
 		   spaces our resource handlers simply don't know about */
 	}
 
-        fb_info.screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
-	if (!fb_info.screen_base) {
+	info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
+	if (!info) {
 		release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len);
+		return -ENOMEM;
+	}
+	info->pseudo_palette = info->par;
+	info->par = NULL;
+
+        info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
+	if (!info->screen_base) {
 		printk(KERN_ERR
 		       "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
 			vesafb_fix.smem_len, vesafb_fix.smem_start);
-		return -EIO;
+		err = -EIO;
+		goto err;
 	}
 
 	printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
-	       vesafb_fix.smem_start, fb_info.screen_base, vesafb_fix.smem_len/1024);
+	       vesafb_fix.smem_start, info->screen_base, vesafb_fix.smem_len/1024);
 	printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
 	       vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel, vesafb_fix.line_length, screen_info.pages);
 
@@ -331,12 +350,10 @@ int __init vesafb_init(void)
 		       screen_info.red_pos,
 		       screen_info.green_pos,
 		       screen_info.blue_pos);
-		video_cmap_len = 16;
 	} else {
 		vesafb_defined.red.length   = 6;
 		vesafb_defined.green.length = 6;
 		vesafb_defined.blue.length  = 6;
-		video_cmap_len = 256;
 	}
 
 	vesafb_fix.ypanstep  = ypan     ? 1 : 0;
@@ -358,20 +375,51 @@ int __init vesafb_init(void)
 		}
 	}
 	
-	fb_info.fbops = &vesafb_ops;
-	fb_info.var = vesafb_defined;
-	fb_info.fix = vesafb_fix;
-	fb_info.pseudo_palette = pseudo_palette;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+	info->fbops = &vesafb_ops;
+	info->var = vesafb_defined;
+	info->fix = vesafb_fix;
+	info->flags = FBINFO_FLAG_DEFAULT;
+
+	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
+		err = -ENXIO;
+		goto err;
+	}
+	if (register_framebuffer(info)<0) {
+		err = -EINVAL;
+		fb_dealloc_cmap(&info->cmap);
+		goto err;
+	}
+	printk(KERN_INFO "fb%d: %s frame buffer device\n",
+	       info->node, info->fix.id);
+	return 0;
+err:
+	framebuffer_release(info);
+	release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len);
+	return err;
+}
 
-	fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
+static struct device_driver vesafb_driver = {
+	.name	= "vesafb",
+	.bus	= &platform_bus_type,
+	.probe	= vesafb_probe,
+};
 
-	if (register_framebuffer(&fb_info)<0)
-		return -EINVAL;
+static struct platform_device vesafb_device = {
+	.name	= "vesafb",
+};
 
-	printk(KERN_INFO "fb%d: %s frame buffer device\n",
-	       fb_info.node, fb_info.fix.id);
-	return 0;
+int __init vesafb_init(void)
+{
+	int ret;
+
+	ret = driver_register(&vesafb_driver);
+
+	if (!ret) {
+		ret = platform_device_register(&vesafb_device);
+		if (ret)
+			driver_unregister(&vesafb_driver);
+	}
+	return ret;
 }
 
 /*
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 4fce71133..8b01918a5 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -37,9 +37,6 @@ static void *videomemory;
 static u_long videomemorysize = VIDEOMEMSIZE;
 MODULE_PARM(videomemorysize, "l");
 
-static struct fb_info fb_info;
-static u32 vfb_pseudo_palette[17];
-
 static struct fb_var_screeninfo vfb_default __initdata = {
 	.xres =		640,
 	.yres =		480,
@@ -404,18 +401,22 @@ int __init vfb_setup(char *options)
      *  Initialisation
      */
 
-int __init vfb_init(void)
+static void vfb_platform_release(struct device *device)
 {
-	int retval;
+	// This is called when the reference count goes to zero.
+}
 
-	if (!vfb_enable)
-		return -ENXIO;
+static int __init vfb_probe(struct device *device)
+{
+	struct platform_device *dev = to_platform_device(device);
+	struct fb_info *info;
+	int retval = -ENOMEM;
 
 	/*
 	 * For real video cards we use ioremap.
 	 */
 	if (!(videomemory = vmalloc(videomemorysize)))
-		return -ENOMEM;
+		return retval;
 
 	/*
 	 * VFB must clear memory to prevent kernel info
@@ -425,41 +426,98 @@ int __init vfb_init(void)
 	 */
 	memset(videomemory, 0, videomemorysize);
 
-	fb_info.screen_base = videomemory;
-	fb_info.fbops = &vfb_ops;
+	info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
+	if (!info)
+		goto err;
 
-	retval = fb_find_mode(&fb_info.var, &fb_info, NULL,
+	info->screen_base = videomemory;
+	info->fbops = &vfb_ops;
+
+	retval = fb_find_mode(&info->var, info, NULL,
 			      NULL, 0, NULL, 8);
 
 	if (!retval || (retval == 4))
-		fb_info.var = vfb_default;
-	fb_info.fix = vfb_fix;
-	fb_info.pseudo_palette = &vfb_pseudo_palette;
-	fb_info.flags = FBINFO_FLAG_DEFAULT;
+		info->var = vfb_default;
+	info->fix = vfb_fix;
+	info->pseudo_palette = info->par;
+	info->par = NULL;
+	info->flags = FBINFO_FLAG_DEFAULT;
 
-	fb_alloc_cmap(&fb_info.cmap, 256, 0);
+	retval = fb_alloc_cmap(&info->cmap, 256, 0);
+	if (retval < 0)
+		goto err1;
 
-	if (register_framebuffer(&fb_info) < 0) {
-		vfree(videomemory);
-		return -EINVAL;
-	}
+	retval = register_framebuffer(info);
+	if (retval < 0)
+		goto err2;
+	dev_set_drvdata(&dev->dev, info);
 
 	printk(KERN_INFO
 	       "fb%d: Virtual frame buffer device, using %ldK of video memory\n",
-	       fb_info.node, videomemorysize >> 10);
+	       info->node, videomemorysize >> 10);
 	return 0;
+err2:
+	fb_dealloc_cmap(&info->cmap);
+err1:
+	framebuffer_release(info);
+err:
+	vfree(videomemory);
+	return retval;
 }
 
-#ifdef MODULE
+static int vfb_remove(struct device *device)
+{
+	struct fb_info *info = dev_get_drvdata(device);
+
+	if (info) {
+		unregister_framebuffer(info);
+		vfree(videomemory);
+		framebuffer_release(info);
+	}
+	return 0;
+}
+
+static struct device_driver vfb_driver = {
+	.name	= "vfb",
+	.bus	= &platform_bus_type,
+	.probe	= vfb_probe,
+	.remove = vfb_remove,
+};
 
-static void __exit vfb_cleanup(void)
+static struct platform_device vfb_device = {
+	.name	= "vfb",
+	.id	= 0,
+	.dev	= {
+		.release = vfb_platform_release,
+	}
+};
+
+int __init vfb_init(void)
 {
-	unregister_framebuffer(&fb_info);
-	vfree(videomemory);
+	int ret = 0;
+
+	if (!vfb_enable)
+		return -ENXIO;
+
+	ret = driver_register(&vfb_driver);
+
+	if (!ret) {
+		ret = platform_device_register(&vfb_device);
+		if (ret)
+			driver_unregister(&vfb_driver);
+	}
+	return ret;
+}
+
+#ifdef MODULE
+static void __exit vfb_exit(void)
+{
+	platform_device_unregister(&vfb_device);
+	driver_unregister(&vfb_driver);
 }
 
 module_init(vfb_init);
-module_exit(vfb_cleanup);
+module_exit(vfb_exit);
 
 MODULE_LICENSE("GPL");
 #endif				/* MODULE */
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 577355dac..bdcc8ecef 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -1347,7 +1347,7 @@ int __init vga16fb_init(void)
 
 	/* XXX share VGA_FB_PHYS and I/O region with vgacon and others */
 
-	vga16fb.screen_base = ioremap(VGA_MAP_MEM(VGA_FB_PHYS), VGA_FB_PHYS_LEN);
+	vga16fb.screen_base = (void *)VGA_MAP_MEM(VGA_FB_PHYS);
 	if (!vga16fb.screen_base) {
 		printk(KERN_ERR "vga16fb: unable to map device\n");
 		ret = -ENOMEM;
@@ -1372,8 +1372,6 @@ int __init vga16fb_init(void)
 	vga16fb.par = &vga16_par;
 	vga16fb.flags = FBINFO_FLAG_DEFAULT;
 
-	vga16fb.fix.smem_start	= VGA_MAP_MEM(vga16fb.fix.smem_start);
-
 	i = (vga16fb_defined.bits_per_pixel == 8) ? 256 : 16;
 	ret = fb_alloc_cmap(&vga16fb.cmap, i, 0);
 	if (ret) {
diff --git a/drivers/video/virgefb.c b/drivers/video/virgefb.c
index 8d512fd79..ed7874748 100644
--- a/drivers/video/virgefb.c
+++ b/drivers/video/virgefb.c
@@ -1809,7 +1809,6 @@ int __init virgefb_init(void)
 
 	/* TODO: This driver cannot be unloaded yet */
 
-	MOD_INC_USE_COUNT;
 	DPRINTK("EXIT\n");
 	return 0;
 }
@@ -2064,14 +2063,6 @@ int init_module(void)
 {
 	return virgefb_init();
 }
-
-void cleanup_module(void)
-{
-	/* Not reached because the usecount will never be
-	   decremented to zero */
-	unregister_framebuffer(&fb_info);
-	/* TODO: clean up ... */
-}
 #endif /* MODULE */
 
 static int cv3d_has_4mb(void)
diff --git a/fs/Kconfig b/fs/Kconfig
index 20fb92ab6..27c901867 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -244,6 +244,40 @@ config REISERFS_PROC_INFO
 	  Almost everyone but ReiserFS developers and people fine-tuning
 	  reiserfs or tracing problems should say N.
 
+config REISERFS_FS_XATTR
+	bool "ReiserFS extended attributes"
+	depends on REISERFS_FS
+	help
+	  Extended attributes are name:value pairs associated with inodes by
+	  the kernel or by users (see the attr(5) manual page, or visit
+	  <http://acl.bestbits.at/> for details).
+
+	  If unsure, say N.
+
+config REISERFS_FS_POSIX_ACL
+	bool "ReiserFS POSIX Access Control Lists"
+	depends on REISERFS_FS_XATTR
+	help
+	  Posix Access Control Lists (ACLs) support permissions for users and
+	  groups beyond the owner/group/world scheme.
+
+	  To learn more about Access Control Lists, visit the Posix ACLs for
+	  Linux website <http://acl.bestbits.at/>.
+
+	  If you don't know what Access Control Lists are, say N
+
+config REISERFS_FS_SECURITY
+	bool "ReiserFS Security Labels"
+	depends on REISERFS_FS_XATTR
+	help
+	  Security labels support alternative access control models
+	  implemented by security modules like SELinux.  This option
+	  enables an extended attribute handler for file security
+	  labels in the ReiserFS filesystem.
+
+	  If you are not using a security module that requires using
+	  extended attributes for file security labels, say N.
+
 config JFS_FS
 	tristate "JFS filesystem support"
 	select NLS
@@ -282,13 +316,13 @@ config JFS_STATISTICS
 	  to be made available to the user in the /proc/fs/jfs/ directory.
 
 config FS_POSIX_ACL
-# Posix ACL utility routines (for now, only ext2/ext3/jfs)
+# Posix ACL utility routines (for now, only ext2/ext3/jfs/reiserfs)
 #
 # NOTE: you can implement Posix ACLs without these helpers (XFS does).
 # 	Never use this symbol for ifdefs.
 #
 	bool
-	depends on EXT2_FS_POSIX_ACL || EXT3_FS_POSIX_ACL || JFS_POSIX_ACL
+	depends on EXT2_FS_POSIX_ACL || EXT3_FS_POSIX_ACL || JFS_POSIX_ACL || REISERFS_FS_POSIX_ACL
 	default y
 
 config XFS_FS
@@ -468,7 +502,7 @@ config AUTOFS4_FS
 	  automounter (amd), which is a pure user space daemon.
 
 	  To use the automounter you need the user-space tools from
-	  <ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4/>; you also
+	  <ftp://ftp.kernel.org/pub/linux/daemons/autofs/v4/>; you also
 	  want to answer Y to "NFS file system support", below.
 
 	  To compile this support as a module, choose M here: the module will be
@@ -991,7 +1025,7 @@ config HFSPLUS_FS
 	  style features such as file ownership and permissions.
 
 config BEFS_FS
-	tristate "BeOS file systemv(BeFS) support (read only) (EXPERIMENTAL)"
+	tristate "BeOS file system (BeFS) support (read only) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
 	select NLS
 	help
@@ -1535,20 +1569,30 @@ config CIFS
 	  This is the client VFS module for the Common Internet File System
 	  (CIFS) protocol which is the successor to the Server Message Block 
 	  (SMB) protocol, the native file sharing mechanism for most early
-	  PC operating systems.  CIFS is fully supported by current network
-	  file servers such as Windows 2000 (including Windows NT version 4 
+	  PC operating systems.  The CIFS protocol is fully supported by 
+	  file servers such as Windows 2000 (including Windows 2003, NT 4  
 	  and Windows XP) as well by Samba (which provides excellent CIFS
-	  server support for Linux and many other operating systems).  For
-	  production systems the smbfs module may be used instead of this
-	  cifs module since smbfs is currently more stable and provides
-	  support for older servers.  The intent of this module is to provide the
-	  most advanced network file system function for CIFS compliant servers, 
+	  server support for Linux and many other operating systems). Currently
+	  you must use the smbfs client filesystem to access older SMB servers
+	  such as Windows 9x and OS/2.
+
+	  The intent of the cifs module is to provide an advanced
+	  network file system client for mounting to CIFS compliant servers, 
 	  including support for dfs (hierarchical name space), secure per-user
 	  session establishment, safe distributed caching (oplock), optional
-	  packet signing, Unicode and other internationalization improvements, and
-	  optional Winbind (nsswitch) integration.  This module is in an early
-	  development stage, so unless you are specifically interested in this
-	  filesystem, just say N.
+	  packet signing, Unicode and other internationalization improvements, 
+	  and optional Winbind (nsswitch) integration. You do not need to enable
+	  cifs if running only a (Samba) server. It is possible to enable both
+	  smbfs and cifs (e.g. if you are using CIFS for accessing Windows 2003
+	  and Samba 3 servers, and smbfs for accessing old servers). If you need 
+	  to mount to Samba or Windows 2003 servers from this machine, say Y.
+
+config CIFS_STATS
+        bool "CIFS statistics"
+        depends on CIFS
+        help
+          Enabling this option will cause statistics for each server share
+	  mounted by the cifs client to be displayed in /proc/fs/cifs/DebugData
 
 config NCP_FS
 	tristate "NCP file system support (to mount NetWare volumes)"
@@ -1609,22 +1653,6 @@ config CODA_FS_OLD_API
 	  
 	  For most cases you probably want to say N.
 
-#
-# Intermezzo broke when we added the expanded NGROUPS patches
-#
-config INTERMEZZO_FS
-	tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
-	depends on INET && EXPERIMENTAL 
-	help
-	  InterMezzo is a networked file system with disconnected operation
-	  and kernel level write back caching.  It is most often used for
-	  replicating potentially large trees or keeping laptop/desktop copies
-	  in sync.
-
-	  If you say Y or M your kernel or module will provide InterMezzo
-	  support.  You will also need a file server daemon, which you can get
-	  from <http://www.inter-mezzo.org/>.
-
 config AFS_FS
 # for fs/nls/Config.in
 	tristate "Andrew File System support (AFS) (Experimental)"
diff --git a/fs/Makefile b/fs/Makefile
index a288c0cb3..41cac35d1 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_CRAMFS)		+= cramfs/
 obj-$(CONFIG_RAMFS)		+= ramfs/
 obj-$(CONFIG_HUGETLBFS)		+= hugetlbfs/
 obj-$(CONFIG_CODA_FS)		+= coda/
-obj-$(CONFIG_INTERMEZZO_FS)	+= intermezzo/
 obj-$(CONFIG_MINIX_FS)		+= minix/
 obj-$(CONFIG_FAT_FS)		+= fat/
 obj-$(CONFIG_UMSDOS_FS)		+= umsdos/
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index d19e7c5d2..7fcdd24dc 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -615,7 +615,9 @@ static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
 
 	/* the dirent, if it exists, now points to a different vnode */
  not_found:
+	spin_lock(&dentry->d_lock);
 	dentry->d_flags |= DCACHE_NFSFS_RENAMED;
+	spin_unlock(&dentry->d_lock);
 
  out_bad:
 	if (inode) {
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 928e3b1d6..6b6bb7c8a 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -31,8 +31,8 @@ static int afs_file_readpage(struct file *file, struct page *page);
 static int afs_file_invalidatepage(struct page *page, unsigned long offset);
 static int afs_file_releasepage(struct page *page, int gfp_flags);
 
-static ssize_t afs_file_write(struct file *file, const char *buf, size_t size,
-			      loff_t *off);
+static ssize_t afs_file_write(struct file *file, const char __user *buf,
+			      size_t size, loff_t *off);
 
 struct inode_operations afs_file_inode_operations = {
 	.getattr	= afs_inode_getattr,
@@ -61,8 +61,8 @@ struct address_space_operations afs_fs_aops = {
 /*
  * AFS file write
  */
-static ssize_t afs_file_write(struct file *file, const char *buf, size_t size,
-			      loff_t *off)
+static ssize_t afs_file_write(struct file *file, const char __user *buf,
+			      size_t size, loff_t *off)
 {
 	struct afs_vnode *vnode;
 
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 465994066..9c81b8f7e 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -27,7 +27,7 @@ static void *afs_proc_cells_start(struct seq_file *p, loff_t *pos);
 static void *afs_proc_cells_next(struct seq_file *p, void *v, loff_t *pos);
 static void afs_proc_cells_stop(struct seq_file *p, void *v);
 static int afs_proc_cells_show(struct seq_file *m, void *v);
-static ssize_t afs_proc_cells_write(struct file *file, const char *buf,
+static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf,
 				    size_t size, loff_t *_pos);
 
 static struct seq_operations afs_proc_cells_ops = {
@@ -47,9 +47,10 @@ static struct file_operations afs_proc_cells_fops = {
 
 static int afs_proc_rootcell_open(struct inode *inode, struct file *file);
 static int afs_proc_rootcell_release(struct inode *inode, struct file *file);
-static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
+static ssize_t afs_proc_rootcell_read(struct file *file, char __user *buf,
 				      size_t size, loff_t *_pos);
-static ssize_t afs_proc_rootcell_write(struct file *file, const char *buf,
+static ssize_t afs_proc_rootcell_write(struct file *file,
+				       const char __user *buf,
 				       size_t size, loff_t *_pos);
 
 static struct file_operations afs_proc_rootcell_fops = {
@@ -278,7 +279,7 @@ static int afs_proc_cells_show(struct seq_file *m, void *v)
  * handle writes to /proc/fs/afs/cells
  * - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]"
  */
-static ssize_t afs_proc_cells_write(struct file *file, const char *buf,
+static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf,
 				    size_t size, loff_t *_pos)
 {
 	char *kbuf, *name, *args;
@@ -363,7 +364,7 @@ static int afs_proc_rootcell_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
+static ssize_t afs_proc_rootcell_read(struct file *file, char __user *buf,
 				      size_t size, loff_t *_pos)
 {
 	return 0;
@@ -374,7 +375,8 @@ static ssize_t afs_proc_rootcell_read(struct file *file, char *buf,
  * handle writes to /proc/fs/afs/rootcell
  * - to initialize rootcell: echo "cell.name:192.168.231.14"
  */
-static ssize_t afs_proc_rootcell_write(struct file *file, const char *buf,
+static ssize_t afs_proc_rootcell_write(struct file *file,
+				       const char __user *buf,
 				       size_t size, loff_t *_pos)
 {
 	char *kbuf, *s;
diff --git a/fs/aio.c b/fs/aio.c
index bc42eb7a7..6249313ce 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -15,7 +15,7 @@
 #include <linux/aio_abi.h>
 #include <linux/module.h>
 
-//#define DEBUG 1
+#define DEBUG 0
 
 #include <linux/sched.h>
 #include <linux/fs.h>
@@ -64,14 +64,9 @@ static void aio_kick_handler(void *);
 static int __init aio_setup(void)
 {
 	kiocb_cachep = kmem_cache_create("kiocb", sizeof(struct kiocb),
-				0, SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!kiocb_cachep)
-		panic("unable to create kiocb cache\n");
-
+				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 	kioctx_cachep = kmem_cache_create("kioctx", sizeof(struct kioctx),
-				0, SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!kioctx_cachep)
-		panic("unable to create kioctx cache");
+				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
 	aio_wq = create_workqueue("aio");
 
@@ -399,7 +394,7 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx)
 	req->ki_ctx = ctx;
 	req->ki_cancel = NULL;
 	req->ki_retry = NULL;
-	req->ki_user_obj = NULL;
+	req->ki_obj.user = NULL;
 
 	/* Check if the completion queue has enough free space to
 	 * accept an event from this io.
@@ -442,7 +437,7 @@ static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
 {
 	req->ki_ctx = NULL;
 	req->ki_filp = NULL;
-	req->ki_user_obj = NULL;
+	req->ki_obj.user = NULL;
 	kmem_cache_free(kiocb_cachep, req);
 	ctx->reqs_active--;
 
@@ -543,19 +538,25 @@ struct kioctx *lookup_ioctx(unsigned long ctx_id)
 
 static void use_mm(struct mm_struct *mm)
 {
-	struct mm_struct *active_mm = current->active_mm;
+	struct mm_struct *active_mm;
+
 	atomic_inc(&mm->mm_count);
+	task_lock(current);
+	active_mm = current->active_mm;
 	current->mm = mm;
 	if (mm != active_mm) {
 		current->active_mm = mm;
 		activate_mm(active_mm, mm);
 	}
+	task_unlock(current);
 	mmdrop(active_mm);
 }
 
 static void unuse_mm(struct mm_struct *mm)
 {
+	task_lock(current);
 	current->mm = NULL;
+	task_unlock(current);
 	/* active_mm is still 'mm' */
 	enter_lazy_tlb(mm, current);
 }
@@ -604,7 +605,7 @@ void fastcall kick_iocb(struct kiocb *iocb)
 	 * single context. */
 	if (is_sync_kiocb(iocb)) {
 		kiocbSetKicked(iocb);
-		wake_up_process(iocb->ki_user_obj);
+		wake_up_process(iocb->ki_obj.tsk);
 		return;
 	}
 
@@ -613,7 +614,7 @@ void fastcall kick_iocb(struct kiocb *iocb)
 		spin_lock_irqsave(&ctx->ctx_lock, flags);
 		list_add_tail(&iocb->ki_run_list, &ctx->run_list);
 		spin_unlock_irqrestore(&ctx->ctx_lock, flags);
-		schedule_work(&ctx->wq);
+		queue_work(aio_wq, &ctx->wq);
 	}
 }
 
@@ -652,7 +653,7 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2)
 			spin_unlock_irq(&ctx->ctx_lock);
 		}
 		/* sync iocbs put the task here for us */
-		wake_up_process(iocb->ki_user_obj);
+		wake_up_process(iocb->ki_obj.tsk);
 		return ret;
 	}
 
@@ -672,13 +673,13 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2)
 	event = aio_ring_event(info, tail, KM_IRQ0);
 	tail = (tail + 1) % info->nr;
 
-	event->obj = (u64)(unsigned long)iocb->ki_user_obj;
+	event->obj = (u64)(unsigned long)iocb->ki_obj.user;
 	event->data = iocb->ki_user_data;
 	event->res = res;
 	event->res2 = res2;
 
 	dprintk("aio_complete: %p[%lu]: %p: %p %Lx %lx %lx\n",
-		ctx, tail, iocb, iocb->ki_user_obj, iocb->ki_user_data,
+		ctx, tail, iocb, iocb->ki_obj.user, iocb->ki_user_data,
 		res, res2);
 
 	/* after flagging the request as done, we
@@ -776,24 +777,16 @@ static inline void init_timeout(struct timeout *to)
 static inline void set_timeout(long start_jiffies, struct timeout *to,
 			       const struct timespec *ts)
 {
-	unsigned long how_long;
-
-	if (ts->tv_sec < 0 || (!ts->tv_sec && !ts->tv_nsec)) {
+	to->timer.expires = start_jiffies + timespec_to_jiffies(ts);
+	if (time_after(to->timer.expires, jiffies))
+		add_timer(&to->timer);
+	else
 		to->timed_out = 1;
-		return;
-	}
-
-	how_long = ts->tv_sec * HZ;
-#define HZ_NS (1000000000 / HZ)
-	how_long += (ts->tv_nsec + HZ_NS - 1) / HZ_NS;
-	
-	to->timer.expires = jiffies + how_long;
-	add_timer(&to->timer);
 }
 
 static inline void clear_timeout(struct timeout *to)
 {
-	del_timer_sync(&to->timer);
+	del_singleshot_timer_sync(&to->timer);
 }
 
 static int read_events(struct kioctx *ctx,
@@ -939,7 +932,7 @@ static void io_destroy(struct kioctx *ioctx)
  *	pointer is passed for ctxp.  Will fail with -ENOSYS if not
  *	implemented.
  */
-asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t *ctxp)
+asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp)
 {
 	struct kioctx *ioctx = NULL;
 	unsigned long ctx;
@@ -961,6 +954,7 @@ asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t *ctxp)
 		ret = put_user(ioctx->user_id, ctxp);
 		if (!ret)
 			return 0;
+	 	get_ioctx(ioctx);
 		io_destroy(ioctx);
 	}
 
@@ -1028,7 +1022,7 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 		goto out_put_req;
 	}
 
-	req->ki_user_obj = user_iocb;
+	req->ki_obj.user = user_iocb;
 	req->ki_user_data = iocb->aio_data;
 	req->ki_pos = iocb->aio_offset;
 
@@ -1099,7 +1093,7 @@ out_put_req:
  *	fail with -ENOSYS if not implemented.
  */
 asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr,
-			      struct iocb __user **iocbpp)
+			      struct iocb __user * __user *iocbpp)
 {
 	struct kioctx *ctx;
 	long ret = 0;
@@ -1154,7 +1148,7 @@ struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, u32 key
 	/* TODO: use a hash or array, this sucks. */
 	list_for_each(pos, &ctx->active_reqs) {
 		struct kiocb *kiocb = list_kiocb(pos);
-		if (kiocb->ki_user_obj == iocb && kiocb->ki_key == key)
+		if (kiocb->ki_obj.user == iocb && kiocb->ki_key == key)
 			return kiocb;
 	}
 	return NULL;
@@ -1201,7 +1195,7 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
 		struct io_event tmp;
 		pr_debug("calling cancel\n");
 		memset(&tmp, 0, sizeof(tmp));
-		tmp.obj = (u64)(unsigned long)kiocb->ki_user_obj;
+		tmp.obj = (u64)(unsigned long)kiocb->ki_obj.user;
 		tmp.data = kiocb->ki_user_data;
 		ret = cancel(kiocb, &tmp);
 		if (!ret) {
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 0a4b95417..94a12aee2 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -25,15 +25,17 @@
 #include <linux/string.h>
 #include <linux/wait.h>
 #include <linux/sched.h>
+#include <linux/mount.h>
+#include <linux/namei.h>
 #include <asm/current.h>
 #include <asm/uaccess.h>
 
 /* #define DEBUG */
 
 #ifdef DEBUG
-#define DPRINTK(D) do{ printk("pid %d: ", current->pid); printk D; } while(0)
+#define DPRINTK(fmt,args...) do { printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid , __FUNCTION__ , ##args); } while(0)
 #else
-#define DPRINTK(D) do {} while(0)
+#define DPRINTK(fmt,args...) do {} while(0)
 #endif
 
 #define AUTOFS_SUPER_MAGIC 0x0187
@@ -82,7 +84,7 @@ struct autofs_wait_queue {
 	char *name;
 	/* This is for status reporting upon return */
 	int status;
-	int wait_ctr;
+	atomic_t wait_ctr;
 };
 
 #define AUTOFS_SBI_MAGIC 0x6d4a556d
@@ -93,8 +95,12 @@ struct autofs_sb_info {
 	pid_t oz_pgrp;
 	int catatonic;
 	int version;
+	int sub_version;
 	unsigned long exp_timeout;
+	int reghost_enabled;
+	int needs_reghost;
 	struct super_block *sb;
+	struct semaphore wq_sem;
 	struct autofs_wait_queue *queues; /* Wait queue pointer */
 };
 
@@ -125,6 +131,12 @@ static inline int autofs4_ispending(struct dentry *dentry)
 		(inf != NULL && inf->flags & AUTOFS_INF_EXPIRING);
 }
 
+static inline void autofs4_copy_atime(struct file *src, struct file *dst)
+{
+	dst->f_dentry->d_inode->i_atime = src->f_dentry->d_inode->i_atime;
+	return;
+}
+
 struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *);
 struct autofs_info *autofs4_init_inf(struct autofs_sb_info *, mode_t mode);
 void autofs4_free_ino(struct autofs_info *);
@@ -132,15 +144,17 @@ void autofs4_free_ino(struct autofs_info *);
 /* Expiration */
 int is_autofs4_dentry(struct dentry *);
 int autofs4_expire_run(struct super_block *, struct vfsmount *,
-			struct autofs_sb_info *, struct autofs_packet_expire *);
+			struct autofs_sb_info *,
+			struct autofs_packet_expire __user *);
 int autofs4_expire_multi(struct super_block *, struct vfsmount *,
-			struct autofs_sb_info *, int *);
+			struct autofs_sb_info *, int __user *);
 
 /* Operations structures */
 
 extern struct inode_operations autofs4_symlink_inode_operations;
 extern struct inode_operations autofs4_dir_inode_operations;
 extern struct inode_operations autofs4_root_inode_operations;
+extern struct file_operations autofs4_dir_operations;
 extern struct file_operations autofs4_root_operations;
 
 /* Initializing function */
@@ -157,6 +171,24 @@ enum autofs_notify
 	NFY_EXPIRE
 };
 
-int autofs4_wait(struct autofs_sb_info *,struct qstr *, enum autofs_notify);
+int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
 int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int);
 void autofs4_catatonic_mode(struct autofs_sb_info *);
+
+static inline int simple_positive(struct dentry *dentry)
+{
+	return dentry->d_inode && !d_unhashed(dentry);
+}
+
+static inline int simple_empty_nolock(struct dentry *dentry)
+{
+	struct dentry *child;
+	int ret = 0;
+
+	list_for_each_entry(child, &dentry->d_subdirs, d_child)
+		if (simple_positive(child))
+			goto out;
+	ret = 1;
+out:
+	return ret;
+}
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 4339a52a0..5ebffa647 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -4,6 +4,7 @@
  *
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *  Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
+ *  Copyright 2001-2003 Ian Kent <raven@themaw.net>
  *
  * This file is part of the Linux kernel and is made available under
  * the terms of the GNU General Public License, version 2, or at your
@@ -12,139 +13,198 @@
  * ------------------------------------------------------------------------- */
 
 #include "autofs_i.h"
-#include <linux/mount.h>
 
-/*
- * Determine if a subtree of the namespace is busy.
- *
- * mnt is the mount tree under the autofs mountpoint
+static unsigned long now;
+
+/* Check if a dentry can be expired return 1 if it can else return 0 */
+static inline int autofs4_can_expire(struct dentry *dentry,
+					unsigned long timeout, int do_now)
+{
+	struct autofs_info *ino = autofs4_dentry_ino(dentry);
+
+	/* dentry in the process of being deleted */
+	if (ino == NULL)
+		return 0;
+
+	/* No point expiring a pending mount */
+	if (dentry->d_flags & DCACHE_AUTOFS_PENDING)
+		return 0;
+
+	if (!do_now) {
+		/* Too young to die */
+		if (time_after(ino->last_used + timeout, now))
+			return 0;
+
+		/* update last_used here :-
+		   - obviously makes sense if it is in use now
+		   - less obviously, prevents rapid-fire expire
+		     attempts if expire fails the first time */
+		ino->last_used = now;
+	}
+
+	return 1;
+}
+
+/* Check a mount point for busyness return 1 if not busy, otherwise */
+static int autofs4_check_mount(struct vfsmount *mnt, struct dentry *dentry)
+{
+	int status = 0;
+
+	DPRINTK("dentry %p %.*s",
+		dentry, (int)dentry->d_name.len, dentry->d_name.name);
+
+	mntget(mnt);
+	dget(dentry);
+
+	if (!follow_down(&mnt, &dentry))
+		goto done;
+
+	while (d_mountpoint(dentry) && follow_down(&mnt, &dentry))
+		;
+
+	/* This is an autofs submount, we can't expire it */
+	if (is_autofs4_dentry(dentry))
+		goto done;
+
+	/* The big question */
+	if (may_umount_tree(mnt) == 0)
+		status = 1;
+done:
+	DPRINTK("returning = %d", status);
+	mntput(mnt);
+	dput(dentry);
+	return status;
+}
+
+/* Check a directory tree of mount points for busyness
+ * The tree is not busy iff no mountpoints are busy
+ * Return 1 if the tree is busy or 0 otherwise
  */
-static inline int is_vfsmnt_tree_busy(struct vfsmount *mnt)
+static int autofs4_check_tree(struct vfsmount *mnt,
+	       		      struct dentry *top,
+			      unsigned long timeout,
+			      int do_now)
 {
-	struct vfsmount *this_parent = mnt;
+	struct dentry *this_parent = top;
 	struct list_head *next;
-	int count;
 
-	count = atomic_read(&mnt->mnt_count) - 1;
+	DPRINTK("parent %p %.*s",
+		top, (int)top->d_name.len, top->d_name.name);
 
+	/* Negative dentry - give up */
+	if (!simple_positive(top))
+		return 0;
+
+	/* Timeout of a tree mount is determined by its top dentry */
+	if (!autofs4_can_expire(top, timeout, do_now))
+		return 0;
+
+	spin_lock(&dcache_lock);
 repeat:
-	next = this_parent->mnt_mounts.next;
-	DPRINTK(("is_vfsmnt_tree_busy: mnt=%p, this_parent=%p, next=%p\n",
-		 mnt, this_parent, next));
+	next = this_parent->d_subdirs.next;
 resume:
-	for( ; next != &this_parent->mnt_mounts; next = next->next) {
-		struct vfsmount *p = list_entry(next, struct vfsmount,
-						mnt_child);
+	while (next != &this_parent->d_subdirs) {
+		struct dentry *dentry = list_entry(next, struct dentry, d_child);
 
-		/* -1 for struct vfs_mount's normal count, 
-		   -1 to compensate for child's reference to parent */
-		count += atomic_read(&p->mnt_count) - 1 - 1;
+		/* Negative dentry - give up */
+		if (!simple_positive(dentry)) {
+			next = next->next;
+			continue;
+		}
 
-		DPRINTK(("is_vfsmnt_tree_busy: p=%p, count now %d\n",
-			 p, count));
+		DPRINTK("dentry %p %.*s",
+			dentry, (int)dentry->d_name.len, dentry->d_name.name);
 
-		if (!list_empty(&p->mnt_mounts)) {
-			this_parent = p;
+		if (!simple_empty_nolock(dentry)) {
+			this_parent = dentry;
 			goto repeat;
 		}
-		/* root is busy if any leaf is busy */
-		if (atomic_read(&p->mnt_count) > 1)
-			return 1;
-	}
 
-	/* All done at this level ... ascend and resume the search. */
-	if (this_parent != mnt) {
-		next = this_parent->mnt_child.next; 
-		this_parent = this_parent->mnt_parent;
-		goto resume;
-	}
+		dentry = dget(dentry);
+		spin_unlock(&dcache_lock);
 
-	DPRINTK(("is_vfsmnt_tree_busy: count=%d\n", count));
-	return count != 0; /* remaining users? */
-}
+		if (d_mountpoint(dentry)) {
+			/* First busy => tree busy */
+			if (!autofs4_check_mount(mnt, dentry)) {
+				dput(dentry);
+				return 0;
+			}
+		}
 
-/* Traverse a dentry's list of vfsmounts and return the number of
-   non-busy mounts */
-static int check_vfsmnt(struct vfsmount *mnt, struct dentry *dentry)
-{
-	int ret = dentry->d_mounted;
-	struct vfsmount *vfs = lookup_mnt(mnt, dentry);
+		dput(dentry);
+		spin_lock(&dcache_lock);
+		next = next->next;
+	}
 
-	if (vfs) {
-		mntput(vfs);
-		if (is_vfsmnt_tree_busy(vfs))
-			ret--;
+	if (this_parent != top) {
+		next = this_parent->d_child.next;
+		this_parent = this_parent->d_parent;
+		goto resume;
 	}
-	DPRINTK(("check_vfsmnt: ret=%d\n", ret));
-	return ret;
+	spin_unlock(&dcache_lock);
+
+	return 1;
 }
 
-/* Check dentry tree for busyness.  If a dentry appears to be busy
-   because it is a mountpoint, check to see if the mounted
-   filesystem is busy. */
-static int is_tree_busy(struct vfsmount *topmnt, struct dentry *top)
+struct dentry *autofs4_check_leaves(struct vfsmount *mnt,
+				    struct dentry *parent,
+				    unsigned long timeout,
+				    int do_now)
 {
-	struct dentry *this_parent;
+	struct dentry *this_parent = parent;
 	struct list_head *next;
-	int count;
 
-	count = atomic_read(&top->d_count);
-	
-	DPRINTK(("is_tree_busy: top=%p initial count=%d\n", 
-		 top, count));
-	this_parent = top;
+	DPRINTK("parent %p %.*s",
+		parent, (int)parent->d_name.len, parent->d_name.name);
 
-	if (is_autofs4_dentry(top)) {
-		count--;
-		DPRINTK(("is_tree_busy: autofs; count=%d\n", count));
-	}
-
-	if (d_mountpoint(top))
-		count -= check_vfsmnt(topmnt, top);
-
- repeat:
+	spin_lock(&dcache_lock);
+repeat:
 	next = this_parent->d_subdirs.next;
- resume:
+resume:
 	while (next != &this_parent->d_subdirs) {
-		int adj = 0;
-		struct dentry *dentry = list_entry(next, struct dentry,
-						   d_child);
-		next = next->next;
-
-		count += atomic_read(&dentry->d_count) - 1;
-
-		if (d_mountpoint(dentry))
-			adj += check_vfsmnt(topmnt, dentry);
+		struct dentry *dentry = list_entry(next, struct dentry, d_child);
 
-		if (is_autofs4_dentry(dentry)) {
-			adj++;
-			DPRINTK(("is_tree_busy: autofs; adj=%d\n",
-				 adj));
+		/* Negative dentry - give up */
+		if (!simple_positive(dentry)) {
+			next = next->next;
+			continue;
 		}
 
-		count -= adj;
+		DPRINTK("dentry %p %.*s",
+			dentry, (int)dentry->d_name.len, dentry->d_name.name);
 
 		if (!list_empty(&dentry->d_subdirs)) {
 			this_parent = dentry;
 			goto repeat;
 		}
 
-		if (atomic_read(&dentry->d_count) != adj) {
-			DPRINTK(("is_tree_busy: busy leaf (d_count=%d adj=%d)\n",
-				 atomic_read(&dentry->d_count), adj));
-			return 1;
+		dentry = dget(dentry);
+		spin_unlock(&dcache_lock);
+
+		if (d_mountpoint(dentry)) {
+			/* Can we expire this guy */
+			if (!autofs4_can_expire(dentry, timeout, do_now))
+				goto cont;
+
+			/* Can we umount this guy */
+			if (autofs4_check_mount(mnt, dentry))
+				return dentry;
+
 		}
+cont:
+		dput(dentry);
+		spin_lock(&dcache_lock);
+		next = next->next;
 	}
 
-	/* All done at this level ... ascend and resume the search. */
-	if (this_parent != top) {
-		next = this_parent->d_child.next; 
+	if (this_parent != parent) {
+		next = this_parent->d_child.next;
 		this_parent = this_parent->d_parent;
 		goto resume;
 	}
+	spin_unlock(&dcache_lock);
 
-	DPRINTK(("is_tree_busy: count=%d\n", count));
-	return count != 0; /* remaining users? */
+	return NULL;
 }
 
 /*
@@ -156,61 +216,86 @@ static int is_tree_busy(struct vfsmount *topmnt, struct dentry *top)
 static struct dentry *autofs4_expire(struct super_block *sb,
 				     struct vfsmount *mnt,
 				     struct autofs_sb_info *sbi,
-				     int do_now)
+				     int how)
 {
-	unsigned long now = jiffies;
 	unsigned long timeout;
 	struct dentry *root = sb->s_root;
-	struct list_head *tmp;
+	struct dentry *expired = NULL;
+	struct list_head *next;
+	int do_now = how & AUTOFS_EXP_IMMEDIATE;
+	int exp_leaves = how & AUTOFS_EXP_LEAVES;
 
-	if (!sbi->exp_timeout || !root)
+	if ( !sbi->exp_timeout || !root )
 		return NULL;
 
+	now = jiffies;
 	timeout = sbi->exp_timeout;
 
 	spin_lock(&dcache_lock);
-	for(tmp = root->d_subdirs.next;
-	    tmp != &root->d_subdirs; 
-	    tmp = tmp->next) {
-		struct autofs_info *ino;
-		struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
-
-		if (dentry->d_inode == NULL)
-			continue;
+	next = root->d_subdirs.next;
 
-		ino = autofs4_dentry_ino(dentry);
+	/* On exit from the loop expire is set to a dgot dentry
+	 * to expire or it's NULL */
+	while ( next != &root->d_subdirs ) {
+		struct dentry *dentry = list_entry(next, struct dentry, d_child);
 
-		if (ino == NULL) {
-			/* dentry in the process of being deleted */
+		/* Negative dentry - give up */
+		if ( !simple_positive(dentry) ) {
+			next = next->next;
 			continue;
 		}
 
-		/* No point expiring a pending mount */
-		if (dentry->d_flags & DCACHE_AUTOFS_PENDING)
-			continue;
+		dentry = dget(dentry);
+		spin_unlock(&dcache_lock);
 
-		if (!do_now) {
-			/* Too young to die */
-			if (time_after(ino->last_used + timeout, now))
-				continue;
-		
-			/* update last_used here :- 
-			   - obviously makes sense if it is in use now
-			   - less obviously, prevents rapid-fire expire
-			     attempts if expire fails the first time */
-			ino->last_used = now;
+		/* Case 1: indirect mount or top level direct mount */
+		if (d_mountpoint(dentry)) {
+			DPRINTK("checking mountpoint %p %.*s",
+				dentry, (int)dentry->d_name.len, dentry->d_name.name);
+
+			/* Can we expire this guy */
+			if (!autofs4_can_expire(dentry, timeout, do_now))
+				goto next;
+
+			/* Can we umount this guy */
+			if (autofs4_check_mount(mnt, dentry)) {
+				expired = dentry;
+				break;
+			}
+			goto next;
 		}
-		if (!is_tree_busy(mnt, dentry)) {
-			DPRINTK(("autofs_expire: returning %p %.*s\n",
-				 dentry, (int)dentry->d_name.len, dentry->d_name.name));
-			/* Start from here next time */
-			list_del(&root->d_subdirs);
-			list_add(&root->d_subdirs, &dentry->d_child);
-			dget(dentry);
-			spin_unlock(&dcache_lock);
-
-			return dentry;
+
+		if ( simple_empty(dentry) )
+			goto next;
+
+		/* Case 2: tree mount, expire iff entire tree is not busy */
+		if (!exp_leaves) {
+			if (autofs4_check_tree(mnt, dentry, timeout, do_now)) {
+			expired = dentry;
+			break;
+			}
+		/* Case 3: direct mount, expire individual leaves */
+		} else {
+			expired = autofs4_check_leaves(mnt, dentry, timeout, do_now);
+			if (expired) {
+				dput(dentry);
+				break;
+			}
 		}
+next:
+		dput(dentry);
+		spin_lock(&dcache_lock);
+		next = next->next;
+	}
+
+	if ( expired ) {
+		DPRINTK("returning %p %.*s",
+			expired, (int)expired->d_name.len, expired->d_name.name);
+		spin_lock(&dcache_lock);
+		list_del(&expired->d_parent->d_subdirs);
+		list_add(&expired->d_parent->d_subdirs, &expired->d_child);
+		spin_unlock(&dcache_lock);
+		return expired;
 	}
 	spin_unlock(&dcache_lock);
 
@@ -221,7 +306,7 @@ static struct dentry *autofs4_expire(struct super_block *sb,
 int autofs4_expire_run(struct super_block *sb,
 		      struct vfsmount *mnt,
 		      struct autofs_sb_info *sbi,
-		      struct autofs_packet_expire *pkt_p)
+		      struct autofs_packet_expire __user *pkt_p)
 {
 	struct autofs_packet_expire pkt;
 	struct dentry *dentry;
@@ -248,7 +333,7 @@ int autofs4_expire_run(struct super_block *sb,
 /* Call repeatedly until it returns -EAGAIN, meaning there's nothing
    more to be done */
 int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
-			struct autofs_sb_info *sbi, int *arg)
+			struct autofs_sb_info *sbi, int __user *arg)
 {
 	struct dentry *dentry;
 	int ret = -EAGAIN;
@@ -263,7 +348,7 @@ int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
 		/* This is synchronous because it makes the daemon a
                    little easier */
 		de_info->flags |= AUTOFS_INF_EXPIRING;
-		ret = autofs4_wait(sbi, &dentry->d_name, NFY_EXPIRE);
+		ret = autofs4_wait(sbi, dentry, NFY_EXPIRE);
 		de_info->flags &= ~AUTOFS_INF_EXPIRING;
 		dput(dentry);
 	}
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 649c3dfd1..3b8e34a7a 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -87,7 +87,7 @@ static void autofs4_put_super(struct super_block *sb)
 
 	kfree(sbi);
 
-	DPRINTK(("autofs: shutting down\n"));
+	DPRINTK("shutting down");
 }
 
 static struct super_operations autofs4_sops = {
@@ -187,12 +187,13 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	struct file * pipe;
 	int pipefd;
 	struct autofs_sb_info *sbi;
+	struct autofs_info *ino;
 	int minproto, maxproto;
 
 	sbi = (struct autofs_sb_info *) kmalloc(sizeof(*sbi), GFP_KERNEL);
 	if ( !sbi )
 		goto fail_unlock;
-	DPRINTK(("autofs: starting up, sbi = %p\n",sbi));
+	DPRINTK("starting up, sbi = %p",sbi);
 
 	memset(sbi, 0, sizeof(*sbi));
 
@@ -203,6 +204,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	sbi->oz_pgrp = process_group(current);
 	sbi->sb = s;
 	sbi->version = 0;
+	sbi->sub_version = 0;
+	init_MUTEX(&sbi->wq_sem);
 	sbi->queues = NULL;
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
@@ -212,7 +215,11 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	/*
 	 * Get the root inode and dentry, but defer checking for errors.
 	 */
-	root_inode = autofs4_get_inode(s, autofs4_mkroot(sbi));
+	ino = autofs4_mkroot(sbi);
+	if (!ino)
+		goto fail_free;
+	root_inode = autofs4_get_inode(s, ino);
+	kfree(ino);
 	if (!root_inode)
 		goto fail_free;
 
@@ -244,8 +251,9 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	}
 
 	sbi->version = maxproto > AUTOFS_MAX_PROTO_VERSION ? AUTOFS_MAX_PROTO_VERSION : maxproto;
+	sbi->sub_version = AUTOFS_PROTO_SUBVERSION;
 
-	DPRINTK(("autofs: pipe fd = %d, pgrp = %u\n", pipefd, sbi->oz_pgrp));
+	DPRINTK("pipe fd = %d, pgrp = %u", pipefd, sbi->oz_pgrp);
 	pipe = fget(pipefd);
 	
 	if ( !pipe ) {
@@ -305,7 +313,7 @@ struct inode *autofs4_get_inode(struct super_block *sb,
 	if (S_ISDIR(inf->mode)) {
 		inode->i_nlink = 2;
 		inode->i_op = &autofs4_dir_inode_operations;
-		inode->i_fop = &simple_dir_operations;
+		inode->i_fop = &autofs4_dir_operations;
 	} else if (S_ISLNK(inf->mode)) {
 		inode->i_size = inf->size;
 		inode->i_op = &autofs4_symlink_inode_operations;
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 971dfa29b..1ff9adb6a 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -4,6 +4,7 @@
  *
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
  *  Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
+ *  Copyright 2001-2003 Ian Kent <raven@themaw.net>
  *
  * This file is part of the Linux kernel and is made available under
  * the terms of the GNU General Public License, version 2, or at your
@@ -24,17 +25,28 @@ static int autofs4_dir_unlink(struct inode *,struct dentry *);
 static int autofs4_dir_rmdir(struct inode *,struct dentry *);
 static int autofs4_dir_mkdir(struct inode *,struct dentry *,int);
 static int autofs4_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
+static int autofs4_dir_open(struct inode *inode, struct file *file);
+static int autofs4_dir_close(struct inode *inode, struct file *file);
+static int autofs4_dir_readdir(struct file * filp, void * dirent, filldir_t filldir);
+static int autofs4_root_readdir(struct file * filp, void * dirent, filldir_t filldir);
 static struct dentry *autofs4_root_lookup(struct inode *,struct dentry *, struct nameidata *);
+static int autofs4_dcache_readdir(struct file *, void *, filldir_t);
 
 struct file_operations autofs4_root_operations = {
 	.open		= dcache_dir_open,
 	.release	= dcache_dir_close,
-	.llseek		= dcache_dir_lseek,
 	.read		= generic_read_dir,
-	.readdir	= dcache_readdir,
+	.readdir	= autofs4_root_readdir,
 	.ioctl		= autofs4_root_ioctl,
 };
 
+struct file_operations autofs4_dir_operations = {
+	.open		= autofs4_dir_open,
+	.release	= autofs4_dir_close,
+	.read		= generic_read_dir,
+	.readdir	= autofs4_dir_readdir,
+};
+
 struct inode_operations autofs4_root_inode_operations = {
 	.lookup		= autofs4_root_lookup,
 	.unlink		= autofs4_dir_unlink,
@@ -51,12 +63,35 @@ struct inode_operations autofs4_dir_inode_operations = {
 	.rmdir		= autofs4_dir_rmdir,
 };
 
+static int autofs4_root_readdir(struct file *file, void *dirent,
+				filldir_t filldir)
+{
+	struct autofs_sb_info *sbi = autofs4_sbi(file->f_dentry->d_sb);
+	int oz_mode = autofs4_oz_mode(sbi);
+
+	DPRINTK("called, filp->f_pos = %lld", file->f_pos);
+
+	/*
+	 * Don't set reghost flag if:
+	 * 1) f_pos is larger than zero -- we've already been here.
+	 * 2) we haven't even enabled reghosting in the 1st place.
+	 * 3) this is the daemon doing a readdir
+	 */
+	if (oz_mode && file->f_pos == 0 && sbi->reghost_enabled)
+		sbi->needs_reghost = 1;
+
+	DPRINTK("needs_reghost = %d", sbi->needs_reghost);
+
+	return autofs4_dcache_readdir(file, dirent, filldir);
+}
+
 /* Update usage from here to top of tree, so that scan of
    top-level directories will give a useful result */
 static void autofs4_update_usage(struct dentry *dentry)
 {
 	struct dentry *top = dentry->d_sb->s_root;
 
+	spin_lock(&dcache_lock);
 	for(; dentry != top; dentry = dentry->d_parent) {
 		struct autofs_info *ino = autofs4_dentry_ino(dentry);
 
@@ -65,11 +100,194 @@ static void autofs4_update_usage(struct dentry *dentry)
 			ino->last_used = jiffies;
 		}
 	}
+	spin_unlock(&dcache_lock);
+}
+
+/*
+ * From 2.4 kernel readdir.c
+ */
+static int autofs4_dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
+{
+	int i;
+	struct dentry *dentry = filp->f_dentry;
+
+	i = filp->f_pos;
+	switch (i) {
+		case 0:
+			if (filldir(dirent, ".", 1, i, dentry->d_inode->i_ino, DT_DIR) < 0)
+				break;
+			i++;
+			filp->f_pos++;
+			/* fallthrough */
+		case 1:
+			if (filldir(dirent, "..", 2, i, dentry->d_parent->d_inode->i_ino, DT_DIR) < 0)
+				break;
+			i++;
+			filp->f_pos++;
+			/* fallthrough */
+		default: {
+			struct list_head *list;
+			int j = i-2;
+
+			spin_lock(&dcache_lock);
+			list = dentry->d_subdirs.next;
+
+			for (;;) {
+				if (list == &dentry->d_subdirs) {
+					spin_unlock(&dcache_lock);
+					return 0;
+				}
+				if (!j)
+					break;
+				j--;
+				list = list->next;
+			}
+
+			while(1) {
+				struct dentry *de = list_entry(list, struct dentry, d_child);
+
+				if (!d_unhashed(de) && de->d_inode) {
+					spin_unlock(&dcache_lock);
+					if (filldir(dirent, de->d_name.name, de->d_name.len, filp->f_pos, de->d_inode->i_ino, DT_UNKNOWN) < 0)
+						break;
+					spin_lock(&dcache_lock);
+				}
+				filp->f_pos++;
+				list = list->next;
+				if (list != &dentry->d_subdirs)
+					continue;
+				spin_unlock(&dcache_lock);
+				break;
+			}
+		}
+	}
+	return 0;
+}
+
+static int autofs4_dir_open(struct inode *inode, struct file *file)
+{
+	struct dentry *dentry = file->f_dentry;
+	struct vfsmount *mnt = file->f_vfsmnt;
+	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
+	int status;
+
+	DPRINTK("file=%p dentry=%p %.*s",
+		file, dentry, dentry->d_name.len, dentry->d_name.name);
+
+	if (autofs4_oz_mode(sbi))
+		goto out;
+
+	if (autofs4_ispending(dentry)) {
+		DPRINTK("dentry busy");
+		return -EBUSY;
+	}
+
+	if (!d_mountpoint(dentry) && dentry->d_op && dentry->d_op->d_revalidate) {
+		struct nameidata nd;
+		int empty;
+
+		/* In case there are stale directory dentrys from a failed mount */
+		spin_lock(&dcache_lock);
+		empty = list_empty(&dentry->d_subdirs);
+		spin_unlock(&dcache_lock);
+
+		if (!empty)
+			d_invalidate(dentry);
+
+		nd.flags = LOOKUP_DIRECTORY;
+		status = (dentry->d_op->d_revalidate)(dentry, &nd);
+
+		if (!status)
+			return -ENOENT;
+	}
+
+	if (d_mountpoint(dentry)) {
+		struct file *fp = NULL;
+		struct vfsmount *fp_mnt = mntget(mnt);
+		struct dentry *fp_dentry = dget(dentry);
+
+		while (follow_down(&fp_mnt, &fp_dentry) && d_mountpoint(fp_dentry));
+
+		fp = dentry_open(fp_dentry, fp_mnt, file->f_flags);
+		status = PTR_ERR(fp);
+		if (IS_ERR(fp)) {
+			file->private_data = NULL;
+			return status;
+		}
+		file->private_data = fp;
+	}
+out:
+	return 0;
+}
+
+static int autofs4_dir_close(struct inode *inode, struct file *file)
+{
+	struct dentry *dentry = file->f_dentry;
+	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
+
+	DPRINTK("file=%p dentry=%p %.*s",
+		file, dentry, dentry->d_name.len, dentry->d_name.name);
+
+	if (autofs4_oz_mode(sbi))
+		goto out;
+
+	if (autofs4_ispending(dentry)) {
+		DPRINTK("dentry busy");
+		return -EBUSY;
+	}
+
+	if (d_mountpoint(dentry)) {
+		struct file *fp = file->private_data;
+
+		if (!fp)
+			return -ENOENT;
+
+		filp_close(fp, current->files);
+		file->private_data = NULL;
+	}
+out:
+	return 0;
+}
+
+static int autofs4_dir_readdir(struct file *file, void *dirent, filldir_t filldir)
+{
+	struct dentry *dentry = file->f_dentry;
+	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
+	int status;
+
+	DPRINTK("file=%p dentry=%p %.*s",
+		file, dentry, dentry->d_name.len, dentry->d_name.name);
+
+	if (autofs4_oz_mode(sbi))
+		goto out;
+
+	if (autofs4_ispending(dentry)) {
+		DPRINTK("dentry busy");
+		return -EBUSY;
+	}
+
+	if (d_mountpoint(dentry)) {
+		struct file *fp = file->private_data;
+
+		if (!fp)
+			return -ENOENT;
+
+		if (!fp->f_op || !fp->f_op->readdir)
+			goto out;
+
+		status = vfs_readdir(fp, filldir, dirent);
+		file->f_pos = fp->f_pos;
+		if (status)
+			autofs4_copy_atime(file, fp);
+		return status;
+	}
+out:
+	return autofs4_dcache_readdir(file, dirent, filldir);
 }
 
 static int try_to_fill_dentry(struct dentry *dentry, 
 			      struct super_block *sb,
-			      struct autofs_sb_info *sbi)
+			      struct autofs_sb_info *sbi, int flags)
 {
 	struct autofs_info *de_info = autofs4_dentry_ino(dentry);
 	int status = 0;
@@ -78,28 +296,27 @@ static int try_to_fill_dentry(struct dentry *dentry,
            when expiration is done to trigger mount request with a new
            dentry */
 	if (de_info && (de_info->flags & AUTOFS_INF_EXPIRING)) {
-		DPRINTK(("try_to_fill_entry: waiting for expire %p name=%.*s, flags&PENDING=%s de_info=%p de_info->flags=%x\n",
-			 dentry, dentry->d_name.len, dentry->d_name.name, 
-			 dentry->d_flags & DCACHE_AUTOFS_PENDING?"t":"f",
-			 de_info, de_info?de_info->flags:0));
-		status = autofs4_wait(sbi, &dentry->d_name, NFY_NONE);
+		DPRINTK("waiting for expire %p name=%.*s",
+			 dentry, dentry->d_name.len, dentry->d_name.name);
+
+		status = autofs4_wait(sbi, dentry, NFY_NONE);
 		
-		DPRINTK(("try_to_fill_entry: expire done status=%d\n", status));
+		DPRINTK("expire done status=%d", status);
 		
 		return 0;
 	}
 
-	DPRINTK(("try_to_fill_entry: dentry=%p %.*s ino=%p\n", 
-		 dentry, dentry->d_name.len, dentry->d_name.name, dentry->d_inode));
+	DPRINTK("dentry=%p %.*s ino=%p",
+		 dentry, dentry->d_name.len, dentry->d_name.name, dentry->d_inode);
 
 	/* Wait for a pending mount, triggering one if there isn't one already */
-	while(dentry->d_inode == NULL) {
-		DPRINTK(("try_to_fill_entry: waiting for mount name=%.*s, de_info=%p de_info->flags=%x\n",
-			 dentry->d_name.len, dentry->d_name.name, 
-			 de_info, de_info?de_info->flags:0));
-		status = autofs4_wait(sbi, &dentry->d_name, NFY_MOUNT);
+	if (dentry->d_inode == NULL) {
+		DPRINTK("waiting for mount name=%.*s",
+			 dentry->d_name.len, dentry->d_name.name);
+
+		status = autofs4_wait(sbi, dentry, NFY_MOUNT);
 		 
-		DPRINTK(("try_to_fill_entry: mount done status=%d\n", status));
+		DPRINTK("mount done status=%d", status);
 
 		if (status && dentry->d_inode)
 			return 0; /* Try to get the kernel to invalidate this dentry */
@@ -107,54 +324,65 @@ static int try_to_fill_dentry(struct dentry *dentry,
 		/* Turn this into a real negative dentry? */
 		if (status == -ENOENT) {
 			dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT;
+			spin_lock(&dentry->d_lock);
 			dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
+			spin_unlock(&dentry->d_lock);
 			return 1;
 		} else if (status) {
 			/* Return a negative dentry, but leave it "pending" */
 			return 1;
 		}
-	}
+	/* Trigger mount for path component or follow link */
+	} else if (flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY) ||
+			current->link_count) {
+		DPRINTK("waiting for mount name=%.*s",
+			dentry->d_name.len, dentry->d_name.name);
 
-	/* If this is an unused directory that isn't a mount point,
-	   bitch at the daemon and fix it in user space */
-	spin_lock(&dcache_lock);
-	if (S_ISDIR(dentry->d_inode->i_mode) &&
-	    !d_mountpoint(dentry) && 
-	    list_empty(&dentry->d_subdirs)) {
-		DPRINTK(("try_to_fill_entry: mounting existing dir\n"));
-		spin_unlock(&dcache_lock);
-		return autofs4_wait(sbi, &dentry->d_name, NFY_MOUNT) == 0;
+		spin_lock(&dentry->d_lock);
+		dentry->d_flags |= DCACHE_AUTOFS_PENDING;
+		spin_unlock(&dentry->d_lock);
+		status = autofs4_wait(sbi, dentry, NFY_MOUNT);
+
+		DPRINTK("mount done status=%d", status);
+
+		if (status) {
+			spin_lock(&dentry->d_lock);
+			dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
+			spin_unlock(&dentry->d_lock);
+			return 0;
+		}
 	}
-	spin_unlock(&dcache_lock);
 
 	/* We don't update the usages for the autofs daemon itself, this
 	   is necessary for recursive autofs mounts */
 	if (!autofs4_oz_mode(sbi))
 		autofs4_update_usage(dentry);
 
+	spin_lock(&dentry->d_lock);
 	dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
+	spin_unlock(&dentry->d_lock);
 	return 1;
 }
 
-
 /*
  * Revalidate is called on every cache lookup.  Some of those
  * cache lookups may actually happen while the dentry is not
  * yet completely filled in, and revalidate has to delay such
  * lookups..
  */
-static int autofs4_root_revalidate(struct dentry * dentry, struct nameidata *nd)
+static int autofs4_revalidate(struct dentry * dentry, struct nameidata *nd)
 {
 	struct inode * dir = dentry->d_parent->d_inode;
 	struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb);
 	int oz_mode = autofs4_oz_mode(sbi);
+	int flags = nd ? nd->flags : 0;
+	int status = 1;
 
 	/* Pending dentry */
 	if (autofs4_ispending(dentry)) {
-		if (autofs4_oz_mode(sbi))
-			return 1;
-		else
-			return try_to_fill_dentry(dentry, dir->i_sb, sbi);
+		if (!oz_mode)
+			status = try_to_fill_dentry(dentry, dir->i_sb, sbi, flags);
+		return status;
 	}
 
 	/* Negative dentry.. invalidate if "old" */
@@ -166,13 +394,12 @@ static int autofs4_root_revalidate(struct dentry * dentry, struct nameidata *nd)
 	if (S_ISDIR(dentry->d_inode->i_mode) &&
 	    !d_mountpoint(dentry) && 
 	    list_empty(&dentry->d_subdirs)) {
-		DPRINTK(("autofs_root_revalidate: dentry=%p %.*s, emptydir\n",
-			 dentry, dentry->d_name.len, dentry->d_name.name));
+		DPRINTK("dentry=%p %.*s, emptydir",
+			 dentry, dentry->d_name.len, dentry->d_name.name);
 		spin_unlock(&dcache_lock);
-		if (oz_mode)
-			return 1;
-		else
-			return try_to_fill_dentry(dentry, dir->i_sb, sbi);
+		if (!oz_mode)
+			status = try_to_fill_dentry(dentry, dir->i_sb, sbi, flags);
+		return status;
 	}
 	spin_unlock(&dcache_lock);
 
@@ -183,21 +410,11 @@ static int autofs4_root_revalidate(struct dentry * dentry, struct nameidata *nd)
 	return 1;
 }
 
-static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd)
-{
-	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
-
-	if (!autofs4_oz_mode(sbi))
-		autofs4_update_usage(dentry);
-
-	return 1;
-}
-
 static void autofs4_dentry_release(struct dentry *de)
 {
 	struct autofs_info *inf;
 
-	DPRINTK(("autofs4_dentry_release: releasing %p\n", de));
+	DPRINTK("releasing %p", de);
 
 	inf = autofs4_dentry_ino(de);
 	de->d_fsdata = NULL;
@@ -212,7 +429,7 @@ static void autofs4_dentry_release(struct dentry *de)
 
 /* For dentries of directories in the root dir */
 static struct dentry_operations autofs4_root_dentry_operations = {
-	.d_revalidate	= autofs4_root_revalidate,
+	.d_revalidate	= autofs4_revalidate,
 	.d_release	= autofs4_dentry_release,
 };
 
@@ -224,13 +441,12 @@ static struct dentry_operations autofs4_dentry_operations = {
 
 /* Lookups in non-root dirs never find anything - if it's there, it's
    already in the dcache */
-/* SMP-safe */
 static struct dentry *autofs4_dir_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
 {
 #if 0
-	DPRINTK(("autofs_dir_lookup: ignoring lookup of %.*s/%.*s\n",
+	DPRINTK("ignoring lookup of %.*s/%.*s",
 		 dentry->d_parent->d_name.len, dentry->d_parent->d_name.name,
-		 dentry->d_name.len, dentry->d_name.name));
+		 dentry->d_name.len, dentry->d_name.name);
 #endif
 
 	dentry->d_fsdata = NULL;
@@ -244,18 +460,17 @@ static struct dentry *autofs4_root_lookup(struct inode *dir, struct dentry *dent
 	struct autofs_sb_info *sbi;
 	int oz_mode;
 
-	DPRINTK(("autofs_root_lookup: name = %.*s\n", 
-		 dentry->d_name.len, dentry->d_name.name));
+	DPRINTK("name = %.*s",
+		dentry->d_name.len, dentry->d_name.name);
 
 	if (dentry->d_name.len > NAME_MAX)
 		return ERR_PTR(-ENAMETOOLONG);/* File name too long to exist */
 
 	sbi = autofs4_sbi(dir->i_sb);
 
-	lock_kernel();
 	oz_mode = autofs4_oz_mode(sbi);
-	DPRINTK(("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n",
-		 current->pid, process_group(current), sbi->catatonic, oz_mode));
+	DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
+		 current->pid, process_group(current), sbi->catatonic, oz_mode);
 
 	/*
 	 * Mark the dentry incomplete, but add it. This is needed so
@@ -269,8 +484,11 @@ static struct dentry *autofs4_root_lookup(struct inode *dir, struct dentry *dent
 	 */
 	dentry->d_op = &autofs4_root_dentry_operations;
 
-	if (!oz_mode)
+	if (!oz_mode) {
+		spin_lock(&dentry->d_lock);
 		dentry->d_flags |= DCACHE_AUTOFS_PENDING;
+		spin_unlock(&dentry->d_lock);
+	}
 	dentry->d_fsdata = NULL;
 	d_add(dentry, NULL);
 
@@ -285,12 +503,16 @@ static struct dentry *autofs4_root_lookup(struct inode *dir, struct dentry *dent
 	 * a signal. If so we can force a restart..
 	 */
 	if (dentry->d_flags & DCACHE_AUTOFS_PENDING) {
+		/* See if we were interrupted */
 		if (signal_pending(current)) {
-			unlock_kernel();
-			return ERR_PTR(-ERESTARTNOINTR);
+			sigset_t *sigset = &current->pending.signal;
+			if (sigismember (sigset, SIGKILL) ||
+			    sigismember (sigset, SIGQUIT) ||
+			    sigismember (sigset, SIGINT)) {
+			    return ERR_PTR(-ERESTARTNOINTR);
+			}
 		}
 	}
-	unlock_kernel();
 
 	/*
 	 * If this dentry is unhashed, then we shouldn't honour this
@@ -313,27 +535,21 @@ static int autofs4_dir_symlink(struct inode *dir,
 	struct inode *inode;
 	char *cp;
 
-	DPRINTK(("autofs_dir_symlink: %s <- %.*s\n", symname, 
-		 dentry->d_name.len, dentry->d_name.name));
+	DPRINTK("%s <- %.*s", symname,
+		dentry->d_name.len, dentry->d_name.name);
 
-	lock_kernel();
-	if (!autofs4_oz_mode(sbi)) {
-		unlock_kernel();
+	if (!autofs4_oz_mode(sbi))
 		return -EACCES;
-	}
 
 	ino = autofs4_init_ino(ino, sbi, S_IFLNK | 0555);
-	if (ino == NULL) {
-		unlock_kernel();
+	if (ino == NULL)
 		return -ENOSPC;
-	}
 
 	ino->size = strlen(symname);
 	ino->u.symlink = cp = kmalloc(ino->size + 1, GFP_KERNEL);
 
 	if (cp == NULL) {
 		kfree(ino);
-		unlock_kernel();
 		return -ENOSPC;
 	}
 
@@ -353,7 +569,6 @@ static int autofs4_dir_symlink(struct inode *dir,
 
 	dir->i_mtime = CURRENT_TIME;
 
-	unlock_kernel();
 	return 0;
 }
 
@@ -370,7 +585,7 @@ static int autofs4_dir_symlink(struct inode *dir,
  * If a process is blocked on the dentry waiting for the expire to finish,
  * it will invalidate the dentry and try to mount with a new one.
  *
- * Also see autofs_dir_rmdir().. 
+ * Also see autofs4_dir_rmdir()..
  */
 static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
 {
@@ -378,11 +593,8 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
 	struct autofs_info *ino = autofs4_dentry_ino(dentry);
 	
 	/* This allows root to remove symlinks */
-	lock_kernel();
-	if ( !autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) ) {
-		unlock_kernel();
+	if ( !autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN) )
 		return -EACCES;
-	}
 
 	dput(ino->dentry);
 
@@ -393,8 +605,6 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
 
 	d_drop(dentry);
 
-	unlock_kernel();
-	
 	return 0;
 }
 
@@ -403,16 +613,12 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
 	struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb);
 	struct autofs_info *ino = autofs4_dentry_ino(dentry);
 	
-	lock_kernel();
-	if (!autofs4_oz_mode(sbi)) {
-		unlock_kernel();
+	if (!autofs4_oz_mode(sbi))
 		return -EACCES;
-	}
 
 	spin_lock(&dcache_lock);
 	if (!list_empty(&dentry->d_subdirs)) {
 		spin_unlock(&dcache_lock);
-		unlock_kernel();
 		return -ENOTEMPTY;
 	}
 	__d_drop(dentry);
@@ -426,32 +632,24 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
 	if (dir->i_nlink)
 		dir->i_nlink--;
 
-	unlock_kernel();
 	return 0;
 }
 
-
-
 static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 {
 	struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb);
 	struct autofs_info *ino = autofs4_dentry_ino(dentry);
 	struct inode *inode;
 
-	lock_kernel();
-	if ( !autofs4_oz_mode(sbi) ) {
-		unlock_kernel();
+	if ( !autofs4_oz_mode(sbi) )
 		return -EACCES;
-	}
 
-	DPRINTK(("autofs_dir_mkdir: dentry %p, creating %.*s\n",
-		 dentry, dentry->d_name.len, dentry->d_name.name));
+	DPRINTK("dentry %p, creating %.*s",
+		dentry, dentry->d_name.len, dentry->d_name.name);
 
 	ino = autofs4_init_ino(ino, sbi, S_IFDIR | 0555);
-	if (ino == NULL) {
-		unlock_kernel();
+	if (ino == NULL)
 		return -ENOSPC;
-	}
 
 	inode = autofs4_get_inode(dir->i_sb, ino);
 	d_instantiate(dentry, inode);
@@ -467,13 +665,12 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 	dir->i_nlink++;
 	dir->i_mtime = CURRENT_TIME;
 
-	unlock_kernel();
 	return 0;
 }
 
 /* Get/set timeout ioctl() operation */
 static inline int autofs4_get_set_timeout(struct autofs_sb_info *sbi,
-					 unsigned long *p)
+					 unsigned long __user *p)
 {
 	int rv;
 	unsigned long ntimeout;
@@ -491,12 +688,73 @@ static inline int autofs4_get_set_timeout(struct autofs_sb_info *sbi,
 }
 
 /* Return protocol version */
-static inline int autofs4_get_protover(struct autofs_sb_info *sbi, int *p)
+static inline int autofs4_get_protover(struct autofs_sb_info *sbi, int __user *p)
 {
 	return put_user(sbi->version, p);
 }
 
-/* Identify autofs_dentries - this is so we can tell if there's
+/* Return protocol sub version */
+static inline int autofs4_get_protosubver(struct autofs_sb_info *sbi, int __user *p)
+{
+	return put_user(sbi->sub_version, p);
+}
+
+/*
+ * Tells the daemon whether we need to reghost or not. Also, clears
+ * the reghost_needed flag.
+ */
+static inline int autofs4_ask_reghost(struct autofs_sb_info *sbi, int __user *p)
+{
+	int status;
+
+	DPRINTK("returning %d", sbi->needs_reghost);
+
+	status = put_user(sbi->needs_reghost, p);
+	if ( status )
+		return status;
+
+	sbi->needs_reghost = 0;
+	return 0;
+}
+
+/*
+ * Enable / Disable reghosting ioctl() operation
+ */
+static inline int autofs4_toggle_reghost(struct autofs_sb_info *sbi, int __user *p)
+{
+	int status;
+	int val;
+
+	status = get_user(val, p);
+
+	DPRINTK("reghost = %d", val);
+
+	if (status)
+		return status;
+
+	/* turn on/off reghosting, with the val */
+	sbi->reghost_enabled = val;
+	return 0;
+}
+
+/*
+* Tells the daemon whether it can umount the autofs mount.
+*/
+static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
+{
+	int status = 0;
+
+	if (may_umount(mnt) == 0)
+		status = 1;
+
+	DPRINTK("returning %d", status);
+
+	status = put_user(status, p);
+
+	return status;
+}
+
+/* Identify autofs4_dentries - this is so we can tell if there's
    an extra dentry refcount or not.  We only hold a refcount on the
    dentry if its non-negative (ie, d_inode != NULL)
 */
@@ -516,9 +774,10 @@ static int autofs4_root_ioctl(struct inode *inode, struct file *filp,
 			     unsigned int cmd, unsigned long arg)
 {
 	struct autofs_sb_info *sbi = autofs4_sbi(inode->i_sb);
+	void __user *p = (void __user *)arg;
 
-	DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",
-		 cmd,arg,sbi,process_group(current)));
+	DPRINTK("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u",
+		cmd,arg,sbi,process_group(current));
 
 	if ( _IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
 	     _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT )
@@ -536,18 +795,26 @@ static int autofs4_root_ioctl(struct inode *inode, struct file *filp,
 		autofs4_catatonic_mode(sbi);
 		return 0;
 	case AUTOFS_IOC_PROTOVER: /* Get protocol version */
-		return autofs4_get_protover(sbi, (int *)arg);
+		return autofs4_get_protover(sbi, p);
+	case AUTOFS_IOC_PROTOSUBVER: /* Get protocol sub version */
+		return autofs4_get_protosubver(sbi, p);
 	case AUTOFS_IOC_SETTIMEOUT:
-		return autofs4_get_set_timeout(sbi,(unsigned long *)arg);
+		return autofs4_get_set_timeout(sbi, p);
+
+	case AUTOFS_IOC_TOGGLEREGHOST:
+		return autofs4_toggle_reghost(sbi, p);
+	case AUTOFS_IOC_ASKREGHOST:
+		return autofs4_ask_reghost(sbi, p);
+
+	case AUTOFS_IOC_ASKUMOUNT:
+		return autofs4_ask_umount(filp->f_vfsmnt, p);
 
 	/* return a single thing to expire */
 	case AUTOFS_IOC_EXPIRE:
-		return autofs4_expire_run(inode->i_sb,filp->f_vfsmnt,sbi,
-					  (struct autofs_packet_expire *)arg);
+		return autofs4_expire_run(inode->i_sb,filp->f_vfsmnt,sbi, p);
 	/* same as above, but can send multiple expires through pipe */
 	case AUTOFS_IOC_EXPIRE_MULTI:
-		return autofs4_expire_multi(inode->i_sb,filp->f_vfsmnt,sbi,
-					    (int *)arg);
+		return autofs4_expire_multi(inode->i_sb,filp->f_vfsmnt,sbi, p);
 
 	default:
 		return -ENOSYS;
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index c1b7279ca..caae47fd7 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -3,6 +3,7 @@
  * linux/fs/autofs/waitq.c
  *
  *  Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
+ *  Copyright 2001-2003 Ian Kent <raven@themaw.net>
  *
  * This file is part of the Linux kernel and is made available under
  * the terms of the GNU General Public License, version 2, or at your
@@ -27,7 +28,7 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
 {
 	struct autofs_wait_queue *wq, *nwq;
 
-	DPRINTK(("autofs: entering catatonic mode\n"));
+	DPRINTK("entering catatonic mode");
 
 	sbi->catatonic = 1;
 	wq = sbi->queues;
@@ -37,7 +38,7 @@ void autofs4_catatonic_mode(struct autofs_sb_info *sbi)
 		wq->status = -ENOENT; /* Magic is gone - report failure */
 		kfree(wq->name);
 		wq->name = NULL;
-		wake_up(&wq->queue);
+		wake_up_interruptible(&wq->queue);
 		wq = nwq;
 	}
 	if (sbi->pipe) {
@@ -90,8 +91,8 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 	union autofs_packet_union pkt;
 	size_t pktsz;
 
-	DPRINTK(("autofs_notify: wait id = 0x%08lx, name = %.*s, type=%d\n",
-		 wq->wait_queue_token, wq->len, wq->name, type));
+	DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
+		wq->wait_queue_token, wq->len, wq->name, type);
 
 	memset(&pkt,0,sizeof pkt); /* For security reasons */
 
@@ -116,7 +117,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 		memcpy(ep->name, wq->name, wq->len);
 		ep->name[wq->len] = '\0';
 	} else {
-		printk("autofs_notify_daemon: bad type %d!\n", type);
+		printk("autofs4_notify_daemon: bad type %d!\n", type);
 		return;
 	}
 
@@ -124,62 +125,107 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
 		autofs4_catatonic_mode(sbi);
 }
 
-int autofs4_wait(struct autofs_sb_info *sbi, struct qstr *name,
+static int autofs4_getpath(struct autofs_sb_info *sbi,
+			   struct dentry *dentry, char **name)
+{
+	struct dentry *root = sbi->sb->s_root;
+	struct dentry *tmp;
+	char *buf = *name;
+	char *p;
+	int len = 0;
+
+	spin_lock(&dcache_lock);
+	for (tmp = dentry ; tmp != root ; tmp = tmp->d_parent)
+		len += tmp->d_name.len + 1;
+
+	if (--len > NAME_MAX) {
+		spin_unlock(&dcache_lock);
+		return 0;
+	}
+
+	*(buf + len) = '\0';
+	p = buf + len - dentry->d_name.len;
+	strncpy(p, dentry->d_name.name, dentry->d_name.len);
+
+	for (tmp = dentry->d_parent; tmp != root ; tmp = tmp->d_parent) {
+		*(--p) = '/';
+		p -= tmp->d_name.len;
+		strncpy(p, tmp->d_name.name, tmp->d_name.len);
+	}
+	spin_unlock(&dcache_lock);
+
+	return len;
+}
+
+int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
 		enum autofs_notify notify)
 {
 	struct autofs_wait_queue *wq;
-	int status;
+	char *name;
+	int len, status;
 
 	/* In catatonic mode, we don't wait for nobody */
 	if ( sbi->catatonic )
 		return -ENOENT;
 	
-	/* We shouldn't be able to get here, but just in case */
-	if ( name->len > NAME_MAX )
+	name = kmalloc(NAME_MAX + 1, GFP_KERNEL);
+	if (!name)
+		return -ENOMEM;
+
+	len = autofs4_getpath(sbi, dentry, &name);
+	if (!len) {
+		kfree(name);
 		return -ENOENT;
+	}
+
+	if (down_interruptible(&sbi->wq_sem)) {
+		kfree(name);
+		return -EINTR;
+	}
 
-	for ( wq = sbi->queues ; wq ; wq = wq->next ) {
-		if ( wq->hash == name->hash &&
-		     wq->len == name->len &&
-		     wq->name && !memcmp(wq->name,name->name,name->len) )
+	for (wq = sbi->queues ; wq ; wq = wq->next) {
+		if (wq->hash == dentry->d_name.hash &&
+		    wq->len == len &&
+		    wq->name && !memcmp(wq->name, name, len))
 			break;
 	}
-	
+
 	if ( !wq ) {
 		/* Create a new wait queue */
 		wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
-		if ( !wq )
-			return -ENOMEM;
-
-		wq->name = kmalloc(name->len,GFP_KERNEL);
-		if ( !wq->name ) {
-			kfree(wq);
+		if ( !wq ) {
+			kfree(name);
+			up(&sbi->wq_sem);
 			return -ENOMEM;
 		}
+
 		wq->wait_queue_token = autofs4_next_wait_queue;
 		if (++autofs4_next_wait_queue == 0)
 			autofs4_next_wait_queue = 1;
-		init_waitqueue_head(&wq->queue);
-		wq->hash = name->hash;
-		wq->len = name->len;
-		wq->status = -EINTR; /* Status return if interrupted */
-		memcpy(wq->name, name->name, name->len);
 		wq->next = sbi->queues;
 		sbi->queues = wq;
+		init_waitqueue_head(&wq->queue);
+		wq->hash = dentry->d_name.hash;
+		wq->name = name;
+		wq->len = len;
+		wq->status = -EINTR; /* Status return if interrupted */
+		atomic_set(&wq->wait_ctr, 2);
+		up(&sbi->wq_sem);
 
-		DPRINTK(("autofs_wait: new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
-			 wq->wait_queue_token, wq->len, wq->name, notify));
+		DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d",
+			(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
 		/* autofs4_notify_daemon() may block */
-		wq->wait_ctr = 2;
 		if (notify != NFY_NONE) {
 			autofs4_notify_daemon(sbi,wq, 
-					      notify == NFY_MOUNT ? autofs_ptype_missing :
-								    autofs_ptype_expire_multi);
+					notify == NFY_MOUNT ?
+						  autofs_ptype_missing :
+						  autofs_ptype_expire_multi);
 		}
 	} else {
-		wq->wait_ctr++;
-		DPRINTK(("autofs_wait: existing wait id = 0x%08lx, name = %.*s, nfy=%d\n",
-			 wq->wait_queue_token, wq->len, wq->name, notify));
+		atomic_inc(&wq->wait_ctr);
+		up(&sbi->wq_sem);
+		DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
+			(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
 	}
 
 	/* wq->name is NULL if and only if the lock is already released */
@@ -204,19 +250,20 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct qstr *name,
 		recalc_sigpending();
 		spin_unlock_irqrestore(&current->sighand->siglock, irqflags);
 
-		interruptible_sleep_on(&wq->queue);
+		wait_event_interruptible(wq->queue, wq->name == NULL);
 
 		spin_lock_irqsave(&current->sighand->siglock, irqflags);
 		current->blocked = oldset;
 		recalc_sigpending();
 		spin_unlock_irqrestore(&current->sighand->siglock, irqflags);
 	} else {
-		DPRINTK(("autofs_wait: skipped sleeping\n"));
+		DPRINTK("skipped sleeping");
 	}
 
 	status = wq->status;
 
-	if (--wq->wait_ctr == 0)	/* Are we the last process to need status? */
+	/* Are we the last process to need status? */
+	if (atomic_dec_and_test(&wq->wait_ctr))
 		kfree(wq);
 
 	return status;
@@ -227,23 +274,28 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
 {
 	struct autofs_wait_queue *wq, **wql;
 
+	down(&sbi->wq_sem);
 	for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) {
 		if ( wq->wait_queue_token == wait_queue_token )
 			break;
 	}
-	if ( !wq )
+
+	if ( !wq ) {
+		up(&sbi->wq_sem);
 		return -EINVAL;
+	}
 
 	*wql = wq->next;	/* Unlink from chain */
+	up(&sbi->wq_sem);
 	kfree(wq->name);
 	wq->name = NULL;	/* Do not wait on this queue */
 
 	wq->status = status;
 
-	if (--wq->wait_ctr == 0)	/* Is anyone still waiting for this guy? */
+	if (atomic_dec_and_test(&wq->wait_ctr))	/* Is anyone still waiting for this guy? */
 		kfree(wq);
 	else
-		wake_up(&wq->queue);
+		wake_up_interruptible(&wq->queue);
 
 	return 0;
 }
diff --git a/fs/befs/befs.h b/fs/befs/befs.h
index abe345e5f..fcb7f47b0 100644
--- a/fs/befs/befs.h
+++ b/fs/befs/befs.h
@@ -14,10 +14,7 @@
 #define BEFS_VERSION "0.9.3"
 
 
-/* Sector_t makes this sillyness obsolete */
 typedef u64 befs_blocknr_t;
-typedef u32 vfs_blocknr_t;
-
 /*
  * BeFS in memory structures
  */
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index e1a0256f5..76e219799 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -372,12 +372,12 @@ befs_find_key(struct super_block *sb, befs_btree_node * node,
 		thiskey = befs_bt_get_key(sb, node, mid, &keylen);
 		eq = befs_compare_strings(thiskey, keylen, findkey,
 					  findkey_len);
-		*value = fs64_to_cpu(sb, valarray[mid]);
 
 		if (eq == 0) {
 			befs_debug(sb, "<--- befs_find_key() found %s at %d",
 				   thiskey, mid);
 
+			*value = fs64_to_cpu(sb, valarray[mid]);
 			return BEFS_BT_MATCH;
 		}
 		if (eq > 0)
@@ -387,6 +387,8 @@ befs_find_key(struct super_block *sb, befs_btree_node * node,
 	}
 	if (eq < 0)
 		*value = fs64_to_cpu(sb, valarray[mid + 1]);
+	else
+		*value = fs64_to_cpu(sb, valarray[mid]);
 	befs_debug(sb, "<--- befs_find_key() found %s at %d", thiskey, mid);
 	return BEFS_BT_PARMATCH;
 }
diff --git a/fs/befs/debug.c b/fs/befs/debug.c
index 816fd7191..b5e190116 100644
--- a/fs/befs/debug.c
+++ b/fs/befs/debug.c
@@ -29,22 +29,29 @@ void
 befs_error(const struct super_block *sb, const char *fmt, ...)
 {
 	va_list args;
-	char err_buf[ERRBUFSIZE];
+	char *err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL);
+	if (err_buf == NULL) {
+		printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE);
+		return;
+	}
 
 	va_start(args, fmt);
 	vsnprintf(err_buf, ERRBUFSIZE, fmt, args);
 	va_end(args);
 
 	printk(KERN_ERR "BeFS(%s): %s\n", sb->s_id, err_buf);
-
-	befs_debug(sb, err_buf);
+	kfree(err_buf);
 }
 
 void
 befs_warning(const struct super_block *sb, const char *fmt, ...)
 {
 	va_list args;
-	char err_buf[ERRBUFSIZE];
+	char *err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL);
+	if (err_buf == NULL) {
+		printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE);
+		return;
+	}
 
 	va_start(args, fmt);
 	vsnprintf(err_buf, ERRBUFSIZE, fmt, args);
@@ -52,7 +59,7 @@ befs_warning(const struct super_block *sb, const char *fmt, ...)
 
 	printk(KERN_WARNING "BeFS(%s): %s\n", sb->s_id, err_buf);
 
-	befs_debug(sb, err_buf);
+	kfree(err_buf);
 }
 
 void
@@ -61,15 +68,25 @@ befs_debug(const struct super_block *sb, const char *fmt, ...)
 #ifdef CONFIG_BEFS_DEBUG
 
 	va_list args;
-	char err_buf[ERRBUFSIZE];
+	char *err_buf = NULL;
 
 	if (BEFS_SB(sb)->mount_opts.debug) {
+		err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL);
+		if (err_buf == NULL) {
+			printk(KERN_ERR "could not allocate %d bytes\n",
+				ERRBUFSIZE);
+			return;
+		}
+
 		va_start(args, fmt);
 		vsnprintf(err_buf, ERRBUFSIZE, fmt, args);
 		va_end(args);
 
 		printk(KERN_DEBUG "BeFS(%s): %s\n", sb->s_id, err_buf);
+
+		kfree(err_buf);
 	}
+
 #endif				//CONFIG_BEFS_DEBUG
 }
 
diff --git a/fs/befs/io.c b/fs/befs/io.c
index 50b0f9354..ddef98aa2 100644
--- a/fs/befs/io.c
+++ b/fs/befs/io.c
@@ -28,7 +28,6 @@ befs_bread_iaddr(struct super_block *sb, befs_inode_addr iaddr)
 {
 	struct buffer_head *bh = NULL;
 	befs_blocknr_t block = 0;
-	vfs_blocknr_t vfs_block = 0;
 	befs_sb_info *befs_sb = BEFS_SB(sb);
 
 	befs_debug(sb, "---> Enter befs_read_iaddr() "
@@ -42,17 +41,10 @@ befs_bread_iaddr(struct super_block *sb, befs_inode_addr iaddr)
 	}
 
 	block = iaddr2blockno(sb, &iaddr);
-	vfs_block = (vfs_blocknr_t) block;
-
-	if (vfs_block != block) {
-		befs_error(sb, "Error converting to host blocknr_t. %Lu "
-			   "is larger than the host can use", block);
-		goto error;
-	}
 
 	befs_debug(sb, "befs_read_iaddr: offset = %lu", block);
 
-	bh = sb_bread(sb, vfs_block);
+	bh = sb_bread(sb, block);
 
 	if (bh == NULL) {
 		befs_error(sb, "Failed to read block %lu", block);
@@ -71,20 +63,13 @@ struct buffer_head *
 befs_bread(struct super_block *sb, befs_blocknr_t block)
 {
 	struct buffer_head *bh = NULL;
-	vfs_blocknr_t vfs_block = (vfs_blocknr_t) block;
 
 	befs_debug(sb, "---> Enter befs_read() %Lu", block);
 
-	if (vfs_block != block) {
-		befs_error(sb, "Error converting to host blocknr_t. %Lu "
-			   "is larger than the host can use", block);
-		goto error;
-	}
-
-	bh = sb_bread(sb, vfs_block);
+	bh = sb_bread(sb, block);
 
 	if (bh == NULL) {
-		befs_error(sb, "Failed to read block %lu", vfs_block);
+		befs_error(sb, "Failed to read block %lu", block);
 		goto error;
 	}
 
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 05e6005c5..649d02b03 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -325,7 +325,7 @@ befs_read_inode(struct inode *inode)
 		   befs_ino->i_inode_num.allocation_group,
 		   befs_ino->i_inode_num.start, befs_ino->i_inode_num.len);
 
-	bh = befs_bread_iaddr(sb, befs_ino->i_inode_num);
+	bh = befs_bread(sb, inode->i_ino);
 	if (!bh) {
 		befs_error(sb, "unable to read inode block - "
 			   "inode = %lu", inode->i_ino);
@@ -376,7 +376,7 @@ befs_read_inode(struct inode *inode)
 	befs_ino->i_attribute = fsrun_to_cpu(sb, raw_inode->attributes);
 	befs_ino->i_flags = fs32_to_cpu(sb, raw_inode->flags);
 
-	if (S_ISLNK(inode->i_mode) && !(inode->i_flags & BEFS_LONG_SYMLINK)) {
+	if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){
 		inode->i_size = 0;
 		inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE;
 		strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink,
@@ -571,7 +571,7 @@ befs_utf2nls(struct super_block *sb, const char *in,
 		}
 
 		/* convert from Unicode to nls */
-		unilen = nls->uni2char(uni, &result[o], 1);
+		unilen = nls->uni2char(uni, &result[o], in_len - o);
 		if (unilen < 0) {
 			goto conv_err;
 		}
@@ -584,7 +584,7 @@ befs_utf2nls(struct super_block *sb, const char *in,
 	return o;
 
       conv_err:
-	befs_error(sb, "Name using charecter set %s contains a charecter that "
+	befs_error(sb, "Name using character set %s contains a character that "
 		   "cannot be converted to unicode.", nls->charset);
 	befs_debug(sb, "<--- utf2nls()");
 	kfree(result);
@@ -856,6 +856,13 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 	if (befs_check_sb(sb) != BEFS_OK)
 		goto unaquire_priv_sbp;
 
+	if( befs_sb->num_blocks > ~((sector_t)0) ) {
+		befs_error(sb, "blocks count: %Lu "
+			"is larger than the host can use",
+			befs_sb->num_blocks);
+		goto unaquire_priv_sbp;
+	}
+
 	/*
 	 * set up enough so that it can read an inode
 	 * Fill in kernel superblock fields from private sb
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index 09db6f39c..4656ecc21 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -274,7 +274,7 @@ static int bfs_add_entry(struct inode * dir, const char * name, int namelen, int
 {
 	struct buffer_head * bh;
 	struct bfs_dirent * de;
-	int block, sblock, eblock, off;
+	int block, sblock, eblock, off, eoff;
 	int i;
 
 	dprintf("name=%s, namelen=%d\n", name, namelen);
@@ -286,12 +286,17 @@ static int bfs_add_entry(struct inode * dir, const char * name, int namelen, int
 
 	sblock = BFS_I(dir)->i_sblock;
 	eblock = BFS_I(dir)->i_eblock;
+	eoff = dir->i_size % BFS_BSIZE;
 	for (block=sblock; block<=eblock; block++) {
 		bh = sb_bread(dir->i_sb, block);
 		if(!bh) 
 			return -ENOSPC;
 		for (off=0; off<BFS_BSIZE; off+=BFS_DIRENT_SIZE) {
 			de = (struct bfs_dirent *)(bh->b_data + off);
+			if (block==eblock && off>=eoff) {
+				/* Do not read/interpret the garbage in the end of eblock. */
+				de->ino = 0;
+			}
 			if (!de->ino) {
 				if ((block-sblock)*BFS_BSIZE + off >= dir->i_size) {
 					dir->i_size += BFS_DIRENT_SIZE;
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index 7827c1255..9bda8b9ac 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -521,6 +521,6 @@ static void __exit exit_aout_binfmt(void)
 	unregister_binfmt(&aout_format);
 }
 
-module_init(init_aout_binfmt);
+core_initcall(init_aout_binfmt);
 module_exit(exit_aout_binfmt);
 MODULE_LICENSE("GPL");
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index a67e6f586..a672adc9b 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -110,18 +110,18 @@ static void padzero(unsigned long elf_bss)
 	nbyte = ELF_PAGEOFFSET(elf_bss);
 	if (nbyte) {
 		nbyte = ELF_MIN_ALIGN - nbyte;
-		clear_user((void *) elf_bss, nbyte);
+		clear_user((void __user *) elf_bss, nbyte);
 	}
 }
 
 /* Let's use some macros to make this stack manipulation a litle clearer */
 #ifdef CONFIG_STACK_GROWSUP
-#define STACK_ADD(sp, items) ((elf_addr_t *)(sp) + (items))
+#define STACK_ADD(sp, items) ((elf_addr_t __user *)(sp) + (items))
 #define STACK_ROUND(sp, items) \
 	((15 + (unsigned long) ((sp) + (items))) &~ 15UL)
-#define STACK_ALLOC(sp, len) ({ elf_addr_t *old_sp = (elf_addr_t *)sp; sp += len; old_sp; })
+#define STACK_ALLOC(sp, len) ({ elf_addr_t __user *old_sp = (elf_addr_t __user *)sp; sp += len; old_sp; })
 #else
-#define STACK_ADD(sp, items) ((elf_addr_t *)(sp) - (items))
+#define STACK_ADD(sp, items) ((elf_addr_t __user *)(sp) - (items))
 #define STACK_ROUND(sp, items) \
 	(((unsigned long) (sp - items)) &~ 15UL)
 #define STACK_ALLOC(sp, len) ({ sp -= len ; sp; })
@@ -135,8 +135,10 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 	unsigned long p = bprm->p;
 	int argc = bprm->argc;
 	int envc = bprm->envc;
-	elf_addr_t *argv, *envp;
-	elf_addr_t *sp, *u_platform;
+	elf_addr_t __user *argv;
+	elf_addr_t __user *envp;
+	elf_addr_t __user *sp;
+	elf_addr_t __user *u_platform;
 	const char *k_platform = ELF_PLATFORM;
 	int items;
 	elf_addr_t *elf_info;
@@ -169,7 +171,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 		if (smp_num_siblings > 1)
 			STACK_ALLOC(p, ((current->pid % 64) << 7));
 #endif
-		u_platform = (elf_addr_t *)STACK_ALLOC(p, len);
+		u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);
 		__copy_to_user(u_platform, k_platform, len);
 	}
 
@@ -222,10 +224,10 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 
 	/* Point sp at the lowest address on the stack */
 #ifdef CONFIG_STACK_GROWSUP
-	sp = (elf_addr_t *)bprm->p - items - ei_index;
+	sp = (elf_addr_t __user *)bprm->p - items - ei_index;
 	bprm->exec = (unsigned long) sp; /* XXX: PARISC HACK */
 #else
-	sp = (elf_addr_t *)bprm->p;
+	sp = (elf_addr_t __user *)bprm->p;
 #endif
 
 	/* Now, let's put argc (and argv, envp if appropriate) on the stack */
@@ -245,7 +247,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 	while (argc-- > 0) {
 		size_t len;
 		__put_user((elf_addr_t)p, argv++);
-		len = strnlen_user((void *)p, PAGE_SIZE*MAX_ARG_PAGES);
+		len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES);
 		if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)
 			return;
 		p += len;
@@ -255,7 +257,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 	while (envc-- > 0) {
 		size_t len;
 		__put_user((elf_addr_t)p, envp++);
-		len = strnlen_user((void *)p, PAGE_SIZE*MAX_ARG_PAGES);
+		len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES);
 		if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)
 			return;
 		p += len;
@@ -264,7 +266,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 	current->mm->env_end = p;
 
 	/* Put the elf_info on the stack in the right place.  */
-	sp = (elf_addr_t *)envp + 1;
+	sp = (elf_addr_t __user *)envp + 1;
 	copy_to_user(sp, elf_info, ei_index * sizeof(elf_addr_t));
 }
 
@@ -418,7 +420,7 @@ static unsigned long load_aout_interp(struct exec * interp_ex,
 			     struct file * interpreter)
 {
 	unsigned long text_data, elf_entry = ~0UL;
-	char * addr;
+	char __user * addr;
 	loff_t offset;
 
 	current->mm->end_code = interp_ex->a_text;
@@ -429,12 +431,12 @@ static unsigned long load_aout_interp(struct exec * interp_ex,
 	switch (N_MAGIC(*interp_ex)) {
 	case OMAGIC:
 		offset = 32;
-		addr = (char *) 0;
+		addr = (char __user *)0;
 		break;
 	case ZMAGIC:
 	case QMAGIC:
 		offset = N_TXTOFF(*interp_ex);
-		addr = (char *) N_TXTADDR(*interp_ex);
+		addr = (char __user *) N_TXTADDR(*interp_ex);
 		break;
 	default:
 		goto out;
@@ -734,7 +736,7 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 				nbyte = ELF_MIN_ALIGN - nbyte;
 				if (nbyte > elf_brk - elf_bss)
 					nbyte = elf_brk - elf_bss;
-				clear_user((void *) elf_bss + load_bias, nbyte);
+				clear_user((void __user *) elf_bss + load_bias, nbyte);
 			}
 		}
 
@@ -1184,7 +1186,7 @@ static void fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
 	if (len >= ELF_PRARGSZ)
 		len = ELF_PRARGSZ-1;
 	copy_from_user(&psinfo->pr_psargs,
-		       (const char *)mm->arg_start, len);
+		       (const char __user *)mm->arg_start, len);
 	for(i = 0; i < len; i++)
 		if (psinfo->pr_psargs[i] == 0)
 			psinfo->pr_psargs[i] = ' ';
@@ -1543,6 +1545,6 @@ static void __exit exit_elf_binfmt(void)
 	unregister_binfmt(&elf_format);
 }
 
-module_init(init_elf_binfmt)
-module_exit(exit_elf_binfmt)
+core_initcall(init_elf_binfmt);
+module_exit(exit_elf_binfmt);
 MODULE_LICENSE("GPL");
diff --git a/fs/binfmt_em86.c b/fs/binfmt_em86.c
index 17d5c7ec7..a7f2299cf 100644
--- a/fs/binfmt_em86.c
+++ b/fs/binfmt_em86.c
@@ -110,6 +110,6 @@ static void __exit exit_em86_binfmt(void)
 	unregister_binfmt(&em86_format);
 }
 
-module_init(init_em86_binfmt)
-module_exit(exit_em86_binfmt)
+core_initcall(init_em86_binfmt);
+module_exit(exit_em86_binfmt);
 MODULE_LICENSE("GPL");
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index ddbc3904c..465133cd6 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -723,7 +723,7 @@ static int load_flat_file(struct linux_binprm * bprm,
 				return -ENOEXEC;
 
 			/* Get the pointer's value.  */
-			addr = flat_get_addr_from_rp(rp, relval);
+			addr = flat_get_addr_from_rp(rp, relval, flags);
 			if (addr != 0) {
 				/*
 				 * Do the relocation.  PIC relocs in the data section are
@@ -896,7 +896,7 @@ static void __exit exit_flat_binfmt(void)
 
 /****************************************************************************/
 
-module_init(init_flat_binfmt);
+core_initcall(init_flat_binfmt);
 module_exit(exit_flat_binfmt);
 
 /****************************************************************************/
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 20d40b9e0..9f2c43aba 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -196,7 +196,7 @@ static int unquote(char *from)
  * ':name:type:offset:magic:mask:interpreter:'
  * where the ':' is the IFS, that can be chosen with the first char
  */
-static Node *create_entry(const char *buffer, size_t count)
+static Node *create_entry(const char __user *buffer, size_t count)
 {
 	Node *e;
 	int memsize, err;
@@ -319,7 +319,7 @@ Einval:
  * Set status of entry/binfmt_misc:
  * '1' enables, '0' disables and '-1' clears entry/binfmt_misc
  */
-static int parse_command(const char *buffer, size_t count)
+static int parse_command(const char __user *buffer, size_t count)
 {
 	char s[4];
 
@@ -424,7 +424,7 @@ static void kill_node(Node *e)
 /* /<entry> */
 
 static ssize_t
-bm_entry_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
+bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)
 {
 	Node *e = file->f_dentry->d_inode->u.generic_ip;
 	loff_t pos = *ppos;
@@ -456,7 +456,7 @@ out:
 	return res;
 }
 
-static ssize_t bm_entry_write(struct file *file, const char *buffer,
+static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
 				size_t count, loff_t *ppos)
 {
 	struct dentry *root;
@@ -488,7 +488,7 @@ static struct file_operations bm_entry_operations = {
 
 /* /register */
 
-static ssize_t bm_register_write(struct file *file, const char *buffer,
+static ssize_t bm_register_write(struct file *file, const char __user *buffer,
 			       size_t count, loff_t *ppos)
 {
 	Node *e;
@@ -556,7 +556,7 @@ static struct file_operations bm_register_operations = {
 /* /status */
 
 static ssize_t
-bm_status_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
+bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
 {
 	char *s = enabled ? "enabled" : "disabled";
 	int len = strlen(s);
@@ -574,7 +574,7 @@ bm_status_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
 	return nbytes;
 }
 
-static ssize_t bm_status_write(struct file * file, const char * buffer,
+static ssize_t bm_status_write(struct file * file, const char __user * buffer,
 		size_t count, loff_t *ppos)
 {
 	int res = parse_command(buffer, count);
@@ -656,6 +656,6 @@ static void __exit exit_misc_binfmt(void)
 	unregister_filesystem(&bm_fs_type);
 }
 
-module_init(init_misc_binfmt);
+core_initcall(init_misc_binfmt);
 module_exit(exit_misc_binfmt);
 MODULE_LICENSE("GPL");
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c
index a302e0363..3c81f785e 100644
--- a/fs/binfmt_script.c
+++ b/fs/binfmt_script.c
@@ -111,6 +111,6 @@ static void __exit exit_script_binfmt(void)
 	unregister_binfmt(&script_format);
 }
 
-module_init(init_script_binfmt)
-module_exit(exit_script_binfmt)
+core_initcall(init_script_binfmt);
+module_exit(exit_script_binfmt);
 MODULE_LICENSE("GPL");
diff --git a/fs/binfmt_som.c b/fs/binfmt_som.c
index cabf3ccc0..d7e5f1f23 100644
--- a/fs/binfmt_som.c
+++ b/fs/binfmt_som.c
@@ -305,5 +305,5 @@ static void __exit exit_som_binfmt(void)
 	unregister_binfmt(&som_format);
 }
 
-module_init(init_som_binfmt);
+core_initcall(init_som_binfmt);
 module_exit(exit_som_binfmt);
diff --git a/fs/bio.c b/fs/bio.c
index 6284147b2..2d1ec6536 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -53,7 +53,7 @@ struct biovec_pool {
  * unsigned short
  */
 
-#define BV(x) { .nr_vecs = x, .name = "biovec-" #x }
+#define BV(x) { .nr_vecs = x, .name = "biovec-"__stringify(x) }
 static struct biovec_pool bvec_array[BIOVEC_NR_POOLS] = {
 	BV(1), BV(4), BV(16), BV(64), BV(128), BV(BIO_MAX_PAGES),
 };
@@ -808,9 +808,7 @@ static void __init biovec_init_pools(void)
 		size = bp->nr_vecs * sizeof(struct bio_vec);
 
 		bp->slab = kmem_cache_create(bp->name, size, 0,
-						SLAB_HWCACHE_ALIGN, NULL, NULL);
-		if (!bp->slab)
-			panic("biovec: can't init slab cache\n");
+				SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
 		if (i >= scale)
 			pool_entries >>= 1;
@@ -825,16 +823,16 @@ static void __init biovec_init_pools(void)
 static int __init init_bio(void)
 {
 	bio_slab = kmem_cache_create("bio", sizeof(struct bio), 0,
-					SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!bio_slab)
-		panic("bio: can't create slab cache\n");
-	bio_pool = mempool_create(BIO_POOL_SIZE, mempool_alloc_slab, mempool_free_slab, bio_slab);
+				SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
+	bio_pool = mempool_create(BIO_POOL_SIZE, mempool_alloc_slab,
+				mempool_free_slab, bio_slab);
 	if (!bio_pool)
 		panic("bio: can't create mempool\n");
 
 	biovec_init_pools();
 
-	bio_split_pool = mempool_create(BIO_SPLIT_ENTRIES, bio_pair_alloc, bio_pair_free, NULL);
+	bio_split_pool = mempool_create(BIO_SPLIT_ENTRIES,
+				bio_pair_alloc, bio_pair_free, NULL);
 	if (!bio_split_pool)
 		panic("bio: can't create split pool\n");
 
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 1b43058d8..f3089810d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -238,7 +238,10 @@ static struct inode *bdev_alloc_inode(struct super_block *sb)
 
 static void bdev_destroy_inode(struct inode *inode)
 {
-	kmem_cache_free(bdev_cachep, BDEV_I(inode));
+	struct bdev_inode *bdi = BDEV_I(inode);
+
+	bdi->bdev.bd_inode_backing_dev_info = NULL;
+	kmem_cache_free(bdev_cachep, bdi);
 }
 
 static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
@@ -303,14 +306,9 @@ struct super_block *blockdev_superblock;
 void __init bdev_cache_init(void)
 {
 	int err;
-	bdev_cachep = kmem_cache_create("bdev_cache",
-					sizeof(struct bdev_inode),
-					0,
-					SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
-					init_once,
-					NULL);
-	if (!bdev_cachep)
-		panic("Cannot create bdev_cache SLAB cache");
+	bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
+			0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_PANIC,
+			init_once, NULL);
 	err = register_filesystem(&bd_type);
 	if (err)
 		panic("Cannot register bdev pseudo-fs");
diff --git a/fs/buffer.c b/fs/buffer.c
index 033773300..0b84c0f84 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -43,6 +43,26 @@ static void invalidate_bh_lrus(void);
 
 #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
 
+struct bh_wait_queue {
+	struct buffer_head *bh;
+	wait_queue_t wait;
+};
+
+#define __DEFINE_BH_WAIT(name, b, f)					\
+	struct bh_wait_queue name = {					\
+		.bh	= b,						\
+		.wait	= {						\
+				.task	= current,			\
+				.flags	= f,				\
+				.func	= bh_wake_function,		\
+				.task_list =				\
+					LIST_HEAD_INIT(name.wait.task_list),\
+			},						\
+	}
+#define DEFINE_BH_WAIT(name, bh)	__DEFINE_BH_WAIT(name, bh, 0)
+#define DEFINE_BH_WAIT_EXCLUSIVE(name, bh) \
+		__DEFINE_BH_WAIT(name, bh, WQ_FLAG_EXCLUSIVE)
+
 /*
  * Hashed waitqueue_head's for wait_on_buffer()
  */
@@ -74,10 +94,50 @@ void wake_up_buffer(struct buffer_head *bh)
 
 	smp_mb();
 	if (waitqueue_active(wq))
-		wake_up_all(wq);
+		__wake_up(wq, TASK_INTERRUPTIBLE|TASK_UNINTERRUPTIBLE, 1, bh);
 }
 EXPORT_SYMBOL(wake_up_buffer);
 
+static int bh_wake_function(wait_queue_t *wait, unsigned mode,
+				int sync, void *key)
+{
+	struct buffer_head *bh = key;
+	struct bh_wait_queue *wq;
+
+	wq = container_of(wait, struct bh_wait_queue, wait);
+	if (wq->bh != bh || buffer_locked(bh))
+		return 0;
+	else
+		return autoremove_wake_function(wait, mode, sync, key);
+}
+
+static void sync_buffer(struct buffer_head *bh)
+{
+	struct block_device *bd;
+
+	smp_mb();
+	bd = bh->b_bdev;
+	if (bd)
+		blk_run_address_space(bd->bd_inode->i_mapping);
+}
+
+void fastcall __lock_buffer(struct buffer_head *bh)
+{
+	wait_queue_head_t *wqh = bh_waitq_head(bh);
+	DEFINE_BH_WAIT_EXCLUSIVE(wait, bh);
+
+	do {
+		prepare_to_wait_exclusive(wqh, &wait.wait,
+					TASK_UNINTERRUPTIBLE);
+		if (buffer_locked(bh)) {
+			sync_buffer(bh);
+			io_schedule();
+		}
+	} while (test_set_buffer_locked(bh));
+	finish_wait(wqh, &wait.wait);
+}
+EXPORT_SYMBOL(__lock_buffer);
+
 void fastcall unlock_buffer(struct buffer_head *bh)
 {
 	clear_buffer_locked(bh);
@@ -93,20 +153,16 @@ void fastcall unlock_buffer(struct buffer_head *bh)
 void __wait_on_buffer(struct buffer_head * bh)
 {
 	wait_queue_head_t *wqh = bh_waitq_head(bh);
-	DEFINE_WAIT(wait);
+	DEFINE_BH_WAIT(wait, bh);
 
 	do {
-		prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
+		prepare_to_wait(wqh, &wait.wait, TASK_UNINTERRUPTIBLE);
 		if (buffer_locked(bh)) {
-			struct block_device *bd;
-			smp_mb();
-			bd = bh->b_bdev;
-			if (bd)
-				blk_run_address_space(bd->bd_inode->i_mapping);
+			sync_buffer(bh);
 			io_schedule();
 		}
 	} while (buffer_locked(bh));
-	finish_wait(wqh, &wait);
+	finish_wait(wqh, &wait.wait);
 }
 
 static void
@@ -895,7 +951,8 @@ int __set_page_dirty_buffers(struct page *page)
 		if (page->mapping) {	/* Race with truncate? */
 			if (!mapping->backing_dev_info->memory_backed)
 				inc_page_state(nr_dirty);
-			radix_tree_tag_set(&mapping->page_tree, page->index,
+			radix_tree_tag_set(&mapping->page_tree,
+						page_index(page),
 						PAGECACHE_TAG_DIRTY);
 		}
 		spin_unlock_irq(&mapping->tree_lock);
@@ -1207,12 +1264,6 @@ grow_buffers(struct block_device *bdev, sector_t block, int size)
 	pgoff_t index;
 	int sizebits;
 
-	/* Size must be multiple of hard sectorsize */
-	if (size & (bdev_hardsect_size(bdev)-1))
-		BUG();
-	if (size < 512 || size > PAGE_SIZE)
-		BUG();
-
 	sizebits = -1;
 	do {
 		sizebits++;
@@ -1233,6 +1284,18 @@ grow_buffers(struct block_device *bdev, sector_t block, int size)
 struct buffer_head *
 __getblk_slow(struct block_device *bdev, sector_t block, int size)
 {
+	/* Size must be multiple of hard sectorsize */
+	if (unlikely(size & (bdev_hardsect_size(bdev)-1) ||
+			(size < 512 || size > PAGE_SIZE))) {
+		printk(KERN_ERR "getblk(): invalid block size %d requested\n",
+					size);
+		printk(KERN_ERR "hardsect size: %d\n",
+					bdev_hardsect_size(bdev));
+
+		dump_stack();
+		return NULL;
+	}
+
 	for (;;) {
 		struct buffer_head * bh;
 
@@ -2905,9 +2968,11 @@ EXPORT_SYMBOL(try_to_free_buffers);
 int block_sync_page(struct page *page)
 {
 	struct address_space *mapping;
+
 	smp_mb();
-	mapping = page->mapping;
-	blk_run_address_space(mapping);
+	mapping = page_mapping(page);
+	if (mapping)
+		blk_run_backing_dev(mapping->backing_dev_info, page);
 	return 0;
 }
 
@@ -3035,7 +3100,7 @@ void __init buffer_init(void)
 
 	bh_cachep = kmem_cache_create("buffer_head",
 			sizeof(struct buffer_head), 0,
-			0, init_buffer_head, NULL);
+			SLAB_PANIC, init_buffer_head, NULL);
 	for (i = 0; i < ARRAY_SIZE(bh_wait_queue_heads); i++)
 		init_waitqueue_head(&bh_wait_queue_heads[i].wqh);
 
diff --git a/fs/cifs/AUTHORS b/fs/cifs/AUTHORS
index d717dccd5..ac239020f 100644
--- a/fs/cifs/AUTHORS
+++ b/fs/cifs/AUTHORS
@@ -22,6 +22,8 @@ Andi Kleen
 Amrut Joshi
 Shobhit Dayal
 Sergey Vlasov
+Richard Hughes
+Yury Umanets
 
 Test case and Bug Report contributors
 -------------------------------------
@@ -29,5 +31,7 @@ Thanks to those in the community who have submitted detailed bug reports
 and debug of problems they have found:  Jochen Dolze, David Blaine,
 Rene Scharfe, Martin Josefsson, Alexander Wild, Anthony Liguori,
 Lars Muller, Urban Widmark, Massimiliano Ferrero, Howard Owen,
-Kieron Briggs and others. 
+Olaf Kirch, Kieron Briggs and others. 
 
+And thanks to the IBM LTC and Power test teams and SuSE testers for
+finding multiple bugs during excellent stress test runs.
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 2ae35d9ef..cae2bfb99 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,9 +1,47 @@
+Version 1.18
+------------
+Do not rename hardlinked files (since that should be a noop). Flush
+cached write behind data when reopening a file after session abend,
+except when already in write. Grab per socket sem during reconnect 
+to avoid oops in sendmsg if overlapping with reconnect.
+
+
+Version 1.17
+------------
+Update number of blocks in file so du command is happier (in Linux a fake
+blocksize of 512 is required for calculating number of blocks in inode).
+Fix prepare write of partial pages to read in data from server if possible.
+Fix race on tcpStatus field between unmount and reconnection code, causing
+cifsd process sometimes to hang around forever. Improve out of memory
+checks in cifs_filldir
+
+Version 1.16
+------------
+Fix incorrect file size in file handle based setattr on big endian hardware.
+Fix oops in build_path_from_dentry when out of memory.  Add checks for invalid
+and closing file structs in writepage/partialpagewrite.  Add statistics
+for each mounted share (new menuconfig option). Fix endianness problem in
+volume information displayed in /proc/fs/cifs/DebugData (only affects
+affects big endian architectures). Prevent renames while constructing
+path names for open, mkdir and rmdir.
+
+Version 1.15
+------------
+Change to mempools for alloc smb request buffers and multiplex structs
+to better handle low memory problems (and potential deadlocks).
+
+Version 1.14
+------------
+Fix incomplete listings of large directories on Samba servers when Unix
+extensions enabled.  Fix oops when smb_buffer can not be allocated. Fix
+rename deadlock when writing out dirty pages at same time.
+
 Version 1.13
 ------------
 Fix open of files in which O_CREATE can cause the mode to change in
 some cases. Fix case in which retry of write overlaps file close.
 Fix PPC64 build error.  Reduce excessive stack usage in smb password
-hashing.
+hashing. Fix overwrite of Linux user's view of file mode to Windows servers.
 
 Version 1.12
 ------------
diff --git a/fs/cifs/README b/fs/cifs/README
index 926cd0077..09b49c804 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -97,16 +97,30 @@ Linux:
 
 	case sensitive = yes
 	delete readonly = yes 
- 
+	ea support = yes
+
+Note that ea support is required for supporting Linux xattrs. 
 Some administrators also change the "map archive" and the "create mask" 
 parameters from their default values.  Creating special devices (mknod) remotely 
 may require specifying a mkdev function to Samba.  For more information on these 
 see the manual pages ("man smb.conf") on the Samba server system.  Note that the 
 cifs vfs, unlike the smbfs vfs, does not read the smb.conf on the client system 
 (the few optional settings are passed in on mount via -o parameters instead).  
-Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete 
+Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete
 open files (required for strict POSIX compliance).  Windows Servers already 
-supported this feature.  
+supported this feature. Samba server does not allow symlinks that refer to files
+outside of the share, so in Samba versions prior to 3.0.5, most symlinks to
+files with absolute paths (ie beginning with slash) such as:
+	 ln -s /mnt/foo bar
+would be forbidden. Samba 3.0.5 server or later includes the ability to create 
+such symlinks safely by converting unsafe symlinks (ie symlinks to server 
+files that are outside of the share) to a samba specific format on the server
+that is ignored by local server applications and non-cifs clients and that will
+not be traversed by the Samba server).  This is opaque to the Linux client
+application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or
+later, but only for remote clients using the CIFS Unix extensions, and will
+be invisbile to Windows clients and typically will not affect local
+applications running on the same server as Samba.  
 
 Use instructions:
 ================
@@ -142,6 +156,8 @@ of the mount options. Credential files contain two lines
         password=your_password
 2) By specifying the password in the PASSWD environment variable (similarly
 the user name can be taken from the USER environment variable).
+3) By specifying the password in a file by name via PASSWD_FILE
+4) By specifying the password in a file by file descriptor via PASSWD_FD
 
 If no password is provided, mount.cifs will prompt for password entry
 
@@ -166,8 +182,28 @@ A partial list of the supported mount options follows:
 		mount.	
   domain	Set the SMB/CIFS workgroup name prepended to the
 		username during CIFS session establishment
-  uid           If CIFS Unix extensions are not supported by the server
-                this overrides the default uid for inodes.
+  uid		If CIFS Unix extensions are not supported by the server
+		this overrides the default uid for inodes. For mounts to
+		servers which do support the CIFS Unix extensions, such
+		as a properly configured Samba server, the server provides
+		the uid, gid and mode.  For servers which do not support
+		the Unix extensions, the default uid (and gid) returned on
+		lookup of existing files is the uid (gid) of the person
+		who executed the mount (root, except when mount.cifs
+		is configured setuid for user mounts) unless the "uid=" 
+		(gid) mount option is specified.  For the uid (gid) of newly
+		created files and directories, ie files created since 
+		the last mount of the server share, the expected uid 
+		(gid) is cached as as long as the inode remains in 
+		memory on the client.   Also note that permission
+		checks (authorization checks) on accesses to a file occur
+		at the server, but there are cases in which an administrator
+		may want to restrict at the client as well.  For those
+		servers which do not report a uid/gid owner
+		(such as Windows), permissions can also be checked at the
+		client, and a crude form of client side permission checking 
+		can be enabled by specifying file_mode and dir_mode on 
+		the client
   gid		If CIFS Unix extensions are not supported by the server
 		this overrides the default gid for inodes.
   file_mode     If CIFS Unix extensions are not supported by the server
@@ -219,13 +255,27 @@ A partial list of the supported mount options follows:
 		if guest is specified on the mount options.  If no
 		password is specified a null password will be used.
 
+The mount.cifs mount helper also accepts a few mount options before -o
+including:
+
+	-S      take password from stdin (equivalent to setting the environment
+		variable "PASSWD_FD=0"
+	-V      print mount.cifs version
+	-?      display simple usage information
+
+With recent 2.6 kernel versions of modutils, the version of the cifs kernel
+module can be displayed via modinfo.
+
 Misc /proc/fs/cifs Flags and Debug Info
 =======================================
 Informational pseudo-files:
 DebugData		Displays information about active CIFS sessions
+			and shares.
 SimultaneousOps		Counter which holds maximum number of
 			simultaneous outstanding SMB/CIFS requests.
-Stats			Lists summary resource usage information
+Stats			Lists summary resource usage information as well as per
+			share statistics, if CONFIG_CIFS_STATS in enabled
+			in the kernel configuration.
 
 Configuration pseudo-files:
 MultiuserMount		If set to one, more than one CIFS session to 
@@ -279,13 +329,25 @@ and for more extensive tracing including the start of smb requests and responses
 Three other experimental features are under development and to test 
 require enabling an ifdef (e.g. by  adding "#define CIFS_FCNTL" in cifsglob.h)
 
-	CIFS_QUOTA
+	CONFIG_CIFS_QUOTA
+
+	CONFIG_CIFS_XATTR
 
-	CIFS_XATTR
+	CONFIG_CIFS_FCNTL  (fcntl needed for support of directory change 
+			    notification and perhaps later for file leases)
 
-	CIFS_FCNTL  (fcntl needed for support of directory change notification)
+Per share (per client mount) statistics are available in /proc/fs/cifs/DebugData
+if the kernel was configured with cifs statistics enabled.  The statistics
+represent the number of successful (ie non-zero return code from the server) 
+SMB responses to some of the more common commands (open, delete, mkdir etc.).
+Also recorded is the total bytes read and bytes written to the server for
+that share.  Note that due to client caching effects this can be less than the
+number of bytes read and written by the application running on the client.
+The statistics for the number of total SMBs and oplock breaks are different in
+that they represent all for that share, not just those for which the server
+returned success.
 	
-Also note that "cat /proc/fs/cifs/DebugData" will display some information about 
+Also note that "cat /proc/fs/cifs/DebugData" will display information about 
 the active sessions and the shares that are mounted.  Note: NTLMv2 enablement 
 will not work since they its implementation is not quite complete yet.
 Do not alter these configuration values unless you are doing specific testing.  
diff --git a/fs/cifs/TODO b/fs/cifs/TODO
index 6d9e8502c..c4ee8107a 100644
--- a/fs/cifs/TODO
+++ b/fs/cifs/TODO
@@ -1,7 +1,7 @@
-version 1.0.2 January 29, 2004
+version 1.16 May 27, 2004
 
-A Partial List of Known Problems and Missing Features
-=====================================================
+A Partial List of Missing Features
+==================================
 
 Contributions are welcome.  There are plenty of opportunities
 for visible, important contributions to this module.  Here
@@ -21,8 +21,8 @@ e) NTLMv2 authentication (mostly implemented)
 
 f) MD5-HMAC signing SMB PDUs when SPNEGO style SessionSetup 
 used (Kerberos or NTLMSSP). Signing alreadyimplemented for NTLM
-	and raw NTLMSSP already. This is important when enabling
-	extended security and mounting to Windows 2003 Servers
+and raw NTLMSSP already. This is important when enabling
+extended security and mounting to Windows 2003 Servers
 
 f) Directory entry caching relies on a 1 second timer, rather than 
 using FindNotify or equivalent.  - (started)
@@ -34,7 +34,8 @@ h) quota support
 
 i) support for the Linux 2.5 kernel new feature get_xattr and set_xattr
 which will allow us to expose dos attributes as well as real
-ACLs
+ACLs. This support has been started in the current code, but is
+ifdeffed out.
 
 k) finish writepages support (multi-page write behind for improved
 performance) and syncpage
@@ -42,7 +43,9 @@ performance) and syncpage
 l) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
 extra copy in/out of the socket buffers in some cases.
 
-m) finish support for IPv6
+m) finish support for IPv6.  This is mostly complete but
+needs a simple inet_pton like function to convert ipv6
+addresses in string representation.
 
 o) Better optimize open (and pathbased setfilesize) to reduce the
 oplock breaks coming from windows srv.  Piggyback identical file
@@ -51,10 +54,23 @@ than resending (helps reduce server resource utilization and avoid
 spurious oplock breaks).
 
 p) Improve performance of readpages by sending more than one read
-at a time when 8 pages or more are requested.
+at a time when 8 pages or more are requested.  Evaluate whether
+reads larger than 16K would be helpful.
 
+q) For support of Windows9x/98 we need to retry failed mounts
+to *SMBSERVER (default server name) with the uppercase hostname
+in the RFC1001 session_init request.
 
-KNOWN BUGS (updated January 30, 2004)
+r) Add Extended Attributed support (for storing UID/GID info
+to Windows servers)
+
+s) Finish fcntl D_NOTIFY support so kde and gnome file list windows
+will autorefresh
+
+t) Add GUI tool to configure /proc/fs/cifs settings and for display of
+the CIFS statistics
+
+KNOWN BUGS (updated May 27, 2004)
 ====================================
 1) existing symbolic links (Windows reparse points) are recognized but
 can not be created remotely. They are implemented for Samba and those that
@@ -64,20 +80,18 @@ symlink text beginning with slash
 but recognizes them
 3) create of new files to FAT partitions on Windows servers can
 succeed but still return access denied (appears to be Windows 
-not client problem).  NTFS partitions do not have this problem.
-4) debug connectathon special test case nfs_idem (which does
-some invalid symlink naming, or at least what Samba thinks
-is an invalid symlink target).
-5) debug connectation lock test case 10 which fails against
+server not cifs client problem) and has not been reproduced recently.
+NTFS partitions do not have this problem.
+4) debug connectation lock test case 10 which fails against
 Samba (may be unmappable due to POSIX to Windows lock model
 differences but worth investigating).  Also debug Samba to 
 see why lock test case 7 takes longer to complete to Samba
 than to Windows.
 
 Misc testing to do
-=================
+==================
 1) check out max path names and max path name components against various server
-types.
+types. Return max path name in stat -f information
 
 2) Modify file portion of ltp so it can run against a mounted network
 share and run it against cifs vfs.
@@ -87,5 +101,6 @@ there are some easy changes that can be done to parallelize sequential writes,
 and when signing is disabled to request larger read sizes (larger than 
 negotiated size) and send larger write sizes to modern servers.
 
-4) More exhaustively test the recently added NT4 support
+4) More exhaustively test the recently added NT4 support against various
+NT4 service pack levels.
 
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 68e984ac6..2c3d9a867 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -74,7 +74,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 		    "---------------------------------------------------\n");
 	buf += length;
 
-	length = sprintf(buf, "Servers: \n");
+	length = sprintf(buf, "Servers:\n");
 	buf += length;
 
 	i = 0;
@@ -84,13 +84,15 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 		ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList);
 		length =
 		    sprintf(buf,
-			    "\n%d) Name: %s  Domain: %s Mounts: %d ServerOS: %s  \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\tTCP session status: %d",
+			    "\n%d) Name: %s  Domain: %s Mounts: %d ServerOS: %s  \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\tTCP status: %d",
 				i, ses->serverName, ses->serverDomain, atomic_read(&ses->inUse),
 				ses->serverOS, ses->serverNOS, ses->capabilities,ses->status,ses->server->tcpStatus);
 		buf += length;
 		if(ses->server) {
-			buf += sprintf(buf, "\n\tLocal Users To Same Server: %d SecMode: 0x%x",
-				atomic_read(&ses->server->socketUseCount),ses->server->secMode);
+			buf += sprintf(buf, "\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d",
+				atomic_read(&ses->server->socketUseCount),
+				ses->server->secMode,
+				atomic_read(&ses->server->inFlight));
 			
 			/* length = sprintf(buf, "\nMIDs: \n");
 			buf += length;
@@ -113,7 +115,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 	sprintf(buf, "\n");
 	buf++;
 
-	length = sprintf(buf, "\nShares: \n");
+	length = sprintf(buf, "\nShares:\n");
 	buf += length;
 
 	i = 0;
@@ -123,7 +125,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 		tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
 		length =
 		    sprintf(buf,
-			    "\n%d) %s Uses: %d on FS: %s with characteristics: 0x%x Attributes: 0x%x\n\tPathComponentMax: %d Status: %d",
+			    "\n%d) %s Uses: %d Type: %s Characteristics: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d",
 			    i, tcon->treeName,
 			    atomic_read(&tcon->useCount),
 			    tcon->nativeFileSystem,
@@ -140,8 +142,10 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 			    sprintf(buf, " type: %d ",
 				    tcon->fsDevInfo.DeviceType);
 		buf += length;
-		if(tcon->tidStatus == CifsNeedReconnect)
+		if(tcon->tidStatus == CifsNeedReconnect) {
 			buf += sprintf(buf, "\tDISCONNECTED ");
+			length += 14;
+		}
 	}
 	read_unlock(&GlobalSMBSeslock);
 
@@ -176,32 +180,80 @@ cifs_total_xid_read(char *buf, char **beginBuffer, off_t offset,
 	return length;
 }
 
+#ifdef CONFIG_CIFS_STATS
 int
 cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
 		  int length, int *eof, void *data)
 {
-	int item_length;
-	length =
-	    sprintf(buf,
-		    "Currently Allocated structures\nCIFS Sessions: %d\n",sesInfoAllocCount.counter);
+	int item_length,i;
+	struct list_head *tmp;
+	struct cifsTconInfo *tcon;
+
+	length = sprintf(buf,
+			"Resources in use\nCIFS Session: %d\n",
+			sesInfoAllocCount.counter);
 	buf += length;
 	item_length = 
-		sprintf(buf,"Shares (unique mount targets): %d\n",tconInfoAllocCount.counter);
+		sprintf(buf,"Share (unique mount targets): %d\n",
+			tconInfoAllocCount.counter);
 	length += item_length;
 	buf += item_length;      
 	item_length = 
-			sprintf(buf,"Allocated SMB Request and Response Buffers: %d\n",bufAllocCount.counter);
+		sprintf(buf,"SMB Request/Response Buffer: %d\n",
+			bufAllocCount.counter);
 	length += item_length;
 	buf += item_length;      
 	item_length = 
-		sprintf(buf,"Active Operations (MIDs in use): %d\n",midCount.counter);
+		sprintf(buf,"Operations (MIDs): %d\n",
+			midCount.counter);
 	length += item_length;
 	buf += item_length;
-	item_length = sprintf(buf,"%d sessions and %d shares reconnected after failure\n",tcpSesReconnectCount.counter,tconInfoReconnectCount.counter);
+	item_length = sprintf(buf,
+		"\n%d session %d share reconnects\n",
+		tcpSesReconnectCount.counter,tconInfoReconnectCount.counter);
 	length += item_length;
+	buf += item_length;
+
+	i = 0;
+	read_lock(&GlobalSMBSeslock);
+	list_for_each(tmp, &GlobalTreeConnectionList) {
+		i++;
+		tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
+		item_length = sprintf(buf,"\n%d) %s",i, tcon->treeName);
+		buf += item_length;
+		length += item_length;
+		if(tcon->tidStatus == CifsNeedReconnect) {
+			buf += sprintf(buf, "\tDISCONNECTED ");
+			length += 14;
+		}
+		item_length = sprintf(buf,"\nSMBs: %d Oplock Breaks: %d",
+			atomic_read(&tcon->num_smbs_sent),
+			atomic_read(&tcon->num_oplock_brks));
+		buf += item_length;
+		length += item_length;
+		item_length = sprintf(buf,"\nReads: %d Bytes %lld",
+			atomic_read(&tcon->num_reads),
+			(long long)(tcon->bytes_read));
+		buf += item_length;
+		item_length = sprintf(buf,"\nWrites: %d Bytes: %lld",
+			atomic_read(&tcon->num_writes),
+			(long long)(tcon->bytes_written));
+		buf += item_length;
+		item_length = sprintf(buf,
+			"\nOpens: %d Deletes: %d\nMkdirs: %d Rmdirs: %d",
+			atomic_read(&tcon->num_opens),
+			atomic_read(&tcon->num_deletes),
+			atomic_read(&tcon->num_mkdirs),
+			atomic_read(&tcon->num_rmdirs));
+		buf += item_length;
+		length += item_length;
+	}
+	read_unlock(&GlobalSMBSeslock);
+
 
 	return length;
 }
+#endif
 
 struct proc_dir_entry *proc_fs_cifs;
 read_proc_t cifs_txanchor_read;
@@ -241,10 +293,10 @@ cifs_proc_init(void)
 
 	create_proc_read_entry("SimultaneousOps", 0, proc_fs_cifs,
 				cifs_total_xid_read, 0);
-
+#ifdef CONFIG_CIFS_STATS
 	create_proc_read_entry("Stats", 0, proc_fs_cifs,
 				cifs_stats_read, 0);
-
+#endif
 	pde = create_proc_read_entry("cifsFYI", 0, proc_fs_cifs,
 				cifsFYI_read, 0);
 	if (pde)
@@ -312,7 +364,9 @@ cifs_proc_clean(void)
 	remove_proc_entry("cifsFYI", proc_fs_cifs);
 	remove_proc_entry("traceSMB", proc_fs_cifs);
 	remove_proc_entry("SimultaneousOps", proc_fs_cifs);
+#ifdef CONFIG_CIFS_STATS
 	remove_proc_entry("Stats", proc_fs_cifs);
+#endif
 	remove_proc_entry("MultiuserMount", proc_fs_cifs);
 	remove_proc_entry("OplockEnabled", proc_fs_cifs);
 	remove_proc_entry("NTLMV2Enabled",proc_fs_cifs);
@@ -346,7 +400,7 @@ cifsFYI_read(char *page, char **start, off_t off, int count,
 	return len;
 }
 static int
-cifsFYI_write(struct file *file, const char *buffer,
+cifsFYI_write(struct file *file, const char __user *buffer,
 	      unsigned long count, void *data)
 {
 	char c;
@@ -385,7 +439,7 @@ oplockEnabled_read(char *page, char **start, off_t off,
 	return len;
 }
 static int
-oplockEnabled_write(struct file *file, const char *buffer,
+oplockEnabled_write(struct file *file, const char __user *buffer,
 		    unsigned long count, void *data)
 {
 	char c;
@@ -425,7 +479,7 @@ quotaEnabled_read(char *page, char **start, off_t off,
         return len;
 }
 static int
-quotaEnabled_write(struct file *file, const char *buffer,
+quotaEnabled_write(struct file *file, const char __user *buffer,
                     unsigned long count, void *data)
 {
         char c;
@@ -465,7 +519,7 @@ linuxExtensionsEnabled_read(char *page, char **start, off_t off,
         return len;
 }
 static int
-linuxExtensionsEnabled_write(struct file *file, const char *buffer,
+linuxExtensionsEnabled_write(struct file *file, const char __user *buffer,
                     unsigned long count, void *data)
 {
         char c;
@@ -505,7 +559,7 @@ lookupFlag_read(char *page, char **start, off_t off,
 	return len;
 }
 static int
-lookupFlag_write(struct file *file, const char *buffer,
+lookupFlag_write(struct file *file, const char __user *buffer,
 		    unsigned long count, void *data)
 {
 	char c;
@@ -543,7 +597,7 @@ traceSMB_read(char *page, char **start, off_t off, int count,
 	return len;
 }
 static int
-traceSMB_write(struct file *file, const char *buffer,
+traceSMB_write(struct file *file, const char __user *buffer,
 	       unsigned long count, void *data)
 {
 	char c;
@@ -582,7 +636,7 @@ multiuser_mount_read(char *page, char **start, off_t off,
 	return len;
 }
 static int
-multiuser_mount_write(struct file *file, const char *buffer,
+multiuser_mount_write(struct file *file, const char __user *buffer,
 		      unsigned long count, void *data)
 {
 	char c;
@@ -621,7 +675,7 @@ extended_security_read(char *page, char **start, off_t off,
 	return len;
 }
 static int
-extended_security_write(struct file *file, const char *buffer,
+extended_security_write(struct file *file, const char __user *buffer,
 			unsigned long count, void *data)
 {
 	char c;
@@ -660,7 +714,7 @@ ntlmv2_enabled_read(char *page, char **start, off_t off,
 	return len;
 }
 static int
-ntlmv2_enabled_write(struct file *file, const char *buffer,
+ntlmv2_enabled_write(struct file *file, const char __user *buffer,
 			unsigned long count, void *data)
 {
 	char c;
@@ -699,7 +753,7 @@ packet_signing_enabled_read(char *page, char **start, off_t off,
 	return len;
 }
 static int
-packet_signing_enabled_write(struct file *file, const char *buffer,
+packet_signing_enabled_write(struct file *file, const char __user *buffer,
 			unsigned long count, void *data)
 {
 	char c;
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index 32ffebb70..bf24d2828 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -63,18 +63,4 @@ extern int cifsERROR;
 #define cifserror(format,arg...)
 #endif		/* _CIFS_DEBUG */
 
-/*
- *	statistics
- *	----------
- */
-#ifdef	_CIFS_STATISTICS
-#define	INCREMENT(x)	((x)++)
-#define	DECREMENT(x)	((x)--)
-#define	HIGHWATERMARK(x,y)	x = MAX((x), (y))
-#else
-#define	INCREMENT(x)
-#define	DECREMENT(x)
-#define	HIGHWATERMARK(x,y)
-#endif				/* _CIFS_STATISTICS */
-
 #endif				/* _H_CIFS_DEBUG */
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 17458b708..1fe2654a7 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -31,6 +31,7 @@
 #include <linux/list.h>
 #include <linux/seq_file.h>
 #include <linux/vfs.h>
+#include <linux/mempool.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
 #define DECLARE_GLOBALS_HERE
@@ -39,9 +40,11 @@
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
 #include <linux/mm.h>
-#define CIFS_MAGIC_NUMBER 0xFF534D42	/* the first four bytes of all SMB PDUs */
+#define CIFS_MAGIC_NUMBER 0xFF534D42	/* the first four bytes of SMB PDUs */
+/* BB when mempool_resize is added back in, we will resize pool on new mount */
+#define CIFS_MIN_RCV_POOL 11 /* enough for progress to five servers */
 
-#ifdef CIFS_QUOTA
+#ifdef CONFIG_CIFS_QUOTA
 static struct quotactl_ops cifs_quotactl_ops;
 #endif
 
@@ -100,7 +103,7 @@ cifs_read_super(struct super_block *sb, void *data,
 	sb->s_op = &cifs_super_ops;
 /*	if(cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512)
 	    sb->s_blocksize = cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */
-#ifdef CIFS_QUOTA
+#ifdef CONFIG_CIFS_QUOTA
 	sb->s_qcop = &cifs_quotactl_ops;
 #endif
 	sb->s_blocksize = CIFS_MAX_MSGSIZE;
@@ -209,9 +212,11 @@ static int cifs_permission(struct inode * inode, int mask, struct nameidata *nd)
 }
 
 static kmem_cache_t *cifs_inode_cachep;
-kmem_cache_t *cifs_req_cachep;
-kmem_cache_t *cifs_mid_cachep;
+static kmem_cache_t *cifs_req_cachep;
+static kmem_cache_t *cifs_mid_cachep;
 kmem_cache_t *cifs_oplock_cachep;
+mempool_t *cifs_req_poolp;
+mempool_t *cifs_mid_poolp;
 
 static struct inode *
 cifs_alloc_inode(struct super_block *sb)
@@ -271,7 +276,7 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
 	return 0;
 }
 
-#ifdef CIFS_QUOTA
+#ifdef CONFIG_CIFS_QUOTA
 int cifs_xquota_set(struct super_block * sb, int quota_type, qid_t qid,
 		struct fs_disk_quota * pdquota)
 {
@@ -421,7 +426,7 @@ cifs_get_sb(struct file_system_type *fs_type,
 }
 
 static ssize_t
-cifs_read_wrapper(struct file * file, char *read_data, size_t read_size,
+cifs_read_wrapper(struct file * file, char __user *read_data, size_t read_size,
           loff_t * poffset)
 {
 	if(file == NULL)
@@ -450,7 +455,7 @@ cifs_read_wrapper(struct file * file, char *read_data, size_t read_size,
 }
 
 static ssize_t
-cifs_write_wrapper(struct file * file, const char *write_data,
+cifs_write_wrapper(struct file * file, const char __user *write_data,
            size_t write_size, loff_t * poffset) 
 {
 	ssize_t written;
@@ -504,7 +509,7 @@ struct inode_operations cifs_file_inode_ops = {
 	.getattr = cifs_getattr, /* do we need this anymore? */
 	.rename = cifs_rename,
 	.permission = cifs_permission,
-#ifdef CIFS_XATTR
+#ifdef CONFIG_CIFS_XATTR
 	.setxattr = cifs_setxattr,
 	.getxattr = cifs_getxattr,
 	.listxattr = cifs_listxattr,
@@ -519,7 +524,7 @@ struct inode_operations cifs_symlink_inode_ops = {
 	/* BB add the following two eventually */
 	/* revalidate: cifs_revalidate,
 	   setattr:    cifs_notify_change, *//* BB do we need notify change */
-#ifdef CIFS_XATTR
+#ifdef CONFIG_CIFS_XATTR
 	.setxattr = cifs_setxattr,
 	.getxattr = cifs_getxattr,
 	.listxattr = cifs_listxattr,
@@ -537,7 +542,7 @@ struct file_operations cifs_file_ops = {
 	.flush = cifs_flush,
 	.mmap  = cifs_file_mmap,
 	.sendfile = generic_file_sendfile,
-#ifdef CIFS_FCNTL
+#ifdef CONFIG_CIFS_FCNTL
 	.fcntl = cifs_fcntl,
 #endif
 };
@@ -546,7 +551,7 @@ struct file_operations cifs_dir_ops = {
 	.readdir = cifs_readdir,
 	.release = cifs_closedir,
 	.read    = generic_read_dir,
-#ifdef CIFS_FCNTL
+#ifdef CONFIG_CIFS_FCNTL
 	.fcntl   = cifs_fcntl,
 #endif
 };
@@ -593,12 +598,23 @@ cifs_init_request_bufs(void)
 	if (cifs_req_cachep == NULL)
 		return -ENOMEM;
 
+	cifs_req_poolp = mempool_create(CIFS_MIN_RCV_POOL,
+					mempool_alloc_slab,
+					mempool_free_slab,
+					cifs_req_cachep);
+
+	if(cifs_req_poolp == NULL) {
+		kmem_cache_destroy(cifs_req_cachep);
+		return -ENOMEM;
+	}
+
 	return 0;
 }
 
 static void
 cifs_destroy_request_bufs(void)
 {
+	mempool_destroy(cifs_req_poolp);
 	if (kmem_cache_destroy(cifs_req_cachep))
 		printk(KERN_WARNING
 		       "cifs_destroy_request_cache: error not all structures were freed\n");
@@ -612,11 +628,22 @@ cifs_init_mids(void)
 				SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (cifs_mid_cachep == NULL)
 		return -ENOMEM;
+
+	cifs_mid_poolp = mempool_create(3 /* a reasonable min simultan opers */,
+					mempool_alloc_slab,
+					mempool_free_slab,
+					cifs_mid_cachep);
+	if(cifs_mid_poolp == NULL) {
+		kmem_cache_destroy(cifs_mid_cachep);
+		return -ENOMEM;
+	}
+
 	cifs_oplock_cachep = kmem_cache_create("cifs_oplock_structs",
 				sizeof (struct oplock_q_entry), 0,
 				SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (cifs_oplock_cachep == NULL) {
 		kmem_cache_destroy(cifs_mid_cachep);
+		mempool_destroy(cifs_mid_poolp);
 		return -ENOMEM;
 	}
 
@@ -626,9 +653,11 @@ cifs_init_mids(void)
 static void
 cifs_destroy_mids(void)
 {
+	mempool_destroy(cifs_mid_poolp);
 	if (kmem_cache_destroy(cifs_mid_cachep))
 		printk(KERN_WARNING
 		       "cifs_destroy_mids: error not all structures were freed\n");
+
 	if (kmem_cache_destroy(cifs_oplock_cachep))
 		printk(KERN_WARNING
 		       "error not all oplock structures were freed\n");
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 115db6da1..b8be30c09 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -85,7 +85,7 @@ extern struct dentry_operations cifs_dentry_ops;
 
 /* Functions related to symlinks */
 extern int cifs_follow_link(struct dentry *direntry, struct nameidata *nd);
-extern int cifs_readlink(struct dentry *direntry, char *buffer, int buflen);
+extern int cifs_readlink(struct dentry *direntry, char __user *buffer, int buflen);
 extern int cifs_symlink(struct inode *inode, struct dentry *direntry,
 			const char *symname);
 extern int	cifs_removexattr(struct dentry *, const char *);
@@ -93,5 +93,5 @@ extern int 	cifs_setxattr(struct dentry *, const char *, const void *,
 			 size_t, int);
 extern ssize_t	cifs_getxattr(struct dentry *, const char *, void *, size_t);
 extern ssize_t	cifs_listxattr(struct dentry *, char *, size_t);
-#define CIFS_VERSION   "1.13"
+#define CIFS_VERSION   "1.18"
 #endif				/* _CIFSFS_H */
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 25c9abfb7..427d9c9d5 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -34,9 +34,14 @@
 
 /*
  * MAX_REQ is the maximum number of requests that WE will send
- * on one NetBIOS handle concurently.
+ * on one socket concurently. It also matches the most common
+ * value of max multiplex returned by servers.  We may 
+ * eventually want to use the negotiated value (in case
+ * future servers can handle more) when we are more confident that
+ * we will not have problems oveloading the socket with pending
+ * write data.
  */
-#define MAX_REQ (10)
+#define CIFS_MAX_REQ 50 
 
 #define SERVER_NAME_LENGTH 15
 #define SERVER_NAME_LEN_WITH_NULL     (SERVER_NAME_LENGTH + 1)
@@ -110,7 +115,8 @@ struct TCP_Server_Info {
 		struct sockaddr_in sockAddr;
 		struct sockaddr_in6 sockAddr6;
 	} addr;
-	wait_queue_head_t response_q;
+	wait_queue_head_t response_q; 
+	wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
 	struct list_head pending_mid_q;
 	void *Server_NlsInfo;	/* BB - placeholder for future NLS info  */
 	unsigned short server_codepage;	/* codepage for the server    */
@@ -119,7 +125,8 @@ struct TCP_Server_Info {
 	char versionMajor;
 	char versionMinor;
 	int svlocal:1;		/* local server or remote */
-	atomic_t socketUseCount;	/* indicates if the server has any open cifs sessions */
+	atomic_t socketUseCount; /* number of open cifs sessions on socket */
+	atomic_t inFlight;  /* number of requests on the wire to server */
 	enum statusEnum tcpStatus; /* what we think the status is */
 	struct semaphore tcpSem;
 	struct task_struct *tsk;
@@ -163,7 +170,7 @@ struct cifsSesInfo {
 	struct semaphore sesSem;
 	struct cifsUidInfo *uidInfo;	/* pointer to user info */
 	struct TCP_Server_Info *server;	/* pointer to server info */
-	atomic_t inUse;		/* # of CURRENT users of this ses */
+	atomic_t inUse; /* # of mounts (tree connections) on this ses */
 	enum statusEnum status;
 	__u32 sequence_number;  /* needed for CIFS PDU signature */
 	__u16 ipc_tid;		/* special tid for connection to IPC share */
@@ -195,6 +202,19 @@ struct cifsTconInfo {
 	__u16 Flags;		/* optional support bits */
 	enum statusEnum tidStatus;
 	atomic_t useCount;	/* how many mounts (explicit or implicit) to this share */
+#ifdef CONFIG_CIFS_STATS
+	atomic_t num_smbs_sent;
+	atomic_t num_writes;
+	atomic_t num_reads;
+	atomic_t num_oplock_brks;
+	atomic_t num_opens;
+	atomic_t num_deletes;
+	atomic_t num_mkdirs;
+	atomic_t num_rmdirs;
+	__u64    bytes_read;
+	__u64    bytes_written;
+	spinlock_t stat_lock;
+#endif
 	FILE_SYSTEM_DEVICE_INFO fsDevInfo;
 	FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo;	/* ok if file system name truncated */
 	FILE_SYSTEM_UNIX_INFO fsUnixInfo;
@@ -294,13 +314,6 @@ struct oplock_q_entry {
 #define   MID_RESPONSE_RECEIVED 4
 #define   MID_RETRY_NEEDED      8 /* session closed while this request out */
 
-struct servers_not_supported { /* @z4a */
-	struct servers_not_supported *next1;  /* @z4a */
-	char server_Name[SERVER_NAME_LEN_WITH_NULL]; /* @z4a */
-	/* Server Names in SMB protocol are 15 chars + X'20'  */
-	/*   in 16th byte...                      @z4a        */
-};
-
 /*
  *****************************************************************
  * All constants go here
@@ -398,4 +411,3 @@ GLOBAL_EXTERN unsigned int ntlmv2_support;  /* better optional password hash */
 GLOBAL_EXTERN unsigned int sign_CIFS_PDUs;  /* enable smb packet signing */
 GLOBAL_EXTERN unsigned int linuxExtEnabled;  /* enable Linux/Unix CIFS extensions */
 
-
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 8d9b134c2..067eb4e3e 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -34,9 +34,10 @@
 #define SMB_COM_DELETE                0x06
 #define SMB_COM_RENAME                0x07
 #define SMB_COM_LOCKING_ANDX          0x24
+#define SMB_COM_COPY                  0x29
 #define SMB_COM_READ_ANDX             0x2E
 #define SMB_COM_WRITE_ANDX            0x2F
-#define SMB_COM_TRANSACTION2	      0x32
+#define SMB_COM_TRANSACTION2          0x32
 #define SMB_COM_TRANSACTION2_SECONDARY 0x33
 #define SMB_COM_FIND_CLOSE2           0x34
 #define SMB_COM_TREE_DISCONNECT       0x71
@@ -775,6 +776,34 @@ typedef struct smb_com_rename_req {
 	/* followed by NewFileName */
 } RENAME_REQ;
 
+	/* copy request flags */
+#define COPY_MUST_BE_FILE      0x0001
+#define COPY_MUST_BE_DIR       0x0002
+#define COPY_TARGET_MODE_ASCII 0x0004 /* if not set, binary */
+#define COPY_SOURCE_MODE_ASCII 0x0008 /* if not set, binary */
+#define COPY_VERIFY_WRITES     0x0010
+#define COPY_TREE              0x0020 
+
+typedef struct smb_com_copy_req {
+	struct smb_hdr hdr;	/* wct = 3 */
+	__u16 Tid2;
+	__u16 OpenFunction;
+	__u16 Flags;
+	__u16 ByteCount;
+	__u8 BufferFormat;	/* 4 = ASCII or Unicode */ 
+	unsigned char OldFileName[1];
+	/* followed by __u8 BufferFormat2 */
+	/* followed by NewFileName string */
+} COPY_REQ;
+
+typedef struct smb_com_copy_rsp {
+	struct smb_hdr hdr;     /* wct = 1 */
+	__u16 CopyCount;    /* number of files copied */
+	__u16 ByteCount;    /* may be zero */
+	__u8 BufferFormat;  /* 0x04 - only present if errored file follows */
+	unsigned char ErrorFileName[1]; /* only present if error in copy */
+} COPY_RSP;
+
 #define CREATE_HARD_LINK		0x103
 #define MOVEFILE_COPY_ALLOWED		0x0002
 #define MOVEFILE_REPLACE_EXISTING	0x0001
@@ -833,6 +862,10 @@ typedef struct smb_com_create_directory_rsp {
 	__u16 ByteCount;	/* bct = 0 */
 } CREATE_DIRECTORY_RSP;
 
+/***************************************************/
+/* NT Transact structure defintions follow         */
+/* Currently only ioctl and notify are implemented */
+/***************************************************/
 typedef struct smb_com_transaction_ioctl_req {
 	struct smb_hdr hdr;	/* wct = 23 */
 	__u8 MaxSetupCount;
@@ -875,29 +908,45 @@ typedef struct smb_com_transaction_ioctl_rsp {
 } TRANSACT_IOCTL_RSP;
 
 typedef struct smb_com_transaction_change_notify_req {
-        struct smb_hdr hdr;     /* wct = 23 */
-        __u8 MaxSetupCount;
-        __u16 Reserved;
-        __u32 TotalParameterCount;
-        __u32 TotalDataCount;
-        __u32 MaxParameterCount;
-        __u32 MaxDataCount;
-        __u32 ParameterCount;
-        __u32 ParameterOffset;
-        __u32 DataCount;
-        __u32 DataOffset;
-        __u8 SetupCount; /* four setup words follow subcommand */
-        /* SNIA spec incorrectly included spurious pad here */
-        __u16 SubCommand;/* 4 = Change Notify */
+	struct smb_hdr hdr;     /* wct = 23 */
+	__u8 MaxSetupCount;
+	__u16 Reserved;
+	__u32 TotalParameterCount;
+	__u32 TotalDataCount;
+	__u32 MaxParameterCount;
+	__u32 MaxDataCount;
+	__u32 ParameterCount;
+	__u32 ParameterOffset;
+	__u32 DataCount;
+	__u32 DataOffset;
+	__u8 SetupCount; /* four setup words follow subcommand */
+	/* SNIA spec incorrectly included spurious pad here */
+	__u16 SubCommand;/* 4 = Change Notify */
 	__u32 CompletionFilter;  /* operation to monitor */
 	__u16 Fid;
 	__u8 WatchTree;  /* 1 = Monitor subdirectories */
+	__u8 Reserved2;
 	__u16 ByteCount;
-	__u8 Pad[3];
-	__u8 Data[1];
+/* __u8 Pad[3];*/
+/*	__u8 Data[1];*/
 } TRANSACT_CHANGE_NOTIFY_REQ;
 
-/* Completion Filter flags */
+typedef struct smb_com_transaction_change_notify_rsp {
+	struct smb_hdr hdr;	/* wct = 18 */
+	__u8 Reserved[3];
+	__u32 TotalParameterCount;
+	__u32 TotalDataCount;
+	__u32 ParameterCount;
+	__u32 ParameterOffset;
+	__u32 ParameterDisplacement;
+	__u32 DataCount;
+	__u32 DataOffset;
+	__u32 DataDisplacement;
+	__u8 SetupCount;   /* 0 */
+	__u16 ByteCount;
+	/* __u8 Pad[3]; */
+} TRANSACT_CHANGE_NOTIFY_RSP;
+/* Completion Filter flags for Notify */
 #define FILE_NOTIFY_CHANGE_FILE_NAME    0x00000001
 #define FILE_NOTIFY_CHANGE_DIR_NAME     0x00000002
 #define FILE_NOTIFY_CHANGE_NAME         0x00000003
@@ -912,6 +961,15 @@ typedef struct smb_com_transaction_change_notify_req {
 #define FILE_NOTIFY_CHANGE_STREAM_SIZE  0x00000400
 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
 
+#define FILE_ACTION_ADDED		0x00000001
+#define FILE_ACTION_REMOVED		0x00000002
+#define FILE_ACTION_MODIFIED		0x00000003
+#define FILE_ACTION_RENAMED_OLD_NAME	0x00000004
+#define FILE_ACTION_RENAMED_NEW_NAME	0x00000005
+#define FILE_ACTION_ADDED_STREAM	0x00000006
+#define FILE_ACTION_REMOVED_STREAM	0x00000007
+#define FILE_ACTION_MODIFIED_STREAM	0x00000008
+
 /* response contains array of the following structures */
 struct file_notify_information {
 	__u32 NextEntryOffset;
@@ -988,9 +1046,12 @@ typedef union smb_com_transaction2 {
 
 /* PathInfo/FileInfo infolevels */
 #define SMB_INFO_STANDARD                   1
+#define SMB_INFO_QUERY_EAS_FROM_LIST        3
+#define SMB_INFO_QUERY_ALL_EAS              4
 #define SMB_INFO_IS_NAME_VALID              6
 #define SMB_QUERY_FILE_BASIC_INFO       0x101
 #define SMB_QUERY_FILE_STANDARD_INFO    0x102
+#define SMB_QUERY_FILE_EA_INFO          0x103
 #define SMB_QUERY_FILE_NAME_INFO        0x104
 #define SMB_QUERY_FILE_ALLOCATION_INFO  0x105
 #define SMB_QUERY_FILE_END_OF_FILEINFO  0x106
@@ -1010,8 +1071,13 @@ typedef union smb_com_transaction2 {
 #define SMB_SET_FILE_UNIX_HLINK         0x203
 #define SMB_SET_FILE_BASIC_INFO2        0x3ec
 #define SMB_SET_FILE_RENAME_INFORMATION 0x3f2
+#define SMB_FILE_ALL_INFO2              0x3fa
 #define SMB_SET_FILE_ALLOCATION_INFO2   0x3fb
 #define SMB_SET_FILE_END_OF_FILE_INFO2  0x3fc
+#define SMB_FILE_MOVE_CLUSTER_INFO      0x407
+#define SMB_FILE_QUOTA_INFO             0x408
+#define SMB_FILE_REPARSEPOINT_INFO      0x409
+#define SMB_FILE_MAXIMUM_INFO           0x40d
 
 /* Find File infolevels */
 #define SMB_FIND_FILE_DIRECTORY_INFO      0x101
@@ -1273,6 +1339,7 @@ typedef struct smb_com_transaction2_fnext_rsp_parms {
 	__u16 LastNameOffset;
 } T2_FNEXT_RSP_PARMS;
 
+/* QFSInfo Levels */
 #define SMB_INFO_ALLOCATION         1
 #define SMB_INFO_VOLUME             2
 #define SMB_QUERY_FS_VOLUME_INFO    0x102
@@ -1280,6 +1347,8 @@ typedef struct smb_com_transaction2_fnext_rsp_parms {
 #define SMB_QUERY_FS_DEVICE_INFO    0x104
 #define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
 #define SMB_QUERY_CIFS_UNIX_INFO    0x200
+#define SMB_QUERY_LABEL_INFO        0x3ea
+#define SMB_QUERY_FS_QUOTA_INFO     0x3ee
 
 typedef struct smb_com_transaction2_qfsi_req {
 	struct smb_hdr hdr;	/* wct = 14+ */
@@ -1621,16 +1690,17 @@ struct gealist {
 };
 
 struct fea {
-	unsigned char fEA;
-	unsigned char cbName;
-	unsigned short cbValue;
+	unsigned char EA_flags;
+	__u8 name_len;
+	__u16 value_len;
 	char szName[1];
+	/* optionally followed by value */
 };
 /* flags for _FEA.fEA */
 #define FEA_NEEDEA         0x80	/* need EA bit */
 
 struct fealist {
-	unsigned long cbList;
+	__u32 list_len;
 	struct fea list[1];
 };
 
@@ -1641,6 +1711,83 @@ struct data_blob {
 	void (*free) (struct data_blob * data_blob);
 };
 
+#ifdef CONFIG_CIFS_POSIX
+/* 
+	For better POSIX semantics from Linux client, (even better
+	than the existing CIFS Unix Extensions) we need updated PDUs for:
+	
+	1) PosixCreateX - to set and return the mode, inode#, device info and
+	perhaps add a CreateDevice - to create Pipes and other special .inodes
+	Also note POSIX open flags
+	2) Close - to return the last write time to do cache across close more safely
+	3) PosixQFSInfo - to return statfs info
+	4) FindFirst return unique inode number - what about resume key, two forms short (matches readdir) and full (enough info to cache inodes)
+	5) Mkdir - set mode
+	
+	And under consideration: 
+	6) FindClose2 (return nanosecond timestamp ??)
+	7) Use nanosecond timestamps throughout all time fields if 
+	   corresponding attribute flag is set
+	8) sendfile - handle based copy
+	9) Direct i/o
+	10) "POSIX ACL" support
+	11) Misc fcntls?
+	
+	what about fixing 64 bit alignment
+	
+	There are also various legacy SMB/CIFS requests used as is
+	
+	From existing Lanman and NTLM dialects:
+	--------------------------------------
+	NEGOTIATE
+	SESSION_SETUP_ANDX (BB which?)
+	TREE_CONNECT_ANDX (BB which wct?)
+	TREE_DISCONNECT (BB add volume timestamp on response)
+	LOGOFF_ANDX
+	DELETE (note delete open file behavior)
+	DELETE_DIRECTORY
+	READ_AND_X
+	WRITE_AND_X
+	LOCKING_AND_X (note posix lock semantics)
+	RENAME (note rename across dirs and open file rename posix behaviors)
+	NT_RENAME (for hardlinks) Is this good enough for all features?
+	FIND_CLOSE2
+	TRANSACTION2 (18 cases)
+		SMB_SET_FILE_END_OF_FILE_INFO2 SMB_SET_PATH_END_OF_FILE_INFO2
+		(BB verify that never need to set allocation size)
+		SMB_SET_FILE_BASIC_INFO2 (setting times - BB can it be done via Unix ext?)
+	
+	COPY (note support for copy across directories) - FUTURE, OPTIONAL
+	setting/getting OS/2 EAs - FUTURE (BB can this handle
+	        setting Linux xattrs perfectly)         - OPTIONAL
+    dnotify                                         - FUTURE, OPTIONAL
+    quota                                           - FUTURE, OPTIONAL
+			
+	Note that various requests implemented for NT interop such as 
+		NT_TRANSACT (IOCTL) QueryReparseInfo
+	are unneeded to servers compliant with the CIFS POSIX extensions
+	
+	From CIFS Unix Extensions:
+	-------------------------
+	T2 SET_PATH_INFO (SMB_SET_FILE_UNIX_LINK) for symlinks
+	T2 SET_PATH_INFO (SMB_SET_FILE_BASIC_INFO2)
+	T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_LINK)
+	T2 QUERY_PATH_INFO (SMB_QUERY_FILE_UNIX_BASIC) - BB check for missing inode fields
+					Actually need QUERY_FILE_UNIX_INFO since has inode num
+					BB what about a) blksize/blkbits/blocks
+								  b) i_version
+								  c) i_rdev
+								  d) notify mask?
+								  e) generation
+								  f) size_seqcount
+	T2 FIND_FIRST/FIND_NEXT FIND_FILE_UNIX
+	TRANS2_GET_DFS_REFERRAL				  - OPTIONAL but recommended
+	T2_QFS_INFO QueryDevice/AttributeInfo - OPTIONAL
+	
+	
+ */
+#endif 
+
 #pragma pack()			/* resume default structure packing */
 
 #endif				/* _CIFSPDU_H */
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index ec446c52e..cf99e22c6 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -239,8 +239,16 @@ extern int CIFSSMBSeek(int xid,
 			int whence, unsigned long offset, long long *newoffset);
 
 extern int CIFSSMBCopy(int xid,
-			struct cifsTconInfo *ftcon,
-			char *fromName,
-			struct cifsTconInfo *ttcon,
-			char *toName, int ofun, int flags);
+			struct cifsTconInfo *source_tcon,
+			const char *fromName,
+			const __u16 target_tid,
+			const char *toName, const int flags,
+			const struct nls_table *nls_codepage);
+extern int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, 
+			const int notify_subdirs,const __u16 netfid,__u32 filter,
+			const struct nls_table *nls_codepage);
+extern int CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
+		 const unsigned char *searchName,
+		 char * EAData, size_t size,
+		 const struct nls_table *nls_codepage);
 #endif			/* _CIFSPROTO_H */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index b4da800a5..420742abb 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -37,13 +37,24 @@
 #include "cifs_unicode.h"
 #include "cifs_debug.h"
 
+#ifdef CONFIG_CIFS_POSIX
 static struct {
 	int index;
 	char *name;
 } protocols[] = {
 	{CIFS_PROT, "\2NT LM 0.12"}, 
+	{CIFS_PROT, "\2POSIX 2"},
 	{BAD_PROT, "\2"}
 };
+#else
+static struct {
+	int index;
+	char *name;
+} protocols[] = {
+	{CIFS_PROT, "\2NT LM 0.12"}, 
+	{BAD_PROT, "\2"}
+};
+#endif
 
 
 /* Mark as invalid, all open files on tree connections since they
@@ -143,7 +154,8 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
 		return rc;
 
 	*request_buf = cifs_buf_get();
-	if (request_buf == 0) {
+	if (*request_buf == 0) {
+		/* BB should we add a retry in here if not a writepage? */
 		return -ENOMEM;
 	}
     /* Although the original thought was we needed the response buf for  */
@@ -154,6 +166,12 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
 
 	header_assemble((struct smb_hdr *) *request_buf, smb_command, tcon,
 			wct /*wct */ );
+
+#ifdef CONFIG_CIFS_STATS
+        if(tcon != NULL) {
+                atomic_inc(&tcon->num_smbs_sent);
+        }
+#endif
 	return rc;
 }
 
@@ -365,8 +383,11 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
 			 smb_buffer_response, &length, 0);
 	if (ses->server) {
 		atomic_dec(&ses->server->socketUseCount);
-		if (atomic_read(&ses->server->socketUseCount) == 0)
+		if (atomic_read(&ses->server->socketUseCount) == 0) {
+			spin_lock(&GlobalMid_Lock);
 			ses->server->tcpStatus = CifsExiting;
+			spin_unlock(&GlobalMid_Lock);
+		}
 	}
 	if (pSMB)
 		cifs_buf_release(pSMB);
@@ -418,7 +439,13 @@ DelFileRetry:
 			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
 	if (rc) {
 		cFYI(1, ("Error in RMFile = %d", rc));
-	}
+	} 
+#ifdef CONFIG_CIFS_STATS
+        else {
+		atomic_inc(&tcon->num_deletes);
+        }
+#endif
+
 	if (pSMB)
 		cifs_buf_release(pSMB);
 	if (rc == -EAGAIN)
@@ -465,6 +492,12 @@ RmDirRetry:
 	if (rc) {
 		cFYI(1, ("Error in RMDir = %d", rc));
 	}
+#ifdef CONFIG_CIFS_STATS
+        else {
+		atomic_inc(&tcon->num_rmdirs);
+        }
+#endif
+
 	if (pSMB)
 		cifs_buf_release(pSMB);
 	if (rc == -EAGAIN)
@@ -510,6 +543,11 @@ MkDirRetry:
 	if (rc) {
 		cFYI(1, ("Error in Mkdir = %d", rc));
 	}
+#ifdef CONFIG_CIFS_STATS
+        else {
+		atomic_inc(&tcon->num_mkdirs);
+        }
+#endif
 	if (pSMB)
 		cifs_buf_release(pSMB);
 	if (rc == -EAGAIN)
@@ -606,6 +644,10 @@ openRetry:
 		    pfile_info->EndOfFile = pSMBr->EndOfFile;
 		    pfile_info->NumberOfLinks = cpu_to_le32(1);
 		}
+
+#ifdef CONFIG_CIFS_STATS
+		atomic_inc(&tcon->num_opens);
+#endif
 	}
 	if (pSMB)
 		cifs_buf_release(pSMB);
@@ -728,7 +770,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
 	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
 			 (struct smb_hdr *) pSMBr, &bytes_returned, long_op);
 	if (rc) {
-		cERROR(1, ("Send error in write = %d", rc));
+		cFYI(1, ("Send error in write = %d", rc));
 		*nbytes = 0;
 	} else
 		*nbytes = le16_to_cpu(pSMBr->Count);
@@ -792,7 +834,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
 			 (struct smb_hdr *) pSMBr, &bytes_returned, timeout);
 
 	if (rc) {
-		cERROR(1, ("Send error in Lock = %d", rc));
+		cFYI(1, ("Send error in Lock = %d", rc));
 	}
 	if (pSMB)
 		cifs_buf_release(pSMB);
@@ -892,7 +934,6 @@ renameRetry:
 	}
 
 	pSMB->ByteCount = 1 /* 1st signature byte */  + name_len + name_len2;
-    /* we could also set search attributes but not needed */
 	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
 	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
 
@@ -986,6 +1027,76 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon,
 	return rc;
 }
 
+int
+CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char * fromName, 
+            const __u16 target_tid, const char *toName, const int flags,
+            const struct nls_table *nls_codepage)
+{
+	int rc = 0;
+	COPY_REQ *pSMB = NULL;
+	COPY_RSP *pSMBr = NULL;
+	int bytes_returned;
+	int name_len, name_len2;
+
+	cFYI(1, ("In CIFSSMBCopy"));
+copyRetry:
+	rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB,
+			(void **) &pSMBr);
+	if (rc)
+		return rc;
+
+	pSMB->BufferFormat = 0x04;
+	pSMB->Tid2 = target_tid;
+
+	if(flags & COPY_TREE)
+		pSMB->Flags |= COPY_TREE;
+	pSMB->Flags = cpu_to_le16(pSMB->Flags);
+
+	if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
+		name_len = cifs_strtoUCS((wchar_t *) pSMB->OldFileName, 
+				fromName, 
+				530 /* find define for this maxpathcomponent */,
+				nls_codepage);
+		name_len++;     /* trailing null */
+		name_len *= 2;
+		pSMB->OldFileName[name_len] = 0x04;     /* pad */
+		/* protocol requires ASCII signature byte on Unicode string */
+		pSMB->OldFileName[name_len + 1] = 0x00;
+		name_len2 = cifs_strtoUCS((wchar_t *) & pSMB->
+				OldFileName[name_len + 2], toName, 530,
+				nls_codepage);
+		name_len2 += 1 /* trailing null */  + 1 /* Signature word */ ;
+		name_len2 *= 2; /* convert to bytes */
+	} else {                /* BB improve the check for buffer overruns BB */
+		name_len = strnlen(fromName, 530);
+		name_len++;     /* trailing null */
+		strncpy(pSMB->OldFileName, fromName, name_len);
+		name_len2 = strnlen(toName, 530);
+		name_len2++;    /* trailing null */
+		pSMB->OldFileName[name_len] = 0x04;  /* 2nd buffer format */
+		strncpy(&pSMB->OldFileName[name_len + 1], toName, name_len2);
+		name_len2++;    /* trailing null */
+		name_len2++;    /* signature byte */
+	}
+
+	pSMB->ByteCount = 1 /* 1st signature byte */  + name_len + name_len2;
+	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
+	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
+
+	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
+		(struct smb_hdr *) pSMBr, &bytes_returned, 0);
+	if (rc) {
+		cFYI(1, ("Send error in copy = %d with %d files copied",
+			rc, pSMBr->CopyCount));
+	}
+	if (pSMB)
+		cifs_buf_release(pSMB);
+
+	if (rc == -EAGAIN)
+		goto copyRetry;
+
+	return rc;
+}
 
 int
 CIFSUnixCreateSymLink(const int xid, struct cifsTconInfo *tcon,
@@ -1356,9 +1467,9 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon,
 
 	pSMB->TotalParameterCount = 0 ;
 	pSMB->TotalDataCount = 0;
-	pSMB->MaxParameterCount = cpu_to_le16(2);
+	pSMB->MaxParameterCount = cpu_to_le32(2);
 	/* BB find exact data count max from sess structure BB */
-	pSMB->MaxDataCount = cpu_to_le16(4000);
+	pSMB->MaxDataCount = cpu_to_le32(4000);
 	pSMB->MaxSetupCount = 4;
 	pSMB->Reserved = 0;
 	pSMB->ParameterOffset = 0;
@@ -1485,6 +1596,8 @@ QPathInfoRetry:
 	} else {		/* decode response */
 		pSMBr->DataOffset = le16_to_cpu(pSMBr->DataOffset);
 		/* BB also check enough total bytes returned */
+		/* BB we need to improve the validity checking
+		of these trans2 responses */
 		if ((pSMBr->ByteCount < 40) || (pSMBr->DataOffset > 512)) 
 			rc = -EIO;	/* bad smb */
 		else if (pFindData){
@@ -2211,6 +2324,11 @@ QFSAttributeRetry:
 			    (FILE_SYSTEM_ATTRIBUTE_INFO
 			     *) (((char *) &pSMBr->hdr.Protocol) +
 				 pSMBr->DataOffset);
+			response_data->Attributes = le32_to_cpu(response_data->Attributes);
+			response_data->MaxPathNameComponentLength = 
+				le32_to_cpu(response_data->MaxPathNameComponentLength);
+			response_data->FileSystemNameLen = 
+				le32_to_cpu(response_data->FileSystemNameLen);
 			memcpy(&tcon->fsAttrInfo, response_data,
 			       sizeof (FILE_SYSTEM_ATTRIBUTE_INFO));
 		}
@@ -2280,6 +2398,10 @@ QFSDeviceRetry:
 			    (FILE_SYSTEM_DEVICE_INFO
 			     *) (((char *) &pSMBr->hdr.Protocol) +
 				 pSMBr->DataOffset);
+			response_data->DeviceType = 
+				le32_to_cpu(response_data->DeviceType);
+			response_data->DeviceCharacteristics = 
+				le32_to_cpu(response_data->DeviceCharacteristics);
 			memcpy(&tcon->fsDevInfo, response_data,
 			       sizeof (FILE_SYSTEM_DEVICE_INFO));
 		}
@@ -2290,7 +2412,6 @@ QFSDeviceRetry:
 	if (rc == -EAGAIN)
 		goto QFSDeviceRetry;
 
-
 	return rc;
 }
 
@@ -2348,6 +2469,12 @@ QFSUnixRetry:
 			    (FILE_SYSTEM_UNIX_INFO
 			     *) (((char *) &pSMBr->hdr.Protocol) +
 				 pSMBr->DataOffset);
+			response_data->MajorVersionNumber =
+				le16_to_cpu(response_data->MajorVersionNumber);
+			response_data->MinorVersionNumber =
+				le16_to_cpu(response_data->MinorVersionNumber);
+			response_data->Capability =
+				le64_to_cpu(response_data->Capability);
 			memcpy(&tcon->fsUnixInfo, response_data,
 			       sizeof (FILE_SYSTEM_UNIX_INFO));
 		}
@@ -2511,7 +2638,7 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
 		(struct file_end_of_file_info *) (((char *) &pSMB->hdr.Protocol) +
 			pSMB->DataOffset);
 	pSMB->DataOffset = cpu_to_le16(pSMB->DataOffset); /* now safe to change to le */
-	parm_data->FileSize = size;
+	parm_data->FileSize = cpu_to_le64(size);
 	pSMB->Fid = fid;
 	if(SetAllocation) {
 		if (tcon->ses->capabilities & CAP_INFOLEVEL_PASSTHRU)
@@ -2706,3 +2833,149 @@ setPermsRetry:
 		goto setPermsRetry;
 	return rc;
 }
+
+int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, 
+			const int notify_subdirs, const __u16 netfid,
+			__u32 filter, const struct nls_table *nls_codepage)
+{
+	int rc = 0;
+	struct smb_com_transaction_change_notify_req * pSMB = NULL;
+	struct smb_com_transaction_change_notify_rsp * pSMBr = NULL;
+	int bytes_returned;
+
+	cFYI(1, ("In CIFSSMBNotify for file handle %d",(int)netfid));
+	rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB,
+                      (void **) &pSMBr);
+	if (rc)
+		return rc;
+
+	pSMB->TotalParameterCount = 0 ;
+	pSMB->TotalDataCount = 0;
+	pSMB->MaxParameterCount = cpu_to_le32(2);
+	/* BB find exact data count max from sess structure BB */
+	pSMB->MaxDataCount = 0; /* same in little endian or be */
+	pSMB->MaxSetupCount = 4;
+	pSMB->Reserved = 0;
+	pSMB->ParameterOffset = 0;
+	pSMB->DataCount = 0;
+	pSMB->DataOffset = 0;
+	pSMB->SetupCount = 4; /* single byte does not need le conversion */
+	pSMB->SubCommand = cpu_to_le16(NT_TRANSACT_NOTIFY_CHANGE);
+	pSMB->ParameterCount = pSMB->TotalParameterCount;
+	if(notify_subdirs)
+		pSMB->WatchTree = 1; /* one byte - no le conversion needed */
+	pSMB->Reserved2 = 0;
+	pSMB->CompletionFilter = cpu_to_le32(filter);
+	pSMB->Fid = netfid; /* file handle always le */
+	pSMB->ByteCount = 0;
+
+	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
+	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
+			(struct smb_hdr *) pSMBr, &bytes_returned, 0);
+	if (rc) {
+		cFYI(1, ("Error in Notify = %d", rc));
+	}
+	if (pSMB)
+		cifs_buf_release(pSMB);
+/*		if (rc == -EAGAIN)
+			goto NotifyRetry; */
+	return rc;	
+}
+#ifdef CONFIG_CIFS_XATTR
+int
+CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
+		 const unsigned char *searchName,
+		 char * EAData, size_t size,
+		 const struct nls_table *nls_codepage)
+{
+		/* BB assumes one setup word */
+	TRANSACTION2_QPI_REQ *pSMB = NULL;
+	TRANSACTION2_QPI_RSP *pSMBr = NULL;
+	int rc = 0;
+	int bytes_returned;
+	int name_len;
+
+	cFYI(1, ("In Query All EAs path %s", searchName));
+QAllEAsRetry:
+	rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
+		      (void **) &pSMBr);
+	if (rc)
+		return rc;
+
+	if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
+		name_len =
+		    cifs_strtoUCS((wchar_t *) pSMB->FileName, searchName, 530
+				  /* find define for this maxpathcomponent */
+				  , nls_codepage);
+		name_len++;	/* trailing null */
+		name_len *= 2;
+	} else {		/* BB improve the check for buffer overruns BB */
+		name_len = strnlen(searchName, 530);
+		name_len++;	/* trailing null */
+		strncpy(pSMB->FileName, searchName, name_len);
+	}
+
+	pSMB->TotalParameterCount = 2 /* level */  + 4 /* reserved */  +
+	    name_len /* includes null */ ;
+	pSMB->TotalDataCount = 0;
+	pSMB->MaxParameterCount = cpu_to_le16(2);
+	pSMB->MaxDataCount = cpu_to_le16(4000);	/* BB find exact max SMB PDU from sess structure BB */
+	pSMB->MaxSetupCount = 0;
+	pSMB->Reserved = 0;
+	pSMB->Flags = 0;
+	pSMB->Timeout = 0;
+	pSMB->Reserved2 = 0;
+	pSMB->ParameterOffset = cpu_to_le16(offsetof(
+        struct smb_com_transaction2_qpi_req ,InformationLevel) - 4);
+	pSMB->DataCount = 0;
+	pSMB->DataOffset = 0;
+	pSMB->SetupCount = 1;
+	pSMB->Reserved3 = 0;
+	pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION);
+	pSMB->ByteCount = pSMB->TotalParameterCount + 1 /* pad */ ;
+	pSMB->TotalParameterCount = cpu_to_le16(pSMB->TotalParameterCount);
+	pSMB->ParameterCount = pSMB->TotalParameterCount;
+	pSMB->InformationLevel = cpu_to_le16(SMB_INFO_QUERY_ALL_EAS);
+	pSMB->Reserved4 = 0;
+	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
+	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
+
+	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
+			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+	if (rc) {
+		cFYI(1, ("Send error in QueryAllEAs = %d", rc));
+	} else {		/* decode response */
+		pSMBr->DataOffset = le16_to_cpu(pSMBr->DataOffset);
+		/* BB also check enough total bytes returned */
+		/* BB we need to improve the validity checking
+		of these trans2 responses */
+		if ((pSMBr->ByteCount < 4) || (pSMBr->DataOffset > 512)) 
+			rc = -EIO;	/* bad smb */
+	   /* else if (pFindData){
+			memcpy((char *) pFindData,
+			       (char *) &pSMBr->hdr.Protocol +
+			       pSMBr->DataOffset, kl);
+		}*/ else {
+			/* check that length of list is not more than bcc */
+			/* check that each entry does not go beyond length
+			   of list */
+			/* check that each element of each entry does not
+			   go beyond end of list */
+			struct fealist * ea_response_data;
+			rc = 0;
+			/* validate_trans2_offsets() */
+			/* BB to check if(start of smb + pSMBr->DataOffset > &bcc+ bcc)*/
+			ea_response_data = (struct fealist *)
+				(((char *) &pSMBr->hdr.Protocol) +
+				pSMBr->DataOffset);
+			cFYI(1,("ea length %d",ea_response_data->list_len));
+		}
+	}
+	if (pSMB)
+		cifs_buf_release(pSMB);
+	if (rc == -EAGAIN)
+		goto QAllEAsRetry;
+
+	return rc;
+}
+#endif
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b36e95ab4..befbff5d6 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -63,6 +63,7 @@ struct smb_vol {
 	mode_t dir_mode;
 	int rw:1;
 	int retry:1;
+	int intr:1;
 	unsigned int rsize;
 	unsigned int wsize;
 	unsigned int sockopt;
@@ -94,9 +95,15 @@ cifs_reconnect(struct TCP_Server_Info *server)
 	struct cifsTconInfo *tcon;
 	struct mid_q_entry * mid_entry;
 	
-	if(server->tcpStatus == CifsExiting)
+	spin_lock(&GlobalMid_Lock);
+	if(server->tcpStatus == CifsExiting) {
+		/* the demux thread will exit normally 
+		next time through the loop */
+		spin_unlock(&GlobalMid_Lock);
 		return rc;
-	server->tcpStatus = CifsNeedReconnect;
+	} else
+		server->tcpStatus = CifsNeedReconnect;
+	spin_unlock(&GlobalMid_Lock);
 	server->maxBuf = 0;
 
 	cFYI(1, ("Reconnecting tcp session "));
@@ -121,7 +128,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
 		}
 	}
 	read_unlock(&GlobalSMBSeslock);
-
+	/* do not want to be sending data on a socket we are freeing */
+	down(&server->tcpSem); 
 	if(server->ssocket) {
 		cFYI(1,("State: 0x%x Flags: 0x%lx", server->ssocket->state,
 			server->ssocket->flags));
@@ -147,7 +155,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
 		}
 	}
 	spin_unlock(&GlobalMid_Lock);
-
+	up(&server->tcpSem); 
 
 	while ((server->tcpStatus != CifsExiting) && (server->tcpStatus != CifsGood))
 	{
@@ -163,7 +171,11 @@ cifs_reconnect(struct TCP_Server_Info *server)
 			schedule_timeout(3 * HZ);
 		} else {
 			atomic_inc(&tcpSesReconnectCount);
-			server->tcpStatus = CifsGood;
+			spin_lock(&GlobalMid_Lock);
+			if(server->tcpStatus != CifsExiting)
+				server->tcpStatus = CifsGood;
+			spin_unlock(&GlobalMid_Lock);
+			atomic_set(&server->inFlight,0);
 			wake_up(&server->response_q);
 		}
 	}
@@ -241,12 +253,14 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 				/* some servers kill tcp session rather than returning
 					smb negprot error in which case reconnecting here is
 					not going to help - return error to mount */
+				spin_lock(&GlobalMid_Lock);
 				server->tcpStatus = CifsExiting;
+				spin_unlock(&GlobalMid_Lock);
 				wake_up(&server->response_q);
 				break;
 			}
 
-			cFYI(1,("Reconnecting after unexpected rcvmsg error "));
+			cFYI(1,("Reconnecting after unexpected peek error %d",length));
 			cifs_reconnect(server);
 			csocket = server->ssocket;
 			wake_up(&server->response_q);
@@ -266,7 +280,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 				length = sock_recvmsg(csocket, &smb_msg, 4, 0);
 				cFYI(0,("Received 4 byte keep alive packet"));
 			} else if (temp[0] == (char) RFC1002_POSITIVE_SESSION_RESPONSE) {
-				iov.iov_base = smb_buffer;
+					iov.iov_base = smb_buffer;
 					iov.iov_len = 4;
 					length = sock_recvmsg(csocket, &smb_msg, 4, 0);
 					cFYI(1,("Good RFC 1002 session rsp"));
@@ -278,7 +292,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 					/* if nack on negprot (rather than 
 					ret of smb negprot error) reconnecting
 					not going to help, ret error to mount */
+					spin_lock(&GlobalMid_Lock);
 					server->tcpStatus = CifsExiting;
+					spin_unlock(&GlobalMid_Lock);
 					/* wake up thread doing negprot */
 					wake_up(&server->response_q);
 					break;
@@ -389,8 +405,16 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 			}
 		}
 	}
-   
+	spin_lock(&GlobalMid_Lock);
 	server->tcpStatus = CifsExiting;
+	spin_unlock(&GlobalMid_Lock);
+	atomic_set(&server->inFlight, 0);
+	/* Although there should not be any requests blocked on 
+	this queue it can not hurt to be paranoid and try to wake up requests
+	that may haven been blocked when more than 50 at time were on the wire 
+	to the same server - they now will see the session is in exit state
+	and get out of SendReceive.  */
+	wake_up_all(&server->request_q);   
 	server->tsk = NULL;
 	if(server->ssocket) {
 		sock_release(csocket);
@@ -587,6 +611,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
 			}
 			if ((temp_len = strnlen(value, 300)) < 300) {
 				vol->UNC = kmalloc(temp_len+1,GFP_KERNEL);
+				if(vol->UNC == NULL)
+					return 1;
 				strcpy(vol->UNC,value);
 				if (strncmp(vol->UNC, "//", 2) == 0) {
 					vol->UNC[0] = '\\';
@@ -699,6 +725,7 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
 				   (strnicmp(data, "exec", 4) == 0) ||
 				   (strnicmp(data, "noexec", 6) == 0) ||
 				   (strnicmp(data, "nodev", 5) == 0) ||
+				   (strnicmp(data, "noauto", 6) == 0) ||
 				   (strnicmp(data, "dev", 3) == 0)) {
 			/*  The mount tool or mount.cifs helper (if present)
 				uses these opts to set flags, and the flags are read
@@ -717,6 +744,12 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
 			vol->retry = 0;
 		} else if (strnicmp(data, "nosoft", 6) == 0) {
 			vol->retry = 1;
+		} else if (strnicmp(data, "nointr", 6) == 0) {
+			vol->intr = 0;
+		} else if (strnicmp(data, "intr", 4) == 0) {
+			vol->intr = 1;
+		} else if (strnicmp(data, "noac", 4) == 0) {
+			printk(KERN_WARNING "CIFS: Mount option noac not supported. Instead set /proc/fs/cifs/LookupCacheEnabled to 0\n");
 		} else
 			printk(KERN_WARNING "CIFS: Unknown mount option %s\n",data);
 	}
@@ -727,6 +760,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
 		}
 		if ((temp_len = strnlen(devname, 300)) < 300) {
 			vol->UNC = kmalloc(temp_len+1,GFP_KERNEL);
+			if(vol->UNC == NULL)
+				return 1;
 			strcpy(vol->UNC,devname);
 			if (strncmp(vol->UNC, "//", 2) == 0) {
 				vol->UNC[0] = '\\';
@@ -908,7 +943,7 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket,
 		} else {
 		/* BB other socket options to set KEEPALIVE, NODELAY? */
 			cFYI(1,("Socket created"));
-	/*		(*csocket)->sk->allocation = GFP_NOFS; */ /* BB is there equivalent in 2.6 */
+			(*csocket)->sk->sk_allocation = GFP_NOFS; 
 		}
 	}
 
@@ -1015,6 +1050,7 @@ ipv6_connect(struct sockaddr_in6 *psin_server, struct socket **csocket)
 		} else {
 		/* BB other socket options to set KEEPALIVE, NODELAY? */
 			 cFYI(1,("ipv6 Socket created"));
+			(*csocket)->sk->sk_allocation = GFP_NOFS;
 		}
 	}
 
@@ -1202,12 +1238,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 			return rc;
 		} else {
 			memset(srvTcp, 0, sizeof (struct TCP_Server_Info));
-			memcpy(&srvTcp->addr.sockAddr, &sin_server, sizeof (struct sockaddr_in));	
-            /* BB Add code for ipv6 case too */
+			memcpy(&srvTcp->addr.sockAddr, &sin_server, sizeof (struct sockaddr_in));
+			atomic_set(&srvTcp->inFlight,0);
+			/* BB Add code for ipv6 case too */
 			srvTcp->ssocket = csocket;
 			srvTcp->protocolType = IPV4;
 			init_waitqueue_head(&srvTcp->response_q);
+			init_waitqueue_head(&srvTcp->request_q);
 			INIT_LIST_HEAD(&srvTcp->pending_mid_q);
+			/* at this point we are the only ones with the pointer
+			to the struct since the kernel thread not created yet
+			so no need to spinlock this init of tcpStatus */
 			srvTcp->tcpStatus = CifsNew;
 			init_MUTEX(&srvTcp->tcpSem);
 			kernel_thread((void *)(void *)cifs_demultiplex_thread, srvTcp,
@@ -1324,9 +1365,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 
 /* on error free sesinfo and tcon struct if needed */
 	if (rc) {
-		if(atomic_read(&srvTcp->socketUseCount) == 0)
-                	srvTcp->tcpStatus = CifsExiting;
-		           /* If find_unc succeeded then rc == 0 so we can not end */
+		if(atomic_read(&srvTcp->socketUseCount) == 0) {
+			spin_lock(&GlobalMid_Lock);
+			srvTcp->tcpStatus = CifsExiting;
+			spin_unlock(&GlobalMid_Lock);
+		}
+		 /* If find_unc succeeded then rc == 0 so we can not end */
 		if (tcon)  /* up here accidently freeing someone elses tcon struct */
 			tconInfoFree(tcon);
 		if (existingCifsSes == 0) {
@@ -1516,7 +1560,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 					bcc_ptr +=
 					    pSMBr->resp.SecurityBlobLength;
 
-				if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
+				if (smb_buffer->Flags2 & SMBFLG2_UNICODE) {
 					if ((long) (bcc_ptr) % 2) {
 						remaining_words =
 						    (BCC(smb_buffer_response)
@@ -1769,7 +1813,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 					      pSMBr->resp.SecurityBlobLength));
 				}
 
-				if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
+				if (smb_buffer->Flags2 & SMBFLG2_UNICODE) {
 					if ((long) (bcc_ptr) % 2) {
 						remaining_words =
 						    (BCC(smb_buffer_response)
@@ -2080,7 +2124,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
 						ses->server->secMode |= 
 							SECMODE_SIGN_ENABLED;
 
-				if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
+				if (smb_buffer->Flags2 & SMBFLG2_UNICODE) {
 					if ((long) (bcc_ptr) % 2) {
 						remaining_words =
 						    (BCC(smb_buffer_response)
@@ -2476,7 +2520,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 				cFYI(1,
 				     ("NTLMSSP response to Authenticate "));
 
-				if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
+				if (smb_buffer->Flags2 & SMBFLG2_UNICODE) {
 					if ((long) (bcc_ptr) % 2) {
 						remaining_words =
 						    (BCC(smb_buffer_response)
@@ -2675,7 +2719,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
         /* skip service field (NB: this field is always ASCII) */
 		bcc_ptr += length + 1;	
 		strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
-		if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
+		if (smb_buffer->Flags2 & SMBFLG2_UNICODE) {
 			length = UniStrnlen((wchar_t *) bcc_ptr, 512);
 			if (((long) bcc_ptr + (2 * length)) -
 			    (long) pByteArea(smb_buffer_response) <=
@@ -2743,6 +2787,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
 				FreeXid(xid);
 				return 0;
 			}
+ 
 			set_current_state(TASK_INTERRUPTIBLE);
 			schedule_timeout(HZ / 4);	/* give captive thread time to exit */
 			if((ses->server) && (ses->server->ssocket)) {            
@@ -2772,7 +2817,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
 	char ntlm_session_key[CIFS_SESSION_KEY_SIZE];
 	int ntlmv2_flag = FALSE;
 
-    /* what if server changes its buffer size after dropping the session? */
+	/* what if server changes its buffer size after dropping the session? */
 	if(pSesInfo->server->maxBuf == 0) /* no need to send on reconnect */ {
 		rc = CIFSSMBNegotiate(xid, pSesInfo);
 		if(rc == -EAGAIN) /* retry only once on 1st time connection */ {
@@ -2780,8 +2825,15 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
 			if(rc == -EAGAIN) 
 				rc = -EHOSTDOWN;
 		}
-		if(rc == 0)
-			pSesInfo->server->tcpStatus = CifsGood;
+		if(rc == 0) {
+			spin_lock(&GlobalMid_Lock);
+			if(pSesInfo->server->tcpStatus != CifsExiting)
+				pSesInfo->server->tcpStatus = CifsGood;
+			else
+				rc = -EHOSTDOWN;
+			spin_unlock(&GlobalMid_Lock);
+
+		}
 	}
 	if (!rc) {
 		pSesInfo->capabilities = pSesInfo->server->capabilities;
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 75ae88991..85cccbb05 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -38,7 +38,7 @@ renew_parental_timestamps(struct dentry *direntry)
 	do {
 		direntry->d_time = jiffies;
 		direntry = direntry->d_parent;
-	} while (!IS_ROOT(direntry));	/* BB for DFS case should stop at the root of share which could be lower than root of this mount due to implicit dfs connections */
+	} while (!IS_ROOT(direntry));	
 }
 
 /* Note: caller must free return buffer */
@@ -49,14 +49,26 @@ build_path_from_dentry(struct dentry *direntry)
 	int namelen = 0;
 	char *full_path;
 
+	if(direntry == NULL)
+		return NULL;  /* not much we can do if dentry is freed and
+		we need to reopen the file after it was closed implicitly
+		when the server crashed */
+
+cifs_bp_rename_retry:
 	for (temp = direntry; !IS_ROOT(temp);) {
 		namelen += (1 + temp->d_name.len);
 		temp = temp->d_parent;
+		if(temp == NULL) {
+			cERROR(1,("corrupt dentry"));
+			return NULL;
+		}
 	}
-	namelen += 1;		/* allow for trailing null */
-	full_path = kmalloc(namelen, GFP_KERNEL);
-	namelen--;
+
+	full_path = kmalloc(namelen+1, GFP_KERNEL);
+	if(full_path == NULL)
+		return full_path;
 	full_path[namelen] = 0;	/* trailing null */
+
 	for (temp = direntry; !IS_ROOT(temp);) {
 		namelen -= 1 + temp->d_name.len;
 		if (namelen < 0) {
@@ -68,11 +80,23 @@ build_path_from_dentry(struct dentry *direntry)
 			cFYI(0, (" name: %s ", full_path + namelen));
 		}
 		temp = temp->d_parent;
+		if(temp == NULL) {
+			cERROR(1,("corrupt dentry"));
+			kfree(full_path);
+			return NULL;
+		}
 	}
-	if (namelen != 0)
+	if (namelen != 0) {
 		cERROR(1,
 		       ("We did not end path lookup where we expected namelen is %d",
 			namelen));
+		/* presumably this is only possible if we were racing with a rename 
+		of one of the parent directories  (we can not lock the dentries
+		above us to prevent this, but retrying should be harmless) */
+		kfree(full_path);
+		namelen = 0;
+		goto cifs_bp_rename_retry;
+	}
 
 	return full_path;
 }
@@ -135,22 +159,28 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
 	struct cifsFileInfo * pCifsFile = NULL;
 	struct cifsInodeInfo * pCifsInode;
 	int disposition = FILE_OVERWRITE_IF;
+	int write_only = FALSE;
 
 	xid = GetXid();
 
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	down(&direntry->d_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
+	up(&direntry->d_sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 
-	if(nd) { 
-		cFYI(1,("In create for inode %p dentry->inode %p nd flags = 0x%x for %s",inode, direntry->d_inode, nd->flags,full_path));
-
+	if(nd) {
 		if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY)
 			desiredAccess = GENERIC_READ;
-		else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY)
+		else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY) {
 			desiredAccess = GENERIC_WRITE;
-		else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
+			write_only = TRUE;
+		} else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR) {
 			/* GENERIC_ALL is too much permission to request */
 			/* can cause unnecessary access denied on create */
 			/* desiredAccess = GENERIC_ALL; */
@@ -173,6 +203,12 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
 		oplock = REQ_OPLOCK;
 
 	buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
+	if(buf == NULL) {
+		kfree(full_path);
+		FreeXid(xid);
+		return -ENOMEM;
+	}
+
 	rc = CIFSSMBOpen(xid, pTcon, full_path, disposition,
 			 desiredAccess, CREATE_NOT_DIR,
 			 &fileHandle, &oplock, buf, cifs_sb->local_nls);
@@ -228,16 +264,25 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
 				pCifsFile->invalidHandle = FALSE;
 				pCifsFile->closePend     = FALSE;
 				init_MUTEX(&pCifsFile->fh_sem);
-				/* pCifsFile->pfile = file; */ /* put in at open time */
+				/* put the following in at open now */
+				/* pCifsFile->pfile = file; */ 
 				write_lock(&GlobalSMBSeslock);
 				list_add(&pCifsFile->tlist,&pTcon->openFileList);
 				pCifsInode = CIFS_I(newinode);
 				if(pCifsInode) {
-					list_add(&pCifsFile->flist,&pCifsInode->openFileList);
+				/* if readable file instance put first in list*/
+					if (write_only == TRUE) {
+                                        	list_add_tail(&pCifsFile->flist,
+							&pCifsInode->openFileList);
+					} else {
+						list_add(&pCifsFile->flist,
+							&pCifsInode->openFileList);
+					}
 					if((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
 						pCifsInode->clientCanCacheAll = TRUE;
 						pCifsInode->clientCanCacheRead = TRUE;
-						cFYI(1,("Exclusive Oplock granted on inode %p",newinode));
+						cFYI(1,("Exclusive Oplock granted on inode %p",
+							newinode));
 					} else if((oplock & 0xF) == OPLOCK_READ)
 						pCifsInode->clientCanCacheRead = TRUE;
 				}
@@ -272,9 +317,13 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	down(&direntry->d_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
-
-	if (pTcon->ses->capabilities & CAP_UNIX) {
+	up(&direntry->d_sb->s_vfs_rename_sem);
+	if(full_path == NULL)
+		rc = -ENOMEM;
+	
+	if (full_path && (pTcon->ses->capabilities & CAP_UNIX)) {
 		rc = CIFSSMBUnixSetPerms(xid, pTcon,
 			full_path, mode, current->euid, current->egid,
 			device_number, cifs_sb->local_nls);
@@ -298,7 +347,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
 struct dentry *
 cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct nameidata *nd)
 {
-	int rc, xid;
+	int xid;
+	int rc = 0; /* to get around spurious gcc warning, set to zero here */
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
 	struct inode *newInode = NULL;
@@ -320,7 +370,15 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
 	cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	/* can not grab the rename sem here since it would
+	deadlock in the cases (beginning of sys_rename itself)
+	in which we already have the sb rename sem */
 	full_path = build_path_from_dentry(direntry);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return ERR_PTR(-ENOMEM);
+	}
+
 	if (direntry->d_inode != NULL) {
 		cFYI(1, (" non-NULL inode in lookup"));
 	} else {
@@ -347,10 +405,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
 		rc = 0;
 		d_add(direntry, NULL);
 	} else {
-		cERROR(1,
-		       ("Error 0x%x or (%d decimal) on cifs_get_inode_info in lookup",
-			rc, rc));
-		/* BB special case check for Access Denied - watch security exposure of returning dir info implicitly via different rc if file exists or not but no access BB */
+		cERROR(1,("Error 0x%x or on cifs_get_inode_info in lookup",rc));
+		/* BB special case check for Access Denied - watch security 
+		exposure of returning dir info implicitly via different rc 
+		if file exists or not but no access BB */
 	}
 
 	if (full_path)
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c
index 4403fc378..1469a406f 100644
--- a/fs/cifs/fcntl.c
+++ b/fs/cifs/fcntl.c
@@ -32,16 +32,41 @@ int cifs_directory_notify(unsigned long arg, struct file * file)
 {
 	int xid;
 	int rc = -EINVAL;
+	int oplock = FALSE;
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
 	char *full_path = NULL;
+	__u32 filter = FILE_NOTIFY_CHANGE_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES;
+    __u16 netfid;
 
 	xid = GetXid();
 	cifs_sb = CIFS_SB(file->f_dentry->d_sb);
 	pTcon = cifs_sb->tcon;
+
+	down(&file->f_dentry->d_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(file->f_dentry);
-	cFYI(1,("cifs dir notify on file %s",full_path));
-	/* CIFSSMBNotify */
+	up(&file->f_dentry->d_sb->s_vfs_rename_sem);
+
+	if(full_path == NULL) {
+		rc = -ENOMEM;
+	} else {
+		cFYI(1,("cifs dir notify on file %s",full_path));
+		rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, 
+			GENERIC_READ | SYNCHRONIZE, 0 /* create options */,
+			&netfid, &oplock,NULL, cifs_sb->local_nls);
+		/* BB fixme - add this handle to a notify handle list */
+		if(rc) {
+			cFYI(1,("Could not open directory for notify"));
+		} else {
+			rc = CIFSSMBNotify(xid, pTcon, 1 /* subdirs */, netfid, 
+				filter, cifs_sb->local_nls);
+			/* BB add code to close file eventually (at unmount
+			it would close automatically but may be a way
+			to do it easily when inode freed or when
+			notify info is cleared/changed */
+		}
+	}
+	
 	FreeXid(xid);
 	return rc;
 }
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 8068c61d9..7d0ac5104 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -80,7 +80,13 @@ cifs_open(struct inode *inode, struct file *file)
 		}
 	}
 
+	down(&inode->i_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(file->f_dentry);
+	up(&inode->i_sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 
 	cFYI(1, (" inode = 0x%p file flags are 0x%x for %s", inode, file->f_flags,full_path));
 	if ((file->f_flags & O_ACCMODE) == O_RDONLY)
@@ -137,6 +143,10 @@ cifs_open(struct inode *inode, struct file *file)
 	/* Also refresh inode by passing in file_info buf returned by SMBOpen 
 	   and calling get_inode_info with returned buf (at least 
 	   helps non-Unix server case */
+
+	/* BB we can not do this if this is the second open of a file 
+	and the first handle has writebehind data, we might be 
+	able to simply do a filemap_fdatawrite/filemap_fdatawait first */
 	buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
 	if(buf==0) {
 		if (full_path)
@@ -150,8 +160,6 @@ cifs_open(struct inode *inode, struct file *file)
 		cFYI(1, ("cifs_open returned 0x%x ", rc));
 		cFYI(1, ("oplock: %d ", oplock));	
 	} else {
-		if(file->private_data)
-			kfree(file->private_data);
 		file->private_data =
 			kmalloc(sizeof (struct cifsFileInfo), GFP_KERNEL);
 		if (file->private_data) {
@@ -169,7 +177,14 @@ cifs_open(struct inode *inode, struct file *file)
 			list_add(&pCifsFile->tlist,&pTcon->openFileList);
 			pCifsInode = CIFS_I(file->f_dentry->d_inode);
 			if(pCifsInode) {
-				list_add(&pCifsFile->flist,&pCifsInode->openFileList);
+				/* want handles we can use to read with first */
+				/* in the list so we do not have to walk the */
+				/* list to search for one in prepare_write */
+				if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
+					list_add_tail(&pCifsFile->flist,&pCifsInode->openFileList);
+				} else {
+					list_add(&pCifsFile->flist,&pCifsInode->openFileList);
+				}
 				write_unlock(&GlobalSMBSeslock);
 				write_unlock(&file->f_owner.lock);
 				if(pCifsInode->clientCanCacheRead) {
@@ -252,7 +267,7 @@ static int cifs_relock_file(struct cifsFileInfo * cifsFile)
 	return rc;
 }
 
-static int cifs_reopen_file(struct inode *inode, struct file *file)
+static int cifs_reopen_file(struct inode *inode, struct file *file, int can_flush)
 {
 	int rc = -EACCES;
 	int xid, oplock;
@@ -264,7 +279,6 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
 	int desiredAccess = 0x20197;
 	int disposition = FILE_OPEN;
 	__u16 netfid;
-	FILE_ALL_INFO * buf = NULL;
 
 	if(inode == NULL)
 		return -EBADF;
@@ -281,11 +295,24 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
 		return 0;
 	}
 
-
+	if(file->f_dentry == NULL) {
+		up(&pCifsFile->fh_sem);
+		cFYI(1,("failed file reopen, no valid name if dentry freed"));
+		FreeXid(xid);
+		return -EBADF;
+	}
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
-
+/* can not grab rename sem here because various ops, including
+those that already have the rename sem can end up causing writepage
+to get called and if the server was down that means we end up here,
+and we can never tell if the caller already has the rename_sem */
 	full_path = build_path_from_dentry(file->f_dentry);
+	if(full_path == NULL) {
+		up(&pCifsFile->fh_sem);
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 
 	cFYI(1, (" inode = 0x%p file flags are 0x%x for %s", inode, file->f_flags,full_path));
 	if ((file->f_flags & O_ACCMODE) == O_RDONLY)
@@ -304,21 +331,23 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
 	else
 		oplock = FALSE;
 
-		/* BB pass O_SYNC flag through on file attributes .. BB */
+	
+	/* Can not refresh inode by passing in file_info buf to be returned
+	 by SMBOpen and then calling get_inode_info with returned buf 
+	 since file might have write behind data that needs to be flushed 
+	 and server version of file size can be stale. If we 
+	 knew for sure that inode was not dirty locally we could do this */
 
-		/* Also refresh inode by passing in file_info buf returned by SMBOpen
-		   and calling get_inode_info with returned buf (at least
-		   helps non-Unix server case */
-	buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
+/*	buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
 	if(buf==0) {
 		up(&pCifsFile->fh_sem);
 		if (full_path)
 			kfree(full_path);
 		FreeXid(xid);
 		return -ENOMEM;
-	}
+	}*/
 	rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, desiredAccess,
-				CREATE_NOT_DIR, &netfid, &oplock, buf, cifs_sb->local_nls);
+				CREATE_NOT_DIR, &netfid, &oplock, NULL, cifs_sb->local_nls);
 	if (rc) {
 		up(&pCifsFile->fh_sem);
 		cFYI(1, ("cifs_open returned 0x%x ", rc));
@@ -329,13 +358,25 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
 		up(&pCifsFile->fh_sem);
 		pCifsInode = CIFS_I(inode);
 		if(pCifsInode) {
-			if (pTcon->ses->capabilities & CAP_UNIX)
-				rc = cifs_get_inode_info_unix(&inode,
+			if(can_flush) {
+				filemap_fdatawrite(inode->i_mapping);
+				filemap_fdatawait(inode->i_mapping);
+			/* temporarily disable caching while we
+			go to server to get inode info */
+				pCifsInode->clientCanCacheAll = FALSE;
+				pCifsInode->clientCanCacheRead = FALSE;
+				if (pTcon->ses->capabilities & CAP_UNIX)
+					rc = cifs_get_inode_info_unix(&inode,
 						full_path, inode->i_sb);
-			else
-				rc = cifs_get_inode_info(&inode,
-						full_path, buf, inode->i_sb);
-
+				else
+					rc = cifs_get_inode_info(&inode,
+						full_path, NULL, inode->i_sb);
+			} /* else we are writing out data to server already
+			and could deadlock if we tried to flush data, and 
+			since we do not know if we have data that would
+			invalidate the current end of file on the server
+			we can not go to the server to get the new
+			inod info */
 			if((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
 				pCifsInode->clientCanCacheAll =  TRUE;
 				pCifsInode->clientCanCacheRead = TRUE;
@@ -351,8 +392,6 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
 		}
 	}
 
-	if (buf)
-		kfree(buf);
 	if (full_path)
 		kfree(full_path);
 	FreeXid(xid);
@@ -546,6 +585,9 @@ cifs_write(struct file * file, const char *write_data,
 	int xid, long_op;
 	struct cifsFileInfo * open_file;
 
+	if(file->f_dentry == NULL)
+		return -EBADF;
+
 	xid = GetXid();
 
 	cifs_sb = CIFS_SB(file->f_dentry->d_sb);
@@ -585,7 +627,11 @@ cifs_write(struct file * file, const char *write_data,
 					FreeXid(xid);
 					return total_written;
 				}
-				rc = cifs_reopen_file(file->f_dentry->d_inode,file);
+				/* we could deadlock if we called
+				 filemap_fdatawait from here so tell
+				reopen_file not to flush data to server now */
+				rc = cifs_reopen_file(file->f_dentry->d_inode,
+					file,FALSE);
 				if(rc != 0)
 					break;
 			}
@@ -608,12 +654,21 @@ cifs_write(struct file * file, const char *write_data,
 		long_op = FALSE; /* subsequent writes fast - 15 seconds is plenty */
 	}
 
+#ifdef CONFIG_CIFS_STATS
+	if(total_written > 0) {
+		atomic_inc(&pTcon->num_writes);
+		spin_lock(&pTcon->stat_lock);
+		pTcon->bytes_written += total_written;
+		spin_unlock(&pTcon->stat_lock);
+	}
+#endif		
+
 	/* since the write may have blocked check these pointers again */
 	if(file->f_dentry) {
 		if(file->f_dentry->d_inode) {
 			file->f_dentry->d_inode->i_ctime = file->f_dentry->d_inode->i_mtime =
 				CURRENT_TIME;
-			if (bytes_written > 0) {
+			if (total_written > 0) {
 				if (*poffset > file->f_dentry->d_inode->i_size)
 					i_size_write(file->f_dentry->d_inode, *poffset);
 			}
@@ -634,26 +689,22 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
 	int bytes_written = 0;
 	struct cifs_sb_info *cifs_sb;
 	struct cifsTconInfo *pTcon;
-	struct inode *inode = page->mapping->host;
+	struct inode *inode;
 	struct cifsInodeInfo *cifsInode;
 	struct cifsFileInfo *open_file = NULL;
 	struct list_head *tmp;
 	struct list_head *tmp1;
 
-	cifs_sb = CIFS_SB(inode->i_sb);
-	pTcon = cifs_sb->tcon;
-
-	/* figure out which file struct to use 
-	if (file->private_data == NULL) {
-		return -EBADF;
-	}     
-	 */
 	if (!mapping) {
 		return -EFAULT;
 	} else if(!mapping->host) {
 		return -EFAULT;
 	}
 
+	inode = page->mapping->host;
+	cifs_sb = CIFS_SB(inode->i_sb);
+	pTcon = cifs_sb->tcon;
+
 	offset += (loff_t)from;
 	write_data = kmap(page);
 	write_data += from;
@@ -676,8 +727,11 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
 
 	cifsInode = CIFS_I(mapping->host);
 	read_lock(&GlobalSMBSeslock); 
+	/* BB we should start at the end */
 	list_for_each_safe(tmp, tmp1, &cifsInode->openFileList) {            
 		open_file = list_entry(tmp,struct cifsFileInfo, flist);
+		if(open_file->closePend)
+			continue;
 		/* We check if file is open for writing first */
 		if((open_file->pfile) && 
 		   ((open_file->pfile->f_flags & O_RDWR) || 
@@ -691,7 +745,15 @@ cifs_partialpagewrite(struct page *page,unsigned from, unsigned to)
 			if ((bytes_written > 0) && (offset)) {
 				rc = 0;
 			} else if(bytes_written < 0) {
-				rc = bytes_written;
+				if(rc == -EBADF) {
+				/* have seen a case in which
+				kernel seemed to have closed/freed a file
+				even with writes active so we might as well
+				see if there are other file structs to try
+				for the same inode before giving up */
+					continue;
+				} else
+					rc = bytes_written;
 			}
 			break;  /* now that we found a valid file handle
 				and tried to write to it we are done, no
@@ -735,6 +797,9 @@ cifs_writepage(struct page* page, struct writeback_control *wbc)
 	xid = GetXid();
 /* BB add check for wbc flags */
 	page_cache_get(page);
+        if (!PageUptodate(page)) {
+		cFYI(1,("ppw - page not up to date"));
+	}
 	
 	rc = cifs_partialpagewrite(page,0,PAGE_CACHE_SIZE);
 	SetPageUptodate(page); /* BB add check for error and Clearuptodate? */
@@ -752,8 +817,7 @@ cifs_commit_write(struct file *file, struct page *page, unsigned offset,
 	int rc = 0;
 	struct inode *inode = page->mapping->host;
 	loff_t position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
-	/* struct cifsFileInfo *open_file;
-	struct cifs_sb_info *cifs_sb; */
+	char * page_data;
 
 	xid = GetXid();
 	cFYI(1,("commit write for page %p up to position %lld for %d",page,position,to));
@@ -784,7 +848,31 @@ cifs_commit_write(struct file *file, struct page *page, unsigned offset,
 			cFYI(1,(" SetEOF (commit write) rc = %d",rc));
 		}*/
 	}
-	set_page_dirty(page);
+	if (!PageUptodate(page)) {
+		position =  ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset;
+		/* can not rely on (or let) writepage write this data */
+		if(to < offset) {
+			cFYI(1,("Illegal offsets, can not copy from %d to %d",
+				offset,to));
+			FreeXid(xid);
+			return rc;
+		}
+		/* this is probably better than directly calling 
+		partialpage_write since in this function
+		the file handle is known which we might as well
+		leverage */
+		/* BB check if anything else missing out of ppw */
+		/* such as updating last write time */
+		page_data = kmap(page);
+		rc = cifs_write(file, page_data+offset,to-offset,
+                                        &position);
+		if(rc > 0)
+			rc = 0;
+		/* else if rc < 0 should we set writebehind rc? */
+		kunmap(page);
+	} else {	
+		set_page_dirty(page);
+	}
 
 	FreeXid(xid);
 	return rc;
@@ -889,13 +977,18 @@ cifs_read(struct file * file, char *read_data, size_t read_size,
 	}
 	open_file = (struct cifsFileInfo *)file->private_data;
 
+	if((file->f_flags & O_ACCMODE) == O_WRONLY) {
+		cFYI(1,("attempting read on write only file instance"));
+	}
+
 	for (total_read = 0,current_offset=read_data; read_size > total_read;
 				total_read += bytes_read,current_offset+=bytes_read) {
 		current_read_size = min_t(const int,read_size - total_read,cifs_sb->rsize);
 		rc = -EAGAIN;
 		while(rc == -EAGAIN) {
 			if ((open_file->invalidHandle) && (!open_file->closePend)) {
-				rc = cifs_reopen_file(file->f_dentry->d_inode,file);
+				rc = cifs_reopen_file(file->f_dentry->d_inode,
+					file,TRUE);
 				if(rc != 0)
 					break;
 			}
@@ -913,10 +1006,15 @@ cifs_read(struct file * file, char *read_data, size_t read_size,
 				return rc;
 			}
 		} else {
+#ifdef CONFIG_CIFS_STATS
+			atomic_inc(&pTcon->num_reads);
+			spin_lock(&pTcon->stat_lock);
+			pTcon->bytes_read += total_read;
+			spin_unlock(&pTcon->stat_lock);
+#endif
 			*poffset += bytes_read;
 		}
 	}
-
 	FreeXid(xid);
 	return total_read;
 }
@@ -1045,7 +1143,8 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 		rc = -EAGAIN;
 		while(rc == -EAGAIN) {
 			if ((open_file->invalidHandle) && (!open_file->closePend)) {
-				rc = cifs_reopen_file(file->f_dentry->d_inode,file);
+				rc = cifs_reopen_file(file->f_dentry->d_inode,
+					file, TRUE);
 				if(rc != 0)
 					break;
 			}
@@ -1078,7 +1177,12 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 				le16_to_cpu(pSMBr->DataOffset), &lru_pvec);
 
 			i +=  bytes_read >> PAGE_CACHE_SHIFT;
-
+#ifdef CONFIG_CIFS_STATS
+			atomic_inc(&pTcon->num_reads);
+			spin_lock(&pTcon->stat_lock);
+			pTcon->bytes_read += bytes_read;
+			spin_unlock(&pTcon->stat_lock);
+#endif
 			if((int)(bytes_read & PAGE_CACHE_MASK) != bytes_read) {
 				cFYI(1,("Partial page %d of %d read to cache",i++,num_pages));
 
@@ -1124,53 +1228,105 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 	return rc;
 }
 
-static int
-cifs_readpage(struct file *file, struct page *page)
+static int cifs_readpage_worker(struct file *file, struct page *page, loff_t * poffset)
 {
-	loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
 	char * read_data;
-	int rc = -EACCES;
-	int xid;
-
-	xid = GetXid();
-
-	if (file->private_data == NULL) {
-		FreeXid(xid);
-		return -EBADF;
-	}
-
-	cFYI(0,("readpage %p at offset %d 0x%x\n",page,(int)offset,(int)offset));
+	int rc;
 
 	page_cache_get(page);
 	read_data = kmap(page);
 	/* for reads over a certain size could initiate async read ahead */
-
-	rc = cifs_read(file, read_data, PAGE_CACHE_SIZE, &offset);
-
+                                                                                                                           
+	rc = cifs_read(file, read_data, PAGE_CACHE_SIZE, poffset);
+                                                                                                                           
 	if (rc < 0)
 		goto io_error;
 	else {
 		cFYI(1,("Bytes read %d ",rc));
 	}
-
+                                                                                                                           
 	file->f_dentry->d_inode->i_atime = CURRENT_TIME;
-
+                                                                                                                           
 	if(PAGE_CACHE_SIZE > rc) {
 		memset(read_data+rc, 0, PAGE_CACHE_SIZE - rc);
 	}
 	flush_dcache_page(page);
 	SetPageUptodate(page);
 	rc = 0;
-
+                                                                                                                           
 io_error:
-	kunmap(page);
+        kunmap(page);
+	page_cache_release(page);
+	return rc;
+}
+
+static int
+cifs_readpage(struct file *file, struct page *page)
+{
+	loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
+	int rc = -EACCES;
+	int xid;
+
+	xid = GetXid();
+
+	if (file->private_data == NULL) {
+		FreeXid(xid);
+		return -EBADF;
+	}
+
+	cFYI(1,("readpage %p at offset %d 0x%x\n",page,(int)offset,(int)offset));
+
+	rc = cifs_readpage_worker(file,page,&offset);
+
 	unlock_page(page);
 
-	page_cache_release(page);
 	FreeXid(xid);
 	return rc;
 }
 
+/* We do not want to update the file size from server for inodes
+   open for write - to avoid races with writepage extending
+   the file - in the future we could consider allowing
+   refreshing the inode only on increases in the file size 
+   but this is tricky to do without racing with writebehind
+   page caching in the current Linux kernel design */
+   
+int is_size_safe_to_change(struct cifsInodeInfo * cifsInode)
+{
+	struct list_head *tmp;
+	struct list_head *tmp1;
+	struct cifsFileInfo *open_file = NULL;
+	int rc = TRUE;
+
+	if(cifsInode == NULL)
+		return rc;
+
+	read_lock(&GlobalSMBSeslock); 
+	list_for_each_safe(tmp, tmp1, &cifsInode->openFileList) {            
+		open_file = list_entry(tmp,struct cifsFileInfo, flist);
+		if(open_file == NULL)
+			break;
+		if(open_file->closePend)
+			continue;
+	/* We check if file is open for writing,   
+	BB we could supplement this with a check to see if file size
+	changes have been flushed to server - ie inode metadata dirty */
+		if((open_file->pfile) && 
+	   ((open_file->pfile->f_flags & O_RDWR) || 
+		(open_file->pfile->f_flags & O_WRONLY))) {
+			 rc = FALSE;
+			 break;
+		}
+		if(tmp->next == NULL) {
+			cFYI(1,("File instance %p removed",tmp));
+			break;
+		}
+	}
+	read_unlock(&GlobalSMBSeslock);
+	return rc;
+}
+
+
 void
 fill_in_inode(struct inode *tmp_inode,
 	      FILE_DIRECTORY_INFO * pfindData, int *pobject_type)
@@ -1230,9 +1386,16 @@ fill_in_inode(struct inode *tmp_inode,
 		atomic_set(&cifsInfo->inUse,1);
 	}
 
-	i_size_write(tmp_inode,pfindData->EndOfFile);
-	tmp_inode->i_blocks =
-		(tmp_inode->i_blksize - 1 + pfindData->AllocationSize) >> tmp_inode->i_blkbits;
+	if(is_size_safe_to_change(cifsInfo)) {
+		/* can not safely change the file size here if the 
+		client is writing to it due to potential races */
+		i_size_write(tmp_inode,pfindData->EndOfFile);
+
+	/* 512 bytes (2**9) is the fake blocksize that must be used */
+	/* for this calculation, even though the reported blocksize is larger */
+		tmp_inode->i_blocks = (512 - 1 + pfindData->AllocationSize) >> 9;
+	}
+
 	if (pfindData->AllocationSize < pfindData->EndOfFile)
 		cFYI(1, ("Possible sparse file: allocation size less than end of file "));
 	cFYI(1,
@@ -1303,10 +1466,17 @@ unix_fill_in_inode(struct inode *tmp_inode,
 	tmp_inode->i_nlink = le64_to_cpu(pfindData->Nlinks);
 
 	pfindData->NumOfBytes = le64_to_cpu(pfindData->NumOfBytes);
-	pfindData->EndOfFile = le64_to_cpu(pfindData->EndOfFile);
-	i_size_write(tmp_inode,pfindData->EndOfFile);
-	tmp_inode->i_blocks =
-                (tmp_inode->i_blksize - 1 + pfindData->NumOfBytes) >> tmp_inode->i_blkbits;
+
+	if(is_size_safe_to_change(cifsInfo)) {
+		/* can not safely change the file size here if the 
+		client is writing to it due to potential races */
+		pfindData->EndOfFile = le64_to_cpu(pfindData->EndOfFile);
+		i_size_write(tmp_inode,pfindData->EndOfFile);
+
+	/* 512 bytes (2**9) is the fake blocksize that must be used */
+	/* for this calculation, not the real blocksize */
+		tmp_inode->i_blocks = (512 - 1 + pfindData->NumOfBytes) >> 9;
+	}
 
 	if (S_ISREG(tmp_inode->i_mode)) {
 		cFYI(1, ("File inode"));
@@ -1348,12 +1518,15 @@ construct_dentry(struct qstr *qstring, struct file *file,
 		/* BB overwrite the old name? i.e. tmp_dentry->d_name and tmp_dentry->d_name.len ?? */
 		if(*ptmp_inode == NULL) {
 	                *ptmp_inode = new_inode(file->f_dentry->d_sb);
+			if(*ptmp_inode == NULL)
+				return;
 			d_instantiate(tmp_dentry, *ptmp_inode);
 		}
 	} else {
 		tmp_dentry = d_alloc(file->f_dentry, qstring);
 		if(tmp_dentry == NULL) {
 			cERROR(1,("Failed allocating dentry"));
+			*ptmp_inode = NULL;
 			return;
 		}
 			
@@ -1361,6 +1534,8 @@ construct_dentry(struct qstr *qstring, struct file *file,
 		tmp_dentry->d_op = &cifs_dentry_ops;
 		cFYI(0, (" instantiate dentry 0x%p with inode 0x%p ",
 			 tmp_dentry, *ptmp_inode));
+		if(*ptmp_inode == NULL)
+			return;
 		d_instantiate(tmp_dentry, *ptmp_inode);
 		d_rehash(tmp_dentry);
 	}
@@ -1417,7 +1592,9 @@ cifs_filldir(struct qstr *pqstring, FILE_DIRECTORY_INFO * pfindData,
 	pqstring->len = pfindData->FileNameLength;
 
 	construct_dentry(pqstring, file, &tmp_inode, &tmp_dentry);
-
+	if((tmp_inode == NULL) || (tmp_dentry == NULL)) {
+		return -ENOMEM;
+	}
 	fill_in_inode(tmp_inode, pfindData, &object_type);
 	rc = filldir(direntry, pfindData->FileName, pqstring->len, file->f_pos,
 		tmp_inode->i_ino, object_type);
@@ -1443,6 +1620,9 @@ cifs_filldir_unix(struct qstr *pqstring,
 	pqstring->len = strnlen(pUnixFindData->FileName, MAX_PATHCONF);
 
 	construct_dentry(pqstring, file, &tmp_inode, &tmp_dentry);
+	if((tmp_inode == NULL) || (tmp_dentry == NULL)) {
+		return -ENOMEM;
+	}
 
 	unix_fill_in_inode(tmp_inode, pUnixFindData, &object_type);
 	rc = filldir(direntry, pUnixFindData->FileName, pqstring->len,
@@ -1793,10 +1973,10 @@ cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
 					cifsFile->search_resume_name = 
 						kmalloc(cifsFile->resume_name_length, GFP_KERNEL);
 					cFYI(1,("fnext last file: %s with name %d bytes long",
-						lastFindData->FileName,
+						pfindDataUnix->FileName,
 						cifsFile->resume_name_length));
 					memcpy(cifsFile->search_resume_name,
-						lastFindData->FileName, 
+						pfindDataUnix->FileName, 
 						cifsFile->resume_name_length);
 				}
 
@@ -1905,17 +2085,34 @@ cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
 int cifs_prepare_write(struct file *file, struct page *page,
 			unsigned from, unsigned to)
 {
+	int rc = 0;
+        loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
 	cFYI(1,("prepare write for page %p from %d to %d",page,from,to));
 	if (!PageUptodate(page)) {
-		if (to - from != PAGE_CACHE_SIZE) {
+	/*	if (to - from != PAGE_CACHE_SIZE) {
 			void *kaddr = kmap_atomic(page, KM_USER0);
 			memset(kaddr, 0, from);
 			memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
 			flush_dcache_page(page);
 			kunmap_atomic(kaddr, KM_USER0);
+		} */
+		/* If we are writing a full page it will be up to date,
+		no need to read from the server */
+		if((to==PAGE_CACHE_SIZE) && (from == 0))
+			SetPageUptodate(page);
+
+		/* might as well read a page, it is fast enough */
+		if((file->f_flags & O_ACCMODE) != O_WRONLY) {
+			rc = cifs_readpage_worker(file,page,&offset);
+		} else {
+		/* should we try using another
+		file handle if there is one - how would we lock it
+		to prevent close of that handle racing with this read? */
+		/* In any case this will be written out by commit_write */
 		}
-		SetPageUptodate(page);
 	}
+
+	/* BB should we pass any errors back? e.g. if we do not have read access to the file */
 	return 0;
 }
 
@@ -1924,8 +2121,7 @@ struct address_space_operations cifs_addr_ops = {
 	.readpage = cifs_readpage,
 	.readpages = cifs_readpages,
 	.writepage = cifs_writepage,
-	.prepare_write = simple_prepare_write, /* BB fixme BB */
-/*	.prepare_write = cifs_prepare_write, */  /* BB removeme BB */
+	.prepare_write = cifs_prepare_write, 
 	.commit_write = cifs_commit_write,
    /* .sync_page = cifs_sync_page, */
 	/*.direct_IO = */
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index e48ed8cc8..c12231b48 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -30,6 +30,8 @@
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
 
+extern int is_size_safe_to_change(struct cifsInodeInfo *);
+
 int
 cifs_get_inode_info_unix(struct inode **pinode,
 			 const unsigned char *search_path,
@@ -43,9 +45,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
 	struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
 	char *tmp_path;
 
-/* BB add caching check so we do not go to server to overwrite inode info to cached file
-	where the local file sizes are correct and the server info is stale  BB */
-
 	xid = GetXid();
 
 	pTcon = cifs_sb->tcon;
@@ -125,13 +124,29 @@ cifs_get_inode_info_unix(struct inode **pinode,
 		inode->i_nlink = le64_to_cpu(findData.Nlinks);
 		findData.NumOfBytes = le64_to_cpu(findData.NumOfBytes);
 		findData.EndOfFile = le64_to_cpu(findData.EndOfFile);
-		i_size_write(inode,findData.EndOfFile);
+
+		if(is_size_safe_to_change(cifsInfo)) {
+		/* can not safely change the file size here if the 
+		   client is writing to it due to potential races */
+
+			i_size_write(inode,findData.EndOfFile);
 /* blksize needs to be multiple of two. So safer to default to blksize
 	and blkbits set in superblock so 2**blkbits and blksize will match */
 /*		inode->i_blksize =
 		    (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/
-		inode->i_blocks = 
-	                (inode->i_blksize - 1 + findData.NumOfBytes) >> inode->i_blkbits;
+
+		/* This seems incredibly stupid but it turns out that
+		i_blocks is not related to (i_size / i_blksize), instead a
+		size of 512 is required to be used for calculating num blocks */
+		 
+
+/*		inode->i_blocks = 
+	                (inode->i_blksize - 1 + findData.NumOfBytes) >> inode->i_blkbits;*/
+
+		/* 512 bytes (2**9) is the fake blocksize that must be used */
+		/* for this calculation */
+			inode->i_blocks = (512 - 1 + findData.NumOfBytes) >> 9;
+		}
 
 		if (findData.NumOfBytes < findData.EndOfFile)
 			cFYI(1, ("Server inconsistency Error: it says allocation size less than end of file "));
@@ -273,10 +288,18 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
 				inode->i_mode &= ~(S_IWUGO);
    /* BB add code here - validate if device or weird share or device type? */
 		}
-		i_size_write(inode,le64_to_cpu(pfindData->EndOfFile));
+		if(is_size_safe_to_change(cifsInfo)) {
+		/* can not safely change the file size here if the 
+		client is writing to it due to potential races */
+
+			i_size_write(inode,le64_to_cpu(pfindData->EndOfFile));
+
+		/* 512 bytes (2**9) is the fake blocksize that must be used */
+		/* for this calculation */
+			inode->i_blocks = (512 - 1 + pfindData->AllocationSize)
+				 >> 9;
+		}
 		pfindData->AllocationSize = le64_to_cpu(pfindData->AllocationSize);
-		inode->i_blocks =
-			(inode->i_blksize - 1 + pfindData->AllocationSize) >> inode->i_blkbits;
 
 		inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);
 
@@ -345,8 +368,15 @@ cifs_unlink(struct inode *inode, struct dentry *direntry)
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+/* Unlink can be called from rename so we can not grab
+	the sem here since we deadlock otherwise */
+/*	down(&direntry->d_sb->s_vfs_rename_sem);*/
 	full_path = build_path_from_dentry(direntry);
-
+/*	up(&direntry->d_sb->s_vfs_rename_sem);*/
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 	rc = CIFSSMBDelFile(xid, pTcon, full_path, cifs_sb->local_nls);
 
 	if (!rc) {
@@ -427,7 +457,13 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	down(&inode->i_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
+	up(&inode->i_sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 	/* BB add setting the equivalent of mode via CreateX w/ACLs */
 	rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls);
 	if (rc) {
@@ -480,7 +516,13 @@ cifs_rmdir(struct inode *inode, struct dentry *direntry)
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	down(&inode->i_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
+	up(&inode->i_sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 
 	rc = CIFSSMBRmDir(xid, pTcon, full_path, cifs_sb->local_nls);
 
@@ -525,15 +567,50 @@ cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
                      different share. Might eventually add support for this */
 	}
 
+	/* we already  have the rename sem so we do not need
+	to grab it again here to protect the path integrity */
 	fromName = build_path_from_dentry(source_direntry);
 	toName = build_path_from_dentry(target_direntry);
+	if((fromName == NULL) || (toName == NULL)) {
+		rc = -ENOMEM;
+		goto cifs_rename_exit;
+	}
 
 	rc = CIFSSMBRename(xid, pTcon, fromName, toName,
 			   cifs_sb_source->local_nls);
 	if(rc == -EEXIST) {
-		cifs_unlink(target_inode, target_direntry);
-		rc = CIFSSMBRename(xid, pTcon, fromName, toName,
-				   cifs_sb_source->local_nls);
+		/* check if they are the same file 
+		because rename of hardlinked files is a noop */
+		FILE_UNIX_BASIC_INFO * info_buf_source;
+		FILE_UNIX_BASIC_INFO * info_buf_target;
+
+		info_buf_source = 
+			kmalloc(2 * sizeof(FILE_UNIX_BASIC_INFO),GFP_KERNEL);
+		if(info_buf_source != NULL) {
+			info_buf_target = info_buf_source+1;
+			rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, 
+				info_buf_source, cifs_sb_source->local_nls);
+			if(rc == 0) {
+				rc = CIFSSMBUnixQPathInfo(xid,pTcon,toName,
+						info_buf_target,
+						cifs_sb_target->local_nls);
+			}
+			if((rc == 0) && 
+				(info_buf_source->UniqueId == 
+				 info_buf_target->UniqueId)) {
+			/* do not rename since the files are hardlinked 
+			   which is a noop */
+			} else {
+			/* we either can not tell the files are hardlinked
+			(as with Windows servers) or files are not hardlinked 
+			so delete the target manually before renaming to
+			follow POSIX rather than Windows semantics */
+				cifs_unlink(target_inode, target_direntry);
+				rc = CIFSSMBRename(xid, pTcon, fromName, toName,
+					cifs_sb_source->local_nls);
+			}
+			kfree(info_buf_source);
+		} /* if we can not get memory just leave rc as EEXIST */
 	}
 
 	if((rc == -EIO)||(rc == -EEXIST)) {
@@ -549,6 +626,8 @@ cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
 			CIFSSMBClose(xid, pTcon, netfid);
 		}
 	}
+
+cifs_rename_exit:
 	if (fromName)
 		kfree(fromName);
 	if (toName)
@@ -586,7 +665,13 @@ cifs_revalidate(struct dentry *direntry)
 
 	cifs_sb = CIFS_SB(direntry->d_sb);
 
+	/* can not safely grab the rename sem here if
+	rename calls revalidate since that would deadlock */
 	full_path = build_path_from_dentry(direntry);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 	cFYI(1,
 	     ("Revalidate: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld",
 	      full_path, direntry->d_inode,
@@ -647,9 +732,12 @@ cifs_revalidate(struct dentry *direntry)
 		}
 	}
 
-
+	/* can not grab this sem since kernel filesys locking
+		documentation indicates i_sem may be taken by the kernel 
+		on lookup and rename which could deadlock if we grab
+		the i_sem here as well */
+/*	down(&direntry->d_inode->i_sem);*/
 	/* need to write out dirty pages here  */
-	down(&direntry->d_inode->i_sem);
 	if(direntry->d_inode->i_mapping) {
 		/* do we need to lock inode until after invalidate completes below? */
 		filemap_fdatawrite(direntry->d_inode->i_mapping);
@@ -663,9 +751,7 @@ cifs_revalidate(struct dentry *direntry)
 			invalidate_remote_inode(direntry->d_inode);
 		}
 	}
-
-
-	up(&direntry->d_inode->i_sem);
+/*	up(&direntry->d_inode->i_sem);*/
 	
 	if (full_path)
 		kfree(full_path);
@@ -729,7 +815,13 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
 	cifs_sb = CIFS_SB(direntry->d_inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	down(&direntry->d_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
+	up(&direntry->d_sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 	cifsInode = CIFS_I(direntry->d_inode);
 
 	/* BB check if we need to refresh inode from server now ? BB */
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 8deba2650..f257ff0ad 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -44,10 +44,18 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
 	cifs_sb_target = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb_target->tcon;
 
-/* No need to check for cross device links since server will do that - BB note DFS case in future though (when we may have to check) */
+/* No need to check for cross device links since server will do that
+   BB note DFS case in future though (when we may have to check) */
 
+	down(&inode->i_sb->s_vfs_rename_sem);
 	fromName = build_path_from_dentry(old_file);
 	toName = build_path_from_dentry(direntry);
+	up(&inode->i_sb->s_vfs_rename_sem);
+	if((fromName == NULL) || (toName == NULL)) {
+		rc = -ENOMEM;
+		goto cifs_hl_exit;
+	}
+
 	if (cifs_sb_target->tcon->ses->capabilities & CAP_UNIX)
 		rc = CIFSUnixCreateHardLink(xid, pTcon, fromName, toName,
 					    cifs_sb_target->local_nls);
@@ -70,6 +78,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
 	cifsInode = CIFS_I(old_file->d_inode);
 	cifsInode->time = 0;	/* will force revalidate to go get info when needed */
 
+cifs_hl_exit:
 	if (fromName)
 		kfree(fromName);
 	if (toName)
@@ -90,7 +99,15 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
 	struct cifsTconInfo *pTcon;
 
 	xid = GetXid();
+
+	down(&direntry->d_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
+	up(&direntry->d_sb->s_vfs_rename_sem);
+
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 	cFYI(1, ("Full path: %s inode = 0x%p", full_path, inode));
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
@@ -149,7 +166,15 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
+	down(&inode->i_sb->s_vfs_rename_sem);
 	full_path = build_path_from_dentry(direntry);
+	up(&inode->i_sb->s_vfs_rename_sem);
+
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
+
 	cFYI(1, ("Full path: %s ", full_path));
 	cFYI(1, ("symname is %s", symname));
 
@@ -185,7 +210,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
 }
 
 int
-cifs_readlink(struct dentry *direntry, char *pBuffer, int buflen)
+cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
 {
 	struct inode *inode = direntry->d_inode;
 	int rc = -EACCES;
@@ -204,7 +229,18 @@ cifs_readlink(struct dentry *direntry, char *pBuffer, int buflen)
 	xid = GetXid();
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
+
+/* BB would it be safe against deadlock to grab this sem 
+      even though rename itself grabs the sem and calls lookup? */
+/*       down(&inode->i_sb->s_vfs_rename_sem);*/
 	full_path = build_path_from_dentry(direntry);
+/*       up(&inode->i_sb->s_vfs_rename_sem);*/
+
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
+
 	cFYI(1,
 	     ("Full path: %s inode = 0x%p pBuffer = 0x%p buflen = %d",
 	      full_path, inode, pBuffer, buflen));
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index ca96ffe2c..0d690174e 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -21,6 +21,7 @@
 
 #include <linux/slab.h>
 #include <linux/ctype.h>
+#include <linux/mempool.h>
 #include "cifspdu.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
@@ -28,7 +29,7 @@
 #include "smberr.h"
 #include "nterr.h"
 
-extern kmem_cache_t *cifs_req_cachep;
+extern mempool_t *cifs_req_poolp;
 extern struct task_struct * oplockThread;
 
 __u16 GlobalMid;		/* multiplex id - rotating counter */
@@ -122,6 +123,9 @@ tconInfoAlloc(void)
 		ret_buf->tidStatus = CifsNew;
 		INIT_LIST_HEAD(&ret_buf->openFileList);
 		init_MUTEX(&ret_buf->tconSem);
+#ifdef CONFIG_CIFS_STATS
+		ret_buf->stat_lock = SPIN_LOCK_UNLOCKED;
+#endif
 		write_unlock(&GlobalSMBSeslock);
 	}
 	return ret_buf;
@@ -153,7 +157,7 @@ cifs_buf_get(void)
    albeit slightly larger than necessary and maxbuffersize 
    defaults to this and can not be bigger */
 	ret_buf =
-	    (struct smb_hdr *) kmem_cache_alloc(cifs_req_cachep, SLAB_KERNEL | SLAB_NOFS);
+	    (struct smb_hdr *) mempool_alloc(cifs_req_poolp, SLAB_KERNEL | SLAB_NOFS);
 
 	/* clear the first few header bytes */
 	if (ret_buf) {
@@ -172,7 +176,7 @@ cifs_buf_release(void *buf_to_free)
 		cFYI(1, ("Null buffer passed to cifs_buf_release"));
 		return;
 	}
-	kmem_cache_free(cifs_req_cachep, buf_to_free);
+	mempool_free(buf_to_free,cifs_req_poolp);
 
 	atomic_dec(&bufAllocCount);
 	return;
@@ -391,6 +395,9 @@ is_valid_oplock_break(struct smb_hdr *buf)
 	list_for_each(tmp, &GlobalTreeConnectionList) {
 		tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
 		if (tcon->tid == buf->Tid) {
+#ifdef CONFIG_CIFS_STATS
+			atomic_inc(&tcon->num_oplock_brks);
+#endif
 			list_for_each(tmp1,&tcon->openFileList){
 				netfile = list_entry(tmp1,struct cifsFileInfo,tlist);
 				if(pSMB->Fid == netfile->netfid) {
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index aaa78992a..3668ab00b 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -25,12 +25,13 @@
 #include <linux/net.h>
 #include <asm/uaccess.h>
 #include <asm/processor.h>
+#include <linux/mempool.h>
 #include "cifspdu.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
   
-extern kmem_cache_t *cifs_mid_cachep;
+extern mempool_t *cifs_mid_poolp;
 extern kmem_cache_t *cifs_oplock_cachep;
 
 struct mid_q_entry *
@@ -47,8 +48,7 @@ AllocMidQEntry(struct smb_hdr *smb_buffer, struct cifsSesInfo *ses)
 		return NULL;
 	}
 	
-	temp = (struct mid_q_entry *) kmem_cache_alloc(cifs_mid_cachep,
-						       SLAB_KERNEL);
+	temp = (struct mid_q_entry *) mempool_alloc(cifs_mid_poolp,SLAB_KERNEL | SLAB_NOFS);
 	if (temp == NULL)
 		return temp;
 	else {
@@ -79,7 +79,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
 	atomic_dec(&midCount);
 	spin_unlock(&GlobalMid_Lock);
 	cifs_buf_release(midEntry->resp_buf);
-	kmem_cache_free(cifs_mid_cachep, midEntry);
+	mempool_free(midEntry, cifs_mid_poolp);
 }
 
 struct oplock_q_entry *
@@ -120,13 +120,13 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
 	 unsigned int smb_buf_length, struct sockaddr *sin)
 {
 	int rc = 0;
+	int i = 0;
 	struct msghdr smb_msg;
 	struct iovec iov;
 	mm_segment_t temp_fs;
 
 	if(ssocket == NULL)
 		return -ENOTSOCK; /* BB eventually add reconnect code here */
-/*  ssocket->sk->allocation = GFP_BUFFER; *//* BB is this spurious? */
 	iov.iov_base = smb_buffer;
 	iov.iov_len = smb_buf_length + 4;
 
@@ -152,6 +152,14 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
 	while(iov.iov_len > 0) {
 		rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4);
 		if ((rc == -ENOSPC) || (rc == -EAGAIN)) {
+			i++;
+			if(i > 60) {
+				cERROR(1,
+				   ("sends on sock %p stuck for 30 seconds",
+				    ssocket));
+				rc = -EAGAIN;
+				break;
+			}
 			set_current_state(TASK_INTERRUPTIBLE);
 			schedule_timeout(HZ/2);
 			continue;
@@ -182,31 +190,60 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 	long timeout;
 	struct mid_q_entry *midQ;
 
-	if ((ses == NULL) || (ses->server == NULL)) {
-		cERROR(1,("Null tcp session or smb session: %p",ses));
+	if (ses == NULL) {
+		cERROR(1,("Null smb session"));
+		return -EIO;
+	}
+	if(ses->server == NULL) {
+		cERROR(1,("Null tcp session"));
 		return -EIO;
 	}
 
+	/* Ensure that we do not send more than 50 overlapping requests 
+		to the same server. We may make this configurable later or
+		use ses->maxReq */
+
+	/* can not count locking commands against the total since
+		they are allowed to block on server */
+	if(long_op < 3) {
+		/* update # of requests on the wire to this server */
+		atomic_inc(&ses->server->inFlight); 
+	}
+ 
+	if(atomic_read(&ses->server->inFlight) > CIFS_MAX_REQ) {
+		wait_event(ses->server->request_q,atomic_read(&ses->server->inFlight) <= CIFS_MAX_REQ);
+	}
+
+	/* make sure that we sign in the same order that we send on this socket 
+		and avoid races inside tcp sendmsg code that could cause corruption
+		of smb data */
+
+	down(&ses->server->tcpSem); 
+
 	if (ses->server->tcpStatus == CifsExiting) {
-		return -ENOENT;
+		rc = -ENOENT;
+		goto out_unlock;
 	} else if (ses->server->tcpStatus == CifsNeedReconnect) {
 		cFYI(1,("tcp session dead - return to caller to retry"));
-		return -EAGAIN;
+		rc = -EAGAIN;
+		goto out_unlock;
 	} else if (ses->status != CifsGood) {
 		/* check if SMB session is bad because we are setting it up */
 		if((in_buf->Command != SMB_COM_SESSION_SETUP_ANDX) && 
 			(in_buf->Command != SMB_COM_NEGOTIATE)) {
-			return -EAGAIN;
+			rc = -EAGAIN;
+			goto out_unlock;
 		} /* else ok - we are setting up session */
 	}
-	/* make sure that we sign in the same order that we send on this socket 
-		and avoid races inside tcp sendmsg code that could cause corruption
-		of smb data */
-	down(&ses->server->tcpSem); 
 	midQ = AllocMidQEntry(in_buf, ses);
 	if (midQ == NULL) {
 		up(&ses->server->tcpSem);
-		return -EIO;
+		/* If not lock req, update # of requests on wire to server */
+		if(long_op < 3) {
+			atomic_dec(&ses->server->inFlight); 
+			wake_up(&ses->server->request_q);
+		}
+		return -ENOMEM;
 	}
 
 	if (in_buf->smb_buf_length > CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE - 4) {
@@ -215,6 +252,11 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 		       ("Illegal length, greater than maximum frame, %d ",
 			in_buf->smb_buf_length));
 		DeleteMidQEntry(midQ);
+		/* If not lock req, update # of requests on wire to server */
+		if(long_op < 3) {
+			atomic_dec(&ses->server->inFlight); 
+			wake_up(&ses->server->request_q);
+		}
 		return -EIO;
 	}
 
@@ -226,7 +268,17 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 	midQ->midState = MID_REQUEST_SUBMITTED;
 	rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length,
 		      (struct sockaddr *) &(ses->server->addr.sockAddr));
-	up(&ses->server->tcpSem);
+	if(rc < 0) {
+		DeleteMidQEntry(midQ);
+		up(&ses->server->tcpSem);
+		/* If not lock req, update # of requests on wire to server */
+		if(long_op < 3) {
+			atomic_dec(&ses->server->inFlight); 
+			wake_up(&ses->server->request_q);
+		}
+		return rc;
+	} else
+		up(&ses->server->tcpSem);
 	if (long_op == -1)
 		goto cifs_no_response_exit;
 	else if (long_op == 2) /* writes past end of file can take looooong time */
@@ -285,10 +337,14 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 		}
 		spin_unlock(&GlobalMid_Lock);
 		DeleteMidQEntry(midQ);
+		/* If not lock req, update # of requests on wire to server */
+		if(long_op < 3) {
+			atomic_dec(&ses->server->inFlight); 
+			wake_up(&ses->server->request_q);
+		}
 		return rc;
 	}
   
-
 	if (receive_len > CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE) {
 		cERROR(1,
 		       ("Frame too large received.  Length: %d  Xid: %d",
@@ -338,8 +394,22 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 		}
 	}
 cifs_no_response_exit:
-	DeleteMidQEntry(midQ);	/* BB what if process is killed?
-			 - BB add background daemon to clean up Mid entries from
-			 killed processes & test killing process with active mid */
+	DeleteMidQEntry(midQ);
+
+	if(long_op < 3) {
+		atomic_dec(&ses->server->inFlight); 
+		wake_up(&ses->server->request_q);
+	}
+
+	return rc;
+
+out_unlock:
+	up(&ses->server->tcpSem);
+	/* If not lock req, update # of requests on wire to server */
+	if(long_op < 3) {
+		atomic_dec(&ses->server->inFlight); 
+		wake_up(&ses->server->request_q);
+	}
+
 	return rc;
 }
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index e377fa024..dd6a2c08c 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -20,37 +20,68 @@
  */
 
 #include <linux/fs.h>
+#include "cifsfs.h"
+#include "cifspdu.h"
+#include "cifsglob.h"
+#include "cifsproto.h"
+#include "cifs_debug.h"
 
 int cifs_removexattr(struct dentry * direntry, const char * name)
 {
-        int rc = -EOPNOTSUPP;
-        return rc;
+	int rc = -EOPNOTSUPP;
+	return rc;
 }
 
 int cifs_setxattr(struct dentry * direntry, const char * name,
         const void * value, size_t size, int flags)
 {
-        int rc = -EOPNOTSUPP;
-        return rc;
+	int rc = -EOPNOTSUPP;
+	return rc;
 }
 
 ssize_t cifs_getxattr(struct dentry * direntry, const char * name,
          void * value, size_t size)
 {
-        ssize_t rc = -EOPNOTSUPP;
-        return rc;
+	ssize_t rc = -EOPNOTSUPP;
+	return rc;
 }
 
 ssize_t cifs_listxattr(struct dentry * direntry, char * ea_data, size_t ea_size)
 {
-        ssize_t rc = -EOPNOTSUPP;
+	ssize_t rc = -EOPNOTSUPP;
+#ifdef CONFIG_CIFS_XATTR
+	int xid;
+	struct cifs_sb_info *cifs_sb;
+	struct cifsTconInfo *pTcon;
+	struct super_block * sb;
+	char * full_path;
+	if(direntry == NULL)
+		return -EIO;
+	if(direntry->d_inode == NULL)
+		return -EIO;
+	sb = direntry->d_inode->i_sb;
+	if(sb == NULL)
+		return -EIO;
+	xid = GetXid();
 
+	cifs_sb = CIFS_SB(sb);
+	pTcon = cifs_sb->tcon;
+
+	down(&sb->s_vfs_rename_sem);
+	full_path = build_path_from_dentry(direntry);
+	up(&sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
 	/* return dosattributes as pseudo xattr */
 	/* return alt name if available as pseudo attr */
 
 	/* if proc/fs/cifs/streamstoxattr is set then
 		search server for EAs or streams to 
 		returns as xattrs */
-
-        return rc;
+	rc = CIFSSMBQAllEAs(xid,pTcon,full_path,ea_data,ea_size,cifs_sb->local_nls);
+	FreeXid(xid);
+#endif
+	return rc;
 }
diff --git a/fs/coda/file.c b/fs/coda/file.c
index 768b2a1e5..f0c867c7e 100644
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -29,7 +29,7 @@
 int use_coda_close;
 
 static ssize_t
-coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos)
+coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct coda_file_info *cfi;
 	struct file *host_file;
@@ -45,7 +45,7 @@ coda_file_read(struct file *coda_file, char *buf, size_t count, loff_t *ppos)
 }
 
 static ssize_t
-coda_file_write(struct file *coda_file, const char *buf, size_t count, loff_t *ppos)
+coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct inode *host_inode, *coda_inode = coda_file->f_dentry->d_inode;
 	struct coda_file_info *cfi;
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c
index e10ac7643..127714936 100644
--- a/fs/coda/pioctl.c
+++ b/fs/coda/pioctl.c
@@ -58,7 +58,7 @@ static int coda_pioctl(struct inode * inode, struct file * filp,
         struct coda_inode_info *cnp;
 
         /* get the Pioctl data arguments from user space */
-        if (copy_from_user(&data, (int *)user_data, sizeof(data))) {
+        if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) {
 	    return -EINVAL;
 	}
        
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 14f665e62..7d55a28b2 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -88,7 +88,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp,
 	switch(cmd) {
 	case CIOC_KERNEL_VERSION:
 		data = CODA_KERNEL_VERSION;
-		return put_user(data, (int *) arg);
+		return put_user(data, (int __user *) arg);
 	default:
 		return -ENOTTY;
 	}
@@ -100,7 +100,7 @@ static int coda_psdev_ioctl(struct inode * inode, struct file * filp,
  *	Receive a message written by Venus to the psdev
  */
  
-static ssize_t coda_psdev_write(struct file *file, const char *buf, 
+static ssize_t coda_psdev_write(struct file *file, const char __user *buf, 
 				size_t nbytes, loff_t *off)
 {
         struct venus_comm *vcp = (struct venus_comm *) file->private_data;
@@ -212,7 +212,7 @@ out:
  *	Read a message from the kernel to Venus
  */
 
-static ssize_t coda_psdev_read(struct file * file, char * buf, 
+static ssize_t coda_psdev_read(struct file * file, char __user * buf, 
 			       size_t nbytes, loff_t *off)
 {
 	DECLARE_WAITQUEUE(wait, current);
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c
index 7c8a136be..f1692b563 100644
--- a/fs/coda/sysctl.c
+++ b/fs/coda/sysctl.c
@@ -69,7 +69,7 @@ void reset_coda_cache_inv_stats( void )
 }
 
 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-			     void * buffer, size_t * lenp )
+			     void __user * buffer, size_t * lenp )
 {
 	if ( write ) {
 		reset_coda_vfs_stats();
@@ -83,7 +83,7 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
 }
 
 int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
-				   struct file * filp, void * buffer, 
+				   struct file * filp, void __user * buffer, 
 				   size_t * lenp )
 {
 	if ( write ) {
@@ -214,7 +214,7 @@ struct proc_dir_entry* proc_fs_coda;
 #define coda_proc_create(name,get_info) \
 	create_proc_info_entry(name, 0, proc_fs_coda, get_info)
 
-void coda_sysctl_init()
+void coda_sysctl_init(void)
 {
 	reset_coda_vfs_stats();
 	reset_coda_cache_inv_stats();
@@ -234,7 +234,7 @@ void coda_sysctl_init()
 #endif 
 }
 
-void coda_sysctl_clean() 
+void coda_sysctl_clean(void) 
 {
 
 #ifdef CONFIG_SYSCTL
diff --git a/fs/compat.c b/fs/compat.c
index b628d2e31..689fdd017 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -34,15 +34,23 @@
 #include <linux/syscalls.h>
 #include <linux/ctype.h>
 #include <linux/module.h>
+#include <linux/dnotify.h>
+#include <linux/highuid.h>
+#include <linux/sunrpc/svc.h>
+#include <linux/nfsd/nfsd.h>
+#include <linux/nfsd/syscall.h>
+#include <linux/personality.h>
+
 #include <net/sock.h>		/* siocdevprivate_ioctl */
 
 #include <asm/uaccess.h>
+#include <asm/mmu_context.h>
 
 /*
  * Not all architectures have sys_utime, so implement this in terms
  * of sys_utimes.
  */
-asmlinkage long compat_sys_utime(char *filename, struct compat_utimbuf *t)
+asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t)
 {
 	struct timeval tv[2];
 
@@ -56,7 +64,7 @@ asmlinkage long compat_sys_utime(char *filename, struct compat_utimbuf *t)
 	return do_utimes(filename, t ? tv : NULL);
 }
 
-asmlinkage long compat_sys_utimes(char *filename, struct compat_timeval *t)
+asmlinkage long compat_sys_utimes(char __user *filename, struct compat_timeval __user *t)
 {
 	struct timeval tv[2];
 
@@ -70,8 +78,8 @@ asmlinkage long compat_sys_utimes(char *filename, struct compat_timeval *t)
 	return do_utimes(filename, t ? tv : NULL);
 }
 
-asmlinkage long compat_sys_newstat(char * filename,
-		struct compat_stat *statbuf)
+asmlinkage long compat_sys_newstat(char __user * filename,
+		struct compat_stat __user *statbuf)
 {
 	struct kstat stat;
 	int error = vfs_stat(filename, &stat);
@@ -81,8 +89,8 @@ asmlinkage long compat_sys_newstat(char * filename,
 	return error;
 }
 
-asmlinkage long compat_sys_newlstat(char * filename,
-		struct compat_stat *statbuf)
+asmlinkage long compat_sys_newlstat(char __user * filename,
+		struct compat_stat __user *statbuf)
 {
 	struct kstat stat;
 	int error = vfs_lstat(filename, &stat);
@@ -93,7 +101,7 @@ asmlinkage long compat_sys_newlstat(char * filename,
 }
 
 asmlinkage long compat_sys_newfstat(unsigned int fd,
-		struct compat_stat * statbuf)
+		struct compat_stat __user * statbuf)
 {
 	struct kstat stat;
 	int error = vfs_fstat(fd, &stat);
@@ -103,7 +111,7 @@ asmlinkage long compat_sys_newfstat(unsigned int fd,
 	return error;
 }
 
-static int put_compat_statfs(struct compat_statfs *ubuf, struct kstatfs *kbuf)
+static int put_compat_statfs(struct compat_statfs __user *ubuf, struct kstatfs *kbuf)
 {
 	
 	if (sizeof ubuf->f_blocks == 4) {
@@ -137,7 +145,7 @@ static int put_compat_statfs(struct compat_statfs *ubuf, struct kstatfs *kbuf)
  * The following statfs calls are copies of code from fs/open.c and
  * should be checked against those from time to time
  */
-asmlinkage long compat_sys_statfs(const char *path, struct compat_statfs *buf)
+asmlinkage long compat_sys_statfs(const char __user *path, struct compat_statfs __user *buf)
 {
 	struct nameidata nd;
 	int error;
@@ -153,7 +161,7 @@ asmlinkage long compat_sys_statfs(const char *path, struct compat_statfs *buf)
 	return error;
 }
 
-asmlinkage long compat_sys_fstatfs(unsigned int fd, struct compat_statfs *buf)
+asmlinkage long compat_sys_fstatfs(unsigned int fd, struct compat_statfs __user *buf)
 {
 	struct file * file;
 	struct kstatfs tmp;
@@ -171,7 +179,7 @@ out:
 	return error;
 }
 
-static int put_compat_statfs64(struct compat_statfs64 *ubuf, struct kstatfs *kbuf)
+static int put_compat_statfs64(struct compat_statfs64 __user *ubuf, struct kstatfs *kbuf)
 {
 	if (sizeof ubuf->f_blocks == 4) {
 		if ((kbuf->f_blocks | kbuf->f_bfree |
@@ -195,7 +203,7 @@ static int put_compat_statfs64(struct compat_statfs64 *ubuf, struct kstatfs *kbu
 	return 0;
 }
 
-asmlinkage long compat_statfs64(const char *path, compat_size_t sz, struct compat_statfs64 *buf)
+asmlinkage long compat_statfs64(const char __user *path, compat_size_t sz, struct compat_statfs64 __user *buf)
 {
 	struct nameidata nd;
 	int error;
@@ -214,7 +222,7 @@ asmlinkage long compat_statfs64(const char *path, compat_size_t sz, struct compa
 	return error;
 }
 
-asmlinkage long compat_fstatfs64(unsigned int fd, compat_size_t sz, struct compat_statfs64 *buf)
+asmlinkage long compat_fstatfs64(unsigned int fd, compat_size_t sz, struct compat_statfs64 __user *buf)
 {
 	struct file * file;
 	struct kstatfs tmp;
@@ -282,53 +290,36 @@ static int __init init_sys32_ioctl(void)
 
 __initcall(init_sys32_ioctl);
 
-static struct ioctl_trans *ioctl_free_list;
-
-/* Never free them really. This avoids SMP races. With a Read-Copy-Update
-   enabled kernel we could just use the RCU infrastructure for this. */
-static void free_ioctl(struct ioctl_trans *t) 
-{ 
-	t->cmd = 0; 
-	mb();
-	t->next = ioctl_free_list;
-	ioctl_free_list = t;
-} 
-
-int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *))
+int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int,
+				unsigned int, unsigned long, struct file *))
 {
 	struct ioctl_trans *t;
+	struct ioctl_trans *new_t;
 	unsigned long hash = ioctl32_hash(cmd);
 
+	new_t = kmalloc(sizeof(*new_t), GFP_KERNEL);
+	if (!new_t)
+		return -ENOMEM;
+
 	lock_kernel(); 
-	for (t = (struct ioctl_trans *)ioctl32_hash_table[hash];
-	     t;
-	     t = t->next) { 
+	for (t = ioctl32_hash_table[hash]; t; t = t->next) {
 		if (t->cmd == cmd) {
-			printk("Trying to register duplicated ioctl32 handler %x\n", cmd);
+			printk(KERN_ERR "Trying to register duplicated ioctl32 "
+					"handler %x\n", cmd);
 			unlock_kernel();
+			kfree(new_t);
 			return -EINVAL; 
 		}
-	} 
-
-	if (ioctl_free_list) { 
-		t = ioctl_free_list; 
-		ioctl_free_list = t->next; 
-	} else { 
-		t = kmalloc(sizeof(struct ioctl_trans), GFP_KERNEL); 
-		if (!t) { 
-			unlock_kernel();
-			return -ENOMEM;
-		}
 	}
-	
-	t->next = NULL;
-	t->cmd = cmd;
-	t->handler = handler; 
-	ioctl32_insert_translation(t);
+	new_t->next = NULL;
+	new_t->cmd = cmd;
+	new_t->handler = handler;
+	ioctl32_insert_translation(new_t);
 
 	unlock_kernel();
 	return 0;
 }
+EXPORT_SYMBOL(register_ioctl32_conversion);
 
 static inline int builtin_ioctl(struct ioctl_trans *t)
 { 
@@ -347,7 +338,7 @@ int unregister_ioctl32_conversion(unsigned int cmd)
 
 	lock_kernel(); 
 
-	t = (struct ioctl_trans *)ioctl32_hash_table[hash];
+	t = ioctl32_hash_table[hash];
 	if (!t) { 
 		unlock_kernel();
 		return -EINVAL;
@@ -358,38 +349,39 @@ int unregister_ioctl32_conversion(unsigned int cmd)
 			printk("%p tried to unregister builtin ioctl %x\n",
 			       __builtin_return_address(0), cmd);
 		} else { 
-		ioctl32_hash_table[hash] = t->next;
-			free_ioctl(t); 
+			ioctl32_hash_table[hash] = t->next;
 			unlock_kernel();
-		return 0;
+			kfree(t);
+			return 0;
 		}
 	} 
 	while (t->next) {
-		t1 = (struct ioctl_trans *)(long)t->next;
+		t1 = t->next;
 		if (t1->cmd == cmd) { 
 			if (builtin_ioctl(t1)) {
-				printk("%p tried to unregister builtin ioctl %x\n",
-				       __builtin_return_address(0), cmd);
+				printk("%p tried to unregister builtin "
+					"ioctl %x\n",
+					__builtin_return_address(0), cmd);
 				goto out;
 			} else { 
-			t->next = t1->next;
-				free_ioctl(t1); 
+				t->next = t1->next;
 				unlock_kernel();
-			return 0;
+				kfree(t1);
+				return 0;
 			}
 		}
 		t = t1;
 	}
-	printk(KERN_ERR "Trying to free unknown 32bit ioctl handler %x\n", cmd);
- out:
+	printk(KERN_ERR "Trying to free unknown 32bit ioctl handler %x\n",
+				cmd);
+out:
 	unlock_kernel();
 	return -EINVAL;
 }
-
-EXPORT_SYMBOL(register_ioctl32_conversion); 
 EXPORT_SYMBOL(unregister_ioctl32_conversion); 
 
-asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
+				unsigned long arg)
 {
 	struct file * filp;
 	int error = -EBADF;
@@ -404,43 +396,53 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon
 		goto out;
 	}
 
-	t = (struct ioctl_trans *)ioctl32_hash_table [ioctl32_hash (cmd)];
+	lock_kernel();
+
+	t = ioctl32_hash_table[ioctl32_hash (cmd)];
 
 	while (t && t->cmd != cmd)
-		t = (struct ioctl_trans *)t->next;
+		t = t->next;
 	if (t) {
 		if (t->handler) { 
-			lock_kernel();
 			error = t->handler(fd, cmd, arg, filp);
 			unlock_kernel();
-		} else
+		} else {
+			unlock_kernel();
 			error = sys_ioctl(fd, cmd, arg);
-	} else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
-		error = siocdevprivate_ioctl(fd, cmd, arg);
+		}
 	} else {
-		static int count;
-		if (++count <= 50) { 
-			char buf[10];
-			char *path = (char *)__get_free_page(GFP_KERNEL), *fn = "?"; 
-
-			/* find the name of the device. */
-			if (path) {
-		       		fn = d_path(filp->f_dentry, filp->f_vfsmnt, 
-					    path, PAGE_SIZE);
+		unlock_kernel();
+		if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
+			error = siocdevprivate_ioctl(fd, cmd, arg);
+		} else {
+			static int count;
+			if (++count <= 50) {
+				char buf[10];
+				char *fn = "?";
+				char *path;
+
+				path = (char *)__get_free_page(GFP_KERNEL);
+
+				/* find the name of the device. */
+				if (path) {
+			       		fn = d_path(filp->f_dentry,
+						filp->f_vfsmnt, path,
+						PAGE_SIZE);
+				}
+
+				sprintf(buf,"'%c'", (cmd>>24) & 0x3f);
+				if (!isprint(buf[1]))
+				    sprintf(buf, "%02x", buf[1]);
+				printk("ioctl32(%s:%d): Unknown cmd fd(%d) "
+					"cmd(%08x){%s} arg(%08x) on %s\n",
+					current->comm, current->pid,
+					(int)fd, (unsigned int)cmd, buf,
+					(unsigned int)arg, fn);
+				if (path)
+					free_page((unsigned long)path);
 			}
-
-			sprintf(buf,"'%c'", (cmd>>24) & 0x3f); 
-			if (!isprint(buf[1]))
-			    sprintf(buf, "%02x", buf[1]);
-			printk("ioctl32(%s:%d): Unknown cmd fd(%d) "
-			       "cmd(%08x){%s} arg(%08x) on %s\n",
-			       current->comm, current->pid,
-			       (int)fd, (unsigned int)cmd, buf, (unsigned int)arg,
-			       fn);
-			if (path) 
-				free_page((unsigned long)path); 
+			error = -EINVAL;
 		}
-		error = -EINVAL;
 	}
 out:
 	fput(filp);
@@ -448,7 +450,7 @@ out2:
 	return error;
 }
 
-static int get_compat_flock(struct flock *kfl, struct compat_flock *ufl)
+static int get_compat_flock(struct flock *kfl, struct compat_flock __user *ufl)
 {
 	if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
 	    __get_user(kfl->l_type, &ufl->l_type) ||
@@ -460,7 +462,7 @@ static int get_compat_flock(struct flock *kfl, struct compat_flock *ufl)
 	return 0;
 }
 
-static int put_compat_flock(struct flock *kfl, struct compat_flock *ufl)
+static int put_compat_flock(struct flock *kfl, struct compat_flock __user *ufl)
 {
 	if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)) ||
 	    __put_user(kfl->l_type, &ufl->l_type) ||
@@ -473,7 +475,7 @@ static int put_compat_flock(struct flock *kfl, struct compat_flock *ufl)
 }
 
 #ifndef HAVE_ARCH_GET_COMPAT_FLOCK64
-static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
+static int get_compat_flock64(struct flock *kfl, struct compat_flock64 __user *ufl)
 {
 	if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
 	    __get_user(kfl->l_type, &ufl->l_type) ||
@@ -487,7 +489,7 @@ static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
 #endif
 
 #ifndef HAVE_ARCH_PUT_COMPAT_FLOCK64
-static int put_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
+static int put_compat_flock64(struct flock *kfl, struct compat_flock64 __user *ufl)
 {
 	if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)) ||
 	    __put_user(kfl->l_type, &ufl->l_type) ||
@@ -564,7 +566,7 @@ asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
 }
 
 asmlinkage long
-compat_sys_io_setup(unsigned nr_reqs, u32 *ctx32p)
+compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
 {
 	long ret;
 	aio_context_t ctx64;
@@ -574,7 +576,8 @@ compat_sys_io_setup(unsigned nr_reqs, u32 *ctx32p)
 		return -EFAULT;
 
 	set_fs(KERNEL_DS);
-	ret = sys_io_setup(nr_reqs, &ctx64);
+	/* The __user pointer cast is valid because of the set_fs() */
+	ret = sys_io_setup(nr_reqs, (aio_context_t __user *) &ctx64);
 	set_fs(oldfs);
 	/* truncating is ok because it's a user address */
 	if (!ret)
@@ -586,12 +589,12 @@ asmlinkage long
 compat_sys_io_getevents(aio_context_t ctx_id,
 				 unsigned long min_nr,
 				 unsigned long nr,
-				 struct io_event *events,
-				 struct compat_timespec *timeout)
+				 struct io_event __user *events,
+				 struct compat_timespec __user *timeout)
 {
 	long ret;
 	struct timespec t;
-	struct timespec *ut = NULL;
+	struct timespec __user *ut = NULL;
 
 	ret = -EFAULT;
 	if (unlikely(!access_ok(VERIFY_WRITE, events, 
@@ -611,7 +614,7 @@ out:
 }
 
 static inline long
-copy_iocb(long nr, u32 *ptr32, u64 *ptr64)
+copy_iocb(long nr, u32 __user *ptr32, struct iocb __user * __user *ptr64)
 {
 	compat_uptr_t uptr;
 	int i;
@@ -619,7 +622,7 @@ copy_iocb(long nr, u32 *ptr32, u64 *ptr64)
 	for (i = 0; i < nr; ++i) {
 		if (get_user(uptr, ptr32 + i))
 			return -EFAULT;
-		if (put_user((u64)compat_ptr(uptr), ptr64 + i))
+		if (put_user(compat_ptr(uptr), ptr64 + i))
 			return -EFAULT;
 	}
 	return 0;
@@ -628,9 +631,9 @@ copy_iocb(long nr, u32 *ptr32, u64 *ptr64)
 #define MAX_AIO_SUBMITS 	(PAGE_SIZE/sizeof(struct iocb *))
 
 asmlinkage long
-compat_sys_io_submit(aio_context_t ctx_id, int nr, u32 *iocb)
+compat_sys_io_submit(aio_context_t ctx_id, int nr, u32 __user *iocb)
 {
-	struct iocb **iocb64; 
+	struct iocb __user * __user *iocb64; 
 	long ret;
 
 	if (unlikely(nr < 0))
@@ -640,7 +643,7 @@ compat_sys_io_submit(aio_context_t ctx_id, int nr, u32 *iocb)
 		nr = MAX_AIO_SUBMITS;
 	
 	iocb64 = compat_alloc_user_space(nr * sizeof(*iocb64));
-	ret = copy_iocb(nr, iocb, (u64 *) iocb64);
+	ret = copy_iocb(nr, iocb, iocb64);
 	if (!ret)
 		ret = sys_io_submit(ctx_id, nr, iocb64);
 	return ret;
@@ -741,9 +744,9 @@ extern int copy_mount_options (const void __user *, unsigned long *);
 #define SMBFS_NAME      "smbfs"
 #define NCPFS_NAME      "ncpfs"
 
-asmlinkage int compat_sys_mount(char __user * dev_name, char __user * dir_name,
-				char __user * type, unsigned long flags,
-				void __user * data)
+asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
+				 char __user * type, unsigned long flags,
+				 void __user * data)
 {
 	unsigned long type_page;
 	unsigned long data_page;
@@ -794,3 +797,840 @@ asmlinkage int compat_sys_mount(char __user * dev_name, char __user * dir_name,
 	return retval;
 }
 
+static ssize_t compat_do_readv_writev(int type, struct file *file,
+			       const struct compat_iovec __user *uvector,
+			       unsigned long nr_segs, loff_t *pos)
+{
+	typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
+	typedef ssize_t (*iov_fn_t)(struct file *, const struct iovec *, unsigned long, loff_t *);
+
+	compat_ssize_t tot_len;
+	struct iovec iovstack[UIO_FASTIOV];
+	struct iovec *iov=iovstack, *vector;
+	ssize_t ret;
+	int seg;
+	io_fn_t fn;
+	iov_fn_t fnv;
+	struct inode *inode;
+
+	/*
+	 * SuS says "The readv() function *may* fail if the iovcnt argument
+	 * was less than or equal to 0, or greater than {IOV_MAX}.  Linux has
+	 * traditionally returned zero for zero segments, so...
+	 */
+	ret = 0;
+	if (nr_segs == 0)
+		goto out;
+
+	/*
+	 * First get the "struct iovec" from user memory and
+	 * verify all the pointers
+	 */
+	ret = -EINVAL;
+	if ((nr_segs > UIO_MAXIOV) || (nr_segs <= 0))
+		goto out;
+	if (!file->f_op)
+		goto out;
+	if (nr_segs > UIO_FASTIOV) {
+		ret = -ENOMEM;
+		iov = kmalloc(nr_segs*sizeof(struct iovec), GFP_KERNEL);
+		if (!iov)
+			goto out;
+	}
+	ret = -EFAULT;
+	if (verify_area(VERIFY_READ, uvector, nr_segs*sizeof(*uvector)))
+		goto out;
+
+	/*
+	 * Single unix specification:
+	 * We should -EINVAL if an element length is not >= 0 and fitting an
+	 * ssize_t.  The total length is fitting an ssize_t
+	 *
+	 * Be careful here because iov_len is a size_t not an ssize_t
+	 */
+	tot_len = 0;
+	vector = iov;
+	ret = -EINVAL;
+	for (seg = 0 ; seg < nr_segs; seg++) {
+		compat_ssize_t tmp = tot_len;
+		compat_ssize_t len;
+		compat_uptr_t buf;
+
+		if (__get_user(len, &uvector->iov_len) ||
+		    __get_user(buf, &uvector->iov_base)) {
+			ret = -EFAULT;
+			goto out;
+		}
+		if (len < 0)	/* size_t not fitting an compat_ssize_t .. */
+			goto out;
+		tot_len += len;
+		if (tot_len < tmp) /* maths overflow on the compat_ssize_t */
+			goto out;
+		vector->iov_base = compat_ptr(buf);
+		vector->iov_len = (compat_size_t) len;
+		uvector++;
+		vector++;
+	}
+	if (tot_len == 0) {
+		ret = 0;
+		goto out;
+	}
+
+	inode = file->f_dentry->d_inode;
+	/* VERIFY_WRITE actually means a read, as we write to user space */
+	ret = locks_verify_area((type == READ
+				 ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
+				inode, file, *pos, tot_len);
+	if (ret)
+		goto out;
+
+	fnv = NULL;
+	if (type == READ) {
+		fn = file->f_op->read;
+		fnv = file->f_op->readv;
+	} else {
+		fn = (io_fn_t)file->f_op->write;
+		fnv = file->f_op->writev;
+	}
+	if (fnv) {
+		ret = fnv(file, iov, nr_segs, pos);
+		goto out;
+	}
+
+	/* Do it by hand, with file-ops */
+	ret = 0;
+	vector = iov;
+	while (nr_segs > 0) {
+		void __user * base;
+		size_t len;
+		ssize_t nr;
+
+		base = vector->iov_base;
+		len = vector->iov_len;
+		vector++;
+		nr_segs--;
+
+		nr = fn(file, base, len, pos);
+
+		if (nr < 0) {
+			if (!ret) ret = nr;
+			break;
+		}
+		ret += nr;
+		if (nr != len)
+			break;
+	}
+out:
+	if (iov != iovstack)
+		kfree(iov);
+	if ((ret + (type == READ)) > 0)
+		dnotify_parent(file->f_dentry,
+				(type == READ) ? DN_ACCESS : DN_MODIFY);
+	return ret;
+}
+
+asmlinkage ssize_t
+compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, unsigned long vlen)
+{
+	struct file *file;
+	ssize_t ret = -EBADF;
+
+	file = fget(fd);
+	if (!file)
+		return -EBADF;
+
+	if (!(file->f_mode & FMODE_READ))
+		goto out;
+
+	ret = -EINVAL;
+	if (!file->f_op || (!file->f_op->readv && !file->f_op->read))
+		goto out;
+
+	ret = compat_do_readv_writev(READ, file, vec, vlen, &file->f_pos);
+
+out:
+	fput(file);
+	return ret;
+}
+
+asmlinkage ssize_t
+compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec, unsigned long vlen)
+{
+	struct file *file;
+	ssize_t ret = -EBADF;
+
+	file = fget(fd);
+	if (!file)
+		return -EBADF;
+	if (!(file->f_mode & FMODE_WRITE))
+		goto out;
+
+	ret = -EINVAL;
+	if (!file->f_op || (!file->f_op->writev && !file->f_op->write))
+		goto out;
+
+	ret = compat_do_readv_writev(WRITE, file, vec, vlen, &file->f_pos);
+
+out:
+	fput(file);
+	return ret;
+}
+
+/*
+ * compat_count() counts the number of arguments/envelopes. It is basically
+ * a copy of count() from fs/exec.c, except that it works with 32 bit argv
+ * and envp pointers.
+ */
+static int compat_count(compat_uptr_t __user *argv, int max)
+{
+	int i = 0;
+
+	if (argv != NULL) {
+		for (;;) {
+			compat_uptr_t p;
+
+			if (get_user(p, argv))
+				return -EFAULT;
+			if (!p)
+				break;
+			argv++;
+			if(++i > max)
+				return -E2BIG;
+		}
+	}
+	return i;
+}
+
+/*
+ * compat_copy_strings() is basically a copy of copy_strings() from fs/exec.c
+ * except that it works with 32 bit argv and envp pointers.
+ */
+static int compat_copy_strings(int argc, compat_uptr_t __user *argv,
+				struct linux_binprm *bprm)
+{
+	struct page *kmapped_page = NULL;
+	char *kaddr = NULL;
+	int ret;
+
+	while (argc-- > 0) {
+		compat_uptr_t str;
+		int len;
+		unsigned long pos;
+
+		if (get_user(str, argv+argc) ||
+			!(len = strnlen_user(compat_ptr(str), bprm->p))) {
+			ret = -EFAULT;
+			goto out;
+		}
+
+		if (bprm->p < len)  {
+			ret = -E2BIG;
+			goto out;
+		}
+
+		bprm->p -= len;
+		/* XXX: add architecture specific overflow check here. */
+		pos = bprm->p;
+
+		while (len > 0) {
+			int i, new, err;
+			int offset, bytes_to_copy;
+			struct page *page;
+
+			offset = pos % PAGE_SIZE;
+			i = pos/PAGE_SIZE;
+			page = bprm->page[i];
+			new = 0;
+			if (!page) {
+				page = alloc_page(GFP_HIGHUSER);
+				bprm->page[i] = page;
+				if (!page) {
+					ret = -ENOMEM;
+					goto out;
+				}
+				new = 1;
+			}
+
+			if (page != kmapped_page) {
+				if (kmapped_page)
+					kunmap(kmapped_page);
+				kmapped_page = page;
+				kaddr = kmap(kmapped_page);
+			}
+			if (new && offset)
+				memset(kaddr, 0, offset);
+			bytes_to_copy = PAGE_SIZE - offset;
+			if (bytes_to_copy > len) {
+				bytes_to_copy = len;
+				if (new)
+					memset(kaddr+offset+len, 0,
+						PAGE_SIZE-offset-len);
+			}
+			err = copy_from_user(kaddr+offset, compat_ptr(str),
+						bytes_to_copy);
+			if (err) {
+				ret = -EFAULT;
+				goto out;
+			}
+
+			pos += bytes_to_copy;
+			str += bytes_to_copy;
+			len -= bytes_to_copy;
+		}
+	}
+	ret = 0;
+out:
+	if (kmapped_page)
+		kunmap(kmapped_page);
+	return ret;
+}
+
+#ifdef CONFIG_MMU
+
+#define free_arg_pages(bprm) do { } while (0)
+
+#else
+
+static inline void free_arg_pages(struct linux_binprm *bprm)
+{
+	int i;
+
+	for (i = 0; i < MAX_ARG_PAGES; i++) {
+		if (bprm->page[i])
+			__free_page(bprm->page[i]);
+		bprm->page[i] = NULL;
+	}
+}
+
+#endif /* CONFIG_MMU */
+
+/*
+ * compat_do_execve() is mostly a copy of do_execve(), with the exception
+ * that it processes 32 bit argv and envp pointers.
+ */
+int compat_do_execve(char * filename,
+	compat_uptr_t __user *argv,
+	compat_uptr_t __user *envp,
+	struct pt_regs * regs)
+{
+	struct linux_binprm bprm;
+	struct file *file;
+	int retval;
+	int i;
+
+	sched_balance_exec();
+
+	file = open_exec(filename);
+
+	retval = PTR_ERR(file);
+	if (IS_ERR(file))
+		return retval;
+
+	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
+	memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
+
+	bprm.file = file;
+	bprm.filename = filename;
+	bprm.interp = filename;
+	bprm.sh_bang = 0;
+	bprm.loader = 0;
+	bprm.exec = 0;
+	bprm.security = NULL;
+	bprm.mm = mm_alloc();
+	retval = -ENOMEM;
+	if (!bprm.mm)
+		goto out_file;
+
+	retval = init_new_context(current, bprm.mm);
+	if (retval < 0)
+		goto out_mm;
+
+	bprm.argc = compat_count(argv, bprm.p / sizeof(compat_uptr_t));
+	if ((retval = bprm.argc) < 0)
+		goto out_mm;
+
+	bprm.envc = compat_count(envp, bprm.p / sizeof(compat_uptr_t));
+	if ((retval = bprm.envc) < 0)
+		goto out_mm;
+
+	retval = security_bprm_alloc(&bprm);
+	if (retval)
+		goto out;
+
+	retval = prepare_binprm(&bprm);
+	if (retval < 0)
+		goto out;
+
+	retval = copy_strings_kernel(1, &bprm.filename, &bprm);
+	if (retval < 0)
+		goto out;
+
+	bprm.exec = bprm.p;
+	retval = compat_copy_strings(bprm.envc, envp, &bprm);
+	if (retval < 0)
+		goto out;
+
+	retval = compat_copy_strings(bprm.argc, argv, &bprm);
+	if (retval < 0)
+		goto out;
+
+	retval = search_binary_handler(&bprm,regs);
+	if (retval >= 0) {
+		free_arg_pages(&bprm);
+
+		/* execve success */
+		security_bprm_free(&bprm);
+		return retval;
+	}
+
+out:
+	/* Something went wrong, return the inode and free the argument pages*/
+	for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
+		struct page * page = bprm.page[i];
+		if (page)
+			__free_page(page);
+	}
+
+	if (bprm.security)
+		security_bprm_free(&bprm);
+
+out_mm:
+	if (bprm.mm)
+		mmdrop(bprm.mm);
+
+out_file:
+	if (bprm.file) {
+		allow_write_access(bprm.file);
+		fput(bprm.file);
+	}
+
+	return retval;
+}
+
+#define __COMPAT_NFDBITS       (8 * sizeof(compat_ulong_t))
+
+#define ROUND_UP(x,y) (((x)+(y)-1)/(y))
+
+/*
+ * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
+ * 64-bit unsigned longs.
+ */
+static inline
+int compat_get_fd_set(unsigned long nr, compat_ulong_t __user *ufdset,
+			unsigned long *fdset)
+{
+	nr = ROUND_UP(nr, __COMPAT_NFDBITS);
+	if (ufdset) {
+		unsigned long odd;
+
+		if (verify_area(VERIFY_WRITE, ufdset, nr*sizeof(compat_ulong_t)))
+			return -EFAULT;
+
+		odd = nr & 1UL;
+		nr &= ~1UL;
+		while (nr) {
+			unsigned long h, l;
+			__get_user(l, ufdset);
+			__get_user(h, ufdset+1);
+			ufdset += 2;
+			*fdset++ = h << 32 | l;
+			nr -= 2;
+		}
+		if (odd)
+			__get_user(*fdset, ufdset);
+	} else {
+		/* Tricky, must clear full unsigned long in the
+		 * kernel fdset at the end, this makes sure that
+		 * actually happens.
+		 */
+		memset(fdset, 0, ((nr + 1) & ~1)*sizeof(compat_ulong_t));
+	}
+	return 0;
+}
+
+static inline
+void compat_set_fd_set(unsigned long nr, compat_ulong_t __user *ufdset,
+			unsigned long *fdset)
+{
+	unsigned long odd;
+	nr = ROUND_UP(nr, __COMPAT_NFDBITS);
+
+	if (!ufdset)
+		return;
+
+	odd = nr & 1UL;
+	nr &= ~1UL;
+	while (nr) {
+		unsigned long h, l;
+		l = *fdset++;
+		h = l >> 32;
+		__put_user(l, ufdset);
+		__put_user(h, ufdset+1);
+		ufdset += 2;
+		nr -= 2;
+	}
+	if (odd)
+		__put_user(*fdset, ufdset);
+}
+
+
+/*
+ * This is a virtual copy of sys_select from fs/select.c and probably
+ * should be compared to it from time to time
+ */
+static void *select_bits_alloc(int size)
+{
+	return kmalloc(6 * size, GFP_KERNEL);
+}
+
+static void select_bits_free(void *bits, int size)
+{
+	kfree(bits);
+}
+
+/*
+ * We can actually return ERESTARTSYS instead of EINTR, but I'd
+ * like to be certain this leads to no problems. So I return
+ * EINTR just for safety.
+ *
+ * Update: ERESTARTSYS breaks at least the xview clock binary, so
+ * I'm trying ERESTARTNOHAND which restart only when you want to.
+ */
+#define MAX_SELECT_SECONDS \
+	((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
+
+asmlinkage long
+compat_sys_select(int n, compat_ulong_t __user *inp, compat_ulong_t __user *outp,
+		compat_ulong_t __user *exp, struct compat_timeval __user *tvp)
+{
+	fd_set_bits fds;
+	char *bits;
+	long timeout;
+	int ret, size, max_fdset;
+
+	timeout = MAX_SCHEDULE_TIMEOUT;
+	if (tvp) {
+		time_t sec, usec;
+
+		if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
+		    || (ret = __get_user(sec, &tvp->tv_sec))
+		    || (ret = __get_user(usec, &tvp->tv_usec)))
+			goto out_nofds;
+
+		ret = -EINVAL;
+		if (sec < 0 || usec < 0)
+			goto out_nofds;
+
+		if ((unsigned long) sec < MAX_SELECT_SECONDS) {
+			timeout = ROUND_UP(usec, 1000000/HZ);
+			timeout += sec * (unsigned long) HZ;
+		}
+	}
+
+	ret = -EINVAL;
+	if (n < 0)
+		goto out_nofds;
+
+	/* max_fdset can increase, so grab it once to avoid race */
+	max_fdset = current->files->max_fdset;
+	if (n > max_fdset)
+		n = max_fdset;
+
+	/*
+	 * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
+	 * since we used fdset we need to allocate memory in units of
+	 * long-words.
+	 */
+	ret = -ENOMEM;
+	size = FDS_BYTES(n);
+	bits = select_bits_alloc(size);
+	if (!bits)
+		goto out_nofds;
+	fds.in      = (unsigned long *)  bits;
+	fds.out     = (unsigned long *) (bits +   size);
+	fds.ex      = (unsigned long *) (bits + 2*size);
+	fds.res_in  = (unsigned long *) (bits + 3*size);
+	fds.res_out = (unsigned long *) (bits + 4*size);
+	fds.res_ex  = (unsigned long *) (bits + 5*size);
+
+	if ((ret = compat_get_fd_set(n, inp, fds.in)) ||
+	    (ret = compat_get_fd_set(n, outp, fds.out)) ||
+	    (ret = compat_get_fd_set(n, exp, fds.ex)))
+		goto out;
+	zero_fd_set(n, fds.res_in);
+	zero_fd_set(n, fds.res_out);
+	zero_fd_set(n, fds.res_ex);
+
+	ret = do_select(n, &fds, &timeout);
+
+	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
+		time_t sec = 0, usec = 0;
+		if (timeout) {
+			sec = timeout / HZ;
+			usec = timeout % HZ;
+			usec *= (1000000/HZ);
+		}
+		if (put_user(sec, &tvp->tv_sec) ||
+		    put_user(usec, &tvp->tv_usec))
+			ret = -EFAULT;
+	}
+
+	if (ret < 0)
+		goto out;
+	if (!ret) {
+		ret = -ERESTARTNOHAND;
+		if (signal_pending(current))
+			goto out;
+		ret = 0;
+	}
+
+	compat_set_fd_set(n, inp, fds.res_in);
+	compat_set_fd_set(n, outp, fds.res_out);
+	compat_set_fd_set(n, exp, fds.res_ex);
+
+out:
+	select_bits_free(bits, size);
+out_nofds:
+	return ret;
+}
+
+#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)
+/* Stuff for NFS server syscalls... */
+struct compat_nfsctl_svc {
+	u16			svc32_port;
+	s32			svc32_nthreads;
+};
+
+struct compat_nfsctl_client {
+	s8			cl32_ident[NFSCLNT_IDMAX+1];
+	s32			cl32_naddr;
+	struct in_addr		cl32_addrlist[NFSCLNT_ADDRMAX];
+	s32			cl32_fhkeytype;
+	s32			cl32_fhkeylen;
+	u8			cl32_fhkey[NFSCLNT_KEYMAX];
+};
+
+struct compat_nfsctl_export {
+	char		ex32_client[NFSCLNT_IDMAX+1];
+	char		ex32_path[NFS_MAXPATHLEN+1];
+	compat_dev_t	ex32_dev;
+	compat_ino_t	ex32_ino;
+	compat_int_t	ex32_flags;
+	compat_uid_t	ex32_anon_uid;
+	compat_gid_t	ex32_anon_gid;
+};
+
+struct compat_nfsctl_fdparm {
+	struct sockaddr		gd32_addr;
+	s8			gd32_path[NFS_MAXPATHLEN+1];
+	compat_int_t		gd32_version;
+};
+
+struct compat_nfsctl_fsparm {
+	struct sockaddr		gd32_addr;
+	s8			gd32_path[NFS_MAXPATHLEN+1];
+	compat_int_t		gd32_maxlen;
+};
+
+struct compat_nfsctl_arg {
+	compat_int_t		ca32_version;	/* safeguard */
+	union {
+		struct compat_nfsctl_svc	u32_svc;
+		struct compat_nfsctl_client	u32_client;
+		struct compat_nfsctl_export	u32_export;
+		struct compat_nfsctl_fdparm	u32_getfd;
+		struct compat_nfsctl_fsparm	u32_getfs;
+	} u;
+#define ca32_svc	u.u32_svc
+#define ca32_client	u.u32_client
+#define ca32_export	u.u32_export
+#define ca32_getfd	u.u32_getfd
+#define ca32_getfs	u.u32_getfs
+};
+
+union compat_nfsctl_res {
+	__u8			cr32_getfh[NFS_FHSIZE];
+	struct knfsd_fh		cr32_getfs;
+};
+
+static int compat_nfs_svc_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg)
+{
+	int err;
+
+	err = access_ok(VERIFY_READ, &arg->ca32_svc, sizeof(arg->ca32_svc));
+	err |= get_user(karg->ca_version, &arg->ca32_version);
+	err |= __get_user(karg->ca_svc.svc_port, &arg->ca32_svc.svc32_port);
+	err |= __get_user(karg->ca_svc.svc_nthreads, &arg->ca32_svc.svc32_nthreads);
+	return (err) ? -EFAULT : 0;
+}
+
+static int compat_nfs_clnt_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg)
+{
+	int err;
+
+	err = access_ok(VERIFY_READ, &arg->ca32_client, sizeof(arg->ca32_client));
+	err |= get_user(karg->ca_version, &arg->ca32_version);
+	err |= __copy_from_user(&karg->ca_client.cl_ident[0],
+			  &arg->ca32_client.cl32_ident[0],
+			  NFSCLNT_IDMAX);
+	err |= __get_user(karg->ca_client.cl_naddr, &arg->ca32_client.cl32_naddr);
+	err |= __copy_from_user(&karg->ca_client.cl_addrlist[0],
+			  &arg->ca32_client.cl32_addrlist[0],
+			  (sizeof(struct in_addr) * NFSCLNT_ADDRMAX));
+	err |= __get_user(karg->ca_client.cl_fhkeytype,
+		      &arg->ca32_client.cl32_fhkeytype);
+	err |= __get_user(karg->ca_client.cl_fhkeylen,
+		      &arg->ca32_client.cl32_fhkeylen);
+	err |= __copy_from_user(&karg->ca_client.cl_fhkey[0],
+			  &arg->ca32_client.cl32_fhkey[0],
+			  NFSCLNT_KEYMAX);
+
+	return (err) ? -EFAULT : 0;
+}
+
+static int compat_nfs_exp_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg)
+{
+	int err;
+
+	err = access_ok(VERIFY_READ, &arg->ca32_export, sizeof(arg->ca32_export));
+	err |= get_user(karg->ca_version, &arg->ca32_version);
+	err |= __copy_from_user(&karg->ca_export.ex_client[0],
+			  &arg->ca32_export.ex32_client[0],
+			  NFSCLNT_IDMAX);
+	err |= __copy_from_user(&karg->ca_export.ex_path[0],
+			  &arg->ca32_export.ex32_path[0],
+			  NFS_MAXPATHLEN);
+	err |= __get_user(karg->ca_export.ex_dev,
+		      &arg->ca32_export.ex32_dev);
+	err |= __get_user(karg->ca_export.ex_ino,
+		      &arg->ca32_export.ex32_ino);
+	err |= __get_user(karg->ca_export.ex_flags,
+		      &arg->ca32_export.ex32_flags);
+	err |= __get_user(karg->ca_export.ex_anon_uid,
+		      &arg->ca32_export.ex32_anon_uid);
+	err |= __get_user(karg->ca_export.ex_anon_gid,
+		      &arg->ca32_export.ex32_anon_gid);
+	SET_UID(karg->ca_export.ex_anon_uid, karg->ca_export.ex_anon_uid);
+	SET_GID(karg->ca_export.ex_anon_gid, karg->ca_export.ex_anon_gid);
+
+	return (err) ? -EFAULT : 0;
+}
+
+static int compat_nfs_getfd_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg)
+{
+	int err;
+
+	err = access_ok(VERIFY_READ, &arg->ca32_getfd, sizeof(arg->ca32_getfd));
+	err |= get_user(karg->ca_version, &arg->ca32_version);
+	err |= __copy_from_user(&karg->ca_getfd.gd_addr,
+			  &arg->ca32_getfd.gd32_addr,
+			  (sizeof(struct sockaddr)));
+	err |= __copy_from_user(&karg->ca_getfd.gd_path,
+			  &arg->ca32_getfd.gd32_path,
+			  (NFS_MAXPATHLEN+1));
+	err |= __get_user(karg->ca_getfd.gd_version,
+		      &arg->ca32_getfd.gd32_version);
+
+	return (err) ? -EFAULT : 0;
+}
+
+static int compat_nfs_getfs_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg)
+{
+	int err;
+
+	err = access_ok(VERIFY_READ, &arg->ca32_getfs, sizeof(arg->ca32_getfs));
+	err |= get_user(karg->ca_version, &arg->ca32_version);
+	err |= __copy_from_user(&karg->ca_getfs.gd_addr,
+			  &arg->ca32_getfs.gd32_addr,
+			  (sizeof(struct sockaddr)));
+	err |= __copy_from_user(&karg->ca_getfs.gd_path,
+			  &arg->ca32_getfs.gd32_path,
+			  (NFS_MAXPATHLEN+1));
+	err |= __get_user(karg->ca_getfs.gd_maxlen,
+		      &arg->ca32_getfs.gd32_maxlen);
+
+	return (err) ? -EFAULT : 0;
+}
+
+/* This really doesn't need translations, we are only passing
+ * back a union which contains opaque nfs file handle data.
+ */
+static int compat_nfs_getfh_res_trans(union nfsctl_res *kres, union compat_nfsctl_res __user *res)
+{
+	int err;
+
+	err = copy_to_user(res, kres, sizeof(*res));
+
+	return (err) ? -EFAULT : 0;
+}
+
+asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *arg,
+					union compat_nfsctl_res __user *res)
+{
+	struct nfsctl_arg *karg;
+	union nfsctl_res *kres;
+	mm_segment_t oldfs;
+	int err;
+
+	karg = kmalloc(sizeof(*karg), GFP_USER);
+	kres = kmalloc(sizeof(*kres), GFP_USER);
+	if(!karg || !kres) {
+		err = -ENOMEM;
+		goto done;
+	}
+
+	switch(cmd) {
+	case NFSCTL_SVC:
+		err = compat_nfs_svc_trans(karg, arg);
+		break;
+
+	case NFSCTL_ADDCLIENT:
+		err = compat_nfs_clnt_trans(karg, arg);
+		break;
+
+	case NFSCTL_DELCLIENT:
+		err = compat_nfs_clnt_trans(karg, arg);
+		break;
+
+	case NFSCTL_EXPORT:
+	case NFSCTL_UNEXPORT:
+		err = compat_nfs_exp_trans(karg, arg);
+		break;
+
+	case NFSCTL_GETFD:
+		err = compat_nfs_getfd_trans(karg, arg);
+		break;
+
+	case NFSCTL_GETFS:
+		err = compat_nfs_getfs_trans(karg, arg);
+		break;
+
+	default:
+		err = -EINVAL;
+		goto done;
+	}
+
+	oldfs = get_fs();
+	set_fs(KERNEL_DS);
+	/* The __user pointer casts are valid because of the set_fs() */
+	err = sys_nfsservctl(cmd, (void __user *) karg, (void __user *) kres);
+	set_fs(oldfs);
+
+	if (err)
+		goto done;
+
+	if((cmd == NFSCTL_GETFD) ||
+	   (cmd == NFSCTL_GETFS))
+		err = compat_nfs_getfh_res_trans(kres, res);
+
+done:
+	kfree(karg);
+	kfree(kres);
+	return err;
+}
+#else /* !NFSD */
+long asmlinkage compat_sys_nfsservctl(int cmd, void *notused, void *notused2)
+{
+	return sys_ni_syscall();
+}
+#endif
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 56ef9138e..fc3fb9f14 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -20,6 +20,7 @@
 #include <linux/smp_lock.h>
 #include <linux/ioctl.h>
 #include <linux/if.h>
+#include <linux/if_bridge.h>
 #include <linux/slab.h>
 #include <linux/hdreg.h>
 #include <linux/raid/md.h>
@@ -134,7 +135,7 @@ static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 	set_fs (KERNEL_DS);
 	err = sys_ioctl(fd, cmd, (unsigned long)&val);
 	set_fs (old_fs);
-	if (!err && put_user(val, (u32 *)compat_ptr(arg)))
+	if (!err && put_user(val, (u32 __user *)compat_ptr(arg)))
 		return -EFAULT;
 	return err;
 }
@@ -142,7 +143,7 @@ static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 static int rw_long(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
-	u32 *argptr = compat_ptr(arg);
+	u32 __user *argptr = compat_ptr(arg);
 	int err;
 	unsigned long val;
 	
@@ -176,7 +177,7 @@ struct video_tuner32 {
 	u16 mode, signal;
 };
 
-static int get_video_tuner32(struct video_tuner *kp, struct video_tuner32 *up)
+static int get_video_tuner32(struct video_tuner *kp, struct video_tuner32 __user *up)
 {
 	int i;
 
@@ -192,7 +193,7 @@ static int get_video_tuner32(struct video_tuner *kp, struct video_tuner32 *up)
 	return 0;
 }
 
-static int put_video_tuner32(struct video_tuner *kp, struct video_tuner32 *up)
+static int put_video_tuner32(struct video_tuner *kp, struct video_tuner32 __user *up)
 {
 	int i;
 
@@ -213,13 +214,18 @@ struct video_buffer32 {
 	compat_int_t height, width, depth, bytesperline;
 };
 
-static int get_video_buffer32(struct video_buffer *kp, struct video_buffer32 *up)
+static int get_video_buffer32(struct video_buffer *kp, struct video_buffer32 __user *up)
 {
 	u32 tmp;
 
-	if(get_user(tmp, &up->base))
+	if (get_user(tmp, &up->base))
 		return -EFAULT;
-	kp->base = compat_ptr(tmp);
+
+	/* This is actually a physical address stored
+	 * as a void pointer.
+	 */
+	kp->base = (void *)(unsigned long) tmp;
+
 	__get_user(kp->height, &up->height);
 	__get_user(kp->width, &up->width);
 	__get_user(kp->depth, &up->depth);
@@ -227,7 +233,7 @@ static int get_video_buffer32(struct video_buffer *kp, struct video_buffer32 *up
 	return 0;
 }
 
-static int put_video_buffer32(struct video_buffer *kp, struct video_buffer32 *up)
+static int put_video_buffer32(struct video_buffer *kp, struct video_buffer32 __user *up)
 {
 	u32 tmp = (u32)((unsigned long)kp->base);
 
@@ -260,9 +266,9 @@ static void free_kvideo_clips(struct video_window *kp)
 		kfree(cp);
 }
 
-static int get_video_window32(struct video_window *kp, struct video_window32 *up)
+static int get_video_window32(struct video_window *kp, struct video_window32 __user *up)
 {
-	struct video_clip32 *ucp;
+	struct video_clip32 __user *ucp;
 	struct video_clip *kcp;
 	int nclips, err, i;
 	u32 tmp;
@@ -312,7 +318,7 @@ cleanup_and_err:
 }
 
 /* You get back everything except the clips... */
-static int put_video_window32(struct video_window *kp, struct video_window32 *up)
+static int put_video_window32(struct video_window *kp, struct video_window32 __user *up)
 {
 	if(put_user(kp->x, &up->x))
 		return -EFAULT;
@@ -343,7 +349,7 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 		unsigned long vx;
 	} karg;
 	mm_segment_t old_fs = get_fs();
-	void *up = compat_ptr(arg);
+	void __user *up = compat_ptr(arg);
 	int err = 0;
 
 	/* First, convert the command. */
@@ -373,7 +379,7 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 		break;
 
 	case VIDIOCSFREQ:
-		err = get_user(karg.vx, (u32 *)up);
+		err = get_user(karg.vx, (u32 __user *)up);
 		break;
 	};
 	if(err)
@@ -401,7 +407,7 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 			break;
 
 		case VIDIOCGFREQ:
-			err = put_user(((u32)karg.vx), (u32 *)up);
+			err = put_user(((u32)karg.vx), (u32 __user *)up);
 			break;
 		};
 	}
@@ -411,7 +417,7 @@ out:
 
 static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct compat_timeval *up = compat_ptr(arg);
+	struct compat_timeval __user *up = compat_ptr(arg);
 	struct timeval ktv;
 	mm_segment_t old_fs = get_fs();
 	int err;
@@ -489,83 +495,79 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct ifconf32 ifc32;
 	struct ifconf ifc;
-	struct ifreq32 *ifr32;
-	struct ifreq *ifr;
-	mm_segment_t old_fs;
+	struct ifconf __user *uifc;
+	struct ifreq32 __user *ifr32;
+	struct ifreq __user *ifr;
 	unsigned int i, j;
 	int err;
 
 	if (copy_from_user(&ifc32, compat_ptr(arg), sizeof(struct ifconf32)))
 		return -EFAULT;
 
-	if(ifc32.ifcbuf == 0) {
+	if (ifc32.ifcbuf == 0) {
 		ifc32.ifc_len = 0;
 		ifc.ifc_len = 0;
-		ifc.ifc_buf = NULL;
+		ifc.ifc_req = NULL;
+		uifc = compat_alloc_user_space(sizeof(struct ifconf));
 	} else {
-		ifc.ifc_len = ((ifc32.ifc_len / sizeof (struct ifreq32)) + 1) *
+		size_t len =((ifc32.ifc_len / sizeof (struct ifreq32)) + 1) *
 			sizeof (struct ifreq);
-		/* should the size be limited? -arnd */
-		ifc.ifc_buf = kmalloc (ifc.ifc_len, GFP_KERNEL);
-		if (!ifc.ifc_buf)
-			return -ENOMEM;
+		uifc = compat_alloc_user_space(sizeof(struct ifconf) + len);
+		ifc.ifc_len = len;
+		ifr = ifc.ifc_req = (void __user *)(uifc + 1);
+		ifr32 = compat_ptr(ifc32.ifcbuf);
+		for (i = 0; i < ifc32.ifc_len; i += sizeof (struct ifreq32)) {
+			if (copy_in_user(ifr, ifr32, sizeof(struct ifreq32)))
+				return -EFAULT;
+			ifr++;
+			ifr32++; 
+		}
 	}
+	if (copy_to_user(uifc, &ifc, sizeof(struct ifconf)))
+		return -EFAULT;
+
+	err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)uifc);	
+	if (err)
+		return err;
+
+	if (copy_from_user(&ifc, uifc, sizeof(struct ifconf))) 
+		return -EFAULT;
+
 	ifr = ifc.ifc_req;
 	ifr32 = compat_ptr(ifc32.ifcbuf);
-	for (i = 0; i < ifc32.ifc_len; i += sizeof (struct ifreq32)) {
-		if (copy_from_user(ifr, ifr32, sizeof (struct ifreq32))) {
-			kfree (ifc.ifc_buf);
+	for (i = 0, j = 0; i < ifc32.ifc_len && j < ifc.ifc_len;
+	     i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) {
+		if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32)))
 			return -EFAULT;
-		}
+		ifr32++;
 		ifr++;
-		ifr32++; 
 	}
-	old_fs = get_fs(); set_fs (KERNEL_DS);
-	err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)&ifc);	
-	set_fs (old_fs);
-	if (!err) {
-		ifr = ifc.ifc_req;
-		ifr32 = compat_ptr(ifc32.ifcbuf);
-		for (i = 0, j = 0; i < ifc32.ifc_len && j < ifc.ifc_len;
-		     i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) {
-			int k = copy_to_user(ifr32, ifr, sizeof (struct ifreq32));
-			ifr32++;
-			ifr++;
-			if (k) {
-				err = -EFAULT;
-				break;
-			}
-		       
-		}
-		if (!err) {
-			if (ifc32.ifcbuf == 0) {
-				/* Translate from 64-bit structure multiple to
-				 * a 32-bit one.
-				 */
-				i = ifc.ifc_len;
-				i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32));
-				ifc32.ifc_len = i;
-			} else {
-				if (i <= ifc32.ifc_len)
-					ifc32.ifc_len = i;
-				else
-					ifc32.ifc_len = i - sizeof (struct ifreq32);
-			}
-			if (copy_to_user(compat_ptr(arg), &ifc32, sizeof(struct ifconf32)))
-				err = -EFAULT;
-		}
+
+	if (ifc32.ifcbuf == 0) {
+		/* Translate from 64-bit structure multiple to
+		 * a 32-bit one.
+		 */
+		i = ifc.ifc_len;
+		i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32));
+		ifc32.ifc_len = i;
+	} else {
+		if (i <= ifc32.ifc_len)
+			ifc32.ifc_len = i;
+		else
+			ifc32.ifc_len = i - sizeof (struct ifreq32);
 	}
-	if(ifc.ifc_buf != NULL)
-		kfree (ifc.ifc_buf);
-	return err;
+	if (copy_to_user(compat_ptr(arg), &ifc32, sizeof(struct ifconf32)))
+		return -EFAULT;
+
+	return 0;
 }
 
 static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct ifreq *ifr;
-	struct ifreq32 *ifr32;
+	struct ifreq __user *ifr;
+	struct ifreq32 __user *ifr32;
 	u32 data;
-	void *datap;
+	void __user *datap;
 	
 	ifr = compat_alloc_user_space(sizeof(*ifr));
 	ifr32 = compat_ptr(arg);
@@ -586,12 +588,12 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 static int bond_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct ifreq kifr;
-	struct ifreq *uifr;
-	struct ifreq32 *ifr32 = compat_ptr(arg);
+	struct ifreq __user *uifr;
+	struct ifreq32 __user *ifr32 = compat_ptr(arg);
 	mm_segment_t old_fs;
 	int err;
 	u32 data;
-	void *datap;
+	void __user *datap;
 
 	switch (cmd) {
 	case SIOCBONDENSLAVE:
@@ -628,10 +630,10 @@ static int bond_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 
 int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct ifreq *u_ifreq64;
-	struct ifreq32 *u_ifreq32 = compat_ptr(arg);
+	struct ifreq __user *u_ifreq64;
+	struct ifreq32 __user *u_ifreq32 = compat_ptr(arg);
 	char tmp_buf[IFNAMSIZ];
-	void *data64;
+	void __user *data64;
 	u32 data32;
 
 	if (copy_from_user(&tmp_buf[0], &(u_ifreq32->ifr_ifrn.ifrn_name[0]),
@@ -655,8 +657,8 @@ int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	struct ifreq ifr;
-	struct ifreq32 *uifr32;
-	struct ifmap32 *uifmap32;
+	struct ifreq32 __user *uifr32;
+	struct ifmap32 __user *uifmap32;
 	mm_segment_t old_fs;
 	int err;
 	
@@ -760,7 +762,7 @@ static int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 	struct socket *mysock = sockfd_lookup(fd, &ret);
 
 	if (mysock && mysock->sk && mysock->sk->sk_family == AF_INET6) { /* ipv6 */
-		struct in6_rtmsg32 *ur6 = compat_ptr(arg);
+		struct in6_rtmsg32 __user *ur6 = compat_ptr(arg);
 		ret = copy_from_user (&r6.rtmsg_dst, &(ur6->rtmsg_dst),
 			3 * sizeof(struct in6_addr));
 		ret |= __get_user (r6.rtmsg_type, &(ur6->rtmsg_type));
@@ -773,7 +775,7 @@ static int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 		
 		r = (void *) &r6;
 	} else { /* ipv4 */
-		struct rtentry32 *ur4 = compat_ptr(arg);
+		struct rtentry32 __user *ur4 = compat_ptr(arg);
 		ret = copy_from_user (&r4.rt_dst, &(ur4->rt_dst),
 					3 * sizeof(struct sockaddr));
 		ret |= __get_user (r4.rt_flags, &(ur4->rt_flags));
@@ -815,7 +817,7 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
 	struct hd_geometry geo;
-	struct hd_geometry32 *ugeo;
+	struct hd_geometry32 __user *ugeo;
 	int err;
 	
 	set_fs (KERNEL_DS);
@@ -855,23 +857,11 @@ struct fb_cmap32 {
 	compat_caddr_t	transp;
 };
 
-static int do_cmap_ptr(__u16 **ptr64, __u32 *ptr32)
-{
-	__u32 data;
-	void *datap;
-
-	if (get_user(data, ptr32))
-		return -EFAULT;
-	datap = compat_ptr(data);
-	if (put_user(datap, ptr64))
-		return -EFAULT;
-	return 0;
-}
-
 static int fb_getput_cmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct fb_cmap *cmap;
-	struct fb_cmap32 *cmap32;
+	struct fb_cmap __user *cmap;
+	struct fb_cmap32 __user *cmap32;
+	__u32 data;
 	int err;
 
 	cmap = compat_alloc_user_space(sizeof(*cmap));
@@ -880,10 +870,14 @@ static int fb_getput_cmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 	if (copy_in_user(&cmap->start, &cmap32->start, 2 * sizeof(__u32)))
 		return -EFAULT;
 
-	if (do_cmap_ptr(&cmap->red, &cmap32->red) ||
-	    do_cmap_ptr(&cmap->green, &cmap32->green) ||
-	    do_cmap_ptr(&cmap->blue, &cmap32->blue) ||
-	    do_cmap_ptr(&cmap->transp, &cmap32->transp))
+	if (get_user(data, &cmap32->red) ||
+	    put_user(compat_ptr(data), &cmap->red) ||
+	    get_user(data, &cmap32->green) ||
+	    put_user(compat_ptr(data), &cmap->green) ||
+	    get_user(data, &cmap32->blue) ||
+	    put_user(compat_ptr(data), &cmap->blue) ||
+	    get_user(data, &cmap32->transp) ||
+	    put_user(compat_ptr(data), &cmap->transp))
 		return -EFAULT;
 
 	err = sys_ioctl(fd, cmd, (unsigned long) cmap);
@@ -898,7 +892,7 @@ static int fb_getput_cmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 }
 
 static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix,
-				  struct fb_fix_screeninfo32 *fix32)
+				  struct fb_fix_screeninfo32 __user *fix32)
 {
 	__u32 data;
 	int err;
@@ -932,7 +926,7 @@ static int fb_get_fscreeninfo(unsigned int fd, unsigned int cmd, unsigned long a
 {
 	mm_segment_t old_fs;
 	struct fb_fix_screeninfo fix;
-	struct fb_fix_screeninfo32 *fix32;
+	struct fb_fix_screeninfo32 __user *fix32;
 	int err;
 
 	fix32 = compat_ptr(arg);
@@ -981,7 +975,7 @@ static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg
 {
 	mm_segment_t old_fs = get_fs();
 	unsigned long kval;
-	unsigned int *uvp;
+	unsigned int __user *uvp;
 	int error;
 
 	set_fs(KERNEL_DS);
@@ -1028,10 +1022,10 @@ typedef struct sg_iovec32 {
 	compat_uint_t iov_len;
 } sg_iovec32_t;
 
-static int sg_build_iovec(sg_io_hdr_t *sgio, void *dxferp, u16 iovec_count)
+static int sg_build_iovec(sg_io_hdr_t __user *sgio, void __user *dxferp, u16 iovec_count)
 {
-	sg_iovec_t *iov = (sg_iovec_t *) (sgio + 1);
-	sg_iovec32_t *iov32 = dxferp;
+	sg_iovec_t __user *iov = (sg_iovec_t __user *) (sgio + 1);
+	sg_iovec32_t __user *iov32 = dxferp;
 	int i;
 
 	for (i = 0; i < iovec_count; i++) {
@@ -1044,17 +1038,18 @@ static int sg_build_iovec(sg_io_hdr_t *sgio, void *dxferp, u16 iovec_count)
 			return -EFAULT;
 	}
 
-	sgio->dxferp = iov; /* FIXME: dereferencing user pointer? */
+	if (put_user(iov, &sgio->dxferp))
+		return -EFAULT;
 	return 0;
 }
 
 static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	sg_io_hdr_t *sgio;
-	sg_io_hdr32_t *sgio32;
+	sg_io_hdr_t __user *sgio;
+	sg_io_hdr32_t __user *sgio32;
 	u16 iovec_count;
 	u32 data;
-	void *dxferp;
+	void __user *dxferp;
 	int err;
 
 	sgio32 = compat_ptr(arg);
@@ -1062,12 +1057,9 @@ static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		return -EFAULT;
 
 	{
-		void *new, *top;
-
-		top = compat_alloc_user_space(0);
-		new = compat_alloc_user_space(sizeof(sg_io_hdr_t) +
-				       (iovec_count *
-					sizeof(sg_iovec_t)));
+		void __user *top = compat_alloc_user_space(0);
+		void __user *new = compat_alloc_user_space(sizeof(sg_io_hdr_t) +
+				       (iovec_count * sizeof(sg_iovec_t)));
 		if (new > top)
 			return -EINVAL;
 
@@ -1094,7 +1086,8 @@ static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 	}
 
 	{
-		unsigned char *cmdp, *sbp;
+		unsigned char __user *cmdp;
+		unsigned char __user *sbp;
 
 		if (get_user(data, &sgio32->cmdp))
 			return -EFAULT;
@@ -1127,7 +1120,7 @@ static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 	err = sys_ioctl(fd, cmd, (unsigned long) sgio);
 
 	if (err >= 0) {
-		void *datap;
+		void __user *datap;
 
 		if (copy_in_user(&sgio32->pack_id, &sgio->pack_id,
 				 sizeof(int)) ||
@@ -1154,9 +1147,9 @@ struct sock_fprog32 {
 
 static int ppp_sock_fprog_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct sock_fprog32 *u_fprog32 = compat_ptr(arg);
-	struct sock_fprog *u_fprog64 = compat_alloc_user_space(sizeof(struct sock_fprog));
-	void *fptr64;
+	struct sock_fprog32 __user *u_fprog32 = compat_ptr(arg);
+	struct sock_fprog __user *u_fprog64 = compat_alloc_user_space(sizeof(struct sock_fprog));
+	void __user *fptr64;
 	u32 fptr32;
 	u16 flen;
 
@@ -1193,8 +1186,8 @@ struct ppp_idle32 {
 
 static int ppp_gidle(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct ppp_idle *idle;
-	struct ppp_idle32 *idle32;
+	struct ppp_idle __user *idle;
+	struct ppp_idle32 __user *idle32;
 	__kernel_time_t xmit, recv;
 	int err;
 
@@ -1215,10 +1208,10 @@ static int ppp_gidle(unsigned int fd, unsigned int cmd, unsigned long arg)
 
 static int ppp_scompress(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct ppp_option_data *odata;
-	struct ppp_option_data32 *odata32;
+	struct ppp_option_data __user *odata;
+	struct ppp_option_data32 __user *odata32;
 	__u32 data;
-	void *datap;
+	void __user *datap;
 
 	odata = compat_alloc_user_space(sizeof(*odata));
 	odata32 = compat_ptr(arg);
@@ -1310,11 +1303,11 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
 	struct mtconfiginfo info;
-	struct mtconfiginfo32 *uinfo32;
+	struct mtconfiginfo32 __user *uinfo32;
 	struct mtget get;
-	struct mtget32 *umget32;
+	struct mtget32 __user *umget32;
 	struct mtpos pos;
-	struct mtpos32 *upos32;
+	struct mtpos32 __user *upos32;
 	unsigned long kcmd;
 	void *karg;
 	int err = 0;
@@ -1344,7 +1337,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		err |= __get_user(info.debug, &uinfo32->debug);
 		err |= __copy_from_user((char *)&info.debug
 				     + sizeof(info.debug),
-				     (char *)&uinfo32->debug
+				     (char __user *)&uinfo32->debug
 				     + sizeof(uinfo32->debug), sizeof(__u32));
 		if (err)
 			return -EFAULT;
@@ -1387,7 +1380,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		err |= __put_user(info.dmanr, &uinfo32->dmanr);
 		err |= __put_user(info.port, &uinfo32->port);
 		err |= __put_user(info.debug, &uinfo32->debug);
-		err |= __copy_to_user((char *)&uinfo32->debug
+		err |= __copy_to_user((char __user *)&uinfo32->debug
 			    		   + sizeof(uinfo32->debug),
 					   (char *)&info.debug + sizeof(info.debug), sizeof(__u32));
 		break;
@@ -1418,10 +1411,10 @@ struct cdrom_generic_command32 {
   
 static int cdrom_do_read_audio(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct cdrom_read_audio *cdread_audio;
-	struct cdrom_read_audio32 *cdread_audio32;
+	struct cdrom_read_audio __user *cdread_audio;
+	struct cdrom_read_audio32 __user *cdread_audio32;
 	__u32 data;
-	void *datap;
+	void __user *datap;
 
 	cdread_audio = compat_alloc_user_space(sizeof(*cdread_audio));
 	cdread_audio32 = compat_ptr(arg);
@@ -1441,24 +1434,11 @@ static int cdrom_do_read_audio(unsigned int fd, unsigned int cmd, unsigned long
 	return sys_ioctl(fd, cmd, (unsigned long) cdread_audio);
 }
 
-static int __cgc_do_ptr(void **ptr64, __u32 *ptr32)
-{
-	u32 data;
-	void *datap;
-
-	if (get_user(data, ptr32))
-		return -EFAULT;
-	datap = compat_ptr(data);
-	if (put_user(datap, ptr64))
-		return -EFAULT;
-
-	return 0;
-}
-
 static int cdrom_do_generic_command(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct cdrom_generic_command *cgc;
-	struct cdrom_generic_command32 *cgc32;
+	struct cdrom_generic_command __user *cgc;
+	struct cdrom_generic_command32 __user *cgc32;
+	u32 data;
 	unsigned char dir;
 	int itmp;
 
@@ -1466,25 +1446,20 @@ static int cdrom_do_generic_command(unsigned int fd, unsigned int cmd, unsigned
 	cgc32 = compat_ptr(arg);
 
 	if (copy_in_user(&cgc->cmd, &cgc32->cmd, sizeof(cgc->cmd)) ||
-	    __cgc_do_ptr((void **) &cgc->buffer, &cgc32->buffer) ||
+	    get_user(data, &cgc32->buffer) ||
+	    put_user(compat_ptr(data), &cgc->buffer) ||
 	    copy_in_user(&cgc->buflen, &cgc32->buflen,
 			 (sizeof(unsigned int) + sizeof(int))) ||
-	    __cgc_do_ptr((void **) &cgc->sense, &cgc32->sense))
-		return -EFAULT;
-
-	if (get_user(dir, &cgc32->data_direction) ||
-	    put_user(dir, &cgc->data_direction))
-		return -EFAULT;
-
-	if (get_user(itmp, &cgc32->quiet) ||
-	    put_user(itmp, &cgc->quiet))
-		return -EFAULT;
-
-	if (get_user(itmp, &cgc32->timeout) ||
-	    put_user(itmp, &cgc->timeout))
-		return -EFAULT;
-
-	if (__cgc_do_ptr(&cgc->reserved[0], &cgc32->reserved[0]))
+	    get_user(data, &cgc32->sense) ||
+	    put_user(compat_ptr(data), &cgc->sense) ||
+	    get_user(dir, &cgc32->data_direction) ||
+	    put_user(dir, &cgc->data_direction) ||
+	    get_user(itmp, &cgc32->quiet) ||
+	    put_user(itmp, &cgc->quiet) ||
+	    get_user(itmp, &cgc32->timeout) ||
+	    put_user(itmp, &cgc->timeout) ||
+	    get_user(data, &cgc32->reserved[0]) ||
+	    put_user(compat_ptr(data), &cgc->reserved[0]))
 		return -EFAULT;
 
 	return sys_ioctl(fd, cmd, (unsigned long) cgc);
@@ -1537,7 +1512,7 @@ static int loop_status(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
 	struct loop_info l;
-	struct loop_info32 *ul;
+	struct loop_info32 __user *ul;
 	int err = -EINVAL;
 
 	ul = compat_ptr(arg);
@@ -1619,19 +1594,14 @@ struct consolefontdesc32 {
 
 static int do_fontx_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
-	struct consolefontdesc cfdarg;
+	struct consolefontdesc32 __user *user_cfd = compat_ptr(arg);
 	struct console_font_op op;
-	struct consolefontdesc32 *user_cfd = compat_ptr(arg);
+	compat_caddr_t data;
 	int i, perm;
 
 	perm = vt_check(file);
 	if (perm < 0) return perm;
 	
-	if (copy_from_user(&cfdarg, user_cfd, sizeof(struct consolefontdesc32)))
-		return -EFAULT;
-	
-	cfdarg.chardata = compat_ptr(((struct consolefontdesc32 *)&cfdarg)->chardata);
- 	
 	switch (cmd) {
 	case PIO_FONTX:
 		if (!perm)
@@ -1639,26 +1609,30 @@ static int do_fontx_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
 		op.op = KD_FONT_OP_SET;
 		op.flags = 0;
 		op.width = 8;
-		op.height = cfdarg.charheight;
-		op.charcount = cfdarg.charcount;
-		op.data = cfdarg.chardata;
+		if (get_user(op.height, &user_cfd->charheight) ||
+		    get_user(op.charcount, &user_cfd->charcount) ||
+		    get_user(data, &user_cfd->chardata))
+			return -EFAULT;
+		op.data = compat_ptr(data);
 		return con_font_op(fg_console, &op);
 	case GIO_FONTX:
-		if (!cfdarg.chardata)
-			return 0;
 		op.op = KD_FONT_OP_GET;
 		op.flags = 0;
 		op.width = 8;
-		op.height = cfdarg.charheight;
-		op.charcount = cfdarg.charcount;
-		op.data = cfdarg.chardata;
+		if (get_user(op.height, &user_cfd->charheight) ||
+		    get_user(op.charcount, &user_cfd->charcount) ||
+		    get_user(data, &user_cfd->chardata))
+			return -EFAULT;
+		if (!data)
+			return 0;
+		op.data = compat_ptr(data);
 		i = con_font_op(fg_console, &op);
 		if (i)
 			return i;
-		cfdarg.charheight = op.height;
-		cfdarg.charcount = op.charcount;
-		((struct consolefontdesc32 *)&cfdarg)->chardata	= (unsigned long)cfdarg.chardata;
-		if (copy_to_user(user_cfd, &cfdarg, sizeof(struct consolefontdesc32)))
+		if (put_user(op.height, &user_cfd->charheight) ||
+		    put_user(op.charcount, &user_cfd->charcount) ||
+		    put_user((compat_caddr_t)(unsigned long)op.data,
+				&user_cfd->chardata))
 			return -EFAULT;
 		return 0;
 	}
@@ -1676,13 +1650,13 @@ struct console_font_op32 {
 static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
 	struct console_font_op op;
-	struct console_font_op32 *fontop = compat_ptr(arg);
+	struct console_font_op32 __user *fontop = compat_ptr(arg);
 	int perm = vt_check(file), i;
 	struct vt_struct *vt;
 	
 	if (perm < 0) return perm;
 	
-	if (copy_from_user(&op, (void *) fontop, sizeof(struct console_font_op32)))
+	if (copy_from_user(&op, fontop, sizeof(struct console_font_op32)))
 		return -EFAULT;
 	if (!perm && op.op != KD_FONT_OP_GET)
 		return -EPERM;
@@ -1692,7 +1666,7 @@ static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar
 	i = con_font_op(vt->vc_num, &op);
 	if (i) return i;
 	((struct console_font_op32 *)&op)->data = (unsigned long)op.data;
-	if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32)))
+	if (copy_to_user(fontop, &op, sizeof(struct console_font_op32)))
 		return -EFAULT;
 	return 0;
 }
@@ -1705,7 +1679,7 @@ struct unimapdesc32 {
 static int do_unimap_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file)
 {
 	struct unimapdesc32 tmp;
-	struct unimapdesc32 *user_ud = compat_ptr(arg);
+	struct unimapdesc32 __user *user_ud = compat_ptr(arg);
 	int perm = vt_check(file);
 	
 	if (perm < 0) return perm;
@@ -1736,7 +1710,7 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long a
 	set_fs(old_fs);
 
 	if (err >= 0)
-		err = put_user(kuid, (compat_uid_t *)compat_ptr(arg));
+		err = put_user(kuid, (compat_uid_t __user *)compat_ptr(arg));
 
 	return err;
 }
@@ -1798,10 +1772,10 @@ static struct {
 
 static int do_atm_iobuf(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct atm_iobuf   *iobuf;
-	struct atm_iobuf32 *iobuf32;
+	struct atm_iobuf   __user *iobuf;
+	struct atm_iobuf32 __user *iobuf32;
 	u32 data;
-	void *datap;
+	void __user *datap;
 	int len, err;
 
 	iobuf = compat_alloc_user_space(sizeof(*iobuf));
@@ -1828,10 +1802,10 @@ static int do_atm_iobuf(unsigned int fd, unsigned int cmd, unsigned long arg)
 
 static int do_atmif_sioc(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-        struct atmif_sioc   *sioc;
-	struct atmif_sioc32 *sioc32;
+        struct atmif_sioc   __user *sioc;
+	struct atmif_sioc32 __user *sioc32;
 	u32 data;
-	void *datap;
+	void __user *datap;
 	int err;
         
 	sioc = compat_alloc_user_space(sizeof(*sioc));
@@ -1926,39 +1900,24 @@ struct blkpg_ioctl_arg32 {
 
 static int blkpg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct blkpg_ioctl_arg a;
-	struct blkpg_ioctl_arg32 *ua32;
-	struct blkpg_partition p;
-	struct blkpg_partition *up32;
+	struct blkpg_ioctl_arg32 __user *ua32 = compat_ptr(arg);
+	struct blkpg_ioctl_arg __user *a = compat_alloc_user_space(sizeof(*a));
 	compat_caddr_t udata;
+	compat_int_t n;
 	int err;
-	mm_segment_t old_fs = get_fs();
 	
-	ua32 = compat_ptr(arg);
-	err = get_user(a.op, &ua32->op);
-	err |= __get_user(a.flags, &ua32->flags);
-	err |= __get_user(a.datalen, &ua32->datalen);
-	err |= __get_user(udata, &ua32->data);
-	up32 = compat_ptr(udata);
+	err = get_user(n, &ua32->op);
+	err |= put_user(n, &a->op);
+	err |= get_user(n, &ua32->flags);
+	err |= put_user(n, &a->flags);
+	err |= get_user(n, &ua32->datalen);
+	err |= put_user(n, &a->datalen);
+	err |= get_user(udata, &ua32->data);
+	err |= put_user(compat_ptr(udata), &a->data);
 	if (err)
 		return err;
 
-	switch (a.op) {
-	case BLKPG_ADD_PARTITION:
-	case BLKPG_DEL_PARTITION:
-		if (a.datalen < sizeof(struct blkpg_partition))
-			return -EINVAL;
-                if (copy_from_user(&p, up32, sizeof(struct blkpg_partition)))
-			return -EFAULT;
-		a.data = &p;
-		set_fs (KERNEL_DS);
-		err = sys_ioctl(fd, cmd, (unsigned long)&a);
-		set_fs (old_fs);
-		break;
-	default:
-		return -EINVAL;
-	}                                        
-	return err;
+	return sys_ioctl(fd, cmd, (unsigned long)a);
 }
 
 static int ioc_settimeout(unsigned int fd, unsigned int cmd, unsigned long arg)
@@ -2127,7 +2086,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		case FDGETPRM32:
 		{
 			compat_uptr_t name;
-			struct floppy_struct32 *uf;
+			struct floppy_struct32 __user *uf;
 			struct floppy_struct *f;
 
 			uf = compat_ptr(arg);
@@ -2156,7 +2115,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		case FDSETDRVPRM32:
 		case FDGETDRVPRM32:
 		{
-			struct floppy_drive_params32 *uf;
+			struct floppy_drive_params32 __user *uf;
 			struct floppy_drive_params *f;
 
 			uf = compat_ptr(arg);
@@ -2218,22 +2177,23 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		case FDGETPRM32:
 		{
 			struct floppy_struct *f = karg;
+			struct floppy_struct32 __user *uf = compat_ptr(arg);
 
-			err = __put_user(f->size, &((struct floppy_struct32 *)arg)->size);
-			err |= __put_user(f->sect, &((struct floppy_struct32 *)arg)->sect);
-			err |= __put_user(f->head, &((struct floppy_struct32 *)arg)->head);
-			err |= __put_user(f->track, &((struct floppy_struct32 *)arg)->track);
-			err |= __put_user(f->stretch, &((struct floppy_struct32 *)arg)->stretch);
-			err |= __put_user(f->gap, &((struct floppy_struct32 *)arg)->gap);
-			err |= __put_user(f->rate, &((struct floppy_struct32 *)arg)->rate);
-			err |= __put_user(f->spec1, &((struct floppy_struct32 *)arg)->spec1);
-			err |= __put_user(f->fmt_gap, &((struct floppy_struct32 *)arg)->fmt_gap);
-			err |= __put_user((u64)f->name, (compat_caddr_t*)&((struct floppy_struct32 *)arg)->name);
+			err = __put_user(f->size, &uf->size);
+			err |= __put_user(f->sect, &uf->sect);
+			err |= __put_user(f->head, &uf->head);
+			err |= __put_user(f->track, &uf->track);
+			err |= __put_user(f->stretch, &uf->stretch);
+			err |= __put_user(f->gap, &uf->gap);
+			err |= __put_user(f->rate, &uf->rate);
+			err |= __put_user(f->spec1, &uf->spec1);
+			err |= __put_user(f->fmt_gap, &uf->fmt_gap);
+			err |= __put_user((u64)f->name, (compat_caddr_t __user *)&uf->name);
 			break;
 		}
 		case FDGETDRVPRM32:
 		{
-			struct floppy_drive_params32 *uf;
+			struct floppy_drive_params32 __user *uf;
 			struct floppy_drive_params *f = karg;
 
 			uf = compat_ptr(arg);
@@ -2261,7 +2221,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		case FDGETDRVSTAT32:
 		case FDPOLLDRVSTAT32:
 		{
-			struct floppy_drive_struct32 *uf;
+			struct floppy_drive_struct32 __user *uf;
 			struct floppy_drive_struct *f = karg;
 
 			uf = compat_ptr(arg);
@@ -2284,7 +2244,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		}
 		case FDGETFDCSTAT32:
 		{
-			struct floppy_fdc_state32 *uf;
+			struct floppy_fdc_state32 __user *uf;
 			struct floppy_fdc_state *f = karg;
 
 			uf = compat_ptr(arg);
@@ -2294,7 +2254,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 			err |= __put_user(f->version, &uf->version);
 			err |= __put_user(f->dor, &uf->dor);
 			err |= __put_user(f->address, &uf->address);
-			err |= __copy_to_user((char *)&uf->address + sizeof(uf->address),
+			err |= __copy_to_user((char __user *)&uf->address + sizeof(uf->address),
 					   (char *)&f->address + sizeof(f->address), sizeof(int));
 			err |= __put_user(f->driver_version, &uf->driver_version);
 			err |= __copy_to_user(uf->track, f->track, sizeof(f->track));
@@ -2302,7 +2262,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 		}
 		case FDWERRORGET32:
 		{
-			struct floppy_write_errors32 *uf;
+			struct floppy_write_errors32 __user *uf;
 			struct floppy_write_errors *f = karg;
 
 			uf = compat_ptr(arg);
@@ -2335,10 +2295,10 @@ struct mtd_oob_buf32 {
 
 static int mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct mtd_oob_buf	*buf = compat_alloc_user_space(sizeof(*buf));
-	struct mtd_oob_buf32	*buf32 = compat_ptr(arg);
+	struct mtd_oob_buf __user *buf = compat_alloc_user_space(sizeof(*buf));
+	struct mtd_oob_buf32 __user *buf32 = compat_ptr(arg);
 	u32 data;
-	char *datap;
+	char __user *datap;
 	unsigned int real_cmd;
 	int err;
 
@@ -2368,7 +2328,7 @@ static int mtd_rw_oob(unsigned int fd, unsigned int cmd, unsigned long arg)
 #define	VFAT_IOCTL_READDIR_SHORT32	_IOR('r', 2, struct compat_dirent[2])
 
 static long
-put_dirent32 (struct dirent *d, struct compat_dirent *d32)
+put_dirent32 (struct dirent *d, struct compat_dirent __user *d32)
 {
         int ret;
 
@@ -2385,6 +2345,7 @@ put_dirent32 (struct dirent *d, struct compat_dirent *d32)
 
 static int vfat_ioctl32(unsigned fd, unsigned cmd, unsigned long arg)
 {
+	struct compat_dirent __user *p = compat_ptr(arg);
 	int ret;
 	mm_segment_t oldfs = get_fs();
 	struct dirent d[2];
@@ -2403,8 +2364,8 @@ static int vfat_ioctl32(unsigned fd, unsigned cmd, unsigned long arg)
 	ret = sys_ioctl(fd,cmd,(unsigned long)&d);
 	set_fs(oldfs);
 	if (ret >= 0) {
-		ret |= put_dirent32(&d[0], (struct compat_dirent *)compat_ptr(arg));
-		ret |= put_dirent32(&d[1], ((struct compat_dirent *)compat_ptr(arg)) + 1);
+		ret |= put_dirent32(&d[0], p);
+		ret |= put_dirent32(&d[1], p + 1);
 	}
 	return ret;
 }
@@ -2426,28 +2387,22 @@ struct raw32_config_request
         __u64   block_minor;
 } __attribute__((packed));
 
-static int get_raw32_request(struct raw_config_request *req, struct raw32_config_request *user_req)
+static int get_raw32_request(struct raw_config_request *req, struct raw32_config_request __user *user_req)
 {
-        __u32   lo_maj, hi_maj, lo_min, hi_min;
         int ret;
 
         if ((ret = verify_area(VERIFY_READ, user_req,
                                sizeof(struct raw32_config_request))))
                 return ret;
 
-        __get_user(req->raw_minor, &user_req->raw_minor);
-        __get_user(lo_maj, (__u32*)&user_req->block_major);
-        __get_user(hi_maj, ((__u32*)(&user_req->block_major) + 1));
-        __get_user(lo_min, (__u32*)&user_req->block_minor);
-        __get_user(hi_min, ((__u32*)(&user_req->block_minor) + 1));
+        ret = __get_user(req->raw_minor, &user_req->raw_minor);
+        ret |= __get_user(req->block_major, &user_req->block_major);
+        ret |= __get_user(req->block_minor, &user_req->block_minor);
 
-        req->block_major = lo_maj | (((__u64)hi_maj) << 32);
-        req->block_minor = lo_min | (((__u64)hi_min) << 32);
-
-        return ret;
+        return ret ? -EFAULT : 0;
 }
 
-static int set_raw32_request(struct raw_config_request *req, struct raw32_config_request *user_req)
+static int set_raw32_request(struct raw_config_request *req, struct raw32_config_request __user *user_req)
 {
 	int ret;
 
@@ -2455,13 +2410,11 @@ static int set_raw32_request(struct raw_config_request *req, struct raw32_config
                                sizeof(struct raw32_config_request))))
                 return ret;
 
-        __put_user(req->raw_minor, &user_req->raw_minor);
-        __put_user((__u32)(req->block_major), (__u32*)&user_req->block_major);
-        __put_user((__u32)(req->block_major >> 32), ((__u32*)(&user_req->block_major) + 1));
-        __put_user((__u32)(req->block_minor), (__u32*)&user_req->block_minor);
-        __put_user((__u32)(req->block_minor >> 32), ((__u32*)(&user_req->block_minor) + 1));
+        ret = __put_user(req->raw_minor, &user_req->raw_minor);
+        ret |= __put_user(req->block_major, &user_req->block_major);
+        ret |= __put_user(req->block_minor, &user_req->block_minor);
 
-        return ret;
+        return ret ? -EFAULT : 0;
 }
 
 static int raw_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
@@ -2472,7 +2425,7 @@ static int raw_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
         case RAW_SETBIND:
         case RAW_GETBIND: {
                 struct raw_config_request req;
-                struct raw32_config_request *user_req = compat_ptr(arg);
+                struct raw32_config_request __user *user_req = compat_ptr(arg);
                 mm_segment_t oldfs = get_fs();
 
                 if ((ret = get_raw32_request(&req, user_req)))
@@ -2520,7 +2473,7 @@ static int serial_struct_ioctl(unsigned fd, unsigned cmd, unsigned long arg)
 {
         typedef struct serial_struct SS;
         typedef struct serial_struct32 SS32;
-        struct serial_struct32 *ss32 = compat_ptr(arg);
+        struct serial_struct32 __user *ss32 = compat_ptr(arg);
         int err;
         struct serial_struct ss;
         mm_segment_t oldseg = get_fs();
@@ -2568,10 +2521,11 @@ struct usbdevfs_ctrltransfer32 {
 static int do_usbdevfs_control(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
         struct usbdevfs_ctrltransfer kctrl;
-        struct usbdevfs_ctrltransfer32 *uctrl;
+        struct usbdevfs_ctrltransfer32 __user *uctrl;
         mm_segment_t old_fs;
         __u32 udata;
-        void *uptr, *kptr;
+        void __user *uptr;
+        void *kptr;
         int err;
 
         uctrl = compat_ptr(arg);
@@ -2629,10 +2583,11 @@ struct usbdevfs_bulktransfer32 {
 static int do_usbdevfs_bulk(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
         struct usbdevfs_bulktransfer kbulk;
-        struct usbdevfs_bulktransfer32 *ubulk;
+        struct usbdevfs_bulktransfer32 __user *ubulk;
         mm_segment_t old_fs;
         __u32 udata;
-        void *uptr, *kptr;
+        void __user *uptr;
+        void *kptr;
         int err;
 
 	ubulk = compat_ptr(arg);
@@ -2895,7 +2850,7 @@ static int do_usbdevfs_reapurb(unsigned int fd, unsigned int cmd, unsigned long
         set_fs(old_fs);
 
         if (err >= 0 &&
-            put_user((u32)(u64)kptr, (u32 *)compat_ptr(arg)))
+            put_user((u32)(u64)kptr, (u32 __user *)compat_ptr(arg)))
                 err = -EFAULT;
 
         return err;
@@ -2911,7 +2866,7 @@ struct usbdevfs_disconnectsignal32 {
 static int do_usbdevfs_discsignal(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
         struct usbdevfs_disconnectsignal kdis;
-        struct usbdevfs_disconnectsignal32 *udis;
+        struct usbdevfs_disconnectsignal32 __user *udis;
         mm_segment_t old_fs;
         u32 uctx;
         int err;
@@ -2957,10 +2912,10 @@ struct i2c_smbus_ioctl_data32 {
 
 static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct i2c_rdwr_ioctl_data	*tdata;
-	struct i2c_rdwr_ioctl_data32	*udata;
-	struct i2c_msg			*tmsgs;
-	struct i2c_msg32		*umsgs;
+	struct i2c_rdwr_ioctl_data	__user *tdata;
+	struct i2c_rdwr_ioctl_data32	__user *udata;
+	struct i2c_msg			__user *tmsgs;
+	struct i2c_msg32		__user *umsgs;
 	compat_caddr_t			datap;
 	int				nmsgs, i;
 
@@ -2970,7 +2925,7 @@ static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar
 	if (verify_area(VERIFY_WRITE, tdata, sizeof(*tdata)))
 		return -EFAULT;
 
-	udata = (struct i2c_rdwr_ioctl_data32 *)compat_ptr(arg);
+	udata = compat_ptr(arg);
 	if (verify_area(VERIFY_READ, udata, sizeof(*udata)))
 		return -EFAULT;
 	if (__get_user(nmsgs, &udata->nmsgs) || __put_user(nmsgs, &tdata->nmsgs))
@@ -2979,7 +2934,7 @@ static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar
 		return -EINVAL;
 	if (__get_user(datap, &udata->msgs))
 		return -EFAULT;
-	umsgs = (struct i2c_msg32 *)compat_ptr(datap);
+	umsgs = compat_ptr(datap);
 	if (verify_area(VERIFY_READ, umsgs, sizeof(struct i2c_msg) * nmsgs))
 		return -EFAULT;
 
@@ -3004,8 +2959,8 @@ static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar
 
 static int do_i2c_smbus_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct i2c_smbus_ioctl_data	*tdata;
-	struct i2c_smbus_ioctl_data32	*udata;
+	struct i2c_smbus_ioctl_data	__user *tdata;
+	struct i2c_smbus_ioctl_data32	__user *udata;
 	compat_caddr_t			datap;
 
 	tdata = compat_alloc_user_space(sizeof(*tdata));
@@ -3014,7 +2969,7 @@ static int do_i2c_smbus_ioctl(unsigned int fd, unsigned int cmd, unsigned long a
 	if (verify_area(VERIFY_WRITE, tdata, sizeof(*tdata)))
 		return -EFAULT;
 
-	udata = (struct i2c_smbus_ioctl_data32 *)compat_ptr(arg);
+	udata = compat_ptr(arg);
 	if (verify_area(VERIFY_READ, udata, sizeof(*udata)))
 		return -EFAULT;
 
@@ -3037,14 +2992,15 @@ struct compat_iw_point {
 
 static int do_wireless_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct iwreq *iwr, *iwr_u;
-	struct iw_point *iwp;
-	struct compat_iw_point *iwp_u;
+	struct iwreq __user *iwr;
+	struct iwreq __user *iwr_u;
+	struct iw_point __user *iwp;
+	struct compat_iw_point __user *iwp_u;
 	compat_caddr_t pointer;
 	__u16 length, flags;
 
-	iwr_u = (struct iwreq *) compat_ptr(arg);
-	iwp_u = (struct compat_iw_point *) &iwr_u->u.data;
+	iwr_u = compat_ptr(arg);
+	iwp_u = (struct compat_iw_point __user *) &iwr_u->u.data;
 	iwr = compat_alloc_user_space(sizeof(*iwr));
 	if (iwr == NULL)
 		return -ENOMEM;
@@ -3072,20 +3028,208 @@ static int do_wireless_ioctl(unsigned int fd, unsigned int cmd, unsigned long ar
 	return sys_ioctl(fd, cmd, (unsigned long) iwr);
 }
 
-/* Emulate old style bridge ioctls */
-static int do_bridge_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+/* Since old style bridge ioctl's endup using SIOCDEVPRIVATE
+ * for some operations; this forces use of the newer bridge-utils that
+ * use compatiable ioctls
+ */
+static int old_bridge_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	u32 tmp;
-	unsigned long *argbuf = compat_alloc_user_space(3 * sizeof(unsigned long)); 
-	int i;	
-	for (i = 0; i < 3; i++) {
-		if (get_user(tmp, i + ((u32 *)arg)) ||
-		    put_user(tmp, i + argbuf))
-			return -EFAULT;
+
+	if (get_user(tmp, (u32 __user *) arg))
+		return -EFAULT;
+	if (tmp == BRCTL_GET_VERSION)
+		return BRCTL_VERSION + 1;
+	return -EINVAL;
+}
+
+#if defined(CONFIG_NCP_FS) || defined(CONFIG_NCP_FS_MODULE)
+struct ncp_ioctl_request_32 {
+	u32 function;
+	u32 size;
+	compat_caddr_t data;
+};
+
+struct ncp_fs_info_v2_32 {
+	s32 version;
+	u32 mounted_uid;
+	u32 connection;
+	u32 buffer_size;
+
+	u32 volume_number;
+	u32 directory_id;
+
+	u32 dummy1;
+	u32 dummy2;
+	u32 dummy3;
+};
+
+struct ncp_objectname_ioctl_32
+{
+	s32		auth_type;
+	u32		object_name_len;
+	compat_caddr_t	object_name;	/* an userspace data, in most cases user name */
+};
+
+struct ncp_privatedata_ioctl_32
+{
+	u32		len;
+	compat_caddr_t	data;		/* ~1000 for NDS */
+};
+
+#define	NCP_IOC_NCPREQUEST_32		_IOR('n', 1, struct ncp_ioctl_request_32)
+#define NCP_IOC_GETMOUNTUID2_32		_IOW('n', 2, u32)
+#define NCP_IOC_GET_FS_INFO_V2_32	_IOWR('n', 4, struct ncp_fs_info_v2_32)
+#define NCP_IOC_GETOBJECTNAME_32	_IOWR('n', 9, struct ncp_objectname_ioctl_32)
+#define NCP_IOC_SETOBJECTNAME_32	_IOR('n', 9, struct ncp_objectname_ioctl_32)
+#define NCP_IOC_GETPRIVATEDATA_32	_IOWR('n', 10, struct ncp_privatedata_ioctl_32)
+#define NCP_IOC_SETPRIVATEDATA_32	_IOR('n', 10, struct ncp_privatedata_ioctl_32)
+
+static int do_ncp_ncprequest(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct ncp_ioctl_request_32 n32;
+	struct ncp_ioctl_request __user *p = compat_alloc_user_space(sizeof(*p));
+
+	if (copy_from_user(&n32, compat_ptr(arg), sizeof(n32)) ||
+	    put_user(n32.function, &p->function) ||
+	    put_user(n32.size, &p->size) ||
+	    put_user(compat_ptr(n32.data), &p->data))
+		return -EFAULT;
+
+	return sys_ioctl(fd, NCP_IOC_NCPREQUEST, (unsigned long)p);
+}
+
+static int do_ncp_getmountuid2(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	mm_segment_t old_fs = get_fs();
+	__kernel_uid_t kuid;
+	int err;
+
+	cmd = NCP_IOC_GETMOUNTUID2;
+
+	set_fs(KERNEL_DS);
+	err = sys_ioctl(fd, cmd, (unsigned long)&kuid);
+	set_fs(old_fs);
+
+	if (!err)
+		err = put_user(kuid,
+			       (unsigned int __user *) compat_ptr(arg));
+
+	return err;
+}
+
+static int do_ncp_getfsinfo2(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	mm_segment_t old_fs = get_fs();
+	struct ncp_fs_info_v2_32 n32;
+	struct ncp_fs_info_v2 n;
+	int err;
+
+	if (copy_from_user(&n32, compat_ptr(arg), sizeof(n32)))
+		return -EFAULT;
+	if (n32.version != NCP_GET_FS_INFO_VERSION_V2)
+		return -EINVAL;
+	n.version = NCP_GET_FS_INFO_VERSION_V2;
+
+	set_fs(KERNEL_DS);
+	err = sys_ioctl(fd, NCP_IOC_GET_FS_INFO_V2, (unsigned long)&n);
+	set_fs(old_fs);
+
+	if (!err) {
+		n32.version = n.version;
+		n32.mounted_uid = n.mounted_uid;
+		n32.connection = n.connection;
+		n32.buffer_size = n.buffer_size;
+		n32.volume_number = n.volume_number;
+		n32.directory_id = n.directory_id;
+		n32.dummy1 = n.dummy1;
+		n32.dummy2 = n.dummy2;
+		n32.dummy3 = n.dummy3;
+		err = copy_to_user(compat_ptr(arg), &n32, sizeof(n32)) ? -EFAULT : 0;
 	}
-	return sys_ioctl(fd, cmd, (unsigned long)argbuf);
+	return err;
 }
 
+static int do_ncp_getobjectname(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct ncp_objectname_ioctl_32 n32, __user *p32 = compat_ptr(arg);
+	struct ncp_objectname_ioctl __user *p = compat_alloc_user_space(sizeof(*p));
+	s32 auth_type;
+	u32 name_len;
+	int err;
+
+	if (copy_from_user(&n32, p32, sizeof(n32)) ||
+	    put_user(n32.object_name_len, &p->object_name_len) ||
+	    put_user(compat_ptr(n32.object_name), &p->object_name))
+		return -EFAULT;
+
+	err = sys_ioctl(fd, NCP_IOC_GETOBJECTNAME, (unsigned long)p);
+        if (err)
+		return err;
+
+	if (get_user(auth_type, &p->auth_type) ||
+	    put_user(auth_type, &p32->auth_type) ||
+	    get_user(name_len, &p->object_name_len) ||
+	    put_user(name_len, &p32->object_name_len))
+		return -EFAULT;
+
+	return 0;
+}
+
+static int do_ncp_setobjectname(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct ncp_objectname_ioctl_32 n32, __user *p32 = compat_ptr(arg);
+	struct ncp_objectname_ioctl __user *p = compat_alloc_user_space(sizeof(*p));
+
+	if (copy_from_user(&n32, p32, sizeof(n32)) ||
+	    put_user(n32.auth_type, &p->auth_type) ||
+	    put_user(n32.object_name_len, &p->object_name_len) ||
+	    put_user(compat_ptr(n32.object_name), &p->object_name))
+		return -EFAULT;
+
+	return sys_ioctl(fd, NCP_IOC_SETOBJECTNAME, (unsigned long)p);
+}
+
+static int do_ncp_getprivatedata(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct ncp_privatedata_ioctl_32 n32, __user *p32 = compat_ptr(arg);
+	struct ncp_privatedata_ioctl __user *p =
+		compat_alloc_user_space(sizeof(*p));
+	u32 len;
+	int err;
+
+	if (copy_from_user(&n32, p32, sizeof(n32)) ||
+	    put_user(n32.len, &p->len) ||
+	    put_user(compat_ptr(n32.data), &p->data))
+		return -EFAULT;
+
+	err = sys_ioctl(fd, NCP_IOC_GETPRIVATEDATA, (unsigned long)p);
+        if (err)
+		return err;
+
+	if (get_user(len, &p->len) ||
+	    put_user(len, &p32->len))
+		return -EFAULT;
+
+	return 0;
+}
+
+static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct ncp_privatedata_ioctl_32 n32;
+	struct ncp_privatedata_ioctl_32 __user *p32 = compat_ptr(arg);
+	struct ncp_privatedata_ioctl __user *p =
+		compat_alloc_user_space(sizeof(*p));
+
+	if (copy_from_user(&n32, p32, sizeof(n32)) ||
+	    put_user(n32.len, &p->len) ||
+	    put_user(compat_ptr(n32.data), &p->data))
+		return -EFAULT;
+
+	return sys_ioctl(fd, NCP_IOC_SETPRIVATEDATA, (unsigned long)p);
+}
+#endif
+
 #undef CODE
 #endif
 
@@ -3133,6 +3277,8 @@ HANDLE_IOCTL(SIOCBONDINFOQUERY, bond_ioctl)
 HANDLE_IOCTL(SIOCBONDCHANGEACTIVE, bond_ioctl)
 HANDLE_IOCTL(SIOCADDRT, routing_ioctl)
 HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
+HANDLE_IOCTL(SIOCBRADDIF, dev_ifsioc)
+HANDLE_IOCTL(SIOCBRDELIF, dev_ifsioc)
 /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
 HANDLE_IOCTL(SIOCRTMSG, ret_einval)
 HANDLE_IOCTL(SIOCGSTAMP, do_siocgstamp)
@@ -3263,8 +3409,18 @@ HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_ioctl)
 HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl)
 HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl)
 HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl)
-HANDLE_IOCTL(SIOCSIFBR, do_bridge_ioctl)
-HANDLE_IOCTL(SIOCGIFBR, do_bridge_ioctl)
+HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl)
+HANDLE_IOCTL(SIOCGIFBR, old_bridge_ioctl)
+
+#if defined(CONFIG_NCP_FS) || defined(CONFIG_NCP_FS_MODULE)
+HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest)
+HANDLE_IOCTL(NCP_IOC_GETMOUNTUID2_32, do_ncp_getmountuid2)
+HANDLE_IOCTL(NCP_IOC_GET_FS_INFO_V2_32, do_ncp_getfsinfo2)
+HANDLE_IOCTL(NCP_IOC_GETOBJECTNAME_32, do_ncp_getobjectname)
+HANDLE_IOCTL(NCP_IOC_SETOBJECTNAME_32, do_ncp_setobjectname)
+HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata)
+HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata)
+#endif
 
 #undef DECLARES
 #endif
diff --git a/fs/dcache.c b/fs/dcache.c
index d4fa197bd..613ff66da 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -21,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/smp_lock.h>
+#include <linux/hash.h>
 #include <linux/cache.h>
 #include <linux/module.h>
 #include <linux/mount.h>
@@ -40,6 +41,8 @@ EXPORT_SYMBOL(dcache_lock);
 
 static kmem_cache_t *dentry_cache; 
 
+#define DNAME_INLINE_LEN (sizeof(struct dentry)-offsetof(struct dentry,d_iname))
+
 /*
  * This is the single most critical data structure when it comes
  * to the dcache: the hashtable for lookups. Somebody should try
@@ -65,9 +68,8 @@ static void d_callback(void *arg)
 {
 	struct dentry * dentry = (struct dentry *)arg;
 
-	if (dname_external(dentry)) {
-		kfree(dentry->d_qstr);
-	}
+	if (dname_external(dentry))
+		kfree(dentry->d_name.name);
 	kmem_cache_free(dentry_cache, dentry); 
 }
 
@@ -161,7 +163,7 @@ repeat:
  	if (d_unhashed(dentry))
 		goto kill_it;
   	if (list_empty(&dentry->d_lru)) {
-  		dentry->d_vfs_flags |= DCACHE_REFERENCED;
+  		dentry->d_flags |= DCACHE_REFERENCED;
   		list_add(&dentry->d_lru, &dentry_unused);
   		dentry_stat.nr_unused++;
   	}
@@ -257,7 +259,7 @@ int d_invalidate(struct dentry * dentry)
 static inline struct dentry * __dget_locked(struct dentry *dentry)
 {
 	atomic_inc(&dentry->d_count);
-	if (atomic_read(&dentry->d_count) == 1) {
+	if (!list_empty(&dentry->d_lru)) {
 		dentry_stat.nr_unused--;
 		list_del_init(&dentry->d_lru);
 	}
@@ -394,8 +396,8 @@ static void prune_dcache(int count)
 			continue;
 		}
 		/* If the dentry was recently referenced, don't free it. */
-		if (dentry->d_vfs_flags & DCACHE_REFERENCED) {
-			dentry->d_vfs_flags &= ~DCACHE_REFERENCED;
+		if (dentry->d_flags & DCACHE_REFERENCED) {
+			dentry->d_flags &= ~DCACHE_REFERENCED;
  			list_add(&dentry->d_lru, &dentry_unused);
  			dentry_stat.nr_unused++;
  			spin_unlock(&dentry->d_lock);
@@ -643,30 +645,27 @@ void shrink_dcache_anon(struct hlist_head *head)
 }
 
 /*
- * This is called from kswapd when we think we need some more memory.
+ * Scan `nr' dentries and return the number which remain.
+ *
+ * We need to avoid reentering the filesystem if the caller is performing a
+ * GFP_NOFS allocation attempt.  One example deadlock is:
+ *
+ * ext2_new_block->getblk->GFP->shrink_dcache_memory->prune_dcache->
+ * prune_one_dentry->dput->dentry_iput->iput->inode->i_sb->s_op->put_inode->
+ * ext2_discard_prealloc->ext2_free_blocks->lock_super->DEADLOCK.
+ *
+ * In this case we return -1 to tell the caller that we baled.
  */
 static int shrink_dcache_memory(int nr, unsigned int gfp_mask)
 {
 	if (nr) {
-		/*
-		 * Nasty deadlock avoidance.
-		 *
-	 	 * ext2_new_block->getblk->GFP->shrink_dcache_memory->
-		 * prune_dcache->prune_one_dentry->dput->dentry_iput->iput->
-		 * inode->i_sb->s_op->put_inode->ext2_discard_prealloc->
-		 * ext2_free_blocks->lock_super->DEADLOCK.
-	 	 *
-	 	 * We should make sure we don't hold the superblock lock over
-	 	 * block allocations, but for now:
-		 */
-		if (gfp_mask & __GFP_FS)
-			prune_dcache(nr);
+		if (!(gfp_mask & __GFP_FS))
+			return -1;
+		prune_dcache(nr);
 	}
 	return dentry_stat.nr_unused;
 }
 
-#define NAME_ALLOC_LEN(len)	((len+16) & ~15)
-
 /**
  * d_alloc	-	allocate a dcache entry
  * @parent: parent of entry to allocate
@@ -677,47 +676,37 @@ static int shrink_dcache_memory(int nr, unsigned int gfp_mask)
  * copied and the copy passed in may be reused after this call.
  */
  
-struct dentry * d_alloc(struct dentry * parent, const struct qstr *name)
+struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
 {
-	char * str;
 	struct dentry *dentry;
-	struct qstr * qstr;
+	char *dname;
 
 	dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); 
 	if (!dentry)
 		return NULL;
 
 	if (name->len > DNAME_INLINE_LEN-1) {
-		qstr = kmalloc(sizeof(*qstr) + NAME_ALLOC_LEN(name->len), 
-				GFP_KERNEL);  
-		if (!qstr) {
+		dname = kmalloc(name->len + 1, GFP_KERNEL);
+		if (!dname) {
 			kmem_cache_free(dentry_cache, dentry); 
 			return NULL;
 		}
-		qstr->name = qstr->name_str;
-		qstr->len = name->len;
-		qstr->hash = name->hash;
-		dentry->d_qstr = qstr;
-		str = qstr->name_str;
 	} else  {
-		dentry->d_qstr = &dentry->d_name;
-		str = dentry->d_iname;
+		dname = dentry->d_iname;
 	}	
+	dentry->d_name.name = dname;
 
-	memcpy(str, name->name, name->len);
-	str[name->len] = 0;
+	dentry->d_name.len = name->len;
+	dentry->d_name.hash = name->hash;
+	memcpy(dname, name->name, name->len);
+	dname[name->len] = 0;
 
 	atomic_set(&dentry->d_count, 1);
-	dentry->d_vfs_flags = DCACHE_UNHASHED;
+	dentry->d_flags = DCACHE_UNHASHED;
 	dentry->d_lock = SPIN_LOCK_UNLOCKED;
-	dentry->d_flags = 0;
 	dentry->d_inode = NULL;
 	dentry->d_parent = NULL;
-	dentry->d_move_count = 0;
 	dentry->d_sb = NULL;
-	dentry->d_name.name = str;
-	dentry->d_name.len = name->len;
-	dentry->d_name.hash = name->hash;
 	dentry->d_op = NULL;
 	dentry->d_fsdata = NULL;
 	dentry->d_mounted = 0;
@@ -784,7 +773,8 @@ struct dentry * d_alloc_root(struct inode * root_inode)
 	struct dentry *res = NULL;
 
 	if (root_inode) {
-		static const struct qstr name = { .name = "/", .len = 1, .hash = 0 };
+		static const struct qstr name = { .name = "/", .len = 1 };
+
 		res = d_alloc(NULL, &name);
 		if (res) {
 			res->d_sb = root_inode->i_sb;
@@ -795,10 +785,11 @@ struct dentry * d_alloc_root(struct inode * root_inode)
 	return res;
 }
 
-static inline struct hlist_head * d_hash(struct dentry * parent, unsigned long hash)
+static inline struct hlist_head *d_hash(struct dentry *parent,
+					unsigned long hash)
 {
-	hash += (unsigned long) parent / L1_CACHE_BYTES;
-	hash = hash ^ (hash >> D_HASHBITS);
+	hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES;
+	hash = hash ^ ((hash ^ GOLDEN_RATIO_PRIME) >> D_HASHBITS);
 	return dentry_hashtable + (hash & D_HASHMASK);
 }
 
@@ -824,7 +815,7 @@ static inline struct hlist_head * d_hash(struct dentry * parent, unsigned long h
 
 struct dentry * d_alloc_anon(struct inode *inode)
 {
-	static const struct qstr anonstring = { "", 0, 0};
+	static const struct qstr anonstring = { .name = "" };
 	struct dentry *tmp;
 	struct dentry *res;
 
@@ -855,9 +846,14 @@ struct dentry * d_alloc_anon(struct inode *inode)
 			res->d_sb = inode->i_sb;
 			res->d_parent = res;
 			res->d_inode = inode;
-			res->d_bucket = d_hash(res, res->d_name.hash);
+
+			/*
+			 * Set d_bucket to an "impossible" bucket address so
+			 * that d_move() doesn't get a false positive
+			 */
+			res->d_bucket = NULL;
 			res->d_flags |= DCACHE_DISCONNECTED;
-			res->d_vfs_flags &= ~DCACHE_UNHASHED;
+			res->d_flags &= ~DCACHE_UNHASHED;
 			list_add(&res->d_alias, &inode->i_dentry);
 			hlist_add_head(&res->d_hash, &inode->i_sb->s_anon);
 			spin_unlock(&res->d_lock);
@@ -930,8 +926,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
  *
  * __d_lookup is dcache_lock free. The hash list is protected using RCU.
  * Memory barriers are used while updating and doing lockless traversal. 
- * To avoid races with d_move while rename is happening, d_move_count is 
- * used. 
+ * To avoid races with d_move while rename is happening, d_lock is used.
  *
  * Overflows in memcmp(), while d_move, are avoided by keeping the length
  * and name pointer in one structure pointed by d_qstr.
@@ -940,8 +935,9 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
  * lookup is going on.
  *
  * dentry_unused list is not updated even if lookup finds the required dentry
- * in there. It is updated in places such as prune_dcache, shrink_dcache_sb and
- * select_parent. This laziness saves lookup from dcache_lock acquisition.
+ * in there. It is updated in places such as prune_dcache, shrink_dcache_sb,
+ * select_parent and __dget_locked. This laziness saves lookup from dcache_lock
+ * acquisition.
  *
  * d_lookup() is protected against the concurrent renames in some unrelated
  * directory using the seqlockt_t rename_lock.
@@ -974,23 +970,11 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
 	
 	hlist_for_each (node, head) { 
 		struct dentry *dentry; 
-		unsigned long move_count;
-		struct qstr * qstr;
+		struct qstr *qstr;
 
 		smp_read_barrier_depends();
 		dentry = hlist_entry(node, struct dentry, d_hash);
 
-		/* if lookup ends up in a different bucket 
-		 * due to concurrent rename, fail it
-		 */
-		if (unlikely(dentry->d_bucket != head))
-			break;
-
-		/*
-		 * We must take a snapshot of d_move_count followed by
-		 * read memory barrier before any search key comparison 
-		 */
-		move_count = dentry->d_move_count;
 		smp_rmb();
 
 		if (dentry->d_name.hash != hash)
@@ -998,29 +982,44 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
 		if (dentry->d_parent != parent)
 			continue;
 
-		qstr = dentry->d_qstr;
+		spin_lock(&dentry->d_lock);
+
+		/*
+		 * If lookup ends up in a different bucket due to concurrent
+		 * rename, fail it
+		 */
+		if (unlikely(dentry->d_bucket != head))
+			goto terminate;
+
+		/*
+		 * Recheck the dentry after taking the lock - d_move may have
+		 * changed things.  Don't bother checking the hash because we're
+		 * about to compare the whole name anyway.
+		 */
+		if (dentry->d_parent != parent)
+			goto next;
+
+		qstr = &dentry->d_name;
 		smp_read_barrier_depends();
 		if (parent->d_op && parent->d_op->d_compare) {
 			if (parent->d_op->d_compare(parent, qstr, name))
-				continue;
+				goto next;
 		} else {
 			if (qstr->len != len)
-				continue;
+				goto next;
 			if (memcmp(qstr->name, str, len))
-				continue;
+				goto next;
 		}
-		spin_lock(&dentry->d_lock);
-		/*
-		 * If dentry is moved, fail the lookup
-		 */ 
-		if (likely(move_count == dentry->d_move_count)) {
-			if (!d_unhashed(dentry)) {
-				atomic_inc(&dentry->d_count);
-				found = dentry;
-			}
+
+		if (!d_unhashed(dentry)) {
+			atomic_inc(&dentry->d_count);
+			found = dentry;
 		}
+terminate:
 		spin_unlock(&dentry->d_lock);
 		break;
+next:
+		spin_unlock(&dentry->d_lock);
  	}
  	rcu_read_unlock();
 
@@ -1118,8 +1117,11 @@ void d_delete(struct dentry * dentry)
 void d_rehash(struct dentry * entry)
 {
 	struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
+
 	spin_lock(&dcache_lock);
- 	entry->d_vfs_flags &= ~DCACHE_UNHASHED;
+	spin_lock(&entry->d_lock);
+ 	entry->d_flags &= ~DCACHE_UNHASHED;
+	spin_unlock(&entry->d_lock);
 	entry->d_bucket = list;
  	hlist_add_head_rcu(&entry->d_hash, list);
 	spin_unlock(&dcache_lock);
@@ -1140,28 +1142,40 @@ void d_rehash(struct dentry * entry)
  * then no longer matches the actual (corrupted) string of the target.
  * The hash value has to match the hash queue that the dentry is on..
  */
-static inline void switch_names(struct dentry * dentry, struct dentry * target)
+static void switch_names(struct dentry *dentry, struct dentry *target)
 {
-	const unsigned char *old_name, *new_name;
-	struct qstr *old_qstr, *new_qstr;
-
-	memcpy(dentry->d_iname, target->d_iname, DNAME_INLINE_LEN); 
-	old_qstr = target->d_qstr;
-	old_name = target->d_name.name;
-	new_qstr = dentry->d_qstr;
-	new_name = dentry->d_name.name;
-	if (old_name == target->d_iname) {
-		old_name = dentry->d_iname;
-		old_qstr = &dentry->d_name;
-	}
-	if (new_name == dentry->d_iname) {
-		new_name = target->d_iname;
-		new_qstr = &target->d_name;
+	if (dname_external(target)) {
+		if (dname_external(dentry)) {
+			/*
+			 * Both external: swap the pointers
+			 */
+			do_switch(target->d_name.name, dentry->d_name.name);
+		} else {
+			/*
+			 * dentry:internal, target:external.  Steal target's
+			 * storage and make target internal.
+			 */
+			dentry->d_name.name = target->d_name.name;
+			target->d_name.name = target->d_iname;
+		}
+	} else {
+		if (dname_external(dentry)) {
+			/*
+			 * dentry:external, target:internal.  Give dentry's
+			 * storage to target and make dentry internal
+			 */
+			memcpy(dentry->d_iname, target->d_name.name,
+					target->d_name.len + 1);
+			target->d_name.name = dentry->d_name.name;
+			dentry->d_name.name = dentry->d_iname;
+		} else {
+			/*
+			 * Both are internal.  Just copy target to dentry
+			 */
+			memcpy(dentry->d_iname, target->d_name.name,
+					target->d_name.len + 1);
+		}
 	}
-	target->d_name.name = new_name;
-	dentry->d_name.name = old_name;
-	target->d_qstr = new_qstr;
-	dentry->d_qstr = old_qstr;
 }
 
 /*
@@ -1204,14 +1218,14 @@ void d_move(struct dentry * dentry, struct dentry * target)
 	}
 
 	/* Move the dentry to the target hash queue, if on different bucket */
-	if (dentry->d_vfs_flags & DCACHE_UNHASHED)
+	if (dentry->d_flags & DCACHE_UNHASHED)
 		goto already_unhashed;
 	if (dentry->d_bucket != target->d_bucket) {
 		hlist_del_rcu(&dentry->d_hash);
 already_unhashed:
 		dentry->d_bucket = target->d_bucket;
 		hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
-		dentry->d_vfs_flags &= ~DCACHE_UNHASHED;
+		dentry->d_flags &= ~DCACHE_UNHASHED;
 	}
 
 	/* Unhash the target: dput() will then get rid of it */
@@ -1239,7 +1253,6 @@ already_unhashed:
 	}
 
 	list_add(&dentry->d_child, &dentry->d_parent->d_subdirs);
-	dentry->d_move_count++;
 	spin_unlock(&target->d_lock);
 	spin_unlock(&dentry->d_lock);
 	write_sequnlock(&rename_lock);
@@ -1337,6 +1350,7 @@ char * d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
 	char *res;
 	struct vfsmount *rootmnt;
 	struct dentry *root;
+
 	read_lock(&current->fs->lock);
 	rootmnt = mntget(current->fs->rootmnt);
 	root = dget(current->fs->root);
@@ -1562,10 +1576,8 @@ static void __init dcache_init(unsigned long mempages)
 	dentry_cache = kmem_cache_create("dentry_cache",
 					 sizeof(struct dentry),
 					 0,
-					 SLAB_RECLAIM_ACCOUNT,
+					 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC,
 					 NULL, NULL);
-	if (!dentry_cache)
-		panic("Cannot create dentry cache");
 	
 	set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
 
@@ -1627,20 +1639,14 @@ void __init vfs_caches_init(unsigned long mempages)
 	/* Base hash sizes on available memory, with a reserve equal to
            150% of current kernel size */
 
-	reserve = (mempages - nr_free_pages()) * 3/2;
+	reserve = min((mempages - nr_free_pages()) * 3/2, mempages - 1);
 	mempages -= reserve;
 
-	names_cachep = kmem_cache_create("names_cache",
-			PATH_MAX, 0,
-			SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!names_cachep)
-		panic("Cannot create names SLAB cache");
-
-	filp_cachep = kmem_cache_create("filp",
-			sizeof(struct file), 0,
-			SLAB_HWCACHE_ALIGN, filp_ctor, filp_dtor);
-	if(!filp_cachep)
-		panic("Cannot create filp SLAB cache");
+	names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
+
+	filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0,
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, filp_ctor, filp_dtor);
 
 	dcache_init(mempages);
 	inode_init(mempages);
diff --git a/fs/dcookies.c b/fs/dcookies.c
index 277ef25df..70fd5f138 100644
--- a/fs/dcookies.c
+++ b/fs/dcookies.c
@@ -142,7 +142,7 @@ out:
 /* And here is where the userspace process can look up the cookie value
  * to retrieve the path.
  */
-asmlinkage long sys_lookup_dcookie(u64 cookie64, char * buf, size_t len)
+asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len)
 {
 	unsigned long cookie = (unsigned long)cookie64;
 	int err = -EINVAL;
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index c7ea29114..5e66bc917 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -848,13 +848,13 @@ static unsigned int boot_options = OPTION_NONE;
 static devfs_handle_t _devfs_walk_path(struct devfs_entry *dir,
 				       const char *name, int namelen,
 				       int traverse_symlink);
-static ssize_t devfsd_read(struct file *file, char *buf, size_t len,
+static ssize_t devfsd_read(struct file *file, char __user *buf, size_t len,
 			   loff_t * ppos);
 static int devfsd_ioctl(struct inode *inode, struct file *file,
 			unsigned int cmd, unsigned long arg);
 static int devfsd_close(struct inode *inode, struct file *file);
 #ifdef CONFIG_DEVFS_DEBUG
-static ssize_t stat_read(struct file *file, char *buf, size_t len,
+static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
 			 loff_t * ppos);
 static struct file_operations stat_fops = {
 	.read = stat_read,
@@ -2579,7 +2579,7 @@ static struct file_system_type devfs_fs_type = {
 
 /*  File operations for devfsd follow  */
 
-static ssize_t devfsd_read(struct file *file, char *buf, size_t len,
+static ssize_t devfsd_read(struct file *file, char __user *buf, size_t len,
 			   loff_t * ppos)
 {
 	int done = FALSE;
@@ -2693,7 +2693,7 @@ static int devfsd_ioctl(struct inode *inode, struct file *file,
 	switch (cmd) {
 	case DEVFSDIOC_GET_PROTO_REV:
 		ival = DEVFSD_PROTOCOL_REVISION_KERNEL;
-		if (copy_to_user((void *)arg, &ival, sizeof ival))
+		if (copy_to_user((void __user *)arg, &ival, sizeof ival))
 			return -EFAULT;
 		break;
 	case DEVFSDIOC_SET_EVENT_MASK:
@@ -2732,7 +2732,7 @@ static int devfsd_ioctl(struct inode *inode, struct file *file,
 		/*break; */
 #ifdef CONFIG_DEVFS_DEBUG
 	case DEVFSDIOC_SET_DEBUG_MASK:
-		if (copy_from_user(&ival, (void *)arg, sizeof ival))
+		if (copy_from_user(&ival, (void __user *)arg, sizeof ival))
 			return -EFAULT;
 		devfs_debug = ival;
 		break;
@@ -2772,7 +2772,7 @@ static int devfsd_close(struct inode *inode, struct file *file)
 }				/*  End Function devfsd_close  */
 
 #ifdef CONFIG_DEVFS_DEBUG
-static ssize_t stat_read(struct file *file, char *buf, size_t len,
+static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
 			 loff_t * ppos)
 {
 	ssize_t num;
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 0831f490f..d498521c9 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -690,8 +690,11 @@ out:
 static void clean_blockdev_aliases(struct dio *dio)
 {
 	unsigned i;
+	unsigned nblocks;
 
-	for (i = 0; i < dio->blocks_available; i++) {
+	nblocks = dio->map_bh.b_size >> dio->inode->i_blkbits;
+
+	for (i = 0; i < nblocks; i++) {
 		unmap_underlying_metadata(dio->map_bh.b_bdev,
 					dio->map_bh.b_blocknr + i);
 	}
@@ -987,13 +990,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
 		}
 	} /* end iovec loop */
 
-	if (ret == -ENOTBLK && rw == WRITE) {
-		/*
-		 * The remaining part of the request will be
-		 * be handled by buffered I/O when we return
-		 */
-		ret = 0;
-	}
 	/*
 	 * There may be some unwritten disk at the end of a part-written
 	 * fs-block-sized block.  Go zero that now.
@@ -1060,24 +1056,29 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
 			kfree(dio);
 		}
 	} else {
+		ssize_t transferred = 0;
+
 		finished_one_bio(dio);
 		ret2 = dio_await_completion(dio);
 		if (ret == 0)
 			ret = ret2;
 		if (ret == 0)
 			ret = dio->page_errors;
-		if (ret == 0 && dio->result) {
+		if (dio->result) {
 			loff_t i_size = i_size_read(inode);
 
-			ret = dio->result;
+			transferred = dio->result;
 			/*
 			 * Adjust the return value if the read crossed a
 			 * non-block-aligned EOF.
 			 */
-			if (rw == READ && (offset + ret > i_size))
-				ret = i_size - offset;
+			if (rw == READ && (offset + transferred > i_size))
+				transferred = i_size - offset;
 		}
-		dio_complete(dio, offset, ret);
+		dio_complete(dio, offset, transferred);
+		if (ret == 0)
+			ret = transferred;
+
 		/* We could have also come here on an AIO file extend */
 		if (!is_sync_kiocb(iocb) && rw == WRITE &&
 		    ret >= 0 && dio->result == dio->size)
@@ -1088,6 +1089,13 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
 			aio_complete(iocb, ret, 0);
 		kfree(dio);
 	}
+	if (ret == -ENOTBLK && rw == WRITE) {
+		/*
+		 * The entire request will be be handled by buffered I/O
+		 * when we return
+		 */
+		ret = 0;
+	}
 	return ret;
 }
 
diff --git a/fs/dnotify.c b/fs/dnotify.c
index 38c62fe57..daee2edb1 100644
--- a/fs/dnotify.c
+++ b/fs/dnotify.c
@@ -173,9 +173,7 @@ EXPORT_SYMBOL_GPL(dnotify_parent);
 static int __init dnotify_init(void)
 {
 	dn_cache = kmem_cache_create("dnotify_cache",
-		sizeof(struct dnotify_struct), 0, 0, NULL, NULL);
-	if (!dn_cache)
-		panic("cannot create dnotify slab cache");
+		sizeof(struct dnotify_struct), 0, SLAB_PANIC, NULL, NULL);
 	return 0;
 }
 
diff --git a/fs/dquot.c b/fs/dquot.c
index 6c58af758..70280bc2f 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -75,6 +75,7 @@
 #include <linux/proc_fs.h>
 #include <linux/security.h>
 #include <linux/kmod.h>
+#include <linux/pagemap.h>
 
 #include <asm/uaccess.h>
 
@@ -305,7 +306,7 @@ EXPORT_SYMBOL(mark_info_dirty);
 
 int dquot_acquire(struct dquot *dquot)
 {
-	int ret = 0;
+	int ret = 0, ret2 = 0;
 	struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
 	down(&dquot->dq_lock);
@@ -318,8 +319,15 @@ int dquot_acquire(struct dquot *dquot)
 	/* Instantiate dquot if needed */
 	if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && !dquot->dq_off) {
 		ret = dqopt->ops[dquot->dq_type]->commit_dqblk(dquot);
+		/* Write the info if needed */
+		if (info_dirty(&dqopt->info[dquot->dq_type]))
+			ret2 = dqopt->ops[dquot->dq_type]->write_file_info(dquot->dq_sb, dquot->dq_type);
 		if (ret < 0)
 			goto out_iolock;
+		if (ret2 < 0) {
+			ret = ret2;
+			goto out_iolock;
+		}
 	}
 	set_bit(DQ_ACTIVE_B, &dquot->dq_flags);
 out_iolock:
@@ -333,7 +341,7 @@ out_iolock:
  */
 int dquot_commit(struct dquot *dquot)
 {
-	int ret = 0;
+	int ret = 0, ret2 = 0;
 	struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
 	down(&dqopt->dqio_sem);
@@ -345,12 +353,15 @@ int dquot_commit(struct dquot *dquot)
 	spin_unlock(&dq_list_lock);
 	/* Inactive dquot can be only if there was error during read/init
 	 * => we have better not writing it */
-	if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
+	if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
 		ret = dqopt->ops[dquot->dq_type]->commit_dqblk(dquot);
+		if (info_dirty(&dqopt->info[dquot->dq_type]))
+			ret2 = dqopt->ops[dquot->dq_type]->write_file_info(dquot->dq_sb, dquot->dq_type);
+		if (ret >= 0)
+			ret = ret2;
+	}
 out_sem:
 	up(&dqopt->dqio_sem);
-	if (info_dirty(&dqopt->info[dquot->dq_type]))
-		dquot->dq_sb->dq_op->write_info(dquot->dq_sb, dquot->dq_type);
 	return ret;
 }
 
@@ -359,7 +370,7 @@ out_sem:
  */
 int dquot_release(struct dquot *dquot)
 {
-	int ret = 0;
+	int ret = 0, ret2 = 0;
 	struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
 	down(&dquot->dq_lock);
@@ -367,7 +378,14 @@ int dquot_release(struct dquot *dquot)
 	if (atomic_read(&dquot->dq_count) > 1)
 		goto out_dqlock;
 	down(&dqopt->dqio_sem);
-	ret = dqopt->ops[dquot->dq_type]->release_dqblk(dquot);
+	if (dqopt->ops[dquot->dq_type]->release_dqblk) {
+		ret = dqopt->ops[dquot->dq_type]->release_dqblk(dquot);
+		/* Write the info */
+		if (info_dirty(&dqopt->info[dquot->dq_type]))
+			ret2 = dqopt->ops[dquot->dq_type]->write_file_info(dquot->dq_sb, dquot->dq_type);
+		if (ret >= 0)
+			ret = ret2;
+	}
 	clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
 	up(&dqopt->dqio_sem);
 out_dqlock:
@@ -529,7 +547,7 @@ we_slept:
 	clear_dquot_dirty(dquot);
 	if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
 		spin_unlock(&dq_list_lock);
-		dquot_release(dquot);
+		dquot->dq_sb->dq_op->release_dquot(dquot);
 		goto we_slept;
 	}
 	atomic_dec(&dquot->dq_count);
@@ -546,7 +564,7 @@ static struct dquot *get_empty_dquot(struct super_block *sb, int type)
 {
 	struct dquot *dquot;
 
-	dquot = kmem_cache_alloc(dquot_cachep, SLAB_KERNEL);
+	dquot = kmem_cache_alloc(dquot_cachep, SLAB_NOFS);
 	if(!dquot)
 		return NODQUOT;
 
@@ -605,7 +623,7 @@ we_slept:
 	 * finished or it will be canceled due to dq_count > 1 test */
 	wait_on_dquot(dquot);
 	/* Read the dquot and instantiate it (everything done only if needed) */
-	if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && dquot_acquire(dquot) < 0) {
+	if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && sb->dq_op->acquire_dquot(dquot) < 0) {
 		dqput(dquot);
 		return NODQUOT;
 	}
@@ -1203,8 +1221,11 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
 		if (transfer_to[cnt] == NODQUOT)
 			continue;
 
-		dquot_decr_inodes(transfer_from[cnt], 1);
-		dquot_decr_space(transfer_from[cnt], space);
+		/* Due to IO error we might not have transfer_from[] structure */
+		if (transfer_from[cnt]) {
+			dquot_decr_inodes(transfer_from[cnt], 1);
+			dquot_decr_space(transfer_from[cnt], space);
+		}
 
 		dquot_incr_inodes(transfer_to[cnt], 1);
 		dquot_incr_space(transfer_to[cnt], space);
@@ -1259,6 +1280,8 @@ struct dquot_operations dquot_operations = {
 	.free_inode	= dquot_free_inode,
 	.transfer	= dquot_transfer,
 	.write_dquot	= dquot_commit,
+	.acquire_dquot	= dquot_acquire,
+	.release_dquot	= dquot_release,
 	.mark_dirty	= dquot_mark_dquot_dirty,
 	.write_info	= dquot_commit_info
 };
@@ -1363,9 +1386,21 @@ static int vfs_quota_on_file(struct file *f, int type, int format_id)
 	error = -EINVAL;
 	if (!fmt->qf_ops->check_quota_file(sb, type))
 		goto out_file_init;
-	/* We don't want quota and atime on quota files (deadlocks possible) */
+	/* We don't want quota and atime on quota files (deadlocks possible)
+	 * We also need to set GFP mask differently because we cannot recurse
+	 * into filesystem when allocating page for quota inode */
 	down_write(&dqopt->dqptr_sem);
 	inode->i_flags |= S_NOQUOTA | S_NOATIME;
+
+	/*
+	 * We write to quota files deep within filesystem code.  We don't want
+	 * the VFS to reenter filesystem code when it tries to allocate a
+	 * pagecache page for the quota file write.  So clear __GFP_FS in
+	 * the quota file's allocation flags.
+	 */
+	mapping_set_gfp_mask(inode->i_mapping,
+		mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
+
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		to_drop[cnt] = inode->i_dquot[cnt];
 		inode->i_dquot[cnt] = NODQUOT;
@@ -1714,9 +1749,8 @@ static int __init dquot_init(void)
 
 	dquot_cachep = kmem_cache_create("dquot", 
 			sizeof(struct dquot), sizeof(unsigned long) * 4,
-			SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, NULL, NULL);
-	if (!dquot_cachep)
-		panic("Cannot create dquot SLAB cache");
+			SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_PANIC,
+			NULL, NULL);
 
 	order = 0;
 	dquot_hash = (struct hlist_head *)__get_free_pages(GFP_ATOMIC, order);
@@ -1760,6 +1794,8 @@ EXPORT_SYMBOL(vfs_get_dqblk);
 EXPORT_SYMBOL(vfs_set_dqblk);
 EXPORT_SYMBOL(dquot_commit);
 EXPORT_SYMBOL(dquot_commit_info);
+EXPORT_SYMBOL(dquot_acquire);
+EXPORT_SYMBOL(dquot_release);
 EXPORT_SYMBOL(dquot_mark_dquot_dirty);
 EXPORT_SYMBOL(dquot_initialize);
 EXPORT_SYMBOL(dquot_drop);
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index dbec5f9d5..bc30a3cdd 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -147,14 +147,6 @@
 /* Get the "struct epitem" from an epoll queue wrapper */
 #define EP_ITEM_FROM_EPQUEUE(p) (container_of(p, struct ep_pqueue, pt)->epi)
 
-/*
- * This is used to optimize the event transfer to userspace. Since this
- * is kept on stack, it should be pretty small.
- */
-#define EP_MAX_BUF_EVENTS 32
-
-
-
 /*
  * Node that is linked into the "wake_task_list" member of the "struct poll_safewake".
  * It is used to keep track on all tasks that are currently inside the wake_up() code
@@ -309,7 +301,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,
 static void ep_unregister_pollwait(struct eventpoll *ep, struct epitem *epi);
 static int ep_unlink(struct eventpoll *ep, struct epitem *epi);
 static int ep_remove(struct eventpoll *ep, struct epitem *epi);
-static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync);
+static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *key);
 static int ep_eventpoll_close(struct inode *inode, struct file *file);
 static unsigned int ep_eventpoll_poll(struct file *file, poll_table *wait);
 static int ep_collect_ready_items(struct eventpoll *ep,
@@ -507,6 +499,11 @@ asmlinkage long sys_epoll_create(int size)
 	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n",
 		     current, size));
 
+	/* Sanity check on the size parameter */
+	error = -EINVAL;
+	if (size <= 0)
+		goto eexit_1;
+
 	/* Correctly size the hash */
 	hashbits = ep_get_hash_bits((unsigned int) size);
 
@@ -1296,7 +1293,7 @@ eexit_1:
  * machanism. It is called by the stored file descriptors when they
  * have events to report.
  */
-static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync)
+static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *key)
 {
 	int pwake = 0;
 	unsigned long flags;
@@ -1430,11 +1427,10 @@ static int ep_collect_ready_items(struct eventpoll *ep, struct list_head *txlist
 static int ep_send_events(struct eventpoll *ep, struct list_head *txlist,
 			  struct epoll_event __user *events)
 {
-	int eventcnt = 0, eventbuf = 0;
+	int eventcnt = 0;
 	unsigned int revents;
 	struct list_head *lnk;
 	struct epitem *epi;
-	struct epoll_event event[EP_MAX_BUF_EVENTS];
 
 	/*
 	 * We can loop without lock because this is a task private list.
@@ -1460,28 +1456,16 @@ static int ep_send_events(struct eventpoll *ep, struct list_head *txlist,
 		epi->revents = revents & epi->event.events;
 
 		if (epi->revents) {
-			event[eventbuf] = epi->event;
-			event[eventbuf].events &= revents;
-			eventbuf++;
-			if (eventbuf == EP_MAX_BUF_EVENTS) {
-				if (__copy_to_user(&events[eventcnt], event,
-						   eventbuf * sizeof(struct epoll_event)))
-					return -EFAULT;
-				eventcnt += eventbuf;
-				eventbuf = 0;
-			}
+			if (__put_user(epi->revents,
+				       &events[eventcnt].events) ||
+			    __put_user(epi->event.data,
+				       &events[eventcnt].data))
+				return -EFAULT;
 			if (epi->event.events & EPOLLONESHOT)
 				epi->event.events &= EP_PRIVATE_BITS;
+			eventcnt++;
 		}
 	}
-
-	if (eventbuf) {
-		if (__copy_to_user(&events[eventcnt], event,
-				   eventbuf * sizeof(struct epoll_event)))
-			return -EFAULT;
-		eventcnt += eventbuf;
-	}
-
 	return eventcnt;
 }
 
@@ -1695,22 +1679,14 @@ static int __init eventpoll_init(void)
 	ep_poll_safewake_init(&psw);
 
 	/* Allocates slab cache used to allocate "struct epitem" items */
-	error = -ENOMEM;
-	epi_cache = kmem_cache_create("eventpoll_epi",
-				      sizeof(struct epitem),
-				      0,
-				      SLAB_HWCACHE_ALIGN | EPI_SLAB_DEBUG, NULL, NULL);
-	if (!epi_cache)
-		goto eexit_1;
+	epi_cache = kmem_cache_create("eventpoll_epi", sizeof(struct epitem),
+			0, SLAB_HWCACHE_ALIGN|EPI_SLAB_DEBUG|SLAB_PANIC,
+			NULL, NULL);
 
 	/* Allocates slab cache used to allocate "struct eppoll_entry" */
-	error = -ENOMEM;
 	pwq_cache = kmem_cache_create("eventpoll_pwq",
-				      sizeof(struct eppoll_entry),
-				      0,
-				      EPI_SLAB_DEBUG, NULL, NULL);
-	if (!pwq_cache)
-		goto eexit_2;
+			sizeof(struct eppoll_entry), 0,
+			EPI_SLAB_DEBUG|SLAB_PANIC, NULL, NULL);
 
 	/*
 	 * Register the virtual file system that will be the source of inodes
@@ -1718,27 +1694,20 @@ static int __init eventpoll_init(void)
 	 */
 	error = register_filesystem(&eventpoll_fs_type);
 	if (error)
-		goto eexit_3;
+		goto epanic;
 
 	/* Mount the above commented virtual file system */
 	eventpoll_mnt = kern_mount(&eventpoll_fs_type);
 	error = PTR_ERR(eventpoll_mnt);
 	if (IS_ERR(eventpoll_mnt))
-		goto eexit_4;
-
-	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: successfully initialized.\n", current));
+		goto epanic;
 
+	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: successfully initialized.\n",
+			current));
 	return 0;
 
-eexit_4:
-	unregister_filesystem(&eventpoll_fs_type);
-eexit_3:
-	kmem_cache_destroy(pwq_cache);
-eexit_2:
-	kmem_cache_destroy(epi_cache);
-eexit_1:
-
-	return error;
+epanic:
+	panic("eventpoll_init() failed\n");
 }
 
 
@@ -1755,4 +1724,3 @@ module_init(eventpoll_init);
 module_exit(eventpoll_exit);
 
 MODULE_LICENSE("GPL");
-
diff --git a/fs/exec.c b/fs/exec.c
index f73d2c4cc..f30b49540 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -293,53 +293,48 @@ EXPORT_SYMBOL(copy_strings_kernel);
  * This routine is used to map in a page into an address space: needed by
  * execve() for the initial stack and environment pages.
  *
- * tsk->mmap_sem is held for writing.
+ * vma->vm_mm->mmap_sem is held for writing.
  */
-void put_dirty_page(struct task_struct *tsk, struct page *page,
-			unsigned long address, pgprot_t prot)
+void install_arg_page(struct vm_area_struct *vma,
+			struct page *page, unsigned long address)
 {
+	struct mm_struct *mm = vma->vm_mm;
 	pgd_t * pgd;
 	pmd_t * pmd;
 	pte_t * pte;
-	struct pte_chain *pte_chain;
 
-	if (page_count(page) != 1)
-		printk(KERN_ERR "mem_map disagrees with %p at %08lx\n",
-				page, address);
-
-	pgd = pgd_offset(tsk->mm, address);
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain)
+	if (unlikely(anon_vma_prepare(vma)))
 		goto out_sig;
-	spin_lock(&tsk->mm->page_table_lock);
-	pmd = pmd_alloc(tsk->mm, pgd, address);
+
+	flush_dcache_page(page);
+	pgd = pgd_offset(mm, address);
+
+	spin_lock(&mm->page_table_lock);
+	pmd = pmd_alloc(mm, pgd, address);
 	if (!pmd)
 		goto out;
-	pte = pte_alloc_map(tsk->mm, pmd, address);
+	pte = pte_alloc_map(mm, pmd, address);
 	if (!pte)
 		goto out;
 	if (!pte_none(*pte)) {
 		pte_unmap(pte);
 		goto out;
 	}
+	mm->rss++;
 	lru_cache_add_active(page);
-	flush_dcache_page(page);
-	set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(page, prot))));
-	pte_chain = page_add_rmap(page, pte, pte_chain);
+	set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(
+					page, vma->vm_page_prot))));
+	page_add_anon_rmap(page, vma, address);
 	pte_unmap(pte);
-	tsk->mm->rss++;
-	spin_unlock(&tsk->mm->page_table_lock);
+	spin_unlock(&mm->page_table_lock);
 
 	/* no need for flush_tlb */
-	pte_chain_free(pte_chain);
 	return;
 out:
-	spin_unlock(&tsk->mm->page_table_lock);
+	spin_unlock(&mm->page_table_lock);
 out_sig:
 	__free_page(page);
-	force_sig(SIGKILL, tsk);
-	pte_chain_free(pte_chain);
-	return;
+	force_sig(SIGKILL, current);
 }
 
 int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
@@ -414,6 +409,8 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 		return -ENOMEM;
 	}
 
+	memset(mpnt, 0, sizeof(*mpnt));
+
 	down_write(&mm->mmap_sem);
 	{
 		mpnt->vm_mm = mm;
@@ -435,11 +432,6 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 		else
 			mpnt->vm_flags = VM_STACK_FLAGS;
 		mpnt->vm_page_prot = protection_map[mpnt->vm_flags & 0x7];
-		mpnt->vm_ops = NULL;
-		mpnt->vm_pgoff = 0;
-		mpnt->vm_file = NULL;
-		INIT_LIST_HEAD(&mpnt->shared);
-		mpnt->vm_private_data = (void *) 0;
 		insert_vm_struct(mm, mpnt);
 		mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
 	}
@@ -448,8 +440,7 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 		struct page *page = bprm->page[i];
 		if (page) {
 			bprm->page[i] = NULL;
-			put_dirty_page(current, page, stack_base,
-					mpnt->vm_page_prot);
+			install_arg_page(mpnt, page, stack_base);
 		}
 		stack_base += PAGE_SIZE;
 	}
@@ -1003,7 +994,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
 			return retval;
 
 		/* Remember if the application is TASO.  */
-		bprm->sh_bang = eh->ah.entry < 0x100000000;
+		bprm->sh_bang = eh->ah.entry < 0x100000000UL;
 
 		bprm->file = file;
 		bprm->loader = loader;
@@ -1083,14 +1074,14 @@ int do_execve(char * filename,
 	int retval;
 	int i;
 
-	sched_balance_exec();
-
 	file = open_exec(filename);
 
 	retval = PTR_ERR(file);
 	if (IS_ERR(file))
 		return retval;
 
+	sched_balance_exec();
+
 	bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
 	memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
 
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index c435e0a64..edde9a5d5 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -155,11 +155,15 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
 
 		if (!IS_ROOT(pd)) {
 			/* must have found a connected parent - great */
+			spin_lock(&pd->d_lock);
 			pd->d_flags &= ~DCACHE_DISCONNECTED;
+			spin_unlock(&pd->d_lock);
 			noprogress = 0;
 		} else if (pd == sb->s_root) {
 			printk(KERN_ERR "export: Eeek filesystem root is not connected, impossible\n");
+			spin_lock(&pd->d_lock);
 			pd->d_flags &= ~DCACHE_DISCONNECTED;
+			spin_unlock(&pd->d_lock);
 			noprogress = 0;
 		} else {
 			/* we have hit the top of a disconnected path.  Try
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index cbd6ae899..e03b54231 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -663,7 +663,7 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
 	}
 	brelse(bitmap_bh);
 	printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n",
-		percpu_counter_read(EXT2_SB(sb)->s_freeinodes_counter),
+		percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter),
 		desc_count, bitmap_count);
 	unlock_super(sb);
 	return desc_count;
@@ -724,7 +724,7 @@ void ext2_check_inodes_bitmap (struct super_block * sb)
 		bitmap_count += x;
 	}
 	brelse(bitmap_bh);
-	if (percpu_counter_read(EXT2_SB(sb)->s_freeinodes_counter) !=
+	if (percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter) !=
 				bitmap_count)
 		ext2_error(sb, "ext2_check_inodes_bitmap",
 			    "Wrong free inodes count in super block, "
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index e7cc85d8b..769c0b3af 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -584,6 +584,7 @@ out:
 	if (err == -EAGAIN)
 		goto changed;
 
+	goal = 0;
 	if (ext2_find_goal(inode, iblock, chain, partial, &goal) < 0)
 		goto changed;
 
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c
index 101055bbf..945d22aa8 100644
--- a/fs/ext2/ioctl.c
+++ b/fs/ext2/ioctl.c
@@ -25,7 +25,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 	switch (cmd) {
 	case EXT2_IOC_GETFLAGS:
 		flags = ei->i_flags & EXT2_FL_USER_VISIBLE;
-		return put_user(flags, (int *) arg);
+		return put_user(flags, (int __user *) arg);
 	case EXT2_IOC_SETFLAGS: {
 		unsigned int oldflags;
 
@@ -35,7 +35,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EACCES;
 
-		if (get_user(flags, (int *) arg))
+		if (get_user(flags, (int __user *) arg))
 			return -EFAULT;
 
 		if (!S_ISDIR(inode->i_mode))
@@ -64,13 +64,13 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 		return 0;
 	}
 	case EXT2_IOC_GETVERSION:
-		return put_user(inode->i_generation, (int *) arg);
+		return put_user(inode->i_generation, (int __user *) arg);
 	case EXT2_IOC_SETVERSION:
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;
-		if (get_user(inode->i_generation, (int *) arg))
+		if (get_user(inode->i_generation, (int __user *) arg))
 			return -EFAULT;	
 		inode->i_ctime = CURRENT_TIME;
 		mark_inode_dirty(inode);
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index b76259ede..d0e5ca59b 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -205,8 +205,6 @@ void ext3_delete_inode (struct inode * inode)
 		 * need to make sure that the in-core orphan linked list
 		 * is properly cleaned up. */
 		ext3_orphan_del(NULL, inode);
-
-		ext3_std_error(inode->i_sb, PTR_ERR(handle));
 		goto no_delete;
 	}
 
@@ -811,6 +809,7 @@ out:
 	if (err == -EAGAIN)
 		goto changed;
 
+	goal = 0;
 	down(&ei->truncate_sem);
 	if (ext3_find_goal(inode, iblock, chain, partial, &goal) < 0) {
 		up(&ei->truncate_sem);
@@ -1081,15 +1080,28 @@ static int ext3_prepare_write(struct file *file, struct page *page,
 	struct inode *inode = page->mapping->host;
 	int ret, needed_blocks = ext3_writepage_trans_blocks(inode);
 	handle_t *handle;
+	int tried_commit = 0;
 
+retry:
 	handle = ext3_journal_start(inode, needed_blocks);
 	if (IS_ERR(handle)) {
 		ret = PTR_ERR(handle);
 		goto out;
 	}
 	ret = block_prepare_write(page, from, to, ext3_get_block);
-	if (ret != 0)
-		goto prepare_write_failed;
+	if (ret) {
+		if (ret != -ENOSPC || tried_commit)
+			goto prepare_write_failed;
+		/*
+		 * It could be that there _is_ free space, but it's all tied up
+		 * in uncommitted bitmaps.  So force a commit here, which makes
+		 * those blocks allocatable and try again.
+		 */
+		tried_commit = 1;
+		handle->h_sync = 1;
+		ext3_journal_stop(handle);
+		goto retry;
+	}
 
 	if (ext3_should_journal_data(inode)) {
 		ret = walk_page_buffers(handle, page_buffers(page),
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index 3681474e5..0d5003913 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -26,7 +26,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 	switch (cmd) {
 	case EXT3_IOC_GETFLAGS:
 		flags = ei->i_flags & EXT3_FL_USER_VISIBLE;
-		return put_user(flags, (int *) arg);
+		return put_user(flags, (int __user *) arg);
 	case EXT3_IOC_SETFLAGS: {
 		handle_t *handle = NULL;
 		int err;
@@ -40,7 +40,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EACCES;
 
-		if (get_user(flags, (int *) arg))
+		if (get_user(flags, (int __user *) arg))
 			return -EFAULT;
 
 		if (!S_ISDIR(inode->i_mode))
@@ -100,7 +100,7 @@ flags_err:
 	}
 	case EXT3_IOC_GETVERSION:
 	case EXT3_IOC_GETVERSION_OLD:
-		return put_user(inode->i_generation, (int *) arg);
+		return put_user(inode->i_generation, (int __user *) arg);
 	case EXT3_IOC_SETVERSION:
 	case EXT3_IOC_SETVERSION_OLD: {
 		handle_t *handle;
@@ -112,7 +112,7 @@ flags_err:
 			return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;
-		if (get_user(generation, (int *) arg))
+		if (get_user(generation, (int __user *) arg))
 			return -EFAULT;
 
 		handle = ext3_journal_start(inode, 1);
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 6ed3d4ff2..d2ad34e13 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -872,6 +872,8 @@ restart:
 		wait_on_buffer(bh);
 		if (!buffer_uptodate(bh)) {
 			/* read error, skip block & hope for the best */
+			ext3_error(sb, __FUNCTION__, "reading directory #%lu "
+				   "offset %lu\n", dir->i_ino, block);
 			brelse(bh);
 			goto next;
 		}
@@ -1763,14 +1765,19 @@ static int empty_dir (struct inode * inode)
 	struct buffer_head * bh;
 	struct ext3_dir_entry_2 * de, * de1;
 	struct super_block * sb;
-	int err;
+	int err = 0;
 
 	sb = inode->i_sb;
 	if (inode->i_size < EXT3_DIR_REC_LEN(1) + EXT3_DIR_REC_LEN(2) ||
 	    !(bh = ext3_bread (NULL, inode, 0, 0, &err))) {
-	    	ext3_warning (inode->i_sb, "empty_dir",
-			      "bad directory (dir #%lu) - no data block",
-			      inode->i_ino);
+		if (err)
+			ext3_error(inode->i_sb, __FUNCTION__,
+				   "error %d reading directory #%lu offset 0",
+				   err, inode->i_ino);
+		else
+			ext3_warning(inode->i_sb, __FUNCTION__,
+				     "bad directory (dir #%lu) - no data block",
+				     inode->i_ino);
 		return 1;
 	}
 	de = (struct ext3_dir_entry_2 *) bh->b_data;
@@ -1792,24 +1799,26 @@ static int empty_dir (struct inode * inode)
 	while (offset < inode->i_size ) {
 		if (!bh ||
 			(void *) de >= (void *) (bh->b_data+sb->s_blocksize)) {
+			err = 0;
 			brelse (bh);
 			bh = ext3_bread (NULL, inode,
 				offset >> EXT3_BLOCK_SIZE_BITS(sb), 0, &err);
 			if (!bh) {
-#if 0
-				ext3_error (sb, "empty_dir",
-				"directory #%lu contains a hole at offset %lu",
-					inode->i_ino, offset);
-#endif
+				if (err)
+					ext3_error(sb, __FUNCTION__,
+						   "error %d reading directory"
+						   " #%lu offset %lu",
+						   err, inode->i_ino, offset);
 				offset += sb->s_blocksize;
 				continue;
 			}
 			de = (struct ext3_dir_entry_2 *) bh->b_data;
 		}
-		if (!ext3_check_dir_entry ("empty_dir", inode, de, bh,
-					   offset)) {
-			brelse (bh);
-			return 1;
+		if (!ext3_check_dir_entry("empty_dir", inode, de, bh, offset)) {
+			de = (struct ext3_dir_entry_2 *)(bh->b_data +
+							 sb->s_blocksize);
+			offset = (offset | (sb->s_blocksize - 1)) + 1;
+			continue;
 		}
 		if (le32_to_cpu(de->inode)) {
 			brelse (bh);
@@ -1953,8 +1962,6 @@ int ext3_orphan_del(handle_t *handle, struct inode *inode)
 		goto out_brelse;
 	NEXT_ORPHAN(inode) = 0;
 	err = ext3_mark_iloc_dirty(handle, inode, &iloc);
-	if (err)
-		goto out_brelse;
 
 out_err:
 	ext3_std_error(inode->i_sb, err);
@@ -2255,11 +2262,15 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
 	/*
 	 * ok, that's it
 	 */
-	retval = ext3_delete_entry(handle, old_dir, old_de, old_bh);
-	if (retval == -ENOENT) {
-		/*
-		 * old_de could have moved out from under us.
-		 */
+	if (le32_to_cpu(old_de->inode) != old_inode->i_ino ||
+	    old_de->name_len != old_dentry->d_name.len ||
+	    strncmp(old_de->name, old_dentry->d_name.name, old_de->name_len) ||
+	    (retval = ext3_delete_entry(handle, old_dir,
+					old_de, old_bh)) == -ENOENT) {
+		/* old_de could have moved from under us during htree split, so
+		 * make sure that we are deleting the right entry.  We might
+		 * also be pointing to a stale entry in the unused part of
+		 * old_bh so just checking inum and the name isn't enough. */
 		struct buffer_head *old_bh2;
 		struct ext3_dir_entry_2 *old_de2;
 
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 4bbb5a078..ad0977b17 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -521,6 +521,8 @@ static void ext3_clear_inode(struct inode *inode)
 static int ext3_dquot_initialize(struct inode *inode, int type);
 static int ext3_dquot_drop(struct inode *inode);
 static int ext3_write_dquot(struct dquot *dquot);
+static int ext3_acquire_dquot(struct dquot *dquot);
+static int ext3_release_dquot(struct dquot *dquot);
 static int ext3_mark_dquot_dirty(struct dquot *dquot);
 static int ext3_write_info(struct super_block *sb, int type);
 static int ext3_quota_on(struct super_block *sb, int type, int format_id, char *path);
@@ -536,6 +538,8 @@ static struct dquot_operations ext3_quota_operations = {
 	.free_inode	= dquot_free_inode,
 	.transfer	= dquot_transfer,
 	.write_dquot	= ext3_write_dquot,
+	.acquire_dquot	= ext3_acquire_dquot,
+	.release_dquot	= ext3_release_dquot,
 	.mark_dirty	= ext3_mark_dquot_dirty,
 	.write_info	= ext3_write_info
 };
@@ -1639,6 +1643,7 @@ static journal_t *ext3_get_journal(struct super_block *sb, int journal_inum)
 	if (!journal) {
 		printk(KERN_ERR "EXT3-fs: Could not load journal inode\n");
 		iput(journal_inode);
+		return NULL;
 	}
 	journal->j_private = sb;
 	ext3_init_journal_params(EXT3_SB(sb), journal);
@@ -1870,13 +1875,17 @@ static void ext3_commit_super (struct super_block * sb,
 static void ext3_mark_recovery_complete(struct super_block * sb,
 					struct ext3_super_block * es)
 {
-	journal_flush(EXT3_SB(sb)->s_journal);
+	journal_t *journal = EXT3_SB(sb)->s_journal;
+
+	journal_lock_updates(journal);
+	journal_flush(journal);
 	if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) &&
 	    sb->s_flags & MS_RDONLY) {
 		EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
 		sb->s_dirt = 0;
 		ext3_commit_super(sb, es, 1);
 	}
+	journal_unlock_updates(journal);
 }
 
 /*
@@ -2181,6 +2190,38 @@ static int ext3_write_dquot(struct dquot *dquot)
 	return ret;
 }
 
+static int ext3_acquire_dquot(struct dquot *dquot)
+{
+	int ret, err;
+	handle_t *handle;
+
+	handle = ext3_journal_start(dquot_to_inode(dquot),
+					EXT3_QUOTA_INIT_BLOCKS);
+	if (IS_ERR(handle))
+		return PTR_ERR(handle);
+	ret = dquot_acquire(dquot);
+	err = ext3_journal_stop(handle);
+	if (!ret)
+		ret = err;
+	return ret;
+}
+
+static int ext3_release_dquot(struct dquot *dquot)
+{
+	int ret, err;
+	handle_t *handle;
+
+	handle = ext3_journal_start(dquot_to_inode(dquot),
+					EXT3_QUOTA_INIT_BLOCKS);
+	if (IS_ERR(handle))
+		return PTR_ERR(handle);
+	ret = dquot_release(dquot);
+	err = ext3_journal_stop(handle);
+	if (!ret)
+		ret = err;
+	return ret;
+}
+
 static int ext3_mark_dquot_dirty(struct dquot *dquot)
 {
 	/* Are we journalling quotas? */
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 00cb5d720..ba1707a5c 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -47,7 +47,8 @@ int fat_get_block(struct inode *inode, sector_t iblock,
 	if (!create)
 		return 0;
 	if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) {
-		BUG();
+		fat_fs_panic(sb, "corrupted file size (i_pos %lld, %lld)",
+			     MSDOS_I(inode)->i_pos, MSDOS_I(inode)->mmu_private);
 		return -EIO;
 	}
 	if (!((unsigned long)iblock & (MSDOS_SB(sb)->sec_per_clus - 1))) {
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 480c5d4c3..0da65be32 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1245,7 +1245,7 @@ retry:
 	lock_kernel();
 	if (!(bh = sb_bread(sb, i_pos >> MSDOS_SB(sb)->dir_per_block_bits))) {
 		printk(KERN_ERR "FAT: unable to read inode block "
-		       "for updating (i_pos %lld)", i_pos);
+		       "for updating (i_pos %lld)\n", i_pos);
 		unlock_kernel();
 		return /* -EIO */;
 	}
diff --git a/fs/fcntl.c b/fs/fcntl.c
index abad0aa00..13d351cba 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -627,15 +627,12 @@ void kill_fasync(struct fasync_struct **fp, int sig, int band)
 		read_unlock(&fasync_lock);
 	}
 }
-
 EXPORT_SYMBOL(kill_fasync);
 
 static int __init fasync_init(void)
 {
 	fasync_cache = kmem_cache_create("fasync_cache",
-		sizeof(struct fasync_struct), 0, 0, NULL, NULL);
-	if (!fasync_cache)
-		panic("cannot create fasync slab cache");
+		sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL, NULL);
 	return 0;
 }
 
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 2f91937ed..5f3ccf989 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -75,8 +75,23 @@ void __mark_inode_dirty(struct inode *inode, int flags)
 	if ((inode->i_state & flags) == flags)
 		return;
 
-	if (unlikely(block_dump))
-		printk("%s(%d): dirtied file\n", current->comm, current->pid);
+	if (unlikely(block_dump)) {
+		struct dentry *dentry = NULL;
+		const char *name = "?";
+
+		if (!list_empty(&inode->i_dentry)) {
+			dentry = list_entry(inode->i_dentry.next,
+					    struct dentry, d_alias);
+			if (dentry && dentry->d_name.name)
+				name = (const char *) dentry->d_name.name;
+		}
+
+		if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev"))
+			printk(KERN_DEBUG
+			       "%s(%d): dirtied inode %lu (%s) on %s\n",
+			       current->comm, current->pid, inode->i_ino,
+			       name, inode->i_sb->s_id);
+	}
 
 	spin_lock(&inode_lock);
 	if ((inode->i_state & flags) != flags) {
@@ -295,11 +310,6 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
 				list_move(&inode->i_list, &sb->s_dirty);
 				continue;
 			}
-			/*
-			 * Assume that all inodes on this superblock are memory
-			 * backed.  Skip the superblock.
-			 */
-			break;
 		}
 
 		if (wbc->nonblocking && bdi_write_congested(bdi)) {
@@ -382,12 +392,26 @@ writeback_inodes(struct writeback_control *wbc)
 
 	spin_lock(&inode_lock);
 	spin_lock(&sb_lock);
+restart:
 	sb = sb_entry(super_blocks.prev);
 	for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) {
 		if (!list_empty(&sb->s_dirty) || !list_empty(&sb->s_io)) {
+			/* we're making our own get_super here */
+			sb->s_count++;
 			spin_unlock(&sb_lock);
-			sync_sb_inodes(sb, wbc);
+			/*
+			 * If we can't get the readlock, there's no sense in
+			 * waiting around, most of the time the FS is going to
+			 * be unmounted by the time it is released.
+			 */
+			if (down_read_trylock(&sb->s_umount)) {
+				if (sb->s_root)
+					sync_sb_inodes(sb, wbc);
+				up_read(&sb->s_umount);
+			}
 			spin_lock(&sb_lock);
+			if (__put_super(sb))
+				goto restart;
 		}
 		if (wbc->nr_to_write <= 0)
 			break;
@@ -409,18 +433,15 @@ writeback_inodes(struct writeback_control *wbc)
  */
 void sync_inodes_sb(struct super_block *sb, int wait)
 {
-	struct page_state ps;
 	struct writeback_control wbc = {
-		.bdi		= NULL,
 		.sync_mode	= wait ? WB_SYNC_ALL : WB_SYNC_HOLD,
-		.older_than_this = NULL,
-		.nr_to_write	= 0,
 	};
+	unsigned long nr_dirty = read_page_state(nr_dirty);
+	unsigned long nr_unstable = read_page_state(nr_unstable);
 
-	get_page_state(&ps);
-	wbc.nr_to_write = ps.nr_dirty + ps.nr_unstable +
+	wbc.nr_to_write = nr_dirty + nr_unstable +
 			(inodes_stat.nr_inodes - inodes_stat.nr_unused) +
-			ps.nr_dirty + ps.nr_unstable;
+			nr_dirty + nr_unstable;
 	wbc.nr_to_write += wbc.nr_to_write / 2;		/* Bit more for luck */
 	spin_lock(&inode_lock);
 	sync_sb_inodes(sb, &wbc);
@@ -521,6 +542,9 @@ void write_inode_now(struct inode *inode, int sync)
 		.sync_mode = WB_SYNC_ALL,
 	};
 
+	if (inode->i_mapping->backing_dev_info->memory_backed)
+		return;
+
 	spin_lock(&inode_lock);
 	__writeback_single_inode(inode, &wbc);
 	spin_unlock(&inode_lock);
diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c
index 701f896f1..d38e18c2f 100644
--- a/fs/hfs/catalog.c
+++ b/fs/hfs/catalog.c
@@ -101,11 +101,11 @@ int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *
 	if (err != -ENOENT) {
 		if (!err)
 			err = -EEXIST;
-		goto out;
+		goto err2;
 	}
 	err = hfs_brec_insert(&fd, &entry, entry_size);
 	if (err)
-		goto out;
+		goto err2;
 
 	hfs_cat_build_key(fd.search_key, dir->i_ino, str);
 	entry_size = hfs_cat_build_record(&entry, cnid, inode);
@@ -114,16 +114,24 @@ int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *
 		/* panic? */
 		if (!err)
 			err = -EEXIST;
-		goto out;
+		goto err1;
 	}
 	err = hfs_brec_insert(&fd, &entry, entry_size);
-	if (!err) {
-		dir->i_size++;
-		mark_inode_dirty(dir);
-	}
-out:
+	if (err)
+		goto err1;
+
+	dir->i_size++;
+	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
+	mark_inode_dirty(dir);
 	hfs_find_exit(&fd);
+	return 0;
 
+err1:
+	hfs_cat_build_key(fd.search_key, cnid, NULL);
+	if (!hfs_brec_find(&fd))
+		hfs_brec_remove(&fd);
+err2:
+	hfs_find_exit(&fd);
 	return err;
 }
 
@@ -240,6 +248,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
 	}
 
 	dir->i_size--;
+	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(dir);
 	res = 0;
 out:
@@ -292,6 +301,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name,
 	if (err)
 		goto out;
 	dst_dir->i_size++;
+	dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(dst_dir);
 
 	/* finally remove the old entry */
@@ -303,6 +313,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name,
 	if (err)
 		goto out;
 	src_dir->i_size--;
+	src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(src_dir);
 
 	type = entry.type;
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 9a578e83c..4ff20bcc4 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -96,7 +96,7 @@ int hfs_releasepage(struct page *page, int mask)
 			}
 			hfs_bnode_unhash(node);
 			hfs_bnode_free(node);
-		} while (--i);
+		} while (--i && nidx < tree->node_count);
 		spin_unlock(&tree->hash_lock);
 	}
 	//printk("releasepage: %lu,%x = %d\n", page->index, mask, res);
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
index 2d1ff31b1..8e1fc76ca 100644
--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -33,7 +33,7 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
 
 	if ((node->type == HFS_NODE_INDEX) &&
 	   !(node->tree->attributes & HFS_TREE_VARIDXKEYS)) {
-		retval = node->tree->max_key_len;
+		retval = node->tree->max_key_len + 2;
 	} else {
 		recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2);
 		if (!recoff)
@@ -144,7 +144,7 @@ skip:
 		if (tree->attributes & HFS_TREE_VARIDXKEYS)
 			key_len = be16_to_cpu(fd->search_key->key_len) + 2;
 		else {
-			fd->search_key->key_len = tree->max_key_len;
+			fd->search_key->key_len = cpu_to_be16(tree->max_key_len);
 			key_len = tree->max_key_len + 2;
 		}
 		goto again;
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index 03a01a3f6..9bb1055f1 100644
--- a/fs/hfsplus/catalog.c
+++ b/fs/hfsplus/catalog.c
@@ -165,11 +165,11 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str, struct ino
 	if (err != -ENOENT) {
 		if (!err)
 			err = -EEXIST;
-		goto out;
+		goto err2;
 	}
 	err = hfs_brec_insert(&fd, &entry, entry_size);
 	if (err)
-		goto out;
+		goto err2;
 
 	hfsplus_cat_build_key(fd.search_key, dir->i_ino, str);
 	entry_size = hfsplus_cat_build_record(&entry, cnid, inode);
@@ -178,16 +178,24 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str, struct ino
 		/* panic? */
 		if (!err)
 			err = -EEXIST;
-		goto out;
+		goto err1;
 	}
 	err = hfs_brec_insert(&fd, &entry, entry_size);
-	if (!err) {
-		dir->i_size++;
-		mark_inode_dirty(dir);
-	}
-out:
+	if (err)
+		goto err1;
+
+	dir->i_size++;
+	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
+	mark_inode_dirty(dir);
 	hfs_find_exit(&fd);
+	return 0;
 
+err1:
+	hfsplus_cat_build_key(fd.search_key, cnid, NULL);
+	if (!hfs_brec_find(&fd))
+		hfs_brec_remove(&fd);
+err2:
+	hfs_find_exit(&fd);
 	return err;
 }
 
@@ -259,6 +267,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str)
 		goto out;
 
 	dir->i_size--;
+	dir->i_mtime = dir->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(dir);
 out:
 	hfs_find_exit(&fd);
@@ -304,6 +313,7 @@ int hfsplus_rename_cat(u32 cnid,
 	if (err)
 		goto out;
 	dst_dir->i_size++;
+	dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(dst_dir);
 
 	/* finally remove the old entry */
@@ -315,6 +325,7 @@ int hfsplus_rename_cat(u32 cnid,
 	if (err)
 		goto out;
 	src_dir->i_size--;
+	src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(src_dir);
 
 	/* remove old thread entry */
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index 656b5a2a4..456e0a3b0 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -18,6 +18,13 @@
 #include "hfsplus_fs.h"
 #include "hfsplus_raw.h"
 
+static inline void hfsplus_instantiate(struct dentry *dentry,
+				       struct inode *inode, u32 cnid)
+{
+	dentry->d_fsdata = (void *)(unsigned long)cnid;
+	d_instantiate(dentry, inode);
+}
+
 /* Find the entry inside dir named dentry->d_name */
 static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry,
 				     struct nameidata *nd)
@@ -52,6 +59,7 @@ again:
 			goto fail;
 		}
 		cnid = be32_to_cpu(entry.folder.id);
+		dentry->d_fsdata = (void *)(unsigned long)cnid;
 	} else if (type == HFSPLUS_FILE) {
 		if (fd.entrylength < sizeof(struct hfsplus_cat_file)) {
 			err = -EIO;
@@ -233,11 +241,11 @@ int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode,
 	res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
 	if (res) {
 		inode->i_nlink = 0;
+		hfsplus_delete_inode(inode);
 		iput(inode);
 		return res;
 	}
-	dentry->d_fsdata = (void *)inode->i_ino;
-	d_instantiate(dentry, inode);
+	hfsplus_instantiate(dentry, inode, inode->i_ino);
 	mark_inode_dirty(inode);
 	return 0;
 }
@@ -284,8 +292,7 @@ int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, struct dentry
 		return res;
 
 	inode->i_nlink++;
-	dst_dentry->d_fsdata = (void *)(unsigned long)cnid;
-	d_instantiate(dst_dentry, inode);
+	hfsplus_instantiate(dst_dentry, inode, cnid);
 	atomic_inc(&inode->i_count);
 	inode->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(inode);
@@ -351,10 +358,11 @@ int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 	res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
 	if (res) {
 		inode->i_nlink = 0;
+		hfsplus_delete_inode(inode);
 		iput(inode);
 		return res;
 	}
-	d_instantiate(dentry, inode);
+	hfsplus_instantiate(dentry, inode, inode->i_ino);
 	mark_inode_dirty(inode);
 	return 0;
 }
@@ -391,7 +399,8 @@ int hfsplus_symlink(struct inode *dir, struct dentry *dentry, const char *symnam
 	res = page_symlink(inode, symname, strlen(symname) + 1);
 	if (res) {
 		inode->i_nlink = 0;
-		iput (inode);
+		hfsplus_delete_inode(inode);
+		iput(inode);
 		return res;
 	}
 
@@ -399,8 +408,7 @@ int hfsplus_symlink(struct inode *dir, struct dentry *dentry, const char *symnam
 	res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
 
 	if (!res) {
-		dentry->d_fsdata = (void *)inode->i_ino;
-		d_instantiate(dentry, inode);
+		hfsplus_instantiate(dentry, inode, inode->i_ino);
 		mark_inode_dirty(inode);
 	}
 
@@ -421,12 +429,12 @@ int hfsplus_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev
 	res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
 	if (res) {
 		inode->i_nlink = 0;
+		hfsplus_delete_inode(inode);
 		iput(inode);
 		return res;
 	}
 	init_special_inode(inode, mode, rdev);
-	dentry->d_fsdata = (void *)inode->i_ino;
-	d_instantiate(dentry, inode);
+	hfsplus_instantiate(dentry, inode, inode->i_ino);
 	mark_inode_dirty(inode);
 
 	return 0;
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 2b3facf45..69d9ea994 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -96,7 +96,7 @@ int hfsplus_releasepage(struct page *page, int mask)
 			}
 			hfs_bnode_unhash(node);
 			hfs_bnode_free(node);
-		} while (--i);
+		} while (--i && nidx < tree->node_count);
 		spin_unlock(&tree->hash_lock);
 	}
 	//printk("releasepage: %lu,%x = %d\n", page->index, mask, res);
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
index 440e0dacf..bd05477cd 100644
--- a/fs/hfsplus/ioctl.c
+++ b/fs/hfsplus/ioctl.c
@@ -31,7 +31,7 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 			flags |= EXT2_FLAG_APPEND; /* EXT2_APPEND_FL */
 		if (HFSPLUS_I(inode).userflags & HFSPLUS_FLG_NODUMP)
 			flags |= EXT2_FLAG_NODUMP; /* EXT2_NODUMP_FL */
-		return put_user(flags, (int *)arg);
+		return put_user(flags, (int __user *)arg);
 	case HFSPLUS_IOC_EXT2_SETFLAGS: {
 		if (IS_RDONLY(inode))
 			return -EROFS;
@@ -39,7 +39,7 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EACCES;
 
-		if (get_user(flags, (int *)arg))
+		if (get_user(flags, (int __user *)arg))
 			return -EFAULT;
 
 		if (flags & (EXT2_FLAG_IMMUTABLE|EXT2_FLAG_APPEND) ||
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 8d4564191..f2893bbc5 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -43,6 +43,8 @@ static struct backing_dev_info hugetlbfs_backing_dev_info = {
 	.memory_backed	= 1,	/* Does not contribute to dirty memory */
 };
 
+int sysctl_hugetlb_shm_group;
+
 static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
 {
 	struct inode *inode = file->f_dentry->d_inode;
@@ -264,40 +266,28 @@ static void hugetlbfs_drop_inode(struct inode *inode)
  * h_pgoff is in HPAGE_SIZE units.
  * vma->vm_pgoff is in PAGE_SIZE units.
  */
-static void
-hugetlb_vmtruncate_list(struct list_head *list, unsigned long h_pgoff)
+static inline void
+hugetlb_vmtruncate_list(struct prio_tree_root *root, unsigned long h_pgoff)
 {
-	struct vm_area_struct *vma;
+	struct vm_area_struct *vma = NULL;
+	struct prio_tree_iter iter;
 
-	list_for_each_entry(vma, list, shared) {
+	while ((vma = vma_prio_tree_next(vma, root, &iter,
+					h_pgoff, ULONG_MAX)) != NULL) {
 		unsigned long h_vm_pgoff;
 		unsigned long v_length;
-		unsigned long h_length;
 		unsigned long v_offset;
 
 		h_vm_pgoff = vma->vm_pgoff << (HPAGE_SHIFT - PAGE_SHIFT);
 		v_length = vma->vm_end - vma->vm_start;
-		h_length = v_length >> HPAGE_SHIFT;
 		v_offset = (h_pgoff - h_vm_pgoff) << HPAGE_SHIFT;
 
 		/*
 		 * Is this VMA fully outside the truncation point?
 		 */
-		if (h_vm_pgoff >= h_pgoff) {
-			zap_hugepage_range(vma, vma->vm_start, v_length);
-			continue;
-		}
-
-		/*
-		 * Is this VMA fully inside the truncaton point?
-		 */
-		if (h_vm_pgoff + (v_length >> HPAGE_SHIFT) <= h_pgoff)
-			continue;
+		if (h_vm_pgoff >= h_pgoff)
+			v_offset = 0;
 
-		/*
-		 * The VMA straddles the truncation point.  v_offset is the
-		 * offset (in bytes) into the VMA where the point lies.
-		 */
 		zap_hugepage_range(vma,
 				vma->vm_start + v_offset,
 				v_length - v_offset);
@@ -319,12 +309,10 @@ static int hugetlb_vmtruncate(struct inode *inode, loff_t offset)
 	pgoff = offset >> HPAGE_SHIFT;
 
 	inode->i_size = offset;
-	down(&mapping->i_shared_sem);
-	if (!list_empty(&mapping->i_mmap))
+	spin_lock(&mapping->i_mmap_lock);
+	if (!prio_tree_empty(&mapping->i_mmap))
 		hugetlb_vmtruncate_list(&mapping->i_mmap, pgoff);
-	if (!list_empty(&mapping->i_mmap_shared))
-		hugetlb_vmtruncate_list(&mapping->i_mmap_shared, pgoff);
-	up(&mapping->i_shared_sem);
+	spin_unlock(&mapping->i_mmap_lock);
 	truncate_hugepages(mapping, offset);
 	return 0;
 }
@@ -375,6 +363,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid,
 
 	inode = new_inode(sb);
 	if (inode) {
+		struct hugetlbfs_inode_info *info;
 		inode->i_mode = mode;
 		inode->i_uid = uid;
 		inode->i_gid = gid;
@@ -383,6 +372,8 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid,
 		inode->i_mapping->a_ops = &hugetlbfs_aops;
 		inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info;
 		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+		info = HUGETLBFS_I(inode);
+		mpol_shared_policy_init(&info->policy);
 		switch (mode & S_IFMT) {
 		default:
 			init_special_inode(inode, mode, dev);
@@ -510,6 +501,33 @@ static void hugetlbfs_put_super(struct super_block *sb)
 	}
 }
 
+static kmem_cache_t *hugetlbfs_inode_cachep;
+
+static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
+{
+	struct hugetlbfs_inode_info *p;
+
+	p = kmem_cache_alloc(hugetlbfs_inode_cachep, SLAB_KERNEL);
+	if (!p)
+		return NULL;
+	return &p->vfs_inode;
+}
+
+static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
+{
+	struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
+
+	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
+	    SLAB_CTOR_CONSTRUCTOR)
+		inode_init_once(&ei->vfs_inode);
+}
+
+static void hugetlbfs_destroy_inode(struct inode *inode)
+{
+	mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy);
+	kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode));
+}
+
 static struct address_space_operations hugetlbfs_aops = {
 	.readpage	= hugetlbfs_readpage,
 	.prepare_write	= hugetlbfs_prepare_write,
@@ -541,6 +559,8 @@ static struct inode_operations hugetlbfs_inode_operations = {
 };
 
 static struct super_operations hugetlbfs_ops = {
+	.alloc_inode    = hugetlbfs_alloc_inode,
+	.destroy_inode  = hugetlbfs_destroy_inode,
 	.statfs		= hugetlbfs_statfs,
 	.drop_inode	= hugetlbfs_drop_inode,
 	.put_super	= hugetlbfs_put_super,
@@ -698,6 +718,12 @@ static unsigned long hugetlbfs_counter(void)
 	return ret;
 }
 
+static int can_do_hugetlb_shm(void)
+{
+	return likely(capable(CAP_IPC_LOCK) ||
+			in_group_p(sysctl_hugetlb_shm_group));
+}
+
 struct file *hugetlb_zero_setup(size_t size)
 {
 	int error;
@@ -707,7 +733,7 @@ struct file *hugetlb_zero_setup(size_t size)
 	struct qstr quick_string;
 	char buf[16];
 
-	if (!capable(CAP_IPC_LOCK))
+	if (!can_do_hugetlb_shm())
 		return ERR_PTR(-EPERM);
 
 	if (!is_hugepage_mem_enough(size))
@@ -755,9 +781,16 @@ static int __init init_hugetlbfs_fs(void)
 	int error;
 	struct vfsmount *vfsmount;
 
+	hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
+					sizeof(struct hugetlbfs_inode_info),
+					0, SLAB_RECLAIM_ACCOUNT,
+					init_once, NULL);
+	if (hugetlbfs_inode_cachep == NULL)
+		return -ENOMEM;
+
 	error = register_filesystem(&hugetlbfs_fs_type);
 	if (error)
-		return error;
+		goto out;
 
 	vfsmount = kern_mount(&hugetlbfs_fs_type);
 
@@ -767,11 +800,16 @@ static int __init init_hugetlbfs_fs(void)
 	}
 
 	error = PTR_ERR(vfsmount);
+
+ out:
+	if (error)
+		kmem_cache_destroy(hugetlbfs_inode_cachep);
 	return error;
 }
 
 static void __exit exit_hugetlbfs_fs(void)
 {
+	kmem_cache_destroy(hugetlbfs_inode_cachep);
 	unregister_filesystem(&hugetlbfs_fs_type);
 }
 
diff --git a/fs/inode.c b/fs/inode.c
index 282d86aed..042e3bb45 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -149,8 +149,20 @@ static struct inode *alloc_inode(struct super_block *sb)
 		mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
 		mapping->assoc_mapping = NULL;
 		mapping->backing_dev_info = &default_backing_dev_info;
-		if (sb->s_bdev)
-			mapping->backing_dev_info = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
+
+		/*
+		 * If the block_device provides a backing_dev_info for client
+		 * inodes then use that.  Otherwise the inode share the bdev's
+		 * backing_dev_info.
+		 */
+		if (sb->s_bdev) {
+			struct backing_dev_info *bdi;
+
+			bdi = sb->s_bdev->bd_inode_backing_dev_info;
+			if (!bdi)
+				bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info;
+			mapping->backing_dev_info = bdi;
+		}
 		memset(&inode->u, 0, sizeof(inode->u));
 		inode->i_mapping = mapping;
 	}
@@ -184,12 +196,12 @@ void inode_init_once(struct inode *inode)
 	init_rwsem(&inode->i_alloc_sem);
 	INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC);
 	spin_lock_init(&inode->i_data.tree_lock);
-	init_MUTEX(&inode->i_data.i_shared_sem);
+	spin_lock_init(&inode->i_data.i_mmap_lock);
 	atomic_set(&inode->i_data.truncate_count, 0);
 	INIT_LIST_HEAD(&inode->i_data.private_list);
 	spin_lock_init(&inode->i_data.private_lock);
-	INIT_LIST_HEAD(&inode->i_data.i_mmap);
-	INIT_LIST_HEAD(&inode->i_data.i_mmap_shared);
+	INIT_PRIO_TREE_ROOT(&inode->i_data.i_mmap);
+	INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear);
 	spin_lock_init(&inode->i_lock);
 	i_size_ordered_init(inode);
 }
@@ -671,13 +683,14 @@ static struct inode * get_new_inode_fast(struct super_block *sb, struct hlist_he
 
 static inline unsigned long hash(struct super_block *sb, unsigned long hashval)
 {
-	unsigned long tmp = hashval + ((unsigned long) sb / L1_CACHE_BYTES);
-	tmp = tmp + (tmp >> I_HASHBITS);
+	unsigned long tmp;
+
+	tmp = (hashval * (unsigned long)sb) ^ (GOLDEN_RATIO_PRIME + hashval) /
+			L1_CACHE_BYTES;
+	tmp = tmp ^ ((tmp ^ GOLDEN_RATIO_PRIME) >> I_HASHBITS);
 	return tmp & I_HASHMASK;
 }
 
-/* Yeah, I know about quadratic hash. Maybe, later. */
-
 /**
  *	iunique - get a unique inode number
  *	@sb: superblock
@@ -1383,11 +1396,8 @@ void __init inode_init(unsigned long mempages)
 
 	/* inode slab cache */
 	inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode),
-					 0, SLAB_HWCACHE_ALIGN, init_once,
-					 NULL);
-	if (!inode_cachep)
-		panic("cannot create inode slab cache");
-
+				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, init_once,
+				NULL);
 	set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);
 }
 
@@ -1408,5 +1418,4 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
 		printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n",
 		       mode);
 }
-
 EXPORT_SYMBOL(init_special_inode);
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 9737a0fa8..aef5391e4 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -18,6 +18,7 @@ static int file_ioctl(struct file *filp,unsigned int cmd,unsigned long arg)
 	int error;
 	int block;
 	struct inode * inode = filp->f_dentry->d_inode;
+	int __user *p = (int __user *)arg;
 
 	switch (cmd) {
 		case FIBMAP:
@@ -29,18 +30,18 @@ static int file_ioctl(struct file *filp,unsigned int cmd,unsigned long arg)
 				return -EINVAL;
 			if (!capable(CAP_SYS_RAWIO))
 				return -EPERM;
-			if ((error = get_user(block, (int *) arg)) != 0)
+			if ((error = get_user(block, p)) != 0)
 				return error;
 
 			res = mapping->a_ops->bmap(mapping, block);
-			return put_user(res, (int *) arg);
+			return put_user(res, p);
 		}
 		case FIGETBSZ:
 			if (inode->i_sb == NULL)
 				return -EBADF;
-			return put_user(inode->i_sb->s_blocksize, (int *) arg);
+			return put_user(inode->i_sb->s_blocksize, p);
 		case FIONREAD:
-			return put_user(i_size_read(inode) - filp->f_pos, (int *) arg);
+			return put_user(i_size_read(inode) - filp->f_pos, p);
 	}
 	if (filp->f_op && filp->f_op->ioctl)
 		return filp->f_op->ioctl(inode, filp, cmd, arg);
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 884719be0..768367ef9 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -1207,7 +1207,7 @@ static void isofs_read_inode(struct inode * inode)
 	struct iso_directory_record * tmpde = NULL;
 	unsigned int de_len;
 	unsigned long offset;
-	int volume_seq_no, i;
+	int i;
 	struct iso_inode_info *ei = ISOFS_I(inode);
 
 	bh = sb_bread(inode->i_sb, block);
@@ -1348,9 +1348,6 @@ static void isofs_read_inode(struct inode * inode)
 		test_and_set_gid(&inode->i_gid, sbi->s_gid);
 	}
 
-	/* get the volume sequence number */
-	volume_seq_no = isonum_723 (de->volume_sequence_number) ;
-
 	/* Install the inode operations vector */
 	if (S_ISREG(inode->i_mode)) {
 		inode->i_fop = &generic_ro_fops;
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 1c029b209..c1eb3c536 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -412,7 +412,8 @@ write_out_data:
 			tagp = &bh->b_data[sizeof(journal_header_t)];
 			space_left = bh->b_size - sizeof(journal_header_t);
 			first_tag = 1;
-			set_bit(BH_JWrite, &bh->b_state);
+			set_buffer_jwrite(bh);
+			set_buffer_dirty(bh);
 			wbuf[bufs++] = bh;
 
 			/* Record it so that we can wait for IO
@@ -638,7 +639,8 @@ wait_for_iobuf:
 	JBUFFER_TRACE(descriptor, "write commit block");
 	{
 		struct buffer_head *bh = jh2bh(descriptor);
-		set_buffer_uptodate(bh);
+
+		set_buffer_dirty(bh);
 		sync_dirty_buffer(bh);
 		if (unlikely(!buffer_uptodate(bh)))
 			err = -EIO;
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 3c95df4bb..a1e2a5d12 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -585,9 +585,13 @@ int journal_bmap(journal_t *journal, unsigned long blocknr,
  * We play buffer_head aliasing tricks to write data/metadata blocks to
  * the journal without copying their contents, but for journal
  * descriptor blocks we do need to generate bona fide buffers.
+ *
+ * After the caller of journal_get_descriptor_buffer() has finished modifying
+ * the buffer's contents they really should run flush_dcache_page(bh->b_page).
+ * But we don't bother doing that, so there will be coherency problems with
+ * mmaps of blockdevs which hold live JBD-controlled filesystems.
  */
-
-struct journal_head * journal_get_descriptor_buffer(journal_t *journal)
+struct journal_head *journal_get_descriptor_buffer(journal_t *journal)
 {
 	struct buffer_head *bh;
 	unsigned long blocknr;
@@ -599,8 +603,10 @@ struct journal_head * journal_get_descriptor_buffer(journal_t *journal)
 		return NULL;
 
 	bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
+	lock_buffer(bh);
 	memset(bh->b_data, 0, journal->j_blocksize);
-	bh->b_state |= (1 << BH_Dirty);
+	set_buffer_uptodate(bh);
+	unlock_buffer(bh);
 	BUFFER_TRACE(bh, "return this buffer");
 	return journal_add_journal_head(bh);
 }
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 1564a4816..6bbd73644 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -522,7 +522,7 @@ void journal_write_revoke_records(journal_t *journal,
 			kmem_cache_free(revoke_record_cache, record);
 		}
 	}
-	if (descriptor) 
+	if (descriptor)
 		flush_descriptor(journal, descriptor, offset);
 	jbd_debug(1, "Wrote %d revoke records\n", count);
 }
@@ -606,7 +606,7 @@ static void flush_descriptor(journal_t *journal,
 	header->r_count = htonl(offset);
 	set_buffer_jwrite(bh);
 	BUFFER_TRACE(bh, "write");
-	set_buffer_uptodate(bh);
+	set_buffer_dirty(bh);
 	ll_rw_block(WRITE, 1, &bh);
 }
 #endif
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 14d40be76..21ddf0b28 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -633,12 +633,20 @@ repeat:
 
 		if (jh->b_jlist == BJ_Shadow) {
 			wait_queue_head_t *wqh;
+			DEFINE_WAIT(wait);
 
 			JBUFFER_TRACE(jh, "on shadow: sleep");
 			jbd_unlock_bh_state(bh);
 			/* commit wakes up all shadow buffers after IO */
-			wqh = bh_waitq_head(jh2bh(jh));
-			wait_event(*wqh, (jh->b_jlist != BJ_Shadow));
+			wqh = bh_waitq_head(bh);
+			for ( ; ; ) {
+				prepare_to_wait(wqh, &wait,
+						TASK_UNINTERRUPTIBLE);
+				if (jh->b_jlist != BJ_Shadow)
+					break;
+				schedule();
+			}
+			finish_wait(wqh, &wait);
 			goto repeat;
 		}
 
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index fe30a98f4..4d34ba69c 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -1582,7 +1582,7 @@ jffs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 			struct jffs_fmcontrol *fmc = c->fmc;
 			printk("Flash status -- ");
 			if (!access_ok(VERIFY_WRITE,
-				       (struct jffs_flash_status *)arg,
+				       (struct jffs_flash_status __user *)arg,
 				       sizeof(struct jffs_flash_status))) {
 				D(printk("jffs_ioctl(): Bad arg in "
 					 "JFFS_GET_STATUS ioctl!\n"));
@@ -1598,7 +1598,7 @@ jffs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 			       "begin: %d, end: %d\n",
 			       fst.size, fst.used, fst.dirty,
 			       fst.begin, fst.end);
-			if (copy_to_user((struct jffs_flash_status *)arg,
+			if (copy_to_user((struct jffs_flash_status __user *)arg,
 					 &fst,
 					 sizeof(struct jffs_flash_status))) {
 				ret = -EFAULT;
diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile
index de0e41895..1a47874c7 100644
--- a/fs/jffs2/Makefile
+++ b/fs/jffs2/Makefile
@@ -6,16 +6,10 @@
 
 obj-$(CONFIG_JFFS2_FS) += jffs2.o
 
-COMPR_OBJS	:= compr.o compr_rubin.o compr_rtime.o compr_zlib.o
-JFFS2_OBJS	:= dir.o file.o ioctl.o nodelist.o malloc.o \
-	read.o nodemgmt.o readinode.o write.o scan.o gc.o \
-	symlink.o build.o erase.o background.o fs.o writev.o
+jffs2-y	:= compr.o compr_rubin.o compr_rtime.o compr_zlib.o
+jffs2-y	+= dir.o file.o ioctl.o nodelist.o malloc.o
+jffs2-y	+= read.o nodemgmt.o readinode.o write.o scan.o gc.o
+jffs2-y	+= symlink.o build.o erase.o background.o fs.o writev.o
+jffs2-y	+= super.o
 
-LINUX_OBJS-24	:= super-v24.o crc32.o
-LINUX_OBJS-25	:= super.o
-LINUX_OBJS-26	:= super.o
-
-NAND_OBJS-$(CONFIG_JFFS2_FS_NAND)	:= wbuf.o
-
-jffs2-objs := $(COMPR_OBJS) $(JFFS2_OBJS) $(VERS_OBJS) $(NAND_OBJS-y) \
-	      $(LINUX_OBJS-$(VERSION)$(PATCHLEVEL))
+jffs2-$(CONFIG_JFFS2_FS_NAND)	+= wbuf.o
diff --git a/fs/jfs/jfs_btree.h b/fs/jfs/jfs_btree.h
index 53c0a6ea7..ba4fb09f5 100644
--- a/fs/jfs/jfs_btree.h
+++ b/fs/jfs/jfs_btree.h
@@ -1,5 +1,5 @@
 /*
- *   Copyright (c) International Business Machines Corp., 2000-2001
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   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
@@ -108,13 +108,12 @@ struct btpage {
  * record the path traversed during the search;
  * top frame record the leaf page/entry selected.
  */
-#define	MAXTREEHEIGHT		8
 struct btframe {	/* stack frame */
 	s64 bn;			/* 8: */
 	s16 index;		/* 2: */
-	s16 lastindex;		/* 2: */
-	struct metapage *mp;	/* 4: */
-};				/* (16) */
+	s16 lastindex;		/* 2: unused */
+	struct metapage *mp;	/* 4/8: */
+};				/* (16/24) */
 
 struct btstack {
 	struct btframe *top;
@@ -125,12 +124,15 @@ struct btstack {
 #define BT_CLR(btstack)\
 	(btstack)->top = (btstack)->stack
 
+#define BT_STACK_FULL(btstack)\
+	( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1]))
+
 #define BT_PUSH(BTSTACK, BN, INDEX)\
 {\
+	assert(!BT_STACK_FULL(BTSTACK));\
 	(BTSTACK)->top->bn = BN;\
 	(BTSTACK)->top->index = INDEX;\
 	++(BTSTACK)->top;\
-	assert((BTSTACK)->top != &((BTSTACK)->stack[MAXTREEHEIGHT]));\
 }
 
 #define BT_POP(btstack)\
@@ -139,6 +141,16 @@ struct btstack {
 #define BT_STACK(btstack)\
 	( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top )
 
+static inline void BT_STACK_DUMP(struct btstack *btstack)
+{
+	int i;
+	printk("btstack dump:\n");
+	for (i = 0; i < MAXTREEHEIGHT; i++)
+		printk(KERN_ERR "bn = %Lx, index = %d\n",
+		       btstack->stack[i].bn,
+		       btstack->stack[i].index);
+}
+
 /* retrieve search results */
 #define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)\
 {\
diff --git a/fs/jfs/jfs_debug.c b/fs/jfs/jfs_debug.c
index adc9c4a3a..91a0a889e 100644
--- a/fs/jfs/jfs_debug.c
+++ b/fs/jfs/jfs_debug.c
@@ -1,6 +1,6 @@
 /*
- *   Copyright (c) International Business Machines Corp., 2000-2002
- *   Portions Copyright (c) Christoph Hellwig, 2001-2002
+ *   Copyright (C) International Business Machines Corp., 2000-2004
+ *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  *
  *   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
@@ -147,7 +147,7 @@ void jfs_proc_clean(void)
 	if (base) {
 		for (i = 0; i < NPROCENT; i++)
 			remove_proc_entry(Entries[i].name, base);
-		remove_proc_entry("jfs", base);
+		remove_proc_entry("jfs", proc_root_fs);
 	}
 }
 
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 3e9e629f4..1b55df36f 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) International Business Machines Corp., 2000-2003
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   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
@@ -382,7 +382,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
 	IREAD_LOCK(ipbmap);
 
 	/* block to be freed better be within the mapsize. */
-	if (blkno + nblocks > bmp->db_mapsize) {
+	if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) {
 		IREAD_UNLOCK(ipbmap);
 		printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
 		       (unsigned long long) blkno,
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index c749681a2..3c3140dd7 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) International Business Machines Corp., 2000-2003
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   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
@@ -177,8 +177,8 @@ static int ciCompare(struct component_name * key, dtpage_t * p, int si,
 static void dtGetKey(dtpage_t * p, int i, struct component_name * key,
 		     int flag);
 
-static void ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
-			       int ri, struct component_name * key, int flag);
+static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
+			      int ri, struct component_name * key, int flag);
 
 static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
 			  ddata_t * data, struct dt_lock **);
@@ -342,7 +342,6 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 	struct metapage *mp;
 	s64 offset;
 	uint page_offset;
-	int rc;
 	struct tlock *tlck;
 	s64 xaddr;
 
@@ -379,6 +378,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 		 * It's time to move the inline table to an external
 		 * page and begin to build the xtree
 		 */
+		if (dbAlloc(ip, 0, sbi->nbperpage, &xaddr))
+			goto clean_up;	/* No space */
 
 		/*
 		 * Save the table, we're going to overwrite it with the
@@ -395,12 +396,12 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 		/*
 		 * Allocate the first block & add it to the xtree
 		 */
-		xaddr = 0;
-		if ((rc =
-		     xtInsert(tid, ip, 0, 0, sbi->nbperpage,
-			      &xaddr, 0))) {
+		if (xtInsert(tid, ip, 0, 0, sbi->nbperpage, &xaddr, 0)) {
+			/* This really shouldn't fail */
 			jfs_warn("add_index: xtInsert failed!");
-			return -EPERM;
+			memcpy(&jfs_ip->i_dirtable, temp_table,
+			       sizeof (temp_table));
+			goto clean_up;
 		}
 		ip->i_size = PSIZE;
 		ip->i_blocks += LBLK2PBLK(sb, sbi->nbperpage);
@@ -408,7 +409,9 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 		if ((mp = get_index_page(ip, 0)) == 0) {
 			jfs_err("add_index: get_metapage failed!");
 			xtTruncate(tid, ip, 0, COMMIT_PWMAP);
-			return -EPERM;
+			memcpy(&jfs_ip->i_dirtable, temp_table,
+			       sizeof (temp_table));
+			goto clean_up;
 		}
 		tlck = txLock(tid, ip, mp, tlckDATA);
 		llck = (struct linelock *) & tlck->lock;
@@ -438,12 +441,9 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 		 * This will be the beginning of a new page
 		 */
 		xaddr = 0;
-		if ((rc =
-		     xtInsert(tid, ip, 0, blkno, sbi->nbperpage,
-			      &xaddr, 0))) {
+		if (xtInsert(tid, ip, 0, blkno, sbi->nbperpage, &xaddr, 0)) {
 			jfs_warn("add_index: xtInsert failed!");
-			jfs_ip->next_index--;
-			return -EPERM;
+			goto clean_up;
 		}
 		ip->i_size += PSIZE;
 		ip->i_blocks += LBLK2PBLK(sb, sbi->nbperpage);
@@ -457,7 +457,7 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 
 	if (mp == 0) {
 		jfs_err("add_index: get/read_metapage failed!");
-		return -EPERM;
+		goto clean_up;
 	}
 
 	lock_index(tid, ip, mp, index);
@@ -472,6 +472,12 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 	release_metapage(mp);
 
 	return index;
+
+      clean_up:
+
+	jfs_ip->next_index--;
+
+	return 0;
 }
 
 /*
@@ -760,11 +766,12 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
 		 */
 	      getChild:
 		/* update max. number of pages to split */
-		if (btstack->nsplit >= 8) {
+		if (BT_STACK_FULL(btstack)) {
 			/* Something's corrupted, mark filesytem dirty so
 			 * chkdsk will fix it.
 			 */
 			jfs_error(sb, "stack overrun in dtSearch!");
+			BT_STACK_DUMP(btstack);
 			rc = -EIO;
 			goto out;
 		}
@@ -971,8 +978,10 @@ static int dtSplitUp(tid_t tid,
 		n -= DTROOTMAXSLOT - sp->header.freecnt; /* header + entries */
 		if (n <= split->nslot)
 			xlen++;
-		if ((rc = dbAlloc(ip, 0, (s64) xlen, &xaddr)))
+		if ((rc = dbAlloc(ip, 0, (s64) xlen, &xaddr))) {
+			DT_PUTPAGE(smp);
 			goto freeKeyName;
+		}
 
 		pxdlist.maxnpxd = 1;
 		pxdlist.npxd = 0;
@@ -1152,9 +1161,16 @@ static int dtSplitUp(tid_t tid,
 			if ((sp->header.flag & BT_ROOT && skip > 1) ||
 			    sp->header.prev != 0 || skip > 1) {
 				/* compute uppercase router prefix key */
-				ciGetLeafPrefixKey(lp,
-						   lp->header.nextindex - 1,
-						   rp, 0, &key, sbi->mntflag);
+				rc = ciGetLeafPrefixKey(lp,
+							lp->header.nextindex-1,
+							rp, 0, &key,
+							sbi->mntflag);
+				if (rc) {
+					DT_PUTPAGE(lmp);
+					DT_PUTPAGE(rmp);
+					DT_PUTPAGE(smp);
+					goto splitOut;
+				}
 			} else {
 				/* next to leftmost entry of
 				   lowest internal level */
@@ -3331,6 +3347,12 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
 		/*
 		 * descend down to leftmost child page
 		 */
+		if (BT_STACK_FULL(btstack)) {
+			DT_PUTPAGE(mp);
+			jfs_error(ip->i_sb, "dtReadFirst: btstack overrun");
+			BT_STACK_DUMP(btstack);
+			return -EIO;
+		}
 		/* push (bn, index) of the parent page/entry */
 		BT_PUSH(btstack, bn, 0);
 
@@ -3713,18 +3735,28 @@ static int ciCompare(struct component_name * key,	/* search key */
  *	     from two adjacent leaf entries
  *	     across page boundary
  *
- * return:
- *	Number of prefix bytes needed to distinguish b from a.
+ * return: non-zero on error
+ *	
  */
-static void ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
+static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
 			       int ri, struct component_name * key, int flag)
 {
 	int klen, namlen;
 	wchar_t *pl, *pr, *kname;
-	wchar_t lname[JFS_NAME_MAX + 1];
-	struct component_name lkey = { 0, lname };
-	wchar_t rname[JFS_NAME_MAX + 1];
-	struct component_name rkey = { 0, rname };
+	struct component_name lkey;
+	struct component_name rkey;
+
+	lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
+					GFP_KERNEL);
+	if (lkey.name == NULL)
+		return -ENOSPC;
+
+	rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
+					GFP_KERNEL);
+	if (rkey.name == NULL) {
+		kfree(lkey.name);
+		return -ENOSPC;
+	}
 
 	/* get left and right key */
 	dtGetKey(lp, li, &lkey, flag);
@@ -3749,7 +3781,7 @@ static void ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
 		*kname = *pr;
 		if (*pl != *pr) {
 			key->namlen = klen + 1;
-			return;
+			goto free_names;
 		}
 	}
 
@@ -3760,7 +3792,10 @@ static void ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
 	} else			/* l->namelen == r->namelen */
 		key->namlen = klen;
 
-	return;
+free_names:
+	kfree(lkey.name);
+	kfree(rkey.name);
+	return 0;
 }
 
 
diff --git a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h
index 1a6ec59da..ac608c9ff 100644
--- a/fs/jfs/jfs_incore.h
+++ b/fs/jfs/jfs_incore.h
@@ -152,6 +152,11 @@ struct jfs_sb_info {
 	pxd_t		ait2;		/* pxd describing AIT copy	*/
 	char		uuid[16];	/* 128-bit uuid for volume	*/
 	char		loguuid[16];	/* 128-bit uuid for log	*/
+	/*
+	 * commit_state is used for synchronization of the jfs_commit
+	 * threads.  It is protected by LAZY_LOCK().
+	 */
+	int		commit_state;	/* commit state */
 	/* Formerly in ipimap */
 	uint		gengen;		/* inode generation generator*/
 	uint		inostamp;	/* shows inode belongs to fileset*/
@@ -164,6 +169,9 @@ struct jfs_sb_info {
 	uint		p_state;	/* state prior to going no integrity */
 };
 
+/* jfs_sb_info commit_state */
+#define IN_LAZYCOMMIT 1
+
 static inline struct jfs_inode_info *JFS_IP(struct inode *inode)
 {
 	return list_entry(inode, struct jfs_inode_info, vfs_inode);
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 73569b11c..f4ce4609c 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -171,6 +171,7 @@ DECLARE_MUTEX(jfs_log_sem);
 extern void txLazyUnlock(struct tblock * tblk);
 extern int jfs_stop_threads;
 extern struct completion jfsIOwait;
+extern int jfs_tlocks_low;
 
 /*
  * forward references
@@ -524,12 +525,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 			tblk->eor = log->eor;
 
 			/* enqueue transaction to commit queue */
-			tblk->cqnext = NULL;
-			if (log->cqueue.head) {
-				log->cqueue.tail->cqnext = tblk;
-				log->cqueue.tail = tblk;
-			} else
-				log->cqueue.head = log->cqueue.tail = tblk;
+			list_add_tail(&tblk->cqueue, &log->cqueue);
 
 			LOGGC_UNLOCK(log);
 		}
@@ -587,7 +583,10 @@ static int lmNextPage(struct jfs_log * log)
 	 *      write or queue the full page at the tail of write queue
 	 */
 	/* get the tail tblk on commit queue */
-	tblk = log->cqueue.tail;
+	if (list_empty(&log->cqueue))
+		tblk = NULL;
+	else
+		tblk = list_entry(log->cqueue.prev, struct tblock, cqueue);
 
 	/* every tblk who has COMMIT record on the current page,
 	 * and has not been committed, must be on commit queue
@@ -688,8 +687,9 @@ int lmGroupCommit(struct jfs_log * log, struct tblock * tblk)
 	if (tblk->xflag & COMMIT_LAZY)
 		tblk->flag |= tblkGC_LAZY;
 
-	if ((!(log->cflag & logGC_PAGEOUT)) && log->cqueue.head &&
-	    (!(tblk->xflag & COMMIT_LAZY) || test_bit(log_FLUSH, &log->flag))) {
+	if ((!(log->cflag & logGC_PAGEOUT)) && (!list_empty(&log->cqueue)) &&
+	    (!(tblk->xflag & COMMIT_LAZY) || test_bit(log_FLUSH, &log->flag)
+	     || jfs_tlocks_low)) {
 		/*
 		 * No pageout in progress
 		 *
@@ -753,7 +753,7 @@ static void lmGCwrite(struct jfs_log * log, int cant_write)
 	struct logpage *lp;
 	int gcpn;		/* group commit page number */
 	struct tblock *tblk;
-	struct tblock *xtblk;
+	struct tblock *xtblk = NULL;
 
 	/*
 	 * build the commit group of a log page
@@ -762,15 +762,16 @@ static void lmGCwrite(struct jfs_log * log, int cant_write)
 	 * transactions with COMMIT records on the same log page.
 	 */
 	/* get the head tblk on the commit queue */
-	tblk = xtblk = log->cqueue.head;
-	gcpn = tblk->pn;
+	gcpn = list_entry(log->cqueue.next, struct tblock, cqueue)->pn;
+
+	list_for_each_entry(tblk, &log->cqueue, cqueue) {
+		if (tblk->pn != gcpn)
+			break;
 
-	while (tblk && tblk->pn == gcpn) {
 		xtblk = tblk;
 
 		/* state transition: (QUEUE, READY) -> COMMIT */
 		tblk->flag |= tblkGC_COMMIT;
-		tblk = tblk->cqnext;
 	}
 	tblk = xtblk;		/* last tblk of the page */
 
@@ -816,7 +817,7 @@ static void lmPostGC(struct lbuf * bp)
 	unsigned long flags;
 	struct jfs_log *log = bp->l_log;
 	struct logpage *lp;
-	struct tblock *tblk;
+	struct tblock *tblk, *temp;
 
 	//LOGGC_LOCK(log);
 	spin_lock_irqsave(&log->gclock, flags);
@@ -826,7 +827,9 @@ static void lmPostGC(struct lbuf * bp)
 	 * remove/wakeup transactions from commit queue who were
 	 * group committed with the current log page
 	 */
-	while ((tblk = log->cqueue.head) && (tblk->flag & tblkGC_COMMIT)) {
+	list_for_each_entry_safe(tblk, temp, &log->cqueue, cqueue) {
+		if (!(tblk->flag & tblkGC_COMMIT))
+			break;
 		/* if transaction was marked GC_COMMIT then
 		 * it has been shipped in the current pageout
 		 * and made it to disk - it is committed.
@@ -836,11 +839,8 @@ static void lmPostGC(struct lbuf * bp)
 			tblk->flag |= tblkGC_ERROR;
 
 		/* remove it from the commit queue */
-		log->cqueue.head = tblk->cqnext;
-		if (log->cqueue.head == NULL)
-			log->cqueue.tail = NULL;
+		list_del(&tblk->cqueue);
 		tblk->flag &= ~tblkGC_QUEUE;
-		tblk->cqnext = 0;
 
 		if (tblk == log->flush_tblk) {
 			/* we can stop flushing the log now */
@@ -893,9 +893,9 @@ static void lmPostGC(struct lbuf * bp)
 	 * select the latest ready transaction as new group leader and
 	 * wake her up to lead her group.
 	 */
-	if ((tblk = log->cqueue.head) &&
+	if ((!list_empty(&log->cqueue)) &&
 	    ((log->gcrtc > 0) || (tblk->bp->l_wqnext != NULL) ||
-	     test_bit(log_FLUSH, &log->flag)))
+	     test_bit(log_FLUSH, &log->flag) || jfs_tlocks_low))
 		/*
 		 * Call lmGCwrite with new group leader
 		 */
@@ -1288,7 +1288,7 @@ int lmLogInit(struct jfs_log * log)
 
 	init_waitqueue_head(&log->syncwait);
 
-	log->cqueue.head = log->cqueue.tail = NULL;
+	INIT_LIST_HEAD(&log->cqueue);
 	log->flush_tblk = NULL;
 
 	log->count = 0;
@@ -1486,6 +1486,7 @@ int lmLogClose(struct super_block *sb)
 		 *      in-line log in host file system
 		 */
 		rc = lmLogShutdown(log);
+		kfree(log);
 		goto out;
 	}
 
@@ -1515,6 +1516,8 @@ int lmLogClose(struct super_block *sb)
 	bd_release(bdev);
 	blkdev_put(bdev);
 
+	kfree(log);
+
       out:
 	up(&jfs_log_sem);
 	jfs_info("lmLogClose: exit(%d)", rc);
@@ -1535,7 +1538,7 @@ int lmLogClose(struct super_block *sb)
 void jfs_flush_journal(struct jfs_log *log, int wait)
 {
 	int i;
-	struct tblock *target;
+	struct tblock *target = NULL;
 
 	/* jfs_write_inode may call us during read-only mount */
 	if (!log)
@@ -1545,13 +1548,12 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
 
 	LOGGC_LOCK(log);
 
-	target = log->cqueue.head;
-
-	if (target) {
+	if (!list_empty(&log->cqueue)) {
 		/*
 		 * This ensures that we will keep writing to the journal as long
 		 * as there are unwritten commit records
 		 */
+		target = list_entry(log->cqueue.prev, struct tblock, cqueue);
 
 		if (test_bit(log_FLUSH, &log->flag)) {
 			/*
@@ -1602,16 +1604,16 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
 	 * If there was recent activity, we may need to wait
 	 * for the lazycommit thread to catch up
 	 */
-	if (log->cqueue.head || !list_empty(&log->synclist)) {
+	if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) {
 		for (i = 0; i < 800; i++) {	/* Too much? */
 			current->state = TASK_INTERRUPTIBLE;
 			schedule_timeout(HZ / 4);
-			if ((log->cqueue.head == NULL) &&
+			if (list_empty(&log->cqueue) &&
 			    list_empty(&log->synclist))
 				break;
 		}
 	}
-	assert(log->cqueue.head == NULL);
+	assert(list_empty(&log->cqueue));
 	assert(list_empty(&log->synclist));
 	clear_bit(log_FLUSH, &log->flag);
 }
diff --git a/fs/jfs/jfs_logmgr.h b/fs/jfs/jfs_logmgr.h
index da4762c3c..995f1241a 100644
--- a/fs/jfs/jfs_logmgr.h
+++ b/fs/jfs/jfs_logmgr.h
@@ -398,10 +398,7 @@ struct jfs_log {
 
 	/* commit */
 	uint cflag;		/* 4: */
-	struct {		/* 8: FIFO commit queue header */
-		struct tblock *head;
-		struct tblock *tail;
-	} cqueue;
+	struct list_head	cqueue; /* FIFO commit queue */
 	struct tblock *flush_tblk; /* tblk we're waiting on for flush */
 	int gcrtc;		/* 4: GC_READY transaction count */
 	struct tblock *gclrt;	/* 4: latest GC_READY transaction */
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index a1fe5f016..8c94bb015 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -228,31 +228,37 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
 	else
 		mapping = inode->i_mapping;
 
-	spin_lock(&meta_lock);
 	hash_ptr = meta_hash(mapping, lblock);
+again:
+	spin_lock(&meta_lock);
 	mp = search_hash(hash_ptr, mapping, lblock);
 	if (mp) {
 	      page_found:
+		mp->count++;
+		lock_metapage(mp);
+		spin_unlock(&meta_lock);
+		if (test_bit(META_stale, &mp->flag)) {
+			release_metapage(mp);
+			yield();	/* Let other waiters release it, too */
+			goto again;
+		}
 		if (test_bit(META_discard, &mp->flag)) {
 			if (!new) {
-				spin_unlock(&meta_lock);
 				jfs_error(inode->i_sb,
 					  "__get_metapage: using a "
 					  "discarded metapage");
+				release_metapage(mp);
 				return NULL;
 			}
 			clear_bit(META_discard, &mp->flag);
 		}
-		mp->count++;
 		jfs_info("__get_metapage: found 0x%p, in hash", mp);
 		if (mp->logical_size != size) {
-			spin_unlock(&meta_lock);
 			jfs_error(inode->i_sb,
 				  "__get_metapage: mp->logical_size != size");
+			release_metapage(mp);
 			return NULL;
 		}
-		lock_metapage(mp);
-		spin_unlock(&meta_lock);
 	} else {
 		l2bsize = inode->i_blkbits;
 		l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;
@@ -451,46 +457,57 @@ void release_metapage(struct metapage * mp)
 	if (--mp->count || atomic_read(&mp->nohomeok)) {
 		unlock_metapage(mp);
 		spin_unlock(&meta_lock);
-	} else {
-		remove_from_hash(mp, meta_hash(mp->mapping, mp->index));
-		spin_unlock(&meta_lock);
-
-		if (mp->page) {
-			kunmap(mp->page);
-			mp->data = 0;
-			if (test_bit(META_dirty, &mp->flag))
-				__write_metapage(mp);
-			if (test_bit(META_sync, &mp->flag)) {
-				sync_metapage(mp);
-				clear_bit(META_sync, &mp->flag);
-			}
-
-			if (test_bit(META_discard, &mp->flag)) {
-				lock_page(mp->page);
-				block_invalidatepage(mp->page, 0);
-				unlock_page(mp->page);
-			}
+		return;
+	}
 
-			page_cache_release(mp->page);
-			INCREMENT(mpStat.pagefree);
+	if (mp->page) {
+		/* Releasing spinlock, we have to check mp->count later */
+		set_bit(META_stale, &mp->flag);
+		spin_unlock(&meta_lock);
+		kunmap(mp->page);
+		mp->data = 0;
+		if (test_bit(META_dirty, &mp->flag))
+			__write_metapage(mp);
+		if (test_bit(META_sync, &mp->flag)) {
+			sync_metapage(mp);
+			clear_bit(META_sync, &mp->flag);
 		}
 
-		if (mp->lsn) {
-			/*
-			 * Remove metapage from logsynclist.
-			 */
-			log = mp->log;
-			LOGSYNC_LOCK(log);
-			mp->log = 0;
-			mp->lsn = 0;
-			mp->clsn = 0;
-			log->count--;
-			list_del(&mp->synclist);
-			LOGSYNC_UNLOCK(log);
+		if (test_bit(META_discard, &mp->flag)) {
+			lock_page(mp->page);
+			block_invalidatepage(mp->page, 0);
+			unlock_page(mp->page);
 		}
 
-		free_metapage(mp);
+		page_cache_release(mp->page);
+		mp->page = NULL;
+		INCREMENT(mpStat.pagefree);
+		spin_lock(&meta_lock);
+	}
+
+	if (mp->lsn) {
+		/*
+		 * Remove metapage from logsynclist.
+		 */
+		log = mp->log;
+		LOGSYNC_LOCK(log);
+		mp->log = 0;
+		mp->lsn = 0;
+		mp->clsn = 0;
+		log->count--;
+		list_del(&mp->synclist);
+		LOGSYNC_UNLOCK(log);
 	}
+	if (mp->count) {
+		/* Someone else is trying to get this metpage */
+		unlock_metapage(mp);
+		spin_unlock(&meta_lock);
+		return;
+	}
+	remove_from_hash(mp, meta_hash(mp->mapping, mp->index));
+	spin_unlock(&meta_lock);
+
+	free_metapage(mp);
 }
 
 void __invalidate_metapages(struct inode *ip, s64 addr, int len)
@@ -510,9 +527,20 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len)
 	for (lblock = addr; lblock < addr + len;
 	     lblock += 1 << l2BlocksPerPage) {
 		hash_ptr = meta_hash(mapping, lblock);
+again:
 		spin_lock(&meta_lock);
 		mp = search_hash(hash_ptr, mapping, lblock);
 		if (mp) {
+			if (test_bit(META_stale, &mp->flag)) {
+				/* Racing with release_metapage */
+				mp->count++;
+				lock_metapage(mp);
+				spin_unlock(&meta_lock);
+				/* racing release_metapage should be done now */
+				release_metapage(mp);
+				goto again;
+			}
+
 			set_bit(META_discard, &mp->flag);
 			spin_unlock(&meta_lock);
 		} else {
diff --git a/fs/jfs/jfs_metapage.h b/fs/jfs/jfs_metapage.h
index 682f773d7..0e58aba58 100644
--- a/fs/jfs/jfs_metapage.h
+++ b/fs/jfs/jfs_metapage.h
@@ -64,6 +64,7 @@ struct metapage {
 #define META_sync	4
 #define META_discard	5
 #define META_forced	6
+#define META_stale	7
 
 #define mark_metapage_dirty(mp) set_bit(META_dirty, &(mp)->flag)
 
diff --git a/fs/jfs/jfs_mount.c b/fs/jfs/jfs_mount.c
index 5cdcaac8f..3de7db13d 100644
--- a/fs/jfs/jfs_mount.c
+++ b/fs/jfs/jfs_mount.c
@@ -288,6 +288,11 @@ int jfs_mount_rw(struct super_block *sb, int remount)
 	 */
 	logMOUNT(sb);
 
+	/*
+	 * Set page cache allocation policy
+	 */
+	mapping_set_gfp_mask(sb->s_bdev->bd_inode->i_mapping, GFP_NOFS);
+
 	return rc;
 }
 
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 551cb7f0b..f48fdeae5 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -48,6 +48,8 @@
 #include <linux/smp_lock.h>
 #include <linux/completion.h>
 #include <linux/suspend.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
 #include "jfs_metapage.h"
@@ -61,25 +63,22 @@
  *      transaction management structures
  */
 static struct {
-	/* tblock */
 	int freetid;		/* index of a free tid structure */
-	wait_queue_head_t freewait;	/* eventlist of free tblock */
-
-	/* tlock */
 	int freelock;		/* index first free lock word */
+	wait_queue_head_t freewait;	/* eventlist of free tblock */
 	wait_queue_head_t freelockwait;	/* eventlist of free tlock */
 	wait_queue_head_t lowlockwait;	/* eventlist of ample tlocks */
 	int tlocksInUse;	/* Number of tlocks in use */
-	int TlocksLow;		/* Indicates low number of available tlocks */
 	spinlock_t LazyLock;	/* synchronize sync_queue & unlock_queue */
 /*	struct tblock *sync_queue; * Transactions waiting for data sync */
-	struct tblock *unlock_queue;	/* Txns waiting to be released */
-	struct tblock *unlock_tail;	/* Tail of unlock_queue */
+	struct list_head unlock_queue;	/* Txns waiting to be released */
 	struct list_head anon_list;	/* inodes having anonymous txns */
 	struct list_head anon_list2;	/* inodes having anonymous txns
 					   that couldn't be sync'ed */
 } TxAnchor;
 
+int jfs_tlocks_low;		/* Indicates low number of available tlocks */
+
 #ifdef CONFIG_JFS_STATISTICS
 struct {
 	uint txBegin;
@@ -95,11 +94,19 @@ struct {
 #endif
 
 static int nTxBlock = 512;	/* number of transaction blocks */
-struct tblock *TxBlock;	        /* transaction block table */
+module_param(nTxBlock, int, 0);
+MODULE_PARM_DESC(nTxBlock,
+		 "Number of transaction blocks (default:512, max:65536)");
 
 static int nTxLock = 4096;	/* number of transaction locks */
-static int TxLockLWM = 4096*.4;	/* Low water mark for number of txLocks used */
-static int TxLockHWM = 4096*.8;	/* High water mark for number of txLocks used */
+module_param(nTxLock, int, 0);
+MODULE_PARM_DESC(nTxLock,
+		 "Number of transaction locks (default:4096, max:65536)");
+
+struct tblock *TxBlock;	        /* transaction block table */
+static int TxLockLWM;		/* Low water mark for number of txLocks used */
+static int TxLockHWM;		/* High water mark for number of txLocks used */
+static int TxLockVHWM;		/* Very High water mark */
 struct tlock *TxLock;           /* transaction lock table */
 
 
@@ -162,7 +169,6 @@ extern void lmSync(struct jfs_log *);
 extern int jfs_commit_inode(struct inode *, int);
 extern int jfs_stop_threads;
 
-struct task_struct *jfsCommitTask;
 extern struct completion jfsIOwait;
 
 /*
@@ -210,9 +216,9 @@ static lid_t txLockAlloc(void)
 		TXN_SLEEP(&TxAnchor.freelockwait);
 	TxAnchor.freelock = TxLock[lid].next;
 	HIGHWATERMARK(stattx.maxlid, lid);
-	if ((++TxAnchor.tlocksInUse > TxLockHWM) && (TxAnchor.TlocksLow == 0)) {
-		jfs_info("txLockAlloc TlocksLow");
-		TxAnchor.TlocksLow = 1;
+	if ((++TxAnchor.tlocksInUse > TxLockHWM) && (jfs_tlocks_low == 0)) {
+		jfs_info("txLockAlloc tlocks low");
+		jfs_tlocks_low = 1;
 		wake_up(&jfs_sync_thread_wait);
 	}
 
@@ -224,9 +230,9 @@ static void txLockFree(lid_t lid)
 	TxLock[lid].next = TxAnchor.freelock;
 	TxAnchor.freelock = lid;
 	TxAnchor.tlocksInUse--;
-	if (TxAnchor.TlocksLow && (TxAnchor.tlocksInUse < TxLockLWM)) {
-		jfs_info("txLockFree TlocksLow no more");
-		TxAnchor.TlocksLow = 0;
+	if (jfs_tlocks_low && (TxAnchor.tlocksInUse < TxLockLWM)) {
+		jfs_info("txLockFree jfs_tlocks_low no more");
+		jfs_tlocks_low = 0;
 		TXN_WAKEUP(&TxAnchor.lowlockwait);
 	}
 	TXN_WAKEUP(&TxAnchor.freelockwait);
@@ -245,12 +251,25 @@ int txInit(void)
 {
 	int k, size;
 
+	/* Verify tunable parameters */
+	if (nTxBlock < 16)
+		nTxBlock = 16;	/* No one should set it this low */
+	if (nTxBlock > 65536)
+		nTxBlock = 65536;
+	if (nTxLock < 256)
+		nTxLock = 256;	/* No one should set it this low */
+	if (nTxLock > 65536)
+		nTxLock = 65536;
 	/*
 	 * initialize transaction block (tblock) table
 	 *
 	 * transaction id (tid) = tblock index
 	 * tid = 0 is reserved.
 	 */
+	TxLockLWM = (nTxLock * 4) / 10;
+	TxLockHWM = (nTxLock * 8) / 10;
+	TxLockVHWM = (nTxLock * 9) / 10;
+
 	size = sizeof(struct tblock) * nTxBlock;
 	TxBlock = (struct tblock *) vmalloc(size);
 	if (TxBlock == NULL)
@@ -295,6 +314,9 @@ int txInit(void)
 	INIT_LIST_HEAD(&TxAnchor.anon_list);
 	INIT_LIST_HEAD(&TxAnchor.anon_list2);
 
+	LAZY_LOCK_INIT();
+	INIT_LIST_HEAD(&TxAnchor.unlock_queue);
+
 	stattx.maxlid = 1;	/* statistics */
 
 	return 0;
@@ -358,7 +380,7 @@ tid_t txBegin(struct super_block *sb, int flag)
 		 * unless COMMIT_FORCE or COMMIT_INODE (which may ultimately
 		 * free tlocks)
 		 */
-		if (TxAnchor.TlocksLow) {
+		if (TxAnchor.tlocksInUse > TxLockVHWM) {
 			INCREMENT(TxStat.txBegin_lockslow);
 			TXN_SLEEP(&TxAnchor.lowlockwait);
 			goto retry;
@@ -450,7 +472,7 @@ void txBeginAnon(struct super_block *sb)
 	/*
 	 * Don't begin transaction if we're getting starved for tlocks
 	 */
-	if (TxAnchor.TlocksLow) {
+	if (TxAnchor.tlocksInUse > TxLockVHWM) {
 		INCREMENT(TxStat.txBeginAnon_lockslow);
 		TXN_SLEEP(&TxAnchor.lowlockwait);
 		goto retry;
@@ -1725,7 +1747,10 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 
 		if (lwm == next)
 			goto out;
-		assert(lwm < next);
+		if (lwm > next) {
+			jfs_err("xtLog: lwm > next\n");
+			goto out;
+		}
 		tlck->flag |= tlckUPDATEMAP;
 		xadlock->flag = mlckALLOCXADLIST;
 		xadlock->count = next - lwm;
@@ -1891,25 +1916,18 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 		/*
 		 *      write log records
 		 */
-		/*
-		 * allocate entries XAD[lwm:next]:
+		/* log after-image for logredo():
+		 *
+		 * logredo() will update bmap for alloc of new/extended
+		 * extents (XAD_NEW|XAD_EXTEND) of XAD[lwm:next) from
+		 * after-image of XADlist;
+		 * logredo() resets (XAD_NEW|XAD_EXTEND) flag when
+		 * applying the after-image to the meta-data page.
 		 */
-		if (lwm < next) {
-			/* log after-image for logredo():
-			 * logredo() will update bmap for alloc of new/extended
-			 * extents (XAD_NEW|XAD_EXTEND) of XAD[lwm:next) from
-			 * after-image of XADlist;
-			 * logredo() resets (XAD_NEW|XAD_EXTEND) flag when
-			 * applying the after-image to the meta-data page.
-			 */
-			lrd->type = cpu_to_le16(LOG_REDOPAGE);
-			PXDaddress(pxd, mp->index);
-			PXDlength(pxd,
-				  mp->logical_size >> tblk->sb->
-				  s_blocksize_bits);
-			lrd->backchain =
-			    cpu_to_le32(lmLog(log, tblk, lrd, tlck));
-		}
+		lrd->type = cpu_to_le16(LOG_REDOPAGE);
+		PXDaddress(pxd, mp->index);
+		PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits);
+		lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
 
 		/*
 		 * truncate entry XAD[twm == next - 1]:
@@ -2559,6 +2577,7 @@ void txFreelock(struct inode *ip)
 	if (!jfs_ip->atlhead)
 		return;
 
+	TXN_LOCK();
 	xtlck = (struct tlock *) &jfs_ip->atlhead;
 
 	while ((lid = xtlck->next)) {
@@ -2579,10 +2598,9 @@ void txFreelock(struct inode *ip)
 		/*
 		 * If inode was on anon_list, remove it
 		 */
-		TXN_LOCK();
 		list_del_init(&jfs_ip->anon_inode_list);
-		TXN_UNLOCK();
 	}
+	TXN_UNLOCK();
 }
 
 
@@ -2602,6 +2620,7 @@ void txAbort(tid_t tid, int dirty)
 	lid_t lid, next;
 	struct metapage *mp;
 	struct tblock *tblk = tid_to_tblock(tid);
+	struct tlock *tlck;
 
 	jfs_warn("txAbort: tid:%d dirty:0x%x", tid, dirty);
 
@@ -2609,9 +2628,10 @@ void txAbort(tid_t tid, int dirty)
 	 * free tlocks of the transaction
 	 */
 	for (lid = tblk->next; lid; lid = next) {
-		next = lid_to_tlock(lid)->next;
-
-		mp = lid_to_tlock(lid)->mp;
+		tlck = lid_to_tlock(lid);
+		next = tlck->next;
+		mp = tlck->mp;
+		JFS_IP(tlck->ip)->xtlid = 0;
 
 		if (mp) {
 			mp->lid = 0;
@@ -2707,50 +2727,54 @@ int jfs_lazycommit(void *arg)
 	int WorkDone;
 	struct tblock *tblk;
 	unsigned long flags;
+	struct jfs_sb_info *sbi;
 
 	daemonize("jfsCommit");
 
-	jfsCommitTask = current;
-
-	LAZY_LOCK_INIT();
-	TxAnchor.unlock_queue = TxAnchor.unlock_tail = 0;
-
 	complete(&jfsIOwait);
 
 	do {
 		LAZY_LOCK(flags);
-restart:
-		WorkDone = 0;
-		while ((tblk = TxAnchor.unlock_queue)) {
-			/*
-			 * We can't get ahead of user thread.  Spinning is
-			 * simpler than blocking/waking.  We shouldn't spin
-			 * very long, since user thread shouldn't be blocking
-			 * between lmGroupCommit & txEnd.
-			 */
-			WorkDone = 1;
+		while (!list_empty(&TxAnchor.unlock_queue)) {
+			WorkDone = 0;
+			list_for_each_entry(tblk, &TxAnchor.unlock_queue,
+					    cqueue) {
 
-			/*
-			 * Remove first transaction from queue
-			 */
-			TxAnchor.unlock_queue = tblk->cqnext;
-			tblk->cqnext = 0;
-			if (TxAnchor.unlock_tail == tblk)
-				TxAnchor.unlock_tail = 0;
+				sbi = JFS_SBI(tblk->sb);
+				/*
+				 * For each volume, the transactions must be
+				 * handled in order.  If another commit thread
+				 * is handling a tblk for this superblock,
+				 * skip it
+				 */
+				if (sbi->commit_state & IN_LAZYCOMMIT)
+					continue;
 
-			LAZY_UNLOCK(flags);
-			txLazyCommit(tblk);
+				sbi->commit_state |= IN_LAZYCOMMIT;
+				WorkDone = 1;
 
-			/*
-			 * We can be running indefinitely if other processors
-			 * are adding transactions to this list
-			 */
-			cond_resched();
-			LAZY_LOCK(flags);
-		}
+				/*
+				 * Remove transaction from queue
+				 */
+				list_del(&tblk->cqueue);
+
+				LAZY_UNLOCK(flags);
+				txLazyCommit(tblk);
+				LAZY_LOCK(flags);
 
-		if (WorkDone)
-			goto restart;
+				sbi->commit_state &= ~IN_LAZYCOMMIT;
+				/*
+				 * Don't continue in the for loop.  (We can't
+				 * anyway, it's unsafe!)  We want to go back to
+				 * the beginning of the list.
+				 */
+				break;
+			}
+
+			/* If there was nothing to do, don't continue */
+			if (!WorkDone)
+				break;
+		}
 
 		if (current->flags & PF_FREEZE) {
 			LAZY_UNLOCK(flags);
@@ -2767,7 +2791,7 @@ restart:
 		}
 	} while (!jfs_stop_threads);
 
-	if (TxAnchor.unlock_queue)
+	if (!list_empty(&TxAnchor.unlock_queue))
 		jfs_err("jfs_lazycommit being killed w/pending transactions!");
 	else
 		jfs_info("jfs_lazycommit being killed\n");
@@ -2780,14 +2804,14 @@ void txLazyUnlock(struct tblock * tblk)
 
 	LAZY_LOCK(flags);
 
-	if (TxAnchor.unlock_tail)
-		TxAnchor.unlock_tail->cqnext = tblk;
-	else
-		TxAnchor.unlock_queue = tblk;
-	TxAnchor.unlock_tail = tblk;
-	tblk->cqnext = 0;
+	list_add_tail(&tblk->cqueue, &TxAnchor.unlock_queue);
+	/*
+	 * Don't wake up a commit thread if there is already one servicing
+	 * this superblock.
+	 */
+	if (!(JFS_SBI(tblk->sb)->commit_state & IN_LAZYCOMMIT))
+		wake_up(&jfs_commit_thread_wait);
 	LAZY_UNLOCK(flags);
-	wake_up(&jfs_commit_thread_wait);
 }
 
 static void LogSyncRelease(struct metapage * mp)
@@ -2821,7 +2845,7 @@ static void LogSyncRelease(struct metapage * mp)
  *	completion
  *
  *	This does almost the same thing as jfs_sync below.  We don't
- *	worry about deadlocking when TlocksLow is set, since we would
+ *	worry about deadlocking when jfs_tlocks_low is set, since we would
  *	expect jfs_sync to get us out of that jam.
  */
 void txQuiesce(struct super_block *sb)
@@ -2912,7 +2936,7 @@ int jfs_sync(void *arg)
 		 * write each inode on the anonymous inode list
 		 */
 		TXN_LOCK();
-		while (TxAnchor.TlocksLow && !list_empty(&TxAnchor.anon_list)) {
+		while (jfs_tlocks_low && !list_empty(&TxAnchor.anon_list)) {
 			jfs_ip = list_entry(TxAnchor.anon_list.next,
 					    struct jfs_inode_info,
 					    anon_inode_list);
@@ -3008,18 +3032,16 @@ int jfs_txanchor_read(char *buffer, char **start, off_t offset, int length,
 		       "freelockwait = %s\n"
 		       "lowlockwait = %s\n"
 		       "tlocksInUse = %d\n"
-		       "TlocksLow = %d\n"
-		       "unlock_queue = 0x%p\n"
-		       "unlock_tail = 0x%p\n",
+		       "jfs_tlocks_low = %d\n"
+		       "unlock_queue is %sempty\n",
 		       TxAnchor.freetid,
 		       freewait,
 		       TxAnchor.freelock,
 		       freelockwait,
 		       lowlockwait,
 		       TxAnchor.tlocksInUse,
-		       TxAnchor.TlocksLow,
-		       TxAnchor.unlock_queue,
-		       TxAnchor.unlock_tail);
+		       jfs_tlocks_low,
+		       list_empty(&TxAnchor.unlock_queue) ? "" : "not ");
 
 	begin = offset;
 	*start = buffer + begin;
diff --git a/fs/jfs/jfs_txnmgr.h b/fs/jfs/jfs_txnmgr.h
index 294d83223..b71b82c2d 100644
--- a/fs/jfs/jfs_txnmgr.h
+++ b/fs/jfs/jfs_txnmgr.h
@@ -1,5 +1,5 @@
 /*
- *   Copyright (c) International Business Machines Corp., 2000-2002
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   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
@@ -53,7 +53,7 @@ struct tblock {
 	u32 logtid;		/* log transaction id */
 
 	/* commit management */
-	struct tblock *cqnext;	/* commit queue link */
+	struct list_head cqueue;	/* commit queue list */
 	s32 clsn;		/* commit lsn */
 	struct lbuf *bp;
 	s32 pn;			/* commit record log page number */
@@ -93,16 +93,16 @@ extern struct tblock *TxBlock;	/* transaction block table */
  *	transaction lock
  */
 struct tlock {
-	lid_t next;		/* index next lockword on tid locklist
+	lid_t next;		/* 2: index next lockword on tid locklist
 				 *          next lockword on freelist
 				 */
-	tid_t tid;		/* transaction id holding lock */
+	tid_t tid;		/* 2: transaction id holding lock */
 
 	u16 flag;		/* 2: lock control */
 	u16 type;		/* 2: log type */
 
-	struct metapage *mp;	/* 4: object page buffer locked */
-	struct inode *ip;	/* 4: object */
+	struct metapage *mp;	/* 4/8: object page buffer locked */
+	struct inode *ip;	/* 4/8: object */
 	/* (16) */
 
 	s16 lock[24];		/* 48: overlay area */
@@ -167,7 +167,7 @@ struct lv {
 #define	TLOCKLONG	28
 
 struct linelock {
-	u16 next;		/* 2: next linelock */
+	lid_t next;		/* 2: next linelock */
 
 	s8 maxcnt;		/* 1: */
 	s8 index;		/* 1: */
@@ -183,7 +183,7 @@ struct linelock {
 #define dt_lock	linelock
 
 struct xtlock {
-	u16 next;		/* 2: */
+	lid_t next;		/* 2: */
 
 	s8 maxcnt;		/* 1: */
 	s8 index;		/* 1: */
@@ -214,7 +214,7 @@ struct xtlock {
  * free maplock (i.e., number of maplock) in the tlock; 
  */
 struct maplock {
-	u16 next;		/* 2: */
+	lid_t next;		/* 2: */
 
 	u8 maxcnt;		/* 2: */
 	u8 index;		/* 2: next free maplock index */
@@ -242,7 +242,7 @@ struct maplock {
 #define	pxd_lock	maplock
 
 struct xdlistlock {
-	u16 next;		/* 2: */
+	lid_t next;		/* 2: */
 
 	u8 maxcnt;		/* 2: */
 	u8 index;		/* 2: */
diff --git a/fs/jfs/jfs_types.h b/fs/jfs/jfs_types.h
index 8666ff19d..3fefbf063 100644
--- a/fs/jfs/jfs_types.h
+++ b/fs/jfs/jfs_types.h
@@ -1,5 +1,5 @@
 /*
- *   Copyright (c) International Business Machines Corp., 2000-2002
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *
  *   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
@@ -34,9 +34,12 @@
 
 /*
  * transaction and lock id's
+ *
+ * Don't change these without carefully considering the impact on the
+ * size and alignment of all of the linelock variants
  */
-typedef uint tid_t;
-typedef uint lid_t;
+typedef u16 tid_t;
+typedef u16 lid_t;
 
 /*
  * Almost identical to Linux's timespec, but not quite
@@ -110,11 +113,12 @@ typedef struct {
 #define	addressPXD(pxd)\
 	( ((s64)((pxd)->addr1)) << 32 | __le32_to_cpu((pxd)->addr2))
 
+#define MAXTREEHEIGHT 8
 /* pxd list */
 struct pxdlist {
 	s16 maxnpxd;
 	s16 npxd;
-	pxd_t pxd[8];
+	pxd_t pxd[MAXTREEHEIGHT];
 };
 
 
diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c
index 6ffcf74f4..f31a9e3f3 100644
--- a/fs/jfs/jfs_umount.c
+++ b/fs/jfs/jfs_umount.c
@@ -121,7 +121,10 @@ int jfs_umount(struct super_block *sb)
 	 * list (to signify skip logredo()).
 	 */
 	if (log) {		/* log = NULL if read-only mount */
-		rc = updateSuper(sb, FM_CLEAN);
+		updateSuper(sb, FM_CLEAN);
+
+		/* Restore default gfp_mask for bdev */
+		mapping_set_gfp_mask(bdev_mapping, GFP_USER);
 
 		/*
 		 * close log: 
@@ -168,5 +171,8 @@ int jfs_umount_rw(struct super_block *sb)
 
 	updateSuper(sb, FM_CLEAN);
 
+	/* Restore default gfp_mask for bdev */
+	mapping_set_gfp_mask(bdev_mapping, GFP_USER);
+
 	return lmLogClose(sb);
 }
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index abfe33f8c..998410ccc 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -135,7 +135,6 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
 
 	insert_inode_hash(ip);
 	mark_inode_dirty(ip);
-	d_instantiate(dentry, ip);
 
 	dip->i_ctime = dip->i_mtime = CURRENT_TIME;
 
@@ -150,7 +149,8 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
 	if (rc) {
 		ip->i_nlink = 0;
 		iput(ip);
-	}
+	} else
+		d_instantiate(dentry, ip);
 
       out2:
 	free_UCSname(&dname);
@@ -265,7 +265,6 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
 
 	insert_inode_hash(ip);
 	mark_inode_dirty(ip);
-	d_instantiate(dentry, ip);
 
 	/* update parent directory inode */
 	dip->i_nlink++;		/* for '..' from child directory */
@@ -281,7 +280,8 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
 	if (rc) {
 		ip->i_nlink = 0;
 		iput(ip);
-	}
+	} else
+		d_instantiate(dentry, ip);
 
       out2:
 	free_UCSname(&dname);
@@ -806,12 +806,14 @@ static int jfs_link(struct dentry *old_dentry,
 	ip->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(dir);
 	atomic_inc(&ip->i_count);
-	d_instantiate(dentry, ip);
 
 	iplist[0] = ip;
 	iplist[1] = dir;
 	rc = txCommit(tid, 2, &iplist[0], 0);
 
+	if (!rc)
+		d_instantiate(dentry, ip);
+
       free_dname:
 	free_UCSname(&dname);
 
@@ -856,7 +858,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
 	unchar *i_fastsymlink;
 	s64 xlen = 0;
 	int bmask = 0, xsize;
-	s64 xaddr;
+	s64 extent = 0, xaddr;
 	struct metapage *mp;
 	struct super_block *sb;
 	struct tblock *tblk;
@@ -890,29 +892,11 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
 	down(&JFS_IP(dip)->commit_sem);
 	down(&JFS_IP(ip)->commit_sem);
 
-	if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE)))
-		goto out3;
-
 	tblk = tid_to_tblock(tid);
 	tblk->xflag |= COMMIT_CREATE;
 	tblk->ino = ip->i_ino;
 	tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
 
-	/*
-	 * create entry for symbolic link in parent directory
-	 */
-
-	ino = ip->i_ino;
-
-
-
-	if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) {
-		jfs_err("jfs_symlink: dtInsert returned %d", rc);
-		/* discard ne inode */
-		goto out3;
-
-	}
-
 	/* fix symlink access permission
 	 * (dir_create() ANDs in the u.u_cmask, 
 	 * but symlinks really need to be 777 access)
@@ -920,7 +904,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
 	ip->i_mode |= 0777;
 
 	/*
-	   *       write symbolic link target path name
+	 * write symbolic link target path name
 	 */
 	xtInitRoot(tid, ip);
 
@@ -964,62 +948,60 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
 		xsize = (ssize + bmask) & ~bmask;
 		xaddr = 0;
 		xlen = xsize >> JFS_SBI(sb)->l2bsize;
-		if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0)) == 0) {
-			ip->i_size = ssize - 1;
-			while (ssize) {
-				int copy_size = min(ssize, PSIZE);
-
-				mp = get_metapage(ip, xaddr, PSIZE, 1);
-
-				if (mp == NULL) {
-					dtDelete(tid, dip, &dname, &ino,
-						 JFS_REMOVE);
-					rc = -EIO;
-					goto out3;
-				}
-				memcpy(mp->data, name, copy_size);
-				flush_metapage(mp);
-#if 0
-				set_buffer_uptodate(bp);
-				mark_buffer_dirty(bp, 1);
-				if (IS_SYNC(dip))
-					sync_dirty_buffer(bp);
-				brelse(bp);
-#endif				/* 0 */
-				ssize -= copy_size;
-				xaddr += JFS_SBI(sb)->nbperpage;
-			}
-			ip->i_blocks = LBLK2PBLK(sb, xlen);
-		} else {
-			dtDelete(tid, dip, &dname, &ino, JFS_REMOVE);
+		if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) {
+			txAbort(tid, 0);
 			rc = -ENOSPC;
 			goto out3;
 		}
+		extent = xaddr;
+		ip->i_size = ssize - 1;
+		while (ssize) {
+			/* This is kind of silly since PATH_MAX == 4K */
+			int copy_size = min(ssize, PSIZE);
+
+			mp = get_metapage(ip, xaddr, PSIZE, 1);
+
+			if (mp == NULL) {
+				dbFree(ip, extent, xlen);
+				rc = -EIO;
+				txAbort(tid, 0);
+				goto out3;
+			}
+			memcpy(mp->data, name, copy_size);
+			flush_metapage(mp);
+			ssize -= copy_size;
+			name += copy_size;
+			xaddr += JFS_SBI(sb)->nbperpage;
+		}
+		ip->i_blocks = LBLK2PBLK(sb, xlen);
+	}
+
+	/*
+	 * create entry for symbolic link in parent directory
+	 */
+	rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE);
+	if (rc == 0) {
+		ino = ip->i_ino;
+		rc = dtInsert(tid, dip, &dname, &ino, &btstack);
+	}
+	if (rc) {
+		if (xlen)
+			dbFree(ip, extent, xlen);
+		txAbort(tid, 0);
+		/* discard new inode */
+		goto out3;
 	}
 
 	insert_inode_hash(ip);
 	mark_inode_dirty(ip);
-	d_instantiate(dentry, ip);
 
 	/*
 	 * commit update of parent directory and link object
-	 *
-	 * if extent allocation failed (ENOSPC),
-	 * the parent inode is committed regardless to avoid
-	 * backing out parent directory update (by dtInsert())
-	 * and subsequent dtDelete() which is harmless wrt 
-	 * integrity concern.  
-	 * the symlink inode will be freed by iput() at exit
-	 * as it has a zero link count (by dtDelete()) and 
-	 * no permanant resources. 
 	 */
 
 	iplist[0] = dip;
-	if (rc == 0) {
-		iplist[1] = ip;
-		rc = txCommit(tid, 2, &iplist[0], 0);
-	} else
-		rc = txCommit(tid, 1, &iplist[0], 0);
+	iplist[1] = ip;
+	rc = txCommit(tid, 2, &iplist[0], 0);
 
       out3:
 	txEnd(tid);
@@ -1028,7 +1010,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
 	if (rc) {
 		ip->i_nlink = 0;
 		iput(ip);
-	}
+	} else
+		d_instantiate(dentry, ip);
 
       out2:
 	free_UCSname(&dname);
@@ -1221,7 +1204,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 			/* Linelock header of dtree */
 			tlck = txLock(tid, old_ip,
 				    (struct metapage *) &JFS_IP(old_ip)->bxflag,
-				      tlckDTREE | tlckBTROOT);
+				      tlckDTREE | tlckBTROOT | tlckRELINK);
 			dtlck = (struct dt_lock *) & tlck->lock;
 			ASSERT(dtlck->index == 0);
 			lv = & dtlck->lv[0];
@@ -1368,7 +1351,6 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
 
 	insert_inode_hash(ip);
 	mark_inode_dirty(ip);
-	d_instantiate(dentry, ip);
 
 	dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 
@@ -1385,7 +1367,8 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
 	if (rc) {
 		ip->i_nlink = 0;
 		iput(ip);
-	}
+	} else
+		d_instantiate(dentry, ip);
 
       out1:
 	free_UCSname(&dname);
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 72ae53817..d359c2619 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -23,6 +23,7 @@
 #include <linux/parser.h>
 #include <linux/completion.h>
 #include <linux/vfs.h>
+#include <linux/moduleparam.h>
 #include <asm/uaccess.h>
 
 #include "jfs_incore.h"
@@ -44,15 +45,20 @@ static struct super_operations jfs_super_operations;
 static struct export_operations jfs_export_operations;
 static struct file_system_type jfs_fs_type;
 
+#define MAX_COMMIT_THREADS 64
+static int commit_threads = 0;
+module_param(commit_threads, int, 0);
+MODULE_PARM_DESC(commit_threads, "Number of commit threads");
+
 int jfs_stop_threads;
 static pid_t jfsIOthread;
-static pid_t jfsCommitThread;
+static pid_t jfsCommitThread[MAX_COMMIT_THREADS];
 static pid_t jfsSyncThread;
 DECLARE_COMPLETION(jfsIOwait);
 
 #ifdef CONFIG_JFS_DEBUG
 int jfsloglevel = JFS_LOGLEVEL_WARN;
-MODULE_PARM(jfsloglevel, "i");
+module_param(jfsloglevel, int, 644);
 MODULE_PARM_DESC(jfsloglevel, "Specify JFS loglevel (0, 1 or 2)");
 #endif
 
@@ -564,6 +570,7 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
 
 static int __init init_jfs_fs(void)
 {
+	int i;
 	int rc;
 
 	jfs_inode_cachep =
@@ -600,12 +607,23 @@ static int __init init_jfs_fs(void)
 	}
 	wait_for_completion(&jfsIOwait);	/* Wait until thread starts */
 
-	jfsCommitThread = kernel_thread(jfs_lazycommit, 0, CLONE_KERNEL);
-	if (jfsCommitThread < 0) {
-		jfs_err("init_jfs_fs: fork failed w/rc = %d", jfsCommitThread);
-		goto kill_iotask;
+	if (commit_threads < 1)
+		commit_threads = num_online_cpus();
+	else if (commit_threads > MAX_COMMIT_THREADS)
+		commit_threads = MAX_COMMIT_THREADS;
+
+	for (i = 0; i < commit_threads; i++) {
+		jfsCommitThread[i] = kernel_thread(jfs_lazycommit, 0,
+						   CLONE_KERNEL);
+		if (jfsCommitThread[i] < 0) {
+			jfs_err("init_jfs_fs: fork failed w/rc = %d",
+				jfsCommitThread[i]);
+			commit_threads = i;
+			goto kill_committask;
+		}
+		/* Wait until thread starts */
+		wait_for_completion(&jfsIOwait);
 	}
-	wait_for_completion(&jfsIOwait);	/* Wait until thread starts */
 
 	jfsSyncThread = kernel_thread(jfs_sync, 0, CLONE_KERNEL);
 	if (jfsSyncThread < 0) {
@@ -622,10 +640,10 @@ static int __init init_jfs_fs(void)
 
 kill_committask:
 	jfs_stop_threads = 1;
-	wake_up(&jfs_commit_thread_wait);
-	wait_for_completion(&jfsIOwait);	/* Wait for thread exit */
-kill_iotask:
-	jfs_stop_threads = 1;
+	wake_up_all(&jfs_commit_thread_wait);
+	for (i = 0; i < commit_threads; i++)
+		wait_for_completion(&jfsIOwait);
+
 	wake_up(&jfs_IO_thread_wait);
 	wait_for_completion(&jfsIOwait);	/* Wait for thread exit */
 end_txmngr:
@@ -639,6 +657,8 @@ free_slab:
 
 static void __exit exit_jfs_fs(void)
 {
+	int i;
+
 	jfs_info("exit_jfs_fs called");
 
 	jfs_stop_threads = 1;
@@ -646,8 +666,9 @@ static void __exit exit_jfs_fs(void)
 	metapage_exit();
 	wake_up(&jfs_IO_thread_wait);
 	wait_for_completion(&jfsIOwait);	/* Wait until IO thread exits */
-	wake_up(&jfs_commit_thread_wait);
-	wait_for_completion(&jfsIOwait);	/* Wait until Commit thread exits */
+	wake_up_all(&jfs_commit_thread_wait);
+	for (i = 0; i < commit_threads; i++)
+		wait_for_completion(&jfsIOwait);
 	wake_up(&jfs_sync_thread_wait);
 	wait_for_completion(&jfsIOwait);	/* Wait until Sync thread exits */
 #ifdef PROC_FS_JFS
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index 967253c2f..c786348cd 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -550,7 +550,8 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
 	}
 	ea_buf->flag = EA_EXTENT;
 	ea_buf->mp = read_metapage(inode, addressDXD(&ji->ea),
-				   lengthDXD(&ji->ea), 1);
+				   lengthDXD(&ji->ea) << sb->s_blocksize_bits,
+				   1);
 	if (ea_buf->mp == NULL)
 		return -EIO;
 	ea_buf->xattr = ea_buf->mp->data;
@@ -687,17 +688,26 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
 			}
 			inode->i_mode = mode;
 			mark_inode_dirty(inode);
-			if (rc == 0)
-				value = NULL;
 		}
 		/*
 		 * We're changing the ACL.  Get rid of the cached one
 		 */
 		acl =JFS_IP(inode)->i_acl;
-		if (acl && (acl != JFS_ACL_NOT_CACHED))
+		if (acl != JFS_ACL_NOT_CACHED)
 			posix_acl_release(acl);
 		JFS_IP(inode)->i_acl = JFS_ACL_NOT_CACHED;
+
+		return 0;
 	} else if (strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0) {
+		acl = posix_acl_from_xattr(value, value_len);
+		if (IS_ERR(acl)) {
+			rc = PTR_ERR(acl);
+			printk(KERN_ERR "posix_acl_from_xattr returned %d\n",
+			       rc);
+			return rc;
+		}
+		posix_acl_release(acl);
+
 		/*
 		 * We're changing the default ACL.  Get rid of the cached one
 		 */
@@ -705,13 +715,11 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
 		if (acl && (acl != JFS_ACL_NOT_CACHED))
 			posix_acl_release(acl);
 		JFS_IP(inode)->i_default_acl = JFS_ACL_NOT_CACHED;
-	} else
-		/* Invalid xattr name */
-		return -EINVAL;
-	return 0;
-#else			/* CONFIG_JFS_POSIX_ACL */
-	return -EOPNOTSUPP;
+
+		return 0;
+	}
 #endif			/* CONFIG_JFS_POSIX_ACL */
+	return -EOPNOTSUPP;
 }
 
 static int can_set_xattr(struct inode *inode, const char *name,
@@ -737,11 +745,7 @@ static int can_set_xattr(struct inode *inode, const char *name,
 	    (!S_ISDIR(inode->i_mode) || inode->i_mode &S_ISVTX))
 		return -EPERM;
 
-#ifdef CONFIG_JFS_POSIX_ACL
-	return jfs_permission(inode, MAY_WRITE, NULL);
-#else
 	return permission(inode, MAY_WRITE, NULL);
-#endif
 }
 
 int __jfs_setxattr(struct inode *inode, const char *name, const void *value,
@@ -900,13 +904,9 @@ int jfs_setxattr(struct dentry *dentry, const char *name, const void *value,
 
 static int can_get_xattr(struct inode *inode, const char *name)
 {
-#ifdef CONFIG_JFS_POSIX_ACL
 	if(strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN) == 0)
 		return 0;
-	return jfs_permission(inode, MAY_READ, NULL);
-#else
 	return permission(inode, MAY_READ, NULL);
-#endif
 }
 
 ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
diff --git a/fs/locks.c b/fs/locks.c
index da5934939..fbd048304 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1720,6 +1720,9 @@ void locks_remove_flock(struct file *filp)
 				lease_modify(before, F_UNLCK);
 				continue;
 			}
+			/* FL_POSIX locks of this process have already been
+			 * removed in filp_close->locks_remove_posix.
+			 */
 			BUG();
  		}
 		before = &fl->fl_next;
@@ -1813,7 +1816,7 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
 			       : (fl->fl_type & F_WRLCK) ? "WRITE" : "READ ");
 	}
 	if (inode) {
-#if WE_CAN_BREAK_LSLK_NOW
+#ifdef WE_CAN_BREAK_LSLK_NOW
 		out += sprintf(out, "%d %s:%ld ", fl->fl_pid,
 				inode->i_sb->s_id, inode->i_ino);
 #else
@@ -1979,30 +1982,59 @@ int lock_may_write(struct inode *inode, loff_t start, unsigned long len)
 
 EXPORT_SYMBOL(lock_may_write);
 
+static inline void __steal_locks(struct file *file, fl_owner_t from)
+{
+	struct inode *inode = file->f_dentry->d_inode;
+	struct file_lock *fl = inode->i_flock;
+
+	while (fl) {
+		if (fl->fl_file == file && fl->fl_owner == from)
+			fl->fl_owner = current->files;
+		fl = fl->fl_next;
+	}
+}
+
+/* When getting ready for executing a binary, we make sure that current
+ * has a files_struct on its own. Before dropping the old files_struct,
+ * we take over ownership of all locks for all file descriptors we own.
+ * Note that we may accidentally steal a lock for a file that a sibling
+ * has created since the unshare_files() call.
+ */
 void steal_locks(fl_owner_t from)
 {
-	struct list_head *tmp;
+	struct files_struct *files = current->files;
+	int i, j;
 
-	if (from == current->files)
+	if (from == files)
 		return;
 
 	lock_kernel();
-	list_for_each(tmp, &file_lock_list) {
-		struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
-		if (fl->fl_owner == from)
-			fl->fl_owner = current->files;
+	j = 0;
+	for (;;) {
+		unsigned long set;
+		i = j * __NFDBITS;
+		if (i >= files->max_fdset || i >= files->max_fds)
+			break;
+		set = files->open_fds->fds_bits[j++];
+		while (set) {
+			if (set & 1) {
+				struct file *file = files->fd[i];
+				if (file)
+					__steal_locks(file, from);
+			}
+			i++;
+			set >>= 1;
+		}
 	}
 	unlock_kernel();
 }
-
 EXPORT_SYMBOL(steal_locks);
 
 static int __init filelock_init(void)
 {
 	filelock_cache = kmem_cache_create("file_lock_cache",
-			sizeof(struct file_lock), 0, 0, init_once, NULL);
-	if (!filelock_cache)
-		panic("cannot create file lock slab cache");
+			sizeof(struct file_lock), 0, SLAB_PANIC,
+			init_once, NULL);
 	return 0;
 }
 
diff --git a/fs/namei.c b/fs/namei.c
index d2cab643c..9828b94fe 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1759,7 +1759,7 @@ slashes:
 	goto exit2;
 }
 
-int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
+int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode)
 {
 	int error = may_create(dir, dentry, NULL);
 
@@ -1803,7 +1803,7 @@ asmlinkage long sys_symlink(const char __user * oldname, const char __user * new
 		dentry = lookup_create(&nd, 0);
 		error = PTR_ERR(dentry);
 		if (!IS_ERR(dentry)) {
-			error = vfs_symlink(nd.dentry->d_inode, dentry, from);
+			error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO);
 			dput(dentry);
 		}
 		up(&nd.dentry->d_inode->i_sem);
diff --git a/fs/namespace.c b/fs/namespace.c
index fb0a3ab58..2adae4289 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -22,6 +22,7 @@
 #include <linux/security.h>
 #include <linux/mount.h>
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 
 extern int __init init_rootfs(void);
 
@@ -36,6 +37,7 @@ static inline int sysfs_init(void)
 
 /* spinlock for vfsmount related operations, inplace of dcache_lock */
 spinlock_t vfsmount_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+
 static struct list_head *mount_hashtable;
 static int hash_mask, hash_bits;
 static kmem_cache_t *mnt_cache; 
@@ -259,7 +261,65 @@ struct seq_operations mounts_op = {
 	.show	= show_vfsmnt
 };
 
-/*
+/**
+ * may_umount_tree - check if a mount tree is busy
+ * @mnt: root of mount tree
+ *
+ * This is called to check if a tree of mounts has any
+ * open files, pwds, chroots or sub mounts that are
+ * busy.
+ */
+int may_umount_tree(struct vfsmount *mnt)
+{
+	struct list_head *next;
+	struct vfsmount *this_parent = mnt;
+	int actual_refs;
+	int minimum_refs;
+
+	spin_lock(&vfsmount_lock);
+	actual_refs = atomic_read(&mnt->mnt_count);
+	minimum_refs = 2;
+repeat:
+	next = this_parent->mnt_mounts.next;
+resume:
+	while (next != &this_parent->mnt_mounts) {
+		struct vfsmount *p = list_entry(next, struct vfsmount, mnt_child);
+
+		next = next->next;
+
+		actual_refs += atomic_read(&p->mnt_count);
+		minimum_refs += 2;
+
+		if (!list_empty(&p->mnt_mounts)) {
+			this_parent = p;
+			goto repeat;
+		}
+	}
+
+	if (this_parent != mnt) {
+		next = this_parent->mnt_child.next;
+		this_parent = this_parent->mnt_parent;
+		goto resume;
+	}
+	spin_unlock(&vfsmount_lock);
+
+	if (actual_refs > minimum_refs)
+		return -EBUSY;
+
+	return 0;
+}
+
+EXPORT_SYMBOL(may_umount_tree);
+
+/**
+ * may_umount - check if a mount point is busy
+ * @mnt: root of mount
+ *
+ * This is called to check if a mount point has any
+ * open files, pwds, chroots or sub mounts. If the
+ * mount has sub mounts this will return busy
+ * regardless of whether the sub mounts are busy.
+ *
  * Doesn't take quota and stuff into account. IOW, in some cases it will
  * give false negatives. The main reason why it's here is that we need
  * a non-destructive way to look for easily umountable filesystems.
@@ -406,6 +466,8 @@ out:
 	return retval;
 }
 
+#ifdef __ARCH_WANT_SYS_OLDUMOUNT
+
 /*
  *	The 2.0 compatible umount. No flags. 
  */
@@ -415,6 +477,8 @@ asmlinkage long sys_oldumount(char __user * name)
 	return sys_umount(name,0);
 }
 
+#endif
+
 static int mount_is_safe(struct nameidata *nd)
 {
 	if (capable(CAP_SYS_ADMIN))
@@ -1142,9 +1206,7 @@ void __init mnt_init(unsigned long mempages)
 	int i;
 
 	mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount),
-					0, SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!mnt_cache)
-		panic("Cannot create vfsmount cache");
+			0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
 	order = 0; 
 	mount_hashtable = (struct list_head *)
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index e4406a583..c1745b6f1 100644
--- a/fs/ncpfs/file.c
+++ b/fs/ncpfs/file.c
@@ -99,7 +99,7 @@ out:
 }
 
 static ssize_t
-ncp_file_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct dentry *dentry = file->f_dentry;
 	struct inode *inode = dentry->d_inode;
@@ -187,7 +187,7 @@ outrel:
 }
 
 static ssize_t
-ncp_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct dentry *dentry = file->f_dentry;
 	struct inode *inode = dentry->d_inode;
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c
index 345270647..107c0b393 100644
--- a/fs/ncpfs/ncplib_kernel.c
+++ b/fs/ncpfs/ncplib_kernel.c
@@ -1002,7 +1002,7 @@ out:
  */
 int
 ncp_read_bounce(struct ncp_server *server, const char *file_id,
-	 __u32 offset, __u16 to_read, char *target, int *bytes_read,
+	 __u32 offset, __u16 to_read, char __user *target, int *bytes_read,
 	 void* bounce, __u32 bufsize)
 {
 	int result;
diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h
index c702f3bc4..6c0af0198 100644
--- a/fs/ncpfs/ncplib_kernel.h
+++ b/fs/ncpfs/ncplib_kernel.h
@@ -56,7 +56,7 @@ static inline int ncp_read_bounce_size(__u32 size) {
 	return sizeof(struct ncp_reply_header) + 2 + 2 + size + 8;
 };
 int ncp_read_bounce(struct ncp_server *, const char *, __u32, __u16, 
-		char *, int *, void* bounce, __u32 bouncelen);
+		char __user *, int *, void* bounce, __u32 bouncelen);
 int ncp_read_kernel(struct ncp_server *, const char *, __u32, __u16, 
 		char *, int *);
 int ncp_write_kernel(struct ncp_server *, const char *, __u32, __u16,
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index e9ae17236..77f051eef 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -32,6 +32,7 @@
  * 18 Dec 2001	Initial implementation for 2.4  --cel
  * 08 Jul 2002	Version for 2.4.19, with bug fixes --trondmy
  * 08 Jun 2003	Port to 2.5 APIs  --cel
+ * 31 Mar 2004	Handle direct I/O without VFS support  --cel
  *
  */
 
@@ -252,9 +253,7 @@ nfs_direct_write_seg(struct inode *inode, struct file *file,
 {
 	const unsigned int wsize = NFS_SERVER(inode)->wsize;
 	size_t request;
-	int need_commit;
-	int tot_bytes;
-	int curpage;
+	int curpage, need_commit, result, tot_bytes;
 	struct nfs_writeverf first_verf;
 	struct nfs_write_data	wdata = {
 		.inode		= inode,
@@ -281,8 +280,6 @@ retry:
 	wdata.args.pgbase = user_addr & ~PAGE_MASK;
 	wdata.args.offset = file_offset;
         do {
-		int result;
-
 		wdata.args.count = request;
                 if (wdata.args.count > wsize)
                         wdata.args.count = wsize;
@@ -299,7 +296,7 @@ retry:
 		if (result <= 0) {
 			if (tot_bytes > 0)
 				break;
-			return result;
+			goto out;
 		}
 
 		if (tot_bytes == 0)
@@ -324,8 +321,6 @@ retry:
 	 * Commit data written so far, even in the event of an error
 	 */
 	if (need_commit) {
-		int result;
-
 		wdata.args.count = tot_bytes;
 		wdata.args.offset = file_offset;
 
@@ -338,9 +333,12 @@ retry:
 						VERF_SIZE) != 0)
 			goto sync_retry;
 	}
+	result = tot_bytes;
+
+out:
 	nfs_end_data_update_defer(inode);
 
-	return tot_bytes;
+	return result;
 
 sync_retry:
 	wdata.args.stable = NFS_FILE_SYNC;
@@ -409,12 +407,6 @@ nfs_direct_write(struct inode *inode, struct file *file,
  * file_offset: offset in file to begin the operation
  * nr_segs: size of iovec array
  *
- * Usually a file system implements direct I/O by calling out to
- * blockdev_direct_IO.  The NFS client doesn't have a backing block
- * device, so we do everything by hand instead.
- *
- * The inode's i_sem is no longer held by the VFS layer before it calls
- * this function to do a write.
  */
 ssize_t
 nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
@@ -429,11 +421,7 @@ nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 	 * No support for async yet
 	 */
 	if (!is_sync_kiocb(iocb))
-		goto out;
-
-	result = nfs_revalidate_inode(NFS_SERVER(inode), inode);
-	if (result < 0)
-		goto out;
+		return result;
 
 	switch (rw) {
 	case READ:
@@ -453,8 +441,160 @@ nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 	default:
 		break;
 	}
+	return result;
+}
+
+/**
+ * nfs_file_direct_read - file direct read operation for NFS files
+ * @iocb: target I/O control block
+ * @buf: user's buffer into which to read data
+ * count: number of bytes to read
+ * pos: byte offset in file where reading starts
+ *
+ * We use this function for direct reads instead of calling
+ * generic_file_aio_read() in order to avoid gfar's check to see if
+ * the request starts before the end of the file.  For that check
+ * to work, we must generate a GETATTR before each direct read, and
+ * even then there is a window between the GETATTR and the subsequent
+ * READ where the file size could change.  So our preference is simply
+ * to do all reads the application wants, and the server will take
+ * care of managing the end of file boundary.
+ * 
+ * This function also eliminates unnecessarily updating the file's
+ * atime locally, as the NFS server sets the file's atime, and this
+ * client must read the updated atime from the server back into its
+ * cache.
+ */
+ssize_t
+nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos)
+{
+	ssize_t retval = -EINVAL;
+	loff_t *ppos = &iocb->ki_pos;
+	struct file *file = iocb->ki_filp;
+	struct dentry *dentry = file->f_dentry;
+	struct address_space *mapping = file->f_mapping;
+	struct inode *inode = mapping->host;
+	struct iovec iov = {
+		.iov_base = (char *)buf,
+		.iov_len = count,
+	};
+
+	dprintk("nfs: direct read(%s/%s, %lu@%lu)\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		(unsigned long) count, (unsigned long) pos);
+
+	if (!is_sync_kiocb(iocb))
+		goto out;
+	if (count < 0)
+		goto out;
+	retval = -EFAULT;
+	if (!access_ok(VERIFY_WRITE, iov.iov_base, iov.iov_len))
+		goto out;
+	retval = 0;
+	if (!count)
+		goto out;
+
+	if (mapping->nrpages) {
+		retval = filemap_fdatawrite(mapping);
+		if (retval == 0)
+			retval = filemap_fdatawait(mapping);
+		if (retval)
+			goto out;
+	}
+
+	retval = nfs_direct_read(inode, file, &iov, pos, 1);
+	if (retval > 0)
+		*ppos = pos + retval;
 
 out:
-	dprintk("NFS: direct_IO result=%zd\n", result);
-	return result;
+	return retval;
+}
+
+/**
+ * nfs_file_direct_write - file direct write operation for NFS files
+ * @iocb: target I/O control block
+ * @buf: user's buffer from which to write data
+ * count: number of bytes to write
+ * pos: byte offset in file where writing starts
+ *
+ * We use this function for direct writes instead of calling
+ * generic_file_aio_write() in order to avoid taking the inode
+ * semaphore and updating the i_size.  The NFS server will set
+ * the new i_size and this client must read the updated size
+ * back into its cache.  We let the server do generic write
+ * parameter checking and report problems.
+ *
+ * We also avoid an unnecessary invocation of generic_osync_inode(),
+ * as it is fairly meaningless to sync the metadata of an NFS file.
+ *
+ * We eliminate local atime updates, see direct read above.
+ *
+ * We avoid unnecessary page cache invalidations for normal cached
+ * readers of this file.
+ *
+ * Note that O_APPEND is not supported for NFS direct writes, as there
+ * is no atomic O_APPEND write facility in the NFS protocol.
+ */
+ssize_t
+nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos)
+{
+	ssize_t retval = -EINVAL;
+	loff_t *ppos = &iocb->ki_pos;
+	unsigned long limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
+	struct file *file = iocb->ki_filp;
+	struct dentry *dentry = file->f_dentry;
+	struct address_space *mapping = file->f_mapping;
+	struct inode *inode = mapping->host;
+	struct iovec iov = {
+		.iov_base = (char __user *)buf,
+		.iov_len = count,
+	};
+
+	dfprintk(VFS, "nfs: direct write(%s/%s(%ld), %lu@%lu)\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		inode->i_ino, (unsigned long) count, (unsigned long) pos);
+
+	if (!is_sync_kiocb(iocb))
+		goto out;
+	if (count < 0)
+		goto out;
+        if (pos < 0)
+		goto out;
+	retval = -EFAULT;
+	if (!access_ok(VERIFY_READ, iov.iov_base, iov.iov_len))
+		goto out;
+        if (file->f_error) {
+                retval = file->f_error;
+                file->f_error = 0;
+                goto out;
+        }
+	retval = -EFBIG;
+	if (limit != RLIM_INFINITY) {
+		if (pos >= limit) {
+			send_sig(SIGXFSZ, current, 0);
+			goto out;
+		}
+		if (count > limit - (unsigned long) pos)
+			count = limit - (unsigned long) pos;
+	}
+	retval = 0;
+	if (!count)
+		goto out;
+
+	if (mapping->nrpages) {
+		retval = filemap_fdatawrite(mapping);
+		if (retval == 0)
+			retval = filemap_fdatawait(mapping);
+		if (retval)
+			goto out;
+	}
+
+	retval = nfs_direct_write(inode, file, &iov, pos, 1);
+	if (mapping->nrpages)
+		invalidate_inode_pages2(mapping);
+	if (retval > 0)
+		*ppos = pos + retval;
+
+out:
+	return retval;
 }
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index df23d4de5..1ea93c580 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -38,9 +38,9 @@ static long nfs_file_fcntl(int fd, unsigned int cmd,
 static int nfs_file_open(struct inode *, struct file *);
 static int nfs_file_release(struct inode *, struct file *);
 static int  nfs_file_mmap(struct file *, struct vm_area_struct *);
-static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
-static ssize_t nfs_file_read(struct kiocb *, char *, size_t, loff_t);
-static ssize_t nfs_file_write(struct kiocb *, const char *, size_t, loff_t);
+static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void __user *);
+static ssize_t nfs_file_read(struct kiocb *, char __user *, size_t, loff_t);
+static ssize_t nfs_file_write(struct kiocb *, const char __user *, size_t, loff_t);
 static int  nfs_file_flush(struct file *);
 static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
 
@@ -148,12 +148,17 @@ nfs_file_flush(struct file *file)
 }
 
 static ssize_t
-nfs_file_read(struct kiocb *iocb, char * buf, size_t count, loff_t pos)
+nfs_file_read(struct kiocb *iocb, char __user * buf, size_t count, loff_t pos)
 {
 	struct dentry * dentry = iocb->ki_filp->f_dentry;
 	struct inode * inode = dentry->d_inode;
 	ssize_t result;
 
+#ifdef CONFIG_NFS_DIRECTIO
+	if (iocb->ki_filp->f_flags & O_DIRECT)
+		return nfs_file_direct_read(iocb, buf, count, pos);
+#endif
+
 	dfprintk(VFS, "nfs: read(%s/%s, %lu@%lu)\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name,
 		(unsigned long) count, (unsigned long) pos);
@@ -166,7 +171,7 @@ nfs_file_read(struct kiocb *iocb, char * buf, size_t count, loff_t pos)
 
 static ssize_t
 nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count,
-		read_actor_t actor, void *target)
+		read_actor_t actor, void __user *target)
 {
 	struct dentry *dentry = filp->f_dentry;
 	struct inode *inode = dentry->d_inode;
@@ -262,12 +267,17 @@ struct address_space_operations nfs_file_aops = {
  * Write to a file (through the page cache).
  */
 static ssize_t
-nfs_file_write(struct kiocb *iocb, const char *buf, size_t count, loff_t pos)
+nfs_file_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos)
 {
 	struct dentry * dentry = iocb->ki_filp->f_dentry;
 	struct inode * inode = dentry->d_inode;
 	ssize_t result;
 
+#ifdef CONFIG_NFS_DIRECTIO
+	if (iocb->ki_filp->f_flags & O_DIRECT)
+		return nfs_file_direct_write(iocb, buf, count, pos);
+#endif
+
 	dfprintk(VFS, "nfs: write(%s/%s(%ld), %lu@%lu)\n",
 		dentry->d_parent->d_name.name, dentry->d_name.name,
 		inode->i_ino, (unsigned long) count, (unsigned long) pos);
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 54fa2c079..d3cf187b9 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -237,7 +237,7 @@ nfs_get_root(struct super_block *sb, struct nfs_fh *rootfh, struct nfs_fsinfo *f
 
 	error = server->rpc_ops->getroot(server, rootfh, fsinfo);
 	if (error < 0) {
-		printk(KERN_NOTICE "nfs_get_root: getattr error = %d\n", -error);
+		dprintk("nfs_get_root: getattr error = %d\n", -error);
 		return ERR_PTR(error);
 	}
 
@@ -262,6 +262,7 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor)
 	struct nfs_pathconf pathinfo = {
 			.fattr = &fattr,
 	};
+	int no_root_error = 0;
 
 	/* We probably want something more informative here */
 	snprintf(sb->s_id, sizeof(sb->s_id), "%x:%x", MAJOR(sb->s_dev), MINOR(sb->s_dev));
@@ -272,12 +273,15 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor)
 
 	root_inode = nfs_get_root(sb, &server->fh, &fsinfo);
 	/* Did getting the root inode fail? */
-	if (IS_ERR(root_inode))
+	if (IS_ERR(root_inode)) {
+		no_root_error = PTR_ERR(root_inode);
 		goto out_no_root;
+	}
 	sb->s_root = d_alloc_root(root_inode);
-	if (!sb->s_root)
+	if (!sb->s_root) {
+		no_root_error = -ENOMEM;
 		goto out_no_root;
-
+	}
 	sb->s_root->d_op = server->rpc_ops->dentry_ops;
 
 	/* Get some general file system info */
@@ -337,10 +341,10 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor)
 	return 0;
 	/* Yargs. It didn't work out. */
 out_no_root:
-	printk("nfs_read_super: get root inode failed\n");
+	dprintk("nfs_sb_init: get root inode failed: errno %d\n", -no_root_error);
 	if (!IS_ERR(root_inode))
 		iput(root_inode);
-	return -EINVAL;
+	return no_root_error;
 }
 
 /*
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 61f5e8105..6a324838f 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -511,8 +511,8 @@ static int
 nfs_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_readlinkargs *args)
 {
 	struct rpc_auth *auth = req->rq_task->tk_auth;
+	unsigned int count = args->count - 5;
 	unsigned int replen;
-	u32 count = args->count - 4;
 
 	p = xdr_encode_fhandle(p, args->fh);
 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
@@ -547,12 +547,15 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, u32 *p, void *dummy)
 	strlen = (u32*)kmap_atomic(rcvbuf->pages[0], KM_USER0);
 	/* Convert length of symlink */
 	len = ntohl(*strlen);
-	if (len > rcvbuf->page_len)
-		len = rcvbuf->page_len;
+	if (len > rcvbuf->page_len) {
+		dprintk(KERN_WARNING "nfs: server returned giant symlink!\n");
+		kunmap_atomic(strlen, KM_USER0);
+		return -ENAMETOOLONG;
+	}
 	*strlen = len;
 	/* NULL terminate the string we got */
 	string = (char *)(strlen + 1);
-	string[len] = 0;
+	string[len] = '\0';
 	kunmap_atomic(strlen, KM_USER0);
 	return 0;
 }
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 98de0230c..56ca3e91f 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -702,8 +702,8 @@ static int
 nfs3_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_readlinkargs *args)
 {
 	struct rpc_auth *auth = req->rq_task->tk_auth;
+	unsigned int count = args->count - 5;
 	unsigned int replen;
-	u32 count = args->count - 4;
 
 	p = xdr_encode_fhandle(p, args->fh);
 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
@@ -742,12 +742,15 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
 	strlen = (u32*)kmap_atomic(rcvbuf->pages[0], KM_USER0);
 	/* Convert length of symlink */
 	len = ntohl(*strlen);
-	if (len > rcvbuf->page_len)
-		len = rcvbuf->page_len;
+	if (len > rcvbuf->page_len) {
+		dprintk(KERN_WARNING "nfs: server returned giant symlink!\n");
+		kunmap_atomic(strlen, KM_USER0);
+		return -ENAMETOOLONG;
+	}
 	*strlen = len;
 	/* NULL terminate the string we got */
 	string = (char *)(strlen + 1);
-	string[len] = 0;
+	string[len] = '\0';
 	kunmap_atomic(strlen, KM_USER0);
 	return 0;
 }
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 9c3405af1..0a8d90899 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -731,6 +731,8 @@ nfs4_reclaim_open_state(struct nfs4_state_owner *sp)
 	int status = 0;
 
 	list_for_each_entry(state, &sp->so_states, open_states) {
+		if (state->state == 0)
+			continue;
 		status = nfs4_open_reclaim(sp, state);
 		if (status >= 0)
 			continue;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 0e12e772d..a2cd1178e 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -947,7 +947,8 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
 static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req)
 {
 	struct rpc_auth *auth = req->rq_task->tk_auth;
-	int replen;
+	unsigned int count = readlink->count - 5;
+	unsigned int replen;
 	uint32_t *p;
 
 	RESERVE_SPACE(4);
@@ -958,7 +959,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r
 	 *      + OP_READLINK + status  = 7
 	 */
 	replen = (RPC_REPHDRSIZE + auth->au_rslack + 7) << 2;
-	xdr_inline_pages(&req->rq_rcv_buf, replen, readlink->pages, 0, readlink->count);
+	xdr_inline_pages(&req->rq_rcv_buf, replen, readlink->pages, 0, count);
 	
 	return 0;
 }
@@ -2921,10 +2922,10 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
 	 */
 	strlen = (uint32_t *) kmap_atomic(rcvbuf->pages[0], KM_USER0);
 	len = ntohl(*strlen);
-	if (len > PAGE_CACHE_SIZE - 5) {
-		printk(KERN_WARNING "nfs: server returned giant symlink!\n");
+	if (len > rcvbuf->page_len) {
+		dprintk(KERN_WARNING "nfs: server returned giant symlink!\n");
 		kunmap_atomic(strlen, KM_USER0);
-		return -EIO;
+		return -ENAMETOOLONG;
 	}
 	*strlen = len;
 
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 053d5462f..2d32aba43 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -43,14 +43,12 @@ static mempool_t *nfs_rdata_mempool;
 
 #define MIN_POOL_READ	(32)
 
-static __inline__ struct nfs_read_data *nfs_readdata_alloc(void)
+static struct nfs_read_data *nfs_readdata_alloc(void)
 {
 	struct nfs_read_data   *p;
 	p = (struct nfs_read_data *)mempool_alloc(nfs_rdata_mempool, SLAB_NOFS);
-	if (p) {
+	if (p)
 		memset(p, 0, sizeof(*p));
-		INIT_LIST_HEAD(&p->pages);
-	}
 	return p;
 }
 
@@ -99,21 +97,22 @@ nfs_readpage_sync(struct file *file, struct inode *inode, struct page *page)
 	unsigned int	rsize = NFS_SERVER(inode)->rsize;
 	unsigned int	count = PAGE_CACHE_SIZE;
 	int		result;
-	struct nfs_read_data	rdata = {
-		.flags		= (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0),
-		.cred		= NULL,
-		.inode		= inode,
-		.args		= {
-			.fh		= NFS_FH(inode),
-			.lockowner	= current->files,
-			.pages		= &page,
-			.pgbase		= 0UL,
-			.count		= rsize,
-		},
-		.res		= {
-			.fattr		= &rdata.fattr,
-		}
-	};
+	struct nfs_read_data *rdata;
+
+	rdata = nfs_readdata_alloc();
+	if (!rdata)
+		return -ENOMEM;
+
+	memset(rdata, 0, sizeof(*rdata));
+	rdata->flags = (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0);
+	rdata->inode = inode;
+	INIT_LIST_HEAD(&rdata->pages);
+	rdata->args.fh = NFS_FH(inode);
+	rdata->args.lockowner = current->files;
+	rdata->args.pages = &page;
+	rdata->args.pgbase = 0UL;
+	rdata->args.count = rsize;
+	rdata->res.fattr = &rdata->fattr;
 
 	dprintk("NFS: nfs_readpage_sync(%p)\n", page);
 
@@ -123,19 +122,19 @@ nfs_readpage_sync(struct file *file, struct inode *inode, struct page *page)
 	 */
 	do {
 		if (count < rsize)
-			rdata.args.count = count;
-		rdata.res.count = rdata.args.count;
-		rdata.args.offset = page_offset(page) + rdata.args.pgbase;
+			rdata->args.count = count;
+		rdata->res.count = rdata->args.count;
+		rdata->args.offset = page_offset(page) + rdata->args.pgbase;
 
 		dprintk("NFS: nfs_proc_read(%s, (%s/%Ld), %Lu, %u)\n",
 			NFS_SERVER(inode)->hostname,
 			inode->i_sb->s_id,
 			(long long)NFS_FILEID(inode),
-			(unsigned long long)rdata.args.pgbase,
-			rdata.args.count);
+			(unsigned long long)rdata->args.pgbase,
+			rdata->args.count);
 
 		lock_kernel();
-		result = NFS_PROTO(inode)->read(&rdata, file);
+		result = NFS_PROTO(inode)->read(rdata, file);
 		unlock_kernel();
 
 		/*
@@ -148,17 +147,17 @@ nfs_readpage_sync(struct file *file, struct inode *inode, struct page *page)
 			goto io_error;
 		}
 		count -= result;
-		rdata.args.pgbase += result;
+		rdata->args.pgbase += result;
 		/* Note: result == 0 should only happen if we're caching
 		 * a write that extends the file and punches a hole.
 		 */
-		if (rdata.res.eof != 0 || result == 0)
+		if (rdata->res.eof != 0 || result == 0)
 			break;
 	} while (count);
 	NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME;
 
 	if (count)
-		memclear_highpage_flush(page, rdata.args.pgbase, count);
+		memclear_highpage_flush(page, rdata->args.pgbase, count);
 	SetPageUptodate(page);
 	if (PageError(page))
 		ClearPageError(page);
@@ -166,6 +165,7 @@ nfs_readpage_sync(struct file *file, struct inode *inode, struct page *page)
 
 io_error:
 	unlock_page(page);
+	nfs_readdata_free(rdata);
 	return result;
 }
 
@@ -305,6 +305,7 @@ static int nfs_pagein_multi(struct list_head *head, struct inode *inode)
 		data = nfs_readdata_alloc();
 		if (!data)
 			goto out_bad;
+		INIT_LIST_HEAD(&data->pages);
 		list_add(&data->pages, &list);
 		requests++;
 		if (nbytes <= rsize)
@@ -361,6 +362,7 @@ static int nfs_pagein_one(struct list_head *head, struct inode *inode)
 	if (!data)
 		goto out_bad;
 
+	INIT_LIST_HEAD(&data->pages);
 	pages = data->pagevec;
 	count = 0;
 	while (!list_empty(head)) {
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index b144021ee..f92eeea33 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -180,7 +180,9 @@ nfs_async_unlink(struct dentry *dentry)
 	task->tk_action = nfs_async_unlink_init;
 	task->tk_release = nfs_async_unlink_release;
 
+	spin_lock(&dentry->d_lock);
 	dentry->d_flags |= DCACHE_NFSFS_RENAMED;
+	spin_unlock(&dentry->d_lock);
 	data->cred = rpcauth_lookupcred(clnt->cl_auth, 0);
 
 	rpc_sleep_on(&nfs_delete_queue, task, NULL, NULL);
@@ -210,7 +212,9 @@ nfs_complete_unlink(struct dentry *dentry)
 		return;
 	data->count++;
 	nfs_copy_dname(dentry, data);
+	spin_lock(&dentry->d_lock);
 	dentry->d_flags &= ~DCACHE_NFSFS_RENAMED;
+	spin_unlock(&dentry->d_lock);
 	if (data->task.tk_rpcwait == &nfs_delete_queue)
 		rpc_wake_up_task(&data->task);
 	nfs_put_unlinkdata(data);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 5e4042d1e..a01a2fa0a 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -179,23 +179,23 @@ static int nfs_writepage_sync(struct file *file, struct inode *inode,
 {
 	unsigned int	wsize = NFS_SERVER(inode)->wsize;
 	int		result, written = 0;
-	struct nfs_write_data	wdata = {
-		.flags		= how,
-		.cred		= NULL,
-		.inode		= inode,
-		.args		= {
-			.fh		= NFS_FH(inode),
-			.lockowner	= current->files,
-			.pages		= &page,
-			.stable		= NFS_FILE_SYNC,
-			.pgbase		= offset,
-			.count		= wsize,
-		},
-		.res		= {
-			.fattr		= &wdata.fattr,
-			.verf		= &wdata.verf,
-		},
-	};
+	struct nfs_write_data *wdata;
+
+	wdata = kmalloc(sizeof(*wdata), GFP_NOFS);
+	if (!wdata)
+		return -ENOMEM;
+
+	memset(wdata, 0, sizeof(*wdata));
+	wdata->flags = how;
+	wdata->inode = inode;
+	wdata->args.fh = NFS_FH(inode);
+	wdata->args.lockowner = current->files;
+	wdata->args.pages = &page;
+	wdata->args.stable = NFS_FILE_SYNC;
+	wdata->args.pgbase = offset;
+	wdata->args.count = wsize;
+	wdata->res.fattr = &wdata->fattr;
+	wdata->res.verf = &wdata->verf;
 
 	dprintk("NFS:      nfs_writepage_sync(%s/%Ld %d@%Ld)\n",
 		inode->i_sb->s_id,
@@ -205,22 +205,22 @@ static int nfs_writepage_sync(struct file *file, struct inode *inode,
 	nfs_begin_data_update(inode);
 	do {
 		if (count < wsize)
-			wdata.args.count = count;
-		wdata.args.offset = page_offset(page) + wdata.args.pgbase;
+			wdata->args.count = count;
+		wdata->args.offset = page_offset(page) + wdata->args.pgbase;
 
-		result = NFS_PROTO(inode)->write(&wdata, file);
+		result = NFS_PROTO(inode)->write(wdata, file);
 
 		if (result < 0) {
 			/* Must mark the page invalid after I/O error */
 			ClearPageUptodate(page);
 			goto io_error;
 		}
-		if (result < wdata.args.count)
+		if (result < wdata->args.count)
 			printk(KERN_WARNING "NFS: short write, count=%u, result=%d\n",
-					wdata.args.count, result);
+					wdata->args.count, result);
 
-		wdata.args.offset += result;
-	        wdata.args.pgbase += result;
+		wdata->args.offset += result;
+	        wdata->args.pgbase += result;
 		written += result;
 		count -= result;
 	} while (count);
@@ -234,9 +234,10 @@ static int nfs_writepage_sync(struct file *file, struct inode *inode,
 
 io_error:
 	nfs_end_data_update_defer(inode);
-	if (wdata.cred)
-		put_rpccred(wdata.cred);
+	if (wdata->cred)
+		put_rpccred(wdata->cred);
 
+	kfree(wdata);
 	return written ? written : result;
 }
 
@@ -313,7 +314,7 @@ do_it:
 		if (err >= 0) {
 			err = 0;
 			if (wbc->for_reclaim)
-				err = WRITEPAGE_ACTIVATE;
+				nfs_flush_inode(inode, 0, 0, FLUSH_STABLE);
 		}
 	} else {
 		err = nfs_writepage_sync(NULL, inode, page, 0,
@@ -326,8 +327,7 @@ do_it:
 	}
 	unlock_kernel();
 out:
-	if (err != WRITEPAGE_ACTIVATE)
-		unlock_page(page);
+	unlock_page(page);
 	if (inode_referenced)
 		iput(inode);
 	return err; 
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index fabf60532..3b9e865c4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -899,7 +899,7 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
 	 * fh must be initialized before calling fh_compose
 	 */
 	fh_init(&fh, maxsize);
-	if (fh_compose(&fh, exp, dget(nd.dentry), NULL))
+	if (fh_compose(&fh, exp, nd.dentry, NULL))
 		err = -EINVAL;
 	else
 		err = 0;
@@ -932,7 +932,6 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
 	if (!fsid_key || IS_ERR(fsid_key))
 		return nfserr_perm;
 
-	dget(fsid_key->ek_export->ex_dentry);
 	rv = fh_compose(fhp, fsid_key->ek_export, 
 			  fsid_key->ek_export->ex_dentry, NULL);
 	expkey_put(&fsid_key->h, &svc_expkey_cache);
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 1541cbb55..941ceaec1 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -436,7 +436,6 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
 	resp->buflen = count;
 	resp->common.err = nfs_ok;
 	resp->buffer = argp->buffer;
-	resp->offset = NULL;
 	resp->rqstp = rqstp;
 	nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie, 
 					&resp->common, nfs3svc_encode_entry);
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 8291752c7..f5df8304f 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -799,6 +799,7 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
 {
 	struct svc_export	*exp;
 	struct dentry		*dparent, *dchild;
+	int rv = 0;
 
 	dparent = cd->fh.fh_dentry;
 	exp  = cd->fh.fh_export;
@@ -813,11 +814,12 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
 		dchild = lookup_one_len(name, dparent, namlen);
 	if (IS_ERR(dchild))
 		return 1;
-	if (d_mountpoint(dchild))
-		return 1;
-	if (fh_compose(fhp, exp, dchild, &cd->fh) != 0 || !dchild->d_inode)
-		return 1;
-	return 0;
+	if (d_mountpoint(dchild) ||
+	    fh_compose(fhp, exp, dchild, &cd->fh) != 0 ||
+	    !dchild->d_inode)
+		rv = 1;
+	dput(dchild);
+	return rv;
 }
 
 /*
@@ -845,8 +847,18 @@ encode_entry(struct readdir_cd *ccd, const char *name,
 	int		elen;		/* estimated entry length in words */
 	int		num_entry_words = 0;	/* actual number of words */
 
-	if (cd->offset)
-		xdr_encode_hyper(cd->offset, (u64) offset);
+	if (cd->offset) {
+		u64 offset64 = offset;
+
+		if (unlikely(cd->offset1)) {
+			/* we ended up with offset on a page boundary */
+			*cd->offset = htonl(offset64 >> 32);
+			*cd->offset1 = htonl(offset64 & 0xffffffff);
+			cd->offset1 = NULL;
+		} else {
+			xdr_encode_hyper(cd->offset, (u64) offset);
+		}
+	}
 
 	/*
 	dprintk("encode_entry(%.*s @%ld%s)\n",
@@ -927,17 +939,32 @@ encode_entry(struct readdir_cd *ccd, const char *name,
 			/* update offset */
 			cd->offset = cd->buffer + (cd->offset - tmp);
 		} else {
+			unsigned int offset_r = (cd->offset - tmp) << 2;
+
+			/* update pointer to offset location.
+			 * This is a 64bit quantity, so we need to
+			 * deal with 3 cases:
+			 *  -	entirely in first page
+			 *  -	entirely in second page
+			 *  -	4 bytes in each page
+			 */
+			if (offset_r + 8 <= len1) {
+				cd->offset = p + (cd->offset - tmp);
+			} else if (offset_r >= len1) {
+				cd->offset -= len1 >> 2;
+			} else {
+				/* sitting on the fence */
+				BUG_ON(offset_r != len1 - 4);
+				cd->offset = p + (cd->offset - tmp);
+				cd->offset1 = tmp;
+			}
+
 			len2 = (num_entry_words << 2) - len1;
 
 			/* move from temp page to current and next pages */
 			memmove(p, tmp, len1);
 			memmove(tmp, (caddr_t)tmp+len1, len2);
 
-			/* update offset */
-			if (((cd->offset - tmp) << 2) <= len1)
-				cd->offset = p + (cd->offset - tmp);
-			else
-				cd->offset -= len1 >> 2;
 			p = tmp + (len2 >> 2);
 		}
 	}
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 97d430bf2..4ba540841 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -175,6 +175,14 @@ idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h)
 	return 0;
 }
 
+static void
+warn_no_idmapd(struct cache_detail *detail)
+{
+	printk("nfsd: nfsv4 idmapping failing: has idmapd %s?\n",
+			detail->last_close? "died" : "not been started");
+}
+
+
 static int         idtoname_parse(struct cache_detail *, char *, int);
 static struct ent *idtoname_lookup(struct ent *, int);
 
@@ -186,6 +194,7 @@ struct cache_detail idtoname_cache = {
 	.cache_request	= idtoname_request,
 	.cache_parse	= idtoname_parse,
 	.cache_show	= idtoname_show,
+	.warn_no_listener = warn_no_idmapd,
 };
 
 int
@@ -318,6 +327,7 @@ struct cache_detail nametoid_cache = {
 	.cache_request	= nametoid_request,
 	.cache_parse	= nametoid_parse,
 	.cache_show	= nametoid_show,
+	.warn_no_listener = warn_no_idmapd,
 };
 
 int
@@ -409,13 +419,19 @@ struct idmap_defer_req {
        atomic_t			count;
 };
 
-static void
+static inline void
 put_mdr(struct idmap_defer_req *mdr)
 {
 	if (atomic_dec_and_test(&mdr->count))
 		kfree(mdr);
 }
 
+static inline void
+get_mdr(struct idmap_defer_req *mdr)
+{
+	atomic_inc(&mdr->count);
+}
+
 static void
 idmap_revisit(struct cache_deferred_req *dreq, int toomany)
 {
@@ -433,31 +449,44 @@ idmap_defer(struct cache_req *req)
 		container_of(req, struct idmap_defer_req, req);
 
 	mdr->deferred_req.revisit = idmap_revisit;
+	get_mdr(mdr);
 	return (&mdr->deferred_req);
 }
 
-static int threads_waiting = 0;
+static inline int
+do_idmap_lookup(struct ent *(*lookup_fn)(struct ent *, int), struct ent *key,
+		struct cache_detail *detail, struct ent **item,
+		struct idmap_defer_req *mdr)
+{
+	*item = lookup_fn(key, 0);
+	if (!*item)
+		return -ENOMEM;
+	return cache_check(detail, &(*item)->h, &mdr->req);
+}
 
 static inline int
-idmap_lookup_wait(struct idmap_defer_req *mdr, wait_queue_t waitq, struct
-		svc_rqst *rqstp) {
-	int ret = -ETIMEDOUT;
-
-	set_task_state(current, TASK_INTERRUPTIBLE);
-	lock_kernel();
-	/* XXX: Does it matter that threads_waiting isn't per-server? */
-	/* Note: BKL prevents races with nfsd_svc and other lookups */
-	if (2 * threads_waiting > rqstp->rq_server->sv_nrthreads)
-		goto out;
-	threads_waiting++;
-	schedule_timeout(10 * HZ);
-	threads_waiting--;
-	ret = 0;
-out:
-	unlock_kernel();
-	remove_wait_queue(&mdr->waitq, &waitq);
-	set_task_state(current, TASK_RUNNING);
-	put_mdr(mdr);
+do_idmap_lookup_nowait(struct ent *(*lookup_fn)(struct ent *, int),
+			struct ent *key, struct cache_detail *detail,
+			struct ent **item)
+{
+	int ret = -ENOMEM;
+
+	*item = lookup_fn(key, 0);
+	if (!*item)
+		goto out_err;
+	ret = -ETIMEDOUT;
+	if (!test_bit(CACHE_VALID, &(*item)->h.flags)
+			|| (*item)->h.expiry_time < get_seconds()
+			|| detail->flush_time > (*item)->h.last_refresh)
+		goto out_put;
+	ret = -ENOENT;
+	if (test_bit(CACHE_NEGATIVE, &(*item)->h.flags))
+		goto out_put;
+	return 0;
+out_put:
+	ent_put(&(*item)->h, detail);
+out_err:
+	*item = NULL;
 	return ret;
 }
 
@@ -467,36 +496,22 @@ idmap_lookup(struct svc_rqst *rqstp,
 		struct cache_detail *detail, struct ent **item)
 {
 	struct idmap_defer_req *mdr;
-	DECLARE_WAITQUEUE(waitq, current);
 	int ret;
 
-	*item = lookup_fn(key, 0);
-	if (!*item)
-		return -ENOMEM;
 	mdr = kmalloc(sizeof(*mdr), GFP_KERNEL);
+	if (!mdr)
+		return -ENOMEM;
 	memset(mdr, 0, sizeof(*mdr));
+	atomic_set(&mdr->count, 1);
 	init_waitqueue_head(&mdr->waitq);
-	add_wait_queue(&mdr->waitq, &waitq);
-	atomic_set(&mdr->count, 2);
 	mdr->req.defer = idmap_defer;
-	ret = cache_check(detail, &(*item)->h, &mdr->req);
+	ret = do_idmap_lookup(lookup_fn, key, detail, item, mdr);
 	if (ret == -EAGAIN) {
-		ret = idmap_lookup_wait(mdr, waitq, rqstp);
-		if (ret)
-			goto out;
-		/* Try again, but don't wait. */
-		*item = lookup_fn(key, 0);
-		ret = -ENOMEM;
-		if (!*item)
-			goto out;
-		ret = -ETIMEDOUT;
-		if (!test_bit(CACHE_VALID, &(*item)->h.flags)) {
-			ent_put(&(*item)->h, detail);
-			goto out;
-		}
-		ret = cache_check(detail, &(*item)->h, NULL);
+		wait_event_interruptible_timeout(mdr->waitq,
+			test_bit(CACHE_VALID, &(*item)->h.flags), 1 * HZ);
+		ret = do_idmap_lookup_nowait(lookup_fn, key, detail, item);
 	}
-out:
+	put_mdr(mdr);
 	return ret;
 }
 
@@ -515,6 +530,8 @@ idmap_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen
 	key.name[namelen] = '\0';
 	strlcpy(key.authname, rqstp->rq_client->name, sizeof(key.authname));
 	ret = idmap_lookup(rqstp, nametoid_lookup, &key, &nametoid_cache, &item);
+	if (ret == -ENOENT)
+		ret = -ESRCH; /* nfserr_badname */
 	if (ret)
 		return ret;
 	*id = item->id;
@@ -533,6 +550,8 @@ idmap_id_to_name(struct svc_rqst *rqstp, int type, uid_t id, char *name)
 
 	strlcpy(key.authname, rqstp->rq_client->name, sizeof(key.authname));
 	ret = idmap_lookup(rqstp, idtoname_lookup, &key, &idtoname_cache, &item);
+	if (ret == -ENOENT)
+		return sprintf(name, "%u", id);
 	if (ret)
 		return ret;
 	ret = strlen(item->name);
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index d8765a093..d54c85ade 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -389,7 +389,7 @@ nfsd4_create(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_cre
 		break;
 
 	default:
-		BUG();
+		status = nfserr_badtype;
 	}
 
 	if (!status) {
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 73a8944ad..848c4851d 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -495,15 +495,13 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 		gen_clid(new);
 		gen_confirm(new);
 		add_to_unconfirmed(new, strhashval);
-	} else if (!cmp_clid(&conf->cl_clientid, &unconf->cl_clientid) &&
-	      !cmp_verf(&conf->cl_confirm, &unconf->cl_confirm)) {
+	} else if (!cmp_verf(&conf->cl_confirm, &unconf->cl_confirm)) {
 		/*	
 		 * CASE3:
 		 * confirmed found (name, principal match)
 		 * confirmed verifier does not match input clverifier
 		 *
 		 * unconfirmed found (name match)
-		 * confirmed->cl_clientid != unconfirmed->cl_clientid and
 		 * confirmed->cl_confirm != unconfirmed->cl_confirm
 		 *
 		 * remove unconfirmed.
@@ -2334,28 +2332,27 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner *
 
 	/* find the lockowner */
         status = nfs_ok;
-	for (i=0; i < LOCK_HASH_SIZE; i++) {
-		list_for_each_entry(local, &lock_ownerstr_hashtbl[i], so_strhash) {
-			if(cmp_owner_str(local, owner, clid))
-				break;
-		}
-	}
-	if (local) {
-		struct nfs4_stateid *stp;
-
-		/* check for any locks held by any stateid associated with the
-		 * (lock) stateowner */
-		status = nfserr_locks_held;
-		list_for_each_entry(stp, &local->so_perfilestate, st_perfilestate) {
-			if(stp->st_vfs_set) {
-				if (check_for_locks(&stp->st_vfs_file, local))
-					goto out;
+	for (i=0; i < LOCK_HASH_SIZE; i++)
+		list_for_each_entry(local, &lock_ownerstr_hashtbl[i], so_strhash)
+			if(cmp_owner_str(local, owner, clid)) {
+				struct nfs4_stateid *stp;
+
+				/* check for any locks held by any stateid
+				 * associated with the (lock) stateowner */
+				status = nfserr_locks_held;
+				list_for_each_entry(stp, &local->so_perfilestate,
+						    st_perfilestate) {
+					if(stp->st_vfs_set) {
+						if (check_for_locks(&stp->st_vfs_file,
+								    local))
+							goto out;
+					}
+				}
+				/* no locks held by (lock) stateowner */
+				status = nfs_ok;
+				release_stateowner(local);
+				goto out;
 			}
-		}
-		/* no locks held by (lock) stateowner */
-		status = nfs_ok;
-		release_stateowner(local);
-	}
 out:
 	nfs4_unlock_state();
 	return status;
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index b98b5fe49..2fc81bcbb 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -538,9 +538,8 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
 	case NF4SOCK:
 	case NF4FIFO:
 	case NF4DIR:
-		break;
 	default:
-		goto xdr_error;
+		break;
 	}
 
 	READ_BUF(4);
@@ -1289,6 +1288,49 @@ static u32 nfs4_ftypes[16] = {
         NF4SOCK, NF4BAD,  NF4LNK, NF4BAD,
 };
 
+static inline int
+xdr_padding(int l)
+{
+       return 3 - ((l - 1) & 3); /* smallest i>=0 such that (l+i)%4 = 0 */
+}
+
+static int
+nfsd4_encode_name(struct svc_rqst *rqstp, int group, uid_t id,
+			u32 **p, int *buflen)
+{
+	int status;
+	u32 len;
+
+	if (*buflen < (XDR_QUADLEN(IDMAP_NAMESZ) << 2) + 4)
+		return nfserr_resource;
+	if (group)
+		status = nfsd_map_gid_to_name(rqstp, id, (u8 *)(*p + 1));
+	else
+		status = nfsd_map_uid_to_name(rqstp, id, (u8 *)(*p + 1));
+	if (status < 0)
+		return nfserrno(status);
+	len = (unsigned)status;
+	*(*p)++ = htonl(len);
+	memset((u8 *)*p + len, 0, xdr_padding(len));
+	*p += XDR_QUADLEN(len);
+	*buflen -= (XDR_QUADLEN(len) << 2) + 4;
+	BUG_ON(*buflen < 0);
+	return 0;
+}
+
+static inline int
+nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, u32 **p, int *buflen)
+{
+	return nfsd4_encode_name(rqstp, uid, 0, p, buflen);
+}
+
+static inline int
+nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, u32 **p, int *buflen)
+{
+	return nfsd4_encode_name(rqstp, gid, 1, p, buflen);
+}
+
+
 /*
  * Note: @fhp can be NULL; in this case, we might have to compose the filehandle
  * ourselves.
@@ -1304,10 +1346,6 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
 	u32 bmval0 = bmval[0];
 	u32 bmval1 = bmval[1];
 	struct kstat stat;
-	char owner[IDMAP_NAMESZ];
-	u32 ownerlen = 0;
-	char group[IDMAP_NAMESZ];
-	u32 grouplen = 0;
 	struct svc_fh tempfh;
 	struct kstatfs statfs;
 	int buflen = *countp << 2;
@@ -1338,23 +1376,6 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
 			goto out;
 		fhp = &tempfh;
 	}
-	if (bmval1 & FATTR4_WORD1_OWNER) {
-		int temp = nfsd_map_uid_to_name(rqstp, stat.uid, owner);
-		if (temp < 0) {
-			status = temp;
-			goto out_nfserr;
-		}
-		ownerlen = (unsigned) temp;
-	}
-	if (bmval1 & FATTR4_WORD1_OWNER_GROUP) {
-		int temp = nfsd_map_gid_to_name(rqstp, stat.gid, group);
-		if (temp < 0) {
-			status = temp;
-			goto out_nfserr;
-		}
-		grouplen = (unsigned) temp;
-	}
-
 	if ((buflen -= 16) < 0)
 		goto out_resource;
 
@@ -1536,18 +1557,18 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
 		WRITE32(stat.nlink);
 	}
 	if (bmval1 & FATTR4_WORD1_OWNER) {
-		buflen -= (XDR_QUADLEN(ownerlen) << 2) + 4;
-		if (buflen < 0)
+		status = nfsd4_encode_user(rqstp, stat.uid, &p, &buflen);
+		if (status == nfserr_resource)
 			goto out_resource;
-		WRITE32(ownerlen);
-		WRITEMEM(owner, ownerlen);
+		if (status)
+			goto out;
 	}
 	if (bmval1 & FATTR4_WORD1_OWNER_GROUP) {
-		buflen -= (XDR_QUADLEN(grouplen) << 2) + 4;
-		if (buflen < 0)
+		status = nfsd4_encode_group(rqstp, stat.gid, &p, &buflen);
+		if (status == nfserr_resource)
 			goto out_resource;
-		WRITE32(grouplen);
-		WRITEMEM(group, grouplen);
+		if (status)
+			goto out;
 	}
 	if (bmval1 & FATTR4_WORD1_RAWDEV) {
 		if ((buflen -= 8) < 0)
@@ -1686,6 +1707,7 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
 			goto error;
 		}
 
+		exp_get(exp);
 		if (d_mountpoint(dentry)) {
 			if ((nfserr = nfsd_cross_mnt(cd->rd_rqstp, &dentry, 
 					 &exp))) {	
@@ -1697,6 +1719,7 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
 			 * this call will be retried.
 			 */
 				dput(dentry);
+				exp_put(exp);
 				nfserr = nfserr_dropit;
 				goto error;
 			}
@@ -1706,6 +1729,8 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
 		nfserr = nfsd4_encode_fattr(NULL, exp,
 				dentry, p, &buflen, cd->rd_bmval,
 				cd->rd_rqstp);
+		dput(dentry);
+		exp_put(exp);
 		if (!nfserr) {
 			p += buflen;
 			goto out;
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 91bfe96ec..5014476b1 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -91,7 +91,7 @@ struct argresp {
  * possibly a read which collects the result - which is stored in a 
  * file-local buffer.
  */
-static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t *pos)
+static ssize_t TA_write(struct file *file, const char __user *buf, size_t size, loff_t *pos)
 {
 	ino_t ino =  file->f_dentry->d_inode->i_ino;
 	struct argresp *ar;
@@ -130,7 +130,7 @@ static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t
 }
 
 
-static ssize_t TA_read(struct file *file, char *buf, size_t size, loff_t *pos)
+static ssize_t TA_read(struct file *file, char __user *buf, size_t size, loff_t *pos)
 {
 	struct argresp *ar;
 	ssize_t rv = 0;
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 369ccea07..8e8c2342b 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -56,7 +56,7 @@ int nfsd_acceptable(void *expv, struct dentry *dentry)
 		/* make sure parents give x permission to user */
 		int err;
 		parent = dget_parent(tdentry);
-		err = permission(parent->d_inode, S_IXOTH, NULL);
+		err = permission(parent->d_inode, MAY_EXEC, NULL);
 		if (err < 0) {
 			dput(parent);
 			break;
@@ -367,7 +367,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st
 		printk(KERN_ERR "fh_compose: called with maxsize %d! %s/%s\n",
 		       fhp->fh_maxsize, parent->d_name.name, dentry->d_name.name);
 
-	fhp->fh_dentry = dentry; /* our internal copy */
+	fhp->fh_dentry = dget(dentry); /* our internal copy */
 	fhp->fh_export = exp;
 	cache_get(&exp->h);
 
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 337c8c3bc..d34a59d28 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -212,6 +212,7 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
 	nfserr = fh_compose(newfhp, dirfhp->fh_export, dchild, dirfhp);
 	if (!nfserr && !dchild->d_inode)
 		nfserr = nfserr_noent;
+	dput(dchild);
 	if (nfserr) {
 		if (nfserr != nfserr_noent)
 			goto out_unlock;
@@ -588,6 +589,7 @@ nfserrno (int errno)
 		{ nfserr_jukebox, -ETIMEDOUT },
 		{ nfserr_dropit, -EAGAIN },
 		{ nfserr_dropit, -ENOMEM },
+		{ nfserr_badname, -ESRCH },
 		{ -1, -EIO }
 	};
 	int	i;
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index f5586d815..3c57bc31f 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -141,10 +141,11 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
 	/* Obtain dentry and export. */
 	err = fh_verify(rqstp, fhp, S_IFDIR, MAY_EXEC);
 	if (err)
-		goto out;
+		return err;
 
 	dparent = fhp->fh_dentry;
 	exp  = fhp->fh_export;
+	exp_get(exp);
 
 	err = nfserr_acces;
 
@@ -208,7 +209,9 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
 	err = fh_compose(resfh, exp, dentry, fhp);
 	if (!err && !dentry->d_inode)
 		err = nfserr_noent;
+	dput(dentry);
 out:
+	exp_put(exp);
 	return err;
 
 out_nfserr:
@@ -564,7 +567,7 @@ nfsd_sync_dir(struct dentry *dp)
 static spinlock_t ra_lock = SPIN_LOCK_UNLOCKED;
 
 static inline struct raparms *
-nfsd_get_raparms(dev_t dev, ino_t ino)
+nfsd_get_raparms(dev_t dev, ino_t ino, struct address_space *mapping)
 {
 	struct raparms	*ra, **rap, **frap = NULL;
 	int depth = 0;
@@ -586,7 +589,7 @@ nfsd_get_raparms(dev_t dev, ino_t ino)
 	ra = *frap;
 	ra->p_dev = dev;
 	ra->p_ino = ino;
-	memset(&ra->p_ra, 0, sizeof(ra->p_ra));
+	file_ra_state_init(&ra->p_ra, mapping);
 found:
 	if (rap != &raparm_cache) {
 		*rap = ra->p_next;
@@ -658,7 +661,8 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
 #endif
 
 	/* Get readahead parameters */
-	ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino);
+	ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino,
+			      inode->i_mapping->host->i_mapping);
 	if (ra)
 		file.f_ra = ra->p_ra;
 
@@ -674,9 +678,12 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
 	}
 
 	/* Write back readahead params */
-	if (ra)
+	if (ra) {
+		spin_lock(&ra_lock);
 		ra->p_ra = file.f_ra;
-
+		ra->p_count--;
+		spin_unlock(&ra_lock);
+	}
 	if (err >= 0) {
 		nfsdstats.io_read += err;
 		*count = err;
@@ -859,7 +866,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		char *fname, int flen, struct iattr *iap,
 		int type, dev_t rdev, struct svc_fh *resfhp)
 {
-	struct dentry	*dentry, *dchild;
+	struct dentry	*dentry, *dchild = NULL;
 	struct inode	*dirp;
 	int		err;
 
@@ -896,7 +903,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 			goto out;
 	} else {
 		/* called from nfsd_proc_create */
-		dchild = resfhp->fh_dentry;
+		dchild = dget(resfhp->fh_dentry);
 		if (!fhp->fh_locked) {
 			/* not actually possible */
 			printk(KERN_ERR
@@ -965,6 +972,8 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 	if (!err)
 		err = fh_update(resfhp);
 out:
+	if (dchild && !IS_ERR(dchild))
+		dput(dchild);
 	return err;
 
 out_nfserr:
@@ -982,7 +991,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		struct svc_fh *resfhp, int createmode, u32 *verifier,
 	        int *truncp)
 {
-	struct dentry	*dentry, *dchild;
+	struct dentry	*dentry, *dchild = NULL;
 	struct inode	*dirp;
 	int		err;
 	__u32		v_mtime=0, v_atime=0;
@@ -1111,6 +1120,8 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
 
  out:
 	fh_unlock(fhp);
+	if (dchild && !IS_ERR(dchild))
+		dput(dchild);
  	return err;
  
  out_nfserr:
@@ -1177,6 +1188,7 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
 {
 	struct dentry	*dentry, *dnew;
 	int		err, cerr;
+	umode_t		mode;
 
 	err = nfserr_noent;
 	if (!flen || !plen)
@@ -1195,6 +1207,11 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
 	if (IS_ERR(dnew))
 		goto out_nfserr;
 
+	mode = S_IALLUGO;
+	/* Only the MODE ATTRibute is even vaguely meaningful */
+	if (iap && (iap->ia_valid & ATTR_MODE))
+		mode = iap->ia_mode & S_IALLUGO;
+
 	if (unlikely(path[plen] != 0)) {
 		char *path_alloced = kmalloc(plen+1, GFP_KERNEL);
 		if (path_alloced == NULL)
@@ -1202,34 +1219,21 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		else {
 			strncpy(path_alloced, path, plen);
 			path_alloced[plen] = 0;
-			err = vfs_symlink(dentry->d_inode, dnew, path_alloced);
+			err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
 			kfree(path_alloced);
 		}
 	} else
-		err = vfs_symlink(dentry->d_inode, dnew, path);
+		err = vfs_symlink(dentry->d_inode, dnew, path, mode);
 
 	if (!err) {
 		if (EX_ISSYNC(fhp->fh_export))
 			nfsd_sync_dir(dentry);
-		if (iap) {
-			iap->ia_valid &= ATTR_MODE /* ~(ATTR_MODE|ATTR_UID|ATTR_GID)*/;
-			if (iap->ia_valid) {
-				iap->ia_valid |= ATTR_CTIME;
-				iap->ia_mode = (iap->ia_mode&S_IALLUGO)
-					| S_IFLNK;
-				err = notify_change(dnew, iap);
-				if (err)
-					err = nfserrno(err);
-				else if (EX_ISSYNC(fhp->fh_export))
-					write_inode_now(dentry->d_inode, 1);
-		       }
-		}
 	} else
 		err = nfserrno(err);
 	fh_unlock(fhp);
 
-	/* Compose the fh so the dentry will be freed ... */
 	cerr = fh_compose(resfhp, fhp->fh_export, dnew, fhp);
+	dput(dnew);
 	if (err==0) err = cerr;
 out:
 	return err;
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index 668900d80..57e8c7ec7 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -1,12 +1,20 @@
-ToDo:
+ToDo/Notes:
 	- Find and fix bugs.
+	- Either invalidate quotas or update the quota charges on NTFS 3.x
+	  volumes with quota tracking enabled ($Quota).
+	- Checkpoint or disable the user space journal ($UsnJrnl).
 	- Implement aops->set_page_dirty() in order to take control of buffer
 	  dirtying. Not having it means if page_has_buffers(), all buffers
 	  will be dirtied with the page. And if not they won't be. That is
 	  fine for the moment but will break once we enable metadata updates.
-	- Implement sops->dirty_inode() to implement {a,m,c} time updates and
-	  such things.
-	- Implement sops->write_inode().
+	  For now just always using __set_page_dirty_nobuffers() for metadata
+	  pages as nothing can dirty a page other than ourselves. Should this
+	  change, we will really need to roll our own ->set_page_dirty().
+	- Implement sops->dirty_inode() to implement {a,m,c}time updates and
+	  such things.  This should probably just flag the ntfs inode such that
+	  sops->write_inode(), i.e. ntfs_write_inode(), will copy the times
+	  when it is invoked rather than having to update the mft record
+	  every time.
 	- In between ntfs_prepare/commit_write, need exclusion between
 	  simultaneous file extensions. Need perhaps an NInoResizeUnderway()
 	  flag which we can set in ntfs_prepare_write() and clear again in
@@ -18,8 +26,128 @@ ToDo:
 	  OTOH, perhaps i_sem, which is held accross generic_file_write is
 	  sufficient for synchronisation here. We then just need to make sure
 	  ntfs_readpage/writepage/truncate interoperate properly with us.
-
-2.1.8 - Handle $MFT mirror and $LogFile, improve time ihandling, and cleanups.
+	- Implement mft.c::sync_mft_mirror_umount().  We currently will just
+	  leave the volume dirty on umount if the final iput(vol->mft_ino)
+	  causes a write of any mirrored mft records due to the mft mirror
+	  inode having been discarded already.  Whether this can actually ever
+	  happen is unclear however so it is worth waiting until someone hits
+	  the problem.
+	- Enable the code for setting the NT4 compatibility flag when we start
+	  making NTFS 1.2 specific modifications.
+
+2.1.14 - Fix an NFSd caused deadlock reported by several users.
+
+	- Modify fs/ntfs/ntfs_readdir() to copy the index root attribute value
+	  to a buffer so that we can put the search context and unmap the mft
+	  record before calling the filldir() callback.  We need to do this
+	  because of NFSd which calls ->lookup() from its filldir callback()
+	  and this causes NTFS to deadlock as ntfs_lookup() maps the mft record
+	  of the directory and since ntfs_readdir() has got it mapped already
+	  ntfs_lookup() deadlocks.
+
+2.1.13 - Enable overwriting of resident files and housekeeping of system files.
+
+	- Implement writing of mft records (fs/ntfs/mft.[hc]), which includes
+	  keeping the mft mirror in sync with the mft when mirrored mft records
+	  are written.  The functions are write_mft_record{,_nolock}().  The
+	  implementation is quite rudimentary for now with lots of things not
+	  implemented yet but I am not sure any of them can actually occur so
+	  I will wait for people to hit each one and only then implement it.
+	- Commit open system inodes at umount time.  This should make it
+	  virtually impossible for sync_mft_mirror_umount() to ever be needed.
+	- Implement ->write_inode (fs/ntfs/inode.c::ntfs_write_inode()) for the
+	  ntfs super operations.  This gives us inode writing via the VFS inode
+	  dirty code paths.  Note:  Access time updates are not implemented yet.
+	- Implement fs/ntfs/mft.[hc]::{,__}mark_mft_record_dirty() and make
+	  fs/ntfs/aops.c::ntfs_writepage() and ntfs_commit_write() use it, thus
+	  finally enabling resident file overwrite!  (-8  This also includes a
+	  placeholder for ->writepage (ntfs_mft_writepage()), which for now
+	  just redirties the page and returns.  Also, at umount time, we for
+	  now throw away all mft data page cache pages after the last call to
+	  ntfs_commit_inode() in the hope that all inodes will have been
+	  written out by then and hence no dirty (meta)data will be lost.  We
+	  also check for this case and emit an error message telling the user
+	  to run chkdsk.
+	- Use set_page_writeback() and end_page_writeback() in the resident
+	  attribute code path of fs/ntfs/aops.c::ntfs_writepage() otherwise
+	  the radix-tree tag PAGECACHE_TAG_DIRTY remains set even though the
+	  page is clean.
+	- Implement ntfs_mft_writepage() so it now checks if any of the mft
+	  records in the page are dirty and if so redirties the page and
+	  returns.  Otherwise it just returns (after doing set_page_writeback(),
+	  unlock_page(), end_page_writeback() or the radix-tree tag
+	  PAGECACHE_TAG_DIRTY remains set even though the page is clean), thus
+	  alowing the VM to do with the page as it pleases.  Also, at umount
+	  time, now only throw away dirty mft (meta)data pages if dirty inodes
+	  are present and ask the user to email us if they see this happening.
+	- Add functions ntfs_{clear,set}_volume_flags(), to modify the volume
+	  information flags (fs/ntfs/super.c).
+	- Mark the volume dirty when (re)mounting read-write and mark it clean
+	  when unmounting or remounting read-only.  If any volume errors are
+	  found, the volume is left marked dirty to force chkdsk to run.
+	- Add code to set the NT4 compatibility flag when (re)mounting
+	  read-write for newer NTFS versions but leave it commented out for now
+	  since we do not make any modifications that are NTFS 1.2 specific yet
+	  and since setting this flag breaks Captive-NTFS which is not nice.
+	  This code must be enabled once we start writing NTFS 1.2 specific
+	  changes otherwise Windows NTFS driver might crash / cause corruption.
+
+2.1.12 - Fix the second fix to the decompression engine and some cleanups.
+
+	- Add a new address space operations struct, ntfs_mst_aops, for mst
+	  protected attributes.  This is because the default ntfs_aops do not
+	  make sense with mst protected data and were they to write anything to
+	  such an attribute they would cause data corruption so we provide
+	  ntfs_mst_aops which does not have any write related operations set.
+	- Cleanup dirty ntfs inode handling (fs/ntfs/inode.[hc]) which also
+	  includes an adapted ntfs_commit_inode() and an implementation of
+	  ntfs_write_inode() which for now just cleans dirty inodes without
+	  writing them (it does emit a warning that this is happening).
+	- Undo the second decompression engine fix (see 2.1.9 release ChangeLog
+	  entry) as it was only fixing a theoretical bug but at the same time
+	  it badly broke the handling of sparse and uncompressed compression
+	  blocks.
+
+2.1.11 - Driver internal cleanups.
+
+	- Only build logfile.o if building the driver with read-write support.
+	- Really final white space cleanups.
+	- Use generic_ffs() instead of ffs() in logfile.c which allows the
+	  log_page_size variable to be optimized by gcc into a constant.
+	- Rename uchar_t to ntfschar everywhere as uchar_t is unsigned 1-byte
+	  char as defined by POSIX and as found on some systems.
+
+2.1.10 - Force read-only (re)mounting of volumes with unsupported volume flags.
+
+	- Finish off the white space cleanups (remove trailing spaces, etc).
+	- Clean up ntfs_fill_super() and ntfs_read_inode_mount() by removing
+	  the kludges around the first iget().  Instead of (re)setting ->s_op
+	  we have the $MFT inode set up by explicit new_inode() / set ->i_ino /
+	  insert_inode_hash() / call ntfs_read_inode_mount() directly.  This
+	  kills the need for second super_operations and allows to return error
+	  from ntfs_read_inode_mount() without resorting to ugly "poisoning"
+	  tricks.  (Al Viro)
+	- Force read-only (re)mounting if any of the following bits are set in
+	  the volume information flags:
+	  	VOLUME_IS_DIRTY, VOLUME_RESIZE_LOG_FILE,
+		VOLUME_UPGRADE_ON_MOUNT, VOLUME_DELETE_USN_UNDERWAY,
+		VOLUME_REPAIR_OBJECT_ID, VOLUME_MODIFIED_BY_CHKDSK
+	  To make this easier we define VOLUME_MUST_MOUNT_RO_MASK with all the
+	  above bits set so the test is made easy.
+
+2.1.9 - Fix two bugs in decompression engine.
+
+	- Fix a bug where we would not always detect that we have reached the
+	  end of a compression block because we were ending at minus one byte
+	  which is effectively the same as being at the end.  The fix is to
+	  check whether the uncompressed buffer has been fully filled and if so
+	  we assume we have reached the end of the compression block.  A big
+	  thank you to Marcin Gibuła for the bug report, the assistance in
+	  tracking down the bug and testing the fix.
+	- Fix a possible bug where when a compressed read is truncated to the
+	  end of the file, the offset inside the last page was not truncated.
+
+2.1.8 - Handle $MFT mirror and $LogFile, improve time handling, and cleanups.
 
 	- Use get_bh() instead of manual atomic_inc() in fs/ntfs/compress.c.
 	- Modify fs/ntfs/time.c::ntfs2utc(), get_current_ntfs_time(), and
@@ -570,12 +698,12 @@ tng-0.0.8 - 08/03/2002 - Now using BitKeeper, http://linux-ntfs.bkbits.net/
 	  types of inode names readdir() returns and modify ntfs_filldir()
 	  accordingly. There are several parameters to show_inodes:
 		system:	system files
-	  	win32:	long file names (including POSIX file names) [DEFAULT]
+		win32:	long file names (including POSIX file names) [DEFAULT]
 		long:	same as win32
-	  	dos:	short file names only (excluding POSIX file names)
+		dos:	short file names only (excluding POSIX file names)
 		short:	same as dos
 		posix:	same as both win32 and dos
-	  	all:	all file names
+		all:	all file names
 	  Note that the options are additive, i.e. specifying:
 		-o show_inodes=system,show_inodes=win32,show_inodes=dos
 	  is the same as specifying:
@@ -868,4 +996,3 @@ tng-0.0.0 - Initial version tag.
 	working nicely, too. Proof of inode metadata in the page cache and non-
 	resident file unnamed stream data in the page cache concepts is thus
 	complete.
-
diff --git a/fs/ntfs/Makefile b/fs/ntfs/Makefile
index 9601080b9..3665464f4 100644
--- a/fs/ntfs/Makefile
+++ b/fs/ntfs/Makefile
@@ -2,10 +2,10 @@
 
 obj-$(CONFIG_NTFS_FS) += ntfs.o
 
-ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o logfile.o \
-	     mft.o mst.o namei.o super.o sysctl.o unistr.o upcase.o
+ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
+	     mst.o namei.o super.o sysctl.o unistr.o upcase.o
 
-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.8\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.14\"
 
 ifeq ($(CONFIG_NTFS_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
@@ -13,4 +13,6 @@ endif
 
 ifeq ($(CONFIG_NTFS_RW),y)
 EXTRA_CFLAGS += -DNTFS_RW
+
+ntfs-objs += logfile.o
 endif
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 797846b8d..08aa85b44 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -478,8 +478,8 @@ static int ntfs_write_block(struct writeback_control *wbc, struct page *page)
 	ni = NTFS_I(vi);
 	vol = ni->vol;
 
-	ntfs_debug("Entering for inode %li, attribute type 0x%x, page index "
-			"0x%lx.\n", vi->i_ino, ni->type, page->index);
+	ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
+			"0x%lx.", vi->i_ino, ni->type, page->index);
 
 	BUG_ON(!NInoNonResident(ni));
 	BUG_ON(NInoMstProtected(ni));
@@ -778,9 +778,8 @@ lock_retry_remap:
  *
  * For resident attributes, OTOH, ntfs_writepage() writes the @page by copying
  * the data to the mft record (which at this stage is most likely in memory).
- * Thus, in this case, I/O is synchronous, as even if the mft record is not
- * cached at this point in time, we need to wait for it to be read in before we
- * can do the copy.
+ * The mft record is then marked dirty and written out asynchronously via the
+ * vfs inode dirty code path.
  *
  * Note the caller clears the page dirty flag before calling ntfs_writepage().
  *
@@ -875,16 +874,6 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 	BUG_ON(page_has_buffers(page));
 	BUG_ON(!PageUptodate(page));
 
-	// TODO: Consider using PageWriteback() + unlock_page() in 2.5 once the
-	// "VM fiddling has ended". Note, don't forget to replace all the
-	// unlock_page() calls further below with end_page_writeback() ones.
-	// FIXME: Make sure it is ok to SetPageError() on unlocked page under
-	// writeback before doing the change!
-#if 0
-	set_page_writeback(page);
-	unlock_page(page);
-#endif
-
 	if (!NInoAttr(ni))
 		base_ni = ni;
 	else
@@ -934,6 +923,14 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 	if (unlikely(bytes > PAGE_CACHE_SIZE))
 		bytes = PAGE_CACHE_SIZE;
 
+	/*
+	 * Keep the VM happy.  This must be done otherwise the radix-tree tag
+	 * PAGECACHE_TAG_DIRTY remains set even though the page is clean.
+	 */
+	BUG_ON(PageWriteback(page));
+	set_page_writeback(page);
+	unlock_page(page);
+
 	/*
 	 * Here, we don't need to zero the out of bounds area everytime because
 	 * the below memcpy() already takes care of the mmap-at-end-of-file
@@ -948,7 +945,10 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 	 * expose data to userspace/disk which should never have been exposed.
 	 *
 	 * FIXME: Ensure that i_size increases do the zeroing/overwriting and
-	 * if we cannot guarantee that, then enable the zeroing below.
+	 * if we cannot guarantee that, then enable the zeroing below.  If the
+	 * zeroing below is enabled, we MUST move the unlock_page() from above
+	 * to after the kunmap_atomic(), i.e. just before the
+	 * end_page_writeback().
 	 */
 
 	kaddr = kmap_atomic(page, KM_USER0);
@@ -966,11 +966,10 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 #endif
 	kunmap_atomic(kaddr, KM_USER0);
 
-	unlock_page(page);
+	end_page_writeback(page);
 
-	// TODO: Mark mft record dirty so it gets written back.
-	ntfs_error(vi->i_sb, "Writing to resident files is not supported yet. "
-			"Wrote to memory only...");
+	/* Mark the mft record dirty, so it gets written back. */
+	mark_mft_record_dirty(ctx->ntfs_ino);
 
 	put_attr_search_ctx(ctx);
 	unmap_mft_record(base_ni);
@@ -1022,7 +1021,7 @@ static int ntfs_prepare_nonresident_write(struct page *page,
 	ni = NTFS_I(vi);
 	vol = ni->vol;
 
-	ntfs_debug("Entering for inode %li, attribute type 0x%x, page index "
+	ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
 			"0x%lx, from = %u, to = %u.", vi->i_ino, ni->type,
 			page->index, from, to);
 
@@ -1379,7 +1378,7 @@ static int ntfs_prepare_write(struct file *file, struct page *page,
 	struct inode *vi = page->mapping->host;
 	ntfs_inode   *ni = NTFS_I(vi);
 
-	ntfs_debug("Entering for inode %li, attribute type 0x%x, page index "
+	ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
 			"0x%lx, from = %u, to = %u.", vi->i_ino, ni->type,
 			page->index, from, to);
 
@@ -1487,7 +1486,7 @@ static int ntfs_commit_nonresident_write(struct page *page,
 
 	vi = page->mapping->host;
 
-	ntfs_debug("Entering for inode %li, attribute type 0x%x, page index "
+	ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
 			"0x%lx, from = %u, to = %u.", vi->i_ino,
 			NTFS_I(vi)->type, page->index, from, to);
 
@@ -1583,7 +1582,7 @@ static int ntfs_commit_write(struct file *file, struct page *page,
 	vi = page->mapping->host;
 	ni = NTFS_I(vi);
 
-	ntfs_debug("Entering for inode %li, attribute type 0x%x, page index "
+	ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
 			"0x%lx, from = %u, to = %u.", vi->i_ino, ni->type,
 			page->index, from, to);
 
@@ -1734,9 +1733,8 @@ static int ntfs_commit_write(struct file *file, struct page *page,
 	}
 	kunmap_atomic(kaddr, KM_USER0);
 
-	// TODO: Mark mft record dirty so it gets written back.
-	ntfs_error(vi->i_sb, "Writing to resident files is not supported yet. "
-			"Wrote to memory only...");
+	/* Mark the mft record dirty, so it gets written back. */
+	mark_mft_record_dirty(ctx->ntfs_ino);
 
 	put_attr_search_ctx(ctx);
 	unmap_mft_record(base_ni);
@@ -1788,3 +1786,12 @@ struct address_space_operations ntfs_aops = {
 #endif
 };
 
+/**
+ * ntfs_mst_aops - general address space operations for mst protecteed inodes
+ *		   and attributes
+ */
+struct address_space_operations ntfs_mst_aops = {
+	.readpage	= ntfs_readpage,	/* Fill page with data. */
+	.sync_page	= block_sync_page,	/* Currently, just unplugs the
+						   disk request queue. */
+};
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index f6e6625b4..6c7fb2a2b 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -105,7 +105,7 @@ static inline run_list_element *ntfs_rl_realloc(run_list_element *rl,
  * It is up to the caller to serialize access to the run lists @dst and @src.
  *
  * Return: TRUE   Success, the run lists can be merged.
- *         FALSE  Failure, the run lists cannot be merged.
+ *	   FALSE  Failure, the run lists cannot be merged.
  */
 static inline BOOL ntfs_are_rl_mergeable(run_list_element *dst,
 		run_list_element *src)
@@ -151,7 +151,7 @@ static inline void __ntfs_rl_merge(run_list_element *dst, run_list_element *src)
  * It is up to the caller to serialize access to the run lists @dst and @src.
  *
  * Return: TRUE   Success, the run lists have been merged.
- *         FALSE  Failure, the run lists cannot be merged and have not been
+ *	   FALSE  Failure, the run lists cannot be merged and have not been
  *		  modified.
  */
 static inline BOOL ntfs_rl_merge(run_list_element *dst, run_list_element *src)
@@ -264,9 +264,9 @@ static inline run_list_element *ntfs_rl_insert(run_list_element *dst,
 	BUG_ON(!src);
 
 	/* disc => Discontinuity between the end of @dst and the start of @src.
-	 *         This means we might need to insert a hole.
+	 *	   This means we might need to insert a hole.
 	 * hole => @dst ends with a hole or an unmapped region which we can
-	 *         extend to match the discontinuity. */
+	 *	   extend to match the discontinuity. */
 	if (loc == 0)
 		disc = (src[0].vcn > 0);
 	else {
@@ -444,7 +444,7 @@ static inline run_list_element *ntfs_rl_split(run_list_element *dst, int dsize,
 	ntfs_rl_mc(dst, loc + 1, src, 0, ssize);
 
 	/* Adjust the size of the holes either size of @src. */
-	dst[loc].length         = dst[loc+1].vcn       - dst[loc].vcn;
+	dst[loc].length		= dst[loc+1].vcn       - dst[loc].vcn;
 	dst[loc+ssize+1].vcn    = dst[loc+ssize].vcn   + dst[loc+ssize].length;
 	dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn;
 
@@ -504,7 +504,7 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl,
 	ntfs_debug_dump_runlist(srl);
 #endif
 
- 	/* Check for silly calling... */
+	/* Check for silly calling... */
 	if (unlikely(!srl))
 		return drl;
 	if (unlikely(IS_ERR(srl) || IS_ERR(drl)))
@@ -624,7 +624,7 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl,
 
 			if (drl[ds].vcn == marker_vcn) {
 				ntfs_debug("Old marker = 0x%llx, replacing "
-						"with LCN_ENOENT.\n",
+						"with LCN_ENOENT.",
 						(unsigned long long)
 						drl[ds].lcn);
 				drl[ds].lcn = (LCN)LCN_ENOENT;
@@ -706,9 +706,9 @@ critical_error:
  *
  * The following error codes are defined:
  *	-ENOMEM	- Not enough memory to allocate run list array.
- * 	-EIO	- Corrupt run list.
- * 	-EINVAL	- Invalid parameters were passed in.
- * 	-ERANGE	- The two run lists overlap.
+ *	-EIO	- Corrupt run list.
+ *	-EINVAL	- Invalid parameters were passed in.
+ *	-ERANGE	- The two run lists overlap.
  *
  * FIXME: For now we take the conceptionally simplest approach of creating the
  * new run list disregarding the already existing one and then splicing the
@@ -719,7 +719,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
 		const ATTR_RECORD *attr, run_list_element *old_rl)
 {
 	VCN vcn;		/* Current vcn. */
-	LCN lcn; 		/* Current lcn. */
+	LCN lcn;		/* Current lcn. */
 	s64 deltaxcn;		/* Change in [vl]cn. */
 	run_list_element *rl;	/* The output run list. */
 	u8 *buf;		/* Current position in mapping pairs array. */
@@ -769,7 +769,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
 		 */
 		if (((rlpos + 3) * sizeof(*old_rl)) > rlsize) {
 			run_list_element *rl2;
-			
+
 			rl2 = ntfs_malloc_nofs(rlsize + (int)PAGE_SIZE);
 			if (unlikely(!rl2)) {
 				ntfs_free(rl);
@@ -946,7 +946,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
 	attr_search_context *ctx;
 	MFT_RECORD *mrec;
 	int err = 0;
-	
+
 	ntfs_debug("Mapping run list part containing vcn 0x%llx.",
 			(unsigned long long)vcn);
 
@@ -983,7 +983,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
 			ni->run_list.rl = rl;
 	}
 	up_write(&ni->run_list.lock);
-	
+
 	put_attr_search_ctx(ctx);
 err_out:
 	unmap_mft_record(base_ni);
@@ -1096,13 +1096,13 @@ LCN vcn_to_lcn(const run_list_element *rl, const VCN vcn)
  * Warning: Never use @val when looking for attribute types which can be
  *	    non-resident as this most likely will result in a crash!
  */
-BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
+BOOL find_attr(const ATTR_TYPES type, const ntfschar *name, const u32 name_len,
 		const IGNORE_CASE_BOOL ic, const u8 *val, const u32 val_len,
 		attr_search_context *ctx)
 {
 	ATTR_RECORD *a;
 	ntfs_volume *vol;
-	uchar_t *upcase;
+	ntfschar *upcase;
 	u32 upcase_len;
 
 	if (ic == IGNORE_CASE) {
@@ -1145,12 +1145,12 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
 			if (a->name_length)
 				return FALSE;
 		} else if (!ntfs_are_names_equal(name, name_len,
-			    (uchar_t*)((u8*)a + le16_to_cpu(a->name_offset)),
+			    (ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)),
 			    a->name_length, ic, upcase, upcase_len)) {
 			register int rc;
-			
+
 			rc = ntfs_collate_names(name, name_len,
-					(uchar_t*)((u8*)a +
+					(ntfschar*)((u8*)a +
 						le16_to_cpu(a->name_offset)),
 					a->name_length, 1, IGNORE_CASE,
 					upcase, upcase_len);
@@ -1162,9 +1162,9 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
 				return FALSE;
 			/* If the strings are not equal, continue search. */
 			if (rc)
-	 			continue;
+				continue;
 			rc = ntfs_collate_names(name, name_len,
-					(uchar_t*)((u8*)a +
+					(ntfschar*)((u8*)a +
 						le16_to_cpu(a->name_offset)),
 					a->name_length, 1, CASE_SENSITIVE,
 					upcase, upcase_len);
@@ -1354,7 +1354,7 @@ err_out:
  * and if there is not enough space, the attribute should be placed in an
  * extent mft record.
  */
-static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
+static BOOL find_external_attr(const ATTR_TYPES type, const ntfschar *name,
 		const u32 name_len, const IGNORE_CASE_BOOL ic,
 		const VCN lowest_vcn, const u8 *val, const u32 val_len,
 		attr_search_context *ctx)
@@ -1364,7 +1364,7 @@ static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
 	ATTR_LIST_ENTRY *al_entry, *next_al_entry;
 	u8 *al_start, *al_end;
 	ATTR_RECORD *a;
-	uchar_t *al_name;
+	ntfschar *al_name;
 	u32 al_name_len;
 
 	ni = ctx->ntfs_ino;
@@ -1417,7 +1417,7 @@ static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
 		 * missing, assume we want an unnamed attribute.
 		 */
 		al_name_len = al_entry->name_length;
-		al_name = (uchar_t*)((u8*)al_entry + al_entry->name_offset);
+		al_name = (ntfschar*)((u8*)al_entry + al_entry->name_offset);
 		if (!name) {
 			if (al_name_len)
 				goto not_found;
@@ -1461,12 +1461,12 @@ static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
 		if (lowest_vcn && (u8*)next_al_entry >= al_start	    &&
 				(u8*)next_al_entry + 6 < al_end		    &&
 				(u8*)next_al_entry + le16_to_cpu(
-					next_al_entry->length) <= al_end    &&	
+					next_al_entry->length) <= al_end    &&
 				sle64_to_cpu(next_al_entry->lowest_vcn) <=
 					sle64_to_cpu(lowest_vcn)	    &&
 				next_al_entry->type == al_entry->type	    &&
 				next_al_entry->name_length == al_name_len   &&
-				ntfs_are_names_equal((uchar_t*)((u8*)
+				ntfs_are_names_equal((ntfschar*)((u8*)
 					next_al_entry +
 					next_al_entry->name_offset),
 					next_al_entry->name_length,
@@ -1539,7 +1539,7 @@ do_next_attr_loop:
 		if (name) {
 			if (a->name_length != al_name_len)
 				continue;
-			if (!ntfs_are_names_equal((uchar_t*)((u8*)a +
+			if (!ntfs_are_names_equal((ntfschar*)((u8*)a +
 					le16_to_cpu(a->name_offset)),
 					a->name_length, al_name, al_name_len,
 					CASE_SENSITIVE, vol->upcase,
@@ -1565,7 +1565,7 @@ do_next_attr:
 		goto do_next_attr_loop;
 	}
 	ntfs_error(base_ni->vol->sb, "Inode contains corrupt attribute list "
-			"attribute.\n");
+			"attribute.");
 	if (ni != base_ni) {
 		unmap_extent_mft_record(ni);
 		ctx->ntfs_ino = base_ni;
@@ -1623,9 +1623,10 @@ not_found:
  * being searched for, i.e. if one wants to add the attribute to the mft
  * record this is the correct place to insert it into.
  */
-BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
-		const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
-		const u32 val_len, attr_search_context *ctx)
+BOOL lookup_attr(const ATTR_TYPES type, const ntfschar *name,
+		const u32 name_len, const IGNORE_CASE_BOOL ic,
+		const VCN lowest_vcn, const u8 *val, const u32 val_len,
+		attr_search_context *ctx)
 {
 	ntfs_inode *base_ni;
 
diff --git a/fs/ntfs/attrib.h b/fs/ntfs/attrib.h
index 8c36c1a44..bbdc9deca 100644
--- a/fs/ntfs/attrib.h
+++ b/fs/ntfs/attrib.h
@@ -2,7 +2,7 @@
  * attrib.h - Defines for attribute handling in NTFS Linux kernel driver.
  *	      Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  * Copyright (c) 2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
@@ -10,13 +10,13 @@
  * by the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -79,13 +79,14 @@ extern int map_run_list(ntfs_inode *ni, VCN vcn);
 
 extern LCN vcn_to_lcn(const run_list_element *rl, const VCN vcn);
 
-extern BOOL find_attr(const ATTR_TYPES type, const uchar_t *name,
+extern BOOL find_attr(const ATTR_TYPES type, const ntfschar *name,
 		const u32 name_len, const IGNORE_CASE_BOOL ic, const u8 *val,
 		const u32 val_len, attr_search_context *ctx);
 
-BOOL lookup_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
-		const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
-		const u32 val_len, attr_search_context *ctx);
+BOOL lookup_attr(const ATTR_TYPES type, const ntfschar *name,
+		const u32 name_len, const IGNORE_CASE_BOOL ic,
+		const VCN lowest_vcn, const u8 *val, const u32 val_len,
+		attr_search_context *ctx);
 
 extern int load_attribute_list(ntfs_volume *vol, run_list *rl, u8 *al_start,
 		const s64 size, const s64 initialized_size);
@@ -103,4 +104,3 @@ extern attr_search_context *get_attr_search_ctx(ntfs_inode *ni,
 extern void put_attr_search_ctx(attr_search_context *ctx);
 
 #endif /* _LINUX_NTFS_ATTRIB_H */
-
diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
index fba39c9b7..f9aca53c7 100644
--- a/fs/ntfs/compress.c
+++ b/fs/ntfs/compress.c
@@ -197,9 +197,15 @@ static int ntfs_decompress(struct page *dest_pages[], int *dest_index,
 do_next_sb:
 	ntfs_debug("Beginning sub-block at offset = 0x%x in the cb.",
 			cb - cb_start);
-
-	/* Have we reached the end of the compression block? */
-	if (cb == cb_end || !le16_to_cpup((u16*)cb)) {
+	/*
+	 * Have we reached the end of the compression block or the end of the
+	 * decompressed data?  The latter can happen for example if the current
+	 * position in the compression block is one byte before its end so the
+	 * first two checks do not detect it.
+	 */
+	if (cb == cb_end || !le16_to_cpup((u16*)cb) ||
+			(*dest_index == dest_max_index &&
+			*dest_ofs == dest_max_ofs)) {
 		int i;
 
 		ntfs_debug("Completed. Returning success (0).");
@@ -427,7 +433,7 @@ do_next_tag:
 	goto do_next_tag;
 
 return_overflow:
-	ntfs_error(NULL, "Failed. Returning -EOVERFLOW.\n");
+	ntfs_error(NULL, "Failed. Returning -EOVERFLOW.");
 	goto return_error;
 }
 
@@ -845,7 +851,7 @@ lock_retry_remap:
 		if (err) {
 			ntfs_error(vol->sb, "ntfs_decompress() failed in inode "
 					"0x%lx with error code %i. Skipping "
-					"this compression block.\n",
+					"this compression block.",
 					ni->mft_no, -err);
 			/* Release the unfinished pages. */
 			for (; prev_cur_page < cur_page; prev_cur_page++) {
@@ -882,7 +888,8 @@ lock_retry_remap:
 		if (page) {
 			ntfs_error(vol->sb, "Still have pages left! "
 					"Terminating them with extreme "
-					"prejudice.");
+					"prejudice.  Inode 0x%lx, page index "
+					"0x%lx.", ni->mft_no, page->index);
 			if (cur_page == xpage && !xpage_done)
 				SetPageError(page);
 			flush_dcache_page(page);
diff --git a/fs/ntfs/debug.c b/fs/ntfs/debug.c
index b78932c15..8ba061051 100644
--- a/fs/ntfs/debug.c
+++ b/fs/ntfs/debug.c
@@ -1,20 +1,20 @@
 /*
  * debug.c - NTFS kernel debug support. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001,2002 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -172,4 +172,3 @@ void ntfs_debug_dump_runlist(const run_list_element *rl)
 }
 
 #endif
-
diff --git a/fs/ntfs/debug.h b/fs/ntfs/debug.h
index 633ecc7ca..e90da5153 100644
--- a/fs/ntfs/debug.h
+++ b/fs/ntfs/debug.h
@@ -1,20 +1,20 @@
 /*
  * debug.h - NTFS kernel debug support. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001,2002 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -69,4 +69,3 @@ extern void __ntfs_error(const char *function, const struct super_block *sb,
 #define ntfs_error(sb, f, a...)		__ntfs_error(__FUNCTION__, sb, f, ##a)
 
 #endif /* _LINUX_NTFS_DEBUG_H */
-
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 1f0de9054..153100bfc 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -27,7 +27,7 @@
 /**
  * The little endian Unicode string $I30 as a global constant.
  */
-uchar_t I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
+ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
 		const_cpu_to_le16('3'),	const_cpu_to_le16('0'),
 		const_cpu_to_le16(0) };
 
@@ -64,7 +64,7 @@ uchar_t I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
  * work but we don't care for how quickly one can access them. This also fixes
  * the dcache aliasing issues.
  */
-MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
+MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
 		const int uname_len, ntfs_name **res)
 {
 	ntfs_volume *vol = dir_ni->vol;
@@ -135,7 +135,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
 		 * returning.
 		 */
 		if (ntfs_are_names_equal(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length,
 				CASE_SENSITIVE, vol->upcase, vol->upcase_len)) {
 found_it:
@@ -186,7 +186,7 @@ found_it:
 		if (!NVolCaseSensitive(vol) &&
 				ie->key.file_name.file_name_type &&
 				ntfs_are_names_equal(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length,
 				IGNORE_CASE, vol->upcase, vol->upcase_len)) {
 			int name_size = sizeof(ntfs_name);
@@ -206,7 +206,7 @@ found_it:
 			}
 
 			if (type != FILE_NAME_DOS)
-				name_size += len * sizeof(uchar_t);
+				name_size += len * sizeof(ntfschar);
 			name = kmalloc(name_size, GFP_NOFS);
 			if (!name) {
 				err = -ENOMEM;
@@ -217,7 +217,7 @@ found_it:
 			if (type != FILE_NAME_DOS) {
 				name->len = len;
 				memcpy(name->name, ie->key.file_name.file_name,
-						len * sizeof(uchar_t));
+						len * sizeof(ntfschar));
 			} else
 				name->len = 0;
 			*res = name;
@@ -227,7 +227,7 @@ found_it:
 		 * know which way in the B+tree we have to go.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				IGNORE_CASE, vol->upcase, vol->upcase_len);
 		/*
@@ -246,7 +246,7 @@ found_it:
 		 * collation.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				CASE_SENSITIVE, vol->upcase, vol->upcase_len);
 		if (rc == -1)
@@ -395,7 +395,7 @@ fast_descend_into_child_node:
 		 * returning.
 		 */
 		if (ntfs_are_names_equal(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length,
 				CASE_SENSITIVE, vol->upcase, vol->upcase_len)) {
 found_it2:
@@ -445,7 +445,7 @@ found_it2:
 		if (!NVolCaseSensitive(vol) &&
 				ie->key.file_name.file_name_type &&
 				ntfs_are_names_equal(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length,
 				IGNORE_CASE, vol->upcase, vol->upcase_len)) {
 			int name_size = sizeof(ntfs_name);
@@ -466,7 +466,7 @@ found_it2:
 			}
 
 			if (type != FILE_NAME_DOS)
-				name_size += len * sizeof(uchar_t);
+				name_size += len * sizeof(ntfschar);
 			name = kmalloc(name_size, GFP_NOFS);
 			if (!name) {
 				err = -ENOMEM;
@@ -477,7 +477,7 @@ found_it2:
 			if (type != FILE_NAME_DOS) {
 				name->len = len;
 				memcpy(name->name, ie->key.file_name.file_name,
-						len * sizeof(uchar_t));
+						len * sizeof(ntfschar));
 			} else
 				name->len = 0;
 			*res = name;
@@ -487,7 +487,7 @@ found_it2:
 		 * know which way in the B+tree we have to go.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				IGNORE_CASE, vol->upcase, vol->upcase_len);
 		/*
@@ -506,7 +506,7 @@ found_it2:
 		 * collation.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				CASE_SENSITIVE, vol->upcase, vol->upcase_len);
 		if (rc == -1)
@@ -607,7 +607,7 @@ dir_err_out:
  *
  * Note, @uname_len does not include the (optional) terminating NULL character.
  */
-u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
+u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
 		const int uname_len)
 {
 	ntfs_volume *vol = dir_ni->vol;
@@ -689,7 +689,7 @@ u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
 		 * convert it to cpu format before returning.
 		 */
 		if (ntfs_are_names_equal(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, ic,
 				vol->upcase, vol->upcase_len)) {
 found_it:
@@ -703,7 +703,7 @@ found_it:
 		 * know which way in the B+tree we have to go.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				IGNORE_CASE, vol->upcase, vol->upcase_len);
 		/*
@@ -722,7 +722,7 @@ found_it:
 		 * collation.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				CASE_SENSITIVE, vol->upcase, vol->upcase_len);
 		if (rc == -1)
@@ -875,7 +875,7 @@ fast_descend_into_child_node:
 		 * convert it to cpu format before returning.
 		 */
 		if (ntfs_are_names_equal(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, ic,
 				vol->upcase, vol->upcase_len)) {
 found_it2:
@@ -888,7 +888,7 @@ found_it2:
 		 * know which way in the B+tree we have to go.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				IGNORE_CASE, vol->upcase, vol->upcase_len);
 		/*
@@ -907,7 +907,7 @@ found_it2:
 		 * collation.
 		 */
 		rc = ntfs_collate_names(uname, uname_len,
-				(uchar_t*)&ie->key.file_name.file_name,
+				(ntfschar*)&ie->key.file_name.file_name,
 				ie->key.file_name.file_name_length, 1,
 				CASE_SENSITIVE, vol->upcase, vol->upcase_len);
 		if (rc == -1)
@@ -1027,7 +1027,7 @@ static inline int ntfs_filldir(ntfs_volume *vol, loff_t *fpos,
 		ntfs_debug("Skipping system file.");
 		return 0;
 	}
-	name_len = ntfs_ucstonls(vol, (uchar_t*)&ie->key.file_name.file_name,
+	name_len = ntfs_ucstonls(vol, (ntfschar*)&ie->key.file_name.file_name,
 			ie->key.file_name.file_name_length, &name,
 			NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1);
 	if (name_len <= 0) {
@@ -1067,7 +1067,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 	ntfs_inode *ndir = NTFS_I(vdir);
 	ntfs_volume *vol = NTFS_SB(sb);
 	MFT_RECORD *m;
-	INDEX_ROOT *ir;
+	INDEX_ROOT *ir = NULL;
 	INDEX_ENTRY *ie;
 	INDEX_ALLOCATION *ia;
 	u8 *name = NULL;
@@ -1139,9 +1139,29 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 				"inode 0x%lx.", vdir->i_ino);
 		goto err_out;
 	}
-	/* Get to the index root value (it's been verified in read_inode). */
-	ir = (INDEX_ROOT*)((u8*)ctx->attr +
-			le16_to_cpu(ctx->attr->data.resident.value_offset));
+	/*
+	 * Copy the index root attribute value to a buffer so that we can put
+	 * the search context and unmap the mft record before calling the
+	 * filldir() callback.  We need to do this because of NFSd which calls
+	 * ->lookup() from its filldir callback() and this causes NTFS to
+	 * deadlock as ntfs_lookup() maps the mft record of the directory and
+	 * we have got it mapped here already.  The only solution is for us to
+	 * unmap the mft record here so that a call to ntfs_lookup() is able to
+	 * map the mft record without deadlocking.
+	 */
+	rc = le32_to_cpu(ctx->attr->data.resident.value_length);
+	ir = (INDEX_ROOT*)kmalloc(rc, GFP_NOFS);
+	if (unlikely(!ir)) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	/* Copy the index root value (it has been verified in read_inode). */
+	memcpy(ir, (u8*)ctx->attr +
+			le16_to_cpu(ctx->attr->data.resident.value_offset), rc);
+	put_attr_search_ctx(ctx);
+	unmap_mft_record(ndir);
+	ctx = NULL;
+	m = NULL;
 	index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
 	/* The first index entry. */
 	ie = (INDEX_ENTRY*)((u8*)&ir->index +
@@ -1154,7 +1174,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 	for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
 		ntfs_debug("In index root, offset 0x%x.", (u8*)ie - (u8*)ir);
 		/* Bounds checks. */
-		if (unlikely((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
+		if (unlikely((u8*)ie < (u8*)ir || (u8*)ie +
 				sizeof(INDEX_ENTRY_HEADER) > index_end ||
 				(u8*)ie + le16_to_cpu(ie->key_length) >
 				index_end))
@@ -1169,20 +1189,13 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 		rc = ntfs_filldir(vol, &fpos, ndir, INDEX_TYPE_ROOT, ir, ie,
 				name, dirent, filldir);
 		if (rc) {
-			put_attr_search_ctx(ctx);
-			unmap_mft_record(ndir);
+			kfree(ir);
 			goto abort;
 		}
 	}
-	/*
-	 * We are done with the index root and the mft record for that matter.
-	 * We need to release it, otherwise we deadlock on ntfs_attr_iget()
-	 * and/or ntfs_read_page().
-	 */
-	put_attr_search_ctx(ctx);
-	unmap_mft_record(ndir);
-	m = NULL;
-	ctx = NULL;
+	/* We are done with the index root and can free the buffer. */
+	kfree(ir);
+	ir = NULL;
 	/* If there is no index allocation attribute we are finished. */
 	if (!NInoIndexAllocPresent(ndir))
 		goto EOD;
@@ -1196,7 +1209,7 @@ skip_index_root:
 	ia_mapping = vdir->i_mapping;
 	bmp_vi = ndir->itype.index.bmp_ino;
 	if (unlikely(!bmp_vi)) {
-		ntfs_debug("Inode %lu, regetting index bitmap.", vdir->i_ino);
+		ntfs_debug("Inode 0x%lx, regetting index bitmap.", vdir->i_ino);
 		bmp_vi = ntfs_attr_iget(vdir, AT_BITMAP, I30, 4);
 		if (unlikely(IS_ERR(bmp_vi))) {
 			ntfs_error(sb, "Failed to get bitmap attribute.");
@@ -1379,6 +1392,8 @@ err_out:
 		ntfs_unmap_page(bmp_page);
 	if (ia_page)
 		ntfs_unmap_page(ia_page);
+	if (ir)
+		kfree(ir);
 	if (name)
 		kfree(name);
 	if (ctx)
diff --git a/fs/ntfs/dir.h b/fs/ntfs/dir.h
index 7b8ebee5d..90a8c3f65 100644
--- a/fs/ntfs/dir.h
+++ b/fs/ntfs/dir.h
@@ -2,20 +2,20 @@
  * dir.h - Defines for directory handling in NTFS Linux kernel driver. Part of
  *	   the Linux-NTFS project.
  *
- * Copyright (c) 2002 Anton Altaparmakov.
+ * Copyright (c) 2002-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -34,14 +34,13 @@ typedef struct {
 	MFT_REF mref;
 	FILE_NAME_TYPE_FLAGS type;
 	u8 len;
-	uchar_t name[0];
+	ntfschar name[0];
 } __attribute__ ((__packed__)) ntfs_name;
 
 /* The little endian Unicode string $I30 as a global constant. */
-extern uchar_t I30[5];
+extern ntfschar I30[5];
 
 extern MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni,
-		const uchar_t *uname, const int uname_len, ntfs_name **res);
+		const ntfschar *uname, const int uname_len, ntfs_name **res);
 
 #endif /* _LINUX_NTFS_FS_DIR_H */
-
diff --git a/fs/ntfs/endian.h b/fs/ntfs/endian.h
index 7a40cdd81..98909576a 100644
--- a/fs/ntfs/endian.h
+++ b/fs/ntfs/endian.h
@@ -2,20 +2,20 @@
  * endian.h - Defines for endianness handling in NTFS Linux kernel driver.
  *	      Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -45,4 +45,3 @@
 #define cpu_to_sle64p(x)	((s64)__cpu_to_le64(*(s64*)(x)))
 
 #endif /* _LINUX_NTFS_ENDIAN_H */
-
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 234be7280..f034d826d 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -1,20 +1,20 @@
 /*
  * file.c - NTFS kernel file operations. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -73,4 +73,3 @@ struct inode_operations ntfs_file_inode_ops = {
 struct file_operations ntfs_empty_file_ops = {};
 
 struct inode_operations ntfs_empty_inode_ops = {};
-
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index cb8c51959..1abe1b399 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -66,7 +66,7 @@ int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
 		if (ni->name_len != na->name_len)
 			return 0;
 		if (na->name_len && memcmp(ni->name, na->name,
-				na->name_len * sizeof(uchar_t)))
+				na->name_len * sizeof(ntfschar)))
 			return 0;
 	}
 	/* Match! */
@@ -121,8 +121,8 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
 	if (na->name && na->name_len && na->name != I30) {
 		unsigned int i;
 
-		i = na->name_len * sizeof(uchar_t);
-		ni->name = (uchar_t*)kmalloc(i + sizeof(uchar_t), GFP_ATOMIC);
+		i = na->name_len * sizeof(ntfschar);
+		ni->name = (ntfschar*)kmalloc(i + sizeof(ntfschar), GFP_ATOMIC);
 		if (!ni->name)
 			return -ENOMEM;
 		memcpy(ni->name, na->name, i);
@@ -206,7 +206,7 @@ struct inode *ntfs_iget(struct super_block *sb, unsigned long mft_no)
  * obtained from PTR_ERR().
  */
 struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
-		uchar_t *name, u32 name_len)
+		ntfschar *name, u32 name_len)
 {
 	struct inode *vi;
 	ntfs_attr na;
@@ -872,7 +872,7 @@ skip_large_dir_stuff:
 		/* Setup the operations for this inode. */
 		vi->i_op = &ntfs_dir_inode_ops;
 		vi->i_fop = &ntfs_dir_ops;
-		vi->i_mapping->a_ops = &ntfs_aops;
+		vi->i_mapping->a_ops = &ntfs_mst_aops;
 	} else {
 		/* It is a file. */
 		reinit_attr_search_ctx(ctx);
@@ -1249,7 +1249,10 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
 	/* Setup the operations for this attribute inode. */
 	vi->i_op = NULL;
 	vi->i_fop = NULL;
-	vi->i_mapping->a_ops = &ntfs_aops;
+	if (NInoMstProtected(ni))
+		vi->i_mapping->a_ops = &ntfs_mst_aops;
+	else
+		vi->i_mapping->a_ops = &ntfs_aops;
 
 	if (!NInoCompressed(ni))
 		vi->i_blocks = ni->allocated_size >> 9;
@@ -1310,7 +1313,7 @@ err_out:
  * This should work but there are two possible pit falls (see inline comments
  * below), but only time will tell if they are real pits or just smoke...
  */
-void ntfs_read_inode_mount(struct inode *vi)
+int ntfs_read_inode_mount(struct inode *vi)
 {
 	VCN next_vcn, last_vcn, highest_vcn;
 	s64 block;
@@ -1326,12 +1329,6 @@ void ntfs_read_inode_mount(struct inode *vi)
 
 	ntfs_debug("Entering.");
 
-	if (vi->i_ino != FILE_MFT) {
-		ntfs_error(sb, "Called for inode 0x%lx but only inode %d "
-				"allowed.", vi->i_ino, FILE_MFT);
-		goto err_out;
-	}
-
 	/* Initialize the ntfs specific part of @vi. */
 	ntfs_init_big_inode(vi);
 
@@ -1345,7 +1342,7 @@ void ntfs_read_inode_mount(struct inode *vi)
 	ni->name_len = 0;
 
 	/*
-	 * This sets up our little cheat allowing us to reuse the async io
+	 * This sets up our little cheat allowing us to reuse the async read io
 	 * completion handler for directories.
 	 */
 	ni->itype.index.block_size = vol->mft_record_size;
@@ -1616,13 +1613,7 @@ void ntfs_read_inode_mount(struct inode *vi)
 			/*
 			 * We have got the first extent of the run_list for
 			 * $MFT which means it is now relatively safe to call
-			 * the normal ntfs_read_inode() function. Thus, take
-			 * us out of the calling chain. Also we need to do this
-			 * now because we need ntfs_read_inode() in place to
-			 * get at subsequent extents.
-			 */
-			sb->s_op = &ntfs_sops;
-			/*
+			 * the normal ntfs_read_inode() function.
 			 * Complete reading the inode, this will actually
 			 * re-read the mft record for $MFT, this time entering
 			 * it into the page cache with which we complete the
@@ -1649,8 +1640,8 @@ void ntfs_read_inode_mount(struct inode *vi)
 						"sourceforge.net");
 				put_attr_search_ctx(ctx);
 				/* Revert to the safe super operations. */
-				sb->s_op = &ntfs_mount_sops;
-				goto out_now;
+				ntfs_free(m);
+				return -1;
 			}
 			/*
 			 * Re-initialize some specifics about $MFT's inode as
@@ -1699,32 +1690,19 @@ void ntfs_read_inode_mount(struct inode *vi)
 	}
 	put_attr_search_ctx(ctx);
 	ntfs_debug("Done.");
-out_now:
 	ntfs_free(m);
-	return;
+	return 0;
+
 em_put_err_out:
 	ntfs_error(sb, "Couldn't find first extent of $DATA attribute in "
 			"attribute list. $MFT is corrupt. Run chkdsk.");
 put_err_out:
 	put_attr_search_ctx(ctx);
 err_out:
-	/* Make sure we revert to the safe super operations. */
-	sb->s_op = &ntfs_mount_sops;
 	ntfs_error(sb, "Failed. Marking inode as bad.");
 	make_bad_inode(vi);
-	goto out_now;
-}
-
-/**
- * ntfs_commit_inode - write out a dirty inode
- * @ni:		inode to write out
- *
- */
-int ntfs_commit_inode(ntfs_inode *ni)
-{
-	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
-	NInoClearDirty(ni);
-	return 0;
+	ntfs_free(m);
+	return -1;
 }
 
 /**
@@ -1755,34 +1733,6 @@ void ntfs_put_inode(struct inode *vi)
 
 void __ntfs_clear_inode(ntfs_inode *ni)
 {
-	int err;
-
-	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
-	if (NInoDirty(ni)) {
-		err = ntfs_commit_inode(ni);
-		if (err) {
-			ntfs_error(ni->vol->sb, "Failed to commit dirty "
-					"inode synchronously.");
-			// FIXME: Do something!!!
-		}
-	}
-	/* Synchronize with ntfs_commit_inode(). */
-	down(&ni->mrec_lock);
-	up(&ni->mrec_lock);
-	if (NInoDirty(ni)) {
-		ntfs_error(ni->vol->sb, "Failed to commit dirty inode "
-				"asynchronously.");
-		// FIXME: Do something!!!
-	}
-	/* No need to lock at this stage as no one else has a reference. */
-	if (ni->nr_extents > 0) {
-		int i;
-
-		// FIXME: Handle dirty case for each extent inode!
-		for (i = 0; i < ni->nr_extents; i++)
-			ntfs_clear_extent_inode(ni->ext.extent_ntfs_inos[i]);
-		kfree(ni->ext.extent_ntfs_inos);
-	}
 	/* Free all alocated memory. */
 	down_write(&ni->run_list.lock);
 	if (ni->run_list.rl) {
@@ -1812,6 +1762,20 @@ void __ntfs_clear_inode(ntfs_inode *ni)
 
 void ntfs_clear_extent_inode(ntfs_inode *ni)
 {
+	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
+
+	BUG_ON(NInoAttr(ni));
+	BUG_ON(ni->nr_extents != -1);
+
+#ifdef NTFS_RW
+	if (NInoDirty(ni)) {
+		if (!is_bad_inode(VFS_I(ni->ext.base_ntfs_ino)))
+			ntfs_error(ni->vol->sb, "Clearing dirty extent inode!  "
+					"Losing data!  This is a BUG!!!");
+		// FIXME:  Do something!!!
+	}
+#endif /* NTFS_RW */
+
 	__ntfs_clear_inode(ni);
 
 	/* Bye, bye... */
@@ -1832,6 +1796,30 @@ void ntfs_clear_big_inode(struct inode *vi)
 {
 	ntfs_inode *ni = NTFS_I(vi);
 
+#ifdef NTFS_RW
+	if (NInoDirty(ni)) {
+		BOOL was_bad = (is_bad_inode(vi));
+
+		/* Committing the inode also commits all extent inodes. */
+		ntfs_commit_inode(vi);
+
+		if (!was_bad && (is_bad_inode(vi) || NInoDirty(ni))) {
+			ntfs_error(vi->i_sb, "Failed to commit dirty inode "
+					"0x%lx.  Losing data!", vi->i_ino);
+			// FIXME:  Do something!!!
+		}
+	}
+#endif /* NTFS_RW */
+
+	/* No need to lock at this stage as no one else has a reference. */
+	if (ni->nr_extents > 0) {
+		int i;
+
+		for (i = 0; i < ni->nr_extents; i++)
+			ntfs_clear_extent_inode(ni->ext.extent_ntfs_inos[i]);
+		kfree(ni->ext.extent_ntfs_inos);
+	}
+
 	__ntfs_clear_inode(ni);
 
 	if (NInoAttr(ni)) {
@@ -1972,4 +1960,134 @@ trunc_err:
 	return err;
 }
 
+/**
+ * ntfs_write_inode - write out a dirty inode
+ * @vi:		inode to write out
+ * @sync:	if true, write out synchronously
+ *
+ * Write out a dirty inode to disk including any extent inodes if present.
+ *
+ * If @sync is true, commit the inode to disk and wait for io completion.  This
+ * is done using write_mft_record().
+ *
+ * If @sync is false, just schedule the write to happen but do not wait for i/o
+ * completion.  In 2.6 kernels, scheduling usually happens just by virtue of
+ * marking the page (and in this case mft record) dirty but we do not implement
+ * this yet as write_mft_record() largely ignores the @sync parameter and
+ * always performs synchronous writes.
+ */
+void ntfs_write_inode(struct inode *vi, int sync)
+{
+	ntfs_inode *ni = NTFS_I(vi);
+#if 0
+	attr_search_context *ctx;
 #endif
+	MFT_RECORD *m;
+	int err = 0;
+
+	ntfs_debug("Entering for %sinode 0x%lx.", NInoAttr(ni) ? "attr " : "",
+			vi->i_ino);
+	/*
+	 * Dirty attribute inodes are written via their real inodes so just
+	 * clean them here.  TODO:  Take care of access time updates.
+	 */
+	if (NInoAttr(ni)) {
+		NInoClearDirty(ni);
+		return;
+	}
+	/* Map, pin, and lock the mft record belonging to the inode. */
+	m = map_mft_record(ni);
+	if (unlikely(IS_ERR(m))) {
+		err = PTR_ERR(m);
+		goto err_out;
+	}
+#if 0
+	/* Obtain the standard information attribute. */
+	ctx = get_attr_search_ctx(ni, m);
+	if (unlikely(!ctx)) {
+		err = -ENOMEM;
+		goto unm_err_out;
+	}
+	if (unlikely(!lookup_attr(AT_STANDARD_INFORMATION, NULL, 0,
+			IGNORE_CASE, 0, NULL, 0, ctx))) {
+		put_attr_search_ctx(ctx);
+		err = -ENOENT;
+		goto unm_err_out;
+	}
+	// TODO:  Update the access times in the standard information attribute
+	// which is now in ctx->attr.
+	// - Probably want to have use sops->dirty_inode() to set a flag that
+	//   we need to update the times here rather than having to blindly do
+	//   it every time.  Or even don't do it here at all and do it in
+	//   sops->dirty_inode() instead.  Problem with this would be that
+	//   sops->dirty_inode() must be atomic under certain circumstances
+	//   and mapping mft records and such like is not atomic.
+	// - For atime updates also need to check whether they are enabled in
+	//   the superblock flags.
+	ntfs_warning(vi->i_sb, "Access time updates not implement yet.");
+	/*
+	 * We just modified the mft record containing the standard information
+	 * attribute.  So need to mark the mft record dirty, too, but we do it
+	 * manually so that mark_inode_dirty() is not called again.
+	 * TODO:  Only do this if there was a change in any of the times!
+	 */
+	if (!NInoTestSetDirty(ctx->ntfs_ino))
+		__set_page_dirty_nobuffers(ctx->ntfs_ino->page);
+	put_attr_search_ctx(ctx);
+#endif
+	/* Write this base mft record. */
+	if (NInoDirty(ni))
+		err = write_mft_record(ni, m, sync);
+	/* Write all attached extent mft records. */
+	down(&ni->extent_lock);
+	if (ni->nr_extents > 0) {
+		ntfs_inode **extent_nis = ni->ext.extent_ntfs_inos;
+		int i;
+
+		ntfs_debug("Writing %i extent inodes.", ni->nr_extents);
+		for (i = 0; i < ni->nr_extents; i++) {
+			ntfs_inode *tni = extent_nis[i];
+
+			if (NInoDirty(tni)) {
+				MFT_RECORD *tm = map_mft_record(tni);
+				int ret;
+
+				if (unlikely(IS_ERR(tm))) {
+					if (!err || err == -ENOMEM)
+						err = PTR_ERR(tm);
+					continue;
+				}
+				ret = write_mft_record(tni, tm, sync);
+				unmap_mft_record(tni);
+				if (unlikely(ret)) {
+					if (!err || err == -ENOMEM)
+						err = ret;
+				}
+			}
+		}
+	}
+	up(&ni->extent_lock);
+	unmap_mft_record(ni);
+	if (unlikely(err))
+		goto err_out;
+	ntfs_debug("Done.");
+	return;
+#if 0
+unm_err_out:
+	unmap_mft_record(ni);
+#endif
+err_out:
+	if (err == -ENOMEM) {
+		ntfs_warning(vi->i_sb, "Not enough memory to write inode.  "
+				"Marking the inode dirty again, so the VFS "
+				"retries later.");
+		mark_inode_dirty(vi);
+	} else {
+		ntfs_error(vi->i_sb, "Failed (error code %i):  Marking inode "
+				"as bad.  You should run chkdsk.", -err);
+		make_bad_inode(vi);
+	}
+	return;
+}
+
+#endif /* NTFS_RW */
diff --git a/fs/ntfs/inode.h b/fs/ntfs/inode.h
index 31d522034..59af63e6c 100644
--- a/fs/ntfs/inode.h
+++ b/fs/ntfs/inode.h
@@ -54,7 +54,7 @@ struct _ntfs_inode {
 	 * name_len = 4 for directories.
 	 */
 	ATTR_TYPES type;	/* Attribute type of this fake inode. */
-	uchar_t *name;		/* Attribute name of this fake inode. */
+	ntfschar *name;		/* Attribute name of this fake inode. */
 	u32 name_len;		/* Attribute name length of this fake inode. */
 	run_list run_list;	/* If state has the NI_NonResident bit set,
 				   the run list of the unnamed data attribute
@@ -248,7 +248,7 @@ static inline struct inode *VFS_I(ntfs_inode *ni)
  */
 typedef struct {
 	unsigned long mft_no;
-	uchar_t *name;
+	ntfschar *name;
 	u32 name_len;
 	ATTR_TYPES type;
 } ntfs_attr;
@@ -259,7 +259,7 @@ extern int ntfs_test_inode(struct inode *vi, ntfs_attr *na);
 
 extern struct inode *ntfs_iget(struct super_block *sb, unsigned long mft_no);
 extern struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
-		uchar_t *name, u32 name_len);
+		ntfschar *name, u32 name_len);
 
 extern struct inode *ntfs_alloc_big_inode(struct super_block *sb);
 extern void ntfs_destroy_big_inode(struct inode *inode);
@@ -269,7 +269,7 @@ extern ntfs_inode *ntfs_new_extent_inode(struct super_block *sb,
 		unsigned long mft_no);
 extern void ntfs_clear_extent_inode(ntfs_inode *ni);
 
-extern void ntfs_read_inode_mount(struct inode *vi);
+extern int ntfs_read_inode_mount(struct inode *vi);
 
 extern void ntfs_put_inode(struct inode *vi);
 
@@ -281,6 +281,15 @@ extern void ntfs_truncate(struct inode *vi);
 
 extern int ntfs_setattr(struct dentry *dentry, struct iattr *attr);
 
+extern void ntfs_write_inode(struct inode *vi, int sync);
+
+static inline void ntfs_commit_inode(struct inode *vi)
+{
+	if (!is_bad_inode(vi))
+		ntfs_write_inode(vi, 1);
+	return;
+}
+
 #endif /* NTFS_RW */
 
 #endif /* _LINUX_NTFS_INODE_H */
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h
index 052610ac6..bad68c2f5 100644
--- a/fs/ntfs/layout.h
+++ b/fs/ntfs/layout.h
@@ -504,7 +504,7 @@ typedef enum {
  */
 typedef struct {
 /*hex ofs*/
-/*  0*/	uchar_t name[0x40];		/* Unicode name of the attribute. Zero
+/*  0*/	ntfschar name[0x40];		/* Unicode name of the attribute. Zero
 					   terminated. */
 /* 80*/	ATTR_TYPES type;		/* Type of the attribute. */
 /* 84*/	u32 display_rule;		/* Default display rule.
@@ -910,7 +910,7 @@ typedef struct {
 				   attribute value. */
 /* 24*/	u16 instance;		/* If lowest_vcn = 0, the instance of the
 				   attribute being referenced; otherwise 0. */
-/* 26*/	uchar_t name[0];	/* Use when creating only. When reading use
+/* 26*/	ntfschar name[0];	/* Use when creating only. When reading use
 				   name_offset to determine the location of the
 				   name. */
 /* sizeof() = 26 + (attribute_name_length * 2) bytes */
@@ -994,7 +994,7 @@ typedef struct {
 /* 40*/	u8 file_name_length;			/* Length of file name in
 						   (Unicode) characters. */
 /* 41*/	FILE_NAME_TYPE_FLAGS file_name_type;	/* Namespace of the file name.*/
-/* 42*/	uchar_t file_name[0];			/* File name in Unicode. */
+/* 42*/	ntfschar file_name[0];			/* File name in Unicode. */
 } __attribute__ ((__packed__)) FILE_NAME_ATTR;
 
 /*
@@ -1090,7 +1090,7 @@ typedef enum {					/* Identifier authority. */
 	SECURITY_NULL_RID		  = 0,	/* S-1-0 */
 	SECURITY_WORLD_RID		  = 0,	/* S-1-1 */
 	SECURITY_LOCAL_RID		  = 0,	/* S-1-2 */
-	
+
 	SECURITY_CREATOR_OWNER_RID	  = 0,	/* S-1-3 */
 	SECURITY_CREATOR_GROUP_RID	  = 1,	/* S-1-3 */
 
@@ -1110,10 +1110,10 @@ typedef enum {					/* Identifier authority. */
 	SECURITY_AUTHENTICATED_USER_RID	  = 0xb,
 	SECURITY_RESTRICTED_CODE_RID	  = 0xc,
 	SECURITY_TERMINAL_SERVER_RID	  = 0xd,
-	
+
 	SECURITY_LOGON_IDS_RID		  = 5,
 	SECURITY_LOGON_IDS_RID_COUNT	  = 3,
-	
+
 	SECURITY_LOCAL_SYSTEM_RID	  = 0x12,
 
 	SECURITY_NT_NON_UNIQUE		  = 0x15,
@@ -1123,12 +1123,12 @@ typedef enum {					/* Identifier authority. */
 	/*
 	 * Well-known domain relative sub-authority values (RIDs).
 	 */
-	
+
 	/* Users. */
 	DOMAIN_USER_RID_ADMIN		  = 0x1f4,
 	DOMAIN_USER_RID_GUEST		  = 0x1f5,
 	DOMAIN_USER_RID_KRBTGT		  = 0x1f6,
-	
+
 	/* Groups. */
 	DOMAIN_GROUP_RID_ADMINS		  = 0x200,
 	DOMAIN_GROUP_RID_USERS		  = 0x201,
@@ -1145,12 +1145,12 @@ typedef enum {					/* Identifier authority. */
 	DOMAIN_ALIAS_RID_USERS		  = 0x221,
 	DOMAIN_ALIAS_RID_GUESTS		  = 0x222,
 	DOMAIN_ALIAS_RID_POWER_USERS	  = 0x223,
-	
+
 	DOMAIN_ALIAS_RID_ACCOUNT_OPS	  = 0x224,
 	DOMAIN_ALIAS_RID_SYSTEM_OPS	  = 0x225,
 	DOMAIN_ALIAS_RID_PRINT_OPS	  = 0x226,
 	DOMAIN_ALIAS_RID_BACKUP_OPS	  = 0x227,
-	
+
 	DOMAIN_ALIAS_RID_REPLICATOR	  = 0x228,
 	DOMAIN_ALIAS_RID_RAS_SERVERS	  = 0x229,
 	DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = 0x22a,
@@ -1258,7 +1258,7 @@ typedef enum {
 
 	ACCESS_ALLOWED_COMPOUND_ACE_TYPE= 4,
 	ACCESS_MAX_MS_V3_ACE_TYPE	= 4,
-	
+
 	/* The following are Win2k only. */
 	ACCESS_MIN_MS_OBJECT_ACE_TYPE	= 5,
 	ACCESS_ALLOWED_OBJECT_ACE_TYPE	= 5,
@@ -1325,33 +1325,33 @@ typedef enum {
 	 */
 
 	/* Specific rights for files and directories are as follows: */
-	
+
 	/* Right to read data from the file. (FILE) */
 	FILE_READ_DATA			= const_cpu_to_le32(0x00000001),
 	/* Right to list contents of a directory. (DIRECTORY) */
 	FILE_LIST_DIRECTORY		= const_cpu_to_le32(0x00000001),
-	
+
 	/* Right to write data to the file. (FILE) */
 	FILE_WRITE_DATA			= const_cpu_to_le32(0x00000002),
 	/* Right to create a file in the directory. (DIRECTORY) */
 	FILE_ADD_FILE			= const_cpu_to_le32(0x00000002),
-	
+
 	/* Right to append data to the file. (FILE) */
 	FILE_APPEND_DATA		= const_cpu_to_le32(0x00000004),
 	/* Right to create a subdirectory. (DIRECTORY) */
 	FILE_ADD_SUBDIRECTORY		= const_cpu_to_le32(0x00000004),
-	
+
 	/* Right to read extended attributes. (FILE/DIRECTORY) */
 	FILE_READ_EA			= const_cpu_to_le32(0x00000008),
-	
+
 	/* Right to write extended attributes. (FILE/DIRECTORY) */
 	FILE_WRITE_EA			= const_cpu_to_le32(0x00000010),
-	
+
 	/* Right to execute a file. (FILE) */
 	FILE_EXECUTE			= const_cpu_to_le32(0x00000020),
 	/* Right to traverse the directory. (DIRECTORY) */
 	FILE_TRAVERSE			= const_cpu_to_le32(0x00000020),
-	
+
 	/*
 	 * Right to delete a directory and all the files it contains (its
 	 * children), even if the files are read-only. (DIRECTORY)
@@ -1360,10 +1360,10 @@ typedef enum {
 
 	/* Right to read file attributes. (FILE/DIRECTORY) */
 	FILE_READ_ATTRIBUTES		= const_cpu_to_le32(0x00000080),
-	
+
 	/* Right to change file attributes. (FILE/DIRECTORY) */
 	FILE_WRITE_ATTRIBUTES		= const_cpu_to_le32(0x00000100),
-	
+
 	/*
 	 * The standard rights (bits 16 to 23). Are independent of the type of
 	 * object being secured.
@@ -1396,15 +1396,15 @@ typedef enum {
 	 * The following STANDARD_RIGHTS_* are combinations of the above for
 	 * convenience and are defined by the Win32 API.
 	 */
-	
+
 	/* These are currently defined to READ_CONTROL. */
 	STANDARD_RIGHTS_READ		= const_cpu_to_le32(0x00020000),
 	STANDARD_RIGHTS_WRITE		= const_cpu_to_le32(0x00020000),
 	STANDARD_RIGHTS_EXECUTE		= const_cpu_to_le32(0x00020000),
-	
+
 	/* Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access. */
 	STANDARD_RIGHTS_REQUIRED	= const_cpu_to_le32(0x000f0000),
-	
+
 	/*
 	 * Combines DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, and
 	 * SYNCHRONIZE access.
@@ -1775,7 +1775,7 @@ typedef struct {
  * NOTE: Present only in FILE_Volume.
  */
 typedef struct {
-	uchar_t name[0];		/* The name of the volume in Unicode. */
+	ntfschar name[0];	/* The name of the volume in Unicode. */
 } __attribute__ ((__packed__)) VOLUME_NAME;
 
 /*
@@ -1790,6 +1790,9 @@ typedef enum {
 	VOLUME_REPAIR_OBJECT_ID		= const_cpu_to_le16(0x0020),
 	VOLUME_MODIFIED_BY_CHKDSK	= const_cpu_to_le16(0x8000),
 	VOLUME_FLAGS_MASK		= const_cpu_to_le16(0x803f),
+
+	/* To make our life easier when checking if we must mount read-only. */
+	VOLUME_MUST_MOUNT_RO_MASK	= const_cpu_to_le16(0x8037),
 } __attribute__ ((__packed__)) VOLUME_FLAGS;
 
 /*
@@ -1973,7 +1976,7 @@ typedef enum {
 
 	QUOTA_FLAG_USER_MASK		= const_cpu_to_le32(0x00000007),
 		/* Bit mask for user quota flags. */
-	
+
 	/* These flags are only present in the quota defaults index entry,
 	   i.e. in the entry where owner_id = QUOTA_DEFAULTS_ID. */
 	QUOTA_FLAG_TRACKING_ENABLED	= const_cpu_to_le32(0x00000010),
@@ -2177,7 +2180,7 @@ typedef enum {
 	IO_REPARSE_TAG_IS_ALIAS		= const_cpu_to_le32(0x20000000),
 	IO_REPARSE_TAG_IS_HIGH_LATENCY	= const_cpu_to_le32(0x40000000),
 	IO_REPARSE_TAG_IS_MICROSOFT	= const_cpu_to_le32(0x80000000),
-	
+
 	IO_REPARSE_TAG_RESERVED_ZERO	= const_cpu_to_le32(0x00000000),
 	IO_REPARSE_TAG_RESERVED_ONE	= const_cpu_to_le32(0x00000001),
 	IO_REPARSE_TAG_RESERVED_RANGE	= const_cpu_to_le32(0x00000001),
@@ -2280,4 +2283,3 @@ typedef struct {
 } __attribute__ ((__packed__)) LOGGED_UTILITY_STREAM, EFS_ATTR;
 
 #endif /* _LINUX_NTFS_LAYOUT_H */
-
diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index 6b9547c75..a34a2e165 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -1,7 +1,7 @@
 /*
  * logfile.c - NTFS kernel journal handling. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2002-2004 Anton Altaparmakov.
+ * Copyright (c) 2002-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -25,6 +25,7 @@
 #include <linux/fs.h>
 #include <linux/highmem.h>
 #include <linux/buffer_head.h>
+#include <linux/bitops.h>
 
 #include "logfile.h"
 #include "volume.h"
@@ -455,7 +456,11 @@ BOOL ntfs_check_logfile(struct inode *log_vi)
 	else
 		log_page_size = PAGE_CACHE_SIZE;
 	log_page_mask = log_page_size - 1;
-	log_page_bits = ffs(log_page_size) - 1;
+	/*
+	 * Use generic_ffs() instead of ffs() to enable the compiler to
+	 * optimize log_page_size and log_page_bits into constants.
+	 */
+	log_page_bits = generic_ffs(log_page_size) - 1;
 	size &= ~(log_page_size - 1);
 	/*
 	 * Ensure the log file is big enough to store at least the two restart
diff --git a/fs/ntfs/logfile.h b/fs/ntfs/logfile.h
index abfe51242..e5e003a90 100644
--- a/fs/ntfs/logfile.h
+++ b/fs/ntfs/logfile.h
@@ -288,7 +288,7 @@ typedef struct {
 /* 22*/	u8 reserved[6];		/* Reserved/alignment. */
 /* 28*/	u32 client_name_length; /* Length of client name in bytes.  Should
 				   always be 8. */
-/* 32*/	uchar_t client_name[64];/* Name of the client in Unicode.  Should
+/* 32*/	ntfschar client_name[64];/* Name of the client in Unicode.  Should
 				   always be "NTFS" with the remaining bytes
 				   set to 0. */
 /* sizeof() = 160 (0xa0) bytes */
diff --git a/fs/ntfs/malloc.h b/fs/ntfs/malloc.h
index af1a1cbfe..c921960bf 100644
--- a/fs/ntfs/malloc.h
+++ b/fs/ntfs/malloc.h
@@ -1,7 +1,7 @@
 /*
  * malloc.h - NTFS kernel memory handling. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index ed793fbc5..8875af935 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -1,7 +1,7 @@
 /**
  * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  * Copyright (c) 2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
@@ -9,13 +9,13 @@
  * by the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -102,6 +102,13 @@ int format_mft_record(ntfs_inode *ni, MFT_RECORD *mft_rec)
  */
 extern int ntfs_readpage(struct file *, struct page *);
 
+#ifdef NTFS_RW
+/**
+ * ntfs_mft_writepage - forward declaration, function is further below
+ */
+static int ntfs_mft_writepage(struct page *page, struct writeback_control *wbc);
+#endif /* NTFS_RW */
+
 /**
  * ntfs_mft_aops - address space operations for access to $MFT
  *
@@ -112,6 +119,10 @@ struct address_space_operations ntfs_mft_aops = {
 	.readpage	= ntfs_readpage,	/* Fill page with data. */
 	.sync_page	= block_sync_page,	/* Currently, just unplugs the
 						   disk request queue. */
+#ifdef NTFS_RW
+	.writepage	= ntfs_mft_writepage,	/* Write out the dirty mft
+						   records in a page. */
+#endif /* NTFS_RW */
 };
 
 /**
@@ -430,3 +441,653 @@ unm_err_out:
 	return m;
 }
 
+#ifdef NTFS_RW
+
+/**
+ * __mark_mft_record_dirty - set the mft record and the page containing it dirty
+ * @ni:		ntfs inode describing the mapped mft record
+ *
+ * Internal function.  Users should call mark_mft_record_dirty() instead.
+ *
+ * Set the mapped (extent) mft record of the (base or extent) ntfs inode @ni,
+ * as well as the page containing the mft record, dirty.  Also, mark the base
+ * vfs inode dirty.  This ensures that any changes to the mft record are
+ * written out to disk.
+ *
+ * NOTE:  We only set I_DIRTY_SYNC and I_DIRTY_DATASYNC (and not I_DIRTY_PAGES)
+ * on the base vfs inode, because even though file data may have been modified,
+ * it is dirty in the inode meta data rather than the data page cache of the
+ * inode, and thus there are no data pages that need writing out.  Therefore, a
+ * full mark_inode_dirty() is overkill.  A mark_inode_dirty_sync(), on the
+ * other hand, is not sufficient, because I_DIRTY_DATASYNC needs to be set to
+ * ensure ->write_inode is called from generic_osync_inode() and this needs to
+ * happen or the file data would not necessarily hit the device synchronously,
+ * even though the vfs inode has the O_SYNC flag set.  Also, I_DIRTY_DATASYNC
+ * simply "feels" better than just I_DIRTY_SYNC, since the file data has not
+ * actually hit the block device yet, which is not what I_DIRTY_SYNC on its own
+ * would suggest.
+ */
+void __mark_mft_record_dirty(ntfs_inode *ni)
+{
+	struct page *page = ni->page;
+	ntfs_inode *base_ni;
+
+	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
+	BUG_ON(!page);
+	BUG_ON(NInoAttr(ni));
+
+	/*
+	 * Set the page containing the mft record dirty.  This also marks the
+	 * $MFT inode dirty (I_DIRTY_PAGES).
+	 */
+	__set_page_dirty_nobuffers(page);
+
+	/* Determine the base vfs inode and mark it dirty, too. */
+	down(&ni->extent_lock);
+	if (likely(ni->nr_extents >= 0))
+		base_ni = ni;
+	else
+		base_ni = ni->ext.base_ntfs_ino;
+	up(&ni->extent_lock);
+	__mark_inode_dirty(VFS_I(base_ni), I_DIRTY_SYNC | I_DIRTY_DATASYNC);
+}
+
+static const char *ntfs_please_email = "Please email "
+		"linux-ntfs-dev@lists.sourceforge.net and say that you saw "
+		"this message.  Thank you.";
+
+/**
+ * sync_mft_mirror_umount - synchronise an mft record to the mft mirror
+ * @ni:		ntfs inode whose mft record to synchronize
+ * @m:		mapped, mst protected (extent) mft record to synchronize
+ *
+ * Write the mapped, mst protected (extent) mft record @m described by the
+ * (regular or extent) ntfs inode @ni to the mft mirror ($MFTMirr) bypassing
+ * the page cache and the $MFTMirr inode itself.
+ *
+ * This function is only for use at umount time when the mft mirror inode has
+ * already been disposed off.  We BUG() if we are called while the mft mirror
+ * inode is still attached to the volume.
+ *
+ * On success return 0.  On error return -errno.
+ *
+ * NOTE:  This function is not implemented yet as I am not convinced it can
+ * actually be triggered considering the sequence of commits we do in super.c::
+ * ntfs_put_super().  But just in case we provide this place holder as the
+ * alternative would be either to BUG() or to get a NULL pointer dereference
+ * and Oops.
+ */
+static int sync_mft_mirror_umount(ntfs_inode *ni, MFT_RECORD *m)
+{
+	ntfs_volume *vol = ni->vol;
+
+	BUG_ON(vol->mftmirr_ino);
+	ntfs_error(vol->sb, "Umount time mft mirror syncing is not "
+			"implemented yet.  %s", ntfs_please_email);
+	return -EOPNOTSUPP;
+}
+
+/**
+ * sync_mft_mirror - synchronize an mft record to the mft mirror
+ * @ni:		ntfs inode whose mft record to synchronize
+ * @m:		mapped, mst protected (extent) mft record to synchronize
+ * @sync:	if true, wait for i/o completion
+ *
+ * Write the mapped, mst protected (extent) mft record @m described by the
+ * (regular or extent) ntfs inode @ni to the mft mirror ($MFTMirr).
+ *
+ * On success return 0.  On error return -errno and set the volume errors flag
+ * in the ntfs_volume to which @ni belongs.
+ *
+ * NOTE:  We always perform synchronous i/o and ignore the @sync parameter.
+ *
+ * TODO:  If @sync is false, want to do truly asynchronous i/o, i.e. just
+ * schedule i/o via ->writepage or do it via kntfsd or whatever.
+ */
+static int sync_mft_mirror(ntfs_inode *ni, MFT_RECORD *m, int sync)
+{
+	ntfs_volume *vol = ni->vol;
+	struct page *page;
+	unsigned int blocksize = vol->sb->s_blocksize;
+	int max_bhs = vol->mft_record_size / blocksize;
+	struct buffer_head *bhs[max_bhs];
+	struct buffer_head *bh, *head;
+	u8 *kmirr;
+	unsigned int block_start, block_end, m_start, m_end;
+	int i_bhs, nr_bhs, err = 0;
+
+	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
+	BUG_ON(!max_bhs);
+	if (unlikely(!vol->mftmirr_ino)) {
+		/* This could happen during umount... */
+		err = sync_mft_mirror_umount(ni, m);
+		if (likely(!err))
+			return err;
+		goto err_out;
+	}
+	/* Get the page containing the mirror copy of the mft record @m. */
+	page = ntfs_map_page(vol->mftmirr_ino->i_mapping, ni->mft_no >>
+			(PAGE_CACHE_SHIFT - vol->mft_record_size_bits));
+	if (unlikely(IS_ERR(page))) {
+		ntfs_error(vol->sb, "Failed to map mft mirror page.");
+		err = PTR_ERR(page);
+		goto err_out;
+	}
+	/*
+	 * Exclusion against other writers.   This should never be a problem
+	 * since the page in which the mft record @m resides is also locked and
+	 * hence any other writers would be held up there but it is better to
+	 * make sure no one is writing from elsewhere.
+	 */
+	lock_page(page);
+	/* The address in the page of the mirror copy of the mft record @m. */
+	kmirr = page_address(page) + ((ni->mft_no << vol->mft_record_size_bits)
+			& ~PAGE_CACHE_MASK);
+	/* Copy the mst protected mft record to the mirror. */
+	memcpy(kmirr, m, vol->mft_record_size);
+	/* Make sure we have mapped buffers. */
+	if (!page_has_buffers(page)) {
+no_buffers_err_out:
+		ntfs_error(vol->sb, "Writing mft mirror records without "
+				"existing buffers is not implemented yet.  %s",
+				ntfs_please_email);
+		err = -EOPNOTSUPP;
+		goto unlock_err_out;
+	}
+	bh = head = page_buffers(page);
+	if (!bh)
+		goto no_buffers_err_out;
+	nr_bhs = 0;
+	block_start = 0;
+	m_start = kmirr - (u8*)page_address(page);
+	m_end = m_start + vol->mft_record_size;
+	do {
+		block_end = block_start + blocksize;
+		/*
+		 * If the buffer is outside the mft record, just skip it,
+		 * clearing it if it is dirty to make sure it is not written
+		 * out.  It should never be marked dirty but better be safe.
+		 */
+		if ((block_end <= m_start) || (block_start >= m_end)) {
+			if (buffer_dirty(bh)) {
+				ntfs_warning(vol->sb, "Clearing dirty mft "
+						"record page buffer.  %s",
+						ntfs_please_email);
+				clear_buffer_dirty(bh);
+			}
+			continue;
+		}
+		if (!buffer_mapped(bh)) {
+			ntfs_error(vol->sb, "Writing mft mirror records "
+					"without existing mapped buffers is "
+					"not implemented yet.  %s",
+					ntfs_please_email);
+			err = -EOPNOTSUPP;
+			continue;
+		}
+		if (!buffer_uptodate(bh)) {
+			ntfs_error(vol->sb, "Writing mft mirror records "
+					"without existing uptodate buffers is "
+					"not implemented yet.  %s",
+					ntfs_please_email);
+			err = -EOPNOTSUPP;
+			continue;
+		}
+		BUG_ON(!nr_bhs && (m_start != block_start));
+		BUG_ON(nr_bhs >= max_bhs);
+		bhs[nr_bhs++] = bh;
+		BUG_ON((nr_bhs >= max_bhs) && (m_end != block_end));
+	} while (block_start = block_end, (bh = bh->b_this_page) != head);
+	if (likely(!err)) {
+		/* Lock buffers and start synchronous write i/o on them. */
+		for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) {
+			struct buffer_head *tbh = bhs[i_bhs];
+
+			if (unlikely(test_set_buffer_locked(tbh)))
+				BUG();
+			BUG_ON(!buffer_uptodate(tbh));
+			if (buffer_dirty(tbh))
+				clear_buffer_dirty(tbh);
+			get_bh(tbh);
+			tbh->b_end_io = end_buffer_write_sync;
+			submit_bh(WRITE, tbh);
+		}
+		/* Wait on i/o completion of buffers. */
+		for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) {
+			struct buffer_head *tbh = bhs[i_bhs];
+
+			wait_on_buffer(tbh);
+			if (unlikely(!buffer_uptodate(tbh))) {
+				err = -EIO;
+				/*
+				 * Set the buffer uptodate so the page & buffer
+				 * states don't become out of sync.
+				 */
+				if (PageUptodate(page))
+					set_buffer_uptodate(tbh);
+			}
+		}
+	} else /* if (unlikely(err)) */ {
+		/* Clean the buffers. */
+		for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++)
+			clear_buffer_dirty(bhs[i_bhs]);
+	}
+unlock_err_out:
+	/* Current state: all buffers are clean, unlocked, and uptodate. */
+	/* Remove the mst protection fixups again. */
+	post_write_mst_fixup((NTFS_RECORD*)kmirr);
+	flush_dcache_page(page);
+	unlock_page(page);
+	ntfs_unmap_page(page);
+	if (unlikely(err)) {
+		/* I/O error during writing.  This is really bad! */
+		ntfs_error(vol->sb, "I/O error while writing mft mirror "
+				"record 0x%lx!  You should unmount the volume "
+				"and run chkdsk or ntfsfix.", ni->mft_no);
+		goto err_out;
+	}
+	ntfs_debug("Done.");
+	return 0;
+err_out:
+	ntfs_error(vol->sb, "Failed to synchronize $MFTMirr (error code %i).  "
+			"Volume will be left marked dirty on umount.  Run "
+			"ntfsfix on the partition after umounting to correct "
+			"this.", -err);
+	/* We don't want to clear the dirty bit on umount. */
+	NVolSetErrors(vol);
+	return err;
+}
+
+/**
+ * write_mft_record_nolock - write out a mapped (extent) mft record
+ * @ni:		ntfs inode describing the mapped (extent) mft record
+ * @m:		mapped (extent) mft record to write
+ * @sync:	if true, wait for i/o completion
+ *
+ * Write the mapped (extent) mft record @m described by the (regular or extent)
+ * ntfs inode @ni to backing store.  If the mft record @m has a counterpart in
+ * the mft mirror, that is also updated.
+ *
+ * On success, clean the mft record and return 0.  On error, leave the mft
+ * record dirty and return -errno.  The caller should call make_bad_inode() on
+ * the base inode to ensure no more access happens to this inode.  We do not do
+ * it here as the caller may want to finish writing other extent mft records
+ * first to minimize on-disk metadata inconsistencies.
+ *
+ * NOTE:  We always perform synchronous i/o and ignore the @sync parameter.
+ * However, if the mft record has a counterpart in the mft mirror and @sync is
+ * true, we write the mft record, wait for i/o completion, and only then write
+ * the mft mirror copy.  This ensures that if the system crashes either the mft
+ * or the mft mirror will contain a self-consistent mft record @m.  If @sync is
+ * false on the other hand, we start i/o on both and then wait for completion
+ * on them.  This provides a speedup but no longer guarantees that you will end
+ * up with a self-consistent mft record in the case of a crash but if you asked
+ * for asynchronous writing you probably do not care about that anyway.
+ *
+ * TODO:  If @sync is false, want to do truly asynchronous i/o, i.e. just
+ * schedule i/o via ->writepage or do it via kntfsd or whatever.
+ */
+int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync)
+{
+	ntfs_volume *vol = ni->vol;
+	struct page *page = ni->page;
+	unsigned int blocksize = vol->sb->s_blocksize;
+	int max_bhs = vol->mft_record_size / blocksize;
+	struct buffer_head *bhs[max_bhs];
+	struct buffer_head *bh, *head;
+	unsigned int block_start, block_end, m_start, m_end;
+	int i_bhs, nr_bhs, err = 0;
+
+	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
+	BUG_ON(NInoAttr(ni));
+	BUG_ON(!max_bhs);
+	BUG_ON(!page);
+	BUG_ON(!PageLocked(page));
+	/*
+	 * If the ntfs_inode is clean no need to do anything.  If it is dirty,
+	 * mark it as clean now so that it can be redirtied later on if needed.
+	 * There is no danger of races as as long as the caller is holding the
+	 * locks for the mft record @m and the page it is in.
+	 */
+	if (!NInoTestClearDirty(ni))
+		goto done;
+	/* Make sure we have mapped buffers. */
+	if (!page_has_buffers(page)) {
+no_buffers_err_out:
+		ntfs_error(vol->sb, "Writing mft records without existing "
+				"buffers is not implemented yet.  %s",
+				ntfs_please_email);
+		err = -EOPNOTSUPP;
+		goto err_out;
+	}
+	bh = head = page_buffers(page);
+	if (!bh)
+		goto no_buffers_err_out;
+	nr_bhs = 0;
+	block_start = 0;
+	m_start = ni->page_ofs;
+	m_end = m_start + vol->mft_record_size;
+	do {
+		block_end = block_start + blocksize;
+		/*
+		 * If the buffer is outside the mft record, just skip it,
+		 * clearing it if it is dirty to make sure it is not written
+		 * out.  It should never be marked dirty but better be safe.
+		 */
+		if ((block_end <= m_start) || (block_start >= m_end)) {
+			if (buffer_dirty(bh)) {
+				ntfs_warning(vol->sb, "Clearing dirty mft "
+						"record page buffer.  %s",
+						ntfs_please_email);
+				clear_buffer_dirty(bh);
+			}
+			continue;
+		}
+		if (!buffer_mapped(bh)) {
+			ntfs_error(vol->sb, "Writing mft records without "
+					"existing mapped buffers is not "
+					"implemented yet.  %s",
+					ntfs_please_email);
+			err = -EOPNOTSUPP;
+			continue;
+		}
+		if (!buffer_uptodate(bh)) {
+			ntfs_error(vol->sb, "Writing mft records without "
+					"existing uptodate buffers is not "
+					"implemented yet.  %s",
+					ntfs_please_email);
+			err = -EOPNOTSUPP;
+			continue;
+		}
+		BUG_ON(!nr_bhs && (m_start != block_start));
+		BUG_ON(nr_bhs >= max_bhs);
+		bhs[nr_bhs++] = bh;
+		BUG_ON((nr_bhs >= max_bhs) && (m_end != block_end));
+	} while (block_start = block_end, (bh = bh->b_this_page) != head);
+	if (unlikely(err))
+		goto cleanup_out;
+	/* Apply the mst protection fixups. */
+	err = pre_write_mst_fixup((NTFS_RECORD*)m, vol->mft_record_size);
+	if (err) {
+		ntfs_error(vol->sb, "Failed to apply mst fixups!");
+		goto cleanup_out;
+	}
+	flush_dcache_mft_record_page(ni);
+	/* Lock buffers and start synchronous write i/o on them. */
+	for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) {
+		struct buffer_head *tbh = bhs[i_bhs];
+
+		if (unlikely(test_set_buffer_locked(tbh)))
+			BUG();
+		BUG_ON(!buffer_uptodate(tbh));
+		if (buffer_dirty(tbh))
+			clear_buffer_dirty(tbh);
+		get_bh(tbh);
+		tbh->b_end_io = end_buffer_write_sync;
+		submit_bh(WRITE, tbh);
+	}
+	/* Synchronize the mft mirror now if not @sync. */
+	if (!sync && ni->mft_no < vol->mftmirr_size)
+		sync_mft_mirror(ni, m, sync);
+	/* Wait on i/o completion of buffers. */
+	for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) {
+		struct buffer_head *tbh = bhs[i_bhs];
+
+		wait_on_buffer(tbh);
+		if (unlikely(!buffer_uptodate(tbh))) {
+			err = -EIO;
+			/*
+			 * Set the buffer uptodate so the page & buffer states
+			 * don't become out of sync.
+			 */
+			if (PageUptodate(page))
+				set_buffer_uptodate(tbh);
+		}
+	}
+	/* If @sync, now synchronize the mft mirror. */
+	if (sync && ni->mft_no < vol->mftmirr_size)
+		sync_mft_mirror(ni, m, sync);
+	/* Remove the mst protection fixups again. */
+	post_write_mst_fixup((NTFS_RECORD*)m);
+	flush_dcache_mft_record_page(ni);
+	if (unlikely(err)) {
+		/* I/O error during writing.  This is really bad! */
+		ntfs_error(vol->sb, "I/O error while writing mft record "
+				"0x%lx!  Marking base inode as bad.  You "
+				"should unmount the volume and run chkdsk.",
+				ni->mft_no);
+		goto err_out;
+	}
+done:
+	ntfs_debug("Done.");
+	return 0;
+cleanup_out:
+	/* Clean the buffers. */
+	for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++)
+		clear_buffer_dirty(bhs[i_bhs]);
+err_out:
+	/*
+	 * Current state: all buffers are clean, unlocked, and uptodate.
+	 * The caller should mark the base inode as bad so that no more i/o
+	 * happens.  ->clear_inode() will still be invoked so all extent inodes
+	 * and other allocated memory will be freed.
+	 */
+	if (err == -ENOMEM) {
+		ntfs_error(vol->sb, "Not enough memory to write mft record.  "
+				"Redirtying so the write is retried later.");
+		mark_mft_record_dirty(ni);
+		err = 0;
+	}
+	return err;
+}
+
+/**
+ * ntfs_mft_writepage - check if a metadata page contains dirty mft records
+ * @page:	metadata page possibly containing dirty mft records
+ * @wbc:	writeback control structure
+ *
+ * This is called from the VM when it wants to have a dirty $MFT/$DATA metadata
+ * page cache page cleaned.  The VM has already locked the page and marked it
+ * clean.  Instead of writing the page as a conventional ->writepage function
+ * would do, we check if the page still contains any dirty mft records (it must
+ * have done at some point in the past since the page was marked dirty) and if
+ * none are found, i.e. all mft records are clean, we unlock the page and
+ * return.  The VM is then free to do with the page as it pleases.  If on the
+ * other hand we do find any dirty mft records in the page, we redirty the page
+ * before unlocking it and returning so the VM knows that the page is still
+ * busy and cannot be thrown out.
+ *
+ * Note, we do not actually write any dirty mft records here because they are
+ * dirty inodes and hence will be written by the VFS inode dirty code paths.
+ * There is no need to write them from the VM page dirty code paths, too and in
+ * fact once we implement journalling it would be a complete nightmare having
+ * two code paths leading to mft record writeout.
+ */
+static int ntfs_mft_writepage(struct page *page, struct writeback_control *wbc)
+{
+	struct inode *mft_vi = page->mapping->host;
+	struct super_block *sb = mft_vi->i_sb;
+	ntfs_volume *vol = NTFS_SB(sb);
+	u8 *maddr;
+	MFT_RECORD *m;
+	ntfs_inode **extent_nis;
+	unsigned long mft_no;
+	int nr, i, j;
+	BOOL is_dirty = FALSE;
+
+	BUG_ON(mft_vi != vol->mft_ino);
+	/* The first mft record number in the page. */
+	mft_no = page->index << (PAGE_CACHE_SHIFT - vol->mft_record_size_bits);
+	/* Number of mft records in the page. */
+	nr = PAGE_CACHE_SIZE >> vol->mft_record_size_bits;
+	BUG_ON(!nr);
+	ntfs_debug("Entering for %i inodes starting at 0x%lx.", nr, mft_no);
+	/* Iterate over the mft records in the page looking for a dirty one. */
+	maddr = (u8*)kmap(page);
+	for (i = 0; i < nr; ++i, ++mft_no, maddr += vol->mft_record_size) {
+		struct inode *vi;
+		ntfs_inode *ni, *eni;
+		ntfs_attr na;
+
+		na.mft_no = mft_no;
+		na.name = NULL;
+		na.name_len = 0;
+		na.type = AT_UNUSED;
+		/*
+		 * Check if the inode corresponding to this mft record is in
+		 * the VFS inode cache and obtain a reference to it if it is.
+		 */
+		ntfs_debug("Looking for inode 0x%lx in icache.", mft_no);
+		/*
+		 * For inode 0, i.e. $MFT itself, we cannot use ilookup5() from
+		 * here or we deadlock because the inode is already locked by
+		 * the kernel (fs/fs-writeback.c::__sync_single_inode()) and
+		 * ilookup5() waits until the inode is unlocked before
+		 * returning it and it never gets unlocked because
+		 * ntfs_mft_writepage() never returns.  )-:  Fortunately, we
+		 * have inode 0 pinned in icache for the duration of the mount
+		 * so we can access it directly.
+		 */
+		if (!mft_no) {
+			/* Balance the below iput(). */
+			vi = igrab(mft_vi);
+			BUG_ON(vi != mft_vi);
+		} else
+			vi = ilookup5(sb, mft_no, (test_t)ntfs_test_inode, &na);
+		if (vi) {
+			ntfs_debug("Inode 0x%lx is in icache.", mft_no);
+			/* The inode is in icache.  Check if it is dirty. */
+			ni = NTFS_I(vi);
+			if (!NInoDirty(ni)) {
+				/* The inode is not dirty, skip this record. */
+				ntfs_debug("Inode 0x%lx is not dirty, "
+						"continuing search.", mft_no);
+				iput(vi);
+				continue;
+			}
+			ntfs_debug("Inode 0x%lx is dirty, aborting search.",
+					mft_no);
+			/* The inode is dirty, no need to search further. */
+			iput(vi);
+			is_dirty = TRUE;
+			break;
+		}
+		ntfs_debug("Inode 0x%lx is not in icache.", mft_no);
+		/* The inode is not in icache. */
+		/* Skip the record if it is not a mft record (type "FILE"). */
+		if (!ntfs_is_mft_recordp(maddr)) {
+			ntfs_debug("Mft record 0x%lx is not a FILE record, "
+					"continuing search.", mft_no);
+			continue;
+		}
+		m = (MFT_RECORD*)maddr;
+		/*
+		 * Skip the mft record if it is not in use.  FIXME:  What about
+		 * deleted/deallocated (extent) inodes?  (AIA)
+		 */
+		if (!(m->flags & MFT_RECORD_IN_USE)) {
+			ntfs_debug("Mft record 0x%lx is not in use, "
+					"continuing search.", mft_no);
+			continue;
+		}
+		/* Skip the mft record if it is a base inode. */
+		if (!m->base_mft_record) {
+			ntfs_debug("Mft record 0x%lx is a base record, "
+					"continuing search.", mft_no);
+			continue;
+		}
+		/*
+		 * This is an extent mft record.  Check if the inode
+		 * corresponding to its base mft record is in icache.
+		 */
+		na.mft_no = MREF_LE(m->base_mft_record);
+		ntfs_debug("Mft record 0x%lx is an extent record.  Looking "
+				"for base inode 0x%lx in icache.", mft_no,
+				na.mft_no);
+		vi = ilookup5(sb, na.mft_no, (test_t)ntfs_test_inode,
+				&na);
+		if (!vi) {
+			/*
+			 * The base inode is not in icache.  Skip this extent
+			 * mft record.
+			 */
+			ntfs_debug("Base inode 0x%lx is not in icache, "
+					"continuing search.", na.mft_no);
+			continue;
+		}
+		ntfs_debug("Base inode 0x%lx is in icache.", na.mft_no);
+		/*
+		 * The base inode is in icache.  Check if it has the extent
+		 * inode corresponding to this extent mft record attached.
+		 */
+		ni = NTFS_I(vi);
+		down(&ni->extent_lock);
+		if (ni->nr_extents <= 0) {
+			/*
+			 * The base inode has no attached extent inodes.  Skip
+			 * this extent mft record.
+			 */
+			up(&ni->extent_lock);
+			iput(vi);
+			continue;
+		}
+		/* Iterate over the attached extent inodes. */
+		extent_nis = ni->ext.extent_ntfs_inos;
+		for (eni = NULL, j = 0; j < ni->nr_extents; ++j) {
+			if (mft_no == extent_nis[j]->mft_no) {
+				/*
+				 * Found the extent inode corresponding to this
+				 * extent mft record.
+				 */
+				eni = extent_nis[j];
+				break;
+			}
+		}
+		/*
+		 * If the extent inode was not attached to the base inode, skip
+		 * this extent mft record.
+		 */
+		if (!eni) {
+			up(&ni->extent_lock);
+			iput(vi);
+			continue;
+		}
+		/*
+		 * Found the extent inode corrsponding to this extent mft
+		 * record.  If it is dirty, no need to search further.
+		 */
+		if (NInoDirty(eni)) {
+			up(&ni->extent_lock);
+			iput(vi);
+			is_dirty = TRUE;
+			break;
+		}
+		/* The extent inode is not dirty, so do the next record. */
+		up(&ni->extent_lock);
+		iput(vi);
+	}
+	kunmap(page);
+	/* If a dirty mft record was found, redirty the page. */
+	if (is_dirty) {
+		ntfs_debug("Inode 0x%lx is dirty.  Redirtying the page "
+				"starting at inode 0x%lx.", mft_no,
+				page->index << (PAGE_CACHE_SHIFT -
+				vol->mft_record_size_bits));
+		redirty_page_for_writepage(wbc, page);
+		unlock_page(page);
+	} else {
+		/*
+		 * Keep the VM happy.  This must be done otherwise the
+		 * radix-tree tag PAGECACHE_TAG_DIRTY remains set even though
+		 * the page is clean.
+		 */
+		BUG_ON(PageWriteback(page));
+		set_page_writeback(page);
+		unlock_page(page);
+		end_page_writeback(page);
+	}
+	ntfs_debug("Done.");
+	return 0;
+}
+
+#endif /* NTFS_RW */
diff --git a/fs/ntfs/mft.h b/fs/ntfs/mft.h
index 38965db36..4fd9b5ec6 100644
--- a/fs/ntfs/mft.h
+++ b/fs/ntfs/mft.h
@@ -2,7 +2,7 @@
  * mft.h - Defines for mft record handling in NTFS Linux kernel driver.
  *	   Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -28,8 +28,6 @@
 #include "inode.h"
 
 extern int format_mft_record(ntfs_inode *ni, MFT_RECORD *m);
-//extern int format_mft_record2(struct super_block *vfs_sb,
-//		const unsigned long inum, MFT_RECORD *m);
 
 extern MFT_RECORD *map_mft_record(ntfs_inode *ni);
 extern void unmap_mft_record(ntfs_inode *ni);
@@ -59,6 +57,60 @@ static inline void flush_dcache_mft_record_page(ntfs_inode *ni)
 	flush_dcache_page(ni->page);
 }
 
+extern void __mark_mft_record_dirty(ntfs_inode *ni);
+
+/**
+ * mark_mft_record_dirty - set the mft record and the page containing it dirty
+ * @ni:		ntfs inode describing the mapped mft record
+ *
+ * Set the mapped (extent) mft record of the (base or extent) ntfs inode @ni,
+ * as well as the page containing the mft record, dirty.  Also, mark the base
+ * vfs inode dirty.  This ensures that any changes to the mft record are
+ * written out to disk.
+ *
+ * NOTE:  Do not do anything if the mft record is already marked dirty.
+ */
+static inline void mark_mft_record_dirty(ntfs_inode *ni)
+{
+	if (!NInoTestSetDirty(ni))
+		__mark_mft_record_dirty(ni);
+}
+
+extern int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync);
+
+/**
+ * write_mft_record - write out a mapped (extent) mft record
+ * @ni:		ntfs inode describing the mapped (extent) mft record
+ * @m:		mapped (extent) mft record to write
+ * @sync:	if true, wait for i/o completion
+ *
+ * This is just a wrapper for write_mft_record_nolock() (see mft.c), which
+ * locks the page for the duration of the write.  This ensures that there are
+ * no race conditions between writing the mft record via the dirty inode code
+ * paths and via the page cache write back code paths or between writing
+ * neighbouring mft records residing in the same page.
+ *
+ * Locking the page also serializes us against ->readpage() if the page is not
+ * uptodate.
+ *
+ * On success, clean the mft record and return 0.  On error, leave the mft
+ * record dirty and return -errno.  The caller should call make_bad_inode() on
+ * the base inode to ensure no more access happens to this inode.  We do not do
+ * it here as the caller may want to finish writing other extent mft records
+ * first to minimize on-disk metadata inconsistencies.
+ */
+static inline int write_mft_record(ntfs_inode *ni, MFT_RECORD *m, int sync)
+{
+	struct page *page = ni->page;
+	int err;
+
+	BUG_ON(!page);
+	lock_page(page);
+	err = write_mft_record_nolock(ni, m, sync);
+	unlock_page(page);
+	return err;
+}
+
 #endif /* NTFS_RW */
 
 #endif /* _LINUX_NTFS_MFT_H */
diff --git a/fs/ntfs/mst.c b/fs/ntfs/mst.c
index 5ef2b1ef1..871548cf7 100644
--- a/fs/ntfs/mst.c
+++ b/fs/ntfs/mst.c
@@ -2,7 +2,7 @@
  * mst.c - NTFS multi sector transfer protection handling code. Part of the
  *	   Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index bc251eb82..6a6273811 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -1,6 +1,6 @@
 /*
  * namei.c - NTFS kernel directory inode operations. Part of the Linux-NTFS
- * 	     project.
+ *	     project.
  *
  * Copyright (c) 2001-2004 Anton Altaparmakov
  *
@@ -9,13 +9,13 @@
  * by the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -98,7 +98,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
 {
 	ntfs_volume *vol = NTFS_SB(dir_ino->i_sb);
 	struct inode *dent_inode;
-	uchar_t *uname;
+	ntfschar *uname;
 	ntfs_name *name = NULL;
 	MFT_REF mref;
 	unsigned long dent_ino;
@@ -177,7 +177,7 @@ handle_name:
 	nls_name.name = NULL;
 	if (name->type != FILE_NAME_DOS) {			/* Case 2. */
 		nls_name.len = (unsigned)ntfs_ucstonls(vol,
-				(uchar_t*)&name->name, name->len,
+				(ntfschar*)&name->name, name->len,
 				(unsigned char**)&nls_name.name, 0);
 		kfree(name);
 	} else /* if (name->type == FILE_NAME_DOS) */ {		/* Case 3. */
@@ -221,14 +221,14 @@ handle_name:
 				goto eio_err_out;
 			fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + le16_to_cpu(
 					ctx->attr->data.resident.value_offset));
-			if ((u32)(fn->file_name_length * sizeof(uchar_t) +
+			if ((u32)(fn->file_name_length * sizeof(ntfschar) +
 					sizeof(FILE_NAME_ATTR)) > val_len)
 				goto eio_err_out;
 		} while (fn->file_name_type != FILE_NAME_WIN32);
 
 		/* Convert the found WIN32 name to current NLS code page. */
 		nls_name.len = (unsigned)ntfs_ucstonls(vol,
-				(uchar_t*)&fn->file_name, fn->file_name_length,
+				(ntfschar*)&fn->file_name, fn->file_name_length,
 				(unsigned char**)&nls_name.name, 0);
 
 		put_attr_search_ctx(ctx);
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
index 82f17d696..c4ccbc9b6 100644
--- a/fs/ntfs/ntfs.h
+++ b/fs/ntfs/ntfs.h
@@ -2,8 +2,8 @@
  * ntfs.h - Defines for NTFS Linux kernel driver. Part of the Linux-NTFS
  *	    project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
- * Copyright (C) 2002 Richard Russon.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
+ * Copyright (C) 2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -61,9 +61,8 @@ extern kmem_cache_t *ntfs_attr_ctx_cache;
 
 /* The various operations structs defined throughout the driver files. */
 extern struct super_operations ntfs_sops;
-extern struct super_operations ntfs_mount_sops;
-
 extern struct address_space_operations ntfs_aops;
+extern struct address_space_operations ntfs_mst_aops;
 extern struct address_space_operations ntfs_mft_aops;
 
 extern struct  file_operations ntfs_file_ops;
@@ -75,14 +74,6 @@ extern struct inode_operations ntfs_dir_inode_ops;
 extern struct  file_operations ntfs_empty_file_ops;
 extern struct inode_operations ntfs_empty_inode_ops;
 
-/* Generic macros to convert pointers to values and vice versa. */
-#ifndef p2n
-#define p2n(p)		((ptrdiff_t)((ptrdiff_t*)(p)))
-#endif
-#ifndef n2p
-#define n2p(p)		((ptrdiff_t*)((ptrdiff_t)(p)))
-#endif
-
 /**
  * NTFS_SB - return the ntfs volume given a vfs super block
  * @sb:		VFS super block
@@ -184,32 +175,31 @@ extern int pre_write_mst_fixup(NTFS_RECORD *b, const u32 size);
 extern void post_write_mst_fixup(NTFS_RECORD *b);
 
 /* From fs/ntfs/unistr.c */
-extern BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
-		const uchar_t *s2, size_t s2_len,
+extern BOOL ntfs_are_names_equal(const ntfschar *s1, size_t s1_len,
+		const ntfschar *s2, size_t s2_len,
 		const IGNORE_CASE_BOOL ic,
-		const uchar_t *upcase, const u32 upcase_size);
-extern int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
-		const uchar_t *name2, const u32 name2_len,
+		const ntfschar *upcase, const u32 upcase_size);
+extern int ntfs_collate_names(const ntfschar *name1, const u32 name1_len,
+		const ntfschar *name2, const u32 name2_len,
 		const int err_val, const IGNORE_CASE_BOOL ic,
-		const uchar_t *upcase, const u32 upcase_len);
-extern int ntfs_ucsncmp(const uchar_t *s1, const uchar_t *s2, size_t n);
-extern int ntfs_ucsncasecmp(const uchar_t *s1, const uchar_t *s2, size_t n,
-		const uchar_t *upcase, const u32 upcase_size);
-extern void ntfs_upcase_name(uchar_t *name, u32 name_len,
-		const uchar_t *upcase, const u32 upcase_len);
+		const ntfschar *upcase, const u32 upcase_len);
+extern int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n);
+extern int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n,
+		const ntfschar *upcase, const u32 upcase_size);
+extern void ntfs_upcase_name(ntfschar *name, u32 name_len,
+		const ntfschar *upcase, const u32 upcase_len);
 extern void ntfs_file_upcase_value(FILE_NAME_ATTR *file_name_attr,
-		const uchar_t *upcase, const u32 upcase_len);
+		const ntfschar *upcase, const u32 upcase_len);
 extern int ntfs_file_compare_values(FILE_NAME_ATTR *file_name_attr1,
 		FILE_NAME_ATTR *file_name_attr2,
 		const int err_val, const IGNORE_CASE_BOOL ic,
-		const uchar_t *upcase, const u32 upcase_len);
+		const ntfschar *upcase, const u32 upcase_len);
 extern int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
-		const int ins_len, uchar_t **outs);
-extern int ntfs_ucstonls(const ntfs_volume *vol, const uchar_t *ins,
+		const int ins_len, ntfschar **outs);
+extern int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins,
 		const int ins_len, unsigned char **outs, int outs_len);
 
 /* From fs/ntfs/upcase.c */
-extern uchar_t *generate_default_upcase(void);
+extern ntfschar *generate_default_upcase(void);
 
 #endif /* _LINUX_NTFS_H */
-
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index e5aa70018..4c3a32b74 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -291,6 +291,101 @@ needs_val:
 	return FALSE;
 }
 
+#ifdef NTFS_RW
+
+/**
+ * ntfs_write_volume_flags - write new flags to the volume information flags
+ * @vol:	ntfs volume on which to modify the flags
+ * @flags:	new flags value for the volume information flags
+ *
+ * Internal function.  You probably want to use ntfs_{set,clear}_volume_flags()
+ * instead (see below).
+ *
+ * Replace the volume information flags on the volume @vol with the value
+ * supplied in @flags.  Note, this overwrites the volume information flags, so
+ * make sure to combine the flags you want to modify with the old flags and use
+ * the result when calling ntfs_write_volume_flags().
+ *
+ * Return 0 on success and -errno on error.
+ */
+static int ntfs_write_volume_flags(ntfs_volume *vol, const VOLUME_FLAGS flags)
+{
+	ntfs_inode *ni = NTFS_I(vol->vol_ino);
+	MFT_RECORD *m;
+	VOLUME_INFORMATION *vi;
+	attr_search_context *ctx;
+	int err;
+
+	ntfs_debug("Entering, old flags = 0x%x, new flags = 0x%x.",
+			vol->vol_flags, flags);
+	if (vol->vol_flags == flags)
+		goto done;
+	BUG_ON(!ni);
+	m = map_mft_record(ni);
+	if (IS_ERR(m)) {
+		err = PTR_ERR(m);
+		goto err_out;
+	}
+	ctx = get_attr_search_ctx(ni, m);
+	if (!ctx) {
+		err = -ENOMEM;
+		goto put_unm_err_out;
+	}
+	if (!lookup_attr(AT_VOLUME_INFORMATION, NULL, 0, 0, 0, NULL, 0, ctx)) {
+		err = -EIO;
+		goto put_unm_err_out;
+	}
+	vi = (VOLUME_INFORMATION*)((u8*)ctx->attr +
+			le16_to_cpu(ctx->attr->data.resident.value_offset));
+	vol->vol_flags = vi->flags = flags;
+	flush_dcache_mft_record_page(ctx->ntfs_ino);
+	mark_mft_record_dirty(ctx->ntfs_ino);
+	put_attr_search_ctx(ctx);
+	unmap_mft_record(ni);
+done:
+	ntfs_debug("Done.");
+	return 0;
+put_unm_err_out:
+	if (ctx)
+		put_attr_search_ctx(ctx);
+	unmap_mft_record(ni);
+err_out:
+	ntfs_error(vol->sb, "Failed with error code %i.", -err);
+	return err;
+}
+
+/**
+ * ntfs_set_volume_flags - set bits in the volume information flags
+ * @vol:	ntfs volume on which to modify the flags
+ * @flags:	flags to set on the volume
+ *
+ * Set the bits in @flags in the volume information flags on the volume @vol.
+ *
+ * Return 0 on success and -errno on error.
+ */
+static inline int ntfs_set_volume_flags(ntfs_volume *vol, VOLUME_FLAGS flags)
+{
+	flags &= VOLUME_FLAGS_MASK;
+	return ntfs_write_volume_flags(vol, vol->vol_flags | flags);
+}
+
+/**
+ * ntfs_clear_volume_flags - clear bits in the volume information flags
+ * @vol:	ntfs volume on which to modify the flags
+ * @flags:	flags to clear on the volume
+ *
+ * Clear the bits in @flags in the volume information flags on the volume @vol.
+ *
+ * Return 0 on success and -errno on error.
+ */
+static inline int ntfs_clear_volume_flags(ntfs_volume *vol, VOLUME_FLAGS flags)
+{
+	flags &= VOLUME_FLAGS_MASK;
+	return ntfs_write_volume_flags(vol, vol->vol_flags & ~flags);
+}
+
+#endif /* NTFS_RW */
+
 /**
  * ntfs_remount - change the mount options of a mounted ntfs filesystem
  * @sb:		superblock of mounted ntfs filesystem
@@ -314,25 +409,74 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
 #else /* ! NTFS_RW */
 	/*
 	 * For the read-write compiled driver, if we are remounting read-write,
-	 * make sure there aren't any volume errors and empty the lofgile.
+	 * make sure there are no volume errors and that no unsupported volume
+	 * flags are set.  Also, empty the logfile journal as it would become
+	 * stale as soon as something is written to the volume and mark the
+	 * volume dirty so that chkdsk is run if the volume is not umounted
+	 * cleanly.
+	 *
+	 * When remounting read-only, mark the volume clean if no volume errors
+	 * have occured.
 	 */
 	if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
 		static const char *es = ".  Cannot remount read-write.";
 
+		/* Remounting read-write. */
 		if (NVolErrors(vol)) {
 			ntfs_error(sb, "Volume has errors and is read-only%s",
 					es);
 			return -EROFS;
 		}
+		if (vol->vol_flags & VOLUME_IS_DIRTY) {
+			ntfs_error(sb, "Volume is dirty and read-only%s", es);
+			return -EROFS;
+		}
+		if (vol->vol_flags & VOLUME_MUST_MOUNT_RO_MASK) {
+			ntfs_error(sb, "Volume has unsupported flags set and "
+					"is read-only%s", es);
+			return -EROFS;
+		}
+		if (ntfs_set_volume_flags(vol, VOLUME_IS_DIRTY)) {
+			ntfs_error(sb, "Failed to set dirty bit in volume "
+					"information flags%s", es);
+			return -EROFS;
+		}
+#if 0
+		// TODO: Enable this code once we start modifying anything that
+		//	 is different between NTFS 1.2 and 3.x...
+		/* Set NT4 compatibility flag on newer NTFS version volumes. */
+		if ((vol->major_ver > 1)) {
+			if (ntfs_set_volume_flags(vol, VOLUME_MOUNTED_ON_NT4)) {
+				ntfs_error(sb, "Failed to set NT4 "
+						"compatibility flag%s", es);
+				NVolSetErrors(vol);
+				return -EROFS;
+			}
+		}
+#endif
 		if (!ntfs_empty_logfile(vol->logfile_ino)) {
 			ntfs_error(sb, "Failed to empty journal $LogFile%s",
 					es);
 			NVolSetErrors(vol);
 			return -EROFS;
 		}
+	} else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
+		/* Remounting read-only. */
+		if (!NVolErrors(vol)) {
+			if (ntfs_clear_volume_flags(vol, VOLUME_IS_DIRTY))
+				ntfs_warning(sb, "Failed to clear dirty bit "
+						"in volume information "
+						"flags.  Run chkdsk.");
+		}
 	}
 	// TODO:  For now we enforce no atime and dir atime updates as they are
 	// not implemented.
+	if ((sb->s_flags & MS_NOATIME) && !(*flags & MS_NOATIME))
+		ntfs_warning(sb, "Atime updates are not implemented yet.  "
+				"Leaving them disabled.");
+	else if ((sb->s_flags & MS_NODIRATIME) && !(*flags & MS_NODIRATIME))
+		ntfs_warning(sb, "Directory atime updates are not implemented "
+				"yet.  Leaving them disabled.");
 	*flags |= MS_NOATIME | MS_NODIRATIME;
 #endif /* ! NTFS_RW */
 
@@ -756,7 +900,7 @@ static BOOL load_and_init_mft_mirror(ntfs_volume *vol)
 	/* The $MFTMirr, like the $MFT is multi sector transfer protected. */
 	NInoSetMstProtected(tmp_ni);
 	/*
-	 * Set up our little cheat allowing us to reuse the async io
+	 * Set up our little cheat allowing us to reuse the async read io
 	 * completion handler for directories.
 	 */
 	tmp_ni->itype.index.block_size = vol->mft_record_size;
@@ -937,12 +1081,12 @@ static BOOL load_and_init_upcase(ntfs_volume *vol)
 	}
 	/*
 	 * The upcase size must not be above 64k Unicode characters, must not
-	 * be zero and must be a multiple of sizeof(uchar_t).
+	 * be zero and must be a multiple of sizeof(ntfschar).
 	 */
-	if (!ino->i_size || ino->i_size & (sizeof(uchar_t) - 1) ||
-			ino->i_size > 64ULL * 1024 * sizeof(uchar_t))
+	if (!ino->i_size || ino->i_size & (sizeof(ntfschar) - 1) ||
+			ino->i_size > 64ULL * 1024 * sizeof(ntfschar))
 		goto iput_upcase_failed;
-	vol->upcase = (uchar_t*)ntfs_malloc_nofs(ino->i_size);
+	vol->upcase = (ntfschar*)ntfs_malloc_nofs(ino->i_size);
 	if (!vol->upcase)
 		goto iput_upcase_failed;
 	index = 0;
@@ -965,7 +1109,7 @@ read_partial_upcase_page:
 	}
 	vol->upcase_len = ino->i_size >> UCHAR_T_SIZE_BITS;
 	ntfs_debug("Read %llu bytes from $UpCase (expected %u bytes).",
-			ino->i_size, 64 * 1024 * sizeof(uchar_t));
+			ino->i_size, 64 * 1024 * sizeof(ntfschar));
 	iput(ino);
 	down(&ntfs_lock);
 	if (!default_upcase) {
@@ -1124,7 +1268,7 @@ get_ctx_vol_failed:
 			le32_to_cpu(ctx->attr->data.resident.value_length) >
 			(u8*)ctx->attr + le32_to_cpu(ctx->attr->length))
 		goto err_put_vol;
-	/* Setup volume flags and version. */
+	/* Copy the volume flags and version to the ntfs_volume structure. */
 	vol->vol_flags = vi->flags;
 	vol->major_ver = vi->major_ver;
 	vol->minor_ver = vi->minor_ver;
@@ -1133,16 +1277,46 @@ get_ctx_vol_failed:
 	printk(KERN_INFO "NTFS volume version %i.%i.\n", vol->major_ver,
 			vol->minor_ver);
 #ifdef NTFS_RW
+	/* Make sure that no unsupported volume flags are set. */
+	if (vol->vol_flags & VOLUME_MUST_MOUNT_RO_MASK) {
+		static const char *es1a = "Volume is dirty";
+		static const char *es1b = "Volume has unsupported flags set";
+		static const char *es2 = ".  Run chkdsk and mount in Windows.";
+		const char *es1;
+		
+		es1 = vol->vol_flags & VOLUME_IS_DIRTY ? es1a : es1b;
+		/* If a read-write mount, convert it to a read-only mount. */
+		if (!(sb->s_flags & MS_RDONLY)) {
+			if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO |
+					ON_ERRORS_CONTINUE))) {
+				ntfs_error(sb, "%s and neither on_errors="
+						"continue nor on_errors="
+						"remount-ro was specified%s",
+						es1, es2);
+				goto iput_vol_err_out;
+			}
+			sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
+			ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
+		} else
+			ntfs_warning(sb, "%s.  Will not be able to remount "
+					"read-write%s", es1, es2);
+		/*
+		 * Do not set NVolErrors() because ntfs_remount() re-checks the
+		 * flags which we need to do in case any flags have changed.
+		 */
+	}
 	/*
 	 * Get the inode for the logfile, check it and determine if the volume
 	 * was shutdown cleanly.
 	 */
 	if (!load_and_check_logfile(vol) ||
 			!ntfs_is_logfile_clean(vol->logfile_ino)) {
-		static const char *es1 = "Failed to load $LogFile";
-		static const char *es2 = "$LogFile is not clean";
-		static const char *es3 = ".  Mount in Windows.";
+		static const char *es1a = "Failed to load $LogFile";
+		static const char *es1b = "$LogFile is not clean";
+		static const char *es2 = ".  Mount in Windows.";
+		const char *es1;
 
+		es1 = !vol->logfile_ino ? es1a : es1b;
 		/* If a read-write mount, convert it to a read-only mount. */
 		if (!(sb->s_flags & MS_RDONLY)) {
 			if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO |
@@ -1150,21 +1324,66 @@ get_ctx_vol_failed:
 				ntfs_error(sb, "%s and neither on_errors="
 						"continue nor on_errors="
 						"remount-ro was specified%s",
-						!vol->logfile_ino ? es1 : es2,
-						es3);
+						es1, es2);
 				goto iput_logfile_err_out;
 			}
 			sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
-			ntfs_error(sb, "%s.  Mounting read-only%s",
-					!vol->logfile_ino ? es1 : es2, es3);
+			ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
 		} else
 			ntfs_warning(sb, "%s.  Will not be able to remount "
-					"read-write%s",
-					!vol->logfile_ino ? es1 : es2, es3);
+					"read-write%s", es1, es2);
 		/* This will prevent a read-write remount. */
 		NVolSetErrors(vol);
-	/* If a read-write mount, empty the logfile. */
-	} else if (!(sb->s_flags & MS_RDONLY) &&
+	}
+	/* If (still) a read-write mount, mark the volume dirty. */
+	if (!(sb->s_flags & MS_RDONLY) &&
+			ntfs_set_volume_flags(vol, VOLUME_IS_DIRTY)) {
+		static const char *es1 = "Failed to set dirty bit in volume "
+				"information flags";
+		static const char *es2 = ".  Run chkdsk.";
+
+		/* Convert to a read-only mount. */
+		if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO |
+				ON_ERRORS_CONTINUE))) {
+			ntfs_error(sb, "%s and neither on_errors=continue nor "
+					"on_errors=remount-ro was specified%s",
+					es1, es2);
+			goto iput_logfile_err_out;
+		}
+		ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
+		sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
+		/*
+		 * Do not set NVolErrors() because ntfs_remount() might manage
+		 * to set the dirty flag in which case all would be well.
+		 */
+	}
+#if 0
+	// TODO: Enable this code once we start modifying anything that is
+	//	 different between NTFS 1.2 and 3.x...
+	/*
+	 * If (still) a read-write mount, set the NT4 compatibility flag on
+	 * newer NTFS version volumes.
+	 */
+	if (!(sb->s_flags & MS_RDONLY) && (vol->major_ver > 1) &&
+			ntfs_set_volume_flags(vol, VOLUME_MOUNTED_ON_NT4)) {
+		static const char *es1 = "Failed to set NT4 compatibility flag";
+		static const char *es2 = ".  Run chkdsk.";
+
+		/* Convert to a read-only mount. */
+		if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO |
+				ON_ERRORS_CONTINUE))) {
+			ntfs_error(sb, "%s and neither on_errors=continue nor "
+					"on_errors=remount-ro was specified%s",
+					es1, es2);
+			goto iput_logfile_err_out;
+		}
+		ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
+		sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
+		NVolSetErrors(vol);
+	}
+#endif
+	/* If (still) a read-write mount, empty the logfile. */
+	if (!(sb->s_flags & MS_RDONLY) &&
 			!ntfs_empty_logfile(vol->logfile_ino)) {
 		static const char *es1 = "Failed to empty $LogFile";
 		static const char *es2 = ".  Mount in Windows.";
@@ -1177,12 +1396,11 @@ get_ctx_vol_failed:
 					es1, es2);
 			goto iput_logfile_err_out;
 		}
-		sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
 		ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
-		/* This will prevent a read-write remount. */
+		sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
 		NVolSetErrors(vol);
 	}
-#endif
+#endif /* NTFS_RW */
 	/*
 	 * Get the inode for the attribute definitions file and parse the
 	 * attribute definitions.
@@ -1240,6 +1458,7 @@ iput_logfile_err_out:
 #ifdef NTFS_RW
 	if (vol->logfile_ino)
 		iput(vol->logfile_ino);
+iput_vol_err_out:
 #endif /* NTFS_RW */
 	iput(vol->vol_ino);
 iput_lcnbmp_err_out:
@@ -1256,18 +1475,69 @@ iput_mirr_err_out:
 
 /**
  * ntfs_put_super - called by the vfs to unmount a volume
- * @vfs_sb:	vfs superblock of volume to unmount
+ * @sb:		vfs superblock of volume to unmount
  *
  * ntfs_put_super() is called by the VFS (from fs/super.c::do_umount()) when
  * the volume is being unmounted (umount system call has been invoked) and it
  * releases all inodes and memory belonging to the NTFS specific part of the
  * super block.
  */
-static void ntfs_put_super(struct super_block *vfs_sb)
+static void ntfs_put_super(struct super_block *sb)
 {
-	ntfs_volume *vol = NTFS_SB(vfs_sb);
+	ntfs_volume *vol = NTFS_SB(sb);
 
 	ntfs_debug("Entering.");
+#ifdef NTFS_RW
+	/*
+	 * Commit all inodes while they are still open in case some of them
+	 * cause others to be dirtied.
+	 */
+	ntfs_commit_inode(vol->vol_ino);
+
+	/* NTFS 3.0+ specific. */
+	if (vol->major_ver >= 3) {
+		if (vol->secure_ino)
+			ntfs_commit_inode(vol->secure_ino);
+	}
+
+	ntfs_commit_inode(vol->root_ino);
+
+	down_write(&vol->lcnbmp_lock);
+	ntfs_commit_inode(vol->lcnbmp_ino);
+	up_write(&vol->lcnbmp_lock);
+
+	down_write(&vol->mftbmp_lock);
+	ntfs_commit_inode(vol->mftbmp_ino);
+	up_write(&vol->mftbmp_lock);
+
+	if (vol->logfile_ino)
+		ntfs_commit_inode(vol->logfile_ino);
+
+	if (vol->mftmirr_ino)
+		ntfs_commit_inode(vol->mftmirr_ino);
+	ntfs_commit_inode(vol->mft_ino);
+
+	/*
+	 * If a read-write mount and no volume errors have occured, mark the
+	 * volume clean.  Also, re-commit all affected inodes.
+	 */
+	if (!(sb->s_flags & MS_RDONLY)) {
+		if (!NVolErrors(vol)) {
+			if (ntfs_clear_volume_flags(vol, VOLUME_IS_DIRTY))
+				ntfs_warning(sb, "Failed to clear dirty bit "
+						"in volume information "
+						"flags.  Run chkdsk.");
+			ntfs_commit_inode(vol->vol_ino);
+			ntfs_commit_inode(vol->root_ino);
+			if (vol->mftmirr_ino)
+				ntfs_commit_inode(vol->mftmirr_ino);
+			ntfs_commit_inode(vol->mft_ino);
+		} else {
+			ntfs_warning(sb, "Volume has errors.  Leaving volume "
+					"marked dirty.  Run chkdsk.");
+		}
+	}
+#endif /* NTFS_RW */
 
 	iput(vol->vol_ino);
 	vol->vol_ino = NULL;
@@ -1298,11 +1568,47 @@ static void ntfs_put_super(struct super_block *vfs_sb)
 		iput(vol->logfile_ino);
 		vol->logfile_ino = NULL;
 	}
-
 	if (vol->mftmirr_ino) {
+		/* Re-commit the mft mirror and mft just in case. */
+		ntfs_commit_inode(vol->mftmirr_ino);
+		ntfs_commit_inode(vol->mft_ino);
 		iput(vol->mftmirr_ino);
 		vol->mftmirr_ino = NULL;
 	}
+	/*
+	 * If any dirty inodes are left, throw away all mft data page cache
+	 * pages to allow a clean umount.  This should never happen any more
+	 * due to mft.c::ntfs_mft_writepage() cleaning all the dirty pages as
+	 * the underlying mft records are written out and cleaned.  If it does,
+	 * happen anyway, we want to know...
+	 */
+	ntfs_commit_inode(vol->mft_ino);
+	write_inode_now(vol->mft_ino, 1);
+	if (!list_empty(&sb->s_dirty)) {
+		const char *s1, *s2;
+
+		down(&vol->mft_ino->i_sem);
+		truncate_inode_pages(vol->mft_ino->i_mapping, 0);
+		up(&vol->mft_ino->i_sem);
+		write_inode_now(vol->mft_ino, 1);
+		if (!list_empty(&sb->s_dirty)) {
+			static const char *_s1 = "inodes";
+			static const char *_s2 = "";
+			s1 = _s1;
+			s2 = _s2;
+		} else {
+			static const char *_s1 = "mft pages";
+			static const char *_s2 = "They have been thrown "
+					"away.  ";
+			s1 = _s1;
+			s2 = _s2;
+		}
+		ntfs_error(sb, "Dirty %s found at umount time.  %sYou should "
+				"run chkdsk.  Please email "
+				"linux-ntfs-dev@lists.sourceforge.net and say "
+				"that you saw this message.  Thank you.", s1,
+				s2);
+	}
 #endif /* NTFS_RW */
 
 	iput(vol->mft_ino);
@@ -1311,7 +1617,7 @@ static void ntfs_put_super(struct super_block *vfs_sb)
 	vol->upcase_len = 0;
 	/*
 	 * Decrease the number of mounts and destroy the global default upcase
-	 * table if necessary. Also decrease the number of upcase users if we
+	 * table if necessary.  Also decrease the number of upcase users if we
 	 * are a user.
 	 */
 	down(&ntfs_lock);
@@ -1335,7 +1641,7 @@ static void ntfs_put_super(struct super_block *vfs_sb)
 		unload_nls(vol->nls_map);
 		vol->nls_map = NULL;
 	}
-	vfs_sb->s_fs_info = NULL;
+	sb->s_fs_info = NULL;
 	kfree(vol);
 	return;
 }
@@ -1584,19 +1890,6 @@ static int ntfs_statfs(struct super_block *sb, struct kstatfs *sfs)
 	return 0;
 }
 
-/**
- * Super operations for mount time when we don't have enough setup to use the
- * proper functions.
- */
-struct super_operations ntfs_mount_sops = {
-	.alloc_inode	= ntfs_alloc_big_inode,	  /* VFS: Allocate new inode. */
-	.destroy_inode	= ntfs_destroy_big_inode, /* VFS: Deallocate inode. */
-	.read_inode	= ntfs_read_inode_mount,  /* VFS: Load inode from disk,
-						     called from iget(). */
-	.clear_inode	= ntfs_clear_big_inode,	  /* VFS: Called when inode is
-						     removed from memory. */
-};
-
 /**
  * The complete super operations.
  */
@@ -1609,8 +1902,8 @@ struct super_operations ntfs_sops = {
 #ifdef NTFS_RW
 	//.dirty_inode	= NULL,			/* VFS: Called from
 	//					   __mark_inode_dirty(). */
-	//.write_inode	= NULL,			/* VFS: Write dirty inode to
-	//					   disk. */
+	.write_inode	= ntfs_write_inode,	/* VFS: Write dirty inode to
+						   disk. */
 	//.drop_inode	= NULL,			/* VFS: Called just after the
 	//					   inode reference count has
 	//					   been decreased to zero.
@@ -1699,8 +1992,12 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
 #ifndef NTFS_RW
 	sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
 #else
-	// TODO:  For now we enforce no atime and dir atime updates as they are
-	// not implemented.
+	if (!(sb->s_flags & MS_NOATIME))
+		ntfs_warning(sb, "Atime updates are not implemented yet.  "
+				"Disabling them.");
+	else if (!(sb->s_flags & MS_NODIRATIME))
+		ntfs_warning(sb, "Directory atime updates are not implemented "
+				"yet.  Disabling them.");
 	sb->s_flags |= MS_NOATIME | MS_NODIRATIME;
 #endif
 	/* Allocate a new ntfs_volume and place it in sb->s_fs_info. */
@@ -1814,28 +2111,20 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
 	 * the inode for $MFT which is sufficient to allow our normal inode
 	 * operations and associated address space operations to function.
 	 */
-	/*
-	 * Poison vol->mft_ino so we know whether iget() called into our
-	 * ntfs_read_inode_mount() method.
-	 */
-#define OGIN	((struct inode*)n2p(le32_to_cpu(0x4e49474f)))	/* OGIN */
-	vol->mft_ino = OGIN;
-	sb->s_op = &ntfs_mount_sops;
-	tmp_ino = iget(vol->sb, FILE_MFT);
-	if (!tmp_ino || tmp_ino != vol->mft_ino || is_bad_inode(tmp_ino)) {
+	sb->s_op = &ntfs_sops;
+	tmp_ino = new_inode(sb);
+	if (!tmp_ino) {
+		if (!silent)
+			ntfs_error(sb, "Failed to load essential metadata.");
+		goto err_out_now;
+	}
+	tmp_ino->i_ino = FILE_MFT;
+	insert_inode_hash(tmp_ino);
+	if (ntfs_read_inode_mount(tmp_ino) < 0) {
 		if (!silent)
 			ntfs_error(sb, "Failed to load essential metadata.");
-		if (tmp_ino && vol->mft_ino == OGIN)
-			ntfs_error(sb, "BUG: iget() did not call "
-					"ntfs_read_inode_mount() method!\n");
-		if (!tmp_ino)
-			goto cond_iput_mft_ino_err_out_now;
 		goto iput_tmp_ino_err_out_now;
 	}
-	/*
-	 * Note: sb->s_op has already been set to &ntfs_sops by our specialized
-	 * ntfs_read_inode_mount() method when it was invoked by iget().
-	 */
 	down(&ntfs_lock);
 	/*
 	 * The current mount is a compression user if the cluster size is
@@ -1931,12 +2220,10 @@ unl_upcase_iput_tmp_ino_err_out_now:
 	up(&ntfs_lock);
 iput_tmp_ino_err_out_now:
 	iput(tmp_ino);
-cond_iput_mft_ino_err_out_now:
-	if (vol->mft_ino && vol->mft_ino != OGIN && vol->mft_ino != tmp_ino) {
+	if (vol->mft_ino && vol->mft_ino != tmp_ino) {
 		iput(vol->mft_ino);
 		vol->mft_ino = NULL;
 	}
-#undef OGIN
 	/*
 	 * This is needed to get ntfs_clear_extent_inode() called for each
 	 * inode we have ever called ntfs_iget()/iput() on, otherwise we A)
@@ -2049,7 +2336,7 @@ static int __init init_ntfs_fs(void)
 	}
 
 	ntfs_name_cache = kmem_cache_create(ntfs_name_cache_name,
-			(NTFS_MAX_NAME_LEN+1) * sizeof(uchar_t), 0,
+			(NTFS_MAX_NAME_LEN+1) * sizeof(ntfschar), 0,
 			SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (!ntfs_name_cache) {
 		printk(KERN_CRIT "NTFS: Failed to create %s!\n",
diff --git a/fs/ntfs/sysctl.c b/fs/ntfs/sysctl.c
index 0c5fe3076..75067e4f3 100644
--- a/fs/ntfs/sysctl.c
+++ b/fs/ntfs/sysctl.c
@@ -1,22 +1,22 @@
 /*
  * sysctl.c - Code for sysctl handling in NTFS Linux kernel driver. Part of
  *	      the Linux-NTFS project. Adapted from the old NTFS driver,
- *	      Copyright (C) 1997 Martin von Löwis, Régis Duchesne.
+ *	      Copyright (C) 1997 Martin von Löwis, Régis Duchesne
  *
- * Copyright (c) 2002 Anton Altaparmakov.
+ * Copyright (c) 2002-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -37,7 +37,7 @@
 
 /* Definition of the ntfs sysctl. */
 static ctl_table ntfs_sysctls[] = {
-	{ FS_NTFS, "ntfs-debug", 		/* Binary and text IDs. */
+	{ FS_NTFS, "ntfs-debug",		/* Binary and text IDs. */
 	  &debug_msgs,sizeof(debug_msgs),	/* Data pointer and size. */
 	  0644,	NULL, &proc_dointvec },		/* Mode, child, proc handler. */
 	{ 0 }
@@ -83,4 +83,3 @@ int ntfs_sysctl(int add)
 
 #endif /* CONFIG_SYSCTL */
 #endif /* DEBUG */
-
diff --git a/fs/ntfs/sysctl.h b/fs/ntfs/sysctl.h
index 2531d758b..df749cc0a 100644
--- a/fs/ntfs/sysctl.h
+++ b/fs/ntfs/sysctl.h
@@ -1,22 +1,22 @@
 /*
  * sysctl.h - Defines for sysctl handling in NTFS Linux kernel driver. Part of
  *	      the Linux-NTFS project. Adapted from the old NTFS driver,
- *	      Copyright (C) 1997 Martin von Löwis, Régis Duchesne.
- * 
- * Copyright (c) 2002 Anton Altaparmakov.
+ *	      Copyright (C) 1997 Martin von Löwis, Régis Duchesne
+ *
+ * Copyright (c) 2002-2004 Anton Altaparmakov
  *
  * This program/include file 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.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -40,4 +40,3 @@ static inline int ntfs_sysctl(int add)
 
 #endif /* DEBUG && CONFIG_SYSCTL */
 #endif /* _LINUX_NTFS_SYSCTL_H */
-
diff --git a/fs/ntfs/time.h b/fs/ntfs/time.h
index 1f32eda0d..b0a7dbafc 100644
--- a/fs/ntfs/time.h
+++ b/fs/ntfs/time.h
@@ -1,7 +1,7 @@
 /*
  * time.h - NTFS time conversion functions.  Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
diff --git a/fs/ntfs/types.h b/fs/ntfs/types.h
index 1e5853e5a..a33fc637f 100644
--- a/fs/ntfs/types.h
+++ b/fs/ntfs/types.h
@@ -2,7 +2,7 @@
  * types.h - Defines for NTFS Linux kernel driver specific types.
  *	     Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -24,7 +24,7 @@
 #define _LINUX_NTFS_TYPES_H
 
 /* 2-byte Unicode character type. */
-typedef u16 uchar_t;
+typedef u16 ntfschar;
 #define UCHAR_T_SIZE_BITS 1
 
 /*
diff --git a/fs/ntfs/unistr.c b/fs/ntfs/unistr.c
index 36bee49dd..507f836f9 100644
--- a/fs/ntfs/unistr.c
+++ b/fs/ntfs/unistr.c
@@ -8,13 +8,13 @@
  * by the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * This program/include file is distributed in the hope that it will be 
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
+ * This program/include file is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program (in the main directory of the Linux-NTFS 
+ * along with this program (in the main directory of the Linux-NTFS
  * distribution in the file COPYING); if not, write to the Free Software
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
@@ -61,10 +61,9 @@ static const u8 legal_ansi_char_array[0x40] = {
  * identical, or FALSE (0) if they are not identical. If @ic is IGNORE_CASE,
  * the @upcase table is used to performa a case insensitive comparison.
  */
-BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
-		     const uchar_t *s2, size_t s2_len,
-		     const IGNORE_CASE_BOOL ic,
-		     const uchar_t *upcase, const u32 upcase_size)
+BOOL ntfs_are_names_equal(const ntfschar *s1, size_t s1_len,
+		const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic,
+		const ntfschar *upcase, const u32 upcase_size)
 {
 	if (s1_len != s2_len)
 		return FALSE;
@@ -78,12 +77,12 @@ BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
  * @name1:	first Unicode name to compare
  * @name2:	second Unicode name to compare
  * @err_val:	if @name1 contains an invalid character return this value
- * @ic:         either CASE_SENSITIVE or IGNORE_CASE
+ * @ic:		either CASE_SENSITIVE or IGNORE_CASE
  * @upcase:	upcase table (ignored if @ic is CASE_SENSITIVE)
  * @upcase_len:	upcase table size (ignored if @ic is CASE_SENSITIVE)
  *
  * ntfs_collate_names collates two Unicode names and returns:
- * 
+ *
  *  -1 if the first name collates before the second one,
  *   0 if the names match,
  *   1 if the second name collates before the first one, or
@@ -91,13 +90,13 @@ BOOL ntfs_are_names_equal(const uchar_t *s1, size_t s1_len,
  *
  * The following characters are considered invalid: '"', '*', '<', '>' and '?'.
  */
-int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
-		const uchar_t *name2, const u32 name2_len,
+int ntfs_collate_names(const ntfschar *name1, const u32 name1_len,
+		const ntfschar *name2, const u32 name2_len,
 		const int err_val, const IGNORE_CASE_BOOL ic,
-		const uchar_t *upcase, const u32 upcase_len)
+		const ntfschar *upcase, const u32 upcase_len)
 {
 	u32 cnt, min_len;
-	uchar_t c1, c2;
+	ntfschar c1, c2;
 
 	min_len = name1_len;
 	if (name1_len > name2_len)
@@ -138,14 +137,14 @@ int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
  * Compare the first @n characters of the Unicode strings @s1 and @s2,
  * The strings in little endian format and appropriate le16_to_cpu()
  * conversion is performed on non-little endian machines.
- * 
+ *
  * The function returns an integer less than, equal to, or greater than zero
  * if @s1 (or the first @n Unicode characters thereof) is found, respectively,
  * to be less than, to match, or be greater than @s2.
  */
-int ntfs_ucsncmp(const uchar_t *s1, const uchar_t *s2, size_t n)
+int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n)
 {
-	uchar_t c1, c2;
+	ntfschar c1, c2;
 	size_t i;
 
 	for (i = 0; i < n; ++i) {
@@ -172,17 +171,17 @@ int ntfs_ucsncmp(const uchar_t *s1, const uchar_t *s2, size_t n)
  * Compare the first @n characters of the Unicode strings @s1 and @s2,
  * ignoring case. The strings in little endian format and appropriate
  * le16_to_cpu() conversion is performed on non-little endian machines.
- * 
+ *
  * Each character is uppercased using the @upcase table before the comparison.
  *
  * The function returns an integer less than, equal to, or greater than zero
  * if @s1 (or the first @n Unicode characters thereof) is found, respectively,
  * to be less than, to match, or be greater than @s2.
  */
-int ntfs_ucsncasecmp(const uchar_t *s1, const uchar_t *s2, size_t n,
-		     const uchar_t *upcase, const u32 upcase_size)
+int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n,
+		const ntfschar *upcase, const u32 upcase_size)
 {
-	uchar_t c1, c2;
+	ntfschar c1, c2;
 	size_t i;
 
 	for (i = 0; i < n; ++i) {
@@ -200,11 +199,11 @@ int ntfs_ucsncasecmp(const uchar_t *s1, const uchar_t *s2, size_t n,
 	return 0;
 }
 
-void ntfs_upcase_name(uchar_t *name, u32 name_len, const uchar_t *upcase,
+void ntfs_upcase_name(ntfschar *name, u32 name_len, const ntfschar *upcase,
 		const u32 upcase_len)
 {
 	u32 i;
-	uchar_t u;
+	ntfschar u;
 
 	for (i = 0; i < name_len; i++)
 		if ((u = le16_to_cpu(name[i])) < upcase_len)
@@ -212,20 +211,20 @@ void ntfs_upcase_name(uchar_t *name, u32 name_len, const uchar_t *upcase,
 }
 
 void ntfs_file_upcase_value(FILE_NAME_ATTR *file_name_attr,
-		const uchar_t *upcase, const u32 upcase_len)
+		const ntfschar *upcase, const u32 upcase_len)
 {
-	ntfs_upcase_name((uchar_t*)&file_name_attr->file_name,
+	ntfs_upcase_name((ntfschar*)&file_name_attr->file_name,
 			file_name_attr->file_name_length, upcase, upcase_len);
 }
 
 int ntfs_file_compare_values(FILE_NAME_ATTR *file_name_attr1,
 		FILE_NAME_ATTR *file_name_attr2,
 		const int err_val, const IGNORE_CASE_BOOL ic,
-		const uchar_t *upcase, const u32 upcase_len)
+		const ntfschar *upcase, const u32 upcase_len)
 {
-	return ntfs_collate_names((uchar_t*)&file_name_attr1->file_name,
+	return ntfs_collate_names((ntfschar*)&file_name_attr1->file_name,
 			file_name_attr1->file_name_length,
-			(uchar_t*)&file_name_attr2->file_name,
+			(ntfschar*)&file_name_attr2->file_name,
 			file_name_attr2->file_name_length,
 			err_val, ic, upcase, upcase_len);
 }
@@ -254,16 +253,16 @@ int ntfs_file_compare_values(FILE_NAME_ATTR *file_name_attr1,
  * This might look a bit odd due to fast path optimization...
  */
 int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
-		const int ins_len, uchar_t **outs)
+		const int ins_len, ntfschar **outs)
 {
 	struct nls_table *nls = vol->nls_map;
-	uchar_t *ucs;
+	ntfschar *ucs;
 	wchar_t wc;
 	int i, o, wc_len;
 
 	/* We don't trust outside sources. */
 	if (ins) {
-		ucs = (uchar_t*)kmem_cache_alloc(ntfs_name_cache, SLAB_NOFS);
+		ucs = (ntfschar*)kmem_cache_alloc(ntfs_name_cache, SLAB_NOFS);
 		if (ucs) {
 			for (i = o = 0; i < ins_len; i += wc_len) {
 				wc_len = nls->char2uni(ins + i, ins_len - i,
@@ -319,7 +318,7 @@ conversion_err:
  *
  * This might look a bit odd due to fast path optimization...
  */
-int ntfs_ucstonls(const ntfs_volume *vol, const uchar_t *ins,
+int ntfs_ucstonls(const ntfs_volume *vol, const ntfschar *ins,
 		const int ins_len, unsigned char **outs, int outs_len)
 {
 	struct nls_table *nls = vol->nls_map;
@@ -381,4 +380,3 @@ mem_err_out:
 	ntfs_error(vol->sb, "Failed to allocate name!");
 	return -ENOMEM;
 }
-
diff --git a/fs/ntfs/upcase.c b/fs/ntfs/upcase.c
index 44789837e..5481f2de8 100644
--- a/fs/ntfs/upcase.c
+++ b/fs/ntfs/upcase.c
@@ -26,7 +26,7 @@
 
 #include "ntfs.h"
 
-uchar_t *generate_default_upcase(void)
+ntfschar *generate_default_upcase(void)
 {
 	static const int uc_run_table[][3] = { /* Start, End, Add */
 	{0x0061, 0x007B,  -32}, {0x0451, 0x045D, -80}, {0x1F70, 0x1F72,  74},
@@ -68,12 +68,12 @@ uchar_t *generate_default_upcase(void)
 	};
 
 	int i, r;
-	uchar_t *uc;
+	ntfschar *uc;
 
-	uc = ntfs_malloc_nofs(default_upcase_len * sizeof(uchar_t));
+	uc = ntfs_malloc_nofs(default_upcase_len * sizeof(ntfschar));
 	if (!uc)
 		return uc;
-	memset(uc, 0, default_upcase_len * sizeof(uchar_t));
+	memset(uc, 0, default_upcase_len * sizeof(ntfschar));
 	for (i = 0; i < default_upcase_len; i++)
 		uc[i] = cpu_to_le16(i);
 	for (r = 0; uc_run_table[r][0]; r++)
diff --git a/fs/ntfs/volume.h b/fs/ntfs/volume.h
index e5a237357..7bd6a80df 100644
--- a/fs/ntfs/volume.h
+++ b/fs/ntfs/volume.h
@@ -2,8 +2,8 @@
  * volume.h - Defines for volume structures in NTFS Linux kernel driver. Part
  *	      of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov.
- * Copyright (c) 2002 Richard Russon.
+ * Copyright (c) 2001-2004 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -72,7 +72,7 @@ typedef struct {
 	u64 serial_no;			/* The volume serial number. */
 	/* Mount specific NTFS information. */
 	u32 upcase_len;			/* Number of entries in upcase[]. */
-	uchar_t *upcase;		/* The upcase table. */
+	ntfschar *upcase;		/* The upcase table. */
 	LCN mft_zone_start;		/* First cluster of the mft zone. */
 	LCN mft_zone_end;		/* First cluster beyond the mft zone. */
 	struct inode *mft_ino;		/* The VFS inode of $MFT. */
diff --git a/fs/open.c b/fs/open.c
index 66a77f563..854c5de74 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -23,6 +23,8 @@
 #include <linux/fs.h>
 #include <linux/pagemap.h>
 
+#include <asm/unistd.h>
+
 int vfs_statfs(struct super_block *sb, struct kstatfs *buf)
 {
 	int retval = -ENODEV;
@@ -335,7 +337,7 @@ asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length)
 }
 #endif
 
-#if !(defined(__alpha__) || defined(__ia64__))
+#ifdef __ARCH_WANT_SYS_UTIME
 
 /*
  * sys_utime() can be implemented in user-level using sys_utimes().
@@ -788,7 +790,6 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
 	}
 
 	f->f_mapping = inode->i_mapping;
-	file_ra_state_init(&f->f_ra, f->f_mapping);
 	f->f_dentry = dentry;
 	f->f_vfsmnt = mnt;
 	f->f_pos = 0;
@@ -802,12 +803,13 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
 	}
 	f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
 
+	file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);
+
 	/* NB: we're sure to have correct a_ops only after f_op->open */
 	if (f->f_flags & O_DIRECT) {
-		if (!f->f_mapping || !f->f_mapping->a_ops ||
-			!f->f_mapping->a_ops->direct_IO) {
-				fput(f);
-				f = ERR_PTR(-EINVAL);
+		if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO) {
+			fput(f);
+			f = ERR_PTR(-EINVAL);
 		}
 	}
 
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 3526d3663..b16b949f0 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -367,6 +367,9 @@ void register_disk(struct gendisk *disk)
 		return;
 
 	bdev = bdget_disk(disk, 0);
+	if (!bdev)
+		return;
+
 	if (blkdev_get(bdev, FMODE_READ, 0) < 0)
 		return;
 	state = check_partition(disk, bdev);
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 3ed5cb52a..e98505bf8 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -389,8 +389,23 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 		put_dev_sector(sect);
 		return 0;
 	}
+
+	/*
+	 * Now that the 55aa signature is present, this is probably
+	 * either the boot sector of a FAT filesystem or a DOS-type
+	 * partition table. Reject this in case the boot indicator
+	 * is not 0 or 0x80.
+	 */
 	p = (struct partition *) (data + 0x1be);
+	for (slot = 1; slot <= 4; slot++, p++) {
+		if (p->boot_ind != 0 && p->boot_ind != 0x80) {
+			put_dev_sector(sect);
+			return 0;
+		}
+	}
+
 #ifdef CONFIG_EFI_PARTITION
+	p = (struct partition *) (data + 0x1be);
 	for (slot = 1 ; slot <= 4 ; slot++, p++) {
 		/* If this is an EFI GPT disk, msdos should ignore it. */
 		if (SYS_IND(p) == EFI_PMBR_OSTYPE_EFI_GPT) {
@@ -398,8 +413,8 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 			return 0;
 		}
 	}
-	p = (struct partition *) (data + 0x1be);
 #endif
+	p = (struct partition *) (data + 0x1be);
 
 	/*
 	 * Look for partitions in two passes:
@@ -407,8 +422,8 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 	 * On the second pass look inside *BSD, Unixware and Solaris partitions.
 	 */
 
-	state->next = 5;
-	for (slot = 1 ; slot <= 4 ; slot++, p++) {
+	state->next = DOS_EXTENDED_PARTITION;
+	for (slot = 1 ; slot < DOS_EXTENDED_PARTITION ; slot++, p++) {
 		u32 start = START_SECT(p)*sector_size;
 		u32 size = NR_SECTS(p)*sector_size;
 		if (!size)
@@ -435,7 +450,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 
 	/* second pass - output for each on a separate line */
 	p = (struct partition *) (0x1be + data);
-	for (slot = 1 ; slot <= 4 ; slot++, p++) {
+	for (slot = 1 ; slot < DOS_EXTENDED_PARTITION ; slot++, p++) {
 		unsigned char id = SYS_IND(p);
 		int n;
 
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 6bdd15bfb..fbcf8bea0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -149,6 +149,7 @@ static inline const char * get_task_state(struct task_struct *tsk)
 
 static inline char * task_state(struct task_struct *p, char *buffer)
 {
+	struct group_info *group_info;
 	int g;
 
 	read_lock(&tasklist_lock);
@@ -174,12 +175,14 @@ static inline char * task_state(struct task_struct *p, char *buffer)
 		"FDSize:\t%d\n"
 		"Groups:\t",
 		p->files ? p->files->max_fds : 0);
+
+	group_info = p->group_info;
+	get_group_info(group_info);
 	task_unlock(p);
 
-	get_group_info(p->group_info);
-	for (g = 0; g < min(p->group_info->ngroups,NGROUPS_SMALL); g++)
-		buffer += sprintf(buffer, "%d ", GROUP_AT(p->group_info,g));
-	put_group_info(p->group_info);
+	for (g = 0; g < min(group_info->ngroups,NGROUPS_SMALL); g++)
+		buffer += sprintf(buffer, "%d ", GROUP_AT(group_info,g));
+	put_group_info(group_info);
 
 	buffer += sprintf(buffer, "\n");
 	return buffer;
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7ff742cec..5d6223272 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -511,7 +511,7 @@ static struct file_operations proc_mounts_operations = {
 
 #define PROC_BLOCK_SIZE	(3*1024)		/* 4K page size but our output routines use some slack for overruns */
 
-static ssize_t proc_info_read(struct file * file, char * buf,
+static ssize_t proc_info_read(struct file * file, char __user * buf,
 			  size_t count, loff_t *ppos)
 {
 	struct inode * inode = file->f_dentry->d_inode;
@@ -557,7 +557,7 @@ static int mem_open(struct inode* inode, struct file* file)
 	return 0;
 }
 
-static ssize_t mem_read(struct file * file, char * buf,
+static ssize_t mem_read(struct file * file, char __user * buf,
 			size_t count, loff_t *ppos)
 {
 	struct task_struct *task = proc_task(file->f_dentry->d_inode);
@@ -710,7 +710,7 @@ out:
 }
 
 static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt,
-			    char *buffer, int buflen)
+			    char __user *buffer, int buflen)
 {
 	struct inode * inode;
 	char *tmp = (char*)__get_free_page(GFP_KERNEL), *path;
@@ -735,7 +735,7 @@ static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt,
 	return len;
 }
 
-static int proc_pid_readlink(struct dentry * dentry, char * buffer, int buflen)
+static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int buflen)
 {
 	int error = -EACCES;
 	struct inode *inode = dentry->d_inode;
@@ -1162,7 +1162,7 @@ static struct inode_operations proc_task_inode_operations = {
 };
 
 #ifdef CONFIG_SECURITY
-static ssize_t proc_pid_attr_read(struct file * file, char * buf,
+static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
 				  size_t count, loff_t *ppos)
 {
 	struct inode * inode = file->f_dentry->d_inode;
@@ -1199,7 +1199,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char * buf,
 	return count;
 }
 
-static ssize_t proc_pid_attr_write(struct file * file, const char * buf,
+static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
 				   size_t count, loff_t *ppos)
 { 
 	struct inode * inode = file->f_dentry->d_inode;
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index f6e81e900..1f55db799 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -183,7 +183,11 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
 	elf->e_entry	= 0;
 	elf->e_phoff	= sizeof(struct elfhdr);
 	elf->e_shoff	= 0;
+#if defined(CONFIG_H8300)
+	elf->e_flags	= ELF_FLAGS;
+#else
 	elf->e_flags	= 0;
+#endif
 	elf->e_ehsize	= sizeof(struct elfhdr);
 	elf->e_phentsize= sizeof(struct elf_phdr);
 	elf->e_phnum	= nphdr;
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index d6b65c00e..60e38c796 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -390,7 +390,7 @@ int show_stat(struct seq_file *p, void *v)
 		(unsigned long long)jiffies_64_to_clock_t(iowait),
 		(unsigned long long)jiffies_64_to_clock_t(irq),
 		(unsigned long long)jiffies_64_to_clock_t(softirq));
-	for_each_cpu(i) {
+	for_each_online_cpu(i) {
 
 		/* Copy values here to work around gcc-2.95.3, gcc-2.96 */
 		user = kstat_cpu(i).cpustat.user;
@@ -631,7 +631,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
 
 		if (get_user(c, buf))
 			return -EFAULT;
-		handle_sysrq(c, NULL, NULL);
+		__handle_sysrq(c, NULL, NULL);
 	}
 	return count;
 }
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 1a7440ae3..bbdfc9431 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -65,7 +65,7 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
 				*shared += pages;
 			continue;
 		}
-		if (vma->vm_flags & VM_SHARED || !list_empty(&vma->shared))
+		if (vma->vm_file)
 			*shared += pages;
 		if (vma->vm_flags & VM_EXECUTABLE)
 			*text += pages;
diff --git a/fs/quota_v1.c b/fs/quota_v1.c
index 2ffb492c8..7c7de9102 100644
--- a/fs/quota_v1.c
+++ b/fs/quota_v1.c
@@ -52,6 +52,8 @@ static int v1_read_dqblk(struct dquot *dquot)
 
 	/* Now we are sure filp is valid */
 	offset = v1_dqoff(dquot->dq_id);
+	/* Set structure to 0s in case read fails/is after end of file */
+	memset(&dqblk, 0, sizeof(struct v1_disk_dqblk));
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 	filp->f_op->read(filp, (char *)&dqblk, sizeof(struct v1_disk_dqblk), &offset);
diff --git a/fs/quota_v2.c b/fs/quota_v2.c
index e5098413a..679d31aca 100644
--- a/fs/quota_v2.c
+++ b/fs/quota_v2.c
@@ -135,7 +135,7 @@ static void mem2diskdqb(struct v2_disk_dqblk *d, struct mem_dqblk *m, qid_t id)
 
 static dqbuf_t getdqbuf(void)
 {
-	dqbuf_t buf = kmalloc(V2_DQBLKSIZE, GFP_KERNEL);
+	dqbuf_t buf = kmalloc(V2_DQBLKSIZE, GFP_NOFS);
 	if (!buf)
 		printk(KERN_WARNING "VFS: Not enough memory for quota buffers.\n");
 	return buf;
@@ -420,7 +420,7 @@ static int v2_write_dquot(struct dquot *dquot)
 	mm_segment_t fs;
 	loff_t offset;
 	ssize_t ret;
-	struct v2_disk_dqblk ddquot;
+	struct v2_disk_dqblk ddquot, empty;
 
 	/* dq_off is guarded by dqio_sem */
 	if (!dquot->dq_off)
@@ -432,6 +432,12 @@ static int v2_write_dquot(struct dquot *dquot)
 	offset = dquot->dq_off;
 	spin_lock(&dq_data_lock);
 	mem2diskdqb(&ddquot, &dquot->dq_dqb, dquot->dq_id);
+	/* Argh... We may need to write structure full of zeroes but that would be
+	 * treated as an empty place by the rest of the code. Format change would
+	 * be definitely cleaner but the problems probably are not worth it */
+	memset(&empty, 0, sizeof(struct v2_disk_dqblk));
+	if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk)))
+		ddquot.dqb_itime = cpu_to_le64(1);
 	spin_unlock(&dq_data_lock);
 	fs = get_fs();
 	set_fs(KERNEL_DS);
@@ -622,7 +628,7 @@ static int v2_read_dquot(struct dquot *dquot)
 	struct file *filp;
 	mm_segment_t fs;
 	loff_t offset;
-	struct v2_disk_dqblk ddquot;
+	struct v2_disk_dqblk ddquot, empty;
 	int ret = 0;
 
 	filp = sb_dqopt(dquot->dq_sb)->files[type];
@@ -652,8 +658,14 @@ static int v2_read_dquot(struct dquot *dquot)
 			printk(KERN_ERR "VFS: Error while reading quota structure for id %u.\n", dquot->dq_id);
 			memset(&ddquot, 0, sizeof(struct v2_disk_dqblk));
 		}
-		else
+		else {
 			ret = 0;
+			/* We need to escape back all-zero structure */
+			memset(&empty, 0, sizeof(struct v2_disk_dqblk));
+			empty.dqb_itime = cpu_to_le64(1);
+			if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk)))
+				ddquot.dqb_itime = 0;
+		}
 		set_fs(fs);
 		disk2memdqb(&dquot->dq_dqb, &ddquot);
 		if (!dquot->dq_dqb.dqb_bhardlimit &&
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index a652b2e39..c8e04d6c5 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -181,6 +181,7 @@ static int ramfs_fill_super(struct super_block * sb, void * data, int silent)
 	struct inode * inode;
 	struct dentry * root;
 
+	sb->s_maxbytes = MAX_LFS_FILESIZE;
 	sb->s_blocksize = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
 	sb->s_magic = RAMFS_MAGIC;
diff --git a/fs/read_write.c b/fs/read_write.c
index a30ab9df4..f765a22b4 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 
 struct file_operations generic_ro_fops = {
 	.llseek		= generic_file_llseek,
@@ -145,7 +146,7 @@ bad:
 }
 EXPORT_SYMBOL_GPL(sys_lseek);
 
-#if !defined(__alpha__)
+#ifdef __ARCH_WANT_SYS_LLSEEK
 asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
 			   unsigned long offset_low, loff_t __user * result,
 			   unsigned int origin)
diff --git a/fs/readdir.c b/fs/readdir.c
index f02cae6b6..fbea474bd 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -14,6 +14,7 @@
 #include <linux/fs.h>
 #include <linux/dirent.h>
 #include <linux/security.h>
+#include <linux/unistd.h>
 
 #include <asm/uaccess.h>
 
@@ -49,10 +50,10 @@ EXPORT_SYMBOL(vfs_readdir);
  * anyway. Thus the special "fillonedir()" function for that
  * case (the low-level handlers don't need to care about this).
  */
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
 #define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1))
 
-#ifndef __ia64__
+#ifdef __ARCH_WANT_OLD_READDIR
 
 struct old_linux_dirent {
 	unsigned long	d_ino;
@@ -76,7 +77,7 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset
 		return -EINVAL;
 	buf->result++;
 	dirent = buf->dirent;
-	if (!access_ok(VERIFY_WRITE, (unsigned long)dirent,
+	if (!access_ok(VERIFY_WRITE, dirent,
 			(unsigned long)(dirent->d_name + namlen + 1) -
 				(unsigned long)dirent))
 		goto efault;
@@ -115,7 +116,7 @@ out:
 	return error;
 }
 
-#endif /* !__ia64__ */
+#endif /* __ARCH_WANT_OLD_READDIR */
 
 /*
  * New, all-improved, singing, dancing, iBCS2-compliant getdents()
@@ -159,7 +160,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
 		goto efault;
 	if (__put_user(0, dirent->d_name + namlen))
 		goto efault;
-	if (__put_user(d_type, (char *) dirent + reclen - 1))
+	if (__put_user(d_type, (char __user *) dirent + reclen - 1))
 		goto efault;
 	buf->previous = dirent;
 	dirent = (void __user *)dirent + reclen;
diff --git a/fs/reiserfs/Makefile b/fs/reiserfs/Makefile
index 8dd067666..3a59309f3 100644
--- a/fs/reiserfs/Makefile
+++ b/fs/reiserfs/Makefile
@@ -9,6 +9,18 @@ reiserfs-objs := bitmap.o do_balan.o namei.o inode.o file.o dir.o fix_node.o \
 		 hashes.o tail_conversion.o journal.o resize.o \
 		 item_ops.o ioctl.o procfs.o
 
+ifeq ($(CONFIG_REISERFS_FS_XATTR),y)
+reiserfs-objs += xattr.o xattr_user.o xattr_trusted.o
+endif
+
+ifeq ($(CONFIG_REISERFS_FS_SECURITY),y)
+reiserfs-objs += xattr_security.o
+endif
+
+ifeq ($(CONFIG_REISERFS_FS_POSIX_ACL),y)
+reiserfs-objs += xattr_acl.o
+endif
+
 # gcc -O2 (the kernel default)  is overaggressive on ppc32 when many inline
 # functions are used.  This causes the compiler to advance the stack
 # pointer out of the available stack space, corrupting kernel space,
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 0550e20ec..86639019d 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -12,6 +12,7 @@
 #include <linux/pagemap.h>
 #include <linux/reiserfs_fs_sb.h>
 #include <linux/reiserfs_fs_i.h>
+#include <linux/quotaops.h>
 
 #define PREALLOCATION_SIZE 9
 
@@ -36,7 +37,7 @@
 
 #define SET_OPTION(optname) \
    do { \
-        reiserfs_warning("reiserfs: option \"%s\" is set\n", #optname); \
+        reiserfs_warning(s, "reiserfs: option \"%s\" is set", #optname); \
         set_bit(_ALLOC_ ## optname , &SB_ALLOC_OPTS(s)); \
     } while(0)
 #define TEST_OPTION(optname, s) \
@@ -59,7 +60,7 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
     int i, j;
 
     if (block == 0 || block >= SB_BLOCK_COUNT (s)) {
-	reiserfs_warning ("vs-4010: is_reusable: block number is out of range %lu (%u)\n",
+	reiserfs_warning (s, "vs-4010: is_reusable: block number is out of range %lu (%u)",
 			  block, SB_BLOCK_COUNT (s));
 	return 0;
     }
@@ -67,8 +68,8 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
     /* it can't be one of the bitmap blocks */
     for (i = 0; i < SB_BMAP_NR (s); i ++)
 	if (block == SB_AP_BITMAP (s)[i].bh->b_blocknr) {
-	    reiserfs_warning ("vs: 4020: is_reusable: "
-			      "bitmap block %lu(%u) can't be freed or reused\n",
+	    reiserfs_warning (s, "vs: 4020: is_reusable: "
+			      "bitmap block %lu(%u) can't be freed or reused",
 			      block, SB_BMAP_NR (s));
 	    return 0;
 	}
@@ -76,8 +77,8 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
     get_bit_address (s, block, &i, &j);
 
     if (i >= SB_BMAP_NR (s)) {
-	reiserfs_warning ("vs-4030: is_reusable: there is no so many bitmap blocks: "
-			  "block=%lu, bitmap_nr=%d\n", block, i);
+	reiserfs_warning (s, "vs-4030: is_reusable: there is no so many bitmap blocks: "
+			  "block=%lu, bitmap_nr=%d", block, i);
 	return 0;
     }
 
@@ -85,16 +86,16 @@ int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value)
          reiserfs_test_le_bit(j, SB_AP_BITMAP(s)[i].bh->b_data)) ||
 	(bit_value == 1 && 
 	 reiserfs_test_le_bit(j, SB_AP_BITMAP (s)[i].bh->b_data) == 0)) {
-	reiserfs_warning ("vs-4040: is_reusable: corresponding bit of block %lu does not "
-			  "match required value (i==%d, j==%d) test_bit==%d\n",
+	reiserfs_warning (s, "vs-4040: is_reusable: corresponding bit of block %lu does not "
+			  "match required value (i==%d, j==%d) test_bit==%d",
 		block, i, j, reiserfs_test_le_bit (j, SB_AP_BITMAP (s)[i].bh->b_data));
 
 	return 0;
     }
 
     if (bit_value == 0 && block == SB_ROOT_BLOCK (s)) {
-	reiserfs_warning ("vs-4050: is_reusable: this is root block (%u), "
-			  "it must be busy\n", SB_ROOT_BLOCK (s));
+	reiserfs_warning (s, "vs-4050: is_reusable: this is root block (%u), "
+			  "it must be busy", SB_ROOT_BLOCK (s));
 	return 0;
     }
 
@@ -133,7 +134,7 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
     int end, next;
     int org = *beg;
 
-    RFALSE(bmap_n >= SB_BMAP_NR (s), "Bitmap %d is out of range (0..%d)\n",bmap_n, SB_BMAP_NR (s) - 1);
+    RFALSE(bmap_n >= SB_BMAP_NR (s), "Bitmap %d is out of range (0..%d)",bmap_n, SB_BMAP_NR (s) - 1);
     PROC_INFO_INC( s, scan_bitmap.bmap );
 /* this is unclear and lacks comments, explain how journal bitmaps
    work here for the reader.  Convey a sense of the design here. What
@@ -141,7 +142,7 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
 /* - I mean `a window of zero bits' as in description of this function - Zam. */
   
     if ( !bi ) {
-	printk("Hey, bitmap info pointer is zero for bitmap %d!\n",bmap_n);
+	reiserfs_warning (s, "NULL bitmap info pointer for bitmap %d", bmap_n);
 	return 0;
     }
     if (buffer_locked (bi->bh)) {
@@ -281,7 +282,8 @@ static int scan_bitmap (struct reiserfs_transaction_handle *th,
 }
 
 static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
-				  b_blocknr_t block)
+				  struct inode *inode, b_blocknr_t block,
+				  int for_unformatted)
 {
     struct super_block * s = th->t_super;
     struct reiserfs_super_block * rs;
@@ -298,8 +300,8 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
     get_bit_address (s, block, &nr, &offset);
 
     if (nr >= sb_bmap_nr (rs)) {
-	reiserfs_warning ("vs-4075: reiserfs_free_block: "
-			  "block %lu is out of range on %s\n", 
+	reiserfs_warning (s, "vs-4075: reiserfs_free_block: "
+			  "block %lu is out of range on %s",
 			  block, reiserfs_bdevname (s));
 	return;
     }
@@ -308,8 +310,8 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
 
     /* clear bit for the given block in bit map */
     if (!reiserfs_test_and_clear_le_bit (offset, apbi[nr].bh->b_data)) {
-	reiserfs_warning ("vs-4080: reiserfs_free_block: "
-			  "free_block (%s:%lu)[dev:blocknr]: bit already cleared\n", 
+	reiserfs_warning (s, "vs-4080: reiserfs_free_block: "
+			  "free_block (%s:%lu)[dev:blocknr]: bit already cleared",
 			  reiserfs_bdevname (s), block);
     }
     if (offset < apbi[nr].first_zero_hint) {
@@ -323,11 +325,13 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
     set_sb_free_blocks( rs, sb_free_blocks(rs) + 1 );
 
     journal_mark_dirty (th, s, sbh);
-  s->s_dirt = 1;
+    if (for_unformatted)
+        DQUOT_FREE_BLOCK_NODIRTY(inode, 1);
 }
 
 void reiserfs_free_block (struct reiserfs_transaction_handle *th, 
-                          b_blocknr_t block)
+			  struct inode *inode, b_blocknr_t block,
+			  int for_unformatted)
 {
     struct super_block * s = th->t_super;
 
@@ -335,42 +339,46 @@ void reiserfs_free_block (struct reiserfs_transaction_handle *th,
     RFALSE(is_reusable (s, block, 1) == 0, "vs-4071: can not free such block");
     /* mark it before we clear it, just in case */
     journal_mark_freed(th, s, block) ;
-    _reiserfs_free_block(th, block) ;
+    _reiserfs_free_block(th, inode, block, for_unformatted) ;
 }
 
 /* preallocated blocks don't need to be run through journal_mark_freed */
 void reiserfs_free_prealloc_block (struct reiserfs_transaction_handle *th, 
-                          b_blocknr_t block) {
+			  struct inode *inode, b_blocknr_t block) {
     RFALSE(!th->t_super, "vs-4060: trying to free block on nonexistent device");
     RFALSE(is_reusable (th->t_super, block, 1) == 0, "vs-4070: can not free such block");
-    _reiserfs_free_block(th, block) ;
+    _reiserfs_free_block(th, inode, block, 1) ;
 }
 
 static void __discard_prealloc (struct reiserfs_transaction_handle * th,
 				struct reiserfs_inode_info *ei)
 {
     unsigned long save = ei->i_prealloc_block ;
+    int dirty = 0;
+    struct inode *inode = &ei->vfs_inode;
 #ifdef CONFIG_REISERFS_CHECK
     if (ei->i_prealloc_count < 0)
-	reiserfs_warning("zam-4001:%s: inode has negative prealloc blocks count.\n", __FUNCTION__ );
+	reiserfs_warning (th->t_super, "zam-4001:%s: inode has negative prealloc blocks count.", __FUNCTION__ );
 #endif
     while (ei->i_prealloc_count > 0) {
-	reiserfs_free_prealloc_block(th,ei->i_prealloc_block);
+	reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block);
 	ei->i_prealloc_block++;
 	ei->i_prealloc_count --;
+	dirty = 1;
     }
+    if (dirty)
+    	reiserfs_update_sd(th, inode);
     ei->i_prealloc_block = save;
     list_del_init(&(ei->i_prealloc_list));
 }
 
 /* FIXME: It should be inline function */
 void reiserfs_discard_prealloc (struct reiserfs_transaction_handle *th, 
-				struct inode * inode)
+				struct inode *inode)
 {
     struct reiserfs_inode_info *ei = REISERFS_I(inode);
-    if (ei->i_prealloc_count) {
+    if (ei->i_prealloc_count)
 	__discard_prealloc(th, ei);
-    }
 }
 
 void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th)
@@ -382,7 +390,7 @@ void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th)
 	ei = list_entry(plist->next, struct reiserfs_inode_info, i_prealloc_list);
 #ifdef CONFIG_REISERFS_CHECK
 	if (!ei->i_prealloc_count) {
-	    reiserfs_warning("zam-4001:%s: inode is in prealloc list but has no preallocated blocks.\n", __FUNCTION__);
+	    reiserfs_warning (th->t_super, "zam-4001:%s: inode is in prealloc list but has no preallocated blocks.", __FUNCTION__);
 	}
 #endif
 	__discard_prealloc(th, ei);
@@ -468,7 +476,8 @@ int reiserfs_parse_alloc_options(struct super_block * s, char * options)
 	    continue;
 	}
 
-	reiserfs_warning("zam-4001: %s : unknown option - %s\n", __FUNCTION__ , this_char);
+	reiserfs_warning (s, "zam-4001: %s : unknown option - %s",
+			  __FUNCTION__ , this_char);
 	return 1;
       }
   
@@ -508,7 +517,7 @@ static inline void get_left_neighbor(reiserfs_blocknr_hint_t *hint)
 
     path = hint->path;
     bh = get_last_bh(path);
-    RFALSE( !bh, "green-4002: Illegal path specified to get_left_neighbor\n");
+    RFALSE( !bh, "green-4002: Illegal path specified to get_left_neighbor");
     ih = get_ih(path);
     pos_in_item = path->pos_in_item;
     item = get_item (path);
@@ -772,6 +781,24 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
     int nr_allocated = 0;
 
     determine_prealloc_size(hint);
+    if (!hint->formatted_node) {
+        int quota_ret;
+#ifdef REISERQUOTA_DEBUG
+	reiserfs_debug (s, "reiserquota: allocating %d blocks id=%u", amount_needed, hint->inode->i_uid);
+#endif
+	quota_ret = DQUOT_ALLOC_BLOCK_NODIRTY(hint->inode, amount_needed);
+	if (quota_ret)    /* Quota exceeded? */
+	    return QUOTA_EXCEEDED;
+	if (hint->preallocate && hint->prealloc_size ) {
+#ifdef REISERQUOTA_DEBUG
+	    reiserfs_debug (s, "reiserquota: allocating (prealloc) %d blocks id=%u", hint->prealloc_size, hint->inode->i_uid);
+#endif
+	    quota_ret = DQUOT_PREALLOC_BLOCK_NODIRTY(hint->inode, hint->prealloc_size);
+	    if (quota_ret)
+		hint->preallocate=hint->prealloc_size=0;
+	}
+    }
+
     while((nr_allocated
 	  += allocate_without_wrapping_disk(hint, new_blocknrs + nr_allocated, start, finish,
 					  amount_needed - nr_allocated, hint->prealloc_size))
@@ -779,8 +806,14 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
 
 	/* not all blocks were successfully allocated yet*/
 	if (second_pass) {	/* it was a second pass; we must free all blocks */
+	    if (!hint->formatted_node) {
+#ifdef REISERQUOTA_DEBUG
+		reiserfs_debug (s, "reiserquota: freeing (nospace) %d blocks id=%u", amount_needed + hint->prealloc_size - nr_allocated, hint->inode->i_uid);
+#endif
+		DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + hint->prealloc_size - nr_allocated);     /* Free not allocated blocks */
+	    }
 	    while (nr_allocated --)
-		reiserfs_free_block(hint->th, new_blocknrs[nr_allocated]);
+		reiserfs_free_block(hint->th, hint->inode, new_blocknrs[nr_allocated], !hint->formatted_node);
 
 	    return NO_DISK_SPACE;
 	} else {		/* refine search parameters for next pass */
@@ -789,7 +822,19 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
 	    start = 0;
 	    continue;
 	}
-      }
+    }
+    if ( !hint->formatted_node &&
+         amount_needed + hint->prealloc_size >
+	 nr_allocated + REISERFS_I(hint->inode)->i_prealloc_count) {
+    /* Some of preallocation blocks were not allocated */
+#ifdef REISERQUOTA_DEBUG
+	reiserfs_debug (s, "reiserquota: freeing (failed prealloc) %d blocks id=%u", amount_needed + hint->prealloc_size - nr_allocated - INODE_INFO(hint->inode)->i_prealloc_count, hint->inode->i_uid);
+#endif
+	DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed +
+	                         hint->prealloc_size - nr_allocated -
+				 REISERFS_I(hint->inode)->i_prealloc_count);
+    }
+
     return CARRY_ON;
 }
 
@@ -858,7 +903,7 @@ int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *hint,
 
     if (ret != CARRY_ON) {
 	while (amount_needed ++ < initial_amount_needed) {
-	    reiserfs_free_block(hint->th, *(--new_blocknrs));
+	    reiserfs_free_block(hint->th, hint->inode, *(--new_blocknrs), 1);
 	}
     }
     return ret;
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index 3147195da..12090d1f1 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -54,7 +54,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
 
     reiserfs_write_lock(inode->i_sb);
 
-    reiserfs_check_lock_depth("readdir") ;
+    reiserfs_check_lock_depth(inode->i_sb, "readdir") ;
 
     /* form key for search the next directory entry using f_pos field of
        file structure */
@@ -62,7 +62,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
 		  TYPE_DIRENTRY, 3);
     next_pos = cpu_key_k_offset (&pos_key);
 
-    /*  reiserfs_warning ("reiserfs_readdir 1: f_pos = %Ld\n", filp->f_pos);*/
+    /*  reiserfs_warning (inode->i_sb, "reiserfs_readdir 1: f_pos = %Ld", filp->f_pos);*/
 
     while (1) {
     research:
@@ -115,6 +115,17 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
 		    /* too big to send back to VFS */
 		    continue ;
 		}
+
+                /* Ignore the .reiserfs_priv entry */
+                if (reiserfs_xattrs (inode->i_sb) &&
+                    !old_format_only(inode->i_sb) &&
+                    filp->f_dentry == inode->i_sb->s_root &&
+                    REISERFS_SB(inode->i_sb)->priv_root &&
+                    REISERFS_SB(inode->i_sb)->priv_root->d_inode &&
+                    deh_objectid(deh) == le32_to_cpu (INODE_PKEY(REISERFS_SB(inode->i_sb)->priv_root->d_inode)->k_objectid)) {
+                  continue;
+                }
+
 		d_off = deh_offset (deh);
 		filp->f_pos = d_off ;
 		d_ino = deh_objectid (deh);
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 05eff4d07..58b3c4272 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -83,7 +83,7 @@ static int balance_leaf_when_delete (struct tree_balance * tb, int flag)
     struct item_head * ih;
 
     RFALSE( tb->FR[0] && B_LEVEL (tb->FR[0]) != DISK_LEAF_NODE_LEVEL + 1,
-	    "vs- 12000: level: wrong FR %z\n", tb->FR[0]);
+	    "vs- 12000: level: wrong FR %z", tb->FR[0]);
     RFALSE( tb->blknum[0] > 1,
 	    "PAP-12005: tb->blknum == %d, can not be > 1", tb->blknum[0]);
     RFALSE( ! tb->blknum[0] && ! PATH_H_PPARENT(tb->tb_path, 0),
@@ -1056,7 +1056,7 @@ static int balance_leaf (struct tree_balance * tb,
 
 	RFALSE (!buffer_journaled (S_new [i]) || buffer_journal_dirty (S_new [i]) ||
 		buffer_dirty (S_new [i]),
-		"PAP-12247: S_new[%d] : (%b)\n", i, S_new[i]);
+		"PAP-12247: S_new[%d] : (%b)", i, S_new[i]);
     }
 
     /* if the affected item was not wholly shifted then we perform all necessary operations on that part or whole of the
@@ -1215,14 +1215,14 @@ static void store_thrown (struct tree_balance * tb, struct buffer_head * bh)
     int i;
 
     if (buffer_dirty (bh))
-      printk ("store_thrown deals with dirty buffer\n");
+      reiserfs_warning (tb->tb_sb, "store_thrown deals with dirty buffer");
     for (i = 0; i < sizeof (tb->thrown)/sizeof (tb->thrown[0]); i ++)
 	if (!tb->thrown[i]) {
 	    tb->thrown[i] = bh;
 	    get_bh(bh) ; /* free_thrown puts this */
 	    return;
 	}
-    reiserfs_warning ("store_thrown: too many thrown buffers\n");
+    reiserfs_warning (tb->tb_sb, "store_thrown: too many thrown buffers");
 }
 
 static void free_thrown(struct tree_balance *tb) {
@@ -1232,9 +1232,11 @@ static void free_thrown(struct tree_balance *tb) {
 	if (tb->thrown[i]) {
 	    blocknr = tb->thrown[i]->b_blocknr ;
 	    if (buffer_dirty (tb->thrown[i]))
-	      printk ("free_thrown deals with dirty buffer %d\n", blocknr);
+	      reiserfs_warning (tb->tb_sb,
+				"free_thrown deals with dirty buffer %d",
+				blocknr);
 	    brelse(tb->thrown[i]) ; /* incremented in store_thrown */
-	    reiserfs_free_block (tb->transaction_handle, blocknr);
+	    reiserfs_free_block (tb->transaction_handle, NULL, blocknr, 0);
 	}
     }
 }
@@ -1247,10 +1249,6 @@ void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head *
     set_blkh_nr_item( blkh, 0 );
     
     clear_buffer_dirty(bh);
-    /* reiserfs_free_block is no longer schedule safe 
-    reiserfs_free_block (tb->transaction_handle, tb->tb_sb, bh->b_blocknr);
-    */
-
     store_thrown (tb, bh);
 }
 
@@ -1345,7 +1343,8 @@ static int locked_or_not_in_tree (struct buffer_head * bh, char * which)
 {
   if ( (!reiserfs_buffer_prepared(bh) && buffer_locked (bh)) ||
         !B_IS_IN_TREE (bh) ) {
-    reiserfs_warning ("vs-12339: locked_or_not_in_tree: %s (%b)\n", which, bh);
+    reiserfs_warning (NULL, "vs-12339: locked_or_not_in_tree: %s (%b)",
+                      which, bh);
     return 1;
   } 
   return 0;
@@ -1409,9 +1408,9 @@ void check_after_balance_leaf (struct tree_balance * tb)
 		    dc_size(B_N_CHILD (PATH_H_PBUFFER(tb->tb_path,1),
 			PATH_H_POSITION (tb->tb_path, 1))));
 	print_cur_tb ("12223");
-	reiserfs_warning(
+	reiserfs_warning (tb->tb_sb,
 	    "B_FREE_SPACE (PATH_H_PBUFFER(tb->tb_path,0)) = %d; "
-    	    "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d\n",
+    	    "MAX_CHILD_SIZE (%d) - dc_size( %y, %d ) [%d] = %d",
 	    left,
 	    MAX_CHILD_SIZE (PATH_H_PBUFFER(tb->tb_path,0)),
 	    PATH_H_PBUFFER(tb->tb_path,1),
@@ -1568,7 +1567,8 @@ void do_balance (struct tree_balance * tb, /* tree_balance structure */
     }
     /* if we have no real work to do  */
     if ( ! tb->insert_size[0] ) {
-	reiserfs_warning ("PAP-12350: do_balance: insert_size == 0, mode == %c",
+	reiserfs_warning (tb->tb_sb,
+			  "PAP-12350: do_balance: insert_size == 0, mode == %c",
 			  flag);
 	unfix_nodes(tb);
 	return;
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 6fa949e2a..b74f71043 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -5,12 +5,16 @@
 
 #include <linux/time.h>
 #include <linux/reiserfs_fs.h>
+#include <linux/reiserfs_acl.h>
+#include <linux/reiserfs_xattr.h>
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <linux/pagemap.h>
+#include <linux/swap.h>
 #include <linux/writeback.h>
 #include <linux/blkdev.h>
 #include <linux/buffer_head.h>
+#include <linux/quotaops.h>
 
 /*
 ** We pack the tails of files on file close, not at the time they are written.
@@ -97,51 +101,6 @@ static int reiserfs_sync_file(
   return ( n_err < 0 ) ? -EIO : 0;
 }
 
-static int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) {
-    struct inode *inode = dentry->d_inode ;
-    int error ;
-    reiserfs_write_lock(inode->i_sb);
-    if (attr->ia_valid & ATTR_SIZE) {
-	/* version 2 items will be caught by the s_maxbytes check
-	** done for us in vmtruncate
-	*/
-	if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5 &&
-	    attr->ia_size > MAX_NON_LFS) {
-	    error = -EFBIG ;
-	    goto out;
-	}
-	/* fill in hole pointers in the expanding truncate case. */
-        if (attr->ia_size > inode->i_size) {
-	    error = generic_cont_expand(inode, attr->ia_size) ;
-	    if (REISERFS_I(inode)->i_prealloc_count > 0) {
-		struct reiserfs_transaction_handle th ;
-		/* we're changing at most 2 bitmaps, inode + super */
-		journal_begin(&th, inode->i_sb, 4) ;
-		reiserfs_discard_prealloc (&th, inode);
-		journal_end(&th, inode->i_sb, 4) ;
-	    }
-	    if (error)
-	        goto out;
-	}
-    }
-
-    if ((((attr->ia_valid & ATTR_UID) && (attr->ia_uid & ~0xffff)) ||
-	 ((attr->ia_valid & ATTR_GID) && (attr->ia_gid & ~0xffff))) &&
-	(get_inode_sd_version (inode) == STAT_DATA_V1)) {
-		/* stat data of format v3.5 has 16 bit uid and gid */
-	    error = -EINVAL;
-	    goto out;	
-	}
-
-    error = inode_change_ok(inode, attr) ;
-    if (!error)
-        inode_setattr(inode, attr) ;
-
-out:
-    reiserfs_write_unlock(inode->i_sb);
-    return error ;
-}
-
 /* I really do not want to play with memory shortage right now, so
    to simplify the code, we are not going to write more than this much pages at
    a time. This still should considerably improve performance compared to 4k
@@ -317,7 +276,7 @@ int reiserfs_allocate_blocks_for_region(
 		    /* Ok, there is existing indirect item already. Need to append it */
 		    /* Calculate position past inserted item */
 		    make_cpu_key( &key, inode, le_key_k_offset( get_inode_item_key_version(inode), &(ih->ih_key)) + op_bytes_number(ih, inode->i_sb->s_blocksize), TYPE_INDIRECT, 3);
-		    res = reiserfs_paste_into_item( th, &path, &key, (char *)zeros, UNFM_P_SIZE*to_paste);
+		    res = reiserfs_paste_into_item( th, &path, &key, inode, (char *)zeros, UNFM_P_SIZE*to_paste);
 		    if ( res ) {
 			kfree(zeros);
 			goto error_exit_free_blocks;
@@ -340,14 +299,15 @@ int reiserfs_allocate_blocks_for_region(
 		    if ( res != ITEM_NOT_FOUND ) {
 			/* item should not exist, otherwise we have error */
 			if ( res != -ENOSPC ) {
-			    reiserfs_warning ("green-9008: search_by_key (%K) returned %d\n",
-					       &key, res);
+			    reiserfs_warning (inode->i_sb,
+				"green-9008: search_by_key (%K) returned %d",
+					      &key, res);
 			}
 			res = -EIO;
 		        kfree(zeros);
 			goto error_exit_free_blocks;
 		    }
-		    res = reiserfs_insert_item( th, &path, &key, &ins_ih, (char *)zeros);
+		    res = reiserfs_insert_item( th, &path, &key, &ins_ih, inode, (char *)zeros);
 		} else {
 		    reiserfs_panic(inode->i_sb, "green-9011: Unexpected key type %K\n", &key);
 		}
@@ -464,7 +424,7 @@ retry:
 	    // position. We do not need to recalculate path as it should
 	    // already point to correct place.
 	    make_cpu_key( &key, inode, le_key_k_offset( get_inode_item_key_version(inode), &(ih->ih_key)) + op_bytes_number(ih, inode->i_sb->s_blocksize), TYPE_INDIRECT, 3);
-	    res = reiserfs_paste_into_item( th, &path, &key, (char *)(allocated_blocks+curr_block), UNFM_P_SIZE*(blocks_to_allocate-curr_block));
+	    res = reiserfs_paste_into_item( th, &path, &key, inode, (char *)(allocated_blocks+curr_block), UNFM_P_SIZE*(blocks_to_allocate-curr_block));
 	    if ( res ) {
 		goto error_exit_free_blocks;
 	    }
@@ -488,14 +448,15 @@ retry:
 		/* Well, if we have found such item already, or some error
 		   occured, we need to warn user and return error */
 		if ( res != -ENOSPC ) {
-		    reiserfs_warning ("green-9009: search_by_key (%K) returned %d\n",
-			              &key, res);
+		    reiserfs_warning (inode->i_sb,
+				      "green-9009: search_by_key (%K) "
+				      "returned %d", &key, res);
 		}
 		res = -EIO;
 		goto error_exit_free_blocks;
 	    }
 	    /* Insert item into the tree with the data as its body */
-	    res = reiserfs_insert_item( th, &path, &key, &ins_ih, (char *)(allocated_blocks+curr_block));
+	    res = reiserfs_insert_item( th, &path, &key, &ins_ih, inode, (char *)(allocated_blocks+curr_block));
 	} else {
 	    reiserfs_panic(inode->i_sb, "green-9010: unexpected item type for key %K\n",&key);
 	}
@@ -505,7 +466,6 @@ retry:
     // unless we return an error, they are also responsible for logging
     // the inode.
     //
-    inode->i_blocks += blocks_to_allocate << (inode->i_blkbits - 9);
     pathrelse(&path);
     reiserfs_write_unlock(inode->i_sb);
 
@@ -551,7 +511,7 @@ error_exit_free_blocks:
     pathrelse(&path);
     // free blocks
     for( i = 0; i < blocks_to_allocate; i++ )
-	reiserfs_free_block(th, le32_to_cpu(allocated_blocks[i]));
+	reiserfs_free_block(th, inode, le32_to_cpu(allocated_blocks[i]), 1);
 
 error_exit:
     reiserfs_update_sd(th, inode); // update any changes we made to blk count
@@ -585,7 +545,7 @@ int reiserfs_copy_from_user_to_file_region(
 								 array to
 								 prepared pages
 								*/
-				const char *buf /* Pointer to user-supplied
+				const char __user *buf /* Pointer to user-supplied
 						   data*/
 				)
 {
@@ -696,10 +656,6 @@ int reiserfs_submit_file_region_for_write(
 			     // we only remember error status to report it on
 			     // exit.
 	write_bytes-=count;
-	SetPageReferenced(page);
-	unlock_page(page); // We unlock the page as it was locked by earlier call
-			  // to grab_cache_page
-	page_cache_release(page);
     }
     /* now that we've gotten all the ordered buffers marked dirty,
      * we can safely update i_size and close any running transaction
@@ -736,6 +692,17 @@ int reiserfs_submit_file_region_for_write(
 	reiserfs_write_unlock(inode->i_sb);
     }
     th->t_trans_id = 0;
+
+    /* 
+     * we have to unlock the pages after updating i_size, otherwise
+     * we race with writepage
+     */
+    for ( i = 0; i < num_pages ; i++) {
+	struct page *page=prepared_pages[i];
+	unlock_page(page); 
+	mark_page_accessed(page);
+	page_cache_release(page);
+    }
     return retval;
 }
 
@@ -842,7 +809,9 @@ int reiserfs_prepare_file_region_for_write(
 
 
     if ( num_pages < 1 ) {
-	reiserfs_warning("green-9001: reiserfs_prepare_file_region_for_write called with zero number of pages to process\n");
+	reiserfs_warning (inode->i_sb,
+			  "green-9001: reiserfs_prepare_file_region_for_write "
+			  "called with zero number of pages to process");
 	return -EFAULT;
     }
 
@@ -1093,7 +1062,7 @@ failed_read:
 
 */
 ssize_t reiserfs_file_write( struct file *file, /* the file we are going to write into */
-                             const char *buf, /*  pointer to user supplied data
+                             const char __user *buf, /*  pointer to user supplied data
 (in userspace) */
                              size_t count, /* amount of bytes to write */
                              loff_t *ppos /* pointer to position in file that we start writing at. Should be updated to
@@ -1321,6 +1290,11 @@ struct file_operations reiserfs_file_operations = {
 struct  inode_operations reiserfs_file_inode_operations = {
     .truncate	= reiserfs_vfs_truncate_file,
     .setattr    = reiserfs_setattr,
+    .setxattr   = reiserfs_setxattr,
+    .getxattr   = reiserfs_getxattr,
+    .listxattr  = reiserfs_listxattr,
+    .removexattr = reiserfs_removexattr,
+    .permission = reiserfs_permission,
 };
 
 
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index b40c7de1c..032201b08 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -483,7 +483,8 @@ static int get_num_ver (int mode, struct tree_balance * tb, int h,
 	snum012[needed_nodes - 1 + 3] = units;
 
 	if (needed_nodes > 2)
-	    reiserfs_warning ("vs-8111: get_num_ver: split_item_position is out of boundary\n");
+	    reiserfs_warning (tb->tb_sb, "vs-8111: get_num_ver: "
+			      "split_item_position is out of boundary");
 	snum012[needed_nodes - 1] ++;
 	split_item_positions[needed_nodes - 1] = i;
 	needed_nodes ++;
@@ -510,7 +511,8 @@ static int get_num_ver (int mode, struct tree_balance * tb, int h,
 	snum012[4] = op_unit_num (&vn->vn_vi[split_item_num]) - snum012[4] - bytes_to_r - bytes_to_l - bytes_to_S1new;
 
 	if (vn->vn_vi[split_item_num].vi_index != TYPE_DIRENTRY)
-	    reiserfs_warning ("vs-8115: get_num_ver: not directory item\n");
+	    reiserfs_warning (tb->tb_sb, "vs-8115: get_num_ver: not "
+			      "directory item");
     }
 
     /* now we know S2bytes, calculate S1bytes */
@@ -795,8 +797,9 @@ static int  get_empty_nodes(
   else /* If we have enough already then there is nothing to do. */
     return CARRY_ON;
 
-  if ( reiserfs_new_form_blocknrs (p_s_tb, a_n_blocknrs,
-                                   n_amount_needed) == NO_DISK_SPACE )
+  /* No need to check quota - is not allocated for blocks used for formatted nodes */
+  if (reiserfs_new_form_blocknrs (p_s_tb, a_n_blocknrs,
+                                   n_amount_needed) == NO_DISK_SPACE)
     return NO_DISK_SPACE;
 
   /* for each blocknumber we just got, get a buffer and stick it on FEB */
@@ -1973,11 +1976,12 @@ void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s)
     if (vp) {
 	REISERFS_SB(s)->s_kmallocs += size;
 	if (REISERFS_SB(s)->s_kmallocs > malloced + 200000) {
-	    reiserfs_warning ("vs-8301: reiserfs_kmalloc: allocated memory %d\n", REISERFS_SB(s)->s_kmallocs);
+	    reiserfs_warning (s,
+			      "vs-8301: reiserfs_kmalloc: allocated memory %d",
+			      REISERFS_SB(s)->s_kmallocs);
 	    malloced = REISERFS_SB(s)->s_kmallocs;
 	}
     }
-/*printk ("malloc : size %d, allocated %d\n", size, REISERFS_SB(s)->s_kmallocs);*/
     return vp;
 }
 
@@ -1987,7 +1991,8 @@ void reiserfs_kfree (const void * vp, size_t size, struct super_block * s)
   
     REISERFS_SB(s)->s_kmallocs -= size;
     if (REISERFS_SB(s)->s_kmallocs < 0)
-	reiserfs_warning ("vs-8302: reiserfs_kfree: allocated memory %d\n", REISERFS_SB(s)->s_kmallocs);
+	reiserfs_warning (s, "vs-8302: reiserfs_kfree: allocated memory %d",
+			  REISERFS_SB(s)->s_kmallocs);
 
 }
 #endif
@@ -2047,8 +2052,9 @@ static int get_mem_for_virtual_node (struct tree_balance * tb)
 	    buf = reiserfs_kmalloc(size, GFP_NOFS, tb->tb_sb);
 	    if ( !buf ) {
 #ifdef CONFIG_REISERFS_CHECK
-		reiserfs_warning ("vs-8345: get_mem_for_virtual_node: "
-				  "kmalloc failed. reiserfs kmalloced %d bytes\n",
+		reiserfs_warning (tb->tb_sb,
+				  "vs-8345: get_mem_for_virtual_node: "
+				  "kmalloc failed. reiserfs kmalloced %d bytes",
 				  REISERFS_SB(tb->tb_sb)->s_kmallocs);
 #endif
 		tb->vn_buf_size = 0;
@@ -2210,7 +2216,10 @@ static int wait_tb_buffers_until_unlocked (struct tree_balance * p_s_tb)
 #ifdef CONFIG_REISERFS_CHECK
 	    repeat_counter++;
 	    if ( (repeat_counter % 10000) == 0) {
-		reiserfs_warning ("wait_tb_buffers_until_released(): too many iterations waiting for buffer to unlock (%b)\n", locked);
+		reiserfs_warning (p_s_tb->tb_sb,
+				  "wait_tb_buffers_until_released(): too many "
+				  "iterations waiting for buffer to unlock "
+				  "(%b)", locked);
 
 		/* Don't loop forever.  Try to recover from possible error. */
 
@@ -2323,8 +2332,7 @@ int fix_nodes (int n_op_mode,
     case M_CUT:
 	if ( n_item_num < 0 || n_item_num >= B_NR_ITEMS(p_s_tbS0) ) {
 	    print_block (p_s_tbS0, 0, -1, -1);
-	    printk("mode = %c insert_size = %d\n", n_op_mode, p_s_tb->insert_size[0]);
-	    reiserfs_panic(p_s_tb->tb_sb,"PAP-8335: fix_nodes: Incorrect item number(%d)", n_item_num);
+	    reiserfs_panic(p_s_tb->tb_sb,"PAP-8335: fix_nodes: Incorrect item number(%d); mode = %c insert_size = %d\n", n_item_num, n_op_mode, p_s_tb->insert_size[0]);
 	}
 	break;
     default:
@@ -2492,7 +2500,7 @@ void unfix_nodes (struct tree_balance * tb)
 	    /* de-allocated block which was not used by balancing and
                bforget about buffer for it */
 	    brelse (tb->FEB[i]);
-	    reiserfs_free_block (tb->transaction_handle, blocknr);
+	    reiserfs_free_block (tb->transaction_handle, NULL, blocknr, 0);
 	}
 	if (tb->used[i]) {
 	    /* release used as new nodes including a new root */
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 6aded3b89..68050af43 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -4,7 +4,10 @@
 
 #include <linux/config.h>
 #include <linux/time.h>
+#include <linux/fs.h>
 #include <linux/reiserfs_fs.h>
+#include <linux/reiserfs_acl.h>
+#include <linux/reiserfs_xattr.h>
 #include <linux/smp_lock.h>
 #include <linux/pagemap.h>
 #include <linux/highmem.h>
@@ -13,6 +16,7 @@
 #include <linux/buffer_head.h>
 #include <linux/mpage.h>
 #include <linux/writeback.h>
+#include <linux/quotaops.h>
 
 extern int reiserfs_default_io_size; /* default io size devuned in super.c */
 
@@ -36,10 +40,13 @@ void reiserfs_delete_inode (struct inode * inode)
   
     reiserfs_write_lock(inode->i_sb);
 
+    DQUOT_FREE_INODE(inode);
     /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
     if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */
 	down (&inode->i_sem); 
 
+	reiserfs_delete_xattrs (inode);
+
 	journal_begin(&th, inode->i_sb, jbegin_count) ;
 	reiserfs_update_inode_transaction(inode) ;
 
@@ -642,7 +649,7 @@ start_trans:
 
 	repeat = _allocate_block(th, block, inode, &allocated_block_nr, &path, create);
 
-	if (repeat == NO_DISK_SPACE) {
+	if (repeat == NO_DISK_SPACE || repeat == QUOTA_EXCEEDED) {
 	    /* restart the transaction to give the journal a chance to free
 	    ** some blocks.  releases the path, so we have to go back to
 	    ** research if we succeed on the second try
@@ -651,10 +658,13 @@ start_trans:
 	    restart_transaction(th, inode, &path) ;
 	    repeat = _allocate_block(th, block, inode, &allocated_block_nr, NULL, create);
 
-	    if (repeat != NO_DISK_SPACE) {
+	    if (repeat != NO_DISK_SPACE && repeat != QUOTA_EXCEEDED) {
 		goto research ;
 	    }
-	    retval = -ENOSPC;
+	    if (repeat == QUOTA_EXCEEDED)
+		retval = -EDQUOT;
+	    else
+		retval = -ENOSPC;
 	    goto failure;
 	}
 
@@ -682,7 +692,6 @@ start_trans:
 	    put_block_num(item, pos_in_item, allocated_block_nr) ;
             unfm_ptr = allocated_block_nr;
 	    journal_mark_dirty (th, inode->i_sb, bh);
-	    inode->i_blocks += (inode->i_sb->s_blocksize / 512) ;
 	    reiserfs_update_sd(th, inode) ;
 	}
 	set_block_dev_mapped(bh_result, unfm_ptr, inode);
@@ -729,13 +738,11 @@ start_trans:
 	    set_cpu_key_k_offset (&tmp_key, 1);
 	    PATH_LAST_POSITION(&path) ++;
 
-	    retval = reiserfs_insert_item (th, &path, &tmp_key, &tmp_ih, (char *)&unp);
+	    retval = reiserfs_insert_item (th, &path, &tmp_key, &tmp_ih, inode, (char *)&unp);
 	    if (retval) {
-		reiserfs_free_block (th, allocated_block_nr);
-		goto failure; // retval == -ENOSPC or -EIO or -EEXIST
+		reiserfs_free_block (th, inode, allocated_block_nr, 1);
+		goto failure; // retval == -ENOSPC, -EDQUOT or -EIO or -EEXIST
 	    }
-	    if (unp)
-		inode->i_blocks += inode->i_sb->s_blocksize / 512;
 	    //mark_tail_converted (inode);
 	} else if (is_direct_le_ih (ih)) {
 	    /* direct item has to be converted */
@@ -767,13 +774,13 @@ start_trans:
 		retval = convert_tail_for_hole(inode, bh_result, tail_offset) ;
 		if (retval) {
 		    if ( retval != -ENOSPC )
-			printk("clm-6004: convert tail failed inode %lu, error %d\n", inode->i_ino, retval) ;
+			reiserfs_warning (inode->i_sb, "clm-6004: convert tail failed inode %lu, error %d", inode->i_ino, retval) ;
 		    if (allocated_block_nr) {
 			/* the bitmap, the super, and the stat data == 3 */
 			if (!th)
 			    th = reiserfs_persistent_transaction(inode->i_sb,3);
 			if (th)
-			    reiserfs_free_block (th, allocated_block_nr);
+			    reiserfs_free_block (th,inode,allocated_block_nr,1);
 		    }
 		    goto failure ;
 		}
@@ -782,7 +789,7 @@ start_trans:
 	    retval = direct2indirect (th, inode, &path, unbh, tail_offset);
 	    if (retval) {
 		reiserfs_unmap_buffer(unbh);
-		reiserfs_free_block (th, allocated_block_nr);
+		reiserfs_free_block (th, inode, allocated_block_nr, 1);
 		goto failure;
 	    }
 	    /* it is important the set_buffer_uptodate is done after
@@ -815,9 +822,6 @@ start_trans:
 		 */
 		mark_buffer_dirty(unbh) ;
 	    }
-
-	    //inode->i_blocks += inode->i_sb->s_blocksize / 512;
-	    //mark_tail_converted (inode);
 	} else {
 	    /* append indirect item with holes if needed, when appending
 	       pointer to 'block'-th block use block, which is already
@@ -865,24 +869,21 @@ start_trans:
 		   only have space for one block */
 		blocks_needed=max_to_insert?max_to_insert:1;
 	    }
-	    retval = reiserfs_paste_into_item (th, &path, &tmp_key, (char *)un, UNFM_P_SIZE * blocks_needed);
+	    retval = reiserfs_paste_into_item (th, &path, &tmp_key, inode, (char *)un, UNFM_P_SIZE * blocks_needed);
 
 	    if (blocks_needed != 1)
 		kfree(un);
 
 	    if (retval) {
-		reiserfs_free_block (th, allocated_block_nr);
+		reiserfs_free_block (th, inode, allocated_block_nr, 1);
 		goto failure;
 	    }
-	    if (done) {
-		inode->i_blocks += inode->i_sb->s_blocksize / 512;
-	    } else {
+	    if (!done) {
 		/* We need to mark new file size in case this function will be
 		   interrupted/aborted later on. And we may do this only for
 		   holes. */
 		inode->i_size += inode->i_sb->s_blocksize * blocks_needed;
 	    }
-	    //mark_tail_converted (inode);
 	}
 
 	if (done == 1)
@@ -910,11 +911,11 @@ start_trans:
 	    goto failure;
 	}
 	if (retval == POSITION_FOUND) {
-	    reiserfs_warning ("vs-825: reiserfs_get_block: "
-			      "%K should not be found\n", &key);
+	    reiserfs_warning (inode->i_sb, "vs-825: reiserfs_get_block: "
+			      "%K should not be found", &key);
 	    retval = -EEXIST;
 	    if (allocated_block_nr)
-	        reiserfs_free_block (th, allocated_block_nr);
+	        reiserfs_free_block (th, inode, allocated_block_nr, 1);
 	    pathrelse(&path) ;
 	    goto failure;
 	}
@@ -944,6 +945,58 @@ reiserfs_readpages(struct file *file, struct address_space *mapping,
     return mpage_readpages(mapping, pages, nr_pages, reiserfs_get_block);
 }
 
+/* Compute real number of used bytes by file
+ * Following three functions can go away when we'll have enough space in stat item
+ */
+static int real_space_diff(struct inode *inode, int sd_size)
+{
+    int bytes;
+    loff_t blocksize = inode->i_sb->s_blocksize ;
+
+    if (S_ISLNK(inode->i_mode) || S_ISDIR(inode->i_mode))
+        return sd_size ;
+
+    /* End of file is also in full block with indirect reference, so round
+    ** up to the next block.
+    **
+    ** there is just no way to know if the tail is actually packed
+    ** on the file, so we have to assume it isn't.  When we pack the
+    ** tail, we add 4 bytes to pretend there really is an unformatted
+    ** node pointer
+    */
+    bytes = ((inode->i_size + (blocksize-1)) >> inode->i_sb->s_blocksize_bits) * UNFM_P_SIZE + sd_size;
+    return bytes ;
+}
+
+static inline loff_t to_real_used_space(struct inode *inode, ulong blocks,
+                                        int sd_size)
+{
+    if (S_ISLNK(inode->i_mode) || S_ISDIR(inode->i_mode)) {
+        return inode->i_size + (loff_t)(real_space_diff(inode, sd_size)) ;
+    }
+    return ((loff_t)real_space_diff(inode, sd_size)) + (((loff_t)blocks) << 9);
+}
+
+/* Compute number of blocks used by file in ReiserFS counting */
+static inline ulong to_fake_used_blocks(struct inode *inode, int sd_size)
+{
+    loff_t bytes = inode_get_bytes(inode) ;
+    loff_t real_space = real_space_diff(inode, sd_size) ;
+
+    /* keeps fsck and non-quota versions of reiserfs happy */
+    if (S_ISLNK(inode->i_mode) || S_ISDIR(inode->i_mode)) {
+        bytes += (loff_t)511 ;
+    }
+
+    /* files from before the quota patch might i_blocks such that
+    ** bytes < real_space.  Deal with that here to prevent it from
+    ** going negative.
+    */
+    if (bytes < real_space)
+        return 0 ;
+    return (bytes - real_space) >> 9;
+}
+
 //
 // BAD: new directories have stat data of new type and all other items
 // of old type. Version stored in the inode says about body items, so
@@ -972,6 +1025,9 @@ static void init_inode (struct inode * inode, struct path * path)
     REISERFS_I(inode)->i_prealloc_count = 0;
     REISERFS_I(inode)->i_trans_id = 0;
     REISERFS_I(inode)->i_jl = NULL;
+    REISERFS_I(inode)->i_acl_access = NULL;
+    REISERFS_I(inode)->i_acl_default = NULL;
+    init_rwsem (&REISERFS_I(inode)->xattr_sem);
 
     if (stat_data_v1 (ih)) {
 	struct stat_data_v1 * sd = (struct stat_data_v1 *)B_I_PITEM (bh, ih);
@@ -1006,6 +1062,14 @@ static void init_inode (struct inode * inode, struct path * path)
 
         rdev = sd_v1_rdev(sd);
 	REISERFS_I(inode)->i_first_direct_byte = sd_v1_first_direct_byte(sd);
+	/* an early bug in the quota code can give us an odd number for the
+	** block count.  This is incorrect, fix it here.
+	*/
+	if (inode->i_blocks & 1) {
+	    inode->i_blocks++ ;
+	}
+	inode_set_bytes(inode, to_real_used_space(inode, inode->i_blocks,
+	                                          SD_V1_SIZE));
 	/* nopack is initially zero for v1 objects. For v2 objects,
 	   nopack is initialised from sd_attrs */
 	REISERFS_I(inode)->i_flags &= ~i_nopack_mask;
@@ -1038,6 +1102,8 @@ static void init_inode (struct inode * inode, struct path * path)
 	    set_inode_item_key_version (inode, KEY_FORMAT_3_6);
 	REISERFS_I(inode)->i_first_direct_byte = 0;
 	set_inode_sd_version (inode, STAT_DATA_V2);
+	inode_set_bytes(inode, to_real_used_space(inode, inode->i_blocks,
+	                                          SD_V2_SIZE));
 	/* read persistent inode attributes from sd and initalise
 	   generic inode flags from them */
 	REISERFS_I(inode)->i_attrs = sd_v2_attrs( sd );
@@ -1053,17 +1119,18 @@ static void init_inode (struct inode * inode, struct path * path)
 	inode->i_op = &reiserfs_dir_inode_operations;
 	inode->i_fop = &reiserfs_dir_operations;
     } else if (S_ISLNK (inode->i_mode)) {
-	inode->i_op = &page_symlink_inode_operations;
+	inode->i_op = &reiserfs_symlink_inode_operations;
 	inode->i_mapping->a_ops = &reiserfs_address_space_operations;
     } else {
 	inode->i_blocks = 0;
+	inode->i_op = &reiserfs_special_inode_operations;
 	init_special_inode(inode, inode->i_mode, new_decode_dev(rdev));
     }
 }
 
 
 // update new stat data with inode fields
-static void inode2sd (void * sd, struct inode * inode)
+static void inode2sd (void * sd, struct inode * inode, loff_t size)
 {
     struct stat_data * sd_v2 = (struct stat_data *)sd;
     __u16 flags;
@@ -1071,12 +1138,12 @@ static void inode2sd (void * sd, struct inode * inode)
     set_sd_v2_mode(sd_v2, inode->i_mode );
     set_sd_v2_nlink(sd_v2, inode->i_nlink );
     set_sd_v2_uid(sd_v2, inode->i_uid );
-    set_sd_v2_size(sd_v2, inode->i_size );
+    set_sd_v2_size(sd_v2, size );
     set_sd_v2_gid(sd_v2, inode->i_gid );
     set_sd_v2_mtime(sd_v2, inode->i_mtime.tv_sec );
     set_sd_v2_atime(sd_v2, inode->i_atime.tv_sec );
     set_sd_v2_ctime(sd_v2, inode->i_ctime.tv_sec );
-    set_sd_v2_blocks(sd_v2, inode->i_blocks );
+    set_sd_v2_blocks(sd_v2, to_fake_used_blocks(inode, SD_V2_SIZE));
     if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode))
 	set_sd_v2_rdev(sd_v2, new_encode_dev(inode->i_rdev));
     else
@@ -1088,7 +1155,7 @@ static void inode2sd (void * sd, struct inode * inode)
 
 
 // used to copy inode's fields to old stat data
-static void inode2sd_v1 (void * sd, struct inode * inode)
+static void inode2sd_v1 (void * sd, struct inode * inode, loff_t size)
 {
     struct stat_data_v1 * sd_v1 = (struct stat_data_v1 *)sd;
 
@@ -1096,7 +1163,7 @@ static void inode2sd_v1 (void * sd, struct inode * inode)
     set_sd_v1_uid(sd_v1, inode->i_uid );
     set_sd_v1_gid(sd_v1, inode->i_gid );
     set_sd_v1_nlink(sd_v1, inode->i_nlink );
-    set_sd_v1_size(sd_v1, inode->i_size );
+    set_sd_v1_size(sd_v1, size );
     set_sd_v1_atime(sd_v1, inode->i_atime.tv_sec );
     set_sd_v1_ctime(sd_v1, inode->i_ctime.tv_sec );
     set_sd_v1_mtime(sd_v1, inode->i_mtime.tv_sec );
@@ -1104,7 +1171,7 @@ static void inode2sd_v1 (void * sd, struct inode * inode)
     if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode))
         set_sd_v1_rdev(sd_v1, new_encode_dev(inode->i_rdev));
     else
-        set_sd_v1_blocks(sd_v1, inode->i_blocks );
+        set_sd_v1_blocks(sd_v1, to_fake_used_blocks(inode, SD_V1_SIZE));
 
     // Sigh. i_first_direct_byte is back
     set_sd_v1_first_direct_byte(sd_v1, REISERFS_I(inode)->i_first_direct_byte);
@@ -1114,7 +1181,8 @@ static void inode2sd_v1 (void * sd, struct inode * inode)
 /* NOTE, you must prepare the buffer head before sending it here,
 ** and then log it after the call
 */
-static void update_stat_data (struct path * path, struct inode * inode)
+static void update_stat_data (struct path * path, struct inode * inode,
+                              loff_t size)
 {
     struct buffer_head * bh;
     struct item_head * ih;
@@ -1128,17 +1196,17 @@ static void update_stat_data (struct path * path, struct inode * inode)
   
     if (stat_data_v1 (ih)) {
 	// path points to old stat data
-	inode2sd_v1 (B_I_PITEM (bh, ih), inode);
+	inode2sd_v1 (B_I_PITEM (bh, ih), inode, size);
     } else {
-	inode2sd (B_I_PITEM (bh, ih), inode);
+	inode2sd (B_I_PITEM (bh, ih), inode, size);
     }
 
     return;
 }
 
 
-void reiserfs_update_sd (struct reiserfs_transaction_handle *th, 
-			 struct inode * inode)
+void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th,
+			      struct inode * inode, loff_t size)
 {
     struct cpu_key key;
     INITIALIZE_PATH(path);
@@ -1154,7 +1222,7 @@ void reiserfs_update_sd (struct reiserfs_transaction_handle *th,
 	/* look for the object's stat data */
 	retval = search_item (inode->i_sb, &key, &path);
 	if (retval == IO_ERROR) {
-	    reiserfs_warning ("vs-13050: reiserfs_update_sd: "
+	    reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: "
 			      "i/o failure occurred trying to update %K stat data",
 			      &key);
 	    return;
@@ -1163,11 +1231,11 @@ void reiserfs_update_sd (struct reiserfs_transaction_handle *th,
 	    pos = PATH_LAST_POSITION (&path);
 	    pathrelse(&path) ;
 	    if (inode->i_nlink == 0) {
-		/*printk ("vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found\n");*/
+		/*reiserfs_warning (inode->i_sb, "vs-13050: reiserfs_update_sd: i_nlink == 0, stat data not found");*/
 		return;
 	    }
-	    reiserfs_warning ("vs-13060: reiserfs_update_sd: "
-			      "stat data of object %k (nlink == %d) not found (pos %d)\n", 
+	    reiserfs_warning (inode->i_sb, "vs-13060: reiserfs_update_sd: "
+			      "stat data of object %k (nlink == %d) not found (pos %d)",
 			      INODE_PKEY (inode), inode->i_nlink, pos);
 	    reiserfs_check_path(&path) ;
 	    return;
@@ -1188,7 +1256,7 @@ void reiserfs_update_sd (struct reiserfs_transaction_handle *th,
 	}
 	break;
     }
-    update_stat_data (&path, inode);
+    update_stat_data (&path, inode, size);
     journal_mark_dirty(th, th->t_super, bh) ; 
     pathrelse (&path);
     return;
@@ -1240,9 +1308,9 @@ void reiserfs_read_locked_inode (struct inode * inode, struct reiserfs_iget_args
     /* look for the object's stat data */
     retval = search_item (inode->i_sb, &key, &path_to_sd);
     if (retval == IO_ERROR) {
-	reiserfs_warning ("vs-13070: reiserfs_read_locked_inode: "
-                    "i/o failure occurred trying to find stat data of %K\n",
-                    &key);
+	reiserfs_warning (inode->i_sb, "vs-13070: reiserfs_read_locked_inode: "
+			  "i/o failure occurred trying to find stat data of %K",
+			  &key);
 	reiserfs_make_bad_inode(inode) ;
 	return;
     }
@@ -1272,9 +1340,10 @@ void reiserfs_read_locked_inode (struct inode * inode, struct reiserfs_iget_args
        during mount (fs/reiserfs/super.c:finish_unfinished()). */
     if( ( inode -> i_nlink == 0 ) && 
 	! REISERFS_SB(inode -> i_sb) -> s_is_unlinked_ok ) {
-	    reiserfs_warning( "vs-13075: reiserfs_read_locked_inode: "
+	    reiserfs_warning (inode->i_sb,
+			      "vs-13075: reiserfs_read_locked_inode: "
 			      "dead inode read from disk %K. "
-			      "This is likely to be race with knfsd. Ignore\n", 
+			      "This is likely to be race with knfsd. Ignore",
 			      &key );
 	    reiserfs_make_bad_inode( inode );
     }
@@ -1377,7 +1446,7 @@ struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 *data,
      */
     if (fhtype > len) {
 	    if (fhtype != 6 || len != 5)
-		    printk(KERN_WARNING "nfsd/reiserfs, fhtype=%d, len=%d - odd\n",
+		    reiserfs_warning (sb, "nfsd/reiserfs, fhtype=%d, len=%d - odd",
 			   fhtype, len);
 	    fhtype = 5;
     }
@@ -1440,8 +1509,9 @@ void reiserfs_write_inode (struct inode * inode, int do_sync) {
     int jbegin_count = 1 ;
 
     if (inode->i_sb->s_flags & MS_RDONLY) {
-        reiserfs_warning("clm-6005: writing inode %lu on readonly FS\n", 
-	                  inode->i_ino) ;
+        reiserfs_warning (inode->i_sb,
+			  "clm-6005: writing inode %lu on readonly FS",
+			  inode->i_ino) ;
         return ;
     }
     /* memory pressure can sometimes initiate write_inode calls with sync == 1,
@@ -1471,6 +1541,7 @@ int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, struct inode *
 /* stat data of new object is inserted already, this inserts the item
    containing "." and ".." entries */
 static int reiserfs_new_directory (struct reiserfs_transaction_handle *th, 
+				   struct inode *inode,
 				   struct item_head * ih, struct path * path,
 				   struct inode * dir)
 {
@@ -1503,25 +1574,26 @@ static int reiserfs_new_directory (struct reiserfs_transaction_handle *th,
     /* look for place in the tree for new item */
     retval = search_item (sb, &key, path);
     if (retval == IO_ERROR) {
-	reiserfs_warning ("vs-13080: reiserfs_new_directory: "
-			  "i/o failure occurred creating new directory\n");
+	reiserfs_warning (sb, "vs-13080: reiserfs_new_directory: "
+			  "i/o failure occurred creating new directory");
 	return -EIO;
     }
     if (retval == ITEM_FOUND) {
 	pathrelse (path);
-	reiserfs_warning ("vs-13070: reiserfs_new_directory: "
+	reiserfs_warning (sb, "vs-13070: reiserfs_new_directory: "
 			  "object with this key exists (%k)", &(ih->ih_key));
 	return -EEXIST;
     }
 
     /* insert item, that is empty directory item */
-    return reiserfs_insert_item (th, path, &key, ih, body);
+    return reiserfs_insert_item (th, path, &key, ih, inode, body);
 }
 
 
 /* stat data of object has been inserted, this inserts the item
    containing the body of symlink */
 static int reiserfs_new_symlink (struct reiserfs_transaction_handle *th, 
+				 struct inode *inode,	/* Inode of symlink */
 				 struct item_head * ih,
 				 struct path * path, const char * symname, int item_len)
 {
@@ -1539,19 +1611,19 @@ static int reiserfs_new_symlink (struct reiserfs_transaction_handle *th,
     /* look for place in the tree for new item */
     retval = search_item (sb, &key, path);
     if (retval == IO_ERROR) {
-	reiserfs_warning ("vs-13080: reiserfs_new_symlinik: "
-			  "i/o failure occurred creating new symlink\n");
+	reiserfs_warning (sb, "vs-13080: reiserfs_new_symlinik: "
+			  "i/o failure occurred creating new symlink");
 	return -EIO;
     }
     if (retval == ITEM_FOUND) {
 	pathrelse (path);
-	reiserfs_warning ("vs-13080: reiserfs_new_symlink: "
+	reiserfs_warning (sb, "vs-13080: reiserfs_new_symlink: "
 			  "object with this key exists (%k)", &(ih->ih_key));
 	return -EEXIST;
     }
 
     /* insert item, that is body of symlink */
-    return reiserfs_insert_item (th, path, &key, ih, symname);
+    return reiserfs_insert_item (th, path, &key, ih, inode, symname);
 }
 
 
@@ -1619,7 +1691,8 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
 
     inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
     inode->i_size = i_size;
-    inode->i_blocks = (inode->i_size + 511) >> 9;
+    inode->i_blocks = 0;
+    inode->i_bytes = 0;
     REISERFS_I(inode)->i_first_direct_byte = S_ISLNK(mode) ? 1 : 
       U32_MAX/*NO_BYTES_IN_DIRECT_ITEM*/;
 
@@ -1632,6 +1705,9 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
     REISERFS_I(inode)->i_attrs =
 	REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK;
     sd_attrs_to_i_attrs( REISERFS_I(inode) -> i_attrs, inode );
+    REISERFS_I(inode)->i_acl_access = NULL;
+    REISERFS_I(inode)->i_acl_default = NULL;
+    init_rwsem (&REISERFS_I(inode)->xattr_sem);
 
     if (old_format_only (sb))
 	make_le_item_head (&ih, 0, KEY_FORMAT_3_5, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT);
@@ -1661,9 +1737,9 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
 	    err = -EINVAL;
 	    goto out_bad_inode;
 	}
-	inode2sd_v1 (&sd, inode);
+	inode2sd_v1 (&sd, inode, inode->i_size);
     } else {
-	inode2sd (&sd, inode);
+	inode2sd (&sd, inode, inode->i_size);
     }
     // these do not go to on-disk stat data
     inode->i_ino = le32_to_cpu (ih.ih_key.k_objectid);
@@ -1687,7 +1763,7 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
     if (REISERFS_I(dir)->new_packing_locality)
 	th->displace_new_blocks = 1;
 #endif
-    retval = reiserfs_insert_item (th, &path_to_key, &key, &ih, (char *)(&sd));
+    retval = reiserfs_insert_item (th, &path_to_key, &key, &ih, inode, (char *)(&sd));
     if (retval) {
 	err = retval;
 	reiserfs_check_path(&path_to_key) ;
@@ -1700,14 +1776,14 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
 #endif
     if (S_ISDIR(mode)) {
 	/* insert item with "." and ".." */
-	retval = reiserfs_new_directory (th, &ih, &path_to_key, dir);
+	retval = reiserfs_new_directory (th, inode, &ih, &path_to_key, dir);
     }
 
     if (S_ISLNK(mode)) {
 	/* insert body of symlink */
 	if (!old_format_only (sb))
 	    i_size = ROUND_UP(i_size);
-	retval = reiserfs_new_symlink (th, &ih, &path_to_key, symname, i_size);
+	retval = reiserfs_new_symlink (th, inode, &ih, &path_to_key, symname, i_size);
     }
     if (retval) {
 	err = retval;
@@ -1716,6 +1792,20 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
 	goto out_inserted_sd;
     }
 
+    /* XXX CHECK THIS */
+    if (reiserfs_posixacl (inode->i_sb)) {
+        retval = reiserfs_inherit_default_acl (dir, dentry, inode);
+        if (retval) {
+            err = retval;
+            reiserfs_check_path(&path_to_key) ;
+            journal_end(th, th->t_super, th->t_blocks_allocated);
+            goto out_inserted_sd;
+        }
+    } else if (inode->i_sb->s_flags & MS_POSIXACL) {
+	reiserfs_warning (inode->i_sb, "ACLs aren't enabled in the fs, "
+			  "but vfs thinks they are!");
+    }
+
     insert_inode_hash (inode);
     reiserfs_update_sd(th, inode);
     reiserfs_check_path(&path_to_key) ;
@@ -1732,6 +1822,9 @@ out_bad_inode:
 
     /* dquot_drop must be done outside a transaction */
     journal_end(th, th->t_super, th->t_blocks_allocated) ;
+    DQUOT_FREE_INODE(inode);
+    DQUOT_DROP(inode);
+    inode->i_flags |= S_NOQUOTA;
     make_bad_inode(inode);
 
 out_inserted_sd:
@@ -1808,9 +1901,10 @@ static int grab_tail_page(struct inode *p_s_inode,
 	** I've screwed up the code to find the buffer, or the code to
 	** call prepare_write
 	*/
-	reiserfs_warning("clm-6000: error reading block %lu on dev %s\n",
-			 bh->b_blocknr,
-			 reiserfs_bdevname (p_s_inode->i_sb)) ;
+	reiserfs_warning (p_s_inode->i_sb,
+			  "clm-6000: error reading block %lu on dev %s",
+			  bh->b_blocknr,
+			  reiserfs_bdevname (p_s_inode->i_sb)) ;
 	error = -EIO ;
 	goto unlock ;
     }
@@ -1850,7 +1944,9 @@ void reiserfs_truncate_file(struct inode *p_s_inode, int update_timestamps) {
 	    // and get_block_create_0 could not find a block to read in,
 	    // which is ok.
 	    if (error != -ENOENT)
-	        reiserfs_warning("clm-6001: grab_tail_page failed %d\n", error);
+	        reiserfs_warning (p_s_inode->i_sb,
+				  "clm-6001: grab_tail_page failed %d",
+				  error);
 	    page = NULL ;
 	    bh = NULL ;
 	}
@@ -1948,7 +2044,8 @@ research:
     /* we've found an unformatted node */
     if (indirect_item_found(retval, ih)) {
 	if (bytes_copied > 0) {
-	    reiserfs_warning("clm-6002: bytes_copied %d\n", bytes_copied) ;
+	    reiserfs_warning (inode->i_sb, "clm-6002: bytes_copied %d",
+			      bytes_copied) ;
 	}
         if (!get_block_num(item, pos_in_item)) {
 	    /* crap, we are writing to a hole */
@@ -1996,7 +2093,9 @@ research:
 	    goto research ;
 	}
     } else {
-        reiserfs_warning("clm-6003: bad item inode %lu, device %s\n", inode->i_ino, reiserfs_bdevname (inode->i_sb)) ;
+        reiserfs_warning (inode->i_sb,
+			  "clm-6003: bad item inode %lu, device %s",
+			  inode->i_ino, reiserfs_bdevname (inode->i_sb)) ;
         retval = -EIO ;
 	goto out ;
     }
@@ -2269,6 +2368,7 @@ static int reiserfs_commit_write(struct file *f, struct page *page,
     struct inode *inode = page->mapping->host ;
     loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
     int ret = 0;
+    int update_sd = 0;
     struct reiserfs_transaction_handle *th = NULL;
     
     reiserfs_wait_on_write_block(inode->i_sb) ;
@@ -2295,11 +2395,14 @@ static int reiserfs_commit_write(struct file *f, struct page *page,
 	reiserfs_update_inode_transaction(inode) ;
 	inode->i_size = pos ;
 	reiserfs_update_sd(&myth, inode) ;
+	update_sd = 1;
 	journal_end(&myth, inode->i_sb, 1) ;
 	reiserfs_write_unlock(inode->i_sb);
     }
     if (th) {
 	reiserfs_write_lock(inode->i_sb);
+	if (!update_sd)
+	    reiserfs_update_sd(th, inode) ;
         reiserfs_end_persistent_transaction(th);
 	reiserfs_write_unlock(inode->i_sb);
     }
@@ -2508,6 +2611,68 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb,
 			offset, nr_segs, reiserfs_get_blocks_direct_io, NULL);
 }
 
+int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) {
+    struct inode *inode = dentry->d_inode ;
+    int error ;
+    unsigned int ia_valid = attr->ia_valid;
+    reiserfs_write_lock(inode->i_sb);
+    if (attr->ia_valid & ATTR_SIZE) {
+	/* version 2 items will be caught by the s_maxbytes check
+	** done for us in vmtruncate
+	*/
+	if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5 &&
+	    attr->ia_size > MAX_NON_LFS) {
+	    error = -EFBIG ;
+	    goto out;
+	}
+	/* fill in hole pointers in the expanding truncate case. */
+        if (attr->ia_size > inode->i_size) {
+	    error = generic_cont_expand(inode, attr->ia_size) ;
+	    if (REISERFS_I(inode)->i_prealloc_count > 0) {
+		struct reiserfs_transaction_handle th ;
+		/* we're changing at most 2 bitmaps, inode + super */
+		journal_begin(&th, inode->i_sb, 4) ;
+		reiserfs_discard_prealloc (&th, inode);
+		journal_end(&th, inode->i_sb, 4) ;
+	    }
+	    if (error)
+	        goto out;
+	}
+    }
+
+    if ((((attr->ia_valid & ATTR_UID) && (attr->ia_uid & ~0xffff)) ||
+	 ((attr->ia_valid & ATTR_GID) && (attr->ia_gid & ~0xffff))) &&
+	(get_inode_sd_version (inode) == STAT_DATA_V1)) {
+		/* stat data of format v3.5 has 16 bit uid and gid */
+	    error = -EINVAL;
+	    goto out;
+	}
+
+    error = inode_change_ok(inode, attr) ;
+    if (!error) {
+	if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+	    (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
+                error = reiserfs_chown_xattrs (inode, attr);
+
+                if (!error)
+                    error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
+        }
+        if (!error)
+            inode_setattr(inode, attr) ;
+    }
+
+
+    if (!error && reiserfs_posixacl (inode->i_sb)) {
+        if (attr->ia_valid & ATTR_MODE)
+            error = reiserfs_acl_chmod (inode);
+    }
+
+out:
+    reiserfs_write_unlock(inode->i_sb);
+    return error ;
+}
+
+
 
 struct address_space_operations reiserfs_address_space_operations = {
     .writepage = reiserfs_writepage,
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index ec59e0744..7f2fba5e1 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -36,7 +36,7 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 	case REISERFS_IOC_GETFLAGS:
 		flags = REISERFS_I(inode) -> i_attrs;
 		i_attrs_to_sd_attrs( inode, ( __u16 * ) &flags );
-		return put_user(flags, (int *) arg);
+		return put_user(flags, (int __user *) arg);
 	case REISERFS_IOC_SETFLAGS: {
 		if (IS_RDONLY(inode))
 			return -EROFS;
@@ -44,7 +44,7 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EPERM;
 
-		if (get_user(flags, (int *) arg))
+		if (get_user(flags, (int __user *) arg))
 			return -EFAULT;
 
 		if ( ( ( flags ^ REISERFS_I(inode) -> i_attrs) & ( REISERFS_IMMUTABLE_FL | REISERFS_APPEND_FL)) &&
@@ -66,13 +66,13 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 		return 0;
 	}
 	case REISERFS_IOC_GETVERSION:
-		return put_user(inode->i_generation, (int *) arg);
+		return put_user(inode->i_generation, (int __user *) arg);
 	case REISERFS_IOC_SETVERSION:
 		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;
-		if (get_user(inode->i_generation, (int *) arg))
+		if (get_user(inode->i_generation, (int __user *) arg))
 			return -EFAULT;	
 		inode->i_ctime = CURRENT_TIME;
 		mark_inode_dirty(inode);
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index 03b424713..7ad205848 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -106,7 +106,7 @@ static int sd_unit_num (struct virtual_item * vi)
 
 static void sd_print_vi (struct virtual_item * vi)
 {
-    reiserfs_warning ("STATDATA, index %d, type 0x%x, %h\n", 
+    reiserfs_warning (NULL, "STATDATA, index %d, type 0x%x, %h",
 		      vi->vi_index, vi->vi_type, vi->vi_ih);
 }
 
@@ -209,7 +209,7 @@ static int direct_unit_num (struct virtual_item * vi)
 
 static void direct_print_vi (struct virtual_item * vi)
 {
-    reiserfs_warning ("DIRECT, index %d, type 0x%x, %h\n", 
+    reiserfs_warning (NULL, "DIRECT, index %d, type 0x%x, %h",
 		      vi->vi_index, vi->vi_type, vi->vi_ih);
 }
 
@@ -302,7 +302,7 @@ static void indirect_print_item (struct item_head * ih, char * item)
     unp = (__u32 *)item;
 
     if (ih_item_len(ih) % UNFM_P_SIZE)
-	printk ("indirect_print_item: invalid item len");  
+	reiserfs_warning (NULL, "indirect_print_item: invalid item len");
 
     printk ("%d pointers\n[ ", (int)I_UNFM_NUM (ih));
     for (j = 0; j < I_UNFM_NUM (ih); j ++) {
@@ -363,7 +363,7 @@ static int indirect_unit_num (struct virtual_item * vi)
 
 static void indirect_print_vi (struct virtual_item * vi)
 {
-    reiserfs_warning ("INDIRECT, index %d, type 0x%x, %h\n", 
+    reiserfs_warning (NULL, "INDIRECT, index %d, type 0x%x, %h",
 		      vi->vi_index, vi->vi_type, vi->vi_ih);
 }
 
@@ -390,7 +390,7 @@ struct item_operations indirect_ops = {
 
 static int direntry_bytes_number (struct item_head * ih, int block_size)
 {
-    reiserfs_warning ("vs-16090: direntry_bytes_number: "
+    reiserfs_warning (NULL, "vs-16090: direntry_bytes_number: "
 		      "bytes number is asked for direntry");
     return 0;
 }
@@ -582,8 +582,7 @@ static int direntry_check_left (struct virtual_item * vi, int free,
     }
 
     if (entries == dir_u->entry_count) {
-	printk ("free spze %d, entry_count %d\n", free, dir_u->entry_count);
-	BUG ();
+	reiserfs_panic (NULL, "free space %d, entry_count %d\n", free, dir_u->entry_count);
     }
 
     /* "." and ".." can not be separated from each other */
@@ -653,7 +652,7 @@ static void direntry_print_vi (struct virtual_item * vi)
     int i;
     struct direntry_uarea * dir_u = vi->vi_uarea;
 
-    reiserfs_warning ("DIRENTRY, index %d, type 0x%x, %h, flags 0x%x\n", 
+    reiserfs_warning (NULL, "DIRENTRY, index %d, type 0x%x, %h, flags 0x%x",
 		      vi->vi_index, vi->vi_type, vi->vi_ih, dir_u->flags);
     printk ("%d entries: ", dir_u->entry_count);
     for (i = 0; i < dir_u->entry_count; i ++)
@@ -682,32 +681,32 @@ struct item_operations direntry_ops = {
 //
 static int errcatch_bytes_number (struct item_head * ih, int block_size)
 {
-    reiserfs_warning ("green-16001: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16001: Invalid item type observed, run fsck ASAP");
     return 0;
 }
 
 static void errcatch_decrement_key (struct cpu_key * key)
 {
-    reiserfs_warning ("green-16002: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16002: Invalid item type observed, run fsck ASAP");
 }
 
 
 static int errcatch_is_left_mergeable (struct key * key, unsigned long bsize)
 {
-    reiserfs_warning ("green-16003: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16003: Invalid item type observed, run fsck ASAP");
     return 0;
 }
 
 
 static void errcatch_print_item (struct item_head * ih, char * item)
 {
-    reiserfs_warning ("green-16004: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16004: Invalid item type observed, run fsck ASAP");
 }
 
 
 static void errcatch_check_item (struct item_head * ih, char * item)
 {
-    reiserfs_warning ("green-16005: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16005: Invalid item type observed, run fsck ASAP");
 }
 
 static int errcatch_create_vi (struct virtual_node * vn,
@@ -715,7 +714,7 @@ static int errcatch_create_vi (struct virtual_node * vn,
 			       int is_affected, 
 			       int insert_size)
 {
-    reiserfs_warning ("green-16006: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16006: Invalid item type observed, run fsck ASAP");
     return 0;	// We might return -1 here as well, but it won't help as create_virtual_node() from where
 		// this operation is called from is of return type void.
 }
@@ -723,32 +722,32 @@ static int errcatch_create_vi (struct virtual_node * vn,
 static int errcatch_check_left (struct virtual_item * vi, int free,
 				int start_skip, int end_skip)
 {
-    reiserfs_warning ("green-16007: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16007: Invalid item type observed, run fsck ASAP");
     return -1;
 }
 
 
 static int errcatch_check_right (struct virtual_item * vi, int free)
 {
-    reiserfs_warning ("green-16008: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16008: Invalid item type observed, run fsck ASAP");
     return -1;
 }
 
 static int errcatch_part_size (struct virtual_item * vi, int first, int count)
 {
-    reiserfs_warning ("green-16009: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16009: Invalid item type observed, run fsck ASAP");
     return 0;
 }
 
 static int errcatch_unit_num (struct virtual_item * vi)
 {
-    reiserfs_warning ("green-16010: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16010: Invalid item type observed, run fsck ASAP");
     return 0;
 }
 
 static void errcatch_print_vi (struct virtual_item * vi)
 {
-    reiserfs_warning ("green-16011: Invalid item type observed, run fsck ASAP\n");
+    reiserfs_warning (NULL, "green-16011: Invalid item type observed, run fsck ASAP");
 }
 
 struct item_operations errcatch_ops = {
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 42425d8b6..52e637f8b 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -271,7 +271,7 @@ int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb,
     jb->journal_list = NULL ;
     jb->bitmaps = vmalloc( mem ) ;
     if (!jb->bitmaps) {
-      reiserfs_warning("clm-2000, unable to allocate bitmaps for journal lists\n") ;
+      reiserfs_warning(p_s_sb, "clm-2000, unable to allocate bitmaps for journal lists") ;
       failed = 1;   
       break ;
     }
@@ -345,7 +345,7 @@ static struct reiserfs_journal_cnode *allocate_cnodes(int num_cnodes) {
 static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) {
   struct reiserfs_journal_cnode *cn ;
 
-  reiserfs_check_lock_depth("get_cnode") ;
+  reiserfs_check_lock_depth(p_s_sb, "get_cnode") ;
 
   if (SB_JOURNAL(p_s_sb)->j_cnode_free <= 0) {
     return NULL ;
@@ -369,7 +369,7 @@ static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) {
 */
 static void free_cnode(struct super_block *p_s_sb, struct reiserfs_journal_cnode *cn) {
 
-  reiserfs_check_lock_depth("free_cnode") ;
+  reiserfs_check_lock_depth(p_s_sb, "free_cnode") ;
 
   SB_JOURNAL(p_s_sb)->j_cnode_used-- ;
   SB_JOURNAL(p_s_sb)->j_cnode_free++ ;
@@ -422,11 +422,10 @@ inline int mark_buffer_not_journaled(struct buffer_head *bh) {
 /* utility function to force a BUG if it is called without the big
 ** kernel lock held.  caller is the string printed just before calling BUG()
 */
-void reiserfs_check_lock_depth(char *caller) {
+void reiserfs_check_lock_depth(struct super_block *sb, char *caller) {
 #ifdef CONFIG_SMP
   if (current->lock_depth < 0) {
-    printk("%s called without kernel lock held\n", caller) ;
-    BUG() ;
+    reiserfs_panic (sb, "%s called without kernel lock held", caller) ;
   }
 #else
   ;
@@ -559,9 +558,8 @@ static inline void put_journal_list(struct super_block *s,
                                    struct reiserfs_journal_list *jl)
 {
     if (jl->j_refcount < 1) {
-        printk("trans id %lu, refcount at %d\n", jl->j_trans_id,
+        reiserfs_panic (s, "trans id %lu, refcount at %d", jl->j_trans_id,
 	                                         jl->j_refcount);
-        BUG();
     }
     if (--jl->j_refcount == 0)
         reiserfs_kfree(jl, sizeof(struct reiserfs_journal_list), s);
@@ -601,7 +599,7 @@ static void reiserfs_end_buffer_io_sync(struct buffer_head *bh, int uptodate) {
     char b[BDEVNAME_SIZE];
 
     if (buffer_journaled(bh)) {
-        reiserfs_warning("clm-2084: pinned buffer %lu:%s sent to disk\n",
+        reiserfs_warning(NULL, "clm-2084: pinned buffer %lu:%s sent to disk",
 	                 bh->b_blocknr, bdevname(bh->b_bdev, b)) ;
     }
     if (uptodate)
@@ -912,7 +910,7 @@ static int flush_commit_list(struct super_block *s, struct reiserfs_journal_list
   struct buffer_head *tbh = NULL ;
   unsigned long trans_id = jl->j_trans_id;
 
-  reiserfs_check_lock_depth("flush_commit_list") ;
+  reiserfs_check_lock_depth(s, "flush_commit_list") ;
 
   if (atomic_read(&jl->j_older_commits_done)) {
     return 0 ;
@@ -1007,7 +1005,7 @@ static int flush_commit_list(struct super_block *s, struct reiserfs_journal_list
   bforget(jl->j_commit_bh) ;
   if (SB_JOURNAL(s)->j_last_commit_id != 0 &&
      (jl->j_trans_id - SB_JOURNAL(s)->j_last_commit_id) != 1) {
-      reiserfs_warning("clm-2200: last commit %lu, current %lu\n",
+      reiserfs_warning(s, "clm-2200: last commit %lu, current %lu",
                        SB_JOURNAL(s)->j_last_commit_id,
 		       jl->j_trans_id);
   }
@@ -1066,8 +1064,8 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb, struct reis
   while(cn) {
     if (cn->blocknr != 0) {
       if (debug) {
-        printk("block %u, bh is %d, state %ld\n", cn->blocknr, cn->bh ? 1: 0,
-	        cn->state) ;
+       reiserfs_warning (p_s_sb, "block %u, bh is %d, state %ld", cn->blocknr,
+                         cn->bh ? 1: 0, cn->state) ;
       }
       cn->state = 0 ;
       remove_journal_hash(p_s_sb, SB_JOURNAL(p_s_sb)->j_list_hash_table, jl, cn->blocknr, 1) ;
@@ -1104,7 +1102,7 @@ static int _update_journal_header_block(struct super_block *p_s_sb, unsigned lon
     set_buffer_dirty(SB_JOURNAL(p_s_sb)->j_header_bh) ;
     sync_dirty_buffer(SB_JOURNAL(p_s_sb)->j_header_bh) ;
     if (!buffer_uptodate(SB_JOURNAL(p_s_sb)->j_header_bh)) {
-      printk( "reiserfs: journal-837: IO error during journal replay\n" );
+      reiserfs_warning (p_s_sb, "journal-837: IO error during journal replay");
       return -EIO ;
     }
   }
@@ -1178,7 +1176,7 @@ static int flush_journal_list(struct super_block *s,
   }
 
   if (atomic_read(&SB_JOURNAL(s)->j_wcount) != 0) {
-    reiserfs_warning("clm-2048: flush_journal_list called with wcount %d\n",
+    reiserfs_warning(s, "clm-2048: flush_journal_list called with wcount %d",
                       atomic_read(&SB_JOURNAL(s)->j_wcount)) ;
   }
   if (jl->j_trans_id == 0)
@@ -1277,8 +1275,10 @@ static int flush_journal_list(struct super_block *s,
     ** is not marked JDirty_wait
     */
     if ((!was_jwait) && !buffer_locked(saved_bh)) {
-printk("journal-813: BAD! buffer %llu %cdirty %cjwait, not in a newer tranasction\n", (unsigned long long)saved_bh->b_blocknr,
-        was_dirty ? ' ' : '!', was_jwait ? ' ' : '!') ;
+	reiserfs_warning (s, "journal-813: BAD! buffer %llu %cdirty %cjwait, "
+			  "not in a newer tranasction",
+			  (unsigned long long)saved_bh->b_blocknr,
+			  was_dirty ? ' ' : '!', was_jwait ? ' ' : '!') ;
     }
     if (was_dirty) { 
       /* we inc again because saved_bh gets decremented at free_cnode */
@@ -1293,8 +1293,8 @@ printk("journal-813: BAD! buffer %llu %cdirty %cjwait, not in a newer tranasctio
         unlock_buffer(saved_bh);
       count++ ;
     } else {
-      printk("clm-2082: Unable to flush buffer %llu in flush_journal_list\n",
-              (unsigned long long)saved_bh->b_blocknr) ;
+      reiserfs_warning (s, "clm-2082: Unable to flush buffer %llu in %s",
+                        (unsigned long long)saved_bh->b_blocknr, __FUNCTION__);
     }
 free_cnode:
     last = cn ;
@@ -1303,7 +1303,7 @@ free_cnode:
       /* we incremented this to keep others from taking the buffer head away */
       put_bh(saved_bh) ;
       if (atomic_read(&(saved_bh->b_count)) < 0) {
-        printk("journal-945: saved_bh->b_count < 0") ;
+        reiserfs_warning (s, "journal-945: saved_bh->b_count < 0");
       }
     }
   }
@@ -1363,7 +1363,7 @@ flush_older_and_return:
 
   if (SB_JOURNAL(s)->j_last_flush_id != 0 &&
      (jl->j_trans_id - SB_JOURNAL(s)->j_last_flush_id) != 1) {
-      reiserfs_warning("clm-2201: last flush %lu, current %lu\n",
+      reiserfs_warning(s, "clm-2201: last flush %lu, current %lu",
                        SB_JOURNAL(s)->j_last_flush_id,
 		       jl->j_trans_id);
   }
@@ -1712,19 +1712,19 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffe
     if (oldest_invalid_trans_id && *oldest_invalid_trans_id && get_desc_trans_id(desc) > *oldest_invalid_trans_id) {
       reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-986: transaction "
 	              "is valid returning because trans_id %d is greater than "
-		      "oldest_invalid %lu\n", get_desc_trans_id(desc), 
+		      "oldest_invalid %lu", get_desc_trans_id(desc),
 		       *oldest_invalid_trans_id);
       return 0 ;
     }
     if (newest_mount_id && *newest_mount_id > get_desc_mount_id (desc)) {
       reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1087: transaction "
                      "is valid returning because mount_id %d is less than "
-		     "newest_mount_id %lu\n", get_desc_mount_id (desc), 
+		     "newest_mount_id %lu", get_desc_mount_id (desc),
 		     *newest_mount_id) ;
       return -1 ;
     }
     if ( get_desc_trans_len(desc) > SB_JOURNAL_TRANS_MAX(p_s_sb) ) {
-      reiserfs_warning("journal-2018: Bad transaction length %d encountered, ignoring transaction\n", get_desc_trans_len(desc));
+      reiserfs_warning(p_s_sb, "journal-2018: Bad transaction length %d encountered, ignoring transaction", get_desc_trans_len(desc));
       return -1 ;
     }
     offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
@@ -1738,7 +1738,7 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffe
     if (journal_compare_desc_commit(p_s_sb, desc, commit)) {
       reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, 
                      "journal_transaction_is_valid, commit offset %ld had bad "
-		     "time %d or length %d\n", 
+		     "time %d or length %d",
 		     c_bh->b_blocknr -  SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
 		     get_commit_trans_id (commit), 
 		     get_commit_trans_len(commit));
@@ -1746,14 +1746,14 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffe
       if (oldest_invalid_trans_id) {
 	*oldest_invalid_trans_id = get_desc_trans_id(desc) ;
 	reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1004: "
-	               "transaction_is_valid setting oldest invalid trans_id "
-		       "to %d\n", get_desc_trans_id(desc)) ;
+		       "transaction_is_valid setting oldest invalid trans_id "
+		       "to %d", get_desc_trans_id(desc)) ;
       }
       return -1; 
     }
     brelse(c_bh) ;
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1006: found valid "
-                   "transaction start offset %llu, len %d id %d\n",
+                   "transaction start offset %llu, len %d id %d",
 		   d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), 
 		   get_desc_trans_len(desc), get_desc_trans_id(desc)) ;
     return 1 ;
@@ -1793,12 +1793,12 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
   desc = (struct reiserfs_journal_desc *)d_bh->b_data ;
   trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
   reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1037: "
-                 "journal_read_transaction, offset %llu, len %d mount_id %d\n",
+                 "journal_read_transaction, offset %llu, len %d mount_id %d",
 		 d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), 
 		 get_desc_trans_len(desc), get_desc_mount_id(desc)) ;
   if (get_desc_trans_id(desc) < oldest_trans_id) {
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1039: "
-                   "journal_read_trans skipping because %lu is too old\n", 
+                   "journal_read_trans skipping because %lu is too old",
 		   cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)) ;
     brelse(d_bh) ;
     return 1 ;
@@ -1806,7 +1806,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
   if (get_desc_mount_id(desc) != newest_mount_id) {
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1146: "
                    "journal_read_trans skipping because %d is != "
-		   "newest_mount_id %lu\n", get_desc_mount_id(desc), 
+		   "newest_mount_id %lu", get_desc_mount_id(desc),
 		    newest_mount_id) ;
     brelse(d_bh) ;
     return 1 ;
@@ -1821,7 +1821,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
   commit = (struct reiserfs_journal_commit *)c_bh->b_data ;
   if (journal_compare_desc_commit(p_s_sb, desc, commit)) {
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal_read_transaction, "
-                   "commit offset %llu had bad time %d or length %d\n",
+                   "commit offset %llu had bad time %d or length %d",
 		   c_bh->b_blocknr -  SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), 
 		   get_commit_trans_id(commit), get_commit_trans_len(commit));
     brelse(c_bh) ;
@@ -1837,7 +1837,7 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
     brelse(d_bh) ;
     reiserfs_kfree(log_blocks, get_desc_trans_len(desc) * sizeof(struct buffer_head *), p_s_sb) ;
     reiserfs_kfree(real_blocks, get_desc_trans_len(desc) * sizeof(struct buffer_head *), p_s_sb) ;
-    reiserfs_warning("journal-1169: kmalloc failed, unable to mount FS\n") ;
+    reiserfs_warning(p_s_sb, "journal-1169: kmalloc failed, unable to mount FS") ;
     return -1 ;
   }
   /* get all the buffer heads */
@@ -1850,12 +1850,12 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
       real_blocks[i] = sb_getblk(p_s_sb, le32_to_cpu(commit->j_realblock[i - trans_half])) ;
     }
     if ( real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb) ) {
-      reiserfs_warning("journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem\n");
+      reiserfs_warning(p_s_sb, "journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem");
       goto abort_replay;
     }
     /* make sure we don't try to replay onto log or reserved area */
     if (is_block_in_log_or_reserved_area(p_s_sb, real_blocks[i]->b_blocknr)) {
-      reiserfs_warning("journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block\n") ;
+      reiserfs_warning(p_s_sb, "journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block") ;
 abort_replay:
       brelse_array(log_blocks, i) ;
       brelse_array(real_blocks, i) ;
@@ -1871,7 +1871,7 @@ abort_replay:
   for (i = 0 ; i < get_desc_trans_len(desc) ; i++) {
     wait_on_buffer(log_blocks[i]) ;
     if (!buffer_uptodate(log_blocks[i])) {
-      reiserfs_warning("journal-1212: REPLAY FAILURE fsck required! buffer write failed\n") ;
+      reiserfs_warning(p_s_sb, "journal-1212: REPLAY FAILURE fsck required! buffer write failed") ;
       brelse_array(log_blocks + i, get_desc_trans_len(desc) - i) ;
       brelse_array(real_blocks, get_desc_trans_len(desc)) ;
       brelse(c_bh) ;
@@ -1892,7 +1892,7 @@ abort_replay:
   for (i = 0 ; i < get_desc_trans_len(desc) ; i++) {
     wait_on_buffer(real_blocks[i]) ; 
     if (!buffer_uptodate(real_blocks[i])) {
-      reiserfs_warning("journal-1226: REPLAY FAILURE, fsck required! buffer write failed\n") ;
+      reiserfs_warning(p_s_sb, "journal-1226: REPLAY FAILURE, fsck required! buffer write failed") ;
       brelse_array(real_blocks + i, get_desc_trans_len(desc) - i) ;
       brelse(c_bh) ;
       brelse(d_bh) ;
@@ -1904,7 +1904,7 @@ abort_replay:
   }
   cur_dblock =  SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + ((trans_offset + get_desc_trans_len(desc) + 2) % SB_ONDISK_JOURNAL_SIZE(p_s_sb)) ;
   reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1095: setting journal "
-                 "start to offset %ld\n", 
+                 "start to offset %ld",
 		 cur_dblock -  SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)) ;
   
   /* init starting values for the first transaction, in case this is the last transaction to be replayed. */
@@ -1986,9 +1986,8 @@ static int journal_read(struct super_block *p_s_sb) {
   char b[BDEVNAME_SIZE];
 
   cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
-  printk("reiserfs: checking transaction log (%s) for (%s)\n",
-	 bdevname(SB_JOURNAL(p_s_sb)->j_dev_bd, b),
-	 reiserfs_bdevname(p_s_sb));
+  reiserfs_info (p_s_sb, "checking transaction log (%s)\n",
+	 bdevname(SB_JOURNAL(p_s_sb)->j_dev_bd, b));
   start = get_seconds();
 
   /* step 1, read in the journal header block.  Check the transaction it says 
@@ -2011,7 +2010,7 @@ static int journal_read(struct super_block *p_s_sb) {
     newest_mount_id = le32_to_cpu(jh->j_mount_id);
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1153: found in "
                    "header: first_unflushed_offset %d, last_flushed_trans_id "
-		   "%lu\n", le32_to_cpu(jh->j_first_unflushed_offset), 
+		   "%lu", le32_to_cpu(jh->j_first_unflushed_offset),
 		   le32_to_cpu(jh->j_last_flush_trans_id)) ;
     valid_journal_header = 1 ;
 
@@ -2029,7 +2028,8 @@ static int journal_read(struct super_block *p_s_sb) {
   }
 
   if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) {
-    printk("clm-2076: device is readonly, unable to replay log\n") ;
+    reiserfs_warning (p_s_sb,
+		      "clm-2076: device is readonly, unable to replay log") ;
     return -1 ;
   }
 
@@ -2049,7 +2049,7 @@ static int journal_read(struct super_block *p_s_sb) {
 	oldest_start = d_bh->b_blocknr ;
 	newest_mount_id = get_desc_mount_id(desc) ;
 	reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1179: Setting "
-	               "oldest_start to offset %llu, trans_id %lu\n",
+	               "oldest_start to offset %llu, trans_id %lu",
 		       oldest_start - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), 
 		       oldest_trans_id) ;
       } else if (oldest_trans_id > get_desc_trans_id(desc)) { 
@@ -2057,14 +2057,14 @@ static int journal_read(struct super_block *p_s_sb) {
         oldest_trans_id = get_desc_trans_id(desc) ;
 	oldest_start = d_bh->b_blocknr ;
 	reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1180: Resetting "
-	               "oldest_start to offset %lu, trans_id %lu\n", 
+	               "oldest_start to offset %lu, trans_id %lu",
 			oldest_start - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), 
 			oldest_trans_id) ;
       }
       if (newest_mount_id < get_desc_mount_id(desc)) {
         newest_mount_id = get_desc_mount_id(desc) ;
 	reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1299: Setting "
-	              "newest_mount_id to %d\n", get_desc_mount_id(desc));
+	              "newest_mount_id to %d", get_desc_mount_id(desc));
       }
       cur_dblock += get_desc_trans_len(desc) + 2 ;
     } else {
@@ -2077,7 +2077,7 @@ start_log_replay:
   cur_dblock = oldest_start ;
   if (oldest_trans_id)  {
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1206: Starting replay "
-                   "from offset %llu, trans_id %lu\n",
+                   "from offset %llu, trans_id %lu",
 		   cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb), 
 		   oldest_trans_id) ;
 
@@ -2098,7 +2098,7 @@ start_log_replay:
 
   if (oldest_trans_id == 0) {
     reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1225: No valid "
-                   "transactions found\n") ;
+                   "transactions found") ;
   }
   /* j_start does not get set correctly if we don't replay any transactions.
   ** if we had a valid journal_header, set j_start to the first unflushed transaction value,
@@ -2113,11 +2113,11 @@ start_log_replay:
     SB_JOURNAL(p_s_sb)->j_mount_id = newest_mount_id + 1 ;
   }
   reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1299: Setting "
-                 "newest_mount_id to %lu\n", SB_JOURNAL(p_s_sb)->j_mount_id) ;
+                 "newest_mount_id to %lu", SB_JOURNAL(p_s_sb)->j_mount_id) ;
   SB_JOURNAL(p_s_sb)->j_first_unflushed_offset = SB_JOURNAL(p_s_sb)->j_start ; 
   if (replay_count > 0) {
-    printk("reiserfs: replayed %d transactions in %lu seconds\n", replay_count, 
-	    get_seconds() - start) ;
+    reiserfs_info (p_s_sb, "replayed %d transactions in %lu seconds\n",
+		   replay_count, get_seconds() - start) ;
   }
   if (!bdev_read_only(p_s_sb->s_bdev) && 
        _update_journal_header_block(p_s_sb, SB_JOURNAL(p_s_sb)->j_start, 
@@ -2172,7 +2172,7 @@ static int release_journal_dev( struct super_block *super,
     }
 
     if( result != 0 ) {
-	reiserfs_warning("sh-457: release_journal_dev: Cannot release journal device: %i\n", result );
+	reiserfs_warning(super, "sh-457: release_journal_dev: Cannot release journal device: %i", result );
     }
     return result;
 }
@@ -2202,8 +2202,9 @@ static int journal_init_dev( struct super_block *super,
 		if (IS_ERR(journal->j_dev_bd)) {
 			result = PTR_ERR(journal->j_dev_bd);
 			journal->j_dev_bd = NULL;
-			printk( "sh-458: journal_init_dev: cannot init journal device\n '%s': %i", 
-				__bdevname(jdev, b), result );
+			reiserfs_warning (super, "sh-458: journal_init_dev: "
+					  "cannot init journal device '%s': %i",
+					  __bdevname(jdev, b), result );
 			return result;
 		} else if (jdev != super->s_dev)
 			set_blocksize(journal->j_dev_bd, super->s_blocksize);
@@ -2214,7 +2215,8 @@ static int journal_init_dev( struct super_block *super,
 	if( !IS_ERR( journal -> j_dev_file ) ) {
 		struct inode *jdev_inode = journal->j_dev_file->f_mapping->host;
 		if( !S_ISBLK( jdev_inode -> i_mode ) ) {
-			printk( "journal_init_dev: '%s' is not a block device\n", jdev_name );
+			reiserfs_warning  (super, "journal_init_dev: '%s' is "
+					   "not a block device", jdev_name );
 			result = -ENOTBLK;
 		} else  {
 			/* ok */
@@ -2224,12 +2226,14 @@ static int journal_init_dev( struct super_block *super,
 	} else {
 		result = PTR_ERR( journal -> j_dev_file );
 		journal -> j_dev_file = NULL;
-		printk( "journal_init_dev: Cannot open '%s': %i\n", jdev_name, result );
+		reiserfs_warning (super,
+				  "journal_init_dev: Cannot open '%s': %i",
+				  jdev_name, result );
 	}
 	if( result != 0 ) {
 		release_journal_dev( super, journal );
 	}
-	printk( "journal_init_dev: journal device: %s\n",
+	reiserfs_info(super, "journal_init_dev: journal device: %s\n",
 		bdevname(journal->j_dev_bd, b));
 	return result;
 }
@@ -2248,7 +2252,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
 
     journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof (struct reiserfs_journal)) ;
     if (!journal) {
-	printk("journal-1256: unable to get memory for journal structure\n") ;
+	reiserfs_warning (p_s_sb, "journal-1256: unable to get memory for journal structure") ;
 	return 1 ;
     }
     memset(journal, 0, sizeof(struct reiserfs_journal)) ;
@@ -2256,8 +2260,10 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
     INIT_LIST_HEAD (&SB_JOURNAL(p_s_sb)->j_prealloc_list);
     INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_working_list);
     INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_journal_list);
-    reiserfs_allocate_list_bitmaps(p_s_sb, SB_JOURNAL(p_s_sb)->j_list_bitmap, 
- 				   SB_BMAP_NR(p_s_sb)) ;
+    if (reiserfs_allocate_list_bitmaps(p_s_sb,
+				       SB_JOURNAL(p_s_sb)->j_list_bitmap,
+ 				       SB_BMAP_NR(p_s_sb)))
+	goto free_and_return ;
     allocate_bitmap_nodes(p_s_sb) ;
 
     /* reserved for journal area support */
@@ -2270,14 +2276,16 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
        (actual for small blocksizes) */
     if ( !SB_ONDISK_JOURNAL_DEVICE( p_s_sb ) &&
          (SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8) ) {
-	printk("journal-1393: journal does not fit for area addressed by first of bitmap blocks. "
-	       "It starts at %u and its size is %u. Block size %ld\n",
-		SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_SIZE(p_s_sb), p_s_sb->s_blocksize) ;
+	reiserfs_warning (p_s_sb, "journal-1393: journal does not fit for area "
+			  "addressed by first of bitmap blocks. It starts at "
+			  "%u and its size is %u. Block size %ld",
+			  SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb),
+			  SB_ONDISK_JOURNAL_SIZE(p_s_sb), p_s_sb->s_blocksize);
 	goto free_and_return;
     }
 
     if( journal_init_dev( p_s_sb, journal, j_dev_name ) != 0 ) {
-      printk( "sh-462: unable to initialize jornal device\n");
+      reiserfs_warning (p_s_sb, "sh-462: unable to initialize jornal device");
       goto free_and_return;
     }
 
@@ -2287,18 +2295,19 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
      bhjh = journal_bread(p_s_sb,
 		   SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_SIZE(p_s_sb));
      if (!bhjh) {
-	 printk("sh-459: unable to read  journal header\n") ;
+	 reiserfs_warning (p_s_sb, "sh-459: unable to read journal header");
 	 goto free_and_return;
      }
      jh = (struct reiserfs_journal_header *)(bhjh->b_data);
      
      /* make sure that journal matches to the super block */
      if (is_reiserfs_jr(rs) && (jh->jh_journal.jp_journal_magic != sb_jp_journal_magic(rs))) {
-	 printk("sh-460: journal header magic %x (device %s) does not match "
-		"to magic found in super block %x (device %s)\n",
-		jh->jh_journal.jp_journal_magic,
-		bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
-		sb_jp_journal_magic(rs), reiserfs_bdevname (p_s_sb));
+	 reiserfs_warning (p_s_sb, "sh-460: journal header magic %x "
+			   "(device %s) does not match to magic found in super "
+			   "block %x",
+			   jh->jh_journal.jp_journal_magic,
+			   bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
+			   sb_jp_journal_magic(rs));
 	 brelse (bhjh);
 	 goto free_and_return;
   }
@@ -2324,7 +2333,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
       SB_JOURNAL_TRANS_MAX(p_s_sb) = JOURNAL_TRANS_MIN_DEFAULT / ratio;
     
     if (SB_JOURNAL_TRANS_MAX(p_s_sb) != initial)
-      printk ("sh-461: journal_init: wrong transaction max size (%u). Changed to %u\n",
+      reiserfs_warning (p_s_sb, "sh-461: journal_init: wrong transaction max size (%u). Changed to %u",
 	      initial, SB_JOURNAL_TRANS_MAX(p_s_sb));
 
     SB_JOURNAL_MAX_BATCH(p_s_sb) = SB_JOURNAL_TRANS_MAX(p_s_sb)*
@@ -2353,16 +2362,16 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
       SB_JOURNAL_MAX_TRANS_AGE(p_s_sb) = commit_max_age;
   }
 
-  printk ("Reiserfs journal params: device %s, size %u, "
-	  "journal first block %u, max trans len %u, max batch %u, "
-	  "max commit age %u, max trans age %u\n",
-	  bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
-	  SB_ONDISK_JOURNAL_SIZE(p_s_sb),
-	  SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
-	  SB_JOURNAL_TRANS_MAX(p_s_sb),
-	  SB_JOURNAL_MAX_BATCH(p_s_sb),
-	  SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb),
-	  SB_JOURNAL_MAX_TRANS_AGE(p_s_sb));
+  reiserfs_info (p_s_sb, "journal params: device %s, size %u, "
+		 "journal first block %u, max trans len %u, max batch %u, "
+		 "max commit age %u, max trans age %u\n",
+		 bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
+		 SB_ONDISK_JOURNAL_SIZE(p_s_sb),
+		 SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
+		 SB_JOURNAL_TRANS_MAX(p_s_sb),
+		 SB_JOURNAL_MAX_BATCH(p_s_sb),
+		 SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb),
+		 SB_JOURNAL_MAX_TRANS_AGE(p_s_sb));
 
   brelse (bhjh);
      
@@ -2401,11 +2410,11 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
   jl = SB_JOURNAL(p_s_sb)->j_current_jl;
   jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
   if (!jl->j_list_bitmap) {
-    reiserfs_warning("journal-2005, get_list_bitmap failed for journal list 0\n") ;
+    reiserfs_warning(p_s_sb, "journal-2005, get_list_bitmap failed for journal list 0") ;
     goto free_and_return;
   }
   if (journal_read(p_s_sb) < 0) {
-    reiserfs_warning("Replay Failure, unable to mount\n") ;
+    reiserfs_warning(p_s_sb, "Replay Failure, unable to mount") ;
     goto free_and_return;
   }
 
@@ -2522,7 +2531,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th, struct sup
   struct reiserfs_transaction_handle myth;
   int sched_count = 0;
 
-  reiserfs_check_lock_depth("journal_begin") ;
+  reiserfs_check_lock_depth(p_s_sb, "journal_begin") ;
   RFALSE( p_s_sb->s_flags & MS_RDONLY, 
 	  "clm-2078: calling journal_begin on readonly FS") ;
 
@@ -2664,14 +2673,14 @@ int journal_begin(struct reiserfs_transaction_handle *th, struct super_block  *
 	      cur_th->t_refcount++ ;
 	      memcpy(th, cur_th, sizeof(*th));
 	      if (th->t_refcount <= 1)
-		      printk("BAD: refcount <= 1, but journal_info != 0\n");
+		      reiserfs_warning (p_s_sb, "BAD: refcount <= 1, but journal_info != 0");
 	      return 0;
 	} else {
 	    /* we've ended up with a handle from a different filesystem.
 	    ** save it and restore on journal_end.  This should never
 	    ** really happen...
 	    */
-	    reiserfs_warning("clm-2100: nesting info a different FS\n") ;
+	    reiserfs_warning(p_s_sb, "clm-2100: nesting info a different FS") ;
 	    th->t_handle_save = current->journal_info ;
 	    current->journal_info = th;
 	}
@@ -2718,14 +2727,16 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, struct super_bloc
   ** could get to disk too early.  NOT GOOD.
   */
   if (!prepared || buffer_dirty(bh)) {
-    printk("journal-1777: buffer %llu bad state %cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT\n", (unsigned long long)bh->b_blocknr, prepared ? ' ' : '!', 
-                            buffer_locked(bh) ? ' ' : '!',
+    reiserfs_warning (p_s_sb, "journal-1777: buffer %llu bad state "
+		      "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT",
+		      (unsigned long long)bh->b_blocknr, prepared ? ' ' : '!',
+			    buffer_locked(bh) ? ' ' : '!',
 			    buffer_dirty(bh) ? ' ' : '!',
 			    buffer_journal_dirty(bh) ? ' ' : '!') ;
   }
 
   if (atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount)) <= 0) {
-    printk("journal-1409: journal_mark_dirty returning because j_wcount was %d\n", atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount))) ;
+    reiserfs_warning (p_s_sb, "journal-1409: journal_mark_dirty returning because j_wcount was %d", atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount))) ;
     return 1 ;
   }
   /* this error means I've screwed up, and we've overflowed the transaction.  
@@ -2785,7 +2796,8 @@ int journal_mark_dirty(struct reiserfs_transaction_handle *th, struct super_bloc
 
 int journal_end(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks) {
   if (!current->journal_info && th->t_refcount > 1)
-    printk("REISER-NESTING: th NULL, refcount %d\n", th->t_refcount);
+    reiserfs_warning (p_s_sb, "REISER-NESTING: th NULL, refcount %d",
+                      th->t_refcount);
 
   th->t_refcount--;
   if (th->t_refcount > 0) {
@@ -2844,7 +2856,7 @@ static int remove_from_transaction(struct super_block *p_s_sb, b_blocknr_t block
     mark_buffer_notjournal_dirty(bh) ; 
     put_bh(bh) ;
     if (atomic_read(&(bh->b_count)) < 0) {
-      printk("journal-1752: remove from trans, b_count < 0\n") ;
+      reiserfs_warning (p_s_sb, "journal-1752: remove from trans, b_count < 0");
     }
     ret = 1 ;
   }
@@ -3142,7 +3154,7 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, struct super_bloc
 	    cleaned = 1 ;
 	    put_bh(cn->bh) ;
 	    if (atomic_read(&(cn->bh->b_count)) < 0) {
-	      printk("journal-2138: cn->bh->b_count < 0\n") ;
+	      reiserfs_warning (p_s_sb, "journal-2138: cn->bh->b_count < 0");
 	    }
 	  }
 	  if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */
@@ -3158,7 +3170,7 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, struct super_bloc
   if (bh) {
     put_bh(bh) ; /* get_hash grabs the buffer */
     if (atomic_read(&(bh->b_count)) < 0) {
-      printk("journal-2165: bh->b_count < 0\n") ;
+      reiserfs_warning (p_s_sb, "journal-2165: bh->b_count < 0");
     }
   }
   return 0 ;
@@ -3318,7 +3330,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b
     BUG() ;
 
   current->journal_info = th->t_handle_save;
-  reiserfs_check_lock_depth("journal end");
+  reiserfs_check_lock_depth(p_s_sb, "journal end");
   if (SB_JOURNAL(p_s_sb)->j_len == 0) {
       reiserfs_prepare_for_journal(p_s_sb, SB_BUFFER_WITH_SB(p_s_sb), 1) ;
       journal_mark_dirty(th, p_s_sb, SB_BUFFER_WITH_SB(p_s_sb)) ;
@@ -3480,7 +3492,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b
       clear_bit(BH_JDirty, &(cn->bh->b_state)) ;
     } else {
       /* JDirty cleared sometime during transaction.  don't log this one */
-      reiserfs_warning("journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!\n") ;
+      reiserfs_warning(p_s_sb, "journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!") ;
       brelse(cn->bh) ;
     }
     next = cn->next ;
@@ -3612,7 +3624,7 @@ first_jl:
 	  flush_commit_list(p_s_sb, jl, 1) ;
   }
 out:
-  reiserfs_check_lock_depth("journal end2");
+  reiserfs_check_lock_depth(p_s_sb, "journal end2");
   th->t_trans_id = 0;
   return 0 ;
 }
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 37c3b0f45..b1cef222a 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -1210,10 +1210,10 @@ void    leaf_paste_entries (
       prev = (i != 0) ? deh_location( &(deh[i - 1]) ) : 0;
       
       if (prev && prev <= deh_location( &(deh[i])))
-	reiserfs_warning ("vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)\n", 
+	reiserfs_warning (NULL, "vs-10240: leaf_paste_entries: directory item (%h) corrupted (prev %a, cur(%d) %a)",
 			  ih, deh + i - 1, i, deh + i);
       if (next && next >= deh_location( &(deh[i])))
-	reiserfs_warning ("vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)\n",
+	reiserfs_warning (NULL, "vs-10250: leaf_paste_entries: directory item (%h) corrupted (cur(%d) %a, next %a)",
 			  ih, i, deh + i, deh + i + 1);
     }
   }
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 5dae18f5b..52d88ae28 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -15,7 +15,10 @@
 #include <linux/time.h>
 #include <linux/bitops.h>
 #include <linux/reiserfs_fs.h>
+#include <linux/reiserfs_acl.h>
+#include <linux/reiserfs_xattr.h>
 #include <linux/smp_lock.h>
+#include <linux/quotaops.h>
 
 #define INC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) { i->i_nlink++; if (i->i_nlink >= REISERFS_LINK_MAX) i->i_nlink=1; }
 #define DEC_DIR_INODE_NLINK(i) if (i->i_nlink != 1) i->i_nlink--;
@@ -123,7 +126,7 @@ int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
     switch (retval) {
     case ITEM_NOT_FOUND:
 	if (!PATH_LAST_POSITION (path)) {
-	    reiserfs_warning ("vs-7000: search_by_entry_key: search_by_key returned item position == 0");
+	    reiserfs_warning (sb, "vs-7000: search_by_entry_key: search_by_key returned item position == 0");
 	    pathrelse(path) ;
 	    return IO_ERROR ;
 	}
@@ -137,7 +140,7 @@ int search_by_entry_key (struct super_block * sb, const struct cpu_key * key,
 
     default:
 	pathrelse (path);
-	reiserfs_warning ("vs-7002: search_by_entry_key: no path to here");
+	reiserfs_warning (sb, "vs-7002: search_by_entry_key: no path to here");
 	return IO_ERROR;
     }
 
@@ -296,7 +299,8 @@ static int reiserfs_find_entry (struct inode * dir, const char * name, int namel
     while (1) {
 	retval = search_by_entry_key (dir->i_sb, &key_to_search, path_to_entry, de);
 	if (retval == IO_ERROR) {
-	    reiserfs_warning ("zam-7001: io error in %s\n", __FUNCTION__);
+	    reiserfs_warning (dir->i_sb, "zam-7001: io error in %s",
+			      __FUNCTION__);
 	    return IO_ERROR;
 	}
 
@@ -331,11 +335,24 @@ static struct dentry * reiserfs_lookup (struct inode * dir, struct dentry * dent
     retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path_to_entry, &de);
     pathrelse (&path_to_entry);
     if (retval == NAME_FOUND) {
+        /* Hide the .reiserfs_priv directory */
+	if (reiserfs_xattrs (dir->i_sb) &&
+	    !old_format_only(dir->i_sb) &&
+            REISERFS_SB(dir->i_sb)->priv_root &&
+            REISERFS_SB(dir->i_sb)->priv_root->d_inode &&
+	    de.de_objectid == le32_to_cpu (INODE_PKEY(REISERFS_SB(dir->i_sb)->priv_root->d_inode)->k_objectid)) {
+	  return ERR_PTR (-EACCES);
+	}
+
 	inode = reiserfs_iget (dir->i_sb, (struct cpu_key *)&(de.de_dir_id));
 	if (!inode || IS_ERR(inode)) {
 	    reiserfs_write_unlock(dir->i_sb);
 	    return ERR_PTR(-EACCES);
         }
+
+	/* Propogate the priv_object flag so we know we're in the priv tree */
+	if (is_reiserfs_priv_object (dir))
+	    REISERFS_I(inode)->i_flags |= i_priv_object;
     }
     reiserfs_write_unlock(dir->i_sb);
     if ( retval == IO_ERROR ) {
@@ -468,8 +485,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
 	}
 
         if (retval != NAME_FOUND) {
-	    reiserfs_warning ("zam-7002:%s: \"reiserfs_find_entry\" has returned"
-                              " unexpected value (%d)\n", __FUNCTION__, retval);
+	    reiserfs_warning (dir->i_sb, "zam-7002:%s: \"reiserfs_find_entry\" "
+			      "has returned unexpected value (%d)",
+			      __FUNCTION__, retval);
        }
 
 	return -EEXIST;
@@ -478,7 +496,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
     gen_number = find_first_zero_bit ((unsigned long *)bit_string, MAX_GENERATION_NUMBER + 1);
     if (gen_number > MAX_GENERATION_NUMBER) {
       /* there is no free generation number */
-      reiserfs_warning ("reiserfs_add_entry: Congratulations! we have got hash function screwed up\n");
+      reiserfs_warning (dir->i_sb, "reiserfs_add_entry: Congratulations! we have got hash function screwed up");
       if (buffer != small_buf)
           reiserfs_kfree (buffer, buflen, dir->i_sb);
       pathrelse (&path);
@@ -493,8 +511,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
  		  
     if (gen_number != 0) {	/* we need to re-search for the insertion point */
       if (search_by_entry_key (dir->i_sb, &entry_key, &path, &de) != NAME_NOT_FOUND) {
-            reiserfs_warning ("vs-7032: reiserfs_add_entry: "
-                            "entry with this key (%K) already exists\n", &entry_key);
+            reiserfs_warning (dir->i_sb, "vs-7032: reiserfs_add_entry: "
+                              "entry with this key (%K) already exists",
+                              &entry_key);
 
 	    if (buffer != small_buf)
 		reiserfs_kfree (buffer, buflen, dir->i_sb);
@@ -504,7 +523,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
     }
   
     /* perform the insertion of the entry that we have prepared */
-    retval = reiserfs_paste_into_item (th, &path, &entry_key, buffer, paste_size);
+    retval = reiserfs_paste_into_item (th, &path, &entry_key, dir, buffer, paste_size);
     if (buffer != small_buf)
 	reiserfs_kfree (buffer, buflen, dir->i_sb);
     if (retval) {
@@ -513,7 +532,6 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
     }
 
     dir->i_size += paste_size;
-    dir->i_blocks = ((dir->i_size + 511) >> 9);
     dir->i_mtime = dir->i_ctime = CURRENT_TIME;
     if (!S_ISDIR (inode->i_mode) && visible)
 	// reiserfs_mkdir or reiserfs_rename will do that by itself
@@ -529,7 +547,9 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in
 ** inserted into the tree yet.
 */
 static int drop_new_inode(struct inode *inode) {
+    DQUOT_DROP(inode);
     make_bad_inode(inode) ;
+    inode->i_flags |= S_NOQUOTA;
     iput(inode) ;
     return 0 ;
 }
@@ -555,6 +575,11 @@ static int new_inode_init(struct inode *inode, struct inode *dir, int mode) {
     } else {
         inode->i_gid = current->fsgid;
     }
+    DQUOT_INIT(inode);
+    if (DQUOT_ALLOC_INODE(inode)) {
+        drop_new_inode(inode);
+	return -EDQUOT;
+    }
     return 0 ;
 }
 
@@ -565,6 +590,7 @@ static int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode,
     struct inode * inode;
     int jbegin_count = JOURNAL_PER_BALANCE_CNT * 2 ;
     struct reiserfs_transaction_handle th ;
+    int locked;
 
     if (!(inode = new_inode(dir->i_sb))) {
 	return -ENOMEM ;
@@ -573,9 +599,19 @@ static int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode,
     if (retval)
         return retval;
 
+    locked = reiserfs_cache_default_acl (dir);
+
     reiserfs_write_lock(dir->i_sb);
+
+    if (locked)
+        reiserfs_write_lock_xattrs (dir->i_sb);
+
     journal_begin(&th, dir->i_sb, jbegin_count) ;
     retval = reiserfs_new_inode (&th, dir, mode, 0, 0/*i_size*/, dentry, inode);
+
+    if (locked)
+        reiserfs_write_unlock_xattrs (dir->i_sb);
+
     if (retval) {
         goto out_failed;
     }
@@ -611,6 +647,7 @@ static int reiserfs_mknod (struct inode * dir, struct dentry *dentry, int mode,
     struct inode * inode;
     struct reiserfs_transaction_handle th ;
     int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3; 
+    int locked;
 
     if (!new_valid_dev(rdev))
 	return -EINVAL;
@@ -622,15 +659,26 @@ static int reiserfs_mknod (struct inode * dir, struct dentry *dentry, int mode,
     if (retval)
         return retval;
 
+    locked = reiserfs_cache_default_acl (dir);
+
     reiserfs_write_lock(dir->i_sb);
+
+    if (locked)
+        reiserfs_write_lock_xattrs (dir->i_sb);
+
     journal_begin(&th, dir->i_sb, jbegin_count) ;
 
     retval = reiserfs_new_inode (&th, dir, mode, 0, 0/*i_size*/, dentry, inode);
+
+    if (locked)
+        reiserfs_write_unlock_xattrs (dir->i_sb);
+
     if (retval) {
         goto out_failed;
     }
 
-    init_special_inode(inode, mode, rdev) ;
+    inode->i_op = &reiserfs_special_inode_operations;
+    init_special_inode(inode, inode->i_mode, rdev) ;
 
     //FIXME: needed for block and char devices only
     reiserfs_update_sd (&th, inode);
@@ -663,6 +711,7 @@ static int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode)
     struct inode * inode;
     struct reiserfs_transaction_handle th ;
     int jbegin_count = JOURNAL_PER_BALANCE_CNT * 3; 
+    int locked;
 
 #ifdef DISPLACE_NEW_PACKING_LOCALITIES
     /* set flag that new packing locality created and new blocks for the content     * of that directory are not displaced yet */
@@ -676,7 +725,11 @@ static int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode)
     if (retval)
         return retval;
 
+    locked = reiserfs_cache_default_acl (dir);
+
     reiserfs_write_lock(dir->i_sb);
+    if (locked)
+        reiserfs_write_lock_xattrs (dir->i_sb);
     journal_begin(&th, dir->i_sb, jbegin_count) ;
 
     /* inc the link count now, so another writer doesn't overflow it while
@@ -688,6 +741,9 @@ static int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode)
 				old_format_only (dir->i_sb) ? 
 				EMPTY_DIR_SIZE_V1 : EMPTY_DIR_SIZE,
 				dentry, inode);
+    if (locked)
+        reiserfs_write_unlock_xattrs (dir->i_sb);
+
     if (retval) {
 	dir->i_nlink-- ;
 	goto out_failed;
@@ -782,7 +838,8 @@ static int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
 	goto end_rmdir;
 
     if ( inode->i_nlink != 2 && inode->i_nlink != 1 )
-	printk ("reiserfs_rmdir: empty directory has nlink != 2 (%d)\n", inode->i_nlink);
+	reiserfs_warning (inode->i_sb, "%s: empty directory has nlink "
+			  "!= 2 (%d)", __FUNCTION__, inode->i_nlink);
 
     inode->i_nlink = 0;
     inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
@@ -790,7 +847,6 @@ static int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
 
     DEC_DIR_INODE_NLINK(dir)
     dir->i_size -= (DEH_SIZE + de.de_entrylen);
-    dir->i_blocks = ((dir->i_size + 511) >> 9);
     reiserfs_update_sd (&th, dir);
 
     /* prevent empty directory from getting lost */
@@ -850,8 +906,10 @@ static int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
     }
   
     if (!inode->i_nlink) {
-	printk("reiserfs_unlink: deleting nonexistent file (%s:%lu), %d\n",
-	       reiserfs_bdevname (inode->i_sb), inode->i_ino, inode->i_nlink);
+	reiserfs_warning (inode->i_sb, "%s: deleting nonexistent file "
+			  "(%s:%lu), %d", __FUNCTION__,
+			  reiserfs_bdevname (inode->i_sb), inode->i_ino,
+			  inode->i_nlink);
 	inode->i_nlink = 1;
     }
 
@@ -873,7 +931,6 @@ static int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
     reiserfs_update_sd (&th, inode);
 
     dir->i_size -= (de.de_entrylen + DEH_SIZE);
-    dir->i_blocks = ((dir->i_size + 511) >> 9);
     dir->i_ctime = dir->i_mtime = CURRENT_TIME;
     reiserfs_update_sd (&th, dir);
 
@@ -930,6 +987,8 @@ static int reiserfs_symlink (struct inode * parent_dir,
     memcpy (name, symname, strlen (symname));
     padd_item (name, item_len, strlen (symname));
 
+    /* We would inherit the default ACL here, but symlinks don't get ACLs */
+
     journal_begin(&th, parent_dir->i_sb, jbegin_count) ;
 
     retval = reiserfs_new_inode (&th, parent_dir, mode, name, strlen (symname), 
@@ -942,7 +1001,7 @@ static int reiserfs_symlink (struct inode * parent_dir,
     reiserfs_update_inode_transaction(inode) ;
     reiserfs_update_inode_transaction(parent_dir) ;
 
-    inode->i_op = &page_symlink_inode_operations;
+    inode->i_op = &reiserfs_symlink_inode_operations;
     inode->i_mapping->a_ops = &reiserfs_address_space_operations;
 
     // must be sure this inode is written with this transaction
@@ -1284,10 +1343,9 @@ static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
     // anybody, but it will panic if will not be able to find the
     // entry. This needs one more clean up
     if (reiserfs_cut_from_item (&th, &old_entry_path, &(old_de.de_entry_key), old_dir, NULL, 0) < 0)
-	reiserfs_warning ("vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?\n");
+	reiserfs_warning (old_dir->i_sb, "vs-7060: reiserfs_rename: couldn't not cut old name. Fsck later?");
 
     old_dir->i_size -= DEH_SIZE + old_de.de_entrylen;
-    old_dir->i_blocks = ((old_dir->i_size + 511) >> 9);
 
     reiserfs_update_sd (&th, old_dir);
     reiserfs_update_sd (&th, new_dir);
@@ -1318,5 +1376,42 @@ struct inode_operations reiserfs_dir_inode_operations = {
     .rmdir	= reiserfs_rmdir,
     .mknod	= reiserfs_mknod,
     .rename	= reiserfs_rename,
+    .setattr    = reiserfs_setattr,
+    .setxattr   = reiserfs_setxattr,
+    .getxattr   = reiserfs_getxattr,
+    .listxattr  = reiserfs_listxattr,
+    .removexattr = reiserfs_removexattr,
+    .permission     = reiserfs_permission,
+};
+
+/*
+ * symlink operations.. same as page_symlink_inode_operations, with xattr
+ * stuff added
+ */
+struct inode_operations reiserfs_symlink_inode_operations = {
+    .readlink       = page_readlink,
+    .follow_link    = page_follow_link,
+    .setattr        = reiserfs_setattr,
+    .setxattr       = reiserfs_setxattr,
+    .getxattr       = reiserfs_getxattr,
+    .listxattr      = reiserfs_listxattr,
+    .removexattr    = reiserfs_removexattr,
+    .permission     = reiserfs_permission,
+
 };
 
+
+/*
+ * special file operations.. just xattr/acl stuff
+ */
+struct inode_operations reiserfs_special_inode_operations = {
+    .setattr        = reiserfs_setattr,
+    .setxattr       = reiserfs_setxattr,
+    .getxattr       = reiserfs_getxattr,
+    .listxattr      = reiserfs_listxattr,
+    .removexattr    = reiserfs_removexattr,
+    .permission     = reiserfs_permission,
+
+};
+
+
diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c
index f6a289f45..8db22b469 100644
--- a/fs/reiserfs/objectid.c
+++ b/fs/reiserfs/objectid.c
@@ -62,7 +62,7 @@ __u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th)
                                 /* comment needed -Hans */
     unused_objectid = le32_to_cpu (map[1]);
     if (unused_objectid == U32_MAX) {
-	printk ("REISERFS: get_objectid: no more object ids\n");
+	reiserfs_warning (s, "%s: no more object ids", __FUNCTION__);
 	reiserfs_restore_prepared_buffer(s, SB_BUFFER_WITH_SB(s)) ;
 	return 0;
     }
@@ -159,7 +159,7 @@ void reiserfs_release_objectid (struct reiserfs_transaction_handle *th,
 	i += 2;
     }
 
-    reiserfs_warning ("vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)\n", 
+    reiserfs_warning (s, "vs-15011: reiserfs_release_objectid: tried to free free object id (%lu)",
 		      ( long unsigned ) objectid_to_release);
 }
 
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index ac20f2dc9..450208848 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -264,20 +264,43 @@ prepare_error_buf( const char *fmt, va_list args )
     va_end( args );\
 }
 
-void reiserfs_warning (const char * fmt, ...)
+void reiserfs_warning (struct super_block *sb, const char * fmt, ...)
 {
   do_reiserfs_warning(fmt);
-  /* console_print (error_buf); */
-  printk (KERN_WARNING "%s", error_buf);
+  if (sb)
+      printk (KERN_WARNING "ReiserFS: %s: warning: %s\n",
+             reiserfs_bdevname (sb), error_buf);
+  else
+      printk (KERN_WARNING "ReiserFS: warning: %s\n", error_buf);
+}
+
+/* No newline.. reiserfs_info calls can be followed by printk's */
+void reiserfs_info (struct super_block *sb, const char * fmt, ...)
+{
+  do_reiserfs_warning(fmt);
+  if (sb)
+      printk (KERN_NOTICE "ReiserFS: %s: %s",
+             reiserfs_bdevname (sb), error_buf);
+  else
+      printk (KERN_NOTICE "ReiserFS: %s", error_buf);
+}
+
+/* No newline.. reiserfs_printk calls can be followed by printk's */
+void reiserfs_printk (const char * fmt, ...)
+{
+  do_reiserfs_warning(fmt);
+  printk (error_buf);
 }
 
 void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...)
 {
 #ifdef CONFIG_REISERFS_CHECK
   do_reiserfs_warning(fmt);
-  printk (KERN_DEBUG "%s", error_buf);
-#else
-  ; 
+  if (s)
+      printk (KERN_DEBUG "ReiserFS: %s: %s\n",
+             reiserfs_bdevname (s), error_buf);
+  else
+      printk (KERN_DEBUG "ReiserFS: %s\n", error_buf);
 #endif
 }
 
@@ -334,7 +357,8 @@ extern struct tree_balance * cur_tb;
 void reiserfs_panic (struct super_block * sb, const char * fmt, ...)
 {
   do_reiserfs_warning(fmt);
-  printk ( KERN_EMERG "%s", error_buf);
+  printk (KERN_EMERG "REISERFS: panic (device %s): %s\n",
+          reiserfs_bdevname (sb), error_buf);
   BUG ();
 
   /* this is not actually called, but makes reiserfs_panic() "noreturn" */
@@ -413,13 +437,13 @@ static int print_internal (struct buffer_head * bh, int first, int last)
 	to = last < B_NR_ITEMS (bh) ? last : B_NR_ITEMS (bh);
     }
 
-    reiserfs_warning ("INTERNAL NODE (%ld) contains %z\n",  bh->b_blocknr, bh);
+    reiserfs_printk ("INTERNAL NODE (%ld) contains %z\n",  bh->b_blocknr, bh);
     
     dc = B_N_CHILD (bh, from);
-    reiserfs_warning ("PTR %d: %y ", from, dc);
+    reiserfs_printk ("PTR %d: %y ", from, dc);
     
     for (i = from, key = B_N_PDELIM_KEY (bh, from), dc ++; i < to; i ++, key ++, dc ++) {
-	reiserfs_warning ("KEY %d: %k PTR %d: %y ", i, key, i + 1, dc);
+	reiserfs_printk ("KEY %d: %k PTR %d: %y ", i, key, i + 1, dc);
 	if (i && i % 4 == 0)
 	    printk ("\n");
     }
@@ -448,10 +472,10 @@ static int print_leaf (struct buffer_head * bh, int print_mode, int first, int l
     nr = blkh_nr_item(blkh);
 
     printk ("\n===================================================================\n");
-    reiserfs_warning ("LEAF NODE (%ld) contains %z\n", bh->b_blocknr, bh);
+    reiserfs_printk ("LEAF NODE (%ld) contains %z\n", bh->b_blocknr, bh);
 
     if (!(print_mode & PRINT_LEAF_ITEMS)) {
-	reiserfs_warning ("FIRST ITEM_KEY: %k, LAST ITEM KEY: %k\n",
+	reiserfs_printk ("FIRST ITEM_KEY: %k, LAST ITEM KEY: %k\n",
 			  &(ih->ih_key), &((ih + nr - 1)->ih_key));
 	return 0;
     }
@@ -471,7 +495,7 @@ static int print_leaf (struct buffer_head * bh, int print_mode, int first, int l
     printk ("|##|   type    |           key           | ilen | free_space | version | loc  |\n");
     for (i = from; i < to; i++, ih ++) {
 	printk ("-------------------------------------------------------------------------------\n");
-	reiserfs_warning ("|%2d| %h |\n", i, ih);
+	reiserfs_printk ("|%2d| %h |\n", i, ih);
 	if (print_mode & PRINT_LEAF_ITEMS)
 	    op_print_item (ih, B_I_PITEM (bh, ih));
     }
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index d7c20a7c0..b9f5be9d8 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -548,8 +548,8 @@ int reiserfs_proc_info_init( struct super_block *sb )
 		add_file(sb, "journal", show_journal);
 		return 0;
 	}
-	reiserfs_warning( "reiserfs: cannot create /proc/%s/%s\n",
-			  proc_info_root_name, reiserfs_bdevname (sb) );
+	reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
+			 proc_info_root_name, reiserfs_bdevname (sb) );
 	return 1;
 }
 
@@ -595,7 +595,8 @@ int reiserfs_proc_info_global_init( void )
 		if( proc_info_root ) {
 			proc_info_root -> owner = THIS_MODULE;
 		} else {
-			reiserfs_warning( "reiserfs: cannot create /proc/%s\n",
+			reiserfs_warning (NULL,
+					  "reiserfs: cannot create /proc/%s",
 					  proc_info_root_name );
 			return 1;
 		}
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 0d4f5f5c1..ab1c01dd6 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -60,6 +60,7 @@
 #include <linux/reiserfs_fs.h>
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
+#include <linux/quotaops.h>
 
 /* Does the buffer contain a disk block which is in the tree. */
 inline int B_IS_IN_TREE (const struct buffer_head * p_s_bh)
@@ -71,9 +72,6 @@ inline int B_IS_IN_TREE (const struct buffer_head * p_s_bh)
   return ( B_LEVEL (p_s_bh) != FREE_LEVEL );
 }
 
-
-
-
 inline void copy_short_key (void * to, const void * from)
 {
     memcpy (to, from, SHORT_KEY_SIZE);
@@ -166,7 +164,7 @@ inline int comp_cpu_keys (const struct cpu_key * key1,
     if (cpu_key_k_offset (key1) > cpu_key_k_offset (key2))
 	return 1;
 
-    reiserfs_warning ("comp_cpu_keys: type are compared for %K and %K\n",
+    reiserfs_warning (NULL, "comp_cpu_keys: type are compared for %K and %K",
 		      key1, key2);
 
     if (cpu_key_k_type (key1) < cpu_key_k_type (key2))
@@ -499,21 +497,21 @@ static int is_leaf (char * buf, int blocksize, struct buffer_head * bh)
 
     blkh = (struct block_head *)buf;
     if ( blkh_level(blkh) != DISK_LEAF_NODE_LEVEL) {
-	printk ("is_leaf: this should be caught earlier\n");
+	reiserfs_warning (NULL, "is_leaf: this should be caught earlier");
 	return 0;
     }
 
     nr = blkh_nr_item(blkh);
     if (nr < 1 || nr > ((blocksize - BLKH_SIZE) / (IH_SIZE + MIN_ITEM_LEN))) {
 	/* item number is too big or too small */
-	reiserfs_warning ("is_leaf: nr_item seems wrong: %z\n", bh);
+	reiserfs_warning (NULL, "is_leaf: nr_item seems wrong: %z", bh);
 	return 0;
     }
     ih = (struct item_head *)(buf + BLKH_SIZE) + nr - 1;
     used_space = BLKH_SIZE + IH_SIZE * nr + (blocksize - ih_location (ih));
     if (used_space != blocksize - blkh_free_space(blkh)) {
 	/* free space does not match to calculated amount of use space */
-	reiserfs_warning ("is_leaf: free space seems wrong: %z\n", bh);
+	reiserfs_warning (NULL, "is_leaf: free space seems wrong: %z", bh);
 	return 0;
     }
 
@@ -525,19 +523,19 @@ static int is_leaf (char * buf, int blocksize, struct buffer_head * bh)
     prev_location = blocksize;
     for (i = 0; i < nr; i ++, ih ++) {
 	if ( le_ih_k_type(ih) == TYPE_ANY) {
-	    reiserfs_warning ("is_leaf: wrong item type for item %h\n",ih);
+	    reiserfs_warning (NULL, "is_leaf: wrong item type for item %h",ih);
 	    return 0;
 	}
 	if (ih_location (ih) >= blocksize || ih_location (ih) < IH_SIZE * nr) {
-	    reiserfs_warning ("is_leaf: item location seems wrong: %h\n", ih);
+	    reiserfs_warning (NULL, "is_leaf: item location seems wrong: %h", ih);
 	    return 0;
 	}
 	if (ih_item_len (ih) < 1 || ih_item_len (ih) > MAX_ITEM_LEN (blocksize)) {
-	    reiserfs_warning ("is_leaf: item length seems wrong: %h\n", ih);
+	    reiserfs_warning (NULL, "is_leaf: item length seems wrong: %h", ih);
 	    return 0;
 	}
 	if (prev_location - ih_location (ih) != ih_item_len (ih)) {
-	    reiserfs_warning ("is_leaf: item location seems wrong (second one): %h\n", ih);
+	    reiserfs_warning (NULL, "is_leaf: item location seems wrong (second one): %h", ih);
 	    return 0;
 	}
 	prev_location = ih_location (ih);
@@ -559,20 +557,20 @@ static int is_internal (char * buf, int blocksize, struct buffer_head * bh)
     nr = blkh_level(blkh);
     if (nr <= DISK_LEAF_NODE_LEVEL || nr > MAX_HEIGHT) {
 	/* this level is not possible for internal nodes */
-	printk ("is_internal: this should be caught earlier\n");
+	reiserfs_warning (NULL, "is_internal: this should be caught earlier");
 	return 0;
     }
     
     nr = blkh_nr_item(blkh);
     if (nr > (blocksize - BLKH_SIZE - DC_SIZE) / (KEY_SIZE + DC_SIZE)) {
 	/* for internal which is not root we might check min number of keys */
-	reiserfs_warning ("is_internal: number of key seems wrong: %z\n", bh);
+	reiserfs_warning (NULL, "is_internal: number of key seems wrong: %z", bh);
 	return 0;
     }
 
     used_space = BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1);
     if (used_space != blocksize - blkh_free_space(blkh)) {
-	reiserfs_warning ("is_internal: free space seems wrong: %z\n", bh);
+	reiserfs_warning (NULL, "is_internal: free space seems wrong: %z", bh);
 	return 0;
     }
 
@@ -586,7 +584,7 @@ static int is_internal (char * buf, int blocksize, struct buffer_head * bh)
 static int is_tree_node (struct buffer_head * bh, int level)
 {
     if (B_LEVEL (bh) != level) {
-	printk ("is_tree_node: node level %d does not match to the expected one %d\n",
+	reiserfs_warning (NULL, "is_tree_node: node level %d does not match to the expected one %d",
 		B_LEVEL (bh), level);
 	return 0;
     }
@@ -683,9 +681,9 @@ int search_by_key (struct super_block * p_s_sb,
 
 #ifdef CONFIG_REISERFS_CHECK
 	if ( !(++n_repeat_counter % 50000) )
-	    reiserfs_warning ("PAP-5100: search_by_key: %s:"
+	    reiserfs_warning (p_s_sb, "PAP-5100: search_by_key: %s:"
 			      "there were %d iterations of while loop "
-			      "looking for key %K\n",
+			      "looking for key %K",
 			      current->comm, n_repeat_counter, p_s_key);
 #endif
 
@@ -748,8 +746,8 @@ int search_by_key (struct super_block * p_s_sb,
 	// make sure, that the node contents look like a node of
 	// certain level
 	if (!is_tree_node (p_s_bh, expected_level)) {
-	    reiserfs_warning ("vs-5150: search_by_key: "
-			      "invalid format found in block %ld. Fsck?\n", 
+	    reiserfs_warning (p_s_sb, "vs-5150: search_by_key: "
+			      "invalid format found in block %ld. Fsck?",
 			      p_s_bh->b_blocknr);
 	    pathrelse (p_s_search_path);
 	    return IO_ERROR;
@@ -1125,8 +1123,7 @@ static char  prepare_for_delete_or_cut(
 		tmp = get_block_num(p_n_unfm_pointer,0);
 		put_block_num(p_n_unfm_pointer, 0, 0);
 		journal_mark_dirty (th, p_s_sb, p_s_bh);
-		inode->i_blocks -= p_s_sb->s_blocksize / 512;
-		reiserfs_free_block(th, tmp);
+		reiserfs_free_block(th, inode, tmp, 1);
 		if ( item_moved (&s_ih, p_s_path) )  {
 			need_research = 1;
 			break ;
@@ -1155,8 +1152,7 @@ static char  prepare_for_delete_or_cut(
     }
 }
 
-
-/* Calculate bytes number which will be deleted or cutted in the balance. */
+/* Calculate number of bytes which will be deleted or cut during balance */
 int calc_deleted_bytes_number(
     struct  tree_balance  * p_s_tb,
     char                    c_mode
@@ -1167,14 +1163,14 @@ int calc_deleted_bytes_number(
     if ( is_statdata_le_ih (p_le_ih) )
 	return 0;
 
+    n_del_size = ( c_mode == M_DELETE ) ? ih_item_len(p_le_ih) : -p_s_tb->insert_size[0];
     if ( is_direntry_le_ih (p_le_ih) ) {
 	// return EMPTY_DIR_SIZE; /* We delete emty directoris only. */
 	// we can't use EMPTY_DIR_SIZE, as old format dirs have a different
 	// empty size.  ick. FIXME, is this right?
 	//
-	return ih_item_len(p_le_ih);
+	return n_del_size ;
     }
-    n_del_size = ( c_mode == M_DELETE ) ? ih_item_len(p_le_ih) : -p_s_tb->insert_size[0];
 
     if ( is_indirect_le_ih (p_le_ih) )
 	n_del_size = (n_del_size/UNFM_P_SIZE)*
@@ -1208,17 +1204,46 @@ void padd_item (char * item, int total_length, int length)
 	item [--i] = 0;
 }
 
+#ifdef REISERQUOTA_DEBUG
+char key2type(struct key *ih)
+{
+  if (is_direntry_le_key(2, ih))
+    return 'd';
+  if (is_direct_le_key(2, ih))
+    return 'D';
+  if (is_indirect_le_key(2, ih))
+    return 'i';
+  if (is_statdata_le_key(2, ih))
+    return 's';
+  return 'u';
+}
+
+char head2type(struct item_head *ih)
+{
+  if (is_direntry_le_ih(ih))
+    return 'd';
+  if (is_direct_le_ih(ih))
+    return 'D';
+  if (is_indirect_le_ih(ih))
+    return 'i';
+  if (is_statdata_le_ih(ih))
+    return 's';
+  return 'u';
+}
+#endif
 
 /* Delete object item. */
 int reiserfs_delete_item (struct reiserfs_transaction_handle *th, 
 			  struct path * p_s_path, /* Path to the deleted item. */
 			  const struct cpu_key * p_s_item_key, /* Key to search for the deleted item.  */
-			  struct inode * p_s_inode,/* inode is here just to update i_blocks */
+			  struct inode * p_s_inode,/* inode is here just to update i_blocks and quotas */
 			  struct buffer_head  * p_s_un_bh)    /* NULL or unformatted node pointer.    */
 {
     struct super_block * p_s_sb = p_s_inode->i_sb;
     struct tree_balance   s_del_balance;
     struct item_head      s_ih;
+    struct item_head      *q_ih;
+    int			  quota_cut_bytes;
     int                   n_ret_value,
 	n_del_size,
 	n_removed;
@@ -1255,8 +1280,8 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 	if (n_ret_value == IO_ERROR)
 	    break;
 	if (n_ret_value == FILE_NOT_FOUND) {
-	    reiserfs_warning ("vs-5340: reiserfs_delete_item: "
-			      "no items of the file %K found\n", p_s_item_key);
+	    reiserfs_warning (p_s_sb, "vs-5340: reiserfs_delete_item: "
+			      "no items of the file %K found", p_s_item_key);
 	    break;
 	}
     } /* while (1) */
@@ -1268,6 +1293,22 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 
     // reiserfs_delete_item returns item length when success
     n_ret_value = calc_deleted_bytes_number(&s_del_balance, M_DELETE);
+    q_ih = get_ih(p_s_path) ;
+    quota_cut_bytes = ih_item_len(q_ih) ;
+
+    /* hack so the quota code doesn't have to guess if the file
+    ** has a tail.  On tail insert, we allocate quota for 1 unformatted node.
+    ** We test the offset because the tail might have been
+    ** split into multiple items, and we only want to decrement for
+    ** the unfm node once
+    */
+    if (!S_ISLNK (p_s_inode->i_mode) && is_direct_le_ih(q_ih)) {
+        if ((le_ih_k_offset(q_ih) & (p_s_sb->s_blocksize - 1)) == 1) {
+            quota_cut_bytes = p_s_sb->s_blocksize + UNFM_P_SIZE;
+        } else {
+	    quota_cut_bytes = 0 ;
+	}
+    }
 
     if ( p_s_un_bh )  {
 	int off;
@@ -1299,10 +1340,14 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 	       B_I_PITEM(PATH_PLAST_BUFFER(p_s_path), &s_ih), n_ret_value);
 	kunmap_atomic(data, KM_USER0);
     }
-
     /* Perform balancing after all resources have been collected at once. */ 
     do_balance(&s_del_balance, NULL, NULL, M_DELETE);
 
+#ifdef REISERQUOTA_DEBUG
+    reiserfs_debug (p_s_sb, "reiserquota delete_item(): freeing %u, id=%u type=%c", quota_cut_bytes, p_s_inode->i_uid, head2type(&s_ih));
+#endif
+    DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes);
+
     /* Return deleted body length */
     return n_ret_value;
 }
@@ -1327,22 +1372,26 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 
 /* this deletes item which never gets split */
 void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
+				 struct inode *inode,
 				 struct key * key)
 {
     struct tree_balance tb;
     INITIALIZE_PATH (path);
-    int item_len;
+    int item_len = 0;
     int tb_init = 0 ;
     struct cpu_key cpu_key;
     int retval;
+    int quota_cut_bytes = 0;
     
     le_key2cpu_key (&cpu_key, key);
     
     while (1) {
 	retval = search_item (th->t_super, &cpu_key, &path);
 	if (retval == IO_ERROR) {
-	    reiserfs_warning ("vs-5350: reiserfs_delete_solid_item: "
-			      "i/o failure occurred trying to delete %K\n", &cpu_key);
+	    reiserfs_warning (th->t_super,
+			      "vs-5350: reiserfs_delete_solid_item: "
+			      "i/o failure occurred trying to delete %K",
+			      &cpu_key);
 	    break;
 	}
 	if (retval != ITEM_FOUND) {
@@ -1350,7 +1399,7 @@ void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
 	    // No need for a warning, if there is just no free space to insert '..' item into the newly-created subdir
 	    if ( !( (unsigned long long) GET_HASH_VALUE (le_key_k_offset (le_key_version (key), key)) == 0 && \
 		 (unsigned long long) GET_GENERATION_NUMBER (le_key_k_offset (le_key_version (key), key)) == 1 ) )
-		reiserfs_warning ("vs-5355: reiserfs_delete_solid_item: %k not found", key);
+		reiserfs_warning (th->t_super, "vs-5355: reiserfs_delete_solid_item: %k not found", key);
 	    break;
 	}
 	if (!tb_init) {
@@ -1358,6 +1407,7 @@ void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
 	    item_len = ih_item_len( PATH_PITEM_HEAD(&path) );
 	    init_tb_struct (th, &tb, th->t_super, &path, - (IH_SIZE + item_len));
 	}
+	quota_cut_bytes = ih_item_len(PATH_PITEM_HEAD(&path)) ;
 
 	retval = fix_nodes (M_DELETE, &tb, NULL, 0);
 	if (retval == REPEAT_SEARCH) {
@@ -1367,12 +1417,18 @@ void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
 
 	if (retval == CARRY_ON) {
 	    do_balance (&tb, 0, 0, M_DELETE);
+	    if (inode) {	/* Should we count quota for item? (we don't count quotas for save-links) */
+#ifdef REISERQUOTA_DEBUG
+		reiserfs_debug (th->t_super, "reiserquota delete_solid_item(): freeing %u id=%u type=%c", quota_cut_bytes, inode->i_uid, key2type(key));
+#endif
+		DQUOT_FREE_SPACE_NODIRTY(inode, quota_cut_bytes);
+	    }
 	    break;
 	}
 
 	// IO_ERROR, NO_DISK_SPACE, etc
-	reiserfs_warning ("vs-5360: reiserfs_delete_solid_item: "
-			  "could not delete %K due to fix_nodes failure\n", &cpu_key);
+	reiserfs_warning (th->t_super, "vs-5360: reiserfs_delete_solid_item: "
+			  "could not delete %K due to fix_nodes failure", &cpu_key);
 	unfix_nodes (&tb);
 	break;
     }
@@ -1399,7 +1455,7 @@ void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inod
       }
 /* USE_INODE_GENERATION_COUNTER */
 #endif
-    reiserfs_delete_solid_item (th, INODE_PKEY (inode));
+    reiserfs_delete_solid_item (th, inode, INODE_PKEY (inode));
 }
 
 
@@ -1466,7 +1522,7 @@ static void indirect_to_direct_roll_back (struct reiserfs_transaction_handle *th
 	tail_len -= removed;
 	set_cpu_key_k_offset (&tail_key, cpu_key_k_offset (&tail_key) - removed);
     }
-    printk ("indirect_to_direct_roll_back: indirect_to_direct conversion has been rolled back due to lack of disk space\n");
+    reiserfs_warning (inode->i_sb, "indirect_to_direct_roll_back: indirect_to_direct conversion has been rolled back due to lack of disk space");
     //mark_file_without_tail (inode);
     mark_inode_dirty (inode);
 }
@@ -1486,12 +1542,14 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
        structure by using the init_tb_struct and fix_nodes functions.
        After that we can make tree balancing. */
     struct tree_balance s_cut_balance;
+    struct item_head *p_le_ih;
     int n_cut_size = 0,        /* Amount to be cut. */
 	n_ret_value = CARRY_ON,
 	n_removed = 0,     /* Number of the removed unformatted nodes. */
 	n_is_inode_locked = 0;
     char                c_mode;            /* Mode of the balance. */
     int retval2 = -1;
+    int quota_cut_bytes;
     
     
     init_tb_struct(th, &s_cut_balance, p_s_inode->i_sb, p_s_path, n_cut_size);
@@ -1556,7 +1614,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
 	if (n_ret_value == POSITION_FOUND)
 	    continue;
 
-	reiserfs_warning ("PAP-5610: reiserfs_cut_from_item: item %K not found\n", p_s_item_key);
+	reiserfs_warning (p_s_sb, "PAP-5610: reiserfs_cut_from_item: item %K not found", p_s_item_key);
 	unfix_nodes (&s_cut_balance);
 	return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT;
     } /* while */
@@ -1569,7 +1627,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
 	    indirect_to_direct_roll_back (th, p_s_inode, p_s_path);
 	}
 	if (n_ret_value == NO_DISK_SPACE)
-	    reiserfs_warning ("NO_DISK_SPACE");
+	    reiserfs_warning (p_s_sb, "NO_DISK_SPACE");
 	unfix_nodes (&s_cut_balance);
 	return -EIO;
     }
@@ -1579,23 +1637,27 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
     RFALSE( c_mode == M_PASTE || c_mode == M_INSERT, "invalid mode");
 
     /* Calculate number of bytes that need to be cut from the item. */
+    quota_cut_bytes = ( c_mode == M_DELETE ) ? ih_item_len(get_ih(p_s_path)) : -s_cut_balance.insert_size[0];
     if (retval2 == -1)
 	n_ret_value = calc_deleted_bytes_number(&s_cut_balance, c_mode);
     else
 	n_ret_value = retval2;
-    
-    if ( c_mode == M_DELETE ) {
-	struct item_head * p_le_ih = PATH_PITEM_HEAD (s_cut_balance.tb_path);
-	
-	if ( is_direct_le_ih (p_le_ih) && (le_ih_k_offset (p_le_ih) & (p_s_sb->s_blocksize - 1)) == 1 ) {
-	    /* we delete first part of tail which was stored in direct
-               item(s) */
+
+
+    /* For direct items, we only change the quota when deleting the last
+    ** item.
+    */
+    p_le_ih = PATH_PITEM_HEAD (s_cut_balance.tb_path);
+    if (!S_ISLNK (p_s_inode->i_mode) && is_direct_le_ih(p_le_ih)) {
+        if (c_mode == M_DELETE &&
+	   (le_ih_k_offset (p_le_ih) & (p_s_sb->s_blocksize - 1)) == 1 ) {
 	    // FIXME: this is to keep 3.5 happy
 	    REISERFS_I(p_s_inode)->i_first_direct_byte = U32_MAX;
-	    p_s_inode->i_blocks -= p_s_sb->s_blocksize / 512;
+	    quota_cut_bytes = p_s_sb->s_blocksize + UNFM_P_SIZE ;
+        } else {
+	    quota_cut_bytes = 0 ;
 	}
     }
-
 #ifdef CONFIG_REISERFS_CHECK
     if (n_is_inode_locked) {
 	struct item_head * le_ih = PATH_PITEM_HEAD (s_cut_balance.tb_path);
@@ -1630,19 +1692,23 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
 	*/
 	REISERFS_I(p_s_inode)->i_flags &= ~i_pack_on_close_mask ;
     }
+#ifdef REISERQUOTA_DEBUG
+    reiserfs_debug (p_s_inode->i_sb, "reiserquota cut_from_item(): freeing %u id=%u type=%c", quota_cut_bytes, p_s_inode->i_uid, '?');
+#endif
+    DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes);
     return n_ret_value;
 }
 
-
 static void truncate_directory (struct reiserfs_transaction_handle *th, struct inode * inode)
 {
     if (inode->i_nlink)
-	reiserfs_warning ("vs-5655: truncate_directory: link count != 0\n");
+	reiserfs_warning (inode->i_sb,
+			  "vs-5655: truncate_directory: link count != 0");
 
     set_le_key_k_offset (KEY_FORMAT_3_5, INODE_PKEY (inode), DOT_OFFSET);
     set_le_key_k_type (KEY_FORMAT_3_5, INODE_PKEY (inode), TYPE_DIRENTRY);
-    reiserfs_delete_solid_item (th, INODE_PKEY (inode));
-
+    reiserfs_delete_solid_item (th, inode, INODE_PKEY (inode));
+    reiserfs_update_sd(th, inode) ;
     set_le_key_k_offset (KEY_FORMAT_3_5, INODE_PKEY (inode), SD_OFFSET);
     set_le_key_k_type (KEY_FORMAT_3_5, INODE_PKEY (inode), TYPE_STAT_DATA);    
 }
@@ -1686,14 +1752,14 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
 
     retval = search_for_position_by_key(p_s_inode->i_sb, &s_item_key, &s_search_path);
     if (retval == IO_ERROR) {
-	reiserfs_warning ("vs-5657: reiserfs_do_truncate: "
-			  "i/o failure occurred trying to truncate %K\n", &s_item_key);
+	reiserfs_warning (p_s_inode->i_sb, "vs-5657: reiserfs_do_truncate: "
+			  "i/o failure occurred trying to truncate %K", &s_item_key);
 	return;
     }
     if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) {
 	pathrelse (&s_search_path);
-	reiserfs_warning ("PAP-5660: reiserfs_do_truncate: "
-			  "wrong result %d of search for %K\n", retval, &s_item_key);
+	reiserfs_warning (p_s_inode->i_sb, "PAP-5660: reiserfs_do_truncate: "
+			  "wrong result %d of search for %K", retval, &s_item_key);
 	return;
     }
 
@@ -1724,7 +1790,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
 	/* Cut or delete file item. */
 	n_deleted = reiserfs_cut_from_item(th, &s_search_path, &s_item_key, p_s_inode,  page, n_new_file_size);
 	if (n_deleted < 0) {
-	    reiserfs_warning ("vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed");
+	    reiserfs_warning (p_s_inode->i_sb, "vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed");
 	    reiserfs_check_path(&s_search_path) ;
 	    return;
 	}
@@ -1764,7 +1830,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
 	      search_for_position_by_key(p_s_inode->i_sb, &s_item_key, &s_search_path) == POSITION_FOUND )  ;
 
     RFALSE( n_file_size > ROUND_UP (n_new_file_size),
-	    "PAP-5680: truncate did not finish: new_file_size %Ld, current %Ld, oid %d\n",
+	    "PAP-5680: truncate did not finish: new_file_size %Ld, current %Ld, oid %d",
 	    n_new_file_size, n_file_size, s_item_key.on_disk_key.k_objectid);
 
 update_and_out:
@@ -1809,18 +1875,37 @@ static void check_research_for_paste (struct path * path,
 int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th, 
 			      struct path         * p_s_search_path,	/* Path to the pasted item.          */
 			      const struct cpu_key      * p_s_key,        	/* Key to search for the needed item.*/
+			      struct inode	  * inode,		/* Inode item belongs to */
 			      const char          * p_c_body,       	/* Pointer to the bytes to paste.    */
 			      int                   n_pasted_size)  	/* Size of pasted bytes.             */
 {
     struct tree_balance s_paste_balance;
     int                 retval;
+    int			fs_gen;
+
+    fs_gen = get_generation(inode->i_sb) ;
 
+#ifdef REISERQUOTA_DEBUG
+    reiserfs_debug (inode->i_sb, "reiserquota paste_into_item(): allocating %u id=%u type=%c", n_pasted_size, inode->i_uid, key2type(&(p_s_key->on_disk_key)));
+#endif
+
+    if (DQUOT_ALLOC_SPACE_NODIRTY(inode, n_pasted_size)) {
+	pathrelse(p_s_search_path);
+	return -EDQUOT;
+    }
     init_tb_struct(th, &s_paste_balance, th->t_super, p_s_search_path, n_pasted_size);
 #ifdef DISPLACE_NEW_PACKING_LOCALITIES
     s_paste_balance.key = p_s_key->on_disk_key;
 #endif
-    
-    while ( (retval = fix_nodes(M_PASTE, &s_paste_balance, NULL, p_c_body)) == REPEAT_SEARCH ) {
+
+    /* DQUOT_* can schedule, must check before the fix_nodes */
+    if (fs_changed(fs_gen, inode->i_sb)) {
+	goto search_again;
+    }
+
+    while ((retval = fix_nodes(M_PASTE, &s_paste_balance, NULL, p_c_body)) ==
+REPEAT_SEARCH ) {
+search_again:
 	/* file system changed while we were in the fix_nodes */
 	PROC_INFO_INC( th -> t_super, paste_into_item_restarted );
 	retval = search_for_position_by_key (th->t_super, p_s_key, p_s_search_path);
@@ -1829,7 +1914,7 @@ int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th,
 	    goto error_out ;
 	}
 	if (retval == POSITION_FOUND) {
-	    reiserfs_warning ("PAP-5710: reiserfs_paste_into_item: entry or pasted byte (%K) exists\n", p_s_key);
+	    reiserfs_warning (inode->i_sb, "PAP-5710: reiserfs_paste_into_item: entry or pasted byte (%K) exists", p_s_key);
 	    retval = -EEXIST ;
 	    goto error_out ;
 	}
@@ -1849,6 +1934,10 @@ int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th,
 error_out:
     /* this also releases the path */
     unfix_nodes(&s_paste_balance);
+#ifdef REISERQUOTA_DEBUG
+    reiserfs_debug (inode->i_sb, "reiserquota paste_into_item(): freeing %u id=%u type=%c", n_pasted_size, inode->i_uid, key2type(&(p_s_key->on_disk_key)));
+#endif
+    DQUOT_FREE_SPACE_NODIRTY(inode, n_pasted_size);
     return retval ;
 }
 
@@ -1858,23 +1947,45 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
 			 struct path         * 	p_s_path,         /* Path to the inserteded item.         */
 			 const struct cpu_key      * key,
 			 struct item_head    * 	p_s_ih,           /* Pointer to the item header to insert.*/
+			 struct inode        * inode,
 			 const char          * 	p_c_body)         /* Pointer to the bytes to insert.      */
 {
     struct tree_balance s_ins_balance;
     int                 retval;
-
+    int fs_gen = 0 ;
+    int quota_bytes = 0 ;
+
+    if (inode) {      /* Do we count quotas for item? */
+	fs_gen = get_generation(inode->i_sb);
+	quota_bytes = ih_item_len(p_s_ih);
+
+	/* hack so the quota code doesn't have to guess if the file has
+	 ** a tail, links are always tails, so there's no guessing needed
+	 */
+	if (!S_ISLNK (inode->i_mode) && is_direct_le_ih(p_s_ih)) {
+	    quota_bytes = inode->i_sb->s_blocksize + UNFM_P_SIZE ;
+	}
+#ifdef REISERQUOTA_DEBUG
+	reiserfs_debug (inode->i_sb, "reiserquota insert_item(): allocating %u id=%u type=%c", quota_bytes, inode->i_uid, head2type(p_s_ih));
+#endif
+	/* We can't dirty inode here. It would be immediately written but
+	 * appropriate stat item isn't inserted yet... */
+	if (DQUOT_ALLOC_SPACE_NODIRTY(inode, quota_bytes)) {
+	    pathrelse(p_s_path);
+	    return -EDQUOT;
+	}
+    }
     init_tb_struct(th, &s_ins_balance, th->t_super, p_s_path, IH_SIZE + ih_item_len(p_s_ih));
 #ifdef DISPLACE_NEW_PACKING_LOCALITIES
     s_ins_balance.key = key->on_disk_key;
 #endif
-
-    /*
-    if (p_c_body == 0)
-      n_zeros_num = ih_item_len(p_s_ih);
-    */
-    //    le_key2cpu_key (&key, &(p_s_ih->ih_key));
+    /* DQUOT_* can schedule, must check to be sure calling fix_nodes is safe */
+    if (inode && fs_changed(fs_gen, inode->i_sb)) {
+	goto search_again;
+    }
 
     while ( (retval = fix_nodes(M_INSERT, &s_ins_balance, p_s_ih, p_c_body)) == REPEAT_SEARCH) {
+search_again:
 	/* file system changed while we were in the fix_nodes */
 	PROC_INFO_INC( th -> t_super, insert_item_restarted );
 	retval = search_item (th->t_super, key, p_s_path);
@@ -1883,8 +1994,8 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
 	    goto error_out ;
 	}
 	if (retval == ITEM_FOUND) {
-	    reiserfs_warning ("PAP-5760: reiserfs_insert_item: "
-			      "key %K already exists in the tree\n", key);
+	    reiserfs_warning (th->t_super, "PAP-5760: reiserfs_insert_item: "
+			      "key %K already exists in the tree", key);
 	    retval = -EEXIST ;
 	    goto error_out; 
 	}
@@ -1900,6 +2011,11 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
 error_out:
     /* also releases the path */
     unfix_nodes(&s_ins_balance);
+#ifdef REISERQUOTA_DEBUG
+    reiserfs_debug (th->t_super, "reiserquota insert_item(): freeing %u id=%u type=%c", quota_bytes, inode->i_uid, head2type(p_s_ih));
+#endif
+    if (inode)
+	DQUOT_FREE_SPACE_NODIRTY(inode, quota_bytes) ;
     return retval; 
 }
 
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 1ab82924f..8872bad96 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -17,6 +17,8 @@
 #include <linux/time.h>
 #include <asm/uaccess.h>
 #include <linux/reiserfs_fs.h>
+#include <linux/reiserfs_acl.h>
+#include <linux/reiserfs_xattr.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/blkdev.h>
@@ -113,7 +115,7 @@ static void remove_save_link_only (struct super_block * s, struct key * key, int
      /* we are going to do one balancing */
      journal_begin (&th, s, JOURNAL_PER_BALANCE_CNT);
  
-     reiserfs_delete_solid_item (&th, key);
+     reiserfs_delete_solid_item (&th, NULL, key);
      if (oid_free)
         /* removals are protected by direct items */
         reiserfs_release_objectid (&th, le32_to_cpu (key->k_objectid));
@@ -148,7 +150,7 @@ static void finish_unfinished (struct super_block * s)
     while (1) {
         retval = search_item (s, &max_cpu_key, &path);
         if (retval != ITEM_NOT_FOUND) {
-            reiserfs_warning ("vs-2140: finish_unfinished: search_by_key returned %d\n",
+            reiserfs_warning (s, "vs-2140: finish_unfinished: search_by_key returned %d",
                               retval);
             break;
         }
@@ -156,7 +158,7 @@ static void finish_unfinished (struct super_block * s)
         bh = get_last_bh (&path);
         item_pos = get_item_pos (&path);
         if (item_pos != B_NR_ITEMS (bh)) {
-            reiserfs_warning ("vs-2060: finish_unfinished: wrong position found\n");
+            reiserfs_warning (s, "vs-2060: finish_unfinished: wrong position found");
             break;
         }
         item_pos --;
@@ -185,7 +187,7 @@ static void finish_unfinished (struct super_block * s)
         if (!inode) {
             /* the unlink almost completed, it just did not manage to remove
 	       "save" link and release objectid */
-            reiserfs_warning ("vs-2180: finish_unfinished: iget failed for %K\n",
+            reiserfs_warning (s, "vs-2180: finish_unfinished: iget failed for %K",
                               &obj_key);
             remove_save_link_only (s, &save_link_key, 1);
             continue;
@@ -193,7 +195,7 @@ static void finish_unfinished (struct super_block * s)
 
 	if (!truncate && inode->i_nlink) {
 	    /* file is not unlinked */
-            reiserfs_warning ("vs-2185: finish_unfinished: file %K is not unlinked\n",
+            reiserfs_warning (s, "vs-2185: finish_unfinished: file %K is not unlinked",
                               &obj_key);
             remove_save_link_only (s, &save_link_key, 0);
             continue;
@@ -204,7 +206,7 @@ static void finish_unfinished (struct super_block * s)
 	       The only imaginable way is to execute unfinished truncate request
 	       then boot into old kernel, remove the file and create dir with
 	       the same key. */
-	    reiserfs_warning("green-2101: impossible truncate on a directory %k. Please report\n", INODE_PKEY (inode));
+	    reiserfs_warning(s, "green-2101: impossible truncate on a directory %k. Please report", INODE_PKEY (inode));
 	    remove_save_link_only (s, &save_link_key, 0);
 	    truncate = 0;
 	    iput (inode); 
@@ -215,14 +217,14 @@ static void finish_unfinished (struct super_block * s)
             REISERFS_I(inode) -> i_flags |= i_link_saved_truncate_mask;
             /* not completed truncate found. New size was committed together
 	       with "save" link */
-            reiserfs_warning ("Truncating %k to %Ld ..",
+            reiserfs_info (s, "Truncating %k to %Ld ..",
                               INODE_PKEY (inode), inode->i_size);
             reiserfs_truncate_file (inode, 0/*don't update modification time*/);
             remove_save_link (inode, truncate);
         } else {
             REISERFS_I(inode) -> i_flags |= i_link_saved_unlink_mask;
             /* not completed unlink (rmdir) found */
-            reiserfs_warning ("Removing %k..", INODE_PKEY (inode));
+            reiserfs_info (s, "Removing %k..", INODE_PKEY (inode));
             /* removal gets completed in iput */
         }
  
@@ -234,7 +236,7 @@ static void finish_unfinished (struct super_block * s)
      
     pathrelse (&path);
     if (done)
-        reiserfs_warning ("There were %d uncompleted unlinks/truncates. "
+        reiserfs_info (s, "There were %d uncompleted unlinks/truncates. "
                           "Completed\n", done);
 }
  
@@ -276,7 +278,7 @@ void add_save_link (struct reiserfs_transaction_handle * th,
     } else {
 	/* truncate */
 	if (S_ISDIR (inode->i_mode))
-	    reiserfs_warning("green-2102: Adding a truncate savelink for a directory %k! Please report\n", INODE_PKEY(inode));
+	    reiserfs_warning(inode->i_sb, "green-2102: Adding a truncate savelink for a directory %k! Please report", INODE_PKEY(inode));
 	set_cpu_key_k_offset (&key, 1);
 	set_cpu_key_k_type (&key, TYPE_INDIRECT);
 
@@ -290,8 +292,8 @@ void add_save_link (struct reiserfs_transaction_handle * th,
     retval = search_item (inode->i_sb, &key, &path);
     if (retval != ITEM_NOT_FOUND) {
 	if ( retval != -ENOSPC )
-	    reiserfs_warning ("vs-2100: add_save_link:"
-			  "search_by_key (%K) returned %d\n", &key, retval);
+	    reiserfs_warning (inode->i_sb, "vs-2100: add_save_link:"
+			  "search_by_key (%K) returned %d", &key, retval);
 	pathrelse (&path);
 	return;
     }
@@ -299,11 +301,11 @@ void add_save_link (struct reiserfs_transaction_handle * th,
     /* body of "save" link */
     link = INODE_PKEY (inode)->k_dir_id;
 
-    /* put "save" link inot tree */
-    retval = reiserfs_insert_item (th, &path, &key, &ih, (char *)&link);
+    /* put "save" link inot tree, don't charge quota to anyone */
+    retval = reiserfs_insert_item (th, &path, &key, &ih, NULL, (char *)&link);
     if (retval) {
 	if (retval != -ENOSPC)
-	    reiserfs_warning ("vs-2120: add_save_link: insert_item returned %d\n",
+	    reiserfs_warning (inode->i_sb, "vs-2120: add_save_link: insert_item returned %d",
 			  retval);
     } else {
 	if( truncate )
@@ -342,7 +344,8 @@ void remove_save_link (struct inode * inode, int truncate)
           ( REISERFS_I(inode) -> i_flags & i_link_saved_truncate_mask ) ) ||
         ( !truncate && 
           ( REISERFS_I(inode) -> i_flags & i_link_saved_unlink_mask ) ) )
-	reiserfs_delete_solid_item (&th, &key);
+	/* don't take quota bytes from anywhere */
+	reiserfs_delete_solid_item (&th, NULL, &key);
     if (!truncate) {
 	reiserfs_release_objectid (&th, inode->i_ino);
 	REISERFS_I(inode) -> i_flags &= ~i_link_saved_unlink_mask;
@@ -357,7 +360,17 @@ static void reiserfs_put_super (struct super_block * s)
 {
   int i;
   struct reiserfs_transaction_handle th ;
+
+  if (REISERFS_SB(s)->xattr_root) {
+    d_invalidate (REISERFS_SB(s)->xattr_root);
+    dput (REISERFS_SB(s)->xattr_root);
+  }
   
+  if (REISERFS_SB(s)->priv_root) {
+    d_invalidate (REISERFS_SB(s)->priv_root);
+    dput (REISERFS_SB(s)->priv_root);
+  }
+
   /* change file system state to current state if it was mounted with read-write permissions */
   if (!(s->s_flags & MS_RDONLY)) {
     journal_begin(&th, s, 10) ;
@@ -381,12 +394,12 @@ static void reiserfs_put_super (struct super_block * s)
   print_statistics (s);
 
   if (REISERFS_SB(s)->s_kmallocs != 0) {
-    reiserfs_warning ("vs-2004: reiserfs_put_super: allocated memory left %d\n",
+    reiserfs_warning (s, "vs-2004: reiserfs_put_super: allocated memory left %d",
 		      REISERFS_SB(s)->s_kmallocs);
   }
 
   if (REISERFS_SB(s)->reserved_blocks != 0) {
-    reiserfs_warning ("green-2005: reiserfs_put_super: reserved blocks left %d\n",
+    reiserfs_warning (s, "green-2005: reiserfs_put_super: reserved blocks left %d",
 		      REISERFS_SB(s)->reserved_blocks);
   }
 
@@ -422,6 +435,8 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 	    SLAB_CTOR_CONSTRUCTOR) {
 		INIT_LIST_HEAD(&ei->i_prealloc_list) ;
 		inode_init_once(&ei->vfs_inode);
+		ei->i_acl_access = NULL;
+		ei->i_acl_default = NULL;
 	}
 }
  
@@ -439,7 +454,7 @@ static int init_inodecache(void)
 static void destroy_inodecache(void)
 {
 	if (kmem_cache_destroy(reiserfs_inode_cachep))
-		printk(KERN_INFO "reiserfs_inode_cache: not all structures were freed\n");
+		reiserfs_warning (NULL, "reiserfs_inode_cache: not all structures were freed");
 }
 
 /* we don't mark inodes dirty, we just log them */
@@ -447,7 +462,7 @@ static void reiserfs_dirty_inode (struct inode * inode) {
     struct reiserfs_transaction_handle th ;
 
     if (inode->i_sb->s_flags & MS_RDONLY) {
-        reiserfs_warning("clm-6006: writing inode %lu on readonly FS\n", 
+        reiserfs_warning(inode->i_sb, "clm-6006: writing inode %lu on readonly FS",
 	                  inode->i_ino) ;
         return ;
     }
@@ -462,6 +477,22 @@ static void reiserfs_dirty_inode (struct inode * inode) {
     reiserfs_write_unlock(inode->i_sb);
 }
 
+static void reiserfs_clear_inode (struct inode *inode)
+{
+    struct posix_acl *acl;
+
+    acl = REISERFS_I(inode)->i_acl_access;
+    if (acl && !IS_ERR (acl))
+        posix_acl_release (acl);
+    REISERFS_I(inode)->i_acl_access = NULL;
+
+    acl = REISERFS_I(inode)->i_acl_default;
+    if (acl && !IS_ERR (acl))
+        posix_acl_release (acl);
+    REISERFS_I(inode)->i_acl_default = NULL;
+}
+
+
 struct super_operations reiserfs_sops = 
 {
   .alloc_inode = reiserfs_alloc_inode,
@@ -469,6 +500,7 @@ struct super_operations reiserfs_sops =
   .write_inode = reiserfs_write_inode,
   .dirty_inode = reiserfs_dirty_inode,
   .delete_inode = reiserfs_delete_inode,
+  .clear_inode  = reiserfs_clear_inode,
   .put_super = reiserfs_put_super,
   .write_super = reiserfs_write_super,
   .write_super_lockfs = reiserfs_write_super_lockfs,
@@ -595,7 +627,7 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
 	}
     }
     if (!opt->option_name) {
-	printk ("reiserfs_getopt: unknown option \"%s\"\n", p);
+	reiserfs_warning (s, "unknown mount option \"%s\"", p);
 	return -1;
     }
     
@@ -603,7 +635,7 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
     switch (*p) {
     case '=':
 	if (!opt->arg_required) {
-	    printk ("reiserfs_getopt: the option \"%s\" does not require an argument\n",
+	    reiserfs_warning (s, "the option \"%s\" does not require an argument",
 		    opt->option_name);
 	    return -1;
 	}
@@ -611,12 +643,12 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
 	
     case 0:
 	if (opt->arg_required) {
-	    printk ("reiserfs_getopt: the option \"%s\" requires an argument\n", opt->option_name);
+	    reiserfs_warning (s, "the option \"%s\" requires an argument", opt->option_name);
 	    return -1;
 	}
 	break;
     default:
-	printk ("reiserfs_getopt: head of option \"%s\" is only correct\n", opt->option_name);
+	reiserfs_warning (s, "head of option \"%s\" is only correct", opt->option_name);
 	return -1;
     }
 	
@@ -625,7 +657,7 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
     
     if ( opt->arg_required && !strlen (p) ) {
 	/* this catches "option=," */
-	printk ("reiserfs_getopt: empty argument for \"%s\"\n", opt->option_name);
+	reiserfs_warning (s, "empty argument for \"%s\"", opt->option_name);
 	return -1;
     }
     
@@ -646,7 +678,7 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
 	}
     }
     
-    printk ("reiserfs_getopt: bad value \"%s\" for option \"%s\"\n", p, opt->option_name);
+    reiserfs_warning (s, "bad value \"%s\" for option \"%s\"", p, opt->option_name);
     return -1;
 }
 
@@ -669,6 +701,12 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	{"conv", 0, 0, 1<<REISERFS_CONVERT, 0},
 	{"attrs", 0, 0, 1<<REISERFS_ATTRS, 0},
 	{"noattrs", 0, 0, 0, 1<<REISERFS_ATTRS},
+	{"user_xattr", 0, 0, 1<<REISERFS_XATTRS_USER, 0},
+	{"nouser_xattr", 0, 0, 0, 1<<REISERFS_XATTRS_USER},
+#ifdef CONFIG_REISERFS_FS_POSIX_ACL
+	{"acl", 0, 0, 1<<REISERFS_POSIXACL, 0},
+	{"noacl", 0, 0, 0, 1<<REISERFS_POSIXACL},
+#endif
 	{"nolog", 0, 0, 0, 0}, /* This is unsupported */
 	{"replayonly", 0, 0, 1<<REPLAYONLY, 0},
 	{"block-allocator", 'a', balloc, 0, 0},
@@ -677,6 +715,8 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	{"jdev", 'j', 0, 0, 0},
 	{"nolargeio", 'w', 0, 0, 0},
 	{"commit", 'c', 0, 0, 0},
+	{"usrquota", 0, 0, 0, 0},
+	{"grpquota", 0, 0, 0, 0},
 	{NULL, 0, 0, 0, 0}
     };
 	
@@ -700,20 +740,19 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	    *blocks = simple_strtoul (arg, &p, 0);
 	    if (*p != '\0') {
 		/* NNN does not look like a number */
-		printk ("reiserfs_parse_options: bad value %s\n", arg);
+		reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg);
 		return 0;
 	    }
 	}
 
 	if ( c == 'c' ) {
 		char *p = 0;
-		int val = simple_strtoul (arg, &p, 0);
+		unsigned long val = simple_strtoul (arg, &p, 0);
 		/* commit=NNN (time in seconds) */
-		if ( *p != '\0' || val < 0) {
-			printk ("reiserfs_parse_options: bad value %s\n", arg);
-			return 0;
+		if ( *p != '\0' || val >= (unsigned int)-1) {
+			reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg);			return 0;
 		}
-		*commit_max_age = val;
+		*commit_max_age = (unsigned int)val;
 	}
 
 	if ( c == 'w' ) {
@@ -721,7 +760,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 		int val = simple_strtoul (arg, &p, 0);
 
 		if ( *p != '\0') {
-		    printk ("reiserfs_parse_options: non-numeric value %s for nolargeio option\n", arg);
+		    reiserfs_warning (s, "reiserfs_parse_options: non-numeric value %s for nolargeio option", arg);
 		    return 0;
 		}
 		if ( val ) 
@@ -733,7 +772,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	if (c == 'j') {
 	    if (arg && *arg && jdev_name) {
 		if ( *jdev_name ) { //Hm, already assigned?
-		    printk("reiserfs_parse_options: journal device was already  specified to be %s\n", *jdev_name);
+		    reiserfs_warning (s, "reiserfs_parse_options: journal device was already  specified to be %s", *jdev_name);
 		    return 0;
 		}
 		*jdev_name = arg;
@@ -756,17 +795,17 @@ static void handle_data_mode(struct super_block *s, unsigned long mount_options)
     if (mount_options & (1 << REISERFS_DATA_LOG)) {
         if (!reiserfs_data_log(s)) {
 	    switch_data_mode(s, REISERFS_DATA_LOG);
-	    printk("reiserfs: switching to journaled data mode\n");
+	    reiserfs_info (s, "switching to journaled data mode\n");
 	}
     } else if (mount_options & (1 << REISERFS_DATA_ORDERED)) {
         if (!reiserfs_data_ordered(s)) {
 	    switch_data_mode(s, REISERFS_DATA_ORDERED);
-	    printk("reiserfs: switching to ordered data mode\n");
+	    reiserfs_info (s, "switching to ordered data mode\n");
 	}
     } else if (mount_options & (1 << REISERFS_DATA_WRITEBACK)) {
         if (!reiserfs_data_writeback(s)) {
 	    switch_data_mode(s, REISERFS_DATA_WRITEBACK);
-	    printk("reiserfs: switching to writeback data mode\n");
+	    reiserfs_info (s, "switching to writeback data mode\n");
 	}
     }
 }
@@ -778,12 +817,12 @@ static void handle_attrs( struct super_block *s )
 	if( reiserfs_attrs( s ) ) {
 		rs = SB_DISK_SUPER_BLOCK (s);
 		if( old_format_only(s) ) {
-			reiserfs_warning( "reiserfs: cannot support attributes on 3.5.x disk format\n" );
+			reiserfs_warning(s, "reiserfs: cannot support attributes on 3.5.x disk format" );
 			REISERFS_SB(s) -> s_mount_opt &= ~ ( 1 << REISERFS_ATTRS );
 			return;
 		}
 		if( !( le32_to_cpu( rs -> s_flags ) & reiserfs_attrs_cleared ) ) {
-				reiserfs_warning( "reiserfs: cannot support attributes until flag is set in super-block\n" );
+				reiserfs_warning(s, "reiserfs: cannot support attributes until flag is set in super-block" );
 				REISERFS_SB(s) -> s_mount_opt &= ~ ( 1 << REISERFS_ATTRS );
 		}
 	}
@@ -796,7 +835,7 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
   unsigned long blocks;
   unsigned long mount_options = REISERFS_SB(s)->s_mount_opt;
   unsigned long safe_mask = 0;
-  unsigned int commit_max_age = 0;
+  unsigned int commit_max_age = (unsigned int)-1;
 
   rs = SB_DISK_SUPER_BLOCK (s);
 
@@ -813,16 +852,18 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
   safe_mask |= 1 << REISERFS_HASHED_RELOCATION;
   safe_mask |= 1 << REISERFS_TEST4;
   safe_mask |= 1 << REISERFS_ATTRS;
+  safe_mask |= 1 << REISERFS_XATTRS_USER;
+  safe_mask |= 1 << REISERFS_POSIXACL;
 
   /* Update the bitmask, taking care to keep
    * the bits we're not allowed to change here */
   REISERFS_SB(s)->s_mount_opt = (REISERFS_SB(s)->s_mount_opt & ~safe_mask) |  (mount_options & safe_mask);
 
-  if(commit_max_age != 0) {
+  if(commit_max_age != 0 && commit_max_age != (unsigned int)-1) {
     SB_JOURNAL_MAX_COMMIT_AGE(s) = commit_max_age;
     SB_JOURNAL_MAX_TRANS_AGE(s) = commit_max_age;
   }
-  else
+  else if(commit_max_age == 0)
   {
     /* 0 means restore defaults. */
     SB_JOURNAL_MAX_COMMIT_AGE(s) = SB_JOURNAL_DEFAULT_MAX_COMMIT_AGE(s);
@@ -836,6 +877,7 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
   }
 
   if (*mount_flags & MS_RDONLY) {
+    reiserfs_xattr_init (s, *mount_flags);
     /* remount read-only */
     if (s->s_flags & MS_RDONLY)
       /* it is read-only already */
@@ -852,8 +894,10 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
     journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB (s));
   } else {
     /* remount read-write */
-    if (!(s->s_flags & MS_RDONLY))
+    if (!(s->s_flags & MS_RDONLY)) {
+	reiserfs_xattr_init (s, *mount_flags);
 	return 0; /* We are read-write already */
+    }
 
     handle_data_mode(s, mount_options);
     REISERFS_SB(s)->s_mount_state = sb_umount_state(rs) ;
@@ -874,8 +918,10 @@ static int reiserfs_remount (struct super_block * s, int * mount_flags, char * a
   journal_end(&th, s, 10) ;
   s->s_dirt = 0;
 
-  if (!( *mount_flags & MS_RDONLY ) )
+  if (!( *mount_flags & MS_RDONLY ) ) {
     finish_unfinished( s );
+    reiserfs_xattr_init (s, *mount_flags);
+  }
 
   return 0;
 }
@@ -926,7 +972,7 @@ static void load_bitmap_info_data (struct super_block *sb,
 
 #ifdef CONFIG_REISERFS_CHECK
 // This outputs a lot of unneded info on big FSes
-//    reiserfs_warning ("bitmap loaded from block %d: %d free blocks\n",
+//    reiserfs_warning ("bitmap loaded from block %d: %d free blocks",
 //		      bi->bh->b_blocknr, bi->free_count);
 #endif
 }
@@ -948,8 +994,8 @@ static int read_bitmaps (struct super_block * s)
     for (i = 0; i < SB_BMAP_NR(s); i++) {
 	wait_on_buffer(SB_AP_BITMAP (s)[i].bh);
 	if (!buffer_uptodate(SB_AP_BITMAP(s)[i].bh)) {
-	    reiserfs_warning("sh-2029: reiserfs read_bitmaps: "
-			 "bitmap block (#%lu) reading failed\n",
+	    reiserfs_warning(s,"sh-2029: reiserfs read_bitmaps: "
+			 "bitmap block (#%lu) reading failed",
 			 SB_AP_BITMAP(s)[i].bh->b_blocknr);
 	    for (i = 0; i < SB_BMAP_NR(s); i++)
 		brelse(SB_AP_BITMAP(s)[i].bh);
@@ -999,7 +1045,7 @@ void check_bitmap (struct super_block * s)
   }
 
   if (free != SB_FREE_BLOCKS (s))
-    reiserfs_warning ("vs-4000: check_bitmap: %d free blocks, must be %d\n",
+    reiserfs_warning (s,"vs-4000: check_bitmap: %d free blocks, must be %d",
 		      free, SB_FREE_BLOCKS (s));
 }
 
@@ -1012,8 +1058,8 @@ static int read_super_block (struct super_block * s, int offset)
 
     bh = sb_bread (s, offset / s->s_blocksize);
     if (!bh) {
-      printk ("sh-2006: read_super_block: "
-              "bread failed (dev %s, block %lu, size %lu)\n",
+      reiserfs_warning (s, "sh-2006: read_super_block: "
+              "bread failed (dev %s, block %lu, size %lu)",
               reiserfs_bdevname (s), offset / s->s_blocksize, s->s_blocksize);
       return 1;
     }
@@ -1033,7 +1079,7 @@ static int read_super_block (struct super_block * s, int offset)
     
     bh = sb_bread (s, offset / s->s_blocksize);
     if (!bh) {
-	printk("sh-2007: read_super_block: "
+	reiserfs_warning (s, "sh-2007: read_super_block: "
                 "bread failed (dev %s, block %lu, size %lu)\n",
                 reiserfs_bdevname (s), offset / s->s_blocksize, s->s_blocksize);
 	return 1;
@@ -1041,7 +1087,7 @@ static int read_super_block (struct super_block * s, int offset)
     
     rs = (struct reiserfs_super_block *)bh->b_data;
     if (sb_blocksize(rs) != s->s_blocksize) {
-	printk ("sh-2011: read_super_block: "
+	reiserfs_warning (s, "sh-2011: read_super_block: "
 		"can't find a reiserfs filesystem on (dev %s, block %Lu, size %lu)\n",
 		reiserfs_bdevname (s), (unsigned long long)bh->b_blocknr, s->s_blocksize);
 	brelse (bh);
@@ -1050,9 +1096,9 @@ static int read_super_block (struct super_block * s, int offset)
 
     if ( rs->s_v1.s_root_block == -1 ) {
        brelse(bh) ;
-       printk("dev %s: Unfinished reiserfsck --rebuild-tree run detected. Please run\n"
+       reiserfs_warning (s, "Unfinished reiserfsck --rebuild-tree run detected. Please run\n"
               "reiserfsck --rebuild-tree and wait for a completion. If that fails\n"
-              "get newer reiserfsprogs package\n", reiserfs_bdevname (s));
+              "get newer reiserfsprogs package");
        return 1;
     }
 
@@ -1063,21 +1109,22 @@ static int read_super_block (struct super_block * s, int offset)
 	/* magic is of non-standard journal filesystem, look at s_version to
 	   find which format is in use */
 	if (sb_version(rs) == REISERFS_VERSION_2)
-	  printk ("read_super_block: found reiserfs format \"3.6\" "
-		  "with non-standard journal\n");
+	  reiserfs_warning (s, "read_super_block: found reiserfs format \"3.6\""
+		  " with non-standard journal");
 	else if (sb_version(rs) == REISERFS_VERSION_1)
-	  printk ("read_super_block: found reiserfs format \"3.5\" "
-		  "with non-standard journal\n");
+	  reiserfs_warning (s, "read_super_block: found reiserfs format \"3.5\""
+		  " with non-standard journal");
 	else {
-	  printk ("sh-2012: read_super_block: found unknown format \"%u\" "
-	            "of reiserfs with non-standard magic\n", sb_version(rs));
+	  reiserfs_warning (s, "sh-2012: read_super_block: found unknown "
+			    "format \"%u\" of reiserfs with non-standard magic",
+			    sb_version(rs));
 	return 1;
 	}
     }
     else
       /* s_version of standard format may contain incorrect information,
 	 so we just look at the magic string */
-      printk ("found reiserfs format \"%s\" with standard journal\n",
+      reiserfs_info (s, "found reiserfs format \"%s\" with standard journal\n",
 	      is_reiserfs_3_5 (rs) ? "3.5" : "3.6");
 
     s->s_op = &reiserfs_sops;
@@ -1098,7 +1145,7 @@ static int reread_meta_blocks(struct super_block *s) {
   ll_rw_block(READ, 1, &(SB_BUFFER_WITH_SB(s))) ;
   wait_on_buffer(SB_BUFFER_WITH_SB(s)) ;
   if (!buffer_uptodate(SB_BUFFER_WITH_SB(s))) {
-    printk("reread_meta_blocks, error reading the super\n") ;
+    reiserfs_warning (s, "reread_meta_blocks, error reading the super") ;
     return 1 ;
   }
 
@@ -1106,7 +1153,7 @@ static int reread_meta_blocks(struct super_block *s) {
     ll_rw_block(READ, 1, &(SB_AP_BITMAP(s)[i].bh)) ;
     wait_on_buffer(SB_AP_BITMAP(s)[i].bh) ;
     if (!buffer_uptodate(SB_AP_BITMAP(s)[i].bh)) {
-      printk("reread_meta_blocks, error reading bitmap block number %d at %llu\n", 
+      reiserfs_warning (s, "reread_meta_blocks, error reading bitmap block number %d at %llu",
         i, (unsigned long long)SB_AP_BITMAP(s)[i].bh->b_blocknr) ;
       return 1 ;
     }
@@ -1153,8 +1200,8 @@ __u32 find_hash_out (struct super_block * s)
 	    if (reiserfs_rupasov_hash(s)) {
 		hash = YURA_HASH ;
 	    }
-	    reiserfs_warning("reiserfs: FS seems to be empty, autodetect "
-	                     "is using the default hash\n");
+	    reiserfs_warning(s,"FS seems to be empty, autodetect "
+	                     "is using the default hash");
 	    break;
 	}
 	r5hash=GET_HASH_VALUE (r5_hash (de.de_name, de.de_namelen));
@@ -1163,9 +1210,9 @@ __u32 find_hash_out (struct super_block * s)
 	if ( ( (teahash == r5hash) && (GET_HASH_VALUE( deh_offset(&(de.de_deh[de.de_entry_num]))) == r5hash) ) ||
 	     ( (teahash == yurahash) && (yurahash == GET_HASH_VALUE( deh_offset(&(de.de_deh[de.de_entry_num])))) ) ||
 	     ( (r5hash == yurahash) && (yurahash == GET_HASH_VALUE( deh_offset(&(de.de_deh[de.de_entry_num])))) ) ) {
-	    reiserfs_warning("reiserfs: Unable to automatically detect hash"
-		"function for device %s\n"
-		"please mount with -o hash={tea,rupasov,r5}\n", reiserfs_bdevname (s));
+	    reiserfs_warning(s,"Unable to automatically detect hash function. "
+			     "Please mount with -o hash={tea,rupasov,r5}",
+			     reiserfs_bdevname (s));
 	    hash = UNSET_HASH;
 	    break;
 	}
@@ -1176,8 +1223,7 @@ __u32 find_hash_out (struct super_block * s)
 	else if (GET_HASH_VALUE( deh_offset(&(de.de_deh[de.de_entry_num])) ) == r5hash)
 	    hash = R5_HASH;
 	else {
-	    reiserfs_warning("reiserfs: Unrecognised hash function for "
-			     "device %s\n", reiserfs_bdevname (s));
+	    reiserfs_warning (s,"Unrecognised hash function");
 	    hash = UNSET_HASH;
 	}
     } while (0);
@@ -1205,16 +1251,16 @@ static int what_hash (struct super_block * s)
 	** mount options 
 	*/
 	if (reiserfs_rupasov_hash(s) && code != YURA_HASH) {
-	    printk("REISERFS: Error, %s hash detected, "
-		   "unable to force rupasov hash\n", reiserfs_hashname(code)) ;
+	    reiserfs_warning (s, "Error, %s hash detected, "
+		   "unable to force rupasov hash", reiserfs_hashname(code)) ;
 	    code = UNSET_HASH ;
 	} else if (reiserfs_tea_hash(s) && code != TEA_HASH) {
-	    printk("REISERFS: Error, %s hash detected, "
-		   "unable to force tea hash\n", reiserfs_hashname(code)) ;
+	    reiserfs_warning (s, "Error, %s hash detected, "
+		   "unable to force tea hash", reiserfs_hashname(code)) ;
 	    code = UNSET_HASH ;
 	} else if (reiserfs_r5_hash(s) && code != R5_HASH) {
-	    printk("REISERFS: Error, %s hash detected, "
-		   "unable to force r5 hash\n", reiserfs_hashname(code)) ;
+	    reiserfs_warning (s, "Error, %s hash detected, "
+		   "unable to force r5 hash", reiserfs_hashname(code)) ;
 	    code = UNSET_HASH ;
 	} 
     } else { 
@@ -1244,13 +1290,13 @@ static hashf_t hash_function (struct super_block * s)
 {
     switch (what_hash (s)) {
     case TEA_HASH:
-	reiserfs_warning ("Using tea hash to sort names\n");
+	reiserfs_info (s, "Using tea hash to sort names\n");
 	return keyed_hash;
     case YURA_HASH:
-	reiserfs_warning ("Using rupasov hash to sort names\n");
+	reiserfs_info (s, "Using rupasov hash to sort names\n");
 	return yura_hash;
     case R5_HASH:
-	reiserfs_warning ("Using r5 hash to sort names\n");
+	reiserfs_info (s, "Using r5 hash to sort names\n");
 	return r5_hash;
     }
     return NULL;
@@ -1271,9 +1317,9 @@ int function2code (hashf_t func)
     return 0;
 }
 
-#define SPRINTK(silent, ...)			\
+#define SWARN(silent, s, ...)			\
 	if (!(silent))				\
-		printk(__VA_ARGS__)
+		reiserfs_warning (s, __VA_ARGS__)
 
 static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
 {
@@ -1282,7 +1328,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     struct reiserfs_transaction_handle th ;
     int old_format = 0;
     unsigned long blocks;
-	unsigned int commit_max_age = 0;
+    unsigned int commit_max_age = 0;
     int jinit_done = 0 ;
     struct reiserfs_iget_args args ;
     struct reiserfs_super_block * rs;
@@ -1305,6 +1351,8 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     REISERFS_SB(s)->s_alloc_options.preallocmin = 4;
     /* Preallocate by 16 blocks (17-1) at once */
     REISERFS_SB(s)->s_alloc_options.preallocsize = 17;
+    /* Initialize the rwsem for xattr dir */
+    init_rwsem(&REISERFS_SB(s)->xattr_dir_sem);
 
     jdev_name = NULL;
     if (reiserfs_parse_options (s, (char *) data, &(sbi->s_mount_opt), &blocks, &jdev_name, &commit_max_age) == 0) {
@@ -1312,7 +1360,8 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     }
 
     if (blocks) {
-	SPRINTK(silent, "jmacd-7: reiserfs_fill_super: resize option for remount only\n");
+	SWARN (silent, s, "jmacd-7: reiserfs_fill_super: resize option "
+	       "for remount only");
 	goto error;
     }	
 
@@ -1321,7 +1370,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
       old_format = 1;
     /* try new format (64-th 1k block), which can contain reiserfs super block */
     else if (read_super_block (s, REISERFS_DISK_OFFSET_IN_BYTES)) {
-      SPRINTK(silent, "sh-2021: reiserfs_fill_super: can not find reiserfs on %s\n", reiserfs_bdevname (s));
+      SWARN(silent, s, "sh-2021: reiserfs_fill_super: can not find reiserfs on %s", reiserfs_bdevname (s));
       goto error;
     }
 
@@ -1330,9 +1379,9 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
        smaller than the filesystem. If the check fails then abort and scream,
        because bad stuff will happen otherwise. */
     if ( s->s_bdev && s->s_bdev->bd_inode && i_size_read(s->s_bdev->bd_inode) < sb_block_count(rs)*sb_blocksize(rs)) {
-	SPRINTK(silent, "Filesystem on %s cannot be mounted because it is bigger than the device\n", reiserfs_bdevname(s));
-	SPRINTK(silent, "You may need to run fsck or increase size of your LVM partition\n");
-	SPRINTK(silent, "Or may be you forgot to reboot after fdisk when it told you to\n");
+	SWARN (silent, s, "Filesystem on %s cannot be mounted because it is bigger than the device", reiserfs_bdevname(s));
+	SWARN(silent, s, "You may need to run fsck or increase size of your LVM partition");
+	SWARN(silent, s, "Or may be you forgot to reboot after fdisk when it told you to");
 	goto error;
     }
 
@@ -1340,12 +1389,12 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     sbi->s_mount_state = REISERFS_VALID_FS ;
 
     if (old_format ? read_old_bitmaps(s) : read_bitmaps(s)) {
-	SPRINTK(silent, "jmacd-8: reiserfs_fill_super: unable to read bitmap\n");
+	SWARN(silent, s, "jmacd-8: reiserfs_fill_super: unable to read bitmap");
 	goto error;
     }
 #ifdef CONFIG_REISERFS_CHECK
-    SPRINTK(silent, "reiserfs:warning: CONFIG_REISERFS_CHECK is set ON\n");
-    SPRINTK(silent, "reiserfs:warning: - it is slow mode for debugging.\n");
+    SWARN (silent, s, "CONFIG_REISERFS_CHECK is set ON");
+    SWARN (silent, s, "- it is slow mode for debugging.");
 #endif
 
     /* make data=ordered the default */
@@ -1356,16 +1405,16 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     }
 
     if (reiserfs_data_log(s)) {
-        printk("reiserfs: using journaled data mode\n");
+        reiserfs_info (s, "using journaled data mode\n");
     } else if (reiserfs_data_ordered(s)) {
-        printk("reiserfs: using ordered data mode\n");
+        reiserfs_info (s, "using ordered data mode\n");
     } else {
-        printk("reiserfs: using writeback data mode\n");
+        reiserfs_info (s, "using writeback data mode\n");
     }
 
     // set_device_ro(s->s_dev, 1) ;
     if( journal_init(s, jdev_name, old_format, commit_max_age) ) {
-	SPRINTK(silent, "sh-2022: reiserfs_fill_super: unable to initialize journal space\n") ;
+	SWARN(silent, s, "sh-2022: reiserfs_fill_super: unable to initialize journal space") ;
 	goto error ;
     } else {
 	jinit_done = 1 ; /* once this is set, journal_release must be called
@@ -1373,7 +1422,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
 			 */
     }
     if (reread_meta_blocks(s)) {
-	SPRINTK(silent, "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init\n") ;
+	SWARN(silent, s, "jmacd-9: reiserfs_fill_super: unable to reread meta blocks after journal init") ;
 	goto error ;
     }
 
@@ -1381,14 +1430,14 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
 	goto error;
 
     if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) {
-        SPRINTK(silent, "clm-7000: Detected readonly device, marking FS readonly\n") ;
+        SWARN(silent, s, "clm-7000: Detected readonly device, marking FS readonly") ;
 	s->s_flags |= MS_RDONLY ;
     }
     args.objectid = REISERFS_ROOT_OBJECTID ;
     args.dirid = REISERFS_ROOT_PARENT_OBJECTID ;
     root_inode = iget5_locked (s, REISERFS_ROOT_OBJECTID, reiserfs_find_actor, reiserfs_init_locked_inode, (void *)(&args));
     if (!root_inode) {
-	SPRINTK(silent, "jmacd-10: reiserfs_fill_super: get root inode failed\n");
+	SWARN(silent, s, "jmacd-10: reiserfs_fill_super: get root inode failed");
 	goto error;
     }
 
@@ -1430,7 +1479,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
 	  if (convert_reiserfs (s)) {
 	    /* and -o conv is given */
 	    if(!silent)
-	      reiserfs_warning ("reiserfs: converting 3.5 filesystem to the 3.6 format\n") ;
+	      reiserfs_info (s,"converting 3.5 filesystem to the 3.6 format") ;
 
 	    if (is_reiserfs_3_5 (rs))
 	      /* put magic string of 3.6 format. 2.2 will not be able to
@@ -1443,18 +1492,30 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
 	    set_bit(REISERFS_3_6, &(sbi->s_properties));
 	    clear_bit(REISERFS_3_5, &(sbi->s_properties));
 	  } else if (!silent){
-	    reiserfs_warning("reiserfs: using 3.5.x disk format\n") ;
+	    reiserfs_info (s, "using 3.5.x disk format\n") ;
 	  }
 	}
 
 	journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB (s));
 	journal_end(&th, s, 1) ;
-	
+
+	if (reiserfs_xattr_init (s, s->s_flags)) {
+	    dput (s->s_root);
+	    s->s_root = NULL;
+	    goto error;
+	}
+
 	/* look for files which were to be removed in previous session */
 	finish_unfinished (s);
     } else {
 	if ( old_format_only(s) && !silent) {
-	    reiserfs_warning("reiserfs: using 3.5.x disk format\n") ;
+	    reiserfs_info (s, "using 3.5.x disk format\n") ;
+	}
+
+	if (reiserfs_xattr_init (s, s->s_flags)) {
+	    dput (s->s_root);
+	    s->s_root = NULL;
+	    goto error;
 	}
     }
     // mark hash in super block: it could be unset. overwrite should be ok
@@ -1523,6 +1584,9 @@ init_reiserfs_fs ( void )
 		return ret;
 	}
 
+        if ((ret = reiserfs_xattr_register_handlers ()))
+            goto failed_reiserfs_xattr_register_handlers;
+
 	reiserfs_proc_info_global_init ();
 	reiserfs_proc_register_global ("version", reiserfs_global_version_in_proc);
 
@@ -1532,6 +1596,9 @@ init_reiserfs_fs ( void )
 		return 0;
 	}
 
+        reiserfs_xattr_unregister_handlers ();
+
+failed_reiserfs_xattr_register_handlers:
 	reiserfs_proc_unregister_global ("version");
 	reiserfs_proc_info_global_done ();
 	destroy_inodecache ();
@@ -1542,6 +1609,7 @@ init_reiserfs_fs ( void )
 static void __exit
 exit_reiserfs_fs ( void )
 {
+        reiserfs_xattr_unregister_handlers ();
 	reiserfs_proc_unregister_global ("version");
 	reiserfs_proc_info_global_done ();
         unregister_filesystem (& reiserfs_fs_type);
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index a80626673..29e6a7ca8 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -50,9 +50,9 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
 
     // FIXME: we could avoid this 
     if ( search_for_position_by_key (sb, &end_key, path) == POSITION_FOUND ) {
-	reiserfs_warning ("PAP-14030: direct2indirect: "
+	reiserfs_warning (sb, "PAP-14030: direct2indirect: "
 			"pasted or inserted byte exists in the tree %K. "
-			"Use fsck to repair.\n", &end_key);
+			"Use fsck to repair.", &end_key);
 	pathrelse(path);
 	return -EIO;
     }
@@ -66,11 +66,11 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod
 	set_ih_free_space (&ind_ih, 0); /* delete at nearest future */
         put_ih_item_len( &ind_ih, UNFM_P_SIZE );
 	PATH_LAST_POSITION (path)++;
-	n_retval = reiserfs_insert_item (th, path, &end_key, &ind_ih, 
+	n_retval = reiserfs_insert_item (th, path, &end_key, &ind_ih, inode,
 					 (char *)&unfm_ptr);
     } else {
 	/* Paste into last indirect item of an object. */
-	n_retval = reiserfs_paste_into_item(th, path, &end_key,
+	n_retval = reiserfs_paste_into_item(th, path, &end_key, inode,
 					    (char *)&unfm_ptr, UNFM_P_SIZE);
     }
     if ( n_retval ) {
@@ -274,7 +274,7 @@ int indirect2direct (struct reiserfs_transaction_handle *th,
     set_cpu_key_k_type (&key, TYPE_DIRECT);
     key.key_length = 4;
     /* Insert tail as new direct item in the tree */
-    if ( reiserfs_insert_item(th, p_s_path, &key, &s_ih,
+    if ( reiserfs_insert_item(th, p_s_path, &key, &s_ih, p_s_inode,
 			      tail ? tail : NULL) < 0 ) {
 	/* No disk memory. So we can not convert last unformatted node
 	   to the direct item.  In this case we used to adjust
@@ -292,13 +292,15 @@ int indirect2direct (struct reiserfs_transaction_handle *th,
     */
     unmap_buffers(page, pos1) ;
 
+    /* make sure to get the i_blocks changes from reiserfs_insert_item */
+    reiserfs_update_sd(th, p_s_inode);
+
     // note: we have now the same as in above direct2indirect
     // conversion: there are two keys which have matching first three
     // key components. They only differ by the fouhth one.
 
     /* We have inserted new direct item and must remove last
        unformatted node. */
-    p_s_inode->i_blocks += (p_s_sb->s_blocksize / 512);
     *p_c_mode = M_CUT;
 
     /* we store position of first direct item in the in-core inode */
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index f1b17acb8..12fc56cac 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -215,7 +215,7 @@ smb_updatepage(struct file *file, struct page *page, unsigned long offset,
 }
 
 static ssize_t
-smb_file_read(struct file * file, char * buf, size_t count, loff_t *ppos)
+smb_file_read(struct file * file, char __user * buf, size_t count, loff_t *ppos)
 {
 	struct dentry * dentry = file->f_dentry;
 	ssize_t	status;
@@ -318,7 +318,7 @@ struct address_space_operations smb_file_aops = {
  * Write to a file (through the page cache).
  */
 static ssize_t
-smb_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+smb_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct dentry * dentry = file->f_dentry;
 	ssize_t	result;
diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c
index 912c0460b..dbae1f8ea 100644
--- a/fs/smbfs/ioctl.c
+++ b/fs/smbfs/ioctl.c
@@ -35,11 +35,11 @@ smb_ioctl(struct inode *inode, struct file *filp,
 		uid_t uid32;
 	case SMB_IOC_GETMOUNTUID:
 		SET_UID(uid16, server->mnt->mounted_uid);
-		result = put_user(uid16, (uid16_t *) arg);
+		result = put_user(uid16, (uid16_t __user *) arg);
 		break;
 	case SMB_IOC_GETMOUNTUID32:
 		SET_UID(uid32, server->mnt->mounted_uid);
-		result = put_user(uid32, (uid_t *) arg);
+		result = put_user(uid32, (uid_t __user *) arg);
 		break;
 
 	case SMB_IOC_NEWCONN:
@@ -56,7 +56,7 @@ smb_ioctl(struct inode *inode, struct file *filp,
 		}
 
 		result = -EFAULT;
-		if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
+		if (!copy_from_user(&opt, (void __user *)arg, sizeof(opt)))
 			result = smb_newconn(server, &opt);
 		break;
 	default:
diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c
index 2eefecb4b..6d8b28756 100644
--- a/fs/smbfs/smbiod.c
+++ b/fs/smbfs/smbiod.c
@@ -54,7 +54,7 @@ static int smbiod_start(void);
 /*
  * called when there's work for us to do
  */
-void smbiod_wake_up()
+void smbiod_wake_up(void)
 {
 	if (smbiod_state == SMBIOD_DEAD)
 		return;
diff --git a/fs/stat.c b/fs/stat.c
index 7816772af..6bda9bfae 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -16,6 +16,7 @@
 #include <linux/security.h>
 
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 
 void generic_fillattr(struct inode *inode, struct kstat *stat)
 {
@@ -105,10 +106,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
 
 EXPORT_SYMBOL(vfs_fstat);
 
-#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) \
-  && !defined(CONFIG_ARCH_S390) && !defined(__hppa__) \
-  && !defined(__arm__) && !defined(CONFIG_V850) && !defined(__powerpc64__) \
-  && !defined(__mips__)
+#ifdef __ARCH_WANT_OLD_STAT
 
 /*
  * For backward compatibility?  Maybe this should be moved
@@ -133,6 +131,8 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
 	tmp.st_ino = stat->ino;
 	tmp.st_mode = stat->mode;
 	tmp.st_nlink = stat->nlink;
+	if (tmp.st_nlink != stat->nlink)
+		return -EOVERFLOW;
 	SET_UID(tmp.st_uid, stat->uid);
 	SET_GID(tmp.st_gid, stat->gid);
 	tmp.st_rdev = old_encode_dev(stat->rdev);
@@ -178,7 +178,7 @@ asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * sta
 	return error;
 }
 
-#endif
+#endif /* __ARCH_WANT_OLD_STAT */
 
 static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
 {
@@ -201,6 +201,8 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
 	tmp.st_ino = stat->ino;
 	tmp.st_mode = stat->mode;
 	tmp.st_nlink = stat->nlink;
+	if (tmp.st_nlink != stat->nlink)
+		return -EOVERFLOW;
 	SET_UID(tmp.st_uid, stat->uid);
 	SET_GID(tmp.st_gid, stat->gid);
 #if BITS_PER_LONG == 32
@@ -284,7 +286,7 @@ asmlinkage long sys_readlink(const char __user * path, char __user * buf, int bu
 
 
 /* ---------- LFS-64 ----------- */
-#if !defined(__ia64__) && !defined(__mips64) && !defined(__x86_64__) && !defined(CONFIG_ARCH_S390X)
+#ifdef __ARCH_WANT_STAT64
 
 static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
 {
@@ -352,7 +354,7 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
 	return error;
 }
 
-#endif /* LFS-64 */
+#endif /* __ARCH_WANT_STAT64 */
 
 void inode_add_bytes(struct inode *inode, loff_t bytes)
 {
diff --git a/fs/super.c b/fs/super.c
index e62838940..8d9bff178 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -101,6 +101,21 @@ static inline void destroy_super(struct super_block *s)
 
 /* Superblock refcounting  */
 
+/*
+ * Drop a superblock's refcount.  Returns non-zero if the superblock was
+ * destroyed.  The caller must hold sb_lock.
+ */
+int __put_super(struct super_block *sb)
+{
+	int ret = 0;
+
+	if (!--sb->s_count) {
+		destroy_super(sb);
+		ret = 1;
+	}
+	return ret;
+}
+
 /**
  *	put_super	-	drop a temporary reference to superblock
  *	@s: superblock in question
@@ -108,14 +123,14 @@ static inline void destroy_super(struct super_block *s)
  *	Drops a temporary reference, frees superblock if there's no
  *	references left.
  */
-static inline void put_super(struct super_block *s)
+static void put_super(struct super_block *sb)
 {
 	spin_lock(&sb_lock);
-	if (!--s->s_count)
-		destroy_super(s);
+	__put_super(sb);
 	spin_unlock(&sb_lock);
 }
 
+
 /**
  *	deactivate_super	-	drop an active reference to superblock
  *	@s: superblock to deactivate
@@ -266,6 +281,7 @@ retry:
 		return ERR_PTR(err);
 	}
 	s->s_type = type;
+	strlcpy(s->s_id, type->name, sizeof(s->s_id));
 	list_add(&s->s_list, super_blocks.prev);
 	list_add(&s->s_instances, &type->fs_supers);
 	spin_unlock(&sb_lock);
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 6b4c28844..d45572510 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -94,7 +94,7 @@ static ssize_t write(struct file * file, const char __user * userbuf,
 
 static int open(struct inode * inode, struct file * file)
 {
-	struct kobject * kobj = kobject_get(file->f_dentry->d_parent->d_fsdata);
+	struct kobject *kobj = sysfs_get_kobject(file->f_dentry->d_parent);
 	struct bin_attribute * attr = file->f_dentry->d_fsdata;
 	int error = -EINVAL;
 
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index add2045e8..d688117ba 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -10,6 +10,8 @@
 #include <linux/kobject.h>
 #include "sysfs.h"
 
+DECLARE_RWSEM(sysfs_rename_sem);
+
 static int init_dir(struct inode * inode)
 {
 	inode->i_op = &simple_dir_inode_operations;
@@ -134,8 +136,14 @@ restart:
 			/**
 			 * Unlink and unhash.
 			 */
+			__d_drop(d);
 			spin_unlock(&dcache_lock);
-			d_delete(d);
+			/* release the target kobject in case of 
+			 * a symlink
+			 */
+			if (S_ISLNK(d->d_inode->i_mode))
+				kobject_put(d->d_fsdata);
+			
 			simple_unlink(dentry->d_inode,d);
 			dput(d);
 			pr_debug(" done\n");
@@ -154,24 +162,35 @@ restart:
 	dput(dentry);
 }
 
-void sysfs_rename_dir(struct kobject * kobj, const char *new_name)
+int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
 {
+	int error = 0;
 	struct dentry * new_dentry, * parent;
 
 	if (!strcmp(kobject_name(kobj), new_name))
-		return;
+		return -EINVAL;
 
 	if (!kobj->parent)
-		return;
+		return -EINVAL;
 
+	down_write(&sysfs_rename_sem);
 	parent = kobj->parent->dentry;
 
 	down(&parent->d_inode->i_sem);
 
 	new_dentry = sysfs_get_dentry(parent, new_name);
-	d_move(kobj->dentry, new_dentry);
-	kobject_set_name(kobj,new_name);
+	if (!IS_ERR(new_dentry)) {
+  		if (!new_dentry->d_inode) {
+			error = kobject_set_name(kobj,new_name);
+			if (!error)
+				d_move(kobj->dentry, new_dentry);
+		}
+		dput(new_dentry);
+	}
 	up(&parent->d_inode->i_sem);	
+	up_write(&sysfs_rename_sem);
+
+	return error;
 }
 
 EXPORT_SYMBOL(sysfs_create_dir);
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index cb1f3d9c7..72cd7076c 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -89,6 +89,7 @@ static int fill_read_buffer(struct file * file, struct sysfs_buffer * buffer)
 		return -ENOMEM;
 
 	count = ops->show(kobj,attr,buffer->page);
+	BUG_ON(count > PAGE_SIZE);
 	if (count >= 0)
 		buffer->count = count;
 	else
@@ -238,7 +239,7 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t
 
 static int check_perm(struct inode * inode, struct file * file)
 {
-	struct kobject * kobj = kobject_get(file->f_dentry->d_parent->d_fsdata);
+	struct kobject *kobj = sysfs_get_kobject(file->f_dentry->d_parent);
 	struct attribute * attr = file->f_dentry->d_fsdata;
 	struct sysfs_buffer * buffer;
 	struct sysfs_ops * ops = NULL;
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 6309cd83b..ac5c0b962 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -96,7 +96,12 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name)
 			pr_debug("sysfs: Removing %s (%d)\n", victim->d_name.name,
 				 atomic_read(&victim->d_count));
 
-			d_delete(victim);
+			d_drop(victim);
+			/* release the target kobject in case of 
+			 * a symlink
+			 */
+			if (S_ISLNK(victim->d_inode->i_mode))
+				kobject_put(victim->d_fsdata);
 			simple_unlink(dir->d_inode,victim);
 		}
 		/*
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 6216e946e..c8bfec6b7 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -8,27 +8,17 @@
 
 #include "sysfs.h"
 
+static struct inode_operations sysfs_symlink_inode_operations = {
+	.readlink = sysfs_readlink,
+	.follow_link = sysfs_follow_link,
+};
 
 static int init_symlink(struct inode * inode)
 {
-	inode->i_op = &page_symlink_inode_operations;
+	inode->i_op = &sysfs_symlink_inode_operations;
 	return 0;
 }
 
-static int sysfs_symlink(struct inode * dir, struct dentry *dentry, const char * symname)
-{
-	int error;
-
-	error = sysfs_create(dentry, S_IFLNK|S_IRWXUGO, init_symlink);
-	if (!error) {
-		int l = strlen(symname)+1;
-		error = page_symlink(dentry->d_inode, symname, l);
-		if (error)
-			iput(dentry->d_inode);
-	}
-	return error;
-}
-
 static int object_depth(struct kobject * kobj)
 {
 	struct kobject * p = kobj;
@@ -74,37 +64,20 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, char * nam
 	struct dentry * dentry = kobj->dentry;
 	struct dentry * d;
 	int error = 0;
-	int size;
-	int depth;
-	char * path;
-	char * s;
-
-	depth = object_depth(kobj);
-	size = object_path_length(target) + depth * 3 - 1;
-	if (size > PATH_MAX)
-		return -ENAMETOOLONG;
-	pr_debug("%s: depth = %d, size = %d\n",__FUNCTION__,depth,size);
-
-	path = kmalloc(size,GFP_KERNEL);
-	if (!path)
-		return -ENOMEM;
-	memset(path,0,size);
-
-	for (s = path; depth--; s += 3)
-		strcpy(s,"../");
-
-	fill_object_path(target,path,size);
-	pr_debug("%s: path = '%s'\n",__FUNCTION__,path);
 
 	down(&dentry->d_inode->i_sem);
 	d = sysfs_get_dentry(dentry,name);
-	if (!IS_ERR(d))
-		error = sysfs_symlink(dentry->d_inode,d,path);
-	else
+	if (!IS_ERR(d)) {
+		error = sysfs_create(d, S_IFLNK|S_IRWXUGO, init_symlink);
+		if (!error)
+			/* 
+			 * associate the link dentry with the target kobject 
+			 */
+			d->d_fsdata = kobject_get(target);
+		dput(d);
+	} else 
 		error = PTR_ERR(d);
-	dput(d);
 	up(&dentry->d_inode->i_sem);
-	kfree(path);
 	return error;
 }
 
@@ -120,6 +93,86 @@ void sysfs_remove_link(struct kobject * kobj, char * name)
 	sysfs_hash_and_remove(kobj->dentry,name);
 }
 
+static int sysfs_get_target_path(struct kobject * kobj, struct kobject * target,
+				   char *path)
+{
+	char * s;
+	int depth, size;
+
+	depth = object_depth(kobj);
+	size = object_path_length(target) + depth * 3 - 1;
+	if (size > PATH_MAX)
+		return -ENAMETOOLONG;
+
+	pr_debug("%s: depth = %d, size = %d\n", __FUNCTION__, depth, size);
+
+	for (s = path; depth--; s += 3)
+		strcpy(s,"../");
+
+	fill_object_path(target, path, size);
+	pr_debug("%s: path = '%s'\n", __FUNCTION__, path);
+
+	return 0;
+}
+
+static int sysfs_getlink(struct dentry *dentry, char * path)
+{
+	struct kobject *kobj, *target_kobj;
+	int error = 0;
+
+	kobj = sysfs_get_kobject(dentry->d_parent);
+	if (!kobj)
+		return -EINVAL;
+
+	target_kobj = sysfs_get_kobject(dentry);
+	if (!target_kobj) {
+		kobject_put(kobj);
+		return -EINVAL;
+	}
+
+	down_read(&sysfs_rename_sem);
+	error = sysfs_get_target_path(kobj, target_kobj, path);
+	up_read(&sysfs_rename_sem);
+	
+	kobject_put(kobj);
+	kobject_put(target_kobj);
+	return error;
+
+}
+
+int sysfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
+{
+	int error = 0;
+	unsigned long page = get_zeroed_page(GFP_KERNEL);
+
+	if (!page)
+		return -ENOMEM;
+
+	error = sysfs_getlink(dentry, (char *) page);
+	if (!error)
+	        error = vfs_readlink(dentry, buffer, buflen, (char *) page);
+
+	free_page(page);
+
+	return error;
+}
+
+int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+	int error = 0;
+	unsigned long page = get_zeroed_page(GFP_KERNEL);
+
+	if (!page)
+		return -ENOMEM;
+
+	error = sysfs_getlink(dentry, (char *) page); 
+	if (!error)
+	        error = vfs_follow_link(nd, (char *) page);
+
+	free_page(page);
+
+	return error;
+}
 
 EXPORT_SYMBOL(sysfs_create_link);
 EXPORT_SYMBOL(sysfs_remove_link);
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 96e390a7b..ff5d1478a 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -11,3 +11,19 @@ extern void sysfs_hash_and_remove(struct dentry * dir, const char * name);
 
 extern int sysfs_create_subdir(struct kobject *, const char *, struct dentry **);
 extern void sysfs_remove_subdir(struct dentry *);
+
+extern int sysfs_readlink(struct dentry *, char __user *, int );
+extern int sysfs_follow_link(struct dentry *, struct nameidata *);
+extern struct rw_semaphore sysfs_rename_sem;
+
+static inline struct kobject *sysfs_get_kobject(struct dentry *dentry)
+{
+	struct kobject * kobj = NULL;
+
+	spin_lock(&dcache_lock);
+	if (!d_unhashed(dentry))
+		kobj = kobject_get(dentry->d_fsdata);
+	spin_unlock(&dcache_lock);
+
+	return kobj;
+}
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 76ef18bb6..33640a971 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -109,7 +109,7 @@ struct address_space_operations udf_adinicb_aops = {
 	.commit_write		= udf_adinicb_commit_write,
 };
 
-static ssize_t udf_file_write(struct file * file, const char * buf,
+static ssize_t udf_file_write(struct file * file, const char __user * buf,
 	size_t count, loff_t *ppos)
 {
 	ssize_t retval;
@@ -204,26 +204,26 @@ int udf_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 	switch (cmd)
 	{
 		case UDF_GETVOLIDENT:
-			return copy_to_user((char *)arg,
+			return copy_to_user((char __user *)arg,
 				UDF_SB_VOLIDENT(inode->i_sb), 32) ? -EFAULT : 0;
 		case UDF_RELOCATE_BLOCKS:
 		{
 			long old, new;
 
 			if (!capable(CAP_SYS_ADMIN)) return -EACCES;
-			if (get_user(old, (long *)arg)) return -EFAULT;
+			if (get_user(old, (long __user *)arg)) return -EFAULT;
 			if ((result = udf_relocate_blocks(inode->i_sb,
 					old, &new)) == 0)
-				result = put_user(new, (long *)arg);
+				result = put_user(new, (long __user *)arg);
 
 			return result;
 		}
 		case UDF_GETEASIZE:
-			result = put_user(UDF_I_LENEATTR(inode), (int *)arg);
+			result = put_user(UDF_I_LENEATTR(inode), (int __user *)arg);
 			break;
 
 		case UDF_GETEABLOCK:
-			result = copy_to_user((char *)arg, UDF_I_DATA(inode),
+			result = copy_to_user((char __user *)arg, UDF_I_DATA(inode),
 				UDF_I_LENEATTR(inode)) ? -EFAULT : 0;
 			break;
 	}
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 67882bf36..ee346b772 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -154,8 +154,8 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
 {
 	struct fileIdentDesc *fi=NULL;
 	loff_t f_pos;
-	int block, namelen;
-	char name[UDF_NAME_LEN], fname[UDF_NAME_LEN];
+	int block, flen;
+	char fname[UDF_NAME_LEN];
 	char *nameptr;
 	uint8_t lfi;
 	uint16_t liu;
@@ -167,9 +167,6 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
 	if (!dir)
 		return NULL;
 
-	if ( !(namelen = udf_put_filename(dir->i_sb, dentry->d_name.name, name, dentry->d_name.len)))
-		return NULL;
-
 	f_pos = (udf_ext0_offset(dir) >> 2);
 
 	fibh->soffset = fibh->eoffset = (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
@@ -253,10 +250,13 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
 		if (!lfi)
 			continue;
 
-		if (udf_match(namelen, name, lfi, nameptr))
+		if ((flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi)))
 		{
-			udf_release_data(bh);
-			return fi;
+			if (udf_match(flen, fname, dentry->d_name.len, dentry->d_name.name))
+			{
+				udf_release_data(bh);
+				return fi;
+			}
 		}
 	}
 	if (fibh->sbh != fibh->ebh)
@@ -353,6 +353,7 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
 	char name[UDF_NAME_LEN], fname[UDF_NAME_LEN];
 	int namelen;
 	loff_t f_pos;
+	int flen;
 	char *nameptr;
 	loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
 	int nfidlen;
@@ -480,7 +481,8 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
 		if (!lfi || !dentry)
 			continue;
 
-		if (udf_match(namelen, name, lfi, nameptr))
+		if ((flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi)) &&
+			udf_match(flen, fname, dentry->d_name.len, dentry->d_name.name))
 		{
 			if (fibh->sbh != fibh->ebh)
 				udf_release_data(fibh->ebh);
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 64b586ee8..3795a5c8e 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of version 2 of the GNU General Public License as
@@ -30,10 +30,10 @@
 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
 #
 
-EXTRA_CFLAGS +=	 -Ifs/xfs -Ifs/xfs/linux -funsigned-char
+EXTRA_CFLAGS +=	 -Ifs/xfs -Ifs/xfs/linux-2.6 -funsigned-char
 
 ifeq ($(CONFIG_XFS_DEBUG),y)
-	EXTRA_CFLAGS += -g -DSTATIC="" -DDEBUG -DXFSDEBUG
+	EXTRA_CFLAGS += -g -DSTATIC="" -DDEBUG
 	EXTRA_CFLAGS += -DPAGEBUF_LOCK_TRACKING
 endif
 ifeq ($(CONFIG_XFS_TRACE),y)
@@ -69,8 +69,8 @@ xfs-$(CONFIG_XFS_RT)		+= xfs_rtalloc.o
 xfs-$(CONFIG_XFS_POSIX_ACL)	+= xfs_acl.o
 xfs-$(CONFIG_XFS_POSIX_CAP)	+= xfs_cap.o
 xfs-$(CONFIG_XFS_POSIX_MAC)	+= xfs_mac.o
-xfs-$(CONFIG_PROC_FS)		+= linux/xfs_stats.o
-xfs-$(CONFIG_SYSCTL)		+= linux/xfs_sysctl.o
+xfs-$(CONFIG_PROC_FS)		+= linux-2.6/xfs_stats.o
+xfs-$(CONFIG_SYSCTL)		+= linux-2.6/xfs_sysctl.o
 
 
 xfs-y				+= xfs_alloc.o \
@@ -124,8 +124,8 @@ xfs-y				+= xfs_alloc.o \
 
 xfs-$(CONFIG_XFS_TRACE)		+= xfs_dir2_trace.o
 
-# Objects in linux/
-xfs-y				+= $(addprefix linux/, \
+# Objects in linux-2.6/
+xfs-y				+= $(addprefix linux-2.6/, \
 				   xfs_aops.o \
 				   xfs_buf.o \
 				   xfs_file.o \
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index e7d4eba4c..f43f7c370 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -419,16 +419,13 @@ linvfs_follow_link(
 	ASSERT(nd);
 
 	link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
-	if (!link) {
-		nd_set_link(nd, ERR_PTR(-ENOMEM));
-		return 0;
-	}
+	if (!link)
+		return -ENOMEM;
 
 	uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
 	if (!uio) {
 		kfree(link);
-		nd_set_link(nd, ERR_PTR(-ENOMEM));
-		return 0;
+		return -ENOMEM;
 	}
 
 	vp = LINVFS_GET_VP(dentry->d_inode);
@@ -444,22 +441,18 @@ linvfs_follow_link(
 
 	VOP_READLINK(vp, uio, 0, NULL, error);
 	if (error) {
+		kfree(uio);
 		kfree(link);
-		link = ERR_PTR(-error);
-	} else {
-		link[MAXNAMELEN - uio->uio_resid] = '\0';
+		return -error;
 	}
-	kfree(uio);
 
-	nd_set_link(nd, link);
-	return 0;
-}
+	link[MAXNAMELEN - uio->uio_resid] = '\0';
+	kfree(uio);
 
-static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd)
-{
-	char *s = nd_get_link(nd);
-	if (!IS_ERR(s))
-		kfree(s);
+	/* vfs_follow_link returns (-) errors */
+	error = vfs_follow_link(nd, link);
+	kfree(link);
+	return error;
 }
 
 #ifdef CONFIG_XFS_POSIX_ACL
@@ -699,7 +692,6 @@ struct inode_operations linvfs_dir_inode_operations = {
 struct inode_operations linvfs_symlink_inode_operations = {
 	.readlink		= linvfs_readlink,
 	.follow_link		= linvfs_follow_link,
-	.put_link		= linvfs_put_link,
 	.permission		= linvfs_permission,
 	.getattr		= linvfs_getattr,
 	.setattr		= linvfs_setattr,
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 9633b155d..0088d7de4 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -1734,7 +1734,6 @@ xfs_qm_get_rtblks(
 STATIC int
 xfs_qm_dqusage_adjust(
 	xfs_mount_t	*mp,		/* mount point for filesystem */
-	xfs_trans_t	*tp,		/* transaction pointer - NULL */
 	xfs_ino_t	ino,		/* inode number to get data for */
 	void		*buffer,	/* not used */
 	int		ubsize,		/* not used */
@@ -1766,7 +1765,7 @@ xfs_qm_dqusage_adjust(
 	 * the case in all other instances. It's OK that we do this because
 	 * quotacheck is done only at mount time.
 	 */
-	if ((error = xfs_iget(mp, tp, ino, XFS_ILOCK_EXCL, &ip, bno))) {
+	if ((error = xfs_iget(mp, NULL, ino, XFS_ILOCK_EXCL, &ip, bno))) {
 		*res = BULKSTAT_RV_NOTHING;
 		return (error);
 	}
@@ -1903,7 +1902,7 @@ xfs_qm_quotacheck(
 		 * Iterate thru all the inodes in the file system,
 		 * adjusting the corresponding dquot counters in core.
 		 */
-		if ((error = xfs_bulkstat(mp, NULL, &lastino, &count,
+		if ((error = xfs_bulkstat(mp, &lastino, &count,
 				     xfs_qm_dqusage_adjust, NULL,
 				     structsz, NULL,
 				     BULKSTAT_FG_IGET|BULKSTAT_FG_VFSLOCKED,
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index 82827a03b..5a0f1ad94 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -1298,7 +1298,6 @@ xfs_qm_internalqcheck_dqadjust(
 STATIC int
 xfs_qm_internalqcheck_adjust(
 	xfs_mount_t	*mp,		/* mount point for filesystem */
-	xfs_trans_t	*tp,		/* transaction pointer */
 	xfs_ino_t	ino,		/* inode number to get data for */
 	void		*buffer,	/* not used */
 	int		ubsize,		/* not used */
@@ -1327,7 +1326,7 @@ xfs_qm_internalqcheck_adjust(
 	ipreleased = B_FALSE;
  again:
 	lock_flags = XFS_ILOCK_SHARED;
-	if ((error = xfs_iget(mp, tp, ino, lock_flags, &ip, bno))) {
+	if ((error = xfs_iget(mp, NULL, ino, lock_flags, &ip, bno))) {
 		*res = BULKSTAT_RV_NOTHING;
 		return (error);
 	}
@@ -1405,7 +1404,7 @@ xfs_qm_internalqcheck(
 		 * Iterate thru all the inodes in the file system,
 		 * adjusting the corresponding dquot counters
 		 */
-		if ((error = xfs_bulkstat(mp, NULL, &lastino, &count,
+		if ((error = xfs_bulkstat(mp, &lastino, &count,
 				 xfs_qm_internalqcheck_adjust, NULL,
 				 0, NULL, BULKSTAT_FG_IGET, &done))) {
 			break;
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h
index 4ac1503d5..40b0f4c54 100644
--- a/fs/xfs/support/debug.h
+++ b/fs/xfs/support/debug.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -42,6 +42,7 @@
 #define CE_PANIC        0               /* panic        */
 
 extern void icmn_err(int, char *, va_list);
+/* PRINTFLIKE2 */
 extern void cmn_err(int, char *, ...);
 
 #ifndef STATIC
diff --git a/fs/xfs/xfs.h b/fs/xfs/xfs.h
index 0e9354961..809bee71d 100644
--- a/fs/xfs/xfs.h
+++ b/fs/xfs/xfs.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
 #ifndef __XFS_H__
 #define __XFS_H__
 
-#include <linux/xfs_linux.h>
+#include <linux-2.6/xfs_linux.h>
 
 #include <xfs_fs.h> 
 
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 30850e6d6..ad9f5de3a 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -340,7 +340,6 @@ xfs_acl_vset(
 		xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
 	}
 
-
 out:
 	VN_RELE(vp);
 	_ACL_FREE(xfs_acl);
@@ -354,13 +353,15 @@ xfs_acl_iaccess(
 	cred_t		*cr)
 {
 	xfs_acl_t	*acl;
-	int		error;
+	int		rval;
 
 	if (!(_ACL_ALLOC(acl)))
 		return -1;
 
 	/* If the file has no ACL return -1. */
-	if (xfs_attr_fetch(ip, SGI_ACL_FILE, (char *)acl, sizeof(xfs_acl_t))) {
+	rval = sizeof(xfs_acl_t);
+	if (xfs_attr_fetch(ip, SGI_ACL_FILE, SGI_ACL_FILE_SIZE,
+			(char *)acl, &rval, ATTR_ROOT | ATTR_KERNACCESS, cr)) {
 		_ACL_FREE(acl);
 		return -1;
 	}
@@ -375,9 +376,9 @@ xfs_acl_iaccess(
 	/* Synchronize ACL with mode bits */
 	xfs_acl_sync_mode(ip->i_d.di_mode, acl);
 
-	error = xfs_acl_access(ip->i_d.di_uid, ip->i_d.di_gid, acl, mode, cr);
+	rval = xfs_acl_access(ip->i_d.di_uid, ip->i_d.di_gid, acl, mode, cr);
 	_ACL_FREE(acl);
-	return error;
+	return rval;
 }
 
 STATIC int
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index 898de3642..8eb321eec 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -115,20 +115,12 @@ ktrace_t *xfs_attr_trace_buf;
  * Overall external interface routines.
  *========================================================================*/
 
-/*ARGSUSED*/
-STATIC int
-xfs_attr_get_int(xfs_inode_t *ip, char *name, char *value, int *valuelenp,
-	     int flags, int lock, struct cred *cred)
+int
+xfs_attr_fetch(xfs_inode_t *ip, char *name, int namelen,
+	       char *value, int *valuelenp, int flags, struct cred *cred)
 {
 	xfs_da_args_t   args;
 	int             error;
-	int             namelen;
-
-	ASSERT(MAXNAMELEN-1 <= 0xff);	/* length is stored in uint8 */
-	namelen = strlen(name);
-	if (namelen >= MAXNAMELEN)
-		return(EFAULT);		/* match IRIX behaviour */
-	XFS_STATS_INC(xs_attr_get);
 
 	if (XFS_FORCED_SHUTDOWN(ip->i_mount))
 		return(EIO);
@@ -138,12 +130,11 @@ xfs_attr_get_int(xfs_inode_t *ip, char *name, char *value, int *valuelenp,
 	     ip->i_d.di_anextents == 0))
 		return(ENOATTR);
 
-	if (lock) {
+	if (!(flags & ATTR_KERNACCESS)) {
 		xfs_ilock(ip, XFS_ILOCK_SHARED);
-		/*
-		 * Do we answer them, or ignore them?
-		 */
-		if ((error = xfs_iaccess(ip, S_IRUSR, cred))) {
+
+		if (!(flags & ATTR_SECURE) &&
+		    ((error = xfs_iaccess(ip, S_IRUSR, cred)))) {
 			xfs_iunlock(ip, XFS_ILOCK_SHARED);
 			return(XFS_ERROR(error));
 		}
@@ -161,7 +152,6 @@ xfs_attr_get_int(xfs_inode_t *ip, char *name, char *value, int *valuelenp,
 	args.hashval = xfs_da_hashname(args.name, args.namelen);
 	args.dp = ip;
 	args.whichfork = XFS_ATTR_FORK;
-	args.trans = NULL;
 
 	/*
 	 * Decide on what work routines to call based on the inode size.
@@ -178,7 +168,7 @@ xfs_attr_get_int(xfs_inode_t *ip, char *name, char *value, int *valuelenp,
 		error = xfs_attr_node_get(&args);
 	}
 
-	if (lock)
+	if (!(flags & ATTR_KERNACCESS))
 		xfs_iunlock(ip, XFS_ILOCK_SHARED);
 
 	/*
@@ -191,21 +181,22 @@ xfs_attr_get_int(xfs_inode_t *ip, char *name, char *value, int *valuelenp,
 	return(error);
 }
 
-int
-xfs_attr_fetch(xfs_inode_t *ip, char *name, char *value, int valuelen)
-{
-	return xfs_attr_get_int(ip, name, value, &valuelen, ATTR_ROOT, 0, NULL);
-}
-
 int
 xfs_attr_get(bhv_desc_t *bdp, char *name, char *value, int *valuelenp,
 	     int flags, struct cred *cred)
 {
 	xfs_inode_t	*ip = XFS_BHVTOI(bdp);
+	int		namelen;
+
+	XFS_STATS_INC(xs_attr_get);
 
 	if (!name)
 		return(EINVAL);
-	return xfs_attr_get_int(ip, name, value, valuelenp, flags, 1, cred);
+	namelen = strlen(name);
+	if (namelen >= MAXNAMELEN)
+		return(EFAULT);		/* match IRIX behaviour */
+
+	return xfs_attr_fetch(ip, name, namelen, value, valuelenp, flags, cred);
 }
 
 /*ARGSUSED*/
@@ -224,22 +215,20 @@ xfs_attr_set(bhv_desc_t *bdp, char *name, char *value, int valuelen, int flags,
 	int             rsvd = (flags & ATTR_ROOT) != 0;
 	int             namelen;
 
-	ASSERT(MAXNAMELEN-1 <= 0xff); /* length is stored in uint8 */
 	namelen = strlen(name);
 	if (namelen >= MAXNAMELEN)
-		return EFAULT; /* match irix behaviour */
+		return EFAULT;		/* match IRIX behaviour */
 
 	XFS_STATS_INC(xs_attr_set);
-	/*
-	 * Do we answer them, or ignore them?
-	 */
+
 	dp = XFS_BHVTOI(bdp);
 	mp = dp->i_mount;
 	if (XFS_FORCED_SHUTDOWN(mp))
 		return (EIO);
 
 	xfs_ilock(dp, XFS_ILOCK_SHARED);
-	if ((error = xfs_iaccess(dp, S_IWUSR, cred))) {
+	if (!(flags & ATTR_SECURE) &&
+	     (error = xfs_iaccess(dp, S_IWUSR, cred))) {
 		xfs_iunlock(dp, XFS_ILOCK_SHARED);
 		return(XFS_ERROR(error));
 	}
@@ -489,16 +478,14 @@ xfs_attr_remove(bhv_desc_t *bdp, char *name, int flags, struct cred *cred)
 
 	XFS_STATS_INC(xs_attr_remove);
 
-	/*
-	 * Do we answer them, or ignore them?
-	 */
 	dp = XFS_BHVTOI(bdp);
 	mp = dp->i_mount;
 	if (XFS_FORCED_SHUTDOWN(mp))
 		return (EIO);
 
 	xfs_ilock(dp, XFS_ILOCK_SHARED);
-	if ((error = xfs_iaccess(dp, S_IWUSR, cred))) {
+	if (!(flags & ATTR_SECURE) &&
+	     (error = xfs_iaccess(dp, S_IWUSR, cred))) {
 		xfs_iunlock(dp, XFS_ILOCK_SHARED);
 		return(XFS_ERROR(error));
 	} else if (XFS_IFORK_Q(dp) == 0 ||
@@ -683,11 +670,10 @@ xfs_attr_list(bhv_desc_t *bdp, char *buffer, int bufsize, int flags,
 
 	if (XFS_FORCED_SHUTDOWN(dp->i_mount))
 		return (EIO);
-	/*
-	 * Do they have permission?
-	 */
+
 	xfs_ilock(dp, XFS_ILOCK_SHARED);
-	if ((error = xfs_iaccess(dp, S_IRUSR, cred))) {
+	if (!(flags & ATTR_SECURE) &&
+	     (error = xfs_iaccess(dp, S_IRUSR, cred))) {
 		xfs_iunlock(dp, XFS_ILOCK_SHARED);
 		return(XFS_ERROR(error));
 	}
diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h
index bd5861557..67cd0f5ac 100644
--- a/fs/xfs/xfs_attr.h
+++ b/fs/xfs/xfs_attr.h
@@ -92,6 +92,7 @@ extern int attr_generic_list(struct vnode *, void *, size_t, int, ssize_t *);
 #define ATTR_REPLACE	0x0020	/* pure set: fail if attr does not exist */
 #define ATTR_SYSTEM	0x0100	/* use attrs in system (pseudo) namespace */
 
+#define ATTR_KERNACCESS	0x0400	/* [kernel] iaccess, inode held io-locked */
 #define ATTR_KERNOTIME	0x1000	/* [kernel] don't update inode timestamps */
 #define ATTR_KERNOVAL	0x2000	/* [kernel] get attr size only, not value */
 #define ATTR_KERNAMELS	0x4000	/* [kernel] list attr names (simple list) */
@@ -186,6 +187,7 @@ int xfs_attr_inactive(struct xfs_inode *dp);
 int xfs_attr_node_get(struct xfs_da_args *);
 int xfs_attr_leaf_get(struct xfs_da_args *);
 int xfs_attr_shortform_getvalue(struct xfs_da_args *);
-int xfs_attr_fetch(struct xfs_inode *, char *, char *, int);
+int xfs_attr_fetch(struct xfs_inode *, char *, int,
+			char *, int *, int, struct cred *);
 
 #endif	/* __XFS_ATTR_H__ */
diff --git a/fs/xfs/xfs_bit.c b/fs/xfs/xfs_bit.c
index 38fece1f7..ec12a13d8 100644
--- a/fs/xfs/xfs_bit.c
+++ b/fs/xfs/xfs_bit.c
@@ -238,32 +238,33 @@ xfs_count_bits(uint *map, uint size, uint start_bit)
 int
 xfs_contig_bits(uint *map, uint	size, uint start_bit)
 {
-#if BITS_PER_LONG == 32
-	return find_next_zero_bit((unsigned long *)map,
-			size * sizeof(uint) * 8, start_bit) - start_bit;
-#else
-	/*
-	 * The first argument to find_next_zero_bit needs to be aligned,
-	 * but this is coming from the xfs_buf_log_format_t on-disk
-	 * struct, which can't be padded or otherwise modified w/o breaking
-	 * on-disk compatibility... so create a temporary, aligned
-	 * variable, copy over the bitmap, and send that to find_next_zero_bit
-	 * This only happens in recovery, so it's ugly but not too bad.
-	 */
-	void * addr;
-	int bit;
-	size_t bitmap_size = size * sizeof(uint);
-
-	addr = (void *)kmem_alloc(bitmap_size, KM_SLEEP);
-	memcpy(addr, map, size * sizeof(uint));
-
-	bit = find_next_zero_bit((unsigned long *)addr,
-			size * sizeof(uint) * 8, start_bit) - start_bit;
+	uint * p = ((unsigned int *) map) + (start_bit >> BIT_TO_WORD_SHIFT);
+	uint result = 0;
+	uint tmp;
 
-	kmem_free(addr, bitmap_size);
+	size <<= BIT_TO_WORD_SHIFT;
 
-	return bit;
-#endif
+	ASSERT(start_bit < size);
+	size -= start_bit & ~(NBWORD - 1);
+	start_bit &= (NBWORD - 1);
+	if (start_bit) {
+		tmp = *p++;
+		/* set to one first offset bits prior to start */
+		tmp |= (~0U >> (NBWORD-start_bit));
+		if (tmp != ~0U)
+			goto found;
+		result += NBWORD;
+		size -= NBWORD;
+	}
+	while (size) {
+		if ((tmp = *p++) != ~0U)
+			goto found;
+		result += NBWORD;
+		size -= NBWORD;
+	}
+	return result - start_bit;
+found:
+	return result + ffz(tmp) - start_bit;
 }
 
 /*
@@ -288,25 +289,20 @@ int xfs_next_bit(uint *map, uint size, uint start_bit)
 	start_bit &= (NBWORD - 1);
 	if (start_bit) {
 		tmp = *p++;
-		/* set to zero first offset bits */
+		/* set to zero first offset bits prior to start */
 		tmp &= (~0U << start_bit);
-		if (size < NBWORD)
-			goto found_first;
 		if (tmp != 0U)
-			goto found_middle;
-		size -= NBWORD;
+			goto found;
 		result += NBWORD;
+		size -= NBWORD;
 	}
-	while (size >= NBWORD) {
+	while (size) {
 		if ((tmp = *p++) != 0U)
-			goto found_middle;
+			goto found;
 		result += NBWORD;
 		size -= NBWORD;
 	}
-	if (!size)
-		return -1;
-	tmp = *p;
-found_first:
-found_middle:
+	return -1;
+found:
 	return result + ffs(tmp) - 1;
 }
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 0b2f4d3d7..d797f406e 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -69,7 +69,7 @@
 #include "xfs_buf_item.h"
 
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 STATIC void
 xfs_bmap_check_leaf_extents(xfs_btree_cur_t *cur, xfs_inode_t *ip, int whichfork);
 #endif
@@ -195,7 +195,7 @@ xfs_bmap_btree_to_extents(
 	int			*logflagsp, /* inode logging flags */
 	int			whichfork); /* data or attr fork */
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Check that the extents list for the inode ip is in the right order.
  */
@@ -695,7 +695,7 @@ xfs_bmap_add_extent(
 		*curp = cur;
 	}
 done:
-#ifdef XFSDEBUG
+#ifdef DEBUG
 	if (!error)
 		xfs_bmap_check_leaf_extents(*curp, ip, whichfork);
 #endif
@@ -4076,64 +4076,6 @@ xfs_bmap_cancel(
 	ASSERT(flist->xbf_count == 0);
 }
 
-/*
- * Returns EINVAL if the specified file is not swappable.
- */
-int						/* error */
-xfs_bmap_check_swappable(
-	xfs_inode_t	*ip)			/* incore inode */
-{
-	xfs_bmbt_rec_t	*base;			/* base of extent array */
-	xfs_bmbt_rec_t	*ep;			/* pointer to an extent entry */
-	xfs_fileoff_t	end_fsb;		/* last block of file within size */
-	xfs_bmbt_irec_t	ext;			/* extent list entry, decoded */
-	xfs_ifork_t	*ifp;			/* inode fork pointer */
-	xfs_fileoff_t	lastaddr;		/* last block number seen */
-	xfs_extnum_t	nextents;		/* number of extent entries */
-	int		retval = 0;		/* return value */
-
-	xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
-
-	/*
-	 * Check for a zero length file.
-	 */
-	if (ip->i_d.di_size == 0)
-		goto check_done;
-
-	ASSERT(XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) == XFS_DINODE_FMT_BTREE ||
-	       XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) == XFS_DINODE_FMT_EXTENTS);
-
-	ifp = &ip->i_df;
-	if (!(ifp->if_flags & XFS_IFEXTENTS) &&
-	    (retval = xfs_iread_extents(NULL, ip, XFS_DATA_FORK)))
-		goto check_done;
-	/*
-	 * Scan extents until the file size is reached. Look for
-	 * holes or unwritten extents, since I/O to these would cause
-	 * a transaction.
-	 */
-	end_fsb = XFS_B_TO_FSB(ip->i_mount, ip->i_d.di_size);
-	nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
-	base = &ifp->if_u1.if_extents[0];
-	for (lastaddr = 0, ep = base; ep < &base[nextents]; ep++) {
-		xfs_bmbt_get_all(ep, &ext);
-		if (lastaddr < ext.br_startoff ||
-		    ext.br_state != XFS_EXT_NORM) {
-			goto error_done;
-		}
-		if (end_fsb <= (lastaddr = ext.br_startoff +
-						ext.br_blockcount))
-			goto check_done;
-	}
-error_done:
-	retval = XFS_ERROR(EINVAL);
-
-
-check_done:
-	xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL);
-	return retval;
-}
-
 /*
  * Returns the file-relative block number of the first unused block(s)
  * in the file with at least "len" logically contiguous blocks free.
@@ -5790,7 +5732,7 @@ xfs_bmap_eof(
 	return 0;
 }
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Check that the extents list for the inode ip is in the right order.
  */
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h
index 429e053f6..479e0d559 100644
--- a/fs/xfs/xfs_bmap.h
+++ b/fs/xfs/xfs_bmap.h
@@ -177,13 +177,6 @@ void
 xfs_bmap_cancel(
 	xfs_bmap_free_t		*flist);	/* free list to clean up */
 
-/*
- * Routine to check if a specified inode is swap capable.
- */
-int
-xfs_bmap_check_swappable(
-	struct xfs_inode	*ip);		/* incore inode */
-
 /*
  * Compute and fill in the value of the maximum depth of a bmap btree
  * in this filesystem.  Done once, during mount.
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 788e80064..ed83f855d 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -700,7 +700,7 @@ error0:
 	return error;
 }
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Get the data from the pointed-to record.
  */
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index 6bc85d791..e2150f703 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -673,7 +673,7 @@ xfs_bmbt_update(
 	xfs_filblks_t,
 	xfs_exntst_t);
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Get the data from the pointed-to record.
  */
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 349b48a45..d550aa030 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -1053,9 +1053,9 @@ xfs_buf_iodone_callbacks(
 		    (time_after(jiffies, (lasttime + 5*HZ)))) {
 			lasttime = jiffies;
 			prdev("XFS write error in file system meta-data "
-			      "block 0x%Lx in %s",
+			      "block 0x%llx in %s",
 			      XFS_BUF_TARGET(bp),
-			      XFS_BUF_ADDR(bp), mp->m_fsname);
+			      (__uint64_t)XFS_BUF_ADDR(bp), mp->m_fsname);
 		}
 		lasttarg = XFS_BUF_TARGET(bp);
 
diff --git a/fs/xfs/xfs_clnt.h b/fs/xfs/xfs_clnt.h
index 093236905..4a49cde9b 100644
--- a/fs/xfs/xfs_clnt.h
+++ b/fs/xfs/xfs_clnt.h
@@ -100,5 +100,7 @@ struct xfs_mount_args {
 #define XFSMNT_DMAPI		0x02000000	/* enable dmapi/xdsm */
 #define XFSMNT_NOLOGFLUSH	0x04000000	/* Don't flush for log blocks */
 #define XFSMNT_IDELETE		0x08000000	/* inode cluster delete */
+#define XFSMNT_SWALLOC		0x10000000	/* turn on stripe width
+						 * allocation */
 
 #endif	/* __XFS_CLNT_H__ */
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 396556102..f0431b7e6 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -2166,9 +2166,9 @@ xfs_da_do_buf(
 					cmn_err(CE_ALERT,
 						"[%02d] br_startoff %lld br_startblock %lld br_blockcount %lld br_state %d\n",
 						i,
-						mapp[i].br_startoff,
-						mapp[i].br_startblock,
-						mapp[i].br_blockcount,
+						(long long)mapp[i].br_startoff,
+						(long long)mapp[i].br_startblock,
+						(long long)mapp[i].br_blockcount,
 						mapp[i].br_state);
 				}
 			}
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 37b28e59e..36bb461b6 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -576,7 +576,8 @@ xfs_fs_log_dummy(xfs_mount_t *mp)
 	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 	xfs_trans_ihold(tp, ip);
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-	xfs_trans_commit(tp, XFS_TRANS_SYNC, NULL);
+	xfs_trans_set_sync(tp);
+	xfs_trans_commit(tp, 0, NULL);
 
 	xfs_iunlock(ip, XFS_ILOCK_EXCL);
 }
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index ec2ab5263..ab973fe10 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -854,6 +854,34 @@ xfs_xlate_dinode_core(
 	INT_XLATE(buf_core->di_gen, mem_core->di_gen, dir, arch);
 }
 
+uint
+xfs_dic2xflags(
+	xfs_dinode_core_t	*dic,
+	xfs_arch_t		arch)
+{
+	__uint16_t		di_flags;
+	uint			flags = 0;
+
+	di_flags = INT_GET(dic->di_flags, arch);
+	if (di_flags & XFS_DIFLAG_REALTIME)
+		flags |= XFS_XFLAG_REALTIME;
+	if (di_flags & XFS_DIFLAG_PREALLOC)
+		flags |= XFS_XFLAG_PREALLOC;
+	if (di_flags & XFS_DIFLAG_IMMUTABLE)
+		flags |= XFS_XFLAG_IMMUTABLE;
+	if (di_flags & XFS_DIFLAG_APPEND)
+		flags |= XFS_XFLAG_APPEND;
+	if (di_flags & XFS_DIFLAG_SYNC)
+		flags |= XFS_XFLAG_SYNC;
+	if (di_flags & XFS_DIFLAG_NOATIME)
+		flags |= XFS_XFLAG_NOATIME;
+	if (di_flags & XFS_DIFLAG_NODUMP)
+		flags |= XFS_XFLAG_NODUMP;
+	if (XFS_CFORK_Q_ARCH(dic, arch))
+		flags |= XFS_XFLAG_HASATTR;
+	return flags;
+}
+
 /*
  * Given a mount structure and an inode number, return a pointer
  * to a newly allocated in-core inode coresponding to the given
@@ -3724,32 +3752,6 @@ xfs_iaccess(
 	return XFS_ERROR(EACCES);
 }
 
-/*
- * Return whether or not it is OK to swap to the given file in the
- * given range.  Return 0 for OK and otherwise return the error.
- *
- * It is only OK to swap to a file if it has no holes, and all
- * extents have been initialized.
- *
- * We use the vnode behavior chain prevent and allow primitives
- * to ensure that the vnode chain stays coherent while we do this.
- * This allows us to walk the chain down to the bottom where XFS
- * lives without worrying about it changing out from under us.
- */
-int
-xfs_swappable(
-	bhv_desc_t	*bdp)
-{
-	xfs_inode_t	*ip;
-
-	ip = XFS_BHVTOI(bdp);
-	/*
-	 * Verify that the file does not have any
-	 * holes or unwritten exents.
-	 */
-	return xfs_bmap_check_swappable(ip);
-}
-
 /*
  * xfs_iroundup: round up argument to next power of two
  */
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index aa07ce3dc..13abdd55e 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -503,8 +503,9 @@ int		xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int);
 int		xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, nlink_t,
 			   xfs_dev_t, struct cred *, xfs_prid_t, int,
 			   struct xfs_buf **, boolean_t *, xfs_inode_t **);
-void		xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *, int,
-			   xfs_arch_t);
+void		xfs_xlate_dinode_core(xfs_caddr_t, struct xfs_dinode_core *,
+					int, xfs_arch_t);
+uint		xfs_dic2xflags(struct xfs_dinode_core *, xfs_arch_t);
 int		xfs_ifree(struct xfs_trans *, xfs_inode_t *,
 			   struct xfs_bmap_free *);
 int		xfs_atruncate_start(xfs_inode_t *);
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index c6083d81a..7e1c1290a 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -577,25 +577,70 @@ retry:
 	 */
 	if (!(ioflag & BMAPI_SYNC) && ((offset + count) > ip->i_d.di_size)) {
 		xfs_off_t	aligned_offset;
+		xfs_filblks_t   count_fsb;
 		unsigned int	iosize;
 		xfs_fileoff_t	ioalign;
+		int		n;
+		xfs_fileoff_t   start_fsb;
 
+		/*
+		 * If there are any real blocks past eof, then don't
+		 * do any speculative allocation.
+		 */
+		start_fsb = XFS_B_TO_FSBT(mp,
+					((xfs_ufsize_t)(offset + count - 1)));
+		count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp));
+		while (count_fsb > 0) {
+			nimaps = XFS_WRITE_IMAPS;
+			error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb,
+					0, &firstblock, 0, imap, &nimaps, NULL);
+			if (error) {
+				return error;
+			}
+			for (n = 0; n < nimaps; n++) {
+				if ((imap[n].br_startblock != HOLESTARTBLOCK) &&
+				    (imap[n].br_startblock != DELAYSTARTBLOCK)) {
+					goto write_map;
+				}
+				start_fsb += imap[n].br_blockcount;
+				count_fsb -= imap[n].br_blockcount;
+			}
+		}
 		iosize = mp->m_writeio_blocks;
 		aligned_offset = XFS_WRITEIO_ALIGN(mp, (offset + count - 1));
 		ioalign = XFS_B_TO_FSBT(mp, aligned_offset);
 		last_fsb = ioalign + iosize;
 		aeof = 1;
 	}
-
+write_map:
 	nimaps = XFS_WRITE_IMAPS;
 	firstblock = NULLFSBLOCK;
 
+	/*
+	 * If mounted with the "-o swalloc" option, roundup the allocation
+	 * request to a stripe width boundary if the file size is >=
+	 * stripe width and we are allocating past the allocation eof.
+	 */
+	if (mp->m_swidth && (mp->m_flags & XFS_MOUNT_SWALLOC)
+	    && (isize >= XFS_FSB_TO_B(mp, mp->m_swidth)) && aeof) {
+		int eof;
+		xfs_fileoff_t new_last_fsb;
+
+		new_last_fsb = roundup_64(last_fsb, mp->m_swidth);
+		error = xfs_bmap_eof(ip, new_last_fsb, XFS_DATA_FORK, &eof);
+		if (error) {
+			return error;
+		}
+		if (eof) {
+			last_fsb = new_last_fsb;
+		}
 	/*
 	 * Roundup the allocation request to a stripe unit (m_dalign) boundary
 	 * if the file size is >= stripe unit size, and we are allocating past
 	 * the allocation eof.
 	 */
-	if (mp->m_dalign && (isize >= XFS_FSB_TO_B(mp, mp->m_dalign)) && aeof) {
+	} else if (mp->m_dalign && (isize >= XFS_FSB_TO_B(mp, mp->m_dalign))
+		   && aeof) {
 		int eof;
 		xfs_fileoff_t new_last_fsb;
 		new_last_fsb = roundup_64(last_fsb, mp->m_dalign);
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 419fcf82a..01fae1abb 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -55,14 +55,18 @@
 #include "xfs_itable.h"
 #include "xfs_error.h"
 
+#ifndef HAVE_USERACC
+#define useracc(ubuffer, size, flags, foo) (0)
+#define unuseracc(ubuffer, size, flags)
+#endif
+
 /*
  * Return stat information for one inode.
  * Return 0 if ok, else errno.
  */
-int					/* error status */
+int		       		/* error status */
 xfs_bulkstat_one(
 	xfs_mount_t	*mp,		/* mount point for filesystem */
-	xfs_trans_t	*tp,		/* transaction pointer */
 	xfs_ino_t	ino,		/* inode number to get data for */
 	void		*buffer,	/* buffer to place output in */
 	int		ubsize,		/* size of buffer */
@@ -78,12 +82,10 @@ xfs_bulkstat_one(
 	xfs_dinode_core_t *dic;		/* dinode core info pointer */
 	xfs_inode_t	*ip = NULL;	/* incore inode pointer */
 	xfs_arch_t      arch;           /* these are set according to      */
-	__uint16_t      di_flags;       /* temp */
 
-	buf = (xfs_bstat_t *)buffer;
 	dip = (xfs_dinode_t *)dibuff;
 
-	if (! buf || ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino ||
+	if (!buffer || ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino ||
 	    (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) &&
 	     (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino))) {
 		*stat = BULKSTAT_RV_NOTHING;
@@ -94,11 +96,13 @@ xfs_bulkstat_one(
 		return XFS_ERROR(ENOMEM);
 	}
 
+	buf = kmem_alloc(sizeof(*buf), KM_SLEEP);
+
 	if (dip == NULL) {
 		/* We're not being passed a pointer to a dinode.  This happens
 		 * if BULKSTAT_FG_IGET is selected.  Do the iget.
 		 */
-		error = xfs_iget(mp, tp, ino, XFS_ILOCK_SHARED, &ip, bno);
+		error = xfs_iget(mp, NULL, ino, XFS_ILOCK_SHARED, &ip, bno);
 		if (error) {
 			*stat = BULKSTAT_RV_NOTHING;
 			return error;
@@ -108,6 +112,7 @@ xfs_bulkstat_one(
 		if (ip->i_d.di_mode == 0) {
 			xfs_iput_new(ip, XFS_ILOCK_SHARED);
 			*stat = BULKSTAT_RV_NOTHING;
+			kmem_free(buf, sizeof(*buf));
 			return XFS_ERROR(ENOENT);
 		}
 		dic = &ip->i_d;
@@ -160,29 +165,7 @@ xfs_bulkstat_one(
 	buf->bs_mtime.tv_nsec = INT_GET(dic->di_mtime.t_nsec, arch);
 	buf->bs_ctime.tv_sec = INT_GET(dic->di_ctime.t_sec, arch);
 	buf->bs_ctime.tv_nsec = INT_GET(dic->di_ctime.t_nsec, arch);
-	/*
-	 * convert di_flags to bs_xflags.
-	 */
-	di_flags = INT_GET(dic->di_flags, arch);
-
-	buf->bs_xflags =
-		((di_flags & XFS_DIFLAG_REALTIME) ?
-			XFS_XFLAG_REALTIME : 0) |
-		((di_flags & XFS_DIFLAG_PREALLOC) ?
-			XFS_XFLAG_PREALLOC : 0) |
-	        ((di_flags & XFS_DIFLAG_IMMUTABLE) ?
-		        XFS_XFLAG_IMMUTABLE : 0) |
-		((di_flags & XFS_DIFLAG_APPEND) ?
-		        XFS_XFLAG_APPEND : 0) |
-		((di_flags & XFS_DIFLAG_SYNC) ?
-		        XFS_XFLAG_SYNC : 0) |
-		((di_flags & XFS_DIFLAG_NOATIME) ?
-		        XFS_XFLAG_NOATIME : 0) |
-		((di_flags & XFS_DIFLAG_NODUMP) ?
-		        XFS_XFLAG_NODUMP : 0) |
-		(XFS_CFORK_Q_ARCH(dic, arch) ?
-			XFS_XFLAG_HASATTR : 0);
-
+	buf->bs_xflags = xfs_dic2xflags(dic, arch);
 	buf->bs_extsize = INT_GET(dic->di_extsize, arch) << mp->m_sb.sb_blocklog;
 	buf->bs_extents = INT_GET(dic->di_nextents, arch);
 	buf->bs_gen = INT_GET(dic->di_gen, arch);
@@ -224,6 +207,13 @@ xfs_bulkstat_one(
 		xfs_iput(ip, XFS_ILOCK_SHARED);
 	}
 
+	if (copy_to_user(buffer, buf, sizeof(*buf)))  {
+		kmem_free(buf, sizeof(*buf));
+		*stat = BULKSTAT_RV_NOTHING;
+		return EFAULT;
+	}
+
+	kmem_free(buf, sizeof(*buf));
 	*stat = BULKSTAT_RV_DIDONE;
 	if (ubused)
 		*ubused = sizeof(*buf);
@@ -236,7 +226,6 @@ xfs_bulkstat_one(
 int					/* error status */
 xfs_bulkstat(
 	xfs_mount_t		*mp,	/* mount point for filesystem */
-	xfs_trans_t		*tp,	/* transaction pointer */
 	xfs_ino_t		*lastinop, /* last inode returned */
 	int			*ubcountp, /* size of buffer/count returned */
 	bulkstat_one_pf		formatter, /* func that'd fill a single buf */
@@ -311,13 +300,11 @@ xfs_bulkstat(
 	 * Lock down the user's buffer. If a buffer was not sent, as in the case
 	 * disk quota code calls here, we skip this.
 	 */
-#if defined(HAVE_USERACC)
 	if (ubuffer &&
 	    (error = useracc(ubuffer, ubcount * statstruct_size,
 			(B_READ|B_PHYS), NULL))) {
 		return error;
 	}
-#endif
 	/*
 	 * Allocate a page-sized buffer for inode btree records.
 	 * We could try allocating something smaller, but for normal
@@ -333,7 +320,7 @@ xfs_bulkstat(
 	while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) {
 		bp = NULL;
 		down_read(&mp->m_peraglock);
-		error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
+		error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
 		up_read(&mp->m_peraglock);
 		if (error) {
 			/*
@@ -347,7 +334,7 @@ xfs_bulkstat(
 		/*
 		 * Allocate and initialize a btree cursor for ialloc btree.
 		 */
-		cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO,
+		cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO,
 			(xfs_inode_t *)0, 0);
 		irbp = irbuf;
 		irbufend = irbuf + nirbuf;
@@ -461,7 +448,7 @@ xfs_bulkstat(
 		 * when calling iget.
 		 */
 		xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
-		xfs_trans_brelse(tp, agbp);
+		xfs_buf_relse(agbp);
 		/*
 		 * Now format all the good inodes into the user's buffer.
 		 */
@@ -534,8 +521,8 @@ xfs_bulkstat(
 						ip->i_ino = ino;
 						ip->i_mount = mp;
 						if (bp)
-							xfs_trans_brelse(tp, bp);
-						error = xfs_itobp(mp, tp, ip,
+							xfs_buf_relse(bp);
+						error = xfs_itobp(mp, NULL, ip,
 								  &dip, &bp, bno);
 						if (!error)
 							clustidx = ip->i_boffset / mp->m_sb.sb_inodesize;
@@ -580,7 +567,7 @@ xfs_bulkstat(
 				 * in xfs_qm_quotacheck.
 				 */
 				ubused = statstruct_size;
-				error = formatter(mp, tp, ino, ubufp,
+				error = formatter(mp, ino, ubufp,
 						ubleft, private_data,
 						bno, &ubused, dip, &fmterror);
 				if (fmterror == BULKSTAT_RV_NOTHING) {
@@ -603,7 +590,7 @@ xfs_bulkstat(
 		}
 
 		if (bp)
-			xfs_trans_brelse(tp, bp);
+			xfs_buf_relse(bp);
 
 		/*
 		 * Set up for the next loop iteration.
@@ -621,10 +608,8 @@ xfs_bulkstat(
 	 * Done, we're either out of filesystem or space to put the data.
 	 */
 	kmem_free(irbuf, NBPC);
-#if defined(HAVE_USERACC)
 	if (ubuffer)
 		unuseracc(ubuffer, ubcount * statstruct_size, (B_READ|B_PHYS));
-#endif
 	*ubcountp = ubelem;
 	if (agno >= mp->m_sb.sb_agcount) {
 		/*
@@ -651,7 +636,6 @@ xfs_bulkstat_single(
 	xfs_caddr_t		buffer,	/* buffer with inode stats */
 	int			*done)	/* 1 if there're more stats to get */
 {
-	xfs_bstat_t		bstat;	/* one bulkstat result structure */
 	int			count;	/* count value for bulkstat call */
 	int			error;	/* return value */
 	xfs_ino_t		ino;	/* filesystem inode number */
@@ -667,7 +651,7 @@ xfs_bulkstat_single(
 	 */
 
 	ino = (xfs_ino_t)*lastinop;
-	error = xfs_bulkstat_one(mp, NULL, ino, &bstat, sizeof(bstat),
+	error = xfs_bulkstat_one(mp, ino, buffer, sizeof(xfs_bstat_t),
 				 NULL, 0, NULL, NULL, &res);
 	if (error) {
 		/*
@@ -676,9 +660,9 @@ xfs_bulkstat_single(
 		 */
 		(*lastinop)--;
 		count = 1;
-		if (xfs_bulkstat(mp, NULL, lastinop, &count, xfs_bulkstat_one,
-				NULL,
-				sizeof(bstat), buffer, BULKSTAT_FG_IGET, done))
+		if (xfs_bulkstat(mp, lastinop, &count, xfs_bulkstat_one,
+				NULL, sizeof(xfs_bstat_t), buffer,
+				BULKSTAT_FG_IGET, done))
 			return error;
 		if (count == 0 || (xfs_ino_t)*lastinop != ino)
 			return error == EFSCORRUPTED ?
@@ -687,8 +671,6 @@ xfs_bulkstat_single(
 			return 0;
 	}
 	*done = 0;
-	if (copy_to_user(buffer, &bstat, sizeof(bstat)))
-		return XFS_ERROR(EFAULT);
 	return 0;
 }
 
@@ -698,7 +680,6 @@ xfs_bulkstat_single(
 int					/* error status */
 xfs_inumbers(
 	xfs_mount_t	*mp,		/* mount point for filesystem */
-	xfs_trans_t	*tp,		/* transaction pointer */
 	xfs_ino_t	*lastino,	/* last inode returned */
 	int		*count,		/* size of buffer/count returned */
 	xfs_caddr_t	ubuffer)	/* buffer with inode descriptions */
@@ -732,7 +713,7 @@ xfs_inumbers(
 	while (left > 0 && agno < mp->m_sb.sb_agcount) {
 		if (agbp == NULL) {
 			down_read(&mp->m_peraglock);
-			error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
+			error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
 			up_read(&mp->m_peraglock);
 			if (error) {
 				/*
@@ -745,13 +726,13 @@ xfs_inumbers(
 				agino = 0;
 				continue;
 			}
-			cur = xfs_btree_init_cursor(mp, tp, agbp, agno,
+			cur = xfs_btree_init_cursor(mp, NULL, agbp, agno,
 				XFS_BTNUM_INO, (xfs_inode_t *)0, 0);
 			error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp);
 			if (error) {
 				xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
 				cur = NULL;
-				xfs_trans_brelse(tp, agbp);
+				xfs_buf_relse(agbp);
 				agbp = NULL;
 				/*
 				 * Move up the the last inode in the current
@@ -765,7 +746,7 @@ xfs_inumbers(
 		if ((error = xfs_inobt_get_rec(cur, &gino, &gcnt, &gfree,
 			&i, ARCH_NOCONVERT)) ||
 		    i == 0) {
-			xfs_trans_brelse(tp, agbp);
+			xfs_buf_relse(agbp);
 			agbp = NULL;
 			xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
 			cur = NULL;
@@ -794,7 +775,7 @@ xfs_inumbers(
 			if (error) {
 				xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
 				cur = NULL;
-				xfs_trans_brelse(tp, agbp);
+				xfs_buf_relse(agbp);
 				agbp = NULL;
 				/*
 				 * The agino value has already been bumped.
@@ -820,6 +801,6 @@ xfs_inumbers(
 		xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
 					   XFS_BTREE_NOERROR));
 	if (agbp)
-		xfs_trans_brelse(tp, agbp);
+		xfs_buf_relse(agbp);
 	return error;
 }
diff --git a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h
index 5c2a08b00..476e531a9 100644
--- a/fs/xfs/xfs_itable.h
+++ b/fs/xfs/xfs_itable.h
@@ -39,7 +39,6 @@
  * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
  */
 typedef int (*bulkstat_one_pf)(struct xfs_mount	*mp,
-			       struct xfs_trans	*tp,
 			       xfs_ino_t	ino,
 			       void		*buffer,
 			       int		ubsize,
@@ -69,7 +68,6 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount	*mp,
 int					/* error status */
 xfs_bulkstat(
 	xfs_mount_t	*mp,		/* mount point for filesystem */
-	xfs_trans_t	*tp,		/* transaction pointer */
 	xfs_ino_t	*lastino,	/* last inode returned */
 	int		*count,		/* size of buffer/count returned */
 	bulkstat_one_pf formatter,	/* func that'd fill a single buf */
@@ -89,7 +87,6 @@ xfs_bulkstat_single(
 int
 xfs_bulkstat_one(
 	xfs_mount_t		*mp,
-	xfs_trans_t		*tp,
 	xfs_ino_t		ino,
 	void			*buffer,
 	int			ubsize,
@@ -102,7 +99,6 @@ xfs_bulkstat_one(
 int					/* error status */
 xfs_inumbers(
 	xfs_mount_t		*mp,	/* mount point for filesystem */
-	xfs_trans_t		*tp,	/* transaction pointer */
 	xfs_ino_t		*last,	/* last inode returned */
 	int			*count,	/* size of buffer/count returned */
 	xfs_caddr_t		buffer);/* buffer with inode descriptions */
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 8505f1d35..212d4e837 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -122,9 +122,7 @@ STATIC void		xlog_ticket_put(xlog_t *log, xlog_ticket_t *ticket);
 /* local debug functions */
 #if defined(DEBUG) && !defined(XLOG_NOLOG)
 STATIC void	xlog_verify_dest_ptr(xlog_t *log, __psint_t ptr);
-#ifdef XFSDEBUG
 STATIC void	xlog_verify_disk_cycle_no(xlog_t *log, xlog_in_core_t *iclog);
-#endif
 STATIC void	xlog_verify_grant_head(xlog_t *log, int equals);
 STATIC void	xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog,
 				  int count, boolean_t syncing);
@@ -339,13 +337,11 @@ xfs_log_force(xfs_mount_t *mp,
 
 }	/* xfs_log_force */
 
-
 /*
- * This function will take a log sequence number and check to see if that
- * lsn has been flushed to disk.  If it has, then the callback function is
- * called with the callback argument.  If the relevant in-core log has not
- * been synced to disk, we add the callback to the callback list of the
- * in-core log.
+ * Attaches a new iclog I/O completion callback routine during
+ * transaction commit.  If the log is in error state, a non-zero
+ * return code is handed back and the caller is responsible for
+ * executing the callback at an appropriate time.
  */
 int
 xfs_log_notify(xfs_mount_t	  *mp,		/* mount of partition */
@@ -371,10 +367,7 @@ xfs_log_notify(xfs_mount_t	  *mp,		/* mount of partition */
 		iclog->ic_callback_tail = &(cb->cb_next);
 	}
 	LOG_UNLOCK(log, spl);
-	if (abortflg) {
-		cb->cb_func(cb->cb_arg, abortflg);
-	}
-	return 0;
+	return abortflg;
 }	/* xfs_log_notify */
 
 int
@@ -497,7 +490,7 @@ xfs_log_mount(xfs_mount_t	*mp,
 		if (readonly)
 			vfsp->vfs_flag |= VFS_RDONLY;
 		if (error) {
-			cmn_err(CE_WARN, "XFS: log mount/recovery failed");
+			cmn_err(CE_WARN, "XFS: log mount/recovery failed: error %d", error);
 			xlog_unalloc_log(mp->m_log);
 			return error;
 		}
@@ -1664,7 +1657,6 @@ xlog_write(xfs_mount_t *	mp,
     int		     copy_len;	     /* # bytes actually memcpy'ing */
     int		     copy_off;	     /* # bytes from entry start */
     int		     contwr;	     /* continued write of in-core log? */
-    int		     firstwr = 0;    /* first write of transaction */
     int		     error;
     int		     record_cnt = 0, data_cnt = 0;
 
@@ -1729,7 +1721,6 @@ xlog_write(xfs_mount_t *	mp,
 		logop_head->oh_flags    = XLOG_START_TRANS;
 		INT_ZERO(logop_head->oh_res2, ARCH_CONVERT);
 		ticket->t_flags		&= ~XLOG_TIC_INITED;	/* clear bit */
-		firstwr = 1;			  /* increment log ops below */
 		record_cnt++;
 
 		start_rec_copy = sizeof(xlog_op_header_t);
@@ -1800,7 +1791,6 @@ xlog_write(xfs_mount_t *	mp,
 	    copy_len += start_rec_copy + sizeof(xlog_op_header_t);
 	    record_cnt++;
 	    data_cnt += contwr ? copy_len : 0;
-	    firstwr = 0;
 	    if (partial_copy) {			/* copied partial region */
 		    /* already marked WANT_SYNC by xlog_state_get_iclog_space */
 		    xlog_state_finish_copy(log, iclog, record_cnt, data_cnt);
@@ -3253,7 +3243,7 @@ xlog_verify_dest_ptr(xlog_t     *log,
 }	/* xlog_verify_dest_ptr */
 
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /* check split LR write */
 STATIC void
 xlog_verify_disk_cycle_no(xlog_t	 *log,
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 88eba53d8..2e5ab6af8 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1867,6 +1867,7 @@ xlog_recover_do_inode_buffer(
 
 			nbits = xfs_contig_bits(data_map, map_size,
 							 bit);
+			ASSERT(nbits > 0);
 			reg_buf_offset = bit << XFS_BLI_SHIFT;
 			reg_buf_bytes = nbits << XFS_BLI_SHIFT;
 			item_index++;
@@ -1951,6 +1952,7 @@ xlog_recover_do_reg_buffer(
 		if (bit == -1)
 			break;
 		nbits = xfs_contig_bits(data_map, map_size, bit);
+		ASSERT(nbits > 0);
 		ASSERT(item->ri_buf[i].i_addr != 0);
 		ASSERT(item->ri_buf[i].i_len % XFS_BLI_CHUNK == 0);
 		ASSERT(XFS_BUF_COUNT(bp) >=
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 927936e6d..93c544ee5 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -682,14 +682,21 @@ xfs_mountfs(
 					error = XFS_ERROR(EINVAL);
 					goto error1;
 				}
+				xfs_fs_cmn_err(CE_WARN, mp,
+"stripe alignment turned off: sunit(%d)/swidth(%d) incompatible with agsize(%d)",
+					mp->m_dalign, mp->m_swidth,
+					sbp->sb_agblocks);
+
 				mp->m_dalign = 0;
 				mp->m_swidth = 0;
 			} else if (mp->m_dalign) {
 				mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth);
 			} else {
 				if (mp->m_flags & XFS_MOUNT_RETERR) {
-					cmn_err(CE_WARN,
-					"XFS: alignment check 3 failed");
+					xfs_fs_cmn_err(CE_WARN, mp,
+"stripe alignment turned off: sunit(%d) less than bsize(%d)",
+                                        	mp->m_dalign,
+						mp->m_blockmask +1);
 					error = XFS_ERROR(EINVAL);
 					goto error1;
 				}
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index e338e32d3..1ee2bbf63 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -95,7 +95,8 @@ typedef int	(*xfs_send_data_t)(int, struct vnode *,
 			xfs_off_t, size_t, int, vrwlock_t *);
 typedef int	(*xfs_send_mmap_t)(struct vm_area_struct *, uint);
 typedef int	(*xfs_send_destroy_t)(struct vnode *, dm_right_t);
-typedef int	(*xfs_send_namesp_t)(dm_eventtype_t, struct vnode *,
+typedef int	(*xfs_send_namesp_t)(dm_eventtype_t, struct vfs *,
+			struct vnode *,
 			dm_right_t, struct vnode *, dm_right_t,
 			char *, char *, mode_t, int, int);
 typedef void	(*xfs_send_unmount_t)(struct vfs *, struct vnode *,
@@ -116,7 +117,9 @@ typedef struct xfs_dmops {
 #define XFS_SEND_DESTROY(mp, vp,right) \
 	(*(mp)->m_dm_ops.xfs_send_destroy)(vp,right)
 #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
-	(*(mp)->m_dm_ops.xfs_send_namesp)(ev,b1,r1,b2,r2,n1,n2,mode,rval,fl)
+	(*(mp)->m_dm_ops.xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl)
+#define XFS_SEND_PREUNMOUNT(mp, vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
+	(*(mp)->m_dm_ops.xfs_send_namesp)(DM_EVENT_PREUNMOUNT,vfs,b1,r1,b2,r2,n1,n2,mode,rval,fl)
 #define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \
 	(*(mp)->m_dm_ops.xfs_send_unmount)(vfsp,vp,right,mode,rval,fl)
 
@@ -413,6 +416,8 @@ typedef struct xfs_mount {
 #define XFS_MOUNT_NOUUID	0x00010000	/* ignore uuid during mount */
 #define XFS_MOUNT_NOLOGFLUSH	0x00020000
 #define XFS_MOUNT_IDELETE	0x00040000	/* delete empty inode clusters*/
+#define XFS_MOUNT_SWALLOC	0x00080000	/* turn on stripe width
+						 * allocation */
 
 /*
  * Default minimum read and write sizes.
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index aebea7a29..818857739 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -855,16 +855,19 @@ shut_us_down:
 	tp->t_logcb.cb_func = (void(*)(void*, int))xfs_trans_committed;
 	tp->t_logcb.cb_arg = tp;
 
-	/* We need to pass the iclog buffer which was used for the
+	/*
+	 * We need to pass the iclog buffer which was used for the
 	 * transaction commit record into this function, and attach
 	 * the callback to it. The callback must be attached before
 	 * the items are unlocked to avoid racing with other threads
 	 * waiting for an item to unlock.
 	 */
-	error = xfs_log_notify(mp, commit_iclog, &(tp->t_logcb));
+	shutdown = xfs_log_notify(mp, commit_iclog, &(tp->t_logcb));
 
-	/* mark this thread as no longer being in a transaction */
-        PFLAGS_RESTORE_FSTRANS(&tp->t_pflags);
+	/*
+	 * Mark this thread as no longer being in a transaction
+	 */
+	PFLAGS_RESTORE_FSTRANS(&tp->t_pflags);
 
 	/*
 	 * Once all the items of the transaction have been copied
@@ -881,6 +884,19 @@ shut_us_down:
 	 */
 	xfs_trans_unlock_items(tp, commit_lsn);
 
+	/*
+	 * If we detected a log error earlier, finish committing
+	 * the transaction now (unpin log items, etc).
+	 *
+	 * Order is critical here, to avoid using the transaction
+	 * pointer after its been freed (by xfs_trans_committed
+	 * either here now, or as a callback).  We cannot do this
+	 * step inside xfs_log_notify as was done earlier because
+	 * of this issue.
+	 */
+	if (shutdown)
+		xfs_trans_committed(tp, XFS_LI_ABORTED);
+
 	/*
 	 * Now that the xfs_trans_committed callback has been attached,
 	 * and the items are released we can finally allow the iclog to
@@ -1241,10 +1257,6 @@ xfs_trans_chunk_committed(
 		if (aborted)
 			lip->li_flags |= XFS_LI_ABORTED;
 
-		if (lidp->lid_flags & XFS_LID_SYNC_UNLOCK) {
-			IOP_UNLOCK(lip);
-		}
-
 		/*
 		 * Send in the ABORTED flag to the COMMITTED routine
 		 * so that it knows whether the transaction was aborted
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index b415975b8..86e53377e 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -220,7 +220,6 @@ typedef struct xfs_log_item_desc {
 
 #define XFS_LID_DIRTY		0x1
 #define XFS_LID_PINNED		0x2
-#define XFS_LID_SYNC_UNLOCK	0x4
 #define XFS_LID_BUF_STALE	0x8
 
 /*
@@ -1001,7 +1000,6 @@ struct xfs_buf	*xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int);
 void		xfs_trans_brelse(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_bjoin(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_bhold(xfs_trans_t *, struct xfs_buf *);
-void		xfs_trans_bhold_until_committed(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_binval(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *);
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 7f2037a4e..7bc5eab4c 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -48,11 +48,11 @@ STATIC xfs_log_item_t * xfs_ail_delete(xfs_ail_entry_t *, xfs_log_item_t *);
 STATIC xfs_log_item_t * xfs_ail_min(xfs_ail_entry_t *);
 STATIC xfs_log_item_t * xfs_ail_next(xfs_ail_entry_t *, xfs_log_item_t *);
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 STATIC void xfs_ail_check(xfs_ail_entry_t *);
 #else
 #define	xfs_ail_check(a)
-#endif /* XFSDEBUG */
+#endif /* DEBUG */
 
 
 /*
@@ -553,7 +553,7 @@ xfs_ail_next(
 
 }
 
-#ifdef XFSDEBUG
+#ifdef DEBUG
 /*
  * Check that the list is sorted as it should be.
  */
@@ -593,4 +593,4 @@ xfs_ail_check(
 	ASSERT(lip == (xfs_log_item_t*)base);
 	ASSERT(base->ail_back == prev_lip);
 }
-#endif /* XFSDEBUG */
+#endif /* DEBUG */
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 365b79093..a9682b951 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -713,40 +713,6 @@ xfs_trans_bhold(xfs_trans_t	*tp,
 	xfs_buf_item_trace("BHOLD", bip);
 }
 
-/*
- * This function is used to indicate that the buffer should not be
- * unlocked until the transaction is committed to disk.  Since we
- * are going to keep the lock held, make the transaction synchronous
- * so that the lock is not held too long.
- *
- * It uses the log item descriptor flag XFS_LID_SYNC_UNLOCK to
- * delay the buf items's unlock call until the transaction is
- * committed to disk or aborted.
- */
-void
-xfs_trans_bhold_until_committed(xfs_trans_t	*tp,
-				xfs_buf_t	*bp)
-{
-	xfs_log_item_desc_t	*lidp;
-	xfs_buf_log_item_t	*bip;
-
-	ASSERT(XFS_BUF_ISBUSY(bp));
-	ASSERT(XFS_BUF_FSPRIVATE2(bp, xfs_trans_t *) == tp);
-	ASSERT(XFS_BUF_FSPRIVATE(bp, void *) != NULL);
-
-	bip = XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *);
-	ASSERT(!(bip->bli_flags & XFS_BLI_STALE));
-	ASSERT(!(bip->bli_format.blf_flags & XFS_BLI_CANCEL));
-	ASSERT(atomic_read(&bip->bli_refcount) > 0);
-	lidp = xfs_trans_find_item(tp, (xfs_log_item_t*)bip);
-	ASSERT(lidp != NULL);
-
-	lidp->lid_flags |= XFS_LID_SYNC_UNLOCK;
-	xfs_buf_item_trace("BHOLD UNTIL COMMIT", bip);
-
-	xfs_trans_set_sync(tp);
-}
-
 /*
  * This is called to mark bytes first through last inclusive of the given
  * buffer as needing to be logged when the transaction is committed.
@@ -799,7 +765,6 @@ xfs_trans_log_buf(xfs_trans_t	*tp,
 	if (bip->bli_flags & XFS_BLI_STALE) {
 		xfs_buf_item_trace("BLOG UNSTALE", bip);
 		bip->bli_flags &= ~XFS_BLI_STALE;
-		/* note this will have to change for page_buf interface... unstale isn't really an option RMC */
 		ASSERT(XFS_BUF_ISSTALE(bp));
 		XFS_BUF_UNSTALE(bp);
 		bip->bli_format.blf_flags &= ~XFS_BLI_CANCEL;
diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c
index 56062796a..767af4810 100644
--- a/fs/xfs/xfs_trans_item.c
+++ b/fs/xfs/xfs_trans_item.c
@@ -397,7 +397,8 @@ xfs_trans_unlock_items(xfs_trans_t *tp, xfs_lsn_t commit_lsn)
  * Stamp the commit lsn into each item if necessary.
  * Free descriptors pointing to items which are not dirty if freeing_chunk
  * is zero. If freeing_chunk is non-zero, then we need to unlock all
- * items in the chunk including those with XFS_LID_SYNC_UNLOCK set.
+ * items in the chunk.
+ * 
  * Return the number of descriptors freed.
  */
 STATIC int
@@ -423,18 +424,9 @@ xfs_trans_unlock_chunk(
 
 		if (commit_lsn != NULLCOMMITLSN)
 			IOP_COMMITTING(lip, commit_lsn);
-
-		/* XXXsup */
 		if (abort)
 			lip->li_flags |= XFS_LI_ABORTED;
-
-		/* if (abort) {
-			IOP_ABORT(lip);
-		} else */
-		if (!(lidp->lid_flags & XFS_LID_SYNC_UNLOCK) ||
-			   freeing_chunk || abort) {
-			IOP_UNLOCK(lip);
-		}
+		IOP_UNLOCK(lip);
 
 		/*
 		 * Free the descriptor if the item is not dirty
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index aa16d90e2..be1188165 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -279,6 +279,9 @@ xfs_start_flags(
 	if (ap->flags & XFSMNT_NOALIGN)
 		mp->m_flags |= XFS_MOUNT_NOALIGN;
 
+	if (ap->flags & XFSMNT_SWALLOC)
+		mp->m_flags |= XFS_MOUNT_SWALLOC;
+
 	if (ap->flags & XFSMNT_OSYNCISOSYNC)
 		mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
 
@@ -536,7 +539,7 @@ xfs_unmount(
 	rvp = XFS_ITOV(rip);
 
 	if (vfsp->vfs_flag & VFS_DMI) {
-		error = XFS_SEND_NAMESP(mp, DM_EVENT_PREUNMOUNT,
+		error = XFS_SEND_PREUNMOUNT(mp, vfsp,
 				rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
 				NULL, NULL, 0, 0,
 				(mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))?
@@ -1614,6 +1617,7 @@ xfs_vget(
 #define MNTOPT_WSYNC	"wsync"		/* safe-mode nfs compatible mount */
 #define MNTOPT_INO64	"ino64"		/* force inodes into 64-bit range */
 #define MNTOPT_NOALIGN	"noalign"	/* turn off stripe alignment */
+#define MNTOPT_SWALLOC	"swalloc"	/* turn on stripe width allocation */
 #define MNTOPT_SUNIT	"sunit"		/* data volume stripe unit */
 #define MNTOPT_SWIDTH	"swidth"	/* data volume stripe width */
 #define MNTOPT_NOUUID	"nouuid"	/* ignore filesystem UUID */
@@ -1721,6 +1725,8 @@ xfs_parseargs(
 #endif
 		} else if (!strcmp(this_char, MNTOPT_NOALIGN)) {
 			args->flags |= XFSMNT_NOALIGN;
+		} else if (!strcmp(this_char, MNTOPT_SWALLOC)) {
+			args->flags |= XFSMNT_SWALLOC;
 		} else if (!strcmp(this_char, MNTOPT_SUNIT)) {
 			if (!value || !*value) {
 				printk("XFS: %s option requires an argument\n",
@@ -1815,6 +1821,7 @@ xfs_showargs(
 		{ XFS_MOUNT_WSYNC,		"," MNTOPT_WSYNC },
 		{ XFS_MOUNT_INO64,		"," MNTOPT_INO64 },
 		{ XFS_MOUNT_NOALIGN,		"," MNTOPT_NOALIGN },
+		{ XFS_MOUNT_SWALLOC,		"," MNTOPT_SWALLOC },
 		{ XFS_MOUNT_NOUUID,		"," MNTOPT_NOUUID },
 		{ XFS_MOUNT_NORECOVERY,		"," MNTOPT_NORECOVERY },
 		{ XFS_MOUNT_OSYNCISOSYNC,	"," MNTOPT_OSYNCISOSYNC },
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index dd20a0a26..ab9b4d181 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -246,25 +246,10 @@ xfs_getattr(
 		goto all_done;
 
 	/*
-	 * convert di_flags to xflags
+	 * Convert di_flags to xflags.
 	 */
-	vap->va_xflags = 0;
-	if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
-		vap->va_xflags |= XFS_XFLAG_REALTIME;
-	if (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC)
-		vap->va_xflags |= XFS_XFLAG_PREALLOC;
-	if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE)
-		vap->va_xflags |= XFS_XFLAG_IMMUTABLE;
-	if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
-		vap->va_xflags |= XFS_XFLAG_APPEND;
-	if (ip->i_d.di_flags & XFS_DIFLAG_SYNC)
-		vap->va_xflags |= XFS_XFLAG_SYNC;
-	if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME)
-		vap->va_xflags |= XFS_XFLAG_NOATIME;
-	if (ip->i_d.di_flags & XFS_DIFLAG_NODUMP)
-		vap->va_xflags |= XFS_XFLAG_NODUMP;
-	if (XFS_IFORK_Q(ip))
-		vap->va_xflags |= XFS_XFLAG_HASATTR;
+	vap->va_xflags = xfs_dic2xflags(&ip->i_d, ARCH_NOCONVERT);
+
 	/*
 	 * Exit for inode revalidate.  See if any of the rest of
 	 * the fields to be filled in are needed.
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index ab4415132..243727d03 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -212,6 +212,10 @@ acpi_os_queue_for_execution (
 	OSD_EXECUTION_CALLBACK  function,
 	void                            *context);
 
+void
+acpi_os_wait_events_complete(
+	void * context);
+
 void
 acpi_os_sleep (
 	u32                             seconds,
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index cd253c8c6..1b383e3cb 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -115,6 +115,8 @@ static __inline__ long atomic_add_return(int i, atomic_t * v)
 	return result;
 }
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
 static __inline__ long atomic64_add_return(long i, atomic64_t * v)
 {
 	long temp, result;
@@ -178,6 +180,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
 #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
 #define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
 
+#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
 #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
 #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
 
diff --git a/include/asm-alpha/cacheflush.h b/include/asm-alpha/cacheflush.h
index 68babfa19..40a11e4cf 100644
--- a/include/asm-alpha/cacheflush.h
+++ b/include/asm-alpha/cacheflush.h
@@ -10,6 +10,8 @@
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_cache_vmap(start, end)		do { } while (0)
 #define flush_cache_vunmap(start, end)		do { } while (0)
 
diff --git a/include/asm-alpha/checksum.h b/include/asm-alpha/checksum.h
index c9501f230..f3e379787 100644
--- a/include/asm-alpha/checksum.h
+++ b/include/asm-alpha/checksum.h
@@ -43,7 +43,7 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
  */
-unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *errp);
+unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, int len, unsigned int sum, int *errp);
 
 unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum);
 
diff --git a/include/asm-alpha/core_mcpcia.h b/include/asm-alpha/core_mcpcia.h
index e75eab24e..db03753ed 100644
--- a/include/asm-alpha/core_mcpcia.h
+++ b/include/asm-alpha/core_mcpcia.h
@@ -167,7 +167,7 @@
 
 /* Hack!  Only words for bus 0.  */
 
-#if !MCPCIA_ONE_HAE_WINDOW
+#ifndef MCPCIA_ONE_HAE_WINDOW
 #define MCPCIA_HAE_ADDRESS	MCPCIA_HAE_MEM(4)
 #endif
 #define MCPCIA_IACK_SC		_MCPCIA_IACK_SC(4)
@@ -351,7 +351,7 @@ __EXTERN_INLINE u8 mcpcia_readb(unsigned long in_addr)
 	unsigned long hose = in_addr & ~0xffffffffUL;
 	unsigned long result, work;
 
-#if !MCPCIA_ONE_HAE_WINDOW
+#ifndef MCPCIA_ONE_HAE_WINDOW
 	unsigned long msb;
 	msb = addr & ~MCPCIA_MEM_MASK;
 	set_hae(msb);
@@ -370,7 +370,7 @@ __EXTERN_INLINE u16 mcpcia_readw(unsigned long in_addr)
 	unsigned long hose = in_addr & ~0xffffffffUL;
 	unsigned long result, work;
 
-#if !MCPCIA_ONE_HAE_WINDOW
+#ifndef MCPCIA_ONE_HAE_WINDOW
 	unsigned long msb;
 	msb = addr & ~MCPCIA_MEM_MASK;
 	set_hae(msb);
@@ -389,7 +389,7 @@ __EXTERN_INLINE void mcpcia_writeb(u8 b, unsigned long in_addr)
 	unsigned long hose = in_addr & ~0xffffffffUL;
 	unsigned long w;
 
-#if !MCPCIA_ONE_HAE_WINDOW
+#ifndef MCPCIA_ONE_HAE_WINDOW
 	unsigned long msb;
 	msb = addr & ~MCPCIA_MEM_MASK;
 	set_hae(msb);
@@ -407,7 +407,7 @@ __EXTERN_INLINE void mcpcia_writew(u16 b, unsigned long in_addr)
 	unsigned long hose = in_addr & ~0xffffffffUL;
 	unsigned long w;
 
-#if !MCPCIA_ONE_HAE_WINDOW
+#ifndef MCPCIA_ONE_HAE_WINDOW
 	unsigned long msb;
 	msb = addr & ~MCPCIA_MEM_MASK;
 	set_hae(msb);
diff --git a/include/asm-alpha/core_polaris.h b/include/asm-alpha/core_polaris.h
index ee7bdceed..dca0341b0 100644
--- a/include/asm-alpha/core_polaris.h
+++ b/include/asm-alpha/core_polaris.h
@@ -18,13 +18,13 @@
  */
 
 /* Polaris memory regions */
-#define POLARIS_SPARSE_MEM_BASE		(IDENT_ADDR + 0xf800000000)
-#define POLARIS_DENSE_MEM_BASE		(IDENT_ADDR + 0xf900000000)
-#define POLARIS_SPARSE_IO_BASE		(IDENT_ADDR + 0xf980000000)
-#define POLARIS_SPARSE_CONFIG_BASE	(IDENT_ADDR + 0xf9c0000000)
-#define POLARIS_IACK_BASE		(IDENT_ADDR + 0xf9f8000000)
-#define POLARIS_DENSE_IO_BASE		(IDENT_ADDR + 0xf9fc000000)
-#define POLARIS_DENSE_CONFIG_BASE	(IDENT_ADDR + 0xf9fe000000)
+#define POLARIS_SPARSE_MEM_BASE		(IDENT_ADDR + 0xf800000000UL)
+#define POLARIS_DENSE_MEM_BASE		(IDENT_ADDR + 0xf900000000UL)
+#define POLARIS_SPARSE_IO_BASE		(IDENT_ADDR + 0xf980000000UL)
+#define POLARIS_SPARSE_CONFIG_BASE	(IDENT_ADDR + 0xf9c0000000UL)
+#define POLARIS_IACK_BASE		(IDENT_ADDR + 0xf9f8000000UL)
+#define POLARIS_DENSE_IO_BASE		(IDENT_ADDR + 0xf9fc000000UL)
+#define POLARIS_DENSE_CONFIG_BASE	(IDENT_ADDR + 0xf9fe000000UL)
 
 #define POLARIS_IACK_SC			POLARIS_IACK_BASE
 
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
index b8f13146e..e94a945a2 100644
--- a/include/asm-alpha/elf.h
+++ b/include/asm-alpha/elf.h
@@ -1,6 +1,11 @@
 #ifndef __ASM_ALPHA_ELF_H
 #define __ASM_ALPHA_ELF_H
 
+/* Special values for the st_other field in the symbol table.  */
+
+#define STO_ALPHA_NOPV		0x80
+#define STO_ALPHA_STD_GPLOAD	0x88
+
 /*
  * Alpha ELF relocation types
  */
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h
index 41ab32c4f..289a00d51 100644
--- a/include/asm-alpha/floppy.h
+++ b/include/asm-alpha/floppy.h
@@ -108,10 +108,11 @@ static int FDC2 = -1;
  * on that platform... ;-}
  */
 
-#define CROSS_64KB(a,s)						\
-({ unsigned long __s64 = (unsigned long)(a);			\
-   unsigned long __e64 = __s64 + (unsigned long)(s) - 1;	\
-   (__s64 ^ __e64) & ~0xfffful; })
+static inline unsigned long CROSS_64KB(void *a, unsigned long s)
+{
+	unsigned long p = (unsigned long)a;
+	return ((p + s - 1) ^ p) & ~0xffffUL;
+}
 
 #define EXTRA_FLOPPY_PARAMS
 
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h
index 9444b3d6d..68934a259 100644
--- a/include/asm-alpha/ide.h
+++ b/include/asm-alpha/ide.h
@@ -19,6 +19,8 @@
 #define MAX_HWIFS	CONFIG_IDE_MAX_HWIFS
 #endif
 
+#define IDE_ARCH_OBSOLETE_DEFAULTS
+
 static inline int ide_default_irq(unsigned long base)
 {
 	switch (base) {
@@ -43,6 +45,9 @@ static inline unsigned long ide_default_io_base(int index)
 	}
 }
 
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+
 #ifdef CONFIG_PCI
 #define ide_init_default_irq(base)	(0)
 #else
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index fccb0fa8c..5f4a74357 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -9,9 +9,9 @@
  * Virtual -> physical identity mapping starts at this offset
  */
 #ifdef USE_48_BIT_KSEG
-#define IDENT_ADDR     0xffff800000000000
+#define IDENT_ADDR     0xffff800000000000UL
 #else
-#define IDENT_ADDR     0xfffffc0000000000
+#define IDENT_ADDR     0xfffffc0000000000UL
 #endif
 
 #ifdef __KERNEL__
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index 2602b3685..b316fc6a0 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -73,10 +73,13 @@ extern __inline__ int get_order(unsigned long size)
 	return order;
 }
 
-#endif /* !__ASSEMBLY__ */
+#ifdef USE_48_BIT_KSEG
+#define PAGE_OFFSET		0xffff800000000000UL
+#else
+#define PAGE_OFFSET		0xfffffc0000000000UL
+#endif
 
-/* to align the pointer to the (next) page boundary */
-#define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
+#else
 
 #ifdef USE_48_BIT_KSEG
 #define PAGE_OFFSET		0xffff800000000000
@@ -84,6 +87,11 @@ extern __inline__ int get_order(unsigned long size)
 #define PAGE_OFFSET		0xfffffc0000000000
 #endif
 
+#endif /* !__ASSEMBLY__ */
+
+/* to align the pointer to the (next) page boundary */
+#define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
+
 #define __pa(x)			((unsigned long) (x) - PAGE_OFFSET)
 #define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET))
 #ifndef CONFIG_DISCONTIGMEM
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index 62954be6f..8707a399b 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -83,7 +83,7 @@
 #define __DIRTY_BITS	(_PAGE_DIRTY | _PAGE_KWE | _PAGE_UWE)
 #define __ACCESS_BITS	(_PAGE_ACCESSED | _PAGE_KRE | _PAGE_URE)
 
-#define _PFN_MASK	0xFFFFFFFF00000000
+#define _PFN_MASK	0xFFFFFFFF00000000UL
 
 #define _PAGE_TABLE	(_PAGE_VALID | __DIRTY_BITS | __ACCESS_BITS)
 #define _PAGE_CHG_MASK	(_PFN_MASK | __DIRTY_BITS | __ACCESS_BITS)
@@ -349,6 +349,4 @@ extern void paging_init(void);
 /* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT.  */
 #define HAVE_ARCH_UNMAPPED_AREA
 
-typedef pte_t *pte_addr_t;
-
 #endif /* _ALPHA_PGTABLE_H */
diff --git a/include/asm-alpha/semaphore.h b/include/asm-alpha/semaphore.h
index 2ab1341a5..1f1978428 100644
--- a/include/asm-alpha/semaphore.h
+++ b/include/asm-alpha/semaphore.h
@@ -18,12 +18,12 @@
 struct semaphore {
 	atomic_t count;
 	wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	long __magic;
 #endif
 };
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 # define __SEM_DEBUG_INIT(name)		, (long)&(name).__magic
 #else
 # define __SEM_DEBUG_INIT(name)
@@ -53,7 +53,7 @@ static inline void sema_init(struct semaphore *sem, int val)
 
 	atomic_set(&sem->count, val);
 	init_waitqueue_head(&sem->wait);
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	sem->__magic = (long)&sem->__magic;
 #endif
 }
@@ -142,7 +142,7 @@ static inline void __up(struct semaphore *sem)
 		__up_wakeup(sem);
 }
 
-#if !WAITQUEUE_DEBUG && !defined(CONFIG_DEBUG_SEMAPHORE)
+#if !defined(WAITQUEUE_DEBUG) && !defined(CONFIG_DEBUG_SEMAPHORE)
 extern inline void down(struct semaphore *sem)
 {
 	__down(sem);
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h
index e24248f01..37f1742ff 100644
--- a/include/asm-alpha/signal.h
+++ b/include/asm-alpha/signal.h
@@ -187,7 +187,6 @@ struct sigstack {
 #include <asm/sigcontext.h>
 
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
-#define HAVE_ARCH_SYS_PAUSE
 
 #endif
 
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index bab905918..71d9743b8 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -36,6 +36,7 @@ typedef struct {
 
 #define spin_is_locked(x)	((x)->lock != 0)
 #define spin_unlock_wait(x)	({ do { barrier(); } while ((x)->lock); })
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 #ifdef CONFIG_DEBUG_SPINLOCK
 extern void _raw_spin_unlock(spinlock_t * lock);
diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h
index f5716139e..43264d219 100644
--- a/include/asm-alpha/types.h
+++ b/include/asm-alpha/types.h
@@ -56,6 +56,8 @@ typedef unsigned long u64;
 typedef u64 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ALPHA_TYPES_H */
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index 3d6980306..a65bfb31a 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -29,6 +29,14 @@
 
 #define segment_eq(a,b)	((a).seg == (b).seg)
 
+#ifdef __CHECKER__
+#define CHECK_UPTR(ptr) do {                            \
+        __typeof__(*(ptr)) *__dummy_check_uptr =        \
+		(void __user *)&__dummy_check_uptr;     \
+} while(0)
+#else
+#define CHECK_UPTR(ptr)
+#endif
 
 /*
  * Is a address valid? This does a straightforward calculation rather
@@ -43,10 +51,13 @@
 #define __access_ok(addr,size,segment) \
 	(((segment).seg & (addr | size | (addr+size))) == 0)
 
-#define access_ok(type,addr,size) \
-	__access_ok(((unsigned long)(addr)),(size),get_fs())
+#define access_ok(type,addr,size)				\
+({								\
+	CHECK_UPTR(addr);					\
+	__access_ok(((unsigned long)(addr)),(size),get_fs());	\
+})
 
-extern inline int verify_area(int type, const void * addr, unsigned long size)
+extern inline int verify_area(int type, const void __user * addr, unsigned long size)
 {
 	return access_ok(type,addr,size) ? 0 : -EFAULT;
 }
@@ -90,6 +101,7 @@ extern void __get_user_unknown(void);
 #define __get_user_nocheck(x,ptr,size)				\
 ({								\
 	long __gu_err = 0, __gu_val;				\
+	CHECK_UPTR(ptr);					\
 	switch (size) {						\
 	  case 1: __get_user_8(ptr); break;			\
 	  case 2: __get_user_16(ptr); break;			\
@@ -105,6 +117,7 @@ extern void __get_user_unknown(void);
 ({								\
 	long __gu_err = -EFAULT, __gu_val = 0;			\
 	const __typeof__(*(ptr)) *__gu_addr = (ptr);		\
+	CHECK_UPTR(ptr);					\
 	if (__access_ok((long)__gu_addr,size,segment)) {	\
 		__gu_err = 0;					\
 		switch (size) {					\
@@ -204,6 +217,7 @@ extern void __put_user_unknown(void);
 #define __put_user_nocheck(x,ptr,size)				\
 ({								\
 	long __pu_err = 0;					\
+	CHECK_UPTR(ptr);					\
 	switch (size) {						\
 	  case 1: __put_user_8(x,ptr); break;			\
 	  case 2: __put_user_16(x,ptr); break;			\
@@ -218,6 +232,7 @@ extern void __put_user_unknown(void);
 ({								\
 	long __pu_err = -EFAULT;				\
 	__typeof__(*(ptr)) *__pu_addr = (ptr);			\
+	CHECK_UPTR(ptr);					\
 	if (__access_ok((long)__pu_addr,size,segment)) {	\
 		__pu_err = 0;					\
 		switch (size) {					\
@@ -371,34 +386,42 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len)
 }
 
 extern inline long
-__copy_tofrom_user(void *to, const void *from, long len, const void *validate)
+__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
 {
 	if (__access_ok((long)validate, len, get_fs()))
 		len = __copy_tofrom_user_nocheck(to, from, len);
 	return len;
 }
 
-#define __copy_to_user(to,from,n)   __copy_tofrom_user_nocheck((to),(from),(n))
-#define __copy_from_user(to,from,n) __copy_tofrom_user_nocheck((to),(from),(n))
+#define __copy_to_user(to,from,n)				\
+({								\
+	CHECK_UPTR(to);						\
+	__copy_tofrom_user_nocheck((void *)(to),(from),(n));	\
+})
+#define __copy_from_user(to,from,n)				\
+({								\
+	CHECK_UPTR(from);					\
+	__copy_tofrom_user_nocheck((to),(void *)(from),(n));	\
+})
 
 extern inline long
-copy_to_user(void *to, const void *from, long n)
+copy_to_user(void __user *to, const void *from, long n)
 {
-	return __copy_tofrom_user(to, from, n, to);
+	return __copy_tofrom_user((void *)to, from, n, to);
 }
 
 extern inline long
-copy_from_user(void *to, const void *from, long n)
+copy_from_user(void *to, const void __user *from, long n)
 {
-	return __copy_tofrom_user(to, from, n, from);
+	return __copy_tofrom_user(to, (void *)from, n, from);
 }
 
 extern void __do_clear_user(void);
 
 extern inline long
-__clear_user(void *to, long len)
+__clear_user(void __user *to, long len)
 {
-	register void * __cl_to __asm__("$6") = to;
+	register void __user * __cl_to __asm__("$6") = to;
 	register long __cl_len __asm__("$0") = len;
 	__asm__ __volatile__(
 		__module_call(28, 2, __do_clear_user)
@@ -410,7 +433,7 @@ __clear_user(void *to, long len)
 }
 
 extern inline long
-clear_user(void *to, long len)
+clear_user(void __user *to, long len)
 {
 	if (__access_ok((long)to, len, get_fs()))
 		len = __clear_user(to, len);
@@ -423,10 +446,10 @@ clear_user(void *to, long len)
 /* Returns: -EFAULT if exception before terminator, N if the entire
    buffer filled, else strlen.  */
 
-extern long __strncpy_from_user(char *__to, const char *__from, long __to_len);
+extern long __strncpy_from_user(char *__to, const char __user *__from, long __to_len);
 
 extern inline long
-strncpy_from_user(char *to, const char *from, long n)
+strncpy_from_user(char *to, const char __user *from, long n)
 {
 	long ret = -EFAULT;
 	if (__access_ok((long)from, 0, get_fs()))
@@ -435,18 +458,18 @@ strncpy_from_user(char *to, const char *from, long n)
 }
 
 /* Returns: 0 if bad, string length+1 (memory size) of string if ok */
-extern long __strlen_user(const char *);
+extern long __strlen_user(const char __user *);
 
-extern inline long strlen_user(const char *str)
+extern inline long strlen_user(const char __user *str)
 {
 	return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0;
 }
 
 /* Returns: 0 if exception before NUL or reaching the supplied limit (N),
  * a value greater than N if the limit would be exceeded, else strlen.  */
-extern long __strnlen_user(const char *, long);
+extern long __strnlen_user(const char __user *, long);
 
-extern inline long strnlen_user(const char *str, long n)
+extern inline long strnlen_user(const char __user *str, long n)
 {
 	return access_ok(VERIFY_READ,str,0) ? __strnlen_user(str, n) : 0;
 }
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 7e65aa4f2..ceda5fc56 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -558,6 +558,19 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
 
 #endif /* __LIBRARY__ && __GNUC__ */
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-arm/arch-adifcc/memory.h b/include/asm-arm/arch-adifcc/memory.h
index 31b21bc32..b76187d8d 100644
--- a/include/asm-arm/arch-adifcc/memory.h
+++ b/include/asm-arm/arch-adifcc/memory.h
@@ -7,37 +7,11 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
-
-/*
- * Task size: 3GB
- */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
-
 /*
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET	(0xC0000000UL)
 
-/*
- * physical vs virtual ram conversion
- */
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-#define __virt_to_phys(x)	((x) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(x)	((x) - PHYS_OFFSET + PAGE_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -47,8 +21,6 @@
  *
  * These are dummies for now.
  */
-#define __virt_to_bus__is_a_macro
-#define __bus_to_virt__is_a_macro
 #define __virt_to_bus(x)	 __virt_to_phys(x)
 #define __bus_to_virt(x)	 __phys_to_virt(x)
 
diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h
index b074792de..9776bba8e 100644
--- a/include/asm-arm/arch-cl7500/memory.h
+++ b/include/asm-arm/arch-cl7500/memory.h
@@ -11,39 +11,19 @@
  *  21-Mar-1999	RMK	Renamed to memory.h
  *		RMK	Added TASK_SIZE and PAGE_OFFSET
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x10000000UL)
 
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-
 /*
  * These are exactly the same on the RiscPC as the
  * physical memory view.
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x) __phys_to_virt(x)
 
 #endif
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h
index a116a7fa5..bd978947d 100644
--- a/include/asm-arm/arch-clps711x/memory.h
+++ b/include/asm-arm/arch-clps711x/memory.h
@@ -1,5 +1,5 @@
 /*
- *  linux/include/asm-arm/arch-clps711x/mmu.h
+ *  linux/include/asm-arm/arch-clps711x/memory.h
  *
  *  Copyright (C) 1999 ARM Limited
  *
@@ -17,37 +17,16 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 #include <linux/config.h>
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0xc0000000UL)
 
-/*
- * On integrator, the dram is contiguous
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -58,23 +37,17 @@
 
 #if defined(CONFIG_ARCH_CDB89712)
 
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	(x)
 
 #elif defined (CONFIG_ARCH_AUTCPU12)
 
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	(x)
 
 #else
 
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	((x) - PAGE_OFFSET)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	((x) + PAGE_OFFSET)
 
 #endif
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
index a7a1d4c18..52030abe9 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -50,7 +50,7 @@ void __writel(u32 val, void *addr);
 #define writew(v,b)		__writew(v,b)
 #define writel(v,b)		__writel(v,b)
 
-#define __arch_ioremap(cookie,sz,c)	((void *)(cookie))
+#define __arch_ioremap(cookie,sz,c,a)	((void *)(cookie))
 #define __arch_iounmap(cookie)		do { } while (0)
 
 #endif
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h
index 146855ded..5a9493e12 100644
--- a/include/asm-arm/arch-ebsa110/memory.h
+++ b/include/asm-arm/arch-ebsa110/memory.h
@@ -17,35 +17,15 @@
 #define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x00000000UL)
 
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage)	((vpage) - PAGE_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage)	((ppage) + PAGE_OFFSET)
-
 /*
  * We keep this 1:1 so that we don't interfere
  * with the PCMCIA memory regions
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	(x)
 
 #endif
diff --git a/include/asm-arm/arch-ebsa110/system.h b/include/asm-arm/arch-ebsa110/system.h
index 3afdb3d58..d7c8fece0 100644
--- a/include/asm-arm/arch-ebsa110/system.h
+++ b/include/asm-arm/arch-ebsa110/system.h
@@ -25,13 +25,13 @@ static inline void arch_idle(void)
 	const char *irq_stat = (char *)0xff000000;
 
 	/* disable clock switching */
-	asm volatile ("mcr%? p15, 0, ip, c15, c2, 2");
+	asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");
 
 	/* wait for an interrupt to occur */
 	while (!*irq_stat);
 
 	/* enable clock switching */
-	asm volatile ("mcr%? p15, 0, ip, c15, c1, 2");
+	asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
 }
 
 #define arch_reset(mode)	cpu_reset(0x80000000)
diff --git a/include/asm-arm/arch-ebsa110/timex.h b/include/asm-arm/arch-ebsa110/timex.h
index 6cdd6b5de..1e9ef0450 100644
--- a/include/asm-arm/arch-ebsa110/timex.h
+++ b/include/asm-arm/arch-ebsa110/timex.h
@@ -15,5 +15,5 @@
  * This is therefore not used to calculate the
  * divisor.
  */
-//#define CLOCK_TICK_RATE		2000000
+#define CLOCK_TICK_RATE		47894000
 
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h
index 3ff4bd099..8396e9a3d 100644
--- a/include/asm-arm/arch-ebsa110/uncompress.h
+++ b/include/asm-arm/arch-ebsa110/uncompress.h
@@ -13,26 +13,26 @@
  */
 static void puts(const char *s)
 {
-	__asm__ __volatile__("
-	ldrb	%0, [%2], #1
-	teq	%0, #0
-	beq	3f
-1:	strb	%0, [%3]
-2:	ldrb	%1, [%3, #0x14]
-	and	%1, %1, #0x60
-	teq	%1, #0x60
-	bne	2b
-	teq	%0, #'\n'
-	moveq	%0, #'\r'
-	beq	1b
-	ldrb	%0, [%2], #1
-	teq	%0, #0
-	bne	1b
-3:	ldrb	%1, [%3, #0x14]
-	and	%1, %1, #0x60
-	teq	%1, #0x60
-	bne	3b
-	" : : "r" (0), "r" (0), "r" (s), "r" (0xf0000be0) : "cc");
+	__asm__ __volatile__(
+	"ldrb	%0, [%2], #1\n"
+"	teq	%0, #0\n"
+"	beq	3f\n"
+"1:	strb	%0, [%3]\n"
+"2:	ldrb	%1, [%3, #0x14]\n"
+"	and	%1, %1, #0x60\n"
+"	teq	%1, #0x60\n"
+"	bne	2b\n"
+"	teq	%0, #'\n'\n"
+"	moveq	%0, #'\r'\n"
+"	beq	1b\n"
+"	ldrb	%0, [%2], #1\n"
+"	teq	%0, #0\n"
+"	bne	1b\n"
+"3:	ldrb	%1, [%3, #0x14]\n"
+"	and	%1, %1, #0x60\n"
+"	teq	%1, #0x60\n"
+"	bne	3b"
+	: : "r" (0), "r" (0), "r" (s), "r" (0xf0000be0) : "cc");
 }
 
 /*
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h
index 42912ef05..d0466f998 100644
--- a/include/asm-arm/arch-ebsa285/memory.h
+++ b/include/asm-arm/arch-ebsa285/memory.h
@@ -16,8 +16,8 @@
  *			Renamed to memory.h
  *			Moved PAGE_OFFSET and TASK_SIZE here
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 #include <linux/config.h>
 
@@ -34,9 +34,7 @@ extern unsigned long __bus_to_virt(unsigned long);
 
 #elif defined(CONFIG_FOOTBRIDGE_HOST)
 
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	((x) - 0xe0000000)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	((x) + 0xe0000000)
 
 #else
@@ -63,7 +61,9 @@ extern unsigned long __bus_to_virt(unsigned long);
 
 #endif
 
-#define TASK_SIZE_26		(0x04000000UL)
+/*
+ * Physical DRAM offset.
+ */
 #define PHYS_OFFSET		(0x00000000UL)
 
 /*
@@ -72,12 +72,4 @@ extern unsigned long __bus_to_virt(unsigned long);
  */
 #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3)
 
-/*
- * The DRAM is always contiguous.
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((unsigned long)(vpage) - PAGE_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET)
-
 #endif
diff --git a/include/asm-arm/arch-epxa10db/memory.h b/include/asm-arm/arch-epxa10db/memory.h
index 3af88af12..3f86bf7f6 100644
--- a/include/asm-arm/arch-epxa10db/memory.h
+++ b/include/asm-arm/arch-epxa10db/memory.h
@@ -17,35 +17,14 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x00000000UL)
 
-/*
- * On epxa10, the dram is contiguous
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -53,9 +32,7 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *              to an address that the kernel can use.
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	(x - PAGE_OFFSET + /*SDRAM_BASE*/0)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	(x - /*SDRAM_BASE*/0 + PAGE_OFFSET)
 
 #endif
diff --git a/include/asm-arm/arch-integrator/memory.h b/include/asm-arm/arch-integrator/memory.h
index ab0330405..2087ea7d2 100644
--- a/include/asm-arm/arch-integrator/memory.h
+++ b/include/asm-arm/arch-integrator/memory.h
@@ -1,5 +1,5 @@
 /*
- *  linux/include/asm-arm/arch-integrator/mmu.h
+ *  linux/include/asm-arm/arch-integrator/memory.h
  *
  *  Copyright (C) 1999 ARM Limited
  *
@@ -17,35 +17,13 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x00000000UL)
-
-/*
- * On integrator, the dram is contiguous
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
-
 #define BUS_OFFSET	(0x80000000UL)
 
 /*
@@ -55,9 +33,7 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *              to an address that the kernel can use.
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	(x - PAGE_OFFSET + BUS_OFFSET)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	(x - BUS_OFFSET + PAGE_OFFSET)
 
 #endif
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h
index 5bd08007e..a2d077a3b 100644
--- a/include/asm-arm/arch-iop3xx/memory.h
+++ b/include/asm-arm/arch-iop3xx/memory.h
@@ -9,36 +9,11 @@
 #include <asm/arch/iop310.h>
 #include <asm/arch/iop321.h>
 
-/*
- * Task size: 3GB
- */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
-
 /*
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET	(0xa0000000UL)
 
-/*
- * physical vs virtual ram conversion
- */
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-#define __virt_to_phys(x)	((x) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(x)	((x) - PHYS_OFFSET + PAGE_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -46,9 +21,6 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *		to an address that the kernel can use.
  */
-#define __virt_to_bus__is_a_macro
-#define __bus_to_virt__is_a_macro
-
 #ifdef CONFIG_ARCH_IOP310
 
 #define __virt_to_bus(x)	(((__virt_to_phys(x)) & ~(*IOP310_SIATVR)) | ((*IOP310_SIABAR) & 0xfffffff0))
diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h
index 12f8ad8c2..c5b9608cb 100644
--- a/include/asm-arm/arch-l7200/memory.h
+++ b/include/asm-arm/arch-l7200/memory.h
@@ -12,39 +12,12 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
-/*
- * Task size: 3GB
- */
-#define TASK_SIZE       (0xbf000000UL)
-#define TASK_SIZE_26    (0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET     (0xc0000000UL)
-
 /*
  * Physical DRAM offset on the L7200 SDB.
  */
 #define PHYS_OFFSET     (0xf0000000UL)
 
-/*
- * The DRAM is contiguous.
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x) __phys_to_virt(x)
 
 #endif
diff --git a/include/asm-arm/arch-lh7a40x/hardware.h b/include/asm-arm/arch-lh7a40x/hardware.h
index 2d75c6d74..aeb07c162 100644
--- a/include/asm-arm/arch-lh7a40x/hardware.h
+++ b/include/asm-arm/arch-lh7a40x/hardware.h
@@ -13,8 +13,6 @@
 #ifndef __ASM_ARCH_HARDWARE_H
 #define __ASM_ARCH_HARDWARE_H
 
-#include <asm/mach-types.h>
-
 #define io_p2v(x) (0xf0000000 | (((x) & 0xfff00000) >> 4) | ((x) & 0x0000ffff))
 #define io_v2p(x) (             (((x) & 0x0fff0000) << 4) | ((x) & 0x0000ffff))
 
@@ -39,10 +37,10 @@ typedef struct { volatile u32 offset[4096]; } __regbase;
 # define __REGP(x)	((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
 # define __REG(x)	__REGP(io_p2v(x))
 typedef struct { volatile u16 offset[4096]; } __regbase16;
-# define __REGP16(x)	((__regbase16 *)((x)&~4095))->offset[((x)&4095)>>2]
+# define __REGP16(x)	((__regbase16 *)((x)&~4095))->offset[((x)&4095)>>1]
 # define __REG16(x)	__REGP16(io_p2v(x))
 typedef struct { volatile u8 offset[4096]; } __regbase8;
-# define __REGP8(x)	((__regbase8 *)((x)&~4095))->offset[((x)&4095)>>2]
+# define __REGP8(x)	((__regbase8 *)((x)&~4095))->offset[(x)&4095]
 # define __REG8(x)	__REGP8(io_p2v(x))
 #endif
 
diff --git a/include/asm-arm/arch-lh7a40x/ide.h b/include/asm-arm/arch-lh7a40x/ide.h
index 7a461d166..fb50c0799 100644
--- a/include/asm-arm/arch-lh7a40x/ide.h
+++ b/include/asm-arm/arch-lh7a40x/ide.h
@@ -64,13 +64,6 @@ static __inline__  void ide_init_default_hwifs (void)
 	ide_register_hw (&hw, &hwif);
 	lpd7a40x_hwif_ioops (hwif); /* Override IO routines */
 }
-
-#else
-
-static __inline__ void ide_init_hwif_ports (hw_regs_t *hw, int data_port,
-					    int ctrl_port, int *irq) {}
-static __inline__ void ide_init_default_hwifs (void) {}
-
 #endif
 
 #endif
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h
index 2632ae73c..1a1b1a3d5 100644
--- a/include/asm-arm/arch-lh7a40x/memory.h
+++ b/include/asm-arm/arch-lh7a40x/memory.h
@@ -14,36 +14,11 @@
 
 #define BANKS_PER_NODE 1	/* Define as either 1 or 2 */
 
-/*
- * Task size: 3GB
- */
-#define TASK_SIZE	(0xbf000000UL) /* 0xc0000000? */
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
-
 /*
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET	(0xc0000000UL)
 
-/*
- * physical vs virtual ram conversion
- */
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-#define __virt_to_phys(x)	((x) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(x)	((x) - PHYS_OFFSET + PAGE_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -51,8 +26,6 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *		to an address that the kernel can use.
  */
-#define __virt_to_bus__is_a_macro
-#define __bus_to_virt__is_a_macro
 #define __virt_to_bus(x)	 __virt_to_phys(x)
 #define __bus_to_virt(x)	 __phys_to_virt(x)
 
diff --git a/include/asm-arm/arch-nexuspci/memory.h b/include/asm-arm/arch-nexuspci/memory.h
index 89423f082..85d7c4505 100644
--- a/include/asm-arm/arch-nexuspci/memory.h
+++ b/include/asm-arm/arch-nexuspci/memory.h
@@ -5,42 +5,19 @@
  * Copyright (c) 1999 Russell King
  *
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x40000000UL)
 #define BUS_OFFSET	(0xe0000000UL)
 
-/*
- * DRAM is contiguous
- */
-#define __virt_to_phys(vpage) ((unsigned long)(vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET - PHYS_OFFSET)
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-
 /*
  * On the PCI bus the DRAM appears at address 0xe0000000
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x) ((unsigned long)(x) - PAGE_OFFSET + BUS_OFFSET)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x) ((unsigned long)(x) + PAGE_OFFSET - BUS_OFFSET)
 
 #endif
diff --git a/include/asm-arm/arch-omap/board-innovator.h b/include/asm-arm/arch-omap/board-innovator.h
index beb50550f..50671ba47 100644
--- a/include/asm-arm/arch-omap/board-innovator.h
+++ b/include/asm-arm/arch-omap/board-innovator.h
@@ -33,74 +33,74 @@
  *  OMAP-1510 FPGA
  * ---------------------------------------------------------------------------
  */
-#define OMAP1510P1_FPGA_BASE			0xE8000000	/* Virtual */
-#define OMAP1510P1_FPGA_SIZE			SZ_4K
-#define OMAP1510P1_FPGA_START			0x08000000	/* Physical */
+#define OMAP1510_FPGA_BASE			0xE8000000	/* Virtual */
+#define OMAP1510_FPGA_SIZE			SZ_4K
+#define OMAP1510_FPGA_START			0x08000000	/* Physical */
 
 /* Revision */
-#define OMAP1510P1_FPGA_REV_LOW			(OMAP1510P1_FPGA_BASE + 0x0)
-#define OMAP1510P1_FPGA_REV_HIGH		(OMAP1510P1_FPGA_BASE + 0x1)
+#define OMAP1510_FPGA_REV_LOW			(OMAP1510_FPGA_BASE + 0x0)
+#define OMAP1510_FPGA_REV_HIGH			(OMAP1510_FPGA_BASE + 0x1)
 
-#define OMAP1510P1_FPGA_LCD_PANEL_CONTROL	(OMAP1510P1_FPGA_BASE + 0x2)
-#define OMAP1510P1_FPGA_LED_DIGIT		(OMAP1510P1_FPGA_BASE + 0x3)
-#define INNOVATOR_FPGA_HID_SPI			(OMAP1510P1_FPGA_BASE + 0x4)
-#define OMAP1510P1_FPGA_POWER			(OMAP1510P1_FPGA_BASE + 0x5)
+#define OMAP1510_FPGA_LCD_PANEL_CONTROL		(OMAP1510_FPGA_BASE + 0x2)
+#define OMAP1510_FPGA_LED_DIGIT			(OMAP1510_FPGA_BASE + 0x3)
+#define INNOVATOR_FPGA_HID_SPI			(OMAP1510_FPGA_BASE + 0x4)
+#define OMAP1510_FPGA_POWER			(OMAP1510_FPGA_BASE + 0x5)
 
 /* Interrupt status */
-#define OMAP1510P1_FPGA_ISR_LO			(OMAP1510P1_FPGA_BASE + 0x6)
-#define OMAP1510P1_FPGA_ISR_HI			(OMAP1510P1_FPGA_BASE + 0x7)
+#define OMAP1510_FPGA_ISR_LO			(OMAP1510_FPGA_BASE + 0x6)
+#define OMAP1510_FPGA_ISR_HI			(OMAP1510_FPGA_BASE + 0x7)
 
 /* Interrupt mask */
-#define OMAP1510P1_FPGA_IMR_LO			(OMAP1510P1_FPGA_BASE + 0x8)
-#define OMAP1510P1_FPGA_IMR_HI			(OMAP1510P1_FPGA_BASE + 0x9)
+#define OMAP1510_FPGA_IMR_LO			(OMAP1510_FPGA_BASE + 0x8)
+#define OMAP1510_FPGA_IMR_HI			(OMAP1510_FPGA_BASE + 0x9)
 
 /* Reset registers */
-#define OMAP1510P1_FPGA_HOST_RESET		(OMAP1510P1_FPGA_BASE + 0xa)
-#define OMAP1510P1_FPGA_RST			(OMAP1510P1_FPGA_BASE + 0xb)
-
-#define OMAP1510P1_FPGA_AUDIO			(OMAP1510P1_FPGA_BASE + 0xc)
-#define OMAP1510P1_FPGA_DIP			(OMAP1510P1_FPGA_BASE + 0xe)
-#define OMAP1510P1_FPGA_FPGA_IO			(OMAP1510P1_FPGA_BASE + 0xf)
-#define OMAP1510P1_FPGA_UART1			(OMAP1510P1_FPGA_BASE + 0x14)
-#define OMAP1510P1_FPGA_UART2			(OMAP1510P1_FPGA_BASE + 0x15)
-#define OMAP1510P1_FPGA_OMAP1510_STATUS		(OMAP1510P1_FPGA_BASE + 0x16)
-#define OMAP1510P1_FPGA_BOARD_REV		(OMAP1510P1_FPGA_BASE + 0x18)
-#define OMAP1510P1_PPT_DATA			(OMAP1510P1_FPGA_BASE + 0x100)
-#define OMAP1510P1_PPT_STATUS			(OMAP1510P1_FPGA_BASE + 0x101)
-#define OMAP1510P1_PPT_CONTROL			(OMAP1510P1_FPGA_BASE + 0x102)
-
-#define OMAP1510P1_FPGA_TOUCHSCREEN		(OMAP1510P1_FPGA_BASE + 0x204)
-
-#define INNOVATOR_FPGA_INFO			(OMAP1510P1_FPGA_BASE + 0x205)
-#define INNOVATOR_FPGA_LCD_BRIGHT_LO		(OMAP1510P1_FPGA_BASE + 0x206)
-#define INNOVATOR_FPGA_LCD_BRIGHT_HI		(OMAP1510P1_FPGA_BASE + 0x207)
-#define INNOVATOR_FPGA_LED_GRN_LO		(OMAP1510P1_FPGA_BASE + 0x208)
-#define INNOVATOR_FPGA_LED_GRN_HI		(OMAP1510P1_FPGA_BASE + 0x209)
-#define INNOVATOR_FPGA_LED_RED_LO		(OMAP1510P1_FPGA_BASE + 0x20a)
-#define INNOVATOR_FPGA_LED_RED_HI		(OMAP1510P1_FPGA_BASE + 0x20b)
-#define INNOVATOR_FPGA_CAM_USB_CONTROL		(OMAP1510P1_FPGA_BASE + 0x20c)
-#define INNOVATOR_FPGA_EXP_CONTROL		(OMAP1510P1_FPGA_BASE + 0x20d)
-#define INNOVATOR_FPGA_ISR2			(OMAP1510P1_FPGA_BASE + 0x20e)
-#define INNOVATOR_FPGA_IMR2			(OMAP1510P1_FPGA_BASE + 0x210)
-
-#define OMAP1510P1_FPGA_ETHR_START		(OMAP1510P1_FPGA_START + 0x300)
-#define OMAP1510P1_FPGA_ETHR_BASE		(OMAP1510P1_FPGA_BASE + 0x300)
+#define OMAP1510_FPGA_HOST_RESET		(OMAP1510_FPGA_BASE + 0xa)
+#define OMAP1510_FPGA_RST			(OMAP1510_FPGA_BASE + 0xb)
+
+#define OMAP1510_FPGA_AUDIO			(OMAP1510_FPGA_BASE + 0xc)
+#define OMAP1510_FPGA_DIP			(OMAP1510_FPGA_BASE + 0xe)
+#define OMAP1510_FPGA_FPGA_IO			(OMAP1510_FPGA_BASE + 0xf)
+#define OMAP1510_FPGA_UART1			(OMAP1510_FPGA_BASE + 0x14)
+#define OMAP1510_FPGA_UART2			(OMAP1510_FPGA_BASE + 0x15)
+#define OMAP1510_FPGA_OMAP1510_STATUS		(OMAP1510_FPGA_BASE + 0x16)
+#define OMAP1510_FPGA_BOARD_REV			(OMAP1510_FPGA_BASE + 0x18)
+#define OMAP1510P1_PPT_DATA			(OMAP1510_FPGA_BASE + 0x100)
+#define OMAP1510P1_PPT_STATUS			(OMAP1510_FPGA_BASE + 0x101)
+#define OMAP1510P1_PPT_CONTROL			(OMAP1510_FPGA_BASE + 0x102)
+
+#define OMAP1510_FPGA_TOUCHSCREEN		(OMAP1510_FPGA_BASE + 0x204)
+
+#define INNOVATOR_FPGA_INFO			(OMAP1510_FPGA_BASE + 0x205)
+#define INNOVATOR_FPGA_LCD_BRIGHT_LO		(OMAP1510_FPGA_BASE + 0x206)
+#define INNOVATOR_FPGA_LCD_BRIGHT_HI		(OMAP1510_FPGA_BASE + 0x207)
+#define INNOVATOR_FPGA_LED_GRN_LO		(OMAP1510_FPGA_BASE + 0x208)
+#define INNOVATOR_FPGA_LED_GRN_HI		(OMAP1510_FPGA_BASE + 0x209)
+#define INNOVATOR_FPGA_LED_RED_LO		(OMAP1510_FPGA_BASE + 0x20a)
+#define INNOVATOR_FPGA_LED_RED_HI		(OMAP1510_FPGA_BASE + 0x20b)
+#define INNOVATOR_FPGA_CAM_USB_CONTROL		(OMAP1510_FPGA_BASE + 0x20c)
+#define INNOVATOR_FPGA_EXP_CONTROL		(OMAP1510_FPGA_BASE + 0x20d)
+#define INNOVATOR_FPGA_ISR2			(OMAP1510_FPGA_BASE + 0x20e)
+#define INNOVATOR_FPGA_IMR2			(OMAP1510_FPGA_BASE + 0x210)
+
+#define OMAP1510_FPGA_ETHR_START		(OMAP1510_FPGA_START + 0x300)
+#define OMAP1510_FPGA_ETHR_BASE			(OMAP1510_FPGA_BASE + 0x300)
 
 /*
  * Power up Giga UART driver, turn on HID clock.
  * Turn off BT power, since we're not using it and it
  * draws power.
  */
-#define OMAP1510P1_FPGA_RESET_VALUE		0x42
-
-#define OMAP1510P1_FPGA_PCR_IF_PD0		(1 << 7)
-#define OMAP1510P1_FPGA_PCR_COM2_EN		(1 << 6)
-#define OMAP1510P1_FPGA_PCR_COM1_EN		(1 << 5)
-#define OMAP1510P1_FPGA_PCR_EXP_PD0		(1 << 4)
-#define OMAP1510P1_FPGA_PCR_EXP_PD1		(1 << 3)
-#define OMAP1510P1_FPGA_PCR_48MHZ_CLK		(1 << 2)
-#define OMAP1510P1_FPGA_PCR_4MHZ_CLK		(1 << 1)
-#define OMAP1510P1_FPGA_PCR_RSRVD_BIT0		(1 << 0)
+#define OMAP1510_FPGA_RESET_VALUE		0x42
+
+#define OMAP1510_FPGA_PCR_IF_PD0		(1 << 7)
+#define OMAP1510_FPGA_PCR_COM2_EN		(1 << 6)
+#define OMAP1510_FPGA_PCR_COM1_EN		(1 << 5)
+#define OMAP1510_FPGA_PCR_EXP_PD0		(1 << 4)
+#define OMAP1510_FPGA_PCR_EXP_PD1		(1 << 3)
+#define OMAP1510_FPGA_PCR_48MHZ_CLK		(1 << 2)
+#define OMAP1510_FPGA_PCR_4MHZ_CLK		(1 << 1)
+#define OMAP1510_FPGA_PCR_RSRVD_BIT0		(1 << 0)
 
 /*
  * Innovator/OMAP1510 FPGA HID register bit definitions
diff --git a/include/asm-arm/arch-omap/bus.h b/include/asm-arm/arch-omap/bus.h
index ff3594797..afb61f8ea 100644
--- a/include/asm-arm/arch-omap/bus.h
+++ b/include/asm-arm/arch-omap/bus.h
@@ -72,8 +72,12 @@ struct omap_driver {
  * Device ID numbers for bus types
  */
 #define OMAP_OCP_DEVID_USB	0
+
+#define OMAP_TIPB_DEVID_OHCI	0
 #define OMAP_TIPB_DEVID_LCD	1
 #define OMAP_TIPB_DEVID_MMC	2
+#define OMAP_TIPB_DEVID_OTG	3
+#define OMAP_TIPB_DEVID_UDC	4
 
 /*
  * Virtual bus definitions for OMAP
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
index 2c67bebf6..bf87b3a56 100644
--- a/include/asm-arm/arch-omap/dma.h
+++ b/include/asm-arm/arch-omap/dma.h
@@ -33,10 +33,10 @@
 #define OMAP_DMA_EXT_NDMA_REQ		5
 #define OMAP_DMA_EXT_NDMA_REQ2		6
 #define OMAP_DMA_UWIRE_TX		7
-#define OMAP_DMA_MCBSP1_DMA_TX		8
-#define OMAP_DMA_MCBSP1_DMA_RX		9
-#define OMAP_DMA_MCBSP3_DMA_TX		10
-#define OMAP_DMA_MCBSP3_DMA_RX		11
+#define OMAP_DMA_MCBSP1_TX		8
+#define OMAP_DMA_MCBSP1_RX		9
+#define OMAP_DMA_MCBSP3_TX		10
+#define OMAP_DMA_MCBSP3_RX		11
 #define OMAP_DMA_UART1_TX		12
 #define OMAP_DMA_UART1_RX		13
 #define OMAP_DMA_UART2_TX		14
@@ -86,75 +86,77 @@
 #define OMAP_DMA_CRYPTO_DES_OUT		56
 
 
-#define OMAP_DMA_BASE			0xfffed800
-#define OMAP_DMA_GCR_REG		(OMAP_DMA_BASE + 0x400)
-#define OMAP_DMA_GSCR_REG		(OMAP_DMA_BASE + 0x404)
-#define OMAP_DMA_GRST_REG		(OMAP_DMA_BASE + 0x408)
-#define OMAP_DMA_HW_ID_REG		(OMAP_DMA_BASE + 0x442)
-#define OMAP_DMA_PCH2_ID_REG		(OMAP_DMA_BASE + 0x444)
+#define OMAP_DMA_BASE			(0xfffed800)
+#define OMAP_DMA_GCR			(OMAP_DMA_BASE + 0x400)
+#define OMAP_DMA_GSCR			(OMAP_DMA_BASE + 0x404)
+#define OMAP_DMA_GRST			(OMAP_DMA_BASE + 0x408)
+#define OMAP_DMA_HW_ID			(OMAP_DMA_BASE + 0x442)
+#define OMAP_DMA_PCH2_ID		(OMAP_DMA_BASE + 0x444)
 #define OMAP_DMA_PCH0_ID		(OMAP_DMA_BASE + 0x446)
 #define OMAP_DMA_PCH1_ID		(OMAP_DMA_BASE + 0x448)
 #define OMAP_DMA_PCHG_ID		(OMAP_DMA_BASE + 0x44a)
 #define OMAP_DMA_PCHD_ID		(OMAP_DMA_BASE + 0x44c)
-#define OMAP_DMA_CAPS_0_U_REG		(OMAP_DMA_BASE + 0x44e)
-#define OMAP_DMA_CAPS_0_L_REG		(OMAP_DMA_BASE + 0x450)
-#define OMAP_DMA_CAPS_1_U_REG		(OMAP_DMA_BASE + 0x452)
-#define OMAP_DMA_CAPS_1_L_REG		(OMAP_DMA_BASE + 0x454)
-#define OMAP_DMA_CAPS_2_REG		(OMAP_DMA_BASE + 0x456)
-#define OMAP_DMA_CAPS_3_REG		(OMAP_DMA_BASE + 0x458)
-#define OMAP_DMA_CAPS_4_REG		(OMAP_DMA_BASE + 0x45a)
-#define OMAP_DMA_PCH2_SR_REG		(OMAP_DMA_BASE + 0x460)
-#define OMAP_DMA_PCH0_SR_REG		(OMAP_DMA_BASE + 0x480)
-#define OMAP_DMA_PCH1_SR_REG		(OMAP_DMA_BASE + 0x482)
-#define OMAP_DMA_PCHD_SR_REG		(OMAP_DMA_BASE + 0x4c0)
-
-#define OMAP1510_DMA_LCD_CTRL		0xfffedb00
-#define OMAP1510_DMA_LCD_TOP_F1_L	0xfffedb02
-#define OMAP1510_DMA_LCD_TOP_F1_U	0xfffedb04
-#define OMAP1510_DMA_LCD_BOT_F1_L	0xfffedb06
-#define OMAP1510_DMA_LCD_BOT_F1_U	0xfffedb08
-
-#define OMAP1610_DMA_LCD_CSDP		0xfffee3c0
-#define OMAP1610_DMA_LCD_CCR		0xfffee3c2
-#define OMAP1610_DMA_LCD_CTRL		0xfffee3c4
-#define OMAP1610_DMA_LCD_TOP_B1_L	0xfffee3c8
-#define OMAP1610_DMA_LCD_TOP_B1_U	0xfffee3ca
-#define OMAP1610_DMA_LCD_BOT_B1_L	0xfffee3cc
-#define OMAP1610_DMA_LCD_BOT_B1_U	0xfffee3ce
-#define OMAP1610_DMA_LCD_TOP_B2_L	0xfffee3d0
-#define OMAP1610_DMA_LCD_TOP_B2_U	0xfffee3d2
-#define OMAP1610_DMA_LCD_BOT_B2_L	0xfffee3d4
-#define OMAP1610_DMA_LCD_BOT_B2_U	0xfffee3d6
-#define OMAP1610_DMA_LCD_SRC_EI_B1	0xfffee3d8
-#define OMAP1610_DMA_LCD_SRC_FI_B1_L	0xfffee3da
-#define OMAP1610_DMA_LCD_SRC_EN_B1	0xfffee3e0
-#define OMAP1610_DMA_LCD_SRC_FN_B1	0xfffee3e4
-#define OMAP1610_DMA_LCD_LCH_CTRL	0xfffee3ea
-#define OMAP1610_DMA_LCD_SRC_FI_B1_U	0xfffee3f4
+#define OMAP_DMA_CAPS_0_U		(OMAP_DMA_BASE + 0x44e)
+#define OMAP_DMA_CAPS_0_L		(OMAP_DMA_BASE + 0x450)
+#define OMAP_DMA_CAPS_1_U		(OMAP_DMA_BASE + 0x452)
+#define OMAP_DMA_CAPS_1_L		(OMAP_DMA_BASE + 0x454)
+#define OMAP_DMA_CAPS_2			(OMAP_DMA_BASE + 0x456)
+#define OMAP_DMA_CAPS_3			(OMAP_DMA_BASE + 0x458)
+#define OMAP_DMA_CAPS_4			(OMAP_DMA_BASE + 0x45a)
+#define OMAP_DMA_PCH2_SR		(OMAP_DMA_BASE + 0x460)
+#define OMAP_DMA_PCH0_SR		(OMAP_DMA_BASE + 0x480)
+#define OMAP_DMA_PCH1_SR		(OMAP_DMA_BASE + 0x482)
+#define OMAP_DMA_PCHD_SR		(OMAP_DMA_BASE + 0x4c0)
+
+#define OMAP1510_DMA_LCD_BASE		(0xfffedb00)
+#define OMAP1510_DMA_LCD_CTRL		(OMAP1510_DMA_LCD_BASE + 0x00)
+#define OMAP1510_DMA_LCD_TOP_F1_L	(OMAP1510_DMA_LCD_BASE + 0x02)
+#define OMAP1510_DMA_LCD_TOP_F1_U	(OMAP1510_DMA_LCD_BASE + 0x04)
+#define OMAP1510_DMA_LCD_BOT_F1_L	(OMAP1510_DMA_LCD_BASE + 0x06)
+#define OMAP1510_DMA_LCD_BOT_F1_U	(OMAP1510_DMA_LCD_BASE + 0x08)
+
+#define OMAP1610_DMA_LCD_BASE		(0xfffee300)
+#define OMAP1610_DMA_LCD_CSDP      	(OMAP1610_DMA_LCD_BASE + 0xc0)
+#define OMAP1610_DMA_LCD_CCR		(OMAP1610_DMA_LCD_BASE + 0xc2)
+#define OMAP1610_DMA_LCD_CTRL		(OMAP1610_DMA_LCD_BASE + 0xc4)
+#define OMAP1610_DMA_LCD_TOP_B1_L	(OMAP1610_DMA_LCD_BASE + 0xc8)
+#define OMAP1610_DMA_LCD_TOP_B1_U	(OMAP1610_DMA_LCD_BASE + 0xca)
+#define OMAP1610_DMA_LCD_BOT_B1_L	(OMAP1610_DMA_LCD_BASE + 0xcc)
+#define OMAP1610_DMA_LCD_BOT_B1_U	(OMAP1610_DMA_LCD_BASE + 0xce)
+#define OMAP1610_DMA_LCD_TOP_B2_L	(OMAP1610_DMA_LCD_BASE + 0xd0)
+#define OMAP1610_DMA_LCD_TOP_B2_U	(OMAP1610_DMA_LCD_BASE + 0xd2)
+#define OMAP1610_DMA_LCD_BOT_B2_L	(OMAP1610_DMA_LCD_BASE + 0xd4)
+#define OMAP1610_DMA_LCD_BOT_B2_U	(OMAP1610_DMA_LCD_BASE + 0xd6)
+#define OMAP1610_DMA_LCD_SRC_EI_B1	(OMAP1610_DMA_LCD_BASE + 0xd8)
+#define OMAP1610_DMA_LCD_SRC_FI_B1_L	(OMAP1610_DMA_LCD_BASE + 0xda)
+#define OMAP1610_DMA_LCD_SRC_EN_B1	(OMAP1610_DMA_LCD_BASE + 0xe0)
+#define OMAP1610_DMA_LCD_SRC_FN_B1	(OMAP1610_DMA_LCD_BASE + 0xe4)
+#define OMAP1610_DMA_LCD_LCH_CTRL	(OMAP1610_DMA_LCD_BASE + 0xea)
+#define OMAP1610_DMA_LCD_SRC_FI_B1_U	(OMAP1610_DMA_LCD_BASE + 0xf4)
 
 
 /* Every LCh has its own set of the registers below */
-#define OMAP_DMA_CSDP_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x00)
-#define OMAP_DMA_CCR_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x02)
-#define OMAP_DMA_CICR_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x04)
-#define OMAP_DMA_CSR_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x06)
-#define OMAP_DMA_CSSA_L_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x08)
-#define OMAP_DMA_CSSA_U_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x0a)
-#define OMAP_DMA_CDSA_L_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x0c)
-#define OMAP_DMA_CDSA_U_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x0e)
-#define OMAP_DMA_CEN_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x10)
-#define OMAP_DMA_CFN_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x12)
-#define OMAP_DMA_CSFI_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x14)
-#define OMAP_DMA_CSEI_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x16)
-#define OMAP_DMA_CSAC_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x18)
-#define OMAP_DMA_CDAC_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x1a)
-#define OMAP_DMA_CDEI_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x1c)
-#define OMAP_DMA_CDFI_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x1e)
-#define OMAP_DMA_COLOR_L_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x20)
-#define OMAP_DMA_COLOR_U_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x22)
-#define OMAP_DMA_CCR2_REG(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x24)
-#define OMAP_DMA_CLNK_CTRL_REG(n)	(OMAP_DMA_BASE + 0x40 * (n) + 0x28)
-#define OMAP_DMA_LCH_CTRL_REG(n)	(OMAP_DMA_BASE + 0x40 * (n) + 0x2a)
+#define OMAP_DMA_CSDP(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x00)
+#define OMAP_DMA_CCR(n)			(OMAP_DMA_BASE + 0x40 * (n) + 0x02)
+#define OMAP_DMA_CICR(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x04)
+#define OMAP_DMA_CSR(n)			(OMAP_DMA_BASE + 0x40 * (n) + 0x06)
+#define OMAP_DMA_CSSA_L(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x08)
+#define OMAP_DMA_CSSA_U(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x0a)
+#define OMAP_DMA_CDSA_L(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x0c)
+#define OMAP_DMA_CDSA_U(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x0e)
+#define OMAP_DMA_CEN(n)			(OMAP_DMA_BASE + 0x40 * (n) + 0x10)
+#define OMAP_DMA_CFN(n)			(OMAP_DMA_BASE + 0x40 * (n) + 0x12)
+#define OMAP_DMA_CSFI(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x14)
+#define OMAP_DMA_CSEI(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x16)
+#define OMAP_DMA_CSAC(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x18)
+#define OMAP_DMA_CDAC(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x1a)
+#define OMAP_DMA_CDEI(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x1c)
+#define OMAP_DMA_CDFI(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x1e)
+#define OMAP_DMA_COLOR_L(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x20)
+#define OMAP_DMA_COLOR_U(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x22)
+#define OMAP_DMA_CCR2(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x24)
+#define OMAP_DMA_CLNK_CTRL(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x28)
+#define OMAP_DMA_LCH_CTRL(n)		(OMAP_DMA_BASE + 0x40 * (n) + 0x2a)
 
 #define OMAP_DMA_TOUT_IRQ		(1 << 0)
 #define OMAP_DMA_DROP_IRQ		(1 << 1)
@@ -192,6 +194,11 @@ enum {
 	OMAP_LCD_DMA_B2_BOTTOM
 };
 
+enum {
+	OMAP_DMA_DATA_BURST_4,
+	OMAP_DMA_DATA_BURST_8
+};
+
 extern int omap_request_dma(int dev_id, const char *dev_name,
 			    void (* callback)(int lch, u16 ch_status, void *data),
 			    void *data, int *dma_ch);
@@ -203,10 +210,23 @@ extern void omap_stop_dma(int lch);
 extern void omap_set_dma_transfer_params(int lch, int data_type,
 					 int elem_count, int frame_count,
 					 int sync_mode);
+extern void omap_set_dma_constant_fill(int lch, u32 color);
+extern void omap_set_dma_transparent_copy(int lch, u32 color);
+
 extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
 				    unsigned long src_start);
+extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
+extern void omap_set_dma_src_data_pack(int lch, int enable);
+extern void omap_set_dma_src_burst_mode(int lch, int burst_mode);
+
 extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
 				     unsigned long dest_start);
+extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
+extern void omap_set_dma_dest_data_pack(int lch, int enable);
+extern void omap_set_dma_dest_burst_mode(int lch, int burst_mode);
+
+extern void omap_dma_link_lch (int lch_head, int lch_queue);
+extern void omap_dma_unlink_lch (int lch_head, int lch_queue);
 
 /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
 extern int omap_dma_in_1510_mode(void);
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
index d54e36cf6..3b1680dbb 100644
--- a/include/asm-arm/arch-omap/gpio.h
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -32,18 +32,18 @@
 
 #define OMAP_MPUIO_BASE			0xfffb5000
 #define OMAP_MPUIO_INPUT_LATCH		0x00
-#define OMAP_MPUIO_OUTPUT_REG		0x04
+#define OMAP_MPUIO_OUTPUT		0x04
 #define OMAP_MPUIO_IO_CNTL		0x08
 #define OMAP_MPUIO_KBR_LATCH		0x10
-#define OMAP_MPUIO_KBC_REG		0x14
-#define OMAP_MPUIO_GPIO_EVENT_MODE_REG	0x18
-#define OMAP_MPUIO_GPIO_INT_EDGE_REG	0x1c
+#define OMAP_MPUIO_KBC			0x14
+#define OMAP_MPUIO_GPIO_EVENT_MODE	0x18
+#define OMAP_MPUIO_GPIO_INT_EDGE	0x1c
 #define OMAP_MPUIO_KBD_INT		0x20
 #define OMAP_MPUIO_GPIO_INT		0x24
 #define OMAP_MPUIO_KBD_MASKIT		0x28
 #define OMAP_MPUIO_GPIO_MASKIT		0x2c
-#define OMAP_MPUIO_GPIO_DEBOUNCING_REG	0x30
-#define OMAP_MPUIO_LATCH_REG		0x34
+#define OMAP_MPUIO_GPIO_DEBOUNCING	0x30
+#define OMAP_MPUIO_LATCH		0x34
 
 #define OMAP_MPUIO(nr)		(OMAP_MAX_GPIO_LINES + (nr))
 #define OMAP_GPIO_IS_MPUIO(nr)	((nr) >= OMAP_MAX_GPIO_LINES)
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
index 826539d69..348072bc4 100644
--- a/include/asm-arm/arch-omap/hardware.h
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -10,6 +10,7 @@
  * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
  *
  * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
+ *                          and Dirk Behme <dirk.behme@de.bosch.com>
  *
  * 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
@@ -40,50 +41,7 @@
 #ifndef __ASSEMBLER__
 #include <asm/types.h>
 #endif
-#include <asm/mach-types.h>
-
-/*
- * ----------------------------------------------------------------------------
- * I/O mapping
- * ----------------------------------------------------------------------------
- */
-#define IO_PHYS			0xFFFB0000
-#define IO_OFFSET		0x01000000	/* Virtual IO = 0xfefb0000 */
-#define IO_VIRT			(IO_PHYS - IO_OFFSET)
-#define IO_SIZE			0x40000
-#define IO_ADDRESS(x)		((x) - IO_OFFSET)
-
-#define PCIO_BASE		0
-
-#define io_p2v(x)               ((x) - IO_OFFSET)
-#define io_v2p(x)               ((x) + IO_OFFSET)
-
-#ifndef __ASSEMBLER__
-
-/* 16 bit uses LDRH/STRH, base +/- offset_8 */
-typedef struct { volatile u16 offset[256]; } __regbase16;
-#define __REGV16(vaddr)		((__regbase16 *)((vaddr)&~0xff)) \
-					->offset[((vaddr)&0xff)>>1]
-#define __REG16(paddr)          __REGV16(io_p2v(paddr))
-
-/* 8/32 bit uses LDR/STR, base +/- offset_12 */
-typedef struct { volatile u8 offset[4096]; } __regbase8;
-#define __REGV8(vaddr)		((__regbase8  *)((paddr)&~4095)) \
-					->offset[((paddr)&4095)>>0]
-#define __REG8(paddr)		__REGV8(io_p2v(paddr))
-
-typedef struct { volatile u32 offset[4096]; } __regbase32;
-#define __REGV32(vaddr)		((__regbase32 *)((vaddr)&~4095)) \
-					->offset[((vaddr)&4095)>>2]
-#define __REG32(paddr)		__REGV32(io_p2v(paddr))
-
-#else
-
-#define __REG8(paddr)		io_p2v(paddr)
-#define __REG16(paddr)		io_p2v(paddr)
-#define __REG32(paddr)		io_p2v(paddr)
-
-#endif
+#include <asm/arch/io.h>
 
 /*
  * ---------------------------------------------------------------------------
@@ -98,14 +56,14 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
  * Clocks
  * ----------------------------------------------------------------------------
  */
-#define CLKGEN_RESET_BASE	(0xfffece00)
-#define ARM_CKCTL		(CLKGEN_RESET_BASE + 0x0)
-#define ARM_IDLECT1		(CLKGEN_RESET_BASE + 0x4)
-#define ARM_IDLECT2		(CLKGEN_RESET_BASE + 0x8)
-#define ARM_EWUPCT		(CLKGEN_RESET_BASE + 0xC)
-#define ARM_RSTCT1		(CLKGEN_RESET_BASE + 0x10)
-#define ARM_RSTCT2		(CLKGEN_RESET_BASE + 0x14)
-#define ARM_SYSST		(CLKGEN_RESET_BASE + 0x18)
+#define CLKGEN_REG_BASE		(0xfffece00)
+#define ARM_CKCTL		(CLKGEN_REG_BASE + 0x0)
+#define ARM_IDLECT1		(CLKGEN_REG_BASE + 0x4)
+#define ARM_IDLECT2		(CLKGEN_REG_BASE + 0x8)
+#define ARM_EWUPCT		(CLKGEN_REG_BASE + 0xC)
+#define ARM_RSTCT1		(CLKGEN_REG_BASE + 0x10)
+#define ARM_RSTCT2		(CLKGEN_REG_BASE + 0x14)
+#define ARM_SYSST		(CLKGEN_REG_BASE + 0x18)
 
 #define CK_RATEF		1
 #define CK_IDLEF		2
@@ -114,19 +72,27 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
 #define SETARM_IDLE_SHIFT
 
 /* DPLL control registers */
-#define DPLL_CTL_REG		(0xfffecf00)
-#define CK_DPLL1		(0xfffecf00)
+#define DPLL_CTL		(0xfffecf00)
+
+/* DSP clock control */
+#define DSP_CONFIG_REG_BASE     (0xe1008000)
+#define DSP_IDLECT1		(DSP_CONFIG_REG_BASE + 0x4)
+#define DSP_IDLECT2		(DSP_CONFIG_REG_BASE + 0x8)
 
-/* ULPD */
+/*
+ * ---------------------------------------------------------------------------
+ * UPLD
+ * ---------------------------------------------------------------------------
+ */
 #define ULPD_REG_BASE		(0xfffe0800)
-#define ULPD_IT_STATUS_REG	(ULPD_REG_BASE + 0x14)
-#define ULPD_CLOCK_CTRL_REG	(ULPD_REG_BASE + 0x30)
-#define ULPD_SOFT_REQ_REG	(ULPD_REG_BASE + 0x34)
-#define ULPD_DPLL_CTRL_REG	(ULPD_REG_BASE + 0x3c)
-#define ULPD_STATUS_REQ_REG	(ULPD_REG_BASE + 0x40)
-#define ULPD_APLL_CTRL_REG	(ULPD_REG_BASE + 0x4c)
-#define ULPD_POWER_CTRL_REG	(ULPD_REG_BASE + 0x50)
-#define ULPD_CAM_CLK_CTRL_REG	(ULPD_REG_BASE + 0x7c)
+#define ULPD_IT_STATUS		(ULPD_REG_BASE + 0x14)
+#define ULPD_CLOCK_CTRL		(ULPD_REG_BASE + 0x30)
+#define ULPD_SOFT_REQ		(ULPD_REG_BASE + 0x34)
+#define ULPD_DPLL_CTRL		(ULPD_REG_BASE + 0x3c)
+#define ULPD_STATUS_REQ		(ULPD_REG_BASE + 0x40)
+#define ULPD_APLL_CTRL		(ULPD_REG_BASE + 0x4c)
+#define ULPD_POWER_CTRL		(ULPD_REG_BASE + 0x50)
+#define ULPD_CAM_CLK_CTRL	(ULPD_REG_BASE + 0x7c)
 
 /*
  * ---------------------------------------------------------------------------
@@ -147,18 +113,24 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
 #define TIMER32k_ARL		(1<<3)
 
 /* MPU Timer base addresses */
-#define OMAP_MPUTIMER_BASE	0xfffec500
-#define OMAP_MPUTIMER_OFF	0x00000100
-
-#define OMAP_TIMER1_BASE	0xfffec500
-#define OMAP_TIMER2_BASE	0xfffec600
-#define OMAP_TIMER3_BASE	0xfffec700
-#define OMAP_WATCHDOG_BASE	0xfffec800
+#define OMAP_TIMER1_BASE	(0xfffec500)
+#define OMAP_TIMER2_BASE	(0xfffec600)
+#define OMAP_TIMER3_BASE	(0xfffec700)
+#define OMAP_MPUTIMER_BASE	OMAP_TIMER1_BASE
+#define OMAP_MPUTIMER_OFFSET	0x100
 
 /* MPU Timer Registers */
-#define CNTL_TIMER		0
-#define LOAD_TIM		4
-#define READ_TIM		8
+#define OMAP_TIMER1_CNTL	(OMAP_TIMER_BASE1 + 0x0)
+#define OMAP_TIMER1_LOAD_TIM	(OMAP_TIMER_BASE1 + 0x4)
+#define OMAP_TIMER1_READ_TIM	(OMAP_TIMER_BASE1 + 0x8)
+
+#define OMAP_TIMER2_CNTL	(OMAP_TIMER_BASE2 + 0x0)
+#define OMAP_TIMER2_LOAD_TIM	(OMAP_TIMER_BASE2 + 0x4)
+#define OMAP_TIMER2_READ_TIM	(OMAP_TIMER_BASE2 + 0x8)
+
+#define OMAP_TIMER3_CNTL	(OMAP_TIMER_BASE3 + 0x0)
+#define OMAP_TIMER3_LOAD_TIM	(OMAP_TIMER_BASE3 + 0x4)
+#define OMAP_TIMER3_READ_TIM	(OMAP_TIMER_BASE3 + 0x8)
 
 /* CNTL_TIMER register bits */
 #define MPUTIM_FREE		(1<<6)
@@ -168,6 +140,13 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
 #define MPUTIM_AR		(1<<1)
 #define MPUTIM_ST		(1<<0)
 
+/* Watchdog */
+#define OMAP_WATCHDOG_BASE	(0xfffec800)
+#define OMAP_WDT_TIMER		(OMAP_WATCHDOG_BASE + 0x0)
+#define OMAP_WDT_LOAD_TIM	(OMAP_WATCHDOG_BASE + 0x4)
+#define OMAP_WDT_READ_TIM	(OMAP_WATCHDOG_BASE + 0x4)
+#define OMAP_WDT_TIMER_MODE	(OMAP_WATCHDOG_BASE + 0x8)
+
 /*
  * ---------------------------------------------------------------------------
  * Interrupts
@@ -175,22 +154,30 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
  */
 #define OMAP_IH1_BASE		0xfffecb00
 #define OMAP_IH2_BASE		0xfffe0000
-#define OMAP_ITR		0x0
-#define OMAP_MASK		0x4
-
-#define IRQ_ITR			0x00
-#define IRQ_MIR			0x04
-#define IRQ_SIR_IRQ		0x10
-#define IRQ_SIR_FIQ		0x14
-#define IRQ_CONTROL_REG		0x18
-#define IRQ_ISR			0x9c
-#define IRQ_ILR0		0x1c
-
-/* OMAP-1610 specific interrupt handler registers */
-#define OMAP_IH2_SECT1		(OMAP_IH2_BASE)
-#define OMAP_IH2_SECT2		(OMAP_IH2_BASE + 0x100)
-#define OMAP_IH2_SECT3		(OMAP_IH2_BASE + 0x200)
-#define OMAP_IH2_SECT4		(OMAP_IH2_BASE + 0x300)
+
+#define OMAP_IH1_ITR		(OMAP_IH1_BASE + 0x00)
+#define OMAP_IH1_MIR		(OMAP_IH1_BASE + 0x04)
+#define OMAP_IH1_SIR_IRQ	(OMAP_IH1_BASE + 0x10)
+#define OMAP_IH1_SIR_FIQ	(OMAP_IH1_BASE + 0x14)
+#define OMAP_IH1_CONTROL	(OMAP_IH1_BASE + 0x18)
+#define OMAP_IH1_ILR0		(OMAP_IH1_BASE + 0x1c)
+#define OMAP_IH1_ISR		(OMAP_IH1_BASE + 0x9c)
+
+#define OMAP_IH2_ITR		(OMAP_IH2_BASE + 0x00)
+#define OMAP_IH2_MIR		(OMAP_IH2_BASE + 0x04)
+#define OMAP_IH2_SIR_IRQ	(OMAP_IH2_BASE + 0x10)
+#define OMAP_IH2_SIR_FIQ	(OMAP_IH2_BASE + 0x14)
+#define OMAP_IH2_CONTROL	(OMAP_IH2_BASE + 0x18)
+#define OMAP_IH2_ILR0		(OMAP_IH2_BASE + 0x1c)
+#define OMAP_IH2_ISR		(OMAP_IH2_BASE + 0x9c)
+
+#define IRQ_ITR_REG_OFFSET	0x00
+#define IRQ_MIR_REG_OFFSET	0x04
+#define IRQ_SIR_IRQ_REG_OFFSET	0x10
+#define IRQ_SIR_FIQ_REG_OFFSET	0x14
+#define IRQ_CONTROL_REG_OFFSET	0x18
+#define IRQ_ISR_REG_OFFSET	0x9c
+#define IRQ_ILR0_REG_OFFSET	0x1c
 
 /*
  * ---------------------------------------------------------------------------
@@ -199,9 +186,9 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
  */
 #define TCMIF_BASE		0xfffecc00
 #define IMIF_PRIO		(TCMIF_BASE + 0x00)
-#define EMIFS_PRIO_REG		(TCMIF_BASE + 0x04)
-#define EMIFF_PRIO_REG		(TCMIF_BASE + 0x08)
-#define EMIFS_CONFIG_REG	(TCMIF_BASE + 0x0c)
+#define EMIFS_PRIO		(TCMIF_BASE + 0x04)
+#define EMIFF_PRIO		(TCMIF_BASE + 0x08)
+#define EMIFS_CONFIG		(TCMIF_BASE + 0x0c)
 #define EMIFS_CS0_CONFIG	(TCMIF_BASE + 0x10)
 #define EMIFS_CS1_CONFIG	(TCMIF_BASE + 0x14)
 #define EMIFS_CS2_CONFIG	(TCMIF_BASE + 0x18)
@@ -214,7 +201,6 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
 #define TC_ENDIANISM		(TCMIF_BASE + 0x34)
 #define EMIFF_SDRAM_CONFIG_2	(TCMIF_BASE + 0x3c)
 #define EMIF_CFG_DYNAMIC_WS	(TCMIF_BASE + 0x40)
-
 /*
  * ----------------------------------------------------------------------------
  * System control registers
@@ -266,25 +252,24 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
  * ---------------------------------------------------------------------------
  */
 #define TIPB_PUBLIC_CNTL_BASE		0xfffed300
-#define MPU_PUBLIC_TIPB_CNTL_REG	(TIPB_PUBLIC_CNTL_BASE + 0x8)
+#define MPU_PUBLIC_TIPB_CNTL		(TIPB_PUBLIC_CNTL_BASE + 0x8)
 #define TIPB_PRIVATE_CNTL_BASE		0xfffeca00
-#define MPU_PRIVATE_TIPB_CNTL_REG	(TIPB_PRIVATE_CNTL_BASE + 0x8)
+#define MPU_PRIVATE_TIPB_CNTL		(TIPB_PRIVATE_CNTL_BASE + 0x8)
 
 /*
  * ----------------------------------------------------------------------------
- * DSP control registers
+ * MPUI interface
  * ----------------------------------------------------------------------------
  */
-/*  MPUI Interface Registers */
-#define MPUI_CTRL_REG		(0xfffec900)
-#define MPUI_DEBUG_ADDR		(0xfffec904)
-#define MPUI_DEBUG_DATA		(0xfffec908)
-#define MPUI_DEBUG_FLAG		(0xfffec90c)
-#define MPUI_STATUS_REG		(0xfffec910)
-#define MPUI_DSP_STATUS_REG	(0xfffec914)
-#define MPUI_DSP_BOOT_CONFIG	(0xfffec918)
-#define MPUI_DSP_API_CONFIG	(0xfffec91c)
-
+#define MPUI_BASE			(0xfffec900)
+#define MPUI_CTRL			(MPUI_BASE + 0x0)
+#define MPUI_DEBUG_ADDR			(MPUI_BASE + 0x4)
+#define MPUI_DEBUG_DATA			(MPUI_BASE + 0x8)
+#define MPUI_DEBUG_FLAG			(MPUI_BASE + 0xc)
+#define MPUI_STATUS_REG			(MPUI_BASE + 0x10)
+#define MPUI_DSP_STATUS			(MPUI_BASE + 0x14)
+#define MPUI_DSP_BOOT_CONFIG		(MPUI_BASE + 0x18)
+#define MPUI_DSP_API_CONFIG		(MPUI_BASE + 0x1c)
 
 #ifndef __ASSEMBLER__
 
@@ -293,28 +278,39 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
  * Processor differentiation
  * ---------------------------------------------------------------------------
  */
-#define OMAP_ID_REG		__REG32(0xfffed404)
+#define OMAP_ID_BASE		(0xfffed400)
+#define OMAP_ID_REG		__REG32(OMAP_ID_BASE +  0x04)
+
+#define ID_SHIFT		12
+#define ID_MASK			0x7fff
+
+/* See also uncompress.h */
+#define OMAP_ID_730		0x355F
+#define OMAP_ID_1510		0x3470
+#define OMAP_ID_1610		0x3576
+#define OMAP_ID_1710		0x35F7
+#define OMAP_ID_5912		0x358C
 
 #ifdef CONFIG_ARCH_OMAP730
 #include "omap730.h"
-#define cpu_is_omap730()	(((OMAP_ID_REG >> 12) & 0xffff) == 0xB55F)
+#define cpu_is_omap730()	(((OMAP_ID_REG >> ID_SHIFT) & ID_MASK) == OMAP_ID_730)
 #else
 #define cpu_is_omap730()	0
 #endif
 
 #ifdef CONFIG_ARCH_OMAP1510
 #include "omap1510.h"
-#define cpu_is_omap1510()	(((OMAP_ID_REG >> 12) & 0xffff) == 0xB470)
+#define cpu_is_omap1510()	(((OMAP_ID_REG >> ID_SHIFT) & ID_MASK) == OMAP_ID_1510)
 #else
 #define cpu_is_omap1510()	0
 #endif
 
 #ifdef CONFIG_ARCH_OMAP1610
 #include "omap1610.h"
-#define cpu_is_omap1710()       (((OMAP_ID_REG >> 12) & 0xffff) == 0xB5F7)
+#define cpu_is_omap1710()       (((OMAP_ID_REG >> ID_SHIFT) & ID_MASK) == OMAP_ID_1710)
 /* Detect 1710 as 1610 for now */
-#define cpu_is_omap1610()	(((OMAP_ID_REG >> 12) & 0xffff) == 0xB576 || \
-				 cpu_is_omap1710())
+#define cpu_is_omap1610()	(((OMAP_ID_REG >> ID_SHIFT) & ID_MASK) == OMAP_ID_1610 \
+				|| cpu_is_omap1710())
 #else
 #define cpu_is_omap1610()	0
 #define cpu_is_omap1710()	0
@@ -322,7 +318,7 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
 
 #ifdef CONFIG_ARCH_OMAP5912
 #include "omap5912.h"
-#define cpu_is_omap5912()	(((OMAP_ID_REG >> 12) & 0xffff) == 0xB58C)
+#define cpu_is_omap5912()	(((OMAP_ID_REG >> ID_SHIFT) & ID_MASK) == OMAP_ID_5912)
 #else
 #define cpu_is_omap5912()	0
 #endif
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 86c1cb3fb..6622ba31f 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -1,13 +1,36 @@
 /*
  * linux/include/asm-arm/arch-omap/io.h
  *
+ * IO definitions for TI OMAP processors and boards
+ *
  * Copied from linux/include/asm-arm/arch-sa1100/io.h
  * Copyright (C) 1997-1999 Russell King
  *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
  * Modifications:
  *  06-12-1997	RMK	Created.
  *  07-04-1999	RMK	Major cleanup
  */
+
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
@@ -21,6 +44,24 @@
 #define __mem_pci(a)		((unsigned long)(a))
 #define __mem_isa(a)		((unsigned long)(a))
 
+/*
+ * ----------------------------------------------------------------------------
+ * I/O mapping
+ * ----------------------------------------------------------------------------
+ */
+#define IO_PHYS			0xFFFB0000
+#define IO_OFFSET		0x01000000	/* Virtual IO = 0xfefb0000 */
+#define IO_VIRT			(IO_PHYS - IO_OFFSET)
+#define IO_SIZE			0x40000
+#define IO_ADDRESS(x)		((x) - IO_OFFSET)
+
+#define PCIO_BASE		0
+
+#define io_p2v(x)               ((x) - IO_OFFSET)
+#define io_v2p(x)               ((x) + IO_OFFSET)
+
+#ifndef __ASSEMBLER__
+
 /*
  * Functions to access the OMAP IO region
  *
@@ -38,4 +79,29 @@
 #define omap_writew(v,a)	(*(volatile unsigned short *)IO_ADDRESS(a) = (v))
 #define omap_writel(v,a)	(*(volatile unsigned int   *)IO_ADDRESS(a) = (v))
 
+/* 16 bit uses LDRH/STRH, base +/- offset_8 */
+typedef struct { volatile u16 offset[256]; } __regbase16;
+#define __REGV16(vaddr)		((__regbase16 *)((vaddr)&~0xff)) \
+					->offset[((vaddr)&0xff)>>1]
+#define __REG16(paddr)          __REGV16(io_p2v(paddr))
+
+/* 8/32 bit uses LDR/STR, base +/- offset_12 */
+typedef struct { volatile u8 offset[4096]; } __regbase8;
+#define __REGV8(vaddr)		((__regbase8  *)((vaddr)&~4095)) \
+					->offset[((vaddr)&4095)>>0]
+#define __REG8(paddr)		__REGV8(io_p2v(paddr))
+
+typedef struct { volatile u32 offset[4096]; } __regbase32;
+#define __REGV32(vaddr)		((__regbase32 *)((vaddr)&~4095)) \
+					->offset[((vaddr)&4095)>>2]
+#define __REG32(paddr)		__REGV32(io_p2v(paddr))
+
+#else
+
+#define __REG8(paddr)		io_p2v(paddr)
+#define __REG16(paddr)		io_p2v(paddr)
+#define __REG32(paddr)		io_p2v(paddr)
+
+#endif
+
 #endif
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h
index 71a8e2196..106af7555 100644
--- a/include/asm-arm/arch-omap/memory.h
+++ b/include/asm-arm/arch-omap/memory.h
@@ -30,25 +30,12 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE		(0xbf000000UL)
-#define TASK_SIZE_26		(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE	(0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET		(0xC0000000UL)
 #define PHYS_OFFSET		(0x10000000UL)
 
 /*
@@ -56,21 +43,11 @@
  */
 #define OMAP1510_LB_OFFSET	(0x30000000UL)
 
-/*
- * The DRAM is contiguous.
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-
 /*
  * Conversion between SDRAM and fake PCI bus, used by USB
  * NOTE: Physical address must be converted to Local Bus address
  *	 on OMAP-1510 only
  */
-#define __virt_to_bus__is_a_macro
-#define __bus_to_virt__is_a_macro
 
 /*
  * Bus address is physical address, except for OMAP-1510 Local Bus.
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index b1a0a6f9a..405395706 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -140,16 +140,20 @@ typedef enum {
 	R18_1510_USB_GPIO0,
 	W4_USB_PUEN,
 	W4_USB_CLKO,
+	W4_USB_HIGHZ,
+	W4_GPIO58,
 
 	/* USB1 master */
 	USB1_SUSP,
 	USB1_SEO,
+	W13_1610_USB1_SE0,
 	USB1_TXEN,
 	USB1_TXD,
 	USB1_VP,
 	USB1_VM,
 	USB1_RCV,
 	USB1_SPEED,
+	R13_1610_USB1_SPEED,
 
 	/* USB2 master */
 	USB2_SUSP,
@@ -216,6 +220,7 @@ typedef enum {
 	/* OMAP-1610 GPIO */
 	P20_1610_GPIO4,
 	V9_1610_GPIO7,
+	W8_1610_GPIO9,
 	N19_1610_GPIO13,
 	P10_1610_GPIO22,
 	V5_1610_GPIO24,
@@ -317,16 +322,20 @@ MUX_CFG("R18_USB_VBUS",		 7,    9,    2,	  1,  11,   0,	 NA,	 0,  1)
 MUX_CFG("R18_1510_USB_GPIO0",	 7,    9,    0,	  1,  11,   1,	 NA,	 0,  1)
 MUX_CFG("W4_USB_PUEN",		 D,    3,    0,	  3,   5,   1,	 NA,	 0,  1)
 MUX_CFG("W4_USB_CLKO",		 D,    3,    1,	  3,   5,   0,	 NA,	 0,  1)
+MUX_CFG("W4_USB_HIGHZ",		 D,    3,    4,	  3,   5,   0,	  3,	 0,  1)
+MUX_CFG("W4_GPIO58",		 D,    3,    7,	  3,   5,   0,	  3,	 0,  1)
 
 /* USB1 master */
 MUX_CFG("USB1_SUSP",		 8,   27,    2,	  1,  27,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_SE0",		 9,    0,    2,	  1,  28,   0,	 NA,	 0,  1)
+MUX_CFG("W13_1610_USB1_SE0",	 9,    0,    4,	  1,  28,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_TXEN",		 9,    3,    2,	  1,  29,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_TXD",		 9,   24,    1,	  2,   4,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_VP",		 A,    3,    1,	  2,   7,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_VM",		 A,    6,    1,	  2,   8,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_RCV",		 A,    9,    1,	  2,   9,   0,	 NA,	 0,  1)
 MUX_CFG("USB1_SPEED",		 A,   12,    2,	  2,  10,   0,	 NA,	 0,  1)
+MUX_CFG("R13_1610_USB1_SPEED",	 A,   12,    5,	  2,  10,   0,	 NA,	 0,  1)
 
 /* USB2 master */
 MUX_CFG("USB2_SUSP",		 B,    3,    1,	  2,  17,   0,	 NA,	 0,  1)
@@ -394,6 +403,7 @@ MUX_CFG("J18_1610_ETM_D7",	 5,   27,    1,	  0,  19,   0,	  0,	 0,  1)
 /* OMAP-1610 GPIO */
 MUX_CFG("P20_1610_GPIO4",	 6,   27,    0,	  1,   7,   0,	  1,	 1,  1)
 MUX_CFG("V9_1610_GPIO7",	 B,   12,    1,	  2,  20,   0,	  2,	 1,  1)
+MUX_CFG("W8_1610_GPIO9",	 B,   21,    0,	  2,  23,   0,	  2,	 1,  1)
 MUX_CFG("N19_1610_GPIO13",	 6,   12,    0,	  1,   2,   0,	  1,	 1,  1)
 MUX_CFG("P10_1610_GPIO22",	 C,    0,    7,	  2,  26,   0,	  2,	 1,  1)
 MUX_CFG("V5_1610_GPIO24",	 B,   15,    7,	  2,  21,   0,	  2,	 1,  1)
@@ -405,7 +415,7 @@ MUX_CFG("U18_1610_UWIRE_SDI",	 8,    0,    0,	  1,  18,   0,	  1,	 1,  1)
 MUX_CFG("W21_1610_UWIRE_SDO",	 8,    3,    0,	  1,  19,   0,	  1,	 1,  1)
 MUX_CFG("N14_1610_UWIRE_CS0",	 8,    9,    1,	  1,  21,   0,	  1,	 1,  1)
 MUX_CFG("P15_1610_UWIRE_CS3",	 8,   12,    1,	  1,  22,   0,	  1,	 1,  1)
-MUX_CFG("N15_1610_UWIRE_CS1",	 7,   18,    2,	 NA,   0,   0,	 NA,	 0,  0)
+MUX_CFG("N15_1610_UWIRE_CS1",	 7,   18,    2,	  1,  14,   0,	 NA,	 0,  1)
 
 /* First MMC interface, same on 1510 and 1610 */
 MUX_CFG("MMC_CMD",		 A,   27,    0,	  2,  15,   1,	  2,	 1,  1)
@@ -458,7 +468,7 @@ MUX_CFG("E19_1610_KBR4",	 3,   18,    0,	  0,   6,   1,	  0,	 1,  0)
 MUX_CFG("N19_1610_KBR5",	 6,  12,     1,	  1,   2,   1,	  1,	 1,  0)
 
 /* Power management */
-MUX_CFG("T20_1610_LOW_PWR",	 7,   12,    1,	  0,   0,   0,   NA,	 0,  0)
+MUX_CFG("T20_1610_LOW_PWR",	 7,   12,    1,	  NA,   0,   0,   NA,	 0,  0)
 };
 
 #endif	/* __MUX_C__ */
diff --git a/include/asm-arm/arch-omap/omap1610.h b/include/asm-arm/arch-omap/omap1610.h
index c2ef7c32c..667a6f697 100644
--- a/include/asm-arm/arch-omap/omap1610.h
+++ b/include/asm-arm/arch-omap/omap1610.h
@@ -48,20 +48,60 @@
 #define OMAP1610_DSPREG_SIZE	SZ_128K
 #define OMAP1610_DSPREG_START	0xE1000000
 
-#define OMAP_IH2_0_BASE          0xfffe0000
-#define OMAP_IH2_1_BASE          0xfffe0100
-#define OMAP_IH2_2_BASE          0xfffe0200
-#define OMAP_IH2_3_BASE          0xfffe0300
+/*
+ * ---------------------------------------------------------------------------
+ * Interrupts
+ * ---------------------------------------------------------------------------
+ */
+#define OMAP_IH2_0_BASE		(0xfffe0000)
+#define OMAP_IH2_1_BASE		(0xfffe0100)
+#define OMAP_IH2_2_BASE		(0xfffe0200)
+#define OMAP_IH2_3_BASE		(0xfffe0300)
+
+#define OMAP_IH2_0_ITR		(OMAP_IH2_0_BASE + 0x00)
+#define OMAP_IH2_0_MIR		(OMAP_IH2_0_BASE + 0x04)
+#define OMAP_IH2_0_SIR_IRQ	(OMAP_IH2_0_BASE + 0x10)
+#define OMAP_IH2_0_SIR_FIQ	(OMAP_IH2_0_BASE + 0x14)
+#define OMAP_IH2_0_CONTROL	(OMAP_IH2_0_BASE + 0x18)
+#define OMAP_IH2_0_ILR0		(OMAP_IH2_0_BASE + 0x1c)
+#define OMAP_IH2_0_ISR		(OMAP_IH2_0_BASE + 0x9c)
+
+#define OMAP_IH2_1_ITR		(OMAP_IH2_1_BASE + 0x00)
+#define OMAP_IH2_1_MIR		(OMAP_IH2_1_BASE + 0x04)
+#define OMAP_IH2_1_SIR_IRQ	(OMAP_IH2_1_BASE + 0x10)
+#define OMAP_IH2_1_SIR_FIQ	(OMAP_IH2_1_BASE + 0x14)
+#define OMAP_IH2_1_CONTROL	(OMAP_IH2_1_BASE + 0x18)
+#define OMAP_IH2_1_ILR1		(OMAP_IH2_1_BASE + 0x1c)
+#define OMAP_IH2_1_ISR		(OMAP_IH2_1_BASE + 0x9c)
+
+#define OMAP_IH2_2_ITR		(OMAP_IH2_2_BASE + 0x00)
+#define OMAP_IH2_2_MIR		(OMAP_IH2_2_BASE + 0x04)
+#define OMAP_IH2_2_SIR_IRQ	(OMAP_IH2_2_BASE + 0x10)
+#define OMAP_IH2_2_SIR_FIQ	(OMAP_IH2_2_BASE + 0x14)
+#define OMAP_IH2_2_CONTROL	(OMAP_IH2_2_BASE + 0x18)
+#define OMAP_IH2_2_ILR2		(OMAP_IH2_2_BASE + 0x1c)
+#define OMAP_IH2_2_ISR		(OMAP_IH2_2_BASE + 0x9c)
+
+#define OMAP_IH2_3_ITR		(OMAP_IH2_3_BASE + 0x00)
+#define OMAP_IH2_3_MIR		(OMAP_IH2_3_BASE + 0x04)
+#define OMAP_IH2_3_SIR_IRQ	(OMAP_IH2_3_BASE + 0x10)
+#define OMAP_IH2_3_SIR_FIQ	(OMAP_IH2_3_BASE + 0x14)
+#define OMAP_IH2_3_CONTROL	(OMAP_IH2_3_BASE + 0x18)
+#define OMAP_IH2_3_ILR3		(OMAP_IH2_3_BASE + 0x1c)
+#define OMAP_IH2_3_ISR		(OMAP_IH2_3_BASE + 0x9c)
 
 /*
  * ----------------------------------------------------------------------------
- * System control registers
+ * Clocks
  * ----------------------------------------------------------------------------
  */
+#define OMAP1610_ARM_IDLECT3	(CLKGEN_REG_BASE + 0x24)
 
-#define OMAP1610_RESET_CONTROL		0xfffe1140
-#define OMAP1610_ARM_IDLECT3		(CLKGEN_RESET_BASE + 0x24)
-#define OMAP1610_CONF_VOLTAGE_CTRL_0	0xfffe1060
+/*
+ * ----------------------------------------------------------------------------
+ * Pin configuration registers
+ * ----------------------------------------------------------------------------
+ */
 #define OMAP1610_CONF_VOLTAGE_VDDSHV6	(1 << 8)
 #define OMAP1610_CONF_VOLTAGE_VDDSHV7	(1 << 9)
 #define OMAP1610_CONF_VOLTAGE_VDDSHV8	(1 << 10)
@@ -73,14 +113,8 @@
  * TIPB bus interface
  * ---------------------------------------------------------------------------
  */
-
-#define OMAP1610_TIPB_SWITCH		0xfffbc800
-#define OMAP1610_TIPB_BRIDGE_INT	0xfffeca00	/* Private TIPB_CNTL */
-#define OMAP1610_PRIVATE_MPU_TIPB_CNTL	0xfffeca08
-#define OMAP1610_TIPB_BRIDGE_EXT	0xfffed300	/* Public (Shared) TIPB_CNTL */
-#define OMAP1610_PUBLIC_MPU_TIPB_CNTL	0xfffed308
-#define OMAP1610_TIPB_SWITCH_CFG	OMAP_TIPB_SWITCH
-#define OMAP1610_MMCSD2_SSW_MPU_CONF	(TIPB_SWITCH_CFG + 0x160)
+#define TIPB_SWITCH_BASE		 (0xfffbc800)
+#define OMAP1610_MMCSD2_SSW_MPU_CONF	(TIPB_SWITCH_BASE + 0x160)
 
 #endif /*  __ASM_ARCH_OMAP1610_H */
 
diff --git a/include/asm-arm/arch-omap/omap5912.h b/include/asm-arm/arch-omap/omap5912.h
index aa72dd5c2..f996af7c1 100644
--- a/include/asm-arm/arch-omap/omap5912.h
+++ b/include/asm-arm/arch-omap/omap5912.h
@@ -49,13 +49,55 @@
 #define OMAP5912_DSPREG_SIZE	SZ_128K
 #define OMAP5912_DSPREG_START	0xE1000000
 
+/*
+ * ---------------------------------------------------------------------------
+ * Interrupts
+ * ---------------------------------------------------------------------------
+ */
+#define OMAP_IH2_0_BASE		(0xfffe0000)
+#define OMAP_IH2_1_BASE		(0xfffe0100)
+#define OMAP_IH2_2_BASE		(0xfffe0200)
+#define OMAP_IH2_3_BASE		(0xfffe0300)
+
+#define OMAP_IH2_0_ITR		(OMAP_IH2_0_BASE + 0x00)
+#define OMAP_IH2_0_MIR		(OMAP_IH2_0_BASE + 0x04)
+#define OMAP_IH2_0_SIR_IRQ	(OMAP_IH2_0_BASE + 0x10)
+#define OMAP_IH2_0_SIR_FIQ	(OMAP_IH2_0_BASE + 0x14)
+#define OMAP_IH2_0_CONTROL	(OMAP_IH2_0_BASE + 0x18)
+#define OMAP_IH2_0_ILR0		(OMAP_IH2_0_BASE + 0x1c)
+#define OMAP_IH2_0_ISR		(OMAP_IH2_0_BASE + 0x9c)
+
+#define OMAP_IH2_1_ITR		(OMAP_IH2_1_BASE + 0x00)
+#define OMAP_IH2_1_MIR		(OMAP_IH2_1_BASE + 0x04)
+#define OMAP_IH2_1_SIR_IRQ	(OMAP_IH2_1_BASE + 0x10)
+#define OMAP_IH2_1_SIR_FIQ	(OMAP_IH2_1_BASE + 0x14)
+#define OMAP_IH2_1_CONTROL	(OMAP_IH2_1_BASE + 0x18)
+#define OMAP_IH2_1_ILR1		(OMAP_IH2_1_BASE + 0x1c)
+#define OMAP_IH2_1_ISR		(OMAP_IH2_1_BASE + 0x9c)
+
+#define OMAP_IH2_2_ITR		(OMAP_IH2_2_BASE + 0x00)
+#define OMAP_IH2_2_MIR		(OMAP_IH2_2_BASE + 0x04)
+#define OMAP_IH2_2_SIR_IRQ	(OMAP_IH2_2_BASE + 0x10)
+#define OMAP_IH2_2_SIR_FIQ	(OMAP_IH2_2_BASE + 0x14)
+#define OMAP_IH2_2_CONTROL	(OMAP_IH2_2_BASE + 0x18)
+#define OMAP_IH2_2_ILR2		(OMAP_IH2_2_BASE + 0x1c)
+#define OMAP_IH2_2_ISR		(OMAP_IH2_2_BASE + 0x9c)
+
+#define OMAP_IH2_3_ITR		(OMAP_IH2_3_BASE + 0x00)
+#define OMAP_IH2_3_MIR		(OMAP_IH2_3_BASE + 0x04)
+#define OMAP_IH2_3_SIR_IRQ	(OMAP_IH2_3_BASE + 0x10)
+#define OMAP_IH2_3_SIR_FIQ	(OMAP_IH2_3_BASE + 0x14)
+#define OMAP_IH2_3_CONTROL	(OMAP_IH2_3_BASE + 0x18)
+#define OMAP_IH2_3_ILR3		(OMAP_IH2_3_BASE + 0x1c)
+#define OMAP_IH2_3_ISR		(OMAP_IH2_3_BASE + 0x9c)
+
 /*
  * ----------------------------------------------------------------------------
  * System control registers
  * ----------------------------------------------------------------------------
  */
 
-#define OMAP5912_ARM_IDLECT3		(CLKGEN_RESET_BASE + 0x24)
+#define OMAP5912_ARM_IDLECT3	(CLKGEN_REG_BASE + 0x24)
 
 #endif /*  __ASM_ARCH_OMAP5912_H */
 
diff --git a/include/asm-arm/arch-omap/omap730.h b/include/asm-arm/arch-omap/omap730.h
index 82aca67e2..8ca763687 100644
--- a/include/asm-arm/arch-omap/omap730.h
+++ b/include/asm-arm/arch-omap/omap730.h
@@ -105,8 +105,8 @@
  * OMAP730 PCC_UPLD configuration registers
  * ----------------------------------------------------------------------------
  */
-#define OMAP730_PCC_UPLD_CTRL_REG_BASE	(0xfffe0900)
-#define OMAP730_PCC_UPLD_CTRL_REG	(OMAP730_PCC_UPLD_CTRL_REG_BASE + 0x00)
+#define OMAP730_PCC_UPLD_CTRL_BASE	(0xfffe0900)
+#define OMAP730_PCC_UPLD_CTRL		(OMAP730_PCC_UPLD_CTRL_BASE + 0x00)
 
 #endif /*  __ASM_ARCH_OMAP730_H */
 
diff --git a/include/asm-arm/arch-omap/time.h b/include/asm-arm/arch-omap/time.h
index 9e3cc951e..85d481219 100644
--- a/include/asm-arm/arch-omap/time.h
+++ b/include/asm-arm/arch-omap/time.h
@@ -52,7 +52,7 @@ typedef struct {
 
 #define mputimer_base(n) \
     ((volatile mputimer_regs_t*)IO_ADDRESS(OMAP_MPUTIMER_BASE + \
-				 (n)*OMAP_MPUTIMER_OFF))
+				 (n)*OMAP_MPUTIMER_OFFSET))
 
 static inline unsigned long timer32k_read(int reg) {
 	unsigned long val;
diff --git a/include/asm-arm/arch-omap/uncompress.h b/include/asm-arm/arch-omap/uncompress.h
index 758560259..9b287366d 100644
--- a/include/asm-arm/arch-omap/uncompress.h
+++ b/include/asm-arm/arch-omap/uncompress.h
@@ -20,13 +20,12 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/serial_reg.h>
-#include <asm/mach-types.h>
 #include <asm/hardware.h>
 #include <asm/arch/serial.h>
 
 #define UART_OMAP_MDR1		0x08	/* mode definition register */
-
 #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
+#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
 
 static void
 puts(const char *s)
@@ -34,17 +33,27 @@ puts(const char *s)
 	volatile u8 * uart = 0;
 	int shift = 0;
 
+#ifdef	CONFIG_OMAP_LL_DEBUG_UART3
+	uart = (volatile u8 *)(OMAP_UART3_BASE);
+#elif	CONFIG_OMAP_LL_DEBUG_UART2
+	uart = (volatile u8 *)(OMAP_UART2_BASE);
+#else
+	uart = (volatile u8 *)(OMAP_UART1_BASE);
+#endif
+
 	/* Determine which serial port to use */
 	do {
-		if (machine_is_omap_innovator() || machine_is_omap_osk()) {
+		/* MMU is not on, so cpu_is_omapXXXX() won't work here */
+		unsigned int omap_id = omap_get_id();
+
+		if (omap_id == OMAP_ID_1510 || omap_id == OMAP_ID_1610 ||
+		    omap_id == OMAP_ID_1710 || omap_id == OMAP_ID_5912) {
 			shift = 2;
-			uart = (volatile u8 *)(OMAP_UART1_BASE);
-		} else if (machine_is_omap_perseus2()) {
+		} else if (omap_id == OMAP_ID_730) {
 			shift = 0;
-			uart = (volatile u8 *)(OMAP_UART1_BASE);
 		} else {
-			/* Assume nothing for unknown machines.
-			 * Add an entry for your machine to select
+			/* Assume nothing for unknown OMAP processors.
+			 * Add an entry for your OMAP type to select
 			 * the default serial console here. If the
 			 * serial port is enabled, we'll use it to
 			 * display status messages. Else we'll be
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h
index edc4804a6..df4bc6628 100644
--- a/include/asm-arm/arch-pxa/dma.h
+++ b/include/asm-arm/arch-pxa/dma.h
@@ -29,9 +29,21 @@ typedef struct {
 	volatile u32 dcmd;	/* DCMD value for the current transfer */
 } pxa_dma_desc;
 
-/*
- * DMA registration
- */
+#if defined(CONFIG_PXA27x)
+
+#define PXA_DMA_CHANNELS	32
+#define PXA_DMA_NBCH(prio)	((prio == DMA_PRIO_LOW) ? 16 : 8)
+
+typedef enum {
+	DMA_PRIO_HIGH = 0,
+	DMA_PRIO_MEDIUM = 8,
+	DMA_PRIO_LOW = 16
+} pxa_dma_prio;
+
+#elif defined(CONFIG_PXA25x)
+
+#define PXA_DMA_CHANNELS	16
+#define PXA_DMA_NBCH(prio)	((prio == DMA_PRIO_LOW) ? 8 : 4)
 
 typedef enum {
 	DMA_PRIO_HIGH = 0,
@@ -39,6 +51,12 @@ typedef enum {
 	DMA_PRIO_LOW = 8
 } pxa_dma_prio;
 
+#endif
+
+/*
+ * DMA registration
+ */
+
 int pxa_request_dma (char *name,
 			 pxa_dma_prio prio,
 			 void (*irq_handler)(int, void *, struct pt_regs *),
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index 638bd35d7..ffd2fa2eb 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -13,18 +13,6 @@
 #ifndef __ASM_ARCH_HARDWARE_H
 #define __ASM_ARCH_HARDWARE_H
 
-#include <asm/mach-types.h>
-
-
-/*
- * These are statically mapped PCMCIA IO space for designs using it as a
- * generic IO bus, typically with ISA parts, hardwired IDE interfaces, etc.
- * The actual PCMCIA code is mapping required IO region at run time.
- */
-#define PCMCIA_IO_0_BASE	0xf6000000
-#define PCMCIA_IO_1_BASE	0xf7000000
-
-
 /*
  * We requires absolute addresses.
  */
@@ -38,15 +26,21 @@
 #define UNCACHED_ADDR		UNCACHED_PHYS_0
 
 /*
- * Intel PXA internal I/O mappings:
+ * Intel PXA2xx internal register mapping:
+ *
+ * 0x40000000 - 0x41ffffff <--> 0xf2000000 - 0xf3ffffff
+ * 0x44000000 - 0x45ffffff <--> 0xf4000000 - 0xf5ffffff
+ * 0x48000000 - 0x49ffffff <--> 0xf6000000 - 0xf7ffffff
+ * 0x4c000000 - 0x4dffffff <--> 0xf8000000 - 0xf9ffffff
+ * 0x50000000 - 0x51ffffff <--> 0xfa000000 - 0xfbffffff
+ * 0x54000000 - 0x55ffffff <--> 0xfc000000 - 0xfdffffff
+ * 0x58000000 - 0x59ffffff <--> 0xfe000000 - 0xffffffff
  *
- * 0x40000000 - 0x41ffffff <--> 0xf8000000 - 0xf9ffffff
- * 0x44000000 - 0x45ffffff <--> 0xfa000000 - 0xfbffffff
- * 0x48000000 - 0x49ffffff <--> 0xfc000000 - 0xfdffffff
+ * Note that not all PXA2xx chips implement all those addresses, and the
+ * kernel only maps the minimum needed range of this mapping.
  */
-
-#define io_p2v(x)	( ((x) | 0xbe000000) ^ (~((x) >> 1) & 0x06000000) )
-#define io_v2p( x )	( ((x) & 0x41ffffff) ^ ( ((x) & 0x06000000) << 1) )
+#define io_p2v(x) (0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1))
+#define io_v2p(x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1))
 
 #ifndef __ASSEMBLY__
 
@@ -89,18 +83,11 @@ typedef struct { volatile u32 offset[4096]; } __regbase;
 extern void pxa_gpio_mode( int gpio_mode );
 
 /*
- * return current lclk frequency in units of 10kHz
+ * return current memory and LCD clock frequency in units of 10kHz
  */
-extern unsigned int get_lclk_frequency_10khz(void);
+extern unsigned int get_memclk_frequency_10khz(void);
+extern unsigned int get_lcdclk_frequency_10khz(void);
 
 #endif
 
-
-/*
- * Implementation specifics
- */
-
-#include "lubbock.h"
-#include "idp.h"
-
 #endif  /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index 4281d56be..29164556b 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -118,7 +118,8 @@
  */
 #ifdef CONFIG_SA1111
 #define NR_IRQS			(IRQ_S1_BVD1_STSCHG + 1)
-#elif defined(CONFIG_ARCH_LUBBOCK)
+#elif defined(CONFIG_ARCH_LUBBOCK) || \
+      defined(CONFIG_MACH_MAINSTONE)
 #define NR_IRQS			(IRQ_BOARD_END)
 #else
 #define NR_IRQS			(IRQ_BOARD_START)
@@ -138,3 +139,19 @@
 #define LUBBOCK_USB_DISC_IRQ	LUBBOCK_IRQ(6)  /* usb disconnect */
 #define LUBBOCK_LAST_IRQ	LUBBOCK_IRQ(6)
 
+#define MAINSTONE_IRQ(x)	(IRQ_BOARD_START + (x))
+#define MAINSTONE_MMC_IRQ	MAINSTONE_IRQ(0)
+#define MAINSTONE_USIM_IRQ	MAINSTONE_IRQ(1)
+#define MAINSTONE_USBC_IRQ	MAINSTONE_IRQ(2)
+#define MAINSTONE_ETHERNET_IRQ	MAINSTONE_IRQ(3)
+#define MAINSTONE_AC97_IRQ	MAINSTONE_IRQ(4)
+#define MAINSTONE_PEN_IRQ	MAINSTONE_IRQ(5)
+#define MAINSTONE_MSINS_IRQ	MAINSTONE_IRQ(6)
+#define MAINSTONE_EXBRD_IRQ	MAINSTONE_IRQ(7)
+#define MAINSTONE_S0_CD_IRQ	MAINSTONE_IRQ(9)
+#define MAINSTONE_S0_STSCHG_IRQ	MAINSTONE_IRQ(10)
+#define MAINSTONE_S0_IRQ	MAINSTONE_IRQ(11)
+#define MAINSTONE_S1_CD_IRQ	MAINSTONE_IRQ(13)
+#define MAINSTONE_S1_STSCHG_IRQ	MAINSTONE_IRQ(14)
+#define MAINSTONE_S1_IRQ	MAINSTONE_IRQ(15)
+
diff --git a/include/asm-arm/arch-pxa/lubbock.h b/include/asm-arm/arch-pxa/lubbock.h
index 62a72f0ea..11ee73593 100644
--- a/include/asm-arm/arch-pxa/lubbock.h
+++ b/include/asm-arm/arch-pxa/lubbock.h
@@ -35,3 +35,6 @@
 #define LUB_IRQ_SET_CLR		__LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0)
 #define LUB_GP			__LUB_REG(LUBBOCK_FPGA_PHYS + 0x100)
 
+#ifndef __ASSEMBLY__
+extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
+#endif
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h
index 6fd886847..427e6ff5c 100644
--- a/include/asm-arm/arch-pxa/memory.h
+++ b/include/asm-arm/arch-pxa/memory.h
@@ -12,37 +12,11 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
-
-/*
- * Task size: 3GB
- */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
-
 /*
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET	(0xa0000000UL)
 
-/*
- * physical vs virtual ram conversion
- */
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-#define __virt_to_phys(x)	((x) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(x)	((x) - PHYS_OFFSET + PAGE_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -50,8 +24,6 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *		to an address that the kernel can use.
  */
-#define __virt_to_bus__is_a_macro
-#define __bus_to_virt__is_a_macro
 #define __virt_to_bus(x)	 __virt_to_phys(x)
 #define __bus_to_virt(x)	 __phys_to_virt(x)
 
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index be8b23adf..d0f64e3f7 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -10,6 +10,9 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef __PXA_REGS_H
+#define __PXA_REGS_H
+
 #include <linux/config.h>
 
 // FIXME hack so that SA-1111.h will work [cb]
@@ -101,6 +104,15 @@ typedef void            (*ExcpHndlr) (void) ;
 #define DCSR_RUN	(1 << 31)	/* Run Bit (read / write) */
 #define DCSR_NODESC	(1 << 30)	/* No-Descriptor Fetch (read / write) */
 #define DCSR_STOPIRQEN	(1 << 29)	/* Stop Interrupt Enable (read / write) */
+#ifdef CONFIG_PXA27x
+#define DCSR_EORIRQEN	(1 << 28)       /* End of Receive Interrupt Enable (R/W) */
+#define DCSR_EORJMPEN	(1 << 27)       /* Jump to next descriptor on EOR */
+#define DCSR_EORSTOPEN	(1 << 26)       /* STOP on an EOR */
+#define DCSR_SETCMPST	(1 << 25)       /* Set Descriptor Compare Status */
+#define DCSR_CLRCMPST	(1 << 24)       /* Clear Descriptor Compare Status */
+#define DCSR_CMPST	(1 << 10)       /* The Descriptor Compare Status */
+#define DCSR_ENRINTR	(1 << 9)        /* The end of Receive */
+#endif
 #define DCSR_REQPEND	(1 << 8)	/* Request Pending (read-only) */
 #define DCSR_STOPSTATE	(1 << 3)	/* Stop State (read-only) */
 #define DCSR_ENDINTR	(1 << 2)	/* End Interrupt (read / write) */
@@ -109,6 +121,7 @@ typedef void            (*ExcpHndlr) (void) ;
 
 #define DINT		__REG(0x400000f0)  /* DMA Interrupt Register */
 
+#define DRCMR(n)	__REG2(0x40000100, (n)<<2)
 #define DRCMR0		__REG(0x40000100)  /* Request to Channel Map Register for DREQ 0 */
 #define DRCMR1		__REG(0x40000104)  /* Request to Channel Map Register for DREQ 1 */
 #define DRCMR2		__REG(0x40000108)  /* Request to Channel Map Register for I2S receive Request */
@@ -150,6 +163,10 @@ typedef void            (*ExcpHndlr) (void) ;
 #define DRCMR38		__REG(0x40000198)  /* Request to Channel Map Register for USB endpoint 14 Request */
 #define DRCMR39		__REG(0x4000019C)  /* Reserved */
 
+#define DRCMR68		__REG(0x40001110)  /* Request to Channel Map Register for Camera FIFO 0 Request */
+#define DRCMR69		__REG(0x40001114)  /* Request to Channel Map Register for Camera FIFO 1 Request */
+#define DRCMR70		__REG(0x40001118)  /* Request to Channel Map Register for Camera FIFO 2 Request */
+
 #define DRCMRRXSADR	DRCMR2
 #define DRCMRTXSADR	DRCMR3
 #define DRCMRRXBTRBR	DRCMR4
@@ -169,9 +186,10 @@ typedef void            (*ExcpHndlr) (void) ;
 #define DRCMRTXSTTHR	DRCMR20
 #define DRCMRRXMMC	DRCMR21
 #define DRCMRTXMMC	DRCMR22
+#define DRCMRUDC(x)	DRCMR((x) + 24)
 
 #define DRCMR_MAPVLD	(1 << 7)	/* Map Valid (read / write) */
-#define DRCMR_CHLNUM	0x0f		/* mask for Channel Number (read / write) */
+#define DRCMR_CHLNUM	0x1f		/* mask for Channel Number (read / write) */
 
 #define DDADR0		__REG(0x40000200)  /* DMA Descriptor Address Register Channel 0 */
 #define DSADR0		__REG(0x40000204)  /* DMA Source Address Register Channel 0 */
@@ -398,6 +416,12 @@ typedef void            (*ExcpHndlr) (void) ;
 #define ISR		__REG(0x40301698)  /* I2C Status Register - ISR */
 #define ISAR		__REG(0x403016A0)  /* I2C Slave Address Register - ISAR */
 
+#define PWRIBMR    __REG(0x40f00180)  /* Power I2C Bus Monitor Register-IBMR */
+#define PWRIDBR    __REG(0x40f00188)  /* Power I2C Data Buffer Register-IDBR */
+#define PWRICR __REG(0x40f00190)  /* Power I2C Control Register - ICR */
+#define PWRISR __REG(0x40f00198)  /* Power I2C Status Register - ISR */
+#define PWRISAR    __REG(0x40f001A0)  /*Power I2C Slave Address Register-ISAR */
+
 #define ICR_START	(1 << 0)	   /* start bit */
 #define ICR_STOP	(1 << 1)	   /* stop bit */
 #define ICR_ACKNAK	(1 << 2)	   /* send ACK(0) or NAK(1) */
@@ -523,7 +547,10 @@ typedef void            (*ExcpHndlr) (void) ;
 
 /*
  * USB Device Controller
+ * PXA25x and PXA27x USB device controller registers are different.
  */
+#if defined(CONFIG_PXA25x)
+
 #define UDC_RES1	__REG(0x40600004)  /* UDC Undocumented - Reserved1 */
 #define UDC_RES2	__REG(0x40600008)  /* UDC Undocumented - Reserved2 */
 #define UDC_RES3	__REG(0x4060000C)  /* UDC Undocumented - Reserved3 */
@@ -679,11 +706,246 @@ typedef void            (*ExcpHndlr) (void) ;
 #define USIR1_IR14	(1 << 6)	/* Interrup request ep 14 */
 #define USIR1_IR15	(1 << 7)	/* Interrup request ep 15 */
 
+#elif defined(CONFIG_PXA27x)
+
+#define UDCCR           __REG(0x40600000) /* UDC Control Register */
+#define UDCCR_OEN	(1 << 31)	/* On-the-Go Enable */
+#define UDCCR_AALTHNP	(1 << 30)	/* A-device Alternate Host Negotiation
+					   Protocol Port Support */
+#define UDCCR_AHNP	(1 << 29)	/* A-device Host Negotiation Protocol
+					   Support */
+#define UDCCR_BHNP	(1 << 28)	/* B-device Host Negotiation Protocol
+					   Enable */
+#define UDCCR_DWRE	(1 << 16)	/* Device Remote Wake-up Enable */
+#define UDCCR_ACN	(0x03 << 11)	/* Active UDC configuration Number */
+#define UDCCR_ACN_S	11
+#define UDCCR_AIN	(0x07 << 8)	/* Active UDC interface Number */
+#define UDCCR_AIN_S	8
+#define UDCCR_AAISN	(0x07 << 5)	/* Active UDC Alternate Interface
+					   Setting Number */
+#define UDCCR_AAISN_S	5
+#define UDCCR_SMAC	(1 << 4)	/* Switch Endpoint Memory to Active
+					   Configuration */
+#define UDCCR_EMCE	(1 << 3)	/* Endpoint Memory Configuration
+					   Error */
+#define UDCCR_UDR	(1 << 2)	/* UDC Resume */
+#define UDCCR_UDA	(1 << 1)	/* UDC Active */
+#define UDCCR_UDE	(1 << 0)	/* UDC Enable */
+
+#define UDCICR0         __REG(0x40600004) /* UDC Interrupt Control Register0 */
+#define UDCICR1         __REG(0x40600008) /* UDC Interrupt Control Register1 */
+#define UDCICR_FIFOERR	(1 << 1)	/* FIFO Error interrupt for EP */
+#define UDCICR_PKTCOMPL (1 << 0)	/* Packet Complete interrupt for EP */
+
+#define UDC_INT_FIFOERROR  (0x2)
+#define UDC_INT_PACKETCMP  (0x1)
+
+#define UDCICR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2))
+#define UDCICR1_IECC	(1 << 31)	/* IntEn - Configuration Change */
+#define UDCICR1_IESOF	(1 << 30)	/* IntEn - Start of Frame */
+#define UDCICR1_IERU	(1 << 29)	/* IntEn - Resume */
+#define UDCICR1_IESU	(1 << 28)	/* IntEn - Suspend */
+#define UDCICR1_IERS	(1 << 27)	/* IntEn - Reset */
+
+#define UDCISR0         __REG(0x4060000C) /* UDC Interrupt Status Register 0 */
+#define UDCISR1         __REG(0x40600010) /* UDC Interrupt Status Register 1 */
+#define UDCISR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2))
+#define UDCISR1_IECC	(1 << 31)	/* IntEn - Configuration Change */
+#define UDCISR1_IESOF	(1 << 30)	/* IntEn - Start of Frame */
+#define UDCISR1_IERU	(1 << 29)	/* IntEn - Resume */
+#define UDCISR1_IESU	(1 << 28)	/* IntEn - Suspend */
+#define UDCISR1_IERS	(1 << 27)	/* IntEn - Reset */
+
+
+#define UDCFNR          __REG(0x40600014) /* UDC Frame Number Register */
+#define UDCOTGICR	__REG(0x40600018) /* UDC On-The-Go interrupt control */
+#define UDCOTGICR_IESF	(1 << 24)	/* OTG SET_FEATURE command recvd */
+#define UDCOTGICR_IEXR	(1 << 17)	/* Extra Transciever Interrupt
+					   Rising Edge Interrupt Enable */
+#define UDCOTGICR_IEXF	(1 << 16)	/* Extra Transciever Interrupt
+					   Falling Edge Interrupt Enable */
+#define UDCOTGICR_IEVV40R (1 << 9)	/* OTG Vbus Valid 4.0V Rising Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IEVV40F (1 << 8)	/* OTG Vbus Valid 4.0V Falling Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IEVV44R (1 << 7)	/* OTG Vbus Valid 4.4V Rising Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IEVV44F (1 << 6)	/* OTG Vbus Valid 4.4V Falling Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IESVR	(1 << 5)	/* OTG Session Valid Rising Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IESVF	(1 << 4)	/* OTG Session Valid Falling Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IESDR	(1 << 3)	/* OTG A-Device SRP Detect Rising
+					   Edge Interrupt Enable */
+#define UDCOTGICR_IESDF	(1 << 2)	/* OTG A-Device SRP Detect Falling
+					   Edge Interrupt Enable */
+#define UDCOTGICR_IEIDR	(1 << 1)	/* OTG ID Change Rising Edge
+					   Interrupt Enable */
+#define UDCOTGICR_IEIDF	(1 << 0)	/* OTG ID Change Falling Edge
+					   Interrupt Enable */
+
+#define UDCCSN(x)	__REG2(0x40600100, (x) << 2)
+#define UDCCSR0         __REG(0x40600100) /* UDC Control/Status register - Endpoint 0 */
+#define UDCCSR0_SA	(1 << 7)	/* Setup Active */
+#define UDCCSR0_RNE	(1 << 6)	/* Receive FIFO Not Empty */
+#define UDCCSR0_FST	(1 << 5)	/* Force Stall */
+#define UDCCSR0_SST	(1 << 4)	/* Sent Stall */
+#define UDCCSR0_DME	(1 << 3)	/* DMA Enable */
+#define UDCCSR0_FTF	(1 << 2)	/* Flush Transmit FIFO */
+#define UDCCSR0_IPR	(1 << 1)	/* IN Packet Ready */
+#define UDCCSR0_OPC	(1 << 0)	/* OUT Packet Complete */
+
+#define UDCCSRA         __REG(0x40600104) /* UDC Control/Status register - Endpoint A */
+#define UDCCSRB         __REG(0x40600108) /* UDC Control/Status register - Endpoint B */
+#define UDCCSRC         __REG(0x4060010C) /* UDC Control/Status register - Endpoint C */
+#define UDCCSRD         __REG(0x40600110) /* UDC Control/Status register - Endpoint D */
+#define UDCCSRE         __REG(0x40600114) /* UDC Control/Status register - Endpoint E */
+#define UDCCSRF         __REG(0x40600118) /* UDC Control/Status register - Endpoint F */
+#define UDCCSRG         __REG(0x4060011C) /* UDC Control/Status register - Endpoint G */
+#define UDCCSRH         __REG(0x40600120) /* UDC Control/Status register - Endpoint H */
+#define UDCCSRI         __REG(0x40600124) /* UDC Control/Status register - Endpoint I */
+#define UDCCSRJ         __REG(0x40600128) /* UDC Control/Status register - Endpoint J */
+#define UDCCSRK         __REG(0x4060012C) /* UDC Control/Status register - Endpoint K */
+#define UDCCSRL         __REG(0x40600130) /* UDC Control/Status register - Endpoint L */
+#define UDCCSRM         __REG(0x40600134) /* UDC Control/Status register - Endpoint M */
+#define UDCCSRN         __REG(0x40600138) /* UDC Control/Status register - Endpoint N */
+#define UDCCSRP         __REG(0x4060013C) /* UDC Control/Status register - Endpoint P */
+#define UDCCSRQ         __REG(0x40600140) /* UDC Control/Status register - Endpoint Q */
+#define UDCCSRR         __REG(0x40600144) /* UDC Control/Status register - Endpoint R */
+#define UDCCSRS         __REG(0x40600148) /* UDC Control/Status register - Endpoint S */
+#define UDCCSRT         __REG(0x4060014C) /* UDC Control/Status register - Endpoint T */
+#define UDCCSRU         __REG(0x40600150) /* UDC Control/Status register - Endpoint U */
+#define UDCCSRV         __REG(0x40600154) /* UDC Control/Status register - Endpoint V */
+#define UDCCSRW         __REG(0x40600158) /* UDC Control/Status register - Endpoint W */
+#define UDCCSRX         __REG(0x4060015C) /* UDC Control/Status register - Endpoint X */
+
+#define UDCCSR_DPE	(1 << 9)	/* Data Packet Error */
+#define UDCCSR_FEF	(1 << 8)	/* Flush Endpoint FIFO */
+#define UDCCSR_SP	(1 << 7)	/* Short Packet Control/Status */
+#define UDCCSR_BNE	(1 << 6)	/* Buffer Not Empty (IN endpoints) */
+#define UDCCSR_BNF	(1 << 6)	/* Buffer Not Full (OUT endpoints) */
+#define UDCCSR_FST	(1 << 5)	/* Force STALL */
+#define UDCCSR_SST	(1 << 4)	/* Sent STALL */
+#define UDCCSR_DME	(1 << 3)	/* DMA Enable */
+#define UDCCSR_TRN	(1 << 2)	/* Tx/Rx NAK */
+#define UDCCSR_PC	(1 << 1)	/* Packet Complete */
+#define UDCCSR_FS	(1 << 0)	/* FIFO needs service */
+
+#define UDCBCN(x)	__REG2(0x40600200, (x)<<2)
+#define UDCBCR0         __REG(0x40600200) /* Byte Count Register - EP0 */
+#define UDCBCRA         __REG(0x40600204) /* Byte Count Register - EPA */
+#define UDCBCRB         __REG(0x40600208) /* Byte Count Register - EPB */
+#define UDCBCRC         __REG(0x4060020C) /* Byte Count Register - EPC */
+#define UDCBCRD         __REG(0x40600210) /* Byte Count Register - EPD */
+#define UDCBCRE         __REG(0x40600214) /* Byte Count Register - EPE */
+#define UDCBCRF         __REG(0x40600218) /* Byte Count Register - EPF */
+#define UDCBCRG         __REG(0x4060021C) /* Byte Count Register - EPG */
+#define UDCBCRH         __REG(0x40600220) /* Byte Count Register - EPH */
+#define UDCBCRI         __REG(0x40600224) /* Byte Count Register - EPI */
+#define UDCBCRJ         __REG(0x40600228) /* Byte Count Register - EPJ */
+#define UDCBCRK         __REG(0x4060022C) /* Byte Count Register - EPK */
+#define UDCBCRL         __REG(0x40600230) /* Byte Count Register - EPL */
+#define UDCBCRM         __REG(0x40600234) /* Byte Count Register - EPM */
+#define UDCBCRN         __REG(0x40600238) /* Byte Count Register - EPN */
+#define UDCBCRP         __REG(0x4060023C) /* Byte Count Register - EPP */
+#define UDCBCRQ         __REG(0x40600240) /* Byte Count Register - EPQ */
+#define UDCBCRR         __REG(0x40600244) /* Byte Count Register - EPR */
+#define UDCBCRS         __REG(0x40600248) /* Byte Count Register - EPS */
+#define UDCBCRT         __REG(0x4060024C) /* Byte Count Register - EPT */
+#define UDCBCRU         __REG(0x40600250) /* Byte Count Register - EPU */
+#define UDCBCRV         __REG(0x40600254) /* Byte Count Register - EPV */
+#define UDCBCRW         __REG(0x40600258) /* Byte Count Register - EPW */
+#define UDCBCRX         __REG(0x4060025C) /* Byte Count Register - EPX */
+
+#define UDCDN(x)	__REG2(0x40600300, (x)<<2)
+#define PHYS_UDCDN(x)	(0x40600300 + ((x)<<2))
+#define PUDCDN(x)	(volatile u32 *)(io_p2v(PHYS_UDCDN((x))))
+#define UDCDR0          __REG(0x40600300) /* Data Register - EP0 */
+#define UDCDRA          __REG(0x40600304) /* Data Register - EPA */
+#define UDCDRB          __REG(0x40600308) /* Data Register - EPB */
+#define UDCDRC          __REG(0x4060030C) /* Data Register - EPC */
+#define UDCDRD          __REG(0x40600310) /* Data Register - EPD */
+#define UDCDRE          __REG(0x40600314) /* Data Register - EPE */
+#define UDCDRF          __REG(0x40600318) /* Data Register - EPF */
+#define UDCDRG          __REG(0x4060031C) /* Data Register - EPG */
+#define UDCDRH          __REG(0x40600320) /* Data Register - EPH */
+#define UDCDRI          __REG(0x40600324) /* Data Register - EPI */
+#define UDCDRJ          __REG(0x40600328) /* Data Register - EPJ */
+#define UDCDRK          __REG(0x4060032C) /* Data Register - EPK */
+#define UDCDRL          __REG(0x40600330) /* Data Register - EPL */
+#define UDCDRM          __REG(0x40600334) /* Data Register - EPM */
+#define UDCDRN          __REG(0x40600338) /* Data Register - EPN */
+#define UDCDRP          __REG(0x4060033C) /* Data Register - EPP */
+#define UDCDRQ          __REG(0x40600340) /* Data Register - EPQ */
+#define UDCDRR          __REG(0x40600344) /* Data Register - EPR */
+#define UDCDRS          __REG(0x40600348) /* Data Register - EPS */
+#define UDCDRT          __REG(0x4060034C) /* Data Register - EPT */
+#define UDCDRU          __REG(0x40600350) /* Data Register - EPU */
+#define UDCDRV          __REG(0x40600354) /* Data Register - EPV */
+#define UDCDRW          __REG(0x40600358) /* Data Register - EPW */
+#define UDCDRX          __REG(0x4060035C) /* Data Register - EPX */
+
+#define UDCCN(x)       __REG2(0x40600400, (x)<<2)
+#define UDCCRA          __REG(0x40600404) /* Configuration register EPA */
+#define UDCCRB          __REG(0x40600408) /* Configuration register EPB */
+#define UDCCRC          __REG(0x4060040C) /* Configuration register EPC */
+#define UDCCRD          __REG(0x40600410) /* Configuration register EPD */
+#define UDCCRE          __REG(0x40600414) /* Configuration register EPE */
+#define UDCCRF          __REG(0x40600418) /* Configuration register EPF */
+#define UDCCRG          __REG(0x4060041C) /* Configuration register EPG */
+#define UDCCRH          __REG(0x40600420) /* Configuration register EPH */
+#define UDCCRI          __REG(0x40600424) /* Configuration register EPI */
+#define UDCCRJ          __REG(0x40600428) /* Configuration register EPJ */
+#define UDCCRK          __REG(0x4060042C) /* Configuration register EPK */
+#define UDCCRL          __REG(0x40600430) /* Configuration register EPL */
+#define UDCCRM          __REG(0x40600434) /* Configuration register EPM */
+#define UDCCRN          __REG(0x40600438) /* Configuration register EPN */
+#define UDCCRP          __REG(0x4060043C) /* Configuration register EPP */
+#define UDCCRQ          __REG(0x40600440) /* Configuration register EPQ */
+#define UDCCRR          __REG(0x40600444) /* Configuration register EPR */
+#define UDCCRS          __REG(0x40600448) /* Configuration register EPS */
+#define UDCCRT          __REG(0x4060044C) /* Configuration register EPT */
+#define UDCCRU          __REG(0x40600450) /* Configuration register EPU */
+#define UDCCRV          __REG(0x40600454) /* Configuration register EPV */
+#define UDCCRW          __REG(0x40600458) /* Configuration register EPW */
+#define UDCCRX          __REG(0x4060045C) /* Configuration register EPX */
+
+#define UDCCONR_CN	(0x03 << 25)	/* Configuration Number */
+#define UDCCONR_CN_S	(25)
+#define UDCCONR_IN	(0x07 << 22)	/* Interface Number */
+#define UDCCONR_IN_S	(22)
+#define UDCCONR_AISN	(0x07 << 19)	/* Alternate Interface Number */
+#define UDCCONR_AISN_S	(19)
+#define UDCCONR_EN	(0x0f << 15)	/* Endpoint Number */
+#define UDCCONR_EN_S	(15)
+#define UDCCONR_ET	(0x03 << 13)	/* Endpoint Type: */
+#define UDCCONR_ET_S	(13)
+#define UDCCONR_ET_INT	(0x03 << 13)	/*   Interrupt */
+#define UDCCONR_ET_BULK	(0x02 << 13)	/*   Bulk */
+#define UDCCONR_ET_ISO	(0x01 << 13)	/*   Isochronous */
+#define UDCCONR_ET_NU	(0x00 << 13)	/*   Not used */
+#define UDCCONR_ED	(1 << 12)	/* Endpoint Direction */
+#define UDCCONR_MPS	(0x3ff << 2)	/* Maximum Packet Size */
+#define UDCCONR_MPS_S	(2)
+#define UDCCONR_DE	(1 << 1)	/* Double Buffering Enable */
+#define UDCCONR_EE	(1 << 0)	/* Endpoint Enable */
+
+
+#define UDC_INT_FIFOERROR  (0x2)
+#define UDC_INT_PACKETCMP  (0x1)
+
+#define UDC_FNR_MASK     (0x7ff)
+
+#define UDCCSR_WR_MASK   (UDCCSR_DME|UDCCSR_FST)
+#define UDC_BCR_MASK    (0x3ff)
+#endif
 
 /*
  * Fast Infrared Communication Port
  */
 
+#define FICP		__REG(0x40800000)  /* Start of FICP area */
 #define ICCR0		__REG(0x40800000)  /* ICP Control Register 0 */
 #define ICCR1		__REG(0x40800004)  /* ICP Control Register 1 */
 #define ICCR2		__REG(0x40800008)  /* ICP Control Register 2 */
@@ -691,29 +953,41 @@ typedef void            (*ExcpHndlr) (void) ;
 #define ICSR0		__REG(0x40800014)  /* ICP Status Register 0 */
 #define ICSR1		__REG(0x40800018)  /* ICP Status Register 1 */
 
-#define ICCR0_AME       (1 << 7)           /* Address match enable */
-#define ICCR0_TIE       (1 << 6)           /* Transmit FIFO interrupt enable */
-#define ICCR0_RIE       (1 << 5)           /* Receive FIFO interrupt enable */
-#define ICCR0_RXE       (1 << 4)           /* Receive enable */
-#define ICCR0_TXE       (1 << 3)           /* Transmit enable */
-#define ICCR0_TUS       (1 << 2)           /* Transmit FIFO underrun select */
-#define ICCR0_LBM       (1 << 1)           /* Loopback mode */
-#define ICCR0_ITR       (1 << 0)           /* IrDA transmission */
-
-#define ICSR0_FRE       (1 << 5)           /* Framing error */
-#define ICSR0_RFS       (1 << 4)           /* Receive FIFO service request */
-#define ICSR0_TFS       (1 << 3)           /* Transnit FIFO service request */
-#define ICSR0_RAB       (1 << 2)           /* Receiver abort */
-#define ICSR0_TUR       (1 << 1)           /* Trunsmit FIFO underun */
-#define ICSR0_EIF       (1 << 0)           /* End/Error in FIFO */
-
-#define ICSR1_ROR       (1 << 6)           /* Receiver FIFO underrun  */
-#define ICSR1_CRE       (1 << 5)           /* CRC error */
-#define ICSR1_EOF       (1 << 4)           /* End of frame */
-#define ICSR1_TNF       (1 << 3)           /* Transmit FIFO not full */
-#define ICSR1_RNE       (1 << 2)           /* Receive FIFO not empty */
-#define ICSR1_TBY       (1 << 1)           /* Tramsmiter busy flag */
-#define ICSR1_RSY       (1 << 0)           /* Recevier synchronized flag */
+#define ICCR0_AME	(1 << 7)	/* Adress match enable */
+#define ICCR0_TIE	(1 << 6)	/* Transmit FIFO interrupt enable */
+#define ICCR0_RIE	(1 << 5)	/* Recieve FIFO interrupt enable */
+#define ICCR0_RXE	(1 << 4)	/* Receive enable */
+#define ICCR0_TXE	(1 << 3)	/* Transmit enable */
+#define ICCR0_TUS	(1 << 2)	/* Transmit FIFO underrun select */
+#define ICCR0_LBM	(1 << 1)	/* Loopback mode */
+#define ICCR0_ITR	(1 << 0)	/* IrDA transmission */
+
+#ifdef CONFIG_CPU_BULVERDE
+#define ICCR2_RXP       (1 << 3)	/* Receive Pin Polarity select */
+#define ICCR2_TXP       (1 << 2)	/* Transmit Pin Polarity select */
+#define ICCR2_TRIG	(3 << 0)	/* Receive FIFO Trigger threshold */
+#define ICCR2_TRIG_8    (0 << 0)	/* 	>= 8 bytes */
+#define ICCR2_TRIG_16   (1 << 0)	/*	>= 16 bytes */
+#define ICCR2_TRIG_32   (2 << 0)	/*	>= 32 bytes */
+#endif
+
+#ifdef CONFIG_CPU_BULVERDE
+#define ICSR0_EOC	(1 << 6)	/* DMA End of Descriptor Chain */
+#endif
+#define ICSR0_FRE	(1 << 5)	/* Framing error */
+#define ICSR0_RFS	(1 << 4)	/* Receive FIFO service request */
+#define ICSR0_TFS	(1 << 3)	/* Transnit FIFO service request */
+#define ICSR0_RAB	(1 << 2)	/* Receiver abort */
+#define ICSR0_TUR	(1 << 1)	/* Trunsmit FIFO underun */
+#define ICSR0_EIF	(1 << 0)	/* End/Error in FIFO */
+
+#define ICSR1_ROR	(1 << 6)	/* Receiver FIFO underrun  */
+#define ICSR1_CRE	(1 << 5)	/* CRC error */
+#define ICSR1_EOF	(1 << 4)	/* End of frame */
+#define ICSR1_TNF	(1 << 3)	/* Transmit FIFO not full */
+#define ICSR1_RNE	(1 << 2)	/* Receive FIFO not empty */
+#define ICSR1_TBY	(1 << 1)	/* Tramsmiter busy flag */
+#define ICSR1_RSY	(1 << 0)	/* Recevier synchronized flag */
 
 
 /*
@@ -724,7 +998,10 @@ typedef void            (*ExcpHndlr) (void) ;
 #define RTAR		__REG(0x40900004)  /* RTC Alarm Register */
 #define RTSR		__REG(0x40900008)  /* RTC Status Register */
 #define RTTR		__REG(0x4090000C)  /* RTC Timer Trim Register */
+#define PIAR		__REG(0x40900038)  /* Periodic Interrupt Alarm Register */
 
+#define RTSR_PICE	(1 << 15)	/* Periodic interrupt count enable */
+#define RTSR_PIALE	(1 << 14)	/* Periodic interrupt Alarm enable */
 #define RTSR_HZE	(1 << 3)	/* HZ interrupt enable */
 #define RTSR_ALE	(1 << 2)	/* RTC alarm interrupt enable */
 #define RTSR_HZ		(1 << 1)	/* HZ rising-edge detected */
@@ -739,7 +1016,10 @@ typedef void            (*ExcpHndlr) (void) ;
 #define OSMR1		__REG(0x40A00004)  /* */
 #define OSMR2		__REG(0x40A00008)  /* */
 #define OSMR3		__REG(0x40A0000C)  /* */
+#define OSMR4		__REG(0x40A00080)  /* */
 #define OSCR		__REG(0x40A00010)  /* OS Timer Counter Register */
+#define OSCR4		__REG(0x40A00040)  /* OS Timer Counter Register */
+#define OMCR4		__REG(0x40A000C0)  /* */
 #define OSSR		__REG(0x40A00014)  /* OS Timer Status Register */
 #define OWER		__REG(0x40A00018)  /* OS Timer Watchdog Enable Register */
 #define OIER		__REG(0x40A0001C)  /* OS Timer Interrupt Enable Register */
@@ -819,11 +1099,52 @@ typedef void            (*ExcpHndlr) (void) ;
 #define GAFR1_L		__REG(0x40E0005C)  /* GPIO Alternate Function Select Register GPIO<47:32> */
 #define GAFR1_U		__REG(0x40E00060)  /* GPIO Alternate Function Select Register GPIO<63:48> */
 #define GAFR2_L		__REG(0x40E00064)  /* GPIO Alternate Function Select Register GPIO<79:64> */
-#define GAFR2_U		__REG(0x40E00068)  /* GPIO Alternate Function Select Register GPIO 80 */
+#define GAFR2_U		__REG(0x40E00068)  /* GPIO Alternate Function Select Register GPIO<95-80> */
+#define GAFR3_L		__REG(0x40E0006C)  /* GPIO Alternate Function Select Register GPIO<111:96> */
+#define GAFR3_U		__REG(0x40E00070)  /* GPIO Alternate Function Select Register GPIO<127:112> */
+
+#define GPLR3		__REG(0x40E00100)  /* GPIO Pin-Level Register GPIO<127:96> */
+#define GPDR3		__REG(0x40E0010C)  /* GPIO Pin Direction Register GPIO<127:96> */
+#define GPSR3		__REG(0x40E00118)  /* GPIO Pin Output Set Register GPIO<127:96> */
+#define GPCR3		__REG(0x40E00124)  /* GPIO Pin Output Clear Register GPIO<127:96> */
+#define GRER3		__REG(0x40E00130)  /* GPIO Rising-Edge Detect Register GPIO<127:96> */
+#define GFER3		__REG(0x40E0013C)  /* GPIO Falling-Edge Detect Register GPIO<127:96> */
+#define GEDR3		__REG(0x40E00148)  /* GPIO Edge Detect Status Register GPIO<127:96> */
 
 /* More handy macros.  The argument is a literal GPIO number. */
 
 #define GPIO_bit(x)	(1 << ((x) & 0x1f))
+
+#ifdef CONFIG_PXA27x
+
+/* Interrupt Controller */
+
+#define ICIP2		__REG(0x40D0009C)  /* Interrupt Controller IRQ Pending Register 2 */
+#define ICMR2		__REG(0x40D000A0)  /* Interrupt Controller Mask Register 2 */
+#define ICLR2		__REG(0x40D000A4)  /* Interrupt Controller Level Register 2 */
+#define ICFP2		__REG(0x40D000A8)  /* Interrupt Controller FIQ Pending Register 2 */
+#define ICPR2		__REG(0x40D000AC)  /* Interrupt Controller Pending Register 2 */
+
+#define _GPLR(x)	__REG2(0x40E00000, ((x) & 0x60) >> 3)
+#define _GPDR(x)	__REG2(0x40E0000C, ((x) & 0x60) >> 3)
+#define _GPSR(x)	__REG2(0x40E00018, ((x) & 0x60) >> 3)
+#define _GPCR(x)	__REG2(0x40E00024, ((x) & 0x60) >> 3)
+#define _GRER(x)	__REG2(0x40E00030, ((x) & 0x60) >> 3)
+#define _GFER(x)	__REG2(0x40E0003C, ((x) & 0x60) >> 3)
+#define _GEDR(x)	__REG2(0x40E00048, ((x) & 0x60) >> 3)
+#define _GAFR(x)	__REG2(0x40E00054, ((x) & 0x70) >> 2)
+
+#define GPLR(x) 	((((x) & 0x7f) < 96) ? _GPLR(x) : GPLR3)
+#define GPDR(x)		((((x) & 0x7f) < 96) ? _GPDR(x) : GPDR3)
+#define GPSR(x)		((((x) & 0x7f) < 96) ? _GPSR(x) : GPSR3)
+#define GPCR(x)		((((x) & 0x7f) < 96) ? _GPCR(x) : GPCR3)
+#define GRER(x)		((((x) & 0x7f) < 96) ? _GRER(x) : GRER3)
+#define GFER(x)		((((x) & 0x7f) < 96) ? _GFER(x) : GFER3)
+#define GEDR(x)		((((x) & 0x7f) < 96) ? _GEDR(x) : GEDR3)
+#define GAFR(x)		((((x) & 0x7f) < 96) ? _GAFR(x) : \
+			 ((((x) & 0x7f) < 112) ? GAFR3_L : GAFR3_U))
+#else
+
 #define GPLR(x)		__REG2(0x40E00000, ((x) & 0x60) >> 3)
 #define GPDR(x)		__REG2(0x40E0000C, ((x) & 0x60) >> 3)
 #define GPSR(x)		__REG2(0x40E00018, ((x) & 0x60) >> 3)
@@ -833,6 +1154,9 @@ typedef void            (*ExcpHndlr) (void) ;
 #define GEDR(x)		__REG2(0x40E00048, ((x) & 0x60) >> 3)
 #define GAFR(x)		__REG2(0x40E00054, ((x) & 0x70) >> 2)
 
+#endif
+
+
 /* GPIO alternate function assignments */
 
 #define GPIO1_RST		1	/* reset */
@@ -1047,14 +1371,73 @@ typedef void            (*ExcpHndlr) (void) ;
 #define PGSR0		__REG(0x40F00020)  /* Power Manager GPIO Sleep State Register for GP[31-0] */
 #define PGSR1		__REG(0x40F00024)  /* Power Manager GPIO Sleep State Register for GP[63-32] */
 #define PGSR2		__REG(0x40F00028)  /* Power Manager GPIO Sleep State Register for GP[84-64] */
+#define PGSR3		__REG(0x40F0002C)  /* Power Manager GPIO Sleep State Register for GP[118-96] */
 #define RCSR		__REG(0x40F00030)  /* Reset Controller Status Register */
 
+#define PSLR		__REG(0x40F00034)	/* Power Manager Sleep Config Register */
+#define PSTR		__REG(0x40F00038)	/*Power Manager Standby Config Register */
+#define PSNR		__REG(0x40F0003C)	/*Power Manager Sense Config Register */
+#define PVCR		__REG(0x40F00040)	/*Power Manager VoltageControl Register */
+#define PKWR		__REG(0x40F00050)	/* Power Manager KB Wake-up Enable Reg */
+#define PKSR		__REG(0x40F00054)	/* Power Manager KB Level-Detect Register */
+#define PCMD(x)	__REG2(0x40F00080, (x)<<2)
+#define PCMD0	__REG(0x40F00080 + 0 * 4)
+#define PCMD1	__REG(0x40F00080 + 1 * 4)
+#define PCMD2	__REG(0x40F00080 + 2 * 4)
+#define PCMD3	__REG(0x40F00080 + 3 * 4)
+#define PCMD4	__REG(0x40F00080 + 4 * 4)
+#define PCMD5	__REG(0x40F00080 + 5 * 4)
+#define PCMD6	__REG(0x40F00080 + 6 * 4)
+#define PCMD7	__REG(0x40F00080 + 7 * 4)
+#define PCMD8	__REG(0x40F00080 + 8 * 4)
+#define PCMD9	__REG(0x40F00080 + 9 * 4)
+#define PCMD10	__REG(0x40F00080 + 10 * 4)
+#define PCMD11	__REG(0x40F00080 + 11 * 4)
+#define PCMD12	__REG(0x40F00080 + 12 * 4)
+#define PCMD13	__REG(0x40F00080 + 13 * 4)
+#define PCMD14	__REG(0x40F00080 + 14 * 4)
+#define PCMD15	__REG(0x40F00080 + 15 * 4)
+#define PCMD16	__REG(0x40F00080 + 16 * 4)
+#define PCMD17	__REG(0x40F00080 + 17 * 4)
+#define PCMD18	__REG(0x40F00080 + 18 * 4)
+#define PCMD19	__REG(0x40F00080 + 19 * 4)
+#define PCMD20	__REG(0x40F00080 + 20 * 4)
+#define PCMD21	__REG(0x40F00080 + 21 * 4)
+#define PCMD22	__REG(0x40F00080 + 22 * 4)
+#define PCMD23	__REG(0x40F00080 + 23 * 4)
+#define PCMD24	__REG(0x40F00080 + 24 * 4)
+#define PCMD25	__REG(0x40F00080 + 25 * 4)
+#define PCMD26	__REG(0x40F00080 + 26 * 4)
+#define PCMD27	__REG(0x40F00080 + 27 * 4)
+#define PCMD28	__REG(0x40F00080 + 28 * 4)
+#define PCMD29	__REG(0x40F00080 + 29 * 4)
+#define PCMD30	__REG(0x40F00080 + 30 * 4)
+#define PCMD31	__REG(0x40F00080 + 31 * 4)
+
+#define PCMD_MBC	(1<<12)
+#define PCMD_DCE	(1<<11)
+#define PCMD_LC	(1<<10)
+/* FIXME:  PCMD_SQC need be checked.   */
+#define PCMD_SQC	(3<<8)	/* currently only bit 8 is changeable,
+				   bit 9 should be 0 all day. */
+#define PVCR_VCSA	(0x1<<14)
+#define PVCR_CommandDelay (0xf80)
+#define PCFR_PI2C_EN	(0x1 << 6)
+
+#define PSSR_OTGPH	(1 << 7)	/* OTG Peripheral control Hold */
 #define PSSR_RDH	(1 << 5)	/* Read Disable Hold */
 #define PSSR_PH		(1 << 4)	/* Peripheral Control Hold */
 #define PSSR_VFS	(1 << 2)	/* VDD Fault Status */
 #define PSSR_BFS	(1 << 1)	/* Battery Fault Status */
 #define PSSR_SSS	(1 << 0)	/* Software Sleep Status */
 
+#define PCFR_RO		(1 << 15)	/* RDH Override */
+#define PCFR_PO		(1 << 14)	/* PH Override */
+#define PCFR_GPROD	(1 << 12)	/* GPIO nRESET_OUT Disable */
+#define PCFR_L1_EN	(1 << 11)	/* Sleep Mode L1 converter Enable */
+#define PCFR_FVC	(1 << 10)	/* Frequency/Voltage Change */
+#define PCFR_DC_EN	(1 << 7)	/* Sleep/deep-sleep DC-DC Converter Enable */
+#define PCFR_PI2CEN	(1 << 6)	/* Enable PI2C controller */
 #define PCFR_DS		(1 << 3)	/* Deep Sleep Mode */
 #define PCFR_FS		(1 << 2)	/* Float Static Chip Selects */
 #define PCFR_FP		(1 << 1)	/* Float PCMCIA controls */
@@ -1137,21 +1520,35 @@ typedef void            (*ExcpHndlr) (void) ;
 #define CCCR		__REG(0x41300000)  /* Core Clock Configuration Register */
 #define CKEN		__REG(0x41300004)  /* Clock Enable Register */
 #define OSCC		__REG(0x41300008)  /* Oscillator Configuration Register */
+#define CCSR		__REG(0x4130000C)  /* Core Clock Status Register */
 
 #define CCCR_N_MASK	0x0380		/* Run Mode Frequency to Turbo Mode Frequency Multiplier */
 #define CCCR_M_MASK	0x0060		/* Memory Frequency to Run Mode Frequency Multiplier */
 #define CCCR_L_MASK	0x001f		/* Crystal Frequency to Memory Frequency Multiplier */
 
+#define CKEN24_CAMERA	(1 << 24)	/* Camera Interface Clock Enable */
+#define CKEN23_SSP1	(1 << 23)	/* SSP1 Unit Clock Enable */
+#define CKEN22_MEMC	(1 << 22)	/* Memory Controller Clock Enable */
+#define CKEN21_MEMSTK	(1 << 21)	/* Memory Stick Host Controller */
+#define CKEN20_IM	(1 << 20)	/* Internal Memory Clock Enable */
+#define CKEN19_KEYPAD	(1 << 19)	/* Keypad Interface Clock Enable */
+#define CKEN18_USIM	(1 << 18)	/* USIM Unit Clock Enable */
+#define CKEN17_MSL	(1 << 17)	/* MSL Unit Clock Enable */
 #define CKEN16_LCD	(1 << 16)	/* LCD Unit Clock Enable */
+#define CKEN15_PWRI2C	(1 << 15)	/* PWR I2C Unit Clock Enable */
 #define CKEN14_I2C	(1 << 14)	/* I2C Unit Clock Enable */
 #define CKEN13_FICP	(1 << 13)	/* FICP Unit Clock Enable */
 #define CKEN12_MMC	(1 << 12)	/* MMC Unit Clock Enable */
 #define CKEN11_USB	(1 << 11)	/* USB Unit Clock Enable */
+#define CKEN10_USBHOST	(1 << 10)	/* USB Host Unit Clock Enable */
+#define CKEN9_OSTIMER	(1 << 9)	/* OS Timer Unit Clock Enable */
 #define CKEN8_I2S	(1 << 8)	/* I2S Unit Clock Enable */
 #define CKEN7_BTUART	(1 << 7)	/* BTUART Unit Clock Enable */
 #define CKEN6_FFUART	(1 << 6)	/* FFUART Unit Clock Enable */
 #define CKEN5_STUART	(1 << 5)	/* STUART Unit Clock Enable */
+#define CKEN4_SSP3	(1 << 4)	/* SSP3 Unit Clock Enable */
 #define CKEN3_SSP	(1 << 3)	/* SSP Unit Clock Enable */
+#define CKEN3_SSP2	(1 << 3)	/* SSP2 Unit Clock Enable */
 #define CKEN2_AC97	(1 << 2)	/* AC97 Unit Clock Enable */
 #define CKEN1_PWM1	(1 << 1)	/* PWM1 Clock Enable */
 #define CKEN0_PWM0	(1 << 0)	/* PWM0 Clock Enable */
@@ -1175,6 +1572,12 @@ typedef void            (*ExcpHndlr) (void) ;
 #define TMEDRGBR	__REG(0x44000040)  /* TMED RGB Seed Register */
 #define TMEDCR		__REG(0x44000044)  /* TMED Control Register */
 
+#define LCCR3_1BPP (0 << 24)
+#define LCCR3_2BPP (1 << 24)
+#define LCCR3_4BPP (2 << 24)
+#define LCCR3_8BPP (3 << 24)
+#define LCCR3_16BPP (4 << 24)
+
 #define FDADR0		__REG(0x44000200)  /* DMA Channel 0 Frame Descriptor Address Register */
 #define FSADR0		__REG(0x44000204)  /* DMA Channel 0 Frame Source Address Register */
 #define FIDR0		__REG(0x44000208)  /* DMA Channel 0 Frame ID Register */
@@ -1185,15 +1588,27 @@ typedef void            (*ExcpHndlr) (void) ;
 #define LDCMD1		__REG(0x4400021C)  /* DMA Channel 1 Command Register */
 
 #define LCCR0_ENB	(1 << 0)	/* LCD Controller enable */
-#define LCCR0_CMS	(1 << 1)	/* Color = 0, Monochrome = 1 */
-#define LCCR0_SDS	(1 << 2)	/* Single Panel = 0, Dual Panel = 1 */
+#define LCCR0_CMS	(1 << 1)	/* Color/Monochrome Display Select */
+#define LCCR0_Color     (LCCR0_CMS*0)   /*  Color display                  */
+#define LCCR0_Mono      (LCCR0_CMS*1)   /*  Monochrome display             */
+#define LCCR0_SDS	(1 << 2)	/* Single/Dual Panel Display       */
+                                        /* Select                          */
+#define LCCR0_Sngl      (LCCR0_SDS*0)   /*  Single panel display           */
+#define LCCR0_Dual      (LCCR0_SDS*1)   /*  Dual panel display             */
+
 #define LCCR0_LDM	(1 << 3)	/* LCD Disable Done Mask */
 #define LCCR0_SFM	(1 << 4)	/* Start of frame mask */
 #define LCCR0_IUM	(1 << 5)	/* Input FIFO underrun mask */
 #define LCCR0_EFM	(1 << 6)	/* End of Frame mask */
-#define LCCR0_PAS	(1 << 7)	/* Passive = 0, Active = 1 */
-#define LCCR0_BLE	(1 << 8)	/* Little Endian = 0, Big Endian = 1 */
-#define LCCR0_DPD	(1 << 9)	/* Double Pixel mode, 4 pixel value = 0, 8 pixle values = 1 */
+#define LCCR0_PAS	(1 << 7)	/* Passive/Active display Select   */
+#define LCCR0_Pas       (LCCR0_PAS*0)   /*  Passive display (STN)          */
+#define LCCR0_Act       (LCCR0_PAS*1)   /*  Active display (TFT)           */
+#define LCCR0_DPD	(1 << 9)	/* Double Pixel Data (monochrome   */
+                                        /* display mode)                   */
+#define LCCR0_4PixMono  (LCCR0_DPD*0)   /*  4-Pixel/clock Monochrome       */
+                                        /*  display                        */
+#define LCCR0_8PixMono  (LCCR0_DPD*1)   /*  8-Pixel/clock Monochrome       */
+                                        /*  display                        */
 #define LCCR0_DIS	(1 << 10)	/* LCD Disable */
 #define LCCR0_QDM	(1 << 11)	/* LCD Quick Disable mask */
 #define LCCR0_PDD	(0xff << 12)	/* Palette DMA request delay */
@@ -1255,8 +1670,15 @@ typedef void            (*ExcpHndlr) (void) ;
 #define LCCR3_API_S	16
 #define LCCR3_VSP	(1 << 20)	/* vertical sync polarity */
 #define LCCR3_HSP	(1 << 21)	/* horizontal sync polarity */
-#define LCCR3_PCP	(1 << 22)	/* pixel clock polarity */
-#define LCCR3_OEP	(1 << 23)	/* output enable polarity */
+#define LCCR3_PCP	(1 << 22)	/* Pixel Clock Polarity (L_PCLK)   */
+#define LCCR3_PixRsEdg  (LCCR3_PCP*0)   /*  Pixel clock Rising-Edge        */
+#define LCCR3_PixFlEdg  (LCCR3_PCP*1)   /*  Pixel clock Falling-Edge       */
+
+#define LCCR3_OEP       (1 << 23)       /* Output Enable Polarity (L_BIAS, */
+                                        /* active display mode)            */
+#define LCCR3_OutEnH    (LCCR3_OEP*0)   /*  Output Enable active High      */
+#define LCCR3_OutEnL    (LCCR3_OEP*1)   /*  Output Enable active Low       */
+
 #if 0
 #define LCCR3_BPP	(7 << 24)	/* bits per pixel */
 #define LCCR3_BPP_S	24
@@ -1336,6 +1758,19 @@ typedef void            (*ExcpHndlr) (void) ;
 #define MDMRS		__REG(0x48000040)  /* MRS value to be written to SDRAM */
 #define BOOT_DEF	__REG(0x48000044)  /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
 
+/*
+ * More handy macros for PCMCIA
+ *
+ * Arg is socket number
+ */
+#define MCMEM(s)	__REG2(0x48000028, (s)<<2 )  /* Card interface Common Memory Space Socket s Timing */
+#define MCATT(s)	__REG2(0x48000030, (s)<<2 )  /* Card interface Attribute Space Socket s Timing Configuration */
+#define MCIO(s)		__REG2(0x48000038, (s)<<2 )  /* Card interface I/O Space Socket s Timing Configuration */
+
+/* MECR register defines */
+#define MECR_NOS	(1 << 0)	/* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
+#define MECR_CIT	(1 << 1)	/* Card Is There: 0 -> no card, 1 -> card inserted */
+
 #define MDREFR_K2FREE	(1 << 25)	/* SDRAM Free-Running Control */
 #define MDREFR_K1FREE	(1 << 24)	/* SDRAM Free-Running Control */
 #define MDREFR_K0FREE	(1 << 23)	/* SDRAM Free-Running Control */
@@ -1351,4 +1786,274 @@ typedef void            (*ExcpHndlr) (void) ;
 #define MDREFR_E0PIN	(1 << 12)	/* SDCKE0 Level Control/Status */
 
 
+#ifdef CONFIG_PXA27x
+
+/*
+ * Keypad
+ */
+#define KPC             __REG(0x41500000) /* Keypad Interface Control register */
+#define KPDK            __REG(0x41500008) /* Keypad Interface Direct Key register */
+#define KPREC           __REG(0x41500010) /* Keypad Interface Rotary Encoder register */
+#define KPMK            __REG(0x41500018) /* Keypad Interface Matrix Key register */
+#define KPAS            __REG(0x41500020) /* Keypad Interface Automatic Scan register */
+#define KPASMKP0        __REG(0x41500028) /* Keypad Interface Automatic Scan Multiple Key Presser register 0 */
+#define KPASMKP1        __REG(0x41500030) /* Keypad Interface Automatic Scan Multiple Key Presser register 1 */
+#define KPASMKP2        __REG(0x41500038) /* Keypad Interface Automatic Scan Multiple Key Presser register 2 */
+#define KPASMKP3        __REG(0x41500040) /* Keypad Interface Automatic Scan Multiple Key Presser register 3 */
+#define KPKDI           __REG(0x41500048) /* Keypad Interface Key Debounce Interval register */
+
+#define KPC_AS          (0x1 << 30)  /* Automatic Scan bit */
+#define KPC_ASACT       (0x1 << 29)  /* Automatic Scan on Activity */
+#define KPC_MI          (0x1 << 22)  /* Matrix interrupt bit */
+#define KPC_IMKP        (0x1 << 21)  /* Ignore Multiple Key Press */
+#define KPC_MS7         (0x1 << 20)  /* Matrix scan line 7 */
+#define KPC_MS6         (0x1 << 19)  /* Matrix scan line 6 */
+#define KPC_MS5         (0x1 << 18)  /* Matrix scan line 5 */
+#define KPC_MS4         (0x1 << 17)  /* Matrix scan line 4 */
+#define KPC_MS3         (0x1 << 16)  /* Matrix scan line 3 */
+#define KPC_MS2         (0x1 << 15)  /* Matrix scan line 2 */
+#define KPC_MS1         (0x1 << 14)  /* Matrix scan line 1 */
+#define KPC_MS0         (0x1 << 13)  /* Matrix scan line 0 */
+#define KPC_MS_ALL      (KPC_MS0 | KPC_MS1 | KPC_MS2 | KPC_MS3 | KPC_MS4 | KPC_MS5 | KPC_MS6 | KPC_MS7)
+#define KPC_ME          (0x1 << 12)  /* Matrix Keypad Enable */
+#define KPC_MIE         (0x1 << 11)  /* Matrix Interrupt Enable */
+#define KPC_DK_DEB_SEL	(0x1 <<  9)  /* Direct Keypad Debounce Select */
+#define KPC_DI          (0x1 <<  5)  /* Direct key interrupt bit */
+#define KPC_RE_ZERO_DEB (0x1 <<  4)  /* Rotary Encoder Zero Debounce */
+#define KPC_REE1        (0x1 <<  3)  /* Rotary Encoder1 Enable */
+#define KPC_REE0        (0x1 <<  2)  /* Rotary Encoder0 Enable */
+#define KPC_DE          (0x1 <<  1)  /* Direct Keypad Enable */
+#define KPC_DIE         (0x1 <<  0)  /* Direct Keypad interrupt Enable */
+
+#define KPDK_DKP        (0x1 << 31)
+#define KPDK_DK7        (0x1 <<  7)
+#define KPDK_DK6        (0x1 <<  6)
+#define KPDK_DK5        (0x1 <<  5)
+#define KPDK_DK4        (0x1 <<  4)
+#define KPDK_DK3        (0x1 <<  3)
+#define KPDK_DK2        (0x1 <<  2)
+#define KPDK_DK1        (0x1 <<  1)
+#define KPDK_DK0        (0x1 <<  0)
+
+#define KPREC_OF1       (0x1 << 31)
+#define kPREC_UF1       (0x1 << 30)
+#define KPREC_OF0       (0x1 << 15)
+#define KPREC_UF0       (0x1 << 14)
+
+#define KPMK_MKP        (0x1 << 31)
+#define KPAS_SO         (0x1 << 31)
+#define KPASMKPx_SO     (0x1 << 31)
+
+/*
+ * UHC: USB Host Controller (OHCI-like) register definitions
+ */
+#define UHC_BASE_PHYS	(0x4C000000)
+#define UHCREV		__REG(0x4C000000) /* UHC HCI Spec Revision */
+#define UHCHCON		__REG(0x4C000004) /* UHC Host Control Register */
+#define UHCCOMS		__REG(0x4C000008) /* UHC Command Status Register */
+#define UHCINTS		__REG(0x4C00000C) /* UHC Interrupt Status Register */
+#define UHCINTE		__REG(0x4C000010) /* UHC Interrupt Enable */
+#define UHCINTD		__REG(0x4C000014) /* UHC Interrupt Disable */
+#define UHCHCCA		__REG(0x4C000018) /* UHC Host Controller Comm. Area */
+#define UHCPCED		__REG(0x4C00001C) /* UHC Period Current Endpt Descr */
+#define UHCCHED		__REG(0x4C000020) /* UHC Control Head Endpt Descr */
+#define UHCCCED		__REG(0x4C000024) /* UHC Control Current Endpt Descr */
+#define UHCBHED		__REG(0x4C000028) /* UHC Bulk Head Endpt Descr */
+#define UHCBCED		__REG(0x4C00002C) /* UHC Bulk Current Endpt Descr */
+#define UHCDHEAD	__REG(0x4C000030) /* UHC Done Head */
+#define UHCFMI		__REG(0x4C000034) /* UHC Frame Interval */
+#define UHCFMR		__REG(0x4C000038) /* UHC Frame Remaining */
+#define UHCFMN		__REG(0x4C00003C) /* UHC Frame Number */
+#define UHCPERS		__REG(0x4C000040) /* UHC Periodic Start */
+#define UHCLS		__REG(0x4C000044) /* UHC Low Speed Threshold */
+#define UHCRHDA		__REG(0x4C000048) /* UHC Root Hub Descriptor A */
+#define UHCRHDB		__REG(0x4C00004C) /* UHC Root Hub Descriptor B */
+#define UHCRHS		__REG(0x4C000050) /* UHC Root Hub Status */
+#define UHCRHPS1	__REG(0x4C000054) /* UHC Root Hub Port 1 Status */
+#define UHCRHPS2	__REG(0x4C000058) /* UHC Root Hub Port 2 Status */
+#define UHCRHPS3	__REG(0x4C00005C) /* UHC Root Hub Port 3 Status */
+
+#define UHCSTAT		__REG(0x4C000060) /* UHC Status Register */
+#define UHCSTAT_UPS3	(1 << 16)	/* USB Power Sense Port3 */
+#define UHCSTAT_SBMAI	(1 << 15)	/* System Bus Master Abort Interrupt*/
+#define UHCSTAT_SBTAI	(1 << 14)	/* System Bus Target Abort Interrupt*/
+#define UHCSTAT_UPRI	(1 << 13)	/* USB Port Resume Interrupt */
+#define UHCSTAT_UPS2	(1 << 12)	/* USB Power Sense Port 2 */
+#define UHCSTAT_UPS1	(1 << 11)	/* USB Power Sense Port 1 */
+#define UHCSTAT_HTA	(1 << 10)	/* HCI Target Abort */
+#define UHCSTAT_HBA	(1 << 8)	/* HCI Buffer Active */
+#define UHCSTAT_RWUE	(1 << 7)	/* HCI Remote Wake Up Event */
+
+#define UHCHR           __REG(0x4C000064) /* UHC Reset Register */
+#define UHCHR_SSEP3	(1 << 11)	/* Sleep Standby Enable for Port3 */
+#define UHCHR_SSEP2	(1 << 10)	/* Sleep Standby Enable for Port2 */
+#define UHCHR_SSEP1	(1 << 9)	/* Sleep Standby Enable for Port1 */
+#define UHCHR_PCPL	(1 << 7)	/* Power control polarity low */
+#define UHCHR_PSPL	(1 << 6)	/* Power sense polarity low */
+#define UHCHR_SSE	(1 << 5)	/* Sleep Standby Enable */
+#define UHCHR_UIT	(1 << 4)	/* USB Interrupt Test */
+#define UHCHR_SSDC	(1 << 3)	/* Simulation Scale Down Clock */
+#define UHCHR_CGR	(1 << 2)	/* Clock Generation Reset */
+#define UHCHR_FHR	(1 << 1)	/* Force Host Controller Reset */
+#define UHCHR_FSBIR	(1 << 0)	/* Force System Bus Iface Reset */
+
+#define UHCHIE          __REG(0x4C000068) /* UHC Interrupt Enable Register*/
+#define UHCHIE_UPS3IE	(1 << 14)	/* Power Sense Port3 IntEn */
+#define UHCHIE_UPRIE	(1 << 13)	/* Port Resume IntEn */
+#define UHCHIE_UPS2IE	(1 << 12)	/* Power Sense Port2 IntEn */
+#define UHCHIE_UPS1IE	(1 << 11)	/* Power Sense Port1 IntEn */
+#define UHCHIE_TAIE	(1 << 10)	/* HCI Interface Transfer Abort
+					   Interrupt Enable*/
+#define UHCHIE_HBAIE	(1 << 8)	/* HCI Buffer Active IntEn */
+#define UHCHIE_RWIE	(1 << 7)	/* Remote Wake-up IntEn */
+
+#define UHCHIT          __REG(0x4C00006C) /* UHC Interrupt Test register */
+
+/* Camera Interface */
+#define CICR0		__REG(0x50000000)
+#define CICR1		__REG(0x50000004)
+#define CICR2		__REG(0x50000008)
+#define CICR3		__REG(0x5000000C)
+#define CICR4		__REG(0x50000010)
+#define CISR		__REG(0x50000014)
+#define CIFR		__REG(0x50000018)
+#define CITOR		__REG(0x5000001C)
+#define CIBR0		__REG(0x50000028)
+#define CIBR1		__REG(0x50000030)
+#define CIBR2		__REG(0x50000038)
+
+#define CICR0_DMAEN	(1 << 31)	/* DMA request enable */
+#define CICR0_PAR_EN	(1 << 30)	/* Parity enable */
+#define CICR0_SL_CAP_EN	(1 << 29)	/* Capture enable for slave mode */
+#define CICR0_ENB	(1 << 28)	/* Camera interface enable */
+#define CICR0_DIS	(1 << 27)	/* Camera interface disable */
+#define CICR0_SIM	(0x7 << 24)	/* Sensor interface mode mask */
+#define CICR0_TOM	(1 << 9)	/* Time-out mask */
+#define CICR0_RDAVM	(1 << 8)	/* Receive-data-available mask */
+#define CICR0_FEM	(1 << 7)	/* FIFO-empty mask */
+#define CICR0_EOLM	(1 << 6)	/* End-of-line mask */
+#define CICR0_PERRM	(1 << 5)	/* Parity-error mask */
+#define CICR0_QDM	(1 << 4)	/* Quick-disable mask */
+#define CICR0_CDM	(1 << 3)	/* Disable-done mask */
+#define CICR0_SOFM	(1 << 2)	/* Start-of-frame mask */
+#define CICR0_EOFM	(1 << 1)	/* End-of-frame mask */
+#define CICR0_FOM	(1 << 0)	/* FIFO-overrun mask */
+
+#define CICR1_TBIT	(1 << 31)	/* Transparency bit */
+#define CICR1_RGBT_CONV	(0x3 << 30)	/* RGBT conversion mask */
+#define CICR1_PPL	(0x3f << 15)	/* Pixels per line mask */
+#define CICR1_RGB_CONV	(0x7 << 12)	/* RGB conversion mask */
+#define CICR1_RGB_F	(1 << 11)	/* RGB format */
+#define CICR1_YCBCR_F	(1 << 10)	/* YCbCr format */
+#define CICR1_RGB_BPP	(0x7 << 7)	/* RGB bis per pixel mask */
+#define CICR1_RAW_BPP	(0x3 << 5)	/* Raw bis per pixel mask */
+#define CICR1_COLOR_SP	(0x3 << 3)	/* Color space mask */
+#define CICR1_DW	(0x7 << 0)	/* Data width mask */
+
+#define CICR2_BLW	(0xff << 24)	/* Beginning-of-line pixel clock
+					   wait count mask */
+#define CICR2_ELW	(0xff << 16)	/* End-of-line pixel clock
+					   wait count mask */
+#define CICR2_HSW	(0x3f << 10)	/* Horizontal sync pulse width mask */
+#define CICR2_BFPW	(0x3f << 3)	/* Beginning-of-frame pixel clock
+					   wait count mask */
+#define CICR2_FSW	(0x7 << 0)	/* Frame stabilization
+					   wait count mask */
+
+#define CICR3_BFW	(0xff << 24)	/* Beginning-of-frame line clock
+					   wait count mask */
+#define CICR3_EFW	(0xff << 16)	/* End-of-frame line clock
+					   wait count mask */
+#define CICR3_VSW	(0x3f << 10)	/* Vertical sync pulse width mask */
+#define CICR3_BFPW	(0x3f << 3)	/* Beginning-of-frame pixel clock
+					   wait count mask */
+#define CICR3_LPF	(0x3ff << 0)	/* Lines per frame mask */
+
+#define CICR4_MCLK_DLY	(0x3 << 24)	/* MCLK Data Capture Delay mask */
+#define CICR4_PCLK_EN	(1 << 23)	/* Pixel clock enable */
+#define CICR4_PCP	(1 << 22)	/* Pixel clock polarity */
+#define CICR4_HSP	(1 << 21)	/* Horizontal sync polarity */
+#define CICR4_VSP	(1 << 20)	/* Vertical sync polarity */
+#define CICR4_MCLK_EN	(1 << 19)	/* MCLK enable */
+#define CICR4_FR_RATE	(0x7 << 8)	/* Frame rate mask */
+#define CICR4_DIV	(0xff << 0)	/* Clock divisor mask */
+
+#define CISR_FTO	(1 << 15)	/* FIFO time-out */
+#define CISR_RDAV_2	(1 << 14)	/* Channel 2 receive data available */
+#define CISR_RDAV_1	(1 << 13)	/* Channel 1 receive data available */
+#define CISR_RDAV_0	(1 << 12)	/* Channel 0 receive data available */
+#define CISR_FEMPTY_2	(1 << 11)	/* Channel 2 FIFO empty */
+#define CISR_FEMPTY_1	(1 << 10)	/* Channel 1 FIFO empty */
+#define CISR_FEMPTY_0	(1 << 9)	/* Channel 0 FIFO empty */
+#define CISR_EOL	(1 << 8)	/* End of line */
+#define CISR_PAR_ERR	(1 << 7)	/* Parity error */
+#define CISR_CQD	(1 << 6)	/* Camera interface quick disable */
+#define CISR_SOF	(1 << 5)	/* Start of frame */
+#define CISR_CDD	(1 << 4)	/* Camera interface disable done */
+#define CISR_EOF	(1 << 3)	/* End of frame */
+#define CISR_IFO_2	(1 << 2)	/* FIFO overrun for Channel 2 */
+#define CISR_IFO_1	(1 << 1)	/* FIFO overrun for Channel 1 */
+#define CISR_IFO_0	(1 << 0)	/* FIFO overrun for Channel 0 */
+
+#define CIFR_FLVL2	(0x7f << 23)	/* FIFO 2 level mask */
+#define CIFR_FLVL1	(0x7f << 16)	/* FIFO 1 level mask */
+#define CIFR_FLVL0	(0xff << 8)	/* FIFO 0 level mask */
+#define CIFR_THL_0	(0x3 << 4)	/* Threshold Level for Channel 0 FIFO */
+#define CIFR_RESET_F	(1 << 3)	/* Reset input FIFOs */
+#define CIFR_FEN2	(1 << 2)	/* FIFO enable for channel 2 */
+#define CIFR_FEN1	(1 << 1)	/* FIFO enable for channel 1 */
+#define CIFR_FEN0	(1 << 0)	/* FIFO enable for channel 0 */
+
+#define SRAM_SIZE		0x40000 /* 4x64K  */
+
+#define SRAM_MEM_PHYS		0x5C000000
+
+#define IMPMCR		__REG(0x58000000) /* IM Power Management Control Reg */
+#define IMPMSR		__REG(0x58000008) /* IM Power Management Status Reg */
+
+#define IMPMCR_PC3		(0x3 << 22) /* Bank 3 Power Control */
+#define IMPMCR_PC3_RUN_MODE	(0x0 << 22) /*   Run mode */
+#define IMPMCR_PC3_STANDBY_MODE	(0x1 << 22) /*   Standby mode */
+#define IMPMCR_PC3_AUTO_MODE	(0x3 << 22) /*   Automatically controlled */
+
+#define IMPMCR_PC2		(0x3 << 20) /* Bank 2 Power Control */
+#define IMPMCR_PC2_RUN_MODE	(0x0 << 20) /*   Run mode */
+#define IMPMCR_PC2_STANDBY_MODE	(0x1 << 20) /*   Standby mode */
+#define IMPMCR_PC2_AUTO_MODE	(0x3 << 20) /*   Automatically controlled */
+
+#define IMPMCR_PC1		(0x3 << 18) /* Bank 1 Power Control */
+#define IMPMCR_PC1_RUN_MODE	(0x0 << 18) /*   Run mode */
+#define IMPMCR_PC1_STANDBY_MODE	(0x1 << 18) /*   Standby mode */
+#define IMPMCR_PC1_AUTO_MODE	(0x3 << 18) /*   Automatically controlled */
+
+#define IMPMCR_PC0		(0x3 << 16) /* Bank 0 Power Control */
+#define IMPMCR_PC0_RUN_MODE	(0x0 << 16) /*   Run mode */
+#define IMPMCR_PC0_STANDBY_MODE	(0x1 << 16) /*   Standby mode */
+#define IMPMCR_PC0_AUTO_MODE	(0x3 << 16) /*   Automatically controlled */
+
+#define IMPMCR_AW3		(1 << 11) /* Bank 3 Automatic Wake-up enable */
+#define IMPMCR_AW2		(1 << 10) /* Bank 2 Automatic Wake-up enable */
+#define IMPMCR_AW1		(1 << 9)  /* Bank 1 Automatic Wake-up enable */
+#define IMPMCR_AW0		(1 << 8)  /* Bank 0 Automatic Wake-up enable */
+
+#define IMPMCR_DST		(0xFF << 0) /* Delay Standby Time, ms */
+
+#define IMPMSR_PS3		(0x3 << 6) /* Bank 3 Power Status: */
+#define IMPMSR_PS3_RUN_MODE	(0x0 << 6) /*    Run mode */
+#define IMPMSR_PS3_STANDBY_MODE	(0x1 << 6) /*    Standby mode */
+
+#define IMPMSR_PS2		(0x3 << 4) /* Bank 2 Power Status: */
+#define IMPMSR_PS2_RUN_MODE	(0x0 << 4) /*    Run mode */
+#define IMPMSR_PS2_STANDBY_MODE	(0x1 << 4) /*    Standby mode */
+
+#define IMPMSR_PS1		(0x3 << 2) /* Bank 1 Power Status: */
+#define IMPMSR_PS1_RUN_MODE	(0x0 << 2) /*    Run mode */
+#define IMPMSR_PS1_STANDBY_MODE	(0x1 << 2) /*    Standby mode */
+
+#define IMPMSR_PS0		(0x3 << 0) /* Bank 0 Power Status: */
+#define IMPMSR_PS0_RUN_MODE	(0x0 << 0) /*    Run mode */
+#define IMPMSR_PS0_STANDBY_MODE	(0x1 << 0) /*    Standby mode */
+
+#endif
 
+#endif
diff --git a/include/asm-arm/arch-pxa/timex.h b/include/asm-arm/arch-pxa/timex.h
index fab199fc3..aa125ec56 100644
--- a/include/asm-arm/arch-pxa/timex.h
+++ b/include/asm-arm/arch-pxa/timex.h
@@ -10,8 +10,16 @@
  * published by the Free Software Foundation.
  */
 
-/*
- * PXA250/210 timer
- */
-#define CLOCK_TICK_RATE		3686400
-#define CLOCK_TICK_FACTOR	80
+#include <linux/config.h>
+
+#if defined(CONFIG_PXA25x)
+/* PXA250/210 timer base */
+#define CLOCK_TICK_RATE 3686400
+#elif defined(CONFIG_PXA27x)
+/* PXA27x timer base */
+#ifdef CONFIG_MACH_MAINSTONE
+#define CLOCK_TICK_RATE 3249600
+#else
+#define CLOCK_TICK_RATE 3250000
+#endif
+#endif
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h
index c6c147ef6..33fc75cde 100644
--- a/include/asm-arm/arch-rpc/memory.h
+++ b/include/asm-arm/arch-rpc/memory.h
@@ -15,39 +15,19 @@
  *   21-Mar-1999 RMK	Renamed to memory.h
  *		 RMK	Added TASK_SIZE and PAGE_OFFSET
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x10000000UL)
 
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-
 /*
  * These are exactly the same on the RiscPC as the
  * physical memory view.
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x) __phys_to_virt(x)
 
 #endif
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h
index 5fdd0d4e4..5321b9746 100644
--- a/include/asm-arm/arch-s3c2410/memory.h
+++ b/include/asm-arm/arch-s3c2410/memory.h
@@ -23,39 +23,16 @@
 #define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
- */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- *
  * DRAM starts at 0x30000000
-*/
-
-#define PAGE_OFFSET	(0xc0000000UL)
+ */
 #define PHYS_OFFSET	(0x30000000UL)
 
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-
 /*
  * These are exactly the same on the S3C2410 as the
  * physical memory view.
 */
 
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x) __phys_to_virt(x)
 
 #endif
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 823ea8c14..a8cc78960 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -574,12 +574,7 @@
 #define S3C2410_EINFLT2	   S3C2410_GPIOREG(0x9C)
 #define S3C2410_EINFLT3	   S3C2410_GPIOREG(0xA0)
 
-/* mask: 0=enable, 1=disable
- * 1 bit EINT, 4=EINT4, 23=EINT23
- * EINT0,1,2,3 are not handled here.
-*/
-#define S3C2410_EINTMASK   S3C2410_GPIOREG(0xA4)
-#define S3C2410_EINTPEND   S3C2410_GPIOREG(0xA8)
+/* removed EINTxxxx defs from here, not meant for this */
 
 /* GSTATUS have miscellaneous information in them
  *
diff --git a/include/asm-arm/arch-s3c2410/regs-irq.h b/include/asm-arm/arch-s3c2410/regs-irq.h
index b6b0223ef..87edb61ed 100644
--- a/include/asm-arm/arch-s3c2410/regs-irq.h
+++ b/include/asm-arm/arch-s3c2410/regs-irq.h
@@ -32,6 +32,11 @@
 #define S3C2410_SUBSRCPND      S3C2410_IRQREG(0x018)
 #define S3C2410_INTSUBMSK      S3C2410_IRQREG(0x01C)
 
+/* mask: 0=enable, 1=disable
+ * 1 bit EINT, 4=EINT4, 23=EINT23
+ * EINT0,1,2,3 are not handled here.
+*/
+
 #define S3C2410_EINTMASK       S3C2410_EINTREG(0x0A4)
 #define S3C2410_EINTPEND       S3C2410_EINTREG(0X0A8)
 
diff --git a/include/asm-arm/arch-s3c2410/time.h b/include/asm-arm/arch-s3c2410/time.h
index 435eba982..8aab3438a 100644
--- a/include/asm-arm/arch-s3c2410/time.h
+++ b/include/asm-arm/arch-s3c2410/time.h
@@ -122,7 +122,7 @@ void __init time_init (void)
 	 *   of 11.25MHz, and a tcnt of 56250.
 	 */
 
-	if (machine_is_h1940()) {
+	if (machine_is_h1940() || machine_is_smdk2410() ) {
 		timer_ticks_usec = s3c2410_pclk / (1000*1000);
 		timer_ticks_usec /= 6;
 
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index 076b3a9d4..38794846b 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -9,38 +9,11 @@
 
 #include <linux/config.h>
 
-/*
- * Task size: 3GB
- */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
-
 /*
  * Physical DRAM offset is 0xc0000000 on the SA1100
  */
 #define PHYS_OFFSET	(0xc0000000UL)
 
-/*
- * We take advantage of the fact that physical and virtual address can be the
- * same.  The NUMA code is handling the large holes that might exist between
- * all memory banks.
- */
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-#define __virt_to_phys(x)	(x)
-#define __phys_to_virt(x)	(x)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -50,8 +23,6 @@
  *
  * On the SA1100, bus addresses are equivalent to physical addresses.
  */
-#define __virt_to_bus__is_a_macro
-#define __bus_to_virt__is_a_macro
 #define __virt_to_bus(x)	 __virt_to_phys(x)
 #define __bus_to_virt(x)	 __phys_to_virt(x)
 
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h
index 18ab21255..7a06f07f6 100644
--- a/include/asm-arm/arch-shark/memory.h
+++ b/include/asm-arm/arch-shark/memory.h
@@ -11,31 +11,11 @@
 #define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: = 3GB
- */
-#define PAGE_OFFSET	(0xC0000000UL)
 #define PHYS_OFFSET     (0x08000000UL)
 
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-#define __virt_to_phys(vpage) (vpage - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(ppage) (ppage - PHYS_OFFSET + PAGE_OFFSET)
-
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	__virt_to_phys(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	__phys_to_virt(x)
 
 #endif
diff --git a/include/asm-arm/arch-tbox/memory.h b/include/asm-arm/arch-tbox/memory.h
index 7fc1c3032..a20479487 100644
--- a/include/asm-arm/arch-tbox/memory.h
+++ b/include/asm-arm/arch-tbox/memory.h
@@ -8,37 +8,14 @@
 #define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET		(0xc0000000UL)
 #define PHYS_OFFSET		(0x80000000UL)
 
-/*
- * DRAM is contiguous
- */
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-
 /*
  * Bus view is the same as physical view
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	__virt_to_phys(x)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	__phys_to_virt(x)
 
 #endif
diff --git a/include/asm-arm/arch-versatile/memory.h b/include/asm-arm/arch-versatile/memory.h
index 4b7295b4a..7b8b7cc42 100644
--- a/include/asm-arm/arch-versatile/memory.h
+++ b/include/asm-arm/arch-versatile/memory.h
@@ -17,35 +17,14 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 /*
- * Task size: 3GB
+ * Physical DRAM offset.
  */
-#define TASK_SIZE	(0xbf000000UL)
-#define TASK_SIZE_26	(0x04000000UL)
-
-/*
- * This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (0x40000000)
-
-/*
- * Page offset: 3GB
- */
-#define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0x00000000UL)
 
-/*
- * On Versatile PB, the dram is contiguous
- */
-#define __virt_to_phys__is_a_macro
-#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET)
-#define __phys_to_virt__is_a_macro
-#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
-
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -53,9 +32,7 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *              to an address that the kernel can use.
  */
-#define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	((x) - PAGE_OFFSET)
-#define __bus_to_virt__is_a_macro
 #define __bus_to_virt(x)	((x) + PAGE_OFFSET)
 
 #endif
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 61227d1a7..257d32f09 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -59,50 +59,47 @@ static inline void atomic_add(int i, atomic_t *v)
 	: "cc");
 }
 
-static inline void atomic_sub(int i, atomic_t *v)
+static inline int atomic_add_return(int i, atomic_t *v)
 {
-	unsigned long tmp, tmp2;
+	unsigned long tmp;
+	int result;
 
-	__asm__ __volatile__("@ atomic_sub\n"
+	__asm__ __volatile__("@ atomic_add_return\n"
 "1:	ldrex	%0, [%2]\n"
-"	sub	%0, %0, %3\n"
+"	add	%0, %0, %3\n"
 "	strex	%1, %0, [%2]\n"
 "	teq	%1, #0\n"
 "	bne	1b"
-	: "=&r" (tmp), "=&r" (tmp2)
+	: "=&r" (result), "=&r" (tmp)
 	: "r" (&v->counter), "Ir" (i)
 	: "cc");
-}
 
-#define atomic_inc(v)	atomic_add(1, v)
-#define atomic_dec(v)	atomic_sub(1, v)
+	return result;
+}
 
-static inline int atomic_dec_and_test(atomic_t *v)
+static inline void atomic_sub(int i, atomic_t *v)
 {
-	unsigned long tmp;
-	int result;
+	unsigned long tmp, tmp2;
 
-	__asm__ __volatile__("@ atomic_dec_and_test\n"
+	__asm__ __volatile__("@ atomic_sub\n"
 "1:	ldrex	%0, [%2]\n"
-"	sub	%0, %0, #1\n"
+"	sub	%0, %0, %3\n"
 "	strex	%1, %0, [%2]\n"
 "	teq	%1, #0\n"
 "	bne	1b"
-	: "=&r" (result), "=&r" (tmp)
-	: "r" (&v->counter)
+	: "=&r" (tmp), "=&r" (tmp2)
+	: "r" (&v->counter), "Ir" (i)
 	: "cc");
-
-	return result == 0;
 }
 
-static inline int atomic_add_negative(int i, atomic_t *v)
+static inline int atomic_sub_return(int i, atomic_t *v)
 {
 	unsigned long tmp;
 	int result;
 
-	__asm__ __volatile__("@ atomic_add_negative\n"
+	__asm__ __volatile__("@ atomic_sub_return\n"
 "1:	ldrex	%0, [%2]\n"
-"	add	%0, %0, %3\n"
+"	sub	%0, %0, %3\n"
 "	strex	%1, %0, [%2]\n"
 "	teq	%1, #0\n"
 "	bne	1b"
@@ -110,7 +107,7 @@ static inline int atomic_add_negative(int i, atomic_t *v)
 	: "r" (&v->counter), "Ir" (i)
 	: "cc");
 
-	return result < 0;
+	return result;
 }
 
 static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
@@ -147,57 +144,39 @@ static inline void atomic_add(int i, atomic_t *v)
 	local_irq_restore(flags);
 }
 
-static inline void atomic_sub(int i, atomic_t *v)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	v->counter -= i;
-	local_irq_restore(flags);
-}
-
-static inline void atomic_inc(atomic_t *v)
+static inline int atomic_add_return(int i, atomic_t *v)
 {
 	unsigned long flags;
+	int val;
 
 	local_irq_save(flags);
-	v->counter += 1;
+	val = v->counter;
+	v->counter = val += i;
 	local_irq_restore(flags);
-}
 
-static inline void atomic_dec(atomic_t *v)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	v->counter -= 1;
-	local_irq_restore(flags);
+	return val;
 }
 
-static inline int atomic_dec_and_test(atomic_t *v)
+static inline void atomic_sub(int i, atomic_t *v)
 {
 	unsigned long flags;
-	int val;
 
 	local_irq_save(flags);
-	val = v->counter;
-	v->counter = val -= 1;
+	v->counter -= i;
 	local_irq_restore(flags);
-
-	return val == 0;
 }
 
-static inline int atomic_add_negative(int i, atomic_t *v)
+static inline int atomic_sub_return(int i, atomic_t *v)
 {
 	unsigned long flags;
 	int val;
 
 	local_irq_save(flags);
 	val = v->counter;
-	v->counter = val += i;
+	v->counter = val -= i;
 	local_irq_restore(flags);
 
-	return val < 0;
+	return val;
 }
 
 static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
@@ -211,6 +190,14 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
 
 #endif /* __LINUX_ARM_ARCH__ */
 
+#define atomic_inc(v)		atomic_add(1, v)
+#define atomic_dec(v)		atomic_sub(1, v)
+
+#define atomic_inc_and_test(v)	(atomic_add_return(1, v) == 0)
+#define atomic_dec_and_test(v)	(atomic_sub_return(1, v) == 0)
+
+#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
+
 /* Atomic operations are already serializing on ARM */
 #define smp_mb__before_atomic_dec()	barrier()
 #define smp_mb__after_atomic_dec()	barrier()
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index 0e053301c..048ed44db 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -291,17 +291,12 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr)
  * about to change to user space.  This is the same method as used on SPARC64.
  * See update_mmu_cache for the user space part.
  */
-extern void __flush_dcache_page(struct page *);
+extern void flush_dcache_page(struct page *);
 
-static inline void flush_dcache_page(struct page *page)
-{
-	struct address_space *mapping = page_mapping(page);
-
-	if (mapping && !mapping_mapped(mapping))
-		set_bit(PG_dcache_dirty, &page->flags);
-	else
-		__flush_dcache_page(page);
-}
+#define flush_dcache_mmap_lock(mapping) \
+	spin_lock_irq(&(mapping)->tree_lock)
+#define flush_dcache_mmap_unlock(mapping) \
+	spin_unlock_irq(&(mapping)->tree_lock)
 
 #define flush_icache_user_range(vma,page,addr,len) \
 	flush_dcache_page(page)
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h
index 23faa6927..690e7f487 100644
--- a/include/asm-arm/hardware/sa1111.h
+++ b/include/asm-arm/hardware/sa1111.h
@@ -405,22 +405,6 @@
 #define GPIO_C6		(1 << 22)
 #define GPIO_C7		(1 << 23)
 
-#define PA_DDR		__CCREG(0x1000)
-#define PA_DRR		__CCREG(0x1004)
-#define PA_DWR		__CCREG(0x1004)
-#define PA_SDR		__CCREG(0x1008)
-#define PA_SSR		__CCREG(0x100c)
-#define PB_DDR		__CCREG(0x1010)
-#define PB_DRR		__CCREG(0x1014)
-#define PB_DWR		__CCREG(0x1014)
-#define PB_SDR		__CCREG(0x1018)
-#define PB_SSR		__CCREG(0x101c)
-#define PC_DDR		__CCREG(0x1020)
-#define PC_DRR		__CCREG(0x1024)
-#define PC_DWR		__CCREG(0x1024)
-#define PC_SDR		__CCREG(0x1028)
-#define PC_SSR		__CCREG(0x102c)
-
 /*
  * Interrupt Controller
  *
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index c57af4d65..b2b9b3da6 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -17,16 +17,18 @@
 #define MAX_HWIFS	4
 #endif
 
-#include <asm/arch/ide.h>
-
-/*
- * We always use the new IDE port registering,
- * so these are fixed here.
- */
-#define ide_default_io_base(i)		(0)
-#define ide_default_irq(b)		(0)
+#if defined(CONFIG_ARCH_LH7A40X) || defined(CONFIG_ARCH_SA1100)
+# include <asm/arch/ide.h>	/* obsolete + broken */
+#endif
 
-#define ide_init_default_irq(base)	(0)
+#if !defined(CONFIG_ARCH_L7200) && !defined(CONFIG_ARCH_LH7A40X)
+# define IDE_ARCH_OBSOLETE_INIT
+# ifdef CONFIG_ARCH_CLPS7500
+#  define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+# else
+#  define ide_default_io_ctl(base)	(0)
+# endif
+#endif /* !ARCH_L7200 && !ARCH_LH7A40X */
 
 #define __ide_mm_insw(port,addr,len)	readsw(port,addr,len)
 #define __ide_mm_insl(port,addr,len)	readsl(port,addr,len)
diff --git a/include/asm-arm/kmap_types.h b/include/asm-arm/kmap_types.h
index 69d967962..45def13ee 100644
--- a/include/asm-arm/kmap_types.h
+++ b/include/asm-arm/kmap_types.h
@@ -14,7 +14,6 @@ enum km_type {
 	KM_BIO_DST_IRQ,
 	KM_PTE0,
 	KM_PTE1,
-	KM_PTE2,
 	KM_IRQ0,
 	KM_IRQ1,
 	KM_SOFTIRQ0,
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index 2cd87b3c2..75da0b9c4 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -15,6 +15,37 @@
 #include <linux/config.h>
 #include <asm/arch/memory.h>
 
+#ifndef TASK_SIZE
+/*
+ * TASK_SIZE - the maximum size of a user space task.
+ * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
+ */
+#define TASK_SIZE		(0xbf000000UL)
+#define TASK_UNMAPPED_BASE	(0x40000000UL)
+#endif
+
+/*
+ * The maximum size of a 26-bit user space task.
+ */
+#define TASK_SIZE_26		(0x04000000UL)
+
+/*
+ * Page offset: 3GB
+ */
+#ifndef PAGE_OFFSET
+#define PAGE_OFFSET		(0xc0000000UL)
+#endif
+
+/*
+ * Physical vs virtual RAM address space conversion.  These are
+ * private definitions which should NOT be used outside memory.h
+ * files.  Use virt_to_phys/phys_to_virt/__pa/__va instead.
+ */
+#ifndef __virt_to_phys
+#define __virt_to_phys(x)	((x) - PAGE_OFFSET + PHYS_OFFSET)
+#define __phys_to_virt(x)	((x) - PHYS_OFFSET + PAGE_OFFSET)
+#endif
+
 /*
  * The module space lives between the addresses given by TASK_SIZE
  * and PAGE_OFFSET - it must be within 32MB of the kernel text.
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 63889334b..14ac954a1 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -312,6 +312,13 @@ PTE_BIT_FUNC(mkyoung,   |= L_PTE_YOUNG);
 		flush_pmd_entry(pmdp);	\
 	} while (0)
 
+#define copy_pmd(pmdpd,pmdps)		\
+	do {				\
+		pmdpd[0] = pmdps[0];	\
+		pmdpd[1] = pmdps[1];	\
+		flush_pmd_entry(pmdpd);	\
+	} while (0)
+
 #define pmd_clear(pmdp)			\
 	do {				\
 		pmdp[0] = __pmd(0);	\
@@ -407,8 +414,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 #define io_remap_page_range(vma,from,phys,size,prot) \
 		remap_page_range(vma,from,phys,size,prot)
 
-typedef pte_t *pte_addr_t;
-
 #define pgtable_cache_init() do { } while (0)
 
 #endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index 8dd08bb84..dc58da851 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -196,7 +196,6 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
 
 struct meminfo {
 	int nr_banks;
-	unsigned long end;
 	struct {
 		unsigned long start;
 		unsigned long size;
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 2d0354f7d..1c22e7fea 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -24,6 +24,7 @@ typedef struct {
 #define spin_lock_init(x)	do { *(x) = SPIN_LOCK_UNLOCKED; } while (0)
 #define spin_is_locked(x)	((x)->lock != 0)
 #define spin_unlock_wait(x)	do { barrier(); } while (spin_is_locked(x))
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 static inline void _raw_spin_lock(spinlock_t *lock)
 {
@@ -88,7 +89,7 @@ static inline void _raw_write_lock(rwlock_t *rw)
 "	strexeq	%0, %2, [%1]\n"
 "	teq	%0, #0\n"
 "	bne	1b"
-	: "=r" (tmp)
+	: "=&r" (tmp)
 	: "r" (&rw->lock), "r" (0x80000000)
 	: "cc", "memory");
 }
@@ -150,7 +151,7 @@ static inline int _raw_write_trylock(rwlock_t *rw)
 "1:	ldrex	%0, [%1]\n"
 "	teq	%0, #0\n"
 "	strexeq	%0, %2, [%1]"
-	: "=r" (tmp)
+	: "=&r" (tmp)
 	: "r" (&rw->lock), "r" (0x80000000)
 	: "cc", "memory");
 
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 9c26aecd9..d500cc940 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -137,22 +137,48 @@ extern unsigned int user_debug;
 #define set_wmb(var, value) do { var = value; wmb(); } while (0)
 #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
 
-#define prepare_to_switch()    do { } while(0)
+#ifdef CONFIG_SMP
+/*
+ * Define our own context switch locking.  This allows us to enable
+ * interrupts over the context switch, otherwise we end up with high
+ * interrupt latency.  The real problem area is switch_mm() which may
+ * do a full cache flush.
+ */
+#define prepare_arch_switch(rq,next)					\
+do {									\
+	spin_lock(&(next)->switch_lock);				\
+	spin_unlock_irq(&(rq)->lock);					\
+} while (0)
+
+#define finish_arch_switch(rq,prev)					\
+	spin_unlock(&(prev)->switch_lock)
+
+#define task_running(rq,p)						\
+	((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
+#else
+/*
+ * Our UP-case is more simple, but we assume knowledge of how
+ * spin_unlock_irq() and friends are implemented.  This avoids
+ * us needlessly decrementing and incrementing the preempt count.
+ */
+#define prepare_arch_switch(rq,next)	local_irq_enable()
+#define finish_arch_switch(rq,prev)	spin_unlock(&(rq)->lock)
+#define task_running(rq,p)		((rq)->curr == (p))
+#endif
 
 /*
  * switch_to(prev, next) should switch from task `prev' to `next'
- * `prev' will never be the same as `next'.
- * The `mb' is to tell GCC not to cache `current' across this call.
+ * `prev' will never be the same as `next'.  schedule() itself
+ * contains the memory barrier to tell GCC not to cache `current'.
  */
 struct thread_info;
 struct task_struct;
 extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
 
-#define switch_to(prev,next,last)						\
-	do {									\
-		last = __switch_to(prev,prev->thread_info,next->thread_info);	\
-		mb();								\
-	} while (0)
+#define switch_to(prev,next,last)					\
+do {									\
+	last = __switch_to(prev,prev->thread_info,next->thread_info);	\
+} while (0)
 
 /*
  * CPU interrupt mask handling.
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index ab1a6f4d6..f67431fdd 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -40,7 +40,7 @@ struct cpu_context_save {
 
 /*
  * low level task data that entry.S needs immediate access to.
- * We assume cpu_context follows immedately after cpu_domain.
+ * __switch_to() assumes cpu_context follows immediately after cpu_domain.
  */
 struct thread_info {
 	unsigned long		flags;		/* low level flags */
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index 22992ee06..f4c92e4c8 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -52,6 +52,8 @@ typedef unsigned long long u64;
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index 119745a6d..d01310569 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -13,7 +13,7 @@
  */
 #include <linux/sched.h>
 #include <asm/errno.h>
-#include <asm/arch/memory.h>
+#include <asm/memory.h>
 #include <asm/domain.h>
 #include <asm/system.h>
 
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index bb0a84e5f..1435eb396 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -448,6 +448,27 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
   __syscall_return(type,__res);						\
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
@@ -499,6 +520,8 @@ static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
 	return sys_wait4((int)pid, wait_stat, options, NULL);
 }
 
+extern long execve(const char *file, char **argv, char **envp);
+
 struct pt_regs;
 asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
 			struct pt_regs *regs);
@@ -514,12 +537,6 @@ asmlinkage long sys_rt_sigaction(int sig,
 				struct sigaction __user *oact,
 				size_t sigsetsize);
 
-/*
- * The following two can't be eliminated yet - they rely on
- * specific conditions.
- */
-static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
-
 #endif
 
 /*
diff --git a/include/asm-arm26/cacheflush.h b/include/asm-arm26/cacheflush.h
index 682962198..eb8877107 100644
--- a/include/asm-arm26/cacheflush.h
+++ b/include/asm-arm26/cacheflush.h
@@ -24,7 +24,6 @@
 #define flush_cache_mm(mm)                      do { } while (0)
 #define flush_cache_range(vma,start,end)        do { } while (0)
 #define flush_cache_page(vma,vmaddr)            do { } while (0)
-#define flush_page_to_ram(page)                 do { } while (0)
 #define flush_cache_vmap(start, end)		do { } while (0)
 #define flush_cache_vunmap(start, end)		do { } while (0)
 
@@ -32,6 +31,8 @@
 #define clean_dcache_range(start,end)           do { } while (0)
 #define flush_dcache_range(start,end)           do { } while (0)
 #define flush_dcache_page(page)                 do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define clean_dcache_entry(_s)                  do { } while (0)
 #define clean_cache_entry(_start)               do { } while (0)
 
diff --git a/include/asm-arm26/ide.h b/include/asm-arm26/ide.h
index 3a3a6fdfe..db804d751 100644
--- a/include/asm-arm26/ide.h
+++ b/include/asm-arm26/ide.h
@@ -26,51 +26,8 @@
 #define __ide_mm_outsw(port,addr,len)   writesw(port,addr,len)
 #define __ide_mm_outsl(port,addr,len)   writesl(port,addr,len)
 
-/*
- * Set up a hw structure for a specified data port, control port and IRQ.
- * This should follow whatever the default interface uses.
- */
-static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
-				       unsigned long ctrl_port, int *irq)
-{
-	unsigned long reg = data_port;
-        int i;
-
-        for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
-                hw->io_ports[i] = reg;
-                reg += 1;
-        }
-	hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
-        if (irq)
-                *irq = 0;
-}
-
-#define ide_init_default_irq(base)	(0)
-
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
-static __inline__ void ide_init_default_hwifs(void)
-{
-        if (machine_is_a5k()) {
-                hw_regs_t hw;
-
-                memset(&hw, 0, sizeof(hw));
-
-                ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
-                hw.irq = IRQ_HARDDISK;
-                ide_register_hw(&hw,NULL);
-        }
-}
-
-
-/*
- * We always use the new IDE port registering,
- * so these are fixed here.
- */
-#define ide_default_io_base(i)		(0)
-#define ide_default_irq(b)		(0)
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	(0)
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
index 55b667aa7..d8a0f65c6 100644
--- a/include/asm-arm26/pgtable.h
+++ b/include/asm-arm26/pgtable.h
@@ -290,8 +290,6 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
 #define io_remap_page_range(vma,from,phys,size,prot) \
 		remap_page_range(vma,from,phys,size,prot)
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h
index 81bd357ad..56cbe573a 100644
--- a/include/asm-arm26/types.h
+++ b/include/asm-arm26/types.h
@@ -52,6 +52,8 @@ typedef unsigned long long u64;
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h
index 98bd48fbf..e64b01117 100644
--- a/include/asm-arm26/unistd.h
+++ b/include/asm-arm26/unistd.h
@@ -375,6 +375,31 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {			\
   __syscall_return(type,__res);								\
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-cris/arch-v10/cache.h b/include/asm-cris/arch-v10/cache.h
index 1e796271e..1d1d1ba65 100644
--- a/include/asm-cris/arch-v10/cache.h
+++ b/include/asm-cris/arch-v10/cache.h
@@ -3,6 +3,7 @@
 
 /* Etrax 100LX have 32-byte cache-lines. */
 #define L1_CACHE_BYTES 32
+#define L1_CACHE_SHIFT 5
 #define L1_CACHE_SHIFT_MAX 5
 
 #endif /* _ASM_ARCH_CACHE_H */
diff --git a/include/asm-cris/arch-v10/irq.h b/include/asm-cris/arch-v10/irq.h
index f657c75dd..a2a6e1533 100644
--- a/include/asm-cris/arch-v10/irq.h
+++ b/include/asm-cris/arch-v10/irq.h
@@ -8,6 +8,11 @@
 #include <asm/arch/sv_addr_ag.h>
 
 #define NR_IRQS 32
+
+/* The first vector number used for IRQs in v10 is really 0x20 */
+/* but all the code and constants are offseted to make 0 the first */
+#define FIRST_IRQ 0
+
 #define SOME_IRQ_NBR        IO_BITNR(R_VECT_MASK_RD, some)   /* 0 ? */
 #define NMI_IRQ_NBR         IO_BITNR(R_VECT_MASK_RD, nmi)    /* 1 */
 #define TIMER0_IRQ_NBR      IO_BITNR(R_VECT_MASK_RD, timer0) /* 2 */
diff --git a/include/asm-cris/arch-v10/offset.h b/include/asm-cris/arch-v10/offset.h
index 87901a752..fcbd77eab 100644
--- a/include/asm-cris/arch-v10/offset.h
+++ b/include/asm-cris/arch-v10/offset.h
@@ -25,7 +25,7 @@
 #define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */
 #define THREAD_dccr 8 /* offsetof(struct thread_struct, dccr) */
 
-#define TASK_pid 121 /* offsetof(struct task_struct, pid) */
+#define TASK_pid 133 /* offsetof(struct task_struct, pid) */
 
 #define LCLONE_VM 256 /* CLONE_VM */
 #define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */
diff --git a/include/asm-cris/atomic.h b/include/asm-cris/atomic.h
index 19ae993cb..b3dfea5a7 100644
--- a/include/asm-cris/atomic.h
+++ b/include/asm-cris/atomic.h
@@ -56,6 +56,8 @@ extern __inline__ int atomic_add_return(int i, volatile atomic_t *v)
 	return retval;
 }
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
 extern __inline__ int atomic_sub_return(int i, volatile atomic_t *v)
 {
 	unsigned long flags;
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h
index f74010366..d7861115d 100644
--- a/include/asm-cris/bitops.h
+++ b/include/asm-cris/bitops.h
@@ -295,6 +295,50 @@ extern inline int find_next_zero_bit (void * addr, int size, int offset)
 	return result + ffz(tmp);
 }
 
+/**
+ * find_next_bit - find the first set bit in a memory region
+ * @addr: The address to base the search on
+ * @offset: The bitnumber to start searching at
+ * @size: The maximum size to search
+ */
+static __inline__ int find_next_bit(void *addr, int size, int offset)
+{
+	unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
+        unsigned long result = offset & ~31UL;
+        unsigned long tmp;
+
+        if (offset >= size)
+                return size;
+        size -= result;
+        offset &= 31UL;
+        if (offset) {
+                tmp = *(p++);
+                tmp &= (~0UL << offset);
+                if (size < 32)
+                        goto found_first;
+                if (tmp)
+                        goto found_middle;
+                size -= 32;
+                result += 32;
+        }
+        while (size & ~31UL) {
+                if ((tmp = *(p++)))
+                        goto found_middle;
+                result += 32;
+                size -= 32;
+        }
+        if (!size)
+                return result;
+        tmp = *p;
+
+found_first:
+        tmp &= (~0UL >> (32 - size));
+        if (tmp == 0UL)        /* Are any bits set? */
+                return result + size; /* Nope. */
+found_middle:
+        return result + __ffs(tmp);
+}
+
 /**
  * find_first_zero_bit - find the first zero bit in a memory region
  * @addr: The address to start the search at
@@ -306,6 +350,8 @@ extern inline int find_next_zero_bit (void * addr, int size, int offset)
 
 #define find_first_zero_bit(addr, size) \
         find_next_zero_bit((addr), (size), 0)
+#define find_first_bit(addr, size) \
+        find_next_bit((addr), (size), 0)
 
 #define ext2_set_bit                 test_and_set_bit
 #define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
diff --git a/include/asm-cris/cacheflush.h b/include/asm-cris/cacheflush.h
index 316020598..793fea286 100644
--- a/include/asm-cris/cacheflush.h
+++ b/include/asm-cris/cacheflush.h
@@ -11,8 +11,9 @@
 #define flush_cache_mm(mm)			do { } while (0)
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
-#define flush_page_to_ram(page)			do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start, end)		do { } while (0)
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
diff --git a/include/asm-cris/dma-mapping.h b/include/asm-cris/dma-mapping.h
index e7e16901f..0d770f601 100644
--- a/include/asm-cris/dma-mapping.h
+++ b/include/asm-cris/dma-mapping.h
@@ -1 +1,125 @@
-#include <asm-generic/dma-mapping.h>
+#ifndef _ASM_CRIS_DMA_MAPPING_H
+#define _ASM_CRIS_DMA_MAPPING_H
+
+#include "scatterlist.h"
+
+static inline int
+dma_supported(struct device *dev, u64 mask)
+{
+	BUG();
+	return 0;
+}
+
+static inline int
+dma_set_mask(struct device *dev, u64 dma_mask)
+{
+	BUG();
+	return 1;
+}
+
+static inline void *
+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
+		   int flag)
+{
+	BUG();
+	return NULL;
+}
+
+static inline void
+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
+		    dma_addr_t dma_handle)
+{
+	BUG();
+}
+
+static inline dma_addr_t
+dma_map_single(struct device *dev, void *cpu_addr, size_t size,
+	       enum dma_data_direction direction)
+{
+	BUG();
+	return 0;
+}
+
+static inline void
+dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
+		 enum dma_data_direction direction)
+{
+	BUG();
+}
+
+static inline dma_addr_t
+dma_map_page(struct device *dev, struct page *page,
+	     unsigned long offset, size_t size,
+	     enum dma_data_direction direction)
+{
+	BUG();
+	return 0;
+}
+
+static inline void
+dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
+	       enum dma_data_direction direction)
+{
+	BUG();
+}
+
+static inline int
+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
+	   enum dma_data_direction direction)
+{
+	BUG();
+	return 1;
+}
+
+static inline void
+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
+	     enum dma_data_direction direction)
+{
+	BUG();
+}
+
+static inline void
+dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size,
+		enum dma_data_direction direction)
+{
+	BUG();
+}
+
+static inline void
+dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems,
+	    enum dma_data_direction direction)
+{
+	BUG();
+}
+
+/* Now for the API extensions over the pci_ one */
+
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+#define dma_is_consistent(d)	(1)
+
+static inline int
+dma_get_cache_alignment(void)
+{
+	/* no easy way to get cache size on all processors, so return
+	 * the maximum possible, to be safe */
+	return (1 << L1_CACHE_SHIFT_MAX);
+}
+
+static inline void
+dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
+		      unsigned long offset, size_t size,
+		      enum dma_data_direction direction)
+{
+	BUG();
+}
+
+static inline void
+dma_cache_sync(void *vaddr, size_t size,
+	       enum dma_data_direction direction)
+{
+	BUG();
+}
+
+#endif
+
diff --git a/include/asm-cris/fasttimer.h b/include/asm-cris/fasttimer.h
index 10a770647..69522028b 100644
--- a/include/asm-cris/fasttimer.h
+++ b/include/asm-cris/fasttimer.h
@@ -1,4 +1,4 @@
-/* $Id: fasttimer.h,v 1.2 2002/12/11 13:03:43 starvik Exp $
+/* $Id: fasttimer.h,v 1.3 2004/05/14 10:19:19 starvik Exp $
  * linux/include/asm-cris/fasttimer.h
  *
  * Fast timers for ETRAX100LX
@@ -24,6 +24,8 @@ struct fast_timer{ /* Close to timer_list */
   const char *name;
 };
 
+extern struct fast_timer *fast_timer_list;
+
 void start_one_shot_timer(struct fast_timer *t,
                           fast_timer_function_type *function,
                           unsigned long data,
diff --git a/include/asm-cris/io.h b/include/asm-cris/io.h
index b89c1f93b..ac8807b36 100644
--- a/include/asm-cris/io.h
+++ b/include/asm-cris/io.h
@@ -72,6 +72,8 @@ extern void iounmap(void *addr);
 
 #define IO_SPACE_LIMIT 0xffff
 #define inb(x) (0)
+#define inw(x) (0)
+#define inl(x) (0)
 #define outb(x,y)
 #define outw(x,y)
 #define outl(x,y)
diff --git a/include/asm-cris/ioctl.h b/include/asm-cris/ioctl.h
index bb12a105c..be2d8f667 100644
--- a/include/asm-cris/ioctl.h
+++ b/include/asm-cris/ioctl.h
@@ -53,11 +53,18 @@
 	 ((nr)   << _IOC_NRSHIFT) | \
 	 ((size) << _IOC_SIZESHIFT))
 
+/* provoke compile error for invalid uses of size argument */
+extern int __invalid_size_argument_for_IOC;
+#define _IOC_TYPECHECK(t) \
+	((sizeof(t) == sizeof(t[1]) && \
+	  sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
+	  sizeof(t) : __invalid_size_argument_for_IOC)
+
 /* used to create numbers */
 #define _IO(type,nr)		_IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)	_IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOR(type,nr,size)	_IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOW(type,nr,size)	_IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOWR(type,nr,size)	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
 
 /* used to decode ioctl numbers.. */
 #define _IOC_DIR(nr)		(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index 05dc15526..bebb8890d 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -6,7 +6,11 @@
 
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	13
+#ifndef __ASSEMBLY__
 #define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#else
+#define PAGE_SIZE	(1 << PAGE_SHIFT)
+#endif
 #define PAGE_MASK	(~(PAGE_SIZE-1))
 
 #ifdef __KERNEL__
@@ -20,10 +24,12 @@
 /*
  * These are used to make use of C type-checking..
  */
+#ifndef __ASSEMBLY__
 typedef struct { unsigned long pte; } pte_t;
 typedef struct { unsigned long pmd; } pmd_t;
 typedef struct { unsigned long pgd; } pgd_t;
 typedef struct { unsigned long pgprot; } pgprot_t;
+#endif
 
 #define pte_val(x)	((x).pte)
 #define pmd_val(x)	((x).pmd)
@@ -51,7 +57,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 
 #define virt_to_page(kaddr)    (mem_map + (((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT))
 #define VALID_PAGE(page)       (((page) - mem_map) < max_mapnr)
-#define virt_addr_valid(kaddr)	pfn_valid((kaddr) >> PAGE_SHIFT)
+#define virt_addr_valid(kaddr)	pfn_valid((unsigned)(kaddr) >> PAGE_SHIFT)
 
 /* convert a page (based on mem_map and forward) to a physical address
  * do this by figuring out the virtual address and then use __pa
@@ -72,8 +78,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
          BUG(); \
 } while (0)
 
-#endif /* __ASSEMBLY__ */
-
 /* Pure 2^n version of get_order */
 static inline int get_order(unsigned long size)
 {
@@ -87,6 +91,7 @@ static inline int get_order(unsigned long size)
 	} while (size);
 	return order;
 }
+#endif /* __ASSEMBLY__ */
 
 #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
diff --git a/include/asm-cris/pci.h b/include/asm-cris/pci.h
index e080860b4..c61041531 100644
--- a/include/asm-cris/pci.h
+++ b/include/asm-cris/pci.h
@@ -1,9 +1,13 @@
 #ifndef __ASM_CRIS_PCI_H
 #define __ASM_CRIS_PCI_H
 
+#include <asm/scatterlist.h>
+#include <asm-generic/pci-dma-compat.h>
+
 /* ETRAX chips don't have a PCI bus. This file is just here because some stupid .c code
  * includes it even if CONFIG_PCI is not set.
  */
+#define PCI_DMA_BUS_IS_PHYS       (1)
 
 #endif /* __ASM_CRIS_PCI_H */
 
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index 25b2b51b5..4a08ed86e 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -5,9 +5,11 @@
 #ifndef _CRIS_PGTABLE_H
 #define _CRIS_PGTABLE_H
 
+#ifndef __ASSEMBLY__
 #include <linux/config.h>
 #include <linux/sched.h>
 #include <asm/mmu.h>
+#endif
 #include <asm/arch/pgtable.h>
 
 /*
@@ -21,8 +23,9 @@
  * This file contains the functions and defines necessary to modify and use
  * the CRIS page table tree.
  */
-
+#ifndef __ASSEMBLY__
 extern void paging_init(void);
+#endif
 
 /* Certain architectures need to do special things when pte's
  * within a page table are directly modified.  Thus, the following
@@ -72,8 +75,10 @@ extern void paging_init(void);
 #define FIRST_USER_PGD_NR       0
 
 /* zero page used for uninitialized stuff */
+#ifndef __ASSEMBLY__
 extern unsigned long empty_zero_page;
 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+#endif
 
 /* number of bits that fit into a memory pointer */
 #define BITS_PER_PTR			(8*sizeof(unsigned long))
@@ -104,6 +109,8 @@ extern unsigned long empty_zero_page;
 #define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
 #define pmd_clear(xp)	do { pmd_val(*(xp)) = 0; } while (0)
 
+#ifndef __ASSEMBLY__
+
 /*
  * The "pgd_xxx()" functions here are trivial for a folded two-level
  * setup: the pgd is never bad, and a pmd always exists (as it's folded
@@ -337,6 +344,5 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma,
 #define pte_to_pgoff(x)	(pte_val(x) >> 6)
 #define pgoff_to_pte(x)	__pte(((x) << 6) | _PAGE_FILE)
 
-typedef pte_t *pte_addr_t;
-
+#endif /* __ASSEMBLY__ */
 #endif /* _CRIS_PGTABLE_H */
diff --git a/include/asm-cris/ptrace.h b/include/asm-cris/ptrace.h
index 79045e36d..7a8c2880e 100644
--- a/include/asm-cris/ptrace.h
+++ b/include/asm-cris/ptrace.h
@@ -3,8 +3,10 @@
 
 #include <asm/arch/ptrace.h>
 
+#ifdef __KERNEL__
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 #define PTRACE_GETREGS            12
 #define PTRACE_SETREGS            13
+#endif
 
 #endif /* _CRIS_PTRACE_H */
diff --git a/include/asm-cris/rtc.h b/include/asm-cris/rtc.h
index 382081c4a..97c130398 100644
--- a/include/asm-cris/rtc.h
+++ b/include/asm-cris/rtc.h
@@ -100,6 +100,8 @@ struct rtc_time {
 #define RTC_RD_TIME		_IOR(RTC_MAGIC, 0x09, struct rtc_time)	/* Read RTC time. */
 #define RTC_SET_TIME		_IOW(RTC_MAGIC, 0x0a, struct rtc_time)	/* Set RTC time. */
 #define RTC_SET_CHARGE  	_IOW(RTC_MAGIC, 0x0b, int) 		
-#define RTC_MAX_IOCTL 0x0b
+#define RTC_VLOW_RD     _IOR(RTC_MAGIC, 0x11, int)  /* Voltage Low detector */
+#define RTC_VLOW_SET    _IO(RTC_MAGIC, 0x12)        /* Clear voltage low information */
+#define RTC_MAX_IOCTL 0x12
 
 #endif /* __RTC_H__ */
diff --git a/include/asm-cris/semaphore-helper.h b/include/asm-cris/semaphore-helper.h
index 461c5e4fc..dbd0f30b8 100644
--- a/include/asm-cris/semaphore-helper.h
+++ b/include/asm-cris/semaphore-helper.h
@@ -52,7 +52,7 @@ extern inline int waking_non_zero_interruptible(struct semaphore *sem,
 		dec(&sem->waking);
 		ret = 1;
 	} else if (signal_pending(tsk)) {
-		count_inc(&sem->count);
+		inc(&sem->count);
 		ret = -EINTR;
 	}
 	local_irq_restore(flags);
@@ -67,7 +67,7 @@ extern inline int waking_non_zero_trylock(struct semaphore *sem)
 	local_save_flags(flags);
 	local_irq_disable();
 	if (read(&sem->waking) <= 0)
-		count_inc(&sem->count);
+		inc(&sem->count);
 	else {
 		dec(&sem->waking);
 		ret = 0;
diff --git a/include/asm-cris/semaphore.h b/include/asm-cris/semaphore.h
index d0821f6ce..9ee66b9d5 100644
--- a/include/asm-cris/semaphore.h
+++ b/include/asm-cris/semaphore.h
@@ -21,7 +21,7 @@
 int printk(const char *fmt, ...);
 
 struct semaphore {
-	int count; /* not atomic_t since we do the atomicity here already */
+	atomic_t count;
 	atomic_t waking;
 	wait_queue_head_t wait;
 #if WAITQUEUE_DEBUG
@@ -36,7 +36,7 @@ struct semaphore {
 #endif
 
 #define __SEMAPHORE_INITIALIZER(name,count)             \
-        { count, ATOMIC_INIT(0),          \
+        { ATOMIC_INIT(count), ATOMIC_INIT(0),           \
           __WAIT_QUEUE_HEAD_INITIALIZER((name).wait)    \
           __SEM_DEBUG_INIT(name) }
 
@@ -84,7 +84,7 @@ extern inline void down(struct semaphore * sem)
 	/* atomically decrement the semaphores count, and if its negative, we wait */
 	local_save_flags(flags);
 	local_irq_disable();
-	failed = --(sem->count) < 0;
+	failed = --(sem->count.counter) < 0;
 	local_irq_restore(flags);
 	if(failed) {
 		__down(sem);
@@ -110,7 +110,7 @@ extern inline int down_interruptible(struct semaphore * sem)
 	/* atomically decrement the semaphores count, and if its negative, we wait */
 	local_save_flags(flags);
 	local_irq_disable();
-	failed = --(sem->count) < 0;
+	failed = --(sem->count.counter) < 0;
 	local_irq_restore(flags);
 	if(failed)
 		failed = __down_interruptible(sem);
@@ -128,7 +128,7 @@ extern inline int down_trylock(struct semaphore * sem)
 
 	local_save_flags(flags);
 	local_irq_disable();
-	failed = --(sem->count) < 0;
+	failed = --(sem->count.counter) < 0;
 	local_irq_restore(flags);
 	if(failed)
 		failed = __down_trylock(sem);
@@ -153,7 +153,7 @@ extern inline void up(struct semaphore * sem)
 	/* atomically increment the semaphores count, and if it was negative, we wake people */
 	local_save_flags(flags);
 	local_irq_disable();
-	wakeup = ++(sem->count) <= 0;
+	wakeup = ++(sem->count.counter) <= 0;
 	local_irq_restore(flags);
 	if(wakeup) {
 		__up(sem);
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h
index 118e9b8fc..16d9a491f 100644
--- a/include/asm-cris/termbits.h
+++ b/include/asm-cris/termbits.h
@@ -154,7 +154,7 @@ struct termios {
 #define  B6250000  0010007
 /* etrax 200 supports this as well */
 #define  B12500000 0010010
-#define CIBAUD	  002003600000	/* input baud rate */
+#define CIBAUD	  002003600000	/* input baud rate (used in v32) */
 /* The values for CIBAUD bits are the same as the values for CBAUD and CBAUDEX
  * shifted left IBSHIFT bits.
  */
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 25425c09d..41a0d450b 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -50,6 +50,9 @@ typedef unsigned long long u64;
 /* Dma addresses are 32-bits wide, just like our other addresses.  */
  
 typedef u32 dma_addr_t;
+typedef u32 dma64_addr_t;
+
+typedef unsigned int kmem_bufctl_t;
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index a212d4344..0b58c457b 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -275,16 +275,53 @@
 #define __NR_clock_nanosleep	(__NR_timer_create+8)
 #define __NR_statfs64		268
 #define __NR_fstatfs64		269
+#define __NR_tgkill		270
+#define __NR_utimes		271
+#define __NR_fadvise64_64	272
+#define __NR_vserver		273
+#define __NR_mbind		274
+#define __NR_get_mempolicy	275
+#define __NR_set_mempolicy	276
+#define __NR_mq_open 		277
+#define __NR_mq_unlink		(__NR_mq_open+1)
+#define __NR_mq_timedsend	(__NR_mq_open+2)
+#define __NR_mq_timedreceive	(__NR_mq_open+3)
+#define __NR_mq_notify		(__NR_mq_open+4)
+#define __NR_mq_getsetattr	(__NR_mq_open+5)
  
-#define NR_syscalls 270
-
+#define NR_syscalls 283
 
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
 
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
 #include <linux/types.h>
+#include <linux/linkage.h>
 
 /*
  * we need this inline - forking from kernel space will result
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 9bf5071ac..ee74be68c 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -8,15 +8,32 @@
  *  - update the page tables
  *  - inform the TLB about the new one
  *
- * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock
+ * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock.
+ *
+ * Note: the old pte is known to not be writable, so we don't need to
+ * worry about dirty bits etc getting lost.
  */
 #define ptep_establish(__vma, __address, __ptep, __entry)		\
-do {									\
+do {				  					\
 	set_pte(__ptep, __entry);					\
 	flush_tlb_page(__vma, __address);				\
 } while (0)
 #endif
 
+#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+/*
+ * Largely same as above, but only sets the access flags (dirty,
+ * accessed, and writable). Furthermore, we know it always gets set
+ * to a "more permissive" setting, which allows most architectures
+ * to optimize this.
+ */
+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+do {				  					  \
+	set_pte(__ptep, __entry);					  \
+	flush_tlb_page(__vma, __address);				  \
+} while (0)
+#endif
+
 #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 static inline int ptep_test_and_clear_young(pte_t *ptep)
 {
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index a4b6c768c..918b02d6c 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -2,6 +2,10 @@
 #define LOAD_OFFSET 0
 #endif
 
+#ifndef VMLINUX_SYMBOL
+#define VMLINUX_SYMBOL(_sym_) _sym_
+#endif
+
 #define RODATA								\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
 		*(.rodata) *(.rodata.*)					\
@@ -14,30 +18,30 @@
 									\
 	/* Kernel symbol table: Normal symbols */			\
 	__ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {		\
-		__start___ksymtab = .;					\
+		VMLINUX_SYMBOL(__start___ksymtab) = .;			\
 		*(__ksymtab)						\
-		__stop___ksymtab = .;					\
+		VMLINUX_SYMBOL(__stop___ksymtab) = .;			\
 	}								\
 									\
 	/* Kernel symbol table: GPL-only symbols */			\
 	__ksymtab_gpl     : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) {	\
-		__start___ksymtab_gpl = .;				\
+		VMLINUX_SYMBOL(__start___ksymtab_gpl) = .;		\
 		*(__ksymtab_gpl)					\
-		__stop___ksymtab_gpl = .;				\
+		VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .;		\
 	}								\
 									\
 	/* Kernel symbol table: Normal symbols */			\
 	__kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {		\
-		__start___kcrctab = .;					\
+		VMLINUX_SYMBOL(__start___kcrctab) = .;			\
 		*(__kcrctab)						\
-		__stop___kcrctab = .;					\
+		VMLINUX_SYMBOL(__stop___kcrctab) = .;			\
 	}								\
 									\
 	/* Kernel symbol table: GPL-only symbols */			\
 	__kcrctab_gpl     : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) {	\
-		__start___kcrctab_gpl = .;				\
+		VMLINUX_SYMBOL(__start___kcrctab_gpl) = .;		\
 		*(__kcrctab_gpl)					\
-		__stop___kcrctab_gpl = .;				\
+		VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .;		\
 	}								\
 									\
 	/* Kernel symbol table: strings */				\
@@ -47,12 +51,12 @@
 
 #define SECURITY_INIT							\
 	.security_initcall.init : {					\
-		__security_initcall_start = .;				\
+		VMLINUX_SYMBOL(__security_initcall_start) = .;		\
 		*(.security_initcall.init) 				\
-		__security_initcall_end = .;				\
+		VMLINUX_SYMBOL(__security_initcall_end) = .;		\
 	}
 
 #define SCHED_TEXT							\
-		__scheduling_functions_start_here = .;			\
+		VMLINUX_SYMBOL(__sched_text_start) = .;			\
 		*(.sched.text)						\
-		__scheduling_functions_end_here = .;
+		VMLINUX_SYMBOL(__sched_text_end) = .;
diff --git a/include/asm-h8300/atomic.h b/include/asm-h8300/atomic.h
index e9595c099..7230f6507 100644
--- a/include/asm-h8300/atomic.h
+++ b/include/asm-h8300/atomic.h
@@ -25,6 +25,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)
 }
 
 #define atomic_add(i, v) atomic_add_return(i, v)
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
 
 static __inline__ int atomic_sub_return(int i, atomic_t *v)
 {
@@ -49,6 +50,16 @@ static __inline__ int atomic_inc_return(atomic_t *v)
 
 #define atomic_inc(v) atomic_inc_return(v)
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 static __inline__ int atomic_dec_return(atomic_t *v)
 {
 	int ret,flags;
diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h
index 83050cc0e..893e6f1c7 100644
--- a/include/asm-h8300/bitops.h
+++ b/include/asm-h8300/bitops.h
@@ -181,6 +181,23 @@ H8300_GEN_TEST_BITOP(test_and_change_bit,"bnot")
 #define find_first_zero_bit(addr, size) \
 	find_next_zero_bit((addr), (size), 0)
 
+static __inline__ unsigned long __ffs(unsigned long word)
+{
+	unsigned long result;
+
+	result = -1;
+	__asm__("1:\n\t"
+		"shlr.l %2\n\t"
+		"adds #1,%0\n\t"
+		"bcc 1b"
+		: "=r" (result)
+		: "0"(result),"r"(word));
+	return result;
+}
+
+#define ffs(x) generic_ffs(x)
+#define fls(x) generic_fls(x)
+
 static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
 {
 	unsigned long *p = (unsigned long *)(((unsigned long)addr + (offset >> 3)) & ~3);
@@ -217,22 +234,44 @@ found_middle:
 	return result + ffz(tmp);
 }
 
-static __inline__ unsigned long __ffs(unsigned long word)
+static __inline__ unsigned long find_next_bit(const unsigned long *addr,
+	unsigned long size, unsigned long offset)
 {
-	unsigned long result;
+	unsigned long *p = (unsigned long *)(((unsigned long)addr + (offset >> 3)) & ~3);
+	unsigned int result = offset & ~31UL;
+	unsigned int tmp;
 
-	result = -1;
-	__asm__("1:\n\t"
-		"shlr.l %2\n\t"
-		"adds #1,%0\n\t"
-		"bcc 1b"
-		: "=r" (result)
-		: "0"(result),"r"(word));
-	return result;
-}
+	if (offset >= size)
+		return size;
+	size -= result;
+	offset &= 31UL;
+	if (offset) {
+		tmp = *(p++);
+		tmp &= ~0UL << offset;
+		if (size < 32)
+			goto found_first;
+		if (tmp)
+			goto found_middle;
+		size -= 32;
+		result += 32;
+	}
+	while (size >= 32) {
+		if ((tmp = *p++) != 0)
+			goto found_middle;
+		result += 32;
+		size -= 32;
+	}
+	if (!size)
+		return result;
+	tmp = *p;
 
-#define ffs(x) generic_ffs(x)
-#define fls(x) generic_fls(x)
+found_first:
+	tmp &= ~0UL >> (32 - size);
+	if (tmp == 0UL)
+		return result + size;
+found_middle:
+	return result + __ffs(tmp);
+}
 
 /*
  * Every architecture must define this function. It's the fastest
diff --git a/include/asm-h8300/cacheflush.h b/include/asm-h8300/cacheflush.h
index 429eee027..d9583676f 100644
--- a/include/asm-h8300/cacheflush.h
+++ b/include/asm-h8300/cacheflush.h
@@ -14,8 +14,9 @@
 #define	flush_cache_mm(mm)
 #define	flush_cache_range(vma,a,b)
 #define	flush_cache_page(vma,p)
-#define	flush_page_to_ram(page)
 #define	flush_dcache_page(page)
+#define	flush_dcache_mmap_lock(mapping)
+#define	flush_dcache_mmap_unlock(mapping)
 #define	flush_icache()
 #define	flush_icache_page(vma,page)
 #define	flush_icache_range(start,len)
diff --git a/include/asm-h8300/elf.h b/include/asm-h8300/elf.h
index 8af8df06f..f4af1553a 100644
--- a/include/asm-h8300/elf.h
+++ b/include/asm-h8300/elf.h
@@ -13,26 +13,30 @@ typedef unsigned long elf_greg_t;
 
 #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-typedef struct user_m68kfp_struct elf_fpregset_t;
+typedef unsigned long elf_fpregset_t;
 
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
-#define elf_check_arch(x) ((x)->e_machine == EM_68K)
+#define elf_check_arch(x) ((x)->e_machine == EM_H8_300)
 
 /*
  * These are used to set parameters in the core dumps.
  */
 #define ELF_CLASS	ELFCLASS32
 #define ELF_DATA	ELFDATA2MSB
-#define ELF_ARCH	EM_H8_300H
+#define ELF_ARCH	EM_H8_300
+#if defined(__H8300H__)
+#define ELF_FLAGS       0x810000
+#endif
+#if defined(__H8300S__)
+#define ELF_FLAGS       0x820000
+#endif
 
 #define ELF_PLAT_INIT(_r)	_r->er1 = 0
 
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE	4096
-#endif
 
 /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
    use of this is to invoke "./ld.so someprog" to test out a new version of
@@ -55,3 +59,49 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
 #ifdef __KERNEL__
 #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
 #endif
+
+#define R_H8_NONE       0
+#define R_H8_DIR32      1
+#define R_H8_DIR32_28   2
+#define R_H8_DIR32_24   3
+#define R_H8_DIR32_16   4
+#define R_H8_DIR32U     6
+#define R_H8_DIR32U_28  7
+#define R_H8_DIR32U_24  8
+#define R_H8_DIR32U_20  9
+#define R_H8_DIR32U_16 10
+#define R_H8_DIR24     11
+#define R_H8_DIR24_20  12
+#define R_H8_DIR24_16  13
+#define R_H8_DIR24U    14
+#define R_H8_DIR24U_20 15
+#define R_H8_DIR24U_16 16
+#define R_H8_DIR16     17
+#define R_H8_DIR16U    18
+#define R_H8_DIR16S_32 19
+#define R_H8_DIR16S_28 20
+#define R_H8_DIR16S_24 21
+#define R_H8_DIR16S_20 22
+#define R_H8_DIR16S    23
+#define R_H8_DIR8      24
+#define R_H8_DIR8U     25
+#define R_H8_DIR8Z_32  26
+#define R_H8_DIR8Z_28  27
+#define R_H8_DIR8Z_24  28
+#define R_H8_DIR8Z_20  29
+#define R_H8_DIR8Z_16  30
+#define R_H8_PCREL16   31
+#define R_H8_PCREL8    32
+#define R_H8_BPOS      33
+#define R_H8_PCREL32   34
+#define R_H8_GOT32O    35
+#define R_H8_GOT16O    36
+#define R_H8_DIR16A8   59
+#define R_H8_DIR16R8   60
+#define R_H8_DIR24A8   61
+#define R_H8_DIR24R8   62
+#define R_H8_DIR32A16  63
+#define R_H8_ABS32     65
+#define R_H8_ABS32A16 127
+
+#endif
diff --git a/include/asm-h8300/flat.h b/include/asm-h8300/flat.h
index 61d9aaf7e..c20eee767 100644
--- a/include/asm-h8300/flat.h
+++ b/include/asm-h8300/flat.h
@@ -18,7 +18,8 @@
  */
 
 #define	flat_get_relocate_addr(rel)		(rel)
-#define flat_get_addr_from_rp(rp, relval)       (get_unaligned(rp) & 0x0ffffff)
+#define flat_get_addr_from_rp(rp, relval, flags) \
+        (get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff))
 #define flat_put_addr_at_rp(rp, addr, rel) \
 	put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
 
diff --git a/include/asm-h8300/hardirq.h b/include/asm-h8300/hardirq.h
index ccab235b9..c0941a080 100644
--- a/include/asm-h8300/hardirq.h
+++ b/include/asm-h8300/hardirq.h
@@ -75,7 +75,7 @@ typedef struct {
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 
 #ifdef CONFIG_PREEMPT
-# define in_atomic()	(preempt_count() != kernel_locked())
+# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
 #else
 # define in_atomic()	(preempt_count() != 0)
diff --git a/include/asm-h8300/ide.h b/include/asm-h8300/ide.h
index 034715501..f8535ce74 100644
--- a/include/asm-h8300/ide.h
+++ b/include/asm-h8300/ide.h
@@ -16,23 +16,9 @@
 #ifdef __KERNEL__
 /****************************************************************************/
 
-void h8300_ide_print_resource(char *name, hw_regs_t *hw);
-static __inline__ int ide_default_irq(unsigned long base) { return 0; };
-static __inline__ unsigned long ide_default_io_base(int index) { return 0; };
-
-static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
-	 unsigned long ctrl_port, int *irq)
-{
-}
-
-#define ide_init_default_irq(base)	(0)
-
 #define MAX_HWIFS	1
 
-#define __ide_mm_insw(port,addr,count)  do { } while(0)
-#define __ide_mm_insl(port,addr,count)  do { } while(0)
-#define __ide_mm_outsw(port,addr,count) do { } while(0)
-#define __ide_mm_outsl(port,addr,count) do { } while(0)
+#include <asm-generic/ide_iops.h>
 
 /****************************************************************************/
 #endif /* __KERNEL__ */
diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h
index 662ca8698..ceef5200c 100644
--- a/include/asm-h8300/io.h
+++ b/include/asm-h8300/io.h
@@ -33,21 +33,29 @@
  * swap functions are sometimes needed to interface little-endian hardware
  */
 
-/*
- * CHANGES
- * 
- * 020325   Added some #define's for the COBRA5272 board
- *          (hede)
- */
-
 static inline unsigned short _swapw(volatile unsigned short v)
 {
-    return ((v << 8) | (v >> 8));
+	unsigned short r,t;
+	__asm__("mov.b %w2,%x1\n\t"
+		"mov.b %x2,%w1\n\t"
+		"mov.w %1,%0"
+		:"=r"(r),"=r"(t)
+		:"r"(v));
+	return r;
 }
 
 static inline unsigned int _swapl(volatile unsigned long v)
 {
-    return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
+	unsigned int r,t;
+	__asm__("mov.b %w2,%x1\n\t"
+		"mov.b %x2,%w1\n\t"
+		"mov.w %f1,%e0\n\t"
+		"mov.w %e2,%f1\n\t"
+		"mov.b %w1,%x0\n\t"
+		"mov.b %x1,%w0"
+		:"=r"(r),"=r"(t)
+		:"r"(v));
+	return r;
 }
 
 #define readb(addr) \
@@ -76,7 +84,7 @@ static inline int h8300_buswidth(unsigned int addr)
 	return (*(volatile unsigned char *)ABWCR & (1 << ((addr >> 21) & 7))) == 0;
 }
 
-static inline void io_outsb(unsigned int addr, void *buf, int len)
+static inline void io_outsb(unsigned int addr, const void *buf, int len)
 {
 	volatile unsigned char  *ap_b = (volatile unsigned char *) addr;
 	volatile unsigned short *ap_w = (volatile unsigned short *) addr;
@@ -91,33 +99,37 @@ static inline void io_outsb(unsigned int addr, void *buf, int len)
 	}
 }
 
-static inline void io_outsw(unsigned int addr, void *buf, int len)
+static inline void io_outsw(unsigned int addr, const void *buf, int len)
 {
 	volatile unsigned short *ap = (volatile unsigned short *) addr;
 	unsigned short *bp = (unsigned short *) buf;
 	while (len--)
-		*ap = *bp++;
+		*ap = _swapw(*bp++);
 }
 
-static inline void io_outsl(unsigned int addr, void *buf, int len)
+static inline void io_outsl(unsigned int addr, const void *buf, int len)
 {
 	volatile unsigned int *ap = (volatile unsigned int *) addr;
-	unsigned int *bp = (unsigned int *) buf;
+	unsigned long *bp = (unsigned long *) buf;
 	while (len--)
-		*ap = *bp++;
+		*ap = _swapl(*bp++);
 }
 
 static inline void io_insb(unsigned int addr, void *buf, int len)
 {
-	volatile unsigned char  *ap;
+	volatile unsigned char  *ap_b;
+	volatile unsigned short *ap_w;
 	unsigned char *bp = (unsigned char *) buf;
 
-	if(h8300_buswidth(addr))
-		ap = (volatile unsigned char *)(addr ^ 1);
-	else
-		ap = (volatile unsigned char *)addr;
-	while (len--)
-		*bp++ = *ap;
+	if(h8300_buswidth(addr)) {
+		ap_w = (volatile unsigned short *)(addr & ~1);
+		while (len--)
+			*bp++ = *ap_w & 0xff;
+	} else {
+		ap_b = (volatile unsigned char *)addr;
+		while (len--)
+			*bp++ = *ap_b;
+	}
 }
 
 static inline void io_insw(unsigned int addr, void *buf, int len)
@@ -125,15 +137,15 @@ static inline void io_insw(unsigned int addr, void *buf, int len)
 	volatile unsigned short *ap = (volatile unsigned short *) addr;
 	unsigned short *bp = (unsigned short *) buf;
 	while (len--)
-		*bp++ = *ap;
+		*bp++ = _swapw(*ap);
 }
 
 static inline void io_insl(unsigned int addr, void *buf, int len)
 {
 	volatile unsigned int *ap = (volatile unsigned int *) addr;
-	unsigned int *bp = (unsigned int *) buf;
+	unsigned long *bp = (unsigned long *) buf;
 	while (len--)
-		*bp++ = *ap;
+		*bp++ = _swapl(*ap);
 }
 
 /*
@@ -145,10 +157,10 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
 #define memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
 #define memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))
 
-#define inb(addr)    ((h8300_buswidth(addr))?readb((addr) ^ 1) & 0xff:readb(addr))
+#define inb(addr)    ((h8300_buswidth(addr))?readw((addr) & ~1) & 0xff:readb(addr))
 #define inw(addr)    _swapw(readw(addr))
 #define inl(addr)    _swapl(readl(addr))
-#define outb(x,addr) ((void)((h8300_buswidth(addr) && ((addr) & 1))?writew(x,addr):writeb(x,addr)))
+#define outb(x,addr) ((void)((h8300_buswidth(addr) && ((addr) & 1))?writew(x,(addr) & ~1):writeb(x,addr)))
 #define outw(x,addr) ((void) writew(_swapw(x),addr))
 #define outl(x,addr) ((void) writel(_swapl(x),addr))
 
diff --git a/include/asm-h8300/module.h b/include/asm-h8300/module.h
index 2573cfb4a..de23231f3 100644
--- a/include/asm-h8300/module.h
+++ b/include/asm-h8300/module.h
@@ -3,5 +3,11 @@
 /*
  * This file contains the H8/300 architecture specific module code.
  */
+struct mod_arch_specific { };
+#define Elf_Shdr Elf32_Shdr
+#define Elf_Sym Elf32_Sym
+#define Elf_Ehdr Elf32_Ehdr
+
+#define MODULE_SYMBOL_PREFIX "_"
 
 #endif /* _ASM_H8/300_MODULE_H */
diff --git a/include/asm-h8300/pgtable.h b/include/asm-h8300/pgtable.h
index 7726b1c51..6c64b136c 100644
--- a/include/asm-h8300/pgtable.h
+++ b/include/asm-h8300/pgtable.h
@@ -7,8 +7,6 @@
 #include <asm/page.h>
 #include <asm/io.h>
 
-typedef pte_t *pte_addr_t;
-
 #define pgd_present(pgd)     (1)       /* pages are always present on NO_MM */
 #define pgd_none(pgd)		(0)
 #define pgd_bad(pgd)		(0)
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index 31494109a..59900733c 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -23,12 +23,12 @@
 #include <asm/ptrace.h>
 #include <asm/current.h>
 
-extern inline unsigned long rdusp(void) {
+static inline unsigned long rdusp(void) {
 	extern unsigned int	sw_usp;
 	return(sw_usp);
 }
 
-extern inline void wrusp(unsigned long usp) {
+static inline void wrusp(unsigned long usp) {
 	extern unsigned int	sw_usp;
 	sw_usp = usp;
 }
@@ -61,9 +61,15 @@ struct thread_struct {
 	} breakinfo;
 };
 
-#define INIT_THREAD  { \
-	sizeof(init_stack) + (unsigned long) init_stack, 0, \
-	PS_S,  0, {(unsigned short *)-1, 0}, \
+#define INIT_THREAD  {						\
+	.ksp  = sizeof(init_stack) + (unsigned long)init_stack, \
+	.usp  = 0,						\
+	.ccr  = PS_S,						\
+	.esp0 = 0,						\
+	.breakinfo = {						\
+		.addr = (unsigned short *)-1,			\
+		.inst = 0					\
+	}							\
 }
 
 /*
@@ -78,6 +84,7 @@ do {							        \
 	set_fs(USER_DS);           /* reads from user space */  \
   	(_regs)->pc = (_pc);				        \
 	(_regs)->ccr &= 0x00;	   /* clear kernel flag */      \
+	(_regs)->er5 = current->mm->start_data;	/* GOT base */  \
 	wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3);	\
 } while(0)
 #endif
@@ -88,6 +95,7 @@ do {							        \
 	(_regs)->pc = (_pc);				        \
 	(_regs)->ccr = 0x00;	   /* clear kernel flag */      \
 	(_regs)->exr = 0x78;       /* enable all interrupts */  \
+	(_regs)->er5 = current->mm->start_data;	/* GOT base */  \
 	/* 14 = space for retaddr(4), vector(4), er0(4) and ext(2) on stack */ \
 	wrusp(((unsigned long)(_usp)) - 14);                    \
 } while(0)
diff --git a/include/asm-h8300/semaphore.h b/include/asm-h8300/semaphore.h
index 283f0860a..9efd009de 100644
--- a/include/asm-h8300/semaphore.h
+++ b/include/asm-h8300/semaphore.h
@@ -96,7 +96,7 @@ static inline void down(struct semaphore * sem)
 	__asm__ __volatile__(
 		"stc ccr,r3l\n\t"
 		"orc #0x80,ccr\n\t"
-		"mov.l %0, er1\n\t"
+		"mov.l %2, er1\n\t"
 		"dec.l #1,er1\n\t"
 		"mov.l er1,%0\n\t"
 		"bpl 1f\n\t"
@@ -107,8 +107,8 @@ static inline void down(struct semaphore * sem)
 		"1:\n\t"
 		"ldc r3l,ccr\n"
 		"2:"
-		: "+m"(*count)
-		: "g"(sem)
+		: "=m"(*count)
+		: "g"(sem),"m"(*count)
 		: "cc",  "er1", "er2", "er3");
 }
 
@@ -125,7 +125,7 @@ static inline int down_interruptible(struct semaphore * sem)
 	__asm__ __volatile__(
 		"stc ccr,r1l\n\t"
 		"orc #0x80,ccr\n\t"
-		"mov.l %1, er2\n\t"
+		"mov.l %3, er2\n\t"
 		"dec.l #1,er2\n\t"
 		"mov.l er2,%1\n\t"
 		"bpl 1f\n\t"
@@ -137,8 +137,8 @@ static inline int down_interruptible(struct semaphore * sem)
 		"ldc r1l,ccr\n\t"
 		"sub.l %0,%0\n\t"
 		"2:\n\t"
-		: "=r" (count),"+m" (*count)
-		: "g"(sem)
+		: "=r" (count),"=m" (*count)
+		: "g"(sem),"m"(*count)
 		: "cc", "er1", "er2", "er3");
 	return (int)count;
 }
@@ -155,7 +155,7 @@ static inline int down_trylock(struct semaphore * sem)
 	__asm__ __volatile__(
 		"stc ccr,r3l\n\t"
 		"orc #0x80,ccr\n\t"
-		"mov.l %0,er2\n\t"
+		"mov.l %3,er2\n\t"
 		"dec.l #1,er2\n\t"
 		"mov.l er2,%0\n\t"
 		"bpl 1f\n\t"
@@ -171,8 +171,8 @@ static inline int down_trylock(struct semaphore * sem)
 		"ldc r3l,ccr\n\t"
 		"sub.l %1,%1\n"
 		"2:"
-		: "+m" (*count),"=r"(count)
-		: "g"(sem)
+		: "=m" (*count),"=r"(count)
+		: "g"(sem),"m"(*count)
 		: "cc", "er1","er2", "er3");
 	return (int)count;
 }
@@ -195,7 +195,7 @@ static inline void up(struct semaphore * sem)
 	__asm__ __volatile__(
 		"stc ccr,r3l\n\t"
 		"orc #0x80,ccr\n\t"
-		"mov.l %0,er1\n\t"
+		"mov.l %2,er1\n\t"
 		"inc.l #1,er1\n\t"
 		"mov.l er1,%0\n\t"
 		"ldc r3l,ccr\n\t"
@@ -205,8 +205,8 @@ static inline void up(struct semaphore * sem)
 		"mov.l %1,er0\n\t"
 		"jsr @___up\n"
 		"1:"
-		: "+m"(*count)
-		: "g"(sem)
+		: "=m"(*count)
+		: "g"(sem),"m"(*count)
 		: "cc", "er1", "er2", "er3");
 }
 
diff --git a/include/asm-h8300/sigcontext.h b/include/asm-h8300/sigcontext.h
index acd04dee4..c2a8df4f5 100644
--- a/include/asm-h8300/sigcontext.h
+++ b/include/asm-h8300/sigcontext.h
@@ -8,6 +8,7 @@ struct sigcontext {
 	unsigned long  sc_er1;
 	unsigned long  sc_er2;
 	unsigned long  sc_er3;
+	unsigned long  sc_er5;
 	unsigned short sc_ccr;
 	unsigned long  sc_pc;
 };
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h
index 226ed1d56..e26e98cf7 100644
--- a/include/asm-h8300/thread_info.h
+++ b/include/asm-h8300/thread_info.h
@@ -32,10 +32,11 @@ struct thread_info {
  */
 #define INIT_THREAD_INFO(tsk)			\
 {						\
-	task:		&tsk,			\
-	exec_domain:	&default_exec_domain,	\
-	flags:		0,			\
-	cpu:		0,			\
+	.task =		&tsk,			\
+	.exec_domain =	&default_exec_domain,	\
+	.flags =	0,			\
+	.cpu =		0,			\
+	.preempt_count = 1,			\
 	.restart_block	= {			\
 		.fn = do_no_restart_syscall,	\
 	},					\
@@ -59,7 +60,7 @@ static inline struct thread_info *current_thread_info(void)
 		"mov.l	sp, %0 \n\t"
 		"and.l	%1, %0"
 		: "=&r"(ti)
-		: "g" (~(THREAD_SIZE-1))
+		: "i" (~(THREAD_SIZE-1))
 		);
 	return ti;
 }
@@ -79,6 +80,7 @@ static inline struct thread_info *current_thread_info(void)
 #define TI_EXECDOMAIN	4
 #define TI_FLAGS	8
 #define TI_CPU		12
+#define TI_PRE_COUNT	16
 
 #define	PREEMPT_ACTIVE	0x4000000
 
diff --git a/include/asm-h8300/timex.h b/include/asm-h8300/timex.h
index 4ea243a11..7a61dee5d 100644
--- a/include/asm-h8300/timex.h
+++ b/include/asm-h8300/timex.h
@@ -6,11 +6,7 @@
 #ifndef _ASM_H8300_TIMEX_H
 #define _ASM_H8300_TIMEX_H
 
-#define H8300_TIMER_DEFINE
-#include <asm/machine-depend.h>
-#undef  H8300_TIMER_DEFINE
-
-#define CLOCK_TICK_RATE H8300_TIMER_FREQ
+#define CLOCK_TICK_RATE CONFIG_CPU_CLOCK*1000/8192 /* Timer input freq. */
 #define CLOCK_TICK_FACTOR	20	/* Factor of both 1000000 and CLOCK_TICK_RATE */
 #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
 	(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index bf91e0d4d..21f4fc07a 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -58,6 +58,8 @@ typedef u32 dma_addr_t;
 #define HAVE_SECTOR_T
 typedef u64 sector_t;
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* __KERNEL__ */
 
 #endif /* __ASSEMBLY__ */
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h
index 4f73d087e..a6d15d494 100644
--- a/include/asm-h8300/unistd.h
+++ b/include/asm-h8300/unistd.h
@@ -446,6 +446,31 @@ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f)			\
 }
 		
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 8bfd3c1ce..42164a6d5 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -122,9 +122,10 @@ static inline void disable_acpi(void)
 #define FIX_ACPI_PAGES 4
 
 extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
+extern int (*platform_rename_gsi)(int ioapic, int gsi);
+
 #ifdef CONFIG_X86_IO_APIC
 extern int skip_ioapic_setup;
-extern int acpi_irq_to_vector(u32 irq);	/* deprecated in favor of acpi_gsi_to_irq */
 extern int acpi_skip_timer_override;
 
 static inline void disable_ioapic_setup(void)
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 114ac7ac3..2c6a7bb1e 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -290,7 +290,7 @@ static __inline__ int find_first_zero_bit(const unsigned long *addr, unsigned si
 		"shll $3,%%edi\n\t"
 		"addl %%edi,%%edx"
 		:"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
-		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
+		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr) : "memory");
 	return res;
 }
 
@@ -318,7 +318,7 @@ static __inline__ int find_first_bit(const unsigned long *addr, unsigned size)
 		"shll $3,%%edi\n\t"
 		"addl %%edi,%%eax"
 		:"=a" (res), "=&c" (d0), "=&D" (d1)
-		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
+		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr) : "memory");
 	return res;
 }
 
diff --git a/include/asm-i386/cacheflush.h b/include/asm-i386/cacheflush.h
index 9f78028b2..183361ebe 100644
--- a/include/asm-i386/cacheflush.h
+++ b/include/asm-i386/cacheflush.h
@@ -10,6 +10,8 @@
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start, end)		do { } while (0)
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
index 8324108c1..d962258e2 100644
--- a/include/asm-i386/cpu.h
+++ b/include/asm-i386/cpu.h
@@ -17,7 +17,9 @@ static inline int arch_register_cpu(int num){
 	struct node *parent = NULL;
 	
 #ifdef CONFIG_NUMA
-	parent = &node_devices[cpu_to_node(num)].node;
+	int node = cpu_to_node(num);
+	if (node_online(node))
+		parent = &node_devices[node].node;
 #endif /* CONFIG_NUMA */
 
 	return register_cpu(&cpu_devices[num].cpu, num, parent);
diff --git a/include/asm-i386/dma-mapping.h b/include/asm-i386/dma-mapping.h
index 70f62048f..410430ccb 100644
--- a/include/asm-i386/dma-mapping.h
+++ b/include/asm-i386/dma-mapping.h
@@ -2,6 +2,8 @@
 #define _ASM_I386_DMA_MAPPING_H
 
 #include <asm/cache.h>
+#include <asm/io.h>
+#include <asm/scatterlist.h>
 
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
@@ -51,7 +53,7 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset,
 	     size_t size, enum dma_data_direction direction)
 {
 	BUG_ON(direction == DMA_NONE);
-	return (dma_addr_t)(page_to_pfn(page)) * PAGE_SIZE + offset;
+	return page_to_phys(page) + offset;
 }
 
 static inline void
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index 8e420add7..f47822848 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -204,7 +204,7 @@ static unsigned long vdma_mem_alloc(unsigned long size)
 static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
 {
 	if((unsigned int) addr >= (unsigned int) high_memory)
-		return vfree((void *)addr);
+		vfree((void *)addr);
 	else
 		free_pages(addr, get_order(size));		
 }
diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h
index 7a165f27c..cf61fde56 100644
--- a/include/asm-i386/genapic.h
+++ b/include/asm-i386/genapic.h
@@ -26,7 +26,8 @@ struct genapic {
 	int int_delivery_mode;
 	int int_dest_mode; 
 	int apic_broadcast_id; 
-	int esr_disable;
+	int ESR_DISABLE;
+	int apic_destination_logical;
 	unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
 	unsigned long (*check_apicid_present)(int apicid); 
 	int no_balance_irq;
@@ -80,6 +81,8 @@ struct genapic {
 	.apic_broadcast_id = APIC_BROADCAST_ID, \
 	.no_balance_irq = NO_BALANCE_IRQ, \
 	.no_ioapic_check = NO_IOAPIC_CHECK, \
+	.ESR_DISABLE = esr_disable, \
+	.apic_destination_logical = APIC_DEST_LOGICAL, \
 	APICFUNC(apic_id_registered), \
 	APICFUNC(target_cpus), \
 	APICFUNC(check_apicid_used), \
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h
index 2875fe7bc..25b7baadb 100644
--- a/include/asm-i386/hw_irq.h
+++ b/include/asm-i386/hw_irq.h
@@ -59,7 +59,7 @@ void disable_IO_APIC(void);
 void print_IO_APIC(void);
 int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
 void send_IPI(int dest, int vector);
-void setup_ioapic_dest(cpumask_t mask);
+void setup_ioapic_dest(void);
 
 extern unsigned long io_apic_irqs;
 
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h
index db663695d..6d8a1995e 100644
--- a/include/asm-i386/i387.h
+++ b/include/asm-i386/i387.h
@@ -51,7 +51,7 @@ static inline void __save_init_fpu( struct task_struct *tsk )
 #define __clear_fpu( tsk )					\
 do {								\
 	if ((tsk)->thread_info->status & TS_USEDFPU) {		\
-		asm volatile("fwait");				\
+		asm volatile("fnclex ; fwait");				\
 		(tsk)->thread_info->status &= ~TS_USEDFPU;	\
 		stts();						\
 	}							\
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index e241be6d6..0409c22f1 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -23,6 +23,8 @@
 # endif
 #endif
 
+#define IDE_ARCH_OBSOLETE_DEFAULTS
+
 static __inline__ int ide_default_irq(unsigned long base)
 {
 	switch (base) {
@@ -85,6 +87,9 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por
 }
 #endif
 
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+
 #ifdef CONFIG_BLK_DEV_IDEPCI
 #define ide_init_default_irq(base)	(0)
 #else
diff --git a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h
index a117c0ade..bc71f5a36 100644
--- a/include/asm-i386/kmap_types.h
+++ b/include/asm-i386/kmap_types.h
@@ -19,12 +19,12 @@ D(5)	KM_BIO_SRC_IRQ,
 D(6)	KM_BIO_DST_IRQ,
 D(7)	KM_PTE0,
 D(8)	KM_PTE1,
-D(9)	KM_PTE2,
-D(10)	KM_IRQ0,
-D(11)	KM_IRQ1,
-D(12)	KM_SOFTIRQ0,
-D(13)	KM_SOFTIRQ1,
-D(14)	KM_TYPE_NR
+D(9)	KM_IRQ0,
+D(10)	KM_IRQ1,
+D(11)	KM_SOFTIRQ0,
+D(12)	KM_SOFTIRQ1,
+D(13)	KM_TYPE_NR,
+D(14)	KM_DUMP
 };
 
 #undef D
diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
index 4f887d605..e7b7b2ddd 100644
--- a/include/asm-i386/mach-bigsmp/mach_apic.h
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h
@@ -22,13 +22,21 @@ static inline int apic_id_registered(void)
 }
 
 #define APIC_DFR_VALUE	(APIC_DFR_CLUSTER)
+/* Round robin the irqs amoung the online cpus */
 static inline cpumask_t target_cpus(void)
 { 
-	return cpu_online_map;
+	static unsigned long cpu = NR_CPUS;
+	do {
+		if (cpu >= NR_CPUS)
+			cpu = first_cpu_const(cpu_online_map);
+		else
+			cpu = next_cpu_const(cpu, cpu_online_map);
+	} while (cpu >= NR_CPUS);
+	return mk_cpumask_const(cpumask_of_cpu(cpu));
 }
 #define TARGET_CPUS	(target_cpus())
 
-#define INT_DELIVERY_MODE dest_LowestPrio
+#define INT_DELIVERY_MODE dest_Fixed
 #define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
 
 #define APIC_BROADCAST_ID     (0xff)
@@ -141,36 +149,14 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
 	return (1);
 }
 
+/* As we are using single CPU as destination, pick only one CPU here */
 static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
 {
-	int num_bits_set;
-	int cpus_found = 0;
 	int cpu;
 	int apicid;	
 
-	num_bits_set = cpus_weight_const(cpumask);
-	/* Return id to all */
-	if (num_bits_set == NR_CPUS)
-		return (int) 0xFF;
-	/* 
-	 * The cpus in the mask must all be on the apic cluster.  If are not 
-	 * on the same apicid cluster return default value of TARGET_CPUS. 
-	 */
 	cpu = first_cpu_const(cpumask);
 	apicid = cpu_to_logical_apicid(cpu);
-	while (cpus_found < num_bits_set) {
-		if (cpu_isset_const(cpu, cpumask)) {
-			int new_apicid = cpu_to_logical_apicid(cpu);
-			if (apicid_cluster(apicid) != 
-					apicid_cluster(new_apicid)){
-				printk ("%s: Not a valid mask!\n",__FUNCTION__);
-				return 0xFF;
-			}
-			apicid = apicid | new_apicid;
-			cpus_found++;
-		}
-		cpu++;
-	}
 	return apicid;
 }
 
diff --git a/include/asm-i386/mach-default/irq_vectors.h b/include/asm-i386/mach-default/irq_vectors.h
index 881c63ca6..0bcc6f1ad 100644
--- a/include/asm-i386/mach-default/irq_vectors.h
+++ b/include/asm-i386/mach-default/irq_vectors.h
@@ -48,6 +48,7 @@
 #define INVALIDATE_TLB_VECTOR	0xfd
 #define RESCHEDULE_VECTOR	0xfc
 #define CALL_FUNCTION_VECTOR	0xfb
+#define DUMP_VECTOR		0xfa
 
 #define THERMAL_APIC_VECTOR	0xf0
 /*
diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h
index 72e87d081..0405b6b42 100644
--- a/include/asm-i386/mach-es7000/mach_apic.h
+++ b/include/asm-i386/mach-es7000/mach_apic.h
@@ -39,7 +39,7 @@ static inline cpumask_t target_cpus(void)
 #endif
 
 #define APIC_BROADCAST_ID	(0xff)
-#define NO_IOAPIC_CHECK (0)
+#define NO_IOAPIC_CHECK (1)
 
 static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
 { 
@@ -169,7 +169,11 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
 	num_bits_set = cpus_weight_const(cpumask);
 	/* Return id to all */
 	if (num_bits_set == NR_CPUS)
+#if defined CONFIG_ES7000_CLUSTERED_APIC
 		return 0xFF;
+#else
+		return cpu_to_logical_apicid(0);
+#endif
 	/* 
 	 * The cpus in the mask must all be on the apic cluster.  If are not 
 	 * on the same apicid cluster return default value of TARGET_CPUS. 
@@ -182,7 +186,11 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
 			if (apicid_cluster(apicid) != 
 					apicid_cluster(new_apicid)){
 				printk ("%s: Not a valid mask!\n",__FUNCTION__);
+#if defined CONFIG_ES7000_CLUSTERED_APIC
 				return 0xFF;
+#else
+				return cpu_to_logical_apicid(0);
+#endif
 			}
 			apicid = new_apicid;
 			cpus_found++;
diff --git a/include/asm-i386/mach-es7000/mach_ipi.h b/include/asm-i386/mach-es7000/mach_ipi.h
index 979ac6864..6b7a56c1d 100644
--- a/include/asm-i386/mach-es7000/mach_ipi.h
+++ b/include/asm-i386/mach-es7000/mach_ipi.h
@@ -1,7 +1,7 @@
 #ifndef __ASM_MACH_IPI_H
 #define __ASM_MACH_IPI_H
 
-static inline void send_IPI_mask_sequence(cpumask_t mask, int vector);
+inline void send_IPI_mask_sequence(cpumask_t mask, int vector);
 
 static inline void send_IPI_mask(cpumask_t mask, int vector)
 {
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h
index 3bcad6ab5..0aae26413 100644
--- a/include/asm-i386/mach-es7000/mach_mpparse.h
+++ b/include/asm-i386/mach-es7000/mach_mpparse.h
@@ -12,26 +12,28 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
 {
 }
 
-extern void parse_unisys_oem (char *oemptr, int oem_entries);
+extern int parse_unisys_oem (char *oemptr, int oem_entries);
 extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length);
 
-static inline void mps_oem_check(struct mp_config_table *mpc, char *oem, 
+static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
 		char *productid)
 {
 	if (mpc->mpc_oemptr) {
 		struct mp_config_oemtable *oem_table = 
 			(struct mp_config_oemtable *)mpc->mpc_oemptr;
-		parse_unisys_oem((char *)oem_table, oem_table->oem_length);
+		return parse_unisys_oem((char *)oem_table, oem_table->oem_length);
 	}
+	return 0;
 }
 
 /* Hook from generic ACPI tables.c */
-static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
 	unsigned long oem_addr; 
 	int oem_entries;
 	if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries))
-		parse_unisys_oem((char *)oem_addr, oem_entries);
+		return parse_unisys_oem((char *)oem_addr, oem_entries);
+	return 0;
 }
 
 
diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
index ed349c793..a7d6246ad 100644
--- a/include/asm-i386/mach-generic/mach_apic.h
+++ b/include/asm-i386/mach-generic/mach_apic.h
@@ -3,15 +3,16 @@
 
 #include <asm/genapic.h>
 
-#define esr_disable (genapic->esr_disable)
+#define esr_disable (genapic->ESR_DISABLE)
 #define NO_BALANCE_IRQ (genapic->no_balance_irq)
 #define NO_IOAPIC_CHECK	(genapic->no_ioapic_check)
 #define APIC_BROADCAST_ID (genapic->apic_broadcast_id)
 #define INT_DELIVERY_MODE (genapic->int_delivery_mode)
 #define INT_DEST_MODE (genapic->int_dest_mode)
+#undef APIC_DEST_LOGICAL
+#define APIC_DEST_LOGICAL (genapic->apic_destination_logical)
 #define TARGET_CPUS	  (genapic->target_cpus())
 #define apic_id_registered (genapic->apic_id_registered)
-#define apic_id_registered (genapic->apic_id_registered)
 #define init_apic_ldr (genapic->init_apic_ldr)
 #define ioapic_phys_id_map (genapic->ioapic_phys_id_map)
 #define clustered_apic_check (genapic->clustered_apic_check) 
diff --git a/include/asm-i386/param.h b/include/asm-i386/param.h
index 2c814d033..e0a475028 100644
--- a/include/asm-i386/param.h
+++ b/include/asm-i386/param.h
@@ -4,7 +4,7 @@
 #ifdef __KERNEL__
 # define HZ		1000		/* Internal kernel timer frequency */
 # define USER_HZ	100		/* .. some user interfaces are in "ticks" */
-# define CLOCKS_PER_SEC	(USER_HZ)	/* like times() */
+# define CLOCKS_PER_SEC		(USER_HZ)	/* like times() */
 #endif
 
 #ifndef HZ
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 1ba07e942..299c75871 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -314,23 +314,25 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 #define pte_unmap_nested(pte) do { } while (0)
 #endif
 
-#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G)
-typedef u32 pte_addr_t;
-#endif
-
-#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM64G)
-typedef u64 pte_addr_t;
-#endif
-
-#if !defined(CONFIG_HIGHPTE)
-typedef pte_t *pte_addr_t;
-#endif
-
 /*
  * The i386 doesn't have any external MMU info: the kernel page
  * tables contain all the necessary information.
+ *
+ * Also, we only update the dirty/accessed state if we set
+ * the dirty bit by hand in the kernel, since the hardware
+ * will do the accessed bit for us, and we don't want to
+ * race with other CPU's that might be updating the dirty
+ * bit at the same time.
  */
 #define update_mmu_cache(vma,address,pte) do { } while (0)
+#define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+	do {								  \
+		if (__dirty) {						  \
+			(__ptep)->pte_low = (__entry).pte_low;	  	  \
+			flush_tlb_page(__vma, __address);		  \
+		}							  \
+	} while (0)
 
 /* Encode and de-code a swap entry */
 #define __swp_type(x)			(((x).val >> 1) & 0x1f)
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index e114f9fe9..9d49ea237 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -59,6 +59,7 @@ struct cpuinfo_x86 {
 	char	x86_model_id[64];
 	int 	x86_cache_size;  /* in KB - valid for CPUS which support this
 				    call  */
+	int 	x86_cache_alignment;	/* In bytes */
 	int	fdiv_bug;
 	int	f00f_bug;
 	int	coma_bug;
@@ -648,4 +649,11 @@ extern inline void prefetchw(const void *x)
 
 extern void select_idle_routine(const struct cpuinfo_x86 *c);
 
+#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
+
+#ifdef CONFIG_SCHED_SMT
+#define ARCH_HAS_SCHED_DOMAIN
+#define ARCH_HAS_SCHED_WAKE_IDLE
+#endif
+
 #endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 268dabd46..bd8fa4cd9 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -34,9 +34,10 @@
 extern void smp_alloc_memory(void);
 extern int pic_mode;
 extern int smp_num_siblings;
-extern int cpu_sibling_map[];
+extern cpumask_t cpu_sibling_map[];
 
 extern void smp_flush_tlb(void);
+extern void dump_send_ipi(void);
 extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
 extern void smp_invalidate_rcv(void);		/* Process an NMI */
 extern void (*mtrr_hook) (void);
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index e89511675..8bd4f23a5 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -42,6 +42,7 @@ typedef struct {
 
 #define spin_is_locked(x)	(*(volatile signed char *)(&(x)->lock) <= 0)
 #define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 #define spin_lock_string \
 	"\n1:\t" \
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 6f59e1fe3..4ef147f97 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -47,15 +47,7 @@ struct thread_info {
 
 #else /* !__ASSEMBLY__ */
 
-/* offsets into the thread_info struct for assembly code access */
-#define TI_TASK		0x00000000
-#define TI_EXEC_DOMAIN	0x00000004
-#define TI_FLAGS	0x00000008
-#define TI_STATUS	0x0000000C
-#define TI_CPU		0x00000010
-#define TI_PRE_COUNT	0x00000014
-#define TI_ADDR_LIMIT	0x00000018
-#define TI_RESTART_BLOCK 0x000001C
+#include <asm/asm_offsets.h>
 
 #endif
 
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index 41adcaeaa..585d947ca 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -4,11 +4,16 @@
 /**
  * struct timer_ops - used to define a timer source
  *
+ * @name: name of the timer.
  * @init: Probes and initializes the timer. Takes clock= override 
- *  string as an argument. Returns 0 on success, anything else on failure.
- * @mark_offset: called by the timer interrupt
- * @get_offset: called by gettimeofday().  Returns the number of ms since the
- *	last timer intruupt.
+ *        string as an argument. Returns 0 on success, anything else
+ *        on failure.
+ * @mark_offset: called by the timer interrupt.
+ * @get_offset:  called by gettimeofday(). Returns the number of microseconds
+ *               since the last timer interupt.
+ * @monotonic_clock: returns the number of nanoseconds since the init of the
+ *                   timer.
+ * @delay: delays this many clock cycles.
  */
 struct timer_opts{
 	char* name;
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index ced00fe8f..901b77c42 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -63,6 +63,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index f0216b1e0..656be13d0 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -43,7 +43,7 @@ extern struct movsl_mask {
 } ____cacheline_aligned_in_smp movsl_mask;
 #endif
 
-#define __addr_ok(addr) ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg))
+#define __addr_ok(addr) ((unsigned long __force)(addr) < (current_thread_info()->addr_limit.seg))
 
 /*
  * Test whether a block of memory is a valid user space address.
@@ -56,6 +56,7 @@ extern struct movsl_mask {
  */
 #define __range_ok(addr,size) ({ \
 	unsigned long flag,sum; \
+	__chk_user_ptr(addr); \
 	asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
 		:"=&r" (flag), "=r" (sum) \
 		:"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \
@@ -170,6 +171,7 @@ extern void __get_user_4(void);
  */
 #define get_user(x,ptr)							\
 ({	int __ret_gu,__val_gu;						\
+	__chk_user_ptr(ptr);						\
 	switch(sizeof (*(ptr))) {					\
 	case 1:  __get_user_x(1,__ret_gu,__val_gu,ptr); break;		\
 	case 2:  __get_user_x(2,__ret_gu,__val_gu,ptr); break;		\
@@ -288,6 +290,7 @@ extern void __put_user_bad(void);
 #define __put_user_size(x,ptr,size,retval,errret)			\
 do {									\
 	retval = 0;							\
+	__chk_user_ptr(ptr);						\
 	switch (size) {							\
 	case 1: __put_user_asm(x,ptr,retval,"b","b","iq",errret);break;	\
 	case 2: __put_user_asm(x,ptr,retval,"w","w","ir",errret);break; \
@@ -346,6 +349,7 @@ extern long __get_user_bad(void);
 #define __get_user_size(x,ptr,size,retval,errret)			\
 do {									\
 	retval = 0;							\
+	__chk_user_ptr(ptr);						\
 	switch (size) {							\
 	case 1: __get_user_asm(x,ptr,retval,"b","b","=q",errret);break;	\
 	case 2: __get_user_asm(x,ptr,retval,"w","w","=r",errret);break;	\
@@ -403,13 +407,13 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
 
 		switch (n) {
 		case 1:
-			__put_user_size(*(u8 *)from, (u8 *)to, 1, ret, 1);
+			__put_user_size(*(u8 *)from, (u8 __user *)to, 1, ret, 1);
 			return ret;
 		case 2:
-			__put_user_size(*(u16 *)from, (u16 *)to, 2, ret, 2);
+			__put_user_size(*(u16 *)from, (u16 __user *)to, 2, ret, 2);
 			return ret;
 		case 4:
-			__put_user_size(*(u32 *)from, (u32 *)to, 4, ret, 4);
+			__put_user_size(*(u32 *)from, (u32 __user *)to, 4, ret, 4);
 			return ret;
 		}
 	}
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 620a23208..0df3f9b0a 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -288,8 +288,9 @@
 #define __NR_mq_timedreceive	(__NR_mq_open+3)
 #define __NR_mq_notify		(__NR_mq_open+4)
 #define __NR_mq_getsetattr	(__NR_mq_open+5)
+#define __NR_sys_kexec_load	283
 
-#define NR_syscalls 283
+#define NR_syscalls 284
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
 
@@ -380,6 +381,31 @@ __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; int $0x80 ; p
 __syscall_return(type,__res); \
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 72be5cce3..3e13984cf 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -96,7 +96,6 @@ static inline void disable_acpi(void) { }
 const char *acpi_get_sysname (void);
 int acpi_request_vector (u32 int_type);
 int acpi_register_irq (u32 gsi, u32 polarity, u32 trigger);
-int acpi_irq_to_vector (u32 irq); /* deprecated in favor of acpi_gsi_to_irq */
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef CONFIG_ACPI_NUMA
diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h
index 25eb686b0..77af457f4 100644
--- a/include/asm-ia64/asmmacro.h
+++ b/include/asm-ia64/asmmacro.h
@@ -100,4 +100,12 @@ name:
 # define TEXT_ALIGN(n)
 #endif
 
+#ifdef HAVE_SERIALIZE_DIRECTIVE
+# define dv_serialize_data		.serialize.data
+# define dv_serialize_instruction	.serialize.instruction
+#else
+# define dv_serialize_data
+# define dv_serialize_instruction
+#endif
+
 #endif /* _ASM_IA64_ASMMACRO_H */
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h
index f2e179d4b..cd49762ec 100644
--- a/include/asm-ia64/atomic.h
+++ b/include/asm-ia64/atomic.h
@@ -159,10 +159,10 @@ atomic64_add_negative (__s64 i, atomic64_t *v)
 
 #define atomic_sub_and_test(i,v)	(atomic_sub_return((i), (v)) == 0)
 #define atomic_dec_and_test(v)		(atomic_sub_return(1, (v)) == 0)
-#define atomic_inc_and_test(v)		(atomic_add_return(1, (v)) != 0)
+#define atomic_inc_and_test(v)		(atomic_add_return(1, (v)) == 0)
 #define atomic64_sub_and_test(i,v)	(atomic64_sub_return((i), (v)) == 0)
 #define atomic64_dec_and_test(v)	(atomic64_sub_return(1, (v)) == 0)
-#define atomic64_inc_and_test(v)	(atomic64_add_return(1, (v)) != 0)
+#define atomic64_inc_and_test(v)	(atomic64_add_return(1, (v)) == 0)
 
 #define atomic_add(i,v)			atomic_add_return((i), (v))
 #define atomic_sub(i,v)			atomic_sub_return((i), (v))
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
index bd39859c2..c9b8bba84 100644
--- a/include/asm-ia64/bitops.h
+++ b/include/asm-ia64/bitops.h
@@ -11,7 +11,7 @@
 
 #include <linux/compiler.h>
 #include <linux/types.h>
-
+#include <asm/bitops.h>
 #include <asm/intrinsics.h>
 
 /**
@@ -359,93 +359,21 @@ hweight64 (unsigned long x)
 
 #endif /* __KERNEL__ */
 
-/*
- * Find next zero bit in a bitmap reasonably efficiently..
- */
-static inline int
-find_next_zero_bit (void *addr, unsigned long size, unsigned long offset)
-{
-	unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
-	unsigned long result = offset & ~63UL;
-	unsigned long tmp;
-
-	if (offset >= size)
-		return size;
-	size -= result;
-	offset &= 63UL;
-	if (offset) {
-		tmp = *(p++);
-		tmp |= ~0UL >> (64-offset);
-		if (size < 64)
-			goto found_first;
-		if (~tmp)
-			goto found_middle;
-		size -= 64;
-		result += 64;
-	}
-	while (size & ~63UL) {
-		if (~(tmp = *(p++)))
-			goto found_middle;
-		result += 64;
-		size -= 64;
-	}
-	if (!size)
-		return result;
-	tmp = *p;
-found_first:
-	tmp |= ~0UL << size;
-	if (tmp == ~0UL)		/* any bits zero? */
-		return result + size;	/* nope */
-found_middle:
-	return result + ffz(tmp);
-}
+extern int __find_next_zero_bit (void *addr, unsigned long size,
+			unsigned long offset);
+extern int __find_next_bit(const void *addr, unsigned long size,
+			unsigned long offset);
+
+#define find_next_zero_bit(addr, size, offset) \
+			__find_next_zero_bit((addr), (size), (offset))
+#define find_next_bit(addr, size, offset) \
+			__find_next_bit((addr), (size), (offset))
 
 /*
  * The optimizer actually does good code for this case..
  */
 #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
 
-/*
- * Find next bit in a bitmap reasonably efficiently..
- */
-static inline int
-find_next_bit(const void *addr, unsigned long size, unsigned long offset)
-{
-	unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
-	unsigned long result = offset & ~63UL;
-	unsigned long tmp;
-
-	if (offset >= size)
-		return size;
-	size -= result;
-	offset &= 63UL;
-	if (offset) {
-		tmp = *(p++);
-		tmp &= ~0UL << offset;
-		if (size < 64)
-			goto found_first;
-		if (tmp)
-			goto found_middle;
-		size -= 64;
-		result += 64;
-	}
-	while (size & ~63UL) {
-		if ((tmp = *(p++)))
-			goto found_middle;
-		result += 64;
-		size -= 64;
-	}
-	if (!size)
-		return result;
-	tmp = *p;
-  found_first:
-	tmp &= ~0UL >> (64-size);
-	if (tmp == 0UL)		/* Are any bits set? */
-		return result + size; /* Nope. */
-  found_middle:
-	return result + __ffs(tmp);
-}
-
 #define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
 
 #ifdef __KERNEL__
diff --git a/include/asm-ia64/cacheflush.h b/include/asm-ia64/cacheflush.h
index 8aefdd6b6..ef0e256f2 100644
--- a/include/asm-ia64/cacheflush.h
+++ b/include/asm-ia64/cacheflush.h
@@ -29,6 +29,9 @@ do {						\
 	clear_bit(PG_arch_1, &(page)->flags);	\
 } while (0)
 
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
+
 extern void flush_icache_range (unsigned long start, unsigned long end);
 
 #define flush_icache_user_range(vma, page, user_addr, len)					\
diff --git a/include/asm-ia64/delay.h b/include/asm-ia64/delay.h
index 1b9df23a5..aa627cfd8 100644
--- a/include/asm-ia64/delay.h
+++ b/include/asm-ia64/delay.h
@@ -44,6 +44,12 @@ ia64_set_itv (unsigned long val)
 	ia64_srlz_d();
 }
 
+static __inline__ unsigned long
+ia64_get_itv (void)
+{
+	return ia64_getreg(_IA64_REG_CR_ITV);
+}
+
 static __inline__ void
 ia64_set_itc (unsigned long val)
 {
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h
index a2274aa3f..d3d94e85c 100644
--- a/include/asm-ia64/gcc_intrin.h
+++ b/include/asm-ia64/gcc_intrin.h
@@ -4,9 +4,10 @@
  *
  * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com>
  * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
- *
  */
 
+#include <linux/compiler.h>
+
 /* define this macro to get some asm stmts included in 'c' files */
 #define ASM_SUPPORTED
 
@@ -23,7 +24,7 @@
 extern void ia64_bad_param_for_setreg (void);
 extern void ia64_bad_param_for_getreg (void);
 
-register unsigned long ia64_r13 asm ("r13");
+register unsigned long ia64_r13 asm ("r13") __attribute_used__;
 
 #define ia64_setreg(regnum, val)						\
 ({										\
@@ -377,9 +378,16 @@ register unsigned long ia64_r13 asm ("r13");
 })
 
 #define ia64_srlz_i()	asm volatile (";; srlz.i ;;" ::: "memory")
-
 #define ia64_srlz_d()	asm volatile (";; srlz.d" ::: "memory");
 
+#ifdef HAVE_SERIALIZE_DIRECTIVE
+# define ia64_dv_serialize_data()		asm volatile (".serialize.data");
+# define ia64_dv_serialize_instruction()	asm volatile (".serialize.instruction");
+#else
+# define ia64_dv_serialize_data()
+# define ia64_dv_serialize_instruction()
+#endif
+
 #define ia64_nop(x)	asm volatile ("nop %0"::"i"(x));
 
 #define ia64_itci(addr)	asm volatile ("itc.i %0;;" :: "r"(addr) : "memory")
diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h
index 778d69ec6..e62b95301 100644
--- a/include/asm-ia64/ide.h
+++ b/include/asm-ia64/ide.h
@@ -25,6 +25,8 @@
 # endif
 #endif
 
+#define IDE_ARCH_OBSOLETE_DEFAULTS
+
 static inline int ide_default_irq(unsigned long base)
 {
 	switch (base) {
@@ -53,6 +55,9 @@ static inline unsigned long ide_default_io_base(int index)
 	}
 }
 
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+
 #ifdef CONFIG_PCI
 #define ide_init_default_irq(base)	(0)
 #else
diff --git a/include/asm-ia64/intel_intrin.h b/include/asm-ia64/intel_intrin.h
index 542f8421a..a7122d850 100644
--- a/include/asm-ia64/intel_intrin.h
+++ b/include/asm-ia64/intel_intrin.h
@@ -204,6 +204,9 @@ __s64 _m64_popcnt(__s64 a);
 #define ia64_srlz_d		__dsrlz
 #define ia64_srlz_i		__isrlz
 
+#define ia64_dv_serialize_data()
+#define ia64_dv_serialize_instruction()
+
 #define ia64_st1_rel		__st1_rel
 #define ia64_st2_rel		__st2_rel
 #define ia64_st4_rel		__st4_rel
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index 83a57662f..590432c08 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -8,7 +8,7 @@
  * This hopefully works with any (fixed) IA-64 page-size, as defined
  * in <asm/page.h> (currently 8192).
  *
- * Copyright (C) 1998-2003 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
@@ -102,7 +102,7 @@
  * can map.
  */
 #define PMD_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT-3))
-#define PMD_SIZE	(__IA64_UL(1) << PMD_SHIFT)
+#define PMD_SIZE	(1UL << PMD_SHIFT)
 #define PMD_MASK	(~(PMD_SIZE-1))
 #define PTRS_PER_PMD	(__IA64_UL(1) << (PAGE_SHIFT-3))
 
@@ -469,8 +469,6 @@ extern void hugetlb_free_pgtables(struct mmu_gather *tlb,
 	struct vm_area_struct * prev, unsigned long start, unsigned long end);
 #endif
 
-typedef pte_t *pte_addr_t;
-
 /*
  * IA-64 doesn't have any external MMU info: the page tables contain all the necessary
  * information.  However, we use this routine to take care of any (delayed) i-cache
@@ -478,6 +476,42 @@ typedef pte_t *pte_addr_t;
  */
 extern void update_mmu_cache (struct vm_area_struct *vma, unsigned long vaddr, pte_t pte);
 
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+/*
+ * Update PTEP with ENTRY, which is guaranteed to be a less
+ * restrictive PTE.  That is, ENTRY may have the ACCESSED, DIRTY, and
+ * WRITABLE bits turned on, when the value at PTEP did not.  The
+ * WRITABLE bit may only be turned if SAFELY_WRITABLE is TRUE.
+ *
+ * SAFELY_WRITABLE is TRUE if we can update the value at PTEP without
+ * having to worry about races.  On SMP machines, there are only two
+ * cases where this is true:
+ *
+ *	(1) *PTEP has the PRESENT bit turned OFF
+ *	(2) ENTRY has the DIRTY bit turned ON
+ *
+ * On ia64, we could implement this routine with a cmpxchg()-loop
+ * which ORs in the _PAGE_A/_PAGE_D bit if they're set in ENTRY.
+ * However, like on x86, we can get a more streamlined version by
+ * observing that it is OK to drop ACCESSED bit updates when
+ * SAFELY_WRITABLE is FALSE.  Besides being rare, all that would do is
+ * result in an extra Access-bit fault, which would then turn on the
+ * ACCESSED bit in the low-level fault handler (iaccess_bit or
+ * daccess_bit in ivt.S).
+ */
+#ifdef CONFIG_SMP
+# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable)	\
+do {											\
+	if (__safely_writable) {							\
+		set_pte(__ptep, __entry);						\
+		flush_tlb_page(__vma, __addr);						\
+	}										\
+} while (0)
+#else
+# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable)	\
+	ptep_establish(__vma, __addr, __ptep, __entry)
+#endif
+
 #  ifdef CONFIG_VIRTUAL_MEM_MAP
   /* arch mem_map init routine is needed due to holes in a virtual mem_map */
 #   define __HAVE_ARCH_MEMMAP_INIT
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h
index 4d2257f25..f24615df3 100644
--- a/include/asm-ia64/signal.h
+++ b/include/asm-ia64/signal.h
@@ -176,7 +176,6 @@ struct k_sigaction {
 #  include <asm/sigcontext.h>
 
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
-#define HAVE_ARCH_SYS_PAUSE
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index deeccd4f8..f12f939e3 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -36,9 +36,8 @@ extern struct smp_boot_data {
 	int cpu_phys_id[NR_CPUS];
 } smp_boot_data __initdata;
 
-extern char no_int_routing __initdata;
+extern char no_int_routing __devinitdata;
 
-extern cpumask_t phys_cpu_present_map;
 extern cpumask_t cpu_online_map;
 extern unsigned long ipi_base_addr;
 extern unsigned char smp_int_redirect;
@@ -48,8 +47,6 @@ extern volatile int ia64_cpu_to_sapicid[];
 
 extern unsigned long ap_wakeup_vector;
 
-#define cpu_possible_map phys_cpu_present_map
-
 /*
  * Function to map hard smp processor id to logical id.  Slow, so don't use this in
  * performance-critical code.
@@ -113,6 +110,7 @@ hard_smp_processor_id (void)
 /* Upping and downing of CPUs */
 extern int __cpu_disable (void);
 extern void __cpu_die (unsigned int cpu);
+extern void cpu_die (void) __attribute__ ((noreturn));
 extern int __cpu_up (unsigned int cpu);
 extern void __init smp_build_cpu_map(void);
 
@@ -122,6 +120,8 @@ extern void smp_do_timer (struct pt_regs *regs);
 extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
 				     int retry, int wait);
 extern void smp_send_reschedule (int cpu);
+extern void lock_ipi_calllock(void);
+extern void unlock_ipi_calllock(void);
 
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_SMP_H */
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
index 53691562b..0faf9d7dd 100644
--- a/include/asm-ia64/sn/arch.h
+++ b/include/asm-ia64/sn/arch.h
@@ -20,12 +20,6 @@ typedef u64	hubreg_t;
 typedef u64	mmr_t;
 typedef u64	nic_t;
 
-#define CNODE_TO_CPU_BASE(_cnode)	(NODEPDA(_cnode)->node_first_cpu)
-
-#define NASID_TO_COMPACT_NODEID(nasid)  (nasid_to_cnodeid(nasid))
-#define COMPACT_TO_NASID_NODEID(cnode)  (cnodeid_to_nasid(cnode))
-
-
 #define INVALID_NASID		((nasid_t)-1)
 #define INVALID_CNODEID		((cnodeid_t)-1)
 #define INVALID_PNODEID		((pnodeid_t)-1)
@@ -34,9 +28,7 @@ typedef u64	nic_t;
 #define	INVALID_PARTID		((partid_t)-1)
 
 extern cpuid_t cnodetocpu(cnodeid_t);
-void   sn_flush_all_caches(long addr, long bytes);
-
-extern int     is_fine_dirmode(void);
-
+extern void sn_flush_all_caches(long addr, long bytes);
+extern int is_fine_dirmode(void);
 
 #endif /* _ASM_IA64_SN_ARCH_H */
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
index c34d28fdd..d2e8a0aa5 100644
--- a/include/asm-ia64/sn/intr.h
+++ b/include/asm-ia64/sn/intr.h
@@ -8,9 +8,11 @@
 #ifndef _ASM_IA64_SN_INTR_H
 #define _ASM_IA64_SN_INTR_H
 
+#include <asm/sn/types.h>
 #include <asm/sn/sn2/intr.h>
 
 extern void sn_send_IPI_phys(long, int, int);
+extern void intr_init_vecblk(cnodeid_t node);
 
 #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector)
 #define SN_CPU_FROM_IRQ(irq)	(0)
diff --git a/include/asm-ia64/sn/module.h b/include/asm-ia64/sn/module.h
index ff23517a8..b7c7dd2ab 100644
--- a/include/asm-ia64/sn/module.h
+++ b/include/asm-ia64/sn/module.h
@@ -184,10 +184,6 @@ extern module_t	       *modules[MODULE_MAX];	/* Indexed by cmoduleid_t   */
 extern int		nummodules;
 
 extern module_t	       *module_lookup(moduleid_t id);
-
-extern int		get_kmod_sys_snum(cmoduleid_t cmod,
-					  char *snum);
-
 extern void		format_module_id(char *buffer, moduleid_t m, int fmt);
 extern int		parse_module_id(char *buffer);
 
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
index c992940c6..d76ef9ea9 100644
--- a/include/asm-ia64/sn/nodepda.h
+++ b/include/asm-ia64/sn/nodepda.h
@@ -36,13 +36,6 @@
 
 
 struct nodepda_s {
-
-
-	cpuid_t         node_first_cpu; /* Starting cpu number for node */
-					/* WARNING: no guarantee that   */
-					/*  the second cpu on a node is */
-					/*  node_first_cpu+1.           */
-
 	vertex_hdl_t 	xbow_vhdl;
 	nasid_t		xbow_peer;	/* NASID of our peer hub on xbow */
 	struct semaphore xbow_sema;	/* Sema for xbow synchronization */
diff --git a/include/asm-ia64/sn/sn2/sn_private.h b/include/asm-ia64/sn/sn2/sn_private.h
index 4e91a848a..bee0da86f 100644
--- a/include/asm-ia64/sn/sn2/sn_private.h
+++ b/include/asm-ia64/sn/sn2/sn_private.h
@@ -233,7 +233,7 @@ extern void sysctlr_keepalive(void);
  * address.
  */
 #define paddr_dimm(_pa)		((_pa & MD_BANK_MASK) >> MD_BANK_SHFT)
-#define paddr_cnode(_pa)	(NASID_TO_COMPACT_NODEID(NASID_GET(_pa)))
+#define paddr_cnode(_pa)	(nasid_to_cnodeid(NASID_GET(_pa)))
 extern void membank_pathname_get(paddr_t, char *);
 
 extern void crbx(nasid_t nasid, void (*pf) (char *, ...));
diff --git a/include/asm-ia64/sn/types.h b/include/asm-ia64/sn/types.h
index 5f821c078..ac9dff862 100644
--- a/include/asm-ia64/sn/types.h
+++ b/include/asm-ia64/sn/types.h
@@ -15,11 +15,9 @@ typedef signed char	partid_t;	/* partition ID type */
 typedef unsigned int    moduleid_t;     /* user-visible module number type */
 typedef unsigned int    cmoduleid_t;    /* kernel compact module id type */
 typedef signed char     slabid_t;
-typedef unsigned char	clusterid_t;	/* Clusterid of the cell */
 
 typedef unsigned long iopaddr_t;
 typedef unsigned long paddr_t;
-typedef unsigned long pfn_t;
 typedef short cnodeid_t;
 
 #endif /* _ASM_IA64_SN_TYPES_H */
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
index 28ba9138b..40f939c5b 100644
--- a/include/asm-ia64/spinlock.h
+++ b/include/asm-ia64/spinlock.h
@@ -32,10 +32,10 @@ typedef struct {
  * carefully coded to touch only those registers that spin_lock() marks "clobbered".
  */
 
-#define IA64_SPINLOCK_CLOBBERS "ar.ccv", "ar.pfs", "p14", "r28", "r29", "r30", "b6", "memory"
+#define IA64_SPINLOCK_CLOBBERS "ar.ccv", "ar.pfs", "p14", "p15", "r27", "r28", "r29", "r30", "b6", "memory"
 
 static inline void
-_raw_spin_lock (spinlock_t *lock)
+_raw_spin_lock_flags (spinlock_t *lock, unsigned long flags)
 {
 	register volatile unsigned int *ptr asm ("r31") = &lock->lock;
 
@@ -50,9 +50,10 @@ _raw_spin_lock (spinlock_t *lock)
 		      "cmpxchg4.acq r30 = [%1], r30, ar.ccv\n\t"
 		      "movl r29 = ia64_spinlock_contention_pre3_4;;\n\t"
 		      "cmp4.ne p14, p0 = r30, r0\n\t"
-		      "mov b6 = r29;;\n"
+		      "mov b6 = r29;;\n\t"
+		      "mov r27=%2\n\t"
 		      "(p14) br.cond.spnt.many b6"
-		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
+		      : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
 # else
 	asm volatile ("{\n\t"
 		      "  mov ar.ccv = r0\n\t"
@@ -60,33 +61,38 @@ _raw_spin_lock (spinlock_t *lock)
 		      "  mov r30 = 1;;\n\t"
 		      "}\n\t"
 		      "cmpxchg4.acq r30 = [%1], r30, ar.ccv;;\n\t"
-		      "cmp4.ne p14, p0 = r30, r0\n"
+		      "cmp4.ne p14, p0 = r30, r0\n\t"
+		      "mov r27=%2\n\t"
 		      "(p14) brl.cond.spnt.many ia64_spinlock_contention_pre3_4;;"
-		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
+		      : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
 # endif /* CONFIG_MCKINLEY */
 #else
 # ifdef CONFIG_ITANIUM
 	/* don't use brl on Itanium... */
 	/* mis-declare, so we get the entry-point, not it's function descriptor: */
 	asm volatile ("mov r30 = 1\n\t"
+		      "mov r27=%2\n\t"
 		      "mov ar.ccv = r0;;\n\t"
 		      "cmpxchg4.acq r30 = [%0], r30, ar.ccv\n\t"
 		      "movl r29 = ia64_spinlock_contention;;\n\t"
 		      "cmp4.ne p14, p0 = r30, r0\n\t"
-		      "mov b6 = r29;;\n"
+		      "mov b6 = r29;;\n\t"
 		      "(p14) br.call.spnt.many b6 = b6"
-		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
+		      : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
 # else
 	asm volatile ("mov r30 = 1\n\t"
+		      "mov r27=%2\n\t"
 		      "mov ar.ccv = r0;;\n\t"
 		      "cmpxchg4.acq r30 = [%0], r30, ar.ccv;;\n\t"
 		      "cmp4.ne p14, p0 = r30, r0\n\t"
 		      "(p14) brl.call.spnt.many b6=ia64_spinlock_contention;;"
-		      : "=r"(ptr) : "r"(ptr) : IA64_SPINLOCK_CLOBBERS);
+		      : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS);
 # endif /* CONFIG_MCKINLEY */
 #endif
 }
+#define _raw_spin_lock(lock) _raw_spin_lock_flags(lock, 0)
 #else /* !ASM_SUPPORTED */
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 # define _raw_spin_lock(x)								\
 do {											\
 	__u32 *ia64_spinlock_ptr = (__u32 *) (x);					\
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index d6a5d7eb4..57c7db10a 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -114,10 +114,16 @@ extern struct ia64_boot_param {
  */
 /* For spinlocks etc */
 
-/* clearing psr.i is implicitly serialized (visible by next insn) */
-/* setting psr.i requires data serialization */
+/*
+ * - clearing psr.i is implicitly serialized (visible by next insn)
+ * - setting psr.i requires data serialization
+ * - we need a stop-bit before reading PSR because we sometimes
+ *   write a floating-point register right before reading the PSR
+ *   and that writes to PSR.mfl
+ */
 #define __local_irq_save(x)			\
 do {						\
+	ia64_stop();				\
 	(x) = ia64_getreg(_IA64_REG_PSR);	\
 	ia64_stop();				\
 	ia64_rsm(IA64_PSR_I);			\
@@ -166,7 +172,7 @@ do {								\
 #endif /* !CONFIG_IA64_DEBUG_IRQ */
 
 #define local_irq_enable()	({ ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
-#define local_save_flags(flags)	((flags) = ia64_getreg(_IA64_REG_PSR))
+#define local_save_flags(flags)	({ ia64_stop(); (flags) = ia64_getreg(_IA64_REG_PSR); })
 
 #define irqs_disabled()				\
 ({						\
@@ -233,7 +239,7 @@ extern void ia64_load_extra (struct task_struct *task);
  * the latest fph state from another CPU.  In other words: eager save, lazy restore.
  */
 # define switch_to(prev,next,last) do {						\
-	if (ia64_psr(ia64_task_regs(prev))->mfh) {				\
+	if (ia64_psr(ia64_task_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) {				\
 		ia64_psr(ia64_task_regs(prev))->mfh = 0;			\
 		(prev)->thread.flags |= IA64_THREAD_FPH_VALID;			\
 		__ia64_save_fpu((prev)->thread.fph);				\
diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h
index 902850d12..a677565aa 100644
--- a/include/asm-ia64/types.h
+++ b/include/asm-ia64/types.h
@@ -67,6 +67,8 @@ typedef __u64 u64;
 
 typedef u64 dma_addr_t;
 
+typedef unsigned short kmem_bufctl_t;
+
 # endif /* __KERNEL__ */
 #endif /* !__ASSEMBLY__ */
 
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 284c40afe..ca3c7b958 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -4,7 +4,7 @@
 /*
  * IA-64 Linux syscall numbers and inline-functions.
  *
- * Copyright (C) 1998-2003 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
@@ -248,20 +248,36 @@
 #define __NR_clock_nanosleep		1256
 #define __NR_fstatfs64			1257
 #define __NR_statfs64			1258
-#define __NR_reserved1			1259	/* reserved for NUMA interface */
-#define __NR_reserved2			1260	/* reserved for NUMA interface */
-#define __NR_reserved3			1261	/* reserved for NUMA interface */
+#define __NR_mbind			1259
+#define __NR_get_mempolicy		1260
+#define __NR_set_mempolicy		1261
 #define __NR_mq_open			1262
 #define __NR_mq_unlink			1263
 #define __NR_mq_timedsend		1264
 #define __NR_mq_timedreceive		1265
 #define __NR_mq_notify			1266
 #define __NR_mq_getsetattr		1267
+#define __NR_kexec_load			1268
+#define __NR_vserver			1269
 
 #ifdef __KERNEL__
 
+#include <linux/config.h>
+
 #define NR_syscalls			256 /* length of syscall table */
 
+#ifdef CONFIG_IA32_SUPPORT
+# define __ARCH_WANT_SYS_FADVISE64
+# define __ARCH_WANT_SYS_GETPGRP
+# define __ARCH_WANT_SYS_LLSEEK
+# define __ARCH_WANT_SYS_NICE
+# define __ARCH_WANT_SYS_OLD_GETRLIMIT
+# define __ARCH_WANT_SYS_OLDUMOUNT
+# define __ARCH_WANT_SYS_SIGPENDING
+# define __ARCH_WANT_SYS_SIGPROCMASK
+# define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
 
 #include <linux/types.h>
@@ -303,10 +319,10 @@ lseek (int fd, off_t off, int whence)
 	return sys_lseek(fd, off, whence);
 }
 
-static inline long
+static inline void
 _exit (int value)
 {
-	return sys_exit(value);
+	sys_exit(value);
 }
 
 #define exit(x) _exit(x)
@@ -372,7 +388,7 @@ asmlinkage long sys_rt_sigaction(int sig,
  * proper prototype, but we can't use __typeof__ either, because not all cond_syscall()
  * declarations have prototypes at the moment.
  */
-#define cond_syscall(x) asmlinkage long x() __attribute__((weak,alias("sys_ni_syscall")));
+#define cond_syscall(x) asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall")));
 
 #endif /* !__ASSEMBLY__ */
 #endif /* __KERNEL__ */
diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h
index 045f58fcd..3ae5d8d55 100644
--- a/include/asm-m68k/amigahw.h
+++ b/include/asm-m68k/amigahw.h
@@ -252,8 +252,8 @@ struct CUSTOM {
 #define DMAF_ALL		(0x01FF)
 
 struct CIA {
-    unsigned char pra; 		char pad0[0xff];
-    unsigned char prb; 		char pad1[0xff];
+    unsigned char pra;		char pad0[0xff];
+    unsigned char prb;		char pad1[0xff];
     unsigned char ddra;		char pad2[0xff];
     unsigned char ddrb;		char pad3[0xff];
     unsigned char talo;		char pad4[0xff];
@@ -263,10 +263,10 @@ struct CIA {
     unsigned char todlo;	char pad8[0xff];
     unsigned char todmid;	char pad9[0xff];
     unsigned char todhi;	char pada[0x1ff];
-    unsigned char sdr; 		char padb[0xff];
-    unsigned char icr; 		char padc[0xff];
-    unsigned char cra; 		char padd[0xff];
-    unsigned char crb; 		char pade[0xff];
+    unsigned char sdr;		char padb[0xff];
+    unsigned char icr;		char padc[0xff];
+    unsigned char cra;		char padd[0xff];
+    unsigned char crb;		char pade[0xff];
 };
 
 #define zTwoBase (0x80000000)
@@ -319,7 +319,7 @@ struct tod3000 {
   unsigned int  :28, year2:4;	/* lower digit */
   unsigned int  :28, year1:4;	/* upper digit */
   unsigned int  :28, cntrl1:4;	/* control-byte 1 */
-  unsigned int  :28, cntrl2:4;	/* control-byte 2 */  
+  unsigned int  :28, cntrl2:4;	/* control-byte 2 */
   unsigned int  :28, cntrl3:4;	/* control-byte 3 */
 };
 #define TOD3000_CNTRL1_HOLD	0
@@ -341,7 +341,7 @@ struct tod2000 {
   unsigned int  :28, year1:4;	/* upper digit */
   unsigned int  :28, weekday:4;
   unsigned int  :28, cntrl1:4;	/* control-byte 1 */
-  unsigned int  :28, cntrl2:4;	/* control-byte 2 */  
+  unsigned int  :28, cntrl2:4;	/* control-byte 2 */
   unsigned int  :28, cntrl3:4;	/* control-byte 3 */
 };
 
diff --git a/include/asm-m68k/apollodma.h b/include/asm-m68k/apollodma.h
index 558dfd220..6821e3ba3 100644
--- a/include/asm-m68k/apollodma.h
+++ b/include/asm-m68k/apollodma.h
@@ -32,7 +32,7 @@
  *  - page registers for 5-7 don't use data bit 0, represent 128K pages
  *  - page registers for 0-3 use bit 0, represent 64K pages
  *
- * DMA transfers are limited to the lower 16MB of _physical_ memory.  
+ * DMA transfers are limited to the lower 16MB of _physical_ memory.
  * Note that addresses loaded into registers must be _physical_ addresses,
  * not logical addresses (which may differ if paging is active).
  *
@@ -42,7 +42,7 @@
  *    |  ...  |   |  ... |   |  ... |
  *    |  ...  |   |  ... |   |  ... |
  *    |  ...  |   |  ... |   |  ... |
- *   P7  ...  P0  A7 ... A0  A7 ... A0   
+ *   P7  ...  P0  A7 ... A0  A7 ... A0
  * |    Page    | Addr MSB | Addr LSB |   (DMA registers)
  *
  *  Address mapping for channels 5-7:
@@ -51,7 +51,7 @@
  *    |  ...  |   \   \   ... \  \  \  ... \  \
  *    |  ...  |    \   \   ... \  \  \  ... \  (not used)
  *    |  ...  |     \   \   ... \  \  \  ... \
- *   P7  ...  P1 (0) A7 A6  ... A0 A7 A6 ... A0   
+ *   P7  ...  P1 (0) A7 A6  ... A0 A7 A6 ... A0
  * |      Page      |  Addr MSB   |  Addr LSB  |   (DMA registers)
  *
  * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
@@ -60,7 +60,7 @@
  *
  * Transfer count (_not # bytes_) is limited to 64K, represented as actual
  * count - 1 : 64K => 0xFFFF, 1 => 0x0000.  Thus, count is always 1 or more,
- * and up to 128K bytes may be transferred on channels 5-7 in one operation. 
+ * and up to 128K bytes may be transferred on channels 5-7 in one operation.
  *
  */
 
@@ -232,7 +232,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
 
 	count = 1 + dma_inb(io_port);
 	count += dma_inb(io_port) << 8;
-	
+
 	return (dmanr<=3)? count : (count<<1);
 }
 
diff --git a/include/asm-m68k/apollohw.h b/include/asm-m68k/apollohw.h
index f29992a39..4304e1c33 100644
--- a/include/asm-m68k/apollohw.h
+++ b/include/asm-m68k/apollohw.h
@@ -4,7 +4,7 @@
 #define _ASMm68k_APOLLOHW_H_
 
 /*
-   apollo models 
+   apollo models
 */
 
 extern u_long apollo_model;
@@ -16,8 +16,8 @@ extern u_long apollo_model;
 #define APOLLO_DN4000 (4)
 #define APOLLO_DN4500 (5)
 
-/* 
-   see scn2681 data sheet for more info. 
+/*
+   see scn2681 data sheet for more info.
    member names are read_write.
 */
 
@@ -96,7 +96,7 @@ extern u_long timer_physaddr;
 #define cpuctrl (*(volatile unsigned int *)(IO_BASE + cpuctrl_physaddr))
 #define pica (IO_BASE + pica_physaddr)
 #define picb (IO_BASE + picb_physaddr)
-#define timer (IO_BASE + timer_physaddr)	
+#define timer (IO_BASE + timer_physaddr)
 #define addr_xlat_map ((unsigned short *)(IO_BASE + 0x17000))
 
 #define isaIO2mem(x) (((((x) & 0x3f8)  << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE)
diff --git a/include/asm-m68k/atafdreg.h b/include/asm-m68k/atafdreg.h
index 8c4a8d5b6..bbf80949f 100644
--- a/include/asm-m68k/atafdreg.h
+++ b/include/asm-m68k/atafdreg.h
@@ -65,7 +65,7 @@
 
 /* PSG Port A Bit Nr 0 .. Side Sel .. 0 -> Side 1  1 -> Side 2 */
 #define DSKSIDE     (0x01)
-        
+
 #define DSKDRVNONE  (0x06)
 #define DSKDRV0     (0x02)
 #define DSKDRV1     (0x04)
diff --git a/include/asm-m68k/atari_SCCserial.h b/include/asm-m68k/atari_SCCserial.h
index 9c373bad8..de3af56c6 100644
--- a/include/asm-m68k/atari_SCCserial.h
+++ b/include/asm-m68k/atari_SCCserial.h
@@ -20,7 +20,7 @@
 /* baud_bases for the common clocks in the Atari. These are the real
  * frequencies divided by 16.
  */
-   
+
 #define SCC_BAUD_BASE_TIMC	19200	/* 0.3072 MHz from TT-MFP, Timer C */
 #define SCC_BAUD_BASE_BCLK	153600	/* 2.4576 MHz */
 #define SCC_BAUD_BASE_PCLK4	229500	/* 3.6720 MHz */
diff --git a/include/asm-m68k/atari_acsi.h b/include/asm-m68k/atari_acsi.h
index 31a882fbf..10fea68f1 100644
--- a/include/asm-m68k/atari_acsi.h
+++ b/include/asm-m68k/atari_acsi.h
@@ -27,7 +27,7 @@ extern unsigned long phys_acsi_buffer;
 
 #define DMA_LONG_WRITE(data,mode)							\
     do {													\
-		*((unsigned long *)&dma_wd.fdc_acces_seccount) = 	\
+		*((unsigned long *)&dma_wd.fdc_acces_seccount) =	\
 			((data)<<16) | (mode);							\
 	} while(0)
 
diff --git a/include/asm-m68k/atarihw.h b/include/asm-m68k/atarihw.h
index ccd67aa8d..f28acd0fd 100644
--- a/include/asm-m68k/atarihw.h
+++ b/include/asm-m68k/atarihw.h
@@ -53,7 +53,7 @@ extern int atari_dont_touch_floppy_select;
 #define ATARI_SWITCH_OVSC_SND6	(ATARI_SWITCH_SND6 << ATARI_SWITCH_OVSC_SHIFT)
 #define ATARI_SWITCH_OVSC_SND7	(ATARI_SWITCH_SND7 << ATARI_SWITCH_OVSC_SHIFT)
 #define ATARI_SWITCH_OVSC_MASK	0xffff0000
-	
+
 /*
  * Define several Hardware-Chips for indication so that for the ATARI we do
  * no longer decide whether it is a Falcon or other machine . It's just
@@ -151,8 +151,8 @@ static inline void dma_cache_maintenance( unsigned long paddr,
 }
 
 
-/* 
-** Shifter  
+/*
+** Shifter
  */
 #define ST_LOW  0
 #define ST_MID  1
@@ -161,22 +161,22 @@ static inline void dma_cache_maintenance( unsigned long paddr,
 #define TT_MID  4
 #define TT_HIGH 6
 
-#define SHF_BAS (0xffff8200)    
-struct SHIFTER 
+#define SHF_BAS (0xffff8200)
+struct SHIFTER
  {
- 	u_char pad1;
+	u_char pad1;
 	u_char bas_hi;
 	u_char pad2;
 	u_char bas_md;
 	u_char pad3;
 	u_char volatile vcounthi;
- 	u_char pad4;
- 	u_char volatile vcountmid;
- 	u_char pad5;
- 	u_char volatile vcountlow;
- 	u_char volatile syncmode;
- 	u_char pad6;
- 	u_char pad7; 
+	u_char pad4;
+	u_char volatile vcountmid;
+	u_char pad5;
+	u_char volatile vcountlow;
+	u_char volatile syncmode;
+	u_char pad6;
+	u_char pad7;
 	u_char bas_lo;
  };
 # define shifter ((*(volatile struct SHIFTER *)SHF_BAS))
@@ -186,7 +186,7 @@ struct SHIFTER_F030
  {
   u_short off_next;
   u_short scn_width;
- };                             
+ };
 # define shifter_f030 ((*(volatile struct SHIFTER_F030 *)SHF_FBAS))
 
 
@@ -278,9 +278,9 @@ struct VIDEL {
 
 /*
 ** DMA/WD1772 Disk Controller
- */                          
- 
-#define FWD_BAS (0xffff8604)  
+ */
+
+#define FWD_BAS (0xffff8604)
 struct DMA_WD
  {
   u_short fdc_acces_seccount;
@@ -364,9 +364,9 @@ struct TT_5380 {
 #define	tt_scsi_regp	((volatile char *)TT_5380_BAS)
 
 
-/* 
+/*
 ** Falcon DMA Sound Subsystem
- */     
+ */
 
 #define MATRIX_BASE (0xffff8930)
 struct MATRIX
@@ -419,8 +419,8 @@ struct BLITTER
   u_short src_x_inc;
   u_short src_y_inc;
   u_long src_address;
-  u_short endmask1;  
-  u_short endmask2;  
+  u_short endmask1;
+  u_short endmask2;
   u_short endmask3;
   u_short dst_x_inc;
   u_short dst_y_inc;
@@ -430,7 +430,7 @@ struct BLITTER
   u_short hlf_op_reg;
   u_short log_op_reg;
   u_short lin_nm_reg;
-  u_short skew_reg;  
+  u_short skew_reg;
  };
 # define blitter ((*(volatile struct BLITTER *)BLT_BAS))
 
@@ -438,7 +438,7 @@ struct BLITTER
 /*
 ** SCC Z8530
  */
- 
+
 #define SCC_BAS (0xffff8c81)
 struct SCC
  {
@@ -462,7 +462,7 @@ struct SCC
 #define	tt_scc_dma	((*(volatile struct TT_DMA *)TT_SCC_DMA_BAS))
 
 /*
-** VIDEL Palette Register 
+** VIDEL Palette Register
  */
 
 #define FPL_BAS (0xffff9800)
@@ -487,7 +487,7 @@ struct DSP56K_HOST_INTERFACE {
 #define DSP56K_ICR_HM0	0x20
 #define DSP56K_ICR_HM1	0x40
 #define DSP56K_ICR_INIT	0x80
-  
+
   u_char cvr;
 #define DSP56K_CVR_HV_MASK 0x1f
 #define DSP56K_CVR_HC	0x80
@@ -500,7 +500,7 @@ struct DSP56K_HOST_INTERFACE {
 #define DSP56K_ISR_HF3	0x10
 #define DSP56K_ISR_DMA	0x40
 #define DSP56K_ISR_HREQ	0x80
-  
+
   u_char ivr;
 
   union {
@@ -510,11 +510,11 @@ struct DSP56K_HOST_INTERFACE {
   } data;
 };
 #define dsp56k_host_interface ((*(volatile struct DSP56K_HOST_INTERFACE *)DSP56K_HOST_INTERFACE_BASE))
- 
+
 /*
 ** MFP 68901
  */
- 
+
 #define MFP_BAS (0xfffffa01)
 struct MFP
  {
@@ -649,7 +649,7 @@ struct TT_RTC {
 #define ACIA_IRQ  (1<<7)	/* Interrupt Request */
 
 #define ACIA_BAS (0xfffffc00)
-struct ACIA 
+struct ACIA
  {
   u_char key_ctrl;
   u_char char_dummy1;
@@ -686,17 +686,17 @@ struct TT_DMASND {
 	u_char	pad11[12];
 	u_char	track_select;	/* Falcon */
 	u_char	mode;
- 	u_char	pad12[14];
- 	/* Falcon only: */
- 	u_short	cbar_src;
- 	u_short cbar_dst;
- 	u_char	ext_div;
- 	u_char	int_div;
- 	u_char	rec_track_select;
- 	u_char	dac_src;
- 	u_char	adc_src;
- 	u_char	input_gain;
- 	u_short	output_atten;
+	u_char	pad12[14];
+	/* Falcon only: */
+	u_short	cbar_src;
+	u_short cbar_dst;
+	u_char	ext_div;
+	u_char	int_div;
+	u_char	rec_track_select;
+	u_char	dac_src;
+	u_char	adc_src;
+	u_char	input_gain;
+	u_short	output_atten;
 };
 # define tt_dmasnd ((*(volatile struct TT_DMASND *)TT_DMASND_BAS))
 
@@ -721,7 +721,7 @@ struct TT_DMASND {
 #define	DMASND_MODE_12KHZ	  0x01
 #define	DMASND_MODE_25KHZ	  0x02
 #define	DMASND_MODE_50KHZ	  0x03
- 
+
 
 #define DMASNDSetBase(bufstart)						\
     do {								\
diff --git a/include/asm-m68k/atariints.h b/include/asm-m68k/atariints.h
index 95f21f5c4..42952c890 100644
--- a/include/asm-m68k/atariints.h
+++ b/include/asm-m68k/atariints.h
@@ -59,8 +59,8 @@
 /* ST-MFP interrupts */
 #define IRQ_MFP_BUSY      (8)
 #define IRQ_MFP_DCD       (9)
-#define IRQ_MFP_CTS  	  (10)
-#define IRQ_MFP_GPU 	  (11)
+#define IRQ_MFP_CTS	  (10)
+#define IRQ_MFP_GPU	  (11)
 #define IRQ_MFP_TIMD      (12)
 #define IRQ_MFP_TIMC	  (13)
 #define IRQ_MFP_ACIA	  (14)
@@ -81,7 +81,7 @@
 #define IRQ_TT_MFP_IO0       (24)
 #define IRQ_TT_MFP_IO1       (25)
 #define IRQ_TT_MFP_SCC	     (26)
-#define IRQ_TT_MFP_RI 	     (27)
+#define IRQ_TT_MFP_RI	     (27)
 #define IRQ_TT_MFP_TIMD      (28)
 #define IRQ_TT_MFP_TIMC	     (29)
 #define IRQ_TT_MFP_DRVRDY    (30)
@@ -122,7 +122,7 @@
 static inline int get_mfp_bit( unsigned irq, int type )
 
 {	unsigned char	mask, *reg;
-	
+
 	mask = 1 << (irq & 7);
 	reg = (unsigned char *)&mfp.int_en_a + type*4 +
 		  ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
@@ -132,7 +132,7 @@ static inline int get_mfp_bit( unsigned irq, int type )
 static inline void set_mfp_bit( unsigned irq, int type )
 
 {	unsigned char	mask, *reg;
-	
+
 	mask = 1 << (irq & 7);
 	reg = (unsigned char *)&mfp.int_en_a + type*4 +
 		  ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
@@ -143,7 +143,7 @@ static inline void set_mfp_bit( unsigned irq, int type )
 static inline void clear_mfp_bit( unsigned irq, int type )
 
 {	unsigned char	mask, *reg;
-	
+
 	mask = ~(1 << (irq & 7));
 	reg = (unsigned char *)&mfp.int_en_a + type*4 +
 		  ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index 898b0a4a1..ec1e32ecb 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -51,7 +51,7 @@ static inline int __generic_test_and_set_bit(int nr,
    __constant_set_bit(nr, vaddr) : \
    __generic_set_bit(nr, vaddr))
 
-#define __set_bit(nr,vaddr) set_bit(nr,vaddr) 
+#define __set_bit(nr,vaddr) set_bit(nr,vaddr)
 
 static inline void __constant_set_bit(int nr, volatile unsigned long *vaddr)
 {
diff --git a/include/asm-m68k/bootinfo.h b/include/asm-m68k/bootinfo.h
index 6b35b29dd..c1e968ceb 100644
--- a/include/asm-m68k/bootinfo.h
+++ b/include/asm-m68k/bootinfo.h
@@ -141,11 +141,11 @@ struct bi_record {
 #define BI_MAC_GMTBIAS		0x8008	/* Mac GMT timezone offset */
 #define BI_MAC_MEMSIZE		0x8009	/* Mac RAM size (sanity check) */
 #define BI_MAC_CPUID		0x800a	/* Mac CPU type (sanity check) */
-#define BI_MAC_ROMBASE		0x800b	/* Mac system ROM base address */ 
+#define BI_MAC_ROMBASE		0x800b	/* Mac system ROM base address */
 
     /*
-     *  Macintosh hardware profile data - unused, see macintosh.h for 
-     *  resonable type values 
+     *  Macintosh hardware profile data - unused, see macintosh.h for
+     *  resonable type values
      */
 
 #define BI_MAC_VIA1BASE		0x8010	/* Mac VIA1 base address (always present) */
@@ -176,7 +176,7 @@ struct bi_record {
 
 #ifndef __ASSEMBLY__
 
-struct mac_booter_data 
+struct mac_booter_data
 {
 	unsigned long videoaddr;
 	unsigned long videorow;
@@ -202,7 +202,7 @@ struct mac_booter_data
 	unsigned long timedbra;
 };
 
-extern struct mac_booter_data 
+extern struct mac_booter_data
 	mac_bi_data;
 
 #endif
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
index 4da086631..da8399855 100644
--- a/include/asm-m68k/cacheflush.h
+++ b/include/asm-m68k/cacheflush.h
@@ -45,7 +45,7 @@ extern void cache_push_v(unsigned long vaddr, int len);
 
 /* cache code */
 #define FLUSH_I_AND_D	(0x00000808)
-#define FLUSH_I 	(0x00000008)
+#define FLUSH_I		(0x00000008)
 
 /* This is needed whenever the virtual mapping of the current
    process changes.  */
@@ -95,14 +95,14 @@ static inline void flush_cache_range(struct vm_area_struct *vma,
 				     unsigned long start,
 				     unsigned long end)
 {
-	if (vma->vm_mm == current->mm) 
+	if (vma->vm_mm == current->mm)
 	        __flush_cache_030();
 }
 
 static inline void flush_cache_page(struct vm_area_struct *vma,
 				    unsigned long vmaddr)
 {
- 	if (vma->vm_mm == current->mm)
+	if (vma->vm_mm == current->mm)
 	        __flush_cache_030();
 }
 
@@ -128,6 +128,8 @@ static inline void __flush_page_to_ram(void *vaddr)
 }
 
 #define flush_dcache_page(page)		__flush_page_to_ram(page_address(page))
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_page(vma, page)	__flush_page_to_ram(page_address(page))
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
diff --git a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h
index d7ffda501..b3fdaa2cb 100644
--- a/include/asm-m68k/checksum.h
+++ b/include/asm-m68k/checksum.h
@@ -115,7 +115,7 @@ ip_compute_csum(unsigned char * buff, int len)
 #define _HAVE_ARCH_IPV6_CSUM
 static __inline__ unsigned short int
 csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
-		__u32 len, unsigned short proto, unsigned int sum) 
+		__u32 len, unsigned short proto, unsigned int sum)
 {
 	register unsigned long tmp;
 	__asm__("addl %2@,%0\n\t"
diff --git a/include/asm-m68k/delay.h b/include/asm-m68k/delay.h
index d5decf54f..5ed92851b 100644
--- a/include/asm-m68k/delay.h
+++ b/include/asm-m68k/delay.h
@@ -22,7 +22,7 @@ extern void __bad_udelay(void);
  * lookup table, really, as the multiplications take much too long with
  * short delays.  This is a "reasonable" implementation, though (and the
  * first constant multiplications gets optimized away if the delay is
- * a constant)  
+ * a constant)
  */
 static inline void __const_udelay(unsigned long xloops)
 {
diff --git a/include/asm-m68k/dvma.h b/include/asm-m68k/dvma.h
index 57e315c87..5978f87b0 100644
--- a/include/asm-m68k/dvma.h
+++ b/include/asm-m68k/dvma.h
@@ -2,7 +2,7 @@
  * include/asm-m68k/dma.h
  *
  * Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu)
- * 
+ *
  * Hacked to fit Sun3x needs by Thomas Bogendoerfer
  */
 
@@ -16,15 +16,15 @@
 #define DVMA_PAGE_MASK	(~(DVMA_PAGE_SIZE-1))
 #define DVMA_PAGE_ALIGN(addr)	(((addr)+DVMA_PAGE_SIZE-1)&DVMA_PAGE_MASK)
 
-extern void dvma_init(void);	
-extern int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, 
+extern void dvma_init(void);
+extern int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
 			  int len);
 
 #define dvma_malloc(x) dvma_malloc_align(x, 0)
 #define dvma_map(x, y) dvma_map_align(x, y, 0)
 #define dvma_map_vme(x, y) (dvma_map(x, y) & 0xfffff)
 #define dvma_map_align_vme(x, y, z) (dvma_map_align (x, y, z) & 0xfffff)
-extern unsigned long dvma_map_align(unsigned long kaddr, int len, 
+extern unsigned long dvma_map_align(unsigned long kaddr, int len,
 			    int align);
 extern void *dvma_malloc_align(unsigned long len, unsigned long align);
 
@@ -44,7 +44,7 @@ extern void dvma_free(void *vaddr);
 #define IOMMU_TOTAL_ENTRIES 128
 #define IOMMU_ENTRIES 120
 
-/* empirical kludge -- dvma regions only seem to work right on 0x10000 
+/* empirical kludge -- dvma regions only seem to work right on 0x10000
    byte boundaries */
 #define DVMA_REGION_SIZE 0x10000
 #define DVMA_ALIGN(addr) (((addr)+DVMA_REGION_SIZE-1) & \
@@ -84,7 +84,7 @@ extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len);
 
 
 
-/* everything below this line is specific to dma used for the onboard 
+/* everything below this line is specific to dma used for the onboard
    ESP scsi on sun3x */
 
 /* Structure to describe the current status of DMA registers on the Sparc */
diff --git a/include/asm-m68k/entry.h b/include/asm-m68k/entry.h
index 5222d5cc9..0396495cd 100644
--- a/include/asm-m68k/entry.h
+++ b/include/asm-m68k/entry.h
@@ -40,7 +40,7 @@
 	/* portable version */
 #define ALLOWINT	(~0x700)
 #define	MAX_NOINT_IPL	0
-#endif /* machine compilation types */ 
+#endif /* machine compilation types */
 
 #ifdef __ASSEMBLY__
 
diff --git a/include/asm-m68k/floppy.h b/include/asm-m68k/floppy.h
index a94c271ec..c6e708dd9 100644
--- a/include/asm-m68k/floppy.h
+++ b/include/asm-m68k/floppy.h
@@ -122,9 +122,9 @@ static int m68k_floppy_init(void)
 {
   use_virtual_dma =1;
   can_use_virtual_dma = 1;
- 
-  
-  if (MACH_IS_Q40)  
+
+
+  if (MACH_IS_Q40)
 	  return 0x3f0;
   else if(MACH_IS_SUN3X)
 	  return sun3xflop_init();
@@ -192,7 +192,7 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id,
 #undef TRACE_FLPY_INT
 #define NO_FLOPPY_ASSEMBLER
 
-#ifdef TRACE_FLPY_INT 
+#ifdef TRACE_FLPY_INT
 	static int calls=0;
 	static int bytes=0;
 	static int dma_wait=0;
@@ -214,10 +214,10 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id,
 		/* serve 1st byte fast: */
 
 		st=1;
-		for(lcount=virtual_dma_count, lptr=virtual_dma_addr; 
+		for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
 		    lcount; lcount--, lptr++) {
 			st=inb(virtual_dma_port+4) & 0xa0 ;
-			if(st != 0xa0) 
+			if(st != 0xa0)
 				break;
 			if(virtual_dma_mode)
 				outb_p(*lptr, virtual_dma_port+5);
@@ -239,7 +239,7 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id,
 		virtual_dma_residue += virtual_dma_count;
 		virtual_dma_count=0;
 #ifdef TRACE_FLPY_INT
-		printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", 
+		printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n",
 		       virtual_dma_count, virtual_dma_residue, calls, bytes,
 		       dma_wait);
 		calls = 0;
diff --git a/include/asm-m68k/hwtest.h b/include/asm-m68k/hwtest.h
index ec7f96a08..402c8a440 100644
--- a/include/asm-m68k/hwtest.h
+++ b/include/asm-m68k/hwtest.h
@@ -2,12 +2,12 @@
  * see arch/m68k/mm/hwtest.c.
  *  -- PMM <pmaydell@chiark.greenend.org.uk> 05/1998
  *
- * Removed __init from decls.  We might want them in modules, and 
+ * Removed __init from decls.  We might want them in modules, and
  * the code is tiny anyway.  16/5/98 pb
  */
 
 #ifndef __ASM_HWTEST_H
-#define __ASM_HWTEST_H 
+#define __ASM_HWTEST_H
 
 extern int hwreg_present(volatile void *regp);
 extern int hwreg_write(volatile void *regp, unsigned short val);
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index 063bb8408..36118fd01 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 1994-1996  Linus Torvalds & authors
  */
- 
+
 /* Copyright(c) 1996 Kars de Jong */
 /* Based on the ide driver from 1.2.13pl8 */
 
@@ -50,32 +50,6 @@
 #define MAX_HWIFS	4	/* same as the other archs */
 #endif
 
-
-static __inline__ int ide_default_irq(unsigned long base)
-{
-	  return 0;
-}
-
-static __inline__ unsigned long ide_default_io_base(int index)
-{
-          return 0;
-}
-
-
-/*
- * Set up a hw structure for a specified data port, control port and IRQ.
- * This should follow whatever the default interface uses.
- */
-static __inline__ void ide_init_hwif_ports(hw_regs_t *hw,
-					   unsigned long data_port,
-					   unsigned long ctrl_port, int *irq)
-{
-	if (data_port || ctrl_port)
-		printk("ide_init_hwif_ports: must not be called\n");
-}
-
-#define ide_init_default_irq(base)	(0)
-
 /*
  * Get rid of defs from io.h - ide has its private and conflicting versions
  * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
diff --git a/include/asm-m68k/intersil.h b/include/asm-m68k/intersil.h
index 8bbec04ac..f482902ca 100644
--- a/include/asm-m68k/intersil.h
+++ b/include/asm-m68k/intersil.h
@@ -17,7 +17,7 @@
 /* bit 4 */
 #define INTERSIL_INT_ENABLE     0x10
 #define INTERSIL_INT_DISABLE    0x00
-                
+
 /* bit 5 */
 #define INTERSIL_MODE_NORMAL     0x00
 #define INTERSIL_MODE_TEST       0x20
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index a50a4776b..aa6fffff2 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -1,5 +1,5 @@
 /*
- * linux/include/asm-m68k/io.h 
+ * linux/include/asm-m68k/io.h
  *
  * 4/1/00 RZ: - rewritten to avoid clashes between ISA/PCI and other
  *              IO access
@@ -62,7 +62,7 @@ extern unsigned long gg2_isa_base;
 
 #ifndef MULTI_ISA
 #define MULTI_ISA 0
-#else 
+#else
 #undef MULTI_ISA
 #define MULTI_ISA 1
 #endif
@@ -76,7 +76,7 @@ extern unsigned long gg2_isa_base;
 
 #ifndef MULTI_ISA
 #define MULTI_ISA 0
-#else 
+#else
 #undef MULTI_ISA
 #define MULTI_ISA 1
 #endif
@@ -101,7 +101,7 @@ extern unsigned long gg2_isa_base;
 #if defined(CONFIG_AMIGA_PCMCIA) && !defined(MULTI_ISA)
 #define ISA_TYPE AG_ISA
 #define ISA_SEX  1
-#endif 
+#endif
 #if defined(CONFIG_GG2) && !defined(MULTI_ISA)
 #define ISA_TYPE GG2_ISA
 #define ISA_SEX  0
@@ -229,7 +229,7 @@ static inline void isa_delay(void)
 #endif  /* CONFIG_ISA */
 
 
-#if defined(CONFIG_ISA) && !defined(CONFIG_PCI) 
+#if defined(CONFIG_ISA) && !defined(CONFIG_PCI)
 #define inb     isa_inb
 #define inb_p   isa_inb_p
 #define outb    isa_outb
@@ -273,8 +273,8 @@ static inline void isa_delay(void)
 
 #else
 /*
- * kernel with both ISA and PCI compiled in, those have 
- * conflicting defs for in/out. Simply consider port < 1024 
+ * kernel with both ISA and PCI compiled in, those have
+ * conflicting defs for in/out. Simply consider port < 1024
  * ISA and everything else PCI. read,write not defined
  * in this case
  */
diff --git a/include/asm-m68k/ipc.h b/include/asm-m68k/ipc.h
index 96441c86c..19e9cbe3f 100644
--- a/include/asm-m68k/ipc.h
+++ b/include/asm-m68k/ipc.h
@@ -1,7 +1,7 @@
 #ifndef __m68k_IPC_H__
 #define __m68k_IPC_H__
 
-/* 
+/*
  * These are used to wrap system calls on m68k.
  *
  * See arch/m68k/kernel/sys_m68k.c for ugly details..
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
index 5889bc919..1f569905c 100644
--- a/include/asm-m68k/irq.h
+++ b/include/asm-m68k/irq.h
@@ -64,7 +64,7 @@ static __inline__ int irq_canonicalize(int irq)
  * All interrupt handling is actually machine specific so it is better
  * to use function pointers, as used by the Sparc port, and select the
  * interrupt handling functions when initializing the kernel. This way
- * we save some unnecessary overhead at run-time. 
+ * we save some unnecessary overhead at run-time.
  *                                                      01/11/97 - Jes
  */
 
diff --git a/include/asm-m68k/mac_asc.h b/include/asm-m68k/mac_asc.h
index a36aa5a27..fc2e5467b 100644
--- a/include/asm-m68k/mac_asc.h
+++ b/include/asm-m68k/mac_asc.h
@@ -1,14 +1,14 @@
 /*
- *	Apple Sound Chip 
+ *	Apple Sound Chip
  */
- 
+
 #ifndef __ASM_MAC_ASC_H
 #define __ASM_MAC_ASC_H
 
 /*
  *	ASC offsets and controls
  */
- 
+
 #define ASC_BUF_BASE	0x00	/* RAM buffer offset */
 #define ASC_BUF_SIZE	0x800
 
@@ -23,5 +23,5 @@
 #define ASC_VOLUME	0x806
 #define ASC_CHAN	0x807	/* ??? */
 
- 
+
 #endif
diff --git a/include/asm-m68k/mac_oss.h b/include/asm-m68k/mac_oss.h
index c48d8b840..7644a639c 100644
--- a/include/asm-m68k/mac_oss.h
+++ b/include/asm-m68k/mac_oss.h
@@ -3,7 +3,7 @@
  *
  *	This is used in place of VIA2 on the IIfx.
  */
- 
+
 #define OSS_BASE	(0x50f1a000)
 
 /*
diff --git a/include/asm-m68k/mac_psc.h b/include/asm-m68k/mac_psc.h
index 9d8f2b55a..7808bb0b2 100644
--- a/include/asm-m68k/mac_psc.h
+++ b/include/asm-m68k/mac_psc.h
@@ -23,7 +23,7 @@
  * continuously, although how you keep the buffer filled in this scenario is
  * not understood as there seems to be only one input and one output buffer
  * pointer.
- * 
+ *
  * Much of this was extrapolated from what was known about the Ethernet
  * registers and subsequently confirmed using MacsBug (ie by pinging the
  * machine with easy-to-find patterns and looking for them in the DMA
@@ -43,7 +43,7 @@
  * To access a particular set of registers, add 0xn0 to the base
  * where n = 3,4,5 or 6.
  */
- 
+
 #define pIFRbase	0x100
 #define pIERbase	0x104
 
@@ -76,9 +76,9 @@
 #define PSC_SET0	0x00
 #define PSC_SET1	0x10
 
-#define PSC_SCSI_ADDR	0x1000 	/* confirmed */
-#define PSC_SCSI_LEN	0x1004 	/* confirmed */
-#define PSC_SCSI_CMD	0x1008 	/* confirmed */
+#define PSC_SCSI_ADDR	0x1000	/* confirmed */
+#define PSC_SCSI_LEN	0x1004	/* confirmed */
+#define PSC_SCSI_CMD	0x1008	/* confirmed */
 #define PSC_ENETRD_ADDR 0x1020	/* confirmed */
 #define PSC_ENETRD_LEN  0x1024	/* confirmed */
 #define PSC_ENETRD_CMD  0x1028	/* confirmed */
@@ -214,7 +214,7 @@ extern int psc_present;
 /*
  *	Access functions
  */
- 
+
 static inline void psc_write_byte(int offset, __u8 data)
 {
 	*((volatile __u8 *)(psc + offset)) = data;
diff --git a/include/asm-m68k/mac_via.h b/include/asm-m68k/mac_via.h
index 751d11fa5..59b758cd1 100644
--- a/include/asm-m68k/mac_via.h
+++ b/include/asm-m68k/mac_via.h
@@ -5,7 +5,7 @@
  *	via them as are assorted bits and bobs - eg rtc, adb. The picture
  *	is a bit incomplete as the Mac documentation doesn't cover this well
  */
- 
+
 #ifndef _ASM_MAC_VIA_H_
 #define _ASM_MAC_VIA_H_
 
@@ -21,7 +21,7 @@
 #define VIA1_BASE	(0x50F00000)
 #define VIA2_BASE	(0x50F02000)
 #define  RBV_BASE	(0x50F26000)
- 
+
 /*
  *	Not all of these are true post MacII I think.
  *      CSA: probably the ones CHRP marks as 'unused' change purposes
@@ -34,9 +34,9 @@
  * VIA1A_vSccWrReq not available and that VIA1A_vSync has moved to an IOP.
  * Also, "All of the functionality of VIA2 has been moved to other chips".
  */
- 
+
 #define VIA1A_vSccWrReq	0x80	/* SCC write. (input)
-				 * [CHRP] SCC WREQ: Reflects the state of the 
+				 * [CHRP] SCC WREQ: Reflects the state of the
 				 * Wait/Request pins from the SCC.
 				 * [Macintosh Family Hardware]
 				 * as CHRP on SE/30,II,IIx,IIcx,IIci.
@@ -93,7 +93,7 @@
 #define VIA1A_CPUID1	0x04	/* CPU id bit 0 on RBV, others */
 #define VIA1A_CPUID2	0x10	/* CPU id bit 0 on RBV, others */
 #define VIA1A_CPUID3	0x40	/* CPU id bit 0 on RBV, others */
- 	
+
 /* Info on VIA1B is from Macintosh Family Hardware & MkLinux.
  * CHRP offers no info. */
 #define VIA1B_vSound	0x80	/* Sound enable (for compatibility with
@@ -123,7 +123,7 @@
 #define	EVRB_SFTWRID	0x80	/* Software Interrupt ReQuest */
 
 /*
- *	VIA2 A register is the interrupt lines raised off the nubus 
+ *	VIA2 A register is the interrupt lines raised off the nubus
  *	slots.
  *      The below info is from 'Macintosh Family Hardware.'
  *      MkLinux calls the 'IIci internal video IRQ' below the 'RBV slot 0 irq.'
@@ -131,7 +131,7 @@
  *      defines the 'Video IRQ' as 0x40 for the 'EVR' VIA work-alike.
  *      Perhaps OSS uses vRAM1 and vRAM2 for ADB.
  */
- 
+
 #define VIA2A_vRAM1	0x80	/* RAM size bit 1 (IIci: reserved) */
 #define VIA2A_vRAM0	0x40	/* RAM size bit 0 (IIci: internal video IRQ) */
 #define VIA2A_vIRQE	0x20	/* IRQ from slot $E */
@@ -148,11 +148,11 @@
  *  1    0    4 Mbit
  *  1    1   16 Mbit
  */
- 
+
 /*
  *	Register B has the fun stuff in it
  */
- 
+
 #define VIA2B_vVBL	0x80	/* VBL output to VIA1 (60.15Hz) driven by
 				 * timer T1.
 				 * on IIci, parity test: 0=test mode.
@@ -184,11 +184,11 @@
  * right bit in the VIA chip (6522 Versatile Interface Adapter).
  * [CSA: don't know which one this is, but it's one of 'em!]
  */
- 
+
 /*
  *	6522 registers - see databook.
  * CSA: Assignments for VIA1 confirmed from CHRP spec.
- */ 
+ */
 
 /* partial address decode.  0xYYXX : XX part for RBV, YY part for VIA */
 /* Note: 15 VIA regs, 8 RBV regs */
@@ -217,7 +217,7 @@
  * decode the bottom eight -- so vBufB | rBufB will always get you BufB */
 /* CSA: in fact, only bits 0,1, and 4 seem to be decoded.
  * BUT note the values for rIER and rIFR, where the top 8 bits *do* seem
- * to matter.  In fact *all* of the top 8 bits seem to matter; 
+ * to matter.  In fact *all* of the top 8 bits seem to matter;
  * setting rIER=0x1813 and rIFR=0x1803 doesn't work, either.
  * Perhaps some sort of 'compatibility mode' is built-in? [21-May-1999]
  */
diff --git a/include/asm-m68k/machw.h b/include/asm-m68k/machw.h
index 120195037..d2e0e25d5 100644
--- a/include/asm-m68k/machw.h
+++ b/include/asm-m68k/machw.h
@@ -51,7 +51,7 @@ struct MAC_5380 {
 /*
 ** SCC Z8530
 */
- 
+
 #define MAC_SCC_BAS (0x50F04000)
 struct MAC_SCC
  {
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h
index ab762b103..6fc3d1951 100644
--- a/include/asm-m68k/macintosh.h
+++ b/include/asm-m68k/macintosh.h
@@ -7,11 +7,11 @@
 /*
  *	Apple Macintoshisms
  */
- 
+
 extern void mac_reset(void);
 extern void mac_poweroff(void);
 extern void mac_init_IRQ(void);
-extern int mac_request_irq (unsigned int, irqreturn_t (*)(int, void *, 
+extern int mac_request_irq (unsigned int, irqreturn_t (*)(int, void *,
 				struct pt_regs *),
 				unsigned long, const char *, void *);
 extern void mac_free_irq(unsigned int, void *);
@@ -30,7 +30,7 @@ extern void mac_boom(int);
 /*
  *	Floppy driver magic hook - probably shouldnt be here
  */
- 
+
 extern void via1_set_head(int);
 
 extern void parse_booter(char *ptr);
@@ -39,7 +39,7 @@ extern void print_booter(char *ptr);
 /*
  *	Macintosh Table
  */
- 
+
 struct mac_model
 {
 	short ident;
@@ -81,7 +81,7 @@ struct mac_model
 #define MAC_SCC_QUADRA		3
 #define MAC_SCC_PSC		4
 
-#define MAC_ETHER_NONE		0	
+#define MAC_ETHER_NONE		0
 #define MAC_ETHER_SONIC		1
 #define MAC_ETHER_MACE		2
 
@@ -91,7 +91,7 @@ struct mac_model
 /*
  *	Gestalt numbers
  */
- 
+
 #define MAC_MODEL_II		6
 #define MAC_MODEL_IIX		7
 #define MAC_MODEL_IICX		8
@@ -113,7 +113,7 @@ struct mac_model
 #define MAC_MODEL_PB180		33
 #define MAC_MODEL_PB160		34
 #define MAC_MODEL_Q800		35	/* aka: WGS80 */
-#define MAC_MODEL_Q650		36 
+#define MAC_MODEL_Q650		36
 #define MAC_MODEL_LCII		37	/* aka: P400/405/410/430 */
 #define MAC_MODEL_PB250		38
 #define MAC_MODEL_IIVI		44
@@ -148,5 +148,5 @@ struct mac_model
 #define MAC_MODEL_PB150		115
 
 extern struct mac_model *macintosh_config;
- 
+
 #endif
diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h
index f60ffdc8b..fd8c3a9fe 100644
--- a/include/asm-m68k/macints.h
+++ b/include/asm-m68k/macints.h
@@ -52,7 +52,7 @@
 
 #define NUM_MAC_SOURCES		72
 
-/* 
+/*
  * clean way to separate IRQ into its source and index
  */
 
@@ -74,7 +74,7 @@
 #define IRQ_VIA1_0	  (8)		/* one second int. */
 #define IRQ_VIA1_1        (9)		/* VBlank int. */
 #define IRQ_MAC_VBL	  IRQ_VIA1_1
-#define IRQ_VIA1_2 	  (10)		/* ADB SR shifts complete */
+#define IRQ_VIA1_2	  (10)		/* ADB SR shifts complete */
 #define IRQ_MAC_ADB	  IRQ_VIA1_2
 #define IRQ_MAC_ADB_SR	  IRQ_VIA1_2
 #define IRQ_VIA1_3	  (11)		/* ADB SR CB2 ?? */
@@ -92,7 +92,7 @@
 #define IRQ_MAC_SCSIDRQ	  IRQ_VIA2_0
 #define IRQ_VIA2_1        (17)
 #define IRQ_MAC_NUBUS	  IRQ_VIA2_1
-#define IRQ_VIA2_2 	  (18)
+#define IRQ_VIA2_2	  (18)
 #define IRQ_VIA2_3	  (19)
 #define IRQ_MAC_SCSI	  IRQ_VIA2_3
 #define IRQ_VIA2_4        (20)
@@ -108,7 +108,7 @@
 #define IRQ_PSC3_3	  (27)
 
 /* Level 4 (SCC) interrupts */
-#define IRQ_SCC 	     (32)
+#define IRQ_SCC		     (32)
 #define IRQ_SCCA	     (33)
 #define IRQ_SCCB	     (34)
 #if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
diff --git a/include/asm-m68k/md.h b/include/asm-m68k/md.h
index 1d15aae21..467ea0838 100644
--- a/include/asm-m68k/md.h
+++ b/include/asm-m68k/md.h
@@ -1,8 +1,8 @@
 /* $Id: md.h,v 1.1 1997/12/15 15:12:04 jj Exp $
- * md.h: High speed xor_block operation for RAID4/5 
+ * md.h: High speed xor_block operation for RAID4/5
  *
  */
- 
+
 #ifndef __ASM_MD_H
 #define __ASM_MD_H
 
diff --git a/include/asm-m68k/mmu_context.h b/include/asm-m68k/mmu_context.h
index 5f9d3069a..661191d15 100644
--- a/include/asm-m68k/mmu_context.h
+++ b/include/asm-m68k/mmu_context.h
@@ -124,7 +124,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
 		mm->context = get_free_context(mm);
 }
 
-/* flush context if allocated... */	
+/* flush context if allocated... */
 static inline void destroy_context(struct mm_struct *mm)
 {
 	if(mm->context != SUN3_INVALID_CONTEXT)
@@ -150,5 +150,5 @@ static inline void activate_mm(struct mm_struct *prev_mm,
 	activate_context(next_mm);
 }
 
-#endif 
+#endif
 #endif
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
index dbec2c97a..f9391dfbb 100644
--- a/include/asm-m68k/motorola_pgtable.h
+++ b/include/asm-m68k/motorola_pgtable.h
@@ -217,7 +217,7 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
 	return (pmd_t *)__pgd_page(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PMD-1));
 }
 
-/* Find an entry in the third-level page table.. */ 
+/* Find an entry in the third-level page table.. */
 static inline pte_t *pte_offset_kernel(pmd_t *pmdp, unsigned long address)
 {
 	return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
diff --git a/include/asm-m68k/msgbuf.h b/include/asm-m68k/msgbuf.h
index 9ce71a86d..243cb798d 100644
--- a/include/asm-m68k/msgbuf.h
+++ b/include/asm-m68k/msgbuf.h
@@ -1,7 +1,7 @@
 #ifndef _M68K_MSGBUF_H
 #define _M68K_MSGBUF_H
 
-/* 
+/*
  * The msqid64_ds structure for m68k architecture.
  * Note extra padding because this structure is passed back and forth
  * between kernel and user space.
diff --git a/include/asm-m68k/mvme147hw.h b/include/asm-m68k/mvme147hw.h
index 195a50893..f245139f3 100644
--- a/include/asm-m68k/mvme147hw.h
+++ b/include/asm-m68k/mvme147hw.h
@@ -21,7 +21,7 @@ typedef struct {
 
 
 struct pcc_regs {
-   volatile u_long 	dma_tadr;
+   volatile u_long	dma_tadr;
    volatile u_long	dma_dadr;
    volatile u_long	dma_bcr;
    volatile u_long	dma_hr;
diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h
index 4102460fb..5d07231d2 100644
--- a/include/asm-m68k/mvme16xhw.h
+++ b/include/asm-m68k/mvme16xhw.h
@@ -65,7 +65,7 @@ typedef struct {
 #define MVME_SCC_PCLK	10000000
 
 #define MVME162_IRQ_TYPE_PRIO	0
-                
+
 #define MVME167_IRQ_PRN		0x54
 #define MVME16x_IRQ_I596	0x57
 #define MVME16x_IRQ_SCSI	0x55
diff --git a/include/asm-m68k/openprom.h b/include/asm-m68k/openprom.h
index 22488977d..efbfb0bec 100644
--- a/include/asm-m68k/openprom.h
+++ b/include/asm-m68k/openprom.h
@@ -91,92 +91,92 @@ struct linux_bootargs_v2 {
 
 #if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
 struct linux_romvec {
-	char		*pv_initsp;		
+	char		*pv_initsp;
 	int		(*pv_startmon)(void);
 
-	int		*diagberr;		
+	int		*diagberr;
 
 	struct linux_arguments_v0 **pv_v0bootargs;
- 	unsigned	*pv_sun3mem;		
+	unsigned	*pv_sun3mem;
 
 	unsigned char	(*pv_getchar)(void);
 	int		(*pv_putchar)(int ch);
-	int		(*pv_nbgetchar)(void);	
+	int		(*pv_nbgetchar)(void);
 	int		(*pv_nbputchar)(int ch);
-	unsigned char	*pv_echo;	
+	unsigned char	*pv_echo;
 	unsigned char	*pv_insource;
 	unsigned char	*pv_outsink;
 
-	int		(*pv_getkey)(void);		
+	int		(*pv_getkey)(void);
 	int		(*pv_initgetkey)(void);
 	unsigned int	*pv_translation;
-	unsigned char	*pv_keybid;		
-	int		*pv_screen_x;		
-	int		*pv_screen_y;		
-	struct keybuf	*pv_keybuf;		
+	unsigned char	*pv_keybid;
+	int		*pv_screen_x;
+	int		*pv_screen_y;
+	struct keybuf	*pv_keybuf;
 
 	char		*pv_monid;
 
-	/* 
-	 * Frame buffer output and terminal emulation 
+	/*
+	 * Frame buffer output and terminal emulation
 	 */
 
-	int		(*pv_fbwritechar)(char);	
-	int		*pv_fbaddr;		
-	char		**pv_font;		
-	int		(*pv_fbwritestr)(char);	
+	int		(*pv_fbwritechar)(char);
+	int		*pv_fbaddr;
+	char		**pv_font;
+	int		(*pv_fbwritestr)(char);
 
 	void		(*pv_reboot)(char *bootstr);
 
-	/* 
-	 * Line input and parsing 
+	/*
+	 * Line input and parsing
 	 */
 
-	unsigned char	*pv_linebuf;		
-	unsigned char	**pv_lineptr;		
-	int		*pv_linesize;		
-	int		(*pv_getline)(void);	
-	unsigned char	(*pv_getnextchar)(void);	
-	unsigned char	(*pv_peeknextchar)(void);	
-	int		*pv_fbthere;		
-	int		(*pv_getnum)(void);		
+	unsigned char	*pv_linebuf;
+	unsigned char	**pv_lineptr;
+	int		*pv_linesize;
+	int		(*pv_getline)(void);
+	unsigned char	(*pv_getnextchar)(void);
+	unsigned char	(*pv_peeknextchar)(void);
+	int		*pv_fbthere;
+	int		(*pv_getnum)(void);
 
 	void		(*pv_printf)(const char *fmt, ...);
 	int		(*pv_printhex)(void);
 
-	unsigned char	*pv_leds;		
-	int		(*pv_setleds)(void);	
+	unsigned char	*pv_leds;
+	int		(*pv_setleds)(void);
 
-	/* 
+	/*
 	 * Non-maskable interrupt  (nmi) information
-	 */ 
+	 */
 
 	int		(*pv_nmiaddr)(void);
 	int		(*pv_abortentry)(void);
-	int		*pv_nmiclock;		
+	int		*pv_nmiclock;
 
 	int		*pv_fbtype;
 
-	/* 
-	 * Assorted other things 
+	/*
+	 * Assorted other things
 	 */
 
 	unsigned	pv_romvers;
-	struct globram  *pv_globram;		
-	char		*pv_kbdzscc;		
-
-	int		*pv_keyrinit;		
-	unsigned char	*pv_keyrtick; 		
-	unsigned	*pv_memoryavail;	
-	long		*pv_resetaddr;		
-	long		*pv_resetmap;		
-						
-	void		(*pv_halt)(void);	
-	unsigned char	*pv_memorybitmap;	
+	struct globram  *pv_globram;
+	char		*pv_kbdzscc;
+
+	int		*pv_keyrinit;
+	unsigned char	*pv_keyrtick;
+	unsigned	*pv_memoryavail;
+	long		*pv_resetaddr;
+	long		*pv_resetmap;
+
+	void		(*pv_halt)(void);
+	unsigned char	*pv_memorybitmap;
 
 #ifdef CONFIG_SUN3
 	void		(*pv_setctxt)(int ctxt, char *va, int pmeg);
-	void		(*pv_vector_cmd)(void);	
+	void		(*pv_vector_cmd)(void);
 	int		dummy1z;
 	int		dummy2z;
 	int		dummy3z;
diff --git a/include/asm-m68k/oplib.h b/include/asm-m68k/oplib.h
index 84248e0eb..c3594f473 100644
--- a/include/asm-m68k/oplib.h
+++ b/include/asm-m68k/oplib.h
@@ -244,7 +244,7 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize);
 /* Does the passed node have the given "name"? YES=1 NO=0 */
 extern int prom_nodematch(int thisnode, char *name);
 
-/* Puts in buffer a prom name in the form name@x,y or name (x for which_io 
+/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
  * and y for first regs phys address
  */
 extern int prom_getname(int node, char *buf, int buflen);
@@ -272,7 +272,7 @@ extern int prom_node_has_property(int node, char *property);
  */
 extern int prom_setprop(int node, char *prop_name, char *prop_value,
 			int value_size);
-			
+
 extern int prom_pathtoinode(char *path);
 extern int prom_inst2pkg(int);
 
@@ -290,8 +290,8 @@ extern void prom_adjust_ranges(struct linux_prom_ranges *cranges, int ncranges,
 extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs);
 
 /* Apply ranges of any prom node (and optionally parent node as well) to registers. */
-extern void prom_apply_generic_ranges(int node, int parent, 
+extern void prom_apply_generic_ranges(int node, int parent,
 				      struct linux_prom_registers *sbusregs, int nregs);
-				   
+
 
 #endif /* !(__SPARC_OPLIB_H) */
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 98ef1900f..6b7d6a040 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -25,9 +25,9 @@
 #else
 #define THREAD_SIZE PAGE_SIZE
 #endif
- 
+
 #ifndef __ASSEMBLY__
- 
+
 #define get_user_page(vaddr)		__get_free_page(GFP_KERNEL)
 #define free_user_page(page, addr)	free_page(addr)
 
@@ -80,7 +80,7 @@ static inline void clear_page(void *page)
 #endif
 
 #define clear_user_page(addr, vaddr, page)	\
-	do { 	clear_page(addr);		\
+	do {	clear_page(addr);		\
 		flush_dcache_page(page);	\
 	} while (0)
 #define copy_user_page(to, from, vaddr, page)	\
diff --git a/include/asm-m68k/page_offset.h b/include/asm-m68k/page_offset.h
index 39e30499c..86d3c2845 100644
--- a/include/asm-m68k/page_offset.h
+++ b/include/asm-m68k/page_offset.h
@@ -4,6 +4,6 @@
 #ifndef CONFIG_SUN3
 #define PAGE_OFFSET_RAW		0x00000000
 #else
-#define PAGE_OFFSET_RAW		0x0E000000 
+#define PAGE_OFFSET_RAW		0x0E000000
 #endif
 
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index ee99ac915..e939f8e04 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -168,8 +168,6 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
 	    ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S))	\
 	    : (prot)))
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 /*
diff --git a/include/asm-m68k/q40_master.h b/include/asm-m68k/q40_master.h
index 9bce91505..3907a09d4 100644
--- a/include/asm-m68k/q40_master.h
+++ b/include/asm-m68k/q40_master.h
@@ -1,5 +1,5 @@
-/* 
- * Q40 master Chip Control 
+/*
+ * Q40 master Chip Control
  * RTC stuff merged for compactnes..
 */
 
diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h
index ac6785ff1..041f0a87b 100644
--- a/include/asm-m68k/raw_io.h
+++ b/include/asm-m68k/raw_io.h
@@ -1,5 +1,5 @@
 /*
- * linux/include/asm-m68k/raw_io.h 
+ * linux/include/asm-m68k/raw_io.h
  *
  * 10/20/00 RZ: - created from bits of io.h and ide.h to cleanup namespace
  *
diff --git a/include/asm-m68k/rtc.h b/include/asm-m68k/rtc.h
index 2de18f80a..71406fc4e 100644
--- a/include/asm-m68k/rtc.h
+++ b/include/asm-m68k/rtc.h
@@ -51,7 +51,7 @@ static inline unsigned int get_rtc_ss(void)
 		return mach_get_ss();
 	else{
 		struct rtc_time h;
-		
+
 		get_rtc_time(&h);
 		return h.tm_sec;
 	}
diff --git a/include/asm-m68k/sembuf.h b/include/asm-m68k/sembuf.h
index e2af7d471..2308052a8 100644
--- a/include/asm-m68k/sembuf.h
+++ b/include/asm-m68k/sembuf.h
@@ -1,7 +1,7 @@
 #ifndef _M68K_SEMBUF_H
 #define _M68K_SEMBUF_H
 
-/* 
+/*
  * The semid64_ds structure for m68k architecture.
  * Note extra padding because this structure is passed back and forth
  * between kernel and user space.
diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h
index 97f16d6e4..9f5bcdc10 100644
--- a/include/asm-m68k/serial.h
+++ b/include/asm-m68k/serial.h
@@ -2,7 +2,7 @@
  * include/asm-m68k/serial.h
  *
  * currently this seems useful only for a Q40,
- * it's an almost exact copy of ../asm-alpha/serial.h 
+ * it's an almost exact copy of ../asm-alpha/serial.h
  *
  */
 
@@ -31,7 +31,7 @@
 #define ACCENT_FLAGS 0
 #define BOCA_FLAGS 0
 #endif
-	
+
 #define STD_SERIAL_PORT_DEFNS			\
 	/* UART CLK   PORT IRQ     FLAGS        */			\
 	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
@@ -42,7 +42,7 @@
 
 #ifdef CONFIG_SERIAL_MANY_PORTS
 #define EXTRA_SERIAL_PORT_DEFNS			\
-	{ 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, 	/* ttyS4 */	\
+	{ 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS },	/* ttyS4 */	\
 	{ 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS },	/* ttyS5 */	\
 	{ 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS },	/* ttyS6 */	\
 	{ 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS },	/* ttyS7 */	\
diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h
index 6d198bc5f..47b4627ef 100644
--- a/include/asm-m68k/setup.h
+++ b/include/asm-m68k/setup.h
@@ -248,7 +248,7 @@ extern unsigned long m68k_fputype;
 extern unsigned long m68k_mmutype;		/* Not really used yet */
 #ifdef CONFIG_VME
 extern unsigned long vme_brdtype;
-#endif 
+#endif
 
     /*
      *  m68k_is040or060 is != 0 for a '040 or higher;
diff --git a/include/asm-m68k/shmbuf.h b/include/asm-m68k/shmbuf.h
index 358ecbfb9..f8928d62f 100644
--- a/include/asm-m68k/shmbuf.h
+++ b/include/asm-m68k/shmbuf.h
@@ -1,7 +1,7 @@
 #ifndef _M68K_SHMBUF_H
 #define _M68K_SHMBUF_H
 
-/* 
+/*
  * The shmid64_ds structure for m68k architecture.
  * Note extra padding because this structure is passed back and forth
  * between kernel and user space.
diff --git a/include/asm-m68k/sigcontext.h b/include/asm-m68k/sigcontext.h
index a2d28c218..64fbe34cf 100644
--- a/include/asm-m68k/sigcontext.h
+++ b/include/asm-m68k/sigcontext.h
@@ -2,7 +2,7 @@
 #define _ASM_M68k_SIGCONTEXT_H
 
 struct sigcontext {
-	unsigned long  sc_mask; 	/* old sigmask */
+	unsigned long  sc_mask;		/* old sigmask */
 	unsigned long  sc_usp;		/* old user stack pointer */
 	unsigned long  sc_d0;
 	unsigned long  sc_d1;
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
index b69104c7d..5f8fd9359 100644
--- a/include/asm-m68k/signal.h
+++ b/include/asm-m68k/signal.h
@@ -96,7 +96,7 @@ typedef unsigned long sigset_t;
 #define SA_ONESHOT	SA_RESETHAND
 #define SA_INTERRUPT	0x20000000 /* dummy -- ignored */
 
-/* 
+/*
  * sigaltstack controls
  */
 #define SS_ONSTACK	1
diff --git a/include/asm-m68k/sockios.h b/include/asm-m68k/sockios.h
index 85ace3da5..9b9ed973c 100644
--- a/include/asm-m68k/sockios.h
+++ b/include/asm-m68k/sockios.h
@@ -2,7 +2,7 @@
 #define __ARCH_M68K_SOCKIOS__
 
 /* Socket-level I/O control calls. */
-#define FIOSETOWN 	0x8901
+#define FIOSETOWN	0x8901
 #define SIOCSPGRP	0x8902
 #define FIOGETOWN	0x8903
 #define SIOCGPGRP	0x8904
diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h
index 0f2d0b595..7ea5dc8e7 100644
--- a/include/asm-m68k/string.h
+++ b/include/asm-m68k/string.h
@@ -73,7 +73,7 @@ static inline char * strncat(char *dest, const char *src, size_t count)
 static inline char * strchr(const char * s, int c)
 {
   const char ch = c;
-  
+
   for(; *s != ch; ++s)
     if (*s == '\0')
       return( NULL );
@@ -85,7 +85,7 @@ static inline char * strchr(const char * s, int c)
 static inline char *strpbrk(const char *cs,const char *ct)
 {
   const char *sc1,*sc2;
-  
+
   for( sc1 = cs; *sc1 != '\0'; ++sc1)
     for( sc2 = ct; *sc2 != '\0'; ++sc2)
       if (*sc1 == *sc2)
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h
index 3b7f6cc2d..d00e10ff6 100644
--- a/include/asm-m68k/sun3_pgalloc.h
+++ b/include/asm-m68k/sun3_pgalloc.h
@@ -1,5 +1,5 @@
 /* sun3_pgalloc.h --
- * reorganization around 2.3.39, routines moved from sun3_pgtable.h 
+ * reorganization around 2.3.39, routines moved from sun3_pgtable.h
  *
  *
  * 02/27/2002 -- Modified to support "highpte" implementation in 2.5.5 (Sam)
@@ -36,26 +36,26 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *page)
 	tlb_remove_page(tlb, page);
 }
 
-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 
+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 					  unsigned long address)
 {
 	unsigned long page = __get_free_page(GFP_KERNEL|__GFP_REPEAT);
 
 	if (!page)
 		return NULL;
-		
+
 	memset((void *)page, 0, PAGE_SIZE);
 	return (pte_t *) (page);
 }
 
-static inline struct page *pte_alloc_one(struct mm_struct *mm, 
+static inline struct page *pte_alloc_one(struct mm_struct *mm,
 					 unsigned long address)
 {
         struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
 
 	if (page == NULL)
 		return NULL;
-		
+
 	clear_highpage(page);
 	return page;
 
diff --git a/include/asm-m68k/sun3mmu.h b/include/asm-m68k/sun3mmu.h
index 4867b696a..6c8c17d04 100644
--- a/include/asm-m68k/sun3mmu.h
+++ b/include/asm-m68k/sun3mmu.h
@@ -144,7 +144,7 @@ static inline unsigned char sun3_get_context(void)
 	SET_SFC(FC_CONTROL);
 	GET_CONTROL_BYTE(AC_CONTEXT, c);
 	SET_SFC(sfc);
-	
+
 	return c;
 }
 
@@ -156,7 +156,7 @@ static inline void sun3_put_context(unsigned char c)
 	SET_DFC(FC_CONTROL);
 	SET_CONTROL_BYTE(AC_CONTEXT, c);
 	SET_DFC(dfc);
-	
+
 	return;
 }
 
diff --git a/include/asm-m68k/sun3x.h b/include/asm-m68k/sun3x.h
index 354f2273e..f5691a1ed 100644
--- a/include/asm-m68k/sun3x.h
+++ b/include/asm-m68k/sun3x.h
@@ -20,7 +20,7 @@
 #define SUN3X_FDC_FVR     0x6e000800
 
 /* some NVRAM addresses */
-#define SUN3X_EEPROM_CONS 	(SUN3X_EEPROM + 0x1f)
+#define SUN3X_EEPROM_CONS	(SUN3X_EEPROM + 0x1f)
 #define SUN3X_EEPROM_PORTA	(SUN3X_EEPROM + 0x58)
 #define SUN3X_EEPROM_PORTB	(SUN3X_EEPROM + 0x60)
 
diff --git a/include/asm-m68k/sun3xflop.h b/include/asm-m68k/sun3xflop.h
index 6c65cc39b..1ed3b787e 100644
--- a/include/asm-m68k/sun3xflop.h
+++ b/include/asm-m68k/sun3xflop.h
@@ -89,11 +89,11 @@ static void sun3x_82072_fd_outb(unsigned char value, int port)
 
 		if(value & 0x10) {
 			fcr |= (FCR_DSEL0 | FCR_MTRON);
-		} else 
+		} else
 			fcr &= ~(FCR_DSEL0 | FCR_MTRON);
-		
-		
-		if(fcr != sun3x_fdc.fcr) { 
+
+
+		if(fcr != sun3x_fdc.fcr) {
 			*(sun3x_fdc.fcr_r) = fcr;
 			sun3x_fdc.fcr = fcr;
 		}
@@ -121,7 +121,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id,
 #undef TRACE_FLPY_INT
 #define NO_FLOPPY_ASSEMBLER
 
-#ifdef TRACE_FLPY_INT 
+#ifdef TRACE_FLPY_INT
 	static int calls=0;
 	static int bytes=0;
 	static int dma_wait=0;
@@ -142,13 +142,13 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id,
 		register int lcount;
 		register char *lptr;
 
-		for(lcount=virtual_dma_count, lptr=virtual_dma_addr; 
+		for(lcount=virtual_dma_count, lptr=virtual_dma_addr;
 		    lcount; lcount--, lptr++) {
 /*			st=fd_inb(virtual_dma_port+4) & 0x80 ;  */
 			st = *(sun3x_fdc.status_r);
 /*			if(st != 0xa0)                  */
 /*				break;                  */
-	
+
 			if((st & 0x80) == 0) {
 				virtual_dma_count = lcount;
 				virtual_dma_addr = lptr;
@@ -157,7 +157,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id,
 
 			if((st & 0x20) == 0)
 				break;
-		
+
 			if(virtual_dma_mode)
 /*				fd_outb(*lptr, virtual_dma_port+5); */
 				*(sun3x_fdc.data_r) = *lptr;
@@ -165,7 +165,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id,
 /*				*lptr = fd_inb(virtual_dma_port+5); */
 				*lptr = *(sun3x_fdc.data_r);
 		}
-		
+
 		virtual_dma_count = lcount;
 		virtual_dma_addr = lptr;
 /*		st = fd_inb(virtual_dma_port+4);   */
@@ -184,7 +184,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id,
 		doing_pdma = 0;
 
 #ifdef TRACE_FLPY_INT
-		printk("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n", 
+		printk("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n",
 		       virtual_dma_count, virtual_dma_residue, calls, bytes,
 		       dma_wait);
 		calls = 0;
@@ -195,7 +195,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id,
 		return IRQ_HANDLED;
 	}
 
-	
+
 #ifdef TRACE_FLPY_INT
 	if(!virtual_dma_count)
 		dma_wait++;
@@ -232,9 +232,9 @@ static int sun3xflop_init(void)
 	if(*sun3x_fdc.status_r == 0xff) {
 		return -1;
 	}
-	
+
 	*sun3x_fdc.fvr_r = FLOPPY_IRQ;
-	
+
 	*sun3x_fdc.fcr_r = FCR_TC;
 	udelay(10);
 	*sun3x_fdc.fcr_r = 0;
@@ -249,7 +249,7 @@ static int sun3xflop_init(void)
 static int sun3x_eject(void)
 {
 	if(MACH_IS_SUN3X) {
-	
+
 		sun3x_fdc.fcr |= (FCR_DSEL0 | FCR_EJECT);
 		*(sun3x_fdc.fcr_r) = sun3x_fdc.fcr;
 		udelay(10);
diff --git a/include/asm-m68k/termios.h b/include/asm-m68k/termios.h
index 530d490da..857f0c9a9 100644
--- a/include/asm-m68k/termios.h
+++ b/include/asm-m68k/termios.h
@@ -3,7 +3,7 @@
 
 #include <asm/termbits.h>
 #include <asm/ioctls.h>
- 
+
 struct winsize {
 	unsigned short ws_row;
 	unsigned short ws_col;
diff --git a/include/asm-m68k/thread_info.h b/include/asm-m68k/thread_info.h
index 873c18443..6a4367e35 100644
--- a/include/asm-m68k/thread_info.h
+++ b/include/asm-m68k/thread_info.h
@@ -56,7 +56,7 @@ extern int thread_flag_fixme(void);
  * - pass TIF_xxxx constants to these functions
  */
 
-#define __set_tsk_thread_flag(tsk, flag, val) ({ 	\
+#define __set_tsk_thread_flag(tsk, flag, val) ({	\
 	switch (flag) {					\
 	case TIF_SIGPENDING:				\
 		tsk->thread.work.sigpending = val;	\
diff --git a/include/asm-m68k/tlbflush.h b/include/asm-m68k/tlbflush.h
index 498f090dc..c989e4fcf 100644
--- a/include/asm-m68k/tlbflush.h
+++ b/include/asm-m68k/tlbflush.h
@@ -147,7 +147,7 @@ static inline void flush_tlb_mm (struct mm_struct *mm)
 	     seg = sun3_get_segmap(i);
 	     if(seg == SUN3_INVALID_PMEG)
 		     continue;
-	     
+
 	     sun3_put_segmap(i, SUN3_INVALID_PMEG);
 	     pmeg_alloc[seg] = 0;
 	     pmeg_ctx[seg] = 0;
@@ -155,7 +155,7 @@ static inline void flush_tlb_mm (struct mm_struct *mm)
      }
 
      sun3_put_context(oldctx);
-     		     
+
 }
 
 /* Flush a single TLB page. In this case, we're limited to flushing a
@@ -174,7 +174,7 @@ static inline void flush_tlb_page (struct vm_area_struct *vma,
 		pmeg_alloc[i] = 0;
 		pmeg_ctx[i] = 0;
 		pmeg_vaddr[i] = 0;
-		sun3_put_segmap (addr,  SUN3_INVALID_PMEG);     
+		sun3_put_segmap (addr,  SUN3_INVALID_PMEG);
 	}
 	sun3_put_context(oldctx);
 
@@ -186,7 +186,7 @@ static inline void flush_tlb_range (struct vm_area_struct *vma,
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned char seg, oldctx;
-	
+
 	start &= ~SUN3_PMEG_MASK;
 
 	oldctx = sun3_get_context();
@@ -194,7 +194,7 @@ static inline void flush_tlb_range (struct vm_area_struct *vma,
 
 	while(start < end)
 	{
-		if((seg = sun3_get_segmap(start)) == SUN3_INVALID_PMEG) 
+		if((seg = sun3_get_segmap(start)) == SUN3_INVALID_PMEG)
 		     goto next;
 		if(pmeg_ctx[seg] == mm->context) {
 			pmeg_alloc[seg] = 0;
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index b5a1febc9..f391cbe39 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -60,6 +60,8 @@ typedef unsigned long long u64;
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-m68k/unaligned.h b/include/asm-m68k/unaligned.h
index 479f15864..804cb3f88 100644
--- a/include/asm-m68k/unaligned.h
+++ b/include/asm-m68k/unaligned.h
@@ -2,7 +2,7 @@
 #define __M68K_UNALIGNED_H
 
 /*
- * The m68k can do unaligned accesses itself. 
+ * The m68k can do unaligned accesses itself.
  *
  * The strange macros are there to make sure these can't
  * be misused in a way that makes them not work on other
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index 0cc0b9f40..6a105788a 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -337,6 +337,31 @@ __asm__ __volatile__ ("trap  #0" \
 __syscall_return(type,__res); \
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-m68k/user.h b/include/asm-m68k/user.h
index 7ba0f8f1e..e8d5a64c7 100644
--- a/include/asm-m68k/user.h
+++ b/include/asm-m68k/user.h
@@ -51,7 +51,7 @@ struct user_regs_struct {
 	short __fill;
 };
 
-	
+
 /* When the kernel dumps core, it starts by dumping the user struct -
    this will be used by gdb to figure out where the data and stack segments
    are within the file, and what virtual addresses to use. */
@@ -72,7 +72,7 @@ struct user{
 				   This is actually the bottom of the stack,
 				   the top of the stack is always found in the
 				   esp register.  */
-  long int signal;     		/* Signal that caused the core dump. */
+  long int signal;		/* Signal that caused the core dump. */
   int reserved;			/* No longer used */
   struct user_regs_struct *u_ar0;
 				/* Used by gdb to help find the values for */
diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h
index 68205b618..8c4e8037b 100644
--- a/include/asm-m68k/virtconvert.h
+++ b/include/asm-m68k/virtconvert.h
@@ -8,6 +8,7 @@
 #ifdef __KERNEL__
 
 #include <linux/config.h>
+#include <linux/compiler.h>
 #include <asm/setup.h>
 #include <asm/page.h>
 
@@ -31,7 +32,7 @@ static inline unsigned long mm_ptov(unsigned long paddr)
 {
 	return (unsigned long)__va(paddr);
 }
-#endif 
+#endif
 
 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
 static inline unsigned long virt_to_phys(void *vaddr)
diff --git a/include/asm-m68knommu/atomic.h b/include/asm-m68knommu/atomic.h
index edaf71e7c..0f33ee426 100644
--- a/include/asm-m68knommu/atomic.h
+++ b/include/asm-m68knommu/atomic.h
@@ -18,30 +18,6 @@ typedef struct { int counter; } atomic_t;
 #define atomic_read(v)		((v)->counter)
 #define atomic_set(v, i)	(((v)->counter) = i)
 
-#ifdef CONFIG_COLDFIRE
-
-static __inline__ void atomic_add(int i, atomic_t *v)
-{
-	__asm__ __volatile__(
-		"movel %1,%%d0\t\n"
-		"addl %%d0,%0"
-		:
-		: "m" (*v), "id" (i)
-		: "d0");
-}
-
-static __inline__ void atomic_sub(int i, atomic_t *v)
-{
-	__asm__ __volatile__(
-		"movel %1,%%d0\t\n"
-		"subl %%d0,%0"
-		:
-		: "m" (*v), "id" (i)
-		: "d0");
-}
-
-#else
-
 static __inline__ void atomic_add(int i, atomic_t *v)
 {
 	__asm__ __volatile__("addl %1,%0" : "=m" (*v) : "d" (i), "0" (*v));
@@ -52,8 +28,6 @@ static __inline__ void atomic_sub(int i, atomic_t *v)
 	__asm__ __volatile__("subl %1,%0" : "=m" (*v) : "d" (i), "0" (*v));
 }
 
-#endif /* COLDFIRE */
-
 static __inline__ void atomic_inc(volatile atomic_t *v)
 {
 	__asm__ __volatile__("addql #1,%0" : "=m" (*v): "0" (*v));
@@ -96,6 +70,8 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
 	return temp;
 }
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
 extern __inline__ int atomic_sub_return(int i, atomic_t * v)
 {
 	unsigned long temp, flags;
@@ -112,6 +88,16 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
 #define atomic_dec_return(v) atomic_sub_return(1,(v))
 #define atomic_inc_return(v) atomic_add_return(1,(v))
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
 #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
 
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h
index 18422f15a..09ee1c5cf 100644
--- a/include/asm-m68knommu/bitops.h
+++ b/include/asm-m68knommu/bitops.h
@@ -76,12 +76,6 @@ static inline int __ffs(int x)
 	return r;
 }
 
-/*
- * fls: find last bit set.
- */
-#define fls(x) generic_fls(x)
-
-
 /*
  * Every architecture must define this function. It's the fastest
  * way of searching a 140-bit bitmap where the first 100 bits are
@@ -283,7 +277,7 @@ static __inline__ int __constant_test_bit(int nr, const volatile unsigned long *
 	return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
 }
 
-static __inline__ int __test_bit(int nr, const unsigned long * addr)
+static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
 {
 	int 	* a = (int *) addr;
 	int	mask;
@@ -337,6 +331,48 @@ found_middle:
 	return result + ffz(tmp);
 }
 
+/*
+ * Find next one bit in a bitmap reasonably efficiently.
+ */
+static __inline__ unsigned long find_next_bit(const unsigned long *addr,
+	unsigned long size, unsigned long offset)
+{
+	unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
+	unsigned int result = offset & ~31UL;
+	unsigned int tmp;
+
+	if (offset >= size)
+		return size;
+	size -= result;
+	offset &= 31UL;
+	if (offset) {
+		tmp = *p++;
+		tmp &= ~0UL << offset;
+		if (size < 32)
+			goto found_first;
+		if (tmp)
+			goto found_middle;
+		size -= 32;
+		result += 32;
+	}
+	while (size >= 32) {
+		if ((tmp = *p++) != 0)
+			goto found_middle;
+		result += 32;
+		size -= 32;
+	}
+	if (!size)
+		return result;
+	tmp = *p;
+
+found_first:
+	tmp &= ~0UL >> (32 - size);
+	if (tmp == 0UL)        /* Are any bits set? */
+		return result + size; /* Nope. */
+found_middle:
+	return result + __ffs(tmp);
+}
+
 /*
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
@@ -478,4 +514,9 @@ found_middle:
 
 #endif /* __KERNEL__ */
 
+/*
+ * fls: find last bit set.
+ */
+#define fls(x) generic_fls(x)
+
 #endif /* _M68KNOMMU_BITOPS_H */
diff --git a/include/asm-m68knommu/cacheflush.h b/include/asm-m68knommu/cacheflush.h
index 3789be803..f7182c4c8 100644
--- a/include/asm-m68knommu/cacheflush.h
+++ b/include/asm-m68knommu/cacheflush.h
@@ -12,6 +12,8 @@
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_range(start,len)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start,len)		__flush_cache_all()
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
@@ -37,13 +39,15 @@ extern inline void __flush_cache_all(void)
 		"1:\n\t"
 		"movel	%%d0,%%a0\n\t"
 		"2:\n\t"
-		".word	0xf4e8\n\t"
+		".word	0xf468\n\t"
 		"addl	#0x10,%%a0\n\t"
 		"cmpl	#0x00000800,%%a0\n\t"
 		"blt	2b\n\t"
 		"addql	#1,%%d0\n\t"
 		"cmpil	#4,%%d0\n\t"
 		"bne	1b\n\t"
+		"movel	#0xb6088500,%%d0\n\t"
+		"movec	%%d0,%%CACR\n\t"
 		: : : "d0", "a0" );
 #endif /* CONFIG_M5407 */
 #ifdef CONFIG_M5272
diff --git a/include/asm-m68knommu/flat.h b/include/asm-m68knommu/flat.h
index 73712f276..2d836edc4 100644
--- a/include/asm-m68knommu/flat.h
+++ b/include/asm-m68knommu/flat.h
@@ -9,7 +9,7 @@
 #define	flat_argvp_envp_on_stack()		1
 #define	flat_old_ram_flag(flags)		(flags)
 #define	flat_reloc_valid(reloc, size)		((reloc) <= (size))
-#define	flat_get_addr_from_rp(rp, relval)	get_unaligned(rp)
+#define	flat_get_addr_from_rp(rp, relval, flags)	get_unaligned(rp)
 #define	flat_put_addr_at_rp(rp, val, relval)	put_unaligned(val,rp)
 #define	flat_get_relocate_addr(rel)		(rel)
 
diff --git a/include/asm-m68knommu/mcfsmc.h b/include/asm-m68knommu/mcfsmc.h
index 1d590e489..2583900b9 100644
--- a/include/asm-m68knommu/mcfsmc.h
+++ b/include/asm-m68knommu/mcfsmc.h
@@ -21,6 +21,18 @@
 
 #undef	outb
 #undef	inb
+#undef	outw
+#undef	outwd
+#undef	inw	
+#undef	outl
+#undef	inl
+
+#undef	outsb
+#undef	outsw
+#undef	outsl
+#undef	insb
+#undef	insw
+#undef	insl
 
 /*
  *	Re-defines for ColdFire environment... The SMC part is
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h
index 1d1f7e848..8f2b59042 100644
--- a/include/asm-m68knommu/pgtable.h
+++ b/include/asm-m68knommu/pgtable.h
@@ -11,8 +11,6 @@
 #include <asm/page.h>
 #include <asm/io.h>
 
-typedef pte_t *pte_addr_t;
-
 /*
  * Trivial page table functions.
  */
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index c58c9790c..b10e469b2 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -372,6 +372,30 @@ type name(atype a, btype b, ctype c, dtype d, etype e)				\
   return (type)__res;								\
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
 
 #ifdef __KERNEL_SYSCALLS__
 
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index 0ab4f7d67..c08c486a2 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -45,6 +45,9 @@ static inline void flush_dcache_page(struct page *page)
 
 }
 
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
+
 extern void (*flush_icache_page)(struct vm_area_struct *vma,
 	struct page *page);
 extern void (*flush_icache_range)(unsigned long start, unsigned long end);
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index 0db85f430..e31681afb 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -120,10 +120,6 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
 	return csum_fold(csum);
 }
 
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
 static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
 	unsigned long daddr, unsigned short len, unsigned short proto,
 	unsigned int sum)
diff --git a/include/asm-mips/hdreg.h b/include/asm-mips/hdreg.h
index 7f7fd1af0..5989bbc97 100644
--- a/include/asm-mips/hdreg.h
+++ b/include/asm-mips/hdreg.h
@@ -1 +1 @@
-#include <asm-generic/hdreg.h>
+#warning this file is obsolete, please do not use it
diff --git a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h
index a117c0ade..6886a0c3f 100644
--- a/include/asm-mips/kmap_types.h
+++ b/include/asm-mips/kmap_types.h
@@ -19,12 +19,11 @@ D(5)	KM_BIO_SRC_IRQ,
 D(6)	KM_BIO_DST_IRQ,
 D(7)	KM_PTE0,
 D(8)	KM_PTE1,
-D(9)	KM_PTE2,
-D(10)	KM_IRQ0,
-D(11)	KM_IRQ1,
-D(12)	KM_SOFTIRQ0,
-D(13)	KM_SOFTIRQ1,
-D(14)	KM_TYPE_NR
+D(9)	KM_IRQ0,
+D(10)	KM_IRQ1,
+D(11)	KM_SOFTIRQ0,
+D(12)	KM_SOFTIRQ1,
+D(13)	KM_TYPE_NR
 };
 
 #undef D
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 91b1b07a5..326f26696 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -1141,14 +1141,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
 #define Au1500_PCI_MEM_START      0x440000000
 #define Au1500_PCI_MEM_END        0x44FFFFFFF
 
-#define PCI_IO_START    (Au1500_PCI_IO_START + 0x300)
+#define PCI_IO_START    (Au1500_PCI_IO_START + 0x1000)
 #define PCI_IO_END      (Au1500_PCI_IO_END)
 #define PCI_MEM_START   (Au1500_PCI_MEM_START)
 #define PCI_MEM_END     (Au1500_PCI_MEM_END)
 #define PCI_FIRST_DEVFN (0<<3)
 #define PCI_LAST_DEVFN  (19<<3)
 
-#define IOPORT_RESOURCE_START 0x00000000
+#define IOPORT_RESOURCE_START 0x00001000 /* skip the legacy ide probing */
 #define IOPORT_RESOURCE_END   0xffffffff
 #define IOMEM_RESOURCE_START  0x10000000
 #define IOMEM_RESOURCE_END    0xffffffff
@@ -1199,5 +1199,20 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
 #elif defined(CONFIG_SOC_AU1100)
 #define NUM_ETH_INTERFACES 1
 #endif
+/* Processor information base on prid.
+ * Copied from PowerPC.
+ */
+struct cpu_spec {
+	/* CPU is matched via (PRID & prid_mask) == prid_value */
+	unsigned int	prid_mask;
+	unsigned int	prid_value;
+
+	char		*cpu_name;
+	unsigned int	cpu_od;		/* Set Config[OD] */
+	unsigned int	cpu_bclk;	/* Enable BCLK switching */
+};
+
+extern struct cpu_spec		cpu_specs[];
+extern struct cpu_spec		*cur_cpu_spec[];
 
 #endif
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h
index 65990e18a..3b03b0b0a 100644
--- a/include/asm-mips/mach-db1x00/db1x00.h
+++ b/include/asm-mips/mach-db1x00/db1x00.h
@@ -27,21 +27,34 @@
 #ifndef __ASM_DB1X00_H
 #define __ASM_DB1X00_H
 
+#ifdef CONFIG_MIPS_DB1550
+#define BCSR_KSEG1_ADDR 0xAF000000
+#else
+#define BCSR_KSEG1_ADDR 0xAE000000
+#endif
 
 /*
  * Overlay data structure of the Db1x00 board registers.
- * Registers located at physical 1E0000xx, KSEG1 0xAE0000xx
+ * Registers located at physical 0E0000xx, KSEG1 0xAE0000xx
  */
 typedef volatile struct
 {
-	/*00*/	unsigned long whoami;
-	/*04*/	unsigned long status;
-	/*08*/	unsigned long switches;
-	/*0C*/	unsigned long resets;
-	/*10*/	unsigned long pcmcia;
-	/*14*/	unsigned long specific;
-	/*18*/	unsigned long leds;
-	/*1C*/	unsigned long swreset;
+	/*00*/	unsigned short whoami;
+	unsigned short reserved0;
+	/*04*/	unsigned short status;
+	unsigned short reserved1;
+	/*08*/	unsigned short switches;
+	unsigned short reserved2;
+	/*0C*/	unsigned short resets;
+	unsigned short reserved3;
+	/*10*/	unsigned short pcmcia;
+	unsigned short reserved4;
+	/*14*/	unsigned short specific;
+	unsigned short reserved5;
+	/*18*/	unsigned short leds;
+	unsigned short reserved6;
+	/*1C*/	unsigned short swreset;
+	unsigned short reserved7;
 
 } BCSR;
 
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h
index 6fe8e9b54..a326f4512 100644
--- a/include/asm-mips/mach-dec/mc146818rtc.h
+++ b/include/asm-mips/mach-dec/mc146818rtc.h
@@ -23,7 +23,7 @@ extern unsigned long dec_kn_slot_size;
 #define RTC_PORT(x)	CPHYSADDR(dec_rtc_base)
 #define RTC_IO_EXTENT	dec_kn_slot_size
 #define RTC_IOMAPPED	0
-#define RTC_IRQ		0
+#undef RTC_IRQ
 
 #define RTC_DEC_YEAR	0x3f	/* Where we store the real year on DECs.  */
 
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index a4618ca9f..fa2760afa 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -20,6 +20,8 @@
 # endif
 #endif
 
+#define IDE_ARCH_OBSOLETE_DEFAULTS
+
 static inline int ide_default_irq(unsigned long base)
 {
 	switch (base) {
@@ -48,6 +50,9 @@ static inline unsigned long ide_default_io_base(int index)
 	}
 }
 
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+
 #ifdef CONFIG_BLK_DEV_IDEPCI
 #define ide_init_default_irq(base)	(0)
 #else
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 8beb5f4f5..51326d10b 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -216,10 +216,4 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)	((pte_t) { (x).val })
 
-#ifdef CONFIG_64BIT_PHYS_ADDR
-typedef u64 pte_addr_t;
-#else
-typedef pte_t *pte_addr_t;
-#endif
-
 #endif /* _ASM_PGTABLE_32_H */
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index 2bd879e4c..eba84a79e 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -214,8 +214,6 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)	((pte_t) { (x).val })
 
-typedef pte_t *pte_addr_t;
-
 /*
  * Used for the b0rked handling of kernel pagetables on the 64-bit kernel.
  */
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index f13b15ac0..70534af2a 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -175,6 +175,8 @@ typedef struct {
 	unsigned long seg;
 } mm_segment_t;
 
+#define ARCH_MIN_TASKALIGN	8
+
 /*
  * If you change thread_struct remember to change the #defines below too!
  */
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 36df5fc7b..19cadb657 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -69,6 +69,8 @@ struct pt_regs {
 
 extern void show_regs(struct pt_regs *);
 
+extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
+
 #endif
 
 #endif /* _ASM_PTRACE_H */
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index d2575ae42..f16118f57 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -23,6 +23,7 @@ typedef struct {
 
 #define spin_is_locked(x)	((x)->lock != 0)
 #define spin_unlock_wait(x)	do { barrier(); } while ((x)->lock)
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index 82889016d..117825203 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -110,6 +110,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
 #define TIF_NOTIFY_RESUME	1	/* resumption notification requested */
 #define TIF_SIGPENDING		2	/* signal pending */
 #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
+#define TIF_SYSCALL_AUDIT	4	/* syscall auditing active */
 #define TIF_USEDFPU		16	/* FPU was used by this task this quantum (SMP) */
 #define TIF_POLLING_NRFLAG	17	/* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_SYSCALL_TRACE	31	/* syscall trace active */
@@ -118,12 +119,13 @@ register struct thread_info *__current_thread_info __asm__("$28");
 #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
 #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)
+#define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
 #define _TIF_USEDFPU		(1<<TIF_USEDFPU)
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 
-#define _TIF_WORK_MASK		0x0000fffe	/* work to do on
+#define _TIF_WORK_MASK		0x0000ffef	/* work to do on
                                                    interrupt/exception return */
-#define _TIF_ALLWORK_MASK	0x8000fffe	/* work to do on any return to
+#define _TIF_ALLWORK_MASK	0x8000ffff	/* work to do on any return to
                                                    u-space */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index b949ab33e..d2f0c76b0 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -99,6 +99,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 8fe42c70e..4dfc72bd1 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -288,16 +288,25 @@
 #define __NR_clock_nanosleep		(__NR_Linux + 265)
 #define __NR_tgkill			(__NR_Linux + 266)
 #define __NR_utimes			(__NR_Linux + 267)
+#define __NR_mbind			(__NR_Linux + 268)
+#define __NR_get_mempolicy		(__NR_Linux + 269)
+#define __NR_set_mempolicy		(__NR_Linux + 270)
+#define __NR_mq_open			(__NR_Linux + 271)
+#define __NR_mq_unlink			(__NR_Linux + 272)
+#define __NR_mq_timedsend		(__NR_Linux + 273)
+#define __NR_mq_timedreceive		(__NR_Linux + 274)
+#define __NR_mq_notify			(__NR_Linux + 275)
+#define __NR_mq_getsetattr		(__NR_Linux + 276)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux_syscalls		267
+#define __NR_Linux_syscalls		276
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #define __NR_O32_Linux			4000
-#define __NR_O32_Linux_syscalls		267
+#define __NR_O32_Linux_syscalls		276
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 
@@ -532,16 +541,25 @@
 #define __NR_clock_nanosleep		(__NR_Linux + 224)
 #define __NR_tgkill			(__NR_Linux + 225)
 #define __NR_utimes			(__NR_Linux + 226)
+#define __NR_mbind			(__NR_Linux + 227)
+#define __NR_get_mempolicy		(__NR_Linux + 228)
+#define __NR_set_mempolicy		(__NR_Linux + 229)
+#define __NR_mq_open			(__NR_Linux + 230)
+#define __NR_mq_unlink			(__NR_Linux + 231)
+#define __NR_mq_timedsend		(__NR_Linux + 232)
+#define __NR_mq_timedreceive		(__NR_Linux + 233)
+#define __NR_mq_notify			(__NR_Linux + 234)
+#define __NR_mq_getsetattr		(__NR_Linux + 235)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls		226
+#define __NR_Linux_syscalls		235
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux			5000
-#define __NR_64_Linux_syscalls		226
+#define __NR_64_Linux_syscalls		235
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
@@ -780,16 +798,25 @@
 #define __NR_clock_nanosleep		(__NR_Linux + 228)
 #define __NR_tgkill			(__NR_Linux + 229)
 #define __NR_utimes			(__NR_Linux + 230)
+#define __NR_mbind			(__NR_Linux + 231)
+#define __NR_get_mempolicy		(__NR_Linux + 232)
+#define __NR_set_mempolicy		(__NR_Linux + 233)
+#define __NR_mq_open			(__NR_Linux + 234)
+#define __NR_mq_unlink			(__NR_Linux + 235)
+#define __NR_mq_timedsend		(__NR_Linux + 236)
+#define __NR_mq_timedreceive		(__NR_Linux + 237)
+#define __NR_mq_notify			(__NR_Linux + 238)
+#define __NR_mq_getsetattr		(__NR_Linux + 239)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls		230
+#define __NR_Linux_syscalls		239
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux			6000
-#define __NR_N32_Linux_syscalls		230
+#define __NR_N32_Linux_syscalls		239
 
 #ifndef __ASSEMBLY__
 
@@ -1045,6 +1072,31 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
 
 #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+# ifndef __mips64
+#  define __ARCH_WANT_STAT64
+# endif
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
index 8d2e1b6df..53fe1162a 100644
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ b/include/asm-mips/vr41xx/vr41xx.h
@@ -136,6 +136,9 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
 extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
 extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq));
 
+extern void vr41xx_enable_dsiuint(void);
+extern void vr41xx_disable_dsiuint(void);
+
 /*
  * Power Management Unit
  */
@@ -189,22 +192,25 @@ enum {
 /*
  * Serial Interface Unit
  */
-extern void vr41xx_siu_init(int interface, int module);
-extern void vr41xx_siu_ifselect(int interface, int module);
+extern void vr41xx_siu_init(void);
 extern int vr41xx_serial_ports;
 
 /* SIU interfaces */
-enum {
+typedef enum {
 	SIU_RS232C,
 	SIU_IRDA
-};
+} siu_interface_t;
 
 /* IrDA interfaces */
-enum {
-	IRDA_SHARP = 1,
+typedef enum {
+	IRDA_NONE,
+	IRDA_SHARP,
 	IRDA_TEMIC,
 	IRDA_HP
-};
+} irda_module_t;
+
+extern void vr41xx_select_siu_interface(siu_interface_t interface,
+                                        irda_module_t module);
 
 /*
  * Debug Serial Interface Unit
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h
index 20ee097b5..4b04759ec 100644
--- a/include/asm-parisc/atomic.h
+++ b/include/asm-parisc/atomic.h
@@ -3,7 +3,6 @@
 
 #include <linux/config.h>
 #include <asm/system.h>
-
 /* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>.  */
 
 /*
@@ -15,33 +14,47 @@
  */
 
 #ifdef CONFIG_SMP
+#include <asm/cache.h>		/* we use L1_CACHE_BYTES */
+
+typedef spinlock_t atomic_lock_t;
+
 /* Use an array of spinlocks for our atomic_ts.
-** Hash function to index into a different SPINLOCK.
-** Since "a" is usually an address, ">>8" makes one spinlock per 64-bytes.
-*/
+ * Hash function to index into a different SPINLOCK.
+ * Since "a" is usually an address, use one spinlock per cacheline.
+ */
 #  define ATOMIC_HASH_SIZE 4
-#  define ATOMIC_HASH(a) (&__atomic_hash[(((unsigned long) a)>>8)&(ATOMIC_HASH_SIZE-1)])
-
-extern spinlock_t __atomic_hash[ATOMIC_HASH_SIZE];
-/* copied from <asm/spinlock.h> and modified */
-#  define SPIN_LOCK(x) \
-	do { while(__ldcw(&(x)->lock) == 0); } while(0)
-	
-#  define SPIN_UNLOCK(x) \
-	do { (x)->lock = 1; } while(0)
+#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
+
+extern atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
+
+static inline void atomic_spin_lock(atomic_lock_t *a)
+{
+	while (__ldcw(a) == 0)
+		while (a->lock[0] == 0);
+}
+
+static inline void atomic_spin_unlock(atomic_lock_t *a)
+{
+	a->lock[0] = 1;
+}
+
 #else
 #  define ATOMIC_HASH_SIZE 1
 #  define ATOMIC_HASH(a)	(0)
-
-/* copied from <linux/spinlock.h> and modified */
-#  define SPIN_LOCK(x) (void)(x)
-	
-#  define SPIN_UNLOCK(x) do { } while(0)
+#  define atomic_spin_lock(x) (void)(x)
+#  define atomic_spin_unlock(x) do { } while(0)
 #endif
 
 /* copied from <linux/spinlock.h> and modified */
-#define SPIN_LOCK_IRQSAVE(lock, flags)		do { local_irq_save(flags);       SPIN_LOCK(lock); } while (0)
-#define SPIN_UNLOCK_IRQRESTORE(lock, flags)	do { SPIN_UNLOCK(lock);  local_irq_restore(flags); } while (0)
+#define atomic_spin_lock_irqsave(lock, flags)	do { 	\
+	local_irq_save(flags);				\
+	atomic_spin_lock(lock); 			\
+} while (0)
+
+#define atomic_spin_unlock_irqrestore(lock, flags) do {	\
+	atomic_spin_unlock(lock);			\
+	local_irq_restore(flags);			\
+} while (0)
 
 /* Note that we need not lock read accesses - aligned word writes/reads
  * are atomic, so a reader never sees unconsistent values.
@@ -137,22 +150,22 @@ static __inline__ int __atomic_add_return(int i, atomic_t *v)
 {
 	int ret;
 	unsigned long flags;
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(v), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(v), flags);
 
 	ret = (v->counter += i);
 
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(v), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
 	return ret;
 }
 
 static __inline__ void atomic_set(atomic_t *v, int i) 
 {
 	unsigned long flags;
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(v), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(v), flags);
 
 	v->counter = i;
 
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(v), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
 }
 
 static __inline__ int atomic_read(const atomic_t *v)
@@ -172,6 +185,18 @@ static __inline__ int atomic_read(const atomic_t *v)
 #define atomic_inc_return(v)	(__atomic_add_return(   1,(v)))
 #define atomic_dec_return(v)	(__atomic_add_return(  -1,(v)))
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 #define atomic_dec_and_test(v)	(atomic_dec_return(v) == 0)
 
 #define ATOMIC_INIT(i)	{ (i) }
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h
index 0ecabe5a2..caa317328 100644
--- a/include/asm-parisc/bitops.h
+++ b/include/asm-parisc/bitops.h
@@ -38,9 +38,9 @@ static __inline__ void set_bit(int nr, void * address)
 
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(addr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
 	*addr |= mask;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(addr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 }
 
 static __inline__ void __set_bit(int nr, void * address)
@@ -61,9 +61,9 @@ static __inline__ void clear_bit(int nr, void * address)
 
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(addr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
 	*addr &= ~mask;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(addr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 }
 
 static __inline__ void __clear_bit(unsigned long nr, volatile void * address)
@@ -84,9 +84,9 @@ static __inline__ void change_bit(int nr, void * address)
 
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(addr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
 	*addr ^= mask;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(addr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 }
 
 static __inline__ void __change_bit(int nr, void * address)
@@ -108,10 +108,10 @@ static __inline__ int test_and_set_bit(int nr, void * address)
 
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(addr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
 	oldbit = (*addr & mask) ? 1 : 0;
 	*addr |= mask;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(addr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 
 	return oldbit;
 }
@@ -139,10 +139,10 @@ static __inline__ int test_and_clear_bit(int nr, void * address)
 
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(addr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
 	oldbit = (*addr & mask) ? 1 : 0;
 	*addr &= ~mask;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(addr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 
 	return oldbit;
 }
@@ -170,10 +170,10 @@ static __inline__ int test_and_change_bit(int nr, void * address)
 
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
-	SPIN_LOCK_IRQSAVE(ATOMIC_HASH(addr), flags);
+	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
 	oldbit = (*addr & mask) ? 1 : 0;
 	*addr ^= mask;
-	SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(addr), flags);
+	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 
 	return oldbit;
 }
@@ -427,6 +427,17 @@ found_middle:
 	return result + __ffs(tmp);
 }
 
+/**
+ * find_first_bit - find the first set bit in a memory region
+ * @addr: The address to start the search at
+ * @size: The maximum size to search
+ *
+ * Returns the bit-number of the first set bit, not the number of the byte
+ * containing a bit.
+ */
+#define find_first_bit(addr, size) \
+        find_next_bit((addr), (size), 0)
+
 #define _EXT2_HAVE_ASM_BITOPS_
 
 #ifdef __KERNEL__
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h
index c62fe6640..f6701e705 100644
--- a/include/asm-parisc/cache.h
+++ b/include/asm-parisc/cache.h
@@ -52,6 +52,8 @@ extern void disable_sr_hashing(void);   /* turns off space register hashing */
 extern void disable_sr_hashing_asm(int); /* low level support for above */
 extern void free_sid(unsigned long);
 unsigned long alloc_sid(void);
+extern void flush_user_dcache_page(unsigned long);
+extern void flush_user_icache_page(unsigned long);
 
 struct seq_file;
 extern void show_cache_info(struct seq_file *m);
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index 224b3e6a5..a5700c29f 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -78,17 +78,18 @@ static inline void flush_dcache_page(struct page *page)
 	}
 }
 
+#define flush_dcache_mmap_lock(mapping) \
+	spin_lock_irq(&(mapping)->tree_lock)
+#define flush_dcache_mmap_unlock(mapping) \
+	spin_unlock_irq(&(mapping)->tree_lock)
+
 #define flush_icache_page(vma,page)	do { flush_kernel_dcache_page(page_address(page)); flush_kernel_icache_page(page_address(page)); } while (0)
 
 #define flush_icache_range(s,e)		do { flush_kernel_dcache_range_asm(s,e); flush_kernel_icache_range_asm(s,e); } while (0)
 
-#define flush_icache_user_range(vma, page, addr, len) do { \
-        flush_user_dcache_range(addr, addr + len); \
-	flush_user_icache_range(addr, addr + len); } while (0)
-
 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
 do { memcpy(dst, src, len); \
-     flush_icache_user_range(vma, page, vaddr, len); \
+     flush_kernel_dcache_range_asm((unsigned long)dst, (unsigned long)dst + len); \
 } while (0)
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
 	memcpy(dst, src, len)
@@ -112,27 +113,85 @@ static inline void flush_cache_range(struct vm_area_struct *vma,
 	}
 }
 
-static inline void
-flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr)
+/* Simple function to work out if we have an existing address translation
+ * for a user space vma. */
+static inline int translation_exists(struct vm_area_struct *vma,
+				     unsigned long addr)
 {
-	int sr3;
+	pgd_t *pgd = pgd_offset(vma->vm_mm, addr);
+	pmd_t *pmd;
+	pte_t *pte;
 
-	if (!vma->vm_mm->context) {
-		BUG();
-		return;
-	}
+	if(pgd_none(*pgd))
+		return 0;
 
-	sr3 = mfsp(3);
-	if (vma->vm_mm->context == sr3) {
-		flush_user_dcache_range(vmaddr,vmaddr + PAGE_SIZE);
+	pmd = pmd_offset(pgd, addr);
+	if(pmd_none(*pmd) || pmd_bad(*pmd))
+		return 0;
+
+	pte = pte_offset_map(pmd, addr);
+
+	/* The PA flush mappings show up as pte_none, but they're
+	 * valid none the less */
+	if(pte_none(*pte) && ((pte_val(*pte) & _PAGE_FLUSH) == 0))
+		return 0;
+	return 1;
+}
+
+
+/* Private function to flush a page from the cache of a non-current
+ * process.  cr25 contains the Page Directory of the current user
+ * process; we're going to hijack both it and the user space %sr3 to
+ * temporarily make the non-current process current.  We have to do
+ * this because cache flushing may cause a non-access tlb miss which
+ * the handlers have to fill in from the pgd of the non-current
+ * process. */
+static inline void
+flush_user_cache_page_non_current(struct vm_area_struct *vma,
+				  unsigned long vmaddr)
+{
+	/* save the current process space and pgd */
+	unsigned long space = mfsp(3), pgd = mfctl(25);
+
+	/* we don't mind taking interrups since they may not
+	 * do anything with user space, but we can't
+	 * be preempted here */
+	preempt_disable();
+
+	/* make us current */
+	mtctl(__pa(vma->vm_mm->pgd), 25);
+	mtsp(vma->vm_mm->context, 3);
+
+	flush_user_dcache_page(vmaddr);
+	if(vma->vm_flags & VM_EXEC)
+		flush_user_icache_page(vmaddr);
+
+	/* put the old current process back */
+	mtsp(space, 3);
+	mtctl(pgd, 25);
+	preempt_enable();
+}
+
+static inline void
+__flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr)
+{
+	if (likely(vma->vm_mm->context == mfsp(3))) {
+		flush_user_dcache_page(vmaddr);
 		if (vma->vm_flags & VM_EXEC)
-			flush_user_icache_range(vmaddr,vmaddr + PAGE_SIZE);
+			flush_user_icache_page(vmaddr);
 	} else {
-		if (vma->vm_flags & VM_EXEC)
-			flush_cache_all();
-		else
-			flush_data_cache();
+		flush_user_cache_page_non_current(vma, vmaddr);
 	}
 }
+
+static inline void
+flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr)
+{
+	BUG_ON(!vma->vm_mm->context);
+
+	if(likely(translation_exists(vma, vmaddr)))
+		__flush_cache_page(vma, vmaddr);
+
+}
 #endif
 
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h
index 7cb205555..89808f778 100644
--- a/include/asm-parisc/dma-mapping.h
+++ b/include/asm-parisc/dma-mapping.h
@@ -247,4 +247,7 @@ struct parisc_device;
 void * sba_get_iommu(struct parisc_device *dev);
 #endif
 
+/* At the moment, we panic on error for IOMMU resource exaustion */
+#define dma_mapping_error(x)	0
+
 #endif
diff --git a/include/asm-parisc/fixmap.h b/include/asm-parisc/fixmap.h
index 52fc100f6..a5caf4b12 100644
--- a/include/asm-parisc/fixmap.h
+++ b/include/asm-parisc/fixmap.h
@@ -2,18 +2,22 @@
 #define _ASM_FIXMAP_H
 
 /*
- * Allocate a 8 Mb temporary mapping area for copy_user_page/clear_user_page.
- * This area needs to be aligned on a 8 Mb boundary.
+ * This file defines the locations of the fixed mappings on parisc.
  *
- * FIXME:
+ * All of the values in this file are machine virtual addresses.
  *
- * For PA-RISC, this has no meaning.  It is starting to be used on x86
- * for vsyscalls.  PA will probably do this using space registers.
- */
+ * All of the values in this file must be <4GB (because of assembly
+ * loading restrictions).  If you place this region anywhere above
+ * __PAGE_OFFSET, you must adjust the memory map accordingly */
 
-/* This TMPALIAS_MAP_START reserves some of the memory where the
- * FIXMAP region is on x86.  It's only real use is to constrain
- * VMALLOC_END (see pktable.h) */
-#define TMPALIAS_MAP_START (__PAGE_OFFSET - 0x01000000)
+/* The alias region is used in kernel space to do copy/clear to or
+ * from areas congruently mapped with user space.  It is 8MB large
+ * and must be 16MB aligned */
+#define TMPALIAS_MAP_START	((__PAGE_OFFSET) - 16*1024*1024)
+/* This is the kernel area for all maps (vmalloc, dma etc.)  most
+ * usually, it extends up to TMPALIAS_MAP_START.  Virtual addresses
+ * 0..GATEWAY_PAGE_SIZE are reserved for the gateway page */
+#define KERNEL_MAP_START	(GATEWAY_PAGE_SIZE)
+#define KERNEL_MAP_END		(TMPALIAS_MAP_START)
 
 #endif
diff --git a/include/asm-parisc/hardware.h b/include/asm-parisc/hardware.h
index 3f54dfa50..3fc29c68f 100644
--- a/include/asm-parisc/hardware.h
+++ b/include/asm-parisc/hardware.h
@@ -36,7 +36,8 @@ enum cpu_type {
 	pcxu_	= 7, /* pa8200	(u+)	pa 2.0  */
 	pcxw	= 8, /* pa8500		pa 2.0  */
 	pcxw_	= 9, /* pa8600	(w+)	pa 2.0  */
-	pcxw2	= 10 /* pa8700		pa 2.0  */
+	pcxw2	= 10, /* pa8700		pa 2.0  */
+	mako	= 11  /* pa8800		pa 2.0  */
 };
 
 extern char *cpu_name_version[][2]; /* mapping from enum cpu_type to strings */
diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h
index 61c379217..15a9374c1 100644
--- a/include/asm-parisc/ide.h
+++ b/include/asm-parisc/ide.h
@@ -19,10 +19,8 @@
 #define MAX_HWIFS	2
 #endif
 
-#define ide_default_irq(base) (0)
-#define ide_default_io_base(index) (0)
-
-#define ide_init_default_irq(base)	(0)
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
 
 #define ide_request_irq(irq,hand,flg,dev,id)	request_irq((irq),(hand),(flg),(dev),(id))
 #define ide_free_irq(irq,dev_id)		free_irq((irq), (dev_id))
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index 7d848d272..54cc342e4 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -10,6 +10,7 @@
 #include <linux/config.h>
 #ifndef __ASSEMBLY__
 
+#include <asm/types.h>
 #include <asm/cache.h>
 
 #define clear_page(page)	memset((void *)(page), 0, PAGE_SIZE)
@@ -39,12 +40,26 @@ clear_user_page(void *page, unsigned long vaddr, struct page *pg)
 /*
  * These are used to make use of C type-checking..
  */
+#ifdef __LP64__
 typedef struct { unsigned long pte; } pte_t;
-typedef struct { unsigned long pmd; } pmd_t;
-typedef struct { unsigned long pgd; } pgd_t;
+#else
+typedef struct {
+	unsigned long pte;
+	unsigned long flags;
+} pte_t;
+#endif
+/* NOTE: even on 64 bits, these entries are __u32 because we allocate
+ * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */
+typedef struct { __u32 pmd; } pmd_t;
+typedef struct { __u32 pgd; } pgd_t;
 typedef struct { unsigned long pgprot; } pgprot_t;
 
 #define pte_val(x)	((x).pte)
+#ifdef __LP64__
+#define pte_flags(x)	(*(__u32 *)&((x).pte))
+#else
+#define pte_flags(x)	((x).flags)
+#endif
 #define pmd_val(x)	((x).pmd)
 #define pgd_val(x)	((x).pgd)
 #define pgprot_val(x)	((x).pgprot)
@@ -84,14 +99,43 @@ extern int npmem_ranges;
 
 #endif /* !__ASSEMBLY__ */
 
+/* WARNING: The definitions below must match exactly to sizeof(pte_t)
+ * etc
+ */
+#ifdef __LP64__
+#define BITS_PER_PTE_ENTRY	3
+#define BITS_PER_PMD_ENTRY	2
+#define BITS_PER_PGD_ENTRY	2
+#else
+#define BITS_PER_PTE_ENTRY	3
+#define BITS_PER_PMD_ENTRY	2
+#define BITS_PER_PGD_ENTRY	BITS_PER_PMD_ENTRY
+#endif
+#define PGD_ENTRY_SIZE	(1UL << BITS_PER_PGD_ENTRY)
+#define PMD_ENTRY_SIZE	(1UL << BITS_PER_PMD_ENTRY)
+#define PTE_ENTRY_SIZE	(1UL << BITS_PER_PTE_ENTRY)
+
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
 
 
 #define LINUX_GATEWAY_SPACE     0
+
+/* This governs the relationship between virtual and physical addresses.
+ * If you alter it, make sure to take care of our various fixed mapping
+ * segments in fixmap.h */
 #define __PAGE_OFFSET           (0x10000000)
 
 #define PAGE_OFFSET		((unsigned long)__PAGE_OFFSET)
+
+/* The size of the gateway page (we leave lots of room for expansion) */
+#define GATEWAY_PAGE_SIZE	0x4000
+
+/* The start of the actual kernel binary---used in vmlinux.lds.S
+ * Leave some space after __PAGE_OFFSET for detecting kernel null
+ * ptr derefs */
+#define KERNEL_BINARY_TEXT_START	(__PAGE_OFFSET + 0x100000)
+
 /* These macros don't work for 64-bit C code -- don't allow in C at all */
 #ifdef __ASSEMBLY__
 #   define PA(x)	((x)-__PAGE_OFFSET)
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h
index c49f73b18..990ddd36d 100644
--- a/include/asm-parisc/pdc.h
+++ b/include/asm-parisc/pdc.h
@@ -953,6 +953,7 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
 		struct pdc_memory_table *tbl, unsigned long entries);
 #endif
 
+void set_firmware_width(void);
 int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
 int pdc_do_reset(void);
 int pdc_soft_power_info(unsigned long *power_reg);
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index eb97d25ff..7b2a36c9d 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -10,39 +10,75 @@
 #include <asm/pgtable.h>
 #include <asm/cache.h>
 
+/* Allocate the top level pgd (page directory)
+ *
+ * Here (for 64 bit kernels) we implement a Hybrid L2/L3 scheme: we
+ * allocate the first pmd adjacent to the pgd.  This means that we can
+ * subtract a constant offset to get to it.  The pmd and pgd sizes are
+ * arranged so that a single pmd covers 4GB (giving a full LP64
+ * process access to 8TB) so our lookups are effectively L2 for the
+ * first 4GB of the kernel (i.e. for all ILP32 processes and all the
+ * kernel for machines with under 4GB of memory) */
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL);
-	if (likely(pgd != NULL))
-		clear_page(pgd);
-	return pgd;
+	pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL|GFP_DMA,
+					       PGD_ALLOC_ORDER);
+	pgd_t *actual_pgd = pgd;
+
+	if (likely(pgd != NULL)) {
+		memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER);
+#ifdef __LP64__
+		actual_pgd += PTRS_PER_PGD;
+		/* Populate first pmd with allocated memory.  We mark it
+		 * with _PAGE_GATEWAY as a signal to the system that this
+		 * pmd entry may not be cleared. */
+		pgd_val(*actual_pgd) = (_PAGE_TABLE | _PAGE_GATEWAY) + 
+			(__u32)__pa((unsigned long)pgd);
+		/* The first pmd entry also is marked with _PAGE_GATEWAY as
+		 * a signal that this pmd may not be freed */
+		pgd_val(*pgd) = _PAGE_GATEWAY;
+#endif
+	}
+	return actual_pgd;
 }
 
 static inline void pgd_free(pgd_t *pgd)
 {
-	free_page((unsigned long)pgd);
+#ifdef __LP64__
+	pgd -= PTRS_PER_PGD;
+#endif
+	free_pages((unsigned long)pgd, PGD_ALLOC_ORDER);
 }
 
-#ifdef __LP64__
+#if PT_NLEVELS == 3
 
 /* Three Level Page Table Support for pmd's */
 
 static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
 {
-	pgd_val(*pgd) = _PAGE_TABLE + __pa((unsigned long)pmd);
+	pgd_val(*pgd) = _PAGE_TABLE + (__u32)__pa((unsigned long)pmd);
 }
 
+/* NOTE: pmd must be in ZONE_DMA (<4GB) so the pgd pointer can be
+ * housed in 32 bits */
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *pmd = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	pmd_t *pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT|GFP_DMA,
+					       PMD_ORDER);
 	if (pmd)
-		clear_page(pmd);
+		memset(pmd, 0, PAGE_SIZE<<PMD_ORDER);
 	return pmd;
 }
 
 static inline void pmd_free(pmd_t *pmd)
 {
-	free_page((unsigned long)pmd);
+#ifdef __LP64__
+	if(pmd_val(*pmd) & _PAGE_GATEWAY)
+		/* This is the permanent pmd attached to the pgd;
+		 * cannot free it */
+		return;
+#endif
+	free_pages((unsigned long)pmd, PMD_ORDER);
 }
 
 #else
@@ -63,16 +99,26 @@ static inline void pmd_free(pmd_t *pmd)
 static inline void
 pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
 {
-	pmd_val(*pmd) = _PAGE_TABLE + __pa((unsigned long)pte);
+#ifdef __LP64__
+	/* preserve the gateway marker if this is the beginning of
+	 * the permanent pmd */
+	if(pmd_val(*pmd) & _PAGE_GATEWAY)
+		pmd_val(*pmd) = (_PAGE_TABLE | _PAGE_GATEWAY)
+			+ (__u32)__pa((unsigned long)pte);
+	else
+#endif
+		pmd_val(*pmd) = _PAGE_TABLE + (__u32)__pa((unsigned long)pte);
 }
 
 #define pmd_populate(mm, pmd, pte_page) \
 	pmd_populate_kernel(mm, pmd, page_address(pte_page))
 
+/* NOTE: pte must be in ZONE_DMA (<4GB) so that the pmd pointer
+ * can be housed in 32 bits */
 static inline struct page *
 pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
+	struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT|GFP_DMA);
 	if (likely(page != NULL))
 		clear_page(page_address(page));
 	return page;
@@ -81,7 +127,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
 {
-	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|GFP_DMA);
 	if (likely(pte != NULL))
 		clear_page(pte);
 	return pte;
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index 5d0b71ba3..cadae7fb3 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -43,9 +43,9 @@
 #define pte_ERROR(e) \
 	printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 #define pmd_ERROR(e) \
-	printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
+	printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, (unsigned long)pmd_val(e))
 #define pgd_ERROR(e) \
-	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
+	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))
 
  /* Note: If you change ISTACK_SIZE, you need to change the corresponding
   * values in vmlinux.lds and vmlinux64.lds (init_istack section). Also,
@@ -55,49 +55,59 @@
 #define  ISTACK_SIZE  32768 /* Interrupt Stack Size */
 #define  ISTACK_ORDER 3
 
-/*
- * NOTE: Many of the below macros use PT_NLEVELS because
- *       it is convenient that PT_NLEVELS == LOG2(pte size in bytes),
- *       i.e. we use 3 level page tables when we use 8 byte pte's
- *       (for 64 bit) and 2 level page tables when we use 4 byte pte's
- */
+/* This is the size of the initially mapped kernel memory (i.e. currently
+ * 0 to 1<<23 == 8MB */
+#define KERNEL_INITIAL_ORDER	23
+#define KERNEL_INITIAL_SIZE	(1 << KERNEL_INITIAL_ORDER)
 
 #ifdef __LP64__
-#define PT_NLEVELS 3
-#define PT_INITIAL 4 /* Number of initial page tables */
+#define PT_NLEVELS	3
+#define PGD_ORDER	1 /* Number of pages per pgd */
+#define PMD_ORDER	1 /* Number of pages per pmd */
+#define PGD_ALLOC_ORDER	2 /* first pgd contains pmd */
 #else
-#define PT_NLEVELS 2
-#define PT_INITIAL 2 /* Number of initial page tables */
+#define PT_NLEVELS	2
+#define PGD_ORDER	1 /* Number of pages per pgd */
+#define PGD_ALLOC_ORDER	PGD_ORDER
 #endif
 
-#define MAX_ADDRBITS (PAGE_SHIFT + (PT_NLEVELS)*(PAGE_SHIFT - PT_NLEVELS))
-#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
-
-#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
-
-/* Definitions for 1st level */
-
-#define PGDIR_SHIFT  (PAGE_SHIFT + (PT_NLEVELS - 1)*(PAGE_SHIFT - PT_NLEVELS))
-#define PGDIR_SIZE	(1UL << PGDIR_SHIFT)
-#define PGDIR_MASK	(~(PGDIR_SIZE-1))
-#define PTRS_PER_PGD    (1UL << (PAGE_SHIFT - PT_NLEVELS))
-#define USER_PTRS_PER_PGD       PTRS_PER_PGD
+/* Definitions for 3rd level (we use PLD here for Page Lower directory
+ * because PTE_SHIFT is used lower down to mean shift that has to be
+ * done to get usable bits out of the PTE) */
+#define PLD_SHIFT	PAGE_SHIFT
+#define PLD_SIZE	PAGE_SIZE
+#define BITS_PER_PTE	(PAGE_SHIFT - BITS_PER_PTE_ENTRY)
+#define PTRS_PER_PTE    (1UL << BITS_PER_PTE)
 
 /* Definitions for 2nd level */
 #define pgtable_cache_init()	do { } while (0)
 
-#define PMD_SHIFT       (PAGE_SHIFT + (PAGE_SHIFT - PT_NLEVELS))
+#define PMD_SHIFT       (PLD_SHIFT + BITS_PER_PTE)
 #define PMD_SIZE	(1UL << PMD_SHIFT)
 #define PMD_MASK	(~(PMD_SIZE-1))
 #if PT_NLEVELS == 3
-#define PTRS_PER_PMD    (1UL << (PAGE_SHIFT - PT_NLEVELS))
+#define BITS_PER_PMD	(PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY)
 #else
-#define PTRS_PER_PMD    1
+#define BITS_PER_PMD	0
 #endif
+#define PTRS_PER_PMD    (1UL << BITS_PER_PMD)
+
+/* Definitions for 1st level */
+#define PGDIR_SHIFT	(PMD_SHIFT + BITS_PER_PMD)
+#define BITS_PER_PGD	(PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY)
+#define PGDIR_SIZE	(1UL << PGDIR_SHIFT)
+#define PGDIR_MASK	(~(PGDIR_SIZE-1))
+#define PTRS_PER_PGD    (1UL << BITS_PER_PGD)
+#define USER_PTRS_PER_PGD       PTRS_PER_PGD
 
-/* Definitions for 3rd level */
+#define MAX_ADDRBITS	(PGDIR_SHIFT + BITS_PER_PGD)
+#define MAX_ADDRESS	(1UL << MAX_ADDRBITS)
+
+#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
 
-#define PTRS_PER_PTE    (1UL << (PAGE_SHIFT - PT_NLEVELS))
+/* This calculates the number of initial pages we need for the initial
+ * page tables */
+#define PT_INITIAL	(1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT))
 
 /*
  * pgd entries used up by user/kernel:
@@ -110,7 +120,7 @@ extern  void *vmalloc_start;
 #define PCXL_DMA_MAP_SIZE   (8*1024*1024)
 #define VMALLOC_START   ((unsigned long)vmalloc_start)
 /* this is a fixmap remnant, see fixmap.h */
-#define VMALLOC_END	(TMPALIAS_MAP_START)
+#define VMALLOC_END	(KERNEL_MAP_END)
 #endif
 
 /* NB: The tlb miss handlers make certain assumptions about the order */
@@ -217,7 +227,7 @@ extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */
 
 /* initial page tables for 0-8MB for kernel */
 
-extern unsigned long pg0[];
+extern pte_t pg0[];
 
 /* zero page used for uninitialized stuff */
 
@@ -234,22 +244,50 @@ extern unsigned long *empty_zero_page;
 #define pte_present(x)	(pte_val(x) & _PAGE_PRESENT)
 #define pte_clear(xp)	do { pte_val(*(xp)) = 0; } while (0)
 
+#ifdef __LP64__
+/* The first entry of the permanent pmd is not there if it contains
+ * the gateway marker */
+#define pmd_none(x)	(!pmd_val(x) || pmd_val(x) == _PAGE_GATEWAY)
+#define pmd_bad(x)	((pmd_val(x) & ~PAGE_MASK) != _PAGE_TABLE && (pmd_val(x) & ~PAGE_MASK) != (_PAGE_TABLE | _PAGE_GATEWAY))
+#else
 #define pmd_none(x)	(!pmd_val(x))
 #define pmd_bad(x)	((pmd_val(x) & ~PAGE_MASK) != _PAGE_TABLE)
+#endif
 #define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
-#define pmd_clear(xp)	do { pmd_val(*(xp)) = 0; } while (0)
+static inline void pmd_clear(pmd_t *pmd) {
+#ifdef __LP64__
+	if(pmd_val(*pmd) & _PAGE_GATEWAY)
+		/* This is the entry pointing to the permanent pmd
+		 * attached to the pgd; cannot clear it */
+		pmd_val(*pmd) = _PAGE_GATEWAY;
+	else
+#endif
+		pmd_val(*pmd) = 0;
+}
 
 
 
-#ifdef __LP64__
+#if PT_NLEVELS == 3
 #define pgd_page(pgd) ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
 
 /* For 64 bit we have three level tables */
 
 #define pgd_none(x)     (!pgd_val(x))
+#ifdef __LP64__
+#define pgd_bad(x)      ((pgd_val(x) & ~PAGE_MASK) != _PAGE_TABLE && (pgd_val(x) & ~PAGE_MASK) != (_PAGE_TABLE | _PAGE_GATEWAY))
+#else
 #define pgd_bad(x)      ((pgd_val(x) & ~PAGE_MASK) != _PAGE_TABLE)
+#endif
 #define pgd_present(x)  (pgd_val(x) & _PAGE_PRESENT)
-#define pgd_clear(xp)   do { pgd_val(*(xp)) = 0; } while (0)
+static inline void pgd_clear(pgd_t *pgd) {
+#ifdef __LP64__
+	if(pgd_val(*pgd) & _PAGE_GATEWAY)
+		/* This is the permanent pmd attached to the pgd; cannot
+		 * free it */
+		return;
+#endif
+	pgd_val(*pgd) = 0;
+}
 #else
 /*
  * The "pgd_xxx()" functions here are trivial for a folded two-level
@@ -337,7 +375,7 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 
 /* Find an entry in the second-level page table.. */
 
-#ifdef __LP64__
+#if PT_NLEVELS == 3
 #define pmd_offset(dir,address) \
 ((pmd_t *) pgd_page(*(dir)) + (((address)>>PMD_SHIFT) & (PTRS_PER_PMD-1)))
 #else
@@ -450,8 +488,6 @@ static inline void ptep_mkdirty(pte_t *ptep)
 
 #define pte_same(A,B)	(pte_val(A) == pte_val(B))
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 #define io_remap_page_range remap_page_range
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index 3f407809b..1a886a0f6 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -52,11 +52,11 @@
 #ifndef __ASSEMBLY__
 
 /*
-** Data detected about CPUs at boot time which is the same for all CPU's.
-** HP boxes are SMP - ie identical processors.
-**
-** FIXME: some CPU rev info may be processor specific...
-*/
+ * Data detected about CPUs at boot time which is the same for all CPU's.
+ * HP boxes are SMP - ie identical processors.
+ *
+ * FIXME: some CPU rev info may be processor specific...
+ */
 struct system_cpuinfo_parisc {
 	unsigned int	cpu_count;
 	unsigned int	cpu_hz;
@@ -77,9 +77,7 @@ struct system_cpuinfo_parisc {
 };
 
 
-/*
-** Per CPU data structure - ie varies per CPU.
-*/
+/* Per CPU data structure - ie varies per CPU.  */
 struct cpuinfo_parisc {
 	unsigned long it_value;     /* Interval Timer at last timer Intr */
 	unsigned long it_delta;     /* Interval delta (tic_10ms / HZ * 100) */
@@ -116,6 +114,8 @@ typedef struct {
 	int seg;  
 } mm_segment_t;
 
+#define ARCH_MIN_TASKALIGN	8
+
 struct thread_struct {
 	struct pt_regs regs;
 	unsigned long  task_size;
@@ -309,22 +309,31 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
 
 extern void map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm);
 
-static inline unsigned long get_wchan(struct task_struct *p)
-{
-	return 0xdeadbeef; /* XXX */
-}
+extern unsigned long get_wchan(struct task_struct *p);
 
 #define KSTK_EIP(tsk)	((tsk)->thread.regs.iaoq[0])
 #define KSTK_ESP(tsk)	((tsk)->thread.regs.gr[30])
 
-#ifdef  CONFIG_PA20
+
+/*
+ * PA 2.0 defines data prefetch instructions on page 6-11 of the Kane book.
+ * In addition, many implementations do hardware prefetching of both
+ * instructions and data.
+ *
+ * PA7300LC (page 14-4 of the ERS) also implements prefetching by a load
+ * to gr0 but not in a way that Linux can use.  If the load would cause an
+ * interruption (eg due to prefetching 0), it is suppressed on PA2.0
+ * processors, but not on 7300LC.
+ */
+#ifdef  CONFIG_PREFETCH
 #define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCHW
+
 extern inline void prefetch(const void *addr)
 {
 	__asm__("ldw 0(%0), %%r0" : : "r" (addr));
 }
 
-#define ARCH_HAS_PREFETCHW
 extern inline void prefetchw(const void *addr)
 {
 	__asm__("ldd 0(%0), %%r0" : : "r" (addr));
diff --git a/include/asm-parisc/smp.h b/include/asm-parisc/smp.h
index 83e720f79..1efee5886 100644
--- a/include/asm-parisc/smp.h
+++ b/include/asm-parisc/smp.h
@@ -52,9 +52,7 @@ extern void smp_send_reschedule(int cpu);
 extern unsigned long cpu_present_mask;
 
 #define smp_processor_id()	(current_thread_info()->cpu)
-#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
-
-#define cpu_possible_map	cpu_present_map
+#define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
 
 #endif /* CONFIG_SMP */
 
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h
index a114d46d6..1ad3aaa6d 100644
--- a/include/asm-parisc/spinlock.h
+++ b/include/asm-parisc/spinlock.h
@@ -4,35 +4,43 @@
 #include <asm/system.h>
 
 /* Note that PA-RISC has to use `1' to mean unlocked and `0' to mean locked
- * since it only has load-and-zero.
+ * since it only has load-and-zero. Moreover, at least on some PA processors,
+ * the semaphore address has to be 16-byte aligned.
  */
 
 #undef SPIN_LOCK_UNLOCKED
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { { 1, 1, 1, 1 } }
 
-#define spin_lock_init(x)	do { (x)->lock = 1; } while(0)
+#define spin_lock_init(x)	do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
 
-#define spin_is_locked(x) ((x)->lock == 0)
-
-#define spin_unlock_wait(x)	do { barrier(); } while(((volatile spinlock_t *)(x))->lock == 0)
-
-#if 1
-#define _raw_spin_lock(x) do { \
-	while (__ldcw (&(x)->lock) == 0) \
-		while (((x)->lock) == 0) ; } while (0)
-
-#else
-#define _raw_spin_lock(x) \
-	do { while(__ldcw(&(x)->lock) == 0); } while(0)
-#endif
-	
-#define _raw_spin_unlock(x) \
-	do { (x)->lock = 1; } while(0)
+static inline int spin_is_locked(spinlock_t *x)
+{
+	volatile unsigned int *a = __ldcw_align(x);
+	return *a == 0;
+}
 
-#define _raw_spin_trylock(x) (__ldcw(&(x)->lock) != 0)
+#define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
+static inline void _raw_spin_lock(spinlock_t *x)
+{
+	volatile unsigned int *a = __ldcw_align(x);
+	while (__ldcw(a) == 0)
+		while (*a == 0);
+}
 
+static inline void _raw_spin_unlock(spinlock_t *x)
+{
+	volatile unsigned int *a = __ldcw_align(x);
+	*a = 1;
+}
 
+static inline int _raw_spin_trylock(spinlock_t *x)
+{
+	volatile unsigned int *a = __ldcw_align(x);
+	return __ldcw(a) != 0;
+}
+	
 /*
  * Read-write spinlocks, allowing multiple readers
  * but only one writer.
@@ -42,7 +50,7 @@ typedef struct {
 	volatile int counter;
 } rwlock_t;
 
-#define RW_LOCK_UNLOCKED (rwlock_t) { {1}, 0 }
+#define RW_LOCK_UNLOCKED (rwlock_t) { { { 1, 1, 1, 1 } }, 0 }
 
 #define rwlock_init(lp)	do { *(lp) = RW_LOCK_UNLOCKED; } while (0)
 
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 318a3deaa..d73c20d42 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -145,6 +145,19 @@ static inline void set_eiem(unsigned long val)
 	__ret; \
 })
 
+/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
+   and GCC only guarantees 8-byte alignment for stack locals, we can't
+   be assured of 16-byte alignment for atomic lock data even if we
+   specify "__attribute ((aligned(16)))" in the type declaration.  So,
+   we use a struct containing an array of four ints for the atomic lock
+   type and dynamically select the 16-byte aligned int from the array
+   for the semaphore.  */
+#define __PA_LDCW_ALIGNMENT 16
+#define __ldcw_align(a) ({ \
+  unsigned long __ret = (unsigned long) a;                     		\
+  __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \
+  (volatile unsigned int *) __ret;                                      \
+})
 
 #ifdef CONFIG_SMP
 /*
@@ -152,8 +165,13 @@ static inline void set_eiem(unsigned long val)
  */
 
 typedef struct {
-	volatile unsigned int __attribute__((aligned(16))) lock;
+	volatile unsigned int lock[4];
 } spinlock_t;
+
+#define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
+
 #endif
 
+#define KERNEL_START (0x10100000 - 0x1000)
+
 #endif
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index d21b9d0d6..8fe7a44ea 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -56,6 +56,8 @@ typedef unsigned long long u64;
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index d810f2ba5..72b457db1 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -700,124 +700,176 @@
 #define __NR_acl_set            (__NR_Linux + 205)
 #define __NR_gettid             (__NR_Linux + 206)
 #define __NR_readahead          (__NR_Linux + 207)
-#define __NR_tkill		(__NR_Linux + 208)
-#define __NR_sendfile64		(__NR_Linux + 209)
-#define __NR_futex		(__NR_Linux + 210)
-#define __NR_sched_setaffinity	(__NR_Linux + 211)
-#define __NR_sched_getaffinity	(__NR_Linux + 212)
-#define __NR_set_thread_area	(__NR_Linux + 213)
-#define __NR_get_thread_area	(__NR_Linux + 214)
-#define __NR_io_setup		(__NR_Linux + 215)
-#define __NR_io_destroy		(__NR_Linux + 216)
-#define __NR_io_getevents	(__NR_Linux + 217)
-#define __NR_io_submit		(__NR_Linux + 218)
-#define __NR_io_cancel		(__NR_Linux + 219)
-#define __NR_alloc_hugepages	(__NR_Linux + 220)
-#define __NR_free_hugepages	(__NR_Linux + 221)
-#define __NR_exit_group		(__NR_Linux + 222)
-#define __NR_lookup_dcookie	(__NR_Linux + 223)
-#define __NR_epoll_create	(__NR_Linux + 224)
-#define __NR_epoll_ctl		(__NR_Linux + 225)
-#define __NR_epoll_wait		(__NR_Linux + 226)
-#define __NR_remap_file_pages	(__NR_Linux + 227)
-#define __NR_semtimedop		(__NR_Linux + 228)
-
-
-#define __NR_Linux_syscalls     228
+#define __NR_tkill              (__NR_Linux + 208)
+#define __NR_sendfile64         (__NR_Linux + 209)
+#define __NR_futex              (__NR_Linux + 210)
+#define __NR_sched_setaffinity  (__NR_Linux + 211)
+#define __NR_sched_getaffinity  (__NR_Linux + 212)
+#define __NR_set_thread_area    (__NR_Linux + 213)
+#define __NR_get_thread_area    (__NR_Linux + 214)
+#define __NR_io_setup           (__NR_Linux + 215)
+#define __NR_io_destroy         (__NR_Linux + 216)
+#define __NR_io_getevents       (__NR_Linux + 217)
+#define __NR_io_submit          (__NR_Linux + 218)
+#define __NR_io_cancel          (__NR_Linux + 219)
+#define __NR_alloc_hugepages    (__NR_Linux + 220)
+#define __NR_free_hugepages     (__NR_Linux + 221)
+#define __NR_exit_group         (__NR_Linux + 222)
+#define __NR_lookup_dcookie     (__NR_Linux + 223)
+#define __NR_epoll_create       (__NR_Linux + 224)
+#define __NR_epoll_ctl          (__NR_Linux + 225)
+#define __NR_epoll_wait         (__NR_Linux + 226)
+#define __NR_remap_file_pages   (__NR_Linux + 227)
+#define __NR_semtimedop         (__NR_Linux + 228)
+#define __NR_mq_open            (__NR_Linux + 229) /* Keep the mq_* syscalls together */
+#define __NR_mq_unlink          (__NR_Linux + 230)
+#define __NR_mq_timedsend       (__NR_Linux + 231)
+#define __NR_mq_timedreceive    (__NR_Linux + 232)
+#define __NR_mq_notify          (__NR_Linux + 233)
+#define __NR_mq_getsetattr      (__NR_Linux + 234)
+
+#define __NR_Linux_syscalls     235
 
 #define HPUX_GATEWAY_ADDR       0xC0000004
 #define LINUX_GATEWAY_ADDR      0x100
 
 #ifndef __ASSEMBLY__
 
-/* The old syscall code here didn't work, and it looks like it's only used
- * by applications such as fdisk which for some reason need to produce
- * their own syscall instead of using same from libc.  The code below
- * is leveraged from glibc/sysdeps/unix/sysv/linux/hppa/sysdep.h where
- * it is essentially duplicated -- which sucks.  -PB
- */
-
 #define SYS_ify(syscall_name)   __NR_##syscall_name
 
-/* The system call number MUST ALWAYS be loaded in the delay slot of
-   the ble instruction, or restarting system calls WILL NOT WORK.  See
-   arch/parisc/kernel/signal.c - dhd, 2000-07-26 */
-#define K_INLINE_SYSCALL(name, nr, args...)       ({              \
-        unsigned long __sys_res;                                \
-        {                                                       \
-                register unsigned long __res asm("r28");        \
-                K_LOAD_ARGS_##nr(args)                            \
-                asm volatile(                                   \
-			"ble  0x100(%%sr2, %%r0)\n\t"           \
-                        " ldi %1, %%r20"                        \
-                        : "=r" (__res)                          \
-                        : "i" (SYS_ify(name)) K_ASM_ARGS_##nr   \
-			  );                                    \
-                __sys_res = __res;                              \
-        }                                                       \
-        if (__sys_res >= (unsigned long)-4095) {                \
-		errno = -__sys_res;				\
-                __sys_res = (unsigned long)-1;                 \
-        }                                                       \
-        __sys_res;                                              \
+/* Assume all syscalls are done from PIC code just to be
+ * safe. The worst case scenario is that you lose a register
+ * and save/restore r19 across the syscall. */
+#define PIC
+
+#ifndef ASM_LINE_SEP
+# define ASM_LINE_SEP ;
+#endif
+
+/* Definition taken from glibc 2.3.3
+ * sysdeps/unix/sysv/linux/hppa/sysdep.h
+ */
+
+#ifdef PIC
+/* WARNING: CANNOT BE USED IN A NOP! */
+# define K_STW_PIC stw %r19, -32(%sr0, %sp) ASM_LINE_SEP
+# define K_LDW_PIC ldw -32(%sr0, %sp), %r19 ASM_LINE_SEP
+# define K_STW_ASM_PIC	"       copy %%r19, %%r4\n"
+# define K_LDW_ASM_PIC	"       copy %%r4, %%r19\n"
+# define K_USING_GR4	"%r4",
+#else
+# define K_STW_PIC ASM_LINE_SEP
+# define K_LDW_PIC ASM_LINE_SEP
+# define K_STW_ASM_PIC	" \n"
+# define K_LDW_ASM_PIC	" \n"
+# define K_USING_GR4
+#endif
+
+/* GCC has to be warned that a syscall may clobber all the ABI
+   registers listed as "caller-saves", see page 8, Table 2
+   in section 2.2.6 of the PA-RISC RUN-TIME architecture
+   document. However! r28 is the result and will conflict with
+   the clobber list so it is left out. Also the input arguments
+   registers r20 -> r26 will conflict with the list so they
+   are treated specially. Although r19 is clobbered by the syscall
+   we cannot say this because it would violate ABI, thus we say
+   r4 is clobbered and use that register to save/restore r19
+   across the syscall. */
+
+#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
+	        	 "%r20", "%r29", "%r31"
+
+#undef K_INLINE_SYSCALL
+#define K_INLINE_SYSCALL(name, nr, args...)	({			\
+	long __sys_res;							\
+	{								\
+		register unsigned long __res asm("r28");		\
+		K_LOAD_ARGS_##nr(args)					\
+		/* FIXME: HACK stw/ldw r19 around syscall */		\
+		asm volatile(						\
+			K_STW_ASM_PIC					\
+			"	ble  0x100(%%sr2, %%r0)\n"		\
+			"	ldi %1, %%r20\n"			\
+			K_LDW_ASM_PIC					\
+			: "=r" (__res)					\
+			: "i" (SYS_ify(name)) K_ASM_ARGS_##nr   	\
+			: K_CALL_CLOB_REGS K_CLOB_ARGS_##nr		\
+		);							\
+		__sys_res = (long)__res;				\
+	}								\
+	if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){	\
+		errno = -__sys_res);		        		\
+		__sys_res = -1;						\
+	}								\
+	__sys_res;							\
 })
 
 #define K_LOAD_ARGS_0()
-#define K_LOAD_ARGS_1(r26)                                        \
-        register unsigned long __r26 __asm__("r26") = (unsigned long)r26;       \
-        K_LOAD_ARGS_0()
-#define K_LOAD_ARGS_2(r26,r25)                                    \
-        register unsigned long __r25 __asm__("r25") = (unsigned long)r25;       \
-        K_LOAD_ARGS_1(r26)
-#define K_LOAD_ARGS_3(r26,r25,r24)                                \
-        register unsigned long __r24 __asm__("r24") = (unsigned long)r24;       \
-        K_LOAD_ARGS_2(r26,r25)
-#define K_LOAD_ARGS_4(r26,r25,r24,r23)                            \
-        register unsigned long __r23 __asm__("r23") = (unsigned long)r23;       \
-        K_LOAD_ARGS_3(r26,r25,r24)
-#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22)                        \
-        register unsigned long __r22 __asm__("r22") = (unsigned long)r22;       \
-        K_LOAD_ARGS_4(r26,r25,r24,r23)
-#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)                    \
-        register unsigned long __r21 __asm__("r21") = (unsigned long)r21;       \
-        K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
-
+#define K_LOAD_ARGS_1(r26)					\
+	register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \
+	K_LOAD_ARGS_0()
+#define K_LOAD_ARGS_2(r26,r25)					\
+	register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);   \
+	K_LOAD_ARGS_1(r26)
+#define K_LOAD_ARGS_3(r26,r25,r24)				\
+	register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);   \
+	K_LOAD_ARGS_2(r26,r25)
+#define K_LOAD_ARGS_4(r26,r25,r24,r23)				\
+	register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);   \
+	K_LOAD_ARGS_3(r26,r25,r24)
+#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22)			\
+	register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);   \
+	K_LOAD_ARGS_4(r26,r25,r24,r23)
+#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)			\
+	register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);   \
+	K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
+
+/* Even with zero args we use r20 for the syscall number */
 #define K_ASM_ARGS_0
-#define K_ASM_ARGS_1 , "r" (__r26)
-#define K_ASM_ARGS_2 , "r" (__r26), "r" (__r25)
-#define K_ASM_ARGS_3 , "r" (__r26), "r" (__r25), "r" (__r24)
-#define K_ASM_ARGS_4 , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23)
-#define K_ASM_ARGS_5 , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23), "r" (__r22)
-#define K_ASM_ARGS_6 , "r" (__r26), "r" (__r25), "r" (__r24), "r" (__r23), "r" (__r22), "r" (__r21)
-
-#define _syscall0(type,name)						      \
-type name(void)								      \
-{									      \
-    return K_INLINE_SYSCALL(name, 0);	\
+#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
+#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
+#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
+#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
+#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
+#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
+
+/* The registers not listed as inputs but clobbered */
+#define K_CLOB_ARGS_6
+#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
+#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
+#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
+#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
+#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
+#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
+
+#define _syscall0(type,name)						\
+type name(void)								\
+{									\
+    return K_INLINE_SYSCALL(name, 0);	                                \
 }
 
-#define _syscall1(type,name,type1,arg1)					      \
-type name(type1 arg1)							      \
-{									      \
-    return K_INLINE_SYSCALL(name, 1, arg1);	\
+#define _syscall1(type,name,type1,arg1)					\
+type name(type1 arg1)							\
+{									\
+    return K_INLINE_SYSCALL(name, 1, arg1);	                        \
 }
 
-#define _syscall2(type,name,type1,arg1,type2,arg2)			      \
-type name(type1 arg1, type2 arg2)					      \
-{									      \
-    return K_INLINE_SYSCALL(name, 2, arg1, arg2);	\
+#define _syscall2(type,name,type1,arg1,type2,arg2)			\
+type name(type1 arg1, type2 arg2)					\
+{									\
+    return K_INLINE_SYSCALL(name, 2, arg1, arg2);	                \
 }
 
-#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)		      \
-type name(type1 arg1, type2 arg2, type3 arg3)				      \
-{									      \
-    return K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3);	\
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)		\
+type name(type1 arg1, type2 arg2, type3 arg3)				\
+{									\
+    return K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3);	                \
 }
 
-#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)      \
-type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		      \
-{									      \
-    return K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4);	\
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
+{									\
+    return K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4);	        \
 }
 
 /* select takes 5 arguments */
@@ -827,16 +879,36 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
     return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5);	\
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
 
 /* mmap & mmap2 take 6 arguments */
-
 #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
-{									\
+{									        \
     return K_INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6);	\
 }
 
-
 #ifdef __KERNEL_SYSCALLS__
 
 #include <asm/current.h>
diff --git a/include/asm-ppc/atomic.h b/include/asm-ppc/atomic.h
index 6cd515b57..eeafd5058 100644
--- a/include/asm-ppc/atomic.h
+++ b/include/asm-ppc/atomic.h
@@ -134,6 +134,16 @@ static __inline__ int atomic_inc_return(atomic_t *v)
 	return t;
 }
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 static __inline__ void atomic_dec(atomic_t *v)
 {
 	int t;
diff --git a/include/asm-ppc/bug.h b/include/asm-ppc/bug.h
index ff3be2d38..6b2579d9d 100644
--- a/include/asm-ppc/bug.h
+++ b/include/asm-ppc/bug.h
@@ -23,26 +23,30 @@ struct bug_entry {
 		: : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
 } while (0)
 
-#define BUG_ON(x) do {						\
-	__asm__ __volatile__(					\
-		"1:	twnei %0,0\n"				\
-		".section __bug_table,\"a\"\n\t"		\
-		"	.long 1b,%1,%2,%3\n"			\
-		".previous"					\
-		: : "r" (x), "i" (__LINE__), "i" (__FILE__),	\
-		    "i" (__FUNCTION__));			\
+#define BUG_ON(x) do {							\
+	if (!__builtin_constant_p(x) || (x)) {				\
+		__asm__ __volatile__(					\
+			"1:	twnei %0,0\n"				\
+			".section __bug_table,\"a\"\n\t"		\
+			"	.long 1b,%1,%2,%3\n"			\
+			".previous"					\
+			: : "r" (x), "i" (__LINE__), "i" (__FILE__),	\
+			    "i" (__FUNCTION__));			\
+	}								\
 } while (0)
 
-#define PAGE_BUG(page) do { BUG(); } while (0)
+#define PAGE_BUG(page)	BUG()
 
-#define WARN_ON(x) do {						\
-	__asm__ __volatile__(					\
-		"1:	twnei %0,0\n"				\
-		".section __bug_table,\"a\"\n\t"		\
-		"	.long 1b,%1,%2,%3\n"			\
-		".previous"					\
-		: : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP),	\
-		    "i" (__FILE__), "i" (__FUNCTION__));	\
+#define WARN_ON(x) do {							\
+	if (!__builtin_constant_p(x) || (x)) {				\
+		__asm__ __volatile__(					\
+			"1:	twnei %0,0\n"				\
+			".section __bug_table,\"a\"\n\t"		\
+			"	.long 1b,%1,%2,%3\n"			\
+			".previous"					\
+			: : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP),	\
+			    "i" (__FILE__), "i" (__FUNCTION__));	\
+	}								\
 } while (0)
 
 #endif
diff --git a/include/asm-ppc/cacheflush.h b/include/asm-ppc/cacheflush.h
index e84fa9c09..7848d7130 100644
--- a/include/asm-ppc/cacheflush.h
+++ b/include/asm-ppc/cacheflush.h
@@ -28,6 +28,9 @@
 #define flush_cache_vunmap(start, end)	do { } while (0)
 
 extern void flush_dcache_page(struct page *page);
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
+
 extern void flush_icache_range(unsigned long, unsigned long);
 extern void flush_icache_user_range(struct vm_area_struct *vma,
 		struct page *page, unsigned long addr, int len);
@@ -41,6 +44,6 @@ do { memcpy(dst, src, len); \
 
 extern void __flush_dcache_icache(void *page_va);
 extern void __flush_dcache_icache_phys(unsigned long physaddr);
-
+extern void flush_dcache_icache_page(struct page *page);
 #endif /* _PPC_CACHEFLUSH_H */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h
index 80b5e0b9a..9be4f7297 100644
--- a/include/asm-ppc/dma-mapping.h
+++ b/include/asm-ppc/dma-mapping.h
@@ -6,15 +6,48 @@
 #define __ASM_PPC_DMA_MAPPING_H
 
 #include <linux/config.h>
-/* we implement the API below in terms of the existing PCI one,
- * so include it */
-#include <linux/pci.h>
 /* need struct page definitions */
 #include <linux/mm.h>
 #include <linux/device.h>
 #include <asm/scatterlist.h>
 #include <asm/io.h>
 
+#ifdef CONFIG_NOT_COHERENT_CACHE
+/*
+ * DMA-consistent mapping functions for PowerPCs that don't support
+ * cache snooping.  These allocate/free a region of uncached mapped
+ * memory space for use with DMA devices.  Alternatively, you could
+ * allocate the space "normally" and use the cache management functions
+ * to ensure it is consistent.
+ */
+extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, int gfp);
+extern void __dma_free_coherent(size_t size, void *vaddr);
+extern void __dma_sync(void *vaddr, size_t size, int direction);
+extern void __dma_sync_page(struct page *page, unsigned long offset,
+				 size_t size, int direction);
+#define dma_cache_inv(_start,_size) \
+	invalidate_dcache_range(_start, (_start + _size))
+#define dma_cache_wback(_start,_size) \
+	clean_dcache_range(_start, (_start + _size))
+#define dma_cache_wback_inv(_start,_size) \
+	flush_dcache_range(_start, (_start + _size))
+
+#else /* ! CONFIG_NOT_COHERENT_CACHE */
+/*
+ * Cache coherent cores.
+ */
+
+#define dma_cache_inv(_start,_size)		do { } while (0)
+#define dma_cache_wback(_start,_size)		do { } while (0)
+#define dma_cache_wback_inv(_start,_size)	do { } while (0)
+
+#define __dma_alloc_coherent(gfp, size, handle)	NULL
+#define __dma_free_coherent(size, addr)		do { } while (0)
+#define __dma_sync(addr, size, rw)		do { } while (0)
+#define __dma_sync_page(pg, off, sz, rw)	do { } while (0)
+
+#endif /* ! CONFIG_NOT_COHERENT_CACHE */
+
 #define dma_supported(dev, mask)	(1)
 
 static inline int dma_set_mask(struct device *dev, u64 dma_mask)
@@ -28,28 +61,38 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
 }
 
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,
-				       dma_addr_t * dma_handle, int flag)
+				       dma_addr_t * dma_handle, int gfp)
 {
-#ifdef CONFIG_PCI
-	if (dev && dev->bus == &pci_bus_type)
-		return pci_alloc_consistent(to_pci_dev(dev), size, dma_handle);
-#endif
+#ifdef CONFIG_NOT_COHERENT_CACHE
+	return __dma_alloc_coherent(size, dma_handle, gfp);
+#else
+	void *ret;
+	/* ignore region specifiers */
+	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
+
+	if (dev == NULL || dev->coherent_dma_mask < 0xffffffff)
+		gfp |= GFP_DMA;
+
+	ret = (void *)__get_free_pages(gfp, get_order(size));
 
-	return consistent_alloc(flag, size, dma_handle);
+	if (ret != NULL) {
+		memset(ret, 0, size);
+		*dma_handle = virt_to_bus(ret);
+	}
+
+	return ret;
+#endif
 }
 
 static inline void
 dma_free_coherent(struct device *dev, size_t size, void *vaddr,
 		  dma_addr_t dma_handle)
 {
-#ifdef CONFIG_PCI
-	if (dev && dev->bus == &pci_bus_type) {
-		pci_free_consistent(to_pci_dev(dev), size, vaddr, dma_handle);
-		return;
-	}
+#ifdef CONFIG_NOT_COHERENT_CACHE
+	__dma_free_coherent(size, vaddr);
+#else
+	free_pages((unsigned long)vaddr, get_order(size));
 #endif
-
-	consistent_free(vaddr);
 }
 
 static inline dma_addr_t
@@ -58,7 +101,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
 {
 	BUG_ON(direction == DMA_NONE);
 
-	consistent_sync(ptr, size, direction);
+	__dma_sync(ptr, size, direction);
 
 	return virt_to_bus(ptr);
 }
@@ -72,12 +115,14 @@ dma_map_page(struct device *dev, struct page *page,
 	     enum dma_data_direction direction)
 {
 	BUG_ON(direction == DMA_NONE);
-	consistent_sync_page(page, offset, size, direction);
+
+	__dma_sync_page(page, offset, size, direction);
+
 	return (page - mem_map) * PAGE_SIZE + PCI_DRAM_OFFSET + offset;
 }
 
 /* We do nothing. */
-#define dma_unmap_page(dev, addr, size, dir)	do { } while (0)
+#define dma_unmap_page(dev, handle, size, dir)	do { } while (0)
 
 static inline int
 dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
@@ -89,8 +134,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 	for (i = 0; i < nents; i++, sg++) {
 		BUG_ON(!sg->page);
-		consistent_sync_page(sg->page, sg->offset,
-				     sg->length, direction);
+		__dma_sync_page(sg->page, sg->offset, sg->length, direction);
 		sg->dma_address = page_to_bus(sg->page) + sg->offset;
 	}
 
@@ -107,50 +151,50 @@ dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
 {
 	BUG_ON(direction == DMA_NONE);
 
-	consistent_sync(bus_to_virt(dma_handle), size, direction);
+	__dma_sync(bus_to_virt(dma_handle), size, direction);
 }
 
 static inline void
 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
-			   size_t size,
-			   enum dma_data_direction direction)
+			size_t size,
+			enum dma_data_direction direction)
 {
 	BUG_ON(direction == DMA_NONE);
 
-	consistent_sync(bus_to_virt(dma_handle), size, direction);
+	__dma_sync(bus_to_virt(dma_handle), size, direction);
 }
 
 static inline void
-dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
-		    int nelems, enum dma_data_direction direction)
+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
+		    enum dma_data_direction direction)
 {
 	int i;
 
 	BUG_ON(direction == DMA_NONE);
 
-	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync_page(sg->page, sg->offset,
-				     sg->length, direction);
+	for (i = 0; i < nents; i++, sg++)
+		__dma_sync_page(sg->page, sg->offset, sg->length, direction);
 }
 
 static inline void
-dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
-		       int nelems, enum dma_data_direction direction)
+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
+		    enum dma_data_direction direction)
 {
 	int i;
 
 	BUG_ON(direction == DMA_NONE);
 
-	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync_page(sg->page, sg->offset,
-				     sg->length, direction);
+	for (i = 0; i < nents; i++, sg++)
+		__dma_sync_page(sg->page, sg->offset, sg->length, direction);
 }
 
-/* Now for the API extensions over the pci_ one */
-
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define dma_is_consistent(d)	(0)
+#else
 #define dma_is_consistent(d)	(1)
+#endif
 
 static inline int dma_get_cache_alignment(void)
 {
@@ -163,26 +207,26 @@ static inline int dma_get_cache_alignment(void)
 
 static inline void
 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
-			      unsigned long offset, size_t size,
-			      enum dma_data_direction direction)
+		      	      unsigned long offset, size_t size,
+		      	      enum dma_data_direction direction)
 {
-	/* just sync everything, that's all the pci API can do */
+	/* just sync everything for now */
 	dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction);
 }
 
 static inline void
 dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
-				 unsigned long offset, size_t size,
+		    		 unsigned long offset, size_t size,
 				 enum dma_data_direction direction)
 {
-	/* just sync everything, that's all the pci API can do */
+	/* just sync everything for now */
 	dma_sync_single_for_device(dev, dma_handle, offset + size, direction);
 }
 
 static inline void dma_cache_sync(void *vaddr, size_t size,
 				  enum dma_data_direction direction)
 {
-	consistent_sync(vaddr, size, (int)direction);
+	__dma_sync(vaddr, size, (int)direction);
 }
 
 static inline int dma_mapping_error(dma_addr_t dma_addr)
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h
index 8f4f12a46..2531c3bdb 100644
--- a/include/asm-ppc/hardirq.h
+++ b/include/asm-ppc/hardirq.h
@@ -83,11 +83,15 @@ typedef struct {
 
 #ifdef CONFIG_PREEMPT
 # define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
+# define preemptible()	(preempt_count() == 0 && !irqs_disabled())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
+
 #else
 # define in_atomic()	(preempt_count() != 0)
+# define preemptible()	0
 # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
 #endif
+
 #define irq_exit()							\
 do {									\
 	preempt_count() -= IRQ_EXIT_OFFSET;				\
diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h
index 2bfdad685..bed6a7e01 100644
--- a/include/asm-ppc/ibm44x.h
+++ b/include/asm-ppc/ibm44x.h
@@ -19,25 +19,6 @@
 
 #include <linux/config.h>
 
-#ifndef __ASSEMBLY__
-/*
- * Data structure defining board information maintained by the boot
- * ROM on IBM's "Ebony" evaluation board. An effort has been made to
- * keep the field names consistent with the 8xx 'bd_t' board info
- * structures.
- *
- * Ebony firmware stores MAC addresses in the F/W VPD area. The
- * firmware must store the other dynamic values in NVRAM like on
- * the previous 40x systems so they  should be accessible if we
- * really want them.
- */
-typedef struct board_info {
-	unsigned char	bi_enetaddr[2][6];	/* EMAC addresses */
-	unsigned int	bi_opb_busfreq;		/* OPB clock in Hz */
-	int		bi_iic_fast[2];		/* Use fast i2c mode */
-} bd_t;
-#endif /* __ASSEMBLY__ */
-
 #ifndef NR_BOARD_IRQS
 #define NR_BOARD_IRQS 0
 #endif
@@ -87,11 +68,35 @@ typedef struct board_info {
  */
 
 #ifdef CONFIG_440GX
+/* CPRs */
+#define DCRN_CPR_CONFIG_ADDR	0xc
+#define DCRN_CPR_CONFIG_DATA	0xd
+
+#define DCRN_CPR_CLKUPD		0x0020
+#define DCRN_CPR_PLLC		0x0040
+#define DCRN_CPR_PLLD		0x0060
+#define DCRN_CPR_PRIMAD		0x0080
+#define DCRN_CPR_PRIMBD		0x00a0
+#define DCRN_CPR_OPBD		0x00c0
+#define DCRN_CPR_PERD		0x00e0
+#define DCRN_CPR_MALD		0x0100
+
+/* CPRs read/write helper macros */
+#define CPR_READ(offset) ({\
+	mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \
+	mfdcr(DCRN_CPR_CONFIG_DATA);})
+#define CPR_WRITE(offset, data) ({\
+	mtdcr(DCRN_CPR_CONFIG_ADDR, offset); \
+	mtdcr(DCRN_CPR_CONFIG_DATA, data);})
+
 /* SDRs */
 #define DCRN_SDR_CONFIG_ADDR 	0xe
 #define DCRN_SDR_CONFIG_DATA	0xf
 #define DCRN_SDR_PFC0		0x4100
 #define DCRN_SDR_PFC1		0x4101
+#define DCRN_SDR_PFC1_EPS	0x1c000000
+#define DCRN_SDR_PFC1_EPS_SHIFT	26
+#define DCRN_SDR_PFC1_RMII	0x02000000
 #define DCRN_SDR_MFR		0x4300
 #define DCRN_SDR_MFR_TAH0 	0x80000000  	/* TAHOE0 Enable */
 #define DCRN_SDR_MFR_TAH1 	0x40000000  	/* TAHOE1 Enable */
@@ -117,6 +122,8 @@ typedef struct board_info {
 #define DCRN_SDR_MFR_E3TXFH	0x00000004
 #define DCRN_SDR_MFR_E3RXFL	0x00000002
 #define DCRN_SDR_MFR_E3RXFH	0x00000001
+#define DCRN_SDR_UART0		0x0120
+#define DCRN_SDR_UART1		0x0121
 
 /* SDR read/write helper macros */
 #define SDR_READ(offset) ({\
@@ -139,8 +146,12 @@ typedef struct board_info {
 /* UIC */
 #define DCRN_UIC0_BASE	0xc0
 #define DCRN_UIC1_BASE	0xd0
+#define DCRN_UIC2_BASE	0x210
+#define DCRN_UICB_BASE	0x200
 #define UIC0		DCRN_UIC0_BASE
 #define UIC1		DCRN_UIC1_BASE
+#define UIC2		DCRN_UIC2_BASE
+#define UICB		DCRN_UICB_BASE
 
 #define DCRN_UIC_SR(base)       (base + 0x0)
 #define DCRN_UIC_ER(base)       (base + 0x2)
@@ -151,8 +162,12 @@ typedef struct board_info {
 #define DCRN_UIC_VR(base)       (base + 0x7)
 #define DCRN_UIC_VCR(base)      (base + 0x8)
 
-#define UIC0_UIC1NC      30	/* UIC1 non-critical interrupt */
-#define UIC0_UIC1CR      31	/* UIC1 critical interrupt */
+#define UIC0_UIC1NC		30	/* UIC1 non-critical interrupt */
+#define UIC0_UIC1CR      	31	/* UIC1 critical interrupt */
+
+#define UICB_UIC0NC		0x40000000
+#define UICB_UIC1NC		0x10000000
+#define UICB_UIC2NC		0x04000000
 
 /* 440GP MAL DCRs */
 #define DCRN_MALCR(base)		(base + 0x0)	/* Configuration */
@@ -327,6 +342,81 @@ typedef struct board_info {
 #define PPC44x_MEM_SIZE_256M		0x10000000
 #define PPC44x_MEM_SIZE_512M		0x20000000
 
+#ifdef CONFIG_440GX
+/* Internal SRAM Controller */
+#define DCRN_SRAM0_SB0CR	0x020
+#define DCRN_SRAM0_SB1CR	0x021
+#define DCRN_SRAM0_SB2CR	0x022
+#define DCRN_SRAM0_SB3CR	0x023
+#define  SRAM_SBCR_BAS0		0x80000000
+#define  SRAM_SBCR_BAS1		0x80010000
+#define  SRAM_SBCR_BAS2		0x80020000
+#define  SRAM_SBCR_BAS3		0x80030000
+#define  SRAM_SBCR_BU_MASK	0x00000180
+#define  SRAM_SBCR_BS_64KB	0x00000800
+#define  SRAM_SBCR_BU_RO	0x00000080
+#define  SRAM_SBCR_BU_RW	0x00000180
+#define DCRN_SRAM0_BEAR		0x024
+#define DCRN_SRAM0_BESR0	0x025
+#define DCRN_SRAM0_BESR1	0x026
+#define DCRN_SRAM0_PMEG		0x027
+#define DCRN_SRAM0_CID		0x028
+#define DCRN_SRAM0_REVID	0x029
+#define DCRN_SRAM0_DPC		0x02a
+#define  SRAM_DPC_ENABLE	0x80000000
+
+/* L2 Cache Controller */
+#define DCRN_L2C0_CFG		0x030
+#define  L2C_CFG_L2M		0x80000000
+#define  L2C_CFG_ICU		0x40000000
+#define  L2C_CFG_DCU		0x20000000
+#define  L2C_CFG_DCW_MASK	0x1e000000
+#define  L2C_CFG_TPC		0x01000000
+#define  L2C_CFG_CPC		0x00800000
+#define  L2C_CFG_FRAN		0x00200000
+#define  L2C_CFG_SS_MASK	0x00180000
+#define  L2C_CFG_SS_256		0x00000000
+#define  L2C_CFG_CPIM		0x00040000
+#define  L2C_CFG_TPIM		0x00020000
+#define  L2C_CFG_LIM		0x00010000
+#define  L2C_CFG_PMUX_MASK	0x00007000
+#define  L2C_CFG_PMUX_SNP	0x00000000
+#define  L2C_CFG_PMUX_IF	0x00001000
+#define  L2C_CFG_PMUX_DF	0x00002000
+#define  L2C_CFG_PMUX_DS	0x00003000
+#define  L2C_CFG_PMIM		0x00000800
+#define  L2C_CFG_TPEI		0x00000400
+#define  L2C_CFG_CPEI		0x00000200
+#define  L2C_CFG_NAM		0x00000100
+#define  L2C_CFG_SMCM		0x00000080
+#define  L2C_CFG_NBRM		0x00000040
+#define DCRN_L2C0_CMD		0x031
+#define  L2C_CMD_CLR		0x80000000
+#define  L2C_CMD_DIAG		0x40000000
+#define  L2C_CMD_INV		0x20000000
+#define  L2C_CMD_CCP		0x10000000
+#define  L2C_CMD_CTE		0x08000000
+#define  L2C_CMD_STRC		0x04000000
+#define  L2C_CMD_STPC		0x02000000
+#define  L2C_CMD_RPMC		0x01000000
+#define  L2C_CMD_HCC		0x00800000
+#define DCRN_L2C0_ADDR		0x032
+#define DCRN_L2C0_DATA		0x033
+#define DCRN_L2C0_SR		0x034
+#define  L2C_SR_CC		0x80000000
+#define  L2C_SR_CPE		0x40000000
+#define  L2C_SR_TPE		0x20000000
+#define  L2C_SR_LRU		0x10000000
+#define  L2C_SR_PCS		0x08000000
+#define DCRN_L2C0_REVID		0x035
+#define DCRN_L2C0_SNP0		0x036
+#define DCRN_L2C0_SNP1		0x037
+#define  L2C_SNP_BA_MASK	0xffff0000
+#define  L2C_SNP_SSR_MASK	0x0000f000
+#define  L2C_SNP_SSR_32G	0x0000f000
+#define  L2C_SNP_ESR		0x00000800
+#endif /* CONFIG_440GX */
+
 /*
  * PCI-X definitions
  */
@@ -423,7 +513,11 @@ typedef struct board_info {
 #define IIC_CLOCK		50
 
 #undef NR_UICS
+#ifdef CONFIG_440GX
+#define NR_UICS 3
+#else
 #define NR_UICS 2
+#endif
 #define UIC_CASCADE_MASK	0x0003		/* bits 30 & 31 */
 
 #define BD_EMAC_ADDR(e,i) bi_enetaddr[e][i]
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index ea883c82a..cae365fa5 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -15,6 +15,7 @@
 #define __ASM_IBM4XX_H__
 
 #include <linux/config.h>
+#include <asm/types.h>
 
 #ifdef CONFIG_40x
 
@@ -22,8 +23,8 @@
 #include <platforms/4xx/ash.h>
 #endif
 
-#if defined (CONFIG_CEDAR)
-#include <platforms/4xx/cedar.h>
+#if defined(CONFIG_BUBINGA)
+#include <platforms/4xx/bubinga.h>
 #endif
 
 #if defined(CONFIG_CPCI405)
@@ -46,17 +47,27 @@
 #include <platforms/4xx/redwood5.h>
 #endif
 
+#if defined(CONFIG_REDWOOD_6)
+#include <platforms/4xx/redwood6.h>
+#endif
+
+#if defined(CONFIG_SYCAMORE)
+#include <platforms/4xx/sycamore.h>
+#endif
+
 #if defined(CONFIG_WALNUT)
 #include <platforms/4xx/walnut.h>
 #endif
 
 #ifndef __ASSEMBLY__
 
+#ifdef CONFIG_40x
 /*
  * The "residual" board information structure the boot loader passes
  * into the kernel.
  */
 extern bd_t __res;
+#endif
 
 void ppc4xx_setup_arch(void);
 void ppc4xx_map_io(void);
@@ -91,12 +102,14 @@ void ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
 #endif
 
 #ifndef __ASSEMBLY__
+#ifdef CONFIG_40x
 /*
  * The "residual" board information structure the boot loader passes
  * into the kernel.
  */
 extern bd_t __res;
 #endif
+#endif
 #endif /* CONFIG_40x */
 
 #endif /* __ASM_IBM4XX_H__ */
diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h
index 1393d51c3..6c091582d 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-ppc/ide.h
@@ -43,6 +43,8 @@ extern struct ide_machdep_calls ppc_ide_md;
 #undef	SUPPORT_SLOW_DATA_PORTS
 #define	SUPPORT_SLOW_DATA_PORTS	0
 
+#define IDE_ARCH_OBSOLETE_DEFAULTS
+
 static __inline__ int ide_default_irq(unsigned long base)
 {
 	if (ppc_ide_md.default_irq)
@@ -57,6 +59,9 @@ static __inline__ unsigned long ide_default_io_base(int index)
 	return 0;
 }
 
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+
 #ifdef CONFIG_PCI
 #define ide_init_default_irq(base)	(0)
 #else
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 8bfae0909..9cc9d5f99 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -388,43 +388,5 @@ static inline int isa_check_signature(unsigned long io_addr,
 	return 0;
 }
 
-#ifdef CONFIG_NOT_COHERENT_CACHE
-
-/*
- * DMA-consistent mapping functions for PowerPCs that don't support
- * cache snooping.  These allocate/free a region of uncached mapped
- * memory space for use with DMA devices.  Alternatively, you could
- * allocate the space "normally" and use the cache management functions
- * to ensure it is consistent.
- */
-extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
-extern void consistent_free(void *vaddr);
-extern void consistent_sync(void *vaddr, size_t size, int rw);
-extern void consistent_sync_page(struct page *page, unsigned long offset,
-				 size_t size, int rw);
-
-#define dma_cache_inv(_start,_size) \
-	invalidate_dcache_range(_start, (_start + _size))
-#define dma_cache_wback(_start,_size) \
-	clean_dcache_range(_start, (_start + _size))
-#define dma_cache_wback_inv(_start,_size) \
-	flush_dcache_range(_start, (_start + _size))
-
-#else /* ! CONFIG_NOT_COHERENT_CACHE */
-
-/*
- * Cache coherent cores.
- */
-
-#define dma_cache_inv(_start,_size)		do { } while (0)
-#define dma_cache_wback(_start,_size)		do { } while (0)
-#define dma_cache_wback_inv(_start,_size)	do { } while (0)
-
-#define consistent_alloc(gfp, size, handle)	NULL
-#define consistent_free(addr)			do { } while (0)
-#define consistent_sync(addr, size, rw)		do { } while (0)
-#define consistent_sync_page(pg, off, sz, rw)	do { } while (0)
-
-#endif /* ! CONFIG_NOT_COHERENT_CACHE */
 #endif /* _PPC_IO_H */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h
index 5ffc886dd..2589f182a 100644
--- a/include/asm-ppc/kmap_types.h
+++ b/include/asm-ppc/kmap_types.h
@@ -16,6 +16,7 @@ enum km_type {
 	KM_IRQ1,
 	KM_SOFTIRQ0,
 	KM_SOFTIRQ1,
+	KM_PPC_SYNC_PAGE,
 	KM_TYPE_NR
 };
 
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
index ce222070f..213b0a702 100644
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -16,6 +16,10 @@
 #include <platforms/est8260.h>
 #endif
 
+#ifdef CONFIG_SBC82xx
+#include <platforms/sbc82xx.h>
+#endif
+
 #ifdef CONFIG_SBS8260
 #include <platforms/sbs8260.h>
 #endif
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index a7f1d4c71..3d735b9e9 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -1,103 +1,116 @@
 /*
  * ocp.h
  *
+ *      (c) Benjamin Herrenschmidt (benh@kernel.crashing.org)
+ *          Mipsys - France
  *
- * 	Current Maintainer
- *      Armin Kuster akuster@pacbell.net
- *      Jan, 2002
- *
+ *          Derived from work (c) Armin Kuster akuster@pacbell.net
  *
+ *          Additional support and port to 2.6 LDM/sysfs by
+ *          Matt Porter <mporter@kernel.crashing.org>
+ *          Copyright 2003-2004 MontaVista Software, Inc.
  *
  * 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.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR   IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT,  INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 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.
  *
- *  You should have received a copy of the  GNU General Public License along
- *  with this program; if not, write  to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *  TODO: - Add get/put interface & fixup locking to provide same API for
+ *          2.4 and 2.5
+ *	  - Rework PM callbacks
  */
 
 #ifdef __KERNEL__
 #ifndef __OCP_H__
 #define __OCP_H__
 
+#include <linux/init.h>
 #include <linux/list.h>
 #include <linux/config.h>
+#include <linux/devfs_fs_kernel.h>
 #include <linux/device.h>
-#include <linux/errno.h>
 
+#include <asm/mmu.h>
 #include <asm/ocp_ids.h>
-#include <asm/mmu.h>		/* For phys_addr_t */
-#undef DEBUG
-/* #define DEBUG*/
+#include <asm/rwsem.h>
+#include <asm/semaphore.h>
 
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
+#ifdef CONFIG_PPC_OCP
 
+#define OCP_MAX_IRQS	7
+#define MAX_EMACS	4
 #define OCP_IRQ_NA	-1	/* used when ocp device does not have an irq */
-#define OCP_IRQ_MUL	-2	/* used for ocp devices with multiple irqs */
-#define OCP_NULL_TYPE	0	/* used to mark end of list */
-#define OCP_DEV_NA	-1
+#define OCP_IRQ_MUL	-2	/* used for ocp devices with multiply irqs */
+#define OCP_NULL_TYPE	-1	/* used to mark end of list */
 #define OCP_CPM_NA	0	/* No Clock or Power Management avaliable */
+#define OCP_PADDR_NA	0	/* No MMIO registers */
 
 #define OCP_ANY_ID	(~0)
+#define OCP_ANY_INDEX	-1
 
-
-extern struct list_head ocp_root_buses;
-extern struct list_head ocp_devices;
+extern struct list_head 	ocp_devices;
+extern struct rw_semaphore	ocp_devices_sem;
 
 struct ocp_device_id {
-	unsigned int vendor, device;		/* Vendor and device ID or PCI_ANY_ID */
-	char name[16];
-	char desc[50];
-	unsigned long driver_data;		/* Data private to the driver */
+	unsigned int	vendor, function;	/* Vendor and function ID or OCP_ANY_ID */
+	unsigned long	driver_data;		/* Data private to the driver */
 };
 
-struct func_info {
-	char name[16];
-	char desc[50];
-};
 
+/*
+ * Static definition of an OCP device.
+ *
+ * @vendor:    Vendor code. It is _STRONGLY_ discouraged to use
+ *             the vendor code as a way to match a unique device,
+ *             though I kept that possibility open, you should
+ *             really define different function codes for different
+ *             device types
+ * @function:  This is the function code for this device.
+ * @index:     This index is used for mapping the Nth function of a
+ *             given core. This is typically used for cross-driver
+ *             matching, like looking for a given MAL or ZMII from
+ *             an EMAC or for getting to the proper set of DCRs.
+ *             Indices are no longer magically calculated based on
+ *             structure ordering, they have to be actually coded
+ *             into the ocp_def to avoid any possible confusion
+ *             I _STRONGLY_ (again ? wow !) encourage anybody relying
+ *             on index mapping to encode the "target" index in an
+ *             associated structure pointed to by "additions", see
+ *             how it's done for the EMAC driver.
+ * @paddr:     Device physical address (may not mean anything...)
+ * @irq:       Interrupt line for this device (TODO: think about making
+ *             an array with this)
+ * @pm:        Currently, contains the bitmask in CPMFR DCR for the device
+ * @additions: Optionally points to a function specific structure
+ *             providing additional informations for a given device
+ *             instance. It's currently used by the EMAC driver for MAL
+ *             channel & ZMII port mapping among others.
+ * @show:      Optionally points to a function specific structure
+ *             providing a sysfs show routine for additions fields.
+ */
 struct ocp_def {
-	unsigned int vendor;
-	unsigned int device;
-	phys_addr_t paddr;
-	int irq;
-	unsigned long pm;
+	unsigned int	vendor;
+	unsigned int	function;
+	int		index;
+	phys_addr_t	paddr;
+	int	  	irq;
+	unsigned long	pm;
+	void		*additions;
+	void		(*show)(struct device *);
 };
 
 
-/* Struct for single ocp device managment */
+/* Struct for a given device instance */
 struct ocp_device {
-	struct list_head global_list;
-	unsigned int	num;		/* instance of device */
-	char		name[80];	/* device name */
-	unsigned int vendor;
-	unsigned int device;
-	phys_addr_t paddr;
-	int irq;
-	unsigned long pm;
-	void *ocpdev;		/* driver data for this device */
-	struct ocp_driver *driver;
-	u32 current_state;	/* Current operating state. In ACPI-speak,
-				   this is D0-D3, D0 being fully functional,
-				   and D3 being off. */
-	struct device dev;
+	struct list_head	link;
+	char			name[80];	/* device name */
+	struct ocp_def		*def;		/* device definition */
+	void			*drvdata;	/* driver data for this device */
+	struct ocp_driver	*driver;
+	u32			current_state;	/* Current operating state. In ACPI-speak,
+						   this is D0-D3, D0 being fully functional,
+						   and D3 being off. */
+	struct			device dev;
 };
 
 struct ocp_driver {
@@ -106,23 +119,13 @@ struct ocp_driver {
 	const struct ocp_device_id *id_table;	/* NULL if wants all devices */
 	int  (*probe)  (struct ocp_device *dev);	/* New device inserted */
 	void (*remove) (struct ocp_device *dev);	/* Device removed (NULL if not a hot-plug capable driver) */
-	int  (*save_state) (struct ocp_device *dev, u32 state);    /* Save Device Context */
 	int  (*suspend) (struct ocp_device *dev, u32 state);	/* Device suspended */
 	int  (*resume) (struct ocp_device *dev);	                /* Device woken up */
-	int  (*enable_wake) (struct ocp_device *dev, u32 state, int enable);   /* Enable wake event */
 	struct device_driver driver;
 };
 
-#define	to_ocp_dev(n) container_of(n, struct ocp_device, dev)
-#define	to_ocp_driver(n) container_of(n, struct ocp_driver, driver)
-
-extern int ocp_register_driver(struct ocp_driver *drv);
-extern void ocp_unregister_driver(struct ocp_driver *drv);
-
-#define ocp_dev_g(n) list_entry(n, struct ocp_device, global_list)
-
-#define ocp_for_each_dev(dev) \
-	for(dev = ocp_dev_g(ocp_devices.next); dev != ocp_dev_g(&ocp_devices); dev = ocp_dev_g(dev->global_list.next))
+#define to_ocp_dev(n) container_of(n, struct ocp_device, dev)
+#define to_ocp_drv(n) container_of(n, struct ocp_driver, driver)
 
 /* Similar to the helpers above, these manipulate per-ocp_dev
  * driver-specific data.  Currently stored as ocp_dev::ocpdev,
@@ -131,45 +134,13 @@ extern void ocp_unregister_driver(struct ocp_driver *drv);
 static inline void *
 ocp_get_drvdata(struct ocp_device *pdev)
 {
-	return pdev->ocpdev;
+	return pdev->drvdata;
 }
 
 static inline void
 ocp_set_drvdata(struct ocp_device *pdev, void *data)
 {
-	pdev->ocpdev = data;
-}
-
-/*
- * a helper function which helps ensure correct pci_driver
- * setup and cleanup for commonly-encountered hotplug/modular cases
- *
- * This MUST stay in a header, as it checks for -DMODULE
- */
-static inline int ocp_module_init(struct ocp_driver *drv)
-{
-	int rc = ocp_register_driver(drv);
-
-	if (rc > 0)
-		return 0;
-
-	/* iff CONFIG_HOTPLUG and built into kernel, we should
-	 * leave the driver around for future hotplug events.
-	 * For the module case, a hotplug daemon of some sort
-	 * should load a module in response to an insert event. */
-#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
-	if (rc == 0)
-		return 0;
-#else
-	if (rc == 0)
-		rc = -ENODEV;		
-#endif
-
-	/* if we get here, we need to clean up pci driver instance
-	 * and return some sort of error */
-	ocp_unregister_driver (drv);
-	
-	return rc;
+	pdev->drvdata = data;
 }
 
 #if defined (CONFIG_PM)
@@ -180,26 +151,57 @@ static inline int ocp_module_init(struct ocp_driver *drv)
 static inline void
 ocp_force_power_off(struct ocp_device *odev)
 {
-	mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) | odev->pm);
+	mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) | odev->def->pm);
 }
 
 static inline void
 ocp_force_power_on(struct ocp_device *odev)
 {
-	mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) & ~odev->pm);
+	mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) & ~odev->def->pm);
 }
 #else
 #define ocp_force_power_off(x)	(void)(x)
 #define ocp_force_power_on(x)	(void)(x)
 #endif
 
-extern void ocp_init(void);
-extern struct bus_type ocp_bus_type;
-extern struct ocp_device *ocp_get_dev(unsigned int device, int index);
-extern unsigned int ocp_get_num(unsigned int device);
+/* Register/Unregister an OCP driver */
+extern int ocp_register_driver(struct ocp_driver *drv);
+extern void ocp_unregister_driver(struct ocp_driver *drv);
+
+/* Build list of devices */
+extern int ocp_early_init(void) __init;
+
+/* Find a device by index */
+extern struct ocp_device *ocp_find_device(unsigned int vendor, unsigned int function, int index);
+
+/* Get a def by index */
+extern struct ocp_def *ocp_get_one_device(unsigned int vendor, unsigned int function, int index);
+
+/* Add a device by index */
+extern int ocp_add_one_device(struct ocp_def *def);
 
-extern int ocp_generic_suspend(struct ocp_device *pdev, u32 state);
-extern int ocp_generic_resume(struct ocp_device *pdev);
+/* Remove a device by index */
+extern int ocp_remove_one_device(unsigned int vendor, unsigned int function, int index);
+
+/* Iterate over devices and execute a routine */
+extern void ocp_for_each_device(void(*callback)(struct ocp_device *, void *arg), void *arg);
+
+/* Sysfs support */
+#define OCP_SYSFS_ADDTL(type, format, name, field)			\
+static ssize_t								\
+show_##name##_##field(struct device *dev, char *buf)			\
+{									\
+	struct ocp_device *odev = to_ocp_dev(dev);			\
+	type *add = odev->def->additions;				\
+									\
+	return sprintf(buf, format, add->field);			\
+}									\
+static DEVICE_ATTR(name##_##field, S_IRUGO, show_##name##_##field, NULL);
+
+#ifdef CONFIG_IBM_OCP
+#include <asm/ibm_ocp.h>
+#endif
 
+#endif				/* CONFIG_PPC_OCP */
 #endif				/* __OCP_H__ */
 #endif				/* __KERNEL__ */
diff --git a/include/asm-ppc/ocp_ids.h b/include/asm-ppc/ocp_ids.h
index bae1d67a2..da5ad07ab 100644
--- a/include/asm-ppc/ocp_ids.h
+++ b/include/asm-ppc/ocp_ids.h
@@ -1,34 +1,15 @@
 /*
- * FILE NAME: ocp_ids.h
+ * ocp_ids.h
  *
- * BRIEF MODULE DESCRIPTION:
  * OCP device ids based on the ideas from PCI
  *
- * Maintained by: Armin <akuster@mvista.com>
+ * The numbers below are almost completely arbitrary, and in fact
+ * strings might work better.  -- paulus
  *
- *
- *  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.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  You should have received a copy of the  GNU General Public License along
- *  with this program; if not, write  to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  Version 1.0 08/22/02 -Armin
- *  	initial release
+ * 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.
  */
 
 /*
@@ -42,8 +23,9 @@
 
 #define	OCP_VENDOR_INVALID	0x0000
 #define	OCP_VENDOR_ARM		0x0004
+#define OCP_VENDOR_FREESCALE	0x1057
 #define OCP_VENDOR_IBM		0x1014
-#define OCP_VENDOR_MOTOROLA	0x1057
+#define OCP_VENDOR_MOTOROLA	OCP_VENDOR_FREESCALE
 #define	OCP_VENDOR_XILINX	0x10ee
 #define	OCP_VENDOR_UNKNOWN	0xFFFF
 
@@ -53,33 +35,20 @@
 #define OCP_FUNC_INVALID	0x0000
 
 /* system 0x0001 - 0x001F */
-#define	OCP_FUNC_UIC		0x0001
 
 /* Timers 0x0020 - 0x002F */
-#define OCP_FUNC_GPT		0x0020 	/* General purpose timers */
-#define OCP_FUNC_RTC		0x0021
 
 /* Serial 0x0030 - 0x006F*/
 #define OCP_FUNC_16550		0x0031
-#define OCP_FUNC_SSP		0x0032 /* sync serial port */
-#define OCP_FUNC_SCP		0x0033 	/* serial controller port */
-#define OCP_FUNC_SCC		0x0034 	/* serial contoller */
-#define OCP_FUNC_SCI		0x0035 	/* Smart card */
-#define OCP_FUNC_IIC		0x0040
-#define OCP_FUNC_USB		0x0050
-#define OCP_FUNC_IR		0x0060	
+#define OCP_FUNC_IIC		0x0032
+#define OCP_FUNC_USB		0x0033
 
 /* Memory devices 0x0090 - 0x009F */
-#define	OCP_FUNC_SDRAM		0x0091
-#define OCP_FUNC_DMA		0x0092
+#define OCP_FUNC_MAL		0x0090
 
 /* Display 0x00A0 - 0x00AF */
-#define OCP_FUNC_VIDEO		0x00A0
-#define OCP_FUNC_LED		0x00A1
-#define	OCP_FUNC_LCD		0x00A2
 
 /* Sound 0x00B0 - 0x00BF */
-#define OCP_FUNC_AUDIO		0x00B0
 
 /* Mass Storage 0x00C0 - 0xxCF */
 #define OCP_FUNC_IDE		0x00C0
@@ -87,17 +56,15 @@
 /* Misc 0x00D0 - 0x00DF*/
 #define OCP_FUNC_GPIO		0x00D0
 #define OCP_FUNC_ZMII		0x00D1
+#define OCP_FUNC_PERFMON	0x00D2	/* Performance Monitor */
+#define OCP_FUNC_RGMII		0x00D3
+#define OCP_FUNC_TAH		0x00D4
 
 /* Network 0x0200 - 0x02FF */
 #define OCP_FUNC_EMAC		0x0200
+#define OCP_FUNC_ENET		0x0201	/* TSEC & FEC */
 
 /* Bridge devices 0xE00 - 0xEFF */
-#define OCP_FUNC_HOST		0x0E00
-#define OCP_FUNC_DCR		0x0E01
-#define OCP_FUNC_OPB		0x0E02
-#define OCP_FUNC_PHY		0x0E03
-#define OCP_FUNC_EXT		0x0E04
-#define	OCP_FUNC_PCI		0x0E05
-#define	OCP_FUNC_PLB		0x0E06
+#define OCP_FUNC_OPB		0x0E00
 
 #define OCP_FUNC_UNKNOWN	0xFFFF
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index 2511b4327..5349f5ca4 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -9,6 +9,7 @@
 #include <asm/scatterlist.h>
 #include <asm/io.h>
 #include <asm/pci-bridge.h>
+#include <asm-generic/pci-dma-compat.h>
 
 struct pci_dev;
 
@@ -54,61 +55,11 @@ extern unsigned long phys_to_bus(unsigned long pa);
 extern unsigned long pci_phys_to_bus(unsigned long pa, int busnr);
 extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr);
 
-/*
- * Dynamic DMA Mapping stuff
- * Originally stolen from i386 by ajoshi and updated by paulus
- * Non-consistent cache support by Dan Malek
- */
-
 /* The PCI address space does equal the physical memory
  * address space.  The networking and block device layers use
  * this boolean for bounce buffer decisions.
  */
-#define PCI_DMA_BUS_IS_PHYS	(1)
-
-/* Allocate and map kernel buffer using consistent mode DMA for a device.
- * hwdev should be valid struct pci_dev pointer for PCI devices,
- * NULL for PCI-like buses (ISA, EISA).
- * Returns non-NULL cpu-view pointer to the buffer if successful and
- * sets *dma_addrp to the pci side dma address as well, else *dma_addrp
- * is undefined.
- */
-extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
-				  dma_addr_t *dma_handle);
-
-/* Free and unmap a consistent DMA buffer.
- * cpu_addr is what was returned from pci_alloc_consistent,
- * size must be the same as what as passed into pci_alloc_consistent,
- * and likewise dma_addr must be the same as what *dma_addrp was set to.
- *
- * References to the memory and mappings associated with cpu_addr/dma_addr
- * past this call are illegal.
- */
-extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
-				void *vaddr, dma_addr_t dma_handle);
-
-/* Map a single buffer of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Once the device is given the dma address, the device owns this memory
- * until either pci_unmap_single or pci_dma_sync_single_for_cpu is performed.
- */
-static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
-					size_t size, int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-
-	consistent_sync(ptr, size, direction);
-
-	return virt_to_bus(ptr);
-}
-
-static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
-				    size_t size, int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-	/* nothing to do */
-}
+#define PCI_DMA_BUS_IS_PHYS     (1)
 
 /* pci_unmap_{page,single} is a nop so... */
 #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
@@ -118,183 +69,12 @@ static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
 #define pci_unmap_len(PTR, LEN_NAME)		(0)
 #define pci_unmap_len_set(PTR, LEN_NAME, VAL)	do { } while (0)
 
-/*
- * pci_{map,unmap}_single_page maps a kernel page to a dma_addr_t. identical
- * to pci_map_single, but takes a struct page instead of a virtual address
- */
-static inline dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
-				      unsigned long offset, size_t size,
-				      int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-	consistent_sync_page(page, offset, size, direction);
-	return (page - mem_map) * PAGE_SIZE + PCI_DRAM_OFFSET + offset;
-}
-
-static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
-				  size_t size, int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-	/* Nothing to do */
-}
-
-/* Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
- * above pci_map_single interface.  Here the scatter gather list
- * elements are each tagged with the appropriate dma address
- * and length.  They are obtained via sg_dma_{address,length}(SG).
- *
- * NOTE: An implementation may be able to use a smaller number of
- *       DMA address/length pairs than there are SG table elements.
- *       (for example via virtual mapping capabilities)
- *       The routine returns the number of addr/length pairs actually
- *       used, at most nents.
- *
- * Device ownership issues as mentioned above for pci_map_single are
- * the same here.
- */
-static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
-			     int nents, int direction)
-{
-	int i;
-
-	BUG_ON(direction == PCI_DMA_NONE);
-
-	/*
-	 * temporary 2.4 hack
-	 */
-	for (i = 0; i < nents; i++, sg++) {
-		BUG_ON(!sg->page);
-		consistent_sync_page(sg->page, sg->offset,
-				     sg->length, direction);
-		sg->dma_address = page_to_bus(sg->page) + sg->offset;
-	}
-
-	return nents;
-}
-
-/* Unmap a set of streaming mode DMA translations.
- * Again, cpu read rules concerning calls here are the same as for
- * pci_unmap_single() above.
- */
-static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
-				int nents, int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-	/* nothing to do */
-}
-
-/* Make physical memory consistent for a single
- * streaming mode DMA translation after a transfer.
- *
- * If you perform a pci_map_single() but wish to interrogate the
- * buffer using the cpu, yet do not wish to teardown the PCI dma
- * mapping, you must call this function before doing so.  At the
- * next point you give the PCI dma address back to the card, you
- * must first perform a pci_dma_sync_for_device, and then the device
- * again owns the buffer.
- */
-static inline void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev,
-					       dma_addr_t dma_handle,
-					       size_t size, int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-
-	consistent_sync(bus_to_virt(dma_handle), size, direction);
-}
-
-static inline void pci_dma_sync_single_for_device(struct pci_dev *hwdev,
-						  dma_addr_t dma_handle,
-						  size_t size, int direction)
-{
-	BUG_ON(direction == PCI_DMA_NONE);
-
-	consistent_sync(bus_to_virt(dma_handle), size, direction);
-}
-
-/* Make physical memory consistent for a set of streaming
- * mode DMA translations after a transfer.
- *
- * The same as pci_dma_sync_single_for_* but for a scatter-gather list,
- * same rules and usage.
- */
-static inline void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev,
-					   struct scatterlist *sg,
-					   int nelems, int direction)
-{
-	int i;
-
-	BUG_ON(direction == PCI_DMA_NONE);
-
-	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync_page(sg->page, sg->offset,
-				     sg->length, direction);
-}
-
-static inline void pci_dma_sync_sg_for_device(struct pci_dev *hwdev,
-					      struct scatterlist *sg,
-					      int nelems, int direction)
-{
-	int i;
-
-	BUG_ON(direction == PCI_DMA_NONE);
-
-	for (i = 0; i < nelems; i++, sg++)
-		consistent_sync_page(sg->page, sg->offset,
-				     sg->length, direction);
-}
-
-/* Return whether the given PCI device DMA address mask can
- * be supported properly.  For example, if your device can
- * only drive the low 24-bits during PCI bus mastering, then
- * you would pass 0x00ffffff as the mask to this function.
- */
-static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
-{
-	return 1;
-}
-
 /*
  * At present there are very few 32-bit PPC machines that can have
  * memory above the 4GB point, and we don't support that.
  */
 #define pci_dac_dma_supported(pci_dev, mask)	(0)
 
-static inline dma64_addr_t
-pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
-{
-	return (dma64_addr_t) page_to_bus(page) + offset;
-}
-
-static inline struct page *
-pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
-{
-	return mem_map + (unsigned long)(dma_addr >> PAGE_SHIFT);
-}
-
-static inline unsigned long
-pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
-{
-	return (dma_addr & ~PAGE_MASK);
-}
-
-static inline void
-pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
-{
-	/* Nothing to do. */
-}
-
-static inline void
-pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
-{
-	/* Nothing to do. */
-}
-
-static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
-{
-	return 0;
-}
-
 /* Return the index of the PCI controller for device PDEV. */
 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
 
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 98e9bb20e..01256bda1 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -548,6 +548,20 @@ static inline void ptep_mkdirty(pte_t *ptep)
 	pte_update(ptep, 0, _PAGE_DIRTY);
 }
 
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
+{
+	unsigned long bits = pte_val(entry) &
+		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
+	pte_update(ptep, 0, bits);
+}
+
+#define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+	do {								   \
+		__ptep_set_access_flags(__ptep, __entry, __dirty);	   \
+		flush_tlb_page_nohash(__vma, __address);	       	   \
+	} while(0)
+
 /*
  * Macro to mark a page protection value as "uncacheable".
  */
@@ -670,7 +684,7 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size,
  */
 #define pgtable_cache_init()	do { } while (0)
 
-typedef pte_t *pte_addr_t;
+extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
 
 #endif /* !__ASSEMBLY__ */
 
diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-ppc/ppc_asm.h
index 7a62917a9..c8de15c77 100644
--- a/include/asm-ppc/ppc_asm.h
+++ b/include/asm-ppc/ppc_asm.h
@@ -161,6 +161,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 #define CLR_TOP32(r)
 #endif /* CONFIG_PPC64BRIDGE */
 
+#define RFMCI		.long 0x4c00004c	/* rfmci instruction */
+
 #ifdef CONFIG_IBM405_ERR77
 #define PPC405_ERR77(ra,rb)	dcbt	ra, rb;
 #define	PPC405_ERR77_SYNC	sync;
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index 4c29516b8..e1defaea3 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -444,7 +444,7 @@
 #define PVR_440GP_RC2	0x40200481
 #define PVR_440GX_RA	0x51b21850
 #define PVR_440GX_RB	0x51b21851
-#define PVR_440GX_RB1	0x51b21852
+#define PVR_440GX_RC	0x51b21892
 #define PVR_601		0x00010000
 #define PVR_602		0x00050000
 #define PVR_603		0x00030000
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 11759ab06..2c688c1fd 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -11,19 +11,24 @@
 
 #ifndef __ASSEMBLY__
 /* Device Control Registers */
-#define mfdcr(rn) mfdcr_or_dflt(rn, 0)
-#define mfdcr_or_dflt(rn,default_rval)					\
-	({unsigned int rval;						\
-	if (rn == 0)							\
-		rval = default_rval;					\
-	else								\
-		asm volatile("mfdcr %0," __stringify(rn) : "=r" (rval)); \
+void __mtdcr(int reg, unsigned int val);
+unsigned int __mfdcr(int reg);
+#define mfdcr(rn)						\
+	({unsigned int rval;					\
+	if (__builtin_constant_p(rn))				\
+		asm volatile("mfdcr %0," __stringify(rn)	\
+		              : "=r" (rval));			\
+	else							\
+		rval = __mfdcr(rn);				\
 	rval;})
 
-#define mtdcr(rn, v)							\
-do {									\
-	if (rn != 0)							\
-		asm volatile("mtdcr " __stringify(rn) ",%0" : : "r" (v)); \
+#define mtdcr(rn, v)						\
+do {								\
+	if (__builtin_constant_p(rn))				\
+		asm volatile("mtdcr " __stringify(rn) ",%0"	\
+			      : : "r" (v)); 			\
+	else							\
+		__mtdcr(rn, v);					\
 } while (0)
 
 /* R/W of indirect DCRs make use of standard naming conventions for DCRs */
@@ -86,6 +91,20 @@ do {						\
 #define SPRN_IVOR13	0x19D	/* Interrupt Vector Offset Register 13 */
 #define SPRN_IVOR14	0x19E	/* Interrupt Vector Offset Register 14 */
 #define SPRN_IVOR15	0x19F	/* Interrupt Vector Offset Register 15 */
+#define SPRN_MCSRR0	0x23A	/* Machine Check Save and Restore Register 0 */
+#define SPRN_MCSRR1	0x23B	/* Machine Check Save and Restore Register 1 */
+#define SPRN_MCSR	0x23C	/* Machine Check Status Register */
+#ifdef CONFIG_440A
+#define  MCSR_MCS	0x80000000 /* Machine Check Summary */
+#define  MCSR_IB	0x40000000 /* Instruction PLB Error */
+#define  MCSR_DRB	0x20000000 /* Data Read PLB Error */
+#define  MCSR_DWB	0x10000000 /* Data Write PLB Error */
+#define  MCSR_TLBP	0x08000000 /* TLB Parity Error */
+#define  MCSR_ICP	0x04000000 /* I-Cache Parity Error */
+#define  MCSR_DCSP	0x02000000 /* D-Cache Search Parity Error */
+#define  MCSR_DCFP	0x01000000 /* D-Cache Flush Parity Error */
+#define  MCSR_IMPE	0x00800000 /* Imprecise Machine Check Exception */
+#endif
 #define SPRN_ZPR	0x3B0	/* Zone Protection Register (40x) */
 #define SPRN_MMUCR	0x3B2	/* MMU Control Register */
 #define SPRN_CCR0	0x3B3	/* Core Configuration Register */
@@ -144,6 +163,7 @@ do {						\
  */
 #ifdef CONFIG_BOOKE
 #define DBSR_IC		0x08000000	/* Instruction Completion */
+#define DBSR_BT		0x04000000	/* Branch Taken */
 #define DBSR_TIE	0x01000000	/* Trap Instruction Event */
 #endif
 #ifdef CONFIG_40x
@@ -250,6 +270,8 @@ do {						\
 #define CSRR0	SPRN_SRR2	/* Logically and functionally equivalent. */
 #define CSRR1	SPRN_SRR3	/* Logically and functionally equivalent. */
 #endif
+#define MCSRR0	SPRN_MCSRR0	/* Machine Check Save and Restore Register 0 */
+#define MCSRR1	SPRN_MCSRR1	/* Machine Check Save and Restore Register 1 */
 #define DCMP	SPRN_DCMP	/* Data TLB Compare Register */
 #define SPRG4R	SPRN_SPRG4R	/* Supervisor Private Registers */
 #define SPRG5R	SPRN_SPRG5R
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index 3e3c2a501..d91ba524d 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -27,6 +27,7 @@ typedef struct {
 #define spin_lock_init(x) 	do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
 #define spin_is_locked(x)	((x)->lock != 0)
 #define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 #ifndef CONFIG_DEBUG_SPINLOCK
 
@@ -64,7 +65,6 @@ static inline void _raw_spin_unlock(spinlock_t *lock)
 extern void _raw_spin_lock(spinlock_t *lock);
 extern void _raw_spin_unlock(spinlock_t *lock);
 extern int _raw_spin_trylock(spinlock_t *lock);
-extern unsigned long __spin_trylock(volatile unsigned long *lock);
 
 #endif
 
@@ -135,6 +135,26 @@ static __inline__ void _raw_read_unlock(rwlock_t *rw)
 	: "cr0", "memory");
 }
 
+static __inline__ int _raw_write_trylock(rwlock_t *rw)
+{
+	unsigned int tmp;
+
+	__asm__ __volatile__(
+"2:	lwarx	%0,0,%1		# write_trylock\n\
+	cmpwi	0,%0,0\n\
+	bne-	1f\n"
+	PPC405_ERR77(0,%1)
+"	stwcx.	%2,0,%1\n\
+	bne-	2b\n\
+	isync\n\
+1:"
+	: "=&r"(tmp)
+	: "r"(&rw->lock), "r"(-1)
+	: "cr0", "memory");
+
+	return tmp == 0;
+}
+
 static __inline__ void _raw_write_lock(rwlock_t *rw)
 {
 	unsigned int tmp;
@@ -168,6 +188,7 @@ extern void _raw_read_lock(rwlock_t *rw);
 extern void _raw_read_unlock(rwlock_t *rw);
 extern void _raw_write_lock(rwlock_t *rw);
 extern void _raw_write_unlock(rwlock_t *rw);
+extern int _raw_write_trylock(rwlock_t *rw);
 
 #endif
 
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 3885c4d83..e8c8e88dc 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -76,11 +76,15 @@ extern void giveup_fpu(struct task_struct *);
 extern void enable_kernel_fp(void);
 extern void giveup_altivec(struct task_struct *);
 extern void load_up_altivec(struct task_struct *);
+extern int fix_alignment(struct pt_regs *);
 extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
 extern void cvt_df(double *from, float *to, unsigned long *fpscr);
 extern int call_rtas(const char *, int, int, unsigned long *, ...);
 extern int abs(int);
 extern void cacheable_memzero(void *p, unsigned int nb);
+extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
+extern void bad_page_fault(struct pt_regs *, unsigned long, int);
+extern void die(const char *, struct pt_regs *, long);
 
 struct device_node;
 extern void note_scsi_host(struct device_node *, void *);
diff --git a/include/asm-ppc/termbits.h b/include/asm-ppc/termbits.h
index 49ba5b3d5..c343fb7bd 100644
--- a/include/asm-ppc/termbits.h
+++ b/include/asm-ppc/termbits.h
@@ -81,6 +81,7 @@ struct termios {
 #define   TAB1	00002000
 #define   TAB2	00004000
 #define   TAB3	00006000
+#define   XTABS	00006000	/* required by POSIX to == TAB3 */
 #define CRDLY	00030000
 #define   CR0	00000000
 #define   CR1	00010000
@@ -95,7 +96,6 @@ struct termios {
 #define VTDLY	00200000
 #define   VT0	00000000
 #define   VT1	00200000
-#define XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
 
 /* c_cflag bit meaning */
 #define CBAUD	0000377
diff --git a/include/asm-ppc/tlbflush.h b/include/asm-ppc/tlbflush.h
index 7d755b2d7..6c6842fb4 100644
--- a/include/asm-ppc/tlbflush.h
+++ b/include/asm-ppc/tlbflush.h
@@ -29,6 +29,9 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 static inline void flush_tlb_page(struct vm_area_struct *vma,
 				unsigned long vmaddr)
 	{ _tlbie(vmaddr); }
+static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
+					 unsigned long vmaddr)
+	{ _tlbie(vmaddr); }
 static inline void flush_tlb_range(struct vm_area_struct *vma,
 				unsigned long start, unsigned long end)
 	{ __tlbia(); }
@@ -44,6 +47,9 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
 static inline void flush_tlb_page(struct vm_area_struct *vma,
 				unsigned long vmaddr)
 	{ _tlbie(vmaddr); }
+static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
+					 unsigned long vmaddr)
+	{ _tlbie(vmaddr); }
 static inline void flush_tlb_range(struct mm_struct *mm,
 				unsigned long start, unsigned long end)
 	{ __tlbia(); }
@@ -56,6 +62,7 @@ struct mm_struct;
 struct vm_area_struct;
 extern void flush_tlb_mm(struct mm_struct *mm);
 extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
+extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr);
 extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
 			    unsigned long end);
 extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h
index 77dc24d7d..a787bc032 100644
--- a/include/asm-ppc/types.h
+++ b/include/asm-ppc/types.h
@@ -62,6 +62,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
index 6ef6c95f0..57fb02c6c 100644
--- a/include/asm-ppc/unistd.h
+++ b/include/asm-ppc/unistd.h
@@ -272,8 +272,9 @@
 #define __NR_mq_timedreceive	265
 #define __NR_mq_notify		266
 #define __NR_mq_getsetattr	267
+#define __NR_kexec_load		268
 
-#define __NR_syscalls		268
+#define __NR_syscalls		269
 
 #define __NR(n)	#n
 
@@ -380,6 +381,29 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
 #define __NR__exit __NR_exit
 #define NR_syscalls	__NR_syscalls
 
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+
 /*
  * Forking from kernel space will result in the child getting a new,
  * empty kernel stack area.  Thus the child cannot access automatic
diff --git a/include/asm-ppc64/atomic.h b/include/asm-ppc64/atomic.h
index 00617e218..0e5f25e83 100644
--- a/include/asm-ppc64/atomic.h
+++ b/include/asm-ppc64/atomic.h
@@ -54,6 +54,8 @@ static __inline__ int atomic_add_return(int a, atomic_t *v)
 	return t;
 }
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
 static __inline__ void atomic_sub(int a, atomic_t *v)
 {
 	int t;
@@ -118,6 +120,16 @@ static __inline__ int atomic_inc_return(atomic_t *v)
 	return t;
 }
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 static __inline__ void atomic_dec(atomic_t *v)
 {
 	int t;
diff --git a/include/asm-ppc64/bitops.h b/include/asm-ppc64/bitops.h
index 3f053b6bb..feeeb9b77 100644
--- a/include/asm-ppc64/bitops.h
+++ b/include/asm-ppc64/bitops.h
@@ -154,6 +154,20 @@ static __inline__ int test_and_change_bit(unsigned long nr, volatile unsigned lo
 	return (old & mask) != 0;
 }
 
+static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
+{
+	unsigned long old;
+
+	__asm__ __volatile__(
+"1:	ldarx	%0,0,%3		# set_bit\n\
+	or	%0,%0,%2\n\
+	stdcx.	%0,0,%3\n\
+	bne-	1b"
+	: "=&r" (old), "=m" (*addr)
+	: "r" (mask), "r" (addr), "m" (*addr)
+	: "cc");
+}
+
 /*
  * non-atomic versions
  */
diff --git a/include/asm-ppc64/cacheflush.h b/include/asm-ppc64/cacheflush.h
index d6f24f9a1..7222160db 100644
--- a/include/asm-ppc64/cacheflush.h
+++ b/include/asm-ppc64/cacheflush.h
@@ -18,6 +18,9 @@
 #define flush_cache_vunmap(start, end)		do { } while (0)
 
 extern void flush_dcache_page(struct page *page);
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
+
 extern void __flush_icache_range(unsigned long, unsigned long);
 extern void flush_icache_user_range(struct vm_area_struct *vma,
 				    struct page *page, unsigned long addr,
@@ -37,7 +40,7 @@ extern void __flush_dcache_icache(void *page_va);
 
 static inline void flush_icache_range(unsigned long start, unsigned long stop)
 {
-	if (!(cur_cpu_spec->cpu_features & CPU_FTR_COHERENT_ICACHE))
+	if (!(cur_cpu_spec->cpu_features & ASM_CONST(CPU_FTR_COHERENT_ICACHE)))
 		__flush_icache_range(start, stop);
 }
 
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h
index 4e33b67e9..09c28d28c 100644
--- a/include/asm-ppc64/compat.h
+++ b/include/asm-ppc64/compat.h
@@ -25,6 +25,7 @@ typedef u16		compat_ipc_pid_t;
 typedef s32		compat_daddr_t;
 typedef u32		compat_caddr_t;
 typedef __kernel_fsid_t	compat_fsid_t;
+typedef s32		compat_key_t;
 
 typedef s32		compat_int_t;
 typedef s32		compat_long_t;
@@ -116,12 +117,12 @@ typedef u32		compat_sigset_word;
  */
 typedef	u32		compat_uptr_t;
 
-static inline void *compat_ptr(compat_uptr_t uptr)
+static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
-	return (void *)(unsigned long)uptr;
+	return (void __user *)(unsigned long)uptr;
 }
 
-static inline void *compat_alloc_user_space(long len)
+static inline void __user *compat_alloc_user_space(long len)
 {
 	struct pt_regs *regs = current->thread.regs;
 	unsigned long usp = regs->gpr[1];
@@ -133,7 +134,69 @@ static inline void *compat_alloc_user_space(long len)
 	if (!(test_thread_flag(TIF_32BIT)))
 		usp -= 288;
 
-	return (void *) (usp - len);
+	return (void __user *) (usp - len);
 }
 
+/*
+ * ipc64_perm is actually 32/64bit clean but since the compat layer refers to
+ * it we may as well define it.
+ */
+struct compat_ipc64_perm {
+	compat_key_t key;
+	compat_uid_t uid;
+	compat_gid_t gid;
+	compat_uid_t cuid;
+	compat_gid_t cgid;
+	compat_mode_t mode;
+	unsigned int seq;
+	unsigned int __pad2;
+	unsigned long __unused1;	/* yes they really are 64bit pads */
+	unsigned long __unused2;
+};
+
+struct compat_semid64_ds {
+	struct compat_ipc64_perm sem_perm;
+	unsigned int __unused1;
+	compat_time_t sem_otime;
+	unsigned int __unused2;
+	compat_time_t sem_ctime;
+	compat_ulong_t sem_nsems;
+	compat_ulong_t __unused3;
+	compat_ulong_t __unused4;
+};
+
+struct compat_msqid64_ds {
+	struct compat_ipc64_perm msg_perm;
+	unsigned int __unused1;
+	compat_time_t msg_stime;
+	unsigned int __unused2;
+	compat_time_t msg_rtime;
+	unsigned int __unused3;
+	compat_time_t msg_ctime;
+	compat_ulong_t msg_cbytes;
+	compat_ulong_t msg_qnum;
+	compat_ulong_t msg_qbytes;
+	compat_pid_t msg_lspid;
+	compat_pid_t msg_lrpid;
+	compat_ulong_t __unused4;
+	compat_ulong_t __unused5;
+};
+
+struct compat_shmid64_ds {
+	struct compat_ipc64_perm shm_perm;
+	unsigned int __unused1;
+	compat_time_t shm_atime;
+	unsigned int __unused2;
+	compat_time_t shm_dtime;
+	unsigned int __unused3;
+	compat_time_t shm_ctime;
+	unsigned int __unused4;
+	compat_size_t shm_segsz;
+	compat_pid_t shm_cpid;
+	compat_pid_t shm_lpid;
+	compat_ulong_t shm_nattch;
+	compat_ulong_t __unused5;
+	compat_ulong_t __unused6;
+};
+
 #endif /* _ASM_PPC64_COMPAT_H */
diff --git a/include/asm-ppc64/current.h b/include/asm-ppc64/current.h
index 429487ddd..24ea6e1ab 100644
--- a/include/asm-ppc64/current.h
+++ b/include/asm-ppc64/current.h
@@ -8,13 +8,11 @@
  * 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.
- *
- * Use r13 for current since the ppc64 ABI reserves it - Anton
  */
 
 #include <asm/thread_info.h>
 
-#define get_current()   ((struct task_struct *)(get_paca()->xCurrent))
+#define get_current()   (get_paca()->xCurrent)
 #define current         get_current()
 
 #endif /* !(_PPC64_CURRENT_H) */
diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h
index 4ccf43666..928dc5e39 100644
--- a/include/asm-ppc64/eeh.h
+++ b/include/asm-ppc64/eeh.h
@@ -47,16 +47,16 @@ void *eeh_ioremap(unsigned long addr, void *vaddr);
 void __init pci_addr_cache_build(void);
 
 /**
- * eeh_add_device - perform EEH initialization for the indicated pci device
- * @dev: pci device for which to set up EEH
+ * eeh_add_device_early
+ * eeh_add_device_late
  *
- * This routine can be used to perform EEH initialization for PCI
- * devices that were added after system boot (e.g. hotplug, dlpar).
- * Whether this actually enables EEH or not for this device depends
- * on the type of the device, on earlier boot command-line
- * arguments & etc.
+ * Perform eeh initialization for devices added after boot.
+ * Call eeh_add_device_early before doing any i/o to the
+ * device (including config space i/o).  Call eeh_add_device_late
+ * to finish the eeh setup for this device.
  */
-void eeh_add_device(struct pci_dev *);
+void eeh_add_device_early(struct device_node *);
+void eeh_add_device_late(struct pci_dev *);
 
 /**
  * eeh_remove_device - undo EEH setup for the indicated pci device
@@ -215,7 +215,7 @@ static inline u8 eeh_inb(unsigned long port) {
 
 static inline void eeh_outb(u8 val, unsigned long port) {
 	if (_IO_IS_VALID(port))
-		return out_8((u8 *)(port+pci_io_base), val);
+		out_8((u8 *)(port+pci_io_base), val);
 }
 
 static inline u16 eeh_inw(unsigned long port) {
@@ -230,7 +230,7 @@ static inline u16 eeh_inw(unsigned long port) {
 
 static inline void eeh_outw(u16 val, unsigned long port) {
 	if (_IO_IS_VALID(port))
-		return out_le16((u16 *)(port+pci_io_base), val);
+		out_le16((u16 *)(port+pci_io_base), val);
 }
 
 static inline u32 eeh_inl(unsigned long port) {
@@ -245,7 +245,7 @@ static inline u32 eeh_inl(unsigned long port) {
 
 static inline void eeh_outl(u32 val, unsigned long port) {
 	if (_IO_IS_VALID(port))
-		return out_le32((u32 *)(port+pci_io_base), val);
+		out_le32((u32 *)(port+pci_io_base), val);
 }
 
 /* in-string eeh macros */
diff --git a/include/asm-ppc64/iSeries/HvCallSc.h b/include/asm-ppc64/iSeries/HvCallSc.h
index 3b77eb0bb..eea258447 100644
--- a/include/asm-ppc64/iSeries/HvCallSc.h
+++ b/include/asm-ppc64/iSeries/HvCallSc.h
@@ -21,14 +21,14 @@
 
 #include <asm/iSeries/HvTypes.h>
 
-#define HvCallBase		0x8000000000000000
-#define HvCallCc		0x8001000000000000
-#define HvCallCfg		0x8002000000000000
-#define HvCallEvent		0x8003000000000000
-#define HvCallHpt		0x8004000000000000
-#define HvCallPci		0x8005000000000000
-#define HvCallSm		0x8007000000000000
-#define HvCallXm		0x8009000000000000
+#define HvCallBase		0x8000000000000000ul
+#define HvCallCc		0x8001000000000000ul
+#define HvCallCfg		0x8002000000000000ul
+#define HvCallEvent		0x8003000000000000ul
+#define HvCallHpt		0x8004000000000000ul
+#define HvCallPci		0x8005000000000000ul
+#define HvCallSm		0x8007000000000000ul
+#define HvCallXm		0x8009000000000000ul
 
 u64 HvCall0( u64 );
 u64 HvCall1( u64, u64 );
diff --git a/include/asm-ppc64/ide.h b/include/asm-ppc64/ide.h
index 88d3645e5..00df66e0e 100644
--- a/include/asm-ppc64/ide.h
+++ b/include/asm-ppc64/ide.h
@@ -22,10 +22,8 @@
 # define MAX_HWIFS	4
 #endif
 
-static inline int ide_default_irq(unsigned long base) { return 0; }
-static inline unsigned long ide_default_io_base(int index) { return 0; }
-
-#define ide_init_default_irq(base)	(0)
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h
index ac409a04a..f6262bad7 100644
--- a/include/asm-ppc64/io.h
+++ b/include/asm-ppc64/io.h
@@ -240,22 +240,23 @@ static inline int in_8(volatile unsigned char *addr)
 {
 	int ret;
 
-	__asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync" :
-			     "=r" (ret) : "m" (*addr));
+	__asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync"
+			     : "=r" (ret) : "m" (*addr));
 	return ret;
 }
 
 static inline void out_8(volatile unsigned char *addr, int val)
 {
-	__asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
+	__asm__ __volatile__("stb%U0%X0 %1,%0; sync"
+			     : "=m" (*addr) : "r" (val));
 }
 
 static inline int in_le16(volatile unsigned short *addr)
 {
 	int ret;
 
-	__asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync" :
-			     "=r" (ret) : "r" (addr), "m" (*addr));
+	__asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync"
+			     : "=r" (ret) : "r" (addr), "m" (*addr));
 	return ret;
 }
 
@@ -263,28 +264,29 @@ static inline int in_be16(volatile unsigned short *addr)
 {
 	int ret;
 
-	__asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync" :
-			     "=r" (ret) : "m" (*addr));
+	__asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
+			     : "=r" (ret) : "m" (*addr));
 	return ret;
 }
 
 static inline void out_le16(volatile unsigned short *addr, int val)
 {
-	__asm__ __volatile__("sthbrx %1,0,%2; eieio" : "=m" (*addr) :
-			      "r" (val), "r" (addr));
+	__asm__ __volatile__("sthbrx %1,0,%2; sync"
+			     : "=m" (*addr) : "r" (val), "r" (addr));
 }
 
 static inline void out_be16(volatile unsigned short *addr, int val)
 {
-	__asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
+	__asm__ __volatile__("sth%U0%X0 %1,%0; sync"
+			     : "=m" (*addr) : "r" (val));
 }
 
 static inline unsigned in_le32(volatile unsigned *addr)
 {
 	unsigned ret;
 
-	__asm__ __volatile__("lwbrx %0,0,%1; twi 0,%0,0; isync" :
-			     "=r" (ret) : "r" (addr), "m" (*addr));
+	__asm__ __volatile__("lwbrx %0,0,%1; twi 0,%0,0; isync"
+			     : "=r" (ret) : "r" (addr), "m" (*addr));
 	return ret;
 }
 
@@ -292,20 +294,21 @@ static inline unsigned in_be32(volatile unsigned *addr)
 {
 	unsigned ret;
 
-	__asm__ __volatile__("lwz%U1%X1 %0,%1; twi 0,%0,0; isync" :
-			     "=r" (ret) : "m" (*addr));
+	__asm__ __volatile__("lwz%U1%X1 %0,%1; twi 0,%0,0; isync"
+			     : "=r" (ret) : "m" (*addr));
 	return ret;
 }
 
 static inline void out_le32(volatile unsigned *addr, int val)
 {
-	__asm__ __volatile__("stwbrx %1,0,%2; eieio" : "=m" (*addr) :
-			     "r" (val), "r" (addr));
+	__asm__ __volatile__("stwbrx %1,0,%2; sync" : "=m" (*addr)
+			     : "r" (val), "r" (addr));
 }
 
 static inline void out_be32(volatile unsigned *addr, int val)
 {
-	__asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
+	__asm__ __volatile__("stw%U0%X0 %1,%0; sync"
+			     : "=m" (*addr) : "r" (val));
 }
 
 static inline unsigned long in_le64(volatile unsigned long *addr)
@@ -323,7 +326,7 @@ static inline unsigned long in_le64(volatile unsigned long *addr)
 			     "rldicl %1,%1,32,0\n"
 			     "rlwimi %0,%1,8,8,31\n"
 			     "rlwimi %0,%1,24,16,23\n"
-			     : "=r" (ret), "=r" (tmp) : "b" (addr) , "m" (*addr));
+			     : "=r" (ret) , "=r" (tmp) : "b" (addr) , "m" (*addr));
 	return ret;
 }
 
@@ -331,12 +334,12 @@ static inline unsigned long in_be64(volatile unsigned long *addr)
 {
 	unsigned long ret;
 
-	__asm__ __volatile__("ld %0,0(%1); twi 0,%0,0; isync" :
-			     "=r" (ret) : "m" (*addr));
+	__asm__ __volatile__("ld %0,0(%1); twi 0,%0,0; isync"
+			     : "=r" (ret) : "m" (*addr));
 	return ret;
 }
 
-static inline void out_le64(volatile unsigned long *addr, int val)
+static inline void out_le64(volatile unsigned long *addr, unsigned long val)
 {
 	unsigned long tmp;
 
@@ -348,14 +351,14 @@ static inline void out_le64(volatile unsigned long *addr, int val)
 			     "rldicl %1,%1,32,0\n"
 			     "rlwimi %0,%1,8,8,31\n"
 			     "rlwimi %0,%1,24,16,23\n"
-			     "std %0,0(%2)\n"
-			     "eieio\n"
-			     : "=r" (tmp) : "r" (val), "b" (addr) , "m" (*addr));
+			     "std %0,0(%3)\n"
+			     "sync"
+			     : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
 }
 
-static inline void out_be64(volatile unsigned long *addr, int val)
+static inline void out_be64(volatile unsigned long *addr, unsigned long val)
 {
-	__asm__ __volatile__("std %1,0(%0); eieio" : "=m" (*addr) : "r" (val));
+	__asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val));
 }
 
 #ifndef CONFIG_PPC_ISERIES 
diff --git a/include/asm-ppc64/iommu.h b/include/asm-ppc64/iommu.h
index 689b6adf3..8530fb673 100644
--- a/include/asm-ppc64/iommu.h
+++ b/include/asm-ppc64/iommu.h
@@ -29,10 +29,10 @@
 
 /*
  * IOMAP_MAX_ORDER defines the largest contiguous block
- * of dma (tce) space we can get.  IOMAP_MAX_ORDER = 10 
- * allows up to 2**9 pages (512 * 4096) = 2 MB
+ * of dma (tce) space we can get.  IOMAP_MAX_ORDER = 13
+ * allows up to 2**12 pages (4096 * 4096) = 16 MB
  */
-#define IOMAP_MAX_ORDER 10
+#define IOMAP_MAX_ORDER 13
 
 /*
  * Tces come in two formats, one for the virtual bus and a different
diff --git a/include/asm-ppc64/ipc.h b/include/asm-ppc64/ipc.h
index cfb82f0f5..f91bf5b0d 100644
--- a/include/asm-ppc64/ipc.h
+++ b/include/asm-ppc64/ipc.h
@@ -12,7 +12,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 struct ipc_kludge {
-	struct msgbuf *msgp;
+	struct msgbuf __user *msgp;
 	long msgtyp;
 };
 
diff --git a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h
index 2cd77b493..6544827f7 100644
--- a/include/asm-ppc64/irq.h
+++ b/include/asm-ppc64/irq.h
@@ -9,6 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/threads.h>
 #include <asm/atomic.h>
 
 /*
@@ -77,7 +78,26 @@ static __inline__ int irq_canonicalize(int irq)
 
 struct irqaction;
 struct pt_regs;
-int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
+int handle_irq_event(int, struct pt_regs *, struct irqaction *);
+
+#ifdef CONFIG_IRQSTACKS
+/*
+ * Per-cpu stacks for handling hard and soft interrupts.
+ */
+extern struct thread_info *hardirq_ctx[NR_CPUS];
+extern struct thread_info *softirq_ctx[NR_CPUS];
+
+extern void irq_ctx_init(void);
+extern void call_do_softirq(struct thread_info *tp);
+extern int call_handle_irq_event(int irq, struct pt_regs *regs,
+			struct irqaction *action, struct thread_info *tp);
+
+#define __ARCH_HAS_DO_SOFTIRQ
+
+#else
+#define irq_ctx_init()
+
+#endif /* CONFIG_IRQSTACKS */
 
 #endif /* _ASM_IRQ_H */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index b42d9a4db..f9823b2ac 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -204,7 +204,7 @@ static inline unsigned long hpt_hash(unsigned long vpn, int large)
 		page = vpn & 0xffff;
 	}
 
-	return (vsid & 0x7fffffffff) ^ page;
+	return (vsid & 0x7fffffffffUL) ^ page;
 }
 
 static inline void __tlbie(unsigned long va, int large)
diff --git a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h
index 2682e04f9..505ad13b3 100644
--- a/include/asm-ppc64/mmu_context.h
+++ b/include/asm-ppc64/mmu_context.h
@@ -172,11 +172,17 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
  * After we have set current->mm to a new value, this activates
  * the context for the new mm so we see the new mappings.
  */
-#define activate_mm(active_mm, mm) \
-	switch_mm(active_mm, mm, current);
+static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	switch_mm(prev, next, current);
+	local_irq_restore(flags);
+}
 
-#define VSID_RANDOMIZER 42470972311
-#define VSID_MASK	0xfffffffff
+#define VSID_RANDOMIZER 42470972311UL
+#define VSID_MASK	0xfffffffffUL
 
 
 /* This is only valid for kernel (including vmalloc, imalloc and bolted) EA's
@@ -189,15 +195,15 @@ get_kernel_vsid( unsigned long ea )
 	ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | (ea >> 60);
 	vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK;
 
-	ifppcdebug(PPCDBG_HTABSTRESS) {
-		/* For debug, this path creates a very poor vsid distribuition.
-		 * A user program can access virtual addresses in the form
-		 * 0x0yyyyxxxx000 where yyyy = xxxx to cause multiple mappings
-		 * to hash to the same page table group.
-		 */ 
-		ordinal = ((ea >> 28) & 0x1fff) | (ea >> 44);
-		vsid = ordinal & VSID_MASK;
-	}
+#ifdef HTABSTRESS
+	/* For debug, this path creates a very poor vsid distribuition.
+	 * A user program can access virtual addresses in the form
+	 * 0x0yyyyxxxx000 where yyyy = xxxx to cause multiple mappings
+	 * to hash to the same page table group.
+	 */
+	ordinal = ((ea >> 28) & 0x1fff) | (ea >> 44);
+	vsid = ordinal & VSID_MASK;
+#endif /* HTABSTRESS */
 
 	return vsid;
 } 
@@ -212,11 +218,11 @@ get_vsid( unsigned long context, unsigned long ea )
 	ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | context;
 	vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK;
 
-	ifppcdebug(PPCDBG_HTABSTRESS) {
-		/* See comment above. */
-		ordinal = ((ea >> 28) & 0x1fff) | (context << 16);
-		vsid = ordinal & VSID_MASK;
-	}
+#ifdef HTABSTRESS
+	/* See comment above. */
+	ordinal = ((ea >> 28) & 0x1fff) | (context << 16);
+	vsid = ordinal & VSID_MASK;
+#endif /* HTABSTRESS */
 
 	return vsid;
 }
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h
index 4182c647f..6903024ff 100644
--- a/include/asm-ppc64/mmzone.h
+++ b/include/asm-ppc64/mmzone.h
@@ -23,7 +23,6 @@ extern char *numa_memory_lookup_table;
 extern cpumask_t numa_cpumask_lookup_table[];
 extern int nr_cpus_in_node[];
 
-#define MAX_MEMORY (1UL << 41)
 /* 16MB regions */
 #define MEMORY_INCREMENT_SHIFT 24
 #define MEMORY_INCREMENT (1UL << MEMORY_INCREMENT_SHIFT)
diff --git a/include/asm-ppc64/naca.h b/include/asm-ppc64/naca.h
index a50189402..3c0b8d3a5 100644
--- a/include/asm-ppc64/naca.h
+++ b/include/asm-ppc64/naca.h
@@ -30,7 +30,7 @@ struct naca_struct {
 	u64 log;                        /* Ptr to log buffer         0x30 */
 	u64 serialPortAddr;		/* Phy addr of serial port   0x38 */
 	u64 interrupt_controller;	/* Type of int controller    0x40 */ 
-	u64 slb_size;			/* SLB size in entries       0x48 */
+	u64 unused1;			/* was SLB size in entries   0x48 */
 	u64 pftSize;			/* Log 2 of page table size  0x50 */
 	void *systemcfg;		/* Pointer to systemcfg data 0x58 */
 	u32 dCacheL1LogLineSize;	/* L1 d-cache line size Log2 0x60 */
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h
index d368afedd..bf38c7f01 100644
--- a/include/asm-ppc64/paca.h
+++ b/include/asm-ppc64/paca.h
@@ -37,6 +37,8 @@ extern struct paca_struct paca[];
 register struct paca_struct *local_paca asm("r13");
 #define get_paca()	local_paca
 
+struct task_struct;
+
 /*============================================================================
  * Name_______:	paca
  *
@@ -59,9 +61,12 @@ struct paca_struct {
  */
 	struct ItLpPaca *xLpPacaPtr;	/* Pointer to LpPaca for PLIC		0x00 */
 	struct ItLpRegSave *xLpRegSavePtr; /* Pointer to LpRegSave for PLIC	0x08 */
-	u64 xCurrent;  		        /* Pointer to current			0x10 */
-	u16 xPacaIndex;			/* Logical processor number		0x18 */
-        u16 xHwProcNum;                 /* Physical processor number            0x1A */
+	struct task_struct *xCurrent;	/* Pointer to current			0x10 */
+	/* Note: the spinlock functions in arch/ppc64/lib/locks.c load lock_token and
+	   xPacaIndex with a single lwz instruction, using the constant offset 24.
+	   If you move either field, fix the spinlocks and rwlocks. */
+	u16 lock_token;			/* Constant 0x8000, used in spinlocks	0x18 */
+	u16 xPacaIndex;			/* Logical processor number		0x1A */
 	u32 default_decr;		/* Default decrementer value		0x1c */	
 	u64 xKsave;			/* Saved Kernel stack addr or zero	0x20 */
 	struct ItLpQueue *lpQueuePtr;	/* LpQueue handled by this processor    0x28 */
@@ -70,7 +75,8 @@ struct paca_struct {
 	u8 *exception_sp;		/*                                      0x50 */
 	u8 xProcEnabled;		/*                                      0x58 */
 	u8 prof_enabled;		/* 1=iSeries profiling enabled          0x59 */
-	u8 resv1[38];			/*					0x5a-0x7f*/
+	u16 xHwProcNum;			/* Physical processor number		0x5a */
+	u8 resv1[36];			/*					0x5c */
 
 /*=====================================================================================
  * CACHE_LINE_2 0x0080 - 0x00FF
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index 984602ae4..b144b14dc 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -12,18 +12,21 @@
 
 #include <linux/config.h>
 
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	12
-#ifndef __ASSEMBLY__
-# define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#ifdef __ASSEMBLY__
+  #define ASM_CONST(x) x
 #else
-# define PAGE_SIZE	(1 << PAGE_SHIFT)
+  #define __ASM_CONST(x) x##UL
+  #define ASM_CONST(x) __ASM_CONST(x)
 #endif
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT	12
+#define PAGE_SIZE	(ASM_CONST(1) << PAGE_SHIFT)
 #define PAGE_MASK	(~(PAGE_SIZE-1))
 #define PAGE_OFFSET_MASK (PAGE_SIZE-1)
 
 #define SID_SHIFT       28
-#define SID_MASK        0xfffffffff
+#define SID_MASK        0xfffffffffUL
 #define GET_ESID(x)     (((x) >> SID_SHIFT) & SID_MASK)
 
 #ifdef CONFIG_HUGETLB_PAGE
@@ -196,11 +199,11 @@ extern int page_is_ram(unsigned long physaddr);
 /*       KERNELBASE is defined for performance reasons. */
 /*       When KERNELBASE moves, those macros may have   */
 /*             to change!                               */
-#define PAGE_OFFSET     0xC000000000000000
+#define PAGE_OFFSET     ASM_CONST(0xC000000000000000)
 #define KERNELBASE      PAGE_OFFSET
-#define VMALLOCBASE     0xD000000000000000
-#define IOREGIONBASE    0xE000000000000000
-#define EEHREGIONBASE   0xA000000000000000
+#define VMALLOCBASE     0xD000000000000000UL
+#define IOREGIONBASE    0xE000000000000000UL
+#define EEHREGIONBASE   0xA000000000000000UL
 
 #define IO_REGION_ID       (IOREGIONBASE>>REGION_SHIFT)
 #define EEH_REGION_ID      (EEHREGIONBASE>>REGION_SHIFT)
diff --git a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h
index 251bbd9a5..3a073a3c0 100644
--- a/include/asm-ppc64/pgalloc.h
+++ b/include/asm-ppc64/pgalloc.h
@@ -48,28 +48,43 @@ pmd_free(pmd_t *pmd)
 	pmd_populate_kernel(mm, pmd, page_address(pte_page))
 
 static inline pte_t *
-pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
+pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
-	return kmem_cache_alloc(zero_cache, GFP_KERNEL|__GFP_REPEAT);
+	pte_t *pte;
+	pte = kmem_cache_alloc(zero_cache, GFP_KERNEL|__GFP_REPEAT);
+	if (pte) {
+		struct page *ptepage = virt_to_page(pte);
+		ptepage->mapping = (void *) mm;
+		ptepage->index = address & PMD_MASK;
+	}
+	return pte;
 }
 
 static inline struct page *
 pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pte_t *pte = pte_alloc_one_kernel(mm, address);
-
-	if (pte)
-		return virt_to_page(pte);
-
+	pte_t *pte;
+	pte = kmem_cache_alloc(zero_cache, GFP_KERNEL|__GFP_REPEAT);
+	if (pte) {
+		struct page *ptepage = virt_to_page(pte);
+		ptepage->mapping = (void *) mm;
+		ptepage->index = address & PMD_MASK;
+		return ptepage;
+	}
 	return NULL;
 }
 		
 static inline void pte_free_kernel(pte_t *pte)
 {
+	virt_to_page(pte)->mapping = NULL;
 	kmem_cache_free(zero_cache, pte);
 }
 
-#define pte_free(pte_page)	pte_free_kernel(page_address(pte_page))
+static inline void pte_free(struct page *ptepage)
+{
+	ptepage->mapping = NULL;
+	kmem_cache_free(zero_cache, page_address(ptepage));
+}
 
 struct pte_freelist_batch
 {
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
index 6ca8b0c91..b1e7f6d4f 100644
--- a/include/asm-ppc64/pgtable.h
+++ b/include/asm-ppc64/pgtable.h
@@ -47,7 +47,7 @@
 /*
  * Define the address range of the vmalloc VM area.
  */
-#define VMALLOC_START (0xD000000000000000)
+#define VMALLOC_START (0xD000000000000000ul)
 #define VMALLOC_END   (VMALLOC_START + VALID_EA_BITS)
 
 /*
@@ -56,8 +56,8 @@
  */
 #define IMALLOC_START     (ioremap_bot)
 #define IMALLOC_VMADDR(x) ((unsigned long)(x))
-#define PHBS_IO_BASE  	  (0xE000000000000000)	/* Reserve 2 gigs for PHBs */
-#define IMALLOC_BASE      (0xE000000080000000)  
+#define PHBS_IO_BASE  	  (0xE000000000000000ul)	/* Reserve 2 gigs for PHBs */
+#define IMALLOC_BASE      (0xE000000080000000ul)  
 #define IMALLOC_END       (IMALLOC_BASE + VALID_EA_BITS)
 
 /*
@@ -306,7 +306,10 @@ static inline unsigned long pte_update(pte_t *p, unsigned long clr)
 	return old;
 }
 
-/* PTE updating functions */
+/* PTE updating functions, this function puts the PTE in the
+ * batch, doesn't actually triggers the hash flush immediately,
+ * you need to call flush_tlb_pending() to do that.
+ */
 extern void hpte_update(pte_t *ptep, unsigned long pte, int wrprot);
 
 static inline int ptep_test_and_clear_young(pte_t *ptep)
@@ -318,7 +321,7 @@ static inline int ptep_test_and_clear_young(pte_t *ptep)
 	old = pte_update(ptep, _PAGE_ACCESSED);
 	if (old & _PAGE_HASHPTE) {
 		hpte_update(ptep, old, 0);
-		flush_tlb_pending();	/* XXX generic code doesn't flush */
+		flush_tlb_pending();
 	}
 	return (old & _PAGE_ACCESSED) != 0;
 }
@@ -396,11 +399,40 @@ static inline void pte_clear(pte_t * ptep)
  */
 static inline void set_pte(pte_t *ptep, pte_t pte)
 {
-	if (pte_present(*ptep))
+	if (pte_present(*ptep)) {
 		pte_clear(ptep);
+		flush_tlb_pending();
+	}
 	*ptep = __pte(pte_val(pte)) & ~_PAGE_HPTEFLAGS;
 }
 
+/* Set the dirty and/or accessed bits atomically in a linux PTE, this
+ * function doesn't need to flush the hash entry
+ */
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
+{
+	unsigned long bits = pte_val(entry) &
+		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
+	unsigned long old, tmp;
+
+	__asm__ __volatile__(
+	"1:	ldarx	%0,0,%4\n\
+		andi.	%1,%0,%6\n\
+		bne-	1b \n\
+		or	%0,%3,%0\n\
+		stdcx.	%0,0,%4\n\
+		bne-	1b"
+	:"=&r" (old), "=&r" (tmp), "=m" (*ptep)
+	:"r" (bits), "r" (ptep), "m" (ptep), "i" (_PAGE_BUSY)
+	:"cc");
+}
+#define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+	do {								   \
+		__ptep_set_access_flags(__ptep, __entry, __dirty);	   \
+		flush_tlb_page_nohash(__vma, __address);	       	   \
+	} while(0)
+
 /*
  * Macro to mark a page protection value as "uncacheable".
  */
@@ -471,8 +503,6 @@ extern struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
 			int region_type);
 unsigned long im_free(void *addr);
 
-typedef pte_t *pte_addr_t;
-
 long pSeries_lpar_hpte_insert(unsigned long hpte_group,
 			      unsigned long va, unsigned long prpn,
 			      int secondary, unsigned long hpteflags,
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
index 7338ea298..f4a36ea03 100644
--- a/include/asm-ppc64/ppc32.h
+++ b/include/asm-ppc64/ppc32.h
@@ -141,9 +141,4 @@ struct ucontext32 {
 	struct mcontext32	uc_mcontext;
 };
 
-struct ipc_kludge_32 {
-	unsigned int msgp;
-	int msgtyp;
-};
-
 #endif  /* _PPC64_PPC32_H */
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index d3e83108c..428080919 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -384,6 +384,8 @@
 #define	PV_POWER4p	0x0038
 #define PV_GPUL		0x0039
 #define	PV_POWER5	0x003A
+#define PV_POWER5p	0x003B
+#define PV_GPULp	0x003C
 #define	PV_630        	0x0040
 #define	PV_630p	        0x0041
 
@@ -625,6 +627,17 @@ static inline void prefetchw(const void *x)
 
 #define spin_lock_prefetch(x)	prefetchw(x)
 
+#ifdef CONFIG_SCHED_SMT
+#define ARCH_HAS_SCHED_DOMAIN
+#define ARCH_HAS_SCHED_WAKE_IDLE
+#endif
+
 #endif /* ASSEMBLY */
 
+/*
+ * Number of entries in the SLB. If this ever changes we should handle
+ * it with a use a cpu feature fixup.
+ */
+#define SLB_NUM_ENTRIES 64
+
 #endif /* __ASM_PPC64_PROCESSOR_H */
diff --git a/include/asm-ppc64/ptrace.h b/include/asm-ppc64/ptrace.h
index 1b5b1bac4..c4e809d69 100644
--- a/include/asm-ppc64/ptrace.h
+++ b/include/asm-ppc64/ptrace.h
@@ -124,7 +124,7 @@ struct pt_regs32 {
 /* Kernel and userspace will both use this PT_FPSCR value.  32-bit apps will have
  * visibility to the asm-ppc/ptrace.h header instead of this one.
  */
-#define PT_FPSCR (PT_FPR0 + 32 + 1)	  /* each FP reg occupies 1 slot in 64-bit space */
+#define PT_FPSCR (PT_FPR0 + 32)	  /* each FP reg occupies 1 slot in 64-bit space */
 
 #ifdef __KERNEL__
 #define PT_FPSCR32 (PT_FPR0 + 2*32 + 1)	  /* each FP reg occupies 2 32-bit userspace slots */
diff --git a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h
index 47232af7b..e51ebb166 100644
--- a/include/asm-ppc64/rtas.h
+++ b/include/asm-ppc64/rtas.h
@@ -166,7 +166,7 @@ extern struct flash_block_list_header rtas_firmware_flash_list;
 
 extern struct rtas_t rtas;
 
-extern void enter_rtas(struct rtas_args *);
+extern void enter_rtas(unsigned long);
 extern int rtas_token(const char *service);
 extern long rtas_call(int token, int, int, unsigned long *, ...);
 extern void call_rtas_display_status(char);
diff --git a/include/asm-ppc64/sigcontext.h b/include/asm-ppc64/sigcontext.h
index 86cd52556..6f8aee768 100644
--- a/include/asm-ppc64/sigcontext.h
+++ b/include/asm-ppc64/sigcontext.h
@@ -7,7 +7,7 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-
+#include <linux/compiler.h>
 #include <asm/ptrace.h>
 #include <asm/elf.h>
 
@@ -18,7 +18,7 @@ struct sigcontext {
 	int		_pad0;
 	unsigned long	handler;
 	unsigned long	oldmask;
-	struct pt_regs	*regs;
+	struct pt_regs	__user *regs;
 	elf_gregset_t	gp_regs;
 	elf_fpregset_t	fp_regs;
 /*
@@ -40,7 +40,7 @@ struct sigcontext {
  * The entry with index 33 contains the vrsave as the first word (offset 0) 
  * within the quadword.
  */
-	elf_vrreg_t	*v_regs;
+	elf_vrreg_t	__user *v_regs;
 	long		vmx_reserve[ELF_NVRREG+ELF_NVRREG+1];
 };
 
diff --git a/include/asm-ppc64/spinlock.h b/include/asm-ppc64/spinlock.h
index 4181bd232..a16b2ff58 100644
--- a/include/asm-ppc64/spinlock.h
+++ b/include/asm-ppc64/spinlock.h
@@ -4,7 +4,7 @@
 /*
  * Simple spin lock operations.  
  *
- * Copyright (C) 2001 Paul Mackerras <paulus@au.ibm.com>, IBM
+ * Copyright (C) 2001-2004 Paul Mackerras <paulus@au.ibm.com>, IBM
  * Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
  *
  * Type of int is used as a full 64b word is not necessary.
@@ -14,6 +14,8 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+#include <linux/config.h>
+
 typedef struct {
 	volatile unsigned int lock;
 } spinlock_t;
@@ -22,25 +24,48 @@ typedef struct {
 #define SPIN_LOCK_UNLOCKED	(spinlock_t) { 0 }
 
 #define spin_is_locked(x)	((x)->lock != 0)
+#define spin_lock_init(x)	do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
+
+static __inline__ void _raw_spin_unlock(spinlock_t *lock)
+{
+	__asm__ __volatile__("lwsync	# spin_unlock": : :"memory");
+	lock->lock = 0;
+}
+
+/*
+ * Normally we use the spinlock functions in arch/ppc64/lib/locks.c.
+ * For special applications such as profiling, we can have the
+ * spinlock functions inline by defining CONFIG_SPINLINE.
+ * This is not recommended on partitioned systems with shared
+ * processors, since the inline spinlock functions don't include
+ * the code for yielding the CPU to the lock holder.
+ */
+
+#ifndef CONFIG_SPINLINE
+extern int _raw_spin_trylock(spinlock_t *lock);
+extern void _raw_spin_lock(spinlock_t *lock);
+extern void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags);
+extern void spin_unlock_wait(spinlock_t *lock);
+
+#else
 
 static __inline__ int _raw_spin_trylock(spinlock_t *lock)
 {
-	unsigned int tmp;
+	unsigned int tmp, tmp2;
 
 	__asm__ __volatile__(
-"1:	lwarx		%0,0,%1		# spin_trylock\n\
+"1:	lwarx		%0,0,%2		# spin_trylock\n\
 	cmpwi		0,%0,0\n\
-	li		%0,0\n\
 	bne-		2f\n\
-	li		%0,1\n\
-	stwcx.		%0,0,%1\n\
+	lwz		%1,24(13)\n\
+	stwcx.		%1,0,%2\n\
 	bne-		1b\n\
 	isync\n\
-2:"	: "=&r"(tmp)
+2:"	: "=&r"(tmp), "=&r"(tmp2)
 	: "r"(&lock->lock)
 	: "cr0", "memory");
 
-	return tmp;
+	return tmp == 0;
 }
 
 static __inline__ void _raw_spin_lock(spinlock_t *lock)
@@ -58,20 +83,51 @@ static __inline__ void _raw_spin_lock(spinlock_t *lock)
 "2:	lwarx		%0,0,%1\n\
 	cmpwi		0,%0,0\n\
 	bne-		1b\n\
-	stwcx.		%2,0,%1\n\
+	lwz		%0,24(13)\n\
+	stwcx.		%0,0,%1\n\
 	bne-		2b\n\
 	isync"
 	: "=&r"(tmp)
-	: "r"(&lock->lock), "r"(1)
+	: "r"(&lock->lock)
 	: "cr0", "memory");
 }
 
-static __inline__ void _raw_spin_unlock(spinlock_t *lock)
+/*
+ * Note: if we ever want to inline the spinlocks on iSeries,
+ * we will have to change the irq enable/disable stuff in here.
+ */
+static __inline__ void _raw_spin_lock_flags(spinlock_t *lock,
+					    unsigned long flags)
 {
-	__asm__ __volatile__("eieio	# spin_unlock": : :"memory");
-	lock->lock = 0;
+	unsigned int tmp;
+	unsigned long tmp2;
+
+	__asm__ __volatile__(
+	"b		3f		# spin_lock\n\
+1:	mfmsr		%1\n\
+	mtmsrd		%3,1\n\
+2:"	HMT_LOW
+"	lwzx		%0,0,%2\n\
+	cmpwi		0,%0,0\n\
+	bne+		2b\n"
+	HMT_MEDIUM
+"	mtmsrd		%1,1\n\
+3:	lwarx		%0,0,%2\n\
+	cmpwi		0,%0,0\n\
+	bne-		1b\n\
+	lwz		%1,24(13)\n\
+	stwcx.		%1,0,%2\n\
+	bne-		3b\n\
+	isync"
+	: "=&r"(tmp), "=&r"(tmp2)
+	: "r"(&lock->lock), "r"(flags)
+	: "cr0", "memory");
 }
 
+#define spin_unlock_wait(x)	do { cpu_relax(); } while (spin_is_locked(x))
+
+#endif /* CONFIG_SPINLINE */
+
 /*
  * Read-write spinlocks, allowing multiple readers
  * but only one writer.
@@ -88,6 +144,34 @@ typedef struct {
 
 #define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
 
+#define rwlock_init(x)		do { *(x) = RW_LOCK_UNLOCKED; } while(0)
+#define rwlock_is_locked(x)	((x)->lock)
+
+static __inline__ int is_read_locked(rwlock_t *rw)
+{
+	return rw->lock > 0;
+}
+
+static __inline__ int is_write_locked(rwlock_t *rw)
+{
+	return rw->lock < 0;
+}
+
+static __inline__ void _raw_write_unlock(rwlock_t *rw)
+{
+	__asm__ __volatile__("lwsync		# write_unlock": : :"memory");
+	rw->lock = 0;
+}
+
+#ifndef CONFIG_SPINLINE
+extern int _raw_read_trylock(rwlock_t *rw);
+extern void _raw_read_lock(rwlock_t *rw);
+extern void _raw_read_unlock(rwlock_t *rw);
+extern int _raw_write_trylock(rwlock_t *rw);
+extern void _raw_write_lock(rwlock_t *rw);
+extern void _raw_write_unlock(rwlock_t *rw);
+
+#else
 static __inline__ int _raw_read_trylock(rwlock_t *rw)
 {
 	unsigned int tmp;
@@ -139,7 +223,7 @@ static __inline__ void _raw_read_unlock(rwlock_t *rw)
 	unsigned int tmp;
 
 	__asm__ __volatile__(
-	"eieio				# read_unlock\n\
+	"lwsync				# read_unlock\n\
 1:	lwarx		%0,0,%1\n\
 	addic		%0,%0,-1\n\
 	stwcx.		%0,0,%1\n\
@@ -192,29 +276,7 @@ static __inline__ void _raw_write_lock(rwlock_t *rw)
 	: "r"(&rw->lock), "r"(-1)
 	: "cr0", "memory");
 }
-
-static __inline__ void _raw_write_unlock(rwlock_t *rw)
-{
-	__asm__ __volatile__("eieio		# write_unlock": : :"memory");
-	rw->lock = 0;
-}
-
-static __inline__ int is_read_locked(rwlock_t *rw)
-{
-	return rw->lock > 0;
-}
-
-static __inline__ int is_write_locked(rwlock_t *rw)
-{
-	return rw->lock < 0;
-}
-
-#define spin_lock_init(x)      do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
-#define spin_unlock_wait(x)    do { cpu_relax(); } while(spin_is_locked(x))
-
-#define rwlock_init(x)         do { *(x) = RW_LOCK_UNLOCKED; } while(0)
-
-#define rwlock_is_locked(x)	((x)->lock)
+#endif /* CONFIG_SPINLINE */
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h
index 152a59acb..bb1ebb203 100644
--- a/include/asm-ppc64/system.h
+++ b/include/asm-ppc64/system.h
@@ -29,22 +29,26 @@
  * read_barrier_depends() prevents data-dependent loads being reordered
  *	across this point (nop on PPC).
  *
- * We can use the eieio instruction for wmb, but since it doesn't
- * give any ordering guarantees about loads, we have to use the
- * stronger but slower sync instruction for mb and rmb.
+ * We have to use the sync instructions for mb(), since lwsync doesn't
+ * order loads with respect to previous stores.  Lwsync is fine for
+ * rmb(), though.
+ * For wmb(), we use sync since wmb is used in drivers to order
+ * stores to system memory with respect to writes to the device.
+ * However, smp_wmb() can be a lighter-weight eieio barrier on
+ * SMP since it is only used to order updates to system memory.
  */
 #define mb()   __asm__ __volatile__ ("sync" : : : "memory")
 #define rmb()  __asm__ __volatile__ ("lwsync" : : : "memory")
-#define wmb()  __asm__ __volatile__ ("eieio" : : : "memory")
+#define wmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define read_barrier_depends()  do { } while(0)
 
-#define set_mb(var, value)	do { var = value; mb(); } while (0)
-#define set_wmb(var, value)	do { var = value; wmb(); } while (0)
+#define set_mb(var, value)	do { var = value; smp_mb(); } while (0)
+#define set_wmb(var, value)	do { var = value; smp_wmb(); } while (0)
 
 #ifdef CONFIG_SMP
 #define smp_mb()	mb()
 #define smp_rmb()	rmb()
-#define smp_wmb()	wmb()
+#define smp_wmb()	__asm__ __volatile__ ("eieio" : : : "memory")
 #define smp_read_barrier_depends()  read_barrier_depends()
 #else
 #define smp_mb()	__asm__ __volatile__("": : :"memory")
@@ -60,6 +64,7 @@ struct pt_regs;
 #ifdef CONFIG_DEBUGGER
 
 extern int (*__debugger)(struct pt_regs *regs);
+extern int (*__debugger_ipi)(struct pt_regs *regs);
 extern int (*__debugger_bpt)(struct pt_regs *regs);
 extern int (*__debugger_sstep)(struct pt_regs *regs);
 extern int (*__debugger_iabr_match)(struct pt_regs *regs);
@@ -75,6 +80,7 @@ static inline int __NAME(struct pt_regs *regs) \
 }
 
 DEBUGGER_BOILERPLATE(debugger)
+DEBUGGER_BOILERPLATE(debugger_ipi)
 DEBUGGER_BOILERPLATE(debugger_bpt)
 DEBUGGER_BOILERPLATE(debugger_sstep)
 DEBUGGER_BOILERPLATE(debugger_iabr_match)
@@ -87,6 +93,7 @@ extern void xmon_init(void);
 
 #else
 static inline int debugger(struct pt_regs *regs) { return 0; }
+static inline int debugger_ipi(struct pt_regs *regs) { return 0; }
 static inline int debugger_bpt(struct pt_regs *regs) { return 0; }
 static inline int debugger_sstep(struct pt_regs *regs) { return 0; }
 static inline int debugger_iabr_match(struct pt_regs *regs) { return 0; }
diff --git a/include/asm-ppc64/termbits.h b/include/asm-ppc64/termbits.h
index 6cd7e99c7..d1a2bee10 100644
--- a/include/asm-ppc64/termbits.h
+++ b/include/asm-ppc64/termbits.h
@@ -89,6 +89,7 @@ struct termios {
 #define   TAB1	00002000
 #define   TAB2	00004000
 #define   TAB3	00006000
+#define   XTABS	00006000	/* required by POSIX to == TAB3 */
 #define CRDLY	00030000
 #define   CR0	00000000
 #define   CR1	00010000
@@ -103,7 +104,6 @@ struct termios {
 #define VTDLY	00200000
 #define   VT0	00000000
 #define   VT1	00200000
-#define XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
 
 /* c_cflag bit meaning */
 #define CBAUD	0000377
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h
index 297c974bf..a4674974c 100644
--- a/include/asm-ppc64/thread_info.h
+++ b/include/asm-ppc64/thread_info.h
@@ -69,10 +69,6 @@ struct thread_info {
 #define get_thread_info(ti)	get_task_struct((ti)->task)
 #define put_thread_info(ti)	put_task_struct((ti)->task)
 
-#if THREAD_SIZE != (4*PAGE_SIZE)
-#error update vmlinux.lds and current_thread_info to match
-#endif
-
 /* how to get the thread information struct from C */
 static inline struct thread_info *current_thread_info(void)
 {
diff --git a/include/asm-ppc64/tlbflush.h b/include/asm-ppc64/tlbflush.h
index 92aeb579a..183bdfba9 100644
--- a/include/asm-ppc64/tlbflush.h
+++ b/include/asm-ppc64/tlbflush.h
@@ -6,6 +6,7 @@
  *
  *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
  *  - flush_tlb_page(vma, vmaddr) flushes one page
+ *  - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
  *  - flush_tlb_range(vma, start, end) flushes a range of pages
  *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
  *  - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
@@ -39,6 +40,7 @@ static inline void flush_tlb_pending(void)
 
 #define flush_tlb_mm(mm)			flush_tlb_pending()
 #define flush_tlb_page(vma, addr)		flush_tlb_pending()
+#define flush_tlb_page_nohash(vma, addr)       	do { } while (0)
 #define flush_tlb_range(vma, start, end) \
 		do { (void)(start); flush_tlb_pending(); } while (0)
 #define flush_tlb_kernel_range(start, end)	flush_tlb_pending()
diff --git a/include/asm-ppc64/types.h b/include/asm-ppc64/types.h
index 0fb0412a5..5b8c2cfa1 100644
--- a/include/asm-ppc64/types.h
+++ b/include/asm-ppc64/types.h
@@ -71,6 +71,8 @@ typedef struct {
 	unsigned long toc;
 	unsigned long env;
 } func_descr_t;
+
+typedef unsigned int kmem_bufctl_t;
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h
index 0a031ab11..9423be5ad 100644
--- a/include/asm-ppc64/uaccess.h
+++ b/include/asm-ppc64/uaccess.h
@@ -54,7 +54,7 @@
 	(((segment).seg & (addr | size )) == 0)
 
 #define access_ok(type,addr,size) \
-	__access_ok(((unsigned long)(addr)),(size),get_fs())
+	__access_ok(((__force unsigned long)(addr)),(size),get_fs())
 
 static inline int verify_area(int type, const void __user *addr, unsigned long size)
 {
@@ -116,6 +116,7 @@ extern long __put_user_bad(void);
 #define __put_user_nocheck(x,ptr,size)				\
 ({								\
 	long __pu_err;						\
+	__chk_user_ptr(ptr);					\
 	__put_user_size((x),(ptr),(size),__pu_err,-EFAULT);	\
 	__pu_err;						\
 })
@@ -123,7 +124,7 @@ extern long __put_user_bad(void);
 #define __put_user_check(x,ptr,size)					\
 ({									\
 	long __pu_err = -EFAULT;					\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);				\
+	void __user *__pu_addr = (ptr);					\
 	if (access_ok(VERIFY_WRITE,__pu_addr,size))			\
 		__put_user_size((x),__pu_addr,(size),__pu_err,-EFAULT);	\
 	__pu_err;							\
@@ -187,6 +188,7 @@ extern long __get_user_bad(void);
 do {									\
 	might_sleep();							\
 	retval = 0;							\
+	__chk_user_ptr(ptr);						\
 	switch (size) {							\
 	  case 1: __get_user_asm(x,ptr,retval,"lbz",errret); break;	\
 	  case 2: __get_user_asm(x,ptr,retval,"lhz",errret); break;	\
diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h
index 8b3e5d562..20c4b3aae 100644
--- a/include/asm-ppc64/unistd.h
+++ b/include/asm-ppc64/unistd.h
@@ -278,8 +278,9 @@
 #define __NR_mq_timedreceive	265
 #define __NR_mq_notify		266
 #define __NR_mq_getsetattr	267
+#define __NR_kexec_load		268
 
-#define __NR_syscalls		268
+#define __NR_syscalls		269
 #ifdef __KERNEL__
 #define NR_syscalls	__NR_syscalls
 #endif
@@ -418,6 +419,28 @@ static inline _syscall3(int, execve, __const__ char *, file, char **, argv,
 #include <linux/compiler.h>
 #include <linux/linkage.h>
 
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+
 unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot,
 		       unsigned long flags, unsigned long fd, off_t offset);
 struct pt_regs;
@@ -433,7 +456,7 @@ int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
 int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
 		unsigned long p4, unsigned long p5, unsigned long p6,
 		struct pt_regs *regs);
-int sys_pipe(int *fildes);
+int sys_pipe(int __user *fildes);
 int sys_ptrace(long request, long pid, long addr, long data);
 struct sigaction;
 long sys_rt_sigaction(int sig, const struct sigaction __user *act,
diff --git a/include/asm-ppc64/vio.h b/include/asm-ppc64/vio.h
index 1ef9a270e..36fc9f9d1 100644
--- a/include/asm-ppc64/vio.h
+++ b/include/asm-ppc64/vio.h
@@ -43,8 +43,6 @@ struct iommu_table;
 
 int vio_register_driver(struct vio_driver *drv);
 void vio_unregister_driver(struct vio_driver *drv);
-const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, 
-						const struct vio_dev *dev);
 
 struct vio_dev * __devinit vio_register_device(struct device_node *node_vdev);
 void __devinit vio_unregister_device(struct vio_dev *dev);
@@ -52,7 +50,6 @@ struct vio_dev *vio_find_node(struct device_node *vnode);
 
 const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length);
 int vio_get_irq(struct vio_dev *dev);
-struct iommu_table * vio_build_iommu_table(struct vio_dev *dev);
 int vio_enable_interrupts(struct vio_dev *dev);
 int vio_disable_interrupts(struct vio_dev *dev);
 
@@ -110,8 +107,6 @@ static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
  * The vio_dev structure is used to describe virtual I/O devices.
  */
 struct vio_dev {
-	struct device_node *archdata;   /* Open Firmware node */
-	void *driver_data;              /* data private to the driver */
 	struct iommu_table *iommu_table;     /* vio_map_* uses this */
 	uint32_t unit_address;	
 	unsigned int irq;
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index 1544a74f1..541b6da9d 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -69,9 +69,10 @@ static __inline__ int atomic_inc_return(volatile atomic_t * v)
 {
 	return __CS_LOOP(v, 1, "ar");
 }
+
 static __inline__ int atomic_inc_and_test(volatile atomic_t * v)
 {
-	return __CS_LOOP(v, 1, "ar") != 0;
+	return __CS_LOOP(v, 1, "ar") == 0;
 }
 static __inline__ void atomic_dec(volatile atomic_t * v)
 {
@@ -144,7 +145,7 @@ static __inline__ long long atomic64_inc_return(volatile atomic64_t * v)
 }
 static __inline__ long long atomic64_inc_and_test(volatile atomic64_t * v)
 {
-	return __CSG_LOOP(v, 1, "agr") != 0;
+	return __CSG_LOOP(v, 1, "agr") == 0;
 }
 static __inline__ void atomic64_dec(volatile atomic64_t * v)
 {
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index f714d9e83..16bb08499 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -110,6 +110,7 @@ extern const char _sb_findmap[];
 
 #endif /* __s390x__ */
 
+#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE)
 #define __BITOPS_BARRIER() __asm__ __volatile__ ( "" : : : "memory" )
 
 #ifdef CONFIG_SMP
@@ -534,6 +535,7 @@ __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
 static inline int
 find_first_zero_bit(const unsigned long * addr, unsigned int size)
 {
+	typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
 	unsigned long cmp, count;
         unsigned int res;
 
@@ -566,13 +568,15 @@ find_first_zero_bit(const unsigned long * addr, unsigned int size)
                 "   alr  %0,%2\n"
                 "4:"
                 : "=&a" (res), "=&d" (cmp), "=&a" (count)
-                : "a" (size), "a" (addr), "a" (&_zb_findmap) : "cc" );
+                : "a" (size), "a" (addr), "a" (&_zb_findmap),
+		  "m" (*(addrtype *) addr) : "cc" );
         return (res < size) ? res : size;
 }
 
 static inline int
 find_first_bit(const unsigned long * addr, unsigned int size)
 {
+	typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
 	unsigned long cmp, count;
         unsigned int res;
 
@@ -605,7 +609,8 @@ find_first_bit(const unsigned long * addr, unsigned int size)
                 "   alr  %0,%2\n"
                 "4:"
                 : "=&a" (res), "=&d" (cmp), "=&a" (count)
-                : "a" (size), "a" (addr), "a" (&_sb_findmap) : "cc" );
+                : "a" (size), "a" (addr), "a" (&_sb_findmap),
+		  "m" (*(addrtype *) addr) : "cc" );
         return (res < size) ? res : size;
 }
 
@@ -695,6 +700,7 @@ find_next_bit (const unsigned long * addr, int size, int offset)
 static inline unsigned long
 find_first_zero_bit(const unsigned long * addr, unsigned long size)
 {
+	typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
         unsigned long res, cmp, count;
 
         if (!size)
@@ -730,13 +736,15 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size)
                 "   algr  %0,%2\n"
                 "5:"
                 : "=&a" (res), "=&d" (cmp), "=&a" (count)
-		: "a" (size), "a" (addr), "a" (&_zb_findmap) : "cc" );
+		: "a" (size), "a" (addr), "a" (&_zb_findmap),
+		  "m" (*(addrtype *) addr) : "cc" );
         return (res < size) ? res : size;
 }
 
 static inline unsigned long
 find_first_bit(const unsigned long * addr, unsigned long size)
 {
+	typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
         unsigned long res, cmp, count;
 
         if (!size)
@@ -772,7 +780,8 @@ find_first_bit(const unsigned long * addr, unsigned long size)
                 "   algr  %0,%2\n"
                 "5:"
                 : "=&a" (res), "=&d" (cmp), "=&a" (count)
-		: "a" (size), "a" (addr), "a" (&_sb_findmap) : "cc" );
+		: "a" (size), "a" (addr), "a" (&_sb_findmap),
+		  "m" (*(addrtype *) addr) : "cc" );
         return (res < size) ? res : size;
 }
 
@@ -983,6 +992,7 @@ static inline int sched_find_first_bit(unsigned long *b)
 static inline int 
 ext2_find_first_zero_bit(void *vaddr, unsigned int size)
 {
+	typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
 	unsigned long cmp, count;
         unsigned int res;
 
@@ -1016,7 +1026,8 @@ ext2_find_first_zero_bit(void *vaddr, unsigned int size)
                 "   alr  %0,%2\n"
                 "4:"
                 : "=&a" (res), "=&d" (cmp), "=&a" (count)
-                : "a" (size), "a" (vaddr), "a" (&_zb_findmap) : "cc" );
+                : "a" (size), "a" (vaddr), "a" (&_zb_findmap),
+		  "m" (*(addrtype *) vaddr) : "cc" );
         return (res < size) ? res : size;
 }
 
@@ -1068,6 +1079,7 @@ ext2_find_next_zero_bit(void *vaddr, unsigned int size, unsigned offset)
 static inline unsigned long
 ext2_find_first_zero_bit(void *vaddr, unsigned long size)
 {
+	typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
         unsigned long res, cmp, count;
 
         if (!size)
@@ -1103,7 +1115,8 @@ ext2_find_first_zero_bit(void *vaddr, unsigned long size)
                 "   algr  %0,%2\n"
                 "5:"
                 : "=&a" (res), "=&d" (cmp), "=&a" (count)
-		: "a" (size), "a" (vaddr), "a" (&_zb_findmap) : "cc" );
+		: "a" (size), "a" (vaddr), "a" (&_zb_findmap),
+		  "m" (*(addrtype *) vaddr) : "cc" );
         return (res < size) ? res : size;
 }
 
diff --git a/include/asm-s390/cacheflush.h b/include/asm-s390/cacheflush.h
index d1ff292fd..3c613c8e6 100644
--- a/include/asm-s390/cacheflush.h
+++ b/include/asm-s390/cacheflush.h
@@ -10,6 +10,8 @@
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start, end)		do { } while (0)
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
diff --git a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h
index 468da9644..471f2af2b 100644
--- a/include/asm-s390/checksum.h
+++ b/include/asm-s390/checksum.h
@@ -93,8 +93,8 @@ csum_partial_inline(const unsigned char * buff, int len, unsigned int sum)
  * Copy from userspace and compute checksum.  If we catch an exception
  * then zero the rest of the buffer.
  */
-static inline unsigned int 
-csum_partial_copy_from_user (const char *src, char *dst,
+static inline unsigned int
+csum_partial_copy_from_user(const char __user *src, char *dst,
                                           int len, unsigned int sum,
                                           int *err_ptr)
 {
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h
index 81b21b837..7f8f544eb 100644
--- a/include/asm-s390/compat.h
+++ b/include/asm-s390/compat.h
@@ -123,19 +123,19 @@ typedef u32		compat_sigset_word;
  */
 typedef	u32		compat_uptr_t;
 
-static inline void *compat_ptr(compat_uptr_t uptr)
+static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
-	return (void *)(unsigned long)(uptr & 0x7fffffffUL);
+	return (void __user *)(unsigned long)(uptr & 0x7fffffffUL);
 }
 
-static inline void *compat_alloc_user_space(long len)
+static inline void __user *compat_alloc_user_space(long len)
 {
 	unsigned long stack;
 
 	stack = KSTK_ESP(current);
 	if (test_thread_flag(TIF_31BIT))
 		stack &= 0x7fffffffUL;
-	return (void *) (stack - len);
+	return (void __user *) (stack - len);
 }
 
 struct compat_ipc64_perm {
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index c266fe9fa..3148d5b2c 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -91,7 +91,8 @@ typedef int (debug_prolog_proc_t) (debug_info_t* id,
 				   char* out_buf);
 typedef int (debug_input_proc_t) (debug_info_t* id,
 				  struct debug_view* view,
-				  struct file* file, const char* user_buf,
+				  struct file* file,
+				  const char __user *user_buf,
 				  size_t in_buf_size, loff_t* offset);
 
 int debug_dflt_header_fn(debug_info_t* id, struct debug_view* view,
@@ -234,26 +235,6 @@ int debug_unregister_view(debug_info_t* id, struct debug_view* view);
 #define PRINT_FATAL(x...) printk ( KERN_DEBUG PRINTK_HEADER x )
 #endif				/* DASD_DEBUG */
 
-#if DASD_DEBUG > 4
-#define INTERNAL_ERROR(x...) PRINT_FATAL ( INTERNAL_ERRMSG ( x ) )
-#elif DASD_DEBUG > 2
-#define INTERNAL_ERROR(x...) PRINT_ERR ( INTERNAL_ERRMSG ( x ) )
-#elif DASD_DEBUG > 0
-#define INTERNAL_ERROR(x...) PRINT_WARN ( INTERNAL_ERRMSG ( x ) )
-#else
-#define INTERNAL_ERROR(x...)
-#endif				/* DASD_DEBUG */
-
-#if DASD_DEBUG > 5
-#define INTERNAL_CHECK(x...) PRINT_FATAL ( INTERNAL_CHKMSG ( x ) )
-#elif DASD_DEBUG > 3
-#define INTERNAL_CHECK(x...) PRINT_ERR ( INTERNAL_CHKMSG ( x ) )
-#elif DASD_DEBUG > 1
-#define INTERNAL_CHECK(x...) PRINT_WARN ( INTERNAL_CHKMSG ( x ) )
-#else
-#define INTERNAL_CHECK(x...)
-#endif				/* DASD_DEBUG */
-
 #undef DEBUG_MALLOC
 #ifdef DEBUG_MALLOC
 void *b;
diff --git a/include/asm-s390/idals.h b/include/asm-s390/idals.h
index ad444dc74..8f72c9b1c 100644
--- a/include/asm-s390/idals.h
+++ b/include/asm-s390/idals.h
@@ -218,7 +218,7 @@ idal_buffer_set_cda(struct idal_buffer *ib, struct ccw1 *ccw)
  * Copy count bytes from an idal buffer to user memory
  */
 static inline size_t
-idal_buffer_to_user(struct idal_buffer *ib, void *to, size_t count)
+idal_buffer_to_user(struct idal_buffer *ib, void __user *to, size_t count)
 {
 	size_t left;
 	int i;
@@ -228,7 +228,7 @@ idal_buffer_to_user(struct idal_buffer *ib, void *to, size_t count)
 		left = copy_to_user(to, ib->data[i], IDA_BLOCK_SIZE);
 		if (left)
 			return left + count - IDA_BLOCK_SIZE;
-		to = (void *) to + IDA_BLOCK_SIZE;
+		to = (void __user *) to + IDA_BLOCK_SIZE;
 		count -= IDA_BLOCK_SIZE;
 	}
 	return copy_to_user(to, ib->data[i], count);
@@ -238,7 +238,7 @@ idal_buffer_to_user(struct idal_buffer *ib, void *to, size_t count)
  * Copy count bytes from user memory to an idal buffer
  */
 static inline size_t
-idal_buffer_from_user(struct idal_buffer *ib, const void *from, size_t count)
+idal_buffer_from_user(struct idal_buffer *ib, const void __user *from, size_t count)
 {
 	size_t left;
 	int i;
@@ -248,7 +248,7 @@ idal_buffer_from_user(struct idal_buffer *ib, const void *from, size_t count)
 		left = copy_from_user(ib->data[i], from, IDA_BLOCK_SIZE);
 		if (left)
 			return left + count - IDA_BLOCK_SIZE;
-		from = (void *) from + IDA_BLOCK_SIZE;
+		from = (void __user *) from + IDA_BLOCK_SIZE;
 		count -= IDA_BLOCK_SIZE;
 	}
 	return copy_from_user(ib->data[i], from, count);
diff --git a/include/asm-s390/ipc.h b/include/asm-s390/ipc.h
index 060060a6c..d6c041e9c 100644
--- a/include/asm-s390/ipc.h
+++ b/include/asm-s390/ipc.h
@@ -15,7 +15,7 @@
  * See arch/s390/kernel/sys_s390.c for ugly details..
  */
 struct ipc_kludge {
-	struct msgbuf *msgp;
+	struct msgbuf __user *msgp;
 	long msgtyp;
 };
 
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 9addb02a3..7adef697a 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -5,10 +5,26 @@
 #include <asm/lowcore.h>
 
 /*
- * s390 uses the generic implementation for per cpu data, with the exception that
- * the offset of the cpu local data area is cached in the cpu's lowcore memory
+ * For builtin kernel code s390 uses the generic implementation for
+ * per cpu data, with the exception that the offset of the cpu local
+ * data area is cached in the cpu's lowcore memory
+ * For 64 bit module code s390 forces the use of a GOT slot for the
+ * address of the per cpu variable. This is needed because the module
+ * may be more than 4G above the per cpu area.
  */
+#if defined(__s390x__) && defined(MODULE)
+#define __get_got_cpu_var(var,offset) \
+  (*({ unsigned long *__ptr; \
+       asm ( "larl %0,per_cpu__"#var"@GOTENT" : "=a" (__ptr) ); \
+       ((typeof(&per_cpu__##var))((*__ptr) + offset)); \
+    }))
+#undef __get_cpu_var
+#define __get_cpu_var(var) __get_got_cpu_var(var,S390_lowcore.percpu_offset)
+#undef per_cpu
+#define per_cpu(var,cpu) __get_got_cpu_var(var,__per_cpu_offset[cpu])
+#else
 #undef __get_cpu_var
 #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, S390_lowcore.percpu_offset))
+#endif
 
 #endif /* __ARCH_S390_PERCPU__ */
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 1168f8626..11b67469b 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -580,12 +580,16 @@ static inline void ptep_mkdirty(pte_t *ptep)
 
 static inline void
 ptep_establish(struct vm_area_struct *vma, 
-	       unsigned long address, pte_t *ptep, pte_t entry)
+	       unsigned long address, pte_t *ptep,
+	       pte_t entry)
 {
 	ptep_clear_flush(vma, address, ptep);
 	set_pte(ptep, entry);
 }
 
+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+	ptep_establish(__vma, __address, __ptep, __entry)
+
 /*
  * Test and clear dirty bit in storage key.
  * We can't clear the changed bit atomically. This is a potential
@@ -760,8 +764,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)	((pte_t) { (x).val })
 
-typedef pte_t *pte_addr_t;
-
 #ifndef __s390x__
 # define PTE_FILE_MAX_BITS	26
 #else /* __s390x__ */
@@ -784,11 +786,8 @@ typedef pte_t *pte_addr_t;
  */
 #define pgtable_cache_init()	do { } while (0)
 
-#ifdef __s390x__
-# define HAVE_ARCH_UNMAPPED_AREA
-#endif /* __s390x__ */
-
 #define __HAVE_ARCH_PTEP_ESTABLISH
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 7ef811250..33154f85a 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -63,16 +63,19 @@ extern struct task_struct *last_task_used_math;
 
 # define TASK_SIZE		(0x80000000UL)
 # define TASK_UNMAPPED_BASE	(TASK_SIZE / 2)
+# define DEFAULT_TASK_SIZE	(0x80000000UL)
 
 #else /* __s390x__ */
 
-# define TASK_SIZE		(0x40000000000UL)
-# define TASK31_SIZE		(0x80000000UL)
-# define TASK_UNMAPPED_BASE	(test_thread_flag(TIF_31BIT) ? \
-					(TASK31_SIZE / 2) : (TASK_SIZE / 2))
+# define TASK_SIZE		(test_thread_flag(TIF_31BIT) ? \
+					(0x80000000UL) : (0x40000000000UL))
+# define TASK_UNMAPPED_BASE	(TASK_SIZE / 2)
+# define DEFAULT_TASK_SIZE	(0x40000000000UL)
 
 #endif /* __s390x__ */
 
+#define MM_VM_SIZE(mm)		DEFAULT_TASK_SIZE
+
 typedef struct {
         __u32 ar4;
 } mm_segment_t;
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 0b4ef95ad..fe6e1e311 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -303,6 +303,7 @@ typedef struct
  */
 struct pt_regs 
 {
+	unsigned long args[1];
 	psw_t psw;
 	unsigned long gprs[NUM_GPRS];
 	unsigned long orig_gpr2;
diff --git a/include/asm-s390/qeth.h b/include/asm-s390/qeth.h
index 8868027f3..930d378ef 100644
--- a/include/asm-s390/qeth.h
+++ b/include/asm-s390/qeth.h
@@ -8,19 +8,17 @@
  * Author(s):	Thomas Spatzier <tspat@de.ibm.com>
  *
  */
-#ifndef __ASM_S390_IOCTL_H__
-#define __ASM_S390_IOCTL_H__
+#ifndef __ASM_S390_QETH_IOCTL_H__
+#define __ASM_S390_QETH_IOCTL_H__
 #include <linux/ioctl.h>
 
-#define QETH_IOCTL_LETTER 'Q'
-
-#define SIOC_QETH_ARP_SET_NO_ENTRIES	_IOWR(QETH_IOCTL_LETTER, 1, int)
-#define SIOC_QETH_ARP_QUERY_INFO	_IOWR(QETH_IOCTL_LETTER, 2, int)
-#define SIOC_QETH_ARP_ADD_ENTRY		_IOWR(QETH_IOCTL_LETTER, 3, int)
-#define SIOC_QETH_ARP_REMOVE_ENTRY	_IOWR(QETH_IOCTL_LETTER, 4, int)
-#define SIOC_QETH_ARP_FLUSH_CACHE	_IOWR(QETH_IOCTL_LETTER, 5, int)
-#define SIOC_QETH_ADP_SET_SNMP_CONTROL	_IOWR(QETH_IOCTL_LETTER, 6, int)
-#define SIOC_QETH_GET_CARD_TYPE		_IOWR(QETH_IOCTL_LETTER, 7, int)
+#define SIOC_QETH_ARP_SET_NO_ENTRIES    (SIOCDEVPRIVATE)
+#define SIOC_QETH_ARP_QUERY_INFO        (SIOCDEVPRIVATE + 1)
+#define SIOC_QETH_ARP_ADD_ENTRY         (SIOCDEVPRIVATE + 2)
+#define SIOC_QETH_ARP_REMOVE_ENTRY      (SIOCDEVPRIVATE + 3)
+#define SIOC_QETH_ARP_FLUSH_CACHE       (SIOCDEVPRIVATE + 4)
+#define SIOC_QETH_ADP_SET_SNMP_CONTROL  (SIOCDEVPRIVATE + 5)
+#define SIOC_QETH_GET_CARD_TYPE         (SIOCDEVPRIVATE + 6)
 
 struct qeth_arp_cache_entry {
 	__u8  macaddr[6];
@@ -37,6 +35,13 @@ struct qeth_arp_qi_entry7 {
 	__u8 ipaddr[4];
 } __attribute__((packed));
 
+struct qeth_arp_qi_entry7_short {
+	__u8 macaddr_type;
+	__u8 ipaddr_type;
+	__u8 macaddr[6];
+	__u8 ipaddr[4];
+} __attribute__((packed));
+
 struct qeth_arp_qi_entry5 {
 	__u8 media_specific[32];
 	__u8 macaddr_type;
@@ -44,6 +49,19 @@ struct qeth_arp_qi_entry5 {
 	__u8 ipaddr[4];
 } __attribute__((packed));
 
+struct qeth_arp_qi_entry5_short {
+	__u8 macaddr_type;
+	__u8 ipaddr_type;
+	__u8 ipaddr[4];
+} __attribute__((packed));
+
+/*
+ * can be set by user if no "media specific information" is wanted
+ * -> saves a lot of space in user space buffer
+ */
+#define QETH_QARP_STRIP_ENTRIES  0x8000
+#define QETH_QARP_REQUEST_MASK   0x00ff
+
 /* data sent to user space as result of query arp ioctl */
 #define QETH_QARP_USER_DATA_SIZE 20000
 #define QETH_QARP_MASK_OFFSET    4
@@ -57,4 +75,4 @@ struct qeth_arp_query_user_data {
 	char *entries;
 } __attribute__((packed));
 
-#endif /* __ASM_S390_IOCTL_H__ */
+#endif /* __ASM_S390_QETH_IOCTL_H__ */
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index c5b19f08c..ba3b3510e 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -12,6 +12,7 @@
 #define COMMAND_LINE_SIZE 	896
 #define RAMDISK_ORIGIN		0x800000
 #define RAMDISK_SIZE		0x800000
+#define MEMORY_CHUNKS		16	/* max 0x7fff */
 
 #ifndef __ASSEMBLY__
 
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index 4c3b6aadb..bc7a8471c 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -42,12 +42,13 @@ typedef struct {
 #define spin_lock_init(lp) do { (lp)->lock = 0; } while(0)
 #define spin_unlock_wait(lp)	do { barrier(); } while(((volatile spinlock_t *)(lp))->lock)
 #define spin_is_locked(x) ((x)->lock != 0)
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 extern inline void _raw_spin_lock(spinlock_t *lp)
 {
 #ifndef __s390x__
 	unsigned int reg1, reg2;
-        __asm__ __volatile("    bras  %0,1f\n"
+        __asm__ __volatile__("    bras  %0,1f\n"
                            "0:  diag  0,0,68\n"
                            "1:  slr   %1,%1\n"
                            "    cs    %1,%0,0(%3)\n"
@@ -57,7 +58,7 @@ extern inline void _raw_spin_lock(spinlock_t *lp)
 			   : "cc", "memory" );
 #else /* __s390x__ */
 	unsigned long reg1, reg2;
-        __asm__ __volatile("    bras  %1,1f\n"
+        __asm__ __volatile__("    bras  %1,1f\n"
                            "0:  " __DIAG44_INSN " 0,%4\n"
                            "1:  slr   %0,%0\n"
                            "    cs    %0,%1,0(%3)\n"
@@ -73,7 +74,7 @@ extern inline int _raw_spin_trylock(spinlock_t *lp)
 	unsigned long reg;
 	unsigned int result;
 
-	__asm__ __volatile("    basr  %1,0\n"
+	__asm__ __volatile__("    basr  %1,0\n"
 			   "0:  cs    %0,%1,0(%3)"
 			   : "=d" (result), "=&d" (reg), "=m" (lp->lock)
 			   : "a" (&lp->lock), "m" (lp->lock), "0" (0)
@@ -85,7 +86,7 @@ extern inline void _raw_spin_unlock(spinlock_t *lp)
 {
 	unsigned int old;
 
-	__asm__ __volatile("cs %0,%3,0(%4)"
+	__asm__ __volatile__("cs %0,%3,0(%4)"
 			   : "=d" (old), "=m" (lp->lock)
 			   : "0" (lp->lock), "d" (0), "a" (lp)
 			   : "cc", "memory" );
diff --git a/include/asm-s390/string.h b/include/asm-s390/string.h
index d8739b639..017872d61 100644
--- a/include/asm-s390/string.h
+++ b/include/asm-s390/string.h
@@ -15,136 +15,124 @@
 #include <linux/types.h>
 #endif
 
-#define __HAVE_ARCH_MEMCHR
-#define __HAVE_ARCH_MEMCPY
-#define __HAVE_ARCH_MEMSET
-#define __HAVE_ARCH_STRCAT
-#define __HAVE_ARCH_STRCMP
-#define __HAVE_ARCH_STRCPY
-#define __HAVE_ARCH_STRLEN
-#define __HAVE_ARCH_STRNCPY
+#define __HAVE_ARCH_BCOPY	/* arch function */
+#define __HAVE_ARCH_MEMCHR	/* inline & arch function */
+#define __HAVE_ARCH_MEMCMP	/* arch function */
+#define __HAVE_ARCH_MEMCPY	/* gcc builtin & arch function */
+#define __HAVE_ARCH_MEMSCAN	/* inline & arch function */
+#define __HAVE_ARCH_MEMSET	/* gcc builtin & arch function */
+#define __HAVE_ARCH_STRCAT	/* inline & arch function */
+#define __HAVE_ARCH_STRCMP	/* arch function */
+#define __HAVE_ARCH_STRCPY	/* inline & arch function */
+#define __HAVE_ARCH_STRLCAT	/* arch function */
+#define __HAVE_ARCH_STRLCPY	/* arch function */
+#define __HAVE_ARCH_STRLEN	/* inline & arch function */
+#define __HAVE_ARCH_STRNCAT	/* arch function */
+#define __HAVE_ARCH_STRNCPY	/* arch function */
+#define __HAVE_ARCH_STRNLEN	/* inline & arch function */
+#define __HAVE_ARCH_STRRCHR	/* arch function */
+#define __HAVE_ARCH_STRSTR	/* arch function */
+
+/* Prototypes for non-inlined arch strings functions. */
+extern int memcmp(const void *, const void *, size_t);
+extern void *memcpy(void *, const void *, size_t);
+extern void *memset(void *, int, size_t);
+extern int strcmp(const char *,const char *);
+extern size_t strlcat(char *, const char *, size_t);
+extern size_t strlcpy(char *, const char *, size_t);
+extern char *strncat(char *, const char *, size_t);
+extern char *strncpy(char *, const char *, size_t);
+extern char *strrchr(const char *, int);
+extern char *strstr(const char *, const char *);
 
 #undef __HAVE_ARCH_MEMMOVE
-#undef __HAVE_ARCH_STRNICMP
-#undef __HAVE_ARCH_STRNCAT
-#undef __HAVE_ARCH_STRNCMP
 #undef __HAVE_ARCH_STRCHR
-#undef __HAVE_ARCH_STRRCHR
-#undef __HAVE_ARCH_STRNLEN
-#undef __HAVE_ARCH_STRSPN
+#undef __HAVE_ARCH_STRNCHR
+#undef __HAVE_ARCH_STRNCMP
+#undef __HAVE_ARCH_STRNICMP
 #undef __HAVE_ARCH_STRPBRK
-#undef __HAVE_ARCH_STRTOK
-#undef __HAVE_ARCH_BCOPY
-#undef __HAVE_ARCH_MEMCMP
-#undef __HAVE_ARCH_MEMSCAN
-#undef __HAVE_ARCH_STRSTR
+#undef __HAVE_ARCH_STRSEP
+#undef __HAVE_ARCH_STRSPN
 
-extern void *memset(void *, int, size_t);
-extern void *memcpy(void *, const void *, size_t);
-extern void *memmove(void *, const void *, size_t);
-extern char *strncpy(char *, const char *, size_t);
-extern int strcmp(const char *,const char *);
+#if !defined(IN_ARCH_STRING_C)
 
-static inline void * memchr(const void * cs,int c,size_t count)
+static inline void *memchr(const void * s, int c, size_t n)
 {
-    void *ptr;
-
-    __asm__ __volatile__ (
-#ifndef __s390x__
-                          "   lr    0,%2\n"
-                          "   lr    1,%1\n"
-                          "   la    %0,0(%3,%1)\n"
-                          "0: srst  %0,1\n"
-                          "   jo    0b\n"
-                          "   brc   13,1f\n"
-                          "   slr   %0,%0\n"
-#else /* __s390x__ */
-                          "   lgr   0,%2\n"
-                          "   lgr   1,%1\n"
-                          "   la    %0,0(%3,%1)\n"
-                          "0: srst  %0,1\n"
-                          "   jo    0b\n"
-                          "   brc   13,1f\n"
-                          "   slgr  %0,%0\n"
-#endif /* __s390x__ */
-                          "1:"
-                          : "=&a" (ptr) : "a" (cs), "d" (c), "d" (count)
-                          : "cc", "0", "1" );
-    return ptr;
+	register int r0 asm("0") = (char) c;
+	const void *ret = s + n;
+
+	asm volatile ("0: srst  %0,%1\n"
+		      "   jo    0b\n"
+		      "   jl	1f\n"
+		      "   la    %0,0\n"
+		      "1:"
+		      : "+a" (ret), "+&a" (s) : "d" (r0) : "cc" );
+	return (void *) ret;
 }
 
-static __inline__ char *strcpy(char *dest, const char *src)
+static inline void *memscan(void *s, int c, size_t n)
 {
-    char *tmp = dest;
-
-    __asm__ __volatile__ (
-#ifndef __s390x__
-                          "   sr    0,0\n"
-                          "0: mvst  %0,%1\n"
-                          "   jo    0b"
-#else /* __s390x__ */
-                          "   slgr  0,0\n"
-                          "0: mvst  %0,%1\n"
-                          "   jo    0b"
-#endif /* __s390x__ */
-                          : "+&a" (dest), "+&a" (src) :
-                          : "cc", "memory", "0" );
-    return tmp;
+	register int r0 asm("0") = (char) c;
+	const void *ret = s + n;
+
+	asm volatile ("0: srst  %0,%1\n"
+		      "   jo    0b\n"
+		      : "+a" (ret), "+&a" (s) : "d" (r0) : "cc" );
+	return (void *) ret;
 }
 
-static __inline__ size_t strlen(const char *s)
+static inline char *strcat(char *dst, const char *src)
 {
-    size_t len;
-
-    __asm__ __volatile__ (
-#ifndef __s390x__
-                          "   sr    0,0\n"
-                          "   lr    %0,%1\n"
-                          "0: srst  0,%0\n"
-                          "   jo    0b\n"
-                          "   lr    %0,0\n"
-                          "   sr    %0,%1"
-#else /* __s390x__ */
-                          "   slgr  0,0\n"
-                          "   lgr   %0,%1\n"
-                          "0: srst  0,%0\n"
-                          "   jo    0b\n"
-                          "   lgr   %0,0\n"
-                          "   sgr   %0,%1"
-#endif /* __s390x__ */
-                          : "=&a" (len) : "a" (s) 
-                          : "cc", "0" );
-    return len;
+	register int r0 asm("0") = 0;
+	unsigned long dummy;
+	char *ret = dst;
+
+	asm volatile ("0: srst  %0,%1\n"
+		      "   jo    0b\n"
+		      "1: mvst  %0,%2\n"
+		      "   jo    1b"
+		      : "=&a" (dummy), "+a" (dst), "+a" (src)
+		      : "d" (r0), "0" (0) : "cc", "memory" );
+	return ret;
 }
 
-static __inline__ char *strcat(char *dest, const char *src)
+static inline char *strcpy(char *dst, const char *src)
 {
-    char *tmp = dest;
-
-    __asm__ __volatile__ (
-#ifndef __s390x__
-                          "   sr    0,0\n"
-                          "0: srst  0,%0\n"
-                          "   jo    0b\n"
-                          "   lr    %0,0\n"
-                          "   sr    0,0\n"
-                          "1: mvst  %0,%1\n"
-                          "   jo    1b"
-#else /* __s390x__ */
-                          "   slgr  0,0\n"
-                          "0: srst  0,%0\n"
-                          "   jo    0b\n"
-                          "   lgr   %0,0\n"
-                          "   slgr  0,0\n"
-                          "1: mvst  %0,%1\n"
-                          "   jo    1b"
-#endif /* __s390x__ */
-                          : "+&a" (dest), "+&a" (src) :
-                          : "cc", "memory", "0" );
-    return tmp;
+	register int r0 asm("0") = 0;
+	char *ret = dst;
+
+	asm volatile ("0: mvst  %0,%1\n"
+		      "   jo    0b"
+		      : "+&a" (dst), "+&a" (src) : "d" (r0)
+		      : "cc", "memory" );
+	return ret;
 }
 
-extern void *alloca(size_t);
+static inline size_t strlen(const char *s)
+{
+	register unsigned long r0 asm("0") = 0;
+	const char *tmp = s;
+
+	asm volatile ("0: srst  %0,%1\n"
+		      "   jo    0b"
+		      : "+d" (r0), "+a" (tmp) :  : "cc" );
+	return r0 - (unsigned long) s;
+}
+
+static inline size_t strnlen(const char * s, size_t n)
+{
+	register int r0 asm("0") = 0;
+	const char *tmp = s;
+	const char *end = s + n;
+
+	asm volatile ("0: srst  %0,%1\n"
+		      "   jo    0b"
+		      : "+a" (end), "+a" (tmp) : "d" (r0)  : "cc" );
+	return end - s;
+}
+
+#endif /* !IN_ARCH_STRING_C */
+
 #endif /* __KERNEL__ */
 
 #endif /* __S390_STRING_H_ */
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h
index bb80c86d8..a2bfdeedf 100644
--- a/include/asm-s390/thread_info.h
+++ b/include/asm-s390/thread_info.h
@@ -85,6 +85,7 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
 #define TIF_RESTART_SVC		4	/* restart svc with new svc number */
 #define TIF_SYSCALL_AUDIT	5	/* syscall auditing active */
+#define TIF_SINGLE_STEP		6	/* single stepped svc */
 #define TIF_USEDFPU		16	/* FPU was used by this task this quantum (SMP) */
 #define TIF_POLLING_NRFLAG	17	/* true if poll_idle() is polling 
 					   TIF_NEED_RESCHED */
@@ -96,6 +97,7 @@ static inline struct thread_info *current_thread_info(void)
 #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)
 #define _TIF_RESTART_SVC	(1<<TIF_RESTART_SVC)
 #define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
+#define _TIF_SINGLE_STEP	(1<<TIF_SINGLE_STEP)
 #define _TIF_USEDFPU		(1<<TIF_USEDFPU)
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 #define _TIF_31BIT		(1<<TIF_31BIT)
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index d0be3e477..3fefd6141 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -79,6 +79,8 @@ typedef unsigned  long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned int kmem_bufctl_t;
+
 #ifndef __s390x__
 typedef union {
 	unsigned long long pair;
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index 5e3ca5f7d..bec57b750 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -65,9 +65,10 @@
 
 #define access_ok(type,addr,size) __access_ok(addr,size)
 
-extern inline int verify_area(int type, const void * addr, unsigned long size)
+extern inline int verify_area(int type, const void __user *addr,
+						unsigned long size)
 {
-        return access_ok(type,addr,size)?0:-EFAULT;
+	return access_ok(type, addr, size) ? 0 : -EFAULT;
 }
 
 /*
@@ -119,7 +120,7 @@ struct exception_table_entry
  * These are the main single-value transfer routines.  They automatically
  * use the right size if we just have the right pointer type.
  */
-#if __GNUC__ > 2
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
 #define __put_user_asm(x, ptr, err) \
 ({								\
 	err = 0;						\
@@ -147,6 +148,7 @@ struct exception_table_entry
 })
 #endif
 
+#ifndef __CHECKER__
 #define __put_user(x, ptr) \
 ({								\
 	__typeof__(*(ptr)) __x = (x);				\
@@ -164,6 +166,14 @@ struct exception_table_entry
 	 }							\
 	__pu_err;						\
 })
+#else
+#define __put_user(x, ptr)			\
+({						\
+	void __user *p;				\
+	p = (ptr);				\
+	0;					\
+})
+#endif
 
 #define put_user(x, ptr)					\
 ({								\
@@ -174,7 +184,7 @@ struct exception_table_entry
 
 extern int __put_user_bad(void);
 
-#if __GNUC__ > 2
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
 #define __get_user_asm(x, ptr, err) \
 ({								\
 	err = 0;						\
@@ -202,6 +212,7 @@ extern int __put_user_bad(void);
 })
 #endif
 
+#ifndef __CHECKER__
 #define __get_user(x, ptr)					\
 ({								\
 	__typeof__(*(ptr)) __x;					\
@@ -221,6 +232,15 @@ extern int __put_user_bad(void);
 	(x) = __x;						\
 	__gu_err;						\
 })
+#else
+#define __get_user(x, ptr)			\
+({						\
+	void __user *p;				\
+	p = (ptr);				\
+	0;					\
+})
+#endif
+
 
 #define get_user(x, ptr)					\
 ({								\
@@ -230,7 +250,7 @@ extern int __put_user_bad(void);
 
 extern int __get_user_bad(void);
 
-extern long __copy_to_user_asm(const void *from, long n, void *to);
+extern long __copy_to_user_asm(const void *from, long n, void __user *to);
 
 /**
  * __copy_to_user: - Copy a block of data into user space, with less checking.
@@ -274,7 +294,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n)
 	return n;
 }
 
-extern long __copy_from_user_asm(void *to, long n, const void *from);
+extern long __copy_from_user_asm(void *to, long n, const void __user *from);
 
 /**
  * __copy_from_user: - Copy a block of data from user space, with less checking.
@@ -326,12 +346,13 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
 	return n;
 }
 
-extern long __copy_in_user_asm(const void *from, long n, void *to);
+extern unsigned long __copy_in_user_asm(const void __user *from, long n,
+							void __user *to);
 
 static inline unsigned long
 __copy_in_user(void __user *to, const void __user *from, unsigned long n)
 {
-	__copy_in_user_asm(from, n, to);
+	return __copy_in_user_asm(from, n, to);
 }
 
 static inline unsigned long
@@ -346,26 +367,27 @@ copy_in_user(void __user *to, const void __user *from, unsigned long n)
 /*
  * Copy a null terminated string from userspace.
  */
-extern long __strncpy_from_user_asm(char *dst, const char *src, long count);
+extern long __strncpy_from_user_asm(long count, char *dst,
+					const char __user *src);
 
 static inline long
-strncpy_from_user(char *dst, const char *src, long count)
+strncpy_from_user(char *dst, const char __user *src, long count)
 {
         long res = -EFAULT;
         might_sleep();
         if (access_ok(VERIFY_READ, src, 1))
-                res = __strncpy_from_user_asm(dst, src, count);
+                res = __strncpy_from_user_asm(count, dst, src);
         return res;
 }
 
 
-extern long __strnlen_user_asm(const char *src, long count);
+extern long __strnlen_user_asm(long count, const char __user *src);
 
 static inline unsigned long
-strnlen_user(const char * src, unsigned long n)
+strnlen_user(const char __user * src, unsigned long n)
 {
 	might_sleep();
-	return __strnlen_user_asm(src, n);
+	return __strnlen_user_asm(n, src);
 }
 
 /**
@@ -388,16 +410,16 @@ strnlen_user(const char * src, unsigned long n)
  * Zero Userspace
  */
 
-extern long __clear_user_asm(void *to, long n);
+extern long __clear_user_asm(void __user *to, long n);
 
 static inline unsigned long
-__clear_user(void *to, unsigned long n)
+__clear_user(void __user *to, unsigned long n)
 {
 	return __clear_user_asm(to, n);
 }
 
 static inline unsigned long
-clear_user(void *to, unsigned long n)
+clear_user(void __user *to, unsigned long n)
 {
 	might_sleep();
 	if (access_ok(VERIFY_WRITE, to, n))
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index c15e6d75c..4d46012fe 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -512,6 +512,30 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4,    \
 	__syscall_return(type,__res);			     \
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+# ifndef CONFIG_ARCH_S390X
+#   define __ARCH_WANT_STAT64
+# endif
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/config.h>
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h
index e95641a43..3c4f805da 100644
--- a/include/asm-sh/atomic.h
+++ b/include/asm-sh/atomic.h
@@ -53,6 +53,8 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
 	return temp;
 }
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
 static __inline__ int atomic_sub_return(int i, atomic_t * v)
 {
 	unsigned long temp, flags;
@@ -69,6 +71,16 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
 #define atomic_dec_return(v) atomic_sub_return(1,(v))
 #define atomic_inc_return(v) atomic_add_return(1,(v))
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
 #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
 
diff --git a/include/asm-sh/cpu-sh2/cacheflush.h b/include/asm-sh/cpu-sh2/cacheflush.h
index 547aebe31..98cb67f37 100644
--- a/include/asm-sh/cpu-sh2/cacheflush.h
+++ b/include/asm-sh/cpu-sh2/cacheflush.h
@@ -30,6 +30,8 @@
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start, end)		do { } while (0)
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h
index 4f494d655..e4cbef283 100644
--- a/include/asm-sh/cpu-sh3/cacheflush.h
+++ b/include/asm-sh/cpu-sh3/cacheflush.h
@@ -30,6 +30,8 @@
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start, end)		do { } while (0)
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h
index 643788481..9910dfaed 100644
--- a/include/asm-sh/cpu-sh4/cacheflush.h
+++ b/include/asm-sh/cpu-sh4/cacheflush.h
@@ -30,6 +30,10 @@ extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
 			      unsigned long end);
 extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr);
 extern void flush_dcache_page(struct page *pg);
+
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
+
 extern void flush_icache_range(unsigned long start, unsigned long end);
 extern void flush_cache_sigtramp(unsigned long addr);
 extern void flush_icache_user_range(struct vm_area_struct *vma,
diff --git a/include/asm-sh/flat.h b/include/asm-sh/flat.h
index 1922da9a0..f29072e1c 100644
--- a/include/asm-sh/flat.h
+++ b/include/asm-sh/flat.h
@@ -16,7 +16,7 @@
 #define	flat_argvp_envp_on_stack()		1
 #define	flat_old_ram_flag(flags)		(flags)
 #define	flat_reloc_valid(reloc, size)		((reloc) <= (size))
-#define	flat_get_addr_from_rp(rp, relval)	get_unaligned(rp)
+#define	flat_get_addr_from_rp(rp, relval, flags)	get_unaligned(rp)
 #define	flat_put_addr_at_rp(rp, val, relval)	put_unaligned(val,rp)
 #define	flat_get_relocate_addr(rel)		(rel)
 
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h
index 4aa1568d2..7758b3ec3 100644
--- a/include/asm-sh/ide.h
+++ b/include/asm-sh/ide.h
@@ -22,6 +22,8 @@
 #define MAX_HWIFS	2
 #endif
 
+#define IDE_ARCH_OBSOLETE_DEFAULTS
+
 static inline int ide_default_irq_hp600(unsigned long base)
 {
 	switch (base) {
@@ -72,6 +74,9 @@ static inline unsigned long ide_default_io_base(int index)
 	}
 }
 
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
+
 #ifdef CONFIG_PCI
 #define ide_init_default_irq(base)	(0)
 #else
diff --git a/include/asm-sh/mc146818rtc.h b/include/asm-sh/mc146818rtc.h
index 1707cfb29..4ec4f7370 100644
--- a/include/asm-sh/mc146818rtc.h
+++ b/include/asm-sh/mc146818rtc.h
@@ -16,7 +16,6 @@
 
 /* FIXME:RTC Interrupt feature is not implemented yet. */
 #undef  RTC_IRQ
-#define RTC_IRQ		0
 
 #if defined(CONFIG_CPU_SH3)
 #define RTC_PORT(n)		(R64CNT+(n)*2)
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index e7fcaf0a3..292511404 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -274,8 +274,6 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
 
 #define pte_same(A,B)	(pte_val(A) == pte_val(B))
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 #define kern_addr_valid(addr)	(1)
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index 9930f93b1..31f45f2a7 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -25,6 +25,7 @@ typedef struct {
 
 #define spin_is_locked(x)	((x)->lock != 0)
 #define spin_unlock_wait(x)	do { barrier(); } while (spin_is_locked(x))
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index cb7e183a0..c4dc126c5 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -58,6 +58,8 @@ typedef u64 sector_t;
 #define HAVE_SECTOR_T
 #endif
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 3fe89e8d1..26ad6dd92 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -400,6 +400,31 @@ __asm__ __volatile__ ("trapa	#0x15" \
 __syscall_return(type,__sc0); \
 }
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
index 14b5a8e4d..fe210f361 100644
--- a/include/asm-sparc/atomic.h
+++ b/include/asm-sparc/atomic.h
@@ -33,6 +33,18 @@ extern void atomic_set(atomic_t *, int);
 #define atomic_inc_return(v)	(__atomic_add_return(        1, (v)))
 #define atomic_dec_return(v)	(__atomic_add_return(       -1, (v)))
 
+#define atomic_add_negative(a, v)	(atomic_add_return((a), (v)) < 0)
+
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
 
 /* This is the old 24-bit implementation.  It's still used internally
diff --git a/include/asm-sparc/cacheflush.h b/include/asm-sparc/cacheflush.h
index ac9f8acde..a5f7fc33b 100644
--- a/include/asm-sparc/cacheflush.h
+++ b/include/asm-sparc/cacheflush.h
@@ -70,6 +70,8 @@ BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long)
 extern void sparc_flush_page_to_ram(struct page *page);
 
 #define flush_dcache_page(page)			sparc_flush_page_to_ram(page)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 
 #define flush_cache_vmap(start, end)		flush_cache_all()
 #define flush_cache_vunmap(start, end)		flush_cache_all()
diff --git a/include/asm-sparc/dma-mapping.h b/include/asm-sparc/dma-mapping.h
index 2dc5bb8ef..08ede04f7 100644
--- a/include/asm-sparc/dma-mapping.h
+++ b/include/asm-sparc/dma-mapping.h
@@ -2,6 +2,7 @@
 #define _ASM_SPARC_DMA_MAPPING_H
 
 #include <linux/config.h>
+#include <linux/device.h>
 
 #ifdef CONFIG_PCI
 #include <asm-generic/dma-mapping.h>
diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h
index c7d90b661..e882cf490 100644
--- a/include/asm-sparc/hardirq.h
+++ b/include/asm-sparc/hardirq.h
@@ -56,15 +56,6 @@ typedef struct {
 #define SOFTIRQ_OFFSET  (1UL << SOFTIRQ_SHIFT)
 #define HARDIRQ_OFFSET  (1UL << HARDIRQ_SHIFT)
 
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 /*
  * Are we doing bottom half or hardware interrupt processing?
  * Are we in a softirq context? Interrupt context?
diff --git a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h
index 7ca1a85c2..95effa153 100644
--- a/include/asm-sparc/highmem.h
+++ b/include/asm-sparc/highmem.h
@@ -24,7 +24,7 @@
 #include <asm/fixmap.h>
 #include <asm/vaddrs.h>
 #include <asm/kmap_types.h>
-#include <asm/pgtsrmmu.h>
+#include <asm/pgtable.h>
 
 /* declarations for highmem.c */
 extern unsigned long highstart_pfn, highend_pfn;
@@ -43,7 +43,7 @@ extern void kmap_init(void) __init;
  */
 #define LAST_PKMAP 1024
 #define PKMAP_SIZE (LAST_PKMAP << PAGE_SHIFT)
-#define PKMAP_BASE SRMMU_PMD_ALIGN_SOFT(SRMMU_NOCACHE_VADDR + (SRMMU_MAX_NOCACHE_PAGES << PAGE_SHIFT))
+#define PKMAP_BASE PMD_ALIGN(SRMMU_NOCACHE_VADDR + (SRMMU_MAX_NOCACHE_PAGES << PAGE_SHIFT))
 
 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
 #define PKMAP_NR(virt)  ((virt - PKMAP_BASE) >> PAGE_SHIFT)
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h
index 1f4397221..64d810385 100644
--- a/include/asm-sparc/ide.h
+++ b/include/asm-sparc/ide.h
@@ -19,17 +19,8 @@
 #undef  MAX_HWIFS
 #define MAX_HWIFS	2
 
-static __inline__ int ide_default_irq(unsigned long base)
-{
-	return 0;
-}
-
-static __inline__ unsigned long ide_default_io_base(int index)
-{
-	return 0;
-}
-
-#define ide_init_default_irq(base)	(0)
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
 
 #define __ide_insl(data_reg, buffer, wcount) \
 	__ide_insw(data_reg, buffer, (wcount)<<1)
diff --git a/include/asm-sparc/ipc.h b/include/asm-sparc/ipc.h
index d4d8071bd..3064aaf8f 100644
--- a/include/asm-sparc/ipc.h
+++ b/include/asm-sparc/ipc.h
@@ -7,7 +7,7 @@
  * See arch/sparc/kernel/sys_sparc.c for ugly details..
  */
 struct ipc_kludge {
-	struct msgbuf *msgp;
+	struct msgbuf __user *msgp;
 	long msgtyp;
 };
 
diff --git a/include/asm-sparc/kmap_types.h b/include/asm-sparc/kmap_types.h
index cbacf4442..e215f7104 100644
--- a/include/asm-sparc/kmap_types.h
+++ b/include/asm-sparc/kmap_types.h
@@ -11,7 +11,6 @@ enum km_type {
 	KM_BIO_DST_IRQ,
 	KM_PTE0,
 	KM_PTE1,
-	KM_PTE2,
 	KM_IRQ0,
 	KM_IRQ1,
 	KM_SOFTIRQ0,
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index abe6f197d..fa537363f 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -75,29 +75,10 @@ BTFIXUPDEF_CALL(void,  mmu_unmap_dma_area, unsigned long busa, int len)
 #define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len)
 #define mmu_translate_dvma(ba)     BTFIXUP_CALL(mmu_translate_dvma)(ba)
 
-/*
- */
-BTFIXUPDEF_SIMM13(pmd_shift)
-BTFIXUPDEF_SETHI(pmd_size)
-BTFIXUPDEF_SETHI(pmd_mask)
-
-extern unsigned int pmd_align(unsigned int addr) __attribute_const__;
-extern __inline__ unsigned int pmd_align(unsigned int addr)
-{
-	return ((addr + ~BTFIXUP_SETHI(pmd_mask)) & BTFIXUP_SETHI(pmd_mask));
-}
-
 BTFIXUPDEF_SIMM13(pgdir_shift)
 BTFIXUPDEF_SETHI(pgdir_size)
 BTFIXUPDEF_SETHI(pgdir_mask)
 
-extern unsigned int pgdir_align(unsigned int addr) __attribute_const__;
-extern __inline__ unsigned int pgdir_align(unsigned int addr)
-{
-	return ((addr + ~BTFIXUP_SETHI(pgdir_mask)) & BTFIXUP_SETHI(pgdir_mask));
-}
-
-BTFIXUPDEF_SIMM13(ptrs_per_pte)
 BTFIXUPDEF_SIMM13(ptrs_per_pmd)
 BTFIXUPDEF_SIMM13(ptrs_per_pgd)
 BTFIXUPDEF_SIMM13(user_ptrs_per_pgd)
@@ -112,19 +93,19 @@ BTFIXUPDEF_INT(page_copy)
 BTFIXUPDEF_INT(page_readonly)
 BTFIXUPDEF_INT(page_kernel)
 
-#define PMD_SHIFT       	BTFIXUP_SIMM13(pmd_shift)
-#define PMD_SIZE        	BTFIXUP_SETHI(pmd_size)
-#define PMD_MASK        	BTFIXUP_SETHI(pmd_mask)
-#define PMD_ALIGN(addr) 	pmd_align(addr)
+#define PMD_SHIFT		SUN4C_PMD_SHIFT
+#define PMD_SIZE        	(1UL << PMD_SHIFT)
+#define PMD_MASK        	(~(PMD_SIZE-1))
+#define PMD_ALIGN(__addr) 	(((__addr) + ~PMD_MASK) & PMD_MASK)
 #define PGDIR_SHIFT     	BTFIXUP_SIMM13(pgdir_shift)
 #define PGDIR_SIZE      	BTFIXUP_SETHI(pgdir_size)
 #define PGDIR_MASK      	BTFIXUP_SETHI(pgdir_mask)
-#define PGDIR_ALIGN     	pgdir_align(addr)
-#define PTRS_PER_PTE    	BTFIXUP_SIMM13(ptrs_per_pte)
+#define PTRS_PER_PTE    	1024
 #define PTRS_PER_PMD    	BTFIXUP_SIMM13(ptrs_per_pmd)
 #define PTRS_PER_PGD    	BTFIXUP_SIMM13(ptrs_per_pgd)
 #define USER_PTRS_PER_PGD	BTFIXUP_SIMM13(user_ptrs_per_pgd)
 #define FIRST_USER_PGD_NR	0
+#define PTE_SIZE		(PTRS_PER_PTE*4)
 
 #define PAGE_NONE      __pgprot(BTFIXUP_INT(page_none))
 #define PAGE_SHARED    __pgprot(BTFIXUP_INT(page_shared))
@@ -497,8 +478,6 @@ extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, u
 
 #include <asm-generic/pgtable.h>
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !(__ASSEMBLY__) */
 
 /* We provide our own get_unmapped_area to cope with VA holes for userland */
diff --git a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h
index e0cc31ac5..3107339dd 100644
--- a/include/asm-sparc/pgtsrmmu.h
+++ b/include/asm-sparc/pgtsrmmu.h
@@ -17,10 +17,10 @@
 #define SRMMU_MAX_CONTEXTS	65536
 
 /* PMD_SHIFT determines the size of the area a second-level page table entry can map */
-#define SRMMU_PMD_SHIFT         18
-#define SRMMU_PMD_SIZE          (1UL << SRMMU_PMD_SHIFT)
-#define SRMMU_PMD_MASK          (~(SRMMU_PMD_SIZE-1))
-/* #define SRMMU_PMD_ALIGN(addr)   (((addr)+SRMMU_PMD_SIZE-1)&SRMMU_PMD_MASK) */
+#define SRMMU_REAL_PMD_SHIFT		18
+#define SRMMU_REAL_PMD_SIZE		(1UL << SRMMU_REAL_PMD_SHIFT)
+#define SRMMU_REAL_PMD_MASK		(~(SRMMU_REAL_PMD_SIZE-1))
+#define SRMMU_REAL_PMD_ALIGN(__addr)	(((__addr)+SRMMU_REAL_PMD_SIZE-1)&SRMMU_REAL_PMD_MASK)
 
 /* PGDIR_SHIFT determines what a third-level page table entry can map */
 #define SRMMU_PGDIR_SHIFT       24
@@ -28,13 +28,13 @@
 #define SRMMU_PGDIR_MASK        (~(SRMMU_PGDIR_SIZE-1))
 #define SRMMU_PGDIR_ALIGN(addr) (((addr)+SRMMU_PGDIR_SIZE-1)&SRMMU_PGDIR_MASK)
 
-#define SRMMU_PTRS_PER_PTE      64
-#define SRMMU_PTRS_PER_PMD      64
-#define SRMMU_PTRS_PER_PGD      256
+#define SRMMU_REAL_PTRS_PER_PTE	64
+#define SRMMU_REAL_PTRS_PER_PMD	64
+#define SRMMU_PTRS_PER_PGD	256
 
-#define SRMMU_PTE_TABLE_SIZE    0x100 /* 64 entries, 4 bytes a piece */
-#define SRMMU_PMD_TABLE_SIZE    0x100 /* 64 entries, 4 bytes a piece */
-#define SRMMU_PGD_TABLE_SIZE    0x400 /* 256 entries, 4 bytes a piece */
+#define SRMMU_REAL_PTE_TABLE_SIZE	(SRMMU_REAL_PTRS_PER_PTE*4)
+#define SRMMU_PMD_TABLE_SIZE		(SRMMU_REAL_PTRS_PER_PMD*4)
+#define SRMMU_PGD_TABLE_SIZE		(SRMMU_PTRS_PER_PGD*4)
 
 /*
  * To support pagetables in highmem, Linux introduces APIs which
@@ -44,16 +44,11 @@
  * software tables.
  *
  * PMD_SHIFT determines the size of the area a second-level page table entry
- * can map, and our pmd_t is 16 times larger than normal.
+ * can map, and our pmd_t is 16 times larger than normal.  The values which
+ * were once defined here are now generic for 4c and srmmu, so they're
+ * found in pgtable.h.
  */
-#define SRMMU_PTRS_PER_PTE_SOFT	(PAGE_SIZE/4)	/* 16 hard tables per 4K page */
-#define SRMMU_PTRS_PER_PMD_SOFT	4	/* Each pmd_t contains 16 hard PTPs */
-#define SRMMU_PTE_SZ_SOFT       PAGE_SIZE	/* same as above, in bytes */
-
-#define SRMMU_PMD_SHIFT_SOFT	22
-#define SRMMU_PMD_SIZE_SOFT	(1UL << SRMMU_PMD_SHIFT_SOFT)
-#define SRMMU_PMD_MASK_SOFT	(~(SRMMU_PMD_SIZE_SOFT-1))
-#define SRMMU_PMD_ALIGN_SOFT(addr)  (((addr)+SRMMU_PMD_SIZE_SOFT-1)&SRMMU_PMD_MASK_SOFT)
+#define SRMMU_PTRS_PER_PMD	4
 
 /* Definition of the values in the ET field of PTD's and PTE's */
 #define SRMMU_ET_MASK         0x3
@@ -255,7 +250,7 @@ extern __inline__ void srmmu_flush_tlb_region(unsigned long addr)
 
 extern __inline__ void srmmu_flush_tlb_segment(unsigned long addr)
 {
-	addr &= SRMMU_PMD_MASK;
+	addr &= SRMMU_REAL_PMD_MASK;
 	__asm__ __volatile__("sta %%g0, [%0] %1\n\t": :
 			     "r" (addr | 0x100), /* Flush TLB segment.. */
 			     "i" (ASI_M_FLUSH_PROBE) : "memory");
diff --git a/include/asm-sparc/pgtsun4.h b/include/asm-sparc/pgtsun4.h
index 67a7d27dd..ecd5afcf2 100644
--- a/include/asm-sparc/pgtsun4.h
+++ b/include/asm-sparc/pgtsun4.h
@@ -11,9 +11,6 @@
 
 /* PMD_SHIFT determines the size of the area a second-level page table can map */
 #define SUN4C_PMD_SHIFT       23
-#define SUN4C_PMD_SIZE        (1UL << SUN4C_PMD_SHIFT)
-#define SUN4C_PMD_MASK        (~(SUN4C_PMD_SIZE-1))
-#define SUN4C_PMD_ALIGN(addr) (((addr)+SUN4C_PMD_SIZE-1)&SUN4C_PMD_MASK)
 
 /* PGDIR_SHIFT determines what a third-level page table entry can map */
 #define SUN4C_PGDIR_SHIFT       23
diff --git a/include/asm-sparc/pgtsun4c.h b/include/asm-sparc/pgtsun4c.h
index f989d5062..f53b6dbc5 100644
--- a/include/asm-sparc/pgtsun4c.h
+++ b/include/asm-sparc/pgtsun4c.h
@@ -10,9 +10,6 @@
 
 /* PMD_SHIFT determines the size of the area a second-level page table can map */
 #define SUN4C_PMD_SHIFT       22
-#define SUN4C_PMD_SIZE        (1UL << SUN4C_PMD_SHIFT)
-#define SUN4C_PMD_MASK        (~(SUN4C_PMD_SIZE-1))
-#define SUN4C_PMD_ALIGN(addr) (((addr)+SUN4C_PMD_SIZE-1)&SUN4C_PMD_MASK)
 
 /* PGDIR_SHIFT determines what a third-level page table entry can map */
 #define SUN4C_PGDIR_SHIFT       22
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index 2fb2291db..4072875c7 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -7,6 +7,7 @@
 #ifndef _SPARC_SBUS_H
 #define _SPARC_SBUS_H
 
+#include <linux/dma-mapping.h>
 #include <linux/ioport.h>
 
 #include <asm/oplib.h>
@@ -106,10 +107,10 @@ extern void sbus_set_sbus64(struct sbus_dev *, int);
 extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp);
 extern void sbus_free_consistent(struct sbus_dev *, long, void *, u32);
 
-#define SBUS_DMA_BIDIRECTIONAL	0
-#define SBUS_DMA_TODEVICE	1
-#define SBUS_DMA_FROMDEVICE	2
-#define	SBUS_DMA_NONE		3
+#define SBUS_DMA_BIDIRECTIONAL	DMA_BIDIRECTIONAL
+#define SBUS_DMA_TODEVICE	DMA_TO_DEVICE
+#define SBUS_DMA_FROMDEVICE	DMA_FROM_DEVICE
+#define	SBUS_DMA_NONE		DMA_NONE
 
 /* All the rest use streaming mode mappings. */
 extern dma_addr_t sbus_map_single(struct sbus_dev *, void *, size_t, int);
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h
index a30cbcf1e..e8e9ae601 100644
--- a/include/asm-sparc/semaphore.h
+++ b/include/asm-sparc/semaphore.h
@@ -13,12 +13,12 @@ struct semaphore {
 	atomic24_t count;
 	int sleepers;
 	wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	long __magic;
 #endif
 };
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 # define __SEM_DEBUG_INIT(name) \
 		, (long)&(name).__magic
 #else
@@ -43,7 +43,7 @@ static inline void sema_init (struct semaphore *sem, int val)
 	atomic24_set(&sem->count, val);
 	sem->sleepers = 0;
 	init_waitqueue_head(&sem->wait);
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	sem->__magic = (long)&sem->__magic;
 #endif
 }
@@ -68,7 +68,7 @@ static inline void down(struct semaphore * sem)
 	register volatile int *ptr asm("g1");
 	register int increment asm("g2");
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
@@ -105,7 +105,7 @@ static inline int down_interruptible(struct semaphore * sem)
 	register volatile int *ptr asm("g1");
 	register int increment asm("g2");
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
@@ -145,7 +145,7 @@ static inline int down_trylock(struct semaphore * sem)
 	register volatile int *ptr asm("g1");
 	register int increment asm("g2");
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
@@ -184,7 +184,7 @@ static inline void up(struct semaphore * sem)
 	register volatile int *ptr asm("g1");
 	register int increment asm("g2");
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index de6617a25..98aade6c4 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -199,7 +199,7 @@ struct __new_sigaction {
 #ifdef __KERNEL__
 struct k_sigaction {
 	struct __new_sigaction	sa;
-	void			*ka_restorer;
+	void			__user *ka_restorer;
 };
 #endif
 
@@ -211,7 +211,7 @@ struct __old_sigaction {
 };
 
 typedef struct sigaltstack {
-	void		*ss_sp;
+	void		__user *ss_sp;
 	int		ss_flags;
 	size_t		ss_size;
 } stack_t;
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h
index 99ee46411..4b44ef3b5 100644
--- a/include/asm-sparc/spinlock.h
+++ b/include/asm-sparc/spinlock.h
@@ -216,6 +216,8 @@ extern __inline__ void _raw_write_lock(rwlock_t *rw)
 
 #endif /* CONFIG_DEBUG_SPINLOCK */
 
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
+
 #endif /* !(__ASSEMBLY__) */
 
 #endif /* __SPARC_SPINLOCK_H */
diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h
index be8a8f421..b4a5494ac 100644
--- a/include/asm-sparc/thread_info.h
+++ b/include/asm-sparc/thread_info.h
@@ -17,6 +17,7 @@
 
 #include <asm/btfixup.h>
 #include <asm/ptrace.h>
+#include <asm/page.h>
 
 /*
  * Low level task data.
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
index 42fc6ed98..9eabf6e61 100644
--- a/include/asm-sparc/types.h
+++ b/include/asm-sparc/types.h
@@ -54,6 +54,8 @@ typedef unsigned long long u64;
 typedef u32 dma_addr_t;
 typedef u32 dma64_addr_t;
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index 68e718b07..8ef47f13c 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -94,10 +94,12 @@ extern void __ret_efault(void);
  */
 #define put_user(x,ptr) ({ \
 unsigned long __pu_addr = (unsigned long)(ptr); \
+__chk_user_ptr(ptr); \
 __put_user_check((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr))); })
 
 #define get_user(x,ptr) ({ \
 unsigned long __gu_addr = (unsigned long)(ptr); \
+__chk_user_ptr(ptr); \
 __get_user_check((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr))); })
 
 /*
@@ -292,32 +294,32 @@ __asm__ __volatile__(							\
 
 extern int __get_user_bad(void);
 
-extern unsigned long __copy_user(void *to, const void *from, unsigned long size);
+extern unsigned long __copy_user(void __user *to, const void __user *from, unsigned long size);
 
 static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
 {
 	if (n && __access_ok((unsigned long) to, n))
-		return __copy_user((void *) to, from, n);
+		return __copy_user(to, (void __user *) from, n);
 	else
 		return n;
 }
 
 static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
 {
-	return __copy_user((void *)to, from, n);
+	return __copy_user(to, (void __user *) from, n);
 }
 
 static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
 {
 	if (n && __access_ok((unsigned long) from, n))
-		return __copy_user(to, (void *) from, n);
+		return __copy_user((void __user *) to, from, n);
 	else
 		return n;
 }
 
 static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
 {
-	return __copy_user(to, (void *)from, n);
+	return __copy_user((void __user *) to, from, n);
 }
 
 static inline unsigned long __clear_user(void __user *addr, unsigned long size)
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 4c0c9fbc3..62eaacd9f 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -431,6 +431,30 @@ if (__res < -255 || __res>=0) \
 errno = -__res; \
 return -1; \
 }
+
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-sparc/viking.h b/include/asm-sparc/viking.h
index 3742cfa07..7541da71b 100644
--- a/include/asm-sparc/viking.h
+++ b/include/asm-sparc/viking.h
@@ -236,7 +236,7 @@ static inline unsigned long viking_hwprobe(unsigned long vaddr)
 			     : "=r" (val)
 			     : "r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE));
 	if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) {
-		vaddr &= ~SRMMU_PMD_MASK;
+		vaddr &= ~SRMMU_REAL_PMD_MASK;
 		vaddr >>= PAGE_SHIFT;
 		return val | (vaddr << 8);
 	}
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index 7ccccc304..5374f5b72 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -40,6 +40,16 @@ extern int __atomic64_sub(__s64, atomic64_t *);
 #define atomic_inc_return(v) __atomic_add(1, v)
 #define atomic64_inc_return(v) __atomic64_add(1, v)
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 #define atomic_sub_and_test(i, v) (__atomic_sub(i, v) == 0)
 #define atomic64_sub_and_test(i, v) (__atomic64_sub(i, v) == 0)
 
@@ -52,6 +62,9 @@ extern int __atomic64_sub(__s64, atomic64_t *);
 #define atomic_dec(v) ((void)__atomic_sub(1, v))
 #define atomic64_dec(v) ((void)__atomic64_sub(1, v))
 
+#define atomic_add_negative(i, v) (__atomic_add(i, v) < 0)
+#define atomic64_add_negative(i, v) (__atomic64_add(i, v) < 0)
+
 /* Atomic operations are already serializing */
 #define smp_mb__before_atomic_dec()	barrier()
 #define smp_mb__after_atomic_dec()	barrier()
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index 9deee1ab7..d32c13843 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -204,43 +204,7 @@ static __inline__ unsigned int hweight8(unsigned int w)
  * @offset: The bitnumber to start searching at
  * @size: The maximum size to search
  */
-static __inline__ unsigned long find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset)
-{
-	unsigned long *p = addr + (offset >> 6);
-	unsigned long result = offset & ~63UL;
-	unsigned long tmp;
-
-	if (offset >= size)
-		return size;
-	size -= result;
-	offset &= 63UL;
-	if (offset) {
-		tmp = *(p++);
-		tmp &= (~0UL << offset);
-		if (size < 64)
-			goto found_first;
-		if (tmp)
-			goto found_middle;
-		size -= 64;
-		result += 64;
-	}
-	while (size & ~63UL) {
-		if ((tmp = *(p++)))
-			goto found_middle;
-		result += 64;
-		size -= 64;
-	}
-	if (!size)
-		return result;
-	tmp = *p;
-
-found_first:
-	tmp &= (~0UL >> (64 - size));
-	if (tmp == 0UL)        /* Are any bits set? */
-		return result + size; /* Nope. */
-found_middle:
-	return result + __ffs(tmp);
-}
+extern unsigned long find_next_bit(unsigned long *, unsigned long, unsigned long);
 
 /**
  * find_first_bit - find the first set bit in a memory region
@@ -258,43 +222,7 @@ found_middle:
  * on Linus's ALPHA routines, which are pretty portable BTW.
  */
 
-static __inline__ unsigned long find_next_zero_bit(unsigned long *addr, unsigned long size, unsigned long offset)
-{
-	unsigned long *p = addr + (offset >> 6);
-	unsigned long result = offset & ~63UL;
-	unsigned long tmp;
-
-	if (offset >= size)
-		return size;
-	size -= result;
-	offset &= 63UL;
-	if (offset) {
-		tmp = *(p++);
-		tmp |= ~0UL >> (64-offset);
-		if (size < 64)
-			goto found_first;
-		if (~tmp)
-			goto found_middle;
-		size -= 64;
-		result += 64;
-	}
-	while (size & ~63UL) {
-		if (~(tmp = *(p++)))
-			goto found_middle;
-		result += 64;
-		size -= 64;
-	}
-	if (!size)
-		return result;
-	tmp = *p;
-
-found_first:
-	tmp |= ~0UL << size;
-	if (tmp == ~0UL)        /* Are any bits zero? */
-		return result + size; /* Nope. */
-found_middle:
-	return result + ffz(tmp);
-}
+extern unsigned long find_next_zero_bit(unsigned long *, unsigned long, unsigned long);
 
 #define find_first_zero_bit(addr, size) \
         find_next_zero_bit((addr), (size), 0)
@@ -320,42 +248,7 @@ static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr)
 #define find_first_zero_le_bit(addr, size) \
         find_next_zero_le_bit((addr), (size), 0)
 
-static __inline__ unsigned long find_next_zero_le_bit(unsigned long *addr, unsigned long size, unsigned long offset)
-{
-	unsigned long *p = addr + (offset >> 6);
-	unsigned long result = offset & ~63UL;
-	unsigned long tmp;
-
-	if (offset >= size)
-		return size;
-	size -= result;
-	offset &= 63UL;
-	if(offset) {
-		tmp = __swab64p(p++);
-		tmp |= (~0UL >> (64-offset));
-		if(size < 64)
-			goto found_first;
-		if(~tmp)
-			goto found_middle;
-		size -= 64;
-		result += 64;
-	}
-	while(size & ~63) {
-		if(~(tmp = __swab64p(p++)))
-			goto found_middle;
-		result += 64;
-		size -= 64;
-	}
-	if(!size)
-		return result;
-	tmp = __swab64p(p);
-found_first:
-	tmp |= (~0UL << size);
-	if (tmp == ~0UL)        /* Are any bits zero? */
-		return result + size; /* Nope. */
-found_middle:
-	return result + ffz(tmp);
-}
+extern unsigned long find_next_zero_le_bit(unsigned long *, unsigned long, unsigned long);
 
 #ifdef __KERNEL__
 
diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h
index ab3c4ff76..fc1931681 100644
--- a/include/asm-sparc64/cacheflush.h
+++ b/include/asm-sparc64/cacheflush.h
@@ -42,6 +42,8 @@ extern void __flush_dcache_range(unsigned long start, unsigned long end);
 	memcpy(dst, src, len)
 
 extern void flush_dcache_page(struct page *page);
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 
 #define flush_cache_vmap(start, end)		do { } while (0)
 #define flush_cache_vunmap(start, end)		do { } while (0)
diff --git a/include/asm-sparc64/chmctrl.h b/include/asm-sparc64/chmctrl.h
index 4a4d8fdd5..53047f9f6 100644
--- a/include/asm-sparc64/chmctrl.h
+++ b/include/asm-sparc64/chmctrl.h
@@ -14,171 +14,171 @@
 #define CHMCTRL_MACTRL		0x30 /* Memory Address Control		*/
 
 /* Memory Timing Control I */
-#define TCTRL1_SDRAMCTL_DLY	0xf000000000000000
+#define TCTRL1_SDRAMCTL_DLY	0xf000000000000000UL
 #define TCTRL1_SDRAMCTL_DLY_SHIFT     60
-#define TCTRL1_SDRAMCLK_DLY	0x0e00000000000000
+#define TCTRL1_SDRAMCLK_DLY	0x0e00000000000000UL
 #define TCTRL1_SDRAMCLK_DLY_SHIFT     57
-#define TCTRL1_R		0x0100000000000000
+#define TCTRL1_R		0x0100000000000000UL
 #define TCTRL1_R_SHIFT 		      56
-#define TCTRL1_AUTORFR_CYCLE	0x00fe000000000000
+#define TCTRL1_AUTORFR_CYCLE	0x00fe000000000000UL
 #define TCTRL1_AUTORFR_CYCLE_SHIFT    49
-#define TCTRL1_RD_WAIT		0x0001f00000000000
+#define TCTRL1_RD_WAIT		0x0001f00000000000UL
 #define TCTRL1_RD_WAIT_SHIFT	      44
-#define TCTRL1_PC_CYCLE		0x00000fc000000000
+#define TCTRL1_PC_CYCLE		0x00000fc000000000UL
 #define TCTRL1_PC_CYCLE_SHIFT	      38
-#define TCTRL1_WR_MORE_RAS_PW	0x0000003f00000000
+#define TCTRL1_WR_MORE_RAS_PW	0x0000003f00000000UL
 #define TCTRL1_WR_MORE_RAS_PW_SHIFT   32
-#define TCTRL1_RD_MORE_RAW_PW	0x00000000fc000000
+#define TCTRL1_RD_MORE_RAW_PW	0x00000000fc000000UL
 #define TCTRL1_RD_MORE_RAS_PW_SHIFT   26
-#define TCTRL1_ACT_WR_DLY	0x0000000003f00000
+#define TCTRL1_ACT_WR_DLY	0x0000000003f00000UL
 #define TCTRL1_ACT_WR_DLY_SHIFT	      20
-#define TCTRL1_ACT_RD_DLY	0x00000000000fc000
+#define TCTRL1_ACT_RD_DLY	0x00000000000fc000UL
 #define TCTRL1_ACT_RD_DLY_SHIFT	      14
-#define TCTRL1_BANK_PRESENT	0x0000000000003000
+#define TCTRL1_BANK_PRESENT	0x0000000000003000UL
 #define TCTRL1_BANK_PRESENT_SHIFT     12
-#define TCTRL1_RFR_INT		0x0000000000000ff8
+#define TCTRL1_RFR_INT		0x0000000000000ff8UL
 #define TCTRL1_RFR_INT_SHIFT	      3
-#define TCTRL1_SET_MODE_REG	0x0000000000000004
+#define TCTRL1_SET_MODE_REG	0x0000000000000004UL
 #define TCTRL1_SET_MODE_REG_SHIFT     2
-#define TCTRL1_RFR_ENABLE	0x0000000000000002
+#define TCTRL1_RFR_ENABLE	0x0000000000000002UL
 #define TCTRL1_RFR_ENABLE_SHIFT	      1
-#define TCTRL1_PRECHG_ALL	0x0000000000000001
+#define TCTRL1_PRECHG_ALL	0x0000000000000001UL
 #define TCTRL1_PRECHG_ALL_SHIFT	      0
 
 /* Memory Timing Control II */
-#define TCTRL2_WR_MSEL_DLY	0xfc00000000000000
+#define TCTRL2_WR_MSEL_DLY	0xfc00000000000000UL
 #define TCTRL2_WR_MSEL_DLY_SHIFT      58
-#define TCTRL2_RD_MSEL_DLY	0x03f0000000000000
+#define TCTRL2_RD_MSEL_DLY	0x03f0000000000000UL
 #define TCTRL2_RD_MSEL_DLY_SHIFT      52
-#define TCTRL2_WRDATA_THLD	0x000c000000000000
+#define TCTRL2_WRDATA_THLD	0x000c000000000000UL
 #define TCTRL2_WRDATA_THLD_SHIFT      50
-#define TCTRL2_RDWR_RD_TI_DLY	0x0003f00000000000
+#define TCTRL2_RDWR_RD_TI_DLY	0x0003f00000000000UL
 #define TCTRL2_RDWR_RD_TI_DLY_SHIFT   44
-#define TCTRL2_AUTOPRECHG_ENBL	0x0000080000000000
+#define TCTRL2_AUTOPRECHG_ENBL	0x0000080000000000UL
 #define TCTRL2_AUTOPRECHG_ENBL_SHIFT  43
-#define TCTRL2_RDWR_PI_MORE_DLY	0x000007c000000000
+#define TCTRL2_RDWR_PI_MORE_DLY	0x000007c000000000UL
 #define TCTRL2_RDWR_PI_MORE_DLY_SHIFT 38
-#define TCTRL2_RDWR_1_DLY	0x0000003f00000000
+#define TCTRL2_RDWR_1_DLY	0x0000003f00000000UL
 #define TCTRL2_RDWR_1_DLY_SHIFT       32
-#define TCTRL2_WRWR_PI_MORE_DLY	0x00000000f8000000
+#define TCTRL2_WRWR_PI_MORE_DLY	0x00000000f8000000UL
 #define TCTRL2_WRWR_PI_MORE_DLY_SHIFT 27
-#define TCTRL2_WRWR_1_DLY	0x0000000007e00000
+#define TCTRL2_WRWR_1_DLY	0x0000000007e00000UL
 #define TCTRL2_WRWR_1_DLY_SHIFT       21
-#define TCTRL2_RDWR_RD_PI_MORE_DLY 0x00000000001f0000
+#define TCTRL2_RDWR_RD_PI_MORE_DLY 0x00000000001f0000UL
 #define TCTRL2_RDWR_RD_PI_MORE_DLY_SHIFT 16
-#define TCTRL2_R		0x0000000000008000
+#define TCTRL2_R		0x0000000000008000UL
 #define TCTRL2_R_SHIFT		      15
-#define TCTRL2_SDRAM_MODE_REG_DATA 0x0000000000007fff
+#define TCTRL2_SDRAM_MODE_REG_DATA 0x0000000000007fffUL
 #define TCTRL2_SDRAM_MODE_REG_DATA_SHIFT 0
 
 /* Memory Timing Control III */
-#define TCTRL3_SDRAM_CTL_DLY	0xf000000000000000
+#define TCTRL3_SDRAM_CTL_DLY	0xf000000000000000UL
 #define TCTRL3_SDRAM_CTL_DLY_SHIFT    60
-#define TCTRL3_SDRAM_CLK_DLY	0x0e00000000000000
+#define TCTRL3_SDRAM_CLK_DLY	0x0e00000000000000UL
 #define TCTRL3_SDRAM_CLK_DLY_SHIFT    57
-#define TCTRL3_R		0x0100000000000000
+#define TCTRL3_R		0x0100000000000000UL
 #define TCTRL3_R_SHIFT		      56
-#define TCTRL3_AUTO_RFR_CYCLE	0x00fe000000000000
+#define TCTRL3_AUTO_RFR_CYCLE	0x00fe000000000000UL
 #define TCTRL3_AUTO_RFR_CYCLE_SHIFT   49
-#define TCTRL3_RD_WAIT		0x0001f00000000000
+#define TCTRL3_RD_WAIT		0x0001f00000000000UL
 #define TCTRL3_RD_WAIT_SHIFT	      44
-#define TCTRL3_PC_CYCLE		0x00000fc000000000
+#define TCTRL3_PC_CYCLE		0x00000fc000000000UL
 #define TCTRL3_PC_CYCLE_SHIFT	      38
-#define TCTRL3_WR_MORE_RAW_PW	0x0000003f00000000
+#define TCTRL3_WR_MORE_RAW_PW	0x0000003f00000000UL
 #define TCTRL3_WR_MORE_RAW_PW_SHIFT   32
-#define TCTRL3_RD_MORE_RAW_PW	0x00000000fc000000
+#define TCTRL3_RD_MORE_RAW_PW	0x00000000fc000000UL
 #define TCTRL3_RD_MORE_RAW_PW_SHIFT   26
-#define TCTRL3_ACT_WR_DLY	0x0000000003f00000
+#define TCTRL3_ACT_WR_DLY	0x0000000003f00000UL
 #define TCTRL3_ACT_WR_DLY_SHIFT       20
-#define TCTRL3_ACT_RD_DLY	0x00000000000fc000
+#define TCTRL3_ACT_RD_DLY	0x00000000000fc000UL
 #define TCTRL3_ACT_RD_DLY_SHIFT       14
-#define TCTRL3_BANK_PRESENT	0x0000000000003000
+#define TCTRL3_BANK_PRESENT	0x0000000000003000UL
 #define TCTRL3_BANK_PRESENT_SHIFT     12
-#define TCTRL3_RFR_INT		0x0000000000000ff8
+#define TCTRL3_RFR_INT		0x0000000000000ff8UL
 #define TCTRL3_RFR_INT_SHIFT	      3
-#define TCTRL3_SET_MODE_REG	0x0000000000000004
+#define TCTRL3_SET_MODE_REG	0x0000000000000004UL
 #define TCTRL3_SET_MODE_REG_SHIFT     2
-#define TCTRL3_RFR_ENABLE	0x0000000000000002
+#define TCTRL3_RFR_ENABLE	0x0000000000000002UL
 #define TCTRL3_RFR_ENABLE_SHIFT       1
-#define TCTRL3_PRECHG_ALL	0x0000000000000001
+#define TCTRL3_PRECHG_ALL	0x0000000000000001UL
 #define TCTRL3_PRECHG_ALL_SHIFT	      0
 
 /* Memory Timing Control IV */
-#define TCTRL4_WR_MSEL_DLY	0xfc00000000000000
+#define TCTRL4_WR_MSEL_DLY	0xfc00000000000000UL
 #define TCTRL4_WR_MSEL_DLY_SHIFT      58
-#define TCTRL4_RD_MSEL_DLY	0x03f0000000000000
+#define TCTRL4_RD_MSEL_DLY	0x03f0000000000000UL
 #define TCTRL4_RD_MSEL_DLY_SHIFT      52
-#define TCTRL4_WRDATA_THLD	0x000c000000000000
+#define TCTRL4_WRDATA_THLD	0x000c000000000000UL
 #define TCTRL4_WRDATA_THLD_SHIFT      50
-#define TCTRL4_RDWR_RD_RI_DLY	0x0003f00000000000
+#define TCTRL4_RDWR_RD_RI_DLY	0x0003f00000000000UL
 #define TCTRL4_RDWR_RD_RI_DLY_SHIFT   44
-#define TCTRL4_AUTO_PRECHG_ENBL	0x0000080000000000
+#define TCTRL4_AUTO_PRECHG_ENBL	0x0000080000000000UL
 #define TCTRL4_AUTO_PRECHG_ENBL_SHIFT 43
-#define TCTRL4_RD_WR_PI_MORE_DLY 0x000007c000000000
+#define TCTRL4_RD_WR_PI_MORE_DLY 0x000007c000000000UL
 #define TCTRL4_RD_WR_PI_MORE_DLY_SHIFT 38
-#define TCTRL4_RD_WR_TI_DLY	0x0000003f00000000
+#define TCTRL4_RD_WR_TI_DLY	0x0000003f00000000UL
 #define TCTRL4_RD_WR_TI_DLY_SHIFT     32
-#define TCTRL4_WR_WR_PI_MORE_DLY 0x00000000f8000000
+#define TCTRL4_WR_WR_PI_MORE_DLY 0x00000000f8000000UL
 #define TCTRL4_WR_WR_PI_MORE_DLY_SHIFT 27
-#define TCTRL4_WR_WR_TI_DLY	0x0000000007e00000
+#define TCTRL4_WR_WR_TI_DLY	0x0000000007e00000UL
 #define TCTRL4_WR_WR_TI_DLY_SHIFT     21
-#define TCTRL4_RDWR_RD_PI_MORE_DLY 0x00000000001f0000
+#define TCTRL4_RDWR_RD_PI_MORE_DLY 0x00000000001f000UL0
 #define TCTRL4_RDWR_RD_PI_MORE_DLY_SHIFT 16
-#define TCTRL4_R		0x0000000000008000
+#define TCTRL4_R		0x0000000000008000UL
 #define TCTRL4_R_SHIFT		      15
-#define TCTRL4_SDRAM_MODE_REG_DATA 0x0000000000007fff
+#define TCTRL4_SDRAM_MODE_REG_DATA 0x0000000000007fffUL
 #define TCTRL4_SDRAM_MODE_REG_DATA_SHIFT 0
 
 /* All 4 memory address decoding registers have the
  * same layout.
  */
-#define MEM_DECODE_VALID	0x8000000000000000 /* Valid */
+#define MEM_DECODE_VALID	0x8000000000000000UL /* Valid */
 #define MEM_DECODE_VALID_SHIFT	      63
-#define MEM_DECODE_UK		0x001ffe0000000000 /* Upper mask */
+#define MEM_DECODE_UK		0x001ffe0000000000UL /* Upper mask */
 #define MEM_DECODE_UK_SHIFT	      41
-#define MEM_DECODE_UM		0x0000001ffff00000 /* Upper match */
+#define MEM_DECODE_UM		0x0000001ffff00000UL /* Upper match */
 #define MEM_DECODE_UM_SHIFT	      20
-#define MEM_DECODE_LK		0x000000000003c000 /* Lower mask */
+#define MEM_DECODE_LK		0x000000000003c000UL /* Lower mask */
 #define MEM_DECODE_LK_SHIFT	      14
-#define MEM_DECODE_LM		0x0000000000000f00 /* Lower match */
+#define MEM_DECODE_LM		0x0000000000000f00UL /* Lower match */
 #define MEM_DECODE_LM_SHIFT           8
 
-#define PA_UPPER_BITS		0x000007fffc000000
+#define PA_UPPER_BITS		0x000007fffc000000UL
 #define PA_UPPER_BITS_SHIFT	26
-#define PA_LOWER_BITS		0x00000000000003c0
+#define PA_LOWER_BITS		0x00000000000003c0UL
 #define PA_LOWER_BITS_SHIFT	6
 
-#define MACTRL_R0		         0x8000000000000000
+#define MACTRL_R0		         0x8000000000000000UL
 #define MACTRL_R0_SHIFT		         63
-#define MACTRL_ADDR_LE_PW                0x7000000000000000
+#define MACTRL_ADDR_LE_PW                0x7000000000000000UL
 #define MACTRL_ADDR_LE_PW_SHIFT		 60
-#define MACTRL_CMD_PW                    0x0f00000000000000
+#define MACTRL_CMD_PW                    0x0f00000000000000UL
 #define MACTRL_CMD_PW_SHIFT		 56
-#define MACTRL_HALF_MODE_WR_MSEL_DLY     0x00fc000000000000
+#define MACTRL_HALF_MODE_WR_MSEL_DLY     0x00fc000000000000UL
 #define MACTRL_HALF_MODE_WR_MSEL_DLY_SHIFT 50
-#define MACTRL_HALF_MODE_RD_MSEL_DLY     0x0003f00000000000
+#define MACTRL_HALF_MODE_RD_MSEL_DLY     0x0003f00000000000UL
 #define MACTRL_HALF_MODE_RD_MSEL_DLY_SHIFT 44
-#define MACTRL_HALF_MODE_SDRAM_CTL_DLY   0x00000f0000000000
+#define MACTRL_HALF_MODE_SDRAM_CTL_DLY   0x00000f0000000000UL
 #define MACTRL_HALF_MODE_SDRAM_CTL_DLY_SHIFT 40
-#define MACTRL_HALF_MODE_SDRAM_CLK_DLY   0x000000e000000000
+#define MACTRL_HALF_MODE_SDRAM_CLK_DLY   0x000000e000000000UL
 #define MACTRL_HALF_MODE_SDRAM_CLK_DLY_SHIFT 37
-#define MACTRL_R1                        0x0000001000000000
+#define MACTRL_R1                        0x0000001000000000UL
 #define MACTRL_R1_SHIFT                      36
-#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B3 0x0000000f00000000
+#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B3 0x0000000f00000000UL
 #define MACTRL_BANKSEL_N_ROWADDR_SIZE_B3_SHIFT 32
-#define MACTRL_ENC_INTLV_B3              0x00000000f8000000
+#define MACTRL_ENC_INTLV_B3              0x00000000f8000000UL
 #define MACTRL_ENC_INTLV_B3_SHIFT              27
-#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B2 0x0000000007800000
+#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B2 0x0000000007800000UL
 #define MACTRL_BANKSEL_N_ROWADDR_SIZE_B2_SHIFT 23
-#define MACTRL_ENC_INTLV_B2              0x00000000007c0000
+#define MACTRL_ENC_INTLV_B2              0x00000000007c0000UL
 #define MACTRL_ENC_INTLV_B2_SHIFT              18
-#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B1 0x000000000003c000
+#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B1 0x000000000003c000UL
 #define MACTRL_BANKSEL_N_ROWADDR_SIZE_B1_SHIFT 14
-#define MACTRL_ENC_INTLV_B1              0x0000000000003e00
+#define MACTRL_ENC_INTLV_B1              0x0000000000003e00UL
 #define MACTRL_ENC_INTLV_B1_SHIFT               9
-#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B0 0x00000000000001e0
+#define MACTRL_BANKSEL_N_ROWADDR_SIZE_B0 0x00000000000001e0UL
 #define MACTRL_BANKSEL_N_ROWADDR_SIZE_B0_SHIFT  5
-#define MACTRL_ENC_INTLV_B0              0x000000000000001f
+#define MACTRL_ENC_INTLV_B0              0x000000000000001fUL
 #define MACTRL_ENC_INTLV_B0_SHIFT               0
 
 #endif /* _SPARC64_CHMCTRL_H */
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index 02af9130a..874b136de 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -116,12 +116,12 @@ typedef u32		compat_sigset_word;
  */
 typedef	u32		compat_uptr_t;
 
-static inline void *compat_ptr(compat_uptr_t uptr)
+static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
-	return (void *)(unsigned long)uptr;
+	return (void __user *)(unsigned long)uptr;
 }
 
-static __inline__ void *compat_alloc_user_space(long len)
+static __inline__ void __user *compat_alloc_user_space(long len)
 {
 	struct pt_regs *regs = current_thread_info()->kregs;
 	unsigned long usp = regs->u_regs[UREG_I6];
@@ -129,7 +129,7 @@ static __inline__ void *compat_alloc_user_space(long len)
 	if (!(test_thread_flag(TIF_32BIT)))
 		usp += STACK_BIAS;
 
-	return (void *) (usp - len);
+	return (void __user *) (usp - len);
 }
 
 #endif /* _ASM_SPARC64_COMPAT_H */
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h
index b57dd3df9..cae78abf2 100644
--- a/include/asm-sparc64/hardirq.h
+++ b/include/asm-sparc64/hardirq.h
@@ -55,15 +55,6 @@ typedef struct {
 #define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
 #define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
 
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 /*
  * Are we doing bottom half or hardware interrupt processing?
  * Are we in a softirq context? Interrupt context?
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h
index 9ce42e117..f850b61ab 100644
--- a/include/asm-sparc64/ide.h
+++ b/include/asm-sparc64/ide.h
@@ -24,17 +24,8 @@
 # endif
 #endif
 
-static __inline__ int ide_default_irq(unsigned long base)
-{
-	return 0;
-}
-
-static __inline__ unsigned long ide_default_io_base(int index)
-{
-	return 0;
-}
-
-#define ide_init_default_irq(base)	(0)
+#define IDE_ARCH_OBSOLETE_INIT
+#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
 
 #define __ide_insl(data_reg, buffer, wcount) \
 	__ide_insw(data_reg, buffer, (wcount)<<1)
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h
index c671d2629..5fd16e42a 100644
--- a/include/asm-sparc64/iommu.h
+++ b/include/asm-sparc64/iommu.h
@@ -7,13 +7,13 @@
 #define _SPARC64_IOMMU_H
 
 /* The format of an iopte in the page tables. */
-#define IOPTE_VALID         0x8000000000000000 /* IOPTE is valid                   */
-#define IOPTE_64K           0x2000000000000000 /* IOPTE is for 64k page            */
-#define IOPTE_STBUF         0x1000000000000000 /* DVMA can use streaming buffer    */
-#define IOPTE_INTRA         0x0800000000000000 /* SBUS slot-->slot direct transfer */
-#define IOPTE_CONTEXT	    0x07ff800000000000 /* Context number		   */
-#define IOPTE_PAGE          0x00007fffffffe000 /* Physical page number (PA[42:13]) */
-#define IOPTE_CACHE         0x0000000000000010 /* Cached (in UPA E-cache)          */
-#define IOPTE_WRITE         0x0000000000000002 /* Writeable                        */
+#define IOPTE_VALID   0x8000000000000000UL /* IOPTE is valid                  */
+#define IOPTE_64K     0x2000000000000000UL /* IOPTE is for 64k page           */
+#define IOPTE_STBUF   0x1000000000000000UL /* DVMA can use streaming buffer   */
+#define IOPTE_INTRA   0x0800000000000000UL /* SBUS slot-->slot direct transfer*/
+#define IOPTE_CONTEXT 0x07ff800000000000UL /* Context number		      */
+#define IOPTE_PAGE    0x00007fffffffe000UL /* Physical page number (PA[42:13])*/
+#define IOPTE_CACHE   0x0000000000000010UL /* Cached (in UPA E-cache)         */
+#define IOPTE_WRITE   0x0000000000000002UL /* Writeable                       */
 
 #endif /* !(_SPARC_IOMMU_H) */
diff --git a/include/asm-sparc64/lsu.h b/include/asm-sparc64/lsu.h
index d592e9757..e5329c7f5 100644
--- a/include/asm-sparc64/lsu.h
+++ b/include/asm-sparc64/lsu.h
@@ -2,17 +2,19 @@
 #ifndef _SPARC64_LSU_H
 #define _SPARC64_LSU_H
 
+#include <asm/const.h>
+
 /* LSU Control Register */
-#define LSU_CONTROL_PM		0x000001fe00000000 /* Phys-watchpoint byte mask     */
-#define LSU_CONTROL_VM		0x00000001fe000000 /* Virt-watchpoint byte mask     */
-#define LSU_CONTROL_PR		0x0000000001000000 /* Phys-read watchpoint enable   */
-#define LSU_CONTROL_PW		0x0000000000800000 /* Phys-write watchpoint enable  */
-#define LSU_CONTROL_VR		0x0000000000400000 /* Virt-read watchpoint enable   */
-#define LSU_CONTROL_VW		0x0000000000200000 /* Virt-write watchpoint enable  */
-#define LSU_CONTROL_FM		0x00000000000ffff0 /* Parity mask enables.          */
-#define LSU_CONTROL_DM		0x0000000000000008 /* Data MMU enable.              */
-#define LSU_CONTROL_IM		0x0000000000000004 /* Instruction MMU enable.       */
-#define LSU_CONTROL_DC		0x0000000000000002 /* Data cache enable.            */
-#define LSU_CONTROL_IC		0x0000000000000001 /* Instruction cache enable.     */
+#define LSU_CONTROL_PM _AC(0x000001fe00000000,UL) /* Phys-watchpoint byte mask*/
+#define LSU_CONTROL_VM _AC(0x00000001fe000000,UL) /* Virt-watchpoint byte mask*/
+#define LSU_CONTROL_PR _AC(0x0000000001000000,UL) /* Phys-rd watchpoint enable*/
+#define LSU_CONTROL_PW _AC(0x0000000000800000,UL) /* Phys-wr watchpoint enable*/
+#define LSU_CONTROL_VR _AC(0x0000000000400000,UL) /* Virt-rd watchpoint enable*/
+#define LSU_CONTROL_VW _AC(0x0000000000200000,UL) /* Virt-wr watchpoint enable*/
+#define LSU_CONTROL_FM _AC(0x00000000000ffff0,UL) /* Parity mask enables.     */
+#define LSU_CONTROL_DM _AC(0x0000000000000008,UL) /* Data MMU enable.         */
+#define LSU_CONTROL_IM _AC(0x0000000000000004,UL) /* Instruction MMU enable.  */
+#define LSU_CONTROL_DC _AC(0x0000000000000002,UL) /* Data cache enable.       */
+#define LSU_CONTROL_IC _AC(0x0000000000000001,UL) /* Instruction cache enable.*/
 
 #endif /* !(_SPARC64_LSU_H) */
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index 21ca6e379..c543310b9 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -4,18 +4,12 @@
 #define _SPARC64_PAGE_H
 
 #include <linux/config.h>
+#include <asm/const.h>
 
 #define PAGE_SHIFT   13
-#ifndef __ASSEMBLY__
-/* I have my suspicions... -DaveM */
-#define PAGE_SIZE    (1UL << PAGE_SHIFT)
-#else
-#define PAGE_SIZE    (1 << PAGE_SHIFT)
-#endif
-
+#define PAGE_SIZE    (_AC(1,UL) << PAGE_SHIFT)
 #define PAGE_MASK    (~(PAGE_SIZE-1))
 
-
 #ifdef __KERNEL__
 
 #ifndef __ASSEMBLY__
@@ -99,13 +93,13 @@ typedef unsigned long iopgprot_t;
 #endif
 
 #ifdef CONFIG_HUGETLB_PAGE
-#define HPAGE_SIZE		((1UL) << HPAGE_SHIFT)
+#define HPAGE_SIZE		(_AC(1,UL) << HPAGE_SHIFT)
 #define HPAGE_MASK		(~(HPAGE_SIZE - 1UL))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
 #endif
 
 #define TASK_UNMAPPED_BASE	(test_thread_flag(TIF_32BIT) ? \
-				 (0x0000000070000000UL) : (PAGE_OFFSET))
+				 (_AC(0x0000000070000000,UL)) : (PAGE_OFFSET))
 
 #endif /* !(__ASSEMBLY__) */
 
@@ -115,7 +109,7 @@ typedef unsigned long iopgprot_t;
 /* We used to stick this into a hard-coded global register (%g4)
  * but that does not make sense anymore.
  */
-#define PAGE_OFFSET		0xFFFFF80000000000
+#define PAGE_OFFSET		_AC(0xFFFFF80000000000,UL)
 
 #define __pa(x)			((unsigned long)(x) - PAGE_OFFSET)
 #define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET))
diff --git a/include/asm-sparc64/param.h b/include/asm-sparc64/param.h
index eed805c00..6a12f3ac0 100644
--- a/include/asm-sparc64/param.h
+++ b/include/asm-sparc64/param.h
@@ -3,7 +3,7 @@
 #define _ASMSPARC64_PARAM_H
 
 #ifdef __KERNEL__
-# define HZ		100	/* Internal kernel timer frequency */
+# define HZ		1000	/* Internal kernel timer frequency */
 # define USER_HZ	100	/* .. some user interfaces are in "ticks" */
 # define CLOCKS_PER_SEC (USER_HZ)
 #endif
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 9f7710950..cfe407cf1 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -168,7 +168,7 @@ extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
  * can drive enough of the 64 bits.
  */
 #define PCI64_REQUIRED_MASK	(~(dma64_addr_t)0)
-#define PCI64_ADDR_BASE		0xfffc000000000000
+#define PCI64_ADDR_BASE		0xfffc000000000000UL
 
 /* Usage of the pci_dac_foo interfaces is only valid if this
  * test passes.
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 20149fbc8..44b67330f 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -18,6 +18,7 @@
 #include <asm/system.h>
 #include <asm/page.h>
 #include <asm/processor.h>
+#include <asm/const.h>
 
 /* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 16MB).
  * The page copy blockops use 0x1000000 to 0x18000000 (16MB --> 24MB).
@@ -26,14 +27,14 @@
  * There is a single static kernel PMD which maps from 0x0 to address
  * 0x400000000.
  */
-#define	TLBTEMP_BASE		0x0000000001000000
-#define MODULES_VADDR		0x0000000002000000
-#define MODULES_LEN		0x000000007e000000
-#define MODULES_END		0x0000000080000000
-#define VMALLOC_START		0x0000000140000000
-#define VMALLOC_END		0x0000000200000000
-#define LOW_OBP_ADDRESS		0x00000000f0000000
-#define HI_OBP_ADDRESS		0x0000000100000000
+#define	TLBTEMP_BASE		_AC(0x0000000001000000,UL)
+#define MODULES_VADDR		_AC(0x0000000002000000,UL)
+#define MODULES_LEN		_AC(0x000000007e000000,UL)
+#define MODULES_END		_AC(0x0000000080000000,UL)
+#define VMALLOC_START		_AC(0x0000000140000000,UL)
+#define VMALLOC_END		_AC(0x0000000200000000,UL)
+#define LOW_OBP_ADDRESS		_AC(0x00000000f0000000,UL)
+#define HI_OBP_ADDRESS		_AC(0x0000000100000000,UL)
 
 /* XXX All of this needs to be rethought so we can take advantage
  * XXX cheetah's full 64-bit virtual address space, ie. no more hole
@@ -49,7 +50,9 @@
  * long). Finally, the higher few bits determine pgde#.
  */
 
-/* PMD_SHIFT determines the size of the area a second-level page table can map */
+/* PMD_SHIFT determines the size of the area a second-level page
+ * table can map
+ */
 #define PMD_SHIFT	(PAGE_SHIFT + (PAGE_SHIFT-3))
 #define PMD_SIZE	(1UL << PMD_SHIFT)
 #define PMD_MASK	(~(PMD_SIZE-1))
@@ -78,7 +81,8 @@
  */
 #define REAL_PTRS_PER_PMD	(1UL << PMD_BITS)
 #define PTRS_PER_PMD		((const int)(test_thread_flag(TIF_32BIT) ? \
-				 (1UL << (32 - (PAGE_SHIFT-3) - PAGE_SHIFT)) : (REAL_PTRS_PER_PMD)))
+				 (1UL << (32 - (PAGE_SHIFT-3) - PAGE_SHIFT)) : \
+				 (REAL_PTRS_PER_PMD)))
 
 /*
  * We cannot use the top address range because VPTE table lives there. This
@@ -86,9 +90,9 @@
  * vpte size, then aligns it to the number of bytes mapped by one pgde, and
  * thus calculates the number of pgdes needed.
  */
-#define PTRS_PER_PGD	(((1UL << VA_BITS) - VPTE_SIZE + (1UL << (PAGE_SHIFT + \
-			(PAGE_SHIFT-3) + PMD_BITS)) - 1) / (1UL << (PAGE_SHIFT + \
-			(PAGE_SHIFT-3) + PMD_BITS)))
+#define PTRS_PER_PGD (((1UL << VA_BITS) - VPTE_SIZE + (1UL << (PAGE_SHIFT + \
+		      (PAGE_SHIFT-3) + PMD_BITS)) - 1) / (1UL << (PAGE_SHIFT + \
+		      (PAGE_SHIFT-3) + PMD_BITS)))
 
 /* Kernel has a separate 44bit address space. */
 #define USER_PTRS_PER_PGD	((const int)(test_thread_flag(TIF_32BIT)) ? \
@@ -102,33 +106,33 @@
 #endif /* !(__ASSEMBLY__) */
 
 /* Spitfire/Cheetah TTE bits. */
-#define _PAGE_VALID	0x8000000000000000	/* Valid TTE                          */
-#define _PAGE_R		0x8000000000000000	/* Used to keep ref bit up to date    */
-#define _PAGE_SZ4MB	0x6000000000000000	/* 4MB Page                           */
-#define _PAGE_SZ512K	0x4000000000000000	/* 512K Page                          */
-#define _PAGE_SZ64K	0x2000000000000000	/* 64K Page                           */
-#define _PAGE_SZ8K	0x0000000000000000	/* 8K Page                            */
-#define _PAGE_NFO	0x1000000000000000	/* No Fault Only                      */
-#define _PAGE_IE	0x0800000000000000	/* Invert Endianness                  */
-#define _PAGE_SN	0x0000800000000000	/* (Cheetah) Snoop                    */
-#define _PAGE_PADDR_SF	0x000001FFFFFFE000	/* (Spitfire) Phys Address [40:13]    */
-#define _PAGE_PADDR	0x000007FFFFFFE000	/* (Cheetah) Phys Address [42:13]     */
-#define _PAGE_SOFT	0x0000000000001F80	/* Software bits                      */
-#define _PAGE_L		0x0000000000000040	/* Locked TTE                         */
-#define _PAGE_CP	0x0000000000000020	/* Cacheable in Physical Cache        */
-#define _PAGE_CV	0x0000000000000010	/* Cacheable in Virtual Cache         */
-#define _PAGE_E		0x0000000000000008	/* side-Effect                        */
-#define _PAGE_P		0x0000000000000004	/* Privileged Page                    */
-#define _PAGE_W		0x0000000000000002	/* Writable                           */
-#define _PAGE_G		0x0000000000000001	/* Global                             */
+#define _PAGE_VALID	_AC(0x8000000000000000,UL) /* Valid TTE               */
+#define _PAGE_R		_AC(0x8000000000000000,UL) /* Keep ref bit up to date */
+#define _PAGE_SZ4MB	_AC(0x6000000000000000,UL) /* 4MB Page                */
+#define _PAGE_SZ512K	_AC(0x4000000000000000,UL) /* 512K Page               */
+#define _PAGE_SZ64K	_AC(0x2000000000000000,UL) /* 64K Page                */
+#define _PAGE_SZ8K	_AC(0x0000000000000000,UL) /* 8K Page                 */
+#define _PAGE_NFO	_AC(0x1000000000000000,UL) /* No Fault Only           */
+#define _PAGE_IE	_AC(0x0800000000000000,UL) /* Invert Endianness       */
+#define _PAGE_SN	_AC(0x0000800000000000,UL) /* (Cheetah) Snoop         */
+#define _PAGE_PADDR_SF	_AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr [40:13]*/
+#define _PAGE_PADDR	_AC(0x000007FFFFFFE000,UL) /* (Cheetah) paddr [42:13] */
+#define _PAGE_SOFT	_AC(0x0000000000001F80,UL) /* Software bits           */
+#define _PAGE_L		_AC(0x0000000000000040,UL) /* Locked TTE              */
+#define _PAGE_CP	_AC(0x0000000000000020,UL) /* Cacheable in P-Cache    */
+#define _PAGE_CV	_AC(0x0000000000000010,UL) /* Cacheable in V-Cache    */
+#define _PAGE_E		_AC(0x0000000000000008,UL) /* side-Effect             */
+#define _PAGE_P		_AC(0x0000000000000004,UL) /* Privileged Page         */
+#define _PAGE_W		_AC(0x0000000000000002,UL) /* Writable                */
+#define _PAGE_G		_AC(0x0000000000000001,UL) /* Global                  */
 
 /* Here are the SpitFire software bits we use in the TTE's. */
-#define _PAGE_FILE	0x0000000000001000	/* Pagecache page                     */
-#define _PAGE_MODIFIED	0x0000000000000800	/* Modified Page (ie. dirty)          */
-#define _PAGE_ACCESSED	0x0000000000000400	/* Accessed Page (ie. referenced)     */
-#define _PAGE_READ	0x0000000000000200	/* Readable SW Bit                    */
-#define _PAGE_WRITE	0x0000000000000100	/* Writable SW Bit                    */
-#define _PAGE_PRESENT	0x0000000000000080	/* Present Page (ie. not swapped out) */
+#define _PAGE_FILE	_AC(0x0000000000001000,UL)	/* Pagecache page     */
+#define _PAGE_MODIFIED	_AC(0x0000000000000800,UL)	/* Modified (dirty)   */
+#define _PAGE_ACCESSED	_AC(0x0000000000000400,UL)	/* Accessed (ref'd)   */
+#define _PAGE_READ	_AC(0x0000000000000200,UL)	/* Readable SW Bit    */
+#define _PAGE_WRITE	_AC(0x0000000000000100,UL)	/* Writable SW Bit    */
+#define _PAGE_PRESENT	_AC(0x0000000000000080,UL)	/* Present            */
 
 #if PAGE_SHIFT == 13
 #define _PAGE_SZBITS	_PAGE_SZ8K
@@ -173,7 +177,8 @@
 
 #define _PFN_MASK	_PAGE_PADDR
 
-#define pg_iobits (_PAGE_VALID | _PAGE_PRESENT | __DIRTY_BITS | __ACCESS_BITS | _PAGE_E)
+#define pg_iobits (_PAGE_VALID | _PAGE_PRESENT | __DIRTY_BITS | \
+		   __ACCESS_BITS | _PAGE_E)
 
 #define __P000	PAGE_NONE
 #define __P001	PAGE_READONLY
@@ -260,9 +265,12 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
 #define pte_dirty(pte)		(pte_val(pte) & _PAGE_MODIFIED)
 #define pte_young(pte)		(pte_val(pte) & _PAGE_ACCESSED)
 #define pte_wrprotect(pte)	(__pte(pte_val(pte) & ~(_PAGE_WRITE|_PAGE_W)))
-#define pte_rdprotect(pte)	(__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_READ))
-#define pte_mkclean(pte)	(__pte(pte_val(pte) & ~(_PAGE_MODIFIED|_PAGE_W)))
-#define pte_mkold(pte)		(__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_ACCESSED))
+#define pte_rdprotect(pte)	\
+	(__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_READ))
+#define pte_mkclean(pte)	\
+	(__pte(pte_val(pte) & ~(_PAGE_MODIFIED|_PAGE_W)))
+#define pte_mkold(pte)		\
+	(__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_ACCESSED))
 
 /* Permanent address of a page. */
 #define __page_address(page)	page_address(page)
@@ -280,12 +288,14 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
 /* Find an entry in the second-level page table.. */
-#define pmd_offset(dir, address)	((pmd_t *) pgd_page(*(dir)) + \
-					((address >> PMD_SHIFT) & (REAL_PTRS_PER_PMD-1)))
+#define pmd_offset(dir, address)	\
+	((pmd_t *) pgd_page(*(dir)) + \
+	 ((address >> PMD_SHIFT) & (REAL_PTRS_PER_PMD-1)))
 
 /* Find an entry in the third-level page table.. */
-#define pte_index(dir, address)	((pte_t *) __pmd_page(*(dir)) + \
-					((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
+#define pte_index(dir, address)	\
+	((pte_t *) __pmd_page(*(dir)) + \
+	 ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
 #define pte_offset_kernel		pte_index
 #define pte_offset_map			pte_index
 #define pte_offset_map_nested		pte_index
@@ -305,7 +315,8 @@ extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
 static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
 {
 	pte_t pte;
-	pte_val(pte) = ((page) | pgprot_val(prot) | _PAGE_E) & ~(unsigned long)_PAGE_CACHE;
+	pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) &
+			~(unsigned long)_PAGE_CACHE);
 	pte_val(pte) |= (((unsigned long)space) << 32);
 	return pte;
 }
@@ -365,7 +376,8 @@ extern unsigned long *sparc64_valid_addr_bitmap;
 #define kern_addr_valid(addr)	\
 	(test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
 
-extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset,
+extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
+			       unsigned long offset,
 			       unsigned long size, pgprot_t prot, int space);
 
 #include <asm-generic/pgtable.h>
@@ -376,7 +388,9 @@ extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, u
 /* We provide a special get_unmapped_area for framebuffer mmaps to try and use
  * the largest alignment possible such that larget PTEs can be used.
  */
-extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, unsigned long, unsigned long, unsigned long);
+extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long,
+					  unsigned long, unsigned long,
+					  unsigned long);
 #define HAVE_ARCH_FB_UNMAPPED_AREA
 
 /*
@@ -386,8 +400,6 @@ extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long, unsi
 
 extern void check_pgt_cache(void);
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !(__ASSEMBLY__) */
 
 #endif /* !(_SPARC64_PGTABLE_H) */
diff --git a/include/asm-sparc64/pstate.h b/include/asm-sparc64/pstate.h
index fa69b5f6c..29fb74aa8 100644
--- a/include/asm-sparc64/pstate.h
+++ b/include/asm-sparc64/pstate.h
@@ -2,6 +2,8 @@
 #ifndef _SPARC64_PSTATE_H
 #define _SPARC64_PSTATE_H
 
+#include <asm/const.h>
+
 /* The V9 PSTATE Register (with SpitFire extensions).
  *
  * -----------------------------------------------------------------------
@@ -9,20 +11,20 @@
  * -----------------------------------------------------------------------
  *  63  12  11   10    9     8    7   6   5     4     3     2     1    0
  */
-#define PSTATE_IG	0x0000000000000800	/* Interrupt Globals.		*/
-#define PSTATE_MG	0x0000000000000400	/* MMU Globals.			*/
-#define PSTATE_CLE	0x0000000000000200	/* Current Little Endian.	*/
-#define PSTATE_TLE	0x0000000000000100	/* Trap Little Endian.		*/
-#define PSTATE_MM	0x00000000000000c0	/* Memory Model.		*/
-#define PSTATE_TSO	0x0000000000000000	/* MM: Total Store Order	*/
-#define PSTATE_PSO	0x0000000000000040	/* MM: Partial Store Order	*/
-#define PSTATE_RMO	0x0000000000000080	/* MM: Relaxed Memory Order	*/
-#define PSTATE_RED	0x0000000000000020	/* Reset Error Debug State.	*/
-#define PSTATE_PEF	0x0000000000000010	/* Floating Point Enable.	*/
-#define PSTATE_AM	0x0000000000000008	/* Address Mask.		*/
-#define PSTATE_PRIV	0x0000000000000004	/* Privilege.			*/
-#define PSTATE_IE	0x0000000000000002	/* Interrupt Enable.		*/
-#define PSTATE_AG	0x0000000000000001	/* Alternate Globals.		*/
+#define PSTATE_IG   _AC(0x0000000000000800,UL) /* Interrupt Globals.	*/
+#define PSTATE_MG   _AC(0x0000000000000400,UL) /* MMU Globals.		*/
+#define PSTATE_CLE  _AC(0x0000000000000200,UL) /* Current Little Endian.*/
+#define PSTATE_TLE  _AC(0x0000000000000100,UL) /* Trap Little Endian.	*/
+#define PSTATE_MM   _AC(0x00000000000000c0,UL) /* Memory Model.		*/
+#define PSTATE_TSO  _AC(0x0000000000000000,UL) /* MM: TotalStoreOrder	*/
+#define PSTATE_PSO  _AC(0x0000000000000040,UL) /* MM: PartialStoreOrder	*/
+#define PSTATE_RMO  _AC(0x0000000000000080,UL) /* MM: RelaxedMemoryOrder*/
+#define PSTATE_RED  _AC(0x0000000000000020,UL) /* Reset Error Debug.	*/
+#define PSTATE_PEF  _AC(0x0000000000000010,UL) /* Floating Point Enable.*/
+#define PSTATE_AM   _AC(0x0000000000000008,UL) /* Address Mask.		*/
+#define PSTATE_PRIV _AC(0x0000000000000004,UL) /* Privilege.		*/
+#define PSTATE_IE   _AC(0x0000000000000002,UL) /* Interrupt Enable.	*/
+#define PSTATE_AG   _AC(0x0000000000000001,UL) /* Alternate Globals.	*/
 
 /* The V9 TSTATE Register (with SpitFire and Linux extensions).
  *
@@ -31,35 +33,35 @@
  * ---------------------------------------------------------------
  *  63    40 39   32 31   24 23    20 19       8 7      5 4     0
  */
-#define TSTATE_CCR	0x000000ff00000000	/* Condition Codes.		*/
-#define TSTATE_XCC	0x000000f000000000	/* Condition Codes.		*/
-#define TSTATE_XNEG	0x0000008000000000	/* %xcc Negative.		*/
-#define TSTATE_XZERO	0x0000004000000000	/* %xcc Zero.			*/
-#define TSTATE_XOVFL	0x0000002000000000	/* %xcc Overflow.		*/
-#define TSTATE_XCARRY	0x0000001000000000	/* %xcc Carry.			*/
-#define TSTATE_ICC	0x0000000f00000000	/* Condition Codes.		*/
-#define TSTATE_INEG	0x0000000800000000	/* %icc Negative.		*/
-#define TSTATE_IZERO	0x0000000400000000	/* %icc Zero.			*/
-#define TSTATE_IOVFL	0x0000000200000000	/* %icc Overflow.		*/
-#define TSTATE_ICARRY	0x0000000100000000	/* %icc Carry.			*/
-#define TSTATE_ASI	0x00000000ff000000	/* Address Space Identifier.	*/
-#define TSTATE_PIL	0x0000000000f00000	/* %pil (Linux traps set this)  */
-#define TSTATE_PSTATE	0x00000000000fff00	/* PSTATE.			*/
-#define TSTATE_IG	0x0000000000080000	/* Interrupt Globals.		*/
-#define TSTATE_MG	0x0000000000040000	/* MMU Globals.			*/
-#define TSTATE_CLE	0x0000000000020000	/* Current Little Endian.	*/
-#define TSTATE_TLE	0x0000000000010000	/* Trap Little Endian.		*/
-#define TSTATE_MM	0x000000000000c000	/* Memory Model.		*/
-#define TSTATE_TSO	0x0000000000000000	/* MM: Total Store Order	*/
-#define TSTATE_PSO	0x0000000000004000	/* MM: Partial Store Order	*/
-#define TSTATE_RMO	0x0000000000008000	/* MM: Relaxed Memory Order	*/
-#define TSTATE_RED	0x0000000000002000	/* Reset Error Debug State.	*/
-#define TSTATE_PEF	0x0000000000001000	/* Floating Point Enable.	*/
-#define TSTATE_AM	0x0000000000000800	/* Address Mask.		*/
-#define TSTATE_PRIV	0x0000000000000400	/* Privilege.			*/
-#define TSTATE_IE	0x0000000000000200	/* Interrupt Enable.		*/
-#define TSTATE_AG	0x0000000000000100	/* Alternate Globals.		*/
-#define TSTATE_CWP	0x000000000000001f	/* Current Window Pointer.	*/
+#define TSTATE_CCR	_AC(0x000000ff00000000,UL) /* Condition Codes.	*/
+#define TSTATE_XCC	_AC(0x000000f000000000,UL) /* Condition Codes.	*/
+#define TSTATE_XNEG	_AC(0x0000008000000000,UL) /* %xcc Negative.	*/
+#define TSTATE_XZERO	_AC(0x0000004000000000,UL) /* %xcc Zero.	*/
+#define TSTATE_XOVFL	_AC(0x0000002000000000,UL) /* %xcc Overflow.	*/
+#define TSTATE_XCARRY	_AC(0x0000001000000000,UL) /* %xcc Carry.	*/
+#define TSTATE_ICC	_AC(0x0000000f00000000,UL) /* Condition Codes.	*/
+#define TSTATE_INEG	_AC(0x0000000800000000,UL) /* %icc Negative.	*/
+#define TSTATE_IZERO	_AC(0x0000000400000000,UL) /* %icc Zero.	*/
+#define TSTATE_IOVFL	_AC(0x0000000200000000,UL) /* %icc Overflow.	*/
+#define TSTATE_ICARRY	_AC(0x0000000100000000,UL) /* %icc Carry.	*/
+#define TSTATE_ASI	_AC(0x00000000ff000000,UL) /* AddrSpace ID.	*/
+#define TSTATE_PIL	_AC(0x0000000000f00000,UL) /* %pil (Linux traps)*/
+#define TSTATE_PSTATE	_AC(0x00000000000fff00,UL) /* PSTATE.		*/
+#define TSTATE_IG	_AC(0x0000000000080000,UL) /* Interrupt Globals.*/
+#define TSTATE_MG	_AC(0x0000000000040000,UL) /* MMU Globals.	*/
+#define TSTATE_CLE	_AC(0x0000000000020000,UL) /* CurrLittleEndian.	*/
+#define TSTATE_TLE	_AC(0x0000000000010000,UL) /* TrapLittleEndian.	*/
+#define TSTATE_MM	_AC(0x000000000000c000,UL) /* Memory Model.	*/
+#define TSTATE_TSO	_AC(0x0000000000000000,UL) /* MM: TSO		*/
+#define TSTATE_PSO	_AC(0x0000000000004000,UL) /* MM: PSO		*/
+#define TSTATE_RMO	_AC(0x0000000000008000,UL) /* MM: RMO		*/
+#define TSTATE_RED	_AC(0x0000000000002000,UL) /* Reset Error Debug.*/
+#define TSTATE_PEF	_AC(0x0000000000001000,UL) /* FPU Enable.	*/
+#define TSTATE_AM	_AC(0x0000000000000800,UL) /* Address Mask.	*/
+#define TSTATE_PRIV	_AC(0x0000000000000400,UL) /* Privilege.	*/
+#define TSTATE_IE	_AC(0x0000000000000200,UL) /* Interrupt Enable.	*/
+#define TSTATE_AG	_AC(0x0000000000000100,UL) /* Alternate Globals.*/
+#define TSTATE_CWP	_AC(0x000000000000001f,UL) /* Curr Win-Pointer.	*/
 
 /* Floating-Point Registers State Register.
  *
@@ -68,9 +70,9 @@
  * --------------------------------
  *  63     3    2       1      0
  */
-#define FPRS_FEF	0x0000000000000004	/* Enable Floating Point.	*/
-#define FPRS_DU		0x0000000000000002	/* Dirty Upper.			*/
-#define FPRS_DL		0x0000000000000001	/* Dirty Lower.			*/
+#define FPRS_FEF	_AC(0x0000000000000004,UL) /* FPU Enable.	*/
+#define FPRS_DU		_AC(0x0000000000000002,UL) /* Dirty Upper.	*/
+#define FPRS_DL		_AC(0x0000000000000001,UL) /* Dirty Lower.	*/
 
 /* Version Register.
  *
@@ -79,10 +81,10 @@
  * ------------------------------------------------------
  *  63   48 47  32 31  24 23  16 15    8 7    5 4      0
  */
-#define VERS_MANUF	0xffff000000000000	/* Manufacturer.		*/
-#define VERS_IMPL	0x0000ffff00000000	/* Implementation.		*/
-#define VERS_MASK	0x00000000ff000000	/* Mask Set Revision.		*/
-#define VERS_MAXTL	0x000000000000ff00	/* Maximum Trap Level.		*/
-#define VERS_MAXWIN	0x000000000000001f	/* Maximum Reg Window Index.	*/
+#define VERS_MANUF	_AC(0xffff000000000000,UL) /* Manufacturer.	*/
+#define VERS_IMPL	_AC(0x0000ffff00000000,UL) /* Implementation.	*/
+#define VERS_MASK	_AC(0x00000000ff000000,UL) /* Mask Set Revision.*/
+#define VERS_MAXTL	_AC(0x000000000000ff00,UL) /* Max Trap Level.	*/
+#define VERS_MAXWIN	_AC(0x000000000000001f,UL) /* Max RegWindow Idx.*/
 
 #endif /* !(_SPARC64_PSTATE_H) */
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h
index 2d669b1de..48279e10f 100644
--- a/include/asm-sparc64/sbus.h
+++ b/include/asm-sparc64/sbus.h
@@ -7,6 +7,7 @@
 #ifndef _SPARC64_SBUS_H
 #define _SPARC64_SBUS_H
 
+#include <linux/dma-mapping.h>
 #include <linux/ioport.h>
 
 #include <asm/oplib.h>
@@ -99,10 +100,10 @@ extern void sbus_set_sbus64(struct sbus_dev *, int);
 extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp);
 extern void sbus_free_consistent(struct sbus_dev *, size_t, void *, dma_addr_t);
 
-#define SBUS_DMA_BIDIRECTIONAL	0
-#define SBUS_DMA_TODEVICE	1
-#define SBUS_DMA_FROMDEVICE	2
-#define	SBUS_DMA_NONE		3
+#define SBUS_DMA_BIDIRECTIONAL	DMA_BIDIRECTIONAL
+#define SBUS_DMA_TODEVICE	DMA_TO_DEVICE
+#define SBUS_DMA_FROMDEVICE	DMA_FROM_DEVICE
+#define	SBUS_DMA_NONE		DMA_NONE
 
 /* All the rest use streaming mode mappings. */
 extern dma_addr_t sbus_map_single(struct sbus_dev *, void *, size_t, int);
diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
index 07df51118..7e5459fa4 100644
--- a/include/asm-sparc64/siginfo.h
+++ b/include/asm-sparc64/siginfo.h
@@ -99,7 +99,7 @@ typedef struct sigevent32 {
 	} _sigev_un;
 } sigevent_t32;
 
-extern int copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from);
+extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 3d252c484..1673945ea 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -212,7 +212,7 @@ struct __new_sigaction32 {
 
 struct k_sigaction {
 	struct __new_sigaction 	sa;
-	void			*ka_restorer;
+	void __user		*ka_restorer;
 };
 #endif
 
@@ -253,8 +253,6 @@ struct signal_deliver_cookie {
 struct pt_regs;
 extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
 
-#define HAVE_ARCH_SYS_PAUSE
-
 #endif /* !(__KERNEL__) */
 
 #endif /* !(__ASSEMBLY__) */
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index f5b09c7da..08a6e551c 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -78,6 +78,8 @@ static __inline__ void _raw_spin_unlock(spinlock_t *lock)
 			     : "memory");
 }
 
+extern void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags);
+
 #else /* !(CONFIG_DEBUG_SPINLOCK) */
 
 typedef struct {
@@ -103,6 +105,7 @@ extern int _spin_trylock (spinlock_t *lock);
 #define _raw_spin_trylock(lp)	_spin_trylock(lp)
 #define _raw_spin_lock(lock)	_do_spin_lock(lock, "spin_lock")
 #define _raw_spin_unlock(lock)	_do_spin_unlock(lock)
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 #endif /* CONFIG_DEBUG_SPINLOCK */
 
@@ -142,6 +145,7 @@ extern void _do_read_lock(rwlock_t *rw, char *str);
 extern void _do_read_unlock(rwlock_t *rw, char *str);
 extern void _do_write_lock(rwlock_t *rw, char *str);
 extern void _do_write_unlock(rwlock_t *rw);
+extern int _do_write_trylock(rwlock_t *rw, char *str);
 
 #define _raw_read_lock(lock) \
 do {	unsigned long flags; \
@@ -171,6 +175,15 @@ do {	unsigned long flags; \
 	local_irq_restore(flags); \
 } while(0)
 
+#define _raw_write_trylock(lock) \
+({	unsigned long flags; \
+	int val; \
+	local_irq_save(flags); \
+	val = _do_write_trylock(lock, "write_trylock"); \
+	local_irq_restore(flags); \
+	val; \
+})
+
 #endif /* CONFIG_DEBUG_SPINLOCK */
 
 #endif /* !(__ASSEMBLY__) */
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
index e05da3669..f989fbdc5 100644
--- a/include/asm-sparc64/thread_info.h
+++ b/include/asm-sparc64/thread_info.h
@@ -56,7 +56,8 @@ struct thread_info {
 	unsigned long		gsr[7];
 	unsigned long		xfsr[7];
 
-	__u64			*user_cntd0, *user_cntd1;
+	__u64			__user *user_cntd0;
+	__u64			__user *user_cntd1;
 	__u64			kernel_cntd0, kernel_cntd1;
 	__u64			pcr_reg;
 
diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h
index d0ee7f105..6248ed1a9 100644
--- a/include/asm-sparc64/types.h
+++ b/include/asm-sparc64/types.h
@@ -56,6 +56,8 @@ typedef unsigned long u64;
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index 0626d20c2..e1ce87c86 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -101,10 +101,12 @@ extern void __ret_efault(void);
  */
 #define put_user(x,ptr) ({ \
 unsigned long __pu_addr = (unsigned long)(ptr); \
+__chk_user_ptr(ptr); \
 __put_user_nocheck((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr))); })
 
 #define get_user(x,ptr) ({ \
 unsigned long __gu_addr = (unsigned long)(ptr); \
+__chk_user_ptr(ptr); \
 __get_user_nocheck((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr))); })
 
 #define __put_user(x,ptr) put_user(x,ptr)
@@ -163,7 +165,7 @@ __asm__ __volatile__(							\
 	".previous\n\n\t"						\
        : "=r" (foo) : "r" (x), "r" (__m(addr)));			\
 else									\
-__asm__ __volatile(							\
+__asm__ __volatile__(							\
 	"/* Put user asm ret, inline. */\n"				\
 "1:\t"	"st"#size "a %1, [%2] %%asi\n\n\t"				\
 	".section .fixup,#alloc,#execinstr\n\t"				\
@@ -263,12 +265,12 @@ extern unsigned long __copy_in_user(void __user *to, const void __user *from,
 #define copy_to_user __copy_to_user
 #define copy_in_user __copy_in_user
 
-extern unsigned long __bzero_noasi(void *, unsigned long);
+extern unsigned long __bzero_noasi(void __user *, unsigned long);
 
 static inline unsigned long __clear_user(void __user *addr, unsigned long size)
 {
 	
-	return __bzero_noasi((void *) addr, size);
+	return __bzero_noasi(addr, size);
 }
 
 #define clear_user __clear_user
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 751f7de1c..0ce57c1b4 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -446,7 +446,6 @@ static __inline__ _syscall1(int,dup,int,fd)
 static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp)
 static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
 static __inline__ _syscall1(int,close,int,fd)
-static __inline__ _syscall1(int,_exit,int,exitcode)
 static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
 #include <linux/linkage.h>
@@ -474,6 +473,27 @@ asmlinkage long sys_rt_sigaction(int sig,
 #define   _SC_JOB_CONTROL         6
 #define   _SC_SAVED_IDS           7
 #define   _SC_VERSION             8
+
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
 #endif
 
 /*
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 2d7896dea..148dd8e42 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -384,18 +384,6 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
 #define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
 #define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
 
-#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G)
-typedef u32 pte_addr_t;
-#endif
-
-#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM64G)
-typedef u64 pte_addr_t;
-#endif
-
-#if !defined(CONFIG_HIGHPTE)
-typedef pte_t *pte_addr_t;
-#endif
-
 #define update_mmu_cache(vma,address,pte) do ; while (0)
 
 /* Encode and de-code a swap entry */
diff --git a/include/asm-um/unistd.h b/include/asm-um/unistd.h
index 3e5f80056..5850620bb 100644
--- a/include/asm-um/unistd.h
+++ b/include/asm-um/unistd.h
@@ -12,6 +12,31 @@
 
 extern int um_execve(const char *file, char *const argv[], char *const env[]);
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-v850/atomic.h b/include/asm-v850/atomic.h
index 582de7674..8284aa736 100644
--- a/include/asm-v850/atomic.h
+++ b/include/asm-v850/atomic.h
@@ -76,6 +76,16 @@ static __inline__ void atomic_clear_mask (unsigned long mask, unsigned long *add
 #define atomic_inc(v) 		atomic_inc_return (v)
 #define atomic_dec(v) 		atomic_dec_return (v)
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 #define atomic_sub_and_test(i,v)	(atomic_sub_return ((i), (v)) == 0)
 #define atomic_dec_and_test(v)		(atomic_sub_return (1, (v)) == 0)
 #define atomic_add_negative(i,v)	(atomic_add_return ((i), (v)) < 0)
diff --git a/include/asm-v850/cacheflush.h b/include/asm-v850/cacheflush.h
index 32fdf158a..17d7d8934 100644
--- a/include/asm-v850/cacheflush.h
+++ b/include/asm-v850/cacheflush.h
@@ -27,6 +27,8 @@
 #define flush_cache_range(vma, start, end)	((void)0)
 #define flush_cache_page(vma, vmaddr)		((void)0)
 #define flush_dcache_page(page)			((void)0)
+#define flush_dcache_mmap_lock(mapping)		((void)0)
+#define flush_dcache_mmap_unlock(mapping)	((void)0)
 #define flush_cache_vmap(start, end)		((void)0)
 #define flush_cache_vunmap(start, end)		((void)0)
 
diff --git a/include/asm-v850/flat.h b/include/asm-v850/flat.h
index 17106c894..3888f59d6 100644
--- a/include/asm-v850/flat.h
+++ b/include/asm-v850/flat.h
@@ -45,7 +45,8 @@ flat_get_relocate_addr (unsigned long relval)
    RELVAL is the raw relocation-table entry from which RP is derived.
    For the v850, RP should always be half-word aligned.  */
 static inline unsigned long flat_get_addr_from_rp (unsigned long *rp,
-						   unsigned long relval)
+						   unsigned long relval,
+						   unsigned long flags)
 {
 	short *srp = (short *)rp;
 
diff --git a/include/asm-v850/pgtable.h b/include/asm-v850/pgtable.h
index f71de3385..fd922a474 100644
--- a/include/asm-v850/pgtable.h
+++ b/include/asm-v850/pgtable.h
@@ -5,8 +5,6 @@
 #include <asm/page.h>
 
 
-typedef pte_t *pte_addr_t;
-
 #define pgd_present(pgd)	(1) /* pages are always present on NO_MM */
 #define pgd_none(pgd)		(0)
 #define pgd_bad(pgd)		(0)
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index dcef57196..e7cfe5b33 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -59,6 +59,8 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned int kmem_bufctl_t;
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h
index 7d6695936..f8163e806 100644
--- a/include/asm-v850/unistd.h
+++ b/include/asm-v850/unistd.h
@@ -386,6 +386,31 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f)	      \
 }
 		
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifdef __KERNEL_SYSCALLS__
 
 #include <linux/compiler.h>
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h
index 5ce5dcef4..c91f028db 100644
--- a/include/asm-x86_64/bitops.h
+++ b/include/asm-x86_64/bitops.h
@@ -337,16 +337,15 @@ static __inline__ int find_first_bit(const unsigned long * addr, unsigned size)
 		"repe; scasl\n\t"
 		"jz 1f\n\t"
 		"leaq -4(%%rdi),%%rdi\n\t"
-		"bsfq (%%rdi),%%rax\n"
-		"1:\tsubl %%ebx,%%edi\n\t"
+		"bsfl (%%rdi),%%eax\n"
+		"1:\tsubq %%rbx,%%rdi\n\t"
 		"shll $3,%%edi\n\t"
 		"addl %%edi,%%eax"
 		:"=a" (res), "=&c" (d0), "=&D" (d1)
-		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
+		:"1" ((size + 31) >> 5), "2" (addr), "b" (addr) : "memory");
 	return res;
 }
 
-
 /**
  * find_next_bit - find the first set bit in a memory region
  * @addr: The address to base the search on
@@ -458,7 +457,7 @@ static __inline__ int ffs(int x)
 
 	__asm__("bsfl %1,%0\n\t"
 		"cmovzl %2,%0" 
-		: "=r" (r) : "g" (x), "r" (-1));
+		: "=r" (r) : "rm" (x), "r" (-1));
 	return r+1;
 }
 
diff --git a/include/asm-x86_64/cacheflush.h b/include/asm-x86_64/cacheflush.h
index 5ab521e3d..ddc75f714 100644
--- a/include/asm-x86_64/cacheflush.h
+++ b/include/asm-x86_64/cacheflush.h
@@ -10,6 +10,8 @@
 #define flush_cache_range(vma, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#define flush_dcache_mmap_lock(mapping)		do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
 #define flush_icache_range(start, end)		do { } while (0)
 #define flush_icache_page(vma,pg)		do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
diff --git a/include/asm-x86_64/checksum.h b/include/asm-x86_64/checksum.h
index 3718a8fbb..abcabbce9 100644
--- a/include/asm-x86_64/checksum.h
+++ b/include/asm-x86_64/checksum.h
@@ -139,9 +139,9 @@ extern unsigned long csum_partial_copy_generic(const char *src, const char *dst,
 					       int *src_err_ptr, int *dst_err_ptr);
 
 
-extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, 
+extern unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, 
 				       int len, unsigned int isum, int *errp);
-extern unsigned int csum_partial_copy_to_user(const char *src, char *dst, 
+extern unsigned int csum_partial_copy_to_user(const char *src, char __user *dst, 
 				      int len, unsigned int isum, int *errp);
 extern unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, 
 					      unsigned int sum);
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index c4f520987..c1e04aa5a 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -186,15 +186,15 @@ struct compat_shmid64_ds {
  */
 typedef	u32		compat_uptr_t;
 
-static inline void *compat_ptr(compat_uptr_t uptr)
+static inline void __user *compat_ptr(compat_uptr_t uptr)
 {
-	return (void *)(unsigned long)uptr;
+	return (void __user *)(unsigned long)uptr;
 }
 
-static __inline__ void *compat_alloc_user_space(long len)
+static __inline__ void __user *compat_alloc_user_space(long len)
 {
 	struct pt_regs *regs = (void *)current->thread.rsp0 - sizeof(struct pt_regs); 
-	return (void *)regs->rsp - len; 
+	return (void __user *)regs->rsp - len; 
 }
 
 #endif /* _ASM_X86_64_COMPAT_H */
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h
index 9bb2b94ee..b4543649b 100644
--- a/include/asm-x86_64/desc.h
+++ b/include/asm-x86_64/desc.h
@@ -118,7 +118,6 @@ static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned
 	d.base1 = PTR_MIDDLE(tss) & 0xFF; 
 	d.type = type;
 	d.p = 1; 
-	d.g = 1;
 	d.limit1 = (size >> 16) & 0xF;
 	d.base2 = (PTR_MIDDLE(tss) >> 8) & 0xFF; 
 	d.base3 = PTR_HIGH(tss); 
@@ -135,7 +134,7 @@ static inline void set_tss_desc(unsigned cpu, void *addr)
 static inline void set_ldt_desc(unsigned cpu, void *addr, int size)
 { 
 	set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_LDT], (unsigned long)addr, 
-			      DESC_LDT, size); 
+			      DESC_LDT, size * 8);
 }
 
 static inline void set_seg_base(unsigned cpu, int entry, void *base)
diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h
index 2f2df23b6..bca9b28a1 100644
--- a/include/asm-x86_64/floppy.h
+++ b/include/asm-x86_64/floppy.h
@@ -170,7 +170,7 @@ static unsigned long vdma_mem_alloc(unsigned long size)
 static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
 {
 	if((unsigned long) addr >= (unsigned long) high_memory)
-		return vfree((void *)addr);
+		vfree((void *)addr);
 	else
 		free_pages(addr, get_order(size));		
 }
diff --git a/include/asm-x86_64/fpu32.h b/include/asm-x86_64/fpu32.h
index 244ffe2a0..4153db5c0 100644
--- a/include/asm-x86_64/fpu32.h
+++ b/include/asm-x86_64/fpu32.h
@@ -3,8 +3,8 @@
 
 struct _fpstate_ia32;
 
-int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 *buf, int fsave);
-int save_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 *buf, 
+int restore_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 __user *buf, int fsave);
+int save_i387_ia32(struct task_struct *tsk, struct _fpstate_ia32 __user *buf, 
 		   struct pt_regs *regs, int fsave);
 
 #endif
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h
index bb5edc3cd..10638b850 100644
--- a/include/asm-x86_64/i387.h
+++ b/include/asm-x86_64/i387.h
@@ -23,7 +23,7 @@ extern void fpu_init(void);
 extern unsigned int mxcsr_feature_mask;
 extern void mxcsr_feature_mask_init(void);
 extern void init_fpu(struct task_struct *child);
-extern int save_i387(struct _fpstate *buf);
+extern int save_i387(struct _fpstate __user *buf);
 
 static inline int need_signal_i387(struct task_struct *me) 
 { 
@@ -48,7 +48,7 @@ static inline int need_signal_i387(struct task_struct *me)
 
 #define clear_fpu(tsk) do { \
 	if ((tsk)->thread_info->status & TS_USEDFPU) {		\
-		asm volatile("fwait");				\
+		asm volatile("fnclex ; fwait");			\
 		(tsk)->thread_info->status &= ~TS_USEDFPU;	\
 		stts();						\
 	}							\
@@ -57,10 +57,10 @@ static inline int need_signal_i387(struct task_struct *me)
 /*
  * ptrace request handers...
  */
-extern int get_fpregs(struct user_i387_struct *buf,
+extern int get_fpregs(struct user_i387_struct __user *buf,
 		      struct task_struct *tsk);
 extern int set_fpregs(struct task_struct *tsk,
-		      struct user_i387_struct *buf);
+		      struct user_i387_struct __user *buf);
 
 /*
  * i387 state interaction
@@ -93,7 +93,7 @@ static inline int restore_fpu_checking(struct i387_fxsave_struct *fx)
 	return err;
 } 
 
-static inline int save_i387_checking(struct i387_fxsave_struct *fx) 
+static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) 
 { 
 	int err;
 	asm volatile("1:  rex64 ; fxsave (%[fx])\n\t"
@@ -136,7 +136,7 @@ static inline void save_init_fpu( struct task_struct *tsk )
 /* 
  * This restores directly out of user space. Exceptions are handled.
  */
-static inline int restore_i387(struct _fpstate *buf)
+static inline int restore_i387(struct _fpstate __user *buf)
 {
 	return restore_fpu_checking((struct i387_fxsave_struct *)buf);
 }
diff --git a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
index b29899e3c..a680d0356 100644
--- a/include/asm-x86_64/ia32.h
+++ b/include/asm-x86_64/ia32.h
@@ -168,8 +168,8 @@ struct ustat32 {
 #ifdef __KERNEL__
 struct user_desc;
 struct siginfo_t;
-int do_get_thread_area(struct thread_struct *t, struct user_desc *u_info);
-int do_set_thread_area(struct thread_struct *t, struct user_desc *u_info);
+int do_get_thread_area(struct thread_struct *t, struct user_desc __user *info);
+int do_set_thread_area(struct thread_struct *t, struct user_desc __user *info);
 int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs);
 int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from);
 int ia32_copy_siginfo_to_user(siginfo_t32 __user *to, siginfo_t *from);
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h
index 5facf5648..ff0309c2e 100644
--- a/include/asm-x86_64/ia32_unistd.h
+++ b/include/asm-x86_64/ia32_unistd.h
@@ -288,7 +288,8 @@
 #define __NR_ia32_mq_timedreceive	(__NR_ia32_mq_open+3)
 #define __NR_ia32_mq_notify		(__NR_ia32_mq_open+4)
 #define __NR_ia32_mq_getsetattr	(__NR_ia32_mq_open+5)
+#define __NR_ia32_kexec		283
 
-#define IA32_NR_syscalls 285	/* must be > than biggest syscall! */
+#define IA32_NR_syscalls 287	/* must be > than biggest syscall! */
 
 #endif /* _ASM_X86_64_IA32_UNISTD_H_ */
diff --git a/include/asm-x86_64/ide.h b/include/asm-x86_64/ide.h
index 870bf0e78..4cef0ef61 100644
--- a/include/asm-x86_64/ide.h
+++ b/include/asm-x86_64/ide.h
@@ -1,64 +1 @@
-/*
- *  linux/include/asm-x86_64/ide.h
- *
- *  Copyright (C) 1994-1996  Linus Torvalds & authors
- */
-
-/*
- *  This file contains the x86_64 architecture specific IDE code.
- */
-
-#ifndef __ASMx86_64_IDE_H
-#define __ASMx86_64_IDE_H
-
-#ifdef __KERNEL__
-
-#include <linux/config.h>
-
-#ifndef MAX_HWIFS
-# ifdef CONFIG_BLK_DEV_IDEPCI
-#define MAX_HWIFS	10
-# else
-#define MAX_HWIFS	6
-# endif
-#endif
-
-static __inline__ int ide_default_irq(unsigned long base)
-{
-	switch (base) {
-		case 0x1f0: return 14;
-		case 0x170: return 15;
-		case 0x1e8: return 11;
-		case 0x168: return 10;
-		case 0x1e0: return 8;
-		case 0x160: return 12;
-		default:
-			return 0;
-	}
-}
-
-static __inline__ unsigned long ide_default_io_base(int index)
-{
-	switch (index) {
-		case 0:	return 0x1f0;
-		case 1:	return 0x170;
-		case 2: return 0x1e8;
-		case 3: return 0x168;
-		case 4: return 0x1e0;
-		case 5: return 0x160;
-		default:
-			return 0;
-	}
-}
-
-#ifdef CONFIG_BLK_DEV_IDEPCI
-#define ide_init_default_irq(base)	(0)
-#else
-#define ide_init_default_irq(base)	ide_default_irq(base)
-#endif
-
-#include <asm-generic/ide_iops.h>
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASMx86_64_IDE_H */
+#include <asm-i386/ide.h>
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index b0ce61de4..1ddce4b4a 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -195,8 +195,13 @@ extern void iounmap(void *addr);
 #define __raw_writel writel
 #define __raw_writeq writeq
 
-void *memcpy_fromio(void*,const void*,unsigned); 
-void *memcpy_toio(void*,const void*,unsigned); 
+void *__memcpy_fromio(void*,unsigned long,unsigned);
+void *__memcpy_toio(unsigned long,const void*,unsigned);
+
+#define memcpy_fromio(to,from,len) \
+  __memcpy_fromio((to),(unsigned long)(from),(len))
+#define memcpy_toio(to,from,len) \
+  __memcpy_toio((unsigned long)(to),(from),(len))
 #define memset_io(a,b,c)	memset((void *)(a),(b),(c))
 
 /*
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index abfb086b3..ed94245a5 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -143,8 +143,8 @@ extern inline unsigned int cpuid_edx(unsigned int op)
 #define _EFER_NX 11  /* No execute enable */
 
 #define EFER_SCE (1<<_EFER_SCE)
-#define EFER_LME (1<<EFER_LME)
-#define EFER_LMA (1<<EFER_LMA)
+#define EFER_LME (1<<_EFER_LME)
+#define EFER_LMA (1<<_EFER_LMA)
 #define EFER_NX (1<<_EFER_NX)
 
 /* Intel MSRs. Some also available on other CPUs */
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 8f0b0f3d8..c5c2b01cf 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -65,15 +65,20 @@ extern unsigned long vm_stack_flags, vm_stack_flags32;
 extern unsigned long vm_data_default_flags, vm_data_default_flags32;
 extern unsigned long vm_force_exec32;
 
+#define __START_KERNEL		0xffffffff80100000UL
+#define __START_KERNEL_map	0xffffffff80000000UL
+#define __PAGE_OFFSET           0x0000010000000000UL	/* 1 << 40 */
+
+#else
+#define __START_KERNEL		0xffffffff80100000
+#define __START_KERNEL_map	0xffffffff80000000
+#define __PAGE_OFFSET           0x0000010000000000	/* 1 << 40 */
 #endif /* !__ASSEMBLY__ */
 
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
 
 /* See Documentation/x86_64/mm.txt for a description of the memory map. */
-#define __START_KERNEL		0xffffffff80100000
-#define __START_KERNEL_map	0xffffffff80000000
-#define __PAGE_OFFSET           0x0000010000000000	/* 1 << 40 */
 #define __PHYSICAL_MASK_SHIFT	40
 #define __PHYSICAL_MASK		((1UL << __PHYSICAL_MASK_SHIFT) - 1)
 #define __VIRTUAL_MASK_SHIFT	48
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index d73be9651..415d73f3c 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -39,7 +39,7 @@ extern void setup_per_cpu_areas(void);
 #define DEFINE_PER_CPU(type, name) \
     __typeof__(type) per_cpu__##name
 
-#define per_cpu(var, cpu)			((void)cpu, per_cpu__##var)
+#define per_cpu(var, cpu)			(*((void)cpu, &per_cpu__##var))
 #define __get_cpu_var(var)			per_cpu__##var
 
 #endif	/* SMP */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 82ed27419..37ebbad00 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -124,13 +124,13 @@ static inline void set_pml4(pml4_t *dst, pml4_t val)
 
 
 #ifndef __ASSEMBLY__
-#define VMALLOC_START    0xffffff0000000000
-#define VMALLOC_END      0xffffff7fffffffff
-#define MODULES_VADDR    0xffffffffa0000000
-#define MODULES_END      0xffffffffafffffff
+#define VMALLOC_START    0xffffff0000000000UL
+#define VMALLOC_END      0xffffff7fffffffffUL
+#define MODULES_VADDR    0xffffffffa0000000UL
+#define MODULES_END      0xffffffffafffffffUL
 #define MODULES_LEN   (MODULES_END - MODULES_VADDR)
 
-#define IOMAP_START      0xfffffe8000000000
+#define IOMAP_START      0xfffffe8000000000UL
 
 #define _PAGE_BIT_PRESENT	0
 #define _PAGE_BIT_RW		1
@@ -383,6 +383,20 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 
 #define update_mmu_cache(vma,address,pte) do { } while (0)
 
+/* We only update the dirty/accessed state if we set
+ * the dirty bit by hand in the kernel, since the hardware
+ * will do the accessed bit for us, and we don't want to
+ * race with other CPU's that might be updating the dirty
+ * bit at the same time. */
+#define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+	do {								  \
+		if (__dirty) {						  \
+			set_pte(__ptep, __entry);			  \
+			flush_tlb_page(__vma, __address);		  \
+		}							  \
+	} while (0)
+
 /* Encode and de-code a swap entry */
 #define __swp_type(x)			(((x).val >> 1) & 0x3f)
 #define __swp_offset(x)			((x).val >> 8)
@@ -390,8 +404,6 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 #define __pte_to_swp_entry(pte)		((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)		((pte_t) { (x).val })
 
-typedef pte_t *pte_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 extern int kern_addr_valid(unsigned long addr); 
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index a0ecd64a6..ec696b271 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -44,8 +44,6 @@
 
 /*
  *  CPU type and hardware bug flags. Kept separately for each CPU.
- *  Members of this structure are referenced in head.S, so think twice
- *  before touching them. [mj]
  */
 
 struct cpuinfo_x86 {
@@ -168,7 +166,7 @@ static inline void clear_in_cr4 (unsigned long mask)
 /*
  * User space process size: 512GB - 1GB (default).
  */
-#define TASK_SIZE	(0x0000007fc0000000)
+#define TASK_SIZE	(0x0000007fc0000000UL)
 
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.
@@ -229,6 +227,8 @@ struct tss_struct {
 	unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
 } __attribute__((packed)) ____cacheline_aligned;
 
+#define ARCH_MIN_TASKALIGN	16
+
 struct thread_struct {
 	unsigned long	rsp0;
 	unsigned long	rsp;
@@ -246,14 +246,14 @@ struct thread_struct {
 /* fault info */
 	unsigned long	cr2, trap_no, error_code;
 /* floating point info */
-	union i387_union	i387;
+	union i387_union	i387  __attribute__((aligned(16)));
 /* IO permissions. the bitmap could be moved into the GDT, that would make
    switch faster for a limited number of ioperm using tasks. -AK */
 	int		ioperm;
 	unsigned long	*io_bitmap_ptr;
 /* cached TLS descriptors. */
 	u64 tls_array[GDT_ENTRY_TLS_ENTRIES];
-};
+} __attribute__((aligned(16)));
 
 #define INIT_THREAD  {}
 
@@ -456,4 +456,9 @@ static inline void __mwait(unsigned long eax, unsigned long ecx)
 
 #define cache_line_size() (boot_cpu_data.x86_cache_alignment)
 
+#ifdef CONFIG_SCHED_SMT
+#define ARCH_HAS_SCHED_DOMAIN
+#define ARCH_HAS_SCHED_WAKE_IDLE
+#endif
+
 #endif /* __ASM_X86_64_PROCESSOR_H */
diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
index 3c5c3a4fc..cbc19a778 100644
--- a/include/asm-x86_64/ptrace.h
+++ b/include/asm-x86_64/ptrace.h
@@ -83,7 +83,7 @@ struct pt_regs {
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__) 
 #define user_mode(regs) (!!((regs)->cs & 3))
 #define instruction_pointer(regs) ((regs)->rip)
-void signal_fault(struct pt_regs *regs, void *frame, char *where);
+void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
 
 enum {
         EF_CF   = 0x00000001,
diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86_64/semaphore.h
index 5fe25482f..278883422 100644
--- a/include/asm-x86_64/semaphore.h
+++ b/include/asm-x86_64/semaphore.h
@@ -47,12 +47,12 @@ struct semaphore {
 	atomic_t count;
 	int sleepers;
 	wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	long __magic;
 #endif
 };
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 # define __SEM_DEBUG_INIT(name) \
 		, (int)&(name).__magic
 #else
@@ -83,7 +83,7 @@ static inline void sema_init (struct semaphore *sem, int val)
 	atomic_set(&sem->count, val);
 	sem->sleepers = 0;
 	init_waitqueue_head(&sem->wait);
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	sem->__magic = (int)&sem->__magic;
 #endif
 }
@@ -115,7 +115,7 @@ asmlinkage void __up(struct semaphore * sem);
  */
 static inline void down(struct semaphore * sem)
 {
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
@@ -142,7 +142,7 @@ static inline int down_interruptible(struct semaphore * sem)
 {
 	int result;
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
@@ -171,7 +171,7 @@ static inline int down_trylock(struct semaphore * sem)
 {
 	int result;
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
@@ -199,7 +199,7 @@ static inline int down_trylock(struct semaphore * sem)
  */
 static inline void up(struct semaphore * sem)
 {
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	__asm__ __volatile__(
diff --git a/include/asm-x86_64/sigcontext.h b/include/asm-x86_64/sigcontext.h
index 6a624087d..b4e402366 100644
--- a/include/asm-x86_64/sigcontext.h
+++ b/include/asm-x86_64/sigcontext.h
@@ -2,6 +2,7 @@
 #define _ASM_X86_64_SIGCONTEXT_H
 
 #include <asm/types.h>
+#include <linux/compiler.h>
 
 /* FXSAVE frame */
 /* Note: reserved1/2 may someday contain valuable data. Always save/restore
@@ -47,7 +48,7 @@ struct sigcontext {
 	unsigned long trapno;
 	unsigned long oldmask;
 	unsigned long cr2;
-	struct _fpstate *fpstate;	/* zero when no FPU context */
+	struct _fpstate __user *fpstate;	/* zero when no FPU context */
 	unsigned long reserved1[8];
 };
 
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index e82b6a988..2878896de 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -47,7 +47,7 @@ extern void smp_invalidate_rcv(void);		/* Process an NMI */
 extern void (*mtrr_hook) (void);
 extern void zap_low_mappings(void);
 void smp_stop_cpu(void);
-extern char cpu_sibling_map[];
+extern cpumask_t cpu_sibling_map[NR_CPUS];
 extern char phys_proc_id[NR_CPUS];
 
 #define SMP_TRAMPOLINE_BASE 0x6000
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index c341097c7..3177138f9 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -41,6 +41,7 @@ typedef struct {
 
 #define spin_is_locked(x)	(*(volatile signed char *)(&(x)->lock) <= 0)
 #define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 #define spin_lock_string \
 	"\n1:\t" \
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
index ad1d3d73f..895294a7c 100644
--- a/include/asm-x86_64/timex.h
+++ b/include/asm-x86_64/timex.h
@@ -7,11 +7,12 @@
 #define _ASMx8664_TIMEX_H
 
 #include <linux/config.h>
+#include <asm/8253pit.h>
 #include <asm/msr.h>
 #include <asm/vsyscall.h>
 #include <asm/hpet.h>
 
-#define CLOCK_TICK_RATE	1193182 /* Underlying HZ */
+#define CLOCK_TICK_RATE	PIT_TICK_RATE	/* Underlying HZ */
 #define CLOCK_TICK_FACTOR	20	/* Factor of both 1000000 and CLOCK_TICK_RATE */
 #define FINETUNE ((((((int)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
 	(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
diff --git a/include/asm-x86_64/types.h b/include/asm-x86_64/types.h
index c86c2e679..32bd1426b 100644
--- a/include/asm-x86_64/types.h
+++ b/include/asm-x86_64/types.h
@@ -51,6 +51,8 @@ typedef u64 dma_addr_t;
 typedef u64 sector_t;
 #define HAVE_SECTOR_T
 
+typedef unsigned short kmem_bufctl_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 9b4c018aa..779c74260 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -24,7 +24,7 @@
 
 #define MAKE_MM_SEG(s)	((mm_segment_t) { (s) })
 
-#define KERNEL_DS	MAKE_MM_SEG(0xFFFFFFFFFFFFFFFF)
+#define KERNEL_DS	MAKE_MM_SEG(0xFFFFFFFFFFFFFFFFUL)
 #define USER_DS		MAKE_MM_SEG(PAGE_OFFSET)
 
 #define get_ds()	(KERNEL_DS)
@@ -33,6 +33,16 @@
 
 #define segment_eq(a,b)	((a).seg == (b).seg)
 
+#ifdef __CHECKER__
+#define CHECK_UPTR(ptr) do {				\
+	__typeof__(*(ptr)) *__dummy_check_uptr =	\
+		(void __user *)&__dummy_check_uptr;	\
+} while(0)
+#else
+#define CHECK_UPTR(ptr)
+#endif
+
+
 #define __addr_ok(addr) (!((unsigned long)(addr) & (current_thread_info()->addr_limit.seg)))
 
 /*
@@ -40,15 +50,16 @@
  */
 #define __range_not_ok(addr,size) ({ \
 	unsigned long flag,sum; \
+	CHECK_UPTR(addr);	\
 	asm("# range_ok\n\r" \
 		"addq %3,%1 ; sbbq %0,%0 ; cmpq %1,%4 ; sbbq $0,%0"  \
 		:"=&r" (flag), "=r" (sum) \
 		:"1" (addr),"g" ((long)(size)),"g" (current_thread_info()->addr_limit.seg)); \
 	flag; })
 
-#define access_ok(type,addr,size) (__range_not_ok(addr,size) == 0)
+#define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0)
 
-extern inline int verify_area(int type, const void * addr, unsigned long size)
+extern inline int verify_area(int type, const void __user * addr, unsigned long size)
 {
 	return access_ok(type,addr,size) ? 0 : -EFAULT;
 }
@@ -103,6 +114,7 @@ extern void __get_user_8(void);
 #define get_user(x,ptr)							\
 ({	long __val_gu;							\
 	int __ret_gu; 							\
+	CHECK_UPTR(ptr);						\
 	switch(sizeof (*(ptr))) {					\
 	case 1:  __get_user_x(1,__ret_gu,__val_gu,ptr); break;		\
 	case 2:  __get_user_x(2,__ret_gu,__val_gu,ptr); break;		\
@@ -138,6 +150,7 @@ extern void __put_user_bad(void);
 #define __put_user_nocheck(x,ptr,size)			\
 ({							\
 	int __pu_err;					\
+	CHECK_UPTR(ptr);				\
 	__put_user_size((x),(ptr),(size),__pu_err);	\
 	__pu_err;					\
 })
@@ -193,6 +206,7 @@ struct __large_struct { unsigned long buf[100]; };
 ({								\
 	int __gu_err;						\
 	long __gu_val;						\
+	CHECK_UPTR(ptr);					\
 	__get_user_size(__gu_val,(ptr),(size),__gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;			\
 	__gu_err;						\
@@ -235,15 +249,15 @@ do {									\
 /* Handles exceptions in both to and from, but doesn't do access_ok */
 extern unsigned long copy_user_generic(void *to, const void *from, unsigned len); 
 
-extern unsigned long copy_to_user(void *to, const void *from, unsigned len); 
-extern unsigned long copy_from_user(void *to, const void *from, unsigned len); 
-extern unsigned long copy_in_user(void *to, const void *from, unsigned len); 
+extern unsigned long copy_to_user(void __user *to, const void *from, unsigned len); 
+extern unsigned long copy_from_user(void *to, const void __user *from, unsigned len); 
+extern unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len); 
 
-static inline int __copy_from_user(void *dst, const void *src, unsigned size) 
+static inline int __copy_from_user(void *dst, const void __user *src, unsigned size) 
 { 
        int ret = 0;
 	if (!__builtin_constant_p(size))
-		return copy_user_generic(dst,src,size);
+		return copy_user_generic(dst,(void *)src,size);
 	switch (size) { 
 	case 1:__get_user_asm(*(u8*)dst,(u8 *)src,ret,"b","b","=q",1); 
 		return ret;
@@ -264,15 +278,15 @@ static inline int __copy_from_user(void *dst, const void *src, unsigned size)
 		__get_user_asm(*(u64*)(8+(char*)dst),(u64*)(8+(char*)src),ret,"q","","=r",8);
 		return ret; 
 	default:
-		return copy_user_generic(dst,src,size); 
+		return copy_user_generic(dst,(void *)src,size); 
 	}
 }	
 
-static inline int __copy_to_user(void *dst, const void *src, unsigned size) 
+static inline int __copy_to_user(void __user *dst, const void *src, unsigned size) 
 { 
        int ret = 0;
 	if (!__builtin_constant_p(size))
-		return copy_user_generic(dst,src,size);
+		return copy_user_generic((void *)dst,src,size);
 	switch (size) { 
 	case 1:__put_user_asm(*(u8*)src,(u8 *)dst,ret,"b","b","iq",1); 
 		return ret;
@@ -295,16 +309,16 @@ static inline int __copy_to_user(void *dst, const void *src, unsigned size)
 		__put_user_asm(1[(u64*)src],1+(u64*)dst,ret,"q","","ir",8);
 		return ret; 
 	default:
-		return copy_user_generic(dst,src,size); 
+		return copy_user_generic((void *)dst,src,size); 
 	}
 }	
 
 
-static inline int __copy_in_user(void *dst, const void *src, unsigned size) 
+static inline int __copy_in_user(void __user *dst, const void __user *src, unsigned size) 
 { 
        int ret = 0;
 	if (!__builtin_constant_p(size))
-		return copy_user_generic(dst,src,size);
+		return copy_user_generic((void *)dst,(void *)src,size);
 	switch (size) { 
 	case 1: { 
 		u8 tmp;
@@ -336,15 +350,15 @@ static inline int __copy_in_user(void *dst, const void *src, unsigned size)
 		return ret;
 	}
 	default:
-		return copy_user_generic(dst,src,size); 
+		return copy_user_generic((void *)dst,(void *)src,size); 
 	}
 }	
 
-long strncpy_from_user(char *dst, const char *src, long count);
-long __strncpy_from_user(char *dst, const char *src, long count);
-long strnlen_user(const char *str, long n);
-long strlen_user(const char *str);
-unsigned long clear_user(void *mem, unsigned long len);
-unsigned long __clear_user(void *mem, unsigned long len);
+long strncpy_from_user(char *dst, const char __user *src, long count);
+long __strncpy_from_user(char *dst, const char __user *src, long count);
+long strnlen_user(const char __user *str, long n);
+long strlen_user(const char __user *str);
+unsigned long clear_user(void __user *mem, unsigned long len);
+unsigned long __clear_user(void __user *mem, unsigned long len);
 
 #endif /* __X86_64_UACCESS_H */
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index ac5e67e23..26e0aa30b 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -98,7 +98,7 @@ __SYSCALL(__NR_setitimer, sys_setitimer)
 __SYSCALL(__NR_getpid, sys_getpid)
 
 #define __NR_sendfile                           40
-__SYSCALL(__NR_sendfile, sys_sendfile)
+__SYSCALL(__NR_sendfile, sys_sendfile64)
 #define __NR_socket                             41
 __SYSCALL(__NR_socket, sys_socket)
 #define __NR_connect                            42
@@ -534,26 +534,28 @@ __SYSCALL(__NR_utimes, sys_utimes)
 __SYSCALL(__NR_vserver, sys_ni_syscall)
 #define __NR_vserver		236
 __SYSCALL(__NR_vserver, sys_ni_syscall)
-#define __NR_mbind 			237
-__SYSCALL(__NR_mbind, sys_ni_syscall)
+#define __NR_mbind 		237
+__SYSCALL(__NR_mbind, sys_mbind)
 #define __NR_set_mempolicy 	238
-__SYSCALL(__NR_set_mempolicy, sys_ni_syscall)
+__SYSCALL(__NR_set_mempolicy, sys_set_mempolicy)
 #define __NR_get_mempolicy 	239
-__SYSCALL(__NR_get_mempolicy, sys_ni_syscall)
+__SYSCALL(__NR_get_mempolicy, sys_get_mempolicy)
 #define __NR_mq_open 		240
 __SYSCALL(__NR_mq_open, sys_mq_open)
 #define __NR_mq_unlink 		241
 __SYSCALL(__NR_mq_unlink, sys_mq_unlink)
 #define __NR_mq_timedsend 	242
 __SYSCALL(__NR_mq_timedsend, sys_mq_timedsend)
-#define __NR_mq_timedreceive 243
+#define __NR_mq_timedreceive	243
 __SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive)
 #define __NR_mq_notify 		244
 __SYSCALL(__NR_mq_notify, sys_mq_notify)
 #define __NR_mq_getsetattr 	245
 __SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr)
+#define __NR_kexec_load 	246
+__SYSCALL(__NR_kexec_load, sys_ni_syscall)
 
-#define __NR_syscall_max __NR_mq_getsetattr
+#define __NR_syscall_max __NR_kexec_load
 #ifndef __NO_STUBS
 
 /* user-visible error numbers are in the range -1 - -4095 */
@@ -569,6 +571,29 @@ do { \
 	return (type) (res); \
 } while (0)
 
+#ifdef __KERNEL__
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_OLD_STAT
+#define __ARCH_WANT_SYS_ALARM
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_PAUSE
+#define __ARCH_WANT_SYS_SGETMASK
+#define __ARCH_WANT_SYS_SIGNAL
+#define __ARCH_WANT_SYS_TIME
+#define __ARCH_WANT_SYS_UTIME
+#define __ARCH_WANT_SYS_WAITPID
+#define __ARCH_WANT_SYS_SOCKETCALL
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_LLSEEK
+#define __ARCH_WANT_SYS_NICE
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+#define __ARCH_WANT_SYS_SIGPROCMASK
+#define __ARCH_WANT_SYS_RT_SIGACTION
+#endif
+
 #ifndef __KERNEL_SYSCALLS__
 
 #define __syscall "syscall"
@@ -731,7 +756,7 @@ asmlinkage long sys_pipe(int *fildes);
 
 #endif /* __KERNEL_SYSCALLS__ */
 
-#ifndef __ASSEMBLY__
+#if !defined(__ASSEMBLY__) && defined(__KERNEL__)
 
 #include <linux/linkage.h>
 #include <linux/compiler.h>
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 36a2f3eb9..d56069ba4 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -374,7 +374,7 @@ typedef int (*acpi_table_handler) (unsigned long phys_addr, unsigned long size);
 
 extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
 
-typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header);
+typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const unsigned long end);
 
 char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
 unsigned long acpi_find_rsdp (void);
diff --git a/include/linux/aio.h b/include/linux/aio.h
index b03ebead2..93fe78800 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -59,7 +59,10 @@ struct kiocb {
 	struct list_head	ki_list;	/* the aio core uses this
 						 * for cancellation */
 
-	void __user		*ki_user_obj;	/* pointer to userland's iocb */
+	union {
+		void __user		*user;
+		struct task_struct	*tsk;
+	} ki_obj;
 	__u64			ki_user_data;	/* user's data for completion */
 	loff_t			ki_pos;
 
@@ -76,7 +79,7 @@ struct kiocb {
 		(x)->ki_filp = (filp);			\
 		(x)->ki_ctx = &tsk->active_mm->default_kioctx;	\
 		(x)->ki_cancel = NULL;			\
-		(x)->ki_user_obj = tsk;			\
+		(x)->ki_obj.tsk = tsk;			\
 	} while (0)
 
 #define AIO_RING_MAGIC			0xa10a10a1
@@ -149,11 +152,11 @@ struct mm_struct;
 extern void FASTCALL(exit_aio(struct mm_struct *mm));
 extern struct kioctx *lookup_ioctx(unsigned long ctx_id);
 extern int FASTCALL(io_submit_one(struct kioctx *ctx,
-			struct iocb *user_iocb, struct iocb *iocb));
+			struct iocb __user *user_iocb, struct iocb *iocb));
 
 /* semi private, but used by the 32bit emulations: */
 struct kioctx *lookup_ioctx(unsigned long ctx_id);
-int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb *user_iocb,
+int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 				  struct iocb *iocb));
 
 #define get_ioctx(kioctx)	do { if (unlikely(atomic_read(&(kioctx)->users) <= 0)) BUG(); atomic_inc(&(kioctx)->users); } while (0)
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 33074a08f..38ccb84c0 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -38,6 +38,7 @@ enum {
 
 	ATA_ID_WORDS		= 256,
 	ATA_ID_PROD_OFS		= 27,
+	ATA_ID_FW_REV_OFS	= 23,
 	ATA_ID_SERNO_OFS	= 10,
 	ATA_ID_MAJOR_VER	= 80,
 	ATA_ID_PIO_MODES	= 64,
@@ -103,7 +104,10 @@ enum {
 	ATA_REG_IRQ		= ATA_REG_NSECT,
 
 	/* ATA device commands */
+	ATA_CMD_CHK_POWER	= 0xE5, /* check power mode */
 	ATA_CMD_EDD		= 0x90,	/* execute device diagnostic */
+	ATA_CMD_FLUSH		= 0xE7,
+	ATA_CMD_FLUSH_EXT	= 0xEA,
 	ATA_CMD_ID_ATA		= 0xEC,
 	ATA_CMD_ID_ATAPI	= 0xA1,
 	ATA_CMD_READ		= 0xC8,
@@ -132,6 +136,8 @@ enum {
 
 	/* ATAPI stuff */
 	ATAPI_PKT_DMA		= (1 << 0),
+	ATAPI_DMADIR		= (1 << 2),	/* ATAPI data dir:
+						   0=to device, 1=to host */
 
 	/* cable types */
 	ATA_CBL_NONE		= 0,
@@ -196,9 +202,14 @@ struct ata_taskfile {
 };
 
 #define ata_id_is_ata(dev)	(((dev)->id[0] & (1 << 15)) == 0)
+#define ata_id_rahead_enabled(dev) ((dev)->id[85] & (1 << 6))
+#define ata_id_wcache_enabled(dev) ((dev)->id[85] & (1 << 5))
 #define ata_id_has_lba48(dev)	((dev)->id[83] & (1 << 10))
+#define ata_id_has_wcache(dev)	((dev)->id[82] & (1 << 5))
+#define ata_id_has_pm(dev)	((dev)->id[82] & (1 << 3))
 #define ata_id_has_lba(dev)	((dev)->id[49] & (1 << 8))
 #define ata_id_has_dma(dev)	((dev)->id[49] & (1 << 9))
+#define ata_id_removeable(dev)	((dev)->id[0] & (1 << 7))
 #define ata_id_u32(dev,n)	\
 	(((u32) (dev)->id[(n) + 1] << 16) | ((u32) (dev)->id[(n)]))
 #define ata_id_u64(dev,n)	\
@@ -207,4 +218,10 @@ struct ata_taskfile {
 	  ((u64) dev->id[(n) + 1] << 16) |	\
 	  ((u64) dev->id[(n) + 0]) )
 
+static inline int is_atapi_taskfile(struct ata_taskfile *tf)
+{
+	return (tf->protocol == ATA_PROT_ATAPI) ||
+	       (tf->protocol == ATA_PROT_ATAPI_DMA);
+}
+
 #endif /* __LINUX_ATA_H__ */
diff --git a/include/linux/atm.h b/include/linux/atm.h
index 0380156f9..04e917069 100644
--- a/include/linux/atm.h
+++ b/include/linux/atm.h
@@ -232,7 +232,7 @@ static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr)
 struct atmif_sioc {
     int number;
     int length;
-    void *arg;
+    void __user *arg;
 };
 
 typedef unsigned short atm_backend_t;
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 9242c9c31..b19303d3f 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -351,11 +351,11 @@ struct atmdev_ops { /* only send is required */
 	void (*dev_close)(struct atm_dev *dev);
 	int (*open)(struct atm_vcc *vcc);
 	void (*close)(struct atm_vcc *vcc);
-	int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
+	int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void __user *arg);
 	int (*getsockopt)(struct atm_vcc *vcc,int level,int optname,
-	    void *optval,int optlen);
+	    void __user *optval,int optlen);
 	int (*setsockopt)(struct atm_vcc *vcc,int level,int optname,
-	    void *optval,int optlen);
+	    void __user *optval,int optlen);
 	int (*send)(struct atm_vcc *vcc,struct sk_buff *skb);
 	int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags);
 	void (*phy_put)(struct atm_dev *dev,unsigned char value,
@@ -368,7 +368,7 @@ struct atmdev_ops { /* only send is required */
 
 struct atmphy_ops {
 	int (*start)(struct atm_dev *dev);
-	int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
+	int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void __user *arg);
 	void (*interrupt)(struct atm_dev *dev);
 	int (*stop)(struct atm_dev *dev);
 };
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
index 99aa24761..d1c7b0ec7 100644
--- a/include/linux/auto_fs4.h
+++ b/include/linux/auto_fs4.h
@@ -23,6 +23,12 @@
 #define AUTOFS_MIN_PROTO_VERSION	3
 #define AUTOFS_MAX_PROTO_VERSION	4
 
+#define AUTOFS_PROTO_SUBVERSION         5
+
+/* Mask for expire behaviour */
+#define AUTOFS_EXP_IMMEDIATE		1
+#define AUTOFS_EXP_LEAVES		2
+
 /* New message type */
 #define autofs_ptype_expire_multi	2	/* Expire entry (umount request) */
 
@@ -41,7 +47,11 @@ union autofs_packet_union {
 	struct autofs_packet_expire_multi expire_multi;
 };
 
-#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
+#define AUTOFS_IOC_EXPIRE_MULTI		_IOW(0x93,0x66,int)
+#define AUTOFS_IOC_PROTOSUBVER		_IOR(0x93,0x67,int)
+#define AUTOFS_IOC_ASKREGHOST           _IOR(0x93,0x68,int)
+#define AUTOFS_IOC_TOGGLEREGHOST        _IOR(0x93,0x69,int)
+#define AUTOFS_IOC_ASKUMOUNT		_IOR(0x93,0x70,int)
 
 
 #endif /* _LINUX_AUTO_FS4_H */
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 003717349..3c369c655 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -28,12 +28,12 @@ struct backing_dev_info {
 	int memory_backed;	/* Cannot clean pages with writepage */
 	congested_fn *congested_fn; /* Function pointer if device is md/dm */
 	void *congested_data;	/* Pointer to aux data for congested func */
-	void (*unplug_io_fn)(struct backing_dev_info *);
+	void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
 	void *unplug_io_data;
 };
 
 extern struct backing_dev_info default_backing_dev_info;
-void default_unplug_io_fn(struct backing_dev_info *bdi);
+void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page);
 
 int writeback_acquire(struct backing_dev_info *bdi);
 int writeback_in_progress(struct backing_dev_info *bdi);
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 81e73cdc1..c301d121c 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -29,7 +29,8 @@ static inline void bitmap_fill(unsigned long *bitmap, int bits)
 static inline void bitmap_copy(unsigned long *dst,
 			const unsigned long *src, int bits)
 {
-	memcpy(dst, src, BITS_TO_LONGS(bits)*sizeof(unsigned long));
+	int len = BITS_TO_LONGS(bits)*sizeof(unsigned long);
+	memcpy(dst, src, len);
 }
 
 void bitmap_shift_right(unsigned long *dst,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0fa0011d0..fae1c4dca 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -334,6 +334,8 @@ struct request_queue
 	 * queue settings
 	 */
 	unsigned long		nr_requests;	/* Max # of requests */
+	unsigned int		nr_congestion_on;
+	unsigned int		nr_congestion_off;
 
 	unsigned short		max_sectors;
 	unsigned short		max_phys_segments;
@@ -515,7 +517,7 @@ extern int blk_remove_plug(request_queue_t *);
 extern void blk_recount_segments(request_queue_t *, struct bio *);
 extern int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *);
 extern int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *);
-extern int scsi_cmd_ioctl(struct gendisk *, unsigned int, unsigned long);
+extern int scsi_cmd_ioctl(struct gendisk *, unsigned int, void __user *);
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void __blk_stop_queue(request_queue_t *q);
@@ -530,16 +532,17 @@ static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
 	return bdev->bd_disk->queue;
 }
 
-static inline void blk_run_backing_dev(struct backing_dev_info *bdi)
+static inline void blk_run_backing_dev(struct backing_dev_info *bdi,
+				       struct page *page)
 {
 	if (bdi && bdi->unplug_io_fn)
-		bdi->unplug_io_fn(bdi);
+		bdi->unplug_io_fn(bdi, page);
 }
 
 static inline void blk_run_address_space(struct address_space *mapping)
 {
 	if (mapping)
-		blk_run_backing_dev(mapping->backing_dev_info);
+		blk_run_backing_dev(mapping->backing_dev_info, NULL);
 }
 
 /*
diff --git a/include/linux/blkpg.h b/include/linux/blkpg.h
index 15b61f7bf..be5d0f4ad 100644
--- a/include/linux/blkpg.h
+++ b/include/linux/blkpg.h
@@ -33,7 +33,7 @@ struct blkpg_ioctl_arg {
         int op;
         int flags;
         int datalen;
-        void *data;
+        void __user *data;
 };
 
 /* The subfunctions (for the op field) */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 99cb41393..6d70bd539 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -170,6 +170,7 @@ struct buffer_head *__bread(struct block_device *, sector_t block, int size);
 struct buffer_head *alloc_buffer_head(int gfp_flags);
 void free_buffer_head(struct buffer_head * bh);
 void FASTCALL(unlock_buffer(struct buffer_head *bh));
+void FASTCALL(__lock_buffer(struct buffer_head *bh));
 void ll_rw_block(int, int, struct buffer_head * bh[]);
 void sync_dirty_buffer(struct buffer_head *bh);
 void submit_bh(int, struct buffer_head *);
@@ -279,8 +280,8 @@ static inline void wait_on_buffer(struct buffer_head *bh)
 
 static inline void lock_buffer(struct buffer_head *bh)
 {
-	while (test_set_buffer_locked(bh))
-		__wait_on_buffer(bh);
+	if (test_set_buffer_locked(bh))
+		__lock_buffer(bh);
 }
 
 #endif /* _LINUX_BUFFER_HEAD_H */
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index a00a63e58..22b342ef9 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -167,7 +167,7 @@ typedef struct _IOCTL_Command_struct {
   RequestBlock_struct      Request;
   ErrorInfo_struct  	   error_info; 
   WORD			   buf_size;  /* size in bytes of the buf */
-  BYTE			   *buf;
+  BYTE			   __user *buf;
 } IOCTL_Command_struct;
 
 typedef struct _BIG_IOCTL_Command_struct {
@@ -177,7 +177,7 @@ typedef struct _BIG_IOCTL_Command_struct {
   DWORD			   malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
   DWORD			   buf_size;    /* size in bytes of the buf */
   				        /* < malloc_size * MAXSGENTRIES */
-  BYTE			   *buf;
+  BYTE			   __user *buf;
 } BIG_IOCTL_Command_struct;
 
 typedef struct _LogvolInfo_struct{
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index 8fcf9bc9c..282e9b793 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -237,9 +237,9 @@ struct cdrom_read
 struct cdrom_read_audio
 {
 	union cdrom_addr addr; /* frame address */
-	__u8 addr_format;    /* CDROM_LBA or CDROM_MSF */
+	__u8 addr_format;      /* CDROM_LBA or CDROM_MSF */
 	int nframes;           /* number of 2352-byte-frames to read at once */
-	__u8 *buf;           /* frame buffer (size: nframes*2352 bytes) */
+	__u8 __user *buf;      /* frame buffer (size: nframes*2352 bytes) */
 };
 
 /* This struct is used with the CDROMMULTISESSION ioctl */
@@ -280,17 +280,16 @@ struct cdrom_blk
 struct cdrom_generic_command
 {
 	unsigned char 		cmd[CDROM_PACKET_SIZE];
-	unsigned char 		*buffer;
+	unsigned char		__user *buffer;
 	unsigned int 		buflen;
 	int			stat;
-	struct request_sense	*sense;
+	struct request_sense	__user *sense;
 	unsigned char		data_direction;
 	int			quiet;
 	int			timeout;
-	void			*reserved[1];
+	void			__user *reserved[1];	/* unused, actually */
 };
 
-
 /*
  * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, 
  * 2340, or 2352 bytes long.  
@@ -907,6 +906,19 @@ struct mode_page_header {
 #include <linux/fs.h>		/* not really needed, later.. */
 #include <linux/device.h>
 
+struct packet_command
+{
+	unsigned char 		cmd[CDROM_PACKET_SIZE];
+	unsigned char 		*buffer;
+	unsigned int 		buflen;
+	int			stat;
+	struct request_sense	*sense;
+	unsigned char		data_direction;
+	int			quiet;
+	int			timeout;
+	void			*reserved[1];
+};
+
 /*
  * _OLD will use PIO transfer on atapi devices, _BPC_* will use DMA
  */
@@ -965,7 +977,7 @@ struct cdrom_device_ops {
 	int n_minors;           /* number of active minor devices */
 	/* handle uniform packets for scsi type devices (scsi,atapi) */
 	int (*generic_packet) (struct cdrom_device_info *,
-			       struct cdrom_generic_command *);
+			       struct packet_command *);
 };
 
 /* the general block_device operations structure: */
@@ -990,11 +1002,11 @@ typedef struct {
 extern int cdrom_get_last_written(struct cdrom_device_info *cdi, long *last_written);
 extern int cdrom_number_of_slots(struct cdrom_device_info *cdi);
 extern int cdrom_mode_select(struct cdrom_device_info *cdi,
-			     struct cdrom_generic_command *cgc);
+			     struct packet_command *cgc);
 extern int cdrom_mode_sense(struct cdrom_device_info *cdi,
-			    struct cdrom_generic_command *cgc,
+			    struct packet_command *cgc,
 			    int page_code, int page_control);
-extern void init_cdrom_command(struct cdrom_generic_command *cgc,
+extern void init_cdrom_command(struct packet_command *cgc,
 			       void *buffer, int len, int type);
 
 /* The SCSI spec says there could be 256 slots. */
diff --git a/include/linux/coda.h b/include/linux/coda.h
index 3743f5ef7..eb921d6de 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -759,13 +759,14 @@ union coda_downcalls {
 
 #define PIOCPARM_MASK 0x0000ffff
 struct ViceIoctl {
-        caddr_t in, out;        /* Data to be transferred in, or out */
+        void __user *in;        /* Data to be transferred in */
+        void __user *out;       /* Data to be transferred out */
         short in_size;          /* Size of input buffer <= 2K */
         short out_size;         /* Maximum size of output buffer, <= 2K */
 };
 
 struct PioctlData {
-        const char *path;
+        const char __user *path;
         int follow;
         struct ViceIoctl vi;
 };
diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h
index 26faac1d9..5bf752163 100644
--- a/include/linux/coda_proc.h
+++ b/include/linux/coda_proc.h
@@ -82,9 +82,9 @@ void reset_coda_cache_inv_stats( void );
  * data structure for /proc/sys/... files 
  */
 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-			     void * buffer, size_t * lenp );
+			     void __user * buffer, size_t * lenp );
 int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
-				   struct file * filp, void * buffer, 
+				   struct file * filp, void __user * buffer, 
 				   size_t * lenp );
 
 /* these functions are called to form the content of /proc/fs/coda/... files */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 796204f59..e45c0f905 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -46,9 +46,9 @@ typedef struct {
 	compat_sigset_word	sig[_COMPAT_NSIG_WORDS];
 } compat_sigset_t;
 
-extern int cp_compat_stat(struct kstat *, struct compat_stat *);
-extern int get_compat_timespec(struct timespec *, const struct compat_timespec *);
-extern int put_compat_timespec(const struct timespec *, struct compat_timespec *);
+extern int cp_compat_stat(struct kstat *, struct compat_stat __user *);
+extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *);
+extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *);
 
 struct compat_iovec {
 	compat_uptr_t	iov_base;
@@ -117,5 +117,18 @@ long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
 long compat_sys_shmctl(int first, int second, void __user *uptr);
 long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
 		unsigned nsems, const struct compat_timespec __user *timeout);
+
+asmlinkage ssize_t compat_sys_readv(unsigned long fd,
+		const struct compat_iovec __user *vec, unsigned long vlen);
+asmlinkage ssize_t compat_sys_writev(unsigned long fd,
+		const struct compat_iovec __user *vec, unsigned long vlen);
+
+int compat_do_execve(char * filename, compat_uptr_t __user *argv,
+	        compat_uptr_t __user *envp, struct pt_regs * regs);
+
+asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
+		compat_ulong_t __user *outp, compat_ulong_t __user *exp,
+		struct compat_timeval __user *tvp);
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 72787d3af..356590d44 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -125,6 +125,7 @@ COMPATIBLE_IOCTL(STOP_ARRAY_RO)
 COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
 /* DM */
 COMPATIBLE_IOCTL(DM_VERSION_32)
+COMPATIBLE_IOCTL(DM_REMOVE_ALL_32)
 COMPATIBLE_IOCTL(DM_LIST_DEVICES_32)
 COMPATIBLE_IOCTL(DM_DEV_CREATE_32)
 COMPATIBLE_IOCTL(DM_DEV_REMOVE_32)
@@ -138,6 +139,7 @@ COMPATIBLE_IOCTL(DM_TABLE_DEPS_32)
 COMPATIBLE_IOCTL(DM_TABLE_STATUS_32)
 COMPATIBLE_IOCTL(DM_LIST_VERSIONS_32)
 COMPATIBLE_IOCTL(DM_VERSION)
+COMPATIBLE_IOCTL(DM_REMOVE_ALL)
 COMPATIBLE_IOCTL(DM_LIST_DEVICES)
 COMPATIBLE_IOCTL(DM_DEV_CREATE)
 COMPATIBLE_IOCTL(DM_DEV_REMOVE)
@@ -275,6 +277,8 @@ COMPATIBLE_IOCTL(SIOCGMIIREG)
 COMPATIBLE_IOCTL(SIOCSMIIREG)
 COMPATIBLE_IOCTL(SIOCGIFVLAN)
 COMPATIBLE_IOCTL(SIOCSIFVLAN)
+COMPATIBLE_IOCTL(SIOCBRADDBR)
+COMPATIBLE_IOCTL(SIOCBRDELBR)
 /* SG stuff */
 COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
 COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
@@ -546,6 +550,10 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
 COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
+COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
+COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST)
+COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST)
+COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
 /* DEVFS */
 COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
 COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index e5e72dad4..151ab34a5 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -5,10 +5,14 @@
 # define __user		__attribute__((noderef, address_space(1)))
 # define __kernel	/* default address space */
 # define __safe		__attribute__((safe))
+# define __force	__attribute__((force))
+extern void __chk_user_ptr(void __user *);
 #else
 # define __user
 # define __kernel
 # define __safe
+# define __force
+# define __chk_user_ptr(x) (void)0
 #endif
 
 #ifdef __KERNEL__
diff --git a/include/linux/console.h b/include/linux/console.h
index 2092454b2..c8a8fe4f2 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -19,6 +19,7 @@
 
 struct vc_data;
 struct console_font_op;
+struct module;
 
 /*
  * this is what the terminal answers to a ESC-Z or csi0c query.
@@ -27,6 +28,7 @@ struct console_font_op;
 #define VT102ID "\033[?6c"
 
 struct consw {
+	struct module *owner;
 	const char *(*con_startup)(void);
 	void	(*con_init)(struct vc_data *, int);
 	void	(*con_deinit)(struct vc_data *);
@@ -58,7 +60,7 @@ extern const struct consw vga_con;	/* VGA text console */
 extern const struct consw newport_con;	/* SGI Newport console  */
 extern const struct consw prom_con;	/* SPARC PROM console */
 
-void take_over_console(const struct consw *sw, int first, int last, int deflt);
+int take_over_console(const struct consw *sw, int first, int last, int deflt);
 void give_up_console(const struct consw *sw);
 
 /* scroll */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 7ca3f4868..2c3d97fc5 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -60,7 +60,8 @@ extern struct semaphore cpucontrol;
 #define unlock_cpu_hotplug()	up(&cpucontrol)
 #define lock_cpu_hotplug_interruptible() down_interruptible(&cpucontrol)
 #define hotcpu_notifier(fn, pri) {				\
-	static struct notifier_block fn##_nb = { fn, pri };	\
+	static struct notifier_block fn##_nb =			\
+		{ .notifier_call = fn, .priority = pri };	\
 	register_cpu_notifier(&fn##_nb);			\
 }
 int cpu_down(unsigned int cpu);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index f48a06422..b4204dc7e 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -21,6 +21,7 @@
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
 #include <linux/completion.h>
+#include <linux/workqueue.h>
 
 #define CPUFREQ_NAME_LEN 16
 
@@ -81,6 +82,9 @@ struct cpufreq_policy {
  	struct semaphore	lock;   /* CPU ->setpolicy or ->target may
 					   only be called once a time */
 
+	struct work_struct	update; /* if update_policy() needs to be
+					 * called, but you're in IRQ context */
+
 	struct cpufreq_real_policy	user_policy;
 
 	struct kobject		kobj;
@@ -96,11 +100,13 @@ struct cpufreq_policy {
 
 #define CPUFREQ_PRECHANGE	(0)
 #define CPUFREQ_POSTCHANGE	(1)
+#define CPUFREQ_RESUMECHANGE	(8)
 
 struct cpufreq_freqs {
 	unsigned int cpu;	/* cpu nr */
 	unsigned int old;
 	unsigned int new;
+	u8 flags;		/* flags of cpufreq_driver, see below. */
 };
 
 
@@ -187,6 +193,9 @@ struct cpufreq_driver {
 				 unsigned int target_freq,
 				 unsigned int relation);
 
+	/* should be defined, if possible */
+	unsigned int	(*get)	(unsigned int cpu);
+
 	/* optional */
 	int	(*exit)		(struct cpufreq_policy *policy);
 	int	(*resume)	(struct cpufreq_policy *policy);
@@ -195,8 +204,19 @@ struct cpufreq_driver {
 
 /* flags */
 
-#define CPUFREQ_STICKY	0x01	/* the driver isn't removed even if 
-				   all ->init() calls failed */
+#define CPUFREQ_STICKY		0x01	/* the driver isn't removed even if 
+					 * all ->init() calls failed */
+#define CPUFREQ_CONST_LOOPS 	0x02	/* loops_per_jiffy or other kernel
+					 * "constants" aren't affected by
+					 * frequency transitions */
+#define CPUFREQ_PANIC_OUTOFSYNC	0x04	/* panic if cpufreq's opinion of
+					 * current frequency differs from
+					 * actual frequency */
+#define CPUFREQ_PANIC_RESUME_OUTOFSYNC 0x08 /* panic if cpufreq's opinion of
+					 * current frequency differs from
+					 * actual frequency on resume
+					 * from sleep. */
+
 
 int cpufreq_register_driver(struct cpufreq_driver *driver_data);
 int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
@@ -234,6 +254,9 @@ int cpufreq_set_policy(struct cpufreq_policy *policy);
 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 int cpufreq_update_policy(unsigned int cpu);
 
+/* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */
+unsigned int cpufreq_get(unsigned int cpu);
+
 /* the proc_intf.c needs this */
 int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpufreq_governor **governor);
 
@@ -241,13 +264,10 @@ int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpu
 /*********************************************************************
  *                      CPUFREQ USERSPACE GOVERNOR                   *
  *********************************************************************/
-int cpufreq_gov_userspace_init(void);
-
 #ifdef CONFIG_CPU_FREQ_24_API
 
 int cpufreq_setmax(unsigned int cpu);
 int cpufreq_set(unsigned int kHz, unsigned int cpu);
-unsigned int cpufreq_get(unsigned int cpu);
 
 
 /* /proc/sys/cpu */
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 090c3f2dc..4293a465d 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -10,11 +10,15 @@
 
 extern cpumask_t cpu_online_map;
 extern cpumask_t cpu_possible_map;
+extern cpumask_t cpu_present_map;
 
 #define num_online_cpus()		cpus_weight(cpu_online_map)
 #define num_possible_cpus()		cpus_weight(cpu_possible_map)
+#define num_present_cpus()		cpus_weight(cpu_present_map)
+
 #define cpu_online(cpu)			cpu_isset(cpu, cpu_online_map)
 #define cpu_possible(cpu)		cpu_isset(cpu, cpu_possible_map)
+#define cpu_present(cpu)		cpu_isset(cpu, cpu_present_map)
 
 #define for_each_cpu_mask(cpu, mask)					\
 	for (cpu = first_cpu_const(mk_cpumask_const(mask));		\
@@ -23,16 +27,24 @@ extern cpumask_t cpu_possible_map;
 
 #define for_each_cpu(cpu) for_each_cpu_mask(cpu, cpu_possible_map)
 #define for_each_online_cpu(cpu) for_each_cpu_mask(cpu, cpu_online_map)
+#define for_each_present_cpu(cpu) for_each_cpu_mask(cpu, cpu_present_map)
 #else
 #define	cpu_online_map			cpumask_of_cpu(0)
 #define	cpu_possible_map		cpumask_of_cpu(0)
+#define	cpu_present_map			cpumask_of_cpu(0)
+
 #define num_online_cpus()		1
 #define num_possible_cpus()		1
+#define num_present_cpus()		1
+
 #define cpu_online(cpu)			({ BUG_ON((cpu) != 0); 1; })
 #define cpu_possible(cpu)		({ BUG_ON((cpu) != 0); 1; })
+#define cpu_present(cpu)		({ BUG_ON((cpu) != 0); 1; })
 
+#define for_each_cpu_mask(cpu, mask) for (cpu = 0; cpu < 1; cpu++)
 #define for_each_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
 #define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
+#define for_each_present_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
 #endif
 
 #define cpumask_scnprintf(buf, buflen, map)				\
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 74f22a171..72f48658a 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -27,12 +27,14 @@ struct vfsmount;
 /*
  * "quick string" -- eases parameter passing, but more importantly
  * saves "metadata" about the string (ie length and the hash).
+ *
+ * hash comes first so it snuggles against d_parent and d_bucket in the
+ * dentry.
  */
 struct qstr {
-	const unsigned char * name;
-	unsigned int len;
 	unsigned int hash;
-	char name_str[0];
+	const unsigned char *name;
+	unsigned int len;
 };
 
 struct dentry_stat_t {
@@ -74,38 +76,39 @@ full_name_hash(const unsigned char *name, unsigned int len)
 	return end_name_hash(hash);
 }
 
-#define DNAME_INLINE_LEN_MIN 24
-
 struct dcookie_struct;
- 
+
+#define DNAME_INLINE_LEN_MIN 36
+
 struct dentry {
 	atomic_t d_count;
+	unsigned int d_flags;		/* protected by d_lock */
 	spinlock_t d_lock;		/* per dentry lock */
-	unsigned long d_vfs_flags;	/* moved here to be on same cacheline */
-	struct inode  * d_inode;	/* Where the name belongs to - NULL is negative */
+	struct inode *d_inode;		/* Where the name belongs to - NULL is
+					 * negative */
+	/*
+	 * The next three fields are touched by __d_lookup.  Place them here
+	 * so they all fit in a 16-byte range, with 16-byte alignment.
+	 */
+	struct dentry *d_parent;	/* parent directory */
+	struct hlist_head *d_bucket;	/* lookup hash bucket */
+	struct qstr d_name;
+
 	struct list_head d_lru;		/* LRU list */
 	struct list_head d_child;	/* child of parent list */
 	struct list_head d_subdirs;	/* our children */
 	struct list_head d_alias;	/* inode alias list */
 	unsigned long d_time;		/* used by d_revalidate */
-	struct dentry_operations  *d_op;
-	struct super_block * d_sb;	/* The root of the dentry tree */
-	unsigned int d_flags;
+	struct dentry_operations *d_op;
+	struct super_block *d_sb;	/* The root of the dentry tree */
 	int d_mounted;
-	void * d_fsdata;		/* fs-specific data */
+	void *d_fsdata;			/* fs-specific data */
  	struct rcu_head d_rcu;
-	struct dcookie_struct * d_cookie; /* cookie, if any */
-	unsigned long d_move_count;	/* to indicated moved dentry while lockless lookup */
-	struct qstr * d_qstr;		/* quick str ptr used in lockless lookup and concurrent d_move */
-	struct dentry * d_parent;	/* parent directory */
-	struct qstr d_name;
+	struct dcookie_struct *d_cookie; /* cookie, if any */
 	struct hlist_node d_hash;	/* lookup hash list */	
-	struct hlist_head * d_bucket;	/* lookup hash bucket */
-	unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
+	unsigned char d_iname[DNAME_INLINE_LEN_MIN];	/* small names */
 };
 
-#define DNAME_INLINE_LEN	(sizeof(struct dentry)-offsetof(struct dentry,d_iname))
- 
 struct dentry_operations {
 	int (*d_revalidate)(struct dentry *, struct nameidata *);
 	int (*d_hash) (struct dentry *, struct qstr *);
@@ -124,13 +127,13 @@ struct dentry_operations {
 
 /*
 locking rules:
-		big lock	dcache_lock	may block
-d_revalidate:	no		no		yes
-d_hash		no		no		yes
-d_compare:	no		yes		no
-d_delete:	no		yes		no
-d_release:	no		no		yes
-d_iput:		no		no		yes
+		big lock	dcache_lock	d_lock   may block
+d_revalidate:	no		no		no       yes
+d_hash		no		no		no       yes
+d_compare:	no		yes		yes      no
+d_delete:	no		yes		no       no
+d_release:	no		no		no       yes
+d_iput:		no		no		no       yes
  */
 
 /* d_flags entries */
@@ -175,8 +178,8 @@ extern spinlock_t dcache_lock;
 
 static inline void __d_drop(struct dentry *dentry)
 {
-	if (!(dentry->d_vfs_flags & DCACHE_UNHASHED)) {
-		dentry->d_vfs_flags |= DCACHE_UNHASHED;
+	if (!(dentry->d_flags & DCACHE_UNHASHED)) {
+		dentry->d_flags |= DCACHE_UNHASHED;
 		hlist_del_rcu(&dentry->d_hash);
 	}
 }
@@ -188,9 +191,9 @@ static inline void d_drop(struct dentry *dentry)
 	spin_unlock(&dcache_lock);
 }
 
-static inline int dname_external(struct dentry *d)
+static inline int dname_external(struct dentry *dentry)
 {
-	return d->d_name.name != d->d_iname; 
+	return dentry->d_name.name != dentry->d_iname;
 }
 
 /*
@@ -287,7 +290,7 @@ extern struct dentry * dget_locked(struct dentry *);
  
 static inline int d_unhashed(struct dentry *dentry)
 {
-	return (dentry->d_vfs_flags & DCACHE_UNHASHED);
+	return (dentry->d_flags & DCACHE_UNHASHED);
 }
 
 static inline struct dentry *dget_parent(struct dentry *dentry)
diff --git a/include/linux/delay.h b/include/linux/delay.h
index 36abaa6b1..f5610919d 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -38,4 +38,6 @@ extern unsigned long loops_per_jiffy;
 #define ndelay(x)	udelay(((x)+999)/1000)
 #endif
 
+void msleep(unsigned int msecs);
+
 #endif /* defined(_LINUX_DELAY_H) */
diff --git a/include/linux/device.h b/include/linux/device.h
index 9bc07b556..2b8b3d636 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -400,13 +400,13 @@ extern void firmware_unregister(struct subsystem *);
 
 /* debugging and troubleshooting/diagnostic helpers. */
 #define dev_printk(level, dev, format, arg...)	\
-	printk(level "%s %s: " format , (dev)->driver->name , (dev)->bus_id , ## arg)
+	printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg)
 
 #ifdef DEBUG
 #define dev_dbg(dev, format, arg...)		\
 	dev_printk(KERN_DEBUG , dev , format , ## arg)
 #else
-#define dev_dbg(dev, format, arg...) do {} while (0)
+#define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0)
 #endif
 
 #define dev_err(dev, format, arg...)		\
diff --git a/include/linux/edd.h b/include/linux/edd.h
index 70cc9a3e0..b3b36e283 100644
--- a/include/linux/edd.h
+++ b/include/linux/edd.h
@@ -166,9 +166,9 @@ struct edd_info {
 	u8 device;
 	u8 version;
 	u16 interface_support;
-	u16 legacy_cylinders;
-	u8 legacy_heads;
-	u8 legacy_sectors;
+	u16 legacy_max_cylinder;
+	u8 legacy_max_head;
+	u8 legacy_sectors_per_track;
 	struct edd_device_params params;
 } __attribute__ ((packed));
 
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 536b82838..b6b470e99 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -370,11 +370,4 @@ struct efi_generic_dev_path {
 	u16 length;
 } __attribute ((packed));
 
-/*
- * efi_dir is allocated in arch/ia64/kernel/efi.c.
- */
-#ifdef CONFIG_PROC_FS
-extern struct proc_dir_entry *efi_dir;
-#endif
-
 #endif /* _LINUX_EFI_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 7f21bfaa2..f8115ac02 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -81,8 +81,7 @@ typedef __s64	Elf64_Sxword;
 
 #define EM_V850		87	/* NEC v850 */
 
-#define EM_H8_300H      47      /* Hitachi H8/300H */
-#define EM_H8S          48      /* Hitachi H8S     */
+#define EM_H8_300       46      /* Hitachi H8/300,300H,H8S */
 
 /*
  * This is an interim value that we will use until the committee comes
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 8d4d0e397..c85b21049 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -351,6 +351,8 @@ struct ethtool_ops {
 	int	(*phys_id)(struct net_device *, u32);
 	int	(*get_stats_count)(struct net_device *);
 	void	(*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
+	int	(*begin)(struct net_device *);
+	void	(*complete)(struct net_device *);
 };
 
 /* CMDs currently supported */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 99d3db077..84f0fe1a4 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -516,7 +516,6 @@ struct fb_info {
 	struct fb_cmap cmap;		/* Current cmap */
 	struct fb_ops *fbops;
 	char *screen_base;		/* Virtual address */
-	struct vc_data *display_fg;	/* Console visible on this display */
 	int currcon;			/* Current VC. */
 	void *pseudo_palette;		/* Fake palette of 16 colors */ 
 #define FBINFO_STATE_RUNNING	0
diff --git a/include/linux/fd.h b/include/linux/fd.h
index cbbd0f876..7ce5f01a4 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -339,7 +339,7 @@ struct floppy_raw_cmd {
 #define FD_RAW_FAILURE 0x10000 /* command sent to fdc, fdc returned error */
 #define FD_RAW_HARDFAILURE 0x20000 /* fdc had to be reset, or timed out */
 
-	void *data;
+	void __user *data;
 	char *kernel_data; /* location of data buffer in the kernel */
 	struct floppy_raw_cmd *next; /* used for chaining of raw cmd's 
 				      * within the kernel */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 8971ae34d..10a69a544 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -13,14 +13,12 @@
 #include <linux/types.h>
 #include <linux/kdev_t.h>
 #include <linux/ioctl.h>
-#include <linux/list.h>
 #include <linux/dcache.h>
 #include <linux/stat.h>
 #include <linux/cache.h>
-#include <linux/radix-tree.h>
+#include <linux/prio_tree.h>
 #include <linux/kobject.h>
 #include <asm/atomic.h>
-#include <linux/audit.h>
 
 struct iovec;
 struct nameidata;
@@ -213,6 +211,9 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
 
 #ifdef __KERNEL__
 
+#include <linux/list.h>
+#include <linux/radix-tree.h>
+#include <linux/audit.h>
 #include <asm/semaphore.h>
 #include <asm/byteorder.h>
 
@@ -329,9 +330,10 @@ struct address_space {
 	unsigned long		nrpages;	/* number of total pages */
 	pgoff_t			writeback_index;/* writeback starts here */
 	struct address_space_operations *a_ops;	/* methods */
-	struct list_head	i_mmap;		/* list of private mappings */
-	struct list_head	i_mmap_shared;	/* list of shared mappings */
-	struct semaphore	i_shared_sem;	/* protect both above lists */
+	struct prio_tree_root	i_mmap;		/* tree of private mappings */
+	unsigned int		i_mmap_writable;/* count VM_SHARED mappings */
+	struct list_head	i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
+	spinlock_t		i_mmap_lock;	/* protect tree, count, list */
 	atomic_t		truncate_count;	/* Cover race condition with truncate */
 	unsigned long		flags;		/* error bits/gfp mask */
 	struct backing_dev_info *backing_dev_info; /* device readahead, etc */
@@ -356,6 +358,7 @@ struct block_device {
 	int			bd_invalidated;
 	struct gendisk *	bd_disk;
 	struct list_head	bd_list;
+	struct backing_dev_info *bd_inode_backing_dev_info;
 	/*
 	 * Private data.  You must have bd_claim'ed the block_device
 	 * to use this.  NOTE:  bd_claim allows an owner to claim
@@ -379,19 +382,19 @@ int mapping_tagged(struct address_space *mapping, int tag);
  */
 static inline int mapping_mapped(struct address_space *mapping)
 {
-	return	!list_empty(&mapping->i_mmap) ||
-		!list_empty(&mapping->i_mmap_shared);
+	return	!prio_tree_empty(&mapping->i_mmap) ||
+		!list_empty(&mapping->i_mmap_nonlinear);
 }
 
 /*
  * Might pages of this file have been modified in userspace?
- * Note that i_mmap_shared holds all the VM_SHARED vmas: do_mmap_pgoff
+ * Note that i_mmap_writable counts all VM_SHARED vmas: do_mmap_pgoff
  * marks vma as VM_SHARED if it is shared, and the file was opened for
  * writing i.e. vma may be mprotected writable even if now readonly.
  */
 static inline int mapping_writably_mapped(struct address_space *mapping)
 {
-	return	!list_empty(&mapping->i_mmap_shared);
+	return mapping->i_mmap_writable != 0;
 }
 
 /*
@@ -529,8 +532,8 @@ struct fown_struct {
 	rwlock_t lock;          /* protects pid, uid, euid fields */
 	int pid;		/* pid or -pgrp where SIGIO should be sent */
 	uid_t uid, euid;	/* uid/euid of process setting the owner */
-	int signum;		/* posix.1b rt signal to be delivered on IO */
 	void *security;
+	int signum;		/* posix.1b rt signal to be delivered on IO */
 };
 
 /*
@@ -558,10 +561,10 @@ struct file {
 	atomic_t		f_count;
 	unsigned int 		f_flags;
 	mode_t			f_mode;
+	int			f_error;
 	loff_t			f_pos;
 	struct fown_struct	f_owner;
 	unsigned int		f_uid, f_gid;
-	int			f_error;
 	struct file_ra_state	f_ra;
 
 	unsigned long		f_version;
@@ -596,7 +599,7 @@ extern void close_private_file(struct file *file);
 #if BITS_PER_LONG==32
 #define MAX_LFS_FILESIZE	(((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) 
 #elif BITS_PER_LONG==64
-#define MAX_LFS_FILESIZE 	0x7fffffffffffffff
+#define MAX_LFS_FILESIZE 	0x7fffffffffffffffUL
 #endif
 
 #define FL_POSIX	1
@@ -795,7 +798,7 @@ static inline void unlock_super(struct super_block * sb)
 extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
 extern int vfs_mkdir(struct inode *, struct dentry *, int);
 extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
-extern int vfs_symlink(struct inode *, struct dentry *, const char *);
+extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
 extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
 extern int vfs_rmdir(struct inode *, struct dentry *);
 extern int vfs_unlink(struct inode *, struct dentry *);
@@ -1114,6 +1117,7 @@ struct super_block *sget(struct file_system_type *type,
 			void *data);
 struct super_block *get_sb_pseudo(struct file_system_type *, char *,
 			struct super_operations *ops, unsigned long);
+int __put_super(struct super_block *sb);
 void unnamed_dev_init(void);
 
 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
@@ -1125,6 +1129,7 @@ void unnamed_dev_init(void);
 extern int register_filesystem(struct file_system_type *);
 extern int unregister_filesystem(struct file_system_type *);
 extern struct vfsmount *kern_mount(struct file_system_type *);
+extern int may_umount_tree(struct vfsmount *);
 extern int may_umount(struct vfsmount *);
 extern long do_mount(char *, char *, char *, unsigned long, void *);
 
@@ -1229,7 +1234,6 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned);
 extern int blkdev_put(struct block_device *);
 extern int bd_claim(struct block_device *, void *);
 extern void bd_release(struct block_device *);
-extern void blk_run_queues(void);
 
 /* fs/char_dev.c */
 extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, char *);
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 87f4b2541..65d6cfdb6 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -8,9 +8,10 @@
 #define FUTEX_WAKE (1)
 #define FUTEX_FD (2)
 #define FUTEX_REQUEUE (3)
-
+#define FUTEX_CMP_REQUEUE (4)
 
 long do_futex(unsigned long uaddr, int op, int val,
-		unsigned long timeout, unsigned long uaddr2, int val2);
+		unsigned long timeout, unsigned long uaddr2, int val2,
+		int val3);
 
 #endif
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 15d447954..322a7f732 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -118,10 +118,4 @@ static __inline__ int gameport_time(struct gameport *gameport, int time)
 	return (time * gameport->speed) / 1000;
 }
 
-static __inline__ void wait_ms(unsigned int ms)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(1 + ms * HZ / 1000);
-}
-
 #endif
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 679fc963f..8980d1fd7 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -4,6 +4,10 @@
 #include <linux/mmzone.h>
 #include <linux/stddef.h>
 #include <linux/linkage.h>
+#include <linux/config.h>
+
+struct vm_area_struct;
+
 /*
  * GFP bitmasks..
  */
@@ -69,19 +73,38 @@
  * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets
  * optimized to &contig_page_data at compile-time.
  */
-extern struct page * FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *));
-static inline struct page * alloc_pages_node(int nid, unsigned int gfp_mask, unsigned int order)
+extern struct page *
+FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *));
+
+static inline struct page *alloc_pages_node(int nid, unsigned int gfp_mask,
+						unsigned int order)
 {
 	if (unlikely(order >= MAX_ORDER))
 		return NULL;
 
-	return __alloc_pages(gfp_mask, order, NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK));
+	return __alloc_pages(gfp_mask, order,
+		NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK));
 }
 
+#ifdef CONFIG_NUMA
+extern struct page *alloc_pages_current(unsigned gfp_mask, unsigned order);
+
+static inline struct page *
+alloc_pages(unsigned int gfp_mask, unsigned int order)
+{
+	if (unlikely(order >= MAX_ORDER))
+		return NULL;
+
+	return alloc_pages_current(gfp_mask, order);
+}
+extern struct page *alloc_page_vma(unsigned gfp_mask,
+			struct vm_area_struct *vma, unsigned long addr);
+#else
 #define alloc_pages(gfp_mask, order) \
 		alloc_pages_node(numa_node_id(), gfp_mask, order)
-#define alloc_page(gfp_mask) \
-		alloc_pages_node(numa_node_id(), gfp_mask, 0)
+#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
+#endif
+#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
 
 extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order));
 extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask));
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 4b925472a..41e79a7f5 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -134,7 +134,7 @@ typedef struct hdlc_device_struct {
 			int dce_pvc_count;
 
 			struct timer_list timer;
-			int last_poll;
+			unsigned long last_poll;
 			int reliable;
 			int dce_changed;
 			int request;
@@ -149,8 +149,9 @@ typedef struct hdlc_device_struct {
 			cisco_proto settings;
 
 			struct timer_list timer;
-			int last_poll;
+			unsigned long last_poll;
 			int up;
+			int request_sent;
 			u32 txseq; /* TX sequence number */
 			u32 rxseq; /* RX sequence number */
 		}cisco;
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 894127b19..6908f29d3 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -3,6 +3,8 @@
 
 #ifdef CONFIG_HUGETLB_PAGE
 
+#include <linux/mempolicy.h>
+
 struct ctl_table;
 
 static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
@@ -10,7 +12,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
 	return vma->vm_flags & VM_HUGETLB;
 }
 
-int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void *, size_t *);
+int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *);
 int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
 int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
 void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
@@ -30,6 +32,7 @@ void free_huge_page(struct page *);
 
 extern unsigned long max_huge_pages;
 extern const unsigned long hugetlb_zero, hugetlb_infinity;
+extern int sysctl_hugetlb_shm_group;
 
 static inline void
 mark_mm_hugetlb(struct mm_struct *mm, struct vm_area_struct *vma)
@@ -103,6 +106,17 @@ struct hugetlbfs_sb_info {
 	spinlock_t	stat_lock;
 };
 
+
+struct hugetlbfs_inode_info {
+	struct shared_policy policy;
+	struct inode vfs_inode;
+};
+
+static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode)
+{
+	return container_of(inode, struct hugetlbfs_inode_info, vfs_inode);
+}
+
 static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
 {
 	return sb->s_fs_info;
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index e988edbcb..591e7ad68 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -222,7 +222,7 @@
 #define I2C_HW_B_OMAHA  0x14    /* Omaha I2C interface (ARM)		*/
 #define I2C_HW_B_GUIDE  0x15    /* Guide bit-basher			*/
 #define I2C_HW_B_IXP2000 0x16	/* GPIO on IXP2000 systems              */
-#define I2C_HW_B_IXP425 0x17	/* GPIO on IXP425 systems		*/
+#define I2C_HW_B_IXP4XX 0x17	/* GPIO on IXP4XX systems		*/
 #define I2C_HW_B_S3VIA	0x18	/* S3Via ProSavage adapter		*/
 #define I2C_HW_B_ZR36067 0x19	/* Zoran-36057/36067 based boards	*/
 
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index d1c69565d..0c3cf0e2f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -113,6 +113,7 @@ struct i2c_driver {
 	struct module *owner;
 	char name[32];
 	int id;
+	unsigned int class;
 	unsigned int flags;		/* div., see below		*/
 
 	/* Notifies the driver that a new bus has appeared. This routine
@@ -237,7 +238,6 @@ struct i2c_adapter {
 	/* data fields that are valid for all devices	*/
 	struct semaphore bus_lock;
 	struct semaphore clist_lock;
-	unsigned int flags;/* flags specifying div. data		*/
 
 	int timeout;
 	int retries;
@@ -286,12 +286,14 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
 						/* Must equal I2C_M_TEN below */
 
 /* i2c adapter classes (bitmask) */
-#define I2C_ADAP_CLASS_SMBUS		(1<<0)	/* lm_sensors, ... */
-#define I2C_ADAP_CLASS_TV_ANALOG	(1<<1)	/* bttv + friends */
-#define I2C_ADAP_CLASS_TV_DIGITAL	(1<<2)	/* dbv cards */
-#define I2C_ADAP_CLASS_DDC		(1<<3)	/* i2c-matroxfb ? */
-#define I2C_ADAP_CLASS_CAM_ANALOG	(1<<4)	/* camera with analog CCD */
-#define I2C_ADAP_CLASS_CAM_DIGITAL	(1<<5)	/* most webcams */
+#define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
+#define I2C_CLASS_TV_ANALOG	(1<<1)	/* bttv + friends */
+#define I2C_CLASS_TV_DIGITAL	(1<<2)	/* dvb cards */
+#define I2C_CLASS_DDC		(1<<3)	/* i2c-matroxfb ? */
+#define I2C_CLASS_CAM_ANALOG	(1<<4)	/* camera with analog CCD */
+#define I2C_CLASS_CAM_DIGITAL	(1<<5)	/* most webcams */
+#define I2C_CLASS_SOUND		(1<<6)	/* sound devices */
+#define I2C_CLASS_ALL		(UINT_MAX) /* all of the above */
 
 /* i2c_client_address_data is the struct for holding default client
  * addresses for a driver and for the parameters supplied on the
@@ -599,11 +601,4 @@ union i2c_smbus_data {
 #define i2c_is_isa_adapter(adapptr) \
         ((adapptr)->algo->id == I2C_ALGO_ISA)
 
-/* Tiny delay function used by the i2c bus drivers */
-static inline void i2c_delay(signed long timeout)
-{
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(timeout);
-}
-
 #endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h
index 2f1f141c3..c79f39745 100644
--- a/include/linux/i2o-dev.h
+++ b/include/linux/i2o-dev.h
@@ -41,6 +41,13 @@
 #define I2OHTML 		_IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
 #define I2OEVTREG		_IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
 #define I2OEVTGET		_IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
+#define I2OPASSTHRU		_IOR(I2O_MAGIC_NUMBER,12,struct i2o_cmd_passthru)
+
+struct i2o_cmd_passthru
+{
+	unsigned int iop;	/* IOP unit number */
+	void *msg;		/* message */
+};
 
 struct i2o_cmd_hrtlct
 {
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index a59392a3c..239036553 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -75,6 +75,16 @@ struct i2o_device
 	char dev_name[8];		/* linux /dev name if available */
 };
 
+/*
+ * context queue entry, used for 32-bit context on 64-bit systems
+ */
+struct i2o_context_list_element {
+	struct i2o_context_list_element *next;
+	u32 context;
+	void *ptr;
+	unsigned int flags;
+};
+
 /*
  * Each I2O controller has one of these objects
  */
@@ -133,6 +143,11 @@ struct i2o_controller
 
 	void *page_frame;			/* Message buffers */
 	dma_addr_t page_frame_map;		/* Cache map */
+#if BITS_PER_LONG == 64
+	spinlock_t context_list_lock;		/* lock for context_list */
+	struct i2o_context_list_element *context_list; /* list of context id's
+						    and pointers */
+#endif
 };
 
 /*
@@ -322,6 +337,27 @@ extern int i2o_activate_controller(struct i2o_controller *);
 extern void i2o_run_queue(struct i2o_controller *);
 extern int i2o_delete_controller(struct i2o_controller *);
 
+#if BITS_PER_LONG == 64
+extern u32 i2o_context_list_add(void *, struct i2o_controller *);
+extern void *i2o_context_list_get(u32, struct i2o_controller *);
+extern u32 i2o_context_list_remove(void *, struct i2o_controller *);
+#else
+static inline u32 i2o_context_list_add(void *ptr, struct i2o_controller *c)
+{
+	return (u32)ptr;
+}
+
+static inline void *i2o_context_list_get(u32 context, struct i2o_controller *c)
+{
+	return (void *)context;
+}
+
+static inline u32 i2o_context_list_remove(void *ptr, struct i2o_controller *c)
+{
+	return (u32)ptr;
+}
+#endif
+
 /*
  *	Cache strategies
  */
@@ -640,6 +676,8 @@ extern int i2o_delete_controller(struct i2o_controller *);
 #define HOST_TID		1
 
 #define MSG_FRAME_SIZE		64	/* i2o_scsi assumes >= 32 */
+#define REPLY_FRAME_SIZE	17
+#define SG_TABLESIZE		30
 #define NMBR_MSG_FRAMES		128
 
 #define MSG_POOL_SIZE		(MSG_FRAME_SIZE*NMBR_MSG_FRAMES*sizeof(u32))
@@ -647,5 +685,9 @@ extern int i2o_delete_controller(struct i2o_controller *);
 #define I2O_POST_WAIT_OK	0
 #define I2O_POST_WAIT_TIMEOUT	-ETIMEDOUT
 
+#define I2O_CONTEXT_LIST_MIN_LENGTH	15
+#define I2O_CONTEXT_LIST_USED		0x01
+#define I2O_CONTEXT_LIST_DELETED	0x02
+
 #endif /* __KERNEL__ */
 #endif /* _I2O_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index aa2e86d08..ade3bb869 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -305,20 +305,25 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
 
 #include <asm/ide.h>
 
+/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */
+#ifndef IDE_ARCH_OBSOLETE_DEFAULTS
+# define ide_default_io_base(index)	(0)
+# define ide_default_irq(base)		(0)
+# define ide_init_default_irq(base)	(0)
+#endif
+
 /*
  * ide_init_hwif_ports() is OBSOLETE and will be removed in 2.7 series.
- *
- * arm26, arm, h8300, m68k, m68knommu (broken) and i386-pc9800 (broken)
- * still have their own versions.
+ * New ports shouldn't define IDE_ARCH_OBSOLETE_INIT in <asm/ide.h>.
  */
-#if !defined(CONFIG_ARM) && !defined(CONFIG_H8300) && !defined(CONFIG_M68K)
+#ifdef IDE_ARCH_OBSOLETE_INIT
 static inline void ide_init_hwif_ports(hw_regs_t *hw,
 				       unsigned long io_addr,
 				       unsigned long ctl_addr,
 				       int *irq)
 {
 	if (!ctl_addr)
-		ide_std_init_ports(hw, io_addr, io_addr + 0x206);
+		ide_std_init_ports(hw, io_addr, ide_default_io_ctl(io_addr));
 	else
 		ide_std_init_ports(hw, io_addr, ctl_addr);
 
@@ -332,7 +337,16 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw,
 		ppc_ide_md.ide_init_hwif(hw, io_addr, ctl_addr, irq);
 #endif
 }
-#endif /* !ARM && !H8300 && !M68K */
+#else
+static inline void ide_init_hwif_ports(hw_regs_t *hw,
+				       unsigned long io_addr,
+				       unsigned long ctl_addr,
+				       int *irq)
+{
+	if (io_addr || ctl_addr)
+		printk(KERN_WARNING "%s: must not be called\n", __FUNCTION__);
+}
+#endif /* IDE_ARCH_OBSOLETE_INIT */
 
 /* Currently only m68k, apus and m8xx need it */
 #ifndef IDE_ARCH_ACK_INTR
@@ -676,7 +690,6 @@ typedef union {
 typedef enum {
 	ide_stopped,	/* no drive operation was started */
 	ide_started,	/* a drive operation was started, handler was set */
-	ide_released,	/* as ide_started, but bus also released */
 } ide_startstop_t;
 
 struct ide_driver_s;
@@ -710,7 +723,6 @@ typedef struct ide_drive_s {
 	u8	keep_settings;		/* restore settings after drive reset */
 	u8	autodma;		/* device can safely use dma on host */
 	u8	using_dma;		/* disk is using dma for read/write */
-	u8	using_tcq;		/* disk is using queueing */
 	u8	retry_pio;		/* retrying dma capable host in pio */
 	u8	state;			/* retry state */
 	u8	waiting_for_dma;	/* dma currently in progress */
@@ -737,6 +749,7 @@ typedef struct ide_drive_s {
 	unsigned remap_0_to_1	: 1;	/* 0=noremap, 1=remap 0->1 (for EZDrive) */
 	unsigned blocked        : 1;	/* 1=powermanagment told us not to do anything, so sleep nicely */
 	unsigned vdma		: 1;	/* 1=doing PIO over DMA 0=doing normal DMA */
+	unsigned stroke		: 1;	/* from:  hdx=stroke */
 	unsigned addressing;		/*      : 3;
 					 *  0=28-bit
 					 *  1=48-bit
@@ -767,7 +780,6 @@ typedef struct ide_drive_s {
 	u8	sect;		/* "real" sectors per track */
 	u8	bios_head;	/* BIOS/fdisk/LILO number of heads */
 	u8	bios_sect;	/* BIOS/fdisk/LILO sectors per track */
-	u8	queue_depth;	/* max queue depth */
 
 	unsigned int	bios_cyl;	/* BIOS/fdisk/LILO number of cyls */
 	unsigned int	cyl;		/* "real" number of cyls */
@@ -1081,7 +1093,6 @@ typedef struct ide_settings_s {
 
 extern struct semaphore ide_setting_sem;
 extern int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set);
-extern void ide_remove_setting(ide_drive_t *drive, char *name);
 extern ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name);
 extern int ide_read_setting(ide_drive_t *t, ide_settings_t *setting);
 extern int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val);
@@ -1102,7 +1113,6 @@ extern struct proc_dir_entry *proc_ide_root;
 
 extern void proc_ide_create(void);
 extern void proc_ide_destroy(void);
-extern void destroy_proc_ide_device(ide_hwif_t *, ide_drive_t *);
 extern void destroy_proc_ide_drives(ide_hwif_t *);
 extern void create_proc_ide_interfaces(void);
 extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *);
@@ -1345,6 +1355,8 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
  */
 extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
 
+extern void try_to_flush_leftover_data(ide_drive_t *);
+
 /*
  * Issue ATA command and wait for completion.
  * Use for implementing commands in kernel
@@ -1472,7 +1484,6 @@ int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
 int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
 int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long);
 
-extern void ide_delay_50ms(void);
 extern int system_bus_clock(void);
 
 extern u8 ide_auto_reduce_xfer(ide_drive_t *);
@@ -1541,7 +1552,6 @@ int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
 #define NODMA 0
 #define NOAUTODMA 1
 #define AUTODMA 2
-#define EOL 255
 
 typedef struct ide_pci_enablebit_s {
 	u8	reg;	/* byte pci reg holding the enable-bit */
@@ -1549,9 +1559,15 @@ typedef struct ide_pci_enablebit_s {
 	u8	val;	/* value of masked reg when "enabled" */
 } ide_pci_enablebit_t;
 
+enum {
+	/* Uses ISA control ports not PCI ones. */
+	IDEPCI_FLAG_ISA_PORTS		= (1 << 0),
+
+	IDEPCI_FLAG_FORCE_MASTER	= (1 << 1),
+	IDEPCI_FLAG_FORCE_PDC		= (1 << 2),
+};
+
 typedef struct ide_pci_device_s {
-	u16			vendor;
-	u16			device;
 	char			*name;
 	void			(*init_setup)(struct pci_dev *, struct ide_pci_device_s *);
 	void			(*init_setup_dma)(struct pci_dev *, struct ide_pci_device_s *, ide_hwif_t *);
@@ -1565,7 +1581,7 @@ typedef struct ide_pci_device_s {
 	u8			bootable;
 	unsigned int		extra;
 	struct ide_pci_device_s	*next;
-	u8			isa_ports; 	/* Uses ISA control ports not PCI ones */
+	u8			flags;
 } ide_pci_device_t;
 
 extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
@@ -1604,14 +1620,6 @@ extern int __ide_dma_lostirq(ide_drive_t *);
 extern int __ide_dma_timeout(ide_drive_t *);
 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-extern int __ide_dma_queued_on(ide_drive_t *drive);
-extern int __ide_dma_queued_off(ide_drive_t *drive);
-extern ide_startstop_t __ide_dma_queued_read(ide_drive_t *drive);
-extern ide_startstop_t __ide_dma_queued_write(ide_drive_t *drive);
-extern ide_startstop_t __ide_dma_queued_start(ide_drive_t *drive);
-#endif
-
 #else
 static inline int __ide_dma_off(ide_drive_t *drive) { return 0; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
@@ -1680,28 +1688,6 @@ extern struct semaphore ide_cfg_sem;
 
 #define local_irq_set(flags)	do { local_save_flags((flags)); local_irq_enable(); } while (0)
 
-#define IDE_MAX_TAG	32
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-static inline int ata_pending_commands(ide_drive_t *drive)
-{
-	if (drive->using_tcq)
-		return blk_queue_tag_depth(drive->queue);
-
-	return 0;
-}
-
-static inline int ata_can_queue(ide_drive_t *drive)
-{
-	if (drive->using_tcq)
-		return blk_queue_tag_queue(drive->queue);
-
-	return 1;
-}
-#else
-#define ata_pending_commands(drive)	(0)
-#define ata_can_queue(drive)		(1)
-#endif
-
 extern struct bus_type ide_bus_type;
 
 #endif /* _IDE_H */
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 0aeae7780..81439bfc0 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -15,10 +15,10 @@
 
 #if BITS_PER_LONG == 32
 # define IDR_BITS 5
-# define IDR_FULL 0xffffffff
+# define IDR_FULL 0xfffffffful
 #elif BITS_PER_LONG == 64
 # define IDR_BITS 6
-# define IDR_FULL 0xffffffffffffffff
+# define IDR_FULL 0xfffffffffffffffful
 #else
 # error "BITS_PER_LONG is not 32 or 64"
 #endif
diff --git a/include/linux/if.h b/include/linux/if.h
index 9370fd106..296a6c21e 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -63,6 +63,7 @@
 #define IF_IFACE_T1	0x1003		/* T1 telco serial interface	*/
 #define IF_IFACE_E1	0x1004		/* E1 telco serial interface	*/
 #define IF_IFACE_SYNC_SERIAL 0x1005	/* can't be set by software	*/
+#define IF_IFACE_X21D   0x1006          /* X.21 Dual Clocking (FarSite) */
 
 /* For definitions see hdlc.h */
 #define IF_PROTO_HDLC	0x2000		/* raw HDLC protocol		*/
@@ -77,6 +78,7 @@
 #define IF_PROTO_FR_DEL_ETH_PVC 0x2009	/*  Delete FR Ethernet-bridged PVC */
 #define IF_PROTO_FR_PVC	0x200A		/* for reading PVC status	*/
 #define IF_PROTO_FR_ETH_PVC 0x200B
+#define IF_PROTO_RAW    0x200C          /* RAW Socket                   */
 
 
 /*
@@ -145,7 +147,7 @@ struct ifreq
 		struct  ifmap ifru_map;
 		char	ifru_slave[IFNAMSIZ];	/* Just fits the size */
 		char	ifru_newname[IFNAMSIZ];
-		char __user *	ifru_data;
+		void __user *	ifru_data;
 		struct	if_settings ifru_settings;
 	} ifr_ifru;
 };
@@ -180,8 +182,8 @@ struct ifconf
 	int	ifc_len;			/* size of buffer	*/
 	union 
 	{
-		char *			ifcu_buf;
-		struct	ifreq 		*ifcu_req;
+		char __user *ifcu_buf;
+		struct ifreq __user *ifcu_req;
 	} ifc_ifcu;
 };
 #define	ifc_buf	ifc_ifcu.ifcu_buf		/* buffer address	*/
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 7d06a31e5..bbf49bcd7 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -86,6 +86,7 @@
 #define ARPHRD_IEEE80211_PRISM 802	/* IEEE 802.11 + Prism2 header  */
 
 #define ARPHRD_VOID	  0xFFFF	/* Void type, nothing is known */
+#define ARPHRD_NONE	  0xFFFE	/* zero header length */
 
 /* ARP protocol opcodes. */
 #define	ARPOP_REQUEST	1		/* ARP request			*/
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 5dff099e7..58d6e606d 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -17,6 +17,12 @@
 
 #include <linux/types.h>
 
+#define SYSFS_BRIDGE_ATTR	"bridge"
+#define SYSFS_BRIDGE_FDB	"brforward"
+#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
+#define SYSFS_BRIDGE_PORT_ATTR	"brport"
+#define SYSFS_BRIDGE_PORT_LINK	"bridge"
+
 #define BRCTL_VERSION 1
 
 #define BRCTL_GET_VERSION 0
@@ -98,7 +104,7 @@ struct __fdb_entry
 
 #include <linux/netdevice.h>
 
-extern void brioctl_set(int (*ioctl_hook)(unsigned long));
+extern void brioctl_set(int (*ioctl_hook)(unsigned int, void __user *));
 extern int (*br_handle_frame_hook)(struct sk_buff *skb);
 extern int (*br_should_route_hook)(struct sk_buff **pskb);
 
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 505900335..3c94b1736 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -191,7 +191,7 @@ struct frad_local
    int               buffer;		/* current buffer for S508 firmware */
 };
 
-extern void dlci_ioctl_set(int (*hook)(unsigned int, void *));
+extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *));
 
 #endif /* __KERNEL__ */
 
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 104df1877..46d246bac 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -55,7 +55,7 @@ struct vlan_hdr {
 #define VLAN_VID_MASK	0xfff
 
 /* found in socket.c */
-extern void vlan_ioctl_set(int (*hook)(unsigned long));
+extern void vlan_ioctl_set(int (*hook)(void __user *));
 
 #define VLAN_NAME "vlan"
 
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 093bd2fa2..390e760a9 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -204,9 +204,9 @@ extern int ip_mc_source(int add, int omode, struct sock *sk,
 		struct ip_mreq_source *mreqs, int ifindex);
 extern int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf,int ifindex);
 extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
-		struct ip_msfilter *optval, int *optlen);
+		struct ip_msfilter __user *optval, int __user *optlen);
 extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
-		struct group_filter *optval, int *optlen);
+		struct group_filter __user *optval, int __user *optlen);
 extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif);
 extern void ip_mr_init(void);
 extern void ip_mc_init_dev(struct in_device *);
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index c23cd45da..27a5d0a97 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -96,7 +96,7 @@ extern int unregister_inetaddr_notifier(struct notifier_block *nb);
 
 extern struct net_device 	*ip_dev_find(u32 addr);
 extern int		inet_addr_onlink(struct in_device *in_dev, u32 a, u32 b);
-extern int		devinet_ioctl(unsigned int cmd, void *);
+extern int		devinet_ioctl(unsigned int cmd, void __user *);
 extern void		devinet_init(void);
 extern struct in_device *inetdev_init(struct net_device *dev);
 extern struct in_device	*inetdev_by_index(int);
diff --git a/include/linux/init.h b/include/linux/init.h
index c68424772..45069e275 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -46,8 +46,6 @@
 #define __exitdata	__attribute__ ((__section__(".exit.data")))
 #define __exit_call	__attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
 
-#define __sched		__attribute__((__section__(".sched.text")))
-
 #ifdef MODULE
 #define __exit		__attribute__ ((__section__(".exit.text")))
 #else
diff --git a/include/linux/input.h b/include/linux/input.h
index 77ba731cf..b7a30bb64 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -655,7 +655,7 @@ struct ff_periodic_effect {
 	struct ff_envelope envelope;
 
 /* Only used if waveform == FF_CUSTOM */
-	__u32 custom_len;	/* Number of samples  */	
+	__u32 custom_len;	/* Number of samples */
 	__s16 *custom_data;	/* Buffer of samples */
 /* Note: the data pointed by custom_data is copied by the driver. You can
  * therefore dispose of the memory after the upload/update */
@@ -749,8 +749,6 @@ struct ff_effect {
 #define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
 	((dev->keycodesize == 2) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
 
-#define init_input_dev(dev)	do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
-
 #define SET_INPUT_KEYCODE(dev, scancode, val)			\
 		({	unsigned __old;				\
 		switch (dev->keycodesize) {			\
@@ -915,6 +913,12 @@ struct input_handle {
 #define to_handle(n) container_of(n,struct input_handle,d_node)
 #define to_handle_h(n) container_of(n,struct input_handle,h_node)
 
+static inline void init_input_dev(struct input_dev *dev)
+{
+	INIT_LIST_HEAD(&dev->h_list);
+	INIT_LIST_HEAD(&dev->node);
+}
+
 void input_register_device(struct input_dev *);
 void input_unregister_device(struct input_dev *);
 
@@ -932,14 +936,51 @@ int input_flush_device(struct input_handle* handle, struct file* file);
 
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
 
-#define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c))
-#define input_report_rel(a,b,c) input_event(a, EV_REL, b, c)
-#define input_report_abs(a,b,c) input_event(a, EV_ABS, b, c)
-#define input_report_ff(a,b,c)	input_event(a, EV_FF, b, c)
-#define input_report_ff_status(a,b,c)	input_event(a, EV_FF_STATUS, b, c)
-
-#define input_regs(a,b)		do { (a)->regs = (b); } while (0)
-#define input_sync(a)		do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0)
+static inline void input_report_key(struct input_dev *dev, unsigned int code, int value)
+{
+	input_event(dev, EV_KEY, code, !!value);
+}
+
+static inline void input_report_rel(struct input_dev *dev, unsigned int code, int value)
+{
+	input_event(dev, EV_REL, code, value);
+}
+
+static inline void input_report_abs(struct input_dev *dev, unsigned int code, int value)
+{
+	input_event(dev, EV_ABS, code, value);
+}
+
+static inline void input_report_ff(struct input_dev *dev, unsigned int code, int value)
+{
+	input_event(dev, EV_FF, code, value);
+}
+
+static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value)
+{
+	input_event(dev, EV_FF_STATUS, code, value);
+}
+
+static inline void input_regs(struct input_dev *dev, struct pt_regs *regs)
+{
+	dev->regs = regs;
+}
+
+static inline void input_sync(struct input_dev *dev)
+{
+	input_event(dev, EV_SYN, SYN_REPORT, 0);
+	dev->regs = NULL;
+}
+
+static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
+{
+	dev->absmin[axis] = min;
+	dev->absmax[axis] = max;
+	dev->absfuzz[axis] = fuzz;
+	dev->absflat[axis] = flat;
+
+	dev->absbit[LONG(axis)] |= BIT(axis);
+}
 
 extern struct class_simple *input_class;
 
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e98637f35..ccc084d37 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -192,6 +192,8 @@ struct inet6_skb_parm
 	__u16			dst1;
 };
 
+#define IP6CB(skb)	((struct inet6_skb_parm*)((skb)->cb))
+
 struct ipv6_pinfo {
 	struct in6_addr 	saddr;
 	struct in6_addr 	rcv_saddr;
diff --git a/include/linux/kd.h b/include/linux/kd.h
index 9eacfd158..f8c48b497 100644
--- a/include/linux/kd.h
+++ b/include/linux/kd.h
@@ -1,6 +1,7 @@
 #ifndef _LINUX_KD_H
 #define _LINUX_KD_H
 #include <linux/types.h>
+#include <linux/compiler.h>
 
 /* 0x4B is 'K', to avoid collision with termios and vt */
 
@@ -12,7 +13,7 @@
 struct consolefontdesc {
 	unsigned short charcount;	/* characters in font (256 or 512) */
 	unsigned short charheight;	/* scan lines per character (1-32) */
-	char *chardata;			/* font data in expanded form */
+	char __user *chardata;		/* font data in expanded form */
 };
 
 #define PIO_FONTRESET   0x4B6D	/* reset to default font */
@@ -63,7 +64,7 @@ struct unipair {
 };
 struct unimapdesc {
 	unsigned short entry_ct;
-	struct unipair *entries;
+	struct unipair __user *entries;
 };
 #define PIO_UNIMAP	0x4B67	/* put unicode-to-font mapping in kernel */
 #define PIO_UNIMAPCLR	0x4B68	/* clear table, possibly advise hash algorithm */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index c1171e77c..67da15c2e 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -109,14 +109,17 @@ static inline void console_verbose(void)
 extern void bust_spinlocks(int yes);
 extern int oops_in_progress;		/* If set, an oops, panic(), BUG() or die() is in progress */
 extern int panic_on_oops;
-extern int system_state;		/* See values below */
 extern int tainted;
 extern const char *print_tainted(void);
 
 /* Values used for system_state */
-#define SYSTEM_BOOTING 0
-#define SYSTEM_RUNNING 1
-#define SYSTEM_SHUTDOWN 2
+extern enum system_states {
+	SYSTEM_BOOTING,
+	SYSTEM_RUNNING,
+	SYSTEM_HALT,
+	SYSTEM_POWER_OFF,
+	SYSTEM_RESTART,
+} system_state;
 
 #define TAINT_PROPRIETARY_MODULE	(1<<0)
 #define TAINT_FORCED_MODULE		(1<<1)
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 7c5af18df..a484f5244 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -23,6 +23,8 @@
 #include <linux/errno.h>
 #include <linux/compiler.h>
 
+#define KMOD_PATH_LEN 256
+
 #ifdef CONFIG_KMOD
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index f32f39b4c..6360d2258 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -48,7 +48,7 @@ extern void kobject_cleanup(struct kobject *);
 extern int kobject_add(struct kobject *);
 extern void kobject_del(struct kobject *);
 
-extern void kobject_rename(struct kobject *, char *new_name);
+extern int kobject_rename(struct kobject *, char *new_name);
 
 extern int kobject_register(struct kobject *);
 extern void kobject_unregister(struct kobject *);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index e977b157c..18c90a0c1 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -27,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <asm/io.h>
 #include <linux/ata.h>
+#include <linux/workqueue.h>
 
 /*
  * compile-time options
@@ -39,6 +40,7 @@
 #undef ATA_ENABLE_ATAPI		/* define to enable ATAPI support */
 #undef ATA_ENABLE_PATA		/* define to enable PATA support in some
 				 * low-level drivers */
+#undef ATAPI_ENABLE_DMADIR	/* enables ATAPI DMADIR bridge support */
 
 
 /* note: prints function name for you */
@@ -109,12 +111,7 @@ enum {
 
 	ATA_QCFLAG_ACTIVE	= (1 << 1), /* cmd not yet ack'd to scsi lyer */
 	ATA_QCFLAG_DMA		= (1 << 2), /* data delivered via DMA */
-	ATA_QCFLAG_ATAPI	= (1 << 3), /* is ATAPI packet command? */
 	ATA_QCFLAG_SG		= (1 << 4), /* have s/g table? */
-	ATA_QCFLAG_POLL		= (1 << 5), /* polling, no interrupts */
-
-	/* struct ata_engine atomic flags (use test_bit, etc.) */
-	ATA_EFLG_ACTIVE		= 0,	/* engine is active */
 
 	/* various lengths of time */
 	ATA_TMOUT_EDD		= 5 * HZ,	/* hueristic */
@@ -144,13 +141,6 @@ enum {
 	THR_IDLE		= (THR_PROBE_FAILED + 1),
 	THR_PROBE_SUCCESS	= (THR_IDLE + 1),
 	THR_PROBE_START		= (THR_PROBE_SUCCESS + 1),
-	THR_PIO_POLL		= (THR_PROBE_START + 1),
-	THR_PIO_TMOUT		= (THR_PIO_POLL + 1),
-	THR_PIO			= (THR_PIO_TMOUT + 1),
-	THR_PIO_LAST		= (THR_PIO + 1),
-	THR_PIO_LAST_POLL	= (THR_PIO_LAST + 1),
-	THR_PIO_ERR		= (THR_PIO_LAST_POLL + 1),
-	THR_PACKET		= (THR_PIO_ERR + 1),
 
 	/* SATA port states */
 	PORT_UNKNOWN		= 0,
@@ -163,6 +153,17 @@ enum {
 	ATA_QCFLAG_TIMEOUT	= (1 << 0),
 };
 
+enum pio_task_states {
+	PIO_ST_UNKNOWN,
+	PIO_ST_IDLE,
+	PIO_ST_POLL,
+	PIO_ST_TMOUT,
+	PIO_ST,
+	PIO_ST_LAST,
+	PIO_ST_LAST_POLL,
+	PIO_ST_ERR,
+};
+
 /* forward declarations */
 struct scsi_device;
 struct ata_port_operations;
@@ -224,7 +225,6 @@ struct ata_queued_cmd {
 	struct scsi_cmnd	*scsicmd;
 	void			(*scsidone)(struct scsi_cmnd *);
 
-	struct list_head	node;
 	unsigned long		flags;		/* ATA_QCFLAG_xxx */
 	unsigned int		tag;
 	unsigned int		n_elem;
@@ -239,7 +239,7 @@ struct ata_queued_cmd {
 
 	ata_qc_cb_t		callback;
 
-	struct semaphore	sem;
+	struct completion	*waiting;
 
 	void			*private_data;
 };
@@ -259,23 +259,12 @@ struct ata_device {
 	unsigned int		pio_mode;
 	unsigned int		udma_mode;
 
-	unsigned char		vendor[8];	/* space-padded, not ASCIIZ */
-	unsigned char		product[32];	/* WARNING: shorter than
-						 * ATAPI7 spec size, 40 ASCII
-						 * characters
-						 */
-
 	/* cache info about current transfer mode */
 	u8			xfer_protocol;	/* taskfile xfer protocol */
 	u8			read_cmd;	/* opcode to use on read */
 	u8			write_cmd;	/* opcode to use on write */
 };
 
-struct ata_engine {
-	unsigned long		flags;
-	struct list_head	q;
-};
-
 struct ata_port {
 	struct Scsi_Host	*host;	/* our co-allocated scsi host */
 	struct ata_port_operations	*ops;
@@ -296,8 +285,6 @@ struct ata_port {
 	unsigned int		udma_mask;
 	unsigned int		cbl;	/* cable type; ATA_CBL_xxx */
 
-	struct ata_engine	eng;
-
 	struct ata_device	device[ATA_MAX_DEVICES];
 
 	struct ata_queued_cmd	qcmd[ATA_MAX_QUEUE];
@@ -307,16 +294,17 @@ struct ata_port {
 	struct ata_host_stats	stats;
 	struct ata_host_set	*host_set;
 
-	struct semaphore	sem;
 	struct semaphore	probe_sem;
 
 	unsigned int		thr_state;
-	int			time_to_die;
-	pid_t			thr_pid;
-	struct completion	thr_exited;
-	struct semaphore	thr_sem;
-	struct timer_list	thr_timer;
-	unsigned long		thr_timeout;
+
+	struct work_struct	packet_task;
+
+	struct work_struct	pio_task;
+	unsigned int		pio_task_state;
+	unsigned long		pio_task_timeout;
+
+	struct work_struct	probe_task;
 
 	void			*private_data;
 };
@@ -340,6 +328,7 @@ struct ata_port_operations {
 	void (*phy_reset) (struct ata_port *ap);
 	void (*post_set_mode) (struct ata_port *ap);
 
+	void (*bmdma_setup) (struct ata_queued_cmd *qc);
 	void (*bmdma_start) (struct ata_queued_cmd *qc);
 	void (*fill_sg) (struct ata_queued_cmd *qc);
 	void (*eng_timeout) (struct ata_port *ap);
@@ -392,6 +381,8 @@ extern void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf);
 extern void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 extern void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf);
 extern void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf);
+extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp);
+extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf);
 extern u8 ata_check_status_pio(struct ata_port *ap);
 extern u8 ata_check_status_mmio(struct ata_port *ap);
 extern void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf);
@@ -400,10 +391,14 @@ extern int ata_port_start (struct ata_port *ap);
 extern void ata_port_stop (struct ata_port *ap);
 extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
 extern void ata_fill_sg(struct ata_queued_cmd *qc);
+extern void ata_dev_id_string(struct ata_device *dev, unsigned char *s,
+			      unsigned int ofs, unsigned int len);
+extern void ata_bmdma_setup_mmio (struct ata_queued_cmd *qc);
 extern void ata_bmdma_start_mmio (struct ata_queued_cmd *qc);
+extern void ata_bmdma_setup_pio (struct ata_queued_cmd *qc);
 extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc);
 extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
-extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_late);
+extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat);
 extern void ata_eng_timeout(struct ata_port *ap);
 extern int ata_std_bios_param(struct scsi_device *sdev,
 			      struct block_device *bdev,
@@ -411,11 +406,6 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
 extern int ata_scsi_slave_config(struct scsi_device *sdev);
 
 
-static inline unsigned long msecs_to_jiffies(unsigned long msecs)
-{
-	return ((HZ * msecs + 999) / 1000);
-}
-
 static inline unsigned int ata_tag_valid(unsigned int tag)
 {
 	return (tag < ATA_MAX_QUEUE) ? 1 : 0;
@@ -481,6 +471,12 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
 	return status;
 }
 
+static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
+{
+	qc->flags &= ~ATA_QCFLAG_DMA;
+	qc->tf.ctl |= ATA_NIEN;
+}
+
 static inline struct ata_queued_cmd *ata_qc_from_tag (struct ata_port *ap,
 						      unsigned int tag)
 {
diff --git a/include/linux/mca.h b/include/linux/mca.h
index b1289a792..554bbcf71 100644
--- a/include/linux/mca.h
+++ b/include/linux/mca.h
@@ -144,7 +144,7 @@ static inline void mca_do_proc_init(void)
 {
 }
 
-static inline void mca_set_adapter_procfn(int slot, MCA_ProcFn *fn, void* dev)
+static inline void mca_set_adapter_procfn(int slot, MCA_ProcFn fn, void* dev)
 {
 }
 #endif
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 9a5799601..c87b17ff2 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -9,6 +9,7 @@
 #define __LINUX_MII_H__
 
 #include <linux/types.h>
+#include <linux/if.h>
 
 /* Generic MII registers. */
 
@@ -144,6 +145,12 @@ struct mii_ioctl_data {
 };
 
 
+static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
+{
+	return (struct mii_ioctl_data *) &rq->ifr_ifru;
+}
+
+
 /**
  * mii_nway_result
  * @negotiated: value of MII ANAR and'd with ANLPAR
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index fe5dae18d..505544ae4 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -24,6 +24,7 @@
 #define MICROCODE_MINOR		184
 #define MWAVE_MINOR	219		/* ACP/Mwave Modem */
 #define MPT_MINOR	220
+#define CRASH_DUMP_MINOR   230		/* LKCD */
 #define MISC_DYNAMIC_MINOR 255
 
 #define SGI_GRAPHICS_MINOR   146
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 46c59a68a..8f8a8a3a3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -11,8 +11,12 @@
 #include <linux/list.h>
 #include <linux/mmzone.h>
 #include <linux/rbtree.h>
+#include <linux/prio_tree.h>
 #include <linux/fs.h>
 
+struct mempolicy;
+struct anon_vma;
+
 #ifndef CONFIG_DISCONTIGMEM          /* Don't use mapnrs, do it properly */
 extern unsigned long max_mapnr;
 #endif
@@ -44,9 +48,6 @@ extern int page_cluster;
  * per VM-area/task.  A VM area is any part of the process virtual memory
  * space that has a special rule for the page-fault handlers (ie a shared
  * library, the executable area etc).
- *
- * This structure is exactly 64 bytes on ia32.  Please think very, very hard
- * before adding anything to it.
  */
 struct vm_area_struct {
 	struct mm_struct * vm_mm;	/* The address space we belong to. */
@@ -64,10 +65,28 @@ struct vm_area_struct {
 
 	/*
 	 * For areas with an address space and backing store,
-	 * one of the address_space->i_mmap{,shared} lists,
-	 * for shm areas, the list of attaches, otherwise unused.
+	 * linkage into the address_space->i_mmap prio tree, or
+	 * linkage to the list of like vmas hanging off its node, or
+	 * linkage of vma in the address_space->i_mmap_nonlinear list.
+	 */
+	union {
+		struct {
+			struct list_head list;
+			void *parent;	/* aligns with prio_tree_node parent */
+			struct vm_area_struct *head;
+		} vm_set;
+
+		struct prio_tree_node prio_tree_node;
+	} shared;
+
+	/*
+	 * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma
+	 * list, after a COW of one of the file pages.  A MAP_SHARED vma
+	 * can only be in the i_mmap tree.  An anonymous MAP_PRIVATE, stack
+	 * or brk vma (with NULL file) can only be in an anon_vma list.
 	 */
-	struct list_head shared;
+	struct list_head anon_vma_node;	/* Serialized by anon_vma->lock */
+	struct anon_vma *anon_vma;	/* Serialized by page_table_lock */
 
 	/* Function pointers to deal with this struct. */
 	struct vm_operations_struct * vm_ops;
@@ -77,6 +96,10 @@ struct vm_area_struct {
 					   units, *not* PAGE_CACHE_SIZE */
 	struct file * vm_file;		/* File we map to (can be NULL). */
 	void * vm_private_data;		/* was vm_pte (shared mem) */
+
+#ifdef CONFIG_NUMA
+	struct mempolicy *vm_policy;	/* NUMA policy for the VMA */
+#endif
 };
 
 /*
@@ -112,9 +135,6 @@ struct vm_area_struct {
 #define VM_HUGETLB	0x00400000	/* Huge TLB Page VM */
 #define VM_NONLINEAR	0x00800000	/* Is non-linear (remap_file_pages) */
 
-/* It makes sense to apply VM_ACCOUNT to this vma. */
-#define VM_MAYACCT(vma) (!!((vma)->vm_flags & VM_HUGETLB))
-
 #ifndef VM_STACK_DEFAULT_FLAGS		/* arch can override this */
 #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
 #endif
@@ -148,10 +168,13 @@ struct vm_operations_struct {
 	void (*close)(struct vm_area_struct * area);
 	struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type);
 	int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock);
+#ifdef CONFIG_NUMA
+	int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
+	struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
+					unsigned long addr);
+#endif
 };
 
-/* forward declaration; pte_chain is meant to be internal to rmap.c */
-struct pte_chain;
 struct mmu_gather;
 struct inode;
 
@@ -166,34 +189,31 @@ typedef unsigned long page_flags_t;
  * it to keep track of whatever it is we are using the page for at the
  * moment. Note that we have no way to track which tasks are using
  * a page.
- *
- * Try to keep the most commonly accessed fields in single cache lines
- * here (16 bytes or greater).  This ordering should be particularly
- * beneficial on 32-bit processors.
- *
- * The first line is data used in page cache lookup, the second line
- * is used for linear searches (eg. clock algorithm scans). 
- *
- * TODO: make this structure smaller, it could be as small as 32 bytes.
  */
 struct page {
-	page_flags_t flags;		/* atomic flags, some possibly
-					   updated asynchronously */
-	atomic_t count;			/* Usage count, see below. */
-	struct address_space *mapping;	/* The inode (or ...) we belong to. */
-	pgoff_t index;			/* Our offset within mapping. */
-	struct list_head lru;		/* Pageout list, eg. active_list;
-					   protected by zone->lru_lock !! */
-	union {
-		struct pte_chain *chain;/* Reverse pte mapping pointer.
-					 * protected by PG_chainlock */
-		pte_addr_t direct;
-	} pte;
+	page_flags_t flags;		/* Atomic flags, some possibly
+					 * updated asynchronously */
+	atomic_t _count;		/* Usage count, see below. */
+	unsigned int mapcount;		/* Count of ptes mapped in mms,
+					 * to show when page is mapped
+					 * & limit reverse map searches,
+					 * protected by PG_maplock.
+					 */
 	unsigned long private;		/* Mapping-private opaque data:
 					 * usually used for buffer_heads
 					 * if PagePrivate set; used for
 					 * swp_entry_t if PageSwapCache
 					 */
+	struct address_space *mapping;	/* If PG_anon clear, points to
+					 * inode address_space, or NULL.
+					 * If page mapped as anonymous
+					 * memory, PG_anon is set, and
+					 * it points to anon_vma object.
+					 */
+	pgoff_t index;			/* Our offset within mapping. */
+	struct list_head lru;		/* Pageout list, eg. active_list
+					 * protected by zone->lru_lock !
+					 */
 	/*
 	 * On machines where all RAM is mapped into kernel address space,
 	 * we can simply calculate the virtual address. On machines with
@@ -227,15 +247,35 @@ struct page {
  *
  * Also, many kernel routines increase the page count before a critical
  * routine so they can be sure the page doesn't go away from under them.
+ *
+ * Since 2.6.6 (approx), a free page has ->_count = -1.  This is so that we
+ * can use atomic_add_negative(-1, page->_count) to detect when the page
+ * becomes free and so that we can also use atomic_inc_and_test to atomically
+ * detect when we just tried to grab a ref on a page which some other CPU has
+ * already deemed to be freeable.
+ *
+ * NO code should make assumptions about this internal detail!  Use the provided
+ * macros which retain the old rules: page_count(page) == 0 is a free page.
+ */
+
+/*
+ * Drop a ref, return true if the logical refcount fell to zero (the page has
+ * no users)
  */
 #define put_page_testzero(p)				\
 	({						\
 		BUG_ON(page_count(p) == 0);		\
-		atomic_dec_and_test(&(p)->count);	\
+		atomic_add_negative(-1, &(p)->_count);	\
 	})
 
-#define set_page_count(p,v) 	atomic_set(&(p)->count, v)
-#define __put_page(p)		atomic_dec(&(p)->count)
+/*
+ * Grab a ref, return true if the page previously had a logical refcount of
+ * zero.  ie: returns true if we just grabbed an already-deemed-to-be-free page
+ */
+#define get_page_testone(p)	atomic_inc_and_test(&(p)->_count)
+
+#define set_page_count(p,v) 	atomic_set(&(p)->_count, v - 1)
+#define __put_page(p)		atomic_dec(&(p)->_count)
 
 extern void FASTCALL(__page_cache_release(struct page *));
 
@@ -245,25 +285,25 @@ static inline int page_count(struct page *p)
 {
 	if (PageCompound(p))
 		p = (struct page *)p->private;
-	return atomic_read(&(p)->count);
+	return atomic_read(&(p)->_count) + 1;
 }
 
 static inline void get_page(struct page *page)
 {
 	if (unlikely(PageCompound(page)))
 		page = (struct page *)page->private;
-	atomic_inc(&page->count);
+	atomic_inc(&page->_count);
 }
 
 void put_page(struct page *page);
 
 #else		/* CONFIG_HUGETLB_PAGE */
 
-#define page_count(p)		atomic_read(&(p)->count)
+#define page_count(p)		(atomic_read(&(p)->_count) + 1)
 
 static inline void get_page(struct page *page)
 {
-	atomic_inc(&page->count);
+	atomic_inc(&page->_count);
 }
 
 static inline void put_page(struct page *page)
@@ -280,13 +320,13 @@ static inline void put_page(struct page *page)
  * zeroes, and text pages of executables and shared libraries have
  * only one copy in memory, at most, normally.
  *
- * For the non-reserved pages, page->count denotes a reference count.
- *   page->count == 0 means the page is free.
- *   page->count == 1 means the page is used for exactly one purpose
+ * For the non-reserved pages, page_count(page) denotes a reference count.
+ *   page_count() == 0 means the page is free.
+ *   page_count() == 1 means the page is used for exactly one purpose
  *   (e.g. a private data page of one process).
  *
  * A page may be used for kmalloc() or anyone else who does a
- * __get_free_page(). In this case the page->count is at least 1, and
+ * __get_free_page(). In this case the page_count() is at least 1, and
  * all other fields are unused but should be 0 or NULL. The
  * management of this page is the responsibility of the one who uses
  * it.
@@ -303,14 +343,14 @@ static inline void put_page(struct page *page)
  * page's address_space.  Usually, this is the address of a circular
  * list of the page's disk buffers.
  *
- * For pages belonging to inodes, the page->count is the number of
+ * For pages belonging to inodes, the page_count() is the number of
  * attaches, plus 1 if `private' contains something, plus one for
  * the page cache itself.
  *
  * All pages belonging to an inode are in these doubly linked lists:
  * mapping->clean_pages, mapping->dirty_pages and mapping->locked_pages;
  * using the page->list list_head. These fields are also used for
- * freelist managemet (when page->count==0).
+ * freelist managemet (when page_count()==0).
  *
  * There is also a per-mapping radix tree mapping index to the page
  * in memory if present. The tree is rooted at mapping->root.  
@@ -398,19 +438,35 @@ void page_address_init(void);
  * address_space which maps the page from disk; whereas "page_mapped"
  * refers to user virtual address space into which the page is mapped.
  */
+extern struct address_space swapper_space;
 static inline struct address_space *page_mapping(struct page *page)
 {
-	return PageAnon(page)? NULL: page->mapping;
+	struct address_space *mapping = NULL;
+
+	if (unlikely(PageSwapCache(page)))
+		mapping = &swapper_space;
+	else if (likely(!PageAnon(page)))
+		mapping = page->mapping;
+	return mapping;
+}
+
+/*
+ * Return the pagecache index of the passed page.  Regular pagecache pages
+ * use ->index whereas swapcache pages use ->private
+ */
+static inline pgoff_t page_index(struct page *page)
+{
+	if (unlikely(PageSwapCache(page)))
+		return page->private;
+	return page->index;
 }
 
 /*
- * Return true if this page is mapped into pagetables.  Subtle: test pte.direct
- * rather than pte.chain.  Because sometimes pte.direct is 64-bit, and .chain
- * is only 32-bit.
+ * Return true if this page is mapped into pagetables.
  */
 static inline int page_mapped(struct page *page)
 {
-	return page->pte.direct != 0;
+	return page->mapcount != 0;
 }
 
 /*
@@ -435,6 +491,9 @@ extern void show_free_areas(void);
 
 struct page *shmem_nopage(struct vm_area_struct * vma,
 			unsigned long address, int *type);
+int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new);
+struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
+					unsigned long addr);
 struct file *shmem_file_setup(char * name, loff_t size, unsigned long flags);
 void shmem_lock(struct file * file, int lock);
 int shmem_zero_setup(struct vm_area_struct *);
@@ -447,6 +506,7 @@ struct zap_details {
 	struct address_space *check_mapping;	/* Check page->mapping if set */
 	pgoff_t	first_index;			/* Lowest page->index to unmap */
 	pgoff_t last_index;			/* Highest page->index to unmap */
+	int atomic;				/* May not schedule() */
 };
 
 void zap_page_range(struct vm_area_struct *vma, unsigned long address,
@@ -478,8 +538,7 @@ extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, un
 extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
 extern int make_pages_present(unsigned long addr, unsigned long end);
 extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
-void put_dirty_page(struct task_struct *tsk, struct page *page,
-			unsigned long address, pgprot_t prot);
+void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
 
 int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
 		int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
@@ -538,12 +597,37 @@ extern void show_mem(void);
 extern void si_meminfo(struct sysinfo * val);
 extern void si_meminfo_node(struct sysinfo *val, int nid);
 
+static inline void vma_prio_tree_init(struct vm_area_struct *vma)
+{
+	vma->shared.vm_set.list.next = NULL;
+	vma->shared.vm_set.list.prev = NULL;
+	vma->shared.vm_set.parent = NULL;
+	vma->shared.vm_set.head = NULL;
+}
+
+/* prio_tree.c */
+void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old);
+void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *);
+void vma_prio_tree_remove(struct vm_area_struct *, struct prio_tree_root *);
+struct vm_area_struct *vma_prio_tree_next(
+	struct vm_area_struct *, struct prio_tree_root *,
+	struct prio_tree_iter *, pgoff_t begin, pgoff_t end);
+
 /* mmap.c */
+extern void vma_adjust(struct vm_area_struct *vma, unsigned long start,
+	unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert);
+extern struct vm_area_struct *vma_merge(struct mm_struct *,
+	struct vm_area_struct *prev, unsigned long addr, unsigned long end,
+	unsigned long vm_flags, struct anon_vma *, struct file *, pgoff_t,
+	struct mempolicy *);
+extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
+extern int split_vma(struct mm_struct *,
+	struct vm_area_struct *, unsigned long addr, int new_below);
 extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
 extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
 	struct rb_node **, struct rb_node *);
 extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
-	unsigned long addr, unsigned long len, unsigned long pgoff);
+	unsigned long addr, unsigned long len, pgoff_t pgoff);
 extern void exit_mmap(struct mm_struct *);
 
 extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
@@ -569,26 +653,6 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t);
 
 extern unsigned long do_brk(unsigned long, unsigned long);
 
-static inline void
-__vma_unlink(struct mm_struct *mm, struct vm_area_struct *vma,
-		struct vm_area_struct *prev)
-{
-	prev->vm_next = vma->vm_next;
-	rb_erase(&vma->vm_rb, &mm->mm_rb);
-	if (mm->mmap_cache == vma)
-		mm->mmap_cache = prev;
-}
-
-static inline int
-can_vma_merge(struct vm_area_struct *vma, unsigned long vm_flags)
-{
-#ifdef CONFIG_MMU
-	if (!vma->vm_file && vma->vm_flags == vm_flags)
-		return 1;
-#endif
-	return 0;
-}
-
 /* filemap.c */
 extern unsigned long page_unuse(struct page *);
 extern void truncate_inode_pages(struct address_space *, loff_t);
@@ -622,8 +686,6 @@ extern int expand_stack(struct vm_area_struct * vma, unsigned long address);
 extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
 extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
 					     struct vm_area_struct **pprev);
-extern int split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
-		     unsigned long addr, int new_below);
 
 /* Look up the first VMA which intersects the interval start_addr..end_addr-1,
    NULL if none.  Assume start_addr < end_addr. */
@@ -636,6 +698,11 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
 	return vma;
 }
 
+static inline unsigned long vma_pages(struct vm_area_struct *vma)
+{
+	return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+}
+
 extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr);
 
 extern unsigned int nr_used_zone_pages(void);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 51b8f3f67..f1e1a727a 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -52,6 +52,14 @@ struct per_cpu_pages {
 
 struct per_cpu_pageset {
 	struct per_cpu_pages pcp[2];	/* 0: hot.  1: cold */
+#ifdef CONFIG_NUMA
+	unsigned long numa_hit;		/* allocated in intended node */
+	unsigned long numa_miss;	/* allocated in non intended node */
+	unsigned long numa_foreign;	/* was intended here, hit elsewhere */
+	unsigned long interleave_hit; 	/* interleaver prefered this zone */
+	unsigned long local_node;	/* allocation from local node */
+	unsigned long other_node;	/* allocation from other node */
+#endif
 } ____cacheline_aligned_in_smp;
 
 #define ZONE_DMA		0
diff --git a/include/linux/module.h b/include/linux/module.h
index 0a86652fb..2709330e8 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -16,13 +16,14 @@
 #include <linux/kmod.h>
 #include <linux/elf.h>
 #include <linux/stringify.h>
+#include <linux/kobject.h>
+#include <linux/moduleparam.h>
 #include <asm/local.h>
 
 #include <asm/module.h>
 
 /* Not Yet Implemented */
 #define MODULE_SUPPORTED_DEVICE(name)
-#define print_modules()
 
 /* v850 toolchain uses a `_' prefix for all user symbols */
 #ifndef MODULE_SYMBOL_PREFIX
@@ -207,6 +208,23 @@ enum module_state
 	MODULE_STATE_GOING,
 };
 
+/* sysfs stuff */
+struct module_attribute
+{
+	struct attribute attr;
+	struct kernel_param *param;
+};
+
+struct module_kobject
+{
+	/* Everyone should have one of these. */
+	struct kobject kobj;
+
+	/* We always have refcnt, we may have others from module_param(). */
+	unsigned int num_attributes;
+	struct module_attribute attr[0];
+};
+
 struct module
 {
 	enum module_state state;
@@ -217,6 +235,9 @@ struct module
 	/* Unique handle for this module */
 	char name[MODULE_NAME_LEN];
 
+	/* Sysfs stuff. */
+	struct module_kobject *mkobj;
+
 	/* Exported symbols */
 	const struct kernel_symbol *syms;
 	unsigned int num_syms;
@@ -267,6 +288,9 @@ struct module
 
 	/* Destruction function. */
 	void (*exit)(void);
+
+	/* Fake kernel param for refcnt. */
+	struct kernel_param refcnt_param;
 #endif
 
 #ifdef CONFIG_KALLSYMS
@@ -400,6 +424,7 @@ const struct exception_table_entry *search_module_extables(unsigned long addr);
 int register_module_notifier(struct notifier_block * nb);
 int unregister_module_notifier(struct notifier_block * nb);
 
+extern void print_modules(void);
 #else /* !CONFIG_MODULES... */
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
@@ -480,6 +505,9 @@ static inline int unregister_module_notifier(struct notifier_block * nb)
 
 #define module_put_and_exit(code) do_exit(code)
 
+static inline void print_modules(void)
+{
+}
 #endif /* CONFIG_MODULES */
 
 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index e9d6a16d3..9e799ecc1 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -50,7 +50,7 @@ struct kparam_array
    not there, read bits mean it's readable, write bits mean it's
    writable. */
 #define __module_param_call(prefix, name, set, get, arg, perm)		\
-	static char __param_str_##name[] __initdata = prefix #name;	\
+	static char __param_str_##name[] = prefix #name;		\
 	static struct kernel_param const __param_##name			\
 	__attribute_used__						\
     __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
@@ -71,7 +71,7 @@ struct kparam_array
 
 /* Actually copy string: maxlen param is usually sizeof(string). */
 #define module_param_string(name, string, len, perm)			\
-	static struct kparam_string __param_string_##name __initdata	\
+	static struct kparam_string __param_string_##name		\
 		= { len, string };					\
 	module_param_call(name, param_set_copystring, param_get_charp,	\
 		   &__param_string_##name, perm)
@@ -147,4 +147,4 @@ int param_array(const char *name,
 		void *elem, int elemsize,
 		int (*set)(const char *, struct kernel_param *kp),
 		int *num);
-#endif /* _LINUX_MODULE_PARAM_TYPES_H */
+#endif /* _LINUX_MODULE_PARAMS_H */
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 755c0336a..e05d54a90 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -128,9 +128,9 @@ struct igmpmsg
 #ifdef __KERNEL__
 #include <net/sock.h>
 
-extern int ip_mroute_setsockopt(struct sock *, int, char *, int);
-extern int ip_mroute_getsockopt(struct sock *, int, char *, int *);
-extern int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg);
+extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
+extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
+extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
 extern void ip_mr_init(void);
 
 
diff --git a/include/linux/net.h b/include/linux/net.h
index 3d2cd0cec..a4684166d 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -217,9 +217,9 @@ SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \
 SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \
 SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \
 SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
-			 char *optval, int optlen), (sock, level, optname, optval, optlen)) \
+			 char __user *optval, int optlen), (sock, level, optname, optval, optlen)) \
 SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
-			 char *optval, int *optlen), (sock, level, optname, optval, optlen)) \
+			 char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \
 SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \
 	      (iocb, sock, m, len)) \
 SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len, int flags), \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6a821e7db..a55f97a34 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -215,6 +215,8 @@ struct hh_cache
  */
 #define LL_RESERVED_SPACE(dev) \
 	(((dev)->hard_header_len&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
+#define LL_RESERVED_SPACE_EXTRA(dev,extra) \
+	((((dev)->hard_header_len+extra)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
 
 /* These flag bits are private to the generic network queueing
  * layer, they may not be explicitly referenced by any other
@@ -556,7 +558,7 @@ extern int		dev_restart(struct net_device *dev);
 extern int		netpoll_trap(void);
 #endif
 
-typedef int gifconf_func_t(struct net_device * dev, char * bufptr, int len);
+typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
 extern int		register_gifconf(unsigned int family, gifconf_func_t * gifconf);
 static inline int unregister_gifconf(unsigned int family)
 {
@@ -674,7 +676,7 @@ static inline void dev_kfree_skb_any(struct sk_buff *skb)
 extern int		netif_rx(struct sk_buff *skb);
 #define HAVE_NETIF_RECEIVE_SKB 1
 extern int		netif_receive_skb(struct sk_buff *skb);
-extern int		dev_ioctl(unsigned int cmd, void *);
+extern int		dev_ioctl(unsigned int cmd, void __user *);
 extern int		dev_ethtool(struct ifreq *);
 extern unsigned		dev_get_flags(const struct net_device *);
 extern int		dev_change_flags(struct net_device *, unsigned);
@@ -941,7 +943,7 @@ extern int		weight_p;
 extern unsigned long	netdev_fc_xoff;
 extern atomic_t netdev_dropping;
 extern int		netdev_set_master(struct net_device *dev, struct net_device *master);
-extern struct sk_buff * skb_checksum_help(struct sk_buff *skb);
+extern int skb_checksum_help(struct sk_buff **pskb, int inward);
 #ifdef CONFIG_NET_FASTROUTE
 extern int		netdev_fastroute;
 extern int		netdev_fastroute_obstacles;
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index bbb389af9..b20c79258 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -64,11 +64,11 @@ struct nf_sockopt_ops
 	/* Non-inclusive ranges: use 0/0/NULL to never get called. */
 	int set_optmin;
 	int set_optmax;
-	int (*set)(struct sock *sk, int optval, void *user, unsigned int len);
+	int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
 
 	int get_optmin;
 	int get_optmax;
-	int (*get)(struct sock *sk, int optval, void *user, int *len);
+	int (*get)(struct sock *sk, int optval, void __user *user, int *len);
 
 	/* Number of users inside set() or get(). */
 	unsigned int use;
@@ -156,9 +156,9 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
 		 int (*okfn)(struct sk_buff *), int thresh);
 
 /* Call setsockopt() */
-int nf_setsockopt(struct sock *sk, int pf, int optval, char *opt, 
+int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, 
 		  int len);
-int nf_getsockopt(struct sock *sk, int pf, int optval, char *opt,
+int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt,
 		  int *len);
 
 /* Packet queuing */
@@ -171,6 +171,12 @@ extern void nf_reinject(struct sk_buff *skb,
 			struct nf_info *info,
 			unsigned int verdict);
 
+extern inline struct ipt_target *
+ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex);
+extern inline struct ip6t_target *
+ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex);
+extern inline struct arpt_target *
+arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex);
 extern void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *);
 
 #ifdef CONFIG_NETFILTER_DEBUG
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index d951537ba..78c4f7142 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -205,7 +205,7 @@ struct arpt_replace
 	/* Number of counters (must be equal to current number of entries). */
 	unsigned int num_counters;
 	/* The old entries' counters. */
-	struct arpt_counters *counters;
+	struct arpt_counters __user *counters;
 
 	/* The entries (hang off end: not really an array). */
 	struct arpt_entry entries[0];
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index fb557e487..f43f1ddde 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -252,7 +252,7 @@ struct ipt_replace
 	/* Number of counters (must be equal to current number of entries). */
 	unsigned int num_counters;
 	/* The old entries' counters. */
-	struct ipt_counters *counters;
+	struct ipt_counters __user *counters;
 
 	/* The entries (hang off end: not really an array). */
 	struct ipt_entry entries[0];
@@ -283,6 +283,8 @@ struct ipt_get_entries
 	struct ipt_entry entrytable[0];
 };
 
+extern struct semaphore ipt_mutex;
+
 /* Standard return verdict, or do jump. */
 #define IPT_STANDARD_TARGET ""
 /* Error verdict. */
@@ -334,6 +336,7 @@ ipt_get_target(struct ipt_entry *e)
 /*
  *	Main firewall chains definitions and global var's definitions.
  */
+static DECLARE_MUTEX(ipt_mutex);
 #ifdef __KERNEL__
 
 #include <linux/init.h>
@@ -406,6 +409,11 @@ struct ipt_target
 	struct module *me;
 };
 
+extern struct ipt_target *
+ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex);
+extern struct arpt_target *
+arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex);
+
 extern int ipt_register_target(struct ipt_target *target);
 extern void ipt_unregister_target(struct ipt_target *target);
 
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 3b6ac2013..a09952719 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -106,6 +106,8 @@ struct ip6t_counters
 	u_int64_t pcnt, bcnt;			/* Packet and byte counters */
 };
 
+static DECLARE_MUTEX(ip6t_mutex);
+
 /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
 #define IP6T_F_PROTO		0x01	/* Set if rule cares about upper 
 					   protocols */
@@ -258,7 +260,7 @@ struct ip6t_replace
 	/* Number of counters (must be equal to current number of entries). */
 	unsigned int num_counters;
 	/* The old entries' counters. */
-	struct ip6t_counters *counters;
+	struct ip6t_counters __user *counters;
 
 	/* The entries (hang off end: not really an array). */
 	struct ip6t_entry entries[0];
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8b49e4be6..0fd3f8178 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -306,6 +306,10 @@ nfs_file_cred(struct file *file)
  */
 extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
 			unsigned long);
+extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf,
+			size_t count, loff_t pos);
+extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf,
+			size_t count, loff_t pos);
 
 /*
  * linux/fs/nfs/dir.c
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 204294616..6bad4766d 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -110,6 +110,10 @@ static inline void exp_put(struct svc_export *exp)
 	svc_export_put(&exp->h, &svc_export_cache);
 }
 
+static inline void exp_get(struct svc_export *exp)
+{
+	cache_get(&exp->h);
+}
 static inline struct svc_export *
 exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
 	 struct cache_req *reqp)
@@ -118,10 +122,9 @@ exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
 	if (ek && !IS_ERR(ek)) {
 		struct svc_export *exp = ek->ek_export;
 		int err;
-		cache_get(&exp->h);
+		exp_get(exp);
 		expkey_put(&ek->h, &svc_expkey_cache);
-		if (exp &&
-		    (err = cache_check(&svc_export_cache, &exp->h, reqp)))
+		if ((err = cache_check(&svc_export_cache, &exp->h, reqp)))
 			exp = ERR_PTR(err);
 		return exp;
 	} else
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index cd9c59cf9..e18185256 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -199,6 +199,7 @@ void		nfsd_lockd_shutdown(void);
 #define	nfserr_grace		__constant_htonl(NFSERR_GRACE)
 #define	nfserr_no_grace		__constant_htonl(NFSERR_NO_GRACE)
 #define	nfserr_reclaim_bad	__constant_htonl(NFSERR_RECLAIM_BAD)
+#define	nfserr_badname		__constant_htonl(NFSERR_BADNAME)
 
 /* error codes for internal use */
 /* if a request fails due to kmalloc failure, it gets dropped.
@@ -280,7 +281,7 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
  | FATTR4_WORD1_OWNER	        | FATTR4_WORD1_OWNER_GROUP  | FATTR4_WORD1_RAWDEV           \
  | FATTR4_WORD1_SPACE_AVAIL     | FATTR4_WORD1_SPACE_FREE   | FATTR4_WORD1_SPACE_TOTAL      \
  | FATTR4_WORD1_SPACE_USED      | FATTR4_WORD1_TIME_ACCESS  | FATTR4_WORD1_TIME_ACCESS_SET  \
- | FATTR4_WORD1_TIME_CREATE     | FATTR4_WORD1_TIME_DELTA   | FATTR4_WORD1_TIME_METADATA    \
+ | FATTR4_WORD1_TIME_DELTA   | FATTR4_WORD1_TIME_METADATA    \
  | FATTR4_WORD1_TIME_MODIFY     | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID)
 
 /* These will return ERR_INVAL if specified in GETATTR or READDIR. */
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 1240afe79..13afff346 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -170,6 +170,7 @@ struct nfsd3_readdirres {
 	u32 *			buffer;
 	int			buflen;
 	u32 *			offset;
+	u32 *			offset1;
 	struct svc_rqst *	rqstp;
 
 };
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 9555dd4d6..80cfea0fa 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -86,19 +86,19 @@ struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
  * Write the given asciz string to the given user buffer @buf, updating *offset
  * appropriately. Returns bytes written or -EFAULT.
  */
-ssize_t oprofilefs_str_to_user(char const * str, char * buf, size_t count, loff_t * offset);
+ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count, loff_t * offset);
 
 /**
  * Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
  * updating *offset appropriately. Returns bytes written or -EFAULT.
  */
-ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset);
+ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t count, loff_t * offset);
 
 /**
  * Read an ASCII string for a number from a userspace buffer and fill *val on success.
  * Returns 0 on success, < 0 on error.
  */
-int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t count);
+int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count);
 
 /** lock for read/write safety */
 extern spinlock_t oprofilefs_lock;
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6959827c9..1d376d042 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -71,12 +71,12 @@
 #define PG_nosave		14	/* Used for system suspend/resume */
 #define PG_maplock		15	/* Lock bit for rmap to ptes */
 
-#define PG_direct		16	/* ->pte_chain points directly at pte */
+#define PG_swapcache		16	/* Swap page: swp_entry_t in private */
 #define PG_mappedtodisk		17	/* Has blocks allocated on-disk */
 #define PG_reclaim		18	/* To be reclaimed asap */
 #define PG_compound		19	/* Part of a compound page */
-#define PG_anon			20	/* Anonymous page: anon_vma in mapping*/
-#define PG_swapcache		21	/* Swap page: swp_entry_t in private */
+
+#define PG_anon			20	/* Anonymous: anon_vma in mapping */
 
 
 /*
@@ -133,12 +133,16 @@ struct page_state {
 	unsigned long allocstall;	/* direct reclaim calls */
 
 	unsigned long pgrotated;	/* pages rotated to tail of the LRU */
-} ____cacheline_aligned;
+};
 
 DECLARE_PER_CPU(struct page_state, page_states);
 
 extern void get_page_state(struct page_state *ret);
 extern void get_full_page_state(struct page_state *ret);
+extern unsigned long __read_page_state(unsigned offset);
+
+#define read_page_state(member) \
+	__read_page_state(offsetof(struct page_state, member))
 
 #define mod_page_state(member, delta)					\
 	do {								\
@@ -281,12 +285,6 @@ extern void get_full_page_state(struct page_state *ret);
 #define ClearPageNosave(page)		clear_bit(PG_nosave, &(page)->flags)
 #define TestClearPageNosave(page)	test_and_clear_bit(PG_nosave, &(page)->flags)
 
-#define PageDirect(page)	test_bit(PG_direct, &(page)->flags)
-#define SetPageDirect(page)	set_bit(PG_direct, &(page)->flags)
-#define TestSetPageDirect(page)	test_and_set_bit(PG_direct, &(page)->flags)
-#define ClearPageDirect(page)		clear_bit(PG_direct, &(page)->flags)
-#define TestClearPageDirect(page)	test_and_clear_bit(PG_direct, &(page)->flags)
-
 #define PageMappedToDisk(page)	test_bit(PG_mappedtodisk, &(page)->flags)
 #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
 #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e5acf3596..427b696f4 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -220,13 +220,13 @@ static inline void fault_in_pages_readable(const char __user *uaddr, int size)
 	volatile char c;
 	int ret;
 
-	ret = __get_user(c, (char *)uaddr);
+	ret = __get_user(c, uaddr);
 	if (ret == 0) {
 		const char __user *end = uaddr + size - 1;
 
 		if (((unsigned long)uaddr & PAGE_MASK) !=
 				((unsigned long)end & PAGE_MASK))
-		 	__get_user(c, (char *)end);
+		 	__get_user(c, end);
 	}
 }
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e06685a1f..2662f462b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -488,6 +488,11 @@ struct pci_dev {
 	/* These fields are used by common fixups */
 	unsigned int	transparent:1;	/* Transparent PCI bridge */
 	unsigned int	multifunction:1;/* Part of multi-function device */
+	/* keep track of device state */
+	unsigned int	is_enabled:1;	/* pci_enable_device has been called */
+	unsigned int	is_busmaster:1; /* device is busmaster */
+	
+	unsigned int 	saved_config_space[16]; /* config space saved at suspend time */
 #ifdef CONFIG_PCI_NAMES
 #define PCI_NAME_SIZE	96
 #define PCI_NAME_HALF	__stringify(43)	/* less than half to handle slop */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 8e3bbbe83..2a1a53f90 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -373,6 +373,7 @@
 #define PCI_DEVICE_ID_NS_SCx200_AUDIO	0x0503
 #define PCI_DEVICE_ID_NS_SCx200_VIDEO	0x0504
 #define PCI_DEVICE_ID_NS_SCx200_XBUS	0x0505
+#define PCI_DEVICE_ID_NS_SC1100_BRIDGE	0x0510
 #define PCI_DEVICE_ID_NS_87410		0xd001
 
 #define PCI_VENDOR_ID_TSENG		0x100c
@@ -435,7 +436,9 @@
 #define PCI_DEVICE_ID_IBM_CPC710_PCI64	0x00fc
 #define PCI_DEVICE_ID_IBM_CPC710_PCI32	0x0105
 #define	PCI_DEVICE_ID_IBM_405GP		0x0156
+#define PCI_DEVICE_ID_IBM_SNIPE		0x0180
 #define PCI_DEVICE_ID_IBM_SERVERAIDI960	0x01bd
+#define PCI_DEVICE_ID_IBM_GEMSTONE		0xB166
 #define PCI_DEVICE_ID_IBM_MPIC_2	0xffff
 
 #define PCI_VENDOR_ID_COMPEX2		0x101a // pci.ids says "AT&T GIS (NCR)"
@@ -479,6 +482,7 @@
 #	define PCI_DEVICE_ID_AMD_VIPER_7441	PCI_DEVICE_ID_AMD_OPUS_7441
 #define PCI_DEVICE_ID_AMD_OPUS_7443	0x7443
 #	define PCI_DEVICE_ID_AMD_VIPER_7443	PCI_DEVICE_ID_AMD_OPUS_7443
+#define PCI_DEVICE_ID_AMD_OPUS_7445	0x7445
 #define PCI_DEVICE_ID_AMD_OPUS_7448	0x7448
 # define	PCI_DEVICE_ID_AMD_VIPER_7448	PCI_DEVICE_ID_AMD_OPUS_7448
 #define PCI_DEVICE_ID_AMD_OPUS_7449	0x7449
@@ -572,7 +576,6 @@
 #define PCI_DEVICE_ID_SI_503		0x0008
 #define PCI_DEVICE_ID_SI_ACPI		0x0009
 #define PCI_DEVICE_ID_SI_LPC		0x0018
-#define PCI_DEVICE_ID_SI_180		0x0180
 #define PCI_DEVICE_ID_SI_5597_VGA	0x0200
 #define PCI_DEVICE_ID_SI_6205		0x0205
 #define PCI_DEVICE_ID_SI_501		0x0406
@@ -636,6 +639,7 @@
 #define PCI_DEVICE_ID_SI_6306		0x6306
 #define PCI_DEVICE_ID_SI_6326		0x6326
 #define PCI_DEVICE_ID_SI_7001		0x7001
+#define PCI_DEVICE_ID_SI_7012		0x7012
 #define PCI_DEVICE_ID_SI_7016		0x7016
 
 #define PCI_VENDOR_ID_HP		0x103c
@@ -726,6 +730,7 @@
 #define PCI_DEVICE_ID_TI_1410		0xac50
 #define PCI_DEVICE_ID_TI_1420		0xac51
 #define PCI_DEVICE_ID_TI_1451A		0xac52
+#define PCI_DEVICE_ID_TI_1620		0xac54
 #define PCI_DEVICE_ID_TI_1520		0xac55
 #define PCI_DEVICE_ID_TI_1510		0xac56
 
@@ -1054,11 +1059,19 @@
 #define PCI_DEVICE_ID_NVIDIA_UTNT2		0x0029
 #define PCI_DEVICE_ID_NVIDIA_VTNT2		0x002C
 #define PCI_DEVICE_ID_NVIDIA_UVTNT2		0x002D
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE	0x0035
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA	0x0036
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2	0x003e
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE	0x0053
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA	0x0054
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2	0x0055
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE	0x0065
+#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO		0x006a
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE	0x0085
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA	0x008e
 #define PCI_DEVICE_ID_NVIDIA_ITNT2		0x00A0
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3		0x00d1
+#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO		0x00da
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S  		0x00e1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE	0x00d5
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA	0x00e3
@@ -1088,6 +1101,7 @@
 #define PCI_DEVICE_ID_NVIDIA_QUADRO4_500_GOGL	0x017C
 #define PCI_DEVICE_ID_NVIDIA_IGEFORCE2		0x01a0
 #define PCI_DEVICE_ID_NVIDIA_NFORCE		0x01a4
+#define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO		0x01b1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE		0x01bc
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2		0x01e0
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE3		0x0200
@@ -1642,8 +1656,8 @@
 #define PCI_SUBDEVICE_ID_CHASE_PCIRAS8		0xF010
 
 #define PCI_VENDOR_ID_AUREAL		0x12eb
-#define PCI_DEVICE_ID_AUREAL_VORTEX	0x0001
-#define PCI_DEVICE_ID_AUREAL_VORTEX2	0x0002
+#define PCI_DEVICE_ID_AUREAL_VORTEX_1	0x0001
+#define PCI_DEVICE_ID_AUREAL_VORTEX_2	0x0002
 #define PCI_DEVICE_ID_AUREAL_ADVANTAGE	0x0003
 
 #define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8
@@ -1832,11 +1846,19 @@
 #define PCI_DEVICE_ID_TIGON3_5702FE	0x164d
 #define PCI_DEVICE_ID_TIGON3_5705	0x1653
 #define PCI_DEVICE_ID_TIGON3_5705_2	0x1654
+#define PCI_DEVICE_ID_TIGON3_5720	0x1658
+#define PCI_DEVICE_ID_TIGON3_5721	0x1659
 #define PCI_DEVICE_ID_TIGON3_5705M	0x165d
 #define PCI_DEVICE_ID_TIGON3_5705M_2	0x165e
 #define PCI_DEVICE_ID_TIGON3_5705F	0x166e
+#define PCI_DEVICE_ID_TIGON3_5750	0x1676
+#define PCI_DEVICE_ID_TIGON3_5751	0x1677
+#define PCI_DEVICE_ID_TIGON3_5750M	0x167c
+#define PCI_DEVICE_ID_TIGON3_5751M	0x167d
+#define PCI_DEVICE_ID_TIGON3_5751F	0x167e
 #define PCI_DEVICE_ID_TIGON3_5782	0x1696
 #define PCI_DEVICE_ID_TIGON3_5788	0x169c
+#define PCI_DEVICE_ID_TIGON3_5789	0x169d
 #define PCI_DEVICE_ID_TIGON3_5702X	0x16a6
 #define PCI_DEVICE_ID_TIGON3_5703X	0x16a7
 #define PCI_DEVICE_ID_TIGON3_5704S	0x16a8
@@ -1864,6 +1886,11 @@
 #define PCI_VENDOR_ID_ZOLTRIX		0x15b0
 #define PCI_DEVICE_ID_ZOLTRIX_2BD0	0x2bd0 
 
+#define PCI_VENDOR_ID_MELLANOX		0x15b3
+#define PCI_DEVICE_ID_MELLANOX_TAVOR	0x5a44
+#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
+#define PCI_DEVICE_ID_MELLANOX_ARBEL	0x6282
+
 #define PCI_VENDOR_ID_PDC		0x15e9
 #define PCI_DEVICE_ID_PDC_1841		0x1841
 
@@ -1875,6 +1902,15 @@
 #define PCI_DEVICE_ID_MACROLINK_MCCR8	0x2000
 #define PCI_DEVICE_ID_MACROLINK_MCCR	0x2001
 
+#define PCI_VENDOR_ID_FARSITE           0x1619
+#define PCI_DEVICE_ID_FARSITE_T2P       0x0400
+#define PCI_DEVICE_ID_FARSITE_T4P       0x0440
+#define PCI_DEVICE_ID_FARSITE_T1U       0x0610
+#define PCI_DEVICE_ID_FARSITE_T2U       0x0620
+#define PCI_DEVICE_ID_FARSITE_T4U       0x0640
+#define PCI_DEVICE_ID_FARSITE_TE1       0x1610
+#define PCI_DEVICE_ID_FARSITE_TE1C      0x1612
+
 #define PCI_VENDOR_ID_ALTIMA		0x173b
 #define PCI_DEVICE_ID_ALTIMA_AC1000	0x03e8
 #define PCI_DEVICE_ID_ALTIMA_AC1001	0x03e9
@@ -1885,6 +1921,10 @@
 #define	PCI_DEVICE_ID_S2IO_WIN		0x5731
 #define	PCI_DEVICE_ID_S2IO_UNI		0x5831
 
+#define PCI_VENDOR_ID_INFINICON		0x1820
+
+#define PCI_VENDOR_ID_TOPSPIN		0x1867
+
 #define PCI_VENDOR_ID_ARC               0x192E
 #define PCI_DEVICE_ID_ARC_EHCI          0x0101
 
@@ -2058,7 +2098,6 @@
 #define PCI_DEVICE_ID_INTEL_82801EB_7	0x24d7
 #define PCI_DEVICE_ID_INTEL_82801EB_11	0x24db
 #define PCI_DEVICE_ID_INTEL_82801EB_13	0x24dd
-#define PCI_DEVICE_ID_INTEL_ESB_0	0x25a0
 #define PCI_DEVICE_ID_INTEL_ESB_1	0x25a1
 #define PCI_DEVICE_ID_INTEL_ESB_2	0x25a2
 #define PCI_DEVICE_ID_INTEL_ESB_3	0x25a3
@@ -2084,8 +2123,24 @@
 #define PCI_DEVICE_ID_INTEL_82875_IG	0x257b
 #define PCI_DEVICE_ID_INTEL_ICH6_0	0x2640
 #define PCI_DEVICE_ID_INTEL_ICH6_1	0x2641
-#define PCI_DEVICE_ID_INTEL_ICH6_2	0x266f
-#define PCI_DEVICE_ID_INTEL_ICH6_3	0x266e
+#define PCI_DEVICE_ID_INTEL_ICH6_2	0x2642
+#define PCI_DEVICE_ID_INTEL_ICH6_3	0x2651
+#define PCI_DEVICE_ID_INTEL_ICH6_4	0x2652
+#define PCI_DEVICE_ID_INTEL_ICH6_5	0x2653
+#define PCI_DEVICE_ID_INTEL_ICH6_6	0x2658
+#define PCI_DEVICE_ID_INTEL_ICH6_7	0x2659
+#define PCI_DEVICE_ID_INTEL_ICH6_8	0x265a
+#define PCI_DEVICE_ID_INTEL_ICH6_9	0x265b
+#define PCI_DEVICE_ID_INTEL_ICH6_10	0x265c
+#define PCI_DEVICE_ID_INTEL_ICH6_11	0x2660
+#define PCI_DEVICE_ID_INTEL_ICH6_12	0x2662
+#define PCI_DEVICE_ID_INTEL_ICH6_13	0x2664
+#define PCI_DEVICE_ID_INTEL_ICH6_14	0x2666
+#define PCI_DEVICE_ID_INTEL_ICH6_15	0x2668
+#define PCI_DEVICE_ID_INTEL_ICH6_16	0x266a
+#define PCI_DEVICE_ID_INTEL_ICH6_17	0x266d
+#define PCI_DEVICE_ID_INTEL_ICH6_18	0x266e
+#define PCI_DEVICE_ID_INTEL_ICH6_19	0x266f
 #define PCI_DEVICE_ID_INTEL_82855PM_HB	0x3340
 #define PCI_DEVICE_ID_INTEL_82830_HB	0x3575
 #define PCI_DEVICE_ID_INTEL_82830_CGC	0x3577
@@ -2113,6 +2168,7 @@
 #define PCI_DEVICE_ID_INTEL_82443BX_0	0x7190
 #define PCI_DEVICE_ID_INTEL_82443BX_1	0x7191
 #define PCI_DEVICE_ID_INTEL_82443BX_2	0x7192
+#define PCI_DEVICE_ID_INTEL_440MX	0x7195
 #define PCI_DEVICE_ID_INTEL_82443MX_0	0x7198
 #define PCI_DEVICE_ID_INTEL_82443MX_1	0x7199
 #define PCI_DEVICE_ID_INTEL_82443MX_2	0x719a
@@ -2129,6 +2185,7 @@
 #define PCI_DEVICE_ID_INTEL_82451NX	0x84ca
 #define PCI_DEVICE_ID_INTEL_82454NX     0x84cb
 #define PCI_DEVICE_ID_INTEL_84460GX	0x84ea
+#define	PCI_DEVICE_ID_INTEL_IXP4XX	0x8500
 
 #define PCI_VENDOR_ID_COMPUTONE		0x8e0e
 #define PCI_DEVICE_ID_COMPUTONE_IP2EX	0x0291
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 11977de5d..f54111f9d 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -24,11 +24,12 @@ enum
 	TCA_POLICE_RATE,
 	TCA_POLICE_PEAKRATE,
 	TCA_POLICE_AVRATE,
-	TCA_POLICE_RESULT
+	TCA_POLICE_RESULT,
 #define TCA_POLICE_RESULT TCA_POLICE_RESULT
+	__TCA_POLICE_MAX
 };
 
-#define TCA_POLICE_MAX TCA_POLICE_RESULT
+#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
 
 /* U32 filters */
 
@@ -49,9 +50,10 @@ enum
 	TCA_U32_DIVISOR,
 	TCA_U32_SEL,
 	TCA_U32_POLICE,
+	__TCA_U32_MAX
 };
 
-#define TCA_U32_MAX TCA_U32_POLICE
+#define TCA_U32_MAX (__TCA_U32_MAX - 1)
 
 struct tc_u32_key
 {
@@ -97,9 +99,10 @@ enum
 	TCA_RSVP_SRC,
 	TCA_RSVP_PINFO,
 	TCA_RSVP_POLICE,
+	__TCA_RSVP_MAX
 };
 
-#define TCA_RSVP_MAX TCA_RSVP_POLICE
+#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1)
 
 struct tc_rsvp_gpi
 {
@@ -127,9 +130,10 @@ enum
 	TCA_ROUTE4_FROM,
 	TCA_ROUTE4_IIF,
 	TCA_ROUTE4_POLICE,
+	__TCA_ROUTE4_MAX
 };
 
-#define TCA_ROUTE4_MAX TCA_ROUTE4_POLICE
+#define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
 
 
 /* FW filter */
@@ -139,9 +143,10 @@ enum
 	TCA_FW_UNSPEC,
 	TCA_FW_CLASSID,
 	TCA_FW_POLICE,
+	__TCA_FW_MAX
 };
 
-#define TCA_FW_MAX TCA_FW_POLICE
+#define TCA_FW_MAX (__TCA_FW_MAX - 1)
 
 /* TC index filter */
 
@@ -154,8 +159,9 @@ enum
 	TCA_TCINDEX_FALL_THROUGH,
 	TCA_TCINDEX_CLASSID,
 	TCA_TCINDEX_POLICE,
+	__TCA_TCINDEX_MAX
 };
 
-#define TCA_TCINDEX_MAX        TCA_TCINDEX_POLICE
+#define TCA_TCINDEX_MAX        (__TCA_TCINDEX_MAX - 1)
 
 #endif
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 3017bdef5..66e62c0df 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -229,8 +229,9 @@ extern int pm_suspend(u32 state);
 struct device;
 
 struct dev_pm_info {
-#ifdef	CONFIG_PM
 	u32			power_state;
+#ifdef	CONFIG_PM
+	u32			prev_state;
 	u8			* saved_state;
 	atomic_t		pm_users;
 	struct device		* pm_parent;
diff --git a/include/linux/quota.h b/include/linux/quota.h
index bbd9134ab..506d52452 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -250,6 +250,8 @@ struct dquot_operations {
 	int (*free_inode) (const struct inode *, unsigned long);
 	int (*transfer) (struct inode *, struct iattr *);
 	int (*write_dquot) (struct dquot *);		/* Ordinary dquot write */
+	int (*acquire_dquot) (struct dquot *);		/* Quota is going to be created on disk */
+	int (*release_dquot) (struct dquot *);		/* Quota is going to be deleted from disk */
 	int (*mark_dirty) (struct dquot *);		/* Dquot is marked dirty */
 	int (*write_info) (struct super_block *, int);	/* Write of quota "superblock" */
 };
diff --git a/include/linux/quotaio_v2.h b/include/linux/quotaio_v2.h
index da4e02730..f18ced911 100644
--- a/include/linux/quotaio_v2.h
+++ b/include/linux/quotaio_v2.h
@@ -59,7 +59,7 @@ struct v2_disk_dqinfo {
 
 /*
  *  Structure of header of block with quota structures. It is padded to 16 bytes so
- *  there will be space for exactly 18 quota-entries in a block
+ *  there will be space for exactly 21 quota-entries in a block
  */
 struct v2_disk_dqdbheader {
 	__u32 dqdh_next_free;	/* Number of next block with free entry */
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 0b6b5e6f3..faa400cf2 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -255,6 +255,14 @@ struct mddev_s
 	struct list_head		all_mddevs;
 };
 
+
+static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev)
+{
+	int faulty = rdev->faulty;
+	if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
+		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+}
+
 struct mdk_personality_s
 {
 	char *name;
@@ -271,6 +279,8 @@ struct mdk_personality_s
 	int (*hot_remove_disk) (mddev_t *mddev, int number);
 	int (*spare_active) (mddev_t *mddev);
 	int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster);
+	int (*resize) (mddev_t *mddev, sector_t sectors);
+	int (*reshape) (mddev_t *mddev, int raid_disks);
 };
 
 
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 96abcad3a..50965d968 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -10,6 +10,20 @@ struct mirror_info {
 	sector_t	head_position;
 };
 
+/*
+ * memory pools need a pointer to the mddev, so they can force an unplug
+ * when memory is tight, and a count of the number of drives that the
+ * pool was allocated for, so they know how much to allocate and free.
+ * mddev->raid_disks cannot be used, as it can change while a pool is active
+ * These two datums are stored in a kmalloced struct.
+ */
+
+struct pool_info {
+	mddev_t *mddev;
+	int	raid_disks;
+};
+
+
 typedef struct r1bio_s r1bio_t;
 
 struct r1_private_data_s {
@@ -31,6 +45,8 @@ struct r1_private_data_s {
 	wait_queue_head_t	wait_idle;
 	wait_queue_head_t	wait_resume;
 
+	struct pool_info	*poolinfo;
+
 	mempool_t *r1bio_pool;
 	mempool_t *r1buf_pool;
 };
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index 1cabc4d80..baf88d2ad 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -181,7 +181,7 @@ struct stripe_head {
  * is put on a "delayed" queue until there are no stripes currently
  * in a pre-read phase.  Further, if the "delayed" queue is empty when
  * a stripe is put on it then we "plug" the queue and do not process it
- * until an unplug call is made. (blk_run_queues is run).
+ * until an unplug call is made. (the unplug_io_fn() is called).
  *
  * When preread is initiated on a stripe, we set PREREAD_ACTIVE and add
  * it to the count of prereading stripes.
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index b73b84d51..d60fafc8b 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -22,6 +22,7 @@
  * POWER_OFF   Stop OS and remove all power from system, if possible.
  * RESTART2    Restart system using given command string.
  * SW_SUSPEND  Suspend system using software suspend if compiled in.
+ * KEXEC       Restart system using a previously loaded Linux kernel
  */
 
 #define	LINUX_REBOOT_CMD_RESTART	0x01234567
@@ -31,6 +32,7 @@
 #define	LINUX_REBOOT_CMD_POWER_OFF	0x4321FEDC
 #define	LINUX_REBOOT_CMD_RESTART2	0xA1B2C3D4
 #define	LINUX_REBOOT_CMD_SW_SUSPEND	0xD000FCE2
+#define	LINUX_REBOOT_CMD_KEXEC		0x45584543
 
 
 #ifdef __KERNEL__
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index dfb46b513..8132a6ec9 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -75,6 +75,7 @@
 */
 #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ 
 
+void reiserfs_warning (struct super_block *s, const char * fmt, ...);
 /* assertions handling */
 
 /** always check a condition and panic if it's false. */
@@ -268,6 +269,7 @@ int is_reiserfs_jr (struct reiserfs_super_block * rs);
 #define NO_DISK_SPACE -3
 #define NO_BALANCING_NEEDED  (-4)
 #define NO_MORE_UNUSED_CONTIGUOUS_BLOCKS (-5)
+#define QUOTA_EXCEEDED -6
 
 typedef __u32 b_blocknr_t;
 typedef __u32 unp_t;
@@ -287,7 +289,7 @@ struct unfm_nodeinfo {
 #define STAT_DATA_V2 1
 
 
-static inline struct reiserfs_inode_info *REISERFS_I(struct inode *inode)
+static inline struct reiserfs_inode_info *REISERFS_I(const struct inode *inode)
 {
 	return container_of(inode, struct reiserfs_inode_info, vfs_inode);
 }
@@ -561,9 +563,6 @@ struct item_head
 #define V1_DIRENTRY_UNIQUENESS 500
 #define V1_ANY_UNIQUENESS 555 // FIXME: comment is required
 
-extern void reiserfs_warning (const char * fmt, ...);
-/* __attribute__( ( format ( printf, 1, 2 ) ) ); */
-
 //
 // here are conversion routines
 //
@@ -576,7 +575,8 @@ static inline int uniqueness2type (__u32 uniqueness)
     case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT;
     case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY;
     default:
-	    reiserfs_warning( "vs-500: unknown uniqueness %d\n", uniqueness);
+	    reiserfs_warning (NULL, "vs-500: unknown uniqueness %d",
+			      uniqueness);
 	case V1_ANY_UNIQUENESS:
 	    return TYPE_ANY;
     }
@@ -591,7 +591,7 @@ static inline __u32 type2uniqueness (int type)
     case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS;
     case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS;
     default:
-	    reiserfs_warning( "vs-501: unknown type %d\n", type);
+	    reiserfs_warning (NULL, "vs-501: unknown type %d", type);
 	case TYPE_ANY:
 	    return V1_ANY_UNIQUENESS;
     }
@@ -1238,7 +1238,6 @@ excessive effort to avoid disturbing the precious VFS code.:-( The
 gods only know how we are going to SMP the code that uses them.
 znodes are the way! */
 
-
 struct  path {
   int                   path_length;                      	/* Length of the array above.   */
   struct  path_element  path_elements[EXTENDED_MAX_HEIGHT];	/* Array of the path elements.  */
@@ -1771,7 +1770,7 @@ void reiserfs_update_inode_transaction(struct inode *) ;
 void reiserfs_wait_on_write_block(struct super_block *s) ;
 void reiserfs_block_writes(struct reiserfs_transaction_handle *th) ;
 void reiserfs_allow_writes(struct super_block *s) ;
-void reiserfs_check_lock_depth(char *caller) ;
+void reiserfs_check_lock_depth(struct super_block *s, char *caller) ;
 int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ;
 void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ;
 int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ;
@@ -1889,11 +1888,13 @@ void pathrelse_and_restore (struct super_block *s, struct path * p_s_search_path
 int reiserfs_insert_item (struct reiserfs_transaction_handle *th, 
 			  struct path * path, 
 			  const struct cpu_key * key,
-			  struct item_head * ih, const char * body);
+			  struct item_head * ih,
+			  struct inode *inode, const char * body);
 
 int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th,
 			      struct path * path,
 			      const struct cpu_key * key,
+			      struct inode *inode,
 			      const char * body, int paste_size);
 
 int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
@@ -1910,7 +1911,7 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 			  struct buffer_head  * p_s_un_bh);
 
 void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
-                                                                struct key * key);
+				 struct inode *inode, struct key * key);
 void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode);
 void reiserfs_do_truncate (struct reiserfs_transaction_handle *th, 
 			   struct  inode * p_s_inode, struct page *, 
@@ -1955,11 +1956,22 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
 				   struct inode * dir, int mode, 
 				   const char * symname, loff_t i_size,
 				   struct dentry *dentry, struct inode *inode);
-int reiserfs_sync_inode (struct reiserfs_transaction_handle *th, struct inode * inode);
-void reiserfs_update_sd (struct reiserfs_transaction_handle *th, struct inode * inode);
+
+int reiserfs_sync_inode (struct reiserfs_transaction_handle *th,
+                         struct inode * inode);
+
+void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th,
+                              struct inode * inode, loff_t size);
+
+static inline void reiserfs_update_sd(struct reiserfs_transaction_handle *th,
+                                      struct inode *inode)
+{
+    reiserfs_update_sd_size(th, inode, inode->i_size) ;
+}
 
 void sd_attrs_to_i_attrs( __u16 sd_attrs, struct inode *inode );
 void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs );
+int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
 
 /* namei.c */
 void set_de_name_and_namelen (struct reiserfs_dir_entry * de);
@@ -2010,6 +2022,8 @@ int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
 
 /* dir.c */
 extern struct inode_operations reiserfs_dir_inode_operations;
+extern struct inode_operations reiserfs_symlink_inode_operations;
+extern struct inode_operations reiserfs_special_inode_operations;
 extern struct file_operations reiserfs_dir_operations;
 
 /* tail_conversion.c */
@@ -2048,10 +2062,10 @@ void free_buffers_in_tb (struct tree_balance * p_s_tb);
 
 
 /* prints.c */
-void reiserfs_panic (struct super_block * s, const char * fmt, ...)
-__attribute__ ( ( noreturn ) );/* __attribute__( ( format ( printf, 2, 3 ) ) ) */
+void reiserfs_panic (struct super_block * s, const char * fmt, ...) __attribute__ ( ( noreturn ) );
+void reiserfs_info (struct super_block *s, const char * fmt, ...);
+void reiserfs_printk (const char * fmt, ...);
 void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...);
-/* __attribute__( ( format ( printf, 3, 4 ) ) ); */
 void print_virtual_node (struct virtual_node * vn);
 void print_indirect_item (struct buffer_head * bh, int item_num);
 void store_print_tb (struct tree_balance * tb);
@@ -2136,7 +2150,7 @@ typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t;
 
 int reiserfs_parse_alloc_options (struct super_block *, char *);
 int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value);
-void reiserfs_free_block (struct reiserfs_transaction_handle *th, b_blocknr_t);
+void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted);
 int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t * , int, int);
 extern inline int reiserfs_new_form_blocknrs (struct tree_balance * tb,
 					      b_blocknr_t *new_blocknrs, int amount_needed)
@@ -2237,6 +2251,9 @@ int reiserfs_unpack (struct inode * inode, struct file * filp);
 #define reiserfs_write_lock( sb ) lock_kernel()
 #define reiserfs_write_unlock( sb ) unlock_kernel()
  			         
+/* xattr stuff */
+#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
+
 #endif /* _LINUX_REISER_FS_H */
 
 
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index e689a12bc..57eeaf7ed 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -22,7 +22,9 @@ typedef enum {
       truncate or unlink. Safe link is used to avoid leakage of disk
       space on crash with some files open, but unlinked. */
     i_link_saved_unlink_mask   =  0x0010,
-    i_link_saved_truncate_mask =  0x0020
+    i_link_saved_truncate_mask =  0x0020,
+    i_priv_object              =  0x0080,
+    i_has_xattr_dir            =  0x0100,
 } reiserfs_inode_flags;
 
 
@@ -51,6 +53,10 @@ struct reiserfs_inode_info {
     ** flushed */
     unsigned long i_trans_id ;
     struct reiserfs_journal_list *i_jl;
+
+    struct posix_acl *i_acl_access;
+    struct posix_acl *i_acl_default;
+    struct rw_semaphore xattr_sem;
     struct inode vfs_inode;
 };
 
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 9fa2813c2..38708778d 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -6,6 +6,7 @@
 
 #ifdef __KERNEL__
 #include <linux/workqueue.h>
+#include <linux/rwsem.h>
 #endif
 
 typedef enum {
@@ -251,7 +252,6 @@ struct reiserfs_journal {
 
 #define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick.  magic string to find desc blocks in the journal */
 
-
 typedef __u32 (*hashf_t) (const signed char *, int);
 
 struct reiserfs_bitmap_info
@@ -395,6 +395,10 @@ struct reiserfs_sb_info
     struct proc_dir_entry *procdir;
     int reserved_blocks; /* amount of blocks reserved for further allocations */
     spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */
+    struct dentry *priv_root; /* root of /.reiserfs_priv */
+    struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */
+    struct rw_semaphore xattr_dir_sem;
+
 };
 
 /* Definitions of reiserfs on-disk properties: */
@@ -437,6 +441,9 @@ enum reiserfs_mount_options {
     REISERFS_NO_UNHASHED_RELOCATION,
     REISERFS_HASHED_RELOCATION,
     REISERFS_ATTRS,
+    REISERFS_XATTRS,
+    REISERFS_XATTRS_USER,
+    REISERFS_POSIXACL,
 
     REISERFS_TEST1,
     REISERFS_TEST2,
@@ -462,6 +469,10 @@ enum reiserfs_mount_options {
 #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG))
 #define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED))
 #define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK))
+#define reiserfs_xattrs(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS))
+#define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER))
+#define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL))
+#define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s))
 
 void reiserfs_file_buffer (struct buffer_head * bh, int list);
 extern struct file_system_type reiserfs_fs_type;
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 5f9b35f2f..e3148341f 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -2,41 +2,108 @@
 #define _LINUX_RMAP_H
 /*
  * Declarations for Reverse Mapping functions in mm/rmap.c
- * Its structures are declared within that file.
  */
 
 #include <linux/config.h>
-#include <linux/linkage.h>
+#include <linux/list.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
 
-#define rmap_lock(page) \
+#define page_map_lock(page) \
 	bit_spin_lock(PG_maplock, (unsigned long *)&(page)->flags)
-#define rmap_unlock(page) \
+#define page_map_unlock(page) \
 	bit_spin_unlock(PG_maplock, (unsigned long *)&(page)->flags)
 
+/*
+ * The anon_vma heads a list of private "related" vmas, to scan if
+ * an anonymous page pointing to this anon_vma needs to be unmapped:
+ * the vmas on the list will be related by forking, or by splitting.
+ *
+ * Since vmas come and go as they are split and merged (particularly
+ * in mprotect), the mapping field of an anonymous page cannot point
+ * directly to a vma: instead it points to an anon_vma, on whose list
+ * the related vmas can be easily linked or unlinked.
+ *
+ * After unlinking the last vma on the list, we must garbage collect
+ * the anon_vma object itself: we're guaranteed no page can be
+ * pointing to this anon_vma once its vma list is empty.
+ */
+struct anon_vma {
+	spinlock_t lock;	/* Serialize access to vma list */
+	struct list_head head;	/* List of private "related" vmas */
+};
+
 #ifdef CONFIG_MMU
 
-struct pte_chain;
-struct pte_chain *pte_chain_alloc(int gfp_flags);
-void __pte_chain_free(struct pte_chain *pte_chain);
+extern kmem_cache_t *anon_vma_cachep;
+
+static inline struct anon_vma *anon_vma_alloc(void)
+{
+	return kmem_cache_alloc(anon_vma_cachep, SLAB_KERNEL);
+}
+
+static inline void anon_vma_free(struct anon_vma *anon_vma)
+{
+	kmem_cache_free(anon_vma_cachep, anon_vma);
+}
+
+static inline void anon_vma_lock(struct vm_area_struct *vma)
+{
+	struct anon_vma *anon_vma = vma->anon_vma;
+	if (anon_vma)
+		spin_lock(&anon_vma->lock);
+}
 
-static inline void pte_chain_free(struct pte_chain *pte_chain)
+static inline void anon_vma_unlock(struct vm_area_struct *vma)
 {
-	if (pte_chain)
-		__pte_chain_free(pte_chain);
+	struct anon_vma *anon_vma = vma->anon_vma;
+	if (anon_vma)
+		spin_unlock(&anon_vma->lock);
 }
 
-struct pte_chain * fastcall
-	page_add_rmap(struct page *, pte_t *, struct pte_chain *);
-void fastcall page_remove_rmap(struct page *, pte_t *);
+/*
+ * anon_vma helper functions.
+ */
+void anon_vma_init(void);	/* create anon_vma_cachep */
+int  anon_vma_prepare(struct vm_area_struct *);
+void __anon_vma_merge(struct vm_area_struct *, struct vm_area_struct *);
+void anon_vma_unlink(struct vm_area_struct *);
+void anon_vma_link(struct vm_area_struct *);
+void __anon_vma_link(struct vm_area_struct *);
+
+/*
+ * rmap interfaces called when adding or removing pte of page
+ */
+void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
+void page_add_file_rmap(struct page *);
+void page_remove_rmap(struct page *);
+
+/**
+ * page_dup_rmap - duplicate pte mapping to a page
+ * @page:	the page to add the mapping to
+ *
+ * For copy_page_range only: minimal extract from page_add_rmap,
+ * avoiding unnecessary tests (already checked) so it's quicker.
+ */
+static inline void page_dup_rmap(struct page *page)
+{
+	page_map_lock(page);
+	page->mapcount++;
+	page_map_unlock(page);
+}
 
 /*
  * Called from mm/vmscan.c to handle paging out
  */
-int fastcall page_referenced(struct page *);
-int fastcall try_to_unmap(struct page *);
+int page_referenced(struct page *);
+int try_to_unmap(struct page *);
 
 #else	/* !CONFIG_MMU */
 
+#define anon_vma_init()		do {} while (0)
+#define anon_vma_prepare(vma)	(0)
+#define anon_vma_link(vma)	do {} while (0)
+
 #define page_referenced(page)	TestClearPageReferenced(page)
 #define try_to_unmap(page)	SWAP_FAIL
 
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index fbf366ecd..4b3a0b5d4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -118,9 +118,10 @@ enum
 	RTN_THROW,		/* Not in this table		*/
 	RTN_NAT,		/* Translate this address	*/
 	RTN_XRESOLVE,		/* Use external resolver	*/
+	__RTN_MAX
 };
 
-#define RTN_MAX RTN_XRESOLVE
+#define RTN_MAX (__RTN_MAX - 1)
 
 
 /* rtm_protocol */
@@ -183,9 +184,10 @@ enum rt_class_t
 /* User defined values */
 	RT_TABLE_DEFAULT=253,
 	RT_TABLE_MAIN=254,
-	RT_TABLE_LOCAL=255
+	RT_TABLE_LOCAL=255,
+	__RT_TABLE_MAX
 };
-#define RT_TABLE_MAX RT_TABLE_LOCAL
+#define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
 
 
 
@@ -207,9 +209,10 @@ enum rtattr_type_t
 	RTA_FLOW,
 	RTA_CACHEINFO,
 	RTA_SESSION,
+	__RTA_MAX
 };
 
-#define RTA_MAX RTA_SESSION
+#define RTA_MAX (__RTA_MAX - 1)
 
 #define RTM_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
 #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
@@ -294,9 +297,10 @@ enum
 #define RTAX_INITCWND RTAX_INITCWND
 	RTAX_FEATURES,
 #define RTAX_FEATURES RTAX_FEATURES
+	__RTAX_MAX
 };
 
-#define RTAX_MAX RTAX_FEATURES
+#define RTAX_MAX (__RTAX_MAX - 1)
 
 #define RTAX_FEATURE_ECN	0x00000001
 #define RTAX_FEATURE_SACK	0x00000002
@@ -345,10 +349,11 @@ enum
 	IFA_BROADCAST,
 	IFA_ANYCAST,
 	IFA_CACHEINFO,
-	IFA_MULTICAST
+	IFA_MULTICAST,
+	__IFA_MAX
 };
 
-#define IFA_MAX IFA_CACHEINFO
+#define IFA_MAX (__IFA_MAX - 1)
 
 /* ifa_flags */
 
@@ -399,10 +404,11 @@ enum
 	NDA_UNSPEC,
 	NDA_DST,
 	NDA_LLADDR,
-	NDA_CACHEINFO
+	NDA_CACHEINFO,
+	__NDA_MAX
 };
 
-#define NDA_MAX NDA_CACHEINFO
+#define NDA_MAX (__NDA_MAX - 1)
 
 #define NDA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
 #define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
@@ -485,9 +491,10 @@ enum
 	PREFIX_UNSPEC,
 	PREFIX_ADDRESS,
 	PREFIX_CACHEINFO,
+	__PREFIX_MAX
 };
 
-#define PREFIX_MAX	PREFIX_CACHEINFO
+#define PREFIX_MAX	(__PREFIX_MAX - 1)
 
 struct prefix_cacheinfo
 {
@@ -549,10 +556,11 @@ enum
 #define IFLA_WIRELESS IFLA_WIRELESS
 	IFLA_PROTINFO,		/* Protocol specific information for a link */
 #define IFLA_PROTINFO IFLA_PROTINFO
+	__IFLA_MAX
 };
 
 
-#define IFLA_MAX IFLA_PROTINFO
+#define IFLA_MAX (__IFLA_MAX - 1)
 
 #define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
 #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
@@ -595,8 +603,11 @@ enum
 	IFLA_INET6_STATS,	/* statistics			*/
 	IFLA_INET6_MCAST,	/* MC things. What of them?	*/
 	IFLA_INET6_CACHEINFO,	/* time values and max reasm size */
+	__IFLA_INET6_MAX
 };
 
+#define IFLA_INET6_MAX	(__IFLA_INET6_MAX - 1)
+
 struct ifla_cacheinfo
 {
 	__u32	max_reasm_len;
@@ -605,8 +616,6 @@ struct ifla_cacheinfo
 	__u32	retrans_time;
 };
 
-#define IFLA_INET6_MAX	IFLA_INET6_CACHEINFO
-
 /*****************************************************************
  *		Traffic control messages.
  ****/
@@ -630,9 +639,10 @@ enum
 	TCA_STATS,
 	TCA_XSTATS,
 	TCA_RATE,
+	__TCA_MAX
 };
 
-#define TCA_MAX TCA_RATE
+#define TCA_MAX (__TCA_MAX - 1)
 
 #define TCA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
 #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 73d7127e3..7383821ff 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -91,6 +91,7 @@ extern unsigned long avenrun[];		/* Load averages */
 extern int nr_threads;
 extern int last_pid;
 DECLARE_PER_CPU(unsigned long, process_counts);
+DECLARE_PER_CPU(struct runqueue, runqueues);
 extern int nr_processes(void);
 extern unsigned long nr_running(void);
 extern unsigned long nr_uninterruptible(void);
@@ -147,9 +148,10 @@ extern spinlock_t mmlist_lock;
 typedef struct task_struct task_t;
 
 extern void sched_init(void);
+extern void sched_init_smp(void);
 extern void init_idle(task_t *idle, int cpu);
 
-extern cpumask_t idle_cpu_mask;
+extern cpumask_t nohz_cpu_mask;
 
 extern void show_state(void);
 extern void show_regs(struct pt_regs *);
@@ -171,9 +173,11 @@ extern void update_one_process(struct task_struct *p, unsigned long user,
 			       unsigned long system, int cpu);
 extern void scheduler_tick(int user_tick, int system);
 extern unsigned long cache_decay_ticks;
-extern const unsigned long scheduling_functions_start_here;
-extern const unsigned long scheduling_functions_end_here;
 
+/* Attach to any functions which should be ignored in wchan output. */
+#define __sched		__attribute__((__section__(".sched.text")))
+/* Is this address in the __sched functions? */
+extern int in_sched_functions(unsigned long addr);
 
 #define	MAX_SCHEDULE_TIMEOUT	LONG_MAX
 extern signed long FASTCALL(schedule_timeout(signed long timeout));
@@ -290,7 +294,7 @@ struct signal_struct {
  * in the range MAX_RT_PRIO..MAX_PRIO-1. Priority values
  * are inverted: lower p->prio value means higher priority.
  *
- * The MAX_RT_USER_PRIO value allows the actual maximum
+ * The MAX_USER_RT_PRIO value allows the actual maximum
  * RT priority to be separate from the value exported to
  * user-space.  This allows kernel threads to set their
  * priority to a value higher than any user task. Note:
@@ -349,7 +353,7 @@ struct io_context;			/* See blkdev.h */
 void exit_io_context(void);
 
 #define NGROUPS_SMALL		32
-#define NGROUPS_PER_BLOCK	((int)(EXEC_PAGESIZE / sizeof(gid_t)))
+#define NGROUPS_PER_BLOCK	((int)(PAGE_SIZE / sizeof(gid_t)))
 struct group_info {
 	int ngroups;
 	atomic_t usage;
@@ -376,6 +380,7 @@ int set_current_groups(struct group_info *group_info);
 
 
 struct audit_context;		/* See audit.c */
+struct mempolicy;
 
 struct task_struct {
 	volatile long state;	/* -1 unrunnable, 0 runnable, >0 stopped */
@@ -504,6 +509,11 @@ struct task_struct {
 
 	unsigned long ptrace_message;
 	siginfo_t *last_siginfo; /* For ptrace use.  */
+
+#ifdef CONFIG_NUMA
+  	struct mempolicy *mempolicy;
+  	short il_next;		/* could be shared with used_math */
+#endif
 };
 
 static inline pid_t process_group(struct task_struct *tsk)
@@ -542,6 +552,118 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
 #define PF_SYNCWRITE	0x00200000	/* I am doing a sync write */
 
 #ifdef CONFIG_SMP
+#define SCHED_LOAD_SCALE	128UL	/* increase resolution of load */
+
+#define SD_BALANCE_NEWIDLE	1	/* Balance when about to become idle */
+#define SD_BALANCE_EXEC		2	/* Balance on exec */
+#define SD_BALANCE_CLONE	4	/* Balance on clone */
+#define SD_WAKE_IDLE		8	/* Wake to idle CPU on task wakeup */
+#define SD_WAKE_AFFINE		16	/* Wake task to waking CPU */
+#define SD_WAKE_BALANCE		32	/* Perform balancing at task wakeup */
+#define SD_SHARE_CPUPOWER	64	/* Domain members share cpu power */
+
+struct sched_group {
+	struct sched_group *next;	/* Must be a circular list */
+	cpumask_t cpumask;
+
+	/*
+	 * CPU power of this group, SCHED_LOAD_SCALE being max power for a
+	 * single CPU. This should be read only (except for setup). Although
+	 * it will need to be written to at cpu hot(un)plug time, perhaps the
+	 * cpucontrol semaphore will provide enough exclusion?
+	 */
+	unsigned long cpu_power;
+};
+
+struct sched_domain {
+	/* These fields must be setup */
+	struct sched_domain *parent;	/* top domain must be null terminated */
+	struct sched_group *groups;	/* the balancing groups of the domain */
+	cpumask_t span;			/* span of all CPUs in this domain */
+	unsigned long min_interval;	/* Minimum balance interval ms */
+	unsigned long max_interval;	/* Maximum balance interval ms */
+	unsigned int busy_factor;	/* less balancing by factor if busy */
+	unsigned int imbalance_pct;	/* No balance until over watermark */
+	unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
+	unsigned int cache_nice_tries;	/* Leave cache hot tasks for # tries */
+	unsigned int per_cpu_gain;	/* CPU % gained by adding domain cpus */
+	int flags;			/* See SD_* */
+
+	/* Runtime fields. */
+	unsigned long last_balance;	/* init to jiffies. units in jiffies */
+	unsigned int balance_interval;	/* initialise to 1. units in ms. */
+	unsigned int nr_balance_failed; /* initialise to 0 */
+};
+
+/* Common values for SMT siblings */
+#define SD_SIBLING_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 1,			\
+	.max_interval		= 2,			\
+	.busy_factor		= 8,			\
+	.imbalance_pct		= 110,			\
+	.cache_hot_time		= 0,			\
+	.cache_nice_tries	= 0,			\
+	.per_cpu_gain		= 15,			\
+	.flags			= SD_BALANCE_NEWIDLE	\
+				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_CLONE	\
+				| SD_WAKE_AFFINE	\
+				| SD_WAKE_IDLE		\
+				| SD_SHARE_CPUPOWER,	\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+
+/* Common values for CPUs */
+#define SD_CPU_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 1,			\
+	.max_interval		= 4,			\
+	.busy_factor		= 64,			\
+	.imbalance_pct		= 125,			\
+	.cache_hot_time		= (5*1000000/2),	\
+	.cache_nice_tries	= 1,			\
+	.per_cpu_gain		= 100,			\
+	.flags			= SD_BALANCE_NEWIDLE	\
+				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_CLONE	\
+				| SD_WAKE_AFFINE	\
+				| SD_WAKE_BALANCE,	\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+
+#ifdef CONFIG_NUMA
+/* Common values for NUMA nodes */
+#define SD_NODE_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 8,			\
+	.max_interval		= 32,			\
+	.busy_factor		= 32,			\
+	.imbalance_pct		= 125,			\
+	.cache_hot_time		= (10*1000000),		\
+	.cache_nice_tries	= 1,			\
+	.per_cpu_gain		= 100,			\
+	.flags			= SD_BALANCE_EXEC	\
+				| SD_BALANCE_CLONE	\
+				| SD_WAKE_BALANCE,	\
+	.last_balance		= jiffies,		\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+#endif
+
+extern void cpu_attach_domain(struct sched_domain *sd, int cpu);
+
 extern int set_cpus_allowed(task_t *p, cpumask_t new_mask);
 #else
 static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
@@ -552,16 +674,13 @@ static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
 
 extern unsigned long long sched_clock(void);
 
-#ifdef CONFIG_NUMA
+#ifdef CONFIG_SMP
 extern void sched_balance_exec(void);
-extern void node_nr_running_init(void);
 #else
 #define sched_balance_exec()   {}
-#define node_nr_running_init() {}
 #endif
 
-/* Move tasks off this (offline) CPU onto another. */
-extern void migrate_all_tasks(void);
+extern void sched_idle_next(void);
 extern void set_user_nice(task_t *p, long nice);
 extern int task_prio(task_t *p);
 extern int task_nice(task_t *p);
@@ -570,6 +689,59 @@ extern int idle_cpu(int cpu);
 
 void yield(void);
 
+/*
+ * These are the runqueue data structures:
+ */
+
+#define BITMAP_SIZE ((((MAX_PRIO+1+7)/8)+sizeof(long)-1)/sizeof(long))
+
+typedef struct runqueue runqueue_t;
+
+struct prio_array {
+	unsigned int nr_active;
+	unsigned long bitmap[BITMAP_SIZE];
+	struct list_head queue[MAX_PRIO];
+};
+
+/*
+ * This is the main, per-CPU runqueue data structure.
+ *
+ * Locking rule: those places that want to lock multiple runqueues
+ * (such as the load balancing or the thread migration code), lock
+ * acquire operations must be ordered by ascending &runqueue.
+ */
+struct runqueue {
+	spinlock_t lock;
+
+	/*
+	 * nr_running and cpu_load should be in the same cacheline because
+	 * remote CPUs use both these fields when doing load calculation.
+	 */
+	unsigned long nr_running;
+#ifdef CONFIG_SMP
+	unsigned long cpu_load;
+#endif
+	unsigned long long nr_switches;
+	unsigned long expired_timestamp, nr_uninterruptible;
+	unsigned long long timestamp_last_tick;
+	task_t *curr, *idle;
+	struct mm_struct *prev_mm;
+	prio_array_t *active, *expired, arrays[2];
+	int best_expired_prio;
+	atomic_t nr_iowait;
+
+#ifdef CONFIG_SMP
+	struct sched_domain *sd;
+
+	/* For active balancing */
+	int active_balance;
+	int push_cpu;
+
+	task_t *migration_thread;
+	struct list_head migration_queue;
+#endif
+};
+
 /*
  * The default (Linux) execution domain.
  */
@@ -612,12 +784,17 @@ extern void do_timer(struct pt_regs *);
 
 extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state));
 extern int FASTCALL(wake_up_process(struct task_struct * tsk));
+extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk));
 #ifdef CONFIG_SMP
  extern void kick_process(struct task_struct *tsk);
+ extern void FASTCALL(wake_up_forked_thread(struct task_struct * tsk));
 #else
  static inline void kick_process(struct task_struct *tsk) { }
+ static inline void wake_up_forked_thread(struct task_struct * tsk)
+ {
+	wake_up_forked_process(tsk);
+ }
 #endif
-extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk));
 extern void FASTCALL(sched_fork(task_t * p));
 extern void FASTCALL(sched_exit(task_t * p));
 
diff --git a/include/linux/sdla.h b/include/linux/sdla.h
index 44ae55b1c..3b6afb8ca 100644
--- a/include/linux/sdla.h
+++ b/include/linux/sdla.h
@@ -58,7 +58,7 @@
 struct sdla_mem {
    int  addr;
    int  len;
-   void *data;
+   void __user *data;
 };
 
 #define SDLA_START			(FRAD_LAST_IOCTL + 7)
diff --git a/include/linux/security.h b/include/linux/security.h
index df0089af8..e2f166907 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1172,7 +1172,7 @@ struct security_operations {
 	int (*shm_associate) (struct shmid_kernel * shp, int shmflg);
 	int (*shm_shmctl) (struct shmid_kernel * shp, int cmd);
 	int (*shm_shmat) (struct shmid_kernel * shp, 
-			  char *shmaddr, int shmflg);
+			  char __user *shmaddr, int shmflg);
 
 	int (*sem_alloc_security) (struct sem_array * sma);
 	void (*sem_free_security) (struct sem_array * sma);
diff --git a/include/linux/selection.h b/include/linux/selection.h
index fd34cfa5f..059c95895 100644
--- a/include/linux/selection.h
+++ b/include/linux/selection.h
@@ -13,9 +13,9 @@
 extern int sel_cons;
 
 extern void clear_selection(void);
-extern int set_selection(const struct tiocl_selection *sel, struct tty_struct *tty, int user);
+extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty);
 extern int paste_selection(struct tty_struct *tty);
-extern int sel_loadlut(const unsigned long arg);
+extern int sel_loadlut(char __user *p);
 extern int mouse_reporting(void);
 extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry);
 
diff --git a/include/linux/sem.h b/include/linux/sem.h
index aaf45764a..c365f7989 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -45,10 +45,10 @@ struct sembuf {
 /* arg for semctl system calls. */
 union semun {
 	int val;			/* value for SETVAL */
-	struct semid_ds *buf;		/* buffer for IPC_STAT & IPC_SET */
-	unsigned short *array;		/* array for GETALL & SETALL */
-	struct seminfo *__buf;		/* buffer for IPC_INFO */
-	void *__pad;
+	struct semid_ds __user *buf;	/* buffer for IPC_STAT & IPC_SET */
+	unsigned short __user *array;	/* array for GETALL & SETALL */
+	struct seminfo __user *__buf;	/* buffer for IPC_INFO */
+	void __user *__pad;
 };
 
 struct  seminfo {
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 4d7dd8538..00c4b081f 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -85,6 +85,9 @@
 /* Samsung S3C2410 SoC and derivatives thereof */
 #define PORT_S3C2410    55
 
+/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
+#define PORT_IP22ZILOG	56
+
 #ifdef __KERNEL__
 
 #include <linux/config.h>
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 049e551a3..f8efcf10a 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -2,6 +2,7 @@
 #define __SHMEM_FS_H
 
 #include <linux/swap.h>
+#include <linux/mempolicy.h>
 
 /* inode in-kernel data */
 
@@ -15,6 +16,7 @@ struct shmem_inode_info {
 	unsigned long		alloced;    /* data pages allocated to file */
 	unsigned long		swapped;    /* subtotal assigned to swap */
 	unsigned long		flags;
+	struct shared_policy     policy;
 	struct list_head	list;
 	struct inode		vfs_inode;
 };
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 91e463ad2..7bf6501a9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1014,13 +1014,13 @@ extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
 extern unsigned int    datagram_poll(struct file *file, struct socket *sock,
 				     struct poll_table_struct *wait);
 extern int	       skb_copy_datagram(const struct sk_buff *from,
-					 int offset, char *to, int size);
+					 int offset, char __user *to, int size);
 extern int	       skb_copy_datagram_iovec(const struct sk_buff *from,
 					       int offset, struct iovec *to,
 					       int size);
 extern int	       skb_copy_and_csum_datagram(const struct sk_buff *skb,
-						  int offset, u8 *to, int len,
-						  unsigned int *csump);
+						  int offset, u8 __user *to,
+						  int len, unsigned int *csump);
 extern int	       skb_copy_and_csum_datagram_iovec(const
 							struct sk_buff *skb,
 							int hlen,
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 806cc52ab..e60ff6399 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -44,6 +44,7 @@ typedef struct kmem_cache_s kmem_cache_t;
 #define SLAB_STORE_USER		0x00010000UL	/* store the last owner for bug hunting */
 #define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* track pages allocated to indicate
 						   what is reclaimable later*/
+#define SLAB_PANIC		0x00040000UL	/* panic if kmem_cache_create() fails */
 
 /* flags passed to a constructor func */
 #define	SLAB_CTOR_CONSTRUCTOR	0x001UL		/* if not set, then deconstructor */
@@ -60,6 +61,7 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo
 extern int kmem_cache_destroy(kmem_cache_t *);
 extern int kmem_cache_shrink(kmem_cache_t *);
 extern void *kmem_cache_alloc(kmem_cache_t *, int);
+extern void *kmem_cache_alloc_node(kmem_cache_t *, int);
 extern void kmem_cache_free(kmem_cache_t *, void *);
 extern unsigned int kmem_cache_size(kmem_cache_t *);
 
diff --git a/include/linux/sockios.h b/include/linux/sockios.h
index 2c74362de..5eb33205c 100644
--- a/include/linux/sockios.h
+++ b/include/linux/sockios.h
@@ -116,6 +116,12 @@
 #define SIOCBONDINFOQUERY      0x8994	/* rtn info about bond state    */
 #define SIOCBONDCHANGEACTIVE   0x8995   /* update to a new active slave */
 			
+/* bridge calls */
+#define SIOCBRADDBR     0x89a0		/* create new bridge device     */
+#define SIOCBRDELBR     0x89a1		/* remove bridge device         */
+#define SIOCBRADDIF	0x89a2		/* add interface to bridge      */
+#define SIOCBRDELIF	0x89a3		/* remove interface from bridge */
+
 /* Device private ioctl calls */
 
 /*
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 148ea9d43..de381ec1e 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -40,6 +40,8 @@
 
 #else
 
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
+
 #if !defined(CONFIG_PREEMPT) && !defined(CONFIG_DEBUG_SPINLOCK)
 # define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic)
 # define ATOMIC_DEC_AND_LOCK
@@ -257,7 +259,7 @@ do { \
 do { \
 	local_irq_save(flags); \
 	preempt_disable(); \
-	_raw_spin_lock(lock); \
+	_raw_spin_lock_flags(lock, flags); \
 } while (0)
 
 #define spin_lock_irq(lock) \
diff --git a/include/linux/stat.h b/include/linux/stat.h
index b907fb25a..8ff2a122d 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -60,7 +60,7 @@ struct kstat {
 	unsigned long	ino;
 	dev_t		dev;
 	umode_t		mode;
-	nlink_t		nlink;
+	unsigned int	nlink;
 	uid_t		uid;
 	gid_t		gid;
 	dev_t		rdev;
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 18c776d1d..6c5f0060a 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -97,7 +97,9 @@ struct cache_detail {
 	struct proc_dir_entry   *flush_ent, *channel_ent, *content_ent;
 
 	atomic_t		readers;		/* how many time is /chennel open */
-	time_t			last_close;		/* it no readers, when did last close */
+	time_t			last_close;		/* if no readers, when did last close */
+	time_t			last_warn;		/* when we last warned about no readers */
+	void			(*warn_no_listener)(struct cache_detail *cd);
 };
 
 
@@ -193,8 +195,11 @@ RTN *FNAME ARGS										\
 					t2 = tmp; tmp = new; new = t2;			\
 				}							\
 				if (test_bit(CACHE_NEGATIVE,  &item->MEMBER.flags))	\
-					 set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);	\
-				else {UPDATE;}						\
+					set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);	\
+				else {							\
+					UPDATE;						\
+					clear_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);	\
+				}							\
 			}								\
 			if (set||new) write_unlock(&(DETAIL)->hash_lock);		\
 			else read_unlock(&(DETAIL)->hash_lock);				\
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index e24f9c0ba..629957d71 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -50,46 +50,36 @@ u32 gss_verify_mic(
 u32 gss_delete_sec_context(
 		struct gss_ctx		**ctx_id);
 
-/* We maintain a list of the pseudoflavors (equivalently, mechanism-qop-service
- * triples) that we currently support: */
-
-struct sup_sec_triple {
-	struct list_head	triples;
-	u32			pseudoflavor;
-	struct gss_api_mech	*mech;
-	u32			qop;
-	u32			service;
+struct gss_api_mech * gss_mech_get_by_name(char *name);
+struct gss_api_mech * gss_mech_get_by_pseudoflavor(u32 pseudoflavor);
+u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor);
+char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service);
+
+struct pf_desc {
+	u32	pseudoflavor;
+	u32	qop;
+	u32	service;
+	char	*name;
+	char	*auth_domain_name;
 };
 
-int gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech, u32 qop,
-			u32 service);
-int gss_unregister_triple(u32 pseudoflavor);
-int gss_pseudoflavor_supported(u32 pseudoflavor);
-u32 gss_cmp_triples(u32 oid_len, char *oid_data, u32 qop, u32 service);
-u32 gss_get_pseudoflavor(struct gss_ctx *ctx_id, u32 qop, u32 service);
-u32 gss_pseudoflavor_to_service(u32 pseudoflavor);
-/* Both return NULL on failure: */
-struct gss_api_mech * gss_pseudoflavor_to_mech(u32 pseudoflavor);
-int gss_pseudoflavor_to_mechOID(u32 pseudoflavor, struct xdr_netobj *mech);
-
 /* Different mechanisms (e.g., krb5 or spkm3) may implement gss-api, and
- * mechanisms may be dynamically registered or unregistered by modules.
- * Our only built-in mechanism is a trivial debugging mechanism that provides
- * no actual security; the following function registers that mechanism: */
-
-void gss_mech_register_debug(void);
+ * mechanisms may be dynamically registered or unregistered by modules. */
 
 /* Each mechanism is described by the following struct: */
 struct gss_api_mech {
-	struct xdr_netobj	gm_oid;
 	struct list_head	gm_list;
-	atomic_t		gm_count;
+	struct module		*gm_owner;
+	struct xdr_netobj	gm_oid;
+	char			*gm_name;
 	struct gss_api_ops	*gm_ops;
+	/* pseudoflavors supported by this mechanism: */
+	int			gm_pf_num;
+	struct pf_desc *	gm_pfs;
 };
 
 /* and must provide the following operations: */
 struct gss_api_ops {
-	char *name;
 	u32 (*gss_import_sec_context)(
 			struct xdr_netobj	*input_token,
 			struct gss_ctx		*ctx_id);
@@ -107,29 +97,25 @@ struct gss_api_ops {
 			void			*internal_ctx_id);
 };
 
-/* Returns nonzero on failure. */
-int gss_mech_register(struct xdr_netobj *, struct gss_api_ops *);
+int gss_mech_register(struct gss_api_mech *);
+void gss_mech_unregister(struct gss_api_mech *);
 
-/* Returns nonzero iff someone still has a reference to this mech. */
-int gss_mech_unregister(struct gss_api_mech *);
-
-/* Returns nonzer iff someone still has a reference to some mech. */
-int gss_mech_unregister_all(void);
-
-/* returns a mechanism descriptor given an OID, an increments the mechanism's
+/* returns a mechanism descriptor given an OID, and increments the mechanism's
  * reference count. */
 struct gss_api_mech * gss_mech_get_by_OID(struct xdr_netobj *);
 
-/* Similar, but get by name like "krb5", "spkm", etc., instead of OID. */
+/* Returns a reference to a mechanism, given a name like "krb5" etc. */
 struct gss_api_mech *gss_mech_get_by_name(char *);
 
+/* Similar, but get by pseudoflavor. */
+struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32);
+
 /* Just increments the mechanism's reference count and returns its input: */
 struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
 
-/* Returns nonzero iff you've released the last reference to this mech.
- * Note that for every succesful gss_get_mech call there must be exactly
- * one corresponding call to gss_mech_put.*/
-int gss_mech_put(struct gss_api_mech *);
+/* For every succesful gss_mech_get or gss_mech_get_by_* call there must be a
+ * corresponding call to gss_mech_put. */
+void gss_mech_put(struct gss_api_mech *);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_SUNRPC_GSS_API_H */
diff --git a/include/linux/sunrpc/gss_asn1.h b/include/linux/sunrpc/gss_asn1.h
index bb5f84adc..7559244d4 100644
--- a/include/linux/sunrpc/gss_asn1.h
+++ b/include/linux/sunrpc/gss_asn1.h
@@ -81,5 +81,4 @@ int g_token_size(
 void g_make_token_header(
      struct xdr_netobj *mech,
      int body_size,
-     unsigned char **buf,
-     int tok_type);
+     unsigned char **buf);
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index 961674640..ffe31d2eb 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -115,7 +115,7 @@ enum seal_alg {
 #define ENCTYPE_UNKNOWN         0x01ff
 
 s32
-krb5_make_checksum(s32 cksumtype, char *header, struct xdr_buf *body,
+make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
 		   struct xdr_netobj *cksum);
 
 u32
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index 36bcc5ed7..30689cc57 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -87,6 +87,7 @@ struct auth_domain {
  */
 struct auth_ops {
 	char *	name;
+	struct module *owner;
 	int	flavour;
 	int	(*accept)(struct svc_rqst *rq, u32 *authp);
 	int	(*release)(struct svc_rqst *rq);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 5222a8f4c..298b18486 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -69,8 +69,7 @@ extern unsigned int xprt_tcp_slot_table_entries;
  * This describes a timeout strategy
  */
 struct rpc_timeout {
-	unsigned long		to_current,		/* current timeout */
-				to_initval,		/* initial timeout */
+	unsigned long		to_initval,		/* initial timeout */
 				to_maxval,		/* max timeout */
 				to_increment;		/* if !exponential */
 	unsigned int		to_retries;		/* max # of retries */
@@ -85,7 +84,6 @@ struct rpc_rqst {
 	 * This is the user-visible part
 	 */
 	struct rpc_xprt *	rq_xprt;		/* RPC client */
-	struct rpc_timeout	rq_timeout;		/* timeout parms */
 	struct xdr_buf		rq_snd_buf;		/* send buffer */
 	struct xdr_buf		rq_rcv_buf;		/* recv buffer */
 
@@ -103,6 +101,9 @@ struct rpc_rqst {
 	struct xdr_buf		rq_private_buf;		/* The receive buffer
 							 * used in the softirq.
 							 */
+	unsigned long		rq_majortimeo;	/* major timeout alarm */
+	unsigned long		rq_timeout;	/* Current timeout value */
+	unsigned int		rq_retries;	/* # of retries */
 	/*
 	 * For authentication (e.g. auth_des)
 	 */
@@ -115,7 +116,6 @@ struct rpc_rqst {
 	u32			rq_bytes_sent;	/* Bytes we have sent */
 
 	unsigned long		rq_xtime;	/* when transmitted */
-	int			rq_ntimeo;
 	int			rq_ntrans;
 };
 #define rq_svec			rq_snd_buf.head
@@ -210,7 +210,7 @@ void			xprt_reserve(struct rpc_task *);
 int			xprt_prepare_transmit(struct rpc_task *);
 void			xprt_transmit(struct rpc_task *);
 void			xprt_receive(struct rpc_task *);
-int			xprt_adjust_timeout(struct rpc_timeout *);
+int			xprt_adjust_timeout(struct rpc_rqst *req);
 void			xprt_release(struct rpc_task *);
 void			xprt_connect(struct rpc_task *);
 int			xprt_clear_backlog(struct rpc_xprt *);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 5c5a79729..a748538f3 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -151,7 +151,7 @@ struct swap_list_t {
 extern void out_of_memory(void);
 
 /* linux/mm/memory.c */
-extern void swapin_readahead(swp_entry_t);
+extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
 
 /* linux/mm/page_alloc.c */
 extern unsigned long totalram_pages;
@@ -181,6 +181,8 @@ extern int vm_swappiness;
 extern int shmem_unuse(swp_entry_t entry, struct page *page);
 #endif /* CONFIG_MMU */
 
+extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *);
+
 #ifdef CONFIG_SWAP
 /* linux/mm/page_io.c */
 extern int swap_readpage(struct file *, struct page *);
@@ -200,7 +202,8 @@ extern int move_from_swap_cache(struct page *, unsigned long,
 extern void free_page_and_swap_cache(struct page *);
 extern void free_pages_and_swap_cache(struct page **, int);
 extern struct page * lookup_swap_cache(swp_entry_t);
-extern struct page * read_swap_cache_async(swp_entry_t);
+extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma,
+					   unsigned long addr);
 
 /* linux/mm/swapfile.c */
 extern int total_swap_pages;
@@ -216,7 +219,7 @@ extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t);
 extern struct swap_info_struct *get_swap_info_struct(unsigned);
 extern int can_share_swap_page(struct page *);
 extern int remove_exclusive_swap_page(struct page *);
-extern void swap_unplug_io_fn(struct page *);
+struct backing_dev_info;
 
 extern struct swap_list_t swap_list;
 extern spinlock_t swaplock;
@@ -242,7 +245,7 @@ extern spinlock_t swaplock;
 #define free_swap_and_cache(swp)		/*NOTHING*/
 #define swap_duplicate(swp)			/*NOTHING*/
 #define swap_free(swp)				/*NOTHING*/
-#define read_swap_cache_async(swp)		NULL
+#define read_swap_cache_async(swp,vma,addr)	NULL
 #define lookup_swap_cache(swp)			NULL
 #define valid_swaphandles(swp, off)		0
 #define can_share_swap_page(p)			0
@@ -250,7 +253,6 @@ extern spinlock_t swaplock;
 #define move_from_swap_cache(p, i, m)		1
 #define __delete_from_swap_cache(p)		/*NOTHING*/
 #define delete_from_swap_cache(p)		/*NOTHING*/
-#define swap_unplug_io_fn(p)			/*NOTHING*/
 
 static inline int remove_exclusive_swap_page(struct page *p)
 {
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 89ffe5589..ef193874f 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -19,6 +19,7 @@ struct io_event;
 struct iovec;
 struct itimerspec;
 struct itimerval;
+struct kexec_segment;
 struct linux_dirent;
 struct linux_dirent64;
 struct list_head;
@@ -154,15 +155,18 @@ asmlinkage long sys_shutdown(int, int);
 asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd,
 				void __user *arg);
 asmlinkage long sys_restart_syscall(void);
+asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments,
+			struct kexec_segment *segments, unsigned long flags);
 
 asmlinkage long sys_exit(int error_code);
 asmlinkage void sys_exit_group(int error_code);
-asmlinkage long sys_wait4(pid_t pid, unsigned int *stat_addr,
+asmlinkage long sys_wait4(pid_t pid, unsigned int __user *stat_addr,
 				int options, struct rusage __user *ru);
 asmlinkage long sys_waitpid(pid_t pid, unsigned int __user *stat_addr, int options);
 asmlinkage long sys_set_tid_address(int __user *tidptr);
 asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
-			struct timespec __user *utime, u32 __user *uaddr2);
+			struct timespec __user *utime, u32 __user *uaddr2,
+			int val3);
 
 asmlinkage long sys_init_module(void __user *umod, unsigned long len,
 				const char __user *uargs);
@@ -253,7 +257,7 @@ asmlinkage long sys_mprotect(unsigned long start, size_t len,
 asmlinkage unsigned long sys_mremap(unsigned long addr,
 				unsigned long old_len, unsigned long new_len,
 				unsigned long flags, unsigned long new_addr);
-long sys_remap_file_pages(unsigned long start, unsigned long size,
+asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 			unsigned long prot, unsigned long pgoff,
 			unsigned long flags);
 asmlinkage long sys_msync(unsigned long start, size_t len, int flags);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index d8929c671..9bec6500f 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -133,6 +133,7 @@ enum
 	KERN_NGROUPS_MAX=63,	/* int: NGROUPS_MAX */
 	KERN_SPARC_SCONS_PWROFF=64, /* int: serial console power-off halt */
 	KERN_HZ_TIMER=65,	/* int: hz timer on or off */
+	KERN_DUMP=66,		/* dir: dump parameters */
 };
 
 
@@ -163,6 +164,7 @@ enum
 	VM_MAX_MAP_COUNT=22,	/* int: Maximum number of mmaps/address-space */
 	VM_LAPTOP_MODE=23,	/* vm laptop mode */
 	VM_BLOCK_DUMP=24,	/* block dump mode */
+	VM_HUGETLB_GROUP=25,	/* permitted hugetlb group */
 };
 
 
@@ -335,6 +337,8 @@ enum
  	NET_TCP_BIC=102,
  	NET_TCP_BIC_FAST_CONVERGENCE=103,
 	NET_TCP_BIC_LOW_WINDOW=104,
+	NET_TCP_DEFAULT_WIN_SCALE=105,
+	NET_TCP_MODERATE_RCVBUF=106,
 };
 
 enum {
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index de2083939..4cb54379e 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -44,7 +44,7 @@ sysfs_create_dir(struct kobject *);
 extern void
 sysfs_remove_dir(struct kobject *);
 
-extern void
+extern int
 sysfs_rename_dir(struct kobject *, const char *new_name);
 
 extern int
@@ -80,9 +80,9 @@ static inline void sysfs_remove_dir(struct kobject * k)
 	;
 }
 
-static inline void sysfs_rename_dir(struct kobject * k, const char *new_name)
+static inline int sysfs_rename_dir(struct kobject * k, const char *new_name)
 {
-	;
+	return 0;
 }
 
 static inline int sysfs_create_file(struct kobject * k, const struct attribute * a)
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index 1acdb0bd4..7fe8012f7 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -30,13 +30,7 @@ struct sysrq_key_op {
  */
 
 void handle_sysrq(int, struct pt_regs *, struct tty_struct *);
-
-/* 
- * Nonlocking version of handle sysrq, used by sysrq handlers that need to
- * call sysrq handlers
- */
-
-void __handle_sysrq_nolock(int, struct pt_regs *, struct tty_struct *);
+void __handle_sysrq(int, struct pt_regs *, struct tty_struct *);
 
 /*
  * Sysrq registration manipulation functions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index b6511999f..39e2d2261 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -183,6 +183,9 @@ struct tcp_info
 	__u32	tcpi_snd_cwnd;
 	__u32	tcpi_advmss;
 	__u32	tcpi_reordering;
+
+	__u32	tcpi_rcv_rtt;
+	__u32	tcpi_rcv_space;
 };
 
 #ifdef __KERNEL__
@@ -351,11 +354,11 @@ struct tcp_opt {
 	__u8	urg_mode;	/* In urgent mode		*/
 	__u32	snd_up;		/* Urgent pointer		*/
 
-	/* The syn_wait_lock is necessary only to avoid tcp_get_info having
+	/* The syn_wait_lock is necessary only to avoid proc interface having
 	 * to grab the main lock sock while browsing the listening hash
 	 * (otherwise it's deadlock prone).
-	 * This lock is acquired in read mode only from tcp_get_info() and
-	 * it's acquired in write mode _only_ from code that is actively
+	 * This lock is acquired in read mode only from listening_get_next()
+	 * and it's acquired in write mode _only_ from code that is actively
 	 * changing the syn_wait_queue. All readers that are holding
 	 * the master sock lock don't need to grab this lock in read mode
 	 * too as the syn_wait_queue writes are always protected from
@@ -376,6 +379,20 @@ struct tcp_opt {
 
 	unsigned long last_synq_overflow; 
 
+/* Receiver side RTT estimation */
+	struct {
+		__u32	rtt;
+		__u32	seq;
+		__u32	time;
+	} rcv_rtt_est;
+
+/* Receiver queue space */
+	struct {
+		int	space;
+		__u32	seq;
+		__u32	time;
+	} rcvq_space;
+
 /* TCP Westwood structure */
         struct {
                 __u32    bw_ns_est;        /* first bandwidth estimation..not too smoothed 8) */
diff --git a/include/linux/time.h b/include/linux/time.h
index b85d59694..d24a690cb 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -177,6 +177,34 @@ struct timezone {
 	(SH_DIV((MAX_JIFFY_OFFSET >> SEC_JIFFIE_SC) * TICK_NSEC, NSEC_PER_SEC, 1) - 1)
 
 #endif
+
+/*
+ * Convert jiffies to milliseconds and back.
+ *
+ * Avoid unnecessary multiplications/divisions in the
+ * two most common HZ cases:
+ */
+static inline unsigned int jiffies_to_msecs(const unsigned long j)
+{
+#if HZ <= 1000 && !(1000 % HZ)
+	return (1000 / HZ) * j;
+#elif HZ > 1000 && !(HZ % 1000)
+	return (j + (HZ / 1000) - 1)/(HZ / 1000);
+#else
+	return (j * 1000) / HZ;
+#endif
+}
+static inline unsigned long msecs_to_jiffies(const unsigned int m)
+{
+#if HZ <= 1000 && !(1000 % HZ)
+	return (m + (1000 / HZ) - 1) / (1000 / HZ);
+#elif HZ > 1000 && !(HZ % 1000)
+	return m * (HZ / 1000);
+#else
+	return (m * HZ + 999) / 1000;
+#endif
+}
+
 /*
  * The TICK_NSEC - 1 rounds up the value to the next resolution.  Note
  * that a remainder subtract here would not do the right thing as the
@@ -189,7 +217,7 @@ struct timezone {
  * value to a scaled second value.
  */
 static __inline__ unsigned long
-timespec_to_jiffies(struct timespec *value)
+timespec_to_jiffies(const struct timespec *value)
 {
 	unsigned long sec = value->tv_sec;
 	long nsec = value->tv_nsec + TICK_NSEC - 1;
@@ -205,7 +233,7 @@ timespec_to_jiffies(struct timespec *value)
 }
 
 static __inline__ void
-jiffies_to_timespec(unsigned long jiffies, struct timespec *value)
+jiffies_to_timespec(const unsigned long jiffies, struct timespec *value)
 {
 	/*
 	 * Convert jiffies to nanoseconds and separate with
@@ -228,7 +256,7 @@ jiffies_to_timespec(unsigned long jiffies, struct timespec *value)
  * instruction above the way it was done above.
  */
 static __inline__ unsigned long
-timeval_to_jiffies(struct timeval *value)
+timeval_to_jiffies(const struct timeval *value)
 {
 	unsigned long sec = value->tv_sec;
 	long usec = value->tv_usec;
@@ -243,7 +271,7 @@ timeval_to_jiffies(struct timeval *value)
 }
 
 static __inline__ void
-jiffies_to_timeval(unsigned long jiffies, struct timeval *value)
+jiffies_to_timeval(const unsigned long jiffies, struct timeval *value)
 {
 	/*
 	 * Convert jiffies to nanoseconds and separate with
diff --git a/include/linux/timer.h b/include/linux/timer.h
index d30335783..90db1cc62 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -4,6 +4,7 @@
 #include <linux/config.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
+#include <linux/stddef.h>
 
 struct tvec_t_base_s;
 
@@ -87,9 +88,11 @@ static inline void add_timer(struct timer_list * timer)
 }
 
 #ifdef CONFIG_SMP
-  extern int del_timer_sync(struct timer_list * timer);
+  extern int del_timer_sync(struct timer_list *timer);
+  extern int del_singleshot_timer_sync(struct timer_list *timer);
 #else
 # define del_timer_sync(t) del_timer(t)
+# define del_singleshot_timer_sync(t) del_timer(t)
 #endif
 
 extern void init_timers(void);
diff --git a/include/linux/times.h b/include/linux/times.h
index a682537f8..ff00f334f 100644
--- a/include/linux/times.h
+++ b/include/linux/times.h
@@ -2,15 +2,21 @@
 #define _LINUX_TIMES_H
 
 #ifdef __KERNEL__
+#include <linux/timex.h>
 #include <asm/div64.h>
 #include <asm/types.h>
 #include <asm/param.h>
 
-#if (HZ % USER_HZ)==0
-# define jiffies_to_clock_t(x) ((x) / (HZ / USER_HZ))
+static inline clock_t jiffies_to_clock_t(long x)
+{
+#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0
+	return x / (HZ / USER_HZ);
 #else
-# define jiffies_to_clock_t(x) ((clock_t) jiffies_64_to_clock_t((u64) x))
+	u64 tmp = (u64)x * TICK_NSEC;
+	do_div(tmp, (NSEC_PER_SEC / USER_HZ));
+	return (long)tmp;
 #endif
+}
 
 static inline unsigned long clock_t_to_jiffies(unsigned long x)
 {
@@ -34,7 +40,7 @@ static inline unsigned long clock_t_to_jiffies(unsigned long x)
 
 static inline u64 jiffies_64_to_clock_t(u64 x)
 {
-#if (HZ % USER_HZ)==0
+#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0
 	do_div(x, HZ / USER_HZ);
 #else
 	/*
@@ -42,8 +48,8 @@ static inline u64 jiffies_64_to_clock_t(u64 x)
 	 * but even this doesn't overflow in hundreds of years
 	 * in 64 bits, so..
 	 */
-	x *= USER_HZ;
-	do_div(x, HZ);
+	x *= TICK_NSEC;
+	do_div(x, (NSEC_PER_SEC / USER_HZ));
 #endif
 	return x;
 }
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 6e61f3b27..7481d70fb 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -97,7 +97,6 @@ extern struct screen_info screen_info;
 
 #define VIDEO_TYPE_PICA_S3	0x30	/* ACER PICA-61 local S3 video	*/
 #define VIDEO_TYPE_MIPS_G364	0x31    /* MIPS Magnum 4000 G364 video  */
-#define VIDEO_TYPE_SNI_RM	0x32    /* SNI RM200 PCI video          */
 #define VIDEO_TYPE_SGI          0x33    /* Various SGI graphics hardware */
 
 #define VIDEO_TYPE_TGAC		0x40	/* DEC TGA */
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index ba9506f32..bbf6a3813 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -145,7 +145,7 @@ struct tty_operations {
 	void (*send_xchar)(struct tty_struct *tty, char ch);
 	int (*read_proc)(char *page, char **start, off_t off,
 			  int count, int *eof, void *data);
-	int (*write_proc)(struct file *file, const char *buffer,
+	int (*write_proc)(struct file *file, const char __user *buffer,
 			  unsigned long count, void *data);
 	int (*tiocmget)(struct tty_struct *tty, struct file *file);
 	int (*tiocmset)(struct tty_struct *tty, struct file *file,
@@ -207,7 +207,7 @@ struct tty_driver {
 	void (*send_xchar)(struct tty_struct *tty, char ch);
 	int (*read_proc)(char *page, char **start, off_t off,
 			  int count, int *eof, void *data);
-	int (*write_proc)(struct file *file, const char *buffer,
+	int (*write_proc)(struct file *file, const char __user *buffer,
 			  unsigned long count, void *data);
 	int (*tiocmget)(struct tty_struct *tty, struct file *file);
 	int (*tiocmset)(struct tty_struct *tty, struct file *file,
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index c851b7dc9..cb7ca58e4 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -114,9 +114,9 @@ struct tty_ldisc {
 	void	(*flush_buffer)(struct tty_struct *tty);
 	ssize_t	(*chars_in_buffer)(struct tty_struct *tty);
 	ssize_t	(*read)(struct tty_struct * tty, struct file * file,
-			unsigned char * buf, size_t nr);
+			unsigned char __user * buf, size_t nr);
 	ssize_t	(*write)(struct tty_struct * tty, struct file * file,
-			 const unsigned char * buf, size_t nr);	
+			 const unsigned char __user * buf, size_t nr);	
 	int	(*ioctl)(struct tty_struct * tty, struct file * file,
 			 unsigned int cmd, unsigned long arg);
 	void	(*set_termios)(struct tty_struct *tty, struct termios * old);
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
index 4f19d23eb..46e2bb945 100644
--- a/include/linux/udf_fs.h
+++ b/include/linux/udf_fs.h
@@ -40,7 +40,7 @@
 #define UDFFS_DATE			"2004/29/09"
 #define UDFFS_VERSION			"0.9.8.1"
 
-#define UDFFS_DEBUG
+#undef UDFFS_DEBUG
 
 #ifdef UDFFS_DEBUG
 #define udf_debug(f, a...) \
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 608e3a297..4013919ef 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -14,22 +14,12 @@
 #include <linux/delay.h>	/* for mdelay() */
 #include <linux/interrupt.h>	/* for in_interrupt() */
 #include <linux/list.h>		/* for struct list_head */
+#include <linux/kref.h>		/* for struct kref */
 #include <linux/device.h>	/* for struct device */
 #include <linux/fs.h>		/* for struct file_operations */
 #include <linux/completion.h>	/* for struct completion */
 #include <linux/sched.h>	/* for current && schedule_timeout */
 
-
-static __inline__ void wait_ms(unsigned int ms)
-{
-	if(!in_interrupt()) {
-		current->state = TASK_UNINTERRUPTIBLE;
-		schedule_timeout(1 + ms * HZ / 1000);
-	}
-	else
-		mdelay(ms);
-}
-
 struct usb_device;
 struct usb_driver;
 
@@ -146,12 +136,43 @@ void usb_put_intf(struct usb_interface *intf);
 /* this maximum is arbitrary */
 #define USB_MAXINTERFACES	32
 
+/**
+ * struct usb_interface_cache - long-term representation of a device interface
+ * @num_altsetting: number of altsettings defined.
+ * @ref: reference counter.
+ * @altsetting: variable-length array of interface structures, one for
+ *	each alternate setting that may be selected.  Each one includes a
+ *	set of endpoint configurations.  They will be in no particular order.
+ *
+ * These structures persist for the lifetime of a usb_device, unlike
+ * struct usb_interface (which persists only as long as its configuration
+ * is installed).  The altsetting arrays can be accessed through these
+ * structures at any time, permitting comparison of configurations and
+ * providing support for the /proc/bus/usb/devices pseudo-file.
+ */
+struct usb_interface_cache {
+	unsigned num_altsetting;	/* number of alternate settings */
+	struct kref ref;		/* reference counter */
+
+	/* variable-length array of alternate settings for this interface,
+	 * stored in no particular order */
+	struct usb_host_interface altsetting[0];
+};
+#define	ref_to_usb_interface_cache(r) \
+		container_of(r, struct usb_interface_cache, ref)
+#define	altsetting_to_usb_interface_cache(a) \
+		container_of(a, struct usb_interface_cache, altsetting[0])
+
 /**
  * struct usb_host_config - representation of a device's configuration
  * @desc: the device's configuration descriptor.
- * @interface: array of usb_interface structures, one for each interface
- *	in the configuration.  The number of interfaces is stored in
- *	desc.bNumInterfaces.
+ * @interface: array of pointers to usb_interface structures, one for each
+ *	interface in the configuration.  The number of interfaces is stored
+ *	in desc.bNumInterfaces.  These pointers are valid only while the
+ *	the configuration is active.
+ * @intf_cache: array of pointers to usb_interface_cache structures, one
+ *	for each interface in the configuration.  These structures exist
+ *	for the entire life of the device.
  * @extra: pointer to buffer containing all extra descriptors associated
  *	with this configuration (those preceding the first interface
  *	descriptor).
@@ -185,6 +206,10 @@ struct usb_host_config {
 	 * stored in no particular order */
 	struct usb_interface *interface[USB_MAXINTERFACES];
 
+	/* Interface information available even when this is not the
+	 * active configuration */
+	struct usb_interface_cache *intf_cache[USB_MAXINTERFACES];
+
 	unsigned char *extra;   /* Extra descriptors */
 	int extralen;
 };
@@ -309,6 +334,7 @@ extern void usb_put_dev(struct usb_device *dev);
 
 /* mostly for devices emulating SCSI over USB */
 extern int usb_reset_device(struct usb_device *dev);
+extern int __usb_reset_device(struct usb_device *dev);
 
 extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
 
@@ -676,7 +702,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
  * URB_NO_SETUP_DMA_MAP indicate which buffers have already been mapped.
  * URB_NO_SETUP_DMA_MAP is ignored for non-control URBs.
  *
- * Interrupt UBS must provide an interval, saying how often (in milliseconds
+ * Interrupt URBs must provide an interval, saying how often (in milliseconds
  * or, for highspeed devices, 125 microsecond units)
  * to poll for transfers.  After the URB has been submitted, the interval
  * field reflects how the transfer was actually scheduled.
@@ -731,8 +757,8 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
 struct urb
 {
 	/* private, usb core and host controller only fields in the urb */
+	struct kref kref;		/* reference count of the URB */
 	spinlock_t lock;		/* lock for the URB */
-	atomic_t count;			/* reference count of the URB */
 	void *hcpriv;			/* private data for host controller */
 	struct list_head urb_list;	/* list pointer to all active urbs */
 	int bandwidth;			/* bandwidth for INT/ISO request */
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 129927386..4235d9f35 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -154,7 +154,6 @@ struct usbdevfs_hub_portinfo {
 
 struct dev_state {
 	struct list_head list;      /* state list */
-	struct rw_semaphore devsem; /* protects modifications to dev (dev == NULL indicating disconnect) */ 
 	struct usb_device *dev;
 	struct file *file;
 	spinlock_t lock;            /* protects the async urb lists */
diff --git a/include/linux/video_decoder.h b/include/linux/video_decoder.h
index 1302c7f44..0e9e48b83 100644
--- a/include/linux/video_decoder.h
+++ b/include/linux/video_decoder.h
@@ -22,6 +22,10 @@ DECODER_STATUS_GOOD, the others are just nice things to know.
 #define	DECODER_STATUS_NTSC	8	/* auto detected */
 #define	DECODER_STATUS_SECAM	16	/* auto detected */
 
+struct video_decoder_init {
+	unsigned char len;
+	const unsigned char *data;
+};
 
 #define	DECODER_GET_CAPABILITIES _IOR('d', 1, struct video_decoder_capability)
 #define	DECODER_GET_STATUS    	_IOR('d', 2, int)
@@ -30,6 +34,9 @@ DECODER_STATUS_GOOD, the others are just nice things to know.
 #define	DECODER_SET_OUTPUT	_IOW('d', 5, int)	/* 0 <= output < #outputs */
 #define	DECODER_ENABLE_OUTPUT	_IOW('d', 6, int)	/* boolean output enable control */
 #define	DECODER_SET_PICTURE   	_IOW('d', 7, struct video_picture)
+#define	DECODER_SET_GPIO	_IOW('d', 8, int)	/* switch general purpose pin */
+#define	DECODER_INIT		_IOW('d', 9, struct video_decoder_init)	/* init internal registers at once */
+#define	DECODER_SET_VBI_BYPASS	_IOW('d', 10, int)	/* switch vbi bypass */
 
 #define	DECODER_DUMP		_IO('d', 192)		/* debug hook */
 
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index d1f3c979c..c310bcadc 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -49,8 +49,8 @@ void do_unblank_screen(int leaving_gfx);
 void unblank_screen(void);
 void poke_blanked_console(void);
 int con_font_op(int currcons, struct console_font_op *op);
-int con_set_cmap(unsigned char *cmap);
-int con_get_cmap(unsigned char *cmap);
+int con_set_cmap(unsigned char __user *cmap);
+int con_get_cmap(unsigned char __user *cmap);
 void scrollback(int);
 void scrollfront(int);
 void update_region(int currcons, unsigned long start, int count);
@@ -66,13 +66,13 @@ int tioclinux(struct tty_struct *tty, unsigned long arg);
 struct unimapinit;
 struct unipair;
 
-int con_set_trans_old(unsigned char * table);
-int con_get_trans_old(unsigned char * table);
-int con_set_trans_new(unsigned short * table);
-int con_get_trans_new(unsigned short * table);
+int con_set_trans_old(unsigned char __user * table);
+int con_get_trans_old(unsigned char __user * table);
+int con_set_trans_new(unsigned short __user * table);
+int con_get_trans_new(unsigned short __user * table);
 int con_clear_unimap(int currcons, struct unimapinit *ui);
-int con_set_unimap(int currcons, ushort ct, struct unipair *list);
-int con_get_unimap(int currcons, ushort ct, ushort *uct, struct unipair *list);
+int con_set_unimap(int currcons, ushort ct, struct unipair __user *list);
+int con_get_unimap(int currcons, ushort ct, ushort __user *uct, struct unipair __user *list);
 int con_set_default_unimap(int currcons);
 void con_free_unimap(int currcons);
 void con_protect_unimap(int currcons, int rdonly);
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 17bdd85d7..52edb1786 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -17,8 +17,8 @@
 #include <asm/system.h>
 
 typedef struct __wait_queue wait_queue_t;
-typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync);
-extern int default_wake_function(wait_queue_t *wait, unsigned mode, int sync);
+typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key);
+int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
 
 struct __wait_queue {
 	unsigned int flags;
@@ -104,17 +104,17 @@ static inline void __remove_wait_queue(wait_queue_head_t *head,
 	list_del(&old->task_list);
 }
 
-extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr));
+void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key));
 extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode));
 extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr));
 
-#define wake_up(x)			__wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1)
-#define wake_up_nr(x, nr)		__wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr)
-#define wake_up_all(x)			__wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0)
+#define wake_up(x)			__wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, NULL)
+#define wake_up_nr(x, nr)		__wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr, NULL)
+#define wake_up_all(x)			__wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0, NULL)
 #define wake_up_all_sync(x)			__wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0)
-#define wake_up_interruptible(x)	__wake_up((x),TASK_INTERRUPTIBLE, 1)
-#define wake_up_interruptible_nr(x, nr)	__wake_up((x),TASK_INTERRUPTIBLE, nr)
-#define wake_up_interruptible_all(x)	__wake_up((x),TASK_INTERRUPTIBLE, 0)
+#define wake_up_interruptible(x)	__wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
+#define wake_up_interruptible_nr(x, nr)	__wake_up(x, TASK_INTERRUPTIBLE, nr, NULL)
+#define wake_up_interruptible_all(x)	__wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
 #define	wake_up_locked(x)		__wake_up_locked((x), TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
 #define wake_up_interruptible_sync(x)   __wake_up_sync((x),TASK_INTERRUPTIBLE, 1)
 
@@ -240,7 +240,7 @@ void FASTCALL(prepare_to_wait(wait_queue_head_t *q,
 void FASTCALL(prepare_to_wait_exclusive(wait_queue_head_t *q,
 				wait_queue_t *wait, int state));
 void FASTCALL(finish_wait(wait_queue_head_t *q, wait_queue_t *wait));
-int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync);
+int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
 
 #define DEFINE_WAIT(name)						\
 	wait_queue_t name = {						\
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index e208b6f07..88ba0d29f 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -10,6 +10,7 @@
 #define _LINUX_WATCHDOG_H
 
 #include <linux/ioctl.h>
+#include <linux/types.h>
 
 #define	WATCHDOG_IOCTL_BASE	'W'
 
diff --git a/include/linux/wavefront.h b/include/linux/wavefront.h
index 746102627..61bd0fd35 100644
--- a/include/linux/wavefront.h
+++ b/include/linux/wavefront.h
@@ -534,8 +534,8 @@ typedef struct wf_patch_info {
 				  WF_{GET,SET}_CHANNEL above.
 
 			       */
-    wavefront_any *hdrptr;      /* user-space ptr to hdr bytes */
-    UINT16 *dataptr;            /* actual sample data */
+    wavefront_any __user *hdrptr;      /* user-space ptr to hdr bytes */
+    UINT16 __user *dataptr;            /* actual sample data */
 
     wavefront_any hdr;          /* kernel-space copy of hdr bytes */         
 } wavefront_patch_info;
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 430370b12..5bd22740c 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -152,8 +152,9 @@ enum xfrm_attr_type_t {
 	XFRMA_ALG_COMP,		/* struct xfrm_algo */
 	XFRMA_ENCAP,		/* struct xfrm_algo + struct xfrm_encap_tmpl */
 	XFRMA_TMPL,		/* 1 or more struct xfrm_user_tmpl */
+	__XFRMA_MAX
 
-#define XFRMA_MAX XFRMA_TMPL
+#define XFRMA_MAX (__XFRMA_MAX - 1)
 };
 
 struct xfrm_usersa_info {
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index b1a99b8b7..4928cfdf1 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -52,9 +52,9 @@ struct prefix_info {
 extern void			addrconf_init(void);
 extern void			addrconf_cleanup(void);
 
-extern int			addrconf_add_ifaddr(void *arg);
-extern int			addrconf_del_ifaddr(void *arg);
-extern int			addrconf_set_dstaddr(void *arg);
+extern int			addrconf_add_ifaddr(void __user *arg);
+extern int			addrconf_del_ifaddr(void __user *arg);
+extern int			addrconf_set_dstaddr(void __user *arg);
 
 extern int			ipv6_chk_addr(struct in6_addr *addr,
 					      struct net_device *dev,
diff --git a/include/net/arp.h b/include/net/arp.h
index 61fd735c7..a1f09fad6 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -13,7 +13,7 @@ extern void	arp_init(void);
 extern int	arp_rcv(struct sk_buff *skb, struct net_device *dev,
 			struct packet_type *pt);
 extern int	arp_find(unsigned char *haddr, struct sk_buff *skb);
-extern int	arp_ioctl(unsigned int cmd, void *arg);
+extern int	arp_ioctl(unsigned int cmd, void __user *arg);
 extern void     arp_send(int type, int ptype, u32 dest_ip, 
 			 struct net_device *dev, u32 src_ip, 
 			 unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th);
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 26b5553e3..bf86bf67b 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -312,7 +312,7 @@ extern int  ax25_check_iframes_acked(ax25_cb *, unsigned short);
 
 /* ax25_route.c */
 extern void ax25_rt_device_down(struct net_device *);
-extern int  ax25_rt_ioctl(unsigned int, void *);
+extern int  ax25_rt_ioctl(unsigned int, void __user *);
 extern struct file_operations ax25_route_fops;
 extern int  ax25_rt_autobind(ax25_cb *, ax25_address *);
 extern ax25_route *ax25_rt_find_route(ax25_route *, ax25_address *,
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 99301bd80..0106480b3 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -22,10 +22,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- *  $Id: bluetooth.h,v 1.8 2002/04/17 17:37:20 maxk Exp $
- */
-
 #ifndef __BLUETOOTH_H
 #define __BLUETOOTH_H
 
@@ -41,26 +37,27 @@
 #endif
 
 /* Reserv for core and drivers use */
-#define BT_SKB_RESERVE       8
+#define BT_SKB_RESERVE	8
 
-#define BTPROTO_L2CAP   0
-#define BTPROTO_HCI     1
-#define BTPROTO_SCO   	2
+#define BTPROTO_L2CAP	0
+#define BTPROTO_HCI	1
+#define BTPROTO_SCO	2
 #define BTPROTO_RFCOMM	3
 #define BTPROTO_BNEP	4
 #define BTPROTO_CMTP	5
+#define BTPROTO_HIDP	6
 
-#define SOL_HCI     0
-#define SOL_L2CAP   6
-#define SOL_SCO     17
-#define SOL_RFCOMM  18
+#define SOL_HCI		0
+#define SOL_L2CAP	6
+#define SOL_SCO		17
+#define SOL_RFCOMM	18
 
 #define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg)
 #define BT_DBG(fmt, arg...)  printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg)
 #define BT_ERR(fmt, arg...)  printk(KERN_ERR  "%s: " fmt "\n" , __FUNCTION__ , ## arg)
 
 #ifdef HCI_DATA_DUMP
-#define BT_DMP(buf, len)    bt_dump(__FUNCTION__, buf, len)
+#define BT_DMP(buf, len) bt_dump(__FUNCTION__, buf, len)
 #else
 #define BT_DMP(D...)
 #endif
@@ -122,7 +119,7 @@ struct bt_sock {
 
 struct bt_sock_list {
 	struct hlist_head head;
-	rwlock_t	  lock;
+	rwlock_t          lock;
 };
 
 int  bt_sock_register(int proto, struct net_proto_family *ops);
@@ -139,7 +136,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock);
 
 /* Skb helpers */
 struct bt_skb_cb {
-	int    incoming;
+	int incoming;
 };
 #define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb)) 
 
@@ -155,7 +152,7 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, int how)
 }
 
 static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long len, 
-						       int nb, int *err)
+							int nb, int *err)
 {
 	struct sk_buff *skb;
 
@@ -178,6 +175,6 @@ static inline int skb_frags_no(struct sk_buff *skb)
 
 void bt_dump(char *pref, __u8 *buf, int count);
 
-int  bt_err(__u16 code);
+int bt_err(__u16 code);
 
 #endif /* __BLUETOOTH_H */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 7edb678be..8bdea5773 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -22,10 +22,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- *  $Id: hci.h,v 1.4 2002/04/18 22:26:15 maxk Exp $
- */
-
 #ifndef __HCI_H
 #define __HCI_H
 
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index eed980fb1..830888147 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -22,10 +22,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/* 
- * $Id: hci_core.h,v 1.3 2002/04/17 18:55:21 maxk Exp $ 
- */
-
 #ifndef __HCI_CORE_H
 #define __HCI_CORE_H
 
@@ -63,12 +59,12 @@ struct hci_conn_hash {
 struct hci_dev {
 	struct list_head list;
 	spinlock_t	lock;
-	atomic_t 	refcnt;
+	atomic_t	refcnt;
 
 	char		name[8];
 	unsigned long	flags;
 	__u16		id;
-	__u8	 	type;
+	__u8		type;
 	bdaddr_t	bdaddr;
 	__u8		features[8];
 	__u16		voice_setting;
@@ -79,38 +75,38 @@ struct hci_dev {
 
 	unsigned long	quirks;
 
-	atomic_t 	cmd_cnt;
-	unsigned int 	acl_cnt;
-	unsigned int 	sco_cnt;
+	atomic_t	cmd_cnt;
+	unsigned int	acl_cnt;
+	unsigned int	sco_cnt;
 
 	unsigned int	acl_mtu;
-	unsigned int 	sco_mtu;
+	unsigned int	sco_mtu;
 	unsigned int	acl_pkts;
 	unsigned int	sco_pkts;
 
-	unsigned long   cmd_last_tx;
-	unsigned long   acl_last_tx;
-	unsigned long   sco_last_tx;
+	unsigned long	cmd_last_tx;
+	unsigned long	acl_last_tx;
+	unsigned long	sco_last_tx;
 
-	struct tasklet_struct 	cmd_task;
+	struct tasklet_struct	cmd_task;
 	struct tasklet_struct	rx_task;
-	struct tasklet_struct 	tx_task;
+	struct tasklet_struct	tx_task;
 
 	struct sk_buff_head	rx_q;
-	struct sk_buff_head 	raw_q;
-	struct sk_buff_head 	cmd_q;
+	struct sk_buff_head	raw_q;
+	struct sk_buff_head	cmd_q;
 
-	struct sk_buff     	*sent_cmd;
+	struct sk_buff		*sent_cmd;
 
 	struct semaphore	req_lock;
 	wait_queue_head_t	req_wait_q;
 	__u32			req_status;
 	__u32			req_result;
 
-	struct inquiry_cache 	inq_cache;
-	struct hci_conn_hash 	conn_hash;
+	struct inquiry_cache	inq_cache;
+	struct hci_conn_hash	conn_hash;
 
-	struct hci_dev_stats 	stat;
+	struct hci_dev_stats	stat;
 
 	void			*driver_data;
 	void			*core_data;
@@ -118,12 +114,12 @@ struct hci_dev {
 	atomic_t 		promisc;
 
 #ifdef CONFIG_PROC_FS
-	struct proc_dir_entry   *proc;
+	struct proc_dir_entry	*proc;
 #endif
 
 	struct class_device	class_dev;
 
-	struct module           *owner;
+	struct module 		*owner;
 
 	int (*open)(struct hci_dev *hdev);
 	int (*close)(struct hci_dev *hdev);
@@ -140,9 +136,9 @@ struct hci_conn {
 	atomic_t	 refcnt;
 	spinlock_t	 lock;
 
-	bdaddr_t         dst;
-	__u16            handle;
-	__u16            state;
+	bdaddr_t	 dst;
+	__u16		 handle;
+	__u16		 state;
 	__u8		 type;
 	__u8		 out;
 	__u32		 link_mode;
@@ -154,12 +150,12 @@ struct hci_conn {
 
 	struct timer_list timer;
 	
-	struct hci_dev 	*hdev;
+	struct hci_dev	*hdev;
 	void		*l2cap_data;
 	void		*sco_data;
 	void		*priv;
 
-	struct hci_conn *link;
+	struct hci_conn	*link;
 };
 
 extern struct hci_proto *hci_proto[];
@@ -215,7 +211,7 @@ static inline void hci_conn_hash_init(struct hci_dev *hdev)
 	struct hci_conn_hash *h = &hdev->conn_hash;
 	INIT_LIST_HEAD(&h->list);
 	spin_lock_init(&h->lock);
-	h->num = 0;	
+	h->num = 0;
 }
 
 static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
@@ -233,7 +229,7 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
 }
 
 static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
-	       				__u16 handle)
+					__u16 handle)
 {
 	struct hci_conn_hash *h = &hdev->conn_hash;
 	struct list_head *p;
@@ -244,7 +240,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
 		if (c->handle == handle)
 			return c;
 	}
-        return NULL;
+	return NULL;
 }
 
 static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
@@ -259,7 +255,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
 		if (c->type == type && !bacmp(&c->dst, ba))
 			return c;
 	}
-        return NULL;
+	return NULL;
 }
 
 void hci_acl_connect(struct hci_conn *conn);
@@ -362,12 +358,12 @@ int hci_dev_open(__u16 dev);
 int hci_dev_close(__u16 dev);
 int hci_dev_reset(__u16 dev);
 int hci_dev_reset_stat(__u16 dev);
-int hci_dev_cmd(unsigned int cmd, unsigned long arg);
-int hci_get_dev_list(unsigned long arg);
-int hci_get_dev_info(unsigned long arg);
-int hci_get_conn_list(unsigned long arg);
-int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg);
-int hci_inquiry(unsigned long arg);
+int hci_dev_cmd(unsigned int cmd, void __user *arg);
+int hci_get_dev_list(void __user *arg);
+int hci_get_dev_info(void __user *arg);
+int hci_get_conn_list(void __user *arg);
+int hci_get_conn_info(struct hci_dev *hdev, void __user *arg);
+int hci_inquiry(void __user *arg);
 
 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
 
@@ -506,7 +502,7 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
 /* HCI info for socket */
 #define hci_pi(sk)	((struct hci_pinfo *)sk->sk_protinfo)
 struct hci_pinfo {
-	struct hci_dev 	  *hdev;
+	struct hci_dev    *hdev;
 	struct hci_filter filter;
 	__u32             cmsg_mask;
 };
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index ea239a1ff..d420305ff 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -22,18 +22,14 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- *  $Id: l2cap.h,v 1.1.1.1 2002/03/08 21:03:15 maxk Exp $
- */
-
 #ifndef __L2CAP_H
 #define __L2CAP_H
 
 /* L2CAP defaults */
-#define L2CAP_DEFAULT_MTU 	672
+#define L2CAP_DEFAULT_MTU	672
 #define L2CAP_DEFAULT_FLUSH_TO	0xFFFF
 
-#define L2CAP_CONN_TIMEOUT 	(HZ * 40)
+#define L2CAP_CONN_TIMEOUT	(HZ * 40)
 
 /* L2CAP socket address */
 struct sockaddr_l2 {
@@ -190,10 +186,10 @@ struct l2cap_chan_list {
 struct l2cap_conn {
 	struct hci_conn	*hcon;
 
-	bdaddr_t 	*dst;
-	bdaddr_t 	*src;
+	bdaddr_t	*dst;
+	bdaddr_t	*src;
 	
-	unsigned int    mtu;
+	unsigned int	mtu;
 
 	spinlock_t	lock;
 	
@@ -227,9 +223,9 @@ struct l2cap_pinfo {
 
 	__u16		sport;
 
-	struct l2cap_conn 	*conn;
-	struct sock 		*next_c;
-	struct sock 		*prev_c;
+	struct l2cap_conn	*conn;
+	struct sock		*next_c;
+	struct sock		*prev_c;
 };
 
 #define L2CAP_CONF_REQ_SENT    0x01
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index e022bfbb5..819b06dfb 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -21,14 +21,6 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/* 
-   RPN support    -    Dirk Husemann <hud@zurich.ibm.com>
-*/
-
-/*
- * $Id: rfcomm.h,v 1.29 2002/10/02 20:26:17 maxk Exp $
- */
-
 #ifndef __RFCOMM_H
 #define __RFCOMM_H
 
@@ -356,7 +348,7 @@ struct rfcomm_dev_list_req {
 	struct   rfcomm_dev_info dev_info[0];
 };
 
-int  rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, unsigned long arg);
+int  rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
 int  rfcomm_init_ttys(void);
 void rfcomm_cleanup_ttys(void);
 
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h
index 7f83037a0..a1c469cb7 100644
--- a/include/net/bluetooth/sco.h
+++ b/include/net/bluetooth/sco.h
@@ -22,19 +22,15 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- *  $Id: sco.h,v 1.1.1.1 2002/03/08 21:03:15 maxk Exp $
- */
-
 #ifndef __SCO_H
 #define __SCO_H
 
 /* SCO defaults */
-#define SCO_DEFAULT_MTU 	500
+#define SCO_DEFAULT_MTU		500
 #define SCO_DEFAULT_FLUSH_TO	0xFFFF
 
-#define SCO_CONN_TIMEOUT 	(HZ * 40)
-#define SCO_DISCONN_TIMEOUT 	(HZ * 2)
+#define SCO_CONN_TIMEOUT	(HZ * 40)
+#define SCO_DISCONN_TIMEOUT	(HZ * 2)
 #define SCO_CONN_IDLE_TIMEOUT	(HZ * 60)
 
 /* SCO socket address */
diff --git a/include/net/checksum.h b/include/net/checksum.h
index cbad33338..cd3c52a59 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -95,7 +95,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
 
 #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
 static inline
-unsigned int csum_and_copy_from_user (const char *src, char *dst,
+unsigned int csum_and_copy_from_user (const char __user *src, char *dst,
 				      int len, int sum, int *err_ptr)
 {
 	if (verify_area(VERIFY_READ, src, len) == 0)
@@ -110,7 +110,7 @@ unsigned int csum_and_copy_from_user (const char *src, char *dst,
 
 #ifndef HAVE_CSUM_COPY_USER
 static __inline__ unsigned int csum_and_copy_to_user
-(const char *src, char *dst, int len, unsigned int sum, int *err_ptr)
+(const char *src, char __user *dst, int len, unsigned int sum, int *err_ptr)
 {
 	sum = csum_partial(src, len, sum);
 
diff --git a/include/net/compat.h b/include/net/compat.h
index b16354135..9983fd857 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -29,9 +29,9 @@ struct compat_cmsghdr {
 
 extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *);
 extern int verify_compat_iovec(struct msghdr *, struct iovec *, char *, int);
-extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr *,unsigned);
-extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr *,unsigned);
-extern asmlinkage long compat_sys_getsockopt(int, int, int, char *, int *);
+extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned);
+extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
+extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
 extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
 extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, unsigned char *,
 		int);
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index 120465fd2..86e8e86e6 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -155,7 +155,7 @@ struct rtnode_hello_message
 extern void dn_dev_init(void);
 extern void dn_dev_cleanup(void);
 
-extern int dn_dev_ioctl(unsigned int cmd, void *arg);
+extern int dn_dev_ioctl(unsigned int cmd, void __user *arg);
 
 extern void dn_dev_devices_off(void);
 extern void dn_dev_devices_on(void);
diff --git a/include/net/dst.h b/include/net/dst.h
index 42dd8f511..ed2504c6b 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -67,7 +67,7 @@ struct dst_entry
 	struct xfrm_state	*xfrm;
 
 	int			(*input)(struct sk_buff*);
-	int			(*output)(struct sk_buff*);
+	int			(*output)(struct sk_buff**);
 
 #ifdef CONFIG_NET_CLS_ROUTE
 	__u32			tclassid;
@@ -89,6 +89,7 @@ struct dst_ops
 	int			(*gc)(void);
 	struct dst_entry *	(*check)(struct dst_entry *, __u32 cookie);
 	void			(*destroy)(struct dst_entry *);
+	void			(*ifdown)(struct dst_entry *, int how);
 	struct dst_entry *	(*negative_advice)(struct dst_entry *);
 	void			(*link_failure)(struct sk_buff *);
 	void			(*update_pmtu)(struct dst_entry *dst, u32 mtu);
@@ -219,7 +220,7 @@ static inline int dst_output(struct sk_buff *skb)
 	int err;
 
 	for (;;) {
-		err = skb->dst->output(skb);
+		err = skb->dst->output(&skb);
 
 		if (likely(err == 0))
 			return err;
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 3b0624e7b..e30543604 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -31,11 +31,13 @@ extern int			inet_sendmsg(struct kiocb *iocb,
 extern int			inet_shutdown(struct socket *sock, int how);
 extern unsigned int		inet_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
 extern int			inet_setsockopt(struct socket *sock, int level,
-						int optname, char *optval, 
+						int optname,
+						char __user *optval, 
 						int optlen);
 extern int			inet_getsockopt(struct socket *sock, int level,
-						int optname, char *optval, 
-						int *optlen);
+						int optname,
+						char __user *optval, 
+						int __user *optlen);
 extern int			inet_listen(struct socket *sock, int backlog);
 
 extern void			inet_sock_release(struct sock *sk);
diff --git a/include/net/ip.h b/include/net/ip.h
index 97f509935..5a683ccd4 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -92,8 +92,8 @@ extern int		ip_rcv(struct sk_buff *skb, struct net_device *dev,
 			       struct packet_type *pt);
 extern int		ip_local_deliver(struct sk_buff *skb);
 extern int		ip_mr_input(struct sk_buff *skb);
-extern int		ip_output(struct sk_buff *skb);
-extern int		ip_mc_output(struct sk_buff *skb);
+extern int		ip_output(struct sk_buff **pskb);
+extern int		ip_mc_output(struct sk_buff **pskb);
 extern int		ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*));
 extern int		ip_do_nat(struct sk_buff *skb);
 extern void		ip_send_check(struct iphdr *ip);
@@ -150,7 +150,7 @@ struct ipv4_config
 };
 
 extern struct ipv4_config ipv4_config;
-DECLARE_SNMP_STAT(struct ip_mib, ip_statistics);
+DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics);
 #define IP_INC_STATS(field)		SNMP_INC_STATS(ip_statistics, field)
 #define IP_INC_STATS_BH(field)		SNMP_INC_STATS_BH(ip_statistics, field)
 #define IP_INC_STATS_USER(field) 	SNMP_INC_STATS_USER(ip_statistics, field)
@@ -284,8 +284,8 @@ extern int ip_options_rcv_srr(struct sk_buff *skb);
 
 extern void	ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb);
 extern int	ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc);
-extern int	ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen);
-extern int	ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen);
+extern int	ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen);
+extern int	ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen);
 extern int	ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *));
 
 extern int 	ip_recv_error(struct sock *sk, struct msghdr *msg, int len);
@@ -300,11 +300,11 @@ extern int ipv4_proc_init(void);
  * fed into the routing cache should use these handlers.
  */
 int ipv4_doint_and_flush(ctl_table *ctl, int write,
-			 struct file* filp, void *buffer,
+			 struct file* filp, void __user *buffer,
 			 size_t *lenp);
-int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen,
-				  void *oldval, size_t *oldlenp,
-				  void *newval, size_t newlen, 
+int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
+				  void __user *oldval, size_t __user *oldlenp,
+				  void __user *newval, size_t newlen, 
 				  void **context);
 
 #endif	/* _IP_H */
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index d0ca2230a..14d41c4ba 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -57,6 +57,8 @@ struct rt6_info
 		struct rt6_info		*next;
 	} u;
 
+	struct inet6_dev		*rt6i_idev;
+
 #define rt6i_dev			u.dst.dev
 #define rt6i_nexthop			u.dst.neighbour
 #define rt6i_expires			u.dst.expires
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 794ff3547..291149080 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -35,7 +35,7 @@ extern int			ip6_route_me_harder(struct sk_buff *skb);
 extern void			ip6_route_init(void);
 extern void			ip6_route_cleanup(void);
 
-extern int			ipv6_route_ioctl(unsigned int cmd, void *arg);
+extern int			ipv6_route_ioctl(unsigned int cmd, void __user *arg);
 
 extern int			ip6_route_add(struct in6_rtmsg *rtmsg,
 					      struct nlmsghdr *,
@@ -65,7 +65,7 @@ extern struct rt6_info		*rt6_lookup(struct in6_addr *daddr,
 extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
 					 struct neighbour *neigh,
 					 struct in6_addr *addr,
-					 int (*output)(struct sk_buff *));
+					 int (*output)(struct sk_buff **));
 extern int ndisc_dst_gc(int *more);
 extern void fib6_force_start_gc(void);
 
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index b647b048b..8f647ae8e 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -111,7 +111,7 @@ extern int sysctl_ipv6_bindv6only;
 extern int sysctl_mld_max_msf;
 
 /* MIBs */
-DECLARE_SNMP_STAT(struct ipv6_mib, ipv6_statistics);
+DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
 #define IP6_INC_STATS(field)		SNMP_INC_STATS(ipv6_statistics, field)
 #define IP6_INC_STATS_BH(field)		SNMP_INC_STATS_BH(ipv6_statistics, field)
 #define IP6_INC_STATS_USER(field) 	SNMP_INC_STATS_USER(ipv6_statistics, field)
@@ -215,7 +215,7 @@ extern struct ipv6_txoptions	*fl6_merge_options(struct ipv6_txoptions * opt_spac
 						   struct ip6_flowlabel * fl,
 						   struct ipv6_txoptions * fopt);
 extern void			fl6_free_socklist(struct sock *sk);
-extern int			ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen);
+extern int			ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen);
 extern void			ip6_flowlabel_init(void);
 extern void			ip6_flowlabel_cleanup(void);
 
@@ -355,8 +355,7 @@ extern int			ip6_dst_lookup(struct sock *sk,
  *	skb processing functions
  */
 
-extern int			ip6_output(struct sk_buff *skb);
-extern int			ip6_output2(struct sk_buff *skb);
+extern int			ip6_output(struct sk_buff **pskb);
 extern int			ip6_forward(struct sk_buff *skb);
 extern int			ip6_input(struct sk_buff *skb);
 extern int			ip6_mc_input(struct sk_buff *skb);
@@ -395,11 +394,13 @@ extern struct ipv6_txoptions *	ipv6_invert_rthdr(struct sock *sk,
  */
 
 extern int			ipv6_setsockopt(struct sock *sk, int level, 
-						int optname, char *optval, 
+						int optname,
+						char __user *optval, 
 						int optlen);
 extern int			ipv6_getsockopt(struct sock *sk, int level, 
-						int optname, char *optval, 
-						int *optlen);
+						int optname,
+						char __user *optval, 
+						int __user *optlen);
 
 extern void			ipv6_packet_init(void);
 
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 44ac1b099..497f6a397 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -83,8 +83,6 @@ if(!(expr)) do { \
 #define MESSAGE(args...) printk(KERN_INFO args)
 #define ERROR(args...)   printk(KERN_ERR args)
 
-#define MSECS_TO_JIFFIES(ms) (((ms)*HZ+999)/1000)
-
 /*
  *  Magic numbers used by Linux-IrDA. Random numbers which must be unique to 
  *  give the best protection
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 2f0c8f385..d75b81958 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -251,7 +251,7 @@ LM_REASON irlmp_convert_lap_reason(LAP_REASON);
 
 static inline __u32 irlmp_get_saddr(const struct lsap_cb *self)
 {
-	return (self && !self->lap) ? self->lap->saddr : 0;
+	return (self && self->lap) ? self->lap->saddr : 0;
 }
 
 static inline __u32 irlmp_get_daddr(const struct lsap_cb *self)
diff --git a/include/net/netrom.h b/include/net/netrom.h
index 01ee60459..816878041 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -206,7 +206,7 @@ extern void nr_check_iframes_acked(struct sock *, unsigned short);
 extern void nr_rt_device_down(struct net_device *);
 extern struct net_device *nr_dev_first(void);
 extern struct net_device *nr_dev_get(ax25_address *);
-extern int  nr_rt_ioctl(unsigned int, void *);
+extern int  nr_rt_ioctl(unsigned int, void __user *);
 extern void nr_link_failed(ax25_cb *, int);
 extern int  nr_route_frame(struct sk_buff *, ax25_cb *);
 extern struct file_operations nr_nodes_fops;
diff --git a/include/net/rose.h b/include/net/rose.h
index d164466a5..f3382358e 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -207,7 +207,7 @@ extern struct net_device *rose_dev_get(rose_address *);
 extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *);
 extern struct net_device *rose_ax25_dev_get(char *);
 extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *);
-extern int  rose_rt_ioctl(unsigned int, void *);
+extern int  rose_rt_ioctl(unsigned int, void __user *);
 extern void rose_link_failed(ax25_cb *, int);
 extern int  rose_route_frame(struct sk_buff *, ax25_cb *);
 extern void rose_rt_free(void);
diff --git a/include/net/route.h b/include/net/route.h
index 7a851de92..0e7210e6d 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -55,6 +55,8 @@ struct rtable
 		struct rtable		*rt_next;
 	} u;
 
+	struct in_device	*idev;
+	
 	unsigned		rt_flags;
 	unsigned		rt_type;
 
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 2f5e32ebd..c3088c127 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -93,6 +93,7 @@ typedef enum {
 	SCTP_CMD_PROCESS_OPERR,  /* Process an ERROR chunk. */
 	SCTP_CMD_REPORT_FWDTSN,	 /* Report new cumulative TSN Ack. */
 	SCTP_CMD_PROCESS_FWDTSN, /* Skips were reported, so process further. */
+	SCTP_CMD_CLEAR_INIT_TAG, /* Clears association peer's inittag. */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index efceb30d6..17d0f9adc 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -116,11 +116,6 @@
 #define SCTP_STATIC static
 #endif
 
-#define MSECS_TO_JIFFIES(msec) \
-	(((msec / 1000) * HZ) + ((msec % 1000) * HZ) / 1000)
-#define JIFFIES_TO_MSECS(jiff) \
-	(((jiff / HZ) * 1000) + ((jiff % HZ) * 1000) / HZ)
-
 /*
  * Function declarations.
  */
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 70384234f..a73cea970 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -440,6 +440,23 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a
 		BUG();
 }
 
+/* Check VTAG of the packet matches the sender's own tag. */
+static inline int
+sctp_vtag_verify(const struct sctp_chunk *chunk,
+		 const struct sctp_association *asoc)
+{
+	/* RFC 2960 Sec 8.5 When receiving an SCTP packet, the endpoint
+	 * MUST ensure that the value in the Verification Tag field of
+	 * the received SCTP packet matches its own Tag. If the received
+	 * Verification Tag value does not match the receiver's own
+	 * tag value, the receiver shall silently discard the packet...
+	 */
+        if (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)
+                return 1;
+
+	return 0;
+}
+
 /* Check VTAG of the packet matches the sender's own tag OR its peer's
  * tag and the T bit is set in the Chunk Flags.
  */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 691f146f2..26c97aa3a 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -437,13 +437,13 @@ struct sctp_af {
 	int		(*setsockopt)	(struct sock *sk,
 					 int level,
 					 int optname,
-					 char *optval,
+					 char __user *optval,
 					 int optlen);
 	int		(*getsockopt)	(struct sock *sk,
 					 int level,
 					 int optname,
-					 char *optval,
-					 int *optlen);
+					 char __user *optval,
+					 int __user *optlen);
 	struct dst_entry *(*get_dst)	(struct sctp_association *asoc,
 					 union sctp_addr *daddr,
 					 union sctp_addr *saddr);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 290f9969d..04e991780 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -559,7 +559,7 @@ struct sctp_status {
 struct sctp_getaddrs {
 	sctp_assoc_t            assoc_id;
 	int			addr_num;
-	struct sockaddr		*addrs;
+	struct sockaddr		__user *addrs;
 };
 
 /* These are bit fields for msghdr->msg_flags.  See section 5.1.  */
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 67e22b82e..c702dda23 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -41,61 +41,52 @@
  * cacheline machine it makes a *lot* of sense -AK
  */ 
 
- 
+struct snmp_item {
+	char *name;
+	int offset;
+};
+
+#define SNMP_ITEM(mib,entry,procname)	{	\
+	.name = procname,			\
+	.offset = offsetof(mib, entry),		\
+}
+
+#define SNMP_ITEM_SENTINEL {			\
+	.name = NULL,				\
+	.offset = 0,				\
+}
+
 /*
  * RFC 1213:  MIB-II
  * RFC 2011 (updates 1213):  SNMPv2-MIB-IP
  * RFC 2863:  Interfaces Group MIB
- */
-struct ip_mib
-{
- 	unsigned long	IpInReceives;
- 	unsigned long	IpInHdrErrors;
- 	unsigned long	IpInAddrErrors;
- 	unsigned long	IpForwDatagrams;
- 	unsigned long	IpInUnknownProtos;
- 	unsigned long	IpInDiscards;
- 	unsigned long	IpInDelivers;
- 	unsigned long	IpOutRequests;
- 	unsigned long	IpOutDiscards;
- 	unsigned long	IpOutNoRoutes;
- 	unsigned long	IpReasmTimeout;
- 	unsigned long	IpReasmReqds;
- 	unsigned long	IpReasmOKs;
- 	unsigned long	IpReasmFails;
- 	unsigned long	IpFragOKs;
- 	unsigned long	IpFragFails;
- 	unsigned long	IpFragCreates;
-	unsigned long   __pad[0]; 
-};
- 
-/*
  * RFC 2465:  IPv6 MIB: General Group
+ * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
  */
-struct ipv6_mib
+struct ipstats_mib
 {
-	unsigned long	Ip6InReceives;
- 	unsigned long	Ip6InHdrErrors;
- 	unsigned long	Ip6InTooBigErrors;
- 	unsigned long	Ip6InNoRoutes;
- 	unsigned long	Ip6InAddrErrors;
- 	unsigned long	Ip6InUnknownProtos;
- 	unsigned long	Ip6InTruncatedPkts;
- 	unsigned long	Ip6InDiscards;
- 	unsigned long	Ip6InDelivers;
- 	unsigned long	Ip6OutForwDatagrams;
- 	unsigned long	Ip6OutRequests;
- 	unsigned long	Ip6OutDiscards;
- 	unsigned long	Ip6OutNoRoutes;
- 	unsigned long	Ip6ReasmTimeout;
- 	unsigned long	Ip6ReasmReqds;
- 	unsigned long	Ip6ReasmOKs;
- 	unsigned long	Ip6ReasmFails;
- 	unsigned long	Ip6FragOKs;
- 	unsigned long	Ip6FragFails;
- 	unsigned long	Ip6FragCreates;
- 	unsigned long	Ip6InMcastPkts;
- 	unsigned long	Ip6OutMcastPkts;
+	unsigned long	InReceives;
+ 	unsigned long	InHdrErrors;
+ 	unsigned long	InTooBigErrors;
+ 	unsigned long	InNoRoutes;
+ 	unsigned long	InAddrErrors;
+ 	unsigned long	InUnknownProtos;
+ 	unsigned long	InTruncatedPkts;
+ 	unsigned long	InDiscards;
+ 	unsigned long	InDelivers;
+ 	unsigned long	OutForwDatagrams;
+ 	unsigned long	OutRequests;
+ 	unsigned long	OutDiscards;
+ 	unsigned long	OutNoRoutes;
+ 	unsigned long	ReasmTimeout;
+ 	unsigned long	ReasmReqds;
+ 	unsigned long	ReasmOKs;
+ 	unsigned long	ReasmFails;
+ 	unsigned long	FragOKs;
+ 	unsigned long	FragFails;
+ 	unsigned long	FragCreates;
+ 	unsigned long	InMcastPkts;
+ 	unsigned long	OutMcastPkts;
 	unsigned long   __pad[0]; 
 };
  
diff --git a/include/net/sock.h b/include/net/sock.h
index e01e61768..eb7580c94 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -398,6 +398,21 @@ static inline int sock_flag(struct sock *sk, enum sock_flags flag)
 	return test_bit(flag, &sk->sk_flags);
 }
 
+static inline void sk_acceptq_removed(struct sock *sk)
+{
+	sk->sk_ack_backlog--;
+}
+
+static inline void sk_acceptq_added(struct sock *sk)
+{
+	sk->sk_ack_backlog++;
+}
+
+static inline int sk_acceptq_is_full(struct sock *sk)
+{
+	return sk->sk_ack_backlog > sk->sk_max_ack_backlog;
+}
+
 /* The per-socket spinlock must be held here. */
 #define sk_add_backlog(__sk, __skb)				\
 do {	if (!(__sk)->sk_backlog.tail) {				\
@@ -410,6 +425,20 @@ do {	if (!(__sk)->sk_backlog.tail) {				\
 	(__skb)->next = NULL;					\
 } while(0)
 
+#define sk_wait_event(__sk, __timeo, __condition)		\
+({	int rc;							\
+	release_sock(__sk);					\
+	rc = __condition;					\
+	if (!rc) {						\
+		*(__timeo) = schedule_timeout(*(__timeo));	\
+		rc = __condition;				\
+	}							\
+	lock_sock(__sk);					\
+	rc;							\
+})
+
+extern int sk_wait_data(struct sock *sk, long *timeo);
+
 /* IP protocol blocks we attach to sockets.
  * socket layer -> transport layer interface
  * transport -> network interface is defined by struct inet_proto
@@ -430,10 +459,11 @@ struct proto {
 	int			(*destroy)(struct sock *sk);
 	void			(*shutdown)(struct sock *sk, int how);
 	int			(*setsockopt)(struct sock *sk, int level, 
-					int optname, char *optval, int optlen);
+					int optname, char __user *optval,
+					int optlen);
 	int			(*getsockopt)(struct sock *sk, int level, 
-					int optname, char *optval, 
-					int *option);  	 
+					int optname, char __user *optval, 
+					int __user *option);  	 
 	int			(*sendmsg)(struct kiocb *iocb, struct sock *sk,
 					   struct msghdr *msg, size_t len);
 	int			(*recvmsg)(struct kiocb *iocb, struct sock *sk,
@@ -897,6 +927,11 @@ static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
 	atomic_add(skb->truesize, &sk->sk_rmem_alloc);
 }
 
+extern void sk_reset_timer(struct sock *sk, struct timer_list* timer,
+			   unsigned long expires);
+
+extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);
+
 static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 {
 	int err = 0;
@@ -1034,6 +1069,20 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
 		sk->sk_stamp = *stamp;
 }
 
+/**
+ * sk_eat_skb - Release a skb if it is no longer needed
+ * @sk - socket to eat this skb from
+ * @skb - socket buffer to eat
+ *
+ * This routine must be called with interrupts disabled or with the socket
+ * locked so that the sk_buff queue operation is ok.
+*/
+static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb)
+{
+	__skb_unlink(skb, &sk->sk_receive_queue);
+	__kfree_skb(skb);
+}
+
 extern atomic_t netstamp_needed;
 extern void sock_enable_timestamp(struct sock *sk);
 extern void sock_disable_timestamp(struct sock *sk);
@@ -1048,7 +1097,7 @@ static inline void net_timestamp(struct timeval *stamp)
 	}		
 } 
 
-extern int sock_get_timestamp(struct sock *, struct timeval *);
+extern int sock_get_timestamp(struct sock *, struct timeval __user *);
 
 /* 
  *	Enable debug/info messages 
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cba1f701e..86e9f9add 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -610,6 +610,8 @@ extern int sysctl_tcp_nometrics_save;
 extern int sysctl_tcp_bic;
 extern int sysctl_tcp_bic_fast_convergence;
 extern int sysctl_tcp_bic_low_window;
+extern int sysctl_tcp_default_win_scale;
+extern int sysctl_tcp_moderate_rcvbuf;
 
 extern atomic_t tcp_memory_allocated;
 extern atomic_t tcp_sockets_allocated;
@@ -720,14 +722,14 @@ struct tcp_func {
 	int			(*setsockopt)		(struct sock *sk, 
 							 int level, 
 							 int optname, 
-							 char *optval, 
+							 char __user *optval, 
 							 int optlen);
 
 	int			(*getsockopt)		(struct sock *sk, 
 							 int level, 
 							 int optname, 
-							 char *optval, 
-							 int *optlen);
+							 char __user *optval, 
+							 int __user *optlen);
 
 
 	void			(*addr2sockaddr)	(struct sock *sk,
@@ -800,6 +802,8 @@ extern int			tcp_rcv_established(struct sock *sk,
 						    struct tcphdr *th, 
 						    unsigned len);
 
+extern void			tcp_rcv_space_adjust(struct sock *sk);
+
 enum tcp_ack_state_t
 {
 	TCP_ACK_SCHED = 1,
@@ -869,10 +873,11 @@ extern unsigned int		tcp_poll(struct file * file, struct socket *sock, struct po
 extern void			tcp_write_space(struct sock *sk); 
 
 extern int			tcp_getsockopt(struct sock *sk, int level, 
-					       int optname, char *optval, 
-					       int *optlen);
+					       int optname,
+					       char __user *optval, 
+					       int __user *optlen);
 extern int			tcp_setsockopt(struct sock *sk, int level, 
-					       int optname, char *optval, 
+					       int optname, char __user *optval, 
 					       int optlen);
 extern void			tcp_set_keepalive(struct sock *sk, int val);
 extern int			tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
@@ -965,6 +970,9 @@ extern int tcp_sync_mss(struct sock *sk, u32 pmtu);
 
 extern const char timer_bug_msg[];
 
+/* tcp_diag.c */
+extern void tcp_get_info(struct sock *, struct tcp_info *);
+
 /* Read 'sendfile()'-style from a TCP socket */
 typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
 				unsigned int, size_t);
@@ -981,9 +989,7 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
 		tp->pending = 0;
 
 #ifdef TCP_CLEAR_TIMERS
-		if (timer_pending(&tp->retransmit_timer) &&
-		    del_timer(&tp->retransmit_timer))
-			__sock_put(sk);
+		sk_stop_timer(sk, &tp->retransmit_timer);
 #endif
 		break;
 	case TCP_TIME_DACK:
@@ -991,9 +997,7 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
 		tp->ack.pending = 0;
 
 #ifdef TCP_CLEAR_TIMERS
-		if (timer_pending(&tp->delack_timer) &&
-		    del_timer(&tp->delack_timer))
-			__sock_put(sk);
+		sk_stop_timer(sk, &tp->delack_timer);
 #endif
 		break;
 	default:
@@ -1022,15 +1026,13 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
 	case TCP_TIME_PROBE0:
 		tp->pending = what;
 		tp->timeout = jiffies+when;
-		if (!mod_timer(&tp->retransmit_timer, tp->timeout))
-			sock_hold(sk);
+		sk_reset_timer(sk, &tp->retransmit_timer, tp->timeout);
 		break;
 
 	case TCP_TIME_DACK:
 		tp->ack.pending |= TCP_ACK_TIMER;
 		tp->ack.timeout = jiffies+when;
-		if (!mod_timer(&tp->delack_timer, tp->ack.timeout))
-			sock_hold(sk);
+		sk_reset_timer(sk, &tp->delack_timer, tp->ack.timeout);
 		break;
 
 	default:
@@ -1751,6 +1753,9 @@ static inline void tcp_select_initial_window(int __space, __u32 mss,
 		if (*rcv_wscale && sysctl_tcp_app_win && space>=mss &&
 		    space - max((space>>sysctl_tcp_app_win), mss>>*rcv_wscale) < 65536/2)
 			(*rcv_wscale)--;
+
+		*rcv_wscale = max((__u8)sysctl_tcp_default_win_scale,
+				  *rcv_wscale);
 	}
 
 	/* Set initial window to value enough for senders,
@@ -1789,28 +1794,13 @@ static inline int tcp_full_space( struct sock *sk)
 	return tcp_win_from_space(sk->sk_rcvbuf); 
 }
 
-static inline void tcp_acceptq_removed(struct sock *sk)
-{
-	sk->sk_ack_backlog--;
-}
-
-static inline void tcp_acceptq_added(struct sock *sk)
-{
-	sk->sk_ack_backlog++;
-}
-
-static inline int tcp_acceptq_is_full(struct sock *sk)
-{
-	return sk->sk_ack_backlog > sk->sk_max_ack_backlog;
-}
-
 static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req,
 					 struct sock *child)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
 
 	req->sk = child;
-	tcp_acceptq_added(sk);
+	sk_acceptq_added(sk);
 
 	if (!tp->accept_queue_tail) {
 		tp->accept_queue = req;
diff --git a/include/net/x25.h b/include/net/x25.h
index c6153ea9e..0db97e758 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -196,7 +196,7 @@ extern void x25_transmit_restart_confirmation(struct x25_neigh *);
 extern void x25_transmit_diagnostic(struct x25_neigh *, unsigned char);
 extern void x25_transmit_clear_request(struct x25_neigh *, unsigned int, unsigned char);
 extern void x25_transmit_link(struct sk_buff *, struct x25_neigh *);
-extern int  x25_subscr_ioctl(unsigned int, void *);
+extern int  x25_subscr_ioctl(unsigned int, void __user *);
 extern struct x25_neigh *x25_get_neigh(struct net_device *);
 extern void x25_link_free(void);
 
@@ -221,7 +221,7 @@ extern void x25_enquiry_response(struct sock *);
 extern struct x25_route *x25_get_route(struct x25_address *addr);
 extern struct net_device *x25_dev_get(char *);
 extern void x25_route_device_down(struct net_device *dev);
-extern int  x25_route_ioctl(unsigned int, void *);
+extern int  x25_route_ioctl(unsigned int, void __user *);
 extern void x25_route_free(void);
 
 static __inline__ void x25_route_hold(struct x25_route *rt)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 0de0ac004..647049685 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -216,7 +216,7 @@ struct xfrm_type
 	void			(*destructor)(struct xfrm_state *);
 	int			(*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb);
 	int			(*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb);
-	int			(*output)(struct sk_buff *skb);
+	int			(*output)(struct sk_buff **pskb);
 	/* Estimate maximal size of result of transformation of a dgram */
 	u32			(*get_max_size)(struct xfrm_state *, int size);
 };
@@ -821,10 +821,10 @@ extern int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp);
 
 #ifdef CONFIG_XFRM
 extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
-extern int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen);
+extern int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen);
 extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family);
 #else
-static inline int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen)
+static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen)
 {
  	return -ENOPROTOOPT;
 } 
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index aac024fd3..c45bed631 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -145,6 +145,7 @@ typedef struct io_window_t {
 	u_int			Attributes;
 	ioaddr_t		BasePort, NumPorts;
 	ioaddr_t		InUse, Config;
+	struct resource		*res;
 } io_window_t;
 
 #define WINDOW_MAGIC	0xB35C
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 5087fd008..ef5ef24cd 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -362,6 +362,13 @@ struct scsi_lun {
 #define SCSI_2          3
 #define SCSI_3          4
 
+/*
+ * INQ PERIPHERAL QUALIFIERS
+ */
+#define SCSI_INQ_PQ_CON         0x00
+#define SCSI_INQ_PQ_NOT_CON     0x01
+#define SCSI_INQ_PQ_NOT_CAP     0x03
+
 
 /*
  * Here are some scsi specific ioctl commands which are sometimes useful.
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 3272c6e24..75a1909c2 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -63,6 +63,7 @@ struct scsi_device {
 	char devfs_name[256];	/* devfs junk */
 	char type;
 	char scsi_level;
+	char inq_periph_qual;	/* PQ from INQUIRY data */	
 	unsigned char inquiry_len;	/* valid bytes in 'inquiry' */
 	unsigned char * inquiry;	/* INQUIRY response data */
 	char * vendor;		/* [back_compat] point into 'inquiry' ... */
@@ -111,6 +112,8 @@ struct scsi_device {
 	unsigned int max_device_blocked; /* what device_blocked counts down from  */
 #define SCSI_DEFAULT_DEVICE_BLOCKED	3
 
+	int timeout;
+
 	struct device		sdev_gendev;
 	struct class_device	sdev_classdev;
 
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index c31d87ad0..21bf53ace 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -4,7 +4,8 @@
  * Flags for SCSI devices that need special treatment
  */
 #define BLIST_NOLUN     	0x001	/* Only scan LUN 0 */
-#define BLIST_FORCELUN  	0x002	/* Known to have LUNs, force scanning */
+#define BLIST_FORCELUN  	0x002	/* Known to have LUNs, force scanning,
+					   deprecated: Use max_luns=N */
 #define BLIST_BORKEN    	0x004	/* Flag for broken handshaking */
 #define BLIST_KEY       	0x008	/* unlock by special command */
 #define BLIST_SINGLELUN 	0x010	/* Do not use LUNs in parallel */
@@ -20,4 +21,7 @@
 #define BLIST_MS_SKIP_PAGE_3F	0x4000	/* do not send ms page 0x3f */
 #define BLIST_USE_10_BYTE_MS	0x8000	/* use 10 byte ms before 6 byte ms */
 #define BLIST_MS_192_BYTES_FOR_3F	0x10000	/*  192 byte ms page 0x3f request */
+#define BLIST_REPORTLUN2	0x20000	/* try REPORT_LUNS even for SCSI-2 devs
+ 					   (if HBA supports more than 8 LUNs) */
+#define BLIST_NOREPORTLUN	0x40000	/* don't try REPORT_LUNS scan (SCSI-3 devs) */
 #endif
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h
index 316c2fa04..688fa25e7 100644
--- a/include/scsi/scsi_ioctl.h
+++ b/include/scsi/scsi_ioctl.h
@@ -40,10 +40,10 @@ typedef struct scsi_fctargaddress {
 	unsigned char host_wwn[8]; // include NULL term.
 } Scsi_FCTargAddress;
 
-extern int scsi_ioctl(struct scsi_device *, int, void *);
+extern int scsi_ioctl(struct scsi_device *, int, void __user *);
 extern int kernel_scsi_ioctl(struct scsi_device *, int , void *);
 extern int scsi_ioctl_send_command(struct scsi_device *,
-				   struct scsi_ioctl_command *);
+				   struct scsi_ioctl_command __user *);
 
 #endif /* __KERNEL__ */
 #endif /* _SCSI_IOCTL_H */
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index ebb51372b..01bf5b538 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -91,7 +91,7 @@ Major new features in SG 3.x driver (cf SG 2.x drivers)
 
 typedef struct sg_iovec /* same structure as used by readv() Linux system */
 {                       /* call. It defines one scatter-gather element. */
-    void * iov_base;            /* Starting address  */
+    void __user *iov_base;      /* Starting address  */
     size_t iov_len;             /* Length in bytes  */
 } sg_iovec_t;
 
@@ -104,14 +104,14 @@ typedef struct sg_io_hdr
     unsigned char mx_sb_len;    /* [i] max length to write to sbp */
     unsigned short iovec_count; /* [i] 0 implies no scatter gather */
     unsigned int dxfer_len;     /* [i] byte count of data transfer */
-    void * dxferp;              /* [i], [*io] points to data transfer memory
+    void __user *dxferp;	/* [i], [*io] points to data transfer memory
 					      or scatter gather list */
-    unsigned char * cmdp;       /* [i], [*i] points to command to perform */
-    unsigned char * sbp;        /* [i], [*o] points to sense_buffer memory */
+    unsigned char __user *cmdp; /* [i], [*i] points to command to perform */
+    void __user *sbp;		/* [i], [*o] points to sense_buffer memory */
     unsigned int timeout;       /* [i] MAX_UINT->no timeout (unit: millisec) */
     unsigned int flags;         /* [i] 0 -> default, see SG_FLAG... */
     int pack_id;                /* [i->o] unused internally (normally) */
-    void * usr_ptr;             /* [i->o] unused internally */
+    void __user * usr_ptr;      /* [i->o] unused internally */
     unsigned char status;       /* [o] scsi status */
     unsigned char masked_status;/* [o] shifted, masked scsi status */
     unsigned char msg_status;   /* [o] messaging level data (optional) */
@@ -171,7 +171,7 @@ typedef struct sg_req_info { /* used by SG_GET_REQUEST_TABLE ioctl() */
     char sg_io_owned;   /* 0 -> complete with read(), 1 -> owned by SG_IO */
     char problem;       /* 0 -> no problem detected, 1 -> error to report */
     int pack_id;        /* pack_id associated with request */
-    void * usr_ptr;     /* user provided pointer (in new interface) */
+    void __user *usr_ptr;     /* user provided pointer (in new interface) */
     unsigned int duration; /* millisecs elapsed since written (req_state==1)
 			      or request duration (req_state==2) */
     int unused;
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 2be436ea7..3629059ad 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -51,7 +51,7 @@
 #define AC97_REC_GAIN_MIC	0x1e	/* Record Gain MIC (optional) */
 #define AC97_GENERAL_PURPOSE	0x20	/* General Purpose (optional) */
 #define AC97_3D_CONTROL		0x22	/* 3D Control (optional) */
-#define AC97_RESERVED		0x24	/* Reserved */
+#define AC97_INT_PAGING		0x24	/* Audio Interrupt & Paging (AC'97 2.3) */
 #define AC97_POWERDOWN		0x26	/* Powerdown control / status */
 /* range 0x28-0x3a - AUDIO AC'97 2.0 extensions */
 #define AC97_EXTENDED_ID	0x28	/* Extended Audio ID */
@@ -82,6 +82,13 @@
 /* range 0x5a-0x7b - Vendor Specific */
 #define AC97_VENDOR_ID1		0x7c	/* Vendor ID1 */
 #define AC97_VENDOR_ID2		0x7e	/* Vendor ID2 / revision */
+/* range 0x60-0x6f (page 1) - extended codec registers */
+#define AC97_CODEC_CLASS_REV	0x60	/* Codec Class/Revision */
+#define AC97_PCI_SVID		0x62	/* PCI Subsystem Vendor ID */
+#define AC97_PCI_SID		0x64	/* PCI Subsystem ID */
+#define AC97_FUNC_SELECT	0x66	/* Function Select */
+#define AC97_FUNC_INFO		0x68	/* Function Information */
+#define AC97_SENSE_INFO		0x6a	/* Sense Details */
 
 /* slot allocation */
 #define AC97_SLOT_TAG		0
@@ -139,6 +146,7 @@
 #define AC97_EI_AMAP		0x0200	/* indicates optional slot/DAC mapping based on codec ID */
 #define AC97_EI_REV_MASK	0x0c00	/* AC'97 revision mask */
 #define AC97_EI_REV_22		0x0400	/* AC'97 revision 2.2 */
+#define AC97_EI_REV_23		0x0800	/* AC'97 revision 2.3 */
 #define AC97_EI_REV_SHIFT	10
 #define AC97_EI_ADDR_MASK	0xc000	/* physical codec ID (address) */
 #define AC97_EI_ADDR_SHIFT	14
@@ -180,6 +188,16 @@
 #define AC97_SC_DRS		0x4000	/* Double Rate S/PDIF */
 #define AC97_SC_V		0x8000	/* Validity status */
 
+/* Interrupt and Paging bit defines (AC'97 2.3) */
+#define AC97_PAGE_MASK		0x000f	/* Page Selector */
+#define AC97_PAGE_VENDOR	0	/* Vendor-specific registers */
+#define AC97_PAGE_1		1	/* Extended Codec Registers page 1 */
+#define AC97_INT_ENABLE		0x0800	/* Interrupt Enable */
+#define AC97_INT_SENSE		0x1000	/* Sense Cycle */
+#define AC97_INT_CAUSE_SENSE	0x2000	/* Sense Cycle Completed (RO) */
+#define AC97_INT_CAUSE_GPIO	0x4000	/* GPIO bits changed (RO) */
+#define AC97_INT_STATUS		0x8000	/* Interrupt Status */
+
 /* extended modem ID bit defines */
 #define AC97_MEI_LINE1		0x0001	/* Line1 present */
 #define AC97_MEI_LINE2		0x0002	/* Line2 present */
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
index f6b41a272..a076fcadc 100644
--- a/include/sound/ad1848.h
+++ b/include/sound/ad1848.h
@@ -147,9 +147,6 @@ struct _snd_ad1848 {
 	int calibrate_mute;
 	int dma_size;
 	int thinkpad_flag;		/* Thinkpad CS4248 needs some extra help */
-#ifdef CONFIG_PM
-	struct pm_dev *thinkpad_pmstate;
-#endif
 
 	spinlock_t reg_lock;
 	struct semaphore open_mutex;
diff --git a/include/sound/ainstr_gf1.h b/include/sound/ainstr_gf1.h
index 882d17b39..c59f73765 100644
--- a/include/sound/ainstr_gf1.h
+++ b/include/sound/ainstr_gf1.h
@@ -209,9 +209,9 @@ typedef struct {
 	void *private_data;
 	int (*info)(void *private_data, gf1_info_t *info);
 	int (*put_sample)(void *private_data, gf1_wave_t *wave,
-	                  char *data, long len, int atomic);
+	                  char __user *data, long len, int atomic);
 	int (*get_sample)(void *private_data, gf1_wave_t *wave,
-			  char *data, long len, int atomic);
+			  char __user *data, long len, int atomic);
 	int (*remove_sample)(void *private_data, gf1_wave_t *wave,
 			     int atomic);
 	void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what);
diff --git a/include/sound/ainstr_iw.h b/include/sound/ainstr_iw.h
index ace103158..1b5155fb1 100644
--- a/include/sound/ainstr_iw.h
+++ b/include/sound/ainstr_iw.h
@@ -357,9 +357,9 @@ typedef struct {
 	void *private_data;
 	int (*info)(void *private_data, iwffff_info_t *info);
 	int (*put_sample)(void *private_data, iwffff_wave_t *wave,
-	                  char *data, long len, int atomic);
+	                  char __user *data, long len, int atomic);
 	int (*get_sample)(void *private_data, iwffff_wave_t *wave,
-			  char *data, long len, int atomic);
+			  char __user *data, long len, int atomic);
 	int (*remove_sample)(void *private_data, iwffff_wave_t *wave,
 			     int atomic);
 	void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what);
diff --git a/include/sound/ainstr_simple.h b/include/sound/ainstr_simple.h
index bef1f990c..da73df0b1 100644
--- a/include/sound/ainstr_simple.h
+++ b/include/sound/ainstr_simple.h
@@ -140,9 +140,9 @@ typedef struct {
 	void *private_data;
 	int (*info)(void *private_data, simple_instrument_info_t *info);
 	int (*put_sample)(void *private_data, simple_instrument_t *instr,
-	                  char *data, long len, int atomic);
+	                  char __user *data, long len, int atomic);
 	int (*get_sample)(void *private_data, simple_instrument_t *instr,
-			  char *data, long len, int atomic);
+			  char __user *data, long len, int atomic);
 	int (*remove_sample)(void *private_data, simple_instrument_t *instr,
 			     int atomic);
 	void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what);
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 949b8be37..69dc1829e 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -135,7 +135,7 @@ struct sndrv_hwdep_dsp_status {
 struct sndrv_hwdep_dsp_image {
 	unsigned int index;		/* W: DSP index */
 	unsigned char name[64];		/* W: ID (e.g. file name) */
-	unsigned char *image;		/* W: binary image */
+	unsigned char __user *image;	/* W: binary image */
 	size_t length;			/* W: size of image in bytes */
 	unsigned long driver_data;	/* W: driver-specific data */
 };
@@ -153,7 +153,7 @@ enum {
  *                                                                           *
  *****************************************************************************/
 
-#define SNDRV_PCM_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 6)
+#define SNDRV_PCM_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 7)
 
 typedef unsigned long sndrv_pcm_uframes_t;
 typedef long sndrv_pcm_sframes_t;
@@ -428,15 +428,31 @@ struct sndrv_pcm_mmap_control {
 	sndrv_pcm_uframes_t avail_min;	/* RW: min available frames for wakeup */
 };
 
+#define SNDRV_PCM_SYNC_PTR_HWSYNC	(1<<0)	/* execute hwsync */
+#define SNDRV_PCM_SYNC_PTR_APPL		(1<<1)	/* get appl_ptr from driver (r/w op) */
+#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN	(1<<2)	/* get avail_min from driver */
+
+struct sndrv_pcm_sync_ptr {
+	unsigned int flags;
+	union {
+		struct sndrv_pcm_mmap_status status;
+		unsigned char reserved[64];
+	} s;
+	union {
+		struct sndrv_pcm_mmap_control control;
+		unsigned char reserved[64];
+	} c;
+};
+
 struct sndrv_xferi {
 	sndrv_pcm_sframes_t result;
-	void *buf;
+	void __user *buf;
 	sndrv_pcm_uframes_t frames;
 };
 
 struct sndrv_xfern {
 	sndrv_pcm_sframes_t result;
-	void **bufs;
+	void __user * __user *bufs;
 	sndrv_pcm_uframes_t frames;
 };
 
@@ -451,6 +467,7 @@ enum {
 	SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status),
 	SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t),
 	SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22),
+	SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct sndrv_pcm_sync_ptr),
 	SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info),
 	SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40),
 	SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41),
@@ -538,7 +555,7 @@ enum {
  *  Timer section - /dev/snd/timer
  */
 
-#define SNDRV_TIMER_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 1)
+#define SNDRV_TIMER_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 2)
 
 enum sndrv_timer_class {
 	SNDRV_TIMER_CLASS_NONE = -1,
@@ -619,6 +636,7 @@ struct sndrv_timer_info {
 
 #define SNDRV_TIMER_PSFLG_AUTO		(1<<0)	/* auto start, otherwise one-shot */
 #define SNDRV_TIMER_PSFLG_EXCLUSIVE	(1<<1)	/* exclusive use, precise start/stop/pause/continue */
+#define SNDRV_TIMER_PSFLG_EARLY_EVENT	(1<<2)	/* write early event to the poll queue */
 
 struct sndrv_timer_params {
 	unsigned int flags;		/* flags - SNDRV_MIXER_PSFLG_* */
@@ -667,6 +685,7 @@ enum sndrv_timer_event {
 	SNDRV_TIMER_EVENT_STOP,			/* val = 0 */
 	SNDRV_TIMER_EVENT_CONTINUE,		/* val = resolution in ns */
 	SNDRV_TIMER_EVENT_PAUSE,		/* val = 0 */
+	SNDRV_TIMER_EVENT_EARLY,		/* val = 0, early event */
 	/* master timer events for slave timer instances */
 	SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
 	SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
@@ -757,7 +776,7 @@ struct sndrv_ctl_elem_list {
 	unsigned int space;		/* W: count of element IDs to get */
 	unsigned int used;		/* R: count of element IDs set */
 	unsigned int count;		/* R: count of all elements */
-	struct sndrv_ctl_elem_id *pids; /* R: IDs */
+	struct sndrv_ctl_elem_id __user *pids; /* R: IDs */
 	unsigned char reserved[50];
 };
 
diff --git a/include/sound/core.h b/include/sound/core.h
index c6434a8cd..caf1b3c85 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -163,8 +163,10 @@ struct _snd_card {
 	struct device *dev;
 
 #ifdef CONFIG_PM
-	int (*set_power_state) (snd_card_t *card, unsigned int state);
-	void *power_state_private_data;
+	int (*pm_suspend)(snd_card_t *card, unsigned int state);
+	int (*pm_resume)(snd_card_t *card, unsigned int state);
+	struct pm_dev *pm_dev;		/* for ISA */
+	void *pm_private_data;
 	unsigned int power_state;	/* power state */
 	struct semaphore power_lock;	/* power lock */
 	wait_queue_head_t power_sleep;
@@ -199,12 +201,32 @@ static inline void snd_power_change_state(snd_card_t *card, unsigned int state)
 	card->power_state = state;
 	wake_up(&card->power_sleep);
 }
+int snd_card_set_pm_callback(snd_card_t *card,
+			     int (*suspend)(snd_card_t *, unsigned int),
+			     int (*resume)(snd_card_t *, unsigned int),
+			     void *private_data);
+int snd_card_set_dev_pm_callback(snd_card_t *card, int type,
+				 int (*suspend)(snd_card_t *, unsigned int),
+				 int (*resume)(snd_card_t *, unsigned int),
+				 void *private_data);
+#define snd_card_set_isa_pm_callback(card,suspend,resume,data) \
+	snd_card_set_dev_pm_callback(card, PM_ISA_DEV, suspend, resume, data)
+#ifndef SND_PCI_PM_CALLBACKS
+int snd_card_pci_suspend(struct pci_dev *dev, u32 state);
+int snd_card_pci_resume(struct pci_dev *dev);
+#define SND_PCI_PM_CALLBACKS \
+	.suspend = snd_card_pci_suspend,  .resume = snd_card_pci_resume
+#endif
 #else
 #define snd_power_lock(card)		do { (void)(card); } while (0)
 #define snd_power_unlock(card)		do { (void)(card); } while (0)
 static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file *file) { return 0; }
 #define snd_power_get_state(card)	SNDRV_CTL_POWER_D0
 #define snd_power_change_state(card, state)	do { (void)(card); } while (0)
+#define snd_card_set_pm_callback(card,suspend,resume,data) -EINVAL
+#define snd_card_set_dev_pm_callback(card,suspend,resume,data) -EINVAL
+#define snd_card_set_isa_pm_callback(card,suspend,resume,data) -EINVAL
+#define SND_PCI_PM_CALLBACKS
 #endif
 
 /* device.c */
@@ -280,8 +302,8 @@ void snd_hidden_vfree(void *obj);
 #endif
 void *snd_kcalloc(size_t size, int flags);
 char *snd_kmalloc_strdup(const char *string, int flags);
-int copy_to_user_fromio(void *dst, unsigned long src, size_t count);
-int copy_from_user_toio(unsigned long dst, const void *src, size_t count);
+int copy_to_user_fromio(void __user *dst, unsigned long src, size_t count);
+int copy_from_user_toio(unsigned long dst, const void __user *src, size_t count);
 
 /* init.c */
 
diff --git a/include/sound/cs4231.h b/include/sound/cs4231.h
index af6434688..bd921aa19 100644
--- a/include/sound/cs4231.h
+++ b/include/sound/cs4231.h
@@ -295,7 +295,6 @@ struct _snd_cs4231 {
 	void (*set_capture_format) (cs4231_t *chip, snd_pcm_hw_params_t *hw_params, unsigned char cdfr);
 	void (*trigger) (cs4231_t *chip, unsigned int what, int start);
 #ifdef CONFIG_PM
-	struct pm_dev *pm_dev;
 	void (*suspend) (cs4231_t *chip);
 	void (*resume) (cs4231_t *chip);
 #endif
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 8cacbe91c..6f74f6d93 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1737,9 +1737,6 @@ struct _snd_cs46xx {
 
 	struct snd_cs46xx_gameport *gameport;
 
-#ifdef CONFIG_PM
-	struct pm_dev *pm_dev;
-#endif
 #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
 	int current_gpio;
 #endif
@@ -1771,9 +1768,4 @@ int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi);
 int snd_cs46xx_start_dsp(cs46xx_t *chip);
 void snd_cs46xx_gameport(cs46xx_t *chip);
 
-#ifdef CONFIG_PM
-void snd_cs46xx_suspend(cs46xx_t *chip);
-void snd_cs46xx_resume(cs46xx_t *chip);
-#endif
-
 #endif /* __SOUND_CS46XX_H */
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 604625ca4..6182b7764 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -650,7 +650,8 @@
 #define SPBYPASS_FORMAT		0x00000f00      /* If 1, SPDIF XX uses 24 bit, if 0 - 20 bit	*/
 
 #define AC97SLOT		0x5f            /* additional AC97 slots enable bits		*/
-#define AC97SLOT_10K2		0x03
+#define AC97SLOT_REAR_RIGHT	0x01		/* Rear left */
+#define AC97SLOT_REAR_LEFT	0x02		/* Rear right */
 #define AC97SLOT_CNTR		0x10            /* Center enable */
 #define AC97SLOT_LFE		0x20            /* LFE enable */
 
@@ -937,7 +938,8 @@ struct _snd_emu10k1 {
 	struct resource *res_port;
 	int APS: 1,				/* APS flag */
 	    no_ac97: 1,				/* no AC'97 */
-	    tos_link: 1;			/* tos link detected */
+	    tos_link: 1,			/* tos link detected */
+	    rear_ac97: 1;			/* rear channels are on AC'97 */
 	unsigned int audigy;			/* is Audigy? */
 	unsigned int revision;			/* chip revision */
 	unsigned int serial;			/* serial number */
@@ -1184,8 +1186,8 @@ int snd_emu10k1_proc_init(emu10k1_t * emu);
 #define EXTOUT_AC97_R	   0x01	/* AC'97 playback channel - right */
 #define EXTOUT_TOSLINK_L   0x02	/* LiveDrive - TOSLink Optical - left */
 #define EXTOUT_TOSLINK_R   0x03	/* LiveDrive - TOSLink Optical - right */
-#define EXTOUT_CENTER      0x04	/* SB Live 5.1 - center */
-#define EXTOUT_LFE         0x05 /* SB Live 5.1 - LFE */
+#define EXTOUT_AC97_CENTER 0x04	/* SB Live 5.1 - center */
+#define EXTOUT_AC97_LFE	   0x05 /* SB Live 5.1 - LFE */
 #define EXTOUT_HEADPHONE_L 0x06	/* LiveDrive - Headphone - left */
 #define EXTOUT_HEADPHONE_R 0x07	/* LiveDrive - Headphone - right */
 #define EXTOUT_REAR_L	   0x08	/* Rear channel - left */
@@ -1193,6 +1195,8 @@ int snd_emu10k1_proc_init(emu10k1_t * emu);
 #define EXTOUT_ADC_CAP_L   0x0a	/* ADC Capture buffer - left */
 #define EXTOUT_ADC_CAP_R   0x0b	/* ADC Capture buffer - right */
 #define EXTOUT_MIC_CAP	   0x0c	/* MIC Capture buffer */
+#define EXTOUT_AC97_REAR_L 0x0d	/* SB Live 5.1 (c) 2003 - Rear Left */
+#define EXTOUT_AC97_REAR_R 0x0e	/* SB Live 5.1 (c) 2003 - Rear Right */
 #define EXTOUT_ACENTER	   0x11 /* Analog Center */
 #define EXTOUT_ALFE	   0x12 /* Analog LFE */
 
@@ -1313,14 +1317,14 @@ typedef struct {
 	unsigned int gpr_map[0x100];	  /* initializers */
 
 	unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
-	emu10k1_fx8010_control_gpr_t *gpr_add_controls; /* GPR controls to add/replace */
+	emu10k1_fx8010_control_gpr_t __user *gpr_add_controls; /* GPR controls to add/replace */
 
 	unsigned int gpr_del_control_count; /* count of GPR controls to remove */
-	snd_ctl_elem_id_t *gpr_del_controls; /* IDs of GPR controls to remove */
+	snd_ctl_elem_id_t __user *gpr_del_controls; /* IDs of GPR controls to remove */
 
 	unsigned int gpr_list_control_count; /* count of GPR controls to list */
 	unsigned int gpr_list_control_total; /* total count of GPR controls */
-	emu10k1_fx8010_control_gpr_t *gpr_list_controls; /* listed GPR controls */
+	emu10k1_fx8010_control_gpr_t __user *gpr_list_controls; /* listed GPR controls */
 
 	unsigned long tram_valid[0xa0/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */
 	unsigned int tram_data_map[0xa0]; /* data initializers */
diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h
index b336e353a..c6970aac9 100644
--- a/include/sound/emux_synth.h
+++ b/include/sound/emux_synth.h
@@ -60,7 +60,7 @@ typedef struct snd_emux_operators {
 	void (*free_voice)(snd_emux_voice_t *vp);
 	void (*reset)(snd_emux_t *emu, int ch);
 	/* the first parameters are snd_emux_t */
-	int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *data, long count);
+	int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);
 	int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
 	void (*sample_reset)(snd_emux_t *emu);
 	int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count);
diff --git a/include/sound/gus.h b/include/sound/gus.h
index 6cd0a2252..887b03cce 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -684,9 +684,9 @@ extern int snd_engine_instrument_register_ask(unsigned short mode);
 #endif
 
 /* gus_dram.c */
-int snd_gus_dram_write(snd_gus_card_t *gus, char *ptr,
+int snd_gus_dram_write(snd_gus_card_t *gus, char __user *ptr,
 		       unsigned int addr, unsigned int size);
-int snd_gus_dram_read(snd_gus_card_t *gus, char *ptr,
+int snd_gus_dram_read(snd_gus_card_t *gus, char __user *ptr,
 		      unsigned int addr, unsigned int size, int rom);
 
 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
@@ -699,21 +699,21 @@ void snd_gf1_simple_init(snd_gus_voice_t *voice);
 
 /* gus_instr.c */
 int snd_gus_iwffff_put_sample(void *private_data, iwffff_wave_t *wave,
-			      char *data, long len, int atomic);
+			      char __user *data, long len, int atomic);
 int snd_gus_iwffff_get_sample(void *private_data, iwffff_wave_t *wave,
-			      char *data, long len, int atomic);
+			      char __user *data, long len, int atomic);
 int snd_gus_iwffff_remove_sample(void *private_data, iwffff_wave_t *wave,
 				 int atomic);
 int snd_gus_gf1_put_sample(void *private_data, gf1_wave_t *wave,
-			   char *data, long len, int atomic);
+			   char __user *data, long len, int atomic);
 int snd_gus_gf1_get_sample(void *private_data, gf1_wave_t *wave,
-			   char *data, long len, int atomic);
+			   char __user *data, long len, int atomic);
 int snd_gus_gf1_remove_sample(void *private_data, gf1_wave_t *wave,
 			      int atomic);
 int snd_gus_simple_put_sample(void *private_data, simple_instrument_t *instr,
-			      char *data, long len, int atomic);
+			      char __user *data, long len, int atomic);
 int snd_gus_simple_get_sample(void *private_data, simple_instrument_t *instr,
-			      char *data, long len, int atomic);
+			      char __user *data, long len, int atomic);
 int snd_gus_simple_remove_sample(void *private_data, simple_instrument_t *instr,
 				 int atomic);
 
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
index 21a9f1c0d..93e0427c1 100644
--- a/include/sound/hdsp.h
+++ b/include/sound/hdsp.h
@@ -76,7 +76,7 @@ struct _snd_hdsp_config_info {
 typedef struct _snd_hdsp_firmware hdsp_firmware_t;
 
 struct _snd_hdsp_firmware {
-	unsigned long *firmware_data;	/* 24413 long words */
+	unsigned long __user *firmware_data;	/* 24413 long words */
 };
 
 #define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, hdsp_firmware_t)
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h
index 5e72865bd..4a4cc0167 100644
--- a/include/sound/hwdep.h
+++ b/include/sound/hwdep.h
@@ -32,8 +32,8 @@ typedef struct sndrv_hwdep_dsp_image snd_hwdep_dsp_image_t;
 
 typedef struct _snd_hwdep_ops {
 	long long (*llseek) (snd_hwdep_t *hw, struct file * file, long long offset, int orig);
-	long (*read) (snd_hwdep_t * hw, char *buf, long count, loff_t *offset);
-	long (*write) (snd_hwdep_t * hw, const char *buf, long count, loff_t *offset);
+	long (*read) (snd_hwdep_t * hw, char __user *buf, long count, loff_t *offset);
+	long (*write) (snd_hwdep_t * hw, const char __user *buf, long count, loff_t *offset);
 	int (*open) (snd_hwdep_t * hw, struct file * file);
 	int (*release) (snd_hwdep_t * hw, struct file * file);
 	unsigned int (*poll) (snd_hwdep_t * hw, struct file * file, poll_table * wait);
diff --git a/include/sound/info.h b/include/sound/info.h
index 57ba588d0..9e33b58b8 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -54,9 +54,9 @@ struct snd_info_entry_ops {
 	int (*release) (snd_info_entry_t * entry,
 			unsigned short mode, void *file_private_data);
 	long (*read) (snd_info_entry_t *entry, void *file_private_data,
-		      struct file * file, char *buf, long count);
+		      struct file * file, char __user *buf, long count);
 	long (*write) (snd_info_entry_t *entry, void *file_private_data,
-		       struct file * file, const char *buf, long count);
+		       struct file * file, const char __user *buf, long count);
 	long long (*llseek) (snd_info_entry_t *entry, void *file_private_data,
 			    struct file * file, long long offset, int orig);
 	unsigned int (*poll) (snd_info_entry_t *entry, void *file_private_data,
diff --git a/include/sound/initval.h b/include/sound/initval.h
index f40008475..acb0a7f95 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -133,44 +133,4 @@ static int snd_legacy_find_free_dma(int *dma_table)
 }
 #endif
 
-#if defined(SNDRV_GET_ID) && !defined(MODULE)
-#include <linux/ctype.h>
-#include <linux/init.h>
-#include <linux/bootmem.h>
-static int __init get_id(char **str, char **dst)
-{
-	char *s;
-
-	if (!(*str) || !(**str))
-		return 0;
-	for (s = *str; isalpha(*s) || isdigit(*s) || *s == '_'; s++);
-	if (s != *str) {
-		int len = s - *str;
-		char *d = (char *)alloc_bootmem(len + 1);
-		if (d != NULL) {
-			memcpy(*dst = d, *str, len);
-			d[len] = '\0';
-		}
-	}
-	if (*s == ',') {
-		*str = s + 1;
-		return 2;
-	}
-	*str = s;
-	return 1;
-}
-#endif
-
-/* simple wrapper for long variable.
- * the value more than 32bit won't work!
- */
-inline static int get_option_long(char **str, long *valp)
-{
-	int val, ret;
-	ret = get_option(str, &val);
-	if (ret)
-		*valp = val;
-	return ret;
-}
-
 #endif /* __SOUND_INITVAL_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 17d8b2209..42293603d 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -95,7 +95,7 @@ typedef struct _snd_pcm_ops {
 	int (*trigger)(snd_pcm_substream_t * substream, int cmd);
 	snd_pcm_uframes_t (*pointer)(snd_pcm_substream_t * substream);
 	int (*copy)(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t pos,
-		    void *buf, snd_pcm_uframes_t count);
+		    void __user *buf, snd_pcm_uframes_t count);
 	int (*silence)(snd_pcm_substream_t *substream, int channel, 
 		       snd_pcm_uframes_t pos, snd_pcm_uframes_t count);
 	struct page *(*page)(snd_pcm_substream_t *substream, unsigned long offset);
@@ -479,7 +479,7 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree);
 extern rwlock_t snd_pcm_link_rwlock;
 
 int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info);
-int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t *info);
+int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user *info);
 int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status);
 int snd_pcm_prepare(snd_pcm_substream_t *substream);
 int snd_pcm_start(snd_pcm_substream_t *substream);
@@ -881,13 +881,14 @@ void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks);
 void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream);
 void snd_pcm_period_elapsed(snd_pcm_substream_t *substream);
 snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream,
-				    const void *buf, snd_pcm_uframes_t frames);
+				    const void __user *buf,
+				    snd_pcm_uframes_t frames);
 snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream,
-				   void *buf, snd_pcm_uframes_t frames);
+				   void __user *buf, snd_pcm_uframes_t frames);
 snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream,
-				     void **bufs, snd_pcm_uframes_t frames);
+				     void __user **bufs, snd_pcm_uframes_t frames);
 snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream,
-				    void **bufs, snd_pcm_uframes_t frames);
+				    void __user **bufs, snd_pcm_uframes_t frames);
 
 int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime);
 
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h
index 832d8f532..1a654df4a 100644
--- a/include/sound/seq_instr.h
+++ b/include/sound/seq_instr.h
@@ -79,9 +79,9 @@ struct snd_seq_kinstr_ops {
 	char *instr_type;
 	int (*info)(void *private_data, char *info_data, long len);
 	int (*put)(void *private_data, snd_seq_kinstr_t *kinstr,
-		   char *instr_data, long len, int atomic, int cmd);
+		   char __user *instr_data, long len, int atomic, int cmd);
 	int (*get)(void *private_data, snd_seq_kinstr_t *kinstr,
-		   char *instr_data, long len, int atomic, int cmd);
+		   char __user *instr_data, long len, int atomic, int cmd);
 	int (*get_size)(void *private_data, snd_seq_kinstr_t *kinstr, long *size);
 	int (*remove)(void *private_data, snd_seq_kinstr_t *kinstr, int atomic);
 	void (*notify)(void *private_data, snd_seq_kinstr_t *kinstr, int what);
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index 22dd3a4ec..d0b69fbef 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -158,7 +158,7 @@ extern int snd_seq_create_kernel_client(snd_card_t *card, int client_index, snd_
 extern int snd_seq_delete_kernel_client(int client);
 extern int snd_seq_kernel_client_enqueue(int client, snd_seq_event_t *ev, int atomic, int hop);
 extern int snd_seq_kernel_client_dispatch(int client, snd_seq_event_t *ev, int atomic, int hop);
-extern int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void __user *arg);
+extern int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
 
 #define SNDRV_SEQ_EXT_MASK	0xc0000000
 #define SNDRV_SEQ_EXT_USRPTR	0x80000000
diff --git a/include/sound/seq_oss.h b/include/sound/seq_oss.h
index 4569ff724..bd7e57322 100644
--- a/include/sound/seq_oss.h
+++ b/include/sound/seq_oss.h
@@ -58,7 +58,7 @@ struct snd_seq_oss_callback_t {
 	int (*open)(snd_seq_oss_arg_t *p, void *closure);
 	int (*close)(snd_seq_oss_arg_t *p);
 	int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg);
-	int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char *buf, int offs, int count);
+	int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char __user *buf, int offs, int count);
 	int (*reset)(snd_seq_oss_arg_t *p);
 	int (*raw_event)(snd_seq_oss_arg_t *p, unsigned char *data);
 };
diff --git a/include/sound/sscape_ioctl.h b/include/sound/sscape_ioctl.h
index c6653ebfb..0d8885969 100644
--- a/include/sound/sscape_ioctl.h
+++ b/include/sound/sscape_ioctl.h
@@ -12,7 +12,7 @@ struct sscape_bootblock
 
 struct sscape_microcode
 {
-  unsigned char *code;
+  unsigned char __user *code;
 };
 
 #define SND_SSCAPE_LOAD_BOOTB  _IOWR('P', 100, struct sscape_bootblock)
diff --git a/include/sound/timer.h b/include/sound/timer.h
index 6640f04a7..fd33b802e 100644
--- a/include/sound/timer.h
+++ b/include/sound/timer.h
@@ -60,6 +60,7 @@ typedef struct sndrv_timer_tread snd_timer_tread_t;
 #define SNDRV_TIMER_IFLG_FAST	  0x00000010	/* fast callback (do not use tasklet) */
 #define SNDRV_TIMER_IFLG_CALLBACK 0x00000020	/* timer callback is active */
 #define SNDRV_TIMER_IFLG_EXCLUSIVE 0x00000040	/* exclusive owner - no more instances */
+#define SNDRV_TIMER_IFLG_EARLY_EVENT 0x00000080	/* write early event to the poll queue */
 
 #define SNDRV_TIMER_FLG_CHANGE	0x00000001
 #define SNDRV_TIMER_FLG_RESCHED	0x00000002	/* need reschedule */
diff --git a/include/sound/trident.h b/include/sound/trident.h
index d0e100f5e..255a5cbe6 100644
--- a/include/sound/trident.h
+++ b/include/sound/trident.h
@@ -54,13 +54,6 @@
 #define TRIDENT_DEVICE_ID_NX		((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX)
 #define TRIDENT_DEVICE_ID_SI7018	((PCI_VENDOR_ID_SI<<16)|PCI_DEVICE_ID_SI_7018)
 
-/* Trident chipsets have 1GB memory limit */
-#ifdef __alpha__
-#define TRIDENT_DMA_TYPE        SNDRV_DMA_TYPE_PCI_16MB
-#else
-#define TRIDENT_DMA_TYPE        SNDRV_DMA_TYPE_PCI
-#endif
-
 #define SNDRV_SEQ_DEV_ID_TRIDENT			"trident-synth"
 
 #define SNDRV_TRIDENT_VOICE_TYPE_PCM		0
@@ -486,12 +479,6 @@ int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk);
 snd_util_memblk_t *snd_trident_synth_alloc(trident_t *trident, unsigned int size);
 int snd_trident_synth_free(trident_t *trident, snd_util_memblk_t *blk);
 int snd_trident_synth_bzero(trident_t *trident, snd_util_memblk_t *blk, int offset, int size);
-int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char *data, int size);
-
-/* Power Management */
-#ifdef CONFIG_PM
-void snd_trident_suspend(trident_t *trident);
-void snd_trident_resume(trident_t *trident);
-#endif
+int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char __user *data, int size);
 
 #endif /* __SOUND_TRIDENT_H */
diff --git a/include/sound/uda1341.h b/include/sound/uda1341.h
index 31c77c78d..61ff65a62 100644
--- a/include/sound/uda1341.h
+++ b/include/sound/uda1341.h
@@ -15,7 +15,7 @@
  *                           features support
  */
 
-/* $Id: uda1341.h,v 1.5 2003/04/19 13:34:32 perex Exp $ */
+/* $Id: uda1341.h,v 1.6 2004/05/03 17:36:50 tiwai Exp $ */
 
 #define UDA1341_ALSA_NAME "snd-uda1341"
 
diff --git a/include/sound/version.h b/include/sound/version.h
index fac198497..9f7d0e930 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
 /* include/version.h.  Generated by configure.  */
-#define CONFIG_SND_VERSION "1.0.4rc2"
-#define CONFIG_SND_DATE " (Tue Mar 30 08:19:30 2004 UTC)"
+#define CONFIG_SND_VERSION "1.0.4"
+#define CONFIG_SND_DATE " (Mon May 17 14:31:44 2004 UTC)"
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index bcc633a55..5609f5420 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -254,13 +254,13 @@ inline static unsigned int snd_vx_inl(vx_core_t *chip, int reg)
 inline static void snd_vx_outb(vx_core_t *chip, int reg, unsigned char val)
 {
 	snd_assert(chip->ops->out8, return);
-	return chip->ops->out8(chip, reg, val);
+	chip->ops->out8(chip, reg, val);
 }
 
 inline static void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val)
 {
 	snd_assert(chip->ops->out32, return);
-	return chip->ops->out32(chip, reg, val);
+	chip->ops->out32(chip, reg, val);
 }
 
 #define vx_inb(chip,reg)	snd_vx_inb(chip, VX_##reg)
diff --git a/include/sound/wavefront.h b/include/sound/wavefront.h
index c13fd09f0..9e572aed2 100644
--- a/include/sound/wavefront.h
+++ b/include/sound/wavefront.h
@@ -554,8 +554,8 @@ typedef struct wf_patch_info {
 				  WF_{GET,SET}_CHANNEL above.
 
 			       */
-    wavefront_any *hdrptr;      /* user-space ptr to hdr bytes */
-    u16 *dataptr;            /* actual sample data */
+    wavefront_any __user *hdrptr;      /* user-space ptr to hdr bytes */
+    u16 __user *dataptr;            /* actual sample data */
 
     wavefront_any hdr;          /* kernel-space copy of hdr bytes */         
 } wavefront_patch_info;
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index 67afeca0c..cf2cd5ad6 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -393,11 +393,6 @@ int snd_ymfpci_timer(ymfpci_t *chip, int device);
 int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice);
 int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice);
 
-#ifdef CONFIG_PM
-void snd_ymfpci_suspend(ymfpci_t *chip);
-void snd_ymfpci_resume(ymfpci_t *chip);
-#endif
-
 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
 #define SUPPORT_JOYSTICK
 #endif
diff --git a/include/video/neomagic.h b/include/video/neomagic.h
index eec28b762..21953f8bd 100644
--- a/include/video/neomagic.h
+++ b/include/video/neomagic.h
@@ -55,6 +55,20 @@
 #define NEO_MODE1_X_1600        0x1c00
 #define NEO_MODE1_BLT_ON_ADDR   0x2000
 
+/* These are offseted in MMIO space by par->CursorOff */
+#define NEOREG_CURSCNTL		0x00
+#define NEOREG_CURSX		0x04
+#define NEOREG_CURSY		0x08
+#define NEOREG_CURSBGCOLOR	0x0C
+#define NEOREG_CURSFGCOLOR	0x10
+#define NEOREG_CURSMEMPOS	0x14
+
+#define NEO_CURS_DISABLE	0x00000000
+#define NEO_CURS_ENABLE		0x00000001
+#define NEO_ICON64_ENABLE	0x00000008
+#define NEO_ICON128_ENABLE	0x0000000C
+#define NEO_ICON_BLANK		0x00000010
+
 #ifdef __KERNEL__
 
 #ifdef NEOFB_DEBUG
@@ -75,191 +89,116 @@
 
 
 struct xtimings {
-  unsigned int pixclock;
-  unsigned int HDisplay;
-  unsigned int HSyncStart;
-  unsigned int HSyncEnd;
-  unsigned int HTotal;
-  unsigned int VDisplay;
-  unsigned int VSyncStart;
-  unsigned int VSyncEnd;
-  unsigned int VTotal;
-  unsigned int sync;
-  int	       dblscan;
-  int	       interlaced;
+	unsigned int pixclock;
+	unsigned int HDisplay;
+	unsigned int HSyncStart;
+	unsigned int HSyncEnd;
+	unsigned int HTotal;
+	unsigned int VDisplay;
+	unsigned int VSyncStart;
+	unsigned int VSyncEnd;
+	unsigned int VTotal;
+	unsigned int sync;
+	int dblscan;
+	int interlaced;
 };
 
 
 /* --------------------------------------------------------------------- */
 
 typedef volatile struct {
-  __u32 bltStat;
-  __u32 bltCntl;
-  __u32 xpColor;
-  __u32 fgColor;
-  __u32 bgColor;
-  __u32 pitch;
-  __u32 clipLT;
-  __u32 clipRB;
-  __u32 srcBitOffset;
-  __u32 srcStart;
-  __u32 reserved0;
-  __u32 dstStart;
-  __u32 xyExt;
-
-  __u32 reserved1[19];
-
-  __u32 pageCntl;
-  __u32 pageBase;
-  __u32 postBase;
-  __u32 postPtr;
-  __u32 dataPtr;
+	__u32 bltStat;
+	__u32 bltCntl;
+	__u32 xpColor;
+	__u32 fgColor;
+	__u32 bgColor;
+	__u32 pitch;
+	__u32 clipLT;
+	__u32 clipRB;
+	__u32 srcBitOffset;
+	__u32 srcStart;
+	__u32 reserved0;
+	__u32 dstStart;
+	__u32 xyExt;
+
+	__u32 reserved1[19];
+
+	__u32 pageCntl;
+	__u32 pageBase;
+	__u32 postBase;
+	__u32 postPtr;
+	__u32 dataPtr;
 } Neo2200;
 
-#define NR_PALETTE	256
-
 #define MMIO_SIZE 0x200000
 
 #define NEO_EXT_CR_MAX 0x85
 #define NEO_EXT_GR_MAX 0xC7
 
 struct neofb_par {
-  
-  unsigned char MiscOutReg;     /* Misc */
-  unsigned char CRTC[25];       /* Crtc Controller */
-  unsigned char Sequencer[5];   /* Video Sequencer */
-  unsigned char Graphics[9];    /* Video Graphics */
-  unsigned char Attribute[21];  /* Video Atribute */
-
-  unsigned char GeneralLockReg;
-  unsigned char ExtCRTDispAddr;
-  unsigned char ExtCRTOffset;
-  unsigned char SysIfaceCntl1;
-  unsigned char SysIfaceCntl2;
-  unsigned char ExtColorModeSelect;
-  unsigned char biosMode;
-
-  unsigned char PanelDispCntlReg1;
-  unsigned char PanelDispCntlReg2;
-  unsigned char PanelDispCntlReg3;
-  unsigned char PanelVertCenterReg1;
-  unsigned char PanelVertCenterReg2;
-  unsigned char PanelVertCenterReg3;
-  unsigned char PanelVertCenterReg4;
-  unsigned char PanelVertCenterReg5;
-  unsigned char PanelHorizCenterReg1;
-  unsigned char PanelHorizCenterReg2;
-  unsigned char PanelHorizCenterReg3;
-  unsigned char PanelHorizCenterReg4;
-  unsigned char PanelHorizCenterReg5;
-
-  int           ProgramVCLK;
-  unsigned char VCLK3NumeratorLow;
-  unsigned char VCLK3NumeratorHigh;
-  unsigned char VCLK3Denominator;
-  unsigned char VerticalExt;
+	struct vgastate state;
+	atomic_t ref_count;
+
+	unsigned char MiscOutReg;	/* Misc */
+	unsigned char CRTC[25];		/* Crtc Controller */
+	unsigned char Sequencer[5];	/* Video Sequencer */
+	unsigned char Graphics[9];	/* Video Graphics */
+	unsigned char Attribute[21];	/* Video Atribute */
+
+	unsigned char GeneralLockReg;
+	unsigned char ExtCRTDispAddr;
+	unsigned char ExtCRTOffset;
+	unsigned char SysIfaceCntl1;
+	unsigned char SysIfaceCntl2;
+	unsigned char ExtColorModeSelect;
+	unsigned char biosMode;
+
+	unsigned char PanelDispCntlReg1;
+	unsigned char PanelDispCntlReg2;
+	unsigned char PanelDispCntlReg3;
+	unsigned char PanelVertCenterReg1;
+	unsigned char PanelVertCenterReg2;
+	unsigned char PanelVertCenterReg3;
+	unsigned char PanelVertCenterReg4;
+	unsigned char PanelVertCenterReg5;
+	unsigned char PanelHorizCenterReg1;
+	unsigned char PanelHorizCenterReg2;
+	unsigned char PanelHorizCenterReg3;
+	unsigned char PanelHorizCenterReg4;
+	unsigned char PanelHorizCenterReg5;
+
+	int ProgramVCLK;
+	unsigned char VCLK3NumeratorLow;
+	unsigned char VCLK3NumeratorHigh;
+	unsigned char VCLK3Denominator;
+	unsigned char VerticalExt;
 
 #ifdef CONFIG_MTRR
-  int    mtrr;
+	int mtrr;
 #endif
-  u8    *mmio_vbase;
+	u8 *mmio_vbase;
+	u8 cursorOff;
+	u8 *cursorPad;		/* Must die !! */
 
-  Neo2200 *neo2200;
+	Neo2200 *neo2200;
 
-  /* Panels size */
-  int NeoPanelWidth;
-  int NeoPanelHeight;
+	/* Panels size */
+	int NeoPanelWidth;
+	int NeoPanelHeight;
 
-  int maxClock;
+	int maxClock;
 
-  int pci_burst;
-  int lcd_stretch;
-  int internal_display;
-  int external_display;
-  int libretto;
+	int pci_burst;
+	int lcd_stretch;
+	int internal_display;
+	int external_display;
+	int libretto;
 };
 
 typedef struct {
-    int x_res;
-    int y_res;
-    int mode;
+	int x_res;
+	int y_res;
+	int mode;
 } biosMode;
 
-/* vga IO functions */
-static inline u8 VGArCR (u8 index)
-{
-  outb (index, 0x3d4);
-  return inb (0x3d5);
-}
-
-static inline void VGAwCR (u8 index, u8 val)
-{
-  outb (index, 0x3d4);
-  outb (val, 0x3d5);
-}
-
-static inline u8 VGArGR (u8 index)
-{
-  outb (index, 0x3ce);
-  return inb (0x3cf);
-}
-
-static inline void VGAwGR (u8 index, u8 val)
-{
-  outb (index, 0x3ce);
-  outb (val, 0x3cf);
-}
-
-static inline u8 VGArSEQ (u8 index)
-{
-  outb (index, 0x3c4);
-  return inb (0x3c5);
-}
-
-static inline void VGAwSEQ (u8 index, u8 val)
-{
-  outb (index, 0x3c4);
-  outb (val, 0x3c5);
-}
-
-
-static int paletteEnabled = 0;
-
-static inline void VGAenablePalette (void)
-{
-  u8 tmp;
-
-  tmp = inb (0x3da);
-  outb (0x00, 0x3c0);
-  paletteEnabled = 1;
-}
-
-static inline void VGAdisablePalette (void)
-{
-  u8 tmp;
-
-  tmp = inb (0x3da);
-  outb (0x20, 0x3c0);
-  paletteEnabled = 0;
-}
-
-static inline void VGAwATTR (u8 index, u8 value)
-{
-  u8 tmp;
-
-  if (paletteEnabled)
-    index &= ~0x20;
-  else
-    index |= 0x20;
-
-  tmp = inb (0x3da);
-  outb (index, 0x3c0);
-  outb (value, 0x3c0);
-}
-
-static inline void VGAwMISC (u8 value)
-{
-  outb (value, 0x3c2);
-}
 #endif
-
diff --git a/include/video/radeon.h b/include/video/radeon.h
index 7499f1f5d..664f758a7 100644
--- a/include/video/radeon.h
+++ b/include/video/radeon.h
@@ -173,6 +173,8 @@
 #define CUR_CLR1                               0x0270  
 #define FP_HORZ_VERT_ACTIVE                    0x0278  
 #define CRTC_MORE_CNTL                         0x027C  
+#define CRTC_H_CUTOFF_ACTIVE_EN                (1<<4)
+#define CRTC_V_CUTOFF_ACTIVE_EN                (1<<5)
 #define DAC_EXT_CNTL                           0x0280  
 #define FP_GEN_CNTL                            0x0284  
 #define FP_HORZ_STRETCH                        0x028C  
@@ -185,6 +187,7 @@
 //#define DDA_ON_OFF			       0x02e4
 #define DVI_I2C_CNTL_1			       0x02e4
 #define GRPH_BUFFER_CNTL                       0x02F0
+#define GRPH2_BUFFER_CNTL                      0x03F0
 #define VGA_BUFFER_CNTL                        0x02F4
 #define OV0_Y_X_START                          0x0400
 #define OV0_Y_X_END                            0x0404  
@@ -1944,7 +1947,7 @@
 #define ixREG_COLLAR_WRITE                         0x0013
 #define ixREG_COLLAR_READ                          0x0014
 
-
+#define NB_TOM                                     0x15C
 
 
 #endif	/* _RADEON_H */
diff --git a/init/Kconfig b/init/Kconfig
index 337feb102..210ca2cb7 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -92,7 +92,7 @@ config SYSVIPC
 
 config POSIX_MQUEUE
 	bool "POSIX Message Queues"
-	depends on EXPERIMENTAL
+	depends on NET && EXPERIMENTAL
 	---help---
 	  POSIX variant of message queues is a part of IPC. In POSIX message
 	  queues every message has a priority which decides about succession
@@ -235,6 +235,17 @@ config KALLSYMS
 	   symbolic stack backtraces. This increases the size of the kernel
 	   somewhat, as all symbols have to be loaded into the kernel image.
 
+config KALLSYMS_ALL
+	bool "Include all symbols in kallsyms"
+	depends on DEBUG_KERNEL && KALLSYMS
+	help
+	   Normally kallsyms only contains the symbols of functions, for nicer
+	   OOPS messages.  Some debuggers can use kallsyms for other
+	   symbols too: say Y here to include all symbols, and you
+	   don't care about adding 300k to the size of your kernel.
+
+	   Say N.
+
 config FUTEX
 	bool "Enable futex support" if EMBEDDED
 	default y
diff --git a/init/Makefile b/init/Makefile
index 767b47b4f..75aa6626b 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -9,6 +9,9 @@ mounts-$(CONFIG_BLK_DEV_RAM)	+= do_mounts_rd.o
 mounts-$(CONFIG_BLK_DEV_INITRD)	+= do_mounts_initrd.o
 mounts-$(CONFIG_BLK_DEV_MD)	+= do_mounts_md.o
 
+extra-$(subst m,y,$(CONFIG_CRASH_DUMP))	+= kerntypes.o
+CFLAGS_kerntypes.o		:= -gstabs
+
 # files to be removed upon make clean
 clean-files := ../include/linux/compile.h
 
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index f7e3d8f1a..6f8900ee1 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -306,7 +306,7 @@ static int crd_infd, crd_outfd;
 
 static int  fill_inbuf(void);
 static void flush_window(void);
-static void *malloc(int size);
+static void *malloc(size_t size);
 static void free(void *where);
 static void error(char *m);
 static void gzip_mark(void **);
@@ -314,7 +314,7 @@ static void gzip_release(void **);
 
 #include "../lib/inflate.c"
 
-static void __init *malloc(int size)
+static void __init *malloc(size_t size)
 {
 	return kmalloc(size, GFP_KERNEL);
 }
diff --git a/init/initramfs.c b/init/initramfs.c
index d0ce3884b..40042ef5f 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -207,7 +207,7 @@ static int __init do_header(void)
 
 static int __init do_skip(void)
 {
-	if (this_header + count <= next_header) {
+	if (this_header + count < next_header) {
 		eat(count);
 		return 1;
 	} else {
diff --git a/init/main.c b/init/main.c
index 77e962511..f0ad2a6cf 100644
--- a/init/main.c
+++ b/init/main.c
@@ -42,6 +42,7 @@
 #include <linux/cpu.h>
 #include <linux/efi.h>
 #include <linux/unistd.h>
+#include <linux/rmap.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -84,7 +85,7 @@ extern void signals_init(void);
 extern void buffer_init(void);
 extern void pidhash_init(void);
 extern void pidmap_init(void);
-extern void pte_chain_init(void);
+extern void prio_tree_init(void);
 extern void radix_tree_init(void);
 extern void free_initmem(void);
 extern void populate_rootfs(void);
@@ -95,7 +96,18 @@ extern void prepare_namespace(void);
 extern void tc_init(void);
 #endif
 
-int system_state;	/* SYSTEM_BOOTING/RUNNING/SHUTDOWN */
+enum system_states system_state;
+EXPORT_SYMBOL(system_state);
+
+/*
+ * The kernel_magic value represents the address of _end, which allows
+ * namelist tools to "match" each other respectively.  That way a tool
+ * that looks at /dev/mem can verify that it is using the right System.map
+ * file -- if kernel_magic doesn't equal the namelist value of _end,
+ * something's wrong.
+ */
+extern unsigned long _end;
+unsigned long *kernel_magic = &_end;
 
 /*
  * Boot command-line arguments
@@ -169,16 +181,14 @@ static int __init obsolete_checksetup(char *line)
    still work even if initially too large, it will just take slightly longer */
 unsigned long loops_per_jiffy = (1<<12);
 
-#ifndef __ia64__
 EXPORT_SYMBOL(loops_per_jiffy);
-#endif
 
 /* This is the number of bits of precision for the loops_per_jiffy.  Each
    bit takes on average 1.5/HZ seconds.  This (like the original) is a little
    better than 1% */
 #define LPS_PREC 8
 
-void __init calibrate_delay(void)
+void __devinit calibrate_delay(void)
 {
 	unsigned long ticks, loopbit;
 	int lps_precision = LPS_PREC;
@@ -186,7 +196,7 @@ void __init calibrate_delay(void)
 	loops_per_jiffy = (1<<12);
 
 	printk("Calibrating delay loop... ");
-	while (loops_per_jiffy <<= 1) {
+	while ((loops_per_jiffy <<= 1) != 0) {
 		/* wait for "start of" clock tick */
 		ticks = jiffies;
 		while (ticks == jiffies)
@@ -351,20 +361,17 @@ static void __init setup_per_cpu_areas(void)
 static void __init smp_init(void)
 {
 	unsigned int i;
-	unsigned j = 1;
 
 	/* FIXME: This should be done in userspace --RR */
-	for (i = 0; i < NR_CPUS; i++) {
+	for_each_present_cpu(i) {
 		if (num_online_cpus() >= max_cpus)
 			break;
-		if (cpu_possible(i) && !cpu_online(i)) {
+		if (!cpu_online(i))
 			cpu_up(i);
-			j++;
-		}
 	}
 
 	/* Any cleanup work */
-	printk("Brought up %u CPUs\n", j);
+	printk("Brought up %ld CPUs\n", (long)num_online_cpus());
 	smp_cpus_done(max_cpus);
 #if 0
 	/* Get other processors into their bootup holding patterns. */
@@ -417,6 +424,13 @@ asmlinkage void __init start_kernel(void)
 	 */
 	smp_prepare_boot_cpu();
 
+	/*
+	 * Set up the scheduler prior starting any interrupts (such as the
+	 * timer interrupt). Full topology setup happens at smp_init()
+	 * time - but meanwhile we still have a functioning scheduler.
+	 */
+	sched_init();
+
 	build_all_zonelists();
 	page_alloc_init();
 	printk("Kernel command line: %s\n", saved_command_line);
@@ -428,7 +442,7 @@ asmlinkage void __init start_kernel(void)
 	rcu_init();
 	init_IRQ();
 	pidhash_init();
-	sched_init();
+	init_timers();
 	softirq_init();
 	time_init();
 
@@ -457,7 +471,8 @@ asmlinkage void __init start_kernel(void)
 	calibrate_delay();
 	pidmap_init();
 	pgtable_cache_init();
-	pte_chain_init();
+	prio_tree_init();
+	anon_vma_init();
 #ifdef CONFIG_X86
 	if (efi_enabled)
 		efi_enter_virtual_mode();
@@ -476,7 +491,6 @@ asmlinkage void __init start_kernel(void)
 	proc_root_init();
 #endif
 	check_bugs();
-	printk("POSIX conformance testing by UNIFIX\n");
 
 	/* 
 	 *	We count on the initial thread going ok 
@@ -567,7 +581,6 @@ static void do_pre_smp_initcalls(void)
 
 	migration_init();
 #endif
-	node_nr_running_init();
 	spawn_ksoftirqd();
 }
 
@@ -577,6 +590,24 @@ static void run_init_process(char *init_filename)
 	execve(init_filename, argv_init, envp_init);
 }
 
+static inline void fixup_cpu_present_map(void)
+{
+#ifdef CONFIG_SMP
+	int i;
+
+	/*
+	 * If arch is not hotplug ready and did not populate
+	 * cpu_present_map, just make cpu_present_map same as cpu_possible_map
+	 * for other cpu bringup code to function as normal. e.g smp_init() etc.
+	 */
+	if (cpus_empty(cpu_present_map)) {
+		for_each_cpu(i) {
+			cpu_set(i, cpu_present_map);
+		}
+	}
+#endif
+}
+
 static int init(void * unused)
 {
 	lock_kernel();
@@ -595,7 +626,9 @@ static int init(void * unused)
 
 	do_pre_smp_initcalls();
 
+	fixup_cpu_present_map();
 	smp_init();
+	sched_init_smp();
 
 	/*
 	 * Do this before initcalls, because some drivers want to access
@@ -609,7 +642,7 @@ static int init(void * unused)
 	 * check if there is an early userspace init.  If yes, let it do all
 	 * the work
 	 */
-	if (sys_access("/init", 0) == 0)
+	if (sys_access((const char __user *) "/init", 0) == 0)
 		execute_command = "/init";
 	else
 		prepare_namespace();
@@ -623,7 +656,7 @@ static int init(void * unused)
 	unlock_kernel();
 	system_state = SYSTEM_RUNNING;
 
-	if (sys_open("/dev/console", O_RDWR, 0) < 0)
+	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
 		printk("Warning: unable to open an initial console.\n");
 
 	(void) sys_dup(0);
diff --git a/init/version.c b/init/version.c
index d8878ae6c..e027a09d2 100644
--- a/init/version.c
+++ b/init/version.c
@@ -11,6 +11,7 @@
 #include <linux/uts.h>
 #include <linux/utsname.h>
 #include <linux/version.h>
+#include <linux/stringify.h>
 
 #define version(a) Version_ ## a
 #define version_string(a) version(a)
@@ -31,3 +32,6 @@ EXPORT_SYMBOL(system_utsname);
 const char *linux_banner = 
 	"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
 	LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
+
+const char *LINUX_COMPILE_VERSION_ID = __stringify(LINUX_COMPILE_VERSION_ID);
+LINUX_COMPILE_VERSION_ID_TYPE;
diff --git a/ipc/compat.c b/ipc/compat.c
index 600fe597d..8cbbdc49d 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -134,7 +134,7 @@ static inline int compat_ipc_parse_version(int *cmd)
 }
 
 static inline int __get_compat_ipc64_perm(struct ipc64_perm *p64,
-					  struct compat_ipc64_perm *up64)
+					  struct compat_ipc64_perm __user *up64)
 {
 	int err;
 
@@ -145,7 +145,7 @@ static inline int __get_compat_ipc64_perm(struct ipc64_perm *p64,
 }
 
 static inline int __get_compat_ipc_perm(struct ipc64_perm *p,
-					struct compat_ipc_perm *up)
+					struct compat_ipc_perm __user *up)
 {
 	int err;
 
@@ -156,7 +156,7 @@ static inline int __get_compat_ipc_perm(struct ipc64_perm *p,
 }
 
 static inline int __put_compat_ipc64_perm(struct ipc64_perm *p64,
-					  struct compat_ipc64_perm *up64)
+					  struct compat_ipc64_perm __user *up64)
 {
 	int err;
 
@@ -171,7 +171,7 @@ static inline int __put_compat_ipc64_perm(struct ipc64_perm *p64,
 }
 
 static inline int __put_compat_ipc_perm(struct ipc64_perm *p,
-					struct compat_ipc_perm *up)
+					struct compat_ipc_perm __user *up)
 {
 	int err;
 	compat_uid_t u;
@@ -192,7 +192,7 @@ static inline int __put_compat_ipc_perm(struct ipc64_perm *p,
 }
 
 static inline int get_compat_semid64_ds(struct semid64_ds *s64,
-					struct compat_semid64_ds *up64)
+					struct compat_semid64_ds __user *up64)
 {
 	if (!access_ok (VERIFY_READ, up64, sizeof(*up64)))
 		return -EFAULT;
@@ -200,7 +200,7 @@ static inline int get_compat_semid64_ds(struct semid64_ds *s64,
 }
 
 static inline int get_compat_semid_ds(struct semid64_ds *s,
-				      struct compat_semid_ds *up)
+				      struct compat_semid_ds __user *up)
 {
 	if (!access_ok (VERIFY_READ, up, sizeof(*up)))
 		return -EFAULT;
@@ -208,7 +208,7 @@ static inline int get_compat_semid_ds(struct semid64_ds *s,
 }
 
 static inline int put_compat_semid64_ds(struct semid64_ds *s64,
-					struct compat_semid64_ds *up64)
+					struct compat_semid64_ds __user *up64)
 {
 	int err;
 
@@ -222,7 +222,7 @@ static inline int put_compat_semid64_ds(struct semid64_ds *s64,
 }
 
 static inline int put_compat_semid_ds(struct semid64_ds *s,
-				      struct compat_semid_ds *up)
+				      struct compat_semid_ds __user *up)
 {
 	int err;
 
@@ -413,7 +413,7 @@ static inline int get_compat_msqid(struct msqid64_ds *m,
 }
 
 static inline int put_compat_msqid64_ds(struct msqid64_ds *m64,
-				 struct compat_msqid64_ds __user __user *up64)
+				 struct compat_msqid64_ds __user *up64)
 {
 	int err;
 
@@ -450,7 +450,7 @@ static inline int put_compat_msqid_ds(struct msqid64_ds *m,
 	return err;
 }
 
-static inline int do_msgctl(int first, int second, void __user *buf)
+static inline int do_msgctl(int first, int second, void *buf)
 {
 	mm_segment_t old_fs;
 	int err;
@@ -712,7 +712,8 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)
 long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
 		unsigned nsops, const struct compat_timespec __user *timeout)
 {
-	struct timespec ts, __user *ts64;
+	struct timespec ts;
+	struct timespec __user *ts64;
 
 	/* parameter checking precedence should mirror sys_semtimedop() */
 	if (nsops < 1 || semid < 0)
diff --git a/ipc/compat_mq.c b/ipc/compat_mq.c
index 1520df89c..a411f4ebd 100644
--- a/ipc/compat_mq.c
+++ b/ipc/compat_mq.c
@@ -77,7 +77,8 @@ asmlinkage long compat_sys_mq_open(const char __user *u_name,
 static struct timespec __user *compat_prepare_timeout(
 			const struct compat_timespec __user *u_abs_timeout)
 {
-	struct timespec ts, __user *u_ts;
+	struct timespec ts;
+	struct timespec __user *u_ts;
 
 	if (!u_abs_timeout)
 		return 0;
@@ -110,7 +111,7 @@ asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
 			size_t msg_len, unsigned int __user *u_msg_prio,
 			const struct compat_timespec __user *u_abs_timeout)
 {
-	struct timespec *u_ts;
+	struct timespec __user *u_ts;
 
 	u_ts = compat_prepare_timeout(u_abs_timeout);
 	if (IS_ERR(u_ts))
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index f7acbb55b..40a8d414e 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -97,7 +97,8 @@ static inline struct mqueue_inode_info *MQUEUE_I(struct inode *inode)
 	return container_of(inode, struct mqueue_inode_info, vfs_inode);
 }
 
-static struct inode *mqueue_get_inode(struct super_block *sb, int mode)
+static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
+							struct mq_attr *attr)
 {
 	struct inode *inode;
 
@@ -127,7 +128,11 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode)
 			memset(&info->attr, 0, sizeof(info->attr));
 			info->attr.mq_maxmsg = DFLT_MSGMAX;
 			info->attr.mq_msgsize = DFLT_MSGSIZEMAX;
-			info->messages = kmalloc(DFLT_MSGMAX * sizeof(struct msg_msg *), GFP_KERNEL);
+			if (attr) {
+				info->attr.mq_maxmsg = attr->mq_maxmsg;
+				info->attr.mq_msgsize = attr->mq_msgsize;
+			}
+			info->messages = kmalloc(info->attr.mq_maxmsg * sizeof(struct msg_msg *), GFP_KERNEL);
 			if (!info->messages) {
 				make_bad_inode(inode);
 				iput(inode);
@@ -153,7 +158,7 @@ static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
 	sb->s_magic = MQUEUE_MAGIC;
 	sb->s_op = &mqueue_super_ops;
 
-	inode = mqueue_get_inode(sb, S_IFDIR | S_ISVTX | S_IRWXUGO);
+	inode = mqueue_get_inode(sb, S_IFDIR | S_ISVTX | S_IRWXUGO, NULL);
 	if (!inode)
 		return -ENOMEM;
 
@@ -226,6 +231,7 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry,
 				int mode, struct nameidata *nd)
 {
 	struct inode *inode;
+	struct mq_attr *attr = dentry->d_fsdata;
 	int error;
 
 	spin_lock(&mq_lock);
@@ -236,7 +242,7 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry,
 	queues_count++;
 	spin_unlock(&mq_lock);
 
-	inode = mqueue_get_inode(dir->i_sb, mode);
+	inode = mqueue_get_inode(dir->i_sb, mode, attr);
 	if (!inode) {
 		error = -ENOMEM;
 		spin_lock(&mq_lock);
@@ -535,9 +541,6 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry,
 			int oflag, mode_t mode, struct mq_attr __user *u_attr)
 {
 	struct file *filp;
-	struct inode *inode;
-	struct mqueue_inode_info *info;
-	struct msg_msg **msgs = NULL;
 	struct mq_attr attr;
 	int ret;
 
@@ -555,28 +558,14 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry,
 					attr.mq_msgsize > msgsize_max)
 				return ERR_PTR(-EINVAL);
 		}
-		msgs = kmalloc(attr.mq_maxmsg * sizeof(*msgs), GFP_KERNEL);
-		if (!msgs)
-			return ERR_PTR(-ENOMEM);
-	} else {
-		msgs = NULL;
+		/* store for use during create */
+		dentry->d_fsdata = &attr;
 	}
 
 	ret = vfs_create(dir->d_inode, dentry, mode, NULL);
-	if (ret) {
-		kfree(msgs);
+	dentry->d_fsdata = NULL;
+	if (ret)
 		return ERR_PTR(ret);
-	}
-
-	inode = dentry->d_inode;
-	info = MQUEUE_I(inode);
-
-	if (msgs) {
-		info->attr.mq_maxmsg = attr.mq_maxmsg;
-		info->attr.mq_msgsize = attr.mq_msgsize;
-		kfree(info->messages);
-		info->messages = msgs;
-	}
 
 	filp = dentry_open(dentry, mqueue_mnt, oflag);
 	if (!IS_ERR(filp))
@@ -791,7 +780,7 @@ asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr,
 
 	/* First try to allocate memory, before doing anything with
 	 * existing queues. */
-	msg_ptr = load_msg((void *)u_msg_ptr, msg_len);
+	msg_ptr = load_msg(u_msg_ptr, msg_len);
 	if (unlikely(IS_ERR(msg_ptr))) {
 		ret = PTR_ERR(msg_ptr);
 		goto out_fput;
diff --git a/ipc/msg.c b/ipc/msg.c
index 37e2d3bb1..5f256af8b 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -229,7 +229,7 @@ asmlinkage long sys_msgget (key_t key, int msgflg)
 	return ret;
 }
 
-static inline unsigned long copy_msqid_to_user(void *buf, struct msqid64_ds *in, int version)
+static inline unsigned long copy_msqid_to_user(void __user *buf, struct msqid64_ds *in, int version)
 {
 	switch(version) {
 	case IPC_64:
@@ -280,7 +280,7 @@ struct msq_setbuf {
 	mode_t		mode;
 };
 
-static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void *buf, int version)
+static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version)
 {
 	switch(version) {
 	case IPC_64:
@@ -320,7 +320,7 @@ static inline unsigned long copy_msqid_from_user(struct msq_setbuf *out, void *b
 	}
 }
 
-asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds *buf)
+asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf)
 {
 	int err, version;
 	struct msg_queue *msq;
@@ -539,7 +539,7 @@ static inline int pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
 	return 0;
 }
 
-asmlinkage long sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg)
+asmlinkage long sys_msgsnd (int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg)
 {
 	struct msg_queue *msq;
 	struct msg_msg *msg;
@@ -645,7 +645,7 @@ static inline int convert_mode(long* msgtyp, int msgflg)
 	return SEARCH_EQUAL;
 }
 
-asmlinkage long sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz,
+asmlinkage long sys_msgrcv (int msqid, struct msgbuf __user *msgp, size_t msgsz,
 			    long msgtyp, int msgflg)
 {
 	struct msg_queue *msq;
diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index e48d777de..66cfb8764 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -25,7 +25,7 @@ struct msg_msgseg {
 #define DATALEN_MSG	(PAGE_SIZE-sizeof(struct msg_msg))
 #define DATALEN_SEG	(PAGE_SIZE-sizeof(struct msg_msgseg))
 
-struct msg_msg *load_msg(void __user *src, int len)
+struct msg_msg *load_msg(const void __user *src, int len)
 {
 	struct msg_msg *msg;
 	struct msg_msgseg **pseg;
@@ -49,7 +49,7 @@ struct msg_msg *load_msg(void __user *src, int len)
 	}
 
 	len -= alen;
-	src = ((char *)src) + alen;
+	src = ((char __user *)src) + alen;
 	pseg = &msg->next;
 	while (len > 0) {
 		struct msg_msgseg *seg;
@@ -70,7 +70,7 @@ struct msg_msg *load_msg(void __user *src, int len)
 		}
 		pseg = &seg->next;
 		len -= alen;
-		src = ((char *)src) + alen;
+		src = ((char __user *)src) + alen;
 	}
 
 	err = security_msg_msg_alloc(msg);
@@ -96,7 +96,7 @@ int store_msg(void __user *dest, struct msg_msg *msg, int len)
 		return -1;
 
 	len -= alen;
-	dest = ((char *)dest) + alen;
+	dest = ((char __user *)dest) + alen;
 	seg = msg->next;
 	while (len > 0) {
 		alen = len;
@@ -105,7 +105,7 @@ int store_msg(void __user *dest, struct msg_msg *msg, int len)
 		if (copy_to_user(dest, seg + 1, alen))
 			return -1;
 		len -= alen;
-		dest = ((char *)dest) + alen;
+		dest = ((char __user *)dest) + alen;
 		seg = seg->next;
 	}
 	return 0;
diff --git a/ipc/sem.c b/ipc/sem.c
index 372567355..6316aca9c 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -610,7 +610,7 @@ static int semctl_main(int semid, int semnum, int cmd, int version, union semun
 	switch (cmd) {
 	case GETALL:
 	{
-		ushort *array = arg.array;
+		ushort __user *array = arg.array;
 		int i;
 
 		if(nsems > SEMMSL_FAST) {
diff --git a/ipc/shm.c b/ipc/shm.c
index 714933b14..9761e3bcb 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -163,6 +163,10 @@ static struct vm_operations_struct shm_vm_ops = {
 	.open	= shm_open,	/* callback for a new vm-area open */
 	.close	= shm_close,	/* callback for when the vm-area is released */
 	.nopage	= shmem_nopage,
+#ifdef CONFIG_NUMA
+	.set_policy = shmem_set_policy,
+	.get_policy = shmem_get_policy,
+#endif
 };
 
 static int newseg (key_t key, int shmflg, size_t size)
diff --git a/ipc/util.c b/ipc/util.c
index f74c5eef5..81a145ede 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -25,6 +25,8 @@
 #include <linux/rcupdate.h>
 #include <linux/workqueue.h>
 
+#include <asm/unistd.h>
+
 #include "util.h"
 
 /**
@@ -507,7 +509,8 @@ int ipc_checkid(struct ipc_ids* ids, struct kern_ipc_perm* ipcp, int uid)
 	return 0;
 }
 
-#if !defined(__ia64__) && !defined(__x86_64__) && !defined(__hppa__)
+#ifdef __ARCH_WANT_IPC_PARSE_VERSION
+
 
 /**
  *	ipc_parse_version	-	IPC call version
@@ -528,4 +531,4 @@ int ipc_parse_version (int *cmd)
 	}
 }
 
-#endif /* __ia64__ */
+#endif /* __ARCH_WANT_IPC_PARSE_VERSION */
diff --git a/ipc/util.h b/ipc/util.h
index e6434942c..8697df67b 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -68,7 +68,7 @@ int ipc_parse_version (int *cmd);
 #endif
 
 extern void free_msg(struct msg_msg *msg);
-extern struct msg_msg *load_msg(void __user *src, int len);
+extern struct msg_msg *load_msg(const void __user *src, int len);
 extern int store_msg(void __user *dest, struct msg_msg *msg, int len);
 
 #endif
diff --git a/kernel/acct.c b/kernel/acct.c
index 555e1e3c3..f0e2bd045 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -204,7 +204,7 @@ void acct_file_reopen(struct file *file)
  *  should be written. If the filename is NULL, accounting will be
  *  shutdown.
  */
-asmlinkage long sys_acct(const char *name)
+asmlinkage long sys_acct(const char __user *name)
 {
 	struct file *file = NULL;
 	char *tmp;
diff --git a/kernel/compat.c b/kernel/compat.c
index f05cda344..57cc48e90 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -23,14 +23,14 @@
 
 #include <asm/uaccess.h>
 
-int get_compat_timespec(struct timespec *ts, const struct compat_timespec *cts)
+int get_compat_timespec(struct timespec *ts, const struct compat_timespec __user *cts)
 {
 	return (verify_area(VERIFY_READ, cts, sizeof(*cts)) ||
 			__get_user(ts->tv_sec, &cts->tv_sec) ||
 			__get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
 }
 
-int put_compat_timespec(const struct timespec *ts, struct compat_timespec *cts)
+int put_compat_timespec(const struct timespec *ts, struct compat_timespec __user *cts)
 {
 	return (verify_area(VERIFY_WRITE, cts, sizeof(*cts)) ||
 			__put_user(ts->tv_sec, &cts->tv_sec) ||
@@ -40,7 +40,7 @@ int put_compat_timespec(const struct timespec *ts, struct compat_timespec *cts)
 static long compat_nanosleep_restart(struct restart_block *restart)
 {
 	unsigned long expire = restart->arg0, now = jiffies;
-	struct compat_timespec *rmtp;
+	struct compat_timespec __user *rmtp;
 
 	/* Did it expire while we handled signals? */
 	if (!time_after(expire, now))
@@ -51,7 +51,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
 	if (expire == 0)
 		return 0;
 
-	rmtp = (struct compat_timespec *)restart->arg1;
+	rmtp = (struct compat_timespec __user *)restart->arg1;
 	if (rmtp) {
 		struct compat_timespec ct;
 		struct timespec t;
@@ -66,8 +66,8 @@ static long compat_nanosleep_restart(struct restart_block *restart)
 	return -ERESTART_RESTARTBLOCK;
 }
 
-asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
-		struct compat_timespec *rmtp)
+asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
+		struct compat_timespec __user *rmtp)
 {
 	struct timespec t;
 	struct restart_block *restart;
@@ -98,7 +98,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
 }
 
 static inline long get_compat_itimerval(struct itimerval *o,
-		struct compat_itimerval *i)
+		struct compat_itimerval __user *i)
 {
 	return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
 		(__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) |
@@ -107,7 +107,7 @@ static inline long get_compat_itimerval(struct itimerval *o,
 		 __get_user(o->it_value.tv_usec, &i->it_value.tv_usec)));
 }
 
-static inline long put_compat_itimerval(struct compat_itimerval *o,
+static inline long put_compat_itimerval(struct compat_itimerval __user *o,
 		struct itimerval *i)
 {
 	return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
@@ -117,7 +117,8 @@ static inline long put_compat_itimerval(struct compat_itimerval *o,
 		 __put_user(i->it_value.tv_usec, &o->it_value.tv_usec)));
 }
 
-asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it)
+asmlinkage long compat_sys_getitimer(int which,
+		struct compat_itimerval __user *it)
 {
 	struct itimerval kit;
 	int error;
@@ -128,8 +129,9 @@ asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it)
 	return error;
 }
 
-asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in,
-		struct compat_itimerval *out)
+asmlinkage long compat_sys_setitimer(int which,
+		struct compat_itimerval __user *in,
+		struct compat_itimerval __user *out)
 {
 	struct itimerval kin, kout;
 	int error;
@@ -148,7 +150,7 @@ asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in,
 	return 0;
 }
 
-asmlinkage long compat_sys_times(struct compat_tms *tbuf)
+asmlinkage long compat_sys_times(struct compat_tms __user *tbuf)
 {
 	/*
 	 *	In the SMP world we might just be unlucky and have one of
@@ -173,22 +175,22 @@ asmlinkage long compat_sys_times(struct compat_tms *tbuf)
  * types that can be passed to put_user()/get_user().
  */
 
-asmlinkage long compat_sys_sigpending(compat_old_sigset_t *set)
+asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
 {
 	old_sigset_t s;
 	long ret;
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
-	ret = sys_sigpending(&s);
+	ret = sys_sigpending((old_sigset_t __user *) &s);
 	set_fs(old_fs);
 	if (ret == 0)
 		ret = put_user(s, set);
 	return ret;
 }
 
-asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
-		compat_old_sigset_t *oset)
+asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
+		compat_old_sigset_t __user *oset)
 {
 	old_sigset_t s;
 	long ret;
@@ -198,7 +200,9 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
 		return -EFAULT;
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
+	ret = sys_sigprocmask(how,
+			      set ? (old_sigset_t __user *) &s : NULL,
+			      oset ? (old_sigset_t __user *) &s : NULL);
 	set_fs(old_fs);
 	if (ret == 0)
 		if (oset)
@@ -207,8 +211,9 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
 }
 
 #ifdef CONFIG_FUTEX
-asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
-		struct compat_timespec *utime, u32 *uaddr2)
+asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, int val,
+		struct compat_timespec __user *utime, u32 __user *uaddr2,
+		int val3)
 {
 	struct timespec t;
 	unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
@@ -219,15 +224,16 @@ asmlinkage long compat_sys_futex(u32 *uaddr, int op, int val,
 			return -EFAULT;
 		timeout = timespec_to_jiffies(&t) + 1;
 	}
-	if (op == FUTEX_REQUEUE)
-		val2 = (int) (long) utime;
+	if (op >= FUTEX_REQUEUE)
+		val2 = (int) (unsigned long) utime;
 
 	return do_futex((unsigned long)uaddr, op, val, timeout,
-			(unsigned long)uaddr2, val2);
+			(unsigned long)uaddr2, val2, val3);
 }
 #endif
 
-asmlinkage long compat_sys_setrlimit(unsigned int resource, struct compat_rlimit *rlim)
+asmlinkage long compat_sys_setrlimit(unsigned int resource,
+		struct compat_rlimit __user *rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -246,14 +252,15 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource, struct compat_rlimit
 	if (r.rlim_max == COMPAT_RLIM_INFINITY)
 		r.rlim_max = RLIM_INFINITY;
 	set_fs(KERNEL_DS);
-	ret = sys_setrlimit(resource, &r);
+	ret = sys_setrlimit(resource, (struct rlimit __user *) &r);
 	set_fs(old_fs);
 	return ret;
 }
 
 #ifdef COMPAT_RLIM_OLD_INFINITY
 
-asmlinkage long compat_sys_old_getrlimit(unsigned int resource, struct compat_rlimit *rlim)
+asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
+		struct compat_rlimit __user *rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -279,14 +286,15 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource, struct compat_rl
 
 #endif
 
-asmlinkage long compat_sys_getrlimit (unsigned int resource, struct compat_rlimit *rlim)
+asmlinkage long compat_sys_getrlimit (unsigned int resource,
+		struct compat_rlimit __user *rlim)
 {
 	struct rlimit r;
 	int ret;
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
-	ret = sys_getrlimit(resource, &r);
+	ret = sys_getrlimit(resource, (struct rlimit __user *) &r);
 	set_fs(old_fs);
 	if (!ret) {
 		if (r.rlim_cur > COMPAT_RLIM_INFINITY)
@@ -302,7 +310,7 @@ asmlinkage long compat_sys_getrlimit (unsigned int resource, struct compat_rlimi
 	return ret;
 }
 
-static long put_compat_rusage (struct compat_rusage *ru, struct rusage *r)
+static long put_compat_rusage(struct compat_rusage __user *ru, struct rusage *r)
 {
 	if (!access_ok(VERIFY_WRITE, ru, sizeof(*ru)) ||
 	    __put_user(r->ru_utime.tv_sec, &ru->ru_utime.tv_sec) ||
@@ -327,14 +335,14 @@ static long put_compat_rusage (struct compat_rusage *ru, struct rusage *r)
 	return 0;
 }
 
-asmlinkage long compat_sys_getrusage(int who, struct compat_rusage *ru)
+asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
 {
 	struct rusage r;
 	int ret;
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
-	ret = sys_getrusage(who, &r);
+	ret = sys_getrusage(who, (struct rusage __user *) &r);
 	set_fs(old_fs);
 
 	if (ret)
@@ -347,8 +355,8 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage *ru)
 }
 
 asmlinkage long
-compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
-	struct compat_rusage *ru)
+compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
+	struct compat_rusage __user *ru)
 {
 	if (!ru) {
 		return sys_wait4(pid, stat_addr, options, NULL);
@@ -359,7 +367,10 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
 		mm_segment_t old_fs = get_fs();
 
 		set_fs (KERNEL_DS);
-		ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r);
+		ret = sys_wait4(pid,
+				(stat_addr ?
+				 (unsigned int __user *) &status : NULL),
+				options, (struct rusage __user *) &r);
 		set_fs (old_fs);
 
 		if (ret > 0) {
@@ -374,42 +385,42 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
 
 asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid, 
 					     unsigned int len,
-					     compat_ulong_t *user_mask_ptr)
+					     compat_ulong_t __user *user_mask_ptr)
 {
-	unsigned long kernel_mask;
+	unsigned long kern_mask;
 	mm_segment_t old_fs;
 	int ret;
 
-	if (get_user(kernel_mask, user_mask_ptr))
+	if (get_user(kern_mask, user_mask_ptr))
 		return -EFAULT;
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 	ret = sys_sched_setaffinity(pid,
-				    sizeof(kernel_mask),
-				    &kernel_mask);
+				    sizeof(kern_mask),
+				    (unsigned long __user *) &kern_mask);
 	set_fs(old_fs);
 
 	return ret;
 }
 
-asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
-					    compat_ulong_t *user_mask_ptr)
+asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
+					     compat_ulong_t __user *user_mask_ptr)
 {
-	unsigned long kernel_mask;
+	unsigned long kern_mask;
 	mm_segment_t old_fs;
 	int ret;
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 	ret = sys_sched_getaffinity(pid,
-				    sizeof(kernel_mask),
-				    &kernel_mask);
+				    sizeof(kern_mask),
+				    (unsigned long __user *) &kern_mask);
 	set_fs(old_fs);
 
 	if (ret > 0) {
 		ret = sizeof(compat_ulong_t);
-		if (put_user(kernel_mask, user_mask_ptr))
+		if (put_user(kern_mask, user_mask_ptr))
 			return -EFAULT;
 	}
 
@@ -417,7 +428,7 @@ asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
 }
 
 static int get_compat_itimerspec(struct itimerspec *dst, 
-				 struct compat_itimerspec *src)
+				 struct compat_itimerspec __user *src)
 { 
 	if (get_compat_timespec(&dst->it_interval, &src->it_interval) ||
 	    get_compat_timespec(&dst->it_value, &src->it_value))
@@ -425,7 +436,7 @@ static int get_compat_itimerspec(struct itimerspec *dst,
 	return 0;
 } 
 
-static int put_compat_itimerspec(struct compat_itimerspec *dst, 
+static int put_compat_itimerspec(struct compat_itimerspec __user *dst, 
 				 struct itimerspec *src)
 { 
 	if (put_compat_timespec(&src->it_interval, &dst->it_interval) ||
@@ -435,8 +446,8 @@ static int put_compat_itimerspec(struct compat_itimerspec *dst,
 } 
 
 long compat_timer_settime(timer_t timer_id, int flags, 
-			  struct compat_itimerspec *new, 
-			  struct compat_itimerspec *old)
+			  struct compat_itimerspec __user *new, 
+			  struct compat_itimerspec __user *old)
 { 
 	long err;
 	mm_segment_t oldfs;
@@ -448,63 +459,77 @@ long compat_timer_settime(timer_t timer_id, int flags,
 		return -EFAULT;	
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_timer_settime(timer_id, flags, &newts, &oldts);
+	err = sys_timer_settime(timer_id, flags,
+				(struct itimerspec __user *) &newts,
+				(struct itimerspec __user *) &oldts);
 	set_fs(oldfs); 
 	if (!err && old && put_compat_itimerspec(old, &oldts))
 		return -EFAULT;
 	return err;
 } 
 
-long compat_timer_gettime(timer_t timer_id, struct compat_itimerspec *setting)
+long compat_timer_gettime(timer_t timer_id,
+		struct compat_itimerspec __user *setting)
 { 
 	long err;
 	mm_segment_t oldfs;
 	struct itimerspec ts; 
+
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_timer_gettime(timer_id, &ts); 
+	err = sys_timer_gettime(timer_id,
+				(struct itimerspec __user *) &ts); 
 	set_fs(oldfs); 
 	if (!err && put_compat_itimerspec(setting, &ts))
 		return -EFAULT;
 	return err;
 } 
 
-long compat_clock_settime(clockid_t which_clock,  struct compat_timespec *tp)
+long compat_clock_settime(clockid_t which_clock,
+		struct compat_timespec __user *tp)
 {
 	long err;
 	mm_segment_t oldfs;
 	struct timespec ts; 
+
 	if (get_compat_timespec(&ts, tp))
 		return -EFAULT; 
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);	
-	err = sys_clock_settime(which_clock, &ts); 
+	err = sys_clock_settime(which_clock,
+				(struct timespec __user *) &ts);
 	set_fs(oldfs);
 	return err;
 } 
 
-long compat_clock_gettime(clockid_t which_clock,  struct compat_timespec *tp)
+long compat_clock_gettime(clockid_t which_clock,
+		struct compat_timespec __user *tp)
 {
 	long err;
 	mm_segment_t oldfs;
 	struct timespec ts; 
+
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_clock_gettime(which_clock, &ts); 
+	err = sys_clock_gettime(which_clock,
+				(struct timespec __user *) &ts);
 	set_fs(oldfs);
 	if (!err && put_compat_timespec(&ts, tp))
 		return -EFAULT; 
 	return err;
 } 
 
-long compat_clock_getres(clockid_t which_clock,  struct compat_timespec *tp)
+long compat_clock_getres(clockid_t which_clock,
+		struct compat_timespec __user *tp)
 {
 	long err;
 	mm_segment_t oldfs;
 	struct timespec ts; 
+
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_clock_getres(which_clock, &ts); 
+	err = sys_clock_getres(which_clock,
+			       (struct timespec __user *) &ts);
 	set_fs(oldfs);
 	if (!err && put_compat_timespec(&ts, tp))
 		return -EFAULT; 
@@ -518,11 +543,15 @@ long compat_clock_nanosleep(clockid_t which_clock, int flags,
 	long err;
 	mm_segment_t oldfs;
 	struct timespec in, out; 
+
 	if (get_compat_timespec(&in, rqtp)) 
 		return -EFAULT;
+
 	oldfs = get_fs();
-	set_fs(KERNEL_DS);	
-	err = sys_clock_nanosleep(which_clock, flags, &in, &out);  
+	set_fs(KERNEL_DS);
+	err = sys_clock_nanosleep(which_clock, flags,
+				  (struct timespec __user *) &in,
+				  (struct timespec __user *) &out);
 	set_fs(oldfs);
 	if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
 	    put_compat_timespec(&out, rmtp))
diff --git a/kernel/cpu.c b/kernel/cpu.c
index fcbb0d5d2..72b984c67 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -20,6 +20,14 @@
 DECLARE_MUTEX(cpucontrol);
 
 static struct notifier_block *cpu_chain;
+/*
+ * Represents all cpu's present in the system
+ * In systems capable of hotplug, this map could dynamically grow
+ * as new cpu's are detected in the system via any platform specific
+ * method, such as ACPI for e.g.
+ */
+cpumask_t	cpu_present_map;
+EXPORT_SYMBOL(cpu_present_map);
 
 /* Need to know about CPUs going up/down? */
 int register_cpu_notifier(struct notifier_block *nb)
@@ -43,15 +51,16 @@ void unregister_cpu_notifier(struct notifier_block *nb)
 EXPORT_SYMBOL(unregister_cpu_notifier);
 
 #ifdef CONFIG_HOTPLUG_CPU
-static inline void check_for_tasks(int cpu, struct task_struct *k)
+static inline void check_for_tasks(int cpu)
 {
 	struct task_struct *p;
 
 	write_lock_irq(&tasklist_lock);
 	for_each_process(p) {
-		if (task_cpu(p) == cpu && p != k)
-			printk(KERN_WARNING "Task %s is on cpu %d\n",
-				p->comm, cpu);
+		if (task_cpu(p) == cpu && (p->utime != 0 || p->stime != 0))
+			printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d\
+				(state = %ld, flags = %lx) \n",
+				 p->comm, p->pid, cpu, p->state, p->flags);
 	}
 	write_unlock_irq(&tasklist_lock);
 }
@@ -96,8 +105,9 @@ static int take_cpu_down(void *unused)
 	if (err < 0)
 		cpu_set(smp_processor_id(), cpu_online_map);
 	else
-		/* Everyone else gets kicked off. */
-		migrate_all_tasks();
+		/* Force idle task to run as soon as we yield: it should
+		   immediately notice cpu is offline and die quickly. */
+		sched_idle_next();
 
 	return err;
 }
@@ -106,6 +116,7 @@ int cpu_down(unsigned int cpu)
 {
 	int err;
 	struct task_struct *p;
+	cpumask_t old_allowed, tmp;
 
 	if ((err = lock_cpu_hotplug_interruptible()) != 0)
 		return err;
@@ -120,17 +131,21 @@ int cpu_down(unsigned int cpu)
 		goto out;
 	}
 
+	/* Ensure that we are not runnable on dying cpu */
+	old_allowed = current->cpus_allowed;
+	tmp = CPU_MASK_ALL;
+	cpu_clear(cpu, tmp);
+	set_cpus_allowed(current, tmp);
+
 	p = __stop_machine_run(take_cpu_down, NULL, cpu);
 	if (IS_ERR(p)) {
 		err = PTR_ERR(p);
-		goto out;
+		goto out_allowed;
 	}
 
 	if (cpu_online(cpu))
 		goto out_thread;
 
-	check_for_tasks(cpu, p);
-
 	/* Wait for it to sleep (leaving idle task). */
 	while (!idle_cpu(cpu))
 		yield();
@@ -146,10 +161,14 @@ int cpu_down(unsigned int cpu)
 	    == NOTIFY_BAD)
 		BUG();
 
+	check_for_tasks(cpu);
+
 	cpu_run_sbin_hotplug(cpu, "offline");
 
 out_thread:
 	err = kthread_stop(p);
+out_allowed:
+	set_cpus_allowed(current, old_allowed);
 out:
 	unlock_cpu_hotplug();
 	return err;
@@ -169,7 +188,7 @@ int __devinit cpu_up(unsigned int cpu)
 	if ((ret = down_interruptible(&cpucontrol)) != 0)
 		return ret;
 
-	if (cpu_online(cpu)) {
+	if (cpu_online(cpu) || !cpu_present(cpu)) {
 		ret = -EINVAL;
 		goto out;
 	}
diff --git a/kernel/exit.c b/kernel/exit.c
index 96d7394cc..3a51fec0a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -22,15 +22,17 @@
 #include <linux/profile.h>
 #include <linux/mount.h>
 #include <linux/proc_fs.h>
+#include <linux/mempolicy.h>
 
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 
 extern void sem_exit (void);
 extern struct task_struct *child_reaper;
 
-int getrusage(struct task_struct *, int, struct rusage *);
+int getrusage(struct task_struct *, int, struct rusage __user *);
 
 static void __unhash_process(struct task_struct *p)
 {
@@ -734,6 +736,14 @@ static void exit_notify(struct task_struct *tsk)
 	tsk->state = state;
 	tsk->flags |= PF_DEAD;
 
+	/*
+	 * Clear these here so that update_process_times() won't try to deliver
+	 * itimer, profile or rlimit signals to this task while it is in late exit.
+	 */
+	tsk->it_virt_value = 0;
+	tsk->it_prof_value = 0;
+	tsk->rlim[RLIMIT_CPU].rlim_cur = RLIM_INFINITY;
+
 	/*
 	 * In the preemption case it must be impossible for the task
 	 * to get runnable again, so use "_raw_" unlock to keep
@@ -790,6 +800,9 @@ asmlinkage NORET_TYPE void do_exit(long code)
 	__exit_fs(tsk);
 	exit_namespace(tsk);
 	exit_thread();
+#ifdef CONFIG_NUMA
+	mpol_free(tsk->mempolicy);
+#endif
 
 	if (tsk->signal->leader)
 		disassociate_ctty(1);
@@ -931,7 +944,7 @@ static int eligible_child(pid_t pid, int options, task_t *p)
  * the lock and this task is uninteresting.  If we return nonzero, we have
  * released the lock and the system call should return.
  */
-static int wait_task_zombie(task_t *p, unsigned int *stat_addr, struct rusage *ru)
+static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct rusage __user *ru)
 {
 	unsigned long state;
 	int retval;
@@ -1004,7 +1017,8 @@ static int wait_task_zombie(task_t *p, unsigned int *stat_addr, struct rusage *r
  * released the lock and the system call should return.
  */
 static int wait_task_stopped(task_t *p, int delayed_group_leader,
-			     unsigned int *stat_addr, struct rusage *ru)
+			     unsigned int __user *stat_addr,
+			     struct rusage __user *ru)
 {
 	int retval, exit_code;
 
@@ -1074,7 +1088,7 @@ static int wait_task_stopped(task_t *p, int delayed_group_leader,
 	return retval;
 }
 
-asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struct rusage * ru)
+asmlinkage long sys_wait4(pid_t pid,unsigned int __user *stat_addr, int options, struct rusage __user *ru)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	struct task_struct *tsk;
@@ -1157,14 +1171,13 @@ end_wait4:
 	return retval;
 }
 
-#if !defined(__alpha__) && !defined(__ia64__) && \
-    !defined(__arm__) && !defined(__s390__)
+#ifdef __ARCH_WANT_SYS_WAITPID
 
 /*
  * sys_waitpid() remains for compatibility. waitpid() should be
  * implemented by calling sys_wait4() from libc.a.
  */
-asmlinkage long sys_waitpid(pid_t pid,unsigned int * stat_addr, int options)
+asmlinkage long sys_waitpid(pid_t pid, unsigned __user *stat_addr, int options)
 {
 	return sys_wait4(pid, stat_addr, options, NULL);
 }
diff --git a/kernel/fork.c b/kernel/fork.c
index 68597bc34..0cbc27f48 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -21,11 +21,13 @@
 #include <linux/completion.h>
 #include <linux/namespace.h>
 #include <linux/personality.h>
+#include <linux/mempolicy.h>
 #include <linux/sem.h>
 #include <linux/file.h>
 #include <linux/binfmts.h>
 #include <linux/mman.h>
 #include <linux/fs.h>
+#include <linux/cpu.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/jiffies.h>
@@ -33,6 +35,7 @@
 #include <linux/ptrace.h>
 #include <linux/mount.h>
 #include <linux/audit.h>
+#include <linux/rmap.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -60,7 +63,7 @@ int nr_processes(void)
 	int cpu;
 	int total = 0;
 
-	for_each_cpu(cpu)
+	for_each_online_cpu(cpu)
 		total += per_cpu(process_counts, cpu);
 
 	return total;
@@ -196,9 +199,9 @@ void fastcall finish_wait(wait_queue_head_t *q, wait_queue_t *wait)
 
 EXPORT_SYMBOL(finish_wait);
 
-int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync)
+int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
 {
-	int ret = default_wake_function(wait, mode, sync);
+	int ret = default_wake_function(wait, mode, sync, key);
 
 	if (ret)
 		list_del_init(&wait->task_list);
@@ -215,11 +218,8 @@ void __init fork_init(unsigned long mempages)
 #endif
 	/* create a slab on which task_structs can be allocated */
 	task_struct_cachep =
-		kmem_cache_create("task_struct",
-				  sizeof(struct task_struct),ARCH_MIN_TASKALIGN,
-				  0, NULL, NULL);
-	if (!task_struct_cachep)
-		panic("fork_init(): cannot create task_struct SLAB cache");
+		kmem_cache_create("task_struct", sizeof(struct task_struct),
+			ARCH_MIN_TASKALIGN, SLAB_PANIC, NULL, NULL);
 #endif
 
 	/*
@@ -271,7 +271,8 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
 	struct vm_area_struct * mpnt, *tmp, **pprev;
 	struct rb_node **rb_link, *rb_parent;
 	int retval;
-	unsigned long charge = 0;
+	unsigned long charge;
+	struct mempolicy *pol;
 
 	down_write(&oldmm->mmap_sem);
 	flush_cache_mm(current->mm);
@@ -303,21 +304,28 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
 
 		if(mpnt->vm_flags & VM_DONTCOPY)
 			continue;
+		charge = 0;
 		if (mpnt->vm_flags & VM_ACCOUNT) {
 			unsigned int len = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
 			if (security_vm_enough_memory(len))
 				goto fail_nomem;
-			charge += len;
+			charge = len;
 		}
 		tmp = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
 		if (!tmp)
 			goto fail_nomem;
 		*tmp = *mpnt;
+		pol = mpol_copy(vma_policy(mpnt));
+		retval = PTR_ERR(pol);
+		if (IS_ERR(pol))
+			goto fail_nomem_policy;
+		vma_set_policy(tmp, pol);
 		tmp->vm_flags &= ~VM_LOCKED;
 		tmp->vm_mm = mm;
 		tmp->vm_next = NULL;
+		anon_vma_link(tmp);
+		vma_prio_tree_init(tmp);
 		file = tmp->vm_file;
-		INIT_LIST_HEAD(&tmp->shared);
 		if (file) {
 			struct inode *inode = file->f_dentry->d_inode;
 			get_file(file);
@@ -325,9 +333,11 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
 				atomic_dec(&inode->i_writecount);
       
 			/* insert tmp into the share list, just after mpnt */
-			down(&file->f_mapping->i_shared_sem);
-			list_add(&tmp->shared, &mpnt->shared);
-			up(&file->f_mapping->i_shared_sem);
+			spin_lock(&file->f_mapping->i_mmap_lock);
+			flush_dcache_mmap_lock(file->f_mapping);
+			vma_prio_tree_add(tmp, mpnt);
+			flush_dcache_mmap_unlock(file->f_mapping);
+			spin_unlock(&file->f_mapping->i_mmap_lock);
 		}
 
 		/*
@@ -351,7 +361,7 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
 			tmp->vm_ops->open(tmp);
 
 		if (retval)
-			goto fail;
+			goto out;
 	}
 	retval = 0;
 
@@ -359,12 +369,14 @@ out:
 	flush_tlb_mm(current->mm);
 	up_write(&oldmm->mmap_sem);
 	return retval;
+fail_nomem_policy:
+	kmem_cache_free(vm_area_cachep, tmp);
 fail_nomem:
 	retval = -ENOMEM;
-fail:
 	vm_unacct_memory(charge);
 	goto out;
 }
+
 static inline int mm_alloc_pgd(struct mm_struct * mm)
 {
 	mm->pgd = pgd_alloc(mm);
@@ -421,9 +433,9 @@ struct mm_struct * mm_alloc(void)
 	mm = allocate_mm();
 	if (mm) {
 		memset(mm, 0, sizeof(*mm));
-		return mm_init(mm);
+		mm = mm_init(mm);
 	}
-	return NULL;
+	return mm;
 }
 
 /*
@@ -505,7 +517,7 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
 		 * not set up a proper pointer then tough luck.
 		 */
 		put_user(0, tidptr);
-		sys_futex(tidptr, FUTEX_WAKE, 1, NULL, NULL);
+		sys_futex(tidptr, FUTEX_WAKE, 1, NULL, NULL, 0);
 	}
 }
 
@@ -953,10 +965,18 @@ struct task_struct *copy_process(unsigned long clone_flags,
 	p->security = NULL;
 	p->io_context = NULL;
 	p->audit_context = NULL;
+#ifdef CONFIG_NUMA
+ 	p->mempolicy = mpol_copy(p->mempolicy);
+ 	if (IS_ERR(p->mempolicy)) {
+ 		retval = PTR_ERR(p->mempolicy);
+ 		p->mempolicy = NULL;
+ 		goto bad_fork_cleanup;
+ 	}
+#endif
 
 	retval = -ENOMEM;
 	if ((retval = security_task_alloc(p)))
-		goto bad_fork_cleanup;
+		goto bad_fork_cleanup_policy;
 	if ((retval = audit_alloc(p)))
 		goto bad_fork_cleanup_security;
 	/* copy all the process information */
@@ -1102,6 +1122,10 @@ bad_fork_cleanup_audit:
 	audit_free(p);
 bad_fork_cleanup_security:
 	security_task_free(p);
+bad_fork_cleanup_policy:
+#ifdef CONFIG_NUMA
+	mpol_free(p->mempolicy);
+#endif
 bad_fork_cleanup:
 	if (p->pid > 0)
 		free_pidmap(p->pid);
@@ -1180,10 +1204,31 @@ long do_fork(unsigned long clone_flags,
 			set_tsk_thread_flag(p, TIF_SIGPENDING);
 		}
 
-		if (!(clone_flags & CLONE_STOPPED))
-			wake_up_forked_process(p);	/* do this last */
-		else
+		if (!(clone_flags & CLONE_STOPPED)) {
+			/*
+			 * Do the wakeup last. On SMP we treat fork() and
+			 * CLONE_VM separately, because fork() has already
+			 * created cache footprint on this CPU (due to
+			 * copying the pagetables), hence migration would
+			 * probably be costy. Threads on the other hand
+			 * have less traction to the current CPU, and if
+			 * there's an imbalance then the scheduler can
+			 * migrate this fresh thread now, before it
+			 * accumulates a larger cache footprint:
+			 */
+			if (clone_flags & CLONE_VM)
+				wake_up_forked_thread(p);
+			else
+				wake_up_forked_process(p);
+		} else {
+			int cpu = get_cpu();
+
 			p->state = TASK_STOPPED;
+			if (cpu_is_offline(task_cpu(p)))
+				set_task_cpu(p, cpu);
+
+			put_cpu();
+		}
 		++total_forks;
 
 		if (unlikely (trace)) {
@@ -1227,37 +1272,20 @@ void __init proc_caches_init(void)
 {
 	sighand_cachep = kmem_cache_create("sighand_cache",
 			sizeof(struct sighand_struct), 0,
-			SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!sighand_cachep)
-		panic("Cannot create sighand SLAB cache");
-
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 	signal_cachep = kmem_cache_create("signal_cache",
 			sizeof(struct signal_struct), 0,
-			SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!signal_cachep)
-		panic("Cannot create signal SLAB cache");
-
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 	files_cachep = kmem_cache_create("files_cache", 
-			 sizeof(struct files_struct), 0, 
-			 SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!files_cachep) 
-		panic("Cannot create files SLAB cache");
-
+			sizeof(struct files_struct), 0,
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 	fs_cachep = kmem_cache_create("fs_cache", 
-			 sizeof(struct fs_struct), 0, 
-			 SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if (!fs_cachep) 
-		panic("Cannot create fs_struct SLAB cache");
- 
+			sizeof(struct fs_struct), 0,
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 	vm_area_cachep = kmem_cache_create("vm_area_struct",
 			sizeof(struct vm_area_struct), 0,
-			0, NULL, NULL);
-	if(!vm_area_cachep)
-		panic("vma_init: Cannot alloc vm_area_struct SLAB cache");
-
+			SLAB_PANIC, NULL, NULL);
 	mm_cachep = kmem_cache_create("mm_struct",
 			sizeof(struct mm_struct), 0,
-			SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if(!mm_cachep)
-		panic("vma_init: Cannot alloc mm_struct SLAB cache");
+			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 }
diff --git a/kernel/futex.c b/kernel/futex.c
index 93f7ea6f8..abae250cf 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -38,6 +38,7 @@
 #include <linux/futex.h>
 #include <linux/mount.h>
 #include <linux/pagemap.h>
+#include <linux/syscalls.h>
 
 #define FUTEX_HASHBITS 8
 
@@ -96,6 +97,7 @@ struct futex_q {
  */
 struct futex_hash_bucket {
        spinlock_t              lock;
+       unsigned int	    nqueued;
        struct list_head       chain;
 };
 
@@ -318,13 +320,14 @@ out:
  * physical page.
  */
 static int futex_requeue(unsigned long uaddr1, unsigned long uaddr2,
-				int nr_wake, int nr_requeue)
+			 int nr_wake, int nr_requeue, int *valp)
 {
 	union futex_key key1, key2;
 	struct futex_hash_bucket *bh1, *bh2;
 	struct list_head *head1;
 	struct futex_q *this, *next;
 	int ret, drop_count = 0;
+	unsigned int nqueued;
 
 	down_read(&current->mm->mmap_sem);
 
@@ -338,12 +341,41 @@ static int futex_requeue(unsigned long uaddr1, unsigned long uaddr2,
 	bh1 = hash_futex(&key1);
 	bh2 = hash_futex(&key2);
 
+	nqueued = bh1->nqueued;
+	if (likely(valp != NULL)) {
+		int curval;
+
+		/* In order to avoid doing get_user while
+		   holding bh1->lock and bh2->lock, nqueued
+		   (monotonically increasing field) must be first
+		   read, then *uaddr1 fetched from userland and
+		   after acquiring lock nqueued field compared with
+		   the stored value.  The smp_mb () below
+		   makes sure that bh1->nqueued is read from memory
+		   before *uaddr1.  */
+		smp_mb();
+
+		if (get_user(curval, (int __user *)uaddr1) != 0) {
+			ret = -EFAULT;
+			goto out;
+		}
+		if (curval != *valp) {
+			ret = -EAGAIN;
+			goto out;
+		}
+	}
+
 	if (bh1 < bh2)
 		spin_lock(&bh1->lock);
 	spin_lock(&bh2->lock);
 	if (bh1 > bh2)
 		spin_lock(&bh1->lock);
 
+	if (unlikely(nqueued != bh1->nqueued && valp != NULL)) {
+		ret = -EAGAIN;
+		goto out_unlock;
+	}
+
 	head1 = &bh1->chain;
 	list_for_each_entry_safe(this, next, head1, list) {
 		if (!match_futex (&this->key, &key1))
@@ -365,6 +397,7 @@ static int futex_requeue(unsigned long uaddr1, unsigned long uaddr2,
 		}
 	}
 
+out_unlock:
 	spin_unlock(&bh1->lock);
 	if (bh1 != bh2)
 		spin_unlock(&bh2->lock);
@@ -398,6 +431,7 @@ static void queue_me(struct futex_q *q, int fd, struct file *filp)
 	q->lock_ptr = &bh->lock;
 
 	spin_lock(&bh->lock);
+	bh->nqueued++;
 	list_add_tail(&q->list, &bh->chain);
 	spin_unlock(&bh->lock);
 }
@@ -459,7 +493,7 @@ static int futex_wait(unsigned long uaddr, int val, unsigned long time)
 	 * We hold the mmap semaphore, so the mapping cannot have changed
 	 * since we looked it up.
 	 */
-	if (get_user(curval, (int *)uaddr) != 0) {
+	if (get_user(curval, (int __user *)uaddr) != 0) {
 		ret = -EFAULT;
 		goto out_unqueue;
 	}
@@ -625,7 +659,7 @@ out:
 }
 
 long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout,
-		unsigned long uaddr2, int val2)
+		unsigned long uaddr2, int val2, int val3)
 {
 	int ret;
 
@@ -641,7 +675,10 @@ long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout,
 		ret = futex_fd(uaddr, val);
 		break;
 	case FUTEX_REQUEUE:
-		ret = futex_requeue(uaddr, uaddr2, val, val2);
+		ret = futex_requeue(uaddr, uaddr2, val, val2, NULL);
+		break;
+	case FUTEX_CMP_REQUEUE:
+		ret = futex_requeue(uaddr, uaddr2, val, val2, &val3);
 		break;
 	default:
 		ret = -ENOSYS;
@@ -651,7 +688,8 @@ long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout,
 
 
 asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
-			  struct timespec __user *utime, u32 __user *uaddr2)
+			  struct timespec __user *utime, u32 __user *uaddr2,
+			  int val3)
 {
 	struct timespec t;
 	unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
@@ -665,11 +703,11 @@ asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
 	/*
 	 * requeue parameter in 'utime' if op == FUTEX_REQUEUE.
 	 */
-	if (op == FUTEX_REQUEUE)
+	if (op >= FUTEX_REQUEUE)
 		val2 = (int) (long) utime;
 
 	return do_futex((unsigned long)uaddr, op, val, timeout,
-			(unsigned long)uaddr2, val2);
+			(unsigned long)uaddr2, val2, val3);
 }
 
 static struct super_block *
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index ab39819f0..21387087b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -88,14 +88,20 @@ const char *kallsyms_lookup(unsigned long addr,
 			name += strlen(name) + 1;
 		}
 
-		/* Base symbol size on next symbol. */
-		if (best + 1 < kallsyms_num_syms)
-			symbol_end = kallsyms_addresses[best + 1];
-		else if (is_kernel_inittext(addr))
+		/* At worst, symbol ends at end of section. */
+		if (is_kernel_inittext(addr))
 			symbol_end = (unsigned long)_einittext;
 		else
 			symbol_end = (unsigned long)_etext;
 
+		/* Search for next non-aliased symbol */
+		for (i = best+1; i < kallsyms_num_syms; i++) {
+			if (kallsyms_addresses[i] > kallsyms_addresses[best]) {
+				symbol_end = kallsyms_addresses[i];
+				break;
+			}
+		}
+
 		*symbolsize = symbol_end - kallsyms_addresses[best];
 		*modname = NULL;
 		*offset = addr - kallsyms_addresses[best];
@@ -171,21 +177,26 @@ static int get_ksymbol_mod(struct kallsym_iter *iter)
 	return 1;
 }
 
-static void get_ksymbol_core(struct kallsym_iter *iter)
+/* Returns space to next name. */
+static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
 {
-	unsigned stemlen;
+	unsigned stemlen, off = iter->nameoff;
 
 	/* First char of each symbol name indicates prefix length
 	   shared with previous name (stem compression). */
-	stemlen = kallsyms_names[iter->nameoff++];
+	stemlen = kallsyms_names[off++];
 
-	strlcpy(iter->name+stemlen, kallsyms_names+iter->nameoff, 128-stemlen);
-	iter->nameoff += strlen(kallsyms_names + iter->nameoff) + 1;
+	strlcpy(iter->name+stemlen, kallsyms_names + off, 128-stemlen);
+	off += strlen(kallsyms_names + off) + 1;
 	iter->owner = NULL;
 	iter->value = kallsyms_addresses[iter->pos];
-	iter->type = 't';
+	if (is_kernel_text(iter->value) || is_kernel_inittext(iter->value))
+		iter->type = 't';
+	else
+		iter->type = 'd';
 
 	upcase_if_global(iter);
+	return off - iter->nameoff;
 }
 
 static void reset_iter(struct kallsym_iter *iter)
@@ -210,9 +221,10 @@ static int update_iter(struct kallsym_iter *iter, loff_t pos)
 
 	/* We need to iterate through the previous symbols: can be slow */
 	for (; iter->pos != pos; iter->pos++) {
-		get_ksymbol_core(iter);
+		iter->nameoff += get_ksymbol_core(iter);
 		cond_resched();
 	}
+	get_ksymbol_core(iter);
 	return 1;
 }
 
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 8754003bb..ea62192b7 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -47,7 +47,7 @@ static struct workqueue_struct *khelper_wq;
 /*
 	modprobe_path is set via /proc/sys.
 */
-char modprobe_path[256] = "/sbin/modprobe";
+char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe";
 
 /**
  * request_module - try to load a kernel module
@@ -132,7 +132,7 @@ EXPORT_SYMBOL(request_module);
 	events.  the command is expected to load drivers when
 	necessary, and may perform additional system setup.
 */
-char hotplug_path[256] = "/sbin/hotplug";
+char hotplug_path[KMOD_PATH_LEN] = "/sbin/hotplug";
 
 EXPORT_SYMBOL(hotplug_path);
 
@@ -192,10 +192,20 @@ static int wait_for_helper(void *data)
 	allow_signal(SIGCHLD);
 
 	pid = kernel_thread(____call_usermodehelper, sub_info, SIGCHLD);
-	if (pid < 0)
+	if (pid < 0) {
 		sub_info->retval = pid;
-	else
-		sys_wait4(pid, &sub_info->retval, 0, NULL);
+	} else {
+		/*
+		 * Normally it is bogus to call wait4() from in-kernel because
+		 * wait4() wants to write the exit code to a userspace address.
+		 * But wait_for_helper() always runs as keventd, and put_user()
+		 * to a kernel address works OK for kernel threads, due to their
+		 * having an mm_segment_t which spans the entire address space.
+		 *
+		 * Thus the __user pointer cast is valid here.
+		 */
+		sys_wait4(pid, (int __user *) &sub_info->retval, 0, NULL);
+	}
 
 	complete(sub_info->complete);
 	return 0;
@@ -269,4 +279,4 @@ static __init int usermodehelper_init(void)
 	BUG_ON(!khelper_wq);
 	return 0;
 }
-__initcall(usermodehelper_init);
+core_initcall(usermodehelper_init);
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 2e60249d4..da0ec5b25 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -11,6 +11,7 @@
 #include <linux/err.h>
 #include <linux/unistd.h>
 #include <linux/file.h>
+#include <linux/module.h>
 #include <asm/semaphore.h>
 
 struct kthread_create_info
@@ -41,7 +42,7 @@ int kthread_should_stop(void)
 {
 	return (kthread_stop_info.k == current);
 }
-
+EXPORT_SYMBOL(kthread_should_stop);
 
 static void kthread_exit_files(void)
 {
@@ -144,6 +145,7 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
 
 	return create.result;
 }
+EXPORT_SYMBOL(kthread_create);
 
 void kthread_bind(struct task_struct *k, unsigned int cpu)
 {
@@ -153,6 +155,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu)
 	set_task_cpu(k, cpu);
 	k->cpus_allowed = cpumask_of_cpu(cpu);
 }
+EXPORT_SYMBOL(kthread_bind);
 
 int kthread_stop(struct task_struct *k)
 {
@@ -180,3 +183,4 @@ int kthread_stop(struct task_struct *k)
 
 	return ret;
 }
+EXPORT_SYMBOL(kthread_stop);
diff --git a/kernel/module.c b/kernel/module.c
index 5a9846bb1..e7a73bac2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -379,6 +379,22 @@ static inline void percpu_modcopy(void *pcpudst, const void *src,
 }
 #endif /* CONFIG_SMP */
 
+static int add_attribute(struct module *mod, struct kernel_param *kp)
+{
+	struct module_attribute *a;
+	int retval;
+
+	a = &mod->mkobj->attr[mod->mkobj->num_attributes];
+	a->attr.name = (char *)kp->name;
+	a->attr.owner = mod;
+	a->attr.mode = kp->perm;
+	a->param = kp;
+	retval = sysfs_create_file(&mod->mkobj->kobj, &a->attr);
+	if (!retval)
+		mod->mkobj->num_attributes++;
+	return retval;
+}
+
 #ifdef CONFIG_MODULE_UNLOAD
 /* Init the unload section of the module. */
 static void module_unload_init(struct module *mod)
@@ -663,6 +679,23 @@ void symbol_put_addr(void *addr)
 }
 EXPORT_SYMBOL_GPL(symbol_put_addr);
 
+static int refcnt_get_fn(char *buffer, struct kernel_param *kp)
+{
+	struct module *mod = container_of(kp, struct module, refcnt_param);
+
+	/* sysfs holds one reference. */
+	return sprintf(buffer, "%u", module_refcount(mod)-1);
+}
+
+static inline int sysfs_unload_setup(struct module *mod)
+{
+	mod->refcnt_param.name = "refcnt";
+	mod->refcnt_param.perm = 0444;
+	mod->refcnt_param.get = refcnt_get_fn;
+
+	return add_attribute(mod, &mod->refcnt_param);
+}
+
 #else /* !CONFIG_MODULE_UNLOAD */
 static void print_unload_info(struct seq_file *m, struct module *mod)
 {
@@ -689,6 +722,10 @@ sys_delete_module(const char *name_user, unsigned int flags)
 	return -ENOSYS;
 }
 
+static inline int sysfs_unload_setup(struct module *mod)
+{
+	return 0;
+}
 #endif /* CONFIG_MODULE_UNLOAD */
 
 #ifdef CONFIG_OBSOLETE_MODPARM
@@ -944,6 +981,116 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs,
 	return ret;
 }
 
+#define to_module_attr(n) container_of(n, struct module_attribute, attr);
+
+static ssize_t module_attr_show(struct kobject *kobj,
+				struct attribute *attr,
+				char *buf)
+{
+	int count;
+	struct module_attribute *attribute = to_module_attr(attr);
+
+	if (!attribute->param->get)
+		return -EPERM;
+
+	count = attribute->param->get(buf, attribute->param);
+	if (count > 0) {
+		strcat(buf, "\n");
+		++count;
+	}
+	return count;
+}
+
+/* sysfs always hands a nul-terminated string in buf.  We rely on that. */
+static ssize_t module_attr_store(struct kobject *kobj,
+				 struct attribute *attr,
+				 const char *buf, size_t len)
+{
+	int err;
+	struct module_attribute *attribute = to_module_attr(attr);
+
+	if (!attribute->param->set)
+		return -EPERM;
+
+	err = attribute->param->set(buf, attribute->param);
+	if (!err)
+		return len;
+	return err;
+}
+
+static struct sysfs_ops module_sysfs_ops = {
+	.show = module_attr_show,
+	.store = module_attr_store,
+};
+
+static void module_kobj_release(struct kobject *kobj)
+{
+	kfree(container_of(kobj, struct module_kobject, kobj));
+}
+
+static struct kobj_type module_ktype = {
+	.sysfs_ops =	&module_sysfs_ops,
+	.release =	&module_kobj_release,
+};
+static decl_subsys(module, &module_ktype, NULL);
+
+static int mod_sysfs_setup(struct module *mod,
+			   struct kernel_param *kparam,
+			   unsigned int num_params)
+{
+	unsigned int i;
+	int err;
+
+	/* We overallocate: not every param is in sysfs, and maybe no refcnt */
+	mod->mkobj = kmalloc(sizeof(*mod->mkobj)
+			     + sizeof(mod->mkobj->attr[0]) * (num_params+1),
+			     GFP_KERNEL);
+	if (!mod->mkobj)
+		return -ENOMEM;
+
+	memset(&mod->mkobj->kobj, 0, sizeof(mod->mkobj->kobj));
+	err = kobject_set_name(&mod->mkobj->kobj, mod->name);
+	if (err)
+		goto out;
+	kobj_set_kset_s(mod->mkobj, module_subsys);
+	err = kobject_register(&mod->mkobj->kobj);
+	if (err)
+		goto out;
+
+	mod->mkobj->num_attributes = 0;
+
+	for (i = 0; i < num_params; i++) {
+		if (kparam[i].perm) {
+			err = add_attribute(mod, &kparam[i]);
+			if (err)
+				goto out_unreg;
+		}
+	}
+	err = sysfs_unload_setup(mod);
+	if (err)
+		goto out_unreg;
+	return 0;
+
+out_unreg:
+	for (i = 0; i < mod->mkobj->num_attributes; i++)
+		sysfs_remove_file(&mod->mkobj->kobj,&mod->mkobj->attr[i].attr);
+	/* Calls module_kobj_release */
+	kobject_unregister(&mod->mkobj->kobj);
+	return err;
+out:
+	kfree(mod->mkobj);
+	return err;
+}
+
+static void mod_kobject_remove(struct module *mod)
+{
+	unsigned int i;
+	for (i = 0; i < mod->mkobj->num_attributes; i++)
+		sysfs_remove_file(&mod->mkobj->kobj,&mod->mkobj->attr[i].attr);
+	/* Calls module_kobj_release */
+	kobject_unregister(&mod->mkobj->kobj);
+}
+
 /* Free a module, remove from lists, etc (must hold module mutex). */
 static void free_module(struct module *mod)
 {
@@ -952,6 +1099,8 @@ static void free_module(struct module *mod)
 	list_del(&mod->list);
 	spin_unlock_irq(&modlist_lock);
 
+	mod_kobject_remove(mod);
+
 	/* Arch-specific cleanup. */
 	module_arch_cleanup(mod);
 
@@ -1131,7 +1280,7 @@ static void set_license(struct module *mod, const char *license)
 		license = "unspecified";
 
 	mod->license_gplok = license_is_gpl_compatible(license);
-	if (!mod->license_gplok) {
+	if (!mod->license_gplok && !(tainted & TAINT_PROPRIETARY_MODULE)) {
 		printk(KERN_WARNING "%s: module license '%s' taints kernel.\n",
 		       mod->name, license);
 		tainted |= TAINT_PROPRIETARY_MODULE;
@@ -1556,6 +1705,11 @@ static struct module *load_module(void __user *umod,
 				 / sizeof(struct kernel_param),
 				 NULL);
 	}
+	err = mod_sysfs_setup(mod, 
+			      (struct kernel_param *)
+			      sechdrs[setupindex].sh_addr,
+			      sechdrs[setupindex].sh_size
+			      / sizeof(struct kernel_param));
 	if (err < 0)
 		goto arch_cleanup;
 
@@ -1886,8 +2040,25 @@ struct module *module_text_address(unsigned long addr)
 	return NULL;
 }
 
+/* Don't grab lock, we're oopsing. */
+void print_modules(void)
+{
+	struct module *mod;
+
+	printk("Modules linked in:");
+	list_for_each_entry(mod, &modules, list)
+		printk(" %s", mod->name);
+	printk("\n");
+}
+
 #ifdef CONFIG_MODVERSIONS
 /* Generate the signature for struct module here, too, for modversions. */
 void struct_module(struct module *mod) { return; }
 EXPORT_SYMBOL(struct_module);
 #endif
+
+static int __init modules_init(void)
+{
+	return subsystem_register(&module_subsys);
+}
+__initcall(modules_init);
diff --git a/kernel/panic.c b/kernel/panic.c
index 3c1581eb6..a0c8bbcd3 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -19,12 +19,17 @@
 #include <linux/syscalls.h>
 #include <linux/interrupt.h>
 #include <linux/nmi.h>
+#ifdef CONFIG_KEXEC
+#include <linux/kexec.h>
+#endif
 
 int panic_timeout;
 int panic_on_oops;
 int tainted;
+void (*dump_function_ptr)(const char *, const struct pt_regs *) = 0;
 
 EXPORT_SYMBOL(panic_timeout);
+EXPORT_SYMBOL(dump_function_ptr);
 
 struct notifier_block *panic_notifier_list;
 
@@ -59,6 +64,7 @@ NORET_TYPE void panic(const char * fmt, ...)
 	va_start(args, fmt);
 	vsnprintf(buf, sizeof(buf), fmt, args);
 	va_end(args);
+
 	printk(KERN_EMERG "Kernel panic: %s\n",buf);
 	if (in_interrupt())
 		printk(KERN_EMERG "In interrupt handler - not syncing\n");
@@ -68,20 +74,30 @@ NORET_TYPE void panic(const char * fmt, ...)
 		sys_sync();
 	bust_spinlocks(0);
 
+        notifier_call_chain(&panic_notifier_list, 0, buf);
+	
 #ifdef CONFIG_SMP
 	smp_send_stop();
 #endif
 
-       notifier_call_chain(&panic_notifier_list, 0, buf);
-
-	if (panic_timeout > 0)
-	{
+	if (panic_timeout > 0) {
 		int i;
 		/*
 	 	 * Delay timeout seconds before rebooting the machine. 
 		 * We can't use the "normal" timers since we just panicked..
 	 	 */
 		printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout);
+#ifdef CONFIG_KEXEC
+{		
+		struct kimage *image;
+		image = xchg(&kexec_image, 0);
+ 		if (image) {
+ 			printk(KERN_EMERG "by starting a new kernel ..\n");
+ 			mdelay(panic_timeout*1000);
+			machine_kexec(image);
+ 		}
+ }
+#endif
 		for (i = 0; i < panic_timeout; i++) {
 			touch_nmi_watchdog();
 			mdelay(1000);
diff --git a/kernel/params.c b/kernel/params.c
index 59667bce9..5f38ee74a 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -161,7 +161,7 @@ int parse_args(const char *name,
 									\
 		if (!val) return -EINVAL;				\
 		l = strtolfn(val, &endp, 0);				\
-		if (endp == val || *endp || ((type)l != l))		\
+		if (endp == val || ((type)l != l))			\
 			return -EINVAL;					\
 		*((type *)kp->arg) = l;					\
 		return 0;						\
diff --git a/kernel/power/process.c b/kernel/power/process.c
index d65d6a375..347435415 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -13,12 +13,6 @@
 #include <linux/suspend.h>
 #include <linux/module.h>
 
-#ifdef DEBUG_SLOW
-#define MDELAY(a) mdelay(a)
-#else
-#define MDELAY(a)
-#endif
-
 /* 
  * Timeout for stopping processes
  */
@@ -121,7 +115,6 @@ void thaw_processes(void)
 	read_unlock(&tasklist_lock);
 	schedule();
 	printk( " done\n" );
-	MDELAY(500);
 }
 
 EXPORT_SYMBOL(refrigerator);
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 8f78d6807..752f6cdb4 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -222,10 +222,30 @@ static void mark_swapfiles(swp_entry_t prev, int mode)
 	__free_page(page);
 }
 
+
+/*
+ * Check whether the swap device is the specified resume
+ * device, irrespective of whether they are specified by
+ * identical names.
+ *
+ * (Thus, device inode aliasing is allowed.  You can say /dev/hda4
+ * instead of /dev/ide/host0/bus0/target0/lun0/part4 [if using devfs]
+ * and they'll be considered the same device.  This is *necessary* for
+ * devfs, since the resume code can only recognize the form /dev/hda4,
+ * but the suspend code would see the long name.)
+ */
+static int is_resume_device(const struct swap_info_struct *swap_info)
+{
+	struct file *file = swap_info->swap_file;
+	struct inode *inode = file->f_dentry->d_inode;
+
+	return S_ISBLK(inode->i_mode) &&
+		resume_device == MKDEV(imajor(inode), iminor(inode));
+}
+
 static void read_swapfiles(void) /* This is called before saving image */
 {
 	int i, len;
-	static char buff[sizeof(resume_file)], *sname;
 	
 	len=strlen(resume_file);
 	root_swap = 0xFFFF;
@@ -244,17 +264,10 @@ static void read_swapfiles(void) /* This is called before saving image */
 					swapfile_used[i] = SWAPFILE_IGNORED;				  
 			} else {
 	  			/* we ignore all swap devices that are not the resume_file */
-				sname = d_path(swap_info[i].swap_file->f_dentry,
-					       swap_info[i].swap_file->f_vfsmnt,
-					       buff,
-					       sizeof(buff));
-				if (!strcmp(sname, resume_file)) {
+				if (is_resume_device(&swap_info[i])) {
 					swapfile_used[i] = SWAPFILE_SUSPEND;
 					root_swap = i;
 				} else {
-#if 0
-					printk( "Resume: device %s (%x != %x) ignored\n", swap_info[i].swap_file->d_name.name, swap_info[i].swap_device, resume_device );				  
-#endif
 				  	swapfile_used[i] = SWAPFILE_IGNORED;
 				}
 			}
@@ -1098,7 +1111,7 @@ static int __init __read_suspend_image(struct block_device *bdev, union diskpage
 	return 0;
 }
 
-static int read_suspend_image(const char * specialfile, int noresume)
+static int __init read_suspend_image(const char * specialfile, int noresume)
 {
 	union diskpage *cur;
 	unsigned long scratch_page = 0;
diff --git a/kernel/printk.c b/kernel/printk.c
index 3b7468818..9e34ce41b 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -471,6 +471,27 @@ static void emit_log_char(char c)
 		logged_chars++;
 }
 
+/*
+ * Zap console related locks when oopsing. Only zap at most once
+ * every 10 seconds, to leave time for slow consoles to print a
+ * full oops.
+ */
+static void zap_locks(void)
+{
+	static unsigned long oops_timestamp;
+
+	if (time_after_eq(jiffies, oops_timestamp) &&
+			!time_after(jiffies, oops_timestamp + 30*HZ))
+		return;
+
+	oops_timestamp = jiffies;
+
+	/* If a crash is occurring, make sure we can't deadlock */
+	spin_lock_init(&logbuf_lock);
+	/* And make sure that we print immediately */
+	init_MUTEX(&console_sem);
+}
+
 /*
  * This is printk.  It can be called from any context.  We want it to work.
  * 
@@ -493,12 +514,8 @@ asmlinkage int printk(const char *fmt, ...)
 	static char printk_buf[1024];
 	static int log_level_unknown = 1;
 
-	if (oops_in_progress) {
-		/* If a crash is occurring, make sure we can't deadlock */
-		spin_lock_init(&logbuf_lock);
-		/* And make sure that we print immediately */
-		init_MUTEX(&console_sem);
-	}
+	if (unlikely(oops_in_progress))
+		zap_locks();
 
 	/* This stops the holder of console_sem just where we want him */
 	spin_lock_irqsave(&logbuf_lock, flags);
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index f9324b7c8..13a1b5a58 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -113,7 +113,7 @@ static void rcu_start_batch(long newbatch)
 		return;
 	}
 	/* Can't change, since spin lock held. */
-	active = idle_cpu_mask;
+	active = nohz_cpu_mask;
 	cpus_complement(active);
 	cpus_and(rcu_ctrlblk.rcu_cpu_mask, cpu_online_map, active);
 }
@@ -223,13 +223,13 @@ static void rcu_process_callbacks(unsigned long unused)
 
 	if (!list_empty(&RCU_curlist(cpu)) &&
 	    rcu_batch_after(rcu_ctrlblk.curbatch, RCU_batch(cpu))) {
-		list_splice(&RCU_curlist(cpu), &list);
+		__list_splice(&RCU_curlist(cpu), &list);
 		INIT_LIST_HEAD(&RCU_curlist(cpu));
 	}
 
 	local_irq_disable();
 	if (!list_empty(&RCU_nxtlist(cpu)) && list_empty(&RCU_curlist(cpu))) {
-		list_splice(&RCU_nxtlist(cpu), &RCU_curlist(cpu));
+		__list_splice(&RCU_nxtlist(cpu), &RCU_curlist(cpu));
 		INIT_LIST_HEAD(&RCU_nxtlist(cpu));
 		local_irq_enable();
 
diff --git a/kernel/resource.c b/kernel/resource.c
index f7a704e88..da0ffd601 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -332,8 +332,8 @@ int insert_resource(struct resource *parent, struct resource *new)
 		if (next->sibling->start > new->end)
 			break;
 
-	/* existing resource overlaps end of new resource */
-	if (next->end > new->end) {
+	/* existing resource includes new resource */
+	if (next->end >= new->end) {
 		parent = next;
 		result = 0;
 		goto begin;
diff --git a/kernel/sched.c b/kernel/sched.c
index 1493acff5..69d4a6eab 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -15,6 +15,7 @@
  *		and per-CPU runqueues.  Cleanups and useful suggestions
  *		by Davide Libenzi, preemptible kernel bits by Robert Love.
  *  2003-09-03	Interactivity tuning by Con Kolivas.
+ *  2004-04-02	Scheduler domains code by Nick Piggin
  */
 
 #include <linux/mm.h>
@@ -40,12 +41,18 @@
 #include <linux/percpu.h>
 #include <linux/kthread.h>
 
+#include <asm/unistd.h>
+
 #ifdef CONFIG_NUMA
 #define cpu_to_node_mask(cpu) node_to_cpumask(cpu_to_node(cpu))
 #else
 #define cpu_to_node_mask(cpu) (cpu_online_map)
 #endif
 
+/* used to soft spin in sched while dump is in progress */
+unsigned long dump_oncpu;
+EXPORT_SYMBOL(dump_oncpu);
+
 /*
  * Convert user-nice values [ -20 ... 0 ... 19 ]
  * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
@@ -91,7 +98,6 @@
 #define MAX_SLEEP_AVG		(AVG_TIMESLICE * MAX_BONUS)
 #define STARVATION_LIMIT	(MAX_SLEEP_AVG)
 #define NS_MAX_SLEEP_AVG	(JIFFIES_TO_NS(MAX_SLEEP_AVG))
-#define NODE_THRESHOLD		125
 #define CREDIT_LIMIT		100
 
 /*
@@ -139,8 +145,7 @@
 	(v1) * (v2_max) / (v1_max)
 
 #define DELTA(p) \
-	(SCALE(TASK_NICE(p), 40, MAX_USER_PRIO*PRIO_BONUS_RATIO/100) + \
-		INTERACTIVE_DELTA)
+	(SCALE(TASK_NICE(p), 40, MAX_BONUS) + INTERACTIVE_DELTA)
 
 #define TASK_INTERACTIVE(p) \
 	((p)->prio <= (p)->static_prio - DELTA(p))
@@ -173,65 +178,23 @@
 		((MAX_TIMESLICE - MIN_TIMESLICE) * \
 			(MAX_PRIO-1 - (p)->static_prio) / (MAX_USER_PRIO-1)))
 
-static inline unsigned int task_timeslice(task_t *p)
+static unsigned int task_timeslice(task_t *p)
 {
 	return BASE_TIMESLICE(p);
 }
 
-/*
- * These are the runqueue data structures:
- */
-
-#define BITMAP_SIZE ((((MAX_PRIO+1+7)/8)+sizeof(long)-1)/sizeof(long))
+#define task_hot(p, now, sd) ((now) - (p)->timestamp < (sd)->cache_hot_time)
 
-typedef struct runqueue runqueue_t;
+DEFINE_PER_CPU(struct runqueue, runqueues);
 
-struct prio_array {
-	int nr_active;
-	unsigned long bitmap[BITMAP_SIZE];
-	struct list_head queue[MAX_PRIO];
-};
-
-/*
- * This is the main, per-CPU runqueue data structure.
- *
- * Locking rule: those places that want to lock multiple runqueues
- * (such as the load balancing or the thread migration code), lock
- * acquire operations must be ordered by ascending &runqueue.
- */
-struct runqueue {
-	spinlock_t lock;
-	unsigned long long nr_switches;
-	unsigned long nr_running, expired_timestamp, nr_uninterruptible,
-		timestamp_last_tick;
-	task_t *curr, *idle;
-	struct mm_struct *prev_mm;
-	prio_array_t *active, *expired, arrays[2];
-	int best_expired_prio, prev_cpu_load[NR_CPUS];
-#ifdef CONFIG_NUMA
-	atomic_t *node_nr_running;
-	int prev_node_load[MAX_NUMNODES];
-#endif
-	task_t *migration_thread;
-	struct list_head migration_queue;
-
-	atomic_t nr_iowait;
-};
-
-static DEFINE_PER_CPU(struct runqueue, runqueues);
+#define for_each_domain(cpu, domain) \
+	for (domain = cpu_rq(cpu)->sd; domain; domain = domain->parent)
 
 #define cpu_rq(cpu)		(&per_cpu(runqueues, (cpu)))
 #define this_rq()		(&__get_cpu_var(runqueues))
 #define task_rq(p)		cpu_rq(task_cpu(p))
 #define cpu_curr(cpu)		(cpu_rq(cpu)->curr)
 
-extern unsigned long __scheduling_functions_start_here;
-extern unsigned long __scheduling_functions_end_here;
-const unsigned long scheduling_functions_start_here =
-			(unsigned long)&__scheduling_functions_start_here;
-const unsigned long scheduling_functions_end_here =
-			(unsigned long)&__scheduling_functions_end_here;
-
 /*
  * Default context-switch locking:
  */
@@ -241,57 +204,12 @@ const unsigned long scheduling_functions_end_here =
 # define task_running(rq, p)		((rq)->curr == (p))
 #endif
 
-#ifdef CONFIG_NUMA
-
-/*
- * Keep track of running tasks.
- */
-
-static atomic_t node_nr_running[MAX_NUMNODES] ____cacheline_maxaligned_in_smp =
-	{[0 ...MAX_NUMNODES-1] = ATOMIC_INIT(0)};
-
-static inline void nr_running_init(struct runqueue *rq)
-{
-	rq->node_nr_running = &node_nr_running[0];
-}
-
-static inline void nr_running_inc(runqueue_t *rq)
-{
-	atomic_inc(rq->node_nr_running);
-	rq->nr_running++;
-}
-
-static inline void nr_running_dec(runqueue_t *rq)
-{
-	atomic_dec(rq->node_nr_running);
-	rq->nr_running--;
-}
-
-__init void node_nr_running_init(void)
-{
-	int i;
-
-	for (i = 0; i < NR_CPUS; i++) {
-		if (cpu_possible(i))
-			cpu_rq(i)->node_nr_running =
-				&node_nr_running[cpu_to_node(i)];
-	}
-}
-
-#else /* !CONFIG_NUMA */
-
-# define nr_running_init(rq)	do { } while (0)
-# define nr_running_inc(rq)	do { (rq)->nr_running++; } while (0)
-# define nr_running_dec(rq)	do { (rq)->nr_running--; } while (0)
-
-#endif /* CONFIG_NUMA */
-
 /*
  * task_rq_lock - lock the runqueue a given task resides on and disable
  * interrupts.  Note the ordering: we can safely lookup the task_rq without
  * explicitly disabling preemption.
  */
-static inline runqueue_t *task_rq_lock(task_t *p, unsigned long *flags)
+static runqueue_t *task_rq_lock(task_t *p, unsigned long *flags)
 {
 	struct runqueue *rq;
 
@@ -314,7 +232,7 @@ static inline void task_rq_unlock(runqueue_t *rq, unsigned long *flags)
 /*
  * rq_lock - lock a given runqueue and disable interrupts.
  */
-static inline runqueue_t *this_rq_lock(void)
+static runqueue_t *this_rq_lock(void)
 {
 	runqueue_t *rq;
 
@@ -333,7 +251,7 @@ static inline void rq_unlock(runqueue_t *rq)
 /*
  * Adding/removing a task to/from a priority array:
  */
-static inline void dequeue_task(struct task_struct *p, prio_array_t *array)
+static void dequeue_task(struct task_struct *p, prio_array_t *array)
 {
 	array->nr_active--;
 	list_del(&p->run_list);
@@ -341,7 +259,7 @@ static inline void dequeue_task(struct task_struct *p, prio_array_t *array)
 		__clear_bit(p->prio, array->bitmap);
 }
 
-static inline void enqueue_task(struct task_struct *p, prio_array_t *array)
+static void enqueue_task(struct task_struct *p, prio_array_t *array)
 {
 	list_add_tail(&p->run_list, array->queue + p->prio);
 	__set_bit(p->prio, array->bitmap);
@@ -349,6 +267,19 @@ static inline void enqueue_task(struct task_struct *p, prio_array_t *array)
 	p->array = array;
 }
 
+/*
+ * Used by the migration code - we pull tasks from the head of the
+ * remote queue so we want these tasks to show up at the head of the
+ * local queue:
+ */
+static inline void enqueue_task_head(struct task_struct *p, prio_array_t *array)
+{
+	list_add(&p->run_list, array->queue + p->prio);
+	__set_bit(p->prio, array->bitmap);
+	array->nr_active++;
+	p->array = array;
+}
+
 /*
  * effective_prio - return the priority that is based on the static
  * priority but is modified by bonuses/penalties.
@@ -386,7 +317,16 @@ static int effective_prio(task_t *p)
 static inline void __activate_task(task_t *p, runqueue_t *rq)
 {
 	enqueue_task(p, rq->active);
-	nr_running_inc(rq);
+	rq->nr_running++;
+}
+
+/*
+ * __activate_idle_task - move idle task to the _front_ of runqueue.
+ */
+static inline void __activate_idle_task(task_t *p, runqueue_t *rq)
+{
+	enqueue_task_head(p, rq->active);
+	rq->nr_running++;
 }
 
 static void recalc_task_prio(task_t *p, unsigned long long now)
@@ -469,9 +409,19 @@ static void recalc_task_prio(task_t *p, unsigned long long now)
  * Update all the scheduling statistics stuff. (sleep average
  * calculation, priority modifiers, etc.)
  */
-static inline void activate_task(task_t *p, runqueue_t *rq)
+static void activate_task(task_t *p, runqueue_t *rq, int local)
 {
-	unsigned long long now = sched_clock();
+	unsigned long long now;
+
+	now = sched_clock();
+#ifdef CONFIG_SMP
+	if (!local) {
+		/* Compensate for drifting sched_clock */
+		runqueue_t *this_rq = this_rq();
+		now = (now - this_rq->timestamp_last_tick)
+			+ rq->timestamp_last_tick;
+	}
+#endif
 
 	recalc_task_prio(p, now);
 
@@ -505,9 +455,9 @@ static inline void activate_task(task_t *p, runqueue_t *rq)
 /*
  * deactivate_task - remove a task from the runqueue.
  */
-static inline void deactivate_task(struct task_struct *p, runqueue_t *rq)
+static void deactivate_task(struct task_struct *p, runqueue_t *rq)
 {
-	nr_running_dec(rq);
+	rq->nr_running--;
 	if (p->state == TASK_UNINTERRUPTIBLE)
 		rq->nr_uninterruptible++;
 	dequeue_task(p, p->array);
@@ -521,9 +471,9 @@ static inline void deactivate_task(struct task_struct *p, runqueue_t *rq)
  * might also involve a cross-CPU call to trigger the scheduler on
  * the target CPU.
  */
-static inline void resched_task(task_t *p)
-{
 #ifdef CONFIG_SMP
+static void resched_task(task_t *p)
+{
 	int need_resched, nrpolling;
 
 	preempt_disable();
@@ -535,10 +485,13 @@ static inline void resched_task(task_t *p)
 	if (!need_resched && !nrpolling && (task_cpu(p) != smp_processor_id()))
 		smp_send_reschedule(task_cpu(p));
 	preempt_enable();
+}
 #else
+static inline void resched_task(task_t *p)
+{
 	set_tsk_need_resched(p);
-#endif
 }
+#endif
 
 /**
  * task_curr - is this task currently executing on a CPU?
@@ -550,40 +503,46 @@ inline int task_curr(task_t *p)
 }
 
 #ifdef CONFIG_SMP
+enum request_type {
+	REQ_MOVE_TASK,
+	REQ_SET_DOMAIN,
+};
+
 typedef struct {
 	struct list_head list;
+	enum request_type type;
+
+	/* For REQ_MOVE_TASK */
 	task_t *task;
+	int dest_cpu;
+
+	/* For REQ_SET_DOMAIN */
+	struct sched_domain *sd;
+
 	struct completion done;
 } migration_req_t;
 
 /*
- * The task's runqueue lock must be held, and the new mask must be valid.
+ * The task's runqueue lock must be held.
  * Returns true if you have to wait for migration thread.
  */
-static int __set_cpus_allowed(task_t *p, cpumask_t new_mask,
-				migration_req_t *req)
+static int migrate_task(task_t *p, int dest_cpu, migration_req_t *req)
 {
 	runqueue_t *rq = task_rq(p);
 
-	p->cpus_allowed = new_mask;
-	/*
-	 * Can the task run on the task's current CPU? If not then
-	 * migrate the thread off to a proper CPU.
-	 */
-	if (cpu_isset(task_cpu(p), new_mask))
-		return 0;
-
 	/*
 	 * If the task is not on a runqueue (and not running), then
 	 * it is sufficient to simply update the task's cpu field.
 	 */
 	if (!p->array && !task_running(rq, p)) {
-		set_task_cpu(p, any_online_cpu(p->cpus_allowed));
+		set_task_cpu(p, dest_cpu);
 		return 0;
 	}
 
 	init_completion(&req->done);
+	req->type = REQ_MOVE_TASK;
 	req->task = p;
+	req->dest_cpu = dest_cpu;
 	list_add(&req->list, &rq->migration_queue);
 	return 1;
 }
@@ -638,6 +597,71 @@ void kick_process(task_t *p)
 
 EXPORT_SYMBOL_GPL(kick_process);
 
+/*
+ * Return a low guess at the load of a migration-source cpu.
+ *
+ * We want to under-estimate the load of migration sources, to
+ * balance conservatively.
+ */
+static inline unsigned long source_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE;
+
+	return min(rq->cpu_load, load_now);
+}
+
+/*
+ * Return a high guess at the load of a migration-target cpu
+ */
+static inline unsigned long target_load(int cpu)
+{
+	runqueue_t *rq = cpu_rq(cpu);
+	unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE;
+
+	return max(rq->cpu_load, load_now);
+}
+
+#endif
+
+/*
+ * wake_idle() is useful especially on SMT architectures to wake a
+ * task onto an idle sibling if we would otherwise wake it onto a
+ * busy sibling.
+ *
+ * Returns the CPU we should wake onto.
+ */
+#if defined(ARCH_HAS_SCHED_WAKE_IDLE)
+static int wake_idle(int cpu, task_t *p)
+{
+	cpumask_t tmp;
+	runqueue_t *rq = cpu_rq(cpu);
+	struct sched_domain *sd;
+	int i;
+
+	if (idle_cpu(cpu))
+		return cpu;
+
+	sd = rq->sd;
+	if (!(sd->flags & SD_WAKE_IDLE))
+		return cpu;
+
+	cpus_and(tmp, sd->span, cpu_online_map);
+	for_each_cpu_mask(i, tmp) {
+		if (!cpu_isset(i, p->cpus_allowed))
+			continue;
+
+		if (idle_cpu(i))
+			return i;
+	}
+
+	return cpu;
+}
+#else
+static inline int wake_idle(int cpu, task_t *p)
+{
+	return cpu;
+}
 #endif
 
 /***
@@ -656,52 +680,129 @@ EXPORT_SYMBOL_GPL(kick_process);
  */
 static int try_to_wake_up(task_t * p, unsigned int state, int sync)
 {
+	int cpu, this_cpu, success = 0;
 	unsigned long flags;
-	int success = 0;
 	long old_state;
 	runqueue_t *rq;
+#ifdef CONFIG_SMP
+	unsigned long load, this_load;
+	struct sched_domain *sd;
+	int new_cpu;
+#endif
 
-repeat_lock_task:
 	rq = task_rq_lock(p, &flags);
 	old_state = p->state;
-	if (old_state & state) {
-		if (!p->array) {
+	if (!(old_state & state))
+		goto out;
+
+	if (p->array)
+		goto out_running;
+
+	cpu = task_cpu(p);
+	this_cpu = smp_processor_id();
+
+#ifdef CONFIG_SMP
+	if (unlikely(task_running(rq, p)))
+		goto out_activate;
+
+	new_cpu = cpu;
+
+	if (cpu == this_cpu || unlikely(!cpu_isset(this_cpu, p->cpus_allowed)))
+		goto out_set_cpu;
+
+	load = source_load(cpu);
+	this_load = target_load(this_cpu);
+
+	/*
+	 * If sync wakeup then subtract the (maximum possible) effect of
+	 * the currently running task from the load of the current CPU:
+	 */
+	if (sync)
+		this_load -= SCHED_LOAD_SCALE;
+
+	/* Don't pull the task off an idle CPU to a busy one */
+	if (load < SCHED_LOAD_SCALE/2 && this_load > SCHED_LOAD_SCALE/2)
+		goto out_set_cpu;
+
+	new_cpu = this_cpu; /* Wake to this CPU if we can */
+
+	/*
+	 * Scan domains for affine wakeup and passive balancing
+	 * possibilities.
+	 */
+	for_each_domain(this_cpu, sd) {
+		unsigned int imbalance;
+		/*
+		 * Start passive balancing when half the imbalance_pct
+		 * limit is reached.
+		 */
+		imbalance = sd->imbalance_pct + (sd->imbalance_pct - 100) / 2;
+
+		if ( ((sd->flags & SD_WAKE_AFFINE) &&
+				!task_hot(p, rq->timestamp_last_tick, sd))
+			|| ((sd->flags & SD_WAKE_BALANCE) &&
+				imbalance*this_load <= 100*load) ) {
 			/*
-			 * Fast-migrate the task if it's not running or runnable
-			 * currently. Do not violate hard affinity.
+			 * Now sd has SD_WAKE_AFFINE and p is cache cold in sd
+			 * or sd has SD_WAKE_BALANCE and there is an imbalance
 			 */
-			if (unlikely(sync && !task_running(rq, p) &&
-				(task_cpu(p) != smp_processor_id()) &&
-					cpu_isset(smp_processor_id(),
-							p->cpus_allowed) &&
-					!cpu_is_offline(smp_processor_id()))) {
-				set_task_cpu(p, smp_processor_id());
-				task_rq_unlock(rq, &flags);
-				goto repeat_lock_task;
-			}
-			if (old_state == TASK_UNINTERRUPTIBLE) {
-				rq->nr_uninterruptible--;
-				/*
-				 * Tasks on involuntary sleep don't earn
-				 * sleep_avg beyond just interactive state.
-				 */
-				p->activated = -1;
-			}
-			if (sync && (task_cpu(p) == smp_processor_id()))
-				__activate_task(p, rq);
-			else {
-				activate_task(p, rq);
-				if (TASK_PREEMPTS_CURR(p, rq))
-					resched_task(rq->curr);
-			}
-			success = 1;
+			if (cpu_isset(cpu, sd->span))
+				goto out_set_cpu;
 		}
-		p->state = TASK_RUNNING;
 	}
+
+	new_cpu = cpu; /* Could not wake to this_cpu. Wake to cpu instead */
+out_set_cpu:
+	new_cpu = wake_idle(new_cpu, p);
+	if (new_cpu != cpu && cpu_isset(new_cpu, p->cpus_allowed)) {
+		set_task_cpu(p, new_cpu);
+		task_rq_unlock(rq, &flags);
+		/* might preempt at this point */
+		rq = task_rq_lock(p, &flags);
+		old_state = p->state;
+		if (!(old_state & state))
+			goto out;
+		if (p->array)
+			goto out_running;
+
+		this_cpu = smp_processor_id();
+		cpu = task_cpu(p);
+	}
+
+out_activate:
+#endif /* CONFIG_SMP */
+	if (old_state == TASK_UNINTERRUPTIBLE) {
+		rq->nr_uninterruptible--;
+		/*
+		 * Tasks on involuntary sleep don't earn
+		 * sleep_avg beyond just interactive state.
+		 */
+		p->activated = -1;
+	}
+
+	/*
+	 * Sync wakeups (i.e. those types of wakeups where the waker
+	 * has indicated that it will leave the CPU in short order)
+	 * don't trigger a preemption, if the woken up task will run on
+	 * this cpu. (in this case the 'I will reschedule' promise of
+	 * the waker guarantees that the freshly woken up task is going
+	 * to be considered on this CPU.)
+	 */
+	activate_task(p, rq, cpu == this_cpu);
+	if (!sync || cpu != this_cpu) {
+		if (TASK_PREEMPTS_CURR(p, rq))
+			resched_task(rq->curr);
+	}
+	success = 1;
+
+out_running:
+	p->state = TASK_RUNNING;
+out:
 	task_rq_unlock(rq, &flags);
 
 	return success;
 }
+
 int fastcall wake_up_process(task_t * p)
 {
 	return try_to_wake_up(p, TASK_STOPPED |
@@ -756,8 +857,8 @@ void fastcall sched_fork(task_t *p)
 	p->timestamp = sched_clock();
 	if (!current->time_slice) {
 		/*
-	 	 * This case is rare, it happens when the parent has only
-	 	 * a single jiffy left from its timeslice. Taking the
+		 * This case is rare, it happens when the parent has only
+		 * a single jiffy left from its timeslice. Taking the
 		 * runqueue lock is not a problem.
 		 */
 		current->time_slice = 1;
@@ -805,7 +906,7 @@ void fastcall wake_up_forked_process(task_t * p)
 		list_add_tail(&p->run_list, &current->run_list);
 		p->array = current->array;
 		p->array->nr_active++;
-		nr_running_inc(rq);
+		rq->nr_running++;
 	}
 	task_rq_unlock(rq, &flags);
 }
@@ -856,7 +957,7 @@ void fastcall sched_exit(task_t * p)
  * with the lock held can cause deadlocks; see schedule() for
  * details.)
  */
-static inline void finish_task_switch(task_t *prev)
+static void finish_task_switch(task_t *prev)
 {
 	runqueue_t *rq = this_rq();
 	struct mm_struct *mm = rq->prev_mm;
@@ -873,7 +974,7 @@ static inline void finish_task_switch(task_t *prev)
 	 * still held, otherwise prev could be scheduled on another cpu, die
 	 * there before we look at prev->state, and then the reference would
 	 * be dropped twice.
-	 * 		Manfred Spraul <manfred@colorfullife.com>
+	 *		Manfred Spraul <manfred@colorfullife.com>
 	 */
 	prev_task_flags = prev->flags;
 	finish_arch_switch(rq, prev);
@@ -935,7 +1036,7 @@ unsigned long nr_running(void)
 {
 	unsigned long i, sum = 0;
 
-	for (i = 0; i < NR_CPUS; i++)
+	for_each_cpu(i)
 		sum += cpu_rq(i)->nr_running;
 
 	return sum;
@@ -945,7 +1046,7 @@ unsigned long nr_uninterruptible(void)
 {
 	unsigned long i, sum = 0;
 
-	for_each_cpu(i)
+	for_each_online_cpu(i)
 		sum += cpu_rq(i)->nr_uninterruptible;
 
 	return sum;
@@ -955,7 +1056,7 @@ unsigned long long nr_context_switches(void)
 {
 	unsigned long long i, sum = 0;
 
-	for_each_cpu(i)
+	for_each_online_cpu(i)
 		sum += cpu_rq(i)->nr_switches;
 
 	return sum;
@@ -965,7 +1066,7 @@ unsigned long nr_iowait(void)
 {
 	unsigned long i, sum = 0;
 
-	for_each_cpu(i)
+	for_each_online_cpu(i)
 		sum += atomic_read(&cpu_rq(i)->nr_iowait);
 
 	return sum;
@@ -977,7 +1078,7 @@ unsigned long nr_iowait(void)
  * Note this does not disable interrupts like task_rq_lock,
  * you need to do so manually before calling.
  */
-static inline void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
+static void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
 {
 	if (rq1 == rq2)
 		spin_lock(&rq1->lock);
@@ -998,14 +1099,151 @@ static inline void double_rq_lock(runqueue_t *rq1, runqueue_t *rq2)
  * Note this does not restore interrupts like task_rq_unlock,
  * you need to do so manually after calling.
  */
-static inline void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
+static void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
 {
 	spin_unlock(&rq1->lock);
 	if (rq1 != rq2)
 		spin_unlock(&rq2->lock);
 }
 
-#ifdef CONFIG_NUMA
+enum idle_type
+{
+	IDLE,
+	NOT_IDLE,
+	NEWLY_IDLE,
+};
+
+#ifdef CONFIG_SMP
+
+/*
+ * find_idlest_cpu - find the least busy runqueue.
+ */
+static int find_idlest_cpu(struct task_struct *p, int this_cpu,
+			   struct sched_domain *sd)
+{
+	unsigned long load, min_load, this_load;
+	int i, min_cpu;
+	cpumask_t mask;
+
+	min_cpu = UINT_MAX;
+	min_load = ULONG_MAX;
+
+	cpus_and(mask, sd->span, cpu_online_map);
+	cpus_and(mask, mask, p->cpus_allowed);
+
+	for_each_cpu_mask(i, mask) {
+		load = target_load(i);
+
+		if (load < min_load) {
+			min_cpu = i;
+			min_load = load;
+
+			/* break out early on an idle CPU: */
+			if (!min_load)
+				break;
+		}
+	}
+
+	/* add +1 to account for the new task */
+	this_load = source_load(this_cpu) + SCHED_LOAD_SCALE;
+
+	/*
+	 * Would with the addition of the new task to the
+	 * current CPU there be an imbalance between this
+	 * CPU and the idlest CPU?
+	 *
+	 * Use half of the balancing threshold - new-context is
+	 * a good opportunity to balance.
+	 */
+	if (min_load*(100 + (sd->imbalance_pct-100)/2) < this_load*100)
+		return min_cpu;
+
+	return this_cpu;
+}
+
+/*
+ * wake_up_forked_thread - wake up a freshly forked thread.
+ *
+ * This function will do some initial scheduler statistics housekeeping
+ * that must be done for every newly created context, and it also does
+ * runqueue balancing.
+ */
+void fastcall wake_up_forked_thread(task_t * p)
+{
+	unsigned long flags;
+	int this_cpu = get_cpu(), cpu;
+	struct sched_domain *tmp, *sd = NULL;
+	runqueue_t *this_rq = cpu_rq(this_cpu), *rq;
+
+	/*
+	 * Find the largest domain that this CPU is part of that
+	 * is willing to balance on clone:
+	 */
+	for_each_domain(this_cpu, tmp)
+		if (tmp->flags & SD_BALANCE_CLONE)
+			sd = tmp;
+	if (sd)
+		cpu = find_idlest_cpu(p, this_cpu, sd);
+	else
+		cpu = this_cpu;
+
+	local_irq_save(flags);
+lock_again:
+	rq = cpu_rq(cpu);
+	double_rq_lock(this_rq, rq);
+
+	BUG_ON(p->state != TASK_RUNNING);
+
+	/*
+	 * We did find_idlest_cpu() unlocked, so in theory
+	 * the mask could have changed - just dont migrate
+	 * in this case:
+	 */
+	if (unlikely(!cpu_isset(cpu, p->cpus_allowed))) {
+		cpu = this_cpu;
+		double_rq_unlock(this_rq, rq);
+		goto lock_again;
+	}
+	/*
+	 * We decrease the sleep average of forking parents
+	 * and children as well, to keep max-interactive tasks
+	 * from forking tasks that are max-interactive.
+	 */
+	current->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(current) *
+		PARENT_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
+
+	p->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(p) *
+		CHILD_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
+
+	p->interactive_credit = 0;
+
+	p->prio = effective_prio(p);
+	set_task_cpu(p, cpu);
+
+	if (cpu == this_cpu) {
+		if (unlikely(!current->array))
+			__activate_task(p, rq);
+		else {
+			p->prio = current->prio;
+			list_add_tail(&p->run_list, &current->run_list);
+			p->array = current->array;
+			p->array->nr_active++;
+			rq->nr_running++;
+		}
+	} else {
+		/* Not the local CPU - must adjust timestamp */
+		p->timestamp = (p->timestamp - this_rq->timestamp_last_tick)
+					+ rq->timestamp_last_tick;
+		__activate_task(p, rq);
+		if (TASK_PREEMPTS_CURR(p, rq))
+			resched_task(rq->curr);
+	}
+
+	double_rq_unlock(this_rq, rq);
+	local_irq_restore(flags);
+	put_cpu();
+}
+
 /*
  * If dest_cpu is allowed for this process, migrate the task to it.
  * This is accomplished by forcing the cpu_allowed mask to only
@@ -1014,236 +1252,75 @@ static inline void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
  */
 static void sched_migrate_task(task_t *p, int dest_cpu)
 {
-	runqueue_t *rq;
 	migration_req_t req;
+	runqueue_t *rq;
 	unsigned long flags;
-	cpumask_t old_mask, new_mask = cpumask_of_cpu(dest_cpu);
 
-	lock_cpu_hotplug();
 	rq = task_rq_lock(p, &flags);
-	old_mask = p->cpus_allowed;
-	if (!cpu_isset(dest_cpu, old_mask) || !cpu_online(dest_cpu))
+	if (!cpu_isset(dest_cpu, p->cpus_allowed)
+	    || unlikely(cpu_is_offline(dest_cpu)))
 		goto out;
 
 	/* force the process onto the specified CPU */
-	if (__set_cpus_allowed(p, new_mask, &req)) {
-		/* Need to wait for migration thread. */
+	if (migrate_task(p, dest_cpu, &req)) {
+		/* Need to wait for migration thread (might exit: take ref). */
+		struct task_struct *mt = rq->migration_thread;
+		get_task_struct(mt);
 		task_rq_unlock(rq, &flags);
-		wake_up_process(rq->migration_thread);
+		wake_up_process(mt);
+		put_task_struct(mt);
 		wait_for_completion(&req.done);
-
-		/* If we raced with sys_sched_setaffinity, don't
-		 * restore mask. */
-		rq = task_rq_lock(p, &flags);
-		if (likely(cpus_equal(p->cpus_allowed, new_mask))) {
-			/* Restore old mask: won't need migration
-			 * thread, since current cpu is allowed. */
-			BUG_ON(__set_cpus_allowed(p, old_mask, NULL));
-		}
+		return;
 	}
 out:
 	task_rq_unlock(rq, &flags);
-	unlock_cpu_hotplug();
 }
 
 /*
- * Find the least loaded CPU.  Slightly favor the current CPU by
- * setting its runqueue length as the minimum to start.
+ * sched_balance_exec(): find the highest-level, exec-balance-capable
+ * domain and try to migrate the task to the least loaded CPU.
+ *
+ * execve() is a valuable balancing opportunity, because at this point
+ * the task has the smallest effective memory and cache footprint.
  */
-static int sched_best_cpu(struct task_struct *p)
+void sched_balance_exec(void)
 {
-	int i, minload, load, best_cpu, node = 0;
-	cpumask_t cpumask;
+	struct sched_domain *tmp, *sd = NULL;
+	int new_cpu, this_cpu = get_cpu();
 
-	best_cpu = task_cpu(p);
-	if (cpu_rq(best_cpu)->nr_running <= 2)
-		return best_cpu;
-
-	minload = 10000000;
-	for_each_node_with_cpus(i) {
-		/*
-		 * Node load is always divided by nr_cpus_node to normalise
-		 * load values in case cpu count differs from node to node.
-		 * We first multiply node_nr_running by 10 to get a little
-		 * better resolution.
-		 */
-		load = 10 * atomic_read(&node_nr_running[i]) / nr_cpus_node(i);
-		if (load < minload) {
-			minload = load;
-			node = i;
-		}
-	}
-
-	minload = 10000000;
-	cpumask = node_to_cpumask(node);
-	for (i = 0; i < NR_CPUS; ++i) {
-		if (!cpu_isset(i, cpumask))
-			continue;
-		if (cpu_rq(i)->nr_running < minload) {
-			best_cpu = i;
-			minload = cpu_rq(i)->nr_running;
-		}
-	}
-	return best_cpu;
-}
+	/* Prefer the current CPU if there's only this task running */
+	if (this_rq()->nr_running <= 1)
+		goto out;
 
-void sched_balance_exec(void)
-{
-	int new_cpu;
+	for_each_domain(this_cpu, tmp)
+		if (tmp->flags & SD_BALANCE_EXEC)
+			sd = tmp;
 
-	if (numnodes > 1) {
-		new_cpu = sched_best_cpu(current);
-		if (new_cpu != smp_processor_id())
+	if (sd) {
+		new_cpu = find_idlest_cpu(current, this_cpu, sd);
+		if (new_cpu != this_cpu) {
+			put_cpu();
 			sched_migrate_task(current, new_cpu);
-	}
-}
-
-/*
- * Find the busiest node. All previous node loads contribute with a
- * geometrically deccaying weight to the load measure:
- *      load_{t} = load_{t-1}/2 + nr_node_running_{t}
- * This way sudden load peaks are flattened out a bit.
- * Node load is divided by nr_cpus_node() in order to compare nodes
- * of different cpu count but also [first] multiplied by 10 to
- * provide better resolution.
- */
-static int find_busiest_node(int this_node)
-{
-	int i, node = -1, load, this_load, maxload;
-
-	if (!nr_cpus_node(this_node))
-		return node;
-	this_load = maxload = (this_rq()->prev_node_load[this_node] >> 1)
-		+ (10 * atomic_read(&node_nr_running[this_node])
-		/ nr_cpus_node(this_node));
-	this_rq()->prev_node_load[this_node] = this_load;
-	for_each_node_with_cpus(i) {
-		if (i == this_node)
-			continue;
-		load = (this_rq()->prev_node_load[i] >> 1)
-			+ (10 * atomic_read(&node_nr_running[i])
-			/ nr_cpus_node(i));
-		this_rq()->prev_node_load[i] = load;
-		if (load > maxload && (100*load > NODE_THRESHOLD*this_load)) {
-			maxload = load;
-			node = i;
+			return;
 		}
 	}
-	return node;
+out:
+	put_cpu();
 }
 
-#endif /* CONFIG_NUMA */
-
-#ifdef CONFIG_SMP
-
 /*
- * double_lock_balance - lock the busiest runqueue
- *
- * this_rq is locked already. Recalculate nr_running if we have to
- * drop the runqueue lock.
+ * double_lock_balance - lock the busiest runqueue, this_rq is locked already.
  */
-static inline
-unsigned int double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest,
-				 int this_cpu, int idle,
-				 unsigned int nr_running)
+static void double_lock_balance(runqueue_t *this_rq, runqueue_t *busiest)
 {
 	if (unlikely(!spin_trylock(&busiest->lock))) {
 		if (busiest < this_rq) {
 			spin_unlock(&this_rq->lock);
 			spin_lock(&busiest->lock);
 			spin_lock(&this_rq->lock);
-			/* Need to recalculate nr_running */
-			if (idle || (this_rq->nr_running >
-					this_rq->prev_cpu_load[this_cpu]))
-				nr_running = this_rq->nr_running;
-			else
-				nr_running = this_rq->prev_cpu_load[this_cpu];
 		} else
 			spin_lock(&busiest->lock);
 	}
-	return nr_running;
-}
-
-/*
- * find_busiest_queue - find the busiest runqueue among the cpus in cpumask.
- */
-static inline
-runqueue_t *find_busiest_queue(runqueue_t *this_rq, int this_cpu, int idle,
-			       int *imbalance, cpumask_t cpumask)
-{
-	int nr_running, load, max_load, i;
-	runqueue_t *busiest, *rq_src;
-
-	/*
-	 * We search all runqueues to find the most busy one.
-	 * We do this lockless to reduce cache-bouncing overhead,
-	 * we re-check the 'best' source CPU later on again, with
-	 * the lock held.
-	 *
-	 * We fend off statistical fluctuations in runqueue lengths by
-	 * saving the runqueue length (as seen by the balancing CPU) during
-	 * the previous load-balancing operation and using the smaller one
-	 * of the current and saved lengths. If a runqueue is long enough
-	 * for a longer amount of time then we recognize it and pull tasks
-	 * from it.
-	 *
-	 * The 'current runqueue length' is a statistical maximum variable,
-	 * for that one we take the longer one - to avoid fluctuations in
-	 * the other direction. So for a load-balance to happen it needs
-	 * stable long runqueue on the target CPU and stable short runqueue
-	 * on the local runqueue.
-	 *
-	 * We make an exception if this CPU is about to become idle - in
-	 * that case we are less picky about moving a task across CPUs and
-	 * take what can be taken.
-	 */
-	if (idle || (this_rq->nr_running > this_rq->prev_cpu_load[this_cpu]))
-		nr_running = this_rq->nr_running;
-	else
-		nr_running = this_rq->prev_cpu_load[this_cpu];
-
-	busiest = NULL;
-	max_load = 1;
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_isset(i, cpumask))
-			continue;
-
-		rq_src = cpu_rq(i);
-		if (idle || (rq_src->nr_running < this_rq->prev_cpu_load[i]))
-			load = rq_src->nr_running;
-		else
-			load = this_rq->prev_cpu_load[i];
-		this_rq->prev_cpu_load[i] = rq_src->nr_running;
-
-		if ((load > max_load) && (rq_src != this_rq)) {
-			busiest = rq_src;
-			max_load = load;
-		}
-	}
-
-	if (likely(!busiest))
-		goto out;
-
-	*imbalance = max_load - nr_running;
-
-	/* It needs an at least ~25% imbalance to trigger balancing. */
-	if (!idle && ((*imbalance)*4 < max_load)) {
-		busiest = NULL;
-		goto out;
-	}
-
-	nr_running = double_lock_balance(this_rq, busiest, this_cpu,
-					 idle, nr_running);
-	/*
-	 * Make sure nothing changed since we checked the
-	 * runqueue length.
-	 */
-	if (busiest->nr_running <= nr_running) {
-		spin_unlock(&busiest->lock);
-		busiest = NULL;
-	}
-out:
-	return busiest;
 }
 
 /*
@@ -1252,86 +1329,83 @@ out:
  */
 static inline
 void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p,
-	       runqueue_t *this_rq, int this_cpu)
+	       runqueue_t *this_rq, prio_array_t *this_array, int this_cpu)
 {
 	dequeue_task(p, src_array);
-	nr_running_dec(src_rq);
+	src_rq->nr_running--;
 	set_task_cpu(p, this_cpu);
-	nr_running_inc(this_rq);
-	enqueue_task(p, this_rq->active);
-	p->timestamp = sched_clock() -
-				(src_rq->timestamp_last_tick - p->timestamp);
+	this_rq->nr_running++;
+	enqueue_task(p, this_array);
+	p->timestamp = (p->timestamp - src_rq->timestamp_last_tick)
+				+ this_rq->timestamp_last_tick;
 	/*
 	 * Note that idle threads have a prio of MAX_PRIO, for this test
 	 * to be always true for them.
 	 */
 	if (TASK_PREEMPTS_CURR(p, this_rq))
-		set_need_resched();
+		resched_task(this_rq->curr);
 }
 
 /*
  * can_migrate_task - may task p from runqueue rq be migrated to this_cpu?
  */
 static inline
-int can_migrate_task(task_t *tsk, runqueue_t *rq, int this_cpu, int idle)
+int can_migrate_task(task_t *p, runqueue_t *rq, int this_cpu,
+		     struct sched_domain *sd, enum idle_type idle)
 {
-	unsigned long delta = rq->timestamp_last_tick - tsk->timestamp;
-
 	/*
 	 * We do not migrate tasks that are:
 	 * 1) running (obviously), or
 	 * 2) cannot be migrated to this CPU due to cpus_allowed, or
 	 * 3) are cache-hot on their current CPU.
 	 */
-	if (task_running(rq, tsk))
-		return 0;
-	if (!cpu_isset(this_cpu, tsk->cpus_allowed))
+	if (task_running(rq, p))
 		return 0;
-	if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
+	if (!cpu_isset(this_cpu, p->cpus_allowed))
 		return 0;
+
+	/* Aggressive migration if we've failed balancing */
+	if (idle == NEWLY_IDLE ||
+			sd->nr_balance_failed < sd->cache_nice_tries) {
+		if (task_hot(p, rq->timestamp_last_tick, sd))
+			return 0;
+	}
+
 	return 1;
 }
 
 /*
- * Current runqueue is empty, or rebalance tick: if there is an
- * inbalance (current runqueue is too short) then pull from
- * busiest runqueue(s).
+ * move_tasks tries to move up to max_nr_move tasks from busiest to this_rq,
+ * as part of a balancing operation within "domain". Returns the number of
+ * tasks moved.
  *
- * We call this with the current runqueue locked,
- * irqs disabled.
+ * Called with both runqueues locked.
  */
-static void load_balance(runqueue_t *this_rq, int idle, cpumask_t cpumask)
+static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest,
+		      unsigned long max_nr_move, struct sched_domain *sd,
+		      enum idle_type idle)
 {
-	int imbalance, idx, this_cpu = smp_processor_id();
-	runqueue_t *busiest;
-	prio_array_t *array;
+	prio_array_t *array, *dst_array;
 	struct list_head *head, *curr;
+	int idx, pulled = 0;
 	task_t *tmp;
 
-	if (cpu_is_offline(this_cpu))
-		goto out;
-
-	busiest = find_busiest_queue(this_rq, this_cpu, idle,
-				     &imbalance, cpumask);
-	if (!busiest)
+	if (max_nr_move <= 0 || busiest->nr_running <= 1)
 		goto out;
 
-	/*
-	 * We only want to steal a number of tasks equal to 1/2 the imbalance,
-	 * otherwise we'll just shift the imbalance to the new queue:
-	 */
-	imbalance /= 2;
-
 	/*
 	 * We first consider expired tasks. Those will likely not be
 	 * executed in the near future, and they are most likely to
 	 * be cache-cold, thus switching CPUs has the least effect
 	 * on them.
 	 */
-	if (busiest->expired->nr_active)
+	if (busiest->expired->nr_active) {
 		array = busiest->expired;
-	else
+		dst_array = this_rq->expired;
+	} else {
 		array = busiest->active;
+		dst_array = this_rq->active;
+	}
 
 new_array:
 	/* Start searching at priority 0: */
@@ -1342,118 +1416,501 @@ skip_bitmap:
 	else
 		idx = find_next_bit(array->bitmap, MAX_PRIO, idx);
 	if (idx >= MAX_PRIO) {
-		if (array == busiest->expired) {
+		if (array == busiest->expired && busiest->active->nr_active) {
 			array = busiest->active;
+			dst_array = this_rq->active;
 			goto new_array;
 		}
-		goto out_unlock;
+		goto out;
+	}
+
+	head = array->queue + idx;
+	curr = head->prev;
+skip_queue:
+	tmp = list_entry(curr, task_t, run_list);
+
+	curr = curr->prev;
+
+	if (!can_migrate_task(tmp, busiest, this_cpu, sd, idle)) {
+		if (curr != head)
+			goto skip_queue;
+		idx++;
+		goto skip_bitmap;
+	}
+	pull_task(busiest, array, tmp, this_rq, dst_array, this_cpu);
+	pulled++;
+
+	/* We only want to steal up to the prescribed number of tasks. */
+	if (pulled < max_nr_move) {
+		if (curr != head)
+			goto skip_queue;
+		idx++;
+		goto skip_bitmap;
+	}
+out:
+	return pulled;
+}
+
+/*
+ * find_busiest_group finds and returns the busiest CPU group within the
+ * domain. It calculates and returns the number of tasks which should be
+ * moved to restore balance via the imbalance parameter.
+ */
+static struct sched_group *
+find_busiest_group(struct sched_domain *sd, int this_cpu,
+		   unsigned long *imbalance, enum idle_type idle)
+{
+	struct sched_group *busiest = NULL, *this = NULL, *group = sd->groups;
+	unsigned long max_load, avg_load, total_load, this_load, total_pwr;
+
+	max_load = this_load = total_load = total_pwr = 0;
+
+	do {
+		cpumask_t tmp;
+		unsigned long load;
+		int local_group;
+		int i, nr_cpus = 0;
+
+		local_group = cpu_isset(this_cpu, group->cpumask);
+
+		/* Tally up the load of all CPUs in the group */
+		avg_load = 0;
+		cpus_and(tmp, group->cpumask, cpu_online_map);
+		if (unlikely(cpus_empty(tmp)))
+			goto nextgroup;
+
+		for_each_cpu_mask(i, tmp) {
+			/* Bias balancing toward cpus of our domain */
+			if (local_group)
+				load = target_load(i);
+			else
+				load = source_load(i);
+
+			nr_cpus++;
+			avg_load += load;
+		}
+
+		if (!nr_cpus)
+			goto nextgroup;
+
+		total_load += avg_load;
+		total_pwr += group->cpu_power;
+
+		/* Adjust by relative CPU power of the group */
+		avg_load = (avg_load * SCHED_LOAD_SCALE) / group->cpu_power;
+
+		if (local_group) {
+			this_load = avg_load;
+			this = group;
+			goto nextgroup;
+		} else if (avg_load > max_load) {
+			max_load = avg_load;
+			busiest = group;
+		}
+nextgroup:
+		group = group->next;
+	} while (group != sd->groups);
+
+	if (!busiest || this_load >= max_load)
+		goto out_balanced;
+
+	avg_load = (SCHED_LOAD_SCALE * total_load) / total_pwr;
+
+	if (this_load >= avg_load ||
+			100*max_load <= sd->imbalance_pct*this_load)
+		goto out_balanced;
+
+ 	/*
+	 * If crash dump is in progress, this other cpu's
+	 * need to wait until it completes.
+	 * NB: this code is optimized away for kernels without
+	 * dumping enabled.
+	 */
+	if (unlikely(dump_oncpu))
+		goto dump_scheduling_disabled;
+
+	/*
+	 * We're trying to get all the cpus to the average_load, so we don't
+	 * want to push ourselves above the average load, nor do we wish to
+	 * reduce the max loaded cpu below the average load, as either of these
+	 * actions would just result in more rebalancing later, and ping-pong
+	 * tasks around. Thus we look for the minimum possible imbalance.
+	 * Negative imbalances (*we* are more loaded than anyone else) will
+	 * be counted as no imbalance for these purposes -- we can't fix that
+	 * by pulling tasks to us.  Be careful of negative numbers as they'll
+	 * appear as very large values with unsigned longs.
+	 */
+	*imbalance = min(max_load - avg_load, avg_load - this_load);
+
+	/* How much load to actually move to equalise the imbalance */
+	*imbalance = (*imbalance * min(busiest->cpu_power, this->cpu_power))
+				/ SCHED_LOAD_SCALE;
+
+	if (*imbalance < SCHED_LOAD_SCALE - 1) {
+		unsigned long pwr_now = 0, pwr_move = 0;
+		unsigned long tmp;
+
+		if (max_load - this_load >= SCHED_LOAD_SCALE*2) {
+			*imbalance = 1;
+			return busiest;
+		}
+
+		/*
+		 * OK, we don't have enough imbalance to justify moving tasks,
+		 * however we may be able to increase total CPU power used by
+		 * moving them.
+		 */
+
+		pwr_now += busiest->cpu_power*min(SCHED_LOAD_SCALE, max_load);
+		pwr_now += this->cpu_power*min(SCHED_LOAD_SCALE, this_load);
+		pwr_now /= SCHED_LOAD_SCALE;
+
+		/* Amount of load we'd subtract */
+		tmp = SCHED_LOAD_SCALE*SCHED_LOAD_SCALE/busiest->cpu_power;
+		if (max_load > tmp)
+			pwr_move += busiest->cpu_power*min(SCHED_LOAD_SCALE,
+							max_load - tmp);
+
+		/* Amount of load we'd add */
+		tmp = SCHED_LOAD_SCALE*SCHED_LOAD_SCALE/this->cpu_power;
+		if (max_load < tmp)
+			tmp = max_load;
+		pwr_move += this->cpu_power*min(SCHED_LOAD_SCALE, this_load + tmp);
+		pwr_move /= SCHED_LOAD_SCALE;
+
+		/* Move if we gain another 8th of a CPU worth of throughput */
+		if (pwr_move < pwr_now + SCHED_LOAD_SCALE / 8)
+			goto out_balanced;
+
+		*imbalance = 1;
+		return busiest;
+	}
+
+	/* Get rid of the scaling factor, rounding down as we divide */
+	*imbalance = (*imbalance + 1) / SCHED_LOAD_SCALE;
+
+	return busiest;
+
+out_balanced:
+	if (busiest && (idle == NEWLY_IDLE ||
+			(idle == IDLE && max_load > SCHED_LOAD_SCALE)) ) {
+		*imbalance = 1;
+		return busiest;
+	}
+
+	*imbalance = 0;
+	return NULL;
+}
+
+/*
+ * find_busiest_queue - find the busiest runqueue among the cpus in group.
+ */
+static runqueue_t *find_busiest_queue(struct sched_group *group)
+{
+	cpumask_t tmp;
+	unsigned long load, max_load = 0;
+	runqueue_t *busiest = NULL;
+	int i;
+
+	cpus_and(tmp, group->cpumask, cpu_online_map);
+	for_each_cpu_mask(i, tmp) {
+		load = source_load(i);
+
+		if (load > max_load) {
+			max_load = load;
+			busiest = cpu_rq(i);
+		}
+	}
+
+	return busiest;
+}
+
+/*
+ * Check this_cpu to ensure it is balanced within domain. Attempt to move
+ * tasks if there is an imbalance.
+ *
+ * Called with this_rq unlocked.
+ */
+static int load_balance(int this_cpu, runqueue_t *this_rq,
+			struct sched_domain *sd, enum idle_type idle)
+{
+	struct sched_group *group;
+	runqueue_t *busiest;
+	unsigned long imbalance;
+	int nr_moved;
+
+	spin_lock(&this_rq->lock);
+
+	group = find_busiest_group(sd, this_cpu, &imbalance, idle);
+	if (!group)
+		goto out_balanced;
+
+	busiest = find_busiest_queue(group);
+	if (!busiest)
+		goto out_balanced;
+	/*
+	 * This should be "impossible", but since load
+	 * balancing is inherently racy and statistical,
+	 * it could happen in theory.
+	 */
+	if (unlikely(busiest == this_rq)) {
+		WARN_ON(1);
+		goto out_balanced;
+	}
+
+	nr_moved = 0;
+	if (busiest->nr_running > 1) {
+		/*
+		 * Attempt to move tasks. If find_busiest_group has found
+		 * an imbalance but busiest->nr_running <= 1, the group is
+		 * still unbalanced. nr_moved simply stays zero, so it is
+		 * correctly treated as an imbalance.
+		 */
+		double_lock_balance(this_rq, busiest);
+		nr_moved = move_tasks(this_rq, this_cpu, busiest,
+						imbalance, sd, idle);
+		spin_unlock(&busiest->lock);
 	}
+	spin_unlock(&this_rq->lock);
+
+	if (!nr_moved) {
+		sd->nr_balance_failed++;
+
+		if (unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2)) {
+			int wake = 0;
+
+			spin_lock(&busiest->lock);
+			if (!busiest->active_balance) {
+				busiest->active_balance = 1;
+				busiest->push_cpu = this_cpu;
+				wake = 1;
+			}
+			spin_unlock(&busiest->lock);
+			if (wake)
+				wake_up_process(busiest->migration_thread);
+
+			/*
+			 * We've kicked active balancing, reset the failure
+			 * counter.
+			 */
+			sd->nr_balance_failed = sd->cache_nice_tries;
+		}
+	} else
+		sd->nr_balance_failed = 0;
+
+	/* We were unbalanced, so reset the balancing interval */
+	sd->balance_interval = sd->min_interval;
+
+	return nr_moved;
+
+out_balanced:
+	spin_unlock(&this_rq->lock);
+
+	/* tune up the balancing interval */
+	if (sd->balance_interval < sd->max_interval)
+		sd->balance_interval *= 2;
+
+	return 0;
+}
+
+/*
+ * Check this_cpu to ensure it is balanced within domain. Attempt to move
+ * tasks if there is an imbalance.
+ *
+ * Called from schedule when this_rq is about to become idle (NEWLY_IDLE).
+ * this_rq is locked.
+ */
+static int load_balance_newidle(int this_cpu, runqueue_t *this_rq,
+				struct sched_domain *sd)
+{
+	struct sched_group *group;
+	runqueue_t *busiest = NULL;
+	unsigned long imbalance;
+	int nr_moved = 0;
+
+	group = find_busiest_group(sd, this_cpu, &imbalance, NEWLY_IDLE);
+	if (!group)
+		goto out;
+
+	busiest = find_busiest_queue(group);
+	if (!busiest || busiest == this_rq)
+		goto out;
+
+	/* Attempt to move tasks */
+	double_lock_balance(this_rq, busiest);
+
+	nr_moved = move_tasks(this_rq, this_cpu, busiest,
+					imbalance, sd, NEWLY_IDLE);
+
+	spin_unlock(&busiest->lock);
+
+out:
+	return nr_moved;
+}
+
+/*
+ * idle_balance is called by schedule() if this_cpu is about to become
+ * idle. Attempts to pull tasks from other CPUs.
+ */
+static inline void idle_balance(int this_cpu, runqueue_t *this_rq)
+{
+	struct sched_domain *sd;
+
+	for_each_domain(this_cpu, sd) {
+		if (sd->flags & SD_BALANCE_NEWIDLE) {
+			if (load_balance_newidle(this_cpu, this_rq, sd)) {
+				/* We've pulled tasks over so stop searching */
+				break;
+			}
+		}
+	}
+}
+
+/*
+ * active_load_balance is run by migration threads. It pushes a running
+ * task off the cpu. It can be required to correctly have at least 1 task
+ * running on each physical CPU where possible, and not have a physical /
+ * logical imbalance.
+ *
+ * Called with busiest locked.
+ */
+static void active_load_balance(runqueue_t *busiest, int busiest_cpu)
+{
+	struct sched_domain *sd;
+	struct sched_group *group, *busy_group;
+	int i;
+
+	if (busiest->nr_running <= 1)
+		return;
+
+	for_each_domain(busiest_cpu, sd)
+		if (cpu_isset(busiest->push_cpu, sd->span))
+			break;
+	if (!sd) {
+		WARN_ON(1);
+		return;
+	}
+
+ 	group = sd->groups;
+	while (!cpu_isset(busiest_cpu, group->cpumask))
+ 		group = group->next;
+ 	busy_group = group;
+
+ 	group = sd->groups;
+ 	do {
+		cpumask_t tmp;
+		runqueue_t *rq;
+		int push_cpu = 0;
 
-	head = array->queue + idx;
-	curr = head->prev;
-skip_queue:
-	tmp = list_entry(curr, task_t, run_list);
+ 		if (group == busy_group)
+ 			goto next_group;
 
-	curr = curr->prev;
+		cpus_and(tmp, group->cpumask, cpu_online_map);
+		if (!cpus_weight(tmp))
+			goto next_group;
 
-	if (!can_migrate_task(tmp, busiest, this_cpu, idle)) {
-		if (curr != head)
-			goto skip_queue;
-		idx++;
-		goto skip_bitmap;
-	}
-	pull_task(busiest, array, tmp, this_rq, this_cpu);
+ 		for_each_cpu_mask(i, tmp) {
+			if (!idle_cpu(i))
+				goto next_group;
+ 			push_cpu = i;
+ 		}
 
-	/* Only migrate one task if we are idle */
-	if (!idle && --imbalance) {
-		if (curr != head)
-			goto skip_queue;
-		idx++;
-		goto skip_bitmap;
-	}
-out_unlock:
-	spin_unlock(&busiest->lock);
-out:
-	;
+		rq = cpu_rq(push_cpu);
+
+		/*
+		 * This condition is "impossible", but since load
+		 * balancing is inherently a bit racy and statistical,
+		 * it can trigger.. Reported by Bjorn Helgaas on a
+		 * 128-cpu setup.
+		 */
+		if (unlikely(busiest == rq))
+			goto next_group;
+		double_lock_balance(busiest, rq);
+		move_tasks(rq, push_cpu, busiest, 1, sd, IDLE);
+		spin_unlock(&rq->lock);
+next_group:
+		group = group->next;
+	} while (group != sd->groups);
 }
 
 /*
- * One of the idle_cpu_tick() and busy_cpu_tick() functions will
- * get called every timer tick, on every CPU. Our balancing action
- * frequency and balancing agressivity depends on whether the CPU is
- * idle or not.
+ * rebalance_tick will get called every timer tick, on every CPU.
  *
- * busy-rebalance every 200 msecs. idle-rebalance every 1 msec. (or on
- * systems with HZ=100, every 10 msecs.)
+ * It checks each scheduling domain to see if it is due to be balanced,
+ * and initiates a balancing operation if so.
  *
- * On NUMA, do a node-rebalance every 400 msecs.
+ * Balancing parameters are set up in arch_init_sched_domains.
  */
-#define IDLE_REBALANCE_TICK (HZ/1000 ?: 1)
-#define BUSY_REBALANCE_TICK (HZ/5 ?: 1)
-#define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5)
-#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2)
-
-#ifdef CONFIG_NUMA
-static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
-{
-	int node = find_busiest_node(cpu_to_node(this_cpu));
 
-	if (node >= 0) {
-		cpumask_t cpumask = node_to_cpumask(node);
-		cpu_set(this_cpu, cpumask);
-		spin_lock(&this_rq->lock);
-		load_balance(this_rq, idle, cpumask);
-		spin_unlock(&this_rq->lock);
-	}
-}
-#endif
+/* Don't have all balancing operations going off at once */
+#define CPU_OFFSET(cpu) (HZ * cpu / NR_CPUS)
 
-static void rebalance_tick(runqueue_t *this_rq, int idle)
+static void rebalance_tick(int this_cpu, runqueue_t *this_rq,
+			   enum idle_type idle)
 {
-#ifdef CONFIG_NUMA
-	int this_cpu = smp_processor_id();
-#endif
-	unsigned long j = jiffies;
+	unsigned long old_load, this_load;
+	unsigned long j = jiffies + CPU_OFFSET(this_cpu);
+	struct sched_domain *sd;
 
+	/* Update our load */
+	old_load = this_rq->cpu_load;
+	this_load = this_rq->nr_running * SCHED_LOAD_SCALE;
 	/*
-	 * First do inter-node rebalancing, then intra-node rebalancing,
-	 * if both events happen in the same tick. The inter-node
-	 * rebalancing does not necessarily have to create a perfect
-	 * balance within the node, since we load-balance the most loaded
-	 * node with the current CPU. (ie. other CPUs in the local node
-	 * are not balanced.)
+	 * Round up the averaging division if load is increasing. This
+	 * prevents us from getting stuck on 9 if the load is 10, for
+	 * example.
 	 */
-	if (idle) {
-#ifdef CONFIG_NUMA
-		if (!(j % IDLE_NODE_REBALANCE_TICK))
-			balance_node(this_rq, idle, this_cpu);
-#endif
-		if (!(j % IDLE_REBALANCE_TICK)) {
-			spin_lock(&this_rq->lock);
-			load_balance(this_rq, idle, cpu_to_node_mask(this_cpu));
-			spin_unlock(&this_rq->lock);
+	if (this_load > old_load)
+		old_load++;
+	this_rq->cpu_load = (old_load + this_load) / 2;
+
+	for_each_domain(this_cpu, sd) {
+		unsigned long interval = sd->balance_interval;
+
+		if (idle != IDLE)
+			interval *= sd->busy_factor;
+
+		/* scale ms to jiffies */
+		interval = msecs_to_jiffies(interval);
+		if (unlikely(!interval))
+			interval = 1;
+
+		if (j - sd->last_balance >= interval) {
+			if (load_balance(this_cpu, this_rq, sd, idle)) {
+				/* We've pulled tasks over so no longer idle */
+				idle = NOT_IDLE;
+			}
+			sd->last_balance += interval;
 		}
-		return;
-	}
-#ifdef CONFIG_NUMA
-	if (!(j % BUSY_NODE_REBALANCE_TICK))
-		balance_node(this_rq, idle, this_cpu);
-#endif
-	if (!(j % BUSY_REBALANCE_TICK)) {
-		spin_lock(&this_rq->lock);
-		load_balance(this_rq, idle, cpu_to_node_mask(this_cpu));
-		spin_unlock(&this_rq->lock);
 	}
 }
 #else
 /*
  * on UP we do not need to balance between CPUs:
  */
-static inline void rebalance_tick(runqueue_t *this_rq, int idle)
+static inline void rebalance_tick(int cpu, runqueue_t *rq, enum idle_type idle)
+{
+}
+static inline void idle_balance(int cpu, runqueue_t *rq)
 {
 }
 #endif
 
+static inline int wake_priority_sleeper(runqueue_t *rq)
+{
+#ifdef CONFIG_SCHED_SMT
+	/*
+	 * If an SMT sibling task has been put to sleep for priority
+	 * reasons reschedule the idle task to see if it can now run.
+	 */
+	if (rq->nr_running) {
+		resched_task(rq->idle);
+		return 1;
+	}
+#endif
+	return 0;
+}
+
 DEFINE_PER_CPU(struct kernel_stat, kstat);
 
 EXPORT_PER_CPU_SYMBOL(kstat);
@@ -1507,7 +1964,9 @@ void scheduler_tick(int user_ticks, int sys_ticks)
 			cpustat->iowait += sys_ticks;
 		else
 			cpustat->idle += sys_ticks;
-		rebalance_tick(rq, 1);
+		if (wake_priority_sleeper(rq))
+			goto out;
+		rebalance_tick(cpu, rq, IDLE);
 		return;
 	}
 	if (TASK_NICE(p) > 0)
@@ -1591,8 +2050,93 @@ void scheduler_tick(int user_ticks, int sys_ticks)
 out_unlock:
 	spin_unlock(&rq->lock);
 out:
-	rebalance_tick(rq, 0);
+	rebalance_tick(cpu, rq, NOT_IDLE);
+}
+
+#ifdef CONFIG_SCHED_SMT
+static inline void wake_sleeping_dependent(int cpu, runqueue_t *rq)
+{
+	int i;
+	struct sched_domain *sd = rq->sd;
+	cpumask_t sibling_map;
+
+	if (!(sd->flags & SD_SHARE_CPUPOWER))
+		return;
+
+	cpus_and(sibling_map, sd->span, cpu_online_map);
+	for_each_cpu_mask(i, sibling_map) {
+		runqueue_t *smt_rq;
+
+		if (i == cpu)
+			continue;
+
+		smt_rq = cpu_rq(i);
+
+		/*
+		 * If an SMT sibling task is sleeping due to priority
+		 * reasons wake it up now.
+		 */
+		if (smt_rq->curr == smt_rq->idle && smt_rq->nr_running)
+			resched_task(smt_rq->idle);
+	}
+}
+
+static inline int dependent_sleeper(int cpu, runqueue_t *rq, task_t *p)
+{
+	struct sched_domain *sd = rq->sd;
+	cpumask_t sibling_map;
+	int ret = 0, i;
+
+	if (!(sd->flags & SD_SHARE_CPUPOWER))
+		return 0;
+
+	cpus_and(sibling_map, sd->span, cpu_online_map);
+	for_each_cpu_mask(i, sibling_map) {
+		runqueue_t *smt_rq;
+		task_t *smt_curr;
+
+		if (i == cpu)
+			continue;
+
+		smt_rq = cpu_rq(i);
+		smt_curr = smt_rq->curr;
+
+		/*
+		 * If a user task with lower static priority than the
+		 * running task on the SMT sibling is trying to schedule,
+		 * delay it till there is proportionately less timeslice
+		 * left of the sibling task to prevent a lower priority
+		 * task from using an unfair proportion of the
+		 * physical cpu's resources. -ck
+		 */
+		if (((smt_curr->time_slice * (100 - sd->per_cpu_gain) / 100) >
+			task_timeslice(p) || rt_task(smt_curr)) &&
+			p->mm && smt_curr->mm && !rt_task(p))
+				ret = 1;
+
+		/*
+		 * Reschedule a lower priority task on the SMT sibling,
+		 * or wake it up if it has been put to sleep for priority
+		 * reasons.
+		 */
+		if ((((p->time_slice * (100 - sd->per_cpu_gain) / 100) >
+			task_timeslice(smt_curr) || rt_task(p)) &&
+			smt_curr->mm && p->mm && !rt_task(smt_curr)) ||
+			(smt_curr == smt_rq->idle && smt_rq->nr_running))
+				resched_task(smt_curr);
+	}
+	return ret;
+}
+#else
+static inline void wake_sleeping_dependent(int cpu, runqueue_t *rq)
+{
+}
+
+static inline int dependent_sleeper(int cpu, runqueue_t *rq, task_t *p)
+{
+	return 0;
 }
+#endif
 
 /*
  * schedule() is the main scheduler function.
@@ -1606,7 +2150,7 @@ asmlinkage void __sched schedule(void)
 	struct list_head *queue;
 	unsigned long long now;
 	unsigned long run_time;
-	int idx;
+	int cpu, idx;
 
 	/*
 	 * Test if we are atomic.  Since do_exit() needs to call into
@@ -1656,13 +2200,13 @@ need_resched:
 			deactivate_task(prev, rq);
 	}
 
+	cpu = smp_processor_id();
 	if (unlikely(!rq->nr_running)) {
-#ifdef CONFIG_SMP
-		load_balance(rq, 1, cpu_to_node_mask(smp_processor_id()));
-#endif
+		idle_balance(cpu, rq);
 		if (!rq->nr_running) {
 			next = rq->idle;
 			rq->expired_timestamp = 0;
+			wake_sleeping_dependent(cpu, rq);
 			goto switch_tasks;
 		}
 	}
@@ -1683,6 +2227,11 @@ need_resched:
 	queue = array->queue + idx;
 	next = list_entry(queue->next, task_t, run_list);
 
+	if (dependent_sleeper(cpu, rq, next)) {
+		next = rq->idle;
+		goto switch_tasks;
+	}
+
 	if (!rt_task(next) && next->activated > 0) {
 		unsigned long long delta = now - next->timestamp;
 
@@ -1726,6 +2275,16 @@ switch_tasks:
 	preempt_enable_no_resched();
 	if (test_thread_flag(TIF_NEED_RESCHED))
 		goto need_resched;
+
+	return;
+
+ dump_scheduling_disabled:
+	/* allow scheduling only if this is the dumping cpu */
+	if (dump_oncpu != smp_processor_id()+1) {
+		while (dump_oncpu)
+			cpu_relax();
+	}
+	return;
 }
 
 EXPORT_SYMBOL(schedule);
@@ -1761,7 +2320,7 @@ need_resched:
 EXPORT_SYMBOL(preempt_schedule);
 #endif /* CONFIG_PREEMPT */
 
-int default_wake_function(wait_queue_t *curr, unsigned mode, int sync)
+int default_wake_function(wait_queue_t *curr, unsigned mode, int sync, void *key)
 {
 	task_t *p = curr->task;
 	return try_to_wake_up(p, mode, sync);
@@ -1779,7 +2338,7 @@ EXPORT_SYMBOL(default_wake_function);
  * zero in this (rare) case, and we handle it by continuing to scan the queue.
  */
 static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
-			     int nr_exclusive, int sync)
+			     int nr_exclusive, int sync, void *key)
 {
 	struct list_head *tmp, *next;
 
@@ -1788,7 +2347,7 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
 		unsigned flags;
 		curr = list_entry(tmp, wait_queue_t, task_list);
 		flags = curr->flags;
-		if (curr->func(curr, mode, sync) &&
+		if (curr->func(curr, mode, sync, key) &&
 		    (flags & WQ_FLAG_EXCLUSIVE) &&
 		    !--nr_exclusive)
 			break;
@@ -1801,12 +2360,13 @@ static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
  * @mode: which threads
  * @nr_exclusive: how many wake-one or wake-many threads to wake up
  */
-void fastcall __wake_up(wait_queue_head_t *q, unsigned int mode, int nr_exclusive)
+void fastcall __wake_up(wait_queue_head_t *q, unsigned int mode,
+				int nr_exclusive, void *key)
 {
 	unsigned long flags;
 
 	spin_lock_irqsave(&q->lock, flags);
-	__wake_up_common(q, mode, nr_exclusive, 0);
+	__wake_up_common(q, mode, nr_exclusive, 0, key);
 	spin_unlock_irqrestore(&q->lock, flags);
 }
 
@@ -1817,7 +2377,7 @@ EXPORT_SYMBOL(__wake_up);
  */
 void fastcall __wake_up_locked(wait_queue_head_t *q, unsigned int mode)
 {
-	__wake_up_common(q, mode, 1, 0);
+	__wake_up_common(q, mode, 1, 0, NULL);
 }
 
 /**
@@ -1836,15 +2396,16 @@ void fastcall __wake_up_locked(wait_queue_head_t *q, unsigned int mode)
 void fastcall __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr_exclusive)
 {
 	unsigned long flags;
+	int sync = 1;
 
 	if (unlikely(!q))
 		return;
 
+	if (unlikely(!nr_exclusive))
+		sync = 0;
+
 	spin_lock_irqsave(&q->lock, flags);
-	if (likely(nr_exclusive))
-		__wake_up_common(q, mode, nr_exclusive, 1);
-	else
-		__wake_up_common(q, mode, nr_exclusive, 0);
+	__wake_up_common(q, mode, nr_exclusive, sync, NULL);
 	spin_unlock_irqrestore(&q->lock, flags);
 }
 EXPORT_SYMBOL_GPL(__wake_up_sync);	/* For internal use only */
@@ -1856,7 +2417,7 @@ void fastcall complete(struct completion *x)
 	spin_lock_irqsave(&x->wait.lock, flags);
 	x->done++;
 	__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,
-			 1, 0);
+			 1, 0, NULL);
 	spin_unlock_irqrestore(&x->wait.lock, flags);
 }
 EXPORT_SYMBOL(complete);
@@ -1868,7 +2429,7 @@ void fastcall complete_all(struct completion *x)
 	spin_lock_irqsave(&x->wait.lock, flags);
 	x->done += UINT_MAX/2;
 	__wake_up_common(&x->wait, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE,
-			 0, 0);
+			 0, 0, NULL);
 	spin_unlock_irqrestore(&x->wait.lock, flags);
 }
 EXPORT_SYMBOL(complete_all);
@@ -2015,7 +2576,7 @@ out_unlock:
 
 EXPORT_SYMBOL(set_user_nice);
 
-#ifndef __alpha__
+#ifdef __ARCH_WANT_SYS_NICE
 
 /*
  * sys_nice - change the priority of the current process.
@@ -2199,7 +2760,7 @@ static int setscheduler(pid_t pid, int policy, struct sched_param __user *param)
 		if (task_running(rq, p)) {
 			if (p->prio > oldprio)
 				resched_task(rq->curr);
-		} else if (p->prio < rq->curr->prio)
+		} else if (TASK_PREEMPTS_CURR(p, rq))
 			resched_task(rq->curr);
 	}
 
@@ -2368,6 +2929,7 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
 	if (len < real_len)
 		return -EINVAL;
 
+	lock_cpu_hotplug();
 	read_lock(&tasklist_lock);
 
 	retval = -ESRCH;
@@ -2380,6 +2942,7 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
 
 out_unlock:
 	read_unlock(&tasklist_lock);
+	unlock_cpu_hotplug();
 	if (retval)
 		return retval;
 	if (copy_to_user(user_mask_ptr, &mask, real_len))
@@ -2398,6 +2961,7 @@ asmlinkage long sys_sched_yield(void)
 {
 	runqueue_t *rq = this_rq_lock();
 	prio_array_t *array = current->array;
+	prio_array_t *target = rq->expired;
 
 	/*
 	 * We implement yielding by moving the task into the expired
@@ -2406,16 +2970,15 @@ asmlinkage long sys_sched_yield(void)
 	 * (special rule: RT tasks will just roundrobin in the active
 	 *  array.)
 	 */
-	if (likely(!rt_task(current))) {
-		dequeue_task(current, array);
-		enqueue_task(current, rq->expired);
-	} else {
-		list_del(&current->run_list);
-		list_add_tail(&current->run_list, array->queue + current->prio);
-	}
+	if (unlikely(rt_task(current)))
+		target = rq->active;
+
+	dequeue_task(current, array);
+	enqueue_task(current, target);
+
 	/*
 	 * Since we are going to call schedule() anyway, there's
-	 * no need to preempt:
+	 * no need to preempt or enable interrupts:
 	 */
 	_raw_spin_unlock(&rq->lock);
 	preempt_enable_no_resched();
@@ -2658,7 +3221,7 @@ void show_state(void)
 	read_unlock(&tasklist_lock);
 }
 
-void __init init_idle(task_t *idle, int cpu)
+void __devinit init_idle(task_t *idle, int cpu)
 {
 	runqueue_t *idle_rq = cpu_rq(cpu), *rq = cpu_rq(task_cpu(idle));
 	unsigned long flags;
@@ -2685,13 +3248,13 @@ void __init init_idle(task_t *idle, int cpu)
 }
 
 /*
- * In a system that switches off the HZ timer idle_cpu_mask
+ * In a system that switches off the HZ timer nohz_cpu_mask
  * indicates which cpus entered this state. This is used
  * in the rcu update to wait only for active cpus. For system
- * which do not switch off the HZ timer idle_cpu_mask should
+ * which do not switch off the HZ timer nohz_cpu_mask should
  * always be CPU_MASK_NONE.
  */
-cpumask_t idle_cpu_mask = CPU_MASK_NONE;
+cpumask_t nohz_cpu_mask = CPU_MASK_NONE;
 
 #ifdef CONFIG_SMP
 /*
@@ -2732,7 +3295,12 @@ int set_cpus_allowed(task_t *p, cpumask_t new_mask)
 		goto out;
 	}
 
-	if (__set_cpus_allowed(p, new_mask, &req)) {
+	p->cpus_allowed = new_mask;
+	/* Can the task run on the task's current CPU? If so, we're done */
+	if (cpu_isset(task_cpu(p), new_mask))
+		goto out;
+
+	if (migrate_task(p, any_online_cpu(new_mask), &req)) {
 		/* Need help from migration thread: drop lock and wait. */
 		task_rq_unlock(rq, &flags);
 		wake_up_process(rq->migration_thread);
@@ -2746,28 +3314,51 @@ out:
 
 EXPORT_SYMBOL_GPL(set_cpus_allowed);
 
-/* Move (not current) task off this cpu, onto dest cpu. */
-static void move_task_away(struct task_struct *p, int dest_cpu)
+/*
+ * Move (not current) task off this cpu, onto dest cpu.  We're doing
+ * this because either it can't run here any more (set_cpus_allowed()
+ * away from this CPU, or CPU going down), or because we're
+ * attempting to rebalance this task on exec (sched_balance_exec).
+ *
+ * So we race with normal scheduler movements, but that's OK, as long
+ * as the task is no longer on this CPU.
+ */
+static void __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
 {
-	runqueue_t *rq_dest;
+	runqueue_t *rq_dest, *rq_src;
+
+	if (unlikely(cpu_is_offline(dest_cpu)))
+		return;
 
+	rq_src  = cpu_rq(src_cpu);
 	rq_dest = cpu_rq(dest_cpu);
 
-	double_rq_lock(this_rq(), rq_dest);
-	if (task_cpu(p) != smp_processor_id())
-		goto out; /* Already moved */
+	double_rq_lock(rq_src, rq_dest);
+	/* Already moved. */
+	if (task_cpu(p) != src_cpu)
+		goto out;
+	/* Affinity changed (again). */
+	if (!cpu_isset(dest_cpu, p->cpus_allowed))
+		goto out;
 
 	set_task_cpu(p, dest_cpu);
 	if (p->array) {
-		deactivate_task(p, this_rq());
-		activate_task(p, rq_dest);
-		if (p->prio < rq_dest->curr->prio)
+		/*
+		 * Sync timestamp with rq_dest's before activating.
+		 * The same thing could be achieved by doing this step
+		 * afterwards, and pretending it was a local activate.
+		 * This way is cleaner and logically correct.
+		 */
+		p->timestamp = p->timestamp - rq_src->timestamp_last_tick
+				+ rq_dest->timestamp_last_tick;
+		deactivate_task(p, rq_src);
+		activate_task(p, rq_dest, 0);
+		if (TASK_PREEMPTS_CURR(p, rq_dest))
 			resched_task(rq_dest->curr);
 	}
-	p->timestamp = rq_dest->timestamp_last_tick;
 
 out:
-	double_rq_unlock(this_rq(), rq_dest);
+	double_rq_unlock(rq_src, rq_dest);
 }
 
 /*
@@ -2783,6 +3374,7 @@ static int migration_thread(void * data)
 	rq = cpu_rq(cpu);
 	BUG_ON(rq->migration_thread != current);
 
+	set_current_state(TASK_INTERRUPTIBLE);
 	while (!kthread_should_stop()) {
 		struct list_head *head;
 		migration_req_t *req;
@@ -2791,40 +3383,66 @@ static int migration_thread(void * data)
 			refrigerator(PF_FREEZE);
 
 		spin_lock_irq(&rq->lock);
+
+		if (cpu_is_offline(cpu)) {
+			spin_unlock_irq(&rq->lock);
+			goto wait_to_die;
+		}
+
+		if (rq->active_balance) {
+			active_load_balance(rq, cpu);
+			rq->active_balance = 0;
+		}
+
 		head = &rq->migration_queue;
-		current->state = TASK_INTERRUPTIBLE;
+
 		if (list_empty(head)) {
 			spin_unlock_irq(&rq->lock);
 			schedule();
+			set_current_state(TASK_INTERRUPTIBLE);
 			continue;
 		}
 		req = list_entry(head->next, migration_req_t, list);
 		list_del_init(head->next);
-		spin_unlock(&rq->lock);
 
-		move_task_away(req->task,
-			       any_online_cpu(req->task->cpus_allowed));
-		local_irq_enable();
+		if (req->type == REQ_MOVE_TASK) {
+			spin_unlock(&rq->lock);
+			__migrate_task(req->task, smp_processor_id(),
+					req->dest_cpu);
+			local_irq_enable();
+		} else if (req->type == REQ_SET_DOMAIN) {
+			rq->sd = req->sd;
+			spin_unlock_irq(&rq->lock);
+		} else {
+			spin_unlock_irq(&rq->lock);
+			WARN_ON(1);
+		}
+
 		complete(&req->done);
 	}
+	__set_current_state(TASK_RUNNING);
+	return 0;
+
+wait_to_die:
+	/* Wait for kthread_stop */
+	set_current_state(TASK_INTERRUPTIBLE);
+	while (!kthread_should_stop()) {
+		schedule();
+		set_current_state(TASK_INTERRUPTIBLE);
+	}
+	__set_current_state(TASK_RUNNING);
 	return 0;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-/* migrate_all_tasks - function to migrate all the tasks from the
- * current cpu caller must have already scheduled this to the target
- * cpu via set_cpus_allowed.  Machine is stopped.  */
-void migrate_all_tasks(void)
+/* migrate_all_tasks - function to migrate all tasks from the dead cpu.  */
+static void migrate_all_tasks(int src_cpu)
 {
 	struct task_struct *tsk, *t;
-	int dest_cpu, src_cpu;
+	int dest_cpu;
 	unsigned int node;
 
-	/* We're nailed to this CPU. */
-	src_cpu = smp_processor_id();
-
-	/* Not required, but here for neatness. */
-	write_lock(&tasklist_lock);
+	write_lock_irq(&tasklist_lock);
 
 	/* watch out for per node tasks, let's stay on this node */
 	node = cpu_to_node(src_cpu);
@@ -2860,10 +3478,36 @@ void migrate_all_tasks(void)
 				       tsk->pid, tsk->comm, src_cpu);
 		}
 
-		move_task_away(tsk, dest_cpu);
+		__migrate_task(tsk, src_cpu, dest_cpu);
 	} while_each_thread(t, tsk);
 
-	write_unlock(&tasklist_lock);
+	write_unlock_irq(&tasklist_lock);
+}
+
+/* Schedules idle task to be the next runnable task on current CPU.
+ * It does so by boosting its priority to highest possible and adding it to
+ * the _front_ of runqueue. Used by CPU offline code.
+ */
+void sched_idle_next(void)
+{
+	int cpu = smp_processor_id();
+	runqueue_t *rq = this_rq();
+	struct task_struct *p = rq->idle;
+	unsigned long flags;
+
+	/* cpu has to be offline */
+	BUG_ON(cpu_online(cpu));
+
+	/* Strictly not necessary since rest of the CPUs are stopped by now
+	 * and interrupts disabled on current cpu.
+	 */
+	spin_lock_irqsave(&rq->lock, flags);
+
+	__setscheduler(p, SCHED_FIFO, MAX_RT_PRIO-1);
+	/* Add idle task to _front_ of it's priority queue */
+	__activate_idle_task(p, rq);
+
+	spin_unlock_irqrestore(&rq->lock, flags);
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
@@ -2899,18 +3543,47 @@ static int migration_call(struct notifier_block *nfb, unsigned long action,
 	case CPU_UP_CANCELED:
 		/* Unbind it from offline cpu so it can run.  Fall thru. */
 		kthread_bind(cpu_rq(cpu)->migration_thread,smp_processor_id());
-	case CPU_DEAD:
 		kthread_stop(cpu_rq(cpu)->migration_thread);
 		cpu_rq(cpu)->migration_thread = NULL;
- 		BUG_ON(cpu_rq(cpu)->nr_running != 0);
+		break;
+	case CPU_DEAD:
+		migrate_all_tasks(cpu);
+		rq = cpu_rq(cpu);
+		kthread_stop(rq->migration_thread);
+		rq->migration_thread = NULL;
+		/* Idle task back to normal (off runqueue, low prio) */
+		rq = task_rq_lock(rq->idle, &flags);
+		deactivate_task(rq->idle, rq);
+		rq->idle->static_prio = MAX_PRIO;
+		__setscheduler(rq->idle, SCHED_NORMAL, 0);
+		task_rq_unlock(rq, &flags);
+ 		BUG_ON(rq->nr_running != 0);
+
+		/* No need to migrate the tasks: it was best-effort if
+		 * they didn't do lock_cpu_hotplug().  Just wake up
+		 * the requestors. */
+		spin_lock_irq(&rq->lock);
+		while (!list_empty(&rq->migration_queue)) {
+			migration_req_t *req;
+			req = list_entry(rq->migration_queue.next,
+					 migration_req_t, list);
+			BUG_ON(req->type != REQ_MOVE_TASK);
+			list_del_init(&req->list);
+			complete(&req->done);
+		}
+		spin_unlock_irq(&rq->lock);
  		break;
 #endif
 	}
 	return NOTIFY_OK;
 }
 
+/* Register at highest priority so that task migration (migrate_all_tasks)
+ * happens before everything else.
+ */
 static struct notifier_block __devinitdata migration_notifier = {
 	.notifier_call = migration_call,
+	.priority = 10
 };
 
 int __init migration_init(void)
@@ -2939,23 +3612,298 @@ int __init migration_init(void)
 spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 EXPORT_SYMBOL(kernel_flag);
 
+#ifdef CONFIG_SMP
+/* Attach the domain 'sd' to 'cpu' as its base domain */
+void cpu_attach_domain(struct sched_domain *sd, int cpu)
+{
+	migration_req_t req;
+	unsigned long flags;
+	runqueue_t *rq = cpu_rq(cpu);
+	int local = 1;
+
+	lock_cpu_hotplug();
+
+	spin_lock_irqsave(&rq->lock, flags);
+
+	if (cpu == smp_processor_id() || !cpu_online(cpu)) {
+		rq->sd = sd;
+	} else {
+		init_completion(&req.done);
+		req.type = REQ_SET_DOMAIN;
+		req.sd = sd;
+		list_add(&req.list, &rq->migration_queue);
+		local = 0;
+	}
+
+	spin_unlock_irqrestore(&rq->lock, flags);
+
+	if (!local) {
+		wake_up_process(rq->migration_thread);
+		wait_for_completion(&req.done);
+	}
+
+	unlock_cpu_hotplug();
+}
+
+#ifdef ARCH_HAS_SCHED_DOMAIN
+extern void __init arch_init_sched_domains(void);
+#else
+static struct sched_group sched_group_cpus[NR_CPUS];
+static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
+#ifdef CONFIG_NUMA
+static struct sched_group sched_group_nodes[MAX_NUMNODES];
+static DEFINE_PER_CPU(struct sched_domain, node_domains);
+static void __init arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first_node = NULL, *last_node = NULL;
+
+	/* Set up domains */
+	for_each_cpu(i) {
+		int node = cpu_to_node(i);
+		cpumask_t nodemask = node_to_cpumask(node);
+		struct sched_domain *node_sd = &per_cpu(node_domains, i);
+		struct sched_domain *cpu_sd = &per_cpu(cpu_domains, i);
+
+		*node_sd = SD_NODE_INIT;
+		node_sd->span = cpu_possible_map;
+		node_sd->groups = &sched_group_nodes[cpu_to_node(i)];
+
+		*cpu_sd = SD_CPU_INIT;
+		cpus_and(cpu_sd->span, nodemask, cpu_possible_map);
+		cpu_sd->groups = &sched_group_cpus[i];
+		cpu_sd->parent = node_sd;
+	}
+
+	/* Set up groups */
+	for (i = 0; i < MAX_NUMNODES; i++) {
+		cpumask_t tmp = node_to_cpumask(i);
+		cpumask_t nodemask;
+		struct sched_group *first_cpu = NULL, *last_cpu = NULL;
+		struct sched_group *node = &sched_group_nodes[i];
+		int j;
+
+		cpus_and(nodemask, tmp, cpu_possible_map);
+
+		if (cpus_empty(nodemask))
+			continue;
+
+		node->cpumask = nodemask;
+		node->cpu_power = SCHED_LOAD_SCALE * cpus_weight(node->cpumask);
+
+		for_each_cpu_mask(j, node->cpumask) {
+			struct sched_group *cpu = &sched_group_cpus[j];
+
+			cpus_clear(cpu->cpumask);
+			cpu_set(j, cpu->cpumask);
+			cpu->cpu_power = SCHED_LOAD_SCALE;
+
+			if (!first_cpu)
+				first_cpu = cpu;
+			if (last_cpu)
+				last_cpu->next = cpu;
+			last_cpu = cpu;
+		}
+		last_cpu->next = first_cpu;
+
+		if (!first_node)
+			first_node = node;
+		if (last_node)
+			last_node->next = node;
+		last_node = node;
+	}
+	last_node->next = first_node;
+
+	mb();
+	for_each_cpu(i) {
+		struct sched_domain *cpu_sd = &per_cpu(cpu_domains, i);
+		cpu_attach_domain(cpu_sd, i);
+	}
+}
+
+#else /* !CONFIG_NUMA */
+static void __init arch_init_sched_domains(void)
+{
+	int i;
+	struct sched_group *first_cpu = NULL, *last_cpu = NULL;
+
+	/* Set up domains */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_sd = &per_cpu(cpu_domains, i);
+
+		*cpu_sd = SD_CPU_INIT;
+		cpu_sd->span = cpu_possible_map;
+		cpu_sd->groups = &sched_group_cpus[i];
+	}
+
+	/* Set up CPU groups */
+	for_each_cpu_mask(i, cpu_possible_map) {
+		struct sched_group *cpu = &sched_group_cpus[i];
+
+		cpus_clear(cpu->cpumask);
+		cpu_set(i, cpu->cpumask);
+		cpu->cpu_power = SCHED_LOAD_SCALE;
+
+		if (!first_cpu)
+			first_cpu = cpu;
+		if (last_cpu)
+			last_cpu->next = cpu;
+		last_cpu = cpu;
+	}
+	last_cpu->next = first_cpu;
+
+	mb(); /* domains were modified outside the lock */
+	for_each_cpu(i) {
+		struct sched_domain *cpu_sd = &per_cpu(cpu_domains, i);
+		cpu_attach_domain(cpu_sd, i);
+	}
+}
+
+#endif /* CONFIG_NUMA */
+#endif /* ARCH_HAS_SCHED_DOMAIN */
+
+#define SCHED_DOMAIN_DEBUG
+#ifdef SCHED_DOMAIN_DEBUG
+void sched_domain_debug(void)
+{
+	int i;
+
+	for_each_cpu(i) {
+		runqueue_t *rq = cpu_rq(i);
+		struct sched_domain *sd;
+		int level = 0;
+
+		sd = rq->sd;
+
+		printk(KERN_DEBUG "CPU%d: %s\n",
+				i, (cpu_online(i) ? " online" : "offline"));
+
+		do {
+			int j;
+			char str[NR_CPUS];
+			struct sched_group *group = sd->groups;
+			cpumask_t groupmask, tmp;
+
+			cpumask_scnprintf(str, NR_CPUS, sd->span);
+			cpus_clear(groupmask);
+
+			printk(KERN_DEBUG);
+			for (j = 0; j < level + 1; j++)
+				printk(" ");
+			printk("domain %d: span %s\n", level, str);
+
+			if (!cpu_isset(i, sd->span))
+				printk(KERN_DEBUG "ERROR domain->span does not contain CPU%d\n", i);
+			if (!cpu_isset(i, group->cpumask))
+				printk(KERN_DEBUG "ERROR domain->groups does not contain CPU%d\n", i);
+			if (!group->cpu_power)
+				printk(KERN_DEBUG "ERROR domain->cpu_power not set\n");
+
+			printk(KERN_DEBUG);
+			for (j = 0; j < level + 2; j++)
+				printk(" ");
+			printk("groups:");
+			do {
+				if (!group) {
+					printk(" ERROR: NULL");
+					break;
+				}
+
+				if (!cpus_weight(group->cpumask))
+					printk(" ERROR empty group:");
+
+				cpus_and(tmp, groupmask, group->cpumask);
+				if (cpus_weight(tmp) > 0)
+					printk(" ERROR repeated CPUs:");
+
+				cpus_or(groupmask, groupmask, group->cpumask);
+
+				cpumask_scnprintf(str, NR_CPUS, group->cpumask);
+				printk(" %s", str);
+
+				group = group->next;
+			} while (group != sd->groups);
+			printk("\n");
+
+			if (!cpus_equal(sd->span, groupmask))
+				printk(KERN_DEBUG "ERROR groups don't span domain->span\n");
+
+			level++;
+			sd = sd->parent;
+
+			if (sd) {
+				cpus_and(tmp, groupmask, sd->span);
+				if (!cpus_equal(tmp, groupmask))
+					printk(KERN_DEBUG "ERROR parent span is not a superset of domain->span\n");
+			}
+
+		} while (sd);
+	}
+}
+#else
+#define sched_domain_debug() {}
+#endif
+
+void __init sched_init_smp(void)
+{
+	arch_init_sched_domains();
+	sched_domain_debug();
+}
+#else
+void __init sched_init_smp(void)
+{
+}
+#endif /* CONFIG_SMP */
+
+int in_sched_functions(unsigned long addr)
+{
+	/* Linker adds these: start and end of __sched functions */
+	extern char __sched_text_start[], __sched_text_end[];
+	return addr >= (unsigned long)__sched_text_start
+		&& addr < (unsigned long)__sched_text_end;
+}
+
 void __init sched_init(void)
 {
 	runqueue_t *rq;
 	int i, j, k;
 
+#ifdef CONFIG_SMP
+	/* Set up an initial dummy domain for early boot */
+	static struct sched_domain sched_domain_init;
+	static struct sched_group sched_group_init;
+	cpumask_t cpu_mask_all = CPU_MASK_ALL;
+
+	memset(&sched_domain_init, 0, sizeof(struct sched_domain));
+	sched_domain_init.span = cpu_mask_all;
+	sched_domain_init.groups = &sched_group_init;
+	sched_domain_init.last_balance = jiffies;
+	sched_domain_init.balance_interval = INT_MAX; /* Don't balance */
+
+	memset(&sched_group_init, 0, sizeof(struct sched_group));
+	sched_group_init.cpumask = cpu_mask_all;
+	sched_group_init.next = &sched_group_init;
+	sched_group_init.cpu_power = SCHED_LOAD_SCALE;
+#endif
+
 	for (i = 0; i < NR_CPUS; i++) {
 		prio_array_t *array;
 
 		rq = cpu_rq(i);
+		spin_lock_init(&rq->lock);
 		rq->active = rq->arrays;
 		rq->expired = rq->arrays + 1;
 		rq->best_expired_prio = MAX_PRIO;
 
-		spin_lock_init(&rq->lock);
+#ifdef CONFIG_SMP
+		rq->sd = &sched_domain_init;
+		rq->cpu_load = 0;
+		rq->active_balance = 0;
+		rq->push_cpu = 0;
+		rq->migration_thread = NULL;
 		INIT_LIST_HEAD(&rq->migration_queue);
+#endif
 		atomic_set(&rq->nr_iowait, 0);
-		nr_running_init(rq);
 
 		for (j = 0; j < 2; j++) {
 			array = rq->arrays + j;
@@ -2977,8 +3925,6 @@ void __init sched_init(void)
 	set_task_cpu(current, smp_processor_id());
 	wake_up_forked_process(current);
 
-	init_timers();
-
 	/*
 	 * The boot idle thread does lazy MMU switching as well:
 	 */
diff --git a/kernel/signal.c b/kernel/signal.c
index a9181552a..e734221af 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -23,6 +23,7 @@
 #include <linux/ptrace.h>
 #include <asm/param.h>
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 #include <asm/siginfo.h>
 
 /*
@@ -1403,12 +1404,12 @@ static void __wake_up_parent(struct task_struct *p,
 	 * Fortunately this is not necessary for thread groups:
 	 */
 	if (p->tgid == tsk->tgid) {
-		wake_up_interruptible(&tsk->wait_chldexit);
+		wake_up_interruptible_sync(&tsk->wait_chldexit);
 		return;
 	}
 
 	do {
-		wake_up_interruptible(&tsk->wait_chldexit);
+		wake_up_interruptible_sync(&tsk->wait_chldexit);
 		tsk = next_thread(tsk);
 		if (tsk->signal != parent->signal)
 			BUG();
@@ -2174,7 +2175,7 @@ sys_kill(int pid, int sig)
 }
 
 /**
- *  sys_tkill - send signal to one specific thread
+ *  sys_tgkill - send signal to one specific thread
  *  @tgid: the thread group ID of the thread
  *  @pid: the PID of the thread
  *  @sig: signal to be sent
@@ -2412,14 +2413,19 @@ out:
 	return error;
 }
 
+#ifdef __ARCH_WANT_SYS_SIGPENDING
+
 asmlinkage long
 sys_sigpending(old_sigset_t __user *set)
 {
 	return do_sigpending(set, sizeof(*set));
 }
 
-#if !defined(__alpha__)
-/* Alpha has its own versions with special arguments.  */
+#endif
+
+#ifdef __ARCH_WANT_SYS_SIGPROCMASK
+/* Some platforms have their own version with special arguments others
+   support only sys_rt_sigprocmask.  */
 
 asmlinkage long
 sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset)
@@ -2469,8 +2475,9 @@ sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset)
 out:
 	return error;
 }
+#endif /* __ARCH_WANT_SYS_SIGPROCMASK */
 
-#ifndef __sparc__
+#ifdef __ARCH_WANT_SYS_RT_SIGACTION
 asmlinkage long
 sys_rt_sigaction(int sig,
 		 const struct sigaction __user *act,
@@ -2498,11 +2505,10 @@ sys_rt_sigaction(int sig,
 out:
 	return ret;
 }
-#endif /* __sparc__ */
-#endif
+#endif /* __ARCH_WANT_SYS_RT_SIGACTION */
+
+#ifdef __ARCH_WANT_SYS_SGETMASK
 
-#if !defined(__alpha__) && !defined(__ia64__) && \
-    !defined(__arm__) && !defined(__s390__)
 /*
  * For backwards compatibility.  Functionality superseded by sigprocmask.
  */
@@ -2528,10 +2534,9 @@ sys_ssetmask(int newmask)
 
 	return old;
 }
-#endif /* !defined(__alpha__) */
+#endif /* __ARCH_WANT_SGETMASK */
 
-#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips__) && \
-    !defined(__arm__)
+#ifdef __ARCH_WANT_SYS_SIGNAL
 /*
  * For backwards compatibility.  Functionality superseded by sigaction.
  */
@@ -2548,9 +2553,9 @@ sys_signal(int sig, __sighandler_t handler)
 
 	return ret ? ret : (unsigned long)old_sa.sa.sa_handler;
 }
-#endif /* !alpha && !__ia64__ && !defined(__mips__) && !defined(__arm__) */
+#endif /* __ARCH_WANT_SYS_SIGNAL */
 
-#ifndef HAVE_ARCH_SYS_PAUSE
+#ifdef __ARCH_WANT_SYS_PAUSE
 
 asmlinkage long
 sys_pause(void)
@@ -2560,7 +2565,7 @@ sys_pause(void)
 	return -ERESTARTNOHAND;
 }
 
-#endif /* HAVE_ARCH_SYS_PAUSE */
+#endif
 
 void __init signals_init(void)
 {
@@ -2568,7 +2573,5 @@ void __init signals_init(void)
 		kmem_cache_create("sigqueue",
 				  sizeof(struct sigqueue),
 				  __alignof__(struct sigqueue),
-				  0, NULL, NULL);
-	if (!sigqueue_cachep)
-		panic("signals_init(): cannot create sigqueue SLAB cache");
+				  SLAB_PANIC, NULL, NULL);
 }
diff --git a/kernel/sys.c b/kernel/sys.c
index 4d414d925..1bbc66a60 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -271,6 +271,10 @@ cond_syscall(compat_sys_mq_timedsend)
 cond_syscall(compat_sys_mq_timedreceive)
 cond_syscall(compat_sys_mq_notify)
 cond_syscall(compat_sys_mq_getsetattr)
+cond_syscall(sys_mbind)
+cond_syscall(sys_get_mempolicy)
+cond_syscall(sys_set_mempolicy)
+cond_syscall(compat_get_mempolicy)
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read)
@@ -348,6 +352,8 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
 				if (p->uid == who)
 					error = set_one_prio(p, niceval, error);
 			while_each_thread(g, p);
+			if (who)
+				free_uid(user);		/* For find_user() */
 			break;
 	}
 out_unlock:
@@ -410,6 +416,8 @@ asmlinkage long sys_getpriority(int which, int who)
 						retval = niceval;
 				}
 			while_each_thread(g, p);
+			if (who)
+				free_uid(user);		/* for find_user() */
 			break;
 	}
 out_unlock:
@@ -447,7 +455,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
 	switch (cmd) {
 	case LINUX_REBOOT_CMD_RESTART:
 		notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL);
-		system_state = SYSTEM_SHUTDOWN;
+		system_state = SYSTEM_RESTART;
 		device_shutdown();
 		printk(KERN_EMERG "Restarting system.\n");
 		machine_restart(NULL);
@@ -463,7 +471,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
 
 	case LINUX_REBOOT_CMD_HALT:
 		notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
-		system_state = SYSTEM_SHUTDOWN;
+		system_state = SYSTEM_HALT;
 		device_shutdown();
 		printk(KERN_EMERG "System halted.\n");
 		machine_halt();
@@ -473,7 +481,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
 
 	case LINUX_REBOOT_CMD_POWER_OFF:
 		notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
-		system_state = SYSTEM_SHUTDOWN;
+		system_state = SYSTEM_POWER_OFF;
 		device_shutdown();
 		printk(KERN_EMERG "Power down.\n");
 		machine_power_off();
@@ -489,7 +497,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user
 		buffer[sizeof(buffer) - 1] = '\0';
 
 		notifier_call_chain(&reboot_notifier_list, SYS_RESTART, buffer);
-		system_state = SYSTEM_SHUTDOWN;
+		system_state = SYSTEM_RESTART;
 		device_shutdown();
 		printk(KERN_EMERG "Restarting system with command '%s'.\n", buffer);
 		machine_restart(buffer);
@@ -812,7 +820,7 @@ asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
 	return security_task_post_setuid(old_ruid, old_euid, old_suid, LSM_SETID_RES);
 }
 
-asmlinkage long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
+asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid)
 {
 	int retval;
 
@@ -861,7 +869,7 @@ asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
 	return 0;
 }
 
-asmlinkage long sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
+asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid)
 {
 	int retval;
 
@@ -1056,12 +1064,16 @@ asmlinkage long sys_getpgid(pid_t pid)
 	}
 }
 
+#ifdef __ARCH_WANT_SYS_GETPGRP
+
 asmlinkage long sys_getpgrp(void)
 {
 	/* SMP - assuming writes are word atomic this is fine */
 	return process_group(current);
 }
 
+#endif
+
 asmlinkage long sys_getsid(pid_t pid)
 {
 	if (!pid) {
@@ -1121,10 +1133,10 @@ struct group_info *groups_alloc(int gidsetsize)
 	int nblocks;
 	int i;
 
-	nblocks = (gidsetsize/NGROUPS_PER_BLOCK) +
-	    (gidsetsize%NGROUPS_PER_BLOCK?1:0);
-	group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *),
-	    GFP_USER);
+	nblocks = (gidsetsize + NGROUPS_PER_BLOCK - 1) / NGROUPS_PER_BLOCK;
+	/* Make sure we always allocate at least one indirect block pointer */
+	nblocks = nblocks ? : 1;
+	group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *), GFP_USER);
 	if (!group_info)
 		return NULL;
 	group_info->ngroups = gidsetsize;
@@ -1270,8 +1282,12 @@ int set_current_groups(struct group_info *group_info)
 
 	groups_sort(group_info);
 	get_group_info(group_info);
+
+	task_lock(current);
 	old_info = current->group_info;
 	current->group_info = group_info;
+	task_unlock(current);
+
 	put_group_info(old_info);
 
 	return 0;
@@ -1291,6 +1307,7 @@ asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist)
 	if (gidsetsize < 0)
 		return -EINVAL;
 
+	/* no need to grab task_lock here; it cannot change */
 	get_group_info(current->group_info);
 	i = current->group_info->ngroups;
 	if (gidsetsize) {
@@ -1402,6 +1419,8 @@ asmlinkage long sys_sethostname(char __user *name, int len)
 	return errno;
 }
 
+#ifdef __ARCH_WANT_SYS_GETHOSTNAME
+
 asmlinkage long sys_gethostname(char __user *name, int len)
 {
 	int i, errno;
@@ -1419,6 +1438,8 @@ asmlinkage long sys_gethostname(char __user *name, int len)
 	return errno;
 }
 
+#endif
+
 /*
  * Only setdomainname; getdomainname can be implemented by calling
  * uname()
@@ -1453,7 +1474,7 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim)
 			? -EFAULT : 0;
 }
 
-#if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64) || defined(CONFIG_V850))
+#ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
 
 /*
  *	Back compatibility for getrlimit. Needed for some apps.
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 79e7c0906..ae990887f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -218,7 +218,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_OSTYPE,
 		.procname	= "ostype",
 		.data		= system_utsname.sysname,
-		.maxlen		= 64,
+		.maxlen		= sizeof(system_utsname.sysname),
 		.mode		= 0444,
 		.proc_handler	= &proc_doutsstring,
 		.strategy	= &sysctl_string,
@@ -227,7 +227,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_OSRELEASE,
 		.procname	= "osrelease",
 		.data		= system_utsname.release,
-		.maxlen		= 64,
+		.maxlen		= sizeof(system_utsname.release),
 		.mode		= 0444,
 		.proc_handler	= &proc_doutsstring,
 		.strategy	= &sysctl_string,
@@ -236,7 +236,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_VERSION,
 		.procname	= "version",
 		.data		= system_utsname.version,
-		.maxlen		= 64,
+		.maxlen		= sizeof(system_utsname.version),
 		.mode		= 0444,
 		.proc_handler	= &proc_doutsstring,
 		.strategy	= &sysctl_string,
@@ -245,7 +245,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_NODENAME,
 		.procname	= "hostname",
 		.data		= system_utsname.nodename,
-		.maxlen		= 64,
+		.maxlen		= sizeof(system_utsname.nodename),
 		.mode		= 0644,
 		.proc_handler	= &proc_doutsstring,
 		.strategy	= &sysctl_string,
@@ -254,7 +254,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_DOMAINNAME,
 		.procname	= "domainname",
 		.data		= system_utsname.domainname,
-		.maxlen		= 64,
+		.maxlen		= sizeof(system_utsname.domainname),
 		.mode		= 0644,
 		.proc_handler	= &proc_doutsstring,
 		.strategy	= &sysctl_string,
@@ -392,7 +392,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_MODPROBE,
 		.procname	= "modprobe",
 		.data		= &modprobe_path,
-		.maxlen		= 256,
+		.maxlen		= KMOD_PATH_LEN,
 		.mode		= 0644,
 		.proc_handler	= &proc_dostring,
 		.strategy	= &sysctl_string,
@@ -403,7 +403,7 @@ static ctl_table kern_table[] = {
 		.ctl_name	= KERN_HOTPLUG,
 		.procname	= "hotplug",
 		.data		= &hotplug_path,
-		.maxlen		= 256,
+		.maxlen		= KMOD_PATH_LEN,
 		.mode		= 0644,
 		.proc_handler	= &proc_dostring,
 		.strategy	= &sysctl_string,
@@ -738,6 +738,14 @@ static ctl_table vm_table[] = {
 		.extra1		= (void *)&hugetlb_zero,
 		.extra2		= (void *)&hugetlb_infinity,
 	 },
+	 {
+		.ctl_name	= VM_HUGETLB_GROUP,
+		.procname	= "hugetlb_shm_group",
+		.data		= &sysctl_hugetlb_shm_group,
+		.maxlen		= sizeof(gid_t),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	 },
 #endif
 	{
 		.ctl_name	= VM_LOWER_ZONE_PROTECTION,
@@ -1377,7 +1385,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
 			if(copy_to_user(buffer, table->data, len))
 				return -EFAULT;
 		if (len < *lenp) {
-			if(put_user('\n', ((char *) buffer) + len))
+			if(put_user('\n', ((char __user *) buffer) + len))
 				return -EFAULT;
 			len++;
 		}
@@ -1440,6 +1448,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 	size_t left, len;
 	
 	char buf[TMPBUFLEN], *p;
+	char __user *s = buffer;
 	
 	if (!table->data || !table->maxlen || !*lenp ||
 	    (filp->f_pos && !write)) {
@@ -1458,12 +1467,12 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 		if (write) {
 			while (left) {
 				char c;
-				if (get_user(c,(char __user *) buffer))
+				if (get_user(c, s))
 					return -EFAULT;
 				if (!isspace(c))
 					break;
 				left--;
-				buffer++;
+				s++;
 			}
 			if (!left)
 				break;
@@ -1471,7 +1480,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 			len = left;
 			if (len > sizeof(buf) - 1)
 				len = sizeof(buf) - 1;
-			if(copy_from_user(buf, buffer, len))
+			if (copy_from_user(buf, s, len))
 				return -EFAULT;
 			buf[len] = 0;
 			p = buf;
@@ -1489,7 +1498,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 				break;
 			if (neg)
 				val = -val;
-			buffer += len;
+			s += len;
 			left -= len;
 
 			if (conv(&neg, &lval, i, 1, data))
@@ -1506,23 +1515,22 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 			len = strlen(buf);
 			if (len > left)
 				len = left;
-			if(copy_to_user(buffer, buf, len))
+			if(copy_to_user(s, buf, len))
 				return -EFAULT;
 			left -= len;
-			buffer += len;
+			s += len;
 		}
 	}
 
 	if (!write && !first && left) {
-		if(put_user('\n', (char *) buffer))
+		if(put_user('\n', s))
 			return -EFAULT;
-		left--, buffer++;
+		left--, s++;
 	}
 	if (write) {
-		p = (char *) buffer;
 		while (left) {
 			char c;
-			if (get_user(c, p++))
+			if (get_user(c, s++))
 				return -EFAULT;
 			if (!isspace(c))
 				break;
@@ -1679,6 +1687,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 	int vleft, first=1, neg;
 	size_t len, left;
 	char buf[TMPBUFLEN], *p;
+	char __user *s = buffer;
 	
 	if (!table->data || !table->maxlen || !*lenp ||
 	    (filp->f_pos && !write)) {
@@ -1696,12 +1705,12 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 		if (write) {
 			while (left) {
 				char c;
-				if (get_user(c, (char __user *) buffer))
+				if (get_user(c, s))
 					return -EFAULT;
 				if (!isspace(c))
 					break;
 				left--;
-				buffer++;
+				s++;
 			}
 			if (!left)
 				break;
@@ -1709,7 +1718,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 			len = left;
 			if (len > TMPBUFLEN-1)
 				len = TMPBUFLEN-1;
-			if (copy_from_user(buf, buffer, len))
+			if (copy_from_user(buf, s, len))
 				return -EFAULT;
 			buf[len] = 0;
 			p = buf;
@@ -1725,7 +1734,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 				break;
 			if (neg)
 				val = -val;
-			buffer += len;
+			s += len;
 			left -= len;
 
 			if(neg)
@@ -1741,23 +1750,22 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 			len = strlen(buf);
 			if (len > left)
 				len = left;
-			if(copy_to_user(buffer, buf, len))
+			if(copy_to_user(s, buf, len))
 				return -EFAULT;
 			left -= len;
-			buffer += len;
+			s += len;
 		}
 	}
 
 	if (!write && !first && left) {
-		if(put_user('\n', (char *) buffer))
+		if(put_user('\n', s))
 			return -EFAULT;
-		left--, buffer++;
+		left--, s++;
 	}
 	if (write) {
-		p = (char *) buffer;
 		while (left) {
 			char c;
-			if (get_user(c, p++))
+			if (get_user(c, s++))
 				return -EFAULT;
 			if (!isspace(c))
 				break;
@@ -1909,56 +1917,56 @@ int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
 #else /* CONFIG_PROC_FS */
 
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-		  void *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-			    void *buffer, size_t *lenp)
+			    void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-		  void *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-			void *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-		    void *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-		    void *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-		    void *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-		    void *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
 				      struct file *filp,
-				      void *buffer, size_t *lenp)
+				      void __user *buffer, size_t *lenp)
 {
     return -ENOSYS;
 }
@@ -1991,7 +1999,7 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen,
 				len = table->maxlen;
 			if(copy_to_user(oldval, table->data, len))
 				return -EFAULT;
-			if(put_user(0, ((char *) oldval) + len))
+			if(put_user(0, ((char __user *) oldval) + len))
 				return -EFAULT;
 			if(put_user(len, oldlenp))
 				return -EFAULT;
@@ -2019,10 +2027,14 @@ int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
 		void __user *oldval, size_t __user *oldlenp,
 		void __user *newval, size_t newlen, void **context)
 {
-	int i, *vec, *min, *max;
-	size_t length;
 
 	if (newval && newlen) {
+		int __user *vec = (int __user *) newval;
+		int *min = (int *) table->extra1;
+		int *max = (int *) table->extra2;
+		size_t length;
+		int i;
+
 		if (newlen % sizeof(int) != 0)
 			return -EINVAL;
 
@@ -2033,10 +2045,6 @@ int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
 			newlen = table->maxlen;
 		length = newlen / sizeof(int);
 
-		vec = (int *) newval;
-		min = (int *) table->extra1;
-		max = (int *) table->extra2;
-
 		for (i = 0; i < length; i++) {
 			int value;
 			if (get_user(value, vec + i))
@@ -2063,7 +2071,7 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
 			if (olen!=sizeof(int))
 				return -EINVAL; 
 		}
-		if (put_user(*(int *)(table->data) / HZ, (int *)oldval) || 
+		if (put_user(*(int *)(table->data)/HZ, (int __user *)oldval) ||
 		    (oldlenp && put_user(sizeof(int),oldlenp)))
 			return -EFAULT;
 	}
@@ -2071,7 +2079,7 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
 		int new;
 		if (newlen != sizeof(int))
 			return -EINVAL; 
-		if (get_user(new, (int *)newval))
+		if (get_user(new, (int __user *)newval))
 			return -EFAULT;
 		*(int *)(table->data) = new*HZ; 
 	}
@@ -2133,13 +2141,13 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-			  void *buffer, size_t *lenp)
+			  void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-			  void *buffer, size_t *lenp)
+			  void __user *buffer, size_t *lenp)
 {
 	return -ENOSYS;
 }
diff --git a/kernel/time.c b/kernel/time.c
index 142a4bd57..68c22f2bf 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -29,6 +29,7 @@
 #include <linux/errno.h>
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 
 /* 
  * The timezone where the local system is located.  Used as a default by some
@@ -38,7 +39,7 @@ struct timezone sys_tz;
 
 EXPORT_SYMBOL(sys_tz);
 
-#if !defined(__alpha__) && !defined(__ia64__)
+#ifdef __ARCH_WANT_SYS_TIME
 
 /*
  * sys_time() can be implemented in user-level using
@@ -48,7 +49,7 @@ EXPORT_SYMBOL(sys_tz);
  *
  * XXX This function is NOT 64-bit clean!
  */
-asmlinkage long sys_time(int * tloc)
+asmlinkage long sys_time(int __user * tloc)
 {
 	int i;
 	struct timeval tv;
@@ -70,7 +71,7 @@ asmlinkage long sys_time(int * tloc)
  * architectures that need it).
  */
  
-asmlinkage long sys_stime(time_t *tptr)
+asmlinkage long sys_stime(time_t __user *tptr)
 {
 	struct timespec tv;
 
@@ -84,7 +85,7 @@ asmlinkage long sys_stime(time_t *tptr)
 	return 0;
 }
 
-#endif
+#endif /* __ARCH_WANT_SYS_TIME */
 
 asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __user *tz)
 {
diff --git a/kernel/timer.c b/kernel/timer.c
index 08cec6ae7..3a8162b97 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -33,6 +33,7 @@
 #include <linux/cpu.h>
 
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
 #include <asm/div64.h>
 #include <asm/timex.h>
 
@@ -317,10 +318,16 @@ EXPORT_SYMBOL(del_timer);
  *
  * Synchronization rules: callers must prevent restarting of the timer,
  * otherwise this function is meaningless. It must not be called from
- * interrupt contexts. Upon exit the timer is not queued and the handler
- * is not running on any CPU.
+ * interrupt contexts. The caller must not hold locks which would prevent
+ * completion of the timer's handler.  Upon exit the timer is not queued and
+ * the handler is not running on any CPU.
  *
  * The function returns whether it has deactivated a pending timer or not.
+ *
+ * del_timer_sync() is slow and complicated because it copes with timer
+ * handlers which re-arm the timer (periodic timers).  If the timer handler
+ * is known to not do this (a single shot timer) then use
+ * del_singleshot_timer_sync() instead.
  */
 int del_timer_sync(struct timer_list *timer)
 {
@@ -332,7 +339,7 @@ int del_timer_sync(struct timer_list *timer)
 del_again:
 	ret += del_timer(timer);
 
-	for_each_cpu(i) {
+	for_each_online_cpu(i) {
 		base = &per_cpu(tvec_bases, i);
 		if (base->running_timer == timer) {
 			while (base->running_timer == timer) {
@@ -348,8 +355,36 @@ del_again:
 
 	return ret;
 }
-
 EXPORT_SYMBOL(del_timer_sync);
+
+/***
+ * del_singleshot_timer_sync - deactivate a non-recursive timer
+ * @timer: the timer to be deactivated
+ *
+ * This function is an optimization of del_timer_sync for the case where the
+ * caller can guarantee the timer does not reschedule itself in its timer
+ * function.
+ *
+ * Synchronization rules: callers must prevent restarting of the timer,
+ * otherwise this function is meaningless. It must not be called from
+ * interrupt contexts. The caller must not hold locks which wold prevent
+ * completion of the timer's handler.  Upon exit the timer is not queued and
+ * the handler is not running on any CPU.
+ *
+ * The function returns whether it has deactivated a pending timer or not.
+ */
+int del_singleshot_timer_sync(struct timer_list *timer)
+{
+	int ret = del_timer(timer);
+
+	if (!ret) {
+		ret = del_timer_sync(timer);
+		BUG_ON(ret);
+	}
+
+	return ret;
+}
+EXPORT_SYMBOL(del_singleshot_timer_sync);
 #endif
 
 static int cascade(tvec_base_t *base, tvec_t *tv, int index)
@@ -918,7 +953,7 @@ void do_timer(struct pt_regs *regs)
 	update_times();
 }
 
-#if !defined(__alpha__) && !defined(__ia64__)
+#ifdef __ARCH_WANT_SYS_ALARM
 
 /*
  * For backwards compatibility?  This can be done in libc so Alpha
@@ -1109,7 +1144,7 @@ fastcall signed long __sched schedule_timeout(signed long timeout)
 
 	add_timer(&timer);
 	schedule();
-	del_timer_sync(&timer);
+	del_singleshot_timer_sync(&timer);
 
 	timeout = expire - jiffies;
 
@@ -1451,3 +1486,20 @@ unregister_time_interpolator(struct time_interpolator *ti)
 	spin_unlock(&time_interpolator_lock);
 }
 #endif /* CONFIG_TIME_INTERPOLATION */
+
+/**
+ * msleep - sleep safely even with waitqueue interruptions
+ * @msecs: Time in milliseconds to sleep for
+ */
+void msleep(unsigned int msecs)
+{
+	unsigned long timeout = msecs_to_jiffies(msecs);
+
+	while (timeout) {
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		timeout = schedule_timeout(timeout);
+	}
+}
+
+EXPORT_SYMBOL(msleep);
+
diff --git a/kernel/user.c b/kernel/user.c
index f5c9d425a..60e942b8f 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -64,9 +64,20 @@ static inline struct user_struct *uid_hash_find(uid_t uid, struct list_head *has
 	return NULL;
 }
 
+/*
+ * Locate the user_struct for the passed UID.  If found, take a ref on it.  The
+ * caller must undo that ref with free_uid().
+ *
+ * If the user_struct could not be found, return NULL.
+ */
 struct user_struct *find_user(uid_t uid)
 {
-	return uid_hash_find(uid, uidhashentry(uid));
+	struct user_struct *ret;
+
+	spin_lock(&uidhash_lock);
+	ret = uid_hash_find(uid, uidhashentry(uid));
+	spin_unlock(&uidhash_lock);
+	return ret;
 }
 
 void free_uid(struct user_struct *up)
@@ -138,10 +149,7 @@ static int __init uid_cache_init(void)
 	int n;
 
 	uid_cachep = kmem_cache_create("uid_cache", sizeof(struct user_struct),
-				       0,
-				       SLAB_HWCACHE_ALIGN, NULL, NULL);
-	if(!uid_cachep)
-		panic("Cannot create uid taskcount SLAB cache\n");
+			0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
 	for(n = 0; n < UIDHASH_SZ; ++n)
 		INIT_LIST_HEAD(uidhash_table + n);
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 162aca1f4..987fbc298 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -201,22 +201,50 @@ static int worker_thread(void *__cwq)
 	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
 	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
 
+	set_current_state(TASK_INTERRUPTIBLE);
 	while (!kthread_should_stop()) {
-		set_task_state(current, TASK_INTERRUPTIBLE);
-
 		add_wait_queue(&cwq->more_work, &wait);
 		if (list_empty(&cwq->worklist))
 			schedule();
 		else
-			set_task_state(current, TASK_RUNNING);
+			__set_current_state(TASK_RUNNING);
 		remove_wait_queue(&cwq->more_work, &wait);
 
 		if (!list_empty(&cwq->worklist))
 			run_workqueue(cwq);
+		set_current_state(TASK_INTERRUPTIBLE);
 	}
+	__set_current_state(TASK_RUNNING);
 	return 0;
 }
 
+static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
+{
+	if (cwq->thread == current) {
+		/*
+		 * Probably keventd trying to flush its own queue. So simply run
+		 * it by hand rather than deadlocking.
+		 */
+		run_workqueue(cwq);
+	} else {
+		DEFINE_WAIT(wait);
+		long sequence_needed;
+
+		spin_lock_irq(&cwq->lock);
+		sequence_needed = cwq->insert_sequence;
+
+		while (sequence_needed - cwq->remove_sequence > 0) {
+			prepare_to_wait(&cwq->work_done, &wait,
+					TASK_UNINTERRUPTIBLE);
+			spin_unlock_irq(&cwq->lock);
+			schedule();
+			spin_lock_irq(&cwq->lock);
+		}
+		finish_wait(&cwq->work_done, &wait);
+		spin_unlock_irq(&cwq->lock);
+	}
+}
+
 /*
  * flush_workqueue - ensure that any scheduled work has run to completion.
  *
@@ -233,43 +261,19 @@ static int worker_thread(void *__cwq)
  */
 void fastcall flush_workqueue(struct workqueue_struct *wq)
 {
-	struct cpu_workqueue_struct *cwq;
-	int cpu;
-
 	might_sleep();
 
-	lock_cpu_hotplug();
-	for_each_online_cpu(cpu) {
-		DEFINE_WAIT(wait);
-		long sequence_needed;
-
-		if (is_single_threaded(wq))
-			cwq = wq->cpu_wq + 0; /* Always use cpu 0's area. */
-		else
-			cwq = wq->cpu_wq + cpu;
-
-		if (cwq->thread == current) {
-			/*
-			 * Probably keventd trying to flush its own queue.
-			 * So simply run it by hand rather than deadlocking.
-			 */
-			run_workqueue(cwq);
-			continue;
-		}
-		spin_lock_irq(&cwq->lock);
-		sequence_needed = cwq->insert_sequence;
+	if (is_single_threaded(wq)) {
+		/* Always use cpu 0's area. */
+		flush_cpu_workqueue(wq->cpu_wq + 0);
+	} else {
+		int cpu;
 
-		while (sequence_needed - cwq->remove_sequence > 0) {
-			prepare_to_wait(&cwq->work_done, &wait,
-					TASK_UNINTERRUPTIBLE);
-			spin_unlock_irq(&cwq->lock);
-			schedule();
-			spin_lock_irq(&cwq->lock);
-		}
-		finish_wait(&cwq->work_done, &wait);
-		spin_unlock_irq(&cwq->lock);
+		lock_cpu_hotplug();
+		for_each_online_cpu(cpu)
+			flush_cpu_workqueue(wq->cpu_wq + cpu);
+		unlock_cpu_hotplug();
 	}
-	unlock_cpu_hotplug();
 }
 
 static struct task_struct *create_workqueue_thread(struct workqueue_struct *wq,
@@ -324,7 +328,7 @@ struct workqueue_struct *__create_workqueue(const char *name,
 	} else {
 		spin_lock(&workqueue_lock);
 		list_add(&wq->list, &workqueues);
-		spin_unlock_irq(&workqueue_lock);
+		spin_unlock(&workqueue_lock);
 		for_each_online_cpu(cpu) {
 			p = create_workqueue_thread(wq, cpu);
 			if (p) {
@@ -334,6 +338,7 @@ struct workqueue_struct *__create_workqueue(const char *name,
 				destroy = 1;
 		}
 	}
+	unlock_cpu_hotplug();
 
 	/*
 	 * Was there any error during startup? If yes then clean up:
@@ -342,7 +347,6 @@ struct workqueue_struct *__create_workqueue(const char *name,
 		destroy_workqueue(wq);
 		wq = NULL;
 	}
-	unlock_cpu_hotplug();
 	return wq;
 }
 
@@ -376,7 +380,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
 			cleanup_workqueue_thread(wq, cpu);
 		spin_lock(&workqueue_lock);
 		list_del(&wq->list);
-		spin_unlock_irq(&workqueue_lock);
+		spin_unlock(&workqueue_lock);
 	}
 	unlock_cpu_hotplug();
 	kfree(wq);
diff --git a/lib/kobject.c b/lib/kobject.c
index 5e8d1ed70..5c2ade573 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,13 +385,17 @@ EXPORT_SYMBOL(kobject_set_name);
  *	@new_name: object's new name
  */
 
-void kobject_rename(struct kobject * kobj, char *new_name)
+int kobject_rename(struct kobject * kobj, char *new_name)
 {
+	int error = 0;
+
 	kobj = kobject_get(kobj);
 	if (!kobj)
-		return;
-	sysfs_rename_dir(kobj, new_name);
+		return -EINVAL;
+	error = sysfs_rename_dir(kobj, new_name);
 	kobject_put(kobj);
+
+	return error;
 }
 
 /**
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 1d0a884b9..893822769 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -799,9 +799,7 @@ void __init radix_tree_init(void)
 {
 	radix_tree_node_cachep = kmem_cache_create("radix_tree_node",
 			sizeof(struct radix_tree_node), 0,
-			0, radix_tree_node_ctor, NULL);
-	if (!radix_tree_node_cachep)
-		panic ("Failed to create radix_tree_node cache\n");
+			SLAB_PANIC, radix_tree_node_ctor, NULL);
 	radix_tree_init_maxindex();
 	hotcpu_notifier(radix_tree_callback, 0);
 }
diff --git a/lib/rwsem.c b/lib/rwsem.c
index ce15eb013..27dcd95f7 100644
--- a/lib/rwsem.c
+++ b/lib/rwsem.c
@@ -29,15 +29,15 @@ void rwsemtrace(struct rw_semaphore *sem, const char *str)
 
 /*
  * handle the lock being released whilst there are processes blocked on it that can now run
- * - if we come here, then:
- *   - the 'active part' of the count (&0x0000ffff) reached zero but has been re-incremented
+ * - if we come here from up_xxxx(), then:
+ *   - the 'active part' of the count (&0x0000ffff) had reached zero (but may have changed)
  *   - the 'waiting part' of the count (&0xffff0000) is negative (and will still be so)
  *   - there must be someone on the queue
  * - the spinlock must be held by the caller
  * - woken process blocks are discarded from the list after having task zeroed
- * - writers are only woken if wakewrite is non-zero
+ * - writers are only woken if downgrading is false
  */
-static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
+static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
 {
 	struct rwsem_waiter *waiter;
 	struct task_struct *tsk;
@@ -46,10 +46,12 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 
 	rwsemtrace(sem,"Entering __rwsem_do_wake");
 
-	if (!wakewrite)
+	if (downgrading)
 		goto dont_wake_writers;
 
-	/* only wake someone up if we can transition the active part of the count from 0 -> 1 */
+	/* if we came through an up_xxxx() call, we only only wake someone up
+	 * if we can transition the active part of the count from 0 -> 1
+	 */
  try_again:
 	oldcount = rwsem_atomic_update(RWSEM_ACTIVE_BIAS,sem) - RWSEM_ACTIVE_BIAS;
 	if (oldcount & RWSEM_ACTIVE_MASK)
@@ -78,9 +80,10 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 	if (waiter->flags & RWSEM_WAITING_FOR_WRITE)
 		goto out;
 
-	/* grant an infinite number of read locks to the readers at the front of the queue
-	 * - note we increment the 'active part' of the count by the number of readers (less one
-	 *   for the activity decrement we've already done) before waking any processes up
+	/* grant an infinite number of read locks to the readers at the front
+	 * of the queue
+	 * - note we increment the 'active part' of the count by the number of
+	 *   readers before waking any processes up
 	 */
  readers_only:
 	woken = 0;
@@ -95,8 +98,10 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 	} while (waiter->flags & RWSEM_WAITING_FOR_READ);
 
 	loop = woken;
-	woken *= RWSEM_ACTIVE_BIAS-RWSEM_WAITING_BIAS;
-	woken -= RWSEM_ACTIVE_BIAS;
+	woken *= RWSEM_ACTIVE_BIAS - RWSEM_WAITING_BIAS;
+	if (!downgrading)
+		woken -= RWSEM_ACTIVE_BIAS; /* we'd already done one increment
+					     * earlier */
 	rwsem_atomic_add(woken,sem);
 
 	next = sem->wait_list.next;
@@ -150,7 +155,7 @@ static inline struct rw_semaphore *rwsem_down_failed_common(struct rw_semaphore
 	 * - it might even be this process, since the waker takes a more active part
 	 */
 	if (!(count & RWSEM_ACTIVE_MASK))
-		sem = __rwsem_do_wake(sem,1);
+		sem = __rwsem_do_wake(sem, 0);
 
 	spin_unlock(&sem->wait_lock);
 
@@ -201,7 +206,7 @@ struct rw_semaphore fastcall __sched *rwsem_down_write_failed(struct rw_semaphor
 
 /*
  * handle waking up a waiter on the semaphore
- * - up_read has decremented the active part of the count if we come here
+ * - up_read/up_write has decremented the active part of the count if we come here
  */
 struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 {
@@ -211,7 +216,7 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 
 	/* do nothing if list empty */
 	if (!list_empty(&sem->wait_list))
-		sem = __rwsem_do_wake(sem,1);
+		sem = __rwsem_do_wake(sem, 0);
 
 	spin_unlock(&sem->wait_lock);
 
@@ -233,7 +238,7 @@ struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem)
 
 	/* do nothing if list empty */
 	if (!list_empty(&sem->wait_list))
-		sem = __rwsem_do_wake(sem,0);
+		sem = __rwsem_do_wake(sem, 1);
 
 	spin_unlock(&sem->wait_lock);
 
diff --git a/lib/string.c b/lib/string.c
index d2f23f2c1..603c7174f 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -445,8 +445,8 @@ void * memset(void * s,int c,size_t count)
 #ifndef __HAVE_ARCH_BCOPY
 /**
  * bcopy - Copy one area of memory to another
- * @src: Where to copy from
- * @dest: Where to copy to
+ * @srcp: Where to copy from
+ * @destp: Where to copy to
  * @count: The size of the area.
  *
  * Note that this is the same as memcpy(), with the arguments reversed.
diff --git a/mm/Makefile b/mm/Makefile
index 5f3baecd8..d22feb38a 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -8,8 +8,10 @@ mmu-$(CONFIG_MMU)	:= fremap.o highmem.o madvise.o memory.o mincore.o \
 			   shmem.o vmalloc.o
 
 obj-y			:= bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
-			   page_alloc.o page-writeback.o pdflush.o readahead.o \
-			   slab.o swap.o truncate.o vmscan.o $(mmu-y)
+			   page_alloc.o page-writeback.o pdflush.o prio_tree.o \
+			   readahead.o slab.o swap.o truncate.o vmscan.o \
+			   $(mmu-y)
 
 obj-$(CONFIG_SWAP)	+= page_io.o swap_state.o swapfile.o
 obj-$(CONFIG_HUGETLBFS)	+= hugetlb.o
+obj-$(CONFIG_NUMA) 	+= mempolicy.o
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 6eb3f1e5d..86b236af0 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
+#include <linux/module.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 
@@ -25,6 +26,7 @@
  */
 unsigned long max_low_pfn;
 unsigned long min_low_pfn;
+EXPORT_SYMBOL(min_low_pfn);
 unsigned long max_pfn;
 
 /* return the number of _pages_ that will be allocated for the boot bitmap */
@@ -82,14 +84,11 @@ static void __init reserve_bootmem_core(bootmem_data_t *bdata, unsigned long add
 							PAGE_SIZE-1)/PAGE_SIZE;
 	unsigned long end = (addr + size + PAGE_SIZE-1)/PAGE_SIZE;
 
-	if (!size) BUG();
+	BUG_ON(!size);
+	BUG_ON(sidx >= eidx);
+	BUG_ON((addr >> PAGE_SHIFT) >= bdata->node_low_pfn);
+	BUG_ON(end > bdata->node_low_pfn);
 
-	if (sidx >= eidx)
-		BUG();
-	if ((addr >> PAGE_SHIFT) >= bdata->node_low_pfn)
-		BUG();
-	if (end > bdata->node_low_pfn)
-		BUG();
 	for (i = sidx; i < eidx; i++)
 		if (test_and_set_bit(i, bdata->node_bootmem_map)) {
 #ifdef CONFIG_DEBUG_BOOTMEM
@@ -110,9 +109,8 @@ static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
 	unsigned long eidx = (addr + size - bdata->node_boot_start)/PAGE_SIZE;
 	unsigned long end = (addr + size)/PAGE_SIZE;
 
-	if (!size) BUG();
-	if (end > bdata->node_low_pfn)
-		BUG();
+	BUG_ON(!size);
+	BUG_ON(end > bdata->node_low_pfn);
 
 	if (addr < bdata->last_success)
 		bdata->last_success = addr;
@@ -124,7 +122,7 @@ static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
 	sidx = start - (bdata->node_boot_start/PAGE_SIZE);
 
 	for (i = sidx; i < eidx; i++) {
-		if (!test_and_clear_bit(i, bdata->node_bootmem_map))
+		if (unlikely(!test_and_clear_bit(i, bdata->node_bootmem_map)))
 			BUG();
 	}
 }
@@ -140,7 +138,7 @@ static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
  *
  * alignment has to be a power of 2 value.
  *
- * NOTE:  This function is _not_ reenetrant.
+ * NOTE:  This function is _not_ reentrant.
  */
 static void * __init
 __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
@@ -152,7 +150,6 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
 
 	if(!size) {
 		printk("__alloc_bootmem_core(): zero-sized request\n");
-		dump_stack();
 		BUG();
 	}
 	BUG_ON(align & (align-1));
@@ -260,7 +257,7 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat)
 	unsigned long idx;
 	unsigned long *map; 
 
-	if (!bdata->node_bootmem_map) BUG();
+	BUG_ON(!bdata->node_bootmem_map);
 
 	count = 0;
 	/* first extant page of the node */
diff --git a/mm/fadvise.c b/mm/fadvise.c
index e6d1c32d8..f479387a5 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -16,6 +16,8 @@
 #include <linux/pagevec.h>
 #include <linux/fadvise.h>
 
+#include <asm/unistd.h>
+
 /*
  * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
  * deactivate the pages and clear PG_Referenced.
@@ -98,8 +100,11 @@ out:
 	return ret;
 }
 
+#ifdef __ARCH_WANT_SYS_FADVISE64
+
 asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
 {
 	return sys_fadvise64_64(fd, offset, len, advice);
 }
 
+#endif
diff --git a/mm/filemap.c b/mm/filemap.c
index 1abe874e8..6e59faaa6 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -55,17 +55,19 @@
 /*
  * Lock ordering:
  *
- *  ->i_shared_sem		(vmtruncate)
+ *  ->i_mmap_lock		(vmtruncate)
  *    ->private_lock		(__free_pte->__set_page_dirty_buffers)
  *      ->swap_list_lock
  *        ->swap_device_lock	(exclusive_swap_page, others)
  *          ->mapping->tree_lock
  *
  *  ->i_sem
- *    ->i_shared_sem		(truncate->unmap_mapping_range)
+ *    ->i_mmap_lock		(truncate->unmap_mapping_range)
  *
  *  ->mmap_sem
- *    ->i_shared_sem		(various places)
+ *    ->i_mmap_lock
+ *      ->page_table_lock	(various places, mainly in mmap.c)
+ *        ->mapping->tree_lock	(arch-dependent flush_dcache_mmap_lock)
  *
  *  ->mmap_sem
  *    ->lock_page		(access_process_vm)
@@ -121,14 +123,13 @@ static inline int sync_page(struct page *page)
 {
 	struct address_space *mapping;
 
+	/*
+	 * FIXME, fercrissake.  What is this barrier here for?
+	 */
 	smp_mb();
 	mapping = page_mapping(page);
-	if (mapping) {
-		if (mapping->a_ops && mapping->a_ops->sync_page)
-			return mapping->a_ops->sync_page(page);
-	} else if (PageSwapCache(page)) {
-		swap_unplug_io_fn(page);
-	}
+	if (mapping && mapping->a_ops && mapping->a_ops->sync_page)
+		return mapping->a_ops->sync_page(page);
 	return 0;
 }
 
@@ -252,17 +253,15 @@ int add_to_page_cache(struct page *page, struct address_space *mapping,
 	int error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
 
 	if (error == 0) {
-		page_cache_get(page);
 		spin_lock_irq(&mapping->tree_lock);
 		error = radix_tree_insert(&mapping->page_tree, offset, page);
 		if (!error) {
+			page_cache_get(page);
 			SetPageLocked(page);
 			page->mapping = mapping;
 			page->index = offset;
 			mapping->nrpages++;
 			pagecache_acct(1);
-		} else {
-			page_cache_release(page);
 		}
 		spin_unlock_irq(&mapping->tree_lock);
 		radix_tree_preload_end();
@@ -291,6 +290,40 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
  * at a cost of "thundering herd" phenomena during rare hash
  * collisions.
  */
+struct page_wait_queue {
+	struct page *page;
+	int bit;
+	wait_queue_t wait;
+};
+
+static int page_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
+{
+	struct page *page = key;
+	struct page_wait_queue *wq;
+
+	wq = container_of(wait, struct page_wait_queue, wait);
+	if (wq->page != page || test_bit(wq->bit, &page->flags))
+		return 0;
+	else
+		return autoremove_wake_function(wait, mode, sync, NULL);
+}
+
+#define __DEFINE_PAGE_WAIT(name, p, b, f)				\
+	struct page_wait_queue name = {					\
+		.page	= p,						\
+		.bit	= b,						\
+		.wait	= {						\
+			.task	= current,				\
+			.func	= page_wake_function,			\
+			.flags	= f,					\
+			.task_list = LIST_HEAD_INIT(name.wait.task_list),\
+		},							\
+	}
+
+#define DEFINE_PAGE_WAIT(name, p, b)	__DEFINE_PAGE_WAIT(name, p, b, 0)
+#define DEFINE_PAGE_WAIT_EXCLUSIVE(name, p, b)				\
+		__DEFINE_PAGE_WAIT(name, p, b, WQ_FLAG_EXCLUSIVE)
+
 static wait_queue_head_t *page_waitqueue(struct page *page)
 {
 	const struct zone *zone = page_zone(page);
@@ -298,19 +331,28 @@ static wait_queue_head_t *page_waitqueue(struct page *page)
 	return &zone->wait_table[hash_ptr(page, zone->wait_table_bits)];
 }
 
+static void wake_up_page(struct page *page)
+{
+	const unsigned int mode = TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE;
+	wait_queue_head_t *waitqueue = page_waitqueue(page);
+
+	if (waitqueue_active(waitqueue))
+		__wake_up(waitqueue, mode, 1, page);
+}
+
 void fastcall wait_on_page_bit(struct page *page, int bit_nr)
 {
 	wait_queue_head_t *waitqueue = page_waitqueue(page);
-	DEFINE_WAIT(wait);
+	DEFINE_PAGE_WAIT(wait, page, bit_nr);
 
 	do {
-		prepare_to_wait(waitqueue, &wait, TASK_UNINTERRUPTIBLE);
+		prepare_to_wait(waitqueue, &wait.wait, TASK_UNINTERRUPTIBLE);
 		if (test_bit(bit_nr, &page->flags)) {
 			sync_page(page);
 			io_schedule();
 		}
 	} while (test_bit(bit_nr, &page->flags));
-	finish_wait(waitqueue, &wait);
+	finish_wait(waitqueue, &wait.wait);
 }
 
 EXPORT_SYMBOL(wait_on_page_bit);
@@ -332,13 +374,11 @@ EXPORT_SYMBOL(wait_on_page_bit);
  */
 void fastcall unlock_page(struct page *page)
 {
-	wait_queue_head_t *waitqueue = page_waitqueue(page);
 	smp_mb__before_clear_bit();
 	if (!TestClearPageLocked(page))
 		BUG();
 	smp_mb__after_clear_bit(); 
-	if (waitqueue_active(waitqueue))
-		wake_up_all(waitqueue);
+	wake_up_page(page);
 }
 
 EXPORT_SYMBOL(unlock_page);
@@ -349,15 +389,12 @@ EXPORT_SYMBOL(lock_page);
  */
 void end_page_writeback(struct page *page)
 {
-	wait_queue_head_t *waitqueue = page_waitqueue(page);
-
 	if (!TestClearPageReclaim(page) || rotate_reclaimable_page(page)) {
 		if (!test_clear_page_writeback(page))
 			BUG();
 		smp_mb__after_clear_bit();
 	}
-	if (waitqueue_active(waitqueue))
-		wake_up_all(waitqueue);
+	wake_up_page(page);
 }
 
 EXPORT_SYMBOL(end_page_writeback);
@@ -373,16 +410,16 @@ EXPORT_SYMBOL(end_page_writeback);
 void fastcall __lock_page(struct page *page)
 {
 	wait_queue_head_t *wqh = page_waitqueue(page);
-	DEFINE_WAIT(wait);
+	DEFINE_PAGE_WAIT_EXCLUSIVE(wait, page, PG_locked);
 
 	while (TestSetPageLocked(page)) {
-		prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
+		prepare_to_wait_exclusive(wqh, &wait.wait, TASK_UNINTERRUPTIBLE);
 		if (PageLocked(page)) {
 			sync_page(page);
 			io_schedule();
 		}
 	}
-	finish_wait(wqh, &wait);
+	finish_wait(wqh, &wait.wait);
 }
 
 EXPORT_SYMBOL(__lock_page);
@@ -606,7 +643,7 @@ EXPORT_SYMBOL(grab_cache_page_nowait);
  * - note the struct file * is only passed for the use of readpage
  */
 void do_generic_mapping_read(struct address_space *mapping,
-			     struct file_ra_state *ra,
+			     struct file_ra_state *_ra,
 			     struct file * filp,
 			     loff_t *ppos,
 			     read_descriptor_t * desc,
@@ -616,6 +653,7 @@ void do_generic_mapping_read(struct address_space *mapping,
 	unsigned long index, offset;
 	struct page *cached_page;
 	int error;
+	struct file_ra_state ra = *_ra;
 
 	cached_page = NULL;
 	index = *ppos >> PAGE_CACHE_SHIFT;
@@ -638,13 +676,13 @@ void do_generic_mapping_read(struct address_space *mapping,
 		}
 
 		cond_resched();
-		page_cache_readahead(mapping, ra, filp, index);
+		page_cache_readahead(mapping, &ra, filp, index);
 
 		nr = nr - offset;
 find_page:
 		page = find_get_page(mapping, index);
 		if (unlikely(page == NULL)) {
-			handle_ra_miss(mapping, ra, index);
+			handle_ra_miss(mapping, &ra, index);
 			goto no_cached_page;
 		}
 		if (!PageUptodate(page))
@@ -684,9 +722,6 @@ page_ok:
 		break;
 
 page_not_up_to_date:
-		if (PageUptodate(page))
-			goto page_ok;
-
 		/* Get exclusive access to the page ... */
 		lock_page(page);
 
@@ -746,6 +781,8 @@ no_cached_page:
 		goto readpage;
 	}
 
+	*_ra = ra;
+
 	*ppos = ((loff_t) index << PAGE_CACHE_SHIFT) + offset;
 	if (cached_page)
 		page_cache_release(cached_page);
diff --git a/mm/fremap.c b/mm/fremap.c
index 2c8abe6d1..eb056db90 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -36,7 +36,7 @@ static inline void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
 			if (!PageReserved(page)) {
 				if (pte_dirty(pte))
 					set_page_dirty(page);
-				page_remove_rmap(page, ptep);
+				page_remove_rmap(page);
 				page_cache_release(page);
 				mm->rss--;
 			}
@@ -49,7 +49,7 @@ static inline void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
 }
 
 /*
- * Install a page to a given virtual memory address, release any
+ * Install a file page to a given virtual memory address, release any
  * previously existing mapping.
  */
 int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -60,11 +60,13 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t pte_val;
-	struct pte_chain *pte_chain;
 
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain)
-		goto err;
+	/*
+	 * We use page_add_file_rmap below: if install_page is
+	 * ever extended to anonymous pages, this will warn us.
+	 */
+	BUG_ON(!page_mapping(page));
+
 	pgd = pgd_offset(mm, addr);
 	spin_lock(&mm->page_table_lock);
 
@@ -81,18 +83,14 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 	mm->rss++;
 	flush_icache_page(vma, page);
 	set_pte(pte, mk_pte(page, prot));
-	pte_chain = page_add_rmap(page, pte, pte_chain);
+	page_add_file_rmap(page);
 	pte_val = *pte;
 	pte_unmap(pte);
 	update_mmu_cache(vma, addr, pte_val);
-	spin_unlock(&mm->page_table_lock);
-	pte_chain_free(pte_chain);
-	return 0;
 
+	err = 0;
 err_unlock:
 	spin_unlock(&mm->page_table_lock);
-	pte_chain_free(pte_chain);
-err:
 	return err;
 }
 EXPORT_SYMBOL(install_page);
@@ -159,6 +157,7 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 	unsigned long __prot, unsigned long pgoff, unsigned long flags)
 {
 	struct mm_struct *mm = current->mm;
+	struct address_space *mapping;
 	unsigned long end = start + size;
 	struct vm_area_struct *vma;
 	int err = -EINVAL;
@@ -188,16 +187,30 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 	/*
 	 * Make sure the vma is shared, that it supports prefaulting,
 	 * and that the remapped range is valid and fully within
-	 * the single existing vma:
+	 * the single existing vma.  vm_private_data is used as a
+	 * swapout cursor in a VM_NONLINEAR vma (unless VM_RESERVED
+	 * or VM_LOCKED, but VM_LOCKED could be revoked later on).
 	 */
 	if (vma && (vma->vm_flags & VM_SHARED) &&
+		(!vma->vm_private_data || (vma->vm_flags & VM_RESERVED)) &&
 		vma->vm_ops && vma->vm_ops->populate &&
 			end > start && start >= vma->vm_start &&
 				end <= vma->vm_end) {
 
 		/* Must set VM_NONLINEAR before any pages are populated. */
-		if (pgoff != ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff)
+		if (pgoff != linear_page_index(vma, start) &&
+		    !(vma->vm_flags & VM_NONLINEAR)) {
+			mapping = vma->vm_file->f_mapping;
+			spin_lock(&mapping->i_mmap_lock);
+			flush_dcache_mmap_lock(mapping);
 			vma->vm_flags |= VM_NONLINEAR;
+			vma_prio_tree_remove(vma, &mapping->i_mmap);
+			vma_prio_tree_init(vma);
+			list_add_tail(&vma->shared.vm_set.list,
+					&mapping->i_mmap_nonlinear);
+			flush_dcache_mmap_unlock(mapping);
+			spin_unlock(&mapping->i_mmap_lock);
+		}
 
 		/* ->populate can take a long time, so downgrade the lock. */
 		downgrade_write(&mm->mmap_sem);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 6acf0d814..bce0d47a4 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -57,6 +57,7 @@ void free_huge_page(struct page *page)
 	BUG_ON(page_count(page));
 
 	INIT_LIST_HEAD(&page->lru);
+	page[1].mapping = NULL;
 
 	spin_lock(&hugetlb_lock);
 	enqueue_huge_page(page);
@@ -181,7 +182,8 @@ static unsigned long set_max_huge_pages(unsigned long count)
 
 #ifdef CONFIG_SYSCTL
 int hugetlb_sysctl_handler(struct ctl_table *table, int write,
-			   struct file *file, void *buffer, size_t *length)
+			   struct file *file, void __user *buffer,
+			   size_t *length)
 {
 	proc_doulongvec_minmax(table, write, file, buffer, length);
 	max_huge_pages = set_max_huge_pages(max_huge_pages);
diff --git a/mm/madvise.c b/mm/madvise.c
index 81c4ea30c..0439c560e 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -31,7 +31,9 @@ static long madvise_behavior(struct vm_area_struct * vma, unsigned long start,
 			return -EAGAIN;
 	}
 
-	spin_lock(&mm->page_table_lock);
+	/*
+	 * vm_flags is protected by the mmap_sem held in write mode.
+	 */
 	VM_ClearReadHint(vma);
 
 	switch (behavior) {
@@ -44,7 +46,6 @@ static long madvise_behavior(struct vm_area_struct * vma, unsigned long start,
 	default:
 		break;
 	}
-	spin_unlock(&mm->page_table_lock);
 
 	return 0;
 }
@@ -92,16 +93,14 @@ static long madvise_willneed(struct vm_area_struct * vma,
 static long madvise_dontneed(struct vm_area_struct * vma,
 			     unsigned long start, unsigned long end)
 {
-	struct zap_details details;
-
 	if (vma->vm_flags & VM_LOCKED)
 		return -EINVAL;
 
 	if (unlikely(vma->vm_flags & VM_NONLINEAR)) {
-		details.check_mapping = NULL;
-		details.nonlinear_vma = vma;
-		details.first_index = 0;
-		details.last_index = ULONG_MAX;
+		struct zap_details details = {
+			.nonlinear_vma = vma,
+			.last_index = ULONG_MAX,
+		};
 		zap_page_range(vma, start, end - start, &details);
 	} else
 		zap_page_range(vma, start, end - start, NULL);
@@ -170,18 +169,24 @@ static long madvise_vma(struct vm_area_struct * vma, unsigned long start,
  *  -EBADF  - map exists, but area maps something that isn't a file.
  *  -EAGAIN - a kernel resource was temporarily unavailable.
  */
-asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior)
+asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior)
 {
 	unsigned long end;
 	struct vm_area_struct * vma;
 	int unmapped_error = 0;
 	int error = -EINVAL;
+	size_t len;
 
 	down_write(&current->mm->mmap_sem);
 
 	if (start & ~PAGE_MASK)
 		goto out;
-	len = (len + ~PAGE_MASK) & PAGE_MASK;
+	len = (len_in + ~PAGE_MASK) & PAGE_MASK;
+
+	/* Check to see whether len was rounded up from small -ve to zero */
+	if (len_in && !len)
+		goto out;
+
 	end = start + len;
 	if (end < start)
 		goto out;
diff --git a/mm/memory.c b/mm/memory.c
index 5ae7c99ae..3df1f05e7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -48,7 +48,6 @@
 #include <linux/init.h>
 
 #include <asm/pgalloc.h>
-#include <asm/rmap.h>
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
@@ -98,14 +97,14 @@ static inline void free_one_pmd(struct mmu_gather *tlb, pmd_t * dir)
 
 	if (pmd_none(*dir))
 		return;
-	if (pmd_bad(*dir)) {
+	if (unlikely(pmd_bad(*dir))) {
 		pmd_ERROR(*dir);
 		pmd_clear(dir);
 		return;
 	}
 	page = pmd_page(*dir);
 	pmd_clear(dir);
-	pgtable_remove_rmap(page);
+	dec_page_state(nr_page_table_pages);
 	pte_free_tlb(tlb, page);
 }
 
@@ -116,7 +115,7 @@ static inline void free_one_pgd(struct mmu_gather *tlb, pgd_t * dir)
 
 	if (pgd_none(*dir))
 		return;
-	if (pgd_bad(*dir)) {
+	if (unlikely(pgd_bad(*dir))) {
 		pgd_ERROR(*dir);
 		pgd_clear(dir);
 		return;
@@ -164,7 +163,7 @@ pte_t fastcall * pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long a
 			pte_free(new);
 			goto out;
 		}
-		pgtable_add_rmap(new, mm, address);
+		inc_page_state(nr_page_table_pages);
 		pmd_populate(mm, pmd, new);
 	}
 out:
@@ -190,7 +189,6 @@ pte_t fastcall * pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsigned lon
 			pte_free_kernel(new);
 			goto out;
 		}
-		pgtable_add_rmap(virt_to_page(new), mm, address);
 		pmd_populate_kernel(mm, pmd, new);
 	}
 out:
@@ -217,20 +215,10 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
 	unsigned long address = vma->vm_start;
 	unsigned long end = vma->vm_end;
 	unsigned long cow;
-	struct pte_chain *pte_chain = NULL;
 
 	if (is_vm_hugetlb_page(vma))
 		return copy_hugetlb_page_range(dst, src, vma);
 
-	pte_chain = pte_chain_alloc(GFP_ATOMIC | __GFP_NOWARN);
-	if (!pte_chain) {
-		spin_unlock(&dst->page_table_lock);
-		pte_chain = pte_chain_alloc(GFP_KERNEL);
-		spin_lock(&dst->page_table_lock);
-		if (!pte_chain)
-			goto nomem;
-	}
-	
 	cow = (vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE;
 	src_pgd = pgd_offset(src, address)-1;
 	dst_pgd = pgd_offset(dst, address)-1;
@@ -244,7 +232,7 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
 		
 		if (pgd_none(*src_pgd))
 			goto skip_copy_pmd_range;
-		if (pgd_bad(*src_pgd)) {
+		if (unlikely(pgd_bad(*src_pgd))) {
 			pgd_ERROR(*src_pgd);
 			pgd_clear(src_pgd);
 skip_copy_pmd_range:	address = (address + PGDIR_SIZE) & PGDIR_MASK;
@@ -265,7 +253,7 @@ skip_copy_pmd_range:	address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		
 			if (pmd_none(*src_pmd))
 				goto skip_copy_pte_range;
-			if (pmd_bad(*src_pmd)) {
+			if (unlikely(pmd_bad(*src_pmd))) {
 				pmd_ERROR(*src_pmd);
 				pmd_clear(src_pmd);
 skip_copy_pte_range:
@@ -329,32 +317,8 @@ skip_copy_pte_range:
 				pte = pte_mkold(pte);
 				get_page(page);
 				dst->rss++;
-
 				set_pte(dst_pte, pte);
-				pte_chain = page_add_rmap(page, dst_pte,
-							pte_chain);
-				if (pte_chain)
-					goto cont_copy_pte_range_noset;
-				pte_chain = pte_chain_alloc(GFP_ATOMIC | __GFP_NOWARN);
-				if (pte_chain)
-					goto cont_copy_pte_range_noset;
-
-				/*
-				 * pte_chain allocation failed, and we need to
-				 * run page reclaim.
-				 */
-				pte_unmap_nested(src_pte);
-				pte_unmap(dst_pte);
-				spin_unlock(&src->page_table_lock);	
-				spin_unlock(&dst->page_table_lock);	
-				pte_chain = pte_chain_alloc(GFP_KERNEL);
-				spin_lock(&dst->page_table_lock);	
-				if (!pte_chain)
-					goto nomem;
-				spin_lock(&src->page_table_lock);
-				dst_pte = pte_offset_map(dst_pmd, address);
-				src_pte = pte_offset_map_nested(src_pmd,
-								address);
+				page_dup_rmap(page);
 cont_copy_pte_range_noset:
 				address += PAGE_SIZE;
 				if (address >= end) {
@@ -368,7 +332,7 @@ cont_copy_pte_range_noset:
 			pte_unmap_nested(src_pte-1);
 			pte_unmap(dst_pte-1);
 			spin_unlock(&src->page_table_lock);
-		
+			cond_resched_lock(&dst->page_table_lock);
 cont_copy_pmd_range:
 			src_pmd++;
 			dst_pmd++;
@@ -377,10 +341,8 @@ cont_copy_pmd_range:
 out_unlock:
 	spin_unlock(&src->page_table_lock);
 out:
-	pte_chain_free(pte_chain);
 	return 0;
 nomem:
-	pte_chain_free(pte_chain);
 	return -ENOMEM;
 }
 
@@ -393,7 +355,7 @@ static void zap_pte_range(struct mmu_gather *tlb,
 
 	if (pmd_none(*pmd))
 		return;
-	if (pmd_bad(*pmd)) {
+	if (unlikely(pmd_bad(*pmd))) {
 		pmd_ERROR(*pmd);
 		pmd_clear(pmd);
 		return;
@@ -403,6 +365,8 @@ static void zap_pte_range(struct mmu_gather *tlb,
 	if (offset + size > PMD_SIZE)
 		size = PMD_SIZE - offset;
 	size &= PAGE_MASK;
+	if (details && !details->check_mapping && !details->nonlinear_vma)
+		details = NULL;
 	for (offset=0; offset < size; ptep++, offset += PAGE_SIZE) {
 		pte_t pte = *ptep;
 		if (pte_none(pte))
@@ -446,7 +410,7 @@ static void zap_pte_range(struct mmu_gather *tlb,
 			if (pte_young(pte) && page_mapping(page))
 				mark_page_accessed(page);
 			tlb->freed++;
-			page_remove_rmap(page, ptep);
+			page_remove_rmap(page);
 			tlb_remove_page(tlb, page);
 			continue;
 		}
@@ -472,7 +436,7 @@ static void zap_pmd_range(struct mmu_gather *tlb,
 
 	if (pgd_none(*dir))
 		return;
-	if (pgd_bad(*dir)) {
+	if (unlikely(pgd_bad(*dir))) {
 		pgd_ERROR(*dir);
 		pgd_clear(dir);
 		return;
@@ -485,7 +449,7 @@ static void zap_pmd_range(struct mmu_gather *tlb,
 		zap_pte_range(tlb, pmd, address, end - address, details);
 		address = (address + PMD_SIZE) & PMD_MASK; 
 		pmd++;
-	} while (address < end);
+	} while (address && (address < end));
 }
 
 static void unmap_page_range(struct mmu_gather *tlb,
@@ -556,6 +520,7 @@ int unmap_vmas(struct mmu_gather **tlbp, struct mm_struct *mm,
 	unsigned long tlb_start = 0;	/* For tlb_finish_mmu */
 	int tlb_start_valid = 0;
 	int ret = 0;
+	int atomic = details && details->atomic;
 
 	for ( ; vma && vma->vm_start < end_addr; vma = vma->vm_next) {
 		unsigned long start;
@@ -593,7 +558,7 @@ int unmap_vmas(struct mmu_gather **tlbp, struct mm_struct *mm,
 			zap_bytes -= block;
 			if ((long)zap_bytes > 0)
 				continue;
-			if (need_resched()) {
+			if (!atomic && need_resched()) {
 				int fullmm = tlb_is_full_mm(*tlbp);
 				tlb_finish_mmu(*tlbp, tlb_start, start);
 				cond_resched_lock(&mm->page_table_lock);
@@ -621,8 +586,6 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long address,
 	unsigned long end = address + size;
 	unsigned long nr_accounted = 0;
 
-	might_sleep();
-
 	if (is_vm_hugetlb_page(vma)) {
 		zap_hugepage_range(vma, address, size);
 		return;
@@ -654,7 +617,7 @@ follow_page(struct mm_struct *mm, unsigned long address, int write)
 		return page;
 
 	pgd = pgd_offset(mm, address);
-	if (pgd_none(*pgd) || pgd_bad(*pgd))
+	if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
 		goto out;
 
 	pmd = pmd_offset(pgd, address);
@@ -662,7 +625,7 @@ follow_page(struct mm_struct *mm, unsigned long address, int write)
 		goto out;
 	if (pmd_huge(*pmd))
 		return follow_huge_pmd(mm, address, pmd, write);
-	if (pmd_bad(*pmd))
+	if (unlikely(pmd_bad(*pmd)))
 		goto out;
 
 	ptep = pte_offset_map(pmd, address);
@@ -674,15 +637,11 @@ follow_page(struct mm_struct *mm, unsigned long address, int write)
 	if (pte_present(pte)) {
 		if (write && !pte_write(pte))
 			goto out;
-		if (write && !pte_dirty(pte)) {
-			struct page *page = pte_page(pte);
-			if (!PageDirty(page))
-				set_page_dirty(page);
-		}
 		pfn = pte_pfn(pte);
 		if (pfn_valid(pfn)) {
-			struct page *page = pfn_to_page(pfn);
-			
+			page = pfn_to_page(pfn);
+			if (write && !pte_dirty(pte) && !PageDirty(page))
+				set_page_dirty(page);
 			mark_page_accessed(page);
 			return page;
 		}
@@ -719,12 +678,12 @@ untouched_anonymous_page(struct mm_struct* mm, struct vm_area_struct *vma,
 
 	/* Check if page directory entry exists. */
 	pgd = pgd_offset(mm, address);
-	if (pgd_none(*pgd) || pgd_bad(*pgd))
+	if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
 		return 1;
 
 	/* Check if page middle directory entry exists. */
 	pmd = pmd_offset(pgd, address);
-	if (pmd_none(*pmd) || pmd_bad(*pmd))
+	if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
 		return 1;
 
 	/* There is a pte slot for 'address' in 'mm'. */
@@ -1070,7 +1029,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 {
 	struct page *old_page, *new_page;
 	unsigned long pfn = pte_pfn(pte);
-	struct pte_chain *pte_chain;
 	pte_t entry;
 
 	if (unlikely(!pfn_valid(pfn))) {
@@ -1094,7 +1052,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 			flush_cache_page(vma, address);
 			entry = maybe_mkwrite(pte_mkyoung(pte_mkdirty(pte)),
 					      vma);
-			ptep_establish(vma, address, page_table, entry);
+			ptep_set_access_flags(vma, address, page_table, entry, 1);
 			update_mmu_cache(vma, address, entry);
 			pte_unmap(page_table);
 			spin_unlock(&mm->page_table_lock);
@@ -1109,10 +1067,9 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 	page_cache_get(old_page);
 	spin_unlock(&mm->page_table_lock);
 
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain)
-		goto no_pte_chain;
-	new_page = alloc_page(GFP_HIGHUSER);
+	if (unlikely(anon_vma_prepare(vma)))
+		goto no_new_page;
+	new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);
 	if (!new_page)
 		goto no_new_page;
 	copy_cow_page(old_page,new_page,address);
@@ -1122,13 +1079,14 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 	 */
 	spin_lock(&mm->page_table_lock);
 	page_table = pte_offset_map(pmd, address);
-	if (pte_same(*page_table, pte)) {
+	if (likely(pte_same(*page_table, pte))) {
 		if (PageReserved(old_page))
 			++mm->rss;
-		page_remove_rmap(old_page, page_table);
+		else
+			page_remove_rmap(old_page);
 		break_cow(vma, new_page, address, page_table);
-		pte_chain = page_add_rmap(new_page, page_table, pte_chain);
 		lru_cache_add_active(new_page);
+		page_add_anon_rmap(new_page, vma, address);
 
 		/* Free the old page.. */
 		new_page = old_page;
@@ -1137,12 +1095,9 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 	page_cache_release(new_page);
 	page_cache_release(old_page);
 	spin_unlock(&mm->page_table_lock);
-	pte_chain_free(pte_chain);
 	return VM_FAULT_MINOR;
 
 no_new_page:
-	pte_chain_free(pte_chain);
-no_pte_chain:
 	page_cache_release(old_page);
 	return VM_FAULT_OOM;
 }
@@ -1150,25 +1105,18 @@ no_pte_chain:
 /*
  * Helper function for unmap_mapping_range().
  */
-static void unmap_mapping_range_list(struct list_head *head,
-				     struct zap_details *details)
+static inline void unmap_mapping_range_list(struct prio_tree_root *root,
+					    struct zap_details *details)
 {
-	struct vm_area_struct *vma;
+	struct vm_area_struct *vma = NULL;
+	struct prio_tree_iter iter;
 	pgoff_t vba, vea, zba, zea;
 
-	list_for_each_entry(vma, head, shared) {
-		if (unlikely(vma->vm_flags & VM_NONLINEAR)) {
-			details->nonlinear_vma = vma;
-			zap_page_range(vma, vma->vm_start,
-				vma->vm_end - vma->vm_start, details);
-			details->nonlinear_vma = NULL;
-			continue;
-		}
+	while ((vma = vma_prio_tree_next(vma, root, &iter,
+			details->first_index, details->last_index)) != NULL) {
 		vba = vma->vm_pgoff;
 		vea = vba + ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) - 1;
 		/* Assume for now that PAGE_CACHE_SHIFT == PAGE_SHIFT */
-		if (vba > details->last_index || vea < details->first_index)
-			continue;	/* Mapping disjoint from hole. */
 		zba = details->first_index;
 		if (zba < vba)
 			zba = vba;
@@ -1177,8 +1125,7 @@ static void unmap_mapping_range_list(struct list_head *head,
 			zea = vea;
 		zap_page_range(vma,
 			((zba - vba) << PAGE_SHIFT) + vma->vm_start,
-			(zea - zba + 1) << PAGE_SHIFT,
-			details->check_mapping? details: NULL);
+			(zea - zba + 1) << PAGE_SHIFT, details);
 	}
 }
 
@@ -1199,7 +1146,7 @@ static void unmap_mapping_range_list(struct list_head *head,
  * but 0 when invalidating pagecache, don't throw away private data.
  */
 void unmap_mapping_range(struct address_space *mapping,
-	loff_t const holebegin, loff_t const holelen, int even_cows)
+		loff_t const holebegin, loff_t const holelen, int even_cows)
 {
 	struct zap_details details;
 	pgoff_t hba = holebegin >> PAGE_SHIFT;
@@ -1217,21 +1164,33 @@ void unmap_mapping_range(struct address_space *mapping,
 	details.nonlinear_vma = NULL;
 	details.first_index = hba;
 	details.last_index = hba + hlen - 1;
+	details.atomic = 1;	/* A spinlock is held */
 	if (details.last_index < details.first_index)
 		details.last_index = ULONG_MAX;
 
-	down(&mapping->i_shared_sem);
+	spin_lock(&mapping->i_mmap_lock);
 	/* Protect against page fault */
 	atomic_inc(&mapping->truncate_count);
-	if (unlikely(!list_empty(&mapping->i_mmap)))
-		unmap_mapping_range_list(&mapping->i_mmap, &details);
 
-	/* Don't waste time to check mapping on fully shared vmas */
-	details.check_mapping = NULL;
+	if (unlikely(!prio_tree_empty(&mapping->i_mmap)))
+		unmap_mapping_range_list(&mapping->i_mmap, &details);
 
-	if (unlikely(!list_empty(&mapping->i_mmap_shared)))
-		unmap_mapping_range_list(&mapping->i_mmap_shared, &details);
-	up(&mapping->i_shared_sem);
+	/*
+	 * In nonlinear VMAs there is no correspondence between virtual address
+	 * offset and file offset.  So we must perform an exhaustive search
+	 * across *all* the pages in each nonlinear VMA, not just the pages
+	 * whose virtual address lies outside the file truncation point.
+	 */
+	if (unlikely(!list_empty(&mapping->i_mmap_nonlinear))) {
+		struct vm_area_struct *vma;
+		list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
+						shared.vm_set.list) {
+			details.nonlinear_vma = vma;
+			zap_page_range(vma, vma->vm_start,
+				vma->vm_end - vma->vm_start, &details);
+		}
+	}
+	spin_unlock(&mapping->i_mmap_lock);
 }
 EXPORT_SYMBOL(unmap_mapping_range);
 
@@ -1280,9 +1239,17 @@ EXPORT_SYMBOL(vmtruncate);
  * (1 << page_cluster) entries in the swap area. This method is chosen
  * because it doesn't cost us any seek time.  We also make sure to queue
  * the 'original' request together with the readahead ones...  
+ *
+ * This has been extended to use the NUMA policies from the mm triggering
+ * the readahead.
+ *
+ * Caller must hold down_read on the vma->vm_mm if vma is not NULL.
  */
-void swapin_readahead(swp_entry_t entry)
+void swapin_readahead(swp_entry_t entry, unsigned long addr,struct vm_area_struct *vma)
 {
+#ifdef CONFIG_NUMA
+	struct vm_area_struct *next_vma = vma ? vma->vm_next : NULL;
+#endif
 	int i, num;
 	struct page *new_page;
 	unsigned long offset;
@@ -1294,10 +1261,31 @@ void swapin_readahead(swp_entry_t entry)
 	for (i = 0; i < num; offset++, i++) {
 		/* Ok, do the async read-ahead now */
 		new_page = read_swap_cache_async(swp_entry(swp_type(entry),
-						offset));
+							   offset), vma, addr);
 		if (!new_page)
 			break;
 		page_cache_release(new_page);
+#ifdef CONFIG_NUMA
+		/*
+		 * Find the next applicable VMA for the NUMA policy.
+		 */
+		addr += PAGE_SIZE;
+		if (addr == 0)
+			vma = NULL;
+		if (vma) {
+			if (addr >= vma->vm_end) {
+				vma = next_vma;
+				next_vma = vma ? vma->vm_next : NULL;
+			}
+			if (vma && addr < vma->vm_start)
+				vma = NULL;
+		} else {
+			if (next_vma && addr >= next_vma->vm_start) {
+				vma = next_vma;
+				next_vma = vma->vm_next;
+			}
+		}
+#endif
 	}
 	lru_add_drain();	/* Push any new pages onto the LRU now */
 }
@@ -1314,14 +1302,13 @@ static int do_swap_page(struct mm_struct * mm,
 	swp_entry_t entry = pte_to_swp_entry(orig_pte);
 	pte_t pte;
 	int ret = VM_FAULT_MINOR;
-	struct pte_chain *pte_chain = NULL;
 
 	pte_unmap(page_table);
 	spin_unlock(&mm->page_table_lock);
 	page = lookup_swap_cache(entry);
 	if (!page) {
-		swapin_readahead(entry);
-		page = read_swap_cache_async(entry);
+ 		swapin_readahead(entry, address, vma);
+ 		page = read_swap_cache_async(entry, vma, address);
 		if (!page) {
 			/*
 			 * Back out if somebody else faulted in this pte while
@@ -1329,7 +1316,7 @@ static int do_swap_page(struct mm_struct * mm,
 			 */
 			spin_lock(&mm->page_table_lock);
 			page_table = pte_offset_map(pmd, address);
-			if (pte_same(*page_table, orig_pte))
+			if (likely(pte_same(*page_table, orig_pte)))
 				ret = VM_FAULT_OOM;
 			else
 				ret = VM_FAULT_MINOR;
@@ -1344,11 +1331,6 @@ static int do_swap_page(struct mm_struct * mm,
 	}
 
 	mark_page_accessed(page);
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain) {
-		ret = VM_FAULT_OOM;
-		goto out;
-	}
 	lock_page(page);
 
 	/*
@@ -1357,7 +1339,7 @@ static int do_swap_page(struct mm_struct * mm,
 	 */
 	spin_lock(&mm->page_table_lock);
 	page_table = pte_offset_map(pmd, address);
-	if (!pte_same(*page_table, orig_pte)) {
+	if (unlikely(!pte_same(*page_table, orig_pte))) {
 		pte_unmap(page_table);
 		spin_unlock(&mm->page_table_lock);
 		unlock_page(page);
@@ -1374,20 +1356,28 @@ static int do_swap_page(struct mm_struct * mm,
 
 	mm->rss++;
 	pte = mk_pte(page, vma->vm_page_prot);
-	if (write_access && can_share_swap_page(page))
+	if (write_access && can_share_swap_page(page)) {
 		pte = maybe_mkwrite(pte_mkdirty(pte), vma);
+		write_access = 0;
+	}
 	unlock_page(page);
 
 	flush_icache_page(vma, page);
 	set_pte(page_table, pte);
-	pte_chain = page_add_rmap(page, page_table, pte_chain);
+	page_add_anon_rmap(page, vma, address);
+
+	if (write_access) {
+		if (do_wp_page(mm, vma, address,
+				page_table, pmd, pte) == VM_FAULT_OOM)
+			ret = VM_FAULT_OOM;
+		goto out;
+	}
 
 	/* No need to invalidate - it was non-present before */
 	update_mmu_cache(vma, address, pte);
 	pte_unmap(page_table);
 	spin_unlock(&mm->page_table_lock);
 out:
-	pte_chain_free(pte_chain);
 	return ret;
 }
 
@@ -1403,20 +1393,7 @@ do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
 {
 	pte_t entry;
 	struct page * page = ZERO_PAGE(addr);
-	struct pte_chain *pte_chain;
-	int ret;
 
-	pte_chain = pte_chain_alloc(GFP_ATOMIC | __GFP_NOWARN);
-	if (!pte_chain) {
-		pte_unmap(page_table);
-		spin_unlock(&mm->page_table_lock);
-		pte_chain = pte_chain_alloc(GFP_KERNEL);
-		if (!pte_chain)
-			goto no_mem;
-		spin_lock(&mm->page_table_lock);
-		page_table = pte_offset_map(pmd, addr);
-	}
-		
 	/* Read-only mapping of ZERO_PAGE. */
 	entry = pte_wrprotect(mk_pte(ZERO_PAGE(addr), vma->vm_page_prot));
 
@@ -1426,7 +1403,9 @@ do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
 		pte_unmap(page_table);
 		spin_unlock(&mm->page_table_lock);
 
-		page = alloc_page(GFP_HIGHUSER);
+		if (unlikely(anon_vma_prepare(vma)))
+			goto no_mem;
+		page = alloc_page_vma(GFP_HIGHUSER, vma, addr);
 		if (!page)
 			goto no_mem;
 		clear_user_highpage(page, addr);
@@ -1438,7 +1417,6 @@ do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
 			pte_unmap(page_table);
 			page_cache_release(page);
 			spin_unlock(&mm->page_table_lock);
-			ret = VM_FAULT_MINOR;
 			goto out;
 		}
 		mm->rss++;
@@ -1447,24 +1425,19 @@ do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
 				      vma);
 		lru_cache_add_active(page);
 		mark_page_accessed(page);
+		page_add_anon_rmap(page, vma, addr);
 	}
 
 	set_pte(page_table, entry);
-	/* ignores ZERO_PAGE */
-	pte_chain = page_add_rmap(page, page_table, pte_chain);
 	pte_unmap(page_table);
 
 	/* No need to invalidate - it was non-present before */
 	update_mmu_cache(vma, addr, entry);
 	spin_unlock(&mm->page_table_lock);
-	ret = VM_FAULT_MINOR;
-	goto out;
-
-no_mem:
-	ret = VM_FAULT_OOM;
 out:
-	pte_chain_free(pte_chain);
-	return ret;
+	return VM_FAULT_MINOR;
+no_mem:
+	return VM_FAULT_OOM;
 }
 
 /*
@@ -1486,9 +1459,9 @@ do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
 	struct page * new_page;
 	struct address_space *mapping = NULL;
 	pte_t entry;
-	struct pte_chain *pte_chain;
 	int sequence = 0;
 	int ret = VM_FAULT_MINOR;
+	int anon = 0;
 
 	if (!vma->vm_ops || !vma->vm_ops->nopage)
 		return do_anonymous_page(mm, vma, page_table,
@@ -1510,21 +1483,21 @@ retry:
 	if (new_page == NOPAGE_OOM)
 		return VM_FAULT_OOM;
 
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain)
-		goto oom;
-
 	/*
 	 * Should we do an early C-O-W break?
 	 */
 	if (write_access && !(vma->vm_flags & VM_SHARED)) {
-		struct page * page = alloc_page(GFP_HIGHUSER);
+		struct page *page;
+
+		if (unlikely(anon_vma_prepare(vma)))
+			goto oom;
+		page = alloc_page_vma(GFP_HIGHUSER, vma, address);
 		if (!page)
 			goto oom;
 		copy_user_highpage(page, new_page, address);
 		page_cache_release(new_page);
-		lru_cache_add_active(page);
 		new_page = page;
+		anon = 1;
 	}
 
 	spin_lock(&mm->page_table_lock);
@@ -1538,7 +1511,6 @@ retry:
 		sequence = atomic_read(&mapping->truncate_count);
 		spin_unlock(&mm->page_table_lock);
 		page_cache_release(new_page);
-		pte_chain_free(pte_chain);
 		goto retry;
 	}
 	page_table = pte_offset_map(pmd, address);
@@ -1562,7 +1534,11 @@ retry:
 		if (write_access)
 			entry = maybe_mkwrite(pte_mkdirty(entry), vma);
 		set_pte(page_table, entry);
-		pte_chain = page_add_rmap(new_page, page_table, pte_chain);
+		if (anon) {
+			lru_cache_add_active(new_page);
+			page_add_anon_rmap(new_page, vma, address);
+		} else
+			page_add_file_rmap(new_page);
 		pte_unmap(page_table);
 	} else {
 		/* One of our sibling threads was faster, back out. */
@@ -1575,13 +1551,12 @@ retry:
 	/* no need to invalidate: a not-present page shouldn't be cached */
 	update_mmu_cache(vma, address, entry);
 	spin_unlock(&mm->page_table_lock);
-	goto out;
+out:
+	return ret;
 oom:
 	page_cache_release(new_page);
 	ret = VM_FAULT_OOM;
-out:
-	pte_chain_free(pte_chain);
-	return ret;
+	goto out;
 }
 
 /*
@@ -1667,7 +1642,7 @@ static inline int handle_pte_fault(struct mm_struct *mm,
 		entry = pte_mkdirty(entry);
 	}
 	entry = pte_mkyoung(entry);
-	ptep_establish(vma, address, pte, entry);
+	ptep_set_access_flags(vma, address, pte, entry, write_access);
 	update_mmu_cache(vma, address, entry);
 	pte_unmap(pte);
 	spin_unlock(&mm->page_table_lock);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index a62a65c2e..1b11685f0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -61,6 +61,7 @@
 
 #include <linux/mempolicy.h>
 #include <linux/mm.h>
+#include <linux/highmem.h>
 #include <linux/hugetlb.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
diff --git a/mm/mincore.c b/mm/mincore.c
index 379a277fd..eac70dbc4 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -124,7 +124,7 @@ asmlinkage long sys_mincore(unsigned long start, size_t len,
 		goto out;
 
 	error = -EFAULT;
-	if (!access_ok(VERIFY_WRITE, (unsigned long) vec, len >> PAGE_SHIFT))
+	if (!access_ok(VERIFY_WRITE, vec, len >> PAGE_SHIFT))
 		goto out;
 
 	error = 0;
diff --git a/mm/mlock.c b/mm/mlock.c
index 0cf446b5f..a9e37161d 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -32,10 +32,13 @@ static int mlock_fixup(struct vm_area_struct * vma,
 			goto out;
 		}
 	}
-	
-	spin_lock(&mm->page_table_lock);
+
+	/*
+	 * vm_flags is protected by the mmap_sem held in write mode.
+	 * It's okay if try_to_unmap_one unmaps a page just after we
+	 * set VM_LOCKED, make_pages_present below will bring it back.
+	 */
 	vma->vm_flags = newflags;
-	spin_unlock(&mm->page_table_lock);
 
 	/*
 	 * Keep track of amount of locked VM.
diff --git a/mm/mmap.c b/mm/mmap.c
index bbdcb91d4..d6fd2fe13 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -21,9 +21,12 @@
 #include <linux/profile.h>
 #include <linux/module.h>
 #include <linux/mount.h>
+#include <linux/mempolicy.h>
+#include <linux/rmap.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
+#include <asm/cacheflush.h>
 #include <asm/tlb.h>
 
 /*
@@ -63,31 +66,44 @@ EXPORT_SYMBOL(sysctl_max_map_count);
 EXPORT_SYMBOL(vm_committed_space);
 
 /*
- * Requires inode->i_mapping->i_shared_sem
+ * Requires inode->i_mapping->i_mmap_lock
  */
-static inline void
-__remove_shared_vm_struct(struct vm_area_struct *vma, struct inode *inode)
+static void __remove_shared_vm_struct(struct vm_area_struct *vma,
+		struct file *file, struct address_space *mapping)
 {
-	if (inode) {
-		if (vma->vm_flags & VM_DENYWRITE)
-			atomic_inc(&inode->i_writecount);
-		list_del_init(&vma->shared);
-	}
+	if (vma->vm_flags & VM_DENYWRITE)
+		atomic_inc(&file->f_dentry->d_inode->i_writecount);
+	if (vma->vm_flags & VM_SHARED)
+		mapping->i_mmap_writable--;
+
+	flush_dcache_mmap_lock(mapping);
+	if (unlikely(vma->vm_flags & VM_NONLINEAR))
+		list_del_init(&vma->shared.vm_set.list);
+	else
+		vma_prio_tree_remove(vma, &mapping->i_mmap);
+	flush_dcache_mmap_unlock(mapping);
 }
 
 /*
- * Remove one vm structure from the inode's i_mapping address space.
+ * Remove one vm structure and free it.
  */
-static void remove_shared_vm_struct(struct vm_area_struct *vma)
+static void remove_vm_struct(struct vm_area_struct *vma)
 {
 	struct file *file = vma->vm_file;
 
 	if (file) {
 		struct address_space *mapping = file->f_mapping;
-		down(&mapping->i_shared_sem);
-		__remove_shared_vm_struct(vma, file->f_dentry->d_inode);
-		up(&mapping->i_shared_sem);
+		spin_lock(&mapping->i_mmap_lock);
+		__remove_shared_vm_struct(vma, file, mapping);
+		spin_unlock(&mapping->i_mmap_lock);
 	}
+	if (vma->vm_ops && vma->vm_ops->close)
+		vma->vm_ops->close(vma);
+	if (file)
+		fput(file);
+	anon_vma_unlink(vma);
+	mpol_free(vma_policy(vma));
+	kmem_cache_free(vm_area_cachep, vma);
 }
 
 /*
@@ -140,10 +156,10 @@ out:
 }
 
 #ifdef DEBUG_MM_RB
-static int browse_rb(struct rb_root *root) {
-	int i, j;
+static int browse_rb(struct rb_root *root)
+{
+	int i = 0, j;
 	struct rb_node *nd, *pn = NULL;
-	i = 0;
 	unsigned long prev = 0, pend = 0;
 
 	for (nd = rb_first(root); nd; nd = rb_next(nd)) {
@@ -167,10 +183,11 @@ static int browse_rb(struct rb_root *root) {
 	return i;
 }
 
-void validate_mm(struct mm_struct * mm) {
+void validate_mm(struct mm_struct *mm)
+{
 	int bug = 0;
 	int i = 0;
-	struct vm_area_struct * tmp = mm->mmap;
+	struct vm_area_struct *tmp = mm->mmap;
 	while (tmp) {
 		tmp = tmp->vm_next;
 		i++;
@@ -258,11 +275,16 @@ static inline void __vma_link_file(struct vm_area_struct *vma)
 
 		if (vma->vm_flags & VM_DENYWRITE)
 			atomic_dec(&file->f_dentry->d_inode->i_writecount);
-
 		if (vma->vm_flags & VM_SHARED)
-			list_add_tail(&vma->shared, &mapping->i_mmap_shared);
+			mapping->i_mmap_writable++;
+
+		flush_dcache_mmap_lock(mapping);
+		if (unlikely(vma->vm_flags & VM_NONLINEAR))
+			list_add_tail(&vma->shared.vm_set.list,
+					&mapping->i_mmap_nonlinear);
 		else
-			list_add_tail(&vma->shared, &mapping->i_mmap);
+			vma_prio_tree_insert(vma, &mapping->i_mmap);
+		flush_dcache_mmap_unlock(mapping);
 	}
 }
 
@@ -273,7 +295,7 @@ __vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
 {
 	__vma_link_list(mm, vma, prev, rb_parent);
 	__vma_link_rb(mm, vma, rb_link, rb_parent);
-	__vma_link_file(vma);
+	__anon_vma_link(vma);
 }
 
 static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -286,12 +308,15 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
 		mapping = vma->vm_file->f_mapping;
 
 	if (mapping)
-		down(&mapping->i_shared_sem);
-	spin_lock(&mm->page_table_lock);
+		spin_lock(&mapping->i_mmap_lock);
+	anon_vma_lock(vma);
+
 	__vma_link(mm, vma, prev, rb_link, rb_parent);
-	spin_unlock(&mm->page_table_lock);
+	__vma_link_file(vma);
+
+	anon_vma_unlock(vma);
 	if (mapping)
-		up(&mapping->i_shared_sem);
+		spin_unlock(&mapping->i_mmap_lock);
 
 	mark_mm_hugetlb(mm, vma);
 	mm->map_count++;
@@ -299,9 +324,9 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
 }
 
 /*
- * Insert vm structure into process list sorted by address and into the inode's
- * i_mmap ring. The caller should hold mm->page_table_lock and
- * ->f_mappping->i_shared_sem if vm_file is non-NULL.
+ * Helper for vma_adjust in the split_vma insert case:
+ * insert vm structure into list and rbtree and anon_vma,
+ * but it has already been inserted into prio_tree earlier.
  */
 static void
 __insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
@@ -313,8 +338,156 @@ __insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
 	if (__vma && __vma->vm_start < vma->vm_end)
 		BUG();
 	__vma_link(mm, vma, prev, rb_link, rb_parent);
-	mark_mm_hugetlb(mm, vma);
 	mm->map_count++;
+}
+
+static inline void
+__vma_unlink(struct mm_struct *mm, struct vm_area_struct *vma,
+		struct vm_area_struct *prev)
+{
+	prev->vm_next = vma->vm_next;
+	rb_erase(&vma->vm_rb, &mm->mm_rb);
+	if (mm->mmap_cache == vma)
+		mm->mmap_cache = prev;
+}
+
+/*
+ * We cannot adjust vm_start, vm_end, vm_pgoff fields of a vma that
+ * is already present in an i_mmap tree without adjusting the tree.
+ * The following helper function should be used when such adjustments
+ * are necessary.  The "insert" vma (if any) is to be inserted
+ * before we drop the necessary locks.
+ */
+void vma_adjust(struct vm_area_struct *vma, unsigned long start,
+	unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert)
+{
+	struct mm_struct *mm = vma->vm_mm;
+	struct vm_area_struct *next = vma->vm_next;
+	struct address_space *mapping = NULL;
+	struct prio_tree_root *root = NULL;
+	struct file *file = vma->vm_file;
+	struct anon_vma *anon_vma = NULL;
+	long adjust_next = 0;
+	int remove_next = 0;
+
+	if (next && !insert) {
+		if (end >= next->vm_end) {
+			/*
+			 * vma expands, overlapping all the next, and
+			 * perhaps the one after too (mprotect case 6).
+			 */
+again:			remove_next = 1 + (end > next->vm_end);
+			end = next->vm_end;
+			anon_vma = next->anon_vma;
+		} else if (end > next->vm_start) {
+			/*
+			 * vma expands, overlapping part of the next:
+			 * mprotect case 5 shifting the boundary up.
+			 */
+			adjust_next = (end - next->vm_start) >> PAGE_SHIFT;
+			anon_vma = next->anon_vma;
+		} else if (end < vma->vm_end) {
+			/*
+			 * vma shrinks, and !insert tells it's not
+			 * split_vma inserting another: so it must be
+			 * mprotect case 4 shifting the boundary down.
+			 */
+			adjust_next = - ((vma->vm_end - end) >> PAGE_SHIFT);
+			anon_vma = next->anon_vma;
+		}
+	}
+
+	if (file) {
+		mapping = file->f_mapping;
+		if (!(vma->vm_flags & VM_NONLINEAR))
+			root = &mapping->i_mmap;
+		spin_lock(&mapping->i_mmap_lock);
+		if (insert) {
+			/*
+			 * Put into prio_tree now, so instantiated pages
+			 * are visible to arm/parisc __flush_dcache_page
+			 * throughout; but we cannot insert into address
+			 * space until vma start or end is updated.
+			 */
+			__vma_link_file(insert);
+		}
+	}
+
+	/*
+	 * When changing only vma->vm_end, we don't really need
+	 * anon_vma lock: but is that case worth optimizing out?
+	 */
+	if (vma->anon_vma)
+		anon_vma = vma->anon_vma;
+	if (anon_vma)
+		spin_lock(&anon_vma->lock);
+
+	if (root) {
+		flush_dcache_mmap_lock(mapping);
+		vma_prio_tree_remove(vma, root);
+		if (adjust_next)
+			vma_prio_tree_remove(next, root);
+	}
+
+	vma->vm_start = start;
+	vma->vm_end = end;
+	vma->vm_pgoff = pgoff;
+	if (adjust_next) {
+		next->vm_start += adjust_next << PAGE_SHIFT;
+		next->vm_pgoff += adjust_next;
+	}
+
+	if (root) {
+		if (adjust_next) {
+			vma_prio_tree_init(next);
+			vma_prio_tree_insert(next, root);
+		}
+		vma_prio_tree_init(vma);
+		vma_prio_tree_insert(vma, root);
+		flush_dcache_mmap_unlock(mapping);
+	}
+
+	if (remove_next) {
+		/*
+		 * vma_merge has merged next into vma, and needs
+		 * us to remove next before dropping the locks.
+		 */
+		__vma_unlink(mm, next, vma);
+		if (file)
+			__remove_shared_vm_struct(next, file, mapping);
+		if (next->anon_vma)
+			__anon_vma_merge(vma, next);
+	} else if (insert) {
+		/*
+		 * split_vma has split insert from vma, and needs
+		 * us to insert it before dropping the locks
+		 * (it may either follow vma or precede it).
+		 */
+		__insert_vm_struct(mm, insert);
+	}
+
+	if (anon_vma)
+		spin_unlock(&anon_vma->lock);
+	if (mapping)
+		spin_unlock(&mapping->i_mmap_lock);
+
+	if (remove_next) {
+		if (file)
+			fput(file);
+		mm->map_count--;
+		mpol_free(vma_policy(next));
+		kmem_cache_free(vm_area_cachep, next);
+		/*
+		 * In mprotect's case 6 (see comments on vma_merge),
+		 * we must remove another next too. It would clutter
+		 * up the code too much to do both in one go.
+		 */
+		if (remove_next == 2) {
+			next = vma->vm_next;
+			goto again;
+		}
+	}
+
 	validate_mm(mm);
 }
 
@@ -327,155 +500,227 @@ __insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
 static inline int is_mergeable_vma(struct vm_area_struct *vma,
 			struct file *file, unsigned long vm_flags)
 {
-	if (vma->vm_ops && vma->vm_ops->close)
+	if (vma->vm_flags != vm_flags)
 		return 0;
 	if (vma->vm_file != file)
 		return 0;
-	if (vma->vm_flags != vm_flags)
-		return 0;
-	if (vma->vm_private_data)
+	if (vma->vm_ops && vma->vm_ops->close)
 		return 0;
 	return 1;
 }
 
+static inline int is_mergeable_anon_vma(struct anon_vma *anon_vma1,
+					struct anon_vma *anon_vma2)
+{
+	return !anon_vma1 || !anon_vma2 || (anon_vma1 == anon_vma2);
+}
+
 /*
- * Return true if we can merge this (vm_flags,file,vm_pgoff,size)
+ * Return true if we can merge this (vm_flags,anon_vma,file,vm_pgoff)
  * in front of (at a lower virtual address and file offset than) the vma.
  *
+ * We cannot merge two vmas if they have differently assigned (non-NULL)
+ * anon_vmas, nor if same anon_vma is assigned but offsets incompatible.
+ *
  * We don't check here for the merged mmap wrapping around the end of pagecache
  * indices (16TB on ia32) because do_mmap_pgoff() does not permit mmap's which
  * wrap, nor mmaps which cover the final page at index -1UL.
  */
 static int
 can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags,
-	struct file *file, unsigned long vm_pgoff, unsigned long size)
+	struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff)
 {
-	if (is_mergeable_vma(vma, file, vm_flags)) {
-		if (!file)
-			return 1;	/* anon mapping */
-		if (vma->vm_pgoff == vm_pgoff + size)
+	if (is_mergeable_vma(vma, file, vm_flags) &&
+	    is_mergeable_anon_vma(anon_vma, vma->anon_vma)) {
+		if (vma->vm_pgoff == vm_pgoff)
 			return 1;
 	}
 	return 0;
 }
 
 /*
- * Return true if we can merge this (vm_flags,file,vm_pgoff)
+ * Return true if we can merge this (vm_flags,anon_vma,file,vm_pgoff)
  * beyond (at a higher virtual address and file offset than) the vma.
+ *
+ * We cannot merge two vmas if they have differently assigned (non-NULL)
+ * anon_vmas, nor if same anon_vma is assigned but offsets incompatible.
  */
 static int
 can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
-	struct file *file, unsigned long vm_pgoff)
+	struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff)
 {
-	if (is_mergeable_vma(vma, file, vm_flags)) {
-		unsigned long vma_size;
-
-		if (!file)
-			return 1;	/* anon mapping */
-
-		vma_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-		if (vma->vm_pgoff + vma_size == vm_pgoff)
+	if (is_mergeable_vma(vma, file, vm_flags) &&
+	    is_mergeable_anon_vma(anon_vma, vma->anon_vma)) {
+		pgoff_t vm_pglen;
+		vm_pglen = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+		if (vma->vm_pgoff + vm_pglen == vm_pgoff)
 			return 1;
 	}
 	return 0;
 }
 
 /*
- * Given a new mapping request (addr,end,vm_flags,file,pgoff), figure out
- * whether that can be merged with its predecessor or its successor.  Or
- * both (it neatly fills a hole).
+ * Given a mapping request (addr,end,vm_flags,file,pgoff), figure out
+ * whether that can be merged with its predecessor or its successor.
+ * Or both (it neatly fills a hole).
+ *
+ * In most cases - when called for mmap, brk or mremap - [addr,end) is
+ * certain not to be mapped by the time vma_merge is called; but when
+ * called for mprotect, it is certain to be already mapped (either at
+ * an offset within prev, or at the start of next), and the flags of
+ * this area are about to be changed to vm_flags - and the no-change
+ * case has already been eliminated.
+ *
+ * The following mprotect cases have to be considered, where AAAA is
+ * the area passed down from mprotect_fixup, never extending beyond one
+ * vma, PPPPPP is the prev vma specified, and NNNNNN the next vma after:
+ *
+ *     AAAA             AAAA                AAAA          AAAA
+ *    PPPPPPNNNNNN    PPPPPPNNNNNN    PPPPPPNNNNNN    PPPPNNNNXXXX
+ *    cannot merge    might become    might become    might become
+ *                    PPNNNNNNNNNN    PPPPPPPPPPNN    PPPPPPPPPPPP 6 or
+ *    mmap, brk or    case 4 below    case 5 below    PPPPPPPPXXXX 7 or
+ *    mremap move:                                    PPPPNNNNNNNN 8
+ *        AAAA
+ *    PPPP    NNNN    PPPPPPPPPPPP    PPPPPPPPNNNN    PPPPNNNNNNNN
+ *    might become    case 1 below    case 2 below    case 3 below
+ *
+ * Odd one out? Case 8, because it extends NNNN but needs flags of XXXX:
+ * mprotect_fixup updates vm_flags & vm_page_prot on successful return.
  */
-static struct vm_area_struct *vma_merge(struct mm_struct *mm,
-			struct vm_area_struct *prev,
-			struct rb_node *rb_parent, unsigned long addr, 
+struct vm_area_struct *vma_merge(struct mm_struct *mm,
+			struct vm_area_struct *prev, unsigned long addr,
 			unsigned long end, unsigned long vm_flags,
-			struct file *file, unsigned long pgoff)
+		     	struct anon_vma *anon_vma, struct file *file,
+			pgoff_t pgoff, struct mempolicy *policy)
 {
-	spinlock_t *lock = &mm->page_table_lock;
-	struct inode *inode = file ? file->f_dentry->d_inode : NULL;
-	struct semaphore *i_shared_sem;
+	pgoff_t pglen = (end - addr) >> PAGE_SHIFT;
+	struct vm_area_struct *area, *next;
 
 	/*
-	 * We later require that vma->vm_flags == vm_flags, so this tests
-	 * vma->vm_flags & VM_SPECIAL, too.
+	 * We later require that vma->vm_flags == vm_flags,
+	 * so this tests vma->vm_flags & VM_SPECIAL, too.
 	 */
 	if (vm_flags & VM_SPECIAL)
 		return NULL;
 
-	i_shared_sem = file ? &file->f_mapping->i_shared_sem : NULL;
-
-	if (!prev) {
-		prev = rb_entry(rb_parent, struct vm_area_struct, vm_rb);
-		goto merge_next;
-	}
+	if (prev)
+		next = prev->vm_next;
+	else
+		next = mm->mmap;
+	area = next;
+	if (next && next->vm_end == end)		/* cases 6, 7, 8 */
+		next = next->vm_next;
 
 	/*
 	 * Can it merge with the predecessor?
 	 */
-	if (prev->vm_end == addr &&
-			can_vma_merge_after(prev, vm_flags, file, pgoff)) {
-		struct vm_area_struct *next;
-		int need_up = 0;
-
-		if (unlikely(file && prev->vm_next &&
-				prev->vm_next->vm_file == file)) {
-			down(i_shared_sem);
-			need_up = 1;
-		}
-		spin_lock(lock);
-		prev->vm_end = end;
-
+	if (prev && prev->vm_end == addr &&
+  			mpol_equal(vma_policy(prev), policy) &&
+			can_vma_merge_after(prev, vm_flags,
+						anon_vma, file, pgoff)) {
 		/*
-		 * OK, it did.  Can we now merge in the successor as well?
+		 * OK, it can.  Can we now merge in the successor as well?
 		 */
-		next = prev->vm_next;
-		if (next && prev->vm_end == next->vm_start &&
-				can_vma_merge_before(next, vm_flags, file,
-					pgoff, (end - addr) >> PAGE_SHIFT)) {
-			prev->vm_end = next->vm_end;
-			__vma_unlink(mm, next, prev);
-			__remove_shared_vm_struct(next, inode);
-			spin_unlock(lock);
-			if (need_up)
-				up(i_shared_sem);
-			if (file)
-				fput(file);
-
-			mm->map_count--;
-			kmem_cache_free(vm_area_cachep, next);
-			return prev;
-		}
-		spin_unlock(lock);
-		if (need_up)
-			up(i_shared_sem);
+		if (next && end == next->vm_start &&
+				mpol_equal(policy, vma_policy(next)) &&
+				can_vma_merge_before(next, vm_flags,
+					anon_vma, file, pgoff+pglen) &&
+				is_mergeable_anon_vma(prev->anon_vma,
+						      next->anon_vma)) {
+							/* cases 1, 6 */
+			vma_adjust(prev, prev->vm_start,
+				next->vm_end, prev->vm_pgoff, NULL);
+		} else					/* cases 2, 5, 7 */
+			vma_adjust(prev, prev->vm_start,
+				end, prev->vm_pgoff, NULL);
 		return prev;
 	}
 
 	/*
-	 * Can this new request be merged in front of prev->vm_next?
+	 * Can this new request be merged in front of next?
 	 */
-	prev = prev->vm_next;
-	if (prev) {
- merge_next:
-		if (!can_vma_merge_before(prev, vm_flags, file,
-				pgoff, (end - addr) >> PAGE_SHIFT))
-			return NULL;
-		if (end == prev->vm_start) {
-			if (file)
-				down(i_shared_sem);
-			spin_lock(lock);
-			prev->vm_start = addr;
-			prev->vm_pgoff -= (end - addr) >> PAGE_SHIFT;
-			spin_unlock(lock);
-			if (file)
-				up(i_shared_sem);
-			return prev;
-		}
+	if (next && end == next->vm_start &&
+ 			mpol_equal(policy, vma_policy(next)) &&
+			can_vma_merge_before(next, vm_flags,
+					anon_vma, file, pgoff+pglen)) {
+		if (prev && addr < prev->vm_end)	/* case 4 */
+			vma_adjust(prev, prev->vm_start,
+				addr, prev->vm_pgoff, NULL);
+		else					/* cases 3, 8 */
+			vma_adjust(area, addr, next->vm_end,
+				next->vm_pgoff - pglen, NULL);
+		return area;
 	}
 
 	return NULL;
 }
 
+/*
+ * find_mergeable_anon_vma is used by anon_vma_prepare, to check
+ * neighbouring vmas for a suitable anon_vma, before it goes off
+ * to allocate a new anon_vma.  It checks because a repetitive
+ * sequence of mprotects and faults may otherwise lead to distinct
+ * anon_vmas being allocated, preventing vma merge in subsequent
+ * mprotect.
+ */
+struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma)
+{
+	struct vm_area_struct *near;
+	unsigned long vm_flags;
+
+	near = vma->vm_next;
+	if (!near)
+		goto try_prev;
+
+	/*
+	 * Since only mprotect tries to remerge vmas, match flags
+	 * which might be mprotected into each other later on.
+	 * Neither mlock nor madvise tries to remerge at present,
+	 * so leave their flags as obstructing a merge.
+	 */
+	vm_flags = vma->vm_flags & ~(VM_READ|VM_WRITE|VM_EXEC);
+	vm_flags |= near->vm_flags & (VM_READ|VM_WRITE|VM_EXEC);
+
+	if (near->anon_vma && vma->vm_end == near->vm_start &&
+ 			mpol_equal(vma_policy(vma), vma_policy(near)) &&
+			can_vma_merge_before(near, vm_flags,
+				NULL, vma->vm_file, vma->vm_pgoff +
+				((vma->vm_end - vma->vm_start) >> PAGE_SHIFT)))
+		return near->anon_vma;
+try_prev:
+	/*
+	 * It is potentially slow to have to call find_vma_prev here.
+	 * But it's only on the first write fault on the vma, not
+	 * every time, and we could devise a way to avoid it later
+	 * (e.g. stash info in next's anon_vma_node when assigning
+	 * an anon_vma, or when trying vma_merge).  Another time.
+	 */
+	if (find_vma_prev(vma->vm_mm, vma->vm_start, &near) != vma)
+		BUG();
+	if (!near)
+		goto none;
+
+	vm_flags = vma->vm_flags & ~(VM_READ|VM_WRITE|VM_EXEC);
+	vm_flags |= near->vm_flags & (VM_READ|VM_WRITE|VM_EXEC);
+
+	if (near->anon_vma && near->vm_end == vma->vm_start &&
+  			mpol_equal(vma_policy(near), vma_policy(vma)) &&
+			can_vma_merge_after(near, vm_flags,
+				NULL, vma->vm_file, vma->vm_pgoff))
+		return near->anon_vma;
+none:
+	/*
+	 * There's no absolute need to look only at touching neighbours:
+	 * we could search further afield for "compatible" anon_vmas.
+	 * But it would probably just be a waste of time searching,
+	 * or lead to too many vmas hanging off the same anon_vma.
+	 * We're trying to allow mprotect remerging later on,
+	 * not trying to minimize memory used for anon_vmas.
+	 */
+	return NULL;
+}
+
 /*
  * The caller must hold down_write(current->mm->mmap_sem).
  */
@@ -501,7 +746,8 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
 		if (!file->f_op || !file->f_op->mmap)
 			return -ENODEV;
 
-		if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
+		if ((prot & PROT_EXEC) &&
+		    (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
 			return -EPERM;
 	}
 
@@ -583,15 +829,18 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
 			return -EINVAL;
 		}
 	} else {
-		vm_flags |= VM_SHARED | VM_MAYSHARE;
 		switch (flags & MAP_TYPE) {
-		default:
-			return -EINVAL;
-		case MAP_PRIVATE:
-			vm_flags &= ~(VM_SHARED | VM_MAYSHARE);
-			/* fall through */
 		case MAP_SHARED:
+			vm_flags |= VM_SHARED | VM_MAYSHARE;
 			break;
+		case MAP_PRIVATE:
+			/*
+			 * Set pgoff according to addr for anon_vma.
+			 */
+			pgoff = addr >> PAGE_SHIFT;
+			break;
+		default:
+			return -EINVAL;
 		}
 	}
 
@@ -630,11 +879,15 @@ munmap_back:
 		}
 	}
 
-	/* Can we just expand an old anonymous mapping? */
-	if (!file && !(vm_flags & VM_SHARED) && rb_parent)
-		if (vma_merge(mm, prev, rb_parent, addr, addr + len,
-					vm_flags, NULL, 0))
-			goto out;
+	/*
+	 * Can we just expand an old private anonymous mapping?
+	 * The VM_SHARED test is necessary because shmem_zero_setup
+	 * will create the file object for a shared anonymous map below.
+	 */
+	if (!file && !(vm_flags & VM_SHARED) &&
+	    vma_merge(mm, prev, addr, addr + len, vm_flags,
+					NULL, NULL, pgoff, NULL))
+		goto out;
 
 	/*
 	 * Determine the object being mapped and call the appropriate
@@ -642,21 +895,18 @@ munmap_back:
 	 * not unmapped, but the maps are removed from the list.
 	 */
 	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
-	error = -ENOMEM;
-	if (!vma)
+	if (!vma) {
+		error = -ENOMEM;
 		goto unacct_error;
+	}
+	memset(vma, 0, sizeof(*vma));
 
 	vma->vm_mm = mm;
 	vma->vm_start = addr;
 	vma->vm_end = addr + len;
 	vma->vm_flags = vm_flags;
 	vma->vm_page_prot = protection_map[vm_flags & 0x0f];
-	vma->vm_ops = NULL;
 	vma->vm_pgoff = pgoff;
-	vma->vm_file = NULL;
-	vma->vm_private_data = NULL;
-	vma->vm_next = NULL;
-	INIT_LIST_HEAD(&vma->shared);
 
 	if (file) {
 		error = -EINVAL;
@@ -694,8 +944,8 @@ munmap_back:
 	 */
 	addr = vma->vm_start;
 
-	if (!file || !rb_parent || !vma_merge(mm, prev, rb_parent, addr,
-				addr + len, vma->vm_flags, file, pgoff)) {
+	if (!file || !vma_merge(mm, prev, addr, vma->vm_end,
+			vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
 		vma_link(mm, vma, prev, rb_link, rb_parent);
 		if (correct_wcount)
 			atomic_inc(&inode->i_writecount);
@@ -705,6 +955,7 @@ munmap_back:
 				atomic_inc(&inode->i_writecount);
 			fput(file);
 		}
+		mpol_free(vma_policy(vma));
 		kmem_cache_free(vm_area_cachep, vma);
 	}
 out:	
@@ -715,7 +966,7 @@ out:
 	}
 	if (flags & MAP_POPULATE) {
 		up_write(&mm->mmap_sem);
-		sys_remap_file_pages(addr, len, prot,
+		sys_remap_file_pages(addr, len, 0,
 					pgoff, flags & MAP_NONBLOCK);
 		down_write(&mm->mmap_sem);
 	}
@@ -924,26 +1175,33 @@ int expand_stack(struct vm_area_struct * vma, unsigned long address)
 	if (!(vma->vm_flags & VM_GROWSUP))
 		return -EFAULT;
 
+	/*
+	 * We must make sure the anon_vma is allocated
+	 * so that the anon_vma locking is not a noop.
+	 */
+	if (unlikely(anon_vma_prepare(vma)))
+		return -ENOMEM;
+	anon_vma_lock(vma);
+
 	/*
 	 * vma->vm_start/vm_end cannot change under us because the caller
-	 * is required to hold the mmap_sem in read mode. We need to get
-	 * the spinlock only before relocating the vma range ourself.
+	 * is required to hold the mmap_sem in read mode.  We need the
+	 * anon_vma lock to serialize against concurrent expand_stacks.
 	 */
 	address += 4 + PAGE_SIZE - 1;
 	address &= PAGE_MASK;
- 	spin_lock(&vma->vm_mm->page_table_lock);
 	grow = (address - vma->vm_end) >> PAGE_SHIFT;
 
 	/* Overcommit.. */
 	if (security_vm_enough_memory(grow)) {
-		spin_unlock(&vma->vm_mm->page_table_lock);
+		anon_vma_unlock(vma);
 		return -ENOMEM;
 	}
 	
 	if (address - vma->vm_start > current->rlim[RLIMIT_STACK].rlim_cur ||
 			((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
 			current->rlim[RLIMIT_AS].rlim_cur) {
-		spin_unlock(&vma->vm_mm->page_table_lock);
+		anon_vma_unlock(vma);
 		vm_unacct_memory(grow);
 		return -ENOMEM;
 	}
@@ -951,7 +1209,7 @@ int expand_stack(struct vm_area_struct * vma, unsigned long address)
 	vma->vm_mm->total_vm += grow;
 	if (vma->vm_flags & VM_LOCKED)
 		vma->vm_mm->locked_vm += grow;
-	spin_unlock(&vma->vm_mm->page_table_lock);
+	anon_vma_unlock(vma);
 	return 0;
 }
 
@@ -979,25 +1237,32 @@ int expand_stack(struct vm_area_struct *vma, unsigned long address)
 {
 	unsigned long grow;
 
+	/*
+	 * We must make sure the anon_vma is allocated
+	 * so that the anon_vma locking is not a noop.
+	 */
+	if (unlikely(anon_vma_prepare(vma)))
+		return -ENOMEM;
+	anon_vma_lock(vma);
+
 	/*
 	 * vma->vm_start/vm_end cannot change under us because the caller
-	 * is required to hold the mmap_sem in read mode. We need to get
-	 * the spinlock only before relocating the vma range ourself.
+	 * is required to hold the mmap_sem in read mode.  We need the
+	 * anon_vma lock to serialize against concurrent expand_stacks.
 	 */
 	address &= PAGE_MASK;
- 	spin_lock(&vma->vm_mm->page_table_lock);
 	grow = (vma->vm_start - address) >> PAGE_SHIFT;
 
 	/* Overcommit.. */
 	if (security_vm_enough_memory(grow)) {
-		spin_unlock(&vma->vm_mm->page_table_lock);
+		anon_vma_unlock(vma);
 		return -ENOMEM;
 	}
 	
 	if (vma->vm_end - address > current->rlim[RLIMIT_STACK].rlim_cur ||
 			((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
 			current->rlim[RLIMIT_AS].rlim_cur) {
-		spin_unlock(&vma->vm_mm->page_table_lock);
+		anon_vma_unlock(vma);
 		vm_unacct_memory(grow);
 		return -ENOMEM;
 	}
@@ -1006,7 +1271,7 @@ int expand_stack(struct vm_area_struct *vma, unsigned long address)
 	vma->vm_mm->total_vm += grow;
 	if (vma->vm_flags & VM_LOCKED)
 		vma->vm_mm->locked_vm += grow;
-	spin_unlock(&vma->vm_mm->page_table_lock);
+	anon_vma_unlock(vma);
 	return 0;
 }
 
@@ -1118,13 +1383,7 @@ static void unmap_vma(struct mm_struct *mm, struct vm_area_struct *area)
 				area->vm_start < area->vm_mm->free_area_cache)
 	      area->vm_mm->free_area_cache = area->vm_start;
 
-	remove_shared_vm_struct(area);
-
-	if (area->vm_ops && area->vm_ops->close)
-		area->vm_ops->close(area);
-	if (area->vm_file)
-		fput(area->vm_file);
-	kmem_cache_free(vm_area_cachep, area);
+	remove_vm_struct(area);
 }
 
 /*
@@ -1173,8 +1432,6 @@ static void unmap_region(struct mm_struct *mm,
 /*
  * Create a list of vma's touched by the unmap, removing them from the mm's
  * vma list as we go..
- *
- * Called with the page_table_lock held.
  */
 static void
 detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -1202,8 +1459,8 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
 int split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
 	      unsigned long addr, int new_below)
 {
+	struct mempolicy *pol;
 	struct vm_area_struct *new;
-	struct address_space *mapping = NULL;
 
 	if (mm->map_count >= sysctl_max_map_count)
 		return -ENOMEM;
@@ -1214,8 +1471,7 @@ int split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
 
 	/* most fields are the same, copy all, and then fixup */
 	*new = *vma;
-
-	INIT_LIST_HEAD(&new->shared);
+	vma_prio_tree_init(new);
 
 	if (new_below)
 		new->vm_end = addr;
@@ -1224,30 +1480,24 @@ int split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
 		new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
 	}
 
+	pol = mpol_copy(vma_policy(vma));
+	if (IS_ERR(pol)) {
+		kmem_cache_free(vm_area_cachep, new);
+		return PTR_ERR(pol);
+	}
+	vma_set_policy(new, pol);
+
 	if (new->vm_file)
 		get_file(new->vm_file);
 
 	if (new->vm_ops && new->vm_ops->open)
 		new->vm_ops->open(new);
 
-	if (vma->vm_file)
-		 mapping = vma->vm_file->f_mapping;
-
-	if (mapping)
-		down(&mapping->i_shared_sem);
-	spin_lock(&mm->page_table_lock);
-
-	if (new_below) {
-		vma->vm_start = addr;
-		vma->vm_pgoff += ((addr - new->vm_start) >> PAGE_SHIFT);
-	} else
-		vma->vm_end = addr;
-
-	__insert_vm_struct(mm, new);
-
-	spin_unlock(&mm->page_table_lock);
-	if (mapping)
-		up(&mapping->i_shared_sem);
+	if (new_below)
+		vma_adjust(vma, addr, vma->vm_end, vma->vm_pgoff +
+			((addr - new->vm_start) >> PAGE_SHIFT), new);
+	else
+		vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new);
 
 	return 0;
 }
@@ -1314,8 +1564,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
 	/*
 	 * Remove the vma's, and unmap the actual pages
 	 */
-	spin_lock(&mm->page_table_lock);
 	detach_vmas_to_be_unmapped(mm, mpnt, prev, end);
+	spin_lock(&mm->page_table_lock);
 	unmap_region(mm, mpnt, prev, start, end);
 	spin_unlock(&mm->page_table_lock);
 
@@ -1349,6 +1599,7 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
 	struct vm_area_struct * vma, * prev;
 	unsigned long flags;
 	struct rb_node ** rb_link, * rb_parent;
+	pgoff_t pgoff = addr >> PAGE_SHIFT;
 
 	len = PAGE_ALIGN(len);
 	if (!len)
@@ -1391,9 +1642,9 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
 
 	flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
 
-	/* Can we just expand an old anonymous mapping? */
-	if (rb_parent && vma_merge(mm, prev, rb_parent, addr, addr + len,
-					flags, NULL, 0))
+	/* Can we just expand an old private anonymous mapping? */
+	if (vma_merge(mm, prev, addr, addr + len, flags,
+					NULL, NULL, pgoff, NULL))
 		goto out;
 
 	/*
@@ -1404,20 +1655,15 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
 		vm_unacct_memory(len >> PAGE_SHIFT);
 		return -ENOMEM;
 	}
+	memset(vma, 0, sizeof(*vma));
 
 	vma->vm_mm = mm;
 	vma->vm_start = addr;
 	vma->vm_end = addr + len;
+	vma->vm_pgoff = pgoff;
 	vma->vm_flags = flags;
 	vma->vm_page_prot = protection_map[flags & 0x0f];
-	vma->vm_ops = NULL;
-	vma->vm_pgoff = 0;
-	vma->vm_file = NULL;
-	vma->vm_private_data = NULL;
-	INIT_LIST_HEAD(&vma->shared);
-
 	vma_link(mm, vma, prev, rb_link, rb_parent);
-
 out:
 	mm->total_vm += len >> PAGE_SHIFT;
 	if (flags & VM_LOCKED) {
@@ -1467,27 +1713,36 @@ void exit_mmap(struct mm_struct *mm)
 	 */
 	while (vma) {
 		struct vm_area_struct *next = vma->vm_next;
-		remove_shared_vm_struct(vma);
-		if (vma->vm_ops) {
-			if (vma->vm_ops->close)
-				vma->vm_ops->close(vma);
-		}
-		if (vma->vm_file)
-			fput(vma->vm_file);
-		kmem_cache_free(vm_area_cachep, vma);
+		remove_vm_struct(vma);
 		vma = next;
 	}
 }
 
 /* Insert vm structure into process list sorted by address
- * and into the inode's i_mmap ring.  If vm_file is non-NULL
- * then i_shared_sem is taken here.
+ * and into the inode's i_mmap tree.  If vm_file is non-NULL
+ * then i_mmap_lock is taken here.
  */
 void insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
 {
 	struct vm_area_struct * __vma, * prev;
 	struct rb_node ** rb_link, * rb_parent;
 
+	/*
+	 * The vm_pgoff of a purely anonymous vma should be irrelevant
+	 * until its first write fault, when page's anon_vma and index
+	 * are set.  But now set the vm_pgoff it will almost certainly
+	 * end up with (unless mremap moves it elsewhere before that
+	 * first wfault), so /proc/pid/maps tells a consistent story.
+	 *
+	 * By setting it to reflect the virtual start address of the
+	 * vma, merges and splits can happen in a seamless way, just
+	 * using the existing file pgoff checks and manipulations.
+	 * Similarly in do_mmap_pgoff and in do_brk.
+	 */
+	if (!vma->vm_file) {
+		BUG_ON(vma->anon_vma);
+		vma->vm_pgoff = vma->vm_start >> PAGE_SHIFT;
+	}
 	__vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent);
 	if (__vma && __vma->vm_start < vma->vm_end)
 		BUG();
@@ -1499,17 +1754,25 @@ void insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
  * prior to moving page table entries, to effect an mremap move.
  */
 struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
-	unsigned long addr, unsigned long len, unsigned long pgoff)
+	unsigned long addr, unsigned long len, pgoff_t pgoff)
 {
 	struct vm_area_struct *vma = *vmap;
 	unsigned long vma_start = vma->vm_start;
 	struct mm_struct *mm = vma->vm_mm;
 	struct vm_area_struct *new_vma, *prev;
 	struct rb_node **rb_link, *rb_parent;
+	struct mempolicy *pol;
+
+	/*
+	 * If anonymous vma has not yet been faulted, update new pgoff
+	 * to match new location, to increase its chance of merging.
+	 */
+	if (!vma->vm_file && !vma->anon_vma)
+		pgoff = addr >> PAGE_SHIFT;
 
 	find_vma_prepare(mm, addr, &prev, &rb_link, &rb_parent);
-	new_vma = vma_merge(mm, prev, rb_parent, addr, addr + len,
-			vma->vm_flags, vma->vm_file, pgoff);
+	new_vma = vma_merge(mm, prev, addr, addr + len, vma->vm_flags,
+			vma->anon_vma, vma->vm_file, pgoff, vma_policy(vma));
 	if (new_vma) {
 		/*
 		 * Source vma may have been merged into new_vma
@@ -1521,7 +1784,13 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
 		new_vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
 		if (new_vma) {
 			*new_vma = *vma;
-			INIT_LIST_HEAD(&new_vma->shared);
+			vma_prio_tree_init(new_vma);
+			pol = mpol_copy(vma_policy(vma));
+			if (IS_ERR(pol)) {
+				kmem_cache_free(vm_area_cachep, new_vma);
+				return NULL;
+			}
+			vma_set_policy(new_vma, pol);
 			new_vma->vm_start = addr;
 			new_vma->vm_end = addr + len;
 			new_vma->vm_pgoff = pgoff;
diff --git a/mm/mprotect.c b/mm/mprotect.c
index f4018549f..5b438e1a0 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -16,6 +16,7 @@
 #include <linux/fs.h>
 #include <linux/highmem.h>
 #include <linux/security.h>
+#include <linux/mempolicy.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
@@ -106,50 +107,6 @@ change_protection(struct vm_area_struct *vma, unsigned long start,
 	spin_unlock(&current->mm->page_table_lock);
 	return;
 }
-/*
- * Try to merge a vma with the previous flag, return 1 if successful or 0 if it
- * was impossible.
- */
-static int
-mprotect_attempt_merge(struct vm_area_struct *vma, struct vm_area_struct *prev,
-		unsigned long end, int newflags)
-{
-	struct mm_struct * mm;
-
-	if (!prev || !vma)
-		return 0;
-	mm = vma->vm_mm;
-	if (prev->vm_end != vma->vm_start)
-		return 0;
-	if (!can_vma_merge(prev, newflags))
-		return 0;
-	if (vma->vm_file || (vma->vm_flags & VM_SHARED))
-		return 0;
-
-	/*
-	 * If the whole area changes to the protection of the previous one
-	 * we can just get rid of it.
-	 */
-	if (end == vma->vm_end) {
-		spin_lock(&mm->page_table_lock);
-		prev->vm_end = end;
-		__vma_unlink(mm, vma, prev);
-		spin_unlock(&mm->page_table_lock);
-
-		kmem_cache_free(vm_area_cachep, vma);
-		mm->map_count--;
-		return 1;
-	} 
-
-	/*
-	 * Otherwise extend it.
-	 */
-	spin_lock(&mm->page_table_lock);
-	prev->vm_end = end;
-	vma->vm_start = end;
-	spin_unlock(&mm->page_table_lock);
-	return 1;
-}
 
 static int
 mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
@@ -158,6 +115,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
 	struct mm_struct * mm = vma->vm_mm;
 	unsigned long charged = 0;
 	pgprot_t newprot;
+	pgoff_t pgoff;
 	int error;
 
 	if (newflags == vma->vm_flags) {
@@ -174,8 +132,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
 	 * a MAP_NORESERVE private mapping to writable will now reserve.
 	 */
 	if (newflags & VM_WRITE) {
-		if (!(vma->vm_flags & (VM_ACCOUNT|VM_WRITE|VM_SHARED))
-				&& VM_MAYACCT(vma)) {
+		if (!(vma->vm_flags & (VM_ACCOUNT|VM_WRITE|VM_SHARED|VM_HUGETLB))) {
 			charged = (end - start) >> PAGE_SHIFT;
 			if (security_vm_enough_memory(charged))
 				return -ENOMEM;
@@ -185,15 +142,18 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
 
 	newprot = protection_map[newflags & 0xf];
 
-	if (start == vma->vm_start) {
-		/*
-		 * Try to merge with the previous vma.
-		 */
-		if (mprotect_attempt_merge(vma, *pprev, end, newflags)) {
-			vma = *pprev;
-			goto success;
-		}
-	} else {
+	/*
+	 * First try to merge with previous and/or next vma.
+	 */
+	pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
+	*pprev = vma_merge(mm, *pprev, start, end, newflags,
+			vma->anon_vma, vma->vm_file, pgoff, vma_policy(vma));
+	if (*pprev) {
+		vma = *pprev;
+		goto success;
+	}
+
+	if (start != vma->vm_start) {
 		error = split_vma(mm, vma, start, 1);
 		if (error)
 			goto fail;
@@ -210,11 +170,13 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
 			goto fail;
 	}
 
-	spin_lock(&mm->page_table_lock);
+success:
+	/*
+	 * vm_flags and vm_page_prot are protected by the mmap_sem
+	 * held in write mode.
+	 */
 	vma->vm_flags = newflags;
 	vma->vm_page_prot = newprot;
-	spin_unlock(&mm->page_table_lock);
-success:
 	change_protection(vma, start, end, newprot);
 	return 0;
 
@@ -227,7 +189,7 @@ asmlinkage long
 sys_mprotect(unsigned long start, size_t len, unsigned long prot)
 {
 	unsigned long vm_flags, nstart, end, tmp;
-	struct vm_area_struct * vma, * next, * prev;
+	struct vm_area_struct *vma, *prev;
 	int error = -EINVAL;
 	const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP);
 	prot &= ~(PROT_GROWSDOWN|PROT_GROWSUP);
@@ -271,10 +233,11 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot)
 				goto out;
 		}
 	}
+	if (start > vma->vm_start)
+		prev = vma;
 
 	for (nstart = start ; ; ) {
 		unsigned int newflags;
-		int last = 0;
 
 		/* Here we know that  vma->vm_start <= nstart < vma->vm_end. */
 
@@ -294,39 +257,25 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot)
 		if (error)
 			goto out;
 
-		if (vma->vm_end > end) {
-			error = mprotect_fixup(vma, &prev, nstart, end, newflags);
-			goto out;
-		}
-		if (vma->vm_end == end)
-			last = 1;
-
 		tmp = vma->vm_end;
-		next = vma->vm_next;
+		if (tmp > end)
+			tmp = end;
 		error = mprotect_fixup(vma, &prev, nstart, tmp, newflags);
 		if (error)
 			goto out;
-		if (last)
-			break;
 		nstart = tmp;
-		vma = next;
+
+		if (nstart < prev->vm_end)
+			nstart = prev->vm_end;
+		if (nstart >= end)
+			goto out;
+
+		vma = prev->vm_next;
 		if (!vma || vma->vm_start != nstart) {
 			error = -ENOMEM;
 			goto out;
 		}
 	}
-
-	if (next && prev->vm_end == next->vm_start &&
-			can_vma_merge(next, prev->vm_flags) &&
-			!prev->vm_file && !(prev->vm_flags & VM_SHARED)) {
-		spin_lock(&prev->vm_mm->page_table_lock);
-		prev->vm_end = next->vm_end;
-		__vma_unlink(prev->vm_mm, next, prev);
-		spin_unlock(&prev->vm_mm->page_table_lock);
-
-		kmem_cache_free(vm_area_cachep, next);
-		prev->vm_mm->map_count--;
-	}
 out:
 	up_write(&current->mm->mmap_sem);
 	return error;
diff --git a/mm/mremap.c b/mm/mremap.c
index 904307691..690b8002d 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -15,7 +15,6 @@
 #include <linux/swap.h>
 #include <linux/fs.h>
 #include <linux/highmem.h>
-#include <linux/rmap.h>
 #include <linux/security.h>
 
 #include <asm/uaccess.h>
@@ -56,16 +55,18 @@ end:
 	return pte;
 }
 
-static inline int page_table_present(struct mm_struct *mm, unsigned long addr)
+static pte_t *get_one_pte_map(struct mm_struct *mm, unsigned long addr)
 {
 	pgd_t *pgd;
 	pmd_t *pmd;
 
 	pgd = pgd_offset(mm, addr);
 	if (pgd_none(*pgd))
-		return 0;
+		return NULL;
 	pmd = pmd_offset(pgd, addr);
-	return pmd_present(*pmd);
+	if (!pmd_present(*pmd))
+		return NULL;
+	return pte_offset_map(pmd, addr);
 }
 
 static inline pte_t *alloc_one_pte_map(struct mm_struct *mm, unsigned long addr)
@@ -79,38 +80,27 @@ static inline pte_t *alloc_one_pte_map(struct mm_struct *mm, unsigned long addr)
 	return pte;
 }
 
-static void
-copy_one_pte(struct vm_area_struct *vma, unsigned long old_addr,
-	     pte_t *src, pte_t *dst, struct pte_chain **pte_chainp)
-{
-	pte_t pte = ptep_clear_flush(vma, old_addr, src);
-	set_pte(dst, pte);
-
-	if (pte_present(pte)) {
-		unsigned long pfn = pte_pfn(pte);
-		if (pfn_valid(pfn)) {
-			struct page *page = pfn_to_page(pfn);
-			page_remove_rmap(page, src);
-			*pte_chainp = page_add_rmap(page, dst, *pte_chainp);
-		}
-	}
-}
-
 static int
 move_one_page(struct vm_area_struct *vma, unsigned long old_addr,
 		unsigned long new_addr)
 {
+	struct address_space *mapping = NULL;
 	struct mm_struct *mm = vma->vm_mm;
 	int error = 0;
 	pte_t *src, *dst;
-	struct pte_chain *pte_chain;
 
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain) {
-		error = -ENOMEM;
-		goto out;
+	if (vma->vm_file) {
+		/*
+		 * Subtle point from Rajesh Venkatasubramanian: before
+		 * moving file-based ptes, we must lock vmtruncate out,
+		 * since it might clean the dst vma before the src vma,
+		 * and we propagate stale pages into the dst afterward.
+		 */
+		mapping = vma->vm_file->f_mapping;
+		spin_lock(&mapping->i_mmap_lock);
 	}
 	spin_lock(&mm->page_table_lock);
+
 	src = get_one_pte_map_nested(mm, old_addr);
 	if (src) {
 		/*
@@ -118,22 +108,29 @@ move_one_page(struct vm_area_struct *vma, unsigned long old_addr,
 		 * memory allocation.  If it does then we need to drop the
 		 * atomic kmap
 		 */
-		if (!page_table_present(mm, new_addr)) {
+		dst = get_one_pte_map(mm, new_addr);
+		if (unlikely(!dst)) {
 			pte_unmap_nested(src);
-			src = NULL;
-		}
-		dst = alloc_one_pte_map(mm, new_addr);
-		if (src == NULL)
+			if (mapping)
+				spin_unlock(&mapping->i_mmap_lock);
+			dst = alloc_one_pte_map(mm, new_addr);
+			if (mapping && !spin_trylock(&mapping->i_mmap_lock)) {
+				spin_unlock(&mm->page_table_lock);
+				spin_lock(&mapping->i_mmap_lock);
+				spin_lock(&mm->page_table_lock);
+			}
 			src = get_one_pte_map_nested(mm, old_addr);
+		}
 		/*
 		 * Since alloc_one_pte_map can drop and re-acquire
 		 * page_table_lock, we should re-check the src entry...
 		 */
 		if (src) {
-			if (dst)
-				copy_one_pte(vma, old_addr, src,
-						dst, &pte_chain);
-			else
+			if (dst) {
+				pte_t pte;
+				pte = ptep_clear_flush(vma, old_addr, src);
+				set_pte(dst, pte);
+			} else
 				error = -ENOMEM;
 			pte_unmap_nested(src);
 		}
@@ -141,13 +138,14 @@ move_one_page(struct vm_area_struct *vma, unsigned long old_addr,
 			pte_unmap(dst);
 	}
 	spin_unlock(&mm->page_table_lock);
-	pte_chain_free(pte_chain);
-out:
+	if (mapping)
+		spin_unlock(&mapping->i_mmap_lock);
 	return error;
 }
 
 static unsigned long move_page_tables(struct vm_area_struct *vma,
-	unsigned long new_addr, unsigned long old_addr, unsigned long len)
+		unsigned long new_addr, unsigned long old_addr,
+		unsigned long len)
 {
 	unsigned long offset;
 
@@ -161,6 +159,7 @@ static unsigned long move_page_tables(struct vm_area_struct *vma,
 	for (offset = 0; offset < len; offset += PAGE_SIZE) {
 		if (move_one_page(vma, old_addr+offset, new_addr+offset) < 0)
 			break;
+		cond_resched();
 	}
 	return offset;
 }
@@ -170,7 +169,6 @@ static unsigned long move_vma(struct vm_area_struct *vma,
 		unsigned long new_len, unsigned long new_addr)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	struct address_space *mapping = NULL;
 	struct vm_area_struct *new_vma;
 	unsigned long vm_flags = vma->vm_flags;
 	unsigned long new_pgoff;
@@ -190,16 +188,6 @@ static unsigned long move_vma(struct vm_area_struct *vma,
 	if (!new_vma)
 		return -ENOMEM;
 
-	if (vma->vm_file) {
-		/*
-		 * Subtle point from Rajesh Venkatasubramanian: before
-		 * moving file-based ptes, we must lock vmtruncate out,
-		 * since it might clean the dst vma before the src vma,
-		 * and we propagate stale pages into the dst afterward.
-		 */
-		mapping = vma->vm_file->f_mapping;
-		down(&mapping->i_shared_sem);
-	}
 	moved_len = move_page_tables(vma, new_addr, old_addr, old_len);
 	if (moved_len < old_len) {
 		/*
@@ -213,8 +201,6 @@ static unsigned long move_vma(struct vm_area_struct *vma,
 		old_addr = new_addr;
 		new_addr = -ENOMEM;
 	}
-	if (mapping)
-		up(&mapping->i_shared_sem);
 
 	/* Conceal VM_ACCOUNT so old reservation is not undone */
 	if (vm_flags & VM_ACCOUNT) {
@@ -368,9 +354,10 @@ unsigned long do_mremap(unsigned long addr,
 		/* can we just expand the current mapping? */
 		if (max_addr - addr >= new_len) {
 			int pages = (new_len - old_len) >> PAGE_SHIFT;
-			spin_lock(&vma->vm_mm->page_table_lock);
-			vma->vm_end = addr + new_len;
-			spin_unlock(&vma->vm_mm->page_table_lock);
+
+			vma_adjust(vma, vma->vm_start,
+				addr + new_len, vma->vm_pgoff, NULL);
+
 			current->mm->total_vm += pages;
 			if (vma->vm_flags & VM_LOCKED) {
 				current->mm->locked_vm += pages;
diff --git a/mm/msync.c b/mm/msync.c
index 5467df544..cd5e947da 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -11,6 +11,7 @@
 #include <linux/pagemap.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
+#include <linux/hugetlb.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -106,6 +107,13 @@ static int filemap_sync(struct vm_area_struct * vma, unsigned long address,
 
 	dir = pgd_offset(vma->vm_mm, address);
 	flush_cache_range(vma, address, end);
+
+	/* For hugepages we can't go walking the page table normally,
+	 * but that's ok, hugetlbfs is memory based, so we don't need
+	 * to do anything more on an msync() */
+	if (is_vm_hugetlb_page(vma))
+		goto out;
+
 	if (address >= end)
 		BUG();
 	do {
@@ -118,7 +126,7 @@ static int filemap_sync(struct vm_area_struct * vma, unsigned long address,
 	 * dirty bits.
 	 */
 	flush_tlb_range(vma, end - size, end);
-
+ out:
 	spin_unlock(&vma->vm_mm->page_table_lock);
 
 	return error;
diff --git a/mm/nommu.c b/mm/nommu.c
index c940756b4..587290579 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/blkdev.h>
+#include <linux/backing-dev.h>
 
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
@@ -33,6 +34,9 @@ atomic_t vm_committed_space = ATOMIC_INIT(0);
 int sysctl_overcommit_memory; /* default is heuristic overcommit */
 int sysctl_overcommit_ratio = 50; /* default is 50% */
 
+int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
+EXPORT_SYMBOL(sysctl_max_map_count);
+
 /*
  * Handle all mappings that got truncated by a "truncate()"
  * system call.
@@ -485,7 +489,7 @@ int do_munmap(struct mm_struct * mm, unsigned long addr, size_t len)
 	show_process_blocks();
 #endif	  
 
-	return -EINVAL;
+	return 0;
 }
 
 /* Release all mmaps. */
@@ -568,6 +572,6 @@ unsigned long get_unmapped_area(struct file *file, unsigned long addr,
 	return -ENOMEM;
 }
 
-void pte_chain_init(void)
+void swap_unplug_io_fn(struct backing_dev_info *)
 {
 }
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index ed0cee4e6..203923cbe 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -245,7 +245,6 @@ void out_of_memory(void)
 	 * If it's been a long time since last failure,
 	 * we're not oom.
 	 */
-	last = now;
 	if (since > 5*HZ)
 		goto reset;
 
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 042ccadd8..a2aa511ad 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -92,11 +92,29 @@ int block_dump;
  */
 int laptop_mode;
 
+EXPORT_SYMBOL(laptop_mode);
+
 /* End of sysctl-exported parameters */
 
 
 static void background_writeout(unsigned long _min_pages);
 
+struct writeback_state
+{
+	unsigned long nr_dirty;
+	unsigned long nr_unstable;
+	unsigned long nr_mapped;
+	unsigned long nr_writeback;
+};
+
+static void get_writeback_state(struct writeback_state *wbs)
+{
+	wbs->nr_dirty = read_page_state(nr_dirty);
+	wbs->nr_unstable = read_page_state(nr_unstable);
+	wbs->nr_mapped = read_page_state(nr_mapped);
+	wbs->nr_writeback = read_page_state(nr_writeback);
+}
+
 /*
  * Work out the current dirty-memory clamping and background writeout
  * thresholds.
@@ -115,7 +133,7 @@ static void background_writeout(unsigned long _min_pages);
  * clamping level.
  */
 static void
-get_dirty_limits(struct page_state *ps, long *pbackground, long *pdirty)
+get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty)
 {
 	int background_ratio;		/* Percentages */
 	int dirty_ratio;
@@ -124,9 +142,9 @@ get_dirty_limits(struct page_state *ps, long *pbackground, long *pdirty)
 	long dirty;
 	struct task_struct *tsk;
 
-	get_page_state(ps);
+	get_writeback_state(wbs);
 
-	unmapped_ratio = 100 - (ps->nr_mapped * 100) / total_pages;
+	unmapped_ratio = 100 - (wbs->nr_mapped * 100) / total_pages;
 
 	dirty_ratio = vm_dirty_ratio;
 	if (dirty_ratio > unmapped_ratio / 2)
@@ -159,7 +177,7 @@ get_dirty_limits(struct page_state *ps, long *pbackground, long *pdirty)
  */
 static void balance_dirty_pages(struct address_space *mapping)
 {
-	struct page_state ps;
+	struct writeback_state wbs;
 	long nr_reclaimable;
 	long background_thresh;
 	long dirty_thresh;
@@ -176,9 +194,9 @@ static void balance_dirty_pages(struct address_space *mapping)
 			.nr_to_write	= write_chunk,
 		};
 
-		get_dirty_limits(&ps, &background_thresh, &dirty_thresh);
-		nr_reclaimable = ps.nr_dirty + ps.nr_unstable;
-		if (nr_reclaimable + ps.nr_writeback <= dirty_thresh)
+		get_dirty_limits(&wbs, &background_thresh, &dirty_thresh);
+		nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable;
+		if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
 			break;
 
 		dirty_exceeded = 1;
@@ -191,10 +209,10 @@ static void balance_dirty_pages(struct address_space *mapping)
 		 */
 		if (nr_reclaimable) {
 			writeback_inodes(&wbc);
-			get_dirty_limits(&ps, &background_thresh,
+			get_dirty_limits(&wbs, &background_thresh,
 					&dirty_thresh);
-			nr_reclaimable = ps.nr_dirty + ps.nr_unstable;
-			if (nr_reclaimable + ps.nr_writeback <= dirty_thresh)
+			nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable;
+			if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
 				break;
 			pages_written += write_chunk - wbc.nr_to_write;
 			if (pages_written >= write_chunk)
@@ -203,7 +221,7 @@ static void balance_dirty_pages(struct address_space *mapping)
 		blk_congestion_wait(WRITE, HZ/10);
 	}
 
-	if (nr_reclaimable + ps.nr_writeback <= dirty_thresh)
+	if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
 		dirty_exceeded = 0;
 
 	if (writeback_in_progress(bdi))
@@ -230,10 +248,10 @@ static void balance_dirty_pages(struct address_space *mapping)
  * which was newly dirtied.  The function will periodically check the system's
  * dirty state and will initiate writeback if needed.
  *
- * On really big machines, get_page_state is expensive, so try to avoid calling
- * it too often (ratelimiting).  But once we're over the dirty memory limit we
- * decrease the ratelimiting by a lot, to prevent individual processes from
- * overshooting the limit by (ratelimit_pages) each.
+ * On really big machines, get_writeback_state is expensive, so try to avoid
+ * calling it too often (ratelimiting).  But once we're over the dirty memory
+ * limit we decrease the ratelimiting by a lot, to prevent individual processes
+ * from overshooting the limit by (ratelimit_pages) each.
  */
 void balance_dirty_pages_ratelimited(struct address_space *mapping)
 {
@@ -274,12 +292,12 @@ static void background_writeout(unsigned long _min_pages)
 	};
 
 	for ( ; ; ) {
-		struct page_state ps;
+		struct writeback_state wbs;
 		long background_thresh;
 		long dirty_thresh;
 
-		get_dirty_limits(&ps, &background_thresh, &dirty_thresh);
-		if (ps.nr_dirty + ps.nr_unstable < background_thresh
+		get_dirty_limits(&wbs, &background_thresh, &dirty_thresh);
+		if (wbs.nr_dirty + wbs.nr_unstable < background_thresh
 				&& min_pages <= 0)
 			break;
 		wbc.encountered_congestion = 0;
@@ -304,10 +322,10 @@ static void background_writeout(unsigned long _min_pages)
 int wakeup_bdflush(long nr_pages)
 {
 	if (nr_pages == 0) {
-		struct page_state ps;
+		struct writeback_state wbs;
 
-		get_page_state(&ps);
-		nr_pages = ps.nr_dirty + ps.nr_unstable;
+		get_writeback_state(&wbs);
+		nr_pages = wbs.nr_dirty + wbs.nr_unstable;
 	}
 	return pdflush_operation(background_writeout, nr_pages);
 }
@@ -341,7 +359,7 @@ static void wb_kupdate(unsigned long arg)
 	unsigned long start_jif;
 	unsigned long next_jif;
 	long nr_to_write;
-	struct page_state ps;
+	struct writeback_state wbs;
 	struct writeback_control wbc = {
 		.bdi		= NULL,
 		.sync_mode	= WB_SYNC_NONE,
@@ -353,11 +371,11 @@ static void wb_kupdate(unsigned long arg)
 
 	sync_supers();
 
-	get_page_state(&ps);
+	get_writeback_state(&wbs);
 	oldest_jif = jiffies - (dirty_expire_centisecs * HZ) / 100;
 	start_jif = jiffies;
 	next_jif = start_jif + (dirty_writeback_centisecs * HZ) / 100;
-	nr_to_write = ps.nr_dirty + ps.nr_unstable +
+	nr_to_write = wbs.nr_dirty + wbs.nr_unstable +
 			(inodes_stat.nr_inodes - inodes_stat.nr_unused);
 	while (nr_to_write > 0) {
 		wbc.encountered_congestion = 0;
@@ -432,8 +450,8 @@ void laptop_sync_completion(void)
 /*
  * If ratelimit_pages is too high then we can get into dirty-data overload
  * if a large number of processes all perform writes at the same time.
- * If it is too low then SMP machines will call the (expensive) get_page_state
- * too often.
+ * If it is too low then SMP machines will call the (expensive)
+ * get_writeback_state too often.
  *
  * Here we set ratelimit_pages to a level which ensures that when all CPUs are
  * dirtying in parallel, we cannot go more than 3% (1/32) over the dirty memory
@@ -545,34 +563,40 @@ EXPORT_SYMBOL(write_one_page);
  * For address_spaces which do not use buffers.  Just tag the page as dirty in
  * its radix tree.
  *
- * __set_page_dirty_nobuffers() may return -ENOSPC.  But if it does, the page
- * is still safe, as long as it actually manages to find some blocks at
- * writeback time.
- *
  * This is also used when a single buffer is being dirtied: we want to set the
  * page dirty in that case, but not all the buffers.  This is a "bottom-up"
  * dirtying, whereas __set_page_dirty_buffers() is a "top-down" dirtying.
+ *
+ * Most callers have locked the page, which pins the address_space in memory.
+ * But zap_pte_range() does not lock the page, however in that case the
+ * mapping is pinned by the vma's ->vm_file reference.
+ *
+ * We take care to handle the case where the page was truncated from the
+ * mapping by re-checking page_mapping() insode tree_lock.
  */
 int __set_page_dirty_nobuffers(struct page *page)
 {
 	int ret = 0;
 
 	if (!TestSetPageDirty(page)) {
-		struct address_space *mapping = page->mapping;
+		struct address_space *mapping = page_mapping(page);
 
 		if (mapping) {
 			spin_lock_irq(&mapping->tree_lock);
-			if (page->mapping) {	/* Race with truncate? */
-				BUG_ON(page->mapping != mapping);
+			mapping = page_mapping(page);
+			if (page_mapping(page)) { /* Race with truncate? */
+				BUG_ON(page_mapping(page) != mapping);
 				if (!mapping->backing_dev_info->memory_backed)
 					inc_page_state(nr_dirty);
 				radix_tree_tag_set(&mapping->page_tree,
-					page->index, PAGECACHE_TAG_DIRTY);
+					page_index(page), PAGECACHE_TAG_DIRTY);
 			}
 			spin_unlock_irq(&mapping->tree_lock);
-			if (!PageSwapCache(page))
+			if (mapping->host) {
+				/* !PageAnon && !swapper_space */
 				__mark_inode_dirty(mapping->host,
 							I_DIRTY_PAGES);
+			}
 		}
 	}
 	return ret;
@@ -598,14 +622,16 @@ EXPORT_SYMBOL(redirty_page_for_writepage);
 int fastcall set_page_dirty(struct page *page)
 {
 	struct address_space *mapping = page_mapping(page);
-	int (*spd)(struct page *);
 
-	if (!mapping) {
-		SetPageDirty(page);
-		return 0;
+	if (likely(mapping)) {
+		int (*spd)(struct page *) = mapping->a_ops->set_page_dirty;
+		if (spd)
+			return (*spd)(page);
+		return __set_page_dirty_buffers(page);
 	}
-	spd = mapping->a_ops->set_page_dirty;
-	return spd? (*spd)(page): __set_page_dirty_buffers(page);
+	if (!PageDirty(page))
+		SetPageDirty(page);
+	return 0;
 }
 EXPORT_SYMBOL(set_page_dirty);
 
@@ -642,7 +668,8 @@ int test_clear_page_dirty(struct page *page)
 	if (mapping) {
 		spin_lock_irqsave(&mapping->tree_lock, flags);
 		if (TestClearPageDirty(page)) {
-			radix_tree_tag_clear(&mapping->page_tree, page->index,
+			radix_tree_tag_clear(&mapping->page_tree,
+						page_index(page),
 						PAGECACHE_TAG_DIRTY);
 			spin_unlock_irqrestore(&mapping->tree_lock, flags);
 			if (!mapping->backing_dev_info->memory_backed)
@@ -698,7 +725,8 @@ int __clear_page_dirty(struct page *page)
 
 		spin_lock_irqsave(&mapping->tree_lock, flags);
 		if (TestClearPageDirty(page)) {
-			radix_tree_tag_clear(&mapping->page_tree, page->index,
+			radix_tree_tag_clear(&mapping->page_tree,
+						page_index(page),
 						PAGECACHE_TAG_DIRTY);
 			spin_unlock_irqrestore(&mapping->tree_lock, flags);
 			return 1;
@@ -720,7 +748,8 @@ int test_clear_page_writeback(struct page *page)
 		spin_lock_irqsave(&mapping->tree_lock, flags);
 		ret = TestClearPageWriteback(page);
 		if (ret)
-			radix_tree_tag_clear(&mapping->page_tree, page->index,
+			radix_tree_tag_clear(&mapping->page_tree,
+						page_index(page),
 						PAGECACHE_TAG_WRITEBACK);
 		spin_unlock_irqrestore(&mapping->tree_lock, flags);
 	} else {
@@ -740,10 +769,12 @@ int test_set_page_writeback(struct page *page)
 		spin_lock_irqsave(&mapping->tree_lock, flags);
 		ret = TestSetPageWriteback(page);
 		if (!ret)
-			radix_tree_tag_set(&mapping->page_tree, page->index,
+			radix_tree_tag_set(&mapping->page_tree,
+						page_index(page),
 						PAGECACHE_TAG_WRITEBACK);
 		if (!PageDirty(page))
-			radix_tree_tag_clear(&mapping->page_tree, page->index,
+			radix_tree_tag_clear(&mapping->page_tree,
+						page_index(page),
 						PAGECACHE_TAG_DIRTY);
 		spin_unlock_irqrestore(&mapping->tree_lock, flags);
 	} else {
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8d3f6f461..314a83438 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -45,6 +45,11 @@ int sysctl_lower_zone_protection = 0;
 EXPORT_SYMBOL(totalram_pages);
 EXPORT_SYMBOL(nr_swap_pages);
 
+#ifdef CONFIG_CRASH_DUMP_MODULE
+/* This symbol has to be exported to use 'for_each_pgdat' macro by modules. */
+EXPORT_SYMBOL(pgdat_list);
+#endif
+
 /*
  * Used by page_zone() to look up the address of the struct zone whose
  * id is encoded in the upper bits of page->flags
@@ -73,9 +78,9 @@ static void bad_page(const char *function, struct page *page)
 {
 	printk(KERN_EMERG "Bad page state at %s (in process '%s', page %p)\n",
 		function, current->comm, page);
-	printk(KERN_EMERG "flags:0x%08lx mapping:%p mapped:%d count:%d\n",
+	printk(KERN_EMERG "flags:0x%08lx mapping:%p mapcount:%d count:%d\n",
 		(unsigned long)page->flags, page->mapping,
-		page_mapped(page), page_count(page));
+		(int)page->mapcount, page_count(page));
 	printk(KERN_EMERG "Backtrace:\n");
 	dump_stack();
 	printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n");
@@ -90,9 +95,11 @@ static void bad_page(const char *function, struct page *page)
 			1 << PG_writeback);
 	set_page_count(page, 0);
 	page->mapping = NULL;
+	page->mapcount = 0;
 }
 
-#ifndef CONFIG_HUGETLB_PAGE
+#if !defined(CONFIG_HUGETLB_PAGE) && !defined(CONFIG_CRASH_DUMP) \
+	&& !defined(CONFIG_CRASH_DUMP_MODULE)
 #define prep_compound_page(page, order) do { } while (0)
 #define destroy_compound_page(page, order) do { } while (0)
 #else
@@ -460,6 +467,32 @@ void drain_local_pages(void)
 }
 #endif /* CONFIG_PM */
 
+static void zone_statistics(struct zonelist *zonelist, struct zone *z)
+{
+#ifdef CONFIG_NUMA
+	unsigned long flags;
+	int cpu;
+	pg_data_t *pg = z->zone_pgdat;
+	pg_data_t *orig = zonelist->zones[0]->zone_pgdat;
+	struct per_cpu_pageset *p;
+
+	local_irq_save(flags);
+	cpu = smp_processor_id();
+	p = &z->pageset[cpu];
+	if (pg == orig) {
+		z->pageset[cpu].numa_hit++;
+	} else {
+		p->numa_miss++;
+		zonelist->zones[0]->pageset[cpu].numa_foreign++;
+	}
+	if (pg == NODE_DATA(numa_node_id()))
+		p->local_node++;
+	else
+		p->other_node++;
+	local_irq_restore(flags);
+#endif
+}
+
 /*
  * Free a 0-order page
  */
@@ -593,8 +626,10 @@ __alloc_pages(unsigned int gfp_mask, unsigned int order,
 		if (z->free_pages >= min ||
 				(!wait && z->free_pages >= z->pages_high)) {
 			page = buffered_rmqueue(z, order, gfp_mask);
-			if (page)
+			if (page) {
+				zone_statistics(zonelist, z);
 				goto got_pg;
+			}
 		}
 	}
 
@@ -616,8 +651,10 @@ __alloc_pages(unsigned int gfp_mask, unsigned int order,
 		if (z->free_pages >= min ||
 				(!wait && z->free_pages >= z->pages_high)) {
 			page = buffered_rmqueue(z, order, gfp_mask);
-			if (page)
+			if (page) {
+				zone_statistics(zonelist, z);
 				goto got_pg;
+			}
 		}
 	}
 
@@ -630,8 +667,10 @@ rebalance:
 			struct zone *z = zones[i];
 
 			page = buffered_rmqueue(z, order, gfp_mask);
-			if (page)
+			if (page) {
+				zone_statistics(zonelist, z);
 				goto got_pg;
+			}
 		}
 		goto nopage;
 	}
@@ -658,8 +697,10 @@ rebalance:
 		if (z->free_pages >= min ||
 				(!wait && z->free_pages >= z->pages_high)) {
 			page = buffered_rmqueue(z, order, gfp_mask);
-			if (page)
+			if (page) {
+ 				zone_statistics(zonelist, z);
 				goto got_pg;
+			}
 		}
 	}
 
@@ -953,6 +994,23 @@ void get_full_page_state(struct page_state *ret)
 	__get_page_state(ret, sizeof(*ret) / sizeof(unsigned long));
 }
 
+unsigned long __read_page_state(unsigned offset)
+{
+	unsigned long ret = 0;
+	int cpu;
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		unsigned long in;
+
+		if (!cpu_possible(cpu))
+			continue;
+
+		in = (unsigned long)&per_cpu(page_states, cpu) + offset;
+		ret += *((unsigned long *)in);
+	}
+	return ret;
+}
+
 void get_zone_counts(unsigned long *active,
 		unsigned long *inactive, unsigned long *free)
 {
@@ -1284,7 +1342,7 @@ static void __init build_zonelists(pg_data_t *pgdat)
  		for (node = 0; node < local_node; node++)
  			j = build_zonelists_node(NODE_DATA(node), zonelist, j, k);
  
-		zonelist->zones[j++] = NULL;
+		zonelist->zones[j] = NULL;
 	}
 }
 
diff --git a/mm/readahead.c b/mm/readahead.c
index 71bf2462d..972395626 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -15,7 +15,7 @@
 #include <linux/backing-dev.h>
 #include <linux/pagevec.h>
 
-void default_unplug_io_fn(struct backing_dev_info *bdi)
+void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
 {
 }
 EXPORT_SYMBOL(default_unplug_io_fn);
@@ -353,7 +353,7 @@ page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
 	unsigned orig_next_size;
 	unsigned actual;
 	int first_access=0;
-	unsigned long preoffset=0;
+	unsigned long average;
 
 	/*
 	 * Here we detect the case where the application is performing
@@ -394,10 +394,17 @@ page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
 		if (ra->serial_cnt <= (max * 2))
 			ra->serial_cnt++;
 	} else {
-		ra->average = (ra->average + ra->serial_cnt) / 2;
+		/*
+		 * to avoid rounding errors, ensure that 'average'
+		 * tends towards the value of ra->serial_cnt.
+		 */
+		average = ra->average;
+		if (average < ra->serial_cnt) {
+			average++;
+		}
+		ra->average = (average + ra->serial_cnt) / 2;
 		ra->serial_cnt = 1;
 	}
-	preoffset = ra->prev_page;
 	ra->prev_page = offset;
 
 	if (offset >= ra->start && offset <= (ra->start + ra->size)) {
@@ -457,18 +464,13 @@ do_io:
 		 * ahead window and get some I/O underway for the new
 		 * current window.
 		 */
-		if (!first_access && preoffset >= ra->start &&
-				preoffset < (ra->start + ra->size)) {
-			 /* Heuristic:  If 'n' pages were
-			  * accessed in the current window, there
-			  * is a high probability that around 'n' pages
-			  * shall be used in the next current window.
-			  *
-			  * To minimize lazy-readahead triggered
-			  * in the next current window, read in
-			  * an extra page.
+		if (!first_access) {
+			 /* Heuristic: there is a high probability
+			  * that around  ra->average number of
+			  * pages shall be accessed in the next
+			  * current window.
 			  */
-			ra->next_size = preoffset - ra->start + 2;
+			ra->next_size = min(ra->average , (unsigned long)max);
 		}
 		ra->start = offset;
 		ra->size = ra->next_size;
@@ -492,21 +494,19 @@ do_io:
 		 */
 		if (ra->ahead_start == 0) {
 			/*
-			 * if the average io-size is less than maximum
+			 * If the average io-size is more than maximum
 			 * readahead size of the file the io pattern is
 			 * sequential. Hence  bring in the readahead window
 			 * immediately.
-			 * Else the i/o pattern is random. Bring
-			 * in the readahead window only if the last page of
-			 * the current window is accessed (lazy readahead).
+			 * If the average io-size is less than maximum
+			 * readahead size of the file the io pattern is
+			 * random. Hence don't bother to readahead.
 			 */
-			unsigned long average = ra->average;
-
+			average = ra->average;
 			if (ra->serial_cnt > average)
-				average = (ra->serial_cnt + ra->average) / 2;
+				average = (ra->serial_cnt + ra->average + 1) / 2;
 
-			if ((average >= max) || (offset == (ra->start +
-							ra->size - 1))) {
+			if (average > max) {
 				ra->ahead_start = ra->start + ra->size;
 				ra->ahead_size = ra->next_size;
 				actual = do_page_cache_readahead(mapping, filp,
diff --git a/mm/rmap.c b/mm/rmap.c
index 5577805ae..1f3c84f8c 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -4,17 +4,23 @@
  * Copyright 2001, Rik van Riel <riel@conectiva.com.br>
  * Released under the General Public License (GPL).
  *
+ * Simple, low overhead reverse mapping scheme.
+ * Please try to keep this thing as modular as possible.
  *
- * Simple, low overhead pte-based reverse mapping scheme.
- * This is kept modular because we may want to experiment
- * with object-based reverse mapping schemes. Please try
- * to keep this thing as modular as possible.
+ * Provides methods for unmapping each kind of mapped page:
+ * the anon methods track anonymous pages, and
+ * the file methods track pages belonging to an inode.
+ *
+ * Original design by Rik van Riel <riel@conectiva.com.br> 2001
+ * File methods by Dave McCracken <dmccr@us.ibm.com> 2003, 2004
+ * Anonymous methods by Andrea Arcangeli <andrea@suse.de> 2004
+ * Contributions by Hugh Dickins <hugh@veritas.com> 2003, 2004
  */
 
 /*
  * Locking:
- * - the page->pte.chain is protected by the PG_maplock bit,
- *   which nests within the the mm->page_table_lock,
+ * - the page->mapcount field is protected by the PG_maplock bit,
+ *   which nests within the mm->page_table_lock,
  *   which nests within the page lock.
  * - because swapout locking is opposite to the locking order
  *   in the page fault path, the swapout path uses trylocks
@@ -27,106 +33,282 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/rmap.h>
-#include <linux/cache.h>
-#include <linux/percpu.h>
 
-#include <asm/pgalloc.h>
-#include <asm/rmap.h>
-#include <asm/tlb.h>
 #include <asm/tlbflush.h>
 
-/*
- * Something oopsable to put for now in the page->mapping
- * of an anonymous page, to test that it is ignored.
- */
-#define ANON_MAPPING_DEBUG	((struct address_space *) 0)
+//#define RMAP_DEBUG /* can be enabled only for debugging */
 
-static inline void clear_page_anon(struct page *page)
+kmem_cache_t *anon_vma_cachep;
+
+static inline void validate_anon_vma(struct vm_area_struct *find_vma)
 {
-	BUG_ON(page->mapping != ANON_MAPPING_DEBUG);
-	page->mapping = NULL;
-	ClearPageAnon(page);
+#ifdef RMAP_DEBUG
+	struct anon_vma *anon_vma = find_vma->anon_vma;
+	struct vm_area_struct *vma;
+	unsigned int mapcount = 0;
+	int found = 0;
+
+	list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
+		mapcount++;
+		BUG_ON(mapcount > 100000);
+		if (vma == find_vma)
+			found = 1;
+	}
+	BUG_ON(!found);
+#endif
 }
 
-/*
- * Shared pages have a chain of pte_chain structures, used to locate
- * all the mappings to this page. We only need a pointer to the pte
- * here, the page struct for the page table page contains the process
- * it belongs to and the offset within that process.
- *
- * We use an array of pte pointers in this structure to minimise cache misses
- * while traversing reverse maps.
- */
-#define NRPTE ((L1_CACHE_BYTES - sizeof(unsigned long))/sizeof(pte_addr_t))
+/* This must be called under the mmap_sem. */
+int anon_vma_prepare(struct vm_area_struct *vma)
+{
+	struct anon_vma *anon_vma = vma->anon_vma;
+
+	might_sleep();
+	if (unlikely(!anon_vma)) {
+		struct mm_struct *mm = vma->vm_mm;
+		struct anon_vma *allocated = NULL;
+
+		anon_vma = find_mergeable_anon_vma(vma);
+		if (!anon_vma) {
+			anon_vma = anon_vma_alloc();
+			if (unlikely(!anon_vma))
+				return -ENOMEM;
+			allocated = anon_vma;
+		}
 
-/*
- * next_and_idx encodes both the address of the next pte_chain and the
- * offset of the lowest-index used pte in ptes[] (which is equal also
- * to the offset of the highest-index unused pte in ptes[], plus one).
- */
-struct pte_chain {
-	unsigned long next_and_idx;
-	pte_addr_t ptes[NRPTE];
-} ____cacheline_aligned;
+		/* page_table_lock to protect against threads */
+		spin_lock(&mm->page_table_lock);
+		if (likely(!vma->anon_vma)) {
+			vma->anon_vma = anon_vma;
+			list_add(&vma->anon_vma_node, &anon_vma->head);
+			allocated = NULL;
+		}
+		spin_unlock(&mm->page_table_lock);
+		if (unlikely(allocated))
+			anon_vma_free(allocated);
+	}
+	return 0;
+}
+
+void __anon_vma_merge(struct vm_area_struct *vma, struct vm_area_struct *next)
+{
+	if (!vma->anon_vma) {
+		BUG_ON(!next->anon_vma);
+		vma->anon_vma = next->anon_vma;
+		list_add(&vma->anon_vma_node, &next->anon_vma_node);
+	} else {
+		/* if they're both non-null they must be the same */
+		BUG_ON(vma->anon_vma != next->anon_vma);
+	}
+	list_del(&next->anon_vma_node);
+}
+
+void __anon_vma_link(struct vm_area_struct *vma)
+{
+	struct anon_vma *anon_vma = vma->anon_vma;
+
+	if (anon_vma) {
+		list_add(&vma->anon_vma_node, &anon_vma->head);
+		validate_anon_vma(vma);
+	}
+}
+
+void anon_vma_link(struct vm_area_struct *vma)
+{
+	struct anon_vma *anon_vma = vma->anon_vma;
+
+	if (anon_vma) {
+		spin_lock(&anon_vma->lock);
+		list_add(&vma->anon_vma_node, &anon_vma->head);
+		validate_anon_vma(vma);
+		spin_unlock(&anon_vma->lock);
+	}
+}
+
+void anon_vma_unlink(struct vm_area_struct *vma)
+{
+	struct anon_vma *anon_vma = vma->anon_vma;
+	int empty;
+
+	if (!anon_vma)
+		return;
 
-kmem_cache_t	*pte_chain_cache;
+	spin_lock(&anon_vma->lock);
+	validate_anon_vma(vma);
+	list_del(&vma->anon_vma_node);
 
-static inline struct pte_chain *pte_chain_next(struct pte_chain *pte_chain)
+	/* We must garbage collect the anon_vma if it's empty */
+	empty = list_empty(&anon_vma->head);
+	spin_unlock(&anon_vma->lock);
+
+	if (empty)
+		anon_vma_free(anon_vma);
+}
+
+static void anon_vma_ctor(void *data, kmem_cache_t *cachep, unsigned long flags)
 {
-	return (struct pte_chain *)(pte_chain->next_and_idx & ~NRPTE);
+	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
+						SLAB_CTOR_CONSTRUCTOR) {
+		struct anon_vma *anon_vma = data;
+
+		spin_lock_init(&anon_vma->lock);
+		INIT_LIST_HEAD(&anon_vma->head);
+	}
 }
 
-static inline struct pte_chain *pte_chain_ptr(unsigned long pte_chain_addr)
+void __init anon_vma_init(void)
 {
-	return (struct pte_chain *)(pte_chain_addr & ~NRPTE);
+	anon_vma_cachep = kmem_cache_create("anon_vma",
+		sizeof(struct anon_vma), 0, SLAB_PANIC, anon_vma_ctor, NULL);
 }
 
-static inline int pte_chain_idx(struct pte_chain *pte_chain)
+/* this needs the page->flags PG_maplock held */
+static inline void clear_page_anon(struct page *page)
 {
-	return pte_chain->next_and_idx & NRPTE;
+	BUG_ON(!page->mapping);
+	page->mapping = NULL;
+	ClearPageAnon(page);
 }
 
+/*
+ * At what user virtual address is page expected in vma?
+ */
 static inline unsigned long
-pte_chain_encode(struct pte_chain *pte_chain, int idx)
+vma_address(struct page *page, struct vm_area_struct *vma)
 {
-	return (unsigned long)pte_chain | idx;
+	pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+	unsigned long address;
+
+	address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
+	if (unlikely(address < vma->vm_start || address >= vma->vm_end)) {
+		/* page should be within any vma from prio_tree_next */
+		BUG_ON(!PageAnon(page));
+		return -EFAULT;
+	}
+	return address;
 }
 
 /*
- * pte_chain list management policy:
- *
- * - If a page has a pte_chain list then it is shared by at least two processes,
- *   because a single sharing uses PageDirect. (Well, this isn't true yet,
- *   coz this code doesn't collapse singletons back to PageDirect on the remove
- *   path).
- * - A pte_chain list has free space only in the head member - all succeeding
- *   members are 100% full.
- * - If the head element has free space, it occurs in its leading slots.
- * - All free space in the pte_chain is at the start of the head member.
- * - Insertion into the pte_chain puts a pte pointer in the last free slot of
- *   the head member.
- * - Removal from a pte chain moves the head pte of the head member onto the
- *   victim pte and frees the head member if it became empty.
+ * Subfunctions of page_referenced: page_referenced_one called
+ * repeatedly from either page_referenced_anon or page_referenced_file.
  */
+static int page_referenced_one(struct page *page,
+	struct vm_area_struct *vma, unsigned int *mapcount)
+{
+	struct mm_struct *mm = vma->vm_mm;
+	unsigned long address;
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+	int referenced = 0;
+
+	if (!mm->rss)
+		goto out;
+	address = vma_address(page, vma);
+	if (address == -EFAULT)
+		goto out;
+
+	if (!spin_trylock(&mm->page_table_lock))
+		goto out;
+
+	pgd = pgd_offset(mm, address);
+	if (!pgd_present(*pgd))
+		goto out_unlock;
+
+	pmd = pmd_offset(pgd, address);
+	if (!pmd_present(*pmd))
+		goto out_unlock;
+
+	pte = pte_offset_map(pmd, address);
+	if (!pte_present(*pte))
+		goto out_unmap;
+
+	if (page_to_pfn(page) != pte_pfn(*pte))
+		goto out_unmap;
+
+	if (ptep_test_and_clear_young(pte))
+		referenced++;
+
+	(*mapcount)--;
+
+out_unmap:
+	pte_unmap(pte);
+out_unlock:
+	spin_unlock(&mm->page_table_lock);
+out:
+	return referenced;
+}
+
+static inline int page_referenced_anon(struct page *page)
+{
+	unsigned int mapcount = page->mapcount;
+	struct anon_vma *anon_vma = (struct anon_vma *) page->mapping;
+	struct vm_area_struct *vma;
+	int referenced = 0;
+
+	spin_lock(&anon_vma->lock);
+	BUG_ON(list_empty(&anon_vma->head));
+	list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
+		referenced += page_referenced_one(page, vma, &mapcount);
+		if (!mapcount)
+			break;
+	}
+	spin_unlock(&anon_vma->lock);
+	return referenced;
+}
 
 /**
- ** VM stuff below this comment
- **/
+ * page_referenced_file - referenced check for object-based rmap
+ * @page: the page we're checking references on.
+ *
+ * For an object-based mapped page, find all the places it is mapped and
+ * check/clear the referenced flag.  This is done by following the page->mapping
+ * pointer, then walking the chain of vmas it holds.  It returns the number
+ * of references it found.
+ *
+ * This function is only called from page_referenced for object-based pages.
+ *
+ * The spinlock address_space->i_mmap_lock is tried.  If it can't be gotten,
+ * assume a reference count of 0, so try_to_unmap will then have a go.
+ */
+static inline int page_referenced_file(struct page *page)
+{
+	unsigned int mapcount = page->mapcount;
+	struct address_space *mapping = page->mapping;
+	pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+	struct vm_area_struct *vma = NULL;
+	struct prio_tree_iter iter;
+	int referenced = 0;
+
+	if (!spin_trylock(&mapping->i_mmap_lock))
+		return 0;
+
+	while ((vma = vma_prio_tree_next(vma, &mapping->i_mmap,
+					&iter, pgoff, pgoff)) != NULL) {
+		if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE))
+				  == (VM_LOCKED|VM_MAYSHARE)) {
+			referenced++;
+			break;
+		}
+		referenced += page_referenced_one(page, vma, &mapcount);
+		if (!mapcount)
+			break;
+	}
+
+	spin_unlock(&mapping->i_mmap_lock);
+	return referenced;
+}
 
 /**
  * page_referenced - test if the page was referenced
  * @page: the page to test
  *
  * Quick test_and_clear_referenced for all mappings to a page,
- * returns the number of processes which referenced the page.
+ * returns the number of ptes which referenced the page.
  * Caller needs to hold the rmap lock.
- *
- * If the page has a single-entry pte_chain, collapse that back to a PageDirect
- * representation.  This way, it's only done under memory pressure.
  */
-int fastcall page_referenced(struct page * page)
+int page_referenced(struct page *page)
 {
-	struct pte_chain *pc;
 	int referenced = 0;
 
 	if (page_test_and_clear_young(page))
@@ -135,218 +317,183 @@ int fastcall page_referenced(struct page * page)
 	if (TestClearPageReferenced(page))
 		referenced++;
 
-	if (PageDirect(page)) {
-		pte_t *pte = rmap_ptep_map(page->pte.direct);
-		if (ptep_test_and_clear_young(pte))
-			referenced++;
-		rmap_ptep_unmap(pte);
-	} else {
-		int nr_chains = 0;
-
-		/* Check all the page tables mapping this page. */
-		for (pc = page->pte.chain; pc; pc = pte_chain_next(pc)) {
-			int i;
-
-			for (i = pte_chain_idx(pc); i < NRPTE; i++) {
-				pte_addr_t pte_paddr = pc->ptes[i];
-				pte_t *p;
-
-				p = rmap_ptep_map(pte_paddr);
-				if (ptep_test_and_clear_young(p))
-					referenced++;
-				rmap_ptep_unmap(p);
-				nr_chains++;
-			}
-		}
-		if (nr_chains == 1) {
-			pc = page->pte.chain;
-			page->pte.direct = pc->ptes[NRPTE-1];
-			SetPageDirect(page);
-			pc->ptes[NRPTE-1] = 0;
-			__pte_chain_free(pc);
-		}
+	if (page->mapcount && page->mapping) {
+		if (PageAnon(page))
+			referenced += page_referenced_anon(page);
+		else
+			referenced += page_referenced_file(page);
 	}
 	return referenced;
 }
 
 /**
- * page_add_rmap - add reverse mapping entry to a page
- * @page: the page to add the mapping to
- * @ptep: the page table entry mapping this page
+ * page_add_anon_rmap - add pte mapping to an anonymous page
+ * @page:	the page to add the mapping to
+ * @vma:	the vm area in which the mapping is added
+ * @address:	the user virtual address mapped
  *
- * Add a new pte reverse mapping to a page.
  * The caller needs to hold the mm->page_table_lock.
  */
-struct pte_chain * fastcall
-page_add_rmap(struct page *page, pte_t *ptep, struct pte_chain *pte_chain)
+void page_add_anon_rmap(struct page *page,
+	struct vm_area_struct *vma, unsigned long address)
 {
-	pte_addr_t pte_paddr = ptep_to_paddr(ptep);
-	struct pte_chain *cur_pte_chain;
+	struct anon_vma *anon_vma = vma->anon_vma;
+	pgoff_t index;
 
-	if (PageReserved(page))
-		return pte_chain;
+	BUG_ON(PageReserved(page));
+	BUG_ON(!anon_vma);
 
-	rmap_lock(page);
+	index = (address - vma->vm_start) >> PAGE_SHIFT;
+	index += vma->vm_pgoff;
+	index >>= PAGE_CACHE_SHIFT - PAGE_SHIFT;
 
-	if (page->pte.direct == 0) {
-		page->pte.direct = pte_paddr;
-		SetPageDirect(page);
-		if (!page->mapping) {
-			SetPageAnon(page);
-			page->mapping = ANON_MAPPING_DEBUG;
-		}
+	/*
+	 * Setting and clearing PG_anon must always happen inside
+	 * page_map_lock to avoid races between mapping and
+	 * unmapping on different processes of the same
+	 * shared cow swapcache page. And while we take the
+	 * page_map_lock PG_anon cannot change from under us.
+	 * Actually PG_anon cannot change under fork either
+	 * since fork holds a reference on the page so it cannot
+	 * be unmapped under fork and in turn copy_page_range is
+	 * allowed to read PG_anon outside the page_map_lock.
+	 */
+	page_map_lock(page);
+	if (!page->mapcount) {
+		BUG_ON(PageAnon(page));
+		BUG_ON(page->mapping);
+		SetPageAnon(page);
+		page->index = index;
+		page->mapping = (struct address_space *) anon_vma;
 		inc_page_state(nr_mapped);
-		goto out;
-	}
-
-	if (PageDirect(page)) {
-		/* Convert a direct pointer into a pte_chain */
-		ClearPageDirect(page);
-		pte_chain->ptes[NRPTE-1] = page->pte.direct;
-		pte_chain->ptes[NRPTE-2] = pte_paddr;
-		pte_chain->next_and_idx = pte_chain_encode(NULL, NRPTE-2);
-		page->pte.direct = 0;
-		page->pte.chain = pte_chain;
-		pte_chain = NULL;	/* We consumed it */
-		goto out;
-	}
-
-	cur_pte_chain = page->pte.chain;
-	if (cur_pte_chain->ptes[0]) {	/* It's full */
-		pte_chain->next_and_idx = pte_chain_encode(cur_pte_chain,
-								NRPTE - 1);
-		page->pte.chain = pte_chain;
-		pte_chain->ptes[NRPTE-1] = pte_paddr;
-		pte_chain = NULL;	/* We consumed it */
-		goto out;
+	} else {
+		BUG_ON(!PageAnon(page));
+		BUG_ON(page->index != index);
+		BUG_ON(page->mapping != (struct address_space *) anon_vma);
 	}
-	cur_pte_chain->ptes[pte_chain_idx(cur_pte_chain) - 1] = pte_paddr;
-	cur_pte_chain->next_and_idx--;
-out:
-	rmap_unlock(page);
-	return pte_chain;
+	page->mapcount++;
+	page_map_unlock(page);
 }
 
 /**
- * page_remove_rmap - take down reverse mapping to a page
- * @page: page to remove mapping from
- * @ptep: page table entry to remove
+ * page_add_file_rmap - add pte mapping to a file page
+ * @page: the page to add the mapping to
  *
- * Removes the reverse mapping from the pte_chain of the page,
- * after that the caller can clear the page table entry and free
- * the page.
- * Caller needs to hold the mm->page_table_lock.
+ * The caller needs to hold the mm->page_table_lock.
  */
-void fastcall page_remove_rmap(struct page *page, pte_t *ptep)
+void page_add_file_rmap(struct page *page)
 {
-	pte_addr_t pte_paddr = ptep_to_paddr(ptep);
-	struct pte_chain *pc;
-
+	BUG_ON(PageAnon(page));
 	if (!pfn_valid(page_to_pfn(page)) || PageReserved(page))
 		return;
 
-	rmap_lock(page);
+	page_map_lock(page);
+	if (!page->mapcount)
+		inc_page_state(nr_mapped);
+	page->mapcount++;
+	page_map_unlock(page);
+}
 
-	if (!page_mapped(page))
-		goto out_unlock;	/* remap_page_range() from a driver? */
+/**
+ * page_remove_rmap - take down pte mapping from a page
+ * @page: page to remove mapping from
+ *
+ * Caller needs to hold the mm->page_table_lock.
+ */
+void page_remove_rmap(struct page *page)
+{
+	BUG_ON(PageReserved(page));
+	BUG_ON(!page->mapcount);
 
-	if (PageDirect(page)) {
-		if (page->pte.direct == pte_paddr) {
-			page->pte.direct = 0;
-			ClearPageDirect(page);
-			goto out;
-		}
-	} else {
-		struct pte_chain *start = page->pte.chain;
-		struct pte_chain *next;
-		int victim_i = pte_chain_idx(start);
-
-		for (pc = start; pc; pc = next) {
-			int i;
-
-			next = pte_chain_next(pc);
-			if (next)
-				prefetch(next);
-			for (i = pte_chain_idx(pc); i < NRPTE; i++) {
-				pte_addr_t pa = pc->ptes[i];
-
-				if (pa != pte_paddr)
-					continue;
-				pc->ptes[i] = start->ptes[victim_i];
-				start->ptes[victim_i] = 0;
-				if (victim_i == NRPTE-1) {
-					/* Emptied a pte_chain */
-					page->pte.chain = pte_chain_next(start);
-					__pte_chain_free(start);
-				} else {
-					start->next_and_idx++;
-				}
-				goto out;
-			}
-		}
-	}
-out:
-	if (!page_mapped(page)) {
+	page_map_lock(page);
+	page->mapcount--;
+	if (!page->mapcount) {
 		if (page_test_and_clear_dirty(page))
 			set_page_dirty(page);
 		if (PageAnon(page))
 			clear_page_anon(page);
 		dec_page_state(nr_mapped);
 	}
-out_unlock:
-	rmap_unlock(page);
+	page_map_unlock(page);
 }
 
-/**
- * try_to_unmap_one - worker function for try_to_unmap
- * @page: page to unmap
- * @ptep: page table entry to unmap from page
- *
- * Internal helper function for try_to_unmap, called for each page
- * table entry mapping a page. Because locking order here is opposite
- * to the locking order used by the page fault path, we use trylocks.
- * Locking:
- *	    page lock			shrink_list(), trylock
- *		rmap lock		shrink_list()
- *		    mm->page_table_lock	try_to_unmap_one(), trylock
+/*
+ * Subfunctions of try_to_unmap: try_to_unmap_one called
+ * repeatedly from either try_to_unmap_anon or try_to_unmap_file.
  */
-static int fastcall try_to_unmap_one(struct page * page, pte_addr_t paddr)
+static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma)
 {
-	pte_t *ptep = rmap_ptep_map(paddr);
-	unsigned long address = ptep_to_address(ptep);
-	struct mm_struct * mm = ptep_to_mm(ptep);
-	struct vm_area_struct * vma;
-	pte_t pte;
-	int ret;
-
-	if (!mm)
-		BUG();
+	struct mm_struct *mm = vma->vm_mm;
+	unsigned long address;
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+	pte_t pteval;
+	int ret = SWAP_AGAIN;
+
+	if (!mm->rss)
+		goto out;
+	address = vma_address(page, vma);
+	if (address == -EFAULT)
+		goto out;
 
 	/*
 	 * We need the page_table_lock to protect us from page faults,
 	 * munmap, fork, etc...
 	 */
-	if (!spin_trylock(&mm->page_table_lock)) {
-		rmap_ptep_unmap(ptep);
-		return SWAP_AGAIN;
-	}
+	if (!spin_trylock(&mm->page_table_lock))
+		goto out;
 
-	/* unmap_vmas drops page_table_lock with vma unlinked */
-	vma = find_vma(mm, address);
-	if (!vma) {
-		ret = SWAP_FAIL;
+	pgd = pgd_offset(mm, address);
+	if (!pgd_present(*pgd))
 		goto out_unlock;
+
+	pmd = pmd_offset(pgd, address);
+	if (!pmd_present(*pmd))
+		goto out_unlock;
+
+	pte = pte_offset_map(pmd, address);
+	if (!pte_present(*pte))
+		goto out_unmap;
+
+	if (page_to_pfn(page) != pte_pfn(*pte))
+		goto out_unmap;
+
+	/*
+	 * If the page is mlock()d, we cannot swap it out.
+	 * If it's recently referenced (perhaps page_referenced
+	 * skipped over this mm) then we should reactivate it.
+	 */
+	if ((vma->vm_flags & (VM_LOCKED|VM_RESERVED)) ||
+			ptep_test_and_clear_young(pte)) {
+		ret = SWAP_FAIL;
+		goto out_unmap;
 	}
 
-	/* The page is mlock()d, we cannot swap it out. */
-	if (vma->vm_flags & VM_LOCKED) {
+	/*
+	 * Don't pull an anonymous page out from under get_user_pages.
+	 * GUP carefully breaks COW and raises page count (while holding
+	 * page_table_lock, as we have here) to make sure that the page
+	 * cannot be freed.  If we unmap that page here, a user write
+	 * access to the virtual address will bring back the page, but
+	 * its raised count will (ironically) be taken to mean it's not
+	 * an exclusive swap page, do_wp_page will replace it by a copy
+	 * page, and the user never get to see the data GUP was holding
+	 * the original page for.
+	 */
+	if (PageSwapCache(page) &&
+	    page_count(page) != page->mapcount + 2) {
 		ret = SWAP_FAIL;
-		goto out_unlock;
+		goto out_unmap;
 	}
 
 	/* Nuke the page table entry. */
 	flush_cache_page(vma, address);
-	pte = ptep_clear_flush(vma, address, ptep);
+	pteval = ptep_clear_flush(vma, address, pte);
+
+	/* Move the dirty bit to the physical page now the pte is gone. */
+	if (pte_dirty(pteval))
+		set_page_dirty(page);
 
 	if (PageAnon(page)) {
 		swp_entry_t entry = { .val = page->private };
@@ -356,189 +503,283 @@ static int fastcall try_to_unmap_one(struct page * page, pte_addr_t paddr)
 		 */
 		BUG_ON(!PageSwapCache(page));
 		swap_duplicate(entry);
-		set_pte(ptep, swp_entry_to_pte(entry));
-		BUG_ON(pte_file(*ptep));
-	} else {
-		/*
-		 * If a nonlinear mapping then store the file page offset
-		 * in the pte.
-		 */
-		BUG_ON(!page->mapping);
-		if (page->index != linear_page_index(vma, address)) {
-			set_pte(ptep, pgoff_to_pte(page->index));
-			BUG_ON(!pte_file(*ptep));
-		}
+		set_pte(pte, swp_entry_to_pte(entry));
+		BUG_ON(pte_file(*pte));
 	}
 
-	/* Move the dirty bit to the physical page now the pte is gone. */
-	if (pte_dirty(pte))
-		set_page_dirty(page);
-
 	mm->rss--;
+	BUG_ON(!page->mapcount);
+	page->mapcount--;
 	page_cache_release(page);
-	ret = SWAP_SUCCESS;
 
+out_unmap:
+	pte_unmap(pte);
 out_unlock:
-	rmap_ptep_unmap(ptep);
 	spin_unlock(&mm->page_table_lock);
+out:
 	return ret;
 }
 
-/**
- * try_to_unmap - try to remove all page table mappings to a page
- * @page: the page to get unmapped
+/*
+ * objrmap doesn't work for nonlinear VMAs because the assumption that
+ * offset-into-file correlates with offset-into-virtual-addresses does not hold.
+ * Consequently, given a particular page and its ->index, we cannot locate the
+ * ptes which are mapping that page without an exhaustive linear search.
  *
- * Tries to remove all the page table entries which are mapping this
- * page, used in the pageout path.  Caller must hold the page lock
- * and its rmap lock.  Return values are:
+ * So what this code does is a mini "virtual scan" of each nonlinear VMA which
+ * maps the file to which the target page belongs.  The ->vm_private_data field
+ * holds the current cursor into that scan.  Successive searches will circulate
+ * around the vma's virtual address space.
  *
- * SWAP_SUCCESS	- we succeeded in removing all mappings
- * SWAP_AGAIN	- we missed a trylock, try again later
- * SWAP_FAIL	- the page is unswappable
+ * So as more replacement pressure is applied to the pages in a nonlinear VMA,
+ * more scanning pressure is placed against them as well.   Eventually pages
+ * will become fully unmapped and are eligible for eviction.
+ *
+ * For very sparsely populated VMAs this is a little inefficient - chances are
+ * there there won't be many ptes located within the scan cluster.  In this case
+ * maybe we could scan further - to the end of the pte page, perhaps.
  */
-int fastcall try_to_unmap(struct page * page)
+#define CLUSTER_SIZE	min(32*PAGE_SIZE, PMD_SIZE)
+#define CLUSTER_MASK	(~(CLUSTER_SIZE - 1))
+
+static int try_to_unmap_cluster(unsigned long cursor,
+	unsigned int *mapcount, struct vm_area_struct *vma)
 {
-	struct pte_chain *pc, *next_pc, *start;
-	int ret = SWAP_SUCCESS;
-	int victim_i;
-
-	/* This page should not be on the pageout lists. */
-	if (PageReserved(page))
-		BUG();
-	if (!PageLocked(page))
-		BUG();
-
-	if (PageDirect(page)) {
-		ret = try_to_unmap_one(page, page->pte.direct);
-		if (ret == SWAP_SUCCESS) {
-			page->pte.direct = 0;
-			ClearPageDirect(page);
-		}
-		goto out;
-	}
+	struct mm_struct *mm = vma->vm_mm;
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+	pte_t pteval;
+	struct page *page;
+	unsigned long address;
+	unsigned long end;
+	unsigned long pfn;
 
-	start = page->pte.chain;
-	victim_i = pte_chain_idx(start);
-	for (pc = start; pc; pc = next_pc) {
-		int i;
-
-		next_pc = pte_chain_next(pc);
-		if (next_pc)
-			prefetch(next_pc);
-		for (i = pte_chain_idx(pc); i < NRPTE; i++) {
-			pte_addr_t pte_paddr = pc->ptes[i];
-
-			switch (try_to_unmap_one(page, pte_paddr)) {
-			case SWAP_SUCCESS:
-				/*
-				 * Release a slot.  If we're releasing the
-				 * first pte in the first pte_chain then
-				 * pc->ptes[i] and start->ptes[victim_i] both
-				 * refer to the same thing.  It works out.
-				 */
-				pc->ptes[i] = start->ptes[victim_i];
-				start->ptes[victim_i] = 0;
-				victim_i++;
-				if (victim_i == NRPTE) {
-					page->pte.chain = pte_chain_next(start);
-					__pte_chain_free(start);
-					start = page->pte.chain;
-					victim_i = 0;
-				} else {
-					start->next_and_idx++;
-				}
-				break;
-			case SWAP_AGAIN:
-				/* Skip this pte, remembering status. */
-				ret = SWAP_AGAIN;
-				continue;
-			case SWAP_FAIL:
-				ret = SWAP_FAIL;
-				goto out;
-			}
-		}
-	}
-out:
-	if (!page_mapped(page)) {
-		if (page_test_and_clear_dirty(page))
+	/*
+	 * We need the page_table_lock to protect us from page faults,
+	 * munmap, fork, etc...
+	 */
+	if (!spin_trylock(&mm->page_table_lock))
+		return SWAP_FAIL;
+
+	address = (vma->vm_start + cursor) & CLUSTER_MASK;
+	end = address + CLUSTER_SIZE;
+	if (address < vma->vm_start)
+		address = vma->vm_start;
+	if (end > vma->vm_end)
+		end = vma->vm_end;
+
+	pgd = pgd_offset(mm, address);
+	if (!pgd_present(*pgd))
+		goto out_unlock;
+
+	pmd = pmd_offset(pgd, address);
+	if (!pmd_present(*pmd))
+		goto out_unlock;
+
+	for (pte = pte_offset_map(pmd, address);
+			address < end; pte++, address += PAGE_SIZE) {
+
+		if (!pte_present(*pte))
+			continue;
+
+		pfn = pte_pfn(*pte);
+		if (!pfn_valid(pfn))
+			continue;
+
+		page = pfn_to_page(pfn);
+		BUG_ON(PageAnon(page));
+		if (PageReserved(page))
+			continue;
+
+		if (ptep_test_and_clear_young(pte))
+			continue;
+
+		/* Nuke the page table entry. */
+		flush_cache_page(vma, address);
+		pteval = ptep_clear_flush(vma, address, pte);
+
+		/* If nonlinear, store the file page offset in the pte. */
+		if (page->index != linear_page_index(vma, address))
+			set_pte(pte, pgoff_to_pte(page->index));
+
+		/* Move the dirty bit to the physical page now the pte is gone. */
+		if (pte_dirty(pteval))
 			set_page_dirty(page);
-		if (PageAnon(page))
-			clear_page_anon(page);
-		dec_page_state(nr_mapped);
-		ret = SWAP_SUCCESS;
-	}
-	return ret;
-}
 
-/**
- ** No more VM stuff below this comment, only pte_chain helper
- ** functions.
- **/
+		page_remove_rmap(page);
+		page_cache_release(page);
+		mm->rss--;
+		(*mapcount)--;
+	}
 
-static void pte_chain_ctor(void *p, kmem_cache_t *cachep, unsigned long flags)
-{
-	struct pte_chain *pc = p;
+	pte_unmap(pte);
 
-	memset(pc, 0, sizeof(*pc));
+out_unlock:
+	spin_unlock(&mm->page_table_lock);
+	return SWAP_AGAIN;
 }
 
-DEFINE_PER_CPU(struct pte_chain *, local_pte_chain) = 0;
-
-/**
- * __pte_chain_free - free pte_chain structure
- * @pte_chain: pte_chain struct to free
- */
-void __pte_chain_free(struct pte_chain *pte_chain)
+static inline int try_to_unmap_anon(struct page *page)
 {
-	struct pte_chain **pte_chainp;
-
-	pte_chainp = &get_cpu_var(local_pte_chain);
-	if (pte_chain->next_and_idx)
-		pte_chain->next_and_idx = 0;
-	if (*pte_chainp)
-		kmem_cache_free(pte_chain_cache, *pte_chainp);
-	*pte_chainp = pte_chain;
-	put_cpu_var(local_pte_chain);
+	struct anon_vma *anon_vma = (struct anon_vma *) page->mapping;
+	struct vm_area_struct *vma;
+	int ret = SWAP_AGAIN;
+
+	spin_lock(&anon_vma->lock);
+	BUG_ON(list_empty(&anon_vma->head));
+	list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
+		ret = try_to_unmap_one(page, vma);
+		if (ret == SWAP_FAIL || !page->mapcount)
+			break;
+	}
+	spin_unlock(&anon_vma->lock);
+	return ret;
 }
 
-/*
- * pte_chain_alloc(): allocate a pte_chain structure for use by page_add_rmap().
+/**
+ * try_to_unmap_file - unmap file page using the object-based rmap method
+ * @page: the page to unmap
+ *
+ * Find all the mappings of a page using the mapping pointer and the vma chains
+ * contained in the address_space struct it points to.
+ *
+ * This function is only called from try_to_unmap for object-based pages.
  *
- * The caller of page_add_rmap() must perform the allocation because
- * page_add_rmap() is invariably called under spinlock.  Often, page_add_rmap()
- * will not actually use the pte_chain, because there is space available in one
- * of the existing pte_chains which are attached to the page.  So the case of
- * allocating and then freeing a single pte_chain is specially optimised here,
- * with a one-deep per-cpu cache.
+ * The spinlock address_space->i_mmap_lock is tried.  If it can't be gotten,
+ * return a temporary error.
  */
-struct pte_chain *pte_chain_alloc(int gfp_flags)
+static inline int try_to_unmap_file(struct page *page)
 {
-	struct pte_chain *ret;
-	struct pte_chain **pte_chainp;
+	struct address_space *mapping = page->mapping;
+	pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+	struct vm_area_struct *vma = NULL;
+	struct prio_tree_iter iter;
+	int ret = SWAP_AGAIN;
+	unsigned long cursor;
+	unsigned long max_nl_cursor = 0;
+	unsigned long max_nl_size = 0;
+	unsigned int mapcount;
+
+	if (!spin_trylock(&mapping->i_mmap_lock))
+		return ret;
+
+	while ((vma = vma_prio_tree_next(vma, &mapping->i_mmap,
+					&iter, pgoff, pgoff)) != NULL) {
+		ret = try_to_unmap_one(page, vma);
+		if (ret == SWAP_FAIL || !page->mapcount)
+			goto out;
+	}
 
-	might_sleep_if(gfp_flags & __GFP_WAIT);
+	if (list_empty(&mapping->i_mmap_nonlinear))
+		goto out;
 
-	pte_chainp = &get_cpu_var(local_pte_chain);
-	if (*pte_chainp) {
-		ret = *pte_chainp;
-		*pte_chainp = NULL;
-		put_cpu_var(local_pte_chain);
-	} else {
-		put_cpu_var(local_pte_chain);
-		ret = kmem_cache_alloc(pte_chain_cache, gfp_flags);
+	list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
+						shared.vm_set.list) {
+		if (vma->vm_flags & (VM_LOCKED|VM_RESERVED))
+			continue;
+		cursor = (unsigned long) vma->vm_private_data;
+		if (cursor > max_nl_cursor)
+			max_nl_cursor = cursor;
+		cursor = vma->vm_end - vma->vm_start;
+		if (cursor > max_nl_size)
+			max_nl_size = cursor;
 	}
+
+	if (max_nl_size == 0)	/* any nonlinears locked or reserved */
+		goto out;
+
+	/*
+	 * We don't try to search for this page in the nonlinear vmas,
+	 * and page_referenced wouldn't have found it anyway.  Instead
+	 * just walk the nonlinear vmas trying to age and unmap some.
+	 * The mapcount of the page we came in with is irrelevant,
+	 * but even so use it as a guide to how hard we should try?
+	 */
+	mapcount = page->mapcount;
+	page_map_unlock(page);
+	cond_resched_lock(&mapping->i_mmap_lock);
+
+	max_nl_size = (max_nl_size + CLUSTER_SIZE - 1) & CLUSTER_MASK;
+	if (max_nl_cursor == 0)
+		max_nl_cursor = CLUSTER_SIZE;
+
+	do {
+		list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
+						shared.vm_set.list) {
+			if (vma->vm_flags & (VM_LOCKED|VM_RESERVED))
+				continue;
+			cursor = (unsigned long) vma->vm_private_data;
+			while (vma->vm_mm->rss &&
+				cursor < max_nl_cursor &&
+				cursor < vma->vm_end - vma->vm_start) {
+				ret = try_to_unmap_cluster(
+						cursor, &mapcount, vma);
+				if (ret == SWAP_FAIL)
+					break;
+				cursor += CLUSTER_SIZE;
+				vma->vm_private_data = (void *) cursor;
+				if ((int)mapcount <= 0)
+					goto relock;
+			}
+			if (ret != SWAP_FAIL)
+				vma->vm_private_data =
+					(void *) max_nl_cursor;
+			ret = SWAP_AGAIN;
+		}
+		cond_resched_lock(&mapping->i_mmap_lock);
+		max_nl_cursor += CLUSTER_SIZE;
+	} while (max_nl_cursor <= max_nl_size);
+
+	/*
+	 * Don't loop forever (perhaps all the remaining pages are
+	 * in locked vmas).  Reset cursor on all unreserved nonlinear
+	 * vmas, now forgetting on which ones it had fallen behind.
+	 */
+	list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
+						shared.vm_set.list) {
+		if (!(vma->vm_flags & VM_RESERVED))
+			vma->vm_private_data = 0;
+	}
+relock:
+	page_map_lock(page);
+out:
+	spin_unlock(&mapping->i_mmap_lock);
 	return ret;
 }
 
-void __init pte_chain_init(void)
+/**
+ * try_to_unmap - try to remove all page table mappings to a page
+ * @page: the page to get unmapped
+ *
+ * Tries to remove all the page table entries which are mapping this
+ * page, used in the pageout path.  Caller must hold the page lock
+ * and its rmap lock.  Return values are:
+ *
+ * SWAP_SUCCESS	- we succeeded in removing all mappings
+ * SWAP_AGAIN	- we missed a trylock, try again later
+ * SWAP_FAIL	- the page is unswappable
+ */
+int try_to_unmap(struct page *page)
 {
-	pte_chain_cache = kmem_cache_create(	"pte_chain",
-						sizeof(struct pte_chain),
-						sizeof(struct pte_chain),
-						0,
-						pte_chain_ctor,
-						NULL);
-
-	if (!pte_chain_cache)
-		panic("failed to create pte_chain cache!\n");
+	int ret;
+
+	BUG_ON(PageReserved(page));
+	BUG_ON(!PageLocked(page));
+	BUG_ON(!page->mapcount);
+
+	if (PageAnon(page))
+		ret = try_to_unmap_anon(page);
+	else
+		ret = try_to_unmap_file(page);
+
+	if (!page->mapcount) {
+		if (page_test_and_clear_dirty(page))
+			set_page_dirty(page);
+		if (PageAnon(page))
+			clear_page_anon(page);
+		dec_page_state(nr_mapped);
+		ret = SWAP_SUCCESS;
+	}
+	return ret;
 }
diff --git a/mm/shmem.c b/mm/shmem.c
index f1438c77e..5a6d56a45 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -8,6 +8,7 @@
  *		 2002 Red Hat Inc.
  * Copyright (C) 2002-2003 Hugh Dickins.
  * Copyright (C) 2002-2003 VERITAS Software Corporation.
+ * Copyright (C) 2004 Andi Kleen, SuSE Labs
  *
  * This file is released under the GPL.
  */
@@ -37,8 +38,11 @@
 #include <linux/vfs.h>
 #include <linux/blkdev.h>
 #include <linux/security.h>
+#include <linux/swapops.h>
+#include <linux/mempolicy.h>
 #include <asm/uaccess.h>
 #include <asm/div64.h>
+#include <asm/pgtable.h>
 
 /* This magic number is used in glibc for posix shared memory */
 #define TMPFS_MAGIC	0x01021994
@@ -783,6 +787,74 @@ redirty:
 	return WRITEPAGE_ACTIVATE;	/* Return with the page locked */
 }
 
+#ifdef CONFIG_NUMA
+static struct page *shmem_swapin_async(struct shared_policy *p,
+				       swp_entry_t entry, unsigned long idx)
+{
+	struct page *page;
+	struct vm_area_struct pvma;
+
+	/* Create a pseudo vma that just contains the policy */
+	memset(&pvma, 0, sizeof(struct vm_area_struct));
+	pvma.vm_end = PAGE_SIZE;
+	pvma.vm_pgoff = idx;
+	pvma.vm_policy = mpol_shared_policy_lookup(p, idx);
+	page = read_swap_cache_async(entry, &pvma, 0);
+	mpol_free(pvma.vm_policy);
+	return page;
+}
+
+struct page *shmem_swapin(struct shmem_inode_info *info, swp_entry_t entry,
+			  unsigned long idx)
+{
+	struct shared_policy *p = &info->policy;
+	int i, num;
+	struct page *page;
+	unsigned long offset;
+
+	num = valid_swaphandles(entry, &offset);
+	for (i = 0; i < num; offset++, i++) {
+		page = shmem_swapin_async(p,
+				swp_entry(swp_type(entry), offset), idx);
+		if (!page)
+			break;
+		page_cache_release(page);
+	}
+	lru_add_drain();	/* Push any new pages onto the LRU now */
+	return shmem_swapin_async(p, entry, idx);
+}
+
+static struct page *
+shmem_alloc_page(unsigned long gfp, struct shmem_inode_info *info,
+		 unsigned long idx)
+{
+	struct vm_area_struct pvma;
+	struct page *page;
+
+	memset(&pvma, 0, sizeof(struct vm_area_struct));
+	pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx);
+	pvma.vm_pgoff = idx;
+	pvma.vm_end = PAGE_SIZE;
+	page = alloc_page_vma(gfp, &pvma, 0);
+	mpol_free(pvma.vm_policy);
+	return page;
+}
+#else
+static inline struct page *
+shmem_swapin(struct shmem_inode_info *info,swp_entry_t entry,unsigned long idx)
+{
+	swapin_readahead(entry, 0, NULL);
+	return read_swap_cache_async(entry, NULL, 0);
+}
+
+static inline struct page *
+shmem_alloc_page(unsigned long gfp,struct shmem_inode_info *info,
+				 unsigned long idx)
+{
+	return alloc_page(gfp);
+}
+#endif
+
 /*
  * shmem_getpage - either get the page from swap or allocate a new one
  *
@@ -790,7 +862,8 @@ redirty:
  * vm. If we swap it in we mark it dirty since we also free the swap
  * entry since a page cannot live in both the swap and page cache
  */
-static int shmem_getpage(struct inode *inode, unsigned long idx, struct page **pagep, enum sgp_type sgp, int *type)
+static int shmem_getpage(struct inode *inode, unsigned long idx,
+			struct page **pagep, enum sgp_type sgp, int *type)
 {
 	struct address_space *mapping = inode->i_mapping;
 	struct shmem_inode_info *info = SHMEM_I(inode);
@@ -840,8 +913,7 @@ repeat:
 			if (majmin == VM_FAULT_MINOR && type)
 				inc_page_state(pgmajfault);
 			majmin = VM_FAULT_MAJOR;
-			swapin_readahead(swap);
-			swappage = read_swap_cache_async(swap);
+			swappage = shmem_swapin(info, swap, idx);
 			if (!swappage) {
 				spin_lock(&info->lock);
 				entry = shmem_swp_alloc(info, idx, sgp);
@@ -946,7 +1018,9 @@ repeat:
 
 		if (!filepage) {
 			spin_unlock(&info->lock);
-			filepage = page_cache_alloc(mapping);
+			filepage = shmem_alloc_page(mapping_gfp_mask(mapping),
+						    info,
+						    idx);
 			if (!filepage) {
 				shmem_unacct_blocks(info->flags, 1);
 				shmem_free_block(inode);
@@ -1069,6 +1143,24 @@ static int shmem_populate(struct vm_area_struct *vma,
 	return 0;
 }
 
+#ifdef CONFIG_NUMA
+int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
+{
+	struct inode *i = vma->vm_file->f_dentry->d_inode;
+	return mpol_set_shared_policy(&SHMEM_I(i)->policy, vma, new);
+}
+
+struct mempolicy *
+shmem_get_policy(struct vm_area_struct *vma, unsigned long addr)
+{
+	struct inode *i = vma->vm_file->f_dentry->d_inode;
+	unsigned long idx;
+
+	idx = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
+	return mpol_shared_policy_lookup(&SHMEM_I(i)->policy, idx);
+}
+#endif
+
 void shmem_lock(struct file *file, int lock)
 {
 	struct inode *inode = file->f_dentry->d_inode;
@@ -1117,6 +1209,7 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
 		info = SHMEM_I(inode);
 		memset(info, 0, (char *)inode - (char *)info);
 		spin_lock_init(&info->lock);
+ 		mpol_shared_policy_init(&info->policy);
 		switch (mode & S_IFMT) {
 		default:
 			init_special_inode(inode, mode, dev);
@@ -1792,6 +1885,7 @@ static struct inode *shmem_alloc_inode(struct super_block *sb)
 
 static void shmem_destroy_inode(struct inode *inode)
 {
+	mpol_free_shared_policy(&SHMEM_I(inode)->policy);
 	kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode));
 }
 
@@ -1808,9 +1902,9 @@ static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
 static int init_inodecache(void)
 {
 	shmem_inode_cachep = kmem_cache_create("shmem_inode_cache",
-					     sizeof(struct shmem_inode_info),
-					     0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
-					     init_once, NULL);
+				sizeof(struct shmem_inode_info),
+				0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
+				init_once, NULL);
 	if (shmem_inode_cachep == NULL)
 		return -ENOMEM;
 	return 0;
@@ -1876,6 +1970,10 @@ static struct super_operations shmem_ops = {
 static struct vm_operations_struct shmem_vm_ops = {
 	.nopage		= shmem_nopage,
 	.populate	= shmem_populate,
+#ifdef CONFIG_NUMA
+	.set_policy     = shmem_set_policy,
+	.get_policy     = shmem_get_policy,
+#endif
 };
 
 static struct super_block *shmem_get_sb(struct file_system_type *fs_type,
diff --git a/mm/slab.c b/mm/slab.c
index 6b3cedfc6..45c5c0549 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -135,11 +135,11 @@
 			 SLAB_POISON | SLAB_HWCACHE_ALIGN | \
 			 SLAB_NO_REAP | SLAB_CACHE_DMA | \
 			 SLAB_MUST_HWCACHE_ALIGN | SLAB_STORE_USER | \
-			 SLAB_RECLAIM_ACCOUNT )
+			 SLAB_RECLAIM_ACCOUNT | SLAB_PANIC)
 #else
 # define CREATE_MASK	(SLAB_HWCACHE_ALIGN | SLAB_NO_REAP | \
 			 SLAB_CACHE_DMA | SLAB_MUST_HWCACHE_ALIGN | \
-			 SLAB_RECLAIM_ACCOUNT)
+			 SLAB_RECLAIM_ACCOUNT | SLAB_PANIC)
 #endif
 
 /*
@@ -161,10 +161,9 @@
  * is less than 512 (PAGE_SIZE<<3), but greater than 256.
  */
 
-#define BUFCTL_END	0xffffFFFF
-#define BUFCTL_FREE	0xffffFFFE
-#define	SLAB_LIMIT	0xffffFFFD
-typedef unsigned int kmem_bufctl_t;
+#define BUFCTL_END	(((kmem_bufctl_t)(~0U))-0)
+#define BUFCTL_FREE	(((kmem_bufctl_t)(~0U))-1)
+#define	SLAB_LIMIT	(((kmem_bufctl_t)(~0U))-2)
 
 /* Max number of objs-per-slab for caches which use off-slab slabs.
  * Needed to avoid a possible looping condition in cache_grow().
@@ -478,10 +477,12 @@ struct cache_sizes malloc_sizes[] = {
 EXPORT_SYMBOL(malloc_sizes);
 
 /* Must match cache_sizes above. Out of line to keep cache footprint low. */
-static struct cache_names {
+struct cache_names {
 	char *name;
 	char *name_dma;
-} cache_names[] = {
+};
+
+static struct cache_names __initdata cache_names[] = {
 #define CACHE(x) { .name = "size-" #x, .name_dma = "size-" #x "(DMA)" },
 #include <linux/kmalloc_sizes.h>
 	{ 0, }
@@ -613,6 +614,26 @@ static void stop_cpu_timer(int cpu)
 }
 #endif
 
+static struct array_cache *alloc_arraycache(int cpu, int entries, int batchcount)
+{
+	int memsize = sizeof(void*)*entries+sizeof(struct array_cache);
+	struct array_cache *nc = NULL;
+
+	if (cpu != -1) {
+		nc = kmem_cache_alloc_node(kmem_find_general_cachep(memsize,
+					GFP_KERNEL), cpu_to_node(cpu));
+	}
+	if (!nc)
+		nc = kmalloc(memsize, GFP_KERNEL);
+	if (nc) {
+		nc->avail = 0;
+		nc->limit = entries;
+		nc->batchcount = batchcount;
+		nc->touched = 0;
+	}
+	return nc;
+}
+
 static int __devinit cpuup_callback(struct notifier_block *nfb,
 				  unsigned long action,
 				  void *hcpu)
@@ -624,17 +645,11 @@ static int __devinit cpuup_callback(struct notifier_block *nfb,
 	case CPU_UP_PREPARE:
 		down(&cache_chain_sem);
 		list_for_each_entry(cachep, &cache_chain, next) {
-			int memsize;
 			struct array_cache *nc;
 
-			memsize = sizeof(void*)*cachep->limit+sizeof(struct array_cache);
-			nc = kmalloc(memsize, GFP_KERNEL);
+			nc = alloc_arraycache(cpu, cachep->limit, cachep->batchcount);
 			if (!nc)
 				goto bad;
-			nc->avail = 0;
-			nc->limit = cachep->limit;
-			nc->batchcount = cachep->batchcount;
-			nc->touched = 0;
 
 			spin_lock_irq(&cachep->spinlock);
 			cachep->array[cpu] = nc;
@@ -741,11 +756,9 @@ void __init kmem_cache_init(void)
 		 * eliminates "false sharing".
 		 * Note for systems short on memory removing the alignment will
 		 * allow tighter packing of the smaller caches. */
-		sizes->cs_cachep = kmem_cache_create(
-			names->name, sizes->cs_size,
-			ARCH_KMALLOC_MINALIGN, 0, NULL, NULL);
-		if (!sizes->cs_cachep)
-			BUG();
+		sizes->cs_cachep = kmem_cache_create(names->name,
+			sizes->cs_size, ARCH_KMALLOC_MINALIGN,
+			SLAB_PANIC, NULL, NULL);
 
 		/* Inc off-slab bufctl limit until the ceiling is hit. */
 		if (!(OFF_SLAB(sizes->cs_cachep))) {
@@ -753,11 +766,9 @@ void __init kmem_cache_init(void)
 			offslab_limit /= sizeof(kmem_bufctl_t);
 		}
 
-		sizes->cs_dmacachep = kmem_cache_create(
-			names->name_dma, sizes->cs_size,
-			ARCH_KMALLOC_MINALIGN, SLAB_CACHE_DMA, NULL, NULL);
-		if (!sizes->cs_dmacachep)
-			BUG();
+		sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
+			sizes->cs_size, ARCH_KMALLOC_MINALIGN,
+			(SLAB_CACHE_DMA | SLAB_PANIC), NULL, NULL);
 
 		sizes++;
 		names++;
@@ -830,23 +841,32 @@ __initcall(cpucache_init);
  * did not request dmaable memory, we might get it, but that
  * would be relatively rare and ignorable.
  */
-static inline void *kmem_getpages(kmem_cache_t *cachep, unsigned long flags)
+static void *kmem_getpages(kmem_cache_t *cachep, int flags, int nodeid)
 {
+	struct page *page;
 	void *addr;
+	int i;
 
 	flags |= cachep->gfpflags;
-	addr = (void*)__get_free_pages(flags, cachep->gfporder);
-	if (addr) {
-		int i = (1 << cachep->gfporder);
-		struct page *page = virt_to_page(addr);
-
-		if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
-			atomic_add(i, &slab_reclaim_pages);
-		add_page_state(nr_slab, i);
-		while (i--) {
-			SetPageSlab(page);
-			page++;
-		}
+	if (likely(nodeid == -1)) {
+		addr = (void*)__get_free_pages(flags, cachep->gfporder);
+		if (!addr)
+			return NULL;
+		page = virt_to_page(addr);
+	} else {
+		page = alloc_pages_node(nodeid, flags, cachep->gfporder);
+		if (!page)
+			return NULL;
+		addr = page_address(page);
+	}
+
+	i = (1 << cachep->gfporder);
+	if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
+		atomic_add(i, &slab_reclaim_pages);
+	add_page_state(nr_slab, i);
+	while (i--) {
+		SetPageSlab(page);
+		page++;
 	}
 	return addr;
 }
@@ -1380,9 +1400,11 @@ next:
 	up(&cache_chain_sem);
 	unlock_cpu_hotplug();
 opps:
+	if (!cachep && (flags & SLAB_PANIC))
+		panic("kmem_cache_create(): failed to create slab `%s'\n",
+			name);
 	return cachep;
 }
-
 EXPORT_SYMBOL(kmem_cache_create);
 
 static inline void check_irq_off(void)
@@ -1651,6 +1673,21 @@ static void kmem_flagcheck(kmem_cache_t *cachep, int flags)
 	}
 }
 
+static void set_slab_attr(kmem_cache_t *cachep, struct slab *slabp, void *objp)
+{
+	int i;
+	struct page *page;
+
+	/* Nasty!!!!!! I hope this is OK. */
+	i = 1 << cachep->gfporder;
+	page = virt_to_page(objp);
+	do {
+		SET_PAGE_CACHE(page, cachep);
+		SET_PAGE_SLAB(page, slabp);
+		page++;
+	} while (--i);
+}
+
 /*
  * Grow (by 1) the number of slabs within a cache.  This is called by
  * kmem_cache_alloc() when there are no active objs left in a cache.
@@ -1658,10 +1695,9 @@ static void kmem_flagcheck(kmem_cache_t *cachep, int flags)
 static int cache_grow (kmem_cache_t * cachep, int flags)
 {
 	struct slab	*slabp;
-	struct page	*page;
 	void		*objp;
 	size_t		 offset;
-	unsigned int	 i, local_flags;
+	int		 local_flags;
 	unsigned long	 ctor_flags;
 
 	/* Be lazy and only check for valid flags here,
@@ -1707,21 +1743,14 @@ static int cache_grow (kmem_cache_t * cachep, int flags)
 
 
 	/* Get mem for the objs. */
-	if (!(objp = kmem_getpages(cachep, flags)))
+	if (!(objp = kmem_getpages(cachep, flags, -1)))
 		goto failed;
 
 	/* Get slab management. */
 	if (!(slabp = alloc_slabmgmt(cachep, objp, offset, local_flags)))
 		goto opps1;
 
-	/* Nasty!!!!!! I hope this is OK. */
-	i = 1 << cachep->gfporder;
-	page = virt_to_page(objp);
-	do {
-		SET_PAGE_CACHE(page, cachep);
-		SET_PAGE_SLAB(page, slabp);
-		page++;
-	} while (--i);
+	set_slab_attr(cachep, slabp, objp);
 
 	cache_init_objs(cachep, slabp, ctor_flags);
 
@@ -2226,6 +2255,81 @@ out:
 	return 0;
 }
 
+/**
+ * kmem_cache_alloc_node - Allocate an object on the specified node
+ * @cachep: The cache to allocate from.
+ * @flags: See kmalloc().
+ * @nodeid: node number of the target node.
+ *
+ * Identical to kmem_cache_alloc, except that this function is slow
+ * and can sleep. And it will allocate memory on the given node, which
+ * can improve the performance for cpu bound structures.
+ */
+void *kmem_cache_alloc_node(kmem_cache_t *cachep, int nodeid)
+{
+	size_t offset;
+	void *objp;
+	struct slab *slabp;
+	kmem_bufctl_t next;
+
+	/* The main algorithms are not node aware, thus we have to cheat:
+	 * We bypass all caches and allocate a new slab.
+	 * The following code is a streamlined copy of cache_grow().
+	 */
+
+	/* Get colour for the slab, and update the next value. */
+	spin_lock_irq(&cachep->spinlock);
+	offset = cachep->colour_next;
+	cachep->colour_next++;
+	if (cachep->colour_next >= cachep->colour)
+		cachep->colour_next = 0;
+	offset *= cachep->colour_off;
+	spin_unlock_irq(&cachep->spinlock);
+
+	/* Get mem for the objs. */
+	if (!(objp = kmem_getpages(cachep, GFP_KERNEL, nodeid)))
+		goto failed;
+
+	/* Get slab management. */
+	if (!(slabp = alloc_slabmgmt(cachep, objp, offset, GFP_KERNEL)))
+		goto opps1;
+
+	set_slab_attr(cachep, slabp, objp);
+	cache_init_objs(cachep, slabp, SLAB_CTOR_CONSTRUCTOR);
+
+	/* The first object is ours: */
+	objp = slabp->s_mem + slabp->free*cachep->objsize;
+	slabp->inuse++;
+	next = slab_bufctl(slabp)[slabp->free];
+#if DEBUG
+	slab_bufctl(slabp)[slabp->free] = BUFCTL_FREE;
+#endif
+	slabp->free = next;
+
+	/* add the remaining objects into the cache */
+	spin_lock_irq(&cachep->spinlock);
+	check_slabp(cachep, slabp);
+	STATS_INC_GROWN(cachep);
+	/* Make slab active. */
+	if (slabp->free == BUFCTL_END) {
+		list_add_tail(&slabp->list, &(list3_data(cachep)->slabs_full));
+	} else {
+		list_add_tail(&slabp->list,
+				&(list3_data(cachep)->slabs_partial));
+		list3_data(cachep)->free_objects += cachep->num-1;
+	}
+	spin_unlock_irq(&cachep->spinlock);
+	objp = cache_alloc_debugcheck_after(cachep, GFP_KERNEL, objp,
+					__builtin_return_address(0));
+	return objp;
+opps1:
+	kmem_freepages(cachep, objp);
+failed:
+	return NULL;
+
+}
+EXPORT_SYMBOL(kmem_cache_alloc_node);
+
 /**
  * kmalloc - allocate memory
  * @size: how many bytes of memory are required.
@@ -2290,7 +2394,10 @@ void *__alloc_percpu(size_t size, size_t align)
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_possible(i))
 			continue;
-		pdata->ptrs[i] = kmalloc(size, GFP_KERNEL);
+		pdata->ptrs[i] = kmem_cache_alloc_node(
+				kmem_find_general_cachep(size, GFP_KERNEL),
+				cpu_to_node(i));
+
 		if (!pdata->ptrs[i])
 			goto unwind_oom;
 		memset(pdata->ptrs[i], 0, size);
@@ -2429,19 +2536,15 @@ static int do_tune_cpucache (kmem_cache_t* cachep, int limit, int batchcount, in
 
 	memset(&new.new,0,sizeof(new.new));
 	for (i = 0; i < NR_CPUS; i++) {
-		struct array_cache *ccnew;
-
-		ccnew = kmalloc(sizeof(void*)*limit+
-				sizeof(struct array_cache), GFP_KERNEL);
-		if (!ccnew) {
-			for (i--; i >= 0; i--) kfree(new.new[i]);
-			return -ENOMEM;
+		if (cpu_online(i)) {
+			new.new[i] = alloc_arraycache(i, limit, batchcount);
+			if (!new.new[i]) {
+				for (i--; i >= 0; i--) kfree(new.new[i]);
+				return -ENOMEM;
+			}
+		} else {
+			new.new[i] = NULL;
 		}
-		ccnew->avail = 0;
-		ccnew->limit = limit;
-		ccnew->batchcount = batchcount;
-		ccnew->touched = 0;
-		new.new[i] = ccnew;
 	}
 	new.cachep = cachep;
 
@@ -2463,14 +2566,9 @@ static int do_tune_cpucache (kmem_cache_t* cachep, int limit, int batchcount, in
 		spin_unlock_irq(&cachep->spinlock);
 		kfree(ccold);
 	}
-	new_shared = kmalloc(sizeof(void*)*batchcount*shared+
-				sizeof(struct array_cache), GFP_KERNEL);
+	new_shared = alloc_arraycache(-1, batchcount*shared, 0xbaadf00d);
 	if (new_shared) {
 		struct array_cache *old;
-		new_shared->avail = 0;
-		new_shared->limit = batchcount*shared;
-		new_shared->batchcount = 0xbaadf00d;
-		new_shared->touched = 0;
 
 		spin_lock_irq(&cachep->spinlock);
 		old = cachep->lists.shared;
diff --git a/mm/swap_state.c b/mm/swap_state.c
index b6232384d..571713576 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -6,35 +6,41 @@
  *
  *  Rewritten to use page cache, (C) 1998 Stephen Tweedie
  */
-
+#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/kernel_stat.h>
 #include <linux/swap.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
+#include <linux/buffer_head.h>
 #include <linux/backing-dev.h>
 
 #include <asm/pgtable.h>
 
 /*
  * swapper_space is a fiction, retained to simplify the path through
- * vmscan's shrink_list.  Only those fields initialized below are used.
+ * vmscan's shrink_list, to make sync_page look nicer, and to allow
+ * future use of radix_tree tags in the swap cache.
  */
 static struct address_space_operations swap_aops = {
 	.writepage	= swap_writepage,
+	.sync_page	= block_sync_page,
+	.set_page_dirty	= __set_page_dirty_nobuffers,
 };
 
 static struct backing_dev_info swap_backing_dev_info = {
-	.state		= 0,	/* uncongested */
+	.memory_backed	= 1,	/* Does not contribute to dirty memory */
+	.unplug_io_fn	= swap_unplug_io_fn,
 };
 
 struct address_space swapper_space = {
 	.page_tree	= RADIX_TREE_INIT(GFP_ATOMIC),
 	.tree_lock	= SPIN_LOCK_UNLOCKED,
-	.nrpages	= 0,	/* total_swapcache_pages */
 	.a_ops		= &swap_aops,
+	.i_mmap_nonlinear = LIST_HEAD_INIT(swapper_space.i_mmap_nonlinear),
 	.backing_dev_info = &swap_backing_dev_info,
 };
+EXPORT_SYMBOL(swapper_space);
 
 #define INC_CACHE_INFO(x)	do { swap_cache_info.x++; } while (0)
 
@@ -68,19 +74,18 @@ static int __add_to_swap_cache(struct page *page,
 	BUG_ON(PagePrivate(page));
 	error = radix_tree_preload(gfp_mask);
 	if (!error) {
-		page_cache_get(page);
-		spin_lock(&swapper_space.tree_lock);
+		spin_lock_irq(&swapper_space.tree_lock);
 		error = radix_tree_insert(&swapper_space.page_tree,
 						entry.val, page);
 		if (!error) {
+			page_cache_get(page);
 			SetPageLocked(page);
 			SetPageSwapCache(page);
 			page->private = entry.val;
 			total_swapcache_pages++;
 			pagecache_acct(1);
-		} else
-			page_cache_release(page);
-		spin_unlock(&swapper_space.tree_lock);
+		}
+		spin_unlock_irq(&swapper_space.tree_lock);
 		radix_tree_preload_end();
 	}
 	return error;
@@ -207,9 +212,9 @@ void delete_from_swap_cache(struct page *page)
   
 	entry.val = page->private;
 
-	spin_lock(&swapper_space.tree_lock);
+	spin_lock_irq(&swapper_space.tree_lock);
 	__delete_from_swap_cache(page);
-	spin_unlock(&swapper_space.tree_lock);
+	spin_unlock_irq(&swapper_space.tree_lock);
 
 	swap_free(entry);
 	page_cache_release(page);
@@ -308,13 +313,13 @@ struct page * lookup_swap_cache(swp_entry_t entry)
 {
 	struct page *page;
 
-	spin_lock(&swapper_space.tree_lock);
+	spin_lock_irq(&swapper_space.tree_lock);
 	page = radix_tree_lookup(&swapper_space.page_tree, entry.val);
 	if (page) {
 		page_cache_get(page);
 		INC_CACHE_INFO(find_success);
 	}
-	spin_unlock(&swapper_space.tree_lock);
+	spin_unlock_irq(&swapper_space.tree_lock);
 	INC_CACHE_INFO(find_total);
 	return page;
 }
@@ -325,7 +330,8 @@ struct page * lookup_swap_cache(swp_entry_t entry)
  * A failure return means that either the page allocation failed or that
  * the swap entry is no longer in use.
  */
-struct page * read_swap_cache_async(swp_entry_t entry)
+struct page *read_swap_cache_async(swp_entry_t entry,
+			struct vm_area_struct *vma, unsigned long addr)
 {
 	struct page *found_page, *new_page = NULL;
 	int err;
@@ -336,12 +342,12 @@ struct page * read_swap_cache_async(swp_entry_t entry)
 		 * called after lookup_swap_cache() failed, re-calling
 		 * that would confuse statistics.
 		 */
-		spin_lock(&swapper_space.tree_lock);
+		spin_lock_irq(&swapper_space.tree_lock);
 		found_page = radix_tree_lookup(&swapper_space.page_tree,
 						entry.val);
 		if (found_page)
 			page_cache_get(found_page);
-		spin_unlock(&swapper_space.tree_lock);
+		spin_unlock_irq(&swapper_space.tree_lock);
 		if (found_page)
 			break;
 
@@ -349,7 +355,7 @@ struct page * read_swap_cache_async(swp_entry_t entry)
 		 * Get a new page to read into from swap.
 		 */
 		if (!new_page) {
-			new_page = alloc_page(GFP_HIGHUSER);
+			new_page = alloc_page_vma(GFP_HIGHUSER, vma, addr);
 			if (!new_page)
 				break;		/* Out of memory */
 		}
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 9ca222bc0..2eabfd19a 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -7,6 +7,7 @@
 
 #include <linux/config.h>
 #include <linux/mm.h>
+#include <linux/hugetlb.h>
 #include <linux/mman.h>
 #include <linux/slab.h>
 #include <linux/kernel_stat.h>
@@ -48,68 +49,38 @@ struct swap_info_struct swap_info[MAX_SWAPFILES];
 static DECLARE_MUTEX(swapon_sem);
 
 /*
- * Array of backing blockdevs, for swap_unplug_fn.  We need this because the
- * bdev->unplug_fn can sleep and we cannot hold swap_list_lock while calling
- * the unplug_fn.  And swap_list_lock cannot be turned into a semaphore.
+ * We need this because the bdev->unplug_fn can sleep and we cannot
+ * hold swap_list_lock while calling the unplug_fn. And swap_list_lock
+ * cannot be turned into a semaphore.
  */
-static DECLARE_MUTEX(swap_bdevs_sem);
-static struct block_device *swap_bdevs[MAX_SWAPFILES];
+static DECLARE_RWSEM(swap_unplug_sem);
 
 #define SWAPFILE_CLUSTER 256
 
-/*
- * Caller holds swap_bdevs_sem
- */
-static void install_swap_bdev(struct block_device *bdev)
-{
-	int i;
-
-	for (i = 0; i < MAX_SWAPFILES; i++) {
-		if (swap_bdevs[i] == NULL) {
-			swap_bdevs[i] = bdev;
-			return;
-		}
-	}
-	BUG();
-}
-
-static void remove_swap_bdev(struct block_device *bdev)
-{
-	int i;
-
-	for (i = 0; i < MAX_SWAPFILES; i++) {
-		if (swap_bdevs[i] == bdev) {
-			memcpy(&swap_bdevs[i], &swap_bdevs[i + 1],
-				(MAX_SWAPFILES - i - 1) * sizeof(*swap_bdevs));
-			swap_bdevs[MAX_SWAPFILES - 1] = NULL;
-			return;
-		}
-	}
-	BUG();
-}
-
-/*
- * Unlike a standard unplug_io_fn, swap_unplug_io_fn is never called
- * through swap's backing_dev_info (which is only used by shrink_list),
- * but directly from sync_page when PageSwapCache: and takes the page
- * as argument, so that it can find the right device from swp_entry_t.
- */
-void swap_unplug_io_fn(struct page *page)
+void swap_unplug_io_fn(struct backing_dev_info *unused_bdi, struct page *page)
 {
 	swp_entry_t entry;
 
-	down(&swap_bdevs_sem);
+	down_read(&swap_unplug_sem);
 	entry.val = page->private;
 	if (PageSwapCache(page)) {
-		struct block_device *bdev = swap_bdevs[swp_type(entry)];
+		struct block_device *bdev = swap_info[swp_type(entry)].bdev;
 		struct backing_dev_info *bdi;
 
-		if (bdev) {
-			bdi = bdev->bd_inode->i_mapping->backing_dev_info;
-			(*bdi->unplug_io_fn)(bdi);
-		}
+		/*
+		 * If the page is removed from swapcache from under us (with a
+		 * racy try_to_unuse/swapoff) we need an additional reference
+		 * count to avoid reading garbage from page->private above. If
+		 * the WARN_ON triggers during a swapoff it maybe the race
+		 * condition and it's harmless. However if it triggers without
+		 * swapoff it signals a problem.
+		 */
+		WARN_ON(page_count(page) <= 1);
+
+		bdi = bdev->bd_inode->i_mapping->backing_dev_info;
+		bdi->unplug_io_fn(bdi, page);
 	}
-	up(&swap_bdevs_sem);
+	up_read(&swap_unplug_sem);
 }
 
 static inline int scan_swap_map(struct swap_info_struct *si)
@@ -319,10 +290,10 @@ static int exclusive_swap_page(struct page *page)
 		/* Is the only swap cache user the cache itself? */
 		if (p->swap_map[swp_offset(entry)] == 1) {
 			/* Recheck the page count with the swapcache lock held.. */
-			spin_lock(&swapper_space.tree_lock);
+			spin_lock_irq(&swapper_space.tree_lock);
 			if (page_count(page) == 2)
 				retval = 1;
-			spin_unlock(&swapper_space.tree_lock);
+			spin_unlock_irq(&swapper_space.tree_lock);
 		}
 		swap_info_put(p);
 	}
@@ -390,13 +361,13 @@ int remove_exclusive_swap_page(struct page *page)
 	retval = 0;
 	if (p->swap_map[swp_offset(entry)] == 1) {
 		/* Recheck the page count with the swapcache lock held.. */
-		spin_lock(&swapper_space.tree_lock);
+		spin_lock_irq(&swapper_space.tree_lock);
 		if ((page_count(page) == 2) && !PageWriteback(page)) {
 			__delete_from_swap_cache(page);
 			SetPageDirty(page);
 			retval = 1;
 		}
-		spin_unlock(&swapper_space.tree_lock);
+		spin_unlock_irq(&swapper_space.tree_lock);
 	}
 	swap_info_put(p);
 
@@ -420,12 +391,12 @@ void free_swap_and_cache(swp_entry_t entry)
 	p = swap_info_get(entry);
 	if (p) {
 		if (swap_entry_free(p, swp_offset(entry)) == 1) {
-			spin_lock(&swapper_space.tree_lock);
+			spin_lock_irq(&swapper_space.tree_lock);
 			page = radix_tree_lookup(&swapper_space.page_tree,
 				entry.val);
 			if (page && TestSetPageLocked(page))
 				page = NULL;
-			spin_unlock(&swapper_space.tree_lock);
+			spin_unlock_irq(&swapper_space.tree_lock);
 		}
 		swap_info_put(p);
 	}
@@ -457,19 +428,19 @@ void free_swap_and_cache(swp_entry_t entry)
 /* vma->vm_mm->page_table_lock is held */
 static void
 unuse_pte(struct vm_area_struct *vma, unsigned long address, pte_t *dir,
-	swp_entry_t entry, struct page *page, struct pte_chain **pte_chainp)
+	swp_entry_t entry, struct page *page)
 {
 	vma->vm_mm->rss++;
 	get_page(page);
 	set_pte(dir, pte_mkold(mk_pte(page, vma->vm_page_prot)));
-	*pte_chainp = page_add_rmap(page, dir, *pte_chainp);
+	page_add_anon_rmap(page, vma, address);
 	swap_free(entry);
 }
 
 /* vma->vm_mm->page_table_lock is held */
-static int unuse_pmd(struct vm_area_struct * vma, pmd_t *dir,
+static unsigned long unuse_pmd(struct vm_area_struct * vma, pmd_t *dir,
 	unsigned long address, unsigned long size, unsigned long offset,
-	swp_entry_t entry, struct page *page, struct pte_chain **pte_chainp)
+	swp_entry_t entry, struct page *page)
 {
 	pte_t * pte;
 	unsigned long end;
@@ -494,10 +465,10 @@ static int unuse_pmd(struct vm_area_struct * vma, pmd_t *dir,
 		 * Test inline before going to call unuse_pte.
 		 */
 		if (unlikely(pte_same(*pte, swp_pte))) {
-			unuse_pte(vma, offset + address, pte,
-					entry, page, pte_chainp);
+			unuse_pte(vma, offset + address, pte, entry, page);
 			pte_unmap(pte);
-			return 1;
+			/* add 1 since address may be 0 */
+			return 1 + offset + address;
 		}
 		address += PAGE_SIZE;
 		pte++;
@@ -507,12 +478,13 @@ static int unuse_pmd(struct vm_area_struct * vma, pmd_t *dir,
 }
 
 /* vma->vm_mm->page_table_lock is held */
-static int unuse_pgd(struct vm_area_struct * vma, pgd_t *dir,
+static unsigned long unuse_pgd(struct vm_area_struct * vma, pgd_t *dir,
 	unsigned long address, unsigned long size,
-	swp_entry_t entry, struct page *page, struct pte_chain **pte_chainp)
+	swp_entry_t entry, struct page *page)
 {
 	pmd_t * pmd;
 	unsigned long offset, end;
+	unsigned long foundaddr;
 
 	if (pgd_none(*dir))
 		return 0;
@@ -530,9 +502,10 @@ static int unuse_pgd(struct vm_area_struct * vma, pgd_t *dir,
 	if (address >= end)
 		BUG();
 	do {
-		if (unuse_pmd(vma, pmd, address, end - address,
-				offset, entry, page, pte_chainp))
-			return 1;
+		foundaddr = unuse_pmd(vma, pmd, address, end - address,
+						offset, entry, page);
+		if (foundaddr)
+			return foundaddr;
 		address = (address + PMD_SIZE) & PMD_MASK;
 		pmd++;
 	} while (address && (address < end));
@@ -540,17 +513,19 @@ static int unuse_pgd(struct vm_area_struct * vma, pgd_t *dir,
 }
 
 /* vma->vm_mm->page_table_lock is held */
-static int unuse_vma(struct vm_area_struct * vma, pgd_t *pgdir,
-	swp_entry_t entry, struct page *page, struct pte_chain **pte_chainp)
+static unsigned long unuse_vma(struct vm_area_struct * vma, pgd_t *pgdir,
+	swp_entry_t entry, struct page *page)
 {
 	unsigned long start = vma->vm_start, end = vma->vm_end;
+	unsigned long foundaddr;
 
 	if (start >= end)
 		BUG();
 	do {
-		if (unuse_pgd(vma, pgdir, start, end - start,
-				entry, page, pte_chainp))
-			return 1;
+		foundaddr = unuse_pgd(vma, pgdir, start, end - start,
+						entry, page);
+		if (foundaddr)
+			return foundaddr;
 		start = (start + PGDIR_SIZE) & PGDIR_MASK;
 		pgdir++;
 	} while (start && (start < end));
@@ -561,23 +536,27 @@ static int unuse_process(struct mm_struct * mm,
 			swp_entry_t entry, struct page* page)
 {
 	struct vm_area_struct* vma;
-	struct pte_chain *pte_chain;
-
-	pte_chain = pte_chain_alloc(GFP_KERNEL);
-	if (!pte_chain)
-		return -ENOMEM;
+	unsigned long foundaddr = 0;
 
 	/*
 	 * Go through process' page directory.
 	 */
+	down_read(&mm->mmap_sem);
 	spin_lock(&mm->page_table_lock);
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
-		pgd_t * pgd = pgd_offset(mm, vma->vm_start);
-		if (unuse_vma(vma, pgd, entry, page, &pte_chain))
-			break;
+		if (!is_vm_hugetlb_page(vma)) {
+			pgd_t * pgd = pgd_offset(mm, vma->vm_start);
+			foundaddr = unuse_vma(vma, pgd, entry, page);
+			if (foundaddr)
+				break;
+		}
 	}
 	spin_unlock(&mm->page_table_lock);
-	pte_chain_free(pte_chain);
+	up_read(&mm->mmap_sem);
+	/*
+	 * Currently unuse_process cannot fail, but leave error handling
+	 * at call sites for now, since we change it from time to time.
+	 */
 	return 0;
 }
 
@@ -679,7 +658,7 @@ static int try_to_unuse(unsigned int type)
 		 */
 		swap_map = &si->swap_map[i];
 		entry = swp_entry(type, i);
-		page = read_swap_cache_async(entry);
+		page = read_swap_cache_async(entry, NULL, 0);
 		if (!page) {
 			/*
 			 * Either swap_duplicate() failed because entry
@@ -1143,6 +1122,11 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
 	current->flags |= PF_SWAPOFF;
 	err = try_to_unuse(type);
 	current->flags &= ~PF_SWAPOFF;
+
+	/* wait for any unplug function to finish */
+	down_write(&swap_unplug_sem);
+	up_write(&swap_unplug_sem);
+
 	if (err) {
 		/* re-insert swap space back into swap_list */
 		swap_list_lock();
@@ -1161,7 +1145,6 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
 		goto out_dput;
 	}
 	down(&swapon_sem);
-	down(&swap_bdevs_sem);
 	swap_list_lock();
 	swap_device_lock(p);
 	swap_file = p->swap_file;
@@ -1173,8 +1156,6 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
 	destroy_swap_extents(p);
 	swap_device_unlock(p);
 	swap_list_unlock();
-	remove_swap_bdev(p->bdev);
-	up(&swap_bdevs_sem);
 	up(&swapon_sem);
 	vfree(swap_map);
 	if (S_ISBLK(mapping->host->i_mode)) {
@@ -1518,7 +1499,6 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
 		goto bad_swap;
 
 	down(&swapon_sem);
-	down(&swap_bdevs_sem);
 	swap_list_lock();
 	swap_device_lock(p);
 	p->flags = SWP_ACTIVE;
@@ -1544,8 +1524,6 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
 	}
 	swap_device_unlock(p);
 	swap_list_unlock();
-	install_swap_bdev(p->bdev);
-	up(&swap_bdevs_sem);
 	up(&swapon_sem);
 	error = 0;
 	goto out;
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index c7f701827..16e6f88c2 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -284,6 +284,7 @@ void __vunmap(void *addr, int deallocate_pages)
 
 	if ((PAGE_SIZE-1) & (unsigned long)addr) {
 		printk(KERN_ERR "Trying to vfree() bad address (%p)\n", addr);
+		WARN_ON(1);
 		return;
 	}
 
@@ -291,6 +292,7 @@ void __vunmap(void *addr, int deallocate_pages)
 	if (unlikely(!area)) {
 		printk(KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n",
 				addr);
+		WARN_ON(1);
 		return;
 	}
 	
diff --git a/mm/vmscan.c b/mm/vmscan.c
index f78921216..e5f0b0919 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -153,20 +153,23 @@ static int shrink_slab(unsigned long scanned, unsigned int gfp_mask)
 		delta *= (*shrinker->shrinker)(0, gfp_mask);
 		do_div(delta, pages + 1);
 		shrinker->nr += delta;
-		if (shrinker->nr > SHRINK_BATCH) {
-			long nr_to_scan = shrinker->nr;
-
-			shrinker->nr = 0;
-			mod_page_state(slabs_scanned, nr_to_scan);
-			while (nr_to_scan) {
-				long this_scan = nr_to_scan;
-
-				if (this_scan > 128)
-					this_scan = 128;
-				(*shrinker->shrinker)(this_scan, gfp_mask);
-				nr_to_scan -= this_scan;
-				cond_resched();
-			}
+		if (shrinker->nr < 0)
+			shrinker->nr = LONG_MAX;	/* It wrapped! */
+
+		if (shrinker->nr <= SHRINK_BATCH)
+			continue;
+		while (shrinker->nr) {
+			long this_scan = shrinker->nr;
+			int shrink_ret;
+
+			if (this_scan > 128)
+				this_scan = 128;
+			shrink_ret = (*shrinker->shrinker)(this_scan, gfp_mask);
+			mod_page_state(slabs_scanned, this_scan);
+			shrinker->nr -= this_scan;
+			if (shrink_ret == -1)
+				break;
+			cond_resched();
 		}
 	}
 	up(&shrinker_sem);
@@ -237,23 +240,113 @@ static void handle_write_error(struct address_space *mapping,
 	unlock_page(page);
 }
 
+/* possible outcome of pageout() */
+typedef enum {
+	/* failed to write page out, page is locked */
+	PAGE_KEEP,
+	/* move page to the active list, page is locked */
+	PAGE_ACTIVATE,
+	/* page has been sent to the disk successfully, page is unlocked */
+	PAGE_SUCCESS,
+	/* page is clean and locked */
+	PAGE_CLEAN,
+} pageout_t;
+
 /*
- * shrink_list returns the number of reclaimed pages
+ * pageout is called by shrink_list() for each dirty page. Calls ->writepage().
  */
-static int
-shrink_list(struct list_head *page_list, unsigned int gfp_mask,
-		int *nr_scanned, int do_writepage)
+static pageout_t pageout(struct page *page, struct address_space *mapping)
+{
+	/*
+	 * If the page is dirty, only perform writeback if that write
+	 * will be non-blocking.  To prevent this allocation from being
+	 * stalled by pagecache activity.  But note that there may be
+	 * stalls if we need to run get_block().  We could test
+	 * PagePrivate for that.
+	 *
+	 * If this process is currently in generic_file_write() against
+	 * this page's queue, we can perform writeback even if that
+	 * will block.
+	 *
+	 * If the page is swapcache, write it back even if that would
+	 * block, for some throttling. This happens by accident, because
+	 * swap_backing_dev_info is bust: it doesn't reflect the
+	 * congestion state of the swapdevs.  Easy to fix, if needed.
+	 * See swapfile.c:page_queue_congested().
+	 */
+	if (!is_page_cache_freeable(page))
+		return PAGE_KEEP;
+	if (!mapping)
+		return PAGE_KEEP;
+	if (mapping->a_ops->writepage == NULL)
+		return PAGE_ACTIVATE;
+	if (!may_write_to_queue(mapping->backing_dev_info))
+		return PAGE_KEEP;
+
+	if (clear_page_dirty_for_io(page)) {
+		int res;
+		struct writeback_control wbc = {
+			.sync_mode = WB_SYNC_NONE,
+			.nr_to_write = SWAP_CLUSTER_MAX,
+			.nonblocking = 1,
+			.for_reclaim = 1,
+		};
+
+		SetPageReclaim(page);
+		res = mapping->a_ops->writepage(page, &wbc);
+		if (res < 0)
+			handle_write_error(mapping, page, res);
+		if (res == WRITEPAGE_ACTIVATE) {
+			ClearPageReclaim(page);
+			return PAGE_ACTIVATE;
+		}
+		if (!PageWriteback(page)) {
+			/* synchronous write or broken a_ops? */
+			ClearPageReclaim(page);
+		}
+
+		return PAGE_SUCCESS;
+	}
+
+	return PAGE_CLEAN;
+}
+
+struct scan_control {
+	/* Ask refill_inactive_zone, or shrink_cache to scan this many pages */
+	unsigned long nr_to_scan;
+
+	/* Incremented by the number of inactive pages that were scanned */
+	unsigned long nr_scanned;
+
+	/* Incremented by the number of pages reclaimed */
+	unsigned long nr_reclaimed;
+
+	unsigned long nr_mapped;	/* From page_state */
+
+	/* Ask shrink_caches, or shrink_zone to scan at this priority */
+	unsigned int priority;
+
+	/* This context's GFP mask */
+	unsigned int gfp_mask;
+
+	int may_writepage;
+};
+
+/*
+ * shrink_list adds the number of reclaimed pages to sc->nr_reclaimed
+ */
+static int shrink_list(struct list_head *page_list, struct scan_control *sc)
 {
-	struct address_space *mapping;
 	LIST_HEAD(ret_pages);
 	struct pagevec freed_pvec;
 	int pgactivate = 0;
-	int ret = 0;
+	int reclaimed = 0;
 
 	cond_resched();
 
 	pagevec_init(&freed_pvec, 1);
 	while (!list_empty(page_list)) {
+		struct address_space *mapping;
 		struct page *page;
 		int may_enter_fs;
 		int referenced;
@@ -264,26 +357,24 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask,
 		if (TestSetPageLocked(page))
 			goto keep;
 
-		/* Double the slab pressure for mapped and swapcache pages */
-		if (page_mapped(page) || PageSwapCache(page))
-			(*nr_scanned)++;
-
 		BUG_ON(PageActive(page));
 
 		if (PageWriteback(page))
 			goto keep_locked;
 
-		rmap_lock(page);
+		sc->nr_scanned++;
+		/* Double the slab pressure for mapped and swapcache pages */
+		if (page_mapped(page) || PageSwapCache(page))
+			sc->nr_scanned++;
+
+		page_map_lock(page);
 		referenced = page_referenced(page);
 		if (referenced && page_mapping_inuse(page)) {
 			/* In active use or really unfreeable.  Activate it. */
-			rmap_unlock(page);
+			page_map_unlock(page);
 			goto activate_locked;
 		}
 
-		mapping = page_mapping(page);
-		may_enter_fs = (gfp_mask & __GFP_FS);
-
 #ifdef CONFIG_SWAP
 		/*
 		 * Anonymous process memory has backing store?
@@ -292,17 +383,17 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask,
 		 * XXX: implement swap clustering ?
 		 */
 		if (PageAnon(page) && !PageSwapCache(page)) {
-			rmap_unlock(page);
+			page_map_unlock(page);
 			if (!add_to_swap(page))
 				goto activate_locked;
-			rmap_lock(page);
-		}
-		if (PageSwapCache(page)) {
-			mapping = &swapper_space;
-			may_enter_fs = (gfp_mask & __GFP_IO);
+			page_map_lock(page);
 		}
 #endif /* CONFIG_SWAP */
 
+		mapping = page_mapping(page);
+		may_enter_fs = (sc->gfp_mask & __GFP_FS) ||
+			(PageSwapCache(page) && (sc->gfp_mask & __GFP_IO));
+
 		/*
 		 * The page is mapped into the page tables of one or more
 		 * processes. Try to unmap it here.
@@ -310,71 +401,45 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask,
 		if (page_mapped(page) && mapping) {
 			switch (try_to_unmap(page)) {
 			case SWAP_FAIL:
-				rmap_unlock(page);
+				page_map_unlock(page);
 				goto activate_locked;
 			case SWAP_AGAIN:
-				rmap_unlock(page);
+				page_map_unlock(page);
 				goto keep_locked;
 			case SWAP_SUCCESS:
 				; /* try to free the page below */
 			}
 		}
-		rmap_unlock(page);
+		page_map_unlock(page);
 
-		/*
-		 * If the page is dirty, only perform writeback if that write
-		 * will be non-blocking.  To prevent this allocation from being
-		 * stalled by pagecache activity.  But note that there may be
-		 * stalls if we need to run get_block().  We could test
-		 * PagePrivate for that.
-		 *
-		 * If this process is currently in generic_file_write() against
-		 * this page's queue, we can perform writeback even if that
-		 * will block.
-		 *
-		 * If the page is swapcache, write it back even if that would
-		 * block, for some throttling. This happens by accident, because
-		 * swap_backing_dev_info is bust: it doesn't reflect the
-		 * congestion state of the swapdevs.  Easy to fix, if needed.
-		 * See swapfile.c:page_queue_congested().
-		 */
 		if (PageDirty(page)) {
 			if (referenced)
 				goto keep_locked;
-			if (!is_page_cache_freeable(page))
-				goto keep_locked;
-			if (!mapping)
-				goto keep_locked;
-			if (mapping->a_ops->writepage == NULL)
-				goto activate_locked;
 			if (!may_enter_fs)
 				goto keep_locked;
-			if (!may_write_to_queue(mapping->backing_dev_info))
+			if (laptop_mode && !sc->may_writepage)
 				goto keep_locked;
-			if (laptop_mode && !do_writepage)
+
+			/* Page is dirty, try to write it out here */
+			switch(pageout(page, mapping)) {
+			case PAGE_KEEP:
 				goto keep_locked;
-			if (clear_page_dirty_for_io(page)) {
-				int res;
-				struct writeback_control wbc = {
-					.sync_mode = WB_SYNC_NONE,
-					.nr_to_write = SWAP_CLUSTER_MAX,
-					.nonblocking = 1,
-					.for_reclaim = 1,
-				};
-
-				SetPageReclaim(page);
-				res = mapping->a_ops->writepage(page, &wbc);
-				if (res < 0)
-					handle_write_error(mapping, page, res);
-				if (res == WRITEPAGE_ACTIVATE) {
-					ClearPageReclaim(page);
-					goto activate_locked;
-				}
-				if (!PageWriteback(page)) {
-					/* synchronous write or broken a_ops? */
-					ClearPageReclaim(page);
-				}
-				goto keep;
+			case PAGE_ACTIVATE:
+				goto activate_locked;
+			case PAGE_SUCCESS:
+				if (PageWriteback(page) || PageDirty(page))
+					goto keep;
+				/*
+				 * A synchronous write - probably a ramdisk.  Go
+				 * ahead and try to reclaim the page.
+				 */
+				if (TestSetPageLocked(page))
+					goto keep;
+				if (PageDirty(page) || PageWriteback(page))
+					goto keep_locked;
+				mapping = page_mapping(page);
+			case PAGE_CLEAN:
+				; /* try to free the page below */
 			}
 		}
 
@@ -396,11 +461,11 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask,
 		 * the pages which were not successfully invalidated in
 		 * truncate_complete_page().  We try to drop those buffers here
 		 * and if that worked, and the page is no longer mapped into
-		 * process address space (page_count == 0) it can be freed.
+		 * process address space (page_count == 1) it can be freed.
 		 * Otherwise, leave the page on the LRU so it is swappable.
 		 */
 		if (PagePrivate(page)) {
-			if (!try_to_release_page(page, gfp_mask))
+			if (!try_to_release_page(page, sc->gfp_mask))
 				goto activate_locked;
 			if (!mapping && page_count(page) == 1)
 				goto free_it;
@@ -438,7 +503,7 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask,
 
 free_it:
 		unlock_page(page);
-		ret++;
+		reclaimed++;
 		if (!pagevec_add(&freed_pvec, page))
 			__pagevec_release_nonlru(&freed_pvec);
 		continue;
@@ -456,7 +521,8 @@ keep:
 	if (pagevec_count(&freed_pvec))
 		__pagevec_release_nonlru(&freed_pvec);
 	mod_page_state(pgactivate, pgactivate);
-	return ret;
+	sc->nr_reclaimed += reclaimed;
+	return reclaimed;
 }
 
 /*
@@ -464,19 +530,16 @@ keep:
  * a batch of pages and working on them outside the lock.  Any pages which were
  * not freed will be added back to the LRU.
  *
- * shrink_cache() is passed the number of pages to scan and returns the number
- * of pages which were reclaimed.
+ * shrink_cache() adds the number of pages reclaimed to sc->nr_reclaimed
  *
  * For pagecache intensive workloads, the first loop here is the hottest spot
  * in the kernel (apart from the copy_*_user functions).
  */
-static int
-shrink_cache(struct zone *zone, unsigned int gfp_mask,
-		int max_scan, int *total_scanned, int do_writepage)
+static void shrink_cache(struct zone *zone, struct scan_control *sc)
 {
 	LIST_HEAD(page_list);
 	struct pagevec pvec;
-	int ret = 0;
+	int max_scan = sc->nr_to_scan;
 
 	pagevec_init(&pvec, 1);
 
@@ -498,14 +561,16 @@ shrink_cache(struct zone *zone, unsigned int gfp_mask,
 			if (!TestClearPageLRU(page))
 				BUG();
 			list_del(&page->lru);
-			if (page_count(page) == 0) {
-				/* It is currently in pagevec_release() */
+			if (get_page_testone(page)) {
+				/*
+				 * It is being freed elsewhere
+				 */
+				__put_page(page);
 				SetPageLRU(page);
 				list_add(&page->lru, &zone->inactive_list);
 				continue;
 			}
 			list_add(&page->lru, &page_list);
-			page_cache_get(page);
 			nr_taken++;
 		}
 		zone->nr_inactive -= nr_taken;
@@ -520,17 +585,11 @@ shrink_cache(struct zone *zone, unsigned int gfp_mask,
 			mod_page_state_zone(zone, pgscan_kswapd, nr_scan);
 		else
 			mod_page_state_zone(zone, pgscan_direct, nr_scan);
-		nr_freed = shrink_list(&page_list, gfp_mask,
-					total_scanned, do_writepage);
-		*total_scanned += nr_taken;
+		nr_freed = shrink_list(&page_list, sc);
 		if (current_is_kswapd())
 			mod_page_state(kswapd_steal, nr_freed);
 		mod_page_state_zone(zone, pgsteal, nr_freed);
 
-		ret += nr_freed;
-		if (nr_freed <= 0 && list_empty(&page_list))
-			goto done;
-
 		spin_lock_irq(&zone->lru_lock);
 		/*
 		 * Put back any unfreeable pages.
@@ -554,7 +613,6 @@ shrink_cache(struct zone *zone, unsigned int gfp_mask,
 	spin_unlock_irq(&zone->lru_lock);
 done:
 	pagevec_release(&pvec);
-	return ret;
 }
 
 /*
@@ -571,16 +629,16 @@ done:
  * It is safe to rely on PG_active against the non-LRU pages in here because
  * nobody will play with that bit on a non-LRU page.
  *
- * The downside is that we have to touch page->count against each page.
+ * The downside is that we have to touch page->_count against each page.
  * But we had to alter page->flags anyway.
  */
 static void
-refill_inactive_zone(struct zone *zone, const int nr_pages_in,
-			struct page_state *ps)
+refill_inactive_zone(struct zone *zone, struct scan_control *sc)
 {
 	int pgmoved;
 	int pgdeactivate = 0;
-	int nr_pages = nr_pages_in;
+	int pgscanned = 0;
+	int nr_pages = sc->nr_to_scan;
 	LIST_HEAD(l_hold);	/* The pages which were snipped off */
 	LIST_HEAD(l_inactive);	/* Pages to go onto the inactive_list */
 	LIST_HEAD(l_active);	/* Pages to go onto the active_list */
@@ -594,22 +652,27 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
 	lru_add_drain();
 	pgmoved = 0;
 	spin_lock_irq(&zone->lru_lock);
-	while (nr_pages && !list_empty(&zone->active_list)) {
+	while (pgscanned < nr_pages && !list_empty(&zone->active_list)) {
 		page = lru_to_page(&zone->active_list);
 		prefetchw_prev_lru_page(page, &zone->active_list, flags);
 		if (!TestClearPageLRU(page))
 			BUG();
 		list_del(&page->lru);
-		if (page_count(page) == 0) {
-			/* It is currently in pagevec_release() */
+		if (get_page_testone(page)) {
+			/*
+			 * It was already free!  release_pages() or put_page()
+			 * are about to remove it from the LRU and free it. So
+			 * put the refcount back and put the page back on the
+			 * LRU
+			 */
+			__put_page(page);
 			SetPageLRU(page);
 			list_add(&page->lru, &zone->active_list);
 		} else {
-			page_cache_get(page);
 			list_add(&page->lru, &l_hold);
 			pgmoved++;
 		}
-		nr_pages--;
+		pgscanned++;
 	}
 	zone->nr_active -= pgmoved;
 	spin_unlock_irq(&zone->lru_lock);
@@ -625,7 +688,7 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
 	 * mapped memory instead of just pagecache.  Work out how much memory
 	 * is mapped.
 	 */
-	mapped_ratio = (ps->nr_mapped * 100) / total_memory;
+	mapped_ratio = (sc->nr_mapped * 100) / total_memory;
 
 	/*
 	 * Now decide how much we really want to unmap some pages.  The mapped
@@ -653,13 +716,13 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
 				list_add(&page->lru, &l_active);
 				continue;
 			}
-			rmap_lock(page);
+			page_map_lock(page);
 			if (page_referenced(page)) {
-				rmap_unlock(page);
+				page_map_unlock(page);
 				list_add(&page->lru, &l_active);
 				continue;
 			}
-			rmap_unlock(page);
+			page_map_unlock(page);
 		}
 		/*
 		 * FIXME: need to consider page_count(page) here if/when we
@@ -724,7 +787,7 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
 	spin_unlock_irq(&zone->lru_lock);
 	pagevec_release(&pvec);
 
-	mod_page_state_zone(zone, pgrefill, nr_pages_in - nr_pages);
+	mod_page_state_zone(zone, pgrefill, pgscanned);
 	mod_page_state(pgdeactivate, pgdeactivate);
 }
 
@@ -732,41 +795,52 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
  * Scan `nr_pages' from this zone.  Returns the number of reclaimed pages.
  * This is a basic per-zone page freer.  Used by both kswapd and direct reclaim.
  */
-static int
-shrink_zone(struct zone *zone, int max_scan, unsigned int gfp_mask,
-		int *total_scanned, struct page_state *ps, int do_writepage)
+static void
+shrink_zone(struct zone *zone, struct scan_control *sc)
 {
-	unsigned long ratio;
+	unsigned long scan_active, scan_inactive;
 	int count;
 
+	scan_inactive = (zone->nr_active + zone->nr_inactive) >> sc->priority;
+
 	/*
 	 * Try to keep the active list 2/3 of the size of the cache.  And
 	 * make sure that refill_inactive is given a decent number of pages.
 	 *
-	 * The "ratio+1" here is important.  With pagecache-intensive workloads
-	 * the inactive list is huge, and `ratio' evaluates to zero all the
-	 * time.  Which pins the active list memory.  So we add one to `ratio'
-	 * just to make sure that the kernel will slowly sift through the
-	 * active list.
+	 * The "scan_active + 1" here is important.  With pagecache-intensive
+	 * workloads the inactive list is huge, and `ratio' evaluates to zero
+	 * all the time.  Which pins the active list memory.  So we add one to
+	 * `scan_active' just to make sure that the kernel will slowly sift
+	 * through the active list.
 	 */
-	ratio = (unsigned long)SWAP_CLUSTER_MAX * zone->nr_active /
-				((zone->nr_inactive | 1) * 2);
+	if (zone->nr_active >= 4*(zone->nr_inactive*2 + 1)) {
+		/* Don't scan more than 4 times the inactive list scan size */
+		scan_active = 4*scan_inactive;
+	} else {
+		unsigned long long tmp;
+
+		/* Cast to long long so the multiply doesn't overflow */
+
+		tmp = (unsigned long long)scan_inactive * zone->nr_active;
+		do_div(tmp, zone->nr_inactive*2 + 1);
+		scan_active = (unsigned long)tmp;
+	}
 
-	atomic_add(ratio+1, &zone->nr_scan_active);
+	atomic_add(scan_active + 1, &zone->nr_scan_active);
 	count = atomic_read(&zone->nr_scan_active);
 	if (count >= SWAP_CLUSTER_MAX) {
 		atomic_set(&zone->nr_scan_active, 0);
-		refill_inactive_zone(zone, count, ps);
+		sc->nr_to_scan = count;
+		refill_inactive_zone(zone, sc);
 	}
 
-	atomic_add(max_scan, &zone->nr_scan_inactive);
+	atomic_add(scan_inactive, &zone->nr_scan_inactive);
 	count = atomic_read(&zone->nr_scan_inactive);
 	if (count >= SWAP_CLUSTER_MAX) {
 		atomic_set(&zone->nr_scan_inactive, 0);
-		return shrink_cache(zone, gfp_mask, count,
-					total_scanned, do_writepage);
+		sc->nr_to_scan = count;
+		shrink_cache(zone, sc);
 	}
-	return 0;
 }
 
 /*
@@ -785,28 +859,23 @@ shrink_zone(struct zone *zone, int max_scan, unsigned int gfp_mask,
  * If a zone is deemed to be full of pinned pages then just give it a light
  * scan then give up on it.
  */
-static int
-shrink_caches(struct zone **zones, int priority, int *total_scanned,
-		int gfp_mask, struct page_state *ps, int do_writepage)
+static void
+shrink_caches(struct zone **zones, struct scan_control *sc)
 {
-	int ret = 0;
 	int i;
 
 	for (i = 0; zones[i] != NULL; i++) {
 		struct zone *zone = zones[i];
-		int max_scan;
 
-		if (zone->free_pages < zone->pages_high)
-			zone->temp_priority = priority;
+		zone->temp_priority = sc->priority;
+		if (zone->prev_priority > sc->priority)
+			zone->prev_priority = sc->priority;
 
-		if (zone->all_unreclaimable && priority != DEF_PRIORITY)
+		if (zone->all_unreclaimable && sc->priority != DEF_PRIORITY)
 			continue;	/* Let kswapd poll it */
 
-		max_scan = zone->nr_inactive >> priority;
-		ret += shrink_zone(zone, max_scan, gfp_mask,
-					total_scanned, ps, do_writepage);
+		shrink_zone(zone, sc);
 	}
-	return ret;
 }
  
 /*
@@ -817,25 +886,23 @@ shrink_caches(struct zone **zones, int priority, int *total_scanned,
  *
  * If the caller is !__GFP_FS then the probability of a failure is reasonably
  * high - the zone may be full of dirty or under-writeback pages, which this
- * caller can't do much about.  So for !__GFP_FS callers, we just perform a
- * small LRU walk and if that didn't work out, fail the allocation back to the
- * caller.  GFP_NOFS allocators need to know how to deal with it.  Kicking
- * bdflush, waiting and retrying will work.
- *
- * This is a fairly lame algorithm - it can result in excessive CPU burning and
- * excessive rotation of the inactive list, which is _supposed_ to be an LRU,
- * yes?
+ * caller can't do much about.  We kick pdflush and take explicit naps in the
+ * hope that some of these pages can be written.  But if the allocating task
+ * holds filesystem locks which prevent writeout this might not work, and the
+ * allocation attempt will fail.
  */
 int try_to_free_pages(struct zone **zones,
 		unsigned int gfp_mask, unsigned int order)
 {
 	int priority;
 	int ret = 0;
-	int nr_reclaimed = 0;
+	int total_scanned = 0, total_reclaimed = 0;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
+	struct scan_control sc;
 	int i;
-	unsigned long total_scanned = 0;
-	int do_writepage = 0;
+
+	sc.gfp_mask = gfp_mask;
+	sc.may_writepage = 0;
 
 	inc_page_state(allocstall);
 
@@ -843,23 +910,23 @@ int try_to_free_pages(struct zone **zones,
 		zones[i]->temp_priority = DEF_PRIORITY;
 
 	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
-		int scanned = 0;
-		struct page_state ps;
-
-		get_page_state(&ps);
-		nr_reclaimed += shrink_caches(zones, priority, &scanned,
-						gfp_mask, &ps, do_writepage);
-		shrink_slab(scanned, gfp_mask);
+		sc.nr_mapped = read_page_state(nr_mapped);
+		sc.nr_scanned = 0;
+		sc.nr_reclaimed = 0;
+		sc.priority = priority;
+		shrink_caches(zones, &sc);
+		shrink_slab(sc.nr_scanned, gfp_mask);
 		if (reclaim_state) {
-			nr_reclaimed += reclaim_state->reclaimed_slab;
+			sc.nr_reclaimed += reclaim_state->reclaimed_slab;
 			reclaim_state->reclaimed_slab = 0;
 		}
-		if (nr_reclaimed >= SWAP_CLUSTER_MAX) {
+		if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX) {
 			ret = 1;
 			goto out;
 		}
-		if (!(gfp_mask & __GFP_FS))
-			break;		/* Let the caller handle it */
+		total_scanned += sc.nr_scanned;
+		total_reclaimed += sc.nr_reclaimed;
+
 		/*
 		 * Try to write back as many pages as we just scanned.  This
 		 * tends to cause slow streaming writers to write data to the
@@ -867,14 +934,13 @@ int try_to_free_pages(struct zone **zones,
 		 * that's undesirable in laptop mode, where we *want* lumpy
 		 * writeout.  So in laptop mode, write out the whole world.
 		 */
-		total_scanned += scanned;
 		if (total_scanned > SWAP_CLUSTER_MAX + SWAP_CLUSTER_MAX/2) {
 			wakeup_bdflush(laptop_mode ? 0 : total_scanned);
-			do_writepage = 1;
+			sc.may_writepage = 1;
 		}
 
 		/* Take a nap, wait for some writeback to complete */
-		if (scanned && priority < DEF_PRIORITY - 2)
+		if (sc.nr_scanned && priority < DEF_PRIORITY - 2)
 			blk_congestion_wait(WRITE, HZ/10);
 	}
 	if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
@@ -910,15 +976,18 @@ out:
  * the page allocator fallback scheme to ensure that aging of pages is balanced
  * across the zones.
  */
-static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps)
+static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
 {
 	int to_free = nr_pages;
 	int priority;
 	int i;
+	int total_scanned = 0, total_reclaimed = 0;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
-	unsigned long total_scanned = 0;
-	unsigned long total_reclaimed = 0;
-	int do_writepage = 0;
+	struct scan_control sc;
+
+	sc.gfp_mask = GFP_KERNEL;
+	sc.may_writepage = 0;
+	sc.nr_mapped = read_page_state(nr_mapped);
 
 	inc_page_state(pageoutrun);
 
@@ -928,7 +997,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages, struct page_state *ps)
 		zone->temp_priority = DEF_PRIORITY;
 	}
 
-	for (priority = DEF_PRIORITY; priority; priority--) {
+	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 		int all_zones_ok = 1;
 		int end_zone = 0;	/* Inclusive.  0 = ZONE_DMA */
 
@@ -966,9 +1035,6 @@ scan:
 		 */
 		for (i = 0; i <= end_zone; i++) {
 			struct zone *zone = pgdat->node_zones + i;
-			int max_scan;
-			int reclaimed;
-			int scanned = 0;
 
 			if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 				continue;
@@ -978,15 +1044,16 @@ scan:
 					all_zones_ok = 0;
 			}
 			zone->temp_priority = priority;
-			max_scan = zone->nr_inactive >> priority;
-			reclaimed = shrink_zone(zone, max_scan, GFP_KERNEL,
-					&scanned, ps, do_writepage);
-			total_scanned += scanned;
+			if (zone->prev_priority > priority)
+				zone->prev_priority = priority;
+			sc.nr_scanned = 0;
+			sc.nr_reclaimed = 0;
+			sc.priority = priority;
+			shrink_zone(zone, &sc);
 			reclaim_state->reclaimed_slab = 0;
-			shrink_slab(scanned, GFP_KERNEL);
-			reclaimed += reclaim_state->reclaimed_slab;
-			total_reclaimed += reclaimed;
-			to_free -= reclaimed;
+			shrink_slab(sc.nr_scanned, GFP_KERNEL);
+			sc.nr_reclaimed += reclaim_state->reclaimed_slab;
+			total_reclaimed += sc.nr_reclaimed;
 			if (zone->all_unreclaimable)
 				continue;
 			if (zone->pages_scanned > zone->present_pages * 2)
@@ -998,9 +1065,9 @@ scan:
 			 */
 			if (total_scanned > SWAP_CLUSTER_MAX * 2 &&
 			    total_scanned > total_reclaimed+total_reclaimed/2)
-				do_writepage = 1;
+				sc.may_writepage = 1;
 		}
-		if (nr_pages && to_free > 0)
+		if (nr_pages && to_free > total_reclaimed)
 			continue;	/* swsusp: need to do more work */
 		if (all_zones_ok)
 			break;		/* kswapd: all done */
@@ -1064,15 +1131,13 @@ int kswapd(void *p)
 	tsk->flags |= PF_MEMALLOC|PF_KSWAPD;
 
 	for ( ; ; ) {
-		struct page_state ps;
-
 		if (current->flags & PF_FREEZE)
 			refrigerator(PF_FREEZE);
 		prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
 		schedule();
 		finish_wait(&pgdat->kswapd_wait, &wait);
-		get_page_state(&ps);
-		balance_pgdat(pgdat, 0, &ps);
+
+		balance_pgdat(pgdat, 0);
 	}
 }
 
@@ -1105,10 +1170,7 @@ int shrink_all_memory(int nr_pages)
 	current->reclaim_state = &reclaim_state;
 	for_each_pgdat(pgdat) {
 		int freed;
-		struct page_state ps;
-
-		get_page_state(&ps);
-		freed = balance_pgdat(pgdat, nr_to_free, &ps);
+		freed = balance_pgdat(pgdat, nr_to_free);
 		ret += freed;
 		nr_to_free -= freed;
 		if (nr_to_free <= 0)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 6203a5616..a44c900ac 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -49,7 +49,7 @@ static char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>";
 static char vlan_buggyright[] = "David S. Miller <davem@redhat.com>";
 
 static int vlan_device_event(struct notifier_block *, unsigned long, void *);
-static int vlan_ioctl_handler(unsigned long);
+static int vlan_ioctl_handler(void __user *);
 static int unregister_vlan_dev(struct net_device *, unsigned short );
 
 struct notifier_block vlan_notifier_block = {
@@ -661,9 +661,9 @@ out:
 /*
  *	VLAN IOCTL handler.
  *	o execute requested action or pass command to the device driver
- *   arg is really a void* to a vlan_ioctl_args structure.
+ *   arg is really a struct vlan_ioctl_args __user *.
  */
-static int vlan_ioctl_handler(unsigned long arg)
+static int vlan_ioctl_handler(void __user *arg)
 {
 	int err = 0;
 	struct vlan_ioctl_args args;
@@ -675,8 +675,7 @@ static int vlan_ioctl_handler(unsigned long arg)
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
 
-	if (copy_from_user(&args, (void*)arg,
-                           sizeof(struct vlan_ioctl_args)))
+	if (copy_from_user(&args, arg, sizeof(struct vlan_ioctl_args)))
 		return -EFAULT;
 
 	/* Null terminate this sucker, just in case. */
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
index 0bff5a834..3a5ae4334 100644
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -7,7 +7,7 @@
 /* #define VLAN_DEBUG */
 
 #define VLAN_ERR KERN_ERR
-#define VLAN_INF KERN_ALERT
+#define VLAN_INF KERN_INFO
 #define VLAN_DBG KERN_ALERT /* change these... to debug, having a hard time
                              * changing the log level at run-time..for some reason.
                              */
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index af571e3e3..4170de1a0 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -673,7 +673,7 @@ static int ddp_device_event(struct notifier_block *this, unsigned long event,
 
 /* ioctl calls. Shouldn't even need touching */
 /* Device configuration ioctl calls */
-static int atif_ioctl(int cmd, void *arg)
+static int atif_ioctl(int cmd, void __user *arg)
 {
 	static char aarp_mcast[6] = { 0x09, 0x00, 0x00, 0xFF, 0xFF, 0xFF };
 	struct ifreq atreq;
@@ -892,7 +892,7 @@ static int atif_ioctl(int cmd, void *arg)
 }
 
 /* Routing ioctl() calls */
-static int atrtr_ioctl(unsigned int cmd, void *arg)
+static int atrtr_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct rtentry rt;
 
@@ -1567,7 +1567,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
 	struct atalk_route *rt;
 	int err;
 
-	if (flags & ~MSG_DONTWAIT)
+	if (flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	if (len > DDP_MAXSZ)
@@ -1769,6 +1769,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	int rc = -EINVAL;
 	struct sock *sk = sock->sk;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 		/* Protocol layer */
@@ -1778,7 +1779,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 
 			if (amount < 0)
 				amount = 0;
-			rc = put_user(amount, (int *)arg);
+			rc = put_user(amount, (int __user *)argp);
 			break;
 		}
 		case TIOCINQ: {
@@ -1791,18 +1792,18 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 
 			if (skb)
 				amount = skb->len - sizeof(struct ddpehdr);
-			rc = put_user(amount, (int *)arg);
+			rc = put_user(amount, (int __user *)argp);
 			break;
 		}
 		case SIOCGSTAMP:
-			rc = sock_get_timestamp(sk, (struct timeval *)arg);
+			rc = sock_get_timestamp(sk, argp);
 			break;
 		/* Routing */
 		case SIOCADDRT:
 		case SIOCDELRT:
 			rc = -EPERM;
 			if (capable(CAP_NET_ADMIN))
-				rc = atrtr_ioctl(cmd, (void *)arg);
+				rc = atrtr_ioctl(cmd, argp);
 			break;
 		/* Interface */
 		case SIOCGIFADDR:
@@ -1813,7 +1814,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCSARP:		/* proxy AARP */
 		case SIOCDARP:		/* proxy AARP */
 			rtnl_lock();
-			rc = atif_ioctl(cmd, (void *)arg);
+			rc = atif_ioctl(cmd, argp);
 			rtnl_unlock();
 			break;
 		/* Physical layer ioctl calls */
@@ -1829,7 +1830,7 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCGIFCOUNT:
 		case SIOCGIFINDEX:
 		case SIOCGIFNAME:
-			rc = dev_ioctl(cmd, (void *)arg);
+			rc = dev_ioctl(cmd, argp);
 			break;
 	}
 
diff --git a/net/atm/addr.c b/net/atm/addr.c
index 459bdeed0..96407a0bb 100644
--- a/net/atm/addr.c
+++ b/net/atm/addr.c
@@ -114,7 +114,7 @@ int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr)
 }
 
 
-int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc *u_buf,int size)
+int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size)
 {
 	unsigned long flags;
 	struct atm_dev_addr *walk;
@@ -134,7 +134,7 @@ int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc *u_buf,int size)
 		memcpy(tmp_bufp++, &walk->addr, sizeof(struct sockaddr_atmsvc));
 	spin_unlock_irqrestore(&dev->lock, flags);
 	error = total > size ? -E2BIG : total;
-	if (copy_to_user(u_buf, tmp_buf, total < size ? total : size))
+	if (copy_to_user(buf, tmp_buf, total < size ? total : size))
 		error = -EFAULT;
 	kfree(tmp_buf);
 	return error;
diff --git a/net/atm/addr.h b/net/atm/addr.h
index 89f651cbc..2affa3a12 100644
--- a/net/atm/addr.h
+++ b/net/atm/addr.h
@@ -13,6 +13,6 @@
 void atm_reset_addr(struct atm_dev *dev);
 int atm_add_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
 int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
-int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc *u_buf,int size);
+int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size);
 
 #endif
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index f469813fa..91a89d3a2 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -342,12 +342,12 @@ static int br2684_mac_addr(struct net_device *dev, void *p)
 
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 /* this IOCTL is experimental. */
-static int br2684_setfilt(struct atm_vcc *atmvcc, unsigned long arg)
+static int br2684_setfilt(struct atm_vcc *atmvcc, void __user *arg)
 {
 	struct br2684_vcc *brvcc;
 	struct br2684_filter_set fs;
 
-	if (copy_from_user(&fs, (void *) arg, sizeof fs))
+	if (copy_from_user(&fs, arg, sizeof fs))
 		return -EFAULT;
 	if (fs.ifspec.method != BR2684_FIND_BYNOTHING) {
 		/*
@@ -494,7 +494,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 	netif_rx(skb);
 }
 
-static int br2684_regvcc(struct atm_vcc *atmvcc, unsigned long arg)
+static int br2684_regvcc(struct atm_vcc *atmvcc, void __user *arg)
 {
 /* assign a vcc to a dev
 Note: we do not have explicit unassign, but look at _push()
@@ -507,7 +507,7 @@ Note: we do not have explicit unassign, but look at _push()
 	struct net_device *net_dev;
 	struct atm_backend_br2684 be;
 
-	if (copy_from_user(&be, (void *) arg, sizeof be))
+	if (copy_from_user(&be, arg, sizeof be))
 		return -EFAULT;
 	brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
 	if (!brvcc)
@@ -593,7 +593,7 @@ static void br2684_setup(struct net_device *netdev)
 	INIT_LIST_HEAD(&brdev->brvccs);
 }
 
-static int br2684_create(unsigned long arg)
+static int br2684_create(void __user *arg)
 {
 	int err;
 	struct net_device *netdev;
@@ -602,7 +602,7 @@ static int br2684_create(unsigned long arg)
 
 	DPRINTK("br2684_create\n");
 
-	if (copy_from_user(&ni, (void *) arg, sizeof ni)) {
+	if (copy_from_user(&ni, arg, sizeof ni)) {
 		return -EFAULT;
 	}
 	if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
@@ -642,13 +642,14 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
 	unsigned long arg)
 {
 	struct atm_vcc *atmvcc = ATM_SD(sock);
+	void __user *argp = (void __user *)arg;
 
 	int err;
 	switch(cmd) {
 	case ATM_SETBACKEND:
 	case ATM_NEWBACKENDIF: {
 		atm_backend_t b;
-		err = get_user(b, (atm_backend_t *) arg);
+		err = get_user(b, (atm_backend_t __user *) argp);
 		if (err)
 			return -EFAULT;
 		if (b != ATM_BACKEND_BR2684)
@@ -656,9 +657,9 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 		if (cmd == ATM_SETBACKEND)
-			return br2684_regvcc(atmvcc, arg);
+			return br2684_regvcc(atmvcc, argp);
 		else
-			return br2684_create(arg);
+			return br2684_create(argp);
 		}
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 	case BR2684_SETFILT:
@@ -666,7 +667,7 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
 			return -ENOIOCTLCMD;
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
-		err = br2684_setfilt(atmvcc, arg);
+		err = br2684_setfilt(atmvcc, argp);
 		return err;
 #endif /* CONFIG_ATM_BR2684_IPFILTER */
 	}
diff --git a/net/atm/common.c b/net/atm/common.c
index 859b72739..ce00ea644 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -509,7 +509,7 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
 	struct atm_vcc *vcc;
 	struct sk_buff *skb;
 	int eff,error;
-	const void *buff;
+	const void __user *buff;
 	int size;
 
 	lock_sock(sk);
@@ -676,7 +676,7 @@ static int check_qos(struct atm_qos *qos)
 }
 
 int vcc_setsockopt(struct socket *sock, int level, int optname,
-		   char *optval, int optlen)
+		   char __user *optval, int optlen)
 {
 	struct atm_vcc *vcc;
 	unsigned long value;
@@ -704,7 +704,7 @@ int vcc_setsockopt(struct socket *sock, int level, int optname,
 				return 0;
 			}
 		case SO_SETCLP:
-			if (get_user(value,(unsigned long *) optval))
+			if (get_user(value,(unsigned long __user *)optval))
 				return -EFAULT;
 			if (value) vcc->atm_options |= ATM_ATMOPT_CLP;
 			else vcc->atm_options &= ~ATM_ATMOPT_CLP;
@@ -719,7 +719,7 @@ int vcc_setsockopt(struct socket *sock, int level, int optname,
 
 
 int vcc_getsockopt(struct socket *sock, int level, int optname,
-		   char *optval, int *optlen)
+		   char __user *optval, int __user *optlen)
 {
 	struct atm_vcc *vcc;
 	int len;
@@ -738,7 +738,7 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,
 			    -EFAULT : 0;
 		case SO_SETCLP:
 			return put_user(vcc->atm_options & ATM_ATMOPT_CLP ? 1 :
-			  0,(unsigned long *) optval) ? -EFAULT : 0;
+			  0,(unsigned long __user *)optval) ? -EFAULT : 0;
 		case SO_ATMPVC:
 			{
 				struct sockaddr_atmpvc pvc;
diff --git a/net/atm/common.h b/net/atm/common.h
index fe634abeb..d4cb95c57 100644
--- a/net/atm/common.h
+++ b/net/atm/common.h
@@ -19,10 +19,10 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
 		size_t total_len);
 unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
-int vcc_setsockopt(struct socket *sock, int level, int optname, char *optval,
-		   int optlen);
-int vcc_getsockopt(struct socket *sock, int level, int optname, char *optval,
-		   int *optlen);
+int vcc_setsockopt(struct socket *sock, int level, int optname,
+		   char __user *optval, int optlen);
+int vcc_getsockopt(struct socket *sock, int level, int optname,
+		   char __user *optval, int __user *optlen);
 
 void atm_shutdown_dev(struct atm_dev *dev);
 
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
index b8133d17d..b15e724f8 100644
--- a/net/atm/ioctl.c
+++ b/net/atm/ioctl.c
@@ -49,6 +49,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	struct atm_vcc *vcc;
 	int error;
 	struct list_head * pos;
+	void __user *argp = (void __user *)arg;
 
 	vcc = ATM_SD(sock);
 	switch (cmd) {
@@ -60,7 +61,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			}
 			error = put_user(vcc->sk->sk_sndbuf -
 					 atomic_read(&vcc->sk->sk_wmem_alloc),
-					 (int *) arg) ? -EFAULT : 0;
+					 (int __user *) argp) ? -EFAULT : 0;
 			goto done;
 		case SIOCINQ:
 			{
@@ -72,12 +73,11 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 				}
 				skb = skb_peek(&vcc->sk->sk_receive_queue);
 				error = put_user(skb ? skb->len : 0,
-					 	 (int *) arg) ? -EFAULT : 0;
+					 	 (int __user *)argp) ? -EFAULT : 0;
 				goto done;
 			}
 		case SIOCGSTAMP: /* borrowed from IP */
-			error = sock_get_timestamp(vcc->sk, (struct timeval *)
-						   arg);
+			error = sock_get_timestamp(vcc->sk, argp);
 			goto done;
 		case ATM_SETSC:
 			printk(KERN_WARNING "ATM_SETSC is obsolete\n");
@@ -131,7 +131,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	if (error != -ENOIOCTLCMD)
 		goto done;
 
-	error = atm_dev_ioctl(cmd, arg);
+	error = atm_dev_ioctl(cmd, argp);
 
 done:
 	return error;
diff --git a/net/atm/lec.c b/net/atm/lec.c
index fb6cc84bb..b005e1a5c 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -774,7 +774,7 @@ lec_pop(struct atm_vcc *vcc, struct sk_buff *skb)
 }
 
 int 
-lec_vcc_attach(struct atm_vcc *vcc, void *arg)
+lec_vcc_attach(struct atm_vcc *vcc, void __user *arg)
 {
 	struct lec_vcc_priv *vpriv;
         int bytes_left;
@@ -1161,7 +1161,7 @@ static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			err = lec_mcast_attach(vcc, (int) arg);
 			break;
 		case ATMLEC_DATA:
-			err = lec_vcc_attach(vcc, (void *) arg);
+			err = lec_vcc_attach(vcc, (void __user *) arg);
 			break;
 	}
 
diff --git a/net/atm/lec.h b/net/atm/lec.h
index 673bd7881..af6559193 100644
--- a/net/atm/lec.h
+++ b/net/atm/lec.h
@@ -148,7 +148,7 @@ struct lec_vcc_priv {
 #define LEC_VCC_PRIV(vcc)	((struct lec_vcc_priv *)((vcc)->user_back))
 
 int lecd_attach(struct atm_vcc *vcc, int arg);
-int lec_vcc_attach(struct atm_vcc *vcc, void *arg);
+int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg);
 int lec_mcast_attach(struct atm_vcc *vcc, int arg);
 struct net_device *get_dev_lec(int itf);
 int make_lec(struct atm_vcc *vcc);
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 0ca118478..e629e89d4 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -565,7 +565,7 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
 	return retval;
 }
 
-int atm_mpoa_vcc_attach(struct atm_vcc *vcc, long arg)
+int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg)
 {
 	int bytes_left;
 	struct mpoa_client *mpc;
@@ -574,7 +574,7 @@ int atm_mpoa_vcc_attach(struct atm_vcc *vcc, long arg)
 	uint32_t  ipaddr;
 	unsigned char *ip;
 
-	bytes_left = copy_from_user(&ioc_data, (void *)arg, sizeof(struct atmmpc_ioc));
+	bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmmpc_ioc));
 	if (bytes_left != 0) {
 		printk("mpoa: mpc_vcc_attach: Short read (missed %d bytes) from userland\n", bytes_left);
 		return -EFAULT;
@@ -1366,7 +1366,7 @@ static void clean_up(struct k_message *msg, struct mpoa_client *mpc, int action)
 	return;
 }
 
-static void mpc_timer_refresh()
+static void mpc_timer_refresh(void)
 {
 	mpc_timer.expires = jiffies + (MPC_P2 * HZ);
 	mpc_timer.data = mpc_timer.expires;
@@ -1418,7 +1418,7 @@ static int atm_mpoa_ioctl(struct socket *sock, unsigned int cmd, unsigned long a
 				sock->state = SS_CONNECTED;
 			break;
 		case ATMMPC_DATA:
-			err = atm_mpoa_vcc_attach(vcc, arg);
+			err = atm_mpoa_vcc_attach(vcc, (void __user *)arg);
 			break;
 		default:
 			break;
diff --git a/net/atm/mpc.h b/net/atm/mpc.h
index a28e4b274..c7b1108d0 100644
--- a/net/atm/mpc.h
+++ b/net/atm/mpc.h
@@ -13,7 +13,7 @@ int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc);
 
 /* Functions for ioctl(ATMMPC_*) operations */
 int atm_mpoa_mpoad_attach(struct atm_vcc *vcc, int arg);
-int atm_mpoa_vcc_attach(struct atm_vcc *vcc, long arg);
+int atm_mpoa_vcc_attach(struct atm_vcc *vcc, void __user *arg);
 
 struct mpoa_client {
         struct mpoa_client *next;
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 6201756e6..64c676dd5 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -30,10 +30,10 @@
 extern struct mpoa_client *mpcs;
 extern struct proc_dir_entry *atm_proc_root;  /* from proc.c. */
 
-static ssize_t proc_mpc_read(struct file *file, char *buff,
+static ssize_t proc_mpc_read(struct file *file, char __user *buff,
 			     size_t count, loff_t *pos);
 
-static ssize_t proc_mpc_write(struct file *file, const char *buff,
+static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
                               size_t nbytes, loff_t *ppos);
 
 static int parse_qos(const char *buff, int len);
@@ -99,7 +99,7 @@ static const char *egress_state_string(int state){
 /*
  * READING function - called when the /proc/atm/mpoa file is read from.
  */
-static ssize_t proc_mpc_read(struct file *file, char *buff,
+static ssize_t proc_mpc_read(struct file *file, char __user *buff,
 			     size_t count, loff_t *pos){
         unsigned long page = 0;
 	unsigned char *temp;
@@ -165,12 +165,12 @@ static ssize_t proc_mpc_read(struct file *file, char *buff,
         return length;
 }
 
-static ssize_t proc_mpc_write(struct file *file, const char *buff,
+static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
                               size_t nbytes, loff_t *ppos)
 {
         int incoming, error, retval;
         char *page, c;
-        const char *tmp;
+        const char __user *tmp;
 
         if (nbytes == 0) return 0;
         if (nbytes >= PAGE_SIZE) nbytes = PAGE_SIZE-1;
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 95b63a08e..e430c24cc 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -257,10 +257,10 @@ static int pppoatm_devppp_ioctl(struct ppp_channel *chan, unsigned int cmd,
 {
 	switch (cmd) {
 	case PPPIOCGFLAGS:
-		return put_user(chan_to_pvcc(chan)->flags, (int *) arg)
+		return put_user(chan_to_pvcc(chan)->flags, (int __user *) arg)
 		    ? -EFAULT : 0;
 	case PPPIOCSFLAGS:
-		return get_user(chan_to_pvcc(chan)->flags, (int *) arg)
+		return get_user(chan_to_pvcc(chan)->flags, (int __user *) arg)
 		    ? -EFAULT : 0;
 	}
 	return -ENOTTY;
@@ -271,7 +271,7 @@ static /*const*/ struct ppp_channel_ops pppoatm_ops = {
 	.ioctl = pppoatm_devppp_ioctl,
 };
 
-static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, unsigned long arg)
+static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
 {
 	struct atm_backend_ppp be;
 	struct pppoatm_vcc *pvcc;
@@ -281,7 +281,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, unsigned long arg)
 	 * prototypical one used to initialize them
 	 */
 	static const DECLARE_TASKLET(tasklet_proto, pppoatm_wakeup_sender, 0);
-	if (copy_from_user(&be, (void *) arg, sizeof be))
+	if (copy_from_user(&be, arg, sizeof be))
 		return -EFAULT;
 	if (be.encaps != PPPOATM_ENCAPS_AUTODETECT &&
 	    be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC)
@@ -319,26 +319,27 @@ static int pppoatm_ioctl(struct socket *sock, unsigned int cmd,
 	unsigned long arg)
 {
 	struct atm_vcc *atmvcc = ATM_SD(sock);
+	void __user *argp = (void __user *)arg;
 
 	if (cmd != ATM_SETBACKEND && atmvcc->push != pppoatm_push)
 		return -ENOIOCTLCMD;
 	switch (cmd) {
 	case ATM_SETBACKEND: {
 		atm_backend_t b;
-		if (get_user(b, (atm_backend_t *) arg))
+		if (get_user(b, (atm_backend_t __user *) argp))
 			return -EFAULT;
 		if (b != ATM_BACKEND_PPP)
 			return -ENOIOCTLCMD;
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
-		return pppoatm_assign_vcc(atmvcc, arg);
+		return pppoatm_assign_vcc(atmvcc, argp);
 		}
 	case PPPIOCGCHAN:
 		return put_user(ppp_channel_index(&atmvcc_to_pvcc(atmvcc)->
-		    chan), (int *) arg) ? -EFAULT : 0;
+		    chan), (int __user *) argp) ? -EFAULT : 0;
 	case PPPIOCGUNIT:
 		return put_user(ppp_unit_number(&atmvcc_to_pvcc(atmvcc)->
-		    chan), (int *) arg) ? -EFAULT : 0;
+		    chan), (int __user *) argp) ? -EFAULT : 0;
 	}
 	return -ENOIOCTLCMD;
 }
diff --git a/net/atm/proc.c b/net/atm/proc.c
index fffc39bc1..12f49fe94 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -31,7 +31,7 @@
 #include "common.h" /* atm_proc_init prototype */
 #include "signaling.h" /* to get sigd - ugly too */
 
-static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count,
+static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count,
     loff_t *pos);
 
 static struct file_operations proc_atm_dev_ops = {
@@ -384,8 +384,8 @@ static struct file_operations svc_seq_fops = {
 	.release	= vcc_seq_release,
 };
 
-static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count,
-    loff_t *pos)
+static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
+				 size_t count, loff_t *pos)
 {
 	struct atm_dev *dev;
 	unsigned long page;
diff --git a/net/atm/pvc.c b/net/atm/pvc.c
index c0ce4d4d2..2684a92da 100644
--- a/net/atm/pvc.c
+++ b/net/atm/pvc.c
@@ -60,7 +60,7 @@ static int pvc_connect(struct socket *sock,struct sockaddr *sockaddr,
 }
 
 static int pvc_setsockopt(struct socket *sock, int level, int optname,
-			  char *optval, int optlen)
+			  char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	int error;
@@ -73,7 +73,7 @@ static int pvc_setsockopt(struct socket *sock, int level, int optname,
 
 
 static int pvc_getsockopt(struct socket *sock, int level, int optname,
-		          char *optval, int *optlen)
+		          char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	int error;
diff --git a/net/atm/resources.c b/net/atm/resources.c
index a72dc2d42..58de2ac93 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -180,7 +180,7 @@ static void subtract_aal_stats(struct k_atm_aal_stats *from,
 }
 
 
-static int fetch_stats(struct atm_dev *dev, struct atm_dev_stats *arg, int zero)
+static int fetch_stats(struct atm_dev *dev, struct atm_dev_stats __user *arg, int zero)
 {
 	struct atm_dev_stats tmp;
 	int error = 0;
@@ -199,19 +199,20 @@ static int fetch_stats(struct atm_dev *dev, struct atm_dev_stats *arg, int zero)
 }
 
 
-int atm_dev_ioctl(unsigned int cmd, unsigned long arg)
+int atm_dev_ioctl(unsigned int cmd, void __user *arg)
 {
-	void *buf;
+	void __user *buf;
 	int error, len, number, size = 0;
 	struct atm_dev *dev;
 	struct list_head *p;
 	int *tmp_buf, *tmp_p;
-
+	struct atm_iobuf __user *iobuf = arg;
+	struct atmif_sioc __user *sioc = arg;
 	switch (cmd) {
 		case ATM_GETNAMES:
-			if (get_user(buf, &((struct atm_iobuf *) arg)->buffer))
+			if (get_user(buf, &iobuf->buffer))
 				return -EFAULT;
-			if (get_user(len, &((struct atm_iobuf *) arg)->length))
+			if (get_user(len, &iobuf->length))
 				return -EFAULT;
 			spin_lock(&atm_dev_lock);
 			list_for_each(p, &atm_devs)
@@ -232,7 +233,7 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg)
 			}
 			spin_unlock(&atm_dev_lock);
 		        error = ((copy_to_user(buf, tmp_buf, size)) ||
-					put_user(size, &((struct atm_iobuf *) arg)->length))
+					put_user(size, &iobuf->length))
 						? -EFAULT : 0;
 			kfree(tmp_buf);
 			return error;
@@ -240,11 +241,11 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg)
 			break;
 	}
 
-	if (get_user(buf, &((struct atmif_sioc *) arg)->arg))
+	if (get_user(buf, &sioc->arg))
 		return -EFAULT;
-	if (get_user(len, &((struct atmif_sioc *) arg)->length))
+	if (get_user(len, &sioc->length))
 		return -EFAULT;
-	if (get_user(number, &((struct atmif_sioc *) arg)->number))
+	if (get_user(number, &sioc->number))
 		return -EFAULT;
 
 	if (!(dev = atm_dev_lookup(number)))
@@ -351,7 +352,7 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg)
 			size = error;
 			/* may return 0, but later on size == 0 means "don't
 			   write the length" */
-			error = put_user(size, &((struct atmif_sioc *) arg)->length)
+			error = put_user(size, &sioc->length)
 				? -EFAULT : 0;
 			goto done;
 		case ATM_SETLOOP:
@@ -385,7 +386,7 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg)
 	}
 	
 	if (size)
-		error = put_user(size, &((struct atmif_sioc *) arg)->length)
+		error = put_user(size, &sioc->length)
 			? -EFAULT : 0;
 	else
 		error = 0;
diff --git a/net/atm/resources.h b/net/atm/resources.h
index 5f69a949e..12910619d 100644
--- a/net/atm/resources.h
+++ b/net/atm/resources.h
@@ -14,7 +14,7 @@ extern struct list_head atm_devs;
 extern spinlock_t atm_dev_lock;
 
 
-int atm_dev_ioctl(unsigned int cmd, unsigned long arg);
+int atm_dev_ioctl(unsigned int cmd, void __user *arg);
 
 
 #ifdef CONFIG_PROC_FS
diff --git a/net/atm/svc.c b/net/atm/svc.c
index aa46d6ae9..c3e321fd4 100644
--- a/net/atm/svc.c
+++ b/net/atm/svc.c
@@ -459,7 +459,7 @@ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos)
 
 
 static int svc_setsockopt(struct socket *sock,int level,int optname,
-    char *optval,int optlen)
+    char __user *optval,int optlen)
 {
 	struct sock *sk = sock->sk;
 	struct atm_vcc *vcc;
@@ -483,7 +483,7 @@ out:
 
 
 static int svc_getsockopt(struct socket *sock,int level,int optname,
-    char *optval,int *optlen)
+    char __user *optval,int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	int error = 0, len;
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 75ab89d5c..47fbd98e0 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -336,7 +336,7 @@ void ax25_destroy_socket(ax25_cb *ax25)
  *		  includes a KILL command to abort any connection.
  *		  VERY useful for debugging ;-)
  */
-static int ax25_ctl_ioctl(const unsigned int cmd, void *arg)
+static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
 {
 	struct ax25_ctl_struct ax25_ctl;
 	ax25_digi digi;
@@ -508,7 +508,7 @@ ax25_cb *ax25_create_cb(void)
  */
 
 static int ax25_setsockopt(struct socket *sock, int level, int optname,
-	char *optval, int optlen)
+	char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	ax25_cb *ax25;
@@ -522,7 +522,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
 	if (optlen < sizeof(int))
 		return -EINVAL;
 
-	if (get_user(opt, (int *)optval))
+	if (get_user(opt, (int __user *)optval))
 		return -EFAULT;
 
 	lock_sock(sk);
@@ -648,7 +648,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
 }
 
 static int ax25_getsockopt(struct socket *sock, int level, int optname,
-	char *optval, int *optlen)
+	char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	ax25_cb *ax25;
@@ -1413,9 +1413,8 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
 	size_t size;
 	int lv, err, addr_len = msg->msg_namelen;
 
-	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR)) {
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
 		return -EINVAL;
-	}
 
 	lock_sock(sk);
 	ax25 = ax25_sk(sk);
@@ -1669,6 +1668,7 @@ static int ax25_shutdown(struct socket *sk, int how)
 static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
+	void __user *argp = (void __user *)arg;
 	int res = 0;
 
 	lock_sock(sk);
@@ -1678,7 +1678,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 		if (amount < 0)
 			amount = 0;
-		res = put_user(amount, (int *)arg);
+		res = put_user(amount, (int __user *)argp);
 		break;
 	}
 
@@ -1688,13 +1688,13 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		/* These two are safe on a single CPU system as only user tasks fiddle here */
 		if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
 			amount = skb->len;
-		res = put_user(amount, (int *)arg);
+		res = put_user(amount, (int __user *)argp);
 		break;
 	}
 
 	case SIOCGSTAMP:
 		if (sk != NULL) {
-			res = sock_get_timestamp(sk, (struct timeval *)arg);
+			res = sock_get_timestamp(sk, argp);
 			break;
 	 	}
 		res = -EINVAL;
@@ -1704,7 +1704,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	case SIOCAX25DELUID:	/* Delete a uid from the uid/call map table */
 	case SIOCAX25GETUID: {
 		struct sockaddr_ax25 sax25;
-		if (copy_from_user(&sax25, (void *)arg, sizeof(sax25))) {
+		if (copy_from_user(&sax25, argp, sizeof(sax25))) {
 			res = -EFAULT;
 			break;
 		}
@@ -1718,7 +1718,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			res = -EPERM;
 			break;
 		}
-		if (get_user(amount, (long *)arg)) {
+		if (get_user(amount, (long __user *)argp)) {
 			res = -EFAULT;
 			break;
 		}
@@ -1738,7 +1738,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			res = -EPERM;
 			break;
 		}
-		res = ax25_rt_ioctl(cmd, (void *)arg);
+		res = ax25_rt_ioctl(cmd, argp);
 		break;
 
 	case SIOCAX25CTLCON:
@@ -1746,7 +1746,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			res = -EPERM;
 			break;
 		}
-		res = ax25_ctl_ioctl(cmd, (void *)arg);
+		res = ax25_ctl_ioctl(cmd, argp);
 		break;
 
 	case SIOCAX25GETINFO:
@@ -1783,12 +1783,12 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 				warned=1;
 			}
 
-			if (copy_to_user((void *)arg, &ax25_info, sizeof(struct ax25_info_struct_deprecated))) {
+			if (copy_to_user(argp, &ax25_info, sizeof(struct ax25_info_struct_deprecated))) {
 				res = -EFAULT;
 				break;
 			}
 		} else {
-			if (copy_to_user((void *)arg, &ax25_info, sizeof(struct ax25_info_struct))) {
+			if (copy_to_user(argp, &ax25_info, sizeof(struct ax25_info_struct))) {
 				res = -EINVAL;
 				break;
 			}
@@ -1804,7 +1804,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			res = -EPERM;
 			break;
 		}
-		if (copy_from_user(&ax25_fwd, (void *)arg, sizeof(ax25_fwd))) {
+		if (copy_from_user(&ax25_fwd, argp, sizeof(ax25_fwd))) {
 			res = -EFAULT;
 			break;
 		}
@@ -1826,7 +1826,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		break;
 
 	default:
-		res = dev_ioctl(cmd, (void *)arg);
+		res = dev_ioctl(cmd, argp);
 		break;
 	}
 	release_sock(sk);
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index 7c977ebcc..de40eee76 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -253,7 +253,7 @@ out:
 	return err;
 }
 
-int ax25_rt_ioctl(unsigned int cmd, void *arg)
+int ax25_rt_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct ax25_route_opt_struct rt_option;
 	struct ax25_routes_struct route;
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index b0eb17f97..7c050d65d 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -14,22 +14,20 @@ menuconfig BT
 
 	  Linux Bluetooth subsystem consist of several layers:
 	     Bluetooth Core (HCI device and connection manager, scheduler)
-	     HCI Device drivers (interface to the hardware)
-	     L2CAP Module (L2CAP protocol)
-	     SCO Module (SCO links)
-	     RFCOMM Module (RFCOMM protocol)  
-	     BNEP Module (BNEP protocol)
-	     CMTP Module (CMTP protocol)
+	     HCI Device drivers (Interface to the hardware)
+	     SCO Module (SCO audio links)
+	     L2CAP Module (Logical Link Control and Adaptation Protocol)
+	     RFCOMM Module (RFCOMM Protocol)  
+	     BNEP Module (Bluetooth Network Encapsulation Protocol)
+	     CMTP Module (CAPI Message Transport Protocol)
 
-	  Say Y here to enable Linux Bluetooth support and to build Bluetooth Core
-	  layer.
+	  Say Y here to compile Bluetooth support into the kernel or say M to
+	  compile it as module (bluetooth).
 
 	  To use Linux Bluetooth subsystem, you will need several user-space
 	  utilities like hciconfig and hcid.  These utilities and updates to
 	  Bluetooth kernel modules are provided in the BlueZ packages.
-	  For more information, see <http://bluez.sourceforge.net/>.
-
-	  If you want to compile Bluetooth Core as module (bluetooth) say M here.
+	  For more information, see <http://www.bluez.org/>.
 
 config BT_L2CAP
 	tristate "L2CAP protocol support"
@@ -46,7 +44,7 @@ config BT_SCO
 	tristate "SCO links support"
 	depends on BT
 	help
-	  SCO link provides voice transport over Bluetooth. SCO support is
+	  SCO link provides voice transport over Bluetooth.  SCO support is
 	  required for voice applications like Headset and Audio.
 
 	  Say Y here to compile SCO support into the kernel or say M to
diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
index 39cbf94a4..ce0521706 100644
--- a/net/bluetooth/Makefile
+++ b/net/bluetooth/Makefile
@@ -9,4 +9,4 @@ obj-$(CONFIG_BT_RFCOMM)	+= rfcomm/
 obj-$(CONFIG_BT_BNEP)	+= bnep/
 obj-$(CONFIG_BT_CMTP)	+= cmtp/
 
-bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o syms.o
+bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 74b70f70e..e111cf3c3 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -22,12 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- *  Bluetooth address family and sockets.
- *
- * $Id: af_bluetooth.c,v 1.3 2002/04/17 17:37:15 maxk Exp $
- */
-#define VERSION "2.4"
+/* Bluetooth address family and sockets. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -53,13 +48,16 @@
 
 #ifndef CONFIG_BT_SOCK_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
+#define VERSION "2.5"
+
 struct proc_dir_entry *proc_bt;
+EXPORT_SYMBOL(proc_bt);
 
 /* Bluetooth sockets */
-#define BT_MAX_PROTO	6
+#define BT_MAX_PROTO	7
 static struct net_proto_family *bt_proto[BT_MAX_PROTO];
 
 static kmem_cache_t *bt_sock_cache;
@@ -75,6 +73,7 @@ int bt_sock_register(int proto, struct net_proto_family *ops)
 	bt_proto[proto] = ops;
 	return 0;
 }
+EXPORT_SYMBOL(bt_sock_register);
 
 int bt_sock_unregister(int proto)
 {
@@ -87,6 +86,7 @@ int bt_sock_unregister(int proto)
 	bt_proto[proto] = NULL;
 	return 0;
 }
+EXPORT_SYMBOL(bt_sock_unregister);
 
 static int bt_sock_create(struct socket *sock, int proto)
 {
@@ -116,7 +116,7 @@ struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio
 	sk = sk_alloc(PF_BLUETOOTH, prio, sizeof(struct bt_sock), bt_sock_cache);
 	if (!sk)
 		return NULL;
-	
+
 	if (pi_size) {
 		pi = kmalloc(pi_size, prio);
 		if (!pi) {
@@ -129,13 +129,14 @@ struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio
 
 	sock_init_data(sock, sk);
 	INIT_LIST_HEAD(&bt_sk(sk)->accept_q);
-	
+
 	sk->sk_zapped   = 0;
 	sk->sk_protocol = proto;
 	sk->sk_state    = BT_OPEN;
 
 	return sk;
 }
+EXPORT_SYMBOL(bt_sock_alloc);
 
 void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
 {
@@ -143,6 +144,7 @@ void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
 	sk_add_node(sk, &l->head);
 	write_unlock_bh(&l->lock);
 }
+EXPORT_SYMBOL(bt_sock_link);
 
 void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk)
 {
@@ -150,6 +152,7 @@ void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk)
 	sk_del_node_init(sk);
 	write_unlock_bh(&l->lock);
 }
+EXPORT_SYMBOL(bt_sock_unlink);
 
 void bt_accept_enqueue(struct sock *parent, struct sock *sk)
 {
@@ -160,6 +163,7 @@ void bt_accept_enqueue(struct sock *parent, struct sock *sk)
 	bt_sk(sk)->parent = parent;
 	parent->sk_ack_backlog++;
 }
+EXPORT_SYMBOL(bt_accept_enqueue);
 
 static void bt_accept_unlink(struct sock *sk)
 {
@@ -175,19 +179,19 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
 {
 	struct list_head *p, *n;
 	struct sock *sk;
-	
+
 	BT_DBG("parent %p", parent);
 
 	list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
 		sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
-		
+
 		lock_sock(sk);
 		if (sk->sk_state == BT_CLOSED) {
 			release_sock(sk);
 			bt_accept_unlink(sk);
 			continue;
 		}
-		
+
 		if (sk->sk_state == BT_CONNECTED || !newsock) {
 			bt_accept_unlink(sk);
 			if (newsock)
@@ -199,6 +203,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
 	}
 	return NULL;
 }
+EXPORT_SYMBOL(bt_accept_dequeue);
 
 int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	struct msghdr *msg, size_t len, int flags)
@@ -235,6 +240,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 
 	return err ? : copied;
 }
+EXPORT_SYMBOL(bt_sock_recvmsg);
 
 static inline unsigned int bt_accept_poll(struct sock *parent)
 {
@@ -287,6 +293,7 @@ unsigned int bt_sock_poll(struct file * file, struct socket *sock, poll_table *w
 
 	return mask;
 }
+EXPORT_SYMBOL(bt_sock_poll);
 
 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
 {
@@ -322,9 +329,10 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
 	remove_wait_queue(sk->sk_sleep, &wait);
 	return err;
 }
+EXPORT_SYMBOL(bt_sock_wait_state);
 
 static struct net_proto_family bt_sock_family_ops = {
-	.owner  = THIS_MODULE,
+	.owner	= THIS_MODULE,
 	.family	= PF_BLUETOOTH,
 	.create	= bt_sock_create,
 };
@@ -342,7 +350,7 @@ static int __init bt_init(void)
 	proc_bt = proc_mkdir("bluetooth", NULL);
 	if (proc_bt)
 		proc_bt->owner = THIS_MODULE;
-	
+
 	/* Init socket cache */
 	bt_sock_cache = kmem_cache_create("bt_sock",
 			sizeof(struct bt_sock), 0,
@@ -352,7 +360,7 @@ static int __init bt_init(void)
 		BT_ERR("Socket cache creation failed");
 		return -ENOMEM;
 	}
-	
+
 	sock_register(&bt_sock_family_ops);
 
 	BT_INFO("HCI device and connection manager initialized");
diff --git a/net/bluetooth/bnep/Kconfig b/net/bluetooth/bnep/Kconfig
index 5c2a14808..35158b036 100644
--- a/net/bluetooth/bnep/Kconfig
+++ b/net/bluetooth/bnep/Kconfig
@@ -4,12 +4,8 @@ config BT_BNEP
 	select CRC32
 	help
 	  BNEP (Bluetooth Network Encapsulation Protocol) is Ethernet
-	  emulation layer on top of Bluetooth. BNEP is required for Bluetooth
-	  PAN (Personal Area Network).
-
-	  To use BNEP, you will need user-space utilities provided in the 
-	  BlueZ-PAN package.
-	  For more information, see <http://bluez.sourceforge.net>.
+	  emulation layer on top of Bluetooth.  BNEP is required for
+	  Bluetooth PAN (Personal Area Network).
 
 	  Say Y here to compile BNEP support into the kernel or say M to
 	  compile it as module (bnep).
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 0978a58b7..990e503a1 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -77,6 +77,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 	struct bnep_conndel_req  cd;
 	struct bnep_conninfo ci;
 	struct socket *nsock;
+	void __user *argp = (void __user *)arg;
 	int err;
 
 	BT_DBG("cmd %x arg %lx", cmd, arg);
@@ -86,7 +87,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 		if (!capable(CAP_NET_ADMIN))
 			return -EACCES;
 
-		if (copy_from_user(&ca, (void *) arg, sizeof(ca)))
+		if (copy_from_user(&ca, argp, sizeof(ca)))
 			return -EFAULT;
 	
 		nsock = sockfd_lookup(ca.sock, &err);
@@ -100,7 +101,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 
 		err = bnep_add_connection(&ca, nsock);
 		if (!err) {
-    			if (copy_to_user((void *) arg, &ca, sizeof(ca)))
+    			if (copy_to_user(argp, &ca, sizeof(ca)))
 				err = -EFAULT;
 		} else
 			fput(nsock->file);
@@ -111,30 +112,30 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 		if (!capable(CAP_NET_ADMIN))
 			return -EACCES;
 
-		if (copy_from_user(&cd, (void *) arg, sizeof(cd)))
+		if (copy_from_user(&cd, argp, sizeof(cd)))
 			return -EFAULT;
 	
 		return bnep_del_connection(&cd);
 
 	case BNEPGETCONNLIST:
-		if (copy_from_user(&cl, (void *) arg, sizeof(cl)))
+		if (copy_from_user(&cl, argp, sizeof(cl)))
 			return -EFAULT;
 
 		if (cl.cnum <= 0)
 			return -EINVAL;
 	
 		err = bnep_get_connlist(&cl);
-		if (!err && copy_to_user((void *) arg, &cl, sizeof(cl)))
+		if (!err && copy_to_user(argp, &cl, sizeof(cl)))
 			return -EFAULT;
 
 		return err;
 
 	case BNEPGETCONNINFO:
-		if (copy_from_user(&ci, (void *) arg, sizeof(ci)))
+		if (copy_from_user(&ci, argp, sizeof(ci)))
 			return -EFAULT;
 
 		err = bnep_get_conninfo(&ci);
-		if (!err && copy_to_user((void *) arg, &ci, sizeof(ci)))
+		if (!err && copy_to_user(argp, &ci, sizeof(ci)))
 			return -EFAULT;
 
 		return err;
diff --git a/net/bluetooth/cmtp/Kconfig b/net/bluetooth/cmtp/Kconfig
index e832f20ce..d6b0382f6 100644
--- a/net/bluetooth/cmtp/Kconfig
+++ b/net/bluetooth/cmtp/Kconfig
@@ -3,7 +3,7 @@ config BT_CMTP
 	depends on BT && BT_L2CAP && ISDN_CAPI
 	help
 	  CMTP (CAPI Message Transport Protocol) is a transport layer
-	  for CAPI messages. CMTP is required for the Bluetooth Common
+	  for CAPI messages.  CMTP is required for the Bluetooth Common
 	  ISDN Access Profile.
 
 	  Say Y here to compile CMTP support into the kernel or say M to
diff --git a/net/bluetooth/cmtp/cmtp.h b/net/bluetooth/cmtp/cmtp.h
index 0a0062607..58e4adc38 100644
--- a/net/bluetooth/cmtp/cmtp.h
+++ b/net/bluetooth/cmtp/cmtp.h
@@ -55,7 +55,7 @@ struct cmtp_conninfo {
 
 struct cmtp_connlist_req {
 	__u32  cnum;
-	struct cmtp_conninfo *ci;
+	struct cmtp_conninfo __user *ci;
 };
 
 int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock);
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 618155928..bf4e7d784 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -71,6 +71,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 	struct cmtp_connlist_req cl;
 	struct cmtp_conninfo ci;
 	struct socket *nsock;
+	void __user *argp = (void __user *)arg;
 	int err;
 
 	BT_DBG("cmd %x arg %lx", cmd, arg);
@@ -80,7 +81,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 		if (!capable(CAP_NET_ADMIN))
 			return -EACCES;
 
-		if (copy_from_user(&ca, (void *) arg, sizeof(ca)))
+		if (copy_from_user(&ca, argp, sizeof(ca)))
 			return -EFAULT;
 
 		nsock = sockfd_lookup(ca.sock, &err);
@@ -94,7 +95,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 
 		err = cmtp_add_connection(&ca, nsock);
 		if (!err) {
-			if (copy_to_user((void *) arg, &ca, sizeof(ca)))
+			if (copy_to_user(argp, &ca, sizeof(ca)))
 				err = -EFAULT;
 		} else
 			fput(nsock->file);
@@ -105,30 +106,30 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
 		if (!capable(CAP_NET_ADMIN))
 			return -EACCES;
 
-		if (copy_from_user(&cd, (void *) arg, sizeof(cd)))
+		if (copy_from_user(&cd, argp, sizeof(cd)))
 			return -EFAULT;
 
 		return cmtp_del_connection(&cd);
 
 	case CMTPGETCONNLIST:
-		if (copy_from_user(&cl, (void *) arg, sizeof(cl)))
+		if (copy_from_user(&cl, argp, sizeof(cl)))
 			return -EFAULT;
 
 		if (cl.cnum <= 0)
 			return -EINVAL;
 
 		err = cmtp_get_connlist(&cl);
-		if (!err && copy_to_user((void *) arg, &cl, sizeof(cl)))
+		if (!err && copy_to_user(argp, &cl, sizeof(cl)))
 			return -EFAULT;
 
 		return err;
 
 	case CMTPGETCONNINFO:
-		if (copy_from_user(&ci, (void *) arg, sizeof(ci)))
+		if (copy_from_user(&ci, argp, sizeof(ci)))
 			return -EFAULT;
 
 		err = cmtp_get_conninfo(&ci);
-		if (!err && copy_to_user((void *) arg, &ci, sizeof(ci)))
+		if (!err && copy_to_user(argp, &ci, sizeof(ci)))
 			return -EFAULT;
 
 		return err;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 962ce3a34..51976db01 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -22,11 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * HCI Connection handling.
- *
- * $Id: hci_conn.c,v 1.2 2002/04/17 17:37:16 maxk Exp $
- */
+/* Bluetooth HCI connection handling. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -54,7 +50,7 @@
 
 #ifndef CONFIG_BT_HCI_CORE_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
 void hci_acl_connect(struct hci_conn *conn)
@@ -178,10 +174,10 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
 
 int hci_conn_del(struct hci_conn *conn)
 {
-	struct hci_dev  *hdev = conn->hdev;
+	struct hci_dev *hdev = conn->hdev;
 
 	BT_DBG("%s conn %p handle %d", hdev->name, conn, conn->handle);
-	
+
 	hci_conn_del_timer(conn);
 
 	if (conn->type == SCO_LINK) {
@@ -226,14 +222,14 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
 
 	list_for_each(p, &hci_dev_list) {
 		struct hci_dev *d = list_entry(p, struct hci_dev, list);
-		
+
 		if (!test_bit(HCI_UP, &d->flags))
 			continue;
 
 		/* Simple routing: 
-	 	 * 	No source address - find interface with bdaddr != dst 
-	 	 *	Source address 	  - find interface with bdaddr == src 
-	 	 */
+		 *   No source address - find interface with bdaddr != dst
+		 *   Source address    - find interface with bdaddr == src
+		 */
 
 		if (use_src) {
 			if (!bacmp(&d->bdaddr, src)) {
@@ -252,6 +248,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
 	read_unlock_bh(&hci_dev_list_lock);
 	return hdev;
 }
+EXPORT_SYMBOL(hci_get_route);
 
 /* Create SCO or ACL connection.
  * Device _must_ be locked */
@@ -294,15 +291,16 @@ struct hci_conn * hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst)
 		return acl;
 	}
 }
+EXPORT_SYMBOL(hci_connect);
 
 /* Authenticate remote device */
 int hci_conn_auth(struct hci_conn *conn)
 {
 	BT_DBG("conn %p", conn);
-	
+
 	if (conn->link_mode & HCI_LM_AUTH)
 		return 1;
-	
+
 	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
 		struct hci_cp_auth_requested cp;
 		cp.handle = __cpu_to_le16(conn->handle);
@@ -310,15 +308,16 @@ int hci_conn_auth(struct hci_conn *conn)
 	}
 	return 0;
 }
+EXPORT_SYMBOL(hci_conn_auth);
 
 /* Enable encryption */
 int hci_conn_encrypt(struct hci_conn *conn)
 {
 	BT_DBG("conn %p", conn);
-	
+
 	if (conn->link_mode & HCI_LM_ENCRYPT)
 		return 1;
-	
+
 	if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
 		return 0;
 
@@ -330,12 +329,13 @@ int hci_conn_encrypt(struct hci_conn *conn)
 	}
 	return 0;
 }
+EXPORT_SYMBOL(hci_conn_encrypt);
 
 /* Drop all connection on the device */
 void hci_conn_hash_flush(struct hci_dev *hdev)
 {
 	struct hci_conn_hash *h = &hdev->conn_hash;
-        struct list_head *p;
+	struct list_head *p;
 
 	BT_DBG("hdev %s", hdev->name);
 
@@ -353,7 +353,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev)
 	}
 }
 
-int hci_get_conn_list(unsigned long arg)
+int hci_get_conn_list(void __user *arg)
 {
 	struct hci_conn_list_req req, *cl;
 	struct hci_conn_info *ci;
@@ -361,7 +361,7 @@ int hci_get_conn_list(unsigned long arg)
 	struct list_head *p;
 	int n = 0, size, err;
 
-	if (copy_from_user(&req, (void *) arg, sizeof(req)))
+	if (copy_from_user(&req, arg, sizeof(req)))
 		return -EFAULT;
 
 	if (!req.conn_num || req.conn_num > (PAGE_SIZE * 2) / sizeof(*ci))
@@ -401,20 +401,20 @@ int hci_get_conn_list(unsigned long arg)
 
 	hci_dev_put(hdev);
 
-	err = copy_to_user((void *) arg, cl, size);
+	err = copy_to_user(arg, cl, size);
 	kfree(cl);
 
 	return err ? -EFAULT : 0;
 }
 
-int hci_get_conn_info(struct hci_dev *hdev, unsigned long arg)
+int hci_get_conn_info(struct hci_dev *hdev, void __user *arg)
 {
 	struct hci_conn_info_req req;
 	struct hci_conn_info ci;
 	struct hci_conn *conn;
-	char *ptr = (void *) arg + sizeof(req);
+	char __user *ptr = arg + sizeof(req);
 
-	if (copy_from_user(&req, (void *) arg, sizeof(req)))
+	if (copy_from_user(&req, arg, sizeof(req)))
 		return -EFAULT;
 
 	hci_dev_lock_bh(hdev);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 35a874bde..69ab2e7b9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -22,11 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * Bluetooth HCI Core.
- *
- * $Id: hci_core.c,v 1.6 2002/04/17 17:37:16 maxk Exp $
- */
+/* Bluetooth HCI core. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -55,7 +51,7 @@
 
 #ifndef CONFIG_BT_HCI_CORE_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
 static void hci_cmd_task(unsigned long arg);
@@ -288,6 +284,7 @@ struct hci_dev *hci_dev_get(int index)
 	read_unlock(&hci_dev_list_lock);
 	return hdev;
 }
+EXPORT_SYMBOL(hci_dev_get);
 
 /* ---- Inquiry support ---- */
 void inquiry_cache_flush(struct hci_dev *hdev)
@@ -369,15 +366,15 @@ static void hci_inq_req(struct hci_dev *hdev, unsigned long opt)
 	hci_send_cmd(hdev, OGF_LINK_CTL, OCF_INQUIRY, sizeof(cp), &cp);
 }
 
-int hci_inquiry(unsigned long arg)
+int hci_inquiry(void __user *arg)
 {
+	__u8 __user *ptr = arg;
 	struct hci_inquiry_req ir;
 	struct hci_dev *hdev;
 	int err = 0, do_inquiry = 0, max_rsp;
 	long timeo;
-	__u8 *buf, *ptr;
+	__u8 *buf;
 
-	ptr = (void *) arg;
 	if (copy_from_user(&ir, ptr, sizeof(ir)))
 		return -EFAULT;
 
@@ -416,7 +413,7 @@ int hci_inquiry(unsigned long arg)
 
 	if (!copy_to_user(ptr, &ir, sizeof(ir))) {
 		ptr += sizeof(ir);
-	        if (copy_to_user(ptr, buf, sizeof(struct inquiry_info) *
+		if (copy_to_user(ptr, buf, sizeof(struct inquiry_info) *
 					ir.num_rsp))
 			err = -EFAULT;
 	} else 
@@ -459,7 +456,7 @@ int hci_dev_open(__u16 dev)
 
 		//__hci_request(hdev, hci_reset_req, 0, HZ);
 		ret = __hci_request(hdev, hci_init_req, 0, HCI_INIT_TIMEOUT);
-       
+
 		clear_bit(HCI_INIT, &hdev->flags);
 	}
 
@@ -514,7 +511,7 @@ static int hci_dev_do_close(struct hci_dev *hdev)
 	inquiry_cache_flush(hdev);
 	hci_conn_hash_flush(hdev);
 	hci_dev_unlock_bh(hdev);
-	
+
 	hci_notify(hdev, HCI_DEV_DOWN);
 
 	if (hdev->flush)
@@ -558,7 +555,7 @@ int hci_dev_close(__u16 dev)
 {
 	struct hci_dev *hdev;
 	int err;
-	
+
 	if (!(hdev = hci_dev_get(dev)))
 		return -ENODEV;
 	err = hci_dev_do_close(hdev);
@@ -619,13 +616,13 @@ int hci_dev_reset_stat(__u16 dev)
 	return ret;
 }
 
-int hci_dev_cmd(unsigned int cmd, unsigned long arg)
+int hci_dev_cmd(unsigned int cmd, void __user *arg)
 {
 	struct hci_dev *hdev;
 	struct hci_dev_req dr;
 	int err = 0;
 
-	if (copy_from_user(&dr, (void *) arg, sizeof(dr)))
+	if (copy_from_user(&dr, arg, sizeof(dr)))
 		return -EFAULT;
 
 	if (!(hdev = hci_dev_get(dr.dev_id)))
@@ -649,19 +646,19 @@ int hci_dev_cmd(unsigned int cmd, unsigned long arg)
 			if (err)
 				break;
 		}
-			
+
 		err = hci_request(hdev, hci_encrypt_req,
 					dr.dev_opt, HCI_INIT_TIMEOUT);
 		break;
-	
+
 	case HCISETSCAN:
 		err = hci_request(hdev, hci_scan_req, dr.dev_opt, HCI_INIT_TIMEOUT);
 		break;
-	
+
 	case HCISETPTYPE:
 		hdev->pkt_type = (__u16) dr.dev_opt;
 		break;
-		
+
 	case HCISETLINKPOL:
 		hdev->link_policy = (__u16) dr.dev_opt;
 		break;
@@ -683,12 +680,12 @@ int hci_dev_cmd(unsigned int cmd, unsigned long arg)
 	default:
 		err = -EINVAL;
 		break;
-	}	
+	}
 	hci_dev_put(hdev);
 	return err;
 }
 
-int hci_get_dev_list(unsigned long arg)
+int hci_get_dev_list(void __user *arg)
 {
 	struct hci_dev_list_req *dl;
 	struct hci_dev_req *dr;
@@ -696,7 +693,7 @@ int hci_get_dev_list(unsigned long arg)
 	int n = 0, size, err;
 	__u16 dev_num;
 
-	if (get_user(dev_num, (__u16 *) arg))
+	if (get_user(dev_num, (__u16 __user *) arg))
 		return -EFAULT;
 
 	if (!dev_num || dev_num > (PAGE_SIZE * 2) / sizeof(*dr))
@@ -723,19 +720,19 @@ int hci_get_dev_list(unsigned long arg)
 	dl->dev_num = n;
 	size = sizeof(*dl) + n * sizeof(*dr);
 
-	err = copy_to_user((void *) arg, dl, size);
+	err = copy_to_user(arg, dl, size);
 	kfree(dl);
 
 	return err ? -EFAULT : 0;
 }
 
-int hci_get_dev_info(unsigned long arg)
+int hci_get_dev_info(void __user *arg)
 {
 	struct hci_dev *hdev;
 	struct hci_dev_info di;
 	int err = 0;
 
-	if (copy_from_user(&di, (void *) arg, sizeof(di)))
+	if (copy_from_user(&di, arg, sizeof(di)))
 		return -EFAULT;
 
 	if (!(hdev = hci_dev_get(di.dev_id)))
@@ -756,7 +753,7 @@ int hci_get_dev_info(unsigned long arg)
 	memcpy(&di.stat, &hdev->stat, sizeof(di.stat));
 	memcpy(&di.features, &hdev->features, sizeof(di.features));
 
-	if (copy_to_user((void *) arg, &di, sizeof(di)))
+	if (copy_to_user(arg, &di, sizeof(di)))
 		err = -EFAULT;
 
 	hci_dev_put(hdev);
@@ -779,6 +776,7 @@ struct hci_dev *hci_alloc_dev(void)
 
 	return hdev;
 }
+EXPORT_SYMBOL(hci_alloc_dev);
 
 /* Free HCI device */
 void hci_free_dev(struct hci_dev *hdev)
@@ -786,6 +784,7 @@ void hci_free_dev(struct hci_dev *hdev)
 	/* will free via class release */
 	class_device_put(&hdev->class_dev);
 }
+EXPORT_SYMBOL(hci_free_dev);
 
 /* Register HCI device */
 int hci_register_dev(struct hci_dev *hdev)
@@ -802,7 +801,7 @@ int hci_register_dev(struct hci_dev *hdev)
 
 	/* Find first available device id */
 	list_for_each(p, &hci_dev_list) {
-	       	if (list_entry(p, struct hci_dev, list)->id != id)
+		if (list_entry(p, struct hci_dev, list)->id != id)
 			break;
 		head = p; id++;
 	}
@@ -813,7 +812,7 @@ int hci_register_dev(struct hci_dev *hdev)
 
 	atomic_set(&hdev->refcnt, 1);
 	spin_lock_init(&hdev->lock);
-			
+
 	hdev->flags = 0;
 	hdev->pkt_type  = (HCI_DM1 | HCI_DH1 | HCI_HV1);
 	hdev->link_mode = (HCI_LM_ACCEPT);
@@ -836,7 +835,7 @@ int hci_register_dev(struct hci_dev *hdev)
 	memset(&hdev->stat, 0, sizeof(struct hci_dev_stats));
 
 	atomic_set(&hdev->promisc, 0);
-		
+
 	write_unlock_bh(&hci_dev_list_lock);
 
 	hci_register_sysfs(hdev);
@@ -845,6 +844,7 @@ int hci_register_dev(struct hci_dev *hdev)
 
 	return id;
 }
+EXPORT_SYMBOL(hci_register_dev);
 
 /* Unregister HCI device */
 int hci_unregister_dev(struct hci_dev *hdev)
@@ -864,6 +864,7 @@ int hci_unregister_dev(struct hci_dev *hdev)
 	__hci_dev_put(hdev);
 	return 0;
 }
+EXPORT_SYMBOL(hci_unregister_dev);
 
 /* Suspend HCI device */
 int hci_suspend_dev(struct hci_dev *hdev)
@@ -871,13 +872,15 @@ int hci_suspend_dev(struct hci_dev *hdev)
 	hci_notify(hdev, HCI_DEV_SUSPEND);
 	return 0;
 }
+EXPORT_SYMBOL(hci_suspend_dev);
 
 /* Resume HCI device */
 int hci_resume_dev(struct hci_dev *hdev)
 {
 	hci_notify(hdev, HCI_DEV_RESUME);
 	return 0;
-}       
+}
+EXPORT_SYMBOL(hci_resume_dev);
 
 /* ---- Interface to upper protocols ---- */
 
@@ -903,6 +906,7 @@ int hci_register_proto(struct hci_proto *hp)
 
 	return err;
 }
+EXPORT_SYMBOL(hci_register_proto);
 
 int hci_unregister_proto(struct hci_proto *hp)
 {
@@ -924,6 +928,7 @@ int hci_unregister_proto(struct hci_proto *hp)
 
 	return err;
 }
+EXPORT_SYMBOL(hci_unregister_proto);
 
 static int hci_send_frame(struct sk_buff *skb)
 {
@@ -938,7 +943,7 @@ static int hci_send_frame(struct sk_buff *skb)
 
 	if (atomic_read(&hdev->promisc)) {
 		/* Time stamp */
-	        do_gettimeofday(&skb->stamp);
+		do_gettimeofday(&skb->stamp);
 
 		hci_send_to_sock(hdev, skb);
 	}
@@ -980,6 +985,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p
 
 	return 0;
 }
+EXPORT_SYMBOL(hci_send_cmd);
 
 /* Get data from the previously sent command */
 void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf)
@@ -1026,7 +1032,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
 	if (!(list = skb_shinfo(skb)->frag_list)) {
 		/* Non fragmented */
 		BT_DBG("%s nonfrag skb %p len %d", hdev->name, skb, skb->len);
-		
+
 		skb_queue_tail(&conn->data_q, skb);
 	} else {
 		/* Fragmented */
@@ -1044,7 +1050,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
 			skb->dev = (void *) hdev;
 			skb->pkt_type = HCI_ACLDATA_PKT;
 			hci_add_acl_hdr(skb, conn->handle, flags | ACL_CONT);
-		
+
 			BT_DBG("%s frag %p len %d", hdev->name, skb, skb->len);
 
 			__skb_queue_tail(&conn->data_q, skb);
@@ -1052,10 +1058,11 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
 
 		spin_unlock_bh(&conn->data_q.lock);
 	}
-		
+
 	hci_sched_tx(hdev);
 	return 0;
 }
+EXPORT_SYMBOL(hci_send_acl);
 
 /* Send SCO data */
 int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
@@ -1082,6 +1089,7 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
 	hci_sched_tx(hdev);
 	return 0;
 }
+EXPORT_SYMBOL(hci_send_sco);
 
 /* ---- HCI TX task (outgoing data) ---- */
 
@@ -1091,7 +1099,7 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
 	struct hci_conn_hash *h = &hdev->conn_hash;
 	struct hci_conn  *conn = NULL;
 	int num = 0, min = ~0;
-        struct list_head *p;
+	struct list_head *p;
 
 	/* We don't have to lock device here. Connections are always 
 	 * added and removed with TX task disabled. */
@@ -1124,7 +1132,7 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
 static inline void hci_acl_tx_to(struct hci_dev *hdev)
 {
 	struct hci_conn_hash *h = &hdev->conn_hash;
-        struct list_head *p;
+	struct list_head *p;
 	struct hci_conn  *c;
 
 	BT_ERR("%s ACL tx timeout", hdev->name);
@@ -1265,7 +1273,7 @@ static inline void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
 	hci_dev_lock(hdev);
 	conn = hci_conn_hash_lookup_handle(hdev, handle);
 	hci_dev_unlock(hdev);
-	
+
 	if (conn) {
 		register struct hci_proto *hp;
 
@@ -1348,7 +1356,7 @@ static void hci_cmd_task(unsigned long arg)
 		BT_ERR("%s command tx timeout", hdev->name);
 		atomic_set(&hdev->cmd_cnt, 1);
 	}
-	
+
 	/* Send queued commands */
 	if (atomic_read(&hdev->cmd_cnt) && (skb = skb_dequeue(&hdev->cmd_q))) {
 		if (hdev->sent_cmd)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c515f2871..ab63024de 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -22,11 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * HCI Events.
- *
- * $Id: hci_event.c,v 1.3 2002/04/17 17:37:16 maxk Exp $
- */
+/* Bluetooth HCI event handling. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -54,7 +50,7 @@
 
 #ifndef CONFIG_BT_HCI_CORE_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
 /* Handle HCI Event packets */
@@ -98,9 +94,9 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
 
 		if (rd->status)
 			break;
-		
+
 		hci_dev_lock(hdev);
-	
+
 		conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rd->handle));
 		if (conn) {
 			if (rd->role)
@@ -355,7 +351,7 @@ static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
 		return;
 
 	hci_dev_lock(hdev);
-	
+
 	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
 
 	BT_DBG("%s status 0x%x bdaddr %s conn %p", hdev->name,
@@ -572,7 +568,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 	BT_DBG("%s", hdev->name);
 
 	hci_dev_lock(hdev);
-	
+
 	conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
 	if (!conn) {
 		hci_dev_unlock(hdev);
@@ -585,7 +581,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 
 		if (test_bit(HCI_AUTH, &hdev->flags))
 			conn->link_mode |= HCI_LM_AUTH;
-		
+
 		if (test_bit(HCI_ENCRYPT, &hdev->flags))
 			conn->link_mode |= HCI_LM_ENCRYPT;
 
@@ -643,7 +639,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
 		return;
 
 	hci_dev_lock(hdev);
-	
+
 	conn = hci_conn_hash_lookup_handle(hdev, handle);
 	if (conn) {
 		conn->state = BT_CLOSED;
@@ -709,7 +705,7 @@ static inline void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb
 		return;
 
 	hci_dev_lock(hdev);
-	
+
 	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
 	if (conn) {
 		if (ev->role)
@@ -731,7 +727,7 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 	BT_DBG("%s status %d", hdev->name, ev->status);
 
 	hci_dev_lock(hdev);
-	
+
 	conn = hci_conn_hash_lookup_handle(hdev, handle);
 	if (conn) {
 		if (!ev->status)
@@ -739,7 +735,7 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 		clear_bit(HCI_CONN_AUTH_PEND, &conn->pend);
 
 		hci_proto_auth_cfm(conn, ev->status);
-		
+
 		if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
 			if (!ev->status) {
 				struct hci_cp_set_conn_encrypt cp;
@@ -768,11 +764,11 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
 	BT_DBG("%s status %d", hdev->name, ev->status);
 
 	hci_dev_lock(hdev);
-	
+
 	conn = hci_conn_hash_lookup_handle(hdev, handle);
 	if (conn) {
 		if (!ev->status) {
-		       	if (ev->encrypt)
+			if (ev->encrypt)
 				conn->link_mode |= HCI_LM_ENCRYPT;
 			else
 				conn->link_mode &= ~HCI_LM_ENCRYPT;
@@ -840,7 +836,7 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
 	case HCI_EV_CMD_STATUS:
 		cs = (struct hci_ev_cmd_status *) skb->data;
 		skb_pull(skb, sizeof(cs));
-				
+
 		opcode = __le16_to_cpu(cs->opcode);
 		ogf = hci_opcode_ogf(opcode);
 		ocf = hci_opcode_ocf(opcode);
@@ -928,15 +924,16 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
 		return;
 
 	hdr = (void *) skb_put(skb, HCI_EVENT_HDR_SIZE);
-       	hdr->evt  = HCI_EV_STACK_INTERNAL;
+	hdr->evt  = HCI_EV_STACK_INTERNAL;
 	hdr->plen = sizeof(*ev) + dlen;
 
 	ev  = (void *) skb_put(skb, sizeof(*ev) + dlen);
 	ev->type = type;
 	memcpy(ev->data, data, dlen);
-	
+
 	skb->pkt_type = HCI_EVENT_PKT;
 	skb->dev = (void *) hdev;
 	hci_send_to_sock(hdev, skb);
 	kfree_skb(skb);
 }
+EXPORT_SYMBOL(hci_si_event);
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index ceee70746..348a82fb4 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -22,11 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * Bluetooth HCI socket layer.
- *
- * $Id: hci_sock.c,v 1.4 2002/04/18 22:26:14 maxk Exp $
- */
+/* Bluetooth HCI sockets. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -56,7 +52,7 @@
 
 #ifndef CONFIG_BT_HCI_SOCK_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
 /* ----- HCI socket interface ----- */
@@ -139,7 +135,6 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
 
 		if (sock_queue_rcv_skb(sk, nskb))
 			kfree_skb(nskb);
-		
 	}
 	read_unlock(&hci_sk_list.lock);
 }
@@ -191,7 +186,7 @@ static inline int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, unsign
 		return 0;
 
 	case HCIGETCONNINFO:
-		return hci_get_conn_info(hdev, arg);
+		return hci_get_conn_info(hdev, (void __user *)arg);
 
 	default:
 		if (hdev->ioctl)
@@ -203,19 +198,20 @@ static inline int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, unsign
 static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
+	void __user *argp = (void __user *)arg;
 	int err;
 
 	BT_DBG("cmd %x arg %lx", cmd, arg);
 
 	switch (cmd) {
 	case HCIGETDEVLIST:
-		return hci_get_dev_list(arg);
+		return hci_get_dev_list(argp);
 
 	case HCIGETDEVINFO:
-		return hci_get_dev_info(arg);
+		return hci_get_dev_info(argp);
 
 	case HCIGETCONNLIST:
-		return hci_get_conn_list(arg);
+		return hci_get_conn_list(argp);
 
 	case HCIDEVUP:
 		if (!capable(CAP_NET_ADMIN))
@@ -247,10 +243,10 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long a
 	case HCISETSCOMTU:
 		if (!capable(CAP_NET_ADMIN))
 			return -EACCES;
-		return hci_dev_cmd(cmd, arg);
+		return hci_dev_cmd(cmd, argp);
 
 	case HCIINQUIRY:
-		return hci_inquiry(arg);
+		return hci_inquiry(argp);
 
 	default:
 		lock_sock(sk);
@@ -318,14 +314,14 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
 	__u32 mask = hci_pi(sk)->cmsg_mask;
 
 	if (mask & HCI_CMSG_DIR)
-        	put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(int), &bt_cb(skb)->incoming);
+		put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(int), &bt_cb(skb)->incoming);
 
 	if (mask & HCI_CMSG_TSTAMP)
-        	put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp);
+		put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp);
 }
  
 static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, 
-			    struct msghdr *msg, size_t len, int flags)
+				struct msghdr *msg, size_t len, int flags)
 {
 	int noblock = flags & MSG_DONTWAIT;
 	struct sock *sk = sock->sk;
@@ -355,7 +351,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
 
 	hci_sock_cmsg(sk, msg, skb);
-	
+
 	skb_free_datagram(sk, skb);
 
 	return err ? : copied;
@@ -406,7 +402,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 
 		if (((ogf > HCI_SFLT_MAX_OGF) ||
 				!hci_test_bit(ocf & HCI_FLT_OCF_BITS, &hci_sec_filter.ocf_mask[ogf])) &&
-		    			!capable(CAP_NET_RAW)) {
+					!capable(CAP_NET_RAW)) {
 			err = -EPERM;
 			goto drop;
 		}
@@ -439,7 +435,7 @@ drop:
 	goto done;
 }
 
-int hci_sock_setsockopt(struct socket *sock, int level, int optname, char *optval, int len)
+int hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int len)
 {
 	struct hci_ufilter uf = { .opcode = 0 };
 	struct sock *sk = sock->sk;
@@ -451,7 +447,7 @@ int hci_sock_setsockopt(struct socket *sock, int level, int optname, char *optva
 
 	switch (optname) {
 	case HCI_DATA_DIR:
-		if (get_user(opt, (int *)optval)) {
+		if (get_user(opt, (int __user *)optval)) {
 			err = -EFAULT;
 			break;
 		}
@@ -463,7 +459,7 @@ int hci_sock_setsockopt(struct socket *sock, int level, int optname, char *optva
 		break;
 
 	case HCI_TIME_STAMP:
-		if (get_user(opt, (int *)optval)) {
+		if (get_user(opt, (int __user *)optval)) {
 			err = -EFAULT;
 			break;
 		}
@@ -487,9 +483,9 @@ int hci_sock_setsockopt(struct socket *sock, int level, int optname, char *optva
 			uf.event_mask[1] &= *((u32 *) hci_sec_filter.event_mask + 1);
 		}
 
-		{	
+		{
 			struct hci_filter *f = &hci_pi(sk)->filter;
-		
+
 			f->type_mask = uf.type_mask;
 			f->opcode    = uf.opcode;
 			*((u32 *) f->event_mask + 0) = uf.event_mask[0];
@@ -501,12 +497,12 @@ int hci_sock_setsockopt(struct socket *sock, int level, int optname, char *optva
 		err = -ENOPROTOOPT;
 		break;
 	}
-	
+
 	release_sock(sk);
 	return err;
 }
 
-int hci_sock_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
+int hci_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
 {
 	struct hci_ufilter uf;
 	struct sock *sk = sock->sk;
@@ -539,7 +535,7 @@ int hci_sock_getsockopt(struct socket *sock, int level, int optname, char *optva
 	case HCI_FILTER:
 		{
 			struct hci_filter *f = &hci_pi(sk)->filter;
-		
+
 			uf.type_mask = f->type_mask;
 			uf.opcode    = f->opcode;
 			uf.event_mask[0] = *((u32 *) f->event_mask + 0);
@@ -560,23 +556,23 @@ int hci_sock_getsockopt(struct socket *sock, int level, int optname, char *optva
 }
 
 struct proto_ops hci_sock_ops = {
-	.family =	PF_BLUETOOTH,
-	.owner =	THIS_MODULE,
-	.release =	hci_sock_release,
-	.bind =		hci_sock_bind,
-	.getname =	hci_sock_getname,
-	.sendmsg =	hci_sock_sendmsg,
-	.recvmsg =	hci_sock_recvmsg,
-	.ioctl =	hci_sock_ioctl,
-	.poll =		datagram_poll,
-	.listen =	sock_no_listen,
-	.shutdown =	sock_no_shutdown,
-	.setsockopt =	hci_sock_setsockopt,
-	.getsockopt =	hci_sock_getsockopt,
-	.connect =	sock_no_connect,
-	.socketpair =	sock_no_socketpair,
-	.accept =	sock_no_accept,
-	.mmap =		sock_no_mmap
+	.family		= PF_BLUETOOTH,
+	.owner		= THIS_MODULE,
+	.release	= hci_sock_release,
+	.bind		= hci_sock_bind,
+	.getname	= hci_sock_getname,
+	.sendmsg	= hci_sock_sendmsg,
+	.recvmsg	= hci_sock_recvmsg,
+	.ioctl		= hci_sock_ioctl,
+	.poll		= datagram_poll,
+	.listen		= sock_no_listen,
+	.shutdown	= sock_no_shutdown,
+	.setsockopt	= hci_sock_setsockopt,
+	.getsockopt	= hci_sock_getsockopt,
+	.connect	= sock_no_connect,
+	.socketpair	= sock_no_socketpair,
+	.accept		= sock_no_accept,
+	.mmap		= sock_no_mmap
 };
 
 static int hci_sock_create(struct socket *sock, int protocol)
@@ -597,7 +593,7 @@ static int hci_sock_create(struct socket *sock, int protocol)
 	sk_set_owner(sk, THIS_MODULE);
 
 	sock->state = SS_UNCONNECTED;
-	sk->sk_state   = BT_OPEN;
+	sk->sk_state = BT_OPEN;
 
 	bt_sock_link(&hci_sk_list, sk);
 	return 0;
@@ -607,14 +603,14 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
 {
 	struct hci_dev *hdev = (struct hci_dev *) ptr;
 	struct hci_ev_si_device ev;
-	
+
 	BT_DBG("hdev %s event %ld", hdev->name, event);
 
 	/* Send event to sockets */
 	ev.event  = event;
 	ev.dev_id = hdev->id;
 	hci_si_event(NULL, HCI_EV_SI_DEVICE, sizeof(ev), &ev);
-	
+
 	if (event == HCI_DEV_UNREG) {
 		struct sock *sk;
 		struct hlist_node *node;
@@ -640,9 +636,9 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
 }
 
 struct net_proto_family hci_sock_family_ops = {
-	.family = PF_BLUETOOTH,
+	.family	= PF_BLUETOOTH,
 	.owner	= THIS_MODULE,
-	.create = hci_sock_create,
+	.create	= hci_sock_create,
 };
 
 struct notifier_block hci_sock_nblock = {
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index df5f11d42..1b8039fb4 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -1,3 +1,5 @@
+/* Bluetooth HCI driver model support. */
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -7,7 +9,7 @@
 
 #ifndef CONFIG_BT_HCI_CORE_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
 static ssize_t show_name(struct class_device *cdev, char *buf)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 68f325798..298a25fb3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -22,12 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * Bluetooth L2CAP core and sockets.
- *
- * $Id: l2cap.c,v 1.15 2002/09/09 01:14:52 maxk Exp $
- */
-#define VERSION "2.1"
+/* Bluetooth L2CAP core and sockets. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -59,9 +54,11 @@
 
 #ifndef CONFIG_BT_L2CAP_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
+#define VERSION "2.2"
+
 static struct proto_ops l2cap_sock_ops;
 
 struct bt_sock_list l2cap_sk_list = {
@@ -98,17 +95,13 @@ static void l2cap_sock_timeout(unsigned long arg)
 static void l2cap_sock_set_timer(struct sock *sk, long timeout)
 {
 	BT_DBG("sk %p state %d timeout %ld", sk, sk->sk_state, timeout);
-
-	if (!mod_timer(&sk->sk_timer, jiffies + timeout))
-		sock_hold(sk);
+	sk_reset_timer(sk, &sk->sk_timer, jiffies + timeout);
 }
 
 static void l2cap_sock_clear_timer(struct sock *sk)
 {
 	BT_DBG("sock %p state %d", sk, sk->sk_state);
-
-	if (timer_pending(&sk->sk_timer) && del_timer(&sk->sk_timer))
-		__sock_put(sk);
+	sk_stop_timer(sk, &sk->sk_timer);
 }
 
 static void l2cap_sock_init_timer(struct sock *sk)
@@ -135,11 +128,11 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
 
 	hcon->l2cap_data = conn;
 	conn->hcon = hcon;
-	
+
 	conn->mtu = hcon->hdev->acl_mtu;
 	conn->src = &hcon->hdev->bdaddr;
 	conn->dst = &hcon->dst;
-	
+
 	spin_lock_init(&conn->lock);
 	conn->chan_list.lock = RW_LOCK_UNLOCKED;
 
@@ -374,10 +367,10 @@ static int l2cap_sock_create(struct socket *sock, int protocol)
 
 	if (sock->type != SOCK_SEQPACKET && sock->type != SOCK_DGRAM && sock->type != SOCK_RAW)
 		return -ESOCKTNOSUPPORT;
-	
+
 	if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW))
 		return -EPERM;
-	
+
 	sock->ops = &l2cap_sock_ops;
 
 	sk = l2cap_sock_alloc(sock, protocol, GFP_KERNEL);
@@ -407,6 +400,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
 	}
 
 	write_lock_bh(&l2cap_sk_list.lock);
+
 	if (la->l2_psm && __l2cap_get_sock_by_addr(la->l2_psm, &la->l2_bdaddr)) {
 		err = -EADDRINUSE;
 	} else {
@@ -416,6 +410,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
 		l2cap_pi(sk)->sport = la->l2_psm;
 		sk->sk_state = BT_BOUND;
 	}
+
 	write_unlock_bh(&l2cap_sk_list.lock);
 
 done:
@@ -428,8 +423,8 @@ static int l2cap_do_connect(struct sock *sk)
 	bdaddr_t *src = &bt_sk(sk)->src;
 	bdaddr_t *dst = &bt_sk(sk)->dst;
 	struct l2cap_conn *conn;
-	struct hci_conn   *hcon;
-	struct hci_dev    *hdev;
+	struct hci_conn *hcon;
+	struct hci_dev *hdev;
 	int err = 0;
 
 	BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst), l2cap_pi(sk)->psm);
@@ -550,8 +545,25 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
 	}
 
 	if (!l2cap_pi(sk)->psm) {
+		bdaddr_t *src = &bt_sk(sk)->src;
+		u16 psm;
+
 		err = -EINVAL;
-		goto done;
+
+		write_lock_bh(&l2cap_sk_list.lock);
+
+		for (psm = 0x1001; psm < 0x1100; psm += 2)
+			if (!__l2cap_get_sock_by_addr(psm, src)) {
+				l2cap_pi(sk)->psm   = htobs(psm);
+				l2cap_pi(sk)->sport = htobs(psm);
+				err = 0;
+				break;
+			}
+
+		write_unlock_bh(&l2cap_sk_list.lock);
+
+		if (err < 0)
+			goto done;
 	}
 
 	sk->sk_max_ack_backlog = backlog;
@@ -735,7 +747,7 @@ static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 	return err;
 }
 
-static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
+static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	struct l2cap_options opts;
@@ -758,7 +770,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch
 		break;
 
 	case L2CAP_LM:
-		if (get_user(opt, (u32 *)optval)) {
+		if (get_user(opt, (u32 __user *)optval)) {
 			err = -EFAULT;
 			break;
 		}
@@ -775,7 +787,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch
 	return err;
 }
 
-static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
+static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	struct l2cap_options opts;
@@ -800,7 +812,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch
 		break;
 
 	case L2CAP_LM:
-		if (put_user(l2cap_pi(sk)->link_mode, (u32 *)optval))
+		if (put_user(l2cap_pi(sk)->link_mode, (u32 __user *)optval))
 			err = -EFAULT;
 		break;
 
@@ -834,7 +846,8 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
 
 	BT_DBG("sock %p, sk %p", sock, sk);
 
-	if (!sk) return 0;
+	if (!sk)
+		return 0;
 
 	lock_sock(sk);
 	if (!sk->sk_shutdown) {
@@ -856,7 +869,8 @@ static int l2cap_sock_release(struct socket *sock)
 
 	BT_DBG("sock %p, sk %p", sock, sk);
 
-	if (!sk) return 0;
+	if (!sk)
+		return 0;
 
 	err = l2cap_sock_shutdown(sock, 2);
 
@@ -988,7 +1002,7 @@ static void l2cap_chan_del(struct sock *sk, int err)
 
 	sk->sk_state  = BT_CLOSED;
 	sk->sk_zapped = 1;
-	
+
 	if (err)
 		sk->sk_err = err;
 
@@ -1111,7 +1125,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
 
 	len = L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE + dlen;
 	count = min_t(unsigned int, conn->mtu, len);
-	
+
 	skb = bt_skb_alloc(count, GFP_ATOMIC);
 	if (!skb)
 		return NULL;
@@ -1132,7 +1146,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
 	}
 
 	len -= skb->len;
-	
+
 	/* Continuation fragments (no L2CAP header) */
 	frag = &skb_shinfo(skb)->frag_list;
 	while (len) {
@@ -1141,12 +1155,12 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
 		*frag = bt_skb_alloc(count, GFP_ATOMIC);
 		if (!*frag)
 			goto fail;
-		
+
 		memcpy(skb_put(*frag, count), data, count);
 
 		len  -= count;
 		data += count;
-		
+
 		frag = &(*frag)->next;
 	}
 
@@ -1238,7 +1252,7 @@ static inline void l2cap_parse_conf_req(struct sock *sk, void *data, int len)
 
 		case L2CAP_CONF_QOS:
 			break;
-		
+
 		default:
 			if (hint)
 				break;
@@ -1306,8 +1320,7 @@ static inline int l2cap_conf_output(struct sock *sk, void **ptr)
 	int result = 0;
 
 	/* Configure output options and let the other side know
-	 * which ones we don't like.
-	 */
+	 * which ones we don't like. */
 	if (pi->conf_mtu < pi->omtu) {
 		l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
 		result = L2CAP_CONF_UNACCEPT;
@@ -1533,13 +1546,11 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
 	case L2CAP_CONF_UNACCEPT:
 		if (++l2cap_pi(sk)->conf_retry < L2CAP_CONF_MAX_RETRIES) {
 			char req[128];
-			/* 
-			   It does not make sense to adjust L2CAP parameters 
-			   that are currently defined in the spec. We simply 
-			   resend config request that we sent earlier. It is
-			   stupid :) but it helps qualification testing
-			   which expects at least some response from us.
-			*/
+			/* It does not make sense to adjust L2CAP parameters
+			 * that are currently defined in the spec. We simply
+			 * resend config request that we sent earlier. It is
+			 * stupid, but it helps qualification testing which
+			 * expects at least some response from us. */
 			l2cap_send_req(conn, L2CAP_CONF_REQ,
 				l2cap_build_conf_req(sk, req), req);
 			goto done;
@@ -1594,7 +1605,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd
 	l2cap_send_rsp(conn, cmd->ident, L2CAP_DISCONN_RSP, sizeof(rsp), &rsp);
 
 	sk->sk_shutdown = SHUTDOWN_MASK;
-	
+
 	l2cap_chan_del(sk, ECONNRESET);
 	bh_unlock_sock(sk);
 
@@ -1723,11 +1734,11 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 	if (l2cap_pi(sk)->imtu < skb->len)
 		goto drop;
 
-	/* If socket recv buffers overflows we drop data here 
-	 * which is *bad* because L2CAP has to be reliable. 
-	 * But we don't have any other choice. L2CAP doesn't 
-	 * provide flow control mechanism */ 
-	
+	/* If socket recv buffers overflows we drop data here
+	 * which is *bad* because L2CAP has to be reliable.
+	 * But we don't have any other choice. L2CAP doesn't
+	 * provide flow control mechanism */
+
 	if (!sock_queue_rcv_skb(sk, skb))
 		goto done;
 
@@ -1787,7 +1798,7 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
 		skb_pull(skb, 2);
 		l2cap_conless_channel(conn, psm, skb);
 		break;
-		
+
 	default:
 		l2cap_data_channel(conn, cid, skb);
 		break;
@@ -1839,7 +1850,7 @@ static int l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
 			l2cap_conn_ready(conn);
 	} else 
 		l2cap_conn_del(hcon, bt_err(status));
-	
+
 	return 0;
 }
 
@@ -1861,7 +1872,7 @@ static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status)
 	struct l2cap_conn_rsp rsp;
 	struct sock *sk;
 	int result;
-	
+
 	if (!(conn = hcon->l2cap_data))
 		return 0;
 	l = &conn->chan_list;
@@ -1908,7 +1919,7 @@ static int l2cap_encrypt_cfm(struct hci_conn *hcon, u8 status)
 	struct l2cap_conn_rsp rsp;
 	struct sock *sk;
 	int result;
-	
+
 	if (!(conn = hcon->l2cap_data))
 		return 0;
 	l = &conn->chan_list;
@@ -2069,10 +2080,10 @@ static int  l2cap_seq_show(struct seq_file *seq, void *e)
 }
 
 static struct seq_operations l2cap_seq_ops = {
-	.start  = l2cap_seq_start,
-	.next   = l2cap_seq_next,
-	.stop   = l2cap_seq_stop,
-	.show   = l2cap_seq_show 
+	.start	= l2cap_seq_start,
+	.next	= l2cap_seq_next,
+	.stop	= l2cap_seq_stop,
+	.show	= l2cap_seq_show 
 };
 
 static int l2cap_seq_open(struct inode *inode, struct file *file)
@@ -2081,76 +2092,76 @@ static int l2cap_seq_open(struct inode *inode, struct file *file)
 }
 
 static struct file_operations l2cap_seq_fops = {
-	.owner	 = THIS_MODULE,
-	.open    = l2cap_seq_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release,
+	.owner		= THIS_MODULE,
+	.open		= l2cap_seq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
 };
 
-static int  __init l2cap_proc_init(void)
+static int __init l2cap_proc_init(void)
 {
-        struct proc_dir_entry *p = create_proc_entry("l2cap", S_IRUGO, proc_bt);
-        if (!p)
-                return -ENOMEM;
+	struct proc_dir_entry *p = create_proc_entry("l2cap", S_IRUGO, proc_bt);
+	if (!p)
+		return -ENOMEM;
 	p->owner     = THIS_MODULE;
-        p->proc_fops = &l2cap_seq_fops;
-        return 0;
+	p->proc_fops = &l2cap_seq_fops;
+	return 0;
 }
 
 static void __exit l2cap_proc_cleanup(void)
 {
-        remove_proc_entry("l2cap", proc_bt);
+	remove_proc_entry("l2cap", proc_bt);
 }
 
 #else /* CONFIG_PROC_FS */
 
-static int  __init l2cap_proc_init(void)
+static int __init l2cap_proc_init(void)
 {
-        return 0;
+	return 0;
 }
 
 static void __exit l2cap_proc_cleanup(void)
 {
-        return;
+	return;
 }
 #endif /* CONFIG_PROC_FS */
 
 static struct proto_ops l2cap_sock_ops = {
-	.family  =      PF_BLUETOOTH,
-	.owner   =	THIS_MODULE,
-	.release =      l2cap_sock_release,
-	.bind    =      l2cap_sock_bind,
-	.connect =      l2cap_sock_connect,
-	.listen  =      l2cap_sock_listen,
-	.accept  =      l2cap_sock_accept,
-	.getname =      l2cap_sock_getname,
-	.sendmsg =      l2cap_sock_sendmsg,
-	.recvmsg =      bt_sock_recvmsg,
-	.poll    =      bt_sock_poll,
-	.mmap    =      sock_no_mmap,
-	.socketpair =   sock_no_socketpair,
-	.ioctl      =   sock_no_ioctl,
-	.shutdown   =   l2cap_sock_shutdown,
-	.setsockopt =   l2cap_sock_setsockopt,
-	.getsockopt =   l2cap_sock_getsockopt
+	.family		= PF_BLUETOOTH,
+	.owner		= THIS_MODULE,
+	.release	= l2cap_sock_release,
+	.bind		= l2cap_sock_bind,
+	.connect	= l2cap_sock_connect,
+	.listen		= l2cap_sock_listen,
+	.accept		= l2cap_sock_accept,
+	.getname	= l2cap_sock_getname,
+	.sendmsg	= l2cap_sock_sendmsg,
+	.recvmsg	= bt_sock_recvmsg,
+	.poll		= bt_sock_poll,
+	.mmap		= sock_no_mmap,
+	.socketpair	= sock_no_socketpair,
+	.ioctl		= sock_no_ioctl,
+	.shutdown	= l2cap_sock_shutdown,
+	.setsockopt	= l2cap_sock_setsockopt,
+	.getsockopt	= l2cap_sock_getsockopt
 };
 
 static struct net_proto_family l2cap_sock_family_ops = {
-	.family =       PF_BLUETOOTH,
-	.create	=       l2cap_sock_create,
-	.owner	=	THIS_MODULE,
+	.family	= PF_BLUETOOTH,
+	.owner	= THIS_MODULE,
+	.create	= l2cap_sock_create,
 };
 
 static struct hci_proto l2cap_hci_proto = {
-	.name =         "L2CAP",
-	.id   =         HCI_PROTO_L2CAP,
-	.connect_ind =  l2cap_connect_ind,
-	.connect_cfm =  l2cap_connect_cfm,
-	.disconn_ind =  l2cap_disconn_ind,
-	.auth_cfm    =  l2cap_auth_cfm,
-	.encrypt_cfm =  l2cap_encrypt_cfm,
-	.recv_acldata =	l2cap_recv_acldata
+	.name		= "L2CAP",
+	.id		= HCI_PROTO_L2CAP,
+	.connect_ind	= l2cap_connect_ind,
+	.connect_cfm	= l2cap_connect_cfm,
+	.disconn_ind	= l2cap_disconn_ind,
+	.auth_cfm	= l2cap_auth_cfm,
+	.encrypt_cfm	= l2cap_encrypt_cfm,
+	.recv_acldata	= l2cap_recv_acldata
 };
 
 static int __init l2cap_init(void)
@@ -2168,7 +2179,7 @@ static int __init l2cap_init(void)
 	}
 
 	l2cap_proc_init();
-	
+
 	BT_INFO("L2CAP ver %s", VERSION);
 	BT_INFO("L2CAP socket layer initialized");
 
@@ -2189,9 +2200,9 @@ static void __exit l2cap_exit(void)
 
 void l2cap_load(void)
 {
-	/* Dummy function to trigger automatic L2CAP module loading by 
-	   other modules that use L2CAP sockets but don not use any other
-	   symbols from it. */
+	/* Dummy function to trigger automatic L2CAP module loading by
+	 * other modules that use L2CAP sockets but don not use any othe
+	 * symbols from it. */
 	return;
 }
 EXPORT_SYMBOL(l2cap_load);
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index 44c022292..ca07e4bb0 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -22,11 +22,10 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * Bluetooth kernel library.
- *
- * $Id: lib.c,v 1.1 2002/03/08 21:06:59 maxk Exp $
- */
+/* Bluetooth kernel library. */
+
+#include <linux/config.h>
+#include <linux/module.h>
 
 #include <linux/kernel.h>
 #include <linux/stddef.h>
@@ -58,6 +57,7 @@ void bt_dump(char *pref, __u8 *buf, int count)
 	if (line[0])
 		printk(KERN_INFO "%s:%s\n", pref, line);
 }
+EXPORT_SYMBOL(bt_dump);
 
 void baswap(bdaddr_t *dst, bdaddr_t *src)
 {
@@ -68,6 +68,7 @@ void baswap(bdaddr_t *dst, bdaddr_t *src)
 	for (i = 0; i < 6; i++)
 		d[i] = s[5 - i];
 }
+EXPORT_SYMBOL(baswap);
 
 char *batostr(bdaddr_t *ba)
 {
@@ -76,11 +77,12 @@ char *batostr(bdaddr_t *ba)
 
 	i ^= 1;
 	sprintf(str[i], "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
-	        ba->b[0], ba->b[1], ba->b[2],
+		ba->b[0], ba->b[1], ba->b[2],
 		ba->b[3], ba->b[4], ba->b[5]);
 
 	return str[i];
 }
+EXPORT_SYMBOL(batostr);
 
 /* Bluetooth error codes to Unix errno mapping */
 int bt_err(__u16 code)
@@ -173,3 +175,4 @@ int bt_err(__u16 code)
 		return ENOSYS;
 	}
 }
+EXPORT_SYMBOL(bt_err);
diff --git a/net/bluetooth/rfcomm/Kconfig b/net/bluetooth/rfcomm/Kconfig
index f79116892..405a0e61e 100644
--- a/net/bluetooth/rfcomm/Kconfig
+++ b/net/bluetooth/rfcomm/Kconfig
@@ -2,7 +2,7 @@ config BT_RFCOMM
 	tristate "RFCOMM protocol support"
 	depends on BT && BT_L2CAP
 	help
-	  RFCOMM provides connection oriented stream transport. RFCOMM
+	  RFCOMM provides connection oriented stream transport.  RFCOMM
 	  support is required for Dialup Networking, OBEX and other Bluetooth
 	  applications.
 
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index d9b4ce095..a2912da9c 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -50,7 +50,7 @@
 #include <net/bluetooth/l2cap.h>
 #include <net/bluetooth/rfcomm.h>
 
-#define VERSION "1.2"
+#define VERSION "1.3"
 
 #ifndef CONFIG_BT_RFCOMM_DEBUG
 #undef  BT_DBG
@@ -158,8 +158,7 @@ static int rfcomm_l2sock_create(struct socket **sock)
 
 	BT_DBG("");
 
-	err = sock_create_kern(PF_BLUETOOTH, SOCK_SEQPACKET,
-			       BTPROTO_L2CAP, sock);
+	err = sock_create_kern(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP, sock);
 	if (!err) {
 		struct sock *sk = (*sock)->sk;
 		sk->sk_data_ready   = rfcomm_l2data_ready;
@@ -471,32 +470,33 @@ struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
 	if (!s)
 		return NULL;
 	memset(s, 0, sizeof(*s));
-	
+
 	BT_DBG("session %p sock %p", s, sock);
 
 	INIT_LIST_HEAD(&s->dlcs);
 	s->state = state;
 	s->sock  = sock;
 
-	s->mtu   = RFCOMM_DEFAULT_MTU;
-	s->cfc   = RFCOMM_CFC_UNKNOWN;
-	
-	list_add(&s->list, &session_list);
+	s->mtu = RFCOMM_DEFAULT_MTU;
+	s->cfc = RFCOMM_CFC_UNKNOWN;
 
-	/* Do not increment module usage count for listeting sessions.
-	 * Otherwise we won't be able to unload the module.
-	 * Non listening session are added either by a socket or a TTYs
-	 * which means that we already hold refcount to this module.
-	 */
+	/* Do not increment module usage count for listening sessions.
+	 * Otherwise we won't be able to unload the module. */
 	if (state != BT_LISTEN)
-		__module_get(THIS_MODULE);
+		if (!try_module_get(THIS_MODULE)) {
+			kfree(s);
+			return NULL;
+		}
+
+	list_add(&s->list, &session_list);
+
 	return s;
 }
 
 void rfcomm_session_del(struct rfcomm_session *s)
 {
 	int state = s->state;
-	
+
 	BT_DBG("session %p state %ld", s, s->state);
 
 	list_del(&s->list);
@@ -1642,9 +1642,9 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
 
 	BT_DBG("session %p", s);
 
-	if (sock_create_lite(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP, &nsock))
+	if (sock_create_lite(PF_BLUETOOTH, sock->type, BTPROTO_L2CAP, &nsock))
 		return;
-	
+
 	nsock->ops  = sock->ops;
 
 	__module_get(nsock->ops->owner);
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 1428ce659..1aa1387cc 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -398,6 +398,27 @@ int rfcomm_sock_listen(struct socket *sock, int backlog)
 		goto done;
 	}
 
+	if (!rfcomm_pi(sk)->channel) {
+		bdaddr_t *src = &bt_sk(sk)->src;
+		u8 channel;
+
+		err = -EINVAL;
+
+		write_lock_bh(&rfcomm_sk_list.lock);
+
+		for (channel = 1; channel < 31; channel++)
+			if (!__rfcomm_get_sock_by_addr(channel, src)) {
+				rfcomm_pi(sk)->channel = channel;
+				err = 0;
+				break;
+			}
+
+		write_unlock_bh(&rfcomm_sk_list.lock);
+
+		if (err < 0)
+			goto done;
+	}
+
 	sk->sk_max_ack_backlog = backlog;
 	sk->sk_ack_backlog = 0;
 	sk->sk_state = BT_LISTEN;
@@ -637,7 +658,7 @@ out:
 	return copied ? : err;
 }
 
-static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
+static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	int err = 0;
@@ -656,7 +677,7 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c
 	return err;
 }
 
-static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
+static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	int len, err = 0; 
@@ -686,7 +707,7 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon
 	lock_sock(sk);
 
 #ifdef CONFIG_BT_RFCOMM_TTY
-	err = rfcomm_dev_ioctl(sk, cmd, arg);
+	err = rfcomm_dev_ioctl(sk, cmd, (void __user *)arg);
 #else
 	err = -EOPNOTSUPP;
 #endif
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 9a777b9a3..ed8abeff3 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -302,13 +302,13 @@ static struct sk_buff *rfcomm_wmalloc(struct rfcomm_dev *dev, unsigned long size
 
 #define NOCAP_FLAGS ((1 << RFCOMM_REUSE_DLC) | (1 << RFCOMM_RELEASE_ONHUP))
 
-static int rfcomm_create_dev(struct sock *sk, unsigned long arg)
+static int rfcomm_create_dev(struct sock *sk, void __user *arg)
 {
 	struct rfcomm_dev_req req;
 	struct rfcomm_dlc *dlc;
 	int id;
 
-	if (copy_from_user(&req, (void *) arg, sizeof(req)))
+	if (copy_from_user(&req, arg, sizeof(req)))
 		return -EFAULT;
 
 	BT_DBG("sk %p dev_id %id flags 0x%x", sk, req.dev_id, req.flags);
@@ -344,12 +344,12 @@ static int rfcomm_create_dev(struct sock *sk, unsigned long arg)
 	return id;
 }
 
-static int rfcomm_release_dev(unsigned long arg)
+static int rfcomm_release_dev(void __user *arg)
 {
 	struct rfcomm_dev_req req;
 	struct rfcomm_dev *dev;
 
-	if (copy_from_user(&req, (void *) arg, sizeof(req)))
+	if (copy_from_user(&req, arg, sizeof(req)))
 		return -EFAULT;
 
 	BT_DBG("dev_id %id flags 0x%x", req.dev_id, req.flags);
@@ -370,7 +370,7 @@ static int rfcomm_release_dev(unsigned long arg)
 	return 0;
 }
 
-static int rfcomm_get_dev_list(unsigned long arg)
+static int rfcomm_get_dev_list(void __user *arg)
 {
 	struct rfcomm_dev_list_req *dl;
 	struct rfcomm_dev_info *di;
@@ -380,7 +380,7 @@ static int rfcomm_get_dev_list(unsigned long arg)
 
 	BT_DBG("");
 
-	if (get_user(dev_num, (u16 *) arg))
+	if (get_user(dev_num, (u16 __user *) arg))
 		return -EFAULT;
 
 	if (!dev_num || dev_num > (PAGE_SIZE * 4) / sizeof(*di))
@@ -412,13 +412,13 @@ static int rfcomm_get_dev_list(unsigned long arg)
 	dl->dev_num = n;
 	size = sizeof(*dl) + n * sizeof(*di);
 
-	err = copy_to_user((void *) arg, dl, size);
+	err = copy_to_user(arg, dl, size);
 	kfree(dl);
 
 	return err ? -EFAULT : 0;
 }
 
-static int rfcomm_get_dev_info(unsigned long arg)
+static int rfcomm_get_dev_info(void __user *arg)
 {
 	struct rfcomm_dev *dev;
 	struct rfcomm_dev_info di;
@@ -426,7 +426,7 @@ static int rfcomm_get_dev_info(unsigned long arg)
 
 	BT_DBG("");
 
-	if (copy_from_user(&di, (void *)arg, sizeof(di)))
+	if (copy_from_user(&di, arg, sizeof(di)))
 		return -EFAULT;
 
 	if (!(dev = rfcomm_dev_get(di.id)))
@@ -438,16 +438,16 @@ static int rfcomm_get_dev_info(unsigned long arg)
 	bacpy(&di.src, &dev->src);
 	bacpy(&di.dst, &dev->dst);
 
-	if (copy_to_user((void *)arg, &di, sizeof(di)))
+	if (copy_to_user(arg, &di, sizeof(di)))
 		err = -EFAULT;
 
 	rfcomm_dev_put(dev);
 	return err;
 }
 
-int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, unsigned long arg)
+int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
 {
-	BT_DBG("cmd %d arg %ld", cmd, arg);
+	BT_DBG("cmd %d arg %p", cmd, arg);
 
 	switch (cmd) {
 	case RFCOMMCREATEDEV:
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index ab9053b8e..55a266705 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -22,12 +22,7 @@
    SOFTWARE IS DISCLAIMED.
 */
 
-/*
- * Bluetooth SCO sockets.
- *
- * $Id: sco.c,v 1.3 2002/04/17 17:37:16 maxk Exp $
- */
-#define VERSION "0.3"
+/* Bluetooth SCO sockets. */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -58,9 +53,11 @@
 
 #ifndef CONFIG_BT_SCO_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
+#define VERSION "0.3"
+
 static struct proto_ops sco_sock_ops;
 
 static struct bt_sock_list sco_sk_list = {
@@ -94,17 +91,13 @@ static void sco_sock_timeout(unsigned long arg)
 static void sco_sock_set_timer(struct sock *sk, long timeout)
 {
 	BT_DBG("sock %p state %d timeout %ld", sk, sk->sk_state, timeout);
-
-	if (!mod_timer(&sk->sk_timer, jiffies + timeout))
-		sock_hold(sk);
+	sk_reset_timer(sk, &sk->sk_timer, jiffies + timeout);
 }
 
 static void sco_sock_clear_timer(struct sock *sk)
 {
 	BT_DBG("sock %p state %d", sk, sk->sk_state);
-
-	if (timer_pending(&sk->sk_timer) && del_timer(&sk->sk_timer))
-		__sock_put(sk);
+	sk_stop_timer(sk, &sk->sk_timer);
 }
 
 static void sco_sock_init_timer(struct sock *sk)
@@ -137,7 +130,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
 
 	conn->src = &hdev->bdaddr;
 	conn->dst = &hcon->dst;
-	
+
 	if (hdev->sco_mtu > 0)
 		conn->mtu = hdev->sco_mtu;
 	else
@@ -483,7 +476,7 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
 	}
 
 	write_lock_bh(&sco_sk_list.lock);
-	
+
 	if (bacmp(src, BDADDR_ANY) && __sco_get_sock_by_addr(src)) {
 		err = -EADDRINUSE;
 	} else {
@@ -491,7 +484,7 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
 		bacpy(&bt_sk(sk)->src, &sa->sco_bdaddr);
 		sk->sk_state = BT_BOUND;
 	}
-	
+
 	write_unlock_bh(&sco_sk_list.lock);
 
 done:
@@ -655,7 +648,7 @@ static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 	return err;
 }
 
-static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
+static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	int err = 0;
@@ -674,7 +667,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char
 	return err;
 }
 
-static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
+static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	struct sco_options opts;
@@ -694,7 +687,7 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char
 			err = -ENOTCONN;
 			break;
 		}
-		
+
 		opts.mtu = sco_pi(sk)->conn->mtu;
 
 		BT_DBG("mtu %d", opts.mtu);
@@ -737,7 +730,7 @@ static int sco_sock_release(struct socket *sock)
 
 	if (!sk)
 		return 0;
-	
+
 	sco_sock_close(sk);
 
 	if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime) {
@@ -811,7 +804,7 @@ static void sco_conn_ready(struct sco_conn *conn)
 		sk = sco_sock_alloc(NULL, BTPROTO_SCO, GFP_ATOMIC);
 		if (!sk) {
 			bh_unlock_sock(parent);
-                	goto done;
+			goto done;
 		}
 
 		sco_sock_init(sk, parent);
@@ -820,14 +813,14 @@ static void sco_conn_ready(struct sco_conn *conn)
 		bacpy(&bt_sk(sk)->dst, conn->dst);
 
 		hci_conn_hold(conn->hcon);
-        	__sco_chan_add(conn, sk, parent);
+		__sco_chan_add(conn, sk, parent);
 
-        	sk->sk_state = BT_CONNECTED;
+		sk->sk_state = BT_CONNECTED;
 
 		/* Wake up parent */
 		parent->sk_data_ready(parent, 1);
-	
-        	bh_unlock_sock(parent);
+
+		bh_unlock_sock(parent);
 	}
 
 done:
@@ -858,7 +851,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
 			sco_conn_ready(conn);
 	} else 
 		sco_conn_del(hcon, bt_err(status));
-	
+
 	return 0;
 }
 
@@ -931,10 +924,10 @@ static int  sco_seq_show(struct seq_file *seq, void *e)
 }
 
 static struct seq_operations sco_seq_ops = {
-	.start  = sco_seq_start,
-	.next   = sco_seq_next,
-	.stop   = sco_seq_stop,
-	.show   = sco_seq_show 
+	.start	= sco_seq_start,
+	.next	= sco_seq_next,
+	.stop	= sco_seq_stop,
+	.show	= sco_seq_show 
 };
 
 static int sco_seq_open(struct inode *inode, struct file *file)
@@ -943,74 +936,74 @@ static int sco_seq_open(struct inode *inode, struct file *file)
 }
 
 static struct file_operations sco_seq_fops = {
-	.owner	 = THIS_MODULE,
-	.open    = sco_seq_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release,
+	.owner		= THIS_MODULE,
+	.open		= sco_seq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
 };
 
-static int  __init sco_proc_init(void)
+static int __init sco_proc_init(void)
 {
-        struct proc_dir_entry *p = create_proc_entry("sco", S_IRUGO, proc_bt);
-        if (!p)
-                return -ENOMEM;
+	struct proc_dir_entry *p = create_proc_entry("sco", S_IRUGO, proc_bt);
+	if (!p)
+		return -ENOMEM;
 	p->owner     = THIS_MODULE;
-        p->proc_fops = &sco_seq_fops;
-        return 0;
+	p->proc_fops = &sco_seq_fops;
+	return 0;
 }
 
 static void __exit sco_proc_cleanup(void)
 {
-        remove_proc_entry("sco", proc_bt);
+	remove_proc_entry("sco", proc_bt);
 }
 
 #else /* CONFIG_PROC_FS */
 
-static int  __init sco_proc_init(void)
+static int __init sco_proc_init(void)
 {
-        return 0;
+	return 0;
 }
 
 static void __exit sco_proc_cleanup(void)
 {
-        return;
+	return;
 }
 #endif /* CONFIG_PROC_FS */
 
 static struct proto_ops sco_sock_ops = {
-	.family  =      PF_BLUETOOTH,
-	.owner   =	THIS_MODULE,
-	.release =      sco_sock_release,
-	.bind    =     	sco_sock_bind,
-	.connect =      sco_sock_connect,
-	.listen  =      sco_sock_listen,
-	.accept  =      sco_sock_accept,
-	.getname =      sco_sock_getname,
-	.sendmsg =      sco_sock_sendmsg,
-	.recvmsg =      bt_sock_recvmsg,
-	.poll    =      bt_sock_poll,
-	.ioctl   =      sock_no_ioctl,
-	.mmap    =      sock_no_mmap,
-	.socketpair =   sock_no_socketpair,
-	.shutdown   =   sock_no_shutdown,
-	.setsockopt =   sco_sock_setsockopt,
-	.getsockopt =   sco_sock_getsockopt
+	.family		= PF_BLUETOOTH,
+	.owner		= THIS_MODULE,
+	.release	= sco_sock_release,
+	.bind		= sco_sock_bind,
+	.connect	= sco_sock_connect,
+	.listen		= sco_sock_listen,
+	.accept		= sco_sock_accept,
+	.getname	= sco_sock_getname,
+	.sendmsg	= sco_sock_sendmsg,
+	.recvmsg	= bt_sock_recvmsg,
+	.poll		= bt_sock_poll,
+	.ioctl		= sock_no_ioctl,
+	.mmap		= sock_no_mmap,
+	.socketpair	= sock_no_socketpair,
+	.shutdown	= sock_no_shutdown,
+	.setsockopt	= sco_sock_setsockopt,
+	.getsockopt	= sco_sock_getsockopt
 };
 
 static struct net_proto_family sco_sock_family_ops = {
-	.family =       PF_BLUETOOTH,
-	.create =       sco_sock_create,
-	.owner	=	THIS_MODULE,
+	.family	= PF_BLUETOOTH,
+	.owner	= THIS_MODULE,
+	.create	= sco_sock_create,
 };
 
 static struct hci_proto sco_hci_proto = {
-	.name =         "SCO",
-	.id   =         HCI_PROTO_SCO,
-	.connect_ind =  sco_connect_ind,
-	.connect_cfm =  sco_connect_cfm,
-	.disconn_ind =  sco_disconn_ind,
-	.recv_scodata =	sco_recv_scodata
+	.name		= "SCO",
+	.id		= HCI_PROTO_SCO,
+	.connect_ind	= sco_connect_ind,
+	.connect_cfm	= sco_connect_cfm,
+	.disconn_ind	= sco_disconn_ind,
+	.recv_scodata	= sco_recv_scodata
 };
 
 static int __init sco_init(void)
@@ -1028,7 +1021,7 @@ static int __init sco_init(void)
 	}
 
 	sco_proc_init();
-	
+
 	BT_INFO("SCO (Voice Link) ver %s", VERSION);
 	BT_INFO("SCO socket layer initialized");
 
diff --git a/net/bridge/Makefile b/net/bridge/Makefile
index b2d49f58f..59556e40e 100644
--- a/net/bridge/Makefile
+++ b/net/bridge/Makefile
@@ -8,6 +8,8 @@ bridge-y	:= br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
 			br_ioctl.o br_notify.o br_stp.o br_stp_bpdu.o \
 			br_stp_if.o br_stp_timer.o
 
+bridge-$(CONFIG_SYSFS) += br_sysfs_if.o br_sysfs_br.o
+
 bridge-$(CONFIG_BRIDGE_NETFILTER) += br_netfilter.o
 
 obj-$(CONFIG_BRIDGE_NF_EBTABLES) += netfilter/
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 675d0709a..06fdee661 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -33,6 +33,8 @@ static int __init br_init(void)
 {
 	br_fdb_init();
 
+	br_sysfs_init();
+
 #ifdef CONFIG_BRIDGE_NETFILTER
 	if (br_netfilter_init())
 		return 1;
@@ -67,6 +69,7 @@ static void __exit br_deinit(void)
 #endif
 
 	br_handle_frame_hook = NULL;
+	br_sysfs_fini();
 	br_fdb_fini();
 }
 
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 1b8dbdd9f..b7e6adc0b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -19,21 +19,6 @@
 #include <asm/uaccess.h>
 #include "br_private.h"
 
-static int br_dev_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
-	unsigned long args[4];
-	unsigned long *data;
-
-	if (cmd != SIOCDEVPRIVATE)
-		return -EOPNOTSUPP;
-
-	data = (unsigned long *)rq->ifr_data;
-	if (copy_from_user(args, data, 4*sizeof(unsigned long)))
-		return -EFAULT;
-
-	return br_ioctl_device(dev->priv, args[0], args[1], args[2], args[3]);
-}
-
 static struct net_device_stats *br_dev_get_stats(struct net_device *dev)
 {
 	struct net_bridge *br;
@@ -115,7 +100,7 @@ void br_dev_setup(struct net_device *dev)
 
 	ether_setup(dev);
 
-	dev->do_ioctl = br_dev_do_ioctl;
+	dev->do_ioctl = br_dev_ioctl;
 	dev->get_stats = br_dev_get_stats;
 	dev->hard_start_xmit = br_dev_xmit;
 	dev->open = br_dev_open;
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index e4ffa00ce..324489dda 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -16,14 +16,15 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
-#include <linux/if_bridge.h>
 #include <linux/times.h>
+#include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <asm/atomic.h>
-#include <asm/uaccess.h>
 #include "br_private.h"
 
 static kmem_cache_t *br_fdb_cache;
+static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
+		      const unsigned char *addr, int is_local);
 
 void __init br_fdb_init(void)
 {
@@ -54,17 +55,6 @@ static __inline__ int has_expired(const struct net_bridge *br,
 		&& time_before_eq(fdb->ageing_timer + hold_time(br), jiffies);
 }
 
-static inline void copy_fdb(struct __fdb_entry *ent, 
-				const struct net_bridge_fdb_entry *f)
-{
-	memset(ent, 0, sizeof(struct __fdb_entry));
-	memcpy(ent->mac_addr, f->addr.addr, ETH_ALEN);
-	ent->port_no = f->dst?f->dst->port_no:0;
-	ent->is_local = f->is_local;
-	ent->ageing_timer_value = f->is_static ? 0 
-		: jiffies_to_clock_t(jiffies - f->ageing_timer);
-}
-
 static __inline__ int br_mac_hash(const unsigned char *mac)
 {
 	unsigned long x;
@@ -84,37 +74,49 @@ static __inline__ int br_mac_hash(const unsigned char *mac)
 static __inline__ void fdb_delete(struct net_bridge_fdb_entry *f)
 {
 	hlist_del(&f->hlist);
-	list_del(&f->age_list);
+	if (!f->is_static)
+		list_del(&f->age_list);
+
 	br_fdb_put(f);
 }
 
 void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr)
 {
-	struct net_bridge *br;
+	struct net_bridge *br = p->br;
 	int i;
-	int newhash = br_mac_hash(newaddr);
-
-	br = p->br;
+	
 	write_lock_bh(&br->hash_lock);
-	for (i=0;i<BR_HASH_SIZE;i++) {
+
+	/* Search all chains since old address/hash is unknown */
+	for (i = 0; i < BR_HASH_SIZE; i++) {
 		struct hlist_node *h;
-		
 		hlist_for_each(h, &br->hash[i]) {
-			struct net_bridge_fdb_entry *f
-				= hlist_entry(h, struct net_bridge_fdb_entry, hlist);
+			struct net_bridge_fdb_entry *f;
 
+			f = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
 			if (f->dst == p && f->is_local) {
-				memcpy(f->addr.addr, newaddr, ETH_ALEN);
-				if (newhash != i) {
-					hlist_del(&f->hlist);
-					hlist_add_head(&f->hlist,
-						       &br->hash[newhash]);
+				/* maybe another port has same hw addr? */
+				struct net_bridge_port *op;
+				list_for_each_entry(op, &br->port_list, list) {
+					if (op != p && 
+					    !memcmp(op->dev->dev_addr,
+						    f->addr.addr, ETH_ALEN)) {
+						f->dst = op;
+						goto insert;
+					}
 				}
-				goto out;
+
+				/* delete old one */
+				fdb_delete(f);
+				goto insert;
 			}
 		}
 	}
- out:
+ insert:
+	/* insert new address,  may fail if invalid address or dup. */
+	fdb_insert(br, p, newaddr, 1);
+
+
 	write_unlock_bh(&br->hash_lock);
 }
 
@@ -133,11 +135,10 @@ void br_fdb_cleanup(unsigned long _data)
 		unsigned long expires = f->ageing_timer + delay;
 
 		if (time_before_eq(expires, jiffies)) {
-			if (!f->is_static) {
-				pr_debug("expire age %lu jiffies %lu\n",
-					 f->ageing_timer, jiffies);
-				fdb_delete(f);
-			}
+			WARN_ON(f->is_static);
+			pr_debug("expire age %lu jiffies %lu\n",
+				 f->ageing_timer, jiffies);
+			fdb_delete(f);
 		} else {
 			mod_timer(&br->gc_timer, expires);
 			break;
@@ -151,15 +152,34 @@ void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
 	int i;
 
 	write_lock_bh(&br->hash_lock);
-	for (i=0;i<BR_HASH_SIZE;i++) {
+	for (i = 0; i < BR_HASH_SIZE; i++) {
 		struct hlist_node *h, *g;
 		
 		hlist_for_each_safe(h, g, &br->hash[i]) {
 			struct net_bridge_fdb_entry *f
 				= hlist_entry(h, struct net_bridge_fdb_entry, hlist);
-			if (f->dst == p) {
-				fdb_delete(f);
+			if (f->dst != p) 
+				continue;
+
+			/*
+			 * if multiple ports all have the same device address
+			 * then when one port is deleted, assign
+			 * the local entry to other port
+			 */
+			if (f->is_local) {
+				struct net_bridge_port *op;
+				list_for_each_entry(op, &br->port_list, list) {
+					if (op != p && 
+					    !memcmp(op->dev->dev_addr,
+						    f->addr.addr, ETH_ALEN)) {
+						f->dst = op;
+						goto skip_delete;
+					}
+				}
 			}
+
+			fdb_delete(f);
+		skip_delete: ;
 		}
 	}
 	write_unlock_bh(&br->hash_lock);
@@ -195,115 +215,97 @@ void br_fdb_put(struct net_bridge_fdb_entry *ent)
 		kmem_cache_free(br_fdb_cache, ent);
 }
 
-int br_fdb_get_entries(struct net_bridge *br,
-		       unsigned char *_buf,
-		       int maxnum,
-		       int offset)
+/*
+ * Fill buffer with forwarding table records in 
+ * the API format.
+ */
+int br_fdb_fillbuf(struct net_bridge *br, void *buf,
+		   unsigned long maxnum, unsigned long skip)
 {
-	int i;
-	int num;
-	struct __fdb_entry *walk;
+	struct __fdb_entry *fe = buf;
+	int i, num = 0;
+	struct hlist_node *h;
+	struct net_bridge_fdb_entry *f;
 
-	num = 0;
-	walk = (struct __fdb_entry *)_buf;
+	memset(buf, 0, maxnum*sizeof(struct __fdb_entry));
 
 	read_lock_bh(&br->hash_lock);
-	for (i=0;i<BR_HASH_SIZE;i++) {
-		struct hlist_node *h;
-		
-		hlist_for_each(h, &br->hash[i]) {
-			struct net_bridge_fdb_entry *f
-				= hlist_entry(h, struct net_bridge_fdb_entry, hlist);
-			struct __fdb_entry ent;
-
+	for (i = 0; i < BR_HASH_SIZE; i++) {
+		hlist_for_each_entry(f, h, &br->hash[i], hlist) {
 			if (num >= maxnum)
 				goto out;
 
 			if (has_expired(br, f)) 
 				continue;
 
-			if (offset) {
-				offset--;
+			if (skip) {
+				--skip;
 				continue;
 			}
 
-			copy_fdb(&ent, f);
-
-			atomic_inc(&f->use_count);
-			read_unlock_bh(&br->hash_lock);
-			
-			if (copy_to_user(walk, &ent, sizeof(struct __fdb_entry)))
-				return -EFAULT;
-
-			read_lock_bh(&br->hash_lock);
-			
-			/* entry was deleted during copy_to_user */
-			if (atomic_dec_and_test(&f->use_count)) {
-				kmem_cache_free(br_fdb_cache, f);
-				num = -EAGAIN;
-				goto out;
-			}
-
-			/* entry changed address hash while copying */
-			if (br_mac_hash(f->addr.addr) != i) {
-				num = -EAGAIN;
-				goto out;
-			}
-
-			num++;
-			walk++;
+			/* convert from internal format to API */
+			memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN);
+			fe->port_no = f->dst->port_no;
+			fe->is_local = f->is_local;
+			if (!f->is_static)
+				fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer);
+			++fe;
+			++num;
 		}
 	}
 
  out:
 	read_unlock_bh(&br->hash_lock);
+
 	return num;
 }
 
-int br_fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
+static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
 		  const unsigned char *addr, int is_local)
 {
 	struct hlist_node *h;
 	struct net_bridge_fdb_entry *fdb;
 	int hash = br_mac_hash(addr);
-	int ret = 0;
 
 	if (!is_valid_ether_addr(addr))
 		return -EADDRNOTAVAIL;
 
-	write_lock_bh(&br->hash_lock);
-	hlist_for_each(h, &br->hash[hash]) {
-		fdb = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
+	hlist_for_each_entry(fdb, h, &br->hash[hash], hlist) {
 		if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
 			/* attempt to update an entry for a local interface */
-			if (unlikely(fdb->is_local)) {
+			if (fdb->is_local) {
+				/* it is okay to have multiple ports with same 
+				 * address, just don't allow to be spoofed.
+				 */
 				if (is_local) 
-					printk(KERN_INFO "%s: attempt to add"
-					       " interface with same source address.\n",
-					       source->dev->name);
-				else if (net_ratelimit()) 
+					return 0;
+
+				if (net_ratelimit()) 
 					printk(KERN_WARNING "%s: received packet with "
 					       " own address as source address\n",
 					       source->dev->name);
-				ret = -EEXIST;
-				goto out;
+				return -EEXIST;
 			}
 
-
-			if (likely(!fdb->is_static || is_local)) {
-				/* move to end of age list */
-				list_del(&fdb->age_list);
+			if (is_local) {
+				printk(KERN_WARNING "%s adding interface with same address "
+				       "as a received packet\n",
+				       source->dev->name);
 				goto update;
 			}
-			goto out;
+
+			if (fdb->is_static)
+				return 0;
+
+			/* move to end of age list */
+			list_del(&fdb->age_list);
+			goto update;
 		}
 	}
 
 	fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC);
-	if (unlikely(fdb == NULL)) {
-		ret = -ENOMEM;
-		goto out;
-	}
+	if (!fdb)
+		return ENOMEM;
 
 	memcpy(fdb->addr.addr, addr, ETH_ALEN);
 	atomic_set(&fdb->use_count, 1);
@@ -319,9 +321,19 @@ int br_fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
 	fdb->is_local = is_local;
 	fdb->is_static = is_local;
 	fdb->ageing_timer = jiffies;
-	list_add_tail(&fdb->age_list, &br->age_list);
- out:
-	write_unlock_bh(&br->hash_lock);
+	if (!is_local) 
+		list_add_tail(&fdb->age_list, &br->age_list);
 
+	return 0;
+}
+
+int br_fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
+		  const unsigned char *addr, int is_local)
+{
+	int ret;
+
+	write_lock_bh(&br->hash_lock);
+	ret = fdb_insert(br, source, addr, is_local);
+	write_unlock_bh(&br->hash_lock);
 	return ret;
 }
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 3e52b610f..8a6de043e 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -78,53 +78,56 @@ static int br_initial_port_cost(struct net_device *dev)
 static void destroy_nbp(void *arg)
 {
 	struct net_bridge_port *p = arg;
+	struct net_device *dev = p->dev;
 
-	p->dev->br_port = NULL;
-
-	BUG_ON(timer_pending(&p->message_age_timer));
-	BUG_ON(timer_pending(&p->forward_delay_timer));
-	BUG_ON(timer_pending(&p->hold_timer));
+	dev->br_port = NULL;
+	p->br = NULL;
+	p->dev = NULL;
+	dev_put(dev);
 
-	dev_put(p->dev);
-	kfree(p);
+	br_sysfs_freeif(p);
 }
 
-/* called under bridge lock */
+/* called with RTNL */
 static void del_nbp(struct net_bridge_port *p)
 {
+	struct net_bridge *br = p->br;
 	struct net_device *dev = p->dev;
 
+	dev_set_promiscuity(dev, -1);
+
+	spin_lock_bh(&br->lock);
 	br_stp_disable_port(p);
+	spin_unlock_bh(&br->lock);
 
-	dev_set_promiscuity(dev, -1);
+	br_fdb_delete_by_port(br, p);
 
 	list_del_rcu(&p->list);
 
-	br_fdb_delete_by_port(p->br, p);
-
-	del_timer(&p->message_age_timer);
-	del_timer(&p->forward_delay_timer);
-	del_timer(&p->hold_timer);
+	del_timer_sync(&p->message_age_timer);
+	del_timer_sync(&p->forward_delay_timer);
+	del_timer_sync(&p->hold_timer);
 	
 	call_rcu(&p->rcu, destroy_nbp, p);
 }
 
+/* called with RTNL */
 static void del_br(struct net_bridge *br)
 {
-	struct list_head *p, *n;
+	struct net_bridge_port *p, *n;
 
-	spin_lock_bh(&br->lock);
-	list_for_each_safe(p, n, &br->port_list) {
-		del_nbp(list_entry(p, struct net_bridge_port, list));
+	list_for_each_entry_safe(p, n, &br->port_list, list) {
+		br_sysfs_removeif(p);
+		del_nbp(p);
 	}
-	spin_unlock_bh(&br->lock);
 
 	del_timer_sync(&br->gc_timer);
 
+	br_sysfs_delbr(br->dev);
  	unregister_netdevice(br->dev);
 }
 
-static struct net_bridge *new_nb(const char *name)
+static struct net_device *new_bridge_dev(const char *name)
 {
 	struct net_bridge *br;
 	struct net_device *dev;
@@ -135,7 +138,7 @@ static struct net_bridge *new_nb(const char *name)
 	if (!dev)
 		return NULL;
 
-	br = dev->priv;
+	br = netdev_priv(dev);
 	br->dev = dev;
 
 	br->lock = SPIN_LOCK_UNLOCKED;
@@ -160,7 +163,7 @@ static struct net_bridge *new_nb(const char *name)
 
 	br_stp_timer_init(br);
 
-	return br;
+	return dev;
 }
 
 /* find an available port number */
@@ -171,7 +174,7 @@ static int find_portno(struct net_bridge *br)
 	unsigned long *inuse;
 
 	inuse = kmalloc(BITS_TO_LONGS(BR_MAX_PORTS)*sizeof(unsigned long),
-			GFP_ATOMIC);
+			GFP_KERNEL);
 	if (!inuse)
 		return -ENOMEM;
 
@@ -186,7 +189,7 @@ static int find_portno(struct net_bridge *br)
 	return (index >= BR_MAX_PORTS) ? -EXFULL : index;
 }
 
-/* called under bridge lock */
+/* called with RTNL */
 static struct net_bridge_port *new_nbp(struct net_bridge *br, 
 				       struct net_device *dev,
 				       unsigned long cost)
@@ -198,7 +201,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
 	if (index < 0)
 		return ERR_PTR(index);
 
-	p = kmalloc(sizeof(*p), GFP_ATOMIC);
+	p = kmalloc(sizeof(*p), GFP_KERNEL);
 	if (p == NULL)
 		return ERR_PTR(-ENOMEM);
 
@@ -212,22 +215,51 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
 	p->port_no = index;
 	br_init_port(p);
 	p->state = BR_STATE_DISABLED;
+	kobject_init(&p->kobj);
 
 	return p;
 }
 
 int br_add_bridge(const char *name)
 {
-	struct net_bridge *br;
+	struct net_device *dev;
 	int ret;
 
-	if ((br = new_nb(name)) == NULL) 
+	dev = new_bridge_dev(name);
+	if (!dev) 
 		return -ENOMEM;
 
-	ret = register_netdev(br->dev);
+	rtnl_lock();
+	if (strchr(dev->name, '%')) {
+		ret = dev_alloc_name(dev, dev->name);
+		if (ret < 0)
+			goto err1;
+	}
+
+	ret = register_netdevice(dev);
 	if (ret)
-		free_netdev(br->dev);
+		goto err2;
+
+	/* network device kobject is not setup until
+	 * after rtnl_unlock does it's hotplug magic.
+	 * so hold reference to avoid race.
+	 */
+	dev_hold(dev);
+	rtnl_unlock();
+
+	ret = br_sysfs_addbr(dev);
+	dev_put(dev);
+
+	if (ret) 
+		unregister_netdev(dev);
+ out:
 	return ret;
+
+ err2:
+	free_netdev(dev);
+ err1:
+	rtnl_unlock();
+	goto out;
 }
 
 int br_del_bridge(const char *name)
@@ -251,16 +283,16 @@ int br_del_bridge(const char *name)
 	} 
 
 	else 
-		del_br(dev->priv);
+		del_br(netdev_priv(dev));
 
 	rtnl_unlock();
 	return ret;
 }
 
+/* called with RTNL */
 int br_add_if(struct net_bridge *br, struct net_device *dev)
 {
 	struct net_bridge_port *p;
-	unsigned long cost;
 	int err = 0;
 
 	if (dev->flags & IFF_LOOPBACK || dev->type != ARPHRD_ETHER)
@@ -269,78 +301,50 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 	if (dev->hard_start_xmit == br_dev_xmit)
 		return -ELOOP;
 
-	cost = br_initial_port_cost(dev);
-
-	spin_lock_bh(&br->lock);
 	if (dev->br_port != NULL)
-		err = -EBUSY;
+		return -EBUSY;
 
-	else if (IS_ERR(p = new_nbp(br, dev, cost)))
-		err = PTR_ERR(p);
+	if (IS_ERR(p = new_nbp(br, dev, br_initial_port_cost(dev))))
+		return PTR_ERR(p);
 
- 	else if ((err = br_fdb_insert(br, p, dev->dev_addr, 1)))
- 		 destroy_nbp(p);
+ 	if ((err = br_fdb_insert(br, p, dev->dev_addr, 1)))
+		destroy_nbp(p);
  
+	else if ((err = br_sysfs_addif(p)))
+		del_nbp(p);
 	else {
 		dev_set_promiscuity(dev, 1);
 
 		list_add_rcu(&p->list, &br->port_list);
 
+		spin_lock_bh(&br->lock);
 		br_stp_recalculate_bridge_id(br);
 		if ((br->dev->flags & IFF_UP) && (dev->flags & IFF_UP))
 			br_stp_enable_port(p);
-
+		spin_unlock_bh(&br->lock);
 	}
-	spin_unlock_bh(&br->lock);
+
 	return err;
 }
 
+/* called with RTNL */
 int br_del_if(struct net_bridge *br, struct net_device *dev)
 {
-	struct net_bridge_port *p;
-	int err = 0;
-
-	spin_lock_bh(&br->lock);
-	p = dev->br_port;
+	struct net_bridge_port *p = dev->br_port;
+	
 	if (!p || p->br != br) 
-		err = -EINVAL;
-	else {
-		del_nbp(p);
-		br_stp_recalculate_bridge_id(br);
-	}
-	spin_unlock_bh(&br->lock);
-
-	return err;
-}
-
-int br_get_bridge_ifindices(int *indices, int num)
-{
-	struct net_device *dev;
-	int i = 0;
-
-	read_lock(&dev_base_lock);
-	for (dev = dev_base; dev && i < num; dev = dev->next) {
-		if (dev->priv_flags & IFF_EBRIDGE) 
-			indices[i++] = dev->ifindex;
-	}
-	read_unlock(&dev_base_lock);
+		return -EINVAL;
 
-	return i;
-}
+	br_sysfs_removeif(p);
+	del_nbp(p);
 
-void br_get_port_ifindices(struct net_bridge *br, int *ifindices, int num)
-{
-	struct net_bridge_port *p;
+	spin_lock_bh(&br->lock);
+	br_stp_recalculate_bridge_id(br);
+	spin_unlock_bh(&br->lock);
 
-	rcu_read_lock();
-	list_for_each_entry_rcu(p, &br->port_list, list) {
-		if (p->port_no < num)
-			ifindices[p->port_no] = p->dev->ifindex;
-	}
-	rcu_read_unlock();
+	return 0;
 }
 
-
 void __exit br_cleanup_bridges(void)
 {
 	struct net_device *dev, *nxt;
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index 4cff15b1c..cceb01866 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -20,42 +20,102 @@
 #include <asm/uaccess.h>
 #include "br_private.h"
 
-/* Report time remaining in user HZ  */
-static unsigned long timer_residue(const struct timer_list *timer)
+/* called with RTNL */
+static int get_bridge_ifindices(int *indices, int num)
 {
-	return timer_pending(timer) 
-		? jiffies_to_clock_t(timer->expires - jiffies) : 0;
+	struct net_device *dev;
+	int i = 0;
+
+	for (dev = dev_base; dev && i < num; dev = dev->next) {
+		if (dev->priv_flags & IFF_EBRIDGE) 
+			indices[i++] = dev->ifindex;
+	}
+
+	return i;
 }
 
-int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
-		   unsigned long arg0, unsigned long arg1, unsigned long arg2)
+/* called with RTNL */
+static void get_port_ifindices(struct net_bridge *br, int *ifindices, int num)
 {
-	if (br == NULL)
-		return -EINVAL;
-
-	switch (cmd)
-	{
-	case BRCTL_ADD_IF:
-	case BRCTL_DEL_IF:
-	{
-		struct net_device *dev;
-		int ret;
+	struct net_bridge_port *p;
 
-		if (!capable(CAP_NET_ADMIN))
-			return -EPERM;
+	list_for_each_entry(p, &br->port_list, list) {
+		if (p->port_no < num)
+			ifindices[p->port_no] = p->dev->ifindex;
+	}
+}
 
-		dev = dev_get_by_index(arg0);
-		if (dev == NULL)
-			return -EINVAL;
+/*
+ * Format up to a page worth of forwarding table entries
+ * userbuf -- where to copy result
+ * maxnum  -- maximum number of entries desired
+ *            (limited to a page for sanity)
+ * offset  -- number of records to skip
+ */
+static int get_fdb_entries(struct net_bridge *br, void __user *userbuf, 
+			   unsigned long maxnum, unsigned long offset)
+{
+	int num;
+	void *buf;
+	size_t size = maxnum * sizeof(struct __fdb_entry);
 
-		if (cmd == BRCTL_ADD_IF)
-			ret = br_add_if(br, dev);
-		else
-			ret = br_del_if(br, dev);
+	if (size > PAGE_SIZE) {
+		size = PAGE_SIZE;
+		maxnum = PAGE_SIZE/sizeof(struct __fdb_entry);
+	}
 
-		dev_put(dev);
-		return ret;
+	buf = kmalloc(size, GFP_USER);
+	if (!buf)
+		return -ENOMEM;
+	
+	num = br_fdb_fillbuf(br, buf, maxnum, offset);
+	if (num > 0) {
+		if (copy_to_user(userbuf, buf, num*sizeof(struct __fdb_entry)))
+			num = -EFAULT;
 	}
+	kfree(buf);
+
+	return num;
+}
+
+static int add_del_if(struct net_bridge *br, int ifindex, int isadd)
+{
+	struct net_device *dev;
+	int ret;
+
+	if (!capable(CAP_NET_ADMIN))
+		return -EPERM;
+
+	dev = dev_get_by_index(ifindex);
+	if (dev == NULL)
+		return -EINVAL;
+	
+	if (isadd)
+		ret = br_add_if(br, dev);
+	else
+		ret = br_del_if(br, dev);
+
+	dev_put(dev);
+	return ret;
+}
+
+/*
+ * Legacy ioctl's through SIOCDEVPRIVATE
+ * This interface is deprecated because it was too difficult to
+ * to do the translation for 32/64bit ioctl compatability.
+ */
+static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+	struct net_bridge *br = netdev_priv(dev);
+	unsigned long args[4];
+	
+	if (copy_from_user(args, rq->ifr_data, sizeof(args)))
+		return -EFAULT;
+
+	switch (args[0]) {
+	case BRCTL_ADD_IF:
+	case BRCTL_DEL_IF:
+		return add_del_if(br, args[1], args[0] == BRCTL_ADD_IF);
 
 	case BRCTL_GET_BRIDGE_INFO:
 	{
@@ -77,13 +137,13 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 		b.root_port = br->root_port;
 		b.stp_enabled = br->stp_enabled;
 		b.ageing_time = jiffies_to_clock_t(br->ageing_time);
-		b.hello_timer_value = timer_residue(&br->hello_timer);
-		b.tcn_timer_value = timer_residue(&br->tcn_timer);
-		b.topology_change_timer_value = timer_residue(&br->topology_change_timer);
-		b.gc_timer_value = timer_residue(&br->gc_timer);
+		b.hello_timer_value = br_timer_value(&br->hello_timer);
+		b.tcn_timer_value = br_timer_value(&br->tcn_timer);
+		b.topology_change_timer_value = br_timer_value(&br->topology_change_timer);
+		b.gc_timer_value = br_timer_value(&br->gc_timer);
 	        rcu_read_unlock();
 
-		if (copy_to_user((void *)arg0, &b, sizeof(b)))
+		if (copy_to_user((void __user *)args[1], &b, sizeof(b)))
 			return -EFAULT;
 
 		return 0;
@@ -93,7 +153,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 	{
 		int num, *indices;
 
-		num = arg1;
+		num = args[2];
 		if (num < 0)
 			return -EINVAL;
 		if (num == 0)
@@ -107,8 +167,8 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 
 		memset(indices, 0, num*sizeof(int));
 
-		br_get_port_ifindices(br, indices, num);
-		if (copy_to_user((void *)arg0, indices, num*sizeof(int)))
+		get_port_ifindices(br, indices, num);
+		if (copy_to_user((void __user *)args[1], indices, num*sizeof(int)))
 			num =  -EFAULT;
 		kfree(indices);
 		return num;
@@ -119,7 +179,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 			return -EPERM;
 
 		spin_lock_bh(&br->lock);
-		br->bridge_forward_delay = clock_t_to_jiffies(arg0);
+		br->bridge_forward_delay = clock_t_to_jiffies(args[1]);
 		if (br_is_root_bridge(br))
 			br->forward_delay = br->bridge_forward_delay;
 		spin_unlock_bh(&br->lock);
@@ -130,7 +190,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 			return -EPERM;
 
 		spin_lock_bh(&br->lock);
-		br->bridge_hello_time = clock_t_to_jiffies(arg0);
+		br->bridge_hello_time = clock_t_to_jiffies(args[1]);
 		if (br_is_root_bridge(br))
 			br->hello_time = br->bridge_hello_time;
 		spin_unlock_bh(&br->lock);
@@ -141,7 +201,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 			return -EPERM;
 
 		spin_lock_bh(&br->lock);
-		br->bridge_max_age = clock_t_to_jiffies(arg0);
+		br->bridge_max_age = clock_t_to_jiffies(args[1]);
 		if (br_is_root_bridge(br))
 			br->max_age = br->bridge_max_age;
 		spin_unlock_bh(&br->lock);
@@ -151,7 +211,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 
-		br->ageing_time = clock_t_to_jiffies(arg0);
+		br->ageing_time = clock_t_to_jiffies(args[1]);
 		return 0;
 
 	case BRCTL_GET_PORT_INFO:
@@ -160,7 +220,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 		struct net_bridge_port *pt;
 
 		rcu_read_lock();
-		if ((pt = br_get_port(br, arg1)) == NULL) {
+		if ((pt = br_get_port(br, args[2])) == NULL) {
 			rcu_read_unlock();
 			return -EINVAL;
 		}
@@ -175,13 +235,13 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 		p.state = pt->state;
 		p.top_change_ack = pt->topology_change_ack;
 		p.config_pending = pt->config_pending;
-		p.message_age_timer_value = timer_residue(&pt->message_age_timer);
-		p.forward_delay_timer_value = timer_residue(&pt->forward_delay_timer);
-		p.hold_timer_value = timer_residue(&pt->hold_timer);
+		p.message_age_timer_value = br_timer_value(&pt->message_age_timer);
+		p.forward_delay_timer_value = br_timer_value(&pt->forward_delay_timer);
+		p.hold_timer_value = br_timer_value(&pt->hold_timer);
 
 		rcu_read_unlock();
 
-		if (copy_to_user((void *)arg0, &p, sizeof(p)))
+		if (copy_to_user((void __user *)args[1], &p, sizeof(p)))
 			return -EFAULT;
 
 		return 0;
@@ -191,7 +251,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 
-		br->stp_enabled = arg0?1:0;
+		br->stp_enabled = args[1]?1:0;
 		return 0;
 
 	case BRCTL_SET_BRIDGE_PRIORITY:
@@ -199,7 +259,7 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 			return -EPERM;
 
 		spin_lock_bh(&br->lock);
-		br_stp_set_bridge_priority(br, arg0);
+		br_stp_set_bridge_priority(br, args[1]);
 		spin_unlock_bh(&br->lock);
 		return 0;
 
@@ -211,14 +271,14 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 
-		if (arg1 >= (1<<(16-BR_PORT_BITS)))
+		if (args[2] >= (1<<(16-BR_PORT_BITS)))
 			return -ERANGE;
 
 		spin_lock_bh(&br->lock);
-		if ((p = br_get_port(br, arg0)) == NULL) 
+		if ((p = br_get_port(br, args[1])) == NULL) 
 			ret = -EINVAL;
 		else
-			br_stp_set_port_priority(p, arg1);
+			br_stp_set_port_priority(p, args[2]);
 		spin_unlock_bh(&br->lock);
 		return ret;
 	}
@@ -232,27 +292,30 @@ int br_ioctl_device(struct net_bridge *br, unsigned int cmd,
 			return -EPERM;
 
 		spin_lock_bh(&br->lock);
-		if ((p = br_get_port(br, arg0)) == NULL)
+		if ((p = br_get_port(br, args[1])) == NULL)
 			ret = -EINVAL;
 		else
-			br_stp_set_path_cost(p, arg1);
+			br_stp_set_path_cost(p, args[2]);
 		spin_unlock_bh(&br->lock);
 		return ret;
 	}
 
 	case BRCTL_GET_FDB_ENTRIES:
-		return br_fdb_get_entries(br, (void *)arg0, arg1, arg2);
+		return get_fdb_entries(br, (void __user *)args[1], 
+				       args[2], args[3]);
 	}
 
 	return -EOPNOTSUPP;
 }
 
-static int br_ioctl_deviceless(unsigned int cmd,
-			       unsigned long arg0,
-			       unsigned long arg1)
+static int old_deviceless(void __user *uarg)
 {
-	switch (cmd)
-	{
+	unsigned long args[3];
+
+	if (copy_from_user(args, uarg, sizeof(args)))
+		return -EFAULT;
+
+	switch (args[0]) {
 	case BRCTL_GET_VERSION:
 		return BRCTL_VERSION;
 
@@ -261,15 +324,15 @@ static int br_ioctl_deviceless(unsigned int cmd,
 		int *indices;
 		int ret = 0;
 
-		indices = kmalloc(arg1*sizeof(int), GFP_KERNEL);
+		indices = kmalloc(args[2]*sizeof(int), GFP_KERNEL);
 		if (indices == NULL)
 			return -ENOMEM;
 
-		memset(indices, 0, arg1*sizeof(int));
-		arg1 = br_get_bridge_ifindices(indices, arg1);
+		memset(indices, 0, args[2]*sizeof(int));
+		args[2] = get_bridge_ifindices(indices, args[2]);
 
-		ret = copy_to_user((void *)arg0, indices, arg1*sizeof(int))
-			? -EFAULT : arg1;
+		ret = copy_to_user((void __user *)args[1], indices, args[2]*sizeof(int))
+			? -EFAULT : args[2];
 
 		kfree(indices);
 		return ret;
@@ -283,12 +346,12 @@ static int br_ioctl_deviceless(unsigned int cmd,
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 
-		if (copy_from_user(buf, (void *)arg0, IFNAMSIZ))
+		if (copy_from_user(buf, (void __user *)args[1], IFNAMSIZ))
 			return -EFAULT;
 
 		buf[IFNAMSIZ-1] = 0;
 
-		if (cmd == BRCTL_ADD_BRIDGE)
+		if (args[0] == BRCTL_ADD_BRIDGE)
 			return br_add_bridge(buf);
 
 		return br_del_bridge(buf);
@@ -298,13 +361,48 @@ static int br_ioctl_deviceless(unsigned int cmd,
 	return -EOPNOTSUPP;
 }
 
+int br_ioctl_deviceless_stub(unsigned int cmd, void __user *uarg)
+{
+	switch (cmd) {
+	case SIOCGIFBR:
+	case SIOCSIFBR:
+		return old_deviceless(uarg);
+		
+	case SIOCBRADDBR:
+	case SIOCBRDELBR:
+	{
+		char buf[IFNAMSIZ];
+
+		if (!capable(CAP_NET_ADMIN))
+			return -EPERM;
 
-int br_ioctl_deviceless_stub(unsigned long arg)
+		if (copy_from_user(buf, uarg, IFNAMSIZ))
+			return -EFAULT;
+
+		buf[IFNAMSIZ-1] = 0;
+		if (cmd == SIOCBRADDBR)
+			return br_add_bridge(buf);
+
+		return br_del_bridge(buf);
+	}
+	}
+	return -EOPNOTSUPP;
+}
+
+int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	unsigned long i[3];
+	struct net_bridge *br = netdev_priv(dev);
 
-	if (copy_from_user(i, (void *)arg, 3*sizeof(unsigned long)))
-		return -EFAULT;
+	switch(cmd) {
+	case SIOCDEVPRIVATE:
+		return old_dev_ioctl(dev, rq, cmd);
+
+	case SIOCBRADDIF:
+	case SIOCBRDELIF:
+		return add_del_if(br, rq->ifr_ifindex, cmd == SIOCBRADDIF);
 
-	return br_ioctl_deviceless(i[0], i[1], i[2]);
+	}
+
+	printk(KERN_DEBUG "Bridge does not support ioctl 0x%x\n", cmd);
+	return -EOPNOTSUPP;
 }
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 9651cdfa8..7313d06c9 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -165,7 +165,7 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
 		skb_pull(skb, VLAN_HLEN);
 		skb->nh.raw += VLAN_HLEN;
 	}
-	skb->dst->output(skb);
+	skb->dst->output(&skb);
 	return 0;
 }
 
@@ -800,7 +800,7 @@ static struct nf_hook_ops br_nf_ops[] = {
 #ifdef CONFIG_SYSCTL
 static
 int brnf_sysctl_call_tables(ctl_table *ctl, int write, struct file * filp,
-			void *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp)
 {
 	int ret;
 
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 594bb5bca..c59335e3b 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -38,30 +38,35 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
 
 	br = p->br;
 
-	spin_lock_bh(&br->lock);
-	switch (event) 
-	{
+	switch (event) {
 	case NETDEV_CHANGEADDR:
+		spin_lock_bh(&br->lock);
 		br_fdb_changeaddr(p, dev->dev_addr);
 		if (br->dev->flags & IFF_UP)
 			br_stp_recalculate_bridge_id(br);
+		spin_unlock_bh(&br->lock);
 		break;
 
 	case NETDEV_DOWN:
-		if (br->dev->flags & IFF_UP)
+		if (br->dev->flags & IFF_UP) {
+			spin_lock_bh(&br->lock);
 			br_stp_disable_port(p);
+			spin_unlock_bh(&br->lock);
+		}
 		break;
 
 	case NETDEV_UP:
-		if (br->dev->flags & IFF_UP)
+		if (br->dev->flags & IFF_UP) {
+			spin_lock_bh(&br->lock);
 			br_stp_enable_port(p);
+			spin_unlock_bh(&br->lock);
+		}
 		break;
 
 	case NETDEV_UNREGISTER:
 		br_del_if(br, dev);
 		break;
 	}
-	spin_unlock_bh(&br->lock);
 
 	return NOTIFY_DONE;
 }
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 20462c1e4..d3cd71517 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -76,6 +76,7 @@ struct net_bridge_port
 	struct timer_list		forward_delay_timer;
 	struct timer_list		hold_timer;
 	struct timer_list		message_age_timer;
+	struct kobject			kobj;
 	struct rcu_head			rcu;
 };
 
@@ -110,6 +111,7 @@ struct net_bridge
 	struct timer_list		tcn_timer;
 	struct timer_list		topology_change_timer;
 	struct timer_list		gc_timer;
+	struct kobject			ifobj;
 };
 
 extern struct notifier_block br_device_notifier;
@@ -137,10 +139,8 @@ extern void br_fdb_delete_by_port(struct net_bridge *br,
 extern struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
 					unsigned char *addr);
 extern void br_fdb_put(struct net_bridge_fdb_entry *ent);
-extern int  br_fdb_get_entries(struct net_bridge *br,
-			unsigned char *_buf,
-			int maxnum,
-			int offset);
+extern int br_fdb_fillbuf(struct net_bridge *br, void *buf, 
+			  unsigned long count, unsigned long off);
 extern int br_fdb_insert(struct net_bridge *br,
 			 struct net_bridge_port *source,
 			 const unsigned char *addr,
@@ -168,22 +168,14 @@ extern int br_add_if(struct net_bridge *br,
 	      struct net_device *dev);
 extern int br_del_if(struct net_bridge *br,
 	      struct net_device *dev);
-extern int br_get_bridge_ifindices(int *indices,
-			    int num);
-extern void br_get_port_ifindices(struct net_bridge *br,
-			   int *ifindices, int num);
 
 /* br_input.c */
 extern int br_handle_frame_finish(struct sk_buff *skb);
 extern int br_handle_frame(struct sk_buff *skb);
 
 /* br_ioctl.c */
-extern int br_ioctl_device(struct net_bridge *br,
-			   unsigned int cmd,
-			   unsigned long arg0,
-			   unsigned long arg1,
-			   unsigned long arg2);
-extern int br_ioctl_deviceless_stub(unsigned long arg);
+extern int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+extern int br_ioctl_deviceless_stub(unsigned int cmd, void __user *arg);
 
 /* br_netfilter.c */
 extern int br_netfilter_init(void);
@@ -208,6 +200,7 @@ extern void br_stp_set_port_priority(struct net_bridge_port *p,
 				     u8 newprio);
 extern void br_stp_set_path_cost(struct net_bridge_port *p,
 				 u32 path_cost);
+extern ssize_t br_show_bridge_id(char *buf, const struct bridge_id *id);
 
 /* br_stp_bpdu.c */
 extern int br_stp_handle_bpdu(struct sk_buff *skb);
@@ -215,5 +208,30 @@ extern int br_stp_handle_bpdu(struct sk_buff *skb);
 /* br_stp_timer.c */
 extern void br_stp_timer_init(struct net_bridge *br);
 extern void br_stp_port_timer_init(struct net_bridge_port *p);
+extern unsigned long br_timer_value(const struct timer_list *timer);
+
+#ifdef CONFIG_SYSFS
+/* br_sysfs_if.c */
+extern int br_sysfs_addif(struct net_bridge_port *p);
+extern void br_sysfs_removeif(struct net_bridge_port *p);
+extern void br_sysfs_freeif(struct net_bridge_port *p);
+
+/* br_sysfs_br.c */
+extern struct subsystem bridge_subsys;
+extern void br_sysfs_init(void);
+extern void br_sysfs_fini(void);
+extern int br_sysfs_addbr(struct net_device *dev);
+extern void br_sysfs_delbr(struct net_device *dev);
+
+#else
+
+#define br_sysfs_addif(p)	(0)
+#define br_sysfs_removeif(p)	do { } while(0)
+#define br_sysfs_freeif(p)	kfree(p)
+#define br_sysfs_init()		do { } while(0)
+#define br_sysfs_fini()		do { } while(0)
+#define br_sysfs_addbr(dev)	(0)
+#define br_sysfs_delbr(dev)	do { } while(0)
+#endif /* CONFIG_SYSFS */
 
 #endif
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 80452970b..9e1d296b6 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -212,3 +212,11 @@ void br_stp_set_path_cost(struct net_bridge_port *p, u32 path_cost)
 	br_configuration_update(p->br);
 	br_port_state_selection(p->br);
 }
+
+ssize_t br_show_bridge_id(char *buf, const struct bridge_id *id)
+{
+	return sprintf(buf, "%.2x%.2x.%.2x%.2x%.2x%.2x%.2x%.2x\n",
+	       id->prio[0], id->prio[1],
+	       id->addr[0], id->addr[1], id->addr[2],
+	       id->addr[3], id->addr[4], id->addr[5]);
+}
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index 1f4983054..9bef55f56 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -14,6 +14,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/times.h>
 #include <linux/smp_lock.h>
 
 #include "br_private.h"
@@ -178,3 +179,10 @@ void br_stp_port_timer_init(struct net_bridge_port *p)
 	br_timer_init(&p->hold_timer, br_hold_timer_expired,
 		      (unsigned long) p);
 }	
+
+/* Report ticks left (in USER_HZ) used for API */
+unsigned long br_timer_value(const struct timer_list *timer)
+{
+	return timer_pending(timer)
+		? jiffies_to_clock_t(timer->expires - jiffies) : 0;
+}
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index f76563312..65184c5e6 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -902,7 +902,7 @@ static void get_counters(struct ebt_counter *oldcounters,
 }
 
 /* replace the table */
-static int do_replace(void *user, unsigned int len)
+static int do_replace(void __user *user, unsigned int len)
 {
 	int ret, i, countersize;
 	struct ebt_table_info *newinfo;
@@ -1217,7 +1217,7 @@ void ebt_unregister_table(struct ebt_table *table)
 }
 
 /* userspace just supplied us with counters */
-static int update_counters(void *user, unsigned int len)
+static int update_counters(void __user *user, unsigned int len)
 {
 	int i, ret;
 	struct ebt_counter *tmp;
@@ -1315,7 +1315,7 @@ static inline int ebt_make_names(struct ebt_entry *e, char *base, char *ubase)
 }
 
 /* called with ebt_mutex down */
-static int copy_everything_to_user(struct ebt_table *t, void *user,
+static int copy_everything_to_user(struct ebt_table *t, void __user *user,
    int *len, int cmd)
 {
 	struct ebt_replace tmp;
@@ -1391,7 +1391,7 @@ static int copy_everything_to_user(struct ebt_table *t, void *user,
 }
 
 static int do_ebt_set_ctl(struct sock *sk,
-	int cmd, void *user, unsigned int len)
+	int cmd, void __user *user, unsigned int len)
 {
 	int ret;
 
@@ -1408,7 +1408,7 @@ static int do_ebt_set_ctl(struct sock *sk,
 	return ret;
 }
 
-static int do_ebt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
+static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 {
 	int ret;
 	struct ebt_replace tmp;
diff --git a/net/compat.c b/net/compat.c
index 59937f595..998b21b65 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -29,7 +29,7 @@
 #include <net/compat.h>
 
 static inline int iov_from_user_compat_to_kern(struct iovec *kiov,
-					  struct compat_iovec *uiov32,
+					  struct compat_iovec __user *uiov32,
 					  int niov)
 {
 	int tot_len = 0;
@@ -53,7 +53,7 @@ static inline int iov_from_user_compat_to_kern(struct iovec *kiov,
 	return tot_len;
 }
 
-int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr *umsg)
+int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg)
 {
 	compat_uptr_t tmp1, tmp2, tmp3;
 
@@ -98,7 +98,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
 	}
 
 	tot_len = iov_from_user_compat_to_kern(kern_iov,
-					  (struct compat_iovec *)kern_msg->msg_iov,
+					  (struct compat_iovec __user *)kern_msg->msg_iov,
 					  kern_msg->msg_iovlen);
 	if(tot_len >= 0)
 		kern_msg->msg_iov = kern_iov;
@@ -112,7 +112,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
 #define CMSG_COMPAT_ALIGN(len)	ALIGN((len), sizeof(s32))
 
 #define CMSG_COMPAT_DATA(cmsg)				\
-	((void *)((char *)(cmsg) + CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr))))
+	((void __user *)((char __user *)(cmsg) + CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr))))
 #define CMSG_COMPAT_SPACE(len)				\
 	(CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)) + CMSG_COMPAT_ALIGN(len))
 #define CMSG_COMPAT_LEN(len)				\
@@ -120,20 +120,17 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
 
 #define CMSG_COMPAT_FIRSTHDR(msg)			\
 	(((msg)->msg_controllen) >= sizeof(struct compat_cmsghdr) ?	\
-	 (struct compat_cmsghdr *)((msg)->msg_control) :		\
-	 (struct compat_cmsghdr *)NULL)
+	 (struct compat_cmsghdr __user *)((msg)->msg_control) :		\
+	 (struct compat_cmsghdr __user *)NULL)
 
-static inline struct compat_cmsghdr *cmsg_compat_nxthdr(struct msghdr *msg,
-		struct compat_cmsghdr *cmsg, int cmsg_len)
+static inline struct compat_cmsghdr __user *cmsg_compat_nxthdr(struct msghdr *msg,
+		struct compat_cmsghdr __user *cmsg, int cmsg_len)
 {
-	struct compat_cmsghdr *ptr;
-
-	ptr = (struct compat_cmsghdr *)(((unsigned char *)cmsg) +
-			CMSG_COMPAT_ALIGN(cmsg_len));
-	if ((unsigned long)((char *)(ptr + 1) - (char *)msg->msg_control) >
+	char __user *ptr = (char __user *)cmsg + CMSG_COMPAT_ALIGN(cmsg_len);
+	if ((unsigned long)(ptr + 1 - (char __user *)msg->msg_control) >
 			msg->msg_controllen)
 		return NULL;
-	return ptr;
+	return (struct compat_cmsghdr __user *)ptr;
 }
 
 /* There is a lot of hair here because the alignment rules (and
@@ -143,7 +140,7 @@ static inline struct compat_cmsghdr *cmsg_compat_nxthdr(struct msghdr *msg,
 int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
 			       unsigned char *stackbuf, int stackbuf_size)
 {
-	struct compat_cmsghdr *ucmsg;
+	struct compat_cmsghdr __user *ucmsg;
 	struct cmsghdr *kcmsg, *kcmsg_base;
 	compat_size_t ucmlen;
 	__kernel_size_t kcmlen, tmp;
@@ -159,7 +156,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
 		if(CMSG_COMPAT_ALIGN(ucmlen) <
 		   CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)))
 			return -EINVAL;
-		if((unsigned long)(((char *)ucmsg - (char *)kmsg->msg_control)
+		if((unsigned long)(((char __user *)ucmsg - (char __user *)kmsg->msg_control)
 				   + ucmlen) > kmsg->msg_controllen)
 			return -EINVAL;
 
@@ -217,7 +214,7 @@ out_free_efault:
 int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *data)
 {
 	struct compat_timeval ctv;
-	struct compat_cmsghdr *cm = (struct compat_cmsghdr *) kmsg->msg_control;
+	struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
 	struct compat_cmsghdr cmhdr;
 	int cmlen;
 
@@ -255,17 +252,17 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
 
 void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
 {
-	struct compat_cmsghdr *cm = (struct compat_cmsghdr *) kmsg->msg_control;
+	struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
 	int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int);
 	int fdnum = scm->fp->count;
 	struct file **fp = scm->fp->fp;
-	int *cmfptr;
+	int __user *cmfptr;
 	int err = 0, i;
 
 	if (fdnum < fdmax)
 		fdmax = fdnum;
 
-	for (i = 0, cmfptr = (int *) CMSG_COMPAT_DATA(cm); i < fdmax; i++, cmfptr++) {
+	for (i = 0, cmfptr = (int __user *) CMSG_COMPAT_DATA(cm); i < fdmax; i++, cmfptr++) {
 		int new_fd;
 		err = get_unused_fd();
 		if (err < 0)
@@ -322,10 +319,10 @@ struct compat_ipt_replace {
 };
 
 static int do_netfilter_replace(int fd, int level, int optname,
-				char *optval, int optlen)
+				char __user *optval, int optlen)
 {
-	struct compat_ipt_replace *urepl = (struct compat_ipt_replace *)optval;
-	struct ipt_replace *repl_nat;
+	struct compat_ipt_replace __user *urepl;
+	struct ipt_replace __user *repl_nat;
 	char name[IPT_TABLE_MAXNAMELEN];
 	u32 origsize, tmp32, num_counters;
 	unsigned int repl_nat_size;
@@ -333,6 +330,7 @@ static int do_netfilter_replace(int fd, int level, int optname,
 	int i;
 	compat_uptr_t ucntrs;
 
+	urepl = (struct compat_ipt_replace __user *)optval;
 	if (get_user(origsize, &urepl->size))
 		return -EFAULT;
 
@@ -399,7 +397,7 @@ static int do_netfilter_replace(int fd, int level, int optname,
 
 
 	ret = sys_setsockopt(fd, level, optname,
-			     (char *)repl_nat, repl_nat_size);
+			     (char __user *)repl_nat, repl_nat_size);
 
 out:
 	return ret;
@@ -414,10 +412,10 @@ struct compat_sock_fprog {
 };
 
 static int do_set_attach_filter(int fd, int level, int optname,
-				char *optval, int optlen)
+				char __user *optval, int optlen)
 {
-	struct compat_sock_fprog *fprog32 = (struct compat_sock_fprog *)optval;
-	struct sock_fprog *kfprog = compat_alloc_user_space(sizeof(struct sock_fprog)); 
+	struct compat_sock_fprog __user *fprog32 = (struct compat_sock_fprog __user *)optval;
+	struct sock_fprog __user *kfprog = compat_alloc_user_space(sizeof(struct sock_fprog)); 
 	compat_uptr_t ptr;
 	u16 len;
 
@@ -429,13 +427,13 @@ static int do_set_attach_filter(int fd, int level, int optname,
 	    __put_user(compat_ptr(ptr), &kfprog->filter))
 		return -EFAULT;
 
-	return sys_setsockopt(fd, level, optname, (char *)kfprog, 
+	return sys_setsockopt(fd, level, optname, (char __user *)kfprog, 
 			      sizeof(struct sock_fprog));
 }
 
-static int do_set_sock_timeout(int fd, int level, int optname, char *optval, int optlen)
+static int do_set_sock_timeout(int fd, int level, int optname, char __user *optval, int optlen)
 {
-	struct compat_timeval *up = (struct compat_timeval *) optval;
+	struct compat_timeval __user *up = (struct compat_timeval __user *) optval;
 	struct timeval ktime;
 	mm_segment_t old_fs;
 	int err;
@@ -455,7 +453,7 @@ static int do_set_sock_timeout(int fd, int level, int optname, char *optval, int
 }
 
 asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
-				char *optval, int optlen)
+				char __user *optval, int optlen)
 {
 	if (optname == IPT_SO_SET_REPLACE)
 		return do_netfilter_replace(fd, level, optname,
@@ -469,14 +467,15 @@ asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
 	return sys_setsockopt(fd, level, optname, optval, optlen);
 }
 
-static int do_get_sock_timeout(int fd, int level, int optname, char *optval,
-		int *optlen)
+static int do_get_sock_timeout(int fd, int level, int optname,
+		char __user *optval, int __user *optlen)
 {
-	struct compat_timeval *up = (struct compat_timeval *) optval;
+	struct compat_timeval __user *up;
 	struct timeval ktime;
 	mm_segment_t old_fs;
 	int len, err;
 
+	up = (struct compat_timeval __user *) optval;
 	if (get_user(len, optlen))
 		return -EFAULT;
 	if (len < sizeof(*up))
@@ -498,7 +497,7 @@ static int do_get_sock_timeout(int fd, int level, int optname, char *optval,
 }
 
 asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
-				char *optval, int *optlen)
+				char __user *optval, int __user *optlen)
 {
 	if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO)
 		return do_get_sock_timeout(fd, level, optname, optval, optlen);
@@ -512,17 +511,17 @@ static unsigned char nas[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
 				AL(6),AL(2),AL(5),AL(5),AL(3),AL(3)};
 #undef AL
 
-asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr *msg, unsigned flags)
+asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags)
 {
-	return sys_sendmsg(fd, (struct msghdr *)msg, flags | MSG_CMSG_COMPAT);
+	return sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
 }
 
-asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr *msg, unsigned int flags)
+asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags)
 {
-	return sys_recvmsg(fd, (struct msghdr *)msg, flags | MSG_CMSG_COMPAT);
+	return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
 }
 
-asmlinkage long compat_sys_socketcall(int call, u32 *args)
+asmlinkage long compat_sys_socketcall(int call, u32 __user *args)
 {
 	int ret;
 	u32 a[6];
diff --git a/net/core/Makefile b/net/core/Makefile
index bb81a042b..a1a8ff3c2 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -6,9 +6,10 @@ obj-y := sock.o skbuff.o iovec.o datagram.o scm.o
 
 obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
 
-obj-y		     += flow.o dev.o ethtool.o net-sysfs.o dev_mcast.o dst.o \
+obj-y		     += flow.o dev.o ethtool.o dev_mcast.o dst.o \
 			neighbour.o rtnetlink.o utils.o link_watch.o filter.o
 
+obj-$(CONFIG_SYSFS) += net-sysfs.o
 obj-$(CONFIG_NETFILTER) += netfilter.o
 obj-$(CONFIG_NET_DIVERT) += dv.o
 obj-$(CONFIG_NET_PKTGEN) += pktgen.o
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 3471632b7..b422d9bda 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -202,7 +202,7 @@ void skb_free_datagram(struct sock *sk, struct sk_buff *skb)
 /*
  *	Copy a datagram to a linear buffer.
  */
-int skb_copy_datagram(const struct sk_buff *skb, int offset, char *to, int size)
+int skb_copy_datagram(const struct sk_buff *skb, int offset, char __user *to, int size)
 {
 	struct iovec iov = {
 		.iov_base = to,
@@ -297,7 +297,7 @@ fault:
 }
 
 int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
-			       u8 *to, int len, unsigned int *csump)
+			       u8 __user *to, int len, unsigned int *csump)
 {
 	int start = skb_headlen(skb);
 	int pos = 0;
diff --git a/net/core/dev.c b/net/core/dev.c
index 43c273e74..fb20e1047 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -220,9 +220,15 @@ int netdev_fastroute;
 int netdev_fastroute_obstacles;
 #endif
 
+#ifdef CONFIG_SYSFS
 extern int netdev_sysfs_init(void);
 extern int netdev_register_sysfs(struct net_device *);
-extern int netdev_unregister_sysfs(struct net_device *);
+extern void netdev_unregister_sysfs(struct net_device *);
+#else
+#define netdev_sysfs_init()	 	(0)
+#define netdev_register_sysfs(dev)	(0)
+#define	netdev_unregister_sysfs(dev)	do { } while(0)
+#endif
 
 
 /*******************************************************************************
@@ -785,13 +791,15 @@ int dev_alloc_name(struct net_device *dev, const char *name)
 /**
  *	dev_change_name - change name of a device
  *	@dev: device
- *	@name: name (or format string) must be at least IFNAMSIZ
+ *	@newname: name (or format string) must be at least IFNAMSIZ
  *
  *	Change name of a device, can pass format strings "eth%d".
  *	for wildcarding.
  */
 int dev_change_name(struct net_device *dev, char *newname)
 {
+	int err = 0;
+
 	ASSERT_RTNL();
 
 	if (dev->flags & IFF_UP)
@@ -801,7 +809,7 @@ int dev_change_name(struct net_device *dev, char *newname)
 		return -EINVAL;
 
 	if (strchr(newname, '%')) {
-		int err = dev_alloc_name(dev, newname);
+		err = dev_alloc_name(dev, newname);
 		if (err < 0)
 			return err;
 		strcpy(newname, dev->name);
@@ -811,12 +819,14 @@ int dev_change_name(struct net_device *dev, char *newname)
 	else
 		strlcpy(dev->name, newname, IFNAMSIZ);
 
-	hlist_del(&dev->name_hlist);
-	hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name));
+	err = class_device_rename(&dev->class_dev, dev->name);
+	if (!err) {
+		hlist_del(&dev->name_hlist);
+		hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name));
+		notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev);
+	}
 
-	class_device_rename(&dev->class_dev, dev->name);
-	notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev);
-	return 0;
+	return err;
 }
 
 /**
@@ -1170,28 +1180,46 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
 	rcu_read_unlock();
 }
 
-/* Calculate csum in the case, when packet is misrouted.
- * If it failed by some reason, ignore and send skb with wrong
- * checksum.
+/*
+ * Invalidate hardware checksum when packet is to be mangled, and
+ * complete checksum manually on outgoing path.
  */
-struct sk_buff *skb_checksum_help(struct sk_buff *skb)
+int skb_checksum_help(struct sk_buff **pskb, int inward)
 {
 	unsigned int csum;
-	int offset = skb->h.raw - skb->data;
+	int ret = 0, offset = (*pskb)->h.raw - (*pskb)->data;
+
+	if (inward) {
+		(*pskb)->ip_summed = CHECKSUM_NONE;
+		goto out;
+	}
+
+	if (skb_shared(*pskb)  || skb_cloned(*pskb)) {
+		struct sk_buff *newskb = skb_copy(*pskb, GFP_ATOMIC);
+		if (!newskb) {
+			ret = -ENOMEM;
+			goto out;
+		}
+		if ((*pskb)->sk)
+			skb_set_owner_w(newskb, (*pskb)->sk);
+		kfree_skb(*pskb);
+		*pskb = newskb;
+	}
 
-	if (offset > (int)skb->len)
+	if (offset > (int)(*pskb)->len)
 		BUG();
-	csum = skb_checksum(skb, offset, skb->len-offset, 0);
+	csum = skb_checksum(*pskb, offset, (*pskb)->len-offset, 0);
 
-	offset = skb->tail - skb->h.raw;
+	offset = (*pskb)->tail - (*pskb)->h.raw;
 	if (offset <= 0)
 		BUG();
-	if (skb->csum + 2 > offset)
+	if ((*pskb)->csum + 2 > offset)
 		BUG();
 
-	*(u16*)(skb->h.raw + skb->csum) = csum_fold(csum);
-	skb->ip_summed = CHECKSUM_NONE;
-	return skb;
+	*(u16*)((*pskb)->h.raw + (*pskb)->csum) = csum_fold(csum);
+	(*pskb)->ip_summed = CHECKSUM_NONE;
+out:	
+	return ret;
 }
 
 #ifdef CONFIG_HIGHMEM
@@ -1316,10 +1344,9 @@ int dev_queue_xmit(struct sk_buff *skb)
 	if (skb->ip_summed == CHECKSUM_HW &&
 	    (!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) &&
 	     (!(dev->features & NETIF_F_IP_CSUM) ||
-	      skb->protocol != htons(ETH_P_IP)))) {
-		if ((skb = skb_checksum_help(skb)) == NULL)
-			goto out;
-	}
+	      skb->protocol != htons(ETH_P_IP))))
+	      	if (skb_checksum_help(&skb, 0))
+	      		goto out_kfree_skb;
 
 	/* Grab device queue */
 	spin_lock_bh(&dev->queue_lock);
@@ -1948,7 +1975,7 @@ static int dev_ifconf(char __user *arg)
 {
 	struct ifconf ifc;
 	struct net_device *dev;
-	char *pos;
+	char __user *pos;
 	int len;
 	int total;
 	int i;
@@ -2515,6 +2542,8 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd)
 			    cmd == SIOCGMIIPHY ||
 			    cmd == SIOCGMIIREG ||
 			    cmd == SIOCSMIIREG ||
+			    cmd == SIOCBRADDIF ||
+			    cmd == SIOCBRDELIF ||
 			    cmd == SIOCWANDEV) {
 				err = -EOPNOTSUPP;
 				if (dev->do_ioctl) {
@@ -2669,6 +2698,8 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
 		case SIOCBONDSLAVEINFOQUERY:
 		case SIOCBONDINFOQUERY:
 		case SIOCBONDCHANGEACTIVE:
+		case SIOCBRADDIF:
+		case SIOCBRDELIF:
 			if (!capable(CAP_NET_ADMIN))
 				return -EPERM;
 			dev_load(ifr.ifr_name);
@@ -2963,16 +2994,20 @@ static DECLARE_MUTEX(net_todo_run_mutex);
 void netdev_run_todo(void)
 {
 	struct list_head list = LIST_HEAD_INIT(list);
+	int err;
 
-	/* Safe outside mutex since we only care about entries that
-	 * this cpu put into queue while under RTNL.
-	 */
-	if (list_empty(&net_todo_list))
-		return;
 
 	/* Need to guard against multiple cpu's getting out of order. */
 	down(&net_todo_run_mutex);
 
+	/* Not safe to do outside the semaphore.  We must not return
+	 * until all unregister events invoked by the local processor
+	 * have been completed (either by this todo run, or one on
+	 * another cpu).
+	 */
+	if (list_empty(&net_todo_list))
+		goto out;
+
 	/* Snapshot list, allow later requests */
 	spin_lock(&net_todo_list_lock);
 	list_splice_init(&net_todo_list, &list);
@@ -2985,7 +3020,10 @@ void netdev_run_todo(void)
 
 		switch(dev->reg_state) {
 		case NETREG_REGISTERING:
-			netdev_register_sysfs(dev);
+			err = netdev_register_sysfs(dev);
+			if (err)
+				printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
+				       dev->name, err);
 			dev->reg_state = NETREG_REGISTERED;
 			break;
 
@@ -3016,6 +3054,7 @@ void netdev_run_todo(void)
 		}
 	}
 
+out:
 	up(&net_todo_run_mutex);
 }
 
@@ -3029,6 +3068,7 @@ void netdev_run_todo(void)
  */
 void free_netdev(struct net_device *dev)
 {
+#ifdef CONFIG_SYSFS
 	/*  Compatiablity with error handling in drivers */
 	if (dev->reg_state == NETREG_UNINITIALIZED) {
 		kfree((char *)dev - dev->padded);
@@ -3040,6 +3080,9 @@ void free_netdev(struct net_device *dev)
 
 	/* will free via class release */
 	class_device_put(&dev->class_dev);
+#else
+	kfree((char *)dev - dev->padded);
+#endif
 }
  
 /* Synchronize with packet receive processing. */
diff --git a/net/core/dst.c b/net/core/dst.c
index ba4856ccd..571ef1f2c 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -100,15 +100,15 @@ out:
 	spin_unlock(&dst_lock);
 }
 
-static int dst_discard(struct sk_buff *skb)
+static int dst_discard_in(struct sk_buff *skb)
 {
 	kfree_skb(skb);
 	return 0;
 }
 
-static int dst_blackhole(struct sk_buff *skb)
+static int dst_discard_out(struct sk_buff **pskb)
 {
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	return 0;
 }
 
@@ -128,8 +128,8 @@ void * dst_alloc(struct dst_ops * ops)
 	dst->ops = ops;
 	dst->lastuse = jiffies;
 	dst->path = dst;
-	dst->input = dst_discard;
-	dst->output = dst_blackhole;
+	dst->input = dst_discard_in;
+	dst->output = dst_discard_out;
 #if RT_CACHE_DEBUG >= 2 
 	atomic_inc(&dst_total);
 #endif
@@ -143,8 +143,8 @@ static void ___dst_free(struct dst_entry * dst)
 	   protocol module is unloaded.
 	 */
 	if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) {
-		dst->input = dst_discard;
-		dst->output = dst_blackhole;
+		dst->input = dst_discard_in;
+		dst->output = dst_discard_out;
 	}
 	dst->obsolete = 2;
 }
@@ -228,20 +228,22 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
 				   _race_ _condition_.
 				 */
 				if (event!=NETDEV_DOWN &&
-				    dst->output == dst_blackhole) {
+				    dst->output == dst_discard_out) {
 					dst->dev = &loopback_dev;
-					dev_put(dev);
 					dev_hold(&loopback_dev);
-					dst->output = dst_discard;
+					dev_put(dev);
+					dst->output = dst_discard_out;
 					if (dst->neighbour && dst->neighbour->dev == dev) {
 						dst->neighbour->dev = &loopback_dev;
 						dev_put(dev);
 						dev_hold(&loopback_dev);
 					}
 				} else {
-					dst->input = dst_discard;
-					dst->output = dst_blackhole;
+					dst->input = dst_discard_in;
+					dst->output = dst_discard_out;
 				}
+				if (dst->ops->ifdown)
+					dst->ops->ifdown(dst, event != NETDEV_DOWN);
 			}
 		}
 		spin_unlock_bh(&dst_lock);
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 9925b8160..d996db798 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -650,8 +650,9 @@ static int ethtool_get_stats(struct net_device *dev, void __user *useraddr)
 int dev_ethtool(struct ifreq *ifr)
 {
 	struct net_device *dev = __dev_get_by_name(ifr->ifr_name);
-	void __user *useraddr = (void __user *) ifr->ifr_data;
+	void __user *useraddr = ifr->ifr_data;
 	u32 ethcmd;
+	int rc;
 
 	/*
 	 * XXX: This can be pushed down into the ethtool_* handlers that
@@ -669,70 +670,109 @@ int dev_ethtool(struct ifreq *ifr)
 	if (copy_from_user(&ethcmd, useraddr, sizeof (ethcmd)))
 		return -EFAULT;
 
+	if(dev->ethtool_ops->begin)
+		if ((rc = dev->ethtool_ops->begin(dev)) < 0)
+			return rc;
+
 	switch (ethcmd) {
 	case ETHTOOL_GSET:
-		return ethtool_get_settings(dev, useraddr);
+		rc = ethtool_get_settings(dev, useraddr);
+		break;
 	case ETHTOOL_SSET:
-		return ethtool_set_settings(dev, useraddr);
+		rc = ethtool_set_settings(dev, useraddr);
+		break;
 	case ETHTOOL_GDRVINFO:
-		return ethtool_get_drvinfo(dev, useraddr);
+		rc = ethtool_get_drvinfo(dev, useraddr);
+
+		break;
 	case ETHTOOL_GREGS:
-		return ethtool_get_regs(dev, useraddr);
+		rc = ethtool_get_regs(dev, useraddr);
+		break;
 	case ETHTOOL_GWOL:
-		return ethtool_get_wol(dev, useraddr);
+		rc = ethtool_get_wol(dev, useraddr);
+		break;
 	case ETHTOOL_SWOL:
-		return ethtool_set_wol(dev, useraddr);
+		rc = ethtool_set_wol(dev, useraddr);
+		break;
 	case ETHTOOL_GMSGLVL:
-		return ethtool_get_msglevel(dev, useraddr);
+		rc = ethtool_get_msglevel(dev, useraddr);
+		break;
 	case ETHTOOL_SMSGLVL:
-		return ethtool_set_msglevel(dev, useraddr);
+		rc = ethtool_set_msglevel(dev, useraddr);
+		break;
 	case ETHTOOL_NWAY_RST:
-		return ethtool_nway_reset(dev);
+		rc = ethtool_nway_reset(dev);
+		break;
 	case ETHTOOL_GLINK:
-		return ethtool_get_link(dev, useraddr);
+		rc = ethtool_get_link(dev, useraddr);
+		break;
 	case ETHTOOL_GEEPROM:
-		return ethtool_get_eeprom(dev, useraddr);
+		rc = ethtool_get_eeprom(dev, useraddr);
+		break;
 	case ETHTOOL_SEEPROM:
-		return ethtool_set_eeprom(dev, useraddr);
+		rc = ethtool_set_eeprom(dev, useraddr);
+		break;
 	case ETHTOOL_GCOALESCE:
-		return ethtool_get_coalesce(dev, useraddr);
+		rc = ethtool_get_coalesce(dev, useraddr);
+		break;
 	case ETHTOOL_SCOALESCE:
-		return ethtool_set_coalesce(dev, useraddr);
+		rc = ethtool_set_coalesce(dev, useraddr);
+		break;
 	case ETHTOOL_GRINGPARAM:
-		return ethtool_get_ringparam(dev, useraddr);
+		rc = ethtool_get_ringparam(dev, useraddr);
+		break;
 	case ETHTOOL_SRINGPARAM:
-		return ethtool_set_ringparam(dev, useraddr);
+		rc = ethtool_set_ringparam(dev, useraddr);
+		break;
 	case ETHTOOL_GPAUSEPARAM:
-		return ethtool_get_pauseparam(dev, useraddr);
+		rc = ethtool_get_pauseparam(dev, useraddr);
+		break;
 	case ETHTOOL_SPAUSEPARAM:
-		return ethtool_set_pauseparam(dev, useraddr);
+		rc = ethtool_set_pauseparam(dev, useraddr);
+		break;
 	case ETHTOOL_GRXCSUM:
-		return ethtool_get_rx_csum(dev, useraddr);
+		rc = ethtool_get_rx_csum(dev, useraddr);
+		break;
 	case ETHTOOL_SRXCSUM:
-		return ethtool_set_rx_csum(dev, useraddr);
+		rc = ethtool_set_rx_csum(dev, useraddr);
+		break;
 	case ETHTOOL_GTXCSUM:
-		return ethtool_get_tx_csum(dev, useraddr);
+		rc = ethtool_get_tx_csum(dev, useraddr);
+		break;
 	case ETHTOOL_STXCSUM:
-		return ethtool_set_tx_csum(dev, useraddr);
+		rc = ethtool_set_tx_csum(dev, useraddr);
+		break;
 	case ETHTOOL_GSG:
-		return ethtool_get_sg(dev, useraddr);
+		rc = ethtool_get_sg(dev, useraddr);
+		break;
 	case ETHTOOL_SSG:
-		return ethtool_set_sg(dev, useraddr);
+		rc = ethtool_set_sg(dev, useraddr);
+		break;
 	case ETHTOOL_GTSO:
-		return ethtool_get_tso(dev, useraddr);
+		rc = ethtool_get_tso(dev, useraddr);
+		break;
 	case ETHTOOL_STSO:
-		return ethtool_set_tso(dev, useraddr);
+		rc = ethtool_set_tso(dev, useraddr);
+		break;
 	case ETHTOOL_TEST:
-		return ethtool_self_test(dev, useraddr);
+		rc = ethtool_self_test(dev, useraddr);
+		break;
 	case ETHTOOL_GSTRINGS:
-		return ethtool_get_strings(dev, useraddr);
+		rc = ethtool_get_strings(dev, useraddr);
+		break;
 	case ETHTOOL_PHYS_ID:
-		return ethtool_phys_id(dev, useraddr);
+		rc = ethtool_phys_id(dev, useraddr);
+		break;
 	case ETHTOOL_GSTATS:
-		return ethtool_get_stats(dev, useraddr);
+		rc = ethtool_get_stats(dev, useraddr);
+		break;
 	default:
-		return -EOPNOTSUPP;
+		rc =  -EOPNOTSUPP;
 	}
+	
+	if(dev->ethtool_ops->complete)
+		dev->ethtool_ops->complete(dev);
+	return rc;
 
  ioctl:
 	if (dev->do_ioctl)
diff --git a/net/core/iovec.c b/net/core/iovec.c
index 587f93357..89de9355d 100644
--- a/net/core/iovec.c
+++ b/net/core/iovec.c
@@ -157,7 +157,7 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset,
 	}
 
 	while (len > 0) {
-		u8 *base = iov->iov_base + offset;
+		u8 __user *base = iov->iov_base + offset;
 		int copy = min_t(unsigned int, len, iov->iov_len - offset);
 
 		offset = 0;
@@ -192,7 +192,7 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
 	}
 
 	while (len > 0) {
-		u8 *base = iov->iov_base + offset;
+		u8 __user *base = iov->iov_base + offset;
 		int copy = min_t(unsigned int, len, iov->iov_len - offset);
 
 		offset = 0;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 5720ca0d6..16baf92f6 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -20,9 +20,9 @@
 #define to_class_dev(obj) container_of(obj,struct class_device,kobj)
 #define to_net_dev(class) container_of(class, struct net_device, class_dev)
 
-static const char *fmt_hex = "%#x\n";
-static const char *fmt_dec = "%d\n";
-static const char *fmt_ulong = "%lu\n";
+static const char fmt_hex[] = "%#x\n";
+static const char fmt_dec[] = "%d\n";
+static const char fmt_ulong[] = "%lu\n";
 
 static inline int dev_isalive(const struct net_device *dev) 
 {
diff --git a/net/core/netfilter.c b/net/core/netfilter.c
index 3aabe124d..58632d189 100644
--- a/net/core/netfilter.c
+++ b/net/core/netfilter.c
@@ -286,7 +286,7 @@ void nf_debug_ip_finish_output2(struct sk_buff *skb)
 
 /* Call get/setsockopt() */
 static int nf_sockopt(struct sock *sk, int pf, int val, 
-		      char *opt, int *len, int get)
+		      char __user *opt, int *len, int get)
 {
 	struct list_head *i;
 	struct nf_sockopt_ops *ops;
@@ -329,13 +329,13 @@ static int nf_sockopt(struct sock *sk, int pf, int val,
 	return ret;
 }
 
-int nf_setsockopt(struct sock *sk, int pf, int val, char *opt,
+int nf_setsockopt(struct sock *sk, int pf, int val, char __user *opt,
 		  int len)
 {
 	return nf_sockopt(sk, pf, val, opt, &len, 0);
 }
 
-int nf_getsockopt(struct sock *sk, int pf, int val, char *opt, int *len)
+int nf_getsockopt(struct sock *sk, int pf, int val, char __user *opt, int *len)
 {
 	return nf_sockopt(sk, pf, val, opt, len, 1);
 }
@@ -504,14 +504,6 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
 	unsigned int verdict;
 	int ret = 0;
 
-	if (skb->ip_summed == CHECKSUM_HW) {
-		if (outdev == NULL) {
-			skb->ip_summed = CHECKSUM_NONE;
-		} else {
-			skb_checksum_help(skb);
-		}
-	}
-
 	/* We may already have this, but read-locks nest anyway */
 	rcu_read_lock();
 
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 2f0115eef..4115945f3 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -623,7 +623,7 @@ void netpoll_cleanup(struct netpoll *np)
 	np->dev = 0;
 }
 
-int netpoll_trap()
+int netpoll_trap(void)
 {
 	return trapped;
 }
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b1b450cfd..3821caa36 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -870,7 +870,7 @@ static int proc_read(char *buf , char **start, off_t offset,
 	return p - buf;
 }
 
-static int count_trail_chars(const char *user_buffer, unsigned int maxlen)
+static int count_trail_chars(const char __user *user_buffer, unsigned int maxlen)
 {
 	int i;
 
@@ -895,7 +895,7 @@ done:
 	return i;
 }
 
-static unsigned long num_arg(const char *user_buffer, unsigned long maxlen,
+static unsigned long num_arg(const char __user *user_buffer, unsigned long maxlen,
 			     unsigned long *num)
 {
 	int i = 0;
@@ -916,7 +916,7 @@ static unsigned long num_arg(const char *user_buffer, unsigned long maxlen,
 	return i;
 }
 
-static int strn_len(const char *user_buffer, unsigned int maxlen)
+static int strn_len(const char __user *user_buffer, unsigned int maxlen)
 {
 	int i = 0;
 
@@ -940,7 +940,7 @@ done_str:
 	return i;
 }
 
-static int proc_write(struct file *file, const char *user_buffer,
+static int proc_write(struct file *file, const char __user *user_buffer,
 			 unsigned long count, void *data)
 {
 	int i = 0, max, len;
diff --git a/net/core/scm.c b/net/core/scm.c
index bba5c5895..3699df388 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -169,7 +169,7 @@ error:
 
 int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
 {
-	struct cmsghdr *cm = (struct cmsghdr*)msg->msg_control;
+	struct cmsghdr __user *cm = (struct cmsghdr __user *)msg->msg_control;
 	struct cmsghdr cmhdr;
 	int cmlen = CMSG_LEN(len);
 	int err;
@@ -204,16 +204,18 @@ out:
 
 void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
 {
-	struct cmsghdr *cm = (struct cmsghdr*)msg->msg_control;
+	struct cmsghdr __user *cm = (struct cmsghdr __user*)msg->msg_control;
 
 	int fdmax = 0;
 	int fdnum = scm->fp->count;
 	struct file **fp = scm->fp->fp;
-	int *cmfptr;
+	int __user *cmfptr;
 	int err = 0, i;
 
-	if (MSG_CMSG_COMPAT & msg->msg_flags)
-		return scm_detach_fds_compat(msg, scm);
+	if (MSG_CMSG_COMPAT & msg->msg_flags) {
+		scm_detach_fds_compat(msg, scm);
+		return;
+	}
 
 	if (msg->msg_controllen > sizeof(struct cmsghdr))
 		fdmax = ((msg->msg_controllen - sizeof(struct cmsghdr))
@@ -222,7 +224,7 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
 	if (fdnum < fdmax)
 		fdmax = fdnum;
 
-	for (i=0, cmfptr=(int*)CMSG_DATA(cm); i<fdmax; i++, cmfptr++)
+	for (i=0, cmfptr=(int __user *)CMSG_DATA(cm); i<fdmax; i++, cmfptr++)
 	{
 		int new_fd;
 		err = security_file_receive(fp[i]);
diff --git a/net/core/sock.c b/net/core/sock.c
index 92bc77ad6..289f5824e 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -917,6 +917,31 @@ void __release_sock(struct sock *sk)
 	} while((skb = sk->sk_backlog.head) != NULL);
 }
 
+/**
+ * sk_wait_data - wait for data to arrive at sk_receive_queue
+ * sk - sock to wait on
+ * timeo - for how long
+ *
+ * Now socket state including sk->sk_err is changed only under lock,
+ * hence we may omit checks after joining wait queue.
+ * We check receive queue before schedule() only as optimization;
+ * it is very likely that release_sock() added new data.
+ */
+int sk_wait_data(struct sock *sk, long *timeo)
+{
+	int rc;
+	DEFINE_WAIT(wait);
+
+	prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
+	set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
+	rc = sk_wait_event(sk, timeo, !skb_queue_empty(&sk->sk_receive_queue));
+	clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
+	finish_wait(sk->sk_sleep, &wait);
+	return rc;
+}
+
+EXPORT_SYMBOL(sk_wait_data);
+
 /*
  * Set of default routines for initialising struct proto_ops when
  * the protocol does not support a particular function. In certain
@@ -1099,6 +1124,23 @@ void sk_send_sigurg(struct sock *sk)
 			sk_wake_async(sk, 3, POLL_PRI);
 }
 
+void sk_reset_timer(struct sock *sk, struct timer_list* timer,
+		    unsigned long expires)
+{
+	if (!mod_timer(timer, expires))
+		sock_hold(sk);
+}
+
+EXPORT_SYMBOL(sk_reset_timer);
+
+void sk_stop_timer(struct sock *sk, struct timer_list* timer)
+{
+	if (timer_pending(timer) && del_timer(timer))
+		__sock_put(sk);
+}
+
+EXPORT_SYMBOL(sk_stop_timer);
+
 void sock_init_data(struct socket *sock, struct sock *sk)
 {
 	skb_queue_head_init(&sk->sk_receive_queue);
@@ -1172,7 +1214,7 @@ EXPORT_SYMBOL(release_sock);
 /* When > 0 there are consumers of rx skb time stamps */
 atomic_t netstamp_needed = ATOMIC_INIT(0); 
 
-int sock_get_timestamp(struct sock *sk, struct timeval *userstamp)
+int sock_get_timestamp(struct sock *sk, struct timeval __user *userstamp)
 { 
 	if (!sock_flag(sk, SOCK_TIMESTAMP))
 		sock_enable_timestamp(sk);
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index e0d5284a7..c08a80fd3 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -155,8 +155,8 @@ static rwlock_t dn_hash_lock = RW_LOCK_UNLOCKED;
 static struct hlist_head dn_sk_hash[DN_SK_HASH_SIZE];
 static struct hlist_head dn_wild_sk;
 
-static int __dn_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen, int flags);
-static int __dn_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen, int flags);
+static int __dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen, int flags);
+static int __dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen, int flags);
 
 static struct hlist_head *dn_find_list(struct sock *sk)
 {
@@ -1212,7 +1212,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	{
 	case SIOCGIFADDR:
 	case SIOCSIFADDR:
-		return dn_dev_ioctl(cmd, (void *)arg);
+		return dn_dev_ioctl(cmd, (void __user *)arg);
 
 	case SIOCATMARK:
 		lock_sock(sk);
@@ -1226,7 +1226,7 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 		if (amount < 0)
 			amount = 0;
-		err = put_user(amount, (int *)arg);
+		err = put_user(amount, (int __user *)arg);
 		break;
 
 	case TIOCINQ:
@@ -1244,11 +1244,11 @@ static int dn_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			}
 		}
 		release_sock(sk);
-		err = put_user(amount, (int *)arg);
+		err = put_user(amount, (int __user *)arg);
 		break;
 
 	default:
-		err = dev_ioctl(cmd, (void *)arg);
+		err = dev_ioctl(cmd, (void __user *)arg);
 		break;
 	}
 
@@ -1313,7 +1313,7 @@ out:
 	return err;
 }
 
-static int dn_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
+static int dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	int err;
@@ -1325,7 +1325,7 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char *optv
 	return err;
 }
 
-static int __dn_setsockopt(struct socket *sock, int level,int optname, char *optval, int optlen, int flags) 
+static int __dn_setsockopt(struct socket *sock, int level,int optname, char __user *optval, int optlen, int flags) 
 {
 	struct	sock *sk = sock->sk;
 	struct dn_scp *scp = DN_SK(sk);
@@ -1490,7 +1490,7 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char *opt
 	return 0;
 }
 
-static int dn_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
+static int dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	int err;
@@ -1502,7 +1502,7 @@ static int dn_getsockopt(struct socket *sock, int level, int optname, char *optv
 	return err;
 }
 
-static int __dn_getsockopt(struct socket *sock, int level,int optname, char *optval,int *optlen, int flags)
+static int __dn_getsockopt(struct socket *sock, int level,int optname, char __user *optval,int __user *optlen, int flags)
 {
 	struct	sock *sk = sock->sk;
 	struct dn_scp *scp = DN_SK(sk);
@@ -1905,7 +1905,7 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock,
 	unsigned char fctype;
 	long timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
 
-	if (flags & ~(MSG_TRYHARD|MSG_OOB|MSG_DONTWAIT|MSG_EOR|MSG_NOSIGNAL|MSG_MORE))
+	if (flags & ~(MSG_TRYHARD|MSG_OOB|MSG_DONTWAIT|MSG_EOR|MSG_NOSIGNAL|MSG_MORE|MSG_CMSG_COMPAT))
 		return -EOPNOTSUPP;
 
 	if (addr_len && (addr_len != sizeof(struct sockaddr_dn)))
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index bc27c4efd..6b6e49a9e 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -161,10 +161,10 @@ static int min_priority[1];
 static int max_priority[] = { 127 }; /* From DECnet spec */
 
 static int dn_forwarding_proc(ctl_table *, int, struct file *,
-			void *, size_t *);
-static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen,
-			void *oldval, size_t *oldlenp,
-			void *newval, size_t newlen,
+			void __user *, size_t *);
+static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
+			void __user *oldval, size_t __user *oldlenp,
+			void __user *newval, size_t newlen,
 			void **context);
 
 static struct dn_dev_sysctl_table {
@@ -362,7 +362,7 @@ static void dn_dev_check_default(struct net_device *dev)
 
 static int dn_forwarding_proc(ctl_table *table, int write, 
 				struct file *filep,
-				void *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp)
 {
 #ifdef CONFIG_DECNET_ROUTER
 	struct net_device *dev = table->extra1;
@@ -404,9 +404,9 @@ static int dn_forwarding_proc(ctl_table *table, int write,
 #endif
 }
 
-static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen,
-			void *oldval, size_t *oldlenp,
-			void *newval, size_t newlen,
+static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
+			void __user *oldval, size_t __user *oldlenp,
+			void __user *newval, size_t newlen,
 			void **context)
 {
 #ifdef CONFIG_DECNET_ROUTER
@@ -423,7 +423,7 @@ static int dn_forwarding_sysctl(ctl_table *table, int *name, int nlen,
 		if (newlen != sizeof(int))
 			return -EINVAL;
 
-		if (get_user(value, (int *)newval))
+		if (get_user(value, (int __user *)newval))
 			return -EFAULT;
 		if (value < 0)
 			return -EINVAL;
@@ -553,7 +553,7 @@ static int dn_dev_set_ifa(struct net_device *dev, struct dn_ifaddr *ifa)
 }
 
 
-int dn_dev_ioctl(unsigned int cmd, void *arg)
+int dn_dev_ioctl(unsigned int cmd, void __user *arg)
 {
 	char buffer[DN_IFREQ_SIZE];
 	struct ifreq *ifr = (struct ifreq *)buffer;
@@ -1294,35 +1294,43 @@ int unregister_dnaddr_notifier(struct notifier_block *nb)
  * it as a compile time option. Probably you should use the
  * rtnetlink interface instead.
  */
-int dnet_gifconf(struct net_device *dev, char *buf, int len)
+int dnet_gifconf(struct net_device *dev, char __user *buf, int len)
 {
 	struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr;
 	struct dn_ifaddr *ifa;
-	struct ifreq *ifr = (struct ifreq *)buf;
+	char buffer[DN_IFREQ_SIZE];
+	struct ifreq *ifr = (struct ifreq *)buffer;
+	struct sockaddr_dn *addr = (struct sockaddr_dn *)&ifr->ifr_addr;
 	int done = 0;
 
 	if ((dn_db == NULL) || ((ifa = dn_db->ifa_list) == NULL))
 		return 0;
 
 	for(; ifa; ifa = ifa->ifa_next) {
-		if (!ifr) {
+		if (!buf) {
 			done += sizeof(DN_IFREQ_SIZE);
 			continue;
 		}
 		if (len < DN_IFREQ_SIZE)
 			return done;
-		memset(ifr, 0, DN_IFREQ_SIZE);
+		memset(buffer, 0, DN_IFREQ_SIZE);
 
 		if (ifa->ifa_label)
 			strcpy(ifr->ifr_name, ifa->ifa_label);
 		else
 			strcpy(ifr->ifr_name, dev->name);
 
-		(*(struct sockaddr_dn *) &ifr->ifr_addr).sdn_family = AF_DECnet;
-		(*(struct sockaddr_dn *) &ifr->ifr_addr).sdn_add.a_len = 2;
-		(*(dn_address *)(*(struct sockaddr_dn *) &ifr->ifr_addr).sdn_add.a_addr) = ifa->ifa_local;
+		addr->sdn_family = AF_DECnet;
+		addr->sdn_add.a_len = 2;
+		memcpy(addr->sdn_add.a_addr, &ifa->ifa_local,
+			sizeof(dn_address));
+
+		if (copy_to_user(buf, buffer, DN_IFREQ_SIZE)) {
+			done = -EFAULT;
+			break;
+		}
 
-		ifr = (struct ifreq *)((char *)ifr + DN_IFREQ_SIZE);
+		buf  += DN_IFREQ_SIZE;
 		len  -= DN_IFREQ_SIZE;
 		done += DN_IFREQ_SIZE;
 	}
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index d9628dbef..90d0583f5 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -684,8 +684,9 @@ out:
 	return NET_RX_DROP;
 }
 
-static int dn_output(struct sk_buff *skb)
+static int dn_output(struct sk_buff **pskb)
 {
+	struct sk_buff *skb = *pskb;
 	struct dst_entry *dst = skb->dst;
 	struct dn_route *rt = (struct dn_route *)dst;
 	struct net_device *dev = dst->dev;
@@ -796,6 +797,11 @@ static int dn_rt_bug(struct sk_buff *skb)
 	return NET_RX_BAD;
 }
 
+static int dn_rt_bug_out(struct sk_buff **pskb)
+{
+	return dn_rt_bug(*pskb);
+}
+
 static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res)
 {
 	struct dn_fib_info *fi = res->fi;
@@ -1387,7 +1393,7 @@ make_route:
 	rt->u.dst.neighbour = neigh;
 	rt->u.dst.dev = out_dev;
 	rt->u.dst.lastuse = jiffies;
-	rt->u.dst.output = dn_rt_bug;
+	rt->u.dst.output = dn_rt_bug_out;
 	switch(res.type) {
 		case RTN_UNICAST:
 			rt->u.dst.input = dn_forward;
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index 1c692b40e..65ce3bb95 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -127,9 +127,9 @@ static int parse_addr(dn_address *addr, char *str)
 }
 
 
-static int dn_node_address_strategy(ctl_table *table, int *name, int nlen,
-				void *oldval, size_t *oldlenp,
-				void *newval, size_t newlen,
+static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen,
+				void __user *oldval, size_t __user *oldlenp,
+				void __user *newval, size_t newlen,
 				void **context)
 {
 	size_t len;
@@ -141,14 +141,14 @@ static int dn_node_address_strategy(ctl_table *table, int *name, int nlen,
 		if (len) {
 			if (len != sizeof(unsigned short))
 				return -EINVAL;
-			if (put_user(decnet_address, (unsigned short *)oldval))
+			if (put_user(decnet_address, (unsigned short __user *)oldval))
 				return -EFAULT;
 		}
 	}
 	if (newval && newlen) {
 		if (newlen != sizeof(unsigned short))
 			return -EINVAL;
-		if (get_user(addr, (unsigned short *)newval))
+		if (get_user(addr, (unsigned short __user *)newval))
 			return -EFAULT;
 
 		dn_dev_devices_off();
@@ -162,7 +162,7 @@ static int dn_node_address_strategy(ctl_table *table, int *name, int nlen,
 
 static int dn_node_address_handler(ctl_table *table, int write, 
 				struct file *filp,
-				void *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp)
 {
 	char addr[DN_ASCBUF_LEN];
 	size_t len;
@@ -212,9 +212,9 @@ static int dn_node_address_handler(ctl_table *table, int write,
 }
 
 
-static int dn_def_dev_strategy(ctl_table *table, int *name, int nlen,
-				void *oldval, size_t *oldlenp,
-				void *newval, size_t newlen,
+static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen,
+				void __user *oldval, size_t __user *oldlenp,
+				void __user *newval, size_t newlen,
 				void **context)
 {
 	size_t len;
@@ -273,7 +273,7 @@ static int dn_def_dev_strategy(ctl_table *table, int *name, int nlen,
 
 static int dn_def_dev_handler(ctl_table *table, int write, 
 				struct file * filp,
-				void *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp)
 {
 	size_t len;
 	struct net_device *dev;
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index b503ae3b4..ce383ad75 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -274,8 +274,8 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
 	 *	Check the flags. 
 	 */
 
-	if (msg->msg_flags&~MSG_DONTWAIT) 
-		return(-EINVAL);
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT)) 
+		return -EINVAL;
 
 	/*
 	 *	Get and verify the address. 
@@ -418,10 +418,18 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
 
 	/* tack our header on the front of the iovec */
 	size = sizeof(struct aunhdr);
+	/*
+	 * XXX: that is b0rken.  We can't mix userland and kernel pointers
+	 * in iovec, since on a lot of platforms copy_from_user() will
+	 * *not* work with the kernel and userland ones at the same time,
+	 * regardless of what we do with set_fs().  And we are talking about
+	 * econet-over-ethernet here, so "it's only ARM anyway" doesn't
+	 * apply.  Any suggestions on fixing that code?		-- AV
+	 */
 	iov[0].iov_base = (void *)&ah;
 	iov[0].iov_len = size;
 	for (i = 0; i < msg->msg_iovlen; i++) {
-		void *base = msg->msg_iov[i].iov_base;
+		void __user *base = msg->msg_iov[i].iov_base;
 		size_t len = msg->msg_iov[i].iov_len;
 		/* Check it now since we switch to KERNEL_DS later. */
 		if ((err = verify_area(VERIFY_READ, base, len)) < 0)
@@ -589,7 +597,7 @@ out:
  *	Handle Econet specific ioctls
  */
 
-static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void *arg)
+static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
 {
 	struct ifreq ifr;
 	struct ec_device *edev;
@@ -662,18 +670,19 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void *arg)
 static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
+	void __user *argp = (void __user *)arg;
 
 	switch(cmd) {
 		case SIOCGSTAMP:
-			return sock_get_timestamp(sk,(struct timeval *)arg);
+			return sock_get_timestamp(sk, argp);
 
 		case SIOCSIFADDR:
 		case SIOCGIFADDR:
-			return ec_dev_ioctl(sock, cmd, (void *)arg);
+			return ec_dev_ioctl(sock, cmd, argp);
 			break;
 
 		default:
-			return dev_ioctl(cmd,(void *) arg);
+			return dev_ioctl(cmd, argp);
 	}
 	/*NOTREACHED*/
 	return 0;
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index edf457090..8b14637aa 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -216,7 +216,7 @@ void inet_sock_release(struct sock *sk)
  *	Set socket options on an inet socket.
  */
 int inet_setsockopt(struct socket *sock, int level, int optname,
-		    char *optval, int optlen)
+		    char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 
@@ -232,7 +232,7 @@ int inet_setsockopt(struct socket *sock, int level, int optname,
  */
 
 int inet_getsockopt(struct socket *sock, int level, int optname,
-		    char *optval, int *optlen)
+		    char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 
@@ -843,7 +843,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 
 	switch (cmd) {
 		case SIOCGSTAMP:
-			err = sock_get_timestamp(sk, (struct timeval *)arg);
+			err = sock_get_timestamp(sk, (struct timeval __user *)arg);
 			break;
 		case SIOCADDRT:
 		case SIOCDELRT:
@@ -853,7 +853,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCDARP:
 		case SIOCGARP:
 		case SIOCSARP:
-			err = arp_ioctl(cmd, (void *)arg);
+			err = arp_ioctl(cmd, (void __user *)arg);
 			break;
 		case SIOCGIFADDR:
 		case SIOCSIFADDR:
@@ -866,13 +866,13 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCSIFPFLAGS:
 		case SIOCGIFPFLAGS:
 		case SIOCSIFFLAGS:
-			err = devinet_ioctl(cmd, (void *)arg);
+			err = devinet_ioctl(cmd, (void __user *)arg);
 			break;
 		default:
 			if (!sk->sk_prot->ioctl ||
 			    (err = sk->sk_prot->ioctl(sk, cmd, arg)) ==
 			    					-ENOIOCTLCMD)
-				err = dev_ioctl(cmd, (void *)arg);
+				err = dev_ioctl(cmd, (void __user *)arg);
 			break;
 	}
 	return err;
@@ -978,7 +978,7 @@ void inet_register_protosw(struct inet_protosw *p)
 
 	spin_lock_bh(&inetsw_lock);
 
-	if (p->type > SOCK_MAX)
+	if (p->type >= SOCK_MAX)
 		goto out_illegal;
 
 	/* If we are trying to override a permanent protocol, bail. */
@@ -1066,8 +1066,8 @@ static int __init init_ipv4_mibs(void)
 {
 	net_statistics[0] = alloc_percpu(struct linux_mib);
 	net_statistics[1] = alloc_percpu(struct linux_mib);
-	ip_statistics[0] = alloc_percpu(struct ip_mib);
-	ip_statistics[1] = alloc_percpu(struct ip_mib);
+	ip_statistics[0] = alloc_percpu(struct ipstats_mib);
+	ip_statistics[1] = alloc_percpu(struct ipstats_mib);
 	icmp_statistics[0] = alloc_percpu(struct icmp_mib);
 	icmp_statistics[1] = alloc_percpu(struct icmp_mib);
 	tcp_statistics[0] = alloc_percpu(struct tcp_mib);
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index d3395b048..0d62398f7 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -54,10 +54,10 @@ static int ip_clear_mutable_options(struct iphdr *iph, u32 *daddr)
 	return 0;
 }
 
-static int ah_output(struct sk_buff *skb)
+static int ah_output(struct sk_buff **pskb)
 {
 	int err;
-	struct dst_entry *dst = skb->dst;
+	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
 	struct iphdr *iph, *top_iph;
 	struct ip_auth_hdr *ah;
@@ -67,23 +67,24 @@ static int ah_output(struct sk_buff *skb)
 		char 		buf[60];
 	} tmp_iph;
 
-	if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
-		err = -EINVAL;
-		goto error_nolock;
+	if ((*pskb)->ip_summed == CHECKSUM_HW) {
+		err = skb_checksum_help(pskb, 0);
+		if (err)
+			goto error_nolock;
 	}
 
 	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, skb, AF_INET);
+	err = xfrm_check_output(x, *pskb, AF_INET);
 	if (err)
 		goto error;
 
-	iph = skb->nh.iph;
+	iph = (*pskb)->nh.iph;
 	if (x->props.mode) {
-		top_iph = (struct iphdr*)skb_push(skb, x->props.header_len);
+		top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len);
 		top_iph->ihl = 5;
 		top_iph->version = 4;
 		top_iph->tos = 0;
-		top_iph->tot_len = htons(skb->len);
+		top_iph->tot_len = htons((*pskb)->len);
 		top_iph->frag_off = 0;
 		if (!(iph->frag_off&htons(IP_DF)))
 			__ip_select_ident(top_iph, dst, 0);
@@ -95,12 +96,12 @@ static int ah_output(struct sk_buff *skb)
 		ah = (struct ip_auth_hdr*)(top_iph+1);
 		ah->nexthdr = IPPROTO_IPIP;
 	} else {
-		memcpy(&tmp_iph, skb->data, iph->ihl*4);
-		top_iph = (struct iphdr*)skb_push(skb, x->props.header_len);
+		memcpy(&tmp_iph, (*pskb)->data, iph->ihl*4);
+		top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len);
 		memcpy(top_iph, &tmp_iph, iph->ihl*4);
 		iph = &tmp_iph.iph;
 		top_iph->tos = 0;
-		top_iph->tot_len = htons(skb->len);
+		top_iph->tot_len = htons((*pskb)->len);
 		top_iph->frag_off = 0;
 		top_iph->ttl = 0;
 		top_iph->protocol = IPPROTO_AH;
@@ -120,14 +121,14 @@ static int ah_output(struct sk_buff *skb)
 	ah->reserved = 0;
 	ah->spi = x->id.spi;
 	ah->seq_no = htonl(++x->replay.oseq);
-	ahp->icv(ahp, skb, ah->auth_data);
+	ahp->icv(ahp, *pskb, ah->auth_data);
 	top_iph->tos = iph->tos;
 	top_iph->ttl = iph->ttl;
 	if (x->props.mode) {
 		if (x->props.flags & XFRM_STATE_NOECN)
 			IP_ECN_clear(top_iph);
 		top_iph->frag_off = iph->frag_off&~htons(IP_MF|IP_OFFSET);
-		memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
+		memset(&(IPCB(*pskb)->opt), 0, sizeof(struct ip_options));
 	} else {
 		top_iph->frag_off = iph->frag_off;
 		top_iph->daddr = iph->daddr;
@@ -136,12 +137,12 @@ static int ah_output(struct sk_buff *skb)
 	}
 	ip_send_check(top_iph);
 
-	skb->nh.raw = skb->data;
+	(*pskb)->nh.raw = (*pskb)->data;
 
-	x->curlft.bytes += skb->len;
+	x->curlft.bytes += (*pskb)->len;
 	x->curlft.packets++;
 	spin_unlock_bh(&x->lock);
-	if ((skb->dst = dst_pop(dst)) == NULL) {
+	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
 		err = -EHOSTUNREACH;
 		goto error_nolock;
 	}
@@ -150,7 +151,7 @@ static int ah_output(struct sk_buff *skb)
 error:
 	spin_unlock_bh(&x->lock);
 error_nolock:
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	return err;
 }
 
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index bc76f3fb7..b6f3840b4 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1103,7 +1103,7 @@ int arp_req_delete(struct arpreq *r, struct net_device * dev)
  *	Handle an ARP layer I/O control request.
  */
 
-int arp_ioctl(unsigned int cmd, void *arg)
+int arp_ioctl(unsigned int cmd, void __user *arg)
 {
 	int err;
 	struct arpreq r;
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index c9cd619cf..6e16cc55b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -489,7 +489,7 @@ static __inline__ int inet_abc_len(u32 addr)
 }
 
 
-int devinet_ioctl(unsigned int cmd, void *arg)
+int devinet_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct ifreq ifr;
 	struct sockaddr_in sin_orig;
@@ -713,7 +713,7 @@ rarok:
 	goto out;
 }
 
-static int inet_gifconf(struct net_device *dev, char *buf, int len)
+static int inet_gifconf(struct net_device *dev, char __user *buf, int len)
 {
 	struct in_device *in_dev = __in_dev_get(dev);
 	struct in_ifaddr *ifa;
@@ -1136,7 +1136,7 @@ void inet_forward_change(void)
 }
 
 static int devinet_sysctl_forward(ctl_table *ctl, int write,
-				  struct file* filp, void *buffer,
+				  struct file* filp, void __user *buffer,
 				  size_t *lenp)
 {
 	int *valp = ctl->data;
@@ -1154,7 +1154,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
 }
 
 int ipv4_doint_and_flush(ctl_table *ctl, int write,
-			 struct file* filp, void *buffer,
+			 struct file* filp, void __user *buffer,
 			 size_t *lenp)
 {
 	int *valp = ctl->data;
@@ -1167,9 +1167,9 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
 	return ret;
 }
 
-int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen,
-				  void *oldval, size_t *oldlenp,
-				  void *newval, size_t newlen, 
+int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
+				  void __user *oldval, size_t __user *oldlenp,
+				  void __user *newval, size_t newlen, 
 				  void **context)
 {
 	int *valp = table->data;
@@ -1181,7 +1181,7 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen,
 	if (newlen != sizeof(int))
 		return -EINVAL;
 
-	if (get_user(new, (int *)newval))
+	if (get_user(new, (int __user *)newval))
 		return -EFAULT;
 
 	if (new == *valp)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index d4696c1f0..4755e0dcc 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -20,10 +20,10 @@ struct esp_decap_data {
 	__u8		proto;
 };
 
-int esp_output(struct sk_buff *skb)
+int esp_output(struct sk_buff **pskb)
 {
 	int err;
-	struct dst_entry *dst = skb->dst;
+	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
 	struct iphdr *iph, *top_iph;
 	struct ip_esp_hdr *esph;
@@ -42,28 +42,28 @@ int esp_output(struct sk_buff *skb)
 		char 		buf[60];
 	} tmp_iph;
 
-	/* First, if the skb is not checksummed, complete checksum. */
-	if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
-		err = -EINVAL;
-		goto error_nolock;
+	if ((*pskb)->ip_summed == CHECKSUM_HW) {
+		err = skb_checksum_help(pskb, 0);
+		if (err)
+			goto error_nolock;
 	}
 
 	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, skb, AF_INET);
+	err = xfrm_check_output(x, *pskb, AF_INET);
 	if (err)
 		goto error;
 	err = -ENOMEM;
 
 	/* Strip IP header in transport mode. Save it. */
 	if (!x->props.mode) {
-		iph = skb->nh.iph;
+		iph = (*pskb)->nh.iph;
 		memcpy(&tmp_iph, iph, iph->ihl*4);
-		__skb_pull(skb, iph->ihl*4);
+		__skb_pull(*pskb, iph->ihl*4);
 	}
 	/* Now skb is pure payload to encrypt */
 
 	/* Round to block size */
-	clen = skb->len;
+	clen = (*pskb)->len;
 
 	esp = x->data;
 	alen = esp->auth.icv_trunc_len;
@@ -73,23 +73,23 @@ int esp_output(struct sk_buff *skb)
 	if (esp->conf.padlen)
 		clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1);
 
-	if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0)
+	if ((nfrags = skb_cow_data(*pskb, clen-(*pskb)->len+alen, &trailer)) < 0)
 		goto error;
 
 	/* Fill padding... */
 	do {
 		int i;
-		for (i=0; i<clen-skb->len - 2; i++)
+		for (i=0; i<clen-(*pskb)->len - 2; i++)
 			*(u8*)(trailer->tail + i) = i+1;
 	} while (0);
-	*(u8*)(trailer->tail + clen-skb->len - 2) = (clen - skb->len)-2;
-	pskb_put(skb, trailer, clen - skb->len);
+	*(u8*)(trailer->tail + clen-(*pskb)->len - 2) = (clen - (*pskb)->len)-2;
+	pskb_put(*pskb, trailer, clen - (*pskb)->len);
 
 	encap = x->encap;
 
-	iph = skb->nh.iph;
+	iph = (*pskb)->nh.iph;
 	if (x->props.mode) {
-		top_iph = (struct iphdr*)skb_push(skb, x->props.header_len);
+		top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len);
 		esph = (struct ip_esp_hdr*)(top_iph+1);
 		if (encap && encap->encap_type) {
 			switch (encap->encap_type) {
@@ -121,7 +121,7 @@ int esp_output(struct sk_buff *skb)
 		top_iph->tos = iph->tos;	/* DS disclosed */
 		if (x->props.flags & XFRM_STATE_NOECN)
 			IP_ECN_clear(top_iph);
-		top_iph->tot_len = htons(skb->len + alen);
+		top_iph->tot_len = htons((*pskb)->len + alen);
 		top_iph->frag_off = iph->frag_off&htons(IP_DF);
 		if (!(top_iph->frag_off))
 			ip_select_ident(top_iph, dst, 0);
@@ -129,10 +129,10 @@ int esp_output(struct sk_buff *skb)
 		top_iph->check = 0;
 		top_iph->saddr = x->props.saddr.a4;
 		top_iph->daddr = x->id.daddr.a4;
-		memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
+		memset(&(IPCB(*pskb)->opt), 0, sizeof(struct ip_options));
 	} else {
-		esph = (struct ip_esp_hdr*)skb_push(skb, x->props.header_len);
-		top_iph = (struct iphdr*)skb_push(skb, iph->ihl*4);
+		esph = (struct ip_esp_hdr*)skb_push(*pskb, x->props.header_len);
+		top_iph = (struct iphdr*)skb_push(*pskb, iph->ihl*4);
 		memcpy(top_iph, &tmp_iph, iph->ihl*4);
 		if (encap && encap->encap_type) {
 			switch (encap->encap_type) {
@@ -159,7 +159,7 @@ int esp_output(struct sk_buff *skb)
 		} else
 			top_iph->protocol = IPPROTO_ESP;
 		iph = &tmp_iph.iph;
-		top_iph->tot_len = htons(skb->len + alen);
+		top_iph->tot_len = htons((*pskb)->len + alen);
 		top_iph->check = 0;
 		top_iph->frag_off = iph->frag_off;
 		*(u8*)(trailer->tail - 1) = iph->protocol;
@@ -169,7 +169,7 @@ int esp_output(struct sk_buff *skb)
 	if (encap && uh) {
 		uh->source = encap->encap_sport;
 		uh->dest = encap->encap_dport;
-		uh->len = htons(skb->len + alen - sizeof(struct iphdr));
+		uh->len = htons((*pskb)->len + alen - sizeof(struct iphdr));
 		uh->check = 0;
 	}
 
@@ -188,7 +188,7 @@ int esp_output(struct sk_buff *skb)
 			if (!sg)
 				goto error;
 		}
-		skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen);
+		skb_to_sgvec(*pskb, sg, esph->enc_data+esp->conf.ivlen-(*pskb)->data, clen);
 		crypto_cipher_encrypt(tfm, sg, sg, clen);
 		if (unlikely(sg != sgbuf))
 			kfree(sg);
@@ -200,19 +200,19 @@ int esp_output(struct sk_buff *skb)
 	}
 
 	if (esp->auth.icv_full_len) {
-		esp->auth.icv(esp, skb, (u8*)esph-skb->data,
+		esp->auth.icv(esp, *pskb, (u8*)esph-(*pskb)->data,
 		              sizeof(struct ip_esp_hdr) + esp->conf.ivlen+clen, trailer->tail);
-		pskb_put(skb, trailer, alen);
+		pskb_put(*pskb, trailer, alen);
 	}
 
 	ip_send_check(top_iph);
 
-	skb->nh.raw = skb->data;
+	(*pskb)->nh.raw = (*pskb)->data;
 
-	x->curlft.bytes += skb->len;
+	x->curlft.bytes += (*pskb)->len;
 	x->curlft.packets++;
 	spin_unlock_bh(&x->lock);
-	if ((skb->dst = dst_pop(dst)) == NULL) {
+	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
 		err = -EHOSTUNREACH;
 		goto error_nolock;
 	}
@@ -221,7 +221,7 @@ int esp_output(struct sk_buff *skb)
 error:
 	spin_unlock_bh(&x->lock);
 error_nolock:
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	return err;
 }
 
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 99d46b4bc..149dc8627 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -292,6 +292,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
 		}
 	}
 	if (rt->rt_src == 0) {
+		kfree_skb(skb);
 		ip_rt_put(rt);
 		return 0;
 	}
@@ -1912,7 +1913,7 @@ done:
 }
 
 int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
-	struct ip_msfilter *optval, int *optlen)
+	struct ip_msfilter __user *optval, int __user *optlen)
 {
 	int err, len, count, copycount;
 	struct ip_mreqn	imr;
@@ -1958,11 +1959,11 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
 	len = copycount * sizeof(psl->sl_addr[0]);
 	msf->imsf_numsrc = count;
 	if (put_user(IP_MSFILTER_SIZE(copycount), optlen) ||
-	    copy_to_user((void *)optval, msf, IP_MSFILTER_SIZE(0))) {
+	    copy_to_user(optval, msf, IP_MSFILTER_SIZE(0))) {
 		return -EFAULT;
 	}
 	if (len &&
-	    copy_to_user((void *)&optval->imsf_slist[0], psl->sl_addr, len))
+	    copy_to_user(&optval->imsf_slist[0], psl->sl_addr, len))
 		return -EFAULT;
 	return 0;
 done:
@@ -1971,7 +1972,7 @@ done:
 }
 
 int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
-	struct group_filter *optval, int *optlen)
+	struct group_filter __user *optval, int __user *optlen)
 {
 	int err, i, count, copycount;
 	struct sockaddr_in *psin;
@@ -2005,7 +2006,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
 	copycount = count < gsf->gf_numsrc ? count : gsf->gf_numsrc;
 	gsf->gf_numsrc = count;
 	if (put_user(GROUP_FILTER_SIZE(copycount), optlen) ||
-	    copy_to_user((void *)optval, gsf, GROUP_FILTER_SIZE(0))) {
+	    copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) {
 		return -EFAULT;
 	}
 	for (i=0; i<copycount; i++) {
@@ -2016,7 +2017,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
 		memset(&ss, 0, sizeof(ss));
 		psin->sin_family = AF_INET;
 		psin->sin_addr.s_addr = psl->sl_addr[i];
-		if (copy_to_user((void *)&optval->gf_slist[i], &ss, sizeof(ss)))
+		if (copy_to_user(&optval->gf_slist[i], &ss, sizeof(ss)))
 			return -EFAULT;
 	}
 	return 0;
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index f26d67ca6..be1e87c11 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -46,7 +46,7 @@ static inline int ip_forward_finish(struct sk_buff *skb)
 {
 	struct ip_options * opt	= &(IPCB(skb)->opt);
 
-	IP_INC_STATS_BH(IpForwDatagrams);
+	IP_INC_STATS_BH(OutForwDatagrams);
 
 	if (unlikely(opt->optlen))
 		ip_forward_options(skb);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 375caffe0..1f007c67b 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -263,7 +263,7 @@ static void ip_evictor(void)
 		spin_unlock(&qp->lock);
 
 		ipq_put(qp);
-		IP_INC_STATS_BH(IpReasmFails);
+		IP_INC_STATS_BH(ReasmFails);
 	}
 }
 
@@ -281,8 +281,8 @@ static void ip_expire(unsigned long arg)
 
 	ipq_kill(qp);
 
-	IP_INC_STATS_BH(IpReasmTimeout);
-	IP_INC_STATS_BH(IpReasmFails);
+	IP_INC_STATS_BH(ReasmTimeout);
+	IP_INC_STATS_BH(ReasmFails);
 
 	if ((qp->last_in&FIRST_IN) && qp->fragments != NULL) {
 		struct sk_buff *head = qp->fragments;
@@ -609,7 +609,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
 	iph = head->nh.iph;
 	iph->frag_off = 0;
 	iph->tot_len = htons(len);
-	IP_INC_STATS_BH(IpReasmOKs);
+	IP_INC_STATS_BH(ReasmOKs);
 	qp->fragments = NULL;
 	return head;
 
@@ -625,7 +625,7 @@ out_oversize:
 			"Oversized IP packet from %d.%d.%d.%d.\n",
 			NIPQUAD(qp->saddr));
 out_fail:
-	IP_INC_STATS_BH(IpReasmFails);
+	IP_INC_STATS_BH(ReasmFails);
 	return NULL;
 }
 
@@ -636,7 +636,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
 	struct ipq *qp;
 	struct net_device *dev;
 	
-	IP_INC_STATS_BH(IpReasmReqds);
+	IP_INC_STATS_BH(ReasmReqds);
 
 	/* Start by cleaning up the memory. */
 	if (atomic_read(&ip_frag_mem) > sysctl_ipfrag_high_thresh)
@@ -661,7 +661,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
 		return ret;
 	}
 
-	IP_INC_STATS_BH(IpReasmFails);
+	IP_INC_STATS_BH(ReasmFails);
 	kfree_skb(skb);
 	return NULL;
 }
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 904f20aba..2f71ed5cf 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -150,7 +150,7 @@
  *	SNMP management statistics
  */
 
-DEFINE_SNMP_STAT(struct ip_mib, ip_statistics);
+DEFINE_SNMP_STAT(struct ipstats_mib, ip_statistics);
 
 /*
  *	Process Router Attention IP option
@@ -249,16 +249,16 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
 				protocol = -ret;
 				goto resubmit;
 			}
-			IP_INC_STATS_BH(IpInDelivers);
+			IP_INC_STATS_BH(InDelivers);
 		} else {
 			if (!raw_sk) {
 				if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
-					IP_INC_STATS_BH(IpInUnknownProtos);
+					IP_INC_STATS_BH(InUnknownProtos);
 					icmp_send(skb, ICMP_DEST_UNREACH,
 						  ICMP_PROT_UNREACH, 0);
 				}
 			} else
-				IP_INC_STATS_BH(IpInDelivers);
+				IP_INC_STATS_BH(InDelivers);
 			kfree_skb(skb);
 		}
 	}
@@ -324,7 +324,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
 		*/
 
 		if (skb_cow(skb, skb_headroom(skb))) {
-			IP_INC_STATS_BH(IpInDiscards);
+			IP_INC_STATS_BH(InDiscards);
 			goto drop;
 		}
 		iph = skb->nh.iph;
@@ -353,7 +353,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
 	return dst_input(skb);
 
 inhdr_error:
-	IP_INC_STATS_BH(IpInHdrErrors);
+	IP_INC_STATS_BH(InHdrErrors);
 drop:
         kfree_skb(skb);
         return NET_RX_DROP;
@@ -372,10 +372,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 	if (skb->pkt_type == PACKET_OTHERHOST)
 		goto drop;
 
-	IP_INC_STATS_BH(IpInReceives);
+	IP_INC_STATS_BH(InReceives);
 
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
-		IP_INC_STATS_BH(IpInDiscards);
+		IP_INC_STATS_BH(InDiscards);
 		goto out;
 	}
 
@@ -426,7 +426,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 		       ip_rcv_finish);
 
 inhdr_error:
-	IP_INC_STATS_BH(IpInHdrErrors);
+	IP_INC_STATS_BH(InHdrErrors);
 drop:
         kfree_skb(skb);
 out:
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 8a34ed3a6..60fc5091c 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -223,8 +223,9 @@ int ip_finish_output(struct sk_buff *skb)
 		       ip_finish_output2);
 }
 
-int ip_mc_output(struct sk_buff *skb)
+int ip_mc_output(struct sk_buff **pskb)
 {
+	struct sk_buff *skb = *pskb;
 	struct sock *sk = skb->sk;
 	struct rtable *rt = (struct rtable*)skb->dst;
 	struct net_device *dev = rt->u.dst.dev;
@@ -232,7 +233,7 @@ int ip_mc_output(struct sk_buff *skb)
 	/*
 	 *	If the indicated interface is up and running, send the packet.
 	 */
-	IP_INC_STATS(IpOutRequests);
+	IP_INC_STATS(OutRequests);
 
 	skb->dev = dev;
 	skb->protocol = htons(ETH_P_IP);
@@ -283,9 +284,11 @@ int ip_mc_output(struct sk_buff *skb)
 		return ip_finish_output(skb);
 }
 
-int ip_output(struct sk_buff *skb)
+int ip_output(struct sk_buff **pskb)
 {
-	IP_INC_STATS(IpOutRequests);
+	struct sk_buff *skb = *pskb;
+
+	IP_INC_STATS(OutRequests);
 
 	if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) &&
 	    !skb_shinfo(skb)->tso_size)
@@ -390,7 +393,7 @@ packet_routed:
 		       dst_output);
 
 no_route:
-	IP_INC_STATS(IpOutNoRoutes);
+	IP_INC_STATS(OutNoRoutes);
 	kfree_skb(skb);
 	return -EHOSTUNREACH;
 }
@@ -547,7 +550,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 		}
 
 		if (err == 0) {
-			IP_INC_STATS(IpFragOKs);
+			IP_INC_STATS(FragOKs);
 			return 0;
 		}
 
@@ -556,7 +559,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 			kfree_skb(frag);
 			frag = skb;
 		}
-		IP_INC_STATS(IpFragFails);
+		IP_INC_STATS(FragFails);
 		return err;
 	}
 
@@ -567,7 +570,7 @@ slow_path:
 #ifdef CONFIG_BRIDGE_NETFILTER
 	/* for bridged IP traffic encapsulated inside f.e. a vlan header,
 	 * we need to make room for the encapsulating header */
-	ll_rs = LL_RESERVED_SPACE(rt->u.dst.dev + nf_bridge_pad(skb));
+	ll_rs = LL_RESERVED_SPACE_EXTRA(rt->u.dst.dev, nf_bridge_pad(skb));
 	mtu -= nf_bridge_pad(skb);
 #else
 	ll_rs = LL_RESERVED_SPACE(rt->u.dst.dev);
@@ -662,7 +665,7 @@ slow_path:
 		 *	Put this fragment into the sending queue.
 		 */
 
-		IP_INC_STATS(IpFragCreates);
+		IP_INC_STATS(FragCreates);
 
 		iph->tot_len = htons(len + hlen);
 
@@ -673,12 +676,12 @@ slow_path:
 			goto fail;
 	}
 	kfree_skb(skb);
-	IP_INC_STATS(IpFragOKs);
+	IP_INC_STATS(FragOKs);
 	return err;
 
 fail:
 	kfree_skb(skb); 
-	IP_INC_STATS(IpFragFails);
+	IP_INC_STATS(FragFails);
 	return err;
 }
 
@@ -975,7 +978,7 @@ alloc_new_skb:
 
 error:
 	inet->cork.length -= length;
-	IP_INC_STATS(IpOutDiscards);
+	IP_INC_STATS(OutDiscards);
 	return err; 
 }
 
@@ -1088,7 +1091,7 @@ ssize_t	ip_append_page(struct sock *sk, struct page *page,
 
 error:
 	inet->cork.length -= size;
-	IP_INC_STATS(IpOutDiscards);
+	IP_INC_STATS(OutDiscards);
 	return err;
 }
 
@@ -1198,7 +1201,7 @@ out:
 	return err;
 
 error:
-	IP_INC_STATS(IpOutDiscards);
+	IP_INC_STATS(OutDiscards);
 	goto out;
 }
 
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 83579b58c..39e435a45 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -384,7 +384,7 @@ out:
  *	an IP socket.
  */
 
-int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int optlen)
+int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen)
 {
 	struct inet_opt *inet = inet_sk(sk);
 	int val=0,err;
@@ -401,12 +401,12 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
 				optname == IP_MULTICAST_TTL || 
 				optname == IP_MULTICAST_LOOP) { 
 		if (optlen >= sizeof(int)) {
-			if (get_user(val, (int *) optval))
+			if (get_user(val, (int __user *) optval))
 				return -EFAULT;
 		} else if (optlen >= sizeof(char)) {
 			unsigned char ucval;
 
-			if (get_user(ucval, (unsigned char *) optval))
+			if (get_user(ucval, (unsigned char __user *) optval))
 				return -EFAULT;
 			val = (int) ucval;
 		}
@@ -875,7 +875,7 @@ e_inval:
  *	_received_ ones. The set sets the _sent_ ones.
  */
 
-int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *optlen)
+int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen)
 {
 	struct inet_opt *inet = inet_sk(sk);
 	int val;
@@ -984,7 +984,7 @@ int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *op
 
   			if(put_user(len, optlen))
   				return -EFAULT;
-			if(copy_to_user((void *)optval, &addr, len))
+			if(copy_to_user(optval, &addr, len))
 				return -EFAULT;
 			return 0;
 		}
@@ -1002,7 +1002,7 @@ int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *op
 				return -EFAULT;
 			}
 			err = ip_mc_msfget(sk, &msf,
-				(struct ip_msfilter *)optval, optlen);
+				(struct ip_msfilter __user *)optval, optlen);
 			release_sock(sk);
 			return err;
 		}
@@ -1020,7 +1020,7 @@ int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *op
 				return -EFAULT;
 			}
 			err = ip_mc_gsfget(sk, &gsf,
-				(struct group_filter *)optval, optlen);
+				(struct group_filter __user *)optval, optlen);
 			release_sock(sk);
 			return err;
 		}
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 2a5a7dfcf..e20c7e43b 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -143,10 +143,10 @@ static void ipcomp_tunnel_encap(struct xfrm_state *x, struct sk_buff *skb)
 	skb->nh.raw = skb->data;
 }
 
-static int ipcomp_output(struct sk_buff *skb)
+static int ipcomp_output(struct sk_buff **pskb)
 {
 	int err;
-	struct dst_entry *dst = skb->dst;
+	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x = dst->xfrm;
 	struct iphdr *iph, *top_iph;
 	struct ip_comp_hdr *ipch;
@@ -157,25 +157,26 @@ static int ipcomp_output(struct sk_buff *skb)
 	} tmp_iph;
 	int hdr_len = 0;
 
-	if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
-		err = -EINVAL;
-		goto error_nolock;
+	if ((*pskb)->ip_summed == CHECKSUM_HW) {
+		err = skb_checksum_help(pskb, 0);
+		if (err)
+			goto error_nolock;
 	}
 
 	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, skb, AF_INET);
+	err = xfrm_check_output(x, *pskb, AF_INET);
 	if (err)
 		goto error;
 
 	/* Don't bother compressing */
 	if (!x->props.mode) {
-		iph = skb->nh.iph;
+		iph = (*pskb)->nh.iph;
 		hdr_len = iph->ihl * 4;
 	}
-	if ((skb->len - hdr_len) < ipcd->threshold) {
+	if (((*pskb)->len - hdr_len) < ipcd->threshold) {
 		if (x->props.mode) {
-			ipcomp_tunnel_encap(x, skb);
-			iph = skb->nh.iph;
+			ipcomp_tunnel_encap(x, *pskb);
+			iph = (*pskb)->nh.iph;
 			iph->protocol = IPPROTO_IPIP;
 			ip_send_check(iph);
 		}
@@ -183,19 +184,19 @@ static int ipcomp_output(struct sk_buff *skb)
 	}
 
 	if (x->props.mode) 
-		ipcomp_tunnel_encap(x, skb);
+		ipcomp_tunnel_encap(x, *pskb);
 
-	if ((skb_is_nonlinear(skb) || skb_cloned(skb)) &&
-	    skb_linearize(skb, GFP_ATOMIC) != 0) {
+	if ((skb_is_nonlinear(*pskb) || skb_cloned(*pskb)) &&
+	    skb_linearize(*pskb, GFP_ATOMIC) != 0) {
 	    	err = -ENOMEM;
 	    	goto error;
 	}
 	
-	err = ipcomp_compress(x, skb);
+	err = ipcomp_compress(x, *pskb);
 	if (err) {
 		if (err == -EMSGSIZE) {
 			if (x->props.mode) {
-				iph = skb->nh.iph;
+				iph = (*pskb)->nh.iph;
 				iph->protocol = IPPROTO_IPIP;
 				ip_send_check(iph);
 			}
@@ -205,14 +206,14 @@ static int ipcomp_output(struct sk_buff *skb)
 	}
 
 	/* Install ipcomp header, convert into ipcomp datagram. */
-	iph = skb->nh.iph;
+	iph = (*pskb)->nh.iph;
 	memcpy(&tmp_iph, iph, iph->ihl * 4);
-	top_iph = (struct iphdr *)skb_push(skb, sizeof(struct ip_comp_hdr));
+	top_iph = (struct iphdr *)skb_push(*pskb, sizeof(struct ip_comp_hdr));
 	memcpy(top_iph, &tmp_iph, iph->ihl * 4);
 	iph = top_iph;
 	if (x->props.mode && (x->props.flags & XFRM_STATE_NOECN))
 		IP_ECN_clear(iph);
-	iph->tot_len = htons(skb->len);
+	iph->tot_len = htons((*pskb)->len);
 	iph->protocol = IPPROTO_COMP;
 	iph->check = 0;
 	ipch = (struct ip_comp_hdr *)((char *)iph + iph->ihl * 4);
@@ -220,14 +221,14 @@ static int ipcomp_output(struct sk_buff *skb)
 	ipch->flags = 0;
 	ipch->cpi = htons((u16 )ntohl(x->id.spi));
 	ip_send_check(iph);
-	skb->nh.raw = skb->data;
+	(*pskb)->nh.raw = (*pskb)->data;
 
 out_ok:
-	x->curlft.bytes += skb->len;
+	x->curlft.bytes += (*pskb)->len;
 	x->curlft.packets++;
 	spin_unlock_bh(&x->lock);
 	
-	if ((skb->dst = dst_pop(dst)) == NULL) {
+	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
 		err = -EHOSTUNREACH;
 		goto error_nolock;
 	}
@@ -238,7 +239,7 @@ out_exit:
 error:
 	spin_unlock_bh(&x->lock);
 error_nolock:
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	goto out_exit;
 }
 
@@ -339,6 +340,7 @@ static void ipcomp_destroy(struct xfrm_state *x)
 	struct ipcomp_data *ipcd = x->data;
 	if (!ipcd)
 		return;
+	xfrm_state_delete_tunnel(x);
 	ipcomp_free_data(ipcd);
 	kfree(ipcd);
 }
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 5792a4218..757b1d3f6 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -479,6 +479,7 @@ static int ipip_rcv(struct sk_buff *skb)
 	read_lock(&ipip_lock);
 	if ((tunnel = ipip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
 		if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+			read_unlock(&ipip_lock);
 			kfree_skb(skb);
 			return 0;
 		}
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index ca7e1e57e..a25e56077 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -844,7 +844,7 @@ static void mrtsock_destruct(struct sock *sk)
  *	MOSPF/PIM router set up we can clean this up.
  */
  
-int ip_mroute_setsockopt(struct sock *sk,int optname,char *optval,int optlen)
+int ip_mroute_setsockopt(struct sock *sk,int optname,char __user *optval,int optlen)
 {
 	int ret;
 	struct vifctl vif;
@@ -925,7 +925,7 @@ int ip_mroute_setsockopt(struct sock *sk,int optname,char *optval,int optlen)
 		case MRT_ASSERT:
 		{
 			int v;
-			if(get_user(v,(int *)optval))
+			if(get_user(v,(int __user *)optval))
 				return -EFAULT;
 			mroute_do_assert=(v)?1:0;
 			return 0;
@@ -934,7 +934,7 @@ int ip_mroute_setsockopt(struct sock *sk,int optname,char *optval,int optlen)
 		case MRT_PIM:
 		{
 			int v, ret;
-			if(get_user(v,(int *)optval))
+			if(get_user(v,(int __user *)optval))
 				return -EFAULT;
 			v = (v)?1:0;
 			rtnl_lock();
@@ -970,7 +970,7 @@ int ip_mroute_setsockopt(struct sock *sk,int optname,char *optval,int optlen)
  *	Getsock opt support for the multicast routing system.
  */
  
-int ip_mroute_getsockopt(struct sock *sk,int optname,char *optval,int *optlen)
+int ip_mroute_getsockopt(struct sock *sk,int optname,char __user *optval,int __user *optlen)
 {
 	int olr;
 	int val;
@@ -1008,7 +1008,7 @@ int ip_mroute_getsockopt(struct sock *sk,int optname,char *optval,int *optlen)
  *	The IP multicast ioctl support routines.
  */
  
-int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
+int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
 {
 	struct sioc_sg_req sr;
 	struct sioc_vif_req vr;
@@ -1018,7 +1018,7 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
 	switch(cmd)
 	{
 		case SIOCGETVIFCNT:
-			if (copy_from_user(&vr,(void *)arg,sizeof(vr)))
+			if (copy_from_user(&vr,arg,sizeof(vr)))
 				return -EFAULT; 
 			if(vr.vifi>=maxvif)
 				return -EINVAL;
@@ -1031,14 +1031,14 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
 				vr.obytes=vif->bytes_out;
 				read_unlock(&mrt_lock);
 
-				if (copy_to_user((void *)arg,&vr,sizeof(vr)))
+				if (copy_to_user(arg,&vr,sizeof(vr)))
 					return -EFAULT;
 				return 0;
 			}
 			read_unlock(&mrt_lock);
 			return -EADDRNOTAVAIL;
 		case SIOCGETSGCNT:
-			if (copy_from_user(&sr,(void *)arg,sizeof(sr)))
+			if (copy_from_user(&sr,arg,sizeof(sr)))
 				return -EFAULT;
 
 			read_lock(&mrt_lock);
@@ -1049,7 +1049,7 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
 				sr.wrong_if = c->mfc_un.res.wrong_if;
 				read_unlock(&mrt_lock);
 
-				if (copy_to_user((void *)arg,&sr,sizeof(sr)))
+				if (copy_to_user(arg,&sr,sizeof(sr)))
 					return -EFAULT;
 				return 0;
 			}
@@ -1115,7 +1115,7 @@ static inline int ipmr_forward_finish(struct sk_buff *skb)
 {
 	struct ip_options * opt	= &(IPCB(skb)->opt);
 
-	IP_INC_STATS_BH(IpForwDatagrams);
+	IP_INC_STATS_BH(OutForwDatagrams);
 
 	if (unlikely(opt->optlen))
 		ip_forward_options(skb);
@@ -1178,7 +1178,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
 		   to blackhole.
 		 */
 
-		IP_INC_STATS_BH(IpFragFails);
+		IP_INC_STATS_BH(FragFails);
 		ip_rt_put(rt);
 		goto out_free;
 	}
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
index a3aa64107..9f4b94f07 100644
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -735,6 +735,13 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb,
 	if (skb->nfcache & NFC_IPVS_PROPERTY)
 		return NF_ACCEPT;
 
+	if (skb->ip_summed == CHECKSUM_HW) {
+		if (skb_checksum_help(pskb, (out == NULL)))
+			return NF_DROP;
+		if (skb != *pskb)
+			skb = *pskb;
+	}
+
 	iph = skb->nh.iph;
 	if (unlikely(iph->protocol == IPPROTO_ICMP)) {
 		int related, verdict = ip_vs_out_icmp(pskb, &related);
@@ -974,6 +981,13 @@ ip_vs_in(unsigned int hooknum, struct sk_buff **pskb,
 		return NF_ACCEPT;
 	}
 
+	if (skb->ip_summed == CHECKSUM_HW) {
+		if (skb_checksum_help(pskb, (out == NULL)))
+			return NF_DROP;
+		if (skb != *pskb)
+			skb = *pskb;
+	}
+
 	iph = skb->nh.iph;
 	if (unlikely(iph->protocol == IPPROTO_ICMP)) {
 		int related, verdict = ip_vs_in_icmp(pskb, &related);
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 066a14a24..5df55ca9e 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -1347,7 +1347,7 @@ static int ip_vs_zero_all(void)
 
 static int
 proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
-		     void *buffer, size_t *lenp)
+		     void __user *buffer, size_t *lenp)
 {
 	int *valp = table->data;
 	int val = *valp;
@@ -1370,7 +1370,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
 
 static int
 proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
-		       void *buffer, size_t *lenp)
+		       void __user *buffer, size_t *lenp)
 {
 	int *valp = table->data;
 	int val[2];
@@ -1912,7 +1912,7 @@ static unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = {
 };
 
 static int
-do_ip_vs_set_ctl(struct sock *sk, int cmd, void *user, unsigned int len)
+do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
 {
 	int ret;
 	unsigned char arg[MAX_ARG_LEN];
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 822380bad..65230e5e1 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -179,11 +179,10 @@ static inline int arp_packet_match(const struct arphdr *arphdr,
 		return 0;
 	}
 
-	/* Look for ifname matches; this should unroll nicely. */
-	for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
-		ret |= (((const unsigned long *)indev)[i]
-			^ ((const unsigned long *)arpinfo->iniface)[i])
-			& ((const unsigned long *)arpinfo->iniface_mask)[i];
+	/* Look for ifname matches.  */
+	for (i = 0, ret = 0; i < IFNAMSIZ; i++) {
+		ret |= (indev[i] ^ arpinfo->iniface[i])
+			& arpinfo->iniface_mask[i];
 	}
 
 	if (FWINV(ret != 0, ARPT_INV_VIA_IN)) {
@@ -388,12 +387,12 @@ find_inlist_lock(struct list_head *head,
 }
 #endif
 
-static inline struct arpt_table *find_table_lock(const char *name, int *error, struct semaphore *mutex)
+static inline struct arpt_table *arpt_find_table_lock(const char *name, int *error, struct semaphore *mutex)
 {
 	return find_inlist_lock(&arpt_tables, name, "arptable_", error, mutex);
 }
 
-static inline struct arpt_target *find_target_lock(const char *name, int *error, struct semaphore *mutex)
+struct arpt_target *arpt_find_target_lock(const char *name, int *error, struct semaphore *mutex)
 {
 	return find_inlist_lock(&arpt_target, name, "arpt_", error, mutex);
 }
@@ -543,7 +542,7 @@ static inline int check_entry(struct arpt_entry *e, const char *name, unsigned i
 	}
 
 	t = arpt_get_target(e);
-	target = find_target_lock(t->u.user.name, &ret, &arpt_mutex);
+	target = arpt_find_target_lock(t->u.user.name, &ret, &arpt_mutex);
 	if (!target) {
 		duprintf("check_entry: `%s' not found\n", t->u.user.name);
 		goto out;
@@ -778,7 +777,7 @@ static void get_counters(const struct arpt_table_info *t,
 
 static int copy_entries_to_user(unsigned int total_size,
 				struct arpt_table *table,
-				void *userptr)
+				void __user *userptr)
 {
 	unsigned int off, num, countersize;
 	struct arpt_entry *e;
@@ -838,12 +837,12 @@ static int copy_entries_to_user(unsigned int total_size,
 }
 
 static int get_entries(const struct arpt_get_entries *entries,
-		       struct arpt_get_entries *uptr)
+		       struct arpt_get_entries __user *uptr)
 {
 	int ret;
 	struct arpt_table *t;
 
-	t = find_table_lock(entries->name, &ret, &arpt_mutex);
+	t = arpt_find_table_lock(entries->name, &ret, &arpt_mutex);
 	if (t) {
 		duprintf("t->private->number = %u\n",
 			 t->private->number);
@@ -864,7 +863,7 @@ static int get_entries(const struct arpt_get_entries *entries,
 	return ret;
 }
 
-static int do_replace(void *user, unsigned int len)
+static int do_replace(void __user *user, unsigned int len)
 {
 	int ret;
 	struct arpt_replace tmp;
@@ -909,7 +908,7 @@ static int do_replace(void *user, unsigned int len)
 
 	duprintf("arp_tables: Translated table\n");
 
-	t = find_table_lock(tmp.name, &ret, &arpt_mutex);
+	t = arpt_find_table_lock(tmp.name, &ret, &arpt_mutex);
 	if (!t)
 		goto free_newinfo_counters_untrans;
 
@@ -980,7 +979,7 @@ static inline int add_counter_to_entry(struct arpt_entry *e,
 	return 0;
 }
 
-static int do_add_counters(void *user, unsigned int len)
+static int do_add_counters(void __user *user, unsigned int len)
 {
 	unsigned int i;
 	struct arpt_counters_info tmp, *paddc;
@@ -1002,7 +1001,7 @@ static int do_add_counters(void *user, unsigned int len)
 		goto free;
 	}
 
-	t = find_table_lock(tmp.name, &ret, &arpt_mutex);
+	t = arpt_find_table_lock(tmp.name, &ret, &arpt_mutex);
 	if (!t)
 		goto free;
 
@@ -1027,7 +1026,7 @@ static int do_add_counters(void *user, unsigned int len)
 	return ret;
 }
 
-static int do_arpt_set_ctl(struct sock *sk, int cmd, void *user, unsigned int len)
+static int do_arpt_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
 {
 	int ret;
 
@@ -1051,7 +1050,7 @@ static int do_arpt_set_ctl(struct sock *sk, int cmd, void *user, unsigned int le
 	return ret;
 }
 
-static int do_arpt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
+static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 {
 	int ret;
 
@@ -1075,7 +1074,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
 			break;
 		}
 		name[ARPT_TABLE_MAXNAMELEN-1] = '\0';
-		t = find_table_lock(name, &ret, &arpt_mutex);
+		t = arpt_find_table_lock(name, &ret, &arpt_mutex);
 		if (t) {
 			struct arpt_getinfo info;
 
@@ -1323,6 +1322,7 @@ static void __exit fini(void)
 EXPORT_SYMBOL(arpt_register_table);
 EXPORT_SYMBOL(arpt_unregister_table);
 EXPORT_SYMBOL(arpt_do_table);
+EXPORT_SYMBOL(arpt_find_target_lock);
 EXPORT_SYMBOL(arpt_register_target);
 EXPORT_SYMBOL(arpt_unregister_target);
 
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index 3ea086beb..67c2fd2a5 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -324,8 +324,9 @@ destroy_conntrack(struct nf_conntrack *nfct)
 		ip_conntrack_destroyed(ct);
 
 	WRITE_LOCK(&ip_conntrack_lock);
-	/* Delete us from our own list to prevent corruption later */
-	list_del(&ct->sibling_list);
+	/* Make sure don't leave any orphaned expectations lying around */
+	if (ct->expecting)
+		remove_expectations(ct, 1);
 
 	/* Delete our master expectation */
 	if (ct->master) {
@@ -920,7 +921,7 @@ static void expectation_timed_out(unsigned long ul_expect)
 }
 
 struct ip_conntrack_expect *
-ip_conntrack_expect_alloc()
+ip_conntrack_expect_alloc(void)
 {
 	struct ip_conntrack_expect *new;
 	
@@ -1127,10 +1128,8 @@ int ip_conntrack_alter_reply(struct ip_conntrack *conntrack,
 	DUMP_TUPLE(newreply);
 
 	conntrack->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply;
-	if (!conntrack->master)
-		conntrack->helper = LIST_FIND(&helpers, helper_cmp,
-					      struct ip_conntrack_helper *,
-					      newreply);
+	if (!conntrack->master && list_empty(&conntrack->sibling_list))
+		conntrack->helper = ip_ct_find_helper(newreply);
 	WRITE_UNLOCK(&ip_conntrack_lock);
 
 	return 1;
@@ -1300,7 +1299,7 @@ ip_ct_selective_cleanup(int (*kill)(const struct ip_conntrack *i, void *data),
 /* Reversing the socket's dst/src point of view gives us the reply
    mapping. */
 static int
-getorigdst(struct sock *sk, int optval, void *user, int *len)
+getorigdst(struct sock *sk, int optval, void __user *user, int *len)
 {
 	struct inet_opt *inet = inet_sk(sk);
 	struct ip_conntrack_tuple_hash *h;
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index 9bcb718ec..1cc796556 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -177,6 +177,8 @@ static int tcp_packet(struct ip_conntrack *conntrack,
 
 	if (skb_copy_bits(skb, skb->nh.iph->ihl * 4, &tcph, sizeof(tcph)) != 0)
 		return -1;
+	if (skb->len < skb->nh.iph->ihl * 4 + tcph.doff * 4)
+		return -1;
 
 	/* If only reply is a RST, we can consider ourselves not to
 	   have an established connection: this is a fairly common
diff --git a/net/ipv4/netfilter/ip_fw_compat.c b/net/ipv4/netfilter/ip_fw_compat.c
index a45090d83..f7146f31b 100644
--- a/net/ipv4/netfilter/ip_fw_compat.c
+++ b/net/ipv4/netfilter/ip_fw_compat.c
@@ -69,7 +69,8 @@ fw_in(unsigned int hooknum,
 	/* Assume worse case: any hook could change packet */
 	(*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED;
 	if ((*pskb)->ip_summed == CHECKSUM_HW)
-		(*pskb)->ip_summed = CHECKSUM_NONE;
+		if (skb_checksum_help(pskb, (out == NULL)))
+			return NF_DROP;
 
 	switch (hooknum) {
 	case NF_IP_PRE_ROUTING:
@@ -181,7 +182,7 @@ static unsigned int fw_confirm(unsigned int hooknum,
 
 extern int ip_fw_ctl(int optval, void *m, unsigned int len);
 
-static int sock_fn(struct sock *sk, int optval, void *user, unsigned int len)
+static int sock_fn(struct sock *sk, int optval, void __user *user, unsigned int len)
 {
 	/* MAX of:
 	   2.2: sizeof(struct ip_fwtest) (~14x4 + 3x4 = 17x4)
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c
index c4fe69b65..a84453f89 100644
--- a/net/ipv4/netfilter/ip_nat_standalone.c
+++ b/net/ipv4/netfilter/ip_nat_standalone.c
@@ -85,7 +85,8 @@ ip_nat_fn(unsigned int hooknum,
 
 	/* If we had a hardware checksum before, it's now invalid */
 	if ((*pskb)->ip_summed == CHECKSUM_HW)
-		(*pskb)->ip_summed = CHECKSUM_NONE;
+		if (skb_checksum_help(pskb, (out == NULL)))
+			return NF_DROP;
 
 	ct = ip_conntrack_get(*pskb, &ctinfo);
 	/* Can't track?  It's not due to stress, or conntrack would
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 1c1207164..2d433b69d 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -61,9 +61,6 @@ do {								\
 #endif
 #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
 
-/* Mutex protects lists (only traversed in user context). */
-static DECLARE_MUTEX(ipt_mutex);
-
 /* Must have mutex */
 #define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0)
 #define ASSERT_WRITE_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0)
@@ -418,7 +415,7 @@ find_inlist_lock_noload(struct list_head *head,
 {
 	void *ret;
 
-#if 0
+#if 0 
 	duprintf("find_inlist: searching for `%s' in %s.\n",
 		 name, head == &ipt_target ? "ipt_target"
 		 : head == &ipt_match ? "ipt_match"
@@ -461,7 +458,7 @@ find_inlist_lock(struct list_head *head,
 #endif
 
 static inline struct ipt_table *
-find_table_lock(const char *name, int *error, struct semaphore *mutex)
+ipt_find_table_lock(const char *name, int *error, struct semaphore *mutex)
 {
 	return find_inlist_lock(&ipt_tables, name, "iptable_", error, mutex);
 }
@@ -472,8 +469,8 @@ find_match_lock(const char *name, int *error, struct semaphore *mutex)
 	return find_inlist_lock(&ipt_match, name, "ipt_", error, mutex);
 }
 
-static inline struct ipt_target *
-find_target_lock(const char *name, int *error, struct semaphore *mutex)
+struct ipt_target *
+ipt_find_target_lock(const char *name, int *error, struct semaphore *mutex)
 {
 	return find_inlist_lock(&ipt_target, name, "ipt_", error, mutex);
 }
@@ -688,7 +685,7 @@ check_entry(struct ipt_entry *e, const char *name, unsigned int size,
 		goto cleanup_matches;
 
 	t = ipt_get_target(e);
-	target = find_target_lock(t->u.user.name, &ret, &ipt_mutex);
+	target = ipt_find_target_lock(t->u.user.name, &ret, &ipt_mutex);
 	if (!target) {
 		duprintf("check_entry: `%s' not found\n", t->u.user.name);
 		goto cleanup_matches;
@@ -942,7 +939,7 @@ get_counters(const struct ipt_table_info *t,
 static int
 copy_entries_to_user(unsigned int total_size,
 		     struct ipt_table *table,
-		     void *userptr)
+		     void __user *userptr)
 {
 	unsigned int off, num, countersize;
 	struct ipt_entry *e;
@@ -1020,12 +1017,12 @@ copy_entries_to_user(unsigned int total_size,
 
 static int
 get_entries(const struct ipt_get_entries *entries,
-	    struct ipt_get_entries *uptr)
+	    struct ipt_get_entries __user *uptr)
 {
 	int ret;
 	struct ipt_table *t;
 
-	t = find_table_lock(entries->name, &ret, &ipt_mutex);
+	t = ipt_find_table_lock(entries->name, &ret, &ipt_mutex);
 	if (t) {
 		duprintf("t->private->number = %u\n",
 			 t->private->number);
@@ -1047,7 +1044,7 @@ get_entries(const struct ipt_get_entries *entries,
 }
 
 static int
-do_replace(void *user, unsigned int len)
+do_replace(void __user *user, unsigned int len)
 {
 	int ret;
 	struct ipt_replace tmp;
@@ -1092,7 +1089,7 @@ do_replace(void *user, unsigned int len)
 
 	duprintf("ip_tables: Translated table\n");
 
-	t = find_table_lock(tmp.name, &ret, &ipt_mutex);
+	t = ipt_find_table_lock(tmp.name, &ret, &ipt_mutex);
 	if (!t)
 		goto free_newinfo_counters_untrans;
 
@@ -1173,7 +1170,7 @@ add_counter_to_entry(struct ipt_entry *e,
 }
 
 static int
-do_add_counters(void *user, unsigned int len)
+do_add_counters(void __user *user, unsigned int len)
 {
 	unsigned int i;
 	struct ipt_counters_info tmp, *paddc;
@@ -1195,7 +1192,7 @@ do_add_counters(void *user, unsigned int len)
 		goto free;
 	}
 
-	t = find_table_lock(tmp.name, &ret, &ipt_mutex);
+	t = ipt_find_table_lock(tmp.name, &ret, &ipt_mutex);
 	if (!t)
 		goto free;
 
@@ -1221,7 +1218,7 @@ do_add_counters(void *user, unsigned int len)
 }
 
 static int
-do_ipt_set_ctl(struct sock *sk,	int cmd, void *user, unsigned int len)
+do_ipt_set_ctl(struct sock *sk,	int cmd, void __user *user, unsigned int len)
 {
 	int ret;
 
@@ -1246,7 +1243,7 @@ do_ipt_set_ctl(struct sock *sk,	int cmd, void *user, unsigned int len)
 }
 
 static int
-do_ipt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
+do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 {
 	int ret;
 
@@ -1270,7 +1267,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void *user, int *len)
 			break;
 		}
 		name[IPT_TABLE_MAXNAMELEN-1] = '\0';
-		t = find_table_lock(name, &ret, &ipt_mutex);
+		t = ipt_find_table_lock(name, &ret, &ipt_mutex);
 		if (t) {
 			struct ipt_getinfo info;
 
@@ -1855,6 +1852,7 @@ EXPORT_SYMBOL(ipt_unregister_match);
 EXPORT_SYMBOL(ipt_do_table);
 EXPORT_SYMBOL(ipt_register_target);
 EXPORT_SYMBOL(ipt_unregister_target);
+EXPORT_SYMBOL(ipt_find_target_lock);
 
 module_init(init);
 module_exit(fini);
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
index 341e845f4..8ca402564 100644
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -50,7 +50,7 @@ set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
 
 /* Return 0 if there was an error. */
 static inline int
-set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
+set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward)
 {
 	struct tcphdr tcph;
 	u_int16_t diffs[2];
@@ -74,11 +74,15 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
 		if (!skb_ip_make_writable(pskb,
 					  (*pskb)->nh.iph->ihl*4+sizeof(tcph)))
 			return 0;
-		tcph.check = csum_fold(csum_partial((char *)diffs,
-		                                    sizeof(diffs),
-		                                    tcph.check^0xFFFF));
+		if ((*pskb)->ip_summed != CHECKSUM_HW)
+			tcph.check = csum_fold(csum_partial((char *)diffs,
+					       sizeof(diffs),
+					       tcph.check^0xFFFF));
 		memcpy((*pskb)->data + (*pskb)->nh.iph->ihl*4,
 		       &tcph, sizeof(tcph));
+		if ((*pskb)->ip_summed == CHECKSUM_HW)
+			if (skb_checksum_help(pskb, inward))
+				return 0;
 		(*pskb)->nfcache |= NFC_ALTERED;
 	}
 	return 1;
@@ -100,7 +104,7 @@ target(struct sk_buff **pskb,
 
 	if (einfo->operation & (IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR)
 	    && (*pskb)->nh.iph->protocol == IPPROTO_TCP)
-		if (!set_ect_tcp(pskb, einfo))
+		if (!set_ect_tcp(pskb, einfo, (out == NULL)))
 			return NF_DROP;
 
 	return IPT_CONTINUE;
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c
index 369f84b4c..4ef4782c9 100644
--- a/net/ipv4/netfilter/ipt_TCPMSS.c
+++ b/net/ipv4/netfilter/ipt_TCPMSS.c
@@ -186,8 +186,9 @@ ipt_tcpmss_target(struct sk_buff **pskb,
 	       newmss);
 
  retmodified:
-	/* If we had a hardware checksum before, it's now invalid */
-	(*pskb)->ip_summed = CHECKSUM_NONE;
+	/* We never hw checksum SYN packets.  */
+	BUG_ON((*pskb)->ip_summed == CHECKSUM_HW);
+
 	(*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED;
 	return IPT_CONTINUE;
 }
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index eda86a22a..08b786ac3 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -175,7 +175,7 @@ static int ip_recent_get_info(char *buffer, char **start, off_t offset, int leng
  * clear         -- Flush table, remove all entries
  */
 
-static int ip_recent_ctrl(struct file *file, const char *input, unsigned long size, void *data)
+static int ip_recent_ctrl(struct file *file, const char __user *input, unsigned long size, void *data)
 {
 	static const u_int32_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
 	u_int32_t val;
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 416e2e552..be47cbec5 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -88,7 +88,7 @@ static struct file_operations sockstat_seq_fops = {
 };
 
 static unsigned long
-fold_field(void *mib[], int nr)
+__fold_field(void *mib[], int offt)
 {
 	unsigned long res = 0;
 	int i;
@@ -98,14 +98,41 @@ fold_field(void *mib[], int nr)
 			continue;
 		res +=
 		    *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
-					 sizeof (unsigned long) * nr));
+					 offt));
 		res +=
 		    *((unsigned long *) (((void *) per_cpu_ptr(mib[1], i)) +
-					 sizeof (unsigned long) * nr));
+					 offt));
 	}
 	return res;
 }
 
+#define fold_field(_mib, _nr)	__fold_field(_mib, (sizeof(unsigned long) * (_nr)))
+
+/* snmp items */
+static struct snmp_item snmp4_ipstats_list[] = {
+#define __SNMP_GEN(x,y)	SNMP_ITEM(struct ipstats_mib, x, y)
+#define SNMP_GEN(x)	__SNMP_GEN(x, #x)
+	SNMP_GEN(InReceives),
+	SNMP_GEN(InHdrErrors),
+	SNMP_GEN(InAddrErrors),
+	__SNMP_GEN(OutForwDatagrams,"ForwDatagrams"),	/* for backward compatibility */
+	SNMP_GEN(InUnknownProtos),
+	SNMP_GEN(InDiscards),
+	SNMP_GEN(InDelivers),
+	SNMP_GEN(OutRequests),
+	SNMP_GEN(OutDiscards),
+	SNMP_GEN(OutNoRoutes),
+	SNMP_GEN(ReasmTimeout),
+	SNMP_GEN(ReasmReqds),
+	SNMP_GEN(ReasmOKs),
+	SNMP_GEN(ReasmFails),
+	SNMP_GEN(FragOKs),
+	SNMP_GEN(FragFails),
+	SNMP_GEN(FragCreates),
+	SNMP_ITEM_SENTINEL
+#undef SNMP_GEN
+};
+
 /*
  *	Called from the PROCfs module. This outputs /proc/net/snmp.
  */
@@ -113,17 +140,18 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
 {
 	int i;
 
-	seq_printf(seq, "Ip: Forwarding DefaultTTL InReceives InHdrErrors "
-			"InAddrErrors ForwDatagrams InUnknownProtos "
-			"InDiscards InDelivers OutRequests OutDiscards "
-			"OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs "
-			"ReasmFails FragOKs FragFails FragCreates\nIp: %d %d",
+	seq_printf(seq, "Ip: Forwarding DefaultTTL");
+
+	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_ipstats_list[i].name);
+
+	seq_printf(seq, "\nIp: %d %d",
 			ipv4_devconf.forwarding ? 1 : 2, sysctl_ip_default_ttl);
 
-	for (i = 0;
-	     i < offsetof(struct ip_mib, __pad) / sizeof(unsigned long); i++)
+	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
 		seq_printf(seq, " %lu",
-			   fold_field((void **) ip_statistics, i));
+			   __fold_field((void **) ip_statistics, 
+					snmp4_ipstats_list[i].offset));
 
 	seq_printf(seq, "\nIcmp: InMsgs InErrors InDestUnreachs InTimeExcds "
 			"InParmProbs InSrcQuenchs InRedirects InEchos "
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index d7b9238d1..b941c00dd 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -319,7 +319,7 @@ error_fault:
 	err = -EFAULT;
 	kfree_skb(skb);
 error:
-	IP_INC_STATS(IpOutDiscards);
+	IP_INC_STATS(OutDiscards);
 	return err; 
 }
 
@@ -568,7 +568,7 @@ static int raw_init(struct sock *sk)
 	return 0;
 }
 
-static int raw_seticmpfilter(struct sock *sk, char *optval, int optlen)
+static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
 {
 	if (optlen > sizeof(struct icmp_filter))
 		optlen = sizeof(struct icmp_filter);
@@ -577,7 +577,7 @@ static int raw_seticmpfilter(struct sock *sk, char *optval, int optlen)
 	return 0;
 }
 
-static int raw_geticmpfilter(struct sock *sk, char *optval, int *optlen)
+static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *optlen)
 {
 	int len, ret = -EFAULT;
 
@@ -597,7 +597,7 @@ out:	return ret;
 }
 
 static int raw_setsockopt(struct sock *sk, int level, int optname, 
-			  char *optval, int optlen)
+			  char __user *optval, int optlen)
 {
 	if (level != SOL_RAW)
 		return ip_setsockopt(sk, level, optname, optval, optlen);
@@ -612,7 +612,7 @@ static int raw_setsockopt(struct sock *sk, int level, int optname,
 }
 
 static int raw_getsockopt(struct sock *sk, int level, int optname, 
-			  char *optval, int *optlen)
+			  char __user *optval, int __user *optlen)
 {
 	if (level != SOL_RAW)
 		return ip_getsockopt(sk, level, optname, optval, optlen);
@@ -631,7 +631,7 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
 	switch (cmd) {
 		case SIOCOUTQ: {
 			int amount = atomic_read(&sk->sk_wmem_alloc);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 		case SIOCINQ: {
 			struct sk_buff *skb;
@@ -642,12 +642,12 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
 			if (skb != NULL)
 				amount = skb->len;
 			spin_unlock_irq(&sk->sk_receive_queue.lock);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 
 		default:
 #ifdef CONFIG_IP_MROUTE
-			return ipmr_ioctl(sk, cmd, arg);
+			return ipmr_ioctl(sk, cmd, (void __user *)arg);
 #else
 			return -ENOIOCTLCMD;
 #endif
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0c6d85976..a570e709f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -138,6 +138,7 @@ static struct timer_list rt_secret_timer;
 
 static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie);
 static void		 ipv4_dst_destroy(struct dst_entry *dst);
+static void		 ipv4_dst_ifdown(struct dst_entry *dst, int how);
 static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst);
 static void		 ipv4_link_failure(struct sk_buff *skb);
 static void		 ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu);
@@ -150,6 +151,7 @@ static struct dst_ops ipv4_dst_ops = {
 	.gc =			rt_garbage_collect,
 	.check =		ipv4_dst_check,
 	.destroy =		ipv4_dst_destroy,
+	.ifdown =		ipv4_dst_ifdown,
 	.negative_advice =	ipv4_negative_advice,
 	.link_failure =		ipv4_link_failure,
 	.update_pmtu =		ip_rt_update_pmtu,
@@ -1040,6 +1042,8 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
 				rt->u.dst.child		= NULL;
 				if (rt->u.dst.dev)
 					dev_hold(rt->u.dst.dev);
+				if (rt->idev)
+					in_dev_hold(rt->idev);
 				rt->u.dst.obsolete	= 0;
 				rt->u.dst.lastuse	= jiffies;
 				rt->u.dst.path		= &rt->u.dst;
@@ -1321,11 +1325,27 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
 {
 	struct rtable *rt = (struct rtable *) dst;
 	struct inet_peer *peer = rt->peer;
+	struct in_device *idev = rt->idev;
 
 	if (peer) {
 		rt->peer = NULL;
 		inet_putpeer(peer);
 	}
+
+	if (idev) {
+		rt->idev = NULL;
+		in_dev_put(idev);
+	}
+}
+
+static void ipv4_dst_ifdown(struct dst_entry *dst, int how)
+{
+	struct rtable *rt = (struct rtable *) dst;
+	struct in_device *idev = rt->idev;
+	if (idev) {
+		rt->idev = NULL;
+		in_dev_put(idev);
+	}
 }
 
 static void ipv4_link_failure(struct sk_buff *skb)
@@ -1339,8 +1359,10 @@ static void ipv4_link_failure(struct sk_buff *skb)
 		dst_set_expires(&rt->u.dst, 0);
 }
 
-static int ip_rt_bug(struct sk_buff *skb)
+static int ip_rt_bug(struct sk_buff **pskb)
 {
+	struct sk_buff *skb = *pskb;
+
 	printk(KERN_DEBUG "ip_rt_bug: %u.%u.%u.%u -> %u.%u.%u.%u, %s\n",
 		NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr),
 		skb->dev ? skb->dev->name : "?");
@@ -1486,6 +1508,7 @@ static int ip_route_input_mc(struct sk_buff *skb, u32 daddr, u32 saddr,
 	rth->fl.iif	= dev->ifindex;
 	rth->u.dst.dev	= &loopback_dev;
 	dev_hold(rth->u.dst.dev);
+	rth->idev	= in_dev_get(rth->u.dst.dev);
 	rth->fl.oif	= 0;
 	rth->rt_gateway	= daddr;
 	rth->rt_spec_dst= spec_dst;
@@ -1695,6 +1718,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
 	rth->fl.iif	= dev->ifindex;
 	rth->u.dst.dev	= out_dev->dev;
 	dev_hold(rth->u.dst.dev);
+	rth->idev	= in_dev_get(rth->u.dst.dev);
 	rth->fl.oif 	= 0;
 	rth->rt_spec_dst= spec_dst;
 
@@ -1774,6 +1798,7 @@ local_input:
 	rth->fl.iif	= dev->ifindex;
 	rth->u.dst.dev	= &loopback_dev;
 	dev_hold(rth->u.dst.dev);
+	rth->idev	= in_dev_get(rth->u.dst.dev);
 	rth->rt_gateway	= daddr;
 	rth->rt_spec_dst= spec_dst;
 	rth->u.dst.input= ip_local_deliver;
@@ -2157,6 +2182,7 @@ make_route:
 	rth->rt_iif	= oldflp->oif ? : dev_out->ifindex;
 	rth->u.dst.dev	= dev_out;
 	dev_hold(dev_out);
+	rth->idev	= in_dev_get(dev_out);
 	rth->rt_gateway = fl.fl4_dst;
 	rth->rt_spec_dst= fl.fl4_src;
 
@@ -2482,7 +2508,7 @@ void ip_rt_multicast_event(struct in_device *in_dev)
 static int flush_delay;
 
 static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
-					struct file *filp, void *buffer,
+					struct file *filp, void __user *buffer,
 					size_t *lenp)
 {
 	if (write) {
@@ -2494,15 +2520,19 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
 	return -EINVAL;
 }
 
-static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, int *name,
-						int nlen, void *oldval,
-						size_t *oldlenp, void *newval,
-						size_t newlen, void **context)
+static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
+						int __user *name,
+						int nlen,
+						void __user *oldval,
+						size_t __user *oldlenp,
+						void __user *newval,
+						size_t newlen,
+						void **context)
 {
 	int delay;
 	if (newlen != sizeof(int))
 		return -EINVAL;
-	if (get_user(delay, (int *)newval))
+	if (get_user(delay, (int __user *)newval))
 		return -EFAULT; 
 	rt_cache_flush(delay); 
 	return 0;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 4a98b0b72..6b0b74430 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -62,7 +62,7 @@ extern ctl_table ipv4_route_table[];
 
 static
 int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
-			void *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp)
 {
 	int val = ipv4_devconf.forwarding;
 	int ret;
@@ -75,9 +75,10 @@ int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
 	return ret;
 }
 
-static int ipv4_sysctl_forward_strategy(ctl_table *table, int *name, int nlen,
-			 void *oldval, size_t *oldlenp,
-			 void *newval, size_t newlen, 
+static int ipv4_sysctl_forward_strategy(ctl_table *table,
+			 int __user *name, int nlen,
+			 void __user *oldval, size_t __user *oldlenp,
+			 void __user *newval, size_t newlen, 
 			 void **context)
 {
 	int *valp = table->data;
@@ -89,7 +90,7 @@ static int ipv4_sysctl_forward_strategy(ctl_table *table, int *name, int nlen,
 	if (newlen != sizeof(int))
 		return -EINVAL;
 
-	if (get_user(new, (int *)newval))
+	if (get_user(new, (int __user *)newval))
 		return -EFAULT;
 
 	if (new == *valp)
@@ -665,6 +666,22 @@ ctl_table ipv4_table[] = {
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+	{
+		.ctl_name	= NET_TCP_DEFAULT_WIN_SCALE,
+		.procname	= "tcp_default_win_scale",
+		.data		= &sysctl_tcp_default_win_scale,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+	{
+		.ctl_name	= NET_TCP_MODERATE_RCVBUF,
+		.procname	= "tcp_moderate_rcvbuf",
+		.data		= &sysctl_tcp_moderate_rcvbuf,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
 	{ .ctl_name = 0 }
 };
 
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f5d991b37..260cb4032 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -276,6 +276,8 @@ kmem_cache_t *tcp_timewait_cachep;
 
 atomic_t tcp_orphan_count = ATOMIC_INIT(0);
 
+int sysctl_tcp_default_win_scale;
+
 int sysctl_tcp_mem[3];
 int sysctl_tcp_wmem[3] = { 4 * 1024, 16 * 1024, 128 * 1024 };
 int sysctl_tcp_rmem[3] = { 4 * 1024, 87380, 87380 * 2 };
@@ -528,7 +530,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 		return -ENOIOCTLCMD;
 	};
 
-	return put_user(answ, (int *)arg);
+	return put_user(answ, (int __user *)arg);
 }
 
 
@@ -646,7 +648,7 @@ static void tcp_listen_stop (struct sock *sk)
 		local_bh_enable();
 		sock_put(child);
 
-		tcp_acceptq_removed(sk);
+		sk_acceptq_removed(sk);
 		tcp_openreq_fastfree(req);
 	}
 	BUG_TRAP(!sk->sk_ack_backlog);
@@ -964,7 +966,7 @@ ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
 #define TCP_PAGE(sk)	(inet_sk(sk)->sndmsg_page)
 #define TCP_OFF(sk)	(inet_sk(sk)->sndmsg_off)
 
-static inline int tcp_copy_to_page(struct sock *sk, char *from,
+static inline int tcp_copy_to_page(struct sock *sk, char __user *from,
 				   struct sk_buff *skb, struct page *page,
 				   int off, int copy)
 {
@@ -989,7 +991,7 @@ static inline int tcp_copy_to_page(struct sock *sk, char *from,
 	return 0;
 }
 
-static inline int skb_add_data(struct sk_buff *skb, char *from, int copy)
+static inline int skb_add_data(struct sk_buff *skb, char __user *from, int copy)
 {
 	int err = 0;
 	unsigned int csum;
@@ -1063,7 +1065,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 
 	while (--iovlen >= 0) {
 		int seglen = iov->iov_len;
-		unsigned char *from = iov->iov_base;
+		unsigned char __user *from = iov->iov_base;
 
 		iov++;
 
@@ -1294,18 +1296,6 @@ static int tcp_recv_urg(struct sock *sk, long timeo,
 	return -EAGAIN;
 }
 
-/*
- *	Release a skb if it is no longer needed. This routine
- *	must be called with interrupts disabled or with the
- *	socket locked so that the sk_buff queue operation is ok.
- */
-
-static inline void tcp_eat_skb(struct sock *sk, struct sk_buff *skb)
-{
-	__skb_unlink(skb, &sk->sk_receive_queue);
-	__kfree_skb(skb);
-}
-
 /* Clean up the receive buffer for full frames taken by the user,
  * then send an ACK if necessary.  COPIED is the number of bytes
  * tcp_recvmsg has given to the user so far, it speeds up the
@@ -1366,31 +1356,6 @@ static void cleanup_rbuf(struct sock *sk, int copied)
 		tcp_send_ack(sk);
 }
 
-/* Now socket state including sk->sk_err is changed only under lock,
- * hence we may omit checks after joining wait queue.
- * We check receive queue before schedule() only as optimization;
- * it is very likely that release_sock() added new data.
- */
-
-static long tcp_data_wait(struct sock *sk, long timeo)
-{
-	DEFINE_WAIT(wait);
-
-	prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
-
-	set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
-	release_sock(sk);
-
-	if (skb_queue_empty(&sk->sk_receive_queue))
-		timeo = schedule_timeout(timeo);
-
-	lock_sock(sk);
-	clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
-
-	finish_wait(sk->sk_sleep, &wait);
-	return timeo;
-}
-
 static void tcp_prequeue_process(struct sock *sk)
 {
 	struct sk_buff *skb;
@@ -1471,15 +1436,18 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
 				break;
 		}
 		if (skb->h.th->fin) {
-			tcp_eat_skb(sk, skb);
+			sk_eat_skb(sk, skb);
 			++seq;
 			break;
 		}
-		tcp_eat_skb(sk, skb);
+		sk_eat_skb(sk, skb);
 		if (!desc->count)
 			break;
 	}
 	tp->copied_seq = seq;
+
+	tcp_rcv_space_adjust(sk);
+
 	/* Clean up data we have read: This will do ACK frames. */
 	if (copied)
 		cleanup_rbuf(sk, copied);
@@ -1667,9 +1635,8 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 			/* Do not sleep, just process backlog. */
 			release_sock(sk);
 			lock_sock(sk);
-		} else {
-			timeo = tcp_data_wait(sk, timeo);
-		}
+		} else
+			sk_wait_data(sk, &timeo);
 
 		if (user_recv) {
 			int chunk;
@@ -1740,6 +1707,8 @@ do_prequeue:
 		copied += used;
 		len -= used;
 
+		tcp_rcv_space_adjust(sk);
+
 skip_copy:
 		if (tp->urg_data && after(tp->copied_seq, tp->urg_seq)) {
 			tp->urg_data = 0;
@@ -1751,14 +1720,14 @@ skip_copy:
 		if (skb->h.th->fin)
 			goto found_fin_ok;
 		if (!(flags & MSG_PEEK))
-			tcp_eat_skb(sk, skb);
+			sk_eat_skb(sk, skb);
 		continue;
 
 	found_fin_ok:
 		/* Process the FIN. */
 		++*seq;
 		if (!(flags & MSG_PEEK))
-			tcp_eat_skb(sk, skb);
+			sk_eat_skb(sk, skb);
 		break;
 	} while (len > 0);
 
@@ -2256,7 +2225,7 @@ struct sock *tcp_accept(struct sock *sk, int flags, int *err)
 		tp->accept_queue_tail = NULL;
 
  	newsk = req->sk;
-	tcp_acceptq_removed(sk);
+	sk_acceptq_removed(sk);
 	tcp_openreq_fastfree(req);
 	BUG_TRAP(newsk->sk_state != TCP_SYN_RECV);
 	release_sock(sk);
@@ -2271,7 +2240,7 @@ out:
 /*
  *	Socket option code for TCP.
  */
-int tcp_setsockopt(struct sock *sk, int level, int optname, char *optval,
+int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
 		   int optlen)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
@@ -2285,7 +2254,7 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char *optval,
 	if (optlen < sizeof(int))
 		return -EINVAL;
 
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 
 	lock_sock(sk);
@@ -2435,8 +2404,8 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char *optval,
 	return err;
 }
 
-int tcp_getsockopt(struct sock *sk, int level, int optname, char *optval,
-		   int *optlen)
+int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
+		   int __user *optlen)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
 	int val, len;
@@ -2491,56 +2460,11 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char *optval,
 		break;
 	case TCP_INFO: {
 		struct tcp_info info;
-		u32 now = tcp_time_stamp;
 
 		if (get_user(len, optlen))
 			return -EFAULT;
-		info.tcpi_state = sk->sk_state;
-		info.tcpi_ca_state = tp->ca_state;
-		info.tcpi_retransmits = tp->retransmits;
-		info.tcpi_probes = tp->probes_out;
-		info.tcpi_backoff = tp->backoff;
-		info.tcpi_options = 0;
-		if (tp->tstamp_ok)
-			info.tcpi_options |= TCPI_OPT_TIMESTAMPS;
-		if (tp->sack_ok)
-			info.tcpi_options |= TCPI_OPT_SACK;
-		if (tp->wscale_ok) {
-			info.tcpi_options |= TCPI_OPT_WSCALE;
-			info.tcpi_snd_wscale = tp->snd_wscale;
-			info.tcpi_rcv_wscale = tp->rcv_wscale;
-		} else {
-			info.tcpi_snd_wscale = 0;
-			info.tcpi_rcv_wscale = 0;
-		}
-		if (tp->ecn_flags & TCP_ECN_OK)
-			info.tcpi_options |= TCPI_OPT_ECN;
-
-		info.tcpi_rto = (1000000 * tp->rto) / HZ;
-		info.tcpi_ato = (1000000 * tp->ack.ato) / HZ;
-		info.tcpi_snd_mss = tp->mss_cache_std;
-		info.tcpi_rcv_mss = tp->ack.rcv_mss;
-
-		info.tcpi_unacked = tp->packets_out;
-		info.tcpi_sacked = tp->sacked_out;
-		info.tcpi_lost = tp->lost_out;
-		info.tcpi_retrans = tp->retrans_out;
-		info.tcpi_fackets = tp->fackets_out;
-
-		info.tcpi_last_data_sent = ((now - tp->lsndtime) * 1000) / HZ;
-		info.tcpi_last_ack_sent = 0;
-		info.tcpi_last_data_recv = ((now -
-					     tp->ack.lrcvtime) * 1000) / HZ;
-		info.tcpi_last_ack_recv = ((now - tp->rcv_tstamp) * 1000) / HZ;
-
-		info.tcpi_pmtu = tp->pmtu_cookie;
-		info.tcpi_rcv_ssthresh = tp->rcv_ssthresh;
-		info.tcpi_rtt = ((1000000 * tp->srtt) / HZ) >> 3;
-		info.tcpi_rttvar = ((1000000 * tp->mdev) / HZ) >> 2;
-		info.tcpi_snd_ssthresh = tp->snd_ssthresh;
-		info.tcpi_snd_cwnd = tp->snd_cwnd;
-		info.tcpi_advmss = tp->advmss;
-		info.tcpi_reordering = tp->reordering;
+
+		tcp_get_info(sk, &info);
 
 		len = min_t(unsigned int, len, sizeof(info));
 		if (put_user(len, optlen))
@@ -2675,10 +2599,6 @@ void __init tcp_init(void)
 	sysctl_tcp_mem[0] =  768 << order;
 	sysctl_tcp_mem[1] = 1024 << order;
 	sysctl_tcp_mem[2] = 1536 << order;
-	if (sysctl_tcp_mem[2] - sysctl_tcp_mem[1] > 512)
-		sysctl_tcp_mem[1] = sysctl_tcp_mem[2] - 512;
-	if (sysctl_tcp_mem[1] - sysctl_tcp_mem[0] > 512)
-		sysctl_tcp_mem[0] = sysctl_tcp_mem[1] - 512;
 
 	if (order < 3) {
 		sysctl_tcp_wmem[2] = 64 * 1024;
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 305fe2eae..5506944b7 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -41,6 +41,61 @@ static struct sock *tcpnl;
    rta->rta_len = rtalen;                   \
    RTA_DATA(rta); })
 
+/* Return information about state of tcp endpoint in API format. */
+void tcp_get_info(struct sock *sk, struct tcp_info *info)
+{
+	struct tcp_opt *tp = tcp_sk(sk);
+	u32 now = tcp_time_stamp;
+
+	memset(info, 0, sizeof(*info));
+
+	info->tcpi_state = sk->sk_state;
+	info->tcpi_ca_state = tp->ca_state;
+	info->tcpi_retransmits = tp->retransmits;
+	info->tcpi_probes = tp->probes_out;
+	info->tcpi_backoff = tp->backoff;
+
+	if (tp->tstamp_ok)
+		info->tcpi_options |= TCPI_OPT_TIMESTAMPS;
+	if (tp->sack_ok)
+		info->tcpi_options |= TCPI_OPT_SACK;
+	if (tp->wscale_ok) {
+		info->tcpi_options |= TCPI_OPT_WSCALE;
+		info->tcpi_snd_wscale = tp->snd_wscale;
+		info->tcpi_rcv_wscale = tp->rcv_wscale;
+	} 
+
+	if (tp->ecn_flags&TCP_ECN_OK)
+		info->tcpi_options |= TCPI_OPT_ECN;
+
+	info->tcpi_rto = (1000000*tp->rto)/HZ;
+	info->tcpi_ato = (1000000*tp->ack.ato)/HZ;
+	info->tcpi_snd_mss = tp->mss_cache;
+	info->tcpi_rcv_mss = tp->ack.rcv_mss;
+
+	info->tcpi_unacked = tp->packets_out;
+	info->tcpi_sacked = tp->sacked_out;
+	info->tcpi_lost = tp->lost_out;
+	info->tcpi_retrans = tp->retrans_out;
+	info->tcpi_fackets = tp->fackets_out;
+
+	info->tcpi_last_data_sent = ((now - tp->lsndtime)*1000)/HZ;
+	info->tcpi_last_data_recv = ((now - tp->ack.lrcvtime)*1000)/HZ;
+	info->tcpi_last_ack_recv = ((now - tp->rcv_tstamp)*1000)/HZ;
+
+	info->tcpi_pmtu = tp->pmtu_cookie;
+	info->tcpi_rcv_ssthresh = tp->rcv_ssthresh;
+	info->tcpi_rtt = ((1000000*tp->srtt)/HZ)>>3;
+	info->tcpi_rttvar = ((1000000*tp->mdev)/HZ)>>2;
+	info->tcpi_snd_ssthresh = tp->snd_ssthresh;
+	info->tcpi_snd_cwnd = tp->snd_cwnd;
+	info->tcpi_advmss = tp->advmss;
+	info->tcpi_reordering = tp->reordering;
+
+	info->tcpi_rcv_rtt = ((1000000*tp->rcv_rtt_est.rtt)/HZ)>>3;
+	info->tcpi_rcv_space = tp->rcvq_space.space;
+}
+
 static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
 			int ext, u32 pid, u32 seq)
 {
@@ -150,55 +205,8 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
 		minfo->tcpdiag_tmem = atomic_read(&sk->sk_wmem_alloc);
 	}
 
-	if (info) {
-		u32 now = tcp_time_stamp;
-
-		info->tcpi_state = sk->sk_state;
-		info->tcpi_ca_state = tp->ca_state;
-		info->tcpi_retransmits = tp->retransmits;
-		info->tcpi_probes = tp->probes_out;
-		info->tcpi_backoff = tp->backoff;
-		info->tcpi_options = 0;
-		if (tp->tstamp_ok)
-			info->tcpi_options |= TCPI_OPT_TIMESTAMPS;
-		if (tp->sack_ok)
-			info->tcpi_options |= TCPI_OPT_SACK;
-		if (tp->wscale_ok) {
-			info->tcpi_options |= TCPI_OPT_WSCALE;
-			info->tcpi_snd_wscale = tp->snd_wscale;
-			info->tcpi_rcv_wscale = tp->rcv_wscale;
-		} else {
-			info->tcpi_snd_wscale = 0;
-			info->tcpi_rcv_wscale = 0;
-		}
-		if (tp->ecn_flags&TCP_ECN_OK)
-			info->tcpi_options |= TCPI_OPT_ECN;
-
-		info->tcpi_rto = (1000000*tp->rto)/HZ;
-		info->tcpi_ato = (1000000*tp->ack.ato)/HZ;
-		info->tcpi_snd_mss = tp->mss_cache;
-		info->tcpi_rcv_mss = tp->ack.rcv_mss;
-
-		info->tcpi_unacked = tp->packets_out;
-		info->tcpi_sacked = tp->sacked_out;
-		info->tcpi_lost = tp->lost_out;
-		info->tcpi_retrans = tp->retrans_out;
-		info->tcpi_fackets = tp->fackets_out;
-
-		info->tcpi_last_data_sent = ((now - tp->lsndtime)*1000)/HZ;
-		info->tcpi_last_ack_sent = 0;
-		info->tcpi_last_data_recv = ((now - tp->ack.lrcvtime)*1000)/HZ;
-		info->tcpi_last_ack_recv = ((now - tp->rcv_tstamp)*1000)/HZ;
-
-		info->tcpi_pmtu = tp->pmtu_cookie;
-		info->tcpi_rcv_ssthresh = tp->rcv_ssthresh;
-		info->tcpi_rtt = ((1000000*tp->srtt)/HZ)>>3;
-		info->tcpi_rttvar = ((1000000*tp->mdev)/HZ)>>2;
-		info->tcpi_snd_ssthresh = tp->snd_ssthresh;
-		info->tcpi_snd_cwnd = tp->snd_cwnd;
-		info->tcpi_advmss = tp->advmss;
-		info->tcpi_reordering = tp->reordering;
-	}
+	if (info) 
+		tcp_get_info(sk, info);
 
 	if (vinfo) {
 		vinfo->tcpv_enabled = tp->vegas.doing_vegas_now;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 1890be674..c0a0b65f5 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -90,6 +90,8 @@ int sysctl_tcp_nometrics_save;
 int sysctl_tcp_westwood;
 int sysctl_tcp_vegas_cong_avoid;
 
+int sysctl_tcp_moderate_rcvbuf;
+
 /* Default values of the Vegas variables, in fixed-point representation
  * with V_PARAM_SHIFT bits to the right of the binary point.
  */
@@ -305,6 +307,8 @@ static void tcp_init_buffer_space(struct sock *sk)
 	if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK))
 		tcp_fixup_sndbuf(sk);
 
+	tp->rcvq_space.space = tp->rcv_wnd;
+
 	maxwin = tcp_full_space(sk);
 
 	if (tp->window_clamp >= maxwin) {
@@ -364,6 +368,130 @@ static void tcp_clamp_window(struct sock *sk, struct tcp_opt *tp)
 	}
 }
 
+/* Receiver "autotuning" code.
+ *
+ * The algorithm for RTT estimation w/o timestamps is based on
+ * Dynamic Right-Sizing (DRS) by Wu Feng and Mike Fisk of LANL.
+ * <http://www.lanl.gov/radiant/website/pubs/drs/lacsi2001.ps>
+ *
+ * More detail on this code can be found at
+ * <http://www.psc.edu/~jheffner/senior_thesis.ps>,
+ * though this reference is out of date.  A new paper
+ * is pending.
+ */
+static void tcp_rcv_rtt_update(struct tcp_opt *tp, u32 sample, int win_dep)
+{
+	u32 new_sample = tp->rcv_rtt_est.rtt;
+	long m = sample;
+
+	if (m == 0)
+		m = 1;
+
+	if (new_sample != 0) {
+		/* If we sample in larger samples in the non-timestamp
+		 * case, we could grossly overestimate the RTT especially
+		 * with chatty applications or bulk transfer apps which
+		 * are stalled on filesystem I/O.
+		 *
+		 * Also, since we are only going for a minimum in the
+		 * non-timestamp case, we do not smoothe things out
+		 * else with timestamps disabled convergance takes too
+		 * long.
+		 */
+		if (!win_dep) {
+			m -= (new_sample >> 3);
+			new_sample += m;
+		} else if (m < new_sample)
+			new_sample = m << 3;
+	} else {
+		/* No previous mesaure. */
+		new_sample = m << 3;
+	}
+
+	if (tp->rcv_rtt_est.rtt != new_sample)
+		tp->rcv_rtt_est.rtt = new_sample;
+}
+
+static inline void tcp_rcv_rtt_measure(struct tcp_opt *tp)
+{
+	if (tp->rcv_rtt_est.time == 0)
+		goto new_measure;
+	if (before(tp->rcv_nxt, tp->rcv_rtt_est.seq))
+		return;
+	tcp_rcv_rtt_update(tp,
+			   jiffies - tp->rcv_rtt_est.time,
+			   1);
+
+new_measure:
+	tp->rcv_rtt_est.seq = tp->rcv_nxt + tp->rcv_wnd;
+	tp->rcv_rtt_est.time = tcp_time_stamp;
+}
+
+static inline void tcp_rcv_rtt_measure_ts(struct tcp_opt *tp, struct sk_buff *skb)
+{
+	if (tp->rcv_tsecr &&
+	    (TCP_SKB_CB(skb)->end_seq -
+	     TCP_SKB_CB(skb)->seq >= tp->ack.rcv_mss))
+		tcp_rcv_rtt_update(tp, tcp_time_stamp - tp->rcv_tsecr, 0);
+}
+
+/*
+ * This function should be called every time data is copied to user space.
+ * It calculates the appropriate TCP receive buffer space.
+ */
+void tcp_rcv_space_adjust(struct sock *sk)
+{
+	struct tcp_opt *tp = tcp_sk(sk);
+	int time;
+	int space;
+	
+	if (tp->rcvq_space.time == 0)
+		goto new_measure;
+	
+	time = tcp_time_stamp - tp->rcvq_space.time;
+	if (time < (tp->rcv_rtt_est.rtt >> 3) ||
+	    tp->rcv_rtt_est.rtt == 0)
+		return;
+	
+	space = 2 * (tp->copied_seq - tp->rcvq_space.seq);
+
+	space = max(tp->rcvq_space.space, space);
+
+	if (tp->rcvq_space.space != space) {
+		int rcvmem;
+
+		tp->rcvq_space.space = space;
+
+		if (sysctl_tcp_moderate_rcvbuf) {
+			int new_clamp = space;
+
+			/* Receive space grows, normalize in order to
+			 * take into account packet headers and sk_buff
+			 * structure overhead.
+			 */
+			space /= tp->advmss;
+			if (!space)
+				space = 1;
+			rcvmem = (tp->advmss + MAX_TCP_HEADER +
+				  16 + sizeof(struct sk_buff));
+			while (tcp_win_from_space(rcvmem) < tp->advmss)
+				rcvmem += 128;
+			space *= rcvmem;
+			space = min(space, sysctl_tcp_rmem[2]);
+			if (space > sk->sk_rcvbuf) {
+				sk->sk_rcvbuf = space;
+
+				/* Make the window clamp follow along.  */
+				tp->window_clamp = new_clamp;
+			}
+		}
+	}
+	
+new_measure:
+	tp->rcvq_space.seq = tp->copied_seq;
+	tp->rcvq_space.time = tcp_time_stamp;
+}
+
 /* There is something which you must keep in mind when you analyze the
  * behavior of the tp->ato delayed ack timeout interval.  When a
  * connection starts up, we want to ack as quickly as possible.  The
@@ -382,6 +510,8 @@ static void tcp_event_data_recv(struct sock *sk, struct tcp_opt *tp, struct sk_b
 
 	tcp_measure_rcv_mss(tp, skb);
 
+	tcp_rcv_rtt_measure(tp);
+	
 	now = tcp_time_stamp;
 
 	if (!tp->ack.ato) {
@@ -3318,6 +3448,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 				tp->ucopy.len -= chunk;
 				tp->copied_seq += chunk;
 				eaten = (chunk == skb->len && !th->fin);
+				tcp_rcv_space_adjust(sk);
 			}
 			local_bh_disable();
 		}
@@ -3918,6 +4049,7 @@ static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen)
 	if (!err) {
 		tp->ucopy.len -= chunk;
 		tp->copied_seq += chunk;
+		tcp_rcv_space_adjust(sk);
 	}
 
 	local_bh_disable();
@@ -4045,6 +4177,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 				    (sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED) &&
 				    tp->rcv_nxt == tp->rcv_wup)
 					tcp_store_ts_recent(tp);
+
+				tcp_rcv_rtt_measure_ts(tp, skb);
+
 				/* We know that such packets are checksummed
 				 * on entry.
 				 */
@@ -4076,6 +4211,8 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 					    tp->rcv_nxt == tp->rcv_wup)
 						tcp_store_ts_recent(tp);
 
+					tcp_rcv_rtt_measure_ts(tp, skb);
+
 					__skb_pull(skb, tcp_header_len);
 					tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
 					NET_INC_STATS_BH(TCPHPHitsToUser);
@@ -4095,6 +4232,8 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 				    tp->rcv_nxt == tp->rcv_wup)
 					tcp_store_ts_recent(tp);
 
+				tcp_rcv_rtt_measure_ts(tp, skb);
+
 				if ((int)skb->truesize > sk->sk_forward_alloc)
 					goto step5;
 
@@ -4191,6 +4330,8 @@ step5:
 	if(th->ack)
 		tcp_ack(sk, skb, FLAG_SLOWPATH);
 
+	tcp_rcv_rtt_measure_ts(tp, skb);
+
 	/* Process urgent data. */
 	tcp_urg(sk, skb, th);
 
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index ac9211504..e5d1364dd 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1290,12 +1290,12 @@ static struct dst_entry* tcp_v4_route_req(struct sock *sk,
 					 .dport = req->rmt_port } } };
 
 	if (ip_route_output_flow(&rt, &fl, sk, 0)) {
-		IP_INC_STATS_BH(IpOutNoRoutes);
+		IP_INC_STATS_BH(OutNoRoutes);
 		return NULL;
 	}
 	if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) {
 		ip_rt_put(rt);
-		IP_INC_STATS_BH(IpOutNoRoutes);
+		IP_INC_STATS_BH(OutNoRoutes);
 		return NULL;
 	}
 	return &rt->u.dst;
@@ -1442,7 +1442,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 	 * clogging syn queue with openreqs with exponentially increasing
 	 * timeout.
 	 */
-	if (tcp_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
+	if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
 		goto drop;
 
 	req = tcp_openreq_alloc();
@@ -1567,7 +1567,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 	struct tcp_opt *newtp;
 	struct sock *newsk;
 
-	if (tcp_acceptq_is_full(sk))
+	if (sk_acceptq_is_full(sk))
 		goto exit_overflow;
 
 	if (!dst && (dst = tcp_v4_route_req(sk, req)) == NULL)
@@ -2452,7 +2452,7 @@ static void get_openreq4(struct sock *sk, struct open_request *req,
 	int ttd = req->expires - jiffies;
 
 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X"
-		" %02X %08X:%08X %02X:%08X %08X %5d %8d %u %d %p",
+		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %p",
 		i,
 		req->af.v4_req.loc_addr,
 		ntohs(inet_sk(sk)->sport),
@@ -2526,7 +2526,7 @@ static void get_timewait4_sock(struct tcp_tw_bucket *tw, char *tmpbuf, int i)
 	srcp  = ntohs(tw->tw_sport);
 
 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X"
-		" %02X %08X:%08X %02X:%08X %08X %5d %8d %d %d %p",
+		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p",
 		i, src, srcp, dest, destp, tw->tw_substate, 0, 0,
 		3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
 		atomic_read(&tw->tw_refcnt), tw);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7cae8de08..bc5fba4a3 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1389,8 +1389,7 @@ void tcp_send_delayed_ack(struct sock *sk)
 	}
 	tp->ack.pending |= TCP_ACK_SCHED|TCP_ACK_TIMER;
 	tp->ack.timeout = timeout;
-	if (!mod_timer(&tp->delack_timer, timeout))
-		sock_hold(sk);
+	sk_reset_timer(sk, &tp->delack_timer, timeout);
 }
 
 /* This routine sends an ack and also updates the window. */
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 58796c6c9..cab2678b1 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -68,18 +68,13 @@ void tcp_clear_xmit_timers(struct sock *sk)
 	struct tcp_opt *tp = tcp_sk(sk);
 
 	tp->pending = 0;
-	if (timer_pending(&tp->retransmit_timer) &&
-	    del_timer(&tp->retransmit_timer))
-		__sock_put(sk);
+	sk_stop_timer(sk, &tp->retransmit_timer);
 
 	tp->ack.pending = 0;
 	tp->ack.blocked = 0;
-	if (timer_pending(&tp->delack_timer) &&
-	    del_timer(&tp->delack_timer))
-		__sock_put(sk);
+	sk_stop_timer(sk, &tp->delack_timer);
 
-	if (timer_pending(&sk->sk_timer) && del_timer(&sk->sk_timer))
-		__sock_put(sk);
+	sk_stop_timer(sk, &sk->sk_timer);
 }
 
 static void tcp_write_err(struct sock *sk)
@@ -218,8 +213,7 @@ static void tcp_delack_timer(unsigned long data)
 		/* Try again later. */
 		tp->ack.blocked = 1;
 		NET_INC_STATS_BH(DelayedACKLocked);
-		if (!mod_timer(&tp->delack_timer, jiffies + TCP_DELACK_MIN))
-			sock_hold(sk);
+		sk_reset_timer(sk, &tp->delack_timer, jiffies + TCP_DELACK_MIN);
 		goto out_unlock;
 	}
 
@@ -229,8 +223,7 @@ static void tcp_delack_timer(unsigned long data)
 		goto out;
 
 	if (time_after(tp->ack.timeout, jiffies)) {
-		if (!mod_timer(&tp->delack_timer, tp->ack.timeout))
-			sock_hold(sk);
+		sk_reset_timer(sk, &tp->delack_timer, tp->ack.timeout);
 		goto out;
 	}
 	tp->ack.pending &= ~TCP_ACK_TIMER;
@@ -429,8 +422,7 @@ static void tcp_write_timer(unsigned long data)
 	bh_lock_sock(sk);
 	if (sock_owned_by_user(sk)) {
 		/* Try again later */
-		if (!mod_timer(&tp->retransmit_timer, jiffies + (HZ/20)))
-			sock_hold(sk);
+		sk_reset_timer(sk, &tp->retransmit_timer, jiffies + (HZ / 20));
 		goto out_unlock;
 	}
 
@@ -438,8 +430,7 @@ static void tcp_write_timer(unsigned long data)
 		goto out;
 
 	if (time_after(tp->timeout, jiffies)) {
-		if (!mod_timer(&tp->retransmit_timer, tp->timeout))
-			sock_hold(sk);
+		sk_reset_timer(sk, &tp->retransmit_timer, tp->timeout);
 		goto out;
 	}
 
@@ -557,14 +548,12 @@ static void tcp_synack_timer(struct sock *sk)
 
 void tcp_delete_keepalive_timer (struct sock *sk)
 {
-	if (timer_pending(&sk->sk_timer) && del_timer (&sk->sk_timer))
-		__sock_put(sk);
+	sk_stop_timer(sk, &sk->sk_timer);
 }
 
 void tcp_reset_keepalive_timer (struct sock *sk, unsigned long len)
 {
-	if (!mod_timer(&sk->sk_timer, jiffies + len))
-		sock_hold(sk);
+	sk_reset_timer(sk, &sk->sk_timer, jiffies + len);
 }
 
 void tcp_set_keepalive(struct sock *sk, int val)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 05dcb54d5..a58375168 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -294,7 +294,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
 		    ipv6_only_sock(s)					||
 		    (s->sk_bound_dev_if && s->sk_bound_dev_if != dif))
 			continue;
-		if (!ip_mc_sf_allow(sk, loc_addr, rmt_addr, dif))
+		if (!ip_mc_sf_allow(s, loc_addr, rmt_addr, dif))
 			continue;
 		goto found;
   	}
@@ -725,7 +725,7 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 		case SIOCOUTQ:
 		{
 			int amount = atomic_read(&sk->sk_wmem_alloc);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 
 		case SIOCINQ:
@@ -745,7 +745,7 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 				amount = skb->len - sizeof(struct udphdr);
 			}
 			spin_unlock_irq(&sk->sk_receive_queue.lock);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 
 		default:
@@ -1269,7 +1269,7 @@ static int udp_destroy_sock(struct sock *sk)
  *	Socket option code for UDP
  */
 static int udp_setsockopt(struct sock *sk, int level, int optname, 
-			  char *optval, int optlen)
+			  char __user *optval, int optlen)
 {
 	struct udp_opt *up = udp_sk(sk);
 	int val;
@@ -1281,7 +1281,7 @@ static int udp_setsockopt(struct sock *sk, int level, int optname,
 	if(optlen<sizeof(int))
 		return -EINVAL;
 
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 
 	switch(optname) {
@@ -1309,7 +1309,7 @@ static int udp_setsockopt(struct sock *sk, int level, int optname,
 }
 
 static int udp_getsockopt(struct sock *sk, int level, int optname, 
-			  char *optval, int *optlen)
+			  char __user *optval, int __user *optlen)
 {
 	struct udp_opt *up = udp_sk(sk);
 	int val, len;
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index c70dde747..a05bd39a7 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -90,7 +90,6 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 			goto error;
 		}
 
-		dst1->xfrm = xfrm[i];
 		if (!dst)
 			dst = dst1;
 		else {
@@ -120,10 +119,12 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 		dst_hold(&rt->u.dst);
 	}
 	dst_prev->child = &rt->u.dst;
+	i = 0;
 	for (dst_prev = dst; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) {
 		struct xfrm_dst *x = (struct xfrm_dst*)dst_prev;
 		x->u.rt.fl = *fl;
 
+		dst_prev->xfrm = xfrm[i++];
 		dst_prev->dev = rt->u.dst.dev;
 		if (rt->u.dst.dev)
 			dev_hold(rt->u.dst.dev);
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index cd78fa0d6..ed6dbef78 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -83,9 +83,7 @@ __xfrm4_find_acq(u8 mode, u32 reqid, u8 proto,
 			    break;
 		    }
 	}
-	if (x0) {
-		xfrm_state_hold(x0);
-	} else if (create && (x0 = xfrm_state_alloc()) != NULL) {
+	if (!x0 && create && (x0 = xfrm_state_alloc()) != NULL) {
 		x0->sel.daddr.a4 = daddr->a4;
 		x0->sel.saddr.a4 = saddr->a4;
 		x0->sel.prefixlen_d = 32;
@@ -100,11 +98,14 @@ __xfrm4_find_acq(u8 mode, u32 reqid, u8 proto,
 		x0->props.family = AF_INET;
 		x0->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
 		xfrm_state_hold(x0);
-		mod_timer(&x0->timer, jiffies + XFRM_ACQ_EXPIRES*HZ);
+		x0->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
+		add_timer(&x0->timer);
 		xfrm_state_hold(x0);
 		list_add_tail(&x0->bydst, xfrm4_state_afinfo.state_bydst+h);
 		wake_up(&km_waitq);
 	}
+	if (x0)
+		xfrm_state_hold(x0);
 	return x0;
 }
 
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index accc0c8d6..3c9d4aaa2 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -33,8 +33,9 @@ out:
 	return ret;
 }
 
-static int ipip_output(struct sk_buff *skb)
+static int ipip_output(struct sk_buff **pskb)
 {
+	struct sk_buff *skb = *pskb;
 	struct dst_entry *dst = skb->dst;
 	struct xfrm_state *x = dst->xfrm;
 	struct iphdr *iph, *top_iph;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 226aa2bb4..065a11e6c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1510,7 +1510,7 @@ ok:
  *	Special case for SIT interfaces where we create a new "virtual"
  *	device.
  */
-int addrconf_set_dstaddr(void *arg)
+int addrconf_set_dstaddr(void __user *arg)
 {
 	struct in6_ifreq ireq;
 	struct net_device *dev;
@@ -1630,7 +1630,7 @@ static int inet6_addr_del(int ifindex, struct in6_addr *pfx, int plen)
 }
 
 
-int addrconf_add_ifaddr(void *arg)
+int addrconf_add_ifaddr(void __user *arg)
 {
 	struct in6_ifreq ireq;
 	int err;
@@ -1647,7 +1647,7 @@ int addrconf_add_ifaddr(void *arg)
 	return err;
 }
 
-int addrconf_del_ifaddr(void *arg)
+int addrconf_del_ifaddr(void __user *arg)
 {
 	struct in6_ifreq ireq;
 	int err;
@@ -3003,7 +3003,7 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
 
 static
 int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
-			   void *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp)
 {
 	int *valp = ctl->data;
 	int val = *valp;
@@ -3031,9 +3031,10 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
 }
 
 static int addrconf_sysctl_forward_strategy(ctl_table *table, 
-					    int *name, int nlen,
-					    void *oldval, size_t *oldlenp,
-					    void *newval, size_t newlen,
+					    int __user *name, int nlen,
+					    void __user *oldval,
+					    size_t __user *oldlenp,
+					    void __user *newval, size_t newlen,
 					    void **context)
 {
 	int *valp = table->data;
@@ -3043,7 +3044,7 @@ static int addrconf_sysctl_forward_strategy(ctl_table *table,
 		return 0;
 	if (newlen != sizeof(int))
 		return -EINVAL;
-	if (get_user(new, (int *)newval))
+	if (get_user(new, (int __user *)newval))
 		return -EFAULT;
 	if (new == *valp)
 		return 0;
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 24ca03a62..33e39d220 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -474,23 +474,23 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	switch(cmd) 
 	{
 	case SIOCGSTAMP:
-		return sock_get_timestamp(sk, (struct timeval *)arg);
+		return sock_get_timestamp(sk, (struct timeval __user *)arg);
 
 	case SIOCADDRT:
 	case SIOCDELRT:
 	  
-		return(ipv6_route_ioctl(cmd,(void *)arg));
+		return(ipv6_route_ioctl(cmd,(void __user *)arg));
 
 	case SIOCSIFADDR:
-		return addrconf_add_ifaddr((void *) arg);
+		return addrconf_add_ifaddr((void __user *) arg);
 	case SIOCDIFADDR:
-		return addrconf_del_ifaddr((void *) arg);
+		return addrconf_del_ifaddr((void __user *) arg);
 	case SIOCSIFDSTADDR:
-		return addrconf_set_dstaddr((void *) arg);
+		return addrconf_set_dstaddr((void __user *) arg);
 	default:
 		if (!sk->sk_prot->ioctl ||
 		    (err = sk->sk_prot->ioctl(sk, cmd, arg)) == -ENOIOCTLCMD)
-			return(dev_ioctl(cmd,(void *) arg));		
+			return(dev_ioctl(cmd,(void __user *) arg));		
 		return err;
 	}
 	/*NOTREACHED*/
@@ -572,7 +572,7 @@ inet6_register_protosw(struct inet_protosw *p)
 
 	spin_lock_bh(&inetsw6_lock);
 
-	if (p->type > SOCK_MAX)
+	if (p->type >= SOCK_MAX)
 		goto out_illegal;
 
 	/* If we are trying to override a permanent protocol, bail. */
@@ -667,14 +667,14 @@ snmp6_mib_free(void *ptr[2])
 
 static int __init init_ipv6_mibs(void)
 {
-	if (snmp6_mib_init((void **)ipv6_statistics, sizeof (struct ipv6_mib),
-			   __alignof__(struct ipv6_mib)) < 0)
+	if (snmp6_mib_init((void **)ipv6_statistics, sizeof (struct ipstats_mib),
+			   __alignof__(struct ipstats_mib)) < 0)
 		goto err_ip_mib;
 	if (snmp6_mib_init((void **)icmpv6_statistics, sizeof (struct icmpv6_mib),
-			   __alignof__(struct ipv6_mib)) < 0)
+			   __alignof__(struct icmpv6_mib)) < 0)
 		goto err_icmp_mib;
 	if (snmp6_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib),
-			   __alignof__(struct ipv6_mib)) < 0)
+			   __alignof__(struct udp_mib)) < 0)
 		goto err_udp_mib;
 	return 0;
 
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 4f61bffd7..185092c0d 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -144,11 +144,11 @@ static int ipv6_clear_mutable_options(struct sk_buff *skb, u16 *nh_offset, int d
 	return nexthdr;
 }
 
-int ah6_output(struct sk_buff *skb)
+int ah6_output(struct sk_buff **pskb)
 {
 	int err;
 	int hdr_len = sizeof(struct ipv6hdr);
-	struct dst_entry *dst = skb->dst;
+	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
 	struct ipv6hdr *iph = NULL;
 	struct ip_auth_hdr *ah;
@@ -156,54 +156,55 @@ int ah6_output(struct sk_buff *skb)
 	u16 nh_offset = 0;
 	u8 nexthdr;
 
-	if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
-		err = -EINVAL;
-		goto error_nolock;
+	if ((*pskb)->ip_summed == CHECKSUM_HW) {
+		err = skb_checksum_help(pskb, 0);
+		if (err)
+			goto error_nolock;
 	}
 
 	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, skb, AF_INET6);
+	err = xfrm_check_output(x, *pskb, AF_INET6);
 	if (err)
 		goto error;
 
 	if (x->props.mode) {
-		iph = skb->nh.ipv6h;
-		skb->nh.ipv6h = (struct ipv6hdr*)skb_push(skb, x->props.header_len);
-		skb->nh.ipv6h->version = 6;
-		skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
-		skb->nh.ipv6h->nexthdr = IPPROTO_AH;
-		ipv6_addr_copy(&skb->nh.ipv6h->saddr,
+		iph = (*pskb)->nh.ipv6h;
+		(*pskb)->nh.ipv6h = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
+		(*pskb)->nh.ipv6h->version = 6;
+		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
+		(*pskb)->nh.ipv6h->nexthdr = IPPROTO_AH;
+		ipv6_addr_copy(&(*pskb)->nh.ipv6h->saddr,
 			       (struct in6_addr *) &x->props.saddr);
-		ipv6_addr_copy(&skb->nh.ipv6h->daddr,
+		ipv6_addr_copy(&(*pskb)->nh.ipv6h->daddr,
 			       (struct in6_addr *) &x->id.daddr);
-		ah = (struct ip_auth_hdr*)(skb->nh.ipv6h+1);
+		ah = (struct ip_auth_hdr*)((*pskb)->nh.ipv6h+1);
 		ah->nexthdr = IPPROTO_IPV6;
 	} else {
-		hdr_len = skb->h.raw - skb->nh.raw;
+		hdr_len = (*pskb)->h.raw - (*pskb)->nh.raw;
 		iph = kmalloc(hdr_len, GFP_ATOMIC);
 		if (!iph) {
 			err = -ENOMEM;
 			goto error;
 		}
-		memcpy(iph, skb->data, hdr_len);
-		skb->nh.ipv6h = (struct ipv6hdr*)skb_push(skb, x->props.header_len);
-		memcpy(skb->nh.ipv6h, iph, hdr_len);
-		nexthdr = ipv6_clear_mutable_options(skb, &nh_offset, XFRM_POLICY_OUT);
+		memcpy(iph, (*pskb)->data, hdr_len);
+		(*pskb)->nh.ipv6h = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
+		memcpy((*pskb)->nh.ipv6h, iph, hdr_len);
+		nexthdr = ipv6_clear_mutable_options(*pskb, &nh_offset, XFRM_POLICY_OUT);
 		if (nexthdr == 0)
-			goto error;
+			goto error_free_iph;
 
-		skb->nh.raw[nh_offset] = IPPROTO_AH;
-		skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
-		ah = (struct ip_auth_hdr*)(skb->nh.raw+hdr_len);
-		skb->h.raw = (unsigned char*) ah;
+		(*pskb)->nh.raw[nh_offset] = IPPROTO_AH;
+		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
+		ah = (struct ip_auth_hdr*)((*pskb)->nh.raw+hdr_len);
+		(*pskb)->h.raw = (unsigned char*) ah;
 		ah->nexthdr = nexthdr;
 	}
 
-	skb->nh.ipv6h->priority    = 0;
-	skb->nh.ipv6h->flow_lbl[0] = 0;
-	skb->nh.ipv6h->flow_lbl[1] = 0;
-	skb->nh.ipv6h->flow_lbl[2] = 0;
-	skb->nh.ipv6h->hop_limit    = 0;
+	(*pskb)->nh.ipv6h->priority    = 0;
+	(*pskb)->nh.ipv6h->flow_lbl[0] = 0;
+	(*pskb)->nh.ipv6h->flow_lbl[1] = 0;
+	(*pskb)->nh.ipv6h->flow_lbl[2] = 0;
+	(*pskb)->nh.ipv6h->hop_limit    = 0;
 
 	ahp = x->data;
 	ah->hdrlen  = (XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + 
@@ -212,37 +213,39 @@ int ah6_output(struct sk_buff *skb)
 	ah->reserved = 0;
 	ah->spi = x->id.spi;
 	ah->seq_no = htonl(++x->replay.oseq);
-	ahp->icv(ahp, skb, ah->auth_data);
+	ahp->icv(ahp, *pskb, ah->auth_data);
 
 	if (x->props.mode) {
-		skb->nh.ipv6h->hop_limit   = iph->hop_limit;
-		skb->nh.ipv6h->priority    = iph->priority; 	
-		skb->nh.ipv6h->flow_lbl[0] = iph->flow_lbl[0];
-		skb->nh.ipv6h->flow_lbl[1] = iph->flow_lbl[1];
-		skb->nh.ipv6h->flow_lbl[2] = iph->flow_lbl[2];
+		(*pskb)->nh.ipv6h->hop_limit   = iph->hop_limit;
+		(*pskb)->nh.ipv6h->priority    = iph->priority; 	
+		(*pskb)->nh.ipv6h->flow_lbl[0] = iph->flow_lbl[0];
+		(*pskb)->nh.ipv6h->flow_lbl[1] = iph->flow_lbl[1];
+		(*pskb)->nh.ipv6h->flow_lbl[2] = iph->flow_lbl[2];
 		if (x->props.flags & XFRM_STATE_NOECN)
-			IP6_ECN_clear(skb->nh.ipv6h);
+			IP6_ECN_clear((*pskb)->nh.ipv6h);
 	} else {
-		memcpy(skb->nh.ipv6h, iph, hdr_len);
-		skb->nh.raw[nh_offset] = IPPROTO_AH;
-		skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
+		memcpy((*pskb)->nh.ipv6h, iph, hdr_len);
+		(*pskb)->nh.raw[nh_offset] = IPPROTO_AH;
+		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
 		kfree (iph);
 	}
 
-	skb->nh.raw = skb->data;
+	(*pskb)->nh.raw = (*pskb)->data;
 
-	x->curlft.bytes += skb->len;
+	x->curlft.bytes += (*pskb)->len;
 	x->curlft.packets++;
 	spin_unlock_bh(&x->lock);
-	if ((skb->dst = dst_pop(dst)) == NULL) {
+	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
 		err = -EHOSTUNREACH;
 		goto error_nolock;
 	}
 	return NET_XMIT_BYPASS;
+error_free_iph:
+	kfree(iph);
 error:
 	spin_unlock_bh(&x->lock);
 error_nolock:
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	return err;
 }
 
@@ -360,7 +363,7 @@ void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset);
 	struct xfrm_state *x;
 
-	if (type != ICMPV6_DEST_UNREACH ||
+	if (type != ICMPV6_DEST_UNREACH &&
 	    type != ICMPV6_PKT_TOOBIG)
 		return;
 
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index fef31fb55..8bd78996b 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -145,10 +145,8 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
 			  (struct in6_addr *)(skb->nh.raw + serr->addr_offset));
 			if (np->sndflow)
 				sin->sin6_flowinfo = *(u32*)(skb->nh.raw + serr->addr_offset - 24) & IPV6_FLOWINFO_MASK;
-			if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) {
-				struct inet6_skb_parm *opt = (struct inet6_skb_parm *) skb->cb;
-				sin->sin6_scope_id = opt->iif;
-			}
+			if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL)
+				sin->sin6_scope_id = IP6CB(skb)->iif;
 		} else {
 			ipv6_addr_set(&sin->sin6_addr, 0, 0,
 				      htonl(0xffff),
@@ -167,10 +165,8 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
 			ipv6_addr_copy(&sin->sin6_addr, &skb->nh.ipv6h->saddr);
 			if (np->rxopt.all)
 				datagram_recv_ctl(sk, msg, skb);
-			if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) {
-				struct inet6_skb_parm *opt = (struct inet6_skb_parm *) skb->cb;
-				sin->sin6_scope_id = opt->iif;
-			}
+			if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL)
+				sin->sin6_scope_id = IP6CB(skb)->iif;
 		} else {
 			struct inet_opt *inet = inet_sk(sk);
 
@@ -211,7 +207,7 @@ out:
 int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
-	struct inet6_skb_parm *opt = (struct inet6_skb_parm *) skb->cb;
+	struct inet6_skb_parm *opt = IP6CB(skb);
 
 	if (np->rxopt.bits.rxinfo) {
 		struct in6_pktinfo src_info;
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index dc8bfac22..8156942b1 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -40,11 +40,11 @@
 
 #define MAX_SG_ONSTACK 4
 
-int esp6_output(struct sk_buff *skb)
+int esp6_output(struct sk_buff **pskb)
 {
 	int err;
 	int hdr_len = 0;
-	struct dst_entry *dst = skb->dst;
+	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
 	struct ipv6hdr *iph = NULL, *top_iph;
 	struct ipv6_esp_hdr *esph;
@@ -58,14 +58,14 @@ int esp6_output(struct sk_buff *skb)
 	u8 *prevhdr;
 	u8 nexthdr = 0;
 
-	/* First, if the skb is not checksummed, complete checksum. */
-	if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
-		err = -EINVAL;
-		goto error_nolock;
+	if ((*pskb)->ip_summed == CHECKSUM_HW) {
+		err = skb_checksum_help(pskb, 0);
+		if (err)
+			goto error_nolock;
 	}
 
 	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, skb, AF_INET6);
+	err = xfrm_check_output(x, *pskb, AF_INET6);
 	if (err)
 		goto error;
 	err = -ENOMEM;
@@ -73,7 +73,7 @@ int esp6_output(struct sk_buff *skb)
 	/* Strip IP header in transport mode. Save it. */
 
 	if (!x->props.mode) {
-		hdr_len = ip6_find_1stfragopt(skb, &prevhdr);
+		hdr_len = ip6_find_1stfragopt(*pskb, &prevhdr);
 		nexthdr = *prevhdr;
 		*prevhdr = IPPROTO_ESP;
 		iph = kmalloc(hdr_len, GFP_ATOMIC);
@@ -81,14 +81,14 @@ int esp6_output(struct sk_buff *skb)
 			err = -ENOMEM;
 			goto error;
 		}
-		memcpy(iph, skb->nh.raw, hdr_len);
-		__skb_pull(skb, hdr_len);
+		memcpy(iph, (*pskb)->nh.raw, hdr_len);
+		__skb_pull(*pskb, hdr_len);
 	}
 
 	/* Now skb is pure payload to encrypt */
 
 	/* Round to block size */
-	clen = skb->len;
+	clen = (*pskb)->len;
 
 	esp = x->data;
 	alen = esp->auth.icv_trunc_len;
@@ -98,7 +98,7 @@ int esp6_output(struct sk_buff *skb)
 	if (esp->conf.padlen)
 		clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1);
 
-	if ((nfrags = skb_cow_data(skb, clen-skb->len+alen, &trailer)) < 0) {
+	if ((nfrags = skb_cow_data(*pskb, clen-(*pskb)->len+alen, &trailer)) < 0) {
 		if (!x->props.mode && iph) kfree(iph);
 		goto error;
 	}
@@ -106,15 +106,15 @@ int esp6_output(struct sk_buff *skb)
 	/* Fill padding... */
 	do {
 		int i;
-		for (i=0; i<clen-skb->len - 2; i++)
+		for (i=0; i<clen-(*pskb)->len - 2; i++)
 			*(u8*)(trailer->tail + i) = i+1;
 	} while (0);
-	*(u8*)(trailer->tail + clen-skb->len - 2) = (clen - skb->len)-2;
-	pskb_put(skb, trailer, clen - skb->len);
+	*(u8*)(trailer->tail + clen-(*pskb)->len - 2) = (clen - (*pskb)->len)-2;
+	pskb_put(*pskb, trailer, clen - (*pskb)->len);
 
 	if (x->props.mode) {
-		iph = skb->nh.ipv6h;
-		top_iph = (struct ipv6hdr*)skb_push(skb, x->props.header_len);
+		iph = (*pskb)->nh.ipv6h;
+		top_iph = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
 		esph = (struct ipv6_esp_hdr*)(top_iph+1);
 		*(u8*)(trailer->tail - 1) = IPPROTO_IPV6;
 		top_iph->version = 6;
@@ -125,19 +125,19 @@ int esp6_output(struct sk_buff *skb)
 		if (x->props.flags & XFRM_STATE_NOECN)
 			IP6_ECN_clear(top_iph);
 		top_iph->nexthdr = IPPROTO_ESP;
-		top_iph->payload_len = htons(skb->len + alen - sizeof(struct ipv6hdr));
+		top_iph->payload_len = htons((*pskb)->len + alen - sizeof(struct ipv6hdr));
 		top_iph->hop_limit = iph->hop_limit;
 		ipv6_addr_copy(&top_iph->saddr,
 			       (struct in6_addr *)&x->props.saddr);
 		ipv6_addr_copy(&top_iph->daddr,
 			       (struct in6_addr *)&x->id.daddr);
 	} else { 
-		esph = (struct ipv6_esp_hdr*)skb_push(skb, x->props.header_len);
-		skb->h.raw = (unsigned char*)esph;
-		top_iph = (struct ipv6hdr*)skb_push(skb, hdr_len);
+		esph = (struct ipv6_esp_hdr*)skb_push(*pskb, x->props.header_len);
+		(*pskb)->h.raw = (unsigned char*)esph;
+		top_iph = (struct ipv6hdr*)skb_push(*pskb, hdr_len);
 		memcpy(top_iph, iph, hdr_len);
 		kfree(iph);
-		top_iph->payload_len = htons(skb->len + alen - sizeof(struct ipv6hdr));
+		top_iph->payload_len = htons((*pskb)->len + alen - sizeof(struct ipv6hdr));
 		*(u8*)(trailer->tail - 1) = nexthdr;
 	}
 
@@ -156,7 +156,7 @@ int esp6_output(struct sk_buff *skb)
 			if (!sg)
 				goto error;
 		}
-		skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen);
+		skb_to_sgvec(*pskb, sg, esph->enc_data+esp->conf.ivlen-(*pskb)->data, clen);
 		crypto_cipher_encrypt(tfm, sg, sg, clen);
 		if (unlikely(sg != sgbuf))
 			kfree(sg);
@@ -168,17 +168,17 @@ int esp6_output(struct sk_buff *skb)
 	}
 
 	if (esp->auth.icv_full_len) {
-		esp->auth.icv(esp, skb, (u8*)esph-skb->data,
+		esp->auth.icv(esp, *pskb, (u8*)esph-(*pskb)->data,
 			sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen+clen, trailer->tail);
-		pskb_put(skb, trailer, alen);
+		pskb_put(*pskb, trailer, alen);
 	}
 
-	skb->nh.raw = skb->data;
+	(*pskb)->nh.raw = (*pskb)->data;
 
-	x->curlft.bytes += skb->len;
+	x->curlft.bytes += (*pskb)->len;
 	x->curlft.packets++;
 	spin_unlock_bh(&x->lock);
-	if ((skb->dst = dst_pop(dst)) == NULL) {
+	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
 		err = -EHOSTUNREACH;
 		goto error_nolock;
 	}
@@ -187,7 +187,7 @@ int esp6_output(struct sk_buff *skb)
 error:
 	spin_unlock_bh(&x->lock);
 error_nolock:
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	return err;
 }
 
@@ -324,7 +324,7 @@ void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	struct ipv6_esp_hdr *esph = (struct ipv6_esp_hdr*)(skb->data+offset);
 	struct xfrm_state *x;
 
-	if (type != ICMPV6_DEST_UNREACH ||
+	if (type != ICMPV6_DEST_UNREACH && 
 	    type != ICMPV6_PKT_TOOBIG)
 		return;
 
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 24286b940..ff12dcf3e 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -155,11 +155,11 @@ static struct tlvtype_proc tlvprocdestopt_lst[] = {
 static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 {
 	struct sk_buff *skb = *skbp;
-	struct inet6_skb_parm *opt = (struct inet6_skb_parm *)skb->cb;
+	struct inet6_skb_parm *opt = IP6CB(skb);
 
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
 	    !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -172,7 +172,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 		return 1;
 	}
 
-	IP6_INC_STATS_BH(Ip6InHdrErrors);
+	IP6_INC_STATS_BH(InHdrErrors);
 	return -1;
 }
 
@@ -217,7 +217,7 @@ void __init ipv6_nodata_init(void)
 static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 {
 	struct sk_buff *skb = *skbp;
-	struct inet6_skb_parm *opt = (struct inet6_skb_parm *)skb->cb;
+	struct inet6_skb_parm *opt = IP6CB(skb);
 	struct in6_addr *addr;
 	struct in6_addr daddr;
 	int n, i;
@@ -227,7 +227,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
 	    !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -236,7 +236,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) ||
 	    skb->pkt_type != PACKET_HOST) {
-		IP6_INC_STATS_BH(Ip6InAddrErrors);
+		IP6_INC_STATS_BH(InAddrErrors);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -252,13 +252,13 @@ looped_back:
 	}
 
 	if (hdr->type != IPV6_SRCRT_TYPE_0) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw);
 		return -1;
 	}
 	
 	if (hdr->hdrlen & 0x01) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->hdrlen) - skb->nh.raw);
 		return -1;
 	}
@@ -271,7 +271,7 @@ looped_back:
 	n = hdr->hdrlen >> 1;
 
 	if (hdr->segments_left > n) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->segments_left) - skb->nh.raw);
 		return -1;
 	}
@@ -284,11 +284,11 @@ looped_back:
 		kfree_skb(skb);
 		/* the copy is a forwarded packet */
 		if (skb2 == NULL) {
-			IP6_INC_STATS_BH(Ip6OutDiscards);	
+			IP6_INC_STATS_BH(OutDiscards);	
 			return -1;
 		}
 		*skbp = skb = skb2;
-		opt = (struct inet6_skb_parm *)skb2->cb;
+		opt = IP6CB(skb2);
 		hdr = (struct ipv6_rt_hdr *) skb2->h.raw;
 	}
 
@@ -302,7 +302,7 @@ looped_back:
 	addr += i - 1;
 
 	if (ipv6_addr_is_multicast(addr)) {
-		IP6_INC_STATS_BH(Ip6InAddrErrors);
+		IP6_INC_STATS_BH(InAddrErrors);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -319,7 +319,7 @@ looped_back:
 	}
 	if (skb->dst->dev->flags&IFF_LOOPBACK) {
 		if (skb->nh.ipv6h->hop_limit <= 1) {
-			IP6_INC_STATS_BH(Ip6InHdrErrors);
+			IP6_INC_STATS_BH(InHdrErrors);
 			icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
 				    0, skb->dev);
 			kfree_skb(skb);
@@ -418,7 +418,7 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr)
 static int ipv6_hop_ra(struct sk_buff *skb, int optoff)
 {
 	if (skb->nh.raw[optoff+1] == 2) {
-		((struct inet6_skb_parm*)skb->cb)->ra = optoff;
+		IP6CB(skb)->ra = optoff;
 		return 1;
 	}
 	LIMIT_NETDEBUG(
@@ -436,24 +436,24 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
 	if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) {
 		LIMIT_NETDEBUG(
 			 printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]));
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		goto drop;
 	}
 
 	pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2));
 	if (pkt_len <= IPV6_MAXPLEN) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
 		return 0;
 	}
 	if (skb->nh.ipv6h->payload_len) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff);
 		return 0;
 	}
 
 	if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {
-		IP6_INC_STATS_BH(Ip6InTruncatedPkts);
+		IP6_INC_STATS_BH(InTruncatedPkts);
 		goto drop;
 	}
 	if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
@@ -482,7 +482,7 @@ static struct tlvtype_proc tlvprochopopt_lst[] = {
 
 int ipv6_parse_hopopts(struct sk_buff *skb, int nhoff)
 {
-	((struct inet6_skb_parm*)skb->cb)->hop = sizeof(struct ipv6hdr);
+	IP6CB(skb)->hop = sizeof(struct ipv6hdr);
 	if (ip6_parse_tlv(tlvprochopopt_lst, skb))
 		return sizeof(struct ipv6hdr);
 	return -1;
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 24e3def47..cfecd15d9 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -174,7 +174,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
 	 */
 	dst = ip6_route_output(sk, fl);
 	if (dst->error) {
-		IP6_INC_STATS(Ip6OutNoRoutes);
+		IP6_INC_STATS(OutNoRoutes);
 	} else if (dst->dev && (dst->dev->flags&IFF_LOOPBACK)) {
 		res = 1;
 	} else {
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 22ff7344c..5c885fa77 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -277,7 +277,7 @@ static int fl6_renew(struct ip6_flowlabel *fl, unsigned long linger, unsigned lo
 }
 
 static struct ip6_flowlabel *
-fl_create(struct in6_flowlabel_req *freq, char *optval, int optlen, int *err_p)
+fl_create(struct in6_flowlabel_req *freq, char __user *optval, int optlen, int *err_p)
 {
 	struct ip6_flowlabel *fl;
 	int olen;
@@ -407,7 +407,7 @@ static int ipv6_opt_cmp(struct ipv6_txoptions *o1, struct ipv6_txoptions *o2)
 	return 0;
 }
 
-int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen)
+int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
 {
 	int err;
 	struct ipv6_pinfo *np = inet6_sk(sk);
@@ -692,14 +692,14 @@ static struct file_operations ip6fl_seq_fops = {
 #endif
 
 
-void ip6_flowlabel_init()
+void ip6_flowlabel_init(void)
 {
 #ifdef CONFIG_PROC_FS
 	proc_net_fops_create("ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops);
 #endif
 }
 
-void ip6_flowlabel_cleanup()
+void ip6_flowlabel_cleanup(void)
 {
 	del_timer(&ip6_fl_gc_timer);
 #ifdef CONFIG_PROC_FS
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index a274679a8..0be5945d3 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -64,23 +64,23 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 	if (skb->pkt_type == PACKET_OTHERHOST)
 		goto drop;
 
-	IP6_INC_STATS_BH(Ip6InReceives);
+	IP6_INC_STATS_BH(InReceives);
 
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
-		IP6_INC_STATS_BH(Ip6InDiscards);
+		IP6_INC_STATS_BH(InDiscards);
 		goto out;
 	}
 
 	/* Store incoming device index. When the packet will
 	   be queued, we cannot refer to skb->dev anymore.
 	 */
-	((struct inet6_skb_parm *)skb->cb)->iif = dev->ifindex;
+	IP6CB(skb)->iif = dev->ifindex;
 
 	if (skb->len < sizeof(struct ipv6hdr))
 		goto err;
 
 	if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
 		goto drop;
 	}
 
@@ -97,7 +97,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 			goto truncated;
 		if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
 			if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))){
-				IP6_INC_STATS_BH(Ip6InHdrErrors);
+				IP6_INC_STATS_BH(InHdrErrors);
 				goto drop;
 			}
 			hdr = skb->nh.ipv6h;
@@ -109,7 +109,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 	if (hdr->nexthdr == NEXTHDR_HOP) {
 		skb->h.raw = (u8*)(hdr+1);
 		if (ipv6_parse_hopopts(skb, offsetof(struct ipv6hdr, nexthdr)) < 0) {
-			IP6_INC_STATS_BH(Ip6InHdrErrors);
+			IP6_INC_STATS_BH(InHdrErrors);
 			return 0;
 		}
 		hdr = skb->nh.ipv6h;
@@ -117,9 +117,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 
 	return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
 truncated:
-	IP6_INC_STATS_BH(Ip6InTruncatedPkts);
+	IP6_INC_STATS_BH(InTruncatedPkts);
 err:
-	IP6_INC_STATS_BH(Ip6InHdrErrors);
+	IP6_INC_STATS_BH(InHdrErrors);
 drop:
 	kfree_skb(skb);
 out:
@@ -194,15 +194,15 @@ resubmit:
 		if (ret > 0)
 			goto resubmit;
 		else if (ret == 0)
-			IP6_INC_STATS_BH(Ip6InDelivers);
+			IP6_INC_STATS_BH(InDelivers);
 	} else {
 		if (!raw_sk) {
 			if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
-				IP6_INC_STATS_BH(Ip6InUnknownProtos);
+				IP6_INC_STATS_BH(InUnknownProtos);
 				icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
 			}
 		} else {
-			IP6_INC_STATS_BH(Ip6InDelivers);
+			IP6_INC_STATS_BH(InDelivers);
 			kfree_skb(skb);
 		}
 	}
@@ -210,7 +210,7 @@ resubmit:
 	return 0;
 
 discard:
-	IP6_INC_STATS_BH(Ip6InDiscards);
+	IP6_INC_STATS_BH(InDiscards);
 	rcu_read_unlock();
 	kfree_skb(skb);
 	return 0;
@@ -227,7 +227,7 @@ int ip6_mc_input(struct sk_buff *skb)
 	struct ipv6hdr *hdr;
 	int deliver;
 
-	IP6_INC_STATS_BH(Ip6InMcastPkts);
+	IP6_INC_STATS_BH(InMcastPkts);
 
 	hdr = skb->nh.ipv6h;
 	deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index d6f0db4aa..0057672a3 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -55,7 +55,7 @@
 #include <net/icmp.h>
 #include <net/xfrm.h>
 
-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*));
+static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**));
 
 static __inline__ void ipv6_select_ident(struct sk_buff *skb, struct frag_hdr *fhdr)
 {
@@ -87,7 +87,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
 	} else if (dst->neighbour)
 		return dst->neighbour->output(skb);
 
-	IP6_INC_STATS_BH(Ip6OutNoRoutes);
+	IP6_INC_STATS_BH(OutNoRoutes);
 	kfree_skb(skb);
 	return -EINVAL;
 
@@ -107,8 +107,9 @@ static int ip6_dev_loopback_xmit(struct sk_buff *newskb)
 }
 
 
-int ip6_output2(struct sk_buff *skb)
+static int ip6_output2(struct sk_buff **pskb)
 {
+	struct sk_buff *skb = *pskb;
 	struct dst_entry *dst = skb->dst;
 	struct net_device *dev = dst->dev;
 
@@ -132,24 +133,26 @@ int ip6_output2(struct sk_buff *skb)
 					ip6_dev_loopback_xmit);
 
 			if (skb->nh.ipv6h->hop_limit == 0) {
-				IP6_INC_STATS(Ip6OutDiscards);
+				IP6_INC_STATS(OutDiscards);
 				kfree_skb(skb);
 				return 0;
 			}
 		}
 
-		IP6_INC_STATS(Ip6OutMcastPkts);
+		IP6_INC_STATS(OutMcastPkts);
 	}
 
 	return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
 }
 
-int ip6_output(struct sk_buff *skb)
+int ip6_output(struct sk_buff **pskb)
 {
+	struct sk_buff *skb = *pskb;
+
 	if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list))
-		return ip6_fragment(skb, ip6_output2);
+		return ip6_fragment(pskb, ip6_output2);
 	else
-		return ip6_output2(skb);
+		return ip6_output2(pskb);
 }
 
 #ifdef CONFIG_NETFILTER
@@ -169,7 +172,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
 	dst = ip6_route_output(skb->sk, &fl);
 
 	if (dst->error) {
-		IP6_INC_STATS(Ip6OutNoRoutes);
+		IP6_INC_STATS(OutNoRoutes);
 		LIMIT_NETDEBUG(
 			printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n"));
 		dst_release(dst);
@@ -228,7 +231,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 			kfree_skb(skb);
 			skb = skb2;
 			if (skb == NULL) {	
-				IP6_INC_STATS(Ip6OutDiscards);
+				IP6_INC_STATS(OutDiscards);
 				return -ENOBUFS;
 			}
 			if (sk)
@@ -262,7 +265,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 
 	mtu = dst_pmtu(dst);
 	if ((skb->len <= mtu) || ipfragok) {
-		IP6_INC_STATS(Ip6OutRequests);
+		IP6_INC_STATS(OutRequests);
 		return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
 	}
 
@@ -270,7 +273,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 		printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
 	skb->dev = dst->dev;
 	icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
-	IP6_INC_STATS(Ip6FragFails);
+	IP6_INC_STATS(FragFails);
 	kfree_skb(skb);
 	return -EMSGSIZE;
 }
@@ -346,13 +349,13 @@ int ip6_forward(struct sk_buff *skb)
 {
 	struct dst_entry *dst = skb->dst;
 	struct ipv6hdr *hdr = skb->nh.ipv6h;
-	struct inet6_skb_parm *opt =(struct inet6_skb_parm*)skb->cb;
+	struct inet6_skb_parm *opt = IP6CB(skb);
 	
 	if (ipv6_devconf.forwarding == 0)
 		goto error;
 
 	if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
-		IP6_INC_STATS(Ip6InDiscards);
+		IP6_INC_STATS(InDiscards);
 		goto drop;
 	}
 
@@ -391,7 +394,7 @@ int ip6_forward(struct sk_buff *skb)
 	}
 
 	if (!xfrm6_route_forward(skb)) {
-		IP6_INC_STATS(Ip6InDiscards);
+		IP6_INC_STATS(InDiscards);
 		goto drop;
 	}
 
@@ -429,14 +432,14 @@ int ip6_forward(struct sk_buff *skb)
 		/* Again, force OUTPUT device used as source address */
 		skb->dev = dst->dev;
 		icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_pmtu(dst), skb->dev);
-		IP6_INC_STATS_BH(Ip6InTooBigErrors);
-		IP6_INC_STATS_BH(Ip6FragFails);
+		IP6_INC_STATS_BH(InTooBigErrors);
+		IP6_INC_STATS_BH(FragFails);
 		kfree_skb(skb);
 		return -EMSGSIZE;
 	}
 
 	if (skb_cow(skb, dst->dev->hard_header_len)) {
-		IP6_INC_STATS(Ip6OutDiscards);
+		IP6_INC_STATS(OutDiscards);
 		goto drop;
 	}
 
@@ -446,11 +449,11 @@ int ip6_forward(struct sk_buff *skb)
  
 	hdr->hop_limit--;
 
-	IP6_INC_STATS_BH(Ip6OutForwDatagrams);
+	IP6_INC_STATS_BH(OutForwDatagrams);
 	return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
 
 error:
-	IP6_INC_STATS_BH(Ip6InAddrErrors);
+	IP6_INC_STATS_BH(InAddrErrors);
 drop:
 	kfree_skb(skb);
 	return -EINVAL;
@@ -513,11 +516,11 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
 	return offset;
 }
 
-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
+static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
 {
 	struct net_device *dev;
+	struct sk_buff *frag, *skb = *pskb;
 	struct rt6_info *rt = (struct rt6_info*)skb->dst;
-	struct sk_buff *frag;
 	struct ipv6hdr *tmp_hdr;
 	struct frag_hdr *fh;
 	unsigned int mtu, hlen, left, len;
@@ -563,7 +566,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 
 		tmp_hdr = kmalloc(hlen, GFP_ATOMIC);
 		if (!tmp_hdr) {
-			IP6_INC_STATS(Ip6FragFails);
+			IP6_INC_STATS(FragFails);
 			return -ENOMEM;
 		}
 
@@ -604,11 +607,13 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 				frag->nh.ipv6h->payload_len = htons(frag->len - sizeof(struct ipv6hdr));
 				ip6_copy_metadata(frag, skb);
 			}
-			err = output(skb);
-
-			if (err || !frag)
+			err = output(pskb);
+			if (err || !frag) {
+				if (unlikely(skb != *pskb))
+					skb = *pskb;
 				break;
-
+			}
+			
 			skb = frag;
 			frag = skb->next;
 			skb->next = NULL;
@@ -618,7 +623,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 			kfree(tmp_hdr);
 
 		if (err == 0) {
-			IP6_INC_STATS(Ip6FragOKs);
+			IP6_INC_STATS(FragOKs);
 			return 0;
 		}
 
@@ -628,7 +633,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 			frag = skb;
 		}
 
-		IP6_INC_STATS(Ip6FragFails);
+		IP6_INC_STATS(FragFails);
 		return err;
 	}
 
@@ -661,7 +666,7 @@ slow_path:
 
 		if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) {
 			NETDEBUG(printk(KERN_INFO "IPv6: frag: no memory for new fragment!\n"));
-			IP6_INC_STATS(Ip6FragFails);
+			IP6_INC_STATS(FragFails);
 			err = -ENOMEM;
 			goto fail;
 		}
@@ -719,19 +724,19 @@ slow_path:
 		 *	Put this fragment into the sending queue.
 		 */
 
-		IP6_INC_STATS(Ip6FragCreates);
+		IP6_INC_STATS(FragCreates);
 
-		err = output(frag);
+		err = output(&frag);
 		if (err)
 			goto fail;
 	}
 	kfree_skb(skb);
-	IP6_INC_STATS(Ip6FragOKs);
+	IP6_INC_STATS(FragOKs);
 	return err;
 
 fail:
 	kfree_skb(skb); 
-	IP6_INC_STATS(Ip6FragFails);
+	IP6_INC_STATS(FragFails);
 	return err;
 }
 
@@ -1016,7 +1021,7 @@ alloc_new_skb:
 	return 0;
 error:
 	inet->cork.length -= length;
-	IP6_INC_STATS(Ip6OutDiscards);
+	IP6_INC_STATS(OutDiscards);
 	return err;
 }
 
@@ -1076,7 +1081,7 @@ int ip6_push_pending_frames(struct sock *sk)
 	ipv6_addr_copy(&hdr->daddr, final_dst);
 
 	skb->dst = dst_clone(&rt->u.dst);
-	IP6_INC_STATS(Ip6OutRequests);	
+	IP6_INC_STATS(OutRequests);	
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev, dst_output);
 	if (err) {
 		if (err > 0)
@@ -1108,7 +1113,7 @@ void ip6_flush_pending_frames(struct sock *sk)
 	struct sk_buff *skb;
 
 	while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
-		IP6_INC_STATS(Ip6OutDiscards);
+		IP6_INC_STATS(OutDiscards);
 		kfree_skb(skb);
 	}
 
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 97db913bf..b357db4cc 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -118,10 +118,10 @@ error_out:
 	return err;
 }
 
-static int ipcomp6_output(struct sk_buff *skb)
+static int ipcomp6_output(struct sk_buff **pskb)
 {
 	int err;
-	struct dst_entry *dst = skb->dst;
+	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x = dst->xfrm;
 	struct ipv6hdr *tmp_iph = NULL, *iph, *top_iph;
 	int hdr_len = 0;
@@ -132,54 +132,55 @@ static int ipcomp6_output(struct sk_buff *skb)
 	int plen, dlen;
 	u8 *start, *scratch = ipcd->scratch;
 
-	if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
-		err = -EINVAL;
-		goto error_nolock;
+	if ((*pskb)->ip_summed == CHECKSUM_HW) {
+		err = skb_checksum_help(pskb, 0);
+		if (err)
+			goto error_nolock;
 	}
 
 	spin_lock_bh(&x->lock);
 
-	err = xfrm_check_output(x, skb, AF_INET6);
+	err = xfrm_check_output(x, *pskb, AF_INET6);
 	if (err)
 		goto error;
 
 	if (x->props.mode) {
 		hdr_len = sizeof(struct ipv6hdr);
 		nexthdr = IPPROTO_IPV6;
-		iph = skb->nh.ipv6h;
-		top_iph = (struct ipv6hdr *)skb_push(skb, sizeof(struct ipv6hdr));
+		iph = (*pskb)->nh.ipv6h;
+		top_iph = (struct ipv6hdr *)skb_push(*pskb, sizeof(struct ipv6hdr));
 		top_iph->version = 6;
 		top_iph->priority = iph->priority;
 		top_iph->flow_lbl[0] = iph->flow_lbl[0];
 		top_iph->flow_lbl[1] = iph->flow_lbl[1];
 		top_iph->flow_lbl[2] = iph->flow_lbl[2];
 		top_iph->nexthdr = IPPROTO_IPV6; /* initial */
-		top_iph->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
+		top_iph->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
 		top_iph->hop_limit = iph->hop_limit;
 		memcpy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr, sizeof(struct in6_addr));
 		memcpy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr, sizeof(struct in6_addr));
-		skb->nh.raw = skb->data; /* == top_iph */
-		skb->h.raw = skb->nh.raw + hdr_len;
+		(*pskb)->nh.raw = (*pskb)->data; /* == top_iph */
+		(*pskb)->h.raw = (*pskb)->nh.raw + hdr_len;
 	} else {
-		hdr_len = ip6_find_1stfragopt(skb, &prevhdr);
+		hdr_len = ip6_find_1stfragopt(*pskb, &prevhdr);
 		nexthdr = *prevhdr;
 	}
 
 	/* check whether datagram len is larger than threshold */
-	if ((skb->len - hdr_len) < ipcd->threshold) {
+	if (((*pskb)->len - hdr_len) < ipcd->threshold) {
 		goto out_ok;
 	}
 
-	if ((skb_is_nonlinear(skb) || skb_cloned(skb)) &&
-		skb_linearize(skb, GFP_ATOMIC) != 0) {
+	if ((skb_is_nonlinear(*pskb) || skb_cloned(*pskb)) &&
+		skb_linearize(*pskb, GFP_ATOMIC) != 0) {
 		err = -ENOMEM;
 		goto error;
 	}
 
 	/* compression */
-	plen = skb->len - hdr_len;
+	plen = (*pskb)->len - hdr_len;
 	dlen = IPCOMP_SCRATCH_SIZE;
-	start = skb->data + hdr_len;
+	start = (*pskb)->data + hdr_len;
 
 	err = crypto_comp_compress(ipcd->tfm, start, plen, scratch, &dlen);
 	if (err) {
@@ -189,7 +190,7 @@ static int ipcomp6_output(struct sk_buff *skb)
 		goto out_ok;
 	}
 	memcpy(start, scratch, dlen);
-	pskb_trim(skb, hdr_len+dlen);
+	pskb_trim(*pskb, hdr_len+dlen);
 
 	/* insert ipcomp header and replace datagram */
 	tmp_iph = kmalloc(hdr_len, GFP_ATOMIC);
@@ -197,16 +198,16 @@ static int ipcomp6_output(struct sk_buff *skb)
 		err = -ENOMEM;
 		goto error;
 	}
-	memcpy(tmp_iph, skb->nh.raw, hdr_len);
-	top_iph = (struct ipv6hdr*)skb_push(skb, sizeof(struct ipv6_comp_hdr));
+	memcpy(tmp_iph, (*pskb)->nh.raw, hdr_len);
+	top_iph = (struct ipv6hdr*)skb_push(*pskb, sizeof(struct ipv6_comp_hdr));
 	memcpy(top_iph, tmp_iph, hdr_len);
 	kfree(tmp_iph);
 
 	if (x->props.mode && (x->props.flags & XFRM_STATE_NOECN))
 		IP6_ECN_clear(top_iph);
-	top_iph->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
-	skb->nh.raw = skb->data; /* top_iph */
-	ip6_find_1stfragopt(skb, &prevhdr); 
+	top_iph->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
+	(*pskb)->nh.raw = (*pskb)->data; /* top_iph */
+	ip6_find_1stfragopt(*pskb, &prevhdr); 
 	*prevhdr = IPPROTO_COMP;
 
 	ipch = (struct ipv6_comp_hdr *)((unsigned char *)top_iph + hdr_len);
@@ -214,13 +215,13 @@ static int ipcomp6_output(struct sk_buff *skb)
 	ipch->flags = 0;
 	ipch->cpi = htons((u16 )ntohl(x->id.spi));
 
-	skb->h.raw = (unsigned char*)ipch;
+	(*pskb)->h.raw = (unsigned char*)ipch;
 out_ok:
-	x->curlft.bytes += skb->len;
+	x->curlft.bytes += (*pskb)->len;
 	x->curlft.packets++;
 	spin_unlock_bh(&x->lock);
 
-	if ((skb->dst = dst_pop(dst)) == NULL) {
+	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
 		err = -EHOSTUNREACH;
 		goto error_nolock;
 	}
@@ -231,7 +232,7 @@ out_exit:
 error:
 	spin_unlock_bh(&x->lock);
 error_nolock:
-	kfree_skb(skb);
+	kfree_skb(*pskb);
 	goto out_exit;
 }
 
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 4f77f0f5b..73cc1dd09 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -55,7 +55,7 @@
 
 #include <asm/uaccess.h>
 
-DEFINE_SNMP_STAT(struct ipv6_mib, ipv6_statistics);
+DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
 
 static struct packet_type ipv6_packet_type = {
 	.type = __constant_htons(ETH_P_IPV6), 
@@ -113,11 +113,11 @@ extern int ip6_mc_source(int add, int omode, struct sock *sk,
 	struct group_source_req *pgsr);
 extern int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf);
 extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
-	struct group_filter *optval, int *optlen);
+	struct group_filter __user *optval, int __user *optlen);
 
 
-int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval, 
-		    int optlen)
+int ipv6_setsockopt(struct sock *sk, int level, int optname,
+		    char __user *optval, int optlen)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	int val, valbool;
@@ -131,7 +131,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval,
 
 	if (optval == NULL)
 		val=0;
-	else if (get_user(val, (int *) optval))
+	else if (get_user(val, (int __user *) optval))
 		return -EFAULT;
 
 	valbool = (val!=0);
@@ -524,8 +524,8 @@ e_inval:
 	return -EINVAL;
 }
 
-int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval, 
-		    int *optlen)
+int ipv6_getsockopt(struct sock *sk, int level, int optname,
+		    char __user *optval, int __user *optlen)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	int len;
@@ -557,7 +557,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval,
 			return -EFAULT;
 		lock_sock(sk);
 		err = ip6_mc_msfget(sk, &gsf,
-			(struct group_filter *)optval, optlen);
+			(struct group_filter __user *)optval, optlen);
 		release_sock(sk);
 		return err;
 	}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index a94f3c0af..b35114577 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -527,7 +527,7 @@ done:
 }
 
 int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
-	struct group_filter *optval, int *optlen)
+	struct group_filter __user *optval, int __user *optlen)
 {
 	int err, i, count, copycount;
 	struct in6_addr *group;
@@ -569,7 +569,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
 	copycount = count < gsf->gf_numsrc ? count : gsf->gf_numsrc;
 	gsf->gf_numsrc = count;
 	if (put_user(GROUP_FILTER_SIZE(copycount), optlen) ||
-	    copy_to_user((void *)optval, gsf, GROUP_FILTER_SIZE(0))) {
+	    copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) {
 		return -EFAULT;
 	}
 	for (i=0; i<copycount; i++) {
@@ -580,7 +580,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
 		memset(&ss, 0, sizeof(ss));
 		psin6->sin6_family = AF_INET6;
 		psin6->sin6_addr = psl->sl_addr[i];
-	    	if (copy_to_user((void *)&optval->gf_slist[i], &ss, sizeof(ss)))
+	    	if (copy_to_user(&optval->gf_slist[i], &ss, sizeof(ss)))
 			return -EFAULT;
 	}
 	return 0;
@@ -1317,7 +1317,7 @@ static void mld_sendpack(struct sk_buff *skb)
 	struct inet6_dev *idev = in6_dev_get(skb->dev);
 	int err;
 
-	IP6_INC_STATS(Ip6OutRequests);
+	IP6_INC_STATS(OutRequests);
 	payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h -
 		sizeof(struct ipv6hdr);
 	mldlen = skb->tail - skb->h.raw;
@@ -1329,9 +1329,9 @@ static void mld_sendpack(struct sk_buff *skb)
 		dev_queue_xmit);
 	if (!err) {
 		ICMP6_INC_STATS(idev,Icmp6OutMsgs);
-		IP6_INC_STATS(Ip6OutMcastPkts);
+		IP6_INC_STATS(OutMcastPkts);
 	} else
-		IP6_INC_STATS(Ip6OutDiscards);
+		IP6_INC_STATS(OutDiscards);
 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
@@ -1613,7 +1613,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 		     IPV6_TLV_ROUTERALERT, 2, 0, 0,
 		     IPV6_TLV_PADN, 0 };
 
-	IP6_INC_STATS(Ip6OutRequests);
+	IP6_INC_STATS(OutRequests);
 	snd_addr = addr;
 	if (type == ICMPV6_MGM_REDUCTION) {
 		snd_addr = &all_routers;
@@ -1627,7 +1627,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 	skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err);
 
 	if (skb == NULL) {
-		IP6_INC_STATS(Ip6OutDiscards);
+		IP6_INC_STATS(OutDiscards);
 		return;
 	}
 
@@ -1672,16 +1672,16 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 		else
 			ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses);
 		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
-		IP6_INC_STATS(Ip6OutMcastPkts);
+		IP6_INC_STATS(OutMcastPkts);
 	} else
-		IP6_INC_STATS(Ip6OutDiscards);
+		IP6_INC_STATS(OutDiscards);
 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
 	return;
 
 out:
-	IP6_INC_STATS(Ip6OutDiscards);
+	IP6_INC_STATS(OutDiscards);
 	kfree_skb(skb);
 }
 
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 3de845af2..245dac731 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -395,7 +395,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
 
 	ndisc_flow_init(&fl, NDISC_NEIGHBOUR_ADVERTISEMENT, src_addr, daddr);
 
-	dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output2);
+	dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output);
 	if (!dst)
 		return;
 
@@ -452,7 +452,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
 
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(Ip6OutRequests);
+	IP6_INC_STATS(OutRequests);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
 		ICMP6_INC_STATS(idev, Icmp6OutNeighborAdvertisements);
@@ -486,7 +486,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
 
 	ndisc_flow_init(&fl, NDISC_NEIGHBOUR_SOLICITATION, saddr, daddr);
 
-	dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output2);
+	dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output);
 	if (!dst)
 		return;
 
@@ -536,7 +536,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
 	/* send it! */
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(Ip6OutRequests);
+	IP6_INC_STATS(OutRequests);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
 		ICMP6_INC_STATS(idev, Icmp6OutNeighborSolicits);
@@ -562,7 +562,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
 
 	ndisc_flow_init(&fl, NDISC_ROUTER_SOLICITATION, saddr, daddr);
 
-	dst = ndisc_dst_alloc(dev, NULL, daddr, ip6_output2);
+	dst = ndisc_dst_alloc(dev, NULL, daddr, ip6_output);
 	if (!dst)
 		return;
 
@@ -609,7 +609,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
 	/* send it! */
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(Ip6OutRequests);	
+	IP6_INC_STATS(OutRequests);	
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
 		ICMP6_INC_STATS(idev, Icmp6OutRouterSolicits);
@@ -1335,7 +1335,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
 
 	buff->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(Ip6OutRequests);
+	IP6_INC_STATS(OutRequests);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, buff, NULL, dst->dev, dst_output);
 	if (!err) {
 		ICMP6_INC_STATS(idev, Icmp6OutRedirects);
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index b8ef96fd3..223212888 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -66,8 +66,6 @@ do {								\
 #endif
 #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
 
-/* Mutex protects lists (only traversed in user context). */
-static DECLARE_MUTEX(ip6t_mutex);
 
 /* Must have mutex */
 #define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ip6t_mutex) != 0)
@@ -544,7 +542,7 @@ find_inlist_lock(struct list_head *head,
 #endif
 
 static inline struct ip6t_table *
-find_table_lock(const char *name, int *error, struct semaphore *mutex)
+ip6t_find_table_lock(const char *name, int *error, struct semaphore *mutex)
 {
 	return find_inlist_lock(&ip6t_tables, name, "ip6table_", error, mutex);
 }
@@ -555,8 +553,8 @@ find_match_lock(const char *name, int *error, struct semaphore *mutex)
 	return find_inlist_lock(&ip6t_match, name, "ip6t_", error, mutex);
 }
 
-static inline struct ip6t_target *
-find_target_lock(const char *name, int *error, struct semaphore *mutex)
+struct ip6t_target *
+ip6t_find_target_lock(const char *name, int *error, struct semaphore *mutex)
 {
 	return find_inlist_lock(&ip6t_target, name, "ip6t_", error, mutex);
 }
@@ -771,7 +769,7 @@ check_entry(struct ip6t_entry *e, const char *name, unsigned int size,
 		goto cleanup_matches;
 
 	t = ip6t_get_target(e);
-	target = find_target_lock(t->u.user.name, &ret, &ip6t_mutex);
+	target = ip6t_find_target_lock(t->u.user.name, &ret, &ip6t_mutex);
 	if (!target) {
 		duprintf("check_entry: `%s' not found\n", t->u.user.name);
 		goto cleanup_matches;
@@ -1028,7 +1026,7 @@ get_counters(const struct ip6t_table_info *t,
 static int
 copy_entries_to_user(unsigned int total_size,
 		     struct ip6t_table *table,
-		     void *userptr)
+		     void __user *userptr)
 {
 	unsigned int off, num, countersize;
 	struct ip6t_entry *e;
@@ -1106,12 +1104,12 @@ copy_entries_to_user(unsigned int total_size,
 
 static int
 get_entries(const struct ip6t_get_entries *entries,
-	    struct ip6t_get_entries *uptr)
+	    struct ip6t_get_entries __user *uptr)
 {
 	int ret;
 	struct ip6t_table *t;
 
-	t = find_table_lock(entries->name, &ret, &ip6t_mutex);
+	t = ip6t_find_table_lock(entries->name, &ret, &ip6t_mutex);
 	if (t) {
 		duprintf("t->private->number = %u\n",
 			 t->private->number);
@@ -1133,7 +1131,7 @@ get_entries(const struct ip6t_get_entries *entries,
 }
 
 static int
-do_replace(void *user, unsigned int len)
+do_replace(void __user *user, unsigned int len)
 {
 	int ret;
 	struct ip6t_replace tmp;
@@ -1174,7 +1172,7 @@ do_replace(void *user, unsigned int len)
 
 	duprintf("ip_tables: Translated table\n");
 
-	t = find_table_lock(tmp.name, &ret, &ip6t_mutex);
+	t = ip6t_find_table_lock(tmp.name, &ret, &ip6t_mutex);
 	if (!t)
 		goto free_newinfo_counters_untrans;
 
@@ -1254,7 +1252,7 @@ add_counter_to_entry(struct ip6t_entry *e,
 }
 
 static int
-do_add_counters(void *user, unsigned int len)
+do_add_counters(void __user *user, unsigned int len)
 {
 	unsigned int i;
 	struct ip6t_counters_info tmp, *paddc;
@@ -1276,7 +1274,7 @@ do_add_counters(void *user, unsigned int len)
 		goto free;
 	}
 
-	t = find_table_lock(tmp.name, &ret, &ip6t_mutex);
+	t = ip6t_find_table_lock(tmp.name, &ret, &ip6t_mutex);
 	if (!t)
 		goto free;
 
@@ -1302,7 +1300,7 @@ do_add_counters(void *user, unsigned int len)
 }
 
 static int
-do_ip6t_set_ctl(struct sock *sk,	int cmd, void *user, unsigned int len)
+do_ip6t_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
 {
 	int ret;
 
@@ -1327,7 +1325,7 @@ do_ip6t_set_ctl(struct sock *sk,	int cmd, void *user, unsigned int len)
 }
 
 static int
-do_ip6t_get_ctl(struct sock *sk, int cmd, void *user, int *len)
+do_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
 {
 	int ret;
 
@@ -1351,7 +1349,7 @@ do_ip6t_get_ctl(struct sock *sk, int cmd, void *user, int *len)
 			break;
 		}
 		name[IP6T_TABLE_MAXNAMELEN-1] = '\0';
-		t = find_table_lock(name, &ret, &ip6t_mutex);
+		t = ip6t_find_table_lock(name, &ret, &ip6t_mutex);
 		if (t) {
 			struct ip6t_getinfo info;
 
@@ -1964,6 +1962,7 @@ static void __exit fini(void)
 EXPORT_SYMBOL(ip6t_register_table);
 EXPORT_SYMBOL(ip6t_unregister_table);
 EXPORT_SYMBOL(ip6t_do_table);
+EXPORT_SYMBOL(ip6t_find_target_lock);
 EXPORT_SYMBOL(ip6t_register_match);
 EXPORT_SYMBOL(ip6t_unregister_match);
 EXPORT_SYMBOL(ip6t_register_target);
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index e6e4621f5..fda6285ef 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -57,43 +57,36 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
 	return 0;
 }
 
-struct snmp6_item
-{
-	char *name;
-	int   offset;
-};
-#define SNMP6_SENTINEL	{ .name = NULL, .offset = 0 }
-
-static struct snmp6_item snmp6_ipv6_list[] = {
+static struct snmp_item snmp6_ipstats_list[] = {
 /* ipv6 mib according to RFC 2465 */
-#define SNMP6_GEN(x) { .name = #x , .offset = offsetof(struct ipv6_mib, x) }
-	SNMP6_GEN(Ip6InReceives),
-	SNMP6_GEN(Ip6InHdrErrors),
-	SNMP6_GEN(Ip6InTooBigErrors),
-	SNMP6_GEN(Ip6InNoRoutes),
-	SNMP6_GEN(Ip6InAddrErrors),
-	SNMP6_GEN(Ip6InUnknownProtos),
-	SNMP6_GEN(Ip6InTruncatedPkts),
-	SNMP6_GEN(Ip6InDiscards),
-	SNMP6_GEN(Ip6InDelivers),
-	SNMP6_GEN(Ip6OutForwDatagrams),
-	SNMP6_GEN(Ip6OutRequests),
-	SNMP6_GEN(Ip6OutDiscards),
-	SNMP6_GEN(Ip6OutNoRoutes),
-	SNMP6_GEN(Ip6ReasmTimeout),
-	SNMP6_GEN(Ip6ReasmReqds),
-	SNMP6_GEN(Ip6ReasmOKs),
-	SNMP6_GEN(Ip6ReasmFails),
-	SNMP6_GEN(Ip6FragOKs),
-	SNMP6_GEN(Ip6FragFails),
-	SNMP6_GEN(Ip6FragCreates),
-	SNMP6_GEN(Ip6InMcastPkts),
-	SNMP6_GEN(Ip6OutMcastPkts),
+#define SNMP6_GEN(x)	SNMP_ITEM(struct ipstats_mib, x, "Ip6" #x)
+	SNMP6_GEN(InReceives),
+	SNMP6_GEN(InHdrErrors),
+	SNMP6_GEN(InTooBigErrors),
+	SNMP6_GEN(InNoRoutes),
+	SNMP6_GEN(InAddrErrors),
+	SNMP6_GEN(InUnknownProtos),
+	SNMP6_GEN(InTruncatedPkts),
+	SNMP6_GEN(InDiscards),
+	SNMP6_GEN(InDelivers),
+	SNMP6_GEN(OutForwDatagrams),
+	SNMP6_GEN(OutRequests),
+	SNMP6_GEN(OutDiscards),
+	SNMP6_GEN(OutNoRoutes),
+	SNMP6_GEN(ReasmTimeout),
+	SNMP6_GEN(ReasmReqds),
+	SNMP6_GEN(ReasmOKs),
+	SNMP6_GEN(ReasmFails),
+	SNMP6_GEN(FragOKs),
+	SNMP6_GEN(FragFails),
+	SNMP6_GEN(FragCreates),
+	SNMP6_GEN(InMcastPkts),
+	SNMP6_GEN(OutMcastPkts),
 #undef SNMP6_GEN
-	SNMP6_SENTINEL
+	SNMP_ITEM_SENTINEL
 };
 
-static struct snmp6_item snmp6_icmp6_list[] = {
+static struct snmp_item snmp6_icmp6_list[] = {
 /* icmpv6 mib according to RFC 2466
 
    Exceptions:  {In|Out}AdminProhibs are removed, because I see
@@ -104,7 +97,7 @@ static struct snmp6_item snmp6_icmp6_list[] = {
 		OutRouterAdvertisements too.
 		OutGroupMembQueries too.
  */
-#define SNMP6_GEN(x) { .name = #x , .offset = offsetof(struct icmpv6_mib, x) }
+#define SNMP6_GEN(x)	SNMP_ITEM(struct icmpv6_mib, x, #x)
 	SNMP6_GEN(Icmp6InMsgs),
 	SNMP6_GEN(Icmp6InErrors),
 	SNMP6_GEN(Icmp6InDestUnreachs),
@@ -134,17 +127,17 @@ static struct snmp6_item snmp6_icmp6_list[] = {
 	SNMP6_GEN(Icmp6OutGroupMembResponses),
 	SNMP6_GEN(Icmp6OutGroupMembReductions),
 #undef SNMP6_GEN
-	SNMP6_SENTINEL
+	SNMP_ITEM_SENTINEL
 };
 
-static struct snmp6_item snmp6_udp6_list[] = {
-#define SNMP6_GEN(x) { .name = "Udp6" #x , .offset = offsetof(struct udp_mib, Udp##x) }
+static struct snmp_item snmp6_udp6_list[] = {
+#define SNMP6_GEN(x)	SNMP_ITEM(struct udp_mib, Udp##x, "Udp6" #x)
 	SNMP6_GEN(InDatagrams),
 	SNMP6_GEN(NoPorts),
 	SNMP6_GEN(InErrors),
 	SNMP6_GEN(OutDatagrams),
 #undef SNMP6_GEN
-	SNMP6_SENTINEL
+	SNMP_ITEM_SENTINEL
 };
 
 static unsigned long
@@ -167,7 +160,7 @@ fold_field(void *mib[], int offt)
 }
 
 static inline void
-snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp6_item *itemlist)
+snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_item *itemlist)
 {
 	int i;
 	for (i=0; itemlist[i].name; i++)
@@ -183,7 +176,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
 		seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex);
 		snmp6_seq_show_item(seq, (void **)idev->stats.icmpv6, snmp6_icmp6_list);
 	} else {
-		snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipv6_list);
+		snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list);
 		snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list);
 		snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list);
 	}
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index c407c7ed5..0e1b275ad 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -283,7 +283,8 @@ void rawv6_err(struct sock *sk, struct sk_buff *skb,
 
 static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb)
 {
-	if (sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
+	if ((raw6_sk(sk)->checksum || sk->sk_filter) && 
+	    skb->ip_summed != CHECKSUM_UNNECESSARY) {
 		if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) {
 			/* FIXME: increment a raw6 drops counter here */
 			kfree_skb(skb);
@@ -408,10 +409,8 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
 		ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr);
 		sin6->sin6_flowinfo = 0;
 		sin6->sin6_scope_id = 0;
-		if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) {
-			struct inet6_skb_parm *opt = (struct inet6_skb_parm *) skb->cb;
-			sin6->sin6_scope_id = opt->iif;
-		}
+		if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
+			sin6->sin6_scope_id = IP6CB(skb)->iif;
 	}
 
 	sock_recv_timestamp(msg, sk, skb);
@@ -452,6 +451,10 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct r
 	struct sk_buff *skb;
 	int err = 0;
 	u16 *csum;
+	u32 tmp_csum;
+
+	if (!opt->checksum)
+		goto send;
 
 	if ((skb = skb_peek(&sk->sk_write_queue)) == NULL)
 		goto out;
@@ -463,29 +466,32 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct r
 		goto out;
 	}
 
+	/* should be check HW csum miyazawa */
 	if (skb_queue_len(&sk->sk_write_queue) == 1) {
 		/*
 		 * Only one fragment on the socket.
 		 */
-		/* should be check HW csum miyazawa */
-		*csum = csum_ipv6_magic(&fl->fl6_src,
-					&fl->fl6_dst,
-					len, fl->proto, skb->csum);
+		tmp_csum = skb->csum;
 	} else {
-		u32 tmp_csum = 0;
+		tmp_csum = 0;
 
 		skb_queue_walk(&sk->sk_write_queue, skb) {
 			tmp_csum = csum_add(tmp_csum, skb->csum);
 		}
-
-		tmp_csum = csum_ipv6_magic(&fl->fl6_src,
-					   &fl->fl6_dst,
-					   len, fl->proto, tmp_csum);
-		*csum = tmp_csum;
 	}
+
+	/* in case cksum was not initialized */
+	if (unlikely(*csum))
+		tmp_csum = csum_sub(tmp_csum, *csum);
+
+	*csum = csum_ipv6_magic(&fl->fl6_src,
+				&fl->fl6_dst,
+				len, fl->proto, tmp_csum);
+
 	if (*csum == 0)
 		*csum = -1;
-	ip6_push_pending_frames(sk);
+send:
+	err = ip6_push_pending_frames(sk);
 out:
 	return err;
 }
@@ -527,7 +533,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
 	if (err)
 		goto error_fault;
 
-	IP6_INC_STATS(Ip6OutRequests);		
+	IP6_INC_STATS(OutRequests);		
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
 		      dst_output);
 	if (err > 0)
@@ -541,7 +547,7 @@ error_fault:
 	err = -EFAULT;
 	kfree_skb(skb);
 error:
-	IP6_INC_STATS(Ip6OutDiscards);
+	IP6_INC_STATS(OutDiscards);
 	return err; 
 }
 static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
@@ -702,13 +708,8 @@ back_from_confirm:
 
 		if (err)
 			ip6_flush_pending_frames(sk);
-		else if (!(msg->msg_flags & MSG_MORE)) {
-			if (raw_opt->checksum) {
-				err = rawv6_push_pending_frames(sk, &fl, raw_opt, len);
-			} else {
-				err = ip6_push_pending_frames(sk);
-			}
-		}
+		else if (!(msg->msg_flags & MSG_MORE))
+			err = rawv6_push_pending_frames(sk, &fl, raw_opt, len);
 	}
 done:
 	ip6_dst_store(sk, dst,
@@ -730,7 +731,7 @@ do_confirm:
 }
 
 static int rawv6_seticmpfilter(struct sock *sk, int level, int optname, 
-			       char *optval, int optlen)
+			       char __user *optval, int optlen)
 {
 	switch (optname) {
 	case ICMPV6_FILTER:
@@ -747,7 +748,7 @@ static int rawv6_seticmpfilter(struct sock *sk, int level, int optname,
 }
 
 static int rawv6_geticmpfilter(struct sock *sk, int level, int optname, 
-			       char *optval, int *optlen)
+			       char __user *optval, int __user *optlen)
 {
 	int len;
 
@@ -773,7 +774,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
 
 
 static int rawv6_setsockopt(struct sock *sk, int level, int optname, 
-			    char *optval, int optlen)
+			    char __user *optval, int optlen)
 {
 	struct raw6_opt *opt = raw6_sk(sk);
 	int val;
@@ -795,7 +796,7 @@ static int rawv6_setsockopt(struct sock *sk, int level, int optname,
 					       optlen);
 	};
 
-  	if (get_user(val, (int *)optval))
+  	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 
 	switch (optname) {
@@ -820,7 +821,7 @@ static int rawv6_setsockopt(struct sock *sk, int level, int optname,
 }
 
 static int rawv6_getsockopt(struct sock *sk, int level, int optname, 
-			    char *optval, int *optlen)
+			    char __user *optval, int __user *optlen)
 {
 	struct raw6_opt *opt = raw6_sk(sk);
 	int val, len;
@@ -872,7 +873,7 @@ static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg)
 		case SIOCOUTQ:
 		{
 			int amount = atomic_read(&sk->sk_wmem_alloc);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 		case SIOCINQ:
 		{
@@ -884,7 +885,7 @@ static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg)
 			if (skb != NULL)
 				amount = skb->tail - skb->h.raw;
 			spin_unlock_irq(&sk->sk_receive_queue.lock);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 
 		default:
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 1ee91bff2..ccee9877c 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -284,7 +284,7 @@ static void ip6_evictor(void)
 		spin_unlock(&fq->lock);
 
 		fq_put(fq);
-		IP6_INC_STATS_BH(Ip6ReasmFails);
+		IP6_INC_STATS_BH(ReasmFails);
 	}
 }
 
@@ -299,8 +299,8 @@ static void ip6_frag_expire(unsigned long data)
 
 	fq_kill(fq);
 
-	IP6_INC_STATS_BH(Ip6ReasmTimeout);
-	IP6_INC_STATS_BH(Ip6ReasmFails);
+	IP6_INC_STATS_BH(ReasmTimeout);
+	IP6_INC_STATS_BH(ReasmFails);
 
 	/* Send error only if the first segment arrived. */
 	if (fq->last_in&FIRST_IN && fq->fragments) {
@@ -386,7 +386,7 @@ ip6_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr
 	return ip6_frag_intern(hash, fq);
 
 oom:
-	IP6_INC_STATS_BH(Ip6ReasmFails);
+	IP6_INC_STATS_BH(ReasmFails);
 	return NULL;
 }
 
@@ -426,7 +426,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 			((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1)));
 
 	if ((unsigned int)end > IPV6_MAXPLEN) {
-		IP6_INC_STATS_BH(Ip6InHdrErrors);
+		IP6_INC_STATS_BH(InHdrErrors);
  		icmpv6_param_prob(skb,ICMPV6_HDR_FIELD, (u8*)&fhdr->frag_off - skb->nh.raw);
  		return;
 	}
@@ -453,7 +453,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 			/* RFC2460 says always send parameter problem in
 			 * this case. -DaveM
 			 */
-			IP6_INC_STATS_BH(Ip6InHdrErrors);
+			IP6_INC_STATS_BH(InHdrErrors);
 			icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, 
 					  offsetof(struct ipv6hdr, payload_len));
 			return;
@@ -572,7 +572,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 	return;
 
 err:
-	IP6_INC_STATS(Ip6ReasmFails);
+	IP6_INC_STATS(ReasmFails);
 	kfree_skb(skb);
 }
 
@@ -666,7 +666,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
 	if (head->ip_summed == CHECKSUM_HW)
 		head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
 
-	IP6_INC_STATS_BH(Ip6ReasmOKs);
+	IP6_INC_STATS_BH(ReasmOKs);
 	fq->fragments = NULL;
 	*nhoffp = nhoff;
 	return 1;
@@ -679,7 +679,7 @@ out_oom:
 	if (net_ratelimit())
 		printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
 out_fail:
-	IP6_INC_STATS_BH(Ip6ReasmFails);
+	IP6_INC_STATS_BH(ReasmFails);
 	return -1;
 }
 
@@ -693,16 +693,16 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	hdr = skb->nh.ipv6h;
 
-	IP6_INC_STATS_BH(Ip6ReasmReqds);
+	IP6_INC_STATS_BH(ReasmReqds);
 
 	/* Jumbo payload inhibits frag. header */
 	if (hdr->payload_len==0) {
-		IP6_INC_STATS(Ip6InHdrErrors);
+		IP6_INC_STATS(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
 		return -1;
 	}
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) {
-		IP6_INC_STATS(Ip6InHdrErrors);
+		IP6_INC_STATS(InHdrErrors);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
 		return -1;
 	}
@@ -713,7 +713,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 	if (!(fhdr->frag_off & htons(0xFFF9))) {
 		/* It is not a fragmented frame */
 		skb->h.raw += sizeof(struct frag_hdr);
-		IP6_INC_STATS_BH(Ip6ReasmOKs);
+		IP6_INC_STATS_BH(ReasmOKs);
 
 		*nhoffp = (u8*)fhdr - skb->nh.raw;
 		return 1;
@@ -738,7 +738,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 		return ret;
 	}
 
-	IP6_INC_STATS_BH(Ip6ReasmFails);
+	IP6_INC_STATS_BH(ReasmFails);
 	kfree_skb(skb);
 	return -1;
 }
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 442b4d5ef..541f2434b 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -83,9 +83,12 @@ static int ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40;
 static struct rt6_info * ip6_rt_copy(struct rt6_info *ort);
 static struct dst_entry	*ip6_dst_check(struct dst_entry *dst, u32 cookie);
 static struct dst_entry *ip6_negative_advice(struct dst_entry *);
+static void		ip6_dst_destroy(struct dst_entry *);
+static void		ip6_dst_ifdown(struct dst_entry *, int how);
 static int		 ip6_dst_gc(void);
 
 static int		ip6_pkt_discard(struct sk_buff *skb);
+static int		ip6_pkt_discard_out(struct sk_buff **pskb);
 static void		ip6_link_failure(struct sk_buff *skb);
 static void		ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu);
 
@@ -95,6 +98,8 @@ static struct dst_ops ip6_dst_ops = {
 	.gc			=	ip6_dst_gc,
 	.gc_thresh		=	1024,
 	.check			=	ip6_dst_check,
+	.destroy		=	ip6_dst_destroy,
+	.ifdown			=	ip6_dst_ifdown,
 	.negative_advice	=	ip6_negative_advice,
 	.link_failure		=	ip6_link_failure,
 	.update_pmtu		=	ip6_rt_update_pmtu,
@@ -111,7 +116,7 @@ struct rt6_info ip6_null_entry = {
 			.error		= -ENETUNREACH,
 			.metrics	= { [RTAX_HOPLIMIT - 1] = 255, },
 			.input		= ip6_pkt_discard,
-			.output		= ip6_pkt_discard,
+			.output		= ip6_pkt_discard_out,
 			.ops		= &ip6_dst_ops,
 			.path		= (struct dst_entry*)&ip6_null_entry,
 		}
@@ -134,7 +139,23 @@ rwlock_t rt6_lock = RW_LOCK_UNLOCKED;
 /* allocate dst with ip6_dst_ops */
 static __inline__ struct rt6_info *ip6_dst_alloc(void)
 {
-	return dst_alloc(&ip6_dst_ops);
+	return (struct rt6_info *)dst_alloc(&ip6_dst_ops);
+}
+
+static void ip6_dst_destroy(struct dst_entry *dst)
+{
+	struct rt6_info *rt = (struct rt6_info *)dst;
+	struct inet6_dev *idev = rt->rt6i_idev;
+
+	if (idev != NULL) {
+		rt->rt6i_idev = NULL;
+		in6_dev_put(idev);
+	}	
+}
+
+static void ip6_dst_ifdown(struct dst_entry *dst, int how)
+{
+	ip6_dst_destroy(dst);
 }
 
 /*
@@ -554,37 +575,43 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
 
 	if (mtu < dst_pmtu(dst) && rt6->rt6i_dst.plen == 128) {
 		rt6->rt6i_flags |= RTF_MODIFIED;
+		if (mtu < IPV6_MIN_MTU)
+			mtu = IPV6_MIN_MTU;
 		dst->metrics[RTAX_MTU-1] = mtu;
 	}
 }
 
 /* Protected by rt6_lock.  */
 static struct dst_entry *ndisc_dst_gc_list;
+static int ipv6_get_mtu(struct net_device *dev);
+static inline unsigned int ipv6_advmss(unsigned int mtu);
 
 struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 
 				  struct neighbour *neigh,
 				  struct in6_addr *addr,
-				  int (*output)(struct sk_buff *))
+				  int (*output)(struct sk_buff **))
 {
 	struct rt6_info *rt = ip6_dst_alloc();
 
 	if (unlikely(rt == NULL))
 		goto out;
 
-	if (dev)
-		dev_hold(dev);
+	dev_hold(dev);
 	if (neigh)
 		neigh_hold(neigh);
 	else
 		neigh = ndisc_get_neigh(dev, addr);
 
 	rt->rt6i_dev	  = dev;
+	rt->rt6i_idev     = in6_dev_get(dev);
 	rt->rt6i_nexthop  = neigh;
 	rt->rt6i_expires  = 0;
 	rt->rt6i_flags    = RTF_LOCAL;
 	rt->rt6i_metric   = 0;
 	atomic_set(&rt->u.dst.__refcnt, 1);
 	rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255;
+	rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev);
+	rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_pmtu(&rt->u.dst));
 	rt->u.dst.output  = output;
 
 	write_lock_bh(&rt6_lock);
@@ -712,6 +739,12 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_rtattr)
 	if (rtmsg->rtmsg_src_len)
 		return -EINVAL;
 #endif
+	if (rtmsg->rtmsg_ifindex) {
+		dev = dev_get_by_index(rtmsg->rtmsg_ifindex);
+		if (!dev)
+			return -ENODEV;
+	}
+
 	if (rtmsg->rtmsg_metric == 0)
 		rtmsg->rtmsg_metric = IP6_RT_PRIO_USER;
 
@@ -737,13 +770,6 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_rtattr)
 
 	rt->u.dst.output = ip6_output;
 
-	if (rtmsg->rtmsg_ifindex) {
-		dev = dev_get_by_index(rtmsg->rtmsg_ifindex);
-		err = -ENODEV;
-		if (dev == NULL)
-			goto out;
-	}
-
 	ipv6_addr_prefix(&rt->rt6i_dst.addr, 
 			 &rtmsg->rtmsg_dst, rtmsg->rtmsg_dst_len);
 	rt->rt6i_dst.plen = rtmsg->rtmsg_dst_len;
@@ -767,7 +793,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_rtattr)
 			dev_put(dev);
 		dev = &loopback_dev;
 		dev_hold(dev);
-		rt->u.dst.output = ip6_pkt_discard;
+		rt->u.dst.output = ip6_pkt_discard_out;
 		rt->u.dst.input = ip6_pkt_discard;
 		rt->u.dst.error = -ENETUNREACH;
 		rt->rt6i_flags = RTF_REJECT|RTF_NONEXTHOP;
@@ -870,6 +896,7 @@ install_route:
 	if (!rt->u.dst.metrics[RTAX_ADVMSS-1])
 		rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_pmtu(&rt->u.dst));
 	rt->u.dst.dev = dev;
+	rt->rt6i_idev = in6_dev_get(dev);
 	return rt6_ins(rt, nlh, _rtattr);
 
 out:
@@ -1136,6 +1163,9 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
 		rt->u.dst.dev = ort->u.dst.dev;
 		if (rt->u.dst.dev)
 			dev_hold(rt->u.dst.dev);
+		rt->rt6i_idev = ort->rt6i_idev;
+		if (rt->rt6i_idev)
+			in6_dev_hold(rt->rt6i_idev);
 		rt->u.dst.lastuse = jiffies;
 		rt->rt6i_expires = 0;
 
@@ -1217,7 +1247,7 @@ restart:
 	read_unlock_bh(&rt6_lock);
 }
 
-int ipv6_route_ioctl(unsigned int cmd, void *arg)
+int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct in6_rtmsg rtmsg;
 	int err;
@@ -1257,12 +1287,17 @@ int ipv6_route_ioctl(unsigned int cmd, void *arg)
 
 int ip6_pkt_discard(struct sk_buff *skb)
 {
-	IP6_INC_STATS(Ip6OutNoRoutes);
+	IP6_INC_STATS(OutNoRoutes);
 	icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb->dev);
 	kfree_skb(skb);
 	return 0;
 }
 
+int ip6_pkt_discard_out(struct sk_buff **pskb)
+{
+	return ip6_pkt_discard(*pskb);
+}
+
 /*
  *	Add address
  */
@@ -1280,6 +1315,7 @@ int ip6_rt_addr_add(struct in6_addr *addr, struct net_device *dev, int anycast)
 	rt->u.dst.input = ip6_input;
 	rt->u.dst.output = ip6_output;
 	rt->rt6i_dev = &loopback_dev;
+	rt->rt6i_idev = in6_dev_get(&loopback_dev);
 	rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev);
 	rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_pmtu(&rt->u.dst));
 	rt->u.dst.metrics[RTAX_HOPLIMIT-1] = ipv6_get_hoplimit(rt->rt6i_dev);
@@ -1884,7 +1920,7 @@ static int flush_delay;
 
 static
 int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
-			      void *buffer, size_t *lenp)
+			      void __user *buffer, size_t *lenp)
 {
 	if (write) {
 		proc_dointvec(ctl, write, filp, buffer, lenp);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2949cd143..2668fc87c 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -479,7 +479,7 @@ static int tcp_v6_check_established(struct sock *sk)
 
 	/* And established part... */
 	sk_for_each(sk2, node, &head->chain) {
-		if(TCP_IPV6_MATCH(sk, saddr, daddr, ports, dif))
+		if(TCP_IPV6_MATCH(sk2, saddr, daddr, ports, dif))
 			goto not_unique;
 	}
 
@@ -536,8 +536,7 @@ static int tcp_v6_hash_connect(struct sock *sk)
 
 static __inline__ int tcp_v6_iif(struct sk_buff *skb)
 {
-	struct inet6_skb_parm *opt = (struct inet6_skb_parm *) skb->cb;
-	return opt->iif;
+	return IP6CB(skb)->iif;
 }
 
 static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, 
@@ -879,7 +878,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req,
 		    np->rxopt.bits.srcrt == 2 &&
 		    req->af.v6_req.pktopts) {
 			struct sk_buff *pktopts = req->af.v6_req.pktopts;
-			struct inet6_skb_parm *rxopt = (struct inet6_skb_parm *)pktopts->cb;
+			struct inet6_skb_parm *rxopt = IP6CB(pktopts);
 			if (rxopt->srcrt)
 				opt = ipv6_invert_rthdr(sk, (struct ipv6_rt_hdr*)(pktopts->nh.raw + rxopt->srcrt));
 		}
@@ -932,7 +931,7 @@ static struct or_calltable or_ipv6 = {
 static int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
-	struct inet6_skb_parm *opt = (struct inet6_skb_parm *)skb->cb;
+	struct inet6_skb_parm *opt = IP6CB(skb);
 
 	if (np->rxopt.all) {
 		if ((opt->hop && np->rxopt.bits.hopopts) ||
@@ -1183,7 +1182,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 		goto drop;		
 	}
 
-	if (tcp_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
+	if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
 		goto drop;
 
 	req = tcp_openreq_alloc();
@@ -1300,12 +1299,12 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 
 	opt = np->opt;
 
-	if (tcp_acceptq_is_full(sk))
+	if (sk_acceptq_is_full(sk))
 		goto out_overflow;
 
 	if (np->rxopt.bits.srcrt == 2 &&
 	    opt == NULL && req->af.v6_req.pktopts) {
-		struct inet6_skb_parm *rxopt = (struct inet6_skb_parm *)req->af.v6_req.pktopts->cb;
+		struct inet6_skb_parm *rxopt = IP6CB(req->af.v6_req.pktopts);
 		if (rxopt->srcrt)
 			opt = ipv6_invert_rthdr(sk, (struct ipv6_rt_hdr*)(req->af.v6_req.pktopts->nh.raw+rxopt->srcrt));
 	}
@@ -1933,7 +1932,7 @@ static void get_openreq6(struct seq_file *seq,
 	dest = &req->af.v6_req.rmt_addr;
 	seq_printf(seq,
 		   "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
-		   "%02X %08X:%08X %02X:%08X %08X %5d %8d %d %d %p\n",
+		   "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p\n",
 		   i,
 		   src->s6_addr32[0], src->s6_addr32[1],
 		   src->s6_addr32[2], src->s6_addr32[3],
@@ -2019,7 +2018,7 @@ static void get_timewait6_sock(struct seq_file *seq,
 
 	seq_printf(seq,
 		   "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
-		   "%02X %08X:%08X %02X:%08X %08X %5d %8d %d %d %p\n",
+		   "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p\n",
 		   i,
 		   src->s6_addr32[0], src->s6_addr32[1],
 		   src->s6_addr32[2], src->s6_addr32[3], srcp,
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 17cf6dd87..0dc7f0ec1 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -432,10 +432,8 @@ try_again:
 
 			if (np->rxopt.all)
 				datagram_recv_ctl(sk, msg, skb);
-			if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) {
-				struct inet6_skb_parm *opt = (struct inet6_skb_parm *) skb->cb;
-				sin6->sin6_scope_id = opt->iif;
-			}
+			if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
+				sin6->sin6_scope_id = IP6CB(skb)->iif;
 		}
   	}
 	err = copied;
@@ -574,34 +572,26 @@ static void udpv6_mcast_deliver(struct udphdr *uh,
 				struct sk_buff *skb)
 {
 	struct sock *sk, *sk2;
-	struct sk_buff *buff;
 	int dif;
 
 	read_lock(&udp_hash_lock);
 	sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
 	dif = skb->dev->ifindex;
 	sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
-	if (!sk)
-		goto free_skb;
+	if (!sk) {
+		kfree_skb(skb);
+		goto out;
+	}
 
-	buff = NULL;
 	sk2 = sk;
 	while ((sk2 = udp_v6_mcast_next(sk_next(sk2), uh->dest, daddr,
 					uh->source, saddr, dif))) {
-		if (!buff) {
-			buff = skb_clone(skb, GFP_ATOMIC);
-			if (!buff)
-				continue;
-		}
-		if (udpv6_queue_rcv_skb(sk2, buff) >= 0)
-			buff = NULL;
-	}
-	if (buff)
-		kfree_skb(buff);
-	if (udpv6_queue_rcv_skb(sk, skb) < 0) {
-free_skb:
-		kfree_skb(skb);
+		struct sk_buff *buff = skb_clone(skb, GFP_ATOMIC);
+		if (buff)
+			udpv6_queue_rcv_skb(sk2, buff);
 	}
+	udpv6_queue_rcv_skb(sk, skb);
+out:
 	read_unlock(&udp_hash_lock);
 }
 
@@ -1026,7 +1016,7 @@ static int udpv6_destroy_sock(struct sock *sk)
  *	Socket option code for UDP
  */
 static int udpv6_setsockopt(struct sock *sk, int level, int optname, 
-			  char *optval, int optlen)
+			  char __user *optval, int optlen)
 {
 	struct udp_opt *up = udp_sk(sk);
 	int val;
@@ -1038,7 +1028,7 @@ static int udpv6_setsockopt(struct sock *sk, int level, int optname,
 	if(optlen<sizeof(int))
 		return -EINVAL;
 
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 
 	switch(optname) {
@@ -1066,7 +1056,7 @@ static int udpv6_setsockopt(struct sock *sk, int level, int optname,
 }
 
 static int udpv6_getsockopt(struct sock *sk, int level, int optname, 
-			  char *optval, int *optlen)
+			  char __user *optval, int __user *optlen)
 {
 	struct udp_opt *up = udp_sk(sk);
 	int val, len;
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 740fb1ad5..1041ef952 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -107,7 +107,6 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 			goto error;
 		}
 
-		dst1->xfrm = xfrm[i];
 		if (!dst)
 			dst = dst1;
 		else {
@@ -139,9 +138,11 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 		dst_hold(&rt->u.dst);
 	}
 	dst_prev->child = &rt->u.dst;
+	i = 0;
 	for (dst_prev = dst; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) {
 		struct xfrm_dst *x = (struct xfrm_dst*)dst_prev;
 
+		dst_prev->xfrm = xfrm[i++];
 		dst_prev->dev = rt->u.dst.dev;
 		if (rt->u.dst.dev)
 			dev_hold(rt->u.dst.dev);
@@ -236,10 +237,10 @@ static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu)
 {
 	struct dst_entry *path = dst->path;
 
-	if (mtu >= 1280 && mtu < dst_pmtu(dst))
-		return;
-
-	path->ops->update_pmtu(path, mtu);
+	if (mtu >= IPV6_MIN_MTU && mtu < dst_pmtu(dst))
+		path->ops->update_pmtu(path, mtu);
+	
+	return;
 }
 
 struct dst_ops xfrm6_dst_ops = {
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index c00c8ef25..c72cf83d4 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -90,9 +90,7 @@ __xfrm6_find_acq(u8 mode, u32 reqid, u8 proto,
 			    break;
 		    }
 	}
-	if (x0) {
-		xfrm_state_hold(x0);
-	} else if (create && (x0 = xfrm_state_alloc()) != NULL) {
+	if (!x0 && create && (x0 = xfrm_state_alloc()) != NULL) {
 		ipv6_addr_copy((struct in6_addr *)x0->sel.daddr.a6,
 			       (struct in6_addr *)daddr);
 		ipv6_addr_copy((struct in6_addr *)x0->sel.saddr.a6,
@@ -110,11 +108,14 @@ __xfrm6_find_acq(u8 mode, u32 reqid, u8 proto,
 		x0->props.reqid = reqid;
 		x0->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
 		xfrm_state_hold(x0);
-		mod_timer(&x0->timer, jiffies + XFRM_ACQ_EXPIRES*HZ);
+		x0->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
+		add_timer(&x0->timer);
 		xfrm_state_hold(x0);
 		list_add_tail(&x0->bydst, xfrm6_state_afinfo.state_bydst+h);
 		wake_up(&km_waitq);
 	}
+	if (x0)
+		xfrm_state_hold(x0);
 	return x0;
 }
 
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 85cb6a1c3..163223daf 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -90,7 +90,7 @@ extern int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
 			       struct iovec *iov, int len, int noblock);
 extern int ipxrtr_route_skb(struct sk_buff *skb);
 extern struct ipx_route *ipxrtr_lookup(__u32 net);
-extern int ipxrtr_ioctl(unsigned int cmd, void *arg);
+extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
 
 #undef IPX_REFCNT_DEBUG
 #ifdef IPX_REFCNT_DEBUG
@@ -114,7 +114,7 @@ static void ipxcfg_set_auto_select(char val)
 		ipx_primary_net = ipx_interfaces_head();
 }
 
-static int ipxcfg_get_config_data(struct ipx_config_data *arg)
+static int ipxcfg_get_config_data(struct ipx_config_data __user *arg)
 {
 	struct ipx_config_data vals;
 
@@ -1141,7 +1141,7 @@ out:
 	return intrfc;
 }
 
-static int ipxitf_ioctl(unsigned int cmd, void *arg)
+static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
 {
 	int rc = -EINVAL;
 	struct ifreq ifr;
@@ -1204,14 +1204,14 @@ static int ipxitf_ioctl(unsigned int cmd, void *arg)
 	}
 	case SIOCAIPXITFCRT: 
 		rc = -EFAULT;
-		if (get_user(val, (unsigned char *) arg))
+		if (get_user(val, (unsigned char __user *) arg))
 			break;
 		rc = 0;
 		ipxcfg_auto_create_interfaces = val;
 		break;
 	case SIOCAIPXPRISLT: 
 		rc = -EFAULT;
-		if (get_user(val, (unsigned char *) arg))
+		if (get_user(val, (unsigned char __user *) arg))
 			break;
 		rc = 0;
 		ipxcfg_set_auto_select(val);
@@ -1285,7 +1285,7 @@ const char *ipx_device_name(struct ipx_interface *intrfc)
  * socket object. */
 
 static int ipx_setsockopt(struct socket *sock, int level, int optname,
-			  char *optval, int optlen)
+			  char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	int opt;
@@ -1295,7 +1295,7 @@ static int ipx_setsockopt(struct socket *sock, int level, int optname,
 		goto out;
 
 	rc = -EFAULT;
-	if (get_user(opt, (unsigned int *)optval))
+	if (get_user(opt, (unsigned int __user *)optval))
 		goto out;
 
 	rc = -ENOPROTOOPT;
@@ -1309,7 +1309,7 @@ out:
 }
 
 static int ipx_getsockopt(struct socket *sock, int level, int optname,
-	char *optval, int *optlen)
+	char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	int val = 0;
@@ -1695,7 +1695,7 @@ static int ipx_sendmsg(struct kiocb *iocb, struct socket *sock,
 	/* Socket gets bound below anyway */
 /*	if (sk->sk_zapped)
 		return -EIO; */	/* Socket not bound */
-	if (flags & ~MSG_DONTWAIT)
+	if (flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		goto out;
 
 	/* Max possible packet size limited by 16 bit pktsize in header */
@@ -1823,13 +1823,14 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	int rc = 0;
 	long amount = 0;
 	struct sock *sk = sock->sk;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case TIOCOUTQ:
 		amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 		if (amount < 0)
 			amount = 0;
-		rc = put_user(amount, (int *)arg);
+		rc = put_user(amount, (int __user *)argp);
 		break;
 	case TIOCINQ: {
 		struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
@@ -1837,14 +1838,14 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		 * user tasks fiddle here */
 		if (skb)
 			amount = skb->len - sizeof(struct ipxhdr);
-		rc = put_user(amount, (int *)arg);
+		rc = put_user(amount, (int __user *)argp);
 		break;
 	}
 	case SIOCADDRT:
 	case SIOCDELRT:
 		rc = -EPERM;
 		if (capable(CAP_NET_ADMIN))
-			rc = ipxrtr_ioctl(cmd, (void *)arg);
+			rc = ipxrtr_ioctl(cmd, argp);
 		break;
 	case SIOCSIFADDR:
 	case SIOCAIPXITFCRT:
@@ -1853,10 +1854,10 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		if (!capable(CAP_NET_ADMIN))
 			break;
 	case SIOCGIFADDR:
-		rc = ipxitf_ioctl(cmd, (void *)arg);
+		rc = ipxitf_ioctl(cmd, argp);
 		break;
 	case SIOCIPXCFGDATA:
-		rc = ipxcfg_get_config_data((void *)arg);
+		rc = ipxcfg_get_config_data(argp);
 		break;
 	case SIOCIPXNCPCONN:
 		/*
@@ -1867,12 +1868,12 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
         	if (!capable(CAP_NET_ADMIN))
 			break;
 		rc = get_user(ipx_sk(sk)->ipx_ncp_conn,
-			      (const unsigned short *)(arg));
+			      (const unsigned short __user *)argp);
 		break;
 	case SIOCGSTAMP:
 		rc = -EINVAL;
 		if (sk) 
-			rc = sock_get_timestamp(sk, (struct timeval *)arg);
+			rc = sock_get_timestamp(sk, argp);
 		break;
 	case SIOCGIFDSTADDR:
 	case SIOCSIFDSTADDR:
@@ -1883,7 +1884,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		rc = -EINVAL;
 		break;
 	default:
-		rc = dev_ioctl(cmd,(void *) arg);
+		rc = dev_ioctl(cmd, argp);
 		break;
 	}
 
diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c
index 63505106e..57faf8cbc 100644
--- a/net/ipx/ipx_route.c
+++ b/net/ipx/ipx_route.c
@@ -256,7 +256,7 @@ out:
 /*
  * We use a normal struct rtentry for route handling
  */
-int ipxrtr_ioctl(unsigned int cmd, void *arg)
+int ipxrtr_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct rtentry rt;	/* Use these to behave like 'other' stacks */
 	struct sockaddr_ipx *sg, *st;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 9e56f712e..c90c505ed 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1269,7 +1269,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
 	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
 
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
-	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR))
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	if (sk->sk_shutdown & SEND_SHUTDOWN) {
@@ -1521,7 +1521,7 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
 
 	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
 
-	if (msg->msg_flags & ~MSG_DONTWAIT)
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	if (sk->sk_shutdown & SEND_SHUTDOWN) {
@@ -1593,7 +1593,7 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
 
 	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
 
-	if (msg->msg_flags & ~MSG_DONTWAIT)
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	if (sk->sk_shutdown & SEND_SHUTDOWN) {
@@ -1779,7 +1779,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 		if (amount < 0)
 			amount = 0;
-		if (put_user(amount, (unsigned int *)arg))
+		if (put_user(amount, (unsigned int __user *)arg))
 			return -EFAULT;
 		return 0;
 	}
@@ -1790,14 +1790,14 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		/* These two are safe on a single CPU system as only user tasks fiddle here */
 		if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
 			amount = skb->len;
-		if (put_user(amount, (unsigned int *)arg))
+		if (put_user(amount, (unsigned int __user *)arg))
 			return -EFAULT;
 		return 0;
 	}
 
 	case SIOCGSTAMP:
 		if (sk != NULL)
-			return sock_get_timestamp(sk, (struct timeval *)arg);
+			return sock_get_timestamp(sk, (struct timeval __user *)arg);
 		return -EINVAL;
 
 	case SIOCGIFADDR:
@@ -1813,7 +1813,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		return -EINVAL;
 	default:
 		IRDA_DEBUG(1, "%s(), doing device ioctl!\n", __FUNCTION__);
-		return dev_ioctl(cmd, (void *) arg);
+		return dev_ioctl(cmd, (void __user *) arg);
 	}
 
 	/*NOTREACHED*/
@@ -1827,7 +1827,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
  *
  */
 static int irda_setsockopt(struct socket *sock, int level, int optname,
-			   char *optval, int optlen)
+			   char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self = irda_sk(sk);
@@ -1860,7 +1860,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
 			return -ENOMEM;
 
 		/* Copy query to the driver. */
-		if (copy_from_user(ias_opt, (char *)optval, optlen)) {
+		if (copy_from_user(ias_opt, optval, optlen)) {
 			kfree(ias_opt);
 			return -EFAULT;
 		}
@@ -1962,7 +1962,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
 			return -ENOMEM;
 
 		/* Copy query to the driver. */
-		if (copy_from_user(ias_opt, (char *)optval, optlen)) {
+		if (copy_from_user(ias_opt, optval, optlen)) {
 			kfree(ias_opt);
 			return -EFAULT;
 		}
@@ -2012,7 +2012,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
 		if (optlen < sizeof(int))
 			return -EINVAL;
 
-		if (get_user(opt, (int *)optval))
+		if (get_user(opt, (int __user *)optval))
 			return -EFAULT;
 
 		/* Only possible for a seqpacket service (TTP with SAR) */
@@ -2031,7 +2031,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
 			return -EINVAL;
 
 		/* The input is really a (__u8 hints[2]), easier as an int */
-		if (get_user(opt, (int *)optval))
+		if (get_user(opt, (int __user *)optval))
 			return -EFAULT;
 
 		/* Unregister any old registration */
@@ -2050,7 +2050,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
 			return -EINVAL;
 
 		/* The input is really a (__u8 hints[2]), easier as an int */
-		if (get_user(opt, (int *)optval))
+		if (get_user(opt, (int __user *)optval))
 			return -EFAULT;
 
 		/* Set the new hint mask */
@@ -2121,7 +2121,7 @@ static int irda_extract_ias_value(struct irda_ias_set *ias_opt,
  * Function irda_getsockopt (sock, level, optname, optval, optlen)
  */
 static int irda_getsockopt(struct socket *sock, int level, int optname,
-			   char *optval, int *optlen)
+			   char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	struct irda_sock *self = irda_sk(sk);
@@ -2211,7 +2211,7 @@ bed:
 			return -ENOMEM;
 
 		/* Copy query to the driver. */
-		if (copy_from_user((char *) ias_opt, (char *)optval, len)) {
+		if (copy_from_user(ias_opt, optval, len)) {
 			kfree(ias_opt);
 			return -EFAULT;
 		}
@@ -2245,7 +2245,7 @@ bed:
 		}
 
 		/* Copy reply to the user */
-		if (copy_to_user((char *)optval, (char *) ias_opt,
+		if (copy_to_user(optval, ias_opt,
 				 sizeof(struct irda_ias_set))) {
 			kfree(ias_opt);
 			return -EFAULT;
@@ -2267,7 +2267,7 @@ bed:
 			return -ENOMEM;
 
 		/* Copy query to the driver. */
-		if (copy_from_user((char *) ias_opt, (char *)optval, len)) {
+		if (copy_from_user(ias_opt, optval, len)) {
 			kfree(ias_opt);
 			return -EFAULT;
 		}
@@ -2351,7 +2351,7 @@ bed:
 		}
 
 		/* Copy reply to the user */
-		if (copy_to_user((char *)optval, (char *) ias_opt,
+		if (copy_to_user(optval, ias_opt,
 				 sizeof(struct irda_ias_set))) {
 			kfree(ias_opt);
 			return -EFAULT;
@@ -2378,7 +2378,7 @@ bed:
 		if (len != sizeof(int))
 			return -EINVAL;
 		/* Get timeout in ms (max time we block the caller) */
-		if (get_user(val, (int *)optval))
+		if (get_user(val, (int __user *)optval))
 			return -EFAULT;
 
 		/* Tell IrLMP we want to be notified */
@@ -2438,7 +2438,7 @@ bed:
 		 * If the user want more details, he should query
 		 * the whole discovery log and pick one device...
 		 */
-		if (put_user(daddr, (int *)optval))
+		if (put_user(daddr, (int __user *)optval))
 			return -EFAULT;
 
 		break;
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 6b9ae8cd9..f348c0caf 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -721,8 +721,10 @@ static int ircomm_tty_write(struct tty_struct *tty, int from_user,
 		kbuf = kmalloc(count, GFP_KERNEL);
 		if (kbuf == NULL)
 			return -ENOMEM;
-		if (copy_from_user(kbuf, ubuf, count))
+		if (copy_from_user(kbuf, ubuf, count)) {
+			kfree(kbuf);
 			return -EFAULT;
+		}
 	} else
 		/* The buffer is already in kernel space */
 		kbuf = (unsigned char *) ubuf;
@@ -779,6 +781,8 @@ static int ircomm_tty_write(struct tty_struct *tty, int from_user,
 					    self->max_header_size);
 			if (!skb) {
 				spin_unlock_irqrestore(&self->spinlock, flags);
+	                        if (from_user)
+		                        kfree(kbuf);
 				return -ENOBUFS;
 			}
 			skb_reserve(skb, self->max_header_size);
@@ -873,7 +877,7 @@ static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout)
 	orig_jiffies = jiffies;
 
 	/* Set poll time to 200 ms */
-	poll_time = IRDA_MIN(timeout, MSECS_TO_JIFFIES(200));
+	poll_time = IRDA_MIN(timeout, msecs_to_jiffies(200));
 
 	spin_lock_irqsave(&self->spinlock, flags);
 	while (self->tx_skb && self->tx_skb->len) {
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c
index cf5778686..40965158a 100644
--- a/net/irda/ircomm/ircomm_tty_ioctl.c
+++ b/net/irda/ircomm/ircomm_tty_ioctl.c
@@ -260,7 +260,7 @@ int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
  *
  */
 static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,
-				      struct serial_struct *retinfo)
+				      struct serial_struct __user *retinfo)
 {
 	struct serial_struct info;
    
@@ -297,7 +297,7 @@ static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,
  *
  */
 static int ircomm_tty_set_serial_info(struct ircomm_tty_cb *self,
-				      struct serial_struct *new_info)
+				      struct serial_struct __user *new_info)
 {
 #if 0
 	struct serial_struct new_serial;
@@ -388,10 +388,10 @@ int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file,
 
 	switch (cmd) {
 	case TIOCGSERIAL:
-		ret = ircomm_tty_get_serial_info(self, (struct serial_struct *) arg);
+		ret = ircomm_tty_get_serial_info(self, (struct serial_struct __user *) arg);
 		break;
 	case TIOCSSERIAL:
-		ret = ircomm_tty_set_serial_info(self, (struct serial_struct *) arg);
+		ret = ircomm_tty_set_serial_info(self, (struct serial_struct __user *) arg);
 		break;
 	case TIOCMIWAIT:
 		IRDA_DEBUG(0, "(), TIOCMIWAIT, not impl!\n");
@@ -403,7 +403,7 @@ int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file,
 		save_flags(flags); cli();
 		cnow = driver->icount;
 		restore_flags(flags);
-		p_cuser = (struct serial_icounter_struct *) arg;
+		p_cuser = (struct serial_icounter_struct __user *) arg;
 		if (put_user(cnow.cts, &p_cuser->cts) ||
 		    put_user(cnow.dsr, &p_cuser->dsr) ||
 		    put_user(cnow.rng, &p_cuser->rng) ||
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c
index 3871220e6..a58bb70d5 100644
--- a/net/irda/irlap_event.c
+++ b/net/irda/irlap_event.c
@@ -627,7 +627,7 @@ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event,
 		if (irda_device_is_receiving(self->netdev) && !self->add_wait) {
 			IRDA_DEBUG(2, "%s(), device is slow to answer, "
 				   "waiting some more!\n", __FUNCTION__);
-			irlap_start_slot_timer(self, MSECS_TO_JIFFIES(10));
+			irlap_start_slot_timer(self, msecs_to_jiffies(10));
 			self->add_wait = TRUE;
 			return ret;
 		}
@@ -849,7 +849,7 @@ static int irlap_state_setup(struct irlap_cb *self, IRLAP_EVENT event,
  *  1.5 times the time taken to transmit a SNRM frame. So this time should
  *  between 15 msecs and 45 msecs.
  */
-			irlap_start_backoff_timer(self, MSECS_TO_JIFFIES(20 +
+			irlap_start_backoff_timer(self, msecs_to_jiffies(20 +
 						        (jiffies % 30)));
 		} else {
 			/* Always switch state before calling upper layers */
@@ -1506,7 +1506,7 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event,
 		if (irda_device_is_receiving(self->netdev) && !self->add_wait) {
 			IRDA_DEBUG(1, "FINAL_TIMER_EXPIRED when receiving a "
 			      "frame! Waiting a little bit more!\n");
-			irlap_start_final_timer(self, MSECS_TO_JIFFIES(300));
+			irlap_start_final_timer(self, msecs_to_jiffies(300));
 
 			/*
 			 *  Don't allow this to happen one more time in a row,
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 0a9b1ca00..d16ce9bb8 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -804,7 +804,7 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
  * Note : separate from irlmp_do_discovery() so that we can handle
  * passive discovery properly.
  */
-void irlmp_do_expiry()
+void irlmp_do_expiry(void)
 {
 	struct lap_cb *lap;
 
@@ -1078,7 +1078,7 @@ void irlmp_discovery_expiry(discinfo_t *expiries, int number)
  *    Used by IrLAP to get the discovery info it needs when answering
  *    discovery requests by other devices.
  */
-discovery_t *irlmp_get_discovery_response()
+discovery_t *irlmp_get_discovery_response(void)
 {
 	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index 98afb0a20..b81d56cba 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -35,7 +35,7 @@
  */
 static inline ssize_t
 irnet_ctrl_write(irnet_socket *	ap,
-		 const char *	buf,
+		 const char __user *buf,
 		 size_t		count)
 {
   char		command[IRNET_MAX_COMMAND];
@@ -254,7 +254,7 @@ irnet_read_discovery_log(irnet_socket *	ap,
 static inline ssize_t
 irnet_ctrl_read(irnet_socket *	ap,
 		struct file *	file,
-		char *		buf,
+		char __user *	buf,
 		size_t		count)
 {
   DECLARE_WAITQUEUE(wait, current);
@@ -529,7 +529,7 @@ dev_irnet_close(struct inode *	inode,
  */
 static ssize_t
 dev_irnet_write(struct file *	file,
-		const char *	buf,
+		const char __user *buf,
 		size_t		count,
 		loff_t *	ppos)
 {
@@ -553,7 +553,7 @@ dev_irnet_write(struct file *	file,
  */
 static ssize_t
 dev_irnet_read(struct file *	file,
-	       char *		buf,
+	       char __user *	buf,
 	       size_t		count,
 	       loff_t *		ppos)
 {
@@ -610,6 +610,7 @@ dev_irnet_ioctl(struct inode *	inode,
   irnet_socket *	ap = (struct irnet_socket *) file->private_data;
   int			err;
   int			val;
+  void __user *argp = (void __user *)arg;
 
   DENTER(FS_TRACE, "(file=0x%p, ap=0x%p, cmd=0x%X)\n",
 	 file, ap, cmd);
@@ -626,7 +627,7 @@ dev_irnet_ioctl(struct inode *	inode,
     {
       /* Set discipline (should be N_SYNC_PPP or N_TTY) */
     case TIOCSETD:
-      if(get_user(val, (int *) arg))
+      if(get_user(val, (int __user *)argp))
 	break;
       if((val == N_SYNC_PPP) || (val == N_PPP))
 	{
@@ -665,7 +666,7 @@ dev_irnet_ioctl(struct inode *	inode,
     case PPPIOCGCHAN:
       if(!ap->ppp_open)
 	break;
-      if(put_user(ppp_channel_index(&ap->chan), (int *) arg))
+      if(put_user(ppp_channel_index(&ap->chan), (int __user *)argp))
 	break;
       DEBUG(FS_INFO, "Query channel.\n");
       err = 0;
@@ -673,7 +674,7 @@ dev_irnet_ioctl(struct inode *	inode,
     case PPPIOCGUNIT:
       if(!ap->ppp_open)
 	break;
-      if(put_user(ppp_unit_number(&ap->chan), (int *) arg))
+      if(put_user(ppp_unit_number(&ap->chan), (int __user *)argp))
 	break;
       DEBUG(FS_INFO, "Query unit number.\n");
       err = 0;
@@ -703,14 +704,14 @@ dev_irnet_ioctl(struct inode *	inode,
       /* Get termios */
     case TCGETS:
       DEBUG(FS_INFO, "Get termios.\n");
-      if(kernel_termios_to_user_termios((struct termios *)arg, &ap->termios))
+      if(kernel_termios_to_user_termios((struct termios __user *)argp, &ap->termios))
 	break;
       err = 0;
       break;
       /* Set termios */
     case TCSETSF:
       DEBUG(FS_INFO, "Set termios.\n");
-      if(user_termios_to_kernel_termios(&ap->termios, (struct termios *) arg))
+      if(user_termios_to_kernel_termios(&ap->termios, (struct termios __user *)argp))
 	break;
       err = 0;
       break;
@@ -743,7 +744,7 @@ dev_irnet_ioctl(struct inode *	inode,
     case FIONREAD:
       DEBUG(FS_INFO, "FIONREAD\n");
       val = 0;
-      if(put_user(val, (int *) arg))
+      if(put_user(val, (int __user *)argp))
 	break;
       err = 0;
       break;
@@ -950,6 +951,7 @@ ppp_irnet_ioctl(struct ppp_channel *	chan,
   int			err;
   int			val;
   u32			accm[8];
+  void __user *argp = (void __user *)arg;
 
   DENTER(PPP_TRACE, "(channel=0x%p, ap=0x%p, cmd=0x%X)\n",
 	 chan, ap, cmd);
@@ -963,12 +965,12 @@ ppp_irnet_ioctl(struct ppp_channel *	chan,
       /* PPP flags */
     case PPPIOCGFLAGS:
       val = ap->flags | ap->rbits;
-      if(put_user(val, (int *) arg))
+      if(put_user(val, (int __user *) argp))
 	break;
       err = 0;
       break;
     case PPPIOCSFLAGS:
-      if(get_user(val, (int *) arg))
+      if(get_user(val, (int __user *) argp))
 	break;
       ap->flags = val & ~SC_RCV_BITS;
       ap->rbits = val & SC_RCV_BITS;
@@ -977,32 +979,32 @@ ppp_irnet_ioctl(struct ppp_channel *	chan,
 
       /* Async map stuff - all dummy to please pppd */
     case PPPIOCGASYNCMAP:
-      if(put_user(ap->xaccm[0], (u32 *) arg))
+      if(put_user(ap->xaccm[0], (u32 __user *) argp))
 	break;
       err = 0;
       break;
     case PPPIOCSASYNCMAP:
-      if(get_user(ap->xaccm[0], (u32 *) arg))
+      if(get_user(ap->xaccm[0], (u32 __user *) argp))
 	break;
       err = 0;
       break;
     case PPPIOCGRASYNCMAP:
-      if(put_user(ap->raccm, (u32 *) arg))
+      if(put_user(ap->raccm, (u32 __user *) argp))
 	break;
       err = 0;
       break;
     case PPPIOCSRASYNCMAP:
-      if(get_user(ap->raccm, (u32 *) arg))
+      if(get_user(ap->raccm, (u32 __user *) argp))
 	break;
       err = 0;
       break;
     case PPPIOCGXASYNCMAP:
-      if(copy_to_user((void *) arg, ap->xaccm, sizeof(ap->xaccm)))
+      if(copy_to_user(argp, ap->xaccm, sizeof(ap->xaccm)))
 	break;
       err = 0;
       break;
     case PPPIOCSXASYNCMAP:
-      if(copy_from_user(accm, (void *) arg, sizeof(accm)))
+      if(copy_from_user(accm, argp, sizeof(accm)))
 	break;
       accm[2] &= ~0x40000000U;		/* can't escape 0x5e */
       accm[3] |= 0x60000000U;		/* must escape 0x7d, 0x7e */
@@ -1012,12 +1014,12 @@ ppp_irnet_ioctl(struct ppp_channel *	chan,
 
       /* Max PPP frame size */
     case PPPIOCGMRU:
-      if(put_user(ap->mru, (int *) arg))
+      if(put_user(ap->mru, (int __user *) argp))
 	break;
       err = 0;
       break;
     case PPPIOCSMRU:
-      if(get_user(val, (int *) arg))
+      if(get_user(val, (int __user *) argp))
 	break;
       if(val < PPP_MRU)
 	val = PPP_MRU;
@@ -1097,7 +1099,7 @@ void __exit
 irnet_cleanup(void)
 {
   irda_irnet_cleanup();
-  return ppp_irnet_cleanup();
+  ppp_irnet_cleanup();
 }
 
 /*------------------------------------------------------------------*/
diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
index 0c84c8272..8b4e06c55 100644
--- a/net/irda/irnet/irnet_ppp.h
+++ b/net/irda/irnet/irnet_ppp.h
@@ -66,11 +66,11 @@ static int
 			struct file *);
 static ssize_t
 	dev_irnet_write(struct file *,
-			const char *,
+			const char __user *,
 			size_t,
 			loff_t *),
 	dev_irnet_read(struct file *,
-		       char *,
+		       char __user *,
 		       size_t,
 		       loff_t *);
 static unsigned int
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index ae25dc3d6..995f4e15c 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -78,7 +78,7 @@ static int min_lap_keepalive_time = 100;	/* 100us */
  * us on that - Jean II */
 
 static int do_devname(ctl_table *table, int write, struct file *filp,
-		      void *buffer, size_t *lenp)
+		      void __user *buffer, size_t *lenp)
 {
 	int ret;
 
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 6f360a610..645b42564 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1059,7 +1059,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
 		struct sadb_address *addr = ext_hdrs[SADB_EXT_ADDRESS_PROXY-1];
 
 		/* Nobody uses this, but we try. */
-		pfkey_sadb_addr2xfrm_addr(addr, &x->sel.saddr);
+		x->sel.family = pfkey_sadb_addr2xfrm_addr(addr, &x->sel.saddr);
 		x->sel.prefixlen_s = addr->sadb_address_prefixlen;
 	}
 
@@ -1976,7 +1976,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
 	memset(&sel, 0, sizeof(sel));
 
 	sa = ext_hdrs[SADB_EXT_ADDRESS_SRC-1], 
-	pfkey_sadb_addr2xfrm_addr(sa, &sel.saddr);
+	sel.family = pfkey_sadb_addr2xfrm_addr(sa, &sel.saddr);
 	sel.prefixlen_s = sa->sadb_address_prefixlen;
 	sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto);
 	sel.sport = ((struct sockaddr_in *)(sa+1))->sin_port;
@@ -2726,7 +2726,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb,
 	int copied, err;
 
 	err = -EINVAL;
-	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC))
+	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
 		goto out;
 
 	msg->msg_namelen = 0;
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index cd5e993d9..d088fe8f6 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -867,7 +867,7 @@ out:
 static int llc_ui_ioctl(struct socket *sock, unsigned int cmd,
 			unsigned long arg)
 {
-	return dev_ioctl(cmd, (void *)arg);
+	return dev_ioctl(cmd, (void __user *)arg);
 }
 
 /**
@@ -881,7 +881,7 @@ static int llc_ui_ioctl(struct socket *sock, unsigned int cmd,
  *	Set various connection specific parameters.
  */
 static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
-			     char *optval, int optlen)
+			     char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	struct llc_opt *llc = llc_sk(sk);
@@ -890,7 +890,7 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
 	lock_sock(sk);
 	if (level != SOL_LLC || optlen != sizeof(int))
 		goto out;
-	rc = get_user(opt, (int *)optval);
+	rc = get_user(opt, (int __user *)optval);
 	if (rc)
 		goto out;
 	rc = -EINVAL;
@@ -956,7 +956,7 @@ out:
  *	Get connection specific socket information.
  */
 static int llc_ui_getsockopt(struct socket *sock, int level, int optname,
-			     char *optval, int *optlen)
+			     char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	struct llc_opt *llc = llc_sk(sk);
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 9a77db793..4c9011348 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -543,7 +543,7 @@ retry:
 	sk = netlink_getsockbypid(ssk, pid);
 	if (IS_ERR(sk)) {
 		kfree_skb(skb);
-		return PTR_ERR(skb);
+		return PTR_ERR(sk);
 	}
 	err = netlink_attachskb(sk, skb, nonblock, timeo);
 	if (err == 1)
diff --git a/net/netlink/netlink_dev.c b/net/netlink/netlink_dev.c
index bf5d86a27..72059f182 100644
--- a/net/netlink/netlink_dev.c
+++ b/net/netlink/netlink_dev.c
@@ -54,7 +54,7 @@ static unsigned int netlink_poll(struct file *file, poll_table * wait)
  *	Write a message to the kernel side of a communication link
  */
  
-static ssize_t netlink_write(struct file * file, const char * buf,
+static ssize_t netlink_write(struct file * file, const char __user * buf,
 			     size_t count, loff_t *pos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
@@ -62,7 +62,7 @@ static ssize_t netlink_write(struct file * file, const char * buf,
 	struct msghdr msg;
 	struct iovec iov;
 
-	iov.iov_base = (void*)buf;
+	iov.iov_base = (void __user*)buf;
 	iov.iov_len = count;
 	msg.msg_name=NULL;
 	msg.msg_namelen=0;
@@ -78,7 +78,7 @@ static ssize_t netlink_write(struct file * file, const char * buf,
  *	Read a message from the kernel side of the communication link
  */
 
-static ssize_t netlink_read(struct file * file, char * buf,
+static ssize_t netlink_read(struct file * file, char __user * buf,
 			    size_t count, loff_t *pos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index bb5ac58a6..fbb97bf37 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -297,7 +297,7 @@ void nr_destroy_socket(struct sock *sk)
  */
 
 static int nr_setsockopt(struct socket *sock, int level, int optname,
-	char *optval, int optlen)
+	char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	nr_cb *nr = nr_sk(sk);
@@ -309,7 +309,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname,
 	if (optlen < sizeof(int))
 		return -EINVAL;
 
-	if (get_user(opt, (int *)optval))
+	if (get_user(opt, (int __user *)optval))
 		return -EFAULT;
 
 	switch (optname) {
@@ -349,7 +349,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname,
 }
 
 static int nr_getsockopt(struct socket *sock, int level, int optname,
-	char *optval, int *optlen)
+	char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	nr_cb *nr = nr_sk(sk);
@@ -1021,7 +1021,7 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
 	unsigned char *asmptr;
 	int size;
 
-	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR))
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	lock_sock(sk);
@@ -1176,6 +1176,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
 static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
+	void __user *argp = (void __user *)arg;
 	int ret;
 
 	lock_sock(sk);
@@ -1186,7 +1187,7 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		if (amount < 0)
 			amount = 0;
 		release_sock(sk);
-		return put_user(amount, (int *)arg);
+		return put_user(amount, (int __user *)argp);
 	}
 
 	case TIOCINQ: {
@@ -1196,13 +1197,13 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
 			amount = skb->len;
 		release_sock(sk);
-		return put_user(amount, (int *)arg);
+		return put_user(amount, (int __user *)argp);
 	}
 
 	case SIOCGSTAMP:
 		ret = -EINVAL;
 		if (sk != NULL)
-			ret = sock_get_timestamp(sk, (struct timeval *)arg);
+			ret = sock_get_timestamp(sk, argp);
 		release_sock(sk);
 		return ret;
 
@@ -1224,11 +1225,11 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	case SIOCNRDECOBS:
 		release_sock(sk);
 		if (!capable(CAP_NET_ADMIN)) return -EPERM;
-		return nr_rt_ioctl(cmd, (void *)arg);
+		return nr_rt_ioctl(cmd, argp);
 
 	default:
 		release_sock(sk);
-		return dev_ioctl(cmd, (void *)arg);
+		return dev_ioctl(cmd, argp);
 	}
 	release_sock(sk);
 
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index 0505c00d6..dac2e36fc 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -647,7 +647,7 @@ static ax25_digi *nr_call_to_digi(int ndigis, ax25_address *digipeaters)
 /*
  *	Handle the ioctls that control the routing functions.
  */
-int nr_rt_ioctl(unsigned int cmd, void *arg)
+int nr_rt_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct nr_route_struct nr_route;
 	struct net_device *dev;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 7ebb64d52..93ac3b310 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1037,7 +1037,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
 	int copied, err;
 
 	err = -EINVAL;
-	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC))
+	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
 		goto out;
 
 #if 0
@@ -1292,7 +1292,7 @@ static void packet_flush_mclist(struct sock *sk)
 #endif
 
 static int
-packet_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
+packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	int ret;
@@ -1347,7 +1347,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, char *optval, int
 }
 
 int packet_getsockopt(struct socket *sock, int level, int optname,
-		      char *optval, int *optlen)
+		      char __user *optval, int __user *optlen)
 {
 	int len;
 	struct sock *sk = sock->sk;
@@ -1450,7 +1450,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
 		case SIOCOUTQ:
 		{
 			int amount = atomic_read(&sk->sk_wmem_alloc);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 		case SIOCINQ:
 		{
@@ -1462,10 +1462,10 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
 			if (skb)
 				amount = skb->len;
 			spin_unlock_bh(&sk->sk_receive_queue.lock);
-			return put_user(amount, (int *)arg);
+			return put_user(amount, (int __user *)arg);
 		}
 		case SIOCGSTAMP:
-			return sock_get_timestamp(sk, (struct timeval *)arg);
+			return sock_get_timestamp(sk, (struct timeval __user *)arg);
 			
 #ifdef CONFIG_INET
 		case SIOCADDRT:
@@ -1486,7 +1486,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
 #endif
 
 		default:
-			return dev_ioctl(cmd, (void *)arg);
+			return dev_ioctl(cmd, (void __user *)arg);
 	}
 	return 0;
 }
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index aa770bce7..a5555c328 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -368,7 +368,7 @@ void rose_destroy_socket(struct sock *sk)
  */
 
 static int rose_setsockopt(struct socket *sock, int level, int optname,
-	char *optval, int optlen)
+	char __user *optval, int optlen)
 {
 	struct sock *sk = sock->sk;
 	rose_cb *rose = rose_sk(sk);
@@ -380,7 +380,7 @@ static int rose_setsockopt(struct socket *sock, int level, int optname,
 	if (optlen < sizeof(int))
 		return -EINVAL;
 
-	if (get_user(opt, (int *)optval))
+	if (get_user(opt, (int __user *)optval))
 		return -EFAULT;
 
 	switch (optname) {
@@ -428,7 +428,7 @@ static int rose_setsockopt(struct socket *sock, int level, int optname,
 }
 
 static int rose_getsockopt(struct socket *sock, int level, int optname,
-	char *optval, int *optlen)
+	char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	rose_cb *rose = rose_sk(sk);
@@ -1021,7 +1021,7 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
 	unsigned char *asmptr;
 	int n, size, qbit = 0;
 
-	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR))
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
 		return -EINVAL;
 
 	if (sk->sk_zapped)
@@ -1249,6 +1249,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
 	rose_cb *rose = rose_sk(sk);
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case TIOCOUTQ: {
@@ -1256,7 +1257,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
 		if (amount < 0)
 			amount = 0;
-		return put_user(amount, (unsigned int *)arg);
+		return put_user(amount, (unsigned int __user *)argp);
 	}
 
 	case TIOCINQ: {
@@ -1265,12 +1266,12 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		/* These two are safe on a single CPU system as only user tasks fiddle here */
 		if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
 			amount = skb->len;
-		return put_user(amount, (unsigned int *)arg);
+		return put_user(amount, (unsigned int __user *)argp);
 	}
 
 	case SIOCGSTAMP:
 		if (sk != NULL) 
-			return sock_get_timestamp(sk, (struct timeval *)arg);
+			return sock_get_timestamp(sk, (struct timeval __user *)argp);
 		return -EINVAL;
 
 	case SIOCGIFADDR:
@@ -1290,18 +1291,18 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	case SIOCRSCLRRT:
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
-		return rose_rt_ioctl(cmd, (void *)arg);
+		return rose_rt_ioctl(cmd, argp);
 
 	case SIOCRSGCAUSE: {
 		struct rose_cause_struct rose_cause;
 		rose_cause.cause      = rose->cause;
 		rose_cause.diagnostic = rose->diagnostic;
-		return copy_to_user((void *)arg, &rose_cause, sizeof(struct rose_cause_struct)) ? -EFAULT : 0;
+		return copy_to_user(argp, &rose_cause, sizeof(struct rose_cause_struct)) ? -EFAULT : 0;
 	}
 
 	case SIOCRSSCAUSE: {
 		struct rose_cause_struct rose_cause;
-		if (copy_from_user(&rose_cause, (void *)arg, sizeof(struct rose_cause_struct)))
+		if (copy_from_user(&rose_cause, argp, sizeof(struct rose_cause_struct)))
 			return -EFAULT;
 		rose->cause      = rose_cause.cause;
 		rose->diagnostic = rose_cause.diagnostic;
@@ -1312,14 +1313,14 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		if (!capable(CAP_NET_ADMIN)) return -EPERM;
 		if (ax25cmp(&rose_callsign, &null_ax25_address) != 0)
 			ax25_listen_release(&rose_callsign, NULL);
-		if (copy_from_user(&rose_callsign, (void *)arg, sizeof(ax25_address)))
+		if (copy_from_user(&rose_callsign, argp, sizeof(ax25_address)))
 			return -EFAULT;
 		if (ax25cmp(&rose_callsign, &null_ax25_address) != 0)
 			ax25_listen_register(&rose_callsign, NULL);
 		return 0;
 
 	case SIOCRSGL2CALL:
-		return copy_to_user((void *)arg, &rose_callsign, sizeof(ax25_address)) ? -EFAULT : 0;
+		return copy_to_user(argp, &rose_callsign, sizeof(ax25_address)) ? -EFAULT : 0;
 
 	case SIOCRSACCEPT:
 		if (rose->state == ROSE_STATE_5) {
@@ -1335,7 +1336,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		return 0;
 
 	default:
-		return dev_ioctl(cmd, (void *)arg);
+		return dev_ioctl(cmd, argp);
 	}
 
 	return 0;
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 47664dc7a..0cd8810f2 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -710,7 +710,7 @@ out:
 /*
  *	Handle the ioctls that control the routing functions.
  */
-int rose_rt_ioctl(unsigned int cmd, void *arg)
+int rose_rt_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct rose_route_struct rose_route;
 	struct net_device *dev;
diff --git a/net/sched/sch_delay.c b/net/sched/sch_delay.c
index 9c8a3ce62..c1a4210aa 100644
--- a/net/sched/sch_delay.c
+++ b/net/sched/sch_delay.c
@@ -165,6 +165,7 @@ static int change_limit(struct Qdisc *q, u32 limit)
 		return -ENOMEM;
 
 	rta->rta_type = RTM_NEWQDISC;
+	rta->rta_len = RTA_LENGTH(sizeof(struct tc_fifo_qopt));
 	((struct tc_fifo_qopt *)RTA_DATA(rta))->limit = limit;
 	ret = q->ops->change(q, rta);
 	kfree(rta);
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 7eadd1910..785498056 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -495,6 +495,11 @@ static void tbf_walk(struct Qdisc *sch, struct qdisc_walker *walker)
 	}
 }
 
+static struct tcf_proto **tbf_find_tcf(struct Qdisc *sch, unsigned long cl)
+{
+	return NULL;
+}
+
 static struct Qdisc_class_ops tbf_class_ops =
 {
 	.graft		=	tbf_graft,
@@ -504,6 +509,7 @@ static struct Qdisc_class_ops tbf_class_ops =
 	.change		=	tbf_change_class,
 	.delete		=	tbf_delete,
 	.walk		=	tbf_walk,
+	.tcf_chain	=	tbf_find_tcf,
 	.dump		=	tbf_dump_class,
 };
 
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index a4a86a23e..1a2ac8b4a 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -142,9 +142,9 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc,
 	 * socket values.
 	 */
 	asoc->max_retrans = sp->assocparams.sasoc_asocmaxrxt;
-	asoc->rto_initial = MSECS_TO_JIFFIES(sp->rtoinfo.srto_initial);
-	asoc->rto_max = MSECS_TO_JIFFIES(sp->rtoinfo.srto_max);
-	asoc->rto_min = MSECS_TO_JIFFIES(sp->rtoinfo.srto_min);
+	asoc->rto_initial = msecs_to_jiffies(sp->rtoinfo.srto_initial);
+	asoc->rto_max = msecs_to_jiffies(sp->rtoinfo.srto_max);
+	asoc->rto_min = msecs_to_jiffies(sp->rtoinfo.srto_min);
 
 	asoc->overall_error_count = 0;
 
@@ -170,7 +170,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc,
 	asoc->max_init_attempts	= sp->initmsg.sinit_max_attempts;
 
 	asoc->max_init_timeo =
-		 MSECS_TO_JIFFIES(sp->initmsg.sinit_max_init_timeo);
+		 msecs_to_jiffies(sp->initmsg.sinit_max_init_timeo);
 
 	/* Allocate storage for the ssnmap after the inbound and outbound
 	 * streams have been negotiated during Init.
@@ -271,7 +271,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc,
 
 	asoc->need_ecne = 0;
 
-	asoc->assoc_id = (sctp_assoc_t)-1;
+	asoc->assoc_id = (sctp_assoc_t)-1L;
 
 	/* Assume that peer would support both address types unless we are
 	 * told otherwise.
@@ -374,9 +374,9 @@ static void sctp_association_destroy(struct sctp_association *asoc)
 	sctp_endpoint_put(asoc->ep);
 	sock_put(asoc->base.sk);
 
-	if ((int)asoc->assoc_id != -1) {
+	if ((long)asoc->assoc_id != -1L) {
 		spin_lock_bh(&sctp_assocs_id_lock);
-		idr_remove(&sctp_assocs_id, (int)asoc->assoc_id);
+		idr_remove(&sctp_assocs_id, (long)asoc->assoc_id);
 		spin_unlock_bh(&sctp_assocs_id_lock);
 	}
 
@@ -507,7 +507,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
 	/* Initialize the peer's heartbeat interval based on the
 	 * sock configured value.
 	 */
-	peer->hb_interval = MSECS_TO_JIFFIES(sp->paddrparam.spp_hbinterval);
+	peer->hb_interval = msecs_to_jiffies(sp->paddrparam.spp_hbinterval);
 
 	/* Set the path max_retrans.  */
 	peer->max_retrans = asoc->max_retrans;
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index c044cd40f..67f3afdf0 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -186,7 +186,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
 	if (sinfo->sinfo_timetolive) {
 		/* sinfo_timetolive is in milliseconds */
 		msg->expires_at = jiffies +
-				    MSECS_TO_JIFFIES(sinfo->sinfo_timetolive);
+				    msecs_to_jiffies(sinfo->sinfo_timetolive);
 		msg->can_abandon = 1;
 		SCTP_DEBUG_PRINTK("%s: msg:%p expires_at: %ld jiffies:%ld\n",
 				  __FUNCTION__, msg, msg->expires_at, jiffies);
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index e706368b6..5f9a99c64 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -129,7 +129,7 @@ struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
 	ep->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT] =
 		SCTP_DEFAULT_TIMEOUT_T1_INIT;
 	ep->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] =
-		MSECS_TO_JIFFIES(sp->rtoinfo.srto_initial);
+		msecs_to_jiffies(sp->rtoinfo.srto_initial);
 	ep->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX] = 0;
 	ep->timeouts[SCTP_EVENT_TIMEOUT_T4_RTO] = 0;
 
@@ -138,7 +138,7 @@ struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
 	 * recommended value of 5 times 'RTO.Max'.
 	 */
         ep->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD]
-		= 5 * MSECS_TO_JIFFIES(sp->rtoinfo.srto_max);
+		= 5 * msecs_to_jiffies(sp->rtoinfo.srto_max);
 
 	ep->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] =
 		SCTP_DEFAULT_TIMEOUT_HEARTBEAT;
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 6d45e05c1..d54f915ae 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -496,7 +496,7 @@ out:
 	return err;
 no_route:
 	kfree_skb(nskb);
-	IP_INC_STATS_BH(IpOutNoRoutes);
+	IP_INC_STATS_BH(OutNoRoutes);
 
 	/* FIXME: Returning the 'err' will effect all the associations
 	 * associated with a socket, although only one of the paths of the
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 79f072a40..83cee2acd 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -429,6 +429,9 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
 		sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP,
 				SCTP_ULPEVENT(event));
 
+	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
+			SCTP_STATE(SCTP_STATE_CLOSED));
+
 	/* SEND_FAILED sent later when cleaning up the association. */
 	asoc->outqueue.error = error;
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
@@ -457,6 +460,10 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
+	/* Set sk_err to ECONNRESET on a 1-1 style socket. */
+	if (!sctp_style(asoc->base.sk, UDP))
+		asoc->base.sk->sk_err = ECONNRESET; 
+
 	/* SEND_FAILED sent later when cleaning up the association. */
 	asoc->outqueue.error = error;
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
@@ -1272,6 +1279,9 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
 		case SCTP_CMD_PROCESS_OPERR:
 			sctp_cmd_process_operr(commands, asoc, chunk);
 			break;
+		case SCTP_CMD_CLEAR_INIT_TAG:
+			asoc->peer.i.init_tag = 0;
+			break;
 		default:
 			printk(KERN_WARNING "Impossible command: %u, %p\n",
 			       cmd->verb, cmd->obj.ptr);
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 3804123f3..30849b0e1 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -171,7 +171,7 @@ nomem:
  *    Verification Tag field to Tag_A, and also provide its own
  *    Verification Tag (Tag_Z) in the Initiate Tag field.
  *
- * Verification Tag: No checking.
+ * Verification Tag: Must be 0. 
  *
  * Inputs
  * (endpoint, asoc, chunk)
@@ -219,6 +219,12 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
 	     (sk->sk_ack_backlog >= sk->sk_max_ack_backlog)))
 		return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
 
+	/* 3.1 A packet containing an INIT chunk MUST have a zero Verification
+	 * Tag. 
+	 */
+	if (chunk->sctp_hdr->vtag != 0)
+		return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
+
 	/* Verify the INIT chunk before processing it. */
 	err_chunk = NULL;
 	if (!sctp_verify_init(asoc, chunk->chunk_hdr->type,
@@ -377,6 +383,9 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 	if (!chunk->singleton)
 		return SCTP_DISPOSITION_VIOLATION;
 
+	if (!sctp_vtag_verify(chunk, asoc))
+		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+
 	/* Grab the INIT header.  */
 	chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data;
 
@@ -659,8 +668,12 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep,
 				      const sctp_subtype_t type, void *arg,
 				      sctp_cmd_seq_t *commands)
 {
+	struct sctp_chunk *chunk = arg;
 	struct sctp_ulpevent *ev;
 
+	if (!sctp_vtag_verify(chunk, asoc))
+		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+
 	/* RFC 2960 5.1 Normal Establishment of an Association
 	 *
 	 * E) Upon reception of the COOKIE ACK, endpoint "A" will move
@@ -807,13 +820,7 @@ sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
 	struct sctp_chunk *reply;
 	size_t paylen = 0;
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag. If the received
-	 * Verification Tag value does not match the receiver's own
-	 * tag value, the receiver shall silently discard the packet...
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	/* 8.3 The receiver of the HEARTBEAT should immediately
@@ -876,11 +883,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
 	sctp_sender_hb_info_t *hbinfo;
 	unsigned long max_interval;
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag. ...
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data;
@@ -1130,6 +1133,12 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
 	if (!chunk->singleton)
 		return SCTP_DISPOSITION_VIOLATION;
 
+	/* 3.1 A packet containing an INIT chunk MUST have a zero Verification
+	 * Tag. 
+	 */
+	if (chunk->sctp_hdr->vtag != 0)
+		return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
+
 	/* Grab the INIT header.  */
 	chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data;
 
@@ -1386,6 +1395,8 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep,
 	sctp_init_chunk_t *peer_init;
 	struct sctp_ulpevent *ev;
 	struct sctp_chunk *repl;
+	struct sctp_chunk *err;
+	sctp_disposition_t disposition;
 
 	/* new_asoc is a brand-new association, so these are not yet
 	 * side effects--it is safe to run them here.
@@ -1405,6 +1416,29 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep,
 		return SCTP_DISPOSITION_CONSUME;
 	}
 
+	/* If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes
+	 * the peer has restarted (Action A), it MUST NOT setup a new
+	 * association but instead resend the SHUTDOWN ACK and send an ERROR
+	 * chunk with a "Cookie Received while Shutting Down" error cause to
+	 * its peer.
+	*/
+	if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) {
+		disposition = sctp_sf_do_9_2_reshutack(ep, asoc,
+				SCTP_ST_CHUNK(chunk->chunk_hdr->type),
+				chunk, commands);
+		if (SCTP_DISPOSITION_NOMEM == disposition)
+			goto nomem;
+
+		err = sctp_make_op_error(asoc, chunk,
+					 SCTP_ERROR_COOKIE_IN_SHUTDOWN,
+					 NULL, 0);
+		if (err)
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(err));
+
+		return SCTP_DISPOSITION_CONSUME;
+	}
+
 	/* For now, fail any unsent/unacked data.  Consider the optional
 	 * choice of resending of this data.
 	 */
@@ -1883,6 +1917,9 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
 
 	sctp_addto_chunk(reply, sizeof(bht), &bht);
 
+	/* Clear peer's init_tag cached in assoc as we are sending a new INIT */
+	sctp_add_cmd_sf(commands, SCTP_CMD_CLEAR_INIT_TAG, SCTP_NULL());
+
 	/* Cast away the const modifier, as we want to just
 	 * rerun it through as a sideffect.
 	 */
@@ -2071,13 +2108,7 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep,
 	skb_pull(chunk->skb, sizeof(sctp_shutdownhdr_t));
 	chunk->subh.shutdown_hdr = sdh;
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag. If the received
-	 * Verification Tag value does not match the receiver's own
-	 * tag value, the receiver shall silently discard the packet...
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	/* Upon the reception of the SHUTDOWN, the peer endpoint shall
@@ -2190,13 +2221,7 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
 	sctp_cwrhdr_t *cwr;
 	struct sctp_chunk *chunk = arg;
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag. If the received
-	 * Verification Tag value does not match the receiver's own
-	 * tag value, the receiver shall silently discard the packet...
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	cwr = (sctp_cwrhdr_t *) chunk->skb->data;
@@ -2246,13 +2271,7 @@ sctp_disposition_t sctp_sf_do_ecne(const struct sctp_endpoint *ep,
 	sctp_ecnehdr_t *ecne;
 	struct sctp_chunk *chunk = arg;
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag. If the received
-	 * Verification Tag value does not match the receiver's own
-	 * tag value, the receiver shall silently discard the packet...
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	ecne = (sctp_ecnehdr_t *) chunk->skb->data;
@@ -2309,13 +2328,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
 	int tmp;
 	__u32 tsn;
 
-	/* RFC 2960 8.5 Verification Tag
-	 *
-	 * When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag.
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) {
+	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
 				SCTP_NULL());
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -2569,13 +2582,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep,
 	int tmp;
 	__u32 tsn;
 
-	/* RFC 2960 8.5 Verification Tag
-	 *
-	 * When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag.
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) {
+	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
 				SCTP_NULL());
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -2745,11 +2752,7 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep,
 	sctp_sackhdr_t *sackh;
 	__u32 ctsn;
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag. ...
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	/* Pull the SACK chunk from the data buffer */
@@ -2895,6 +2898,9 @@ sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep,
 	struct sctp_chunk *reply;
 	struct sctp_ulpevent *ev;
 
+	if (!sctp_vtag_verify(chunk, asoc))
+		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+
 	/* 10.2 H) SHUTDOWN COMPLETE notification
 	 *
 	 * When SCTP completes the shutdown procedures (section 9.2) this
@@ -3229,13 +3235,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,
 	__u16 len;
 	__u32 tsn;
 
-	/* RFC 2960 8.5 Verification Tag
-	 *
-	 * When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag.
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) {
+	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
 				SCTP_NULL());
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -3293,13 +3293,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
 	__u16 len;
 	__u32 tsn;
 
-	/* RFC 2960 8.5 Verification Tag
-	 *
-	 * When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag.
-	 */
-	if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) {
+	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
 				SCTP_NULL());
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -3376,13 +3370,7 @@ sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep,
 
 	SCTP_DEBUG_PRINTK("Processing the unknown chunk id %d.\n", type.chunk);
 
-	/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
-	 * that the value in the Verification Tag field of the
-	 * received SCTP packet matches its own Tag.  If the received
-	 * Verification Tag value does not match the receiver's own
-	 * tag value, the receiver shall silently discard the packet.
-	 */
-	if (ntohl(unk_chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
+	if (!sctp_vtag_verify(unk_chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
 	switch (type.chunk & SCTP_CID_ACTION_MASK) {
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 5219c3ba4..491b510b0 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -765,7 +765,8 @@ out:
  *
  * Returns 0 if ok, <0 errno code on error.
  */
-SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, struct sockaddr *addrs,
+SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
+				      struct sockaddr __user *addrs,
 				      int addrs_size, int op)
 {
 	struct sockaddr *kaddrs;
@@ -1163,6 +1164,11 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
 	if (!asoc) {
 		SCTP_DEBUG_PRINTK("There is no association yet.\n");
 
+		if (sinfo_flags & (MSG_EOF | MSG_ABORT)) {
+			err = -EINVAL;
+			goto out_unlock;
+		}
+
 		/* Check for invalid stream against the stream counts,
 		 * either the default or the user specified stream counts.
 		 */
@@ -1224,7 +1230,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
 			}
 			if (sinit->sinit_max_init_timeo) {
 				asoc->max_init_timeo = 
-				 MSECS_TO_JIFFIES(sinit->sinit_max_init_timeo);
+				 msecs_to_jiffies(sinit->sinit_max_init_timeo);
 			}
 		}
 
@@ -1538,14 +1544,14 @@ out:
  * instead a error will be indicated to the user.
  */
 static int sctp_setsockopt_disable_fragments(struct sock *sk,
-						    char *optval, int optlen)
+					    char __user *optval, int optlen)
 {
 	int val;
 
 	if (optlen < sizeof(int))
 		return -EINVAL;
 
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 
 	sctp_sk(sk)->disable_fragments = (val == 0) ? 0 : 1;
@@ -1553,7 +1559,7 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
 	return 0;
 }
 
-static int sctp_setsockopt_events(struct sock *sk, char *optval,
+static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
 					int optlen)
 {
 	if (optlen != sizeof(struct sctp_event_subscribe))
@@ -1574,7 +1580,7 @@ static int sctp_setsockopt_events(struct sock *sk, char *optval,
  * integer defining the number of seconds of idle time before an
  * association is closed.
  */
-static int sctp_setsockopt_autoclose(struct sock *sk, char *optval,
+static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
 					    int optlen)
 {
 	struct sctp_opt *sp = sctp_sk(sk);
@@ -1623,7 +1629,7 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char *optval,
  *                     considered unreachable.
  */
 static int sctp_setsockopt_peer_addr_params(struct sock *sk,
-					    char *optval, int optlen)
+					    char __user *optval, int optlen)
 {
 	struct sctp_paddrparams params;
 	struct sctp_transport *trans;
@@ -1662,7 +1668,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
 		if (params.spp_hbinterval) {
 			trans->hb_allowed = 1;
 			trans->hb_interval = 
-				MSECS_TO_JIFFIES(params.spp_hbinterval);
+				msecs_to_jiffies(params.spp_hbinterval);
 		} else
 			trans->hb_allowed = 0;
 	}
@@ -1686,7 +1692,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
  * by the change).  With TCP-style sockets, this option is inherited by
  * sockets derived from a listener socket.
  */
-static int sctp_setsockopt_initmsg(struct sock *sk, char *optval, int optlen)
+static int sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, int optlen)
 {
 	struct sctp_initmsg sinit;
 	struct sctp_opt *sp = sctp_sk(sk);
@@ -1723,7 +1729,7 @@ static int sctp_setsockopt_initmsg(struct sock *sk, char *optval, int optlen)
  *   to this call if the caller is using the UDP model.
  */
 static int sctp_setsockopt_default_send_param(struct sock *sk,
-						char *optval, int optlen)
+						char __user *optval, int optlen)
 {
 	struct sctp_sndrcvinfo info;
 	struct sctp_association *asoc;
@@ -1761,7 +1767,7 @@ static int sctp_setsockopt_default_send_param(struct sock *sk,
  * the association primary.  The enclosed address must be one of the
  * association peer's addresses.
  */
-static int sctp_setsockopt_primary_addr(struct sock *sk, char *optval,
+static int sctp_setsockopt_primary_addr(struct sock *sk, char __user *optval,
 					int optlen)
 {
 	struct sctp_prim prim;
@@ -1790,14 +1796,14 @@ static int sctp_setsockopt_primary_addr(struct sock *sk, char *optval,
  * introduced, at the cost of more packets in the network.  Expects an
  *  integer boolean flag.
  */
-static int sctp_setsockopt_nodelay(struct sock *sk, char *optval,
+static int sctp_setsockopt_nodelay(struct sock *sk, char __user *optval,
 					int optlen)
 {
 	int val;
 
 	if (optlen < sizeof(int))
 		return -EINVAL;
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 
 	sctp_sk(sk)->nodelay = (val == 0) ? 0 : 1;
@@ -1816,7 +1822,7 @@ static int sctp_setsockopt_nodelay(struct sock *sk, char *optval,
  * be changed.
  *
  */
-static int sctp_setsockopt_rtoinfo(struct sock *sk, char *optval, int optlen) {
+static int sctp_setsockopt_rtoinfo(struct sock *sk, char __user *optval, int optlen) {
 	struct sctp_rtoinfo rtoinfo;
 	struct sctp_association *asoc;
 
@@ -1835,11 +1841,11 @@ static int sctp_setsockopt_rtoinfo(struct sock *sk, char *optval, int optlen) {
 	if (asoc) {
 		if (rtoinfo.srto_initial != 0)
 			asoc->rto_initial = 
-				MSECS_TO_JIFFIES(rtoinfo.srto_initial);
+				msecs_to_jiffies(rtoinfo.srto_initial);
 		if (rtoinfo.srto_max != 0)
-			asoc->rto_max = MSECS_TO_JIFFIES(rtoinfo.srto_max);
+			asoc->rto_max = msecs_to_jiffies(rtoinfo.srto_max);
 		if (rtoinfo.srto_min != 0)
-			asoc->rto_min = MSECS_TO_JIFFIES(rtoinfo.srto_min);
+			asoc->rto_min = msecs_to_jiffies(rtoinfo.srto_min);
 	} else {
 		/* If there is no association or the association-id = 0
 		 * set the values to the endpoint.
@@ -1868,7 +1874,7 @@ static int sctp_setsockopt_rtoinfo(struct sock *sk, char *optval, int optlen) {
  * See [SCTP] for more information.
  *
  */
-static int sctp_setsockopt_associnfo(struct sock *sk, char *optval, int optlen)
+static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int optlen)
 {
 
 	struct sctp_assocparams assocparams;
@@ -1919,14 +1925,14 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char *optval, int optlen)
  * addresses and a user will receive both PF_INET6 and PF_INET type
  * addresses on the socket.
  */
-static int sctp_setsockopt_mappedv4(struct sock *sk, char *optval, int optlen)
+static int sctp_setsockopt_mappedv4(struct sock *sk, char __user *optval, int optlen)
 {
 	int val;
 	struct sctp_opt *sp = sctp_sk(sk);
 
 	if (optlen < sizeof(int))
 		return -EINVAL;
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 	if (val)
 		sp->v4mapped = 1;
@@ -1946,7 +1952,7 @@ static int sctp_setsockopt_mappedv4(struct sock *sk, char *optval, int optlen)
  * PMTU of the underlying association is smaller than the value set by
  * the user.
  */
-static int sctp_setsockopt_maxseg(struct sock *sk, char *optval, int optlen)
+static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optlen)
 {
 	struct sctp_association *asoc;
 	struct list_head *pos;
@@ -1955,7 +1961,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char *optval, int optlen)
 
 	if (optlen < sizeof(int))
 		return -EINVAL;
-	if (get_user(val, (int *)optval))
+	if (get_user(val, (int __user *)optval))
 		return -EFAULT;
 	if ((val < 8) || (val > SCTP_MAX_CHUNK_LEN))
 		return -EINVAL;
@@ -1981,7 +1987,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char *optval, int optlen)
  *   locally bound addresses. The following structure is used to make a
  *   set primary request:
  */
-static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char *optval,
+static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optval,
 					     int optlen)
 {
 	struct sctp_opt		*sp;
@@ -2041,9 +2047,9 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char *optval,
  *
  * The syntax is:
  *
- *   ret = getsockopt(int sd, int level, int optname, void *optval,
- *                    int *optlen);
- *   ret = setsockopt(int sd, int level, int optname, const void *optval,
+ *   ret = getsockopt(int sd, int level, int optname, void __user *optval,
+ *                    int __user *optlen);
+ *   ret = setsockopt(int sd, int level, int optname, const void __user *optval,
  *                    int optlen);
  *
  *   sd      - the socket descript.
@@ -2053,7 +2059,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char *optval,
  *   optlen  - the size of the buffer.
  */
 SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
-				char *optval, int optlen)
+				char __user *optval, int optlen)
 {
 	int retval = 0;
 
@@ -2077,13 +2083,13 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
 	switch (optname) {
 	case SCTP_SOCKOPT_BINDX_ADD:
 		/* 'optlen' is the size of the addresses buffer. */
-		retval = sctp_setsockopt_bindx(sk, (struct sockaddr *)optval,
+		retval = sctp_setsockopt_bindx(sk, (struct sockaddr __user *)optval,
 					       optlen, SCTP_BINDX_ADD_ADDR);
 		break;
 
 	case SCTP_SOCKOPT_BINDX_REM:
 		/* 'optlen' is the size of the addresses buffer. */
-		retval = sctp_setsockopt_bindx(sk, (struct sockaddr *)optval,
+		retval = sctp_setsockopt_bindx(sk, (struct sockaddr __user *)optval,
 					       optlen, SCTP_BINDX_REM_ADDR);
 		break;
 
@@ -2379,14 +2385,14 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
 	sp->initmsg.sinit_num_ostreams   = sctp_max_outstreams;
 	sp->initmsg.sinit_max_instreams  = sctp_max_instreams;
 	sp->initmsg.sinit_max_attempts   = sctp_max_retrans_init;
-	sp->initmsg.sinit_max_init_timeo = JIFFIES_TO_MSECS(sctp_rto_max);
+	sp->initmsg.sinit_max_init_timeo = jiffies_to_msecs(sctp_rto_max);
 
 	/* Initialize default RTO related parameters.  These parameters can
 	 * be modified for with the SCTP_RTOINFO socket option.
 	 */
-	sp->rtoinfo.srto_initial = JIFFIES_TO_MSECS(sctp_rto_initial);
-	sp->rtoinfo.srto_max     = JIFFIES_TO_MSECS(sctp_rto_max);
-	sp->rtoinfo.srto_min     = JIFFIES_TO_MSECS(sctp_rto_min);
+	sp->rtoinfo.srto_initial = jiffies_to_msecs(sctp_rto_initial);
+	sp->rtoinfo.srto_max     = jiffies_to_msecs(sctp_rto_max);
+	sp->rtoinfo.srto_min     = jiffies_to_msecs(sctp_rto_min);
 
 	/* Initialize default association related parameters. These parameters
 	 * can be modified with the SCTP_ASSOCINFO socket option.
@@ -2396,7 +2402,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
 	sp->assocparams.sasoc_peer_rwnd = 0;
 	sp->assocparams.sasoc_local_rwnd = 0;
 	sp->assocparams.sasoc_cookie_life = 
-		JIFFIES_TO_MSECS(sctp_valid_cookie_life);
+		jiffies_to_msecs(sctp_valid_cookie_life);
 
 	/* Initialize default event subscriptions. By default, all the
 	 * options are off. 
@@ -2406,7 +2412,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
 	/* Default Peer Address Parameters.  These defaults can
 	 * be modified via SCTP_PEER_ADDR_PARAMS
 	 */
-	sp->paddrparam.spp_hbinterval = JIFFIES_TO_MSECS(sctp_hb_interval);
+	sp->paddrparam.spp_hbinterval = jiffies_to_msecs(sctp_hb_interval);
 	sp->paddrparam.spp_pathmaxrxt = sctp_max_retrans_path;
 
 	/* If enabled no SCTP message fragmentation will be performed.
@@ -2506,8 +2512,9 @@ SCTP_STATIC void sctp_shutdown(struct sock *sk, int how)
  * number of unacked data chunks, and number of data chunks pending
  * receipt.  This information is read-only.
  */
-static int sctp_getsockopt_sctp_status(struct sock *sk, int len, char *optval,
-				       int *optlen)
+static int sctp_getsockopt_sctp_status(struct sock *sk, int len,
+				       char __user *optval,
+				       int __user *optlen)
 {
 	struct sctp_status status;
 	struct sctp_association *asoc = NULL;
@@ -2552,7 +2559,7 @@ static int sctp_getsockopt_sctp_status(struct sock *sk, int len, char *optval,
 	status.sstat_primary.spinfo_state = transport->active;
 	status.sstat_primary.spinfo_cwnd = transport->cwnd;
 	status.sstat_primary.spinfo_srtt = transport->srtt;
-	status.sstat_primary.spinfo_rto = JIFFIES_TO_MSECS(transport->rto);
+	status.sstat_primary.spinfo_rto = jiffies_to_msecs(transport->rto);
 	status.sstat_primary.spinfo_mtu = transport->pmtu;
 
 	if (put_user(len, optlen)) {
@@ -2582,7 +2589,8 @@ out:
  * read-only.
  */
 static int sctp_getsockopt_peer_addr_info(struct sock *sk, int len,
-					  char *optval, int *optlen)
+					  char __user *optval,
+					  int __user *optlen)
 {
 	struct sctp_paddrinfo pinfo;
 	struct sctp_transport *transport;
@@ -2607,7 +2615,7 @@ static int sctp_getsockopt_peer_addr_info(struct sock *sk, int len,
 	pinfo.spinfo_state = transport->active;
 	pinfo.spinfo_cwnd = transport->cwnd;
 	pinfo.spinfo_srtt = transport->srtt;
-	pinfo.spinfo_rto = JIFFIES_TO_MSECS(transport->rto);
+	pinfo.spinfo_rto = jiffies_to_msecs(transport->rto);
 	pinfo.spinfo_mtu = transport->pmtu;
 
 	if (put_user(len, optlen)) {
@@ -2632,7 +2640,7 @@ out:
  * instead a error will be indicated to the user.
  */
 static int sctp_getsockopt_disable_fragments(struct sock *sk, int len,
-						    char *optval, int *optlen)
+					char __user *optval, int __user *optlen)
 {
 	int val;
 
@@ -2653,8 +2661,8 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len,
  * This socket option is used to specify various notifications and
  * ancillary data the user wishes to receive.
  */
-static int sctp_getsockopt_events(struct sock *sk, int len, char *optval,
-				  int *optlen)
+static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval,
+				  int __user *optlen)
 {
 	if (len != sizeof(struct sctp_event_subscribe))
 		return -EINVAL;
@@ -2674,7 +2682,7 @@ static int sctp_getsockopt_events(struct sock *sk, int len, char *optval,
  * integer defining the number of seconds of idle time before an
  * association is closed.
  */
-static int sctp_getsockopt_autoclose(struct sock *sk, int len, char *optval, int *optlen)
+static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optval, int __user *optlen)
 {
 	/* Applicable to UDP-style socket only */
 	if (sctp_style(sk, TCP))
@@ -2714,7 +2722,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc,
 	return err;
 }
 
-static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int *optlen)
+static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval, int __user *optlen)
 {
 	sctp_peeloff_arg_t peeloff;
 	struct socket *newsock;
@@ -2789,14 +2797,14 @@ out:
  *                     considered unreachable.
  */
 static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
-						char *optval, int *optlen)
+						char __user *optval, int __user *optlen)
 {
 	struct sctp_paddrparams params;
 	struct sctp_transport *trans;
 
 	if (len != sizeof(struct sctp_paddrparams))
 		return -EINVAL;
-	if (copy_from_user(&params, optval, *optlen))
+	if (copy_from_user(&params, optval, len))
 		return -EFAULT;
 
 	trans = sctp_addr_id2transport(sk, &params.spp_address,
@@ -2811,7 +2819,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
 	if (!trans->hb_allowed)
 		params.spp_hbinterval = 0;
 	else
-		params.spp_hbinterval = JIFFIES_TO_MSECS(trans->hb_interval);
+		params.spp_hbinterval = jiffies_to_msecs(trans->hb_interval);
 
 	/* spp_pathmaxrxt contains the maximum number of retransmissions
 	 * before this address shall be considered unreachable.
@@ -2838,7 +2846,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
  * by the change).  With TCP-style sockets, this option is inherited by
  * sockets derived from a listener socket.
  */
-static int sctp_getsockopt_initmsg(struct sock *sk, int len, char *optval, int *optlen)
+static int sctp_getsockopt_initmsg(struct sock *sk, int len, char __user *optval, int __user *optlen)
 {
 	if (len != sizeof(struct sctp_initmsg))
 		return -EINVAL;
@@ -2848,7 +2856,7 @@ static int sctp_getsockopt_initmsg(struct sock *sk, int len, char *optval, int *
 }
 
 static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len,
-					  char *optval, int *optlen)
+					  char __user *optval, int __user *optlen)
 {
 	sctp_assoc_t id;
 	struct sctp_association *asoc;
@@ -2874,14 +2882,14 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len,
 }
 
 static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
-				      char *optval, int *optlen)
+				      char __user *optval, int __user *optlen)
 {
 	struct sctp_association *asoc;
 	struct list_head *pos;
 	int cnt = 0;
 	struct sctp_getaddrs getaddrs;
 	struct sctp_transport *from;
-	void *to;
+	void __user *to;
 	union sctp_addr temp;
 	struct sctp_opt *sp = sctp_sk(sk);
 	int addrlen;
@@ -2899,7 +2907,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
 	if (!asoc)
 		return -EINVAL;
 
-	to = (void *)getaddrs.addrs;
+	to = (void __user *)getaddrs.addrs;
 	list_for_each(pos, &asoc->peer.transport_addr_list) {
 		from = list_entry(pos, struct sctp_transport, transports);
 		memcpy(&temp, &from->ipaddr, sizeof(temp));
@@ -2920,7 +2928,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
 }
 
 static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
-						char *optval, int *optlen)
+						char __user *optval,
+						int __user *optlen)
 {
 	sctp_assoc_t id;
 	struct sctp_bind_addr *bp;
@@ -2957,7 +2966,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
 }
 
 static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
-					char *optval, int *optlen)
+					char __user *optval, int __user *optlen)
 {
 	struct sctp_bind_addr *bp;
 	struct sctp_association *asoc;
@@ -2965,7 +2974,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
 	int cnt = 0;
 	struct sctp_getaddrs getaddrs;
 	struct sctp_sockaddr_entry *from;
-	void *to;
+	void __user *to;
 	union sctp_addr temp;
 	struct sctp_opt *sp = sctp_sk(sk);
 	int addrlen;
@@ -2992,7 +3001,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
 		bp = &asoc->base.bind_addr;
 	}
 
-	to = (void *)getaddrs.addrs;
+	to = getaddrs.addrs;
 	list_for_each(pos, &bp->address_list) {
 		from = list_entry(pos,
 				struct sctp_sockaddr_entry,
@@ -3021,7 +3030,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
  * association peer's addresses.
  */
 static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
-					char *optval, int *optlen)
+					char __user *optval, int __user *optlen)
 {
 	struct sctp_prim prim;
 	struct sctp_association *asoc;
@@ -3076,7 +3085,8 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
  *   For getsockopt, it get the default sctp_sndrcvinfo structure.
  */
 static int sctp_getsockopt_default_send_param(struct sock *sk,
-					int len, char *optval, int *optlen)
+					int len, char __user *optval,
+					int __user *optlen)
 {
 	struct sctp_sndrcvinfo info;
 	struct sctp_association *asoc;
@@ -3122,7 +3132,7 @@ static int sctp_getsockopt_default_send_param(struct sock *sk,
  */
 
 static int sctp_getsockopt_nodelay(struct sock *sk, int len,
-				   char *optval, int *optlen)
+				   char __user *optval, int __user *optlen)
 {
 	int val;
 
@@ -3150,8 +3160,9 @@ static int sctp_getsockopt_nodelay(struct sock *sk, int len,
  * be changed.
  *
  */
-static int sctp_getsockopt_rtoinfo(struct sock *sk, int len, char *optval,
-				int *optlen) {
+static int sctp_getsockopt_rtoinfo(struct sock *sk, int len,
+				char __user *optval,
+				int __user *optlen) {
 	struct sctp_rtoinfo rtoinfo;
 	struct sctp_association *asoc;
 
@@ -3168,9 +3179,9 @@ static int sctp_getsockopt_rtoinfo(struct sock *sk, int len, char *optval,
 
 	/* Values corresponding to the specific association. */
 	if (asoc) {
-		rtoinfo.srto_initial = JIFFIES_TO_MSECS(asoc->rto_initial);
-		rtoinfo.srto_max = JIFFIES_TO_MSECS(asoc->rto_max);
-		rtoinfo.srto_min = JIFFIES_TO_MSECS(asoc->rto_min);
+		rtoinfo.srto_initial = jiffies_to_msecs(asoc->rto_initial);
+		rtoinfo.srto_max = jiffies_to_msecs(asoc->rto_max);
+		rtoinfo.srto_min = jiffies_to_msecs(asoc->rto_min);
 	} else {
 		/* Values corresponding to the endpoint. */
 		struct sctp_opt *sp = sctp_sk(sk);
@@ -3200,8 +3211,9 @@ static int sctp_getsockopt_rtoinfo(struct sock *sk, int len, char *optval,
  * See [SCTP] for more information.
  *
  */
-static int sctp_getsockopt_associnfo(struct sock *sk, int len, char *optval,
-				     int *optlen)
+static int sctp_getsockopt_associnfo(struct sock *sk, int len,
+				     char __user *optval,
+				     int __user *optlen)
 {
 
 	struct sctp_assocparams assocparams;
@@ -3270,7 +3282,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, char *optval,
  * addresses on the socket.
  */
 static int sctp_getsockopt_mappedv4(struct sock *sk, int len,
-				    char *optval, int *optlen)
+				    char __user *optval, int __user *optlen)
 {
 	int val;
 	struct sctp_opt *sp = sctp_sk(sk);
@@ -3299,7 +3311,7 @@ static int sctp_getsockopt_mappedv4(struct sock *sk, int len,
  * the user.
  */
 static int sctp_getsockopt_maxseg(struct sock *sk, int len,
-				  char *optval, int *optlen)
+				  char __user *optval, int __user *optlen)
 {
 	int val;
 
@@ -3318,7 +3330,7 @@ static int sctp_getsockopt_maxseg(struct sock *sk, int len,
 }
 
 SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,
-				char *optval, int *optlen)
+				char __user *optval, int __user *optlen)
 {
 	int retval = 0;
 	int len;
@@ -4381,7 +4393,11 @@ out:
 	return err;
 
 do_error:
-	err = -ECONNREFUSED;
+	if (asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1 >=
+					 	asoc->max_init_attempts)
+		err = -ETIMEDOUT;
+	else
+		err = -ECONNREFUSED;
 	goto out;
 
 do_interrupted:
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 16f84b1e5..89fa20c73 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -232,7 +232,7 @@ static int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
 				return -EINVAL;
 		}
 		if (put_user((*(int *)(table->data) * 1000) / HZ,
-			(int *)oldval) ||
+			(int __user *)oldval) ||
 		    (oldlenp && put_user(sizeof (int), oldlenp)))
 			return -EFAULT;
 	}
@@ -242,7 +242,7 @@ static int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
 		if (newlen != sizeof (int))
 			return -EINVAL;
 
-		if (get_user(new, (int *)newval))
+		if (get_user(new, (int __user *)newval))
 			return -EFAULT;
 
 		*(int *)(table->data) = (new * HZ) / 1000;
diff --git a/net/socket.c b/net/socket.c
index bee094985..1aa2ce2a3 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -87,6 +87,8 @@
 #endif	/* CONFIG_NET_RADIO */
 
 #include <asm/uaccess.h>
+#include <asm/unistd.h>
+
 #include <net/compat.h>
 
 #include <net/sock.h>
@@ -308,9 +310,9 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 static int init_inodecache(void)
 {
 	sock_inode_cachep = kmem_cache_create("sock_inode_cache",
-					     sizeof(struct socket_alloc),
-					     0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
-					     init_once, NULL);
+				sizeof(struct socket_alloc),
+				0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
+				init_once, NULL);
 	if (sock_inode_cachep == NULL)
 		return -ENOMEM;
 	return 0;
@@ -727,9 +729,9 @@ static ssize_t sock_writev(struct file *file, const struct iovec *vector,
  */
 
 static DECLARE_MUTEX(br_ioctl_mutex);
-static int (*br_ioctl_hook)(unsigned long arg) = NULL;
+static int (*br_ioctl_hook)(unsigned int cmd, void __user *arg) = NULL;
 
-void brioctl_set(int (*hook)(unsigned long))
+void brioctl_set(int (*hook)(unsigned int, void __user *))
 {
 	down(&br_ioctl_mutex);
 	br_ioctl_hook = hook;
@@ -738,9 +740,9 @@ void brioctl_set(int (*hook)(unsigned long))
 EXPORT_SYMBOL(brioctl_set);
 
 static DECLARE_MUTEX(vlan_ioctl_mutex);
-static int (*vlan_ioctl_hook)(unsigned long arg);
+static int (*vlan_ioctl_hook)(void __user *arg);
 
-void vlan_ioctl_set(int (*hook)(unsigned long))
+void vlan_ioctl_set(int (*hook)(void __user *))
 {
 	down(&vlan_ioctl_mutex);
 	vlan_ioctl_hook = hook;
@@ -749,9 +751,9 @@ void vlan_ioctl_set(int (*hook)(unsigned long))
 EXPORT_SYMBOL(vlan_ioctl_set);
 
 static DECLARE_MUTEX(dlci_ioctl_mutex);
-static int (*dlci_ioctl_hook)(unsigned int, void *);
+static int (*dlci_ioctl_hook)(unsigned int, void __user *);
 
-void dlci_ioctl_set(int (*hook)(unsigned int, void *))
+void dlci_ioctl_set(int (*hook)(unsigned int, void __user *))
 {
 	down(&dlci_ioctl_mutex);
 	dlci_ioctl_hook = hook;
@@ -768,39 +770,42 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		      unsigned long arg)
 {
 	struct socket *sock;
+	void __user *argp = (void __user *)arg;
 	int pid, err;
 
 	unlock_kernel();
 	sock = SOCKET_I(inode);
 	if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
-		err = dev_ioctl(cmd, (void *)arg);
+		err = dev_ioctl(cmd, argp);
 	} else
 #ifdef WIRELESS_EXT
 	if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
-		err = dev_ioctl(cmd, (void *)arg);
+		err = dev_ioctl(cmd, argp);
 	} else
 #endif	/* WIRELESS_EXT */
 	switch (cmd) {
 		case FIOSETOWN:
 		case SIOCSPGRP:
 			err = -EFAULT;
-			if (get_user(pid, (int *)arg))
+			if (get_user(pid, (int __user *)argp))
 				break;
 			err = f_setown(sock->file, pid, 1);
 			break;
 		case FIOGETOWN:
 		case SIOCGPGRP:
-			err = put_user(sock->file->f_owner.pid, (int *)arg);
+			err = put_user(sock->file->f_owner.pid, (int __user *)argp);
 			break;
 		case SIOCGIFBR:
 		case SIOCSIFBR:
+		case SIOCBRADDBR:
+		case SIOCBRDELBR:
 			err = -ENOPKG;
 			if (!br_ioctl_hook)
 				request_module("bridge");
 
 			down(&br_ioctl_mutex);
 			if (br_ioctl_hook) 
-				err = br_ioctl_hook(arg);
+				err = br_ioctl_hook(cmd, argp);
 			up(&br_ioctl_mutex);
 			break;
 		case SIOCGIFVLAN:
@@ -811,13 +816,13 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 			down(&vlan_ioctl_mutex);
 			if (vlan_ioctl_hook)
-				err = vlan_ioctl_hook(arg);
+				err = vlan_ioctl_hook(argp);
 			up(&vlan_ioctl_mutex);
 			break;
 		case SIOCGIFDIVERT:
 		case SIOCSIFDIVERT:
 		/* Convert this to call through a hook */
-			err = divert_ioctl(cmd, (struct divert_cf *)arg);
+			err = divert_ioctl(cmd, argp);
 			break;
 		case SIOCADDDLCI:
 		case SIOCDELDLCI:
@@ -827,7 +832,7 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 			if (dlci_ioctl_hook) {
 				down(&dlci_ioctl_mutex);
-				err = dlci_ioctl_hook(cmd, (void *)arg);
+				err = dlci_ioctl_hook(cmd, argp);
 				up(&dlci_ioctl_mutex);
 			}
 			break;
@@ -1817,6 +1822,8 @@ out:
 	return err;
 }
 
+#ifdef __ARCH_WANT_SYS_SOCKETCALL
+
 /* Argument list sizes for sys_socketcall */
 #define AL(x) ((x) * sizeof(unsigned long))
 static unsigned char nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
@@ -1910,6 +1917,8 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args)
 	return err;
 }
 
+#endif /* __ARCH_WANT_SYS_SOCKETCALL */
+
 /*
  *	This function is called by a protocol handler that wants to
  *	advertise its address family, and have it linked into the
diff --git a/net/sunrpc/auth_gss/Makefile b/net/sunrpc/auth_gss/Makefile
index 94e972a33..9495e5278 100644
--- a/net/sunrpc/auth_gss/Makefile
+++ b/net/sunrpc/auth_gss/Makefile
@@ -4,11 +4,11 @@
 
 obj-$(CONFIG_SUNRPC_GSS) += auth_rpcgss.o
 
-auth_rpcgss-objs := auth_gss.o gss_pseudoflavors.o gss_generic_token.o \
-	sunrpcgss_syms.o gss_mech_switch.o svcauth_gss.o
+auth_rpcgss-objs := auth_gss.o gss_generic_token.o \
+	gss_mech_switch.o svcauth_gss.o gss_krb5_crypto.o
 
 obj-$(CONFIG_RPCSEC_GSS_KRB5) += rpcsec_gss_krb5.o
 
 rpcsec_gss_krb5-objs := gss_krb5_mech.o gss_krb5_seal.o gss_krb5_unseal.o \
-	gss_krb5_crypto.o gss_krb5_seqnum.o
+	gss_krb5_seqnum.o
 
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 971124109..60bca99bf 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -132,6 +132,8 @@ print_hexl(u32 *p, u_int length, u_int offset)
 	}
 }
 
+EXPORT_SYMBOL(print_hexl);
+
 static inline struct gss_cl_ctx *
 gss_get_ctx(struct gss_cl_ctx *ctx)
 {
@@ -280,7 +282,7 @@ err_free_ctx:
 	kfree(ctx);
 err:
 	*gc = NULL;
-	dprintk("RPC: gss_parse_init_downcall returning %d\n", err);
+	dprintk("RPC:      gss_parse_init_downcall returning %d\n", err);
 	return err;
 }
 
@@ -311,8 +313,10 @@ __gss_find_upcall(struct gss_auth *gss_auth, uid_t uid)
 		if (pos->uid != uid)
 			continue;
 		atomic_inc(&pos->count);
+		dprintk("RPC:      gss_find_upcall found msg %p\n", pos);
 		return pos;
 	}
+	dprintk("RPC:      gss_find_upcall found nothing\n");
 	return NULL;
 }
 
@@ -350,6 +354,8 @@ gss_upcall(struct rpc_clnt *clnt, struct rpc_task *task, struct rpc_cred *cred)
 	uid_t uid = cred->cr_uid;
 	int res = 0;
 
+	dprintk("RPC: %4u gss_upcall for uid %u\n", task->tk_pid, uid);
+
 retry:
 	spin_lock(&gss_auth->lock);
 	gss_msg = __gss_find_upcall(gss_auth, uid);
@@ -358,8 +364,10 @@ retry:
 	if (gss_new == NULL) {
 		spin_unlock(&gss_auth->lock);
 		gss_new = kmalloc(sizeof(*gss_new), GFP_KERNEL);
-		if (!gss_new)
+		if (!gss_new) {
+			dprintk("RPC: %4u gss_upcall -ENOMEM\n", task->tk_pid);
 			return -ENOMEM;
+		}
 		goto retry;
 	}
 	gss_msg = gss_new;
@@ -389,12 +397,14 @@ retry:
 		spin_unlock(&gss_auth->lock);
 	}
 	gss_release_msg(gss_msg);
+	dprintk("RPC: %4u gss_upcall for uid %u result %d", task->tk_pid,
+			uid, res);
 	return res;
 out_sleep:
-	/* Sleep forever */
 	task->tk_timeout = 0;
 	rpc_sleep_on(&gss_msg->waitq, task, NULL, NULL);
 	spin_unlock(&gss_auth->lock);
+	dprintk("RPC: %4u gss_upcall  sleeping\n", task->tk_pid);
 	if (gss_new)
 		kfree(gss_new);
 	/* Note: we drop the reference here: we are automatically removed
@@ -426,13 +436,13 @@ gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
 	return mlen;
 }
 
+#define MSG_BUF_MAXSIZE 1024
+
 static ssize_t
 gss_pipe_downcall(struct file *filp, const char *src, size_t mlen)
 {
-	char buf[1024];
 	struct xdr_netobj obj = {
 		.len	= mlen,
-		.data	= buf,
 	};
 	struct inode *inode = filp->f_dentry->d_inode;
 	struct rpc_inode *rpci = RPC_I(inode);
@@ -448,11 +458,16 @@ gss_pipe_downcall(struct file *filp, const char *src, size_t mlen)
 	int err;
 	int gss_err;
 
-	if (mlen > sizeof(buf))
-		return -ENOSPC;
-	left = copy_from_user(buf, src, mlen);
-	if (left)
-		return -EFAULT;
+	if (mlen > MSG_BUF_MAXSIZE)
+		return -EFBIG;
+	obj.data = kmalloc(mlen, GFP_KERNEL);
+	if (!obj.data)
+		return -ENOMEM;
+	left = copy_from_user(obj.data, src, mlen);
+	if (left) {
+		err = -EFAULT;
+		goto out;
+	}
 	clnt = rpci->private;
 	atomic_inc(&clnt->cl_users);
 	auth = clnt->cl_auth;
@@ -477,12 +492,16 @@ gss_pipe_downcall(struct file *filp, const char *src, size_t mlen)
 	} else
 		spin_unlock(&gss_auth->lock);
 	rpc_release_client(clnt);
+	kfree(obj.data);
+	dprintk("RPC:      gss_pipe_downcall returning length %Zu\n", mlen);
 	return mlen;
 err:
 	if (ctx)
 		gss_destroy_ctx(ctx);
 	rpc_release_client(clnt);
-	dprintk("RPC: gss_pipe_downcall returning %d\n", err);
+out:
+	kfree(obj.data);
+	dprintk("RPC:      gss_pipe_downcall returning %d\n", err);
 	return err;
 }
 
@@ -520,6 +539,8 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
 	static unsigned long ratelimit;
 
 	if (msg->errno < 0) {
+		dprintk("RPC:      gss_pipe_destroy_msg releasing msg %p\n",
+				gss_msg);
 		atomic_inc(&gss_msg->count);
 		gss_unhash_msg(gss_msg);
 		if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) {
@@ -544,10 +565,11 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
 	struct gss_auth *gss_auth;
 	struct rpc_auth * auth;
 
-	dprintk("RPC: creating GSS authenticator for client %p\n",clnt);
+	dprintk("RPC:      creating GSS authenticator for client %p\n",clnt);
+
 	if (!(gss_auth = kmalloc(sizeof(*gss_auth), GFP_KERNEL)))
 		goto out_dec;
-	gss_auth->mech = gss_pseudoflavor_to_mech(flavor);
+	gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor);
 	if (!gss_auth->mech) {
 		printk(KERN_WARNING "%s: Pseudoflavor %d not found!",
 				__FUNCTION__, flavor);
@@ -566,7 +588,7 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
 
 	snprintf(gss_auth->path, sizeof(gss_auth->path), "%s/%s",
 			clnt->cl_pathname,
-			gss_auth->mech->gm_ops->name);
+			gss_auth->mech->gm_name);
 	gss_auth->dentry = rpc_mkpipe(gss_auth->path, clnt, &gss_upcall_ops, RPC_PIPE_WAIT_FOR_OPEN);
 	if (IS_ERR(gss_auth->dentry))
 		goto err_free;
@@ -582,7 +604,8 @@ static void
 gss_destroy(struct rpc_auth *auth)
 {
 	struct gss_auth *gss_auth;
-	dprintk("RPC: destroying GSS authenticator %p flavor %d\n",
+
+	dprintk("RPC:      destroying GSS authenticator %p flavor %d\n",
 		auth, auth->au_flavor);
 
 	gss_auth = container_of(auth, struct gss_auth, rpc_auth);
@@ -597,8 +620,7 @@ gss_destroy(struct rpc_auth *auth)
 static void
 gss_destroy_ctx(struct gss_cl_ctx *ctx)
 {
-
-	dprintk("RPC: gss_destroy_ctx\n");
+	dprintk("RPC:      gss_destroy_ctx\n");
 
 	if (ctx->gc_gss_ctx)
 		gss_delete_sec_context(&ctx->gc_gss_ctx);
@@ -617,7 +639,7 @@ gss_destroy_cred(struct rpc_cred *rc)
 {
 	struct gss_cred *cred = (struct gss_cred *)rc;
 
-	dprintk("RPC: gss_destroy_cred \n");
+	dprintk("RPC:      gss_destroy_cred \n");
 
 	if (cred->gc_ctx)
 		gss_put_ctx(cred->gc_ctx);
@@ -629,7 +651,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags)
 {
 	struct gss_cred	*cred = NULL;
 
-	dprintk("RPC: gss_create_cred for uid %d, flavor %d\n",
+	dprintk("RPC:      gss_create_cred for uid %d, flavor %d\n",
 		acred->uid, auth->au_flavor);
 
 	if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL)))
@@ -649,7 +671,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags)
 	return (struct rpc_cred *) cred;
 
 out_err:
-	dprintk("RPC: gss_create_cred failed\n");
+	dprintk("RPC:      gss_create_cred failed\n");
 	if (cred) gss_destroy_cred((struct rpc_cred *)cred);
 	return NULL;
 }
@@ -679,15 +701,16 @@ gss_marshal(struct rpc_task *task, u32 *p, int ruid)
 	struct xdr_buf	verf_buf;
 	u32		service;
 
-	dprintk("RPC: gss_marshal\n");
+	dprintk("RPC: %4u gss_marshal\n", task->tk_pid);
 
 	*p++ = htonl(RPC_AUTH_GSS);
 	cred_len = p++;
 
-	service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+	service = gss_pseudoflavor_to_service(ctx->gc_gss_ctx->mech_type,
+						gss_cred->gc_flavor);
 	if (service == 0) {
-		dprintk("Bad pseudoflavor %d in gss_marshal\n",
-			gss_cred->gc_flavor);
+		dprintk("RPC: %4u Bad pseudoflavor %d in gss_marshal\n",
+			task->tk_pid, gss_cred->gc_flavor);
 		goto out_put_ctx;
 	}
 	spin_lock(&ctx->gc_seq_lock);
@@ -736,10 +759,8 @@ static int
 gss_refresh(struct rpc_task *task)
 {
 	struct rpc_clnt *clnt = task->tk_client;
-	struct rpc_xprt *xprt = task->tk_xprt;
 	struct rpc_cred *cred = task->tk_msg.rpc_cred;
 
-	task->tk_timeout = xprt->timeout.to_current;
 	if (!gss_cred_is_uptodate_ctx(cred))
 		return gss_upcall(clnt, task, cred);
 	return 0;
@@ -759,7 +780,7 @@ gss_validate(struct rpc_task *task, u32 *p)
 	u32		flav,len;
 	u32		service;
 
-	dprintk("RPC: gss_validate\n");
+	dprintk("RPC: %4u gss_validate\n", task->tk_pid);
 
 	flav = ntohl(*p++);
 	if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE)
@@ -775,7 +796,8 @@ gss_validate(struct rpc_task *task, u32 *p)
 
 	if (gss_verify_mic(ctx->gc_gss_ctx, &verf_buf, &mic, &qop_state))
                goto out_bad;
-       service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+       service = gss_pseudoflavor_to_service(ctx->gc_gss_ctx->mech_type,
+					gss_cred->gc_flavor);
        switch (service) {
        case RPC_GSS_SVC_NONE:
 	       /* verifier data, flavor, length: */
@@ -789,33 +811,75 @@ gss_validate(struct rpc_task *task, u32 *p)
 	       goto out_bad;
        }
 	gss_put_ctx(ctx);
+	dprintk("RPC: %4u GSS gss_validate: gss_verify_mic succeeded.\n",
+			task->tk_pid);
 	return p + XDR_QUADLEN(len);
 out_bad:
 	gss_put_ctx(ctx);
+	dprintk("RPC: %4u gss_validate failed.\n", task->tk_pid);
 	return NULL;
 }
 
+static inline int
+gss_wrap_req_integ(struct gss_cl_ctx *ctx,
+			kxdrproc_t encode, void *rqstp, u32 *p, void *obj)
+{
+	struct rpc_rqst	*req = (struct rpc_rqst *)rqstp;
+	struct xdr_buf	*snd_buf = &req->rq_snd_buf;
+	struct xdr_buf	integ_buf;
+	u32             *integ_len = NULL;
+	struct xdr_netobj mic;
+	u32		offset, *q;
+	struct iovec	*iov;
+	u32             maj_stat = 0;
+	int		status = -EIO;
+
+	integ_len = p++;
+	offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base;
+	*p++ = htonl(req->rq_seqno);
+
+	status = encode(rqstp, p, obj);
+	if (status)
+		return status;
+
+	if (xdr_buf_subsegment(snd_buf, &integ_buf,
+				offset, snd_buf->len - offset))
+		return status;
+	*integ_len = htonl(integ_buf.len);
+
+	/* guess whether we're in the head or the tail: */
+	if (snd_buf->page_len || snd_buf->tail[0].iov_len) 
+		iov = snd_buf->tail;
+	else
+		iov = snd_buf->head;
+	p = iov->iov_base + iov->iov_len;
+	mic.data = (u8 *)(p + 1);
+
+	maj_stat = gss_get_mic(ctx->gc_gss_ctx,
+			GSS_C_QOP_DEFAULT, &integ_buf, &mic);
+	status = -EIO; /* XXX? */
+	if (maj_stat)
+		return status;
+	q = xdr_encode_opaque(p, NULL, mic.len);
+
+	offset = (u8 *)q - (u8 *)p;
+	iov->iov_len += offset;
+	snd_buf->len += offset;
+	return 0;
+}
+
 static int
 gss_wrap_req(struct rpc_task *task,
 	     kxdrproc_t encode, void *rqstp, u32 *p, void *obj)
 {
-	struct rpc_rqst	*req = (struct rpc_rqst *)rqstp;
-	struct xdr_buf	*snd_buf = &req->rq_snd_buf;
 	struct rpc_cred *cred = task->tk_msg.rpc_cred;
 	struct gss_cred	*gss_cred = container_of(cred, struct gss_cred,
 			gc_base);
 	struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
-	u32             *integ_len = NULL;
 	int             status = -EIO;
-	u32             maj_stat = 0;
-	struct xdr_buf	integ_buf;
-	struct xdr_netobj mic;
 	u32		service;
-	u32		offset, *q;
-	struct iovec	*iov;
 
-	dprintk("RPC: gss_wrap_body\n");
-	BUG_ON(!ctx);
+	dprintk("RPC: %4u gss_wrap_req\n", task->tk_pid);
 	if (ctx->gc_proc != RPC_GSS_PROC_DATA) {
 		/* The spec seems a little ambiguous here, but I think that not
 		 * wrapping context destruction requests makes the most sense.
@@ -823,103 +887,84 @@ gss_wrap_req(struct rpc_task *task,
 		status = encode(rqstp, p, obj);
 		goto out;
 	}
-	service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+	service = gss_pseudoflavor_to_service(ctx->gc_gss_ctx->mech_type,
+						gss_cred->gc_flavor);
 	switch (service) {
 		case RPC_GSS_SVC_NONE:
 			status = encode(rqstp, p, obj);
 			goto out;
 		case RPC_GSS_SVC_INTEGRITY:
-
-			integ_len = p++;
-			offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base;
-			*p++ = htonl(req->rq_seqno);
-
-			status = encode(rqstp, p, obj);
-			if (status)
-				goto out;
-
-			if (xdr_buf_subsegment(snd_buf, &integ_buf,
-						offset, snd_buf->len - offset))
-				goto out;
-			*integ_len = htonl(integ_buf.len);
-
-			/* guess whether we're in the head or the tail: */
-			if (snd_buf->page_len || snd_buf->tail[0].iov_len) 
-				iov = snd_buf->tail;
-			else
-				iov = snd_buf->head;
-			p = iov->iov_base + iov->iov_len;
-			mic.data = (u8 *)(p + 1);
-
-			maj_stat = gss_get_mic(ctx->gc_gss_ctx,
-					GSS_C_QOP_DEFAULT, &integ_buf, &mic);
-			status = -EIO; /* XXX? */
-			if (maj_stat)
-				goto out;
-			q = xdr_encode_opaque(p, NULL, mic.len);
-
-			offset = (u8 *)q - (u8 *)p;
-			iov->iov_len += offset;
-			snd_buf->len += offset;
-			break;
+			status = gss_wrap_req_integ(ctx, encode, rqstp, p, obj);
+			goto out;
 		case RPC_GSS_SVC_PRIVACY:
 		default:
 			goto out;
 	}
-	status = 0;
 out:
 	gss_put_ctx(ctx);
-	dprintk("RPC: gss_wrap_req returning %d\n", status);
+	dprintk("RPC: %4u gss_wrap_req returning %d\n", task->tk_pid, status);
 	return status;
 }
 
+static inline int
+gss_unwrap_resp_integ(struct gss_cl_ctx *ctx,
+		kxdrproc_t decode, void *rqstp, u32 **p, void *obj)
+{
+	struct rpc_rqst *req = (struct rpc_rqst *)rqstp;
+	struct xdr_buf	*rcv_buf = &req->rq_rcv_buf;
+	struct xdr_buf integ_buf;
+	struct xdr_netobj mic;
+	u32 data_offset, mic_offset;
+	u32 integ_len;
+	u32 maj_stat;
+	int status = -EIO;
+
+	integ_len = ntohl(*(*p)++);
+	if (integ_len & 3)
+		return status;
+	data_offset = (u8 *)(*p) - (u8 *)rcv_buf->head[0].iov_base;
+	mic_offset = integ_len + data_offset;
+	if (mic_offset > rcv_buf->len)
+		return status;
+	if (ntohl(*(*p)++) != req->rq_seqno)
+		return status;
+
+	if (xdr_buf_subsegment(rcv_buf, &integ_buf, data_offset,
+				mic_offset - data_offset))
+		return status;
+
+	if (xdr_buf_read_netobj(rcv_buf, &mic, mic_offset))
+		return status;
+
+	maj_stat = gss_verify_mic(ctx->gc_gss_ctx, &integ_buf,
+			&mic, NULL);
+	if (maj_stat != GSS_S_COMPLETE)
+		return status;
+	return 0;
+}
+
 static int
 gss_unwrap_resp(struct rpc_task *task,
 		kxdrproc_t decode, void *rqstp, u32 *p, void *obj)
 {
-	struct rpc_rqst *req = (struct rpc_rqst *)rqstp;
-	struct xdr_buf	*rcv_buf = &req->rq_rcv_buf;
 	struct rpc_cred *cred = task->tk_msg.rpc_cred;
 	struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
 			gc_base);
 	struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
-	struct xdr_buf	integ_buf;
-	struct xdr_netobj mic;
 	int             status = -EIO;
-	u32		maj_stat = 0;
 	u32		service;
-	u32		data_offset, mic_offset;
-	u32		integ_len;
-
-	BUG_ON(!ctx);
 
 	if (ctx->gc_proc != RPC_GSS_PROC_DATA)
 		goto out_decode;
-	service = gss_pseudoflavor_to_service(gss_cred->gc_flavor);
+	service = gss_pseudoflavor_to_service(ctx->gc_gss_ctx->mech_type,
+						gss_cred->gc_flavor);
 	switch (service) {
 		case RPC_GSS_SVC_NONE:
 			goto out_decode;
 		case RPC_GSS_SVC_INTEGRITY:
-			integ_len = ntohl(*p++);
-			if (integ_len & 3)
-				goto out;
-			data_offset = (u8 *)p - (u8 *)rcv_buf->head[0].iov_base;
-			mic_offset = integ_len + data_offset;
-			if (mic_offset > rcv_buf->len)
-				goto out;
-			if (ntohl(*p++) != req->rq_seqno)
-				goto out;
-
-			if (xdr_buf_subsegment(rcv_buf, &integ_buf, data_offset,
-						mic_offset - data_offset))
-				goto out;
-
-			if (xdr_buf_read_netobj(rcv_buf, &mic, mic_offset))
-				goto out;
-
-			maj_stat = gss_verify_mic(ctx->gc_gss_ctx, &integ_buf,
-					&mic, NULL);
-			if (maj_stat != GSS_S_COMPLETE)
+			status = gss_unwrap_resp_integ(ctx, decode, 
+							rqstp, &p, obj);
+			if (status)
 				goto out;
 			break;
 		case RPC_GSS_SVC_PRIVACY:
@@ -930,7 +975,8 @@ out_decode:
 	status = decode(rqstp, p, obj);
 out:
 	gss_put_ctx(ctx);
-	dprintk("RPC: gss_unwrap_resp returning %d\n", status);
+	dprintk("RPC: %4u gss_unwrap_resp returning %d\n", task->tk_pid,
+			status);
 	return status;
 }
   
@@ -985,7 +1031,6 @@ out:
 static void __exit exit_rpcsec_gss(void)
 {
 	gss_svc_shutdown();
-	gss_mech_unregister_all();
 	rpcauth_unregister(&authgss_ops);
 }
 
diff --git a/net/sunrpc/auth_gss/gss_generic_token.c b/net/sunrpc/auth_gss/gss_generic_token.c
index 9a948de03..d7b040809 100644
--- a/net/sunrpc/auth_gss/gss_generic_token.c
+++ b/net/sunrpc/auth_gss/gss_generic_token.c
@@ -32,6 +32,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/sunrpc/sched.h>
@@ -151,22 +152,23 @@ g_token_size(struct xdr_netobj *mech, unsigned int body_size)
 	return(1 + der_length_size(body_size) + body_size);
 }
 
+EXPORT_SYMBOL(g_token_size);
+
 /* fills in a buffer with the token header.  The buffer is assumed to
    be the right size.  buf is advanced past the token header */
 
 void
-g_make_token_header(struct xdr_netobj *mech, int body_size, unsigned char **buf,
-		int tok_type)
+g_make_token_header(struct xdr_netobj *mech, int body_size, unsigned char **buf)
 {
 	*(*buf)++ = 0x60;
 	der_write_length(buf, 4 + mech->len + body_size);
 	*(*buf)++ = 0x06;
 	*(*buf)++ = (unsigned char) mech->len;
 	TWRITE_STR(*buf, mech->data, ((int) mech->len));
-	*(*buf)++ = (unsigned char) ((tok_type>>8)&0xff);
-	*(*buf)++ = (unsigned char) (tok_type&0xff);
 }
 
+EXPORT_SYMBOL(g_make_token_header);
+
 /*
  * Given a buffer containing a token, reads and verifies the token,
  * leaving buf advanced past the token header, and setting body_size
@@ -221,9 +223,6 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
 	if (ret)
 		return(ret);
 
-	if ((*buf++ != ((tok_type>>8)&0xff)) || (*buf++ != (tok_type&0xff))) 
-		return(G_WRONG_TOKID);
-
 	if (!ret) {
 		*buf_in = buf;
 		*body_size = toksize;
@@ -232,6 +231,8 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
 	return(ret);
 }
 
+EXPORT_SYMBOL(g_verify_token_header);
+
 /* Given a buffer containing a token, returns a copy of the mech oid in
  * the parameter mech. */
 u32
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 9c53c7494..b4db91868 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -59,14 +59,14 @@ krb5_encrypt(
         struct scatterlist sg[1];
 	u8 local_iv[16] = {0};
 
-	dprintk("RPC: krb5_encrypt: input data:\n");
+	dprintk("RPC:      krb5_encrypt: input data:\n");
 	print_hexl((u32 *)in, length, 0);
 
 	if (length % crypto_tfm_alg_blocksize(tfm) != 0)
 		goto out;
 
 	if (crypto_tfm_alg_ivsize(tfm) > 16) {
-		dprintk("RPC: gss_k5encrypt: tfm iv size to large %d\n",
+		dprintk("RPC:      gss_k5encrypt: tfm iv size to large %d\n",
 		         crypto_tfm_alg_ivsize(tfm));
 		goto out;
 	}
@@ -81,13 +81,15 @@ krb5_encrypt(
 
 	ret = crypto_cipher_encrypt_iv(tfm, sg, sg, length, local_iv);
 
-	dprintk("RPC: krb5_encrypt: output data:\n");
+	dprintk("RPC:      krb5_encrypt: output data:\n");
 	print_hexl((u32 *)out, length, 0);
 out:
-	dprintk("krb5_encrypt returns %d\n",ret);
+	dprintk("RPC:      krb5_encrypt returns %d\n",ret);
 	return(ret);
 }
 
+EXPORT_SYMBOL(krb5_encrypt);
+
 u32
 krb5_decrypt(
      struct crypto_tfm *tfm,
@@ -100,14 +102,14 @@ krb5_decrypt(
 	struct scatterlist sg[1];
 	u8 local_iv[16] = {0};
 
-	dprintk("RPC: krb5_decrypt: input data:\n");
+	dprintk("RPC:      krb5_decrypt: input data:\n");
 	print_hexl((u32 *)in, length, 0);
 
 	if (length % crypto_tfm_alg_blocksize(tfm) != 0)
 		goto out;
 
 	if (crypto_tfm_alg_ivsize(tfm) > 16) {
-		dprintk("RPC: gss_k5decrypt: tfm iv size to large %d\n",
+		dprintk("RPC:      gss_k5decrypt: tfm iv size to large %d\n",
 			crypto_tfm_alg_ivsize(tfm));
 		goto out;
 	}
@@ -121,13 +123,15 @@ krb5_decrypt(
 
 	ret = crypto_cipher_decrypt_iv(tfm, sg, sg, length, local_iv);
 
-	dprintk("RPC: krb5_decrypt: output_data:\n");
+	dprintk("RPC:      krb5_decrypt: output_data:\n");
 	print_hexl((u32 *)out, length, 0);
 out:
-	dprintk("gss_k5decrypt returns %d\n",ret);
+	dprintk("RPC:      gss_k5decrypt returns %d\n",ret);
 	return(ret);
 }
 
+EXPORT_SYMBOL(krb5_decrypt);
+
 void
 buf_to_sg(struct scatterlist *sg, char *ptr, int len) {
 	sg->page = virt_to_page(ptr);
@@ -135,10 +139,9 @@ buf_to_sg(struct scatterlist *sg, char *ptr, int len) {
 	sg->length = len;
 }
 
-/* checksum the plaintext data and the first 8 bytes of the krb5 token header,
- * as specified by the rfc: */
+/* checksum the plaintext data and hdrlen bytes of the token header */
 s32
-krb5_make_checksum(s32 cksumtype, char *header, struct xdr_buf *body,
+make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
 		   struct xdr_netobj *cksum)
 {
 	char                            *cksumname;
@@ -153,7 +156,7 @@ krb5_make_checksum(s32 cksumtype, char *header, struct xdr_buf *body,
 			cksumname = "md5";
 			break;
 		default:
-			dprintk("RPC: krb5_make_checksum:"
+			dprintk("RPC:      krb5_make_checksum:"
 				" unsupported checksum %d", cksumtype);
 			goto out;
 	}
@@ -164,7 +167,7 @@ krb5_make_checksum(s32 cksumtype, char *header, struct xdr_buf *body,
 		goto out;
 
 	crypto_digest_init(tfm);
-	buf_to_sg(sg, header, 8);
+	buf_to_sg(sg, header, hdrlen);
 	crypto_digest_update(tfm, sg, 1);
 	if (body->head[0].iov_len) {
 		buf_to_sg(sg, body->head[0].iov_base, body->head[0].iov_len);
@@ -202,3 +205,5 @@ out:
 		crypto_free_tfm(tfm);
 	return code;
 }
+
+EXPORT_SYMBOL(make_checksum);
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 57c074a06..0082fb5c9 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -40,7 +40,6 @@
 #include <linux/slab.h>
 #include <linux/sunrpc/auth.h>
 #include <linux/in.h>
-#include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/gss_krb5.h>
 #include <linux/sunrpc/xdr.h>
 #include <linux/crypto.h>
@@ -100,7 +99,7 @@ get_key(char **p, char *end, struct crypto_tfm **res)
 			alg_mode = CRYPTO_TFM_MODE_CBC;
 			break;
 		default:
-			dprintk("RPC: get_key: unsupported algorithm %d\n", alg);
+			dprintk("RPC:      get_key: unsupported algorithm %d\n", alg);
 			goto out_err_free_key;
 	}
 	if (!(*res = crypto_alloc_tfm(alg_name, alg_mode)))
@@ -155,7 +154,7 @@ gss_import_sec_context_kerberos(struct xdr_netobj *inbuf,
 		goto out_err_free_key2;
 
 	ctx_id->internal_ctx_id = ctx;
-	dprintk("Succesfully imported new context.\n");
+	dprintk("RPC:      Succesfully imported new context.\n");
 	return 0;
 
 out_err_free_key2:
@@ -197,7 +196,7 @@ gss_verify_mic_kerberos(struct gss_ctx		*ctx,
 	if (!maj_stat && qop_state)
 	    *qstate = qop_state;
 
-	dprintk("RPC: gss_verify_mic_kerberos returning %d\n", maj_stat);
+	dprintk("RPC:      gss_verify_mic_kerberos returning %d\n", maj_stat);
 	return maj_stat;
 }
 
@@ -211,41 +210,52 @@ gss_get_mic_kerberos(struct gss_ctx	*ctx,
 
 	err = krb5_make_token(kctx, qop, message, mic_token, KG_TOK_MIC_MSG);
 
-	dprintk("RPC: gss_get_mic_kerberos returning %d\n",err);
+	dprintk("RPC:      gss_get_mic_kerberos returning %d\n",err);
 
 	return err;
 }
 
 static struct gss_api_ops gss_kerberos_ops = {
-	.name			= "krb5",
 	.gss_import_sec_context	= gss_import_sec_context_kerberos,
 	.gss_get_mic		= gss_get_mic_kerberos,
 	.gss_verify_mic		= gss_verify_mic_kerberos,
 	.gss_delete_sec_context	= gss_delete_sec_context_kerberos,
 };
 
-/* XXX error checking? reference counting? */
+static struct pf_desc gss_kerberos_pfs[] = {
+	[0] = {
+		.pseudoflavor = RPC_AUTH_GSS_KRB5,
+		.service = RPC_GSS_SVC_NONE,
+		.name = "krb5",
+	},
+	[1] = {
+		.pseudoflavor = RPC_AUTH_GSS_KRB5I,
+		.service = RPC_GSS_SVC_INTEGRITY,
+		.name = "krb5i",
+	},
+};
+
+static struct gss_api_mech gss_kerberos_mech = {
+	.gm_name	= "krb5",
+	.gm_owner	= THIS_MODULE,
+	.gm_ops		= &gss_kerberos_ops,
+	.gm_pf_num	= ARRAY_SIZE(gss_kerberos_pfs),
+	.gm_pfs		= gss_kerberos_pfs,
+};
+
 static int __init init_kerberos_module(void)
 {
-	struct gss_api_mech *gm;
+	int status;
 
-	if (gss_mech_register(&gss_mech_krb5_oid, &gss_kerberos_ops))
+	status = gss_mech_register(&gss_kerberos_mech);
+	if (status)
 		printk("Failed to register kerberos gss mechanism!\n");
-	gm = gss_mech_get_by_OID(&gss_mech_krb5_oid);
-	gss_register_triple(RPC_AUTH_GSS_KRB5 , gm, 0, RPC_GSS_SVC_NONE);
-	gss_register_triple(RPC_AUTH_GSS_KRB5I, gm, 0, RPC_GSS_SVC_INTEGRITY);
-	if (svcauth_gss_register_pseudoflavor(RPC_AUTH_GSS_KRB5, "krb5"))
-		printk("Failed to register %s with server!\n", "krb5");
-	if (svcauth_gss_register_pseudoflavor(RPC_AUTH_GSS_KRB5I, "krb5i"))
-		printk("Failed to register %s with server!\n", "krb5i");
-	gss_mech_put(gm);
-	return 0;
+	return status;
 }
 
 static void __exit cleanup_kerberos_module(void)
 {
-	gss_unregister_triple(RPC_AUTH_GSS_KRB5I);
-	gss_unregister_triple(RPC_AUTH_GSS_KRB5);
+	gss_mech_unregister(&gss_kerberos_mech);
 }
 
 MODULE_LICENSE("GPL");
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index 1622e2167..afeeb8715 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -91,7 +91,7 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req,
 
 	dprintk("RPC:     gss_krb5_seal\n");
 
-	now = jiffies;
+	now = get_seconds();
 
 	if (qop_req != 0)
 		goto out_err;
@@ -101,12 +101,12 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req,
 			checksum_type = CKSUMTYPE_RSA_MD5;
 			break;
 		default:
-			dprintk("RPC: gss_krb5_seal: ctx->signalg %d not"
+			dprintk("RPC:      gss_krb5_seal: ctx->signalg %d not"
 				" supported\n", ctx->signalg);
 			goto out_err;
 	}
 	if (ctx->sealalg != SEAL_ALG_NONE && ctx->sealalg != SEAL_ALG_DES) {
-		dprintk("RPC: gss_krb5_seal: ctx->sealalg %d not supported\n",
+		dprintk("RPC:      gss_krb5_seal: ctx->sealalg %d not supported\n",
 			ctx->sealalg);
 		goto out_err;
 	}
@@ -122,7 +122,10 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req,
 	token->len = g_token_size(&ctx->mech_used, 22 + tmsglen);
 
 	ptr = token->data;
-	g_make_token_header(&ctx->mech_used, 22 + tmsglen, &ptr, toktype);
+	g_make_token_header(&ctx->mech_used, 22 + tmsglen, &ptr);
+
+	*ptr++ = (unsigned char) ((toktype>>8)&0xff);
+	*ptr++ = (unsigned char) (toktype&0xff);
 
 	/* ptr now at byte 2 of header described in rfc 1964, section 1.2.1: */
 	krb5_hdr = ptr - 2;
@@ -137,7 +140,7 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req,
 		/* XXX removing support for now */
 		goto out_err;
 	} else { /* Sign only.  */
-		if (krb5_make_checksum(checksum_type, krb5_hdr, text,
+		if (make_checksum(checksum_type, krb5_hdr, 8, text,
 				       &md5cksum))
 			goto out_err;
 	}
@@ -151,7 +154,7 @@ krb5_make_token(struct krb5_ctx *ctx, int qop_req,
 		       md5cksum.data + md5cksum.len - KRB5_CKSUM_LENGTH,
 		       KRB5_CKSUM_LENGTH);
 
-		dprintk("make_seal_token: cksum data: \n");
+		dprintk("RPC:      make_seal_token: cksum data: \n");
 		print_hexl((u32 *) (krb5_hdr + 16), KRB5_CKSUM_LENGTH, 0);
 		break;
 	default:
diff --git a/net/sunrpc/auth_gss/gss_krb5_seqnum.c b/net/sunrpc/auth_gss/gss_krb5_seqnum.c
index 3345bae2a..c53ead391 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seqnum.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seqnum.c
@@ -70,7 +70,7 @@ krb5_get_seq_num(struct crypto_tfm *key,
 	s32 code;
 	unsigned char plain[8];
 
-	dprintk("krb5_get_seq_num: \n");
+	dprintk("RPC:      krb5_get_seq_num:\n");
 
 	if ((code = krb5_decrypt(key, cksum, buf, plain, 8)))
 		return code;
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
index 0e1c7f70f..dcde40fe7 100644
--- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
@@ -99,6 +99,10 @@ krb5_read_token(struct krb5_ctx *ctx,
 	if (g_verify_token_header(&ctx->mech_used, &bodysize, &ptr, toktype,
 					read_token->len))
 		goto out;
+
+	if ((*ptr++ != ((toktype>>8)&0xff)) || (*ptr++ != (toktype&0xff)))
+		goto out;
+
 	/* XXX sanity-check bodysize?? */
 
 	if (toktype == KG_TOK_WRAP_MSG) {
@@ -149,7 +153,7 @@ krb5_read_token(struct krb5_ctx *ctx,
 
 	switch (signalg) {
 	case SGN_ALG_DES_MAC_MD5:
-		ret = krb5_make_checksum(checksum_type, ptr - 2,
+		ret = make_checksum(checksum_type, ptr - 2, 8,
 					 message_buffer, &md5cksum);
 		if (ret)
 			goto out;
@@ -174,7 +178,7 @@ krb5_read_token(struct krb5_ctx *ctx,
 	if (qop_state)
 		*qop_state = GSS_C_QOP_DEFAULT;
 
-	now = jiffies;
+	now = get_seconds();
 
 	ret = GSS_S_CONTEXT_EXPIRED;
 	if (now > ctx->endtime)
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index b076e81af..f5030f3fc 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -36,9 +36,11 @@
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/socket.h>
+#include <linux/module.h>
 #include <linux/sunrpc/msg_prot.h>
 #include <linux/sunrpc/gss_asn1.h>
 #include <linux/sunrpc/auth_gss.h>
+#include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/gss_err.h>
 #include <linux/sunrpc/sched.h>
 #include <linux/sunrpc/gss_api.h>
@@ -51,146 +53,186 @@
 static LIST_HEAD(registered_mechs);
 static spinlock_t registered_mechs_lock = SPIN_LOCK_UNLOCKED;
 
-/* Reference counting: The reference count includes the reference in the
- * global registered_mechs list.  That reference will never diseappear
- * (so the reference count will never go below 1) until after the mech
- * is removed from the list.  Nothing can be removed from the list without
- * first getting the registered_mechs_lock, so a gss_api_mech won't diseappear
- * from underneath us while we hold the registered_mech_lock.  */
-
-int
-gss_mech_register(struct xdr_netobj * mech_type, struct gss_api_ops * ops)
+static void
+gss_mech_free(struct gss_api_mech *gm)
 {
-	struct gss_api_mech *gm;
+	struct pf_desc *pf;
+	int i;
 
-	if (!(gm = kmalloc(sizeof(*gm), GFP_KERNEL))) {
-		printk("Failed to allocate memory in gss_mech_register");
-		return -1;
+	for (i = 0; i < gm->gm_pf_num; i++) {
+		pf = &gm->gm_pfs[i];
+		if (pf->auth_domain_name)
+			kfree(pf->auth_domain_name);
+		pf->auth_domain_name = NULL;
 	}
-	gm->gm_oid.len = mech_type->len;
-	if (!(gm->gm_oid.data = kmalloc(mech_type->len, GFP_KERNEL))) {
-		kfree(gm);
-		printk("Failed to allocate memory in gss_mech_register");
-		return -1;
-	}
-	memcpy(gm->gm_oid.data, mech_type->data, mech_type->len);
-	/* We're counting the reference in the registered_mechs list: */
-	atomic_set(&gm->gm_count, 1);
-	gm->gm_ops = ops;
-	
-	spin_lock(&registered_mechs_lock);
-	list_add(&gm->gm_list, &registered_mechs);
-	spin_unlock(&registered_mechs_lock);
-	dprintk("RPC: gss_mech_register: registered mechanism with oid:\n");
-	print_hexl((u32 *)mech_type->data, mech_type->len, 0);
-	return 0;
 }
 
-/* The following must be called with spinlock held: */
-int
-do_gss_mech_unregister(struct gss_api_mech *gm)
+static inline char *
+make_auth_domain_name(char *name)
 {
+	static char	*prefix = "gss/";
+	char		*new;
 
-	list_del(&gm->gm_list);
+	new = kmalloc(strlen(name) + strlen(prefix) + 1, GFP_KERNEL);
+	if (new) {
+		strcpy(new, prefix);
+		strcat(new, name);
+	}
+	return new;
+}
 
-	dprintk("RPC: unregistered mechanism with oid:\n");
-	print_hexl((u32 *)gm->gm_oid.data, gm->gm_oid.len, 0);
-	if (!gss_mech_put(gm)) {
-		dprintk("RPC: We just unregistered a gss_mechanism which"
-				" someone is still using.\n");
-		return -1;
-	} else {
-		return 0;
+static int
+gss_mech_svc_setup(struct gss_api_mech *gm)
+{
+	struct pf_desc *pf;
+	int i, status;
+
+	for (i = 0; i < gm->gm_pf_num; i++) {
+		pf = &gm->gm_pfs[i];
+		pf->auth_domain_name = make_auth_domain_name(pf->name);
+		status = -ENOMEM;
+		if (pf->auth_domain_name == NULL)
+			goto out;
+		status = svcauth_gss_register_pseudoflavor(pf->pseudoflavor,
+							pf->auth_domain_name);
+		if (status)
+			goto out;
 	}
+	return 0;
+out:
+	gss_mech_free(gm);
+	return status;
 }
 
 int
-gss_mech_unregister(struct gss_api_mech *gm)
+gss_mech_register(struct gss_api_mech *gm)
 {
 	int status;
 
+	status = gss_mech_svc_setup(gm);
+	if (status)
+		return status;
 	spin_lock(&registered_mechs_lock);
-	status = do_gss_mech_unregister(gm);
+	list_add(&gm->gm_list, &registered_mechs);
 	spin_unlock(&registered_mechs_lock);
-	return status;
+	dprintk("RPC:      registered gss mechanism %s\n", gm->gm_name);
+	return 0;
 }
 
-int
-gss_mech_unregister_all(void)
-{
-	struct list_head	*pos;
-	struct gss_api_mech	*gm;
-	int			status = 0;
+EXPORT_SYMBOL(gss_mech_register);
 
+void
+gss_mech_unregister(struct gss_api_mech *gm)
+{
 	spin_lock(&registered_mechs_lock);
-	while (!list_empty(&registered_mechs)) {
-		pos = registered_mechs.next;
-		gm = list_entry(pos, struct gss_api_mech, gm_list);
-		if (do_gss_mech_unregister(gm))
-			status = -1;
-	}
+	list_del(&gm->gm_list);
 	spin_unlock(&registered_mechs_lock);
-	return status;
+	dprintk("RPC:      unregistered gss mechanism %s\n", gm->gm_name);
+	gss_mech_free(gm);
 }
 
+EXPORT_SYMBOL(gss_mech_unregister);
+
 struct gss_api_mech *
 gss_mech_get(struct gss_api_mech *gm)
 {
-	atomic_inc(&gm->gm_count);
+	__module_get(gm->gm_owner);
 	return gm;
 }
 
+EXPORT_SYMBOL(gss_mech_get);
+
 struct gss_api_mech *
-gss_mech_get_by_OID(struct xdr_netobj *mech_type)
+gss_mech_get_by_name(char *name)
 {
-	struct gss_api_mech 	*pos, *gm = NULL;
+	struct gss_api_mech	*pos, *gm = NULL;
 
-	dprintk("RPC: gss_mech_get_by_OID searching for mechanism with OID:\n");
-	print_hexl((u32 *)mech_type->data, mech_type->len, 0);
 	spin_lock(&registered_mechs_lock);
 	list_for_each_entry(pos, &registered_mechs, gm_list) {
-		if ((pos->gm_oid.len == mech_type->len)
-			&& !memcmp(pos->gm_oid.data, mech_type->data,
-							mech_type->len)) {
-			gm = gss_mech_get(pos);
+		if (0 == strcmp(name, pos->gm_name)) {
+			if (!try_module_get(pos->gm_owner))
+				continue;
+			gm = pos;
 			break;
 		}
 	}
 	spin_unlock(&registered_mechs_lock);
-	dprintk("RPC: gss_mech_get_by_OID %s it\n", gm ? "found" : "didn't find");
 	return gm;
+
+}
+
+EXPORT_SYMBOL(gss_mech_get_by_name);
+
+static inline int
+mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor)
+{
+	int i;
+
+	for (i = 0; i < gm->gm_pf_num; i++) {
+		if (gm->gm_pfs[i].pseudoflavor == pseudoflavor)
+			return 1;
+	}
+	return 0;
 }
 
 struct gss_api_mech *
-gss_mech_get_by_name(char *name)
+gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
 {
-	struct gss_api_mech	*pos, *gm = NULL;
+	struct gss_api_mech *pos, *gm = NULL;
 
 	spin_lock(&registered_mechs_lock);
 	list_for_each_entry(pos, &registered_mechs, gm_list) {
-		if (0 == strcmp(name, pos->gm_ops->name)) {
-			gm = gss_mech_get(pos);
-			break;
+		if (!try_module_get(pos->gm_owner))
+			continue;
+		if (!mech_supports_pseudoflavor(pos, pseudoflavor)) {
+			module_put(pos->gm_owner);
+			continue;
 		}
+		gm = pos;
+		break;
 	}
 	spin_unlock(&registered_mechs_lock);
 	return gm;
+}
+
+EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor);
 
+u32
+gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor)
+{
+	int i;
+
+	for (i = 0; i < gm->gm_pf_num; i++) {
+		if (gm->gm_pfs[i].pseudoflavor == pseudoflavor)
+			return gm->gm_pfs[i].service;
+	}
+	return 0;
 }
 
-int
-gss_mech_put(struct gss_api_mech * gm)
+EXPORT_SYMBOL(gss_pseudoflavor_to_service);
+
+char *
+gss_service_to_auth_domain_name(struct gss_api_mech *gm, u32 service)
 {
-	if (atomic_dec_and_test(&gm->gm_count)) {
-		if (gm->gm_oid.len >0)
-			kfree(gm->gm_oid.data);
-		kfree(gm);
-		return 1;
-	} else {
-		return 0;
+	int i;
+
+	for (i = 0; i < gm->gm_pf_num; i++) {
+		if (gm->gm_pfs[i].service == service)
+			return gm->gm_pfs[i].auth_domain_name;
 	}
+	return NULL;
 }
 
+EXPORT_SYMBOL(gss_service_to_auth_domain_name);
+
+void
+gss_mech_put(struct gss_api_mech * gm)
+{
+	module_put(gm->gm_owner);
+}
+
+EXPORT_SYMBOL(gss_mech_put);
+
 /* The mech could probably be determined from the token instead, but it's just
  * as easy for now to pass it in. */
 u32
@@ -244,7 +286,8 @@ gss_verify_mic(struct gss_ctx		*context_handle,
 u32
 gss_delete_sec_context(struct gss_ctx	**context_handle)
 {
-	dprintk("gss_delete_sec_context deleting %p\n",*context_handle);
+	dprintk("RPC:      gss_delete_sec_context deleting %p\n",
+			*context_handle);
 
 	if (!*context_handle)
 		return(GSS_S_NO_CONTEXT);
diff --git a/net/sunrpc/auth_gss/gss_pseudoflavors.c b/net/sunrpc/auth_gss/gss_pseudoflavors.c
index 443b200c9..e7b9aa9c9 100644
--- a/net/sunrpc/auth_gss/gss_pseudoflavors.c
+++ b/net/sunrpc/auth_gss/gss_pseudoflavors.c
@@ -82,12 +82,13 @@ gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech,
 
 	spin_lock(&registered_triples_lock);
 	if (do_lookup_triple_by_pseudoflavor(pseudoflavor)) {
-		printk("Registered pseudoflavor %d again\n", pseudoflavor);
+		printk(KERN_WARNING "RPC: Registered pseudoflavor %d again\n",
+				pseudoflavor);
 		goto err_unlock;
 	}
 	list_add(&triple->triples, &registered_triples);
 	spin_unlock(&registered_triples_lock);
-	dprintk("RPC: registered pseudoflavor %d\n", pseudoflavor);
+	dprintk("RPC:      registered pseudoflavor %d\n", pseudoflavor);
 
 	return 0;
 
@@ -145,7 +146,7 @@ gss_cmp_triples(u32 oid_len, char *oid_data, u32 qop, u32 service)
 	oid.len = oid_len;
 	oid.data = oid_data;
 
-	dprintk("RPC: gss_cmp_triples \n");
+	dprintk("RPC:      gss_cmp_triples\n");
 	print_sec_triple(&oid,qop,service);
 
 	spin_lock(&registered_triples_lock);
@@ -158,7 +159,7 @@ gss_cmp_triples(u32 oid_len, char *oid_data, u32 qop, u32 service)
 		}
 	}
 	spin_unlock(&registered_triples_lock);
-	dprintk("RPC: gss_cmp_triples return %d\n", pseudoflavor);
+	dprintk("RPC:      gss_cmp_triples return %d\n", pseudoflavor);
 	return pseudoflavor;
 }
 
@@ -193,8 +194,8 @@ gss_pseudoflavor_to_service(u32 pseudoflavor)
 	triple = do_lookup_triple_by_pseudoflavor(pseudoflavor);
 	spin_unlock(&registered_triples_lock);
 	if (!triple) {
-		dprintk("RPC: gss_pseudoflavor_to_service called with"
-			" unsupported pseudoflavor %d\n", pseudoflavor);
+		dprintk("RPC:      gss_pseudoflavor_to_service called with unsupported pseudoflavor %d\n",
+				pseudoflavor);
 		return 0;
 	}
 	return triple->service;
@@ -211,8 +212,8 @@ gss_pseudoflavor_to_mech(u32 pseudoflavor) {
 	if (triple)
 		mech = gss_mech_get(triple->mech);
 	else
-		dprintk("RPC: gss_pseudoflavor_to_mech called with"
-			" unsupported pseudoflavor %d\n", pseudoflavor);
+		dprintk("RPC:      gss_pseudoflavor_to_mech called with unsupported pseudoflavor %d\n",
+				pseudoflavor);
 	return mech;
 }
 
@@ -223,8 +224,8 @@ gss_pseudoflavor_to_mechOID(u32 pseudoflavor, struct xdr_netobj * oid)
 
 	mech = gss_pseudoflavor_to_mech(pseudoflavor);
 	if (!mech)  {
-		dprintk("RPC: gss_pseudoflavor_to_mechOID called with"
-			" unsupported pseudoflavor %d\n", pseudoflavor);
+		dprintk("RPC:      gss_pseudoflavor_to_mechOID called with unsupported pseudoflavor %d\n",
+				pseudoflavor);
 		        return -1;
 	}
 	oid->len = mech->gm_oid.len;
diff --git a/net/sunrpc/auth_gss/sunrpcgss_syms.c b/net/sunrpc/auth_gss/sunrpcgss_syms.c
index a6b02569c..ef45f93e5 100644
--- a/net/sunrpc/auth_gss/sunrpcgss_syms.c
+++ b/net/sunrpc/auth_gss/sunrpcgss_syms.c
@@ -10,26 +10,28 @@
 #include <linux/sunrpc/auth_gss.h>
 #include <linux/sunrpc/svcauth_gss.h>
 #include <linux/sunrpc/gss_asn1.h>
+#include <linux/sunrpc/gss_krb5.h>
 
-/* sec_triples: */
-EXPORT_SYMBOL(gss_register_triple);
-EXPORT_SYMBOL(gss_unregister_triple);
-EXPORT_SYMBOL(gss_cmp_triples);
-EXPORT_SYMBOL(gss_pseudoflavor_to_mechOID);
-EXPORT_SYMBOL(gss_pseudoflavor_supported);
-EXPORT_SYMBOL(gss_pseudoflavor_to_service);
+/* svcauth_gss.c: */
 EXPORT_SYMBOL(svcauth_gss_register_pseudoflavor);
 
 /* registering gss mechanisms to the mech switching code: */
 EXPORT_SYMBOL(gss_mech_register);
+EXPORT_SYMBOL(gss_mech_unregister);
 EXPORT_SYMBOL(gss_mech_get);
-EXPORT_SYMBOL(gss_mech_get_by_OID);
+EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor);
+EXPORT_SYMBOL(gss_mech_get_by_name);
 EXPORT_SYMBOL(gss_mech_put);
+EXPORT_SYMBOL(gss_pseudoflavor_to_service);
+EXPORT_SYMBOL(gss_service_to_auth_domain_name);
 
 /* generic functionality in gss code: */
 EXPORT_SYMBOL(g_make_token_header);
 EXPORT_SYMBOL(g_verify_token_header);
 EXPORT_SYMBOL(g_token_size);
+EXPORT_SYMBOL(make_checksum);
+EXPORT_SYMBOL(krb5_encrypt);
+EXPORT_SYMBOL(krb5_decrypt);
 
 /* debug */
 EXPORT_SYMBOL(print_hexl);
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index dae18e979..55b2fd104 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -333,6 +333,7 @@ rsc_init(struct rsc *new, struct rsc *tmp)
 	new->handle.data = tmp->handle.data;
 	tmp->handle.data = NULL;
 	new->mechctx = NULL;
+	new->cred.cr_group_info = NULL;
 }
 
 static inline void
@@ -453,8 +454,11 @@ gss_svc_searchbyctx(struct xdr_netobj *handle)
 	struct rsc rsci;
 	struct rsc *found;
 
-	rsci.handle = *handle;
+	memset(&rsci, 0, sizeof(rsci));
+	if (dup_to_netobj(&rsci.handle, handle->data, handle->len))
+		return NULL;
 	found = rsc_lookup(&rsci, 0);
+	rsc_free(&rsci);
 	if (!found)
 		return NULL;
 	if (cache_check(&rsc_cache, &found->h, NULL))
@@ -570,14 +574,14 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
 	}
 
 	if (gc->gc_seq > MAXSEQ) {
-		dprintk("svcauth_gss: discarding request with large"
-			" sequence number %d\n", gc->gc_seq);
+		dprintk("RPC:      svcauth_gss: discarding request with large sequence number %d\n",
+				gc->gc_seq);
 		*authp = rpcsec_gsserr_ctxproblem;
 		return SVC_DENIED;
 	}
 	if (!gss_check_seq_num(rsci, gc->gc_seq)) {
-		dprintk("svcauth_gss: discarding request with old"
-				" sequence number %d\n", gc->gc_seq);
+		dprintk("RPC:      svcauth_gss: discarding request with old sequence number %d\n",
+				gc->gc_seq);
 		return SVC_DROP;
 	}
 	return SVC_OK;
@@ -617,19 +621,15 @@ struct gss_domain {
 	u32			pseudoflavor;
 };
 
-/* XXX this should be done in gss_pseudoflavors, and shouldn't be hardcoded: */
 static struct auth_domain *
 find_gss_auth_domain(struct gss_ctx *ctx, u32 svc)
 {
-	switch(gss_get_pseudoflavor(ctx, 0, svc)) {
-		case RPC_AUTH_GSS_KRB5:
-			return auth_domain_find("gss/krb5");
-		case RPC_AUTH_GSS_KRB5I:
-			return auth_domain_find("gss/krb5i");
-		case RPC_AUTH_GSS_KRB5P:
-			return auth_domain_find("gss/krb5p");
-	}
-	return NULL;
+	char *name;
+
+	name = gss_service_to_auth_domain_name(ctx->mech_type, svc);
+	if (!name)
+		return NULL;
+	return auth_domain_find(name);
 }
 
 int
@@ -637,19 +637,17 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
 {
 	struct gss_domain	*new;
 	struct auth_domain	*test;
-	static char		*prefix = "gss/";
-	int			stat = -1;
+	int			stat = -ENOMEM;
 
 	new = kmalloc(sizeof(*new), GFP_KERNEL);
 	if (!new)
 		goto out;
 	cache_init(&new->h.h);
 	atomic_inc(&new->h.h.refcnt);
-	new->h.name = kmalloc(strlen(name) + strlen(prefix) + 1, GFP_KERNEL);
+	new->h.name = kmalloc(strlen(name) + 1, GFP_KERNEL);
 	if (!new->h.name)
 		goto out_free_dom;
-	strcpy(new->h.name, prefix);
-	strcat(new->h.name, name);
+	strcpy(new->h.name, name);
 	new->h.flavour = RPC_AUTH_GSS;
 	new->pseudoflavor = pseudoflavor;
 	new->h.h.expiry_time = NEVER;
@@ -670,6 +668,8 @@ out:
 	return stat;
 }
 
+EXPORT_SYMBOL(svcauth_gss_register_pseudoflavor);
+
 static inline int
 read_u32_from_xdr_buf(struct xdr_buf *buf, int base, u32 *obj)
 {
@@ -755,7 +755,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
 	u32		*reject_stat = resv->iov_base + resv->iov_len;
 	int		ret;
 
-	dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n",argv->iov_len);
+	dprintk("RPC:      svcauth_gss: argv->iov_len = %zd\n",argv->iov_len);
 
 	*authp = rpc_autherr_badcred;
 	if (!svcdata)
@@ -1049,6 +1049,7 @@ svcauth_gss_domain_release(struct auth_domain *dom)
 
 struct auth_ops svcauthops_gss = {
 	.name		= "rpcsec_gss",
+	.owner		= THIS_MODULE,
 	.flavour	= RPC_AUTH_GSS,
 	.accept		= svcauth_gss_accept,
 	.release	= svcauth_gss_release,
@@ -1058,10 +1059,12 @@ struct auth_ops svcauthops_gss = {
 int
 gss_svc_init(void)
 {
-	cache_register(&rsc_cache);
-	cache_register(&rsi_cache);
-	svc_auth_register(RPC_AUTH_GSS, &svcauthops_gss);
-	return 0;
+	int rv = svc_auth_register(RPC_AUTH_GSS, &svcauthops_gss);
+	if (rv == 0) {
+		cache_register(&rsc_cache);
+		cache_register(&rsi_cache);
+	}
+	return rv;
 }
 
 void
@@ -1069,4 +1072,5 @@ gss_svc_shutdown(void)
 {
 	cache_unregister(&rsc_cache);
 	cache_unregister(&rsi_cache);
+	svc_auth_unregister(RPC_AUTH_GSS);
 }
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 3e823aa8b..e84acd07f 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -214,6 +214,7 @@ void cache_register(struct cache_detail *cd)
 	cd->entries = 0;
 	atomic_set(&cd->readers, 0);
 	cd->last_close = 0;
+	cd->last_warn = -1;
 	list_add(&cd->others, &cache_list);
 	spin_unlock(&cache_list_lock);
 
@@ -574,7 +575,7 @@ struct cache_reader {
 };
 
 static ssize_t
-cache_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
+cache_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct cache_reader *rp = filp->private_data;
 	struct cache_request *rq;
@@ -652,12 +653,13 @@ cache_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
 	return err ? err :  count;
 }
 
+static char write_buf[8192]; /* protected by queue_io_sem */
+
 static ssize_t
-cache_write(struct file *filp, const char *buf, size_t count,
+cache_write(struct file *filp, const char __user *buf, size_t count,
 	    loff_t *ppos)
 {
 	int err;
-	char *page;
 	struct cache_detail *cd = PDE(filp->f_dentry->d_inode)->data;
 
 	if (ppos != &filp->f_pos)
@@ -665,31 +667,22 @@ cache_write(struct file *filp, const char *buf, size_t count,
 
 	if (count == 0)
 		return 0;
-	if (count > PAGE_SIZE)
+	if (count >= sizeof(write_buf))
 		return -EINVAL;
 
 	down(&queue_io_sem);
 
-	page = kmalloc(PAGE_SIZE, GFP_KERNEL);
-	if (page == NULL) {
-		up(&queue_io_sem);
-		return -ENOMEM;
-	}
-
-	if (copy_from_user(page, buf, count)) {
+	if (copy_from_user(write_buf, buf, count)) {
 		up(&queue_io_sem);
-		kfree(page);
 		return -EFAULT;
 	}
-	if (count < PAGE_SIZE)
-		page[count] = '\0';
+	write_buf[count] = '\0';
 	if (cd->cache_parse)
-		err = cd->cache_parse(cd, page, count);
+		err = cd->cache_parse(cd, write_buf, count);
 	else
 		err = -EINVAL;
 
 	up(&queue_io_sem);
-	kfree(page);
 	return err ? err : count;
 }
 
@@ -750,7 +743,7 @@ cache_ioctl(struct inode *ino, struct file *filp,
 		}
 	spin_unlock(&queue_lock);
 
-	return put_user(len, (int *)arg);
+	return put_user(len, (int __user *)arg);
 }
 
 static int
@@ -913,7 +906,14 @@ void qword_addhex(char **bpp, int *lp, char *buf, int blen)
 	*lp = len;
 }
 
-			
+void warn_no_listener(struct cache_detail *detail)
+{
+	if (detail->last_warn != detail->last_close) {
+		detail->last_warn = detail->last_close;
+		if (detail->warn_no_listener)
+			detail->warn_no_listener(detail);
+	}
+}
 
 /*
  * register an upcall request to user-space.
@@ -931,9 +931,10 @@ static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h)
 		return -EINVAL;
 
 	if (atomic_read(&detail->readers) == 0 &&
-	    detail->last_close < get_seconds() - 60)
-		/* nobody is listening */
-		return -EINVAL;
+	    detail->last_close < get_seconds() - 30) {
+			warn_no_listener(detail);
+			return -EINVAL;
+	}
 
 	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!buf)
@@ -1165,7 +1166,7 @@ static struct file_operations content_file_operations = {
 	.release	= content_release,
 };
 
-static ssize_t read_flush(struct file *file, char *buf,
+static ssize_t read_flush(struct file *file, char __user *buf,
 			    size_t count, loff_t *ppos)
 {
 	struct cache_detail *cd = PDE(file->f_dentry->d_inode)->data;
@@ -1186,7 +1187,7 @@ static ssize_t read_flush(struct file *file, char *buf,
 	return len;
 }
 
-static ssize_t write_flush(struct file * file, const char * buf,
+static ssize_t write_flush(struct file * file, const char __user * buf,
 			     size_t count, loff_t *ppos)
 {
 	struct cache_detail *cd = PDE(file->f_dentry->d_inode)->data;
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 1696c16b2..e06577901 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -788,13 +788,11 @@ static void
 call_timeout(struct rpc_task *task)
 {
 	struct rpc_clnt	*clnt = task->tk_client;
-	struct rpc_timeout *to = &task->tk_rqstp->rq_timeout;
 
-	if (xprt_adjust_timeout(to)) {
+	if (xprt_adjust_timeout(task->tk_rqstp) == 0) {
 		dprintk("RPC: %4d call_timeout (minor)\n", task->tk_pid);
 		goto retry;
 	}
-	to->to_retries = clnt->cl_timeout.to_retries;
 
 	dprintk("RPC: %4d call_timeout (major)\n", task->tk_pid);
 	if (RPC_IS_SOFT(task)) {
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 409e6aef1..8a8c4eb6c 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -270,7 +270,7 @@ rpc_pipe_ioctl(struct inode *ino, struct file *filp,
 			msg = (struct rpc_pipe_msg *)filp->private_data;
 			len += msg->len - msg->copied;
 		}
-		return put_user(len, (int *)arg);
+		return put_user(len, (int __user *)arg);
 	default:
 		return -EINVAL;
 	}
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index db78e727d..54ea89629 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -11,6 +11,7 @@
 
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/module.h>
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/xdr.h>
 #include <linux/sunrpc/svcsock.h>
@@ -27,6 +28,7 @@
 extern struct auth_ops svcauth_null;
 extern struct auth_ops svcauth_unix;
 
+static spinlock_t authtab_lock = SPIN_LOCK_UNLOCKED;
 static struct auth_ops	*authtab[RPC_AUTH_MAXFLAVOR] = {
 	[0] = &svcauth_null,
 	[1] = &svcauth_unix,
@@ -43,10 +45,15 @@ svc_authenticate(struct svc_rqst *rqstp, u32 *authp)
 	flavor = ntohl(svc_getu32(&rqstp->rq_arg.head[0]));
 
 	dprintk("svc: svc_authenticate (%d)\n", flavor);
-	if (flavor >= RPC_AUTH_MAXFLAVOR || !(aops = authtab[flavor])) {
+
+	spin_lock(&authtab_lock);
+	if (flavor >= RPC_AUTH_MAXFLAVOR || !(aops = authtab[flavor])
+			|| !try_module_get(aops->owner)) {
+		spin_unlock(&authtab_lock);
 		*authp = rpc_autherr_badcred;
 		return SVC_DENIED;
 	}
+	spin_unlock(&authtab_lock);
 
 	rqstp->rq_authop = aops;
 	return aops->accept(rqstp, authp);
@@ -63,28 +70,35 @@ int svc_authorise(struct svc_rqst *rqstp)
 
 	rqstp->rq_authop = NULL;
 	
-	if (aops) 
+	if (aops) {
 		rv = aops->release(rqstp);
-
-	/* FIXME should I count and release authops */
+		module_put(aops->owner);
+	}
 	return rv;
 }
 
 int
 svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops)
 {
-	if (flavor >= RPC_AUTH_MAXFLAVOR || authtab[flavor])
-		return -EINVAL;
-	authtab[flavor] = aops;
-	return 0;
+	int rv = -EINVAL;
+	spin_lock(&authtab_lock);
+	if (flavor < RPC_AUTH_MAXFLAVOR && authtab[flavor] == NULL) {
+		authtab[flavor] = aops;
+		rv = 0;
+	}
+	spin_unlock(&authtab_lock);
+	return rv;
 }
 
 void
 svc_auth_unregister(rpc_authflavor_t flavor)
 {
+	spin_lock(&authtab_lock);
 	if (flavor < RPC_AUTH_MAXFLAVOR)
 		authtab[flavor] = NULL;
+	spin_unlock(&authtab_lock);
 }
+EXPORT_SYMBOL(svc_auth_unregister);
 
 /**************************************************
  * cache for domain name to auth_domain
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 082684ddf..ab5164b6d 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -1,5 +1,6 @@
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/module.h>
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/xdr.h>
 #include <linux/sunrpc/svcsock.h>
@@ -411,6 +412,7 @@ svcauth_null_release(struct svc_rqst *rqstp)
 
 struct auth_ops svcauth_null = {
 	.name		= "null",
+	.owner		= THIS_MODULE,
 	.flavour	= RPC_AUTH_NULL,
 	.accept 	= svcauth_null_accept,
 	.release	= svcauth_null_release,
@@ -515,6 +517,7 @@ svcauth_unix_release(struct svc_rqst *rqstp)
 
 struct auth_ops svcauth_unix = {
 	.name		= "unix",
+	.owner		= THIS_MODULE,
 	.flavour	= RPC_AUTH_UNIX,
 	.accept 	= svcauth_unix_accept,
 	.release	= svcauth_unix_release,
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index a8ac421d0..024e768cd 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1255,6 +1255,7 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
 
 	/* No data, incomplete (TCP) read, or accept() */
 	if (len == 0 || len == -EAGAIN) {
+		rqstp->rq_res.len = 0;
 		svc_sock_release(rqstp);
 		return -EAGAIN;
 	}
@@ -1511,9 +1512,9 @@ static void svc_revisit(struct cache_deferred_req *dreq, int too_many)
 	dprintk("revisit queued\n");
 	svsk = dr->svsk;
 	dr->svsk = NULL;
-	spin_lock(&serv->sv_lock);
+	spin_lock_bh(&serv->sv_lock);
 	list_add(&dr->handle.recent, &svsk->sk_deferred);
-	spin_unlock(&serv->sv_lock);
+	spin_unlock_bh(&serv->sv_lock);
 	set_bit(SK_DEFERRED, &svsk->sk_flags);
 	svc_sock_enqueue(svsk);
 	svc_sock_put(svsk);
@@ -1544,10 +1545,10 @@ svc_defer(struct cache_req *req)
 		dr->argslen = rqstp->rq_arg.len >> 2;
 		memcpy(dr->args, rqstp->rq_arg.head[0].iov_base-skip, dr->argslen<<2);
 	}
-	spin_lock(&rqstp->rq_server->sv_lock);
+	spin_lock_bh(&rqstp->rq_server->sv_lock);
 	rqstp->rq_sock->sk_inuse++;
 	dr->svsk = rqstp->rq_sock;
-	spin_unlock(&rqstp->rq_server->sv_lock);
+	spin_unlock_bh(&rqstp->rq_server->sv_lock);
 
 	dr->handle.revisit = svc_revisit;
 	return &dr->handle;
@@ -1577,7 +1578,7 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_sock *svsk)
 	
 	if (!test_bit(SK_DEFERRED, &svsk->sk_flags))
 		return NULL;
-	spin_lock(&serv->sv_lock);
+	spin_lock_bh(&serv->sv_lock);
 	clear_bit(SK_DEFERRED, &svsk->sk_flags);
 	if (!list_empty(&svsk->sk_deferred)) {
 		dr = list_entry(svsk->sk_deferred.next,
@@ -1586,6 +1587,6 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_sock *svsk)
 		list_del_init(&dr->handle.recent);
 		set_bit(SK_DEFERRED, &svsk->sk_flags);
 	}
-	spin_unlock(&serv->sv_lock);
+	spin_unlock_bh(&serv->sv_lock);
 	return dr;
 }
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 730f47d73..e69a7fbb4 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -58,9 +58,10 @@ rpc_unregister_sysctl(void)
 
 static int
 proc_dodebug(ctl_table *table, int write, struct file *file,
-				void *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp)
 {
-	char		tmpbuf[20], *p, c;
+	char		tmpbuf[20], c, *s;
+	char __user *p;
 	unsigned int	value;
 	size_t		left, len;
 
@@ -74,7 +75,7 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
 	if (write) {
 		if (!access_ok(VERIFY_READ, buffer, left))
 			return -EFAULT;
-		p = (char *) buffer;
+		p = buffer;
 		while (left && __get_user(c, p) >= 0 && isspace(c))
 			left--, p++;
 		if (!left)
@@ -86,12 +87,12 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
 			return -EFAULT;
 		tmpbuf[left] = '\0';
 
-		for (p = tmpbuf, value = 0; '0' <= *p && *p <= '9'; p++, left--)
-			value = 10 * value + (*p - '0');
-		if (*p && !isspace(*p))
+		for (s = tmpbuf, value = 0; '0' <= *s && *s <= '9'; s++, left--)
+			value = 10 * value + (*s - '0');
+		if (*s && !isspace(*s))
 			return -EINVAL;
-		while (left && isspace(*p))
-			left--, p++;
+		while (left && isspace(*s))
+			left--, s++;
 		*(unsigned int *) table->data = value;
 		/* Display the RPC tasks on writing to rpc_debug */
 		if (table->ctl_name == CTL_RPCDEBUG) {
@@ -106,7 +107,7 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
 		if (__copy_to_user(buffer, tmpbuf, len))
 			return -EFAULT;
 		if ((left -= len) > 0) {
-			if (put_user('\n', (char *)buffer + len))
+			if (put_user('\n', (char __user *)buffer + len))
 				return -EFAULT;
 			left--;
 		}
diff --git a/net/sunrpc/timer.c b/net/sunrpc/timer.c
index 6979f7340..bcbdf6430 100644
--- a/net/sunrpc/timer.c
+++ b/net/sunrpc/timer.c
@@ -39,6 +39,7 @@ rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo)
 	for (i = 0; i < 5; i++) {
 		rt->srtt[i] = init;
 		rt->sdrtt[i] = RPC_RTO_INIT;
+		rt->ntimeouts[i] = 0;
 	}
 }
 
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index f02f9e259..abfb21184 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -351,36 +351,58 @@ xprt_adjust_cwnd(struct rpc_xprt *xprt, int result)
 	xprt->cwnd = cwnd;
 }
 
+/*
+ * Reset the major timeout value
+ */
+static void xprt_reset_majortimeo(struct rpc_rqst *req)
+{
+	struct rpc_timeout *to = &req->rq_xprt->timeout;
+
+	req->rq_majortimeo = req->rq_timeout;
+	if (to->to_exponential)
+		req->rq_majortimeo <<= to->to_retries;
+	else
+		req->rq_majortimeo += to->to_increment * to->to_retries;
+	if (req->rq_majortimeo > to->to_maxval || req->rq_majortimeo == 0)
+		req->rq_majortimeo = to->to_maxval;
+	req->rq_majortimeo += jiffies;
+}
+
 /*
  * Adjust timeout values etc for next retransmit
  */
-int
-xprt_adjust_timeout(struct rpc_timeout *to)
+int xprt_adjust_timeout(struct rpc_rqst *req)
 {
-	if (to->to_retries > 0) {
+	struct rpc_xprt *xprt = req->rq_xprt;
+	struct rpc_timeout *to = &xprt->timeout;
+	int status = 0;
+
+	if (time_before(jiffies, req->rq_majortimeo)) {
 		if (to->to_exponential)
-			to->to_current <<= 1;
+			req->rq_timeout <<= 1;
 		else
-			to->to_current += to->to_increment;
-		if (to->to_maxval && to->to_current >= to->to_maxval)
-			to->to_current = to->to_maxval;
+			req->rq_timeout += to->to_increment;
+		if (to->to_maxval && req->rq_timeout >= to->to_maxval)
+			req->rq_timeout = to->to_maxval;
+		req->rq_retries++;
+		pprintk("RPC: %lu retrans\n", jiffies);
 	} else {
-		if (to->to_exponential)
-			to->to_initval <<= 1;
-		else
-			to->to_initval += to->to_increment;
-		if (to->to_maxval && to->to_initval >= to->to_maxval)
-			to->to_initval = to->to_maxval;
-		to->to_current = to->to_initval;
+		req->rq_timeout = to->to_initval;
+		req->rq_retries = 0;
+		xprt_reset_majortimeo(req);
+		/* Reset the RTT counters == "slow start" */
+		spin_lock_bh(&xprt->sock_lock);
+		rpc_init_rtt(req->rq_task->tk_client->cl_rtt, to->to_initval);
+		spin_unlock_bh(&xprt->sock_lock);
+		pprintk("RPC: %lu timeout\n", jiffies);
+		status = -ETIMEDOUT;
 	}
 
-	if (!to->to_current) {
-		printk(KERN_WARNING "xprt_adjust_timeout: to_current = 0!\n");
-		to->to_current = 5 * HZ;
+	if (req->rq_timeout == 0) {
+		printk(KERN_WARNING "xprt_adjust_timeout: rq_timeout = 0!\n");
+		req->rq_timeout = 5 * HZ;
 	}
-	pprintk("RPC: %lu %s\n", jiffies,
-			to->to_retries? "retrans" : "timeout");
-	return to->to_retries-- > 0;
+	return status;
 }
 
 /*
@@ -537,8 +559,17 @@ void xprt_connect(struct rpc_task *task)
 
 	task->tk_timeout = RPC_CONNECT_TIMEOUT;
 	rpc_sleep_on(&xprt->pending, task, xprt_connect_status, NULL);
-	if (!test_and_set_bit(XPRT_CONNECTING, &xprt->sockstate))
-		schedule_work(&xprt->sock_connect);
+	if (!test_and_set_bit(XPRT_CONNECTING, &xprt->sockstate)) {
+		/* Note: if we are here due to a dropped connection
+		 * 	 we delay reconnecting by RPC_REESTABLISH_TIMEOUT/HZ
+		 * 	 seconds
+		 */
+		if (xprt->sock != NULL)
+			schedule_delayed_work(&xprt->sock_connect,
+					RPC_REESTABLISH_TIMEOUT);
+		else
+			schedule_work(&xprt->sock_connect);
+	}
 	return;
  out_write:
 	xprt_release_write(xprt, task);
@@ -566,7 +597,6 @@ xprt_connect_status(struct rpc_task *task)
 	case -ECONNREFUSED:
 	case -ECONNRESET:
 	case -ENOTCONN:
-		rpc_delay(task, RPC_REESTABLISH_TIMEOUT);
 		return;
 	case -ETIMEDOUT:
 		dprintk("RPC: %4d xprt_connect_status: timed out\n",
@@ -1166,6 +1196,7 @@ xprt_transmit(struct rpc_task *task)
 			/* Add request to the receive list */
 			list_add_tail(&req->rq_list, &xprt->recv);
 			spin_unlock_bh(&xprt->sock_lock);
+			xprt_reset_majortimeo(req);
 		}
 	} else if (!req->rq_bytes_sent)
 		return;
@@ -1221,7 +1252,7 @@ xprt_transmit(struct rpc_task *task)
 			if (!xprt_connected(xprt))
 				task->tk_status = -ENOTCONN;
 			else if (test_bit(SOCK_NOSPACE, &xprt->sock->flags)) {
-				task->tk_timeout = req->rq_timeout.to_current;
+				task->tk_timeout = req->rq_timeout;
 				rpc_sleep_on(&xprt->pending, task, NULL, NULL);
 			}
 			spin_unlock_bh(&xprt->sock_lock);
@@ -1248,13 +1279,11 @@ xprt_transmit(struct rpc_task *task)
 	if (!xprt->nocong) {
 		int timer = task->tk_msg.rpc_proc->p_timer;
 		task->tk_timeout = rpc_calc_rto(clnt->cl_rtt, timer);
-		task->tk_timeout <<= rpc_ntimeo(clnt->cl_rtt, timer);
-		task->tk_timeout <<= clnt->cl_timeout.to_retries
-			- req->rq_timeout.to_retries;
-		if (task->tk_timeout > req->rq_timeout.to_maxval)
-			task->tk_timeout = req->rq_timeout.to_maxval;
+		task->tk_timeout <<= rpc_ntimeo(clnt->cl_rtt, timer) + req->rq_retries;
+		if (task->tk_timeout > xprt->timeout.to_maxval || task->tk_timeout == 0)
+			task->tk_timeout = xprt->timeout.to_maxval;
 	} else
-		task->tk_timeout = req->rq_timeout.to_current;
+		task->tk_timeout = req->rq_timeout;
 	/* Don't race with disconnect */
 	if (!xprt_connected(xprt))
 		task->tk_status = -ENOTCONN;
@@ -1324,7 +1353,7 @@ xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
 {
 	struct rpc_rqst	*req = task->tk_rqstp;
 
-	req->rq_timeout = xprt->timeout;
+	req->rq_timeout = xprt->timeout.to_initval;
 	req->rq_task	= task;
 	req->rq_xprt    = xprt;
 	req->rq_xid     = xprt_alloc_xid(xprt);
@@ -1381,7 +1410,6 @@ xprt_default_timeout(struct rpc_timeout *to, int proto)
 void
 xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr)
 {
-	to->to_current   = 
 	to->to_initval   = 
 	to->to_increment = incr;
 	to->to_maxval    = incr * retr;
@@ -1446,7 +1474,6 @@ xprt_setup(int proto, struct sockaddr_in *ap, struct rpc_timeout *to)
 	/* Set timeout parameters */
 	if (to) {
 		xprt->timeout = *to;
-		xprt->timeout.to_current = to->to_initval;
 	} else
 		xprt_default_timeout(&xprt->timeout, xprt->prot);
 
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 89fb7eb9e..e19475e6a 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1829,7 +1829,7 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 	{
 		case SIOCOUTQ:
 			amount = atomic_read(&sk->sk_wmem_alloc);
-			err = put_user(amount, (int *)arg);
+			err = put_user(amount, (int __user *)arg);
 			break;
 		case SIOCINQ:
 		{
@@ -1844,12 +1844,12 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			if (skb)
 				amount=skb->len;
 			spin_unlock(&sk->sk_receive_queue.lock);
-			err = put_user(amount, (int *)arg);
+			err = put_user(amount, (int __user *)arg);
 			break;
 		}
 
 		default:
-			err = dev_ioctl(cmd, (void *)arg);
+			err = dev_ioctl(cmd, (void __user *)arg);
 			break;
 	}
 	return err;
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c
index d4d13d430..4776ec1ea 100644
--- a/net/wanrouter/af_wanpipe.c
+++ b/net/wanrouter/af_wanpipe.c
@@ -552,7 +552,7 @@ static int wanpipe_sendmsg(struct kiocb *iocb, struct socket *sock,
 	if (sk->sk_state != WANSOCK_CONNECTED)
 		return -ENOTCONN;	
 
-	if (msg->msg_flags&~MSG_DONTWAIT) 
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT)) 
 		return(-EINVAL);
 
 	/* it was <=, now one can send
@@ -1765,7 +1765,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar
 	switch(cmd) 
 	{
 		case SIOCGSTAMP:
-			return sock_get_timestamp(sk, (struct timeval *)arg);
+			return sock_get_timestamp(sk, (struct timeval __user *)arg);
 
 		case SIOC_WANPIPE_CHECK_TX:
 
@@ -1832,7 +1832,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar
 #endif
 
 		default:
-			return dev_ioctl(cmd,(void *) arg);
+			return dev_ioctl(cmd,(void __user *) arg);
 	}
 	/*NOTREACHED*/
 }
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index fcdce75c6..956c17f6c 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -128,13 +128,14 @@ static void dbg_kfree(void * v, int line) {
  */
 
 static int wanrouter_device_setup(struct wan_device *wandev,
-				  wandev_conf_t *u_conf);
+				  wandev_conf_t __user *u_conf);
 static int wanrouter_device_stat(struct wan_device *wandev,
-				 wandev_stat_t *u_stat);
+				 wandev_stat_t __user *u_stat);
 static int wanrouter_device_shutdown(struct wan_device *wandev);
 static int wanrouter_device_new_if(struct wan_device *wandev,
-				   wanif_conf_t *u_conf);
-static int wanrouter_device_del_if(struct wan_device *wandev, char *u_name);
+				   wanif_conf_t __user *u_conf);
+static int wanrouter_device_del_if(struct wan_device *wandev,
+				   char __user *u_name);
 
 /*
  *	Miscellaneous
@@ -410,6 +411,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
 	int err = 0;
 	struct proc_dir_entry *dent;
 	struct wan_device *wandev;
+	void __user *data = (void __user *)arg;
 
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
@@ -427,7 +429,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
 
 	switch (cmd) {
 	case ROUTER_SETUP:
-		err = wanrouter_device_setup(wandev, (void*)arg);
+		err = wanrouter_device_setup(wandev, data);
 		break;
 
 	case ROUTER_DOWN:
@@ -435,15 +437,15 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
 		break;
 
 	case ROUTER_STAT:
-		err = wanrouter_device_stat(wandev, (void*)arg);
+		err = wanrouter_device_stat(wandev, data);
 		break;
 
 	case ROUTER_IFNEW:
-		err = wanrouter_device_new_if(wandev, (void*)arg);
+		err = wanrouter_device_new_if(wandev, data);
 		break;
 
 	case ROUTER_IFDEL:
-		err = wanrouter_device_del_if(wandev, (void*)arg);
+		err = wanrouter_device_del_if(wandev, data);
 		break;
 
 	case ROUTER_IFSTAT:
@@ -472,7 +474,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
  */
 
 static int wanrouter_device_setup(struct wan_device *wandev,
-				  wandev_conf_t *u_conf)
+				  wandev_conf_t __user *u_conf)
 {
 	void *data = NULL;
 	wandev_conf_t *conf;
@@ -583,7 +585,7 @@ static int wanrouter_device_shutdown(struct wan_device *wandev)
  */
 
 static int wanrouter_device_stat(struct wan_device *wandev,
-				 wandev_stat_t *u_stat)
+				 wandev_stat_t __user *u_stat)
 {
 	wandev_stat_t stat;
 
@@ -614,7 +616,7 @@ static int wanrouter_device_stat(struct wan_device *wandev,
  */
 
 static int wanrouter_device_new_if(struct wan_device *wandev,
-				   wanif_conf_t *u_conf)
+				   wanif_conf_t __user *u_conf)
 {
 	wanif_conf_t *cnf;
 	struct net_device *dev = NULL;
@@ -740,7 +742,7 @@ out:
  *	 o copy configuration data to kernel address space
  */
 
-static int wanrouter_device_del_if(struct wan_device *wandev, char *u_name)
+static int wanrouter_device_del_if(struct wan_device *wandev, char __user *u_name)
 {
 	char name[WAN_IFNAME_SZ + 1];
         int err = 0;
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 614f959b0..17d20343a 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -363,7 +363,7 @@ void x25_destroy_socket(struct sock *sk)
  */
 
 static int x25_setsockopt(struct socket *sock, int level, int optname,
-			  char *optval, int optlen)
+			  char __user *optval, int optlen)
 {
 	int opt;
 	struct sock *sk = sock->sk;
@@ -377,7 +377,7 @@ static int x25_setsockopt(struct socket *sock, int level, int optname,
 		goto out;
 
 	rc = -EFAULT;
-	if (get_user(opt, (int *)optval))
+	if (get_user(opt, (int __user *)optval))
 		goto out;
 
 	x25_sk(sk)->qbitincl = !!opt;
@@ -387,7 +387,7 @@ out:
 }
 
 static int x25_getsockopt(struct socket *sock, int level, int optname,
-			  char *optval, int *optlen)
+			  char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
 	int val, len, rc = -ENOPROTOOPT;
@@ -922,7 +922,7 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock,
 	size_t size;
 	int qbit = 0, rc = -EINVAL;
 
-	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_OOB | MSG_EOR))
+	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_OOB|MSG_EOR|MSG_CMSG_COMPAT))
 		goto out;
 
 	/* we currently don't support segmented records at the user interface */
@@ -1180,6 +1180,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
 	struct sock *sk = sock->sk;
 	struct x25_opt *x25 = x25_sk(sk);
+	void __user *argp = (void __user *)arg;
 	int rc;
 
 	switch (cmd) {
@@ -1188,7 +1189,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 				     atomic_read(&sk->sk_wmem_alloc);
 			if (amount < 0)
 				amount = 0;
-			rc = put_user(amount, (unsigned int *)arg);
+			rc = put_user(amount, (unsigned int __user *)argp);
 			break;
 		}
 
@@ -1201,7 +1202,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			 */
 			if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
 				amount = skb->len;
-			rc = put_user(amount, (unsigned int *)arg);
+			rc = put_user(amount, (unsigned int __user *)argp);
 			break;
 		}
 
@@ -1209,7 +1210,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			rc = -EINVAL;
 			if (sk)
 				rc = sock_get_timestamp(sk, 
-						(struct timeval *)arg); 
+						(struct timeval __user *)argp); 
 			break;
 		case SIOCGIFADDR:
 		case SIOCSIFADDR:
@@ -1228,20 +1229,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			rc = -EPERM;
 			if (!capable(CAP_NET_ADMIN))
 				break;
-			rc = x25_route_ioctl(cmd, (void *)arg);
+			rc = x25_route_ioctl(cmd, argp);
 			break;
 		case SIOCX25GSUBSCRIP:
-			rc = x25_subscr_ioctl(cmd, (void *)arg);
+			rc = x25_subscr_ioctl(cmd, argp);
 			break;
 		case SIOCX25SSUBSCRIP:
 			rc = -EPERM;
 			if (!capable(CAP_NET_ADMIN))
 				break;
-			rc = x25_subscr_ioctl(cmd, (void *)arg);
+			rc = x25_subscr_ioctl(cmd, argp);
 			break;
 		case SIOCX25GFACILITIES: {
 			struct x25_facilities fac = x25->facilities;
-			rc = copy_to_user((void *)arg, &fac,
+			rc = copy_to_user(argp, &fac,
 					  sizeof(fac)) ? -EFAULT : 0;
 			break;
 		}
@@ -1249,7 +1250,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCX25SFACILITIES: {
 			struct x25_facilities facilities;
 			rc = -EFAULT;
-			if (copy_from_user(&facilities, (void *)arg,
+			if (copy_from_user(&facilities, argp,
 					   sizeof(facilities)))
 				break;
 			rc = -EINVAL;
@@ -1277,7 +1278,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 
 		case SIOCX25GCALLUSERDATA: {
 			struct x25_calluserdata cud = x25->calluserdata;
-			rc = copy_to_user((void *)arg, &cud,
+			rc = copy_to_user(argp, &cud,
 					  sizeof(cud)) ? -EFAULT : 0;
 			break;
 		}
@@ -1286,7 +1287,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 			struct x25_calluserdata calluserdata;
 
 			rc = -EFAULT;
-			if (copy_from_user(&calluserdata, (void *)arg,
+			if (copy_from_user(&calluserdata, argp,
 					   sizeof(calluserdata)))
 				break;
 			rc = -EINVAL;
@@ -1300,13 +1301,13 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCX25GCAUSEDIAG: {
 			struct x25_causediag causediag;
 			causediag = x25->causediag;
-			rc = copy_to_user((void *)arg, &causediag,
+			rc = copy_to_user(argp, &causediag,
 					  sizeof(causediag)) ? -EFAULT : 0;
 			break;
 		}
 
  		default:
-			rc = dev_ioctl(cmd, (void *)arg);
+			rc = dev_ioctl(cmd, argp);
 			break;
 	}
 
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c
index c5df945f3..118146629 100644
--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -374,7 +374,7 @@ struct x25_neigh *x25_get_neigh(struct net_device *dev)
 /*
  *	Handle the ioctls that control the subscription functions.
  */
-int x25_subscr_ioctl(unsigned int cmd, void *arg)
+int x25_subscr_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct x25_subscrip_struct x25_subscr;
 	struct x25_neigh *nb;
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c
index 07ae9d9e2..4697d55bb 100644
--- a/net/x25/x25_route.c
+++ b/net/x25/x25_route.c
@@ -174,7 +174,7 @@ struct x25_route *x25_get_route(struct x25_address *addr)
 /*
  *	Handle the ioctls that control the routing functions.
  */
-int x25_route_ioctl(unsigned int cmd, void *arg)
+int x25_route_ioctl(unsigned int cmd, void __user *arg)
 {
 	struct x25_route_struct rt;
 	struct net_device *dev;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 714e6f3cf..2e60c843f 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -148,6 +148,8 @@ static void xfrm_policy_timer(unsigned long data)
 	int warn = 0;
 	int dir;
 
+	read_lock(&xp->lock);
+
 	if (xp->dead)
 		goto out;
 
@@ -197,6 +199,7 @@ static void xfrm_policy_timer(unsigned long data)
 		xfrm_pol_hold(xp);
 
 out:
+	read_unlock(&xp->lock);
 	xfrm_pol_put(xp);
 	return;
 
@@ -1014,6 +1017,8 @@ static int stale_bundle(struct dst_entry *dst)
 
 static void xfrm_dst_destroy(struct dst_entry *dst)
 {
+	if (!dst->xfrm)
+		return;
 	xfrm_state_put(dst->xfrm);
 	dst->xfrm = NULL;
 }
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index dc70df79f..44cb5240f 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -221,13 +221,9 @@ static void __xfrm_state_delete(struct xfrm_state *x)
 		if (atomic_read(&x->refcnt) > 2)
 			xfrm_flush_bundles();
 
-		/* All xfrm_state objects are created by one of two possible
-		 * paths:
-		 *
-		 * 2) xfrm_state_lookup --> xfrm_state_insert
-		 *
-		 * The xfrm_state_lookup or xfrm_state_alloc call gives a
-		 * reference, and that is what we are dropping here.
+		/* All xfrm_state objects are created by xfrm_state_alloc.
+		 * The xfrm_state_alloc call gives a reference, and that
+		 * is what we are dropping here.
 		 */
 		atomic_dec(&x->refcnt);
 	}
@@ -235,7 +231,6 @@ static void __xfrm_state_delete(struct xfrm_state *x)
 
 void xfrm_state_delete(struct xfrm_state *x)
 {
-	xfrm_state_delete_tunnel(x);
 	spin_lock_bh(&x->lock);
 	__xfrm_state_delete(x);
 	spin_unlock_bh(&x->lock);
@@ -331,14 +326,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
 		}
 	}
 
-	if (best) {
-		xfrm_state_hold(best);
-		spin_unlock_bh(&xfrm_state_lock);
-		return best;
-	}
-
-	x = NULL;
-	if (!error && !acquire_in_progress &&
+	x = best;
+	if (!x && !error && !acquire_in_progress &&
 	    ((x = xfrm_state_alloc()) != NULL)) {
 		/* Initialize temporary selector matching only
 		 * to current session. */
@@ -355,7 +344,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
 			}
 			x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
 			xfrm_state_hold(x);
-			mod_timer(&x->timer, XFRM_ACQ_EXPIRES*HZ);
+			x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
+			add_timer(&x->timer);
 		} else {
 			x->km.state = XFRM_STATE_DEAD;
 			xfrm_state_put(x);
@@ -363,10 +353,12 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
 			error = 1;
 		}
 	}
-	spin_unlock_bh(&xfrm_state_lock);
-	if (!x)
+	if (x)
+		xfrm_state_hold(x);
+	else
 		*err = acquire_in_progress ? -EAGAIN :
 			(error ? -ESRCH : -ENOMEM);
+	spin_unlock_bh(&xfrm_state_lock);
 	return x;
 }
 
@@ -489,15 +481,16 @@ out:
 			memcpy(x1->encap, x->encap, sizeof(*x1->encap));
 		memcpy(&x1->lft, &x->lft, sizeof(x1->lft));
 		x1->km.dying = 0;
+
+		if (!mod_timer(&x1->timer, jiffies + HZ))
+			xfrm_state_hold(x1);
+		if (x1->curlft.use_time)
+			xfrm_state_check_expire(x1);
+
 		err = 0;
 	}
 	spin_unlock_bh(&x1->lock);
 
-	if (!mod_timer(&x1->timer, jiffies + HZ))
-		xfrm_state_hold(x1);
-	if (x1->curlft.use_time)
-		xfrm_state_check_expire(x1);
-
 	xfrm_state_put(x1);
 
 	return err;
@@ -801,7 +794,7 @@ void km_policy_expired(struct xfrm_policy *pol, int dir, int hard)
 		wake_up(&km_waitq);
 }
 
-int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen)
+int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen)
 {
 	int err;
 	u8 *data;
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 43c110fe7..f4b328979 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -5,12 +5,13 @@
  * This software may be used and distributed according to the terms
  * of the GNU General Public License, incorporated herein by reference.
  *
- * Usage: nm -n vmlinux | scripts/kallsyms > symbols.S
+ * Usage: nm -n vmlinux | scripts/kallsyms [--all-symbols] > symbols.S
  */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 
 struct sym_entry {
 	unsigned long long addr;
@@ -22,11 +23,12 @@ struct sym_entry {
 static struct sym_entry *table;
 static int size, cnt;
 static unsigned long long _stext, _etext, _sinittext, _einittext;
+static int all_symbols = 0;
 
 static void
 usage(void)
 {
-	fprintf(stderr, "Usage: kallsyms < in.map > out.S\n");
+	fprintf(stderr, "Usage: kallsyms [--all-symbols] < in.map > out.S\n");
 	exit(1);
 }
 
@@ -44,6 +46,19 @@ read_symbol(FILE *in, struct sym_entry *s)
 		}
 		return -1;
 	}
+
+	/* Ignore most absolute/undefined (?) symbols. */
+	if (strcmp(str, "_stext") == 0)
+		_stext = s->addr;
+	else if (strcmp(str, "_etext") == 0)
+		_etext = s->addr;
+	else if (strcmp(str, "_sinittext") == 0)
+		_sinittext = s->addr;
+	else if (strcmp(str, "_einittext") == 0)
+		_einittext = s->addr;
+	else if (toupper(s->type) == 'A' || toupper(s->type) == 'U')
+		return -1;
+
 	s->sym = strdup(str);
 	return 0;
 }
@@ -51,9 +66,11 @@ read_symbol(FILE *in, struct sym_entry *s)
 static int
 symbol_valid(struct sym_entry *s)
 {
-	if ((s->addr < _stext || s->addr > _etext)
-	    && (s->addr < _sinittext || s->addr > _einittext))
-		return 0;
+	if (!all_symbols) {
+		if ((s->addr < _stext || s->addr > _etext)
+		    && (s->addr < _sinittext || s->addr > _einittext))
+			return 0;
+	}
 
 	if (strstr(s->sym, "_compiled."))
 		return 0;
@@ -64,8 +81,6 @@ symbol_valid(struct sym_entry *s)
 static void
 read_map(FILE *in)
 {
-	int i;
-
 	while (!feof(in)) {
 		if (cnt >= size) {
 			size += 10000;
@@ -78,22 +93,11 @@ read_map(FILE *in)
 		if (read_symbol(in, &table[cnt]) == 0)
 			cnt++;
 	}
-	for (i = 0; i < cnt; i++) {
-		if (strcmp(table[i].sym, "_stext") == 0)
-			_stext = table[i].addr;
-		if (strcmp(table[i].sym, "_etext") == 0)
-			_etext = table[i].addr;
-		if (strcmp(table[i].sym, "_sinittext") == 0)
-			_sinittext = table[i].addr;
-		if (strcmp(table[i].sym, "_einittext") == 0)
-			_einittext = table[i].addr;
-	}
 }
 
 static void
 write_src(void)
 {
-	unsigned long long last_addr;
 	int i, valid = 0;
 	char *prev;
 
@@ -111,16 +115,12 @@ write_src(void)
 	printf(".globl kallsyms_addresses\n");
 	printf("\tALGN\n");
 	printf("kallsyms_addresses:\n");
-	for (i = 0, last_addr = 0; i < cnt; i++) {
+	for (i = 0; i < cnt; i++) {
 		if (!symbol_valid(&table[i]))
 			continue;
-		
-		if (table[i].addr == last_addr)
-			continue;
 
 		printf("\tPTR\t%#llx\n", table[i].addr);
 		valid++;
-		last_addr = table[i].addr;
 	}
 	printf("\n");
 
@@ -134,20 +134,16 @@ write_src(void)
 	printf("\tALGN\n");
 	printf("kallsyms_names:\n");
 	prev = ""; 
-	for (i = 0, last_addr = 0; i < cnt; i++) {
+	for (i = 0; i < cnt; i++) {
 		int k;
 
 		if (!symbol_valid(&table[i]))
 			continue;
-		
-		if (table[i].addr == last_addr)
-			continue;
 
 		for (k = 0; table[i].sym[k] && table[i].sym[k] == prev[k]; ++k)
 			; 
 
 		printf("\t.byte 0x%02x\n\t.asciz\t\"%s\"\n", k, table[i].sym + k);
-		last_addr = table[i].addr;
 		prev = table[i].sym;
 	}
 	printf("\n");
@@ -156,7 +152,9 @@ write_src(void)
 int
 main(int argc, char **argv)
 {
-	if (argc != 1)
+	if (argc == 2 && strcmp(argv[1], "--all-symbols") == 0)
+		all_symbols = 1;
+	else if (argc != 1)
 		usage();
 
 	read_map(stdin);
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 945a28bde..a331dfdb2 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1304,6 +1304,8 @@ sub create_parameterlist($$$) {
     }
     
     foreach my $arg (split($splitter, $args)) {
+	# strip comments
+	$arg =~ s/\/\*.*\*\///;
         # strip leading/trailing spaces
         $arg =~ s/^\s*//;
 	$arg =~ s/\s*$//;
diff --git a/scripts/mk_elfconfig.c b/scripts/mk_elfconfig.c
index a39764823..de2aabf89 100644
--- a/scripts/mk_elfconfig.c
+++ b/scripts/mk_elfconfig.c
@@ -55,7 +55,7 @@ main(int argc, char **argv)
 	else
 		abort();
 
-	if (strcmp(argv[1], "v850") == 0)
+	if ((strcmp(argv[1], "v850") == 0) || (strcmp(argv[1], "h8300") == 0))
 		printf("#define MODULE_SYMBOL_PREFIX \"_\"\n");
 	else 
 		printf("#define MODULE_SYMBOL_PREFIX \"\"\n");
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 8d118d181..fe0a2ae55 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -33,7 +33,7 @@ UTS_VERSION="$UTS_VERSION `LC_ALL=C LANG=C date`"
 
 UTS_LEN=64
 UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
-
+LINUX_COMPILE_VERSION_ID="__linux_compile_version_id__`hostname | tr -c '[0-9A-Za-z\n]' '__'`_`LANG=C date | tr -c '[0-9A-Za-z\n]' '_'`"
 # Generate a temporary compile.h
 
 ( echo /\* This file is auto generated, version $VERSION \*/
@@ -55,6 +55,8 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
   fi
 
   echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
+  echo \#define LINUX_COMPILE_VERSION_ID $LINUX_COMPILE_VERSION_ID
+  echo \#define LINUX_COMPILE_VERSION_ID_TYPE typedef char* "$LINUX_COMPILE_VERSION_ID""_t"
 ) > .tmpcompile
 
 # Only replace the real compile.h if the new one is different,
diff --git a/scripts/modpost.c b/scripts/modpost.c
index 5205c2bf8..662e75b2f 100644
--- a/scripts/modpost.c
+++ b/scripts/modpost.c
@@ -267,6 +267,7 @@ parse_elf(struct elf_info *info, const char *filename)
 	hdr->e_shoff    = TO_NATIVE(hdr->e_shoff);
 	hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx);
 	hdr->e_shnum    = TO_NATIVE(hdr->e_shnum);
+	hdr->e_machine  = TO_NATIVE(hdr->e_machine);
 	sechdrs = (void *)hdr + hdr->e_shoff;
 	info->sechdrs = sechdrs;
 
diff --git a/scripts/reference_discarded.pl b/scripts/reference_discarded.pl
index 9d01ec5f3..8f80364fc 100644
--- a/scripts/reference_discarded.pl
+++ b/scripts/reference_discarded.pl
@@ -106,4 +106,4 @@ foreach $object (keys(%object)) {
 }
 # printf("Done\n");
 
-exit($errorcount);
+exit(0);
diff --git a/scripts/sumversion.c b/scripts/sumversion.c
index 898adcbf1..b41b718ed 100644
--- a/scripts/sumversion.c
+++ b/scripts/sumversion.c
@@ -374,7 +374,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
 			break;
 		/* Terminate line at first space, to get rid of final ' \' */
 		while (*p) {
-			if isspace(*p) {
+                       if (isspace(*p)) {
 				*p = '\0';
 				break;
 			}
diff --git a/security/Makefile b/security/Makefile
index d156d81ad..3686a1bb3 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -6,7 +6,7 @@ subdir-$(CONFIG_SECURITY_SELINUX)	+= selinux
 
 # if we don't select a security model, use the default capabilities
 ifneq ($(CONFIG_SECURITY),y)
-obj-y		+= commoncap.o capability.o
+obj-y		+= commoncap.o
 endif
 
 # Object file lists
diff --git a/security/capability.c b/security/capability.c
index f1e81ba6b..532023c65 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -22,9 +22,7 @@
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <linux/ptrace.h>
-
-#ifdef CONFIG_SECURITY
-
+#include <linux/moduleparam.h>
 
 static struct security_operations capability_ops = {
 	.ptrace =			cap_ptrace,
@@ -50,22 +48,23 @@ static struct security_operations capability_ops = {
 	.vm_enough_memory =             cap_vm_enough_memory,
 };
 
-#if defined(CONFIG_SECURITY_CAPABILITIES_MODULE)
-#define MY_NAME THIS_MODULE->name
-#else
-#define MY_NAME "capability"
-#endif
+#define MY_NAME __stringify(KBUILD_MODNAME)
 
 /* flag to keep track of how we were registered */
 static int secondary;
 
+static int capability_disable;
+module_param_named(disable, capability_disable, int, 0);
+MODULE_PARM_DESC(disable, "To disable capabilities module set disable = 1");
 
 static int __init capability_init (void)
 {
+	if (capability_disable) {
+		printk(KERN_INFO "Capabilities disabled at initialization\n");
+		return 0;
+	}
 	/* register ourselves with the security framework */
 	if (register_security (&capability_ops)) {
-		printk (KERN_INFO
-			"Failure registering capabilities with the kernel\n");
 		/* try registering with primary module */
 		if (mod_reg_security (MY_NAME, &capability_ops)) {
 			printk (KERN_INFO "Failure registering capabilities "
@@ -74,12 +73,15 @@ static int __init capability_init (void)
 		}
 		secondary = 1;
 	}
-	printk (KERN_INFO "Capability LSM initialized\n");
+	printk (KERN_INFO "Capability LSM initialized%s\n",
+		secondary ? " as secondary" : "");
 	return 0;
 }
 
 static void __exit capability_exit (void)
 {
+	if (capability_disable)
+		return;
 	/* remove ourselves from the security framework */
 	if (secondary) {
 		if (mod_unreg_security (MY_NAME, &capability_ops))
@@ -99,5 +101,3 @@ module_exit (capability_exit);
 
 MODULE_DESCRIPTION("Standard Linux Capabilities Security Module");
 MODULE_LICENSE("GPL");
-
-#endif	/* CONFIG_SECURITY */
diff --git a/security/commoncap.c b/security/commoncap.c
index f40fc7370..289569304 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -289,7 +289,7 @@ void cap_task_reparent_to_init (struct task_struct *p)
 
 int cap_syslog (int type)
 {
-	if ((type != 3) && !capable(CAP_SYS_ADMIN))
+	if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
 	return 0;
 }
diff --git a/security/dummy.c b/security/dummy.c
index 2a3ca3c76..3e768e050 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -99,7 +99,7 @@ static int dummy_quota_on (struct file *f)
 
 static int dummy_syslog (int type)
 {
-	if ((type != 3) && current->euid)
+	if ((type != 3 && type != 10) && current->euid)
 		return -EPERM;
 	return 0;
 }
@@ -688,7 +688,7 @@ static int dummy_shm_shmctl (struct shmid_kernel *shp, int cmd)
 	return 0;
 }
 
-static int dummy_shm_shmat (struct shmid_kernel *shp, char *shmaddr,
+static int dummy_shm_shmat (struct shmid_kernel *shp, char __user *shmaddr,
 			    int shmflg)
 {
 	return 0;
diff --git a/security/selinux/Kconfig b/security/selinux/Kconfig
index be4d39864..8819822d8 100644
--- a/security/selinux/Kconfig
+++ b/security/selinux/Kconfig
@@ -1,6 +1,6 @@
 config SECURITY_SELINUX
 	bool "NSA SELinux Support"
-	depends on SECURITY
+	depends on SECURITY && NET
 	default n
 	help
 	  This selects NSA Security-Enhanced Linux (SELinux).
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 8880f37dd..c447232c6 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -62,6 +62,7 @@
 #include <linux/nfs_mount.h>
 #include <net/ipv6.h>
 #include <linux/hugetlb.h>
+#include <linux/major.h>
 
 #include "avc.h"
 #include "objsec.h"
@@ -1379,7 +1380,7 @@ static void selinux_capset_set(struct task_struct *target, kernel_cap_t *effecti
 	if (error)
 		return;
 
-	return secondary_ops->capset_set(target, effective, inheritable, permitted);
+	secondary_ops->capset_set(target, effective, inheritable, permitted);
 }
 
 static int selinux_capable(struct task_struct *tsk, int cap)
@@ -1475,6 +1476,7 @@ static int selinux_syslog(int type)
 
 	switch (type) {
 		case 3:         /* Read last kernel messages */
+		case 10:        /* Return size of the log buffer */
 			rc = task_has_system(current, SYSTEM__SYSLOG_READ);
 			break;
 		case 6:         /* Disable logging to console */
@@ -1712,18 +1714,77 @@ static void selinux_bprm_free_security(struct linux_binprm *bprm)
 	kfree(bsec);
 }
 
+/* Create an open file that refers to the null device.
+   Derived from the OpenWall LSM. */
+struct file *open_devnull(void)
+{
+	struct inode *inode;
+	struct dentry *dentry;
+	struct file *file = NULL;
+	struct inode_security_struct *isec;
+	dev_t dev;
+
+	inode = new_inode(current->fs->rootmnt->mnt_sb);
+	if (!inode)
+		goto out;
+
+	dentry = dget(d_alloc_root(inode));
+	if (!dentry)
+		goto out_iput;
+
+	file = get_empty_filp();
+	if (!file)
+		goto out_dput;
+
+	dev = MKDEV(MEM_MAJOR, 3); /* null device */
+
+	inode->i_uid = current->fsuid;
+	inode->i_gid = current->fsgid;
+	inode->i_blksize = PAGE_SIZE;
+	inode->i_blocks = 0;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+	inode->i_state = I_DIRTY; /* so that mark_inode_dirty won't touch us */
+
+	isec = inode->i_security;
+	isec->sid = SECINITSID_DEVNULL;
+	isec->sclass = SECCLASS_CHR_FILE;
+	isec->initialized = 1;
+
+	file->f_flags = O_RDWR;
+	file->f_mode = FMODE_READ | FMODE_WRITE;
+	file->f_dentry = dentry;
+	file->f_vfsmnt = mntget(current->fs->rootmnt);
+	file->f_pos = 0;
+
+	init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, dev);
+	if (inode->i_fop->open(inode, file))
+		goto out_fput;
+
+out:
+	return file;
+out_fput:
+	mntput(file->f_vfsmnt);
+	put_filp(file);
+out_dput:
+	dput(dentry);
+out_iput:
+	iput(inode);
+	file = NULL;
+	goto out;
+}
+
 /* Derived from fs/exec.c:flush_old_files. */
 static inline void flush_unauthorized_files(struct files_struct * files)
 {
 	struct avc_audit_data ad;
-	struct file *file;
+	struct file *file, *devnull = NULL;
 	long j = -1;
 
 	AVC_AUDIT_DATA_INIT(&ad,FS);
 
 	spin_lock(&files->file_lock);
 	for (;;) {
-		unsigned long set, i;
+		unsigned long set, i, fd;
 
 		j++;
 		i = j * __NFDBITS;
@@ -1740,8 +1801,27 @@ static inline void flush_unauthorized_files(struct files_struct * files)
 					continue;
 				if (file_has_perm(current,
 						  file,
-						  file_to_av(file)))
+						  file_to_av(file))) {
 					sys_close(i);
+					fd = get_unused_fd();
+					if (fd != i) {
+						if (fd >= 0)
+							put_unused_fd(fd);
+						fput(file);
+						continue;
+					}
+					if (devnull) {
+						atomic_inc(&devnull->f_count);
+					} else {
+						devnull = open_devnull();
+						if (!devnull) {
+							put_unused_fd(fd);
+							fput(file);
+							continue;
+						}
+					}
+					fd_install(fd, devnull);
+				}
 				fput(file);
 			}
 		}
@@ -3465,7 +3545,7 @@ static int selinux_msg_msg_alloc_security(struct msg_msg *msg)
 
 static void selinux_msg_msg_free_security(struct msg_msg *msg)
 {
-	return msg_msg_free_security(msg);
+	msg_msg_free_security(msg);
 }
 
 /* message queue security operations */
@@ -3701,7 +3781,7 @@ static int selinux_shm_shmctl(struct shmid_kernel *shp, int cmd)
 }
 
 static int selinux_shm_shmat(struct shmid_kernel *shp,
-			     char *shmaddr, int shmflg)
+			     char __user *shmaddr, int shmflg)
 {
 	u32 perms;
 
diff --git a/security/selinux/include/flask.h b/security/selinux/include/flask.h
index 43ef2d661..6425c7869 100644
--- a/security/selinux/include/flask.h
+++ b/security/selinux/include/flask.h
@@ -65,7 +65,8 @@
 #define SECINITSID_KMOD                                 24
 #define SECINITSID_POLICY                               25
 #define SECINITSID_SCMP_PACKET                          26
+#define SECINITSID_DEVNULL                              27
 
-#define SECINITSID_NUM                                  26
+#define SECINITSID_NUM                                  27
 
 #endif
diff --git a/security/selinux/include/initial_sid_to_string.h b/security/selinux/include/initial_sid_to_string.h
index ec010c0e2..d4fac8279 100644
--- a/security/selinux/include/initial_sid_to_string.h
+++ b/security/selinux/include/initial_sid_to_string.h
@@ -28,5 +28,6 @@ static char *initial_sid_to_string[] =
     "kmod",
     "policy",
     "scmp_packet",
+    "devnull",
 };
 
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 1a589da54..975a17708 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -68,7 +68,7 @@ enum sel_inos {
 	SEL_DISABLE	/* disable SELinux until next reboot */
 };
 
-static ssize_t sel_read_enforce(struct file *filp, char *buf,
+static ssize_t sel_read_enforce(struct file *filp, char __user *buf,
 				size_t count, loff_t *ppos)
 {
 	char *page;
@@ -105,7 +105,7 @@ out:
 }
 
 #ifdef CONFIG_SECURITY_SELINUX_DEVELOP
-static ssize_t sel_write_enforce(struct file * file, const char * buf,
+static ssize_t sel_write_enforce(struct file * file, const char __user * buf,
 				 size_t count, loff_t *ppos)
 
 {
@@ -155,7 +155,7 @@ static struct file_operations sel_enforce_ops = {
 };
 
 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
-static ssize_t sel_write_disable(struct file * file, const char * buf,
+static ssize_t sel_write_disable(struct file * file, const char __user * buf,
 				 size_t count, loff_t *ppos)
 
 {
@@ -201,7 +201,7 @@ static struct file_operations sel_disable_ops = {
 	.write		= sel_write_disable,
 };
 
-static ssize_t sel_read_policyvers(struct file *filp, char *buf,
+static ssize_t sel_read_policyvers(struct file *filp, char __user *buf,
                                    size_t count, loff_t *ppos)
 {
 	char *page;
@@ -244,7 +244,7 @@ static struct file_operations sel_policyvers_ops = {
 /* declaration for sel_write_load */
 static int sel_make_bools(void);
 
-static ssize_t sel_read_mls(struct file *filp, char *buf,
+static ssize_t sel_read_mls(struct file *filp, char __user *buf,
 				size_t count, loff_t *ppos)
 {
 	char *page;
@@ -284,7 +284,7 @@ static struct file_operations sel_mls_ops = {
 	.read		= sel_read_mls,
 };
 
-static ssize_t sel_write_load(struct file * file, const char * buf,
+static ssize_t sel_write_load(struct file * file, const char __user * buf,
 			      size_t count, loff_t *ppos)
 
 {
@@ -334,7 +334,7 @@ static struct file_operations sel_load_ops = {
 };
 
 
-static ssize_t sel_write_context(struct file * file, const char * buf,
+static ssize_t sel_write_context(struct file * file, const char __user * buf,
 				 size_t count, loff_t *ppos)
 
 {
@@ -406,7 +406,7 @@ struct argresp {
  * possibly a read which collects the result - which is stored in a
  * file-local buffer.
  */
-static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t *pos)
+static ssize_t TA_write(struct file *file, const char __user *buf, size_t size, loff_t *pos)
 {
 	ino_t ino =  file->f_dentry->d_inode->i_ino;
 	struct argresp *ar;
@@ -445,7 +445,7 @@ static ssize_t TA_write(struct file *file, const char *buf, size_t size, loff_t
 	return rv;
 }
 
-static ssize_t TA_read(struct file *file, char *buf, size_t size, loff_t *pos)
+static ssize_t TA_read(struct file *file, char __user *buf, size_t size, loff_t *pos)
 {
 	struct argresp *ar;
 	ssize_t rv = 0;
@@ -744,7 +744,7 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode)
 
 #define BOOL_INO_OFFSET 30
 
-static ssize_t sel_read_bool(struct file *filep, char *buf,
+static ssize_t sel_read_bool(struct file *filep, char __user *buf,
 			     size_t count, loff_t *ppos)
 {
 	char *page = NULL;
@@ -806,7 +806,7 @@ out:
 	return ret;
 }
 
-static ssize_t sel_write_bool(struct file *filep, const char *buf,
+static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
 			      size_t count, loff_t *ppos)
 {
 	char *page = NULL;
@@ -833,8 +833,10 @@ static ssize_t sel_write_bool(struct file *filep, const char *buf,
 		goto out;
 	}
 	page = (char*)__get_free_page(GFP_KERNEL);
-	if (!page)
-		return -ENOMEM;
+	if (!page) {
+		length = -ENOMEM;
+		goto out;
+	}
 	memset(page, 0, PAGE_SIZE);
 
 	if (copy_from_user(page, buf, count))
@@ -863,7 +865,8 @@ static struct file_operations sel_bool_ops = {
 	.write          = sel_write_bool,
 };
 
-static ssize_t sel_commit_bools_write(struct file *filep, const char *buf,
+static ssize_t sel_commit_bools_write(struct file *filep,
+				      const char __user *buf,
 				      size_t count, loff_t *ppos)
 {
 	char *page = NULL;
@@ -889,8 +892,10 @@ static ssize_t sel_commit_bools_write(struct file *filep, const char *buf,
 		goto out;
 	}
 	page = (char*)__get_free_page(GFP_KERNEL);
-	if (!page)
-		return -ENOMEM;
+	if (!page) {
+		length = -ENOMEM;
+		goto out;
+	}
 
 	memset(page, 0, PAGE_SIZE);
 
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index aa1b54c47..f54ad88d4 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -290,7 +290,7 @@ int mls_context_to_sid(char oldc,
 		if (rc)
 			goto out;
 	}
-	*scontext = p;
+	*scontext = ++p;
 	rc = 0;
 out:
 	return rc;
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 7d0fedf04..21ab4c975 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -532,6 +532,11 @@ int security_context_to_sid(char *scontext, u32 scontext_len, u32 *sid)
 	if (rc)
 		goto out_unlock;
 
+	if ((p - scontext2) < scontext_len) {
+		rc = -EINVAL;
+		goto out_unlock;
+	}
+
 	/* Check the validity of the new context. */
 	if (!policydb_context_isvalid(&policydb, &context)) {
 		rc = -EINVAL;
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index d198e939a..59916802c 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -21,7 +21,7 @@
  *                              merged HAL layer (patches from Brian)
  */
 
-/* $Id: sa11xx-uda1341.c,v 1.13 2004/03/02 15:32:35 perex Exp $ */
+/* $Id: sa11xx-uda1341.c,v 1.15 2004/05/03 17:36:50 tiwai Exp $ */
 
 /***************************************************************************************************
 *
@@ -62,6 +62,7 @@
 #include <linux/config.h>
 #include <sound/driver.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/ioctl.h>
@@ -112,7 +113,7 @@ MODULE_DEVICES("{{UDA1341,iPAQ H3600 UDA1341TS}}");
 
 static char *id = NULL;	/* ID for this card */
 
-MODULE_PARM(id, "s");
+module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard.");
 
 #define chip_t sa11xx_uda1341_t
@@ -136,7 +137,6 @@ typedef struct audio_stream {
 }audio_stream_t;
 
 typedef struct snd_card_sa11xx_uda1341 {
-	struct pm_dev *pm_dev;        
 	snd_card_t *card;
 	struct l3_client *uda1341;
 	snd_pcm_t *pcm;
@@ -867,12 +867,10 @@ static int __init snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341_t *sa11xx_uda1341,
 
 #ifdef CONFIG_PM
 
-static void snd_sa11xx_uda1341_suspend(sa11xx_uda1341_t *chip)
+static int snd_sa11xx_uda1341_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	sa11xx_uda1341_t *chip = snd_magic_cast(sa11x_uda1341_t, card->pm_private_data, return -EINVAL);
 
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
 	snd_pcm_suspend_all(chip->pcm);
 #ifdef HH_VERSION	
 	sa1100_dma_sleep(chip->s[SNDRV_PCM_STREAM_PLAYBACK].dmach);
@@ -883,14 +881,13 @@ static void snd_sa11xx_uda1341_suspend(sa11xx_uda1341_t *chip)
 	l3_command(chip->uda1341, CMD_SUSPEND, NULL);
 	sa11xx_uda1341_audio_shutdown(chip);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void snd_sa11xx_uda1341_resume(sa11xx_uda1341_t *chip)
+static int snd_sa11xx_uda1341_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	sa11xx_uda1341_t *chip = snd_magic_cast(sa11x_uda1341_t, card->pm_private_data, return -EINVAL);
 
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
 	sa11xx_uda1341_audio_init(chip);
 	l3_command(chip->uda1341, CMD_RESUME, NULL);
 #ifdef HH_VERSION	
@@ -900,50 +897,14 @@ static void snd_sa11xx_uda1341_resume(sa11xx_uda1341_t *chip)
 	//FIXME
 #endif
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int sa11xx_uda1341_pm_callback(struct pm_dev *pm_dev, pm_request_t req, void *data)
-{
-	sa11xx_uda1341_t *chip = pm_dev->data;
-        
-	switch (req) {
-	case PM_SUSPEND: /* enter D1-D3 */
-		snd_sa11xx_uda1341_suspend(chip);
-		break;
-	case PM_RESUME:  /* enter D0 */
-		snd_sa11xx_uda1341_resume(chip);
-		break;
-	}
 	return 0;
 }
-
-static int sa11xx_uda1341_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	sa11xx_uda1341_t *chip = snd_magic_cast(sa11xx_uda1341_t, card->power_state_private_data, return);
-
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_sa11xx_uda1341_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_sa11xx_uda1341_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 #endif /* COMFIG_PM */
 
 void snd_sa11xx_uda1341_free(snd_card_t *card)
 {
 	sa11xx_uda1341_t *chip = snd_magic_cast(sa11xx_uda1341_t, card->private_data, return);
 
-	pm_unregister(chip->pm_dev);
 	audio_dma_free(&chip->s[SNDRV_PCM_STREAM_PLAYBACK]);
 	audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]);
 	sa11xx_uda1341 = NULL;
@@ -984,15 +945,10 @@ static int __init sa11xx_uda1341_init(void)
 	if ((err = snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341, 0)) < 0)
 		goto nodev;
         
-       
-#ifdef CONFIG_PM
-	card->power_state_private_data = sa11xx_uda1341;
-	card->set_power_state = sa11xx_uda1341_set_power_state;
-	sa11xx_uda1341->pm_dev = pm_register(PM_SYS_DEV, 0, sa11xx_uda1341_pm_callback);
-	if (sa11xx_uda1341->pm_dev)
-		sa11xx_uda1341->pm_dev->data = sa11xx_uda1341;
-#endif
-        
+	snd_card_set_dev_pm_callback(card, PM_SYS_DEV,
+				     snd_sa11xx_uda1341_suspend, snd_sa11_uda1341_resume,
+				     sa11xx_uda1341);
+
 	strcpy(card->driver, "UDA1341");
 	strcpy(card->shortname, "H3600 UDA1341TS");
 	sprintf(card->longname, "Compaq iPAQ H3600 with Philips UDA1341TS");
diff --git a/sound/core/Kconfig b/sound/core/Kconfig
index 4bf228801..732208bd5 100644
--- a/sound/core/Kconfig
+++ b/sound/core/Kconfig
@@ -1,8 +1,4 @@
 # ALSA soundcard-configuration
-config SND_BIT32_EMUL
-	tristate "Emulation for 32-bit applications"
-	depends on SND && SND_PCM && (SPARC64 || PPC64 || X86_64 && IA32_EMULATION)
-
 config SND_TIMER
 	tristate
 
@@ -59,6 +55,17 @@ config SND_SEQUENCER_OSS
 	  Say 'Y' to enable OSS sequencer emulation (both /dev/sequencer and
 	  /dev/music interfaces).
 
+config SND_BIT32_EMUL
+	tristate "Emulation for 32-bit applications"
+	depends on SND && (MIPS64 || SPARC64 || PPC64 || X86_64 && IA32_EMULATION)
+	select SND_PCM
+	select SND_RAWMIDI
+	select SND_TIMER
+	select SND_HWDEP
+	help
+	  Say 'Y' or 'M' to enable the emulation for 32-bit ALSA-native
+	  applications.
+
 config SND_RTCTIMER
 	tristate "RTC Timer support"
 	depends on SND && RTC
diff --git a/sound/core/control.c b/sound/core/control.c
index 7d2bdb77a..7cc19394d 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -512,7 +512,7 @@ snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
 }
 
 static int snd_ctl_card_info(snd_card_t * card, snd_ctl_file_t * ctl,
-			     unsigned int cmd, unsigned long arg)
+			     unsigned int cmd, void __user *arg)
 {
 	snd_ctl_card_info_t info;
 
@@ -526,12 +526,12 @@ static int snd_ctl_card_info(snd_card_t * card, snd_ctl_file_t * ctl,
 	strlcpy(info.mixername, card->mixername, sizeof(info.mixername));
 	strlcpy(info.components, card->components, sizeof(info.components));
 	up_read(&snd_ioctl_rwsem);
-	if (copy_to_user((void *) arg, &info, sizeof(snd_ctl_card_info_t)))
+	if (copy_to_user(arg, &info, sizeof(snd_ctl_card_info_t)))
 		return -EFAULT;
 	return 0;
 }
 
-static int snd_ctl_elem_list(snd_card_t *card, snd_ctl_elem_list_t *_list)
+static int snd_ctl_elem_list(snd_card_t *card, snd_ctl_elem_list_t __user *_list)
 {
 	struct list_head *plist;
 	snd_ctl_elem_list_t list;
@@ -593,7 +593,7 @@ static int snd_ctl_elem_list(snd_card_t *card, snd_ctl_elem_list_t *_list)
 	return 0;
 }
 
-static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t *_info)
+static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t __user *_info)
 {
 	snd_card_t *card = ctl->card;
 	snd_ctl_elem_info_t info;
@@ -636,7 +636,7 @@ static int snd_ctl_elem_info(snd_ctl_file_t *ctl, snd_ctl_elem_info_t *_info)
 	return result;
 }
 
-static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control)
+static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t __user *_control)
 {
 	snd_ctl_elem_value_t *control;
 	snd_kcontrol_t *kctl;
@@ -676,7 +676,7 @@ static int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *_control)
 	return result;
 }
 
-static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_control)
+static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t __user *_control)
 {
 	snd_card_t *card = file->card;
 	snd_ctl_elem_value_t *control;
@@ -726,7 +726,7 @@ static int snd_ctl_elem_write(snd_ctl_file_t *file, snd_ctl_elem_value_t *_contr
 	return result;
 }
 
-static int snd_ctl_elem_lock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
+static int snd_ctl_elem_lock(snd_ctl_file_t *file, snd_ctl_elem_id_t __user *_id)
 {
 	snd_card_t *card = file->card;
 	snd_ctl_elem_id_t id;
@@ -754,7 +754,7 @@ static int snd_ctl_elem_lock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
 	return result;
 }
 
-static int snd_ctl_elem_unlock(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
+static int snd_ctl_elem_unlock(snd_ctl_file_t *file, snd_ctl_elem_id_t __user *_id)
 {
 	snd_card_t *card = file->card;
 	snd_ctl_elem_id_t id;
@@ -840,7 +840,7 @@ static void snd_ctl_elem_user_free(snd_kcontrol_t * kcontrol)
 	kfree(kcontrol->private_data);
 }
 
-static int snd_ctl_elem_add(snd_ctl_file_t *file, snd_ctl_elem_info_t *_info, int replace)
+static int snd_ctl_elem_add(snd_ctl_file_t *file, snd_ctl_elem_info_t __user *_info, int replace)
 {
 	snd_card_t *card = file->card;
 	snd_ctl_elem_info_t info;
@@ -965,7 +965,7 @@ static int snd_ctl_elem_add(snd_ctl_file_t *file, snd_ctl_elem_info_t *_info, in
 	return 0;
 }
 
-static int snd_ctl_elem_remove(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
+static int snd_ctl_elem_remove(snd_ctl_file_t *file, snd_ctl_elem_id_t __user *_id)
 {
 	snd_ctl_elem_id_t id;
 
@@ -974,7 +974,7 @@ static int snd_ctl_elem_remove(snd_ctl_file_t *file, snd_ctl_elem_id_t *_id)
 	return snd_ctl_remove_unlocked_id(file, &id);
 }
 
-static int snd_ctl_subscribe_events(snd_ctl_file_t *file, int *ptr)
+static int snd_ctl_subscribe_events(snd_ctl_file_t *file, int __user *ptr)
 {
 	int subscribe;
 	if (get_user(subscribe, ptr))
@@ -995,6 +995,33 @@ static int snd_ctl_subscribe_events(snd_ctl_file_t *file, int *ptr)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+/*
+ * change the power state
+ */
+static int snd_ctl_set_power_state(snd_card_t *card, unsigned int power_state)
+{
+	switch (power_state) {
+	case SNDRV_CTL_POWER_D0:
+	case SNDRV_CTL_POWER_D1:
+	case SNDRV_CTL_POWER_D2:
+		if (card->power_state != power_state)
+			/* FIXME: pass the correct state value */
+			card->pm_resume(card, 0);
+		break;
+	case SNDRV_CTL_POWER_D3hot:
+	case SNDRV_CTL_POWER_D3cold:
+		if (card->power_state != power_state)
+			/* FIXME: pass the correct state value */
+			card->pm_suspend(card, 0);
+		break;
+	default:
+		return -EINVAL;
+	}
+	return 0;
+}
+#endif
+
 static int snd_ctl_ioctl(struct inode *inode, struct file *file,
 			 unsigned int cmd, unsigned long arg)
 {
@@ -1002,6 +1029,8 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file,
 	snd_card_t *card;
 	struct list_head *list;
 	snd_kctl_ioctl_t *p;
+	void __user *argp = (void __user *)arg;
+	int __user *ip = argp;
 	int err;
 
 	ctl = snd_magic_cast(snd_ctl_file_t, file->private_data, return -ENXIO);
@@ -1009,38 +1038,38 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file,
 	snd_assert(card != NULL, return -ENXIO);
 	switch (cmd) {
 	case SNDRV_CTL_IOCTL_PVERSION:
-		return put_user(SNDRV_CTL_VERSION, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_CTL_VERSION, ip) ? -EFAULT : 0;
 	case SNDRV_CTL_IOCTL_CARD_INFO:
-		return snd_ctl_card_info(card, ctl, cmd, arg);
+		return snd_ctl_card_info(card, ctl, cmd, argp);
 	case SNDRV_CTL_IOCTL_ELEM_LIST:
-		return snd_ctl_elem_list(ctl->card, (snd_ctl_elem_list_t *) arg);
+		return snd_ctl_elem_list(ctl->card, argp);
 	case SNDRV_CTL_IOCTL_ELEM_INFO:
-		return snd_ctl_elem_info(ctl, (snd_ctl_elem_info_t *) arg);
+		return snd_ctl_elem_info(ctl, argp);
 	case SNDRV_CTL_IOCTL_ELEM_READ:
-		return snd_ctl_elem_read(ctl->card, (snd_ctl_elem_value_t *) arg);
+		return snd_ctl_elem_read(ctl->card, argp);
 	case SNDRV_CTL_IOCTL_ELEM_WRITE:
-		return snd_ctl_elem_write(ctl, (snd_ctl_elem_value_t *) arg);
+		return snd_ctl_elem_write(ctl, argp);
 	case SNDRV_CTL_IOCTL_ELEM_LOCK:
-		return snd_ctl_elem_lock(ctl, (snd_ctl_elem_id_t *) arg);
+		return snd_ctl_elem_lock(ctl, argp);
 	case SNDRV_CTL_IOCTL_ELEM_UNLOCK:
-		return snd_ctl_elem_unlock(ctl, (snd_ctl_elem_id_t *) arg);
+		return snd_ctl_elem_unlock(ctl, argp);
 	case SNDRV_CTL_IOCTL_ELEM_ADD:
-		return snd_ctl_elem_add(ctl, (snd_ctl_elem_info_t *) arg, 0);
+		return snd_ctl_elem_add(ctl, argp, 0);
 	case SNDRV_CTL_IOCTL_ELEM_REPLACE:
-		return snd_ctl_elem_add(ctl, (snd_ctl_elem_info_t *) arg, 1);
+		return snd_ctl_elem_add(ctl, argp, 1);
 	case SNDRV_CTL_IOCTL_ELEM_REMOVE:
-		return snd_ctl_elem_remove(ctl, (snd_ctl_elem_id_t *) arg);
+		return snd_ctl_elem_remove(ctl, argp);
 	case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS:
-		return snd_ctl_subscribe_events(ctl, (int *) arg);
+		return snd_ctl_subscribe_events(ctl, ip);
 	case SNDRV_CTL_IOCTL_POWER:
-		if (get_user(err, (int *)arg))
+		if (get_user(err, ip))
 			return -EFAULT;
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 #ifdef CONFIG_PM
-		if (card->set_power_state) {
+		if (card->pm_suspend && card->pm_resume) {
 			snd_power_lock(card);
-			err = card->set_power_state(card, err);
+			err = snd_ctl_set_power_state(card, err);
 			snd_power_unlock(card);
 		} else
 #endif
@@ -1048,9 +1077,9 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file,
 		return err;
 	case SNDRV_CTL_IOCTL_POWER_STATE:
 #ifdef CONFIG_PM
-		return put_user(card->power_state, (int *)arg) ? -EFAULT : 0;
+		return put_user(card->power_state, ip) ? -EFAULT : 0;
 #else
-		return put_user(SNDRV_CTL_POWER_D0, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_CTL_POWER_D0, ip) ? -EFAULT : 0;
 #endif
 	}
 	down_read(&snd_ioctl_rwsem);
@@ -1067,7 +1096,7 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file,
 	return -ENOTTY;
 }
 
-static ssize_t snd_ctl_read(struct file *file, char *buffer, size_t count, loff_t * offset)
+static ssize_t snd_ctl_read(struct file *file, char __user *buffer, size_t count, loff_t * offset)
 {
 	snd_ctl_file_t *ctl;
 	int err = 0;
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 33d7603f9..d18e4769d 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -55,7 +55,7 @@ static loff_t snd_hwdep_llseek(struct file * file, loff_t offset, int orig)
 	return -ENXIO;
 }
 
-static ssize_t snd_hwdep_read(struct file * file, char *buf, size_t count, loff_t *offset)
+static ssize_t snd_hwdep_read(struct file * file, char __user *buf, size_t count, loff_t *offset)
 {
 	snd_hwdep_t *hw = snd_magic_cast(snd_hwdep_t, file->private_data, return -ENXIO);
 	if (hw->ops.read)
@@ -63,7 +63,7 @@ static ssize_t snd_hwdep_read(struct file * file, char *buf, size_t count, loff_
 	return -ENXIO;	
 }
 
-static ssize_t snd_hwdep_write(struct file * file, const char *buf, size_t count, loff_t *offset)
+static ssize_t snd_hwdep_write(struct file * file, const char __user *buf, size_t count, loff_t *offset)
 {
 	snd_hwdep_t *hw = snd_magic_cast(snd_hwdep_t, file->private_data, return -ENXIO);
 	if (hw->ops.write)
@@ -179,7 +179,7 @@ static unsigned int snd_hwdep_poll(struct file * file, poll_table * wait)
 	return 0;
 }
 
-static int snd_hwdep_info(snd_hwdep_t *hw, snd_hwdep_info_t *_info)
+static int snd_hwdep_info(snd_hwdep_t *hw, snd_hwdep_info_t __user *_info)
 {
 	snd_hwdep_info_t info;
 	
@@ -193,7 +193,7 @@ static int snd_hwdep_info(snd_hwdep_t *hw, snd_hwdep_info_t *_info)
 	return 0;
 }
 
-static int snd_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *_info)
+static int snd_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t __user *_info)
 {
 	snd_hwdep_dsp_status_t info;
 	int err;
@@ -209,7 +209,7 @@ static int snd_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *_info)
 	return 0;
 }
 
-static int snd_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *_info)
+static int snd_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t __user *_info)
 {
 	snd_hwdep_dsp_image_t info;
 	int err;
@@ -235,15 +235,16 @@ static int snd_hwdep_ioctl(struct inode *inode, struct file * file,
 			   unsigned int cmd, unsigned long arg)
 {
 	snd_hwdep_t *hw = snd_magic_cast(snd_hwdep_t, file->private_data, return -ENXIO);
+	void __user *argp = (void __user *)arg;
 	switch (cmd) {
 	case SNDRV_HWDEP_IOCTL_PVERSION:
-		return put_user(SNDRV_HWDEP_VERSION, (int *)arg);
+		return put_user(SNDRV_HWDEP_VERSION, (int __user *)argp);
 	case SNDRV_HWDEP_IOCTL_INFO:
-		return snd_hwdep_info(hw, (snd_hwdep_info_t *)arg);
+		return snd_hwdep_info(hw, argp);
 	case SNDRV_HWDEP_IOCTL_DSP_STATUS:
-		return snd_hwdep_dsp_status(hw, (snd_hwdep_dsp_status_t *)arg);
+		return snd_hwdep_dsp_status(hw, argp);
 	case SNDRV_HWDEP_IOCTL_DSP_LOAD:
-		return snd_hwdep_dsp_load(hw, (snd_hwdep_dsp_image_t *)arg);
+		return snd_hwdep_dsp_load(hw, argp);
 	}
 	if (hw->ops.ioctl)
 		return hw->ops.ioctl(hw, file, cmd, arg);
@@ -269,7 +270,7 @@ static int snd_hwdep_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
 		{
 			int device;
 
-			if (get_user(device, (int *)arg))
+			if (get_user(device, (int __user *)arg))
 				return -EFAULT;
 			device = device < 0 ? 0 : device + 1;
 			while (device < SNDRV_MINOR_HWDEPS) {
@@ -279,13 +280,13 @@ static int snd_hwdep_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
 			}
 			if (device >= SNDRV_MINOR_HWDEPS)
 				device = -1;
-			if (put_user(device, (int *)arg))
+			if (put_user(device, (int __user *)arg))
 				return -EFAULT;
 			return 0;
 		}
 	case SNDRV_CTL_IOCTL_HWDEP_INFO:
 		{
-			snd_hwdep_info_t *info = (snd_hwdep_info_t *)arg;
+			snd_hwdep_info_t __user *info = (snd_hwdep_info_t __user *)arg;
 			int device;
 			snd_hwdep_t *hwdep;
 
diff --git a/sound/core/info.c b/sound/core/info.c
index fadd47112..0b08203d5 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -174,7 +174,7 @@ out:
 	return ret;
 }
 
-static ssize_t snd_info_entry_read(struct file *file, char *buffer,
+static ssize_t snd_info_entry_read(struct file *file, char __user *buffer,
 				   size_t count, loff_t * offset)
 {
 	snd_info_private_data_t *data;
@@ -208,7 +208,7 @@ static ssize_t snd_info_entry_read(struct file *file, char *buffer,
 	return size;
 }
 
-static ssize_t snd_info_entry_write(struct file *file, const char *buffer,
+static ssize_t snd_info_entry_write(struct file *file, const char __user *buffer,
 				    size_t count, loff_t * offset)
 {
 	snd_info_private_data_t *data;
diff --git a/sound/core/init.c b/sound/core/init.c
index 115065061..9c3df614a 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -26,6 +26,8 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/ctype.h>
+#include <linux/pci.h>
+#include <linux/pm.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/info.h>
@@ -254,6 +256,12 @@ int snd_card_free(snd_card_t * card)
 
 #ifdef CONFIG_PM
 	wake_up(&card->power_sleep);
+#ifdef CONFIG_ISA
+	if (card->pm_dev) {
+		pm_unregister(card->pm_dev);
+		card->pm_dev = NULL;
+	}
+#endif
 #endif
 
 	/* wait, until all devices are ready for the free operation */
@@ -708,4 +716,93 @@ int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file
 	remove_wait_queue(&card->power_sleep, &wait);
 	return result;
 }
+
+/**
+ * snd_card_set_pm_callback - set the PCI power-management callbacks
+ * @card: soundcard structure
+ * @suspend: suspend callback function
+ * @resume: resume callback function
+ * @private_data: private data to pass to the callback functions
+ *
+ * Sets the power-management callback functions of the card.
+ * These callbacks are called from ALSA's common PCI suspend/resume
+ * handler and from the control API.
+ */
+int snd_card_set_pm_callback(snd_card_t *card,
+			     int (*suspend)(snd_card_t *, unsigned int),
+			     int (*resume)(snd_card_t *, unsigned int),
+			     void *private_data)
+{
+	card->pm_suspend = suspend;
+	card->pm_resume = resume;
+	card->pm_private_data = private_data;
+	return 0;
+}
+
+static int snd_generic_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+	snd_card_t *card = dev->data;
+
+	switch (rqst) {
+	case PM_SUSPEND:
+		/* FIXME: the correct state value? */
+		card->pm_suspend(card, 0);
+		break;
+	case PM_RESUME:
+		/* FIXME: the correct state value? */
+		card->pm_resume(card, 0);
+		break;
+	}
+	return 0;
+}
+
+/**
+ * snd_card_set_dev_pm_callback - set the generic power-management callbacks
+ * @card: soundcard structure
+ * @type: PM device type (PM_XXX)
+ * @suspend: suspend callback function
+ * @resume: resume callback function
+ * @private_data: private data to pass to the callback functions
+ *
+ * Registers the power-management and sets the lowlevel callbacks for
+ * the given card with the given PM type.  These callbacks are called
+ * from the ALSA's common PM handler and from the control API.
+ */
+int snd_card_set_dev_pm_callback(snd_card_t *card, int type,
+				 int (*suspend)(snd_card_t *, unsigned int),
+				 int (*resume)(snd_card_t *, unsigned int),
+				 void *private_data)
+{
+	card->pm_dev = pm_register(type, 0, snd_generic_pm_callback);
+	if (! card->pm_dev)
+		return -ENOMEM;
+	card->pm_dev->data = card;
+	snd_card_set_pm_callback(card, suspend, resume, private_data);
+	return 0;
+}
+
+#ifdef CONFIG_PCI
+int snd_card_pci_suspend(struct pci_dev *dev, u32 state)
+{
+	snd_card_t *card = pci_get_drvdata(dev);
+	if (! card || ! card->pm_suspend)
+		return 0;
+	if (card->power_state == SNDRV_CTL_POWER_D3hot)
+		return 0;
+	/* FIXME: correct state value? */
+	return card->pm_suspend(card, 0);
+}
+
+int snd_card_pci_resume(struct pci_dev *dev)
+{
+	snd_card_t *card = pci_get_drvdata(dev);
+	if (! card || ! card->pm_resume)
+		return 0;
+	if (card->power_state == SNDRV_CTL_POWER_D0)
+		return 0;
+	/* FIXME: correct state value? */
+	return card->pm_resume(card, 0);
+}
+#endif
+
 #endif /* CONFIG_PM */
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index c5f6bc1d7..3cf091774 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
+#include <linux/moduleparam.h>
 #include <asm/semaphore.h>
 #include <sound/memalloc.h>
 #ifdef CONFIG_SBUS
@@ -45,7 +46,8 @@ MODULE_LICENSE("GPL");
 #define SNDRV_CARDS	8
 #endif
 static int enable[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+static int boot_devs;
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable cards to allocate buffers.");
 
 /*
@@ -89,32 +91,7 @@ struct snd_mem_list {
  *  Hacks
  */
 
-static void *snd_dma_alloc_coherent1(struct device *dev, size_t size,
-				     dma_addr_t *dma_handle, int flags)
-{
-	if (dev)
-		return dma_alloc_coherent(dev, size, dma_handle, flags);
-	else /* FIXME: dma_alloc_coherent does't always accept dev=NULL */
-		return pci_alloc_consistent(NULL, size, dma_handle);
-}
-
-static void snd_dma_free_coherent1(struct device *dev, size_t size, void *dma_addr,
-				   dma_addr_t dma_handle)
-{
-	if (dev)
-		return dma_free_coherent(dev, size, dma_addr, dma_handle);
-	else
-		return pci_free_consistent(NULL, size, dma_addr, dma_handle);
-}
-
-#undef dma_alloc_coherent
-#define dma_alloc_coherent snd_dma_alloc_coherent1
-#undef dma_free_coherent
-#define dma_free_coherent snd_dma_free_coherent1
-
-
 #if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
-
 /*
  * A hack to allocate large buffers via dma_alloc_coherent()
  *
@@ -135,14 +112,17 @@ static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size,
 					 dma_addr_t *dma_handle, int flags)
 {
 	void *ret;
-	u64 dma_mask;
+	u64 dma_mask, coherent_dma_mask;
 
 	if (dev == NULL || !dev->dma_mask)
 		return dma_alloc_coherent(dev, size, dma_handle, flags);
 	dma_mask = *dev->dma_mask;
+	coherent_dma_mask = dev->coherent_dma_mask;
 	*dev->dma_mask = 0xffffffff; 	/* do without masking */
+	dev->coherent_dma_mask = 0xffffffff; 	/* do without masking */
 	ret = dma_alloc_coherent(dev, size, dma_handle, flags);
 	*dev->dma_mask = dma_mask;	/* restore */
+	dev->coherent_dma_mask = coherent_dma_mask;	/* restore */
 	if (ret) {
 		/* obtained address is out of range? */
 		if (((unsigned long)*dma_handle + size - 1) & ~dma_mask) {
@@ -152,8 +132,12 @@ static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size,
 		}
 	} else {
 		/* wish to success now with the proper mask... */
-		if (dma_mask != 0xffffffffUL)
+		if (dma_mask != 0xffffffffUL) {
+			/* allocation with GFP_ATOMIC to avoid the long stall */
+			flags &= ~GFP_KERNEL;
+			flags |= GFP_ATOMIC;
 			ret = dma_alloc_coherent(dev, size, dma_handle, flags);
+		}
 	}
 	return ret;
 }
@@ -842,25 +826,6 @@ module_init(snd_mem_init)
 module_exit(snd_mem_exit)
 
 
-#ifndef MODULE
-
-/* format is: snd-page-alloc=enable */
-
-static int __init snd_mem_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-page-alloc=", snd_mem_setup);
-
-#endif
-
 /*
  * exports
  */
diff --git a/sound/core/memory.c b/sound/core/memory.c
index 1f8c8d934..cf4f75cec 100644
--- a/sound/core/memory.c
+++ b/sound/core/memory.c
@@ -307,7 +307,7 @@ char *snd_kmalloc_strdup(const char *string, int flags)
  *
  * Returns zero if successful, or non-zero on failure.
  */
-int copy_to_user_fromio(void *dst, unsigned long src, size_t count)
+int copy_to_user_fromio(void __user *dst, unsigned long src, size_t count)
 {
 #if defined(__i386__) || defined(CONFIG_SPARC32)
 	return copy_to_user(dst, (const void*)src, count) ? -EFAULT : 0;
@@ -338,7 +338,7 @@ int copy_to_user_fromio(void *dst, unsigned long src, size_t count)
  *
  * Returns zero if successful, or non-zero on failure.
  */
-int copy_from_user_toio(unsigned long dst, const void *src, size_t count)
+int copy_from_user_toio(unsigned long dst, const void __user *src, size_t count)
 {
 #if defined(__i386__) || defined(CONFIG_SPARC32)
 	return copy_from_user((void*)dst, src, count) ? -EFAULT : 0;
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 8e7efafee..d8359d301 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -81,7 +81,7 @@ static int snd_mixer_oss_release(struct inode *inode, struct file *file)
 }
 
 static int snd_mixer_oss_info(snd_mixer_oss_file_t *fmixer,
-			      mixer_info *_info)
+			      mixer_info __user *_info)
 {
 	snd_card_t *card = fmixer->card;
 	snd_mixer_oss_t *mixer = fmixer->mixer;
@@ -97,7 +97,7 @@ static int snd_mixer_oss_info(snd_mixer_oss_file_t *fmixer,
 }
 
 static int snd_mixer_oss_info_obsolete(snd_mixer_oss_file_t *fmixer,
-				       _old_mixer_info *_info)
+				       _old_mixer_info __user *_info)
 {
 	snd_card_t *card = fmixer->card;
 	snd_mixer_oss_t *mixer = fmixer->mixer;
@@ -293,65 +293,67 @@ static int snd_mixer_oss_set_volume(snd_mixer_oss_file_t *fmixer,
 
 static int snd_mixer_oss_ioctl1(snd_mixer_oss_file_t *fmixer, unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	int tmp;
 
 	snd_assert(fmixer != NULL, return -ENXIO);
 	if (((cmd >> 8) & 0xff) == 'M') {
 		switch (cmd) {
 		case SOUND_MIXER_INFO:
-			return snd_mixer_oss_info(fmixer, (mixer_info *)arg);
+			return snd_mixer_oss_info(fmixer, argp);
 		case SOUND_OLD_MIXER_INFO:
- 			return snd_mixer_oss_info_obsolete(fmixer, (_old_mixer_info *)arg);
+ 			return snd_mixer_oss_info_obsolete(fmixer, argp);
 		case SOUND_MIXER_WRITE_RECSRC:
-			if (get_user(tmp, (int *)arg))
+			if (get_user(tmp, p))
 				return -EFAULT;
 			tmp = snd_mixer_oss_set_recsrc(fmixer, tmp);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg);
+			return put_user(tmp, p);
 		case OSS_GETVERSION:
-			return put_user(SNDRV_OSS_VERSION, (int *) arg);
+			return put_user(SNDRV_OSS_VERSION, p);
 		case OSS_ALSAEMULVER:
-			return put_user(1, (int *) arg);
+			return put_user(1, p);
 		case SOUND_MIXER_READ_DEVMASK:
 			tmp = snd_mixer_oss_devmask(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg);
+			return put_user(tmp, p);
 		case SOUND_MIXER_READ_STEREODEVS:
 			tmp = snd_mixer_oss_stereodevs(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg);
+			return put_user(tmp, p);
 		case SOUND_MIXER_READ_RECMASK:
 			tmp = snd_mixer_oss_recmask(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg);
+			return put_user(tmp, p);
 		case SOUND_MIXER_READ_CAPS:
 			tmp = snd_mixer_oss_caps(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg);
+			return put_user(tmp, p);
 		case SOUND_MIXER_READ_RECSRC:
 			tmp = snd_mixer_oss_get_recsrc(fmixer);
 			if (tmp < 0)
 				return tmp;
-			return put_user(tmp, (int *)arg);
+			return put_user(tmp, p);
 		}
 	}
 	if (cmd & SIOC_IN) {
-		if (get_user(tmp, (int *)arg))
+		if (get_user(tmp, p))
 			return -EFAULT;
 		tmp = snd_mixer_oss_set_volume(fmixer, cmd & 0xff, tmp);
 		if (tmp < 0)
 			return tmp;
-		return put_user(tmp, (int *)arg);
+		return put_user(tmp, p);
 	} else if (cmd & SIOC_OUT) {
 		tmp = snd_mixer_oss_get_volume(fmixer, cmd & 0xff);
 		if (tmp < 0)
 			return tmp;
-		return put_user(tmp, (int *)arg);
+		return put_user(tmp, p);
 	}
 	return -ENXIO;
 }
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index ceb459b26..65b5017e4 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/vmalloc.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/minors.h>
 #include <sound/pcm.h>
@@ -45,17 +46,18 @@
 static int dsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
 static int adsp_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
 static int nonblock_open;
+static int boot_devs;
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Abramo Bagnara <abramo@alsa-project.org>");
 MODULE_DESCRIPTION("PCM OSS emulation for ALSA.");
 MODULE_LICENSE("GPL");
-MODULE_PARM(dsp_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dsp_map, int, boot_devs, 0444);
 MODULE_PARM_DESC(dsp_map, "PCM device number assigned to 1st OSS device.");
 MODULE_PARM_SYNTAX(dsp_map, "default:0,skill:advanced");
-MODULE_PARM(adsp_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(adsp_map, int, boot_devs, 0444);
 MODULE_PARM_DESC(adsp_map, "PCM device number assigned to 2nd OSS device.");
 MODULE_PARM_SYNTAX(adsp_map, "default:1,skill:advanced");
-MODULE_PARM(nonblock_open, "i");
+module_param(nonblock_open, bool, 0644);
 MODULE_PARM_DESC(nonblock_open, "Don't block opening busy PCM devices.");
 MODULE_PARM_SYNTAX(nonblock_open, "default:0,skill:advanced");
 MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM);
@@ -804,7 +806,7 @@ static ssize_t snd_pcm_oss_write2(snd_pcm_substream_t *substream, const char *bu
 	return bytes;
 }
 
-static ssize_t snd_pcm_oss_write1(snd_pcm_substream_t *substream, const char *buf, size_t bytes)
+static ssize_t snd_pcm_oss_write1(snd_pcm_substream_t *substream, const char __user *buf, size_t bytes)
 {
 	size_t xfer = 0;
 	ssize_t tmp;
@@ -881,7 +883,7 @@ static ssize_t snd_pcm_oss_read2(snd_pcm_substream_t *substream, char *buf, size
 	return bytes;
 }
 
-static ssize_t snd_pcm_oss_read1(snd_pcm_substream_t *substream, char *buf, size_t bytes)
+static ssize_t snd_pcm_oss_read1(snd_pcm_substream_t *substream, char __user *buf, size_t bytes)
 {
 	size_t xfer = 0;
 	ssize_t tmp;
@@ -1065,9 +1067,9 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
 					snd_pcm_lib_write(substream, runtime->oss.buffer, size1);
 				}
 			} else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) {
-				void *buffers[runtime->channels];
+				void __user *buffers[runtime->channels];
 				memset(buffers, 0, runtime->channels * sizeof(void *));
-				snd_pcm_lib_writev(substream, (void **)buffers, size);
+				snd_pcm_lib_writev(substream, buffers, size);
 			}
 		}
 		/*
@@ -1466,7 +1468,7 @@ static int snd_pcm_oss_get_odelay(snd_pcm_oss_file_t *pcm_oss_file)
 	return snd_pcm_oss_bytes(substream, delay);
 }
 
-static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, struct count_info * _info)
+static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, struct count_info __user * _info)
 {	
 	snd_pcm_substream_t *substream;
 	snd_pcm_runtime_t *runtime;
@@ -1514,21 +1516,21 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str
 		runtime->oss.prev_hw_ptr_interrupt = delay;
 		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 			snd_pcm_oss_simulate_fill(substream, delay);
-		info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr);
+		info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX;
 	} else {
 		delay = snd_pcm_oss_bytes(substream, delay) + fixup;
 		info.blocks = delay / runtime->oss.period_bytes;
 		if (stream == SNDRV_PCM_STREAM_PLAYBACK)
-			info.bytes = runtime->oss.bytes - delay;
+			info.bytes = (runtime->oss.bytes - delay) & INT_MAX;
 		else
-			info.bytes = runtime->oss.bytes + delay;
+			info.bytes = (runtime->oss.bytes + delay) & INT_MAX;
 	}
 	if (copy_to_user(_info, &info, sizeof(info)))
 		return -EFAULT;
 	return 0;
 }
 
-static int snd_pcm_oss_get_space(snd_pcm_oss_file_t *pcm_oss_file, int stream, struct audio_buf_info *_info)
+static int snd_pcm_oss_get_space(snd_pcm_oss_file_t *pcm_oss_file, int stream, struct audio_buf_info __user *_info)
 {
 	snd_pcm_substream_t *substream;
 	snd_pcm_runtime_t *runtime;
@@ -1587,7 +1589,7 @@ static int snd_pcm_oss_get_space(snd_pcm_oss_file_t *pcm_oss_file, int stream, s
 	return 0;
 }
 
-static int snd_pcm_oss_get_mapbuf(snd_pcm_oss_file_t *pcm_oss_file, int stream, struct buffmem_desc * _info)
+static int snd_pcm_oss_get_mapbuf(snd_pcm_oss_file_t *pcm_oss_file, int stream, struct buffmem_desc __user * _info)
 {
 	// it won't be probably implemented
 	// snd_printd("TODO: snd_pcm_oss_get_mapbuf\n");
@@ -1910,13 +1912,14 @@ static int snd_pcm_oss_ioctl(struct inode *inode, struct file *file,
                              unsigned int cmd, unsigned long arg)
 {
 	snd_pcm_oss_file_t *pcm_oss_file;
+	int __user *p = (int __user *)arg;
 	int res;
 
 	pcm_oss_file = snd_magic_cast(snd_pcm_oss_file_t, file->private_data, return -ENXIO);
 	if (cmd == OSS_GETVERSION)
-		return put_user(SNDRV_OSS_VERSION, (int *)arg);
+		return put_user(SNDRV_OSS_VERSION, p);
 	if (cmd == OSS_ALSAEMULVER)
-		return put_user(1, (int *)arg);
+		return put_user(1, p);
 #if defined(CONFIG_SND_MIXER_OSS) || (defined(MODULE) && defined(CONFIG_SND_MIXER_OSS_MODULE))
 	if (((cmd >> 8) & 0xff) == 'M')	{	/* mixer ioctl - for OSS compatibility */
 		snd_pcm_substream_t *substream;
@@ -1941,93 +1944,93 @@ static int snd_pcm_oss_ioctl(struct inode *inode, struct file *file,
 	case SNDCTL_DSP_SYNC:
 		return snd_pcm_oss_sync(pcm_oss_file);
 	case SNDCTL_DSP_SPEED:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		if ((res = snd_pcm_oss_set_rate(pcm_oss_file, res))<0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SOUND_PCM_READ_RATE:
 		res = snd_pcm_oss_get_rate(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_STEREO:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		res = res > 0 ? 2 : 1;
 		if ((res = snd_pcm_oss_set_channels(pcm_oss_file, res)) < 0)
 			return res;
-		return put_user(--res, (int *)arg);
+		return put_user(--res, p);
 	case SNDCTL_DSP_GETBLKSIZE:
 		res = snd_pcm_oss_get_block_size(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_SETFMT:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		res = snd_pcm_oss_set_format(pcm_oss_file, res);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SOUND_PCM_READ_BITS:
 		res = snd_pcm_oss_get_format(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		res = snd_pcm_oss_set_channels(pcm_oss_file, res);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SOUND_PCM_READ_CHANNELS:
 		res = snd_pcm_oss_get_channels(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SOUND_PCM_WRITE_FILTER:
 	case SOUND_PCM_READ_FILTER:
 		return -EIO;
 	case SNDCTL_DSP_POST:
 		return snd_pcm_oss_post(pcm_oss_file);
 	case SNDCTL_DSP_SUBDIVIDE:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		res = snd_pcm_oss_set_subdivide(pcm_oss_file, res);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		return snd_pcm_oss_set_fragment(pcm_oss_file, res);
 	case SNDCTL_DSP_GETFMTS:
 		res = snd_pcm_oss_get_formats(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_GETOSPACE:
 	case SNDCTL_DSP_GETISPACE:
 		return snd_pcm_oss_get_space(pcm_oss_file,
 			cmd == SNDCTL_DSP_GETISPACE ?
 				SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK,
-			(struct audio_buf_info *) arg);
+			(struct audio_buf_info __user *) arg);
 	case SNDCTL_DSP_NONBLOCK:
 		return snd_pcm_oss_nonblock(file);
 	case SNDCTL_DSP_GETCAPS:
 		res = snd_pcm_oss_get_caps(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_GETTRIGGER:
 		res = snd_pcm_oss_get_trigger(pcm_oss_file);
 		if (res < 0)
 			return res;
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(res, (int *)arg))
+		if (get_user(res, p))
 			return -EFAULT;
 		return snd_pcm_oss_set_trigger(pcm_oss_file, res);
 	case SNDCTL_DSP_GETIPTR:
@@ -2035,13 +2038,13 @@ static int snd_pcm_oss_ioctl(struct inode *inode, struct file *file,
 		return snd_pcm_oss_get_ptr(pcm_oss_file,
 			cmd == SNDCTL_DSP_GETIPTR ?
 				SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK,
-			(struct count_info *) arg);
+			(struct count_info __user *) arg);
 	case SNDCTL_DSP_MAPINBUF:
 	case SNDCTL_DSP_MAPOUTBUF:
 		return snd_pcm_oss_get_mapbuf(pcm_oss_file,
 			cmd == SNDCTL_DSP_MAPINBUF ?
 				SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK,
-			(struct buffmem_desc *) arg);
+			(struct buffmem_desc __user *) arg);
 	case SNDCTL_DSP_SETSYNCRO:
 		/* stop DMA now.. */
 		return 0;
@@ -2053,10 +2056,10 @@ static int snd_pcm_oss_ioctl(struct inode *inode, struct file *file,
 		res = snd_pcm_oss_get_odelay(pcm_oss_file);
 		if (res < 0) {
 			/* it's for sure, some broken apps don't check for error codes */
-			put_user(0, (int *)arg);
+			put_user(0, p);
 			return res;
 		}
-		return put_user(res, (int *)arg);
+		return put_user(res, p);
 	case SNDCTL_DSP_PROFILE:
 		return 0;	/* silently ignore */
 	default:
@@ -2065,7 +2068,7 @@ static int snd_pcm_oss_ioctl(struct inode *inode, struct file *file,
 	return -EINVAL;
 }
 
-static ssize_t snd_pcm_oss_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t snd_pcm_oss_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	snd_pcm_oss_file_t *pcm_oss_file;
 	snd_pcm_substream_t *substream;
@@ -2085,7 +2088,7 @@ static ssize_t snd_pcm_oss_read(struct file *file, char *buf, size_t count, loff
 #endif
 }
 
-static ssize_t snd_pcm_oss_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+static ssize_t snd_pcm_oss_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
 	snd_pcm_oss_file_t *pcm_oss_file;
 	snd_pcm_substream_t *substream;
@@ -2510,24 +2513,3 @@ static void __exit alsa_pcm_oss_exit(void)
 
 module_init(alsa_pcm_oss_init)
 module_exit(alsa_pcm_oss_exit)
-
-#ifndef MODULE
-
-/* format is: snd-pcm-oss=dsp_map,adsp_map[,nonblock_open] */
-
-static int __init alsa_pcm_oss_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&dsp_map[nr_dev]) == 2 &&
-	       get_option(&str,&adsp_map[nr_dev]) == 2);
-	(void)(get_option(&str,&nonblock_open) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-pcm-oss=", alsa_pcm_oss_setup);
-
-#endif /* !MODULE */
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 4f879747d..7f1bf94e0 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -55,7 +55,7 @@ static int snd_pcm_control_ioctl(snd_card_t * card,
 		{
 			int device;
 
-			if (get_user(device, (int *)arg))
+			if (get_user(device, (int __user *)arg))
 				return -EFAULT;
 			device = device < 0 ? 0 : device + 1;
 			while (device < SNDRV_PCM_DEVICES) {
@@ -65,18 +65,19 @@ static int snd_pcm_control_ioctl(snd_card_t * card,
 			}
 			if (device == SNDRV_PCM_DEVICES)
 				device = -1;
-			if (put_user(device, (int *)arg))
+			if (put_user(device, (int __user *)arg))
 				return -EFAULT;
 			return 0;
 		}
 	case SNDRV_CTL_IOCTL_PCM_INFO:
 		{
-			snd_pcm_info_t *info = (snd_pcm_info_t *)arg;
+			snd_pcm_info_t __user *info;
 			unsigned int device, subdevice;
 			snd_pcm_stream_t stream;
 			snd_pcm_t *pcm;
 			snd_pcm_str_t *pstr;
 			snd_pcm_substream_t *substream;
+			info = (snd_pcm_info_t __user *)arg;
 			if (get_user(device, &info->device))
 				return -EFAULT;
 			if (device >= SNDRV_PCM_DEVICES)
@@ -106,7 +107,7 @@ static int snd_pcm_control_ioctl(snd_card_t * card,
 		{
 			int val;
 			
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user *)arg))
 				return -EFAULT;
 			control->prefer_pcm_subdevice = val;
 			return 0;
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 49ab38418..61d1c38fb 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2049,12 +2049,12 @@ void snd_pcm_period_elapsed(snd_pcm_substream_t *substream)
 
 static int snd_pcm_lib_write_transfer(snd_pcm_substream_t *substream,
 				      unsigned int hwoff,
-				      void *data, unsigned int off,
+				      unsigned long data, unsigned int off,
 				      snd_pcm_uframes_t frames)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
-	char *buf = (char *) data + frames_to_bytes(runtime, off);
+	char __user *buf = (char __user *) data + frames_to_bytes(runtime, off);
 	if (substream->ops->copy) {
 		if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0)
 			return err;
@@ -2068,10 +2068,12 @@ static int snd_pcm_lib_write_transfer(snd_pcm_substream_t *substream,
 }
  
 typedef int (*transfer_f)(snd_pcm_substream_t *substream, unsigned int hwoff,
-			  void *data, unsigned int off, snd_pcm_uframes_t size);
+			  unsigned long data, unsigned int off,
+			  snd_pcm_uframes_t size);
 
 static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, 
-					    const void *data, snd_pcm_uframes_t size,
+					    unsigned long data,
+					    snd_pcm_uframes_t size,
 					    int nonblock,
 					    transfer_f transfer)
 {
@@ -2186,7 +2188,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
 		appl_ptr = runtime->control->appl_ptr;
 		appl_ofs = appl_ptr % runtime->buffer_size;
 		snd_pcm_stream_unlock_irq(substream);
-		if ((err = transfer(substream, appl_ofs, (void *)data, offset, frames)) < 0)
+		if ((err = transfer(substream, appl_ofs, data, offset, frames)) < 0)
 			goto _end;
 		snd_pcm_stream_lock_irq(substream);
 		switch (runtime->status->state) {
@@ -2227,7 +2229,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
 	return xfer > 0 ? (snd_pcm_sframes_t)xfer : err;
 }
 
-snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void *buf, snd_pcm_uframes_t size)
+snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void __user *buf, snd_pcm_uframes_t size)
 {
 	snd_pcm_runtime_t *runtime;
 	int nonblock;
@@ -2256,18 +2258,18 @@ snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, const void *
 	if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED &&
 	    runtime->channels > 1)
 		return -EINVAL;
-	return snd_pcm_lib_write1(substream, buf, size, nonblock,
+	return snd_pcm_lib_write1(substream, (unsigned long)buf, size, nonblock,
 				  snd_pcm_lib_write_transfer);
 }
 
 static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream,
 				       unsigned int hwoff,
-				       void *data, unsigned int off,
+				       unsigned long data, unsigned int off,
 				       snd_pcm_uframes_t frames)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
-	void **bufs = data;
+	void __user **bufs = (void __user **)data;
 	int channels = runtime->channels;
 	int c;
 	if (substream->ops->copy) {
@@ -2277,7 +2279,7 @@ static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream,
 				if ((err = substream->ops->silence(substream, c, hwoff, frames)) < 0)
 					return err;
 			} else {
-				char *buf = *bufs + samples_to_bytes(runtime, off);
+				char __user *buf = *bufs + samples_to_bytes(runtime, off);
 				if ((err = substream->ops->copy(substream, c, hwoff, buf, frames)) < 0)
 					return err;
 			}
@@ -2291,7 +2293,7 @@ static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream,
 			if (*bufs == NULL) {
 				snd_pcm_format_set_silence(runtime->format, hwbuf, frames);
 			} else {
-				char *buf = *bufs + samples_to_bytes(runtime, off);
+				char __user *buf = *bufs + samples_to_bytes(runtime, off);
 				if (copy_from_user(hwbuf, buf, samples_to_bytes(runtime, frames)))
 					return -EFAULT;
 			}
@@ -2300,7 +2302,8 @@ static int snd_pcm_lib_writev_transfer(snd_pcm_substream_t *substream,
 	return 0;
 }
  
-snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, void **bufs,
+snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream,
+				     void __user **bufs,
 				     snd_pcm_uframes_t frames)
 {
 	snd_pcm_runtime_t *runtime;
@@ -2329,18 +2332,18 @@ snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, void **bufs
 
 	if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED)
 		return -EINVAL;
-	return snd_pcm_lib_write1(substream, bufs, frames, nonblock,
-				  snd_pcm_lib_writev_transfer);
+	return snd_pcm_lib_write1(substream, (unsigned long)bufs, frames,
+				  nonblock, snd_pcm_lib_writev_transfer);
 }
 
 static int snd_pcm_lib_read_transfer(snd_pcm_substream_t *substream, 
 				     unsigned int hwoff,
-				     void *data, unsigned int off,
+				     unsigned long data, unsigned int off,
 				     snd_pcm_uframes_t frames)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
-	char *buf = (char *) data + frames_to_bytes(runtime, off);
+	char __user *buf = (char __user *) data + frames_to_bytes(runtime, off);
 	if (substream->ops->copy) {
 		if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0)
 			return err;
@@ -2353,7 +2356,10 @@ static int snd_pcm_lib_read_transfer(snd_pcm_substream_t *substream,
 	return 0;
 }
 
-static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void *data, snd_pcm_uframes_t size, int nonblock,
+static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream,
+					   unsigned long data,
+					   snd_pcm_uframes_t size,
+					   int nonblock,
 					   transfer_f transfer)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
@@ -2481,7 +2487,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void
 		appl_ptr = runtime->control->appl_ptr;
 		appl_ofs = appl_ptr % runtime->buffer_size;
 		snd_pcm_stream_unlock_irq(substream);
-		if ((err = transfer(substream, appl_ofs, (void *)data, offset, frames)) < 0)
+		if ((err = transfer(substream, appl_ofs, data, offset, frames)) < 0)
 			goto _end;
 		snd_pcm_stream_lock_irq(substream);
 		switch (runtime->status->state) {
@@ -2516,7 +2522,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void
 	return xfer > 0 ? (snd_pcm_sframes_t)xfer : err;
 }
 
-snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void *buf, snd_pcm_uframes_t size)
+snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void __user *buf, snd_pcm_uframes_t size)
 {
 	snd_pcm_runtime_t *runtime;
 	int nonblock;
@@ -2543,22 +2549,22 @@ snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, void *buf, sn
 #endif
 	if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED)
 		return -EINVAL;
-	return snd_pcm_lib_read1(substream, buf, size, nonblock, snd_pcm_lib_read_transfer);
+	return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer);
 }
 
 static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream,
 				      unsigned int hwoff,
-				      void *data, unsigned int off,
+				      unsigned long data, unsigned int off,
 				      snd_pcm_uframes_t frames)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
-	void **bufs = data;
+	void __user **bufs = (void __user **)data;
 	int channels = runtime->channels;
 	int c;
 	if (substream->ops->copy) {
 		for (c = 0; c < channels; ++c, ++bufs) {
-			char *buf;
+			char __user *buf;
 			if (*bufs == NULL)
 				continue;
 			buf = *bufs + samples_to_bytes(runtime, off);
@@ -2569,7 +2575,8 @@ static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream,
 		snd_pcm_uframes_t dma_csize = runtime->dma_bytes / channels;
 		snd_assert(runtime->dma_area, return -EFAULT);
 		for (c = 0; c < channels; ++c, ++bufs) {
-			char *hwbuf, *buf;
+			char *hwbuf;
+			char __user *buf;
 			if (*bufs == NULL)
 				continue;
 
@@ -2582,7 +2589,8 @@ static int snd_pcm_lib_readv_transfer(snd_pcm_substream_t *substream,
 	return 0;
 }
  
-snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, void **bufs,
+snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream,
+				    void __user **bufs,
 				    snd_pcm_uframes_t frames)
 {
 	snd_pcm_runtime_t *runtime;
@@ -2611,7 +2619,7 @@ snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, void **bufs,
 
 	if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED)
 		return -EINVAL;
-	return snd_pcm_lib_read1(substream, bufs, frames, nonblock, snd_pcm_lib_readv_transfer);
+	return snd_pcm_lib_read1(substream, (unsigned long)bufs, frames, nonblock, snd_pcm_lib_readv_transfer);
 }
 
 /*
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index 8789b6ef5..ab70ba7b6 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -23,18 +23,19 @@
 #include <asm/io.h>
 #include <linux/time.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
 #include <sound/initval.h>
 
 static int preallocate_dma = 1;
-MODULE_PARM(preallocate_dma, "i");
+module_param(preallocate_dma, int, 0444);
 MODULE_PARM_DESC(preallocate_dma, "Preallocate DMA memory when the PCM devices are initialized.");
 MODULE_PARM_SYNTAX(preallocate_dma, SNDRV_BOOLEAN_TRUE_DESC);
 
 static int maximum_substreams = 4;
-MODULE_PARM(maximum_substreams, "i");
+module_param(maximum_substreams, int, 0444);
 MODULE_PARM_DESC(maximum_substreams, "Maximum substreams with preallocated DMA memory.");
 MODULE_PARM_SYNTAX(maximum_substreams, SNDRV_BOOLEAN_TRUE_DESC);
 
@@ -223,9 +224,13 @@ static int snd_pcm_lib_preallocate_pages1(snd_pcm_substream_t *substream,
  */
 static inline void setup_pcm_id(snd_pcm_substream_t *subs)
 {
-	if (! subs->dma_device.id)
+	if (! subs->dma_device.id) {
 		subs->dma_device.id = subs->pcm->device << 16 |
 			subs->stream << 8 | (subs->number + 1);
+		if (subs->dma_device.type == SNDRV_DMA_TYPE_CONTINUOUS ||
+		    subs->dma_device.dev == NULL)
+			subs->dma_device.id |= (subs->pcm->card->number + 1) << 24;
+	}
 }
 
 /**
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index 5d55e36c8..a35ed275d 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -230,7 +230,7 @@ int snd_pcm_format_width(snd_pcm_format_t format)
 		return 64;
 	case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
 	case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
-		return 24;
+		return 32;
 	case SNDRV_PCM_FORMAT_MU_LAW:
 	case SNDRV_PCM_FORMAT_A_LAW:
 		return 8;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 6de6af466..15ed2b9b3 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -56,8 +56,8 @@ struct sndrv_pcm_hw_params_old {
 #define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct sndrv_pcm_hw_params_old)
 #define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct sndrv_pcm_hw_params_old)
 
-static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old * _oparams);
-static int snd_pcm_hw_params_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old * _oparams);
+static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams);
+static int snd_pcm_hw_params_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams);
 
 /*
  *
@@ -108,7 +108,7 @@ int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info)
 	return 0;
 }
 
-int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t * _info)
+int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user * _info)
 {
 	snd_pcm_info_t info;
 	int err = snd_pcm_info(substream, &info);
@@ -302,7 +302,7 @@ int snd_pcm_hw_refine(snd_pcm_substream_t *substream,
 	return 0;
 }
 
-static int snd_pcm_hw_refine_user(snd_pcm_substream_t * substream, snd_pcm_hw_params_t * _params)
+static int snd_pcm_hw_refine_user(snd_pcm_substream_t * substream, snd_pcm_hw_params_t __user * _params)
 {
 	snd_pcm_hw_params_t params;
 	int err;
@@ -406,7 +406,7 @@ static int snd_pcm_hw_params(snd_pcm_substream_t *substream,
 	return err;
 }
 
-static int snd_pcm_hw_params_user(snd_pcm_substream_t * substream, snd_pcm_hw_params_t * _params)
+static int snd_pcm_hw_params_user(snd_pcm_substream_t * substream, snd_pcm_hw_params_t __user * _params)
 {
 	snd_pcm_hw_params_t params;
 	int err;
@@ -494,7 +494,7 @@ static int snd_pcm_sw_params(snd_pcm_substream_t * substream, snd_pcm_sw_params_
 	return 0;
 }
 
-static int snd_pcm_sw_params_user(snd_pcm_substream_t * substream, snd_pcm_sw_params_t * _params)
+static int snd_pcm_sw_params_user(snd_pcm_substream_t * substream, snd_pcm_sw_params_t __user * _params)
 {
 	snd_pcm_sw_params_t params;
 	int err;
@@ -550,7 +550,7 @@ int snd_pcm_status(snd_pcm_substream_t *substream,
 	return 0;
 }
 
-static int snd_pcm_status_user(snd_pcm_substream_t * substream, snd_pcm_status_t * _status)
+static int snd_pcm_status_user(snd_pcm_substream_t * substream, snd_pcm_status_t __user * _status)
 {
 	snd_pcm_status_t status;
 	snd_pcm_runtime_t *runtime;
@@ -567,7 +567,7 @@ static int snd_pcm_status_user(snd_pcm_substream_t * substream, snd_pcm_status_t
 	return 0;
 }
 
-static int snd_pcm_channel_info(snd_pcm_substream_t * substream, snd_pcm_channel_info_t * _info)
+static int snd_pcm_channel_info(snd_pcm_substream_t * substream, snd_pcm_channel_info_t __user * _info)
 {
 	snd_pcm_channel_info_t info;
 	snd_pcm_runtime_t *runtime;
@@ -1038,7 +1038,7 @@ static int snd_pcm_resume(snd_pcm_substream_t *substream)
 
 	snd_power_lock(card);
 	if ((res = snd_power_wait(card, SNDRV_CTL_POWER_D0, substream->ffile)) >= 0)
-		return snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0, 0);
+		res = snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream, 0, 0);
 	snd_power_unlock(card);
 	return res;
 }
@@ -2297,7 +2297,7 @@ static int snd_pcm_hwsync(snd_pcm_substream_t *substream)
 	return err;
 }
 		
-static int snd_pcm_delay(snd_pcm_substream_t *substream, snd_pcm_sframes_t *res)
+static int snd_pcm_delay(snd_pcm_substream_t *substream, snd_pcm_sframes_t __user *res)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
@@ -2335,41 +2335,80 @@ static int snd_pcm_delay(snd_pcm_substream_t *substream, snd_pcm_sframes_t *res)
 	return err;
 }
 		
+static int snd_pcm_sync_ptr(snd_pcm_substream_t *substream, struct sndrv_pcm_sync_ptr __user *_sync_ptr)
+{
+	snd_pcm_runtime_t *runtime = substream->runtime;
+	struct sndrv_pcm_sync_ptr sync_ptr;
+	volatile struct sndrv_pcm_mmap_status *status;
+	volatile struct sndrv_pcm_mmap_control *control;
+	int err;
+
+	memset(&sync_ptr, 0, sizeof(sync_ptr));
+	if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags)))
+		return -EFAULT;
+	if (copy_from_user(&sync_ptr.c.control, &(_sync_ptr->c.control), sizeof(struct sndrv_pcm_mmap_control)))
+		return -EFAULT;	
+	status = runtime->status;
+	control = runtime->control;
+	if (sync_ptr.flags & SNDRV_PCM_SYNC_PTR_HWSYNC) {
+		err = snd_pcm_hwsync(substream);
+		if (err < 0)
+			return err;
+	}
+	snd_pcm_stream_lock_irq(substream);
+	if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_APPL))
+		control->appl_ptr = sync_ptr.c.control.appl_ptr;
+	else
+		sync_ptr.c.control.appl_ptr = control->appl_ptr;
+	if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN))
+		control->avail_min = sync_ptr.c.control.avail_min;
+	else
+		sync_ptr.c.control.avail_min = control->avail_min;
+	sync_ptr.s.status.state = status->state;
+	sync_ptr.s.status.hw_ptr = status->hw_ptr;
+	sync_ptr.s.status.tstamp = status->tstamp;
+	sync_ptr.s.status.suspended_state = status->suspended_state;
+	snd_pcm_stream_unlock_irq(substream);
+	if (copy_to_user(_sync_ptr, &sync_ptr, sizeof(sync_ptr)))
+		return -EFAULT;
+	return 0;
+}
+		
 static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
-				   unsigned int cmd, void *arg);
+				   unsigned int cmd, void __user *arg);
 static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
-				  unsigned int cmd, void *arg);
+				  unsigned int cmd, void __user *arg);
 
 static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream,
-				 unsigned int cmd, void *arg)
+				 unsigned int cmd, void __user *arg)
 {
 	snd_assert(substream != NULL, return -ENXIO);
 
 	switch (cmd) {
 	case SNDRV_PCM_IOCTL_PVERSION:
-		return put_user(SNDRV_PCM_VERSION, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0;
 	case SNDRV_PCM_IOCTL_INFO:
-		return snd_pcm_info_user(substream, (snd_pcm_info_t *) arg);
+		return snd_pcm_info_user(substream, arg);
 	case SNDRV_PCM_IOCTL_TSTAMP:
 	{
 		int xarg;
-		if (get_user(xarg, (int *) arg))
+		if (get_user(xarg, (int __user *)arg))
 			return -EFAULT;
 		substream->runtime->tstamp_timespec = xarg ? 1 : 0;
 		return 0;
 	}
 	case SNDRV_PCM_IOCTL_HW_REFINE:
-		return snd_pcm_hw_refine_user(substream, (snd_pcm_hw_params_t *) arg);
+		return snd_pcm_hw_refine_user(substream, arg);
 	case SNDRV_PCM_IOCTL_HW_PARAMS:
-		return snd_pcm_hw_params_user(substream, (snd_pcm_hw_params_t *) arg);
+		return snd_pcm_hw_params_user(substream, arg);
 	case SNDRV_PCM_IOCTL_HW_FREE:
 		return snd_pcm_hw_free(substream);
 	case SNDRV_PCM_IOCTL_SW_PARAMS:
-		return snd_pcm_sw_params_user(substream, (snd_pcm_sw_params_t *) arg);
+		return snd_pcm_sw_params_user(substream, arg);
 	case SNDRV_PCM_IOCTL_STATUS:
-		return snd_pcm_status_user(substream, (snd_pcm_status_t *) arg);
+		return snd_pcm_status_user(substream, arg);
 	case SNDRV_PCM_IOCTL_CHANNEL_INFO:
-		return snd_pcm_channel_info(substream, (snd_pcm_channel_info_t *) arg);
+		return snd_pcm_channel_info(substream, arg);
 	case SNDRV_PCM_IOCTL_PREPARE:
 		return snd_pcm_prepare(substream);
 	case SNDRV_PCM_IOCTL_RESET:
@@ -2377,7 +2416,7 @@ static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream,
 	case SNDRV_PCM_IOCTL_START:
 		return snd_pcm_action_lock_irq(&snd_pcm_action_start, substream, 0, 0);
 	case SNDRV_PCM_IOCTL_LINK:
-		return snd_pcm_link(substream, (long) arg);
+		return snd_pcm_link(substream, (int)(unsigned long) arg);
 	case SNDRV_PCM_IOCTL_UNLINK:
 		return snd_pcm_unlink(substream);
 	case SNDRV_PCM_IOCTL_RESUME:
@@ -2387,25 +2426,28 @@ static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream,
 	case SNDRV_PCM_IOCTL_HWSYNC:
 		return snd_pcm_hwsync(substream);
 	case SNDRV_PCM_IOCTL_DELAY:
-		return snd_pcm_delay(substream, (snd_pcm_sframes_t *) arg);
+		return snd_pcm_delay(substream, arg);
+	case SNDRV_PCM_IOCTL_SYNC_PTR:
+		return snd_pcm_sync_ptr(substream, arg);
 	case SNDRV_PCM_IOCTL_HW_REFINE_OLD:
-		return snd_pcm_hw_refine_old_user(substream, (struct sndrv_pcm_hw_params_old *) arg);
+		return snd_pcm_hw_refine_old_user(substream, arg);
 	case SNDRV_PCM_IOCTL_HW_PARAMS_OLD:
-		return snd_pcm_hw_params_old_user(substream, (struct sndrv_pcm_hw_params_old *) arg);
+		return snd_pcm_hw_params_old_user(substream, arg);
 	}
 	snd_printd("unknown ioctl = 0x%x\n", cmd);
 	return -ENOTTY;
 }
 
 static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
-				   unsigned int cmd, void *arg)
+				   unsigned int cmd, void __user *arg)
 {
 	snd_assert(substream != NULL, return -ENXIO);
 	snd_assert(substream->stream == SNDRV_PCM_STREAM_PLAYBACK, return -EINVAL);
 	switch (cmd) {
 	case SNDRV_PCM_IOCTL_WRITEI_FRAMES:
 	{
-		snd_xferi_t xferi, *_xferi = arg;
+		snd_xferi_t xferi;
+		snd_xferi_t __user *_xferi = arg;
 		snd_pcm_runtime_t *runtime = substream->runtime;
 		snd_pcm_sframes_t result;
 		if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
@@ -2420,9 +2462,10 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
 	}
 	case SNDRV_PCM_IOCTL_WRITEN_FRAMES:
 	{
-		snd_xfern_t xfern, *_xfern = arg;
+		snd_xfern_t xfern;
+		snd_xfern_t __user *_xfern = arg;
 		snd_pcm_runtime_t *runtime = substream->runtime;
-		void *bufs;
+		void __user **bufs;
 		snd_pcm_sframes_t result;
 		if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
 			return -EBADFD;
@@ -2446,7 +2489,8 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
 	}
 	case SNDRV_PCM_IOCTL_REWIND:
 	{
-		snd_pcm_uframes_t frames, *_frames = arg;
+		snd_pcm_uframes_t frames;
+		snd_pcm_uframes_t __user *_frames = arg;
 		snd_pcm_sframes_t result;
 		if (get_user(frames, _frames))
 			return -EFAULT;
@@ -2458,7 +2502,8 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
 	}
 	case SNDRV_PCM_IOCTL_FORWARD:
 	{
-		snd_pcm_uframes_t frames, *_frames = arg;
+		snd_pcm_uframes_t frames;
+		snd_pcm_uframes_t __user *_frames = arg;
 		snd_pcm_sframes_t result;
 		if (get_user(frames, _frames))
 			return -EFAULT;
@@ -2472,7 +2517,7 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
 	{
 		int res;
 		snd_pcm_stream_lock_irq(substream);
-		res = snd_pcm_pause(substream, (long) arg);
+		res = snd_pcm_pause(substream, (int)(unsigned long)arg);
 		snd_pcm_stream_unlock_irq(substream);
 		return res;
 	}
@@ -2485,14 +2530,15 @@ static int snd_pcm_playback_ioctl1(snd_pcm_substream_t *substream,
 }
 
 static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
-				  unsigned int cmd, void *arg)
+				  unsigned int cmd, void __user *arg)
 {
 	snd_assert(substream != NULL, return -ENXIO);
 	snd_assert(substream->stream == SNDRV_PCM_STREAM_CAPTURE, return -EINVAL);
 	switch (cmd) {
 	case SNDRV_PCM_IOCTL_READI_FRAMES:
 	{
-		snd_xferi_t xferi, *_xferi = arg;
+		snd_xferi_t xferi;
+		snd_xferi_t __user *_xferi = arg;
 		snd_pcm_runtime_t *runtime = substream->runtime;
 		snd_pcm_sframes_t result;
 		if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
@@ -2507,7 +2553,8 @@ static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
 	}
 	case SNDRV_PCM_IOCTL_READN_FRAMES:
 	{
-		snd_xfern_t xfern, *_xfern = arg;
+		snd_xfern_t xfern;
+		snd_xfern_t __user *_xfern = arg;
 		snd_pcm_runtime_t *runtime = substream->runtime;
 		void *bufs;
 		snd_pcm_sframes_t result;
@@ -2533,7 +2580,8 @@ static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
 	}
 	case SNDRV_PCM_IOCTL_REWIND:
 	{
-		snd_pcm_uframes_t frames, *_frames = arg;
+		snd_pcm_uframes_t frames;
+		snd_pcm_uframes_t __user *_frames = arg;
 		snd_pcm_sframes_t result;
 		if (get_user(frames, _frames))
 			return -EFAULT;
@@ -2545,7 +2593,8 @@ static int snd_pcm_capture_ioctl1(snd_pcm_substream_t *substream,
 	}
 	case SNDRV_PCM_IOCTL_FORWARD:
 	{
-		snd_pcm_uframes_t frames, *_frames = arg;
+		snd_pcm_uframes_t frames;
+		snd_pcm_uframes_t __user *_frames = arg;
 		snd_pcm_sframes_t result;
 		if (get_user(frames, _frames))
 			return -EFAULT;
@@ -2573,7 +2622,7 @@ static int snd_pcm_playback_ioctl(struct inode *inode, struct file *file,
 	if (((cmd >> 8) & 0xff) != 'A')
 		return -ENOTTY;
 
-	return snd_pcm_playback_ioctl1(pcm_file->substream, cmd, (void *) arg);
+	return snd_pcm_playback_ioctl1(pcm_file->substream, cmd, (void __user *)arg);
 }
 
 static int snd_pcm_capture_ioctl(struct inode *inode, struct file *file,
@@ -2586,7 +2635,7 @@ static int snd_pcm_capture_ioctl(struct inode *inode, struct file *file,
 	if (((cmd >> 8) & 0xff) != 'A')
 		return -ENOTTY;
 
-	return snd_pcm_capture_ioctl1(pcm_file->substream, cmd, (void *) arg);
+	return snd_pcm_capture_ioctl1(pcm_file->substream, cmd, (void __user *)arg);
 }
 
 int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream,
@@ -2626,7 +2675,7 @@ int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream,
 	}
 }
 
-static ssize_t snd_pcm_read(struct file *file, char *buf, size_t count, loff_t * offset)
+static ssize_t snd_pcm_read(struct file *file, char __user *buf, size_t count, loff_t * offset)
 {
 	snd_pcm_file_t *pcm_file;
 	snd_pcm_substream_t *substream;
@@ -2648,7 +2697,7 @@ static ssize_t snd_pcm_read(struct file *file, char *buf, size_t count, loff_t *
 	return result;
 }
 
-static ssize_t snd_pcm_write(struct file *file, const char *buf, size_t count, loff_t * offset)
+static ssize_t snd_pcm_write(struct file *file, const char __user *buf, size_t count, loff_t * offset)
 {
 	snd_pcm_file_t *pcm_file;
 	snd_pcm_substream_t *substream;
@@ -2684,7 +2733,7 @@ static ssize_t snd_pcm_readv(struct file *file, const struct iovec *_vector,
 	snd_pcm_runtime_t *runtime;
 	snd_pcm_sframes_t result;
 	unsigned long i;
-	void **bufs;
+	void __user **bufs;
 	snd_pcm_uframes_t frames;
 
 	pcm_file = snd_magic_cast(snd_pcm_file_t, file->private_data, return -ENXIO);
@@ -2718,7 +2767,7 @@ static ssize_t snd_pcm_writev(struct file *file, const struct iovec *_vector,
 	snd_pcm_runtime_t *runtime;
 	snd_pcm_sframes_t result;
 	unsigned long i;
-	void **bufs;
+	void __user **bufs;
 	snd_pcm_uframes_t frames;
 
 	pcm_file = snd_magic_cast(snd_pcm_file_t, file->private_data, result = -ENXIO; goto end);
@@ -3082,7 +3131,7 @@ static void snd_pcm_hw_convert_to_old_params(struct sndrv_pcm_hw_params_old *opa
 	oparams->fifo_size = params->fifo_size;
 }
 
-static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old * _oparams)
+static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams)
 {
 	snd_pcm_hw_params_t params;
 	struct sndrv_pcm_hw_params_old oparams;
@@ -3097,7 +3146,7 @@ static int snd_pcm_hw_refine_old_user(snd_pcm_substream_t * substream, struct sn
 	return err;
 }
 
-static int snd_pcm_hw_params_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old * _oparams)
+static int snd_pcm_hw_params_old_user(snd_pcm_substream_t * substream, struct sndrv_pcm_hw_params_old __user * _oparams)
 {
 	snd_pcm_hw_params_t params;
 	struct sndrv_pcm_hw_params_old oparams;
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 81be9e56a..df904d18d 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/rawmidi.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -40,10 +41,11 @@ MODULE_LICENSE("GPL");
 #ifdef CONFIG_SND_OSSEMUL
 static int midi_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};
 static int amidi_map[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 1};
-MODULE_PARM(midi_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+static int boot_devs;
+module_param_array(midi_map, int, boot_devs, 0444);
 MODULE_PARM_DESC(midi_map, "Raw MIDI device number assigned to 1st OSS device.");
 MODULE_PARM_SYNTAX(midi_map, "default:0,skill:advanced");
-MODULE_PARM(amidi_map, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(amidi_map, int, boot_devs, 0444);
 MODULE_PARM_DESC(amidi_map, "Raw MIDI device number assigned to 2nd OSS device.");
 MODULE_PARM_SYNTAX(amidi_map, "default:1,skill:advanced");
 #endif /* CONFIG_SND_OSSEMUL */
@@ -541,7 +543,7 @@ int snd_rawmidi_info(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t *inf
 	return 0;
 }
 
-static int snd_rawmidi_info_user(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t * _info)
+static int snd_rawmidi_info_user(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t __user * _info)
 {
 	snd_rawmidi_info_t info;
 	int err;
@@ -577,7 +579,7 @@ int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info)
 }
 
 static int snd_rawmidi_info_select_user(snd_card_t *card,
-					snd_rawmidi_info_t *_info)
+					snd_rawmidi_info_t __user *_info)
 {
 	int err;
 	snd_rawmidi_info_t info;
@@ -677,17 +679,18 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
 			     unsigned int cmd, unsigned long arg)
 {
 	snd_rawmidi_file_t *rfile;
+	void __user *argp = (void __user *)arg;
 
 	rfile = snd_magic_cast(snd_rawmidi_file_t, file->private_data, return -ENXIO);
 	if (((cmd >> 8) & 0xff) != 'W')
 		return -ENOTTY;
 	switch (cmd) {
 	case SNDRV_RAWMIDI_IOCTL_PVERSION:
-		return put_user(SNDRV_RAWMIDI_VERSION, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_RAWMIDI_VERSION, (int __user *)argp) ? -EFAULT : 0;
 	case SNDRV_RAWMIDI_IOCTL_INFO:
 	{
 		snd_rawmidi_stream_t stream;
-		snd_rawmidi_info_t *info = (snd_rawmidi_info_t *) arg;
+		snd_rawmidi_info_t __user *info = argp;
 		if (get_user(stream, &info->stream))
 			return -EFAULT;
 		switch (stream) {
@@ -702,7 +705,7 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
 	case SNDRV_RAWMIDI_IOCTL_PARAMS:
 	{
 		snd_rawmidi_params_t params;
-		if (copy_from_user(&params, (snd_rawmidi_params_t *) arg, sizeof(snd_rawmidi_params_t)))
+		if (copy_from_user(&params, argp, sizeof(snd_rawmidi_params_t)))
 			return -EFAULT;
 		switch (params.stream) {
 		case SNDRV_RAWMIDI_STREAM_OUTPUT:
@@ -721,7 +724,7 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
 	{
 		int err = 0;
 		snd_rawmidi_status_t status;
-		if (copy_from_user(&status, (snd_rawmidi_status_t *) arg, sizeof(snd_rawmidi_status_t)))
+		if (copy_from_user(&status, argp, sizeof(snd_rawmidi_status_t)))
 			return -EFAULT;
 		switch (status.stream) {
 		case SNDRV_RAWMIDI_STREAM_OUTPUT:
@@ -739,14 +742,14 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
 		}
 		if (err < 0)
 			return err;
-		if (copy_to_user((snd_rawmidi_status_t *) arg, &status, sizeof(snd_rawmidi_status_t)))
+		if (copy_to_user(argp, &status, sizeof(snd_rawmidi_status_t)))
 			return -EFAULT;
 		return 0;
 	}
 	case SNDRV_RAWMIDI_IOCTL_DROP:
 	{
 		int val;
-		if (get_user(val, (long *) arg))
+		if (get_user(val, (long __user *) argp))
 			return -EFAULT;
 		switch (val) {
 		case SNDRV_RAWMIDI_STREAM_OUTPUT:
@@ -760,7 +763,7 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
 	case SNDRV_RAWMIDI_IOCTL_DRAIN:
 	{
 		int val;
-		if (get_user(val, (long *) arg))
+		if (get_user(val, (long __user *) argp))
 			return -EFAULT;
 		switch (val) {
 		case SNDRV_RAWMIDI_STREAM_OUTPUT:
@@ -786,6 +789,7 @@ static int snd_rawmidi_ioctl(struct inode *inode, struct file *file,
 int snd_rawmidi_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
 			      unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
 	unsigned int tmp;
 
 	tmp = card->number * SNDRV_RAWMIDI_DEVICES;
@@ -794,7 +798,7 @@ int snd_rawmidi_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
 	{
 		int device;
 		
-		if (get_user(device, (int *)arg))
+		if (get_user(device, (int __user *)argp))
 			return -EFAULT;
 		device = device < 0 ? 0 : device + 1;
 		while (device < SNDRV_RAWMIDI_DEVICES) {
@@ -804,7 +808,7 @@ int snd_rawmidi_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
 		}
 		if (device == SNDRV_RAWMIDI_DEVICES)
 			device = -1;
-		if (put_user(device, (int *)arg))
+		if (put_user(device, (int __user *)argp))
 			return -EFAULT;
 		return 0;
 	}
@@ -812,13 +816,13 @@ int snd_rawmidi_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
 	{
 		int val;
 		
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		control->prefer_rawmidi_subdevice = val;
 		return 0;
 	}
 	case SNDRV_CTL_IOCTL_RAWMIDI_INFO:
-		return snd_rawmidi_info_select_user(card, (snd_rawmidi_info_t *)arg);
+		return snd_rawmidi_info_select_user(card, argp);
 	}
 	return -ENOIOCTLCMD;
 }
@@ -932,7 +936,7 @@ long snd_rawmidi_kernel_read(snd_rawmidi_substream_t *substream, unsigned char *
 	return snd_rawmidi_kernel_read1(substream, buf, count, 1);
 }
 
-static ssize_t snd_rawmidi_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	long result;
 	int count1;
@@ -1164,7 +1168,7 @@ long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigne
 	return snd_rawmidi_kernel_write1(substream, buf, count, 1);
 }
 
-static ssize_t snd_rawmidi_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
 	long result, timeout;
 	int count1;
@@ -1637,26 +1641,6 @@ static void __exit alsa_rawmidi_exit(void)
 module_init(alsa_rawmidi_init)
 module_exit(alsa_rawmidi_exit)
 
-#ifndef MODULE
-#ifdef CONFIG_SND_OSSEMUL
-/* format is: snd-rawmidi=midi_map,amidi_map */
-
-static int __init alsa_rawmidi_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&midi_map[nr_dev]) == 2 &&
-	       get_option(&str,&amidi_map[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-rawmidi=", alsa_rawmidi_setup);
-#endif /* CONFIG_SND_OSSEMUL */
-#endif /* ifndef MODULE */
-
 EXPORT_SYMBOL(snd_rawmidi_output_params);
 EXPORT_SYMBOL(snd_rawmidi_input_params);
 EXPORT_SYMBOL(snd_rawmidi_drop_output);
diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c
index 79b30f13f..e957b1396 100644
--- a/sound/core/rtctimer.c
+++ b/sound/core/rtctimer.c
@@ -25,6 +25,7 @@
 #include <linux/time.h>
 #include <linux/threads.h>
 #include <linux/interrupt.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/timer.h>
 #include <sound/info.h>
@@ -177,21 +178,9 @@ static void __exit rtctimer_exit(void)
 module_init(rtctimer_init)
 module_exit(rtctimer_exit)
 
-MODULE_PARM(rtctimer_freq, "i");
+module_param(rtctimer_freq, int, 0444);
 MODULE_PARM_DESC(rtctimer_freq, "timer frequency in Hz");
 
 MODULE_LICENSE("GPL");
 
-#ifndef MODULE
-/* format is: snd-rtctimer=freq */
-
-static int __init rtctimer_setup(char *str)
-{
-	(void)(get_option(&str,&rtctimer_freq) == 2);
-	return 1;
-}
-
-__setup("snd-rtctimer=", rtctimer_setup);
-#endif /* ifndef MODULE */
-
 #endif /* CONFIG_RTC || CONFIG_RTC_MODULE */
diff --git a/sound/core/seq/instr/ainstr_fm.c b/sound/core/seq/instr/ainstr_fm.c
index aabb0c2bb..648a7b89c 100644
--- a/sound/core/seq/instr/ainstr_fm.c
+++ b/sound/core/seq/instr/ainstr_fm.c
@@ -35,7 +35,7 @@ MODULE_SUPPORTED_DEVICE("sound");
 char *snd_seq_fm_id = SNDRV_SEQ_INSTR_ID_OPL2_3;
 
 static int snd_seq_fm_put(void *private_data, snd_seq_kinstr_t *instr,
-			  char *instr_data, long len, int atomic, int cmd)
+			  char __user *instr_data, long len, int atomic, int cmd)
 {
 	fm_instrument_t *ip;
 	fm_xinstrument_t ix;
@@ -77,7 +77,8 @@ static int snd_seq_fm_put(void *private_data, snd_seq_kinstr_t *instr,
 }
 
 static int snd_seq_fm_get(void *private_data, snd_seq_kinstr_t *instr,
-			  char *instr_data, long len, int atomic, int cmd)
+			  char __user *instr_data, long len, int atomic,
+			  int cmd)
 {
 	fm_instrument_t *ip;
 	fm_xinstrument_t ix;
diff --git a/sound/core/seq/instr/ainstr_gf1.c b/sound/core/seq/instr/ainstr_gf1.c
index d1029dfdd..13b46beff 100644
--- a/sound/core/seq/instr/ainstr_gf1.c
+++ b/sound/core/seq/instr/ainstr_gf1.c
@@ -48,7 +48,7 @@ static unsigned int snd_seq_gf1_size(unsigned int size, unsigned int format)
 
 static int snd_seq_gf1_copy_wave_from_stream(snd_gf1_ops_t *ops,
 					     gf1_instrument_t *ip,
-					     char **data,
+					     char __user **data,
 					     long *len,
 					     int atomic)
 {
@@ -141,7 +141,8 @@ static void snd_seq_gf1_instr_free(snd_gf1_ops_t *ops,
 }
 
 static int snd_seq_gf1_put(void *private_data, snd_seq_kinstr_t *instr,
-			   char *instr_data, long len, int atomic, int cmd)
+			   char __user *instr_data, long len, int atomic,
+			   int cmd)
 {
 	snd_gf1_ops_t *ops = (snd_gf1_ops_t *)private_data;
 	gf1_instrument_t *ip;
@@ -192,7 +193,7 @@ static int snd_seq_gf1_put(void *private_data, snd_seq_kinstr_t *instr,
 
 static int snd_seq_gf1_copy_wave_to_stream(snd_gf1_ops_t *ops,
 					   gf1_instrument_t *ip,
-					   char **data,
+					   char __user **data,
 					   long *len,
 					   int atomic)
 {
@@ -253,7 +254,8 @@ static int snd_seq_gf1_copy_wave_to_stream(snd_gf1_ops_t *ops,
 }
 
 static int snd_seq_gf1_get(void *private_data, snd_seq_kinstr_t *instr,
-			   char *instr_data, long len, int atomic, int cmd)
+			   char __user *instr_data, long len, int atomic,
+			   int cmd)
 {
 	snd_gf1_ops_t *ops = (snd_gf1_ops_t *)private_data;
 	gf1_instrument_t *ip;
diff --git a/sound/core/seq/instr/ainstr_iw.c b/sound/core/seq/instr/ainstr_iw.c
index 121e09cde..cd9ea5545 100644
--- a/sound/core/seq/instr/ainstr_iw.c
+++ b/sound/core/seq/instr/ainstr_iw.c
@@ -60,7 +60,7 @@ static int snd_seq_iwffff_copy_env_from_stream(__u32 req_stype,
 					       iwffff_layer_t *lp,
 					       iwffff_env_t *ep,
 					       iwffff_xenv_t *ex,
-					       char **data,
+					       char __user **data,
 					       long *len,
 					       int gfp_mask)
 {
@@ -126,7 +126,7 @@ static int snd_seq_iwffff_copy_env_from_stream(__u32 req_stype,
 
 static int snd_seq_iwffff_copy_wave_from_stream(snd_iwffff_ops_t *ops,
 						iwffff_layer_t *lp,
-					        char **data,
+					        char __user **data,
 					        long *len,
 					        int atomic)
 {
@@ -230,7 +230,8 @@ static void snd_seq_iwffff_instr_free(snd_iwffff_ops_t *ops,
 }
 
 static int snd_seq_iwffff_put(void *private_data, snd_seq_kinstr_t *instr,
-			      char *instr_data, long len, int atomic, int cmd)
+			      char __user *instr_data, long len, int atomic,
+			      int cmd)
 {
 	snd_iwffff_ops_t *ops = (snd_iwffff_ops_t *)private_data;
 	iwffff_instrument_t *ip;
@@ -350,7 +351,7 @@ static int snd_seq_iwffff_copy_env_to_stream(__u32 req_stype,
 					     iwffff_layer_t *lp,
 					     iwffff_xenv_t *ex,
 					     iwffff_env_t *ep,
-					     char **data,
+					     char __user **data,
 					     long *len)
 {
 	iwffff_env_record_t *rp;
@@ -395,7 +396,7 @@ static int snd_seq_iwffff_copy_env_to_stream(__u32 req_stype,
 
 static int snd_seq_iwffff_copy_wave_to_stream(snd_iwffff_ops_t *ops,
 					      iwffff_layer_t *lp,
-					      char **data,
+					      char __user **data,
 					      long *len,
 					      int atomic)
 {
@@ -449,14 +450,14 @@ static int snd_seq_iwffff_copy_wave_to_stream(snd_iwffff_ops_t *ops,
 }
 
 static int snd_seq_iwffff_get(void *private_data, snd_seq_kinstr_t *instr,
-			      char *instr_data, long len, int atomic, int cmd)
+			      char __user *instr_data, long len, int atomic, int cmd)
 {
 	snd_iwffff_ops_t *ops = (snd_iwffff_ops_t *)private_data;
 	iwffff_instrument_t *ip;
 	iwffff_xinstrument_t ix;
 	iwffff_layer_t *lp;
 	iwffff_xlayer_t lx;
-	char *layer_instr_data;
+	char __user *layer_instr_data;
 	int err;
 	
 	if (cmd != SNDRV_SEQ_INSTR_GET_CMD_FULL)
diff --git a/sound/core/seq/instr/ainstr_simple.c b/sound/core/seq/instr/ainstr_simple.c
index 575b1e86b..0f8117838 100644
--- a/sound/core/seq/instr/ainstr_simple.c
+++ b/sound/core/seq/instr/ainstr_simple.c
@@ -55,7 +55,8 @@ static void snd_seq_simple_instr_free(snd_simple_ops_t *ops,
 }
 
 static int snd_seq_simple_put(void *private_data, snd_seq_kinstr_t *instr,
-			      char *instr_data, long len, int atomic, int cmd)
+			      char __user *instr_data, long len,
+			      int atomic, int cmd)
 {
 	snd_simple_ops_t *ops = (snd_simple_ops_t *)private_data;
 	simple_instrument_t *ip;
@@ -103,7 +104,8 @@ static int snd_seq_simple_put(void *private_data, snd_seq_kinstr_t *instr,
 }
 
 static int snd_seq_simple_get(void *private_data, snd_seq_kinstr_t *instr,
-			      char *instr_data, long len, int atomic, int cmd)
+			      char __user *instr_data, long len,
+			      int atomic, int cmd)
 {
 	snd_simple_ops_t *ops = (snd_simple_ops_t *)private_data;
 	simple_instrument_t *ip;
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c
index c03706069..5681563fa 100644
--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -22,6 +22,7 @@
 
 #include <sound/driver.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/minors.h>
 #include <sound/initval.h>
@@ -40,7 +41,7 @@ MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_SEQUENCER);
 MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MUSIC);
 
 #ifdef SNDRV_SEQ_OSS_DEBUG
-MODULE_PARM(seq_oss_debug, "i");
+module_param(seq_oss_debug, int, 0644);
 MODULE_PARM_DESC(seq_oss_debug, "debug option");
 int seq_oss_debug = 0;
 #endif
@@ -56,8 +57,8 @@ static void unregister_proc(void);
 
 static int odev_open(struct inode *inode, struct file *file);
 static int odev_release(struct inode *inode, struct file *file);
-static ssize_t odev_read(struct file *file, char *buf, size_t count, loff_t *offset);
-static ssize_t odev_write(struct file *file, const char *buf, size_t count, loff_t *offset);
+static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset);
+static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset);
 static int odev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
 static unsigned int odev_poll(struct file *file, poll_table * wait);
 #ifdef CONFIG_PROC_FS
@@ -154,7 +155,7 @@ odev_release(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-odev_read(struct file *file, char *buf, size_t count, loff_t *offset)
+odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	seq_oss_devinfo_t *dp;
 	dp = file->private_data;
@@ -164,7 +165,7 @@ odev_read(struct file *file, char *buf, size_t count, loff_t *offset)
 
 
 static ssize_t
-odev_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
 	seq_oss_devinfo_t *dp;
 	dp = file->private_data;
diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c
index 7bb54d276..c8b199dc1 100644
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -28,17 +28,18 @@
 #include "seq_oss_timer.h"
 #include "seq_oss_event.h"
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 
 /*
  * common variables
  */
-MODULE_PARM(maxqlen, "i");
+static int maxqlen = SNDRV_SEQ_OSS_MAX_QLEN;
+module_param(maxqlen, int, 0444);
 MODULE_PARM_DESC(maxqlen, "maximum queue length");
 
 static int system_client = -1; /* ALSA sequencer client number */
 static int system_port = -1;
 
-int maxqlen = SNDRV_SEQ_OSS_MAX_QLEN;
 static int num_clients;
 static seq_oss_devinfo_t *client_table[SNDRV_SEQ_OSS_MAX_CLIENTS];
 
diff --git a/sound/core/seq/oss/seq_oss_ioctl.c b/sound/core/seq/oss/seq_oss_ioctl.c
index d5973a837..6d783cd14 100644
--- a/sound/core/seq/oss/seq_oss_ioctl.c
+++ b/sound/core/seq/oss/seq_oss_ioctl.c
@@ -36,6 +36,7 @@ snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long carg)
 	struct midi_info minf;
 	unsigned char ev[8];
 	void __user *arg = (void __user *)carg;
+	int __user *p = arg;
 	snd_seq_event_t tmpev;
 
 	switch (cmd) {
@@ -72,7 +73,7 @@ snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long carg)
 
 	case SNDCTL_SEQ_TESTMIDI:
 		debug_printk(("test midi\n"));
-		if (get_user(dev, (int *)arg))
+		if (get_user(dev, p))
 			return -EFAULT;
 		return snd_seq_oss_midi_open(dp, dev, dp->file_mode);
 
@@ -80,42 +81,42 @@ snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long carg)
 		debug_printk(("get in count\n"));
 		if (dp->readq == NULL || ! is_read_mode(dp->file_mode))
 			return 0;
-		return put_user(dp->readq->qlen, (int *)arg) ? -EFAULT : 0;
+		return put_user(dp->readq->qlen, p) ? -EFAULT : 0;
 
 	case SNDCTL_SEQ_GETOUTCOUNT:
 		debug_printk(("get out count\n"));
 		if (! is_write_mode(dp->file_mode) || dp->writeq == NULL)
 			return 0;
-		return put_user(snd_seq_oss_writeq_get_free_size(dp->writeq), (int *)arg) ? -EFAULT : 0;
+		return put_user(snd_seq_oss_writeq_get_free_size(dp->writeq), p) ? -EFAULT : 0;
 
 	case SNDCTL_SEQ_GETTIME:
 		debug_printk(("get time\n"));
-		return put_user(snd_seq_oss_timer_cur_tick(dp->timer), (int *)arg) ? -EFAULT : 0;
+		return put_user(snd_seq_oss_timer_cur_tick(dp->timer), p) ? -EFAULT : 0;
 
 	case SNDCTL_SEQ_RESETSAMPLES:
 		debug_printk(("reset samples\n"));
-		if (get_user(dev, (int *)arg))
+		if (get_user(dev, p))
 			return -EFAULT;
 		return snd_seq_oss_synth_ioctl(dp, dev, cmd, carg);
 
 	case SNDCTL_SEQ_NRSYNTHS:
 		debug_printk(("nr synths\n"));
-		return put_user(dp->max_synthdev, (int *)arg) ? -EFAULT : 0;
+		return put_user(dp->max_synthdev, p) ? -EFAULT : 0;
 
 	case SNDCTL_SEQ_NRMIDIS:
 		debug_printk(("nr midis\n"));
-		return put_user(dp->max_mididev, (int *)arg) ? -EFAULT : 0;
+		return put_user(dp->max_mididev, p) ? -EFAULT : 0;
 
 	case SNDCTL_SYNTH_MEMAVL:
 		debug_printk(("mem avail\n"));
-		if (get_user(dev, (int *)arg))
+		if (get_user(dev, p))
 			return -EFAULT;
 		val = snd_seq_oss_synth_ioctl(dp, dev, cmd, carg);
-		return put_user(val, (int *)arg) ? -EFAULT : 0;
+		return put_user(val, p) ? -EFAULT : 0;
 
 	case SNDCTL_FM_4OP_ENABLE:
 		debug_printk(("4op\n"));
-		if (get_user(dev, (int *)arg))
+		if (get_user(dev, p))
 			return -EFAULT;
 		snd_seq_oss_synth_ioctl(dp, dev, cmd, carg);
 		return 0;
@@ -157,7 +158,7 @@ snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long carg)
 		debug_printk(("threshold\n"));
 		if (! is_write_mode(dp->file_mode))
 			return 0;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val < 1)
 			val = 1;
@@ -170,14 +171,14 @@ snd_seq_oss_ioctl(seq_oss_devinfo_t *dp, unsigned int cmd, unsigned long carg)
 		debug_printk(("pretime\n"));
 		if (dp->readq == NULL || !is_read_mode(dp->file_mode))
 			return 0;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val <= 0)
 			val = -1;
 		else
 			val = (HZ * val) / 10;
 		dp->readq->pre_event_timeout = val;
-		return put_user(val, (int *)arg) ? -EFAULT : 0;
+		return put_user(val, p) ? -EFAULT : 0;
 
 	default:
 		debug_printk(("others\n"));
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c
index 04ad08435..5f8beb4a2 100644
--- a/sound/core/seq/seq.c
+++ b/sound/core/seq/seq.c
@@ -21,6 +21,7 @@
 
 #include <sound/driver.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/initval.h>
 
@@ -34,7 +35,11 @@
 #include "seq_info.h"
 #include <sound/seq_device.h>
 
+#if defined(CONFIG_SND_SEQ_DUMMY_MODULE)
+int seq_client_load[64] = {[0] = SNDRV_SEQ_CLIENT_DUMMY, [1 ... 63] = -1};
+#else
 int seq_client_load[64] = {[0 ... 63] = -1};
+#endif
 int seq_default_timer_class = SNDRV_TIMER_CLASS_GLOBAL;
 int seq_default_timer_sclass = SNDRV_TIMER_SCLASS_NONE;
 int seq_default_timer_card = -1;
@@ -48,19 +53,20 @@ MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_SUPPORTED_DEVICE("sound");
 
-MODULE_PARM(seq_client_load, "1-64i");
+static int boot_devs;
+module_param_array(seq_client_load, int, boot_devs, 0444);
 MODULE_PARM_DESC(seq_client_load, "The numbers of global (system) clients to load through kmod.");
-MODULE_PARM(seq_default_timer_class, "i");
+module_param(seq_default_timer_class, int, 0644);
 MODULE_PARM_DESC(seq_default_timer_class, "The default timer class.");
-MODULE_PARM(seq_default_timer_sclass, "i");
+module_param(seq_default_timer_sclass, int, 0644);
 MODULE_PARM_DESC(seq_default_timer_sclass, "The default timer slave class.");
-MODULE_PARM(seq_default_timer_card, "i");
+module_param(seq_default_timer_card, int, 0644);
 MODULE_PARM_DESC(seq_default_timer_card, "The default timer card number.");
-MODULE_PARM(seq_default_timer_device, "i");
+module_param(seq_default_timer_device, int, 0644);
 MODULE_PARM_DESC(seq_default_timer_device, "The default timer device number.");
-MODULE_PARM(seq_default_timer_subdevice, "i");
+module_param(seq_default_timer_subdevice, int, 0644);
 MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice number.");
-MODULE_PARM(seq_default_timer_resolution, "i");
+module_param(seq_default_timer_resolution, int, 0644);
 MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz.");
 
 /*
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 40fef22f5..9e67d06da 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2154,17 +2154,17 @@ static int snd_seq_do_ioctl(client_t *client, unsigned int cmd, void __user *arg
 	switch (cmd) {
 	case SNDRV_SEQ_IOCTL_PVERSION:
 		/* return sequencer version number */
-		return put_user(SNDRV_SEQ_VERSION, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_SEQ_VERSION, (int __user *)arg) ? -EFAULT : 0;
 	case SNDRV_SEQ_IOCTL_CLIENT_ID:
 		/* return the id of this client */
-		return put_user(client->number, (int *)arg) ? -EFAULT : 0;
+		return put_user(client->number, (int __user *)arg) ? -EFAULT : 0;
 	}
 
 	if (! arg)
 		return -EFAULT;
 	for (p = ioctl_tables; p->cmd; p++) {
 		if (p->cmd == cmd)
-			return p->func(client, (void __user *) arg);
+			return p->func(client, arg);
 	}
 	snd_printd("seq unknown ioctl() 0x%x (type='%c', number=0x%2x)\n",
 		   cmd, _IOC_TYPE(cmd), _IOC_NR(cmd));
@@ -2348,7 +2348,7 @@ int snd_seq_kernel_client_dispatch(int client, snd_seq_event_t * ev,
  * exported, called by kernel clients to perform same functions as with
  * userland ioctl() 
  */
-int snd_seq_kernel_client_ctl(int clientid, unsigned int cmd, void __user *arg)
+int snd_seq_kernel_client_ctl(int clientid, unsigned int cmd, void *arg)
 {
 	client_t *client;
 	mm_segment_t fs;
diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c
index e05095a7d..eb7f13b5f 100644
--- a/sound/core/seq/seq_dummy.c
+++ b/sound/core/seq/seq_dummy.c
@@ -21,6 +21,7 @@
 #include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include "seq_clientmgr.h"
 #include <sound/initval.h>
@@ -64,12 +65,14 @@ MODULE_DESCRIPTION("ALSA sequencer MIDI-through client");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_SUPPORTED_DEVICE("sound");
-MODULE_PARM(ports, "i");
+
+static int ports = 1;
+static int duplex = 0;
+
+module_param(ports, int, 0444);
 MODULE_PARM_DESC(ports, "number of ports to be created");
-MODULE_PARM(duplex, "i");
+module_param(duplex, bool, 0444);
 MODULE_PARM_DESC(duplex, "create DUPLEX ports");
-int ports = 1;
-int duplex = 0;
 
 typedef struct snd_seq_dummy_port {
 	int client;
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index 298cfd317..fbcfd3c8a 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -90,7 +90,7 @@ int snd_seq_dump_var_event(const snd_seq_event_t *event, snd_seq_dump_func_t fun
 
 	if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) {
 		char buf[32];
-		char *curptr = event->data.ext.ptr;
+		char __user *curptr = event->data.ext.ptr;
 		while (len > 0) {
 			int size = sizeof(buf);
 			if (len < size)
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index ebfb232eb..a2a4b83f8 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -31,6 +31,7 @@ Possible options for midisynth module:
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <linux/moduleparam.h>
 #include <asm/semaphore.h>
 #include <sound/core.h>
 #include <sound/rawmidi.h>
@@ -45,10 +46,10 @@ MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_SUPPORTED_DEVICE("sound");
 int output_buffer_size = PAGE_SIZE;
-MODULE_PARM(output_buffer_size, "i");
+module_param(output_buffer_size, int, 0644);
 MODULE_PARM_DESC(output_buffer_size, "Output buffer size in bytes.");
 int input_buffer_size = PAGE_SIZE;
-MODULE_PARM(input_buffer_size, "i");
+module_param(input_buffer_size, int, 0644);
 MODULE_PARM_DESC(input_buffer_size, "Input buffer size in bytes.");
 
 /* data for this midi synth driver */
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 7790d08b9..558a8dbaa 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -23,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/minors.h>
 #include <sound/info.h>
@@ -45,15 +46,15 @@ MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_SUPPORTED_DEVICE("sound");
-MODULE_PARM(major, "i");
+module_param(major, int, 0444);
 MODULE_PARM_DESC(major, "Major # for sound driver.");
 MODULE_PARM_SYNTAX(major, "default:116,skill:devel");
-MODULE_PARM(cards_limit, "i");
+module_param(cards_limit, int, 0444);
 MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
 MODULE_PARM_SYNTAX(cards_limit, "default:8,skill:advanced");
 MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
 #ifdef CONFIG_DEVFS_FS
-MODULE_PARM(device_mode, "i");
+module_param(device_mode, int, 0444);
 MODULE_PARM_DESC(device_mode, "Device file permission mask for devfs.");
 MODULE_PARM_SYNTAX(device_mode, "default:0666,base:8");
 #endif
@@ -465,6 +466,12 @@ EXPORT_SYMBOL(snd_card_file_add);
 EXPORT_SYMBOL(snd_card_file_remove);
 #ifdef CONFIG_PM
 EXPORT_SYMBOL(snd_power_wait);
+EXPORT_SYMBOL(snd_card_set_pm_callback);
+EXPORT_SYMBOL(snd_card_set_dev_pm_callback);
+#ifdef CONFIG_PCI
+EXPORT_SYMBOL(snd_card_pci_suspend);
+EXPORT_SYMBOL(snd_card_pci_resume);
+#endif
 #endif
   /* device.c */
 EXPORT_SYMBOL(snd_device_new);
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 35c5d05f2..6f6d89c43 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/timer.h>
 #include <sound/control.h>
@@ -46,7 +47,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>");
 MODULE_DESCRIPTION("ALSA timer interface");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
-MODULE_PARM(timer_limit, "i");
+module_param(timer_limit, int, 0444);
 MODULE_PARM_DESC(timer_limit, "Maximum global timers in system.");
 
 typedef struct {
@@ -1252,7 +1253,7 @@ static void snd_timer_user_copy_id(snd_timer_id_t *id, snd_timer_t *timer)
 	id->subdevice = timer->tmr_subdevice;
 }
 
-static int snd_timer_user_next_device(snd_timer_id_t *_tid)
+static int snd_timer_user_next_device(snd_timer_id_t __user *_tid)
 {
 	snd_timer_id_t id;
 	snd_timer_t *timer;
@@ -1343,7 +1344,7 @@ static int snd_timer_user_next_device(snd_timer_id_t *_tid)
 	return 0;
 } 
 
-static int snd_timer_user_ginfo(struct file *file, snd_timer_ginfo_t *_ginfo)
+static int snd_timer_user_ginfo(struct file *file, snd_timer_ginfo_t __user *_ginfo)
 {
 	snd_timer_ginfo_t ginfo;
 	snd_timer_id_t tid;
@@ -1381,7 +1382,7 @@ static int snd_timer_user_ginfo(struct file *file, snd_timer_ginfo_t *_ginfo)
 	return err;
 }
 
-static int snd_timer_user_gparams(struct file *file, snd_timer_gparams_t *_gparams)
+static int snd_timer_user_gparams(struct file *file, snd_timer_gparams_t __user *_gparams)
 {
 	snd_timer_gparams_t gparams;
 	snd_timer_t *t;
@@ -1407,7 +1408,7 @@ static int snd_timer_user_gparams(struct file *file, snd_timer_gparams_t *_gpara
 	return err;
 }
 
-static int snd_timer_user_gstatus(struct file *file, snd_timer_gstatus_t *_gstatus)
+static int snd_timer_user_gstatus(struct file *file, snd_timer_gstatus_t __user *_gstatus)
 {
 	snd_timer_gstatus_t gstatus;
 	snd_timer_id_t tid;
@@ -1436,12 +1437,12 @@ static int snd_timer_user_gstatus(struct file *file, snd_timer_gstatus_t *_gstat
 		err = -ENODEV;
 	}
 	up(&register_mutex);
-	if (err >= 0 && copy_from_user(_gstatus, &gstatus, sizeof(gstatus)))
+	if (err >= 0 && copy_to_user(_gstatus, &gstatus, sizeof(gstatus)))
 		err = -EFAULT;
 	return err;
 }
 
-static int snd_timer_user_tselect(struct file *file, snd_timer_select_t *_tselect)
+static int snd_timer_user_tselect(struct file *file, snd_timer_select_t __user *_tselect)
 {
 	snd_timer_user_t *tu;
 	snd_timer_select_t tselect;
@@ -1488,7 +1489,7 @@ static int snd_timer_user_tselect(struct file *file, snd_timer_select_t *_tselec
 	return 0;
 }
 
-static int snd_timer_user_info(struct file *file, snd_timer_info_t *_info)
+static int snd_timer_user_info(struct file *file, snd_timer_info_t __user *_info)
 {
 	snd_timer_user_t *tu;
 	snd_timer_info_t info;
@@ -1510,9 +1511,8 @@ static int snd_timer_user_info(struct file *file, snd_timer_info_t *_info)
 	return 0;
 }
 
-static int snd_timer_user_params(struct file *file, snd_timer_params_t *_params)
+static int snd_timer_user_params(struct file *file, snd_timer_params_t __user *_params)
 {
-	unsigned long flags;
 	snd_timer_user_t *tu;
 	snd_timer_params_t params;
 	snd_timer_t *t;
@@ -1548,18 +1548,17 @@ static int snd_timer_user_params(struct file *file, snd_timer_params_t *_params)
 		goto _end;
 	}
 	snd_timer_stop(tu->timeri);
-	spin_lock_irqsave(&t->lock, flags);
-	if (params.flags & SNDRV_TIMER_PSFLG_AUTO) {
+	spin_lock_irq(&t->lock);
+	tu->timeri->flags &= ~(SNDRV_TIMER_IFLG_AUTO|
+			       SNDRV_TIMER_IFLG_EXCLUSIVE|
+			       SNDRV_TIMER_IFLG_EARLY_EVENT);
+	if (params.flags & SNDRV_TIMER_PSFLG_AUTO)
 		tu->timeri->flags |= SNDRV_TIMER_IFLG_AUTO;
-	} else {
-		tu->timeri->flags &= ~SNDRV_TIMER_IFLG_AUTO;
-	}
-	if (params.flags & SNDRV_TIMER_PSFLG_EXCLUSIVE) {
+	if (params.flags & SNDRV_TIMER_PSFLG_EXCLUSIVE)
 		tu->timeri->flags |= SNDRV_TIMER_IFLG_EXCLUSIVE;
-	} else {
-		tu->timeri->flags &= ~SNDRV_TIMER_IFLG_EXCLUSIVE;
-	}
-	spin_unlock_irqrestore(&t->lock, flags);
+	if (params.flags & SNDRV_TIMER_PSFLG_EARLY_EVENT)
+		tu->timeri->flags |= SNDRV_TIMER_IFLG_EARLY_EVENT;
+	spin_unlock_irq(&t->lock);
 	if (params.queue_size > 0 && (unsigned int)tu->queue_size != params.queue_size) {
 		if (tu->tread) {
 			ttr = (snd_timer_tread_t *)kmalloc(params.queue_size * sizeof(snd_timer_tread_t), GFP_KERNEL);
@@ -1577,6 +1576,24 @@ static int snd_timer_user_params(struct file *file, snd_timer_params_t *_params)
 			}
 		}
 	}
+	tu->qhead = tu->qtail = tu->qused = 0;
+	if (tu->timeri->flags & SNDRV_TIMER_IFLG_EARLY_EVENT) {
+		if (tu->tread) {
+			snd_timer_tread_t tread;
+			tread.event = SNDRV_TIMER_EVENT_EARLY;
+			tread.tstamp.tv_sec = 0;
+			tread.tstamp.tv_nsec = 0;
+			tread.val = 0;
+			snd_timer_user_append_to_tqueue(tu, &tread);
+		} else {
+			snd_timer_read_t *r = &tu->queue[0];
+			r->resolution = 0;
+			r->ticks = 0;
+			tu->qused++;
+			tu->qtail++;
+		}
+		
+	}
 	tu->filter = params.filter;
 	tu->ticks = params.ticks;
 	err = 0;
@@ -1586,9 +1603,8 @@ static int snd_timer_user_params(struct file *file, snd_timer_params_t *_params)
 	return err;
 }
 
-static int snd_timer_user_status(struct file *file, snd_timer_status_t *_status)
+static int snd_timer_user_status(struct file *file, snd_timer_status_t __user *_status)
 {
-	unsigned long flags;
 	snd_timer_user_t *tu;
 	snd_timer_status_t status;
 	
@@ -1599,9 +1615,9 @@ static int snd_timer_user_status(struct file *file, snd_timer_status_t *_status)
 	status.resolution = snd_timer_resolution(tu->timeri);
 	status.lost = tu->timeri->lost;
 	status.overrun = tu->overrun;
-	spin_lock_irqsave(&tu->qlock, flags);
+	spin_lock_irq(&tu->qlock);
 	status.queue = tu->qused;
-	spin_unlock_irqrestore(&tu->qlock, flags);
+	spin_unlock_irq(&tu->qlock);
 	if (copy_to_user(_status, &status, sizeof(status)))
 		return -EFAULT;
 	return 0;
@@ -1645,38 +1661,40 @@ static int snd_timer_user_ioctl(struct inode *inode, struct file *file,
 				unsigned int cmd, unsigned long arg)
 {
 	snd_timer_user_t *tu;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	
 	tu = snd_magic_cast(snd_timer_user_t, file->private_data, return -ENXIO);
 	switch (cmd) {
 	case SNDRV_TIMER_IOCTL_PVERSION:
-		return put_user(SNDRV_TIMER_VERSION, (int *)arg) ? -EFAULT : 0;
+		return put_user(SNDRV_TIMER_VERSION, p) ? -EFAULT : 0;
 	case SNDRV_TIMER_IOCTL_NEXT_DEVICE:
-		return snd_timer_user_next_device((snd_timer_id_t *)arg);
+		return snd_timer_user_next_device(argp);
 	case SNDRV_TIMER_IOCTL_TREAD:
 	{
 		int xarg;
 		
 		if (tu->timeri)		/* too late */
 			return -EBUSY;
-		if (get_user(xarg, (int *) arg))
+		if (get_user(xarg, p))
 			return -EFAULT;
 		tu->tread = xarg ? 1 : 0;
 		return 0;
 	}
 	case SNDRV_TIMER_IOCTL_GINFO:
-		return snd_timer_user_ginfo(file, (snd_timer_ginfo_t *)arg);
+		return snd_timer_user_ginfo(file, argp);
 	case SNDRV_TIMER_IOCTL_GPARAMS:
-		return snd_timer_user_gparams(file, (snd_timer_gparams_t *)arg);
+		return snd_timer_user_gparams(file, argp);
 	case SNDRV_TIMER_IOCTL_GSTATUS:
-		return snd_timer_user_gstatus(file, (snd_timer_gstatus_t *)arg);
+		return snd_timer_user_gstatus(file, argp);
 	case SNDRV_TIMER_IOCTL_SELECT:
-		return snd_timer_user_tselect(file, (snd_timer_select_t *)arg);
+		return snd_timer_user_tselect(file, argp);
 	case SNDRV_TIMER_IOCTL_INFO:
-		return snd_timer_user_info(file, (snd_timer_info_t *)arg);
+		return snd_timer_user_info(file, argp);
 	case SNDRV_TIMER_IOCTL_PARAMS:
-		return snd_timer_user_params(file, (snd_timer_params_t *)arg);
+		return snd_timer_user_params(file, argp);
 	case SNDRV_TIMER_IOCTL_STATUS:
-		return snd_timer_user_status(file, (snd_timer_status_t *)arg);
+		return snd_timer_user_status(file, argp);
 	case SNDRV_TIMER_IOCTL_START:
 		return snd_timer_user_start(file);
 	case SNDRV_TIMER_IOCTL_STOP:
@@ -1699,7 +1717,7 @@ static int snd_timer_user_fasync(int fd, struct file * file, int on)
 	return 0;
 }
 
-static ssize_t snd_timer_user_read(struct file *file, char *buffer, size_t count, loff_t *offset)
+static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, size_t count, loff_t *offset)
 {
 	snd_timer_user_t *tu;
 	long result = 0, unit;
@@ -1848,18 +1866,6 @@ static void __exit alsa_timer_exit(void)
 module_init(alsa_timer_init)
 module_exit(alsa_timer_exit)
 
-#ifndef MODULE
-/* format is: snd-timer=timer_limit */
-
-static int __init alsa_timer_setup(char *str)
-{
-	(void)(get_option(&str,&timer_limit) == 2);
-	return 1;
-}
-
-__setup("snd-timer=", alsa_timer_setup);
-#endif /* ifndef MODULE */
-
 EXPORT_SYMBOL(snd_timer_open);
 EXPORT_SYMBOL(snd_timer_close);
 EXPORT_SYMBOL(snd_timer_resolution);
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index e707b8f97..b6fba1a97 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -24,11 +24,11 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -129,23 +129,24 @@ static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
 static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
 static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8};
 //static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for dummy soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for dummy soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(pcm_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_devs, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
 MODULE_PARM_SYNTAX(pcm_devs, SNDRV_ENABLED ",allows:{{0,4}},default:1,dialog:list");
-MODULE_PARM(pcm_substreams, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_substreams, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
 MODULE_PARM_SYNTAX(pcm_substreams, SNDRV_ENABLED ",allows:{{1,16}},default:8,dialog:list");
-//MODULE_PARM(midi_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+//module_param_array(midi_devs, int, boot_devs, 0444);
 //MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
 //MODULE_PARM_SYNTAX(midi_devs, SNDRV_ENABLED ",allows:{{0,2}},default:8,dialog:list");
 
@@ -661,27 +662,3 @@ static void __exit alsa_card_dummy_exit(void)
 
 module_init(alsa_card_dummy_init)
 module_exit(alsa_card_dummy_exit)
-
-#ifndef MODULE
-
-/* format is: snd-dummy=enable,index,id,
-			pcm_devs,pcm_substreams */
-
-static int __init alsa_card_dummy_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_devs[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_substreams[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-dummy=", alsa_card_dummy_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index ced81e5ec..dac8fb1d7 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -30,9 +30,9 @@
 #ifdef CONFIG_ACPI_BUS
 #include <acpi/acpi_bus.h>
 #endif
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #ifdef CONFIG_ACPI_BUS
@@ -55,29 +55,30 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* MPU-401 IRQ */
 #ifdef CONFIG_X86_PC9800
 static int pc98ii[SNDRV_CARDS];				/* PC98-II dauther board */
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for MPU-401 device.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for MPU-401 device.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable MPU-401 device.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef USE_ACPI_PNP
-MODULE_PARM(acpipnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(acpipnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(acpipnp, "ACPI PnP detection for MPU-401 device.");
 MODULE_PARM_SYNTAX(acpipnp, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
 #endif
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for MPU-401 device.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
 #ifdef CONFIG_X86_PC9800
-MODULE_PARM(pc98ii, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pc98ii, bool, boot_devs, 0444);
 MODULE_PARM_DESC(pc98ii, "Roland MPU-PC98II support.");
 MODULE_PARM_SYNTAX(pc98ii, SNDRV_BOOLEAN_FALSE_DESC);
 #endif
@@ -303,35 +304,3 @@ static void __exit alsa_card_mpu401_exit(void)
 
 module_init(alsa_card_mpu401_init)
 module_exit(alsa_card_mpu401_exit)
-
-#ifndef MODULE
-
-/* format is: snd-mpu401=enable,index,id,acpipnp[,pc98ii],port,irq */
-
-static int __init alsa_card_mpu401_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-#ifdef CONFIG_X86_PC9800
-	       get_option(&str,&pc98ii[nr_dev]) == 2 &&
-#endif
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2);
-#ifdef USE_ACPI_PNP
-	if (pnp != INT_MAX)
-		acpipnp[nr_dev] = pnp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-mpu401=", alsa_card_mpu401_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index e2a3425b3..d6529a444 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -55,8 +55,8 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/rawmidi.h>
 #include <linux/delay.h>
@@ -83,19 +83,19 @@ static long port = MTPAV_IOBASE;	/* 0x378, 0x278 */
 static int irq = MTPAV_IRQ;		/* 7, 5 */
 static int hwports = MTPAV_MAX_PORTS;	/* use hardware ports 1-8 */
 
-MODULE_PARM(index, "i");
+module_param(index, int, 0444);
 MODULE_PARM_DESC(index, "Index value for MotuMTPAV MIDI.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "s");
+module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for MotuMTPAV MIDI.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(port, "l");
+module_param(port, long, 0444);
 MODULE_PARM_DESC(port, "Parallel port # for MotuMTPAV MIDI.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x378},{0x278}},dialog:list");
-MODULE_PARM(irq, "i");
+module_param(irq, int, 0444);
 MODULE_PARM_DESC(irq, "Parallel IRQ # for MotuMTPAV MIDI.");
 MODULE_PARM_SYNTAX(irq,  SNDRV_ENABLED ",allows:{{7},{5}},dialog:list");
-MODULE_PARM(hwports, "i");
+module_param(hwports, int, 0444);
 MODULE_PARM_DESC(hwports, "Hardware ports # for MotuMTPAV MIDI.");
 MODULE_PARM_SYNTAX(hwports, SNDRV_ENABLED ",allows:{{1,8}},dialog:list");
 
@@ -800,25 +800,3 @@ static void __exit alsa_card_mtpav_exit(void)
 
 module_init(alsa_card_mtpav_init)
 module_exit(alsa_card_mtpav_exit)
-
-#ifndef MODULE
-
-/* format is: snd-mtpav=enable,index,id,
-			port,irq,hwports */
-
-static int __init alsa_card_mtpav_setup(char *str)
-{
-        int __attribute__ ((__unused__)) enable = 1;
-
-	(void)(get_option(&str,&enable) == 2 &&
-	       get_option(&str,&index) == 2 &&
-	       get_id(&str,&id) == 2 &&
-	       get_option_long(&str,&port) == 2 &&
-	       get_option(&str,&irq) == 2 &&
-	       get_option(&str,&hwports) == 2);
-	return 1;
-}
-
-__setup("snd-mtpav=", alsa_card_mtpav_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c
index 5504605ad..d3193b03e 100644
--- a/sound/drivers/opl3/opl3_oss.c
+++ b/sound/drivers/opl3/opl3_oss.c
@@ -24,7 +24,7 @@
 static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure);
 static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg);
 static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg);
-static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char *buf, int offs, int count);
+static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count);
 static int snd_opl3_reset_seq_oss(snd_seq_oss_arg_t *arg);
 
 /* */
@@ -207,7 +207,7 @@ static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg)
 #define SBFM_MAXINSTR	256
 
 static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
-				       const char *buf, int offs, int count)
+				       const char __user *buf, int offs, int count)
 {
 	opl3_t *opl3;
 	int err = -EINVAL;
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index 3f7748134..c6953b89c 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -24,6 +24,7 @@
 
 #include "opl3_voice.h"
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Uros Bizjak <uros@kss-loka.si>");
@@ -32,7 +33,7 @@ MODULE_DESCRIPTION("ALSA driver for OPL3 FM synth");
 MODULE_CLASSES("{sound}");
 
 int use_internal_drums = 0;
-MODULE_PARM(use_internal_drums, "i");
+module_param(use_internal_drums, bool, 0444);
 MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums.");
 
 int snd_opl3_synth_use_inc(opl3_t * opl3)
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index bd39864db..1e6472e3b 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -94,6 +94,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
 		   unsigned int cmd, unsigned long arg)
 {
 	opl3_t *opl3 = snd_magic_cast(opl3_t, hw->private_data, return -ENXIO);
+	void __user *argp = (void __user *)arg;
 
 	snd_assert(opl3 != NULL, return -EINVAL);
 
@@ -105,7 +106,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
 
 			info.fm_mode = opl3->fm_mode;
 			info.rhythm = opl3->rhythm;
-			if (copy_to_user((snd_dm_fm_info_t *) arg, &info, sizeof(snd_dm_fm_info_t)))
+			if (copy_to_user(argp, &info, sizeof(snd_dm_fm_info_t)))
 				return -EFAULT;
 			return 0;
 		}
@@ -123,7 +124,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
 #endif
 		{
 			snd_dm_fm_note_t note;
-			if (copy_from_user(&note, (snd_dm_fm_note_t *) arg, sizeof(snd_dm_fm_note_t)))
+			if (copy_from_user(&note, argp, sizeof(snd_dm_fm_note_t)))
 				return -EFAULT;
 			return snd_opl3_play_note(opl3, &note);
 		}
@@ -134,7 +135,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
 #endif
 		{
 			snd_dm_fm_voice_t voice;
-			if (copy_from_user(&voice, (snd_dm_fm_voice_t *) arg, sizeof(snd_dm_fm_voice_t)))
+			if (copy_from_user(&voice, argp, sizeof(snd_dm_fm_voice_t)))
 				return -EFAULT;
 			return snd_opl3_set_voice(opl3, &voice);
 		}
@@ -145,7 +146,7 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
 #endif
 		{
 			snd_dm_fm_params_t params;
-			if (copy_from_user(&params, (snd_dm_fm_params_t *) arg, sizeof(snd_dm_fm_params_t)))
+			if (copy_from_user(&params, argp, sizeof(snd_dm_fm_params_t)))
 				return -EFAULT;
 			return snd_opl3_set_params(opl3, &params);
 		}
diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c
index 2b346d600..f2f364d15 100644
--- a/sound/drivers/opl4/opl4_proc.c
+++ b/sound/drivers/opl4/opl4_proc.c
@@ -50,7 +50,7 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry,
 }
 
 static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_data,
-				   struct file *file, char *_buf, long count)
+				   struct file *file, char __user *_buf, long count)
 {
 	opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO);
 	long size;
@@ -76,7 +76,7 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d
 }
 
 static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_data,
-				    struct file *file, const char *_buf, long count)
+				    struct file *file, const char __user *_buf, long count)
 {
 	opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO);
 	long size;
diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c
index 27b4c05e1..cc0dee9c2 100644
--- a/sound/drivers/opl4/opl4_seq.c
+++ b/sound/drivers/opl4/opl4_seq.c
@@ -33,6 +33,7 @@
 
 #include "opl4_local.h"
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
@@ -42,7 +43,7 @@ MODULE_CLASSES("{sound}");
 
 int volume_boost = 8;
 
-MODULE_PARM(volume_boost, "i");
+module_param(volume_boost, int, 0644);
 MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds.");
 MODULE_PARM_SYNTAX(volume_boost, "default:8");
 
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index fda496447..1e639aeb9 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -35,9 +35,9 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/rawmidi.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <linux/serial_reg.h>
@@ -77,39 +77,40 @@ static int outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};	 /* 1 to 16 */
 static int ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};	/* 1 to 16 */
 static int adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};
 static int droponfull[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS -1)] = SNDRV_SERIAL_NORMALBUFF };
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Serial MIDI.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Serial MIDI.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable UART16550A chip.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for UART16550A chip.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for UART16550A chip.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(speed, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(speed, int, boot_devs, 0444);
 MODULE_PARM_DESC(speed, "Speed in bauds.");
 MODULE_PARM_SYNTAX(speed, SNDRV_ENABLED ",allows:{9600,19200,38400,57600,115200},dialog:list");
-MODULE_PARM(base, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(base, int, boot_devs, 0444);
 MODULE_PARM_DESC(base, "Base for divisor in bauds.");
 MODULE_PARM_SYNTAX(base, SNDRV_ENABLED ",allows:{57600,115200,230400,460800},dialog:list");
-MODULE_PARM(outs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(outs, int, boot_devs, 0444);
 MODULE_PARM_DESC(outs, "Number of MIDI outputs.");
-MODULE_PARM(ins, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ins, int, boot_devs, 0444);
 MODULE_PARM_DESC(ins, "Number of MIDI inputs.");
-MODULE_PARM(droponfull, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(droponfull, bool, boot_devs, 0444);
 MODULE_PARM_DESC(droponfull, "Flag to enable drop-on-full buffer mode");
 MODULE_PARM_SYNTAX(droponfull, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
 MODULE_PARM_SYNTAX(outs, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
 MODULE_PARM_SYNTAX(ins, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
-MODULE_PARM(adaptor, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(adaptor, int, boot_devs, 0444);
 MODULE_PARM_DESC(adaptor, "Type of adaptor.");
 MODULE_PARM_SYNTAX(adaptor, SNDRV_ENABLED ",allows:{{0=Soundcanvas,1=MS-124T,2=MS-124W S/A,3=MS-124W M/B,4=Generic}},dialog:list");
 
@@ -987,34 +988,3 @@ static void __exit alsa_card_serial_exit(void)
 
 module_init(alsa_card_serial_init)
 module_exit(alsa_card_serial_exit)
-
-#ifndef MODULE
-
-/* format is: snd-serial=enable,index,id,
-			 port,irq,speed,base,outs,
- 			 ins,adaptor,droponfull */
-
-static int __init alsa_card_serial_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&speed[nr_dev]) == 2 &&
-	       get_option(&str,&base[nr_dev]) == 2 &&
-	       get_option(&str,&outs[nr_dev]) == 2 &&
-	       get_option(&str,&ins[nr_dev]) == 2 &&
-	       get_option(&str,&adaptor[nr_dev]) == 2 &&
-	       get_option(&str,&droponfull[nr_dev]) == 2 );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-serial=", alsa_card_serial_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index 4ade60026..73eefd29c 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -45,10 +45,10 @@
 #include <linux/init.h>
 #include <linux/wait.h>
 #include <linux/sched.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/seq_kernel.h>
 #include <sound/seq_virmidi.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 /* hack: OSS defines midi_devs, so undefine it (versioned symbols) */
@@ -66,17 +66,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
 static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for virmidi soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for virmidi soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable this soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(midi_devs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(midi_devs, int, boot_devs, 0444);
 MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-8)");
 MODULE_PARM_SYNTAX(midi_devs, SNDRV_ENABLED ",allows:{{1,8}}");
 
@@ -162,25 +163,3 @@ static void __exit alsa_card_virmidi_exit(void)
 
 module_init(alsa_card_virmidi_init)
 module_exit(alsa_card_virmidi_exit)
-
-#ifndef MODULE
-
-/* format is: snd-virmidi=enable,index,id,midi_devs */
-
-static int __init alsa_card_virmidi_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&midi_devs[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-virmidi=", alsa_card_virmidi_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index e08ff62c5..3a5671838 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -23,8 +23,8 @@
 #include <linux/time.h>
 #include <linux/wait.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/ad1816a.h>
 #include <sound/mpu401.h>
@@ -56,35 +56,36 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* Pnp setup */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* Pnp setup */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ad1816a based soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ad1816a based soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ad1816a based soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for ad1816a driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for ad1816a driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for ad1816a driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for ad1816a driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for ad1816a driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "1st DMA # for ad1816a driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "2nd DMA # for ad1816a driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
 
@@ -323,33 +324,3 @@ static void __exit alsa_card_ad1816a_exit(void)
 
 module_init(alsa_card_ad1816a_init)
 module_exit(alsa_card_ad1816a_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ad1816a=enable,index,id,port,
-			  mpu_port,fm_port,irq,mpu_irq,
-			  dma1,dma2 */
-
-static int __init alsa_card_ad1816a_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-ad1816a=", alsa_card_ad1816a_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index ac8f6b613..afd232fd5 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -25,9 +25,9 @@
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/ad1848.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define chip_t ad1848_t
@@ -47,26 +47,27 @@ static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* PnP setup */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,11,12,15 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
 static int thinkpad[SNDRV_CARDS];			/* Thinkpad special case */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for AD1848 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for AD1848 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable AD1848 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for AD1848 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for AD1848 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for AD1848 driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(thinkpad, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(thinkpad, bool, boot_devs, 0444);
 MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series.");
 MODULE_PARM_SYNTAX(thinkpad,  SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -159,29 +160,3 @@ static void __exit alsa_card_ad1848_exit(void)
 
 module_init(alsa_card_ad1848_init)
 module_exit(alsa_card_ad1848_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ad1848=enable,index,id,port,
-			 irq,dma1 */
-
-static int __init alsa_card_ad1848_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&thinkpad[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-ad1848=", alsa_card_ad1848_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index 3473788bd..fe913bf4f 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -647,12 +647,12 @@ static void snd_ad1848_thinkpad_twiddle(ad1848_t *chip, int on) {
 }
 
 #ifdef CONFIG_PM
-static void snd_ad1848_suspend(ad1848_t *chip) {
-
-	snd_card_t *card = chip->card;
+static int snd_ad1848_suspend(snd_card_t *card, unsigned int state)
+{
+	ad1848_t *chip = snd_magic_cast(ad1848_t, card->pm_private_data, return -EINVAL);
 
 	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
+		return 0;
 
 	snd_pcm_suspend_all(chip->pcm);
 	/* FIXME: save registers? */
@@ -661,14 +661,15 @@ static void snd_ad1848_suspend(ad1848_t *chip) {
 		snd_ad1848_thinkpad_twiddle(chip, 0);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void snd_ad1848_resume(ad1848_t *chip) {
-
-	snd_card_t *card = chip->card;
+static int snd_ad1848_resume(snd_card_t *card, unsigned int state)
+{
+	ad1848_t *chip = snd_magic_cast(ad1848_t, card->pm_private_data, return -EINVAL);
 
 	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+		return 0;
 
 	if (chip->thinkpad_flag)
 		snd_ad1848_thinkpad_twiddle(chip, 1);
@@ -676,43 +677,8 @@ static void snd_ad1848_resume(ad1848_t *chip) {
 	/* FIXME: restore registers? */
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-/* callback for control API */
-static int snd_ad1848_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	ad1848_t *chip = (ad1848_t *) card->power_state_private_data;
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_ad1848_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_ad1848_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
 	return 0;
 }
-
-static int snd_ad1848_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
-	ad1848_t *chip = snd_magic_cast(ad1848_t, dev->data, return 0);
-
-	switch (rqst) {
-	case PM_SUSPEND:
-		snd_ad1848_suspend(chip);
-		break;
-	case PM_RESUME:
-		snd_ad1848_resume(chip);
-		break;
-	}
-	return 0;
-}
-
 #endif /* CONFIG_PM */
 
 static int snd_ad1848_probe(ad1848_t * chip)
@@ -891,10 +857,6 @@ static int snd_ad1848_capture_close(snd_pcm_substream_t * substream)
 
 static int snd_ad1848_free(ad1848_t *chip)
 {
-#ifdef CONFIG_PM
-        if (chip->thinkpad_pmstate)
-                pm_unregister(chip->thinkpad_pmstate);
-#endif
 	if (chip->res_port) {
 		release_resource(chip->res_port);
 		kfree_nocheck(chip->res_port);
@@ -973,14 +935,7 @@ int snd_ad1848_create(snd_card_t * card,
 		chip->thinkpad_flag = 1;
 		chip->hardware = AD1848_HW_DETECT; /* reset */
 		snd_ad1848_thinkpad_twiddle(chip, 1);
-#ifdef CONFIG_PM
-		chip->thinkpad_pmstate = pm_register(PM_ISA_DEV, 0, snd_ad1848_pm_callback);
-		if (chip->thinkpad_pmstate) {
-			chip->thinkpad_pmstate->data = chip;
-			card->set_power_state = snd_ad1848_set_power_state; /* callback */
-			card->power_state_private_data = chip;
-		}
-#endif
+		snd_card_set_isa_pm_callback(card, snd_ad1848_suspend, snd_ad1848_resume, chip);
 	}
 
 	if (snd_ad1848_probe(chip) < 0) {
diff --git a/sound/isa/als100.c b/sound/isa/als100.c
index e2f1b55e2..6babe7ca3 100644
--- a/sound/isa/als100.c
+++ b/sound/isa/als100.c
@@ -25,8 +25,8 @@
 #include <linux/wait.h>
 #include <linux/time.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
@@ -59,35 +59,36 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* PnP setup */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* PnP setup */
 static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
 static int dma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for als100 based soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for als100 based soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable als100 based soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for als100 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for als100 driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for als100 driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for als100 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for als100 driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for als100 driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
-MODULE_PARM(dma16, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma16, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma16, "16-bit DMA # for als100 driver.");
 MODULE_PARM_SYNTAX(dma16, SNDRV_DMA16_DESC);
 
@@ -345,33 +346,3 @@ static void __exit alsa_card_als100_exit(void)
 
 module_init(alsa_card_als100_init)
 module_exit(alsa_card_als100_exit)
-
-#ifndef MODULE
-
-/* format is: snd-als100=enable,index,id,port,
-			 mpu_port,fm_port,irq,mpu_irq,
-			 dma8,dma16 */
-
-static int __init alsa_card_als100_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2 &&
-	       get_option(&str,&dma16[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-als100=", alsa_card_als100_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c
index 89d1f4ee6..4c71d4c0e 100644
--- a/sound/isa/azt2320.c
+++ b/sound/isa/azt2320.c
@@ -36,8 +36,8 @@
 #include <linux/time.h>
 #include <linux/wait.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
@@ -68,38 +68,39 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* Pnp setup */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* Pnp setup */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for azt2320 based soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for azt2320 based soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable azt2320 based soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for azt2320 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(wss_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(wss_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(wss_port, "WSS Port # for azt2320 driver.");
 MODULE_PARM_SYNTAX(wss_port, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for azt2320 driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for azt2320 driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for azt2320 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for azt2320 driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "1st DMA # for azt2320 driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "2nd DMA # for azt2320 driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
 
@@ -378,33 +379,3 @@ static void __exit alsa_card_azt2320_exit(void)
 
 module_init(alsa_card_azt2320_init)
 module_exit(alsa_card_azt2320_exit)
-
-#ifndef MODULE
-
-/* format is: snd-azt2320=enable,index,id,port,
-			  wss_port,mpu_port,fm_port,
-			  irq,mpu_irq,dma1,dma2 */
-
-static int __init alsa_card_azt2320_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&wss_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-azt2320=", alsa_card_azt2320_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index ea213f5dc..60a6f4f83 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -47,10 +47,10 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/ad1848.h>
 #include <sound/sb.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 /*
@@ -79,42 +79,43 @@ static int sbdma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
 static long wssport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
 static int wssirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
 static int wssdma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for CMI8330 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string  for CMI8330 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable CMI8330 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef CONFIG_PNP
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
 #endif
 
-MODULE_PARM(sbport, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(sbport, long, boot_devs, 0444);
 MODULE_PARM_DESC(sbport, "Port # for CMI8330 SB driver.");
 MODULE_PARM_SYNTAX(sbport, SNDRV_ENABLED ",allows:{{0x220,0x280,0x20}},prefers:{0x220},base:16,dialog:list");
-MODULE_PARM(sbirq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(sbirq, int, boot_devs, 0444);
 MODULE_PARM_DESC(sbirq, "IRQ # for CMI8330 SB driver.");
 MODULE_PARM_SYNTAX(sbirq, SNDRV_ENABLED ",allows:{{5},{7},{9},{10},{11},{12}},prefers:{5},dialog:list");
-MODULE_PARM(sbdma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(sbdma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(sbdma8, "DMA8 for CMI8330 SB driver.");
 MODULE_PARM_SYNTAX(sbdma8, SNDRV_DMA8_DESC ",prefers:{1}");
-MODULE_PARM(sbdma16, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(sbdma16, int, boot_devs, 0444);
 MODULE_PARM_DESC(sbdma16, "DMA16 for CMI8330 SB driver.");
 MODULE_PARM_SYNTAX(sbdma16, SNDRV_ENABLED ",allows:{{5},{7}},prefers:{5},dialog:list");
 
-MODULE_PARM(wssport, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(wssport, long, boot_devs, 0444);
 MODULE_PARM_DESC(wssport, "Port # for CMI8330 WSS driver.");
 MODULE_PARM_SYNTAX(wssport, SNDRV_ENABLED ",allows:{{0x530},{0xe80,0xf40,0xc0}},prefers:{0x530},base:16,dialog:list");
-MODULE_PARM(wssirq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(wssirq, int, boot_devs, 0444);
 MODULE_PARM_DESC(wssirq, "IRQ # for CMI8330 WSS driver.");
 MODULE_PARM_SYNTAX(wssirq, SNDRV_ENABLED ",allows:{{5},{7},{9},{10},{11},{12}},prefers:{11},dialog:list");
-MODULE_PARM(wssdma, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(wssdma, int, boot_devs, 0444);
 MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");
 MODULE_PARM_SYNTAX(wssdma, SNDRV_DMA8_DESC ",prefers:{0}");
 
@@ -643,41 +644,3 @@ static void __exit alsa_card_cmi8330_exit(void)
 
 module_init(alsa_card_cmi8330_init)
 module_exit(alsa_card_cmi8330_exit)
-
-#ifndef MODULE
-
-/* format is: snd-cmi8330=enable,index,id,isapnp,
-			  sbport,sbirq,
-			  sbdma8,sbdma16,
-			  wssport,wssirq,
-			  wssdma */
-
-static int __init alsa_card_cmi8330_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&sbport[nr_dev]) == 2 &&
-	       get_option(&str,&sbirq[nr_dev]) == 2 &&
-	       get_option(&str,&sbdma8[nr_dev]) == 2 &&
-	       get_option(&str,&sbdma16[nr_dev]) == 2 &&
-	       get_option_long(&str,&wssport[nr_dev]) == 2 &&
-	       get_option(&str,&wssirq[nr_dev]) == 2 &&
-	       get_option(&str,&wssdma[nr_dev]) == 2);
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp[nr_dev] = pnp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-cmi8330=", alsa_card_cmi8330_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index 155fbd9b2..205638d50 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -24,10 +24,10 @@
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define chip_t cs4231_t
@@ -47,32 +47,33 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,11,12,15 */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 9,11,12,15 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for CS4231 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for CS4231 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable CS4231 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for CS4231 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for CS4231 driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for CS4231 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for CS4231 driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for CS4231 driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for CS4231 driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
 
@@ -179,34 +180,3 @@ static void __exit alsa_card_cs4231_exit(void)
 
 module_init(alsa_card_cs4231_init)
 module_exit(alsa_card_cs4231_exit)
-
-#ifndef MODULE
-
-/* format is: snd-cs4231=enable,index,id,
-			 port,mpu_port,irq,mpu_irq,
-			 dma1,dma2 */
-
-static int __init alsa_card_cs4231_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-cs4231=", alsa_card_cs4231_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index 9778c7bfc..741ea0d4b 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -979,19 +979,27 @@ irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	}		
 	if (chip->single_dma && chip->hardware != CS4231_HW_INTERWAVE) {
 		if (status & CS4231_PLAYBACK_IRQ) {
-			if (chip->mode & CS4231_MODE_PLAY)
-				snd_pcm_period_elapsed(chip->playback_substream);
+			if (chip->mode & CS4231_MODE_PLAY) {
+				if (chip->playback_substream)
+					snd_pcm_period_elapsed(chip->playback_substream);
+			}
 			if (chip->mode & CS4231_MODE_RECORD) {
-				snd_cs4231_overrange(chip);
-				snd_pcm_period_elapsed(chip->capture_substream);
+				if (chip->capture_substream) {
+					snd_cs4231_overrange(chip);
+					snd_pcm_period_elapsed(chip->capture_substream);
+				}
 			}
 		}
 	} else {
-		if (status & CS4231_PLAYBACK_IRQ)
-			snd_pcm_period_elapsed(chip->playback_substream);
+		if (status & CS4231_PLAYBACK_IRQ) {
+			if (chip->playback_substream)
+				snd_pcm_period_elapsed(chip->playback_substream);
+		}
 		if (status & CS4231_RECORD_IRQ) {
-			snd_cs4231_overrange(chip);
-			snd_pcm_period_elapsed(chip->capture_substream);
+			if (chip->capture_substream) {
+				snd_cs4231_overrange(chip);
+				snd_pcm_period_elapsed(chip->capture_substream);
+			}
 		}
 	}
 
@@ -1343,6 +1351,7 @@ static int snd_cs4231_capture_close(snd_pcm_substream_t * substream)
 
 #ifdef CONFIG_PM
 
+/* lowlevel suspend callback for CS4231 */
 static void snd_cs4231_suspend(cs4231_t *chip)
 {
 	int reg;
@@ -1354,6 +1363,7 @@ static void snd_cs4231_suspend(cs4231_t *chip)
 	spin_unlock_irqrestore(&chip->reg_lock, flags);
 }
 
+/* lowlevel resume callback for CS4231 */
 static void snd_cs4231_resume(cs4231_t *chip)
 {
 	int reg;
@@ -1395,25 +1405,25 @@ static void snd_cs4231_resume(cs4231_t *chip)
 #endif
 }
 
-static int snd_cs4231_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+static int snd_cs4231_pm_suspend(snd_card_t *card, unsigned int state)
 {
-	cs4231_t *chip = snd_magic_cast(cs4231_t, dev->data, return 0);
-
-	switch (rqst) {
-	case PM_SUSPEND:
-		if (chip->suspend) {
-			snd_pcm_suspend_all(chip->pcm);
-			(*chip->suspend)(chip);
-		}
-		break;
-	case PM_RESUME:
-		if (chip->resume)
-			(*chip->resume)(chip);
-		break;
+	cs4231_t *chip = snd_magic_cast(cs4231_t, card->pm_private_data, return -EINVAL);
+	if (chip->suspend) {
+		chip->suspend(chip);
+		snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
 	}
 	return 0;
 }
 
+static int snd_cs4231_pm_resume(snd_card_t *card, unsigned int state)
+{
+	cs4231_t *chip = snd_magic_cast(cs4231_t, card->pm_private_data, return -EINVAL);
+	if (chip->resume) {
+		chip->resume(chip);
+		snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+	}
+	return 0;
+}
 #endif /* CONFIG_PM */
 
 #ifdef LEGACY_SUPPORT
@@ -1441,10 +1451,6 @@ static int snd_cs4231_free(cs4231_t *chip)
 		snd_dma_disable(chip->dma2);
 		free_dma(chip->dma2);
 	}
-#ifdef CONFIG_PM
-	if (chip->pm_dev)
-		pm_unregister(chip->pm_dev);
-#endif
 	if (chip->timer)
 		snd_device_free(chip->card, chip->timer);
 	snd_magic_kfree(chip);
@@ -1587,9 +1593,7 @@ int snd_cs4231_create(snd_card_t * card,
 	/* Power Management */
 	chip->suspend = snd_cs4231_suspend;
 	chip->resume = snd_cs4231_resume;
-	chip->pm_dev = pm_register(PM_ISA_DEV, 0, snd_cs4231_pm_callback);
-	if (chip->pm_dev)
-		chip->pm_dev->data = chip;
+	snd_card_set_isa_pm_callback(card, snd_cs4231_pm_suspend, snd_cs4231_pm_resume, chip);
 #endif
 
 	*rchip = chip;
@@ -1659,7 +1663,7 @@ int snd_cs4231_pcm(cs4231_t *chip, int device, snd_pcm_t **rpcm)
 #else
 #  ifdef EBUS_SUPPORT
         if (chip->ebus_flag) {
-                snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_PCI,
+                snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
                 				      chip->dev_u.pdev,
 						      64*1024, 128*1024);
         } else {
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index d9dd5ebff..b2fa15a3d 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -23,11 +23,11 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define chip_t cs4231_t
@@ -95,46 +95,47 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,11,12,15 */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 9,11,12,15 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " IDENT " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " IDENT " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable " IDENT " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef CONFIG_PNP
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
 #endif
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(cport, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(cport, long, boot_devs, 0444);
 MODULE_PARM_DESC(cport, "Control port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(cport, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(sb_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(sb_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(sb_port, "SB port # for " IDENT " driver (optional).");
 MODULE_PARM_SYNTAX(sb_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
 
@@ -198,6 +199,8 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = {
 	{ .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } },
 	/* Intel Marlin Spike Motherboard (#2) - CS4235 */
 	{ .id = "CSC0225", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC0103" } } },
+	/* Unknown Intel mainboard - CS4235 */
+	{ .id = "CSC0225", .devs = { { "CSC0100" }, { "CSC0110" } } },
 	/* Genius Sound Maker 3DJ - CS4237B */
 	{ .id = "CSC0437", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } },
 	/* Digital PC 5000 Onboard - CS4236B */
@@ -618,48 +621,3 @@ static void __exit alsa_card_cs423x_exit(void)
 
 module_init(alsa_card_cs423x_init)
 module_exit(alsa_card_cs423x_exit)
-
-#ifndef MODULE
-
-/* format is: snd-cs4232=enable,index,id,isapnp,port,
-			 cport,mpu_port,fm_port,sb_port,
-			 irq,mpu_irq,dma1,dma2 */
-/* format is: snd-cs4236=enable,index,id,isapnp,port,
-			 cport,mpu_port,fm_port,sb_port,
-			 irq,mpu_irq,dma1,dma2 */
-
-static int __init alsa_card_cs423x_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&cport[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&sb_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2);
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp[nr_dev] = pnp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-#ifdef CS4232
-__setup("snd-cs4232=", alsa_card_cs423x_setup);
-#else /* CS4236 */
-__setup("snd-cs4236=", alsa_card_cs423x_setup);
-#endif
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/cs423x/pc98.c b/sound/isa/cs423x/pc98.c
index 1bb9803c2..ec0b4ccc5 100644
--- a/sound/isa/cs423x/pc98.c
+++ b/sound/isa/cs423x/pc98.c
@@ -25,11 +25,11 @@
 #include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include "sound_pc9800.h"
 
@@ -57,43 +57,44 @@ static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 9,11,12,15 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3,5,6,7 */
 static int pc98ii[SNDRV_CARDS];				/* PC98II */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " IDENT " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " IDENT " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable " IDENT " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
 #if 0 /* NOT USED */
-MODULE_PARM(cport, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(cport, long, boot_devs, 0444);
 MODULE_PARM_DESC(cport, "Control port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(cport, SNDRV_PORT12_DESC);
 #endif
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
-MODULE_PARM(pc98ii, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pc98ii, bool, boot_devs, 0444);
 MODULE_PARM_DESC(pc98ii, "Roland MPU-PC98II support.");
 MODULE_PARM_SYNTAX(pc98ii, SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -435,34 +436,3 @@ static void __exit alsa_card_pc98_exit(void)
 
 module_init(alsa_card_pc98_init)
 module_exit(alsa_card_pc98_exit)
-
-#ifndef MODULE
-
-/* format is: snd-pc98-cs4232=enable,index,id,port,
-			 mpu_port,fm_port,
-			 irq,mpu_irq,dma1,dma2,pc98ii */
-
-static int __init alsa_card_pc98_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2 &&
-	       get_option(&str,&pc98ii[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-pc98-cs4232=", alsa_card_pc98_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c
index 0fb003a10..40132645d 100644
--- a/sound/isa/dt019x.c
+++ b/sound/isa/dt019x.c
@@ -26,8 +26,8 @@
 #include <linux/sched.h>
 #include <linux/wait.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
@@ -53,32 +53,33 @@ static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* PnP setup */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* PnP setup */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* PnP setup */
 static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for DT-019X based soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for DT-019X based soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable DT-019X based soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for dt019x driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for dt019x driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for dt019x driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for dt019x driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for dt019x driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for dt019x driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
 
@@ -337,32 +338,3 @@ static void __exit alsa_card_dt019x_exit(void)
 
 module_init(alsa_card_dt019x_init)
 module_exit(alsa_card_dt019x_exit)
-
-#ifndef MODULE
-
-/* format is: snd-dt019x=enable,index,id,
-			  port,mpu_port,fm_port,
-			  irq,mpu_irq,dma8,dma8_size */
-
-static int __init alsa_card_dt019x_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-dt019x=", alsa_card_dt019x_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 79a5dd6dc..a4a5a7c9a 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/es1688.h>
 #include <sound/mpu401.h>
@@ -31,7 +32,6 @@
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -51,29 +51,30 @@ static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,10 */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,10 */
 static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3 */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ESx688 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ESx688 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ESx688 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for ESx688 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for ESx688 driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for ESx688 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for ESx688 driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for ESx688 driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
 
@@ -211,32 +212,3 @@ static void __exit alsa_card_es1688_exit(void)
 
 module_init(alsa_card_es1688_init)
 module_exit(alsa_card_es1688_exit)
-
-#ifndef MODULE
-
-/* format is: snd-es1688=enable,index,id,
-			 port,mpu_port,
-			 irq,mpu_irq,
-			 dma8 */
-
-static int __init alsa_card_es1688_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-es1688=", alsa_card_es1688_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 90b1a4447..202eab49e 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -72,6 +72,7 @@
 #include <linux/slab.h>
 #include <linux/pnp.h>
 #include <linux/isapnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -81,7 +82,6 @@
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define PFX "es18xx: "
@@ -124,7 +124,6 @@ struct _snd_es18xx {
 	spinlock_t mixer_lock;
 	spinlock_t ctrl_lock;
 #ifdef CONFIG_PM
-	struct pm_dev *pm_dev;
 	unsigned char pm_reg;
 #endif
 };
@@ -1610,12 +1609,9 @@ int __devinit snd_es18xx_pcm(es18xx_t *chip, int device, snd_pcm_t ** rpcm)
 
 /* Power Management support functions */
 #ifdef CONFIG_PM
-static void snd_es18xx_suspend(es18xx_t *chip)
+static int snd_es18xx_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
+	es18xx_t *chip = snd_magic_cast(es18xx_t, card->pm_private_data, return -EINVAL);
 
 	snd_pcm_suspend_all(chip->pcm);
 
@@ -1626,63 +1622,23 @@ static void snd_es18xx_suspend(es18xx_t *chip)
 	snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_SUS);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void snd_es18xx_resume(es18xx_t *chip)
+static int snd_es18xx_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+	es18xx_t *chip = snd_magic_cast(es18xx_t, card->pm_private_data, return -EINVAL);
 
 	/* restore PM register, we won't wake till (not 0x07) i/o activity though */
 	snd_es18xx_write(chip, ES18XX_PM, chip->pm_reg ^= ES18XX_PM_FM);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-/* callback for control API */
-static int snd_es18xx_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	es18xx_t *chip = (es18xx_t *) card->power_state_private_data;
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_es18xx_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_es18xx_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
-static int snd_es18xx_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
-	es18xx_t *chip = snd_magic_cast(es18xx_t, dev->data, return 0);
-
-	switch (rqst) {
-	case PM_SUSPEND:
-		snd_es18xx_suspend(chip);
-		break;
-	case PM_RESUME:
-		snd_es18xx_resume(chip);
-		break;
-	}
 	return 0;
 }
 #endif /* CONFIG_PM */
 
 static int snd_es18xx_free(es18xx_t *chip)
 {
-#ifdef CONFIG_PM
-	if (chip->pm_dev)
-		pm_unregister(chip->pm_dev);
-#endif
 	if (chip->res_port) {
 		release_resource(chip->res_port);
 		kfree_nocheck(chip->res_port);
@@ -1900,37 +1856,38 @@ static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,10 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3 */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3 */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ES18xx soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ES18xx soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ES18xx soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef CONFIG_PNP
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
 #endif
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for ES18xx driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x220,0x280,0x20}},prefers:{0x220},base:16,dialog:list");
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for ES18xx driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0x300,0x330,0x30},{0x800,0xffe,0x2}},prefers:{0x330,0x300},base:16,dialog:combo");
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for ES18xx driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{0x388},{0x800,0xffc,0x4}},prefers:{0x388},base:16,dialog:combo");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for ES18xx driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC ",prefers:{5}");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA 1 # for ES18xx driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA8_DESC ",prefers:{1}");
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_ENABLED ",allows:{{0},{1},{3},{5}},dialog:list,prefers:{0}");
 
@@ -2149,16 +2106,9 @@ static int __devinit snd_audiodrive_probe(int dev, struct pnp_card_link *pcard,
 		chip->rmidi = rmidi;
 	}
 
-#ifdef CONFIG_PM
 	/* Power Management */
-	chip->pm_dev = pm_register(PM_ISA_DEV, 0, snd_es18xx_pm_callback);
-	if (chip->pm_dev) {
-		chip->pm_dev->data = chip;
-		/* set control api callback */
-		card->set_power_state = snd_es18xx_set_power_state;
-		card->power_state_private_data = chip;
-	}
-#endif
+	snd_card_set_isa_pm_callback(card, snd_es18xx_suspend, snd_es18xx_resume, chip);
+
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
@@ -2283,39 +2233,3 @@ static void __exit alsa_card_es18xx_exit(void)
 
 module_init(alsa_card_es18xx_init)
 module_exit(alsa_card_es18xx_exit)
-
-
-#ifndef MODULE
-
-/* format is: snd-es18xx=enable,index,id,isapnp,
-			 port,mpu_port,fm_port,irq,
-			 dma1,dma2 */
-
-static int __init alsa_card_es18xx_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2);
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp[nr_dev] = pnp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-es18xx=", alsa_card_es18xx_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/gus/gus_dram.c b/sound/isa/gus/gus_dram.c
index 44895d34f..0b73d4c5f 100644
--- a/sound/isa/gus/gus_dram.c
+++ b/sound/isa/gus/gus_dram.c
@@ -26,7 +26,7 @@
 #include <sound/info.h>
 
 
-static int snd_gus_dram_poke(snd_gus_card_t *gus, char *_buffer,
+static int snd_gus_dram_poke(snd_gus_card_t *gus, char __user *_buffer,
 			     unsigned int address, unsigned int size)
 {
 	unsigned long flags;
@@ -57,13 +57,13 @@ static int snd_gus_dram_poke(snd_gus_card_t *gus, char *_buffer,
 }
 
 
-int snd_gus_dram_write(snd_gus_card_t *gus, char *buffer,
+int snd_gus_dram_write(snd_gus_card_t *gus, char __user *buffer,
 		       unsigned int address, unsigned int size)
 {
 	return snd_gus_dram_poke(gus, buffer, address, size);
 }
 
-static int snd_gus_dram_peek(snd_gus_card_t *gus, char *_buffer,
+static int snd_gus_dram_peek(snd_gus_card_t *gus, char __user *_buffer,
 			     unsigned int address, unsigned int size,
 			     int rom)
 {
@@ -95,7 +95,7 @@ static int snd_gus_dram_peek(snd_gus_card_t *gus, char *_buffer,
 	return 0;
 }
 
-int snd_gus_dram_read(snd_gus_card_t *gus, char *buffer,
+int snd_gus_dram_read(snd_gus_card_t *gus, char __user *buffer,
 		      unsigned int address, unsigned int size,
 		      int rom)
 {
diff --git a/sound/isa/gus/gus_instr.c b/sound/isa/gus/gus_instr.c
index 031a77978..e819e907b 100644
--- a/sound/isa/gus/gus_instr.c
+++ b/sound/isa/gus/gus_instr.c
@@ -29,7 +29,7 @@
  */
 
 int snd_gus_iwffff_put_sample(void *private_data, iwffff_wave_t *wave,
-			      char *data, long len, int atomic)
+			      char __user *data, long len, int atomic)
 {
 	snd_gus_card_t *gus = snd_magic_cast(snd_gus_card_t, private_data, return -ENXIO);
 	snd_gf1_mem_block_t *block;
@@ -59,7 +59,7 @@ int snd_gus_iwffff_put_sample(void *private_data, iwffff_wave_t *wave,
 }
 
 int snd_gus_iwffff_get_sample(void *private_data, iwffff_wave_t *wave,
-			      char *data, long len, int atomic)
+			      char __user *data, long len, int atomic)
 {
 	snd_gus_card_t *gus = snd_magic_cast(snd_gus_card_t, private_data, return -ENXIO);
 
@@ -82,7 +82,7 @@ int snd_gus_iwffff_remove_sample(void *private_data, iwffff_wave_t *wave,
  */
 
 int snd_gus_gf1_put_sample(void *private_data, gf1_wave_t *wave,
-			   char *data, long len, int atomic)
+			   char __user *data, long len, int atomic)
 {
 	snd_gus_card_t *gus = snd_magic_cast(snd_gus_card_t, private_data, return -ENXIO);
 	snd_gf1_mem_block_t *block;
@@ -110,7 +110,7 @@ int snd_gus_gf1_put_sample(void *private_data, gf1_wave_t *wave,
 }
 
 int snd_gus_gf1_get_sample(void *private_data, gf1_wave_t *wave,
-			   char *data, long len, int atomic)
+			   char __user *data, long len, int atomic)
 {
 	snd_gus_card_t *gus = snd_magic_cast(snd_gus_card_t, private_data, return -ENXIO);
 
@@ -130,7 +130,7 @@ int snd_gus_gf1_remove_sample(void *private_data, gf1_wave_t *wave,
  */
 
 int snd_gus_simple_put_sample(void *private_data, simple_instrument_t *instr,
-			      char *data, long len, int atomic)
+			      char __user *data, long len, int atomic)
 {
 	snd_gus_card_t *gus = snd_magic_cast(snd_gus_card_t, private_data, return -ENXIO);
 	snd_gf1_mem_block_t *block;
@@ -157,7 +157,7 @@ int snd_gus_simple_put_sample(void *private_data, simple_instrument_t *instr,
 }
 
 int snd_gus_simple_get_sample(void *private_data, simple_instrument_t *instr,
-			      char *data, long len, int atomic)
+			      char __user *data, long len, int atomic)
 {
 	snd_gus_card_t *gus = snd_magic_cast(snd_gus_card_t, private_data, return -ENXIO);
 
diff --git a/sound/isa/gus/gus_mem_proc.c b/sound/isa/gus/gus_mem_proc.c
index 32f02ad50..95071a084 100644
--- a/sound/isa/gus/gus_mem_proc.c
+++ b/sound/isa/gus/gus_mem_proc.c
@@ -33,7 +33,7 @@ typedef struct gus_proc_private {
 } gus_proc_private_t;
 
 static long snd_gf1_mem_proc_dump(snd_info_entry_t *entry, void *file_private_data,
-			          struct file *file, char *buf, long count)
+			          struct file *file, char __user *buf, long count)
 {
 	long size;
 	gus_proc_private_t *priv = snd_magic_cast(gus_proc_private_t, entry->private_data, return -ENXIO);
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index a0f96cd02..040804ca8 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -346,7 +346,7 @@ static int snd_gf1_pcm_poke_block(snd_gus_card_t *gus, unsigned char *buf,
 static int snd_gf1_pcm_playback_copy(snd_pcm_substream_t *substream,
 				     int voice,
 				     snd_pcm_uframes_t pos,
-				     void *src,
+				     void __user *src,
 				     snd_pcm_uframes_t count)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index f687c3fb5..e876402c3 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -24,12 +24,12 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/gus.h>
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -49,35 +49,36 @@ static int joystick_dac[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 29};
 				/* 0 to 31, (0.59V-4.52V or 0.389V-2.98V) */
 static int channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 24};
 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for GUS Classic soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for GUS Classic soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable GUS Classic soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for GUS Classic driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x220,0x260,0x10}},dialog:list");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for GUS Classic driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{3},{5},{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for GUS Classic driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_ENABLED ",allows:{{1},{3},{5},{6},{7}},dialog:list");
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for GUS Classic driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_ENABLED ",allows:{{1},{3},{5},{6},{7}},dialog:list");
-MODULE_PARM(joystick_dac, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_dac, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for GUS Classic driver.");
 MODULE_PARM_SYNTAX(joystick_dac, SNDRV_ENABLED ",allows:{{0,31}}");
-MODULE_PARM(channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(channels, "GF1 channels for GUS Classic driver.");
 MODULE_PARM_SYNTAX(channels,  SNDRV_ENABLED ",allows:{{14,32}}");
-MODULE_PARM(pcm_channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Classic driver.");
 MODULE_PARM_SYNTAX(pcm_channels, SNDRV_ENABLED ",allows:{{2,16}}");
 
@@ -269,35 +270,3 @@ static void __exit alsa_card_gusclassic_exit(void)
 
 module_init(alsa_card_gusclassic_init)
 module_exit(alsa_card_gusclassic_exit)
-
-#ifndef MODULE
-
-/* format is: snd-gusclassic=enable,index,id,
-			     port,irq,
-			     dma1,dma2,
-			     joystick_dac,
-			     channels,pcm_channels */
-
-static int __init alsa_card_gusclassic_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2 &&
-	       get_option(&str,&joystick_dac[nr_dev]) == 2 &&
-	       get_option(&str,&channels[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_channels[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-gusclassic=", alsa_card_gusclassic_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index cd4fcde0f..ba39f7038 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/gus.h>
 #include <sound/es1688.h>
@@ -32,7 +33,6 @@
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -56,47 +56,48 @@ static int joystick_dac[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 29};
 				/* 0 to 31, (0.59V-4.52V or 0.389V-2.98V) */
 static int channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 24};
 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for GUS Extreme soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for GUS Extreme soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable GUS Extreme soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x220,0x260,0x20}},dialog:list");
-MODULE_PARM(gf1_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(gf1_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(gf1_port, "GF1 port # for GUS Extreme driver (optional).");
 MODULE_PARM_SYNTAX(gf1_port, SNDRV_ENABLED ",allows:{{0x210,0x270,0x10}},dialog:list");
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0x300,0x320,0x10}},dialog:list");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{5},{7},{9},{10}},dialog:list");
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_ENABLED ",allows:{{5},{7},{9},{10}},dialog:list");
-MODULE_PARM(gf1_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(gf1_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(gf1_irq, "GF1 IRQ # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(gf1_irq, SNDRV_ENABLED ",allows:{{2},{3},{5},{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "GF1 DMA # for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(joystick_dac, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_dac, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(joystick_dac, SNDRV_ENABLED ",allows:{{0,31}}");
-MODULE_PARM(channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(channels, "GF1 channels for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(channels, SNDRV_ENABLED ",allows:{{14,32}}");
-MODULE_PARM(pcm_channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver.");
 MODULE_PARM_SYNTAX(pcm_channels, SNDRV_ENABLED ",allows:{{2,16}}");
 
@@ -387,37 +388,3 @@ static void __exit alsa_card_gusextreme_exit(void)
 
 module_init(alsa_card_gusextreme_init)
 module_exit(alsa_card_gusextreme_exit)
-
-#ifndef MODULE
-
-/* format is: snd-gusextreme=enable,index,id,
-			     port,gf1_port,mpu_port,
-			     irq,gf1_irq,mpu_irq,
-			     dma8,dma1,
-			     joystick_dac,
-			     channels,pcm_channels */
-
-static int __init alsa_card_gusextreme_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&gf1_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&gf1_irq[nr_dev]) == 2 &&
-	       get_option(&str,&mpu_irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-gusextreme=", alsa_card_gusextreme_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index 8fcf4ab65..9d7c62a52 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -24,13 +24,13 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/gus.h>
 #include <sound/cs4231.h>
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -50,35 +50,36 @@ static int joystick_dac[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 29};
 				/* 0 to 31, (0.59V-4.52V or 0.389V-2.98V) */
 static int channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 24};
 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for GUS MAX soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for GUS MAX soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable GUS MAX soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for GUS MAX driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x220},{0x230},{0x240},{0x250},{0x260}},dialog:list");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for GUS MAX driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{3},{5},{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for GUS MAX driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for GUS MAX driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
-MODULE_PARM(joystick_dac, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_dac, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for GUS MAX driver.");
 MODULE_PARM_SYNTAX(joystick_dac, SNDRV_ENABLED ",allows:{{0,31}}");
-MODULE_PARM(channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(channels, "Used GF1 channels for GUS MAX driver.");
 MODULE_PARM_SYNTAX(channels, SNDRV_ENABLED ",allows:{{14,32}}");
-MODULE_PARM(pcm_channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS MAX driver.");
 MODULE_PARM_SYNTAX(pcm_channels, SNDRV_ENABLED ",allows:{{2,16}}");
 
@@ -409,35 +410,3 @@ static void __exit alsa_card_gusmax_exit(void)
 
 module_init(alsa_card_gusmax_init)
 module_exit(alsa_card_gusmax_exit)
-
-#ifndef MODULE
-
-/* format is: snd-gusmax=enable,index,id,
-			 port,irq,
-			 dma1,dma2,
-			 joystick_dac,
-			 channels,pcm_channels */
-
-static int __init alsa_card_gusmax_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2 &&
-	       get_option(&str,&joystick_dac[nr_dev]) == 2 &&
-	       get_option(&str,&channels[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_channels[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-gusmax=", alsa_card_gusmax_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 9c618faef..74bdb4a22 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/gus.h>
 #include <sound/cs4231.h>
@@ -37,7 +38,6 @@
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -73,46 +73,47 @@ static int joystick_dac[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 29};
 static int midi[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
 static int effect[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for InterWave soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for InterWave soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable InterWave soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for InterWave driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x210,0x260,0x10}},dialog:list");
 #ifdef SNDRV_STB
-MODULE_PARM(port_tc, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port_tc, long, boot_devs, 0444);
 MODULE_PARM_DESC(port_tc, "Tone control (TEA6330T - i2c bus) port # for InterWave driver.");
 MODULE_PARM_SYNTAX(port_tc, SNDRV_ENABLED ",allows:{{0x350,0x380,0x10}},dialog:list");
 #endif
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for InterWave driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{3},{5},{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for InterWave driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for InterWave driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
-MODULE_PARM(joystick_dac, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_dac, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_dac, "Joystick DAC level 0.59V-4.52V or 0.389V-2.98V for InterWave driver.");
 MODULE_PARM_SYNTAX(joystick_dac, SNDRV_ENABLED ",allows:{{0,31}}");
-MODULE_PARM(midi, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(midi, int, boot_devs, 0444);
 MODULE_PARM_DESC(midi, "MIDI UART enable for InterWave driver.");
 MODULE_PARM_SYNTAX(midi, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
-MODULE_PARM(pcm_channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for InterWave driver.");
 MODULE_PARM_SYNTAX(pcm_channels, SNDRV_ENABLED ",allows:{{2,16}}");
-MODULE_PARM(effect, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(effect, int, boot_devs, 0444);
 MODULE_PARM_DESC(effect, "Effects enable for InterWave driver.");
 MODULE_PARM_SYNTAX(effect, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
 
@@ -985,49 +986,3 @@ static void __exit alsa_card_interwave_exit(void)
 
 module_init(alsa_card_interwave_init)
 module_exit(alsa_card_interwave_exit)
-
-#ifndef MODULE
-
-/* format is: snd-interwave=enable,index,id,isapnp,
-			    port[,port_tc],irq,
-			    dma1,dma2,
-			    joystick_dac,midi,
-			    pcm_channels,effect */
-
-static int __init alsa_card_interwave_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-#ifdef SNDRV_STB
-	       get_option_long(&str,&port_tc[nr_dev]) == 2 &&
-#endif
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2 &&
-	       get_option(&str,&joystick_dac[nr_dev]) == 2 &&
-	       get_option(&str,&midi[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_channels[nr_dev]) == 2 &&
-	       get_option(&str,&effect[nr_dev]) == 2);
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp[nr_dev] = pnp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-#ifndef SNDRV_STB
-__setup("snd-interwave=", alsa_card_interwave_setup);
-#else
-__setup("snd-interwave-stb=", alsa_card_interwave_setup);
-#endif
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index d0743d9b7..2bea92fd0 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -25,11 +25,11 @@
 #include <linux/pm.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -59,46 +59,47 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 0,1,3,5,9,11,12,15 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 1,3,5,6,7 */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 1,3,5,6,7 */
 static int opl3sa3_ymode[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 };   /* 0,1,2,3 */ /*SL Added*/
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for OPL3-SA soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for OPL3-SA soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable OPL3-SA soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef CONFIG_PNP
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
 #endif
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0xf86},{0x370},{0x100}},dialog:list");
-MODULE_PARM(sb_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(sb_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(sb_port, "SB port # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(sb_port, SNDRV_ENABLED ",allows:{{0x220},{0x240},{0x260}},dialog:list");
-MODULE_PARM(wss_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(wss_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(wss_port, "WSS port # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(wss_port, SNDRV_ENABLED ",allows:{{0x530},{0xe80},{0xf40},{0x604}},dialog:list");
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{0x388}},dialog:list");
-MODULE_PARM(midi_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(midi_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(midi_port, "MIDI port # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(midi_port, SNDRV_ENABLED ",allows:{{0x330},{0x300}},dialog:list");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{0},{1},{3},{5},{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_ENABLED ",allows:{{1},{3},{5},{6},{7}},dialog:list");
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for OPL3-SA driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_ENABLED ",allows:{{1},{3},{5},{6},{7}},dialog:list");
-MODULE_PARM(opl3sa3_ymode, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); /* SL Added */
+module_param_array(opl3sa3_ymode, int, boot_devs, 0444);
 MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");
 MODULE_PARM_SYNTAX(opl3sa3_ymode, SNDRV_ENABLED ",allows:{{0,3}},dialog:list");  /* SL Added */
 
@@ -151,7 +152,6 @@ struct snd_opl3sa2 {
 	snd_kcontrol_t *master_switch;
 	snd_kcontrol_t *master_volume;
 #ifdef CONFIG_PM
-	struct pm_dev *pm_dev;
 	void (*cs4231_suspend)(cs4231_t *);
 	void (*cs4231_resume)(cs4231_t *);
 #endif
@@ -168,6 +168,8 @@ static struct pnp_card_device_id snd_opl3sa2_pnpids[] = {
 	{ .id = "YMH0030", .devs = { { "YMH0021" } } },
 	/* Yamaha OPL3-SA2 */
 	{ .id = "YMH0800", .devs = { { "YMH0021" } } },
+	/* Yamaha OPL3-SA2 */
+	{ .id = "YMH0801", .devs = { { "YMH0021" } } },
 	/* NeoMagic MagicWave 3DX */
 	{ .id = "NMX2200", .devs = { { "YMH2210" } } },
 	/* --- */
@@ -547,12 +549,9 @@ static int __init snd_opl3sa2_mixer(opl3sa2_t *chip)
 
 /* Power Management support functions */
 #ifdef CONFIG_PM
-static void snd_opl3sa2_suspend(opl3sa2_t *chip)
+static int snd_opl3sa2_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
+	opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, card->pm_private_data, return -EINVAL);
 
 	snd_pcm_suspend_all(chip->cs4231->pcm); /* stop before saving regs */
 	chip->cs4231_suspend(chip->cs4231);
@@ -561,16 +560,14 @@ static void snd_opl3sa2_suspend(opl3sa2_t *chip)
 	snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void snd_opl3sa2_resume(opl3sa2_t *chip)
+static int snd_opl3sa2_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, card->pm_private_data, return -EINVAL);
 	int i;
 
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
-
 	/* power up */
 	snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
 
@@ -587,43 +584,8 @@ static void snd_opl3sa2_resume(opl3sa2_t *chip)
 	chip->cs4231_resume(chip->cs4231);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-/* callback for control API */
-static int snd_opl3sa2_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	opl3sa2_t *chip = (opl3sa2_t *) card->power_state_private_data;
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_opl3sa2_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_opl3sa2_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
-static int snd_opl3sa2_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
-	opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, dev->data, return 0);
-
-	switch (rqst) {
-	case PM_SUSPEND:
-		snd_opl3sa2_suspend(chip);
-		break;
-	case PM_RESUME:
-		snd_opl3sa2_resume(chip);
-		break;
-	}
 	return 0;
 }
-
 #endif /* CONFIG_PM */
 
 #ifdef CONFIG_PNP
@@ -688,10 +650,6 @@ static int __init snd_opl3sa2_pnp(int dev, opl3sa2_t *chip,
 
 static int snd_opl3sa2_free(opl3sa2_t *chip)
 {
-#ifdef CONFIG_PM
-	if (chip->pm_dev)
-		pm_unregister(chip->pm_dev);
-#endif
 	if (chip->irq >= 0)
 		free_irq(chip->irq, (void *)chip);
 	if (chip->res_port) {
@@ -816,22 +774,12 @@ static int __devinit snd_opl3sa2_probe(int dev,
 			goto __error;
 	}
 #ifdef CONFIG_PM
-	/* Power Management */
-	chip->pm_dev = pm_register(PM_ISA_DEV, 0, snd_opl3sa2_pm_callback);
-	if (chip->pm_dev) {
-		chip->pm_dev->data = chip;
-		/* remember callbacks for cs4231 - they are called inside
-		 * opl3sa2 pm callback
-		 */
-		chip->cs4231_suspend = chip->cs4231->suspend;
-		chip->cs4231_resume = chip->cs4231->resume;
-		/* now clear callbacks for cs4231 */
-		chip->cs4231->suspend = NULL;
-		chip->cs4231->resume = NULL;
-		/* set control api callback */
-		card->set_power_state = snd_opl3sa2_set_power_state;
-		card->power_state_private_data = chip;
-	}
+	chip->cs4231_suspend = chip->cs4231->suspend;
+	chip->cs4231_resume = chip->cs4231->resume;
+	/* now clear callbacks for cs4231 */
+	chip->cs4231->suspend = NULL;
+	chip->cs4231->resume = NULL;
+	snd_card_set_isa_pm_callback(card, snd_opl3sa2_suspend, snd_opl3sa2_resume, chip);
 #endif
 
 	sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
@@ -932,42 +880,3 @@ static void __exit alsa_card_opl3sa2_exit(void)
 
 module_init(alsa_card_opl3sa2_init)
 module_exit(alsa_card_opl3sa2_exit)
-
-#ifndef MODULE
-
-/* format is: snd-opl3sa2=enable,index,id,isapnp,
-			  port,sb_port,wss_port,fm_port,
-			  midi_port,irq,dma1,dma2,
-			  opl3sa3_ymode */
-
-static int __init alsa_card_opl3sa2_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&sb_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&wss_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&midi_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2 &&
-	       get_option(&str,&opl3sa3_ymode[nr_dev]) == 2);
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp[nr_dev] = pnp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-opl3sa2=", alsa_card_opl3sa2_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 3888d5c61..846b00acc 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -30,6 +30,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #ifdef CS4231
 #include <sound/cs4231.h>
@@ -48,7 +49,6 @@
 #endif
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
@@ -84,38 +84,38 @@ static int dma1 = SNDRV_DEFAULT_DMA1;		/* 0,1,3 */
 static int dma2 = SNDRV_DEFAULT_DMA1;		/* 0,1,3 */
 #endif	/* CS4231 || OPTi93X */
 
-MODULE_PARM(index, "i");
+module_param(index, int, 0444);
 MODULE_PARM_DESC(index, "Index value for opti9xx based soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "s");
+module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for opti9xx based soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-//MODULE_PARM(enable, "i");
+//module_param(enable, bool, 0444);
 //MODULE_PARM_DESC(enable, "Enable opti9xx soundcard.");
 //MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(isapnp, "i");
+module_param(isapnp, bool, 0444);
 MODULE_PARM_DESC(isapnp, "Enable ISA PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
-MODULE_PARM(port, "l");
+module_param(port, long, 0444);
 MODULE_PARM_DESC(port, "WSS port # for opti9xx driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT_DESC);
-MODULE_PARM(mpu_port, "l");
+module_param(mpu_port, long, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for opti9xx driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT_DESC);
-MODULE_PARM(fm_port, "l");
+module_param(fm_port, long, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for opti9xx driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT_DESC);
-MODULE_PARM(irq, "i");
+module_param(irq, int, 0444);
 MODULE_PARM_DESC(irq, "WSS irq # for opti9xx driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(mpu_irq, "i");
+module_param(mpu_irq, int, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 irq # for opti9xx driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma1, "i");
+module_param(dma1, int, 0444);
 MODULE_PARM_DESC(dma1, "1st dma # for opti9xx driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
 #if defined(CS4231) || defined(OPTi93X)
-MODULE_PARM(dma2, "i");
+module_param(dma2, int, 0444);
 MODULE_PARM_DESC(dma2, "2nd dma # for opti9xx driver.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
 #endif	/* CS4231 || OPTi93X */
@@ -602,7 +602,11 @@ __skip_base:
 #endif	/* CS4231 || OPTi93X */
 
 	spin_lock_irqsave(&chip->lock, flags);
+#ifndef OPTi93X
+	 outb(irq_bits << 3 | dma_bits, chip->wss_base);
+#else /* OPTi93X */
 	snd_opti9xx_write(chip, OPTi9XX_MC_REG(3), (irq_bits << 3 | dma_bits));
+#endif /* OPTi93X */
 	spin_unlock_irqrestore(&chip->lock, flags);
 
 __skip_resources:
@@ -2253,47 +2257,3 @@ static void __exit alsa_card_opti9xx_exit(void)
 
 module_init(alsa_card_opti9xx_init)
 module_exit(alsa_card_opti9xx_exit)
-
-#ifndef MODULE
-
-/* format is: snd-opti9xx=enable,index,id,isapnp,
-			  port,mpu_port,fm_port,
-			  irq,mpu_irq,
-			  dma1,[dma2] */
-
-static int __init alsa_card_opti9xx_setup(char *str)
-{
-	int __attribute__ ((__unused__)) enable = 1;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-
-	(void)(get_option(&str,&enable) == 2 &&
-	       get_option(&str,&index) == 2 &&
-	       get_id(&str,&id) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port) == 2 &&
-	       get_option_long(&str,&mpu_port) == 2 &&
-	       get_option_long(&str,&fm_port) == 2 &&
-	       get_option(&str,&irq) == 2 &&
-	       get_option(&str,&mpu_irq) == 2 &&
-	       get_option(&str,&dma1) == 2
-#if defined(CS4231) || defined(OPTi93X)
-	       &&
-	       get_option(&str,&dma2) == 2
-#endif
-	       );
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp = pnp;
-#endif
-	return 1;
-}
-
-#if defined(OPTi93X)
-__setup("snd-opti93x=", alsa_card_opti9xx_setup);
-#elif defined(CS4231)
-__setup("snd-opti92x-cs4231=", alsa_card_opti9xx_setup);
-#else
-__setup("snd-opti92x-ad1848=", alsa_card_opti9xx_setup);
-#endif
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c
index 432c31e84..9ecd53c21 100644
--- a/sound/isa/sb/emu8000_patch.c
+++ b/sound/isa/sb/emu8000_patch.c
@@ -21,12 +21,12 @@
 
 #include "emu8000_local.h"
 #include <asm/uaccess.h>
+#include <linux/moduleparam.h>
 
-MODULE_PARM(emu8000_reset_addr, "i");
+static int emu8000_reset_addr = 0;
+module_param(emu8000_reset_addr, int, 0444);
 MODULE_PARM_DESC(emu8000_reset_addr, "reset write address at each time (makes slowdown)");
 
-int emu8000_reset_addr = 0;
-
 
 /*
  * Open up channels.
@@ -87,14 +87,14 @@ read_word(const void __user *buf, int offset, int mode)
 	unsigned short c;
 	if (mode & SNDRV_SFNT_SAMPLE_8BITS) {
 		unsigned char cc;
-		get_user(cc, (unsigned char*)buf + offset);
+		get_user(cc, (unsigned char __user *)buf + offset);
 		c = cc << 8; /* convert 8bit -> 16bit */
 	} else {
 #ifdef SNDRV_LITTLE_ENDIAN
-		get_user(c, (unsigned short*)buf + offset);
+		get_user(c, (unsigned short __user *)buf + offset);
 #else
 		unsigned short cc;
-		get_user(cc, (unsigned short*)buf + offset);
+		get_user(cc, (unsigned short __user *)buf + offset);
 		c = swab16(cc);
 #endif
 	}
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c
index 51e4f20a1..4d84f2519 100644
--- a/sound/isa/sb/emu8000_pcm.c
+++ b/sound/isa/sb/emu8000_pcm.c
@@ -515,12 +515,12 @@ static int emu8k_pcm_silence(snd_pcm_substream_t *subs,
 static int emu8k_pcm_copy(snd_pcm_substream_t *subs,
 			  int voice,
 			  snd_pcm_uframes_t pos,
-			  void *src,
+			  void __user *src,
 			  snd_pcm_uframes_t count)
 {
 	emu8k_pcm_t *rec = subs->runtime->private_data;
 	emu8000_t *emu = rec->emu;
-	unsigned short *buf = src;
+	unsigned short __user *buf = src;
 
 	snd_emu8000_write_wait(emu, 1);
 	EMU8000_SMALW_WRITE(emu, pos + rec->loop_start[0]);
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c
index 29baa2bca..c44efdba9 100644
--- a/sound/isa/sb/es968.c
+++ b/sound/isa/sb/es968.c
@@ -24,8 +24,8 @@
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/sb.h>
 
@@ -45,23 +45,24 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this car
 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* PnP setup */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* Pnp setup */
 static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* PnP setup */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for es968 based soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for es968 based soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable es968 based soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for es968 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for es968 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for es968 driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
 
@@ -242,28 +243,3 @@ static void __exit alsa_card_es968_exit(void)
 
 module_init(alsa_card_es968_init)
 module_exit(alsa_card_es968_exit)
-
-#ifndef MODULE
-
-/* format is: snd-es968=enable,index,id,
-			port,irq,dma1 */
-
-static int __init alsa_card_es968_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-es968=", alsa_card_es968_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index f1ffddd64..cdf00d306 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/sb.h>
 #include <sound/sb16_csp.h>
@@ -34,7 +35,6 @@
 #define SNDRV_LEGACY_AUTO_PROBE
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define chip_t sb_t
@@ -92,54 +92,55 @@ static int csp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 #ifdef SNDRV_SBAWE_EMU8000
 static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for SoundBlaster 16 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for SoundBlaster 16 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable SoundBlaster 16 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef CONFIG_PNP
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
 #endif
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for SB16 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x220},{0x240},{0x260},{0x280}},dialog:list");
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port # for SB16 driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0x330},{0x300}},dialog:list");
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port # for SB16 PnP driver.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{0x388},{0x38c},{0x390},{0x394}},dialog:list");
 #ifdef SNDRV_SBAWE_EMU8000
-MODULE_PARM(awe_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(awe_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(awe_port, "AWE port # for SB16 PnP driver.");
 MODULE_PARM_SYNTAX(awe_port, SNDRV_ENABLED ",allows:{{0x620},{0x640},{0x660},{0x680}},dialog:list");
 #endif
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for SB16 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for SB16 driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
-MODULE_PARM(dma16, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma16, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma16, "16-bit DMA # for SB16 driver.");
 MODULE_PARM_SYNTAX(dma16, SNDRV_DMA16_DESC);
-MODULE_PARM(mic_agc, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mic_agc, int, boot_devs, 0444);
 MODULE_PARM_DESC(mic_agc, "Mic Auto-Gain-Control switch.");
 MODULE_PARM_SYNTAX(mic_agc, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
 #ifdef CONFIG_SND_SB16_CSP
-MODULE_PARM(csp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(csp, int, boot_devs, 0444);
 MODULE_PARM_DESC(csp, "ASP/CSP chip support.");
 MODULE_PARM_SYNTAX(csp, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
 #endif
 #ifdef SNDRV_SBAWE_EMU8000
-MODULE_PARM(seq_ports, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(seq_ports, int, boot_devs, 0444);
 MODULE_PARM_DESC(seq_ports, "Number of sequencer ports for WaveTable synth.");
 MODULE_PARM_SYNTAX(seq_ports, SNDRV_ENABLED ",allows:{{0,8}},skill:advanced");
 #endif
@@ -247,6 +248,8 @@ static struct pnp_card_device_id snd_sb16_pnpids[] = {
 	{ .id = "CTLXXXX" , .devs = { { "CTL0044" }, { "CTL0023" } } },
 	{ .id = "CTLXXXX" , .devs = { { "CTL0045" }, { "CTL0022" } } },
 #endif /* SNDRV_SBAWE */
+	/* Sound Blaster 16 PnP (Virtual PC 2004)*/
+	{ .id = "tBA03b0", .devs = { { "PNPb003" } } },
 	{ .id = "", }
 };
 
@@ -691,60 +694,3 @@ static void __exit alsa_card_sb16_exit(void)
 
 module_init(alsa_card_sb16_init)
 module_exit(alsa_card_sb16_exit)
-
-#ifndef MODULE
-
-/* format is: snd-sb16=enable,index,id,isapnp,
-		       port,mpu_port,fm_port,
-		       irq,dma8,dma16,
-		       mic_agc,csp,
-		       [awe_port,seq_ports] */
-
-static int __init alsa_card_sb16_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-	int __attribute__ ((__unused__)) pnp = INT_MAX;
-	int __attribute__ ((__unused__)) xcsp = INT_MAX;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pnp) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2 &&
-	       get_option(&str,&dma16[nr_dev]) == 2 &&
-	       get_option(&str,&mic_agc[nr_dev]) == 2
-#ifdef CONFIG_SND_SB16_CSP
-	       &&
-	       get_option(&str,&xcsp) == 2
-#endif
-#ifdef SNDRV_SBAWE_EMU8000
-	       &&
-	       get_option_long(&str,&awe_port[nr_dev]) == 2 &&
-	       get_option(&str,&seq_ports[nr_dev]) == 2
-#endif
-	       );
-#ifdef CONFIG_PNP
-	if (pnp != INT_MAX)
-		isapnp[nr_dev] = pnp;
-#endif
-#ifdef CONFIG_SND_SB16_CSP
-	if (xcsp != INT_MAX)
-		csp[nr_dev] = xcsp;
-#endif
-	nr_dev++;
-	return 1;
-}
-
-#ifndef SNDRV_SBAWE_EMU8000
-__setup("snd-sb16=", alsa_card_sb16_setup);
-#else
-__setup("snd-sbawe=", alsa_card_sb16_setup);
-#endif
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 80d576a68..6cbef4688 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -89,9 +89,9 @@ static int read_register(sb_t *chip, unsigned char reg);
 static int set_mode_register(sb_t *chip, unsigned char mode);
 static int get_version(sb_t *chip);
 
-static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * code);
+static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user * code);
 static int snd_sb_csp_unload(snd_sb_csp_t * p);
-static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size, int load_flags);
+static int snd_sb_csp_load_user(snd_sb_csp_t * p, const unsigned char __user *buf, int size, int load_flags);
 static int snd_sb_csp_autoload(snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode);
 static int snd_sb_csp_check_version(snd_sb_csp_t * p);
 
@@ -213,7 +213,7 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
 		info.run_width = p->run_width;
 		info.version = p->version;
 		info.state = p->running;
-		if (copy_to_user((void *) arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			err = -EFAULT;
 		else
 			err = 0;
@@ -222,7 +222,7 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
 		/* load CSP microcode */
 	case SNDRV_SB_CSP_IOCTL_LOAD_CODE:
 		err = (p->running & SNDRV_SB_CSP_ST_RUNNING ?
-		       -EBUSY : snd_sb_csp_riff_load(p, (snd_sb_csp_microcode_t *) arg));
+		       -EBUSY : snd_sb_csp_riff_load(p, (snd_sb_csp_microcode_t __user *) arg));
 		break;
 	case SNDRV_SB_CSP_IOCTL_UNLOAD_CODE:
 		err = (p->running & SNDRV_SB_CSP_ST_RUNNING ?
@@ -231,7 +231,7 @@ static int snd_sb_csp_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cm
 
 		/* change CSP running state */
 	case SNDRV_SB_CSP_IOCTL_START:
-		if (copy_from_user(&start_info, (void *) arg, sizeof(start_info)))
+		if (copy_from_user(&start_info, (void __user *) arg, sizeof(start_info)))
 			err = -EFAULT;
 		else
 			err = snd_sb_csp_start(p, start_info.sample_width, start_info.channels);
@@ -297,11 +297,12 @@ static int snd_sb_csp_unuse(snd_sb_csp_t * p)
  * load microcode via ioctl: 
  * code is user-space pointer
  */
-static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode)
+static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user * mcode)
 {
 	snd_sb_csp_mc_header_t info;
 
-	unsigned char *data_ptr, *data_end;
+	unsigned char __user *data_ptr;
+	unsigned char __user *data_end;
 	unsigned short func_nr = 0;
 
 	riff_header_t file_h, item_h, code_h;
@@ -372,8 +373,8 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
 				if (code_h.name != INIT_HEADER)
 					break;
 				data_ptr += sizeof(code_h);
-				err = snd_sb_csp_load(p, data_ptr, LE_INT(code_h.len),
-						      SNDRV_SB_CSP_LOAD_INITBLOCK | SNDRV_SB_CSP_LOAD_FROMUSER);
+				err = snd_sb_csp_load_user(p, data_ptr, LE_INT(code_h.len),
+						      SNDRV_SB_CSP_LOAD_INITBLOCK);
 				if (err)
 					return err;
 				data_ptr += LE_INT(code_h.len);
@@ -387,8 +388,8 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t * mcode
 				return -EINVAL;
 			}
 			data_ptr += sizeof(code_h);
-			err = snd_sb_csp_load(p, data_ptr, LE_INT(code_h.len),
-					      SNDRV_SB_CSP_LOAD_FROMUSER);
+			err = snd_sb_csp_load_user(p, data_ptr,
+						   LE_INT(code_h.len), 0);
 			if (err)
 				return err;
 
@@ -627,28 +628,10 @@ static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size,
 	/* Send high byte */
 	snd_sbdsp_command(p->chip, (unsigned char)((size - 1) >> 8));
 	/* send microcode sequence */
-	if (load_flags & SNDRV_SB_CSP_LOAD_FROMUSER) {
-		/* copy microcode from user space */
-		unsigned char *kbuf, *_kbuf;
-		_kbuf = kbuf = kmalloc (size, GFP_KERNEL);
-		if (copy_from_user(kbuf, buf, size)) {
-			result = -EFAULT;
-			kfree (_kbuf);
+	/* load from kernel space */
+	while (size--) {
+		if (!snd_sbdsp_command(p->chip, *buf++))
 			goto __fail;
-		}
-		while (size--) {
-			if (!snd_sbdsp_command(p->chip, *kbuf++)) {
-				kfree (_kbuf);
-				goto __fail;
-			}
-		}
-		kfree (_kbuf);
-	} else {
-		/* load from kernel space */
-		while (size--) {
-			if (!snd_sbdsp_command(p->chip, *buf++))
-				goto __fail;
-		}
 	}
 	if (snd_sbdsp_get_byte(p->chip))
 		goto __fail;
@@ -692,6 +675,20 @@ static int snd_sb_csp_load(snd_sb_csp_t * p, const unsigned char *buf, int size,
 	spin_unlock_irqrestore(&p->chip->reg_lock, flags);
 	return result;
 }
+ 
+static int snd_sb_csp_load_user(snd_sb_csp_t * p, const unsigned char __user *buf, int size, int load_flags)
+{
+	int err = -ENOMEM;
+	unsigned char *kbuf = kmalloc(size, GFP_KERNEL);
+	if (kbuf) {
+		if (copy_from_user(kbuf, buf, size))
+			err = -EFAULT;
+		else
+			err = snd_sb_csp_load(p, kbuf, size, load_flags);
+		kfree(kbuf);
+	}
+	return err;
+}
 
 #include "sb16_csp_codecs.h"
 
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 480e1c6b8..feac3efc1 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -23,11 +23,11 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/sb.h>
 #include <sound/opl3.h>
 #define SNDRV_LEGACY_AUTO_PROBE
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define chip_t sb_t
@@ -44,23 +44,24 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;	/* Enable this card */
 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* 0x220,0x240,0x260 */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5,7,9,10 */
 static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 1,3 */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Sound Blaster soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Sound Blaster soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Sound Blaster soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for SB8 driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for SB8 driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-MODULE_PARM(dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma8, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma8, "8-bit DMA # for SB8 driver.");
 MODULE_PARM_SYNTAX(dma8, SNDRV_DMA8_DESC);
 
@@ -230,28 +231,3 @@ static void __exit alsa_card_sb8_exit(void)
 
 module_init(alsa_card_sb8_init)
 module_exit(alsa_card_sb8_exit)
-
-#ifndef MODULE
-
-/* format is: snd-sb8=enable,index,id,
-		      port,irq,dma8 */
-
-static int __init alsa_card_sb8_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&port[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma8[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-sb8=", alsa_card_sb8_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c
index 88f320f69..c59a84cba 100644
--- a/sound/isa/sgalaxy.c
+++ b/sound/isa/sgalaxy.c
@@ -27,13 +27,13 @@
 #include <linux/delay.h>
 #include <linux/time.h>
 #include <linux/irq.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/sb.h>
 #include <sound/ad1848.h>
 #include <sound/control.h>
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Christopher Butler <chrisb@sandy.force9.co.uk>");
@@ -49,23 +49,24 @@ static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* 0x220,0x240 */
 static long wssport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* 0x530,0xe80,0xf40,0x604 */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 7,9,10,11 */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0,1,3 */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Sound Galaxy soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Sound Galaxy soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(sbport, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(sbport, long, boot_devs, 0444);
 MODULE_PARM_DESC(sbport, "Port # for Sound Galaxy SB driver.");
 MODULE_PARM_SYNTAX(sbport, SNDRV_ENABLED ",allows:{{0x220},{0x240}},dialog:list");
-MODULE_PARM(wssport, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(wssport, long, boot_devs, 0444);
 MODULE_PARM_DESC(wssport, "Port # for Sound Galaxy WSS driver.");
 MODULE_PARM_SYNTAX(wssport, SNDRV_ENABLED ",allows:{{0x530},{0xe80},{0xf40},{0x604}},dialog:list");
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for Sound Galaxy driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_ENABLED ",allows:{{7},{9},{10},{11}},dialog:list");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for Sound Galaxy driver.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA8_DESC);
 
@@ -327,30 +328,3 @@ static void __exit alsa_card_sgalaxy_exit(void)
 
 module_init(alsa_card_sgalaxy_init)
 module_exit(alsa_card_sgalaxy_exit)
-
-#ifndef MODULE
-
-/* format is: snd-sgalaxy=enable,index,id,
-			  sbport,wssport,
-			  irq,dma1 */
-
-static int __init alsa_card_sgalaxy_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&sbport[nr_dev]) == 2 &&
-	       get_option_long(&str,&wssport[nr_dev]) == 2 &&
-	       get_option(&str,&irq[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-sgalaxy=", alsa_card_sgalaxy_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index b685311c1..c45061308 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -26,12 +26,12 @@
 #include <linux/delay.h>
 #include <linux/pnp.h>
 #include <linux/spinlock.h>
+#include <linux/moduleparam.h>
 #include <asm/dma.h>
 #include <sound/core.h>
 #include <sound/hwdep.h>
 #include <sound/cs4231.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <sound/sscape_ioctl.h>
@@ -49,28 +49,29 @@ static long port[SNDRV_CARDS] __devinitdata = { [0 ... (SNDRV_CARDS-1)] = SNDRV_
 static int irq[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_IRQ;
 static int mpu_irq[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_IRQ;
 static int dma[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_DMA;
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index number for SoundScape soundcard");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
 
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "Description for SoundScape card");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
 
-MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for SoundScape driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED);
 
-MODULE_PARM(irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for SoundScape driver.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
 
-MODULE_PARM(mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU401 IRQ # for SoundScape driver.");
 MODULE_PARM_SYNTAX(mpu_irq, SNDRV_IRQ_DESC);
 
-MODULE_PARM(dma, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
 MODULE_PARM_SYNTAX(dma, SNDRV_DMA8_DESC);
   
@@ -454,7 +455,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout)
  * Upload a byte-stream into the SoundScape using DMA channel A.
  */
 static int upload_dma_data(struct soundscape *s,
-                           const unsigned char *data,
+                           const unsigned char __user *data,
                            size_t size)
 {
 	unsigned long flags;
@@ -568,7 +569,7 @@ static int upload_dma_data(struct soundscape *s,
  *       However, we have already verified its memory
  *       addresses by the time we get here.
  */
-static int sscape_upload_bootblock(struct soundscape *sscape, struct sscape_bootblock *bb)
+static int sscape_upload_bootblock(struct soundscape *sscape, struct sscape_bootblock __user *bb)
 {
 	unsigned long flags;
 	int data = 0;
@@ -603,10 +604,10 @@ static int sscape_upload_bootblock(struct soundscape *sscape, struct sscape_boot
  * SPACE, and save ourselves from copying it at all.
  */
 static int sscape_upload_microcode(struct soundscape *sscape,
-                                   const struct sscape_microcode *mc)
+                                   const struct sscape_microcode __user *mc)
 {
 	unsigned long flags;
-	char *code;
+	char __user *code;
 	int err, ret;
 
 	/*
@@ -682,7 +683,7 @@ static int sscape_hw_ioctl(snd_hwdep_t * hw, struct file *file,
 	switch (cmd) {
 	case SND_SSCAPE_LOAD_BOOTB:
 		{
-			register struct sscape_bootblock *bb = (struct sscape_bootblock *) arg;
+			register struct sscape_bootblock __user *bb = (struct sscape_bootblock __user *) arg;
 
 			/*
 			 * We are going to have to copy this data into a special
@@ -704,7 +705,7 @@ static int sscape_hw_ioctl(snd_hwdep_t * hw, struct file *file,
 
 	case SND_SSCAPE_LOAD_MCODE:
 		{
-			register const struct sscape_microcode *mc = (const struct sscape_microcode *) arg;
+			register const struct sscape_microcode __user *mc = (const struct sscape_microcode __user *) arg;
 
 			err = sscape_upload_microcode(sscape, mc);
 		}
@@ -1531,30 +1532,3 @@ static int __init sscape_init(void)
 
 module_init(sscape_init);
 module_exit(sscape_exit);
-
-#ifndef MODULE
-
-/* format is: snd-sscape=index,id,port,irq,mpu_irq,dma */
-
-static int __init builtin_sscape_setup(char *str)
-{
-	static unsigned __initdata nr_dev;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-
-	(void)((get_option(&str, &index[nr_dev]) == 2) &&
-	       (get_id(&str, &id[nr_dev]) == 2) &&
-	       (get_option_long(&str, &port[nr_dev]) == 2) &&
-	       (get_option(&str, &irq[nr_dev]) == 2) &&
-	       (get_option(&str, &mpu_irq[nr_dev]) == 2) &&
-	       (get_option(&str, &dma[nr_dev]) == 2)); 
- 
-	++nr_dev;
-	return 1;
-}
-
-__setup("snd-sscape=", builtin_sscape_setup);
-
-#endif
-
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 0275fa4cb..e0c8e1430 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -24,8 +24,8 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/pnp.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/opl3.h>
 #include <sound/snd_wavefront.h>
@@ -52,49 +52,50 @@ static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	    /* PnP setup */
 static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	    /* 0,1,3,5,6,7 */
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	    /* 0,1,3,5,6,7 */
 static int use_cs4232_midi[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for WaveFront soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for WaveFront soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable WaveFront soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef CONFIG_PNP
-MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "ISA PnP detection for WaveFront soundcards.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
 #endif
-MODULE_PARM(cs4232_pcm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(cs4232_pcm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(cs4232_pcm_port, "Port # for CS4232 PCM interface.");
 MODULE_PARM_SYNTAX(cs4232_pcm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(cs4232_pcm_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(cs4232_pcm_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(cs4232_pcm_irq, "IRQ # for CS4232 PCM interface.");
 MODULE_PARM_SYNTAX(cs4232_pcm_irq, SNDRV_ENABLED ",allows:{{5},{7},{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(dma1, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma1, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma1, "DMA1 # for CS4232 PCM interface.");
 MODULE_PARM_SYNTAX(dma1, SNDRV_DMA_DESC);
-MODULE_PARM(dma2, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dma2, int, boot_devs, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for CS4232 PCM interface.");
 MODULE_PARM_SYNTAX(dma2, SNDRV_DMA_DESC);
-MODULE_PARM(cs4232_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(cs4232_mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(cs4232_mpu_port, "port # for CS4232 MPU-401 interface.");
 MODULE_PARM_SYNTAX(cs4232_mpu_port, SNDRV_PORT12_DESC);
-MODULE_PARM(cs4232_mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(cs4232_mpu_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(cs4232_mpu_irq, "IRQ # for CS4232 MPU-401 interface.");
 MODULE_PARM_SYNTAX(cs4232_mpu_irq, SNDRV_ENABLED ",allows:{{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(ics2115_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ics2115_irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(ics2115_irq, "IRQ # for ICS2115.");
 MODULE_PARM_SYNTAX(ics2115_irq, SNDRV_ENABLED ",allows:{{9},{11},{12},{15}},dialog:list");
-MODULE_PARM(ics2115_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(ics2115_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(ics2115_port, "Port # for ICS2115.");
 MODULE_PARM_SYNTAX(ics2115_port, SNDRV_PORT12_DESC);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port #.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_PORT12_DESC);
-MODULE_PARM(use_cs4232_midi, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(use_cs4232_midi, bool, boot_devs, 0444);
 MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
 MODULE_PARM_SYNTAX(use_cs4232_midi, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -731,41 +732,3 @@ static void __exit alsa_card_wavefront_exit(void)
 
 module_init(alsa_card_wavefront_init)
 module_exit(alsa_card_wavefront_exit)
-
-#ifndef MODULE
-
-/* format is: snd-wavefront=enable,index,id,isapnp,
-			    cs4232_pcm_port,cs4232_pcm_irq,
-			    cs4232_mpu_port,cs4232_mpu_irq,
-			    ics2115_port,ics2115_irq,
-			    fm_port,
-			    dma1,dma2,
-			    use_cs4232_midi */
-
-static int __init alsa_card_wavefront_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&isapnp[nr_dev]) == 2 &&
-	       get_option_long(&str,&cs4232_pcm_port[nr_dev]) == 2 &&
-	       get_option(&str,&cs4232_pcm_irq[nr_dev]) == 2 &&
-	       get_option_long(&str,&cs4232_mpu_port[nr_dev]) == 2 &&
-	       get_option(&str,&cs4232_mpu_irq[nr_dev]) == 2 &&
-	       get_option_long(&str,&ics2115_port[nr_dev]) == 2 &&
-	       get_option(&str,&ics2115_irq[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option(&str,&dma1[nr_dev]) == 2 &&
-	       get_option(&str,&dma2[nr_dev]) == 2 &&
-	       get_option(&str,&use_cs4232_midi[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-wavefront=", alsa_card_wavefront_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 01d6647c1..92d9c85a4 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -179,7 +179,7 @@ snd_wavefront_fx_ioctl (snd_hwdep_t *sdev, struct file *file,
 	acard = card->private_data;
 	dev = &acard->wavefront;
 
-	if (copy_from_user (&r, (unsigned char *) arg, sizeof (wavefront_fx_info)))
+	if (copy_from_user (&r, (void __user *)arg, sizeof (wavefront_fx_info)))
 		return -EFAULT;
 
 	switch (r.request) {
@@ -201,7 +201,7 @@ snd_wavefront_fx_ioctl (snd_hwdep_t *sdev, struct file *file,
 				return -EIO;
 			}
 			if (copy_from_user (page_data,
-					    (unsigned char *) r.data[3],
+					    (unsigned char __user *) r.data[3],
 					    r.data[2]))
 				return -EFAULT;
 			pd = page_data;
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 0b3755f39..9b65db0b1 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -27,6 +27,7 @@
 #include <linux/delay.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/snd_wavefront.h>
 #include <sound/initval.h>
@@ -83,25 +84,25 @@ int ramcheck_time = 20;    /* time in seconds to wait while ROM code
 int osrun_time = 10;       /* time in seconds we wait for the OS to
 			      start running.
 			   */
-MODULE_PARM(wf_raw,"i");
+module_param(wf_raw, int, 0444);
 MODULE_PARM_DESC(wf_raw, "if non-zero, assume that we need to boot the OS");
-MODULE_PARM(fx_raw,"i");
+module_param(fx_raw, int, 0444);
 MODULE_PARM_DESC(fx_raw, "if non-zero, assume that the FX process needs help");
-MODULE_PARM(debug_default,"i");
+module_param(debug_default, int, 0444);
 MODULE_PARM_DESC(debug_default, "debug parameters for card initialization");
-MODULE_PARM(wait_usecs,"i");
+module_param(wait_usecs, int, 0444);
 MODULE_PARM_DESC(wait_usecs, "how long to wait without sleeping, usecs");
-MODULE_PARM(sleep_interval,"i");
+module_param(sleep_interval, int, 0444);
 MODULE_PARM_DESC(sleep_interval, "how long to sleep when waiting for reply");
-MODULE_PARM(sleep_tries,"i");
+module_param(sleep_tries, int, 0444);
 MODULE_PARM_DESC(sleep_tries, "how many times to try sleeping during a wait");
-MODULE_PARM(ospath,"s");
+module_param(ospath, charp, 0444);
 MODULE_PARM_DESC(ospath, "full pathname to processed ICS2115 OS firmware");
-MODULE_PARM(reset_time,"i");
+module_param(reset_time, int, 0444);
 MODULE_PARM_DESC(reset_time, "how long to wait for a reset to take effect");
-MODULE_PARM(ramcheck_time,"i");
+module_param(ramcheck_time, int, 0444);
 MODULE_PARM_DESC(ramcheck_time, "how many seconds to wait for the RAM test");
-MODULE_PARM(osrun_time,"i");
+module_param(osrun_time, int, 0444);
 MODULE_PARM_DESC(osrun_time, "how many seconds to wait for the ICS2115 OS");
 
 /* if WF_DEBUG not defined, no run-time debugging messages will
@@ -860,7 +861,7 @@ wavefront_freemem (snd_wavefront_t *dev)
 static int
 wavefront_send_sample (snd_wavefront_t *dev, 
 		       wavefront_patch_info *header,
-		       u16 *dataptr,
+		       u16 __user *dataptr,
 		       int data_is_unsigned)
 
 {
@@ -875,7 +876,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
 
 	u16 sample_short;
 	u32 length;
-	u16 *data_end = 0;
+	u16 __user *data_end = 0;
 	unsigned int i;
 	const unsigned int max_blksize = 4096/2;
 	unsigned int written;
@@ -1354,7 +1355,7 @@ wavefront_find_free_patch (snd_wavefront_t *dev)
 #endif
 
 static int
-wavefront_load_patch (snd_wavefront_t *dev, const char *addr)
+wavefront_load_patch (snd_wavefront_t *dev, const char __user *addr)
 
 {
 	wavefront_patch_info header;
@@ -1376,8 +1377,7 @@ wavefront_load_patch (snd_wavefront_t *dev, const char *addr)
 	switch (header.subkey) {
 	case WF_ST_SAMPLE:  /* sample or sample_header, based on patch->size */
 
-		if (copy_from_user ((unsigned char *) &header.hdr.s,
-				    (unsigned char *) header.hdrptr,
+		if (copy_from_user (&header.hdr.s, header.hdrptr,
 				    sizeof (wavefront_sample)))
 			return -EFAULT;
 
@@ -1385,8 +1385,7 @@ wavefront_load_patch (snd_wavefront_t *dev, const char *addr)
 
 	case WF_ST_MULTISAMPLE:
 
-		if (copy_from_user ((unsigned char *) &header.hdr.s,
-				    (unsigned char *) header.hdrptr,
+		if (copy_from_user (&header.hdr.s, header.hdrptr,
 				    sizeof (wavefront_multisample)))
 			return -EFAULT;
 
@@ -1395,32 +1394,28 @@ wavefront_load_patch (snd_wavefront_t *dev, const char *addr)
 
 	case WF_ST_ALIAS:
 
-		if (copy_from_user ((unsigned char *) &header.hdr.a,
-				    (unsigned char *) header.hdrptr,
+		if (copy_from_user (&header.hdr.a, header.hdrptr,
 				    sizeof (wavefront_alias)))
 			return -EFAULT;
 
 		return wavefront_send_alias (dev, &header);
 
 	case WF_ST_DRUM:
-		if (copy_from_user ((unsigned char *) &header.hdr.d, 
-				    (unsigned char *) header.hdrptr,
+		if (copy_from_user (&header.hdr.d, header.hdrptr,
 				    sizeof (wavefront_drum)))
 			return -EFAULT;
 
 		return wavefront_send_drum (dev, &header);
 
 	case WF_ST_PATCH:
-		if (copy_from_user ((unsigned char *) &header.hdr.p, 
-				    (unsigned char *) header.hdrptr,
+		if (copy_from_user (&header.hdr.p, header.hdrptr,
 				    sizeof (wavefront_patch)))
 			return -EFAULT;
 
 		return wavefront_send_patch (dev, &header);
 
 	case WF_ST_PROGRAM:
-		if (copy_from_user ((unsigned char *) &header.hdr.pr, 
-				    (unsigned char *) header.hdrptr,
+		if (copy_from_user (&header.hdr.pr, header.hdrptr,
 				    sizeof (wavefront_program)))
 			return -EFAULT;
 
@@ -1626,6 +1621,7 @@ snd_wavefront_synth_ioctl (snd_hwdep_t *hw, struct file *file,
 	snd_wavefront_t *dev;
 	snd_wavefront_card_t *acard;
 	wavefront_control wc;
+	void __user *argp = (void __user *)arg;
 
 	card = (snd_card_t *) hw->card;
 
@@ -1638,18 +1634,18 @@ snd_wavefront_synth_ioctl (snd_hwdep_t *hw, struct file *file,
 	
 	switch (cmd) {
 	case WFCTL_LOAD_SPP:
-		if (wavefront_load_patch (dev, (char *) arg) != 0) {
+		if (wavefront_load_patch (dev, argp) != 0) {
 			return -EIO;
 		}
 		break;
 
 	case WFCTL_WFCMD:
-		if (copy_from_user (&wc, (void *) arg, sizeof (wc)))
+		if (copy_from_user (&wc, argp, sizeof (wc)))
 			return -EFAULT;
 		if (wavefront_synth_control (acard, &wc) < 0) {
 			return -EIO;
 		}
-		if (copy_to_user ((void *) arg, &wc, sizeof (wc)))
+		if (copy_to_user (argp, &wc, sizeof (wc)))
 			return -EFAULT;
 		break;
 
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index bd9440595..648bccd40 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -34,102 +34,31 @@ config SOUND_CMPCI
 
 config SOUND_CMPCI_FM
 	bool "Enable legacy FM"
-	depends on SOUND_CMPCI
+	depends on SOUND_CMPCI && X86
 	help
-	  Say Y here to enable the legacy FM (frequency-modulation) synthesis
-	  support on a card using the CMI8338 or CMI8378 chipset.
+	  Say Y here to enable the legacy FM (frequency-modulation) synthesizer
+	  support on a card using the CMI8338 or CMI8378 chipset. Even it is
+	  enabled, you need to set fmio as proper value to enable it.
 	  Say N here if you don't need this.
 
-config SOUND_CMPCI_FMIO
-	hex "FM I/O 388, 3C8, 3E0, 3E8"
-	depends on SOUND_CMPCI_FM
-	default "388"
-	help
-	  Set the base I/O address for FM synthesis control on a card using
-	  the CMI8338 or CMI8378 chipset.
-	  The default is 388; other choices are 3c8, 3e0, or 3e8.
-
 config SOUND_CMPCI_MIDI
 	bool "Enable legacy MPU-401"
-	depends on SOUND_CMPCI
+	depends on SOUND_CMPCI && X86
 	help
-	  Say Y here to enable the legacy MP401 MIDI synthesis support on a
-	  card using the CMI8338 or CMI8378 chipset.
+	  Say Y here to enable the legacy MPU401 MIDI synthesizer support on a
+	  card using the CMI8338 or CMI8378 chipset. Even it is enabled,
+	  you need to set mpuio as proper value to enable it.
 	  Say N here if you don't need this.
 
-config SOUND_CMPCI_MPUIO
-	hex "MPU-401 I/O 330, 320, 310, 300"
-	depends on SOUND_CMPCI_MIDI
-	default "330"
-	help
-	  Set the base I/O address for MP401 MIDI synthesis control on a card
-	  using the CMI8338 or CMI8378 chipset.
-	  The default is 330; other choices are 320, 310, or 300.
-
 config SOUND_CMPCI_JOYSTICK
 	bool "Enable joystick"
-	depends on SOUND_CMPCI
-	help
-	  Say here in order to enable the joystick port on a sound crd using
-	  the CMI8338 or the CMI8738 chipset.  Data on these chips are
-	  available at <http://www.cmedia.com.tw/>.
-
-config SOUND_CMPCI_CM8738
-	bool "Support CMI8738 based audio cards"
-	depends on SOUND_CMPCI
-	help
-	  Say Y or M if you have a PCI sound card using the CMI8338
-	  or the CMI8378 chipset.  Data on this chip is available at
-	  <http://www.cmedia.com.tw/doc8738.htm>.
-
-	  A userspace utility to control some internal registers of these
-	  chips is available at
-	  <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
-
-config SOUND_CMPCI_SPDIFINVERSE
-	bool "Inverse S/PDIF in for CMI8738"
-	depends on SOUND_CMPCI_CM8738
+	depends on SOUND_CMPCI && X86
 	help
-	  Say Y here to have the driver invert the signal presented on SPDIF IN
-	  of a card using the CMI8338 or CMI8378 chipset.
+	  Say Y here in order to enable the joystick port on a sound card using
+	  the CMI8338 or the CMI8738 chipset.  You need to config the
+	  gameport support and set joystick parameter as 1 to use it.
 	  Say N here if you don't need this.
 
-config SOUND_CMPCI_SPDIFLOOP
-	bool "Enable S/PDIF loop for CMI8738"
-	depends on SOUND_CMPCI_CM8738
-	help
-	  Enable loopback from SPDIF in to SPDIF out.  For discussion, see
-	  "The 8738 Audio SPDIF In/Out Technical Data" on the technical
-	  support page at <http://www.cmedia.com.tw/>.
-
-	  A userspace utility to control even more internal registers of these
-	  chips is available at
-	  <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
-	  This package will among other things help you enable SPDIF 
-	  out/in/loop/monitor.
-
-config SOUND_CMPCI_SPEAKERS
-	int "Number of speakers 2, 4, 5, 6"
-	depends on SOUND_CMPCI_CM8738
-	default "2"
-	help
-	  Specify the number of speaker channels you want the card to drive,
-	  as an integer.
-
-config SOUND_CMPCI_LINE_REAR
-	bool "Use Line-in as Read-out"
-	depends on SOUND_CMPCI_CM8738 && SOUND_CMPCI_SPEAKERS!=2
-	help
-	  Say Y here to enable using line-in jack as an output jack for a rear
-	  speaker.  Say N here if you don't need this.
-
-config SOUND_CMPCI_LINE_BASS
-	bool "Use Line-in as Bass"
-	depends on SOUND_CMPCI_CM8738 && SOUND_CMPCI_SPEAKERS!=2
-	help
-	  Say Y here to enable using line-in jack as an output jack for a bass
-	  speaker.  Say N here if you don't need this.
-
 config SOUND_EMU10K1
 	tristate "Creative SBLive! (EMU10K1)"
 	depends on SOUND_PRIME!=n && SOUND && PCI
diff --git a/sound/oss/Makefile b/sound/oss/Makefile
index e8a7ffc87..6fc30dc7f 100644
--- a/sound/oss/Makefile
+++ b/sound/oss/Makefile
@@ -55,6 +55,12 @@ obj-$(CONFIG_SOUND_NM256)	+= nm256_audio.o ac97.o
 obj-$(CONFIG_SOUND_ICH)		+= i810_audio.o ac97_codec.o
 obj-$(CONFIG_SOUND_SONICVIBES)	+= sonicvibes.o
 obj-$(CONFIG_SOUND_CMPCI)	+= cmpci.o
+ifeq ($(CONFIG_SOUND_CMPCI_FM),y)
+  obj-$(CONFIG_SOUND_CMPCI)     += sound.o opl3.o
+endif
+ifeq ($(CONFIG_SOUND_CMPCI_MIDI),y)
+  obj-$(CONFIG_SOUND_CMPCI)     += sound.o mpu401.o
+endif
 obj-$(CONFIG_SOUND_ES1370)	+= es1370.o
 obj-$(CONFIG_SOUND_ES1371)	+= es1371.o ac97_codec.o
 obj-$(CONFIG_SOUND_VRC5477)	+= nec_vrc5477.o ac97_codec.o
diff --git a/sound/oss/ac97.c b/sound/oss/ac97.c
index 258060ecb..d79ff7754 100644
--- a/sound/oss/ac97.c
+++ b/sound/oss/ac97.c
@@ -369,7 +369,7 @@ ac97_set_values (struct ac97_hwint *dev,
 }
 
 int
-ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, caddr_t arg)
+ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, void __user *arg)
 {
     int ret;
 
@@ -380,7 +380,7 @@ ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, caddr_t arg)
 
     case SOUND_MIXER_WRITE_RECSRC:
 	{
-	    if (get_user (ret, (int *) arg))
+	    if (get_user (ret, (int __user *) arg))
 		ret = -EFAULT;
 	    else
 		ret = ac97_set_recmask (dev, ret);
@@ -414,7 +414,7 @@ ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, caddr_t arg)
 		ret = 0;
 		if (dir & _SIOC_WRITE) {
 		    int val;
-		    if (get_user (val, (int *) arg) == 0)
+		    if (get_user (val, (int __user *) arg) == 0)
 			ret = ac97_set_mixer (dev, channel, val);
 		    else
 			ret = -EFAULT;
@@ -434,7 +434,7 @@ ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, caddr_t arg)
     if (ret < 0)
 	return ret;
     else
-	return put_user(ret, (int *) arg);
+	return put_user(ret, (int __user *) arg);
 }
 
 EXPORT_SYMBOL(ac97_init);
diff --git a/sound/oss/ac97.h b/sound/oss/ac97.h
index 6353b79b6..3353c84b5 100644
--- a/sound/oss/ac97.h
+++ b/sound/oss/ac97.h
@@ -206,7 +206,7 @@ extern int ac97_get_mixer_scaled (struct ac97_hwint *dev, int oss_channel);
 
 /* Default ioctl. */
 extern int ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd,
-			     caddr_t arg);
+			     void __user * arg);
 
 /* Do a complete reset on the AC97 mixer, restoring all mixer registers to
    the current values.  Normally used after an APM resume event.  */
diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c
index 4b33c2f8e..c883411da 100644
--- a/sound/oss/ac97_codec.c
+++ b/sound/oss/ac97_codec.c
@@ -516,7 +516,7 @@ static int ac97_mixer_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned
 		strlcpy(info.id, codec->name, sizeof(info.id));
 		strlcpy(info.name, codec->name, sizeof(info.name));
 		info.modify_counter = codec->modcnt;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -525,7 +525,7 @@ static int ac97_mixer_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned
 		memset(&info, 0, sizeof(info));
 		strlcpy(info.id, codec->name, sizeof(info.id));
 		strlcpy(info.name, codec->name, sizeof(info.name));
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -534,7 +534,7 @@ static int ac97_mixer_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned
 		return -EINVAL;
 
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, (int __user *)arg);
 
 	if (_SIOC_DIR(cmd) == _SIOC_READ) {
 		switch (_IOC_NR(cmd)) {
@@ -573,12 +573,12 @@ static int ac97_mixer_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned
 			val = codec->mixer_state[i];
  			break;
 		}
-		return put_user(val, (int *)arg);
+		return put_user(val, (int __user *)arg);
 	}
 
 	if (_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) {
 		codec->modcnt++;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)arg))
 			return -EFAULT;
 
 		switch (_IOC_NR(cmd)) {
diff --git a/sound/oss/ac97_plugin_ad1980.c b/sound/oss/ac97_plugin_ad1980.c
index 0015a044f..24a9acd28 100644
--- a/sound/oss/ac97_plugin_ad1980.c
+++ b/sound/oss/ac97_plugin_ad1980.c
@@ -75,7 +75,7 @@ static int ad1980_probe(struct ac97_codec *codec, struct ac97_driver *driver)
 
 	/* Switch the inputs/outputs over (from Dell code) */
 	control = codec->codec_read(codec, AC97_AD_MISC);
-	codec->codec_write(codec, AC97_AD_MISC, control | 0x0420);
+	codec->codec_write(codec, AC97_AD_MISC, control | 0x4420);
 	
 	/* We could refuse the device since we dont need to hang around,
 	   but we will claim it */
diff --git a/sound/oss/aci.c b/sound/oss/aci.c
index 20af39fca..ac3c481aa 100644
--- a/sound/oss/aci.c
+++ b/sound/oss/aci.c
@@ -234,12 +234,12 @@ out:	return read;
 
 EXPORT_SYMBOL(aci_rw_cmd);
 
-static int setvolume(caddr_t arg, 
+static int setvolume(int __user *arg, 
 		     unsigned char left_index, unsigned char right_index)
 {
 	int vol, ret, uservol, buf;
 
-	__get_user(uservol, (int *)arg);
+	__get_user(uservol, arg);
 
 	/* left channel */
 	vol = uservol & 0xff;
@@ -260,12 +260,12 @@ static int setvolume(caddr_t arg,
 		return buf;
 	ret |= SCALE(0x20, 100, vol) << 8;
  
-	__put_user(ret, (int *)arg);
+	__put_user(ret, arg);
 
 	return 0;
 }
 
-static int getvolume(caddr_t arg,
+static int getvolume(int __user *arg,
 		     unsigned char left_index, unsigned char right_index)
 {
 	int vol;
@@ -281,7 +281,7 @@ static int getvolume(caddr_t arg,
 		return buf;
 	vol |= SCALE(0x20, 100, buf < 0x20 ? 0x20-buf : 0) << 8;
 
-	__put_user(vol, (int *)arg);
+	__put_user(vol, arg);
 
 	return 0;
 }
@@ -318,13 +318,13 @@ static inline unsigned int eq_aci2oss(unsigned int vol)
 }
 
 
-static int setequalizer(caddr_t arg, 
+static int setequalizer(int __user *arg, 
 			unsigned char left_index, unsigned char right_index)
 {
 	int buf;
 	unsigned int vol;
 
-	__get_user(vol, (int *)arg);
+	__get_user(vol, arg);
 
 	/* left channel */
 	if ((buf=aci_write_cmd(left_index, eq_oss2aci(vol & 0xff)))<0)
@@ -338,7 +338,7 @@ static int setequalizer(caddr_t arg,
 	return 0;
 }
 
-static int getequalizer(caddr_t arg,
+static int getequalizer(int __user *arg,
 			unsigned char left_index, unsigned char right_index)
 {
 	int buf;
@@ -354,50 +354,51 @@ static int getequalizer(caddr_t arg,
 		return buf;
 	vol |= eq_aci2oss(buf) << 8;
 
-	__put_user(vol, (int *)arg);
+	__put_user(vol, arg);
 
 	return 0;
 }
 
-static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
+static int aci_mixer_ioctl (int dev, unsigned int cmd, void __user * arg)
 {
 	int vol, buf;
+	int __user *p = arg;
 
 	switch (cmd) {
 	case SOUND_MIXER_WRITE_VOLUME:
-		return setvolume(arg, 0x01, 0x00);
+		return setvolume(p, 0x01, 0x00);
 	case SOUND_MIXER_WRITE_CD:
-		return setvolume(arg, 0x3c, 0x34);
+		return setvolume(p, 0x3c, 0x34);
 	case SOUND_MIXER_WRITE_MIC:
-		return setvolume(arg, 0x38, 0x30);
+		return setvolume(p, 0x38, 0x30);
 	case SOUND_MIXER_WRITE_LINE:
-		return setvolume(arg, 0x39, 0x31);
+		return setvolume(p, 0x39, 0x31);
 	case SOUND_MIXER_WRITE_SYNTH:
-		return setvolume(arg, 0x3b, 0x33);
+		return setvolume(p, 0x3b, 0x33);
 	case SOUND_MIXER_WRITE_PCM:
-		return setvolume(arg, 0x3a, 0x32);
+		return setvolume(p, 0x3a, 0x32);
 	case MIXER_WRITE(SOUND_MIXER_RADIO): /* fall through */
 	case SOUND_MIXER_WRITE_LINE1:  /* AUX1 or radio */
-		return setvolume(arg, 0x3d, 0x35);
+		return setvolume(p, 0x3d, 0x35);
 	case SOUND_MIXER_WRITE_LINE2:  /* AUX2 */
-		return setvolume(arg, 0x3e, 0x36);
+		return setvolume(p, 0x3e, 0x36);
 	case SOUND_MIXER_WRITE_BASS:   /* set band one and two */
 		if (aci_idcode[1]=='C') {
-			if ((buf=setequalizer(arg, 0x48, 0x40)) || 
-			    (buf=setequalizer(arg, 0x49, 0x41)));
+			if ((buf=setequalizer(p, 0x48, 0x40)) || 
+			    (buf=setequalizer(p, 0x49, 0x41)));
 			return buf;
 		}
 		break;
 	case SOUND_MIXER_WRITE_TREBLE: /* set band six and seven */
 		if (aci_idcode[1]=='C') {
-			if ((buf=setequalizer(arg, 0x4d, 0x45)) || 
-			    (buf=setequalizer(arg, 0x4e, 0x46)));
+			if ((buf=setequalizer(p, 0x4d, 0x45)) || 
+			    (buf=setequalizer(p, 0x4e, 0x46)));
 			return buf;
 		}
 		break;
 	case SOUND_MIXER_WRITE_IGAIN:  /* MIC pre-amp */
 		if (aci_idcode[1]=='B' || aci_idcode[1]=='C') {
-			__get_user(vol, (int *)arg);
+			__get_user(vol, p);
 			vol = vol & 0xff;
 			if (vol > 100)
 				vol = 100;
@@ -407,13 +408,13 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 			aci_micpreamp = vol;
 			vol = SCALE(3, 100, vol);
 			vol |= (vol << 8);
-			__put_user(vol, (int *)arg);
+			__put_user(vol, p);
 			return 0;
 		}
 		break;
 	case SOUND_MIXER_WRITE_OGAIN:  /* Power-amp/line-out level */
 		if (aci_idcode[1]=='A' || aci_idcode[1]=='B') {
-			__get_user(buf, (int *)arg);
+			__get_user(buf, p);
 			buf = buf & 0xff;
 			if (buf > 50)
 				vol = 1;
@@ -426,13 +427,13 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 				buf = (100 || 100<<8);
 			else
 				buf = 0;
-			__put_user(buf, (int *)arg);
+			__put_user(buf, p);
 			return 0;
 		}
 		break;
 	case SOUND_MIXER_WRITE_RECSRC:
 		/* handle solo mode control */
-		__get_user(buf, (int *)arg);
+		__get_user(buf, p);
 		/* unset solo when RECSRC for PCM is requested */
 		if (aci_idcode[1]=='B' || aci_idcode[1]=='C') {
 			vol = !(buf & SOUND_MASK_PCM);
@@ -448,7 +449,7 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 			buf |= SOUND_MASK_LINE1;
 		if (!aci_solo)
 			buf |= SOUND_MASK_PCM;
-		__put_user(buf, (int *)arg);
+		__put_user(buf, p);
 		return 0;
 	case SOUND_MIXER_READ_DEVMASK:
 		buf = (SOUND_MASK_VOLUME | SOUND_MASK_CD    |
@@ -470,7 +471,7 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 		default:
 			buf |= SOUND_MASK_LINE1;
 		}
-		__put_user(buf, (int *)arg);
+		__put_user(buf, p);
 		return 0;
 	case SOUND_MIXER_READ_STEREODEVS:
 		buf = (SOUND_MASK_VOLUME | SOUND_MASK_CD    |
@@ -485,7 +486,7 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 		default:
 			buf |= SOUND_MASK_LINE1;
 		}
-		__put_user(buf, (int *)arg);
+		__put_user(buf, p);
 		return 0;
 	case SOUND_MIXER_READ_RECMASK:
 		buf = (SOUND_MASK_CD| SOUND_MASK_MIC| SOUND_MASK_LINE|
@@ -495,7 +496,7 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 		else
 			buf |= SOUND_MASK_LINE1;
 
-		__put_user(buf, (int *)arg);
+		__put_user(buf, p);
 		return 0;
 	case SOUND_MIXER_READ_RECSRC:
 		buf = (SOUND_MASK_CD    | SOUND_MASK_MIC   | SOUND_MASK_LINE  |
@@ -523,36 +524,36 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 		else
 			buf |= SOUND_MASK_LINE1;
 
-		__put_user(buf, (int *)arg);
+		__put_user(buf, p);
 		return 0;
 	case SOUND_MIXER_READ_CAPS:
-		__put_user(0, (int *)arg);
+		__put_user(0, p);
 		return 0;
 	case SOUND_MIXER_READ_VOLUME:
-		return getvolume(arg, 0x04, 0x03);
+		return getvolume(p, 0x04, 0x03);
 	case SOUND_MIXER_READ_CD:
-		return getvolume(arg, 0x0a, 0x09);
+		return getvolume(p, 0x0a, 0x09);
 	case SOUND_MIXER_READ_MIC:
-		return getvolume(arg, 0x06, 0x05);
+		return getvolume(p, 0x06, 0x05);
 	case SOUND_MIXER_READ_LINE:
-		return getvolume(arg, 0x08, 0x07);
+		return getvolume(p, 0x08, 0x07);
 	case SOUND_MIXER_READ_SYNTH:
-		return getvolume(arg, 0x0c, 0x0b);
+		return getvolume(p, 0x0c, 0x0b);
 	case SOUND_MIXER_READ_PCM:
-		return getvolume(arg, 0x0e, 0x0d);
+		return getvolume(p, 0x0e, 0x0d);
 	case MIXER_READ(SOUND_MIXER_RADIO): /* fall through */
 	case SOUND_MIXER_READ_LINE1:  /* AUX1 */
-		return getvolume(arg, 0x11, 0x10);
+		return getvolume(p, 0x11, 0x10);
 	case SOUND_MIXER_READ_LINE2:  /* AUX2 */
-		return getvolume(arg, 0x13, 0x12);
+		return getvolume(p, 0x13, 0x12);
 	case SOUND_MIXER_READ_BASS:   /* get band one */
 		if (aci_idcode[1]=='C') {
-			return getequalizer(arg, 0x23, 0x22);
+			return getequalizer(p, 0x23, 0x22);
 		}
 		break;
 	case SOUND_MIXER_READ_TREBLE: /* get band seven */
 		if (aci_idcode[1]=='C') {
-			return getequalizer(arg, 0x2f, 0x2e);
+			return getequalizer(p, 0x2f, 0x2e);
 		}
 		break;
 	case SOUND_MIXER_READ_IGAIN:  /* MIC pre-amp */
@@ -567,7 +568,7 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 				buf=aci_micpreamp;
 			vol = SCALE(3, 100, buf <= 3 ? buf : 3);
 			vol |= vol << 8;
-			__put_user(vol, (int *)arg);
+			__put_user(vol, p);
 			return 0;
 		}
 		break;
@@ -576,7 +577,7 @@ static int aci_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 			buf = (100 || 100<<8);
 		else
 			buf = 0;
-		__put_user(buf, (int *)arg);
+		__put_user(buf, p);
 		return 0;
 	}
 	return -EINVAL;
diff --git a/sound/oss/ad1816.c b/sound/oss/ad1816.c
index 258bb4ef9..c2abdddd7 100644
--- a/sound/oss/ad1816.c
+++ b/sound/oss/ad1816.c
@@ -874,10 +874,11 @@ ad1816_mixer_reset (ad1816_info * devc)
 }
 
 static int
-ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
+ad1816_mixer_ioctl (int dev, unsigned int cmd, void __user * arg)
 {
 	ad1816_info    *devc = mixer_devs[dev]->devc;
 	int val;
+	int __user *p = arg;
   
 	DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_ioctl called!\n"));
   
@@ -889,19 +890,19 @@ ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 			switch (cmd & 0xff){
 			case SOUND_MIXER_RECSRC:
 				
-				if (get_user(val, (int *)arg))
+				if (get_user(val, p))
 					return -EFAULT;
 				val=ad1816_set_recmask (devc, val);
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 				break;
 				
 			default:
-				if (get_user(val, (int *)arg))
+				if (get_user(val, p))
 					return -EFAULT;
 				if ((val=ad1816_mixer_set (devc, cmd & 0xff, val))<0)
 				        return val;
 				else
-				        return put_user(val, (int *)arg);
+				        return put_user(val, p);
 			}
 		} else { 
 			/* read ioctl */
@@ -909,34 +910,34 @@ ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 				
 			case SOUND_MIXER_RECSRC:
 				val=devc->recmask;
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 				break;
 				
 			case SOUND_MIXER_DEVMASK:
 				val=devc->supported_devices;
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 				break;
 
 			case SOUND_MIXER_STEREODEVS:
 				val=devc->supported_devices & ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX);
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 				break;
 				
 			case SOUND_MIXER_RECMASK:
 				val=devc->supported_rec_devices;
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 				break;
 				
 			case SOUND_MIXER_CAPS:
 				val=SOUND_CAP_EXCL_INPUT;
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 				break;
 				
 			default:
 			        if ((val=ad1816_mixer_get (devc, cmd & 0xff))<0)
 				        return val;
 				else
-				        return put_user(val, (int *)arg);
+				        return put_user(val, p);
 			}
 		}
 	} else
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c
index 0195b64da..7e9e30e5b 100644
--- a/sound/oss/ad1848.c
+++ b/sound/oss/ad1848.c
@@ -624,6 +624,7 @@ static void ad1848_mixer_reset(ad1848_info * devc)
 			devc->supported_devices = MODE3_MIXER_DEVICES;
 			break;
 		case MD_4232:
+		case MD_4235:
 		case MD_4236:
 			devc->supported_devices = MODE3_MIXER_DEVICES;
 			break;
@@ -672,14 +673,14 @@ static void ad1848_mixer_reset(ad1848_info * devc)
 	spin_unlock_irqrestore(&devc->lock,flags);
 }
 
-static int ad1848_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int ad1848_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	ad1848_info *devc = mixer_devs[dev]->devc;
 	int val;
 
 	if (cmd == SOUND_MIXER_PRIVATE1) 
 	{
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)arg))
 			return -EFAULT;
 
 		if (val != 0xffff) 
@@ -697,11 +698,11 @@ static int ad1848_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			spin_unlock_irqrestore(&devc->lock,flags);
 		}
 		val = devc->mixer_output_port;
-		return put_user(val, (int *)arg);
+		return put_user(val, (int __user *)arg);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE2)
 	{
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)arg))
 			return -EFAULT;
 		return(ad1848_control(AD1848_MIXER_REROUTE, val));
 	}
@@ -712,18 +713,18 @@ static int ad1848_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			switch (cmd & 0xff) 
 			{
 				case SOUND_MIXER_RECSRC:
-					if (get_user(val, (int *)arg))
+					if (get_user(val, (int __user *)arg))
 						return -EFAULT;
 					val = ad1848_set_recmask(devc, val);
 					break;
 				
 				default:
-					if (get_user(val, (int *)arg))
+					if (get_user(val, (int __user *)arg))
 					return -EFAULT;
 					val = ad1848_mixer_set(devc, cmd & 0xff, val);
 					break;
 			} 
-			return put_user(val, (int *)arg);
+			return put_user(val, (int __user *)arg);
 		}
 		else
 		{
@@ -759,7 +760,7 @@ static int ad1848_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 					val = ad1848_mixer_get(devc, cmd & 0xff);
 					break;
 			}
-			return put_user(val, (int *)arg);
+			return put_user(val, (int __user *)arg);
 		}
 	}
 	else
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 98515fee5..89543f3a3 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -437,13 +437,13 @@ XXX
 
 /************************* /dev/dsp interfaces ************************* */
 
-static ssize_t ad1889_read(struct file *file, char *buffer, size_t count,
+static ssize_t ad1889_read(struct file *file, char __user *buffer, size_t count,
 	loff_t *ppos)
 {
 	return 0;
 }
 
-static ssize_t ad1889_write(struct file *file, const char *buffer, size_t count,
+static ssize_t ad1889_write(struct file *file, const char __user *buffer, size_t count,
 	loff_t *ppos)
 {
 	ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data;
@@ -617,11 +617,12 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data;
 	struct dmabuf *dmabuf;
 	audio_buf_info abinfo;
+	int __user *p = (int __user *)arg;
 
 	switch (cmd)
 	{
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_RESET:
 		break;
@@ -631,7 +632,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 	case SNDCTL_DSP_SPEED:
 		/* set sampling rate */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val > 5400 && val < 48000)
 		{
@@ -643,7 +644,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case SNDCTL_DSP_STEREO: /* undocumented? */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			val = AD1889_READW(ad1889_dev, AD_DSWSMC);
@@ -667,13 +668,13 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case SNDCTL_DSP_GETBLKSIZE:
-		return put_user(DMA_SIZE, (int *)arg);
+		return put_user(DMA_SIZE, p);
 
 	case SNDCTL_DSP_GETFMTS:
-		return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+		return put_user(AFMT_S16_LE|AFMT_U8, p);
 
 	case SNDCTL_DSP_SETFMT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (file->f_mode & FMODE_READ) 
@@ -682,7 +683,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (file->f_mode & FMODE_WRITE) 
 			ad1889_set_wav_fmt(dev, val);
 
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_CHANNELS:
 		break;
@@ -696,7 +697,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 	case SNDCTL_DSP_SETFRAGMENT:
 		/* not supported; uses fixed fragment sizes */
-		return put_user(DMA_SIZE, (int *)arg);
+		return put_user(DMA_SIZE, p);
 
 	case SNDCTL_DSP_GETOSPACE:
 	case SNDCTL_DSP_GETISPACE:
@@ -709,13 +710,13 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		abinfo.fragstotal = 1;
 		abinfo.fragsize = DMA_SIZE;
 		abinfo.bytes = DMA_SIZE;
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(p, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 	case SNDCTL_DSP_NONBLOCK:
 		file->f_flags |= O_NONBLOCK;
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case SNDCTL_DSP_GETTRIGGER:
 	case SNDCTL_DSP_SETTRIGGER:
@@ -732,7 +733,7 @@ static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		break;
 
 	case SOUND_PCM_READ_RATE:
-		return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), (int *)arg);
+		return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p);
 
 	case SOUND_PCM_READ_CHANNELS:
 	case SOUND_PCM_READ_BITS:
diff --git a/sound/oss/ali5455.c b/sound/oss/ali5455.c
index 8a905b3a7..3f3a456b3 100644
--- a/sound/oss/ali5455.c
+++ b/sound/oss/ali5455.c
@@ -1579,7 +1579,7 @@ static irqreturn_t ali_interrupt(int irq, void *dev_id, struct pt_regs *regs)
    waiting to be copied to the user's buffer.  It is filled by the dma
    machine and drained by this loop. */
 
-static ssize_t ali_read(struct file *file, char *buffer,
+static ssize_t ali_read(struct file *file, char __user *buffer,
 			size_t count, loff_t * ppos)
 {
 	struct ali_state *state = (struct ali_state *) file->private_data;
@@ -1721,7 +1721,7 @@ done:
 /* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to
    the soundcard.  it is drained by the dma machine and filled by this loop. */
 static ssize_t ali_write(struct file *file,
-			 const char *buffer, size_t count, loff_t * ppos)
+			 const char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct ali_state *state = (struct ali_state *) file->private_data;
 	struct ali_card *card = state ? state->card : 0;
@@ -1981,16 +1981,19 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 	unsigned int i_scr;
 	int val = 0, ret;
 	struct ac97_codec *codec = state->card->ac97_codec[0];
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
+
 #ifdef DEBUG
 	printk("ali_audio: ali_ioctl, arg=0x%x, cmd=",
-	       arg ? *(int *) arg : 0);
+	       arg ? *p : 0);
 #endif
 	switch (cmd) {
 	case OSS_GETVERSION:
 #ifdef DEBUG
 		printk("OSS_GETVERSION\n");
 #endif
-		return put_user(SOUND_VERSION, (int *) arg);
+		return put_user(SOUND_VERSION, p);
 	case SNDCTL_DSP_RESET:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_RESET\n");
@@ -2058,7 +2061,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 #ifdef DEBUG
 		printk("SNDCTL_DSP_SPEED\n");
 #endif
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_WRITE) {
@@ -2136,7 +2139,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 				spin_unlock_irqrestore(&state->card->lock, flags);
 			}
 		}
-		return put_user(dmabuf->rate, (int *) arg);
+		return put_user(dmabuf->rate, p);
 	case SNDCTL_DSP_STEREO:	/* set stereo or mono channel */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_STEREO\n");
@@ -2153,7 +2156,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		if (dmabuf->enable & CONTROLLER_SPDIFOUT_RUNNING) {
 			stop_spdifout(state);
 		}
-		return put_user(1, (int *) arg);
+		return put_user(1, p);
 	case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE) {
 			if (codec_independent_spdif_locked > 0) {
@@ -2177,22 +2180,22 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETBLKSIZE %d\n", dmabuf->userfragsize);
 #endif
-		return put_user(dmabuf->userfragsize, (int *) arg);
+		return put_user(dmabuf->userfragsize, p);
 	case SNDCTL_DSP_GETFMTS:	/* Returns a mask of supported sample format */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETFMTS\n");
 #endif
-		return put_user(AFMT_S16_LE, (int *) arg);
+		return put_user(AFMT_S16_LE, p);
 	case SNDCTL_DSP_SETFMT:	/* Select sample format */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_SETFMT\n");
 #endif
-		return put_user(AFMT_S16_LE, (int *) arg);
+		return put_user(AFMT_S16_LE, p);
 	case SNDCTL_DSP_CHANNELS:	// add support 4,6 channel 
 #ifdef DEBUG
 		printk("SNDCTL_DSP_CHANNELS\n");
 #endif
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val > 0) {
 			if (dmabuf->enable & DAC_RUNNING) {
@@ -2208,7 +2211,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 				stop_adc(state);
 			}
 		} else {
-			return put_user(state->card->channels, (int *) arg);
+			return put_user(state->card->channels, p);
 		}
 
 		i_scr = inl(state->card->iobase + ALI_SCR);
@@ -2243,7 +2246,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			val = ret;
 			break;
 		}
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 	case SNDCTL_DSP_POST:	/* the user has sent all data and is notifying us */
 		/* we update the swptr to the end of the last sg segment then return */
 #ifdef DEBUG
@@ -2270,7 +2273,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 	case SNDCTL_DSP_SUBDIVIDE:
 		if (dmabuf->subdivision)
 			return -EINVAL;
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2281,7 +2284,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		dmabuf->ready = 0;
 		return 0;
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		dmabuf->ossfragsize = 1 << (val & 0xffff);
 		dmabuf->ossmaxfrags = (val >> 16) & 0xffff;
@@ -2360,7 +2363,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		       abinfo.bytes, abinfo.fragsize, abinfo.fragments,
 		       abinfo.fragstotal);
 #endif
-		return copy_to_user((void *) arg, &abinfo,
+		return copy_to_user(argp, &abinfo,
 				    sizeof(abinfo)) ? -EFAULT : 0;
 	case SNDCTL_DSP_GETOPTR:
 		if (!(file->f_mode & FMODE_WRITE))
@@ -2408,7 +2411,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		printk("SNDCTL_DSP_GETOPTR %d, %d, %d, %d\n", cinfo.bytes,
 		       cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
-		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))? -EFAULT : 0;
+		return copy_to_user(argp, &cinfo, sizeof(cinfo))? -EFAULT : 0;
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
 			return -EINVAL;
@@ -2425,7 +2428,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		       abinfo.bytes, abinfo.fragsize, abinfo.fragments,
 		       abinfo.fragstotal);
 #endif
-		return copy_to_user((void *) arg, &abinfo,
+		return copy_to_user(argp, &abinfo,
 				    sizeof(abinfo)) ? -EFAULT : 0;
 	case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -2447,7 +2450,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		printk("SNDCTL_DSP_GETIPTR %d, %d, %d, %d\n", cinfo.bytes,
 		       cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
-		return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))? -EFAULT: 0;
+		return copy_to_user(argp, &cinfo, sizeof(cinfo))? -EFAULT: 0;
 	case SNDCTL_DSP_NONBLOCK:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_NONBLOCK\n");
@@ -2459,15 +2462,15 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		printk("SNDCTL_DSP_GETCAPS\n");
 #endif
 		return put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER |
-				DSP_CAP_MMAP | DSP_CAP_BIND, (int *) arg);
+				DSP_CAP_MMAP | DSP_CAP_BIND, p);
 	case SNDCTL_DSP_GETTRIGGER:
 		val = 0;
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETTRIGGER 0x%x\n", dmabuf->trigger);
 #endif
-		return put_user(dmabuf->trigger, (int *) arg);
+		return put_user(dmabuf->trigger, p);
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 #if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_SETTRIGGER 0x%x\n", val);
@@ -2586,27 +2589,27 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETODELAY %d\n", dmabuf->count);
 #endif
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 	case SOUND_PCM_READ_RATE:
 #ifdef DEBUG
 		printk("SOUND_PCM_READ_RATE %d\n", dmabuf->rate);
 #endif
-		return put_user(dmabuf->rate, (int *) arg);
+		return put_user(dmabuf->rate, p);
 	case SOUND_PCM_READ_CHANNELS:
 #ifdef DEBUG
 		printk("SOUND_PCM_READ_CHANNELS\n");
 #endif
-		return put_user(2, (int *) arg);
+		return put_user(2, p);
 	case SOUND_PCM_READ_BITS:
 #ifdef DEBUG
 		printk("SOUND_PCM_READ_BITS\n");
 #endif
-		return put_user(AFMT_S16_LE, (int *) arg);
+		return put_user(AFMT_S16_LE, p);
 	case SNDCTL_DSP_SETSPDIF:	/* Set S/PDIF Control register */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_SETSPDIF\n");
 #endif
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		/* Check to make sure the codec supports S/PDIF transmitter */
 		if ((state->card->ac97_features & 4)) {
@@ -2625,12 +2628,12 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		else
 			printk(KERN_WARNING "ali_audio: S/PDIF transmitter not avalible.\n");
 #endif
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 	case SNDCTL_DSP_GETSPDIF:	/* Get S/PDIF Control register */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETSPDIF\n");
 #endif
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		/* Check to make sure the codec supports S/PDIF transmitter */
 		if (!(state->card->ac97_features & 4)) {
@@ -2642,14 +2645,14 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			val = ali_ac97_get(codec, AC97_SPDIF_CONTROL);
 		}
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 //end add support spdif out
 //add support 4,6 channel
 	case SNDCTL_DSP_GETCHANNELMASK:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETCHANNELMASK\n");
 #endif
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		/* Based on AC'97 DAC support, not ICH hardware */
 		val = DSP_BIND_FRONT;
@@ -2659,12 +2662,12 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			val |= DSP_BIND_SURR;
 		if (state->card->ac97_features & 0x0140)
 			val |= DSP_BIND_CENTER_LFE;
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 	case SNDCTL_DSP_BIND_CHANNEL:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_BIND_CHANNEL\n");
 #endif
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val == DSP_BIND_QUERY) {
 			val = DSP_BIND_FRONT;	/* Always report this as being enabled */
@@ -2749,7 +2752,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 					val &= ~DSP_BIND_CENTER_LFE;
 			}
 		}
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 	case SNDCTL_DSP_MAPINBUF:
 	case SNDCTL_DSP_MAPOUTBUF:
 	case SNDCTL_DSP_SETSYNCRO:
diff --git a/sound/oss/audio.c b/sound/oss/audio.c
index 91101d990..ef2c658af 100644
--- a/sound/oss/audio.c
+++ b/sound/oss/audio.c
@@ -38,7 +38,7 @@
 #define NEUTRAL16	0x00
 
 
-int             dma_ioctl(int dev, unsigned int cmd, caddr_t arg);
+int             dma_ioctl(int dev, unsigned int cmd, void __user *arg);
 
 static int set_format(int dev, int fmt)
 {
@@ -219,7 +219,7 @@ static void translate_bytes(const unsigned char *table, unsigned char *buff, int
 		buff[i] = table[buff[i]];
 }
 
-int audio_write(int dev, struct file *file, const char *buf, int count)
+int audio_write(int dev, struct file *file, const char __user *buf, int count)
 {
 	int c, p, l, buf_size, used, returned;
 	int err;
@@ -300,7 +300,7 @@ int audio_write(int dev, struct file *file, const char *buf, int count)
 	return count;
 }
 
-int audio_read(int dev, struct file *file, char *buf, int count)
+int audio_read(int dev, struct file *file, char __user *buf, int count)
 {
 	int             c, p, l;
 	char           *dmabuf;
@@ -365,11 +365,12 @@ int audio_read(int dev, struct file *file, char *buf, int count)
 	return count - c;
 }
 
-int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
+int audio_ioctl(int dev, struct file *file, unsigned int cmd, void __user *arg)
 {
 	int val, count;
 	unsigned long flags;
 	struct dma_buffparms *dmap;
+	int __user *p = arg;
 
 	dev = dev >> 4;
 
@@ -399,7 +400,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 				return 0;
 			audio_devs[dev]->dmap_out->flags |= DMA_POST | DMA_DIRTY;
 			sync_output(dev);
-			dma_ioctl(dev, SNDCTL_DSP_POST, (caddr_t) 0);
+			dma_ioctl(dev, SNDCTL_DSP_POST, NULL);
 			return 0;
 
 		case SNDCTL_DSP_RESET:
@@ -412,7 +413,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			break;
 	
 		case SNDCTL_DSP_SETFMT:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			val = set_format(dev, val);
 			break;
@@ -449,7 +450,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 				break;
 			
 		case SOUND_PCM_WRITE_RATE:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			val = audio_devs[dev]->d->set_speed(dev, val);
 			break;
@@ -459,7 +460,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			break;
 			
 		case SNDCTL_DSP_STEREO:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val > 1 || val < 0)
 				return -EINVAL;
@@ -467,7 +468,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			break;
 
 		case SOUND_PCM_WRITE_CHANNELS:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			val = audio_devs[dev]->d->set_channels(dev, val);
 			break;
@@ -486,7 +487,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			return (audio_devs[dev]->flags & DMA_DUPLEX) ? 0 : -EIO;
 
 		case SNDCTL_DSP_PROFILE:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (audio_devs[dev]->open_mode & OPEN_WRITE)
 				audio_devs[dev]->dmap_out->applic_profile = val;
@@ -522,7 +523,7 @@ int audio_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 		default:
 			return dma_ioctl(dev, cmd, arg);
 	}
-	return put_user(val, (int *)arg);
+	return put_user(val, p);
 }
 
 void audio_init_devices(void)
@@ -734,7 +735,7 @@ static int dma_set_fragment(int dev, struct dma_buffparms *dmap, int fact)
 	return bytes | ((count - 1) << 16);
 }
 
-int dma_ioctl(int dev, unsigned int cmd, caddr_t arg)
+int dma_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	struct dma_buffparms *dmap_out = audio_devs[dev]->dmap_out;
 	struct dma_buffparms *dmap_in = audio_devs[dev]->dmap_in;
@@ -748,7 +749,7 @@ int dma_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	{
 		case SNDCTL_DSP_SUBDIVIDE:
 			ret = 0;
-			if (get_user(fact, (int *)arg))
+			if (get_user(fact, (int __user *)arg))
 				return -EFAULT;
 			if (audio_devs[dev]->open_mode & OPEN_WRITE)
 				ret = dma_subdivide(dev, dmap_out, fact);
@@ -816,7 +817,7 @@ int dma_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			return 0;
 
 		case SNDCTL_DSP_SETTRIGGER:
-			if (get_user(bits, (int *)arg))
+			if (get_user(bits, (int __user *)arg))
 				return -EFAULT;
 			bits &= audio_devs[dev]->open_mode;
 			if (audio_devs[dev]->d->trigger == NULL)
@@ -957,7 +958,7 @@ int dma_ioctl(int dev, unsigned int cmd, caddr_t arg)
 
 		case SNDCTL_DSP_SETFRAGMENT:
 			ret = 0;
-			if (get_user(fact, (int *)arg))
+			if (get_user(fact, (int __user *)arg))
 				return -EFAULT;
 			if (audio_devs[dev]->open_mode & OPEN_WRITE)
 				ret = dma_set_fragment(dev, dmap_out, fact);
@@ -978,5 +979,5 @@ int dma_ioctl(int dev, unsigned int cmd, caddr_t arg)
 				return -EINVAL;
 			return audio_devs[dev]->d->ioctl(dev, cmd, arg);
 	}
-	return put_user(ret, (int *)arg);
+	return put_user(ret, (int __user *)arg);
 }
diff --git a/sound/oss/awe_wave.c b/sound/oss/awe_wave.c
index 6aac55d4a..f49a2dee4 100644
--- a/sound/oss/awe_wave.c
+++ b/sound/oss/awe_wave.c
@@ -336,14 +336,14 @@ static void awe_modwheel_change(int voice, int value);
 /* sequencer interface */
 static int awe_open(int dev, int mode);
 static void awe_close(int dev);
-static int awe_ioctl(int dev, unsigned int cmd, caddr_t arg);
+static int awe_ioctl(int dev, unsigned int cmd, void __user * arg);
 static int awe_kill_note(int dev, int voice, int note, int velocity);
 static int awe_start_note(int dev, int v, int note_num, int volume);
 static int awe_set_instr(int dev, int voice, int instr_no);
 static int awe_set_instr_2(int dev, int voice, int instr_no);
 static void awe_reset(int dev);
 static void awe_hw_control(int dev, unsigned char *event);
-static int awe_load_patch(int dev, int format, const char *addr,
+static int awe_load_patch(int dev, int format, const char __user *addr,
 			  int offs, int count, int pmgr_flag);
 static void awe_aftertouch(int dev, int voice, int pressure);
 static void awe_controller(int dev, int voice, int ctrl_num, int value);
@@ -374,21 +374,21 @@ static void awe_alloc_one_voice(int voice, int note, int velocity);
 static int awe_clear_voice(void);
 
 /* load / remove patches */
-static int awe_open_patch(awe_patch_info *patch, const char *addr, int count);
-static int awe_close_patch(awe_patch_info *patch, const char *addr, int count);
-static int awe_unload_patch(awe_patch_info *patch, const char *addr, int count);
-static int awe_load_info(awe_patch_info *patch, const char *addr, int count);
-static int awe_remove_info(awe_patch_info *patch, const char *addr, int count);
-static int awe_load_data(awe_patch_info *patch, const char *addr, int count);
-static int awe_replace_data(awe_patch_info *patch, const char *addr, int count);
-static int awe_load_map(awe_patch_info *patch, const char *addr, int count);
+static int awe_open_patch(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_close_patch(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_unload_patch(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_load_info(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_remove_info(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_load_data(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_replace_data(awe_patch_info *patch, const char __user *addr, int count);
+static int awe_load_map(awe_patch_info *patch, const char __user *addr, int count);
 #ifdef AWE_HAS_GUS_COMPATIBILITY
-static int awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag);
+static int awe_load_guspatch(const char __user *addr, int offs, int size, int pmgr_flag);
 #endif
-/*static int awe_probe_info(awe_patch_info *patch, const char *addr, int count);*/
-static int awe_probe_data(awe_patch_info *patch, const char *addr, int count);
+/*static int awe_probe_info(awe_patch_info *patch, const char __user *addr, int count);*/
+static int awe_probe_data(awe_patch_info *patch, const char __user *addr, int count);
 static sf_list *check_patch_opened(int type, char *name);
-static int awe_write_wave_data(const char *addr, int offset, awe_sample_list *sp, int channels);
+static int awe_write_wave_data(const char __user *addr, int offset, awe_sample_list *sp, int channels);
 static int awe_create_sf(int type, char *name);
 static void awe_free_sf(sf_list *sf);
 static void add_sf_info(sf_list *sf, awe_voice_list *rec);
@@ -422,10 +422,10 @@ static void awe_close_dram(void);
 static int awe_detect_base(int addr);
 static int awe_detect(void);
 static void awe_check_dram(void);
-static int awe_load_chorus_fx(awe_patch_info *patch, const char *addr, int count);
+static int awe_load_chorus_fx(awe_patch_info *patch, const char __user *addr, int count);
 static void awe_set_chorus_mode(int mode);
 static void awe_update_chorus_mode(void);
-static int awe_load_reverb_fx(awe_patch_info *patch, const char *addr, int count);
+static int awe_load_reverb_fx(awe_patch_info *patch, const char __user *addr, int count);
 static void awe_set_reverb_mode(int mode);
 static void awe_update_reverb_mode(void);
 static void awe_equalizer(int bass, int treble);
@@ -1865,7 +1865,7 @@ awe_init_ctrl_parms(int init_all)
 /* sequencer I/O control:
  */
 static int
-awe_ioctl(int dev, unsigned int cmd, caddr_t arg)
+awe_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	switch (cmd) {
 	case SNDCTL_SYNTH_INFO:
@@ -1873,7 +1873,7 @@ awe_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			awe_info.nr_voices = awe_max_voices;
 		else
 			awe_info.nr_voices = AWE_MAX_CHANNELS;
-		if (copy_to_user((char*)arg, &awe_info, sizeof(awe_info)))
+		if (copy_to_user(arg, &awe_info, sizeof(awe_info)))
 			return -EFAULT;
 		return 0;
 		break;
@@ -2656,7 +2656,7 @@ awe_bender(int dev, int voice, int value)
  */
 
 static int
-awe_load_patch(int dev, int format, const char *addr,
+awe_load_patch(int dev, int format, const char __user *addr,
 	       int offs, int count, int pmgr_flag)
 {
 	awe_patch_info patch;
@@ -2865,7 +2865,7 @@ awe_free_sf(sf_list *sf)
 
 /* open patch; create sf list and set opened flag */
 static int
-awe_open_patch(awe_patch_info *patch, const char *addr, int count)
+awe_open_patch(awe_patch_info *patch, const char __user *addr, int count)
 {
 	awe_open_parm parm;
 	int shared;
@@ -2913,7 +2913,7 @@ check_patch_opened(int type, char *name)
 
 /* close the patch; if no voice is loaded, remove the patch */
 static int
-awe_close_patch(awe_patch_info *patch, const char *addr, int count)
+awe_close_patch(awe_patch_info *patch, const char __user *addr, int count)
 {
 	if (patch_opened && sftail) {
 		/* if no voice is loaded, release the current patch */
@@ -2929,7 +2929,7 @@ awe_close_patch(awe_patch_info *patch, const char *addr, int count)
 
 /* remove the latest patch */
 static int
-awe_unload_patch(awe_patch_info *patch, const char *addr, int count)
+awe_unload_patch(awe_patch_info *patch, const char __user *addr, int count)
 {
 	if (current_sf_id > 0 && current_sf_id > locked_sf_id) {
 		awe_reset(0);
@@ -2968,7 +2968,7 @@ alloc_new_sample(void)
 
 /* load voice map */
 static int
-awe_load_map(awe_patch_info *patch, const char *addr, int count)
+awe_load_map(awe_patch_info *patch, const char __user *addr, int count)
 {
 	awe_voice_map map;
 	awe_voice_list *rec, *p;
@@ -3019,7 +3019,7 @@ awe_load_map(awe_patch_info *patch, const char *addr, int count)
 #if 0
 /* probe preset in the current list -- nothing to be loaded */
 static int
-awe_probe_info(awe_patch_info *patch, const char *addr, int count)
+awe_probe_info(awe_patch_info *patch, const char __user *addr, int count)
 {
 #ifdef AWE_ALLOW_SAMPLE_SHARING
 	awe_voice_map map;
@@ -3054,7 +3054,7 @@ awe_probe_info(awe_patch_info *patch, const char *addr, int count)
 
 /* probe sample in the current list -- nothing to be loaded */
 static int
-awe_probe_data(awe_patch_info *patch, const char *addr, int count)
+awe_probe_data(awe_patch_info *patch, const char __user *addr, int count)
 {
 #ifdef AWE_ALLOW_SAMPLE_SHARING
 	if (! patch_opened)
@@ -3100,7 +3100,7 @@ remove_info(sf_list *sf, int bank, int instr)
 
 /* load voice information data */
 static int
-awe_load_info(awe_patch_info *patch, const char *addr, int count)
+awe_load_info(awe_patch_info *patch, const char __user *addr, int count)
 {
 	int offset;
 	awe_voice_rec_hdr hdr;
@@ -3188,7 +3188,7 @@ awe_load_info(awe_patch_info *patch, const char *addr, int count)
 
 /* remove instrument layers */
 static int
-awe_remove_info(awe_patch_info *patch, const char *addr, int count)
+awe_remove_info(awe_patch_info *patch, const char __user *addr, int count)
 {
 	unsigned char bank, instr;
 	sf_list *sf;
@@ -3208,7 +3208,7 @@ awe_remove_info(awe_patch_info *patch, const char *addr, int count)
 
 /* load wave sample data */
 static int
-awe_load_data(awe_patch_info *patch, const char *addr, int count)
+awe_load_data(awe_patch_info *patch, const char __user *addr, int count)
 {
 	int offset, size;
 	int rc;
@@ -3260,7 +3260,7 @@ awe_load_data(awe_patch_info *patch, const char *addr, int count)
 
 /* replace wave sample data */
 static int
-awe_replace_data(awe_patch_info *patch, const char *addr, int count)
+awe_replace_data(awe_patch_info *patch, const char __user *addr, int count)
 {
 	int offset;
 	int size;
@@ -3322,13 +3322,13 @@ awe_replace_data(awe_patch_info *patch, const char *addr, int count)
 
 /*----------------------------------------------------------------*/
 
-static const char *readbuf_addr;
+static const char __user *readbuf_addr;
 static int readbuf_offs;
 static int readbuf_flags;
 
 /* initialize read buffer */
 static int
-readbuf_init(const char *addr, int offset, awe_sample_info *sp)
+readbuf_init(const char __user *addr, int offset, awe_sample_info *sp)
 {
 	readbuf_addr = addr;
 	readbuf_offs = offset;
@@ -3344,10 +3344,10 @@ readbuf_word(int pos)
 	/* read from user buffer */
 	if (readbuf_flags & AWE_SAMPLE_8BITS) {
 		unsigned char cc;
-		get_user(cc, (unsigned char*)(readbuf_addr + readbuf_offs + pos));
+		get_user(cc, (unsigned char __user *)(readbuf_addr + readbuf_offs + pos));
 		c = (unsigned short)cc << 8; /* convert 8bit -> 16bit */
 	} else {
-		get_user(c, (unsigned short*)(readbuf_addr + readbuf_offs + pos * 2));
+		get_user(c, (unsigned short __user *)(readbuf_addr + readbuf_offs + pos * 2));
 	}
 	if (readbuf_flags & AWE_SAMPLE_UNSIGNED)
 		c ^= 0x8000; /* unsigned -> signed */
@@ -3365,7 +3365,7 @@ readbuf_word(int pos)
 
 /* loading onto memory - return the actual written size */
 static int 
-awe_write_wave_data(const char *addr, int offset, awe_sample_list *list, int channels)
+awe_write_wave_data(const char __user *addr, int offset, awe_sample_list *list, int channels)
 {
 	int i, truesize, dram_offset;
 	awe_sample_info *sp = &list->v;
@@ -3481,7 +3481,7 @@ calc_gus_envelope_time(int rate, int start, int end)
 
 /* load GUS patch */
 static int
-awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
+awe_load_guspatch(const char __user *addr, int offs, int size, int pmgr_flag)
 {
 	struct patch_info patch;
 	awe_voice_info *rec;
@@ -4112,7 +4112,7 @@ awe_setup_voice(int dev, int voice, int chn)
  * AWE32 mixer device control
  */
 
-static int awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg);
+static int awe_mixer_ioctl(int dev, unsigned int cmd, void __user *arg);
 
 static int my_mixerdev = -1;
 
@@ -4137,14 +4137,14 @@ static void __exit unload_mixer(void)
 }
 
 static int
-awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+awe_mixer_ioctl(int dev, unsigned int cmd, void __user * arg)
 {
 	int i, level, value;
 
 	if (((cmd >> 8) & 0xff) != 'M')
 		return -EINVAL;
 
-	if (get_user(level, (int *)arg))
+	if (get_user(level, (int __user *)arg))
 		return -EFAULT;
 	level = ((level & 0xff) + (level >> 8)) / 2;
 	DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
@@ -4201,7 +4201,7 @@ awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		level = 0;
 		break;
 	}
-	if (put_user(level, (int *)arg))
+	if (put_user(level, (int __user *)arg))
 		return -EFAULT;
 	return level;
 }
@@ -4662,7 +4662,7 @@ static awe_chorus_fx_rec chorus_parm[AWE_CHORUS_NUMBERS] = {
 };
 
 static int
-awe_load_chorus_fx(awe_patch_info *patch, const char *addr, int count)
+awe_load_chorus_fx(awe_patch_info *patch, const char __user *addr, int count)
 {
 	if (patch->optarg < AWE_CHORUS_PREDEFINED || patch->optarg >= AWE_CHORUS_NUMBERS) {
 		printk(KERN_WARNING "AWE32 Error: invalid chorus mode %d for uploading\n", patch->optarg);
@@ -4770,7 +4770,7 @@ static struct ReverbCmdPair {
 };
 
 static int
-awe_load_reverb_fx(awe_patch_info *patch, const char *addr, int count)
+awe_load_reverb_fx(awe_patch_info *patch, const char __user *addr, int count)
 {
 	if (patch->optarg < AWE_REVERB_PREDEFINED || patch->optarg >= AWE_REVERB_NUMBERS) {
 		printk(KERN_WARNING "AWE32 Error: invalid reverb mode %d for uploading\n", patch->optarg);
@@ -4915,7 +4915,7 @@ typedef struct {
 
 static int awe_midi_open(int dev, int mode, void (*input)(int,unsigned char), void (*output)(int));
 static void awe_midi_close(int dev);
-static int awe_midi_ioctl(int dev, unsigned cmd, caddr_t arg);
+static int awe_midi_ioctl(int dev, unsigned cmd, void __user * arg);
 static int awe_midi_outputc(int dev, unsigned char midi_byte);
 
 static void init_midi_status(MidiStatus *st);
@@ -5055,7 +5055,7 @@ awe_midi_close (int dev)
 
 
 static int
-awe_midi_ioctl (int dev, unsigned cmd, caddr_t arg)
+awe_midi_ioctl (int dev, unsigned cmd, void __user *arg)
 {
 	return -EPERM;
 }
diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c
index c8866da61..2a7ea80c5 100644
--- a/sound/oss/btaudio.c
+++ b/sound/oss/btaudio.c
@@ -327,6 +327,7 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
 {
 	struct btaudio *bta = file->private_data;
 	int ret,val=0,i=0;
+	void __user *argp = (void __user *)arg;
 
 	if (cmd == SOUND_MIXER_INFO) {
 		mixer_info info;
@@ -334,7 +335,7 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
                 strlcpy(info.id,"bt878",sizeof(info.id));
                 strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
                 info.modify_counter = bta->mixcount;
-                if (copy_to_user((void *)arg, &info, sizeof(info)))
+                if (copy_to_user(argp, &info, sizeof(info)))
                         return -EFAULT;
 		return 0;
 	}
@@ -343,16 +344,16 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
 		memset(&info,0,sizeof(info));
                 strlcpy(info.id,"bt878",sizeof(info.id)-1);
                 strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
-                if (copy_to_user((void *)arg, &info, sizeof(info)))
+                if (copy_to_user(argp, &info, sizeof(info)))
                         return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, (int __user *)argp);
 
 	/* read */
 	if (_SIOC_DIR(cmd) & _SIOC_WRITE)
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 
 	switch (cmd) {
@@ -421,7 +422,7 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
 	default:
 		return -EINVAL;
 	}
-	if (put_user(ret, (int *)arg))
+	if (put_user(ret, (int __user *)argp))
 		return -EFAULT;
 	return 0;
 }
@@ -503,7 +504,7 @@ static int btaudio_dsp_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t btaudio_dsp_read(struct file *file, char *buffer,
+static ssize_t btaudio_dsp_read(struct file *file, char __user *buffer,
 				size_t swcount, loff_t *ppos)
 {
 	struct btaudio *bta = file->private_data;
@@ -554,7 +555,7 @@ static ssize_t btaudio_dsp_read(struct file *file, char *buffer,
 		} else if (!bta->analog) {
 			/* stereo => mono (digital audio) */
 			__s16 *src = (__s16*)(bta->buf_cpu + bta->read_offset);
-			__s16 *dst = (__s16*)(buffer + ret);
+			__s16 __user *dst = (__s16 __user *)(buffer + ret);
 			__s16 avg;
 			int n = ndst>>1;
 			if (0 != verify_area(VERIFY_WRITE,dst,ndst)) {
@@ -565,13 +566,13 @@ static ssize_t btaudio_dsp_read(struct file *file, char *buffer,
 			for (; n; n--, dst++) {
 				avg  = (__s16)le16_to_cpu(*src) / 2; src++;
 				avg += (__s16)le16_to_cpu(*src) / 2; src++;
-				__put_user(cpu_to_le16(avg),(__u16*)(dst));
+				__put_user(cpu_to_le16(avg),dst);
 			}
 
 		} else if (8 == bta->bits) {
 			/* copy + byte downsampling (audio A/D) */
 			__u8 *src = bta->buf_cpu + bta->read_offset;
-			__u8 *dst = buffer + ret;
+			__u8 __user *dst = buffer + ret;
 			int n = ndst;
 			if (0 != verify_area(VERIFY_WRITE,dst,ndst)) {
 				if (0 == ret)
@@ -579,12 +580,12 @@ static ssize_t btaudio_dsp_read(struct file *file, char *buffer,
 				break;
 			}
 			for (; n; n--, src += (1 << bta->sampleshift), dst++)
-				__put_user(*src,(__u8*)(dst));
+				__put_user(*src, dst);
 
 		} else {
 			/* copy + word downsampling (audio A/D) */
 			__u16 *src = (__u16*)(bta->buf_cpu + bta->read_offset);
-			__u16 *dst = (__u16*)(buffer + ret);
+			__u16 __user *dst = (__u16 __user *)(buffer + ret);
 			int n = ndst>>1;
 			if (0 != verify_area(VERIFY_WRITE,dst,ndst)) {
 				if (0 == ret)
@@ -592,7 +593,7 @@ static ssize_t btaudio_dsp_read(struct file *file, char *buffer,
 				break;
 			}
 			for (; n; n--, src += (1 << bta->sampleshift), dst++)
-				__put_user(*src,(__u16*)(dst));
+				__put_user(*src, dst);
 		}
 
 		ret     += ndst;
@@ -609,7 +610,7 @@ static ssize_t btaudio_dsp_read(struct file *file, char *buffer,
 	return ret;
 }
 
-static ssize_t btaudio_dsp_write(struct file *file, const char *buffer,
+static ssize_t btaudio_dsp_write(struct file *file, const char __user *buffer,
 				 size_t count, loff_t *ppos)
 {
 	return -EINVAL;
@@ -620,15 +621,17 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 {
 	struct btaudio *bta = file->private_data;
 	int s, i, ret, val = 0;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	
         switch (cmd) {
         case OSS_GETVERSION:
-                return put_user(SOUND_VERSION, (int *)arg);
+                return put_user(SOUND_VERSION, p);
         case SNDCTL_DSP_GETCAPS:
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (bta->analog) {
 			for (s = 0; s < 16; s++)
@@ -656,14 +659,14 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 		/* fall through */
         case SOUND_PCM_READ_RATE:
 		if (bta->analog) {
-			return put_user(HWBASE_AD*4/bta->decimation>>bta->sampleshift, (int*)arg);
+			return put_user(HWBASE_AD*4/bta->decimation>>bta->sampleshift, p);
 		} else {
-			return put_user(bta->rate, (int*)arg);
+			return put_user(bta->rate, p);
 		}
 
         case SNDCTL_DSP_STEREO:
 		if (!bta->analog) {
-			if (get_user(val, (int*)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			bta->channels    = (val > 0) ? 2 : 1;
 			bta->sampleshift = (bta->channels == 2) ? 0 : 1;
@@ -681,11 +684,11 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 					       "btaudio: stereo=0 channels=1\n");
 			}
 		}
-		return put_user((bta->channels)-1, (int *)arg);
+		return put_user((bta->channels)-1, p);
 
         case SNDCTL_DSP_CHANNELS:
 		if (!bta->analog) {
-			if (get_user(val, (int*)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			bta->channels    = (val > 1) ? 2 : 1;
 			bta->sampleshift = (bta->channels == 2) ? 0 : 1;
@@ -696,16 +699,16 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 		}
 		/* fall through */
         case SOUND_PCM_READ_CHANNELS:
-		return put_user(bta->channels, (int *)arg);
+		return put_user(bta->channels, p);
 		
         case SNDCTL_DSP_GETFMTS: /* Returns a mask */
 		if (bta->analog)
-			return put_user(AFMT_S16_LE|AFMT_S8, (int*)arg);
+			return put_user(AFMT_S16_LE|AFMT_S8, p);
 		else
-			return put_user(AFMT_S16_LE, (int*)arg);
+			return put_user(AFMT_S16_LE, p);
 
         case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
                 if (val != AFMT_QUERY) {
 			if (bta->analog)
@@ -722,10 +725,10 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 		if (debug)
 			printk(KERN_DEBUG "btaudio: fmt: bits=%d\n",bta->bits);
                 return put_user((bta->bits==16) ? AFMT_S16_LE : AFMT_S8,
-				(int*)arg);
+				p);
 		break;
         case SOUND_PCM_READ_BITS:
-		return put_user(bta->bits, (int*)arg);
+		return put_user(bta->bits, p);
 
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -745,7 +748,7 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 			if (0 != (ret = make_risc(bta)))
 				return ret;
 		}
-		return put_user(bta->block_bytes>>bta->sampleshift,(int*)arg);
+		return put_user(bta->block_bytes>>bta->sampleshift,p);
 
         case SNDCTL_DSP_SYNC:
 		/* NOP */
@@ -764,7 +767,7 @@ static int btaudio_dsp_ioctl(struct inode *inode, struct file *file,
 			       "returns %d/%d/%d/%d\n",
 			       info.fragsize, info.fragstotal,
 			       info.bytes, info.fragments);
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c
index 9dce64309..a7d067c2d 100644
--- a/sound/oss/cmpci.c
+++ b/sound/oss/cmpci.c
@@ -1,16 +1,13 @@
-/*****************************************************************************/
 /*
  *      cmpci.c  --  C-Media PCI audio driver.
  *
- *      Copyright (C) 1999  ChenLi Tien (cltien@cmedia.com.tw)
- *      		    C-media support (support@cmedia.com.tw)
+ *      Copyright (C) 1999  C-media support (support@cmedia.com.tw)
  *
  *      Based on the PCI drivers by Thomas Sailer (sailer@ife.ee.ethz.ch)
  *
  * 	For update, visit:
- * 		http://members.home.net/puresoft/cmedia.html
  * 		http://www.cmedia.com.tw
- * 	
+ *
  *      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
@@ -77,16 +74,38 @@
  *    08/10/2001 - use set_current_state in some more places
  *
  *	Carlos Eduardo Gorges <carlos@techlinux.com.br>
- *	Fri May 25 2001 
+ *	Fri May 25 2001
  *	- SMP support ( spin[un]lock* revision )
- *	- speaker mixer support 
+ *	- speaker mixer support
  *	Mon Aug 13 2001
  *	- optimizations and cleanups
+ *
  *    03/01/2003 - open_mode fixes from Georg Acher <acher@in.tum.de>
+ *	Simon Braunschmidt <brasimon@web.de>
+ *     Sat Jan 31 2004
+ *	- provide support for opl3 FM by releasing IO range after initialization
+ *
+ *    ChenLi Tien <cltien@cmedia.com.tw>
+ *    Mar 9 2004
+ *	- Fix S/PDIF out if spdif_loop enabled
+ *	- Load opl3 driver if enabled (fmio in proper range)
+ *	- Load mpu401 if enabled (mpuio in proper range)
+ *    Apr 5 2004
+ *	- Fix DUAL_DAC dma synchronization bug
+ *	- Check exist FM/MPU401 I/O before activate.
+ *	- Add AFTM_S16_BE format support, so MPlayer/Xine can play AC3/mutlichannel
+ *	  on Mac
+ *	- Change to support kernel 2.6 so only small patch needed
+ *	- All parameters default to 0
+ *	- Add spdif_out to send PCM through S/PDIF out jack
+ *	- Add hw_copy to get 4-spaker output for general PCM/analog output
  *
+ *    Stefan Thater <stefan.thaeter@gmx.de>
+ *    Apr 5 2004
+ *	- Fix mute single channel for CD/Line-in/AUX-in
  */
 /*****************************************************************************/
-      
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
@@ -109,11 +128,21 @@
 #include <asm/page.h>
 #include <asm/uaccess.h>
 
-#include "dm.h"
+#ifdef CONFIG_SOUND_CMPCI_MIDI
+#include "sound_config.h"
+#include "mpu401.h"
+#endif
+#ifdef CONFIG_SOUND_CMPCI_FM
+#include "opl3.h"
+#endif
+#ifdef CONFIG_SOUND_CMPCI_JOYSTICK
+#include <linux/gameport.h>
+#endif
 
 /* --------------------------------------------------------------------- */
 #undef OSS_DOCUMENTED_MIXER_SEMANTICS
 #undef DMABYTEIO
+#define	DBG(x) {}
 /* --------------------------------------------------------------------- */
 
 #define CM_MAGIC  ((PCI_VENDOR_ID_CMEDIA<<16)|PCI_DEVICE_ID_CMEDIA_CM8338A)
@@ -142,6 +171,9 @@
 #define CODEC_CMI_CH1_FRAME1		(0x88)
 #define CODEC_CMI_CH1_FRAME2		(0x8C)
 
+#define CODEC_CMI_SPDIF_CTRL		(0x90)
+#define CODEC_CMI_MISC_CTRL2		(0x92)
+
 #define CODEC_CMI_EXT_REG		(0xF0)
 
 /*  Mixer registers for SB16 ******************/
@@ -178,51 +210,173 @@
 #define DSP_MIX_TREBLEIDX_R		((unsigned char)(0x45))
 #define DSP_MIX_BASSIDX_L		((unsigned char)(0x46))
 #define DSP_MIX_BASSIDX_R		((unsigned char)(0x47))
-
-#define CM_CH0_RESET			0x04
-#define CM_CH1_RESET			0x08
-#define CM_EXTENT_CODEC			0x100
-#define CM_EXTENT_MIDI			0x2
-#define CM_EXTENT_SYNTH			0x4
-#define CM_INT_CH0			1
-#define CM_INT_CH1			2
-
-#define CM_CFMT_STEREO			0x01
-#define CM_CFMT_16BIT			0x02
-#define CM_CFMT_MASK			0x03
-#define CM_CFMT_DACSHIFT		2
-#define CM_CFMT_ADCSHIFT		0
-
+#define DSP_MIX_EXTENSION		((unsigned char)(0xf0))
+// pseudo register for AUX
+#define	DSP_MIX_AUXVOL_L		((unsigned char)(0x50))
+#define	DSP_MIX_AUXVOL_R		((unsigned char)(0x51))
+
+// I/O length
+#define CM_EXTENT_CODEC	  0x100
+#define CM_EXTENT_MIDI	  0x2
+#define CM_EXTENT_SYNTH	  0x4
+#define CM_EXTENT_GAME	  0x8
+
+// Function Control Register 0 (00h)
+#define CHADC0    	0x01
+#define CHADC1    	0x02
+#define PAUSE0	  	0x04
+#define PAUSE1	  	0x08
+
+// Function Control Register 0+2 (02h)
+#define CHEN0     	0x01
+#define CHEN1     	0x02
+#define RST_CH0	  	0x04
+#define RST_CH1	  	0x08
+
+// Function Control Register 1 (04h)
+#define JYSTK_EN	0x02
+#define UART_EN		0x04
+#define	SPDO2DAC	0x40
+#define	SPDFLOOP	0x80
+
+// Function Control Register 1+1 (05h)
+#define	SPDF_0		0x01
+#define	SPDF_1		0x02
+#define	ASFC		0x1c
+#define	DSFC		0xe0
+#define	SPDIF2DAC	(SPDF_1 << 8 | SPDO2DAC)
+
+// Channel Format Register (08h)
+#define CM_CFMT_STEREO	0x01
+#define CM_CFMT_16BIT	0x02
+#define CM_CFMT_MASK	0x03
+#define	POLVALID	0x20
+#define	INVSPDIFI	0x80
+
+// Channel Format Register+2 (0ah)
+#define SPD24SEL	0x20
+
+// Channel Format Register+3 (0bh)
+#define CHB3D		0x20
+#define CHB3D5C		0x80
+
+// Interrupt Hold/Clear Register+2 (0eh)
+#define	CH0_INT_EN	0x01
+#define	CH1_INT_EN	0x02
+
+// Interrupt Register (10h)
+#define CHINT0		0x01
+#define CHINT1		0x02
+#define	CH0BUSY		0x04
+#define	CH1BUSY		0x08
+
+// Legacy Control/Status Register+1 (15h)
+#define	EXBASEN		0x10
+#define	BASE2LIN	0x20
+#define	CENTR2LIN	0x40
+#define	CB2LIN		(BASE2LIN | CENTR2LIN)
+#define	CHB3D6C		0x80
+
+// Legacy Control/Status Register+2 (16h)
+#define	DAC2SPDO	0x20
+#define	SPDCOPYRHT	0x40
+#define	ENSPDOUT	0x80
+
+// Legacy Control/Status Register+3 (17h)
+#define	FMSEL		0x03
+#define	VSBSEL		0x0c
+#define	VMPU		0x60
+#define	NXCHG		0x80
+
+// Miscellaneous Control Register (18h)
+#define	REAR2LIN	0x20
+#define	MUTECH1		0x40
+#define	ENCENTER	0x80
+
+// Miscellaneous Control Register+1 (19h)
+#define	SELSPDIFI2	0x01
+#define	SPDF_AC97	0x80
+
+// Miscellaneous Control Register+2 (1ah)
+#define	AC3_EN		0x04
+#define	FM_EN		0x08
+#define	SPD32SEL	0x20
+#define	XCHGDAC		0x40
+#define	ENDBDAC		0x80
+
+// Miscellaneous Control Register+3 (1bh)
+#define	SPDIFI48K	0x01
+#define	SPDO5V		0x02
+#define	N4SPK3D		0x04
+#define	RESET		0x40
+#define	PWD		0x80
+#define	SPDIF48K	(SPDIFI48K << 24 | SPDF_AC97 << 8)
+
+// Mixer1 (24h)
+#define	CDPLAY		0x01
+#define	X3DEN		0x02
+#define	REAR2FRONT	0x10
+#define	SPK4		0x20
+#define	WSMUTE		0x40
+#define	FMMUTE		0x80
+
+// Miscellaneous Register (27h)
+#define	SPDVALID	0x02
+#define	CENTR2MIC	0x04
+
+// Miscellaneous Register2 (92h)
+#define	SPD32KFMT	0x10
+
+#define CM_CFMT_DACSHIFT   2
+#define CM_CFMT_ADCSHIFT   0
+#define CM_FREQ_DACSHIFT   5
+#define CM_FREQ_ADCSHIFT   2
+#define	RSTDAC	RST_CH1
+#define	RSTADC	RST_CH0
+#define	ENDAC	CHEN1
+#define	ENADC	CHEN0
+#define	PAUSEDAC	PAUSE1
+#define	PAUSEADC	PAUSE0
+#define CODEC_CMI_ADC_FRAME1	CODEC_CMI_CH0_FRAME1
+#define CODEC_CMI_ADC_FRAME2	CODEC_CMI_CH0_FRAME2
+#define CODEC_CMI_DAC_FRAME1	CODEC_CMI_CH1_FRAME1
+#define CODEC_CMI_DAC_FRAME2	CODEC_CMI_CH1_FRAME2
+#define	DACINT	CHINT1
+#define	ADCINT	CHINT0
+#define	DACBUSY	CH1BUSY
+#define	ADCBUSY	CH0BUSY
+#define	ENDACINT	CH1_INT_EN
+#define	ENADCINT	CH0_INT_EN
+
+static const unsigned sample_size[] = { 1, 2, 2, 4 };
 static const unsigned sample_shift[]	= { 0, 1, 1, 2 };
 
-#define CM_ENABLE_CH1      0x2
-#define CM_ENABLE_CH0      0x1
-
-/* MIDI buffer sizes **************************/
+#define SND_DEV_DSP16   5
 
-#define MIDIINBUF  256
-#define MIDIOUTBUF 256
+#define NR_DEVICE 3		/* maximum number of devices */
 
-#define FMODE_MIDI_SHIFT 2
-#define FMODE_MIDI_READ  (FMODE_READ << FMODE_MIDI_SHIFT)
-#define FMODE_MIDI_WRITE (FMODE_WRITE << FMODE_MIDI_SHIFT)
+#define	set_dac1_rate	set_adc_rate
+#define	set_dac1_rate_unlocked	set_adc_rate_unlocked
+#define	stop_dac1	stop_adc
+#define	stop_dac1_unlocked	stop_adc_unlocked
+#define	get_dmadac1	get_dmaadc
 
-#define FMODE_DMFM 0x10
+static unsigned int devindex = 0;
 
-#define SND_DEV_DSP16   5 
+//*********************************************/
 
-#define NR_DEVICE 3		/* maximum number of devices */
+struct cm_state {
+	/* magic */
+	unsigned int magic;
 
-/*********************************************/
+	/* list of cmedia devices */
+	struct list_head devs;
 
-struct cm_state {
-	unsigned int magic;		/* magic */
-	struct cm_state *next;		/* we keep cm cards in a linked list */
+	/* the corresponding pci_dev structure */
+	struct pci_dev *dev;
 
 	int dev_audio;			/* soundcore stuff */
 	int dev_mixer;
-	int dev_midi;
-	int dev_dmfm;
 
 	unsigned int iosb, iobase, iosynth,
 			 iomidi, iogame, irq;	/* hardware resources */
@@ -243,7 +397,7 @@ struct cm_state {
 
 	struct dmabuf {
 		void *rawbuf;
-		unsigned rawphys;
+		dma_addr_t dmaaddr;
 		unsigned buforder;
 		unsigned numfrag;
 		unsigned fragshift;
@@ -252,38 +406,36 @@ struct cm_state {
 		int count;
 		unsigned error;		/* over/underrun */
 		wait_queue_head_t wait;
-		
+
 		unsigned fragsize;	/* redundant, but makes calculations easier */
 		unsigned dmasize;
 		unsigned fragsamples;
 		unsigned dmasamples;
-		
+
 		unsigned mapped:1;	/* OSS stuff */
 		unsigned ready:1;
 		unsigned endcleared:1;
+		unsigned enabled:1;
 		unsigned ossfragshift;
 		int ossmaxfrags;
 		unsigned subdivision;
 	} dma_dac, dma_adc;
 
-	struct {			/* midi stuff */
-		unsigned ird, iwr, icnt;
-		unsigned ord, owr, ocnt;
-		wait_queue_head_t iwait;
-		wait_queue_head_t owait;
-		struct timer_list timer;
-		unsigned char ibuf[MIDIINBUF];
-		unsigned char obuf[MIDIOUTBUF];
-	} midi;
-	
-	int	chip_version;		
+#ifdef CONFIG_SOUND_CMPCI_MIDI
+	int midi_devc;
+	struct address_info mpu_data;
+#endif
+#ifdef CONFIG_SOUND_CMPCI_JOYSTICK
+	struct gameport gameport;
+#endif
+
+	int	chip_version;
 	int	max_channels;
-	int	curr_channels;		
-	int	speakers;		/* number of speakers */
+	int	curr_channels;
 	int	capability;		/* HW capability, various for chip versions */
 
 	int	status;			/* HW or SW state */
-	
+
 	int	spdif_counter;		/* spdif frame counter */
 };
 
@@ -311,9 +463,44 @@ struct cm_state {
 #define	DO_SPDIF_OUT		0x00000100
 #define	DO_SPDIF_IN		0x00000200
 #define	DO_SPDIF_LOOP		0x00000400
-
-static struct cm_state *devs;
-static unsigned long wavetable_mem;
+#define	DO_BIGENDIAN_W		0x00001000		/* used in PowerPC */
+#define	DO_BIGENDIAN_R		0x00002000		/* used in PowerPC */
+
+static LIST_HEAD(devs);
+
+static	int	mpuio = 0;
+static	int	fmio = 0;
+static	int	joystick = 0;
+static	int	spdif_inverse = 0;
+static	int	spdif_loop = 0;
+static	int	spdif_out = 0;
+static	int	use_line_as_rear = 0;
+static	int	use_line_as_bass = 0;
+static	int	use_mic_as_bass = 0;
+static	int	mic_boost = 0;
+static	int	hw_copy = 0;
+MODULE_PARM(mpuio, "i");
+MODULE_PARM(fmio, "i");
+MODULE_PARM(joystick, "i");
+MODULE_PARM(spdif_inverse, "i");
+MODULE_PARM(spdif_loop, "i");
+MODULE_PARM(spdif_out, "i");
+MODULE_PARM(use_line_as_rear, "i");
+MODULE_PARM(use_line_as_bass, "i");
+MODULE_PARM(use_mic_as_bass, "i");
+MODULE_PARM(mic_boost, "i");
+MODULE_PARM(hw_copy, "i");
+MODULE_PARM_DESC(mpuio, "(0x330, 0x320, 0x310, 0x300) Base of MPU-401, 0 to disable");
+MODULE_PARM_DESC(fmio, "(0x388, 0x3C8, 0x3E0) Base of OPL3, 0 to disable");
+MODULE_PARM_DESC(joystick, "(1/0) Enable joystick interface, still need joystick driver");
+MODULE_PARM_DESC(spdif_inverse, "(1/0) Invert S/PDIF-in signal");
+MODULE_PARM_DESC(spdif_loop, "(1/0) Route S/PDIF-in to S/PDIF-out directly");
+MODULE_PARM_DESC(spdif_out, "(1/0) Send PCM to S/PDIF-out (PCM volume will not function)");
+MODULE_PARM_DESC(use_line_as_rear, "(1/0) Use line-in jack as rear-out");
+MODULE_PARM_DESC(use_line_as_bass, "(1/0) Use line-in jack as bass/center");
+MODULE_PARM_DESC(use_mic_as_bass, "(1/0) Use mic-in jack as bass/center");
+MODULE_PARM_DESC(mic_boost, "(1/0) Enable microphone boost");
+MODULE_PARM_DESC(hw_copy, "Copy front channel to surround channel");
 
 /* --------------------------------------------------------------------- */
 
@@ -324,7 +511,7 @@ static inline unsigned ld2(unsigned int x)
 
 	/* num: 2, 4, 16, 256, 65536 */
 	/* exp: 1, 2,  4,   8,    16 */
-	
+
 	while(l--) {
 		if( x >= num[l] ) {
 			if(num[l]>2) x >>= exp;
@@ -356,55 +543,55 @@ static void maskl(unsigned int addr, unsigned int mask, unsigned int value)
 static void set_dmadac1(struct cm_state *s, unsigned int addr, unsigned int count)
 {
 	if (addr)
-	    outl(addr, s->iobase + CODEC_CMI_CH0_FRAME1);
-	outw(count - 1, s->iobase + CODEC_CMI_CH0_FRAME2);
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~1, 0);
+	    outl(addr, s->iobase + CODEC_CMI_ADC_FRAME1);
+	outw(count - 1, s->iobase + CODEC_CMI_ADC_FRAME2);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~CHADC0, 0);
 }
 
 static void set_dmaadc(struct cm_state *s, unsigned int addr, unsigned int count)
 {
-	outl(addr, s->iobase + CODEC_CMI_CH0_FRAME1);
-	outw(count - 1, s->iobase + CODEC_CMI_CH0_FRAME2);
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~0, 1);
+	outl(addr, s->iobase + CODEC_CMI_ADC_FRAME1);
+	outw(count - 1, s->iobase + CODEC_CMI_ADC_FRAME2);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~0, CHADC0);
 }
 
 static void set_dmadac(struct cm_state *s, unsigned int addr, unsigned int count)
 {
-	outl(addr, s->iobase + CODEC_CMI_CH1_FRAME1);
-	outw(count - 1, s->iobase + CODEC_CMI_CH1_FRAME2);
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~2, 0);
+	outl(addr, s->iobase + CODEC_CMI_DAC_FRAME1);
+	outw(count - 1, s->iobase + CODEC_CMI_DAC_FRAME2);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~CHADC1, 0);
 	if (s->status & DO_DUAL_DAC)
 		set_dmadac1(s, 0, count);
 }
 
 static void set_countadc(struct cm_state *s, unsigned count)
 {
-	outw(count - 1, s->iobase + CODEC_CMI_CH0_FRAME2 + 2);
+	outw(count - 1, s->iobase + CODEC_CMI_ADC_FRAME2 + 2);
 }
 
 static void set_countdac(struct cm_state *s, unsigned count)
 {
-	outw(count - 1, s->iobase + CODEC_CMI_CH1_FRAME2 + 2);
+	outw(count - 1, s->iobase + CODEC_CMI_DAC_FRAME2 + 2);
 	if (s->status & DO_DUAL_DAC)
 	    set_countadc(s, count);
 }
 
-static inline unsigned get_dmadac(struct cm_state *s)
+static unsigned get_dmadac(struct cm_state *s)
 {
 	unsigned int curr_addr;
 
-	curr_addr = inw(s->iobase + CODEC_CMI_CH1_FRAME2) + 1;
+	curr_addr = inw(s->iobase + CODEC_CMI_DAC_FRAME2) + 1;
 	curr_addr <<= sample_shift[(s->fmt >> CM_CFMT_DACSHIFT) & CM_CFMT_MASK];
 	curr_addr = s->dma_dac.dmasize - curr_addr;
 
 	return curr_addr;
 }
 
-static inline unsigned get_dmaadc(struct cm_state *s)
+static unsigned get_dmaadc(struct cm_state *s)
 {
 	unsigned int curr_addr;
 
-	curr_addr = inw(s->iobase + CODEC_CMI_CH0_FRAME2) + 1;
+	curr_addr = inw(s->iobase + CODEC_CMI_ADC_FRAME2) + 1;
 	curr_addr <<= sample_shift[(s->fmt >> CM_CFMT_ADCSHIFT) & CM_CFMT_MASK];
 	curr_addr = s->dma_adc.dmasize - curr_addr;
 
@@ -413,30 +600,85 @@ static inline unsigned get_dmaadc(struct cm_state *s)
 
 static void wrmixer(struct cm_state *s, unsigned char idx, unsigned char data)
 {
+	unsigned char regval, pseudo;
+
+	// pseudo register
+	if (idx == DSP_MIX_AUXVOL_L) {
+		data >>= 4;
+		data &= 0x0f;
+		regval = inb(s->iobase + CODEC_CMI_AUX_VOL) & ~0x0f;
+		outb(regval | data, s->iobase + CODEC_CMI_AUX_VOL);
+		return;
+	}
+	if (idx == DSP_MIX_AUXVOL_R) {
+		data &= 0xf0;
+		regval = inb(s->iobase + CODEC_CMI_AUX_VOL) & ~0xf0;
+		outb(regval | data, s->iobase + CODEC_CMI_AUX_VOL);
+		return;
+	}
 	outb(idx, s->iobase + CODEC_SB16_ADDR);
 	udelay(10);
+	// pseudo bits
+	if (idx == DSP_MIX_OUTMIXIDX) {
+		pseudo = data & ~0x1f;
+		pseudo >>= 1;
+		regval = inb(s->iobase + CODEC_CMI_MIXER2) & ~0x30;
+		outb(regval | pseudo, s->iobase + CODEC_CMI_MIXER2);
+	}
+	if (idx == DSP_MIX_ADCMIXIDX_L) {
+		pseudo = data & 0x80;
+		pseudo >>= 1;
+		regval = inb(s->iobase + CODEC_CMI_MIXER2) & ~0x40;
+		outb(regval | pseudo, s->iobase + CODEC_CMI_MIXER2);
+	}
+	if (idx == DSP_MIX_ADCMIXIDX_R) {
+		pseudo = data & 0x80;
+		regval = inb(s->iobase + CODEC_CMI_MIXER2) & ~0x80;
+		outb(regval | pseudo, s->iobase + CODEC_CMI_MIXER2);
+	}
 	outb(data, s->iobase + CODEC_SB16_DATA);
 	udelay(10);
 }
 
 static unsigned char rdmixer(struct cm_state *s, unsigned char idx)
 {
-	unsigned char v;
-	unsigned long flags;
-	
-	spin_lock_irqsave(&s->lock, flags);
+	unsigned char v, pseudo;
+
+	// pseudo register
+	if (idx == DSP_MIX_AUXVOL_L) {
+		v = inb(s->iobase + CODEC_CMI_AUX_VOL) & 0x0f;
+		v <<= 4;
+		return v;
+	}
+	if (idx == DSP_MIX_AUXVOL_L) {
+		v = inb(s->iobase + CODEC_CMI_AUX_VOL) & 0xf0;
+		return v;
+	}
 	outb(idx, s->iobase + CODEC_SB16_ADDR);
 	udelay(10);
 	v = inb(s->iobase + CODEC_SB16_DATA);
 	udelay(10);
-	spin_unlock_irqrestore(&s->lock, flags);
+	// pseudo bits
+	if (idx == DSP_MIX_OUTMIXIDX) {
+		pseudo = inb(s->iobase + CODEC_CMI_MIXER2) & 0x30;
+		pseudo <<= 1;
+		v |= pseudo;
+	}
+	if (idx == DSP_MIX_ADCMIXIDX_L) {
+		pseudo = inb(s->iobase + CODEC_CMI_MIXER2) & 0x40;
+		pseudo <<= 1;
+		v |= pseudo;
+	}
+	if (idx == DSP_MIX_ADCMIXIDX_R) {
+		pseudo = inb(s->iobase + CODEC_CMI_MIXER2) & 0x80;
+		v |= pseudo;
+	}
 	return v;
 }
 
 static void set_fmt_unlocked(struct cm_state *s, unsigned char mask, unsigned char data)
 {
-	if (mask)
-	{
+	if (mask && s->chip_version > 0) {	/* 8338 cannot keep this */
 		s->fmt = inb(s->iobase + CODEC_CMI_CHFORMAT);
 		udelay(10);
 	}
@@ -479,24 +721,98 @@ static struct {
 	{ 48000,	(44100 + 48000) / 2,	48000,			7 }
 };
 
+static void set_spdif_copyright(struct cm_state *s, int spdif_copyright)
+{
+	/* enable SPDIF-in Copyright */
+	maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 2, ~SPDCOPYRHT, spdif_copyright ? SPDCOPYRHT : 0);
+}
+
+static void set_spdif_loop(struct cm_state *s, int spdif_loop)
+{
+	/* enable SPDIF loop */
+	if (spdif_loop) {
+		s->status |= DO_SPDIF_LOOP;
+		/* turn on spdif-in to spdif-out */
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, SPDFLOOP);
+	} else {
+		s->status &= ~DO_SPDIF_LOOP;
+		/* turn off spdif-in to spdif-out */
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~SPDFLOOP, 0);
+	}
+}
+
+static void set_spdif_monitor(struct cm_state *s, int channel)
+{
+	// SPDO2DAC
+	maskw(s->iobase + CODEC_CMI_FUNCTRL1, ~SPDO2DAC, channel == 2 ? SPDO2DAC : 0);
+	// CDPLAY
+	if (s->chip_version >= 39)
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~CDPLAY, channel ? CDPLAY : 0);
+}
+
+static void set_spdifout_level(struct cm_state *s, int level5v)
+{
+	/* SPDO5V */
+	if (s->chip_version > 0)
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 3, ~SPDO5V, level5v ? SPDO5V : 0);
+}
+
+static void set_spdifin_inverse(struct cm_state *s, int spdif_inverse)
+{
+	if (s->chip_version == 0)	/* 8338 has not this feature */
+		return;
+	if (spdif_inverse) {
+		/* turn on spdif-in inverse */
+		if (s->chip_version >= 39)
+			maskb(s->iobase + CODEC_CMI_CHFORMAT, ~0, INVSPDIFI);
+		else
+			maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, 1);
+	} else {
+		/* turn off spdif-ininverse */
+		if (s->chip_version >= 39)
+			maskb(s->iobase + CODEC_CMI_CHFORMAT, ~INVSPDIFI, 0);
+		else
+			maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~1, 0);
+	}
+}
+
+static void set_spdifin_channel2(struct cm_state *s, int channel2)
+{
+	/* SELSPDIFI2 */
+	if (s->chip_version >= 39)
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 1, ~SELSPDIFI2, channel2 ? SELSPDIFI2 : 0);
+}
+
+static void set_spdifin_valid(struct cm_state *s, int valid)
+{
+	/* SPDVALID */
+	maskb(s->iobase + CODEC_CMI_MISC, ~SPDVALID, valid ? SPDVALID : 0);
+}
+
 static void set_spdifout_unlocked(struct cm_state *s, unsigned rate)
 {
+	if (rate != 48000 && rate != 44100)
+		rate = 0;
 	if (rate == 48000 || rate == 44100) {
-		// SPDIFI48K SPDF_ACc97
-		maskl(s->iobase + CODEC_CMI_MISC_CTRL, ~0x01008000, rate == 48000 ? 0x01008000 : 0);
+		set_spdif_loop(s, 0);
+		// SPDF_1
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~0, SPDF_1);
+		// SPDIFI48K SPDF_AC97
+		maskl(s->iobase + CODEC_CMI_MISC_CTRL, ~SPDIF48K, rate == 48000 ? SPDIF48K : 0);
+		if (s->chip_version >= 55)
+		// SPD32KFMT
+			maskb(s->iobase + CODEC_CMI_MISC_CTRL2, ~SPD32KFMT, rate == 48000 ? SPD32KFMT : 0);
+		if (s->chip_version > 0)
 		// ENSPDOUT
-		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 2, ~0, 0x80);
-		// SPDF_1 SPD2DAC
-		maskw(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x240);
-		// CDPLAY
-		if (s->chip_version >= 39)
-			maskb(s->iobase + CODEC_CMI_MIXER1, ~0, 1);
+			maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 2, ~0, ENSPDOUT);
+		// monitor SPDIF out
+		set_spdif_monitor(s, 2);
 		s->status |= DO_SPDIF_OUT;
 	} else {
-		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 2, ~0x80, 0);
-		maskw(s->iobase + CODEC_CMI_FUNCTRL1, ~0x240, 0);
-		if (s->chip_version >= 39)
-			maskb(s->iobase + CODEC_CMI_MIXER1, ~1, 0);
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~SPDF_1, 0);
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 2, ~ENSPDOUT, 0);
+		// monitor none
+		set_spdif_monitor(s, 0);
 		s->status &= ~DO_SPDIF_OUT;
 	}
 }
@@ -510,6 +826,29 @@ static void set_spdifout(struct cm_state *s, unsigned rate)
 	spin_unlock_irqrestore(&s->lock, flags);
 }
 
+static void set_spdifin_unlocked(struct cm_state *s, unsigned rate)
+{
+	if (rate == 48000 || rate == 44100) {
+		// SPDF_1
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~0, SPDF_1);
+		// SPDIFI48K SPDF_AC97
+		maskl(s->iobase + CODEC_CMI_MISC_CTRL, ~SPDIF48K, rate == 48000 ? SPDIF48K : 0);
+		s->status |= DO_SPDIF_IN;
+	} else {
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~SPDF_1, 0);
+		s->status &= ~DO_SPDIF_IN;
+	}
+}
+
+static void set_spdifin(struct cm_state *s, unsigned rate)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&s->lock, flags);
+	set_spdifin_unlocked(s,rate);
+	spin_unlock_irqrestore(&s->lock, flags);
+}
+
 /* find parity for bit 4~30 */
 static unsigned parity(unsigned data)
 {
@@ -528,24 +867,38 @@ static unsigned parity(unsigned data)
 
 static void set_ac3_unlocked(struct cm_state *s, unsigned rate)
 {
+	if (!(s->capability & CAN_AC3))
+		return;
 	/* enable AC3 */
+	if (rate && rate != 44100)
+		rate = 48000;
 	if (rate == 48000 || rate == 44100) {
 		// mute DAC
-		maskb(s->iobase + CODEC_CMI_MIXER1, ~0, 0x40);
-		// AC3EN for 037, 0x10
-		maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, 0x10);
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~0, WSMUTE);
+		if (s->chip_version >= 39)
+			maskb(s->iobase + CODEC_CMI_MISC_CTRL, ~0, MUTECH1);
 		// AC3EN for 039, 0x04
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, 0x04);
+		if (s->chip_version >= 39) {
+			maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, AC3_EN);
+			if (s->chip_version == 55)
+				maskb(s->iobase + CODEC_CMI_SPDIF_CTRL, ~2, 0);
+		// AC3EN for 037, 0x10
+		} else if (s->chip_version == 37)
+			maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, 0x10);
 		if (s->capability & CAN_AC3_HW) {
-			// SPD24SEL for 037, 0x02
 			// SPD24SEL for 039, 0x20, but cannot be set
-			maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, 0x02);
-			s->status |= DO_AC3_HW;
+			if (s->chip_version == 39)
+				maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, SPD24SEL);
+			// SPD24SEL for 037, 0x02
+			else if (s->chip_version == 37)
+				maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, 0x02);
 			if (s->chip_version >= 39)
-				maskb(s->iobase + CODEC_CMI_MIXER1, ~1, 0);
+				maskb(s->iobase + CODEC_CMI_MIXER1, ~CDPLAY, 0);
+
+			s->status |= DO_AC3_HW;
 		 } else {
-			// SPD32SEL for 037 & 039, 0x20
-			maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, 0x20);
+			// SPD32SEL for 037 & 039
+			maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, SPD32SEL);
 			// set 176K sample rate to fix 033 HW bug
 			if (s->chip_version == 33) {
 				if (rate == 48000)
@@ -556,18 +909,65 @@ static void set_ac3_unlocked(struct cm_state *s, unsigned rate)
 			s->status |= DO_AC3_SW;
 		}
 	} else {
-		maskb(s->iobase + CODEC_CMI_MIXER1, ~0x40, 0);
-		maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0x32, 0);
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0x24, 0);
-		maskb(s->iobase + CODEC_CMI_CHFORMAT + 1, ~0x08, 0);
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~WSMUTE, 0);
+		if (s->chip_version >= 39)
+			maskb(s->iobase + CODEC_CMI_MISC_CTRL, ~MUTECH1, 0);
+		maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~(SPD24SEL|0x12), 0);
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~(SPD32SEL|AC3_EN), 0);
 		if (s->chip_version == 33)
 			maskb(s->iobase + CODEC_CMI_CHFORMAT + 1, ~0x08, 0);
 		if (s->chip_version >= 39)
-			maskb(s->iobase + CODEC_CMI_MIXER1, ~0, 1);
+			maskb(s->iobase + CODEC_CMI_MIXER1, ~0, CDPLAY);
 		s->status &= ~DO_AC3;
 	}
 	s->spdif_counter = 0;
+}
+
+static void set_line_as_rear(struct cm_state *s, int use_line_as_rear)
+{
+	if (!(s->capability & CAN_LINE_AS_REAR))
+		return;
+	if (use_line_as_rear) {
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~0, SPK4);
+		s->status |= DO_LINE_AS_REAR;
+	} else {
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~SPK4, 0);
+		s->status &= ~DO_LINE_AS_REAR;
+	}
+}
+
+static void set_line_as_bass(struct cm_state *s, int use_line_as_bass)
+{
+	if (!(s->capability & CAN_LINE_AS_BASS))
+		return;
+	if (use_line_as_bass) {
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~0, CB2LIN);
+		s->status |= DO_LINE_AS_BASS;
+	} else {
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~CB2LIN, 0);
+		s->status &= ~DO_LINE_AS_BASS;
+	}
+}
+
+static void set_mic_as_bass(struct cm_state *s, int use_mic_as_bass)
+{
+	if (!(s->capability & CAN_MIC_AS_BASS))
+		return;
+	if (use_mic_as_bass) {
+		maskb(s->iobase + CODEC_CMI_MISC, ~0, 0x04);
+		s->status |= DO_MIC_AS_BASS;
+	} else {
+		maskb(s->iobase + CODEC_CMI_MISC, ~0x04, 0);
+		s->status &= ~DO_MIC_AS_BASS;
+	}
+}
 
+static void set_hw_copy(struct cm_state *s, int hw_copy)
+{
+    	if (s->max_channels > 2 && hw_copy)
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 3, ~0, N4SPK3D);
+    	else
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 3, ~N4SPK3D, 0);
 }
 
 static void set_ac3(struct cm_state *s, unsigned rate)
@@ -576,21 +976,23 @@ static void set_ac3(struct cm_state *s, unsigned rate)
 
 	spin_lock_irqsave(&s->lock, flags);
 	set_spdifout_unlocked(s, rate);
-	set_ac3_unlocked(s,rate);
+	set_ac3_unlocked(s, rate);
 	spin_unlock_irqrestore(&s->lock, flags);
 }
 
-static int trans_ac3(struct cm_state *s, void *dest, const char *source, int size)
+static int trans_ac3(struct cm_state *s, void *dest, const char __user *source, int size)
 {
 	int   i = size / 2;
-	int err;
 	unsigned long data;
+	unsigned short data16;
 	unsigned long *dst = (unsigned long *) dest;
-	unsigned short *src = (unsigned short *)source;
+	unsigned short __user *src = (unsigned short __user *)source;
+	int err;
 
 	do {
-		if ((err = __get_user(data, src++)))
+		if ((err = __get_user(data16, src++)))
 			return err;
+		data = (unsigned long)le16_to_cpu(data16);
 		data <<= 12;			// ok for 16-bit data
 		if (s->spdif_counter == 2 || s->spdif_counter == 3)
 			data |= 0x40000000;	// indicate AC-3 raw data
@@ -602,7 +1004,7 @@ static int trans_ac3(struct cm_state *s, void *dest, const char *source, int siz
 			data |= 5;		// odd, 'W'
 		else
 			data |= 9;		// even, 'M'
-		*dst++ = data;
+		*dst++ = cpu_to_le32(data);
 		s->spdif_counter++;
 		if (s->spdif_counter == 384)
 			s->spdif_counter = 0;
@@ -628,9 +1030,9 @@ static void set_adc_rate_unlocked(struct cm_state *s, unsigned rate)
 	    	}
 	}
 	s->rateadc = rate;
-	freq <<= 2;
+	freq <<= CM_FREQ_ADCSHIFT;
 
-	maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~0x1c, freq);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~ASFC, freq);
 }
 
 static void set_adc_rate(struct cm_state *s, unsigned rate)
@@ -651,10 +1053,10 @@ static void set_adc_rate(struct cm_state *s, unsigned rate)
 	    	}
 	}
 	s->rateadc = rate;
-	freq <<= 2;
+	freq <<= CM_FREQ_ADCSHIFT;
 
 	spin_lock_irqsave(&s->lock, flags);
-	maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~0x1c, freq);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~ASFC, freq);
 	spin_unlock_irqrestore(&s->lock, flags);
 }
 
@@ -676,46 +1078,45 @@ static void set_dac_rate(struct cm_state *s, unsigned rate)
 	    	}
 	}
 	s->ratedac = rate;
-	freq <<= 5;
+	freq <<= CM_FREQ_DACSHIFT;
 
 	spin_lock_irqsave(&s->lock, flags);
-	maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~0xe0, freq);
-
+	maskb(s->iobase + CODEC_CMI_FUNCTRL1 + 1, ~DSFC, freq);
+	spin_unlock_irqrestore(&s->lock, flags);
 
-	if (s->curr_channels <=  2)
-		set_spdifout_unlocked(s, rate);
+	if (s->curr_channels <= 2 && spdif_out)
+		set_spdifout(s, rate);
 	if (s->status & DO_DUAL_DAC)
-		set_adc_rate_unlocked(s, rate);
-
-	spin_unlock_irqrestore(&s->lock, flags);
+		set_dac1_rate(s, rate);
 }
 
 /* --------------------------------------------------------------------- */
 static inline void reset_adc(struct cm_state *s)
 {
 	/* reset bus master */
-	outb(s->enable | CM_CH0_RESET, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
+	outb(s->enable | RSTADC, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 	udelay(10);
-	outb(s->enable & ~CM_CH0_RESET, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
+	outb(s->enable & ~RSTADC, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 }
 
 static inline void reset_dac(struct cm_state *s)
 {
 	/* reset bus master */
-	outb(s->enable | CM_CH1_RESET, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
-	outb(s->enable & ~CM_CH1_RESET, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
+	outb(s->enable | RSTDAC, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
+	udelay(10);
+	outb(s->enable & ~RSTDAC, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 	if (s->status & DO_DUAL_DAC)
 		reset_adc(s);
 }
 
 static inline void pause_adc(struct cm_state *s)
 {
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~0, 4);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~0, PAUSEADC);
 }
 
 static inline void pause_dac(struct cm_state *s)
 {
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~0, 8);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~0, PAUSEDAC);
 	if (s->status & DO_DUAL_DAC)
 		pause_adc(s);
 }
@@ -723,7 +1124,7 @@ static inline void pause_dac(struct cm_state *s)
 static inline void disable_adc(struct cm_state *s)
 {
 	/* disable channel */
-	s->enable &= ~CM_ENABLE_CH0;
+	s->enable &= ~ENADC;
 	outb(s->enable, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 	reset_adc(s);
 }
@@ -731,7 +1132,7 @@ static inline void disable_adc(struct cm_state *s)
 static inline void disable_dac(struct cm_state *s)
 {
 	/* disable channel */
-	s->enable &= ~CM_ENABLE_CH1;
+	s->enable &= ~ENDAC;
 	outb(s->enable, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 	reset_dac(s);
 	if (s->status & DO_DUAL_DAC)
@@ -740,22 +1141,22 @@ static inline void disable_dac(struct cm_state *s)
 
 static inline void enable_adc(struct cm_state *s)
 {
-	if (!(s->enable & CM_ENABLE_CH0)) {
+	if (!(s->enable & ENADC)) {
 		/* enable channel */
-		s->enable |= CM_ENABLE_CH0;
+		s->enable |= ENADC;
 		outb(s->enable, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 	}
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~4, 0);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~PAUSEADC, 0);
 }
 
 static inline void enable_dac_unlocked(struct cm_state *s)
 {
-	if (!(s->enable & CM_ENABLE_CH1)) {
+	if (!(s->enable & ENDAC)) {
 		/* enable channel */
-		s->enable |= CM_ENABLE_CH1;
+		s->enable |= ENDAC;
 		outb(s->enable, s->iobase + CODEC_CMI_FUNCTRL0 + 2);
 	}
-	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~8, 0);
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~PAUSEDAC, 0);
 
 	if (s->status & DO_DUAL_DAC)
 		enable_adc(s);
@@ -772,9 +1173,9 @@ static inline void enable_dac(struct cm_state *s)
 
 static inline void stop_adc_unlocked(struct cm_state *s)
 {
-	if (s->enable & CM_ENABLE_CH0) {
+	if (s->enable & ENADC) {
 		/* disable interrupt */
-		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~1, 0);
+		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~ENADCINT, 0);
 		disable_adc(s);
 	}
 }
@@ -791,13 +1192,13 @@ static inline void stop_adc(struct cm_state *s)
 
 static inline void stop_dac_unlocked(struct cm_state *s)
 {
-	if (s->enable & CM_ENABLE_CH1) {
+	if (s->enable & ENDAC) {
 		/* disable interrupt */
-		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~2, 0);
+		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~ENDACINT, 0);
 		disable_dac(s);
 	}
 	if (s->status & DO_DUAL_DAC)
-		stop_adc_unlocked(s);
+		stop_dac1_unlocked(s);
 }
 
 static inline void stop_dac(struct cm_state *s)
@@ -809,12 +1210,12 @@ static inline void stop_dac(struct cm_state *s)
 	spin_unlock_irqrestore(&s->lock, flags);
 }
 
-static void start_adc_unlocked(struct cm_state *s)
+static inline void start_adc_unlocked(struct cm_state *s)
 {
 	if ((s->dma_adc.mapped || s->dma_adc.count < (signed)(s->dma_adc.dmasize - 2*s->dma_adc.fragsize))
 	    && s->dma_adc.ready) {
 		/* enable interrupt */
-		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~0, 1);
+		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~0, ENADCINT);
 		enable_adc(s);
 	}
 }
@@ -826,13 +1227,13 @@ static void start_adc(struct cm_state *s)
 	spin_lock_irqsave(&s->lock, flags);
 	start_adc_unlocked(s);
 	spin_unlock_irqrestore(&s->lock, flags);
-}	
+}
 
 static void start_dac1_unlocked(struct cm_state *s)
 {
 	if ((s->dma_adc.mapped || s->dma_adc.count > 0) && s->dma_adc.ready) {
 		/* enable interrupt */
-//		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~0, 1);
+		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~0, ENADCINT);
  		enable_dac_unlocked(s);
 	}
 }
@@ -841,11 +1242,11 @@ static void start_dac_unlocked(struct cm_state *s)
 {
 	if ((s->dma_dac.mapped || s->dma_dac.count > 0) && s->dma_dac.ready) {
 		/* enable interrupt */
-		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~0, 2);
+		maskb(s->iobase + CODEC_CMI_INT_HLDCLR + 2, ~0, ENDACINT);
 		enable_dac_unlocked(s);
 	}
-		if (s->status & DO_DUAL_DAC)
-			start_dac1_unlocked(s);
+	if (s->status & DO_DUAL_DAC)
+		start_dac1_unlocked(s);
 }
 
 static void start_dac(struct cm_state *s)
@@ -855,13 +1256,15 @@ static void start_dac(struct cm_state *s)
 	spin_lock_irqsave(&s->lock, flags);
 	start_dac_unlocked(s);
 	spin_unlock_irqrestore(&s->lock, flags);
-}	
+}
 
 static int prog_dmabuf(struct cm_state *s, unsigned rec);
 
 static int set_dac_channels(struct cm_state *s, int channels)
 {
 	unsigned long flags;
+	static unsigned int fmmute = 0;
+
 	spin_lock_irqsave(&s->lock, flags);
 
 	if ((channels > 2) && (channels <= s->max_channels)
@@ -869,13 +1272,13 @@ static int set_dac_channels(struct cm_state *s, int channels)
 	    set_spdifout_unlocked(s, 0);
 	    if (s->capability & CAN_MULTI_CH_HW) {
 		// NXCHG
-		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0, 0x80);
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0, NXCHG);
 		// CHB3D or CHB3D5C
-	       	maskb(s->iobase + CODEC_CMI_CHFORMAT + 3, ~0xa0, channels > 4 ? 0x80 : 0x20);
+	       	maskb(s->iobase + CODEC_CMI_CHFORMAT + 3, ~(CHB3D5C|CHB3D), channels > 4 ? CHB3D5C : CHB3D);
 		// CHB3D6C
-		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~0x80, channels == 6 ? 0x80 : 0);
-		// ENCENTER 
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL, ~0x80, channels == 6 ? 0x80 : 0);
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~CHB3D6C, channels == 6 ? CHB3D6C : 0);
+		// ENCENTER
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL, ~ENCENTER, channels == 6 ? ENCENTER : 0);
 		s->status |= DO_MULTI_CH_HW;
 	    } else if (s->capability & CAN_DUAL_DAC) {
 		unsigned char fmtm = ~0, fmts = 0;
@@ -883,10 +1286,12 @@ static int set_dac_channels(struct cm_state *s, int channels)
 
 		// ENDBDAC, turn on double DAC mode
 		// XCHGDAC, CH0 -> back, CH1->front
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, 0xC0);
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, ENDBDAC|XCHGDAC);
+		// mute FM
+		fmmute = inb(s->iobase + CODEC_CMI_MIXER1) & FMMUTE;
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~0, FMMUTE);
 		s->status |= DO_DUAL_DAC;
 		// prepare secondary buffer
-
 		spin_unlock_irqrestore(&s->lock, flags);
 		ret = prog_dmabuf(s, 1);
 		if (ret) return ret;
@@ -900,30 +1305,38 @@ static int set_dac_channels(struct cm_state *s, int channels)
 		fmts |= CM_CFMT_16BIT << CM_CFMT_ADCSHIFT;
 		fmts |= CM_CFMT_STEREO << CM_CFMT_DACSHIFT;
 		fmts |= CM_CFMT_STEREO << CM_CFMT_ADCSHIFT;
-		
+
 		set_fmt_unlocked(s, fmtm, fmts);
 		set_adc_rate_unlocked(s, s->ratedac);
-
 	    }
-
-	    if (s->speakers > 2)
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 3, ~0x04, 0);
+	    // disable 4 speaker mode (analog duplicate)
+	    set_hw_copy(s, 0);
 	    s->curr_channels = channels;
+
+	    // enable jack redirect
+	    set_line_as_rear(s, use_line_as_rear);
+	    if (channels > 4) {
+		    set_line_as_bass(s, use_line_as_bass);
+		    set_mic_as_bass(s, use_mic_as_bass);
+	    }
 	} else {
 	    if (s->status & DO_MULTI_CH_HW) {
-		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0x80, 0);
-		maskb(s->iobase + CODEC_CMI_CHFORMAT + 3, ~0xa0, 0);
-		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~0x80, 0);
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~NXCHG, 0);
+		maskb(s->iobase + CODEC_CMI_CHFORMAT + 3, ~(CHB3D5C|CHB3D), 0);
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~CHB3D6C, 0);
 	    } else if (s->status & DO_DUAL_DAC) {
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0x80, 0);
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~ENDBDAC, 0);
+		maskb(s->iobase + CODEC_CMI_MIXER1, ~FMMUTE, fmmute);
 	    }
-	    // N4SPK3D, enable 4 speaker mode (analog duplicate)
-	    if (s->speakers > 2)
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 3, ~0, 0x04);
+	    // enable 4 speaker mode (analog duplicate)
+	    set_hw_copy(s, hw_copy);
 	    s->status &= ~DO_MULTI_CH;
 	    s->curr_channels = s->fmt & (CM_CFMT_STEREO << CM_CFMT_DACSHIFT) ? 2 : 1;
+	    // disable jack redirect
+	    set_line_as_rear(s, hw_copy ? use_line_as_rear : 0);
+	    set_line_as_bass(s, 0);
+	    set_mic_as_bass(s, 0);
 	}
-
 	spin_unlock_irqrestore(&s->lock, flags);
 	return s->curr_channels;
 }
@@ -933,16 +1346,16 @@ static int set_dac_channels(struct cm_state *s, int channels)
 #define DMABUF_DEFAULTORDER (16-PAGE_SHIFT)
 #define DMABUF_MINORDER 1
 
-static void dealloc_dmabuf(struct dmabuf *db)
+static void dealloc_dmabuf(struct cm_state *s, struct dmabuf *db)
 {
 	struct page *pstart, *pend;
-	
+
 	if (db->rawbuf) {
 		/* undo marking the pages as reserved */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (pstart = virt_to_page(db->rawbuf); pstart <= pend; pstart++)
 			ClearPageReserved(pstart);
-		free_pages((unsigned long)db->rawbuf, db->buforder);
+		pci_free_consistent(s->dev, PAGE_SIZE << db->buforder, db->rawbuf, db->dmaaddr);
 	}
 	db->rawbuf = NULL;
 	db->mapped = db->ready = 0;
@@ -975,18 +1388,11 @@ static int prog_dmabuf(struct cm_state *s, unsigned rec)
 	if (!db->rawbuf) {
 		db->ready = db->mapped = 0;
 		for (order = DMABUF_DEFAULTORDER; order >= DMABUF_MINORDER; order--)
-			if ((db->rawbuf = (void *)__get_free_pages(GFP_KERNEL | GFP_DMA, order)))
+			if ((db->rawbuf = pci_alloc_consistent(s->dev, PAGE_SIZE << order, &db->dmaaddr)))
 				break;
-		if (!db->rawbuf)
+		if (!db->rawbuf || !db->dmaaddr)
 			return -ENOMEM;
 		db->buforder = order;
-		db->rawphys = virt_to_bus(db->rawbuf);
-		if ((db->rawphys ^ (db->rawphys + (PAGE_SIZE << db->buforder) - 1)) & ~0xffff)
-			printk(KERN_DEBUG "cmpci: DMA buffer crosses 64k boundary: busaddr 0x%lx  size %ld\n", 
-			       (long) db->rawphys, PAGE_SIZE << db->buforder);
-		if ((db->rawphys + (PAGE_SIZE << db->buforder) - 1) & ~0xffffff)
-			printk(KERN_DEBUG "cmpci: DMA buffer beyond 16MB: busaddr 0x%lx  size %ld\n", 
-			       (long) db->rawphys, PAGE_SIZE << db->buforder);
 		/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
 		pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
 		for (pstart = virt_to_page(db->rawbuf); pstart <= pend; pstart++)
@@ -1020,17 +1426,18 @@ static int prog_dmabuf(struct cm_state *s, unsigned rec)
 	spin_lock_irqsave(&s->lock, flags);
 	if (rec) {
 		if (s->status & DO_DUAL_DAC)
-		    set_dmadac1(s, db->rawphys, db->dmasize >> sample_shift[fmt]);
+		    set_dmadac1(s, db->dmaaddr, db->dmasize >> sample_shift[fmt]);
 		else
-		    set_dmaadc(s, db->rawphys, db->dmasize >> sample_shift[fmt]);
+		    set_dmaadc(s, db->dmaaddr, db->dmasize >> sample_shift[fmt]);
 		/* program sample counts */
 		set_countdac(s, db->fragsamples);
 	} else {
-		set_dmadac(s, db->rawphys, db->dmasize >> sample_shift[fmt]);
+		set_dmadac(s, db->dmaaddr, db->dmasize >> sample_shift[fmt]);
 		/* program sample counts */
 		set_countdac(s, db->fragsamples);
 	}
 	spin_unlock_irqrestore(&s->lock, flags);
+	db->enabled = 1;
 	db->ready = 1;
 	return 0;
 }
@@ -1066,33 +1473,14 @@ static void cm_update_ptr(struct cm_state *s)
 	/* update ADC pointer */
 	if (s->dma_adc.ready) {
 	    if (s->status & DO_DUAL_DAC) {
-		hwptr = get_dmaadc(s) % s->dma_adc.dmasize;
-		diff = (s->dma_adc.dmasize + hwptr - s->dma_adc.hwptr) % s->dma_adc.dmasize;
-		s->dma_adc.hwptr = hwptr;
-		s->dma_adc.total_bytes += diff;
-		if (s->dma_adc.mapped) {
-			s->dma_adc.count += diff;
-			if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
-				wake_up(&s->dma_adc.wait);
-		} else {
-			s->dma_adc.count -= diff;
-			if (s->dma_adc.count <= 0) {
-				pause_adc(s);
-				s->dma_adc.error++;
-			} else if (s->dma_adc.count <= (signed)s->dma_adc.fragsize && !s->dma_adc.endcleared) {
-				clear_advance(s);
-				s->dma_adc.endcleared = 1;
-			}
-			if (s->dma_dac.count + (signed)s->dma_dac.fragsize <= (signed)s->dma_dac.dmasize)
-				wake_up(&s->dma_adc.wait);
-		}
+		    /* the dac part will finish for this */
 	    } else {
 		hwptr = get_dmaadc(s) % s->dma_adc.dmasize;
 		diff = (s->dma_adc.dmasize + hwptr - s->dma_adc.hwptr) % s->dma_adc.dmasize;
 		s->dma_adc.hwptr = hwptr;
 		s->dma_adc.total_bytes += diff;
 		s->dma_adc.count += diff;
-		if (s->dma_adc.count >= (signed)s->dma_adc.fragsize) 
+		if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
 			wake_up(&s->dma_adc.wait);
 		if (!s->dma_adc.mapped) {
 			if (s->dma_adc.count > (signed)(s->dma_adc.dmasize - ((3 * s->dma_adc.fragsize) >> 1))) {
@@ -1108,18 +1496,28 @@ static void cm_update_ptr(struct cm_state *s)
 		diff = (s->dma_dac.dmasize + hwptr - s->dma_dac.hwptr) % s->dma_dac.dmasize;
 		s->dma_dac.hwptr = hwptr;
 		s->dma_dac.total_bytes += diff;
+		if (s->status & DO_DUAL_DAC) {
+			s->dma_adc.hwptr = hwptr;
+			s->dma_adc.total_bytes += diff;
+		}
 		if (s->dma_dac.mapped) {
 			s->dma_dac.count += diff;
+			if (s->status & DO_DUAL_DAC)
+				s->dma_adc.count += diff;
 			if (s->dma_dac.count >= (signed)s->dma_dac.fragsize)
 				wake_up(&s->dma_dac.wait);
 		} else {
 			s->dma_dac.count -= diff;
+			if (s->status & DO_DUAL_DAC)
+				s->dma_adc.count -= diff;
 			if (s->dma_dac.count <= 0) {
 				pause_dac(s);
 				s->dma_dac.error++;
 			} else if (s->dma_dac.count <= (signed)s->dma_dac.fragsize && !s->dma_dac.endcleared) {
 				clear_advance(s);
 				s->dma_dac.endcleared = 1;
+				if (s->status & DO_DUAL_DAC)
+					s->dma_adc.endcleared = 1;
 			}
 			if (s->dma_dac.count + (signed)s->dma_dac.fragsize <= (signed)s->dma_dac.dmasize)
 				wake_up(&s->dma_dac.wait);
@@ -1127,44 +1525,12 @@ static void cm_update_ptr(struct cm_state *s)
 	}
 }
 
-#ifdef CONFIG_SOUND_CMPCI_MIDI
-/* hold spinlock for the following! */
-static void cm_handle_midi(struct cm_state *s)
-{
-	unsigned char ch;
-	int wake;
-
-	wake = 0;
-	while (!(inb(s->iomidi+1) & 0x80)) {
-		ch = inb(s->iomidi);
-		if (s->midi.icnt < MIDIINBUF) {
-			s->midi.ibuf[s->midi.iwr] = ch;
-			s->midi.iwr = (s->midi.iwr + 1) % MIDIINBUF;
-			s->midi.icnt++;
-		}
-		wake = 1;
-	}
-	if (wake)
-		wake_up(&s->midi.iwait);
-	wake = 0;
-	while (!(inb(s->iomidi+1) & 0x40) && s->midi.ocnt > 0) {
-		outb(s->midi.obuf[s->midi.ord], s->iomidi);
-		s->midi.ord = (s->midi.ord + 1) % MIDIOUTBUF;
-		s->midi.ocnt--;
-		if (s->midi.ocnt < MIDIOUTBUF-16)
-			wake = 1;
-	}
-	if (wake)
-		wake_up(&s->midi.owait);
-}
-#endif
-
 static irqreturn_t cm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
         struct cm_state *s = (struct cm_state *)dev_id;
 	unsigned int intsrc, intstat;
 	unsigned char mask = 0;
-	
+
 	/* fastpath out, to ease interrupt sharing */
 	intsrc = inl(s->iobase + CODEC_CMI_INT_STATUS);
 	if (!(intsrc & 0x80000000))
@@ -1172,41 +1538,29 @@ static irqreturn_t cm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	spin_lock(&s->lock);
 	intstat = inb(s->iobase + CODEC_CMI_INT_HLDCLR + 2);
 	/* acknowledge interrupt */
-	if (intsrc & CM_INT_CH0)
-		mask |= 1;
-	if (intsrc & CM_INT_CH1)
-		mask |= 2;
+	if (intsrc & ADCINT)
+		mask |= ENADCINT;
+	if (intsrc & DACINT)
+		mask |= ENDACINT;
 	outb(intstat & ~mask, s->iobase + CODEC_CMI_INT_HLDCLR + 2);
 	outb(intstat | mask, s->iobase + CODEC_CMI_INT_HLDCLR + 2);
 	cm_update_ptr(s);
+	spin_unlock(&s->lock);
 #ifdef CONFIG_SOUND_CMPCI_MIDI
-	cm_handle_midi(s);
+	if (intsrc & 0x00010000) {	// UART interrupt
+		if (s->midi_devc && intchk_mpu401((void *)s->midi_devc))
+			mpuintr(irq, (void *)s->midi_devc, regs);
+		else
+			inb(s->iomidi);// dummy read
+	}
 #endif
-	spin_unlock(&s->lock);
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_SOUND_CMPCI_MIDI
-static void cm_midi_timer(unsigned long data)
-{
-	struct cm_state *s = (struct cm_state *)data;
-	unsigned long flags;
-	
-	spin_lock_irqsave(&s->lock, flags);
-	cm_handle_midi(s);
-	spin_unlock_irqrestore(&s->lock, flags);
-	s->midi.timer.expires = jiffies+1;
-	add_timer(&s->midi.timer);
-}
-#endif
-
 /* --------------------------------------------------------------------- */
 
 static const char invalid_magic[] = KERN_CRIT "cmpci: invalid magic value\n";
 
-#ifdef CONFIG_SOUND_CMPCI	/* support multiple chips */
-#define VALIDATE_STATE(s)
-#else
 #define VALIDATE_STATE(s)                         \
 ({                                                \
 	if (!(s) || (s)->magic != CM_MAGIC) { \
@@ -1214,7 +1568,6 @@ static const char invalid_magic[] = KERN_CRIT "cmpci: invalid magic value\n";
 		return -ENXIO;                    \
 	}                                         \
 })
-#endif
 
 /* --------------------------------------------------------------------- */
 
@@ -1231,16 +1584,17 @@ static const struct {
 	unsigned rec;
 	unsigned play;
 } mixtable[SOUND_MIXER_NRDEVICES] = {
-	[SOUND_MIXER_CD]     = { DSP_MIX_CDVOLIDX_L,     DSP_MIX_CDVOLIDX_R,     MT_5MUTE,     0x04, 0x02 },
-	[SOUND_MIXER_LINE]   = { DSP_MIX_LINEVOLIDX_L,   DSP_MIX_LINEVOLIDX_R,   MT_5MUTE,     0x10, 0x08 },
+	[SOUND_MIXER_CD]     = { DSP_MIX_CDVOLIDX_L,     DSP_MIX_CDVOLIDX_R,     MT_5MUTE,     0x04, 0x06 },
+	[SOUND_MIXER_LINE]   = { DSP_MIX_LINEVOLIDX_L,   DSP_MIX_LINEVOLIDX_R,   MT_5MUTE,     0x10, 0x18 },
 	[SOUND_MIXER_MIC]    = { DSP_MIX_MICVOLIDX,      DSP_MIX_MICVOLIDX,      MT_5MUTEMONO, 0x01, 0x01 },
 	[SOUND_MIXER_SYNTH]  = { DSP_MIX_FMVOLIDX_L,  	 DSP_MIX_FMVOLIDX_R,     MT_5MUTE,     0x40, 0x00 },
 	[SOUND_MIXER_VOLUME] = { DSP_MIX_MASTERVOLIDX_L, DSP_MIX_MASTERVOLIDX_R, MT_5MUTE,     0x00, 0x00 },
 	[SOUND_MIXER_PCM]    = { DSP_MIX_VOICEVOLIDX_L,  DSP_MIX_VOICEVOLIDX_R,  MT_5MUTE,     0x00, 0x00 },
-	[SOUND_MIXER_SPEAKER]= { DSP_MIX_SPKRVOLIDX,	 DSP_MIX_SPKRVOLIDX,	 MT_5MUTEMONO, 0x01, 0x01 }
+	[SOUND_MIXER_LINE1]  = { DSP_MIX_AUXVOL_L,       DSP_MIX_AUXVOL_R,       MT_5MUTE,     0x80, 0x60 },
+	[SOUND_MIXER_SPEAKER]= { DSP_MIX_SPKRVOLIDX,	 DSP_MIX_SPKRVOLIDX,	 MT_5MUTEMONO, 0x00, 0x01 }
 };
 
-static const unsigned char volidx[SOUND_MIXER_NRDEVICES] = 
+static const unsigned char volidx[SOUND_MIXER_NRDEVICES] =
 {
 	[SOUND_MIXER_CD]     = 1,
 	[SOUND_MIXER_LINE]   = 2,
@@ -1248,15 +1602,32 @@ static const unsigned char volidx[SOUND_MIXER_NRDEVICES] =
 	[SOUND_MIXER_SYNTH]  = 4,
 	[SOUND_MIXER_VOLUME] = 5,
 	[SOUND_MIXER_PCM]    = 6,
-	[SOUND_MIXER_SPEAKER]= 7
+	[SOUND_MIXER_LINE1]  = 7,
+	[SOUND_MIXER_SPEAKER]= 8
 };
 
+static unsigned mixer_outmask(struct cm_state *s)
+{
+	unsigned long flags;
+	int i, j, k;
+
+	spin_lock_irqsave(&s->lock, flags);
+	j = rdmixer(s, DSP_MIX_OUTMIXIDX);
+	spin_unlock_irqrestore(&s->lock, flags);
+	for (k = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
+		if (j & mixtable[i].play)
+			k |= 1 << i;
+	return k;
+}
+
 static unsigned mixer_recmask(struct cm_state *s)
 {
+	unsigned long flags;
 	int i, j, k;
 
+	spin_lock_irqsave(&s->lock, flags);
 	j = rdmixer(s, DSP_MIX_ADCMIXIDX_L);
-	j &= 0x7f;
+	spin_unlock_irqrestore(&s->lock, flags);
 	for (k = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 		if (j & mixtable[i].rec)
 			k |= 1 << i;
@@ -1268,6 +1639,8 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 	unsigned long flags;
 	int i, val, j;
 	unsigned char l, r, rl, rr;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
         if (cmd == SOUND_MIXER_INFO) {
@@ -1276,7 +1649,7 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 		strlcpy(info.id, "cmpci", sizeof(info.id));
 		strlcpy(info.name, "C-Media PCI", sizeof(info.name));
 		info.modify_counter = s->mix.modcnt;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -1285,48 +1658,50 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 		memset(&info, 0, sizeof(info));
 		strlcpy(info.id, "cmpci", sizeof(info.id));
 		strlcpy(info.name, "C-Media cmpci", sizeof(info.name));
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
-	if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
+		return put_user(SOUND_VERSION, p);
+	if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
-        if (_IOC_DIR(cmd) == _IOC_READ) {
+        if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-			return put_user(mixer_recmask(s), (int *)arg);
-			
+			val = mixer_recmask(s);
+			return put_user(val, p);
+
                 case SOUND_MIXER_OUTSRC: /* Arg contains a bit for each recording source */
-			return put_user(mixer_recmask(s), (int *)arg);//need fix
-			
+			val = mixer_outmask(s);
+			return put_user(val, p);
+
                 case SOUND_MIXER_DEVMASK: /* Arg contains a bit for each supported device */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].type)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 
                 case SOUND_MIXER_RECMASK: /* Arg contains a bit for each supported recording source */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].rec)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
-			
+			return put_user(val, p);
+
                 case SOUND_MIXER_OUTMASK: /* Arg contains a bit for each supported recording source */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].play)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
-			
+			return put_user(val, p);
+
                  case SOUND_MIXER_STEREODEVS: /* Mixer channels supporting stereo */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].type && mixtable[i].type != MT_4MUTEMONO)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
-			
+			return put_user(val, p);
+
                 case SOUND_MIXER_CAPS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 
 		default:
 			i = _IOC_NR(cmd);
@@ -1334,15 +1709,15 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
                                 return -EINVAL;
 			if (!volidx[i])
 				return -EINVAL;
-			return put_user(s->mix.vol[volidx[i]-1], (int *)arg);
+			return put_user(s->mix.vol[volidx[i]-1], p);
 		}
 	}
-        if (_IOC_DIR(cmd) != (_IOC_READ|_IOC_WRITE)) 
+        if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE))
 		return -EINVAL;
 	s->mix.modcnt++;
 	switch (_IOC_NR(cmd)) {
 	case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		i = generic_hweight32(val);
 		for (j = i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
@@ -1356,12 +1731,12 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 		}
 		spin_lock_irqsave(&s->lock, flags);
 		wrmixer(s, DSP_MIX_ADCMIXIDX_L, j);
-		wrmixer(s, DSP_MIX_ADCMIXIDX_R, (j & 1) | (j>>1));
+		wrmixer(s, DSP_MIX_ADCMIXIDX_R, (j & 1) | (j>>1) | (j & 0x80));
 		spin_unlock_irqrestore(&s->lock, flags);
 		return 0;
 
 	case SOUND_MIXER_OUTSRC: /* Arg contains a bit for each recording source */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		for (j = i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
 			if (!(val & (1 << i)))
@@ -1373,15 +1748,15 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 			j |= mixtable[i].play;
 		}
 		spin_lock_irqsave(&s->lock, flags);
-		frobindir(s, DSP_MIX_OUTMIXIDX, 0x1f, j);
+		wrmixer(s, DSP_MIX_OUTMIXIDX, j);
 		spin_unlock_irqrestore(&s->lock, flags);
 		return 0;
 
-		default:
+	default:
 		i = _IOC_NR(cmd);
 		if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].type)
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = val & 0xff;
 		r = (val >> 8) & 0xff;
@@ -1404,22 +1779,38 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 			rl = (l < 4 ? 0 : (l - 5) / 3) & 31;
 			rr = (rl >> 2) & 7;
 			wrmixer(s, mixtable[i].left, rl<<3);
-			maskb(s->iobase + CODEC_CMI_MIXER2, ~0x0e, rr<<1);
+			if (i == SOUND_MIXER_MIC)
+				maskb(s->iobase + CODEC_CMI_MIXER2, ~0x0e, rr<<1);
 			break;
-			
+
 		case MT_5MUTEMONO:
-			r = l;
 			rl = l < 4 ? 0 : (l - 5) / 3;
-			rr = rl >> 2;
  			wrmixer(s, mixtable[i].left, rl<<3);
-			maskb(s->iobase + CODEC_CMI_MIXER2, ~0x0e, rr<<1);
+			l = rdmixer(s, DSP_MIX_OUTMIXIDX) & ~mixtable[i].play;
+			r = rl ? mixtable[i].play : 0;
+			wrmixer(s, DSP_MIX_OUTMIXIDX, l | r);
+			/* for recording */
+			if (i == SOUND_MIXER_MIC) {
+				if (s->chip_version >= 37) {
+					rr = rl >> 1;
+					maskb(s->iobase + CODEC_CMI_MIXER2, ~0x0e, (rr&0x07)<<1);
+					frobindir(s, DSP_MIX_EXTENSION, ~0x01, rr>>3);
+				} else {
+					rr = rl >> 2;
+					maskb(s->iobase + CODEC_CMI_MIXER2, ~0x0e, rr<<1);
+				}
+			}
 			break;
-				
+
 		case MT_5MUTE:
 			rl = l < 4 ? 0 : (l - 5) / 3;
 			rr = r < 4 ? 0 : (r - 5) / 3;
  			wrmixer(s, mixtable[i].left, rl<<3);
 			wrmixer(s, mixtable[i].right, rr<<3);
+			l = rdmixer(s, DSP_MIX_OUTMIXIDX);
+			l &= ~mixtable[i].play;
+			r = (rl|rr) ? mixtable[i].play : 0;
+			wrmixer(s, DSP_MIX_OUTMIXIDX, l | r);
 			break;
 
 		case MT_6MUTE:
@@ -1440,7 +1831,7 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 		if (!volidx[i])
 			return -EINVAL;
 		s->mix.vol[volidx[i]-1] = val;
-		return put_user(s->mix.vol[volidx[i]-1], (int *)arg);
+		return put_user(s->mix.vol[volidx[i]-1], p);
 	}
 }
 
@@ -1449,12 +1840,16 @@ static int mixer_ioctl(struct cm_state *s, unsigned int cmd, unsigned long arg)
 static int cm_open_mixdev(struct inode *inode, struct file *file)
 {
 	int minor = iminor(inode);
-	struct cm_state *s = devs;
+	struct list_head *list;
+	struct cm_state *s;
 
-	while (s && s->dev_mixer != minor)
-		s = s->next;
-	if (!s)
-		return -ENODEV;
+	for (list = devs.next; ; list = list->next) {
+		if (list == &devs)
+			return -ENODEV;
+		s = list_entry(list, struct cm_state, devs);
+		if (s->dev_mixer == minor)
+			break;
+	}
        	VALIDATE_STATE(s);
 	file->private_data = s;
 	return 0;
@@ -1462,10 +1857,8 @@ static int cm_open_mixdev(struct inode *inode, struct file *file)
 
 static int cm_release_mixdev(struct inode *inode, struct file *file)
 {
-	struct cm_state *s;
+	struct cm_state *s = (struct cm_state *)file->private_data;
 
-	s = file->private_data;
-	
 	VALIDATE_STATE(s);
 	return 0;
 }
@@ -1494,9 +1887,9 @@ static int drain_dac(struct cm_state *s, int nonblock)
 
 	if (s->dma_dac.mapped || !s->dma_dac.ready)
 		return 0;
-        set_current_state(TASK_INTERRUPTIBLE);
         add_wait_queue(&s->dma_dac.wait, &wait);
         for (;;) {
+        	__set_current_state(TASK_INTERRUPTIBLE);
                 spin_lock_irqsave(&s->lock, flags);
 		count = s->dma_dac.count;
                 spin_unlock_irqrestore(&s->lock, flags);
@@ -1512,7 +1905,7 @@ static int drain_dac(struct cm_state *s, int nonblock)
 		tmo = 3 * HZ * (count + s->dma_dac.fragsize) / 2 / s->ratedac;
 		tmo >>= sample_shift[(s->fmt >> CM_CFMT_DACSHIFT) & CM_CFMT_MASK];
 		if (!schedule_timeout(tmo + 1))
-			printk(KERN_DEBUG "cmpci: dma timed out??\n");
+			DBG(printk(KERN_DEBUG "cmpci: dma timed out??\n");)
         }
         remove_wait_queue(&s->dma_dac.wait, &wait);
         set_current_state(TASK_RUNNING);
@@ -1523,9 +1916,10 @@ static int drain_dac(struct cm_state *s, int nonblock)
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t cm_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t cm_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct cm_state *s = (struct cm_state *)file->private_data;
+	DECLARE_WAITQUEUE(wait, current);
 	ssize_t ret;
 	unsigned long flags;
 	unsigned swptr;
@@ -1542,37 +1936,71 @@ static ssize_t cm_read(struct file *file, char *buffer, size_t count, loff_t *pp
 		return -EFAULT;
 	ret = 0;
 
+        add_wait_queue(&s->dma_adc.wait, &wait);
 	while (count > 0) {
 		spin_lock_irqsave(&s->lock, flags);
 		swptr = s->dma_adc.swptr;
 		cnt = s->dma_adc.dmasize-swptr;
 		if (s->dma_adc.count < cnt)
 			cnt = s->dma_adc.count;
+		if (cnt <= 0)
+			__set_current_state(TASK_INTERRUPTIBLE);
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (cnt > count)
 			cnt = count;
 		if (cnt <= 0) {
-			start_adc(s);
-			if (file->f_flags & O_NONBLOCK)
-				return ret ? ret : -EAGAIN;
-			if (!interruptible_sleep_on_timeout(&s->dma_adc.wait, HZ)) {
+			if (s->dma_adc.enabled)
+				start_adc(s);
+			if (file->f_flags & O_NONBLOCK) {
+				if (!ret)
+					ret = -EAGAIN;
+				goto out;
+			}
+			if (!schedule_timeout(HZ)) {
 				printk(KERN_DEBUG "cmpci: read: chip lockup? dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
 				       s->dma_adc.dmasize, s->dma_adc.fragsize, s->dma_adc.count,
 				       s->dma_adc.hwptr, s->dma_adc.swptr);
 				spin_lock_irqsave(&s->lock, flags);
 				stop_adc_unlocked(s);
-				set_dmaadc(s, s->dma_adc.rawphys, s->dma_adc.dmasamples);
+				set_dmaadc(s, s->dma_adc.dmaaddr, s->dma_adc.dmasamples);
 				/* program sample counts */
 				set_countadc(s, s->dma_adc.fragsamples);
 				s->dma_adc.count = s->dma_adc.hwptr = s->dma_adc.swptr = 0;
 				spin_unlock_irqrestore(&s->lock, flags);
 			}
-			if (signal_pending(current))
-				return ret ? ret : -ERESTARTSYS;
+			if (signal_pending(current)) {
+				if (!ret)
+					ret = -ERESTARTSYS;
+				goto out;
+			}
 			continue;
 		}
-		if (copy_to_user(buffer, s->dma_adc.rawbuf + swptr, cnt))
-			return ret ? ret : -EFAULT;
+		if (s->status & DO_BIGENDIAN_R) {
+			int	i, err;
+			unsigned char *src;
+			char __user *dst = buffer;
+			unsigned char data[2];
+
+			src = (unsigned char *) (s->dma_adc.rawbuf + swptr);
+			// copy left/right sample at one time
+			for (i = 0; i < cnt / 2; i++) {
+				data[0] = src[1];
+				data[1] = src[0];
+				if ((err = __put_user(data[0], dst++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __put_user(data[1], dst++))) {
+					ret = err;
+					goto out;
+				}
+				src += 2;
+			}
+		} else if (copy_to_user(buffer, s->dma_adc.rawbuf + swptr, cnt)) {
+			if (!ret)
+				ret = -EFAULT;
+			goto out;
+		}
 		swptr = (swptr + cnt) % s->dma_adc.dmasize;
 		spin_lock_irqsave(&s->lock, flags);
 		s->dma_adc.swptr = swptr;
@@ -1580,15 +2008,20 @@ static ssize_t cm_read(struct file *file, char *buffer, size_t count, loff_t *pp
 		count -= cnt;
 		buffer += cnt;
 		ret += cnt;
-		start_adc_unlocked(s);
+		if (s->dma_adc.enabled)
+			start_adc_unlocked(s);
 		spin_unlock_irqrestore(&s->lock, flags);
 	}
+out:
+        remove_wait_queue(&s->dma_adc.wait, &wait);
+	set_current_state(TASK_RUNNING);
 	return ret;
 }
 
-static ssize_t cm_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t cm_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct cm_state *s = (struct cm_state *)file->private_data;
+	DECLARE_WAITQUEUE(wait, current);
 	ssize_t ret;
 	unsigned long flags;
 	unsigned swptr;
@@ -1608,11 +2041,12 @@ static ssize_t cm_write(struct file *file, const char *buffer, size_t count, lof
 			return -ENXIO;
 		if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
 			return ret;
-		if (!access_ok(VERIFY_READ, buffer, count))
-			return -EFAULT;
 	}
+	if (!access_ok(VERIFY_READ, buffer, count))
+		return -EFAULT;
 	ret = 0;
 
+        add_wait_queue(&s->dma_dac.wait, &wait);
 	while (count > 0) {
 		spin_lock_irqsave(&s->lock, flags);
 		if (s->dma_dac.count < 0) {
@@ -1633,33 +2067,42 @@ static ssize_t cm_write(struct file *file, const char *buffer, size_t count, lof
 			if (s->dma_dac.count + cnt > s->dma_dac.dmasize)
 				cnt = s->dma_dac.dmasize - s->dma_dac.count;
 		}
-		spin_unlock_irqrestore(&s->lock, flags);
+		if (cnt <= 0)
+			__set_current_state(TASK_INTERRUPTIBLE);
+		spin_unlock_irqrestore(&s->lock, flags);
 		if (cnt > count)
 			cnt = count;
 		if ((s->status & DO_DUAL_DAC) && (cnt > count / 2))
 		    cnt = count / 2;
 		if (cnt <= 0) {
-			start_dac(s);
-			if (file->f_flags & O_NONBLOCK)
-				return ret ? ret : -EAGAIN;
-			if (!interruptible_sleep_on_timeout(&s->dma_dac.wait, HZ)) {
+			if (s->dma_dac.enabled)
+				start_dac(s);
+			if (file->f_flags & O_NONBLOCK) {
+				if (!ret)
+					ret = -EAGAIN;
+				goto out;
+			}
+			if (!schedule_timeout(HZ)) {
 				printk(KERN_DEBUG "cmpci: write: chip lockup? dmasz %u fragsz %u count %i hwptr %u swptr %u\n",
 				       s->dma_dac.dmasize, s->dma_dac.fragsize, s->dma_dac.count,
 				       s->dma_dac.hwptr, s->dma_dac.swptr);
 				spin_lock_irqsave(&s->lock, flags);
 				stop_dac_unlocked(s);
-				set_dmadac(s, s->dma_dac.rawphys, s->dma_dac.dmasamples);
+				set_dmadac(s, s->dma_dac.dmaaddr, s->dma_dac.dmasamples);
 				/* program sample counts */
 				set_countdac(s, s->dma_dac.fragsamples);
 				s->dma_dac.count = s->dma_dac.hwptr = s->dma_dac.swptr = 0;
 				if (s->status & DO_DUAL_DAC)  {
-					set_dmadac1(s, s->dma_adc.rawphys, s->dma_adc.dmasamples);
+					set_dmadac1(s, s->dma_adc.dmaaddr, s->dma_adc.dmasamples);
 					s->dma_adc.count = s->dma_adc.hwptr = s->dma_adc.swptr = 0;
 				}
 				spin_unlock_irqrestore(&s->lock, flags);
 			}
-			if (signal_pending(current))
-				return ret ? ret : -ERESTARTSYS;
+			if (signal_pending(current)) {
+				if (!ret)
+					ret = -ERESTARTSYS;
+				goto out;
+			}
 			continue;
 		}
 		if (s->status & DO_AC3_SW) {
@@ -1668,27 +2111,112 @@ static ssize_t cm_write(struct file *file, const char *buffer, size_t count, lof
 			// clip exceeded data, caught by 033 and 037
 			if (swptr + 2 * cnt > s->dma_dac.dmasize)
 				cnt = (s->dma_dac.dmasize - swptr) / 2;
-			if ((err = trans_ac3(s, s->dma_dac.rawbuf + swptr, buffer, cnt)))
-				return err;
+			if ((err = trans_ac3(s, s->dma_dac.rawbuf + swptr, buffer, cnt))) {
+				ret = err;
+				goto out;
+			}
 			swptr = (swptr + 2 * cnt) % s->dma_dac.dmasize;
+		} else if ((s->status & DO_DUAL_DAC) && (s->status & DO_BIGENDIAN_W)) {
+			int	i, err;
+			const char __user *src = buffer;
+			unsigned char *dst0, *dst1;
+			unsigned char data[8];
+
+			dst0 = (unsigned char *) (s->dma_dac.rawbuf + swptr);
+			dst1 = (unsigned char *) (s->dma_adc.rawbuf + swptr);
+			// copy left/right sample at one time
+			for (i = 0; i < cnt / 4; i++) {
+				if ((err = __get_user(data[0], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[1], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[2], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[3], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[4], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[5], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[6], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[7], src++))) {
+					ret = err;
+					goto out;
+				}
+				dst0[0] = data[1];
+				dst0[1] = data[0];
+				dst0[2] = data[3];
+				dst0[3] = data[2];
+				dst1[0] = data[5];
+				dst1[1] = data[4];
+				dst1[2] = data[7];
+				dst1[3] = data[6];
+				dst0 += 4;
+				dst1 += 4;
+			}
+			swptr = (swptr + cnt) % s->dma_dac.dmasize;
 		} else if (s->status & DO_DUAL_DAC) {
 			int	i, err;
-			unsigned long *src, *dst0, *dst1;
+			unsigned long __user *src = (unsigned long __user *) buffer;
+			unsigned long *dst0, *dst1;
 
-			src = (unsigned long *) buffer;
 			dst0 = (unsigned long *) (s->dma_dac.rawbuf + swptr);
 			dst1 = (unsigned long *) (s->dma_adc.rawbuf + swptr);
 			// copy left/right sample at one time
-			for (i = 0; i <= cnt / 4; i++) {
-				if ((err = __get_user(*dst0++, src++)))
-					return err;
-				if ((err = __get_user(*dst1++, src++)))
-					return err;
+			for (i = 0; i < cnt / 4; i++) {
+				if ((err = __get_user(*dst0++, src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(*dst1++, src++))) {
+					ret = err;
+					goto out;
+				}
+			}
+			swptr = (swptr + cnt) % s->dma_dac.dmasize;
+		} else if (s->status & DO_BIGENDIAN_W) {
+			int	i, err;
+			const char __user *src = buffer;
+			unsigned char *dst;
+			unsigned char data[2];
+
+			dst = (unsigned char *) (s->dma_dac.rawbuf + swptr);
+			// swap hi/lo bytes for each sample
+			for (i = 0; i < cnt / 2; i++) {
+				if ((err = __get_user(data[0], src++))) {
+					ret = err;
+					goto out;
+				}
+				if ((err = __get_user(data[1], src++))) {
+					ret = err;
+					goto out;
+				}
+				dst[0] = data[1];
+				dst[1] = data[0];
+				dst += 2;
 			}
 			swptr = (swptr + cnt) % s->dma_dac.dmasize;
 		} else {
-			if (copy_from_user(s->dma_dac.rawbuf + swptr, buffer, cnt))
-				return ret ? ret : -EFAULT;
+			if (copy_from_user(s->dma_dac.rawbuf + swptr, buffer, cnt)) {
+				if (!ret)
+					ret = -EFAULT;
+				goto out;
+			}
 			swptr = (swptr + cnt) % s->dma_dac.dmasize;
 		}
 		spin_lock_irqsave(&s->lock, flags);
@@ -1706,8 +2234,12 @@ static ssize_t cm_write(struct file *file, const char *buffer, size_t count, lof
 			buffer += cnt;
 			ret += cnt;
 		}
-		start_dac(s);
+		if (s->dma_dac.enabled)
+			start_dac(s);
 	}
+out:
+        remove_wait_queue(&s->dma_dac.wait, &wait);
+	set_current_state(TASK_RUNNING);
 	return ret;
 }
 
@@ -1718,10 +2250,16 @@ static unsigned int cm_poll(struct file *file, struct poll_table_struct *wait)
 	unsigned int mask = 0;
 
 	VALIDATE_STATE(s);
-	if (file->f_mode & FMODE_WRITE)
+	if (file->f_mode & FMODE_WRITE) {
+		if (!s->dma_dac.ready && prog_dmabuf(s, 0))
+			return 0;
 		poll_wait(file, &s->dma_dac.wait, wait);
-	if (file->f_mode & FMODE_READ)
+	}
+	if (file->f_mode & FMODE_READ) {
+		if (!s->dma_adc.ready && prog_dmabuf(s, 1))
+			return 0;
 		poll_wait(file, &s->dma_adc.wait, wait);
+	}
 	spin_lock_irqsave(&s->lock, flags);
 	cm_update_ptr(s);
 	if (file->f_mode & FMODE_READ) {
@@ -1730,7 +2268,7 @@ static unsigned int cm_poll(struct file *file, struct poll_table_struct *wait)
 	}
 	if (file->f_mode & FMODE_WRITE) {
 		if (s->dma_dac.mapped) {
-			if (s->dma_dac.count >= (signed)s->dma_dac.fragsize) 
+			if (s->dma_dac.count >= (signed)s->dma_dac.fragsize)
 				mask |= POLLOUT | POLLWRNORM;
 		} else {
 			if ((signed)s->dma_dac.dmasize >= s->dma_dac.count + (signed)s->dma_dac.fragsize)
@@ -1776,6 +2314,16 @@ out:
 	return ret;
 }
 
+#define SNDCTL_SPDIF_COPYRIGHT	_SIOW('S',  0, int)       // set/reset S/PDIF copy protection
+#define SNDCTL_SPDIF_LOOP	_SIOW('S',  1, int)       // set/reset S/PDIF loop
+#define SNDCTL_SPDIF_MONITOR	_SIOW('S',  2, int)       // set S/PDIF monitor
+#define SNDCTL_SPDIF_LEVEL	_SIOW('S',  3, int)       // set/reset S/PDIF out level
+#define SNDCTL_SPDIF_INV	_SIOW('S',  4, int)       // set/reset S/PDIF in inverse
+#define SNDCTL_SPDIF_SEL2	_SIOW('S',  5, int)       // set S/PDIF in #2
+#define SNDCTL_SPDIF_VALID	_SIOW('S',  6, int)       // set S/PDIF valid
+#define SNDCTL_SPDIFOUT		_SIOW('S',  7, int)       // set S/PDIF out
+#define SNDCTL_SPDIFIN		_SIOW('S',  8, int)       // set S/PDIF out
+
 static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct cm_state *s = (struct cm_state *)file->private_data;
@@ -1784,25 +2332,27 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         count_info cinfo;
 	int val, mapped, ret;
 	unsigned char fmtm, fmtd;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
         mapped = ((file->f_mode & FMODE_WRITE) && s->dma_dac.mapped) ||
 		((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
 			return drain_dac(s, 0/*file->f_flags & O_NONBLOCK*/);
 		return 0;
-		
+
 	case SNDCTL_DSP_SETDUPLEX:
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP | DSP_CAP_BIND, (int *)arg);
-		
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP | DSP_CAP_BIND, p);
+
         case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
 			stop_dac(s);
@@ -1819,7 +2369,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -1837,10 +2387,10 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				set_dac_rate(s, val);
 			}
 		}
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 
         case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		fmtd = 0;
 		fmtm = ~0;
@@ -1871,7 +2421,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			fmtd = 0;
@@ -1903,17 +2453,18 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			if ((s->capability & CAN_MULTI_CH)
 			     && (file->f_mode & FMODE_WRITE)) {
 				val = set_dac_channels(s, val);
-				return put_user(val, (int *)arg);
+				return put_user(val, p);
 			}
-		}            
-		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_STEREO << CM_CFMT_ADCSHIFT) 
-					   : (CM_CFMT_STEREO << CM_CFMT_DACSHIFT))) ? 2 : 1, (int *)arg);
-		
+		}
+		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_STEREO << CM_CFMT_ADCSHIFT)
+					   : (CM_CFMT_STEREO << CM_CFMT_DACSHIFT))) ? 2 : 1, p);
+
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8|AFMT_AC3, (int *)arg);
-		
+                return put_user(AFMT_S16_BE|AFMT_S16_LE|AFMT_U8|
+			((s->capability & CAN_AC3) ? AFMT_AC3 : 0), p);
+
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			fmtd = 0;
@@ -1921,36 +2472,44 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			if (file->f_mode & FMODE_READ) {
 				stop_adc(s);
 				s->dma_adc.ready = 0;
-				if (val == AFMT_S16_LE)
+				if (val == AFMT_S16_BE || val == AFMT_S16_LE)
 					fmtd |= CM_CFMT_16BIT << CM_CFMT_ADCSHIFT;
 				else
 					fmtm &= ~(CM_CFMT_16BIT << CM_CFMT_ADCSHIFT);
+				if (val == AFMT_S16_BE)
+					s->status |= DO_BIGENDIAN_R;
+				else
+					s->status &= ~DO_BIGENDIAN_R;
 			}
 			if (file->f_mode & FMODE_WRITE) {
 				stop_dac(s);
 				s->dma_dac.ready = 0;
-				if (val == AFMT_S16_LE || val == AFMT_AC3)
+				if (val == AFMT_S16_BE || val == AFMT_S16_LE || val == AFMT_AC3)
 					fmtd |= CM_CFMT_16BIT << CM_CFMT_DACSHIFT;
 				else
 					fmtm &= ~(CM_CFMT_16BIT << CM_CFMT_DACSHIFT);
 				if (val == AFMT_AC3) {
 					fmtd |= CM_CFMT_STEREO << CM_CFMT_DACSHIFT;
-					set_ac3(s, s->ratedac);
+					set_ac3(s, 48000);
 				} else
 					set_ac3(s, 0);
 				if (s->status & DO_DUAL_DAC) {
 					s->dma_adc.ready = 0;
-					if (val == AFMT_S16_LE)
+					if (val == AFMT_S16_BE || val == AFMT_S16_LE)
 						fmtd |= CM_CFMT_STEREO << CM_CFMT_ADCSHIFT;
 					else
 						fmtm &= ~(CM_CFMT_STEREO << CM_CFMT_ADCSHIFT);
 				}
+				if (val == AFMT_S16_BE)
+					s->status |= DO_BIGENDIAN_W;
+				else
+					s->status &= ~DO_BIGENDIAN_W;
 			}
 			set_fmt(s, fmtm, fmtd);
 		}
-		if (s->status & DO_AC3) return put_user(AFMT_AC3, (int *)arg);
+		if (s->status & DO_AC3) return put_user(AFMT_AC3, p);
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_16BIT << CM_CFMT_ADCSHIFT)
-					   : (CM_CFMT_16BIT << CM_CFMT_DACSHIFT))) ? AFMT_S16_LE : AFMT_U8, (int *)arg);
+					   : (CM_CFMT_16BIT << CM_CFMT_DACSHIFT))) ? val : AFMT_U8, p);
 
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -1959,27 +2518,30 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		val = 0;
 		if (s->status & DO_DUAL_DAC) {
 			if (file->f_mode & FMODE_WRITE &&
-			 (s->enable & CM_ENABLE_CH1) &&
-			 (s->enable & CM_ENABLE_CH0))
+			 (s->enable & ENDAC) &&
+			 (s->enable & ENADC))
 				val |= PCM_ENABLE_OUTPUT;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 		}
-		if (file->f_mode & FMODE_READ && s->enable & CM_ENABLE_CH0) 
+		if (file->f_mode & FMODE_READ && s->enable & ENADC)
 			val |= PCM_ENABLE_INPUT;
-		if (file->f_mode & FMODE_WRITE && s->enable & CM_ENABLE_CH1) 
+		if (file->f_mode & FMODE_WRITE && s->enable & ENDAC)
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
-				if (!s->dma_adc.ready && (ret =  prog_dmabuf(s, 1)))
+				if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
 					return ret;
+				s->dma_adc.enabled = 1;
 				start_adc(s);
-			} else
+			} else {
+				s->dma_adc.enabled = 0;
 				stop_adc(s);
+			}
 		}
 		if (file->f_mode & FMODE_WRITE) {
 			if (val & PCM_ENABLE_OUTPUT) {
@@ -1989,16 +2551,19 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 					if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
 						return ret;
 				}
+				s->dma_dac.enabled = 1;
 				start_dac(s);
-			} else
+			} else {
+				s->dma_dac.enabled = 0;
 				stop_dac(s);
+			}
 		}
 		return 0;
 
 	case SNDCTL_DSP_GETOSPACE:
 		if (!(file->f_mode & FMODE_WRITE))
 			return -EINVAL;
-		if (!(s->enable & CM_ENABLE_CH1) && (val = prog_dmabuf(s, 0)) != 0)
+		if (!(s->enable & ENDAC) && (val = prog_dmabuf(s, 0)) != 0)
 			return val;
 		spin_lock_irqsave(&s->lock, flags);
 		cm_update_ptr(s);
@@ -2007,22 +2572,22 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                 abinfo.fragstotal = s->dma_dac.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
 			return -EINVAL;
-		if (!(s->enable & CM_ENABLE_CH0) && (val = prog_dmabuf(s, 1)) != 0)
+		if (!(s->enable & ENADC) && (val = prog_dmabuf(s, 1)) != 0)
 			return val;
 		spin_lock_irqsave(&s->lock, flags);
 		cm_update_ptr(s);
 		abinfo.fragsize = s->dma_adc.fragsize;
                 abinfo.bytes = s->dma_adc.count;
                 abinfo.fragstotal = s->dma_adc.numfrag;
-                abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
+                abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
-		
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
                 return 0;
@@ -2034,7 +2599,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		cm_update_ptr(s);
                 val = s->dma_dac.count;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
         case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -2047,9 +2612,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
-			return -EFAULT;
-		return 0;
+                return copy_to_user(argp, &cinfo, sizeof(cinfo))  ? -EFAULT : 0;
 
         case SNDCTL_DSP_GETOPTR:
 		if (!(file->f_mode & FMODE_WRITE))
@@ -2066,9 +2629,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				s->dma_adc.count &= s->dma_adc.fragsize-1;
 		}
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
-			return -EFAULT;
-		return 0;
+                return copy_to_user(argp, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
 
         case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE) {
@@ -2077,16 +2638,16 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			if (s->status & DO_DUAL_DAC) {
 				if ((val = prog_dmabuf(s, 1)))
 					return val;
-				return put_user(2 * s->dma_dac.fragsize, (int *)arg);
+				return put_user(2 * s->dma_dac.fragsize, p);
 			}
-			return put_user(s->dma_dac.fragsize, (int *)arg);
+			return put_user(s->dma_dac.fragsize, p);
 		}
 		if ((val = prog_dmabuf(s, 1)))
 			return val;
-		return put_user(s->dma_adc.fragsize, (int *)arg);
+		return put_user(s->dma_adc.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			s->dma_adc.ossfragshift = val & 0xffff;
@@ -2118,7 +2679,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac.subdivision))
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2132,22 +2693,22 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 
         case SOUND_PCM_READ_CHANNELS:
-		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_STEREO << CM_CFMT_ADCSHIFT) : (CM_CFMT_STEREO << CM_CFMT_DACSHIFT))) ? 2 : 1, (int *)arg);
+		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_STEREO << CM_CFMT_ADCSHIFT) : (CM_CFMT_STEREO << CM_CFMT_DACSHIFT))) ? 2 : 1, p);
 
         case SOUND_PCM_READ_BITS:
-		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_16BIT << CM_CFMT_ADCSHIFT) : (CM_CFMT_16BIT << CM_CFMT_DACSHIFT))) ? 16 : 8, (int *)arg);
+		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (CM_CFMT_16BIT << CM_CFMT_ADCSHIFT) : (CM_CFMT_16BIT << CM_CFMT_DACSHIFT))) ? 16 : 8, p);
 
         case SOUND_PCM_READ_FILTER:
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 
 	case SNDCTL_DSP_GETCHANNELMASK:
-		return put_user(DSP_BIND_FRONT|DSP_BIND_SURR|DSP_BIND_CENTER_LFE|DSP_BIND_SPDIF, (int *)arg);
-		
+		return put_user(DSP_BIND_FRONT|DSP_BIND_SURR|DSP_BIND_CENTER_LFE|DSP_BIND_SPDIF, p);
+
 	case SNDCTL_DSP_BIND_CHANNEL:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val == DSP_BIND_QUERY) {
 			val = DSP_BIND_FRONT;
@@ -2163,6 +2724,11 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			if (file->f_mode & FMODE_READ) {
 				stop_adc(s);
 				s->dma_adc.ready = 0;
+				if (val & DSP_BIND_SPDIF) {
+					set_spdifin(s, s->rateadc);
+					if (!(s->status & DO_SPDIF_OUT))
+						val &= ~DSP_BIND_SPDIF;
+				}
 			}
 			if (file->f_mode & FMODE_WRITE) {
 				stop_dac(s);
@@ -2195,14 +2761,58 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				}
 			}
 		}
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SOUND_PCM_WRITE_FILTER:
 	case SNDCTL_DSP_MAPINBUF:
 	case SNDCTL_DSP_MAPOUTBUF:
         case SNDCTL_DSP_SETSYNCRO:
                 return -EINVAL;
-		
+	case SNDCTL_SPDIF_COPYRIGHT:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdif_copyright(s, val);
+                return 0;
+	case SNDCTL_SPDIF_LOOP:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdif_loop(s, val);
+                return 0;
+	case SNDCTL_SPDIF_MONITOR:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdif_monitor(s, val);
+                return 0;
+	case SNDCTL_SPDIF_LEVEL:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdifout_level(s, val);
+                return 0;
+	case SNDCTL_SPDIF_INV:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdifin_inverse(s, val);
+                return 0;
+	case SNDCTL_SPDIF_SEL2:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdifin_channel2(s, val);
+                return 0;
+	case SNDCTL_SPDIF_VALID:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdifin_valid(s, val);
+                return 0;
+	case SNDCTL_SPDIFOUT:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdifout(s, val ? s->ratedac : 0);
+                return 0;
+	case SNDCTL_SPDIFIN:
+		if (get_user(val, p))
+			return -EFAULT;
+		set_spdifin(s, val ? s->rateadc : 0);
+                return 0;
 	}
 	return mixer_ioctl(s, cmd, arg);
 }
@@ -2210,13 +2820,18 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 static int cm_open(struct inode *inode, struct file *file)
 {
 	int minor = iminor(inode);
-	struct cm_state *s = devs;
+	DECLARE_WAITQUEUE(wait, current);
 	unsigned char fmtm = ~0, fmts = 0;
+	struct list_head *list;
+	struct cm_state *s;
 
-	while (s && ((s->dev_audio ^ minor) & ~0xf))
-		s = s->next;
-	if (!s)
-		return -ENODEV;
+	for (list = devs.next; ; list = list->next) {
+		if (list == &devs)
+			return -ENODEV;
+		s = list_entry(list, struct cm_state, devs);
+		if (!((s->dev_audio ^ minor) & ~0xf))
+			break;
+	}
        	VALIDATE_STATE(s);
 	file->private_data = s;
 	/* wait for device to become free */
@@ -2226,31 +2841,39 @@ static int cm_open(struct inode *inode, struct file *file)
 			up(&s->open_sem);
 			return -EBUSY;
 		}
+		add_wait_queue(&s->open_wait, &wait);
+		__set_current_state(TASK_INTERRUPTIBLE);
 		up(&s->open_sem);
-		interruptible_sleep_on(&s->open_wait);
+		schedule();
+		remove_wait_queue(&s->open_wait, &wait);
+		set_current_state(TASK_RUNNING);
 		if (signal_pending(current))
 			return -ERESTARTSYS;
 		down(&s->open_sem);
 	}
 	if (file->f_mode & FMODE_READ) {
+		s->status &= ~DO_BIGENDIAN_R;
 		fmtm &= ~((CM_CFMT_STEREO | CM_CFMT_16BIT) << CM_CFMT_ADCSHIFT);
 		if ((minor & 0xf) == SND_DEV_DSP16)
 			fmts |= CM_CFMT_16BIT << CM_CFMT_ADCSHIFT;
 		s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags = s->dma_adc.subdivision = 0;
+		s->dma_adc.enabled = 1;
 		set_adc_rate(s, 8000);
+		// spdif-in is turnned off by default
+		set_spdifin(s, 0);
 	}
 	if (file->f_mode & FMODE_WRITE) {
+		s->status &= ~DO_BIGENDIAN_W;
 		fmtm &= ~((CM_CFMT_STEREO | CM_CFMT_16BIT) << CM_CFMT_DACSHIFT);
 		if ((minor & 0xf) == SND_DEV_DSP16)
 			fmts |= CM_CFMT_16BIT << CM_CFMT_DACSHIFT;
 		s->dma_dac.ossfragshift = s->dma_dac.ossmaxfrags = s->dma_dac.subdivision = 0;
+		s->dma_dac.enabled = 1;
 		set_dac_rate(s, 8000);
 		// clear previous multichannel, spdif, ac3 state
 		set_spdifout(s, 0);
-		if (s->deviceid == PCI_DEVICE_ID_CMEDIA_CM8738) {
-			set_ac3(s, 0);
-			set_dac_channels(s, 1);
-		}
+		set_ac3(s, 0);
+		set_dac_channels(s, 1);
 	}
 	set_fmt(s, fmtm, fmts);
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
@@ -2270,20 +2893,24 @@ static int cm_release(struct inode *inode, struct file *file)
 	if (file->f_mode & FMODE_WRITE) {
 		stop_dac(s);
 
-		dealloc_dmabuf(&s->dma_dac);
+		dealloc_dmabuf(s, &s->dma_dac);
 		if (s->status & DO_DUAL_DAC)
-			dealloc_dmabuf(&s->dma_adc);
+			dealloc_dmabuf(s, &s->dma_adc);
 
 		if (s->status & DO_MULTI_CH)
-			set_dac_channels(s, 0);
+			set_dac_channels(s, 1);
 		if (s->status & DO_AC3)
 			set_ac3(s, 0);
 		if (s->status & DO_SPDIF_OUT)
 			set_spdifout(s, 0);
+		/* enable SPDIF loop */
+		set_spdif_loop(s, spdif_loop);
+		s->status &= ~DO_BIGENDIAN_W;
 	}
 	if (file->f_mode & FMODE_READ) {
 		stop_adc(s);
-		dealloc_dmabuf(&s->dma_adc);
+		dealloc_dmabuf(s, &s->dma_adc);
+		s->status &= ~DO_BIGENDIAN_R;
 	}
 	s->open_mode &= ~(file->f_mode & (FMODE_READ|FMODE_WRITE));
 	up(&s->open_sem);
@@ -2304,449 +2931,8 @@ static /*const*/ struct file_operations cm_audio_fops = {
 	.release = cm_release,
 };
 
-#ifdef CONFIG_SOUND_CMPCI_MIDI
 /* --------------------------------------------------------------------- */
 
-static ssize_t cm_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
-{
-	struct cm_state *s = (struct cm_state *)file->private_data;
-	DECLARE_WAITQUEUE(wait, current);
-	ssize_t ret;
-	unsigned long flags;
-	unsigned ptr;
-	int cnt;
-
-	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-	if (!access_ok(VERIFY_WRITE, buffer, count))
-		return -EFAULT;
-	ret = 0;
-	add_wait_queue(&s->midi.iwait, &wait);
-	while (count > 0) {
-		spin_lock_irqsave(&s->lock, flags);
-		ptr = s->midi.ird;
-		cnt = MIDIINBUF - ptr;
-		if (s->midi.icnt < cnt)
-			cnt = s->midi.icnt;
-		spin_unlock_irqrestore(&s->lock, flags);
-		if (cnt > count)
-			cnt = count;
-		if (cnt <= 0) {
-			if (file->f_flags & O_NONBLOCK)
-			{
-				if (!ret)
-					ret = -EAGAIN;
-				break;
-			}
-			__set_current_state(TASK_INTERRUPTIBLE);
-			schedule();
-			if (signal_pending(current))
-			{
-				if (!ret)
-					ret = -ERESTARTSYS;
-				break;
-			}
-			continue;
-		}
-		if (copy_to_user(buffer, s->midi.ibuf + ptr, cnt))
-		{
-			if (!ret)
-				ret = -EFAULT;
-			break;
-		}
-		ptr = (ptr + cnt) % MIDIINBUF;
-		spin_lock_irqsave(&s->lock, flags);
-		s->midi.ird = ptr;
-		s->midi.icnt -= cnt;
-		spin_unlock_irqrestore(&s->lock, flags);
-		count -= cnt;
-		buffer += cnt;
-		ret += cnt;
-		break;
-	}
-	__set_current_state(TASK_RUNNING);
-	remove_wait_queue(&s->midi.iwait, &wait);
-	return ret;
-}
-
-static ssize_t cm_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
-{
-	struct cm_state *s = (struct cm_state *)file->private_data;
-	DECLARE_WAITQUEUE(wait, current);
-	ssize_t ret;
-	unsigned long flags;
-	unsigned ptr;
-	int cnt;
-
-	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-	if (!access_ok(VERIFY_READ, buffer, count))
-		return -EFAULT;
-	if (count == 0)
-		return 0;
-	ret = 0;
-	add_wait_queue(&s->midi.owait, &wait);
-	while (count > 0) {
-		spin_lock_irqsave(&s->lock, flags);
-		ptr = s->midi.owr;
-		cnt = MIDIOUTBUF - ptr;
-		if (s->midi.ocnt + cnt > MIDIOUTBUF)
-			cnt = MIDIOUTBUF - s->midi.ocnt;
-		if (cnt <= 0)
-			cm_handle_midi(s);
-		spin_unlock_irqrestore(&s->lock, flags);
-		if (cnt > count)
-			cnt = count;
-		if (cnt <= 0) {
-			if (file->f_flags & O_NONBLOCK)
-			{
-				if (!ret)
-					ret = -EAGAIN;
-				break;
-			}
-			__set_current_state(TASK_INTERRUPTIBLE);
-			schedule();
-			if (signal_pending(current)) {
-				if (!ret)
-					ret = -ERESTARTSYS;
-				break;
-			}
-			continue;
-		}
-		if (copy_from_user(s->midi.obuf + ptr, buffer, cnt))
-		{
-			if (!ret)
-				ret = -EFAULT;
-			break;
-		}
-		ptr = (ptr + cnt) % MIDIOUTBUF;
-		spin_lock_irqsave(&s->lock, flags);
-		s->midi.owr = ptr;
-		s->midi.ocnt += cnt;
-		spin_unlock_irqrestore(&s->lock, flags);
-		count -= cnt;
-		buffer += cnt;
-		ret += cnt;
-		spin_lock_irqsave(&s->lock, flags);
-		cm_handle_midi(s);
-		spin_unlock_irqrestore(&s->lock, flags);
-	}
-	__set_current_state(TASK_RUNNING);
-	remove_wait_queue(&s->midi.owait, &wait);
-	return ret;
-}
-
-static unsigned int cm_midi_poll(struct file *file, struct poll_table_struct *wait)
-{
-	struct cm_state *s = (struct cm_state *)file->private_data;
-	unsigned long flags;
-	unsigned int mask = 0;
-
-	VALIDATE_STATE(s);
-	if (file->f_mode & FMODE_WRITE)
-		poll_wait(file, &s->midi.owait, wait);
-	if (file->f_mode & FMODE_READ)
-		poll_wait(file, &s->midi.iwait, wait);
-	spin_lock_irqsave(&s->lock, flags);
-	if (file->f_mode & FMODE_READ) {
-		if (s->midi.icnt > 0)
-			mask |= POLLIN | POLLRDNORM;
-	}
-	if (file->f_mode & FMODE_WRITE) {
-		if (s->midi.ocnt < MIDIOUTBUF)
-			mask |= POLLOUT | POLLWRNORM;
-	}
-	spin_unlock_irqrestore(&s->lock, flags);
-	return mask;
-}
-
-static int cm_midi_open(struct inode *inode, struct file *file)
-{
-	int minor = iminor(inode);
-	struct cm_state *s = devs;
-	unsigned long flags;
-
-	while (s && s->dev_midi != minor)
-		s = s->next;
-	if (!s)
-		return -ENODEV;
-       	VALIDATE_STATE(s);
-	file->private_data = s;
-	/* wait for device to become free */
-	down(&s->open_sem);
-	while (s->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) {
-		if (file->f_flags & O_NONBLOCK) {
-			up(&s->open_sem);
-			return -EBUSY;
-		}
-		up(&s->open_sem);
-		interruptible_sleep_on(&s->open_wait);
-		if (signal_pending(current))
-			return -ERESTARTSYS;
-		down(&s->open_sem);
-	}
-	spin_lock_irqsave(&s->lock, flags);
-	if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
-		s->midi.ird = s->midi.iwr = s->midi.icnt = 0;
-		s->midi.ord = s->midi.owr = s->midi.ocnt = 0;
-		/* enable MPU-401 */
-		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 4);
-		outb(0xff, s->iomidi+1); /* reset command */
-		if (!(inb(s->iomidi+1) & 0x80))
-			inb(s->iomidi);
-		outb(0x3f, s->iomidi+1); /* uart command */
-		if (!(inb(s->iomidi+1) & 0x80))
-			inb(s->iomidi);
-		s->midi.ird = s->midi.iwr = s->midi.icnt = 0;
-		init_timer(&s->midi.timer);
-		s->midi.timer.expires = jiffies+1;
-		s->midi.timer.data = (unsigned long)s;
-		s->midi.timer.function = cm_midi_timer;
-		add_timer(&s->midi.timer);
-	}
-	if (file->f_mode & FMODE_READ) {
-		s->midi.ird = s->midi.iwr = s->midi.icnt = 0;
-	}
-	if (file->f_mode & FMODE_WRITE) {
-		s->midi.ord = s->midi.owr = s->midi.ocnt = 0;
-	}
-	spin_unlock_irqrestore(&s->lock, flags);
-	s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
-	up(&s->open_sem);
-	return 0;
-}
-
-static int cm_midi_release(struct inode *inode, struct file *file)
-{
-	struct cm_state *s = (struct cm_state *)file->private_data;
-	DECLARE_WAITQUEUE(wait, current);
-	unsigned long flags;
-	unsigned count, tmo;
-
-	VALIDATE_STATE(s);
-	lock_kernel();
-
-	if (file->f_mode & FMODE_WRITE) {
-		__set_current_state(TASK_INTERRUPTIBLE);
-		add_wait_queue(&s->midi.owait, &wait);
-		for (;;) {
-			spin_lock_irqsave(&s->lock, flags);
-			count = s->midi.ocnt;
-			spin_unlock_irqrestore(&s->lock, flags);
-			if (count <= 0)
-				break;
-			if (signal_pending(current))
-				break;
-			if (file->f_flags & O_NONBLOCK) {
-				remove_wait_queue(&s->midi.owait, &wait);
-				set_current_state(TASK_RUNNING);
-				unlock_kernel();
-				return -EBUSY;
-			}
-			tmo = (count * HZ) / 3100;
-			if (!schedule_timeout(tmo ? : 1) && tmo)
-				printk(KERN_DEBUG "cmpci: midi timed out??\n");
-		}
-		remove_wait_queue(&s->midi.owait, &wait);
-		set_current_state(TASK_RUNNING);
-	}
-	down(&s->open_sem);
-	s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
-	spin_lock_irqsave(&s->lock, flags);
-	if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
-		del_timer(&s->midi.timer);		
-		outb(0xff, s->iomidi+1); /* reset command */
-		if (!(inb(s->iomidi+1) & 0x80))
-			inb(s->iomidi);
-		/* disable MPU-401 */
-		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~4, 0);
-	}
-	spin_unlock_irqrestore(&s->lock, flags);
-	up(&s->open_sem);
-	wake_up(&s->open_wait);
-	unlock_kernel();
-	return 0;
-}
-
-static /*const*/ struct file_operations cm_midi_fops = {
-	.owner	 = THIS_MODULE,
-	.llseek	 = no_llseek,
-	.read	 = cm_midi_read,
-	.write	 = cm_midi_write,
-	.poll	 = cm_midi_poll,
-	.open	 = cm_midi_open,
-	.release = cm_midi_release,
-};
-#endif
-
-/* --------------------------------------------------------------------- */
-
-#ifdef CONFIG_SOUND_CMPCI_FM
-static int cm_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-	static const unsigned char op_offset[18] = {
-		0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
-		0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
-		0x10, 0x11, 0x12, 0x13, 0x14, 0x15
-	};
-	struct cm_state *s = (struct cm_state *)file->private_data;
-	struct dm_fm_voice v;
-	struct dm_fm_note n;
-	struct dm_fm_params p;
-	unsigned int io;
-	unsigned int regb;
-
-	switch (cmd) {		
-	case FM_IOCTL_RESET:
-		for (regb = 0xb0; regb < 0xb9; regb++) {
-			outb(regb, s->iosynth);
-			outb(0, s->iosynth+1);
-			outb(regb, s->iosynth+2);
-			outb(0, s->iosynth+3);
-		}
-		return 0;
-
-	case FM_IOCTL_PLAY_NOTE:
-		if (copy_from_user(&n, (void *)arg, sizeof(n)))
-			return -EFAULT;
-		if (n.voice >= 18)
-			return -EINVAL;
-		if (n.voice >= 9) {
-			regb = n.voice - 9;
-			io = s->iosynth+2;
-		} else {
-			regb = n.voice;
-			io = s->iosynth;
-		}
-		outb(0xa0 + regb, io);
-		outb(n.fnum & 0xff, io+1);
-		outb(0xb0 + regb, io);
-		outb(((n.fnum >> 8) & 3) | ((n.octave & 7) << 2) | ((n.key_on & 1) << 5), io+1);
-		return 0;
-
-	case FM_IOCTL_SET_VOICE:
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
-			return -EFAULT;
-		if (v.voice >= 18)
-			return -EINVAL;
-		regb = op_offset[v.voice];
-		io = s->iosynth + ((v.op & 1) << 1);
-		outb(0x20 + regb, io);
-		outb(((v.am & 1) << 7) | ((v.vibrato & 1) << 6) | ((v.do_sustain & 1) << 5) | 
-		     ((v.kbd_scale & 1) << 4) | (v.harmonic & 0xf), io+1);
-		outb(0x40 + regb, io);
-		outb(((v.scale_level & 0x3) << 6) | (v.volume & 0x3f), io+1);
-		outb(0x60 + regb, io);
-		outb(((v.attack & 0xf) << 4) | (v.decay & 0xf), io+1);
-		outb(0x80 + regb, io);
-		outb(((v.sustain & 0xf) << 4) | (v.release & 0xf), io+1);
-		outb(0xe0 + regb, io);
-		outb(v.waveform & 0x7, io+1);
-		if (n.voice >= 9) {
-			regb = n.voice - 9;
-			io = s->iosynth+2;
-		} else {
-			regb = n.voice;
-			io = s->iosynth;
-		}
-		outb(0xc0 + regb, io);
-		outb(((v.right & 1) << 5) | ((v.left & 1) << 4) | ((v.feedback & 7) << 1) |
-		     (v.connection & 1), io+1);
-		return 0;
-		
-	case FM_IOCTL_SET_PARAMS:
-		if (copy_from_user(&p, (void *)arg, sizeof(p)))
-			return -EFAULT;
-		outb(0x08, s->iosynth);
-		outb((p.kbd_split & 1) << 6, s->iosynth+1);
-		outb(0xbd, s->iosynth);
-		outb(((p.am_depth & 1) << 7) | ((p.vib_depth & 1) << 6) | ((p.rhythm & 1) << 5) | ((p.bass & 1) << 4) |
-		     ((p.snare & 1) << 3) | ((p.tomtom & 1) << 2) | ((p.cymbal & 1) << 1) | (p.hihat & 1), s->iosynth+1);
-		return 0;
-
-	case FM_IOCTL_SET_OPL:
-		outb(4, s->iosynth+2);
-		outb(arg, s->iosynth+3);
-		return 0;
-
-	case FM_IOCTL_SET_MODE:
-		outb(5, s->iosynth+2);
-		outb(arg & 1, s->iosynth+3);
-		return 0;
-	}
-	return -EINVAL;
-}
-
-static int cm_dmfm_open(struct inode *inode, struct file *file)
-{
-	int minor = iminor(inode);
-	struct cm_state *s = devs;
-
-	while (s && s->dev_dmfm != minor)
-		s = s->next;
-	if (!s)
-		return -ENODEV;
-       	VALIDATE_STATE(s);
-	file->private_data = s;
-	/* wait for device to become free */
-	down(&s->open_sem);
-	while (s->open_mode & FMODE_DMFM) {
-		if (file->f_flags & O_NONBLOCK) {
-			up(&s->open_sem);
-			return -EBUSY;
-		}
-		up(&s->open_sem);
-		interruptible_sleep_on(&s->open_wait);
-		if (signal_pending(current))
-			return -ERESTARTSYS;
-		down(&s->open_sem);
-	}
-	/* init the stuff */
-	outb(1, s->iosynth);
-	outb(0x20, s->iosynth+1); /* enable waveforms */
-	outb(4, s->iosynth+2);
-	outb(0, s->iosynth+3);  /* no 4op enabled */
-	outb(5, s->iosynth+2);
-	outb(1, s->iosynth+3);  /* enable OPL3 */
-	s->open_mode |= FMODE_DMFM;
-	up(&s->open_sem);
-	return 0;
-}
-
-static int cm_dmfm_release(struct inode *inode, struct file *file)
-{
-	struct cm_state *s = (struct cm_state *)file->private_data;
-	unsigned int regb;
-
-	VALIDATE_STATE(s);
-	lock_kernel();
-	down(&s->open_sem);
-	s->open_mode &= ~FMODE_DMFM;
-	for (regb = 0xb0; regb < 0xb9; regb++) {
-		outb(regb, s->iosynth);
-		outb(0, s->iosynth+1);
-		outb(regb, s->iosynth+2);
-		outb(0, s->iosynth+3);
-	}
-	up(&s->open_sem);
-	wake_up(&s->open_wait);
-	unlock_kernel();
-	return 0;
-}
-
-static /*const*/ struct file_operations cm_dmfm_fops = {
-	.owner	 = THIS_MODULE,
-	.llseek	 = no_llseek,
-	.ioctl	 = cm_dmfm_ioctl,
-	.open	 = cm_dmfm_open,
-	.release = cm_dmfm_release,
-};
-#endif /* CONFIG_SOUND_CMPCI_FM */
-
-
-
 static struct initvol {
 	int mixch;
 	int vol;
@@ -2787,377 +2973,305 @@ static int query_chip(struct cm_state *s)
 	    if (RegValue & (1 << (26-24))) {
 		ChipVersion = 39;
 	    	if (RegValue & (1 << (24-24)))
-		    s->max_channels  = 6;
+		    s->max_channels = 6;
 	    	else
 		    s->max_channels = 4;
 		s->capability |= CAN_AC3_HW;
 		s->capability |= CAN_DUAL_DAC;
 		s->capability |= CAN_MULTI_CH_HW;
+		s->capability |= CAN_LINE_AS_BASS;
+		s->capability |= CAN_MIC_AS_BASS;
 	    } else {
 		ChipVersion = 55; // 4 or 6 channels
-		s->max_channels  = 6;
+		s->max_channels = 6;
 		s->capability |= CAN_AC3_HW;
 		s->capability |= CAN_DUAL_DAC;
 		s->capability |= CAN_MULTI_CH_HW;
+		s->capability |= CAN_LINE_AS_BASS;
+		s->capability |= CAN_MIC_AS_BASS;
 	    }
 	}
-	// still limited to number of speakers
-	if (s->max_channels > s->speakers)
-		s->max_channels = s->speakers;
+	s->capability |= CAN_LINE_AS_REAR;
 	return ChipVersion;
 }
 
-#ifdef CONFIG_SOUND_CMPCI_MIDI
-static	int	mpuio = CONFIG_SOUND_CMPCI_MPUIO;
-#else
-static	int	mpuio;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_FM
-static	int	fmio = CONFIG_SOUND_CMPCI_FMIO;
-#else
-static	int	fmio;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_SPDIFINVERSE
-static	int	spdif_inverse = 1;
-#else
-static	int	spdif_inverse;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_SPDIFLOOP
-static	int	spdif_loop = 1;
-#else
-static	int	spdif_loop;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_SPEAKERS
-static	int	speakers = CONFIG_SOUND_CMPCI_SPEAKERS;
-#else
-static	int	speakers = 2;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_LINE_REAR
-static	int	use_line_as_rear = 1;
-#else
-static	int	use_line_as_rear;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_LINE_BASS
-static	int	use_line_as_bass = 1;
-#else
-static	int	use_line_as_bass;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_JOYSTICK
-static	int	joystick = 1;
-#else
-static	int	joystick;
-#endif
-MODULE_PARM(mpuio, "i");
-MODULE_PARM(fmio, "i");
-MODULE_PARM(spdif_inverse, "i");
-MODULE_PARM(spdif_loop, "i");
-MODULE_PARM(speakers, "i");
-MODULE_PARM(use_line_as_rear, "i");
-MODULE_PARM(use_line_as_bass, "i");
-MODULE_PARM(joystick, "i");
-MODULE_PARM_DESC(mpuio, "(0x330, 0x320, 0x310, 0x300) Base of MPU-401, 0 to disable");
-MODULE_PARM_DESC(fmio, "(0x388, 0x3C8, 0x3E0) Base of OPL3, 0 to disable");
-MODULE_PARM_DESC(spdif_inverse, "(1/0) Invert S/PDIF-in signal");
-MODULE_PARM_DESC(spdif_loop, "(1/0) Route S/PDIF-in to S/PDIF-out directly");
-MODULE_PARM_DESC(speakers, "(2-6) Number of speakers you connect");
-MODULE_PARM_DESC(use_line_as_rear, "(1/0) Use line-in jack as rear-out");
-MODULE_PARM_DESC(use_line_as_bass, "(1/0) Use line-in jack as bass/center");
-MODULE_PARM_DESC(joystick, "(1/0) Enable joystick interface, still need joystick driver");
-
-static struct pci_device_id cmpci_pci_tbl[] = {
-	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, 
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- 	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, 
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, 
-	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0 }
-};
-MODULE_DEVICE_TABLE(pci, cmpci_pci_tbl);
+#define	echo_option(x)\
+if (x) strcat(options, "" #x " ")
 
-void initialize_chip(struct pci_dev *pcidev)
+static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid)
 {
 	struct cm_state *s;
-	int i, val;
-#if defined(CONFIG_SOUND_CMPCI_MIDI) || defined(CONFIG_SOUND_CMPCI_FM)
-	unsigned char reg_mask = 0;
-#endif
+	mm_segment_t fs;
+	int i, val, ret;
+	unsigned char reg_mask;
 	struct {
 		unsigned short	deviceid;
 		char		*devicename;
-	} devicetable[] =
-	{
+	} devicetable[] = {
 		{ PCI_DEVICE_ID_CMEDIA_CM8338A, "CM8338A" },
 		{ PCI_DEVICE_ID_CMEDIA_CM8338B, "CM8338B" },
 		{ PCI_DEVICE_ID_CMEDIA_CM8738,  "CM8738" },
 		{ PCI_DEVICE_ID_CMEDIA_CM8738B, "CM8738B" },
 	};
 	char	*devicename = "unknown";
-	{
-		if (pci_enable_device(pcidev))
-			return;
-		if (pcidev->irq == 0)
-			return;
-		s = kmalloc(sizeof(*s), GFP_KERNEL);
-		if (!s) {
-			printk(KERN_WARNING "cmpci: out of memory\n");
-			return;
-		}
-		/* search device name */
-		for (i = 0; i < sizeof(devicetable) / sizeof(devicetable[0]); i++) {
-			if (devicetable[i].deviceid == pcidev->device)
-			{
-				devicename = devicetable[i].devicename;
-				break;
-			}
-		}
-		memset(s, 0, sizeof(struct cm_state));
-		init_waitqueue_head(&s->dma_adc.wait);
-		init_waitqueue_head(&s->dma_dac.wait);
-		init_waitqueue_head(&s->open_wait);
-		init_waitqueue_head(&s->midi.iwait);
-		init_waitqueue_head(&s->midi.owait);
-		init_MUTEX(&s->open_sem);
-		spin_lock_init(&s->lock);
-		s->magic = CM_MAGIC;
-		s->iobase = pci_resource_start(pcidev, 0);
-		s->iosynth = fmio;
-		s->iomidi = mpuio;
-		s->status = 0;
-		/* range check */
-		if (speakers < 2)
-			speakers = 2;
-		else if (speakers > 6)
-			speakers = 6;
-		s->speakers = speakers;
-		if (s->iobase == 0)
-			return;
-		s->irq = pcidev->irq;
-
-		if (!request_region(s->iobase, CM_EXTENT_CODEC, "cmpci")) {
-			printk(KERN_ERR "cmpci: io ports %#x-%#x in use\n", s->iobase, s->iobase+CM_EXTENT_CODEC-1);
-			goto err_region5;
+	char	options[256];
+
+	if ((ret = pci_enable_device(pcidev)))
+		return ret;
+	if (!(pci_resource_flags(pcidev, 0) & IORESOURCE_IO))
+		return -ENODEV;
+	if (pcidev->irq == 0)
+		return -ENODEV;
+	i = pci_set_dma_mask(pcidev, 0xffffffff);
+	if (i) {
+		printk(KERN_WARNING "cmpci: architecture does not support 32bit PCI busmaster DMA\n");
+		return i;
+	}
+	s = kmalloc(sizeof(*s), GFP_KERNEL);
+	if (!s) {
+		printk(KERN_WARNING "cmpci: out of memory\n");
+		return -ENOMEM;
+	}
+	/* search device name */
+	for (i = 0; i < sizeof(devicetable) / sizeof(devicetable[0]); i++) {
+		if (devicetable[i].deviceid == pcidev->device) {
+			devicename = devicetable[i].devicename;
+			break;
 		}
+	}
+	memset(s, 0, sizeof(struct cm_state));
+	init_waitqueue_head(&s->dma_adc.wait);
+	init_waitqueue_head(&s->dma_dac.wait);
+	init_waitqueue_head(&s->open_wait);
+	init_MUTEX(&s->open_sem);
+	spin_lock_init(&s->lock);
+	s->magic = CM_MAGIC;
+	s->dev = pcidev;
+	s->iobase = pci_resource_start(pcidev, 0);
+	s->iosynth = fmio;
+	s->iomidi = mpuio;
 #ifdef CONFIG_SOUND_CMPCI_MIDI
-		/* disable MPU-401 */
-		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x04, 0);
-		if (s->iomidi) {
-		    if (!request_region(s->iomidi, CM_EXTENT_MIDI, "cmpci Midi")) {
-			printk(KERN_ERR "cmpci: io ports %#x-%#x in use\n", s->iomidi, s->iomidi+CM_EXTENT_MIDI-1);
-			s->iomidi = 0;
-		    } else {
-		        /* set IO based at 0x330 */
-		        switch (s->iomidi) {
-		 	    case 0x330:
-				reg_mask = 0;
-				break;
-			    case 0x320:
-				reg_mask = 0x20;
-				break;
-			    case 0x310:
-				reg_mask = 0x40;
-				break;
-			    case 0x300:
-				reg_mask = 0x60;
-				break;
-			    default:
-				s->iomidi = 0;
-				break;
-		        }
-		        outb((inb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3) & ~0x60) | reg_mask, s->iobase + CODEC_CMI_LEGACY_CTRL + 3);
-			/* enable MPU-401 */
-			if (s->iomidi) {
-			    maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x04);
-			}
-		    }
-		}
+	s->midi_devc = 0;
 #endif
+	s->status = 0;
+	if (s->iobase == 0)
+		return -ENODEV;
+	s->irq = pcidev->irq;
+
+	if (!request_region(s->iobase, CM_EXTENT_CODEC, "cmpci")) {
+		printk(KERN_ERR "cmpci: io ports %#x-%#x in use\n", s->iobase, s->iobase+CM_EXTENT_CODEC-1);
+		ret = -EBUSY;
+		goto err_region5;
+	}
+	/* dump parameters */
+	strcpy(options, "cmpci: ");
+	echo_option(joystick);
+	echo_option(spdif_inverse);
+	echo_option(spdif_loop);
+	echo_option(spdif_out);
+	echo_option(use_line_as_rear);
+	echo_option(use_line_as_bass);
+	echo_option(use_mic_as_bass);
+	echo_option(mic_boost);
+	echo_option(hw_copy);
+	printk(KERN_INFO "%s\n", options);
+
+	/* initialize codec registers */
+	outb(0, s->iobase + CODEC_CMI_INT_HLDCLR + 2);  /* disable ints */
+	outb(0, s->iobase + CODEC_CMI_FUNCTRL0 + 2); /* disable channels */
+	/* reset mixer */
+	wrmixer(s, DSP_MIX_DATARESETIDX, 0);
+
+	/* request irq */
+	if ((ret = request_irq(s->irq, cm_interrupt, SA_SHIRQ, "cmpci", s))) {
+		printk(KERN_ERR "cmpci: irq %u in use\n", s->irq);
+		goto err_irq;
+	}
+	printk(KERN_INFO "cmpci: found %s adapter at io %#x irq %u\n",
+	       devicename, s->iobase, s->irq);
+	/* register devices */
+	if ((s->dev_audio = register_sound_dsp(&cm_audio_fops, -1)) < 0) {
+		ret = s->dev_audio;
+		goto err_dev1;
+	}
+	if ((s->dev_mixer = register_sound_mixer(&cm_mixer_fops, -1)) < 0) {
+		ret = s->dev_mixer;
+		goto err_dev2;
+	}
+	pci_set_master(pcidev);	/* enable bus mastering */
+	/* initialize the chips */
+	fs = get_fs();
+	set_fs(KERNEL_DS);
+	/* set mixer output */
+	frobindir(s, DSP_MIX_OUTMIXIDX, 0x1f, 0x1f);
+	/* set mixer input */
+	val = SOUND_MASK_LINE|SOUND_MASK_SYNTH|SOUND_MASK_CD|SOUND_MASK_MIC;
+	mixer_ioctl(s, SOUND_MIXER_WRITE_RECSRC, (unsigned long)&val);
+	for (i = 0; i < sizeof(initvol)/sizeof(initvol[0]); i++) {
+		val = initvol[i].vol;
+		mixer_ioctl(s, initvol[i].mixch, (unsigned long)&val);
+	}
+	set_fs(fs);
+	/* use channel 1 for playback, channel 0 for record */
+	maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~CHADC1, CHADC0);
+	/* turn off VMIC3 - mic boost */
+	if (mic_boost)
+		maskb(s->iobase + CODEC_CMI_MIXER2, ~1, 0);
+	else
+		maskb(s->iobase + CODEC_CMI_MIXER2, ~0, 1);
+	s->deviceid = pcidev->device;
+
+	if (pcidev->device == PCI_DEVICE_ID_CMEDIA_CM8738
+	 || pcidev->device == PCI_DEVICE_ID_CMEDIA_CM8738B) {
+
+		/* chip version and hw capability check */
+		s->chip_version = query_chip(s);
+		printk(KERN_INFO "cmpci: chip version = 0%d\n", s->chip_version);
+
+		/* set SPDIF-in inverse before enable SPDIF loop */
+		set_spdifin_inverse(s, spdif_inverse);
+
+		/* use SPDIF in #1 */
+		set_spdifin_channel2(s, 0);
+	} else {
+		s->chip_version = 0;
+		/* 8338 will fall here */
+		s->max_channels = 4;
+		s->capability |= CAN_DUAL_DAC;
+		s->capability |= CAN_LINE_AS_REAR;
+	}
+	/* enable SPDIF loop */
+	set_spdif_loop(s, spdif_loop);
+
+	// enable 4 speaker mode (analog duplicate)
+	set_hw_copy(s, hw_copy);
+
+	reg_mask = 0;
 #ifdef CONFIG_SOUND_CMPCI_FM
-		/* disable FM */
-		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~8, 0);
-		if (s->iosynth) {
-		    if (!request_region(s->iosynth, CM_EXTENT_SYNTH, "cmpci FM")) {
-			printk(KERN_ERR "cmpci: io ports %#x-%#x in use\n", s->iosynth, s->iosynth+CM_EXTENT_SYNTH-1);
+	/* disable FM */
+	maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~8, 0);
+	if (s->iosynth) {
+	    /* don't enable OPL3 if there is one */
+	    if (opl3_detect(s->iosynth, NULL)) {
+	    	s->iosynth = 0;
+	    } else {
+		/* set IO based at 0x388 */
+		switch (s->iosynth) {
+		    case 0x388:
+			reg_mask = 0;
+			break;
+		    case 0x3C8:
+			reg_mask = 0x01;
+			break;
+		    case 0x3E0:
+			reg_mask = 0x02;
+			break;
+		    case 0x3E8:
+			reg_mask = 0x03;
+			break;
+		    default:
 			s->iosynth = 0;
-		    } else {
-		        /* set IO based at 0x388 */
-		        switch (s->iosynth) {
-		 	    case 0x388:
-				reg_mask = 0;
-				break;
-			    case 0x3C8:
-				reg_mask = 0x01;
-				break;
-			    case 0x3E0:
-				reg_mask = 0x02;
-				break;
-			    case 0x3E8:
-				reg_mask = 0x03;
-				break;
-			    default:
+			break;
+		}
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0x03, reg_mask);
+		/* enable FM */
+		if (s->iosynth) {
+			maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, 8);
+			if (opl3_detect(s->iosynth, NULL))
+				ret = opl3_init(s->iosynth, NULL, THIS_MODULE);
+			else {
+				maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~8, 0);
 				s->iosynth = 0;
-				break;
-		        }
-		        maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0x03, reg_mask);
-		        /* enable FM */
-			if (s->iosynth) {
-		            maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~0, 8);
 			}
-		    }
 		}
+	    }
+	}
 #endif
-		/* enable joystick */
-		if (joystick)
-			maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x02);
-		else
-			maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x02, 0);
-		/* initialize codec registers */
-		outb(0, s->iobase + CODEC_CMI_INT_HLDCLR + 2);  /* disable ints */
-		outb(0, s->iobase + CODEC_CMI_FUNCTRL0 + 2); /* disable channels */
-		/* reset mixer */
-		wrmixer(s, DSP_MIX_DATARESETIDX, 0);
-
-		/* request irq */
-		if (request_irq(s->irq, cm_interrupt, SA_SHIRQ, "cmpci", s)) {
-			printk(KERN_ERR "cmpci: irq %u in use\n", s->irq);
-			goto err_irq;
-		}
-		printk(KERN_INFO "cmpci: found %s adapter at io %#06x irq %u\n",
-		       devicename, s->iobase, s->irq);
-		/* register devices */
-		if ((s->dev_audio = register_sound_dsp(&cm_audio_fops, -1)) < 0)
-			goto err_dev1;
-		if ((s->dev_mixer = register_sound_mixer(&cm_mixer_fops, -1)) < 0)
-			goto err_dev2;
 #ifdef CONFIG_SOUND_CMPCI_MIDI
-		if ((s->dev_midi = register_sound_midi(&cm_midi_fops, -1)) < 0)
-			goto err_dev3;
-#endif
-#ifdef CONFIG_SOUND_CMPCI_FM
-		if ((s->dev_dmfm = register_sound_special(&cm_dmfm_fops, 15 /* ?? */)) < 0)
-			goto err_dev4;
-#endif
-		pci_set_master(pcidev);	/* enable bus mastering */
-		/* initialize the chips */
-		/* set mixer output */
-		frobindir(s, DSP_MIX_OUTMIXIDX, 0x1f, 0x1f);
-		/* set mixer input */
-		val = SOUND_MASK_LINE|SOUND_MASK_SYNTH|SOUND_MASK_CD|SOUND_MASK_MIC;
-		mixer_ioctl(s, SOUND_MIXER_WRITE_RECSRC, (unsigned long)&val);
-		for (i = 0; i < sizeof(initvol)/sizeof(initvol[0]); i++) {
-			val = initvol[i].vol;
-			mixer_ioctl(s, initvol[i].mixch, (unsigned long)&val);
+	/* disable MPU-401 */
+	maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x04, 0);
+	s->mpu_data.name = "cmpci mpu";
+	s->mpu_data.io_base = s->iomidi;
+	s->mpu_data.irq = -s->irq;	// tell mpu401 to share irq
+	if (probe_mpu401(&s->mpu_data))
+		s->iomidi = 0;
+	if (s->iomidi) {
+		/* set IO based at 0x330 */
+		switch (s->iomidi) {
+		    case 0x330:
+			reg_mask = 0;
+			break;
+		    case 0x320:
+			reg_mask = 0x20;
+			break;
+		    case 0x310:
+			reg_mask = 0x40;
+			break;
+		    case 0x300:
+			reg_mask = 0x60;
+			break;
+		    default:
+			s->iomidi = 0;
+			break;
 		}
-		/* use channel 0 for record, channel 1 for play */
-		maskb(s->iobase + CODEC_CMI_FUNCTRL0, ~2, 1);
-		s->deviceid = pcidev->device;
-
-		if (pcidev->device == PCI_DEVICE_ID_CMEDIA_CM8738) {
-
-			/* chip version and hw capability check */
-			s->chip_version = query_chip(s);
-			printk(KERN_INFO "cmpci: chip version = 0%d\n", s->chip_version);
+		maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0x60, reg_mask);
+		/* enable MPU-401 */
+		if (s->iomidi) {
+			int timeout;
 
-			/* seet SPDIF-in inverse before enable SPDIF loop */
-			if (spdif_inverse) {
-				/* turn on spdif-in inverse */
-				maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~0, 1);
-				printk(KERN_INFO "cmpci: Inverse SPDIF-in\n");
-			} else {
-				/* turn off spdif-ininverse */
-				maskb(s->iobase + CODEC_CMI_CHFORMAT + 2, ~1, 0);
+			maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x04);
+			/* clear all previously received interrupt */
+			for (timeout = 900000; timeout > 0; timeout--) {
+				if ((inb(s->iomidi + 1) && 0x80) == 0)
+					inb(s->iomidi);
+				else
+					break;
 			}
-
-			/* enable SPDIF loop */
-			if (spdif_loop) {
-				s->status |= DO_SPDIF_LOOP;
-				/* turn on spdif-in to spdif-out */
-				maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x80);
-				printk(KERN_INFO "cmpci: Enable SPDIF loop\n");
+	    		if (!probe_mpu401(&s->mpu_data)) {
+				s->iomidi = 0;
+				maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x04);
 			} else {
-				s->status &= ~DO_SPDIF_LOOP;
-				/* turn off spdif-in to spdif-out */
-				maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x80, 0);
-			}
-			if (use_line_as_rear) {
-				s->capability |= CAN_LINE_AS_REAR;
-				s->status |= DO_LINE_AS_REAR;
-				maskb(s->iobase + CODEC_CMI_MIXER1, ~0, 0x20);
-			} else
-				maskb(s->iobase + CODEC_CMI_MIXER1, ~0x20, 0);
-			if (s->chip_version >= 39) {
-				if (use_line_as_bass) {
-					s->capability |= CAN_LINE_AS_BASS;
-					s->status |= DO_LINE_AS_BASS;
-					maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~0, 0x60);
-				} else
-					maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 1, ~0x60, 0);
+				attach_mpu401(&s->mpu_data, THIS_MODULE);
+				s->midi_devc = s->mpu_data.slots[1];
 			}
-		} else {
-			/* 8338 will fall here */
-			s->max_channels = 2;
 		}
-		/* queue it for later freeing */
-		s->next = devs;
-		devs = s;
-		return;
-
-#ifdef CONFIG_SOUND_CMPCI_FM
-		unregister_sound_special(s->dev_dmfm);
-	err_dev4:
-#endif
-#ifdef CONFIG_SOUND_CMPCI_MIDI
-		unregister_sound_midi(s->dev_midi);
-	err_dev3:
-#endif
-		unregister_sound_mixer(s->dev_mixer);
-	err_dev2:
-		unregister_sound_dsp(s->dev_audio);
-	err_dev1:
-		printk(KERN_ERR "cmpci: cannot register misc device\n");
-		free_irq(s->irq, s);
-	err_irq:
-#ifdef CONFIG_SOUND_CMPCI_FM
-		if (s->iosynth) release_region(s->iosynth, CM_EXTENT_SYNTH);
-#endif
-#ifdef CONFIG_SOUND_CMPCI_MIDI
-		if (s->iomidi) release_region(s->iomidi, CM_EXTENT_MIDI);
-#endif
-		release_region(s->iobase, CM_EXTENT_CODEC);
-	err_region5:
-		kfree(s);
-	}
-	if (!devs) {
-		if (wavetable_mem)
-			free_pages(wavetable_mem, 20-PAGE_SHIFT);
-		return;
-	}
-	return;
-}
-
-static int __init init_cmpci(void)
-{
-	struct pci_dev *pcidev = NULL;
-	int index = 0;
-
-	printk(KERN_INFO "cmpci: version $Revision: 5.64 $ time " __TIME__ " " __DATE__ "\n");
-
-	while (index < NR_DEVICE && (
-	       (pcidev = pci_find_device(PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, pcidev)))) { 
-		initialize_chip(pcidev);
-		index++;
 	}
-	while (index < NR_DEVICE && (
- 	       (pcidev = pci_find_device(PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, pcidev)))) {
-		initialize_chip(pcidev);
-		index++;
-	}
-	while (index < NR_DEVICE && (
-	       (pcidev = pci_find_device(PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, pcidev)))) {
-		initialize_chip(pcidev);
-		index++;
+#endif
+#ifdef CONFIG_SOUND_CMPCI_JOYSTICK
+	/* enable joystick */
+	if (joystick) {
+		s->gameport.io = 0x200;
+		if (!request_region(s->gameport.io, CM_EXTENT_GAME, "cmpci GAME")) {
+			printk(KERN_ERR "cmpci: gameport io ports in use\n");
+			s->gameport.io = 0;
+	       	} else {
+			maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x02);
+			gameport_register_port(&s->gameport);
+		}
+	} else {
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x02, 0);
+		s->gameport.io = 0;
 	}
+#endif
+	/* store it in the driver field */
+	pci_set_drvdata(pcidev, s);
+	/* put it into driver list */
+	list_add_tail(&s->devs, &devs);
+	/* increment devindex */
+	if (devindex < NR_DEVICE-1)
+		devindex++;
 	return 0;
+
+err_dev2:
+	unregister_sound_dsp(s->dev_audio);
+err_dev1:
+	printk(KERN_ERR "cmpci: cannot register misc device\n");
+	free_irq(s->irq, s);
+err_irq:
+	release_region(s->iobase, CM_EXTENT_CODEC);
+err_region5:
+	kfree(s);
+	return ret;
 }
 
 /* --------------------------------------------------------------------- */
@@ -3166,41 +3280,76 @@ MODULE_AUTHOR("ChenLi Tien, cltien@cmedia.com.tw");
 MODULE_DESCRIPTION("CM8x38 Audio Driver");
 MODULE_LICENSE("GPL");
 
-
-static void __exit cleanup_cmpci(void)
+static void __devinit cm_remove(struct pci_dev *dev)
 {
-	struct cm_state *s;
+	struct cm_state *s = pci_get_drvdata(dev);
 
-	while ((s = devs)) {
-		devs = devs->next;
-		outb(0, s->iobase + CODEC_CMI_INT_HLDCLR + 2);  /* disable ints */
-		synchronize_irq(s->irq);
-		outb(0, s->iobase + CODEC_CMI_FUNCTRL0 + 2); /* disable channels */
-		free_irq(s->irq, s);
-
-		/* reset mixer */
-		wrmixer(s, DSP_MIX_DATARESETIDX, 0);
-
-		release_region(s->iobase, CM_EXTENT_CODEC);
-#ifdef CONFIG_SOUND_CMPCI_MIDI
-		if (s->iomidi) release_region(s->iomidi, CM_EXTENT_MIDI);
+	if (!s)
+		return;
+#ifdef CONFIG_SOUND_CMPCI_JOYSTICK
+	if (s->gameport.io) {
+		gameport_unregister_port(&s->gameport);
+		release_region(s->gameport.io, CM_EXTENT_GAME);
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x02, 0);
+	}
 #endif
 #ifdef CONFIG_SOUND_CMPCI_FM
-		if (s->iosynth) release_region(s->iosynth, CM_EXTENT_SYNTH);
+	if (s->iosynth) {
+		/* disable FM */
+		maskb(s->iobase + CODEC_CMI_MISC_CTRL + 2, ~8, 0);
+	}
 #endif
-		unregister_sound_dsp(s->dev_audio);
-		unregister_sound_mixer(s->dev_mixer);
 #ifdef CONFIG_SOUND_CMPCI_MIDI
-		unregister_sound_midi(s->dev_midi);
-#endif
-#ifdef CONFIG_SOUND_CMPCI_FM
-		unregister_sound_special(s->dev_dmfm);
-#endif
-		kfree(s);
+	if (s->iomidi) {
+		unload_mpu401(&s->mpu_data);
+		/* disable MPU-401 */
+		maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x04, 0);
 	}
-	if (wavetable_mem)
-		free_pages(wavetable_mem, 20-PAGE_SHIFT);
+#endif
+	set_spdif_loop(s, 0);
+	list_del(&s->devs);
+	outb(0, s->iobase + CODEC_CMI_INT_HLDCLR + 2);  /* disable ints */
+	synchronize_irq(s->irq);
+	outb(0, s->iobase + CODEC_CMI_FUNCTRL0 + 2); /* disable channels */
+	free_irq(s->irq, s);
+
+	/* reset mixer */
+	wrmixer(s, DSP_MIX_DATARESETIDX, 0);
+
+	release_region(s->iobase, CM_EXTENT_CODEC);
+	unregister_sound_dsp(s->dev_audio);
+	unregister_sound_mixer(s->dev_mixer);
+	kfree(s);
+	pci_set_drvdata(dev, NULL);
+}
+
+static struct pci_device_id id_table[] __devinitdata = {
+	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738B, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
+	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
+ 	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
+	{ PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
+	{ 0, }
+};
+
+MODULE_DEVICE_TABLE(pci, id_table);
+
+static struct pci_driver cm_driver = {
+       .name	 = "cmpci",
+       .id_table = id_table,
+       .probe	 = cm_probe,
+       .remove	 = cm_remove
+};
+
+static int __init init_cmpci(void)
+{
+	printk(KERN_INFO "cmpci: version $Revision: 6.82 $ time " __TIME__ " " __DATE__ "\n");
+	return pci_module_init(&cm_driver);
+}
+
+static void __exit cleanup_cmpci(void)
+{
 	printk(KERN_INFO "cmpci: unloading\n");
+	pci_unregister_driver(&cm_driver);
 }
 
 module_init(init_cmpci);
diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
index 2f38ae7c8..c2b496e34 100644
--- a/sound/oss/cs4281/cs4281m.c
+++ b/sound/oss/cs4281/cs4281m.c
@@ -1694,7 +1694,7 @@ static void start_adc(struct cs4281_state *s)
 #define DMABUF_MINORDER 1	// ==> min buffer size = 8K.
 
 
-extern void dealloc_dmabuf(struct cs4281_state *s, struct dmabuf *db)
+void dealloc_dmabuf(struct cs4281_state *s, struct dmabuf *db)
 {
 	struct page *map, *mapend;
 
@@ -2148,6 +2148,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 		SOUND_MASK_MIC, SOUND_MASK_CD, 0, SOUND_MASK_LINE1,
 		SOUND_MASK_LINE, SOUND_MASK_VOLUME, 0, 0
 	};
+	void __user *argp = (void __user *)arg;
 
 	// Index of mixtable1[] member is Device ID 
 	// and must be <= SOUND_MIXER_NRDEVICES.
@@ -2195,26 +2196,26 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 
 		case SOUND_MIXER_CS_GETDBGMASK:
 			return put_user(cs_debugmask,
-					(unsigned long *) arg);
+					(unsigned long __user *) argp);
 
 		case SOUND_MIXER_CS_GETDBGLEVEL:
 			return put_user(cs_debuglevel,
-					(unsigned long *) arg);
+					(unsigned long __user *) argp);
 
 		case SOUND_MIXER_CS_SETDBGMASK:
-			if (get_user(val, (unsigned long *) arg))
+			if (get_user(val, (unsigned long __user *) argp))
 				return -EFAULT;
 			cs_debugmask = val;
 			return 0;
 
 		case SOUND_MIXER_CS_SETDBGLEVEL:
-			if (get_user(val, (unsigned long *) arg))
+			if (get_user(val, (unsigned long __user *) argp))
 				return -EFAULT;
 			cs_debuglevel = val;
 			return 0;
 #ifndef NOT_CS4281_PM
 		case SOUND_MIXER_CS_APM:
-			if (get_user(val, (unsigned long *) arg))
+			if (get_user(val, (unsigned long __user *) argp))
 				return -EFAULT;
 			if(val == CS_IOCTL_CMD_SUSPEND)
 				cs4281_suspend(s);
@@ -2238,7 +2239,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 
 	if (cmd == SOUND_MIXER_PRIVATE1) {
 		// enable/disable/query mixer preamp 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *) argp))
 			return -EFAULT;
 		if (val != -1) {
 			cs4281_read_ac97(s, BA0_AC97_MIC_VOLUME, &temp1);
@@ -2247,11 +2248,11 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 		}
 		cs4281_read_ac97(s, BA0_AC97_MIC_VOLUME, &temp1);
 		val = (temp1 & 0x40) ? 1 : 0;
-		return put_user(val, (int *) arg);
+		return put_user(val, (int __user *) argp);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE2) {
 		// enable/disable/query spatializer 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		if (val != -1) {
 			temp1 = (val & 0x3f) >> 2;
@@ -2262,14 +2263,14 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 					  temp1 | 0x2000);
 		}
 		cs4281_read_ac97(s, BA0_AC97_3D_CONTROL, &temp1);
-		return put_user((temp1 << 2) | 3, (int *) arg);
+		return put_user((temp1 << 2) | 3, (int __user *)argp);
 	}
 	if (cmd == SOUND_MIXER_INFO) {
 		mixer_info info;
 		strlcpy(info.id, "CS4281", sizeof(info.id));
 		strlcpy(info.name, "Crystal CS4281", sizeof(info.name));
 		info.modify_counter = s->mix.modcnt;
-		if (copy_to_user((void *) arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -2277,12 +2278,12 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 		_old_mixer_info info;
 		strlcpy(info.id, "CS4281", sizeof(info.id));
 		strlcpy(info.name, "Crystal CS4281", sizeof(info.name));
-		if (copy_to_user((void *) arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *) arg);
+		return put_user(SOUND_VERSION, (int __user *) argp);
 
 	if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
 		return -EINVAL;
@@ -2292,9 +2293,8 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 	if (_SIOC_DIR(cmd) == _SIOC_READ) {
 		switch (_IOC_NR(cmd)) {
 		case SOUND_MIXER_RECSRC:	// Arg contains a bit for each recording source 
-			cs4281_read_ac97(s, BA0_AC97_RECORD_SELECT,
-					 &temp1);
-			return put_user(mixer_src[temp1 & 7], (int *) arg);
+			cs4281_read_ac97(s, BA0_AC97_RECORD_SELECT, &temp1);
+			return put_user(mixer_src[temp1&7], (int __user *)argp);
 
 		case SOUND_MIXER_DEVMASK:	// Arg contains a bit for each supported device 
 			return put_user(SOUND_MASK_PCM | SOUND_MASK_SYNTH |
@@ -2302,29 +2302,29 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 					SOUND_MASK_LINE1 | SOUND_MASK_MIC |
 					SOUND_MASK_VOLUME |
 					SOUND_MASK_RECLEV |
-					SOUND_MASK_SPEAKER, (int *) arg);
+					SOUND_MASK_SPEAKER, (int __user *)argp);
 
 		case SOUND_MIXER_RECMASK:	// Arg contains a bit for each supported recording source 
 			return put_user(SOUND_MASK_LINE | SOUND_MASK_MIC |
 					SOUND_MASK_CD | SOUND_MASK_VOLUME |
-					SOUND_MASK_LINE1, (int *) arg);
+					SOUND_MASK_LINE1, (int __user *) argp);
 
 		case SOUND_MIXER_STEREODEVS:	// Mixer channels supporting stereo 
 			return put_user(SOUND_MASK_PCM | SOUND_MASK_SYNTH |
 					SOUND_MASK_CD | SOUND_MASK_LINE |
 					SOUND_MASK_LINE1 | SOUND_MASK_MIC |
 					SOUND_MASK_VOLUME |
-					SOUND_MASK_RECLEV, (int *) arg);
+					SOUND_MASK_RECLEV, (int __user *)argp);
 
 		case SOUND_MIXER_CAPS:
-			return put_user(SOUND_CAP_EXCL_INPUT, (int *) arg);
+			return put_user(SOUND_CAP_EXCL_INPUT, (int __user *)argp);
 
 		default:
 			i = _IOC_NR(cmd);
 			if (i >= SOUND_MIXER_NRDEVICES
 			    || !(vidx = mixtable1[i]))
 				return -EINVAL;
-			return put_user(s->mix.vol[vidx - 1], (int *) arg);
+			return put_user(s->mix.vol[vidx - 1], (int __user *)argp);
 		}
 	}
 	// If ioctl doesn't have both the SIOC_READ and 
@@ -2339,7 +2339,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 	switch (_IOC_NR(cmd)) {
 
 	case SOUND_MIXER_RECSRC:	// Arg contains a bit for each recording source 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		i = hweight32(val);	// i = # bits on in val.
 		if (i != 1)	// One & only 1 bit must be on.
@@ -2356,7 +2356,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 		return 0;
 
 	case SOUND_MIXER_VOLUME:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -2391,10 +2391,10 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 #else
 		s->mix.vol[8] = val;
 #endif
-		return put_user(s->mix.vol[8], (int *) arg);
+		return put_user(s->mix.vol[8], (int __user *)argp);
 
 	case SOUND_MIXER_SPEAKER:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -2421,10 +2421,10 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 #else
 		s->mix.vol[6] = val;
 #endif
-		return put_user(s->mix.vol[6], (int *) arg);
+		return put_user(s->mix.vol[6], (int __user *)argp);
 
 	case SOUND_MIXER_RECLEV:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -2447,10 +2447,10 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 #else
 		s->mix.vol[7] = val;
 #endif
-		return put_user(s->mix.vol[7], (int *) arg);
+		return put_user(s->mix.vol[7], (int __user *)argp);
 
 	case SOUND_MIXER_MIC:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -2477,16 +2477,16 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 #else
 		s->mix.vol[5] = val;
 #endif
-		return put_user(s->mix.vol[5], (int *) arg);
+		return put_user(s->mix.vol[5], (int __user *)argp);
 
 
 	case SOUND_MIXER_SYNTH:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
 			l = 100;
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		r = (val >> 8) & 0xff;
 		if (r > 100)
@@ -2512,7 +2512,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 #else
 		s->mix.vol[4] = val;
 #endif
-		return put_user(s->mix.vol[4], (int *) arg);
+		return put_user(s->mix.vol[4], (int __user *)argp);
 
 
 	default:
@@ -2522,7 +2522,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 		i = _IOC_NR(cmd);
 		if (i >= SOUND_MIXER_NRDEVICES || !(vidx = mixtable1[i]))
 			return -EINVAL;
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *)argp))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -2558,7 +2558,7 @@ static int mixer_ioctl(struct cs4281_state *s, unsigned int cmd,
 			"write ac97 mixreg[%d]=0x%x mix.vol[]=0x%x\n", 
 				vidx-1,temp1,s->mix.vol[vidx-1]));
 #endif
-		return put_user(s->mix.vol[vidx - 1], (int *) arg);
+		return put_user(s->mix.vol[vidx - 1], (int __user *)argp);
 	}
 }
 
@@ -2817,7 +2817,7 @@ static void CopySamples(char *dst, char *src, int count, int iChannels,
 // issues with 8 bit capture, so the driver always captures data in 16 bit
 // and then if the user requested 8 bit, converts from 16 to 8 bit.
 //
-static unsigned cs_copy_to_user(struct cs4281_state *s, void *dest,
+static unsigned cs_copy_to_user(struct cs4281_state *s, void __user *dest,
 				unsigned *hwsrc, unsigned cnt,
 				unsigned *copied)
 {
@@ -2859,7 +2859,7 @@ static unsigned cs_copy_to_user(struct cs4281_state *s, void *dest,
 
 // --------------------------------------------------------------------- 
 
-static ssize_t cs4281_read(struct file *file, char *buffer, size_t count,
+static ssize_t cs4281_read(struct file *file, char __user *buffer, size_t count,
 			   loff_t * ppos)
 {
 	struct cs4281_state *s =
@@ -2975,7 +2975,7 @@ static ssize_t cs4281_read(struct file *file, char *buffer, size_t count,
 }
 
 
-static ssize_t cs4281_write(struct file *file, const char *buffer,
+static ssize_t cs4281_write(struct file *file, const char __user *buffer,
 			    size_t count, loff_t * ppos)
 {
 	struct cs4281_state *s =
@@ -3161,6 +3161,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 	audio_buf_info abinfo;
 	count_info cinfo;
 	int val, mapped, ret;
+	int __user *p = (int __user *)arg;
 
 	CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO
 		 "cs4281: cs4281_ioctl(): file=%p cmd=0x%.8x\n", file, cmd));
@@ -3175,7 +3176,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
 			"cs4281: cs4281_ioctl(): SOUND_VERSION=0x%.8x\n",
 				 SOUND_VERSION));
-		return put_user(SOUND_VERSION, (int *) arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		CS_DBGOUT(CS_IOCTL, 4, printk(KERN_INFO
@@ -3192,7 +3193,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 	case SNDCTL_DSP_GETCAPS:
 		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME |
 				DSP_CAP_TRIGGER | DSP_CAP_MMAP,
-				(int *) arg);
+				p);
 
 	case SNDCTL_DSP_RESET:
 		CS_DBGOUT(CS_IOCTL, 4, printk(KERN_INFO
@@ -3216,7 +3217,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
 			 "cs4281: cs4281_ioctl(): DSP_SPEED val=%d\n", val));
@@ -3257,10 +3258,10 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		else if (file->f_mode & FMODE_READ)
 			val = s->prop_adc.rate;
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
 			 "cs4281: cs4281_ioctl(): DSP_STEREO val=%d\n", val));
@@ -3279,7 +3280,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
 			 "cs4281: cs4281_ioctl(): DSP_CHANNELS val=%d\n",
@@ -3310,7 +3311,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		else if (file->f_mode & FMODE_READ)
 			val = s->prop_adc.channels;
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_GETFMTS:	// Returns a mask 
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
@@ -3318,10 +3319,10 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 				 AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 |
 				 AFMT_U8));
 		return put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 |
-				AFMT_U8, (int *) arg);
+				AFMT_U8, p);
 
 	case SNDCTL_DSP_SETFMT:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
 			 "cs4281: cs4281_ioctl(): DSP_SETFMT val=0x%.8x\n",
@@ -3358,7 +3359,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(KERN_INFO
 		  "cs4281: cs4281_ioctl(): DSP_SETFMT return val=0x%.8x\n", 
 			val));
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_POST:
 		CS_DBGOUT(CS_IOCTL, 4, printk(KERN_INFO
@@ -3371,10 +3372,10 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 			val |= PCM_ENABLE_INPUT;
 		if (file->f_mode & s->ena & FMODE_WRITE)
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -3416,7 +3417,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 				abinfo.fragsize,abinfo.bytes,abinfo.fragstotal,
 				abinfo.fragments));
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *) arg, &abinfo,
+		return copy_to_user(p, &abinfo,
 				    sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
@@ -3440,7 +3441,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 			    abinfo.bytes >> s->dma_adc.fragshift;
 		}
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *) arg, &abinfo,
+		return copy_to_user(p, &abinfo,
 				    sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_NONBLOCK:
@@ -3456,7 +3457,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		cs4281_update_ptr(s,CS_FALSE);
 		val = s->dma_dac.count;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -3489,7 +3490,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize - 1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *) arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(p, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -3515,7 +3516,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		if (s->dma_dac.mapped)
 			s->dma_dac.count &= s->dma_dac.fragsize - 1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *) arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(p, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -3523,18 +3524,17 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf_dac(s)))
 				return val;
-			return put_user(s->dma_dac.fragsize, (int *) arg);
+			return put_user(s->dma_dac.fragsize, p);
 		}
 		if ((val = prog_dmabuf_adc(s)))
 			return val;
 		if (s->conversion)
-			return put_user(s->dma_adc.fragsize / 2,
-					(int *) arg);
+			return put_user(s->dma_adc.fragsize / 2, p);
 		else
-			return put_user(s->dma_adc.fragsize, (int *) arg);
+			return put_user(s->dma_adc.fragsize, p);
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		return 0;	// Say OK, but do nothing.
 
@@ -3542,7 +3542,7 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision)
 		    || (file->f_mode & FMODE_WRITE
 			&& s->dma_dac.subdivision)) return -EINVAL;
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -3554,15 +3554,15 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 
 	case SOUND_PCM_READ_RATE:
 		if (file->f_mode & FMODE_READ)
-			return put_user(s->prop_adc.rate, (int *) arg);
+			return put_user(s->prop_adc.rate, p);
 		else if (file->f_mode & FMODE_WRITE)
-			return put_user(s->prop_dac.rate, (int *) arg);
+			return put_user(s->prop_dac.rate, p);
 
 	case SOUND_PCM_READ_CHANNELS:
 		if (file->f_mode & FMODE_READ)
-			return put_user(s->prop_adc.channels, (int *) arg);
+			return put_user(s->prop_adc.channels, p);
 		else if (file->f_mode & FMODE_WRITE)
-			return put_user(s->prop_dac.channels, (int *) arg);
+			return put_user(s->prop_dac.channels, p);
 
 	case SOUND_PCM_READ_BITS:
 		if (file->f_mode & FMODE_READ)
@@ -3570,13 +3570,13 @@ static int cs4281_ioctl(struct inode *inode, struct file *file,
 			    put_user(
 				     (s->prop_adc.
 				      fmt & (AFMT_S8 | AFMT_U8)) ? 8 : 16,
-				     (int *) arg);
+				     p);
 		else if (file->f_mode & FMODE_WRITE)
 			return
 			    put_user(
 				     (s->prop_dac.
 				      fmt & (AFMT_S8 | AFMT_U8)) ? 8 : 16,
-				     (int *) arg);
+				     p);
 
 	case SOUND_PCM_WRITE_FILTER:
 	case SNDCTL_DSP_SETSYNCRO:
@@ -3831,7 +3831,7 @@ static void cs4281_midi_timer(unsigned long data)
 
 // --------------------------------------------------------------------- 
 
-static ssize_t cs4281_midi_read(struct file *file, char *buffer,
+static ssize_t cs4281_midi_read(struct file *file, char __user *buffer,
 				size_t count, loff_t * ppos)
 {
 	struct cs4281_state *s =
@@ -3879,7 +3879,7 @@ static ssize_t cs4281_midi_read(struct file *file, char *buffer,
 }
 
 
-static ssize_t cs4281_midi_write(struct file *file, const char *buffer,
+static ssize_t cs4281_midi_write(struct file *file, const char __user *buffer,
 				 size_t count, loff_t * ppos)
 {
 	struct cs4281_state *s =
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index c50e45e58..60fc6c69f 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -1717,7 +1717,7 @@ static irqreturn_t cs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 /**********************************************************************/
 
-static ssize_t cs_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t cs_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
         struct cs_card *card = (struct cs_card *)file->private_data;
         ssize_t ret;
@@ -1762,7 +1762,7 @@ static ssize_t cs_midi_read(struct file *file, char *buffer, size_t count, loff_
 }
 
 
-static ssize_t cs_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t cs_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
         struct cs_card *card = (struct cs_card *)file->private_data;
         ssize_t ret;
@@ -2037,7 +2037,7 @@ static void CopySamples(char *dst, char *src, int count, unsigned fmt,
  */
 static unsigned cs_copy_to_user(
 	struct cs_state *s, 
-	void *dest, 
+	void __user *dest, 
 	void *hwsrc, 
 	unsigned cnt, 
 	unsigned *copied)
@@ -2046,8 +2046,8 @@ static unsigned cs_copy_to_user(
 	void *src = hwsrc;  /* default to the standard destination buffer addr */
 
 	CS_DBGOUT(CS_FUNCTION, 6, printk(KERN_INFO 
-		"cs_copy_to_user()+ fmt=0x%x cnt=%d dest=0x%.8x\n",
-		dmabuf->fmt,(unsigned)cnt,(unsigned)dest) );
+		"cs_copy_to_user()+ fmt=0x%x cnt=%d dest=%p\n",
+		dmabuf->fmt,(unsigned)cnt,dest) );
 
 	if(cnt > dmabuf->dmasize)
 	{
@@ -2074,8 +2074,8 @@ static unsigned cs_copy_to_user(
         if (copy_to_user(dest, src, cnt))
 	{
 		CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_ERR 
-			"cs46xx: cs_copy_to_user()- fault dest=0x%x src=0x%x cnt=%d\n",
-				(unsigned)dest,(unsigned)src,cnt) );
+			"cs46xx: cs_copy_to_user()- fault dest=%p src=%p cnt=%d\n",
+				dest,src,cnt) );
 		*copied = 0;
 		return -EFAULT;
 	}
@@ -2087,7 +2087,7 @@ static unsigned cs_copy_to_user(
 
 /* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to
    the user's buffer.  it is filled by the dma machine and drained by this loop. */
-static ssize_t cs_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t cs_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct cs_card *card = (struct cs_card *) file->private_data;
 	struct cs_state *state;
@@ -2165,8 +2165,8 @@ static ssize_t cs_read(struct file *file, char *buffer, size_t count, loff_t *pp
 		CS_DBGOUT(CS_WAVE_READ, 2, printk(KERN_INFO 
 			"_read() copy_to cnt=%d count=%d ", cnt,count) );
 		CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO 
-			" .dmasize=%d .count=%d buffer=0x%.8x ret=%d\n",
-			dmabuf->dmasize,dmabuf->count,(unsigned)buffer,ret) );
+			" .dmasize=%d .count=%d buffer=%p ret=%d\n",
+			dmabuf->dmasize,dmabuf->count,buffer,ret) );
 
                 if (cs_copy_to_user(state, buffer, 
 			(void *)((unsigned)dmabuf->rawbuf + swptr), cnt, &copied))
@@ -2196,7 +2196,7 @@ out2:
 
 /* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to
    the soundcard.  it is drained by the dma machine and filled by this loop. */
-static ssize_t cs_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t cs_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct cs_card *card = (struct cs_card *) file->private_data;
 	struct cs_state *state;
@@ -2486,6 +2486,8 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 	audio_buf_info abinfo;
 	count_info cinfo;
 	int val, valsave, mapped, ret;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	state = (struct cs_state *)card->states[0];
 	if(state)
@@ -2507,7 +2509,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 	switch (cmd) 
 	{
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_RESET:
 		/* FIXME: spin_lock ? */
@@ -2550,7 +2552,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
 	case SNDCTL_DSP_SPEED: /* set sample rate */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -2582,12 +2584,12 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				file->f_mode & FMODE_WRITE ? "DAC" : "",
 				file->f_mode & FMODE_READ ? "ADC" : "",
 				dmabuf->rate ) );
-			return put_user(dmabuf->rate, (int *)arg);
+			return put_user(dmabuf->rate, p);
 		}
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case SNDCTL_DSP_STEREO: /* set stereo or mono channel */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_WRITE) {
 			state = (struct cs_state *)card->states[1];
@@ -2637,7 +2639,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				dmabuf = &state->dmabuf;
 				if ((val = prog_dmabuf(state)))
 					return val;
-				return put_user(dmabuf->fragsize, (int *)arg);
+				return put_user(dmabuf->fragsize, p);
 			}
 		}
 		if (file->f_mode & FMODE_READ) {
@@ -2648,16 +2650,16 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				if ((val = prog_dmabuf(state)))
 					return val;
 				return put_user(dmabuf->fragsize/dmabuf->divisor, 
-						(int *)arg);
+						p);
 			}
 		}
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/
-		return put_user(AFMT_S16_LE | AFMT_U8, (int *)arg);
+		return put_user(AFMT_S16_LE | AFMT_U8, p);
 
 	case SNDCTL_DSP_SETFMT: /* Select sample format */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(
 		    "cs46xx: cs_ioctl() DSP_SETFMT %s %s %s %s\n",
@@ -2730,14 +2732,14 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if(dmabuf)
 		{
 			if(dmabuf->fmt & CS_FMT_16BIT)
-				return put_user(AFMT_S16_LE, (int *)arg);
+				return put_user(AFMT_S16_LE, p);
 			else
-				return put_user(AFMT_U8, (int *)arg);
+				return put_user(AFMT_U8, p);
 		}
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			if (file->f_mode & FMODE_WRITE) {
@@ -2776,7 +2778,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			}
 		}
 		return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1,
-				(int *)arg);
+				p);
 
 	case SNDCTL_DSP_POST:
 		/*
@@ -2793,7 +2795,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				dmabuf = &state->dmabuf;
 				if (dmabuf->subdivision)
 					return -EINVAL;
-				if (get_user(val, (int *)arg))
+				if (get_user(val, p))
 					return -EFAULT;
 				if (val != 1 && val != 2)
 					return -EINVAL;
@@ -2807,7 +2809,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				dmabuf = &state->dmabuf;
 				if (dmabuf->subdivision)
 					return -EINVAL;
-				if (get_user(val, (int *)arg))
+				if (get_user(val, p))
 					return -EFAULT;
 				if (val != 1 && val != 2)
 					return -EINVAL;
@@ -2817,7 +2819,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (file->f_mode & FMODE_WRITE) {
@@ -2861,7 +2863,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 
 			abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 			spin_unlock_irqrestore(&state->card->lock, flags);
-			return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+			return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		}
 		return -ENODEV;
 
@@ -2879,7 +2881,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			abinfo.fragstotal = dmabuf->numfrag;
 			abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 			spin_unlock_irqrestore(&state->card->lock, flags);
-			return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+			return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		}
 		return -ENODEV;
 
@@ -2889,7 +2891,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 
 	case SNDCTL_DSP_GETCAPS:
 		return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP,
-			    (int *)arg);
+			    p);
 
 	case SNDCTL_DSP_GETTRIGGER:
 		val = 0;
@@ -2915,10 +2917,10 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			}
 		}
 		CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_GETTRIGGER()- val=0x%x\n",val) );
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			state = (struct cs_state *)card->states[0];
@@ -2961,7 +2963,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			cinfo.blocks = dmabuf->count/dmabuf->divisor >> dmabuf->fragshift;
 			cinfo.ptr = dmabuf->hwptr/dmabuf->divisor;
 			spin_unlock_irqrestore(&state->card->lock, flags);
-			if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+			if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 				return -EFAULT;
 			return 0;
 		}
@@ -2996,7 +2998,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			    "cs46xx: GETOPTR bytes=%d blocks=%d ptr=%d\n",
 				cinfo.bytes,cinfo.blocks,cinfo.ptr) );
 			spin_unlock_irqrestore(&state->card->lock, flags);
-			if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+			if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 				return -EFAULT;
 			return 0;
 		}
@@ -3019,7 +3021,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		}
 		else
 			val = 0;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SOUND_PCM_READ_RATE:
 		if(file->f_mode & FMODE_READ)
@@ -3029,9 +3031,9 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if(state)
 		{
 			dmabuf = &state->dmabuf;
-			return put_user(dmabuf->rate, (int *)arg);
+			return put_user(dmabuf->rate, p);
 		}
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 		
 
 	case SOUND_PCM_READ_CHANNELS:
@@ -3043,9 +3045,9 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		{
 			dmabuf = &state->dmabuf;
 			return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1,
-				(int *)arg);
+				p);
 		}
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case SOUND_PCM_READ_BITS:
 		if(file->f_mode & FMODE_READ)
@@ -3056,10 +3058,10 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		{
 			dmabuf = &state->dmabuf;
 			return put_user((dmabuf->fmt & CS_FMT_16BIT) ? 
-			  	AFMT_S16_LE : AFMT_U8, (int *)arg);
+			  	AFMT_S16_LE : AFMT_U8, p);
 
 		}
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case SNDCTL_DSP_MAPINBUF:
 	case SNDCTL_DSP_MAPOUTBUF:
@@ -4164,6 +4166,7 @@ static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int
 	struct ac97_codec *codec = (struct ac97_codec *)file->private_data;
 	struct cs_card *card=NULL;
 	struct list_head *entry;
+	unsigned long __user *p = (long __user *)arg;
 
 #if CSDEBUG_INTERFACE
         int val;
@@ -4178,25 +4181,25 @@ static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int
 	    {
 
 		case SOUND_MIXER_CS_GETDBGMASK:
-			return put_user(cs_debugmask, (unsigned long *)arg);
+			return put_user(cs_debugmask, p);
 		
 		case SOUND_MIXER_CS_GETDBGLEVEL:
-			return put_user(cs_debuglevel, (unsigned long *)arg);
+			return put_user(cs_debuglevel, p);
 
 		case SOUND_MIXER_CS_SETDBGMASK:
-			if (get_user(val, (unsigned long *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			cs_debugmask = val;
 			return 0;
 
 		case SOUND_MIXER_CS_SETDBGLEVEL:
-			if (get_user(val, (unsigned long *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			cs_debuglevel = val;
 			return 0;
 
 		case SOUND_MIXER_CS_APM:
-			if (get_user(val, (unsigned long *) arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if(val == CS_IOCTL_CMD_SUSPEND) 
 			{
diff --git a/sound/oss/dev_table.h b/sound/oss/dev_table.h
index 7b74e92de..2d43d28c7 100644
--- a/sound/oss/dev_table.h
+++ b/sound/oss/dev_table.h
@@ -156,7 +156,7 @@ typedef struct coproc_operations
 	struct module *owner;
 	int (*open) (void *devc, int sub_device);
 	void (*close) (void *devc, int sub_device);
-	int (*ioctl) (void *devc, unsigned int cmd, caddr_t arg, int local);
+	int (*ioctl) (void *devc, unsigned int cmd, void __user * arg, int local);
 	void (*reset) (void *devc);
 
 	void *devc;		/* Driver specific info */
@@ -171,14 +171,14 @@ struct audio_driver
 			      int count, int intrflag);
 	void (*start_input) (int dev, unsigned long buf, 
 			     int count, int intrflag);
-	int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
+	int (*ioctl) (int dev, unsigned int cmd, void __user * arg);
 	int (*prepare_for_input) (int dev, int bufsize, int nbufs);
 	int (*prepare_for_output) (int dev, int bufsize, int nbufs);
 	void (*halt_io) (int dev);
 	int (*local_qlen)(int dev);
 	void (*copy_user) (int dev,
 			char *localbuf, int localoffs,
-                        const char *userbuf, int useroffs,
+                        const char __user *userbuf, int useroffs,
                         int max_in, int max_out,
                         int *used, int *returned,
                         int len);
@@ -247,7 +247,7 @@ struct mixer_operations
 	struct module *owner;
 	char id[16];
 	char name[64];
-	int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
+	int (*ioctl) (int dev, unsigned int cmd, void __user * arg);
 	
 	void *devc;
 	int modify_counter;
@@ -264,13 +264,13 @@ struct synth_operations
 
 	int (*open) (int dev, int mode);
 	void (*close) (int dev);
-	int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
+	int (*ioctl) (int dev, unsigned int cmd, void __user * arg);
 	int (*kill_note) (int dev, int voice, int note, int velocity);
 	int (*start_note) (int dev, int voice, int note, int velocity);
 	int (*set_instr) (int dev, int voice, int instr);
 	void (*reset) (int dev);
 	void (*hw_control) (int dev, unsigned char *event);
-	int (*load_patch) (int dev, int format, const char *addr,
+	int (*load_patch) (int dev, int format, const char __user *addr,
 	     int offs, int count, int pmgr_flag);
 	void (*aftertouch) (int dev, int voice, int pressure);
 	void (*controller) (int dev, int voice, int ctrl_num, int value);
@@ -317,7 +317,7 @@ struct midi_operations
 		void (*outputintr)(int dev)
 		);
 	void (*close) (int dev);
-	int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
+	int (*ioctl) (int dev, unsigned int cmd, void __user * arg);
 	int (*outputc) (int dev, unsigned char data);
 	int (*start_read) (int dev);
 	int (*end_read) (int dev);
@@ -348,7 +348,7 @@ struct sound_timer_operations
 	void (*close)(int dev);
 	int (*event)(int dev, unsigned char *ev);
 	unsigned long (*get_time)(int dev);
-	int (*ioctl) (int dev, unsigned int cmd, caddr_t arg);
+	int (*ioctl) (int dev, unsigned int cmd, void __user * arg);
 	void (*arm_timer)(int dev, long time);
 };
 
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c
index 73aa19031..c601ea25e 100644
--- a/sound/oss/dmabuf.c
+++ b/sound/oss/dmabuf.c
@@ -236,7 +236,7 @@ static unsigned int default_set_bits(int dev, unsigned int bits)
 	mm_segment_t fs = get_fs();
 
 	set_fs(get_ds());
-	audio_devs[dev]->d->ioctl(dev, SNDCTL_DSP_SETFMT, (caddr_t)&bits);
+	audio_devs[dev]->d->ioctl(dev, SNDCTL_DSP_SETFMT, (void __user *)&bits);
 	set_fs(fs);
 	return bits;
 }
@@ -246,7 +246,7 @@ static int default_set_speed(int dev, int speed)
 	mm_segment_t fs = get_fs();
 
 	set_fs(get_ds());
-	audio_devs[dev]->d->ioctl(dev, SNDCTL_DSP_SPEED, (caddr_t)&speed);
+	audio_devs[dev]->d->ioctl(dev, SNDCTL_DSP_SPEED, (void __user *)&speed);
 	set_fs(fs);
 	return speed;
 }
@@ -257,7 +257,7 @@ static short default_set_channels(int dev, short channels)
 	mm_segment_t fs = get_fs();
 
 	set_fs(get_ds());
-	audio_devs[dev]->d->ioctl(dev, SNDCTL_DSP_CHANNELS, (caddr_t)&c);
+	audio_devs[dev]->d->ioctl(dev, SNDCTL_DSP_CHANNELS, (void __user *)&c);
 	set_fs(fs);
 	return c;
 }
diff --git a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c
index 82bc6bfaf..fadf33e59 100644
--- a/sound/oss/dmasound/dac3550a.c
+++ b/sound/oss/dmasound/dac3550a.c
@@ -9,6 +9,7 @@
 
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/delay.h>
 #include <linux/proc_fs.h>
 #include <linux/ioport.h>
 #include <linux/sysctl.h>
@@ -97,14 +98,14 @@ int daca_leave_sleep(void)
 	/* Do a short sleep, just to make sure I2C bus is awake and paying
 	 * attention to us
 	 */
-	wait_ms(20);
+	msleep(20);
 	/* Write the sample rate reg the value it needs */
 	i2c_smbus_write_byte_data(daca_client, 1, 8);
 	daca_set_volume(cur_left_vol >> 5, cur_right_vol >> 5);
 	/* Another short delay, just to make sure the other I2C bus writes
 	 * have taken...
 	 */
-	wait_ms(20);
+	msleep(20);
 	/* Write the global config reg - invert right power amp,
 	 * DAC on, use 5-volt mode */
 	i2c_smbus_write_byte_data(daca_client, 3, 0x45);
diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
index 371530fa5..1d65e18d7 100644
--- a/sound/oss/dmasound/dmasound.h
+++ b/sound/oss/dmasound/dmasound.h
@@ -267,12 +267,6 @@ extern int dmasound_catchRadius;
 */
 #define BS_VAL 1
 
-static inline void wait_ms(unsigned int ms)
-{
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(1 + ms * HZ / 1000);
-}
-
 #define SW_INPUT_VOLUME_SCALE	4
 #define SW_INPUT_VOLUME_DEFAULT	(128 / SW_INPUT_VOLUME_SCALE)
 
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index 7b5049166..a434e454e 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -457,9 +457,9 @@ tas_dmasound_init(void)
 			&gpio_headphone_detect_pol);
 
 	write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-	wait_ms(100);
+	msleep(100);
 	write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
-	wait_ms(100);
+	msleep(100);
   	if (gpio_headphone_irq) {
 		if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",0) < 0) {
     			printk(KERN_ERR "tumbler: Can't request headphone interrupt\n");
@@ -653,7 +653,7 @@ static void PMacIrqCleanup(void)
 	    machine_is_compatible("PowerBook3,2")) && awacs) {
 		awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
 		awacs_write(MASK_ADDR1 | awacs_reg[1]);
-		wait_ms(200);
+		msleep(200);
 	}
 	if (awacs)
 		free_irq(awacs_irq, 0);
@@ -775,10 +775,10 @@ awacs_recalibrate(void)
 	/* Sorry for the horrible delays... I hope to get that improved
 	 * by making the whole PM process asynchronous in a future version
 	 */
-	wait_ms(750);
+	msleep(750);
 	awacs_reg[1] |= MASK_CMUTE | MASK_AMUTE;
 	awacs_write(awacs_reg[1] | MASK_RECALIBRATE | MASK_ADDR1);
-	wait_ms(1000);
+	msleep(1000);
 	awacs_write(awacs_reg[1] | MASK_ADDR1);
 }
 
@@ -1405,9 +1405,9 @@ load_awacs(void)
 
 	if (awacs_revision == AWACS_SCREAMER) {
 		awacs_write(awacs_reg[5] + MASK_ADDR5);
-		wait_ms(100);
+		msleep(100);
 		awacs_write(awacs_reg[6] + MASK_ADDR6);
-		wait_ms(2);
+		msleep(2);
 		awacs_write(awacs_reg[1] + MASK_ADDR1);
 		awacs_write(awacs_reg[7] + MASK_ADDR7);
 	}
@@ -1479,7 +1479,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
 		    machine_is_compatible("PowerBook3,2")) && awacs) {
 			awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
 			awacs_write(MASK_ADDR1 | awacs_reg[1]);
-			wait_ms(200);
+			msleep(200);
 		}
 		break;
 	case PBOOK_WAKE:
@@ -1487,12 +1487,12 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
 		pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, awacs_node, 0, 1);
 		if ((machine_is_compatible("PowerBook3,1") ||
 		    machine_is_compatible("PowerBook3,2")) && awacs) {
-			wait_ms(100);
+			msleep(100);
 			awacs_reg[1] &= ~(MASK_PAROUT0 | MASK_PAROUT1);
 			awacs_write(MASK_ADDR1 | awacs_reg[1]);
-			wait_ms(300);
+			msleep(300);
 		} else
-			wait_ms(1000);
+			msleep(1000);
  		/* restore settings */
 		switch (awacs_revision) {
 			case AWACS_TUMBLER:
@@ -1500,14 +1500,14 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
 				write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
 				write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
 				write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-				wait_ms(100);
+				msleep(100);
 				write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
-				wait_ms(150);
+				msleep(150);
 				tas_leave_sleep(); /* Stub for now */
 				headphone_intr(0,0,0);
 				break;
 			case AWACS_DACA:
-				wait_ms(10); /* Check this !!! */
+				msleep(10); /* Check this !!! */
 				daca_leave_sleep();
 				break ;		/* dont know how yet */
 			case AWACS_BURGUNDY:
@@ -2432,7 +2432,7 @@ static void PMacAbortRead(void)
 	 * release the memory.
 	 */
 
-	wait_ms(100) ; /* give it a (small) chance to act */
+	msleep(100) ; /* give it a (small) chance to act */
 
 	/* apply the sledgehammer approach - just stop it now */
 
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
index 42fae03b1..1aac3655d 100644
--- a/sound/oss/emu10k1/audio.c
+++ b/sound/oss/emu10k1/audio.c
@@ -50,7 +50,7 @@ static void calculate_ofrag(struct woinst *);
 static void calculate_ifrag(struct wiinst *);
 
 /* Audio file operations */
-static ssize_t emu10k1_audio_read(struct file *file, char *buffer, size_t count, loff_t * ppos)
+static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
 	struct wiinst *wiinst = wave_dev->wiinst;
@@ -112,7 +112,7 @@ static ssize_t emu10k1_audio_read(struct file *file, char *buffer, size_t count,
 		    || (bytestocopy >= count)) {
 			bytestocopy = min_t(u32, bytestocopy, count);
 
-			emu10k1_wavein_xferdata(wiinst, (u8 *) buffer, &bytestocopy);
+			emu10k1_wavein_xferdata(wiinst, (u8 __user *)buffer, &bytestocopy);
 
 			count -= bytestocopy;
 			buffer += bytestocopy;
@@ -137,7 +137,7 @@ static ssize_t emu10k1_audio_read(struct file *file, char *buffer, size_t count,
 	return ret;
 }
 
-static ssize_t emu10k1_audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
+static ssize_t emu10k1_audio_write(struct file *file, const char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
 	struct woinst *woinst = wave_dev->woinst;
@@ -212,7 +212,7 @@ static ssize_t emu10k1_audio_write(struct file *file, const char *buffer, size_t
 
 			bytestocopy = min_t(u32, bytestocopy, count);
 
-			emu10k1_waveout_xferdata(woinst, (u8 *) buffer, &bytestocopy);
+			emu10k1_waveout_xferdata(woinst, (u8 __user *) buffer, &bytestocopy);
 
 			count -= bytestocopy;
 			buffer += bytestocopy * woinst->num_voices;
@@ -254,6 +254,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 	int val = 0;
 	u32 bytestocopy;
 	unsigned long flags;
+	int __user *p = (int __user *)arg;
 
 	DPF(4, "emu10k1_audio_ioctl()\n");
 
@@ -266,7 +267,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 	switch (cmd) {
 	case OSS_GETVERSION:
 		DPF(2, "OSS_GETVERSION:\n");
-		return put_user(SOUND_VERSION, (int *) arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_RESET:
 		DPF(2, "SNDCTL_DSP_RESET:\n");
@@ -352,11 +353,11 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 		DPF(2, "SNDCTL_DSP_GETCAPS:\n");
 		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME |
 				DSP_CAP_TRIGGER | DSP_CAP_MMAP |
-				DSP_CAP_COPROC| DSP_CAP_MULTI, (int *) arg);
+				DSP_CAP_COPROC| DSP_CAP_MULTI, p);
 	case SNDCTL_DSP_SPEED:
 		DPF(2, "SNDCTL_DSP_SPEED:\n");
 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		DPD(2, "val is %d\n", val);
@@ -402,21 +403,21 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 				DPD(2, "set playback sampling rate -> %d\n", val);
 			}
 
-			return put_user(val, (int *) arg);
+			return put_user(val, p);
 		} else {
 			if (file->f_mode & FMODE_READ)
 				val = wiinst->format.samplingrate;
 			else if (file->f_mode & FMODE_WRITE)
 				val = woinst->format.samplingrate;
 
-			return put_user(val, (int *) arg);
+			return put_user(val, p);
 		}
 		break;
 
 	case SNDCTL_DSP_STEREO:
 		DPF(2, "SNDCTL_DSP_STEREO:\n");
 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		DPD(2, " val is %d\n", val);
@@ -460,14 +461,14 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 			DPD(2, "set playback stereo -> %d\n", val);
 		}
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 		break;
 
 	case SNDCTL_DSP_CHANNELS:
 		DPF(2, "SNDCTL_DSP_CHANNELS:\n");
 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		DPD(2, " val is %d\n", val);
@@ -510,14 +511,14 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 				DPD(2, "set playback number of channels -> %d\n", val);
 			}
 
-			return put_user(val, (int *) arg);
+			return put_user(val, p);
 		} else {
 			if (file->f_mode & FMODE_READ)
 				val = wiinst->format.channels;
 			else if (file->f_mode & FMODE_WRITE)
 				val = woinst->format.channels;
 
-			return put_user(val, (int *) arg);
+			return put_user(val, p);
 		}
 		break;
 
@@ -533,12 +534,12 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 						     wave_dev->card->pt.enable_gpr_name) >= 0)
 				val |= AFMT_AC3;
 		}
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_SETFMT:	/* Same as SNDCTL_DSP_SAMPLESIZE */
 		DPF(2, "SNDCTL_DSP_SETFMT:\n");
 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		DPD(2, " val is %d\n", val);
@@ -582,14 +583,14 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 				DPD(2, "set playback format -> %d\n", val);
 			}
 
-			return put_user(val, (int *) arg);
+			return put_user(val, p);
 		} else {
 			if (file->f_mode & FMODE_READ)
 				val = wiinst->format.id;
 			else if (file->f_mode & FMODE_WRITE)
 				val = woinst->format.id;
 
-			return put_user(val, (int *) arg);
+			return put_user(val, p);
 		}
 		break;
 
@@ -600,7 +601,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 		else if (file->f_mode & FMODE_WRITE)
 			val = woinst->format.bitsperchannel;
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SOUND_PCM_READ_RATE:
 
@@ -609,7 +610,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 		else if (file->f_mode & FMODE_WRITE)
 			val = woinst->format.samplingrate;
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SOUND_PCM_READ_CHANNELS:
 
@@ -618,7 +619,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 		else if (file->f_mode & FMODE_WRITE)
 			val = woinst->format.channels;
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SOUND_PCM_WRITE_FILTER:
 		DPF(2, "SOUND_PCM_WRITE_FILTER: not implemented\n");
@@ -641,12 +642,12 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 		if (file->f_mode & FMODE_READ && (wave_dev->enablebits & PCM_ENABLE_INPUT))
 			val |= PCM_ENABLE_INPUT;
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_SETTRIGGER:
 		DPF(2, "SNDCTL_DSP_SETTRIGGER:\n");
 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (file->f_mode & FMODE_WRITE) {
@@ -708,7 +709,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 			info.fragstotal = woinst->buffer.numfrags * woinst->num_voices;
 			info.fragments = info.bytes / info.fragsize;
 
-			if (copy_to_user((int *) arg, &info, sizeof(info)))
+			if (copy_to_user(p, &info, sizeof(info)))
 				return -EFAULT;
 		}
 		break;
@@ -737,7 +738,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 			info.fragments = info.bytes / wiinst->buffer.fragment_size;
 			info.fragsize = wiinst->buffer.fragment_size;
 
-			if (copy_to_user((int *) arg, &info, sizeof(info)))
+			if (copy_to_user(p, &info, sizeof(info)))
 				return -EFAULT;
 		}
 		break;
@@ -765,7 +766,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 		val *= woinst->num_voices;
 		spin_unlock_irqrestore(&woinst->lock, flags);
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_GETIPTR:
 		{
@@ -795,7 +796,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 
 			spin_unlock_irqrestore(&wiinst->lock, flags);
 
-			if (copy_to_user((void *) arg, &cinfo, sizeof(cinfo)))
+			if (copy_to_user(p, &cinfo, sizeof(cinfo)))
 				return -EFAULT;
 		}
 		break;
@@ -841,7 +842,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 
 			spin_unlock_irqrestore(&woinst->lock, flags);
 
-			if (copy_to_user((void *) arg, &cinfo, sizeof(cinfo)))
+			if (copy_to_user(p, &cinfo, sizeof(cinfo)))
 				return -EFAULT;
 		}
 		break;
@@ -867,7 +868,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 			spin_unlock_irqrestore(&wiinst->lock, flags);
 		}
 
-		return put_user(val, (int *) arg);
+		return put_user(val, p);
 
 		break;
 
@@ -892,7 +893,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 	case SNDCTL_DSP_SETFRAGMENT:
 		DPF(2, "SNDCTL_DSP_SETFRAGMENT:\n");
 
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		DPD(2, "val is %#x\n", val);
@@ -930,7 +931,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 			if (!buf)
 				return -ENOMEM;
 
-			if (copy_from_user(buf, (copr_buffer *) arg, sizeof(copr_buffer))) {
+			if (copy_from_user(buf, p, sizeof(copr_buffer))) {
 				kfree (buf);
 				return -EFAULT;
 			}
@@ -969,7 +970,7 @@ static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned
 				for (i = 0; i < buf->len; i++)
 					((u32 *) buf->data)[i] = sblive_readptr(wave_dev->card, buf->offs + i, buf->flags);
 
-				if (copy_to_user((copr_buffer *) arg, buf, sizeof(copr_buffer))) {
+				if (copy_to_user(p, buf, sizeof(copr_buffer))) {
 					kfree(buf);
 					return -EFAULT;
 				}
diff --git a/sound/oss/emu10k1/cardwi.c b/sound/oss/emu10k1/cardwi.c
index ce6f698f8..a6b0495eb 100644
--- a/sound/oss/emu10k1/cardwi.c
+++ b/sound/oss/emu10k1/cardwi.c
@@ -304,7 +304,7 @@ void emu10k1_wavein_getxfersize(struct wiinst *wiinst, u32 * size)
 	}
 }
 
-static void copy_block(u8 *dst, u8 * src, u32 str, u32 len, u8 cov)
+static void copy_block(u8 __user *dst, u8 * src, u32 str, u32 len, u8 cov)
 {
 	if (cov == 1)
 		__copy_to_user(dst, src + str, len);
@@ -321,7 +321,7 @@ static void copy_block(u8 *dst, u8 * src, u32 str, u32 len, u8 cov)
 	}
 }
 
-void emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 * data, u32 * size)
+void emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 __user *data, u32 * size)
 {
 	struct wavein_buffer *buffer = &wiinst->buffer;
 	u32 sizetocopy, sizetocopy_now, start;
diff --git a/sound/oss/emu10k1/cardwi.h b/sound/oss/emu10k1/cardwi.h
index c08e53b0e..15cfb9b35 100644
--- a/sound/oss/emu10k1/cardwi.h
+++ b/sound/oss/emu10k1/cardwi.h
@@ -83,7 +83,7 @@ void emu10k1_wavein_close(struct emu10k1_wavedevice *);
 void emu10k1_wavein_start(struct emu10k1_wavedevice *);
 void emu10k1_wavein_stop(struct emu10k1_wavedevice *);
 void emu10k1_wavein_getxfersize(struct wiinst *, u32 *);
-void emu10k1_wavein_xferdata(struct wiinst *, u8 *, u32 *);
+void emu10k1_wavein_xferdata(struct wiinst *, u8 __user *, u32 *);
 int emu10k1_wavein_setformat(struct emu10k1_wavedevice *, struct wave_format *);
 void emu10k1_wavein_update(struct emu10k1_card *, struct wiinst *);
 
diff --git a/sound/oss/emu10k1/cardwo.c b/sound/oss/emu10k1/cardwo.c
index 5cc3afa43..54daca4f5 100644
--- a/sound/oss/emu10k1/cardwo.c
+++ b/sound/oss/emu10k1/cardwo.c
@@ -417,7 +417,7 @@ void emu10k1_waveout_getxfersize(struct woinst *woinst, u32 *total_free_bytes)
  * Notice that the voice buffer is actually a set of disjointed memory pages.
  *
  */
-static void copy_block(void **dst, u32 str, u8 *src, u32 len)
+static void copy_block(void **dst, u32 str, u8 __user *src, u32 len)
 {
 	unsigned int pg;
 	unsigned int pgoff;
@@ -451,7 +451,7 @@ static void copy_block(void **dst, u32 str, u8 *src, u32 len)
  * Notice that the voice buffer is actually a set of disjointed memory pages.
  *
  */
-static void copy_ilv_block(struct woinst *woinst, u32 str, u8 *src, u32 len) 
+static void copy_ilv_block(struct woinst *woinst, u32 str, u8 __user *src, u32 len) 
 {
         unsigned int pg;
 	unsigned int pgoff;
@@ -524,7 +524,7 @@ static void fill_block(struct woinst *woinst, u32 str, u8 data, u32 len)
  * previously added to the buffer are overwritten.
  *
  */
-void emu10k1_waveout_xferdata(struct woinst *woinst, u8 *data, u32 *size)
+void emu10k1_waveout_xferdata(struct woinst *woinst, u8 __user *data, u32 *size)
 {
 	struct waveout_buffer *buffer = &woinst->buffer;
 	struct voice_mem *mem = &woinst->voice[0].mem;
diff --git a/sound/oss/emu10k1/cardwo.h b/sound/oss/emu10k1/cardwo.h
index 70eb9a3f7..1dece8853 100644
--- a/sound/oss/emu10k1/cardwo.h
+++ b/sound/oss/emu10k1/cardwo.h
@@ -82,7 +82,7 @@ void emu10k1_waveout_close(struct emu10k1_wavedevice *);
 void emu10k1_waveout_start(struct emu10k1_wavedevice *);
 void emu10k1_waveout_stop(struct emu10k1_wavedevice *);
 void emu10k1_waveout_getxfersize(struct woinst*, u32 *);
-void emu10k1_waveout_xferdata(struct woinst*, u8*, u32 *);
+void emu10k1_waveout_xferdata(struct woinst*, u8 __user *, u32 *);
 void emu10k1_waveout_fillsilence(struct woinst*);
 int emu10k1_waveout_setformat(struct emu10k1_wavedevice*, struct wave_format*);
 void emu10k1_waveout_update(struct woinst*);
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index 06a78997d..1aa768f2e 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -244,7 +244,7 @@ static int emu10k1_midi_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t emu10k1_midi_read(struct file *file, char *buffer, size_t count, loff_t * pos)
+static ssize_t emu10k1_midi_read(struct file *file, char __user *buffer, size_t count, loff_t * pos)
 {
 	struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
 	ssize_t ret = 0;
@@ -319,7 +319,7 @@ static ssize_t emu10k1_midi_read(struct file *file, char *buffer, size_t count,
 	return ret;
 }
 
-static ssize_t emu10k1_midi_write(struct file *file, const char *buffer, size_t count, loff_t * pos)
+static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t * pos)
 {
 	struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
 	struct midi_hdr *midihdr;
diff --git a/sound/oss/emu10k1/mixer.c b/sound/oss/emu10k1/mixer.c
index bc252de3c..cbcaaa341 100644
--- a/sound/oss/emu10k1/mixer.c
+++ b/sound/oss/emu10k1/mixer.c
@@ -188,6 +188,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 	u32 size, page;
 	int addr, size_reg, i, ret;
 	unsigned int id, ch;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 
@@ -197,7 +198,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 		if (ctl == NULL)
 			return -ENOMEM;
 
-		if (copy_from_user(ctl, (void *) arg, sizeof(struct mixer_private_ioctl))) {
+		if (copy_from_user(ctl, argp, sizeof(struct mixer_private_ioctl))) {
 			kfree(ctl);
 			return -EFAULT;
 		}
@@ -228,7 +229,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 		case CMD_READFN0:
 			ctl->val[2] = emu10k1_readfn0(card, ctl->val[0]);
 
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 
 			break;
@@ -244,7 +245,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 
 			ctl->val[2] = sblive_readptr(card, ctl->val[0], ctl->val[1]);
 
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 
 			break;
@@ -282,7 +283,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 		case CMD_GETRECSRC:
 			ctl->val[0] = card->wavein.recsrc;
 			ctl->val[1] = card->wavein.fxwc;
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 
 			break;
@@ -297,7 +298,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 			ctl->val[4] = card->waveout.send_routing[2];
 			ctl->val[5] = card->waveout.send_dcba[2];
 
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 
 			break;
@@ -320,7 +321,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 		
 		case CMD_GETPATCH:
 			if (ctl->val[0] == 0) {
-				if (copy_to_user((void *) arg, &card->mgr.rpatch, sizeof(struct dsp_rpatch)))
+				if (copy_to_user(argp, &card->mgr.rpatch, sizeof(struct dsp_rpatch)))
                                 	ret = -EFAULT;
 			} else {
 				if ((ctl->val[0] - 1) / PATCHES_PER_PAGE >= card->mgr.current_pages) {
@@ -328,7 +329,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 					break;
 				}
 
-				if (copy_to_user((void *) arg, PATCH(&card->mgr, ctl->val[0] - 1), sizeof(struct dsp_patch)))
+				if (copy_to_user(argp, PATCH(&card->mgr, ctl->val[0] - 1), sizeof(struct dsp_patch)))
 					ret = -EFAULT;
 			}
 
@@ -342,7 +343,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 				break;
 			}
 
-			if (copy_to_user((void *) arg, &card->mgr.gpr[id], sizeof(struct dsp_gpr)))
+			if (copy_to_user(argp, &card->mgr.gpr[id], sizeof(struct dsp_gpr)))
 				ret = -EFAULT;
 
 			break;
@@ -351,7 +352,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 			addr = emu10k1_find_control_gpr(&card->mgr, (char *) ctl->val, &((char *) ctl->val)[PATCH_NAME_SIZE]);
 			ctl->val[0] = sblive_readptr(card, addr, 0);
 
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 
 			break;
@@ -430,7 +431,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 
 			ctl->val[2] = card->mgr.ctrl_gpr[id][ch];
 
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 
 			break;
@@ -496,7 +497,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 			if (card->is_audigy)
 				ctl->val[4]=emu10k1_readfn0(card, 0x18);
 
-			if (copy_to_user((void *) arg, ctl, sizeof(struct mixer_private_ioctl)))
+			if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
 				ret = -EFAULT;
 			break;
 
@@ -517,7 +518,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 
 	case SOUND_MIXER_PRIVATE4:
 
-		if (copy_from_user(&size, (void *) arg, sizeof(size)))
+		if (copy_from_user(&size, argp, sizeof(size)))
 			return -EFAULT;
 
 		DPD(2, "External tram size %#x\n", size);
@@ -581,7 +582,7 @@ static int emu10k1_dsp_mixer(struct emu10k1_card *card, unsigned int oss_mixer,
 
 	card->ac97->modcnt++;
 
-	if (get_user(val, (int *)arg))
+	if (get_user(val, (int __user *)arg))
 		return -EFAULT;
 
 	/* cleanse input a little */
@@ -634,7 +635,7 @@ static int emu10k1_mixer_ioctl(struct inode *inode, struct file *file, unsigned
 				
 			info.modify_counter = card->ac97->modcnt;
 
-			if (copy_to_user((void *)arg, &info, sizeof(info)))
+			if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 				return -EFAULT;
 
 			return 0;
diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c
index 805840eb1..4094be55f 100644
--- a/sound/oss/emu10k1/passthrough.c
+++ b/sound/oss/emu10k1/passthrough.c
@@ -131,7 +131,7 @@ int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev)
 	return 0;
 }
 
-ssize_t emu10k1_pt_write(struct file *file, const char *buffer, size_t count)
+ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t count)
 {
 	struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
 	struct emu10k1_card *card = wave_dev->card;
@@ -177,10 +177,9 @@ ssize_t emu10k1_pt_write(struct file *file, const char *buffer, size_t count)
 	blocks = (count-bytes_copied)/PT_BLOCKSIZE;
 	blocks_copied = 0;
 	while (blocks > 0) {
-		u16 *bufptr = (u16 *) buffer + (bytes_copied/2);
+		u16 __user *bufptr = (u16 __user *) buffer + (bytes_copied/2);
 		copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE);
-		bufptr = (u16 *) pt->buf;
-		r = pt_putblock(wave_dev, bufptr, nonblock);
+		r = pt_putblock(wave_dev, (u16 *)pt->buf, nonblock);
 		if (r) {
 			if (bytes_copied)
 				return bytes_copied;
diff --git a/sound/oss/emu10k1/passthrough.h b/sound/oss/emu10k1/passthrough.h
index 3c7855320..420cc9784 100644
--- a/sound/oss/emu10k1/passthrough.h
+++ b/sound/oss/emu10k1/passthrough.h
@@ -90,7 +90,7 @@ struct pt_data
 #define USE_PT_METHOD2  (card->is_audigy)
 #define USE_PT_METHOD1	!USE_PT_METHOD2
 
-ssize_t emu10k1_pt_write(struct file *file, const char *buf, size_t count);
+ssize_t emu10k1_pt_write(struct file *file, const char __user *buf, size_t count);
 
 int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev);
 void emu10k1_pt_stop(struct emu10k1_card *card);
diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c
index 4478d7dee..68189853a 100644
--- a/sound/oss/es1370.c
+++ b/sound/oss/es1370.c
@@ -845,21 +845,22 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 	unsigned long flags;
 	int i, val;
 	unsigned char l, r, rl, rr;
+	int __user *p = (int __user *)arg;
 
 	VALIDATE_STATE(s);
 	if (cmd == SOUND_MIXER_PRIVATE1) {
 		/* enable/disable/query mixer preamp */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != -1) {
 			s->mix.micpreamp = !!val;
 			wrcodec(s, 0x19, s->mix.micpreamp);
 		}
-		return put_user(s->mix.micpreamp, (int *)arg);
+		return put_user(s->mix.micpreamp, p);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE2) {
 		/* enable/disable/query use of linein as second lineout */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != -1) {
 			spin_lock_irqsave(&s->lock, flags);
@@ -870,11 +871,11 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 			outl(s->ctrl, s->io+ES1370_REG_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user((s->ctrl & CTRL_XCTL0) ? 1 : 0, (int *)arg);
+		return put_user((s->ctrl & CTRL_XCTL0) ? 1 : 0, p);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE3) {
 		/* enable/disable/query microphone impedance setting */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != -1) {
 			spin_lock_irqsave(&s->lock, flags);
@@ -885,14 +886,14 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 			outl(s->ctrl, s->io+ES1370_REG_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user((s->ctrl & CTRL_XCTL1) ? 1 : 0, (int *)arg);
+		return put_user((s->ctrl & CTRL_XCTL1) ? 1 : 0, p);
 	}
         if (cmd == SOUND_MIXER_INFO) {
 		mixer_info info;
 		strncpy(info.id, "ES1370", sizeof(info.id));
 		strncpy(info.name, "Ensoniq ES1370", sizeof(info.name));
 		info.modify_counter = s->mix.modcnt;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -900,49 +901,49 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 		_old_mixer_info info;
 		strncpy(info.id, "ES1370", sizeof(info.id));
 		strncpy(info.name, "Ensoniq ES1370", sizeof(info.name));
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 	if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
         if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-			return put_user(s->mix.recsrc, (int *)arg);
+			return put_user(s->mix.recsrc, p);
 			
                 case SOUND_MIXER_DEVMASK: /* Arg contains a bit for each supported device */
 			val = SOUND_MASK_IMIX;
 			for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].avail)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 
                 case SOUND_MIXER_RECMASK: /* Arg contains a bit for each supported recording source */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].recmask)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 			
                 case SOUND_MIXER_STEREODEVS: /* Mixer channels supporting stereo */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].stereo)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 			
                 case SOUND_MIXER_CAPS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		
 		case SOUND_MIXER_IMIX:
-			return put_user(s->mix.imix, (int *)arg);
+			return put_user(s->mix.imix, p);
 
 		default:
 			i = _IOC_NR(cmd);
                         if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].avail)
                                 return -EINVAL;
-			return put_user(s->mix.vol[mixtable[i].volidx], (int *)arg);
+			return put_user(s->mix.vol[mixtable[i].volidx], p);
 		}
 	}
         if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE)) 
@@ -951,13 +952,13 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 	switch (_IOC_NR(cmd)) {
 
 	case SOUND_MIXER_IMIX:
-		if (get_user(s->mix.imix, (int *)arg))
+		if (get_user(s->mix.imix, p))
 			return -EFAULT;
 		set_recsrc(s, s->mix.recsrc);
 		return 0;
 
 	case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		set_recsrc(s, val);
 		return 0;
@@ -966,7 +967,7 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 		i = _IOC_NR(cmd);
 		if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].avail)
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -1015,7 +1016,7 @@ static int mixer_ioctl(struct es1370_state *s, unsigned int cmd, unsigned long a
 #else
 		s->mix.vol[mixtable[i].volidx] = val;
 #endif
-                return put_user(s->mix.vol[mixtable[i].volidx], (int *)arg);
+                return put_user(s->mix.vol[mixtable[i].volidx], p);
 	}
 }
 
@@ -1136,7 +1137,7 @@ static int drain_dac2(struct es1370_state *s, int nonblock)
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t es1370_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1370_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1370_state *s = (struct es1370_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1214,7 +1215,7 @@ out:
 	return ret;
 }
 
-static ssize_t es1370_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1370_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1370_state *s = (struct es1370_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1386,13 +1387,15 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
         count_info cinfo;
 	int count;
 	int val, mapped, ret;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
         mapped = ((file->f_mode & FMODE_WRITE) && s->dma_dac2.mapped) ||
 		((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
@@ -1403,7 +1406,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
@@ -1419,7 +1422,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (s->open_mode & (~file->f_mode) & (FMODE_READ|FMODE_WRITE))
@@ -1436,10 +1439,10 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			outl(s->ctrl, s->io+ES1370_REG_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user(DAC2_DIVTOSR((s->ctrl & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV), (int *)arg);
+		return put_user(DAC2_DIVTOSR((s->ctrl & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV), p);
 		
         case SNDCTL_DSP_STEREO:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			stop_adc(s);
@@ -1466,7 +1469,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -1492,13 +1495,13 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 				spin_unlock_irqrestore(&s->lock, flags);
 			}
 		}
-		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, p);
 		
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+                return put_user(AFMT_S16_LE|AFMT_U8, p);
 		
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			if (file->f_mode & FMODE_READ) {
@@ -1525,7 +1528,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 		}
 		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 
-				AFMT_S16_LE : AFMT_U8, (int *)arg);
+				AFMT_S16_LE : AFMT_U8, p);
 		
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -1536,10 +1539,10 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			val |= PCM_ENABLE_INPUT;
 		if (file->f_mode & FMODE_WRITE && s->ctrl & CTRL_DAC2_EN) 
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -1580,7 +1583,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                 abinfo.fragstotal = s->dma_dac2.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac2.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -1597,7 +1600,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                 abinfo.fragstotal = s->dma_adc.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -1614,7 +1617,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (count < 0)
 			count = 0;
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
         case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -1632,7 +1635,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1652,7 +1655,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (s->dma_dac2.mapped)
 			s->dma_dac2.count &= s->dma_dac2.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1660,14 +1663,14 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf_dac2(s)))
 				return val;
-			return put_user(s->dma_dac2.fragsize, (int *)arg);
+			return put_user(s->dma_dac2.fragsize, p);
 		}
 		if ((val = prog_dmabuf_adc(s)))
 			return val;
-		return put_user(s->dma_adc.fragsize, (int *)arg);
+		return put_user(s->dma_adc.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			s->dma_adc.ossfragshift = val & 0xffff;
@@ -1695,7 +1698,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac2.subdivision))
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -1706,15 +1709,15 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user(DAC2_DIVTOSR((s->ctrl & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV), (int *)arg);
+		return put_user(DAC2_DIVTOSR((s->ctrl & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV), p);
 
         case SOUND_PCM_READ_CHANNELS:
 		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ?
-				2 : 1, (int *)arg);
+				2 : 1, p);
 
         case SOUND_PCM_READ_BITS:
 		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 
-				16 : 8, (int *)arg);
+				16 : 8, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -1828,7 +1831,7 @@ static /*const*/ struct file_operations es1370_audio_fops = {
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t es1370_write_dac(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1370_write_dac(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1370_state *s = (struct es1370_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1961,11 +1964,12 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 	int count;
 	unsigned ctrl;
 	int val, ret;
+	int __user *p = (int __user *)arg;
 
 	VALIDATE_STATE(s);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		return drain_dac1(s, 0/*file->f_flags & O_NONBLOCK*/);
@@ -1974,7 +1978,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return -EINVAL;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		stop_dac1(s);
@@ -1983,7 +1987,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			stop_dac1(s);
@@ -1996,10 +2000,10 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 			outl(s->ctrl, s->io+ES1370_REG_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user(dac1_samplerate[(s->ctrl & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL], (int *)arg);
+		return put_user(dac1_samplerate[(s->ctrl & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL], p);
 		
         case SNDCTL_DSP_STEREO:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		stop_dac1(s);
 		s->dma_dac1.ready = 0;
@@ -2013,7 +2017,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			if (s->dma_dac1.mapped)
@@ -2028,13 +2032,13 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 			outl(s->sctrl, s->io+ES1370_REG_SERIAL_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, p);
 		
         case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+                return put_user(AFMT_S16_LE|AFMT_U8, p);
 		
         case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			stop_dac1(s);
@@ -2047,16 +2051,16 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 			outl(s->sctrl, s->io+ES1370_REG_SERIAL_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user((s->sctrl & SCTRL_P1SEB) ? AFMT_S16_LE : AFMT_U8, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SEB) ? AFMT_S16_LE : AFMT_U8, p);
 
         case SNDCTL_DSP_POST:
                 return 0;
 
         case SNDCTL_DSP_GETTRIGGER:
-		return put_user((s->ctrl & CTRL_DAC1_EN) ? PCM_ENABLE_OUTPUT : 0, (int *)arg);
+		return put_user((s->ctrl & CTRL_DAC1_EN) ? PCM_ENABLE_OUTPUT : 0, p);
 						
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val & PCM_ENABLE_OUTPUT) {
 			if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2082,7 +2086,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
                 abinfo.fragstotal = s->dma_dac1.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac1.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -2097,7 +2101,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (count < 0)
 			count = 0;
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
         case SNDCTL_DSP_GETOPTR:
 		if (!s->dma_dac1.ready && (val = prog_dmabuf_dac1(s)) != 0)
@@ -2113,17 +2117,17 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		if (s->dma_dac1.mapped)
 			s->dma_dac1.count &= s->dma_dac1.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user((void __user *)arg, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
         case SNDCTL_DSP_GETBLKSIZE:
 		if ((val = prog_dmabuf_dac1(s)))
 			return val;
-                return put_user(s->dma_dac1.fragsize, (int *)arg);
+                return put_user(s->dma_dac1.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		s->dma_dac1.ossfragshift = val & 0xffff;
 		s->dma_dac1.ossmaxfrags = (val >> 16) & 0xffff;
@@ -2138,7 +2142,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
         case SNDCTL_DSP_SUBDIVIDE:
 		if (s->dma_dac1.subdivision)
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2146,13 +2150,13 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user(dac1_samplerate[(s->ctrl & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL], (int *)arg);
+		return put_user(dac1_samplerate[(s->ctrl & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL], p);
 
         case SOUND_PCM_READ_CHANNELS:
-		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, p);
 
         case SOUND_PCM_READ_BITS:
-		return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -2251,7 +2255,7 @@ static /*const*/ struct file_operations es1370_dac_fops = {
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t es1370_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1370_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1370_state *s = (struct es1370_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -2314,7 +2318,7 @@ static ssize_t es1370_midi_read(struct file *file, char *buffer, size_t count, l
 	return ret;
 }
 
-static ssize_t es1370_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1370_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1370_state *s = (struct es1370_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index 3cc4fb2e7..7d1a108dd 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -1170,7 +1170,7 @@ static int mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned lon
 		return 0;
 
 	case SOUND_MIXER_WRITE_PCM:   /* use SRC for PCM volume */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)arg))
 			return -EFAULT;
 		right = ((val >> 8)  & 0xff);
 		left = (val  & 0xff);
@@ -1186,7 +1186,7 @@ static int mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned lon
 		return 0;
 	
 	case SOUND_MIXER_READ_PCM:
-		return put_user(s->spdif_volume, (int *)arg);
+		return put_user(s->spdif_volume, (int __user *)arg);
 	}
 	return codec->mixer_ioctl(codec, cmd, arg);
 }
@@ -1324,7 +1324,7 @@ static int drain_dac2(struct es1371_state *s, int nonblock)
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t es1371_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1371_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1371_state *s = (struct es1371_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1403,7 +1403,7 @@ out2:
 	return ret;
 }
 
-static ssize_t es1371_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1371_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1371_state *s = (struct es1371_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1578,13 +1578,15 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
         count_info cinfo;
 	int count;
 	int val, mapped, ret;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
         mapped = ((file->f_mode & FMODE_WRITE) && s->dma_dac2.mapped) ||
 		((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
@@ -1595,7 +1597,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
@@ -1611,7 +1613,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -1625,10 +1627,10 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 				set_dac2_rate(s, val);
 			}
 		}
-		return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, p);
 
         case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			stop_adc(s);
@@ -1655,7 +1657,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -1681,13 +1683,13 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 				spin_unlock_irqrestore(&s->lock, flags);
 			}
 		}
-		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, p);
 		
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+                return put_user(AFMT_S16_LE|AFMT_U8, p);
 		
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			if (file->f_mode & FMODE_READ) {
@@ -1714,7 +1716,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 		}
 		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 
-				AFMT_S16_LE : AFMT_U8, (int *)arg);
+				AFMT_S16_LE : AFMT_U8, p);
 		
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -1725,10 +1727,10 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			val |= PCM_ENABLE_INPUT;
 		if (file->f_mode & FMODE_WRITE && s->ctrl & CTRL_DAC2_EN) 
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -1769,7 +1771,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                 abinfo.fragstotal = s->dma_dac2.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac2.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -1786,7 +1788,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                 abinfo.fragstotal = s->dma_adc.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -1803,7 +1805,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (count < 0)
 			count = 0;
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
         case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -1821,7 +1823,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1841,7 +1843,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (s->dma_dac2.mapped)
 			s->dma_dac2.count &= s->dma_dac2.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1849,14 +1851,14 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf_dac2(s)))
 				return val;
-			return put_user(s->dma_dac2.fragsize, (int *)arg);
+			return put_user(s->dma_dac2.fragsize, p);
 		}
 		if ((val = prog_dmabuf_adc(s)))
 			return val;
-		return put_user(s->dma_adc.fragsize, (int *)arg);
+		return put_user(s->dma_adc.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			s->dma_adc.ossfragshift = val & 0xffff;
@@ -1884,7 +1886,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac2.subdivision))
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -1895,13 +1897,13 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, p);
 
         case SOUND_PCM_READ_CHANNELS:
-		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, p);
 		
         case SOUND_PCM_READ_BITS:
-		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 16 : 8, (int *)arg);
+		return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 16 : 8, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -2017,7 +2019,7 @@ static /*const*/ struct file_operations es1371_audio_fops = {
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t es1371_write_dac(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1371_write_dac(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1371_state *s = (struct es1371_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -2149,11 +2151,12 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
         count_info cinfo;
 	int count;
 	int val, ret;
+	int __user *p = (int __user *)arg;
 
 	VALIDATE_STATE(s);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		return drain_dac1(s, 0/*file->f_flags & O_NONBLOCK*/);
@@ -2162,7 +2165,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return -EINVAL;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		stop_dac1(s);
@@ -2171,17 +2174,17 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			stop_dac1(s);
 			s->dma_dac1.ready = 0;
 			set_dac1_rate(s, val);
 		}
-		return put_user(s->dac1rate, (int *)arg);
+		return put_user(s->dac1rate, p);
 
         case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		stop_dac1(s);
 		s->dma_dac1.ready = 0;
@@ -2195,7 +2198,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			stop_dac1(s);
@@ -2208,13 +2211,13 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 			outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, p);
 		
         case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+                return put_user(AFMT_S16_LE|AFMT_U8, p);
 		
         case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			stop_dac1(s);
@@ -2227,16 +2230,16 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 			outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
-		return put_user((s->sctrl & SCTRL_P1SEB) ? AFMT_S16_LE : AFMT_U8, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SEB) ? AFMT_S16_LE : AFMT_U8, p);
 
         case SNDCTL_DSP_POST:
                 return 0;
 
         case SNDCTL_DSP_GETTRIGGER:
-		return put_user((s->ctrl & CTRL_DAC1_EN) ? PCM_ENABLE_OUTPUT : 0, (int *)arg);
+		return put_user((s->ctrl & CTRL_DAC1_EN) ? PCM_ENABLE_OUTPUT : 0, p);
 						
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val & PCM_ENABLE_OUTPUT) {
 			if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2262,7 +2265,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
                 abinfo.fragstotal = s->dma_dac1.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac1.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -2277,7 +2280,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (count < 0)
 			count = 0;
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
         case SNDCTL_DSP_GETOPTR:
 		if (!s->dma_dac1.ready && (val = prog_dmabuf_dac1(s)) != 0)
@@ -2293,17 +2296,17 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		if (s->dma_dac1.mapped)
 			s->dma_dac1.count &= s->dma_dac1.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user((void __user *)arg, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
         case SNDCTL_DSP_GETBLKSIZE:
 		if ((val = prog_dmabuf_dac1(s)))
 			return val;
-                return put_user(s->dma_dac1.fragsize, (int *)arg);
+                return put_user(s->dma_dac1.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		s->dma_dac1.ossfragshift = val & 0xffff;
 		s->dma_dac1.ossmaxfrags = (val >> 16) & 0xffff;
@@ -2318,7 +2321,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
         case SNDCTL_DSP_SUBDIVIDE:
 		if (s->dma_dac1.subdivision)
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2326,13 +2329,13 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user(s->dac1rate, (int *)arg);
+		return put_user(s->dac1rate, p);
 
         case SOUND_PCM_READ_CHANNELS:
-		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, p);
 
         case SOUND_PCM_READ_BITS:
-		return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, (int *)arg);
+		return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -2430,7 +2433,7 @@ static /*const*/ struct file_operations es1371_dac_fops = {
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t es1371_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1371_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1371_state *s = (struct es1371_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -2493,7 +2496,7 @@ static ssize_t es1371_midi_read(struct file *file, char *buffer, size_t count, l
 	return ret;
 }
 
-static ssize_t es1371_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t es1371_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct es1371_state *s = (struct es1371_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index cbd78ed95..b5096b5a4 100644
--- a/sound/oss/esssolo1.c
+++ b/sound/oss/esssolo1.c
@@ -694,37 +694,38 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 	};
 	unsigned char l, r, rl, rr, vidx;
 	int i, val;
+	int __user *p = (int __user *)arg;
 
 	VALIDATE_STATE(s);
 
 	if (cmd == SOUND_MIXER_PRIVATE1) {
 		/* enable/disable/query mixer preamp */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != -1) {
 			val = val ? 0xff : 0xf7;
 			write_mixer(s, 0x7d, (read_mixer(s, 0x7d) | 0x08) & val);
 		}
 		val = (read_mixer(s, 0x7d) & 0x08) ? 1 : 0;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE2) {
 		/* enable/disable/query spatializer */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != -1) {
 			val &= 0x3f;
 			write_mixer(s, 0x52, val);
 			write_mixer(s, 0x50, val ? 0x08 : 0);
 		}
-		return put_user(read_mixer(s, 0x52), (int *)arg);
+		return put_user(read_mixer(s, 0x52), p);
 	}
         if (cmd == SOUND_MIXER_INFO) {
 		mixer_info info;
 		strncpy(info.id, "Solo1", sizeof(info.id));
 		strncpy(info.name, "ESS Solo1", sizeof(info.name));
 		info.modify_counter = s->mix.modcnt;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -732,41 +733,41 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 		_old_mixer_info info;
 		strncpy(info.id, "Solo1", sizeof(info.id));
 		strncpy(info.name, "ESS Solo1", sizeof(info.name));
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 	if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
         if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-			return put_user(mixer_src[read_mixer(s, 0x1c) & 7], (int *)arg);
+			return put_user(mixer_src[read_mixer(s, 0x1c) & 7], p);
 
                 case SOUND_MIXER_DEVMASK: /* Arg contains a bit for each supported device */
 			return put_user(SOUND_MASK_PCM | SOUND_MASK_SYNTH | SOUND_MASK_CD |
 					SOUND_MASK_LINE | SOUND_MASK_LINE1 | SOUND_MASK_MIC |
 					SOUND_MASK_VOLUME | SOUND_MASK_LINE2 | SOUND_MASK_RECLEV |
-					SOUND_MASK_SPEAKER, (int *)arg);
+					SOUND_MASK_SPEAKER, p);
 
                 case SOUND_MIXER_RECMASK: /* Arg contains a bit for each supported recording source */
-			return put_user(SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD | SOUND_MASK_VOLUME, (int *)arg);
+			return put_user(SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD | SOUND_MASK_VOLUME, p);
 
                 case SOUND_MIXER_STEREODEVS: /* Mixer channels supporting stereo */
 			return put_user(SOUND_MASK_PCM | SOUND_MASK_SYNTH | SOUND_MASK_CD |
 					SOUND_MASK_LINE | SOUND_MASK_LINE1 | SOUND_MASK_MIC |
-					SOUND_MASK_VOLUME | SOUND_MASK_LINE2 | SOUND_MASK_RECLEV, (int *)arg);
+					SOUND_MASK_VOLUME | SOUND_MASK_LINE2 | SOUND_MASK_RECLEV, p);
 			
                 case SOUND_MIXER_CAPS:
-			return put_user(SOUND_CAP_EXCL_INPUT, (int *)arg);
+			return put_user(SOUND_CAP_EXCL_INPUT, p);
 
 		default:
 			i = _IOC_NR(cmd);
                         if (i >= SOUND_MIXER_NRDEVICES || !(vidx = mixtable1[i]))
                                 return -EINVAL;
-			return put_user(s->mix.vol[vidx-1], (int *)arg);
+			return put_user(s->mix.vol[vidx-1], p);
 		}
 	}
         if (_SIOC_DIR(cmd) != (_SIOC_READ|_SIOC_WRITE)) 
@@ -788,7 +789,7 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 			       0xb4, read_ctrl(s, 0xb4));
 		}
 #endif
-	        if (get_user(val, (int *)arg))
+	        if (get_user(val, p))
 			return -EFAULT;
                 i = hweight32(val);
                 if (i == 0)
@@ -805,7 +806,7 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 		return 0;
 
 	case SOUND_MIXER_VOLUME:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -834,10 +835,10 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 #else
                 s->mix.vol[9] = val;
 #endif
-		return put_user(s->mix.vol[9], (int *)arg);
+		return put_user(s->mix.vol[9], p);
 
 	case SOUND_MIXER_SPEAKER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = val & 0xff;
 		if (l > 100)
@@ -852,10 +853,10 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 #else
                 s->mix.vol[7] = val;
 #endif
-		return put_user(s->mix.vol[7], (int *)arg);
+		return put_user(s->mix.vol[7], p);
 
 	case SOUND_MIXER_RECLEV:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = (val << 1) & 0x1fe;
 		if (l > 200)
@@ -877,13 +878,13 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 #else
                 s->mix.vol[8] = val;
 #endif
-		return put_user(s->mix.vol[8], (int *)arg);
+		return put_user(s->mix.vol[8], p);
 
 	default:
 		i = _IOC_NR(cmd);
 		if (i >= SOUND_MIXER_NRDEVICES || !(vidx = mixtable1[i]))
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = (val << 1) & 0x1fe;
 		if (l > 200)
@@ -905,7 +906,7 @@ static int mixer_ioctl(struct solo1_state *s, unsigned int cmd, unsigned long ar
 #else
                 s->mix.vol[vidx-1] = val;
 #endif
-		return put_user(s->mix.vol[vidx-1], (int *)arg);
+		return put_user(s->mix.vol[vidx-1], p);
 	}
 }
 
@@ -999,7 +1000,7 @@ static int drain_dac(struct solo1_state *s, int nonblock)
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t solo1_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t solo1_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct solo1_state *s = (struct solo1_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1095,7 +1096,7 @@ static ssize_t solo1_read(struct file *file, char *buffer, size_t count, loff_t
 	return ret;
 }
 
-static ssize_t solo1_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t solo1_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct solo1_state *s = (struct solo1_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1263,13 +1264,15 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	int val, mapped, ret, count;
         int div1, div2;
         unsigned rate1, rate2;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
         mapped = ((file->f_mode & FMODE_WRITE) && s->dma_dac.mapped) ||
 		((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
@@ -1280,7 +1283,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
@@ -1297,7 +1300,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			stop_adc(s);
@@ -1322,10 +1325,10 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			s->clkdiv = div1;
 			prog_codec(s);
 		}
-		return put_user(s->rate, (int *)arg);
+		return put_user(s->rate, p);
 		
         case SNDCTL_DSP_STEREO:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		stop_adc(s);
 		stop_dac(s);
@@ -1336,7 +1339,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			stop_adc(s);
@@ -1346,13 +1349,13 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			s->channels = (val >= 2) ? 2 : 1;
 			prog_codec(s);
 		}
-		return put_user(s->channels, (int *)arg);
+		return put_user(s->channels, p);
 
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U16_LE|AFMT_S8|AFMT_U8, (int *)arg);
+                return put_user(AFMT_S16_LE|AFMT_U16_LE|AFMT_S8|AFMT_U8, p);
 
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			stop_adc(s);
@@ -1365,7 +1368,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			s->fmt = val;
 			prog_codec(s);
 		}
-		return put_user(s->fmt, (int *)arg);
+		return put_user(s->fmt, p);
 
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -1376,10 +1379,10 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			val |= PCM_ENABLE_INPUT;
 		if (file->f_mode & s->ena & FMODE_WRITE)
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -1422,7 +1425,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                 abinfo.fragstotal = s->dma_dac.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -1436,7 +1439,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                 abinfo.fragstotal = s->dma_adc.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -1453,7 +1456,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (count < 0)
 			count = 0;
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
         case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -1468,7 +1471,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1494,7 +1497,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		       cinfo.bytes, cinfo.blocks, cinfo.ptr, s->dma_dac.buforder, s->dma_dac.numfrag, s->dma_dac.fragshift,
 		       s->dma_dac.swptr, s->dma_dac.count, s->dma_dac.fragsize, s->dma_dac.dmasize, s->dma_dac.fragsamples);
 #endif
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1502,14 +1505,14 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf_dac(s)))
 				return val;
-			return put_user(s->dma_dac.fragsize, (int *)arg);
+			return put_user(s->dma_dac.fragsize, p);
 		}
 		if ((val = prog_dmabuf_adc(s)))
 			return val;
-		return put_user(s->dma_adc.fragsize, (int *)arg);
+		return put_user(s->dma_adc.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			s->dma_adc.ossfragshift = val & 0xffff;
@@ -1537,7 +1540,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac.subdivision))
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -1548,13 +1551,13 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user(s->rate, (int *)arg);
+		return put_user(s->rate, p);
 
         case SOUND_PCM_READ_CHANNELS:
-		return put_user(s->channels, (int *)arg);
+		return put_user(s->channels, p);
 
         case SOUND_PCM_READ_BITS:
-		return put_user((s->fmt & (AFMT_S8|AFMT_U8)) ? 8 : 16, (int *)arg);
+		return put_user((s->fmt & (AFMT_S8|AFMT_U8)) ? 8 : 16, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -1727,7 +1730,7 @@ static void solo1_midi_timer(unsigned long data)
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t solo1_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t solo1_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct solo1_state *s = (struct solo1_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1790,7 +1793,7 @@ static ssize_t solo1_midi_read(struct file *file, char *buffer, size_t count, lo
 	return ret;
 }
 
-static ssize_t solo1_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t solo1_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct solo1_state *s = (struct solo1_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -2032,7 +2035,7 @@ static int solo1_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
 	case FM_IOCTL_PLAY_NOTE:
-		if (copy_from_user(&n, (void *)arg, sizeof(n)))
+		if (copy_from_user(&n, (void __user *)arg, sizeof(n)))
 			return -EFAULT;
 		if (n.voice >= 18)
 			return -EINVAL;
@@ -2050,7 +2053,7 @@ static int solo1_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
 	case FM_IOCTL_SET_VOICE:
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void __user *)arg, sizeof(v)))
 			return -EFAULT;
 		if (v.voice >= 18)
 			return -EINVAL;
@@ -2080,7 +2083,7 @@ static int solo1_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int
 		return 0;
 		
 	case FM_IOCTL_SET_PARAMS:
-		if (copy_from_user(&p, (void *)arg, sizeof(p)))
+		if (copy_from_user(&p, (void __user *)arg, sizeof(p)))
 			return -EFAULT;
 		outb(0x08, s->sbbase);
 		outb((p.kbd_split & 1) << 6, s->sbbase+1);
diff --git a/sound/oss/forte.c b/sound/oss/forte.c
index 06a31b765..c7e23fc3c 100644
--- a/sound/oss/forte.c
+++ b/sound/oss/forte.c
@@ -849,6 +849,8 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 	struct forte_chip *chip;
 	struct audio_buf_info abi;
 	struct count_info cinfo;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	chip = file->private_data;
 	
@@ -865,24 +867,24 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 	switch (cmd) {
 
 	case OSS_GETVERSION:
-		return put_user (SOUND_VERSION, (int *) arg);
+		return put_user (SOUND_VERSION, p);
 
 	case SNDCTL_DSP_GETCAPS:
 		DPRINTK ("%s: GETCAPS\n", __FUNCTION__);
 
 		ival = FORTE_CAPS; /* DUPLEX */
-		return put_user (ival, (int *) arg);
+		return put_user (ival, p);
 
 	case SNDCTL_DSP_GETFMTS:
 		DPRINTK ("%s: GETFMTS\n", __FUNCTION__);
 
 		ival = FORTE_FMTS; /* U8, 16LE */
-		return put_user (ival, (int *) arg);
+		return put_user (ival, p);
 
 	case SNDCTL_DSP_SETFMT:	/* U8, 16LE */
 		DPRINTK ("%s: SETFMT\n", __FUNCTION__);
 
-		if (get_user (ival, (int *) arg))
+		if (get_user (ival, p))
 			return -EFAULT;
 
 		spin_lock_irq (&chip->lock);
@@ -899,12 +901,12 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 	
-		return put_user (rval, (int *) arg);
+		return put_user (rval, p);
 
 	case SNDCTL_DSP_STEREO:	/* 0 - mono, 1 - stereo */
 		DPRINTK ("%s: STEREO\n", __FUNCTION__);
 
-		if (get_user (ival, (int *) arg))
+		if (get_user (ival, p))
 			return -EFAULT;
 
 		spin_lock_irq (&chip->lock);
@@ -921,12 +923,12 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-                return put_user (rval, (int *) arg);
+                return put_user (rval, p);
 
 	case SNDCTL_DSP_CHANNELS: /* 1 - mono, 2 - stereo */
 		DPRINTK ("%s: CHANNELS\n", __FUNCTION__);
 
-		if (get_user (ival, (int *) arg))
+		if (get_user (ival, p))
 			return -EFAULT;
 
 		spin_lock_irq (&chip->lock);
@@ -943,12 +945,12 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-                return put_user (rval, (int *) arg);
+                return put_user (rval, p);
 
 	case SNDCTL_DSP_SPEED:
 		DPRINTK ("%s: SPEED\n", __FUNCTION__);
 
-		if (get_user (ival, (int *) arg))
+		if (get_user (ival, p))
                         return -EFAULT;
 
 		spin_lock_irq (&chip->lock);
@@ -965,7 +967,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-                return put_user(rval, (int*) arg);
+                return put_user(rval, p);
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		DPRINTK ("%s: GETBLKSIZE\n", __FUNCTION__);
@@ -980,7 +982,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-                return put_user (ival, (int *) arg);
+                return put_user (ival, p);
 
 	case SNDCTL_DSP_RESET:
 		DPRINTK ("%s: RESET\n", __FUNCTION__);
@@ -1022,7 +1024,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 	case SNDCTL_DSP_SETFRAGMENT:
 		DPRINTK ("%s: SETFRAGMENT\n", __FUNCTION__);
 
-		if (get_user (ival, (int *) arg))
+		if (get_user (ival, p))
 			return -EFAULT;
 
 		spin_lock_irq (&chip->lock);
@@ -1041,7 +1043,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-		return put_user (ival, (int *) arg);
+		return put_user (ival, p);
                 
         case SNDCTL_DSP_GETISPACE:
 		DPRINTK ("%s: GETISPACE\n", __FUNCTION__);
@@ -1065,7 +1067,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-		return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0;
+		return copy_to_user (argp, &abi, sizeof (abi)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETIPTR:
 		DPRINTK ("%s: GETIPTR\n", __FUNCTION__);
@@ -1086,7 +1088,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-		return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
+		return copy_to_user (argp, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
 
         case SNDCTL_DSP_GETOSPACE:
 		if (!wr)
@@ -1114,7 +1116,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 		
-		return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0;
+		return copy_to_user (argp, &abi, sizeof (abi)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETOPTR:
 		if (!wr)
@@ -1133,7 +1135,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-		return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
+		return copy_to_user (argp, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETODELAY:
 		if (!wr)
@@ -1157,7 +1159,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 
 		spin_unlock_irq (&chip->lock);
 
-		return put_user (ival, (int *) arg);
+		return put_user (ival, p);
 
 	case SNDCTL_DSP_SETDUPLEX:
 		DPRINTK ("%s: SETDUPLEX\n", __FUNCTION__);
@@ -1167,11 +1169,11 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 	case SNDCTL_DSP_GETTRIGGER:
 		DPRINTK ("%s: GETTRIGGER\n", __FUNCTION__);
 		
-		return put_user (chip->trigger, (int *) arg);
+		return put_user (chip->trigger, p);
 		
 	case SNDCTL_DSP_SETTRIGGER:
 
-		if (get_user (ival, (int *) arg))
+		if (get_user (ival, p))
 			return -EFAULT;
 
 		DPRINTK ("%s: SETTRIGGER %d\n", __FUNCTION__, ival);
@@ -1207,15 +1209,15 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 		
 	case SOUND_PCM_READ_RATE:
 		DPRINTK ("%s: PCM_READ_RATE\n", __FUNCTION__);		
-		return put_user (chip->play.rate, (int *) arg);
+		return put_user (chip->play.rate, p);
 
 	case SOUND_PCM_READ_CHANNELS:
 		DPRINTK ("%s: PCM_READ_CHANNELS\n", __FUNCTION__);
-		return put_user (chip->play.stereo, (int *) arg);
+		return put_user (chip->play.stereo, p);
 
 	case SOUND_PCM_READ_BITS:
 		DPRINTK ("%s: PCM_READ_BITS\n", __FUNCTION__);		
-		return put_user (chip->play.format, (int *) arg);
+		return put_user (chip->play.format, p);
 
 	case SNDCTL_DSP_NONBLOCK:
 		DPRINTK ("%s: DSP_NONBLOCK\n", __FUNCTION__);		
@@ -1223,7 +1225,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 
 	default:
-		DPRINTK ("Unsupported ioctl: %x (%p)\n", cmd, (void *) arg);
+		DPRINTK ("Unsupported ioctl: %x (%p)\n", cmd, argp);
 		break;
 	}
 
@@ -1428,7 +1430,7 @@ forte_dsp_mmap (struct file *file, struct vm_area_struct *vma)
  */
 
 static ssize_t 
-forte_dsp_write (struct file *file, const char *buffer, size_t bytes, 
+forte_dsp_write (struct file *file, const char __user *buffer, size_t bytes, 
 		 loff_t *ppos)
 {
 	struct forte_chip *chip;
@@ -1536,7 +1538,7 @@ forte_dsp_write (struct file *file, const char *buffer, size_t bytes,
  */
 
 static ssize_t 
-forte_dsp_read (struct file *file, char *buffer, size_t bytes, 
+forte_dsp_read (struct file *file, char __user *buffer, size_t bytes, 
 		loff_t *ppos)
 {
 	struct forte_chip *chip;
diff --git a/sound/oss/gus.h b/sound/oss/gus.h
index 45b60fac1..3d5271baf 100644
--- a/sound/oss/gus.h
+++ b/sound/oss/gus.h
@@ -13,7 +13,7 @@ void gus_voice_irq(void);
 void gus_write8(int reg, unsigned int data);
 void guswave_dma_irq(void);
 void gus_delay(void);
-int gus_default_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg);
+int gus_default_mixer_ioctl (int dev, unsigned int cmd, void __user *arg);
 void gus_timer_command (unsigned int addr, unsigned int val);
 
 /*	From gus_midi.c */
diff --git a/sound/oss/gus_wave.c b/sound/oss/gus_wave.c
index 1aadc7e68..35ade6b85 100644
--- a/sound/oss/gus_wave.c
+++ b/sound/oss/gus_wave.c
@@ -1045,7 +1045,7 @@ int __init gus_wave_detect(int baseaddr)
 	return 1;
 }
 
-static int guswave_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int guswave_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 
 	switch (cmd) 
@@ -1622,7 +1622,7 @@ static void guswave_close(int dev)
 		DMAbuf_close_dma(gus_devnum);
 }
 
-static int guswave_load_patch(int dev, int format, const char *addr,
+static int guswave_load_patch(int dev, int format, const char __user *addr,
 		   int offs, int count, int pmgr_flag)
 {
 	struct patch_info patch;
@@ -1780,7 +1780,7 @@ static int guswave_load_patch(int dev, int format, const char *addr,
 
 			for (i = 0; i < blk_sz; i++)
 			{
-				get_user(*(unsigned char *) &data, (unsigned char *) &((addr)[sizeof_patch + i]));
+				get_user(*(unsigned char *) &data, (unsigned char __user *) &((addr)[sizeof_patch + i]));
 				if (patch.mode & WAVE_UNSIGNED)
 					if (!(patch.mode & WAVE_16_BITS) || (i & 0x01))
 						data ^= 0x80;	/* Convert to signed */
@@ -2082,14 +2082,14 @@ static int gus_audio_set_bits(int bits)
 	return bits;
 }
 
-static int gus_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int gus_audio_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int val;
 
 	switch (cmd) 
 	{
 		case SOUND_PCM_WRITE_RATE:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user*)arg))
 				return -EFAULT;
 			val = gus_audio_set_speed(val);
 			break;
@@ -2099,13 +2099,13 @@ static int gus_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			break;
 
 		case SNDCTL_DSP_STEREO:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user *)arg))
 				return -EFAULT;
 			val = gus_audio_set_channels(val + 1) - 1;
 			break;
 
 		case SOUND_PCM_WRITE_CHANNELS:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user *)arg))
 				return -EFAULT;
 			val = gus_audio_set_channels(val);
 			break;
@@ -2115,7 +2115,7 @@ static int gus_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			break;
 		
 		case SNDCTL_DSP_SETFMT:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user *)arg))
 				return -EFAULT;
 			val = gus_audio_set_bits(val);
 			break;
@@ -2131,7 +2131,7 @@ static int gus_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		default:
 			return -EINVAL;
 	}
-	return put_user(val, (int *)arg);
+	return put_user(val, (int __user *)arg);
 }
 
 static void gus_audio_reset(int dev)
@@ -2687,19 +2687,19 @@ static void set_input_volumes(void)
 #define MIX_DEVS	(SOUND_MASK_MIC|SOUND_MASK_LINE| \
 			 SOUND_MASK_SYNTH|SOUND_MASK_PCM)
 
-int gus_default_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+int gus_default_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int vol, val;
 
 	if (((cmd >> 8) & 0xff) != 'M')
 		return -EINVAL;
 
-	if (!access_ok(VERIFY_WRITE, (int *)arg, sizeof(int)))
+	if (!access_ok(VERIFY_WRITE, arg, sizeof(int)))
 		return -EFAULT;
 
 	if (_SIOC_DIR(cmd) & _SIOC_WRITE) 
 	{
-		if (__get_user(val, (int *) arg))
+		if (__get_user(val, (int __user *) arg))
 			return -EFAULT;
 
 		switch (cmd & 0xff) 
@@ -2810,7 +2810,7 @@ int gus_default_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 				return -EINVAL;
 		}
 	}
-	return __put_user(val, (int *)arg);
+	return __put_user(val, (int __user *)arg);
 }
 
 static struct mixer_operations gus_mixer_operations =
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index cb693b05c..e4f8542b3 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -99,54 +99,14 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
+#include <linux/bitops.h>
 #include <asm/uaccess.h>
 #include <asm/hardirq.h>
 
-#ifndef PCI_DEVICE_ID_INTEL_82801
-#define PCI_DEVICE_ID_INTEL_82801	0x2415
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_82901
-#define PCI_DEVICE_ID_INTEL_82901	0x2425
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_ICH2
-#define PCI_DEVICE_ID_INTEL_ICH2	0x2445
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_ICH3
-#define PCI_DEVICE_ID_INTEL_ICH3	0x2485
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_ICH4
-#define PCI_DEVICE_ID_INTEL_ICH4	0x24c5
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_ICH5
-#define PCI_DEVICE_ID_INTEL_ICH5	0x24d5
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_ICH6_3
-#define PCI_DEVICE_ID_INTEL_ICH6_3	0x266e
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_440MX
-#define PCI_DEVICE_ID_INTEL_440MX	0x7195
-#endif
-#ifndef PCI_DEVICE_ID_INTEL_ESB_5
-#define PCI_DEVICE_ID_INTEL_ESB_5	0x25a6
-#endif
-#ifndef PCI_DEVICE_ID_SI_7012
-#define PCI_DEVICE_ID_SI_7012		0x7012
-#endif
-#ifndef PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO
-#define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO	0x01b1
-#endif
-#ifndef PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO
-#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO	0x006a
-#endif
-#ifndef PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO
-#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO	0x00da
-#endif
-#ifndef PCI_DEVICE_ID_AMD_768_AUDIO
-#define PCI_DEVICE_ID_AMD_768_AUDIO	0x7445
-#endif
-#ifndef PCI_DEVICE_ID_AMD_8111_AC97
-#define PCI_DEVICE_ID_AMD_8111_AC97	0x746d
-#endif
+#define DRIVER_VERSION "1.01"
+
+#define MODULOP2(a, b) ((a) & ((b) - 1))
+#define MASKP2(a, b) ((a) & ~((b) - 1))
 
 static int ftsodell;
 static int strict_clocking;
@@ -209,6 +169,7 @@ struct i810_channel
 
 #define ENUM_ENGINE(PRE,DIG) 									\
 enum {												\
+	PRE##_BASE =	0x##DIG##0,		/* Base Address */				\
 	PRE##_BDBAR =	0x##DIG##0,		/* Buffer Descriptor list Base Address */	\
 	PRE##_CIV =	0x##DIG##4,		/* Current Index Value */			\
 	PRE##_LVI =	0x##DIG##5,		/* Last Valid Index */				\
@@ -256,8 +217,6 @@ enum {
 #define INT_GPI		(1<<0)
 #define INT_MASK (INT_SEC|INT_PRI|INT_MC|INT_PO|INT_PI|INT_MO|INT_NI|INT_GPI)
 
-#define DRIVER_VERSION "0.24"
-
 /* magic numbers to protect our data structures */
 #define I810_CARD_MAGIC		0x5072696E /* "Prin" */
 #define I810_STATE_MAGIC	0x63657373 /* "cess" */
@@ -323,19 +282,19 @@ static struct {
 };
 
 static struct pci_device_id i810_pci_tbl [] = {
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_5,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82901,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_5,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82901AB},
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_440MX,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTEL440MX},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH2,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_4,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH2},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH3,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_5,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH3},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH4,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_5,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH5,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_5,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH5},
 	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7012,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, SI7012},
@@ -345,13 +304,13 @@ static struct pci_device_id i810_pci_tbl [] = {
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, NVIDIA_NFORCE},
 	{PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, NVIDIA_NFORCE},
-	{PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_768_AUDIO,
+	{PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7445,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD768},
-	{PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_AC97,
+	{PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_AUDIO,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD8111},
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_5,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_3,
+	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_18,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4},
 
 	{0,}
@@ -491,8 +450,12 @@ struct i810_card {
 /* extract register offset from codec struct */
 #define IO_REG_OFF(codec) (((struct i810_card *) codec->private_data)->ac97_id_map[codec->id])
 
+#define GET_CIV(port) MODULOP2(inb((port) + OFF_CIV), SG_LEN)
+#define GET_LVI(port) MODULOP2(inb((port) + OFF_LVI), SG_LEN)
+
 /* set LVI from CIV */
-#define CIV_TO_LVI(port, off) outb((inb(port+OFF_CIV)+off) & 31, port+OFF_LVI)
+#define CIV_TO_LVI(port, off) \
+	outb(MODULOP2(GET_CIV((port)) + (off), SG_LEN), (port) + OFF_LVI)
 
 static struct i810_card *devs = NULL;
 
@@ -762,7 +725,7 @@ static inline unsigned i810_get_dma_addr(struct i810_state *state, int rec)
 		port_picb = port + OFF_PICB;
 
 	do {
-		civ = inb(port+OFF_CIV) & 31;
+		civ = GET_CIV(port);
 		offset = inw(port_picb);
 		/* Must have a delay here! */ 
 		if(offset == 0)
@@ -782,7 +745,7 @@ static inline unsigned i810_get_dma_addr(struct i810_state *state, int rec)
 		 * that we won't have to worry about the chip still being
 		 * out of sync with reality ;-)
 		 */
-	} while (civ != (inb(port+OFF_CIV) & 31) || offset != inw(port_picb));
+	} while (civ != GET_CIV(port) || offset != inw(port_picb));
 		 
 	return (((civ + 1) * dmabuf->fragsize - (bytes * offset))
 		% dmabuf->dmasize);
@@ -992,6 +955,7 @@ static int prog_dmabuf(struct i810_state *state, unsigned rec)
 	dmabuf->numfrag = SG_LEN;
 	dmabuf->fragsize = dmabuf->dmasize/dmabuf->numfrag;
 	dmabuf->fragsamples = dmabuf->fragsize >> 1;
+	dmabuf->fragshift = ffs(dmabuf->fragsize) - 1;
 	dmabuf->userfragsize = dmabuf->ossfragsize;
 	dmabuf->userfrags = dmabuf->dmasize/dmabuf->ossfragsize;
 
@@ -999,16 +963,12 @@ static int prog_dmabuf(struct i810_state *state, unsigned rec)
 
 	if(dmabuf->ossmaxfrags == 4) {
 		fragint = 8;
-		dmabuf->fragshift = 2;
 	} else if (dmabuf->ossmaxfrags == 8) {
 		fragint = 4;
-		dmabuf->fragshift = 3;
 	} else if (dmabuf->ossmaxfrags == 16) {
 		fragint = 2;
-		dmabuf->fragshift = 4;
 	} else {
 		fragint = 1;
-		dmabuf->fragshift = 5;
 	}
 	/*
 	 *	Now set up the ring 
@@ -1072,41 +1032,41 @@ static void __i810_update_lvi(struct i810_state *state, int rec)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	int x, port;
-	
+	int trigger;
+	int count, fragsize;
+	void (*start)(struct i810_state *);
+
+	count = dmabuf->count;
 	port = state->card->iobase;
-	if(rec)
+	if (rec) {
 		port += dmabuf->read_channel->port;
-	else
+		trigger = PCM_ENABLE_INPUT;
+		start = __start_adc;
+		count = dmabuf->dmasize - count;
+	} else {
 		port += dmabuf->write_channel->port;
+		trigger = PCM_ENABLE_OUTPUT;
+		start = __start_dac;
+	}
+
+	/* Do not process partial fragments. */
+	fragsize = dmabuf->fragsize;
+	if (count < fragsize)
+		return;
 
-	/* if we are currently stopped, then our CIV is actually set to our
-	 * *last* sg segment and we are ready to wrap to the next.  However,
-	 * if we set our LVI to the last sg segment, then it won't wrap to
-	 * the next sg segment, it won't even get a start.  So, instead, when
-	 * we are stopped, we set both the LVI value and also we increment
-	 * the CIV value to the next sg segment to be played so that when
-	 * we call start_{dac,adc}, things will operate properly
-	 */
 	if (!dmabuf->enable && dmabuf->ready) {
-		if(rec && dmabuf->count < dmabuf->dmasize &&
-		   (dmabuf->trigger & PCM_ENABLE_INPUT))
-		{
-			CIV_TO_LVI(port, 1);
-			__start_adc(state);
-			while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
-		} else if (!rec && dmabuf->count &&
-			   (dmabuf->trigger & PCM_ENABLE_OUTPUT))
-		{
-			CIV_TO_LVI(port, 1);
-			__start_dac(state);
-			while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
-		}
+		if (!(dmabuf->trigger & trigger))
+			return;
+
+		start(state);
+		while (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
+			;
 	}
 
-	/* swptr - 1 is the tail of our transfer */
-	x = (dmabuf->dmasize + dmabuf->swptr - 1) % dmabuf->dmasize;
-	x /= dmabuf->fragsize;
-	outb(x, port+OFF_LVI);
+	/* MASKP2(swptr, fragsize) - 1 is the tail of our transfer */
+	x = MODULOP2(MASKP2(dmabuf->swptr, fragsize) - 1, dmabuf->dmasize);
+	x >>= dmabuf->fragshift;
+	outb(x, port + OFF_LVI);
 }
 
 static void i810_update_lvi(struct i810_state *state, int rec)
@@ -1126,13 +1086,17 @@ static void i810_update_ptr(struct i810_state *state)
 {
 	struct dmabuf *dmabuf = &state->dmabuf;
 	unsigned hwptr;
+	unsigned fragmask, dmamask;
 	int diff;
 
-	/* error handling and process wake up for DAC */
+	fragmask = MASKP2(~0, dmabuf->fragsize);
+	dmamask = MODULOP2(~0, dmabuf->dmasize);
+
+	/* error handling and process wake up for ADC */
 	if (dmabuf->enable == ADC_RUNNING) {
 		/* update hardware pointer */
-		hwptr = i810_get_dma_addr(state, 1);
-		diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
+		hwptr = i810_get_dma_addr(state, 1) & fragmask;
+		diff = (hwptr - dmabuf->hwptr) & dmamask;
 #if defined(DEBUG_INTERRUPTS) || defined(DEBUG_MMAP)
 		printk("ADC HWP %d,%d,%d\n", hwptr, dmabuf->hwptr, diff);
 #endif
@@ -1144,20 +1108,20 @@ static void i810_update_ptr(struct i810_state *state)
 			/* this is normal for the end of a read */
 			/* only give an error if we went past the */
 			/* last valid sg entry */
-			if((inb(state->card->iobase + PI_CIV) & 31) !=
-			   (inb(state->card->iobase + PI_LVI) & 31)) {
+			if (GET_CIV(state->card->iobase + PI_BASE) !=
+			    GET_LVI(state->card->iobase + PI_BASE)) {
 				printk(KERN_WARNING "i810_audio: DMA overrun on read\n");
 				dmabuf->error++;
 			}
 		}
-		if (dmabuf->count > dmabuf->userfragsize)
+		if (diff)
 			wake_up(&dmabuf->wait);
 	}
 	/* error handling and process wake up for DAC */
 	if (dmabuf->enable == DAC_RUNNING) {
 		/* update hardware pointer */
-		hwptr = i810_get_dma_addr(state, 0);
-		diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
+		hwptr = i810_get_dma_addr(state, 0) & fragmask;
+		diff = (hwptr - dmabuf->hwptr) & dmamask;
 #if defined(DEBUG_INTERRUPTS) || defined(DEBUG_MMAP)
 		printk("DAC HWP %d,%d,%d\n", hwptr, dmabuf->hwptr, diff);
 #endif
@@ -1169,18 +1133,18 @@ static void i810_update_ptr(struct i810_state *state)
 			/* this is normal for the end of a write */
 			/* only give an error if we went past the */
 			/* last valid sg entry */
-			if((inb(state->card->iobase + PO_CIV) & 31) !=
-			   (inb(state->card->iobase + PO_LVI) & 31)) {
+			if (GET_CIV(state->card->iobase + PO_BASE) !=
+			    GET_LVI(state->card->iobase + PO_BASE)) {
 				printk(KERN_WARNING "i810_audio: DMA overrun on write\n");
 				printk("i810_audio: CIV %d, LVI %d, hwptr %x, "
 					"count %d\n",
-					inb(state->card->iobase + PO_CIV) & 31,
-					inb(state->card->iobase + PO_LVI) & 31,
+					GET_CIV(state->card->iobase + PO_BASE),
+					GET_LVI(state->card->iobase + PO_BASE),
 					dmabuf->hwptr, dmabuf->count);
 				dmabuf->error++;
 			}
 		}
-		if (dmabuf->count < (dmabuf->dmasize-dmabuf->userfragsize))
+		if (diff)
 			wake_up(&dmabuf->wait);
 	}
 }
@@ -1197,7 +1161,6 @@ static inline int i810_get_free_write_space(struct i810_state *state)
 		dmabuf->swptr = dmabuf->hwptr;
 	}
 	free = dmabuf->dmasize - dmabuf->count;
-	free -= (dmabuf->hwptr % dmabuf->fragsize);
 	if(free < 0)
 		return(0);
 	return(free);
@@ -1215,12 +1178,27 @@ static inline int i810_get_available_read_data(struct i810_state *state)
 		dmabuf->swptr = dmabuf->hwptr;
 	}
 	avail = dmabuf->count;
-	avail -= (dmabuf->hwptr % dmabuf->fragsize);
 	if(avail < 0)
 		return(0);
 	return(avail);
 }
 
+static inline void fill_partial_frag(struct dmabuf *dmabuf)
+{
+	unsigned fragsize;
+	unsigned swptr, len;
+
+	fragsize = dmabuf->fragsize;
+	swptr = dmabuf->swptr;
+	len = fragsize - MODULOP2(dmabuf->swptr, fragsize);
+	if (len == fragsize)
+		return;
+
+	memset(dmabuf->rawbuf + swptr, '\0', len);
+	dmabuf->swptr = MODULOP2(swptr + len, dmabuf->dmasize);
+	dmabuf->count += len;
+}
+
 static int drain_dac(struct i810_state *state, int signals_allowed)
 {
 	DECLARE_WAITQUEUE(wait, current);
@@ -1235,30 +1213,28 @@ static int drain_dac(struct i810_state *state, int signals_allowed)
 		stop_dac(state);
 		return 0;
 	}
+
+	spin_lock_irqsave(&state->card->lock, flags);
+
+	fill_partial_frag(dmabuf);
+
+	/* 
+	 * This will make sure that our LVI is correct, that our
+	 * pointer is updated, and that the DAC is running.  We
+	 * have to force the setting of dmabuf->trigger to avoid
+	 * any possible deadlocks.
+	 */
+	dmabuf->trigger = PCM_ENABLE_OUTPUT;
+	__i810_update_lvi(state, 0);
+
+	spin_unlock_irqrestore(&state->card->lock, flags);
+
 	add_wait_queue(&dmabuf->wait, &wait);
 	for (;;) {
 
 		spin_lock_irqsave(&state->card->lock, flags);
 		i810_update_ptr(state);
 		count = dmabuf->count;
-		spin_unlock_irqrestore(&state->card->lock, flags);
-
-		if (count <= 0)
-			break;
-
-		/* 
-		 * This will make sure that our LVI is correct, that our
-		 * pointer is updated, and that the DAC is running.  We
-		 * have to force the setting of dmabuf->trigger to avoid
-		 * any possible deadlocks.
-		 */
-		if(!dmabuf->enable) {
-			dmabuf->trigger = PCM_ENABLE_OUTPUT;
-			i810_update_lvi(state,0);
-		}
-                if (signal_pending(current) && signals_allowed) {
-                        break;
-                }
 
 		/* It seems that we have to set the current state to
 		 * TASK_INTERRUPTIBLE every time to make the process
@@ -1269,7 +1245,17 @@ static int drain_dac(struct i810_state *state, int signals_allowed)
 		 * instead of actually sleeping and waiting for an
 		 * interrupt to wake us up!
 		 */
-		set_current_state(TASK_INTERRUPTIBLE);
+		__set_current_state(signals_allowed ?
+				    TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
+		spin_unlock_irqrestore(&state->card->lock, flags);
+
+		if (count <= 0)
+			break;
+
+                if (signal_pending(current) && signals_allowed) {
+                        break;
+                }
+
 		/*
 		 * set the timeout to significantly longer than it *should*
 		 * take for the DAC to drain the DMA buffer
@@ -1350,11 +1336,10 @@ static void i810_channel_interrupt(struct i810_card *card)
 			if(status & DMA_INT_DCH)
 				printk("DCH -");
 #endif
-			if(dmabuf->enable & DAC_RUNNING)
-				count = dmabuf->count;
-			else
-				count = dmabuf->dmasize - dmabuf->count;
-			if(count > 0) {
+			count = dmabuf->count;
+			if(dmabuf->enable & ADC_RUNNING)
+				count = dmabuf->dmasize - count;
+			if (count >= (int)dmabuf->fragsize) {
 				outb(inb(port+OFF_CR) | 1, port+OFF_CR);
 #ifdef DEBUG_INTERRUPTS
 				printk(" CONTINUE ");
@@ -1408,7 +1393,7 @@ static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
    waiting to be copied to the user's buffer.  It is filled by the dma
    machine and drained by this loop. */
 
-static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t i810_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct i810_state *state = (struct i810_state *)file->private_data;
 	struct i810_card *card=state ? state->card : 0;
@@ -1417,6 +1402,7 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
 	unsigned long flags;
 	unsigned int swptr;
 	int cnt;
+	int pending;
         DECLARE_WAITQUEUE(waita, current);
 
 #ifdef DEBUG2
@@ -1442,6 +1428,8 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
 		return -EFAULT;
 	ret = 0;
 
+	pending = 0;
+
         add_wait_queue(&dmabuf->wait, &waita);
 	while (count > 0) {
 		set_current_state(TASK_INTERRUPTIBLE);
@@ -1455,8 +1443,8 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
                         }
                         continue;
                 }
-		swptr = dmabuf->swptr;
 		cnt = i810_get_available_read_data(state);
+		swptr = dmabuf->swptr;
 		// this is to make the copy_to_user simpler below
 		if(cnt > (dmabuf->dmasize - swptr))
 			cnt = dmabuf->dmasize - swptr;
@@ -1464,15 +1452,6 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
 
 		if (cnt > count)
 			cnt = count;
-		/* Lop off the last two bits to force the code to always
-		 * write in full samples.  This keeps software that sets
-		 * O_NONBLOCK but doesn't check the return value of the
-		 * write call from getting things out of state where they
-		 * think a full 4 byte sample was written when really only
-		 * a portion was, resulting in odd sound and stereo
-		 * hysteresis.
-		 */
-		cnt &= ~0x3;
 		if (cnt <= 0) {
 			unsigned long tmo;
 			/*
@@ -1526,7 +1505,7 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
 			goto done;
 		}
 
-		swptr = (swptr + cnt) % dmabuf->dmasize;
+		swptr = MODULOP2(swptr + cnt, dmabuf->dmasize);
 
 		spin_lock_irqsave(&card->lock, flags);
 
@@ -1535,7 +1514,7 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
                         continue;
                 }
 		dmabuf->swptr = swptr;
-		dmabuf->count -= cnt;
+		pending = dmabuf->count -= cnt;
 		spin_unlock_irqrestore(&card->lock, flags);
 
 		count -= cnt;
@@ -1543,7 +1522,9 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
 		ret += cnt;
 	}
  done:
-	i810_update_lvi(state,1);
+	pending = dmabuf->dmasize - pending;
+	if (dmabuf->enable || pending >= dmabuf->userfragsize)
+		i810_update_lvi(state, 1);
         set_current_state(TASK_RUNNING);
         remove_wait_queue(&dmabuf->wait, &waita);
 
@@ -1552,7 +1533,7 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
 
 /* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to
    the soundcard.  it is drained by the dma machine and filled by this loop. */
-static ssize_t i810_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t i810_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct i810_state *state = (struct i810_state *)file->private_data;
 	struct i810_card *card=state ? state->card : 0;
@@ -1560,7 +1541,8 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l
 	ssize_t ret;
 	unsigned long flags;
 	unsigned int swptr = 0;
-	int cnt, x;
+	int pending;
+	int cnt;
         DECLARE_WAITQUEUE(waita, current);
 
 #ifdef DEBUG2
@@ -1585,6 +1567,8 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l
 		return -EFAULT;
 	ret = 0;
 
+	pending = 0;
+
         add_wait_queue(&dmabuf->wait, &waita);
 	while (count > 0) {
 		set_current_state(TASK_INTERRUPTIBLE);
@@ -1599,8 +1583,8 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l
                         continue;
                 }
 
-		swptr = dmabuf->swptr;
 		cnt = i810_get_free_write_space(state);
+		swptr = dmabuf->swptr;
 		/* Bound the maximum size to how much we can copy to the
 		 * dma buffer before we hit the end.  If we have more to
 		 * copy then it will get done in a second pass of this
@@ -1615,15 +1599,6 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l
 #endif
 		if (cnt > count)
 			cnt = count;
-		/* Lop off the last two bits to force the code to always
-		 * write in full samples.  This keeps software that sets
-		 * O_NONBLOCK but doesn't check the return value of the
-		 * write call from getting things out of state where they
-		 * think a full 4 byte sample was written when really only
-		 * a portion was, resulting in odd sound and stereo
-		 * hysteresis.
-		 */
-		cnt &= ~0x3;
 		if (cnt <= 0) {
 			unsigned long tmo;
 			// There is data waiting to be played
@@ -1668,7 +1643,7 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l
 			goto ret;
 		}
 
-		swptr = (swptr + cnt) % dmabuf->dmasize;
+		swptr = MODULOP2(swptr + cnt, dmabuf->dmasize);
 
 		spin_lock_irqsave(&state->card->lock, flags);
                 if (PM_SUSPENDED(card)) {
@@ -1677,19 +1652,16 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l
                 }
 
 		dmabuf->swptr = swptr;
-		dmabuf->count += cnt;
+		pending = dmabuf->count += cnt;
 
 		count -= cnt;
 		buffer += cnt;
 		ret += cnt;
 		spin_unlock_irqrestore(&state->card->lock, flags);
 	}
-	if (swptr % dmabuf->fragsize) {
-		x = dmabuf->fragsize - (swptr % dmabuf->fragsize);
-		memset(dmabuf->rawbuf + swptr, '\0', x);
-	}
 ret:
-	i810_update_lvi(state,0);
+	if (dmabuf->enable || pending >= dmabuf->userfragsize)
+		i810_update_lvi(state, 0);
         set_current_state(TASK_RUNNING);
         remove_wait_queue(&dmabuf->wait, &waita);
 
@@ -1783,9 +1755,11 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned int i_glob_cnt;
 	int val = 0, ret;
 	struct ac97_codec *codec = state->card->ac97_codec[0];
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 #ifdef DEBUG
-	printk("i810_audio: i810_ioctl, arg=0x%x, cmd=", arg ? *(int *)arg : 0);
+	printk("i810_audio: i810_ioctl, arg=0x%x, cmd=", arg ? *p : 0);
 #endif
 
 	switch (cmd) 
@@ -1794,7 +1768,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 #ifdef DEBUG
 		printk("OSS_GETVERSION\n");
 #endif
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_RESET:
 #ifdef DEBUG
@@ -1841,7 +1815,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 #ifdef DEBUG
 		printk("SNDCTL_DSP_SPEED\n");
 #endif
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_WRITE) {
@@ -1879,7 +1853,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				spin_unlock_irqrestore(&state->card->lock, flags);
 			}
 		}
-		return put_user(dmabuf->rate, (int *)arg);
+		return put_user(dmabuf->rate, p);
 
 	case SNDCTL_DSP_STEREO: /* set stereo or mono channel */
 #ifdef DEBUG
@@ -1891,7 +1865,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if (dmabuf->enable & ADC_RUNNING) {
 			stop_adc(state);
 		}
-		return put_user(1, (int *)arg);
+		return put_user(1, p);
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		if (file->f_mode & FMODE_WRITE) {
@@ -1905,25 +1879,25 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETBLKSIZE %d\n", dmabuf->userfragsize);
 #endif
-		return put_user(dmabuf->userfragsize, (int *)arg);
+		return put_user(dmabuf->userfragsize, p);
 
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETFMTS\n");
 #endif
-		return put_user(AFMT_S16_LE, (int *)arg);
+		return put_user(AFMT_S16_LE, p);
 
 	case SNDCTL_DSP_SETFMT: /* Select sample format */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_SETFMT\n");
 #endif
-		return put_user(AFMT_S16_LE, (int *)arg);
+		return put_user(AFMT_S16_LE, p);
 
 	case SNDCTL_DSP_CHANNELS:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_CHANNELS\n");
 #endif
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (val > 0) {
@@ -1934,13 +1908,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				stop_adc(state);
 			}
 		} else {
-			return put_user(state->card->channels, (int *)arg);
+			return put_user(state->card->channels, p);
 		}
 
 		/* ICH and ICH0 only support 2 channels */
-		if ( state->card->pci_id == PCI_DEVICE_ID_INTEL_82801 
-		     || state->card->pci_id == PCI_DEVICE_ID_INTEL_82901) 
-			return put_user(2, (int *)arg);
+		if ( state->card->pci_id == PCI_DEVICE_ID_INTEL_82801AA_5
+		     || state->card->pci_id == PCI_DEVICE_ID_INTEL_82801AB_5) 
+			return put_user(2, p);
 	
 		/* Multi-channel support was added with ICH2. Bits in */
 		/* Global Status and Global Control register are now  */
@@ -1985,7 +1959,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				break;
 		}
 
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_POST: /* the user has sent all data and is notifying us */
 		/* we update the swptr to the end of the last sg segment then return */
@@ -2004,7 +1978,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	case SNDCTL_DSP_SUBDIVIDE:
 		if (dmabuf->subdivision)
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2016,7 +1990,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		return 0;
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		dmabuf->ossfragsize = 1<<(val & 0xffff);
@@ -2089,7 +2063,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		printk("SNDCTL_DSP_GETOSPACE %d, %d, %d, %d\n", abinfo.bytes,
 			abinfo.fragsize, abinfo.fragments, abinfo.fragstotal);
 #endif
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETOPTR:
 		if (!(file->f_mode & FMODE_WRITE))
@@ -2111,7 +2085,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		printk("SNDCTL_DSP_GETOPTR %d, %d, %d, %d\n", cinfo.bytes,
 			cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
-		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -2128,7 +2102,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		printk("SNDCTL_DSP_GETISPACE %d, %d, %d, %d\n", abinfo.bytes,
 			abinfo.fragsize, abinfo.fragments, abinfo.fragstotal);
 #endif
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -2150,7 +2124,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		printk("SNDCTL_DSP_GETIPTR %d, %d, %d, %d\n", cinfo.bytes,
 			cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
-		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_NONBLOCK:
 #ifdef DEBUG
@@ -2164,21 +2138,28 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		printk("SNDCTL_DSP_GETCAPS\n");
 #endif
 	    return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP|DSP_CAP_BIND,
-			    (int *)arg);
+			    p);
 
 	case SNDCTL_DSP_GETTRIGGER:
 		val = 0;
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETTRIGGER 0x%x\n", dmabuf->trigger);
 #endif
-		return put_user(dmabuf->trigger, (int *)arg);
+		return put_user(dmabuf->trigger, p);
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 #if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_SETTRIGGER 0x%x\n", val);
 #endif
+		/* silently ignore invalid PCM_ENABLE_xxx bits,
+		 * like the other drivers do
+		 */
+		if (!(file->f_mode & FMODE_READ ))
+			val &= ~PCM_ENABLE_INPUT;
+		if (!(file->f_mode & FMODE_WRITE ))
+			val &= ~PCM_ENABLE_OUTPUT;
 		if((file->f_mode & FMODE_READ) && !(val & PCM_ENABLE_INPUT) && dmabuf->enable == ADC_RUNNING) {
 			stop_adc(state);
 		}
@@ -2186,7 +2167,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			stop_dac(state);
 		}
 		dmabuf->trigger = val;
-		if((file->f_mode & FMODE_WRITE) && (val & PCM_ENABLE_OUTPUT) && !(dmabuf->enable & DAC_RUNNING)) {
+		if((val & PCM_ENABLE_OUTPUT) && !(dmabuf->enable & DAC_RUNNING)) {
 			if (!dmabuf->write_channel) {
 				dmabuf->ready = 0;
 				dmabuf->write_channel = state->card->alloc_pcm_channel(state->card);
@@ -2202,12 +2183,12 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				dmabuf->swptr = dmabuf->hwptr;
 				dmabuf->count = i810_get_free_write_space(state);
 				dmabuf->swptr = (dmabuf->swptr + dmabuf->count) % dmabuf->dmasize;
-				__i810_update_lvi(state, 0);
 				spin_unlock_irqrestore(&state->card->lock, flags);
-			} else
-				start_dac(state);
+			}
+			i810_update_lvi(state, 0);
+			start_dac(state);
 		}
-		if((file->f_mode & FMODE_READ) && (val & PCM_ENABLE_INPUT) && !(dmabuf->enable & ADC_RUNNING)) {
+		if((val & PCM_ENABLE_INPUT) && !(dmabuf->enable & ADC_RUNNING)) {
 			if (!dmabuf->read_channel) {
 				dmabuf->ready = 0;
 				dmabuf->read_channel = state->card->alloc_rec_pcm_channel(state->card);
@@ -2244,31 +2225,31 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETODELAY %d\n", dmabuf->count);
 #endif
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SOUND_PCM_READ_RATE:
 #ifdef DEBUG
 		printk("SOUND_PCM_READ_RATE %d\n", dmabuf->rate);
 #endif
-		return put_user(dmabuf->rate, (int *)arg);
+		return put_user(dmabuf->rate, p);
 
 	case SOUND_PCM_READ_CHANNELS:
 #ifdef DEBUG
 		printk("SOUND_PCM_READ_CHANNELS\n");
 #endif
-		return put_user(2, (int *)arg);
+		return put_user(2, p);
 
 	case SOUND_PCM_READ_BITS:
 #ifdef DEBUG
 		printk("SOUND_PCM_READ_BITS\n");
 #endif
-		return put_user(AFMT_S16_LE, (int *)arg);
+		return put_user(AFMT_S16_LE, p);
 
 	case SNDCTL_DSP_SETSPDIF: /* Set S/PDIF Control register */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_SETSPDIF\n");
 #endif
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		/* Check to make sure the codec supports S/PDIF transmitter */
@@ -2291,13 +2272,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		else 
 			printk(KERN_WARNING "i810_audio: S/PDIF transmitter not avalible.\n");
 #endif
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_GETSPDIF: /* Get S/PDIF Control register */
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETSPDIF\n");
 #endif
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		/* Check to make sure the codec supports S/PDIF transmitter */
@@ -2310,14 +2291,14 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		} else {
 			val = i810_ac97_get(codec, AC97_SPDIF_CONTROL);
 		}
-		//return put_user((val & 0xcfff), (int *)arg);
-		return put_user(val, (int *)arg);
+		//return put_user((val & 0xcfff), p);
+		return put_user(val, p);
    			
 	case SNDCTL_DSP_GETCHANNELMASK:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_GETCHANNELMASK\n");
 #endif
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		
 		/* Based on AC'97 DAC support, not ICH hardware */
@@ -2330,13 +2311,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if ( state->card->ac97_features & 0x0140 )
 			val |= DSP_BIND_CENTER_LFE;
 
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
 	case SNDCTL_DSP_BIND_CHANNEL:
 #ifdef DEBUG
 		printk("SNDCTL_DSP_BIND_CHANNEL\n");
 #endif
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if ( val == DSP_BIND_QUERY ) {
 			val = DSP_BIND_FRONT; /* Always report this as being enabled */
@@ -2404,7 +2385,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 					val &= ~DSP_BIND_CENTER_LFE;
 			}
 		}
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_MAPINBUF:
 	case SNDCTL_DSP_MAPOUTBUF:
@@ -2747,6 +2728,26 @@ static int i810_ac97_probe_and_powerup(struct i810_card *card,struct ac97_codec
 	return i;
 }
 
+static int is_new_ich(u16 pci_id)
+{
+	switch (pci_id) {
+	case PCI_DEVICE_ID_INTEL_82801DB_5:
+	case PCI_DEVICE_ID_INTEL_82801EB_5:
+	case PCI_DEVICE_ID_INTEL_ESB_5:
+	case PCI_DEVICE_ID_INTEL_ICH6_18:
+		return 1;
+	default:
+		break;
+	}
+
+	return 0;
+}
+
+static inline int ich_use_mmio(struct i810_card *card)
+{
+	return is_new_ich(card->pci_id) && card->use_mmio;
+}
+
 /**
  *	i810_ac97_power_up_bus	-	bring up AC97 link
  *	@card : ICH audio device to power up
@@ -2796,9 +2797,7 @@ static int i810_ac97_power_up_bus(struct i810_card *card)
 	 */	
 	/* see i810_ac97_init for the next 7 lines (jsaw) */
 	inw(card->ac97base);
-	if ((card->pci_id == PCI_DEVICE_ID_INTEL_ICH4 || card->pci_id == PCI_DEVICE_ID_INTEL_ICH5 ||
-	     card->pci_id == PCI_DEVICE_ID_INTEL_ESB_5 || card->pci_id == PCI_DEVICE_ID_INTEL_ICH6_3)
-	    && (card->use_mmio)) {
+	if (ich_use_mmio(card)) {
 		primary_codec_id = (int) readl(card->iobase_mmio + SDM) & 0x3;
 		printk(KERN_INFO "i810_audio: Primary codec has ID %d\n",
 		       primary_codec_id);
@@ -2867,9 +2866,7 @@ static int __devinit i810_ac97_init(struct i810_card *card)
 		   possible IO channels. Bit 0:1 of SDM then holds the 
 		   last codec ID spoken to. 
 		*/
-		if ((card->pci_id == PCI_DEVICE_ID_INTEL_ICH4 || card->pci_id == PCI_DEVICE_ID_INTEL_ICH5 ||
-		     card->pci_id == PCI_DEVICE_ID_INTEL_ESB_5 || card->pci_id == PCI_DEVICE_ID_INTEL_ICH6_3)
-		    && (card->use_mmio)) {
+		if (ich_use_mmio(card)) {
 			ac97_id = (int) readl(card->iobase_mmio + SDM) & 0x3;
 			printk(KERN_INFO "i810_audio: Connection %d with codec id %d\n",
 			       num_ac97, ac97_id);
@@ -3065,7 +3062,7 @@ static void __devinit i810_configure_clocking (void)
 			goto config_out;
 		}
 		dmabuf->count = dmabuf->dmasize;
-		CIV_TO_LVI(card->iobase+dmabuf->write_channel->port, 31);
+		CIV_TO_LVI(card->iobase+dmabuf->write_channel->port, -1);
 		local_irq_save(flags);
 		start_dac(state);
 		offset = i810_get_dma_addr(state, 0);
diff --git a/sound/oss/ics2101.c b/sound/oss/ics2101.c
index 5c633dd6a..d5f3be855 100644
--- a/sound/oss/ics2101.c
+++ b/sound/oss/ics2101.c
@@ -117,14 +117,14 @@ static int set_volumes(int dev, int vol)
 	return vol;
 }
 
-static int ics2101_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int ics2101_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int val;
 	
 	if (((cmd >> 8) & 0xff) == 'M') {
 		if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
 			
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user *)arg))
 				return -EFAULT;
 			switch (cmd & 0xff) {
 			case SOUND_MIXER_RECSRC:
@@ -153,7 +153,7 @@ static int ics2101_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			default:
 				return -EINVAL;
 			}
-			return put_user(val, (int *)arg);
+			return put_user(val, (int __user *)arg);
 		} else {
 			switch (cmd & 0xff) {
 				/*
@@ -201,7 +201,7 @@ static int ics2101_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			default:
 				return -EINVAL;
 			}
-			return put_user(val, (int *)arg);
+			return put_user(val, (int __user *)arg);
 		}
 	}
 	return -EINVAL;
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index c09ea8827..2c0722525 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -218,7 +218,7 @@ static int __init kahlua_init_module(void)
 
 static void __devexit kahlua_cleanup_module(void)
 {
-	return pci_unregister_driver(&kahlua_driver);
+	pci_unregister_driver(&kahlua_driver);
 }
 
 
diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c
index 2b17c06f7..4a670f4e4 100644
--- a/sound/oss/maestro.c
+++ b/sound/oss/maestro.c
@@ -2025,7 +2025,9 @@ mixer_push_state(struct ess_card *card)
 static int mixer_ioctl(struct ess_card *card, unsigned int cmd, unsigned long arg)
 {
 	int i, val=0;
-       unsigned long flags;
+	unsigned long flags;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_CARD(card);
         if (cmd == SOUND_MIXER_INFO) {
@@ -2034,7 +2036,7 @@ static int mixer_ioctl(struct ess_card *card, unsigned int cmd, unsigned long ar
 		strlcpy(info.id, card_names[card->card_type], sizeof(info.id));
 		strlcpy(info.name, card_names[card->card_type], sizeof(info.name));
 		info.modify_counter = card->mix.modcnt;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -2043,12 +2045,12 @@ static int mixer_ioctl(struct ess_card *card, unsigned int cmd, unsigned long ar
 		memset(&info, 0, sizeof(info));
 		strlcpy(info.id, card_names[card->card_type], sizeof(info.id));
 		strlcpy(info.name, card_names[card->card_type], sizeof(info.name));
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
@@ -2098,7 +2100,7 @@ static int mixer_ioctl(struct ess_card *card, unsigned int cmd, unsigned long ar
 
 			break;
 		}
-		return put_user(val,(int *)arg);
+		return put_user(val, p);
 	}
 	
         if (_IOC_DIR(cmd) != (_IOC_WRITE|_IOC_READ))
@@ -2106,7 +2108,7 @@ static int mixer_ioctl(struct ess_card *card, unsigned int cmd, unsigned long ar
 	
 	card->mix.modcnt++;
 
-	if (get_user(val, (int *)arg))
+	if (get_user(val, p))
 		return -EFAULT;
 
 	switch (_IOC_NR(cmd)) {
@@ -2262,7 +2264,7 @@ comb_stereo(unsigned char *real_buffer,unsigned char  *tmp_buffer, int offset,
 	to be copied to the user's buffer.  it is filled by the interrupt
 	handler and drained by this loop. */
 static ssize_t 
-ess_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+ess_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct ess_state *s = (struct ess_state *)file->private_data;
 	ssize_t ret;
@@ -2361,7 +2363,7 @@ rec_return_free:
 }
 
 static ssize_t 
-ess_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+ess_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct ess_state *s = (struct ess_state *)file->private_data;
 	ssize_t ret;
@@ -2539,6 +2541,8 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
         count_info cinfo;
 	int val, mapped, ret;
 	unsigned char fmtm, fmtd;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 /*	printk("maestro: ess_ioctl: cmd %d\n", cmd);*/
 	
@@ -2547,7 +2551,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
@@ -2559,7 +2563,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
@@ -2575,7 +2579,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -2589,10 +2593,10 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 				set_dac_rate(s, val);
 			}
 		}
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 		
         case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		fmtd = 0;
 		fmtm = ~0;
@@ -2616,7 +2620,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			fmtd = 0;
@@ -2640,13 +2644,13 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			set_fmt(s, fmtm, fmtd);
 		}
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (ESS_FMT_STEREO << ESS_ADC_SHIFT) 
-					   : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, (int *)arg);
+					   : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, p);
 		
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_U8|AFMT_S16_LE, (int *)arg);
+                return put_user(AFMT_U8|AFMT_S16_LE, p);
 		
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			fmtd = 0;
@@ -2678,7 +2682,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			: (ESS_FMT_16BIT << ESS_DAC_SHIFT))) ? 
 				AFMT_S16_LE : 
 				AFMT_U8, 
-			(int *)arg);
+			p);
 		
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -2689,10 +2693,10 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			val |= PCM_ENABLE_INPUT;
 		if ((file->f_mode & FMODE_WRITE) && (s->enable & DAC_RUNNING)) 
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -2724,7 +2728,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
                 abinfo.fragstotal = s->dma_dac.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -2738,7 +2742,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
                 abinfo.fragstotal = s->dma_adc.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -2753,7 +2757,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		ess_update_ptr(s);
                 val = s->dma_dac.count;
 		spin_unlock_irqrestore(&s->lock, flags);
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
         case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -2768,7 +2772,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -2785,7 +2789,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		if (s->dma_dac.mapped)
 			s->dma_dac.count &= s->dma_dac.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -2793,14 +2797,14 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf(s, 0)))
 				return val;
-			return put_user(s->dma_dac.fragsize, (int *)arg);
+			return put_user(s->dma_dac.fragsize, p);
 		}
 		if ((val = prog_dmabuf(s, 1)))
 			return val;
-		return put_user(s->dma_adc.fragsize, (int *)arg);
+		return put_user(s->dma_adc.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		M_printk("maestro: SETFRAGMENT: %0x\n",val);
 		if (file->f_mode & FMODE_READ) {
@@ -2829,7 +2833,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac.subdivision))
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2840,15 +2844,15 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 
         case SOUND_PCM_READ_CHANNELS:
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (ESS_FMT_STEREO << ESS_ADC_SHIFT) 
-					   : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, (int *)arg);
+					   : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, p);
 
         case SOUND_PCM_READ_BITS:
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (ESS_FMT_16BIT << ESS_ADC_SHIFT) 
-					   : (ESS_FMT_16BIT << ESS_DAC_SHIFT))) ? 16 : 8, (int *)arg);
+					   : (ESS_FMT_16BIT << ESS_DAC_SHIFT))) ? 16 : 8, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c
index 137cb1166..2830f7f1e 100644
--- a/sound/oss/maestro3.c
+++ b/sound/oss/maestro3.c
@@ -1324,7 +1324,7 @@ static int drain_dac(struct m3_state *s, int nonblock)
     return 0;
 }
 
-static ssize_t m3_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t m3_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
     struct m3_state *s = (struct m3_state *)file->private_data;
     ssize_t ret;
@@ -1405,7 +1405,7 @@ out:
     return ret;
 }
 
-static ssize_t m3_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t m3_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
     struct m3_state *s = (struct m3_state *)file->private_data;
     ssize_t ret;
@@ -1584,6 +1584,8 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
     count_info cinfo;
     int val, mapped, ret;
     unsigned char fmtm, fmtd;
+    void __user *argp = (void __user *)arg;
+    int __user *p = argp;
 
     VALIDATE_STATE(s);
 
@@ -1594,7 +1596,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 
     switch (cmd) {
     case OSS_GETVERSION:
-        return put_user(SOUND_VERSION, (int *)arg);
+        return put_user(SOUND_VERSION, p);
 
     case SNDCTL_DSP_SYNC:
         if (file->f_mode & FMODE_WRITE)
@@ -1606,7 +1608,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         return 0;
 
     case SNDCTL_DSP_GETCAPS:
-        return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+        return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
         
     case SNDCTL_DSP_RESET:
         spin_lock_irqsave(&card->lock, flags);
@@ -1624,7 +1626,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         return 0;
 
     case SNDCTL_DSP_SPEED:
-        get_user_ret(val, (int *)arg, -EFAULT);
+        get_user_ret(val, p, -EFAULT);
         spin_lock_irqsave(&card->lock, flags);
         if (val >= 0) {
             if (file->f_mode & FMODE_READ) {
@@ -1639,10 +1641,10 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
             }
         }
         spin_unlock_irqrestore(&card->lock, flags);
-        return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+        return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
         
     case SNDCTL_DSP_STEREO:
-        get_user_ret(val, (int *)arg, -EFAULT);
+        get_user_ret(val, p, -EFAULT);
         spin_lock_irqsave(&card->lock, flags);
         fmtd = 0;
         fmtm = ~0;
@@ -1667,7 +1669,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         return 0;
 
     case SNDCTL_DSP_CHANNELS:
-        get_user_ret(val, (int *)arg, -EFAULT);
+        get_user_ret(val, p, -EFAULT);
         spin_lock_irqsave(&card->lock, flags);
         if (val != 0) {
             fmtd = 0;
@@ -1692,13 +1694,13 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         }
         spin_unlock_irqrestore(&card->lock, flags);
         return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (ESS_FMT_STEREO << ESS_ADC_SHIFT) 
-                       : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, (int *)arg);
+                       : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, p);
         
     case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-        return put_user(AFMT_U8|AFMT_S16_LE, (int *)arg);
+        return put_user(AFMT_U8|AFMT_S16_LE, p);
         
     case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-        get_user_ret(val, (int *)arg, -EFAULT);
+        get_user_ret(val, p, -EFAULT);
         spin_lock_irqsave(&card->lock, flags);
         if (val != AFMT_QUERY) {
             fmtd = 0;
@@ -1727,7 +1729,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
             : (ESS_FMT_16BIT << ESS_DAC_SHIFT))) ? 
                 AFMT_S16_LE : 
                 AFMT_U8, 
-            (int *)arg);
+            p);
         
     case SNDCTL_DSP_POST:
         return 0;
@@ -1738,10 +1740,10 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
             val |= PCM_ENABLE_INPUT;
         if ((file->f_mode & FMODE_WRITE) && (s->enable & DAC_RUNNING)) 
             val |= PCM_ENABLE_OUTPUT;
-        return put_user(val, (int *)arg);
+        return put_user(val, p);
         
     case SNDCTL_DSP_SETTRIGGER:
-        get_user_ret(val, (int *)arg, -EFAULT);
+        get_user_ret(val, p, -EFAULT);
         if (file->f_mode & FMODE_READ) {
             if (val & PCM_ENABLE_INPUT) {
                 if (!s->dma_adc.ready && (ret =  prog_dmabuf(s, 1)))
@@ -1772,7 +1774,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         abinfo.fragstotal = s->dma_dac.numfrag;
         abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;      
         spin_unlock_irqrestore(&card->lock, flags);
-        return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+        return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
     case SNDCTL_DSP_GETISPACE:
         if (!(file->f_mode & FMODE_READ))
@@ -1786,7 +1788,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         abinfo.fragstotal = s->dma_adc.numfrag;
         abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
         spin_unlock_irqrestore(&card->lock, flags);
-        return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+        return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
         
     case SNDCTL_DSP_NONBLOCK:
         file->f_flags |= O_NONBLOCK;
@@ -1799,7 +1801,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         m3_update_ptr(s);
         val = s->dma_dac.count;
         spin_unlock_irqrestore(&card->lock, flags);
-        return put_user(val, (int *)arg);
+        return put_user(val, p);
 
     case SNDCTL_DSP_GETIPTR:
         if (!(file->f_mode & FMODE_READ))
@@ -1812,7 +1814,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         if (s->dma_adc.mapped)
             s->dma_adc.count &= s->dma_adc.fragsize-1;
         spin_unlock_irqrestore(&card->lock, flags);
-	if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+	if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 		return -EFAULT;
 	return 0;
 
@@ -1827,7 +1829,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         if (s->dma_dac.mapped)
             s->dma_dac.count &= s->dma_dac.fragsize-1;
         spin_unlock_irqrestore(&card->lock, flags);
-	if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+	if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 		return -EFAULT;
 	return 0;
 
@@ -1835,14 +1837,14 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         if (file->f_mode & FMODE_WRITE) {
             if ((val = prog_dmabuf(s, 0)))
                 return val;
-            return put_user(s->dma_dac.fragsize, (int *)arg);
+            return put_user(s->dma_dac.fragsize, p);
         }
         if ((val = prog_dmabuf(s, 1)))
             return val;
-        return put_user(s->dma_adc.fragsize, (int *)arg);
+        return put_user(s->dma_adc.fragsize, p);
 
     case SNDCTL_DSP_SETFRAGMENT:
-        get_user_ret(val, (int *)arg, -EFAULT);
+        get_user_ret(val, p, -EFAULT);
         spin_lock_irqsave(&card->lock, flags);
         if (file->f_mode & FMODE_READ) {
             s->dma_adc.ossfragshift = val & 0xffff;
@@ -1871,7 +1873,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
             (file->f_mode & FMODE_WRITE && s->dma_dac.subdivision))
             return -EINVAL;
-                get_user_ret(val, (int *)arg, -EFAULT);
+                get_user_ret(val, p, -EFAULT);
         if (val != 1 && val != 2 && val != 4)
             return -EINVAL;
         if (file->f_mode & FMODE_READ)
@@ -1881,15 +1883,15 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
         return 0;
 
     case SOUND_PCM_READ_RATE:
-        return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+        return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 
     case SOUND_PCM_READ_CHANNELS:
         return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (ESS_FMT_STEREO << ESS_ADC_SHIFT) 
-                       : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, (int *)arg);
+                       : (ESS_FMT_STEREO << ESS_DAC_SHIFT))) ? 2 : 1, p);
 
     case SOUND_PCM_READ_BITS:
         return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (ESS_FMT_16BIT << ESS_ADC_SHIFT) 
-                       : (ESS_FMT_16BIT << ESS_DAC_SHIFT))) ? 16 : 8, (int *)arg);
+                       : (ESS_FMT_16BIT << ESS_DAC_SHIFT))) ? 16 : 8, p);
 
     case SOUND_PCM_WRITE_FILTER:
     case SNDCTL_DSP_SETSYNCRO:
diff --git a/sound/oss/maui.c b/sound/oss/maui.c
index dd5f8437a..1de0fb55b 100644
--- a/sound/oss/maui.c
+++ b/sound/oss/maui.c
@@ -53,7 +53,7 @@ static int     *maui_osp;
 #define STAT_RX_AVAIL	0x02
 #define STAT_RX_IENA	0x01
 
-static int      (*orig_load_patch) (int dev, int format, const char *addr,
+static int      (*orig_load_patch)(int dev, int format, const char __user *addr,
 			      int offs, int count, int pmgr_flag) = NULL;
 
 #include "maui_boot.h"
@@ -242,7 +242,7 @@ static int maui_short_wait(int mask) {
 	return 0;
 }
 
-static int maui_load_patch(int dev, int format, const char *addr,
+static int maui_load_patch(int dev, int format, const char __user *addr,
 		int offs, int count, int pmgr_flag)
 {
 
@@ -282,7 +282,7 @@ static int maui_load_patch(int dev, int format, const char *addr,
 	for (i = 0; i < left; i++) {
 		unsigned char   data;
 
-		if(get_user(*(unsigned char *) &data, (unsigned char *) &((addr)[hdr_size + i])))
+		if(get_user(*(unsigned char *) &data, (unsigned char __user *) &((addr)[hdr_size + i])))
 			return -EFAULT;
 		if (i == 0 && !(data & 0x80))
 			return -EINVAL;
diff --git a/sound/oss/midi_synth.c b/sound/oss/midi_synth.c
index 4336627c9..972edc62a 100644
--- a/sound/oss/midi_synth.c
+++ b/sound/oss/midi_synth.c
@@ -256,7 +256,7 @@ midi_synth_output(int dev)
 	 */
 }
 
-int midi_synth_ioctl(int dev, unsigned int cmd, caddr_t arg)
+int midi_synth_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	/*
 	 * int orig_dev = synth_devs[dev]->midi_dev;
@@ -466,7 +466,7 @@ midi_synth_hw_control(int dev, unsigned char *event)
 }
 
 int
-midi_synth_load_patch(int dev, int format, const char *addr,
+midi_synth_load_patch(int dev, int format, const char __user *addr,
 		      int offs, int count, int pmgr_flag)
 {
 	int             orig_dev = synth_devs[dev]->midi_dev;
@@ -514,7 +514,7 @@ midi_synth_load_patch(int dev, int format, const char *addr,
 	{
 		unsigned char   data;
 
-		get_user(*(unsigned char *) &data, (unsigned char *) &((addr)[hdr_size + i]));
+		get_user(*(unsigned char *) &data, (unsigned char __user *) &((addr)[hdr_size + i]));
 
 		eox_seen = (i > 0 && data & 0x80);	/* End of sysex */
 
diff --git a/sound/oss/midi_synth.h b/sound/oss/midi_synth.h
index fcaf7d53e..6bc9d00bc 100644
--- a/sound/oss/midi_synth.h
+++ b/sound/oss/midi_synth.h
@@ -1,5 +1,5 @@
 int midi_synth_ioctl (int dev,
-	    unsigned int cmd, caddr_t arg);
+	    unsigned int cmd, void __user * arg);
 int midi_synth_kill_note (int dev, int channel, int note, int velocity);
 int midi_synth_set_instr (int dev, int channel, int instr_no);
 int midi_synth_start_note (int dev, int channel, int note, int volume);
@@ -7,7 +7,7 @@ void midi_synth_reset (int dev);
 int midi_synth_open (int dev, int mode);
 void midi_synth_close (int dev);
 void midi_synth_hw_control (int dev, unsigned char *event);
-int midi_synth_load_patch (int dev, int format, const char * addr,
+int midi_synth_load_patch (int dev, int format, const char __user * addr,
 		 int offs, int count, int pmgr_flag);
 void midi_synth_panning (int dev, int channel, int pressure);
 void midi_synth_aftertouch (int dev, int channel, int pressure);
diff --git a/sound/oss/midibuf.c b/sound/oss/midibuf.c
index 1b9179610..615b5c8c7 100644
--- a/sound/oss/midibuf.c
+++ b/sound/oss/midibuf.c
@@ -256,7 +256,7 @@ void MIDIbuf_release(int dev, struct file *file)
 	module_put(midi_devs[dev]->owner);
 }
 
-int MIDIbuf_write(int dev, struct file *file, const char *buf, int count)
+int MIDIbuf_write(int dev, struct file *file, const char __user *buf, int count)
 {
 	int c, n, i;
 	unsigned char tmp_data;
@@ -310,7 +310,7 @@ out:
 }
 
 
-int MIDIbuf_read(int dev, struct file *file, char *buf, int count)
+int MIDIbuf_read(int dev, struct file *file, char __user *buf, int count)
 {
 	int n, c = 0;
 	unsigned char tmp_data;
@@ -359,7 +359,7 @@ out:
 }
 
 int MIDIbuf_ioctl(int dev, struct file *file,
-		  unsigned int cmd, caddr_t arg)
+		  unsigned int cmd, void __user *arg)
 {
 	int val;
 
@@ -377,13 +377,13 @@ int MIDIbuf_ioctl(int dev, struct file *file,
 		switch (cmd) 
 		{
 			case SNDCTL_MIDI_PRETIME:
-				if (get_user(val, (int *)arg))
+				if (get_user(val, (int __user *)arg))
 					return -EFAULT;
 				if (val < 0)
 					val = 0;
 				val = (HZ * val) / 10;
 				parms[dev].prech_timeout = val;
-				return put_user(val, (int *)arg);
+				return put_user(val, (int __user *)arg);
 			
 			default:
 				if (!midi_devs[dev]->ioctl)
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index 0059ee08d..341983bff 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -728,7 +728,7 @@ static int mpu401_end_read(int dev)
 	return 0;
 }
 
-static int mpu401_ioctl(int dev, unsigned cmd, caddr_t arg)
+static int mpu401_ioctl(int dev, unsigned cmd, void __user *arg)
 {
 	struct mpu_config *devc;
 	mpu_command_rec rec;
@@ -742,7 +742,7 @@ static int mpu401_ioctl(int dev, unsigned cmd, caddr_t arg)
 				printk(KERN_WARNING "mpu401: Intelligent mode not supported by the HW\n");
 				return -EINVAL;
 			}
-			if (get_user(val, (int *)arg))
+			if (get_user(val, (int __user *)arg))
 				return -EFAULT;
 			set_uart_mode(dev, devc, !val);
 			return 0;
@@ -772,8 +772,7 @@ static int mpu401_buffer_status(int dev)
 				 */
 }
 
-static int mpu_synth_ioctl(int dev,
-		unsigned int cmd, caddr_t arg)
+static int mpu_synth_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int midi_dev;
 	struct mpu_config *devc;
@@ -789,8 +788,7 @@ static int mpu_synth_ioctl(int dev,
 	{
 
 		case SNDCTL_SYNTH_INFO:
-			if (copy_to_user((&((char *) arg)[0]),
-					(char *) &mpu_synth_info[midi_dev],
+			if (copy_to_user(arg, &mpu_synth_info[midi_dev],
 					sizeof(struct synth_info)))
 				return -EFAULT;
 			return 0;
@@ -1508,17 +1506,19 @@ static unsigned long mpu_timer_get_time(int dev)
 	return curr_ticks;
 }
 
-static int mpu_timer_ioctl(int dev, unsigned int command, caddr_t arg)
+static int mpu_timer_ioctl(int dev, unsigned int command, void __user *arg)
 {
 	int midi_dev = sound_timer_devs[dev]->devlink;
+	int __user *p = (int __user *)arg;
 
 	switch (command)
 	{
 		case SNDCTL_TMR_SOURCE:
 			{
 				int parm;
-	
-				parm = *(int *) arg;
+
+				if (get_user(parm, p))
+					return -EFAULT;
 				parm &= timer_caps;
 
 				if (parm != 0)
@@ -1530,7 +1530,9 @@ static int mpu_timer_ioctl(int dev, unsigned int command, caddr_t arg)
 					else if (timer_mode & TMR_MODE_SMPTE)
 						mpu_cmd(midi_dev, 0x3d, 0);		/* Use SMPTE sync */
 				}
-				return (*(int *) arg = timer_mode);
+				if (put_user(timer_mode, p))
+					return -EFAULT;
+				return timer_mode;
 			}
 			break;
 
@@ -1554,11 +1556,13 @@ static int mpu_timer_ioctl(int dev, unsigned int command, caddr_t arg)
 		case SNDCTL_TMR_TIMEBASE:
 			{
 				int val;
-
-				val = *(int *) arg;
+				if (get_user(val, p))
+					return -EFAULT;
 				if (val)
 					set_timebase(midi_dev, val);
-				return (*(int *) arg = curr_timebase);
+				if (put_user(curr_timebase, p))
+					return -EFAULT;
+				return curr_timebase;
 			}
 			break;
 
@@ -1567,7 +1571,8 @@ static int mpu_timer_ioctl(int dev, unsigned int command, caddr_t arg)
 				int val;
 				int ret;
 
-				val = *(int *) arg;
+				if (get_user(val, p))
+					return -EFAULT;
 
 				if (val)
 				{
@@ -1582,26 +1587,35 @@ static int mpu_timer_ioctl(int dev, unsigned int command, caddr_t arg)
 					}
 					curr_tempo = val;
 				}
-				return (*(int *) arg = curr_tempo);
+				if (put_user(curr_tempo, p))
+					return -EFAULT;
+				return curr_tempo;
 			}
 			break;
 
 		case SNDCTL_SEQ_CTRLRATE:
 			{
 				int val;
+				if (get_user(val, p))
+					return -EFAULT;
 
-				val = *(int *) arg;
 				if (val != 0)		/* Can't change */
 					return -EINVAL;
-				return (*(int *) arg = ((curr_tempo * curr_timebase) + 30) / 60);
+				val = ((curr_tempo * curr_timebase) + 30)/60;
+				if (put_user(val, p))
+					return -EFAULT;
+				return val;
 			}
 			break;
 
 		case SNDCTL_SEQ_GETTIME:
-			return (*(int *) arg = curr_ticks);
+			if (put_user(curr_ticks, p))
+				return -EFAULT;
+			return curr_ticks;
 
 		case SNDCTL_TMR_METRONOME:
-			metronome_mode = *(int *) arg;
+			if (get_user(metronome_mode, p))
+				return -EFAULT;
 			setup_metronome(midi_dev);
 			return 0;
 
diff --git a/sound/oss/msnd.c b/sound/oss/msnd.c
index deb126d8f..6ccdd096f 100644
--- a/sound/oss/msnd.c
+++ b/sound/oss/msnd.c
@@ -59,9 +59,6 @@ int __init msnd_register(multisound_dev_t *dev)
 
 	devs[i] = dev;
 	++num_devs;
-
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -80,8 +77,6 @@ void msnd_unregister(multisound_dev_t *dev)
 
 	devs[i] = NULL;
 	--num_devs;
-
-	MOD_DEC_USE_COUNT;
 }
 
 int msnd_get_num_devs(void)
@@ -144,13 +139,10 @@ void msnd_fifo_make_empty(msnd_fifo *f)
 	f->len = f->tail = f->head = 0;
 }
 
-int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user)
+int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len)
 {
 	int count = 0;
 
-	if (f->len == f->n)
-		return 0;
-
 	while ((count < len) && (f->len != f->n)) {
 
 		int nwritten;
@@ -166,11 +158,7 @@ int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user)
 				nwritten = len - count;
 		}
 
-		if (user) {
-			if (copy_from_user(f->data + f->tail, buf, nwritten))
-				return -EFAULT;
-		} else
-			isa_memcpy_fromio(f->data + f->tail, (unsigned long) buf, nwritten);
+		isa_memcpy_fromio(f->data + f->tail, (unsigned long) buf, nwritten);
 
 		count += nwritten;
 		buf += nwritten;
@@ -182,13 +170,10 @@ int msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user)
 	return count;
 }
 
-int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user)
+int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len)
 {
 	int count = 0;
 
-	if (f->len == 0)
-		return f->len;
-
 	while ((count < len) && (f->len > 0)) {
 
 		int nread;
@@ -204,11 +189,7 @@ int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user)
 				nread = len - count;
 		}
 
-		if (user) {
-			if (copy_to_user(buf, f->data + f->head, nread))
-				return -EFAULT;
-		} else
-			isa_memcpy_toio((unsigned long) buf, f->data + f->head, nread);
+		isa_memcpy_toio((unsigned long) buf, f->data + f->head, nread);
 
 		count += nread;
 		buf += nread;
diff --git a/sound/oss/msnd.h b/sound/oss/msnd.h
index 7b361921e..73148d2ee 100644
--- a/sound/oss/msnd.h
+++ b/sound/oss/msnd.h
@@ -266,8 +266,8 @@ void				msnd_fifo_init(msnd_fifo *f);
 void				msnd_fifo_free(msnd_fifo *f);
 int				msnd_fifo_alloc(msnd_fifo *f, size_t n);
 void				msnd_fifo_make_empty(msnd_fifo *f);
-int				msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len, int user);
-int				msnd_fifo_read(msnd_fifo *f, char *buf, size_t len, int user);
+int				msnd_fifo_write(msnd_fifo *f, const char *buf, size_t len);
+int				msnd_fifo_read(msnd_fifo *f, char *buf, size_t len);
 
 int				msnd_wait_TXDE(multisound_dev_t *dev);
 int				msnd_wait_HC0(multisound_dev_t *dev);
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index aea4a65f7..a130ba4c0 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -212,6 +212,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	LPDAQD lpDAQ, lpDARQ;
         audio_buf_info abinfo;
 	unsigned long flags;
+	int __user *p = (int __user *)arg;
 
 	lpDAQ = dev.base + DAPQ_DATA_BUFF;
 	lpDARQ = dev.base + DARQ_DATA_BUFF;
@@ -238,7 +239,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                 abinfo.fragstotal = dev.DAPF.n / abinfo.fragsize;
                 abinfo.fragments = abinfo.bytes / abinfo.fragsize;
 		spin_unlock_irqrestore(&dev.lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -249,7 +250,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                 abinfo.fragstotal = dev.DARF.n / abinfo.fragsize;
                 abinfo.fragments = abinfo.bytes / abinfo.fragsize;
 		spin_unlock_irqrestore(&dev.lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_RESET:
 		dev.nresets = 0;
@@ -262,18 +263,18 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 	case SNDCTL_DSP_GETBLKSIZE:
 		tmp = dsp_get_frag_size();
-		if (put_user(tmp, (int *)arg))
+		if (put_user(tmp, p))
                         return -EFAULT;
 		return 0;
 
 	case SNDCTL_DSP_GETFMTS:
 		val = AFMT_S16_LE | AFMT_U8;
-		if (put_user(val, (int *)arg))
+		if (put_user(val, p))
 			return -EFAULT;
 		return 0;
 
 	case SNDCTL_DSP_SETFMT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (file->f_mode & FMODE_WRITE)
@@ -285,7 +286,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 				? dev.rec_sample_size
 				: dsp_set_format(file, val);
 
-		if (put_user(data, (int *)arg))
+		if (put_user(data, p))
 			return -EFAULT;
 		return 0;
 
@@ -299,12 +300,12 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 	case SNDCTL_DSP_GETCAPS:
 		val = DSP_CAP_DUPLEX | DSP_CAP_BATCH;
-		if (put_user(val, (int *)arg))
+		if (put_user(val, p))
 			return -EFAULT;
 		return 0;
 
 	case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (val < 8000)
@@ -326,13 +327,13 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (file->f_mode & FMODE_READ)
 			dev.rec_sample_rate = data;
 
-		if (put_user(data, (int *)arg))
+		if (put_user(data, p))
 			return -EFAULT;
 		return 0;
 
 	case SNDCTL_DSP_CHANNELS:
 	case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 		if (cmd == SNDCTL_DSP_CHANNELS) {
@@ -369,7 +370,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (file->f_mode & FMODE_READ)
 			dev.rec_channels = data;
 
-		if (put_user(val, (int *)arg))
+		if (put_user(val, p))
 			return -EFAULT;
 		return 0;
 	}
@@ -565,13 +566,13 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
 		mixer_info info;
 		set_mixer_info();
 		info.modify_counter = dev.mixer_mod_count;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	} else if (cmd == SOUND_OLD_MIXER_INFO) {
 		_old_mixer_info info;
 		set_mixer_info();
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	} else if (cmd == SOUND_MIXER_PRIVATE1) {
@@ -584,19 +585,19 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
 		if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
 			switch (cmd & 0xff) {
 			case SOUND_MIXER_RECSRC:
-				if (get_user(val, (int *)arg))
+				if (get_user(val, (int __user *)arg))
 					return -EFAULT;
 				val = set_recsrc(val);
 				break;
 
 			default:
-				if (get_user(val, (int *)arg))
+				if (get_user(val, (int __user *)arg))
 					return -EFAULT;
 				val = mixer_set(cmd & 0xff, val);
 				break;
 			}
 			++dev.mixer_mod_count;
-			return put_user(val, (int *)arg);
+			return put_user(val, (int __user *)arg);
 		} else {
 			switch (cmd & 0xff) {
 			case SOUND_MIXER_RECSRC:
@@ -638,7 +639,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
 			}
 		}
 
-		return put_user(val, (int *)arg); 
+		return put_user(val, (int __user *)arg); 
 	}
 
 	return -EINVAL;
@@ -650,7 +651,7 @@ static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 
 	if (cmd == OSS_GETVERSION) {
 		int sound_version = SOUND_VERSION;
-		return put_user(sound_version, (int *)arg);
+		return put_user(sound_version, (int __user *)arg);
 	}
 
 	if (minor == dev.dsp_minor)
@@ -809,7 +810,7 @@ static int dev_release(struct inode *inode, struct file *file)
 
 static __inline__ int pack_DARQ_to_DARF(register int bank)
 {
-	register int size, n, timeout = 3;
+	register int size, timeout = 3;
 	register WORD wTmp;
 	LPDAQD DAQD;
 
@@ -830,13 +831,10 @@ static __inline__ int pack_DARQ_to_DARF(register int bank)
 	/* Read data from the head (unprotected bank 1 access okay
            since this is only called inside an interrupt) */
 	outb(HPBLKSEL_1, dev.io + HP_BLKS);
-	if ((n = msnd_fifo_write(
+	msnd_fifo_write(
 		&dev.DARF,
 		(char *)(dev.base + bank * DAR_BUFF_SIZE),
-		size, 0)) <= 0) {
-		outb(HPBLKSEL_0, dev.io + HP_BLKS);
-		return n;
-	}
+		size);
 	outb(HPBLKSEL_0, dev.io + HP_BLKS);
 
 	return 1;
@@ -858,21 +856,16 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start)
 		if (protect) {
 			/* Critical section: protect fifo in non-interrupt */
 			spin_lock_irqsave(&dev.lock, flags);
-			if ((n = msnd_fifo_read(
+			n = msnd_fifo_read(
 				&dev.DAPF,
 				(char *)(dev.base + bank_num * DAP_BUFF_SIZE),
-				DAP_BUFF_SIZE, 0)) < 0) {
-				spin_unlock_irqrestore(&dev.lock, flags);
-				return n;
-			}
+				DAP_BUFF_SIZE);
 			spin_unlock_irqrestore(&dev.lock, flags);
 		} else {
-			if ((n = msnd_fifo_read(
+			n = msnd_fifo_read(
 				&dev.DAPF,
 				(char *)(dev.base + bank_num * DAP_BUFF_SIZE),
-				DAP_BUFF_SIZE, 0)) < 0) {
-				return n;
-			}
+				DAP_BUFF_SIZE);
 		}
 		if (!n)
 			break;
@@ -896,33 +889,46 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start)
 	return nbanks;
 }
 
-static int dsp_read(char *buf, size_t len)
+static int dsp_read(char __user *buf, size_t len)
 {
 	int count = len;
+	char *page = (char *)__get_free_page(PAGE_SIZE);
+
+	if (!page)
+		return -ENOMEM;
 
 	while (count > 0) {
-		int n;
+		int n, k;
 		unsigned long flags;
 
+		k = PAGE_SIZE;
+		if (k > count)
+			k = count;
+
 		/* Critical section: protect fifo in non-interrupt */
 		spin_lock_irqsave(&dev.lock, flags);
-		if ((n = msnd_fifo_read(&dev.DARF, buf, count, 1)) < 0) {
-			printk(KERN_WARNING LOGNAME ": FIFO read error\n");
-			spin_unlock_irqrestore(&dev.lock, flags);
-			return n;
-		}
+		n = msnd_fifo_read(&dev.DARF, page, k);
 		spin_unlock_irqrestore(&dev.lock, flags);
+		if (copy_to_user(buf, page, n)) {
+			free_page((unsigned long)page);
+			return -EFAULT;
+		}
 		buf += n;
 		count -= n;
 
+		if (n == k && count)
+			continue;
+
 		if (!test_bit(F_READING, &dev.flags) && dev.mode & FMODE_READ) {
 			dev.last_recbank = -1;
 			if (chk_send_dsp_cmd(&dev, HDEX_RECORD_START) == 0)
 				set_bit(F_READING, &dev.flags);
 		}
 
-		if (dev.rec_ndelay)
+		if (dev.rec_ndelay) {
+			free_page((unsigned long)page);
 			return count == len ? -EAGAIN : len - count;
+		}
 
 		if (count > 0) {
 			set_bit(F_READBLOCK, &dev.flags);
@@ -931,41 +937,57 @@ static int dsp_read(char *buf, size_t len)
 				get_rec_delay_jiffies(DAR_BUFF_SIZE)))
 				clear_bit(F_READING, &dev.flags);
 			clear_bit(F_READBLOCK, &dev.flags);
-			if (signal_pending(current))
+			if (signal_pending(current)) {
+				free_page((unsigned long)page);
 				return -EINTR;
+			}
 		}
 	}
-
+	free_page((unsigned long)page);
 	return len - count;
 }
 
-static int dsp_write(const char *buf, size_t len)
+static int dsp_write(const char __user *buf, size_t len)
 {
 	int count = len;
+	char *page = (char *)__get_free_page(GFP_KERNEL);
+
+	if (!page)
+		return -ENOMEM;
 
 	while (count > 0) {
-		int n;
+		int n, k;
 		unsigned long flags;
 
+		k = PAGE_SIZE;
+		if (k > count)
+			k = count;
+
+		if (copy_from_user(page, buf, k)) {
+			free_page((unsigned long)page);
+			return -EFAULT;
+		}
+
 		/* Critical section: protect fifo in non-interrupt */
 		spin_lock_irqsave(&dev.lock, flags);
-		if ((n = msnd_fifo_write(&dev.DAPF, buf, count, 1)) < 0) {
-			printk(KERN_WARNING LOGNAME ": FIFO write error\n");
-			spin_unlock_irqrestore(&dev.lock, flags);
-			return n;
-		}
+		n = msnd_fifo_write(&dev.DAPF, page, k);
 		spin_unlock_irqrestore(&dev.lock, flags);
 		buf += n;
 		count -= n;
 
+		if (count && n == k)
+			continue;
+
 		if (!test_bit(F_WRITING, &dev.flags) && (dev.mode & FMODE_WRITE)) {
 			dev.last_playbank = -1;
 			if (pack_DAPF_to_DAPQ(1) > 0)
 				set_bit(F_WRITING, &dev.flags);
 		}
 
-		if (dev.play_ndelay)
+		if (dev.play_ndelay) {
+			free_page((unsigned long)page);
 			return count == len ? -EAGAIN : len - count;
+		}
 
 		if (count > 0) {
 			set_bit(F_WRITEBLOCK, &dev.flags);
@@ -973,15 +995,18 @@ static int dsp_write(const char *buf, size_t len)
 				&dev.writeblock,
 				get_play_delay_jiffies(DAP_BUFF_SIZE));
 			clear_bit(F_WRITEBLOCK, &dev.flags);
-			if (signal_pending(current))
+			if (signal_pending(current)) {
+				free_page((unsigned long)page);
 				return -EINTR;
+			}
 		}
 	}
 
+	free_page((unsigned long)page);
 	return len - count;
 }
 
-static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
+static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_t *off)
 {
 	int minor = iminor(file->f_dentry->d_inode);
 	if (minor == dev.dsp_minor)
@@ -990,7 +1015,7 @@ static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
 		return -EINVAL;
 }
 
-static ssize_t dev_write(struct file *file, const char *buf, size_t count, loff_t *off)
+static ssize_t dev_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
 {
 	int minor = iminor(file->f_dentry->d_inode);
 	if (minor == dev.dsp_minor)
diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c
index 777492c35..ca763f8e7 100644
--- a/sound/oss/nm256_audio.c
+++ b/sound/oss/nm256_audio.c
@@ -52,6 +52,7 @@ static int handle_pm_event (struct pm_dev *dev, pm_request_t rqst, void *data);
 /* These belong in linux/pci.h. */
 #define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
 #define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
+#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
 
 /* List of cards.  */
 static struct nm256_info *nmcard_list;
@@ -928,7 +929,7 @@ nm256_resetAC97 (struct ac97_hwint *dev)
  * mixer ioctl to the AC97 driver.
  */
 static int
-nm256_default_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
+nm256_default_mixer_ioctl (int dev, unsigned int cmd, void __user *arg)
 {
     struct nm256_info *card = nm256_find_card_for_mixer (dev);
     if (card != NULL)
@@ -1275,6 +1276,8 @@ nm256_probe(struct pci_dev *pcidev,const struct pci_device_id *pciid)
 	return nm256_install(pcidev, REV_NM256AV, "256AV");
     if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO)
 	return nm256_install(pcidev, REV_NM256ZX, "256ZX");
+    if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO)
+	return nm256_install(pcidev, REV_NM256ZX, "256XL+");
     return -1; /* should not come here ... */
 }
 
@@ -1415,7 +1418,7 @@ nm256_audio_close(int dev)
 
 /* Standard ioctl handler. */
 static int
-nm256_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
+nm256_audio_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
     int ret;
     u32 oldinfo;
@@ -1439,7 +1442,7 @@ nm256_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
     switch (cmd)
 	{
 	case SOUND_PCM_WRITE_RATE:
-	    if (get_user(ret, (int *) arg))
+	    if (get_user(ret, (int __user *) arg))
 		return -EFAULT;
 
 	    if (ret != 0) {
@@ -1458,7 +1461,7 @@ nm256_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	    break;
 
 	case SNDCTL_DSP_STEREO:
-	    if (get_user(ret, (int *) arg))
+	    if (get_user(ret, (int __user *) arg))
 		return -EFAULT;
 
 	    card->sinfo[w].stereo = ret ? 1 : 0;
@@ -1469,7 +1472,7 @@ nm256_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	    break;
 
 	case SOUND_PCM_WRITE_CHANNELS:
-	    if (get_user(ret, (int *) arg))
+	    if (get_user(ret, (int __user *) arg))
 		return -EFAULT;
 
 	    if (ret < 1 || ret > 3)
@@ -1487,7 +1490,7 @@ nm256_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	    break;
 
 	case SNDCTL_DSP_SETFMT:
-	    if (get_user(ret, (int *) arg))
+	    if (get_user(ret, (int __user *) arg))
 		return -EFAULT;
 
 	    if (ret != 0) {
@@ -1508,7 +1511,7 @@ nm256_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	default:
 	    return -EINVAL;
 	}
-    return put_user(ret, (int *) arg);
+    return put_user(ret, (int __user *) arg);
 }
 
 /*
@@ -1662,6 +1665,8 @@ static struct pci_device_id nm256_pci_tbl[] = {
 	PCI_ANY_ID, PCI_ANY_ID, 0, 0},
 	{PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO,
 	PCI_ANY_ID, PCI_ANY_ID, 0, 0},
+	{PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO,
+	PCI_ANY_ID, PCI_ANY_ID, 0, 0},
 	{0,}
 };
 MODULE_DEVICE_TABLE(pci, nm256_pci_tbl);
diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c
index cc9ce4731..9789c5ab2 100644
--- a/sound/oss/opl3.c
+++ b/sound/oss/opl3.c
@@ -110,7 +110,7 @@ static void enter_4op_mode(void)
 	devc->v_alloc->max_voice = devc->nr_voice = 12;
 }
 
-static int opl3_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int opl3_ioctl(int dev, unsigned int cmd, void __user * arg)
 {
 	struct sbi_instrument ins;
 	
@@ -822,7 +822,7 @@ static void opl3_hw_control(int dev, unsigned char *event)
 {
 }
 
-static int opl3_load_patch(int dev, int format, const char *addr,
+static int opl3_load_patch(int dev, int format, const char __user *addr,
 		int offs, int count, int pmgr_flag)
 {
 	struct sbi_instrument ins;
@@ -833,7 +833,11 @@ static int opl3_load_patch(int dev, int format, const char *addr,
 		return -EINVAL;
 	}
 
-	if(copy_from_user(&((char *) &ins)[offs], &(addr)[offs], sizeof(ins) - offs))
+	/*
+	 * What the fuck is going on here?  We leave junk in the beginning
+	 * of ins and then check the field pretty close to that beginning?
+	 */
+	if(copy_from_user(&((char *) &ins)[offs], addr + offs, sizeof(ins) - offs))
 		return -EFAULT;
 
 	if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR)
diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c
index 6057e071a..6daba626e 100644
--- a/sound/oss/opl3sa2.c
+++ b/sound/oss/opl3sa2.c
@@ -389,9 +389,10 @@ static inline int ret_vol_stereo(int left, int right)
 }
 
 
-static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int retval, value, cmdf = cmd & 0xff;
+	int __user *p = (int __user *)arg;
 
 	opl3sa2_state_t* devc = &opl3sa2_state[dev];
 	
@@ -416,23 +417,23 @@ static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	if (_SIOC_DIR (cmd) & _SIOC_WRITE) {
 		switch (cmdf) {
 			case SOUND_MIXER_VOLUME:
-				retval = get_user(value, (unsigned int *) arg);
+				retval = get_user(value, (unsigned __user *) arg);
 				if (retval)
 					break;
 				arg_to_vol_stereo(value, &devc->volume_l, &devc->volume_r);
 				opl3sa2_set_volume(devc, devc->volume_l, devc->volume_r);
 				value = ret_vol_stereo(devc->volume_l, devc->volume_r);
-				retval = put_user(value, (int *) arg);
+				retval = put_user(value, p);
 				break;
 		  
 			case SOUND_MIXER_MIC:
-				retval = get_user(value, (unsigned int *) arg);
+				retval = get_user(value, (unsigned __user *) arg);
 				if (retval)
 					break;
 				arg_to_vol_mono(value, &devc->mic);
 				opl3sa2_set_mic(devc, devc->mic);
 				value = ret_vol_mono(devc->mic);
-				retval = put_user(value, (int *) arg);
+				retval = put_user(value, p);
 				break;
 
 			default:
@@ -445,35 +446,35 @@ static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		 */
 		switch (cmdf) {
 			case SOUND_MIXER_DEVMASK:
-				retval = put_user(SOUND_MASK_VOLUME | SOUND_MASK_MIC, (int *) arg);
+				retval = put_user(SOUND_MASK_VOLUME | SOUND_MASK_MIC, p);
 				break;
 		  
 			case SOUND_MIXER_STEREODEVS:
-				retval = put_user(SOUND_MASK_VOLUME, (int *) arg);
+				retval = put_user(SOUND_MASK_VOLUME, p);
 				break;
 		  
 			case SOUND_MIXER_RECMASK:
 				/* No recording devices */
-				retval = put_user(0, (int *) arg);
+				retval = put_user(0, p);
 				break;
 
 			case SOUND_MIXER_CAPS:
-				retval = put_user(SOUND_CAP_EXCL_INPUT, (int *) arg);
+				retval = put_user(SOUND_CAP_EXCL_INPUT, p);
 				break;
 
 			case SOUND_MIXER_RECSRC:
 				/* No recording source */
-				retval = put_user(0, (int *) arg);
+				retval = put_user(0, p);
 				break;
 
 			case SOUND_MIXER_VOLUME:
 				value = ret_vol_stereo(devc->volume_l, devc->volume_r);
-				retval = put_user(value, (int *) arg);
+				retval = put_user(value, p);
 				break;
 			  
 			case SOUND_MIXER_MIC:
 				value = ret_vol_mono(devc->mic);
-				put_user(value, (int *) arg);
+				put_user(value, p);
 				break;
 
 			default:
@@ -485,7 +486,7 @@ static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 /* opl3sa2_mixer_ioctl end */
 
 
-static int opl3sa3_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int opl3sa3_mixer_ioctl(int dev, unsigned int cmd, void __user * arg)
 {
 	int value, retval, cmdf = cmd & 0xff;
 
@@ -494,17 +495,17 @@ static int opl3sa3_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	switch (cmdf) {
 	case SOUND_MIXER_BASS:
 		value = ret_vol_stereo(devc->bass_l, devc->bass_r);
-		retval = put_user(value, (int *) arg);
+		retval = put_user(value, (int __user *) arg);
 		break;
 		
 	case SOUND_MIXER_TREBLE:
 		value = ret_vol_stereo(devc->treble_l, devc->treble_r);
-		retval = put_user(value, (int *) arg);
+		retval = put_user(value, (int __user *) arg);
 		break;
 
 	case SOUND_MIXER_DIGITAL1:
 		value = ret_vol_stereo(devc->wide_l, devc->wide_r);
-		retval = put_user(value, (int *) arg);
+		retval = put_user(value, (int __user *) arg);
 		break;
 
 	default:
diff --git a/sound/oss/os.h b/sound/oss/os.h
index 772d4bc14..d6b962978 100644
--- a/sound/oss/os.h
+++ b/sound/oss/os.h
@@ -42,7 +42,7 @@ extern void reprogram_timer(void);
 
 #define USE_AUTOINIT_DMA
 
-extern caddr_t sound_mem_blocks[1024];
+extern void *sound_mem_blocks[1024];
 extern int sound_nblocks;
 
 #undef PSEUDO_DMA_AUTOINIT
diff --git a/sound/oss/pas2_mixer.c b/sound/oss/pas2_mixer.c
index 57d95d7ec..4aade5304 100644
--- a/sound/oss/pas2_mixer.c
+++ b/sound/oss/pas2_mixer.c
@@ -215,13 +215,14 @@ pas_mixer_reset(void)
 	set_mode(0x04 | 0x01);
 }
 
-static int pas_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int pas_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int level,v ;
+	int __user *p = (int __user *)arg;
 
 	DEB(printk("pas2_mixer.c: int pas_mixer_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg));
 	if (cmd == SOUND_MIXER_PRIVATE1) { /* Set loudness bit */
-		if (get_user(level, (int *)arg))
+		if (get_user(level, p))
 			return -EFAULT;
 		if (level == -1)  /* Return current settings */
 			level = (mode_control & 0x04);
@@ -232,10 +233,10 @@ static int pas_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			set_mode(mode_control);
 		}
 		level = !!level;
-		return put_user(level, (int *)arg);
+		return put_user(level, p);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE2) { /* Set enhance bit */
-		if (get_user(level, (int *)arg))
+		if (get_user(level, p))
 			return -EFAULT;
 		if (level == -1) { /* Return current settings */
 			if (!(mode_control & 0x03))
@@ -255,10 +256,10 @@ static int pas_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 				i = (i + 1) * 20;
 			level = i;
 		}
-		return put_user(level, (int *)arg);
+		return put_user(level, p);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE3) { /* Set mute bit */
-		if (get_user(level, (int *)arg))
+		if (get_user(level, p))
 			return -EFAULT;
 		if (level == -1)	/* Return current settings */
 			level = !(pas_read(0x0B8A) & 0x20);
@@ -270,10 +271,10 @@ static int pas_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 
 			level = !(pas_read(0x0B8A) & 0x20);
 		}
-		return put_user(level, (int *)arg);
+		return put_user(level, p);
 	}
 	if (((cmd >> 8) & 0xff) == 'M') {
-		if (get_user(v, (int *)arg))
+		if (get_user(v, p))
 			return -EFAULT;
 		if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
 			v = pas_mixer_set(cmd & 0xff, v);
@@ -304,7 +305,7 @@ static int pas_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 				break;
 			}
 		}
-		return put_user(v, (int *)arg);
+		return put_user(v, p);
 	}
 	return -EINVAL;
 }
diff --git a/sound/oss/pas2_pcm.c b/sound/oss/pas2_pcm.c
index 6805962af..4af6aafa3 100644
--- a/sound/oss/pas2_pcm.c
+++ b/sound/oss/pas2_pcm.c
@@ -17,6 +17,7 @@
 
 #include <linux/init.h>
 #include <linux/spinlock.h>
+#include <asm/timex.h>
 #include "sound_config.h"
 
 #include "pas2.h"
@@ -62,13 +63,13 @@ static int pcm_set_speed(int arg)
 
 	if (pcm_channels & 2)
 	{
-		foo = (596590 + (arg / 2)) / arg;
-		arg = (596590 + (foo / 2)) / foo;
+		foo = ((CLOCK_TICK_RATE / 2) + (arg / 2)) / arg;
+		arg = ((CLOCK_TICK_RATE / 2) + (foo / 2)) / foo;
 	}
 	else
 	{
-		foo = (1193180 + (arg / 2)) / arg;
-		arg = (1193180 + (foo / 2)) / foo;
+		foo = (CLOCK_TICK_RATE + (arg / 2)) / arg;
+		arg = (CLOCK_TICK_RATE + (foo / 2)) / foo;
 	}
 
 	pcm_speed = arg;
@@ -150,16 +151,17 @@ static int pcm_set_bits(int arg)
 	return pcm_bits;
 }
 
-static int pas_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int pas_audio_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	int val, ret;
+	int __user *p = arg;
 
 	DEB(printk("pas2_pcm.c: static int pas_audio_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg));
 
 	switch (cmd) 
 	{
 	case SOUND_PCM_WRITE_RATE:
-		if (get_user(val, (int *)arg)) 
+		if (get_user(val, p)) 
 			return -EFAULT;
 		ret = pcm_set_speed(val);
 		break;
@@ -169,13 +171,13 @@ static int pas_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		break;
 		
 	case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg)) 
+		if (get_user(val, p)) 
 			return -EFAULT;
 		ret = pcm_set_channels(val + 1) - 1;
 		break;
 
 	case SOUND_PCM_WRITE_CHANNELS:
-		if (get_user(val, (int *)arg)) 
+		if (get_user(val, p)) 
 			return -EFAULT;
 		ret = pcm_set_channels(val);
 		break;
@@ -185,7 +187,7 @@ static int pas_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		break;
 
 	case SNDCTL_DSP_SETFMT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		ret = pcm_set_bits(val);
 		break;
@@ -197,7 +199,7 @@ static int pas_audio_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	default:
 		return -EINVAL;
 	}
-	return put_user(ret, (int *)arg);
+	return put_user(ret, p);
 }
 
 static void pas_audio_reset(int dev)
diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index 9a1c91580..38019143b 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -453,20 +453,36 @@ static void pss_mixer_reset(pss_confdata *devc)
 	}
 }
 
-static void arg_to_volume_mono(unsigned int volume, int *aleft)
+static int set_volume_mono(unsigned __user *p, int *aleft)
 {
 	int left;
+	unsigned volume;
+	if (get_user(volume, p))
+		return -EFAULT;
 	
-	left = volume & 0x00ff;
+	left = volume & 0xff;
 	if (left > 100)
 		left = 100;
 	*aleft = left;
+	return 0;
 }
 
-static void arg_to_volume_stereo(unsigned int volume, int *aleft, int *aright)
+static int set_volume_stereo(unsigned __user *p, int *aleft, int *aright)
 {
-	arg_to_volume_mono(volume, aleft);
-	arg_to_volume_mono(volume >> 8, aright);
+	int left, right;
+	unsigned volume;
+	if (get_user(volume, p))
+		return -EFAULT;
+
+	left = volume & 0xff;
+	if (left > 100)
+		left = 100;
+	right = (volume >> 8) & 0xff;
+	if (right > 100)
+		right = 100;
+	*aleft = left;
+	*aright = right;
+	return 0;
 }
 
 static int ret_vol_mono(int left)
@@ -479,7 +495,7 @@ static int ret_vol_stereo(int left, int right)
 	return ((right << 8) | left);
 }
 
-static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, caddr_t arg)
+static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, void __user *arg)
 {
 	if (devc->ad_mixer_dev != NO_WSS_MIXER) 
 		return mixer_devs[devc->ad_mixer_dev]->ioctl(devc->ad_mixer_dev, cmd, arg);
@@ -487,7 +503,7 @@ static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, caddr_t arg)
 		return -EINVAL;
 }
 
-static int pss_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
+static int pss_mixer_ioctl (int dev, unsigned int cmd, void __user *arg)
 {
 	pss_confdata *devc = mixer_devs[dev]->devc;
 	int cmdf = cmd & 0xff;
@@ -513,33 +529,38 @@ static int pss_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 					return call_ad_mixer(devc, cmd, arg);
 				else
 				{
-					if (*(int *)arg != 0)
+					int v;
+					if (get_user(v, (int __user *)arg))
+						return -EFAULT;
+					if (v != 0)
 						return -EINVAL;
 					return 0;
 				}
 			case SOUND_MIXER_VOLUME:
-				arg_to_volume_stereo(*(unsigned int *)arg, &devc->mixer.volume_l,
-					&devc->mixer.volume_r); 
+				if (set_volume_stereo(arg,
+					&devc->mixer.volume_l,
+					&devc->mixer.volume_r))
+					return -EFAULT;
 				set_master_volume(devc, devc->mixer.volume_l,
 					devc->mixer.volume_r);
 				return ret_vol_stereo(devc->mixer.volume_l,
 					devc->mixer.volume_r);
 		  
 			case SOUND_MIXER_BASS:
-				arg_to_volume_mono(*(unsigned int *)arg,
-					&devc->mixer.bass);
+				if (set_volume_mono(arg, &devc->mixer.bass))
+					return -EFAULT;
 				set_bass(devc, devc->mixer.bass);
 				return ret_vol_mono(devc->mixer.bass);
 		  
 			case SOUND_MIXER_TREBLE:
-				arg_to_volume_mono(*(unsigned int *)arg,
-					&devc->mixer.treble);
+				if (set_volume_mono(arg, &devc->mixer.treble))
+					return -EFAULT;
 				set_treble(devc, devc->mixer.treble);
 				return ret_vol_mono(devc->mixer.treble);
 		  
 			case SOUND_MIXER_SYNTH:
-				arg_to_volume_mono(*(unsigned int *)arg,
-					&devc->mixer.synth);
+				if (set_volume_mono(arg, &devc->mixer.synth))
+					return -EFAULT;
 				set_synth_volume(devc, devc->mixer.synth);
 				return ret_vol_mono(devc->mixer.synth);
 		  
@@ -549,54 +570,67 @@ static int pss_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
 	}
 	else			
 	{
+		int val, and_mask = 0, or_mask = 0;
 		/*
 		 * Return parameters
 		 */
 		switch (cmdf)
 		{
-
 			case SOUND_MIXER_DEVMASK:
 				if (call_ad_mixer(devc, cmd, arg) == -EINVAL)
-					*(int *)arg = 0; /* no mixer devices */
-				return (*(int *)arg |= SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | SOUND_MASK_SYNTH);
+					break;
+				and_mask = ~0;
+				or_mask = SOUND_MASK_VOLUME | SOUND_MASK_BASS | SOUND_MASK_TREBLE | SOUND_MASK_SYNTH;
+				break;
 		  
 			case SOUND_MIXER_STEREODEVS:
 				if (call_ad_mixer(devc, cmd, arg) == -EINVAL)
-					*(int *)arg = 0; /* no stereo devices */
-				return (*(int *)arg |= SOUND_MASK_VOLUME);
+					break;
+				and_mask = ~0;
+				or_mask = SOUND_MASK_VOLUME;
+				break;
 		  
 			case SOUND_MIXER_RECMASK:
 				if (devc->ad_mixer_dev != NO_WSS_MIXER)
 					return call_ad_mixer(devc, cmd, arg);
-				else
-					return (*(int *)arg = 0); /* no record devices */
+				break;
 
 			case SOUND_MIXER_CAPS:
 				if (devc->ad_mixer_dev != NO_WSS_MIXER)
 					return call_ad_mixer(devc, cmd, arg);
-				else
-					return (*(int *)arg = SOUND_CAP_EXCL_INPUT);
+				or_mask = SOUND_CAP_EXCL_INPUT;
+				break;
 
 			case SOUND_MIXER_RECSRC:
 				if (devc->ad_mixer_dev != NO_WSS_MIXER)
 					return call_ad_mixer(devc, cmd, arg);
-				else
-					return (*(int *)arg = 0); /* no record source */
+				break;
 
 			case SOUND_MIXER_VOLUME:
-				return (*(int *)arg = ret_vol_stereo(devc->mixer.volume_l, devc->mixer.volume_r));
+				or_mask =  ret_vol_stereo(devc->mixer.volume_l, devc->mixer.volume_r);
+				break;
 			  
 			case SOUND_MIXER_BASS:
-				return (*(int *)arg = ret_vol_mono(devc->mixer.bass));
+				or_mask =  ret_vol_mono(devc->mixer.bass);
+				break;
 			  
 			case SOUND_MIXER_TREBLE:
-				return (*(int *)arg = ret_vol_mono(devc->mixer.treble));
+				or_mask = ret_vol_mono(devc->mixer.treble);
+				break;
 			  
 			case SOUND_MIXER_SYNTH:
-				return (*(int *)arg = ret_vol_mono(devc->mixer.synth));
+				or_mask = ret_vol_mono(devc->mixer.synth);
+				break;
 			default:
 				return -EINVAL;
 		}
+		if (get_user(val, (int __user *)arg))
+			return -EFAULT;
+		val &= and_mask;
+		val |= or_mask;
+		if (put_user(val, (int __user *)arg))
+			return -EFAULT;
+		return val;
 	}
 }
 
@@ -803,7 +837,7 @@ static int download_boot_block(void *dev_info, copr_buffer * buf)
 	return 0;
 }
 
-static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, caddr_t arg, int local)
+static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg, int local)
 {
 	copr_buffer *buf;
 	copr_msg *mbuf;
diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
index 9e9669320..404ba23b1 100644
--- a/sound/oss/rme96xx.c
+++ b/sound/oss/rme96xx.c
@@ -661,13 +661,13 @@ inline int rme96xx_getispace(struct dmabuf * dma, unsigned int hwp)
 }
 
 
-inline int rme96xx_copyfromuser(struct dmabuf* dma,const char* buffer,int count,int hop)
+inline int rme96xx_copyfromuser(struct dmabuf* dma,const char __user * buffer,int count,int hop)
 {
 	int swptr = dma->writeptr;
 	switch (dma->format) {
 	case AFMT_S32_BLOCKED:
 	{
-	     char* buf = (char*)buffer;
+	     char __user * buf = (char __user *)buffer;
 	     int cnt = count/dma->outchannels;
 	     int i;
 	     for (i=0;i < dma->outchannels;i++) {
@@ -686,7 +686,7 @@ inline int rme96xx_copyfromuser(struct dmabuf* dma,const char* buffer,int count,
 	     int i,j;
 	     int cnt = count/dma->outchannels;
 	     for (i=0;i < dma->outchannels + dma->mono;i++) {
-		     short* sbuf = (short*)buffer + i*(!dma->mono);
+		     short __user * sbuf = (short __user *)buffer + i*(!dma->mono);
 		     short* hwbuf =(short*) &dma->s->playbuf[(dma->outoffset + i)*RME96xx_DMA_MAX_SAMPLES];	     
 		     hwbuf+=(swptr>>1);
 		     for (j=0;j<(cnt>>1);j++) {
@@ -710,13 +710,13 @@ inline int rme96xx_copyfromuser(struct dmabuf* dma,const char* buffer,int count,
 }
 
 /* The count argument is the number of bytes */
-inline int rme96xx_copytouser(struct dmabuf* dma,const char* buffer,int count,int hop)
+inline int rme96xx_copytouser(struct dmabuf* dma,const char __user* buffer,int count,int hop)
 {
 	int swptr = dma->readptr;
 	switch (dma->format) {
 	case AFMT_S32_BLOCKED:
 	{
-	     char* buf = (char*)buffer;
+	     char __user * buf = (char __user *)buffer;
 	     int cnt = count/dma->inchannels;
 	     int i;
 
@@ -736,7 +736,7 @@ inline int rme96xx_copytouser(struct dmabuf* dma,const char* buffer,int count,in
 	     int i,j;
 	     int cnt = count/dma->inchannels;
 	     for (i=0;i < dma->inchannels;i++) {
-		  short* sbuf = (short*)buffer + i;
+		  short __user * sbuf = (short __user *)buffer + i;
 		  short* hwbuf =(short*) &dma->s->recbuf[(dma->inoffset + i)*RME96xx_DMA_MAX_SAMPLES];	     
 		  hwbuf+=(swptr>>1);
 		  for (j=0;j<(cnt>>1);j++) {
@@ -1121,7 +1121,6 @@ module_exit(cleanup_rme96xx);
 
 static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd, unsigned long arg)
 {
-
 	struct dmabuf * dma = (struct dmabuf *)file->private_data; 
 	rme96xx_info *s = dma->s;
 	unsigned long flags;
@@ -1129,6 +1128,8 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
         count_info cinfo;
 	int count;
 	int val = 0;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
 
@@ -1136,7 +1137,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 #if 0
@@ -1149,14 +1150,14 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 //		rme96xx_clearbufs(dma);
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 /* generally it's not a problem if we change the speed 
@@ -1195,10 +1196,10 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 			spin_unlock_irqrestore(&s->lock, flags);
 		}
 		DBG(printk("speed set to %d\n",val));
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
         case SNDCTL_DSP_STEREO: /* this plays a mono file on two channels */
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		
 		if (!val) {
@@ -1216,7 +1217,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 		return 0;
         case SNDCTL_DSP_CHANNELS:
 		/* remember to check for resonable offset/channel pairs here */
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 
 		if (file->f_mode & FMODE_WRITE) { 			
@@ -1236,14 +1237,14 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 
 		dma->mono=0;
 
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(RME96xx_FMT, (int *)arg);
+                return put_user(RME96xx_FMT, p);
 		
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
 		DBG(printk("setting to format %x\n",val)); 
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			if (val & RME96xx_FMT)
@@ -1257,7 +1258,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 				break;
 			}
 		}
-		return put_user(dma->format, (int *)arg);
+		return put_user(dma->format, p);
 		
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -1270,10 +1271,10 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 		if (file->f_mode & FMODE_WRITE && s->ctrl & CTRL_DAC2_EN) 
 			val |= PCM_ENABLE_OUTPUT;
 #endif
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 #if 0
 		if (file->f_mode & FMODE_READ) {
@@ -1309,7 +1310,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
                 abinfo.fragstotal = 2;
                 abinfo.fragments = (count > s->fragsize); 
 
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -1323,7 +1324,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
                 abinfo.bytes = (count*dma->inchannels)>>dma->formatshift;
                 abinfo.fragstotal = 2;
                 abinfo.fragments = count > s->fragsize; 
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -1339,7 +1340,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 		if (count < 0)
 			count += s->fragsize<<1;
 
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
 
 /* check out how to use mmaped mode (can only be blocked !!!) */
@@ -1359,7 +1360,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 			dma->readptr &= s->fragsize<<1;
 		spin_unlock_irqrestore(&s->lock,flags);
 
-                if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+                if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1378,14 +1379,14 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 		if (dma->mmapped)
 			dma->writeptr &= s->fragsize<<1;
 		spin_unlock_irqrestore(&s->lock,flags);
-                if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+                if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
         case SNDCTL_DSP_GETBLKSIZE:
-	     return put_user(s->fragsize, (int *)arg);
+	     return put_user(s->fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		val&=0xffff;
 		val -= 7;
@@ -1399,7 +1400,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac2.subdivision))
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -1413,10 +1414,10 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
         case SOUND_PCM_READ_RATE:
 		/* HP20020201 */
 		s->rate = rme96xx_get_sample_rate_status(s);
-		return put_user(s->rate, (int *)arg);
+		return put_user(s->rate, p);
 
         case SOUND_PCM_READ_CHANNELS:
-		return put_user(dma->outchannels, (int *)arg);
+		return put_user(dma->outchannels, p);
 
         case SOUND_PCM_READ_BITS:
 		switch (dma->format) {
@@ -1427,7 +1428,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd,
 				val = 16;
 				break;
 		}
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -1529,7 +1530,7 @@ static int rme96xx_release(struct inode *in, struct file *file)
 }
 
 
-static ssize_t rme96xx_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t rme96xx_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct dmabuf *dma = (struct dmabuf *)file->private_data;
 	ssize_t ret = 0;
@@ -1597,7 +1598,7 @@ static ssize_t rme96xx_write(struct file *file, const char *buffer, size_t count
 	return ret;
 }
 
-static ssize_t rme96xx_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t rme96xx_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 { 
 	struct dmabuf *dma = (struct dmabuf *)file->private_data;
 	ssize_t ret = 0;
@@ -1793,6 +1794,8 @@ static int rme96xx_mixer_ioctl(struct inode *inode, struct file *file, unsigned
 	rme96xx_info *s = (rme96xx_info *)file->private_data;
 	u32 status;
 	int spdifrate;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	status = readl(s->iobase + RME96xx_status_register);
 	/* hack to convert rev 1.5 SPDIF rate to "crystalrate" format   HP 20020201 */
@@ -1802,7 +1805,7 @@ static int rme96xx_mixer_ioctl(struct inode *inode, struct file *file, unsigned
 	VALIDATE_STATE(s);
 	if (cmd == SOUND_MIXER_PRIVATE1) {
 		rme_mixer mixer;
-		if (copy_from_user(&mixer,(void*)arg,sizeof(mixer)))
+		if (copy_from_user(&mixer,argp,sizeof(mixer)))
 			return -EFAULT;
 		
 		mixer.devnr &= RME96xx_MASK_DEVS;
@@ -1825,14 +1828,14 @@ static int rme96xx_mixer_ioctl(struct inode *inode, struct file *file, unsigned
 		mixer.o_offset = s->dma[mixer.devnr].outoffset;
 		mixer.i_offset = s->dma[mixer.devnr].inoffset;
 
-		return copy_to_user((void *)arg, &mixer, sizeof(mixer)) ? -EFAULT : 0;
+		return copy_to_user(argp, &mixer, sizeof(mixer)) ? -EFAULT : 0;
 	}
 	if (cmd == SOUND_MIXER_PRIVATE2) {
-		return put_user(status, (int *)arg);
+		return put_user(status, p);
 	}
 	if (cmd == SOUND_MIXER_PRIVATE3) {
 		u32 control;
-		if (copy_from_user(&control,(void*)arg,sizeof(control)))
+		if (copy_from_user(&control,argp,sizeof(control)))
 			return -EFAULT;
 		if (file->f_mode & FMODE_WRITE) {
 			s->control_register &= ~RME96xx_mixer_allowed;
@@ -1840,7 +1843,7 @@ static int rme96xx_mixer_ioctl(struct inode *inode, struct file *file, unsigned
 			writel(control,s->iobase + RME96xx_control_register);
 		}
 
-	     return put_user(s->control_register, (int *)arg);
+	     return put_user(s->control_register, p);
 	}
 	return -1;
 }
diff --git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c
index 7f7b1c11c..40914dd0c 100644
--- a/sound/oss/sb_audio.c
+++ b/sound/oss/sb_audio.c
@@ -836,7 +836,7 @@ static signed short *lbuf16 = (signed short *)lbuf8;
 static void
 sb16_copy_from_user(int dev,
 		char *localbuf, int localoffs,
-		const char *userbuf, int useroffs,
+		const char __user *userbuf, int useroffs,
 		int max_in, int max_out,
 		int *used, int *returned,
 		int len)
diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c
index 18f7498fc..b5f5ecbf2 100644
--- a/sound/oss/sb_card.c
+++ b/sound/oss/sb_card.c
@@ -181,6 +181,13 @@ static void sb_dev2cfg(struct pnp_dev *dev, struct sb_card_config *scc)
 		scc->mpucnf.io_base = pnp_port_start(dev,1);
 		return;
 	}
+	if(!strncmp("tBA",scc->card_id,3)) {
+		scc->conf.io_base   = pnp_port_start(dev,0);
+		scc->conf.irq       = pnp_irq(dev,0);
+		scc->conf.dma       = pnp_dma(dev,0);
+		scc->conf.dma2      = pnp_dma(dev,1);
+		return;
+	}
 	if(!strncmp("ESS",scc->card_id,3)) {
 		scc->conf.io_base   = pnp_port_start(dev,0);
 		scc->conf.irq       = pnp_irq(dev,0);
diff --git a/sound/oss/sb_card.h b/sound/oss/sb_card.h
index 6425c13cc..5535cff80 100644
--- a/sound/oss/sb_card.h
+++ b/sound/oss/sb_card.h
@@ -140,6 +140,8 @@ static struct pnp_card_device_id sb_pnp_card_table[] = {
 	{.id = "RTL3000", .driver_data = 0, .devs = { {.id="@@@2001"},
 						     {.id="@X@2001"},
 						     {.id="@H@0001"}, } },
+	/* Sound Blaster 16 (Virtual PC 2004) */
+	{.id = "tBA03b0", .driver_data = 0, .devs = { {.id="PNPb003"}, } },
 	/* -end- */
 	{.id = "", }
 };
diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c
index 3639a53c7..249d69cbb 100644
--- a/sound/oss/sb_common.c
+++ b/sound/oss/sb_common.c
@@ -943,7 +943,10 @@ void sb_setmixer(sb_devc * devc, unsigned int port, unsigned int value)
 {
 	unsigned long flags;
 
-	if (devc->model == MDL_ESS) return ess_setmixer (devc, port, value);
+	if (devc->model == MDL_ESS) {
+		ess_setmixer (devc, port, value);
+		return;
+	}
 
 	spin_lock_irqsave(&devc->lock, flags);
 
diff --git a/sound/oss/sb_midi.c b/sound/oss/sb_midi.c
index 449357eec..ed3bd0640 100644
--- a/sound/oss/sb_midi.c
+++ b/sound/oss/sb_midi.c
@@ -118,7 +118,7 @@ static int sb_midi_end_read(int dev)
 	return 0;
 }
 
-static int sb_midi_ioctl(int dev, unsigned cmd, caddr_t arg)
+static int sb_midi_ioctl(int dev, unsigned cmd, void __user *arg)
 {
         return -EINVAL;
 }
diff --git a/sound/oss/sb_mixer.c b/sound/oss/sb_mixer.c
index 4e83b586a..f56898c39 100644
--- a/sound/oss/sb_mixer.c
+++ b/sound/oss/sb_mixer.c
@@ -528,10 +528,11 @@ static int set_outmask(sb_devc * devc, int mask)
 	return devc->outmask;
 }
 
-static int sb_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int sb_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	sb_devc *devc = mixer_devs[dev]->devc;
 	int val, ret;
+	int __user *p = arg;
 
 	/*
 	 * Use ioctl(fd, SOUND_MIXER_AGC, &mode) to turn AGC off (0) or on (1).
@@ -541,7 +542,7 @@ static int sb_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	if (devc->model == MDL_SB16) {
 		if (cmd == SOUND_MIXER_AGC) 
 		{
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			sb_setmixer(devc, 0x43, (~val) & 0x01);
 			return 0;
@@ -552,14 +553,14 @@ static int sb_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			   At least my 4.13 havn't 3DSE, 4.16 has it. */
 			if (devc->minor < 15)
 				return -EINVAL;
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val == 0 || val == 1)
 				sb_chgmixer(devc, AWE_3DSE, 0x01, val);
 			else if (val == 2)
 			{
 				ret = sb_getmixer(devc, AWE_3DSE)&0x01;
-				return put_user(ret, (int *)arg);
+				return put_user(ret, p);
 			}
 			else
 				return -EINVAL;
@@ -570,7 +571,7 @@ static int sb_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	{
 		if (_SIOC_DIR(cmd) & _SIOC_WRITE) 
 		{
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			switch (cmd & 0xff) 
 			{
@@ -625,7 +626,7 @@ static int sb_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 				ret = sb_mixer_get(devc, cmd & 0xff);
 				break;
 		}
-		return put_user(ret, (int *)arg); 
+		return put_user(ret, p); 
 	} else
 		return -EINVAL;
 }
diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c
index 04f334edf..038bf7fd3 100644
--- a/sound/oss/sequencer.c
+++ b/sound/oss/sequencer.c
@@ -82,7 +82,7 @@ static void     seq_reset(void);
 #error Too many synthesizer devices enabled.
 #endif
 
-int sequencer_read(int dev, struct file *file, char *buf, int count)
+int sequencer_read(int dev, struct file *file, char __user *buf, int count)
 {
 	int c = count, p = 0;
 	int ev_len;
@@ -207,7 +207,7 @@ void seq_input_event(unsigned char *event_rec, int len)
 	seq_copy_to_input(event_rec, len);
 }
 
-int sequencer_write(int dev, struct file *file, const char *buf, int count)
+int sequencer_write(int dev, struct file *file, const char __user *buf, int count)
 {
 	unsigned char event_rec[EV_SZ], ev_code;
 	int p = 0, c, ev_size;
@@ -1320,13 +1320,14 @@ static void seq_panic(void)
 	 */
 }
 
-int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
+int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, void __user *arg)
 {
 	int midi_dev, orig_dev, val, err;
 	int mode = translate_mode(file);
 	struct synth_info inf;
 	struct seq_event_rec event_rec;
 	unsigned long flags;
+	int __user *p = arg;
 
 	orig_dev = dev = dev >> 4;
 
@@ -1346,7 +1347,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 		case SNDCTL_TMR_SELECT:
 			if (seq_mode != SEQ_2)
 				return -EINVAL;
-			if (get_user(pending_timer, (int *)arg))
+			if (get_user(pending_timer, p))
 				return -EFAULT;
 			if (pending_timer < 0 || pending_timer >= num_sound_timers || sound_timer_devs[pending_timer] == NULL)
 			{
@@ -1372,7 +1373,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			return 0;
 
 		case SNDCTL_SEQ_TESTMIDI:
-			if (__get_user(midi_dev, (int *)arg))
+			if (__get_user(midi_dev, p))
 				return -EFAULT;
 			if (midi_dev < 0 || midi_dev >= max_mididev || !midi_devs[midi_dev])
 				return -ENXIO;
@@ -1409,7 +1410,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			if (seq_mode == SEQ_2)
 				return tmr->ioctl(tmr_no, cmd, arg);
 
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val != 0)
 				return -EINVAL;
@@ -1419,7 +1420,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 		case SNDCTL_SEQ_RESETSAMPLES:
 		case SNDCTL_SYNTH_REMOVESAMPLE:
 		case SNDCTL_SYNTH_CONTROL:
-			if (get_user(dev, (int *)arg))
+			if (get_user(dev, p))
 				return -EFAULT;
 			if (dev < 0 || dev >= num_synths || synth_devs[dev] == NULL)
 				return -ENXIO;
@@ -1436,7 +1437,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			break;
 
 		case SNDCTL_SYNTH_MEMAVL:
-			if (get_user(dev, (int *)arg))
+			if (get_user(dev, p))
 				return -EFAULT;
 			if (dev < 0 || dev >= num_synths || synth_devs[dev] == NULL)
 				return -ENXIO;
@@ -1446,7 +1447,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			break;
 
 		case SNDCTL_FM_4OP_ENABLE:
-			if (get_user(dev, (int *)arg))
+			if (get_user(dev, p))
 				return -EFAULT;
 			if (dev < 0 || dev >= num_synths || synth_devs[dev] == NULL)
 				return -ENXIO;
@@ -1456,7 +1457,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			return 0;
 
 		case SNDCTL_SYNTH_INFO:
-			if (get_user(dev, (int *)(&(((struct synth_info *)arg)->device))))
+			if (get_user(dev, &((struct synth_info __user *)arg)->device))
 				return -EFAULT;
 			if (dev < 0 || dev >= max_synthdev)
 				return -ENXIO;
@@ -1466,7 +1467,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 
 		/* Like SYNTH_INFO but returns ID in the name field */
 		case SNDCTL_SYNTH_ID:
-			if (get_user(dev, (int *)(&(((struct synth_info *)arg)->device))))
+			if (get_user(dev, &((struct synth_info __user *)arg)->device))
 				return -EFAULT;
 			if (dev < 0 || dev >= max_synthdev)
 				return -ENXIO;
@@ -1486,7 +1487,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			return 0;
 
 		case SNDCTL_MIDI_INFO:
-			if (get_user(dev, (int *)(&(((struct midi_info *)arg)->device))))
+			if (get_user(dev, &((struct midi_info __user *)arg)->device))
 				return -EFAULT;
 			if (dev < 0 || dev >= max_mididev || !midi_devs[dev])
 				return -ENXIO;
@@ -1494,7 +1495,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			return copy_to_user(arg, &midi_devs[dev]->info, sizeof(struct midi_info))?-EFAULT:0;
 
 		case SNDCTL_SEQ_THRESHOLD:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val < 1)
 				val = 1;
@@ -1504,7 +1505,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 			return 0;
 
 		case SNDCTL_MIDI_PRETIME:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val < 0)
 				val = 0;
@@ -1523,7 +1524,7 @@ int sequencer_ioctl(int dev, struct file *file, unsigned int cmd, caddr_t arg)
 				return -EINVAL;
 			return synth_devs[0]->ioctl(0, cmd, arg);
 	}
-	return put_user(val, (int *)arg);
+	return put_user(val, p);
 }
 
 /* No kernel lock - we're using the global irq lock here */
diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
index 9bb3596c7..e231cf0a7 100644
--- a/sound/oss/sonicvibes.c
+++ b/sound/oss/sonicvibes.c
@@ -1042,6 +1042,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 	unsigned long flags;
 	int i, val;
 	unsigned char l, r, rl, rr;
+	int __user *p = (int __user *)arg;
 
 	VALIDATE_STATE(s);
         if (cmd == SOUND_MIXER_INFO) {
@@ -1050,7 +1051,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 		strlcpy(info.id, "SonicVibes", sizeof(info.id));
 		strlcpy(info.name, "S3 SonicVibes", sizeof(info.name));
 		info.modify_counter = s->mix.modcnt;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -1059,14 +1060,14 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 		memset(&info, 0, sizeof(info));
 		strlcpy(info.id, "SonicVibes", sizeof(info.id));
 		strlcpy(info.name, "S3 SonicVibes", sizeof(info.name));
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 	if (cmd == SOUND_MIXER_PRIVATE1) {  /* SRS settings */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		spin_lock_irqsave(&s->lock, flags);
 		if (val & 1) {
@@ -1086,47 +1087,47 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 		r = rdindir(s, SV_CISRSCENTER);
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (l & 0x80)
-			return put_user(0, (int *)arg);
-		return put_user(((4 - (l & 7)) << 2) | ((4 - (r & 7)) << 5) | 2, (int *)arg);
+			return put_user(0, p);
+		return put_user(((4 - (l & 7)) << 2) | ((4 - (r & 7)) << 5) | 2, p);
 	}
 	if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
                 return -EINVAL;
         if (_SIOC_DIR(cmd) == _SIOC_READ) {
                 switch (_IOC_NR(cmd)) {
                 case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-			return put_user(mixer_recmask(s), (int *)arg);
+			return put_user(mixer_recmask(s), p);
 			
                 case SOUND_MIXER_DEVMASK: /* Arg contains a bit for each supported device */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].type)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 
                 case SOUND_MIXER_RECMASK: /* Arg contains a bit for each supported recording source */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].rec)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 			
                 case SOUND_MIXER_STEREODEVS: /* Mixer channels supporting stereo */
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].type && mixtable[i].type != MT_4MUTEMONO)
 					val |= 1 << i;
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 			
                 case SOUND_MIXER_CAPS:
-			return put_user(SOUND_CAP_EXCL_INPUT, (int *)arg);
+			return put_user(SOUND_CAP_EXCL_INPUT, p);
 
 		default:
 			i = _IOC_NR(cmd);
                         if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].type)
                                 return -EINVAL;
 #ifdef OSS_DOCUMENTED_MIXER_SEMANTICS
-			return return_mixval(s, i, (int *)arg);
+			return return_mixval(s, i, p);
 #else /* OSS_DOCUMENTED_MIXER_SEMANTICS */
 			if (!volidx[i])
 				return -EINVAL;
-			return put_user(s->mix.vol[volidx[i]-1], (int *)arg);
+			return put_user(s->mix.vol[volidx[i]-1], p);
 #endif /* OSS_DOCUMENTED_MIXER_SEMANTICS */
 		}
 	}
@@ -1135,7 +1136,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 	s->mix.modcnt++;
 	switch (_IOC_NR(cmd)) {
 	case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		i = hweight32(val);
 		if (i == 0)
@@ -1160,7 +1161,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 		i = _IOC_NR(cmd);
 		if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].type)
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		l = val & 0xff;
 		r = (val >> 8) & 0xff;
@@ -1224,12 +1225,12 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
 		}
 		spin_unlock_irqrestore(&s->lock, flags);
 #ifdef OSS_DOCUMENTED_MIXER_SEMANTICS
-                return return_mixval(s, i, (int *)arg);
+                return return_mixval(s, i, p);
 #else /* OSS_DOCUMENTED_MIXER_SEMANTICS */
 		if (!volidx[i])
 			return -EINVAL;
 		s->mix.vol[volidx[i]-1] = val;
-		return put_user(s->mix.vol[volidx[i]-1], (int *)arg);
+		return put_user(s->mix.vol[volidx[i]-1], p);
 #endif /* OSS_DOCUMENTED_MIXER_SEMANTICS */
 	}
 }
@@ -1314,7 +1315,7 @@ static int drain_dac(struct sv_state *s, int nonblock)
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t sv_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t sv_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct sv_state *s = (struct sv_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1399,7 +1400,7 @@ static ssize_t sv_read(struct file *file, char *buffer, size_t count, loff_t *pp
 	return ret;
 }
 
-static ssize_t sv_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t sv_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct sv_state *s = (struct sv_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1570,13 +1571,15 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 	int count;
 	int val, mapped, ret;
 	unsigned char fmtm, fmtd;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(s);
         mapped = ((file->f_mode & FMODE_WRITE) && s->dma_dac.mapped) ||
 		((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
@@ -1587,7 +1590,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
-		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, (int *)arg);
+		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
 		
         case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
@@ -1603,7 +1606,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val >= 0) {
 			if (file->f_mode & FMODE_READ) {
@@ -1617,10 +1620,10 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 				set_dac_rate(s, val);
 			}
 		}
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 		
         case SNDCTL_DSP_STEREO:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		fmtd = 0;
 		fmtm = ~0;
@@ -1644,7 +1647,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
         case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 0) {
 			fmtd = 0;
@@ -1668,13 +1671,13 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			set_fmt(s, fmtm, fmtd);
 		}
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (SV_CFMT_STEREO << SV_CFMT_CSHIFT) 
-					   : (SV_CFMT_STEREO << SV_CFMT_ASHIFT))) ? 2 : 1, (int *)arg);
+					   : (SV_CFMT_STEREO << SV_CFMT_ASHIFT))) ? 2 : 1, p);
 		
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+                return put_user(AFMT_S16_LE|AFMT_U8, p);
 		
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			fmtd = 0;
@@ -1698,7 +1701,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			set_fmt(s, fmtm, fmtd);
 		}
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (SV_CFMT_16BIT << SV_CFMT_CSHIFT) 
-					   : (SV_CFMT_16BIT << SV_CFMT_ASHIFT))) ? AFMT_S16_LE : AFMT_U8, (int *)arg);
+					   : (SV_CFMT_16BIT << SV_CFMT_ASHIFT))) ? AFMT_S16_LE : AFMT_U8, p);
 		
 	case SNDCTL_DSP_POST:
                 return 0;
@@ -1709,10 +1712,10 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			val |= PCM_ENABLE_INPUT;
 		if (file->f_mode & FMODE_WRITE && s->enable & SV_CENABLE_PE) 
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, p);
 		
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -1753,7 +1756,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                 abinfo.fragstotal = s->dma_dac.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		if (!(file->f_mode & FMODE_READ))
@@ -1770,7 +1773,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                 abinfo.fragstotal = s->dma_adc.numfrag;
                 abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
 		spin_unlock_irqrestore(&s->lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 		
         case SNDCTL_DSP_NONBLOCK:
                 file->f_flags |= O_NONBLOCK;
@@ -1787,7 +1790,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		spin_unlock_irqrestore(&s->lock, flags);
 		if (count < 0)
 			count = 0;
-		return put_user(count, (int *)arg);
+		return put_user(count, p);
 
         case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -1805,7 +1808,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if (s->dma_adc.mapped)
 			s->dma_adc.count &= s->dma_adc.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-		if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1825,7 +1828,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if (s->dma_dac.mapped)
 			s->dma_dac.count &= s->dma_dac.fragsize-1;
 		spin_unlock_irqrestore(&s->lock, flags);
-                if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+                if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -1833,14 +1836,14 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf(s, 0)))
 				return val;
-			return put_user(s->dma_dac.fragsize, (int *)arg);
+			return put_user(s->dma_dac.fragsize, p);
 		}
 		if ((val = prog_dmabuf(s, 1)))
 			return val;
-		return put_user(s->dma_adc.fragsize, (int *)arg);
+		return put_user(s->dma_adc.fragsize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			s->dma_adc.ossfragshift = val & 0xffff;
@@ -1868,7 +1871,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && s->dma_dac.subdivision))
 			return -EINVAL;
-                if (get_user(val, (int *)arg))
+                if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -1879,15 +1882,15 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		return 0;
 
         case SOUND_PCM_READ_RATE:
-		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? s->rateadc : s->ratedac, p);
 
         case SOUND_PCM_READ_CHANNELS:
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (SV_CFMT_STEREO << SV_CFMT_CSHIFT) 
-					   : (SV_CFMT_STEREO << SV_CFMT_ASHIFT))) ? 2 : 1, (int *)arg);
+					   : (SV_CFMT_STEREO << SV_CFMT_ASHIFT))) ? 2 : 1, p);
 
         case SOUND_PCM_READ_BITS:
 		return put_user((s->fmt & ((file->f_mode & FMODE_READ) ? (SV_CFMT_16BIT << SV_CFMT_CSHIFT) 
-					   : (SV_CFMT_16BIT << SV_CFMT_ASHIFT))) ? 16 : 8, (int *)arg);
+					   : (SV_CFMT_16BIT << SV_CFMT_ASHIFT))) ? 16 : 8, p);
 
         case SOUND_PCM_WRITE_FILTER:
         case SNDCTL_DSP_SETSYNCRO:
@@ -1992,7 +1995,7 @@ static /*const*/ struct file_operations sv_audio_fops = {
 
 /* --------------------------------------------------------------------- */
 
-static ssize_t sv_midi_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t sv_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct sv_state *s = (struct sv_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -2055,7 +2058,7 @@ static ssize_t sv_midi_read(struct file *file, char *buffer, size_t count, loff_
 	return ret;
 }
 
-static ssize_t sv_midi_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t sv_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct sv_state *s = (struct sv_state *)file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
@@ -2297,7 +2300,7 @@ static int sv_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		return 0;
 
 	case FM_IOCTL_PLAY_NOTE:
-		if (copy_from_user(&n, (void *)arg, sizeof(n)))
+		if (copy_from_user(&n, (void __user *)arg, sizeof(n)))
 			return -EFAULT;
 		if (n.voice >= 18)
 			return -EINVAL;
@@ -2315,7 +2318,7 @@ static int sv_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		return 0;
 
 	case FM_IOCTL_SET_VOICE:
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, (void __user *)arg, sizeof(v)))
 			return -EFAULT;
 		if (v.voice >= 18)
 			return -EINVAL;
@@ -2345,7 +2348,7 @@ static int sv_dmfm_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		return 0;
 		
 	case FM_IOCTL_SET_PARAMS:
-		if (copy_from_user(&p, (void *)arg, sizeof(p)))
+		if (copy_from_user(&p, (void *__user )arg, sizeof(p)))
 			return -EFAULT;
 		outb(0x08, s->iosynth);
 		outb((p.kbd_split & 1) << 6, s->iosynth+1);
diff --git a/sound/oss/sound_calls.h b/sound/oss/sound_calls.h
index ffa0c1caf..7914e51a8 100644
--- a/sound/oss/sound_calls.h
+++ b/sound/oss/sound_calls.h
@@ -9,7 +9,7 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock);
 int DMAbuf_rmchars(int dev, int buff_no, int c);
 int DMAbuf_start_output(int dev, int buff_no, int l);
 int DMAbuf_move_wrpointer(int dev, int l);
-/* int DMAbuf_ioctl(int dev, unsigned int cmd, caddr_t arg, int local); */
+/* int DMAbuf_ioctl(int dev, unsigned int cmd, void __user *arg, int local); */
 void DMAbuf_init(int dev, int dma1, int dma2);
 void DMAbuf_deinit(int dev);
 int DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode);
@@ -31,25 +31,25 @@ int DMAbuf_sync (int dev);
  *	System calls for /dev/dsp and /dev/audio (audio.c)
  */
 
-int audio_read (int dev, struct file *file, char *buf, int count);
-int audio_write (int dev, struct file *file, const char *buf, int count);
+int audio_read (int dev, struct file *file, char __user *buf, int count);
+int audio_write (int dev, struct file *file, const char __user *buf, int count);
 int audio_open (int dev, struct file *file);
 void audio_release (int dev, struct file *file);
 int audio_ioctl (int dev, struct file *file,
-	   unsigned int cmd, caddr_t arg);
+	   unsigned int cmd, void __user *arg);
 void audio_init_devices (void);
 void reorganize_buffers (int dev, struct dma_buffparms *dmap, int recording);
-int dma_ioctl (int dev, unsigned int cmd, caddr_t arg);
+int dma_ioctl (int dev, unsigned int cmd, void __user *arg);
 
 /*
  *	System calls for the /dev/sequencer
  */
 
-int sequencer_read (int dev, struct file *file, char *buf, int count);
-int sequencer_write (int dev, struct file *file, const char *buf, int count);
+int sequencer_read (int dev, struct file *file, char __user *buf, int count);
+int sequencer_write (int dev, struct file *file, const char __user *buf, int count);
 int sequencer_open (int dev, struct file *file);
 void sequencer_release (int dev, struct file *file);
-int sequencer_ioctl (int dev, struct file *file, unsigned int cmd, caddr_t arg);
+int sequencer_ioctl (int dev, struct file *file, unsigned int cmd, void __user *arg);
 unsigned int sequencer_poll(int dev, struct file *file, poll_table * wait);
 
 void sequencer_init (void);
@@ -65,11 +65,11 @@ void seq_copy_to_input (unsigned char *event, int len);
  *	System calls for the /dev/midi
  */
 
-int MIDIbuf_read (int dev, struct file *file, char *buf, int count);
-int MIDIbuf_write (int dev, struct file *file, const char *buf, int count);
+int MIDIbuf_read (int dev, struct file *file, char __user *buf, int count);
+int MIDIbuf_write (int dev, struct file *file, const char __user *buf, int count);
 int MIDIbuf_open (int dev, struct file *file);
 void MIDIbuf_release (int dev, struct file *file);
-int MIDIbuf_ioctl (int dev, struct file *file, unsigned int cmd, caddr_t arg);
+int MIDIbuf_ioctl (int dev, struct file *file, unsigned int cmd, void __user *arg);
 unsigned int MIDIbuf_poll(int dev, struct file *file, poll_table * wait);
 int MIDIbuf_avail(int dev);
 
diff --git a/sound/oss/sound_timer.c b/sound/oss/sound_timer.c
index 15dc6adf1..bc2777dd2 100644
--- a/sound/oss/sound_timer.c
+++ b/sound/oss/sound_timer.c
@@ -177,8 +177,9 @@ static unsigned long timer_get_time(int dev)
 	return curr_ticks;
 }
 
-static int timer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int timer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
+	int __user *p = arg;
 	int val;
 
 	switch (cmd) 
@@ -201,7 +202,7 @@ static int timer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			return 0;
 
 		case SNDCTL_TMR_TIMEBASE:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val) 
 			{
@@ -215,7 +216,7 @@ static int timer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			break;
 
 		case SNDCTL_TMR_TEMPO:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val) 
 			{
@@ -233,7 +234,7 @@ static int timer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			break;
 
 		case SNDCTL_SEQ_CTRLRATE:
-			if (get_user(val, (int *)arg))
+			if (get_user(val, p))
 				return -EFAULT;
 			if (val != 0)	/* Can't change */
 				return -EINVAL;
@@ -248,7 +249,7 @@ static int timer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		default:
 			return -EINVAL;
 	}
-	return put_user(val, (int *)arg);
+	return put_user(val, p);
 }
 
 static void timer_arm(int dev, long time)
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index ee1f493ca..7e228966e 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -55,7 +55,7 @@
 /*
  * Table for permanently allocated memory (used when unloading the module)
  */
-caddr_t         sound_mem_blocks[1024];
+void *          sound_mem_blocks[1024];
 int             sound_nblocks = 0;
 
 /* Persistent DMA buffers */
@@ -110,7 +110,7 @@ int *load_mixer_volumes(char *name, int *levels, int present)
 	return mixer_vols[n].levels;
 }
 
-static int set_mixer_levels(caddr_t arg)
+static int set_mixer_levels(void __user * arg)
 {
         /* mixer_vol_table is 174 bytes, so IMHO no reason to not allocate it on the stack */
 	mixer_vol_table buf;   
@@ -123,11 +123,11 @@ static int set_mixer_levels(caddr_t arg)
 	return 0;
 }
 
-static int get_mixer_levels(caddr_t arg)
+static int get_mixer_levels(void __user * arg)
 {
 	int n;
 
-	if (__get_user(n, (int *)(&(((mixer_vol_table *)arg)->num))))
+	if (__get_user(n, (int __user *)(&(((mixer_vol_table *__user )arg)->num))))
 		return -EFAULT;
 	if (n < 0 || n >= num_mixer_volumes)
 		return -EINVAL;
@@ -139,7 +139,7 @@ static int get_mixer_levels(caddr_t arg)
 /* 4K page size but our output routines use some slack for overruns */
 #define PROC_BLOCK_SIZE (3*1024)
 
-static ssize_t sound_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+static ssize_t sound_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	int dev = iminor(file->f_dentry->d_inode);
 	int ret = -EINVAL;
@@ -172,7 +172,7 @@ static ssize_t sound_read(struct file *file, char *buf, size_t count, loff_t *pp
 	return ret;
 }
 
-static ssize_t sound_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t sound_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	int dev = iminor(file->f_dentry->d_inode);
 	int ret = -EINVAL;
@@ -282,7 +282,7 @@ static int sound_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static int get_mixer_info(int dev, caddr_t arg)
+static int get_mixer_info(int dev, void __user *arg)
 {
 	mixer_info info;
 	memset(&info, 0, sizeof(info));
@@ -294,7 +294,7 @@ static int get_mixer_info(int dev, caddr_t arg)
 	return 0;
 }
 
-static int get_old_mixer_info(int dev, caddr_t arg)
+static int get_old_mixer_info(int dev, void __user *arg)
 {
 	_old_mixer_info info;
 	memset(&info, 0, sizeof(info));
@@ -305,7 +305,7 @@ static int get_old_mixer_info(int dev, caddr_t arg)
 	return 0;
 }
 
-static int sound_mixer_ioctl(int mixdev, unsigned int cmd, caddr_t arg)
+static int sound_mixer_ioctl(int mixdev, unsigned int cmd, void __user *arg)
 {
  	if (mixdev < 0 || mixdev >= MAX_MIXER_DEV)
  		return -ENXIO;
@@ -331,24 +331,25 @@ static int sound_ioctl(struct inode *inode, struct file *file,
 {
 	int err, len = 0, dtype;
 	int dev = iminor(inode);
+	void __user *p = (void __user *)arg;
 
 	if (_SIOC_DIR(cmd) != _SIOC_NONE && _SIOC_DIR(cmd) != 0) {
 		/*
 		 * Have to validate the address given by the process.
 		 */
 		len = _SIOC_SIZE(cmd);
-		if (len < 1 || len > 65536 || arg == 0)
+		if (len < 1 || len > 65536 || !p)
 			return -EFAULT;
 		if (_SIOC_DIR(cmd) & _SIOC_WRITE)
-			if ((err = verify_area(VERIFY_READ, (void *)arg, len)) < 0)
+			if ((err = verify_area(VERIFY_READ, p, len)) < 0)
 				return err;
 		if (_SIOC_DIR(cmd) & _SIOC_READ)
-			if ((err = verify_area(VERIFY_WRITE, (void *)arg, len)) < 0)
+			if ((err = verify_area(VERIFY_WRITE, p, len)) < 0)
 				return err;
 	}
 	DEB(printk("sound_ioctl(dev=%d, cmd=0x%x, arg=0x%x)\n", dev, cmd, arg));
 	if (cmd == OSS_GETVERSION)
-		return __put_user(SOUND_VERSION, (int *)arg);
+		return __put_user(SOUND_VERSION, (int __user *)p);
 	
 	if (_IOC_TYPE(cmd) == 'M' && num_mixers > 0 &&   /* Mixer ioctl */
 	    (dev & 0x0f) != SND_DEV_CTL) {              
@@ -358,32 +359,32 @@ static int sound_ioctl(struct inode *inode, struct file *file,
 		case SND_DEV_DSP16:
 		case SND_DEV_AUDIO:
 			return sound_mixer_ioctl(audio_devs[dev >> 4]->mixer_dev,
-						 cmd, (caddr_t)arg);
+						 cmd, p);
 			
 		default:
-			return sound_mixer_ioctl(dev >> 4, cmd, (caddr_t)arg);
+			return sound_mixer_ioctl(dev >> 4, cmd, p);
 		}
 	}
 	switch (dev & 0x0f) {
 	case SND_DEV_CTL:
 		if (cmd == SOUND_MIXER_GETLEVELS)
-			return get_mixer_levels((caddr_t)arg);
+			return get_mixer_levels(p);
 		if (cmd == SOUND_MIXER_SETLEVELS)
-			return set_mixer_levels((caddr_t)arg);
-		return sound_mixer_ioctl(dev >> 4, cmd, (caddr_t)arg);
+			return set_mixer_levels(p);
+		return sound_mixer_ioctl(dev >> 4, cmd, p);
 
 	case SND_DEV_SEQ:
 	case SND_DEV_SEQ2:
-		return sequencer_ioctl(dev, file, cmd, (caddr_t)arg);
+		return sequencer_ioctl(dev, file, cmd, p);
 
 	case SND_DEV_DSP:
 	case SND_DEV_DSP16:
 	case SND_DEV_AUDIO:
-		return audio_ioctl(dev, file, cmd, (caddr_t)arg);
+		return audio_ioctl(dev, file, cmd, p);
 		break;
 
 	case SND_DEV_MIDIN:
-		return MIDIbuf_ioctl(dev, file, cmd, (caddr_t)arg);
+		return MIDIbuf_ioctl(dev, file, cmd, p);
 		break;
 
 	}
diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c
index d4c192264..464b5696c 100644
--- a/sound/oss/sscape.c
+++ b/sound/oss/sscape.c
@@ -555,7 +555,7 @@ static int download_boot_block(void *dev_info, copr_buffer * buf)
 	return 0;
 }
 
-static int sscape_coproc_ioctl(void *dev_info, unsigned int cmd, caddr_t arg, int local)
+static int sscape_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg, int local)
 {
 	copr_buffer *buf;
 	int err;
diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
index 459c1741a..3b7fa02cb 100644
--- a/sound/oss/sys_timer.c
+++ b/sound/oss/sys_timer.c
@@ -191,13 +191,14 @@ def_tmr_get_time(int dev)
 }
 
 /* same as sound_timer.c:timer_ioctl!? */
-static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int def_tmr_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
+	int __user *p = arg;
 	int val;
 
 	switch (cmd) {
 	case SNDCTL_TMR_SOURCE:
-		return __put_user(TMR_INTERNAL, (int *)arg);
+		return __put_user(TMR_INTERNAL, p);
 
 	case SNDCTL_TMR_START:
 		tmr_reset();
@@ -213,7 +214,7 @@ static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		return 0;
 
 	case SNDCTL_TMR_TIMEBASE:
-		if (__get_user(val, (int *)arg))
+		if (__get_user(val, p))
 			return -EFAULT;
 		if (val) {
 			if (val < 1)
@@ -222,10 +223,10 @@ static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg)
 				val = 1000;
 			curr_timebase = val;
 		}
-		return __put_user(curr_timebase, (int *)arg);
+		return __put_user(curr_timebase, p);
 
 	case SNDCTL_TMR_TEMPO:
-		if (__get_user(val, (int *)arg))
+		if (__get_user(val, p))
 			return -EFAULT;
 		if (val) {
 			if (val < 8)
@@ -238,18 +239,18 @@ static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			curr_tempo = val;
 			reprogram_timer();
 		}
-		return __put_user(curr_tempo, (int *)arg);
+		return __put_user(curr_tempo, p);
 
 	case SNDCTL_SEQ_CTRLRATE:
-		if (__get_user(val, (int *)arg))
+		if (__get_user(val, p))
 			return -EFAULT;
 		if (val != 0)	/* Can't change */
 			return -EINVAL;
 		val = ((curr_tempo * curr_timebase) + 30) / 60;
-		return __put_user(val, (int *)arg);
+		return __put_user(val, p);
 		
 	case SNDCTL_SEQ_GETTIME:
-		return __put_user(curr_ticks, (int *)arg);
+		return __put_user(curr_ticks, p);
 		
 	case SNDCTL_TMR_METRONOME:
 		/* NOP */
diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index cd11ef2b3..ed04f4007 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -497,7 +497,8 @@ static void ali_setup_spdif_in(struct trident_card *card);
 static void ali_disable_spdif_in(struct trident_card *card);
 static void ali_disable_special_channel(struct trident_card *card, int ch);
 static void ali_setup_spdif_out(struct trident_card *card, int flag);
-static int ali_write_5_1(struct trident_state *state, const char *buffer, 
+static int ali_write_5_1(struct trident_state *state,
+			 const char __user *buffer, 
 			 int cnt_for_multi_channel, unsigned int *copy_count, 
 			 unsigned int *state_cnt);
 static int ali_allocate_other_states_resources(struct trident_state *state, 
@@ -1861,7 +1862,7 @@ trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 /* to be copied to the user's buffer.  it is filled by the dma machine and */ 
 /* drained by this loop. */
 static ssize_t
-trident_read(struct file *file, char *buffer, size_t count, loff_t * ppos)
+trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -1976,7 +1977,7 @@ out:
    the soundcard.  it is drained by the dma machine and filled by this loop. */
 
 static ssize_t
-trident_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
+trident_write(struct file *file, const char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct trident_state *state = (struct trident_state *)file->private_data;
 	struct dmabuf *dmabuf = &state->dmabuf;
@@ -2247,8 +2248,9 @@ trident_ioctl(struct inode *inode, struct file *file,
 	audio_buf_info abinfo;
 	count_info cinfo;
 	int val, mapped, ret = 0;
-
 	struct trident_card *card = state->card;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	VALIDATE_STATE(state);
 
@@ -2256,11 +2258,11 @@ trident_ioctl(struct inode *inode, struct file *file,
 	mapped = ((file->f_mode & (FMODE_WRITE | FMODE_READ)) && dmabuf->mapped);
 
 	pr_debug("trident: trident_ioctl, command = %2d, arg = 0x%08x\n",
-		 _IOC_NR(cmd), arg ? *(int *) arg : 0);
+		 _IOC_NR(cmd), arg ? *p : 0);
 
 	switch (cmd) {
 	case OSS_GETVERSION:
-		ret = put_user(SOUND_VERSION, (int *) arg);
+		ret = put_user(SOUND_VERSION, p);
 		break;
 
 	case SNDCTL_DSP_RESET:
@@ -2287,7 +2289,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 		break;
 
 	case SNDCTL_DSP_SPEED:	/* set smaple rate */
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2307,11 +2309,11 @@ trident_ioctl(struct inode *inode, struct file *file,
 				spin_unlock_irqrestore(&state->card->lock, flags);
 			}
 		}
-		ret = put_user(dmabuf->rate, (int *) arg);
+		ret = put_user(dmabuf->rate, p);
 		break;
 
 	case SNDCTL_DSP_STEREO:	/* set stereo or mono channel */
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2342,14 +2344,14 @@ trident_ioctl(struct inode *inode, struct file *file,
 			if ((val = prog_dmabuf_playback(state)))
 				ret = val;
 			else
-				ret = put_user(dmabuf->fragsize, (int *) arg);
+				ret = put_user(dmabuf->fragsize, p);
 			break;
 		}
 		if (file->f_mode & FMODE_READ) {
 			if ((val = prog_dmabuf_record(state)))
 				ret = val;
 			else
-				ret = put_user(dmabuf->fragsize, (int *) arg);
+				ret = put_user(dmabuf->fragsize, p);
 			break;
 		}
 		/* neither READ nor WRITE? is this even possible? */
@@ -2359,11 +2361,11 @@ trident_ioctl(struct inode *inode, struct file *file,
 
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format */
 		ret = put_user(AFMT_S16_LE | AFMT_U16_LE | AFMT_S8 | 
-			       AFMT_U8, (int *) arg);
+			       AFMT_U8, p);
 		break;
 
 	case SNDCTL_DSP_SETFMT:	/* Select sample format */
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2390,11 +2392,11 @@ trident_ioctl(struct inode *inode, struct file *file,
 		}
 		unlock_set_fmt(state);
 		ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : 
-			       AFMT_U8, (int *) arg);
+			       AFMT_U8, p);
 		break;
 
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2458,7 +2460,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 			}
 			unlock_set_fmt(state);
 		}
-		ret = put_user(val, (int *) arg);
+		ret = put_user(val, p);
 		break;
 
 	case SNDCTL_DSP_POST:
@@ -2470,7 +2472,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 			ret = -EINVAL;
 			break;
 		}
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2482,7 +2484,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 		break;
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2514,7 +2516,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 		abinfo.fragstotal = dmabuf->numfrag;
 		abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *) arg, &abinfo, sizeof (abinfo)) ? 
+		ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? 
 			-EFAULT : 0;
 		break;
 
@@ -2534,7 +2536,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 		abinfo.fragstotal = dmabuf->numfrag;
 		abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *) arg, &abinfo, sizeof (abinfo)) ? 
+		ret = copy_to_user(argp, &abinfo, sizeof (abinfo)) ? 
 			-EFAULT : 0;
 		break;
 
@@ -2544,7 +2546,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 
 	case SNDCTL_DSP_GETCAPS:
 		ret = put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | 
-			       DSP_CAP_MMAP | DSP_CAP_BIND, (int *) arg);
+			       DSP_CAP_MMAP | DSP_CAP_BIND, p);
 		break;
 
 	case SNDCTL_DSP_GETTRIGGER:
@@ -2553,11 +2555,11 @@ trident_ioctl(struct inode *inode, struct file *file,
 			val |= PCM_ENABLE_INPUT;
 		if ((file->f_mode & FMODE_WRITE) && dmabuf->enable)
 			val |= PCM_ENABLE_OUTPUT;
-		ret = put_user(val, (int *) arg);
+		ret = put_user(val, p);
 		break;
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2599,7 +2601,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 		if (dmabuf->mapped)
 			dmabuf->count &= dmabuf->fragsize - 1;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *) arg, &cinfo, sizeof (cinfo)) ? 
+		ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? 
 			-EFAULT : 0;
 		break;
 
@@ -2622,7 +2624,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 		if (dmabuf->mapped)
 			dmabuf->count &= dmabuf->fragsize - 1;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = copy_to_user((void *) arg, &cinfo, sizeof (cinfo)) ? 
+		ret = copy_to_user(argp, &cinfo, sizeof (cinfo)) ? 
 			-EFAULT : 0;
 		break;
 
@@ -2643,26 +2645,26 @@ trident_ioctl(struct inode *inode, struct file *file,
 		trident_update_ptr(state);
 		val = dmabuf->count;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-		ret = put_user(val, (int *) arg);
+		ret = put_user(val, p);
 		break;
 
 	case SOUND_PCM_READ_RATE:
-		ret = put_user(dmabuf->rate, (int *) arg);
+		ret = put_user(dmabuf->rate, p);
 		break;
 
 	case SOUND_PCM_READ_CHANNELS:
 		ret = put_user((dmabuf->fmt & TRIDENT_FMT_STEREO) ? 2 : 1, 
-			       (int *) arg);
+			       p);
 		break;
 
 	case SOUND_PCM_READ_BITS:
 		ret = put_user((dmabuf->fmt & TRIDENT_FMT_16BIT) ? AFMT_S16_LE : 
-			       AFMT_U8, (int *) arg);
+			       AFMT_U8, p);
 		break;
 
 	case SNDCTL_DSP_GETCHANNELMASK:
 		ret = put_user(DSP_BIND_FRONT | DSP_BIND_SURR | 
-			       DSP_BIND_CENTER_LFE,  (int *) arg);
+			       DSP_BIND_CENTER_LFE,  p);
 		break;
 
 	case SNDCTL_DSP_BIND_CHANNEL:
@@ -2671,7 +2673,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 			break;
 		}
 
-		if (get_user(val, (int *) arg)) {
+		if (get_user(val, p)) {
 			ret = -EFAULT;
 			break;
 		}
@@ -2688,7 +2690,7 @@ trident_ioctl(struct inode *inode, struct file *file,
 							      SRC_ENABLE);
 			dmabuf->channel->attribute |= mask2attr[ffs(val)];
 		}
-		ret = put_user(val, (int *) arg);
+		ret = put_user(val, p);
 		break;
 
 	case SNDCTL_DSP_MAPINBUF:
@@ -3878,14 +3880,14 @@ depend on a master state's DMA, and changing the counters of the master
 state DMA is protected by a spinlock.
 */
 static int
-ali_write_5_1(struct trident_state *state, const char *buf, 
+ali_write_5_1(struct trident_state *state, const char __user *buf, 
 	      int cnt_for_multi_channel, unsigned int *copy_count, 
 	      unsigned int *state_cnt)
 {
 
 	struct dmabuf *dmabuf = &state->dmabuf;
 	struct dmabuf *dmabuf_temp;
-	const char *buffer = buf;
+	const char __user *buffer = buf;
 	unsigned swptr, other_dma_nums, sample_s;
 	unsigned int i, loop;
 
@@ -4018,7 +4020,7 @@ ali_free_other_states_resources(struct trident_state *state)
 
 struct proc_dir_entry *res;
 static int
-ali_write_proc(struct file *file, const char *buffer, unsigned long count, void *data)
+ali_write_proc(struct file *file, const char __user *buffer, unsigned long count, void *data)
 {
 	struct trident_card *card = (struct trident_card *) data;
 	unsigned long flags;
@@ -4294,7 +4296,7 @@ trident_game_open(struct gameport *gameport, int mode)
 	switch (mode) {
 	case GAMEPORT_MODE_COOKED:
 		outb(0x80, TRID_REG(card, T4D_GAME_CR));
-		wait_ms(20);
+		msleep(20);
 		return 0;
 	case GAMEPORT_MODE_RAW:
 		outb(0x00, TRID_REG(card, T4D_GAME_CR));
diff --git a/sound/oss/v_midi.c b/sound/oss/v_midi.c
index df92aa26e..656c06366 100644
--- a/sound/oss/v_midi.c
+++ b/sound/oss/v_midi.c
@@ -120,7 +120,7 @@ static int v_midi_end_read (int dev)
 
 /* why -EPERM and not -EINVAL?? */
 
-static inline int v_midi_ioctl (int dev, unsigned cmd, caddr_t arg)
+static inline int v_midi_ioctl (int dev, unsigned cmd, void __user *arg)
 {
 	return -EPERM;
 }
diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
index 899a6ba75..2c83d03c1 100644
--- a/sound/oss/via82cxxx_audio.c
+++ b/sound/oss/via82cxxx_audio.c
@@ -349,8 +349,8 @@ static unsigned via_num_cards;
 static int via_init_one (struct pci_dev *dev, const struct pci_device_id *id);
 static void __devexit via_remove_one (struct pci_dev *pdev);
 
-static ssize_t via_dsp_read(struct file *file, char *buffer, size_t count, loff_t *ppos);
-static ssize_t via_dsp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos);
+static ssize_t via_dsp_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos);
+static ssize_t via_dsp_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos);
 static unsigned int via_dsp_poll(struct file *file, struct poll_table_struct *wait);
 static int via_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
 static int via_dsp_open (struct inode *inode, struct file *file);
@@ -2254,11 +2254,11 @@ out:
 
 
 static ssize_t via_dsp_do_read (struct via_info *card,
-				char *userbuf, size_t count,
+				char __user *userbuf, size_t count,
 				int nonblock)
 {
         DECLARE_WAITQUEUE(wait, current);
-	const char *orig_userbuf = userbuf;
+	const char __user *orig_userbuf = userbuf;
 	struct via_channel *chan = &card->ch_in;
 	size_t size;
 	int n, tmp;
@@ -2388,7 +2388,7 @@ out:
 }
 
 
-static ssize_t via_dsp_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t via_dsp_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct via_info *card;
 	int nonblock = (file->f_flags & O_NONBLOCK);
@@ -2431,11 +2431,11 @@ out:
 
 
 static ssize_t via_dsp_do_write (struct via_info *card,
-				 const char *userbuf, size_t count,
+				 const char __user *userbuf, size_t count,
 				 int nonblock)
 {
         DECLARE_WAITQUEUE(wait, current);
-	const char *orig_userbuf = userbuf;
+	const char __user *orig_userbuf = userbuf;
 	struct via_channel *chan = &card->ch_out;
 	volatile struct via_sgd_table *sgtable = chan->sgtable;
 	size_t size;
@@ -2576,7 +2576,7 @@ out:
 }
 
 
-static ssize_t via_dsp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t via_dsp_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct via_info *card;
 	ssize_t rc;
@@ -2779,7 +2779,7 @@ out:
 
 static int via_dsp_ioctl_space (struct via_info *card,
 				struct via_channel *chan,
-				void *arg)
+				void __user *arg)
 {
 	audio_buf_info info;
 
@@ -2824,7 +2824,7 @@ static int via_dsp_ioctl_space (struct via_info *card,
 
 static int via_dsp_ioctl_ptr (struct via_info *card,
 				struct via_channel *chan,
-				void *arg)
+				void __user *arg)
 {
 	count_info info;
 
@@ -2900,6 +2900,8 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 	struct via_info *card;
 	struct via_channel *chan;
 	int nonblock = (file->f_flags & O_NONBLOCK);
+	int __user *ip = (int __user *)arg;
+	void __user *p = (void __user *)arg;
 
 	assert (file != NULL);
 	card = file->private_data;
@@ -2920,18 +2922,18 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 	/* OSS API version.  XXX unverified */
 	case OSS_GETVERSION:
 		DPRINTK ("ioctl OSS_GETVERSION, EXIT, returning SOUND_VERSION\n");
-		rc = put_user (SOUND_VERSION, (int *)arg);
+		rc = put_user (SOUND_VERSION, ip);
 		break;
 
 	/* list of supported PCM data formats */
 	case SNDCTL_DSP_GETFMTS:
 		DPRINTK ("DSP_GETFMTS, EXIT, returning AFMT U8|S16_LE\n");
-                rc = put_user (AFMT_U8 | AFMT_S16_LE, (int *)arg);
+                rc = put_user (AFMT_U8 | AFMT_S16_LE, ip);
 		break;
 
 	/* query or set current channel's PCM data format */
 	case SNDCTL_DSP_SETFMT:
-		if (get_user(val, (int *)arg)) {
+		if (get_user(val, ip)) {
 			rc = -EFAULT;
 			break;
 		}
@@ -2957,12 +2959,12 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 				val = AFMT_U8;
 		}
 		DPRINTK ("SETFMT EXIT, returning %d\n", val);
-                rc = put_user (val, (int *)arg);
+                rc = put_user (val, ip);
 		break;
 
 	/* query or set number of channels (1=mono, 2=stereo, 4/6 for multichannel) */
         case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *)arg)) {
+		if (get_user(val, ip)) {
 			rc = -EFAULT;
 			break;
 		}
@@ -2987,12 +2989,12 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 				val = card->ch_out.channels;
 		}
 		DPRINTK ("CHANNELS EXIT, returning %d\n", val);
-                rc = put_user (val, (int *)arg);
+                rc = put_user (val, ip);
 		break;
 
 	/* enable (val is not zero) or disable (val == 0) stereo */
         case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg)) {
+		if (get_user(val, ip)) {
 			rc = -EFAULT;
 			break;
 		}
@@ -3010,12 +3012,12 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 		val = rc - 1;
 
 		DPRINTK ("STEREO EXIT, returning %d\n", val);
-		rc = put_user(val, (int *) arg);
+		rc = put_user(val, ip);
 		break;
 
 	/* query or set sampling rate */
         case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int *)arg)) {
+		if (get_user(val, ip)) {
 			rc = -EFAULT;
 			break;
 		}
@@ -3045,7 +3047,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 				val = 0;
 		}
 		DPRINTK ("SPEED EXIT, returning %d\n", val);
-                rc = put_user (val, (int *)arg);
+                rc = put_user (val, ip);
 		break;
 
 	/* wait until all buffers have been played, and then stop device */
@@ -3086,7 +3088,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 	/* obtain bitmask of device capabilities, such as mmap, full duplex, etc. */
 	case SNDCTL_DSP_GETCAPS:
 		DPRINTK ("DSP_GETCAPS\n");
-		rc = put_user(VIA_DSP_CAP, (int *)arg);
+		rc = put_user(VIA_DSP_CAP, ip);
 		break;
 
 	/* obtain buffer fragment size */
@@ -3095,10 +3097,10 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 
 		if (rd) {
 			via_chan_set_buffering(card, &card->ch_in, -1);
-			rc = put_user(card->ch_in.frag_size, (int *)arg);
+			rc = put_user(card->ch_in.frag_size, ip);
 		} else if (wr) {
 			via_chan_set_buffering(card, &card->ch_out, -1);
-			rc = put_user(card->ch_out.frag_size, (int *)arg);
+			rc = put_user(card->ch_out.frag_size, ip);
 		}
 		break;
 
@@ -3106,28 +3108,28 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 	case SNDCTL_DSP_GETISPACE:
 		DPRINTK ("DSP_GETISPACE\n");
 		if (rd)
-			rc = via_dsp_ioctl_space (card, &card->ch_in, (void*) arg);
+			rc = via_dsp_ioctl_space (card, &card->ch_in, p);
 		break;
 
 	/* obtain information about output buffering */
 	case SNDCTL_DSP_GETOSPACE:
 		DPRINTK ("DSP_GETOSPACE\n");
 		if (wr)
-			rc = via_dsp_ioctl_space (card, &card->ch_out, (void*) arg);
+			rc = via_dsp_ioctl_space (card, &card->ch_out, p);
 		break;
 
 	/* obtain information about input hardware pointer */
 	case SNDCTL_DSP_GETIPTR:
 		DPRINTK ("DSP_GETIPTR\n");
 		if (rd)
-			rc = via_dsp_ioctl_ptr (card, &card->ch_in, (void*) arg);
+			rc = via_dsp_ioctl_ptr (card, &card->ch_in, p);
 		break;
 
 	/* obtain information about output hardware pointer */
 	case SNDCTL_DSP_GETOPTR:
 		DPRINTK ("DSP_GETOPTR\n");
 		if (wr)
-			rc = via_dsp_ioctl_ptr (card, &card->ch_out, (void*) arg);
+			rc = via_dsp_ioctl_ptr (card, &card->ch_out, p);
 		break;
 
 	/* return number of bytes remaining to be played by DMA engine */
@@ -3157,7 +3159,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 		assert (val <= (chan->frag_size * chan->frag_number));
 
 		DPRINTK ("GETODELAY EXIT, val = %d bytes\n", val);
-                rc = put_user (val, (int *)arg);
+                rc = put_user (val, ip);
 		break;
 		}
 
@@ -3166,7 +3168,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 	 * occur in the future
 	 */
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg)) {
+		if (get_user(val, ip)) {
 			rc = -EFAULT;
 			break;
 		}
@@ -3190,7 +3192,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 			val |= PCM_ENABLE_INPUT;
 		if ((file->f_mode & FMODE_WRITE) && card->ch_out.is_enabled)
 			val |= PCM_ENABLE_OUTPUT;
-		rc = put_user(val, (int *)arg);
+		rc = put_user(val, ip);
 		break;
 
 	/* Enable full duplex.  Since we do this as soon as we are opened
@@ -3205,7 +3207,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 
 	/* set fragment size.  implemented as a successful no-op for now */
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg)) {
+		if (get_user(val, ip)) {
 			rc = -EFAULT;
 			break;
 		}
@@ -3241,7 +3243,7 @@ static int via_dsp_ioctl (struct inode *inode, struct file *file,
 	/* not implemented */
 	default:
 		DPRINTK ("unhandled ioctl, cmd==%u, arg==%p\n",
-			 cmd, (void*) arg);
+			 cmd, p);
 		break;
 	}
 
diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c
index 86ad13c7a..00fe5cec9 100644
--- a/sound/oss/vidc.c
+++ b/sound/oss/vidc.c
@@ -116,7 +116,7 @@ vidc_mixer_set(int mdev, unsigned int level)
 #undef SCALE
 }
 
-static int vidc_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+static int vidc_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
 {
 	unsigned int val;
 	unsigned int mdev;
@@ -127,7 +127,7 @@ static int vidc_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	mdev = _SIOC_NR(cmd);
 
 	if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
-		if (get_user(val, (unsigned int *)arg))
+		if (get_user(val, (unsigned int __user *)arg))
 			return -EFAULT;
 
 		if (mdev < SOUND_MIXER_NRDEVICES)
@@ -167,7 +167,7 @@ static int vidc_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 			return -EINVAL;
 	}
 
-	return put_user(val, (unsigned int *)arg) ? -EFAULT : 0;
+	return put_user(val, (unsigned int __user *)arg) ? -EFAULT : 0;
 }
 
 static unsigned int vidc_audio_set_format(int dev, unsigned int fmt)
diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
index 7645bb0f5..e438ba506 100644
--- a/sound/oss/vwsnd.c
+++ b/sound/oss/vwsnd.c
@@ -240,9 +240,9 @@ enum {
 /* low-level lithium data */
 
 typedef struct lithium {
-	caddr_t		page0;		/* virtual addresses */
-	caddr_t		page1;
-	caddr_t		page2;
+	void *		page0;		/* virtual addresses */
+	void *		page1;
+	void *		page2;
 	spinlock_t	lock;		/* protects codec and UST/MSC access */
 } lithium_t;
 
@@ -659,7 +659,7 @@ static void li_setup_dma(dma_chan_t *chan,
 static void li_shutdown_dma(dma_chan_t *chan)
 {
 	lithium_t *lith = chan->lith;
-	caddr_t lith1 = lith->page1;
+	void * lith1 = lith->page1;
 
 	DBGEV("(chan=0x%p)\n", chan);
 	
@@ -698,7 +698,7 @@ static __inline__ void li_activate_dma(dma_chan_t *chan)
 static void li_deactivate_dma(dma_chan_t *chan)
 {
 	lithium_t *lith = chan->lith;
-	caddr_t lith2 = lith->page2;
+	void * lith2 = lith->page2;
 
 	chan->ctlval &= ~(LI_CCTL_DMA_ENABLE | LI_CCTL_RPTR | LI_CCTL_WPTR);
 	DBGPV("ctlval = 0x%lx\n", chan->ctlval);
@@ -1480,10 +1480,10 @@ typedef struct vwsnd_port {
 	int		hwbuf_size;
 	unsigned long	hwbuf_paddr;
 	unsigned long	hwbuf_vaddr;
-	caddr_t		hwbuf;		/* hwbuf == hwbuf_vaddr */
+	void *		hwbuf;		/* hwbuf == hwbuf_vaddr */
 	int		hwbuf_max;	/* max bytes to preload */
 
-	caddr_t		swbuf;
+	void *		swbuf;
 	unsigned int	swbuf_size;	/* size in bytes */
 	unsigned int	swb_u_idx;	/* index of next user byte */
 	unsigned int	swb_i_idx;	/* index of next intr byte */
@@ -3083,7 +3083,7 @@ static int vwsnd_mixer_release(struct inode *inode, struct file *file)
 
 /* mixer_read_ioctl handles all read ioctls on the mixer device. */
 
-static int mixer_read_ioctl(vwsnd_dev_t *devc, unsigned int nr, caddr_t arg)
+static int mixer_read_ioctl(vwsnd_dev_t *devc, unsigned int nr, void __user *arg)
 {
 	int val = -1;
 
@@ -3145,19 +3145,19 @@ static int mixer_read_ioctl(vwsnd_dev_t *devc, unsigned int nr, caddr_t arg)
 	default:
 		return -EINVAL;
 	}
-	return put_user(val, (int *) arg);
+	return put_user(val, (int __user *) arg);
 }
 
 /* mixer_write_ioctl handles all write ioctls on the mixer device. */
 
-static int mixer_write_ioctl(vwsnd_dev_t *devc, unsigned int nr, caddr_t arg)
+static int mixer_write_ioctl(vwsnd_dev_t *devc, unsigned int nr, void __user *arg)
 {
 	int val;
 	int err;
 
 	DBGEV("(devc=0x%p, nr=0x%x, arg=0x%p)\n", devc, nr, arg);
 
-	err = get_user(val, (int *) arg);
+	err = get_user(val, (int __user *) arg);
 	if (err)
 		return -EFAULT;
 	switch (nr) {
@@ -3196,7 +3196,7 @@ static int mixer_write_ioctl(vwsnd_dev_t *devc, unsigned int nr, caddr_t arg)
 	}
 	if (val < 0)
 		return val;
-	return put_user(val, (int *) arg);
+	return put_user(val, (int __user *) arg);
 }
 
 /* This is the ioctl entry to the mixer driver. */
@@ -3216,9 +3216,9 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
 	down(&devc->mix_sema);
 	{
 		if ((cmd & ~nrmask) == MIXER_READ(0))
-			retval = mixer_read_ioctl(devc, nr, (caddr_t) arg);
+			retval = mixer_read_ioctl(devc, nr, (void __user *) arg);
 		else if ((cmd & ~nrmask) == MIXER_WRITE(0))
-			retval = mixer_write_ioctl(devc, nr, (caddr_t) arg);
+			retval = mixer_write_ioctl(devc, nr, (void __user *) arg);
 		else
 			retval = -EINVAL;
 	}
@@ -3313,7 +3313,7 @@ static int __init attach_vwsnd(struct address_info *hw_config)
 	devc->rport.hwbuf_vaddr = __get_free_pages(GFP_KERNEL, HWBUF_ORDER);
 	if (!devc->rport.hwbuf_vaddr)
 		goto fail2;
-	devc->rport.hwbuf = (caddr_t) devc->rport.hwbuf_vaddr;
+	devc->rport.hwbuf = (void *) devc->rport.hwbuf_vaddr;
 	devc->rport.hwbuf_paddr = virt_to_phys(devc->rport.hwbuf);
 
 	/*
@@ -3336,7 +3336,7 @@ static int __init attach_vwsnd(struct address_info *hw_config)
 	devc->wport.hwbuf_vaddr = __get_free_pages(GFP_KERNEL, HWBUF_ORDER);
 	if (!devc->wport.hwbuf_vaddr)
 		goto fail3;
-	devc->wport.hwbuf = (caddr_t) devc->wport.hwbuf_vaddr;
+	devc->wport.hwbuf = (void *) devc->wport.hwbuf_vaddr;
 	devc->wport.hwbuf_paddr = virt_to_phys(devc->wport.hwbuf);
 	DBGP("wport hwbuf = 0x%p\n", devc->wport.hwbuf);
 
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index aa2f1d960..44ab69867 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -153,7 +153,7 @@ static spinlock_t	waveartist_lock = SPIN_LOCK_UNLOCKED;
 #else
 static struct timer_list vnc_timer;
 static void vnc_configure_mixer(wavnc_info *devc, unsigned int input_mask);
-static int vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg);
+static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg);
 static void vnc_slider_tick(unsigned long data);
 #endif
 
@@ -515,7 +515,7 @@ waveartist_start_input(int dev, unsigned long buf, int __count, int intrflag)
 }
 
 static int
-waveartist_ioctl(int dev, unsigned int cmd, caddr_t arg)
+waveartist_ioctl(int dev, unsigned int cmd, void __user * arg)
 {
 	return -EINVAL;
 }
@@ -1125,7 +1125,7 @@ waveartist_set_mixer(wavnc_info *devc, int dev, unsigned int level)
 }
 
 static int
-waveartist_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
+waveartist_mixer_ioctl(int dev, unsigned int cmd, void __user * arg)
 {
 	wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
 	int ret = 0, val, nr;
@@ -1149,7 +1149,7 @@ waveartist_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	nr = cmd & 0xff;
 
 	if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
-		if (get_user(val, (int *)arg))
+		if (get_user(val, (int __user *)arg))
 			return -EFAULT;
 
 		switch (nr) {
@@ -1196,7 +1196,7 @@ waveartist_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		}
 
 		if (ret >= 0)
-			ret = put_user(ret, (int *)arg) ? -EFAULT : 0;
+			ret = put_user(ret, (int __user *)arg) ? -EFAULT : 0;
 	}
 
 	return ret;
@@ -1804,7 +1804,7 @@ vnc_slider_tick(unsigned long data)
 }
 
 static int
-vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg)
+vnc_private_ioctl(int dev, unsigned int cmd, int __user * arg)
 {
 	wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc;
 	int val;
@@ -1815,7 +1815,7 @@ vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		u_int prev_spkr_mute, prev_line_mute, prev_auto_state;
 		int val;
 
-		if (get_user(val, (int *)arg))
+		if (get_user(val, arg))
 			return -EFAULT;
 
 		/* check if parameter is logical */
@@ -1845,7 +1845,7 @@ vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg)
 	}
 
 	case SOUND_MIXER_PRIVATE2:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, arg))
 			return -EFAULT;
 
 		switch (val) {
@@ -1870,7 +1870,7 @@ vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		unsigned long	flags;
 		int		mixer_reg[15], i, val;
 
-		if (get_user(val, (int *)arg))
+		if (get_user(val, arg))
 			return -EFAULT;
 		if (copy_from_user(mixer_reg, (void *)val, sizeof(mixer_reg)))
 			return -EFAULT;
@@ -1917,7 +1917,7 @@ vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		      (devc->telephone_detect ? VNC_PHONE_DETECT       : 0) |
 		      (devc->no_autoselect    ? VNC_DISABLE_AUTOSWITCH : 0);
 
-		return put_user(val, (int *)arg) ? -EFAULT : 0;
+		return put_user(val, arg) ? -EFAULT : 0;
 	}
 
 	if (_SIOC_DIR(cmd) & _SIOC_WRITE) {
@@ -1936,7 +1936,7 @@ vnc_private_ioctl(int dev, unsigned int cmd, caddr_t arg)
 		if ((cmd & 0xff) == SOUND_MIXER_SPEAKER) {
 			unsigned int val, l, r;
 
-			if (get_user(val, (int *)arg))
+			if (get_user(val, arg))
 				return -EFAULT;
 
 			l = val & 0x7f;
diff --git a/sound/oss/wavfront.c b/sound/oss/wavfront.c
index fe9427e93..e7932229e 100644
--- a/sound/oss/wavfront.c
+++ b/sound/oss/wavfront.c
@@ -114,7 +114,7 @@
 #define OSS_SUPPORT_LEVEL          0x1  /* just /dev/sequencer for now */
 
 #if    OSS_SUPPORT_LEVEL & OSS_SUPPORT_SEQ
-static int (*midi_load_patch) (int devno, int format, const char *addr,
+static int (*midi_load_patch) (int devno, int format, const char __user *addr,
 			       int offs, int count, int pmgr_flag) = NULL;
 #endif /* OSS_SUPPORT_SEQ */
 
@@ -996,7 +996,7 @@ wavefront_freemem (void)
 
 static int
 wavefront_send_sample (wavefront_patch_info *header,
-		       UINT16 *dataptr,
+		       UINT16 __user *dataptr,
 		       int data_is_unsigned)
 
 {
@@ -1011,7 +1011,7 @@ wavefront_send_sample (wavefront_patch_info *header,
 
 	UINT16 sample_short;
 	UINT32 length;
-	UINT16 *data_end = 0;
+	UINT16 __user *data_end = 0;
 	unsigned int i;
 	const int max_blksize = 4096/2;
 	unsigned int written;
@@ -1024,11 +1024,11 @@ wavefront_send_sample (wavefront_patch_info *header,
 	int initial_skip = 0;
 
 	DPRINT (WF_DEBUG_LOAD_PATCH, "sample %sdownload for slot %d, "
-				      "type %d, %d bytes from 0x%x\n",
+				      "type %d, %d bytes from %p\n",
 				      header->size ? "" : "header ", 
 				      header->number, header->subkey,
 				      header->size,
-				      (int) header->dataptr);
+				      header->dataptr);
 
 	if (header->number == WAVEFRONT_FIND_FREE_SAMPLE_SLOT) {
 		int x;
@@ -1512,7 +1512,7 @@ log2_2048(int n)
 }
 
 static int
-wavefront_load_gus_patch (int devno, int format, const char *addr,
+wavefront_load_gus_patch (int devno, int format, const char __user *addr,
 			  int offs, int count, int pmgr_flag)
 {
 	struct patch_info guspatch;
@@ -1636,7 +1636,7 @@ wavefront_load_gus_patch (int devno, int format, const char *addr,
 	/* Now ship it down */
 
 	wavefront_send_sample (&samp, 
-			       (unsigned short *) &(addr)[sizeof_patch],
+			       (unsigned short __user *) &(addr)[sizeof_patch],
 			       (guspatch.mode & WAVE_UNSIGNED) ? 1:0);
 	wavefront_send_patch (&pat);
 	wavefront_send_program (&prog);
@@ -1656,7 +1656,7 @@ wavefront_load_gus_patch (int devno, int format, const char *addr,
 }
 
 static int
-wavefront_load_patch (const char *addr)
+wavefront_load_patch (const char __user *addr)
 
 
 {
@@ -1680,7 +1680,7 @@ wavefront_load_patch (const char *addr)
 	case WF_ST_SAMPLE:  /* sample or sample_header, based on patch->size */
 
 		if (copy_from_user((unsigned char *) &header.hdr.s,
-				   (unsigned char *) header.hdrptr,
+				   (unsigned char __user *) header.hdrptr,
 				   sizeof (wavefront_sample)))
 			return -EFAULT;
 
@@ -1688,8 +1688,7 @@ wavefront_load_patch (const char *addr)
 
 	case WF_ST_MULTISAMPLE:
 
-		if (copy_from_user((unsigned char *) &header.hdr.s,
-				   (unsigned char *) header.hdrptr,
+		if (copy_from_user(&header.hdr.s, header.hdrptr,
 				   sizeof(wavefront_multisample)))
 			return -EFAULT;
 
@@ -1698,32 +1697,28 @@ wavefront_load_patch (const char *addr)
 
 	case WF_ST_ALIAS:
 
-		if (copy_from_user((unsigned char *) &header.hdr.a,
-				   (unsigned char *) header.hdrptr,
+		if (copy_from_user(&header.hdr.a, header.hdrptr,
 				   sizeof (wavefront_alias)))
 			return -EFAULT;
 
 		return wavefront_send_alias (&header);
 
 	case WF_ST_DRUM:
-		if (copy_from_user((unsigned char *) &header.hdr.d, 
-				   (unsigned char *) header.hdrptr,
+		if (copy_from_user(&header.hdr.d, header.hdrptr,
 				   sizeof (wavefront_drum)))
 			return -EFAULT;
 
 		return wavefront_send_drum (&header);
 
 	case WF_ST_PATCH:
-		if (copy_from_user((unsigned char *) &header.hdr.p, 
-				   (unsigned char *) header.hdrptr,
+		if (copy_from_user(&header.hdr.p, header.hdrptr,
 				   sizeof (wavefront_patch)))
 			return -EFAULT;
 
 		return wavefront_send_patch (&header);
 
 	case WF_ST_PROGRAM:
-		if (copy_from_user((unsigned char *) &header.hdr.pr, 
-				   (unsigned char *) header.hdrptr,
+		if (copy_from_user(&header.hdr.pr, header.hdrptr,
 				   sizeof (wavefront_program)))
 			return -EFAULT;
 
@@ -1940,18 +1935,18 @@ wavefront_ioctl(struct inode *inode, struct file *file,
 	switch (cmd) {
 
 	case WFCTL_WFCMD:
-		if (copy_from_user(&wc, (void *) arg, sizeof (wc)))
+		if (copy_from_user(&wc, (void __user *) arg, sizeof (wc)))
 			return -EFAULT;
 		
 		if ((err = wavefront_synth_control (cmd, &wc)) == 0) {
-			if (copy_to_user ((void *) arg, &wc, sizeof (wc)))
+			if (copy_to_user ((void __user *) arg, &wc, sizeof (wc)))
 				return -EFAULT;
 		}
 
 		return err;
 		
 	case WFCTL_LOAD_SPP:
-		return wavefront_load_patch ((const char *) arg);
+		return wavefront_load_patch ((const char __user *) arg);
 		
 	default:
 		printk (KERN_WARNING LOGNAME "invalid ioctl %#x\n", cmd);
@@ -1998,7 +1993,7 @@ wavefront_oss_close (int devno)
 }
 
 static int
-wavefront_oss_ioctl (int devno, unsigned int cmd, caddr_t arg)
+wavefront_oss_ioctl (int devno, unsigned int cmd, void __user * arg)
 
 {
 	wavefront_control wc;
@@ -2006,8 +2001,7 @@ wavefront_oss_ioctl (int devno, unsigned int cmd, caddr_t arg)
 
 	switch (cmd) {
 	case SNDCTL_SYNTH_INFO:
-		if(copy_to_user(&((char *) arg)[0], &wavefront_info,
-			sizeof (wavefront_info)))
+		if(copy_to_user(arg, &wavefront_info, sizeof (wavefront_info)))
 			return -EFAULT;
 		return 0;
 
@@ -2043,7 +2037,7 @@ wavefront_oss_ioctl (int devno, unsigned int cmd, caddr_t arg)
 }
 
 int
-wavefront_oss_load_patch (int devno, int format, const char *addr,
+wavefront_oss_load_patch (int devno, int format, const char __user *addr,
 			  int offs, int count, int pmgr_flag)
 {
 
@@ -3003,7 +2997,7 @@ wffx_ioctl (wavefront_fx_info *r)
 				return -(EINVAL);
 			}
 			if (copy_from_user(page_data,
-					   (unsigned char *)r->data[3],
+					   (unsigned char __user *)r->data[3],
 					   r->data[2]))
 				return -EFAULT;
 			pd = page_data;
diff --git a/sound/oss/wf_midi.c b/sound/oss/wf_midi.c
index c1a09affe..379e70f2c 100644
--- a/sound/oss/wf_midi.c
+++ b/sound/oss/wf_midi.c
@@ -537,7 +537,7 @@ static inline int wf_mpu_end_read (int dev) {
 	return 0;
 }
 
-static int wf_mpu_ioctl (int dev, unsigned cmd, caddr_t arg)
+static int wf_mpu_ioctl (int dev, unsigned cmd, void __user *arg)
 {
 	printk (KERN_WARNING
 		"WF-MPU: Intelligent mode not supported by hardware.\n");
@@ -573,8 +573,7 @@ static struct synth_info wf_mpu_synth_info_proto =
 static struct synth_info wf_mpu_synth_info[2];
 
 static int
-wf_mpu_synth_ioctl (int dev,
-		    unsigned int cmd, caddr_t arg)
+wf_mpu_synth_ioctl (int dev, unsigned int cmd, void __user *arg)
 {
 	int             midi_dev;
 	int index;
@@ -595,7 +594,7 @@ wf_mpu_synth_ioctl (int dev,
 	switch (cmd) {
 
 	case SNDCTL_SYNTH_INFO:
-		if(copy_to_user (&((char *) arg)[0],
+		if (copy_to_user(arg,
 			      &wf_mpu_synth_info[index],
 			      sizeof (struct synth_info)))
 			return -EFAULT;
diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
index c6183e770..7b3236fed 100644
--- a/sound/oss/ymfpci.c
+++ b/sound/oss/ymfpci.c
@@ -1220,7 +1220,7 @@ out0:
  * machine and drained by this loop.
  */
 static ssize_t
-ymf_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+ymf_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct ymf_state *state = (struct ymf_state *)file->private_data;
 	struct ymf_dmabuf *dmabuf = &state->rpcm.dmabuf;
@@ -1335,7 +1335,7 @@ ymf_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
 }
 
 static ssize_t
-ymf_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+ymf_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct ymf_state *state = (struct ymf_state *)file->private_data;
 	struct ymf_dmabuf *dmabuf = &state->wpcm.dmabuf;
@@ -1568,11 +1568,13 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 	count_info cinfo;
 	int redzone;
 	int val;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	switch (cmd) {
 	case OSS_GETVERSION:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(GETVER) arg 0x%lx\n", cmd, arg);
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, p);
 
 	case SNDCTL_DSP_RESET:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(RESET)\n", cmd);
@@ -1614,7 +1616,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case SNDCTL_DSP_SPEED: /* set smaple rate */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		YMFDBGX("ymf_ioctl: cmd 0x%x(SPEED) sp %d\n", cmd, val);
 		if (val >= 8000 && val <= 48000) {
@@ -1637,7 +1639,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 				spin_unlock_irqrestore(&state->unit->reg_lock, flags);
 			}
 		}
-		return put_user(state->format.rate, (int *)arg);
+		return put_user(state->format.rate, p);
 
 	/*
 	 * OSS manual does not mention SNDCTL_DSP_STEREO at all.
@@ -1646,7 +1648,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 	 * However, mpg123 calls it. I wonder, why Michael Hipp used it.
 	 */
 	case SNDCTL_DSP_STEREO: /* set stereo or mono channel */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		YMFDBGX("ymf_ioctl: cmd 0x%x(STEREO) st %d\n", cmd, val);
 		if (file->f_mode & FMODE_WRITE) {
@@ -1676,23 +1678,23 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 				return val;
 			val = state->wpcm.dmabuf.fragsize;
 			YMFDBGX("ymf_ioctl: GETBLK w %d\n", val);
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 		}
 		if (file->f_mode & FMODE_READ) {
 			if ((val = prog_dmabuf(state, 1)))
 				return val;
 			val = state->rpcm.dmabuf.fragsize;
 			YMFDBGX("ymf_ioctl: GETBLK r %d\n", val);
-			return put_user(val, (int *)arg);
+			return put_user(val, p);
 		}
 		return -EINVAL;
 
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/
 		YMFDBGX("ymf_ioctl: cmd 0x%x(GETFMTS)\n", cmd);
-		return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+		return put_user(AFMT_S16_LE|AFMT_U8, p);
 
 	case SNDCTL_DSP_SETFMT: /* Select sample format */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		YMFDBGX("ymf_ioctl: cmd 0x%x(SETFMT) fmt %d\n", cmd, val);
 		if (val == AFMT_S16_LE || val == AFMT_U8) {
@@ -1715,10 +1717,10 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 				spin_unlock_irqrestore(&state->unit->reg_lock, flags);
 			}
 		}
-		return put_user(state->format.format, (int *)arg);
+		return put_user(state->format.format, p);
 
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		YMFDBGX("ymf_ioctl: cmd 0x%x(CHAN) ch %d\n", cmd, val);
 		if (val != 0) {
@@ -1745,7 +1747,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 				}
 			}
 		}
-		return put_user(state->format.voices, (int *)arg);
+		return put_user(state->format.voices, p);
 
 	case SNDCTL_DSP_POST:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(POST)\n", cmd);
@@ -1768,7 +1770,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		YMFDBGX("ymf_ioctl: cmd 0x%x(SETFRAG) fr 0x%04x:%04x(%d:%d)\n",
 		    cmd,
@@ -1799,7 +1801,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 		abinfo.fragstotal = dmabuf->numfrag;
 		abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 		spin_unlock_irqrestore(&state->unit->reg_lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETISPACE:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(GETISPACE)\n", cmd);
@@ -1814,7 +1816,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 		abinfo.fragstotal = dmabuf->numfrag;
 		abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
 		spin_unlock_irqrestore(&state->unit->reg_lock, flags);
-		return copy_to_user((void *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_NONBLOCK:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(NONBLOCK)\n", cmd);
@@ -1824,8 +1826,8 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 	case SNDCTL_DSP_GETCAPS:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(GETCAPS)\n", cmd);
 		/* return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP,
-			    (int *)arg); */
-		return put_user(0, (int *)arg);
+			    p); */
+		return put_user(0, p);
 
 	case SNDCTL_DSP_GETIPTR:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(GETIPTR)\n", cmd);
@@ -1839,7 +1841,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 		spin_unlock_irqrestore(&state->unit->reg_lock, flags);
 		YMFDBGX("ymf_ioctl: GETIPTR ptr %d bytes %d\n",
 		    cinfo.ptr, cinfo.bytes);
-		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_GETOPTR:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(GETOPTR)\n", cmd);
@@ -1853,7 +1855,7 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 		spin_unlock_irqrestore(&state->unit->reg_lock, flags);
 		YMFDBGX("ymf_ioctl: GETOPTR ptr %d bytes %d\n",
 		    cinfo.ptr, cinfo.bytes);
-		return copy_to_user((void *)arg, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
+		return copy_to_user(argp, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
 
 	case SNDCTL_DSP_SETDUPLEX:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(SETDUPLEX)\n", cmd);
@@ -1861,15 +1863,15 @@ static int ymf_ioctl(struct inode *inode, struct file *file,
 
 	case SOUND_PCM_READ_RATE:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(READ_RATE)\n", cmd);
-		return put_user(state->format.rate, (int *)arg);
+		return put_user(state->format.rate, p);
 
 	case SOUND_PCM_READ_CHANNELS:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(READ_CH)\n", cmd);
-		return put_user(state->format.voices, (int *)arg);
+		return put_user(state->format.voices, p);
 
 	case SOUND_PCM_READ_BITS:
 		YMFDBGX("ymf_ioctl: cmd 0x%x(READ_BITS)\n", cmd);
-		return put_user(AFMT_S16_LE, (int *)arg);
+		return put_user(AFMT_S16_LE, p);
 
 	case SNDCTL_DSP_MAPINBUF:
 	case SNDCTL_DSP_MAPOUTBUF:
diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c
index cb21fa475..423ab05c0 100644
--- a/sound/parisc/harmony.c
+++ b/sound/parisc/harmony.c
@@ -56,11 +56,7 @@
  * also controls for enabling/disabling internal speaker and line
  * input.
  *
- * Buffers used by this driver are all DMA consistent. Since harmony is
- * not "real" pci device, we use a fake struct pci_dev for
- * pci_alloc_consistent().
- * (note that some machines -712 for ex.- don't implement DMA consistent
- * memory, so we will need to use kmalloc instead)
+ * Buffers used by this driver are all DMA consistent.
  */
 
 #include <linux/delay.h>
@@ -70,11 +66,11 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/info.h>
 #include <asm/hardware.h>
@@ -100,16 +96,14 @@ MODULE_DEVICES("{{ALSA,Harmony soundcard}}");
 #define MAX_PCM_SUBSTREAMS	4
 #define MAX_MIDI_DEVICES	0
 
-#define BUFFER_SIZE			4096
-#define MAX_BUFS			10
+#define HARMONY_BUF_SIZE	4096
+#define MAX_BUFS		10
+#define MAX_BUFFER_SIZE		(MAX_BUFS * HARMONY_BUF_SIZE)
 
 /* number of silence & graveyard buffers */
 #define GRAVEYARD_BUFS		3
 #define SILENCE_BUFS		3
 
-#define MAX_BUFFER_SIZE		(MAX_BUFS * BUFFER_SIZE)
-#define HARMONY_BUF_SIZE	BUFFER_SIZE
-
 #define HARMONY_CNTL_C		0x80000000
 
 #define HARMONY_DSTATUS_PN	0x00000200
@@ -140,6 +134,17 @@ MODULE_DEVICES("{{ALSA,Harmony soundcard}}");
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
+static int boot_devs;
+
+module_param_array(index, int, boot_devs, 0444);
+MODULE_PARM_DESC(index, "Index value for Sun CS4231 soundcard.");
+MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
+module_param_array(id, charp, boot_devs, 0444);
+MODULE_PARM_DESC(id, "ID string for Sun CS4231 soundcard.");
+MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
+module_param_array(enable, bool, boot_devs, 0444);
+MODULE_PARM_DESC(enable, "Enable Sun CS4231 soundcard.");
+MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 
 /* Register offset (from base hpa) */
 #define REG_ID		0x00
@@ -191,21 +196,18 @@ typedef struct snd_card_harmony {
 	int cap_stopped;
 	int cap_total;
 
-	struct pci_dev *fake_pci_dev; /* The fake pci_dev needed for 
-					pci_* functions under ccio. */
+	struct parisc_device *pa_dev;
+
+	struct snd_dma_device dma_dev;
 
 	/* the graveyard buffer is used as recording buffer when playback, 
 	 * because harmony always want a buffer to put recorded data */
-
-	unsigned char *graveyard_addr;
-	dma_addr_t graveyard_dma;
+	struct snd_dma_buffer graveyard_dma;
 	int graveyard_count;
 	
 	/* same thing for silence buffer */
-	unsigned char *silence_addr;
-	dma_addr_t silence_dma;
+	struct snd_dma_buffer silence_dma;
 	int silence_count;
-	struct snd_dma_device dma_dev;
 
 	/* alsa stuff */
 	snd_card_t *card;
@@ -264,6 +266,15 @@ static snd_pcm_hw_constraint_list_t hw_constraint_rates = {
 #define HARMONY_SR_33KHZ	0x16
 #define HARMONY_SR_6KHZ		0x17
 
+/* bits corresponding to the entries of snd_card_harmony_rates */
+static unsigned int rate_bits[14] = {
+	HARMONY_SR_5KHZ, HARMONY_SR_6KHZ, HARMONY_SR_8KHZ,
+	HARMONY_SR_9KHZ, HARMONY_SR_11KHZ, HARMONY_SR_16KHZ,
+	HARMONY_SR_18KHZ, HARMONY_SR_22KHZ, HARMONY_SR_27KHZ,
+	HARMONY_SR_32KHZ, HARMONY_SR_33KHZ, HARMONY_SR_37KHZ,
+	HARMONY_SR_44KHZ, HARMONY_SR_48KHZ
+};
+
 /* snd_card_harmony_rate_bits
  * @rate:	index of current data rate in list
  * returns: harmony hex code for registers
@@ -273,26 +284,9 @@ static unsigned int snd_card_harmony_rate_bits(int rate)
 	unsigned int idx;
 	
 	for (idx = 0; idx <= RATES; idx++)
-		if (snd_card_harmony_rates[idx] == rate) break;
-	
-	switch (idx) {
-		case 0: return HARMONY_SR_5KHZ;
-		case 1: return HARMONY_SR_6KHZ;
-		case 2: return HARMONY_SR_8KHZ;
-		case 3: return HARMONY_SR_9KHZ;
-		case 4: return HARMONY_SR_11KHZ;
-		case 5: return HARMONY_SR_16KHZ;
-		case 6: return HARMONY_SR_18KHZ;
-		case 7: return HARMONY_SR_22KHZ;
-		case 8: return HARMONY_SR_27KHZ;
-		case 9: return HARMONY_SR_32KHZ;
-		case 10: return HARMONY_SR_33KHZ;
-		case 11: return HARMONY_SR_37KHZ;
-		case 12: return HARMONY_SR_44KHZ;
-		case 13: return HARMONY_SR_48KHZ;
-		default:  /* fallback */
-				return HARMONY_SR_44KHZ;
-	}
+		if (snd_card_harmony_rates[idx] == rate)
+			return rate_bits[idx];
+	return HARMONY_SR_44KHZ; /* fallback */
 }
 
 /*
@@ -316,27 +310,6 @@ void snd_harmony_update_control(snd_card_harmony_t *harmony)
 	
 }
 
-/*
- * silence a buffer
- * XXX: alsa could probably do this by itself
- * XXX: memset hpmc, commented.
- */
-
-void snd_harmony_silence(snd_card_harmony_t *harmony,
-		void *addr, int length)
-{
-	u8 silence_char;
-	
-	switch(harmony->data_format) {
-			case HARMONY_DF_8BIT_ULAW: silence_char = 0x55; break;
-			case HARMONY_DF_8BIT_ALAW: silence_char = 0xff; break;
-			case HARMONY_DF_16BIT_LINEAR:
-			default:
-									   silence_char = 0;
-	}
-	//memset(addr, silence_char, length);
-}
-
 /*
  * interruption controls routines
  */
@@ -385,9 +358,9 @@ static int snd_card_harmony_interrupt(int irq, void *dev, struct pt_regs *regs)
 			snd_pcm_period_elapsed(harmony->playback_substream);
 			harmony->ply_total++;
 		} else {
-			gsc_writel(harmony->silence_dma + 
-					(HARMONY_BUF_SIZE*harmony->silence_count),
-					hpa+REG_PNXTADD);
+			gsc_writel(harmony->silence_dma.addr + 
+				   (HARMONY_BUF_SIZE*harmony->silence_count),
+				   hpa+REG_PNXTADD);
 			harmony->silence_count++;
 			harmony->silence_count %= SILENCE_BUFS;
 		}
@@ -406,9 +379,9 @@ static int snd_card_harmony_interrupt(int irq, void *dev, struct pt_regs *regs)
 			harmony->cap_total++;
 		} else {
 			/* graveyard buffer */
-			gsc_writel(harmony->graveyard_dma +
-						(HARMONY_BUF_SIZE*harmony->graveyard_count),
-						hpa+REG_RNXTADD);
+			gsc_writel(harmony->graveyard_dma.addr +
+				   (HARMONY_BUF_SIZE*harmony->graveyard_count),
+				   hpa+REG_RNXTADD);
 			harmony->graveyard_count++;
 			harmony->graveyard_count %= GRAVEYARD_BUFS;
 		}
@@ -465,26 +438,8 @@ static void __devinit snd_harmony_proc_init(snd_card_harmony_t *harmony)
 {
 	snd_info_entry_t *entry;
 	
-	if ((entry = snd_info_create_card_entry(harmony->card, "harmony", harmony->card->proc_root)) != NULL) {
-		entry->content = SNDRV_INFO_CONTENT_TEXT;
-		entry->private_data = harmony;
-		entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-		entry->c.text.read_size = 2048;	 /* should be enough */
-		entry->c.text.read = snd_harmony_proc_read;
-		if (snd_info_register(entry) < 0) {
-			snd_info_free_entry(entry);
-			entry = NULL;
-		}
-	}
-	harmony->proc_entry = entry;
-}
-
-static void snd_harmony_proc_done(snd_card_harmony_t *harmony)
-{
-	if (harmony->proc_entry) {
-		snd_info_unregister(harmony->proc_entry);
-		harmony->proc_entry = NULL;
-	}
+	if (! snd_card_proc_new(harmony->card, "harmony", &entry))
+		snd_info_set_text_ops(entry, harmony, 2048, snd_harmony_proc_read);
 }
 
 /* 
@@ -563,6 +518,30 @@ static int snd_card_harmony_capture_trigger(snd_pcm_substream_t * substream,
 	return 0;
 }
 
+/* set data format */
+static int snd_harmony_set_data_format(snd_card_harmony_t *harmony, int pcm_format)
+{
+	int old_format = harmony->data_format;
+	int new_format = old_format;
+	switch (pcm_format) {
+	case SNDRV_PCM_FORMAT_S16_BE:
+		new_format = HARMONY_DF_16BIT_LINEAR;
+		break;
+	case SNDRV_PCM_FORMAT_A_LAW:
+		new_format = HARMONY_DF_8BIT_ALAW;
+		break;
+	case SNDRV_PCM_FORMAT_MU_LAW:
+		new_format = HARMONY_DF_8BIT_ULAW;
+		break;
+	}
+	/* re-initialize silence buffer if needed */
+	if (old_format != new_format)
+		snd_pcm_format_set_silence(pcm_format, harmony->silence_dma.area,
+					   (HARMONY_BUF_SIZE * SILENCE_BUFS * 8) / snd_pcm_format_width(pcm_format));
+
+	return new_format;
+}
+
 static int snd_card_harmony_playback_prepare(snd_pcm_substream_t * substream)
 {
 	snd_card_harmony_t *harmony = snd_pcm_substream_chip(substream);
@@ -577,12 +556,13 @@ static int snd_card_harmony_playback_prepare(snd_pcm_substream_t * substream)
 	harmony->sample_rate = snd_card_harmony_rate_bits(runtime->rate);
 
 	/* data format */
-	if (snd_pcm_format_width(runtime->format) == 16) harmony->data_format = HARMONY_DF_16BIT_LINEAR;
-	else harmony->data_format = HARMONY_DF_8BIT_ULAW;
-	
+	harmony->data_format = snd_harmony_set_data_format(haromny, runtime->format);
+
 	/* number of channels */
-	if (runtime->channels == 2) harmony->stereo_select = HARMONY_SS_STEREO;
-	else harmony->stereo_select = HARMONY_SS_MONO;
+	if (runtime->channels == 2)
+		harmony->stereo_select = HARMONY_SS_STEREO;
+	else
+		harmony->stereo_select = HARMONY_SS_MONO;
 	
 	DPRINTK(KERN_INFO PFX "Playback_prepare, sr=%d(%x), df=%x, ss=%x hpa=%lx\n", runtime->rate,
 				harmony->sample_rate, harmony->data_format, harmony->stereo_select, harmony->hpa);
@@ -607,12 +587,13 @@ static int snd_card_harmony_capture_prepare(snd_pcm_substream_t * substream)
 	harmony->sample_rate = snd_card_harmony_rate_bits(runtime->rate);
 	
 	/* data format */
-	if (snd_pcm_format_width(runtime->format) == 16) harmony->data_format = HARMONY_DF_16BIT_LINEAR;
-	else harmony->data_format = HARMONY_DF_8BIT_ULAW;
+	harmony->data_format = snd_harmony_set_data_format(haromny, runtime->format);
 	
 	/* number of channels */
-	if (runtime->channels == 1) harmony->stereo_select = HARMONY_SS_MONO;
-	else if (runtime->channels == 2) harmony->stereo_select = HARMONY_SS_STEREO;
+	if (runtime->channels == 1)
+		harmony->stereo_select = HARMONY_SS_MONO;
+	else if (runtime->channels == 2)
+		harmony->stereo_select = HARMONY_SS_STEREO;
 		
 	snd_harmony_update_control(harmony);
 	harmony->format_initialized = 1;
@@ -709,13 +690,6 @@ static int snd_card_harmony_playback_open(snd_pcm_substream_t * substream)
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
 	
-	/*
-	 * harmony is not "real" pci, but we need a pci_dev
-	 * to alloc PCI DMA pages
-	 */
-	substream->runtime->dma_private = harmony->fake_pci_dev;
-//	substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI;
-	
 	harmony->playback_substream = substream;
 	runtime->hw = snd_card_harmony_playback;
 	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraint_rates);
@@ -732,14 +706,6 @@ static int snd_card_harmony_capture_open(snd_pcm_substream_t * substream)
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
 	
-	
-	/*
-	 * harmony is not "real" pci, but we need a pci_dev
-	 * to alloc PCI DMA pages
-	 */
-	substream->runtime->dma_private = harmony->fake_pci_dev;
-//	substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI;
-
 	harmony->capture_substream = substream;
 	runtime->hw = snd_card_harmony_capture;
 	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraint_rates);
@@ -752,7 +718,6 @@ static int snd_card_harmony_capture_open(snd_pcm_substream_t * substream)
 static int snd_card_harmony_playback_close(snd_pcm_substream_t * substream)
 {
 	snd_card_harmony_t *harmony = snd_pcm_substream_chip(substream);
-	snd_pcm_lib_free_pages(substream);
 	
 	harmony->playback_substream = NULL;
 	harmony->ply_size 			= 0;
@@ -769,8 +734,6 @@ static int snd_card_harmony_capture_close(snd_pcm_substream_t * substream)
 {
 	snd_card_harmony_t *harmony = snd_pcm_substream_chip(substream);
 	
-	snd_pcm_lib_free_pages(substream);
-	
 	harmony->capture_substream = NULL;
 	harmony->cap_size 			= 0;
 	harmony->cap_buf			= 0;
@@ -785,12 +748,11 @@ static int snd_card_harmony_capture_close(snd_pcm_substream_t * substream)
 static int snd_card_harmony_hw_params(snd_pcm_substream_t *substream, 
 	                   snd_pcm_hw_params_t * hw_params)
 {
-	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
 	
 	err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
 	DPRINTK(KERN_INFO PFX "HW Params returned %d, dma_addr %lx\n", err,
-			(unsigned long)runtime->dma_addr);
+			(unsigned long)substream->runtime->dma_addr);
 	return err;
 }
 
@@ -847,15 +809,19 @@ static int snd_card_harmony_pcm_init(snd_card_harmony_t *harmony, int device)
 	harmony->pcm = pcm;
 	
 	/* initialize graveyard buffer */
-	harmony->dma_dev.type = SNDRV_DMA_TYPE_PCI;
-	harmony->dma_dev.dev = snd_dma_pci_data(harmony->fake_pci_dev); 
-	harmony->graveyard_addr = snd_dma_alloc_pages(&chip->dma_dev,
-			HARMONY_BUF_SIZE*GRAVEYARD_BUFS, &harmony->graveyard_dma);
+	harmony->dma_dev.type = SNDRV_DMA_TYPE_DEV;
+	harmony->dma_dev.dev = &harmony->pa_dev->dev;
+	err = snd_dma_alloc_pages(&harmony->dma_dev, HARMONY_BUF_SIZE*GRAVEYARD_BUFS,
+				  &harmony->graveyard_dma);
+	if (err < 0)
+		return err;
 	harmony->graveyard_count = 0;
 	
 	/* initialize silence buffers */
-	harmony->silence_addr = snd_dma_alloc_pages(&chip->dma_dev,
-			HARMONY_BUF_SIZE*SILENCE_BUFS, &harmony->silence_dma);
+	err = snd_dma_alloc_pages(&harmony->dma_dev, HARMONY_BUF_SIZE*SILENCE_BUFS,
+				  &harmony->silence_dma);
+	if (err < 0)
+		return err;
 	harmony->silence_count = 0;
 
 	harmony->ply_stopped = harmony->cap_stopped = 1;
@@ -865,8 +831,8 @@ static int snd_card_harmony_pcm_init(snd_card_harmony_t *harmony, int device)
 	harmony->graveyard_count = 0;
 	
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-					      snd_dma_pci_data(harmony->fake_pci_dev),
-					      64 * 1024, 128 * 1024);
+					      &harmony->pa_dev->dev,
+					      MAX_BUFFER_SIZE, MAX_BUFFER_SIZE);
 
 	return 0;
 }
@@ -963,7 +929,7 @@ HARMONY_VOLUME("Master Volume", 20, 20, 0x0f, 1),
 HARMONY_VOLUME("PCM Playback Volume", 6, 0, 0x3f, 1),
 };
 
-static void snd_harmony_reset_codec(snd_card_harmony_t *harmony)
+static void __init snd_harmony_reset_codec(snd_card_harmony_t *harmony)
 {
  	snd_harmony_wait_cntl(harmony);
 	gsc_writel(1, harmony->hpa+REG_RESET);
@@ -985,7 +951,7 @@ static void __init snd_harmony_mixer_reset(snd_card_harmony_t *harmony)
 }
 
 
-int __init snd_card_harmony_mixer_init(snd_card_harmony_t *harmony)
+static int __init snd_card_harmony_mixer_init(snd_card_harmony_t *harmony)
 {
 	snd_card_t *card = harmony->card;
 	int idx, err;
@@ -1009,10 +975,11 @@ static int snd_card_harmony_create(snd_card_t *card, struct parisc_device *pa_de
 	
 	harmony->card = card;
 	
+	harmony->pa_dev = pa_dev;
+
 	/* Set the HPA of harmony */
 	harmony->hpa = pa_dev->hpa;
 	
-
 	harmony->irq = pa_dev->irq;
 	if (!harmony->irq) {
 		printk(KERN_ERR PFX "no irq found\n");
@@ -1038,8 +1005,6 @@ static int snd_card_harmony_create(snd_card_t *card, struct parisc_device *pa_de
 		return -EBUSY;
 	}
 	
-	/* a fake pci_dev is needed for pci_* functions under ccio */
-	harmony->fake_pci_dev = ccio_get_fake(pa_dev);
 	return 0;
 }
 	
@@ -1050,7 +1015,7 @@ static int __init snd_card_harmony_probe(struct parisc_device *pa_dev)
 	snd_card_t *card;
 	int err;
 	
-    if (dev >= SNDRV_CARDS)
+	if (dev >= SNDRV_CARDS)
 		return -ENODEV;
 	if (!enable[dev]) {
 		dev++;
@@ -1064,6 +1029,8 @@ static int __init snd_card_harmony_probe(struct parisc_device *pa_dev)
 	if (card == NULL)
 		return -ENOMEM;
 	chip = (struct snd_card_harmony *)card->private_data;
+	spin_lock_init(&chip->control_lock);
+	spin_lock_init(&chip->mixer_lock);
 	
 	if ((err = snd_card_harmony_create(card, pa_dev, chip)) < 0) {
 		printk(KERN_ERR PFX "Creation failed\n");
@@ -1144,7 +1111,6 @@ static void __exit alsa_card_harmony_exit(void)
 		{	
 			DPRINTK(KERN_INFO PFX "Freeing card %d\n", idx);
 			harmony = snd_harmony_cards[idx]->private_data;
-			snd_harmony_proc_done(harmony);
 			free_irq(harmony->irq, snd_card_harmony_interrupt);
 			printk(KERN_INFO PFX "Card unloaded %d, irq=%d\n", idx, harmony->irq);
 			snd_card_free(snd_harmony_cards[idx]);
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 269720128..9f922b029 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -16,11 +16,11 @@ config SND_ALI5451
 	  Say 'Y' or 'M' to include support for ALI PCI Audio M5451 sound core.
 
 config SND_ATIIXP
-	tristate "ATI IXP 150/200/250"
+	tristate "ATI IXP 150/200/250/300"
 	depends on SND
 	select SND_AC97_CODEC
 	help
-	  Say 'Y' or 'M' to include support for ATI IXP 150/200/250 AC97 controller.
+	  Say 'Y' or 'M' to include support for ATI IXP 150/200/250/300 AC97 controller.
 
 config SND_AU8810
         tristate "Aureal Advantage"
@@ -29,6 +29,9 @@ config SND_AU8810
 	select SND_AC97_CODEC
         help
           Say 'Y' or 'M' to include support for Aureal Advantage soundcards.
+          Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
+          3D support code is in place, but not yet useable. For more info, 
+          email the ALSA developer list, or mjander@users.sourceforge.net.
  
 config SND_AU8820
         tristate "Aureal Vortex"
@@ -37,6 +40,8 @@ config SND_AU8820
 	select SND_AC97_CODEC
         help
           Say 'Y' or 'M' to include support for Aureal Vortex soundcards.
+          Supported features: Hardware Mixer and SRC. For more info, email 
+          the ALSA developer list, or mjander@users.sourceforge.net.
  
 config SND_AU8830
         tristate "Aureal Vortex 2"
@@ -45,6 +50,9 @@ config SND_AU8830
 	select SND_AC97_CODEC
         help
           Say 'Y' or 'M' to include support for Aureal Vortex 2 soundcards.
+          Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
+          3D support code is in place, but not yet useable. For more info, 
+          email the ALSA developer list, or mjander@users.sourceforge.net.
  
 config SND_AZT3328
 	tristate "Aztech AZF3328 / PCI168 (EXPERIMENTAL)"
@@ -262,15 +270,15 @@ config SND_ICE1712
 	  TerraTec - EWX 24/96, EWS 88MT, EWS 88D, DMX 6Fire.
 
 config SND_ICE1724
-	tristate "ICE/VT1724 (Envy24HT)"
+	tristate "ICE/VT1724/1720 (Envy24HT/PT)"
 	depends on SND
 	select SND_MPU401_UART
 	select SND_AC97_CODEC
 	help
-	  Say 'Y' or 'M' to include support for ICE/VT1724 (Envy24HT) based
+	  Say 'Y' or 'M' to include support for ICE/VT1724/1720 (Envy24HT/PT) based
 	  soundcards.
 	  Currently supported hardware is: MidiMan M Audio - Revolution 7.1,
-	  AMP Ltd AUDIO2000.
+	  AMP Ltd AUDIO2000, Terratec Aureon 5.1 Sky/7.1, AudioTrak Prodigy 7.1.
 
 config SND_INTEL8X0
 	tristate "Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111"
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 4044d0816..8f43dd60d 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -27,6 +27,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
@@ -42,7 +43,7 @@ MODULE_LICENSE("GPL");
 
 static int enable_loopback;
 
-MODULE_PARM(enable_loopback, "i");
+module_param(enable_loopback, bool, 0444);
 MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control");
 MODULE_PARM_SYNTAX(enable_loopback, SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -299,6 +300,16 @@ unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg)
 	return ac97->bus->read(ac97, reg);
 }
 
+/* read a register - return the cached value if already read */
+static inline unsigned short snd_ac97_read_cache(ac97_t *ac97, unsigned short reg)
+{
+	if (! test_bit(reg, ac97->reg_accessed)) {
+		ac97->regs[reg] = ac97->bus->read(ac97, reg);
+		// set_bit(reg, ac97->reg_accessed);
+	}
+	return ac97->regs[reg];
+}
+
 /**
  * snd_ac97_write_cache - write a value on the given register and update the cache
  * @ac97: the ac97 instance
@@ -370,7 +381,7 @@ int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask,
 	if (!snd_ac97_valid_reg(ac97, reg))
 		return -EINVAL;
 	spin_lock(&ac97->reg_lock);
-	old = ac97->regs[reg];
+	old = snd_ac97_read_cache(ac97, reg);
 	new = (old & ~mask) | value;
 	change = old != new;
 	if (change) {
@@ -385,25 +396,26 @@ int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask,
 static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned short mask, unsigned short value)
 {
 	int change;
-	unsigned short old, new;
+	unsigned short old, new, cfg;
 
 	down(&ac97->spec.ad18xx.mutex);
 	spin_lock(&ac97->reg_lock);
 	old = ac97->spec.ad18xx.pcmreg[codec];
 	new = (old & ~mask) | value;
+	cfg = snd_ac97_read_cache(ac97, AC97_AD_SERIAL_CFG);
 	change = old != new;
 	if (change) {
 		ac97->spec.ad18xx.pcmreg[codec] = new;
 		spin_unlock(&ac97->reg_lock);
 		/* select single codec */
 		ac97->bus->write(ac97, AC97_AD_SERIAL_CFG,
-				 (ac97->regs[AC97_AD_SERIAL_CFG] & ~0x7000) |
+				 (cfg & ~0x7000) |
 				 ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
 		/* update PCM bits */
 		ac97->bus->write(ac97, AC97_PCM, new);
 		/* select all codecs */
 		ac97->bus->write(ac97, AC97_AD_SERIAL_CFG,
-				 ac97->regs[AC97_AD_SERIAL_CFG] | 0x7000);
+				 cfg | 0x7000);
 	} else
 		spin_unlock(&ac97->reg_lock);
 	up(&ac97->spec.ad18xx.mutex);
@@ -435,7 +447,7 @@ static int snd_ac97_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * uc
 	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
 	unsigned short val;
 	
-	val = ac97->regs[AC97_REC_SEL];
+	val = snd_ac97_read_cache(ac97, AC97_REC_SEL);
 	ucontrol->value.enumerated.item[0] = (val >> 8) & 7;
 	ucontrol->value.enumerated.item[1] = (val >> 0) & 7;
 	return 0;
@@ -493,7 +505,7 @@ static int snd_ac97_get_enum_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_valu
 	int shift = (kcontrol->private_value >> 8) & 0xff;
 	int invert = (kcontrol->private_value >> 24) & 0xff;
 	
-	val = (ac97->regs[reg] >> shift) & 1;
+	val = (snd_ac97_read_cache(ac97, reg) >> shift) & 1;
 	if (invert)
 		val ^= 1;
 	ucontrol->value.enumerated.item[0] = val;
@@ -535,7 +547,7 @@ int snd_ac97_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontr
 	int mask = (kcontrol->private_value >> 16) & 0xff;
 	int invert = (kcontrol->private_value >> 24) & 0xff;
 	
-	ucontrol->value.integer.value[0] = (ac97->regs[reg] >> shift) & mask;
+	ucontrol->value.integer.value[0] = (snd_ac97_read_cache(ac97, reg) >> shift) & mask;
 	if (invert)
 		ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0];
 	return 0;
@@ -582,8 +594,8 @@ static int snd_ac97_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
 	int invert = (kcontrol->private_value >> 24) & 0xff;
 	
 	spin_lock(&ac97->reg_lock);
-	ucontrol->value.integer.value[0] = (ac97->regs[reg] >> shift_left) & mask;
-	ucontrol->value.integer.value[1] = (ac97->regs[reg] >> shift_right) & mask;
+	ucontrol->value.integer.value[0] = (snd_ac97_read_cache(ac97, reg) >> shift_left) & mask;
+	ucontrol->value.integer.value[1] = (snd_ac97_read_cache(ac97, reg) >> shift_right) & mask;
 	spin_unlock(&ac97->reg_lock);
 	if (invert) {
 		ucontrol->value.integer.value[0] = mask - ucontrol->value.integer.value[0];
@@ -796,7 +808,7 @@ static int snd_ac97_spdif_default_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_val
 					       AC97_CXR_SPDIF_MASK | AC97_CXR_COPYRGT,
 					       v);
 	} else {
-		unsigned short extst = ac97->regs[AC97_EXTENDED_STATUS];
+		unsigned short extst = snd_ac97_read_cache(ac97, AC97_EXTENDED_STATUS);
 		snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); /* turn off */
 
 		change |= snd_ac97_update_bits(ac97, AC97_SPDIF, 0x3fff, val);
@@ -822,13 +834,13 @@ static int snd_ac97_put_spsa(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
 	mask <<= shift;
 	value <<= shift;
 	spin_lock(&ac97->reg_lock);
-	old = ac97->regs[reg];
+	old = snd_ac97_read_cache(ac97, reg);
 	new = (old & ~mask) | value;
 	spin_unlock(&ac97->reg_lock);
 
 	if (old != new) {
 		int change;
-		unsigned short extst = ac97->regs[AC97_EXTENDED_STATUS];
+		unsigned short extst = snd_ac97_read_cache(ac97, AC97_EXTENDED_STATUS);
 		snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0); /* turn off */
 		change = snd_ac97_update_bits(ac97, reg, mask, value);
 		if (extst & AC97_EA_SPDIF)
@@ -868,14 +880,14 @@ const snd_kcontrol_new_t snd_ac97_controls_spdif[5] = {
 		.info = snd_ac97_info_single,
 		.get = snd_ac97_get_single,
 		.put = snd_ac97_put_spsa,
-		.private_value = AC97_EXTENDED_STATUS | (4 << 8) | (3 << 16) | (0 << 24),
+		.private_value = AC97_SINGLE_VALUE(AC97_EXTENDED_STATUS, 4, 3, 0)
 	},
 };
 
 #define AD18XX_PCM_BITS(xname, codec, lshift, rshift, mask) \
 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ac97_ad18xx_pcm_info_bits, \
   .get = snd_ac97_ad18xx_pcm_get_bits, .put = snd_ac97_ad18xx_pcm_put_bits, \
-  .private_value = (codec) | ((lshift) << 8) | ((rshift) << 12) | ((mask) << 24) }
+  .private_value = (codec) | ((lshift) << 8) | ((rshift) << 12) | ((mask) << 16) }
 
 static int snd_ac97_ad18xx_pcm_info_bits(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
@@ -987,6 +999,8 @@ AD18XX_PCM_BITS("LFE Playback Volume", 2, 0, 0, 31)
  *
  */
 
+static void snd_ac97_powerdown(ac97_t *ac97);
+
 static int snd_ac97_bus_free(ac97_bus_t *bus)
 {
 	if (bus) {
@@ -1022,6 +1036,7 @@ static int snd_ac97_free(ac97_t *ac97)
 static int snd_ac97_dev_free(snd_device_t *device)
 {
 	ac97_t *ac97 = snd_magic_cast(ac97_t, device->device_data, return -ENXIO);
+	snd_ac97_powerdown(ac97); /* for avoiding click noises during shut down */
 	return snd_ac97_free(ac97);
 }
 
@@ -1572,6 +1587,26 @@ static void snd_ac97_determine_rates(ac97_t *ac97, int reg, int shadow_reg, unsi
 	*r_result = result;
 }
 
+/* check AC97_SPDIF register to accept which sample rates */
+static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97)
+{
+	unsigned int result = 0;
+	int i;
+	static unsigned short ctl_bits[] = {
+		AC97_SC_SPSR_44K, AC97_SC_SPSR_32K, AC97_SC_SPSR_48K
+	};
+	static unsigned int rate_bits[] = {
+		SNDRV_PCM_RATE_44100, SNDRV_PCM_RATE_32000, SNDRV_PCM_RATE_48000
+	};
+
+	for (i = 0; i < (int)ARRAY_SIZE(ctl_bits); i++) {
+		snd_ac97_update_bits(ac97, AC97_SPDIF, AC97_SC_SPSR_MASK, ctl_bits[i]);
+		if ((snd_ac97_read(ac97, AC97_SPDIF) & AC97_SC_SPSR_MASK) == ctl_bits[i])
+			result |= rate_bits[i];
+	}
+	return result;
+}
+
 void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem)
 {
 	const ac97_codec_id_t *pid;
@@ -1889,9 +1924,7 @@ int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97)
 		else if (ac97->id == AC97_ID_CM9739)
 			ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000;
 		else
-			ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_48000 |
-						SNDRV_PCM_RATE_44100 |
-						SNDRV_PCM_RATE_32000;
+			ac97->rates[AC97_RATES_SPDIF] = snd_ac97_determine_spdif_rates(ac97);
 	}
 	if (ac97->ext_id & AC97_EI_VRM) {	/* MIC VRA support */
 		snd_ac97_determine_rates(ac97, AC97_PCM_MIC_ADC_RATE, 0, &ac97->rates[AC97_RATES_MIC_ADC]);
@@ -1949,12 +1982,12 @@ int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97)
 	}
 	/* make sure the proper powerdown bits are cleared */
 	if (ac97->scaps) {
-		reg = snd_ac97_read(ac97, AC97_EXTENDED_ID);
+		reg = snd_ac97_read(ac97, AC97_EXTENDED_STATUS);
 		if (ac97->scaps & AC97_SCAP_SURROUND_DAC) 
 			reg &= ~AC97_EA_PRJ;
 		if (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC) 
 			reg &= ~(AC97_EA_PRI | AC97_EA_PRK);
-		snd_ac97_write_cache(ac97, AC97_EXTENDED_ID, reg);
+		snd_ac97_write_cache(ac97, AC97_EXTENDED_STATUS, reg);
 	}
 	snd_ac97_proc_init(ac97);
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ac97, &ops)) < 0) {
@@ -1965,17 +1998,24 @@ int snd_ac97_mixer(ac97_bus_t * bus, ac97_t * _ac97, ac97_t ** rac97)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-/**
- * snd_ac97_suspend - General suspend function for AC97 codec
- * @ac97: the ac97 instance
+
+/*
+ * Power down the chip.
  *
- * Suspends the codec, power down the chip.
+ * MASTER and HEADPHONE registers are muted but the register cache values
+ * are not changed, so that the values can be restored in snd_ac97_resume().
  */
-void snd_ac97_suspend(ac97_t *ac97)
+static void snd_ac97_powerdown(ac97_t *ac97)
 {
-	unsigned short power = (ac97->regs[AC97_POWERDOWN] ^ 0x8000) & ~0x8000;	/* invert EAPD */
+	unsigned short power;
+
+	if (ac97_is_audio(ac97)) {
+		/* some codecs have stereo mute bits */
+		snd_ac97_write(ac97, AC97_MASTER, 0x9f9f);
+		snd_ac97_write(ac97, AC97_HEADPHONE, 0x9f9f);
+	}
 
+	power = ac97->regs[AC97_POWERDOWN] | 0x8000;	/* EAPD */
 	power |= 0x4000;	/* Headphone amplifier powerdown */
 	power |= 0x0300;	/* ADC & DAC powerdown */
 	snd_ac97_write(ac97, AC97_POWERDOWN, power);
@@ -1983,8 +2023,24 @@ void snd_ac97_suspend(ac97_t *ac97)
 	power |= 0x0400;	/* Analog Mixer powerdown (Vref on) */
 	snd_ac97_write(ac97, AC97_POWERDOWN, power);
 	udelay(100);
+#if 0
+	/* FIXME: this causes click noises on some boards at resume */
 	power |= 0x3800;	/* AC-link powerdown, internal Clk disable */
 	snd_ac97_write(ac97, AC97_POWERDOWN, power);
+#endif
+}
+
+
+#ifdef CONFIG_PM
+/**
+ * snd_ac97_suspend - General suspend function for AC97 codec
+ * @ac97: the ac97 instance
+ *
+ * Suspends the codec, power down the chip.
+ */
+void snd_ac97_suspend(ac97_t *ac97)
+{
+	snd_ac97_powerdown(ac97);
 }
 
 /**
@@ -2267,6 +2323,7 @@ EXPORT_SYMBOL(snd_ac97_tune_hardware);
 EXPORT_SYMBOL(snd_ac97_set_rate);
 #ifdef CONFIG_PM
 EXPORT_SYMBOL(snd_ac97_resume);
+EXPORT_SYMBOL(snd_ac97_suspend);
 #endif
 
 /*
diff --git a/sound/pci/ac97/ac97_local.h b/sound/pci/ac97/ac97_local.h
index 5380239b1..838656f76 100644
--- a/sound/pci/ac97/ac97_local.h
+++ b/sound/pci/ac97/ac97_local.h
@@ -22,10 +22,11 @@
  *
  */
 
+#define AC97_SINGLE_VALUE(reg,shift,mask,invert) ((reg) | ((shift) << 8) | ((mask) << 16) | ((invert) << 24))
 #define AC97_SINGLE(xname, reg, shift, mask, invert) \
 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ac97_info_single, \
   .get = snd_ac97_get_single, .put = snd_ac97_put_single, \
-  .private_value = (reg) | ((shift) << 8) | ((mask) << 16) | ((invert) << 24) }
+  .private_value =  AC97_SINGLE_VALUE(reg, shift, mask, invert) }
 
 /* ac97_codec.c */
 extern const char *snd_ac97_stereo_enhancements[];
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 1baa82ef5..85124051e 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -447,18 +447,198 @@ int patch_sigmatel_stac9756(ac97_t * ac97)
 	return 0;
 }
 
+static int snd_ac97_stac9758_output_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[5] = { "Input/Disabled", "Front Output",
+		"Rear Output", "Center/LFE Output", "Mixer Output" };
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 5;
+	if (uinfo->value.enumerated.item > 4)
+		uinfo->value.enumerated.item = 4;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_ac97_stac9758_output_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	int shift = kcontrol->private_value;
+	unsigned short val;
+
+	val = ac97->regs[AC97_SIGMATEL_OUTSEL];
+	if (!((val >> shift) & 4))
+		ucontrol->value.enumerated.item[0] = 0;
+	else
+		ucontrol->value.enumerated.item[0] = 1 + ((val >> shift) & 3);
+	return 0;
+}
+
+static int snd_ac97_stac9758_output_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	int shift = kcontrol->private_value;
+	unsigned short val;
+
+	if (ucontrol->value.enumerated.item[0] > 4)
+		return -EINVAL;
+	if (ucontrol->value.enumerated.item[0] == 0)
+		val = 0;
+	else
+		val = 4 | (ucontrol->value.enumerated.item[0] - 1);
+	return snd_ac97_update_bits(ac97, AC97_SIGMATEL_OUTSEL,
+				    7 << shift, val << shift);
+}
+
+static int snd_ac97_stac9758_input_jack_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[7] = { "Mic2 Jack", "Mic1 Jack", "Line In Jack",
+		"Front Jack", "Rear Jack", "Center/LFE Jack", "Mute" };
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 7;
+	if (uinfo->value.enumerated.item > 6)
+		uinfo->value.enumerated.item = 6;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_ac97_stac9758_input_jack_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	int shift = kcontrol->private_value;
+	unsigned short val;
+
+	val = ac97->regs[AC97_SIGMATEL_INSEL];
+	ucontrol->value.enumerated.item[0] = (val >> shift) & 7;
+	return 0;
+}
+
+static int snd_ac97_stac9758_input_jack_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	int shift = kcontrol->private_value;
+
+	return snd_ac97_update_bits(ac97, AC97_SIGMATEL_INSEL, 7 << shift,
+				    ucontrol->value.enumerated.item[0] << shift);
+}
+
+static int snd_ac97_stac9758_phonesel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[3] = { "None", "Front Jack", "Rear Jack" };
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 3;
+	if (uinfo->value.enumerated.item > 2)
+		uinfo->value.enumerated.item = 2;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_ac97_stac9758_phonesel_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t* ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+
+	ucontrol->value.enumerated.item[0] = ac97->regs[AC97_SIGMATEL_IOMISC] & 3;
+	return 0;
+}
+
+static int snd_ac97_stac9758_phonesel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+
+	return snd_ac97_update_bits(ac97, AC97_SIGMATEL_IOMISC, 3,
+				    ucontrol->value.enumerated.item[0]);
+}
+
+#define STAC9758_OUTPUT_JACK(xname, shift) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
+	.info = snd_ac97_stac9758_output_jack_info, \
+	.get = snd_ac97_stac9758_output_jack_get, \
+	.put = snd_ac97_stac9758_output_jack_put, \
+	.private_value = shift }
+#define STAC9758_INPUT_JACK(xname, shift) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
+	.info = snd_ac97_stac9758_input_jack_info, \
+	.get = snd_ac97_stac9758_input_jack_get, \
+	.put = snd_ac97_stac9758_input_jack_put, \
+	.private_value = shift }
+static const snd_kcontrol_new_t snd_ac97_sigmatel_stac9758_controls[] = {
+	STAC9758_OUTPUT_JACK("Mic1 Jack", 1),
+	STAC9758_OUTPUT_JACK("LineIn Jack", 4),
+	STAC9758_OUTPUT_JACK("Front Jack", 7),
+	STAC9758_OUTPUT_JACK("Rear Jack", 10),
+	STAC9758_OUTPUT_JACK("Center/LFE Jack", 13),
+	STAC9758_INPUT_JACK("Mic Input Source", 0),
+	STAC9758_INPUT_JACK("Line Input Source", 8),
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Headphone Amp",
+		.info = snd_ac97_stac9758_phonesel_info,
+		.get = snd_ac97_stac9758_phonesel_get,
+		.put = snd_ac97_stac9758_phonesel_put
+	},
+	AC97_SINGLE("Exchange Center/LFE", AC97_SIGMATEL_IOMISC, 4, 1, 0),
+	AC97_SINGLE("Headphone +3dB Boost", AC97_SIGMATEL_IOMISC, 8, 1, 0)
+};
+
+static int patch_sigmatel_stac9758_specific(ac97_t *ac97)
+{
+	int err;
+
+	err = patch_sigmatel_stac97xx_specific(ac97);
+	if (err < 0)
+		return err;
+	err = patch_build_controls(ac97, snd_ac97_sigmatel_stac9758_controls,
+				   ARRAY_SIZE(snd_ac97_sigmatel_stac9758_controls));
+	if (err < 0)
+		return err;
+	return 0;
+}
+
+static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
+	.build_3d	= patch_sigmatel_stac9700_3d,
+	.build_specific	= patch_sigmatel_stac9758_specific
+};
+
 int patch_sigmatel_stac9758(ac97_t * ac97)
 {
+	static unsigned short regs[4] = {
+		AC97_SIGMATEL_OUTSEL,
+		AC97_SIGMATEL_IOMISC,
+		AC97_SIGMATEL_INSEL,
+		AC97_SIGMATEL_VARIOUS
+	};
+	static unsigned short def_regs[4] = {
+		/* OUTSEL */ 0xd794,
+		/* IOMISC */ 0x2001,
+		/* INSEL */ 0x0201,
+		/* VARIOUS */ 0x0040
+	};
+	static unsigned short m675_regs[4] = {
+		/* OUTSEL */ 0x9040,
+		/* IOMISC */ 0x2102,
+		/* INSEL */ 0x0203,
+		/* VARIOUS */ 0x0041
+	};
+	unsigned short *pregs = def_regs;
+	int i;
+
+	/* Gateway M675 notebook */
+	if (ac97->pci && 
+	    ac97->subsystem_vendor == 0x107b &&
+	    ac97->subsystem_device == 0x0601)
+	    	pregs = m675_regs;
+
 	// patch for SigmaTel
-	ac97->build_ops = &patch_sigmatel_stac9700_ops;
-	// turn on stereo speaker, headphone and line-out
-	snd_ac97_write_cache(ac97, AC97_SIGMATEL_OUTSEL, 0x9040);
-	// headphone select and boost
-	snd_ac97_write_cache(ac97, AC97_SIGMATEL_IOMISC, 0x2102);
-	// enable mic
-	snd_ac97_write_cache(ac97, AC97_SIGMATEL_INSEL, 0x0203);
-	// enable stereo mic
-	snd_ac97_write_cache(ac97, AC97_SIGMATEL_VARIOUS, 0x0001);
+	ac97->build_ops = &patch_sigmatel_stac9758_ops;
+	for (i = 0; i < 4; i++)
+		snd_ac97_write_cache(ac97, regs[i], pregs[i]);
+
+	ac97->flags |= AC97_STEREO_MUTES;
 	return 0;
 }
 
@@ -1027,6 +1207,8 @@ int patch_ad1985(ac97_t * ac97)
 			     AC97_AD198X_MSPLT |
 			     AC97_AD198X_AC97NC);
 	ac97->flags |= AC97_STEREO_MUTES;
+	/* on AD1985 rev. 3, AC'97 revision bits are zero */
+	ac97->ext_id = (ac97->ext_id & ~AC97_EI_REV_MASK) | AC97_EI_REV_23;
 	return 0;
 }
 
@@ -1088,6 +1270,7 @@ static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = {
 		.info = snd_ac97_info_single,
 		.get = snd_ac97_alc650_mic_get,
 		.put = snd_ac97_alc650_mic_put,
+		.private_value = AC97_SINGLE_VALUE(0, 0, 1, 0) /* only mask needed */
 	},
 };
 
@@ -1188,6 +1371,7 @@ static const snd_kcontrol_new_t snd_ac97_controls_alc655[] = {
 		.info = snd_ac97_info_single,
 		.get = snd_ac97_alc655_mic_get,
 		.put = snd_ac97_alc655_mic_put,
+		.private_value = AC97_SINGLE_VALUE(0, 0, 1, 0) /* only mask needed */
 	},
 };
 
@@ -1358,8 +1542,34 @@ static const snd_kcontrol_new_t snd_ac97_cm9739_controls_spdif[] = {
 	/* BIT 8: SPD32 - 32bit SPDIF - not supported yet */
 };
 
+static int snd_ac97_cm9739_center_mic_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	if (ac97->regs[AC97_CM9739_MULTI_CHAN] & 0x1000)
+		ucontrol->value.integer.value[0] = 1;
+	else
+		ucontrol->value.integer.value[0] = 0;
+	return 0;
+}
+
+static int snd_ac97_cm9739_center_mic_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+	return snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 0x3000,
+				    ucontrol->value.integer.value[0] ? 
+				    0x1000 : 0x2000);
+}
+
 static const snd_kcontrol_new_t snd_ac97_cm9739_controls[] = {
 	AC97_SINGLE("Line-In As Surround", AC97_CM9739_MULTI_CHAN, 10, 1, 0),
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Mic As Center/LFE",
+		.info = snd_ac97_info_single,
+		.get = snd_ac97_cm9739_center_mic_get,
+		.put = snd_ac97_cm9739_center_mic_put,
+		.private_value = AC97_SINGLE_VALUE(0, 0, 1, 0) /* only mask needed */
+	},
 };
 
 static int patch_cm9739_specific(ac97_t * ac97)
@@ -1394,10 +1604,13 @@ int patch_cm9739(ac97_t * ac97)
 	}
 
 	/* set-up multi channel */
-	/* bit 13: enable internal vref output for mic */
-	/* bit 12: enable center/lfe */
 	/* bit 14: 0 = SPDIF, 1 = EAPD */
-	val = (1 << 12) | (1 << 13);
+	/* bit 13: enable internal vref output for mic */
+	/* bit 12: disable center/lfe (swithable) */
+	/* bit 10: disable surround/line (switchable) */
+	/* bit 9: mix 2 surround off */
+	/* bit 0: dB */
+	val = (1 << 13);
 	if (! (ac97->ext_id & AC97_EI_SPDIF))
 		val |= (1 << 14);
 	snd_ac97_write_cache(ac97, AC97_CM9739_MULTI_CHAN, val);
diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c
index f87194ddc..11e80ef23 100644
--- a/sound/pci/ac97/ac97_pcm.c
+++ b/sound/pci/ac97/ac97_pcm.c
@@ -210,7 +210,7 @@ static int set_spdif_rate(ac97_t *ac97, unsigned short rate)
 	}
 
 	spin_lock(&ac97->reg_lock);
-	old = ac97->regs[reg] & mask;
+	old = snd_ac97_read(ac97, reg) & mask;
 	spin_unlock(&ac97->reg_lock);
 	if (old != bits) {
 		snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS, AC97_EA_SPDIF, 0);
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c
index 208046379..40b3e9fd8 100644
--- a/sound/pci/ac97/ac97_proc.c
+++ b/sound/pci/ac97/ac97_proc.c
@@ -34,6 +34,40 @@
  * proc interface
  */
 
+static void snd_ac97_proc_read_functions(ac97_t *ac97, snd_info_buffer_t *buffer)
+{
+	int header = 0, function;
+	unsigned short info, sense_info;
+	static const char *function_names[12] = {
+		"Master Out", "AUX Out", "Center/LFE Out", "SPDIF Out",
+		"Phone In", "Mic 1", "Mic 2", "Line In", "CD In", "Video In",
+		"Aux In", "Mono Out"
+	};
+	static const char *locations[8] = {
+		"Rear I/O Panel", "Front Panel", "Motherboard", "Dock/External",
+		"reserved", "reserved", "reserved", "NC/unused"
+	};
+
+	for (function = 0; function < 12; ++function) {
+		snd_ac97_write(ac97, AC97_FUNC_SELECT, function << 1);
+		info = snd_ac97_read(ac97, AC97_FUNC_INFO);
+		if (!(info & 0x0001))
+			continue;
+		if (!header) {
+			snd_iprintf(buffer, "\n                    Gain     Inverted  Buffer delay  Location\n");
+			header = 1;
+		}
+		sense_info = snd_ac97_read(ac97, AC97_SENSE_INFO);
+		snd_iprintf(buffer, "%-17s: %3d.%d dBV    %c      %2d/fs         %s\n",
+			    function_names[function],
+			    (info & 0x8000 ? -1 : 1) * ((info & 0x7000) >> 12) * 3 / 2,
+			    ((info & 0x0800) >> 11) * 5,
+			    info & 0x0400 ? 'X' : '-',
+			    (info & 0x03e0) >> 5,
+			    locations[sense_info >> 13]);
+	}
+}
+
 static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx)
 {
 	char name[64];
@@ -47,6 +81,21 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
 	if ((ac97->scaps & AC97_SCAP_AUDIO) == 0)
 		goto __modem;
 
+	if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) {
+		val = snd_ac97_read(ac97, AC97_INT_PAGING);
+		snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+				     AC97_PAGE_MASK, AC97_PAGE_1);
+		tmp = snd_ac97_read(ac97, AC97_CODEC_CLASS_REV);
+		snd_iprintf(buffer, "Revision         : 0x%02x\n", tmp & 0xff);
+		snd_iprintf(buffer, "Compat. Class    : 0x%02x\n", (tmp >> 8) & 0x1f);
+		snd_iprintf(buffer, "Subsys. Vendor ID: 0x%04x\n",
+			    snd_ac97_read(ac97, AC97_PCI_SVID));
+		snd_iprintf(buffer, "Subsys. ID       : 0x%04x\n\n",
+			    snd_ac97_read(ac97, AC97_PCI_SID));
+		snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+				     AC97_PAGE_MASK, val & AC97_PAGE_MASK);
+	}
+
 	// val = snd_ac97_read(ac97, AC97_RESET);
 	val = ac97->caps;
 	snd_iprintf(buffer, "Capabilities     :%s%s%s%s%s%s\n",
@@ -185,6 +234,14 @@ static void snd_ac97_proc_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, in
 			}
 		}
 	}
+	if ((ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_23) {
+		val = snd_ac97_read(ac97, AC97_INT_PAGING);
+		snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+				     AC97_PAGE_MASK, AC97_PAGE_1);
+		snd_ac97_proc_read_functions(ac97, buffer);
+		snd_ac97_update_bits(ac97, AC97_INT_PAGING,
+				     AC97_PAGE_MASK, val & AC97_PAGE_MASK);
+	}
 
 
       __modem:
@@ -264,6 +321,23 @@ static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
 	}
 }
 
+#ifdef CONFIG_SND_DEBUG
+/* direct register write for debugging */
+static void snd_ac97_proc_regs_write(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
+{
+	ac97_t *ac97 = snd_magic_cast(ac97_t, entry->private_data, return);
+	char line[64];
+	unsigned int reg, val;
+	while (!snd_info_get_line(buffer, line, sizeof(line))) {
+		if (sscanf(line, "%x %x", &reg, &val) != 2)
+			continue;
+		/* register must be odd */
+		if (reg < 0x80 && (reg & 1) == 0 && val <= 0xffff)
+			snd_ac97_write_cache(ac97, reg, val);
+	}
+}
+#endif
+
 static void snd_ac97_proc_regs_read_main(ac97_t *ac97, snd_info_buffer_t * buffer, int subidx)
 {
 	int reg, val;
@@ -319,6 +393,11 @@ void snd_ac97_proc_init(ac97_t * ac97)
 	sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num);
 	if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
 		snd_info_set_text_ops(entry, ac97, 1024, snd_ac97_proc_regs_read);
+#ifdef CONFIG_SND_DEBUG
+		entry->mode |= S_IWUSR;
+		entry->c.text.write_size = 1024;
+		entry->c.text.write = snd_ac97_proc_regs_write;
+#endif
 		if (snd_info_register(entry) < 0) {
 			snd_info_free_entry(entry);
 			entry = NULL;
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index d149409f2..670b10680 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -25,8 +25,6 @@
  *
  */
 
-#define __SNDRV_OSS_COMPAT__
-
 #include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/delay.h>
@@ -34,12 +32,12 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
 #include <sound/ac97_codec.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Matt Wu <Matt_Wu@acersoftech.com.cn>");
@@ -53,20 +51,21 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32};
 static int spdif[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ALI M5451 PCI Audio.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ALI 5451 PCI Audio.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(pcm_channels, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(pcm_channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_channels, "PCM Channels");
 MODULE_PARM_SYNTAX(pcm_channels, SNDRV_ENABLED ",default:32,allows:{{1,32}}");
-MODULE_PARM(spdif, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(spdif, bool, boot_devs, 0444);
 MODULE_PARM_DESC(spdif, "Support SPDIF I/O");
 MODULE_PARM_SYNTAX(spdif, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -1906,14 +1905,18 @@ static int __devinit snd_ali_mixer(ali_t * codec)
 }
 
 #ifdef CONFIG_PM
-static void ali_suspend(ali_t *chip)
+static int ali_suspend(snd_card_t *card, unsigned int state)
 {
+	ali_t *chip = snd_magic_cast(ali_t, card->pm_private_data, return -EINVAL);
 	ali_image_t *im;
 	int i, j;
 
 	im = chip->image;
 	if (! im)
-		return;
+		return 0;
+
+	snd_pcm_suspend_all(chip->pcm);
+	snd_ac97_suspend(chip->ac97);
 
 	spin_lock_irq(&chip->reg_lock);
 	
@@ -1940,16 +1943,18 @@ static void ali_suspend(ali_t *chip)
 	outl(0xffffffff, ALI_REG(chip, ALI_STOP));
 
 	spin_unlock_irq(&chip->reg_lock);
+	return 0;
 }
 
-static void ali_resume(ali_t *chip)
+static int ali_resume(snd_card_t *card, unsigned int state)
 {
+	ali_t *chip = snd_magic_cast(ali_t, card->pm_private_data, return -EINVAL);
 	ali_image_t *im;
 	int i, j;
 
 	im = chip->image;
 	if (! im)
-		return;
+		return 0;
 
 	pci_enable_device(chip->pci);
 
@@ -1967,27 +1972,15 @@ static void ali_resume(ali_t *chip)
 		outl(im->regs[i], ALI_REG(chip, i*4));
 	}
 	
-	snd_ac97_resume(chip->ac97);
-	
 	// start HW channel
 	outl(im->regs[ALI_START >> 2], ALI_REG(chip, ALI_START));
 	// restore IRQ enable bits
 	outl(im->regs[ALI_MISCINT >> 2], ALI_REG(chip, ALI_MISCINT));
 	
 	spin_unlock_irq(&chip->reg_lock);
-	return;
-}
 
-static int snd_ali_suspend(struct pci_dev *dev, u32 state)
-{
-	ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return -ENXIO);
-	ali_suspend(chip);
-	return 0;
-}
-static int snd_ali_resume(struct pci_dev *dev)
-{
-	ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(dev), return -ENXIO);
-	ali_resume(chip);
+	snd_ac97_resume(chip->ac97);
+	
 	return 0;
 }
 #endif /* CONFIG_PM */
@@ -2203,7 +2196,9 @@ static int __devinit snd_ali_create(snd_card_t * card,
 #ifdef CONFIG_PM
 	codec->image = kmalloc(sizeof(*codec->image), GFP_KERNEL);
 	if (! codec->image)
-		snd_printk("can't allocate apm buffer\n");
+		snd_printk(KERN_WARNING "can't allocate apm buffer\n");
+	else
+		snd_card_set_pm_callback(card, ali_suspend, ali_resume, codec);
 #endif
 
 	snd_ali_enable_address_interrupt(codec);
@@ -2263,16 +2258,14 @@ static int __devinit snd_ali_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, codec);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_ali_remove(struct pci_dev *pci)
 {
-	ali_t *chip = snd_magic_cast(ali_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -2281,23 +2274,12 @@ static struct pci_driver driver = {
 	.id_table = snd_ali_ids,
 	.probe = snd_ali_probe,
 	.remove = __devexit_p(snd_ali_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_ali_suspend,
-	.resume = snd_ali_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };                                
 
 static int __init alsa_card_ali_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ALi pci audio not found or device busy.\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_ali_exit(void)
@@ -2307,25 +2289,3 @@ static void __exit alsa_card_ali_exit(void)
 
 module_init(alsa_card_ali_init)
 module_exit(alsa_card_ali_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ali5451=enable,index,id,pcm_channels */
-
-static int __init alsa_card_ali_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_channels[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-ali5451=", alsa_card_ali_setup);
-
-#endif /* ifndef */
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 896636b1f..73b1d3a08 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -64,13 +64,13 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
 #include <sound/sb.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Bart Hartgers <bart@etpmod.phys.tue.nl>");
@@ -89,18 +89,19 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card *
 #ifdef SUPPORT_JOYSTICK
 static int joystick_port[SNDRV_CARDS];
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ALS4000 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ALS4000 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ALS4000 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_INDEX_DESC);
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_port, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_port, "Joystick port address for ALS4000 soundcard. (0 = disabled)");
 MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED);
 #endif
@@ -755,15 +756,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_als4000_init(void)
 {
-	int err;
-	
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "no ALS4000 based soundcards found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_als4000_exit(void)
@@ -773,28 +766,3 @@ static void __exit alsa_card_als4000_exit(void)
 
 module_init(alsa_card_als4000_init)
 module_exit(alsa_card_als4000_exit)
-
-#ifndef MODULE
-
-/* format is: snd-als4000=enable,index,id,joystick_port */
-
-static int __init alsa_card_als4000_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2
-#ifdef SUPPORT_JOYSTICK
-	       && get_option(&str,&joystick_port[nr_dev]) == 2
-#endif
-	       );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-als4000=", alsa_card_als4000_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 677bfbaae..8869e7a68 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -26,39 +26,40 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/info.h>
 #include <sound/ac97_codec.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
 MODULE_DESCRIPTION("ATI IXP AC97 controller");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
-MODULE_DEVICES("{{ATI,IXP150/200/250}}");
+MODULE_DEVICES("{{ATI,IXP150/200/250/300}}");
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
 static int spdif_aclink[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ATI IXP controller.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ATI IXP controller.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ac97_clock, int, boot_devs, 0444);
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
 MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:48000");
-MODULE_PARM(spdif_aclink, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(spdif_aclink, bool, boot_devs, 0444);
 MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");
 MODULE_PARM_SYNTAX(spdif_aclink, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
 
@@ -223,7 +224,12 @@ typedef struct atiixp_dma_desc {
 /*
  * stream enum
  */
-enum { ATI_DMA_PLAYBACK, ATI_DMA_CAPTURE, ATI_DMA_SPDIF };
+enum { ATI_DMA_PLAYBACK, ATI_DMA_CAPTURE, ATI_DMA_SPDIF, NUM_ATI_DMAS }; /* DMAs */
+enum { ATI_PCM_OUT, ATI_PCM_IN, ATI_PCM_SPDIF, NUM_ATI_PCMS }; /* AC97 pcm slots */
+enum { ATI_PCMDEV_ANALOG, ATI_PCMDEV_DIGITAL, NUM_ATI_PCMDEVS }; /* pcm devices */
+
+#define NUM_ATI_CODECS	3
+
 
 /*
  * constants and callbacks for each DMA type
@@ -231,6 +237,7 @@ enum { ATI_DMA_PLAYBACK, ATI_DMA_CAPTURE, ATI_DMA_SPDIF };
 struct snd_atiixp_dma_ops {
 	int type;			/* ATI_DMA_XXX */
 	unsigned int llp_offset;	/* LINKPTR offset */
+	unsigned int dt_cur;		/* DT_CUR offset */
 	void (*enable_dma)(atiixp_t *chip, int on);	/* called from open callback */
 	void (*enable_transfer)(atiixp_t *chip, int on); /* called from trigger (START/STOP) */
 	void (*flush_dma)(atiixp_t *chip);		/* called from trigger (STOP only) */
@@ -246,9 +253,10 @@ struct snd_atiixp_dma {
 	snd_pcm_substream_t *substream;	/* assigned PCM substream */
 	unsigned int buf_addr, buf_bytes;	/* DMA buffer address, bytes */
 	unsigned int period_bytes, periods;
+	int opened;
 	int running;
-	struct ac97_pcm *pcm;
 	int pcm_open_flag;
+	int ac97_pcm_type;	/* index # of ac97_pcm to access, -1 = not used */
 };
 
 /*
@@ -264,25 +272,34 @@ struct snd_atiixp {
 	int irq;
 	
 	ac97_bus_t *ac97_bus;
-	ac97_t *ac97[3];		/* IXP can have up to 3 codecs */
+	ac97_t *ac97[NUM_ATI_CODECS];
 
 	spinlock_t reg_lock;
 	spinlock_t ac97_lock;
 
-	atiixp_dma_t dmas[3];		/* playback, capture, spdif */
+	atiixp_dma_t dmas[NUM_ATI_DMAS];
+	struct ac97_pcm *pcms[NUM_ATI_PCMS];
+	snd_pcm_t *pcmdevs[NUM_ATI_PCMDEVS];
 
 	int max_channels;		/* max. channels for PCM out */
 
 	unsigned int codec_not_ready_bits;	/* for codec detection */
 
 	int spdif_over_aclink;		/* passed from the module option */
+	struct semaphore open_mutex;	/* playback open mutex */
+
+#ifdef CONFIG_PM
+	u32 pci_state[16];
+#endif
 };
 
 
 /*
  */
 static struct pci_device_id snd_atiixp_ids[] = {
-	{ 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
+	{ 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
+	{ 0, }
 };
 
 MODULE_DEVICE_TABLE(pci, snd_atiixp_ids);
@@ -393,7 +410,7 @@ static int atiixp_build_dma_packets(atiixp_t *chip, atiixp_dma_t *dma,
 		addr += period_bytes;
 	}
 
-	writel(cpu_to_le32((u32)dma->desc_buf.addr | ATI_REG_LINKPTR_EN),
+	writel((u32)dma->desc_buf.addr | ATI_REG_LINKPTR_EN,
 	       chip->remap_addr + dma->ops->llp_offset);
 
 	dma->period_bytes = period_bytes;
@@ -452,7 +469,9 @@ static unsigned short snd_atiixp_codec_read(atiixp_t *chip, unsigned short codec
 			return data >> ATI_REG_PHYS_IN_DATA_SHIFT;
 		udelay(1);
 	} while (--timeout);
-	snd_printk(KERN_WARNING "atiixp: codec read timeout\n");
+	/* time out may happen during reset */
+	if (reg < 0x7c)
+		snd_printk(KERN_WARNING "atiixp: codec read timeout (reg %x)\n", reg);
 	return 0xffff;
 }
 
@@ -527,13 +546,11 @@ static int snd_atiixp_aclink_reset(atiixp_t *chip)
 	return 0;
 }
 
-#if 0 /* for P/M */
+#ifdef CONFIG_PM
 static int snd_atiixp_aclink_down(atiixp_t *chip)
 {
-	unsigned long flags;
-
-	if (atiixp_read(chip, MODEM_MIRROR) & ATI_REG_MODEM_MIRROR_RUNNING)
-		return -EBUSY;
+	// if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */
+	//	return -EBUSY;
 	atiixp_update(chip, CMD,
 		     ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET,
 		     ATI_REG_CMD_POWERDOWN);
@@ -585,12 +602,16 @@ static int snd_atiixp_chip_start(atiixp_t *chip)
 {
 	unsigned int reg;
 
-	/* enable burst mode */
+	/* set up spdif, enable burst mode */
 	reg = atiixp_read(chip, CMD);
 	reg |= 0x02 << ATI_REG_CMD_SPDF_THRESHOLD_SHIFT;
 	reg |= ATI_REG_CMD_BURST_EN;
 	atiixp_write(chip, CMD, reg);
 
+	reg = atiixp_read(chip, SPDF_CMD);
+	reg &= ~(ATI_REG_SPDF_CMD_LFSR|ATI_REG_SPDF_CMD_SINGLE_CH);
+	atiixp_write(chip, SPDF_CMD, reg);
+
 	/* clear all interrupt source */
 	atiixp_write(chip, ISR, 0xffffffff);
 	/* enable irqs */
@@ -635,7 +656,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(snd_pcm_substream_t *substream)
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
-	curptr = readl(chip->remap_addr + dma->ops->llp_offset + 12); /* XXX_DMA_DT_CUR */
+	curptr = readl(chip->remap_addr + dma->ops->dt_cur);
 	if (curptr < dma->buf_addr) {
 		snd_printdd("curptr = %x, base = %x\n", curptr, dma->buf_addr);
 		curptr = 0;
@@ -657,7 +678,7 @@ static void snd_atiixp_xrun_dma(atiixp_t *chip, atiixp_dma_t *dma)
 {
 	if (! dma->substream || ! dma->running)
 		return;
-	snd_printd(KERN_DEBUG "atiixp: XRUN detected (DMA %d)\n", dma->ops->type);
+	snd_printdd("atiixp: XRUN detected (DMA %d)\n", dma->ops->type);
 	snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
 }
 
@@ -800,15 +821,10 @@ static void atiixp_spdif_enable_transfer(atiixp_t *chip, int on)
 {
 	unsigned int data;
 	data = atiixp_read(chip, CMD);
-	if (on) {
+	if (on)
 		data |= ATI_REG_CMD_SPDF_OUT_EN;
-		if (chip->spdif_over_aclink)
-			data |= ATI_REG_CMD_SEND_EN;
-	}  else {
+	else
 		data &= ~ATI_REG_CMD_SPDF_OUT_EN;
-		if (chip->spdif_over_aclink)
-			data &= ~ATI_REG_CMD_SEND_EN;
-	}
 	atiixp_write(chip, CMD, data);
 }
 
@@ -835,25 +851,25 @@ static void atiixp_spdif_flush_dma(atiixp_t *chip)
 static int snd_atiixp_spdif_prepare(snd_pcm_substream_t *substream)
 {
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
-	unsigned int data;
 
 	spin_lock(&chip->reg_lock);
 	if (chip->spdif_over_aclink) {
+		unsigned int data;
 		/* enable slots 10/11 */
 		atiixp_update(chip, CMD, ATI_REG_CMD_SPDF_CONFIG_MASK,
 			      ATI_REG_CMD_SPDF_CONFIG_01);
-		data = atiixp_read(chip, OUT_DMA_SLOT);
+		data = atiixp_read(chip, OUT_DMA_SLOT) & ~ATI_REG_OUT_DMA_SLOT_MASK;
 		data |= ATI_REG_OUT_DMA_SLOT_BIT(10) |
 			ATI_REG_OUT_DMA_SLOT_BIT(11);
 		data |= 0x04 << ATI_REG_OUT_DMA_THRESHOLD_SHIFT;
 		atiixp_write(chip, OUT_DMA_SLOT, data);
+		atiixp_update(chip, CMD, ATI_REG_CMD_INTERLEAVE_OUT,
+			      substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ?
+			      ATI_REG_CMD_INTERLEAVE_OUT : 0);
 	} else {
 		atiixp_update(chip, CMD, ATI_REG_CMD_SPDF_CONFIG_MASK, 0);
+		atiixp_update(chip, CMD, ATI_REG_CMD_INTERLEAVE_SPDF, 0);
 	}
-
-	atiixp_update(chip, CMD, ATI_REG_CMD_INTERLEAVE_SPDF,
-		      substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE ?
-		      ATI_REG_CMD_INTERLEAVE_SPDF : 0);
 	spin_unlock(&chip->reg_lock);
 	return 0;
 }
@@ -938,17 +954,18 @@ static int snd_atiixp_pcm_hw_params(snd_pcm_substream_t *substream,
 	if (err < 0)
 		return err;
 
-	if (dma->pcm) {
+	if (dma->ac97_pcm_type >= 0) {
+		struct ac97_pcm *pcm = chip->pcms[dma->ac97_pcm_type];
 		/* PCM is bound to AC97 codec(s)
 		 * set up the AC97 codecs
 		 */
 		if (dma->pcm_open_flag) {
-			snd_ac97_pcm_close(dma->pcm);
+			snd_ac97_pcm_close(pcm);
 			dma->pcm_open_flag = 0;
 		}
-		err = snd_ac97_pcm_open(dma->pcm, params_rate(hw_params),
+		err = snd_ac97_pcm_open(pcm, params_rate(hw_params),
 					params_channels(hw_params),
-					dma->pcm->r[0].slots);
+					pcm->r[0].slots);
 		if (err >= 0)
 			dma->pcm_open_flag = 1;
 	}
@@ -962,7 +979,8 @@ static int snd_atiixp_pcm_hw_free(snd_pcm_substream_t * substream)
 	atiixp_dma_t *dma = (atiixp_dma_t *)substream->runtime->private_data;
 
 	if (dma->pcm_open_flag) {
-		snd_ac97_pcm_close(dma->pcm);
+		struct ac97_pcm *pcm = chip->pcms[dma->ac97_pcm_type];
+		snd_ac97_pcm_close(pcm);
 		dma->pcm_open_flag = 0;
 	}
 	atiixp_clear_dma_packets(chip, dma, substream);
@@ -992,7 +1010,7 @@ static snd_pcm_hardware_t snd_atiixp_pcm_hw =
 	.periods_max =		ATI_MAX_DESCRIPTORS,
 };
 
-static int snd_atiixp_pcm_open(snd_pcm_substream_t *substream, atiixp_dma_t *dma)
+static int snd_atiixp_pcm_open(snd_pcm_substream_t *substream, atiixp_dma_t *dma, int pcm_type)
 {
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
@@ -1001,15 +1019,17 @@ static int snd_atiixp_pcm_open(snd_pcm_substream_t *substream, atiixp_dma_t *dma
 
 	snd_assert(dma->ops && dma->ops->enable_dma, return -EINVAL);
 
+	if (dma->opened)
+		return -EBUSY;
 	dma->substream = substream;
 	runtime->hw = snd_atiixp_pcm_hw;
-	if (dma->pcm) {
-		runtime->hw.rates = dma->pcm->rates;
+	dma->ac97_pcm_type = pcm_type;
+	if (pcm_type >= 0) {
+		runtime->hw.rates = chip->pcms[pcm_type]->rates;
 		snd_pcm_limit_hw_rates(runtime);
 	} else {
-		/* SPDIF */
-		runtime->hw.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_32000;
-		runtime->hw.rate_min = 32000;
+		/* direct SPDIF */
+		runtime->hw.formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE;
 	}
 	if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
 		return err;
@@ -1019,6 +1039,7 @@ static int snd_atiixp_pcm_open(snd_pcm_substream_t *substream, atiixp_dma_t *dma
 	spin_lock_irqsave(&chip->reg_lock, flags);
 	dma->ops->enable_dma(chip, 1);
 	spin_unlock_irqrestore(&chip->reg_lock, flags);
+	dma->opened = 1;
 
 	return 0;
 }
@@ -1032,6 +1053,7 @@ static int snd_atiixp_pcm_close(snd_pcm_substream_t *substream, atiixp_dma_t *dm
 	dma->ops->enable_dma(chip, 0);
 	spin_unlock_irq(&chip->reg_lock);
 	dma->substream = NULL;
+	dma->opened = 0;
 	return 0;
 }
 
@@ -1042,26 +1064,33 @@ static int snd_atiixp_playback_open(snd_pcm_substream_t *substream)
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
 	int err;
 
-	err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
+	down(&chip->open_mutex);
+	err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 0);
+	up(&chip->open_mutex);
+	if (err < 0)
+		return err;
 	substream->runtime->hw.channels_max = chip->max_channels;
 	if (chip->max_channels > 2)
 		/* channels must be even */
 		snd_pcm_hw_constraint_step(substream->runtime, 0,
 					   SNDRV_PCM_HW_PARAM_CHANNELS, 2);
-
 	return 0;
 }
 
 static int snd_atiixp_playback_close(snd_pcm_substream_t *substream)
 {
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
-	return snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
+	int err;
+	down(&chip->open_mutex);
+	err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
+	up(&chip->open_mutex);
+	return err;
 }
 
 static int snd_atiixp_capture_open(snd_pcm_substream_t *substream)
 {
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
-	return snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_CAPTURE]);
+	return snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_CAPTURE], 1);
 }
 
 static int snd_atiixp_capture_close(snd_pcm_substream_t *substream)
@@ -1073,13 +1102,27 @@ static int snd_atiixp_capture_close(snd_pcm_substream_t *substream)
 static int snd_atiixp_spdif_open(snd_pcm_substream_t *substream)
 {
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
-	return snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_SPDIF]);
+	int err;
+	down(&chip->open_mutex);
+	if (chip->spdif_over_aclink) /* share DMA_PLAYBACK */
+		err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 2);
+	else
+		err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_SPDIF], -1);
+	up(&chip->open_mutex);
+	return err;
 }
 
 static int snd_atiixp_spdif_close(snd_pcm_substream_t *substream)
 {
 	atiixp_t *chip = snd_pcm_substream_chip(substream);
-	return snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_SPDIF]);
+	int err;
+	down(&chip->open_mutex);
+	if (chip->spdif_over_aclink)
+		err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
+	else
+		err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_SPDIF]);
+	up(&chip->open_mutex);
+	return err;
 }
 
 /* AC97 playback */
@@ -1157,6 +1200,7 @@ static struct ac97_pcm atiixp_pcm_defs[] __devinitdata = {
 static atiixp_dma_ops_t snd_atiixp_playback_dma_ops = {
 	.type = ATI_DMA_PLAYBACK,
 	.llp_offset = ATI_REG_OUT_DMA_LINKPTR,
+	.dt_cur = ATI_REG_OUT_DMA_DT_CUR,
 	.enable_dma = atiixp_out_enable_dma,
 	.enable_transfer = atiixp_out_enable_transfer,
 	.flush_dma = atiixp_out_flush_dma,
@@ -1165,6 +1209,7 @@ static atiixp_dma_ops_t snd_atiixp_playback_dma_ops = {
 static atiixp_dma_ops_t snd_atiixp_capture_dma_ops = {
 	.type = ATI_DMA_CAPTURE,
 	.llp_offset = ATI_REG_IN_DMA_LINKPTR,
+	.dt_cur = ATI_REG_IN_DMA_DT_CUR,
 	.enable_dma = atiixp_in_enable_dma,
 	.enable_transfer = atiixp_in_enable_transfer,
 	.flush_dma = atiixp_in_flush_dma,
@@ -1173,6 +1218,7 @@ static atiixp_dma_ops_t snd_atiixp_capture_dma_ops = {
 static atiixp_dma_ops_t snd_atiixp_spdif_dma_ops = {
 	.type = ATI_DMA_SPDIF,
 	.llp_offset = ATI_REG_SPDF_DMA_LINKPTR,
+	.dt_cur = ATI_REG_SPDF_DMA_DT_CUR,
 	.enable_dma = atiixp_spdif_enable_dma,
 	.enable_transfer = atiixp_spdif_enable_transfer,
 	.flush_dma = atiixp_spdif_flush_dma,
@@ -1188,7 +1234,8 @@ static int __devinit snd_atiixp_pcm_new(atiixp_t *chip)
 	/* initialize constants */
 	chip->dmas[ATI_DMA_PLAYBACK].ops = &snd_atiixp_playback_dma_ops;
 	chip->dmas[ATI_DMA_CAPTURE].ops = &snd_atiixp_capture_dma_ops;
-	chip->dmas[ATI_DMA_SPDIF].ops = &snd_atiixp_spdif_dma_ops;
+	if (! chip->spdif_over_aclink)
+		chip->dmas[ATI_DMA_SPDIF].ops = &snd_atiixp_spdif_dma_ops;
 
 	/* assign AC97 pcm */
 	if (chip->spdif_over_aclink)
@@ -1198,49 +1245,55 @@ static int __devinit snd_atiixp_pcm_new(atiixp_t *chip)
 	err = snd_ac97_pcm_assign(pbus, num_pcms, atiixp_pcm_defs);
 	if (err < 0)
 		return err;
+	for (i = 0; i < num_pcms; i++)
+		chip->pcms[i] = &pbus->pcms[i];
 
 	chip->max_channels = 2;
-	if (pbus->pcms[0].r[0].slots & (1 << AC97_SLOT_PCM_SLEFT)) {
-		if (pbus->pcms[0].r[0].slots & (1 << AC97_SLOT_LFE))
+	if (pbus->pcms[ATI_PCM_OUT].r[0].slots & (1 << AC97_SLOT_PCM_SLEFT)) {
+		if (pbus->pcms[ATI_PCM_OUT].r[0].slots & (1 << AC97_SLOT_LFE))
 			chip->max_channels = 6;
 		else
 			chip->max_channels = 4;
 	}
 
-	chip->dmas[ATI_DMA_PLAYBACK].pcm = &pbus->pcms[0];
-	chip->dmas[ATI_DMA_CAPTURE].pcm = &pbus->pcms[1];
-	if (chip->spdif_over_aclink)
-		chip->dmas[ATI_DMA_SPDIF].pcm = &pbus->pcms[2];
-
 	/* PCM #0: analog I/O */
-	err = snd_pcm_new(chip->card, "ATI IXP AC97", 0, 1, 1, &pcm);
+	err = snd_pcm_new(chip->card, "ATI IXP AC97", ATI_PCMDEV_ANALOG, 1, 1, &pcm);
 	if (err < 0)
 		return err;
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_atiixp_playback_ops);
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_atiixp_capture_ops);
 	pcm->private_data = chip;
 	strcpy(pcm->name, "ATI IXP AC97");
+	chip->pcmdevs[ATI_PCMDEV_ANALOG] = pcm;
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 					      snd_dma_pci_data(chip->pci), 64*1024, 128*1024);
 
 	/* no SPDIF support on codec? */
-	if (chip->dmas[ATI_DMA_SPDIF].pcm && ! chip->dmas[ATI_DMA_SPDIF].pcm->rates)
+	if (chip->pcms[ATI_PCM_SPDIF] && ! chip->pcms[ATI_PCM_SPDIF]->rates)
 		return 0;
 		
+	/* FIXME: non-48k sample rate doesn't work on my test machine with AD1888 */
+	if (chip->pcms[ATI_PCM_SPDIF])
+		chip->pcms[ATI_PCM_SPDIF]->rates = SNDRV_PCM_RATE_48000;
+
 	/* PCM #1: spdif playback */
-	err = snd_pcm_new(chip->card, "ATI IXP IEC958", 1, 1, 0, &pcm);
+	err = snd_pcm_new(chip->card, "ATI IXP IEC958", ATI_PCMDEV_DIGITAL, 1, 0, &pcm);
 	if (err < 0)
 		return err;
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_atiixp_spdif_ops);
 	pcm->private_data = chip;
-	strcpy(pcm->name, "ATI IXP IEC958");
+	if (chip->spdif_over_aclink)
+		strcpy(pcm->name, "ATI IXP IEC958 (AC97)");
+	else
+		strcpy(pcm->name, "ATI IXP IEC958 (Direct)");
+	chip->pcmdevs[ATI_PCMDEV_DIGITAL] = pcm;
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 					      snd_dma_pci_data(chip->pci), 64*1024, 128*1024);
 
 	/* pre-select AC97 SPDIF slots 10/11 */
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < NUM_ATI_CODECS; i++) {
 		if (chip->ac97[i])
 			snd_ac97_update_bits(chip->ac97[i], AC97_EXTENDED_STATUS, 0x03 << 4, 0x03 << 4);
 	}
@@ -1272,10 +1325,12 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id, struct pt_regs *r
 		snd_atiixp_xrun_dma(chip,  &chip->dmas[ATI_DMA_CAPTURE]);
 	else if (status & ATI_REG_ISR_IN_STATUS)
 		snd_atiixp_update_dma(chip, &chip->dmas[ATI_DMA_CAPTURE]);
-	if (status & ATI_REG_ISR_SPDF_XRUN)
-		snd_atiixp_xrun_dma(chip,  &chip->dmas[ATI_DMA_SPDIF]);
-	else if (status & ATI_REG_ISR_SPDF_STATUS)
-		snd_atiixp_update_dma(chip, &chip->dmas[ATI_DMA_SPDIF]);
+	if (! chip->spdif_over_aclink) {
+		if (status & ATI_REG_ISR_SPDF_XRUN)
+			snd_atiixp_xrun_dma(chip,  &chip->dmas[ATI_DMA_SPDIF]);
+		else if (status & ATI_REG_ISR_SPDF_STATUS)
+			snd_atiixp_update_dma(chip, &chip->dmas[ATI_DMA_SPDIF]);
+	}
 
 	/* for codec detection */
 	if (status & CODEC_CHECK_BITS) {
@@ -1303,7 +1358,8 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
 	ac97_bus_t bus, *pbus;
 	ac97_t ac97;
 	int i, err;
-	static unsigned int codec_skip[3] = {
+	int codec_count;
+	static unsigned int codec_skip[NUM_ATI_CODECS] = {
 		ATI_REG_ISR_CODEC0_NOT_READY,
 		ATI_REG_ISR_CODEC1_NOT_READY,
 		ATI_REG_ISR_CODEC2_NOT_READY,
@@ -1321,15 +1377,34 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
 		return err;
 	chip->ac97_bus = pbus;
 
-	for (i = 0; i < 3; i++) {
+	codec_count = 0;
+	for (i = 0; i < NUM_ATI_CODECS; i++) {
 		if (chip->codec_not_ready_bits & codec_skip[i])
 			continue;
 		memset(&ac97, 0, sizeof(ac97));
 		ac97.private_data = chip;
 		ac97.pci = chip->pci;
 		ac97.num = i;
-		if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0)
-			return err;
+		ac97.scaps = AC97_SCAP_SKIP_MODEM;
+		if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {
+			if (chip->codec_not_ready_bits)
+				/* codec(s) was detected but not available.
+				 * return the error
+				 */
+				return err;
+			else {
+				/* codec(s) was NOT detected, so just ignore here */
+				chip->ac97[i] = NULL; /* to be sure */
+				snd_printd("atiixp: codec %d not found\n", i);
+				continue;
+			}
+		}
+		codec_count++;
+	}
+
+	if (! codec_count) {
+		snd_printk(KERN_ERR "atiixp: no codec available\n");
+		return -ENODEV;
 	}
 
 	/* snd_ac97_tune_hardware(chip->ac97, ac97_quirks); */
@@ -1338,6 +1413,53 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
 }
 
 
+#ifdef CONFIG_PM
+/*
+ * power management
+ */
+static int snd_atiixp_suspend(snd_card_t *card, unsigned int state)
+{
+	atiixp_t *chip = snd_magic_cast(atiixp_t, card->pm_private_data, return -EINVAL);
+	int i;
+
+	for (i = 0; i < NUM_ATI_PCMDEVS; i++)
+		if (chip->pcmdevs[i])
+			snd_pcm_suspend_all(chip->pcmdevs[i]);
+	for (i = 0; i < NUM_ATI_CODECS; i++)
+		if (chip->ac97[i])
+			snd_ac97_suspend(chip->ac97[i]);
+	snd_atiixp_aclink_down(chip);
+	snd_atiixp_chip_stop(chip);
+
+	pci_save_state(chip->pci, chip->pci_state);
+	pci_set_power_state(chip->pci, 3);
+	pci_disable_device(chip->pci);
+	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
+}
+
+static int snd_atiixp_resume(snd_card_t *card, unsigned int state)
+{
+	atiixp_t *chip = snd_magic_cast(atiixp_t, card->pm_private_data, return -EINVAL);
+	int i;
+
+	pci_enable_device(chip->pci);
+	pci_restore_state(chip->pci, chip->pci_state);
+	pci_set_power_state(chip->pci, 0);
+
+	snd_atiixp_aclink_reset(chip);
+	snd_atiixp_chip_start(chip);
+
+	for (i = 0; i < NUM_ATI_CODECS; i++)
+		if (chip->ac97[i])
+			snd_ac97_resume(chip->ac97[i]);
+
+	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+	return 0;
+}
+#endif /* CONFIG_PM */
+
+
 /*
  * proc interface for register dump
  */
@@ -1412,24 +1534,25 @@ static int __devinit snd_atiixp_create(snd_card_t *card,
 
 	spin_lock_init(&chip->reg_lock);
 	spin_lock_init(&chip->ac97_lock);
+	init_MUTEX(&chip->open_mutex);
 	chip->card = card;
 	chip->pci = pci;
 	chip->irq = -1;
 	chip->addr = pci_resource_start(pci, 0);
 	if ((chip->res = request_mem_region(chip->addr, ATI_MEM_REGION, "ATI IXP AC97")) == NULL) {
-		snd_printk("unable to grab I/O memory 0x%lx\n", chip->addr);
+		snd_printk(KERN_ERR "unable to grab I/O memory 0x%lx\n", chip->addr);
 		snd_atiixp_free(chip);
 		return -EBUSY;
 	}
 	chip->remap_addr = (unsigned long) ioremap_nocache(chip->addr, ATI_MEM_REGION);
 	if (chip->remap_addr == 0) {
-		snd_printk("AC'97 space ioremap problem\n");
+		snd_printk(KERN_ERR "AC'97 space ioremap problem\n");
 		snd_atiixp_free(chip);
 		return -EIO;
 	}
 
 	if (request_irq(pci->irq, snd_atiixp_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) {
-		snd_printk("unable to grab IRQ %d\n", pci->irq);
+		snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
 		snd_atiixp_free(chip);
 		return -EBUSY;
 	}
@@ -1471,7 +1594,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
 
 	pci_read_config_byte(pci, PCI_REVISION_ID, &revision);
 
-	strcpy(card->driver, "ATIIXP");
+	strcpy(card->driver, spdif_aclink[dev] ? "ATIIXP" : "ATIIXP-SPDMA");
 	strcpy(card->shortname, "ATI IXP");
 	if ((err = snd_atiixp_create(card, pci, &chip)) < 0)
 		goto __error;
@@ -1494,10 +1617,12 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
 	sprintf(card->longname, "%s rev %x at 0x%lx, irq %i",
 		card->shortname, revision, chip->addr, chip->irq);
 
+	snd_card_set_pm_callback(card, snd_atiixp_suspend, snd_atiixp_resume, chip);
+
 	if ((err = snd_card_register(card)) < 0)
 		goto __error;
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 
@@ -1508,9 +1633,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
 
 static void __devexit snd_atiixp_remove(struct pci_dev *pci)
 {
-	atiixp_t *chip = snd_magic_cast(atiixp_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -1519,21 +1642,13 @@ static struct pci_driver driver = {
 	.id_table = snd_atiixp_ids,
 	.probe = snd_atiixp_probe,
 	.remove = __devexit_p(snd_atiixp_remove),
+	SND_PCI_PM_CALLBACKS
 };
 
 
 static int __init alsa_card_atiixp_init(void)
 {
-	int err;
-
-        if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ATI IXP AC97 controller not found or device busy\n");
-#endif
-                return err;
-        }
-
-        return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_atiixp_exit(void)
@@ -1543,27 +1658,3 @@ static void __exit alsa_card_atiixp_exit(void)
 
 module_init(alsa_card_atiixp_init)
 module_exit(alsa_card_atiixp_exit)
-
-#ifndef MODULE
-
-/* format is: snd-atiixp=enable,index,id,ac97_clock,spdif_aclink */
-
-static int __init alsa_card_atiixp_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&ac97_clock[nr_dev]) == 2 &&
-	       get_option(&str,&spdif_aclink[nr_dev]) == 2
-	       );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-atiixp=", alsa_card_atiixp_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/au88x0/au8810.h b/sound/pci/au88x0/au8810.h
index e75300845..3837d2ba5 100644
--- a/sound/pci/au88x0/au8810.h
+++ b/sound/pci/au88x0/au8810.h
@@ -7,7 +7,7 @@
 #define CARD_NAME "Aureal Advantage 3D Sound Processor"
 #define CARD_NAME_SHORT "au8810"
 
-#define NR_ADB		0x20
+#define NR_ADB		0x10
 #define NR_WT		0x00
 #define NR_SRC		0x10
 #define NR_A3D		0x10
@@ -51,13 +51,14 @@
 /* ADB */
 #define VORTEX_ADB_SR 0x28400	/* Samplerates enable/disable */
 #define VORTEX_ADB_RTBASE 0x28000
-#define VORTEX_ADB_RTBASE_SIZE (VORTEX_ADB_CHNBASE - VORTEX_ADB_RTBASE)
+#define VORTEX_ADB_RTBASE_COUNT 173
 #define VORTEX_ADB_CHNBASE 0x282b4
-#define VORTEX_ADB_CHNBASE_SIZE (ADB_MASK - VORTEX_ADB_RTBASE_SIZE)
+#define VORTEX_ADB_CHNBASE_COUNT 24
 #define 	ROUTE_MASK	0xffff
 #define		SOURCE_MASK	0xff00
 #define     ADB_MASK   0xff
 #define		ADB_SHIFT 0x8
+
 /* ADB address */
 #define		OFFSET_ADBDMA	0x00
 #define		OFFSET_SRCIN	0x40
@@ -69,10 +70,12 @@
 #define		OFFSET_SPORTIN	0x78	/* ch 0x13 */
 #define		OFFSET_SPORTOUT	0x90
 #define		OFFSET_SPDIFOUT	0x92	/* ch 0x14 check this! */
-#define		OFFSET_EQIN		0xa0
+#define		OFFSET_EQIN	0xa0
 #define		OFFSET_EQOUT	0x7e	/* 2 routes on ch 0x11 */
 #define		OFFSET_XTALKOUT	0x66	/* crosstalk canceller (source) */
 #define		OFFSET_XTALKIN	0x96	/* crosstalk canceller (sink) */
+#define		OFFSET_A3DIN	0x70	/* ADB sink. */
+#define		OFFSET_A3DOUT	0xA6	/* ADB source. 2 routes per slice = 8 */
 #define		OFFSET_EFXIN	0x80	/* ADB sink. */
 #define		OFFSET_EFXOUT	0x68	/* ADB source. */
 
@@ -89,8 +92,8 @@
 #define ADB_SPDIFOUT(x)	(x + OFFSET_SPDIFOUT)
 #define ADB_EQIN(x) (x + OFFSET_EQIN)
 #define ADB_EQOUT(x) (x + OFFSET_EQOUT)
-#define ADB_A3DOUT(x) (x + 0x50)	/* A3D blocks */
-#define ADB_A3DIN(x) (x + 0x70)
+#define ADB_A3DOUT(x) (x + OFFSET_A3DOUT)	/* 0x10 A3D blocks */
+#define ADB_A3DIN(x) (x + OFFSET_A3DIN)
 #define ADB_XTALKIN(x) (x + OFFSET_XTALKIN)
 #define ADB_XTALKOUT(x) (x + OFFSET_XTALKOUT)
 
@@ -120,20 +123,31 @@
 #define		VOL_MAX 0x7f	/* FIXME: Not confirmed! Just guessed. */
 
 /* SRC */
-#define VORTEX_SRCBLOCK_SR	0x26cc0
-#define VORTEX_SRC_CHNBASE	0x26c40
-#define VORTEX_SRC_RTBASE	0x26c00
-#define VORTEX_SRC_SOURCE	0x26cc4
-#define VORTEX_SRC_SOURCESIZE 0x26cc8
-#define VORTEX_SRC_CONVRATIO 0x26e40
-#define VORTEX_SRC_DRIFT0	0x26e80
-#define VORTEX_SRC_DRIFT1	0x26ec0
-#define VORTEX_SRC_DRIFT2	0x26f40
-#define VORTEX_SRC_U0		0x26e00
-#define VORTEX_SRC_U1		0x26f00
-#define VORTEX_SRC_U2		0x26f80
-#define VORTEX_SRC_DATA		0x26800	/* 0xc800 */
-#define VORTEX_SRC_DATA0	0x26000
+#define VORTEX_SRC_CHNBASE		0x26c40
+#define VORTEX_SRC_RTBASE		0x26c00
+#define VORTEX_SRCBLOCK_SR		0x26cc0
+#define VORTEX_SRC_SOURCE		0x26cc4
+#define VORTEX_SRC_SOURCESIZE	0x26cc8
+/* Params
+	0x26e00	: 1 U0
+	0x26e40	: 2 CR
+	0x26e80	: 3 U3
+	0x26ec0	: 4 DRIFT1
+	0x26f00 : 5 U1
+	0x26f40	: 6 DRIFT2
+	0x26f80	: 7 U2 : Target rate, direction
+*/
+
+#define VORTEX_SRC_CONVRATIO	0x26e40
+#define VORTEX_SRC_DRIFT0		0x26e80
+#define VORTEX_SRC_DRIFT1		0x26ec0
+#define VORTEX_SRC_DRIFT2		0x26f40
+#define VORTEX_SRC_U0			0x26e00
+#define		U0_SLOWLOCK		0x200
+#define VORTEX_SRC_U1			0x26f00
+#define VORTEX_SRC_U2			0x26f80
+#define VORTEX_SRC_DATA			0x26800	/* 0xc800 */
+#define VORTEX_SRC_DATA0		0x26000
 
 /* FIFO */
 #define VORTEX_FIFO_ADBCTRL 0x16100	/* Control bits. */
@@ -150,33 +164,37 @@
 //#define       FIFO_MASK       0x1f    /* at shift left 0xb */
 //#define               FIFO_SIZE       0x20
 #define 	FIFO_BITS	0x03880000
-#define VORTEX_FIFO_ADBDATA 0x14000
-#define VORTEX_FIFO_WTDATA 0x10000
+#define VORTEX_FIFO_ADBDATA	0x14000
+#define VORTEX_FIFO_WTDATA	0x10000
 
 /* CODEC */
-#define VORTEX_CODEC_CTRL 0x29184
-#define VORTEX_CODEC_EN 0x29190
+#define VORTEX_CODEC_CTRL	0x29184
+#define VORTEX_CODEC_EN		0x29190
 #define		EN_CODEC0	0x00000300
+#define 	EN_AC98		0x00000c00 /* Modem AC98 slots. */
 #define		EN_CODEC1	0x00003000
 #define		EN_CODEC	(EN_CODEC0 | EN_CODEC1)
 #define		EN_SPORT	0x00030000
 #define		EN_SPDIF	0x000c0000
-#define VORTEX_CODEC_CHN 0x29080
-#define VORTEX_CODEC_WRITE 0x00800000
-#define VORTEX_CODEC_ADDSHIFT 16
-#define VORTEX_CODEC_ADDMASK 0x7f0000	/* 0x000f0000 */
-#define VORTEX_CODEC_DATSHIFT 0
-#define VORTEX_CODEC_DATMASK 0xffff
-#define VORTEX_CODEC_IO 0x29188
+
+#define VORTEX_CODEC_CHN 	0x29080
+#define VORTEX_CODEC_WRITE	0x00800000
+#define VORTEX_CODEC_ADDSHIFT 	16
+#define VORTEX_CODEC_ADDMASK	0x7f0000	/* 0x000f0000 */
+#define VORTEX_CODEC_DATSHIFT	0
+#define VORTEX_CODEC_DATMASK	0xffff
+#define VORTEX_CODEC_IO		0x29188
 
 /* SPDIF */
-#define VORTEX_SPDIF_FLAGS		0x2205c
-#define VORTEX_SPDIF_CFG0		0x291D0
-#define VORTEX_SPDIF_CFG1		0x291D4
+#define VORTEX_SPDIF_FLAGS	0x2205c
+#define VORTEX_SPDIF_CFG0	0x291D0
+#define VORTEX_SPDIF_CFG1	0x291D4
 #define VORTEX_SPDIF_SMPRATE	0x29194
 
 /* Sample timer */
-#define VORTEX_SMP_TIME  0x29198
+#define VORTEX_SMP_TIME		0x29198
+
+#define VORTEX_MODEM_CTRL	0x291ac
 
 /* IRQ */
 #define VORTEX_IRQ_SOURCE 0x2a000	/* Interrupt source flags. */
@@ -193,19 +211,19 @@
 #define 	CTRL_IRQ_ENABLE	0x00004000
 
 /* write: Timer period config / read: TIMER IRQ ack. */
-#define VORTEX_IRQ_STAT 0x2919c
+#define VORTEX_IRQ_STAT		0x2919c
 
 /* DMA */
-#define VORTEX_ENGINE_CTRL 0x27ae8
-#define 	ENGINE_INIT 0x1380000
+#define VORTEX_ENGINE_CTRL	0x27ae8
+#define 	ENGINE_INIT	0x1380000
 
-		     /* MIDI *//* GAME. */
-#define VORTEX_MIDI_DATA 0x28800
-#define VORTEX_MIDI_CMD 0x28804	/* Write command / Read status */
+/* MIDI *//* GAME. */
+#define VORTEX_MIDI_DATA	0x28800
+#define VORTEX_MIDI_CMD		0x28804	/* Write command / Read status */
 
-#define VORTEX_CTRL2 0x2880c
+#define VORTEX_CTRL2		0x2880c
 #define		CTRL2_GAME_ADCMODE 0x40
-#define VORTEX_GAME_LEGACY 0x28808
-#define VORTEX_GAME_AXIS 0x28810
+#define VORTEX_GAME_LEGACY	0x28808
+#define VORTEX_GAME_AXIS	0x28810
 #define		AXIS_SIZE 4
 #define		AXIS_RANGE 0x1fff
diff --git a/sound/pci/au88x0/au8820.c b/sound/pci/au88x0/au8820.c
index b067af6b4..d1fbcce07 100644
--- a/sound/pci/au88x0/au8820.c
+++ b/sound/pci/au88x0/au8820.c
@@ -1,7 +1,7 @@
 #include "au8820.h"
 #include "au88x0.h"
 static struct pci_device_id snd_vortex_ids[] = {
-	{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX,
+	{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
 	{0,}
 };
diff --git a/sound/pci/au88x0/au8820.h b/sound/pci/au88x0/au8820.h
index bd7d76c6a..be8022e78 100644
--- a/sound/pci/au88x0/au8820.h
+++ b/sound/pci/au88x0/au8820.h
@@ -48,9 +48,9 @@
 /* ADB */
 #define VORTEX_ADB_SR 0x10a00	/* Samplerates enable/disable */
 #define VORTEX_ADB_RTBASE 0x10800
-#define VORTEX_ADB_RTBASE_SIZE (VORTEX_ADB_CHNBASE - VORTEX_ADB_RTBASE)
+#define VORTEX_ADB_RTBASE_COUNT 103
 #define VORTEX_ADB_CHNBASE 0x1099c
-#define VORTEX_ADB_CHNBASE_SIZE (ADB_MASK - VORTEX_ADB_RTBASE_SIZE)
+#define VORTEX_ADB_CHNBASE_COUNT 22
 #define 	ROUTE_MASK	0x3fff
 #define     ADB_MASK   0x7f
 #define		ADB_SHIFT 0x7
diff --git a/sound/pci/au88x0/au8830.c b/sound/pci/au88x0/au8830.c
index 010bad31b..d4f2717c1 100644
--- a/sound/pci/au88x0/au8830.c
+++ b/sound/pci/au88x0/au8830.c
@@ -1,7 +1,7 @@
 #include "au8830.h"
 #include "au88x0.h"
 static struct pci_device_id snd_vortex_ids[] = {
-	{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX2,
+	{PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
 	{0,}
 };
diff --git a/sound/pci/au88x0/au8830.h b/sound/pci/au88x0/au8830.h
index 293df0650..aa77826b5 100644
--- a/sound/pci/au88x0/au8830.h
+++ b/sound/pci/au88x0/au8830.h
@@ -45,7 +45,7 @@
 #define VORTEX_ADBDMA_START 0x27c00	/* Which subbuffer starts */
 
 #define VORTEX_ADBDMA_STATUS 0x27A90	/* stored at AdbDma->this_10 / 2 DWORD in size. */
-/* Starting at MSB, each pair seem to be the current DMA page. */
+/* Starting at the MSB, each pair of bits seem to be the current DMA page. */
 /* This current page bits are consistent (same value) with VORTEX_ADBDMA_STAT) */
 
 /* DMA */
@@ -65,9 +65,9 @@
 /* ADB */
 #define VORTEX_ADB_SR 0x28400	/* Samplerates enable/disable */
 #define VORTEX_ADB_RTBASE 0x28000
-#define VORTEX_ADB_RTBASE_SIZE (VORTEX_ADB_CHNBASE - VORTEX_ADB_RTBASE)
+#define VORTEX_ADB_RTBASE_COUNT 173
 #define VORTEX_ADB_CHNBASE 0x282b4
-#define VORTEX_ADB_CHNBASE_SIZE (ADB_MASK - VORTEX_ADB_RTBASE_SIZE)
+#define VORTEX_ADB_CHNBASE_COUNT 24
 #define 	ROUTE_MASK	0xffff
 #define		SOURCE_MASK	0xff00
 #define     ADB_MASK   0xff
@@ -147,7 +147,7 @@
 #define VORTEX_SRC_RTBASE		0x26c00
 #define VORTEX_SRCBLOCK_SR		0x26cc0
 #define VORTEX_SRC_SOURCE		0x26cc4
-#define VORTEX_SRC_SOURCESIZE	0x26cc4
+#define VORTEX_SRC_SOURCESIZE	0x26cc8
 /* Params
 	0x26e00	: 1 U0
 	0x26e40	: 2 CR
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index f8bf47686..5c6a78b98 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -19,7 +19,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
-#define SNDRV_GET_ID
+#include <linux/moduleparam.h>
 #include <sound/initval.h>
 
 // module parameters (see "Module Parameters")
@@ -27,17 +27,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
 static int pcifix[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 255 };
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(pcifix, "1-255i");
+module_param_array(pcifix, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcifix, "Enable VIA-workaround for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(pcifix,
 		   SNDRV_ENABLED
@@ -48,80 +49,72 @@ MODULE_CLASSES("{sound}");
 MODULE_LICENSE("GPL");
 MODULE_DEVICES("{{Aureal Semiconductor Inc., Aureal Vortex Sound Processor}}");
 
-#ifndef MODULE
-/* format is: snd-mychip=enable,index,id */
-static int __init alsa_card_vortex_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str, &enable[nr_dev]) == 2 &&
-	       get_option(&str, &index[nr_dev]) == 2 &&
-	       get_id(&str, &id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-au88x0=", alsa_card_vortex_setup);
-#endif				/* ifndef MODULE */
-
 MODULE_DEVICE_TABLE(pci, snd_vortex_ids);
 
-static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix)
+static void vortex_fix_latency(struct pci_dev *vortex)
 {
-	struct pci_dev *via = NULL;
 	int rc;
-
-	/* autodetect if workarounds are required */
-	while ((via = pci_find_device(PCI_VENDOR_ID_VIA,
-				      PCI_DEVICE_ID_VIA_8365_1, via))) {
-		if (fix == 255) {
-			printk(KERN_INFO CARD_NAME
-			       ": detected VIA KT133/KM133. activating workaround...\n");
-			fix = 3;	// do latency and via bridge workaround
-		}
-		break;
-	}
-
-	/* do not do anything if autodetection was enabled and found no VIA */
-	if (fix == 255)
-		return;
-
-	/* fix vortex latency */
-	if (fix & 0x01) {
-		if (!(rc = pci_write_config_byte(vortex, 0x40, 0xff))) {
+	if (!(rc = pci_write_config_byte(vortex, 0x40, 0xff))) {
 			printk(KERN_INFO CARD_NAME
 			       ": vortex latency is 0xff\n");
-		} else {
-			printk(KERN_WARNING CARD_NAME
-			       ": could not set vortex latency: pci error 0x%x\n",
-			       rc);
-		}
+	} else {
+		printk(KERN_WARNING CARD_NAME
+				": could not set vortex latency: pci error 0x%x\n", rc);
 	}
+}
+
+static void vortex_fix_agp_bridge(struct pci_dev *via)
+{
+	int rc;
+	u8 value;
 
-	/* fix via agp bridge */
-	if (via && (fix & 0x02)) {
-		u8 value;
+	/*
+	 * only set the bit (Extend PCI#2 Internal Master for
+	 * Efficient Handling of Dummy Requests) if the can
+	 * read the config and it is not already set
+	 */
 
-		/*
-		 * only set the bit (Extend PCI#2 Internal Master for
-		 * Efficient Handling of Dummy Requests) if the can
-		 * read the config and it is not already set
-		 */
+	if (!(rc = pci_read_config_byte(via, 0x42, &value))
+			&& ((value & 0x10)
+				|| !(rc = pci_write_config_byte(via, 0x42, value | 0x10)))) {
+		printk(KERN_INFO CARD_NAME
+				": bridge config is 0x%x\n", value | 0x10);
+	} else {
+		printk(KERN_WARNING CARD_NAME
+				": could not set vortex latency: pci error 0x%x\n", rc);
+	}
+}
 
-		if (!(rc = pci_read_config_byte(via, 0x42, &value))
-		    && ((value & 0x10)
-			|| !(rc =
-			     pci_write_config_byte(via, 0x42, value | 0x10)))) {
+static void __devinit snd_vortex_workaround(struct pci_dev *vortex, int fix)
+{
+	struct pci_dev *via;
 
-			printk(KERN_INFO CARD_NAME
-			       ": bridge config is 0x%x\n", value | 0x10);
-		} else {
-			printk(KERN_WARNING CARD_NAME
-			       ": could not set vortex latency: pci error 0x%x\n",
-			       rc);
+	/* autodetect if workarounds are required */
+	if (fix == 255) {
+		/* VIA KT133 */
+		via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8365_1, NULL);
+		/* VIA Apollo */
+		if (via == NULL) {
+			via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, NULL);
 		}
+		/* AMD Irongate */
+		if (via == NULL) {
+			via = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL);
+		}
+		if (via) {
+			printk(KERN_INFO CARD_NAME ": Activating latency workaround...\n");
+			vortex_fix_latency(vortex);
+			vortex_fix_agp_bridge(via);
+		}
+	} else {
+		if (fix & 0x1)
+			vortex_fix_latency(vortex);
+		if ((fix & 0x2) && (via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8365_1, NULL)))
+			vortex_fix_agp_bridge(via);
+		if ((fix & 0x4) && (via = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, NULL)))
+			vortex_fix_agp_bridge(via);
+		if ((fix & 0x8) && (via = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL)))
+			vortex_fix_agp_bridge(via);
 	}
 }
 
@@ -370,7 +363,7 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 		return err;
 	}
 	// (7)
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	vortex_connect_default(chip, 1);
 	vortex_enable_int(chip);
@@ -380,16 +373,8 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 // destructor -- see "Destructor" sub-section
 static void __devexit snd_vortex_remove(struct pci_dev *pci)
 {
-	vortex_t *vortex = snd_magic_cast(vortex_t,
-					  pci_get_drvdata(pci), return);
-
-	if (vortex) {
-		// Release ALSA stuff.
-		snd_card_free(vortex->card);
-		// Free Vortex struct.
-		pci_set_drvdata(pci, NULL);
-	} else
-		printk("snd_vortex_remove called more than one time!\n");
+	snd_card_free(pci_get_drvdata(pci));
+	pci_set_drvdata(pci, NULL);
 }
 
 // pci_driver definition
@@ -403,16 +388,7 @@ static struct pci_driver driver = {
 // initialization of the module
 static int __init alsa_card_vortex_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Aureal soundcard not found "
-		       "or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 // clean up the module
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index 2ab68cfb6..815de180c 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -17,6 +17,7 @@
 #ifndef __SOUND_AU88X0_H
 #define __SOUND_AU88X0_H
 
+#ifdef __KERNEL__
 #include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -28,6 +29,8 @@
 #include <sound/hwdep.h>
 #include <sound/ac97_codec.h>
 
+#endif
+
 #ifndef CHIP_AU8820
 #include "au88x0_eq.h"
 #include "au88x0_a3d.h"
@@ -69,20 +72,19 @@
 #define IRQ_MODEM	0x4000
 
 /* ADB Resource */
-#define VORTEX_RESOURCE_DMA		0x00000000
-#define VORTEX_RESOURCE_SRC		0x00000001
+#define VORTEX_RESOURCE_DMA	0x00000000
+#define VORTEX_RESOURCE_SRC	0x00000001
 #define VORTEX_RESOURCE_MIXIN	0x00000002
 #define VORTEX_RESOURCE_MIXOUT	0x00000003
-#define VORTEX_RESOURCE_A3D		0x00000004
+#define VORTEX_RESOURCE_A3D	0x00000004
 #define VORTEX_RESOURCE_LAST	0x00000005
 
 /* Check for SDAC bit in "Extended audio ID" AC97 register */
-#define VORTEX_IS_QUAD(x) ((x->codec == NULL) ?  0 : (x->codec->ext_id|0x80))
+#define VORTEX_IS_QUAD(x) ((x->codec == NULL) ?  0 : (x->codec->ext_id&0x80))
 /* Check if chip has bug. */
 #define IS_BAD_CHIP(x) (\
-	(x->rev < 3 && x->device == PCI_DEVICE_ID_AUREAL_VORTEX) || \
-	(x->rev < 0xfe && x->device == PCI_DEVICE_ID_AUREAL_VORTEX2) || \
-	(x->rev < 0xfe && x->device == PCI_DEVICE_ID_AUREAL_ADVANTAGE))
+	(x->rev == 0xfe && x->device == PCI_DEVICE_ID_AUREAL_VORTEX_2) || \
+	(x->rev == 0xfe && x->device == PCI_DEVICE_ID_AUREAL_ADVANTAGE))
 
 
 /* PCM devices */
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index 2ca305110..dd85d947b 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -617,6 +617,12 @@ static void vortex_Vort3D(vortex_t * v, int en)
 static void vortex_Vort3D_connect(vortex_t * v, int en)
 {
 	int i;
+	
+// Disable AU8810 routes, since they seem to be wrong (in au8810.h).
+#ifdef CHIP_AU8810
+	return;
+#endif
+	
 #if 1
 	/* Alloc Xtalk mixin resources */
 	v->mixxtlk[0] =
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 5239c2426..d8fccffbe 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -72,6 +72,7 @@
             into au88x0_pcm.c .
  06-06-2003 Buffer shifter bugfix. Mixer volume fix.
  07-12-2003 A3D routing finally fixed. Believed to be OK.
+ 25-03-2004 Many thanks to Claudia, for such valuable bug reports.
  
 */
 
@@ -772,7 +773,9 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
 	return 1;
 }
 
- /*FIFO*/ static void
+ /*FIFO*/ 
+
+static void
 vortex_fifo_clearadbdata(vortex_t * vortex, int fifo, int x)
 {
 	for (x--; x >= 0; x--)
@@ -1345,31 +1348,29 @@ vortex_wtdma_setbuffers(vortex_t * vortex, int wtdma,
 	dma->nr_periods = count;
 	dma->sgbuf = sgbuf;
 
-	psize--;
-
 	dma->cfg0 = 0;
 	dma->cfg1 = 0;
 	switch (count) {
 		/* Four or more pages */
 	default:
 	case 4:
-		dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | psize;
-		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4),
+		dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1);
+		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0xc,
 			snd_sgbuf_get_addr(sgbuf, psize * 3));
 		/* 3 pages */
 	case 3:
 		dma->cfg0 |= 0x12000000;
-		dma->cfg1 |= 0x80000000 | 0x40000000 | (psize << 0xc);
-		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4),
+		dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc);
+		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4)  + 0x8,
 			snd_sgbuf_get_addr(sgbuf, psize * 2));
 		/* 2 pages */
 	case 2:
-		dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | psize;
-		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4),
+		dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1);
+		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x4,
 			snd_sgbuf_get_addr(sgbuf, psize));
 		/* 1 page */
 	case 1:
-		dma->cfg0 |= 0x80000000 | 0x40000000 | (psize << 0xc);
+		dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc);
 		hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4),
 			snd_sgbuf_get_addr(sgbuf, 0));
 		break;
@@ -1575,11 +1576,11 @@ static void vortex_adb_init(vortex_t * vortex)
 	/* it looks like we are writing more than we need to...
 	 * if we write what we are supposed to it breaks things... */
 	hwwrite(vortex->mmio, VORTEX_ADB_SR, 0);
-	for (i = 0; i < VORTEX_ADB_RTBASE_SIZE; i++)
+	for (i = 0; i < VORTEX_ADB_RTBASE_COUNT; i++)
 		hwwrite(vortex->mmio, VORTEX_ADB_RTBASE + (i << 2),
 			hwread(vortex->mmio,
 			       VORTEX_ADB_RTBASE + (i << 2)) | ROUTE_MASK);
-	for (i = 0; i < VORTEX_ADB_CHNBASE_SIZE; i++) {
+	for (i = 0; i < VORTEX_ADB_CHNBASE_COUNT; i++) {
 		hwwrite(vortex->mmio, VORTEX_ADB_CHNBASE + (i << 2),
 			hwread(vortex->mmio,
 			       VORTEX_ADB_CHNBASE + (i << 2)) | ROUTE_MASK);
@@ -1922,6 +1923,9 @@ vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[])
 	// Connect front channels through EQ.
 	vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_EQIN(0));
 	vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_EQIN(1));
+	/* Lower volume, since EQ has some gain. */
+	vortex_mix_setvolumebyte(vortex, mixers[0], 0);
+	vortex_mix_setvolumebyte(vortex, mixers[1], 0);
 	vortex_route(vortex, en, 0x11, ADB_EQOUT(0), ADB_CODECOUT(0));
 	vortex_route(vortex, en, 0x11, ADB_EQOUT(1), ADB_CODECOUT(1));
 
@@ -2007,9 +2011,11 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
 }
 
 /* Default Connections  */
+static int
+vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type);
+
 static void vortex_connect_default(vortex_t * vortex, int en)
 {
-	// FIXME: check if checkout was succesful.
 	// Connect AC97 codec.
 	vortex->mixplayb[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
 				  VORTEX_RESOURCE_MIXOUT);
@@ -2044,7 +2050,7 @@ static void vortex_connect_default(vortex_t * vortex, int en)
 #ifndef CHIP_AU8810
 	vortex_wt_connect(vortex, en);
 #endif
-	// A3D (crosstalk canceler and A3D slices).
+	// A3D (crosstalk canceler and A3D slices). AU8810 disabled for now.
 #ifndef CHIP_AU8820
 	vortex_Vort3D_connect(vortex, en);
 #endif
@@ -2053,18 +2059,7 @@ static void vortex_connect_default(vortex_t * vortex, int en)
 	// Connect DSP interface for SQ3500 turbo (not here i think...)
 
 	// Connect AC98 modem codec
- 	
- 	/* Fast Play Workaround. Revision 0xFE does not seem to need it. */
- 	printk(KERN_INFO "vortex: revision = 0x%x, device = %d\n", vortex->rev, vortex->device);
- 	if (IS_BAD_CHIP(vortex)) {
- 		printk(KERN_INFO "vortex: Erratum workaround enabled.\n");
- #ifndef CHIP_AU8820
- 		vortex->fixed_res[VORTEX_RESOURCE_DMA] = 0x00000001;
- #endif
- 		// Channel swapping workaround. We are nuking registers somewhere, or
- 		// its a hardware bug.
- 		vortex->fixed_res[VORTEX_RESOURCE_SRC] = 0x00000001;
- 	}
+	
 }
 
 /*
@@ -2081,7 +2076,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 {
 	stream_t *stream;
 	int i, en;
-
+	
 	if ((nr_ch == 3)
 	    || ((dir == SNDRV_PCM_STREAM_CAPTURE) && (nr_ch > 2)))
 		return -EBUSY;
@@ -2105,7 +2100,6 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 	stream->dir = dir;
 	stream->type = type;
 
-	// FIXME: check for success of checkout or checkin.
 	/* PLAYBACK ROUTES. */
 	if (dir == SNDRV_PCM_STREAM_PLAYBACK) {
 		int src[4], mix[4], ch_top;
@@ -2165,8 +2159,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 		for (i = 0; i < nr_ch; i++) {
 			if (stream->type == VORTEX_PCM_ADB) {
 				vortex_connection_adbdma_src(vortex, en,
-							     src[nr_ch - 1], 
-							     //src[0], 
+							     src[nr_ch - 1],
 							     dma,
 							     src[i]);
 				vortex_connection_src_mixin(vortex, en,
@@ -2188,7 +2181,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 #ifndef CHIP_AU8820
 			if (stream->type == VORTEX_PCM_A3D) {
 				vortex_connection_adbdma_src(vortex, en,
-							     src[0], 
+							     src[nr_ch - 1], 
 								 dma,
 							     src[i]);
 				vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_A3DIN(a3d));
@@ -2237,7 +2230,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 				     ADB_SPDIFOUT(1));
 		}
 #endif
-		/* CAPTURE ROUTES. */
+	/* CAPTURE ROUTES. */
 	} else {
 		int src[2], mix[2];
 
@@ -2271,7 +2264,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 			vortex_connection_mixin_mix(vortex, en,
 						    MIX_CAPT(1), mix[0], 0);
 			vortex_connection_src_adbdma(vortex, en,
-						     src[nr_ch - 1],
+						     src[0],
 						     src[0], dma);
 		} else {
 			vortex_connection_mixin_mix(vortex, en,
@@ -2279,7 +2272,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
 			vortex_connection_mix_src(vortex, en, 0x11, mix[1],
 						  src[1]);
 			vortex_connection_src_src_adbdma(vortex, en,
-							 src[0], src[0],
+							 src[1], src[0],
 							 src[1], dma);
 		}
 	}
diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c
index b9fba0189..fdf0014f0 100644
--- a/sound/pci/au88x0/au88x0_eq.c
+++ b/sound/pci/au88x0/au88x0_eq.c
@@ -710,11 +710,13 @@ static void vortex_Eqlzr_ShutDownA3d(vortex_t * vortex)
 static void vortex_Eqlzr_SetBypass(vortex_t * vortex, long bp)
 {
 	eqlzr_t *eq = &(vortex->eq);
-
+	
 	if ((eq->this28) && (bp == 0)) {
+		/* EQ enabled */
 		vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);
 		vortex_EqHw_SetBypassGain(vortex, eq->this08, eq->this08);
 	} else {
+		/* EQ disabled. */
 		vortex_EqHw_SetLeftGainsTarget(vortex, (u16 *) (eq->this14));
 		vortex_EqHw_SetRightGainsTarget(vortex, (u16 *) (eq->this14));
 		vortex_EqHw_SetBypassGain(vortex, eq->this0c, eq->this0c);
diff --git a/sound/pci/au88x0/au88x0_game.c b/sound/pci/au88x0/au88x0_game.c
index 7e7443d3b..6cc70af17 100644
--- a/sound/pci/au88x0/au88x0_game.c
+++ b/sound/pci/au88x0/au88x0_game.c
@@ -32,6 +32,7 @@
 
 #include <sound/driver.h>
 #include <linux/time.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <sound/core.h>
 #include "au88x0.h"
@@ -41,8 +42,6 @@
 
 #define VORTEX_GAME_DWAIT	20	/* 20 ms */
 
-static struct gameport gameport;
-
 static unsigned char vortex_game_read(struct gameport *gameport)
 {
 	vortex_t *vortex = gameport->driver;
@@ -81,7 +80,7 @@ static int vortex_game_open(struct gameport *gameport, int mode)
 		hwwrite(vortex->mmio, VORTEX_CTRL2,
 			hwread(vortex->mmio,
 			       VORTEX_CTRL2) | CTRL2_GAME_ADCMODE);
-		wait_ms(VORTEX_GAME_DWAIT);
+		msleep(VORTEX_GAME_DWAIT);
 		return 0;
 	case GAMEPORT_MODE_RAW:
 		hwwrite(vortex->mmio, VORTEX_CTRL2,
@@ -97,8 +96,10 @@ static int vortex_game_open(struct gameport *gameport, int mode)
 
 static int vortex_gameport_register(vortex_t * vortex)
 {
-	vortex->gameport = &gameport;
-
+	if ((vortex->gameport = snd_kcalloc(sizeof(struct gameport), GFP_KERNEL)) == NULL) {
+		return -1;
+	};
+	
 	vortex->gameport->driver = vortex;
 	vortex->gameport->fuzz = 64;
 
@@ -117,8 +118,10 @@ static int vortex_gameport_register(vortex_t * vortex)
 
 static int vortex_gameport_unregister(vortex_t * vortex)
 {
-	if (vortex->gameport != NULL)
+	if (vortex->gameport != NULL) {
 		gameport_unregister_port(vortex->gameport);
+		kfree(vortex->gameport);
+	}
 	return 0;
 }
 
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index 686ca8ff7..6df634ebc 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -18,8 +18,7 @@
  * Vortex PCM ALSA driver.
  *
  * Supports ADB and WT DMA. Unfortunately, WT channels do not run yet.
- * It remains stuck,and DMA transfers do not happen.
- *
+ * It remains stuck,and DMA transfers do not happen. 
  */
 
 #include <sound/driver.h>
@@ -124,7 +123,7 @@ static int snd_vortex_pcm_open(snd_pcm_substream_t * substream)
 	vortex_t *vortex = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	int err;
-
+	
 	/* Force equal size periods */
 	if ((err =
 	     snd_pcm_hw_constraint_integer(runtime,
@@ -232,12 +231,13 @@ snd_vortex_pcm_hw_params(snd_pcm_substream_t * substream,
 	}
 #ifndef CHIP_AU8810
 	else {
-		/*if (stream != NULL)
+		/* if (stream != NULL)
 		   vortex_wt_allocroute(chip, substream->number, 0); */
 		vortex_wt_allocroute(chip, substream->number,
 				     params_channels(hw_params));
 		stream = substream->runtime->private_data =
 		    &chip->dma_wt[substream->number];
+		stream->dma = substream->number;
 		stream->substream = substream;
 		vortex_wtdma_setbuffers(chip, substream->number, sgbuf,
 					params_period_bytes(hw_params),
@@ -325,7 +325,7 @@ static int snd_vortex_pcm_trigger(snd_pcm_substream_t * substream, int cmd)
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
 		// do something to stop the PCM engine
-		//printk(KERN_INFO "vortex: stop %d\n", dma)
+		//printk(KERN_INFO "vortex: stop %d\n", dma);
 		stream->fifo_enabled = 0;
 		if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
 			vortex_adbdma_pausefifo(chip, dma);
@@ -502,18 +502,13 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
 	if (idx == VORTEX_PCM_ADB)
 		snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
 				&snd_vortex_playback_ops);
-
+	
 	/* pre-allocation of Scatter-Gather buffers */
 	
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-										  snd_dma_pci_data(chip->pci_dev),
-										  0x10000, 0x10000);
-	
-	// The above should be used, as soon as ALSA gets updated.
-	/*
-	snd_pcm_lib_preallocate_sg_pages_for_all(chip->pci_dev, pcm,
-						 0x10000, 0x10000);
-	*/
+					      snd_dma_pci_data(chip->pci_dev),
+					      0x10000, 0x10000);
+
 	if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_SPDIF) {
 		snd_kcontrol_t *kcontrol;
 
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index 186721869..400417d34 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -36,6 +36,7 @@ static int vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
 
 /* WT */
 
+/* Put 2 WT channels together for one stereo interlaced channel. */
 static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo)
 {
 	int temp;
@@ -47,6 +48,7 @@ static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo)
 	hwwrite(vortex->mmio, WT_STEREO(wt), temp);
 }
 
+/* Join to mixdown route. */
 static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
 {
 	int temp;
@@ -60,7 +62,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
 	hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp);
 }
 
-// WT routing is still a mistery.
+/* Setup WT route. */
 static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
 {
 	wt_voice_t *voice = &(vortex->wt_voice[wt]);
@@ -68,13 +70,15 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
 
 	//FIXME: WT audio routing.
 	if (nr_ch) {
-		vortex_fifo_wtinitialize(vortex, wt, 2);
+		vortex_fifo_wtinitialize(vortex, wt, 1);
 		vortex_fifo_setwtvalid(vortex, wt, 1);
 		vortex_wt_setstereo(vortex, wt, nr_ch - 1);
 	} else
 		vortex_fifo_setwtvalid(vortex, wt, 0);
-
-	vortex_wt_setdsout(vortex, wt, 0);
+	
+	/* Set mixdown mode. */
+	vortex_wt_setdsout(vortex, wt, 1);
+	/* Set other parameter registers. */
 	hwwrite(vortex->mmio, WT_SRAMP(0), 0x880000);
 	//hwwrite(vortex->mmio, WT_GMODE(0), 0xffffffff);
 #ifdef CHIP_AU8830
@@ -87,7 +91,7 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
 
 	temp = hwread(vortex->mmio, WT_PARM(wt, 3));
 	printk("vortex: WT PARM3: %x\n", temp);
-	hwwrite(vortex->mmio, WT_PARM(wt, 3), temp);
+	//hwwrite(vortex->mmio, WT_PARM(wt, 3), temp);
 
 	hwwrite(vortex->mmio, WT_DELAY(wt, 0), 0);
 	hwwrite(vortex->mmio, WT_DELAY(wt, 1), 0);
@@ -106,6 +110,7 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
 	return 0;
 }
 
+
 static void vortex_wt_connect(vortex_t * vortex, int en)
 {
 	int i, ii, mix;
@@ -129,15 +134,12 @@ static void vortex_wt_connect(vortex_t * vortex, int en)
 				     ADB_WTOUT(i, ii + 0x20), ADB_MIXIN(mix));
 
 			vortex_connection_mixin_mix(vortex, en, mix,
-						    vortex->mixplayb[ii %
-								     2], 0);
+						    vortex->mixplayb[ii % 2], 0);
 			if (VORTEX_IS_QUAD(vortex))
 				vortex_connection_mixin_mix(vortex, en,
 							    mix,
-							    vortex->
-							    mixplayb[2 +
-								     (ii %
-								      2)], 0);
+							    vortex->mixplayb[2 +
+								     (ii % 2)], 0);
 		}
 	}
 	for (i = 0; i < NR_WT; i++) {
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 2c4ee8159..9dc7de84d 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -98,13 +98,13 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include "azt3328.h"
 
@@ -166,18 +166,19 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card *
 #ifdef SUPPORT_JOYSTICK
 static int joystick[SNDRV_CARDS];
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for AZF3328 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for AZF3328 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_INDEX_DESC);
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick, bool, boot_devs, 0444);
 MODULE_PARM_DESC(joystick, "Enable joystick for AZF3328 soundcard.");
 MODULE_PARM_SYNTAX(joystick, SNDRV_BOOLEAN_FALSE_DESC);
 #endif
@@ -1267,6 +1268,10 @@ static int snd_azf3328_free(azf3328_t *chip)
         if (chip->irq < 0)
                 goto __end_hw;
 
+	/* reset (close) mixer */
+	snd_azf3328_mixer_set_mute(chip, IDX_MIXER_PLAY_MASTER, 1); /* first mute master volume */
+	snd_azf3328_mixer_write(chip, IDX_MIXER_RESET, 0x0, WORD_VALUE);
+
         /* interrupt setup - mask everything */
 	/* FIXME */
 
@@ -1540,7 +1545,7 @@ static int __devinit snd_azf3328_probe(struct pci_dev *pci,
 	snd_azf3328_config_joystick(chip, joystick[dev]);
 #endif
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 
 	snd_azf3328_dbgcallleave();
@@ -1549,16 +1554,8 @@ static int __devinit snd_azf3328_probe(struct pci_dev *pci,
 
 static void __devexit snd_azf3328_remove(struct pci_dev *pci)
 {
-        azf3328_t *chip = snd_magic_cast(azf3328_t, pci_get_drvdata(pci), return);
-	
 	snd_azf3328_dbgcallenter();
-
-	/* reset (close) mixer */
-	snd_azf3328_mixer_set_mute(chip, IDX_MIXER_PLAY_MASTER, 1); /* first mute master volume */
-	snd_azf3328_mixer_write(chip, IDX_MIXER_RESET, 0x0, WORD_VALUE);
-
-        if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 	snd_azf3328_dbgcallleave();
 }
@@ -1573,18 +1570,10 @@ static struct pci_driver driver = {
 static int __init alsa_card_azf3328_init(void)
 {
 	int err;
-	
 	snd_azf3328_dbgcallenter();
-
-	if ((err = pci_module_init(&driver)) < 0)
-	{
-#ifdef MODULE
-		printk(KERN_ERR "azt3328: no AZF3328 based soundcards found or device busy\n");
-#endif
-		return err;
-	}
+	err = pci_module_init(&driver);
 	snd_azf3328_dbgcallleave();
-	return 0;
+	return err;
 }
 
 static void __exit alsa_card_azf3328_exit(void)
@@ -1596,31 +1585,3 @@ static void __exit alsa_card_azf3328_exit(void)
 
 module_init(alsa_card_azf3328_init)
 module_exit(alsa_card_azf3328_exit)
-
-#ifndef MODULE
-
-/* format is: snd-azf3328=enable,index,id,joystick */
-
-static int __init alsa_card_azf3328_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	snd_azf3328_dbgcallenter();
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2
-#ifdef SUPPORT_JOYSTICK
-	       && get_option(&str,&joystick[nr_dev]) == 2
-#endif
-	       );
-	nr_dev++;
-	snd_azf3328_dbgcallleave();
-	return 1;
-}
-
-__setup("snd-azt3328=", alsa_card_azf3328_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index b3df7f720..3c232660f 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -26,13 +26,13 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/control.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
@@ -46,17 +46,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int digital_rate[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* digital input rate */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Bt87x soundcard");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Bt87x soundcard");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Bt87x soundcard");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(digital_rate, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(digital_rate, int, boot_devs, 0444);
 MODULE_PARM_DESC(digital_rate, "Digital input rate for Bt87x soundcard");
 MODULE_PARM_SYNTAX(digital_rate, SNDRV_ENABLED);
 
@@ -808,7 +809,7 @@ static int __devinit snd_bt87x_probe(struct pci_dev *pci,
 	if (err < 0)
 		goto _error;
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	++dev;
 	return 0;
 
@@ -819,9 +820,7 @@ _error:
 
 static void __devexit snd_bt87x_remove(struct pci_dev *pci)
 {
-	bt87x_t *chip = snd_magic_cast(bt87x_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -851,16 +850,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_bt87x_init(void)
 {
-	int err;
-
-	err = pci_module_init(&driver);
-	if (err < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Bt87x soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_bt87x_exit(void)
@@ -870,24 +860,3 @@ static void __exit alsa_card_bt87x_exit(void)
 
 module_init(alsa_card_bt87x_init)
 module_exit(alsa_card_bt87x_exit)
-
-#ifndef MODULE
-
-/* format is: snd-bt87x=enable,index,id */
-
-static int __init alsa_card_bt87x_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-bt87x=", alsa_card_bt87x_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index e92e3c5ce..a5ce7233a 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -20,10 +20,6 @@
 /* Does not work. Warning may block system in capture mode */
 /* #define USE_VAR48KRATE */
 
-/* Define this if you want soft ac3 encoding */
-#define DO_SOFT_AC3
-#define USE_AES_IEC958
-
 #include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/delay.h>
@@ -32,6 +28,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -41,7 +38,6 @@
 #include <sound/opl3.h>
 #include <sound/sb.h>
 #include <sound/asoundef.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
@@ -62,35 +58,31 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
 static long mpu_port[SNDRV_CARDS];
 static long fm_port[SNDRV_CARDS];
-#ifdef DO_SOFT_AC3
 static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
-#endif
 #ifdef SUPPORT_JOYSTICK
 static int joystick_port[SNDRV_CARDS];
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for C-Media PCI soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for C-Media PCI soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable C-Media PCI soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x320},{0x310},{0x300}},dialog:list");
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM port.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{0},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list");
-#ifdef DO_SOFT_AC3
-MODULE_PARM(soft_ac3, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(soft_ac3, bool, boot_devs, 0444);
 MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only).");
-MODULE_PARM_SYNTAX(soft_ac3, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
-#endif
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_port, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_port, "Joystick port address.");
 MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{1},{0x200},{0x201}},dialog:list");
 #endif
@@ -426,7 +418,6 @@ struct snd_stru_cmipci_pcm {
 	unsigned int is_dac;		/* is dac? */
 	int bytes_per_frame;
 	int shift;
-	int ac3_shift;	/* extra shift: 1 on soft ac3 mode */
 };
 
 /* mixer elements toggled/resumed during ac3 playback */
@@ -472,10 +463,6 @@ struct snd_stru_cmipci {
 
 	unsigned int dig_status;
 	unsigned int dig_pcm_status;
-#ifdef USE_AES_IEC958
-	snd_ctl_elem_value_t *spdif_channel;
-#endif
-	snd_kcontrol_t *spdif_pcm_ctl;
 
 	snd_pcm_hardware_t *hw_info[3]; /* for playbacks */
 
@@ -784,8 +771,6 @@ static int snd_cmipci_pcm_prepare(cmipci_t *cm, cmipci_pcm_t *rec,
 	/* buffer and period sizes in frame */
 	rec->dma_size = runtime->buffer_size << rec->shift;
 	rec->period_size = runtime->period_size << rec->shift;
-	rec->dma_size <<= rec->ac3_shift;
-	rec->period_size <<= rec->ac3_shift;
 	if (runtime->channels > 2) {
 		/* multi-channels */
 		rec->dma_size = (rec->dma_size * runtime->channels) / 2;
@@ -911,7 +896,6 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(cmipci_t *cm, cmipci_pcm_t *rec,
 	ptr = snd_cmipci_read(cm, reg) - rec->offset;
 	ptr = bytes_to_frames(substream->runtime, ptr);
 #endif
-	ptr >>= rec->ac3_shift;
 	if (substream->runtime->channels > 2)
 		ptr = (ptr * 2) / substream->runtime->channels;
 	return ptr;
@@ -953,358 +937,6 @@ static snd_pcm_uframes_t snd_cmipci_capture_pointer(snd_pcm_substream_t *substre
 	return snd_cmipci_pcm_pointer(cm, &cm->channel[CM_CH_CAPT], substream);
 }
 
-#ifdef DO_SOFT_AC3
-/*
- * special tricks for soft ac3 transfer:
- *
- * we compose an iec958 subframe from 16bit ac3 sample and
- * write the raw subframe via 32bit data mode.
- */
-
-# ifndef USE_AES_IEC958
-
-/* find parity for bit 4~30 */
-static unsigned int parity(unsigned int data)
-{
-	unsigned int parity = 0;
-	int counter = 4;
-
-	data >>= 4;	/* start from bit 4 */
-	while (counter <= 30) {
-		if (data & 1)
-			parity++;
-		data >>= 1;
-		counter++;
-	}
-	return parity & 1;
-}
-
-/*
- * compose 32bit iec958 subframe with non-audio data.
- * bit 0-3  = preamble
- *     4-7  = aux (=0)
- *     8-27 = data (12-27 for 16bit)
- *     28   = validity (=0)
- *     29   = user data (=0)
- *     30   = channel status
- *     31   = parity
- *
- * channel status is assumed as consumer, non-audio
- * thus all 0 except bit 1
- */
-inline static u32 convert_ac3_32bit(cmipci_t *cm, u32 val)
-{
-	u32 data = (u32)val << 12;
-
-	if (cm->spdif_counter == 2 || cm->spdif_counter == 3) /* bit 1 */
-		data |= 0x40000000;	/* indicate AC-3 raw data */
-	if (parity(data))		/* parity bit 4-30 */
-		data |= 0x80000000;
-	if (cm->spdif_counter == 0)
-		data |= 3;		/* preamble 'M' */
-	else if (cm->spdif_counter & 1)
-		data |= 5;		/* odd, 'W' */
-	else
-		data |= 9;		/* even, 'M' */
-
-	cm->spdif_counter++;
-	if (cm->spdif_counter == 384)
-		cm->spdif_counter = 0;
-
-	return data;
-}
-
-# else  /* if USE_AES_IEC958 */
-
-/*
- * The bitstream handling
- */
-typedef struct iec958_stru_bitstream {
-	u32 *data;		/* Holds the current position */
-	u32  left;		/* Bits left in current 32bit frame */
-	u32  word;		/* The 32bit frame of the current position */
-	u32  bits;		/* All bits together */
-	int   err;		/* Error condition */
-} iec958_bitstream_t ;
-
-static iec958_bitstream_t bs;
-
-/* Initialize ptr on the buffer */
-static void iec958_init_bitstream(u8 *buf, u32 size)
-{
-	bs.data = (u32 *)buf;		/* Set initial position */
-	bs.word = *bs.data;		/* The first 32bit frame */
-	bs.left = 32;			/* has exactly 32bits */
-	bs.bits = size;
-	bs.err = 0;
-}
-
-/* Remove ptr on the buffer */
-static void iec958_clear_bitstream(void)
-{
-	bs.data = NULL;
-	bs.left = 0;
-	bs.err = 0;
-}
-
-/* Get bits from bitstream (max 32) */
-static inline u32 iec958_getbits(u32 bits)
-{
-	u32 res;
-
-	if (bs.bits < bits) {
-		bits = bs.bits;
-		bs.err = 1;
-	}
-	if (bits > 32) {
-		bits = 32;
-		bs.err = 1;
-	}
-	bs.bits -= bits;
-
-#  ifdef WORDS_BIGENDIAN
-	if (bits < bs.left) {		/* Within 32bit frame */
-		res = (bs.word << (32 - bs.left)) >> (32 - bits);
-		bs.left -= bits;
-		goto out;
-	}				/* We may cross the frame boundary */
-	res   = (bs.word << (32 - bs.left)) >> (32 - bs.left);
-	bits -= bs.left;
-
-	bs.word = *(++bs.data);		/* Next 32bit frame */
-
-	if (bits)			/* Add remaining bits, if any */
-		res = (res << bits) | (bs.word >> (32 - bits));
-
-#  else  /* not WORDS_BIGENDIAN */
-
-	if (bits < bs.left) {		/* Within 32bit frame */
-		res = (bs.word << (32 - bits)) >> (32 - bits);
-		bs.word >>= bits;
-		bs.left -= bits;
-		goto out;
-	}				/* We may cross the frame boundary */
-	res   = bs.word;
-	bits -= bs.left;
-
-	bs.word = *(++bs.data);		/* Next 32bit frame */
-
-	if (bits) {			/* Add remaining bits, if any */
-		res = res | (((bs.word << (32 - bits)) >> (32 - bits)) << bits);
-		bs.word >>= bits;
-	}
-#  endif /* not WORDS_BIGENDIAN */
-
-	bs.left = (32 - bits);
-out:
-	return res;
-}
-
-static inline u32 iec958_bits_avail(void)
-{
-	return bs.bits;
-}
-
-static inline int iec958_error(void)
-{
-	return bs.err;
-}
-
-/*
- * Determine parity for time slots 4 upto 30
- * to be sure that bit 4 upt 31 will carry
- * an even number of ones and zeros.
- */
-static u32 iec958_parity(u32 data)
-{
-	u32 parity = 0;
-	int counter = 4;
-
-	data >>= 4;     /* start from bit 4 */
-	while (counter++ <= 30) {
-		if (data & 0x00000001)
-			parity++;
-		data >>= 1;
-	}
-	return (parity & 0x00000001);
-}
-
-/*
- * Compose 32bit iec958 subframe, two sub frames
- * build one frame with two channels.
- *
- * bit 0-3  = preamble
- *     4-7  = AUX (=0)
- *     8-27 = data (12-27 for 16bit, 8-27 for 20bit, and 24bit without AUX)
- *     28   = validity (0 for valid data, else 'in error')
- *     29   = user data (0)
- *     30   = channel status (24 bytes for 192 frames)
- *     31   = parity
- */
-
-static inline u32 iec958_subframe(cmipci_t *cm, snd_ctl_elem_value_t * ucontrol)
-{
-	u32 data;
-	u32 byte = cm->spdif_counter >> 4;
-	u32 mask = 1 << ((cm->spdif_counter >> 1) - (byte << 3));
-	u8 * status = ucontrol->value.iec958.status;
-
-	if (status[2] & IEC958_AES2_PRO_SBITS_24) {
-		/* Does this work for LE systems ??? */
-		if (status[2] & IEC958_AES2_PRO_WORDLEN_24_20) {
-			data = iec958_getbits(24);
-			data <<= 4;
-		} else {
-			data = iec958_getbits(20);
-			data <<= 8;
-		}
-	} else {
-		if (status[2] & IEC958_AES2_PRO_WORDLEN_24_20) {
-			/* Does this work for LE systems ??? */
-			data = iec958_getbits(20);
-			data <<= 8;
-		} else {
-			data = iec958_getbits(16);
-			data <<= 12;
-		}
-	}
-
-	/*
-	 * Set one of the 192 bits of the channel status (AES3 and higher)
-	 */
-	if (status[byte] & mask)
-		data |= 0x40000000;
-
-	if (iec958_parity(data))	/* parity bit 4-30 */
-		data |= 0x80000000;
-
-	/* Preamble */
-	if      (!cm->spdif_counter)
-		data |= 0x03;		/* Block start, 'Z' */
-	else if (cm->spdif_counter % 2)
-		data |= 0x05;		/* odd sub frame, 'Y' */
-	else
-		data |= 0x09;		/* even sub frame, 'X' */
-
-	/*
-	 * sub frame counter: 2 sub frame are one audio frame
-	 * and 192 frames are one block
-	 */
-	cm->spdif_counter = (++cm->spdif_counter) % 384;
-
-	return data;
-}
-# endif /* if USE_AES_IEC958 */
-
-static int snd_cmipci_ac3_copy(snd_pcm_substream_t *subs, int channel,
-			       snd_pcm_uframes_t pos, void *src,
-			       snd_pcm_uframes_t count)
-{
-	cmipci_t *cm = snd_pcm_substream_chip(subs);
-	u32 *dst;
-	snd_pcm_uframes_t offset;
-	snd_pcm_runtime_t *runtime = subs->runtime;
-#ifndef USE_AES_IEC958
-	u16 *srcp = src, val;
-#else
-	char buf[480];         /* bits can be divided by 20, 24, 16 */
-	size_t bytes = frames_to_bytes(runtime, count);
-#endif
-
-
-	if (!cm->channel[CM_CH_PLAY].ac3_shift) {
-		if (copy_from_user(runtime->dma_area +
-				   frames_to_bytes(runtime, pos), src,
-				   frames_to_bytes(runtime, count)))
-			return -EFAULT;
-		return 0;
-	}
-
-	if (! access_ok(VERIFY_READ, src, count))
-		return -EFAULT;
-
-	/* frame = 16bit stereo */
-	offset = (pos << 1) % (cm->channel[CM_CH_PLAY].dma_size << 2);
-	dst = (u32*)(runtime->dma_area + offset);
-# ifndef USE_AES_IEC958
-	count /= 2;
-	while (count-- > 0) {
-		get_user(val, srcp);
-		srcp++;
-		*dst++ = convert_ac3_32bit(cm, val);
-	}
-# else
-	while (bytes) {
-		size_t c = bytes;
-
-		if (c > sizeof(buf))
-			c = sizeof(buf);
-
-		if (copy_from_user(buf, src, c))
-			return -EFAULT;
-		bytes -= c;
-		src   += c;
-
-		iec958_init_bitstream(buf, c*8);
-		while (iec958_bits_avail()) {
-			*(dst++) = iec958_subframe(cm, cm->spdif_channel);
-			if (iec958_error())
-				return -EINVAL;
-		}
-		iec958_clear_bitstream();
-	}
-# endif
-	return 0;
-}
-
-static int snd_cmipci_ac3_silence(snd_pcm_substream_t *subs, int channel,
-				  snd_pcm_uframes_t pos,
-				  snd_pcm_uframes_t count)
-{
-	cmipci_t *cm = snd_pcm_substream_chip(subs);
-	u32 *dst;
-	snd_pcm_uframes_t offset;
-	snd_pcm_runtime_t *runtime = subs->runtime;
-# ifdef USE_AES_IEC958
-	char buf[480];		/* bits can be divided by 20, 24, 16 */
-	size_t bytes = frames_to_bytes(runtime, count);
-# endif
-	if (! cm->channel[CM_CH_PLAY].ac3_shift)
-		return snd_pcm_format_set_silence(runtime->format,
-						  runtime->dma_area + frames_to_bytes(runtime, pos), count);
-	
-	/* frame = 16bit stereo */
-	offset = (pos << 1) % (cm->channel[CM_CH_PLAY].dma_size << 2);
-	dst = (u32*)(subs->runtime->dma_area + offset);
-# ifndef USE_AES_IEC958
-	count /= 2;
-	while (count-- > 0) {
-		*dst++ = convert_ac3_32bit(cm, 0);
-	}
-# else
-	while (bytes) {
-		size_t c = bytes;
-
-		if (c > sizeof(buf))
-			c = sizeof(buf);
-
-		/* Q: Does this function know about 24bit silence? */
-		if (snd_pcm_format_set_silence(runtime->format, buf, bytes_to_frames(runtime, c)))
-			return -EINVAL;
-
-		iec958_init_bitstream(buf, c*8);
-		while (iec958_bits_avail()) {
-			*(dst++) = iec958_subframe(cm, cm->spdif_channel);
-			if (iec958_error())
-				return -EINVAL;
-		}
-		iec958_clear_bitstream();
-	}
-# endif
-	return 0;
-}
-#endif /* DO_SOFT_AC3 */
-
 
 /*
  * hw preparation for spdif
@@ -1404,9 +1036,6 @@ static int snd_cmipci_spdif_stream_get(snd_kcontrol_t *kcontrol,
 	spin_lock_irqsave(&chip->reg_lock, flags);
 	for (i = 0; i < 4; i++)
 		ucontrol->value.iec958.status[i] = (chip->dig_pcm_status >> (i * 8)) & 0xff;
-#ifdef USE_AES_IEC958
-	ucontrol = chip->spdif_channel;
-#endif
 	spin_unlock_irqrestore(&chip->reg_lock, flags);
 	return 0;
 }
@@ -1425,9 +1054,6 @@ static int snd_cmipci_spdif_stream_put(snd_kcontrol_t *kcontrol,
 		val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8);
 	change = val != chip->dig_pcm_status;
 	chip->dig_pcm_status = val;
-#ifdef USE_AES_IEC958
-	chip->spdif_channel = ucontrol;
-#endif
 	spin_unlock_irqrestore(&chip->reg_lock, flags);
 	return change;
 }
@@ -1504,9 +1130,6 @@ static void restore_mixer_state(cmipci_t *cm)
 /* spinlock held! */
 static void setup_ac3(cmipci_t *cm, snd_pcm_substream_t *subs, int do_ac3, int rate)
 {
-	cm->channel[CM_CH_PLAY].ac3_shift = 0;
-	cm->spdif_counter = 0;
-
 	if (do_ac3) {
 		/* AC3EN for 037 */
 		snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_AC3EN1);
@@ -1519,9 +1142,6 @@ static void setup_ac3(cmipci_t *cm, snd_pcm_substream_t *subs, int do_ac3, int r
 			snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_SPD24SEL);
 			snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL);
 		} else { /* can_ac3_sw */
-#ifdef DO_SOFT_AC3
-			/* FIXME: ugly hack! */
-			subs->runtime->buffer_size /= 2;
 			/* SPD32SEL for 037 & 039, 0x20 */
 			snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL);
 			/* set 176K sample rate to fix 033 HW bug */
@@ -1532,8 +1152,6 @@ static void setup_ac3(cmipci_t *cm, snd_pcm_substream_t *subs, int do_ac3, int r
 					snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_SRATE_176K);
 				}
 			}
-			cm->channel[CM_CH_PLAY].ac3_shift = 1; /* use 32bit */
-#endif /* DO_SOFT_AC3 */
 		}
 
 	} else {
@@ -1550,11 +1168,9 @@ static void setup_ac3(cmipci_t *cm, snd_pcm_substream_t *subs, int do_ac3, int r
 				snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_SPD24SEL);
 			}
 		} else {
-#ifdef DO_SOFT_AC3
 			snd_cmipci_clear_bit(cm, CM_REG_MISC_CTRL, CM_SPD32SEL);
 			snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_SPD24SEL);
 			snd_cmipci_clear_bit(cm, CM_REG_CHFORMAT, CM_PLAYBACK_SRATE_176K);
-#endif /* DO_SOFT_AC3 */
 		}
 	}
 }
@@ -1604,15 +1220,12 @@ static int snd_cmipci_playback_prepare(snd_pcm_substream_t *substream)
 {
 	cmipci_t *cm = snd_pcm_substream_chip(substream);
 	int rate = substream->runtime->rate;
-	int do_spdif, do_ac3;
+	int do_spdif, do_ac3 = 0;
 	do_spdif = ((rate == 44100 || rate == 48000) &&
 		    substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE &&
 		    substream->runtime->channels == 2);
-	do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
-#ifdef DO_SOFT_AC3
-	if (do_ac3 && cm->can_ac3_sw)
-		do_spdif = 0;
-#endif
+	if (do_spdif && cm->can_ac3_hw) 
+		do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
 	setup_spdif_playback(cm, substream, do_spdif, do_ac3);
 	return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_PLAY], substream);
 }
@@ -1621,7 +1234,12 @@ static int snd_cmipci_playback_prepare(snd_pcm_substream_t *substream)
 static int snd_cmipci_playback_spdif_prepare(snd_pcm_substream_t *substream)
 {
 	cmipci_t *cm = snd_pcm_substream_chip(substream);
-	setup_spdif_playback(cm, substream, 1, cm->dig_pcm_status & IEC958_AES0_NONAUDIO);
+	int do_ac3;
+	if (cm->can_ac3_hw) 
+		do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
+	else
+		do_ac3 = 1; /* doesn't matter */
+	setup_spdif_playback(cm, substream, 1, do_ac3);
 	return snd_cmipci_pcm_prepare(cm, &cm->channel[CM_CH_PLAY], substream);
 }
 
@@ -1768,8 +1386,9 @@ static snd_pcm_hardware_t snd_cmipci_playback2 =
 /* spdif playback on channel A */
 static snd_pcm_hardware_t snd_cmipci_playback_spdif =
 {
-	.info =			(SNDRV_PCM_INFO_INTERLEAVED |
-				 SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE),
+	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+				 SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
+				 SNDRV_PCM_INFO_MMAP_VALID),
 	.formats =		SNDRV_PCM_FMTBIT_S16_LE,
 	.rates =		SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
 	.rate_min =		44100,
@@ -1784,6 +1403,26 @@ static snd_pcm_hardware_t snd_cmipci_playback_spdif =
 	.fifo_size =		0,
 };
 
+/* spdif playback on channel A (32bit, IEC958 subframes) */
+static snd_pcm_hardware_t snd_cmipci_playback_iec958_subframe =
+{
+	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+				 SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
+				 SNDRV_PCM_INFO_MMAP_VALID),
+	.formats =		SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE,
+	.rates =		SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
+	.rate_min =		44100,
+	.rate_max =		48000,
+	.channels_min =		2,
+	.channels_max =		2,
+	.buffer_bytes_max =	(128*1024),
+	.period_bytes_min =	64,
+	.period_bytes_max =	(128*1024),
+	.periods_min =		2,
+	.periods_max =		1024,
+	.fifo_size =		0,
+};
+
 /* spdif capture on channel B */
 static snd_pcm_hardware_t snd_cmipci_capture_spdif =
 {
@@ -1921,13 +1560,13 @@ static int snd_cmipci_playback_spdif_open(snd_pcm_substream_t *substream)
 
 	if ((err = open_device_check(cm, CM_OPEN_SPDIF_PLAYBACK, substream)) < 0) /* use channel A */
 		return err;
-	runtime->hw = snd_cmipci_playback_spdif;
-#ifdef DO_SOFT_AC3
-	if (cm->can_ac3_hw)
-#endif
-		runtime->hw.info |= SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID;
-	if (cm->chip_version >= 37)
-		runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE;
+	if (cm->can_ac3_hw) {
+		runtime->hw = snd_cmipci_playback_spdif;
+		if (cm->chip_version >= 37)
+			runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE;
+	} else {
+		runtime->hw = snd_cmipci_playback_iec958_subframe;
+	}
 	snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x40000);
 	cm->dig_pcm_status = cm->dig_status;
 	return 0;
@@ -2034,21 +1673,6 @@ static snd_pcm_ops_t snd_cmipci_playback_spdif_ops = {
 	.pointer =	snd_cmipci_playback_pointer,
 };
 
-#ifdef DO_SOFT_AC3
-static snd_pcm_ops_t snd_cmipci_playback_spdif_soft_ops = {
-	.open =		snd_cmipci_playback_spdif_open,
-	.close =	snd_cmipci_playback_spdif_close,
-	.ioctl =	snd_pcm_lib_ioctl,
-	.hw_params =	snd_cmipci_hw_params,
-	.hw_free =	snd_cmipci_playback_hw_free,
-	.prepare =	snd_cmipci_playback_spdif_prepare,	/* set up rate */
-	.trigger =	snd_cmipci_playback_trigger,
-	.pointer =	snd_cmipci_playback_pointer,
-	.copy =		snd_cmipci_ac3_copy,
-	.silence =	snd_cmipci_ac3_silence,
-};
-#endif
-
 static snd_pcm_ops_t snd_cmipci_capture_spdif_ops = {
 	.open =		snd_cmipci_capture_spdif_open,
 	.close =	snd_cmipci_capture_spdif_close,
@@ -2125,14 +1749,7 @@ static int __devinit snd_cmipci_pcm_spdif_new(cmipci_t *cm, int device)
 	if (err < 0)
 		return err;
 
-#ifdef DO_SOFT_AC3
-	if (cm->can_ac3_hw)
-		snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cmipci_playback_spdif_ops);
-	else
-		snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cmipci_playback_spdif_soft_ops);
-#else
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cmipci_playback_spdif_ops);
-#endif
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cmipci_capture_spdif_ops);
 
 	pcm->private_data = cm;
@@ -2770,16 +2387,17 @@ static int __devinit snd_cmipci_mixer_new(cmipci_t *cm, int pcm_spdif_device)
 			if (err < 0)
 				return err;
 		}
-		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_default, cm))) < 0)
-			return err;
-		kctl->id.device = pcm_spdif_device;
-		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_mask, cm))) < 0)
-			return err;
-		kctl->id.device = pcm_spdif_device;
-		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_stream, cm))) < 0)
-			return err;
-		kctl->id.device = pcm_spdif_device;
-		cm->spdif_pcm_ctl = kctl;
+		if (cm->can_ac3_hw) {
+			if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_default, cm))) < 0)
+				return err;
+			kctl->id.device = pcm_spdif_device;
+			if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_mask, cm))) < 0)
+				return err;
+			kctl->id.device = pcm_spdif_device;
+			if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_cmipci_spdif_stream, cm))) < 0)
+				return err;
+			kctl->id.device = pcm_spdif_device;
+		}
 		if (cm->chip_version <= 37) {
 			sw = snd_cmipci_old_mixer_switches;
 			for (idx = 0; idx < num_controls(snd_cmipci_old_mixer_switches); idx++, sw++) {
@@ -2917,6 +2535,8 @@ static void __devinit query_chip(cmipci_t *cm)
 	if (cm->can_multi_ch)
 		sprintf(cm->card->driver + strlen(cm->card->driver),
 			"-MC%d", cm->max_channels);
+	else if (cm->can_ac3_sw)
+		strcpy(cm->card->driver + strlen(cm->card->driver), "-SWIEC");
 }
 
 
@@ -3013,9 +2633,7 @@ static int __devinit snd_cmipci_create(snd_card_t *card, struct pci_dev *pci,
 
 	cm->chip_version = 0;
 	cm->max_channels = 2;
-#ifdef DO_SOFT_AC3
 	cm->do_soft_ac3 = soft_ac3[dev];
-#endif
 
 	query_chip(cm);
 
@@ -3264,15 +2882,7 @@ static struct pci_driver driver = {
 	
 static int __init alsa_card_cmipci_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "C-Media PCI soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_cmipci_exit(void)
@@ -3282,34 +2892,3 @@ static void __exit alsa_card_cmipci_exit(void)
 
 module_init(alsa_card_cmipci_init)
 module_exit(alsa_card_cmipci_exit)
-
-#ifndef MODULE
-
-/* format is: snd-cmipci=enable,index,id,
-			 mpu_port,fm_port,soft_ac3,joystick_port */
-
-static int __init alsa_card_cmipci_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2
-#ifdef DO_SOFT_AC3
-	       && get_option(&str,&soft_ac3[nr_dev]) == 2
-#endif
-#ifdef SUPPORT_JOYSTICK
-	       && get_option(&str,&joystick_port[nr_dev]) == 2
-#endif
-	       );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-cmipci=", alsa_card_cmipci_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index 6be207b95..91a60417e 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -27,13 +27,13 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
 #include <sound/ac97_codec.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 
@@ -47,17 +47,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
 static int dual_codec[SNDRV_CARDS];	/* dual codec */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for CS4281 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for CS4281 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable CS4281 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(dual_codec, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dual_codec, bool, boot_devs, 0444);
 MODULE_PARM_DESC(dual_codec, "Secondary Codec ID (0 = disabled).");
 MODULE_PARM_SYNTAX(dual_codec, SNDRV_ENABLED ",allows:{{0,3}}");
 
@@ -1184,7 +1185,7 @@ static void snd_cs4281_proc_read(snd_info_entry_t *entry,
 }
 
 static long snd_cs4281_BA0_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char *buf, long count)
+				struct file *file, char __user *buf, long count)
 {
 	long size;
 	cs4281_t *chip = snd_magic_cast(cs4281_t, entry->private_data, return -ENXIO);
@@ -1201,7 +1202,7 @@ static long snd_cs4281_BA0_read(snd_info_entry_t *entry, void *file_private_data
 }
 
 static long snd_cs4281_BA1_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char *buf, long count)
+				struct file *file, char __user *buf, long count)
 {
 	long size;
 	cs4281_t *chip = snd_magic_cast(cs4281_t, entry->private_data, return -ENXIO);
@@ -1395,7 +1396,8 @@ static int snd_cs4281_dev_free(snd_device_t *device)
 
 static int snd_cs4281_chip_init(cs4281_t *chip); /* defined below */
 #ifdef CONFIG_PM
-static int snd_cs4281_set_power_state(snd_card_t *card, unsigned int power_state);
+static int cs4281_suspend(snd_card_t *card, unsigned int state);
+static int cs4281_resume(snd_card_t *card, unsigned int state);
 #endif
 
 static int __devinit snd_cs4281_create(snd_card_t * card,
@@ -1461,10 +1463,7 @@ static int __devinit snd_cs4281_create(snd_card_t * card,
 
 	snd_cs4281_proc_init(chip);
 
-#ifdef CONFIG_PM
-	card->set_power_state = snd_cs4281_set_power_state;
-	card->power_state_private_data = chip;
-#endif
+	snd_card_set_pm_callback(card, cs4281_suspend, cs4281_resume, chip);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
 		snd_cs4281_free(chip);
@@ -1481,7 +1480,9 @@ static int snd_cs4281_chip_init(cs4281_t *chip)
 {
 	unsigned int tmp;
 	int timeout;
+	int retry_count = 2;
 
+      __retry:
 	tmp = snd_cs4281_peekBA0(chip, BA0_CFLR);
 	if (tmp != BA0_CFLR_DEFAULT) {
 		snd_cs4281_pokeBA0(chip, BA0_CFLR, BA0_CFLR_DEFAULT);
@@ -1629,6 +1630,8 @@ static int snd_cs4281_chip_init(cs4281_t *chip)
 		snd_cs4281_delay_long();
 	} while (timeout-- > 0);
 
+	if (--retry_count > 0)
+		goto __retry;
 	snd_printk(KERN_ERR "never read ISV3 and ISV4 from AC'97\n");
 	return -EIO;
 
@@ -1999,15 +2002,14 @@ static int __devinit snd_cs4281_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_cs4281_remove(struct pci_dev *pci)
 {
-	cs4281_t *chip = pci_get_drvdata(pci);
-	snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -2036,17 +2038,19 @@ static int saved_regs[SUSPEND_REGISTERS] = {
 
 #define CLKCR1_CKRA                             0x00010000L
 
-static void cs4281_suspend(cs4281_t *chip)
+static int cs4281_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	cs4281_t *chip = snd_magic_cast(cs4281_t, card->pm_private_data, return -EINVAL);
 	u32 ulCLK;
 	unsigned int i;
 
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
-
 	snd_pcm_suspend_all(chip->pcm);
 
+	if (chip->ac97)
+		snd_ac97_suspend(chip->ac97);
+	if (chip->ac97_secondary)
+		snd_ac97_suspend(chip->ac97_secondary);
+
 	ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
 	ulCLK |= CLKCR1_CKRA;
 	snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
@@ -2076,17 +2080,15 @@ static void cs4281_suspend(cs4281_t *chip)
 	snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void cs4281_resume(cs4281_t *chip)
+static int cs4281_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	cs4281_t *chip = snd_magic_cast(cs4281_t, card->pm_private_data, return -EINVAL);
 	unsigned int i;
 	u32 ulCLK;
 
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
-
 	pci_enable_device(chip->pci);
 
 	ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
@@ -2110,41 +2112,8 @@ static void cs4281_resume(cs4281_t *chip)
 	snd_cs4281_pokeBA0(chip, BA0_CLKCR1, ulCLK);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_cs4281_suspend(struct pci_dev *dev, u32 state)
-{
-	cs4281_t *chip = snd_magic_cast(cs4281_t, pci_get_drvdata(dev), return -ENXIO);
-	cs4281_suspend(chip);
-	return 0;
-}
-static int snd_cs4281_resume(struct pci_dev *dev)
-{
-	cs4281_t *chip = snd_magic_cast(cs4281_t, pci_get_drvdata(dev), return -ENXIO);
-	cs4281_resume(chip);
 	return 0;
 }
-
-/* callback */
-static int snd_cs4281_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	cs4281_t *chip = snd_magic_cast(cs4281_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		cs4281_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		cs4281_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 #endif /* CONFIG_PM */
 
 static struct pci_driver driver = {
@@ -2152,23 +2121,12 @@ static struct pci_driver driver = {
 	.id_table = snd_cs4281_ids,
 	.probe = snd_cs4281_probe,
 	.remove = __devexit_p(snd_cs4281_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_cs4281_suspend,
-	.resume = snd_cs4281_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 	
 static int __init alsa_card_cs4281_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "CS4281 soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_cs4281_exit(void)
@@ -2178,24 +2136,3 @@ static void __exit alsa_card_cs4281_exit(void)
 
 module_init(alsa_card_cs4281_init)
 module_exit(alsa_card_cs4281_exit)
-
-#ifndef MODULE
-
-/* format is: snd-cs4281=enable,index,id */
-
-static int __init alsa_card_cs4281_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-cs4281=", alsa_card_cs4281_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index 52673bd3b..8b63705c4 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -29,9 +29,9 @@
 #include <linux/pci.h>
 #include <linux/time.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/cs46xx.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -52,23 +52,24 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card *
 static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 static int thinkpad[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for the CS46xx soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable CS46xx soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(external_amp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(external_amp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(external_amp, "Force to enable external amplifer.");
 MODULE_PARM_SYNTAX(external_amp, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
-MODULE_PARM(thinkpad, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(thinkpad, bool, boot_devs, 0444);
 MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
 MODULE_PARM_SYNTAX(thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
-MODULE_PARM(mmap_valid, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mmap_valid, bool, boot_devs, 0444);
 MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
 MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
 
@@ -157,31 +158,14 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int snd_card_cs46xx_suspend(struct pci_dev *pci, u32 state)
-{
-	cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return -ENXIO);
-	snd_cs46xx_suspend(chip);
-	return 0;
-}
-static int snd_card_cs46xx_resume(struct pci_dev *pci)
-{
-	cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return -ENXIO);
-	snd_cs46xx_resume(chip);
-	return 0;
-}
-#endif
-
 static void __devexit snd_card_cs46xx_remove(struct pci_dev *pci)
 {
-	cs46xx_t *chip = snd_magic_cast(cs46xx_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -190,23 +174,12 @@ static struct pci_driver driver = {
 	.id_table = snd_cs46xx_ids,
 	.probe = snd_card_cs46xx_probe,
 	.remove = __devexit_p(snd_card_cs46xx_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_card_cs46xx_suspend,
-	.resume = snd_card_cs46xx_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 
 static int __init alsa_card_cs46xx_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Sound Fusion CS46xx soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_cs46xx_exit(void)
@@ -216,27 +189,3 @@ static void __exit alsa_card_cs46xx_exit(void)
 
 module_init(alsa_card_cs46xx_init)
 module_exit(alsa_card_cs46xx_exit)
-
-#ifndef MODULE
-
-/* format is: snd-cs46xx=enable,index,id,mmap_valid,external_amp,thinkpad */
-
-static int __init alsa_card_cs46xx_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&mmap_valid[nr_dev]) == 2 &&
-	       get_option(&str,&external_amp[nr_dev]) == 2 &&
-	       get_option(&str,&thinkpad[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-cs46xx=", alsa_card_cs46xx_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index e4ea90cd3..9a1758396 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -2866,7 +2866,7 @@ void __devinit snd_cs46xx_gameport(cs46xx_t *chip)
  */
 
 static long snd_cs46xx_io_read(snd_info_entry_t *entry, void *file_private_data,
-			       struct file *file, char *buf, long count)
+			       struct file *file, char __user *buf, long count)
 {
 	long size;
 	snd_cs46xx_region_t *region = (snd_cs46xx_region_t *)entry->private_data;
@@ -3784,17 +3784,19 @@ static struct cs_card_type __devinitdata cards[] = {
  * APM support
  */
 #ifdef CONFIG_PM
-void snd_cs46xx_suspend(cs46xx_t *chip)
+static int snd_cs46xx_suspend(snd_card_t *card, unsigned int state)
 {
+	cs46xx_t *chip = snd_magic_cast(cs46xx_t, card->pm_private_data, return -EINVAL);
 	int amp_saved;
 
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
 	snd_pcm_suspend_all(chip->pcm);
 	// chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL);
 	// chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE);
+
+	snd_ac97_suspend(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]);
+	if (chip->ac97[CS46XX_SECONDARY_CODEC_INDEX])
+		snd_ac97_suspend(chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]);
+
 	amp_saved = chip->amplifier;
 	/* turn off amp */
 	chip->amplifier_ctrl(chip, -chip->amplifier);
@@ -3803,16 +3805,14 @@ void snd_cs46xx_suspend(cs46xx_t *chip)
 	chip->active_ctrl(chip, -chip->amplifier);
 	chip->amplifier = amp_saved; /* restore the status */
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-void snd_cs46xx_resume(cs46xx_t *chip)
+static int snd_cs46xx_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	cs46xx_t *chip = snd_magic_cast(cs46xx_t, card->pm_private_data, return -EINVAL);
 	int amp_saved;
 
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
-
 	pci_enable_device(chip->pci);
 	amp_saved = chip->amplifier;
 	chip->amplifier = 0;
@@ -3832,6 +3832,8 @@ void snd_cs46xx_resume(cs46xx_t *chip)
 #endif
 
 	snd_ac97_resume(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]);
+	if (chip->ac97[CS46XX_SECONDARY_CODEC_INDEX])
+		snd_ac97_resume(chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]);
 
 	if (amp_saved)
 		chip->amplifier_ctrl(chip, 1); /* turn amp on */
@@ -3839,25 +3841,6 @@ void snd_cs46xx_resume(cs46xx_t *chip)
 		chip->active_ctrl(chip, -1); /* disable CLKRUN */
 	chip->amplifier = amp_saved;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_cs46xx_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	cs46xx_t *chip = snd_magic_cast(cs46xx_t, card->power_state_private_data, return -ENXIO);
-
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_cs46xx_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_cs46xx_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
 	return 0;
 }
 #endif /* CONFIG_PM */
@@ -4010,10 +3993,7 @@ int __devinit snd_cs46xx_create(snd_card_t * card,
 
 	snd_cs46xx_proc_init(card, chip);
 
-#ifdef CONFIG_PM
-	card->set_power_state = snd_cs46xx_set_power_state;
-	card->power_state_private_data = chip;
-#endif
+	snd_card_set_pm_callback(card, snd_cs46xx_suspend, snd_cs46xx_resume, chip);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
 		snd_cs46xx_free(chip);
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 16943f5c2..552bdee31 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -23,9 +23,9 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/emu10k1.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -49,32 +49,33 @@ static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
 static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64};
 static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};
 static int enable_ir[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for the EMU10K1 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable the EMU10K1 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(extin, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(extin, int, boot_devs, 0444);
 MODULE_PARM_DESC(extin, "Available external inputs for FX8010. Zero=default.");
 MODULE_PARM_SYNTAX(extin, SNDRV_ENABLED "allows:{{0,0x0ffff}},base:16");
-MODULE_PARM(extout, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(extout, int, boot_devs, 0444);
 MODULE_PARM_DESC(extout, "Available external outputs for FX8010. Zero=default.");
 MODULE_PARM_SYNTAX(extout, SNDRV_ENABLED "allows:{{0,0x0ffff}},base:16");
-MODULE_PARM(seq_ports, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(seq_ports, int, boot_devs, 0444);
 MODULE_PARM_DESC(seq_ports, "Allocated sequencer ports for internal synthesizer.");
 MODULE_PARM_SYNTAX(seq_ports, SNDRV_ENABLED "allows:{{0,32}}");
-MODULE_PARM(max_synth_voices, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(max_synth_voices, int, boot_devs, 0444);
 MODULE_PARM_DESC(max_synth_voices, "Maximum number of voices for WaveTable.");
 MODULE_PARM_SYNTAX(max_synth_voices, SNDRV_ENABLED);
-MODULE_PARM(max_buffer_size, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(max_buffer_size, int, boot_devs, 0444);
 MODULE_PARM_DESC(max_buffer_size, "Maximum sample buffer size in MB.");
 MODULE_PARM_SYNTAX(max_buffer_size, SNDRV_ENABLED);
-MODULE_PARM(enable_ir, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable_ir, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable_ir, "Enable IR.");
 MODULE_PARM_SYNTAX(enable_ir, SNDRV_ENABLE_DESC);
 
@@ -211,15 +212,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_emu10k1_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "EMU10K1/Audigy soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_emu10k1_exit(void)
@@ -229,27 +222,3 @@ static void __exit alsa_card_emu10k1_exit(void)
 
 module_init(alsa_card_emu10k1_init)
 module_exit(alsa_card_emu10k1_exit)
-
-#ifndef MODULE
-
-/* format is: snd-emu10k1=enable,index,id,
-			  seq_ports,max_synth_voices */
-
-static int __init alsa_card_emu10k1_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&seq_ports[nr_dev]) == 2 &&
-	       get_option(&str,&max_synth_voices[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-emu10k1=", alsa_card_emu10k1_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 20e765abb..9f4c8b359 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -690,7 +690,7 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
 	if (extin_mask == 0)
 		extin_mask = 0x3fcf;
 	if (extout_mask == 0)
-		extout_mask = 0x1fff;
+		extout_mask = 0x7fff;
 	emu->fx8010.extin_mask = extin_mask;
 	emu->fx8010.extout_mask = extout_mask;
 
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index d0f3264d9..c4f763000 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -120,8 +120,8 @@ static char *creative_outs[32] = {
 	/* 0x0a */ "PCM Capture Left",
 	/* 0x0b */ "PCM Capture Right",
 	/* 0x0c */ "MIC Capture",
-	/* 0x0d */ NULL,
-	/* 0x0e */ NULL,
+	/* 0x0d */ "AC97 Surround Left",
+	/* 0x0e */ "AC97 Surround Right",
 	/* 0x0f */ NULL,
 	/* 0x10 */ NULL,
 	/* 0x11 */ "Analog Center",
@@ -898,8 +898,10 @@ static snd_emu10k1_fx8010_ctl_t *snd_emu10k1_look_for_ctl(emu10k1_t *emu, snd_ct
 static int snd_emu10k1_verify_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
 {
 	unsigned int i;
-	snd_ctl_elem_id_t *_id, id;
-	emu10k1_fx8010_control_gpr_t *_gctl, gctl;
+	snd_ctl_elem_id_t __user *_id;
+	snd_ctl_elem_id_t id;
+	emu10k1_fx8010_control_gpr_t __user *_gctl;
+	emu10k1_fx8010_control_gpr_t gctl;
 	
 	for (i = 0, _id = icode->gpr_del_controls;
 	     i < icode->gpr_del_control_count; i++, _id++) {
@@ -946,7 +948,8 @@ static void snd_emu10k1_ctl_private_free(snd_kcontrol_t *kctl)
 static void snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
 {
 	unsigned int i, j;
-	emu10k1_fx8010_control_gpr_t *_gctl, gctl;
+	emu10k1_fx8010_control_gpr_t __user *_gctl;
+	emu10k1_fx8010_control_gpr_t gctl;
 	snd_emu10k1_fx8010_ctl_t *ctl, nctl;
 	snd_kcontrol_new_t knew;
 	snd_kcontrol_t *kctl;
@@ -1012,7 +1015,8 @@ static void snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icod
 static void snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
 {
 	unsigned int i;
-	snd_ctl_elem_id_t *_id, id;
+	snd_ctl_elem_id_t id;
+	snd_ctl_elem_id_t __user *_id;
 	snd_emu10k1_fx8010_ctl_t *ctl;
 	snd_card_t *card = emu->card;
 	
@@ -1031,7 +1035,8 @@ static int snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icod
 {
 	unsigned int i = 0, j;
 	unsigned int total = 0;
-	emu10k1_fx8010_control_gpr_t *_gctl, gctl;
+	emu10k1_fx8010_control_gpr_t gctl;
+	emu10k1_fx8010_control_gpr_t __user *_gctl;
 	snd_emu10k1_fx8010_ctl_t *ctl;
 	snd_ctl_elem_id_t *id;
 	struct list_head *list;
@@ -2113,22 +2118,26 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
 		for (z = 0; z < 2; z++)
 			OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_REAR_L + z), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 2 + z), C_00000000, C_00000000);
 
-	if (emu->fx8010.extout_mask & (1<<EXTOUT_CENTER)) {
+	if (emu->fx8010.extout_mask & ((1<<EXTOUT_AC97_REAR_L)|(1<<EXTOUT_AC97_REAR_R)))
+		for (z = 0; z < 2; z++)
+			OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_REAR_L + z), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 2 + z), C_00000000, C_00000000);
+
+	if (emu->fx8010.extout_mask & (1<<EXTOUT_AC97_CENTER)) {
 #ifndef EMU10K1_CENTER_LFE_FROM_FRONT
-		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), C_00000000, C_00000000);
+		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), C_00000000, C_00000000);
 		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ACENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), C_00000000, C_00000000);
 #else
-		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 0), C_00000000, C_00000000);
+		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 0), C_00000000, C_00000000);
 		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ACENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 0), C_00000000, C_00000000);
 #endif
 	}
 
-	if (emu->fx8010.extout_mask & (1<<EXTOUT_LFE)) {
+	if (emu->fx8010.extout_mask & (1<<EXTOUT_AC97_LFE)) {
 #ifndef EMU10K1_CENTER_LFE_FROM_FRONT
-		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), C_00000000, C_00000000);
+		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), C_00000000, C_00000000);
 		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ALFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), C_00000000, C_00000000);
 #else
-		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
+		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
 		OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ALFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
 #endif
 	}
@@ -2293,6 +2302,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 	emu10k1_fx8010_code_t *icode;
 	emu10k1_fx8010_pcm_t *ipcm;
 	unsigned int addr;
+	void __user *argp = (void __user *)arg;
 	int res;
 	
 	switch (cmd) {
@@ -2304,7 +2314,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 			kfree(info);
 			return res;
 		}
-		if (copy_to_user((void *)arg, info, sizeof(*info))) {
+		if (copy_to_user(argp, info, sizeof(*info))) {
 			kfree(info);
 			return -EFAULT;
 		}
@@ -2316,7 +2326,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 		icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL);
 		if (icode == NULL)
 			return -ENOMEM;
-		if (copy_from_user(icode, (void *)arg, sizeof(*icode))) {
+		if (copy_from_user(icode, argp, sizeof(*icode))) {
 			kfree(icode);
 			return -EFAULT;
 		}
@@ -2327,12 +2337,12 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 		icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL);
 		if (icode == NULL)
 			return -ENOMEM;
-		if (copy_from_user(icode, (void *)arg, sizeof(*icode))) {
+		if (copy_from_user(icode, argp, sizeof(*icode))) {
 			kfree(icode);
 			return -EFAULT;
 		}
 		res = snd_emu10k1_icode_peek(emu, icode);
-		if (res == 0 && copy_to_user((void *)arg, icode, sizeof(*icode))) {
+		if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) {
 			kfree(icode);
 			return -EFAULT;
 		}
@@ -2344,7 +2354,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 		ipcm = (emu10k1_fx8010_pcm_t *)kmalloc(sizeof(*ipcm), GFP_KERNEL);
 		if (ipcm == NULL)
 			return -ENOMEM;
-		if (copy_from_user(ipcm, (void *)arg, sizeof(*ipcm))) {
+		if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
 			kfree(ipcm);
 			return -EFAULT;
 		}
@@ -2357,12 +2367,12 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 		ipcm = (emu10k1_fx8010_pcm_t *)snd_kcalloc(sizeof(*ipcm), GFP_KERNEL);
 		if (ipcm == NULL)
 			return -ENOMEM;
-		if (copy_from_user(ipcm, (void *)arg, sizeof(*ipcm))) {
+		if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
 			kfree(ipcm);
 			return -EFAULT;
 		}
 		res = snd_emu10k1_ipcm_peek(emu, ipcm);
-		if (res == 0 && copy_to_user((void *)arg, ipcm, sizeof(*ipcm))) {
+		if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) {
 			kfree(ipcm);
 			return -EFAULT;
 		}
@@ -2373,7 +2383,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 			return -EINVAL;
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
-		if (get_user(addr, (unsigned int *)arg))
+		if (get_user(addr, (unsigned int __user *)argp))
 			return -EFAULT;
 		down(&emu->fx8010.lock);
 		res = snd_emu10k1_fx8010_tram_setup(emu, addr);
@@ -2411,7 +2421,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 	case SNDRV_EMU10K1_IOCTL_SINGLE_STEP:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
-		if (get_user(addr, (unsigned int *)arg))
+		if (get_user(addr, (unsigned int __user *)argp))
 			return -EFAULT;
 		if (addr > 0x1ff)
 			return -EINVAL;
@@ -2430,7 +2440,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
 			addr = snd_emu10k1_ptr_read(emu, A_DBG, 0);
 		else
 			addr = snd_emu10k1_ptr_read(emu, DBG, 0);
-		if (put_user(addr, (unsigned int *)arg))
+		if (put_user(addr, (unsigned int __user *)argp))
 			return -EFAULT;
 		return 0;
 	}
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index bdb567089..45692f56a 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -34,6 +34,8 @@
 
 #define chip_t emu10k1_t
 
+#define AC97_ID_STAC9758	0x83847658
+
 static int snd_emu10k1_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
@@ -531,6 +533,15 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
 			snd_ac97_write(emu->ac97, AC97_REC_SEL, 0x0000);
 			c = audigy_remove_ctls;
 		} else {
+			/*
+			 * Credits for cards based on STAC9758:
+			 *   James Courtier-Dutton <James@superbug.demon.co.uk>
+			 *   Voluspa <voluspa@comhem.se>
+			 */
+			if (emu->ac97->id == AC97_ID_STAC9758) {
+				emu->rear_ac97 = 1;
+				snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE|AC97SLOT_REAR_LEFT|AC97SLOT_REAR_RIGHT);
+			}
 			/* remove unused AC97 controls */
 			snd_ac97_write(emu->ac97, AC97_SURROUND_MASTER, 0x0202);
 			snd_ac97_write(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202);
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 918bc688a..39f5307e2 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -191,7 +191,7 @@ static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry,
 #define TOTAL_SIZE_CODE		(0x200*8)
 
 static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_data,
-				    struct file *file, char *buf, long count)
+				    struct file *file, char __user *buf, long count)
 {
 	long size;
 	emu10k1_t *emu = snd_magic_cast(emu10k1_t, entry->private_data, return -ENXIO);
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index ff4c797c0..43e23d10c 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -27,6 +27,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -36,7 +37,6 @@
 #else
 #include <sound/ak4531_codec.h>
 #endif
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/asoundef.h>
 
@@ -86,23 +86,24 @@ static int joystick_port[SNDRV_CARDS];
 static int joystick[SNDRV_CARDS];
 #endif
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Ensoniq AudioPCI soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Ensoniq AudioPCI soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #ifdef SUPPORT_JOYSTICK
 #ifdef CHIP1371
-MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick_port, int, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_port, "Joystick port address.");
 MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{1},{0x200},{0x208},{0x210},{0x218}},dialog:list");
 #else
-MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick, bool, boot_devs, 0444);
 MODULE_PARM_DESC(joystick, "Enable joystick.");
 MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 #endif
@@ -2371,15 +2372,7 @@ static struct pci_driver driver = {
 	
 static int __init alsa_card_ens137x_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Ensoniq AudioPCI soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_ens137x_exit(void)
@@ -2389,36 +2382,3 @@ static void __exit alsa_card_ens137x_exit(void)
 
 module_init(alsa_card_ens137x_init)
 module_exit(alsa_card_ens137x_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ens1370=enable,index,id,joystick */
-
-static int __init alsa_card_ens137x_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2
-#ifdef SUPPORT_JOYSTICK
-#ifdef CHIP1371
-	       && get_option(&str,&joystick_port[nr_dev]) == 2
-#else
-	       && get_option(&str,&joystick[nr_dev]) == 2
-#endif
-#endif
-	       );
-	nr_dev++;
-	return 1;
-}
-
-#if defined(CHIP1370)
-__setup("snd-ens1370=", alsa_card_ens137x_setup);
-#elif defined(CHIP1371)
-__setup("snd-ens1371=", alsa_card_ens137x_setup);
-#endif
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 1b14501d5..87afa49a0 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -53,12 +53,12 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/opl3.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -84,14 +84,15 @@ MODULE_DEVICES("{{ESS,ES1938},"
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ESS Solo-1 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ESS Solo-1 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ESS Solo-1 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 
@@ -821,7 +822,7 @@ static snd_pcm_uframes_t snd_es1938_playback_pointer(snd_pcm_substream_t *substr
 static int snd_es1938_capture_copy(snd_pcm_substream_t *substream,
 				   int channel,
 				   snd_pcm_uframes_t pos,
-				   void *dst,
+				   void __user *dst,
 				   snd_pcm_uframes_t count)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
@@ -835,7 +836,7 @@ static int snd_es1938_capture_copy(snd_pcm_substream_t *substream,
 	} else {
 		if (copy_to_user(dst, runtime->dma_area + pos + 1, count - 1))
 			return -EFAULT;
-		if (put_user(runtime->dma_area[0], ((unsigned char *)dst) + count - 1))
+		if (put_user(runtime->dma_area[0], ((unsigned char __user *)dst) + count - 1))
 			return -EFAULT;
 	}
 	return 0;
@@ -1700,15 +1701,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_es1938_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ESS Solo-1 soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_es1938_exit(void)
@@ -1718,24 +1711,3 @@ static void __exit alsa_card_es1938_exit(void)
 
 module_init(alsa_card_es1938_init)
 module_exit(alsa_card_es1938_exit)
-
-#ifndef MODULE
-
-/* format is: snd-es1938=enable,index,id */
-
-static int __init alsa_card_es1938_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-es1938=", alsa_card_es1938_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 5d335bba0..f658de44c 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -102,11 +102,11 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/mpu401.h>
 #include <sound/ac97_codec.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define chip_t es1968_t
@@ -138,36 +138,37 @@ static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
 #ifdef SUPPORT_JOYSTICK
 static int joystick[SNDRV_CARDS];
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(total_bufsize, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(total_bufsize, int, boot_devs, 0444);
 MODULE_PARM_DESC(total_bufsize, "Total buffer size in kB.");
 MODULE_PARM_SYNTAX(total_bufsize, SNDRV_ENABLED ",allows:{{1,4096}},skill:advanced");
-MODULE_PARM(pcm_substreams_p, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_substreams_p, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_substreams_p, "PCM Playback substreams for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(pcm_substreams_p, SNDRV_ENABLED ",allows:{{1,8}}");
-MODULE_PARM(pcm_substreams_c, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_substreams_c, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_substreams_c, "PCM Capture substreams for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(pcm_substreams_c, SNDRV_ENABLED ",allows:{{0,8}}");
-MODULE_PARM(clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(clock, int, boot_devs, 0444);
 MODULE_PARM_DESC(clock, "Clock on " CARD_NAME " soundcard.  (0 = auto-detect)");
 MODULE_PARM_SYNTAX(clock, SNDRV_ENABLED);
-MODULE_PARM(use_pm, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(use_pm, int, boot_devs, 0444);
 MODULE_PARM_DESC(use_pm, "Toggle power-management.  (0 = off, 1 = on, 2 = auto)");
-MODULE_PARM_SYNTAX(use_pm, SNDRV_ENABLED ",allows:{{0,1,2}},skill:advanced");
-MODULE_PARM(enable_mpu, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+MODULE_PARM_SYNTAX(use_pm, SNDRV_ENABLED ",allows:{{0,1,2}},default:2,skill:advanced");
+module_param_array(enable_mpu, int, boot_devs, 0444);
 MODULE_PARM_DESC(enable_mpu, "Enable MPU401.  (0 = off, 1 = on, 2 = auto)");
-MODULE_PARM_SYNTAX(enable_mpu, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
+MODULE_PARM_SYNTAX(enable_mpu, SNDRV_ENABLED ",allows:{{0,2}},default:2");
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick, bool, boot_devs, 0444);
 MODULE_PARM_DESC(joystick, "Enable joystick.");
 MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 #endif
@@ -2415,30 +2416,27 @@ static void snd_es1968_start_irq(es1968_t *chip)
 /*
  * PM support
  */
-static void es1968_suspend(es1968_t *chip)
+static int es1968_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	es1968_t *chip = snd_magic_cast(es1968_t, card->pm_private_data, return -EINVAL);
 
 	if (! chip->do_pm)
-		return;
-
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
+		return 0;
 
 	snd_pcm_suspend_all(chip->pcm);
+	snd_ac97_suspend(chip->ac97);
 	snd_es1968_bob_stop(chip);
+	snd_es1968_set_acpi(chip, ACPI_D3);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void es1968_resume(es1968_t *chip)
+static int es1968_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	es1968_t *chip = snd_magic_cast(es1968_t, card->pm_private_data, return -EINVAL);
 
 	if (! chip->do_pm)
-		return;
-
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+		return 0;
 
 	/* restore all our config */
 	pci_enable_device(chip->pci);
@@ -2460,47 +2458,17 @@ static void es1968_resume(es1968_t *chip)
 		snd_es1968_bob_start(chip);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_es1968_suspend(struct pci_dev *dev, u32 state)
-{
-	es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(dev), return -ENXIO);
-	es1968_suspend(chip);
 	return 0;
 }
-static int snd_es1968_resume(struct pci_dev *dev)
-{
-	es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(dev), return -ENXIO);
-	es1968_resume(chip);
-	return 0;
-}
-
-/* callback */
-static int snd_es1968_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	es1968_t *chip = snd_magic_cast(es1968_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		es1968_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		es1968_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 #endif /* CONFIG_PM */
 
 static int snd_es1968_free(es1968_t *chip)
 {
-	if (chip->res_io_port)
-		snd_es1968_reset(chip);
+	if (chip->res_io_port) {
+		synchronize_irq(chip->irq);
+		outw(1, chip->io_port + 0x04); /* clear WP interrupts */
+		outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */
+	}
 
 #ifdef SUPPORT_JOYSTICK
 	if (chip->res_joystick) {
@@ -2534,6 +2502,7 @@ struct ess_device_list {
 };
 
 static struct ess_device_list pm_whitelist[] __devinitdata = {
+	{ TYPE_MAESTRO2E, 0x0e11 },	/* Compaq Armada */
 	{ TYPE_MAESTRO2E, 0x1028 },
 	{ TYPE_MAESTRO2E, 0x103c },
 	{ TYPE_MAESTRO2E, 0x1179 },
@@ -2636,12 +2605,8 @@ static int __devinit snd_es1968_create(snd_card_t * card,
 
 	snd_es1968_chip_init(chip);
 
-#ifdef CONFIG_PM
-	if (chip->do_pm) {
-		card->set_power_state = snd_es1968_set_power_state;
-		card->power_state_private_data = chip;
-	}
-#endif
+	if (chip->do_pm)
+		snd_card_set_pm_callback(card, es1968_suspend, es1968_resume, chip);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
 		snd_es1968_free(chip);
@@ -2763,16 +2728,14 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_es1968_remove(struct pci_dev *pci)
 {
-	es1968_t *chip = snd_magic_cast(es1968_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -2781,71 +2744,18 @@ static struct pci_driver driver = {
 	.id_table = snd_es1968_ids,
 	.probe = snd_es1968_probe,
 	.remove = __devexit_p(snd_es1968_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_es1968_suspend,
-	.resume = snd_es1968_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 
 static int __init alsa_card_es1968_init(void)
 {
-	int err;
-
-        if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ESS Maestro soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_es1968_exit(void)
 {
-#if 0 // do we really need this?
-	unregister_reboot_notifier(&snd_es1968_nb);
-#endif
 	pci_unregister_driver(&driver);
 }
 
 module_init(alsa_card_es1968_init)
 module_exit(alsa_card_es1968_exit)
-
-#ifndef MODULE
-
-/* format is: snd-es1968=enable,index,id,
-			 total_bufsize,
-			 pcm_substreams_p,
-			 pcm_substreams_c,
-			 clock,
-			 use_pm,
-			 enable_mpu,
-			 joystick
-*/
-
-static int __init alsa_card_es1968_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&total_bufsize[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_substreams_p[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_substreams_c[nr_dev]) == 2 &&
-	       get_option(&str,&clock[nr_dev]) == 2 &&
-	       get_option(&str,&use_pm[nr_dev]) == 2 &&
-	       get_option(&str,&enable_mpu[nr_dev]) == 2
-#ifdef SUPPORT_JOYSTICK
-	       && get_option(&str,&joystick[nr_dev]) == 2
-#endif
-	       );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-es1968=", alsa_card_es1968_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index b4c16b33a..f21a17dda 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -25,12 +25,12 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -60,17 +60,18 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card *
  *  High 16-bits are video (radio) device number + 1
  */
 static int tea575x_tuner[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 };
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for the FM801 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for the FM801 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable FM801 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(tea575x_tuner, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(tea575x_tuner, bool, boot_devs, 0444);
 MODULE_PARM_DESC(tea575x_tuner, "Enable TEA575x tuner.");
 MODULE_PARM_SYNTAX(tea575x_tuner, SNDRV_ENABLE_DESC);
 
@@ -1482,15 +1483,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_fm801_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ForteMedia FM801 soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_fm801_exit(void)
@@ -1500,25 +1493,3 @@ static void __exit alsa_card_fm801_exit(void)
 
 module_init(alsa_card_fm801_init)
 module_exit(alsa_card_fm801_exit)
-
-#ifndef MODULE
-
-/* format is: snd-fm801=enable,index,id,tea575x_tuner */
-
-static int __init alsa_card_fm801_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&tea575x_tuner[nr_dev]));
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-fm801=", alsa_card_fm801_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/ice1712/Makefile b/sound/pci/ice1712/Makefile
index 068f6701b..f1e417ca0 100644
--- a/sound/pci/ice1712/Makefile
+++ b/sound/pci/ice1712/Makefile
@@ -5,7 +5,7 @@
 
 snd-ice17xx-ak4xxx-objs := ak4xxx.o
 snd-ice1712-objs := ice1712.o delta.o hoontech.o ews.o
-snd-ice1724-objs := ice1724.o amp.o revo.o aureon.o prodigy.o
+snd-ice1724-objs := ice1724.o amp.o revo.o aureon.o
 
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_ICE1712) += snd-ice1712.o snd-ice17xx-ak4xxx.o
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
index 0969907ab..779951725 100644
--- a/sound/pci/ice1712/amp.c
+++ b/sound/pci/ice1712/amp.c
@@ -54,10 +54,11 @@ static int __devinit snd_vt1724_amp_add_controls(ice1712_t *ice)
 /* entry point */
 struct snd_ice1712_card_info snd_vt1724_amp_cards[] __devinitdata = {
 	{
-		VT1724_SUBDEVICE_AUDIO2000,
-		"AMP Ltd AUDIO2000",
-		snd_vt1724_amp_init,
-		snd_vt1724_amp_add_controls,
+		.subvendor = VT1724_SUBDEVICE_AUDIO2000,
+		.name = "AMP Ltd AUDIO2000",
+		.model = "amp2000",
+		.chip_init = snd_vt1724_amp_init,
+		.build_controls = snd_vt1724_amp_add_controls,
 	},
 	{ } /* terminator */
 };
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index 6e8be2406..a182b8b27 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -38,6 +38,25 @@
  *   the analog mixing but not easily controllable (it's not connected
  *   directly from envy24ht chip).  so let's leave it as it is.
  *
+ *
+ *   Lowlevel functions for AudioTrak Prodigy 7.1 (and possibly 192) cards
+ *      Copyright (c) 2003 Dimitromanolakis Apostolos <apostol@cs.utoronto.ca>
+ *
+ *   version 0.82: Stable / not all features work yet (no communication with AC97 secondary)
+ *       added 64x/128x oversampling switch (should be 64x only for 96khz)
+ *       fixed some recording labels (still need to check the rest)
+ *       recording is working probably thanks to correct wm8770 initialization
+ *
+ *   version 0.5: Initial release:
+ *           working: analog output, mixer, headphone amplifier switch
+ *       not working: prety much everything else, at least i could verify that
+ *                    we have no digital output, no capture, pretty bad clicks and poops
+ *                    on mixer switch and other coll stuff.
+ *
+ * - Prodigy boards are equipped with AC97 STAC9744 chip , too.  it's used to do
+ *   the analog mixing but not easily controllable (it's not connected
+ *   directly from envy24ht chip).  so let's leave it as it is.
+ *
  */      
 
 #include <sound/driver.h>
@@ -77,12 +96,18 @@
 static void aureon_spi_write(ice1712_t *ice, unsigned int cs, unsigned int data, int bits)
 {
 	unsigned int tmp;
+	unsigned int cscs;
 	int i;
 
 	tmp = snd_ice1712_gpio_read(ice);
 
+	if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71)
+		cscs = PRODIGY_CS8415_CS;
+	else
+		cscs = AUREON_CS8415_CS;
+
 	snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RW|AUREON_WM_DATA|AUREON_WM_CLK|
-					 AUREON_WM_CS|AUREON_CS8415_CS));
+					 AUREON_WM_CS|cscs));
 	tmp |= AUREON_WM_RW;
 	tmp &= ~cs;
 	snd_ice1712_gpio_write(ice, tmp);
@@ -134,6 +159,47 @@ static void wm_put(ice1712_t *ice, int reg, unsigned short val)
 	ice->akm[0].images[reg + 1] = val;
 }
 
+/*
+ * DAC mute control
+ */
+static int wm_dac_mute_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int wm_dac_mute_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	down(&ice->gpio_mutex);
+	val = wm_get(ice, snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)+WM_MUTE);
+	ucontrol->value.integer.value[0] = ~val>>4 & 0x1;
+	up(&ice->gpio_mutex);
+	return 0;
+}
+
+static int wm_dac_mute_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	unsigned short new, old;
+	int change;
+
+	snd_ice1712_save_gpio_status(ice);
+	old = wm_get(ice, snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)+WM_MUTE);
+	new = (~ucontrol->value.integer.value[0]<<4&0x10) | (old&~0x10);
+	change = (new != old);
+	if (change)
+		wm_put(ice, snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)+WM_MUTE, new);
+	snd_ice1712_restore_gpio_status(ice);
+
+	return change;
+}
+
 /*
  * DAC volume attenuation mixer control
  */
@@ -191,6 +257,47 @@ static int wm_dac_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr
 	return change;
 }
 
+/*
+ * ADC mute control
+ */
+static int wm_adc_mute_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int wm_adc_mute_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	unsigned short val;
+
+	down(&ice->gpio_mutex);
+	val = wm_get(ice, snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)+WM_ADC_GAIN);
+	ucontrol->value.integer.value[0] = ~val>>5 & 0x1;
+	up(&ice->gpio_mutex);
+	return 0;
+}
+
+static int wm_adc_mute_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	unsigned short new, old;
+	int change;
+
+	snd_ice1712_save_gpio_status(ice);
+	old = wm_get(ice, snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)+WM_ADC_GAIN);
+	new = (~ucontrol->value.integer.value[0]<<5&0x20) | (old&~0x20);
+	change = (new != old);
+	if (change)
+		wm_put(ice, snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)+WM_ADC_GAIN, new);
+	snd_ice1712_restore_gpio_status(ice);
+
+	return change;
+}
+
 /*
  * ADC gain mixer control
  */
@@ -227,10 +334,10 @@ static int wm_adc_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr
 	snd_ice1712_save_gpio_status(ice);
 	idx  = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) + WM_ADC_GAIN;
 	nvol = ucontrol->value.integer.value[0];
-	ovol = wm_get(ice, idx) & 0x1f;
-	change = (ovol != nvol);
+	ovol = wm_get(ice, idx);
+	change = ((ovol & 0x1f)  != nvol);
 	if (change)
-		wm_put(ice, idx, nvol);
+		wm_put(ice, idx, nvol | (ovol & ~0x1f));
 	snd_ice1712_restore_gpio_status(ice);
 	return change;
 }
@@ -241,18 +348,15 @@ static int wm_adc_vol_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr
 static int wm_adc_mux_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
 {
 	static char *texts[] = {
-		"CD Left",
-		"CD Right",
-		"Aux Left",
-		"Aux Right",
-		"Line Left",
-		"Line Right",
-		"Mic Left",
-		"Mic Right",
+		"CD",		//AIN1
+		"Aux",		//AIN2
+		"Line",		//AIN3
+		"Mic",		//AIN4
+		"AC97"		//AIN5
 	};
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-	uinfo->count = 2;
-	uinfo->value.enumerated.items = 8;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 5;
 	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
 		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
 	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -290,6 +394,127 @@ static int wm_adc_mux_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucont
 	return 0;
 }
 
+/*
+ * Headphone Amplifier
+ */
+static int aureon_set_headphone_amp(ice1712_t *ice, int enable)
+{
+	unsigned int tmp, tmp2;
+
+	tmp2 = tmp = snd_ice1712_gpio_read(ice);
+	if (enable)
+		tmp |= AUREON_HP_SEL;
+	else
+		tmp &= ~ AUREON_HP_SEL;
+	if (tmp != tmp2) {
+		snd_ice1712_gpio_write(ice, tmp);
+		return 1;
+	}
+	return 0;
+}
+
+static int aureon_get_headphone_amp(ice1712_t *ice)
+{
+	unsigned int tmp = snd_ice1712_gpio_read(ice);
+
+	return ( tmp & AUREON_HP_SEL )!= 0;
+}
+
+static int aureon_bool_info(snd_kcontrol_t *k, snd_ctl_elem_info_t *uinfo)
+{
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+	uinfo->count = 1;
+	uinfo->value.integer.min = 0;
+	uinfo->value.integer.max = 1;
+	return 0;
+}
+
+static int aureon_hpamp_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+	ucontrol->value.integer.value[0] = aureon_get_headphone_amp(ice);
+	return 0;
+}
+
+
+static int aureon_hpamp_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+	return aureon_set_headphone_amp(ice,ucontrol->value.integer.value[0]);
+}
+
+/*
+ * Deemphasis
+ */
+static int aureon_deemp_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	ucontrol->value.integer.value[0] = (wm_get(ice, WM_DAC_CTRL2) & 0xf) == 0xf;
+	return 0;
+}
+
+static int aureon_deemp_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	int temp, temp2;
+	temp2 = temp = wm_get(ice, WM_DAC_CTRL2);
+	if (ucontrol->value.integer.value[0])
+		temp |= 0xf;
+	else
+		temp &= ~0xf;
+	if (temp != temp2) {
+		wm_put(ice, WM_DAC_CTRL2, temp);
+		return 1;
+	}
+	return 0;
+}
+
+/*
+ * ADC Oversampling
+ */
+static int aureon_oversampling_info(snd_kcontrol_t *k, snd_ctl_elem_info_t *uinfo)
+{
+	static char *texts[2] = { "128x", "64x"	};
+
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 2;
+
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+
+        return 0;
+}
+
+static int aureon_oversampling_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+	ucontrol->value.enumerated.item[0] = (wm_get(ice, WM_MASTER) & 0x8) == 0x8;
+	return 0;
+}
+
+static int aureon_oversampling_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+	int temp, temp2;
+	ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+	temp2 = temp = wm_get(ice, WM_MASTER);
+
+	if (ucontrol->value.enumerated.item[0])
+		temp |= 0x8;
+	else
+		temp &= ~0x8;
+
+	if (temp != temp2) {
+		wm_put(ice, WM_MASTER, temp);
+		return 1;
+	}
+	return 0;
+}
+
 /*
  * mixers
  */
@@ -313,6 +538,13 @@ static snd_kcontrol_new_t aureon71_dac_control __devinitdata = {
 };
 
 static snd_kcontrol_new_t wm_controls[] __devinitdata = {
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Master Playback Switch",
+		.info = wm_dac_mute_info,
+		.get = wm_dac_mute_get,
+		.put = wm_dac_mute_put,
+	},
 	{
 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 		.name = "Master Playback Volume",
@@ -321,6 +553,15 @@ static snd_kcontrol_new_t wm_controls[] __devinitdata = {
 		.put = wm_dac_vol_put,
 		.private_value = 1,
 	},
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "ADC Switch",
+		.count = 2,
+		.info = wm_adc_mute_info,
+		.get = wm_adc_mute_get,
+		.put = wm_adc_mute_put,
+
+	},
 	{
 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
 		.name = "ADC Volume",
@@ -336,6 +577,27 @@ static snd_kcontrol_new_t wm_controls[] __devinitdata = {
 		.get = wm_adc_mux_get,
 		.put = wm_adc_mux_put,
 	},
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "Headphone Amplifier Switch",
+		.info = aureon_bool_info,
+		.get = aureon_hpamp_get,
+		.put = aureon_hpamp_put
+	},
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "DAC Deemphasis Switch",
+		.info = aureon_bool_info,
+		.get = aureon_deemp_get,
+		.put = aureon_deemp_put
+	},
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		.name = "ADC Oversampling",
+		.info = aureon_oversampling_info,
+		.get = aureon_oversampling_get,
+		.put = aureon_oversampling_put
+	},
 };
 
 
@@ -365,7 +627,7 @@ static int __devinit aureon_add_controls(ice1712_t *ice)
  */
 static int __devinit aureon_init(ice1712_t *ice)
 {
-	static unsigned short wm_inits[] = {
+	static unsigned short wm_inits_aureon[] = {
 		/* These come first to reduce init pop noise */
 		0x1b, 0x000,		/* ADC Mux */
 		0x1c, 0x009,		/* Out Mux1 */
@@ -399,20 +661,66 @@ static int __devinit aureon_init(ice1712_t *ice)
 		0x15, 0x000,		/* no deemphasis, no ZFLG */
 		0x19, 0x000,		/* -12dB ADC/L */
 		0x1a, 0x000,		/* -12dB ADC/R */
+		(unsigned short)-1
+	};
+	static unsigned short wm_inits_prodigy[] = {
+
+		/* These come first to reduce init pop noise */
+		0x1b, 0x000,		/* ADC Mux */
+		0x1c, 0x009,		/* Out Mux1 */
+		0x1d, 0x009,		/* Out Mux2 */
+
+		0x18, 0x000,		/* All power-up */
+
+		0x16, 0x022,		/* I2S, normal polarity, 24bit, high-pass on */
+		0x17, 0x006,		/* 128fs, slave mode */
+
+		0x00, 0,		/* DAC1 analog mute */
+		0x01, 0,		/* DAC2 analog mute */
+		0x02, 0,		/* DAC3 analog mute */
+		0x03, 0,		/* DAC4 analog mute */
+		0x04, 0,		/* DAC5 analog mute */
+		0x05, 0,		/* DAC6 analog mute */
+		0x06, 0,		/* DAC7 analog mute */
+		0x07, 0,		/* DAC8 analog mute */
+		0x08, 0x100,		/* master analog mute */
+
+		0x09, 0x7f,		/* DAC1 digital full */
+		0x0a, 0x7f,		/* DAC2 digital full */
+		0x0b, 0x7f,		/* DAC3 digital full */
+		0x0c, 0x7f,		/* DAC4 digital full */
+		0x0d, 0x7f,		/* DAC5 digital full */
+		0x0e, 0x7f,		/* DAC6 digital full */
+		0x0f, 0x7f,		/* DAC7 digital full */
+		0x10, 0x7f,		/* DAC8 digital full */
+		0x11, 0x1FF,		/* master digital full */
+
+		0x12, 0x000,		/* phase normal */
+		0x13, 0x090,		/* unmute DAC L/R */
+		0x14, 0x000,		/* all unmute */
+		0x15, 0x000,		/* no deemphasis, no ZFLG */
+
+		0x19, 0x000,		/* -12dB ADC/L */
+		0x1a, 0x000,		/* -12dB ADC/R */
+		(unsigned short)-1
+
 	};
 	static unsigned short cs_inits[] = {
 		0x0441, /* RUN */
 		0x0100, /* no mute */
 		0x0200, /* */
 		0x0600, /* slave, 24bit */
+		(unsigned short)-1
 	};
 	unsigned int tmp;
-	unsigned int i;
+	unsigned short *p;
+	unsigned int cscs;
 
 	if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY) {
 		ice->num_total_dacs = 6;
 		ice->num_total_adcs = 6;
 	} else {
+		/* aureon 7.1 and prodigy 7.1 */
 		ice->num_total_dacs = 8;
 		ice->num_total_adcs = 8;
 	}
@@ -423,16 +731,22 @@ static int __devinit aureon_init(ice1712_t *ice)
 		return -ENOMEM;
 	ice->akm_codecs = 1;
 
+	if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71)
+		cscs = PRODIGY_CS8415_CS;
+	else
+		cscs = AUREON_CS8415_CS;
+
 	snd_ice1712_gpio_set_dir(ice, 0xbfffff); /* fix this for the time being */
 
 	/* reset the wm codec as the SPI mode */
 	snd_ice1712_save_gpio_status(ice);
-	snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RESET|AUREON_WM_CS|AUREON_CS8415_CS));
+	snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RESET|AUREON_WM_CS|
+					 cscs|AUREON_HP_SEL));
 	tmp = snd_ice1712_gpio_read(ice);
 	tmp &= ~AUREON_WM_RESET;
 	snd_ice1712_gpio_write(ice, tmp);
 	udelay(1);
-	tmp |= AUREON_WM_CS | AUREON_CS8415_CS;
+	tmp |= AUREON_WM_CS | cscs;
 	snd_ice1712_gpio_write(ice, tmp);
 	udelay(1);
 	tmp |= AUREON_WM_RESET;
@@ -440,13 +754,19 @@ static int __devinit aureon_init(ice1712_t *ice)
 	udelay(1);
 
 	/* initialize WM8770 codec */
-	for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2)
-		wm_put(ice, wm_inits[i], wm_inits[i+1]);
+	if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71)
+		p = wm_inits_prodigy;
+	else
+		p = wm_inits_aureon;
+	for (; *p != (unsigned short)-1; p += 2)
+		wm_put(ice, p[0], p[1]);
 
 	/* initialize CS8415A codec */
-	for (i = 0; i < ARRAY_SIZE(cs_inits); i++)
-		aureon_spi_write(ice, AUREON_CS8415_CS,
-				 cs_inits[i] | 0x200000, 24);
+	for (p = cs_inits; *p != (unsigned short)-1; p++)
+		aureon_spi_write(ice, cscs,
+				 *p | 0x200000, 24);
+
+	aureon_set_headphone_amp(ice, 1);
 
 	snd_ice1712_restore_gpio_status(ice);
 
@@ -460,7 +780,7 @@ static int __devinit aureon_init(ice1712_t *ice)
  */
 
 static unsigned char aureon51_eeprom[] __devinitdata = {
-	0x12,	/* SYSCONF: clock 512, mpu401, spdif-in/ADC, 3DACs */
+	0x2a,	/* SYSCONF: clock 512, mpu401, spdif-in/ADC, 3DACs */
 	0x80,	/* ACLINK: I2S */
 	0xf8,	/* I2S: vol, 96k, 24bit, 192k */
 	0xc3,	/* SPDIF: out-en, out-int, spdif-in */
@@ -476,7 +796,23 @@ static unsigned char aureon51_eeprom[] __devinitdata = {
 };
 
 static unsigned char aureon71_eeprom[] __devinitdata = {
-	0x13,	/* SYSCONF: clock 512, mpu401, spdif-in/ADC, 4DACs */
+	0x2b,	/* SYSCONF: clock 512, mpu401, spdif-in/ADC, 4DACs */
+	0x80,	/* ACLINK: I2S */
+	0xf8,	/* I2S: vol, 96k, 24bit, 192k */
+	0xc3,	/* SPDIF: out-en, out-int, spdif-in */
+	0xff,	/* GPIO_DIR */
+	0xff,	/* GPIO_DIR1 */
+	0xbf,	/* GPIO_DIR2 */
+	0x00,	/* GPIO_MASK */
+	0x00,	/* GPIO_MASK1 */
+	0x00,	/* GPIO_MASK2 */
+	0x00,	/* GPIO_STATE */
+	0x00,	/* GPIO_STATE1 */
+	0x00,	/* GPIO_STATE2 */
+};
+
+static unsigned char prodigy71_eeprom[] __devinitdata = {
+	0x2b,	/* SYSCONF: clock 512, mpu401, spdif-in/ADC, 4DACs */
 	0x80,	/* ACLINK: I2S */
 	0xf8,	/* I2S: vol, 96k, 24bit, 192k */
 	0xc3,	/* SPDIF: out-en, out-int, spdif-in */
@@ -496,6 +832,7 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = {
 	{
 		.subvendor = VT1724_SUBDEVICE_AUREON51_SKY,
 		.name = "Terratec Aureon 5.1-Sky",
+		.model = "aureon51",
 		.chip_init = aureon_init,
 		.build_controls = aureon_add_controls,
 		.eeprom_size = sizeof(aureon51_eeprom),
@@ -504,10 +841,29 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = {
 	{
 		.subvendor = VT1724_SUBDEVICE_AUREON71_SPACE,
 		.name = "Terratec Aureon 7.1-Space",
+		.model = "aureon71",
 		.chip_init = aureon_init,
 		.build_controls = aureon_add_controls,
 		.eeprom_size = sizeof(aureon71_eeprom),
 		.eeprom_data = aureon71_eeprom,
 	},
+ 	{
+ 		.subvendor = VT1724_SUBDEVICE_AUREON71_UNIVERSE,
+ 		.name = "Terratec Aureon 7.1-Universe",
+		/* model not needed - identical with 7.1-Space */
+ 		.chip_init = aureon_init,
+ 		.build_controls = aureon_add_controls,
+ 		.eeprom_size = sizeof(aureon71_eeprom),
+ 		.eeprom_data = aureon71_eeprom,
+	},
+	{
+		.subvendor = VT1724_SUBDEVICE_PRODIGY71,
+		.name = "Audiotrak Prodigy 7.1",
+		.model = "prodigy71",
+		.chip_init = aureon_init,
+		.build_controls = aureon_add_controls,
+		.eeprom_size = sizeof(prodigy71_eeprom),
+		.eeprom_data = prodigy71_eeprom,
+	},
 	{ } /* terminator */
 };
diff --git a/sound/pci/ice1712/aureon.h b/sound/pci/ice1712/aureon.h
index c7181425c..88804e098 100644
--- a/sound/pci/ice1712/aureon.h
+++ b/sound/pci/ice1712/aureon.h
@@ -25,10 +25,14 @@
  */      
 
 #define  AUREON_DEVICE_DESC 	       "{Terratec,Aureon 5.1 Sky},"\
-				       "{Terratec,Aureon 7.1 Space},"
+				       "{Terratec,Aureon 7.1 Space},"\
+				       "{Terratec,Aureon 7.1 Universe}," \
+					"{AudioTrak,Prodigy 7.1},"
 
 #define VT1724_SUBDEVICE_AUREON51_SKY	0x3b154711	/* Aureon 5.1 Sky */
 #define VT1724_SUBDEVICE_AUREON71_SPACE	0x3b154511	/* Aureon 7.1 Space */
+#define VT1724_SUBDEVICE_AUREON71_UNIVERSE	0x3b155311	/* Aureon 7.1 Universe */
+#define VT1724_SUBDEVICE_PRODIGY71	0x33495345	/* PRODIGY 7.1 */
 
 extern struct snd_ice1712_card_info  snd_vt1724_aureon_cards[];
 
@@ -44,4 +48,8 @@ extern struct snd_ice1712_card_info  snd_vt1724_aureon_cards[];
 #define AUREON_HP_SEL		(1 << 14)
 #define AUREON_WM_CS		(1 << 12)
 
+/* Prodigy has different pin assignment for chip select */
+#define PRODIGY_CS8415_CS	(1 << 23)
+#define PRODIGY_CS8415_CDTO	(1 << 22)
+
 #endif /* __SOUND_AUREON_H */
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index a5ba80c48..85fc5e4f6 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -692,56 +692,64 @@ static int __devinit snd_ice1712_delta_add_controls(ice1712_t *ice)
 /* entry point */
 struct snd_ice1712_card_info snd_ice1712_delta_cards[] __devinitdata = {
 	{
-		ICE1712_SUBDEVICE_DELTA1010,
-		"M Audio Delta 1010",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_DELTA1010,
+		.name = "M Audio Delta 1010",
+		.model = "delta1010",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_DELTADIO2496,
-		"M Audio Delta DiO 2496",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
-		1, /* NO MPU */
+		.subvendor = ICE1712_SUBDEVICE_DELTADIO2496,
+		.name = "M Audio Delta DiO 2496",
+		.model = "dio2496",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
+		.no_mpu401 = 1,
 	},
 	{
-		ICE1712_SUBDEVICE_DELTA66,
-		"M Audio Delta 66",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
-		1, /* NO MPU */
+		.subvendor = ICE1712_SUBDEVICE_DELTA66,
+		.name = "M Audio Delta 66",
+		.model = "delta66",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
+		.no_mpu401 = 1,
 	},
 	{
-		ICE1712_SUBDEVICE_DELTA44,
-		"M Audio Delta 44",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
-		1, /* NO MPU */
+		.subvendor = ICE1712_SUBDEVICE_DELTA44,
+		.name = "M Audio Delta 44",
+		.model = "delta44",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
+		.no_mpu401 = 1,
 	},
 	{
-		ICE1712_SUBDEVICE_AUDIOPHILE,
-		"M Audio Audiophile 24/96",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_AUDIOPHILE,
+		.name = "M Audio Audiophile 24/96",
+		.model = "audiophile",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_DELTA410,
-		"M Audio Delta 410",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_DELTA410,
+		.name = "M Audio Delta 410",
+		.model = "delta410",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_DELTA1010LT,
-		"M Audio Delta 1010LT",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_DELTA1010LT,
+		.name = "M Audio Delta 1010LT",
+		.model = "delta1010lt",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_VX442,
-		"Digigram VX442",
-		snd_ice1712_delta_init,
-		snd_ice1712_delta_add_controls,
-		1, /* NO MPU */
+		.subvendor = ICE1712_SUBDEVICE_VX442,
+		.name = "Digigram VX442",
+		.model = "vx442",
+		.chip_init = snd_ice1712_delta_init,
+		.build_controls = snd_ice1712_delta_add_controls,
+		.no_mpu401 = 1,
 	},
 	{ } /* terminator */
 };
diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h
index 1e99183bd..375e5fb00 100644
--- a/sound/pci/ice1712/envy24ht.h
+++ b/sound/pci/ice1712/envy24ht.h
@@ -209,4 +209,7 @@ enum {
 #define VT1724_MT_PDMA1_COUNT		0x76	/* word */
 
 
+unsigned char snd_vt1724_read_i2c(ice1712_t *ice, unsigned char dev, unsigned char addr);
+void snd_vt1724_write_i2c(ice1712_t *ice, unsigned char dev, unsigned char addr, unsigned char data);
+
 #endif /* __SOUND_VT1724_H */
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index 5392fc2f7..9509e4840 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -971,34 +971,39 @@ static int __devinit snd_ice1712_ews_add_controls(ice1712_t *ice)
 /* entry point */
 struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = {
 	{
-		ICE1712_SUBDEVICE_EWX2496,
-		"TerraTec EWX24/96",
-		snd_ice1712_ews_init,
-		snd_ice1712_ews_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_EWX2496,
+		.name = "TerraTec EWX24/96",
+		.model = "ewx2496",
+		.chip_init = snd_ice1712_ews_init,
+		.build_controls = snd_ice1712_ews_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_EWS88MT,
-		"TerraTec EWS88MT",
-		snd_ice1712_ews_init,
-		snd_ice1712_ews_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_EWS88MT,
+		.name = "TerraTec EWS88MT",
+		.model = "ews88mt",
+		.chip_init = snd_ice1712_ews_init,
+		.build_controls = snd_ice1712_ews_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_EWS88MT_NEW,
-		"TerraTec EWS88MT",
-		snd_ice1712_ews_init,
-		snd_ice1712_ews_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_EWS88MT_NEW,
+		.name = "TerraTec EWS88MT",
+		.model = "ews88mt_new",
+		.chip_init = snd_ice1712_ews_init,
+		.build_controls = snd_ice1712_ews_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_EWS88D,
-		"TerraTec EWS88D",
-		snd_ice1712_ews_init,
-		snd_ice1712_ews_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_EWS88D,
+		.name = "TerraTec EWS88D",
+		.model = "ews88d",
+		.chip_init = snd_ice1712_ews_init,
+		.build_controls = snd_ice1712_ews_add_controls,
 	},
 	{
-		ICE1712_SUBDEVICE_DMX6FIRE,
-		"TerraTec DMX6Fire",
-		snd_ice1712_ews_init,
-		snd_ice1712_ews_add_controls,
+		.subvendor = ICE1712_SUBDEVICE_DMX6FIRE,
+		.name = "TerraTec DMX6Fire",
+		.model = "dmx6fire",
+		.chip_init = snd_ice1712_ews_init,
+		.build_controls = snd_ice1712_ews_add_controls,
 	},
 	{ } /* terminator */
 };
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c
index cd60f564f..6951c1a9d 100644
--- a/sound/pci/ice1712/hoontech.c
+++ b/sound/pci/ice1712/hoontech.c
@@ -83,6 +83,7 @@ static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, i
 		ICE1712_STDSP24_2_CHN4(ice->hoontech_boxbits, 0);
 	ICE1712_STDSP24_2_MIDI1(ice->hoontech_boxbits, activate);
 	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[2]);
+	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[3]);
 
 	ICE1712_STDSP24_1_CHN1(ice->hoontech_boxbits, 1);
 	ICE1712_STDSP24_1_CHN2(ice->hoontech_boxbits, 1);
@@ -117,7 +118,7 @@ static void __devinit snd_ice1712_stdsp24_box_channel(ice1712_t *ice, int box, i
 	up(&ice->gpio_mutex);
 }
 
-static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int master, int slave)
+static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int master)
 {
 	down(&ice->gpio_mutex);
 
@@ -128,23 +129,26 @@ static void __devinit snd_ice1712_stdsp24_box_midi(ice1712_t *ice, int box, int
 	ICE1712_STDSP24_2_MIDIIN(ice->hoontech_boxbits, 1);
 	ICE1712_STDSP24_2_MIDI1(ice->hoontech_boxbits, master);
 	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[2]);
+	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[3]);
 
 	udelay(100);
 	
 	ICE1712_STDSP24_2_MIDIIN(ice->hoontech_boxbits, 0);
 	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[2]);
 	
-	udelay(100);
+	mdelay(10);
 	
 	ICE1712_STDSP24_2_MIDIIN(ice->hoontech_boxbits, 1);
 	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[2]);
 
-	udelay(100);
+	up(&ice->gpio_mutex);
+}
 
-	/* MIDI2 is direct */
-	ICE1712_STDSP24_3_MIDI2(ice->hoontech_boxbits, slave);
+static void __devinit snd_ice1712_stdsp24_midi2(ice1712_t *ice, int activate)
+{
+	down(&ice->gpio_mutex);
+	ICE1712_STDSP24_3_MIDI2(ice->hoontech_boxbits, activate);
 	snd_ice1712_stdsp24_gpio_write(ice, ice->hoontech_boxbits[3]);
-
 	up(&ice->gpio_mutex);
 }
 
@@ -204,25 +208,118 @@ static int __devinit snd_ice1712_hoontech_init(ice1712_t *ice)
 		for (chn = 0; chn < 4; chn++)
 			snd_ice1712_stdsp24_box_channel(ice, box, chn, (ice->hoontech_boxconfig[box] & (1 << chn)) ? 1 : 0);
 		snd_ice1712_stdsp24_box_midi(ice, box,
-				(ice->hoontech_boxconfig[box] & ICE1712_STDSP24_BOX_MIDI1) ? 1 : 0,
-				(ice->hoontech_boxconfig[box] & ICE1712_STDSP24_BOX_MIDI2) ? 1 : 0);
+				(ice->hoontech_boxconfig[box] & ICE1712_STDSP24_BOX_MIDI1) ? 1 : 0);
+		if (ice->hoontech_boxconfig[box] & ICE1712_STDSP24_BOX_MIDI2)
+			snd_ice1712_stdsp24_midi2(ice, 1);
 	}
 
 	return 0;
 }
 
+/*
+ * AK4524 access
+ */
+
+/* start callback for STDSP24 with modified hardware */
+static void stdsp24_ak4524_lock(akm4xxx_t *ak, int chip)
+{
+	ice1712_t *ice = ak->private_data[0];
+	unsigned char tmp;
+	snd_ice1712_save_gpio_status(ice);
+	tmp =	ICE1712_STDSP24_SERIAL_DATA |
+		ICE1712_STDSP24_SERIAL_CLOCK |
+		ICE1712_STDSP24_AK4524_CS;
+	snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION,
+			  ice->gpio.direction | tmp);
+	snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp);
+}
+
+static int __devinit snd_ice1712_value_init(ice1712_t *ice)
+{
+	/* Hoontech STDSP24 with modified hardware */
+	static akm4xxx_t akm_stdsp24_mv __devinitdata = {
+		.num_adcs = 2,
+		.num_dacs = 2,
+		.type = SND_AK4524,
+		.ops = {
+			.lock = stdsp24_ak4524_lock
+		}
+	};
+
+	static struct snd_ak4xxx_private akm_stdsp24_mv_priv __devinitdata = {
+		.caddr = 2,
+		.cif = 1, /* CIF high */
+		.data_mask = ICE1712_STDSP24_SERIAL_DATA,
+		.clk_mask = ICE1712_STDSP24_SERIAL_CLOCK,
+		.cs_mask = ICE1712_STDSP24_AK4524_CS,
+		.cs_addr = ICE1712_STDSP24_AK4524_CS,
+		.cs_none = 0,
+		.add_flags = 0,
+	};
+
+	int err;
+	akm4xxx_t *ak;
+
+	/* set the analog DACs */
+	ice->num_total_dacs = 2;
+
+	/* set the analog ADCs */
+	ice->num_total_adcs = 2;
+	
+	/* analog section */
+	ak = ice->akm = kmalloc(sizeof(akm4xxx_t), GFP_KERNEL);
+	if (! ak)
+		return -ENOMEM;
+	ice->akm_codecs = 1;
+
+	err = snd_ice1712_akm4xxx_init(ak, &akm_stdsp24_mv, &akm_stdsp24_mv_priv, ice);
+	if (err < 0)
+		return err;
+
+	/* ak4524 controls */
+	err = snd_ice1712_akm4xxx_build_controls(ice);
+	if (err < 0)
+		return err;
+
+	return 0;
+}
+
+static int __devinit snd_ice1712_ez8_init(ice1712_t *ice)
+{
+	ice->gpio.write_mask = ice->eeprom.gpiomask;
+	ice->gpio.direction = ice->eeprom.gpiodir;
+	snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ice->eeprom.gpiomask);
+	snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->eeprom.gpiodir);
+	snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ice->eeprom.gpiostate);
+	return 0;
+}
+
 
 /* entry point */
 struct snd_ice1712_card_info snd_ice1712_hoontech_cards[] __devinitdata = {
 	{
-		ICE1712_SUBDEVICE_STDSP24,
-		"Hoontech SoundTrack Audio DSP24",
-		snd_ice1712_hoontech_init,
+		.subvendor = ICE1712_SUBDEVICE_STDSP24,
+		.name = "Hoontech SoundTrack Audio DSP24",
+		.model = "dsp24",
+		.chip_init = snd_ice1712_hoontech_init,
+	},
+	{
+		.subvendor = ICE1712_SUBDEVICE_STDSP24_VALUE,	/* a dummy id */
+		.name = "Hoontech SoundTrack Audio DSP24 Value",
+		.model = "dsp24_value",
+		.chip_init = snd_ice1712_value_init,
+	},
+	{
+		.subvendor = ICE1712_SUBDEVICE_STDSP24_MEDIA7_1,
+		.name = "Hoontech STA DSP24 Media 7.1",
+		.model = "dsp24_71",
+		.chip_init = snd_ice1712_hoontech_init,
 	},
 	{
-		ICE1712_SUBDEVICE_STDSP24_MEDIA7_1,
-		"Hoontech STA DSP24 Media 7.1",
-		snd_ice1712_hoontech_init,
+		.subvendor = ICE1712_SUBDEVICE_EVENT_EZ8,	/* a dummy id */
+		.name = "Event Electronics EZ8",
+		.model = "ez8",
+		.chip_init = snd_ice1712_ez8_init,
 	},
 	{ } /* terminator */
 };
diff --git a/sound/pci/ice1712/hoontech.h b/sound/pci/ice1712/hoontech.h
index e1fe25b36..1ee538b20 100644
--- a/sound/pci/ice1712/hoontech.h
+++ b/sound/pci/ice1712/hoontech.h
@@ -25,12 +25,15 @@
  */      
 
 #define  HOONTECH_DEVICE_DESC \
-	"{Hoontech SoundTrack DSP 24}," \
-	"{Hoontech SoundTrack DSP 24 Value}," \
-	"{Hoontech SoundTrack DSP 24 Media 7.1}," \
+	"{Hoontech,SoundTrack DSP 24}," \
+	"{Hoontech,SoundTrack DSP 24 Value}," \
+	"{Hoontech,SoundTrack DSP 24 Media 7.1}," \
+	"{Event Electronics,EZ8},"
 
 #define ICE1712_SUBDEVICE_STDSP24		0x12141217	/* Hoontech SoundTrack Audio DSP 24 */
+#define ICE1712_SUBDEVICE_STDSP24_VALUE		0x00010010	/* A dummy id for Hoontech SoundTrack Audio DSP 24 Value */
 #define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1	0x16141217	/* Hoontech ST Audio DSP24 Media 7.1 */
+#define ICE1712_SUBDEVICE_EVENT_EZ8		0x00010001	/* A dummy id for EZ8 */
 
 extern struct snd_ice1712_card_info snd_ice1712_hoontech_cards[];
 
@@ -65,4 +68,10 @@ extern struct snd_ice1712_card_info snd_ice1712_hoontech_cards[];
 #define ICE1712_STDSP24_BOX_MIDI1	(1<<8)
 #define ICE1712_STDSP24_BOX_MIDI2	(1<<9)
 
+/* Hoontech SoundTrack Audio DSP 24 Value definitions for modified hardware */
+
+#define ICE1712_STDSP24_AK4524_CS	0x03	/* AK4524 chip select; low = active */
+#define ICE1712_STDSP24_SERIAL_DATA	0x0c	/* ak4524 data */
+#define ICE1712_STDSP24_SERIAL_CLOCK	0x30	/* ak4524 clock */
+
 #endif /* __SOUND_HOONTECH_H */
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 5e4455aa3..08b94db68 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -41,6 +41,9 @@
  *  2003.02.20  Taksahi Iwai <tiwai@suse.de>
  *	Split vt1724 part to an independent driver.
  *	The GPIO is accessed through the callback functions now.
+ *
+ * 2004.03.31 Doug McLain <nostar@comcast.net>
+ *    Added support for Event Electronics EZ8 card to hoontech.c.
  */
 
 
@@ -51,11 +54,11 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/cs8427.h>
 #include <sound/info.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <sound/asoundef.h>
@@ -81,24 +84,28 @@ MODULE_DEVICES("{"
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;		/* Enable this card */
-static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};	/* Delta44 & 66 Omni I/O support */
+static char *model[SNDRV_CARDS];
+static int omni[SNDRV_CARDS];	/* Delta44 & 66 Omni I/O support */
 static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transciever reset timeout value in msec */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ICE1712 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ICE1712 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ICE1712 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(omni, bool, boot_devs, 0444);
 MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support.");
 MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
-MODULE_PARM(cs8427_timeout, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(cs8427_timeout, int, boot_devs, 0444);
 MODULE_PARM_DESC(cs8427_timeout, "Define reset timeout for cs8427 chip in msec resolution.");
 MODULE_PARM_SYNTAX(cs8427_timeout, SNDRV_ENABLED ", allows:{{1,1000}},default=500,skill:advanced");
+module_param_array(model, charp, boot_devs, 0444);
+MODULE_PARM_DESC(model, "Use the given board model.");
 
 #ifndef PCI_VENDOR_ID_ICE
 #define PCI_VENDOR_ID_ICE		0x1412
@@ -1898,6 +1905,74 @@ static snd_kcontrol_new_t snd_ice1712_pro_internal_clock __devinitdata = {
 	.put = snd_ice1712_pro_internal_clock_put
 };
 
+static int snd_ice1712_pro_internal_clock_default_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
+{
+	static char *texts[] = {
+		"8000",		/* 0: 6 */
+		"9600",		/* 1: 3 */
+		"11025",	/* 2: 10 */
+		"12000",	/* 3: 2 */
+		"16000",	/* 4: 5 */
+		"22050",	/* 5: 9 */
+		"24000",	/* 6: 1 */
+		"32000",	/* 7: 4 */
+		"44100",	/* 8: 8 */
+		"48000",	/* 9: 0 */
+		"64000",	/* 10: 15 */
+		"88200",	/* 11: 11 */
+		"96000",	/* 12: 7 */
+		// "IEC958 Input",	/* 13: -- */
+	};
+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
+	uinfo->count = 1;
+	uinfo->value.enumerated.items = 13;
+	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+		uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
+	strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
+	return 0;
+}
+
+static int snd_ice1712_pro_internal_clock_default_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	int val;
+	static unsigned int xrate[13] = {
+		8000, 9600, 11025, 12000, 1600, 22050, 24000,
+		32000, 44100, 48000, 64000, 88200, 96000
+	};
+
+	for (val = 0; val < 13; val++) {
+		if (xrate[val] == PRO_RATE_DEFAULT)
+			break;
+	}
+
+	ucontrol->value.enumerated.item[0] = val;
+	return 0;
+}
+
+static int snd_ice1712_pro_internal_clock_default_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+	static unsigned int xrate[13] = {
+		8000, 9600, 11025, 12000, 1600, 22050, 24000,
+		32000, 44100, 48000, 64000, 88200, 96000
+	};
+	unsigned char oval;
+	int change = 0;
+
+	oval = PRO_RATE_DEFAULT;
+	PRO_RATE_DEFAULT = xrate[ucontrol->value.integer.value[0] % 13];
+	change = PRO_RATE_DEFAULT != oval;
+
+	return change;
+}
+
+static snd_kcontrol_new_t snd_ice1712_pro_internal_clock_default __devinitdata = {
+	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name = "Multi Track Internal Clock Default",
+	.info = snd_ice1712_pro_internal_clock_default_info,
+	.get = snd_ice1712_pro_internal_clock_default_get,
+	.put = snd_ice1712_pro_internal_clock_default_put
+};
+
 static int snd_ice1712_pro_rate_locking_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
 {
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
@@ -2213,6 +2288,16 @@ static snd_kcontrol_new_t snd_ice1712_mixer_pro_peak __devinitdata = {
  *
  */
 
+/*
+ * list of available boards
+ */
+static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
+	snd_ice1712_hoontech_cards,
+	snd_ice1712_delta_cards,
+	snd_ice1712_ews_cards,
+	0,
+};
+
 static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice,
 						 unsigned char dev,
 						 unsigned char addr)
@@ -2225,7 +2310,7 @@ static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice,
 	return inb(ICEREG(ice, I2C_DATA));
 }
 
-static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice)
+static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice, const char *modelname)
 {
 	int dev = 0xa0;		/* EEPROM device address */
 	unsigned int i, size;
@@ -2234,10 +2319,23 @@ static int __devinit snd_ice1712_read_eeprom(ice1712_t *ice)
 		snd_printk("ICE1712 has not detected EEPROM\n");
 		return -EIO;
 	}
-	ice->eeprom.subvendor = (snd_ice1712_read_i2c(ice, dev, 0x00) << 0) |
-				(snd_ice1712_read_i2c(ice, dev, 0x01) << 8) | 
-				(snd_ice1712_read_i2c(ice, dev, 0x02) << 16) | 
-				(snd_ice1712_read_i2c(ice, dev, 0x03) << 24);
+	if (modelname && *modelname) {
+		struct snd_ice1712_card_info **tbl, *c;
+		for (tbl = card_tables; *tbl; tbl++) {
+			for (c = *tbl; c->subvendor; c++) {
+				if (c->model && !strcmp(modelname, c->model)) {
+					/* use the given subvendor */
+					printk(KERN_INFO "ice1712: Using board model %s\n", c->name);
+					ice->eeprom.subvendor = c->subvendor;
+					break;
+				}
+			}
+		}
+	} else
+		ice->eeprom.subvendor = (snd_ice1712_read_i2c(ice, dev, 0x00) << 0) |
+			(snd_ice1712_read_i2c(ice, dev, 0x01) << 8) | 
+			(snd_ice1712_read_i2c(ice, dev, 0x02) << 16) | 
+			(snd_ice1712_read_i2c(ice, dev, 0x03) << 24);
 	ice->eeprom.size = snd_ice1712_read_i2c(ice, dev, 0x04);
 	if (ice->eeprom.size < 6)
 		ice->eeprom.size = 32; /* FIXME: any cards without the correct size? */
@@ -2333,6 +2431,9 @@ static int __devinit snd_ice1712_build_controls(ice1712_t *ice)
 	if (err < 0)
 		return err;
 	err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_internal_clock, ice));
+	if (err < 0)
+		return err;
+	err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_pro_internal_clock_default, ice));
 	if (err < 0)
 		return err;
 
@@ -2407,6 +2508,7 @@ static int snd_ice1712_dev_free(snd_device_t *device)
 
 static int __devinit snd_ice1712_create(snd_card_t * card,
 					struct pci_dev *pci,
+					const char *modelname,
 					int omni,
 					int cs8427_timeout,
 					ice1712_t ** r_ice1712)
@@ -2491,7 +2593,7 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
 	
 	ice->irq = pci->irq;
 
-	if (snd_ice1712_read_eeprom(ice) < 0) {
+	if (snd_ice1712_read_eeprom(ice, modelname) < 0) {
 		snd_ice1712_free(ice);
 		return -EIO;
 	}
@@ -2526,14 +2628,6 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
 
 static struct snd_ice1712_card_info no_matched __devinitdata;
 
-static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
-	snd_ice1712_hoontech_cards,
-	snd_ice1712_delta_cards,
-	snd_ice1712_ews_cards,
-	0,
-};
-
-
 static int __devinit snd_ice1712_probe(struct pci_dev *pci,
 				       const struct pci_device_id *pci_id)
 {
@@ -2557,7 +2651,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
 	strcpy(card->driver, "ICE1712");
 	strcpy(card->shortname, "ICEnsemble ICE1712");
 	
-	if ((err = snd_ice1712_create(card, pci, omni[dev], cs8427_timeout[dev], &ice)) < 0) {
+	if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev], cs8427_timeout[dev], &ice)) < 0) {
 		snd_card_free(card);
 		return err;
 	}
@@ -2566,6 +2660,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
 		for (c = *tbl; c->subvendor; c++) {
 			if (c->subvendor == ice->eeprom.subvendor) {
 				strcpy(card->shortname, c->name);
+				if (c->driver) /* specific driver? */
+					strcpy(card->driver, c->driver);
 				if (c->chip_init) {
 					if ((err = c->chip_init(ice)) < 0) {
 						snd_card_free(card);
@@ -2659,15 +2755,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_ice1712_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ICE1712 soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_ice1712_exit(void)
@@ -2677,24 +2765,3 @@ static void __exit alsa_card_ice1712_exit(void)
 
 module_init(alsa_card_ice1712_init)
 module_exit(alsa_card_ice1712_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ice1712=enable,index,id */
-
-static int __init alsa_card_ice1712_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-ice1712=", alsa_card_ice1712_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 8b4bc08a5..f8233bfdc 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -329,6 +329,10 @@ struct _snd_ice1712 {
 	unsigned int pro_volumes[20];
 	unsigned int omni: 1;		/* Delta Omni I/O */
 	unsigned int vt1724: 1;
+	unsigned int vt1720: 1;
+	unsigned int has_spdif: 1;	/* VT1720/4 - has SPDIF I/O */
+	unsigned int force_pdma4: 1;	/* VT1720/4 - PDMA4 as non-spdif */
+	unsigned int force_rdma1: 1;	/* VT1720/4 - RDMA1 as non-spdif */
 	unsigned int num_total_dacs;	/* total DACs */
 	unsigned int num_total_adcs;	/* total ADCs */
 	unsigned char hoontech_boxbits[4];
@@ -460,6 +464,8 @@ static inline u8 snd_ice1712_read(ice1712_t * ice, u8 addr)
 struct snd_ice1712_card_info {
 	unsigned int subvendor;
 	char *name;
+	char *model;
+	char *driver;
 	int (*chip_init)(ice1712_t *);
 	int (*build_controls)(ice1712_t *);
 	int no_mpu401: 1;
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 7ffe3a9f5..a7a55a98b 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1,5 +1,6 @@
 /*
  *   ALSA driver for VT1724 ICEnsemble ICE1724 / VIA VT1724 (Envy24HT)
+ *                   VIA VT1720 (Envy24PT)
  *
  *	Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
  *                    2002 James Stafford <jstafford@ampltd.com>
@@ -28,10 +29,10 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <sound/asoundef.h>
@@ -43,35 +44,39 @@
 #include "amp.h"
 #include "revo.h"
 #include "aureon.h"
-#include "prodigy.h"
 
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
-MODULE_DESCRIPTION("ICEnsemble ICE1724 (Envy24HT)");
+MODULE_DESCRIPTION("VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{"
 	       REVO_DEVICE_DESC
 	       AMP_AUDIO2000_DEVICE_DESC
 	       AUREON_DEVICE_DESC
-	       PRODIGY_DEVICE_DESC
+		"{VIA,VT1720},"
 		"{VIA,VT1724},"
 		"{ICEnsemble,Generic ICE1724},"
-		"{ICEnsemble,Generic Envy24HT}}");
+		"{ICEnsemble,Generic Envy24HT}"
+		"{ICEnsemble,Generic Envy24PT}}");
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;		/* Enable this card */
+static char *model[SNDRV_CARDS];
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for ICE1724 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for ICE1724 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable ICE1724 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
+module_param_array(model, charp, boot_devs, 0444);
+MODULE_PARM_DESC(model, "Use the given board model.");
 
 #ifndef PCI_VENDOR_ID_ICE
 #define PCI_VENDOR_ID_ICE		0x1412
@@ -80,6 +85,7 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 #define PCI_DEVICE_ID_VT1724		0x1724
 #endif
 
+/* Both VT1720 and VT1724 have the same PCI IDs */
 static struct pci_device_id snd_vt1724_ids[] = {
 	{ PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
 	{ 0, }
@@ -228,6 +234,17 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *r
 			status &= ~(VT1724_IRQ_MPU_RX|VT1724_IRQ_MPU_TX);
 		}
 		if (status & VT1724_IRQ_MTPCM) {
+			/*
+			 * Multi-track PCM
+			 * PCM assignment are:
+			 * Playback DMA0 (M/C) = playback_pro_substream
+			 * Playback DMA1 = playback_con_substream_ds[0]
+			 * Playback DMA2 = playback_con_substream_ds[1]
+			 * Playback DMA3 = playback_con_substream_ds[2]
+			 * Playback DMA4 (SPDIF) = playback_con_substream
+			 * Record DMA0 = capture_pro_substream
+			 * Record DMA1 = capture_con_substream
+			 */
 			unsigned char mtstat = inb(ICEMT1724(ice, IRQ));
 			if (mtstat & VT1724_MULTI_PDMA0) {
 				if (ice->playback_pro_substream)
@@ -288,6 +305,12 @@ static snd_pcm_hw_constraint_list_t hw_constraints_rates_96 = {
 	.mask = 0,
 };
 
+static snd_pcm_hw_constraint_list_t hw_constraints_rates_48 = {
+	.count = ARRAY_SIZE(rates) - 5, /* up to 48000 */
+	.list = rates,
+	.mask = 0,
+};
+
 static snd_pcm_hw_constraint_list_t hw_constraints_rates_192 = {
 	.count = ARRAY_SIZE(rates),
 	.list = rates,
@@ -423,6 +446,15 @@ static void snd_vt1724_set_pro_rate(ice1712_t *ice, unsigned int rate, int force
 		if (ice->akm[i].ops.set_rate_val)
 			ice->akm[i].ops.set_rate_val(&ice->akm[i], rate);
 	}
+
+	/* set up AC97 registers if needed */
+	if (! (ice->eeprom.data[ICE_EEP2_ACLINK] & 0x80) && ice->ac97) {
+		snd_ac97_set_rate(ice->ac97, AC97_PCM_FRONT_DAC_RATE, rate);
+		snd_ac97_set_rate(ice->ac97, AC97_PCM_SURR_DAC_RATE, rate);
+		snd_ac97_set_rate(ice->ac97, AC97_PCM_LFE_DAC_RATE, rate);
+		snd_ac97_set_rate(ice->ac97, AC97_SPDIF, rate);
+		snd_ac97_set_rate(ice->ac97, AC97_PCM_LR_ADC_RATE, rate);
+	}
 }
 
 static int snd_vt1724_pcm_hw_params(snd_pcm_substream_t * substream,
@@ -435,6 +467,7 @@ static int snd_vt1724_pcm_hw_params(snd_pcm_substream_t * substream,
 	down(&ice->open_mutex);
 	/* mark surround channels */
 	if (substream == ice->playback_pro_substream) {
+		/* PDMA0 can be multi-channel up to 8 */
 		chs = chs / 2 - 1;
 		for (i = 0; i < chs; i++) {
 			if (ice->pcm_reserved[i] && ice->pcm_reserved[i] != substream) {
@@ -449,6 +482,7 @@ static int snd_vt1724_pcm_hw_params(snd_pcm_substream_t * substream,
 		}
 	} else {
 		for (i = 0; i < 3; i++) {
+			/* check individual playback stream */
 			if (ice->playback_con_substream_ds[i] == substream) {
 				if (ice->pcm_reserved[i] && ice->pcm_reserved[i] != substream) {
 					up(&ice->open_mutex);
@@ -609,7 +643,7 @@ static snd_pcm_hardware_t snd_vt1724_playback_pro =
 				 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
 	.formats =		SNDRV_PCM_FMTBIT_S32_LE,
 	.rates =		SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_192000,
-	.rate_min =		4000,
+	.rate_min =		8000,
 	.rate_max =		192000,
 	.channels_min =		2,
 	.channels_max =		8,
@@ -620,6 +654,25 @@ static snd_pcm_hardware_t snd_vt1724_playback_pro =
 	.periods_max =		1024,
 };
 
+static snd_pcm_hardware_t snd_vt1724_spdif =
+{
+	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
+				 SNDRV_PCM_INFO_BLOCK_TRANSFER |
+				 SNDRV_PCM_INFO_MMAP_VALID |
+				 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
+	.formats =		SNDRV_PCM_FMTBIT_S32_LE,
+	.rates =	        SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100|SNDRV_PCM_RATE_48000,
+	.rate_min =		32000,
+	.rate_max =		48000,
+	.channels_min =		2,
+	.channels_max =		2,
+	.buffer_bytes_max =	(1UL << 18),	/* 16bits dword */
+	.period_bytes_min =	2 * 4 * 2,
+	.period_bytes_max =	(1UL << 18),
+	.periods_min =		2,
+	.periods_max =		1024,
+};
+
 static snd_pcm_hardware_t snd_vt1724_2ch_stereo =
 {
 	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
@@ -628,7 +681,7 @@ static snd_pcm_hardware_t snd_vt1724_2ch_stereo =
 				 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),
 	.formats =		SNDRV_PCM_FMTBIT_S32_LE,
 	.rates =		SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_192000,
-	.rate_min =		4000,
+	.rate_min =		8000,
 	.rate_max =		192000,
 	.channels_min =		2,
 	.channels_max =		2,
@@ -639,6 +692,41 @@ static snd_pcm_hardware_t snd_vt1724_2ch_stereo =
 	.periods_max =		1024,
 };
 
+/*
+ * set rate constraints
+ */
+static int set_rate_constraints(ice1712_t *ice, snd_pcm_substream_t *substream)
+{
+	snd_pcm_runtime_t *runtime = substream->runtime;
+	if (ice->eeprom.data[ICE_EEP2_ACLINK] & 0x80) {
+		/* I2S */
+		if (ice->eeprom.data[ICE_EEP2_I2S] & 0x08)
+			return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_192);
+		else {
+			runtime->hw.rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000;
+			runtime->hw.rate_max = 96000;
+			return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_96);
+		}
+	} else if (ice->ac97) {
+		/* ACLINK */
+		int ratec;
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+			ratec = AC97_RATES_FRONT_DAC;
+		else
+			ratec = AC97_RATES_ADC;
+		runtime->hw.rates = ice->ac97->rates[ratec];
+		runtime->hw.rate_max = 48000;
+		if (runtime->hw.rates == SNDRV_PCM_RATE_48000) {
+			runtime->hw.rate_min = 48000;
+			return 0;
+		} else {
+			runtime->hw.rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000;
+			return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_48);
+		}
+	}
+	return 0;
+}
+
 /* multi-channel playback needs alignment 8x32bit regarless of the channels
  * actually used
  */
@@ -655,12 +743,7 @@ static int snd_vt1724_playback_pro_open(snd_pcm_substream_t * substream)
 	runtime->hw = snd_vt1724_playback_pro;
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-	if ((ice->eeprom.data[ICE_EEP2_ACLINK] & 0x80) &&
-	    (ice->eeprom.data[ICE_EEP2_I2S] & 0x08))
-		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_192);
-	else
-		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_96);
-
+	set_rate_constraints(ice, substream);
 	down(&ice->open_mutex);
 	/* calculate the currently available channels */
 	for (chs = 0; chs < 3; chs++) {
@@ -689,11 +772,7 @@ static int snd_vt1724_capture_pro_open(snd_pcm_substream_t * substream)
 	runtime->hw = snd_vt1724_2ch_stereo;
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-	if ((ice->eeprom.data[ICE_EEP2_ACLINK] & 0x80) &&
-	    (ice->eeprom.data[ICE_EEP2_I2S] & 0x08))
-		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_192);
-	else
-		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_96);
+	set_rate_constraints(ice, substream);
 	return 0;
 }
 
@@ -812,11 +891,13 @@ static int snd_vt1724_playback_spdif_open(snd_pcm_substream_t *substream)
 
 	runtime->private_data = (void*)VT1724_PDMA4_START; /* irq/status/trigger bit */
 	ice->playback_con_substream = substream;
-	runtime->hw = snd_vt1724_2ch_stereo;
+	if (ice->force_pdma4) {
+		runtime->hw = snd_vt1724_2ch_stereo;
+		set_rate_constraints(ice, substream);
+	} else
+		runtime->hw = snd_vt1724_spdif;
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-
-	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_192);
 	return 0;
 }
 
@@ -838,10 +919,13 @@ static int snd_vt1724_capture_spdif_open(snd_pcm_substream_t *substream)
 
 	runtime->private_data = (void*)VT1724_RDMA1_START; /* irq/status/trigger bit */
 	ice->capture_con_substream = substream;
-	runtime->hw = snd_vt1724_2ch_stereo;
+	if (ice->force_rdma1) {
+		runtime->hw = snd_vt1724_2ch_stereo;
+		set_rate_constraints(ice, substream);
+	} else
+		runtime->hw = snd_vt1724_spdif;
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_96);
 	return 0;
 }
 
@@ -881,22 +965,31 @@ static snd_pcm_ops_t snd_vt1724_capture_spdif_ops = {
 
 static int __devinit snd_vt1724_pcm_spdif(ice1712_t * ice, int device)
 {
+	char *name;
 	snd_pcm_t *pcm;
 	int play, capt;
 	int err;
 
-	if (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_OUT_INT)
+	if (ice->force_pdma4 ||
+	    (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_OUT_INT)) {
 		play = 1;
-	else
+		ice->has_spdif = 1;
+	} else
 		play = 0;
-	if (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_IN)
+	if (ice->force_rdma1 ||
+	    (ice->eeprom.data[ICE_EEP2_SPDIF] & VT1724_CFG_SPDIF_IN)) {
 		capt = 1;
-	else
+		ice->has_spdif = 1;
+	} else
 		capt = 0;
 	if (! play && ! capt)
 		return 0; /* no spdif device */
 
-	err = snd_pcm_new(ice->card, "ICE1724 IEC958", device, play, capt, &pcm);
+	if (ice->force_pdma4 || ice->force_rdma1)
+		name = "ICE1724 Secondary";
+	else
+		name = "IEC1724 IEC958";
+	err = snd_pcm_new(ice->card, name, device, play, capt, &pcm);
 	if (err < 0)
 		return err;
 
@@ -909,7 +1002,7 @@ static int __devinit snd_vt1724_pcm_spdif(ice1712_t * ice, int device)
 
 	pcm->private_data = ice;
 	pcm->info_flags = 0;
-	strcpy(pcm->name, "ICE1724 IEC958");
+	strcpy(pcm->name, name);
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 					      snd_dma_pci_data(ice->pci), 64*1024, 64*1024);
@@ -983,8 +1076,7 @@ static int snd_vt1724_playback_indep_open(snd_pcm_substream_t *substream)
 	runtime->hw = snd_vt1724_2ch_stereo;
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
-
-	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates_192);
+	set_rate_constraints(ice, substream);
 	return 0;
 }
 
@@ -1723,7 +1815,6 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
 	snd_vt1724_revo_cards,
 	snd_vt1724_amp_cards, 
 	snd_vt1724_aureon_cards,
-	snd_vt1724_prodigy_cards,
 	0,
 };
 
@@ -1731,9 +1822,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
 /*
  */
 
-static unsigned char __devinit snd_vt1724_read_i2c(ice1712_t *ice,
-						 unsigned char dev,
-						 unsigned char addr)
+unsigned char snd_vt1724_read_i2c(ice1712_t *ice, unsigned char dev, unsigned char addr)
 {
 	long t = 0x10000;
 
@@ -1743,49 +1832,71 @@ static unsigned char __devinit snd_vt1724_read_i2c(ice1712_t *ice,
 	return inb(ICEREG1724(ice, I2C_DATA));
 }
 
-static int __devinit snd_vt1724_read_eeprom(ice1712_t *ice)
+void snd_vt1724_write_i2c(ice1712_t *ice, unsigned char dev, unsigned char addr, unsigned char data)
 {
-	int dev = 0xa0;		/* EEPROM device address */
+	long t = 0x10000;
+
+	outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR));
+	outb(data, ICEREG1724(ice, I2C_DATA));
+	outb(dev | VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR));
+	while (t-- > 0 && (inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_BUSY)) ;
+}
+
+static int __devinit snd_vt1724_read_eeprom(ice1712_t *ice, const char *modelname)
+{
+	const int dev = 0xa0;		/* EEPROM device address */
 	unsigned int i, size;
 	struct snd_ice1712_card_info **tbl, *c;
 
-	if ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_EEPROM) == 0) {
-		snd_printk(KERN_WARNING "ICE1724 has not detected EEPROM\n");
-		// return -EIO;
-	}
-	ice->eeprom.subvendor = (snd_vt1724_read_i2c(ice, dev, 0x00) << 0) |
+	if (! modelname || ! *modelname) {
+		ice->eeprom.subvendor = 0;
+		if ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_EEPROM) != 0)
+			ice->eeprom.subvendor = (snd_vt1724_read_i2c(ice, dev, 0x00) << 0) |
 				(snd_vt1724_read_i2c(ice, dev, 0x01) << 8) | 
 				(snd_vt1724_read_i2c(ice, dev, 0x02) << 16) | 
 				(snd_vt1724_read_i2c(ice, dev, 0x03) << 24);
-
-	/* if the EEPROM is given by the driver, use it */
+		if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) {
+			/* invalid subvendor from EEPROM, try the PCI subststem ID instead */
+			u16 vendor, device;
+			pci_read_config_word(ice->pci, PCI_SUBSYSTEM_VENDOR_ID, &vendor);
+			pci_read_config_word(ice->pci, PCI_SUBSYSTEM_ID, &device);
+			ice->eeprom.subvendor = ((unsigned int)swab16(vendor) << 16) | swab16(device);
+			if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) {
+				printk(KERN_ERR "ice1724: No valid ID is found\n");
+				return -ENXIO;
+			}
+		}
+	}
 	for (tbl = card_tables; *tbl; tbl++) {
 		for (c = *tbl; c->subvendor; c++) {
-			if (c->subvendor == ice->eeprom.subvendor) {
-				if (! c->eeprom_size || ! c->eeprom_data)
-					goto found;
-				snd_printdd("using the defined eeprom..\n");
-				ice->eeprom.version = 2;
-				ice->eeprom.size = c->eeprom_size + 6;
-				memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size);
-				goto read_skipped;
-			}
+			if (modelname && c->model && ! strcmp(modelname, c->model)) {
+				printk(KERN_INFO "ice1724: Using board model %s\n", c->name);
+				ice->eeprom.subvendor = c->subvendor;
+			} else if (c->subvendor != ice->eeprom.subvendor)
+				continue;
+			if (! c->eeprom_size || ! c->eeprom_data)
+				goto found;
+			/* if the EEPROM is given by the driver, use it */
+			snd_printdd("using the defined eeprom..\n");
+			ice->eeprom.version = 2;
+			ice->eeprom.size = c->eeprom_size + 6;
+			memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size);
+			goto read_skipped;
 		}
 	}
+	printk(KERN_WARNING "ice1724: No matching model found for ID 0x%x\n", ice->eeprom.subvendor);
 
  found:
 	ice->eeprom.size = snd_vt1724_read_i2c(ice, dev, 0x04);
 	if (ice->eeprom.size < 6)
 		ice->eeprom.size = 32;
 	else if (ice->eeprom.size > 32) {
-		snd_printk("invalid EEPROM (size = %i)\n", ice->eeprom.size);
+		printk(KERN_ERR "ice1724: Invalid EEPROM (size = %i)\n", ice->eeprom.size);
 		return -EIO;
 	}
 	ice->eeprom.version = snd_vt1724_read_i2c(ice, dev, 0x05);
-	if (ice->eeprom.version != 2) {
-		snd_printk("invalid EEPROM version %i\n", ice->eeprom.version);
-		// return -EIO;
-	}
+	if (ice->eeprom.version != 2)
+		printk(KERN_WARNING "ice1724: Invalid EEPROM version %i\n", ice->eeprom.version);
 	size = ice->eeprom.size - 6;
 	for (i = 0; i < size; i++)
 		ice->eeprom.data[i] = snd_vt1724_read_i2c(ice, dev, i + 6);
@@ -1819,6 +1930,9 @@ static int __devinit snd_vt1724_chip_init(ice1712_t *ice)
 
 	outb(0, ICEREG1724(ice, POWERDOWN));
 
+	/* read back to check the availability of SPDIF out */
+	ice->eeprom.data[ICE_EEP2_SPDIF] = inb(ICEREG1724(ice, SPDIF_CFG));
+
 	return 0;
 }
 
@@ -1880,7 +1994,10 @@ static int __devinit snd_vt1724_build_controls(ice1712_t *ice)
 
 	if (ice->num_total_dacs > 0) {
 		snd_kcontrol_new_t tmp = snd_vt1724_mixer_pro_analog_route;
-		tmp.count = ice->num_total_dacs;
+		if (ice->vt1720)
+			tmp.count = 2;
+		else
+			tmp.count = ice->num_total_dacs;
 		err = snd_ctl_add(ice->card, snd_ctl_new1(&tmp, ice));
 		if (err < 0)
 			return err;
@@ -1927,6 +2044,7 @@ static int snd_vt1724_dev_free(snd_device_t *device)
 
 static int __devinit snd_vt1724_create(snd_card_t * card,
 				       struct pci_dev *pci,
+				       const char *modelname,
 				       ice1712_t ** r_ice1712)
 {
 	ice1712_t *ice;
@@ -1982,7 +2100,7 @@ static int __devinit snd_vt1724_create(snd_card_t * card,
 
 	ice->irq = pci->irq;
 
-	if (snd_vt1724_read_eeprom(ice) < 0) {
+	if (snd_vt1724_read_eeprom(ice, modelname) < 0) {
 		snd_vt1724_free(ice);
 		return -EIO;
 	}
@@ -2041,7 +2159,7 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
 	strcpy(card->driver, "ICE1724");
 	strcpy(card->shortname, "ICEnsemble ICE1724");
 	
-	if ((err = snd_vt1724_create(card, pci, &ice)) < 0) {
+	if ((err = snd_vt1724_create(card, pci, model[dev], &ice)) < 0) {
 		snd_card_free(card);
 		return err;
 	}
@@ -2050,6 +2168,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
 		for (c = *tbl; c->subvendor; c++) {
 			if (c->subvendor == ice->eeprom.subvendor) {
 				strcpy(card->shortname, c->name);
+				if (c->driver) /* specific driver? */
+					strcpy(card->driver, c->driver);
 				if (c->chip_init) {
 					if ((err = c->chip_init(ice)) < 0) {
 						snd_card_free(card);
@@ -2088,7 +2208,7 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	if (ice->pcm) { /* has SPDIF I/O */
+	if (ice->pcm && ice->has_spdif) { /* has SPDIF I/O */
 		if ((err = snd_vt1724_spdif_build_controls(ice)) < 0) {
 			snd_card_free(card);
 			return err;
@@ -2141,15 +2261,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_ice1724_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "ICE1724 soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_ice1724_exit(void)
@@ -2159,24 +2271,3 @@ static void __exit alsa_card_ice1724_exit(void)
 
 module_init(alsa_card_ice1724_init)
 module_exit(alsa_card_ice1724_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ice1724=enable,index,id */
-
-static int __init alsa_card_ice1724_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-ice1724=", alsa_card_ice1724_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
index 5c171aed0..805631270 100644
--- a/sound/pci/ice1712/revo.c
+++ b/sound/pci/ice1712/revo.c
@@ -171,10 +171,11 @@ static int __devinit revo_add_controls(ice1712_t *ice)
 /* entry point */
 struct snd_ice1712_card_info snd_vt1724_revo_cards[] __devinitdata = {
 	{
-		VT1724_SUBDEVICE_REVOLUTION71,
-		"M Audio Revolution-7.1",
-		revo_init,
-		revo_add_controls,
+		.subvendor = VT1724_SUBDEVICE_REVOLUTION71,
+		.name = "M Audio Revolution-7.1",
+		.model = "revo71",
+		.chip_init = revo_init,
+		.build_controls = revo_add_controls,
 	},
 	{ } /* terminator */
 };
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index e03f67fed..e6b14ad77 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -34,12 +34,12 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
 #include <sound/info.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 /* for 440MX workaround */
 #include <asm/pgtable.h>
@@ -81,29 +81,30 @@ static int joystick[SNDRV_CARDS];
 #ifdef SUPPORT_MIDI
 static int mpu_port[SNDRV_CARDS]; /* disabled */
 #endif
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Intel i8x0 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Intel i8x0 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Intel i8x0 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ac97_clock, int, boot_devs, 0444);
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
 MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:0");
-MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ac97_quirk, int, boot_devs, 0444);
 MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
 MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,4}},dialog:list,default:-1");
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick, bool, boot_devs, 0444);
 MODULE_PARM_DESC(joystick, "Enable joystick for Intel i8x0 soundcard.");
 MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 #endif
 #ifdef SUPPORT_MIDI
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mpu_port, int, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU401 port # for Intel i8x0 driver.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x300}},dialog:list");
 #endif
@@ -235,6 +236,7 @@ DEFINE_REGSET(SP, 0x60);	/* SPDIF out */
 #define   ICH_P2INT		0x02000000	/* ICH4: PCM2-In interrupt */
 #define   ICH_M2INT		0x01000000	/* ICH4: Mic2-In interrupt */
 #define   ICH_SAMPLE_CAP	0x00c00000	/* ICH4: sample capability bits (RO) */
+#define   ICH_SAMPLE_16_20	0x00400000	/* ICH4: 16- and 20-bit samples */
 #define   ICH_MULTICHAN_CAP	0x00300000	/* ICH4: multi-channel capability bits (RO) */
 #define   ICH_MD3		0x00020000	/* modem power down semaphore */
 #define   ICH_AD3		0x00010000	/* audio power down semaphore */
@@ -378,6 +380,7 @@ typedef struct {
         unsigned int fragsize;
         unsigned int fragsize1;
         unsigned int position;
+	unsigned int pos_shift;
         int frags;
         int lvi;
         int lvi_frag;
@@ -441,10 +444,9 @@ struct _snd_intel8x0 {
 	struct snd_dma_buffer bdbars;
 	u32 int_sta_reg;		/* interrupt status register */
 	u32 int_sta_mask;		/* interrupt status mask */
-	unsigned int pcm_pos_shift;
-	
+
 #ifdef CONFIG_PM
-	int in_suspend;
+	u32 pci_state[64 / sizeof(u32)];
 #endif
 };
 
@@ -719,10 +721,10 @@ static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev)
 		for (idx = 0; idx < (ICH_REG_LVI_MASK + 1) * 2; idx += 4) {
 			bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf);
 			bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */
-						     ichdev->fragsize1 >> chip->pcm_pos_shift);
+						     ichdev->fragsize1 >> ichdev->pos_shift);
 			bdbar[idx + 2] = cpu_to_le32(ichdev->physbuf + (ichdev->size >> 1));
 			bdbar[idx + 3] = cpu_to_le32(0x80000000 | /* interrupt on completion */
-						     ichdev->fragsize1 >> chip->pcm_pos_shift);
+						     ichdev->fragsize1 >> ichdev->pos_shift);
 		}
 		ichdev->frags = 2;
 	} else {
@@ -731,7 +733,7 @@ static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev)
 		for (idx = 0; idx < (ICH_REG_LVI_MASK + 1) * 2; idx += 2) {
 			bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size));
 			bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */
-						     ichdev->fragsize >> chip->pcm_pos_shift);
+						     ichdev->fragsize >> ichdev->pos_shift);
 			// printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]);
 		}
 		ichdev->frags = ichdev->size / ichdev->fragsize;
@@ -773,11 +775,14 @@ static void fill_nocache(void *buf, int size, int nocache)
 static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev)
 {
 	unsigned long port = ichdev->reg_offset;
-	int civ, i, step;
+	int status, civ, i, step;
 	int ack = 0;
 
+	status = igetbyte(chip, port + ichdev->roff_sr);
 	civ = igetbyte(chip, port + ICH_REG_OFF_CIV);
-	if (civ == ichdev->civ) {
+	if (!(status & ICH_BCIS)) {
+		step = 0;
+	} else if (civ == ichdev->civ) {
 		// snd_printd("civ same %d\n", civ);
 		step = 1;
 		ichdev->civ++;
@@ -811,7 +816,8 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev)
 		snd_pcm_period_elapsed(ichdev->substream);
 		spin_lock(&chip->reg_lock);
 	}
-	iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
+	iputbyte(chip, port + ichdev->roff_sr,
+		 status & (ICH_FIFOE | ICH_BCIS | ICH_LVBCI));
 }
 
 static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -981,7 +987,8 @@ static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream)
 	return snd_pcm_lib_free_pages(substream);
 }
 
-static void snd_intel8x0_setup_multi_channels(intel8x0_t *chip, int channels)
+static void snd_intel8x0_setup_pcm_out(intel8x0_t *chip,
+				       int channels, int sample_bits)
 {
 	unsigned int cnt;
 	switch (chip->device_type) {
@@ -1005,7 +1012,7 @@ static void snd_intel8x0_setup_multi_channels(intel8x0_t *chip, int channels)
 		break;
 	default:
 		cnt = igetdword(chip, ICHREG(GLOB_CNT));
-		cnt &= ~ICH_PCM_246_MASK;
+		cnt &= ~(ICH_PCM_246_MASK | ICH_PCM_20BIT);
 		if (chip->multi4 && channels == 4)
 			cnt |= ICH_PCM_4;
 		else if (chip->multi6 && channels == 6)
@@ -1016,6 +1023,9 @@ static void snd_intel8x0_setup_multi_channels(intel8x0_t *chip, int channels)
 			 */
 			iputdword(chip, ICHREG(GLOB_CNT), (cnt & 0xcfffff));
 			mdelay(50); /* grrr... */
+		} else if (chip->device_type == DEVICE_INTEL_ICH4) {
+			if (sample_bits > 16)
+				cnt |= ICH_PCM_20BIT;
 		}
 		iputdword(chip, ICHREG(GLOB_CNT), cnt);
 		break;
@@ -1033,8 +1043,12 @@ static int snd_intel8x0_pcm_prepare(snd_pcm_substream_t * substream)
 	ichdev->fragsize = snd_pcm_lib_period_bytes(substream);
 	if (ichdev->ichd == ICHD_PCMOUT) {
 		spin_lock(&chip->reg_lock);
-		snd_intel8x0_setup_multi_channels(chip, runtime->channels);
+		snd_intel8x0_setup_pcm_out(chip, runtime->channels,
+					   runtime->sample_bits);
 		spin_unlock(&chip->reg_lock);
+		if (chip->device_type == DEVICE_INTEL_ICH4) {
+			ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1;
+		}
 	}
 	snd_intel8x0_setup_periods(chip, ichdev);
 	return 0;
@@ -1047,7 +1061,7 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substrea
 	unsigned long flags;
 	size_t ptr1, ptr;
 
-	ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << chip->pcm_pos_shift;
+	ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << ichdev->pos_shift;
 	if (ptr1 != 0)
 		ptr = ichdev->fragsize1 - ptr1;
 	else
@@ -1142,6 +1156,8 @@ static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream)
 		runtime->hw.channels_max = 4;
 		snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels4);
 	}
+	if (chip->smp20bit)
+		runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE;
 	return 0;
 }
 
@@ -1844,6 +1860,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, int ac
 	memset(&ac97, 0, sizeof(ac97));
 	ac97.private_data = chip;
 	ac97.private_free = snd_intel8x0_mixer_free_ac97;
+	ac97.scaps = AC97_SCAP_SKIP_MODEM;
 	if (chip->device_type != DEVICE_ALI) {
 		glob_sta = igetdword(chip, ICHREG(GLOB_STA));
 		bus.write = snd_intel8x0_codec_write;
@@ -1892,7 +1909,8 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, int ac
 	for (i = 0; i < codecs; i++) {
 		ac97.num = i;
 		if ((err = snd_ac97_mixer(pbus, &ac97, &x97)) < 0) {
-			snd_printk(KERN_ERR "Unable to initialize codec #%d\n", i);
+			if (err != -EACCES)
+				snd_printk(KERN_ERR "Unable to initialize codec #%d\n", i);
 			if (i == 0)
 				goto __err;
 			continue;
@@ -1946,6 +1964,10 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, int ac
 		if (pbus->pcms[0].r[0].slots & (1 << AC97_SLOT_LFE))
 			chip->multi6 = 1;
 	}
+	if (chip->device_type == DEVICE_INTEL_ICH4) {
+		if ((igetdword(chip, ICHREG(GLOB_STA)) & ICH_SAMPLE_CAP) == ICH_SAMPLE_16_20)
+			chip->smp20bit = 1;
+	}
 	if (chip->device_type == DEVICE_NFORCE) {
 		/* 48kHz only */
 		chip->ichd[spdif_idx].pcm->rates = SNDRV_PCM_RATE_48000;
@@ -2184,74 +2206,54 @@ static int snd_intel8x0_free(intel8x0_t *chip)
 /*
  * power management
  */
-static void intel8x0_suspend(intel8x0_t *chip)
+static int intel8x0_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	intel8x0_t *chip = snd_magic_cast(intel8x0_t, card->pm_private_data, return -EINVAL);
 	int i;
 
-	if (chip->in_suspend ||
-	    card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
-
-	chip->in_suspend = 1;
 	for (i = 0; i < chip->pcm_devs; i++)
 		snd_pcm_suspend_all(chip->pcm[i]);
+	for (i = 0; i < 3; i++)
+		if (chip->ac97[i])
+			snd_ac97_suspend(chip->ac97[i]);
+	pci_save_state(chip->pci, chip->pci_state);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void intel8x0_resume(intel8x0_t *chip)
+static int intel8x0_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	intel8x0_t *chip = snd_magic_cast(intel8x0_t, card->pm_private_data, return -EINVAL);
 	int i;
 
-	if (! chip->in_suspend ||
-	    card->power_state == SNDRV_CTL_POWER_D0)
-		return;
-
+	pci_restore_state(chip->pci, chip->pci_state);
 	pci_enable_device(chip->pci);
 	pci_set_master(chip->pci);
 	snd_intel8x0_chip_init(chip, 0);
+
+	/* refill nocache */
+	if (chip->fix_nocache)
+		fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 1);
+
 	for (i = 0; i < 3; i++)
 		if (chip->ac97[i])
 			snd_ac97_resume(chip->ac97[i]);
 
-	chip->in_suspend = 0;
-	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_intel8x0_suspend(struct pci_dev *dev, u32 state)
-{
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return -ENXIO);
-	intel8x0_suspend(chip);
-	return 0;
-}
-static int snd_intel8x0_resume(struct pci_dev *dev)
-{
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return -ENXIO);
-	intel8x0_resume(chip);
-	return 0;
-}
-
-/* callback */
-static int snd_intel8x0_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		intel8x0_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		intel8x0_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
+	/* refill nocache */
+	if (chip->fix_nocache) {
+		for (i = 0; i < chip->bdbars_count; i++) {
+			ichdev_t *ichdev = &chip->ichd[i];
+			if (ichdev->substream) {
+				snd_pcm_runtime_t *runtime = ichdev->substream->runtime;
+				if (runtime->dma_area)
+					fill_nocache(runtime->dma_area, runtime->dma_bytes, 1);
+			}
+		}
 	}
+
+	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
 	return 0;
 }
-
 #endif /* CONFIG_PM */
 
 #define INTEL8X0_TESTBUF_SIZE	32768	/* enough large for one shot */
@@ -2305,7 +2307,7 @@ static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip)
 	spin_lock_irqsave(&chip->reg_lock, flags);
 	/* check the position */
 	pos = ichdev->fragsize1;
-	pos -= igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << chip->pcm_pos_shift;
+	pos -= igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << ichdev->pos_shift;
 	pos += ichdev->position;
 	do_gettimeofday(&stop_time);
 	/* stop */
@@ -2546,9 +2548,9 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
 		}
 		if (device_type == DEVICE_ALI)
 			ichdev->ali_slot = (ichdev->reg_offset - 0x40) / 0x10;
+		/* SIS7012 handles the pcm data in bytes, others are in samples */
+		ichdev->pos_shift = (device_type == DEVICE_SIS) ? 0 : 1;
 	}
-	/* SIS7012 handles the pcm data in bytes, others are in words */
-	chip->pcm_pos_shift = (device_type == DEVICE_SIS) ? 0 : 1;
 
 	memset(&chip->dma_dev, 0, sizeof(chip->dma_dev));
 	chip->dma_dev.type = SNDRV_DMA_TYPE_DEV;
@@ -2581,10 +2583,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
 		return err;
 	}
 
-#ifdef CONFIG_PM
-	card->set_power_state = snd_intel8x0_set_power_state;
-	card->power_state_private_data = chip;
-#endif
+	snd_card_set_pm_callback(card, intel8x0_suspend, intel8x0_resume, chip);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
 		snd_intel8x0_free(chip);
@@ -2692,16 +2691,14 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_intel8x0_remove(struct pci_dev *pci)
 {
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -2710,10 +2707,7 @@ static struct pci_driver driver = {
 	.id_table = snd_intel8x0_ids,
 	.probe = snd_intel8x0_probe,
 	.remove = __devexit_p(snd_intel8x0_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_intel8x0_suspend,
-	.resume = snd_intel8x0_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 
 
@@ -2817,12 +2811,9 @@ static int __init alsa_card_intel8x0_init(void)
 {
 	int err;
 
-        if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Intel ICH soundcard not found or device busy\n");
-#endif
+        if ((err = pci_module_init(&driver)) < 0)
                 return err;
-        }
+
 #if defined(SUPPORT_JOYSTICK) || defined(SUPPORT_MIDI)
 	if (pci_module_init(&joystick_driver) < 0) {
 		snd_printdd(KERN_INFO "no joystick found\n");
@@ -2847,33 +2838,3 @@ static void __exit alsa_card_intel8x0_exit(void)
 
 module_init(alsa_card_intel8x0_init)
 module_exit(alsa_card_intel8x0_exit)
-
-#ifndef MODULE
-
-/* format is: snd-intel8x0=enable,index,id,ac97_clock,ac97_quirk,mpu_port,joystick */
-
-static int __init alsa_card_intel8x0_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&ac97_clock[nr_dev]) == 2 &&
-	       get_option(&str,&ac97_quirk[nr_dev]) == 2
-#ifdef SUPPORT_MIDI
-	       && get_option(&str,&mpu_port[nr_dev]) == 2
-#endif
-#ifdef SUPPORT_JOYSTICK
-	       && get_option(&str,&joystick[nr_dev]) == 2
-#endif
-	       );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-intel8x0=", alsa_card_intel8x0_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index feac6c64b..6046ac13a 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -31,12 +31,12 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
 #include <sound/info.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -56,17 +56,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Intel i8x0 modemcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Intel i8x0 modemcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Intel i8x0 modemcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ac97_clock, int, boot_devs, 0444);
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
 MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:0");
 
@@ -266,10 +267,6 @@ struct _snd_intel8x0m {
 	u32 int_sta_reg;		/* interrupt status register */
 	u32 int_sta_mask;		/* interrupt status mask */
 	unsigned int pcm_pos_shift;
-	
-#ifdef CONFIG_PM
-	int in_suspend;
-#endif
 };
 
 static struct pci_device_id snd_intel8x0m_ids[] = {
@@ -905,6 +902,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
 	memset(&ac97, 0, sizeof(ac97));
 	ac97.private_data = chip;
 	ac97.private_free = snd_intel8x0_mixer_free_ac97;
+	ac97.scaps = AC97_SCAP_SKIP_AUDIO;
 
 	glob_sta = igetdword(chip, ICHREG(GLOB_STA));
 	bus.write = snd_intel8x0_codec_write;
@@ -1081,72 +1079,31 @@ static int snd_intel8x0_free(intel8x0_t *chip)
 /*
  * power management
  */
-static void intel8x0_suspend(intel8x0_t *chip)
+static int intel8x0m_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	intel8x0_t *chip = snd_magic_cast(intel8x0_t, card->pm_private_data, return -EINVAL);
 	int i;
 
-	if (chip->in_suspend ||
-	    card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
-
-	chip->in_suspend = 1;
 	for (i = 0; i < chip->pcm_devs; i++)
 		snd_pcm_suspend_all(chip->pcm[i]);
+	if (chip->ac97)
+		snd_ac97_suspend(chip->ac97);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void intel8x0_resume(intel8x0_t *chip)
+static int intel8x0m_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (! chip->in_suspend ||
-	    card->power_state == SNDRV_CTL_POWER_D0)
-		return;
-
+	intel8x0_t *chip = snd_magic_cast(intel8x0_t, card->pm_private_data, return -EINVAL);
 	pci_enable_device(chip->pci);
 	pci_set_master(chip->pci);
 	snd_intel8x0_chip_init(chip, 0);
 	if (chip->ac97)
 		snd_ac97_resume(chip->ac97);
 
-	chip->in_suspend = 0;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_intel8x0m_suspend(struct pci_dev *dev, u32 state)
-{
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return -ENXIO);
-	intel8x0_suspend(chip);
-	return 0;
-}
-static int snd_intel8x0m_resume(struct pci_dev *dev)
-{
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(dev), return -ENXIO);
-	intel8x0_resume(chip);
 	return 0;
 }
-
-/* callback */
-static int snd_intel8x0_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		intel8x0_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		intel8x0_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 #endif /* CONFIG_PM */
 
 static void snd_intel8x0m_proc_read(snd_info_entry_t * entry,
@@ -1338,10 +1295,7 @@ static int __devinit snd_intel8x0m_create(snd_card_t * card,
 		return err;
 	}
 
-#ifdef CONFIG_PM
-	card->set_power_state = snd_intel8x0_set_power_state;
-	card->power_state_private_data = chip;
-#endif
+	snd_card_set_pm_callback(card, intel8x0m_suspend, intel8x0m_resume, chip);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
 		snd_intel8x0_free(chip);
@@ -1436,16 +1390,14 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_intel8x0m_remove(struct pci_dev *pci)
 {
-	intel8x0_t *chip = snd_magic_cast(intel8x0_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -1454,25 +1406,13 @@ static struct pci_driver driver = {
 	.id_table = snd_intel8x0m_ids,
 	.probe = snd_intel8x0m_probe,
 	.remove = __devexit_p(snd_intel8x0m_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_intel8x0m_suspend,
-	.resume = snd_intel8x0m_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 
 
 static int __init alsa_card_intel8x0m_init(void)
 {
-	int err;
-
-        if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Intel ICH modemcard not found or device busy\n");
-#endif
-                return err;
-        }
-
-        return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_intel8x0m_exit(void)
@@ -1482,26 +1422,3 @@ static void __exit alsa_card_intel8x0m_exit(void)
 
 module_init(alsa_card_intel8x0m_init)
 module_exit(alsa_card_intel8x0m_exit)
-
-#ifndef MODULE
-
-/* format is: snd-intel8x0=enable,index,id,ac97_clock,mpu_port,joystick */
-
-static int __init alsa_card_intel8x0m_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&ac97_clock[nr_dev]) == 2
-	       );
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-intel8x0m=", alsa_card_intel8x0m_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index d196d2248..edd226021 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -26,13 +26,13 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -417,14 +417,15 @@ MODULE_DEVICES("{{KORG,korg1212}}");
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	   /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Korg 1212 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Korg 1212 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
@@ -1327,7 +1328,7 @@ static int snd_korg1212_silence(korg1212_t *korg1212, int pos, int count, int of
 	return 0;
 }
 
-static int snd_korg1212_copy_to(korg1212_t *korg1212, void *dst, int pos, int count, int offset, int size)
+static int snd_korg1212_copy_to(korg1212_t *korg1212, void __user *dst, int pos, int count, int offset, int size)
 {
 	KorgAudioFrame * src =  korg1212->recordDataBufsPtr[0].bufferData + pos;
 	int i, rc;
@@ -1345,7 +1346,7 @@ static int snd_korg1212_copy_to(korg1212_t *korg1212, void *dst, int pos, int co
 			return -EFAULT;
 		}
 #endif
-		rc = copy_to_user((void*) dst + offset, src, size);
+		rc = copy_to_user(dst + offset, src, size);
 		if (rc) {
 #if K1212_DEBUG_LEVEL > 0
 			K1212_DEBUG_PRINTK("K1212_DEBUG: snd_korg1212_copy_to USER EFAULT src=%p dst=%p iter=%d\n", src, dst, i);
@@ -1359,7 +1360,7 @@ static int snd_korg1212_copy_to(korg1212_t *korg1212, void *dst, int pos, int co
 	return 0;
 }
 
-static int snd_korg1212_copy_from(korg1212_t *korg1212, void *src, int pos, int count, int offset, int size)
+static int snd_korg1212_copy_from(korg1212_t *korg1212, void __user *src, int pos, int count, int offset, int size)
 {
 	KorgAudioFrame * dst =  korg1212->playDataBufsPtr[0].bufferData + pos;
 	int i, rc;
@@ -1670,7 +1671,7 @@ static snd_pcm_uframes_t snd_korg1212_capture_pointer(snd_pcm_substream_t *subst
 static int snd_korg1212_playback_copy(snd_pcm_substream_t *substream,
                         int channel, /* not used (interleaved data) */
                         snd_pcm_uframes_t pos,
-                        void *src,
+                        void __user *src,
                         snd_pcm_uframes_t count)
 {
         korg1212_t *korg1212 = _snd_pcm_substream_chip(substream);
@@ -1700,7 +1701,7 @@ static int snd_korg1212_playback_silence(snd_pcm_substream_t *substream,
 static int snd_korg1212_capture_copy(snd_pcm_substream_t *substream,
                         int channel, /* not used (interleaved data) */
                         snd_pcm_uframes_t pos,
-                        void *dst,
+                        void __user *dst,
                         snd_pcm_uframes_t count)
 {
         korg1212_t *korg1212 = _snd_pcm_substream_chip(substream);
@@ -2504,15 +2505,14 @@ snd_korg1212_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, korg1212);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_korg1212_remove(struct pci_dev *pci)
 {
-	korg1212_t *korg1212 = pci_get_drvdata(pci);
-	snd_card_free(korg1212->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -2525,15 +2525,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_korg1212_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "No Korg 1212IO cards found\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_korg1212_exit(void)
@@ -2543,25 +2535,3 @@ static void __exit alsa_card_korg1212_exit(void)
 
 module_init(alsa_card_korg1212_init)
 module_exit(alsa_card_korg1212_exit)
-
-#ifndef MODULE
-
-/* format is: snd-korg1212=enable,index,id */
-
-static int __init alsa_card_korg1212_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-korg1212=", alsa_card_korg1212_setup);
-
-#endif /* ifndef MODULE */
-
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 26a5de08d..8c0bc7694 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -39,13 +39,13 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/mpu401.h>
 #include <sound/ac97_codec.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Zach Brown <zab@zabbo.net>, Takashi Iwai <tiwai@suse.de>");
@@ -63,20 +63,21 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* all enabled */
 static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
 static int amp_gpio[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable this soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(external_amp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(external_amp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(external_amp, "Enable external amp for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(external_amp, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
-MODULE_PARM(amp_gpio, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(amp_gpio, int, boot_devs, 0444);
 MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
 MODULE_PARM_SYNTAX(amp_gpio, SNDRV_ENABLED);
 
@@ -2410,18 +2411,16 @@ static int snd_m3_free(m3_t *chip)
  * APM support
  */
 #ifdef CONFIG_PM
-
-static void m3_suspend(m3_t *chip)
+static int m3_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	m3_t *chip = snd_magic_cast(m3_t, card->pm_private_data, return -EINVAL);
 	int i, index;
 
 	if (chip->suspend_mem == NULL)
-		return;
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
+		return 0;
 
 	snd_pcm_suspend_all(chip->pcm);
+	snd_ac97_suspend(chip->ac97);
 
 	big_mdelay(10); /* give the assp a chance to idle.. */
 
@@ -2440,17 +2439,16 @@ static void m3_suspend(m3_t *chip)
 	snd_m3_outw(chip, 0xffff, 0x54);
 	snd_m3_outw(chip, 0xffff, 0x56);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void m3_resume(m3_t *chip)
+static int m3_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	m3_t *chip = snd_magic_cast(m3_t, card->pm_private_data, return -EINVAL);
 	int i, index;
 
 	if (chip->suspend_mem == NULL)
-		return;
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+		return 0;
 
 	/* first lets just bring everything back. .*/
 	snd_m3_outw(chip, 0, 0x54);
@@ -2481,41 +2479,8 @@ static void m3_resume(m3_t *chip)
 	snd_m3_amp_enable(chip, 1);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_m3_suspend(struct pci_dev *pci, u32 state)
-{
-	m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return -ENXIO);
-	m3_suspend(chip);
-	return 0;
-}
-static int snd_m3_resume(struct pci_dev *pci)
-{
-	m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return -ENXIO);
-	m3_resume(chip);
-	return 0;
-}
-
-/* callback */
-static int snd_m3_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	m3_t *chip = snd_magic_cast(m3_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		m3_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		m3_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
 	return 0;
 }
-
 #endif /* CONFIG_PM */
 
 
@@ -2651,11 +2616,9 @@ snd_m3_create(snd_card_t *card, struct pci_dev *pci,
 #ifdef CONFIG_PM
 	chip->suspend_mem = vmalloc(sizeof(u16) * (REV_B_CODE_MEMORY_LENGTH + REV_B_DATA_MEMORY_LENGTH));
 	if (chip->suspend_mem == NULL)
-		snd_printk("can't allocate apm buffer\n");
-	else {
-		card->set_power_state = snd_m3_set_power_state;
-		card->power_state_private_data = chip;
-	}
+		snd_printk(KERN_WARNING "can't allocate apm buffer\n");
+	else
+		snd_card_set_pm_callback(card, m3_suspend, m3_resume, chip);
 #endif
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
@@ -2738,16 +2701,14 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 		printk(KERN_WARNING "maestro3: no midi support.\n");
 #endif
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_m3_remove(struct pci_dev *pci)
 {
-	m3_t *chip = snd_magic_cast(m3_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -2756,23 +2717,12 @@ static struct pci_driver driver = {
 	.id_table = snd_m3_ids,
 	.probe = snd_m3_probe,
 	.remove = __devexit_p(snd_m3_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_m3_suspend,
-	.resume = snd_m3_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 	
 static int __init alsa_card_m3_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Maestro3/Allegro soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_m3_exit(void)
@@ -2782,26 +2732,3 @@ static void __exit alsa_card_m3_exit(void)
 
 module_init(alsa_card_m3_init)
 module_exit(alsa_card_m3_exit)
-
-#ifndef MODULE
-
-/* format is: snd-maestro3=enable,index,id,external_amp,amp_gpio */
-
-static int __init alsa_card_maestro3_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&external_amp[nr_dev]) == 2 &&
-	       get_option(&str,&amp_gpio[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-maestro3=", alsa_card_maestro3_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index a7041d850..2b918cc7f 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -25,8 +25,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -48,16 +48,17 @@ MODULE_DEVICES("{{Digigram," CARD_NAME "}}");
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;             /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;              /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;     /* Enable this card */
+static int boot_devs;
 
 #define chip_t mixart_t
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Digigram " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Digigram " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 
@@ -1153,7 +1154,7 @@ static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry,
   mixart_BA0 proc interface for BAR 0 - read callback
  */
 static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char *buf, long count)
+				struct file *file, char __user *buf, long count)
 {
 	mixart_mgr_t *mgr = snd_magic_cast(mixart_mgr_t, entry->private_data, return -ENXIO);
 
@@ -1172,7 +1173,7 @@ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data
   mixart_BA1 proc interface for BAR 1 - read callback
  */
 static long snd_mixart_BA1_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char *buf, long count)
+				struct file *file, char __user *buf, long count)
 {
 	mixart_mgr_t *mgr = snd_magic_cast(mixart_mgr_t, entry->private_data, return -ENXIO);
 
@@ -1432,15 +1433,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_mixart_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		snd_printk(KERN_ERR "Digigram miXart soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_mixart_exit(void)
@@ -1450,24 +1443,3 @@ static void __exit alsa_card_mixart_exit(void)
 
 module_init(alsa_card_mixart_init)
 module_exit(alsa_card_mixart_exit)
-
-#ifndef MODULE
-
-/* format is: snd-mixart=enable,index,id */
-
-static int __init alsa_card_mixart_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-mixart=", alsa_card_mixart_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index a6afea5e3..ee3b246bb 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -31,12 +31,12 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/ac97_codec.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #define CARD_NAME "NeoMagic 256AV/ZX"
@@ -62,32 +62,33 @@ static int force_ac97[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disable
 static int buffer_top[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* not specified */
 static int use_cache[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */
 static int vaio_hack[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* disabled */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable this soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(playback_bufsize, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(playback_bufsize, int, boot_devs, 0444);
 MODULE_PARM_DESC(playback_bufsize, "DAC frame size in kB for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(playback_bufsize, SNDRV_ENABLED);
-MODULE_PARM(capture_bufsize, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(capture_bufsize, int, boot_devs, 0444);
 MODULE_PARM_DESC(capture_bufsize, "ADC frame size in kB for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(capture_bufsize, SNDRV_ENABLED);
-MODULE_PARM(force_ac97, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(force_ac97, bool, boot_devs, 0444);
 MODULE_PARM_DESC(force_ac97, "Force to use AC97 codec for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(force_ac97, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
-MODULE_PARM(buffer_top, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(buffer_top, int, boot_devs, 0444);
 MODULE_PARM_DESC(buffer_top, "Set the top address of audio buffer for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(buffer_top, SNDRV_ENABLED);
-MODULE_PARM(use_cache, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(use_cache, bool, boot_devs, 0444);
 MODULE_PARM_DESC(use_cache, "Enable the cache for coefficient table access.");
 MODULE_PARM_SYNTAX(use_cache, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
-MODULE_PARM(vaio_hack, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(vaio_hack, bool, boot_devs, 0444);
 MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks.");
 MODULE_PARM_SYNTAX(vaio_hack, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -274,11 +275,15 @@ struct snd_nm256 {
 #ifndef PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO
 #define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
 #endif
+#ifndef PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO
+#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
+#endif
 
 
 static struct pci_device_id snd_nm256_ids[] = {
 	{PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{0,},
 };
 
@@ -679,7 +684,7 @@ static int
 snd_nm256_playback_copy(snd_pcm_substream_t *substream,
 			int channel, /* not used (interleaved data) */
 			snd_pcm_uframes_t pos,
-			void *src,
+			void __user *src,
 			snd_pcm_uframes_t count)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
@@ -1283,24 +1288,20 @@ snd_nm256_peek_for_sig(nm256_t *chip)
  * APM event handler, so the card is properly reinitialized after a power
  * event.
  */
-static void nm256_suspend(nm256_t *chip)
+static int nm256_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
+	nm256_t *chip = snd_magic_cast(nm256_t, card->pm_private_data, return -EINVAL);
 
 	snd_pcm_suspend_all(chip->pcm);
+	snd_ac97_suspend(chip->ac97);
 	chip->coeffs_current = 0;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void nm256_resume(nm256_t *chip)
+static int nm256_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+	nm256_t *chip = snd_magic_cast(nm256_t, card->pm_private_data, return -EINVAL);
 
 	/* Perform a full reset on the hardware */
 	pci_enable_device(chip->pci);
@@ -1310,41 +1311,8 @@ static void nm256_resume(nm256_t *chip)
 	snd_ac97_resume(chip->ac97);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_nm256_suspend(struct pci_dev *dev, u32 state)
-{
-	nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(dev), return -ENXIO);
-	nm256_suspend(chip);
-	return 0;
-}
-static int snd_nm256_resume(struct pci_dev *dev)
-{
-	nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(dev), return -ENXIO);
-	nm256_resume(chip);
-	return 0;
-}
-
-/* callback */
-static int snd_nm256_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	nm256_t *chip = snd_magic_cast(nm256_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		nm256_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		nm256_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
 	return 0;
 }
-
 #endif /* CONFIG_PM */
 
 static int snd_nm256_free(nm256_t *chip)
@@ -1552,10 +1520,7 @@ snd_nm256_create(snd_card_t *card, struct pci_dev *pci,
 
 	// pci_set_master(pci); /* needed? */
 	
-#ifdef CONFIG_PM
-	card->set_power_state = snd_nm256_set_power_state;
-	card->power_state_private_data = chip;
-#endif
+	snd_card_set_pm_callback(card, nm256_suspend, nm256_resume, chip);
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
 		goto __error;
@@ -1571,6 +1536,21 @@ __error:
 }
 
 
+struct nm256_quirk {
+	unsigned short vendor;
+	unsigned short device;
+	int type;
+};
+
+#define NM_BLACKLISTED	1
+
+static struct nm256_quirk nm256_quirks[] __devinitdata = {
+	/* HP omnibook 4150 has cs4232 codec internally */
+	{ .vendor = 0x103c, .device = 0x0007, .type = NM_BLACKLISTED },
+	{ } /* terminator */
+};
+
+
 static int __devinit snd_nm256_probe(struct pci_dev *pci,
 				     const struct pci_device_id *pci_id)
 {
@@ -1579,6 +1559,8 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
 	nm256_t *chip;
 	int err;
 	unsigned int xbuffer_top;
+	struct nm256_quirk *q;
+	u16 subsystem_vendor, subsystem_device;
 
 	if ((err = pci_enable_device(pci)) < 0)
 		return err;
@@ -1590,6 +1572,18 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
 		return -ENOENT;
 	}
 
+	pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
+	pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsystem_device);
+
+	for (q = nm256_quirks; q->vendor; q++) {
+		if (q->vendor == subsystem_vendor && q->device == subsystem_device) {
+			if (q->type == NM_BLACKLISTED) {
+				printk(KERN_INFO "nm256: The device is blacklisted.  Loading stopped\n");
+				return -ENODEV;
+			}
+		}
+	}
+
 	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
 	if (card == NULL)
 		return -ENOMEM;
@@ -1601,6 +1595,9 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
 	case PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO:
 		strcpy(card->driver, "NM256ZX");
 		break;
+	case PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO:
+		strcpy(card->driver, "NM256XL+");
+		break;
 	default:
 		snd_printk("invalid device id 0x%x\n", pci->device);
 		snd_card_free(card);
@@ -1641,16 +1638,14 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_nm256_remove(struct pci_dev *pci)
 {
-	nm256_t *chip = snd_magic_cast(nm256_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -1660,23 +1655,13 @@ static struct pci_driver driver = {
 	.id_table = snd_nm256_ids,
 	.probe = snd_nm256_probe,
 	.remove = __devexit_p(snd_nm256_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_nm256_suspend,
-	.resume = snd_nm256_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 
 
 static int __init alsa_card_nm256_init(void)
 {
-	int err;
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "NeoMagic 256 audio soundchip not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_nm256_exit(void)
@@ -1686,31 +1671,3 @@ static void __exit alsa_card_nm256_exit(void)
 
 module_init(alsa_card_nm256_init)
 module_exit(alsa_card_nm256_exit)
-
-#ifndef MODULE
-
-/* format is: snd-nm256=enable,index,id,
-			playback_bufsize,capture_bufsize,
-			force_ac97,buffer_top,use_cache */
-
-static int __init alsa_card_nm256_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&playback_bufsize[nr_dev]) == 2 &&
-	       get_option(&str,&capture_bufsize[nr_dev]) == 2 &&
-	       get_option(&str,&force_ac97[nr_dev]) == 2 &&
-	       get_option(&str,&buffer_top[nr_dev]) == 2 &&
-	       get_option(&str,&use_cache[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-nm256=", alsa_card_nm256_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index 3a68a7f31..2f209664d 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -61,6 +61,7 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/info.h>
@@ -68,7 +69,6 @@
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/asoundef.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -76,14 +76,15 @@
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for RME Digi32 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for RME Digi32 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable RME Digi32 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_AUTHOR("Martin Langer <martin-langer@gmx.de>");
@@ -297,7 +298,7 @@ static int snd_rme32_playback_silence(snd_pcm_substream_t * substream, int chann
 
 static int snd_rme32_playback_copy(snd_pcm_substream_t * substream, int channel,	/* not used (interleaved data) */
 				   snd_pcm_uframes_t pos,
-				   void *src, snd_pcm_uframes_t count)
+				   void __user *src, snd_pcm_uframes_t count)
 {
 	rme32_t *rme32 = _snd_pcm_substream_chip(substream);
 	count <<= rme32->playback_frlog;
@@ -310,7 +311,7 @@ static int snd_rme32_playback_copy(snd_pcm_substream_t * substream, int channel,
 
 static int snd_rme32_capture_copy(snd_pcm_substream_t * substream, int channel,	/* not used (interleaved data) */
 				  snd_pcm_uframes_t pos,
-				  void *dst, snd_pcm_uframes_t count)
+				  void __user *dst, snd_pcm_uframes_t count)
 {
 	rme32_t *rme32 = _snd_pcm_substream_chip(substream);
 	count <<= rme32->capture_frlog;
@@ -1995,15 +1996,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_rme32_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		snd_printk("No RME Digi32 cards found\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_rme32_exit(void)
@@ -2013,22 +2006,3 @@ static void __exit alsa_card_rme32_exit(void)
 
 module_init(alsa_card_rme32_init)
 module_exit(alsa_card_rme32_exit)
-
-#ifndef MODULE
-
-static int __init alsa_card_rme32_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void) (get_option(&str, &enable[nr_dev]) == 2 &&
-		get_option(&str, &index[nr_dev]) == 2 &&
-		get_id(&str, &id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-rme32=", alsa_card_rme32_setup);
-
-#endif				/* ifndef MODULE */
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index b2fe7d336..0e04ae457 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -29,6 +29,7 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/info.h>
@@ -36,7 +37,6 @@
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/asoundef.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -57,14 +57,15 @@ MODULE_DEVICES("{{RME,Digi96},"
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for RME Digi96 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for RME Digi96 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable RME Digi96 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 
@@ -360,7 +361,7 @@ static int
 snd_rme96_playback_copy(snd_pcm_substream_t *substream,
 			int channel, /* not used (interleaved data) */
 			snd_pcm_uframes_t pos,
-			void *src,
+			void __user *src,
 			snd_pcm_uframes_t count)
 {
 	rme96_t *rme96 = _snd_pcm_substream_chip(substream);
@@ -375,7 +376,7 @@ static int
 snd_rme96_capture_copy(snd_pcm_substream_t *substream,
 		       int channel, /* not used (interleaved data) */
 		       snd_pcm_uframes_t pos,
-		       void *dst,
+		       void __user *dst,
 		       snd_pcm_uframes_t count)
 {
 	rme96_t *rme96 = _snd_pcm_substream_chip(substream);
@@ -2565,15 +2566,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_rme96_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "No RME Digi96 cards found\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_rme96_exit(void)
@@ -2583,24 +2576,3 @@ static void __exit alsa_card_rme96_exit(void)
 
 module_init(alsa_card_rme96_init)
 module_exit(alsa_card_rme96_exit)
-
-#ifndef MODULE
-
-/* format is: snd-rme96=enable,index,id */
-
-static int __init alsa_card_rme96_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-rme96=", alsa_card_rme96_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index f3224e61f..c91602c12 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -27,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/control.h>
@@ -35,7 +36,6 @@
 #include <sound/asoundef.h>
 #include <sound/rawmidi.h>
 #include <sound/hwdep.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/hdsp.h>
 
@@ -48,20 +48,21 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int precise_ptr[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* Enable precise pointer */
 static int line_outs_monitor[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0}; /* Send all inputs/playback to line outs */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for RME Hammerfall DSP interface.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for RME Hammerfall DSP interface.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable/disable specific Hammerfall DSP soundcards.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(precise_ptr, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(precise_ptr, bool, boot_devs, 0444);
 MODULE_PARM_DESC(precise_ptr, "Enable precise pointer (doesn't work reliably).");
 MODULE_PARM_SYNTAX(precise_ptr, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
-MODULE_PARM(line_outs_monitor,"1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(line_outs_monitor, bool, boot_devs, 0444);
 MODULE_PARM_DESC(line_outs_monitor, "Send all input and playback streams to line outs by default.");
 MODULE_PARM_SYNTAX(line_outs_monitor, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 MODULE_AUTHOR("Paul Davis <paul@linuxaudiosystems.com>, Marcus Andersson, Thomas Charbonnel <thomas@undata.org>");
@@ -634,6 +635,7 @@ static inline int hdsp_playback_to_output_key (hdsp_t *hdsp, int in, int out)
 	case 0xa:
 		return (64 * out) + (32 + (in));
 	case 0x96:
+	case 0x97:
 		return (32 * out) + (16 + (in));
 	default:
 		return (52 * out) + (26 + (in));
@@ -646,6 +648,7 @@ static inline int hdsp_input_to_output_key (hdsp_t *hdsp, int in, int out)
 	case 0xa:
 		return (64 * out) + in;
 	case 0x96:
+	case 0x97:
 		return (32 * out) + in;
 	default:
 		return (52 * out) + in;
@@ -1247,9 +1250,9 @@ static inline void snd_hdsp_midi_write_byte (hdsp_t *hdsp, int id, int val)
 {
 	/* the hardware already does the relevant bit-mask with 0xff */
 	if (id) {
-		return hdsp_write(hdsp, HDSP_midiDataOut1, val);
+		hdsp_write(hdsp, HDSP_midiDataOut1, val);
 	} else {
-		return hdsp_write(hdsp, HDSP_midiDataOut0, val);
+		hdsp_write(hdsp, HDSP_midiDataOut0, val);
 	}
 }
 
@@ -3831,7 +3834,7 @@ static char *hdsp_channel_buffer_location(hdsp_t *hdsp,
 }
 
 static int snd_hdsp_playback_copy(snd_pcm_substream_t *substream, int channel,
-				  snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count)
+				  snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count)
 {
 	hdsp_t *hdsp = _snd_pcm_substream_chip(substream);
 	char *channel_buf;
@@ -3846,7 +3849,7 @@ static int snd_hdsp_playback_copy(snd_pcm_substream_t *substream, int channel,
 }
 
 static int snd_hdsp_capture_copy(snd_pcm_substream_t *substream, int channel,
-				 snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count)
+				 snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count)
 {
 	hdsp_t *hdsp = _snd_pcm_substream_chip(substream);
 	char *channel_buf;
@@ -4120,10 +4123,10 @@ static int snd_hdsp_prepare(snd_pcm_substream_t *substream)
 		return -EIO;
 	}
 
-	spin_lock_irq(&hdsp->lock);
+	spin_lock(&hdsp->lock);
 	if (!hdsp->running)
 		hdsp_reset_hw_pointer(hdsp);
-	spin_unlock_irq(&hdsp->lock);
+	spin_unlock(&hdsp->lock);
 	return result;
 }
 
@@ -4528,10 +4531,11 @@ static int snd_hdsp_hwdep_dummy_op(snd_hwdep_t *hw, struct file *file)
 static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	hdsp_t *hdsp = (hdsp_t *)hw->private_data;	
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case SNDRV_HDSP_IOCTL_GET_PEAK_RMS: {
-		hdsp_peak_rms_t *peak_rms;
+		hdsp_peak_rms_t __user *peak_rms;
 		int i;
 		
 		if (hdsp->io_type == H9652) {
@@ -4539,38 +4543,38 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 			int doublespeed = 0;
 			if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus)
 				doublespeed = 1;
-			peak_rms = (hdsp_peak_rms_t *)arg;
+			peak_rms = (hdsp_peak_rms_t __user *)arg;
 			for (i = 0; i < 26; ++i) {
 				if (!(doublespeed && (i & 4))) {
-					if (copy_to_user_fromio((void *)peak_rms->input_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-i*4, 4) != 0)
+					if (copy_to_user_fromio((void __user *)peak_rms->input_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-i*4, 4) != 0)
 						return -EFAULT;
-					if (copy_to_user_fromio((void *)peak_rms->playback_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
+					if (copy_to_user_fromio((void __user *)peak_rms->playback_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
 						return -EFAULT;
-					if (copy_to_user_fromio((void *)peak_rms->output_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-2*(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
+					if (copy_to_user_fromio((void __user *)peak_rms->output_peaks+i*4, hdsp->iobase+HDSP_9652_peakBase-2*(doublespeed ? 14 : 26)*4-i*4, 4) != 0)
 						return -EFAULT;
 					rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+i*8) & 0xFFFFFF00;
 					rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+i*8+4) & 0xFFFFFF00;
 					rms_high += (rms_low >> 24);
 					rms_low <<= 8;
-					if (copy_to_user((void *)peak_rms->input_rms+i*8, &rms_low, 4) != 0)
+					if (copy_to_user((void __user *)peak_rms->input_rms+i*8, &rms_low, 4) != 0)
 						return -EFAULT;
-					if (copy_to_user((void *)peak_rms->input_rms+i*8+4, &rms_high, 4) != 0)
+					if (copy_to_user((void __user *)peak_rms->input_rms+i*8+4, &rms_high, 4) != 0)
 						return -EFAULT;					
 					rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+(doublespeed ? 14 : 26)*8+i*8) & 0xFFFFFF00;
 					rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+(doublespeed ? 14 : 26)*8+i*8+4) & 0xFFFFFF00;
 					rms_high += (rms_low >> 24);
 					rms_low <<= 8;
-					if (copy_to_user((void *)peak_rms->playback_rms+i*8, &rms_low, 4) != 0)
+					if (copy_to_user((void __user *)peak_rms->playback_rms+i*8, &rms_low, 4) != 0)
 						return -EFAULT;
-					if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, &rms_high, 4) != 0)
+					if (copy_to_user((void __user *)peak_rms->playback_rms+i*8+4, &rms_high, 4) != 0)
 						return -EFAULT;					
 					rms_low = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+2*(doublespeed ? 14 : 26)*8+i*8) & 0xFFFFFF00;
 					rms_high = *(u32 *)(hdsp->iobase+HDSP_9652_rmsBase+2*(doublespeed ? 14 : 26)*8+i*8+4) & 0xFFFFFF00;
 					rms_high += (rms_low >> 24);
 					rms_low <<= 8;
-					if (copy_to_user((void *)peak_rms->output_rms+i*8, &rms_low, 4) != 0)
+					if (copy_to_user((void __user *)peak_rms->output_rms+i*8, &rms_low, 4) != 0)
 						return -EFAULT;
-					if (copy_to_user((void *)peak_rms->output_rms+i*8+4, &rms_high, 4) != 0)
+					if (copy_to_user((void __user *)peak_rms->output_rms+i*8+4, &rms_high, 4) != 0)
 						return -EFAULT;					
 				}
 			}
@@ -4583,25 +4587,25 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 			if (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DoubleSpeedStatus)
 				doublespeed = 1;
 			m = (hdsp_9632_meters_t *)(hdsp->iobase+HDSP_9632_metersBase);
-			peak_rms = (hdsp_peak_rms_t *)arg;
+			peak_rms = (hdsp_peak_rms_t __user *)arg;
 			for (i = 0, j = 0; i < 16; ++i, ++j) {
-				if (copy_to_user((void *)peak_rms->input_peaks+i*4, &(m->input_peak[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->input_peaks+i*4, &(m->input_peak[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->playback_peaks+i*4, &(m->playback_peak[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->playback_peaks+i*4, &(m->playback_peak[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->output_peaks+i*4, &(m->output_peak[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->output_peaks+i*4, &(m->output_peak[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->input_rms+i*8, &(m->input_rms_low[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->input_rms+i*8, &(m->input_rms_low[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->playback_rms+i*8, &(m->playback_rms_low[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->playback_rms+i*8, &(m->playback_rms_low[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->output_rms+i*8, &(m->output_rms_low[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->output_rms+i*8, &(m->output_rms_low[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->input_rms+i*8+4, &(m->input_rms_high[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->input_rms+i*8+4, &(m->input_rms_high[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, &(m->playback_rms_high[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->playback_rms+i*8+4, &(m->playback_rms_high[j]), 4) != 0)
 					return -EFAULT;
-				if (copy_to_user((void *)peak_rms->output_rms+i*8+4, &(m->output_rms_high[j]), 4) != 0)
+				if (copy_to_user((void __user *)peak_rms->output_rms+i*8+4, &(m->output_rms_high[j]), 4) != 0)
 					return -EFAULT;
 				if (doublespeed && i == 3) i += 4;
 			}
@@ -4611,25 +4615,25 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 			snd_printk("firmware needs to be uploaded to the card.\n");	
 			return -EINVAL;
 		}
-		peak_rms = (hdsp_peak_rms_t *)arg;
+		peak_rms = (hdsp_peak_rms_t __user *)arg;
 		for (i = 0; i < 26; ++i) {
-		    if (copy_to_user((void *)peak_rms->playback_peaks+i*4, (void *)hdsp->iobase+HDSP_playbackPeakLevel+i*4, 4) != 0)
+		    if (copy_to_user((void __user *)peak_rms->playback_peaks+i*4, (void *)hdsp->iobase+HDSP_playbackPeakLevel+i*4, 4) != 0)
 			    return -EFAULT;
-		    if (copy_to_user((void *)peak_rms->input_peaks+i*4, (void *)hdsp->iobase+HDSP_inputPeakLevel+i*4, 4) != 0)
+		    if (copy_to_user((void __user *)peak_rms->input_peaks+i*4, (void *)hdsp->iobase+HDSP_inputPeakLevel+i*4, 4) != 0)
 			    return -EFAULT;
 		}
 		for (i = 0; i < 26; ++i) {
-			if (copy_to_user((void *)peak_rms->playback_rms+i*8+4, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8, 4) != 0)
+			if (copy_to_user((void __user *)peak_rms->playback_rms+i*8+4, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8, 4) != 0)
 				return -EFAULT;
-			if (copy_to_user((void *)peak_rms->playback_rms+i*8, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8+4, 4) != 0)
+			if (copy_to_user((void __user *)peak_rms->playback_rms+i*8, (void *)hdsp->iobase+HDSP_playbackRmsLevel+i*8+4, 4) != 0)
 				return -EFAULT;
-			if (copy_to_user((void *)peak_rms->input_rms+i*8+4, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8, 4) != 0)
+			if (copy_to_user((void __user *)peak_rms->input_rms+i*8+4, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8, 4) != 0)
 				return -EFAULT;
-			if (copy_to_user((void *)peak_rms->input_rms+i*8, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8+4, 4) != 0)
+			if (copy_to_user((void __user *)peak_rms->input_rms+i*8, (void *)hdsp->iobase+HDSP_inputRmsLevel+i*8+4, 4) != 0)
 				return -EFAULT;
 		}
 		for (i = 0; i < 28; ++i) {
-		    if (copy_to_user((void *)peak_rms->output_peaks+i*4, (void *)hdsp->iobase+HDSP_outputPeakLevel+i*4, 4) != 0)
+		    if (copy_to_user((void __user *)peak_rms->output_peaks+i*4, (void *)hdsp->iobase+HDSP_outputPeakLevel+i*4, 4) != 0)
 			    return -EFAULT;
 		}
 		break;
@@ -4677,7 +4681,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 			info.analog_extension_board = (unsigned char)hdsp_aeb(hdsp);
 		}
 		spin_unlock_irqrestore(&hdsp->lock, flags);
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		break;
 	}
@@ -4687,7 +4691,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 		if (hdsp->io_type != H9632) return -EINVAL;
 		h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS;
 		h9632_aeb.aebo = hdsp->ss_out_channels - H9632_SS_CHANNELS;
-		if (copy_to_user((void *)arg, &h9632_aeb, sizeof(h9632_aeb)))
+		if (copy_to_user(argp, &h9632_aeb, sizeof(h9632_aeb)))
 			return -EFAULT;
 		break;
 	}
@@ -4703,14 +4707,14 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 		}
 		hdsp_version.io_type = hdsp->io_type;
 		hdsp_version.firmware_rev = hdsp->firmware_rev;
-		if ((err = copy_to_user((void *)arg, &hdsp_version, sizeof(hdsp_version)))) {
+		if ((err = copy_to_user(argp, &hdsp_version, sizeof(hdsp_version)))) {
 		    	return -EFAULT;
 		}
 		break;
 	}
 	case SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE: {
-		hdsp_firmware_t *firmware;
-		unsigned long *firmware_data;
+		hdsp_firmware_t __user *firmware;
+		unsigned long __user *firmware_data;
 		int err;
 		
 		if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
@@ -4718,7 +4722,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 		if (hdsp->io_type == Undefined) return -EINVAL;
 
 		snd_printk("initializing firmware upload\n");
-		firmware = (hdsp_firmware_t *)arg;
+		firmware = (hdsp_firmware_t __user *)argp;
 
 		if (get_user(firmware_data, &firmware->firmware_data)) {
 			return -EFAULT;
@@ -4751,9 +4755,7 @@ static int snd_hdsp_hwdep_ioctl(snd_hwdep_t *hw, struct file *file, unsigned int
 		break;
 	}
 	case SNDRV_HDSP_IOCTL_GET_MIXER: {
-		hdsp_mixer_t *mixer;
-		
-		mixer = (hdsp_mixer_t *)arg;
+		hdsp_mixer_t __user *mixer = (hdsp_mixer_t __user *)argp;
 		if (copy_to_user(mixer->matrix, hdsp->mixer_matrix, sizeof(unsigned short)*HDSP_MATRIX_MIXER_SIZE))
 			return -EFAULT;
 		break;
@@ -5018,6 +5020,7 @@ static int __devinit snd_hdsp_create(snd_card_t *card,
 		is_9652 = 1;
 		break;
 	case 0x96:
+	case 0x97:
 		hdsp->card_name = "RME HDSP 9632";
 		hdsp->max_channels = 16;
 		is_9632 = 1;
@@ -5198,14 +5201,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_hdsp_init(void)
 {
-	if (pci_module_init(&driver) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "RME Hammerfall-DSP: no cards found\n");
-#endif
-		return -ENODEV;
-	}
-
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_hdsp_exit(void)
@@ -5215,24 +5211,3 @@ static void __exit alsa_card_hdsp_exit(void)
 
 module_init(alsa_card_hdsp_init)
 module_exit(alsa_card_hdsp_exit)
-
-#ifndef MODULE
-
-/* format is: snd-hdsp=enable,index,id */
-
-static int __init alsa_card_hdsp_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-hdsp=", alsa_card_hdsp_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index fadb0dbbb..e1abd9813 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -26,13 +26,13 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
 #include <sound/asoundef.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/current.h>
@@ -42,17 +42,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int precise_ptr[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* Enable precise pointer */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for RME Digi9652 (Hammerfall) soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable/disable specific RME96{52,36} soundcards.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(precise_ptr, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(precise_ptr, bool, boot_devs, 0444);
 MODULE_PARM_DESC(precise_ptr, "Enable precise pointer (doesn't work reliably).");
 MODULE_PARM_SYNTAX(precise_ptr, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch");
@@ -2010,7 +2011,7 @@ static char *rme9652_channel_buffer_location(rme9652_t *rme9652,
 }
 
 static int snd_rme9652_playback_copy(snd_pcm_substream_t *substream, int channel,
-				     snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count)
+				     snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count)
 {
 	rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
 	char *channel_buf;
@@ -2027,7 +2028,7 @@ static int snd_rme9652_playback_copy(snd_pcm_substream_t *substream, int channel
 }
 
 static int snd_rme9652_capture_copy(snd_pcm_substream_t *substream, int channel,
-				    snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count)
+				    snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count)
 {
 	rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
 	char *channel_buf;
@@ -2262,10 +2263,10 @@ static int snd_rme9652_prepare(snd_pcm_substream_t *substream)
 	rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
 	int result = 0;
 
-	spin_lock_irq(&rme9652->lock);
+	spin_lock(&rme9652->lock);
 	if (!rme9652->running)
 		rme9652_reset_hw_pointer(rme9652);
-	spin_unlock_irq(&rme9652->lock);
+	spin_unlock(&rme9652->lock);
 	return result;
 }
 
@@ -2748,14 +2749,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_hammerfall_init(void)
 {
-	if (pci_module_init(&driver) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "RME Digi9652/Digi9636: no cards found\n");
-#endif
-		return -ENODEV;
-	}
-
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_hammerfall_exit(void)
@@ -2765,24 +2759,3 @@ static void __exit alsa_card_hammerfall_exit(void)
 
 module_init(alsa_card_hammerfall_init)
 module_exit(alsa_card_hammerfall_exit)
-
-#ifndef MODULE
-
-/* format is: snd-rme9652=enable,index,id */
-
-static int __init alsa_card_rme9652_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-rme9652=", alsa_card_rme9652_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 20118df84..5f9475d2a 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -29,6 +29,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -36,7 +37,6 @@
 #include <sound/control.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -60,23 +60,24 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card *
 static int reverb[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 static int mge[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
 static unsigned int dmaio = 0x7a00;	/* DDMA i/o address */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for S3 SonicVibes soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for S3 SonicVibes soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable S3 SonicVibes soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(reverb, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(reverb, bool, boot_devs, 0444);
 MODULE_PARM_DESC(reverb, "Enable reverb (SRAM is present) for S3 SonicVibes soundcard.");
 MODULE_PARM_SYNTAX(reverb, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
-MODULE_PARM(mge, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mge, bool, boot_devs, 0444);
 MODULE_PARM_DESC(mge, "MIC Gain Enable for S3 SonicVibes soundcard.");
 MODULE_PARM_SYNTAX(mge, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
-MODULE_PARM(dmaio, "i");
+module_param(dmaio, uint, 0444);
 MODULE_PARM_DESC(dmaio, "DDMA i/o base address for S3 SonicVibes soundcard.");
 MODULE_PARM_SYNTAX(dmaio, "global," SNDRV_PORT_DESC);
 
@@ -1535,15 +1536,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_sonicvibes_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "S3 SonicVibes soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_sonicvibes_exit(void)
@@ -1553,28 +1546,3 @@ static void __exit alsa_card_sonicvibes_exit(void)
 
 module_init(alsa_card_sonicvibes_init)
 module_exit(alsa_card_sonicvibes_exit)
-
-#ifndef MODULE
-
-/* format is: snd-sonicvibes=enable,index,id,
-			     reverb,mge,dmaio */
-
-static int __init alsa_card_sonicvibes_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&reverb[nr_dev]) == 2 &&
-	       get_option(&str,&mge[nr_dev]) == 2 &&
-	       get_option(&str,(int *)&dmaio) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-sonicvibes=", alsa_card_sonicvibes_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index d1269e2e6..eb3a882dd 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -25,9 +25,9 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/trident.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, <audio@tridentmicro.com>");
@@ -52,20 +52,21 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int pcm_channels[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 32};
 static int wavetable_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8192};
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Trident 4DWave PCI soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Trident 4DWave PCI soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Trident 4DWave PCI soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(pcm_channels, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pcm_channels, int, boot_devs, 0444);
 MODULE_PARM_DESC(pcm_channels, "Number of hardware channels assigned for PCM.");
 MODULE_PARM_SYNTAX(pcm_channels, SNDRV_ENABLED ",default:32,allows:{{1,32}}");
-MODULE_PARM(wavetable_size, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(wavetable_size, int, boot_devs, 0444);
 MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
 MODULE_PARM_SYNTAX(wavetable_size, SNDRV_ENABLED ",default:8192,skill:advanced");
 
@@ -169,56 +170,28 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, trident);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
 static void __devexit snd_trident_remove(struct pci_dev *pci)
 {
-	trident_t *trident = snd_magic_cast(trident_t, pci_get_drvdata(pci), return);
-	if (trident)
-		snd_card_free(trident->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
-#ifdef CONFIG_PM
-static int snd_card_trident_suspend(struct pci_dev *pci, u32 state)
-{
-	trident_t *chip = snd_magic_cast(trident_t, pci_get_drvdata(pci), return -ENXIO);
-	snd_trident_suspend(chip);
-	return 0;
-}
-static int snd_card_trident_resume(struct pci_dev *pci)
-{
-	trident_t *chip = snd_magic_cast(trident_t, pci_get_drvdata(pci), return -ENXIO);
-	snd_trident_resume(chip);
-	return 0;
-}
-#endif
-
 static struct pci_driver driver = {
 	.name = "Trident4DWaveAudio",
 	.id_table = snd_trident_ids,
 	.probe = snd_trident_probe,
 	.remove = __devexit_p(snd_trident_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_card_trident_suspend,
-	.resume = snd_card_trident_resume,
-#endif
+	SND_PCI_PM_CALLBACKS
 };
 
 static int __init alsa_card_trident_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Trident 4DWave PCI soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_trident_exit(void)
@@ -228,27 +201,3 @@ static void __exit alsa_card_trident_exit(void)
 
 module_init(alsa_card_trident_init)
 module_exit(alsa_card_trident_exit)
-
-#ifndef MODULE
-
-/* format is: snd-trident=enable,index,id,
-			  pcm_channels,wavetable_size */
-
-static int __init alsa_card_trident_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option(&str,&pcm_channels[nr_dev]) == 2 &&
-	       get_option(&str,&wavetable_size[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-trident=", alsa_card_trident_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 819401689..a72dee775 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -50,7 +50,8 @@ static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t *
 static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t * voice, snd_pcm_substream_t *substream);
 static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 #ifdef CONFIG_PM
-static int snd_trident_set_power_state(snd_card_t *card, unsigned int power_state);
+static int snd_trident_suspend(snd_card_t *card, unsigned int state);
+static int snd_trident_resume(snd_card_t *card, unsigned int state);
 #endif
 static int snd_trident_sis_reset(trident_t *trident);
 
@@ -3646,10 +3647,8 @@ int __devinit snd_trident_create(snd_card_t * card,
 
 	snd_trident_enable_eso(trident);
 
-#ifdef CONFIG_PM
-	card->set_power_state = snd_trident_set_power_state;
-	card->power_state_private_data = trident;
-#endif
+	
+	snd_card_set_pm_callback(card, snd_trident_suspend, snd_trident_resume, trident);
 
 	snd_trident_proc_init(trident);
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) {
@@ -3949,19 +3948,21 @@ void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigne
 }
 
 #ifdef CONFIG_PM
-
-void snd_trident_suspend(trident_t *trident)
+static int snd_trident_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = trident->card;
+	trident_t *trident = snd_magic_cast(trident_t, card->pm_private_data, return -EINVAL);
 
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
 	trident->in_suspend = 1;
 	snd_pcm_suspend_all(trident->pcm);
 	if (trident->foldback)
 		snd_pcm_suspend_all(trident->foldback);
 	if (trident->spdif)
 		snd_pcm_suspend_all(trident->spdif);
+
+	snd_ac97_suspend(trident->ac97);
+	if (trident->ac97_sec)
+		snd_ac97_suspend(trident->ac97_sec);
+
 	switch (trident->device) {
 	case TRIDENT_DEVICE_ID_DX:
 	case TRIDENT_DEVICE_ID_NX:
@@ -3970,14 +3971,12 @@ void snd_trident_suspend(trident_t *trident)
 		break;
 	}
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-void snd_trident_resume(trident_t *trident)
+static int snd_trident_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = trident->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+	trident_t *trident = snd_magic_cast(trident_t, card->pm_private_data, return -EINVAL);
 
 	pci_enable_device(trident->pci);
 	if (pci_set_dma_mask(trident->pci, 0x3fffffff) < 0 ||
@@ -3998,6 +3997,8 @@ void snd_trident_resume(trident_t *trident)
 	}
 
 	snd_ac97_resume(trident->ac97);
+	if (trident->ac97_sec)
+		snd_ac97_resume(trident->ac97_sec);
 
 	/* restore some registers */
 	outl(trident->musicvol_wavevol, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL));
@@ -4006,28 +4007,8 @@ void snd_trident_resume(trident_t *trident)
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
 	trident->in_suspend = 0;
+	return 0;
 }
-
-static int snd_trident_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	trident_t *chip = snd_magic_cast(trident_t, card->power_state_private_data, return -ENXIO);
-        
-	switch (power_state) {
-        case SNDRV_CTL_POWER_D0:
-        case SNDRV_CTL_POWER_D1:
-        case SNDRV_CTL_POWER_D2:
-        	snd_trident_resume(chip);
-                break;
-	case SNDRV_CTL_POWER_D3hot:
-        case SNDRV_CTL_POWER_D3cold:
-		snd_trident_suspend(chip);
-		break;
-        default:
-	        return -EINVAL;
-        }
-        return 0;
-}
-
 #endif /* CONFIG_PM */
 
 EXPORT_SYMBOL(snd_trident_alloc_voice);
diff --git a/sound/pci/trident/trident_memory.c b/sound/pci/trident/trident_memory.c
index fdffd3884..3c79110b5 100644
--- a/sound/pci/trident/trident_memory.c
+++ b/sound/pci/trident/trident_memory.c
@@ -471,7 +471,7 @@ int snd_trident_synth_bzero(trident_t *trident, snd_util_memblk_t *blk, int offs
 /*
  * copy_from_user(blk + offset, data, size)
  */
-int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char *data, int size)
+int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char __user *data, int size)
 {
 	int page, nextofs, end_offset, temp, temp1;
 
diff --git a/sound/pci/trident/trident_synth.c b/sound/pci/trident/trident_synth.c
index a2098eab1..8f9797d79 100644
--- a/sound/pci/trident/trident_synth.c
+++ b/sound/pci/trident/trident_synth.c
@@ -504,7 +504,7 @@ static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, un
  */
 
 static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t * instr,
-					 char *data, long len, int atomic)
+					 char __user *data, long len, int atomic)
 {
 	trident_t *trident = snd_magic_cast(trident_t, private_data, return -ENXIO);
 	int size = instr->size;
@@ -557,7 +557,7 @@ static int snd_trident_simple_put_sample(void *private_data, simple_instrument_t
 }
 
 static int snd_trident_simple_get_sample(void *private_data, simple_instrument_t * instr,
-					 char *data, long len, int atomic)
+					 char __user *data, long len, int atomic)
 {
 	//trident_t *trident = snd_magic_cast(trident_t, private_data, return -ENXIO);
 	int size = instr->size;
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 4f4c2cb69..67e5edd5b 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -51,13 +51,13 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/gameport.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/info.h>
 #include <sound/ac97_codec.h>
 #include <sound/mpu401.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #if 0
@@ -84,31 +84,32 @@ static int joystick[SNDRV_CARDS];
 static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
 static int ac97_quirk[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = AC97_TUNE_DEFAULT};
 static int dxs_support[SNDRV_CARDS];
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable audio part of VIA 82xx bridge.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_PORT_DESC);
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(joystick, bool, boot_devs, 0444);
 MODULE_PARM_DESC(joystick, "Enable joystick. (VT82C686x only)");
 MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLE_DESC "," SNDRV_BOOLEAN_FALSE_DESC);
 #endif
-MODULE_PARM(ac97_clock, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ac97_clock, int, boot_devs, 0444);
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
 MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:48000");
-MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ac97_quirk, int, boot_devs, 0444);
 MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
 MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,4}},dialog:list,default:-1");
-MODULE_PARM(dxs_support, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(dxs_support, int, boot_devs, 0444);
 MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA)");
 MODULE_PARM_SYNTAX(dxs_support, SNDRV_ENABLED ",allows:{{0,4}},dialog:list");
 
@@ -368,6 +369,14 @@ struct _snd_via82xx {
 
 	unsigned char old_legacy;
 	unsigned char old_legacy_cfg;
+#ifdef CONFIG_PM
+	unsigned char legacy_saved;
+	unsigned char legacy_cfg_saved;
+	unsigned char spdif_ctrl_saved;
+	unsigned char capture_src_saved[2];
+	unsigned int mpu_port_saved;
+	u32 pci_state[16];
+#endif
 
 	unsigned char playback_volume[4][2]; /* for VIA8233/C/8235; default = 0 */
 
@@ -384,6 +393,7 @@ struct _snd_via82xx {
 	unsigned int no_vra: 1;		/* no need to set VRA on DXS channels */
 	unsigned int spdif_on: 1;	/* only spdif rates work to external DACs */
 
+	snd_pcm_t *pcms[2];
 	snd_rawmidi_t *rmidi;
 
 	ac97_bus_t *ac97_bus;
@@ -1289,6 +1299,7 @@ static int __devinit snd_via8233_pcm_new(via82xx_t *chip)
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_via8233_capture_ops);
 	pcm->private_data = chip;
 	strcpy(pcm->name, chip->card->shortname);
+	chip->pcms[0] = pcm;
 	/* set up playbacks */
 	for (i = 0; i < 4; i++)
 		init_viadev(chip, i, 0x10 * i, 0);
@@ -1307,6 +1318,7 @@ static int __devinit snd_via8233_pcm_new(via82xx_t *chip)
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_via8233_capture_ops);
 	pcm->private_data = chip;
 	strcpy(pcm->name, chip->card->shortname);
+	chip->pcms[1] = pcm;
 	/* set up playback */
 	init_viadev(chip, chip->multi_devno, VIA_REG_MULTPLAY_STATUS, 0);
 	/* set up capture */
@@ -1341,6 +1353,7 @@ static int __devinit snd_via8233a_pcm_new(via82xx_t *chip)
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_via8233_capture_ops);
 	pcm->private_data = chip;
 	strcpy(pcm->name, chip->card->shortname);
+	chip->pcms[0] = pcm;
 	/* set up playback */
 	init_viadev(chip, chip->multi_devno, VIA_REG_MULTPLAY_STATUS, 0);
 	/* capture */
@@ -1357,6 +1370,7 @@ static int __devinit snd_via8233a_pcm_new(via82xx_t *chip)
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_via8233_playback_ops);
 	pcm->private_data = chip;
 	strcpy(pcm->name, chip->card->shortname);
+	chip->pcms[1] = pcm;
 	/* set up playback */
 	init_viadev(chip, chip->playback_devno, 0x30, 0);
 
@@ -1387,6 +1401,7 @@ static int __devinit snd_via686_pcm_new(via82xx_t *chip)
 	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_via686_capture_ops);
 	pcm->private_data = chip;
 	strcpy(pcm->name, chip->card->shortname);
+	chip->pcms[0] = pcm;
 	init_viadev(chip, 0, VIA_REG_PLAYBACK_STATUS, 0);
 	init_viadev(chip, 1, VIA_REG_CAPTURE_STATUS, 1);
 
@@ -1404,8 +1419,11 @@ static int __devinit snd_via686_pcm_new(via82xx_t *chip)
 
 static int snd_via8233_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
 {
+	/* formerly they were "Line" and "Mic", but it looks like that they
+	 * have nothing to do with the actual physical connections...
+	 */
 	static char *texts[2] = {
-		"Line", "Mic"
+		"Input1", "Input2"
 	};
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 	uinfo->count = 1;
@@ -1584,6 +1602,12 @@ static struct ac97_quirk ac97_quirks[] = {
 		.name = "Mitac Mobo",
 		.type = AC97_TUNE_ALC_JACK
 	},
+	{
+		.vendor = 0x161f,
+		.device = 0x202b,
+		.name = "Arima Notebook",
+		.type = AC97_TUNE_HP_ONLY,
+	},
 	{ } /* terminator */
 };
 
@@ -1667,6 +1691,9 @@ static int snd_via686_init_misc(via82xx_t *chip, int dev)
 		if (mpu_port[dev] >= 0x200) {	/* force MIDI */
 			mpu_port[dev] &= 0xfffc;
 			pci_write_config_dword(chip->pci, 0x18, mpu_port[dev] | 0x01);
+#ifdef CONFIG_PM
+			chip->mpu_port_saved = mpu_port[dev];
+#endif
 		} else {
 			mpu_port[dev] = pci_resource_start(chip->pci, 2);
 		}
@@ -1725,6 +1752,11 @@ static int snd_via686_init_misc(via82xx_t *chip, int dev)
 		gameport_register_port(&chip->gameport);
 #endif
 
+#ifdef CONFIG_PM
+	chip->legacy_saved = legacy;
+	chip->legacy_cfg_saved = legacy_cfg;
+#endif
+
 	return 0;
 }
 
@@ -1865,6 +1897,74 @@ static int __devinit snd_via82xx_chip_init(via82xx_t *chip)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+/*
+ * power management
+ */
+static int snd_via82xx_suspend(snd_card_t *card, unsigned int state)
+{
+	via82xx_t *chip = snd_magic_cast(via82xx_t, card->pm_private_data, return -EINVAL);
+	int i;
+
+	for (i = 0; i < 2; i++)
+		if (chip->pcms[i])
+			snd_pcm_suspend_all(chip->pcms[i]);
+	for (i = 0; i < chip->num_devs; i++)
+		snd_via82xx_channel_reset(chip, &chip->devs[i]);
+	synchronize_irq(chip->irq);
+	snd_ac97_suspend(chip->ac97);
+
+	/* save misc values */
+	if (chip->chip_type != TYPE_VIA686) {
+		pci_read_config_byte(chip->pci, VIA8233_SPDIF_CTRL, &chip->spdif_ctrl_saved);
+		chip->capture_src_saved[0] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL);
+		chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10);
+	}
+
+	pci_save_state(chip->pci, chip->pci_state);
+	pci_set_power_state(chip->pci, 3);
+	pci_disable_device(chip->pci);
+	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
+}
+
+static int snd_via82xx_resume(snd_card_t *card, unsigned int state)
+{
+	via82xx_t *chip = snd_magic_cast(via82xx_t, card->pm_private_data, return -EINVAL);
+	int idx, i;
+
+	pci_enable_device(chip->pci);
+	pci_restore_state(chip->pci, chip->pci_state);
+	pci_set_power_state(chip->pci, 0);
+
+	snd_via82xx_chip_init(chip);
+
+	if (chip->chip_type == TYPE_VIA686) {
+		if (chip->mpu_port_saved)
+			pci_write_config_dword(chip->pci, 0x18, chip->mpu_port_saved | 0x01);
+		pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, chip->legacy_saved);
+		pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, chip->legacy_cfg_saved);
+	} else {
+		pci_write_config_byte(chip->pci, VIA8233_SPDIF_CTRL, chip->spdif_ctrl_saved);
+		outb(chip->capture_src_saved[0], chip->port + VIA_REG_CAPTURE_CHANNEL);
+		outb(chip->capture_src_saved[1], chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10);
+		for (idx = 0; idx < 4; idx++) {
+			unsigned long port = chip->port + 0x10 * idx;
+			for (i = 0; i < 2; i++)
+				outb(chip->playback_volume[idx][i], port + VIA_REG_OFS_PLAYBACK_VOLUME_L + i);
+		}
+	}
+
+	snd_ac97_resume(chip->ac97);
+
+	for (i = 0; i < chip->num_devs; i++)
+		snd_via82xx_channel_reset(chip, &chip->devs[i]);
+
+	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+	return 0;
+}
+#endif /* CONFIG_PM */
+
 static int snd_via82xx_free(via82xx_t *chip)
 {
 	unsigned int i;
@@ -2010,7 +2110,8 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
 	static struct dxs_whitelist whitelist[] = {
 		{ .vendor = 0x1005, .device = 0x4710, .action = VIA_DXS_ENABLE }, /* Avance Logic Mobo */
 		{ .vendor = 0x1019, .device = 0x0996, .action = VIA_DXS_48K },
-		{ .vendor = 0x1043, .device = 0x8095, .action = VIA_DXS_ENABLE }, /* ASUS A7V8X */
+		{ .vendor = 0x1019, .device = 0x0a81, .action = VIA_DXS_NO_VRA }, /* ECS K7VTA3 v8.0 */
+		{ .vendor = 0x1043, .device = 0x8095, .action = VIA_DXS_NO_VRA }, /* ASUS A7V8X (FIXME: possibly VIA_DXS_ENABLE?)*/
 		{ .vendor = 0x1043, .device = 0x80a1, .action = VIA_DXS_NO_VRA }, /* ASUS A7V8-X */
 		{ .vendor = 0x1043, .device = 0x80b0, .action = VIA_DXS_NO_VRA }, /* ASUS A7V600 & K8V*/ 
 		{ .vendor = 0x10cf, .device = 0x118e, .action = VIA_DXS_ENABLE }, /* FSC laptop */
@@ -2025,6 +2126,8 @@ static int __devinit check_dxs_list(struct pci_dev *pci)
 		{ .vendor = 0x1462, .device = 0x7120, .action = VIA_DXS_ENABLE }, /* MSI KT4V */
 		{ .vendor = 0x1462, .device = 0x5901, .action = VIA_DXS_NO_VRA }, /* MSI KT6 Delta-SR */
 		{ .vendor = 0x1584, .device = 0x8120, .action = VIA_DXS_ENABLE }, /* Gericom/Targa/Vobis/Uniwill laptop */
+		{ .vendor = 0x161f, .device = 0x202b, .action = VIA_DXS_NO_VRA }, /* Amira Note book */
+		{ .vendor = 0x161f, .device = 0x2032, .action = VIA_DXS_48K }, /* m680x machines */
 		{ .vendor = 0x1631, .device = 0xe004, .action = VIA_DXS_ENABLE }, /* Easy Note 3174, Packard Bell */
 		{ .vendor = 0x1695, .device = 0x3005, .action = VIA_DXS_ENABLE }, /* EPoX EP-8K9A */
 		{ .vendor = 0x1849, .device = 0x3059, .action = VIA_DXS_NO_VRA }, /* ASRock K7VM2 */
@@ -2145,6 +2248,9 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
 		if ((err = snd_via8233_init_misc(chip, dev)) < 0)
 			goto __error;
 	}
+
+	snd_card_set_pm_callback(card, snd_via82xx_suspend, snd_via82xx_resume, chip);
+
 	/* disable interrupts */
 	for (i = 0; i < chip->num_devs; i++)
 		snd_via82xx_channel_reset(chip, &chip->devs[i]);
@@ -2178,19 +2284,12 @@ static struct pci_driver driver = {
 	.id_table = snd_via82xx_ids,
 	.probe = snd_via82xx_probe,
 	.remove = __devexit_p(snd_via82xx_remove),
+	SND_PCI_PM_CALLBACKS
 };
 
 static int __init alsa_card_via82xx_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "VIA 82xx soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_via82xx_exit(void)
@@ -2200,33 +2299,3 @@ static void __exit alsa_card_via82xx_exit(void)
 
 module_init(alsa_card_via82xx_init)
 module_exit(alsa_card_via82xx_exit)
-
-#ifndef MODULE
-
-/* format is: snd-via82xx=enable,index,id,
-			  mpu_port,joystick,
-			  ac97_quirk,ac97_clock,dxs_support */
-
-static int __init alsa_card_via82xx_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
-#ifdef SUPPORT_JOYSTICK
-	       get_option(&str,&joystick[nr_dev]) == 2 &&
-#endif
-	       get_option(&str,&ac97_quirk[nr_dev]) == 2 &&
-	       get_option(&str,&ac97_clock[nr_dev]) == 2 &&
-	       get_option(&str,&dxs_support[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-via82xx=", alsa_card_via82xx_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index e503e93bf..9f4ef46f7 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -23,8 +23,8 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include "vx222.h"
 
@@ -43,20 +43,21 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
 static int mic[SNDRV_CARDS]; /* microphone */
 static int ibl[SNDRV_CARDS]; /* microphone */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Digigram " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Digigram " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(mic, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(mic, bool, boot_devs, 0444);
 MODULE_PARM_DESC(mic, "Enable Microphone.");
 MODULE_PARM_SYNTAX(mic, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
-MODULE_PARM(ibl, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ibl, int, boot_devs, 0444);
 MODULE_PARM_DESC(ibl, "Capture IBL size.");
 MODULE_PARM_SYNTAX(ibl, SNDRV_ENABLED);
 
@@ -272,15 +273,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_vx222_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Digigram VX222 soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_vx222_exit(void)
@@ -290,24 +283,3 @@ static void __exit alsa_card_vx222_exit(void)
 
 module_init(alsa_card_vx222_init)
 module_exit(alsa_card_vx222_exit)
-
-#ifndef MODULE
-
-/* format is: snd-vx222=enable,index,id */
-
-static int __init alsa_card_vx222_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-vx222=", alsa_card_vx222_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index 6f73d05e3..c9dfb2bc1 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -357,7 +357,8 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const snd_hwdep_dsp_image_t *
 {
 	unsigned int i;
 	unsigned int port;
-	unsigned char *image, data;
+	unsigned char data;
+	unsigned char __user *image;
 
 	/* XILINX reset (wait at least 1 milisecond between reset on and off). */
 	vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE | VX_XILINX_RESET_MASK);
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 1fc5d1756..8fbfc24b4 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -23,11 +23,11 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/time.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/ymfpci.h>
 #include <sound/mpu401.h>
 #include <sound/opl3.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
@@ -50,28 +50,29 @@ static long mpu_port[SNDRV_CARDS];
 static long joystick_port[SNDRV_CARDS];
 #endif
 static int rear_switch[SNDRV_CARDS];
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for the Yamaha DS-XG PCI soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for the Yamaha DS-XG PCI soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Yamaha DS-XG soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(mpu_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 Port.");
 MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED);
-MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(fm_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(fm_port, "FM OPL-3 Port.");
 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED);
 #ifdef SUPPORT_JOYSTICK
-MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
+module_param_array(joystick_port, long, boot_devs, 0444);
 MODULE_PARM_DESC(joystick_port, "Joystick port address");
 MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED);
 #endif
-MODULE_PARM(rear_switch, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(rear_switch, bool, boot_devs, 0444);
 MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
 MODULE_PARM_SYNTAX(rear_switch, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 
@@ -311,31 +312,14 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	pci_set_drvdata(pci, chip);
+	pci_set_drvdata(pci, card);
 	dev++;
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int snd_card_ymfpci_suspend(struct pci_dev *pci, u32 state)
-{
-	ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return -ENXIO);
-	snd_ymfpci_suspend(chip);
-	return 0;
-}
-static int snd_card_ymfpci_resume(struct pci_dev *pci)
-{
-	ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return -ENXIO);
-	snd_ymfpci_resume(chip);
-	return 0;
-}
-#endif
-
 static void __devexit snd_card_ymfpci_remove(struct pci_dev *pci)
 {
-	ymfpci_t *chip = snd_magic_cast(ymfpci_t, pci_get_drvdata(pci), return);
-	if (chip)
-		snd_card_free(chip->card);
+	snd_card_free(pci_get_drvdata(pci));
 	pci_set_drvdata(pci, NULL);
 }
 
@@ -344,23 +328,12 @@ static struct pci_driver driver = {
 	.id_table = snd_ymfpci_ids,
 	.probe = snd_card_ymfpci_probe,
 	.remove = __devexit_p(snd_card_ymfpci_remove),
-#ifdef CONFIG_PM
-	.suspend = snd_card_ymfpci_suspend,
-	.resume = snd_card_ymfpci_resume,
-#endif	
+	SND_PCI_PM_CALLBACKS
 };
 
 static int __init alsa_card_ymfpci_init(void)
 {
-	int err;
-
-	if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-		printk(KERN_ERR "Yamaha DS-XG PCI soundcard not found or device busy\n");
-#endif
-		return err;
-	}
-	return 0;
+	return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_ymfpci_exit(void)
@@ -370,27 +343,3 @@ static void __exit alsa_card_ymfpci_exit(void)
 
 module_init(alsa_card_ymfpci_init)
 module_exit(alsa_card_ymfpci_exit)
-
-#ifndef MODULE
-
-/* format is: snd-ymfpci=enable,index,id,
-			 fm_port,mpu_port */
-
-static int __init alsa_card_ymfpci_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&enable[nr_dev]) == 2 &&
-	       get_option(&str,&index[nr_dev]) == 2 &&
-	       get_id(&str,&id[nr_dev]) == 2 &&
-	       get_option_long(&str,&fm_port[nr_dev]) == 2 &&
-	       get_option_long(&str,&mpu_port[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-ymfpci=", alsa_card_ymfpci_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 1449d685b..9d0aa2624 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2157,33 +2157,30 @@ static int saved_regs_index[] = {
 };
 #define YDSXGR_NUM_SAVED_REGS	ARRAY_SIZE(saved_regs_index)
 
-void snd_ymfpci_suspend(ymfpci_t *chip)
+static int snd_ymfpci_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	ymfpci_t *chip = snd_magic_cast(ymfpci_t, card->pm_private_data, return -EINVAL);
 	unsigned int i;
 	
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
 	snd_pcm_suspend_all(chip->pcm);
 	snd_pcm_suspend_all(chip->pcm2);
 	snd_pcm_suspend_all(chip->pcm_spdif);
 	snd_pcm_suspend_all(chip->pcm_4ch);
+	snd_ac97_suspend(chip->ac97);
 	for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++)
 		chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]);
 	chip->saved_ydsxgr_mode = snd_ymfpci_readl(chip, YDSXGR_MODE);
 	snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0);
 	snd_ymfpci_disable_dsp(chip);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-void snd_ymfpci_resume(ymfpci_t *chip)
+static int snd_ymfpci_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	ymfpci_t *chip = snd_magic_cast(ymfpci_t, card->pm_private_data, return -EINVAL);
 	unsigned int i;
 
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
-
 	pci_enable_device(chip->pci);
 	pci_set_master(chip->pci);
 	snd_ymfpci_aclink_reset(chip->pci);
@@ -2205,25 +2202,6 @@ void snd_ymfpci_resume(ymfpci_t *chip)
 		spin_unlock_irqrestore(&chip->reg_lock, flags);
 	}
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-static int snd_ymfpci_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	ymfpci_t *chip = snd_magic_cast(ymfpci_t, card->power_state_private_data, return -ENXIO);
-
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_ymfpci_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_ymfpci_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
 	return 0;
 }
 #endif /* CONFIG_PM */
@@ -2304,8 +2282,7 @@ int __devinit snd_ymfpci_create(snd_card_t * card,
 		snd_ymfpci_free(chip);
 		return -ENOMEM;
 	}
-	card->set_power_state = snd_ymfpci_set_power_state;
-	card->power_state_private_data = chip;
+	snd_card_set_pm_callback(card, snd_ymfpci_suspend, snd_ymfpci_resume, chip);
 #endif
 
 	snd_ymfpci_proc_init(card, chip);
diff --git a/sound/pcmcia/Kconfig b/sound/pcmcia/Kconfig
index 1365d4439..db2e206ba 100644
--- a/sound/pcmcia/Kconfig
+++ b/sound/pcmcia/Kconfig
@@ -20,6 +20,7 @@ config SND_VXP440
 config SND_PDAUDIOCF
 	tristate "Sound Core PDAudioCF"
 	depends on SND && PCMCIA && ISA
+	select SND_PCM
 	help
 	  Say 'Y' or 'M' to include support for Sound Core PDAudioCF soundcard.
 
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 91736b1d6..7b3db54a2 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -21,6 +21,7 @@
 #include <sound/driver.h>
 #include <sound/core.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 #include <pcmcia/version.h>
 #include <pcmcia/ciscode.h>
 #include <pcmcia/cisreg.h>
@@ -44,19 +45,20 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
 static unsigned int irq_mask = 0xffff;
 static int irq_list[4] = { -1 };
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(irq_mask, "i");
+module_param(irq_mask, int, 0444);
 MODULE_PARM_DESC(irq_mask, "IRQ bitmask for " CARD_NAME " soundcard.");
-MODULE_PARM(irq_list, "1-4i");
+module_param_array(irq_list, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq_list, "List of Available interrupts for " CARD_NAME " soundcard.");
  
 
@@ -242,10 +244,7 @@ static int snd_pdacf_assign_resources(pdacf_t *pdacf, int port, int irq)
 	if (err < 0)
 		return err;
 
-#ifdef CONFIG_PM
-	card->power_state_private_data = pdacf;
-	card->set_power_state = snd_pdacf_set_power_state;
-#endif
+	snd_card_set_pm_callback(card, snd_pdacf_suspend, snd_pdacf_resume, pdacf);
 
 	if ((err = snd_card_register(card)) < 0)
 		return err;
@@ -370,7 +369,7 @@ static int pdacf_event(event_t event, int priority, event_callback_args_t *args)
 		link->state |= DEV_SUSPEND;
 		if (chip) {
 			snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n");
-			snd_pdacf_suspend(chip);
+			snd_pdacf_suspend(chip->card, 0);
 		}
 		/* Fall through... */
 	case CS_EVENT_RESET_PHYSICAL:
@@ -389,7 +388,7 @@ static int pdacf_event(event_t event, int priority, event_callback_args_t *args)
 			pcmcia_request_configuration(link->handle, &link->conf);
 			if (chip) {
 				snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n");
-				snd_pdacf_resume(chip);
+				snd_pdacf_resume(chip->card, 0);
 			}
 		}
 		snd_printdd(KERN_DEBUG "resume done!\n");
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h
index a6a63274a..440a92c66 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.h
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h
@@ -136,12 +136,11 @@ pdacf_t *snd_pdacf_create(snd_card_t *card);
 int snd_pdacf_ak4117_create(pdacf_t *pdacf);
 void snd_pdacf_powerdown(pdacf_t *chip);
 #ifdef CONFIG_PM
-void snd_pdacf_suspend(pdacf_t *chip);
-void snd_pdacf_resume(pdacf_t *chip);
-int snd_pdacf_set_power_state(snd_card_t *card, unsigned int power_state);
+int snd_pdacf_suspend(snd_card_t *card, unsigned int state);
+int snd_pdacf_resume(snd_card_t *card, unsigned int state);
 #endif
 int snd_pdacf_pcm_new(pdacf_t *chip);
-void pdacf_interrupt(int irq, void *dev, struct pt_regs *regs);
+irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs);
 void pdacf_tasklet(unsigned long private_data);
 void pdacf_reinit(pdacf_t *chip, int resume);
 
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c
index d8f721eef..7b615fd16 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c
@@ -255,13 +255,11 @@ void snd_pdacf_powerdown(pdacf_t *chip)
 
 #ifdef CONFIG_PM
 
-void snd_pdacf_suspend(pdacf_t *chip)
+int snd_pdacf_suspend(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	pdacf_t *chip = snd_magic_cast(pdacf_t, card->pm_private_data, return -EINVAL);
 	u16 val;
 	
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
 	snd_pcm_suspend_all(chip->pcm);
 	/* disable interrupts, but use direct write to preserve old register value in chip->regmap */
 	val = inw(chip->port + PDAUDIOCF_REG_IER);
@@ -270,6 +268,7 @@ void snd_pdacf_suspend(pdacf_t *chip)
 	chip->chip_status |= PDAUDIOCF_STAT_IS_SUSPENDED;	/* ignore interrupts from now */
 	snd_pdacf_powerdown(chip);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
 static inline int check_signal(pdacf_t *chip)
@@ -277,13 +276,11 @@ static inline int check_signal(pdacf_t *chip)
 	return (chip->ak4117->rcs0 & AK4117_UNLCK) == 0;
 }
 
-void snd_pdacf_resume(pdacf_t *chip)
+int snd_pdacf_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
+	pdacf_t *chip = snd_magic_cast(pdacf_t, card->pm_private_data, return -EINVAL);
 	int timeout = 40;
 
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
 	pdacf_reinit(chip, 1);
 	/* wait for AK4117's PLL */
 	while (timeout-- > 0 &&
@@ -291,26 +288,6 @@ void snd_pdacf_resume(pdacf_t *chip)
 		mdelay(1);
 	chip->chip_status &= ~PDAUDIOCF_STAT_IS_SUSPENDED;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
-}
-
-int snd_pdacf_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	pdacf_t *chip = snd_magic_cast(pdacf_t, card->power_state_private_data, return -ENXIO);
-
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_pdacf_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_pdacf_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
 	return 0;
 }
-
 #endif
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
index bc019ea27..14443f07d 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c
@@ -26,15 +26,15 @@
 /*
  *
  */
-void pdacf_interrupt(int irq, void *dev, struct pt_regs *regs)
+irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs)
 {
-	pdacf_t *chip = snd_magic_cast(pdacf_t, dev, return);
+	pdacf_t *chip = snd_magic_cast(pdacf_t, dev, return IRQ_NONE);
 	unsigned short stat;
 
 	if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE|
 				  PDAUDIOCF_STAT_IS_CONFIGURED|
 				  PDAUDIOCF_STAT_IS_SUSPENDED)) != PDAUDIOCF_STAT_IS_CONFIGURED)
-		return;
+		return IRQ_HANDLED;	/* IRQ_NONE here? */
 
 	stat = inw(chip->port + PDAUDIOCF_REG_ISR);
 	if (stat & (PDAUDIOCF_IRQLVL|PDAUDIOCF_IRQOVR)) {
@@ -47,6 +47,7 @@ void pdacf_interrupt(int irq, void *dev, struct pt_regs *regs)
 	}
 	if (regs != NULL)
 		snd_ak4117_check_rate_and_errors(chip->ak4117, 0);
+	return IRQ_HANDLED;
 }
 
 static inline void pdacf_transfer_mono16(u16 *dst, u16 xor, unsigned int size, unsigned long rdp_port)
diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c
index a23eb4d19..c0e1fd0a8 100644
--- a/sound/pcmcia/vx/vxp_ops.c
+++ b/sound/pcmcia/vx/vxp_ops.c
@@ -152,7 +152,8 @@ static int vxp_load_xilinx_binary(vx_core_t *_chip, const snd_hwdep_dsp_image_t
 	unsigned int i;
 	int c;
 	int regCSUER, regRUER;
-	unsigned char *image, data;
+	unsigned char __user *image;
+	unsigned char data;
 
 	/* Switch to programmation mode */
 	chip->regDIALOG |= VXP_DLG_XILINX_REPROG_MASK;
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 67962cf49..0a9085840 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -32,6 +32,7 @@
 
 #include <sound/driver.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <pcmcia/version.h>
 #include "vxpocket.h"
@@ -58,21 +59,22 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
 static unsigned int irq_mask = 0xffff;
 static int irq_list[4] = { -1 };
 static int ibl[SNDRV_CARDS];
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(irq_mask, "i");
+module_param(irq_mask, int, 0444);
 MODULE_PARM_DESC(irq_mask, "IRQ bitmask for " CARD_NAME " soundcard.");
-MODULE_PARM(irq_list, "1-4i");
+module_param_array(irq_list, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq_list, "List of Available interrupts for " CARD_NAME " soundcard.");
-MODULE_PARM(ibl, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(ibl, int, boot_devs, 0444);
 MODULE_PARM_DESC(ibl, "Capture IBL size for " CARD_NAME " soundcard.");
 MODULE_PARM_SYNTAX(ibl, SNDRV_ENABLED);
  
diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c
index cf523a6f6..c4904895d 100644
--- a/sound/ppc/keywest.c
+++ b/sound/ppc/keywest.c
@@ -79,12 +79,7 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
 
 	new_client->id = keywest_ctx->id++; /* Automatically unique */
 	keywest_ctx->client = new_client;
-
-	if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
-		snd_printk(KERN_ERR "tumbler: cannot initialize the MCS\n");
-		goto __err;
-	}
-
+	
 	/* Tell the i2c layer a new client has arrived */
 	if (i2c_attach_client(new_client)) {
 		snd_printk(KERN_ERR "tumbler: cannot attach i2c client\n");
@@ -121,6 +116,17 @@ void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c)
 	}
 }
 
+int __init snd_pmac_tumbler_post_init(void)
+{
+	int err;
+	
+	if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
+		snd_printk(KERN_ERR "tumbler: %i :cannot initialize the MCS\n", err);
+		return err;
+	}
+	return 0;
+}
+
 /* exported */
 int __init snd_pmac_keywest_init(pmac_keywest_t *i2c)
 {
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 5f94c59f2..95dfeef91 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -42,7 +42,8 @@
 #if defined(CONFIG_PM) && defined(CONFIG_PMAC_PBOOK)
 static int snd_pmac_register_sleep_notifier(pmac_t *chip);
 static int snd_pmac_unregister_sleep_notifier(pmac_t *chip);
-static int snd_pmac_set_power_state(snd_card_t *card, unsigned int power_state);
+static int snd_pmac_suspend(snd_card_t *card, unsigned int state);
+static int snd_pmac_resume(snd_card_t *card, unsigned int state);
 #endif
 
 
@@ -687,7 +688,7 @@ static void snd_pmac_dbdma_reset(pmac_t *chip)
 static irqreturn_t
 snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs)
 {
-	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
+	pmac_t *chip = snd_magic_cast(pmac_t, devid, return IRQ_NONE);
 	snd_pmac_pcm_update(chip, &chip->playback);
 	return IRQ_HANDLED;
 }
@@ -696,7 +697,7 @@ snd_pmac_tx_intr(int irq, void *devid, struct pt_regs *regs)
 static irqreturn_t
 snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs)
 {
-	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
+	pmac_t *chip = snd_magic_cast(pmac_t, devid, return IRQ_NONE);
 	snd_pmac_pcm_update(chip, &chip->capture);
 	return IRQ_HANDLED;
 }
@@ -705,7 +706,7 @@ snd_pmac_rx_intr(int irq, void *devid, struct pt_regs *regs)
 static irqreturn_t
 snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs)
 {
-	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
+	pmac_t *chip = snd_magic_cast(pmac_t, devid, return IRQ_NONE);
 	int ctrl = in_le32(&chip->awacs->control);
 
 	/*printk("pmac: control interrupt.. 0x%x\n", ctrl);*/
@@ -1170,9 +1171,8 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
 
 #if defined(CONFIG_PM) && defined(CONFIG_PMAC_PBOOK)
 	/* add sleep notifier */
-	snd_pmac_register_sleep_notifier(chip);
-	card->set_power_state = snd_pmac_set_power_state;
-	card->power_state_private_data = chip;
+	if (! snd_pmac_register_sleep_notifier(chip))
+		snd_card_set_pm_callback(chip->card, snd_pmac_suspend, snd_pmac_resume, chip);
 #endif
 
 	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
@@ -1197,13 +1197,10 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
  * Save state when going to sleep, restore it afterwards.
  */
 
-static void snd_pmac_suspend(pmac_t *chip)
+static int snd_pmac_suspend(snd_card_t *card, unsigned int state)
 {
+	pmac_t *chip = snd_magic_cast(pmac_t, card->pm_private_data, return -EINVAL);
 	unsigned long flags;
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D3hot)
-		return;
 
 	if (chip->suspend)
 		chip->suspend(chip);
@@ -1219,14 +1216,12 @@ static void snd_pmac_suspend(pmac_t *chip)
 		disable_irq(chip->rx_irq);
 	snd_pmac_sound_feature(chip, 0);
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+	return 0;
 }
 
-static void snd_pmac_resume(pmac_t *chip)
+static int snd_pmac_resume(snd_card_t *card, unsigned int state)
 {
-	snd_card_t *card = chip->card;
-
-	if (card->power_state == SNDRV_CTL_POWER_D0)
-		return;
+	pmac_t *chip = snd_magic_cast(pmac_t, card->pm_private_data, return -EINVAL);
 
 	snd_pmac_sound_feature(chip, 1);
 	if (chip->resume)
@@ -1248,6 +1243,7 @@ static void snd_pmac_resume(pmac_t *chip)
 		enable_irq(chip->rx_irq);
 
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
+	return 0;
 }
 
 /* the chip is stored statically by snd_pmac_register_sleep_notifier
@@ -1264,10 +1260,10 @@ static int snd_pmac_sleep_notify(struct pmu_sleep_notifier *self, int when)
 
 	switch (when) {
 	case PBOOK_SLEEP_NOW:
-		snd_pmac_suspend(chip);
+		snd_pmac_suspend(chip->card, 0);
 		break;
 	case PBOOK_WAKE:
-		snd_pmac_resume(chip);
+		snd_pmac_resume(chip->card, 0);
 		break;
 	}
 	return PBOOK_SLEEP_OK;
@@ -1280,46 +1276,19 @@ static struct pmu_sleep_notifier snd_pmac_sleep_notifier = {
 static int __init snd_pmac_register_sleep_notifier(pmac_t *chip)
 {
 	/* should be protected here.. */
-	if (sleeping_pmac) {
-		snd_printd("sleep notifier already reigistered\n");
-		return -EBUSY;
-	}
+	snd_assert(! sleeping_pmac, return -EBUSY);
 	sleeping_pmac = chip;
 	pmu_register_sleep_notifier(&snd_pmac_sleep_notifier);
-	chip->sleep_registered = 1;
 	return 0;
 }
 						    
 static int snd_pmac_unregister_sleep_notifier(pmac_t *chip)
 {
-	if (! chip->sleep_registered)
-		return 0;
 	/* should be protected here.. */
-	if (sleeping_pmac != chip)
-		return -ENODEV;
+	snd_assert(sleeping_pmac == chip, return -ENODEV);
 	pmu_unregister_sleep_notifier(&snd_pmac_sleep_notifier);
 	sleeping_pmac = NULL;
 	return 0;
 }
 
-/* callback */
-static int snd_pmac_set_power_state(snd_card_t *card, unsigned int power_state)
-{
-	pmac_t *chip = snd_magic_cast(pmac_t, card->power_state_private_data, return -ENXIO);
-	switch (power_state) {
-	case SNDRV_CTL_POWER_D0:
-	case SNDRV_CTL_POWER_D1:
-	case SNDRV_CTL_POWER_D2:
-		snd_pmac_resume(chip);
-		break;
-	case SNDRV_CTL_POWER_D3hot:
-	case SNDRV_CTL_POWER_D3cold:
-		snd_pmac_suspend(chip);
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 #endif /* CONFIG_PM && CONFIG_PMAC_PBOOK */
diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h
index a4d4bca63..252ea0311 100644
--- a/sound/ppc/pmac.h
+++ b/sound/ppc/pmac.h
@@ -162,7 +162,6 @@ struct snd_pmac {
 	void (*update_automute)(pmac_t *chip, int do_notify);
 	int (*detect_headphone)(pmac_t *chip);
 #ifdef CONFIG_PMAC_PBOOK
-	unsigned int sleep_registered : 1;
 	void (*suspend)(pmac_t *chip);
 	void (*resume)(pmac_t *chip);
 #endif
@@ -180,6 +179,7 @@ int snd_pmac_awacs_init(pmac_t *chip);
 int snd_pmac_burgundy_init(pmac_t *chip);
 int snd_pmac_daca_init(pmac_t *chip);
 int snd_pmac_tumbler_init(pmac_t *chip);
+int snd_pmac_tumbler_post_init(void);
 
 /* i2c functions */
 typedef struct snd_pmac_keywest {
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index c46e69edc..3c4550ae6 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -20,8 +20,8 @@
 
 #include <sound/driver.h>
 #include <linux/init.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include "pmac.h"
 #include "awacs.h"
@@ -41,17 +41,17 @@ static char *id = SNDRV_DEFAULT_STR1;		/* ID for this card */
 static int enable_beep = 1;
 #endif
 
-MODULE_PARM(index, "i");
+module_param(index, int, 0444);
 MODULE_PARM_DESC(index, "Index value for " CHIP_NAME " soundchip.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "s");
+module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for " CHIP_NAME " soundchip.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-/* MODULE_PARM(enable, "i");
+/* module_param(enable, bool, 0444);
    MODULE_PARM_DESC(enable, "Enable this soundchip.");
    MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); */
 #ifdef PMAC_SUPPORT_PCM_BEEP
-MODULE_PARM(enable_beep, "i");
+module_param(enable_beep, bool, 0444);
 MODULE_PARM_DESC(enable_beep, "Enable beep using PCM.");
 MODULE_PARM_SYNTAX(enable_beep, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
 #endif
@@ -104,7 +104,7 @@ static int __init snd_pmac_probe(void)
 		sprintf(card->shortname, "PowerMac %s", name_ext);
 		sprintf(card->longname, "%s (Dev %d) Sub-frame %d",
 			card->shortname, chip->device_id, chip->subframe);
-		if ((err = snd_pmac_tumbler_init(chip)) < 0)
+		if ( snd_pmac_tumbler_init(chip) < 0 || snd_pmac_tumbler_post_init() < 0)
 			goto __error;
 		break;
 	case PMAC_AWACS:
@@ -175,26 +175,3 @@ static void __exit alsa_card_pmac_exit(void)
 
 module_init(alsa_card_pmac_init)
 module_exit(alsa_card_pmac_exit)
-
-#ifndef MODULE
-
-/* format is: snd-pmac=enable,index,id,enable_beep
- */
-
-static int __init alsa_card_pmac_setup(char *str)
-{
-	int __attribute__ ((__unused__)) enable = 1;
-
-	(void)(get_option(&str,&enable) == 2 &&
-	       get_option(&str,&index) == 2 &&
-	       get_id(&str,&id) == 2
-#ifdef PMAC_SUPPORT_PCM_BEEP
-	       && get_option(&str,&enable_beep) == 2
-#endif
-	       );
-	return 1;
-}
-
-__setup("snd-pmac=", alsa_card_pmac_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index fc94acb26..42b55b600 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -684,6 +684,8 @@ static int tumbler_put_mute_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_
 
 static int snapper_set_capture_source(pmac_tumbler_t *mix)
 {
+	if (! mix->i2c.client)
+		return -ENODEV;
 	return snd_pmac_keywest_write_byte(&mix->i2c, TAS_REG_ACS,
 					   mix->capture_source ? 2 : 0);
 }
@@ -870,7 +872,7 @@ static void tumbler_update_automute(pmac_t *chip, int do_notify)
 /* interrupt - headphone plug changed */
 static irqreturn_t headphone_intr(int irq, void *devid, struct pt_regs *regs)
 {
-	pmac_t *chip = snd_magic_cast(pmac_t, devid, return);
+	pmac_t *chip = snd_magic_cast(pmac_t, devid, return IRQ_NONE);
 	if (chip->update_automute && chip->initialized) {
 		chip->update_automute(chip, 1);
 		return IRQ_HANDLED;
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index b70c84dc1..993d0fb7a 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -34,13 +34,13 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/moduleparam.h>
 
 #include <sound/driver.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
 #include <sound/control.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -50,14 +50,15 @@
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Sun AMD7930 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Sun AMD7930 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Sun AMD7930 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_AUTHOR("Thomas K. Dyas and David S. Miller");
@@ -1152,24 +1153,3 @@ static void __exit amd7930_exit(void)
 
 module_init(amd7930_init);
 module_exit(amd7930_exit);
-
-#ifndef MODULE
-
-/* format is: snd-sun-amd7930=index,id,enable */
-
-static int __init alsa_card_sun_amd7930_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&index[nr_dev]) == 2 &&
-	       get_option(&str,&id[nr_dev]) == 2 &&
-	       get_id(&str,&enable[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-sun-amd7930=", alsa_card_sun_amd7930_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index fb0ef1aca..00a845e28 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/moduleparam.h>
 
 #include <sound/driver.h>
 #include <sound/core.h>
@@ -22,7 +23,6 @@
 #include <sound/info.h>
 #include <sound/control.h>
 #include <sound/timer.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 #include <sound/pcm_params.h>
 
@@ -49,14 +49,15 @@
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Sun CS4231 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Sun CS4231 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Sun CS4231 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_AUTHOR("Jaroslav Kysela, Derrick J. Brashear and David S. Miller");
@@ -2251,24 +2252,3 @@ static void __exit cs4231_exit(void)
 
 module_init(cs4231_init);
 module_exit(cs4231_exit);
-
-#ifndef MODULE
-
-/* format is: snd-sun-cs4231=index,id,enable */
-
-static int __init alsa_card_sun_cs4231_setup(char *str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str,&index[nr_dev]) == 2 &&
-	       get_option(&str,&id[nr_dev]) == 2 &&
-	       get_id(&str,&enable[nr_dev]) == 2);
-	nr_dev++;
-	return 1;
-}
-
-__setup("snd-sun-cs4231=", alsa_card_sun_cs4231_setup);
-
-#endif /* ifndef MODULE */
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index 3db41a7c1..979252146 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -34,7 +34,7 @@
 static int snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure);
 static int snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg);
 static int snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg);
-static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char *buf, int offs, int count);
+static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count);
 static int snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg);
 static int snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop);
 static void reset_port_mode(snd_emux_port_t *port, int midi_mode);
@@ -201,7 +201,7 @@ snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg)
  */
 static int
 snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
-			    const char *buf, int offs, int count)
+			    const char __user *buf, int offs, int count)
 {
 	snd_emux_t *emu;
 	snd_emux_port_t *p;
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index a536d9f05..8db2e2db5 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -34,7 +34,7 @@
 
 /* Prototypes for static functions */
 
-static int open_patch(snd_sf_list_t *sflist, const char *data, int count, int client);
+static int open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client);
 static snd_soundfont_t *newsf(snd_sf_list_t *sflist, int type, char *name);
 static int is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name);
 static int close_patch(snd_sf_list_t *sflist);
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 1a7ab1bd0..38f415e33 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -45,11 +45,11 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/usb.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include "usbaudio.h"
@@ -69,26 +69,27 @@ static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Vendor ID for
 static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Product ID for this card */
 static int nrpacks = 4;		/* max. number of packets per urb */
 static int async_unlink = 1;
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for the USB audio adapter.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for the USB audio adapter.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable USB audio adapter.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(vid, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(vid, int, boot_devs, 0444);
 MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device.");
 MODULE_PARM_SYNTAX(vid, SNDRV_ENABLED ",allows:{{-1,0xffff}},base:16");
-MODULE_PARM(pid, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(pid, int, boot_devs, 0444);
 MODULE_PARM_DESC(pid, "Product ID for the USB audio device.");
 MODULE_PARM_SYNTAX(pid, SNDRV_ENABLED ",allows:{{-1,0xffff}},base:16");
-MODULE_PARM(nrpacks, "i");
+module_param(nrpacks, int, 0444);
 MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB.");
 MODULE_PARM_SYNTAX(nrpacks, SNDRV_ENABLED ",allows:{{1,10}}");
-MODULE_PARM(async_unlink, "i");
+module_param(async_unlink, bool, 0444);
 MODULE_PARM_DESC(async_unlink, "Use async unlink mode.");
 MODULE_PARM_SYNTAX(async_unlink, SNDRV_BOOLEAN_TRUE_DESC);
 
@@ -1146,7 +1147,7 @@ static int init_usb_pitch(struct usb_device *dev, int iface,
 	/* if endpoint has pitch control, enable it */
 	if (fmt->attributes & EP_CS_ATTR_PITCH_CONTROL) {
 		data[0] = 1;
-		if ((err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR,
+		if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR,
 					   USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, 
 					   PITCH_CONTROL << 8, ep, data, 1, HZ)) < 0) {
 			snd_printk(KERN_ERR "%d:%d:%d: cannot set enable PITCH\n",
@@ -1172,14 +1173,14 @@ static int init_usb_sample_rate(struct usb_device *dev, int iface,
 		data[0] = rate;
 		data[1] = rate >> 8;
 		data[2] = rate >> 16;
-		if ((err = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR,
+		if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR,
 					   USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, 
 					   SAMPLING_FREQ_CONTROL << 8, ep, data, 3, HZ)) < 0) {
 			snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep 0x%x\n",
 				   dev->devnum, iface, fmt->altsetting, rate, ep);
 			return err;
 		}
-		if ((err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR,
+		if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR,
 					   USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN,
 					   SAMPLING_FREQ_CONTROL << 8, ep, data, 3, HZ)) < 0) {
 			snd_printk(KERN_ERR "%d:%d:%d: cannot get freq at ep 0x%x\n",
@@ -1231,7 +1232,7 @@ static int set_format(snd_usb_substream_t *subs, struct audioformat *fmt)
 				   dev->devnum, fmt->iface, fmt->altsetting);
 			return -EIO;
 		}
-		snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altset_idx);
+		snd_printdd(KERN_INFO "setting usb interface %d:%d\n", fmt->iface, fmt->altsetting);
 		subs->interface = fmt->iface;
 		subs->format = fmt->altset_idx;
 	}
@@ -1884,6 +1885,32 @@ void *snd_usb_find_csint_desc(void *buffer, int buflen, void *after, u8 dsubtype
 	return NULL;
 }
 
+/*
+ * Wrapper for usb_control_msg().
+ * Allocates a temp buffer to prevent dmaing from/to the stack.
+ */
+int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
+		    __u8 requesttype, __u16 value, __u16 index, void *data,
+		    __u16 size, int timeout)
+{
+	int err;
+	void *buf = NULL;
+
+	if (size > 0) {
+		buf = kmalloc(size, GFP_KERNEL);
+		if (!buf)
+			return -ENOMEM;
+		memcpy(buf, data, size);
+	}
+	err = usb_control_msg(dev, pipe, request, requesttype,
+			      value, index, buf, size, timeout);
+	if (size > 0) {
+		memcpy(data, buf, size);
+		kfree(buf);
+	}
+	return err;
+}
+
 
 /*
  * entry point for linux usb interface
@@ -1926,7 +1953,7 @@ static void proc_dump_substream_formats(snd_usb_substream_t *subs, snd_info_buff
 		struct audioformat *fp;
 		fp = list_entry(p, struct audioformat, list);
 		snd_iprintf(buffer, "  Interface %d\n", fp->iface);
-		snd_iprintf(buffer, "    Altset %d\n", fp->altset_idx);
+		snd_iprintf(buffer, "    Altset %d\n", fp->altsetting);
 		snd_iprintf(buffer, "    Format: %s\n", snd_pcm_format_name(fp->format));
 		snd_iprintf(buffer, "    Channels: %d\n", fp->channels);
 		snd_iprintf(buffer, "    Endpoint: %d %s (%s)\n",
@@ -2640,6 +2667,7 @@ static int create_fixed_stream_quirk(snd_usb_audio_t *chip,
 	struct audioformat *fp;
 	struct usb_host_interface *alts;
 	int stream, err;
+	int *rate_table = NULL;
 
 	fp = kmalloc(sizeof(*fp), GFP_KERNEL);
 	if (! fp) {
@@ -2647,16 +2675,30 @@ static int create_fixed_stream_quirk(snd_usb_audio_t *chip,
 		return -ENOMEM;
 	}
 	memcpy(fp, quirk->data, sizeof(*fp));
+	if (fp->nr_rates > 0) {
+		rate_table = kmalloc(sizeof(int) * fp->nr_rates, GFP_KERNEL);
+		if (!rate_table) {
+			kfree(fp);
+			return -ENOMEM;
+		}
+		memcpy(rate_table, fp->rate_table, sizeof(int) * fp->nr_rates);
+		fp->rate_table = rate_table;
+	}
+
 	stream = (fp->endpoint & USB_DIR_IN)
 		? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
 	err = add_audio_endpoint(chip, stream, fp);
 	if (err < 0) {
 		kfree(fp);
+		if (rate_table)
+			kfree(rate_table);
 		return err;
 	}
 	if (fp->iface != get_iface_desc(&iface->altsetting[0])->bInterfaceNumber ||
 	    fp->altset_idx >= iface->num_altsetting) {
 		kfree(fp);
+		if (rate_table)
+			kfree(rate_table);
 		return -EINVAL;
 	}
 	alts = &iface->altsetting[fp->altset_idx];
@@ -2700,6 +2742,83 @@ static int create_standard_interface_quirk(snd_usb_audio_t *chip,
 	return 0;
 }
 
+/*
+ * Create a stream for an Edirol UA-700 interface.  The only way
+ * to detect the sample rate is by looking at wMaxPacketSize.
+ */
+static int create_ua700_quirk(snd_usb_audio_t *chip, struct usb_interface *iface)
+{
+	static const struct audioformat ua700_format = {
+		.format = SNDRV_PCM_FORMAT_S24_3LE,
+		.channels = 2,
+		.fmt_type = USB_FORMAT_TYPE_I,
+		.altsetting = 1,
+		.altset_idx = 1,
+		.rates = SNDRV_PCM_RATE_CONTINUOUS,
+	};
+	struct usb_host_interface *alts;
+	struct usb_interface_descriptor *altsd;
+	struct audioformat *fp;
+	int stream, err;
+
+	/* both PCM and MIDI interfaces have 2 altsettings */
+	if (iface->num_altsetting != 2)
+		return -ENXIO;
+	alts = &iface->altsetting[1];
+	altsd = get_iface_desc(alts);
+
+	if (altsd->bNumEndpoints == 2) {
+		static const snd_usb_midi_endpoint_info_t ep = {
+			.out_cables = 0x0003,
+			.in_cables  = 0x0003
+		};
+		static const snd_usb_audio_quirk_t quirk = {
+			.type = QUIRK_MIDI_FIXED_ENDPOINT,
+			.data = &ep
+		};
+		return snd_usb_create_midi_interface(chip, iface, &quirk);
+	}
+
+	if (altsd->bNumEndpoints != 1)
+		return -ENXIO;
+
+	fp = kmalloc(sizeof(*fp), GFP_KERNEL);
+	if (!fp)
+		return -ENOMEM;
+	memcpy(fp, &ua700_format, sizeof(*fp));
+
+	fp->iface = altsd->bInterfaceNumber;
+	fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
+	fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
+	fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
+
+	switch (fp->maxpacksize) {
+	case 0x120:
+		fp->rate_max = fp->rate_min = 44100;
+		break;
+	case 0x138:
+		fp->rate_max = fp->rate_min = 48000;
+		break;
+	case 0x258:
+		fp->rate_max = fp->rate_min = 96000;
+		break;
+	default:
+		snd_printk(KERN_ERR "unknown sample rate\n");
+		kfree(fp);
+		return -ENXIO;
+	}
+
+	stream = (fp->endpoint & USB_DIR_IN)
+		? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
+	err = add_audio_endpoint(chip, stream, fp);
+	if (err < 0) {
+		kfree(fp);
+		return err;
+	}
+	usb_set_interface(chip->dev, fp->iface, 0);
+	return 0;
+}
+
 static int snd_usb_create_quirk(snd_usb_audio_t *chip,
 				struct usb_interface *iface,
 				const snd_usb_audio_quirk_t *quirk);
@@ -2747,7 +2866,7 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac
 	    get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_NEW) {
 		snd_printdd("sending Extigy boot sequence...\n");
 		/* Send message to force it to reconnect with full interface. */
-		err = usb_control_msg(dev, usb_sndctrlpipe(dev,0),
+		err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0),
 				      0x10, 0x43, 0x0001, 0x000a, NULL, 0, HZ);
 		if (err < 0) snd_printdd("error sending boot message: %d\n", err);
 		err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
@@ -2787,6 +2906,8 @@ static int snd_usb_create_quirk(snd_usb_audio_t *chip,
 	case QUIRK_AUDIO_STANDARD_INTERFACE:
 	case QUIRK_MIDI_STANDARD_INTERFACE:
 		return create_standard_interface_quirk(chip, iface, quirk);
+	case QUIRK_AUDIO_EDIROL_UA700:
+		return create_ua700_quirk(chip, iface);
 	default:
 		snd_printd(KERN_ERR "invalid quirk type %d\n", quirk->type);
 		return -ENXIO;
@@ -3124,26 +3245,3 @@ static void __exit snd_usb_audio_cleanup(void)
 
 module_init(snd_usb_audio_init);
 module_exit(snd_usb_audio_cleanup);
-
-#ifndef MODULE
-/*
- * format is snd-usb-audio=enable,index,id,vid,pid
- */
-static int __init snd_usb_audio_module_setup(char* str)
-{
-	static unsigned __initdata nr_dev = 0;
-
-	if (nr_dev >= SNDRV_CARDS)
-		return 0;
-	(void)(get_option(&str, &enable[nr_dev]) == 2 &&
-	       get_option(&str, &index[nr_dev]) == 2 &&
-	       get_id(&str, &id[nr_dev]) == 2 &&
-	       get_option(&str, &vid[nr_dev]) == 2 &&
-	       get_option(&str, &pid[nr_dev]) == 2);
-	++nr_dev;
-	return 1;
-}
-
-__setup("snd-usb-audio=", snd_usb_audio_module_setup);
-
-#endif /* !MODULE */
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 064194c9f..2fe29989e 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -154,6 +154,7 @@ struct snd_usb_audio {
 #define QUIRK_AUDIO_FIXED_ENDPOINT	4
 #define QUIRK_AUDIO_STANDARD_INTERFACE	5
 #define QUIRK_MIDI_STANDARD_INTERFACE	6
+#define QUIRK_AUDIO_EDIROL_UA700	7
 
 typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t;
 typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t;
@@ -185,6 +186,8 @@ struct snd_usb_midi_endpoint_info {
 
 /* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */
 
+/* for QUIRK_AUDIO_EDIROL_UA700, data is NULL */
+
 /*
  */
 
@@ -197,6 +200,8 @@ unsigned int snd_usb_combine_bytes(unsigned char *bytes, int size);
 void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype);
 void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsubtype);
 
+int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout);
+
 int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif);
 
 int snd_usb_create_midi_interface(snd_usb_audio_t *chip, struct usb_interface *iface, const snd_usb_audio_quirk_t *quirk);
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index afbf51f9f..a17d3f82d 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -301,7 +301,7 @@ static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
 	int timeout = 10;
  
 	while (timeout-- > 0) {
-		if (usb_control_msg(cval->chip->dev, usb_rcvctrlpipe(cval->chip->dev, 0),
+		if (snd_usb_ctl_msg(cval->chip->dev, usb_rcvctrlpipe(cval->chip->dev, 0),
 				    request,
 				    USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
 				    validx, cval->ctrlif | (cval->id << 8),
@@ -339,7 +339,7 @@ static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
 	buf[0] = value_set & 0xff;
 	buf[1] = (value_set >> 8) & 0xff;
 	while (timeout -- > 0)
-		if (usb_control_msg(cval->chip->dev, usb_sndctrlpipe(cval->chip->dev, 0),
+		if (snd_usb_ctl_msg(cval->chip->dev, usb_sndctrlpipe(cval->chip->dev, 0),
 				    request,
 				    USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
 				    validx, cval->ctrlif | (cval->id << 8),
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 29989b61d..889798b2b 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -113,7 +113,7 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		.product_name = "UA-100",
 		.ifnum = QUIRK_ANY_INTERFACE,
 		.type = QUIRK_COMPOSITE,
-		.data = & (const snd_usb_audio_quirk_t[]) {
+		.data = (const snd_usb_audio_quirk_t[]) {
 			{
 				.ifnum = 0,
 				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
@@ -274,7 +274,7 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		.product_name = "SC-D70",
 		.ifnum = QUIRK_ANY_INTERFACE,
 		.type = QUIRK_COMPOSITE,
-		.data = & (const snd_usb_audio_quirk_t[]) {
+		.data = (const snd_usb_audio_quirk_t[]) {
 			{
 				.ifnum = 0,
 				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
@@ -338,7 +338,7 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		.product_name = "UA-5",
 		.ifnum = QUIRK_ANY_INTERFACE,
 		.type = QUIRK_COMPOSITE,
-		.data = & (const snd_usb_audio_quirk_t[]) {
+		.data = (const snd_usb_audio_quirk_t[]) {
 			{
 				.ifnum = 1,
 				.type = QUIRK_AUDIO_STANDARD_INTERFACE
@@ -443,7 +443,7 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		.product_name = "UA-20",
 		.ifnum = QUIRK_ANY_INTERFACE,
 		.type = QUIRK_COMPOSITE,
-		.data = & (const snd_usb_audio_quirk_t[]) {
+		.data = (const snd_usb_audio_quirk_t[]) {
 			{
 				.ifnum = 1,
 				.type = QUIRK_AUDIO_STANDARD_INTERFACE
@@ -488,16 +488,34 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		}
 	}
 },
-{
+{	/*
+	 * This quirk is for the "Advanced" modes of the Edirol UA-700.
+	 * If the sample format switch is not in an advanced setting, the
+	 * UA-700 has ID 0x0582/0x002c and is standard compliant (no quirks),
+	 * but offers only 16-bit PCM and no MIDI.
+	 */
 	USB_DEVICE_VENDOR_SPEC(0x0582, 0x002b),
 	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
 		.vendor_name = "EDIROL",
 		.product_name = "UA-700",
-		.ifnum = 3,
-		.type = QUIRK_MIDI_FIXED_ENDPOINT,
-		.data = & (const snd_usb_midi_endpoint_info_t) {
-			.out_cables = 0x0003,
-			.in_cables  = 0x0003
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const snd_usb_audio_quirk_t[]) {
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_EDIROL_UA700
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_EDIROL_UA700
+			},
+			{
+				.ifnum = 3,
+				.type = QUIRK_AUDIO_EDIROL_UA700
+			},
+			{
+				.ifnum = -1
+			}
 		}
 	}
 },
@@ -579,6 +597,62 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		}
 	}
 },
+{
+	USB_DEVICE(0x0582, 0x0044),
+	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
+		.vendor_name = "Roland",
+		.product_name = "UA-1000",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = (const snd_usb_audio_quirk_t[]) {
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.format = SNDRV_PCM_FORMAT_S24,
+					.channels = 12,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.attributes = 0,
+					.endpoint = 0x81,
+					.ep_attr = 0x01,
+					.rates = SNDRV_PCM_RATE_CONTINUOUS,
+					.rate_min = 48000,
+					.rate_max = 48000,
+				}
+			},
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = & (const struct audioformat) {
+					.format = SNDRV_PCM_FORMAT_S24,
+					.channels = 10,
+					.iface = 2,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.attributes = 0,
+					.endpoint = 0x02,
+					.ep_attr = 0x01,
+					.rates = SNDRV_PCM_RATE_CONTINUOUS,
+					.rate_min = 48000,
+					.rate_max = 48000,
+				}
+			},
+			{
+				.ifnum = 3,
+				.type = QUIRK_MIDI_FIXED_ENDPOINT,
+				.data = & (const snd_usb_midi_endpoint_info_t) {
+					.out_cables = 0x0003,
+					.in_cables  = 0x0003
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
 {
 	USB_DEVICE(0x0582, 0x0048),
 	.driver_info = (unsigned long) & (const snd_usb_audio_quirk_t) {
@@ -629,7 +703,7 @@ YAMAHA_DEVICE(0x5008, "01V96"),
 		.product_name = "UA-3FX",
 		.ifnum = QUIRK_ANY_INTERFACE,
 		.type = QUIRK_COMPOSITE,
-		.data = & (const snd_usb_audio_quirk_t[]) {
+		.data = (const snd_usb_audio_quirk_t[]) {
 			{
 				.ifnum = 1,
 				.type = QUIRK_AUDIO_STANDARD_INTERFACE
-- 
2.47.0